Built motion from commit 39a99f00.|2.6.10
authorsupport <support@xcally.com>
Fri, 27 May 2022 06:50:16 +0000 (06:50 +0000)
committersupport <support@xcally.com>
Fri, 27 May 2022 06:50:16 +0000 (06:50 +0000)
1202 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.events.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmContactHasItem/cmContactHasItem.attributes.js
server/api/cmContactHasItem/cmContactHasItem.controller.js
server/api/cmContactHasItem/cmContactHasItem.model.js
server/api/cmContactHasItem/cmContactHasItem.rpc.js
server/api/cmContactHasItem/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
server/api/cmHopperAdditionalPhone/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/contactItemType/contactItemType.attributes.js
server/api/contactItemType/contactItemType.controller.js
server/api/contactItemType/contactItemType.model.js
server/api/contactItemType/contactItemType.rpc.js
server/api/contactItemType/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/contacts/index.js
server/components/contacts/sql-utils.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/import/cm/csvUpdates.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/interaction/sql-utils.js
server/components/interaction/update-interaction.js
server/components/interaction/utils.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/components/realtime/agents.js
server/components/realtime/queues.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/cloud-provider.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/api.js
server/errors/index.js
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/events.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/project.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/index.js
server/services/ami/dialer/models/action.js
server/services/ami/dialer/models/agentComplete.js
server/services/ami/dialer/models/final.js
server/services/ami/dialer/models/hangup.js
server/services/ami/dialer/models/history.js
server/services/ami/dialer/models/queueCallerAbandon.js
server/services/ami/dialer/utils/hopper.js
server/services/ami/dialer/utils/index.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/voiceQueueSummary.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/realtime/utils.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperAdditionalPhone.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/interval.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/iftime.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index b1e2031..7860508 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-05-26T14:30:32.770Z",
+    "time": "2022-05-27T06:42:42.549Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 26b6111..ac47c8e 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-05-26T14:30:32.770Z",
+    "time": "2022-05-27T06:42:42.549Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 32b8956..4893977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1445=['motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','VIRTUAL','action','STRING','contactManager'];(function(_0xd2218a,_0x341cc9){var _0x4fd180=function(_0x485dcd){while(--_0x485dcd){_0xd2218a['push'](_0xd2218a['shift']());}};_0x4fd180(++_0x341cc9);}(_0x1445,0x1bb));var _0x5144=function(_0x191c60,_0x5c0dd8){_0x191c60=_0x191c60-0x0;var _0x3c60e7=_0x1445[_0x191c60];return _0x3c60e7;};'use strict';var Sequelize=require(_0x5144('0x0'));module['exports']={'name':{'type':Sequelize[_0x5144('0x1')],'get':function(_0x2c71bd){return this['getDataValue'](_0x5144('0x2'));}},'action':{'type':Sequelize[_0x5144('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5144('0x4'),'integration',_0x5144('0x5'),'jscripty','urlForward',_0x5144('0x6'),_0x5144('0x7'),_0x5144('0x8')]],'msg':_0x5144('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5144('0xa')},'data2':{'type':Sequelize[_0x5144('0x3')](0x1000),'comment':_0x5144('0xb')},'data3':{'type':Sequelize['STRING'](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[_0x5144('0x3')](0x1000),'comments':_0x5144('0xc')},'data5':{'type':Sequelize[_0x5144('0x3')](0x1000),'comments':_0x5144('0xd')},'data6':{'type':Sequelize[_0x5144('0x3')],'comments':_0x5144('0xe')},'data7':{'type':Sequelize[_0x5144('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x16e9=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x5a74da,_0xb4b3e3){var _0x79fbc3=function(_0x238354){while(--_0x238354){_0x5a74da['push'](_0x5a74da['shift']());}};_0x79fbc3(++_0xb4b3e3);}(_0x16e9,0x144));var _0x916e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x916e('0x0')]={'name':{'type':Sequelize[_0x916e('0x1')],'get':function(_0x46c7ba){return this[_0x916e('0x2')](_0x916e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x916e('0x4'),_0x916e('0x5'),_0x916e('0x6'),_0x916e('0x7'),'urlForward','browser',_0x916e('0x8'),_0x916e('0x9')]],'msg':_0x916e('0xa')}},'comment':_0x916e('0xa')},'data1':{'type':Sequelize[_0x916e('0xb')](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[_0x916e('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x916e('0xb')](0x1000),'comment':_0x916e('0xc')},'data4':{'type':Sequelize[_0x916e('0xb')](0x1000),'comments':_0x916e('0xd')},'data5':{'type':Sequelize[_0x916e('0xb')](0x1000),'comments':_0x916e('0xe')},'data6':{'type':Sequelize[_0x916e('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x916e('0xf')}};
\ No newline at end of file
index 661c77d..5542fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc047=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','body','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x5a68a8,_0x29a5b3){var _0x3625d7=function(_0x47cd74){while(--_0x47cd74){_0x5a68a8['push'](_0x5a68a8['shift']());}};_0x3625d7(++_0x29a5b3);}(_0xc047,0xe8));var _0x7c04=function(_0x3963e8,_0x479606){_0x3963e8=_0x3963e8-0x0;var _0x25bef0=_0xc047[_0x3963e8];return _0x25bef0;};'use strict';var emlformat=require(_0x7c04('0x0'));var rimraf=require(_0x7c04('0x1'));var zipdir=require(_0x7c04('0x2'));var jsonpatch=require(_0x7c04('0x3'));var rp=require(_0x7c04('0x4'));var moment=require(_0x7c04('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c04('0x6'));var util=require(_0x7c04('0x7'));var path=require(_0x7c04('0x8'));var sox=require('sox');var csv=require(_0x7c04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c04('0xa'));var _=require(_0x7c04('0xb'));var squel=require(_0x7c04('0xc'));var crypto=require(_0x7c04('0xd'));var jsforce=require(_0x7c04('0xe'));var deskjs=require(_0x7c04('0xf'));var toCsv=require(_0x7c04('0x9'));var querystring=require(_0x7c04('0x10'));var Papa=require(_0x7c04('0x11'));var Redis=require(_0x7c04('0x12'));var authService=require(_0x7c04('0x13'));var qs=require(_0x7c04('0x14'));var as=require(_0x7c04('0x15'));var hardwareService=require(_0x7c04('0x16'));var logger=require('../../config/logger')(_0x7c04('0x17'));var utils=require('../../config/utils');var config=require(_0x7c04('0x18'));var licenseUtil=require(_0x7c04('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17b40f,_0xd8f63f){_0xd8f63f=_0xd8f63f||0xcc;return function(_0x42b195){if(_0x42b195){return _0x17b40f[_0x7c04('0x1a')](_0xd8f63f);}return _0x17b40f[_0x7c04('0x1b')](_0xd8f63f)[_0x7c04('0x1c')]();};}function respondWithResult(_0x65a9df,_0x468ffa){_0x468ffa=_0x468ffa||0xc8;return function(_0x17f5a9){if(_0x17f5a9){return _0x65a9df[_0x7c04('0x1b')](_0x468ffa)[_0x7c04('0x1d')](_0x17f5a9);}};}function respondWithFilteredResult(_0x58a088,_0x469219){return function(_0x484c53){if(_0x484c53){var _0x161349=typeof _0x469219['offset']===_0x7c04('0x1e')&&typeof _0x469219[_0x7c04('0x1f')]===_0x7c04('0x1e');var _0x1edca1=_0x484c53[_0x7c04('0x20')];var _0x3b6ec7=_0x161349?0x0:_0x469219[_0x7c04('0x21')];var _0x4d8fa2=_0x161349?_0x484c53[_0x7c04('0x20')]:_0x469219[_0x7c04('0x21')]+_0x469219[_0x7c04('0x1f')];var _0x52d0d4;if(_0x4d8fa2>=_0x1edca1){_0x4d8fa2=_0x1edca1;_0x52d0d4=0xc8;}else{_0x52d0d4=0xce;}_0x58a088[_0x7c04('0x1b')](_0x52d0d4);return _0x58a088[_0x7c04('0x22')](_0x7c04('0x23'),_0x3b6ec7+'-'+_0x4d8fa2+'/'+_0x1edca1)[_0x7c04('0x1d')](_0x484c53);}return null;};}function patchUpdates(_0x17ceab){return function(_0x3235f9){try{jsonpatch[_0x7c04('0x24')](_0x3235f9,_0x17ceab,!![]);}catch(_0x2112c7){return BPromise['reject'](_0x2112c7);}return _0x3235f9[_0x7c04('0x25')]();};}function saveUpdates(_0x38b501,_0x10e78e){return function(_0x4f6068){if(_0x4f6068){return _0x4f6068[_0x7c04('0x26')](_0x38b501)[_0x7c04('0x27')](function(_0x29f8aa){return _0x29f8aa;});}return null;};}function removeEntity(_0x128a1a,_0x1c2d0c){return function(_0x159eeb){if(_0x159eeb){return _0x159eeb[_0x7c04('0x28')]()['then'](function(){_0x128a1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43a6ae,_0x3cb1a2){return function(_0x1522bd){if(!_0x1522bd){_0x43a6ae['sendStatus'](0x194);}return _0x1522bd;};}function handleError(_0x9849a,_0xcd19a6){_0xcd19a6=_0xcd19a6||0x1f4;return function(_0x136430){logger[_0x7c04('0x29')](_0x136430[_0x7c04('0x2a')]);if(_0x136430[_0x7c04('0x2b')]){delete _0x136430[_0x7c04('0x2b')];}_0x9849a['status'](_0xcd19a6)[_0x7c04('0x2c')](_0x136430);};}exports[_0x7c04('0x26')]=function(_0x37bd31,_0x656054){if(_0x37bd31[_0x7c04('0x2d')]['id']){delete _0x37bd31[_0x7c04('0x2d')]['id'];}return db['Action']['find']({'where':{'id':_0x37bd31[_0x7c04('0x2e')]['id']}})[_0x7c04('0x27')](handleEntityNotFound(_0x656054,null))['then'](saveUpdates(_0x37bd31[_0x7c04('0x2d')],null))[_0x7c04('0x27')](respondWithResult(_0x656054,null))[_0x7c04('0x2f')](handleError(_0x656054,null));};exports['destroy']=function(_0x1a1498,_0x220c6f){return db['Action'][_0x7c04('0x30')]({'where':{'id':_0x1a1498['params']['id']}})[_0x7c04('0x27')](handleEntityNotFound(_0x220c6f,null))[_0x7c04('0x27')](removeEntity(_0x220c6f,null))[_0x7c04('0x2f')](handleError(_0x220c6f,null));};
\ No newline at end of file
+var _0x0d9d=['error','stack','name','send','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus'];(function(_0x53b087,_0x52fae0){var _0x1a5af1=function(_0x27dc67){while(--_0x27dc67){_0x53b087['push'](_0x53b087['shift']());}};_0x1a5af1(++_0x52fae0);}(_0x0d9d,0xde));var _0xd0d9=function(_0x587c70,_0x58dae5){_0x587c70=_0x587c70-0x0;var _0x537181=_0x0d9d[_0x587c70];return _0x537181;};'use strict';var emlformat=require(_0xd0d9('0x0'));var rimraf=require(_0xd0d9('0x1'));var zipdir=require(_0xd0d9('0x2'));var jsonpatch=require(_0xd0d9('0x3'));var rp=require('request-promise');var moment=require(_0xd0d9('0x4'));var BPromise=require(_0xd0d9('0x5'));var Mustache=require(_0xd0d9('0x6'));var util=require(_0xd0d9('0x7'));var path=require(_0xd0d9('0x8'));var sox=require(_0xd0d9('0x9'));var csv=require(_0xd0d9('0xa'));var ejs=require(_0xd0d9('0xb'));var fs=require('fs');var fs_extra=require(_0xd0d9('0xc'));var _=require('lodash');var squel=require(_0xd0d9('0xd'));var crypto=require(_0xd0d9('0xe'));var jsforce=require(_0xd0d9('0xf'));var deskjs=require(_0xd0d9('0x10'));var toCsv=require(_0xd0d9('0xa'));var querystring=require(_0xd0d9('0x11'));var Papa=require('papaparse');var Redis=require(_0xd0d9('0x12'));var authService=require(_0xd0d9('0x13'));var qs=require(_0xd0d9('0x14'));var as=require(_0xd0d9('0x15'));var hardwareService=require(_0xd0d9('0x16'));var logger=require(_0xd0d9('0x17'))(_0xd0d9('0x18'));var utils=require('../../config/utils');var config=require(_0xd0d9('0x19'));var licenseUtil=require(_0xd0d9('0x1a'));var db=require(_0xd0d9('0x1b'))['db'];function respondWithStatusCode(_0x25249c,_0x237060){_0x237060=_0x237060||0xcc;return function(_0x402196){if(_0x402196){return _0x25249c['sendStatus'](_0x237060);}return _0x25249c[_0xd0d9('0x1c')](_0x237060)[_0xd0d9('0x1d')]();};}function respondWithResult(_0x583ae4,_0xa18aa1){_0xa18aa1=_0xa18aa1||0xc8;return function(_0x317285){if(_0x317285){return _0x583ae4[_0xd0d9('0x1c')](_0xa18aa1)['json'](_0x317285);}};}function respondWithFilteredResult(_0x2d5ff0,_0x204a4b){return function(_0x22aa74){if(_0x22aa74){var _0x3fa0ef=typeof _0x204a4b[_0xd0d9('0x1e')]===_0xd0d9('0x1f')&&typeof _0x204a4b[_0xd0d9('0x20')]===_0xd0d9('0x1f');var _0x5017c5=_0x22aa74[_0xd0d9('0x21')];var _0x18390f=_0x3fa0ef?0x0:_0x204a4b[_0xd0d9('0x1e')];var _0x58f2ee=_0x3fa0ef?_0x22aa74['count']:_0x204a4b[_0xd0d9('0x1e')]+_0x204a4b[_0xd0d9('0x20')];var _0x1bc271;if(_0x58f2ee>=_0x5017c5){_0x58f2ee=_0x5017c5;_0x1bc271=0xc8;}else{_0x1bc271=0xce;}_0x2d5ff0[_0xd0d9('0x1c')](_0x1bc271);return _0x2d5ff0[_0xd0d9('0x22')](_0xd0d9('0x23'),_0x18390f+'-'+_0x58f2ee+'/'+_0x5017c5)[_0xd0d9('0x24')](_0x22aa74);}return null;};}function patchUpdates(_0x595748){return function(_0x23e478){try{jsonpatch[_0xd0d9('0x25')](_0x23e478,_0x595748,!![]);}catch(_0x5d3108){return BPromise[_0xd0d9('0x26')](_0x5d3108);}return _0x23e478[_0xd0d9('0x27')]();};}function saveUpdates(_0x2cfdf7,_0x4d387e){return function(_0x524717){if(_0x524717){return _0x524717[_0xd0d9('0x28')](_0x2cfdf7)[_0xd0d9('0x29')](function(_0x3f7150){return _0x3f7150;});}return null;};}function removeEntity(_0x1a17b9,_0x4c1406){return function(_0x108023){if(_0x108023){return _0x108023['destroy']()[_0xd0d9('0x29')](function(){_0x1a17b9[_0xd0d9('0x1c')](0xcc)[_0xd0d9('0x1d')]();});}};}function handleEntityNotFound(_0x53a3b3,_0x4fc89d){return function(_0x107ad0){if(!_0x107ad0){_0x53a3b3[_0xd0d9('0x2a')](0x194);}return _0x107ad0;};}function handleError(_0x32281d,_0x5f58c7){_0x5f58c7=_0x5f58c7||0x1f4;return function(_0x471ba2){logger[_0xd0d9('0x2b')](_0x471ba2[_0xd0d9('0x2c')]);if(_0x471ba2[_0xd0d9('0x2d')]){delete _0x471ba2[_0xd0d9('0x2d')];}_0x32281d['status'](_0x5f58c7)[_0xd0d9('0x2e')](_0x471ba2);};}exports[_0xd0d9('0x28')]=function(_0x232f74,_0x3b6f17){if(_0x232f74[_0xd0d9('0x2f')]['id']){delete _0x232f74[_0xd0d9('0x2f')]['id'];}return db[_0xd0d9('0x30')][_0xd0d9('0x31')]({'where':{'id':_0x232f74[_0xd0d9('0x32')]['id']}})[_0xd0d9('0x29')](handleEntityNotFound(_0x3b6f17,null))[_0xd0d9('0x29')](saveUpdates(_0x232f74[_0xd0d9('0x2f')],null))[_0xd0d9('0x29')](respondWithResult(_0x3b6f17,null))[_0xd0d9('0x33')](handleError(_0x3b6f17,null));};exports[_0xd0d9('0x34')]=function(_0x44aced,_0x1fa564){return db['Action']['find']({'where':{'id':_0x44aced[_0xd0d9('0x32')]['id']}})[_0xd0d9('0x29')](handleEntityNotFound(_0x1fa564,null))[_0xd0d9('0x29')](removeEntity(_0x1fa564,null))[_0xd0d9('0x33')](handleError(_0x1fa564,null));};
\ No newline at end of file
index 7e64651..8d05546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd795=['define','Action','tools_actions','lodash','util','../../config/logger','moment','path','rimraf','./action.attributes','exports'];(function(_0xc44261,_0x4952ab){var _0x156617=function(_0x167409){while(--_0x167409){_0xc44261['push'](_0xc44261['shift']());}};_0x156617(++_0x4952ab);}(_0xd795,0x121));var _0x5d79=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd795[_0x279d37];return _0x530173;};'use strict';var _=require(_0x5d79('0x0'));var util=require(_0x5d79('0x1'));var logger=require(_0x5d79('0x2'))('api');var moment=require(_0x5d79('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d79('0x4'));var rimraf=require(_0x5d79('0x5'));var config=require('../../config/environment');var attributes=require(_0x5d79('0x6'));module[_0x5d79('0x7')]=function(_0x1566a1,_0x3a3840){return _0x1566a1[_0x5d79('0x8')](_0x5d79('0x9'),attributes,{'tableName':_0x5d79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x627d=['rimraf','../../config/environment','./action.attributes','exports','define','Action','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x627d,0xc6));var _0xd627=function(_0x132148,_0x5d9902){_0x132148=_0x132148-0x0;var _0x51bba2=_0x627d[_0x132148];return _0x51bba2;};'use strict';var _=require('lodash');var util=require(_0xd627('0x0'));var logger=require(_0xd627('0x1'))('api');var moment=require(_0xd627('0x2'));var BPromise=require(_0xd627('0x3'));var rp=require(_0xd627('0x4'));var fs=require('fs');var path=require(_0xd627('0x5'));var rimraf=require(_0xd627('0x6'));var config=require(_0xd627('0x7'));var attributes=require(_0xd627('0x8'));module[_0xd627('0x9')]=function(_0x5eef1e,_0x21c890){return _0x5eef1e[_0xd627('0xa')](_0xd627('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ce7d74..39b7a99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x1a0473,_0x4f9879){_0x1a0473=_0x1a0473-0x0;var _0x5e6c27=_0x4975[_0x1a0473];return _0x5e6c27;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index eaf77bf..a21fa6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x978c=['put','/:id','isAuthenticated','update','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x978c,0xc0));var _0xc978=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x978c[_0xc67528];return _0x38e26d;};'use strict';var multer=require(_0xc978('0x0'));var util=require(_0xc978('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc978('0x2')]();var fs_extra=require(_0xc978('0x3'));var auth=require(_0xc978('0x4'));var interaction=require(_0xc978('0x5'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xc978('0x6')](_0xc978('0x7'),auth[_0xc978('0x8')](),controller[_0xc978('0x9')]);router['delete'](_0xc978('0x7'),auth['isAuthenticated'](),controller[_0xc978('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xd61e=['../../components/interaction/service','/:id','isAuthenticated','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ba495,_0x25bcb4){var _0x1782b4=function(_0x20ce24){while(--_0x20ce24){_0x3ba495['push'](_0x3ba495['shift']());}};_0x1782b4(++_0x25bcb4);}(_0xd61e,0xdd));var _0xed61=function(_0x59c6d2,_0x5ea390){_0x59c6d2=_0x59c6d2-0x0;var _0x39610a=_0xd61e[_0x59c6d2];return _0x39610a;};'use strict';var multer=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var path=require(_0xed61('0x2'));var timeout=require(_0xed61('0x3'));var express=require(_0xed61('0x4'));var router=express[_0xed61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed61('0x6'));var interaction=require(_0xed61('0x7'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0xed61('0x8'),auth[_0xed61('0x9')](),controller[_0xed61('0xa')]);router[_0xed61('0xb')](_0xed61('0x8'),auth[_0xed61('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index c06522a..1c4f57c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['STRING','TEXT','sequelize'];(function(_0x19b971,_0x1e7f16){var _0x267132=function(_0x49ed57){while(--_0x49ed57){_0x19b971['push'](_0x19b971['shift']());}};_0x267132(++_0x1e7f16);}(_0x326f,0xd1));var _0xf326=function(_0x3959ae,_0x11616e){_0x3959ae=_0x3959ae-0x0;var _0x50dc72=_0x326f[_0x3959ae];return _0x50dc72;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0x2d6376,_0x407415){var _0x30e77d=function(_0x48a3c5){while(--_0x48a3c5){_0x2d6376['push'](_0x2d6376['shift']());}};_0x30e77d(++_0x407415);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
index 49ac9f4..1fa5a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x473b=['rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','include','findAll','params','includeAll','find','create','body','user','role','Reports','userProfileId','autoAssociation','catch','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','groupBy','orderBy','DESC','alias','joins','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','replace','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','SELECT','run','runReport','ROUND(%s)','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticCustomReport'];(function(_0x33cd44,_0x421c8f){var _0x478f69=function(_0x4c0d32){while(--_0x4c0d32){_0x33cd44['push'](_0x33cd44['shift']());}};_0x478f69(++_0x421c8f);}(_0x473b,0x11a));var _0xb473=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x473b[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb473('0x0'));var rimraf=require(_0xb473('0x1'));var zipdir=require(_0xb473('0x2'));var jsonpatch=require(_0xb473('0x3'));var rp=require(_0xb473('0x4'));var moment=require(_0xb473('0x5'));var BPromise=require(_0xb473('0x6'));var Mustache=require(_0xb473('0x7'));var util=require(_0xb473('0x8'));var path=require(_0xb473('0x9'));var sox=require(_0xb473('0xa'));var csv=require(_0xb473('0xb'));var ejs=require(_0xb473('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb473('0xd'));var squel=require('squel');var crypto=require(_0xb473('0xe'));var jsforce=require(_0xb473('0xf'));var deskjs=require(_0xb473('0x10'));var toCsv=require(_0xb473('0xb'));var querystring=require(_0xb473('0x11'));var Papa=require(_0xb473('0x12'));var Redis=require(_0xb473('0x13'));var authService=require(_0xb473('0x14'));var qs=require(_0xb473('0x15'));var as=require(_0xb473('0x16'));var hardwareService=require(_0xb473('0x17'));var logger=require(_0xb473('0x18'))(_0xb473('0x19'));var utils=require(_0xb473('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xb473('0x1b'));var db=require(_0xb473('0x1c'))['db'];var dbH=require(_0xb473('0x1c'))[_0xb473('0x1d')];function respondWithStatusCode(_0x69173d,_0x216c34){_0x216c34=_0x216c34||0xcc;return function(_0x2498ba){if(_0x2498ba){return _0x69173d['sendStatus'](_0x216c34);}return _0x69173d[_0xb473('0x1e')](_0x216c34)[_0xb473('0x1f')]();};}function respondWithResult(_0x9bf51b,_0x4cece5){_0x4cece5=_0x4cece5||0xc8;return function(_0x36cb06){if(_0x36cb06){return _0x9bf51b[_0xb473('0x1e')](_0x4cece5)[_0xb473('0x20')](_0x36cb06);}};}function respondWithFilteredResult(_0x1247bf,_0x408d1c){return function(_0x54b28c){if(_0x54b28c){var _0x15099a=typeof _0x408d1c[_0xb473('0x21')]===_0xb473('0x22')&&typeof _0x408d1c[_0xb473('0x23')]===_0xb473('0x22');var _0x1e39e0=_0x54b28c['count'];var _0x312180=_0x15099a?0x0:_0x408d1c[_0xb473('0x21')];var _0x1e3891=_0x15099a?_0x54b28c['count']:_0x408d1c[_0xb473('0x21')]+_0x408d1c[_0xb473('0x23')];var _0x1626a5;if(_0x1e3891>=_0x1e39e0){_0x1e3891=_0x1e39e0;_0x1626a5=0xc8;}else{_0x1626a5=0xce;}_0x1247bf[_0xb473('0x1e')](_0x1626a5);return _0x1247bf[_0xb473('0x24')](_0xb473('0x25'),_0x312180+'-'+_0x1e3891+'/'+_0x1e39e0)[_0xb473('0x20')](_0x54b28c);}return null;};}function patchUpdates(_0x122295){return function(_0x4335bf){try{jsonpatch[_0xb473('0x26')](_0x4335bf,_0x122295,!![]);}catch(_0x2e2fad){return BPromise[_0xb473('0x27')](_0x2e2fad);}return _0x4335bf[_0xb473('0x28')]();};}function saveUpdates(_0x11f55d,_0x564671){return function(_0x5ae73f){if(_0x5ae73f){return _0x5ae73f[_0xb473('0x29')](_0x11f55d)[_0xb473('0x2a')](function(_0x4a71bb){return _0x4a71bb;});}return null;};}function removeEntity(_0x5afe50,_0x4f6447){return function(_0x440d5b){if(_0x440d5b){return _0x440d5b[_0xb473('0x2b')]()[_0xb473('0x2a')](function(){var _0x16695d=_0x440d5b[_0xb473('0x2c')]({'plain':!![]});var _0x1165e7=_0xb473('0x2d');return db[_0xb473('0x2e')][_0xb473('0x2b')]({'where':{'type':_0x1165e7,'resourceId':_0x16695d['id']}})[_0xb473('0x2a')](function(){return _0x440d5b;});})[_0xb473('0x2a')](function(){_0x5afe50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e7b7,_0x4b81d0){return function(_0x171f8a){if(!_0x171f8a){_0x19e7b7[_0xb473('0x2f')](0x194);}return _0x171f8a;};}function handleError(_0x31b00a,_0x4ad587){_0x4ad587=_0x4ad587||0x1f4;return function(_0x61b1bb){logger[_0xb473('0x30')](_0x61b1bb['stack']);if(_0x61b1bb[_0xb473('0x31')]){delete _0x61b1bb[_0xb473('0x31')];}_0x31b00a[_0xb473('0x1e')](_0x4ad587)[_0xb473('0x32')](_0x61b1bb);};}exports[_0xb473('0x33')]=function(_0x51e439,_0x563226){var _0x31e61a={},_0x57c233={},_0x58ab7e={'count':0x0,'rows':[]};var _0x3076e0=_[_0xb473('0x34')](db[_0xb473('0x35')][_0xb473('0x36')],function(_0x178e93){return{'name':_0x178e93['fieldName'],'type':_0x178e93['type'][_0xb473('0x37')]};});_0x57c233[_0xb473('0x38')]=_[_0xb473('0x34')](_0x3076e0,'name');_0x57c233['query']=_[_0xb473('0x39')](_0x51e439[_0xb473('0x3a')]);_0x57c233[_0xb473('0x3b')]=_['intersection'](_0x57c233['model'],_0x57c233[_0xb473('0x3a')]);_0x31e61a[_0xb473('0x3c')]=_[_0xb473('0x3d')](_0x57c233['model'],qs[_0xb473('0x3e')](_0x51e439[_0xb473('0x3a')][_0xb473('0x3e')]));_0x31e61a['attributes']=_0x31e61a[_0xb473('0x3c')][_0xb473('0x3f')]?_0x31e61a[_0xb473('0x3c')]:_0x57c233['model'];if(!_0x51e439['query']['hasOwnProperty'](_0xb473('0x40'))){_0x31e61a[_0xb473('0x23')]=qs['limit'](_0x51e439[_0xb473('0x3a')]['limit']);_0x31e61a['offset']=qs['offset'](_0x51e439[_0xb473('0x3a')]['offset']);}_0x31e61a[_0xb473('0x41')]=qs[_0xb473('0x42')](_0x51e439['query'][_0xb473('0x42')]);_0x31e61a['where']=qs[_0xb473('0x3b')](_['pick'](_0x51e439[_0xb473('0x3a')],_0x57c233[_0xb473('0x3b')]),_0x3076e0);if(_0x51e439[_0xb473('0x3a')][_0xb473('0x43')]){_0x31e61a[_0xb473('0x44')]=_[_0xb473('0x45')](_0x31e61a['where'],{'$or':_['map'](_0x3076e0,function(_0x6d660a){if(_0x6d660a['type']!==_0xb473('0x46')){var _0x8a915b={};_0x8a915b[_0x6d660a['name']]={'$like':'%'+_0x51e439['query']['filter']+'%'};return _0x8a915b;}})});}_0x31e61a=_[_0xb473('0x45')]({},_0x31e61a,_0x51e439[_0xb473('0x47')]);var _0x32e93e={'where':_0x31e61a[_0xb473('0x44')]};return db[_0xb473('0x35')][_0xb473('0x48')](_0x32e93e)['then'](function(_0x10f574){_0x58ab7e['count']=_0x10f574;if(_0x51e439[_0xb473('0x3a')]['includeAll']){_0x31e61a[_0xb473('0x49')]=[{'all':!![]}];}return db[_0xb473('0x35')][_0xb473('0x4a')](_0x31e61a);})['then'](function(_0x24668e){_0x58ab7e['rows']=_0x24668e;return _0x58ab7e;})[_0xb473('0x2a')](respondWithFilteredResult(_0x563226,_0x31e61a))['catch'](handleError(_0x563226,null));};exports['show']=function(_0x551084,_0x36662c){var _0x31aee9={'raw':![],'where':{'id':_0x551084[_0xb473('0x4b')]['id']}},_0x89a5c={};_0x89a5c[_0xb473('0x38')]=_[_0xb473('0x39')](db[_0xb473('0x35')][_0xb473('0x36')]);_0x89a5c[_0xb473('0x3a')]=_[_0xb473('0x39')](_0x551084['query']);_0x89a5c['filters']=_[_0xb473('0x3d')](_0x89a5c['model'],_0x89a5c[_0xb473('0x3a')]);_0x31aee9[_0xb473('0x3c')]=_['intersection'](_0x89a5c[_0xb473('0x38')],qs[_0xb473('0x3e')](_0x551084[_0xb473('0x3a')][_0xb473('0x3e')]));_0x31aee9['attributes']=_0x31aee9[_0xb473('0x3c')][_0xb473('0x3f')]?_0x31aee9['attributes']:_0x89a5c[_0xb473('0x38')];if(_0x551084[_0xb473('0x3a')][_0xb473('0x4c')]){_0x31aee9[_0xb473('0x49')]=[{'all':!![]}];}_0x31aee9=_[_0xb473('0x45')]({},_0x31aee9,_0x551084['options']);return db['AnalyticCustomReport'][_0xb473('0x4d')](_0x31aee9)['then'](handleEntityNotFound(_0x36662c,null))['then'](respondWithResult(_0x36662c,null))['catch'](handleError(_0x36662c,null));};exports['create']=function(_0x33b187,_0x22b41d){return db[_0xb473('0x35')][_0xb473('0x4e')](_0x33b187[_0xb473('0x4f')],{})[_0xb473('0x2a')](function(_0x21064a){var _0x40d3b3=_0x33b187[_0xb473('0x50')][_0xb473('0x2c')]({'plain':!![]});if(!_0x40d3b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40d3b3[_0xb473('0x51')]===_0xb473('0x50')){var _0x268ee9=_0x21064a[_0xb473('0x2c')]({'plain':!![]});var _0x1d9564=_0xb473('0x52');return db['UserProfileSection'][_0xb473('0x4d')]({'where':{'name':_0x1d9564,'userProfileId':_0x40d3b3[_0xb473('0x53')]},'raw':!![]})[_0xb473('0x2a')](function(_0x3fe925){if(_0x3fe925&&_0x3fe925[_0xb473('0x54')]===0x0){return db[_0xb473('0x2e')][_0xb473('0x4e')]({'name':_0x268ee9[_0xb473('0x31')],'resourceId':_0x268ee9['id'],'type':_0xb473('0x2d'),'sectionId':_0x3fe925['id']},{})['then'](function(){return _0x21064a;});}else{return _0x21064a;}})[_0xb473('0x55')](function(_0x5ee0cf){logger[_0xb473('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee0cf);throw _0x5ee0cf;});}return _0x21064a;})[_0xb473('0x2a')](respondWithResult(_0x22b41d,0xc9))[_0xb473('0x55')](handleError(_0x22b41d,null));};exports[_0xb473('0x29')]=function(_0xe1178a,_0x1f5ee6){if(_0xe1178a[_0xb473('0x4f')]['id']){delete _0xe1178a[_0xb473('0x4f')]['id'];}return db[_0xb473('0x35')][_0xb473('0x4d')]({'where':{'id':_0xe1178a['params']['id']}})[_0xb473('0x2a')](handleEntityNotFound(_0x1f5ee6,null))[_0xb473('0x2a')](saveUpdates(_0xe1178a[_0xb473('0x4f')],null))[_0xb473('0x2a')](respondWithResult(_0x1f5ee6,null))['catch'](handleError(_0x1f5ee6,null));};exports['destroy']=function(_0xb104a8,_0x4133aa){return db[_0xb473('0x35')][_0xb473('0x4d')]({'where':{'id':_0xb104a8[_0xb473('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4133aa,null))['then'](removeEntity(_0x4133aa,null))['catch'](handleError(_0x4133aa,null));};exports[_0xb473('0x56')]=function(_0x1aa944,_0x128afa){var _0x22ca45=0xa;var _0x4c4712=['join','left_join',_0xb473('0x57'),_0xb473('0x58')];var _0x1ab63b={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x53072a={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':'DATE(%s)','HOUR':_0xb473('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb473('0x60')};var _0x2524cc=function(_0x5ccdc8){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),_0xb473('0x64'),'IS\x20NOT\x20EMPTY'],_0x5ccdc8);};var _0x3ba6a4=function(_0x3fefb8){if(!_0x3fefb8||!_0x3fefb8[_0xb473('0x65')][_0xb473('0x3f')]){return'';}for(var _0xb130b='(',_0x3749f0=0x0;_0x3749f0<_0x3fefb8['rules']['length'];_0x3749f0+=0x1){_0x3749f0>0x0&&(_0xb130b+='\x20'+_0x3fefb8[_0xb473('0x66')]+'\x20');_0xb130b+=_0x3fefb8['rules'][_0x3749f0][_0xb473('0x67')]?_0x3ba6a4(_0x3fefb8[_0xb473('0x65')][_0x3749f0]['group']):_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x68')]+'\x20'+_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x69')]+(_0x2524cc(_0x3fefb8['rules'][_0x3749f0][_0xb473('0x69')])?'\x20'+_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x6a')]:'');}return _0xb130b+')';};var _0x19c33b={'where':{'id':_0x1aa944['params']['id']}},_0x4b2d93,_0x3e0eb7,_0x559766,_0x4b5c09,_0x126446;_0x19c33b=_[_0xb473('0x45')]({},_0x19c33b,_0x1aa944['options']);return db['AnalyticCustomReport'][_0xb473('0x4d')](_0x19c33b)[_0xb473('0x2a')](function(_0x2d07c1){if(_0x2d07c1){_0x4b2d93=_0x2d07c1;return _0x2d07c1[_0xb473('0x6b')]();}return null;})[_0xb473('0x2a')](function(_0x5aa1e4){if(_0x5aa1e4){if(!_0x5aa1e4[_0xb473('0x3f')]){throw new db[(_0xb473('0x6c'))]['ValidationErrorItem'](_0xb473('0x6d'),0x193);}_0x3e0eb7=_0x5aa1e4;return db[_0xb473('0x6e')][_0xb473('0x4a')]({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x6d962c){if(_0x6d962c){_0x559766=_[_0xb473('0x6f')](_0x6d962c,'id');var _0x58acf6;var _0x2dafdb=squel[_0xb473('0x70')]();_0x2dafdb[_0xb473('0x71')](_0x4b2d93['table']);for(var _0x4ac97e=0x0;_0x4ac97e<_0x3e0eb7[_0xb473('0x3f')];_0x4ac97e+=0x1){_0x58acf6=_0x3e0eb7[_0x4ac97e]['MetricId']?_0x559766[_0x3e0eb7[_0x4ac97e][_0xb473('0x72')]]['metric']:_0x3e0eb7[_0x4ac97e][_0xb473('0x68')];_0x58acf6=_0x3e0eb7[_0x4ac97e][_0xb473('0x73')]?_['replace'](_0x1ab63b[_0x3e0eb7[_0x4ac97e][_0xb473('0x73')]],'%s',_0x58acf6):_0x58acf6;_0x58acf6=_0x3e0eb7[_0x4ac97e]['format']?_['replace'](_0x53072a[_0x3e0eb7[_0x4ac97e][_0xb473('0x74')]],'%s',_0x58acf6):_0x58acf6;if(_0x3e0eb7[_0x4ac97e][_0xb473('0x75')]){_0x2dafdb['group'](_0x58acf6);}_0x3e0eb7[_0x4ac97e][_0xb473('0x76')]&&_0x2dafdb[_0xb473('0x41')](_0x58acf6,_0x3e0eb7[_0x4ac97e][_0xb473('0x76')]===_0xb473('0x77')?![]:!![]);_0x2dafdb[_0xb473('0x68')](_0x58acf6,_0x3e0eb7[_0x4ac97e][_0xb473('0x78')]||_0x58acf6);}if(_0x4b2d93['joins']){_0x4b2d93[_0xb473('0x79')]=JSON['parse'](_0x4b2d93[_0xb473('0x79')]);for(var _0x3bce91=0x0;_0x3bce91<_0x4b2d93[_0xb473('0x79')][_0xb473('0x3f')];_0x3bce91+=0x1){if(_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x4c4712,_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7a')])&&_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7b')]&&_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7c')]&&_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7d')]){_0x2dafdb[_0x4b2d93[_0xb473('0x79')][_0x3bce91]['type']](_0x4b2d93[_0xb473('0x79')][_0x3bce91]['foreignTable'],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x4b2d93[_0xb473('0x7f')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7b')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7c')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7d')]));}}}if(_0x4b2d93[_0xb473('0x80')]){_0x4b2d93[_0xb473('0x80')]=JSON[_0xb473('0x81')](_0x4b2d93[_0xb473('0x80')]);_0x2dafdb[_0xb473('0x44')](_0x3ba6a4(_0x4b2d93['conditions'][_0xb473('0x67')]));}_0x126446=_0x2dafdb[_0xb473('0x82')]();_0x2dafdb[_0xb473('0x23')](_0x22ca45);_0x2dafdb[_0xb473('0x21')](0x0);logger[_0xb473('0x83')](_0xb473('0x84'),_0x2dafdb[_0xb473('0x85')]());return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x2dafdb['toString'](),{'type':dbH[_0xb473('0x86')]['QueryTypes']['SELECT']});}})[_0xb473('0x2a')](respondWithResult(_0x128afa,null))[_0xb473('0x55')](handleError(_0x128afa,null));};function runReport(_0x1b77f2,_0x575b60,_0x5bf713){var _0x3d8e36=_0x575b60[_0xb473('0x31')];var _0x7e29e1=0xa;var _0x10786f=[_0xb473('0x87'),_0xb473('0x88'),_0xb473('0x57'),'cross_join'];var _0x578d69={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':_0xb473('0x89'),'MIN':'MIN(%s)','AVG':_0xb473('0x8a'),'GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':_0xb473('0x8b')};var _0x4d3f6a={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':_0xb473('0x8c'),'HOUR':_0xb473('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb473('0x60')};var _0x45bd90=function(_0x91602b){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),'IS\x20EMPTY',_0xb473('0x8d')],_0x91602b);};var _0x1c7863=function(_0x552dcc){if(!_0x552dcc||!_0x552dcc['rules'][_0xb473('0x3f')]){return'';}for(var _0x2e4bc8='(',_0x1fd5f7=0x0;_0x1fd5f7<_0x552dcc[_0xb473('0x65')][_0xb473('0x3f')];_0x1fd5f7+=0x1){_0x1fd5f7>0x0&&(_0x2e4bc8+='\x20'+_0x552dcc['operator']+'\x20');_0x2e4bc8+=_0x552dcc['rules'][_0x1fd5f7]['group']?_0x1c7863(_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x67')]):_0x552dcc['rules'][_0x1fd5f7][_0xb473('0x68')]+'\x20'+_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x69')]+(_0x45bd90(_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x69')])?'\x20'+_0x552dcc['rules'][_0x1fd5f7][_0xb473('0x6a')]:'');}return _0x2e4bc8+')';};var _0x41b0={'where':{'id':_0x1b77f2['id']}},_0x1b377b,_0x31a119,_0x392360,_0x215806,_0x686c4e;_0x41b0=_[_0xb473('0x45')]({},_0x41b0,_0x5bf713);return db[_0xb473('0x35')][_0xb473('0x4d')](_0x41b0)[_0xb473('0x2a')](function(_0x14bf1b){if(_0x14bf1b){_0x1b377b=_0x14bf1b;return _0x14bf1b[_0xb473('0x6b')]();}return null;})[_0xb473('0x2a')](function(_0x36a82c){if(_0x36a82c){if(!_0x36a82c['length']){throw new db[(_0xb473('0x6c'))][(_0xb473('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31a119=_0x36a82c;return db[_0xb473('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x57d11e){if(_0x57d11e){_0x392360=_[_0xb473('0x6f')](_0x57d11e,'id');var _0x50a3cd;var _0x3d1854=squel[_0xb473('0x70')]();_0x3d1854['from'](_0x1b377b[_0xb473('0x7f')]);for(var _0x42eec0=0x0;_0x42eec0<_0x31a119['length'];_0x42eec0+=0x1){_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x72')]?_0x392360[_0x31a119[_0x42eec0]['MetricId']]['metric']:_0x31a119[_0x42eec0]['field'];_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x73')]?_[_0xb473('0x8f')](_0x578d69[_0x31a119[_0x42eec0][_0xb473('0x73')]],'%s',_0x50a3cd):_0x50a3cd;_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x74')]?_['replace'](_0x4d3f6a[_0x31a119[_0x42eec0][_0xb473('0x74')]],'%s',_0x50a3cd):_0x50a3cd;if(_0x31a119[_0x42eec0][_0xb473('0x75')]){_0x3d1854[_0xb473('0x67')](_0x50a3cd);}_0x31a119[_0x42eec0][_0xb473('0x76')]&&_0x3d1854[_0xb473('0x41')](_0x50a3cd,_0x31a119[_0x42eec0][_0xb473('0x76')]===_0xb473('0x77')?![]:!![]);_0x3d1854['field'](_0x50a3cd,_0x31a119[_0x42eec0]['alias']||_0x50a3cd);}if(_0x1b377b['joins']){_0x1b377b[_0xb473('0x79')]=JSON[_0xb473('0x81')](_0x1b377b['joins']);for(var _0x4809bb=0x0;_0x4809bb<_0x1b377b['joins'][_0xb473('0x3f')];_0x4809bb+=0x1){if(_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x10786f,_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')])&&_0x1b377b['joins'][_0x4809bb][_0xb473('0x7b')]&&_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable']&&_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7d')]){_0x3d1854[_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')]](_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable'],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x1b377b[_0xb473('0x7f')],_0x1b377b[_0xb473('0x79')][_0x4809bb]['parentKey'],_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable'],_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7d')]));}}}if(_0x1b377b['conditions']){_0x1b377b['conditions']=JSON['parse'](_0x1b377b[_0xb473('0x80')]);_0x3d1854[_0xb473('0x44')](_0x1c7863(_0x1b377b['conditions'][_0xb473('0x67')]));}_0x686c4e=_0x3d1854['clone']();_0x3d1854[_0xb473('0x23')](_0x7e29e1);_0x3d1854[_0xb473('0x21')](0x0);return;}})[_0xb473('0x2a')](function(){if(_0x575b60[_0xb473('0x90')]===_0xb473('0x91')){return null;}var _0x2731f8=_[_0xb473('0x45')](_0x575b60,{'name':_0x575b60['fullPath']||_0x575b60['name']||_0x1b377b[_0xb473('0x31')],'basename':_0x3d8e36,'savename':util[_0xb473('0x74')](_0xb473('0x92'),_0x575b60[_0xb473('0x31')]||_0x1b377b['name'],require(_0xb473('0x93'))[_0xb473('0x94')](0x4),_0x575b60[_0xb473('0x90')]||_0xb473('0x95')),'reportId':_0x1b377b['id'],'reportType':_0xb473('0x96')});return db['AnalyticExtractedReport'][_0xb473('0x4e')](_0x2731f8,{'raw':!![]});})[_0xb473('0x2a')](function(_0x18ffcc){if(_0x1b377b[_0xb473('0x7f')]===_0xb473('0x97')){_0x686c4e[_0xb473('0x44')](_0x1b377b['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x575b60[_0xb473('0x98')],_0x575b60['endDate']);}else{_0x686c4e[_0xb473('0x44')](_0x1b377b['table']+_0xb473('0x99'),_0x575b60[_0xb473('0x98')],_0x575b60[_0xb473('0x9a')]);}if(_0x18ffcc){logger[_0xb473('0x9b')](_0xb473('0x9c'),_0x686c4e[_0xb473('0x85')]());require(_0xb473('0x9d'))[_0xb473('0x9e')](path['join'](__dirname,_0xb473('0x9f'),_0x18ffcc[_0xb473('0x90')]),[_0x18ffcc['id'],_0x686c4e[_0xb473('0x85')](),path['join'](__dirname,_0xb473('0xa0'),_0x18ffcc[_0xb473('0xa1')]),_0x3d8e36]);return _0x18ffcc;}else{var _0x30b631=squel['select']();_0x30b631['from']('('+_0x686c4e[_0xb473('0x85')]()+')',_0xb473('0xa2'));_0x30b631[_0xb473('0x68')]('COUNT(*)',_0xb473('0x48'));_0x686c4e['limit'](_0x575b60[_0xb473('0x23')]||_0x7e29e1);_0x686c4e[_0xb473('0x21')](_0x575b60[_0xb473('0x21')]||0x0);return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x30b631[_0xb473('0x85')](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]})[_0xb473('0x2a')](function(_0x238577){if(!_0x238577['length']){_0x215806=0x0;}else{_0x215806=_0x238577[0x0]['count']||0x0;}return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x686c4e['toString'](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]});})[_0xb473('0x2a')](function(_0x2f0f17){return{'rows':_0x2f0f17||[],'count':_0x215806};});}});}exports[_0xb473('0xa4')]=function(_0x28b33b,_0x147c95){return runReport(_0x28b33b[_0xb473('0x4b')],_0x28b33b[_0xb473('0x3a')],_0x28b33b[_0xb473('0x47')])['then'](respondWithResult(_0x147c95,null))['catch'](handleError(_0x147c95,null));};exports[_0xb473('0xa5')]=runReport;exports['query']=function(_0x15f9cf,_0xc07578){var _0x56f028=0xa;var _0x3d21e4=[_0xb473('0x87'),_0xb473('0x88'),_0xb473('0x57'),_0xb473('0x58')];var _0x5bac91={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':_0xb473('0x89'),'MIN':'MIN(%s)','AVG':_0xb473('0x8a'),'GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':_0xb473('0x8b')};var _0x2d615d={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':_0xb473('0x8c'),'HOUR':'HOUR(%s)','ROUND':_0xb473('0xa6'),'UNIX_TIMESTAMP':_0xb473('0x60')};var _0x52b950=function(_0x584222){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),_0xb473('0x64'),_0xb473('0x8d')],_0x584222);};var _0x52ba6f=function(_0x3136d7){if(!_0x3136d7||!_0x3136d7[_0xb473('0x65')]['length']){return'';}for(var _0x448c41='(',_0x2e0408=0x0;_0x2e0408<_0x3136d7['rules'][_0xb473('0x3f')];_0x2e0408+=0x1){_0x2e0408>0x0&&(_0x448c41+='\x20'+_0x3136d7['operator']+'\x20');_0x448c41+=_0x3136d7[_0xb473('0x65')][_0x2e0408]['group']?_0x52ba6f(_0x3136d7[_0xb473('0x65')][_0x2e0408][_0xb473('0x67')]):_0x3136d7['rules'][_0x2e0408][_0xb473('0x68')]+'\x20'+_0x3136d7[_0xb473('0x65')][_0x2e0408]['condition']+(_0x52b950(_0x3136d7[_0xb473('0x65')][_0x2e0408][_0xb473('0x69')])?'\x20'+_0x3136d7[_0xb473('0x65')][_0x2e0408]['value']:'');}return _0x448c41+')';};var _0x1ab435={'where':{'id':_0x15f9cf[_0xb473('0x4b')]['id']}},_0x2eb994,_0x2549df,_0x42cbda,_0x2b16a4,_0x25b6a8;_0x1ab435=_[_0xb473('0x45')]({},_0x1ab435,_0x15f9cf['options']);return db[_0xb473('0x35')][_0xb473('0x4d')](_0x1ab435)[_0xb473('0x2a')](function(_0x4ed0c0){if(_0x4ed0c0){_0x2eb994=_0x4ed0c0;return _0x4ed0c0[_0xb473('0x6b')]();}return null;})['then'](function(_0x67cc3){if(_0x67cc3){if(!_0x67cc3['length']){throw new db['Sequelize'][(_0xb473('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2549df=_0x67cc3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x22564f){if(_0x22564f){_0x42cbda=_[_0xb473('0x6f')](_0x22564f,'id');var _0x4a8ff9;var _0x21549e=squel[_0xb473('0x70')]();_0x21549e[_0xb473('0x71')](_0x2eb994[_0xb473('0x7f')]);for(var _0x1a792b=0x0;_0x1a792b<_0x2549df[_0xb473('0x3f')];_0x1a792b+=0x1){_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x72')]?_0x42cbda[_0x2549df[_0x1a792b][_0xb473('0x72')]][_0xb473('0xa7')]:_0x2549df[_0x1a792b][_0xb473('0x68')];_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x73')]?_[_0xb473('0x8f')](_0x5bac91[_0x2549df[_0x1a792b][_0xb473('0x73')]],'%s',_0x4a8ff9):_0x4a8ff9;_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x74')]?_[_0xb473('0x8f')](_0x2d615d[_0x2549df[_0x1a792b][_0xb473('0x74')]],'%s',_0x4a8ff9):_0x4a8ff9;if(_0x2549df[_0x1a792b][_0xb473('0x75')]){_0x21549e[_0xb473('0x67')](_0x4a8ff9);}_0x2549df[_0x1a792b][_0xb473('0x76')]&&_0x21549e[_0xb473('0x41')](_0x4a8ff9,_0x2549df[_0x1a792b]['orderBy']===_0xb473('0x77')?![]:!![]);_0x21549e[_0xb473('0x68')](_0x4a8ff9,_0x2549df[_0x1a792b]['alias']||_0x4a8ff9);}if(_0x2eb994[_0xb473('0x79')]){_0x2eb994[_0xb473('0x79')]=JSON[_0xb473('0x81')](_0x2eb994['joins']);for(var _0x368750=0x0;_0x368750<_0x2eb994[_0xb473('0x79')][_0xb473('0x3f')];_0x368750+=0x1){if(_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x3d21e4,_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')])&&_0x2eb994['joins'][_0x368750][_0xb473('0x7b')]&&_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')]&&_0x2eb994['joins'][_0x368750][_0xb473('0x7d')]){_0x21549e[_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')]](_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x2eb994[_0xb473('0x7f')],_0x2eb994[_0xb473('0x79')][_0x368750]['parentKey'],_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')],_0x2eb994[_0xb473('0x79')][_0x368750]['foreignKey']));}}}if(_0x2eb994[_0xb473('0x80')]){_0x2eb994[_0xb473('0x80')]=JSON[_0xb473('0x81')](_0x2eb994[_0xb473('0x80')]);_0x21549e[_0xb473('0x44')](_0x52ba6f(_0x2eb994[_0xb473('0x80')][_0xb473('0x67')]));}_0x25b6a8=_0x21549e[_0xb473('0x82')]();_0x21549e[_0xb473('0x23')](_0x56f028);_0x21549e[_0xb473('0x21')](0x0);logger[_0xb473('0x83')]('Limited\x20Query:',_0x21549e[_0xb473('0x85')]());return dbH['sequelize'][_0xb473('0x3a')](_0x21549e[_0xb473('0x85')](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]});}})[_0xb473('0x2a')](function(){return{'sql':_0x25b6a8['toString']()};})[_0xb473('0x2a')](respondWithResult(_0xc07578,null))['catch'](handleError(_0xc07578,null));};
\ No newline at end of file
+var _0x0de2=['request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','orderBy','DESC','alias','joins','foreignTable','parentKey','conditions','clone','debug','Limited\x20Query:','toString','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','metric','groupBy','foreignKey','%s.%s\x20=\x20%s.%s','parse','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','../../components/export/','../../files/reports','savename','countTable','sequelize','QueryTypes','SELECT','run','runReport','DATE(%s)','rimraf'];(function(_0x231782,_0x14e733){var _0x26b4a5=function(_0x55c232){while(--_0x55c232){_0x231782['push'](_0x231782['shift']());}};_0x26b4a5(++_0x14e733);}(_0x0de2,0xa4));var _0x20de=function(_0x243dce,_0x548bcf){_0x243dce=_0x243dce-0x0;var _0x482b9d=_0x0de2[_0x243dce];return _0x482b9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20de('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x20de('0x1'));var moment=require(_0x20de('0x2'));var BPromise=require(_0x20de('0x3'));var Mustache=require(_0x20de('0x4'));var util=require('util');var path=require('path');var sox=require(_0x20de('0x5'));var csv=require('to-csv');var ejs=require(_0x20de('0x6'));var fs=require('fs');var fs_extra=require(_0x20de('0x7'));var _=require('lodash');var squel=require(_0x20de('0x8'));var crypto=require(_0x20de('0x9'));var jsforce=require(_0x20de('0xa'));var deskjs=require(_0x20de('0xb'));var toCsv=require(_0x20de('0xc'));var querystring=require(_0x20de('0xd'));var Papa=require(_0x20de('0xe'));var Redis=require('ioredis');var authService=require(_0x20de('0xf'));var qs=require(_0x20de('0x10'));var as=require(_0x20de('0x11'));var hardwareService=require(_0x20de('0x12'));var logger=require(_0x20de('0x13'))('api');var utils=require(_0x20de('0x14'));var config=require(_0x20de('0x15'));var licenseUtil=require(_0x20de('0x16'));var db=require(_0x20de('0x17'))['db'];var dbH=require('../../mysqldb')[_0x20de('0x18')];function respondWithStatusCode(_0x2604eb,_0x5d1775){_0x5d1775=_0x5d1775||0xcc;return function(_0x5fdad2){if(_0x5fdad2){return _0x2604eb['sendStatus'](_0x5d1775);}return _0x2604eb[_0x20de('0x19')](_0x5d1775)[_0x20de('0x1a')]();};}function respondWithResult(_0x570923,_0x274d51){_0x274d51=_0x274d51||0xc8;return function(_0x507803){if(_0x507803){return _0x570923[_0x20de('0x19')](_0x274d51)['json'](_0x507803);}};}function respondWithFilteredResult(_0x59bff,_0x18b7c2){return function(_0x3b52b5){if(_0x3b52b5){var _0x55552f=typeof _0x18b7c2['offset']===_0x20de('0x1b')&&typeof _0x18b7c2[_0x20de('0x1c')]==='undefined';var _0x35bd02=_0x3b52b5[_0x20de('0x1d')];var _0x1fb1ce=_0x55552f?0x0:_0x18b7c2['offset'];var _0x6600e7=_0x55552f?_0x3b52b5[_0x20de('0x1d')]:_0x18b7c2[_0x20de('0x1e')]+_0x18b7c2[_0x20de('0x1c')];var _0x266001;if(_0x6600e7>=_0x35bd02){_0x6600e7=_0x35bd02;_0x266001=0xc8;}else{_0x266001=0xce;}_0x59bff[_0x20de('0x19')](_0x266001);return _0x59bff[_0x20de('0x1f')](_0x20de('0x20'),_0x1fb1ce+'-'+_0x6600e7+'/'+_0x35bd02)[_0x20de('0x21')](_0x3b52b5);}return null;};}function patchUpdates(_0x3a97d7){return function(_0x2dd2ad){try{jsonpatch[_0x20de('0x22')](_0x2dd2ad,_0x3a97d7,!![]);}catch(_0x176b53){return BPromise['reject'](_0x176b53);}return _0x2dd2ad['save']();};}function saveUpdates(_0x1f3581,_0x5b2753){return function(_0x60b1c3){if(_0x60b1c3){return _0x60b1c3['update'](_0x1f3581)[_0x20de('0x23')](function(_0x290a73){return _0x290a73;});}return null;};}function removeEntity(_0x3ed8de,_0x21bd82){return function(_0x49dcd5){if(_0x49dcd5){return _0x49dcd5[_0x20de('0x24')]()[_0x20de('0x23')](function(){var _0x5b4db9=_0x49dcd5[_0x20de('0x25')]({'plain':!![]});var _0x2a81bc='CustomReports';return db[_0x20de('0x26')][_0x20de('0x24')]({'where':{'type':_0x2a81bc,'resourceId':_0x5b4db9['id']}})['then'](function(){return _0x49dcd5;});})['then'](function(){_0x3ed8de[_0x20de('0x19')](0xcc)[_0x20de('0x1a')]();});}};}function handleEntityNotFound(_0x17444e,_0x4f5951){return function(_0x346d3d){if(!_0x346d3d){_0x17444e[_0x20de('0x27')](0x194);}return _0x346d3d;};}function handleError(_0x32131e,_0x366839){_0x366839=_0x366839||0x1f4;return function(_0xd2c589){logger[_0x20de('0x28')](_0xd2c589[_0x20de('0x29')]);if(_0xd2c589[_0x20de('0x2a')]){delete _0xd2c589['name'];}_0x32131e[_0x20de('0x19')](_0x366839)[_0x20de('0x2b')](_0xd2c589);};}exports[_0x20de('0x2c')]=function(_0x1ffe28,_0x4a4c23){var _0x592c31={},_0x3630c0={},_0x1c3f32={'count':0x0,'rows':[]};var _0x5f17b6=_[_0x20de('0x2d')](db[_0x20de('0x2e')][_0x20de('0x2f')],function(_0x2409f6){return{'name':_0x2409f6[_0x20de('0x30')],'type':_0x2409f6[_0x20de('0x31')][_0x20de('0x32')]};});_0x3630c0[_0x20de('0x33')]=_[_0x20de('0x2d')](_0x5f17b6,_0x20de('0x2a'));_0x3630c0[_0x20de('0x34')]=_[_0x20de('0x35')](_0x1ffe28[_0x20de('0x34')]);_0x3630c0[_0x20de('0x36')]=_[_0x20de('0x37')](_0x3630c0[_0x20de('0x33')],_0x3630c0[_0x20de('0x34')]);_0x592c31[_0x20de('0x38')]=_[_0x20de('0x37')](_0x3630c0[_0x20de('0x33')],qs[_0x20de('0x39')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x39')]));_0x592c31[_0x20de('0x38')]=_0x592c31['attributes']['length']?_0x592c31[_0x20de('0x38')]:_0x3630c0[_0x20de('0x33')];if(!_0x1ffe28[_0x20de('0x34')]['hasOwnProperty']('nolimit')){_0x592c31[_0x20de('0x1c')]=qs[_0x20de('0x1c')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x1c')]);_0x592c31['offset']=qs[_0x20de('0x1e')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x1e')]);}_0x592c31[_0x20de('0x3a')]=qs[_0x20de('0x3b')](_0x1ffe28[_0x20de('0x34')]['sort']);_0x592c31[_0x20de('0x3c')]=qs['filters'](_['pick'](_0x1ffe28[_0x20de('0x34')],_0x3630c0[_0x20de('0x36')]),_0x5f17b6);if(_0x1ffe28['query'][_0x20de('0x3d')]){_0x592c31[_0x20de('0x3c')]=_[_0x20de('0x3e')](_0x592c31[_0x20de('0x3c')],{'$or':_['map'](_0x5f17b6,function(_0x50f47c){if(_0x50f47c[_0x20de('0x31')]!==_0x20de('0x3f')){var _0x4095c7={};_0x4095c7[_0x50f47c[_0x20de('0x2a')]]={'$like':'%'+_0x1ffe28[_0x20de('0x34')][_0x20de('0x3d')]+'%'};return _0x4095c7;}})});}_0x592c31=_['merge']({},_0x592c31,_0x1ffe28[_0x20de('0x40')]);var _0x3f733d={'where':_0x592c31[_0x20de('0x3c')]};return db[_0x20de('0x2e')][_0x20de('0x1d')](_0x3f733d)[_0x20de('0x23')](function(_0x108c2e){_0x1c3f32[_0x20de('0x1d')]=_0x108c2e;if(_0x1ffe28[_0x20de('0x34')][_0x20de('0x41')]){_0x592c31[_0x20de('0x42')]=[{'all':!![]}];}return db[_0x20de('0x2e')][_0x20de('0x43')](_0x592c31);})[_0x20de('0x23')](function(_0x543247){_0x1c3f32[_0x20de('0x44')]=_0x543247;return _0x1c3f32;})[_0x20de('0x23')](respondWithFilteredResult(_0x4a4c23,_0x592c31))[_0x20de('0x45')](handleError(_0x4a4c23,null));};exports[_0x20de('0x46')]=function(_0x183fb7,_0x66bf6f){var _0xedc9c9={'raw':![],'where':{'id':_0x183fb7['params']['id']}},_0x4d2afc={};_0x4d2afc['model']=_[_0x20de('0x35')](db['AnalyticCustomReport'][_0x20de('0x2f')]);_0x4d2afc['query']=_['keys'](_0x183fb7[_0x20de('0x34')]);_0x4d2afc[_0x20de('0x36')]=_[_0x20de('0x37')](_0x4d2afc[_0x20de('0x33')],_0x4d2afc[_0x20de('0x34')]);_0xedc9c9[_0x20de('0x38')]=_['intersection'](_0x4d2afc[_0x20de('0x33')],qs[_0x20de('0x39')](_0x183fb7[_0x20de('0x34')][_0x20de('0x39')]));_0xedc9c9['attributes']=_0xedc9c9[_0x20de('0x38')][_0x20de('0x47')]?_0xedc9c9[_0x20de('0x38')]:_0x4d2afc[_0x20de('0x33')];if(_0x183fb7[_0x20de('0x34')]['includeAll']){_0xedc9c9[_0x20de('0x42')]=[{'all':!![]}];}_0xedc9c9=_['merge']({},_0xedc9c9,_0x183fb7[_0x20de('0x40')]);return db[_0x20de('0x2e')][_0x20de('0x48')](_0xedc9c9)['then'](handleEntityNotFound(_0x66bf6f,null))['then'](respondWithResult(_0x66bf6f,null))[_0x20de('0x45')](handleError(_0x66bf6f,null));};exports[_0x20de('0x49')]=function(_0x2d06c5,_0x32b786){return db['AnalyticCustomReport'][_0x20de('0x49')](_0x2d06c5[_0x20de('0x4a')],{})[_0x20de('0x23')](function(_0x50b241){var _0x1cef99=_0x2d06c5[_0x20de('0x4b')]['get']({'plain':!![]});if(!_0x1cef99)throw new Error(_0x20de('0x4c'));if(_0x1cef99[_0x20de('0x4d')]===_0x20de('0x4b')){var _0x1a8f75=_0x50b241[_0x20de('0x25')]({'plain':!![]});var _0x432b0c=_0x20de('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x432b0c,'userProfileId':_0x1cef99[_0x20de('0x4f')]},'raw':!![]})[_0x20de('0x23')](function(_0x388dec){if(_0x388dec&&_0x388dec[_0x20de('0x50')]===0x0){return db['UserProfileResource'][_0x20de('0x49')]({'name':_0x1a8f75['name'],'resourceId':_0x1a8f75['id'],'type':'CustomReports','sectionId':_0x388dec['id']},{})['then'](function(){return _0x50b241;});}else{return _0x50b241;}})[_0x20de('0x45')](function(_0x5277d2){logger[_0x20de('0x28')](_0x20de('0x51'),_0x5277d2);throw _0x5277d2;});}return _0x50b241;})[_0x20de('0x23')](respondWithResult(_0x32b786,0xc9))[_0x20de('0x45')](handleError(_0x32b786,null));};exports[_0x20de('0x52')]=function(_0x2c1c75,_0x5df128){if(_0x2c1c75[_0x20de('0x4a')]['id']){delete _0x2c1c75['body']['id'];}return db[_0x20de('0x2e')][_0x20de('0x48')]({'where':{'id':_0x2c1c75[_0x20de('0x53')]['id']}})[_0x20de('0x23')](handleEntityNotFound(_0x5df128,null))[_0x20de('0x23')](saveUpdates(_0x2c1c75[_0x20de('0x4a')],null))[_0x20de('0x23')](respondWithResult(_0x5df128,null))[_0x20de('0x45')](handleError(_0x5df128,null));};exports[_0x20de('0x24')]=function(_0x527d14,_0x1756ac){return db[_0x20de('0x2e')][_0x20de('0x48')]({'where':{'id':_0x527d14['params']['id']}})[_0x20de('0x23')](handleEntityNotFound(_0x1756ac,null))[_0x20de('0x23')](removeEntity(_0x1756ac,null))['catch'](handleError(_0x1756ac,null));};exports[_0x20de('0x54')]=function(_0x96cdcb,_0x3cdf99){var _0x446dc2=0xa;var _0x5f19a4=[_0x20de('0x55'),_0x20de('0x56'),_0x20de('0x57'),_0x20de('0x58')];var _0x24a16b={'SUM':_0x20de('0x59'),'COUNT':_0x20de('0x5a'),'COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':_0x20de('0x5e'),'GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x3983bd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x20de('0x60'),'ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x3a8d51=function(_0x5e7e26){return!_[_0x20de('0x63')]([_0x20de('0x64'),_0x20de('0x65'),_0x20de('0x66'),_0x20de('0x67')],_0x5e7e26);};var _0x814e83=function(_0x5ddc25){if(!_0x5ddc25||!_0x5ddc25[_0x20de('0x68')]['length']){return'';}for(var _0x142de='(',_0x1207e4=0x0;_0x1207e4<_0x5ddc25[_0x20de('0x68')][_0x20de('0x47')];_0x1207e4+=0x1){_0x1207e4>0x0&&(_0x142de+='\x20'+_0x5ddc25[_0x20de('0x69')]+'\x20');_0x142de+=_0x5ddc25['rules'][_0x1207e4][_0x20de('0x6a')]?_0x814e83(_0x5ddc25['rules'][_0x1207e4][_0x20de('0x6a')]):_0x5ddc25[_0x20de('0x68')][_0x1207e4]['field']+'\x20'+_0x5ddc25[_0x20de('0x68')][_0x1207e4][_0x20de('0x6b')]+(_0x3a8d51(_0x5ddc25[_0x20de('0x68')][_0x1207e4]['condition'])?'\x20'+_0x5ddc25[_0x20de('0x68')][_0x1207e4][_0x20de('0x6c')]:'');}return _0x142de+')';};var _0x1e987f={'where':{'id':_0x96cdcb[_0x20de('0x53')]['id']}},_0x4ed5c7,_0x117f53,_0x158d52,_0x39929e,_0x3e2a2f;_0x1e987f=_['merge']({},_0x1e987f,_0x96cdcb[_0x20de('0x40')]);return db[_0x20de('0x2e')][_0x20de('0x48')](_0x1e987f)[_0x20de('0x23')](function(_0x197557){if(_0x197557){_0x4ed5c7=_0x197557;return _0x197557[_0x20de('0x6d')]();}return null;})[_0x20de('0x23')](function(_0x8bb939){if(_0x8bb939){if(!_0x8bb939[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))][(_0x20de('0x6f'))](_0x20de('0x70'),0x193);}_0x117f53=_0x8bb939;return db[_0x20de('0x71')][_0x20de('0x43')]({'raw':!![]});}return null;})[_0x20de('0x23')](function(_0x1d6e97){if(_0x1d6e97){_0x158d52=_[_0x20de('0x72')](_0x1d6e97,'id');var _0x3d0241;var _0x266299=squel[_0x20de('0x73')]();_0x266299[_0x20de('0x74')](_0x4ed5c7[_0x20de('0x75')]);for(var _0x128653=0x0;_0x128653<_0x117f53[_0x20de('0x47')];_0x128653+=0x1){_0x3d0241=_0x117f53[_0x128653][_0x20de('0x76')]?_0x158d52[_0x117f53[_0x128653][_0x20de('0x76')]]['metric']:_0x117f53[_0x128653][_0x20de('0x77')];_0x3d0241=_0x117f53[_0x128653][_0x20de('0x78')]?_[_0x20de('0x79')](_0x24a16b[_0x117f53[_0x128653][_0x20de('0x78')]],'%s',_0x3d0241):_0x3d0241;_0x3d0241=_0x117f53[_0x128653][_0x20de('0x7a')]?_['replace'](_0x3983bd[_0x117f53[_0x128653]['format']],'%s',_0x3d0241):_0x3d0241;if(_0x117f53[_0x128653]['groupBy']){_0x266299['group'](_0x3d0241);}_0x117f53[_0x128653][_0x20de('0x7b')]&&_0x266299[_0x20de('0x3a')](_0x3d0241,_0x117f53[_0x128653][_0x20de('0x7b')]===_0x20de('0x7c')?![]:!![]);_0x266299[_0x20de('0x77')](_0x3d0241,_0x117f53[_0x128653][_0x20de('0x7d')]||_0x3d0241);}if(_0x4ed5c7[_0x20de('0x7e')]){_0x4ed5c7[_0x20de('0x7e')]=JSON['parse'](_0x4ed5c7[_0x20de('0x7e')]);for(var _0x8a21d9=0x0;_0x8a21d9<_0x4ed5c7[_0x20de('0x7e')][_0x20de('0x47')];_0x8a21d9+=0x1){if(_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x31')]&&_['includes'](_0x5f19a4,_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x31')])&&_0x4ed5c7['joins'][_0x8a21d9]['parentKey']&&_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x7f')]&&_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['foreignKey']){_0x266299[_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['type']](_0x4ed5c7['joins'][_0x8a21d9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4ed5c7[_0x20de('0x75')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x80')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x7f')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['foreignKey']));}}}if(_0x4ed5c7[_0x20de('0x81')]){_0x4ed5c7[_0x20de('0x81')]=JSON['parse'](_0x4ed5c7[_0x20de('0x81')]);_0x266299[_0x20de('0x3c')](_0x814e83(_0x4ed5c7[_0x20de('0x81')][_0x20de('0x6a')]));}_0x3e2a2f=_0x266299[_0x20de('0x82')]();_0x266299[_0x20de('0x1c')](_0x446dc2);_0x266299[_0x20de('0x1e')](0x0);logger[_0x20de('0x83')](_0x20de('0x84'),_0x266299[_0x20de('0x85')]());return dbH['sequelize']['query'](_0x266299[_0x20de('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x20de('0x23')](respondWithResult(_0x3cdf99,null))[_0x20de('0x45')](handleError(_0x3cdf99,null));};function runReport(_0x4e7b85,_0xe3aa,_0x52f3da){var _0x722e15=_0xe3aa[_0x20de('0x2a')];var _0x33b510=0xa;var _0x31099a=[_0x20de('0x55'),'left_join',_0x20de('0x57'),_0x20de('0x58')];var _0x227154={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':_0x20de('0x86'),'AVG':_0x20de('0x87'),'GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x3fbde9={'SEC_TO_TIME':_0x20de('0x88'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x1dbd8f=function(_0x588564){return!_[_0x20de('0x63')]([_0x20de('0x64'),_0x20de('0x65'),_0x20de('0x66'),_0x20de('0x67')],_0x588564);};var _0x236f5f=function(_0x2e7f49){if(!_0x2e7f49||!_0x2e7f49[_0x20de('0x68')][_0x20de('0x47')]){return'';}for(var _0x2479a4='(',_0x33ff2d=0x0;_0x33ff2d<_0x2e7f49[_0x20de('0x68')][_0x20de('0x47')];_0x33ff2d+=0x1){_0x33ff2d>0x0&&(_0x2479a4+='\x20'+_0x2e7f49[_0x20de('0x69')]+'\x20');_0x2479a4+=_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x6a')]?_0x236f5f(_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x6a')]):_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x77')]+'\x20'+_0x2e7f49['rules'][_0x33ff2d][_0x20de('0x6b')]+(_0x1dbd8f(_0x2e7f49['rules'][_0x33ff2d][_0x20de('0x6b')])?'\x20'+_0x2e7f49[_0x20de('0x68')][_0x33ff2d]['value']:'');}return _0x2479a4+')';};var _0x436bbc={'where':{'id':_0x4e7b85['id']}},_0x17bd43,_0x251755,_0x452c4b,_0x22d9a2,_0x3a2178;_0x436bbc=_['merge']({},_0x436bbc,_0x52f3da);return db[_0x20de('0x2e')][_0x20de('0x48')](_0x436bbc)[_0x20de('0x23')](function(_0x20efee){if(_0x20efee){_0x17bd43=_0x20efee;return _0x20efee['getFields']();}return null;})[_0x20de('0x23')](function(_0x403d4f){if(_0x403d4f){if(!_0x403d4f[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))]['ValidationErrorItem'](_0x20de('0x70'),0x193);}_0x251755=_0x403d4f;return db[_0x20de('0x71')][_0x20de('0x43')]({'raw':!![]});}return null;})['then'](function(_0xd45925){if(_0xd45925){_0x452c4b=_['keyBy'](_0xd45925,'id');var _0x32da10;var _0x59138f=squel[_0x20de('0x73')]();_0x59138f['from'](_0x17bd43[_0x20de('0x75')]);for(var _0x3f6685=0x0;_0x3f6685<_0x251755[_0x20de('0x47')];_0x3f6685+=0x1){_0x32da10=_0x251755[_0x3f6685][_0x20de('0x76')]?_0x452c4b[_0x251755[_0x3f6685]['MetricId']][_0x20de('0x89')]:_0x251755[_0x3f6685][_0x20de('0x77')];_0x32da10=_0x251755[_0x3f6685][_0x20de('0x78')]?_[_0x20de('0x79')](_0x227154[_0x251755[_0x3f6685]['function']],'%s',_0x32da10):_0x32da10;_0x32da10=_0x251755[_0x3f6685][_0x20de('0x7a')]?_[_0x20de('0x79')](_0x3fbde9[_0x251755[_0x3f6685]['format']],'%s',_0x32da10):_0x32da10;if(_0x251755[_0x3f6685][_0x20de('0x8a')]){_0x59138f[_0x20de('0x6a')](_0x32da10);}_0x251755[_0x3f6685][_0x20de('0x7b')]&&_0x59138f[_0x20de('0x3a')](_0x32da10,_0x251755[_0x3f6685]['orderBy']===_0x20de('0x7c')?![]:!![]);_0x59138f['field'](_0x32da10,_0x251755[_0x3f6685][_0x20de('0x7d')]||_0x32da10);}if(_0x17bd43[_0x20de('0x7e')]){_0x17bd43[_0x20de('0x7e')]=JSON['parse'](_0x17bd43[_0x20de('0x7e')]);for(var _0x30a7b3=0x0;_0x30a7b3<_0x17bd43[_0x20de('0x7e')][_0x20de('0x47')];_0x30a7b3+=0x1){if(_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['type']&&_['includes'](_0x31099a,_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x31')])&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x80')]&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignTable']&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x8b')]){_0x59138f[_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x31')]](_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignTable'],null,util[_0x20de('0x7a')](_0x20de('0x8c'),_0x17bd43[_0x20de('0x75')],_0x17bd43['joins'][_0x30a7b3][_0x20de('0x80')],_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x7f')],_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignKey']));}}}if(_0x17bd43[_0x20de('0x81')]){_0x17bd43[_0x20de('0x81')]=JSON[_0x20de('0x8d')](_0x17bd43['conditions']);_0x59138f[_0x20de('0x3c')](_0x236f5f(_0x17bd43[_0x20de('0x81')]['group']));}_0x3a2178=_0x59138f['clone']();_0x59138f[_0x20de('0x1c')](_0x33b510);_0x59138f[_0x20de('0x1e')](0x0);return;}})[_0x20de('0x23')](function(){if(_0xe3aa[_0x20de('0x8e')]===_0x20de('0x8f')){return null;}var _0x390d5a=_[_0x20de('0x3e')](_0xe3aa,{'name':_0xe3aa[_0x20de('0x90')]||_0xe3aa[_0x20de('0x2a')]||_0x17bd43[_0x20de('0x2a')],'basename':_0x722e15,'savename':util[_0x20de('0x7a')](_0x20de('0x91'),_0xe3aa[_0x20de('0x2a')]||_0x17bd43['name'],require(_0x20de('0x92'))[_0x20de('0x93')](0x4),_0xe3aa[_0x20de('0x8e')]||_0x20de('0x94')),'reportId':_0x17bd43['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x20de('0x49')](_0x390d5a,{'raw':!![]});})[_0x20de('0x23')](function(_0x5a0153){if(_0x17bd43[_0x20de('0x75')]===_0x20de('0x95')){_0x3a2178[_0x20de('0x3c')](_0x17bd43[_0x20de('0x75')]+_0x20de('0x96'),_0xe3aa[_0x20de('0x97')],_0xe3aa[_0x20de('0x98')]);}else{_0x3a2178[_0x20de('0x3c')](_0x17bd43[_0x20de('0x75')]+_0x20de('0x99'),_0xe3aa['startDate'],_0xe3aa[_0x20de('0x98')]);}if(_0x5a0153){logger['info']('Run\x20Query:',_0x3a2178[_0x20de('0x85')]());require(_0x20de('0x9a'))['fork'](path[_0x20de('0x55')](__dirname,_0x20de('0x9b'),_0x5a0153['output']),[_0x5a0153['id'],_0x3a2178[_0x20de('0x85')](),path[_0x20de('0x55')](__dirname,_0x20de('0x9c'),_0x5a0153[_0x20de('0x9d')]),_0x722e15]);return _0x5a0153;}else{var _0x2f8aa2=squel[_0x20de('0x73')]();_0x2f8aa2[_0x20de('0x74')]('('+_0x3a2178['toString']()+')',_0x20de('0x9e'));_0x2f8aa2[_0x20de('0x77')]('COUNT(*)',_0x20de('0x1d'));_0x3a2178[_0x20de('0x1c')](_0xe3aa['limit']||_0x33b510);_0x3a2178[_0x20de('0x1e')](_0xe3aa['offset']||0x0);return dbH[_0x20de('0x9f')][_0x20de('0x34')](_0x2f8aa2[_0x20de('0x85')](),{'type':dbH['sequelize'][_0x20de('0xa0')][_0x20de('0xa1')]})[_0x20de('0x23')](function(_0x2fc5fd){if(!_0x2fc5fd[_0x20de('0x47')]){_0x22d9a2=0x0;}else{_0x22d9a2=_0x2fc5fd[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3a2178[_0x20de('0x85')](),{'type':dbH[_0x20de('0x9f')][_0x20de('0xa0')][_0x20de('0xa1')]});})[_0x20de('0x23')](function(_0x86a25b){return{'rows':_0x86a25b||[],'count':_0x22d9a2};});}});}exports[_0x20de('0xa2')]=function(_0x221f00,_0x304bef){return runReport(_0x221f00[_0x20de('0x53')],_0x221f00[_0x20de('0x34')],_0x221f00[_0x20de('0x40')])[_0x20de('0x23')](respondWithResult(_0x304bef,null))[_0x20de('0x45')](handleError(_0x304bef,null));};exports[_0x20de('0xa3')]=runReport;exports[_0x20de('0x34')]=function(_0x1580b8,_0x5aab19){var _0x3f56bd=0xa;var _0x48fbc2=['join',_0x20de('0x56'),_0x20de('0x57'),'cross_join'];var _0x1de069={'SUM':_0x20de('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':'MIN(%s)','AVG':_0x20de('0x87'),'GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':_0x20de('0x5e'),'GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x27e217={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x20de('0xa4'),'HOUR':'HOUR(%s)','ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x1cbb97=function(_0x20dbb0){return!_[_0x20de('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x20de('0x67')],_0x20dbb0);};var _0x2bad66=function(_0xe52e8b){if(!_0xe52e8b||!_0xe52e8b[_0x20de('0x68')]['length']){return'';}for(var _0x540439='(',_0x2de639=0x0;_0x2de639<_0xe52e8b[_0x20de('0x68')]['length'];_0x2de639+=0x1){_0x2de639>0x0&&(_0x540439+='\x20'+_0xe52e8b['operator']+'\x20');_0x540439+=_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6a')]?_0x2bad66(_0xe52e8b['rules'][_0x2de639][_0x20de('0x6a')]):_0xe52e8b[_0x20de('0x68')][_0x2de639]['field']+'\x20'+_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6b')]+(_0x1cbb97(_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6b')])?'\x20'+_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6c')]:'');}return _0x540439+')';};var _0x2e2a9b={'where':{'id':_0x1580b8[_0x20de('0x53')]['id']}},_0x270220,_0x1b8e0c,_0x4078c,_0x2df4ef,_0x4fbbfb;_0x2e2a9b=_[_0x20de('0x3e')]({},_0x2e2a9b,_0x1580b8[_0x20de('0x40')]);return db['AnalyticCustomReport'][_0x20de('0x48')](_0x2e2a9b)[_0x20de('0x23')](function(_0x553613){if(_0x553613){_0x270220=_0x553613;return _0x553613['getFields']();}return null;})['then'](function(_0x557b26){if(_0x557b26){if(!_0x557b26[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))][(_0x20de('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1b8e0c=_0x557b26;return db['AnalyticMetric'][_0x20de('0x43')]({'raw':!![]});}return null;})[_0x20de('0x23')](function(_0x2e440d){if(_0x2e440d){_0x4078c=_[_0x20de('0x72')](_0x2e440d,'id');var _0x442d11;var _0x19a903=squel[_0x20de('0x73')]();_0x19a903[_0x20de('0x74')](_0x270220[_0x20de('0x75')]);for(var _0x6081b7=0x0;_0x6081b7<_0x1b8e0c[_0x20de('0x47')];_0x6081b7+=0x1){_0x442d11=_0x1b8e0c[_0x6081b7][_0x20de('0x76')]?_0x4078c[_0x1b8e0c[_0x6081b7][_0x20de('0x76')]][_0x20de('0x89')]:_0x1b8e0c[_0x6081b7][_0x20de('0x77')];_0x442d11=_0x1b8e0c[_0x6081b7][_0x20de('0x78')]?_[_0x20de('0x79')](_0x1de069[_0x1b8e0c[_0x6081b7][_0x20de('0x78')]],'%s',_0x442d11):_0x442d11;_0x442d11=_0x1b8e0c[_0x6081b7]['format']?_[_0x20de('0x79')](_0x27e217[_0x1b8e0c[_0x6081b7][_0x20de('0x7a')]],'%s',_0x442d11):_0x442d11;if(_0x1b8e0c[_0x6081b7][_0x20de('0x8a')]){_0x19a903[_0x20de('0x6a')](_0x442d11);}_0x1b8e0c[_0x6081b7][_0x20de('0x7b')]&&_0x19a903[_0x20de('0x3a')](_0x442d11,_0x1b8e0c[_0x6081b7][_0x20de('0x7b')]==='DESC'?![]:!![]);_0x19a903['field'](_0x442d11,_0x1b8e0c[_0x6081b7][_0x20de('0x7d')]||_0x442d11);}if(_0x270220[_0x20de('0x7e')]){_0x270220[_0x20de('0x7e')]=JSON[_0x20de('0x8d')](_0x270220[_0x20de('0x7e')]);for(var _0x53f423=0x0;_0x53f423<_0x270220[_0x20de('0x7e')]['length'];_0x53f423+=0x1){if(_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x31')]&&_[_0x20de('0x63')](_0x48fbc2,_0x270220['joins'][_0x53f423][_0x20de('0x31')])&&_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x80')]&&_0x270220['joins'][_0x53f423][_0x20de('0x7f')]&&_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x8b')]){_0x19a903[_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x31')]](_0x270220[_0x20de('0x7e')][_0x53f423]['foreignTable'],null,util[_0x20de('0x7a')](_0x20de('0x8c'),_0x270220[_0x20de('0x75')],_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x80')],_0x270220['joins'][_0x53f423][_0x20de('0x7f')],_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x8b')]));}}}if(_0x270220[_0x20de('0x81')]){_0x270220[_0x20de('0x81')]=JSON[_0x20de('0x8d')](_0x270220['conditions']);_0x19a903['where'](_0x2bad66(_0x270220['conditions'][_0x20de('0x6a')]));}_0x4fbbfb=_0x19a903[_0x20de('0x82')]();_0x19a903[_0x20de('0x1c')](_0x3f56bd);_0x19a903[_0x20de('0x1e')](0x0);logger[_0x20de('0x83')](_0x20de('0x84'),_0x19a903[_0x20de('0x85')]());return dbH[_0x20de('0x9f')]['query'](_0x19a903['toString'](),{'type':dbH[_0x20de('0x9f')]['QueryTypes'][_0x20de('0xa1')]});}})[_0x20de('0x23')](function(){return{'sql':_0x4fbbfb[_0x20de('0x85')]()};})[_0x20de('0x23')](respondWithResult(_0x5aab19,null))[_0x20de('0x45')](handleError(_0x5aab19,null));};
\ No newline at end of file
index cbfcf11..9c76b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a17=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports'];(function(_0x24a9eb,_0x3849df){var _0x37a2c7=function(_0x284101){while(--_0x284101){_0x24a9eb['push'](_0x24a9eb['shift']());}};_0x37a2c7(++_0x3849df);}(_0x5a17,0x84));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75a1('0x0'));var util=require('util');var logger=require(_0x75a1('0x1'))(_0x75a1('0x2'));var moment=require(_0x75a1('0x3'));var BPromise=require(_0x75a1('0x4'));var rp=require(_0x75a1('0x5'));var fs=require('fs');var path=require(_0x75a1('0x6'));var rimraf=require(_0x75a1('0x7'));var config=require(_0x75a1('0x8'));var attributes=require(_0x75a1('0x9'));module['exports']=function(_0xec4bca,_0x222bf8){return _0xec4bca[_0x75a1('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x75a1('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c05=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x1a20ec,_0x27626c){var _0x3a2ec1=function(_0xb45d54){while(--_0xb45d54){_0x1a20ec['push'](_0x1a20ec['shift']());}};_0x3a2ec1(++_0x27626c);}(_0x7c05,0x1d5));var _0x57c0=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0x7c05[_0x1635fe];return _0x3c512a;};'use strict';var _=require('lodash');var util=require(_0x57c0('0x0'));var logger=require(_0x57c0('0x1'))(_0x57c0('0x2'));var moment=require(_0x57c0('0x3'));var BPromise=require(_0x57c0('0x4'));var rp=require(_0x57c0('0x5'));var fs=require('fs');var path=require(_0x57c0('0x6'));var rimraf=require(_0x57c0('0x7'));var config=require(_0x57c0('0x8'));var attributes=require(_0x57c0('0x9'));module[_0x57c0('0xa')]=function(_0x5105cf,_0x51f340){return _0x5105cf['define']('AnalyticCustomReport',attributes,{'tableName':_0x57c0('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5d093e6..40fe6e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f3=['result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf7f3,0x10c));var _0x3f7f=function(_0x49ee10,_0x5803dc){_0x49ee10=_0x49ee10-0x0;var _0x36baa9=_0xf7f3[_0x49ee10];return _0x36baa9;};'use strict';var _=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var moment=require(_0x3f7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f7f('0x4'))(_0x3f7f('0x5'));var config=require(_0x3f7f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3f7f('0x7')][_0x3f7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x402b51,_0x2008d0,_0x337d1e){return new BPromise(function(_0x526ed8,_0x135905){return client['request'](_0x402b51,_0x337d1e)['then'](function(_0x3339d0){logger['info'](_0x3f7f('0x9'),_0x2008d0,_0x3f7f('0xa'));logger[_0x3f7f('0xb')](_0x3f7f('0xc'),_0x2008d0,_0x3f7f('0xa'),JSON['stringify'](_0x3339d0));if(_0x3339d0[_0x3f7f('0xd')]){if(_0x3339d0[_0x3f7f('0xd')][_0x3f7f('0xe')]===0x1f4){logger[_0x3f7f('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2008d0,_0x3339d0[_0x3f7f('0xd')][_0x3f7f('0xf')]);return _0x135905(_0x3339d0['error'][_0x3f7f('0xf')]);}logger[_0x3f7f('0xd')](_0x3f7f('0x9'),_0x2008d0,_0x3339d0[_0x3f7f('0xd')]['message']);return _0x526ed8(_0x3339d0['error'][_0x3f7f('0xf')]);}else{logger[_0x3f7f('0x10')](_0x3f7f('0x9'),_0x2008d0,_0x3f7f('0xa'));_0x526ed8(_0x3339d0[_0x3f7f('0x11')]['message']);}})[_0x3f7f('0x12')](function(_0xb62c0d){logger[_0x3f7f('0xd')](_0x3f7f('0x9'),_0x2008d0,_0xb62c0d);_0x135905(_0xb62c0d);});});}
\ No newline at end of file
+var _0x9bfd=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2a16ef,_0x535d6e){var _0x153854=function(_0x456a96){while(--_0x456a96){_0x2a16ef['push'](_0x2a16ef['shift']());}};_0x153854(++_0x535d6e);}(_0x9bfd,0x1db));var _0xd9bf=function(_0x3edf99,_0x4e6e49){_0x3edf99=_0x3edf99-0x0;var _0x4517ab=_0x9bfd[_0x3edf99];return _0x4517ab;};'use strict';var _=require(_0xd9bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd9bf('0x1'));var rs=require(_0xd9bf('0x2'));var fs=require('fs');var Redis=require(_0xd9bf('0x3'));var db=require(_0xd9bf('0x4'))['db'];var utils=require(_0xd9bf('0x5'));var logger=require(_0xd9bf('0x6'))('rpc');var config=require(_0xd9bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd9bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52015c,_0x547af8,_0x4ca0d9){return new BPromise(function(_0x41cbc8,_0x5652b1){return client[_0xd9bf('0x9')](_0x52015c,_0x4ca0d9)[_0xd9bf('0xa')](function(_0x698c3f){logger[_0xd9bf('0xb')](_0xd9bf('0xc'),_0x547af8,_0xd9bf('0xd'));logger['debug'](_0xd9bf('0xe'),_0x547af8,'request\x20sent',JSON[_0xd9bf('0xf')](_0x698c3f));if(_0x698c3f[_0xd9bf('0x10')]){if(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x547af8,_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);return _0x5652b1(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);}logger[_0xd9bf('0x10')](_0xd9bf('0xc'),_0x547af8,_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);return _0x41cbc8(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);}else{logger[_0xd9bf('0xb')](_0xd9bf('0xc'),_0x547af8,_0xd9bf('0xd'));_0x41cbc8(_0x698c3f['result'][_0xd9bf('0x12')]);}})[_0xd9bf('0x13')](function(_0x1ec35f){logger['error'](_0xd9bf('0xc'),_0x547af8,_0x1ec35f);_0x5652b1(_0x1ec35f);});});}
\ No newline at end of file
index 95b5ec1..b35b63c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3128=['/:id/run','run','/:id/query','post','create','put','/:id','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','preview'];(function(_0x2b58f8,_0x14f865){var _0x2af05b=function(_0x2c2bf3){while(--_0x2c2bf3){_0x2b58f8['push'](_0x2b58f8['shift']());}};_0x2af05b(++_0x14f865);}(_0x3128,0xd0));var _0x8312=function(_0x1e715a,_0x47db84){_0x1e715a=_0x1e715a-0x0;var _0x262f09=_0x3128[_0x1e715a];return _0x262f09;};'use strict';var multer=require(_0x8312('0x0'));var util=require(_0x8312('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8312('0x2'));var router=express[_0x8312('0x3')]();var fs_extra=require(_0x8312('0x4'));var auth=require(_0x8312('0x5'));var interaction=require(_0x8312('0x6'));var config=require('../../config/environment');var controller=require(_0x8312('0x7'));router[_0x8312('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8312('0x8')]('/:id',auth[_0x8312('0x9')](),controller['show']);router[_0x8312('0x8')](_0x8312('0xa'),auth[_0x8312('0x9')](),controller[_0x8312('0xb')]);router[_0x8312('0x8')](_0x8312('0xc'),auth['isAuthenticated'](),controller[_0x8312('0xd')]);router['get'](_0x8312('0xe'),auth[_0x8312('0x9')](),controller['query']);router[_0x8312('0xf')]('/',auth['isAuthenticated'](),controller[_0x8312('0x10')]);router[_0x8312('0x11')](_0x8312('0x12'),auth[_0x8312('0x9')](),controller['update']);router[_0x8312('0x13')](_0x8312('0x12'),auth[_0x8312('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x02cf=['preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x3ce43b,_0x23c483){var _0x195a45=function(_0x35ce15){while(--_0x35ce15){_0x3ce43b['push'](_0x3ce43b['shift']());}};_0x195a45(++_0x23c483);}(_0x02cf,0x8e));var _0xf02c=function(_0x1005b0,_0x4a2c2c){_0x1005b0=_0x1005b0-0x0;var _0x47ba52=_0x02cf[_0x1005b0];return _0x47ba52;};'use strict';var multer=require(_0xf02c('0x0'));var util=require(_0xf02c('0x1'));var path=require(_0xf02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf02c('0x3'));var router=express[_0xf02c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf02c('0x5'));var interaction=require(_0xf02c('0x6'));var config=require(_0xf02c('0x7'));var controller=require(_0xf02c('0x8'));router[_0xf02c('0x9')]('/',auth[_0xf02c('0xa')](),controller[_0xf02c('0xb')]);router[_0xf02c('0x9')]('/:id',auth[_0xf02c('0xa')](),controller[_0xf02c('0xc')]);router[_0xf02c('0x9')](_0xf02c('0xd'),auth[_0xf02c('0xa')](),controller[_0xf02c('0xe')]);router['get'](_0xf02c('0xf'),auth['isAuthenticated'](),controller[_0xf02c('0x10')]);router[_0xf02c('0x9')](_0xf02c('0x11'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x12')]);router[_0xf02c('0x13')]('/',auth['isAuthenticated'](),controller[_0xf02c('0x14')]);router[_0xf02c('0x15')](_0xf02c('0x16'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x17')]);router['delete'](_0xf02c('0x16'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x18')]);module[_0xf02c('0x19')]=router;
\ No newline at end of file
index f0f4e98..f38e47a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['sequelize','STRING','TEXT'];(function(_0x3633ca,_0x1396a7){var _0x9d28b6=function(_0x8e9faa){while(--_0x8e9faa){_0x3633ca['push'](_0x3633ca['shift']());}};_0x9d28b6(++_0x1396a7);}(_0x7217,0x19e));var _0x7721=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7217[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x207c=['STRING','TEXT','exports'];(function(_0x5e8e3f,_0x3b69e9){var _0x45f87c=function(_0x5accb4){while(--_0x5accb4){_0x5e8e3f['push'](_0x5e8e3f['shift']());}};_0x45f87c(++_0x3b69e9);}(_0x207c,0x1e8));var _0xc207=function(_0x5538a4,_0xe0b8b0){_0x5538a4=_0x5538a4-0x0;var _0x530a52=_0x207c[_0x5538a4];return _0x530a52;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}};
\ No newline at end of file
index 3ae2a5e..a59281a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x3c72b9,_0xb5650a){var _0x39ff7a=function(_0x45440d){while(--_0x45440d){_0x3c72b9['push'](_0x3c72b9['shift']());}};_0x39ff7a(++_0xb5650a);}(_0x1261,0x144));var _0x1126=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x1261[_0x40e854];return _0x1463b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xabce[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
index 23e6d79..660fa8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc48=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0xbc48,0x1e5));var _0x8bc4=function(_0x353d70,_0x139687){_0x353d70=_0x353d70-0x0;var _0x3ac2cd=_0xbc48[_0x353d70];return _0x3ac2cd;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var logger=require(_0x8bc4('0x2'))(_0x8bc4('0x3'));var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var rp=require(_0x8bc4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bc4('0x7'));var config=require(_0x8bc4('0x8'));var attributes=require(_0x8bc4('0x9'));module['exports']=function(_0xf0590e,_0x34c2de){return _0xf0590e[_0x8bc4('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x8bc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x955b=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','AnalyticDefaultReport'];(function(_0x22b028,_0x121029){var _0x535ac3=function(_0x10489a){while(--_0x10489a){_0x22b028['push'](_0x22b028['shift']());}};_0x535ac3(++_0x121029);}(_0x955b,0x6c));var _0xb955=function(_0x6dd9df,_0x30408f){_0x6dd9df=_0x6dd9df-0x0;var _0x4876f8=_0x955b[_0x6dd9df];return _0x4876f8;};'use strict';var _=require(_0xb955('0x0'));var util=require('util');var logger=require(_0xb955('0x1'))(_0xb955('0x2'));var moment=require(_0xb955('0x3'));var BPromise=require(_0xb955('0x4'));var rp=require(_0xb955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb955('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xb955('0x7')]=function(_0x4afbf0,_0x3d3cf0){return _0x4afbf0['define'](_0xb955('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9334b5a..1fdc939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x839d=['request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x4b947b,_0x2c9616){var _0x3e2ad4=function(_0x26aea0){while(--_0x26aea0){_0x4b947b['push'](_0x4b947b['shift']());}};_0x3e2ad4(++_0x2c9616);}(_0x839d,0x1ac));var _0xd839=function(_0x3ecd89,_0x382241){_0x3ecd89=_0x3ecd89-0x0;var _0x336a23=_0x839d[_0x3ecd89];return _0x336a23;};'use strict';var _=require('lodash');var util=require(_0xd839('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd839('0x1'));var db=require(_0xd839('0x2'))['db'];var utils=require(_0xd839('0x3'));var logger=require(_0xd839('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd839('0x5'));var client=jayson['client'][_0xd839('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe800ae,_0x45e25b,_0x203ce3){return new BPromise(function(_0x5290b4,_0x2f2dfc){return client[_0xd839('0x7')](_0xe800ae,_0x203ce3)['then'](function(_0x29c40c){logger['info'](_0xd839('0x8'),_0x45e25b,_0xd839('0x9'));logger[_0xd839('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x45e25b,_0xd839('0x9'),JSON[_0xd839('0xb')](_0x29c40c));if(_0x29c40c[_0xd839('0xc')]){if(_0x29c40c[_0xd839('0xc')]['code']===0x1f4){logger['error'](_0xd839('0x8'),_0x45e25b,_0x29c40c['error']['message']);return _0x2f2dfc(_0x29c40c['error'][_0xd839('0xd')]);}logger[_0xd839('0xc')](_0xd839('0x8'),_0x45e25b,_0x29c40c[_0xd839('0xc')][_0xd839('0xd')]);return _0x5290b4(_0x29c40c[_0xd839('0xc')][_0xd839('0xd')]);}else{logger['info'](_0xd839('0x8'),_0x45e25b,'request\x20sent');_0x5290b4(_0x29c40c[_0xd839('0xe')][_0xd839('0xd')]);}})['catch'](function(_0x1bfd00){logger[_0xd839('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x45e25b,_0x1bfd00);_0x2f2dfc(_0x1bfd00);});});}
\ No newline at end of file
+var _0xf1ca=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1eac7d,_0x58765d){var _0x3ad894=function(_0x45bf38){while(--_0x45bf38){_0x1eac7d['push'](_0x1eac7d['shift']());}};_0x3ad894(++_0x58765d);}(_0xf1ca,0x1b4));var _0xaf1c=function(_0x49bc5b,_0x5ee349){_0x49bc5b=_0x49bc5b-0x0;var _0x341774=_0xf1ca[_0x49bc5b];return _0x341774;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaf1c('0x0'));var rs=require(_0xaf1c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf1c('0x2'))['db'];var utils=require(_0xaf1c('0x3'));var logger=require(_0xaf1c('0x4'))(_0xaf1c('0x5'));var config=require(_0xaf1c('0x6'));var jayson=require(_0xaf1c('0x7'));var client=jayson[_0xaf1c('0x8')][_0xaf1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a917,_0x1a0d6a,_0x40107d){return new BPromise(function(_0x1a04a2,_0x408011){return client[_0xaf1c('0xa')](_0x14a917,_0x40107d)[_0xaf1c('0xb')](function(_0x43d318){logger[_0xaf1c('0xc')](_0xaf1c('0xd'),_0x1a0d6a,'request\x20sent');logger[_0xaf1c('0xe')](_0xaf1c('0xf'),_0x1a0d6a,_0xaf1c('0x10'),JSON[_0xaf1c('0x11')](_0x43d318));if(_0x43d318[_0xaf1c('0x12')]){if(_0x43d318[_0xaf1c('0x12')][_0xaf1c('0x13')]===0x1f4){logger['error'](_0xaf1c('0xd'),_0x1a0d6a,_0x43d318['error'][_0xaf1c('0x14')]);return _0x408011(_0x43d318['error']['message']);}logger[_0xaf1c('0x12')](_0xaf1c('0xd'),_0x1a0d6a,_0x43d318['error'][_0xaf1c('0x14')]);return _0x1a04a2(_0x43d318[_0xaf1c('0x12')]['message']);}else{logger['info'](_0xaf1c('0xd'),_0x1a0d6a,'request\x20sent');_0x1a04a2(_0x43d318[_0xaf1c('0x15')][_0xaf1c('0x14')]);}})['catch'](function(_0x1061c0){logger['error'](_0xaf1c('0xd'),_0x1a0d6a,_0x1061c0);_0x408011(_0x1061c0);});});}
\ No newline at end of file
index 9872ce3..adce959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bdc=['put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create'];(function(_0x521054,_0x3640cb){var _0x40af5a=function(_0x12cce1){while(--_0x12cce1){_0x521054['push'](_0x521054['shift']());}};_0x40af5a(++_0x3640cb);}(_0x4bdc,0x18c));var _0xc4bd=function(_0x2f6f5f,_0x5ed9b0){_0x2f6f5f=_0x2f6f5f-0x0;var _0x55c4dd=_0x4bdc[_0x2f6f5f];return _0x55c4dd;};'use strict';var multer=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var path=require('path');var timeout=require(_0xc4bd('0x2'));var express=require(_0xc4bd('0x3'));var router=express[_0xc4bd('0x4')]();var fs_extra=require(_0xc4bd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc4bd('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x8')]);router[_0xc4bd('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc4bd('0xa')]);router[_0xc4bd('0x9')](_0xc4bd('0xb'),auth[_0xc4bd('0x7')](),controller[_0xc4bd('0xc')]);router['get'](_0xc4bd('0xd'),auth['isAuthenticated'](),controller[_0xc4bd('0xe')]);router[_0xc4bd('0x9')](_0xc4bd('0xf'),auth[_0xc4bd('0x7')](),controller['query']);router[_0xc4bd('0x10')]('/',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x11')]);router[_0xc4bd('0x12')](_0xc4bd('0x13'),auth['isAuthenticated'](),controller[_0xc4bd('0x14')]);router[_0xc4bd('0x15')]('/:id',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xd2f5=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1432a6,_0x5846c5){var _0x3eab00=function(_0x33871c){while(--_0x33871c){_0x1432a6['push'](_0x1432a6['shift']());}};_0x3eab00(++_0x5846c5);}(_0xd2f5,0x144));var _0x5d2f=function(_0x243bab,_0x1ff252){_0x243bab=_0x243bab-0x0;var _0x5ed762=_0xd2f5[_0x243bab];return _0x5ed762;};'use strict';var multer=require(_0x5d2f('0x0'));var util=require('util');var path=require(_0x5d2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d2f('0x2'));var router=express['Router']();var fs_extra=require(_0x5d2f('0x3'));var auth=require(_0x5d2f('0x4'));var interaction=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var controller=require(_0x5d2f('0x7'));router[_0x5d2f('0x8')]('/',auth[_0x5d2f('0x9')](),controller[_0x5d2f('0xa')]);router['get'](_0x5d2f('0xb'),auth[_0x5d2f('0x9')](),controller[_0x5d2f('0xc')]);router[_0x5d2f('0x8')](_0x5d2f('0xd'),auth[_0x5d2f('0x9')](),controller['preview']);router[_0x5d2f('0x8')](_0x5d2f('0xe'),auth['isAuthenticated'](),controller[_0x5d2f('0xf')]);router[_0x5d2f('0x8')](_0x5d2f('0x10'),auth['isAuthenticated'](),controller[_0x5d2f('0x11')]);router[_0x5d2f('0x12')]('/',auth[_0x5d2f('0x9')](),controller['create']);router['put'](_0x5d2f('0xb'),auth['isAuthenticated'](),controller[_0x5d2f('0x13')]);router[_0x5d2f('0x14')]('/:id',auth[_0x5d2f('0x9')](),controller['destroy']);module[_0x5d2f('0x15')]=router;
\ No newline at end of file
index 8afd318..ade02ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb989=['pdf','xlsx','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x29df6c,_0x54aa08){var _0x3afad4=function(_0xf64dbc){while(--_0xf64dbc){_0x29df6c['push'](_0x29df6c['shift']());}};_0x3afad4(++_0x54aa08);}(_0xb989,0x1db));var _0x9b98=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xb989[_0x198446];return _0x38d7b7;};'use strict';var Sequelize=require(_0x9b98('0x0'));var moment=require(_0x9b98('0x1'));module[_0x9b98('0x2')]={'name':{'type':Sequelize[_0x9b98('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9b98('0x4')](_0x9b98('0x5'),_0x9b98('0x6'),_0x9b98('0x7')),'allowNull':![],'defaultValue':_0x9b98('0x5')},'savename':{'type':Sequelize[_0x9b98('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9b98('0x8')]},'endDate':{'type':Sequelize[_0x9b98('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9b98('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x9b98('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x9b98('0xb')](0xb)[_0x9b98('0xc')]},'reportType':{'type':Sequelize[_0x9b98('0x3')]}};
\ No newline at end of file
+var _0x0d69=['Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','pdf','xlsx','csv'];(function(_0x530508,_0x351210){var _0x83aeac=function(_0x439763){while(--_0x439763){_0x530508['push'](_0x530508['shift']());}};_0x83aeac(++_0x351210);}(_0x0d69,0xba));var _0x90d6=function(_0x53df14,_0xc24eba){_0x53df14=_0x53df14-0x0;var _0x4c4e2d=_0x0d69[_0x53df14];return _0x4c4e2d;};'use strict';var Sequelize=require(_0x90d6('0x0'));var moment=require('moment');module[_0x90d6('0x1')]={'name':{'type':Sequelize[_0x90d6('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x90d6('0x3'),_0x90d6('0x4')),'allowNull':![],'defaultValue':_0x90d6('0x5')},'savename':{'type':Sequelize[_0x90d6('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x90d6('0x2')],'defaultValue':_0x90d6('0x6')},'type':{'type':Sequelize[_0x90d6('0x7')](_0x90d6('0x8'),_0x90d6('0x9')),'allowNull':![],'defaultValue':_0x90d6('0x8')},'reportId':{'type':Sequelize[_0x90d6('0xa')](0xb)[_0x90d6('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8437a9c..f27c199 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f1c=['request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9f1c,0x1eb));var _0xc9f1=function(_0x508140,_0x1bce34){_0x508140=_0x508140-0x0;var _0x4d57d4=_0x9f1c[_0x508140];return _0x4d57d4;};'use strict';var emlformat=require(_0xc9f1('0x0'));var rimraf=require(_0xc9f1('0x1'));var zipdir=require(_0xc9f1('0x2'));var jsonpatch=require(_0xc9f1('0x3'));var rp=require(_0xc9f1('0x4'));var moment=require('moment');var BPromise=require(_0xc9f1('0x5'));var Mustache=require(_0xc9f1('0x6'));var util=require('util');var path=require(_0xc9f1('0x7'));var sox=require(_0xc9f1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9f1('0x9'));var _=require(_0xc9f1('0xa'));var squel=require(_0xc9f1('0xb'));var crypto=require('crypto');var jsforce=require(_0xc9f1('0xc'));var deskjs=require(_0xc9f1('0xd'));var toCsv=require(_0xc9f1('0xe'));var querystring=require(_0xc9f1('0xf'));var Papa=require(_0xc9f1('0x10'));var Redis=require(_0xc9f1('0x11'));var authService=require(_0xc9f1('0x12'));var qs=require(_0xc9f1('0x13'));var as=require(_0xc9f1('0x14'));var hardwareService=require(_0xc9f1('0x15'));var logger=require('../../config/logger')(_0xc9f1('0x16'));var utils=require(_0xc9f1('0x17'));var config=require(_0xc9f1('0x18'));var licenseUtil=require(_0xc9f1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x134355,_0x4c53d7){_0x4c53d7=_0x4c53d7||0xcc;return function(_0x51a917){if(_0x51a917){return _0x134355[_0xc9f1('0x1a')](_0x4c53d7);}return _0x134355[_0xc9f1('0x1b')](_0x4c53d7)[_0xc9f1('0x1c')]();};}function respondWithResult(_0x1d2ef0,_0x3178fd){_0x3178fd=_0x3178fd||0xc8;return function(_0x324426){if(_0x324426){return _0x1d2ef0['status'](_0x3178fd)[_0xc9f1('0x1d')](_0x324426);}};}function respondWithFilteredResult(_0x2798b7,_0x7d879c){return function(_0x3ef2a7){if(_0x3ef2a7){var _0x3e8bf2=typeof _0x7d879c[_0xc9f1('0x1e')]===_0xc9f1('0x1f')&&typeof _0x7d879c[_0xc9f1('0x20')]==='undefined';var _0x590391=_0x3ef2a7[_0xc9f1('0x21')];var _0x499ce1=_0x3e8bf2?0x0:_0x7d879c[_0xc9f1('0x1e')];var _0x3d6558=_0x3e8bf2?_0x3ef2a7[_0xc9f1('0x21')]:_0x7d879c[_0xc9f1('0x1e')]+_0x7d879c['limit'];var _0x3f7b5e;if(_0x3d6558>=_0x590391){_0x3d6558=_0x590391;_0x3f7b5e=0xc8;}else{_0x3f7b5e=0xce;}_0x2798b7['status'](_0x3f7b5e);return _0x2798b7['set'](_0xc9f1('0x22'),_0x499ce1+'-'+_0x3d6558+'/'+_0x590391)[_0xc9f1('0x1d')](_0x3ef2a7);}return null;};}function patchUpdates(_0xfb073){return function(_0x464383){try{jsonpatch[_0xc9f1('0x23')](_0x464383,_0xfb073,!![]);}catch(_0x3495be){return BPromise['reject'](_0x3495be);}return _0x464383[_0xc9f1('0x24')]();};}function saveUpdates(_0x26e2ea,_0x2fc0c2){return function(_0x4945fa){if(_0x4945fa){return _0x4945fa['update'](_0x26e2ea)['then'](function(_0x721f98){return _0x721f98;});}return null;};}function removeEntity(_0x534a4b,_0x95cafe){return function(_0x1b7b16){if(_0x1b7b16){return _0x1b7b16[_0xc9f1('0x25')]()[_0xc9f1('0x26')](function(){var _0x3025c0=_0x1b7b16[_0xc9f1('0x27')]({'plain':!![]});var _0x6d932=_0xc9f1('0x28');return db[_0xc9f1('0x29')][_0xc9f1('0x25')]({'where':{'type':_0x6d932,'resourceId':_0x3025c0['id']}})[_0xc9f1('0x26')](function(){return _0x1b7b16;});})[_0xc9f1('0x26')](function(){_0x534a4b[_0xc9f1('0x1b')](0xcc)[_0xc9f1('0x1c')]();});}};}function handleEntityNotFound(_0x1aa763,_0x2573d1){return function(_0x33069d){if(!_0x33069d){_0x1aa763[_0xc9f1('0x1a')](0x194);}return _0x33069d;};}function handleError(_0xcb1a0e,_0x23b457){_0x23b457=_0x23b457||0x1f4;return function(_0x31960c){logger[_0xc9f1('0x2a')](_0x31960c[_0xc9f1('0x2b')]);if(_0x31960c['name']){delete _0x31960c[_0xc9f1('0x2c')];}_0xcb1a0e[_0xc9f1('0x1b')](_0x23b457)[_0xc9f1('0x2d')](_0x31960c);};}exports['index']=function(_0x5a3e5d,_0x18e0b7){var _0x391f28={},_0x506ddb={},_0x3e3af3={'count':0x0,'rows':[]};var _0x59aff8=_['map'](db[_0xc9f1('0x2e')][_0xc9f1('0x2f')],function(_0x47e820){return{'name':_0x47e820[_0xc9f1('0x30')],'type':_0x47e820[_0xc9f1('0x31')][_0xc9f1('0x32')]};});_0x506ddb[_0xc9f1('0x33')]=_[_0xc9f1('0x34')](_0x59aff8,_0xc9f1('0x2c'));_0x506ddb[_0xc9f1('0x35')]=_[_0xc9f1('0x36')](_0x5a3e5d[_0xc9f1('0x35')]);_0x506ddb[_0xc9f1('0x37')]=_['intersection'](_0x506ddb[_0xc9f1('0x33')],_0x506ddb[_0xc9f1('0x35')]);_0x391f28[_0xc9f1('0x38')]=_[_0xc9f1('0x39')](_0x506ddb[_0xc9f1('0x33')],qs[_0xc9f1('0x3a')](_0x5a3e5d['query'][_0xc9f1('0x3a')]));_0x391f28['attributes']=_0x391f28[_0xc9f1('0x38')]['length']?_0x391f28['attributes']:_0x506ddb['model'];if(!_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x3b')](_0xc9f1('0x3c'))){_0x391f28['limit']=qs[_0xc9f1('0x20')](_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x20')]);_0x391f28[_0xc9f1('0x1e')]=qs[_0xc9f1('0x1e')](_0x5a3e5d['query'][_0xc9f1('0x1e')]);}_0x391f28[_0xc9f1('0x3d')]=qs[_0xc9f1('0x3e')](_0x5a3e5d['query']['sort']);_0x391f28[_0xc9f1('0x3f')]=qs[_0xc9f1('0x37')](_[_0xc9f1('0x40')](_0x5a3e5d[_0xc9f1('0x35')],_0x506ddb['filters']),_0x59aff8);if(_0x5a3e5d[_0xc9f1('0x35')]['filter']){_0x391f28[_0xc9f1('0x3f')]=_['merge'](_0x391f28[_0xc9f1('0x3f')],{'$or':_['map'](_0x59aff8,function(_0x581edd){if(_0x581edd[_0xc9f1('0x31')]!=='VIRTUAL'){var _0x123e24={};_0x123e24[_0x581edd[_0xc9f1('0x2c')]]={'$like':'%'+_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x41')]+'%'};return _0x123e24;}})});}_0x391f28=_[_0xc9f1('0x42')]({},_0x391f28,_0x5a3e5d['options']);var _0x59fb64={'where':_0x391f28[_0xc9f1('0x3f')]};return db['AnalyticExtractedReport'][_0xc9f1('0x21')](_0x59fb64)[_0xc9f1('0x26')](function(_0x3829d0){_0x3e3af3['count']=_0x3829d0;if(_0x5a3e5d[_0xc9f1('0x35')]['includeAll']){_0x391f28[_0xc9f1('0x43')]=[{'all':!![]}];}return db[_0xc9f1('0x2e')][_0xc9f1('0x44')](_0x391f28);})['then'](function(_0x2b2edf){_0x3e3af3[_0xc9f1('0x45')]=_0x2b2edf;return _0x3e3af3;})['then'](respondWithFilteredResult(_0x18e0b7,_0x391f28))[_0xc9f1('0x46')](handleError(_0x18e0b7,null));};exports[_0xc9f1('0x47')]=function(_0x412fb4,_0x5e54f7){var _0x124e6f={'raw':!![],'where':{'id':_0x412fb4['params']['id']}},_0x257861={};_0x257861[_0xc9f1('0x33')]=_[_0xc9f1('0x36')](db[_0xc9f1('0x2e')]['rawAttributes']);_0x257861[_0xc9f1('0x35')]=_[_0xc9f1('0x36')](_0x412fb4[_0xc9f1('0x35')]);_0x257861['filters']=_['intersection'](_0x257861[_0xc9f1('0x33')],_0x257861[_0xc9f1('0x35')]);_0x124e6f[_0xc9f1('0x38')]=_['intersection'](_0x257861[_0xc9f1('0x33')],qs[_0xc9f1('0x3a')](_0x412fb4[_0xc9f1('0x35')][_0xc9f1('0x3a')]));_0x124e6f['attributes']=_0x124e6f[_0xc9f1('0x38')][_0xc9f1('0x48')]?_0x124e6f[_0xc9f1('0x38')]:_0x257861[_0xc9f1('0x33')];if(_0x412fb4[_0xc9f1('0x35')][_0xc9f1('0x49')]){_0x124e6f[_0xc9f1('0x43')]=[{'all':!![]}];}_0x124e6f=_[_0xc9f1('0x42')]({},_0x124e6f,_0x412fb4['options']);return db[_0xc9f1('0x2e')][_0xc9f1('0x4a')](_0x124e6f)[_0xc9f1('0x26')](handleEntityNotFound(_0x5e54f7,null))[_0xc9f1('0x26')](respondWithResult(_0x5e54f7,null))[_0xc9f1('0x46')](handleError(_0x5e54f7,null));};exports['create']=function(_0x4936bb,_0x188e47){return db[_0xc9f1('0x2e')]['create'](_0x4936bb[_0xc9f1('0x4b')],{})['then'](function(_0x5d0e79){var _0x1591ab=_0x4936bb[_0xc9f1('0x4c')][_0xc9f1('0x27')]({'plain':!![]});if(!_0x1591ab)throw new Error(_0xc9f1('0x4d'));if(_0x1591ab['role']===_0xc9f1('0x4c')){var _0x2293ce=_0x5d0e79[_0xc9f1('0x27')]({'plain':!![]});var _0x216cd6=_0xc9f1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x216cd6,'userProfileId':_0x1591ab[_0xc9f1('0x4e')]},'raw':!![]})[_0xc9f1('0x26')](function(_0x3b9c42){if(_0x3b9c42&&_0x3b9c42[_0xc9f1('0x4f')]===0x0){return db[_0xc9f1('0x29')][_0xc9f1('0x50')]({'name':_0x2293ce[_0xc9f1('0x2c')],'resourceId':_0x2293ce['id'],'type':_0x3b9c42[_0xc9f1('0x2c')],'sectionId':_0x3b9c42['id']},{})[_0xc9f1('0x26')](function(){return _0x5d0e79;});}else{return _0x5d0e79;}})[_0xc9f1('0x46')](function(_0x4b6b01){logger[_0xc9f1('0x2a')](_0xc9f1('0x51'),_0x4b6b01);throw _0x4b6b01;});}return _0x5d0e79;})['then'](respondWithResult(_0x188e47,0xc9))['catch'](handleError(_0x188e47,null));};exports[_0xc9f1('0x52')]=function(_0x756aa5,_0x5cadfe){if(_0x756aa5[_0xc9f1('0x4b')]['id']){delete _0x756aa5[_0xc9f1('0x4b')]['id'];}return db[_0xc9f1('0x2e')][_0xc9f1('0x4a')]({'where':{'id':_0x756aa5[_0xc9f1('0x53')]['id']}})[_0xc9f1('0x26')](handleEntityNotFound(_0x5cadfe,null))[_0xc9f1('0x26')](saveUpdates(_0x756aa5[_0xc9f1('0x4b')],null))['then'](respondWithResult(_0x5cadfe,null))[_0xc9f1('0x46')](handleError(_0x5cadfe,null));};exports[_0xc9f1('0x25')]=function(_0x417a12,_0x1024f7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x417a12['params']['id']}})[_0xc9f1('0x26')](handleEntityNotFound(_0x1024f7,null))[_0xc9f1('0x26')](removeEntity(_0x1024f7,null))[_0xc9f1('0x46')](handleError(_0x1024f7,null));};exports[_0xc9f1('0x54')]=function(_0x49df79,_0x20b706,_0x5c7d41){return db['AnalyticExtractedReport'][_0xc9f1('0x4a')]({'where':{'id':_0x49df79[_0xc9f1('0x53')]['id']},'attributes':[_0xc9f1('0x2c'),'basename',_0xc9f1('0x55'),_0xc9f1('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x20b706,null))[_0xc9f1('0x26')](function(_0x149e99){if(_0x149e99){if(!fs[_0xc9f1('0x57')](path[_0xc9f1('0x58')](config['root'],_0xc9f1('0x59'),_0x149e99['savename']))){throw new db[(_0xc9f1('0x5a'))][(_0xc9f1('0x5b'))](_0xc9f1('0x5c'));}if(_0x49df79[_0xc9f1('0x35')][_0xc9f1('0x5d')]){return _0x20b706['sendStatus'](0xc8);}return _0x20b706[_0xc9f1('0x54')](path[_0xc9f1('0x58')](config[_0xc9f1('0x5e')],'server/files/reports',_0x149e99['savename']),util[_0xc9f1('0x5f')](_0xc9f1('0x60'),_0x149e99[_0xc9f1('0x61')]||_0x149e99[_0xc9f1('0x2c')],_0x149e99[_0xc9f1('0x56')][_0xc9f1('0x62')]()));}})['catch'](handleError(_0x20b706,null));};
\ No newline at end of file
+var _0x3538=['crypto','jsforce','desk.js','papaparse','../../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','set','Content-Range','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','count','includeAll','include','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','request-promise','moment','mustache','path','to-csv','lodash','squel'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3538,0x1ba));var _0x8353=function(_0x1ae2a8,_0x5ad40d){_0x1ae2a8=_0x1ae2a8-0x0;var _0x33ab5d=_0x3538[_0x1ae2a8];return _0x33ab5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8353('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8353('0x1'));var moment=require(_0x8353('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8353('0x3'));var util=require('util');var path=require(_0x8353('0x4'));var sox=require('sox');var csv=require(_0x8353('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8353('0x6'));var squel=require(_0x8353('0x7'));var crypto=require(_0x8353('0x8'));var jsforce=require(_0x8353('0x9'));var deskjs=require(_0x8353('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8353('0xb'));var Redis=require('ioredis');var authService=require(_0x8353('0xc'));var qs=require(_0x8353('0xd'));var as=require(_0x8353('0xe'));var hardwareService=require(_0x8353('0xf'));var logger=require(_0x8353('0x10'))('api');var utils=require(_0x8353('0x11'));var config=require(_0x8353('0x12'));var licenseUtil=require(_0x8353('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4801e1,_0x587345){_0x587345=_0x587345||0xcc;return function(_0x4e40a7){if(_0x4e40a7){return _0x4801e1[_0x8353('0x14')](_0x587345);}return _0x4801e1[_0x8353('0x15')](_0x587345)['end']();};}function respondWithResult(_0x14ccb6,_0x3712bb){_0x3712bb=_0x3712bb||0xc8;return function(_0x2e256d){if(_0x2e256d){return _0x14ccb6['status'](_0x3712bb)[_0x8353('0x16')](_0x2e256d);}};}function respondWithFilteredResult(_0x43c3ca,_0x2cc740){return function(_0x3235d0){if(_0x3235d0){var _0x5835d4=typeof _0x2cc740[_0x8353('0x17')]===_0x8353('0x18')&&typeof _0x2cc740[_0x8353('0x19')]===_0x8353('0x18');var _0x2ceb85=_0x3235d0['count'];var _0x5b783a=_0x5835d4?0x0:_0x2cc740[_0x8353('0x17')];var _0x41c651=_0x5835d4?_0x3235d0['count']:_0x2cc740['offset']+_0x2cc740[_0x8353('0x19')];var _0x1e0a25;if(_0x41c651>=_0x2ceb85){_0x41c651=_0x2ceb85;_0x1e0a25=0xc8;}else{_0x1e0a25=0xce;}_0x43c3ca['status'](_0x1e0a25);return _0x43c3ca[_0x8353('0x1a')](_0x8353('0x1b'),_0x5b783a+'-'+_0x41c651+'/'+_0x2ceb85)[_0x8353('0x16')](_0x3235d0);}return null;};}function patchUpdates(_0x5d3b56){return function(_0x4e3454){try{jsonpatch['apply'](_0x4e3454,_0x5d3b56,!![]);}catch(_0x2e9705){return BPromise[_0x8353('0x1c')](_0x2e9705);}return _0x4e3454[_0x8353('0x1d')]();};}function saveUpdates(_0x21aec0,_0x5c9d35){return function(_0x2ef1b0){if(_0x2ef1b0){return _0x2ef1b0['update'](_0x21aec0)['then'](function(_0x441343){return _0x441343;});}return null;};}function removeEntity(_0x41f849,_0xbc8d21){return function(_0x57b9c7){if(_0x57b9c7){return _0x57b9c7[_0x8353('0x1e')]()[_0x8353('0x1f')](function(){var _0x4e2455=_0x57b9c7[_0x8353('0x20')]({'plain':!![]});var _0xe28913=_0x8353('0x21');return db[_0x8353('0x22')][_0x8353('0x1e')]({'where':{'type':_0xe28913,'resourceId':_0x4e2455['id']}})[_0x8353('0x1f')](function(){return _0x57b9c7;});})[_0x8353('0x1f')](function(){_0x41f849['status'](0xcc)[_0x8353('0x23')]();});}};}function handleEntityNotFound(_0xb74624,_0x258247){return function(_0x58d102){if(!_0x58d102){_0xb74624[_0x8353('0x14')](0x194);}return _0x58d102;};}function handleError(_0x38bec5,_0x318ea9){_0x318ea9=_0x318ea9||0x1f4;return function(_0x3b1688){logger[_0x8353('0x24')](_0x3b1688[_0x8353('0x25')]);if(_0x3b1688[_0x8353('0x26')]){delete _0x3b1688[_0x8353('0x26')];}_0x38bec5['status'](_0x318ea9)[_0x8353('0x27')](_0x3b1688);};}exports['index']=function(_0x52c3c9,_0x56d3a1){var _0x524461={},_0xe520a8={},_0x4d66ca={'count':0x0,'rows':[]};var _0x4b49b1=_['map'](db[_0x8353('0x28')][_0x8353('0x29')],function(_0x5beb53){return{'name':_0x5beb53[_0x8353('0x2a')],'type':_0x5beb53[_0x8353('0x2b')]['key']};});_0xe520a8[_0x8353('0x2c')]=_['map'](_0x4b49b1,_0x8353('0x26'));_0xe520a8['query']=_[_0x8353('0x2d')](_0x52c3c9[_0x8353('0x2e')]);_0xe520a8[_0x8353('0x2f')]=_[_0x8353('0x30')](_0xe520a8['model'],_0xe520a8[_0x8353('0x2e')]);_0x524461[_0x8353('0x31')]=_['intersection'](_0xe520a8[_0x8353('0x2c')],qs[_0x8353('0x32')](_0x52c3c9['query'][_0x8353('0x32')]));_0x524461['attributes']=_0x524461[_0x8353('0x31')][_0x8353('0x33')]?_0x524461[_0x8353('0x31')]:_0xe520a8['model'];if(!_0x52c3c9[_0x8353('0x2e')][_0x8353('0x34')](_0x8353('0x35'))){_0x524461[_0x8353('0x19')]=qs[_0x8353('0x19')](_0x52c3c9[_0x8353('0x2e')][_0x8353('0x19')]);_0x524461[_0x8353('0x17')]=qs[_0x8353('0x17')](_0x52c3c9['query']['offset']);}_0x524461['order']=qs[_0x8353('0x36')](_0x52c3c9[_0x8353('0x2e')][_0x8353('0x36')]);_0x524461[_0x8353('0x37')]=qs[_0x8353('0x2f')](_['pick'](_0x52c3c9[_0x8353('0x2e')],_0xe520a8[_0x8353('0x2f')]),_0x4b49b1);if(_0x52c3c9[_0x8353('0x2e')][_0x8353('0x38')]){_0x524461[_0x8353('0x37')]=_[_0x8353('0x39')](_0x524461[_0x8353('0x37')],{'$or':_[_0x8353('0x3a')](_0x4b49b1,function(_0x40eb50){if(_0x40eb50[_0x8353('0x2b')]!==_0x8353('0x3b')){var _0x442523={};_0x442523[_0x40eb50[_0x8353('0x26')]]={'$like':'%'+_0x52c3c9[_0x8353('0x2e')]['filter']+'%'};return _0x442523;}})});}_0x524461=_[_0x8353('0x39')]({},_0x524461,_0x52c3c9['options']);var _0x215439={'where':_0x524461[_0x8353('0x37')]};return db['AnalyticExtractedReport'][_0x8353('0x3c')](_0x215439)[_0x8353('0x1f')](function(_0x39e987){_0x4d66ca[_0x8353('0x3c')]=_0x39e987;if(_0x52c3c9['query'][_0x8353('0x3d')]){_0x524461[_0x8353('0x3e')]=[{'all':!![]}];}return db[_0x8353('0x28')]['findAll'](_0x524461);})[_0x8353('0x1f')](function(_0x2d4a96){_0x4d66ca['rows']=_0x2d4a96;return _0x4d66ca;})['then'](respondWithFilteredResult(_0x56d3a1,_0x524461))[_0x8353('0x3f')](handleError(_0x56d3a1,null));};exports['show']=function(_0x5306f4,_0x72e5a){var _0x4b01c9={'raw':!![],'where':{'id':_0x5306f4[_0x8353('0x40')]['id']}},_0xa19090={};_0xa19090[_0x8353('0x2c')]=_['keys'](db['AnalyticExtractedReport'][_0x8353('0x29')]);_0xa19090[_0x8353('0x2e')]=_[_0x8353('0x2d')](_0x5306f4[_0x8353('0x2e')]);_0xa19090[_0x8353('0x2f')]=_[_0x8353('0x30')](_0xa19090['model'],_0xa19090[_0x8353('0x2e')]);_0x4b01c9[_0x8353('0x31')]=_['intersection'](_0xa19090[_0x8353('0x2c')],qs[_0x8353('0x32')](_0x5306f4['query']['fields']));_0x4b01c9[_0x8353('0x31')]=_0x4b01c9[_0x8353('0x31')][_0x8353('0x33')]?_0x4b01c9[_0x8353('0x31')]:_0xa19090[_0x8353('0x2c')];if(_0x5306f4[_0x8353('0x2e')][_0x8353('0x3d')]){_0x4b01c9[_0x8353('0x3e')]=[{'all':!![]}];}_0x4b01c9=_['merge']({},_0x4b01c9,_0x5306f4[_0x8353('0x41')]);return db['AnalyticExtractedReport'][_0x8353('0x42')](_0x4b01c9)[_0x8353('0x1f')](handleEntityNotFound(_0x72e5a,null))[_0x8353('0x1f')](respondWithResult(_0x72e5a,null))[_0x8353('0x3f')](handleError(_0x72e5a,null));};exports[_0x8353('0x43')]=function(_0x20de06,_0x186659){return db[_0x8353('0x28')][_0x8353('0x43')](_0x20de06[_0x8353('0x44')],{})[_0x8353('0x1f')](function(_0x135003){var _0x1f521b=_0x20de06[_0x8353('0x45')][_0x8353('0x20')]({'plain':!![]});if(!_0x1f521b)throw new Error(_0x8353('0x46'));if(_0x1f521b[_0x8353('0x47')]==='user'){var _0x155c8d=_0x135003['get']({'plain':!![]});var _0x54f887=_0x8353('0x21');return db[_0x8353('0x48')][_0x8353('0x42')]({'where':{'name':_0x54f887,'userProfileId':_0x1f521b[_0x8353('0x49')]},'raw':!![]})[_0x8353('0x1f')](function(_0x2db5aa){if(_0x2db5aa&&_0x2db5aa['autoAssociation']===0x0){return db[_0x8353('0x22')][_0x8353('0x43')]({'name':_0x155c8d['name'],'resourceId':_0x155c8d['id'],'type':_0x2db5aa[_0x8353('0x26')],'sectionId':_0x2db5aa['id']},{})[_0x8353('0x1f')](function(){return _0x135003;});}else{return _0x135003;}})[_0x8353('0x3f')](function(_0x19f1c7){logger[_0x8353('0x24')](_0x8353('0x4a'),_0x19f1c7);throw _0x19f1c7;});}return _0x135003;})[_0x8353('0x1f')](respondWithResult(_0x186659,0xc9))[_0x8353('0x3f')](handleError(_0x186659,null));};exports[_0x8353('0x4b')]=function(_0x30901c,_0x39f99b){if(_0x30901c[_0x8353('0x44')]['id']){delete _0x30901c[_0x8353('0x44')]['id'];}return db[_0x8353('0x28')][_0x8353('0x42')]({'where':{'id':_0x30901c[_0x8353('0x40')]['id']}})[_0x8353('0x1f')](handleEntityNotFound(_0x39f99b,null))[_0x8353('0x1f')](saveUpdates(_0x30901c[_0x8353('0x44')],null))[_0x8353('0x1f')](respondWithResult(_0x39f99b,null))[_0x8353('0x3f')](handleError(_0x39f99b,null));};exports[_0x8353('0x1e')]=function(_0xc38e5c,_0x39e2e7){return db[_0x8353('0x28')]['find']({'where':{'id':_0xc38e5c['params']['id']}})[_0x8353('0x1f')](handleEntityNotFound(_0x39e2e7,null))[_0x8353('0x1f')](removeEntity(_0x39e2e7,null))[_0x8353('0x3f')](handleError(_0x39e2e7,null));};exports['download']=function(_0x3a2298,_0x1c6022,_0x5db17b){return db[_0x8353('0x28')][_0x8353('0x42')]({'where':{'id':_0x3a2298[_0x8353('0x40')]['id']},'attributes':[_0x8353('0x26'),_0x8353('0x4c'),'savename',_0x8353('0x4d')],'raw':!![]})[_0x8353('0x1f')](handleEntityNotFound(_0x1c6022,null))[_0x8353('0x1f')](function(_0x3d04f0){if(_0x3d04f0){if(!fs[_0x8353('0x4e')](path[_0x8353('0x4f')](config[_0x8353('0x50')],_0x8353('0x51'),_0x3d04f0[_0x8353('0x52')]))){throw new db[(_0x8353('0x53'))][(_0x8353('0x54'))](_0x8353('0x55'));}if(_0x3a2298[_0x8353('0x2e')][_0x8353('0x56')]){return _0x1c6022['sendStatus'](0xc8);}return _0x1c6022['download'](path[_0x8353('0x4f')](config[_0x8353('0x50')],_0x8353('0x51'),_0x3d04f0[_0x8353('0x52')]),util[_0x8353('0x57')](_0x8353('0x58'),_0x3d04f0['basename']||_0x3d04f0[_0x8353('0x26')],_0x3d04f0[_0x8353('0x4d')][_0x8353('0x59')]()));}})[_0x8353('0x3f')](handleError(_0x1c6022,null));};
\ No newline at end of file
index b8270cd..693fca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f91=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1f91,0x1d2));var _0x11f9=function(_0x5084de,_0x5efbf3){_0x5084de=_0x5084de-0x0;var _0x47a2e4=_0x1f91[_0x5084de];return _0x47a2e4;};'use strict';var _=require(_0x11f9('0x0'));var util=require(_0x11f9('0x1'));var logger=require(_0x11f9('0x2'))('api');var moment=require(_0x11f9('0x3'));var BPromise=require(_0x11f9('0x4'));var rp=require(_0x11f9('0x5'));var fs=require('fs');var path=require(_0x11f9('0x6'));var rimraf=require('rimraf');var config=require(_0x11f9('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x11f9('0x8')]=function(_0x50fa2f,_0x5b9163){return _0x50fa2f[_0x11f9('0x9')](_0x11f9('0xa'),attributes,{'tableName':_0x11f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf82d=['request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7385c7,_0x370776){var _0x4c3545=function(_0x3fed4c){while(--_0x3fed4c){_0x7385c7['push'](_0x7385c7['shift']());}};_0x4c3545(++_0x370776);}(_0xf82d,0xbd));var _0xdf82=function(_0xa9cee,_0x2d3ddd){_0xa9cee=_0xa9cee-0x0;var _0x4dc9f1=_0xf82d[_0xa9cee];return _0x4dc9f1;};'use strict';var _=require(_0xdf82('0x0'));var util=require(_0xdf82('0x1'));var logger=require(_0xdf82('0x2'))(_0xdf82('0x3'));var moment=require(_0xdf82('0x4'));var BPromise=require(_0xdf82('0x5'));var rp=require(_0xdf82('0x6'));var fs=require('fs');var path=require(_0xdf82('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf82('0x8'));module[_0xdf82('0x9')]=function(_0x23cf2b,_0x636c56){return _0x23cf2b[_0xdf82('0xa')](_0xdf82('0xb'),attributes,{'tableName':_0xdf82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c7c953d..fe24f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75d0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x75d0,0x1bd));var _0x075d=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x75d0[_0x43941d];return _0x27b82a;};'use strict';var _=require(_0x075d('0x0'));var util=require(_0x075d('0x1'));var moment=require(_0x075d('0x2'));var BPromise=require(_0x075d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x075d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x075d('0x5'));var logger=require(_0x075d('0x6'))(_0x075d('0x7'));var config=require(_0x075d('0x8'));var jayson=require(_0x075d('0x9'));var client=jayson[_0x075d('0xa')][_0x075d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53fdb4,_0xae52e7,_0x4ab8f5){return new BPromise(function(_0x555567,_0x33b8f4){return client[_0x075d('0xc')](_0x53fdb4,_0x4ab8f5)[_0x075d('0xd')](function(_0x19ab64){logger['info'](_0x075d('0xe'),_0xae52e7,_0x075d('0xf'));logger[_0x075d('0x10')](_0x075d('0x11'),_0xae52e7,_0x075d('0xf'),JSON[_0x075d('0x12')](_0x19ab64));if(_0x19ab64[_0x075d('0x13')]){if(_0x19ab64['error'][_0x075d('0x14')]===0x1f4){logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x19ab64[_0x075d('0x13')]['message']);return _0x33b8f4(_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);}logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);return _0x555567(_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);}else{logger[_0x075d('0x16')](_0x075d('0xe'),_0xae52e7,_0x075d('0xf'));_0x555567(_0x19ab64[_0x075d('0x17')][_0x075d('0x15')]);}})[_0x075d('0x18')](function(_0x50e892){logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x50e892);_0x33b8f4(_0x50e892);});});}
\ No newline at end of file
+var _0x94e6=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1d9622,_0x2b3a3d){var _0x5241e4=function(_0x32e4ed){while(--_0x32e4ed){_0x1d9622['push'](_0x1d9622['shift']());}};_0x5241e4(++_0x2b3a3d);}(_0x94e6,0x194));var _0x694e=function(_0xc6e6b1,_0x45ddb5){_0xc6e6b1=_0xc6e6b1-0x0;var _0x3772a9=_0x94e6[_0xc6e6b1];return _0x3772a9;};'use strict';var _=require(_0x694e('0x0'));var util=require('util');var moment=require(_0x694e('0x1'));var BPromise=require(_0x694e('0x2'));var rs=require(_0x694e('0x3'));var fs=require('fs');var Redis=require(_0x694e('0x4'));var db=require(_0x694e('0x5'))['db'];var utils=require(_0x694e('0x6'));var logger=require('../../config/logger')(_0x694e('0x7'));var config=require(_0x694e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x694e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84e66e,_0x1c0a45,_0x492dd2){return new BPromise(function(_0x504e0b,_0x3e3f5c){return client['request'](_0x84e66e,_0x492dd2)['then'](function(_0x4ab419){logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));logger[_0x694e('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1c0a45,_0x694e('0xc'),JSON[_0x694e('0xe')](_0x4ab419));if(_0x4ab419['error']){if(_0x4ab419[_0x694e('0xf')][_0x694e('0x10')]===0x1f4){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419['error'][_0x694e('0x11')]);return _0x3e3f5c(_0x4ab419['error'][_0x694e('0x11')]);}logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);return _0x504e0b(_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);}else{logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));_0x504e0b(_0x4ab419[_0x694e('0x12')][_0x694e('0x11')]);}})[_0x694e('0x13')](function(_0x4e608d){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4e608d);_0x3e3f5c(_0x4e608d);});});}
\ No newline at end of file
index 260536d..52f5389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb8a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','put','update','delete','destroy','exports','util'];(function(_0x426ecc,_0x40233a){var _0x4df4f1=function(_0x400f50){while(--_0x400f50){_0x426ecc['push'](_0x426ecc['shift']());}};_0x4df4f1(++_0x40233a);}(_0xcb8a,0x13a));var _0xacb8=function(_0xd67337,_0x1e30dd){_0xd67337=_0xd67337-0x0;var _0x266b1d=_0xcb8a[_0xd67337];return _0x266b1d;};'use strict';var multer=require('multer');var util=require(_0xacb8('0x0'));var path=require(_0xacb8('0x1'));var timeout=require(_0xacb8('0x2'));var express=require(_0xacb8('0x3'));var router=express[_0xacb8('0x4')]();var fs_extra=require(_0xacb8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacb8('0x6'));var config=require(_0xacb8('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xacb8('0x8')]('/',auth[_0xacb8('0x9')](),controller[_0xacb8('0xa')]);router[_0xacb8('0x8')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0xc')]);router['get']('/:id/download',auth[_0xacb8('0x9')](),controller[_0xacb8('0xd')]);router[_0xacb8('0xe')]('/',auth['isAuthenticated'](),controller[_0xacb8('0xf')]);router[_0xacb8('0x10')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0x11')]);router[_0xacb8('0x12')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0x13')]);module[_0xacb8('0x14')]=router;
\ No newline at end of file
+var _0x2dce=['update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x1f560a,_0x1ade33){var _0x1b6bb3=function(_0x74be66){while(--_0x74be66){_0x1f560a['push'](_0x1f560a['shift']());}};_0x1b6bb3(++_0x1ade33);}(_0x2dce,0x120));var _0xe2dc=function(_0x142ead,_0x5c8525){_0x142ead=_0x142ead-0x0;var _0x58413b=_0x2dce[_0x142ead];return _0x58413b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2dc('0x0'));var timeout=require(_0xe2dc('0x1'));var express=require(_0xe2dc('0x2'));var router=express['Router']();var fs_extra=require(_0xe2dc('0x3'));var auth=require(_0xe2dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe2dc('0x5'));var controller=require(_0xe2dc('0x6'));router[_0xe2dc('0x7')]('/',auth[_0xe2dc('0x8')](),controller[_0xe2dc('0x9')]);router['get'](_0xe2dc('0xa'),auth[_0xe2dc('0x8')](),controller[_0xe2dc('0xb')]);router[_0xe2dc('0x7')]('/:id/download',auth[_0xe2dc('0x8')](),controller[_0xe2dc('0xc')]);router[_0xe2dc('0xd')]('/',auth['isAuthenticated'](),controller[_0xe2dc('0xe')]);router[_0xe2dc('0xf')](_0xe2dc('0xa'),auth['isAuthenticated'](),controller[_0xe2dc('0x10')]);router['delete'](_0xe2dc('0xa'),auth[_0xe2dc('0x8')](),controller[_0xe2dc('0x11')]);module[_0xe2dc('0x12')]=router;
\ No newline at end of file
index 83c34ec..67b41a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8740=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x33c8cb,_0x56cff2){var _0x2d28bb=function(_0x1fcc9b){while(--_0x1fcc9b){_0x33c8cb['push'](_0x33c8cb['shift']());}};_0x2d28bb(++_0x56cff2);}(_0x8740,0x193));var _0x0874=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x8740[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0x0874('0x0'));module[_0x0874('0x1')]={'field':{'type':Sequelize[_0x0874('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0874('0x3')]},'format':{'type':Sequelize[_0x0874('0x3')]},'groupBy':{'type':Sequelize[_0x0874('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0874('0x3')]},'custom':{'type':Sequelize[_0x0874('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x80fc=['exports','STRING','BOOLEAN','sequelize'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x80fc,0x1af));var _0xc80f=function(_0x4d7819,_0xe84f12){_0x4d7819=_0x4d7819-0x0;var _0x5e811c=_0x80fc[_0x4d7819];return _0x5e811c;};'use strict';var Sequelize=require(_0xc80f('0x0'));module[_0xc80f('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc80f('0x2')]},'function':{'type':Sequelize[_0xc80f('0x2')]},'format':{'type':Sequelize[_0xc80f('0x2')]},'groupBy':{'type':Sequelize[_0xc80f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc80f('0x2')]},'custom':{'type':Sequelize[_0xc80f('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 51b966b..51f43c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0440=['find','create','bulkCreate','body','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','reject','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','type','key','model','query','keys','intersection','attributes','length','sort','where','filters','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','options'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x0440,0xe9));var _0x0044=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0x0440[_0x32cf96];return _0x125cc1;};'use strict';var emlformat=require(_0x0044('0x0'));var rimraf=require(_0x0044('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0044('0x2'));var BPromise=require(_0x0044('0x3'));var Mustache=require(_0x0044('0x4'));var util=require(_0x0044('0x5'));var path=require('path');var sox=require(_0x0044('0x6'));var csv=require('to-csv');var ejs=require(_0x0044('0x7'));var fs=require('fs');var fs_extra=require(_0x0044('0x8'));var _=require(_0x0044('0x9'));var squel=require(_0x0044('0xa'));var crypto=require(_0x0044('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0044('0xc'));var querystring=require(_0x0044('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0044('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0044('0xf'));var logger=require(_0x0044('0x10'))('api');var utils=require(_0x0044('0x11'));var config=require(_0x0044('0x12'));var licenseUtil=require(_0x0044('0x13'));var db=require(_0x0044('0x14'))['db'];function respondWithStatusCode(_0x539780,_0x53f940){_0x53f940=_0x53f940||0xcc;return function(_0x1296dd){if(_0x1296dd){return _0x539780[_0x0044('0x15')](_0x53f940);}return _0x539780[_0x0044('0x16')](_0x53f940)[_0x0044('0x17')]();};}function respondWithResult(_0x33cf56,_0x560ca1){_0x560ca1=_0x560ca1||0xc8;return function(_0x1a2ddf){if(_0x1a2ddf){return _0x33cf56[_0x0044('0x16')](_0x560ca1)['json'](_0x1a2ddf);}};}function respondWithFilteredResult(_0x37609c,_0x1836f6){return function(_0x9e74b3){if(_0x9e74b3){var _0x139882=typeof _0x1836f6[_0x0044('0x18')]===_0x0044('0x19')&&typeof _0x1836f6[_0x0044('0x1a')]===_0x0044('0x19');var _0x15645b=_0x9e74b3[_0x0044('0x1b')];var _0x642a53=_0x139882?0x0:_0x1836f6[_0x0044('0x18')];var _0x2f03f9=_0x139882?_0x9e74b3[_0x0044('0x1b')]:_0x1836f6['offset']+_0x1836f6[_0x0044('0x1a')];var _0x4c728a;if(_0x2f03f9>=_0x15645b){_0x2f03f9=_0x15645b;_0x4c728a=0xc8;}else{_0x4c728a=0xce;}_0x37609c[_0x0044('0x16')](_0x4c728a);return _0x37609c['set']('Content-Range',_0x642a53+'-'+_0x2f03f9+'/'+_0x15645b)['json'](_0x9e74b3);}return null;};}function patchUpdates(_0x46e8df){return function(_0x37280f){try{jsonpatch['apply'](_0x37280f,_0x46e8df,!![]);}catch(_0x16faf1){return BPromise[_0x0044('0x1c')](_0x16faf1);}return _0x37280f['save']();};}function saveUpdates(_0x39a84a,_0x1ee60d){return function(_0xa2f052){if(_0xa2f052){return _0xa2f052[_0x0044('0x1d')](_0x39a84a)[_0x0044('0x1e')](function(_0x17cbcd){return _0x17cbcd;});}return null;};}function removeEntity(_0x44ab0b,_0x40c482){return function(_0x16dee3){if(_0x16dee3){return _0x16dee3[_0x0044('0x1f')]()[_0x0044('0x1e')](function(){_0x44ab0b[_0x0044('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12bead,_0x1e4343){return function(_0x3e08fc){if(!_0x3e08fc){_0x12bead[_0x0044('0x15')](0x194);}return _0x3e08fc;};}function handleError(_0x3b1295,_0x7d6ead){_0x7d6ead=_0x7d6ead||0x1f4;return function(_0x110bdf){logger['error'](_0x110bdf[_0x0044('0x20')]);if(_0x110bdf[_0x0044('0x21')]){delete _0x110bdf[_0x0044('0x21')];}_0x3b1295[_0x0044('0x16')](_0x7d6ead)[_0x0044('0x22')](_0x110bdf);};}exports[_0x0044('0x23')]=function(_0x1a4e65,_0x585cc1){var _0x2c4ade={},_0x1cec2d={},_0x5d9639={'count':0x0,'rows':[]};var _0x535d8a=_[_0x0044('0x24')](db[_0x0044('0x25')]['rawAttributes'],function(_0x2b3dbe){return{'name':_0x2b3dbe['fieldName'],'type':_0x2b3dbe[_0x0044('0x26')][_0x0044('0x27')]};});_0x1cec2d[_0x0044('0x28')]=_[_0x0044('0x24')](_0x535d8a,_0x0044('0x21'));_0x1cec2d[_0x0044('0x29')]=_[_0x0044('0x2a')](_0x1a4e65[_0x0044('0x29')]);_0x1cec2d['filters']=_[_0x0044('0x2b')](_0x1cec2d[_0x0044('0x28')],_0x1cec2d[_0x0044('0x29')]);_0x2c4ade['attributes']=_[_0x0044('0x2b')](_0x1cec2d[_0x0044('0x28')],qs['fields'](_0x1a4e65[_0x0044('0x29')]['fields']));_0x2c4ade[_0x0044('0x2c')]=_0x2c4ade[_0x0044('0x2c')][_0x0044('0x2d')]?_0x2c4ade['attributes']:_0x1cec2d['model'];if(!_0x1a4e65[_0x0044('0x29')]['hasOwnProperty']('nolimit')){_0x2c4ade[_0x0044('0x1a')]=qs[_0x0044('0x1a')](_0x1a4e65[_0x0044('0x29')][_0x0044('0x1a')]);_0x2c4ade[_0x0044('0x18')]=qs['offset'](_0x1a4e65[_0x0044('0x29')][_0x0044('0x18')]);}_0x2c4ade['order']=qs['sort'](_0x1a4e65[_0x0044('0x29')][_0x0044('0x2e')]);_0x2c4ade[_0x0044('0x2f')]=qs[_0x0044('0x30')](_[_0x0044('0x31')](_0x1a4e65[_0x0044('0x29')],_0x1cec2d[_0x0044('0x30')]),_0x535d8a);if(_0x1a4e65[_0x0044('0x29')]['filter']){_0x2c4ade[_0x0044('0x2f')]=_['merge'](_0x2c4ade['where'],{'$or':_[_0x0044('0x24')](_0x535d8a,function(_0x41a243){if(_0x41a243[_0x0044('0x26')]!==_0x0044('0x32')){var _0x2bc756={};_0x2bc756[_0x41a243[_0x0044('0x21')]]={'$like':'%'+_0x1a4e65['query'][_0x0044('0x33')]+'%'};return _0x2bc756;}})});}_0x2c4ade=_['merge']({},_0x2c4ade,_0x1a4e65['options']);var _0x46ed81={'where':_0x2c4ade[_0x0044('0x2f')]};return db['AnalyticFieldReport'][_0x0044('0x1b')](_0x46ed81)[_0x0044('0x1e')](function(_0x22f018){_0x5d9639['count']=_0x22f018;if(_0x1a4e65[_0x0044('0x29')][_0x0044('0x34')]){_0x2c4ade[_0x0044('0x35')]=[{'all':!![]}];}return db[_0x0044('0x25')][_0x0044('0x36')](_0x2c4ade);})[_0x0044('0x1e')](function(_0x177060){_0x5d9639[_0x0044('0x37')]=_0x177060;return _0x5d9639;})[_0x0044('0x1e')](respondWithFilteredResult(_0x585cc1,_0x2c4ade))[_0x0044('0x38')](handleError(_0x585cc1,null));};exports[_0x0044('0x39')]=function(_0x3bb356,_0x559426){var _0x39ce45={'raw':![],'where':{'id':_0x3bb356[_0x0044('0x3a')]['id']}},_0x53a46c={};_0x53a46c[_0x0044('0x28')]=_[_0x0044('0x2a')](db[_0x0044('0x25')][_0x0044('0x3b')]);_0x53a46c[_0x0044('0x29')]=_[_0x0044('0x2a')](_0x3bb356[_0x0044('0x29')]);_0x53a46c['filters']=_[_0x0044('0x2b')](_0x53a46c[_0x0044('0x28')],_0x53a46c[_0x0044('0x29')]);_0x39ce45[_0x0044('0x2c')]=_['intersection'](_0x53a46c[_0x0044('0x28')],qs[_0x0044('0x3c')](_0x3bb356[_0x0044('0x29')][_0x0044('0x3c')]));_0x39ce45[_0x0044('0x2c')]=_0x39ce45[_0x0044('0x2c')][_0x0044('0x2d')]?_0x39ce45[_0x0044('0x2c')]:_0x53a46c[_0x0044('0x28')];if(_0x3bb356[_0x0044('0x29')][_0x0044('0x34')]){_0x39ce45[_0x0044('0x35')]=[{'all':!![]}];}_0x39ce45=_[_0x0044('0x3d')]({},_0x39ce45,_0x3bb356[_0x0044('0x3e')]);return db[_0x0044('0x25')][_0x0044('0x3f')](_0x39ce45)['then'](handleEntityNotFound(_0x559426,null))['then'](respondWithResult(_0x559426,null))[_0x0044('0x38')](handleError(_0x559426,null));};exports[_0x0044('0x40')]=function(_0x4126b7,_0x2c99a5){return db[_0x0044('0x25')][_0x0044('0x40')](_0x4126b7['body'],{})[_0x0044('0x1e')](respondWithResult(_0x2c99a5,0xc9))[_0x0044('0x38')](handleError(_0x2c99a5,null));};exports[_0x0044('0x41')]=function(_0x2ffba9,_0x271642){return db[_0x0044('0x25')][_0x0044('0x41')](_0x2ffba9[_0x0044('0x42')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x271642,0xc9))[_0x0044('0x38')](handleError(_0x271642,null));};exports[_0x0044('0x1d')]=function(_0x3ab2c3,_0x3e9a8f){if(_0x3ab2c3[_0x0044('0x42')]['id']){delete _0x3ab2c3[_0x0044('0x42')]['id'];}return db['AnalyticFieldReport'][_0x0044('0x3f')]({'where':{'id':_0x3ab2c3['params']['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x3e9a8f,null))[_0x0044('0x1e')](saveUpdates(_0x3ab2c3['body'],null))[_0x0044('0x1e')](respondWithResult(_0x3e9a8f,null))['catch'](handleError(_0x3e9a8f,null));};exports[_0x0044('0x1f')]=function(_0x313622,_0x546fb5){return db[_0x0044('0x25')][_0x0044('0x3f')]({'where':{'id':_0x313622[_0x0044('0x3a')]['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x546fb5,null))['then'](removeEntity(_0x546fb5,null))['catch'](handleError(_0x546fb5,null));};exports[_0x0044('0x43')]=function(_0x19e0ad,_0x9fb379){return db[_0x0044('0x25')][_0x0044('0x1f')]({'where':{'id':_0x19e0ad['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9fb379,0xcc))[_0x0044('0x38')](handleError(_0x9fb379,null));};exports[_0x0044('0x44')]=function(_0x5ccf47,_0x10cc39,_0x27dcdf){return db[_0x0044('0x45')][_0x0044('0x46')]({'where':{'id':_0x5ccf47[_0x0044('0x3a')]['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x10cc39,null))[_0x0044('0x1e')](function(_0x527d28){if(_0x527d28){return db[_0x0044('0x47')][_0x0044('0x48')](function(_0x1eed60){return db[_0x0044('0x25')]['destroy']({'where':{'CustomReportId':_0x5ccf47[_0x0044('0x3a')]['id']},'transaction':_0x1eed60})[_0x0044('0x1e')](function(_0x38b08e){var _0x2ec91f=_[_0x0044('0x24')](_0x5ccf47[_0x0044('0x42')],function(_0x328fc4){delete _0x328fc4['id'];_0x328fc4[_0x0044('0x49')]=_0x5ccf47[_0x0044('0x3a')]['id'];return _0x328fc4;});return db['AnalyticFieldReport']['bulkCreate'](_0x2ec91f,{'transaction':_0x1eed60});});})[_0x0044('0x1e')](function(){return db[_0x0044('0x25')][_0x0044('0x36')]({'where':{'CustomReportId':_0x5ccf47[_0x0044('0x3a')]['id']}});});}})[_0x0044('0x1e')](respondWithResult(_0x10cc39,null))[_0x0044('0x38')](handleError(_0x10cc39,null));};
\ No newline at end of file
+var _0xfc91=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','bluebird','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','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','then','stack','name','map','AnalyticFieldReport','fieldName','type','key','model','query','keys'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xfc91,0x72));var _0x1fc9=function(_0x1b4d17,_0xbd4d2d){_0x1b4d17=_0x1b4d17-0x0;var _0x185be8=_0xfc91[_0x1b4d17];return _0x185be8;};'use strict';var emlformat=require(_0x1fc9('0x0'));var rimraf=require(_0x1fc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fc9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1fc9('0x3'));var Mustache=require('mustache');var util=require(_0x1fc9('0x4'));var path=require(_0x1fc9('0x5'));var sox=require(_0x1fc9('0x6'));var csv=require(_0x1fc9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fc9('0x8'));var _=require(_0x1fc9('0x9'));var squel=require(_0x1fc9('0xa'));var crypto=require(_0x1fc9('0xb'));var jsforce=require(_0x1fc9('0xc'));var deskjs=require(_0x1fc9('0xd'));var toCsv=require(_0x1fc9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fc9('0xe'));var authService=require(_0x1fc9('0xf'));var qs=require(_0x1fc9('0x10'));var as=require(_0x1fc9('0x11'));var hardwareService=require(_0x1fc9('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1fc9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fc9('0x14'))['db'];function respondWithStatusCode(_0x1033b4,_0x420aee){_0x420aee=_0x420aee||0xcc;return function(_0x518fa9){if(_0x518fa9){return _0x1033b4[_0x1fc9('0x15')](_0x420aee);}return _0x1033b4['status'](_0x420aee)[_0x1fc9('0x16')]();};}function respondWithResult(_0x2d351b,_0x50e3f4){_0x50e3f4=_0x50e3f4||0xc8;return function(_0x3c3a6c){if(_0x3c3a6c){return _0x2d351b['status'](_0x50e3f4)[_0x1fc9('0x17')](_0x3c3a6c);}};}function respondWithFilteredResult(_0x18ed6e,_0x48c636){return function(_0x49be11){if(_0x49be11){var _0x21894=typeof _0x48c636[_0x1fc9('0x18')]===_0x1fc9('0x19')&&typeof _0x48c636[_0x1fc9('0x1a')]===_0x1fc9('0x19');var _0x582121=_0x49be11[_0x1fc9('0x1b')];var _0x1ff6dc=_0x21894?0x0:_0x48c636[_0x1fc9('0x18')];var _0x3d2a99=_0x21894?_0x49be11['count']:_0x48c636[_0x1fc9('0x18')]+_0x48c636[_0x1fc9('0x1a')];var _0xf9eaf5;if(_0x3d2a99>=_0x582121){_0x3d2a99=_0x582121;_0xf9eaf5=0xc8;}else{_0xf9eaf5=0xce;}_0x18ed6e[_0x1fc9('0x1c')](_0xf9eaf5);return _0x18ed6e[_0x1fc9('0x1d')]('Content-Range',_0x1ff6dc+'-'+_0x3d2a99+'/'+_0x582121)[_0x1fc9('0x17')](_0x49be11);}return null;};}function patchUpdates(_0xe0243d){return function(_0x4efe15){try{jsonpatch[_0x1fc9('0x1e')](_0x4efe15,_0xe0243d,!![]);}catch(_0x5b2f67){return BPromise[_0x1fc9('0x1f')](_0x5b2f67);}return _0x4efe15[_0x1fc9('0x20')]();};}function saveUpdates(_0x29049a,_0x348aaa){return function(_0x14f2b8){if(_0x14f2b8){return _0x14f2b8[_0x1fc9('0x21')](_0x29049a)['then'](function(_0xe4a0a9){return _0xe4a0a9;});}return null;};}function removeEntity(_0x3a7901,_0x274d0d){return function(_0x3ec61e){if(_0x3ec61e){return _0x3ec61e[_0x1fc9('0x22')]()[_0x1fc9('0x23')](function(){_0x3a7901[_0x1fc9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b4c4b,_0x59bed7){return function(_0x281061){if(!_0x281061){_0x3b4c4b[_0x1fc9('0x15')](0x194);}return _0x281061;};}function handleError(_0x31c5a7,_0x4c734b){_0x4c734b=_0x4c734b||0x1f4;return function(_0x678adb){logger['error'](_0x678adb[_0x1fc9('0x24')]);if(_0x678adb[_0x1fc9('0x25')]){delete _0x678adb[_0x1fc9('0x25')];}_0x31c5a7['status'](_0x4c734b)['send'](_0x678adb);};}exports['index']=function(_0xdaffcf,_0x3e35eb){var _0x5849a4={},_0x48f997={},_0x4f54b6={'count':0x0,'rows':[]};var _0xb9e0e=_[_0x1fc9('0x26')](db[_0x1fc9('0x27')]['rawAttributes'],function(_0x2d8ea6){return{'name':_0x2d8ea6[_0x1fc9('0x28')],'type':_0x2d8ea6[_0x1fc9('0x29')][_0x1fc9('0x2a')]};});_0x48f997[_0x1fc9('0x2b')]=_[_0x1fc9('0x26')](_0xb9e0e,_0x1fc9('0x25'));_0x48f997[_0x1fc9('0x2c')]=_[_0x1fc9('0x2d')](_0xdaffcf[_0x1fc9('0x2c')]);_0x48f997['filters']=_[_0x1fc9('0x2e')](_0x48f997[_0x1fc9('0x2b')],_0x48f997[_0x1fc9('0x2c')]);_0x5849a4['attributes']=_[_0x1fc9('0x2e')](_0x48f997[_0x1fc9('0x2b')],qs[_0x1fc9('0x2f')](_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x2f')]));_0x5849a4[_0x1fc9('0x30')]=_0x5849a4[_0x1fc9('0x30')]['length']?_0x5849a4[_0x1fc9('0x30')]:_0x48f997[_0x1fc9('0x2b')];if(!_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x31')](_0x1fc9('0x32'))){_0x5849a4[_0x1fc9('0x1a')]=qs[_0x1fc9('0x1a')](_0xdaffcf['query'][_0x1fc9('0x1a')]);_0x5849a4[_0x1fc9('0x18')]=qs[_0x1fc9('0x18')](_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x18')]);}_0x5849a4[_0x1fc9('0x33')]=qs[_0x1fc9('0x34')](_0xdaffcf[_0x1fc9('0x2c')]['sort']);_0x5849a4[_0x1fc9('0x35')]=qs[_0x1fc9('0x36')](_[_0x1fc9('0x37')](_0xdaffcf[_0x1fc9('0x2c')],_0x48f997[_0x1fc9('0x36')]),_0xb9e0e);if(_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x38')]){_0x5849a4[_0x1fc9('0x35')]=_[_0x1fc9('0x39')](_0x5849a4['where'],{'$or':_[_0x1fc9('0x26')](_0xb9e0e,function(_0x2e0e2f){if(_0x2e0e2f[_0x1fc9('0x29')]!==_0x1fc9('0x3a')){var _0xf68a44={};_0xf68a44[_0x2e0e2f[_0x1fc9('0x25')]]={'$like':'%'+_0xdaffcf[_0x1fc9('0x2c')]['filter']+'%'};return _0xf68a44;}})});}_0x5849a4=_['merge']({},_0x5849a4,_0xdaffcf[_0x1fc9('0x3b')]);var _0x115fbe={'where':_0x5849a4['where']};return db[_0x1fc9('0x27')]['count'](_0x115fbe)[_0x1fc9('0x23')](function(_0x47e754){_0x4f54b6[_0x1fc9('0x1b')]=_0x47e754;if(_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x3c')]){_0x5849a4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1fc9('0x3d')](_0x5849a4);})[_0x1fc9('0x23')](function(_0x4c4545){_0x4f54b6[_0x1fc9('0x3e')]=_0x4c4545;return _0x4f54b6;})['then'](respondWithFilteredResult(_0x3e35eb,_0x5849a4))[_0x1fc9('0x3f')](handleError(_0x3e35eb,null));};exports[_0x1fc9('0x40')]=function(_0x539aee,_0x6ace90){var _0x6b9111={'raw':![],'where':{'id':_0x539aee[_0x1fc9('0x41')]['id']}},_0x2e0b88={};_0x2e0b88[_0x1fc9('0x2b')]=_['keys'](db[_0x1fc9('0x27')][_0x1fc9('0x42')]);_0x2e0b88[_0x1fc9('0x2c')]=_['keys'](_0x539aee[_0x1fc9('0x2c')]);_0x2e0b88['filters']=_[_0x1fc9('0x2e')](_0x2e0b88[_0x1fc9('0x2b')],_0x2e0b88[_0x1fc9('0x2c')]);_0x6b9111[_0x1fc9('0x30')]=_['intersection'](_0x2e0b88[_0x1fc9('0x2b')],qs[_0x1fc9('0x2f')](_0x539aee[_0x1fc9('0x2c')]['fields']));_0x6b9111[_0x1fc9('0x30')]=_0x6b9111[_0x1fc9('0x30')][_0x1fc9('0x43')]?_0x6b9111[_0x1fc9('0x30')]:_0x2e0b88[_0x1fc9('0x2b')];if(_0x539aee[_0x1fc9('0x2c')][_0x1fc9('0x3c')]){_0x6b9111[_0x1fc9('0x44')]=[{'all':!![]}];}_0x6b9111=_[_0x1fc9('0x39')]({},_0x6b9111,_0x539aee[_0x1fc9('0x3b')]);return db[_0x1fc9('0x27')][_0x1fc9('0x45')](_0x6b9111)[_0x1fc9('0x23')](handleEntityNotFound(_0x6ace90,null))[_0x1fc9('0x23')](respondWithResult(_0x6ace90,null))['catch'](handleError(_0x6ace90,null));};exports['create']=function(_0x749d1a,_0x4865fd){return db[_0x1fc9('0x27')][_0x1fc9('0x46')](_0x749d1a[_0x1fc9('0x47')],{})[_0x1fc9('0x23')](respondWithResult(_0x4865fd,0xc9))[_0x1fc9('0x3f')](handleError(_0x4865fd,null));};exports[_0x1fc9('0x48')]=function(_0x5b03f3,_0x9206df){return db[_0x1fc9('0x27')][_0x1fc9('0x48')](_0x5b03f3['body'],{'raw':![],'individualHooks':!![]})[_0x1fc9('0x23')](respondWithResult(_0x9206df,0xc9))[_0x1fc9('0x3f')](handleError(_0x9206df,null));};exports['update']=function(_0x3b2caf,_0x4d023e){if(_0x3b2caf[_0x1fc9('0x47')]['id']){delete _0x3b2caf['body']['id'];}return db[_0x1fc9('0x27')][_0x1fc9('0x45')]({'where':{'id':_0x3b2caf[_0x1fc9('0x41')]['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x4d023e,null))[_0x1fc9('0x23')](saveUpdates(_0x3b2caf['body'],null))[_0x1fc9('0x23')](respondWithResult(_0x4d023e,null))['catch'](handleError(_0x4d023e,null));};exports['destroy']=function(_0x16d09d,_0x4fe507){return db[_0x1fc9('0x27')][_0x1fc9('0x45')]({'where':{'id':_0x16d09d[_0x1fc9('0x41')]['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x4fe507,null))[_0x1fc9('0x23')](removeEntity(_0x4fe507,null))[_0x1fc9('0x3f')](handleError(_0x4fe507,null));};exports[_0x1fc9('0x49')]=function(_0x5d2adc,_0x4dce7a){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5d2adc[_0x1fc9('0x2c')][_0x1fc9('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x1fc9('0x23')](respondWithResult(_0x4dce7a,0xcc))['catch'](handleError(_0x4dce7a,null));};exports[_0x1fc9('0x4b')]=function(_0x2f20d0,_0x13e0c5,_0x578a45){return db['AnalyticCustomReport'][_0x1fc9('0x4c')]({'where':{'id':_0x2f20d0['params']['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x13e0c5,null))[_0x1fc9('0x23')](function(_0x2c8688){if(_0x2c8688){return db[_0x1fc9('0x4d')][_0x1fc9('0x4e')](function(_0xf76cf){return db[_0x1fc9('0x27')]['destroy']({'where':{'CustomReportId':_0x2f20d0[_0x1fc9('0x41')]['id']},'transaction':_0xf76cf})[_0x1fc9('0x23')](function(_0x4d03ac){var _0x2561d7=_[_0x1fc9('0x26')](_0x2f20d0[_0x1fc9('0x47')],function(_0x3af0e7){delete _0x3af0e7['id'];_0x3af0e7[_0x1fc9('0x4f')]=_0x2f20d0[_0x1fc9('0x41')]['id'];return _0x3af0e7;});return db[_0x1fc9('0x27')][_0x1fc9('0x48')](_0x2561d7,{'transaction':_0xf76cf});});})[_0x1fc9('0x23')](function(){return db['AnalyticFieldReport'][_0x1fc9('0x3d')]({'where':{'CustomReportId':_0x2f20d0[_0x1fc9('0x41')]['id']}});});}})[_0x1fc9('0x23')](respondWithResult(_0x13e0c5,null))[_0x1fc9('0x3f')](handleError(_0x13e0c5,null));};
\ No newline at end of file
index 64eca63..ee3cecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa645=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x20dd53,_0x110375){var _0x3461a4=function(_0x5e304b){while(--_0x5e304b){_0x20dd53['push'](_0x20dd53['shift']());}};_0x3461a4(++_0x110375);}(_0xa645,0xcb));var _0x5a64=function(_0x35a772,_0x121fb4){_0x35a772=_0x35a772-0x0;var _0x43e4c5=_0xa645[_0x35a772];return _0x43e4c5;};'use strict';var _=require(_0x5a64('0x0'));var util=require(_0x5a64('0x1'));var logger=require(_0x5a64('0x2'))(_0x5a64('0x3'));var moment=require(_0x5a64('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a64('0x5'));var fs=require('fs');var path=require(_0x5a64('0x6'));var rimraf=require(_0x5a64('0x7'));var config=require(_0x5a64('0x8'));var attributes=require(_0x5a64('0x9'));module[_0x5a64('0xa')]=function(_0x1e3274,_0x148884){return _0x1e3274[_0x5a64('0xb')](_0x5a64('0xc'),attributes,{'tableName':_0x5a64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12de=['AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2ac97f,_0x533ecb){var _0x572191=function(_0x3002ea){while(--_0x3002ea){_0x2ac97f['push'](_0x2ac97f['shift']());}};_0x572191(++_0x533ecb);}(_0x12de,0x69));var _0xe12d=function(_0xf70d3e,_0x451f4b){_0xf70d3e=_0xf70d3e-0x0;var _0x53a3af=_0x12de[_0xf70d3e];return _0x53a3af;};'use strict';var _=require(_0xe12d('0x0'));var util=require(_0xe12d('0x1'));var logger=require(_0xe12d('0x2'))(_0xe12d('0x3'));var moment=require(_0xe12d('0x4'));var BPromise=require(_0xe12d('0x5'));var rp=require(_0xe12d('0x6'));var fs=require('fs');var path=require(_0xe12d('0x7'));var rimraf=require(_0xe12d('0x8'));var config=require(_0xe12d('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0xe12d('0xa')]=function(_0x2553f5,_0x5c1839){return _0x2553f5[_0xe12d('0xb')](_0xe12d('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2496021..29756af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6db=['then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x305434,_0x4aa0b9){var _0x2fee2e=function(_0x236980){while(--_0x236980){_0x305434['push'](_0x305434['shift']());}};_0x2fee2e(++_0x4aa0b9);}(_0xb6db,0x16a));var _0xbb6d=function(_0x188726,_0x24f287){_0x188726=_0x188726-0x0;var _0x993137=_0xb6db[_0x188726];return _0x993137;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb6d('0x0'));var BPromise=require(_0xbb6d('0x1'));var rs=require(_0xbb6d('0x2'));var fs=require('fs');var Redis=require(_0xbb6d('0x3'));var db=require(_0xbb6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb6d('0x5'))(_0xbb6d('0x6'));var config=require(_0xbb6d('0x7'));var jayson=require(_0xbb6d('0x8'));var client=jayson[_0xbb6d('0x9')][_0xbb6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3778,_0x3d3ecf,_0x2caa11){return new BPromise(function(_0x382bc5,_0x5f5870){return client[_0xbb6d('0xb')](_0x3c3778,_0x2caa11)[_0xbb6d('0xc')](function(_0x599862){logger[_0xbb6d('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d3ecf,_0xbb6d('0xe'));logger[_0xbb6d('0xf')](_0xbb6d('0x10'),_0x3d3ecf,_0xbb6d('0xe'),JSON[_0xbb6d('0x11')](_0x599862));if(_0x599862[_0xbb6d('0x12')]){if(_0x599862[_0xbb6d('0x12')][_0xbb6d('0x13')]===0x1f4){logger[_0xbb6d('0x12')](_0xbb6d('0x14'),_0x3d3ecf,_0x599862[_0xbb6d('0x12')][_0xbb6d('0x15')]);return _0x5f5870(_0x599862['error']['message']);}logger[_0xbb6d('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d3ecf,_0x599862[_0xbb6d('0x12')][_0xbb6d('0x15')]);return _0x382bc5(_0x599862['error'][_0xbb6d('0x15')]);}else{logger[_0xbb6d('0xd')](_0xbb6d('0x14'),_0x3d3ecf,_0xbb6d('0xe'));_0x382bc5(_0x599862['result'][_0xbb6d('0x15')]);}})['catch'](function(_0xdb0027){logger[_0xbb6d('0x12')](_0xbb6d('0x14'),_0x3d3ecf,_0xdb0027);_0x5f5870(_0xdb0027);});});}
\ No newline at end of file
+var _0x8daa=['info','request\x20sent','debug','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3b5c45,_0x526798){var _0x2232e2=function(_0x1727fe){while(--_0x1727fe){_0x3b5c45['push'](_0x3b5c45['shift']());}};_0x2232e2(++_0x526798);}(_0x8daa,0x66));var _0xa8da=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x8daa[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));var moment=require(_0xa8da('0x2'));var BPromise=require(_0xa8da('0x3'));var rs=require(_0xa8da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8da('0x6'))(_0xa8da('0x7'));var config=require(_0xa8da('0x8'));var jayson=require(_0xa8da('0x9'));var client=jayson[_0xa8da('0xa')][_0xa8da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf34ced,_0x44bbfc,_0x231533){return new BPromise(function(_0x4b8d4c,_0x3db1ac){return client['request'](_0xf34ced,_0x231533)[_0xa8da('0xc')](function(_0x1b32b0){logger[_0xa8da('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0xa8da('0xe'));logger[_0xa8da('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x44bbfc,_0xa8da('0xe'),JSON[_0xa8da('0x10')](_0x1b32b0));if(_0x1b32b0[_0xa8da('0x11')]){if(_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);return _0x3db1ac(_0x1b32b0[_0xa8da('0x11')]['message']);}logger[_0xa8da('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);return _0x4b8d4c(_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);}else{logger[_0xa8da('0xd')](_0xa8da('0x14'),_0x44bbfc,_0xa8da('0xe'));_0x4b8d4c(_0x1b32b0[_0xa8da('0x15')][_0xa8da('0x13')]);}})[_0xa8da('0x16')](function(_0x546bc9){logger[_0xa8da('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x546bc9);_0x3db1ac(_0x546bc9);});});}
\ No newline at end of file
index 361910b..9c4b3b5 100644 (file)
@@ -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(_0x554196,_0x48c7aa){var _0x2d15a6=function(_0x59aa30){while(--_0x59aa30){_0x554196['push'](_0x554196['shift']());}};_0x2d15a6(++_0x48c7aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x1968b1,_0x58467d){var _0x447458=function(_0x4497c6){while(--_0x4497c6){_0x1968b1['push'](_0x1968b1['shift']());}};_0x447458(++_0x58467d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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
index f7d95ef..3492f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3189=['exports','name','STRING','TEXT','sequelize'];(function(_0x20a4da,_0x1e9021){var _0x33cdf4=function(_0x8e43bb){while(--_0x8e43bb){_0x20a4da['push'](_0x20a4da['shift']());}};_0x33cdf4(++_0x1e9021);}(_0x3189,0xae));var _0x9318=function(_0x130375,_0x4cee28){_0x130375=_0x130375-0x0;var _0x457d9e=_0x3189[_0x130375];return _0x457d9e;};'use strict';var Sequelize=require(_0x9318('0x0'));module[_0x9318('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9318('0x2')},'table':{'type':Sequelize[_0x9318('0x3')]},'metric':{'type':Sequelize[_0x9318('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd816=['sequelize','exports','name'];(function(_0x2eb608,_0xe8558){var _0x2bc39a=function(_0x34662b){while(--_0x34662b){_0x2eb608['push'](_0x2eb608['shift']());}};_0x2bc39a(++_0xe8558);}(_0xd816,0xd5));var _0x6d81=function(_0x420354,_0x395687){_0x420354=_0x420354-0x0;var _0x1cbbbe=_0xd816[_0x420354];return _0x1cbbbe;};'use strict';var Sequelize=require(_0x6d81('0x0'));module[_0x6d81('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6d81('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6695ff9..763dfb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['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','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0x008c,0x188));var _0xc008=function(_0x34e84d,_0x3f3502){_0x34e84d=_0x34e84d-0x0;var _0x3f9125=_0x008c[_0x34e84d];return _0x3f9125;};'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(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x56ba3a,_0x32aa7d){var _0x5e2202=function(_0x9c8540){while(--_0x9c8540){_0x56ba3a['push'](_0x56ba3a['shift']());}};_0x5e2202(++_0x32aa7d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4068a3,_0x1c2cd3){_0x4068a3=_0x4068a3-0x0;var _0xcdea1=_0x7fbe[_0x4068a3];return _0xcdea1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
index 7c4b07c..33a473d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d49=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','bluebird'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x4d49,0x141));var _0x94d4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4d49[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var logger=require('../../config/logger')(_0x94d4('0x1'));var moment=require(_0x94d4('0x2'));var BPromise=require(_0x94d4('0x3'));var rp=require(_0x94d4('0x4'));var fs=require('fs');var path=require(_0x94d4('0x5'));var rimraf=require(_0x94d4('0x6'));var config=require(_0x94d4('0x7'));var attributes=require(_0x94d4('0x8'));module[_0x94d4('0x9')]=function(_0x4dd133,_0x2b3127){return _0x4dd133[_0x94d4('0xa')](_0x94d4('0xb'),attributes,{'tableName':_0x94d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f7a=['bluebird','../../config/environment','./analyticMetric.attributes','lodash','util','../../config/logger','api'];(function(_0x28b409,_0x9fe0f3){var _0x4c2d3d=function(_0x2255c9){while(--_0x2255c9){_0x28b409['push'](_0x28b409['shift']());}};_0x4c2d3d(++_0x9fe0f3);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x9f7a[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var logger=require(_0xa9f7('0x2'))(_0xa9f7('0x3'));var moment=require('moment');var BPromise=require(_0xa9f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9f7('0x5'));var attributes=require(_0xa9f7('0x6'));module['exports']=function(_0x499ff6,_0xc1334d){return _0x499ff6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 38cae80..e7079f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb79=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x3d51a5,_0x4b712f){var _0xbc7cde=function(_0x40e203){while(--_0x40e203){_0x3d51a5['push'](_0x3d51a5['shift']());}};_0xbc7cde(++_0x4b712f);}(_0xbb79,0xbb));var _0x9bb7=function(_0xdd6558,_0x48751d){_0xdd6558=_0xdd6558-0x0;var _0x124109=_0xbb79[_0xdd6558];return _0x124109;};'use strict';var _=require(_0x9bb7('0x0'));var util=require(_0x9bb7('0x1'));var moment=require(_0x9bb7('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bb7('0x3'));var fs=require('fs');var Redis=require(_0x9bb7('0x4'));var db=require(_0x9bb7('0x5'))['db'];var utils=require(_0x9bb7('0x6'));var logger=require('../../config/logger')(_0x9bb7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9bb7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x313585,_0x5e76d2,_0x31ba03){return new BPromise(function(_0x3a12e4,_0x366bfe){return client['request'](_0x313585,_0x31ba03)[_0x9bb7('0x9')](function(_0x2e676c){logger[_0x9bb7('0xa')](_0x9bb7('0xb'),_0x5e76d2,_0x9bb7('0xc'));logger[_0x9bb7('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5e76d2,'request\x20sent',JSON[_0x9bb7('0xe')](_0x2e676c));if(_0x2e676c['error']){if(_0x2e676c[_0x9bb7('0xf')]['code']===0x1f4){logger[_0x9bb7('0xf')](_0x9bb7('0xb'),_0x5e76d2,_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);return _0x366bfe(_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);}logger[_0x9bb7('0xf')](_0x9bb7('0xb'),_0x5e76d2,_0x2e676c[_0x9bb7('0xf')]['message']);return _0x3a12e4(_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);}else{logger[_0x9bb7('0xa')](_0x9bb7('0xb'),_0x5e76d2,_0x9bb7('0xc'));_0x3a12e4(_0x2e676c[_0x9bb7('0x11')][_0x9bb7('0x10')]);}})[_0x9bb7('0x12')](function(_0x129e21){logger[_0x9bb7('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x5e76d2,_0x129e21);_0x366bfe(_0x129e21);});});}
\ No newline at end of file
+var _0xa033=['stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c9bdf,_0x3b30cd){var _0x5664a6=function(_0x4ea55c){while(--_0x4ea55c){_0x3c9bdf['push'](_0x3c9bdf['shift']());}};_0x5664a6(++_0x3b30cd);}(_0xa033,0x145));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a03('0x2'));var fs=require('fs');var Redis=require(_0x3a03('0x3'));var db=require(_0x3a03('0x4'))['db'];var utils=require(_0x3a03('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a03('0x6'));var jayson=require(_0x3a03('0x7'));var client=jayson[_0x3a03('0x8')][_0x3a03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d17c9,_0x54d355,_0x127d55){return new BPromise(function(_0x3fc118,_0x27cc13){return client[_0x3a03('0xa')](_0x1d17c9,_0x127d55)['then'](function(_0x2eba7){logger[_0x3a03('0xb')](_0x3a03('0xc'),_0x54d355,_0x3a03('0xd'));logger[_0x3a03('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x54d355,_0x3a03('0xd'),JSON[_0x3a03('0xf')](_0x2eba7));if(_0x2eba7[_0x3a03('0x10')]){if(_0x2eba7['error']['code']===0x1f4){logger['error'](_0x3a03('0xc'),_0x54d355,_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);return _0x27cc13(_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);}logger['error'](_0x3a03('0xc'),_0x54d355,_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);return _0x3fc118(_0x2eba7[_0x3a03('0x10')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x54d355,'request\x20sent');_0x3fc118(_0x2eba7[_0x3a03('0x12')][_0x3a03('0x11')]);}})[_0x3a03('0x13')](function(_0x187b98){logger[_0x3a03('0x10')](_0x3a03('0xc'),_0x54d355,_0x187b98);_0x27cc13(_0x187b98);});});}
\ No newline at end of file
index 8b6dead..02bc7a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x253e0a,_0x3cef8e){var _0x24b388=function(_0x37f3ac){while(--_0x37f3ac){_0x253e0a['push'](_0x253e0a['shift']());}};_0x24b388(++_0x3cef8e);}(_0x1115,0x1b6));var _0x5111=function(_0x48b956,_0xb05185){_0x48b956=_0x48b956-0x0;var _0x5795b6=_0x1115[_0x48b956];return _0x5795b6;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router;
\ No newline at end of file
+var _0xb957=['put','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','create'];(function(_0x583bef,_0x5b86f3){var _0x154875=function(_0x3f8b54){while(--_0x3f8b54){_0x583bef['push'](_0x583bef['shift']());}};_0x154875(++_0x5b86f3);}(_0xb957,0x6d));var _0x7b95=function(_0x317a7c,_0x322daf){_0x317a7c=_0x317a7c-0x0;var _0x25baca=_0xb957[_0x317a7c];return _0x25baca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7b95('0x0'));var timeout=require('connect-timeout');var express=require(_0x7b95('0x1'));var router=express[_0x7b95('0x2')]();var fs_extra=require(_0x7b95('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var controller=require(_0x7b95('0x6'));router[_0x7b95('0x7')]('/',auth[_0x7b95('0x8')](),controller['index']);router[_0x7b95('0x7')](_0x7b95('0x9'),auth[_0x7b95('0x8')](),controller['show']);router['post']('/',auth[_0x7b95('0x8')](),controller[_0x7b95('0xa')]);router[_0x7b95('0xb')](_0x7b95('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7b95('0x9'),auth[_0x7b95('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 722999a..ffe473a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x211e=['exports','sequelize'];(function(_0x14c064,_0x592fa8){var _0x1e0dc0=function(_0x30b630){while(--_0x30b630){_0x14c064['push'](_0x14c064['shift']());}};_0x1e0dc0(++_0x592fa8);}(_0x211e,0x165));var _0xe211=function(_0x3cb417,_0x5dabe){_0x3cb417=_0x3cb417-0x0;var _0xff6332=_0x211e[_0x3cb417];return _0xff6332;};'use strict';var Sequelize=require(_0xe211('0x0'));module[_0xe211('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xcf66=['sequelize','TEXT'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcf66,0x110));var _0x6cf6=function(_0x57435a,_0x1e783d){_0x57435a=_0x57435a-0x0;var _0x3e3561=_0xcf66[_0x57435a];return _0x3e3561;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module['exports']={'tree':{'type':Sequelize[_0x6cf6('0x1')],'allowNull':![]}};
\ No newline at end of file
index 8d2b531..c3d19f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc643=['merge','findAll','rows','catch','show','keys','includeAll','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0x1c663b,_0x1c5e31){var _0x1dcc49=function(_0xcc2414){while(--_0xcc2414){_0x1c663b['push'](_0x1c663b['shift']());}};_0x1dcc49(++_0x1c5e31);}(_0xc643,0xa9));var _0x3c64=function(_0x6a5e9b,_0x2ac2f7){_0x6a5e9b=_0x6a5e9b-0x0;var _0x9d162d=_0xc643[_0x6a5e9b];return _0x9d162d;};'use strict';var emlformat=require(_0x3c64('0x0'));var rimraf=require(_0x3c64('0x1'));var zipdir=require(_0x3c64('0x2'));var jsonpatch=require(_0x3c64('0x3'));var rp=require('request-promise');var moment=require(_0x3c64('0x4'));var BPromise=require(_0x3c64('0x5'));var Mustache=require(_0x3c64('0x6'));var util=require(_0x3c64('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3c64('0x8'));var ejs=require(_0x3c64('0x9'));var fs=require('fs');var fs_extra=require(_0x3c64('0xa'));var _=require(_0x3c64('0xb'));var squel=require('squel');var crypto=require(_0x3c64('0xc'));var jsforce=require(_0x3c64('0xd'));var deskjs=require(_0x3c64('0xe'));var toCsv=require(_0x3c64('0x8'));var querystring=require(_0x3c64('0xf'));var Papa=require(_0x3c64('0x10'));var Redis=require('ioredis');var authService=require(_0x3c64('0x11'));var qs=require(_0x3c64('0x12'));var as=require(_0x3c64('0x13'));var hardwareService=require(_0x3c64('0x14'));var logger=require(_0x3c64('0x15'))(_0x3c64('0x16'));var utils=require(_0x3c64('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3c64('0x18'))['db'];function respondWithStatusCode(_0x1af007,_0x4487ea){_0x4487ea=_0x4487ea||0xcc;return function(_0xc66827){if(_0xc66827){return _0x1af007[_0x3c64('0x19')](_0x4487ea);}return _0x1af007[_0x3c64('0x1a')](_0x4487ea)[_0x3c64('0x1b')]();};}function respondWithResult(_0x1ca73a,_0x26e9b5){_0x26e9b5=_0x26e9b5||0xc8;return function(_0x426024){if(_0x426024){return _0x1ca73a[_0x3c64('0x1a')](_0x26e9b5)['json'](_0x426024);}};}function respondWithFilteredResult(_0x27b2cd,_0x58f1b7){return function(_0x4e4aff){if(_0x4e4aff){var _0x21f55a=typeof _0x58f1b7['offset']===_0x3c64('0x1c')&&typeof _0x58f1b7[_0x3c64('0x1d')]==='undefined';var _0x2fe7ae=_0x4e4aff['count'];var _0x14b5e9=_0x21f55a?0x0:_0x58f1b7[_0x3c64('0x1e')];var _0x5509de=_0x21f55a?_0x4e4aff[_0x3c64('0x1f')]:_0x58f1b7[_0x3c64('0x1e')]+_0x58f1b7[_0x3c64('0x1d')];var _0x14469d;if(_0x5509de>=_0x2fe7ae){_0x5509de=_0x2fe7ae;_0x14469d=0xc8;}else{_0x14469d=0xce;}_0x27b2cd[_0x3c64('0x1a')](_0x14469d);return _0x27b2cd[_0x3c64('0x20')]('Content-Range',_0x14b5e9+'-'+_0x5509de+'/'+_0x2fe7ae)[_0x3c64('0x21')](_0x4e4aff);}return null;};}function patchUpdates(_0x168d1b){return function(_0x408a0b){try{jsonpatch[_0x3c64('0x22')](_0x408a0b,_0x168d1b,!![]);}catch(_0x2aa09a){return BPromise[_0x3c64('0x23')](_0x2aa09a);}return _0x408a0b[_0x3c64('0x24')]();};}function saveUpdates(_0x31ee6d,_0x5ef6b2){return function(_0x32abcd){if(_0x32abcd){return _0x32abcd[_0x3c64('0x25')](_0x31ee6d)['then'](function(_0x48377d){return _0x48377d;});}return null;};}function removeEntity(_0x1400c0,_0x2561db){return function(_0x21db8b){if(_0x21db8b){return _0x21db8b[_0x3c64('0x26')]()[_0x3c64('0x27')](function(){_0x1400c0['status'](0xcc)[_0x3c64('0x1b')]();});}};}function handleEntityNotFound(_0x4740d7,_0x2b32f6){return function(_0x1fd3c4){if(!_0x1fd3c4){_0x4740d7[_0x3c64('0x19')](0x194);}return _0x1fd3c4;};}function handleError(_0x1d45f7,_0x3efe56){_0x3efe56=_0x3efe56||0x1f4;return function(_0x130e7a){logger[_0x3c64('0x28')](_0x130e7a[_0x3c64('0x29')]);if(_0x130e7a[_0x3c64('0x2a')]){delete _0x130e7a[_0x3c64('0x2a')];}_0x1d45f7[_0x3c64('0x1a')](_0x3efe56)[_0x3c64('0x2b')](_0x130e7a);};}exports[_0x3c64('0x2c')]=function(_0x2b10e8,_0x29b174){var _0x4dc7c3={},_0x4ed823={},_0x4744c5={'count':0x0,'rows':[]};var _0x378f79=_[_0x3c64('0x2d')](db[_0x3c64('0x2e')][_0x3c64('0x2f')],function(_0x5a63c4){return{'name':_0x5a63c4[_0x3c64('0x30')],'type':_0x5a63c4[_0x3c64('0x31')][_0x3c64('0x32')]};});_0x4ed823[_0x3c64('0x33')]=_[_0x3c64('0x2d')](_0x378f79,_0x3c64('0x2a'));_0x4ed823[_0x3c64('0x34')]=_['keys'](_0x2b10e8[_0x3c64('0x34')]);_0x4ed823['filters']=_[_0x3c64('0x35')](_0x4ed823[_0x3c64('0x33')],_0x4ed823[_0x3c64('0x34')]);_0x4dc7c3[_0x3c64('0x36')]=_[_0x3c64('0x35')](_0x4ed823[_0x3c64('0x33')],qs[_0x3c64('0x37')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x37')]));_0x4dc7c3[_0x3c64('0x36')]=_0x4dc7c3[_0x3c64('0x36')][_0x3c64('0x38')]?_0x4dc7c3[_0x3c64('0x36')]:_0x4ed823['model'];if(!_0x2b10e8[_0x3c64('0x34')]['hasOwnProperty'](_0x3c64('0x39'))){_0x4dc7c3[_0x3c64('0x1d')]=qs[_0x3c64('0x1d')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x1d')]);_0x4dc7c3[_0x3c64('0x1e')]=qs['offset'](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x1e')]);}_0x4dc7c3[_0x3c64('0x3a')]=qs[_0x3c64('0x3b')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3b')]);_0x4dc7c3[_0x3c64('0x3c')]=qs[_0x3c64('0x3d')](_[_0x3c64('0x3e')](_0x2b10e8[_0x3c64('0x34')],_0x4ed823[_0x3c64('0x3d')]),_0x378f79);if(_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3f')]){_0x4dc7c3[_0x3c64('0x3c')]=_['merge'](_0x4dc7c3['where'],{'$or':_[_0x3c64('0x2d')](_0x378f79,function(_0x532d87){if(_0x532d87[_0x3c64('0x31')]!==_0x3c64('0x40')){var _0x5d34e5={};_0x5d34e5[_0x532d87[_0x3c64('0x2a')]]={'$like':'%'+_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3f')]+'%'};return _0x5d34e5;}})});}_0x4dc7c3=_[_0x3c64('0x41')]({},_0x4dc7c3,_0x2b10e8['options']);var _0x56ab53={'where':_0x4dc7c3[_0x3c64('0x3c')]};return db['AnalyticTreeReport'][_0x3c64('0x1f')](_0x56ab53)['then'](function(_0x1ff93f){_0x4744c5[_0x3c64('0x1f')]=_0x1ff93f;if(_0x2b10e8['query']['includeAll']){_0x4dc7c3['include']=[{'all':!![]}];}return db[_0x3c64('0x2e')][_0x3c64('0x42')](_0x4dc7c3);})[_0x3c64('0x27')](function(_0x3e160b){_0x4744c5[_0x3c64('0x43')]=_0x3e160b;return _0x4744c5;})[_0x3c64('0x27')](respondWithFilteredResult(_0x29b174,_0x4dc7c3))[_0x3c64('0x44')](handleError(_0x29b174,null));};exports[_0x3c64('0x45')]=function(_0x9a3d6f,_0x138315){var _0x3b810d={'raw':!![],'where':{'id':_0x9a3d6f['params']['id']}},_0x428401={};_0x428401['model']=_[_0x3c64('0x46')](db['AnalyticTreeReport'][_0x3c64('0x2f')]);_0x428401[_0x3c64('0x34')]=_[_0x3c64('0x46')](_0x9a3d6f['query']);_0x428401['filters']=_[_0x3c64('0x35')](_0x428401[_0x3c64('0x33')],_0x428401[_0x3c64('0x34')]);_0x3b810d[_0x3c64('0x36')]=_[_0x3c64('0x35')](_0x428401[_0x3c64('0x33')],qs[_0x3c64('0x37')](_0x9a3d6f['query'][_0x3c64('0x37')]));_0x3b810d['attributes']=_0x3b810d[_0x3c64('0x36')][_0x3c64('0x38')]?_0x3b810d[_0x3c64('0x36')]:_0x428401[_0x3c64('0x33')];if(_0x9a3d6f['query'][_0x3c64('0x47')]){_0x3b810d[_0x3c64('0x48')]=[{'all':!![]}];}_0x3b810d=_[_0x3c64('0x41')]({},_0x3b810d,_0x9a3d6f[_0x3c64('0x49')]);return db[_0x3c64('0x2e')][_0x3c64('0x4a')](_0x3b810d)[_0x3c64('0x27')](handleEntityNotFound(_0x138315,null))['then'](respondWithResult(_0x138315,null))[_0x3c64('0x44')](handleError(_0x138315,null));};exports[_0x3c64('0x4b')]=function(_0x3e5d01,_0x61768a){return db[_0x3c64('0x2e')][_0x3c64('0x4b')](_0x3e5d01[_0x3c64('0x4c')],{})['then'](respondWithResult(_0x61768a,0xc9))[_0x3c64('0x44')](handleError(_0x61768a,null));};exports[_0x3c64('0x25')]=function(_0x1f96e3,_0x2f7972){if(_0x1f96e3['body']['id']){delete _0x1f96e3[_0x3c64('0x4c')]['id'];}return db[_0x3c64('0x2e')][_0x3c64('0x4a')]({'where':{'id':_0x1f96e3[_0x3c64('0x4d')]['id']}})[_0x3c64('0x27')](handleEntityNotFound(_0x2f7972,null))[_0x3c64('0x27')](saveUpdates(_0x1f96e3[_0x3c64('0x4c')],null))[_0x3c64('0x27')](respondWithResult(_0x2f7972,null))[_0x3c64('0x44')](handleError(_0x2f7972,null));};exports['destroy']=function(_0x2055ff,_0x18abfc){return db['AnalyticTreeReport'][_0x3c64('0x4a')]({'where':{'id':_0x2055ff['params']['id']}})['then'](handleEntityNotFound(_0x18abfc,null))[_0x3c64('0x27')](removeEntity(_0x18abfc,null))[_0x3c64('0x44')](handleError(_0x18abfc,null));};
\ No newline at end of file
+var _0x93a6=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','stack','name','send','map','AnalyticTreeReport','rawAttributes','model','keys','query','intersection','attributes','fields'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0x93a6,0x179));var _0x693a=function(_0x27ff4d,_0x41a7d6){_0x27ff4d=_0x27ff4d-0x0;var _0x803d72=_0x93a6[_0x27ff4d];return _0x803d72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x693a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x693a('0x1'));var rp=require(_0x693a('0x2'));var moment=require(_0x693a('0x3'));var BPromise=require(_0x693a('0x4'));var Mustache=require(_0x693a('0x5'));var util=require(_0x693a('0x6'));var path=require(_0x693a('0x7'));var sox=require(_0x693a('0x8'));var csv=require(_0x693a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x693a('0xa'));var _=require(_0x693a('0xb'));var squel=require(_0x693a('0xc'));var crypto=require(_0x693a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x693a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x693a('0xf'));var Redis=require(_0x693a('0x10'));var authService=require(_0x693a('0x11'));var qs=require(_0x693a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x693a('0x13'));var logger=require(_0x693a('0x14'))(_0x693a('0x15'));var utils=require(_0x693a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x693a('0x17'))['db'];function respondWithStatusCode(_0x3ba090,_0x44f248){_0x44f248=_0x44f248||0xcc;return function(_0x1c02f2){if(_0x1c02f2){return _0x3ba090[_0x693a('0x18')](_0x44f248);}return _0x3ba090[_0x693a('0x19')](_0x44f248)[_0x693a('0x1a')]();};}function respondWithResult(_0x5e37e5,_0x26a8d1){_0x26a8d1=_0x26a8d1||0xc8;return function(_0x12d22f){if(_0x12d22f){return _0x5e37e5[_0x693a('0x19')](_0x26a8d1)['json'](_0x12d22f);}};}function respondWithFilteredResult(_0x4b3f1d,_0x5ad414){return function(_0x13f81b){if(_0x13f81b){var _0x3e55af=typeof _0x5ad414[_0x693a('0x1b')]===_0x693a('0x1c')&&typeof _0x5ad414['limit']===_0x693a('0x1c');var _0x54fba0=_0x13f81b[_0x693a('0x1d')];var _0x1fc963=_0x3e55af?0x0:_0x5ad414[_0x693a('0x1b')];var _0x4a7e5c=_0x3e55af?_0x13f81b[_0x693a('0x1d')]:_0x5ad414['offset']+_0x5ad414[_0x693a('0x1e')];var _0x39159c;if(_0x4a7e5c>=_0x54fba0){_0x4a7e5c=_0x54fba0;_0x39159c=0xc8;}else{_0x39159c=0xce;}_0x4b3f1d[_0x693a('0x19')](_0x39159c);return _0x4b3f1d[_0x693a('0x1f')](_0x693a('0x20'),_0x1fc963+'-'+_0x4a7e5c+'/'+_0x54fba0)[_0x693a('0x21')](_0x13f81b);}return null;};}function patchUpdates(_0x33cdfc){return function(_0x16a742){try{jsonpatch[_0x693a('0x22')](_0x16a742,_0x33cdfc,!![]);}catch(_0x591a37){return BPromise[_0x693a('0x23')](_0x591a37);}return _0x16a742['save']();};}function saveUpdates(_0x208ee9,_0x1840ec){return function(_0x395d19){if(_0x395d19){return _0x395d19['update'](_0x208ee9)[_0x693a('0x24')](function(_0xc73d82){return _0xc73d82;});}return null;};}function removeEntity(_0x1de215,_0x77c40d){return function(_0x912578){if(_0x912578){return _0x912578['destroy']()['then'](function(){_0x1de215[_0x693a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34c768,_0x5bb94c){return function(_0x286f4d){if(!_0x286f4d){_0x34c768[_0x693a('0x18')](0x194);}return _0x286f4d;};}function handleError(_0x445052,_0x11e1b3){_0x11e1b3=_0x11e1b3||0x1f4;return function(_0x6d731f){logger['error'](_0x6d731f[_0x693a('0x25')]);if(_0x6d731f[_0x693a('0x26')]){delete _0x6d731f[_0x693a('0x26')];}_0x445052[_0x693a('0x19')](_0x11e1b3)[_0x693a('0x27')](_0x6d731f);};}exports['index']=function(_0x44411d,_0x2809f2){var _0x4201e5={},_0x561f48={},_0x406250={'count':0x0,'rows':[]};var _0x3e4d60=_[_0x693a('0x28')](db[_0x693a('0x29')][_0x693a('0x2a')],function(_0x1a3edf){return{'name':_0x1a3edf['fieldName'],'type':_0x1a3edf['type']['key']};});_0x561f48[_0x693a('0x2b')]=_[_0x693a('0x28')](_0x3e4d60,'name');_0x561f48['query']=_[_0x693a('0x2c')](_0x44411d[_0x693a('0x2d')]);_0x561f48['filters']=_[_0x693a('0x2e')](_0x561f48[_0x693a('0x2b')],_0x561f48[_0x693a('0x2d')]);_0x4201e5[_0x693a('0x2f')]=_[_0x693a('0x2e')](_0x561f48['model'],qs[_0x693a('0x30')](_0x44411d['query'][_0x693a('0x30')]));_0x4201e5[_0x693a('0x2f')]=_0x4201e5[_0x693a('0x2f')][_0x693a('0x31')]?_0x4201e5[_0x693a('0x2f')]:_0x561f48[_0x693a('0x2b')];if(!_0x44411d[_0x693a('0x2d')][_0x693a('0x32')](_0x693a('0x33'))){_0x4201e5[_0x693a('0x1e')]=qs[_0x693a('0x1e')](_0x44411d['query'][_0x693a('0x1e')]);_0x4201e5[_0x693a('0x1b')]=qs[_0x693a('0x1b')](_0x44411d[_0x693a('0x2d')][_0x693a('0x1b')]);}_0x4201e5[_0x693a('0x34')]=qs[_0x693a('0x35')](_0x44411d[_0x693a('0x2d')][_0x693a('0x35')]);_0x4201e5[_0x693a('0x36')]=qs[_0x693a('0x37')](_['pick'](_0x44411d['query'],_0x561f48[_0x693a('0x37')]),_0x3e4d60);if(_0x44411d['query'][_0x693a('0x38')]){_0x4201e5[_0x693a('0x36')]=_['merge'](_0x4201e5['where'],{'$or':_[_0x693a('0x28')](_0x3e4d60,function(_0x1d1856){if(_0x1d1856[_0x693a('0x39')]!==_0x693a('0x3a')){var _0x58b009={};_0x58b009[_0x1d1856[_0x693a('0x26')]]={'$like':'%'+_0x44411d['query']['filter']+'%'};return _0x58b009;}})});}_0x4201e5=_[_0x693a('0x3b')]({},_0x4201e5,_0x44411d[_0x693a('0x3c')]);var _0x541a70={'where':_0x4201e5[_0x693a('0x36')]};return db['AnalyticTreeReport'][_0x693a('0x1d')](_0x541a70)['then'](function(_0x2dfb67){_0x406250['count']=_0x2dfb67;if(_0x44411d[_0x693a('0x2d')][_0x693a('0x3d')]){_0x4201e5[_0x693a('0x3e')]=[{'all':!![]}];}return db[_0x693a('0x29')][_0x693a('0x3f')](_0x4201e5);})[_0x693a('0x24')](function(_0x17dc45){_0x406250['rows']=_0x17dc45;return _0x406250;})[_0x693a('0x24')](respondWithFilteredResult(_0x2809f2,_0x4201e5))[_0x693a('0x40')](handleError(_0x2809f2,null));};exports['show']=function(_0xbec6d4,_0x39b5a6){var _0x5c19e7={'raw':!![],'where':{'id':_0xbec6d4[_0x693a('0x41')]['id']}},_0x3ecdcb={};_0x3ecdcb[_0x693a('0x2b')]=_[_0x693a('0x2c')](db[_0x693a('0x29')][_0x693a('0x2a')]);_0x3ecdcb[_0x693a('0x2d')]=_['keys'](_0xbec6d4[_0x693a('0x2d')]);_0x3ecdcb[_0x693a('0x37')]=_[_0x693a('0x2e')](_0x3ecdcb[_0x693a('0x2b')],_0x3ecdcb[_0x693a('0x2d')]);_0x5c19e7[_0x693a('0x2f')]=_[_0x693a('0x2e')](_0x3ecdcb['model'],qs['fields'](_0xbec6d4['query'][_0x693a('0x30')]));_0x5c19e7[_0x693a('0x2f')]=_0x5c19e7['attributes'][_0x693a('0x31')]?_0x5c19e7['attributes']:_0x3ecdcb[_0x693a('0x2b')];if(_0xbec6d4[_0x693a('0x2d')][_0x693a('0x3d')]){_0x5c19e7[_0x693a('0x3e')]=[{'all':!![]}];}_0x5c19e7=_[_0x693a('0x3b')]({},_0x5c19e7,_0xbec6d4['options']);return db[_0x693a('0x29')][_0x693a('0x42')](_0x5c19e7)[_0x693a('0x24')](handleEntityNotFound(_0x39b5a6,null))[_0x693a('0x24')](respondWithResult(_0x39b5a6,null))[_0x693a('0x40')](handleError(_0x39b5a6,null));};exports[_0x693a('0x43')]=function(_0x2344ad,_0x26afb2){return db[_0x693a('0x29')][_0x693a('0x43')](_0x2344ad[_0x693a('0x44')],{})[_0x693a('0x24')](respondWithResult(_0x26afb2,0xc9))[_0x693a('0x40')](handleError(_0x26afb2,null));};exports[_0x693a('0x45')]=function(_0x123eb2,_0x35731b){if(_0x123eb2[_0x693a('0x44')]['id']){delete _0x123eb2[_0x693a('0x44')]['id'];}return db[_0x693a('0x29')]['find']({'where':{'id':_0x123eb2[_0x693a('0x41')]['id']}})[_0x693a('0x24')](handleEntityNotFound(_0x35731b,null))[_0x693a('0x24')](saveUpdates(_0x123eb2['body'],null))['then'](respondWithResult(_0x35731b,null))['catch'](handleError(_0x35731b,null));};exports[_0x693a('0x46')]=function(_0x544140,_0x591aa7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x544140[_0x693a('0x41')]['id']}})[_0x693a('0x24')](handleEntityNotFound(_0x591aa7,null))[_0x693a('0x24')](removeEntity(_0x591aa7,null))[_0x693a('0x40')](handleError(_0x591aa7,null));};
\ No newline at end of file
index bab2f6a..7147816 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x32a635,_0x553600){var _0x4f2736=function(_0x4ea48c){while(--_0x4ea48c){_0x32a635['push'](_0x32a635['shift']());}};_0x4f2736(++_0x553600);}(_0x32c2,0x1e0));var _0x232c=function(_0xf8d23e,_0x13dd0a){_0xf8d23e=_0xf8d23e-0x0;var _0x3477f8=_0x32c2[_0xf8d23e];return _0x3477f8;};'use strict';var _=require(_0x232c('0x0'));var util=require(_0x232c('0x1'));var logger=require(_0x232c('0x2'))(_0x232c('0x3'));var moment=require(_0x232c('0x4'));var BPromise=require(_0x232c('0x5'));var rp=require(_0x232c('0x6'));var fs=require('fs');var path=require(_0x232c('0x7'));var rimraf=require(_0x232c('0x8'));var config=require(_0x232c('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0x232c('0xa')]=function(_0x5cad32,_0x4ff2cd){return _0x5cad32[_0x232c('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5564=['path','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment'];(function(_0x1b81b9,_0x1d314a){var _0x27a94d=function(_0x3f2916){while(--_0x3f2916){_0x1b81b9['push'](_0x1b81b9['shift']());}};_0x27a94d(++_0x1d314a);}(_0x5564,0x114));var _0x4556=function(_0x5ea52d,_0x51d1d6){_0x5ea52d=_0x5ea52d-0x0;var _0x332948=_0x5564[_0x5ea52d];return _0x332948;};'use strict';var _=require(_0x4556('0x0'));var util=require(_0x4556('0x1'));var logger=require('../../config/logger')(_0x4556('0x2'));var moment=require(_0x4556('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4556('0x4'));var rimraf=require('rimraf');var config=require(_0x4556('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x4556('0x6')]=function(_0x133753,_0x11d455){return _0x133753[_0x4556('0x7')](_0x4556('0x8'),attributes,{'tableName':_0x4556('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 51f59f4..42f1045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x16fd22,_0x2a4d4d){var _0x32c6e0=function(_0x5ea5a0){while(--_0x5ea5a0){_0x16fd22['push'](_0x16fd22['shift']());}};_0x32c6e0(++_0x2a4d4d);}(_0xdb28,0x106));var _0x8db2=function(_0x37cf9e,_0x5e07e3){_0x37cf9e=_0x37cf9e-0x0;var _0x7b516e=_0xdb28[_0x37cf9e];return _0x7b516e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _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(_0x1c718d,_0x25224f){var _0x38a555=function(_0x239d4d){while(--_0x239d4d){_0x1c718d['push'](_0x1c718d['shift']());}};_0x38a555(++_0x25224f);}(_0x1261,0x144));var _0x1126=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x1261[_0x595013];return _0x2a29e3;};'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
index 2e16e13..2853502 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a52=['isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x0a52,0x15d));var _0x20a5=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0x0a52[_0x4de1b5];return _0xed55cf;};'use strict';var multer=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var path=require(_0x20a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x20a5('0x3'));var router=express[_0x20a5('0x4')]();var fs_extra=require(_0x20a5('0x5'));var auth=require(_0x20a5('0x6'));var interaction=require(_0x20a5('0x7'));var config=require(_0x20a5('0x8'));var controller=require(_0x20a5('0x9'));router[_0x20a5('0xa')]('/',auth[_0x20a5('0xb')](),controller['index']);router[_0x20a5('0xa')](_0x20a5('0xc'),auth[_0x20a5('0xb')](),controller[_0x20a5('0xd')]);router['post']('/',auth[_0x20a5('0xb')](),controller[_0x20a5('0xe')]);router[_0x20a5('0xf')](_0x20a5('0xc'),auth['isAuthenticated'](),controller[_0x20a5('0x10')]);router[_0x20a5('0x11')](_0x20a5('0xc'),auth[_0x20a5('0xb')](),controller[_0x20a5('0x12')]);module[_0x20a5('0x13')]=router;
\ No newline at end of file
+var _0xc864=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc864,0x17f));var _0x4c86=function(_0x46a5f9,_0x45f0a2){_0x46a5f9=_0x46a5f9-0x0;var _0x1f6ffe=_0xc864[_0x46a5f9];return _0x1f6ffe;};'use strict';var multer=require('multer');var util=require(_0x4c86('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c86('0x1'));var router=express[_0x4c86('0x2')]();var fs_extra=require(_0x4c86('0x3'));var auth=require(_0x4c86('0x4'));var interaction=require(_0x4c86('0x5'));var config=require(_0x4c86('0x6'));var controller=require(_0x4c86('0x7'));router[_0x4c86('0x8')]('/',auth[_0x4c86('0x9')](),controller['index']);router['get'](_0x4c86('0xa'),auth[_0x4c86('0x9')](),controller['show']);router[_0x4c86('0xb')]('/',auth[_0x4c86('0x9')](),controller[_0x4c86('0xc')]);router[_0x4c86('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4c86('0xe')]);router['delete'](_0x4c86('0xa'),auth[_0x4c86('0x9')](),controller['destroy']);module[_0x4c86('0xf')]=router;
\ No newline at end of file
index 85d5858..7685730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38df=['sequelize','exports','STRING'];(function(_0x5592cc,_0x42ce99){var _0x335661=function(_0x3f81e4){while(--_0x3f81e4){_0x5592cc['push'](_0x5592cc['shift']());}};_0x335661(++_0x42ce99);}(_0x38df,0x144));var _0xf38d=function(_0x5b9989,_0x2cf715){_0x5b9989=_0x5b9989-0x0;var _0xe45bbe=_0x38df[_0x5b9989];return _0xe45bbe;};'use strict';var Sequelize=require(_0xf38d('0x0'));module[_0xf38d('0x1')]={'name':{'type':Sequelize[_0xf38d('0x2')]},'basename':{'type':Sequelize[_0xf38d('0x2')]},'type':{'type':Sequelize[_0xf38d('0x2')]}};
\ No newline at end of file
+var _0x975f=['STRING','sequelize','exports'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x975f,0x109));var _0xf975=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x975f[_0x49bdc4];return _0x1f7437;};'use strict';var Sequelize=require(_0xf975('0x0'));module[_0xf975('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf975('0x2')]}};
\ No newline at end of file
index 470922c..c8610e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x664d=['findAll','catch','show','params','clone','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','offline-chat/','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','status','index','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Attachment','includeAll','include'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x664d,0x120));var _0xd664=function(_0x2db025,_0x1cf6de){_0x2db025=_0x2db025-0x0;var _0x47afbe=_0x664d[_0x2db025];return _0x47afbe;};'use strict';var emlformat=require(_0xd664('0x0'));var rimraf=require(_0xd664('0x1'));var zipdir=require(_0xd664('0x2'));var jsonpatch=require(_0xd664('0x3'));var rp=require(_0xd664('0x4'));var moment=require(_0xd664('0x5'));var BPromise=require(_0xd664('0x6'));var Mustache=require('mustache');var util=require(_0xd664('0x7'));var path=require(_0xd664('0x8'));var sox=require(_0xd664('0x9'));var csv=require(_0xd664('0xa'));var ejs=require(_0xd664('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd664('0xc'));var squel=require(_0xd664('0xd'));var crypto=require(_0xd664('0xe'));var jsforce=require(_0xd664('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd664('0x10'));var Papa=require(_0xd664('0x11'));var Redis=require(_0xd664('0x12'));var authService=require(_0xd664('0x13'));var qs=require(_0xd664('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd664('0x15'));var logger=require(_0xd664('0x16'))(_0xd664('0x17'));var utils=require(_0xd664('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd664('0x19'));var db=require(_0xd664('0x1a'))['db'];function respondWithStatusCode(_0x46df07,_0x1dff5a){_0x1dff5a=_0x1dff5a||0xcc;return function(_0x29622d){if(_0x29622d){return _0x46df07[_0xd664('0x1b')](_0x1dff5a);}return _0x46df07['status'](_0x1dff5a)['end']();};}function respondWithResult(_0x487e85,_0x13fabd){_0x13fabd=_0x13fabd||0xc8;return function(_0x36e824){if(_0x36e824){return _0x487e85['status'](_0x13fabd)[_0xd664('0x1c')](_0x36e824);}};}function respondWithFilteredResult(_0x5c9d57,_0x40850e){return function(_0x3388de){if(_0x3388de){var _0x4ba1b8=typeof _0x40850e[_0xd664('0x1d')]===_0xd664('0x1e')&&typeof _0x40850e[_0xd664('0x1f')]===_0xd664('0x1e');var _0x14b33a=_0x3388de[_0xd664('0x20')];var _0xbf5990=_0x4ba1b8?0x0:_0x40850e[_0xd664('0x1d')];var _0x4c4b47=_0x4ba1b8?_0x3388de['count']:_0x40850e[_0xd664('0x1d')]+_0x40850e['limit'];var _0x1afcee;if(_0x4c4b47>=_0x14b33a){_0x4c4b47=_0x14b33a;_0x1afcee=0xc8;}else{_0x1afcee=0xce;}_0x5c9d57['status'](_0x1afcee);return _0x5c9d57[_0xd664('0x21')]('Content-Range',_0xbf5990+'-'+_0x4c4b47+'/'+_0x14b33a)[_0xd664('0x1c')](_0x3388de);}return null;};}function patchUpdates(_0x3650ab){return function(_0x341c6a){try{jsonpatch[_0xd664('0x22')](_0x341c6a,_0x3650ab,!![]);}catch(_0x43a122){return BPromise['reject'](_0x43a122);}return _0x341c6a[_0xd664('0x23')]();};}function saveUpdates(_0xa7236,_0x2bd2e2){return function(_0x22ea65){if(_0x22ea65){return _0x22ea65[_0xd664('0x24')](_0xa7236)[_0xd664('0x25')](function(_0x2ed49e){return _0x2ed49e;});}return null;};}function removeEntity(_0x1491d1,_0x25fed7){return function(_0x3611aa){if(_0x3611aa){return _0x3611aa[_0xd664('0x26')]()[_0xd664('0x25')](function(){_0x1491d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0c50,_0x4f5c17){return function(_0x189390){if(!_0x189390){_0x3b0c50[_0xd664('0x1b')](0x194);}return _0x189390;};}function handleError(_0x5eabd6,_0x1a18fd){_0x1a18fd=_0x1a18fd||0x1f4;return function(_0x4c8844){logger[_0xd664('0x27')](_0x4c8844['stack']);if(_0x4c8844[_0xd664('0x28')]){delete _0x4c8844[_0xd664('0x28')];}_0x5eabd6[_0xd664('0x29')](_0x1a18fd)['send'](_0x4c8844);};}exports[_0xd664('0x2a')]=function(_0xc83fa,_0x450b48){var _0x3dd87d={},_0x628b14={},_0x16cd02={'count':0x0,'rows':[]};var _0x25064d=_['map'](db['Attachment'][_0xd664('0x2b')],function(_0x4d0458){return{'name':_0x4d0458[_0xd664('0x2c')],'type':_0x4d0458[_0xd664('0x2d')]['key']};});_0x628b14[_0xd664('0x2e')]=_[_0xd664('0x2f')](_0x25064d,_0xd664('0x28'));_0x628b14['query']=_[_0xd664('0x30')](_0xc83fa[_0xd664('0x31')]);_0x628b14[_0xd664('0x32')]=_['intersection'](_0x628b14[_0xd664('0x2e')],_0x628b14[_0xd664('0x31')]);_0x3dd87d[_0xd664('0x33')]=_[_0xd664('0x34')](_0x628b14[_0xd664('0x2e')],qs[_0xd664('0x35')](_0xc83fa[_0xd664('0x31')][_0xd664('0x35')]));_0x3dd87d['attributes']=_0x3dd87d[_0xd664('0x33')][_0xd664('0x36')]?_0x3dd87d[_0xd664('0x33')]:_0x628b14['model'];if(!_0xc83fa[_0xd664('0x31')][_0xd664('0x37')](_0xd664('0x38'))){_0x3dd87d['limit']=qs[_0xd664('0x1f')](_0xc83fa[_0xd664('0x31')][_0xd664('0x1f')]);_0x3dd87d[_0xd664('0x1d')]=qs[_0xd664('0x1d')](_0xc83fa[_0xd664('0x31')][_0xd664('0x1d')]);}_0x3dd87d[_0xd664('0x39')]=qs[_0xd664('0x3a')](_0xc83fa[_0xd664('0x31')][_0xd664('0x3a')]);_0x3dd87d['where']=qs[_0xd664('0x32')](_[_0xd664('0x3b')](_0xc83fa['query'],_0x628b14['filters']),_0x25064d);if(_0xc83fa[_0xd664('0x31')][_0xd664('0x3c')]){_0x3dd87d[_0xd664('0x3d')]=_['merge'](_0x3dd87d['where'],{'$or':_[_0xd664('0x2f')](_0x25064d,function(_0x43e37e){if(_0x43e37e[_0xd664('0x2d')]!==_0xd664('0x3e')){var _0x2d6203={};_0x2d6203[_0x43e37e['name']]={'$like':'%'+_0xc83fa[_0xd664('0x31')][_0xd664('0x3c')]+'%'};return _0x2d6203;}})});}_0x3dd87d=_[_0xd664('0x3f')]({},_0x3dd87d,_0xc83fa[_0xd664('0x40')]);var _0x35fbd7={'where':_0x3dd87d[_0xd664('0x3d')]};return db[_0xd664('0x41')]['count'](_0x35fbd7)[_0xd664('0x25')](function(_0x591007){_0x16cd02[_0xd664('0x20')]=_0x591007;if(_0xc83fa[_0xd664('0x31')][_0xd664('0x42')]){_0x3dd87d[_0xd664('0x43')]=[{'all':!![]}];}return db['Attachment'][_0xd664('0x44')](_0x3dd87d);})[_0xd664('0x25')](function(_0xd61e40){_0x16cd02['rows']=_0xd61e40;return _0x16cd02;})[_0xd664('0x25')](respondWithFilteredResult(_0x450b48,_0x3dd87d))[_0xd664('0x45')](handleError(_0x450b48,null));};exports[_0xd664('0x46')]=function(_0xf075d8,_0x5eddfc){var _0x5c8022={'raw':!![],'where':{'id':_0xf075d8[_0xd664('0x47')]['id']}},_0x21c390={};_0x21c390[_0xd664('0x2e')]=_[_0xd664('0x30')](db[_0xd664('0x41')][_0xd664('0x2b')]);_0x21c390[_0xd664('0x31')]=_[_0xd664('0x30')](_0xf075d8[_0xd664('0x31')]);_0x21c390[_0xd664('0x32')]=_['intersection'](_0x21c390[_0xd664('0x2e')],_0x21c390[_0xd664('0x31')]);_0x5c8022[_0xd664('0x33')]=_[_0xd664('0x34')](_0x21c390[_0xd664('0x2e')],qs[_0xd664('0x35')](_0xf075d8[_0xd664('0x31')][_0xd664('0x35')]));_0x5c8022[_0xd664('0x33')]=_0x5c8022[_0xd664('0x33')][_0xd664('0x36')]?_0x5c8022[_0xd664('0x33')]:_0x21c390['model'];if(_0xf075d8[_0xd664('0x31')][_0xd664('0x42')]){_0x5c8022['include']=[{'all':!![]}];}_0x5c8022=_[_0xd664('0x3f')]({},_0x5c8022,_0xf075d8[_0xd664('0x40')]);return db[_0xd664('0x41')]['find'](_0x5c8022)['then'](handleEntityNotFound(_0x5eddfc,null))[_0xd664('0x25')](respondWithResult(_0x5eddfc,null))[_0xd664('0x45')](handleError(_0x5eddfc,null));};exports[_0xd664('0x48')]=function(_0x595bca,_0x4c28c2){var _0x299e99={'where':{'id':_0x595bca[_0xd664('0x47')]['id']}},_0x4ba7ad={};_0x4ba7ad['model']=_[_0xd664('0x30')](db[_0xd664('0x41')][_0xd664('0x2b')]);_0x299e99['attributes']=_[_0xd664('0x34')](_0x4ba7ad[_0xd664('0x2e')],qs[_0xd664('0x35')](_0x595bca['query'][_0xd664('0x35')]));_0x299e99[_0xd664('0x33')]=_0x299e99[_0xd664('0x33')][_0xd664('0x36')]?_0x299e99[_0xd664('0x33')]:_0x4ba7ad[_0xd664('0x2e')];if(_0x595bca['query']['includeAll']){_0x299e99['include']=[{'all':!![]}];}_0x299e99=_['merge']({},_0x299e99,_0x595bca[_0xd664('0x40')]);return db[_0xd664('0x41')][_0xd664('0x49')](_0x299e99)[_0xd664('0x25')](handleEntityNotFound(_0x4c28c2,null))[_0xd664('0x25')](function(_0x49c655){if(_0x49c655){var _0x156f25=_0x49c655[_0xd664('0x4a')]({'plain':!![]});_0x156f25=qs['omit'](_0x156f25,['id',_0xd664('0x4b'),_0xd664('0x4c')]);_0x595bca[_0xd664('0x4d')]=_[_0xd664('0x4e')](_0x595bca['body'],['id','createdAt','updatedAt']);return db[_0xd664('0x41')]['create'](_[_0xd664('0x3f')](_0x156f25,_0x595bca[_0xd664('0x4d')]),{'include':_0x595bca[_0xd664('0x31')][_0xd664('0x42')]?[{'all':!![]}]:undefined});}})[_0xd664('0x25')](respondWithResult(_0x4c28c2,0xc9))['catch'](handleError(_0x4c28c2,null));};exports[_0xd664('0x24')]=function(_0x444686,_0x54e61b){if(_0x444686[_0xd664('0x4d')]['id']){delete _0x444686['body']['id'];}return db[_0xd664('0x41')][_0xd664('0x49')]({'where':{'id':_0x444686[_0xd664('0x47')]['id']}})[_0xd664('0x25')](handleEntityNotFound(_0x54e61b,null))['then'](saveUpdates(_0x444686[_0xd664('0x4d')],null))[_0xd664('0x25')](respondWithResult(_0x54e61b,null))['catch'](handleError(_0x54e61b,null));};exports['destroy']=function(_0x307f23,_0x1910a5){return db[_0xd664('0x41')]['find']({'where':{'id':_0x307f23[_0xd664('0x47')]['id']}})[_0xd664('0x25')](handleEntityNotFound(_0x1910a5,null))['then'](removeEntity(_0x1910a5,null))['catch'](handleError(_0x1910a5,null));};exports[_0xd664('0x4f')]=function(_0x1ef029,_0xfcd4ad,_0x1c49de){_0x1ef029[_0xd664('0x4d')][_0xd664('0x28')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x51')];_0x1ef029[_0xd664('0x4d')][_0xd664('0x52')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x53')];_0x1ef029[_0xd664('0x4d')][_0xd664('0x2d')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x54')];return db[_0xd664('0x41')][_0xd664('0x4f')](_0x1ef029['body'])[_0xd664('0x25')](respondWithResult(_0xfcd4ad,0xc9))[_0xd664('0x45')](handleError(_0xfcd4ad,null));};exports['download']=function(_0x4bea5b,_0x2bc002,_0x558b41){return db[_0xd664('0x41')][_0xd664('0x55')]({'where':{'id':_0x4bea5b[_0xd664('0x47')]['id']},'raw':!![]})[_0xd664('0x25')](handleEntityNotFound(_0x2bc002,null))[_0xd664('0x25')](function(_0x1a0f7a){if(_0x1a0f7a){var _0x41d0e4=_0x1a0f7a[_0xd664('0x56')]!==null;var _0x3e84c3=path['join'](config['root'],'server/files/attachments/');if(_0x41d0e4){_0x3e84c3=path[_0xd664('0x57')](_0x3e84c3,_0xd664('0x58'));}var _0x5c6ed5=path['join'](_0x3e84c3,_0x1a0f7a['basename']);return _0x2bc002['download'](_0x5c6ed5);}})[_0xd664('0x45')](handleError(_0x2bc002,null));};
\ No newline at end of file
+var _0xd906=['count','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','Attachment','findAll','catch','show','params','keys','includeAll','find','clone','get','createdAt','updatedAt','body','omit','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0xbfe7cf,_0x202416){var _0x30efe6=function(_0x590108){while(--_0x590108){_0xbfe7cf['push'](_0xbfe7cf['shift']());}};_0x30efe6(++_0x202416);}(_0xd906,0x1ab));var _0x6d90=function(_0x5525df,_0x4c40cc){_0x5525df=_0x5525df-0x0;var _0x66d0bf=_0xd906[_0x5525df];return _0x66d0bf;};'use strict';var emlformat=require(_0x6d90('0x0'));var rimraf=require(_0x6d90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d90('0x2'));var rp=require(_0x6d90('0x3'));var moment=require(_0x6d90('0x4'));var BPromise=require(_0x6d90('0x5'));var Mustache=require('mustache');var util=require(_0x6d90('0x6'));var path=require(_0x6d90('0x7'));var sox=require(_0x6d90('0x8'));var csv=require(_0x6d90('0x9'));var ejs=require(_0x6d90('0xa'));var fs=require('fs');var fs_extra=require(_0x6d90('0xb'));var _=require(_0x6d90('0xc'));var squel=require('squel');var crypto=require(_0x6d90('0xd'));var jsforce=require(_0x6d90('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d90('0x9'));var querystring=require(_0x6d90('0xf'));var Papa=require(_0x6d90('0x10'));var Redis=require(_0x6d90('0x11'));var authService=require(_0x6d90('0x12'));var qs=require(_0x6d90('0x13'));var as=require(_0x6d90('0x14'));var hardwareService=require(_0x6d90('0x15'));var logger=require(_0x6d90('0x16'))(_0x6d90('0x17'));var utils=require(_0x6d90('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6d90('0x19'));var db=require(_0x6d90('0x1a'))['db'];function respondWithStatusCode(_0x133397,_0x381e5f){_0x381e5f=_0x381e5f||0xcc;return function(_0x302631){if(_0x302631){return _0x133397[_0x6d90('0x1b')](_0x381e5f);}return _0x133397[_0x6d90('0x1c')](_0x381e5f)['end']();};}function respondWithResult(_0x31b153,_0x28a55e){_0x28a55e=_0x28a55e||0xc8;return function(_0x1b7e7f){if(_0x1b7e7f){return _0x31b153[_0x6d90('0x1c')](_0x28a55e)[_0x6d90('0x1d')](_0x1b7e7f);}};}function respondWithFilteredResult(_0x1e6a43,_0x3efa85){return function(_0x57605b){if(_0x57605b){var _0x46ec26=typeof _0x3efa85[_0x6d90('0x1e')]===_0x6d90('0x1f')&&typeof _0x3efa85[_0x6d90('0x20')]===_0x6d90('0x1f');var _0x5ad42e=_0x57605b[_0x6d90('0x21')];var _0x45b62f=_0x46ec26?0x0:_0x3efa85[_0x6d90('0x1e')];var _0x1aa85d=_0x46ec26?_0x57605b[_0x6d90('0x21')]:_0x3efa85[_0x6d90('0x1e')]+_0x3efa85['limit'];var _0x3cdd63;if(_0x1aa85d>=_0x5ad42e){_0x1aa85d=_0x5ad42e;_0x3cdd63=0xc8;}else{_0x3cdd63=0xce;}_0x1e6a43[_0x6d90('0x1c')](_0x3cdd63);return _0x1e6a43['set'](_0x6d90('0x22'),_0x45b62f+'-'+_0x1aa85d+'/'+_0x5ad42e)['json'](_0x57605b);}return null;};}function patchUpdates(_0x352343){return function(_0x47b72c){try{jsonpatch[_0x6d90('0x23')](_0x47b72c,_0x352343,!![]);}catch(_0x52a953){return BPromise[_0x6d90('0x24')](_0x52a953);}return _0x47b72c[_0x6d90('0x25')]();};}function saveUpdates(_0x37068c,_0x812a0f){return function(_0x56f57b){if(_0x56f57b){return _0x56f57b['update'](_0x37068c)['then'](function(_0x221730){return _0x221730;});}return null;};}function removeEntity(_0x2f5077,_0x35105c){return function(_0x39deea){if(_0x39deea){return _0x39deea[_0x6d90('0x26')]()[_0x6d90('0x27')](function(){_0x2f5077[_0x6d90('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2b1f,_0x16e448){return function(_0x3da12e){if(!_0x3da12e){_0x4f2b1f[_0x6d90('0x1b')](0x194);}return _0x3da12e;};}function handleError(_0x126291,_0x38c263){_0x38c263=_0x38c263||0x1f4;return function(_0x70b3f0){logger['error'](_0x70b3f0[_0x6d90('0x28')]);if(_0x70b3f0[_0x6d90('0x29')]){delete _0x70b3f0['name'];}_0x126291[_0x6d90('0x1c')](_0x38c263)[_0x6d90('0x2a')](_0x70b3f0);};}exports[_0x6d90('0x2b')]=function(_0x4fcfde,_0x4af923){var _0x54fb88={},_0x3f2ee5={},_0x4d45f0={'count':0x0,'rows':[]};var _0x2476e0=_[_0x6d90('0x2c')](db['Attachment'][_0x6d90('0x2d')],function(_0x4c2ed8){return{'name':_0x4c2ed8[_0x6d90('0x2e')],'type':_0x4c2ed8[_0x6d90('0x2f')]['key']};});_0x3f2ee5['model']=_[_0x6d90('0x2c')](_0x2476e0,_0x6d90('0x29'));_0x3f2ee5[_0x6d90('0x30')]=_['keys'](_0x4fcfde[_0x6d90('0x30')]);_0x3f2ee5['filters']=_[_0x6d90('0x31')](_0x3f2ee5[_0x6d90('0x32')],_0x3f2ee5[_0x6d90('0x30')]);_0x54fb88[_0x6d90('0x33')]=_[_0x6d90('0x31')](_0x3f2ee5[_0x6d90('0x32')],qs[_0x6d90('0x34')](_0x4fcfde['query'][_0x6d90('0x34')]));_0x54fb88[_0x6d90('0x33')]=_0x54fb88[_0x6d90('0x33')][_0x6d90('0x35')]?_0x54fb88[_0x6d90('0x33')]:_0x3f2ee5[_0x6d90('0x32')];if(!_0x4fcfde[_0x6d90('0x30')][_0x6d90('0x36')](_0x6d90('0x37'))){_0x54fb88[_0x6d90('0x20')]=qs[_0x6d90('0x20')](_0x4fcfde['query']['limit']);_0x54fb88[_0x6d90('0x1e')]=qs[_0x6d90('0x1e')](_0x4fcfde[_0x6d90('0x30')][_0x6d90('0x1e')]);}_0x54fb88['order']=qs[_0x6d90('0x38')](_0x4fcfde['query'][_0x6d90('0x38')]);_0x54fb88[_0x6d90('0x39')]=qs[_0x6d90('0x3a')](_[_0x6d90('0x3b')](_0x4fcfde[_0x6d90('0x30')],_0x3f2ee5[_0x6d90('0x3a')]),_0x2476e0);if(_0x4fcfde['query'][_0x6d90('0x3c')]){_0x54fb88[_0x6d90('0x39')]=_[_0x6d90('0x3d')](_0x54fb88[_0x6d90('0x39')],{'$or':_['map'](_0x2476e0,function(_0x4e6aca){if(_0x4e6aca[_0x6d90('0x2f')]!==_0x6d90('0x3e')){var _0x3e05cc={};_0x3e05cc[_0x4e6aca[_0x6d90('0x29')]]={'$like':'%'+_0x4fcfde['query'][_0x6d90('0x3c')]+'%'};return _0x3e05cc;}})});}_0x54fb88=_[_0x6d90('0x3d')]({},_0x54fb88,_0x4fcfde[_0x6d90('0x3f')]);var _0x5c95d9={'where':_0x54fb88['where']};return db['Attachment'][_0x6d90('0x21')](_0x5c95d9)[_0x6d90('0x27')](function(_0x53a7b0){_0x4d45f0[_0x6d90('0x21')]=_0x53a7b0;if(_0x4fcfde[_0x6d90('0x30')]['includeAll']){_0x54fb88[_0x6d90('0x40')]=[{'all':!![]}];}return db[_0x6d90('0x41')][_0x6d90('0x42')](_0x54fb88);})['then'](function(_0x55bd81){_0x4d45f0['rows']=_0x55bd81;return _0x4d45f0;})[_0x6d90('0x27')](respondWithFilteredResult(_0x4af923,_0x54fb88))[_0x6d90('0x43')](handleError(_0x4af923,null));};exports[_0x6d90('0x44')]=function(_0x4bfc82,_0x571f0c){var _0x1aa951={'raw':!![],'where':{'id':_0x4bfc82[_0x6d90('0x45')]['id']}},_0x520eaf={};_0x520eaf[_0x6d90('0x32')]=_[_0x6d90('0x46')](db[_0x6d90('0x41')][_0x6d90('0x2d')]);_0x520eaf[_0x6d90('0x30')]=_['keys'](_0x4bfc82[_0x6d90('0x30')]);_0x520eaf['filters']=_[_0x6d90('0x31')](_0x520eaf[_0x6d90('0x32')],_0x520eaf[_0x6d90('0x30')]);_0x1aa951[_0x6d90('0x33')]=_[_0x6d90('0x31')](_0x520eaf[_0x6d90('0x32')],qs['fields'](_0x4bfc82['query'][_0x6d90('0x34')]));_0x1aa951[_0x6d90('0x33')]=_0x1aa951[_0x6d90('0x33')][_0x6d90('0x35')]?_0x1aa951['attributes']:_0x520eaf[_0x6d90('0x32')];if(_0x4bfc82['query'][_0x6d90('0x47')]){_0x1aa951[_0x6d90('0x40')]=[{'all':!![]}];}_0x1aa951=_[_0x6d90('0x3d')]({},_0x1aa951,_0x4bfc82[_0x6d90('0x3f')]);return db['Attachment'][_0x6d90('0x48')](_0x1aa951)[_0x6d90('0x27')](handleEntityNotFound(_0x571f0c,null))['then'](respondWithResult(_0x571f0c,null))[_0x6d90('0x43')](handleError(_0x571f0c,null));};exports[_0x6d90('0x49')]=function(_0x167256,_0x33f5a5){var _0x4437c0={'where':{'id':_0x167256['params']['id']}},_0x25e439={};_0x25e439[_0x6d90('0x32')]=_[_0x6d90('0x46')](db[_0x6d90('0x41')][_0x6d90('0x2d')]);_0x4437c0['attributes']=_[_0x6d90('0x31')](_0x25e439[_0x6d90('0x32')],qs['fields'](_0x167256[_0x6d90('0x30')]['fields']));_0x4437c0[_0x6d90('0x33')]=_0x4437c0[_0x6d90('0x33')]['length']?_0x4437c0['attributes']:_0x25e439[_0x6d90('0x32')];if(_0x167256['query'][_0x6d90('0x47')]){_0x4437c0['include']=[{'all':!![]}];}_0x4437c0=_[_0x6d90('0x3d')]({},_0x4437c0,_0x167256[_0x6d90('0x3f')]);return db['Attachment'][_0x6d90('0x48')](_0x4437c0)['then'](handleEntityNotFound(_0x33f5a5,null))[_0x6d90('0x27')](function(_0x176b14){if(_0x176b14){var _0x4d0bd4=_0x176b14[_0x6d90('0x4a')]({'plain':!![]});_0x4d0bd4=qs['omit'](_0x4d0bd4,['id',_0x6d90('0x4b'),_0x6d90('0x4c')]);_0x167256[_0x6d90('0x4d')]=_[_0x6d90('0x4e')](_0x167256[_0x6d90('0x4d')],['id',_0x6d90('0x4b'),_0x6d90('0x4c')]);return db['Attachment'][_0x6d90('0x4f')](_[_0x6d90('0x3d')](_0x4d0bd4,_0x167256[_0x6d90('0x4d')]),{'include':_0x167256[_0x6d90('0x30')][_0x6d90('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x33f5a5,0xc9))[_0x6d90('0x43')](handleError(_0x33f5a5,null));};exports[_0x6d90('0x50')]=function(_0x2766d6,_0x40b712){if(_0x2766d6[_0x6d90('0x4d')]['id']){delete _0x2766d6[_0x6d90('0x4d')]['id'];}return db['Attachment'][_0x6d90('0x48')]({'where':{'id':_0x2766d6[_0x6d90('0x45')]['id']}})[_0x6d90('0x27')](handleEntityNotFound(_0x40b712,null))[_0x6d90('0x27')](saveUpdates(_0x2766d6[_0x6d90('0x4d')],null))['then'](respondWithResult(_0x40b712,null))[_0x6d90('0x43')](handleError(_0x40b712,null));};exports[_0x6d90('0x26')]=function(_0x5097fe,_0x12d223){return db['Attachment'][_0x6d90('0x48')]({'where':{'id':_0x5097fe['params']['id']}})[_0x6d90('0x27')](handleEntityNotFound(_0x12d223,null))['then'](removeEntity(_0x12d223,null))['catch'](handleError(_0x12d223,null));};exports[_0x6d90('0x4f')]=function(_0x3de4ce,_0x38653b,_0x3d3cad){_0x3de4ce[_0x6d90('0x4d')]['name']=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x52')];_0x3de4ce[_0x6d90('0x4d')][_0x6d90('0x53')]=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x54')];_0x3de4ce[_0x6d90('0x4d')]['type']=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x55')];return db[_0x6d90('0x41')]['create'](_0x3de4ce[_0x6d90('0x4d')])[_0x6d90('0x27')](respondWithResult(_0x38653b,0xc9))[_0x6d90('0x43')](handleError(_0x38653b,null));};exports[_0x6d90('0x56')]=function(_0x367d05,_0x1c7807,_0x4afd89){return db[_0x6d90('0x41')][_0x6d90('0x57')]({'where':{'id':_0x367d05[_0x6d90('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c7807,null))['then'](function(_0x17f7e4){if(_0x17f7e4){var _0x4c8370=_0x17f7e4[_0x6d90('0x58')]!==null;var _0x1291bf=path['join'](config['root'],_0x6d90('0x59'));if(_0x4c8370){_0x1291bf=path['join'](_0x1291bf,_0x6d90('0x5a'));}var _0x36ea8a=path[_0x6d90('0x5b')](_0x1291bf,_0x17f7e4[_0x6d90('0x53')]);return _0x1c7807[_0x6d90('0x56')](_0x36ea8a);}})[_0x6d90('0x43')](handleError(_0x1c7807,null));};
\ No newline at end of file
index c84a8c1..4947553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5da=['define','attachments','util','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0xc6bf1,_0x1b8bb8){var _0xd97e75=function(_0x420e63){while(--_0x420e63){_0xc6bf1['push'](_0xc6bf1['shift']());}};_0xd97e75(++_0x1b8bb8);}(_0xa5da,0x1ba));var _0xaa5d=function(_0x154906,_0x429a62){_0x154906=_0x154906-0x0;var _0x63d91a=_0xa5da[_0x154906];return _0x63d91a;};'use strict';var _=require('lodash');var util=require(_0xaa5d('0x0'));var logger=require('../../config/logger')(_0xaa5d('0x1'));var moment=require(_0xaa5d('0x2'));var BPromise=require(_0xaa5d('0x3'));var rp=require(_0xaa5d('0x4'));var fs=require('fs');var path=require(_0xaa5d('0x5'));var rimraf=require('rimraf');var config=require(_0xaa5d('0x6'));var attributes=require(_0xaa5d('0x7'));module[_0xaa5d('0x8')]=function(_0x4db4a2,_0x5f8987){return _0x4db4a2[_0xaa5d('0x9')]('Attachment',attributes,{'tableName':_0xaa5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95eb=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','Attachment'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x95eb,0x14b));var _0xb95e=function(_0x279839,_0xc86373){_0x279839=_0x279839-0x0;var _0x38c1e5=_0x95eb[_0x279839];return _0x38c1e5;};'use strict';var _=require(_0xb95e('0x0'));var util=require(_0xb95e('0x1'));var logger=require(_0xb95e('0x2'))(_0xb95e('0x3'));var moment=require('moment');var BPromise=require(_0xb95e('0x4'));var rp=require(_0xb95e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb95e('0x6'));var config=require(_0xb95e('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x105008,_0x7317bf){return _0x105008['define'](_0xb95e('0x8'),attributes,{'tableName':_0xb95e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index de0a95e..a57cfa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da1=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','create','body','options','raw'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x1da1,0x1a4));var _0x11da=function(_0x4e46be,_0x1cfc61){_0x4e46be=_0x4e46be-0x0;var _0x277c6b=_0x1da1[_0x4e46be];return _0x277c6b;};'use strict';var _=require(_0x11da('0x0'));var util=require(_0x11da('0x1'));var moment=require(_0x11da('0x2'));var BPromise=require(_0x11da('0x3'));var rs=require(_0x11da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11da('0x5'));var logger=require(_0x11da('0x6'))(_0x11da('0x7'));var config=require('../../config/environment');var jayson=require(_0x11da('0x8'));var client=jayson[_0x11da('0x9')][_0x11da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecc27,_0x5e7d63,_0x287653){return new BPromise(function(_0x109f4b,_0x4c7757){return client[_0x11da('0xb')](_0x5ecc27,_0x287653)[_0x11da('0xc')](function(_0x5c03d7){logger[_0x11da('0xd')](_0x11da('0xe'),_0x5e7d63,_0x11da('0xf'));logger[_0x11da('0x10')](_0x11da('0x11'),_0x5e7d63,_0x11da('0xf'),JSON[_0x11da('0x12')](_0x5c03d7));if(_0x5c03d7[_0x11da('0x13')]){if(_0x5c03d7[_0x11da('0x13')]['code']===0x1f4){logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x5c03d7[_0x11da('0x13')][_0x11da('0x14')]);return _0x4c7757(_0x5c03d7[_0x11da('0x13')]['message']);}logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x5c03d7[_0x11da('0x13')][_0x11da('0x14')]);return _0x109f4b(_0x5c03d7[_0x11da('0x13')]['message']);}else{logger[_0x11da('0xd')]('Attachment,\x20%s,\x20%s',_0x5e7d63,_0x11da('0xf'));_0x109f4b(_0x5c03d7[_0x11da('0x15')][_0x11da('0x14')]);}})[_0x11da('0x16')](function(_0x9ec352){logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x9ec352);_0x4c7757(_0x9ec352);});});}exports[_0x11da('0x17')]=function(_0x3c3392){var _0x12fb44=this;return new Promise(function(_0x463c3d,_0x286534){return db['Attachment'][_0x11da('0x18')](_0x3c3392[_0x11da('0x19')],{'raw':_0x3c3392[_0x11da('0x1a')]?_0x3c3392[_0x11da('0x1a')][_0x11da('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2c0d4a){logger[_0x11da('0xd')](_0x11da('0x17'),_0x3c3392);logger['debug']('CreateAttachment',_0x3c3392,JSON[_0x11da('0x12')](_0x2c0d4a));_0x463c3d(_0x2c0d4a);})[_0x11da('0x16')](function(_0x275400){logger['error'](_0x11da('0x17'),_0x275400['message'],_0x3c3392);_0x286534(_0x12fb44[_0x11da('0x13')](0x1f4,_0x275400[_0x11da('0x14')]));});});};
\ No newline at end of file
+var _0xe812=['error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37b0e4,_0x4120b9){var _0x205929=function(_0x28cd3e){while(--_0x28cd3e){_0x37b0e4['push'](_0x37b0e4['shift']());}};_0x205929(++_0x4120b9);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var moment=require(_0x2e81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e81('0x2'));var db=require(_0x2e81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e81('0x4'))(_0x2e81('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e81('0x6'));var client=jayson[_0x2e81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36604d,_0x32b221,_0x27f9c6){return new BPromise(function(_0x5559ca,_0x142cab){return client[_0x2e81('0x8')](_0x36604d,_0x27f9c6)[_0x2e81('0x9')](function(_0x11a56b){logger['info'](_0x2e81('0xa'),_0x32b221,_0x2e81('0xb'));logger[_0x2e81('0xc')](_0x2e81('0xd'),_0x32b221,_0x2e81('0xb'),JSON[_0x2e81('0xe')](_0x11a56b));if(_0x11a56b[_0x2e81('0xf')]){if(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x10')]===0x1f4){logger[_0x2e81('0xf')](_0x2e81('0xa'),_0x32b221,_0x11a56b['error'][_0x2e81('0x11')]);return _0x142cab(_0x11a56b[_0x2e81('0xf')]['message']);}logger[_0x2e81('0xf')]('Attachment,\x20%s,\x20%s',_0x32b221,_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);return _0x5559ca(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);}else{logger[_0x2e81('0x12')](_0x2e81('0xa'),_0x32b221,'request\x20sent');_0x5559ca(_0x11a56b[_0x2e81('0x13')][_0x2e81('0x11')]);}})['catch'](function(_0x330131){logger['error'](_0x2e81('0xa'),_0x32b221,_0x330131);_0x142cab(_0x330131);});});}exports[_0x2e81('0x14')]=function(_0x4c1b11){var _0x402992=this;return new Promise(function(_0x2bb9b6,_0xbb61a4){return db[_0x2e81('0x15')][_0x2e81('0x16')](_0x4c1b11[_0x2e81('0x17')],{'raw':_0x4c1b11[_0x2e81('0x18')]?_0x4c1b11[_0x2e81('0x18')][_0x2e81('0x19')]===undefined?!![]:![]:!![]})[_0x2e81('0x9')](function(_0x524694){logger[_0x2e81('0x12')](_0x2e81('0x14'),_0x4c1b11);logger[_0x2e81('0xc')](_0x2e81('0x14'),_0x4c1b11,JSON[_0x2e81('0xe')](_0x524694));_0x2bb9b6(_0x524694);})[_0x2e81('0x1a')](function(_0x18b9be){logger[_0x2e81('0xf')]('CreateAttachment',_0x18b9be[_0x2e81('0x11')],_0x4c1b11);_0xbb61a4(_0x402992['error'](0x1f4,_0x18b9be[_0x2e81('0x11')]));});});};
\ No newline at end of file
index f7ce46e..9ad81c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4afe00,_0x47e7fa){var _0x33b5fe=function(_0x5609f2){while(--_0x5609f2){_0x4afe00['push'](_0x4afe00['shift']());}};_0x33b5fe(++_0x47e7fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x583cc4,_0x323055){_0x583cc4=_0x583cc4-0x0;var _0x4a94e9=_0x5f2f[_0x583cc4];return _0x4a94e9;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
index 61a946a..47aa05d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7faa=['getLicense','catch','status','send','message','ad-login','signToken','json','use','User','passport','Strategy','moment','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','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','adSsoEnabled','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','user','minutes'];(function(_0x464ffa,_0x3392dd){var _0x372d07=function(_0x2339d3){while(--_0x2339d3){_0x464ffa['push'](_0x464ffa['shift']());}};_0x372d07(++_0x3392dd);}(_0x7faa,0xeb));var _0xa7fa=function(_0x1173e4,_0x317cf4){_0x1173e4=_0x1173e4-0x0;var _0x48409b=_0x7faa[_0x1173e4];return _0x48409b;};'use strict';var passport=require(_0xa7fa('0x0'));var LocalStrategy=require('passport-local')[_0xa7fa('0x1')];var moment=require(_0xa7fa('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa7fa('0x3'));var util=require(_0xa7fa('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xa7fa('0x5'));var utils=require(_0xa7fa('0x6'));var config=require(_0xa7fa('0x7'));var logger=require(_0xa7fa('0x8'))(_0xa7fa('0x9'));function isActiveDirectoryConfigured(_0x19f95b){var _0x2c8d52=![];if(typeof _0x19f95b[_0xa7fa('0xa')]!==_0xa7fa('0xb')){_0x2c8d52=_0x19f95b['activedirectory'][_0xa7fa('0xc')]&&_0x19f95b[_0xa7fa('0xa')][_0xa7fa('0xd')]&&_0x19f95b['activedirectory'][_0xa7fa('0xe')];}return _0x2c8d52;}function adAuthenticate(_0x14661d,_0x391014,_0x1c3c07){return new BPromise(function(_0x54f95a,_0x2bf612){try{var _0x2e9450=new ActiveDirectory(_0x14661d);_0x2e9450[_0xa7fa('0xf')](_0x391014,_0x1c3c07,function(_0x1dd1b4,_0x255fe2){if(_0x1dd1b4){logger[_0xa7fa('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x391014,util[_0xa7fa('0x11')](_0x1dd1b4,{'showHidden':![],'depth':null}));_0x2bf612(_0xa7fa('0x12'));}else if(!_0x255fe2){logger[_0xa7fa('0x10')](_0xa7fa('0x13'),_0x391014);_0x2bf612(_0xa7fa('0x12'));}else{_0x54f95a(_0x255fe2);}});}catch(_0x24d510){_0x2bf612(_0x24d510);}});}function ActiveDirectoryAuthenticate(_0x51b484,_0x375acf,_0x3827ec,_0x562a5b){var _0x34f6fb,_0x3b8e7b;if(!isActiveDirectoryConfigured(config)){logger[_0xa7fa('0x10')](_0xa7fa('0x14'),_0x375acf);return _0x562a5b(null,![],{'message':_0xa7fa('0x12')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa7fa('0x15'),_0xa7fa('0x16')],'raw':!![]})[_0xa7fa('0x17')](function(_0x109866){_0x34f6fb=_0x109866;if(!_0x34f6fb[_0xa7fa('0x15')]){logger[_0xa7fa('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x375acf);throw new Error(_0xa7fa('0x12'));}return _0x51b484[_0xa7fa('0x18')]({'attributes':['id',_0xa7fa('0x19'),_0xa7fa('0x1a'),_0xa7fa('0x1b'),_0xa7fa('0x1c'),_0xa7fa('0x1d'),_0xa7fa('0x1e'),_0xa7fa('0x1f'),_0xa7fa('0x20')],'where':{'name':_0x375acf,'role':{'$or':['admin',_0xa7fa('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xa7fa('0x17')](function(_0x388e13){if(!_0x388e13||_0x388e13&&_0x388e13[_0xa7fa('0x19')]!==_0x375acf){throw new Error(_0xa7fa('0x12'));}_0x3b8e7b=_0x388e13;var _0x3b6ae3=_0x3b8e7b[_0xa7fa('0x19')]+'@'+config[_0xa7fa('0xa')][_0xa7fa('0xe')];return adAuthenticate(config[_0xa7fa('0xa')],_0x3b6ae3,_0x3827ec);})['then'](function(_0x70caef){if(_0x3b8e7b[_0xa7fa('0x1d')]){throw new Error(_0xa7fa('0x12'));}if(_0x34f6fb[_0xa7fa('0x16')]>0x0){if(_0x3b8e7b[_0xa7fa('0x1e')]){if(moment(_0x3b8e7b['blockedAt'])['add'](_0x34f6fb[_0xa7fa('0x16')],_0xa7fa('0x22'))>moment()){throw new Error(_0xa7fa('0x12'));}return utils['clearBlockUser'](_0x3b8e7b,0x0,![],null)[_0xa7fa('0x17')](function(){return utils[_0xa7fa('0x23')](_0x3b8e7b);})['then'](function(){return _0x562a5b(null,_0x3b8e7b);});}else{return utils[_0xa7fa('0x23')](_0x3b8e7b)[_0xa7fa('0x17')](function(){return _0x562a5b(null,_0x3b8e7b);});}}else{return utils['getLicense'](_0x3b8e7b)['then'](function(){return _0x562a5b(null,_0x3b8e7b);});}})[_0xa7fa('0x24')](function(_0x3b8d74){return _0x562a5b(null,![],_0x3b8d74);});}function handleError(_0xe3ca05,_0x4d53ce,_0xcf6e6b){return _0xe3ca05[_0xa7fa('0x25')](_0x4d53ce||0x1f4)[_0xa7fa('0x26')]({'message':_0xcf6e6b?_0xcf6e6b[_0xa7fa('0x27')]||_0xcf6e6b:''});}exports['login']=function(_0x3f0172,_0x2b112d,_0x41ef7d){passport['authenticate'](_0xa7fa('0x28'),function(_0x3f3826,_0x757d18,_0x5d155f){var _0x592bbe=_0x3f3826||_0x5d155f;if(_0x592bbe){return handleError(_0x2b112d,0x191,_0x592bbe);}if(!_0x757d18){return handleError(_0x2b112d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4982ec={'payload':{'id':_0x757d18['id'],'role':_0x757d18[_0xa7fa('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xa7fa('0x29')](_0x4982ec)['then'](function(_0xe64b60){_0x2b112d[_0xa7fa('0x2a')]({'id':_0x757d18['id'],'token':_0xe64b60,'statusCall':'','isAlreadyLogged':_0x757d18[_0xa7fa('0x20')]});});}})(_0x3f0172,_0x2b112d,_0x41ef7d);};passport[_0xa7fa('0x2b')](_0xa7fa('0x28'),new LocalStrategy({'usernameField':_0xa7fa('0x19'),'passwordField':_0xa7fa('0x1a')},function(_0x25377e,_0x1c9b8d,_0x39e5b3){return ActiveDirectoryAuthenticate(db[_0xa7fa('0x2c')],_0x25377e,_0x1c9b8d,_0x39e5b3);}));
\ No newline at end of file
+var _0x8fef=['blockDuration','name','password','salt','role','disabled','blockedAt','online','admin','then','blocked','add','minutes','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','domain','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'];(function(_0x1473a9,_0x446f61){var _0x1c1021=function(_0x29ee89){while(--_0x29ee89){_0x1473a9['push'](_0x1473a9['shift']());}};_0x1c1021(++_0x446f61);}(_0x8fef,0x1e4));var _0xf8fe=function(_0x40461a,_0x1a9cf2){_0x40461a=_0x40461a-0x0;var _0xc14a39=_0x8fef[_0x40461a];return _0xc14a39;};'use strict';var passport=require(_0xf8fe('0x0'));var LocalStrategy=require(_0xf8fe('0x1'))[_0xf8fe('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xf8fe('0x3'));var BPromise=require('bluebird');var util=require(_0xf8fe('0x4'));var db=require(_0xf8fe('0x5'))['db'];var authService=require(_0xf8fe('0x6'));var utils=require(_0xf8fe('0x7'));var config=require(_0xf8fe('0x8'));var logger=require(_0xf8fe('0x9'))('api');function isActiveDirectoryConfigured(_0x9ca0cc){var _0x2b5517=![];if(typeof _0x9ca0cc[_0xf8fe('0xa')]!=='undefined'){_0x2b5517=_0x9ca0cc[_0xf8fe('0xa')]['baseDN']&&_0x9ca0cc[_0xf8fe('0xa')]['url']&&_0x9ca0cc[_0xf8fe('0xa')][_0xf8fe('0xb')];}return _0x2b5517;}function adAuthenticate(_0x1c1809,_0x2ce30c,_0x39f72c){return new BPromise(function(_0x5a2f73,_0x4efa5f){try{var _0x10a717=new ActiveDirectory(_0x1c1809);_0x10a717['authenticate'](_0x2ce30c,_0x39f72c,function(_0x4a29ed,_0x1c4d88){if(_0x4a29ed){logger[_0xf8fe('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x2ce30c,util[_0xf8fe('0xd')](_0x4a29ed,{'showHidden':![],'depth':null}));_0x4efa5f(_0xf8fe('0xe'));}else if(!_0x1c4d88){logger[_0xf8fe('0xc')](_0xf8fe('0xf'),_0x2ce30c);_0x4efa5f(_0xf8fe('0xe'));}else{_0x5a2f73(_0x1c4d88);}});}catch(_0x2c2a27){_0x4efa5f(_0x2c2a27);}});}function ActiveDirectoryAuthenticate(_0x1eb384,_0x4807a4,_0x3c24bb,_0x18bb94){var _0x34118e,_0x1e2feb;if(!isActiveDirectoryConfigured(config)){logger[_0xf8fe('0xc')](_0xf8fe('0x10'),_0x4807a4);return _0x18bb94(null,![],{'message':_0xf8fe('0xe')});}return db[_0xf8fe('0x11')][_0xf8fe('0x12')]({'where':{'id':0x1},'attributes':[_0xf8fe('0x13'),_0xf8fe('0x14')],'raw':!![]})['then'](function(_0x425b74){_0x34118e=_0x425b74;if(!_0x34118e['adSsoEnabled']){logger[_0xf8fe('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x4807a4);throw new Error(_0xf8fe('0xe'));}return _0x1eb384[_0xf8fe('0x12')]({'attributes':['id',_0xf8fe('0x15'),_0xf8fe('0x16'),_0xf8fe('0x17'),_0xf8fe('0x18'),_0xf8fe('0x19'),'blocked',_0xf8fe('0x1a'),_0xf8fe('0x1b')],'where':{'name':_0x4807a4,'role':{'$or':[_0xf8fe('0x1c'),'user','agent']},'adSsoEnabled':!![]}});})[_0xf8fe('0x1d')](function(_0x37371f){if(!_0x37371f||_0x37371f&&_0x37371f[_0xf8fe('0x15')]!==_0x4807a4){throw new Error(_0xf8fe('0xe'));}_0x1e2feb=_0x37371f;var _0x2460e0=_0x1e2feb[_0xf8fe('0x15')]+'@'+config[_0xf8fe('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x2460e0,_0x3c24bb);})['then'](function(_0xda9bdd){if(_0x1e2feb[_0xf8fe('0x19')]){throw new Error(_0xf8fe('0xe'));}if(_0x34118e['blockDuration']>0x0){if(_0x1e2feb[_0xf8fe('0x1e')]){if(moment(_0x1e2feb['blockedAt'])[_0xf8fe('0x1f')](_0x34118e[_0xf8fe('0x14')],_0xf8fe('0x20'))>moment()){throw new Error(_0xf8fe('0xe'));}return utils['clearBlockUser'](_0x1e2feb,0x0,![],null)['then'](function(){return utils[_0xf8fe('0x21')](_0x1e2feb);})[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}else{return utils[_0xf8fe('0x21')](_0x1e2feb)[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}}else{return utils[_0xf8fe('0x21')](_0x1e2feb)[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}})[_0xf8fe('0x22')](function(_0x494651){return _0x18bb94(null,![],_0x494651);});}function handleError(_0xa957b5,_0x5a2f3a,_0x262959){return _0xa957b5['status'](_0x5a2f3a||0x1f4)[_0xf8fe('0x23')]({'message':_0x262959?_0x262959[_0xf8fe('0x24')]||_0x262959:''});}exports[_0xf8fe('0x25')]=function(_0x8b67f,_0x16d233,_0x43bdd9){passport['authenticate']('ad-login',function(_0x1338d2,_0x5dd118,_0x3be091){var _0x3bfe88=_0x1338d2||_0x3be091;if(_0x3bfe88){return handleError(_0x16d233,0x191,_0x3bfe88);}if(!_0x5dd118){return handleError(_0x16d233,0x194,{'message':_0xf8fe('0x26')});}else{var _0x1baef4={'payload':{'id':_0x5dd118['id'],'role':_0x5dd118[_0xf8fe('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1baef4)[_0xf8fe('0x1d')](function(_0x3752d6){_0x16d233[_0xf8fe('0x27')]({'id':_0x5dd118['id'],'token':_0x3752d6,'statusCall':'','isAlreadyLogged':_0x5dd118[_0xf8fe('0x1b')]});});}})(_0x8b67f,_0x16d233,_0x43bdd9);};passport[_0xf8fe('0x28')]('ad-login',new LocalStrategy({'usernameField':_0xf8fe('0x15'),'passwordField':_0xf8fe('0x16')},function(_0x1c5cd4,_0x2562e1,_0x275668){return ActiveDirectoryAuthenticate(db[_0xf8fe('0x29')],_0x1c5cd4,_0x2562e1,_0x275668);}));
\ No newline at end of file
index 283d8bf..2ee852a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b38=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x5ac21e,_0x126167){var _0x3854fc=function(_0x3f95dd){while(--_0x3f95dd){_0x5ac21e['push'](_0x5ac21e['shift']());}};_0x3854fc(++_0x126167);}(_0x0b38,0xbb));var _0x80b3=function(_0x291ffd,_0x44dcef){_0x291ffd=_0x291ffd-0x0;var _0x34a11d=_0x0b38[_0x291ffd];return _0x34a11d;};'use strict';var express=require(_0x80b3('0x0'));var router=express[_0x80b3('0x1')]();var controller=require(_0x80b3('0x2'));router[_0x80b3('0x3')]('/',controller['login']);module[_0x80b3('0x4')]=router;
\ No newline at end of file
+var _0x7225=['express','Router','./authActiveDirectory.controller','post','exports'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0x7225,0x186));var _0x5722=function(_0x2a4e46,_0x38b4c7){_0x2a4e46=_0x2a4e46-0x0;var _0x51ac07=_0x7225[_0x2a4e46];return _0x51ac07;};'use strict';var express=require(_0x5722('0x0'));var router=express[_0x5722('0x1')]();var controller=require(_0x5722('0x2'));router[_0x5722('0x3')]('/',controller['login']);module[_0x5722('0x4')]=router;
\ No newline at end of file
index 2eac6ef..2934158 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x7d2f2d,_0x322f91){_0x7d2f2d=_0x7d2f2d-0x0;var _0x5acf8a=_0x7a54[_0x7d2f2d];return _0x5acf8a;};'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
index b2ca10e..9367177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fb2=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fb2,0xe1));var _0x27fb=function(_0x27cce7,_0x3f384a){_0x27cce7=_0x27cce7-0x0;var _0x48d84f=_0x7fb2[_0x27cce7];return _0x48d84f;};'use strict';var express=require('express');var passport=require(_0x27fb('0x0'));var router=express[_0x27fb('0x1')]();var controller=require(_0x27fb('0x2'));var userController=require(_0x27fb('0x3'));var authService=require(_0x27fb('0x4'));router[_0x27fb('0x5')]('/',controller['login']);router[_0x27fb('0x5')](_0x27fb('0x6'),controller[_0x27fb('0x7')],authService[_0x27fb('0x8')],userController[_0x27fb('0x9')],authService[_0x27fb('0xa')]);module[_0x27fb('0xb')]=router;
\ No newline at end of file
+var _0xb5fd=['/callback','callback','isMiddleware','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x456200,_0x3d4c03){var _0x551f2e=function(_0x807f2d){while(--_0x807f2d){_0x456200['push'](_0x456200['shift']());}};_0x551f2e(++_0x3d4c03);}(_0xb5fd,0x71));var _0xdb5f=function(_0x2c0ff7,_0x5dd45e){_0x2c0ff7=_0x2c0ff7-0x0;var _0x57742=_0xb5fd[_0x2c0ff7];return _0x57742;};'use strict';var express=require('express');var passport=require(_0xdb5f('0x0'));var router=express[_0xdb5f('0x1')]();var controller=require(_0xdb5f('0x2'));var userController=require(_0xdb5f('0x3'));var authService=require(_0xdb5f('0x4'));router[_0xdb5f('0x5')]('/',controller[_0xdb5f('0x6')]);router[_0xdb5f('0x5')](_0xdb5f('0x7'),controller[_0xdb5f('0x8')],authService[_0xdb5f('0x9')],userController[_0xdb5f('0x6')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
index b9a65f5..3e4b8a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd5=['Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','generate','body','trim'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xedd5,0x15f));var _0x5edd=function(_0x49f913,_0x12ccd8){_0x49f913=_0x49f913-0x0;var _0xf48ea5=_0xedd5[_0x49f913];return _0xf48ea5;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x5edd('0x0'))[_0x5edd('0x1')];var jayson=require(_0x5edd('0x2'));var _=require('lodash');var rs=require(_0x5edd('0x3'));var moment=require(_0x5edd('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x5edd('0x5'));var utils=require('../../config/utils');var client=jayson[_0x5edd('0x6')][_0x5edd('0x7')]({'port':0x232b});function localAuthenticate(_0x2e981b,_0x5b49d9,_0x8da44a,_0x4ae92b){var _0x24cc61,_0x3008de;return db['Setting'][_0x5edd('0x8')]({'where':{'id':0x1},'attributes':[_0x5edd('0x9'),_0x5edd('0xa')],'raw':!![]})[_0x5edd('0xb')](function(_0x32d3b9){_0x24cc61=_0x32d3b9;return _0x2e981b[_0x5edd('0x8')]({'attributes':['id',_0x5edd('0xc'),_0x5edd('0xd'),_0x5edd('0xe'),_0x5edd('0xf'),_0x5edd('0x10'),_0x5edd('0x11'),_0x5edd('0x12'),_0x5edd('0x13')],'where':{'name':_0x5b49d9,'role':{'$or':[_0x5edd('0x14'),'user',_0x5edd('0x15')]}}});})[_0x5edd('0xb')](function(_0x2254cf){if(!_0x2254cf||_0x2254cf&&_0x2254cf[_0x5edd('0xc')]!==_0x5b49d9){throw new Error(_0x5edd('0x16'));}else{_0x3008de=_0x2254cf;return _0x3008de;}})[_0x5edd('0xb')](function(){_0x3008de[_0x5edd('0x17')](_0x8da44a,function(_0x1eab2d,_0x1011dd){var _0x2b7bb2=_0x3008de[_0x5edd('0x13')]+0x1;if(_0x1eab2d){return _0x4ae92b(_0x1eab2d);}else if(!_0x1011dd){if(_0x3008de[_0x5edd('0x10')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else if(_0x24cc61[_0x5edd('0x9')]>0x0){if(_0x3008de['blocked']){if(_0x24cc61[_0x5edd('0xa')]>0x0){if(moment(_0x3008de[_0x5edd('0x12')])[_0x5edd('0x18')](_0x24cc61[_0x5edd('0xa')],_0x5edd('0x19'))>moment()){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1a')](_0x3008de,_0x2b7bb2,![],null)[_0x5edd('0xb')](function(){return _0x4ae92b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{if(_0x2b7bb2>=_0x24cc61[_0x5edd('0x9')]){return utils[_0x5edd('0x1a')](_0x3008de,0x0,!![],moment())[_0x5edd('0xb')](function(){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});});}else{return utils[_0x5edd('0x1a')](_0x3008de,_0x2b7bb2,![],null)['then'](function(){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});});}}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{if(_0x3008de[_0x5edd('0x10')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else if(_0x24cc61[_0x5edd('0x9')]>0x0){if(_0x3008de[_0x5edd('0x11')]){if(_0x24cc61[_0x5edd('0xa')]>0x0){if(moment(_0x3008de[_0x5edd('0x12')])[_0x5edd('0x18')](_0x24cc61[_0x5edd('0xa')],'minutes')>moment()){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1a')](_0x3008de,0x0,![],null)[_0x5edd('0xb')](function(){return utils[_0x5edd('0x1b')](_0x3008de);})[_0x5edd('0xb')](function(){return _0x4ae92b(null,_0x3008de);});}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{return utils[_0x5edd('0x1a')](_0x3008de,0x0,![],null)['then'](function(){return utils[_0x5edd('0x1b')](_0x3008de);})['then'](function(){return _0x4ae92b(null,_0x3008de);})['catch'](function(_0x30dc6a){return _0x4ae92b(null,![],_0x30dc6a);});}}else{if(_0x3008de[_0x5edd('0x11')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1b')](_0x3008de)['then'](function(){return _0x4ae92b(null,_0x3008de);});}}}});})[_0x5edd('0x1c')](function(_0x1414e3){return _0x4ae92b(null,![],_0x1414e3);});}function sendServiceMail(_0x3b7577){return db['MailAccount'][_0x5edd('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x5edd('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x5edd('0x1f'),'include':[{'model':db[_0x5edd('0x20')],'as':_0x5edd('0x20')}]}]})[_0x5edd('0xb')](function(_0x1ba669){if(!_0x1ba669){throw new Error(_0x5edd('0x21'));}var _0x186e94=_0x1ba669[_0x5edd('0x22')]();var _0x2b4499={'account':_0x186e94,'message':_[_0x5edd('0x23')]({'from':util['format'](_0x5edd('0x24'),_0x1ba669[_0x5edd('0xc')],_0x1ba669[_0x5edd('0x1e')]||_0x1ba669[_0x5edd('0x1f')]['user'])},_0x3b7577)};return client[_0x5edd('0x25')](_0x5edd('0x26'),_0x2b4499);})[_0x5edd('0xb')](function(_0x5583b5){if(_0x5583b5[_0x5edd('0x27')]){throw new Error(util[_0x5edd('0x28')](_0x5edd('0x29'),_0x5583b5[_0x5edd('0x27')][_0x5edd('0x2a')]||JSON['stringify'](_0x5583b5[_0x5edd('0x27')])));}return!![];});}function handleError(_0x566d56,_0x2cee93,_0x1cd46f){return _0x566d56[_0x5edd('0x2b')](_0x2cee93||0x1f4)[_0x5edd('0x2c')]({'message':_0x1cd46f?_0x1cd46f[_0x5edd('0x2a')]||_0x1cd46f:''});}exports[_0x5edd('0x2d')]=function(_0x1311c6,_0x13eaa7,_0x3a3e89){passport[_0x5edd('0x17')](_0x5edd('0x2e'),function(_0x271734,_0x55cafb,_0x2221fa){var _0x458cbc=_0x271734||_0x2221fa;if(_0x458cbc){return handleError(_0x13eaa7,0x191,_0x458cbc);}if(!_0x55cafb){return handleError(_0x13eaa7,0x194,{'message':_0x5edd('0x2f')});}else{var _0x3e05ab={'payload':{'id':_0x55cafb['id'],'role':_0x55cafb[_0x5edd('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5edd('0x30')](_0x3e05ab)['then'](function(_0x565d9b){_0x13eaa7[_0x5edd('0x31')]({'id':_0x55cafb['id'],'token':_0x565d9b,'statusCall':'','isAlreadyLogged':_0x55cafb['online']});});}})(_0x1311c6,_0x13eaa7,_0x3a3e89);};exports[_0x5edd('0x32')]=function(_0x25b173,_0x5c5858){if(!_0x25b173['body'][_0x5edd('0x1e')]){return handleError(_0x5c5858,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1b5d37=rs[_0x5edd('0x33')]();_0x25b173[_0x5edd('0x34')][_0x5edd('0x1e')]=_0x25b173[_0x5edd('0x34')][_0x5edd('0x1e')][_0x5edd('0x35')]()['toLowerCase']();var _0x3ea620;return db[_0x5edd('0x36')][_0x5edd('0x8')]({'where':{'id':0x1},'attributes':[_0x5edd('0x9'),_0x5edd('0xa')],'raw':!![]})['then'](function(_0x325c9b){_0x3ea620=_0x325c9b;return db[_0x5edd('0x37')]['find']({'where':{'email':_0x25b173[_0x5edd('0x34')]['email']}});})[_0x5edd('0xb')](function(_0x1b0c58){if(!_0x1b0c58){throw new Error(_0x5edd('0x38'));}if(_0x1b0c58[_0x5edd('0x10')]){throw new Error(_0x5edd('0x39'));}if(_0x1b0c58[_0x5edd('0x11')]){if(moment(_0x1b0c58[_0x5edd('0x12')])[_0x5edd('0x18')](_0x3ea620['blockDuration'],_0x5edd('0x19'))>moment()){throw new Error(_0x5edd('0x3a'));}else{_0x1b0c58[_0x5edd('0x11')]=![];_0x1b0c58[_0x5edd('0x12')]=null;}}_0x1b0c58[_0x5edd('0x3b')]=_0x1b5d37;_0x1b0c58[_0x5edd('0x3c')]=Date[_0x5edd('0x3d')]()+0x36ee80;return _0x1b0c58[_0x5edd('0x3e')]();})[_0x5edd('0xb')](function(){return sendServiceMail({'to':_0x25b173[_0x5edd('0x34')]['email'],'subject':_0x5edd('0x3f'),'text':_0x5edd('0x40')+_0x5edd('0x41')+_0x5edd('0x42')+_0x25b173[_0x5edd('0x43')][_0x5edd('0x44')]+_0x5edd('0x45')+_0x1b5d37+'\x0a\x0a'+_0x5edd('0x46')});})[_0x5edd('0xb')](function(){_0x5c5858['status'](0xc8)[_0x5edd('0x2c')]({'message':_0x5edd('0x47')});})[_0x5edd('0x1c')](function(_0x542eef){return handleError(_0x5c5858,0x1f4,_0x542eef);});};exports[_0x5edd('0x48')]=function(_0x4bca8f,_0x233b19){return db[_0x5edd('0x37')][_0x5edd('0x1d')]({'where':{'resetPasswordToken':_0x4bca8f[_0x5edd('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5edd('0x3d')]()}}})[_0x5edd('0xb')](function(_0x399e22){if(!_0x399e22){throw new Error(_0x5edd('0x4a'));}return db[_0x5edd('0x36')][_0x5edd('0x8')]({'attributes':['id',_0x5edd('0x4b'),_0x5edd('0x4c'),'passwordHistoryLimit']})[_0x5edd('0xb')](function(_0xb43205){if(_0xb43205[_0x5edd('0x4b')])authService[_0x5edd('0x4d')](_0x4bca8f[_0x5edd('0x34')]['password']);if(!_0xb43205[_0x5edd('0x4c')]||!_0x399e22[_0x5edd('0x4e')])return _0x399e22;authService[_0x5edd('0x4f')](_0x4bca8f[_0x5edd('0x34')][_0x5edd('0xd')],_0x399e22[_0x5edd('0x4e')],_0xb43205['passwordHistoryLimit']);return _0x399e22;})[_0x5edd('0xb')](function(){_0x399e22[_0x5edd('0xd')]=_0x4bca8f[_0x5edd('0x34')]['password'];_0x399e22[_0x5edd('0x3b')]=null;_0x399e22['resetPasswordExpires']=null;return _0x399e22[_0x5edd('0x3e')]();});})[_0x5edd('0xb')](function(){_0x233b19[_0x5edd('0x2b')](0xc8)['send']({'message':_0x5edd('0x50')});})[_0x5edd('0x1c')](function(_0x529184){return handleError(_0x233b19,0x1f4,_0x529184);});};passport['use'](_0x5edd('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3f4322,_0x3053cf,_0x188abe){return localAuthenticate(db['User'],_0x3f4322,_0x3053cf,_0x188abe);}));
\ No newline at end of file
+var _0xce11=['then','name','password','salt','role','blocked','blockedAt','admin','user','agent','authenticate','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','clearBlockUser','minutes','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','SendMail','error','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','body','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','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','catch','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','status','use','local-login','util','passport','passport-local','Strategy','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce11,0x97));var _0x1ce1=function(_0x277fd9,_0x2c4ae8){_0x277fd9=_0x277fd9-0x0;var _0x4c1296=_0xce11[_0x277fd9];return _0x4c1296;};'use strict';var util=require(_0x1ce1('0x0'));var passport=require(_0x1ce1('0x1'));var LocalStrategy=require(_0x1ce1('0x2'))[_0x1ce1('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x1ce1('0x4'));var moment=require(_0x1ce1('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x1ce1('0x6'));var utils=require(_0x1ce1('0x7'));var client=jayson[_0x1ce1('0x8')][_0x1ce1('0x9')]({'port':0x232b});function localAuthenticate(_0x4b206b,_0x3be155,_0x45fbc2,_0x42037d){var _0x2a7e86,_0x28652b;return db['Setting'][_0x1ce1('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x1ce1('0xb')](function(_0x1d73d5){_0x2a7e86=_0x1d73d5;return _0x4b206b['findOne']({'attributes':['id',_0x1ce1('0xc'),_0x1ce1('0xd'),_0x1ce1('0xe'),_0x1ce1('0xf'),'disabled',_0x1ce1('0x10'),_0x1ce1('0x11'),'loginAttempts'],'where':{'name':_0x3be155,'role':{'$or':[_0x1ce1('0x12'),_0x1ce1('0x13'),_0x1ce1('0x14')]}}});})[_0x1ce1('0xb')](function(_0x983d72){if(!_0x983d72||_0x983d72&&_0x983d72['name']!==_0x3be155){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x28652b=_0x983d72;return _0x28652b;}})[_0x1ce1('0xb')](function(){_0x28652b[_0x1ce1('0x15')](_0x45fbc2,function(_0x176edf,_0x2836b2){var _0x60163f=_0x28652b[_0x1ce1('0x16')]+0x1;if(_0x176edf){return _0x42037d(_0x176edf);}else if(!_0x2836b2){if(_0x28652b[_0x1ce1('0x17')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else if(_0x2a7e86[_0x1ce1('0x19')]>0x0){if(_0x28652b[_0x1ce1('0x10')]){if(_0x2a7e86[_0x1ce1('0x1a')]>0x0){if(moment(_0x28652b['blockedAt'])[_0x1ce1('0x1b')](_0x2a7e86[_0x1ce1('0x1a')],'minutes')>moment()){return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1ce1('0x1c')](_0x28652b,_0x60163f,![],null)['then'](function(){return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}}else{if(_0x60163f>=_0x2a7e86['allowedLoginAttempts']){return utils[_0x1ce1('0x1c')](_0x28652b,0x0,!![],moment())['then'](function(){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});});}else{return utils['clearBlockUser'](_0x28652b,_0x60163f,![],null)[_0x1ce1('0xb')](function(){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});});}}}else{return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x28652b[_0x1ce1('0x17')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else if(_0x2a7e86[_0x1ce1('0x19')]>0x0){if(_0x28652b[_0x1ce1('0x10')]){if(_0x2a7e86[_0x1ce1('0x1a')]>0x0){if(moment(_0x28652b['blockedAt'])[_0x1ce1('0x1b')](_0x2a7e86[_0x1ce1('0x1a')],_0x1ce1('0x1d'))>moment()){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else{return utils['clearBlockUser'](_0x28652b,0x0,![],null)[_0x1ce1('0xb')](function(){return utils[_0x1ce1('0x1e')](_0x28652b);})[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);});}}else{return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x28652b,0x0,![],null)[_0x1ce1('0xb')](function(){return utils[_0x1ce1('0x1e')](_0x28652b);})[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);})['catch'](function(_0x29419d){return _0x42037d(null,![],_0x29419d);});}}else{if(_0x28652b[_0x1ce1('0x10')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else{return utils[_0x1ce1('0x1e')](_0x28652b)[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);});}}}});})['catch'](function(_0x240a5a){return _0x42037d(null,![],_0x240a5a);});}function sendServiceMail(_0x194171){return db[_0x1ce1('0x1f')][_0x1ce1('0x20')]({'where':{'service':!![]},'attributes':['id',_0x1ce1('0xc'),_0x1ce1('0x21')],'include':[{'model':db[_0x1ce1('0x22')],'as':_0x1ce1('0x23'),'include':[{'model':db[_0x1ce1('0x24')],'as':_0x1ce1('0x24')}]}]})['then'](function(_0x2be45d){if(!_0x2be45d){throw new Error(_0x1ce1('0x25'));}var _0x38d5a0=_0x2be45d['getSmtpOptions']();var _0x10adc3={'account':_0x38d5a0,'message':_[_0x1ce1('0x26')]({'from':util[_0x1ce1('0x27')]('\x22%s\x22\x20<%s>',_0x2be45d['name'],_0x2be45d['email']||_0x2be45d['Smtp'][_0x1ce1('0x13')])},_0x194171)};return client['request'](_0x1ce1('0x28'),_0x10adc3);})['then'](function(_0x143dab){if(_0x143dab['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x143dab['error']['message']||JSON['stringify'](_0x143dab[_0x1ce1('0x29')])));}return!![];});}function handleError(_0x1f01c5,_0x32a4ed,_0xa0e751){return _0x1f01c5['status'](_0x32a4ed||0x1f4)['send']({'message':_0xa0e751?_0xa0e751[_0x1ce1('0x2a')]||_0xa0e751:''});}exports['login']=function(_0x2bc018,_0x53f731,_0x499abf){passport[_0x1ce1('0x15')]('local-login',function(_0x51579f,_0x268045,_0x2b813e){var _0x2b6132=_0x51579f||_0x2b813e;if(_0x2b6132){return handleError(_0x53f731,0x191,_0x2b6132);}if(!_0x268045){return handleError(_0x53f731,0x194,{'message':_0x1ce1('0x2b')});}else{var _0x378611={'payload':{'id':_0x268045['id'],'role':_0x268045[_0x1ce1('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x1ce1('0x2c')](_0x378611)[_0x1ce1('0xb')](function(_0x12a568){_0x53f731[_0x1ce1('0x2d')]({'id':_0x268045['id'],'token':_0x12a568,'statusCall':'','isAlreadyLogged':_0x268045[_0x1ce1('0x2e')]});});}})(_0x2bc018,_0x53f731,_0x499abf);};exports['forgot']=function(_0x2251f7,_0x5b8ace){if(!_0x2251f7['body'][_0x1ce1('0x21')]){return handleError(_0x5b8ace,0x1f4,{'message':_0x1ce1('0x2f')});}var _0x426bfd=rs['generate']();_0x2251f7['body'][_0x1ce1('0x21')]=_0x2251f7['body'][_0x1ce1('0x21')][_0x1ce1('0x30')]()[_0x1ce1('0x31')]();var _0xbe69ba;return db[_0x1ce1('0x32')][_0x1ce1('0xa')]({'where':{'id':0x1},'attributes':[_0x1ce1('0x19'),_0x1ce1('0x1a')],'raw':!![]})[_0x1ce1('0xb')](function(_0x2dc58e){_0xbe69ba=_0x2dc58e;return db['User'][_0x1ce1('0x20')]({'where':{'email':_0x2251f7[_0x1ce1('0x33')]['email']}});})['then'](function(_0x43da5c){if(!_0x43da5c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x43da5c['disabled']){throw new Error(_0x1ce1('0x34'));}if(_0x43da5c[_0x1ce1('0x10')]){if(moment(_0x43da5c[_0x1ce1('0x11')])['add'](_0xbe69ba[_0x1ce1('0x1a')],_0x1ce1('0x1d'))>moment()){throw new Error(_0x1ce1('0x35'));}else{_0x43da5c[_0x1ce1('0x10')]=![];_0x43da5c[_0x1ce1('0x11')]=null;}}_0x43da5c[_0x1ce1('0x36')]=_0x426bfd;_0x43da5c[_0x1ce1('0x37')]=Date[_0x1ce1('0x38')]()+0x36ee80;return _0x43da5c[_0x1ce1('0x39')]();})[_0x1ce1('0xb')](function(){return sendServiceMail({'to':_0x2251f7[_0x1ce1('0x33')][_0x1ce1('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1ce1('0x3a')+_0x1ce1('0x3b')+_0x1ce1('0x3c')+_0x2251f7[_0x1ce1('0x3d')][_0x1ce1('0x3e')]+_0x1ce1('0x3f')+_0x426bfd+'\x0a\x0a'+_0x1ce1('0x40')});})['then'](function(){_0x5b8ace['status'](0xc8)[_0x1ce1('0x41')]({'message':_0x1ce1('0x42')});})[_0x1ce1('0x43')](function(_0x9b9c7f){return handleError(_0x5b8ace,0x1f4,_0x9b9c7f);});};exports[_0x1ce1('0x44')]=function(_0x3d4088,_0x38a8cb){return db[_0x1ce1('0x45')][_0x1ce1('0x20')]({'where':{'resetPasswordToken':_0x3d4088[_0x1ce1('0x46')][_0x1ce1('0x47')],'resetPasswordExpires':{'$gt':Date[_0x1ce1('0x38')]()}}})['then'](function(_0xadc288){if(!_0xadc288){throw new Error(_0x1ce1('0x48'));}return db[_0x1ce1('0x32')][_0x1ce1('0xa')]({'attributes':['id',_0x1ce1('0x49'),_0x1ce1('0x4a'),'passwordHistoryLimit']})[_0x1ce1('0xb')](function(_0xb9dd4c){if(_0xb9dd4c[_0x1ce1('0x49')])authService['validatePasswordPattern'](_0x3d4088['body'][_0x1ce1('0xd')]);if(!_0xb9dd4c['enforcePasswordHistory']||!_0xadc288[_0x1ce1('0x4b')])return _0xadc288;authService[_0x1ce1('0x4c')](_0x3d4088[_0x1ce1('0x33')]['password'],_0xadc288['previousPasswords'],_0xb9dd4c[_0x1ce1('0x4d')]);return _0xadc288;})['then'](function(){_0xadc288[_0x1ce1('0xd')]=_0x3d4088[_0x1ce1('0x33')]['password'];_0xadc288['resetPasswordToken']=null;_0xadc288[_0x1ce1('0x37')]=null;return _0xadc288[_0x1ce1('0x39')]();});})[_0x1ce1('0xb')](function(){_0x38a8cb[_0x1ce1('0x4e')](0xc8)[_0x1ce1('0x41')]({'message':'Password\x20reset!'});})['catch'](function(_0x2790cc){return handleError(_0x38a8cb,0x1f4,_0x2790cc);});};passport[_0x1ce1('0x4f')](_0x1ce1('0x50'),new LocalStrategy({'usernameField':_0x1ce1('0xc'),'passwordField':_0x1ce1('0xd')},function(_0x1ba786,_0xf66cf0,_0x21cfe1){return localAuthenticate(db['User'],_0x1ba786,_0xf66cf0,_0x21cfe1);}));
\ No newline at end of file
index a2d7cf0..dac8218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3649=['/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login'];(function(_0x83770f,_0x5eef79){var _0x141355=function(_0x58bf71){while(--_0x58bf71){_0x83770f['push'](_0x83770f['shift']());}};_0x141355(++_0x5eef79);}(_0x3649,0xb8));var _0x9364=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3649[_0x187ee1];return _0x388160;};'use strict';var express=require(_0x9364('0x0'));var router=express[_0x9364('0x1')]();var controller=require(_0x9364('0x2'));router[_0x9364('0x3')]('/',controller[_0x9364('0x4')]);router[_0x9364('0x3')](_0x9364('0x5'),controller[_0x9364('0x6')]);router[_0x9364('0x3')](_0x9364('0x7'),controller[_0x9364('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xc2a0=['/reset/:token','Router','/forgot','post'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc2a0,0xed));var _0x0c2a=function(_0x2e60d8,_0x47679c){_0x2e60d8=_0x2e60d8-0x0;var _0x5a3c2c=_0xc2a0[_0x2e60d8];return _0x5a3c2c;};'use strict';var express=require('express');var router=express[_0x0c2a('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0x0c2a('0x1'),controller['forgot']);router[_0x0c2a('0x2')](_0x0c2a('0x3'),controller['reset']);module['exports']=router;
\ No newline at end of file
index 7b69f0f..87e3ba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01bb=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xb5c068,_0x1d2497){var _0x1f39c7=function(_0x26eb87){while(--_0x26eb87){_0xb5c068['push'](_0xb5c068['shift']());}};_0x1f39c7(++_0x1d2497);}(_0x01bb,0x7e));var _0xb01b=function(_0x224541,_0x2be610){_0x224541=_0x224541-0x0;var _0x5025b0=_0x01bb[_0x224541];return _0x5025b0;};'use strict';var Sequelize=require(_0xb01b('0x0'));module[_0xb01b('0x1')]={'name':{'type':Sequelize[_0xb01b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb01b('0x2')]},'description':{'type':Sequelize[_0xb01b('0x2')]},'status':{'type':Sequelize[_0xb01b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb01b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x009f=['INTEGER','STRING','BOOLEAN'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x009f,0x70));var _0xf009=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x009f[_0x5e2152];return _0x5ddcf6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf009('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xf009('0x0')]},'description':{'type':Sequelize[_0xf009('0x0')]},'status':{'type':Sequelize[_0xf009('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf009('0x2')],'defaultValue':0xa}};
\ No newline at end of file
index 6c66999..d3a5194 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeba5=['json','apply','reject','update','then','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','intersection','body','find','destroy','params','addConditions','ids','getConditions','findOne','Condition','pick','addActions','Action','omit','getActions','length','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0xa8b7ae,_0x227520){var _0x4c4ba4=function(_0x44689e){while(--_0x44689e){_0xa8b7ae['push'](_0xa8b7ae['shift']());}};_0x4c4ba4(++_0x227520);}(_0xeba5,0x7f));var _0x5eba=function(_0x3452d9,_0x3c78d6){_0x3452d9=_0x3452d9-0x0;var _0x42bb77=_0xeba5[_0x3452d9];return _0x42bb77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5eba('0x1'));var moment=require(_0x5eba('0x2'));var BPromise=require(_0x5eba('0x3'));var Mustache=require(_0x5eba('0x4'));var util=require('util');var path=require(_0x5eba('0x5'));var sox=require('sox');var csv=require(_0x5eba('0x6'));var ejs=require(_0x5eba('0x7'));var fs=require('fs');var fs_extra=require(_0x5eba('0x8'));var _=require(_0x5eba('0x9'));var squel=require('squel');var crypto=require(_0x5eba('0xa'));var jsforce=require(_0x5eba('0xb'));var deskjs=require(_0x5eba('0xc'));var toCsv=require(_0x5eba('0x6'));var querystring=require('querystring');var Papa=require(_0x5eba('0xd'));var Redis=require(_0x5eba('0xe'));var authService=require(_0x5eba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5eba('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5eba('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5eba('0x12'));var licenseUtil=require(_0x5eba('0x13'));var db=require(_0x5eba('0x14'))['db'];function respondWithStatusCode(_0xbdfaac,_0x387873){_0x387873=_0x387873||0xcc;return function(_0x54794c){if(_0x54794c){return _0xbdfaac['sendStatus'](_0x387873);}return _0xbdfaac[_0x5eba('0x15')](_0x387873)[_0x5eba('0x16')]();};}function respondWithResult(_0x59f301,_0x1877e1){_0x1877e1=_0x1877e1||0xc8;return function(_0x1d7cd8){if(_0x1d7cd8){return _0x59f301[_0x5eba('0x15')](_0x1877e1)['json'](_0x1d7cd8);}};}function respondWithFilteredResult(_0x3522bf,_0x2eeb22){return function(_0x38a7fc){if(_0x38a7fc){var _0x58027=typeof _0x2eeb22['offset']===_0x5eba('0x17')&&typeof _0x2eeb22[_0x5eba('0x18')]===_0x5eba('0x17');var _0x2f65f5=_0x38a7fc[_0x5eba('0x19')];var _0x27b7ad=_0x58027?0x0:_0x2eeb22[_0x5eba('0x1a')];var _0x421307=_0x58027?_0x38a7fc[_0x5eba('0x19')]:_0x2eeb22['offset']+_0x2eeb22['limit'];var _0x86c572;if(_0x421307>=_0x2f65f5){_0x421307=_0x2f65f5;_0x86c572=0xc8;}else{_0x86c572=0xce;}_0x3522bf['status'](_0x86c572);return _0x3522bf[_0x5eba('0x1b')](_0x5eba('0x1c'),_0x27b7ad+'-'+_0x421307+'/'+_0x2f65f5)[_0x5eba('0x1d')](_0x38a7fc);}return null;};}function patchUpdates(_0x3c20d0){return function(_0x1262b1){try{jsonpatch[_0x5eba('0x1e')](_0x1262b1,_0x3c20d0,!![]);}catch(_0x24ae75){return BPromise[_0x5eba('0x1f')](_0x24ae75);}return _0x1262b1['save']();};}function saveUpdates(_0x32720d,_0x3b3615){return function(_0x1ad6c4){if(_0x1ad6c4){return _0x1ad6c4[_0x5eba('0x20')](_0x32720d)[_0x5eba('0x21')](function(_0x4e19bc){return _0x4e19bc;});}return null;};}function removeEntity(_0x3ebd67,_0x85eb11){return function(_0x3e47ba){if(_0x3e47ba){return _0x3e47ba['destroy']()[_0x5eba('0x21')](function(){_0x3ebd67[_0x5eba('0x15')](0xcc)[_0x5eba('0x16')]();});}};}function handleEntityNotFound(_0x3e8fe5,_0x5932d8){return function(_0x55b753){if(!_0x55b753){_0x3e8fe5['sendStatus'](0x194);}return _0x55b753;};}function handleError(_0xae2dbf,_0x200e0a){_0x200e0a=_0x200e0a||0x1f4;return function(_0x1cb8b0){logger['error'](_0x1cb8b0[_0x5eba('0x22')]);if(_0x1cb8b0[_0x5eba('0x23')]){delete _0x1cb8b0[_0x5eba('0x23')];}_0xae2dbf[_0x5eba('0x15')](_0x200e0a)[_0x5eba('0x24')](_0x1cb8b0);};}exports[_0x5eba('0x25')]=function(_0x192535,_0x3eee8a){var _0x35739f={},_0x513510={},_0x3c2891={'count':0x0,'rows':[]};var _0x1c72f2=_[_0x5eba('0x26')](db[_0x5eba('0x27')][_0x5eba('0x28')],function(_0x1e13ef){return{'name':_0x1e13ef['fieldName'],'type':_0x1e13ef[_0x5eba('0x29')][_0x5eba('0x2a')]};});_0x513510[_0x5eba('0x2b')]=_[_0x5eba('0x26')](_0x1c72f2,_0x5eba('0x23'));_0x513510[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x192535[_0x5eba('0x2c')]);_0x513510[_0x5eba('0x2e')]=_['intersection'](_0x513510[_0x5eba('0x2b')],_0x513510[_0x5eba('0x2c')]);_0x35739f[_0x5eba('0x2f')]=_['intersection'](_0x513510[_0x5eba('0x2b')],qs[_0x5eba('0x30')](_0x192535[_0x5eba('0x2c')]['fields']));_0x35739f[_0x5eba('0x2f')]=_0x35739f[_0x5eba('0x2f')]['length']?_0x35739f['attributes']:_0x513510[_0x5eba('0x2b')];if(!_0x192535['query'][_0x5eba('0x31')](_0x5eba('0x32'))){_0x35739f[_0x5eba('0x18')]=qs[_0x5eba('0x18')](_0x192535['query'][_0x5eba('0x18')]);_0x35739f[_0x5eba('0x1a')]=qs[_0x5eba('0x1a')](_0x192535[_0x5eba('0x2c')]['offset']);}_0x35739f[_0x5eba('0x33')]=qs[_0x5eba('0x34')](_0x192535[_0x5eba('0x2c')][_0x5eba('0x34')]);_0x35739f['where']=qs[_0x5eba('0x2e')](_['pick'](_0x192535[_0x5eba('0x2c')],_0x513510[_0x5eba('0x2e')]),_0x1c72f2);if(_0x192535['query'][_0x5eba('0x35')]){_0x35739f[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x35739f[_0x5eba('0x36')],{'$or':_['map'](_0x1c72f2,function(_0x2007a3){if(_0x2007a3[_0x5eba('0x29')]!==_0x5eba('0x38')){var _0x3df351={};_0x3df351[_0x2007a3[_0x5eba('0x23')]]={'$like':'%'+_0x192535[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x3df351;}})});}_0x35739f=_[_0x5eba('0x37')]({},_0x35739f,_0x192535[_0x5eba('0x39')]);var _0x2c1a44={'where':_0x35739f['where']};return db['Automation'][_0x5eba('0x19')](_0x2c1a44)[_0x5eba('0x21')](function(_0x4a6bfc){_0x3c2891[_0x5eba('0x19')]=_0x4a6bfc;if(_0x192535['query'][_0x5eba('0x3a')]){_0x35739f[_0x5eba('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x5eba('0x3c')](_0x35739f);})[_0x5eba('0x21')](function(_0x13bcc5){_0x3c2891['rows']=_0x13bcc5;return _0x3c2891;})[_0x5eba('0x21')](respondWithFilteredResult(_0x3eee8a,_0x35739f))[_0x5eba('0x3d')](handleError(_0x3eee8a,null));};exports['show']=function(_0x1f3a72,_0x42c7d3){var _0x384468={'raw':![],'where':{'id':_0x1f3a72['params']['id']}},_0x34e1c0={};_0x34e1c0[_0x5eba('0x2b')]=_[_0x5eba('0x2d')](db[_0x5eba('0x27')][_0x5eba('0x28')]);_0x34e1c0[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x1f3a72[_0x5eba('0x2c')]);_0x34e1c0[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x34e1c0['model'],_0x34e1c0[_0x5eba('0x2c')]);_0x384468[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x34e1c0[_0x5eba('0x2b')],qs['fields'](_0x1f3a72[_0x5eba('0x2c')]['fields']));_0x384468[_0x5eba('0x2f')]=_0x384468[_0x5eba('0x2f')]['length']?_0x384468[_0x5eba('0x2f')]:_0x34e1c0['model'];if(_0x1f3a72[_0x5eba('0x2c')][_0x5eba('0x3a')]){_0x384468[_0x5eba('0x3b')]=[{'all':!![]}];}_0x384468=_[_0x5eba('0x37')]({},_0x384468,_0x1f3a72['options']);return db['Automation']['find'](_0x384468)[_0x5eba('0x21')](handleEntityNotFound(_0x42c7d3,null))[_0x5eba('0x21')](respondWithResult(_0x42c7d3,null))[_0x5eba('0x3d')](handleError(_0x42c7d3,null));};exports['create']=function(_0x1b45f1,_0xcbdda6){return db[_0x5eba('0x27')]['create'](_0x1b45f1[_0x5eba('0x3f')],{})[_0x5eba('0x21')](respondWithResult(_0xcbdda6,0xc9))[_0x5eba('0x3d')](handleError(_0xcbdda6,null));};exports[_0x5eba('0x20')]=function(_0x322213,_0x525d4c){if(_0x322213[_0x5eba('0x3f')]['id']){delete _0x322213[_0x5eba('0x3f')]['id'];}return db[_0x5eba('0x27')][_0x5eba('0x40')]({'where':{'id':_0x322213['params']['id']}})['then'](handleEntityNotFound(_0x525d4c,null))['then'](saveUpdates(_0x322213['body'],null))['then'](respondWithResult(_0x525d4c,null))[_0x5eba('0x3d')](handleError(_0x525d4c,null));};exports[_0x5eba('0x41')]=function(_0x518898,_0x32dec6){return db[_0x5eba('0x27')][_0x5eba('0x40')]({'where':{'id':_0x518898[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x32dec6,null))[_0x5eba('0x21')](removeEntity(_0x32dec6,null))[_0x5eba('0x3d')](handleError(_0x32dec6,null));};exports[_0x5eba('0x43')]=function(_0x5da50e,_0x1685db,_0x5b4ea8){return db['Condition'][_0x5eba('0x40')]({'where':{'id':_0x5da50e[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x1685db,null))[_0x5eba('0x21')](function(_0x4434ef){if(_0x4434ef){return _0x4434ef[_0x5eba('0x43')](_0x5da50e[_0x5eba('0x3f')][_0x5eba('0x44')],_['omit'](_0x5da50e[_0x5eba('0x3f')],['ids','id'])||{});}})[_0x5eba('0x21')](respondWithResult(_0x1685db,null))[_0x5eba('0x3d')](handleError(_0x1685db,null));};exports[_0x5eba('0x45')]=function(_0x473f98,_0x15af50,_0xf46ce8){var _0x3e26e8={};var _0x53d2c6={};var _0x5efb58;var _0x3626e5;return db[_0x5eba('0x27')][_0x5eba('0x46')]({'where':{'id':_0x473f98[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x15af50,null))[_0x5eba('0x21')](function(_0x178983){if(_0x178983){_0x5efb58=_0x178983;_0x53d2c6[_0x5eba('0x2b')]=_[_0x5eba('0x2d')](db[_0x5eba('0x47')]['rawAttributes']);_0x53d2c6[_0x5eba('0x2c')]=_['keys'](_0x473f98[_0x5eba('0x2c')]);_0x53d2c6[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x53d2c6['model'],_0x53d2c6[_0x5eba('0x2c')]);_0x3e26e8[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x53d2c6[_0x5eba('0x2b')],qs['fields'](_0x473f98['query'][_0x5eba('0x30')]));_0x3e26e8[_0x5eba('0x2f')]=_0x3e26e8['attributes']['length']?_0x3e26e8['attributes']:_0x53d2c6['model'];_0x3e26e8[_0x5eba('0x33')]=qs[_0x5eba('0x34')](_0x473f98['query'][_0x5eba('0x34')]);_0x3e26e8[_0x5eba('0x36')]=qs[_0x5eba('0x2e')](_[_0x5eba('0x48')](_0x473f98[_0x5eba('0x2c')],_0x53d2c6[_0x5eba('0x2e')]));if(_0x473f98['query']['filter']){_0x3e26e8[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x3e26e8[_0x5eba('0x36')],{'$or':_['map'](_0x3e26e8[_0x5eba('0x2f')],function(_0x2e9009){var _0x43358a={};_0x43358a[_0x2e9009]={'$like':'%'+_0x473f98[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x43358a;})});}_0x3e26e8=_[_0x5eba('0x37')]({},_0x3e26e8,_0x473f98[_0x5eba('0x39')]);return _0x5efb58['getConditions'](_0x3e26e8);}})[_0x5eba('0x21')](function(_0x48cdec){if(_0x48cdec){_0x3626e5=_0x48cdec['length'];if(!_0x473f98[_0x5eba('0x2c')][_0x5eba('0x31')](_0x5eba('0x32'))){_0x3e26e8[_0x5eba('0x18')]=qs['limit'](_0x473f98[_0x5eba('0x2c')][_0x5eba('0x18')]);_0x3e26e8[_0x5eba('0x1a')]=qs['offset'](_0x473f98[_0x5eba('0x2c')][_0x5eba('0x1a')]);}return _0x5efb58['getConditions'](_0x3e26e8);}})[_0x5eba('0x21')](function(_0x2751bd){if(_0x2751bd){return _0x2751bd?{'count':_0x3626e5,'rows':_0x2751bd}:null;}})[_0x5eba('0x21')](respondWithResult(_0x15af50,null))[_0x5eba('0x3d')](handleError(_0x15af50,null));};exports[_0x5eba('0x49')]=function(_0x2242b3,_0x3da64d,_0x1a2882){return db[_0x5eba('0x4a')][_0x5eba('0x40')]({'where':{'id':_0x2242b3[_0x5eba('0x42')]['id']}})['then'](handleEntityNotFound(_0x3da64d,null))['then'](function(_0x36d89b){if(_0x36d89b){return _0x36d89b['addActions'](_0x2242b3[_0x5eba('0x3f')]['ids'],_[_0x5eba('0x4b')](_0x2242b3[_0x5eba('0x3f')],['ids','id'])||{});}})['then'](respondWithResult(_0x3da64d,null))[_0x5eba('0x3d')](handleError(_0x3da64d,null));};exports[_0x5eba('0x4c')]=function(_0x582b61,_0x3ea3e5,_0xe6e0a4){var _0x4f7b0f={};var _0x245c3f={};var _0x47df18;var _0x4becfb;return db['Automation'][_0x5eba('0x46')]({'where':{'id':_0x582b61['params']['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x3ea3e5,null))[_0x5eba('0x21')](function(_0x149f8b){if(_0x149f8b){_0x47df18=_0x149f8b;_0x245c3f[_0x5eba('0x2b')]=_['keys'](db[_0x5eba('0x4a')][_0x5eba('0x28')]);_0x245c3f[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x582b61[_0x5eba('0x2c')]);_0x245c3f[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x245c3f[_0x5eba('0x2b')],_0x245c3f['query']);_0x4f7b0f[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x245c3f[_0x5eba('0x2b')],qs[_0x5eba('0x30')](_0x582b61[_0x5eba('0x2c')][_0x5eba('0x30')]));_0x4f7b0f[_0x5eba('0x2f')]=_0x4f7b0f[_0x5eba('0x2f')][_0x5eba('0x4d')]?_0x4f7b0f[_0x5eba('0x2f')]:_0x245c3f[_0x5eba('0x2b')];_0x4f7b0f[_0x5eba('0x33')]=qs['sort'](_0x582b61[_0x5eba('0x2c')]['sort']);_0x4f7b0f[_0x5eba('0x36')]=qs[_0x5eba('0x2e')](_[_0x5eba('0x48')](_0x582b61['query'],_0x245c3f['filters']));if(_0x582b61[_0x5eba('0x2c')]['filter']){_0x4f7b0f[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x4f7b0f[_0x5eba('0x36')],{'$or':_[_0x5eba('0x26')](_0x4f7b0f[_0x5eba('0x2f')],function(_0x3b4f9c){var _0x56ae1b={};_0x56ae1b[_0x3b4f9c]={'$like':'%'+_0x582b61[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x56ae1b;})});}_0x4f7b0f=_[_0x5eba('0x37')]({},_0x4f7b0f,_0x582b61['options']);return _0x47df18[_0x5eba('0x4c')](_0x4f7b0f);}})[_0x5eba('0x21')](function(_0x92d50d){if(_0x92d50d){_0x4becfb=_0x92d50d[_0x5eba('0x4d')];if(!_0x582b61[_0x5eba('0x2c')][_0x5eba('0x31')](_0x5eba('0x32'))){_0x4f7b0f[_0x5eba('0x18')]=qs[_0x5eba('0x18')](_0x582b61[_0x5eba('0x2c')]['limit']);_0x4f7b0f[_0x5eba('0x1a')]=qs[_0x5eba('0x1a')](_0x582b61[_0x5eba('0x2c')]['offset']);}return _0x47df18[_0x5eba('0x4c')](_0x4f7b0f);}})['then'](function(_0x2b0e5b){if(_0x2b0e5b){return _0x2b0e5b?{'count':_0x4becfb,'rows':_0x2b0e5b}:null;}})['then'](respondWithResult(_0x3ea3e5,null))[_0x5eba('0x3d')](handleError(_0x3ea3e5,null));};
\ No newline at end of file
+var _0x7394=['name','index','map','Automation','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','params','include','create','body','find','addConditions','ids','omit','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','then','error','stack'];(function(_0x1cebe9,_0x37885e){var _0x54003c=function(_0xbd8272){while(--_0xbd8272){_0x1cebe9['push'](_0x1cebe9['shift']());}};_0x54003c(++_0x37885e);}(_0x7394,0x7d));var _0x4739=function(_0x5a311f,_0xd938b7){_0x5a311f=_0x5a311f-0x0;var _0x53675d=_0x7394[_0x5a311f];return _0x53675d;};'use strict';var emlformat=require(_0x4739('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4739('0x1'));var moment=require(_0x4739('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4739('0x3'));var util=require(_0x4739('0x4'));var path=require('path');var sox=require(_0x4739('0x5'));var csv=require(_0x4739('0x6'));var ejs=require(_0x4739('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4739('0x8'));var squel=require(_0x4739('0x9'));var crypto=require(_0x4739('0xa'));var jsforce=require(_0x4739('0xb'));var deskjs=require(_0x4739('0xc'));var toCsv=require(_0x4739('0x6'));var querystring=require(_0x4739('0xd'));var Papa=require(_0x4739('0xe'));var Redis=require(_0x4739('0xf'));var authService=require(_0x4739('0x10'));var qs=require(_0x4739('0x11'));var as=require(_0x4739('0x12'));var hardwareService=require(_0x4739('0x13'));var logger=require(_0x4739('0x14'))(_0x4739('0x15'));var utils=require(_0x4739('0x16'));var config=require(_0x4739('0x17'));var licenseUtil=require(_0x4739('0x18'));var db=require(_0x4739('0x19'))['db'];function respondWithStatusCode(_0x5a6b83,_0x554d42){_0x554d42=_0x554d42||0xcc;return function(_0x42272c){if(_0x42272c){return _0x5a6b83[_0x4739('0x1a')](_0x554d42);}return _0x5a6b83[_0x4739('0x1b')](_0x554d42)[_0x4739('0x1c')]();};}function respondWithResult(_0x1b9c4c,_0x5e61a5){_0x5e61a5=_0x5e61a5||0xc8;return function(_0x36abb8){if(_0x36abb8){return _0x1b9c4c[_0x4739('0x1b')](_0x5e61a5)[_0x4739('0x1d')](_0x36abb8);}};}function respondWithFilteredResult(_0x5569d9,_0x424999){return function(_0x4f9d0c){if(_0x4f9d0c){var _0x4756ad=typeof _0x424999[_0x4739('0x1e')]===_0x4739('0x1f')&&typeof _0x424999[_0x4739('0x20')]===_0x4739('0x1f');var _0xa23ee6=_0x4f9d0c[_0x4739('0x21')];var _0x2dd69b=_0x4756ad?0x0:_0x424999[_0x4739('0x1e')];var _0x4b312c=_0x4756ad?_0x4f9d0c[_0x4739('0x21')]:_0x424999[_0x4739('0x1e')]+_0x424999[_0x4739('0x20')];var _0x4441d5;if(_0x4b312c>=_0xa23ee6){_0x4b312c=_0xa23ee6;_0x4441d5=0xc8;}else{_0x4441d5=0xce;}_0x5569d9['status'](_0x4441d5);return _0x5569d9[_0x4739('0x22')]('Content-Range',_0x2dd69b+'-'+_0x4b312c+'/'+_0xa23ee6)[_0x4739('0x1d')](_0x4f9d0c);}return null;};}function patchUpdates(_0x20b058){return function(_0x4057a4){try{jsonpatch['apply'](_0x4057a4,_0x20b058,!![]);}catch(_0x566c7e){return BPromise[_0x4739('0x23')](_0x566c7e);}return _0x4057a4['save']();};}function saveUpdates(_0x231a26,_0x4063fd){return function(_0x5bebfc){if(_0x5bebfc){return _0x5bebfc[_0x4739('0x24')](_0x231a26)['then'](function(_0x3d46a6){return _0x3d46a6;});}return null;};}function removeEntity(_0x481078,_0x35c7e8){return function(_0x488cc5){if(_0x488cc5){return _0x488cc5[_0x4739('0x25')]()[_0x4739('0x26')](function(){_0x481078['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d60a,_0x2e82d2){return function(_0x269530){if(!_0x269530){_0x21d60a[_0x4739('0x1a')](0x194);}return _0x269530;};}function handleError(_0x47513e,_0x1c44c8){_0x1c44c8=_0x1c44c8||0x1f4;return function(_0x21f469){logger[_0x4739('0x27')](_0x21f469[_0x4739('0x28')]);if(_0x21f469[_0x4739('0x29')]){delete _0x21f469['name'];}_0x47513e[_0x4739('0x1b')](_0x1c44c8)['send'](_0x21f469);};}exports[_0x4739('0x2a')]=function(_0x3c24c2,_0x2ba5fb){var _0x426187={},_0x48e50e={},_0x578497={'count':0x0,'rows':[]};var _0x3d9336=_[_0x4739('0x2b')](db[_0x4739('0x2c')][_0x4739('0x2d')],function(_0x5de28f){return{'name':_0x5de28f['fieldName'],'type':_0x5de28f['type'][_0x4739('0x2e')]};});_0x48e50e[_0x4739('0x2f')]=_[_0x4739('0x2b')](_0x3d9336,_0x4739('0x29'));_0x48e50e[_0x4739('0x30')]=_[_0x4739('0x31')](_0x3c24c2['query']);_0x48e50e[_0x4739('0x32')]=_[_0x4739('0x33')](_0x48e50e['model'],_0x48e50e[_0x4739('0x30')]);_0x426187['attributes']=_[_0x4739('0x33')](_0x48e50e['model'],qs[_0x4739('0x34')](_0x3c24c2['query']['fields']));_0x426187[_0x4739('0x35')]=_0x426187[_0x4739('0x35')][_0x4739('0x36')]?_0x426187[_0x4739('0x35')]:_0x48e50e[_0x4739('0x2f')];if(!_0x3c24c2[_0x4739('0x30')][_0x4739('0x37')](_0x4739('0x38'))){_0x426187[_0x4739('0x20')]=qs[_0x4739('0x20')](_0x3c24c2[_0x4739('0x30')]['limit']);_0x426187[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x3c24c2[_0x4739('0x30')][_0x4739('0x1e')]);}_0x426187[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x3c24c2[_0x4739('0x30')][_0x4739('0x3a')]);_0x426187[_0x4739('0x3b')]=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x3c24c2[_0x4739('0x30')],_0x48e50e[_0x4739('0x32')]),_0x3d9336);if(_0x3c24c2[_0x4739('0x30')]['filter']){_0x426187[_0x4739('0x3b')]=_[_0x4739('0x3d')](_0x426187[_0x4739('0x3b')],{'$or':_[_0x4739('0x2b')](_0x3d9336,function(_0xd2c236){if(_0xd2c236[_0x4739('0x3e')]!==_0x4739('0x3f')){var _0x10b6a3={};_0x10b6a3[_0xd2c236[_0x4739('0x29')]]={'$like':'%'+_0x3c24c2[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x10b6a3;}})});}_0x426187=_[_0x4739('0x3d')]({},_0x426187,_0x3c24c2[_0x4739('0x41')]);var _0x573a00={'where':_0x426187[_0x4739('0x3b')]};return db[_0x4739('0x2c')][_0x4739('0x21')](_0x573a00)[_0x4739('0x26')](function(_0x45b96d){_0x578497[_0x4739('0x21')]=_0x45b96d;if(_0x3c24c2[_0x4739('0x30')][_0x4739('0x42')]){_0x426187['include']=[{'all':!![]}];}return db[_0x4739('0x2c')]['findAll'](_0x426187);})[_0x4739('0x26')](function(_0x4b5ab1){_0x578497[_0x4739('0x43')]=_0x4b5ab1;return _0x578497;})[_0x4739('0x26')](respondWithFilteredResult(_0x2ba5fb,_0x426187))[_0x4739('0x44')](handleError(_0x2ba5fb,null));};exports['show']=function(_0x54f109,_0x500a51){var _0x246854={'raw':![],'where':{'id':_0x54f109[_0x4739('0x45')]['id']}},_0x5d3e01={};_0x5d3e01[_0x4739('0x2f')]=_[_0x4739('0x31')](db[_0x4739('0x2c')][_0x4739('0x2d')]);_0x5d3e01[_0x4739('0x30')]=_[_0x4739('0x31')](_0x54f109[_0x4739('0x30')]);_0x5d3e01[_0x4739('0x32')]=_[_0x4739('0x33')](_0x5d3e01['model'],_0x5d3e01[_0x4739('0x30')]);_0x246854['attributes']=_['intersection'](_0x5d3e01[_0x4739('0x2f')],qs[_0x4739('0x34')](_0x54f109[_0x4739('0x30')][_0x4739('0x34')]));_0x246854[_0x4739('0x35')]=_0x246854['attributes'][_0x4739('0x36')]?_0x246854[_0x4739('0x35')]:_0x5d3e01['model'];if(_0x54f109[_0x4739('0x30')][_0x4739('0x42')]){_0x246854[_0x4739('0x46')]=[{'all':!![]}];}_0x246854=_[_0x4739('0x3d')]({},_0x246854,_0x54f109[_0x4739('0x41')]);return db[_0x4739('0x2c')]['find'](_0x246854)[_0x4739('0x26')](handleEntityNotFound(_0x500a51,null))['then'](respondWithResult(_0x500a51,null))[_0x4739('0x44')](handleError(_0x500a51,null));};exports[_0x4739('0x47')]=function(_0x159772,_0x2f7515){return db['Automation']['create'](_0x159772['body'],{})['then'](respondWithResult(_0x2f7515,0xc9))['catch'](handleError(_0x2f7515,null));};exports[_0x4739('0x24')]=function(_0x1b47c0,_0xcfdca7){if(_0x1b47c0[_0x4739('0x48')]['id']){delete _0x1b47c0[_0x4739('0x48')]['id'];}return db[_0x4739('0x2c')][_0x4739('0x49')]({'where':{'id':_0x1b47c0[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0xcfdca7,null))[_0x4739('0x26')](saveUpdates(_0x1b47c0['body'],null))[_0x4739('0x26')](respondWithResult(_0xcfdca7,null))[_0x4739('0x44')](handleError(_0xcfdca7,null));};exports['destroy']=function(_0x39011d,_0xf23deb){return db[_0x4739('0x2c')][_0x4739('0x49')]({'where':{'id':_0x39011d['params']['id']}})[_0x4739('0x26')](handleEntityNotFound(_0xf23deb,null))[_0x4739('0x26')](removeEntity(_0xf23deb,null))[_0x4739('0x44')](handleError(_0xf23deb,null));};exports['addConditions']=function(_0x430c57,_0x2de77b,_0x4238e6){return db['Condition'][_0x4739('0x49')]({'where':{'id':_0x430c57[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x2de77b,null))[_0x4739('0x26')](function(_0xb03373){if(_0xb03373){return _0xb03373[_0x4739('0x4a')](_0x430c57['body'][_0x4739('0x4b')],_[_0x4739('0x4c')](_0x430c57[_0x4739('0x48')],[_0x4739('0x4b'),'id'])||{});}})[_0x4739('0x26')](respondWithResult(_0x2de77b,null))['catch'](handleError(_0x2de77b,null));};exports[_0x4739('0x4d')]=function(_0x2c1837,_0x3f41ab,_0x26134f){var _0x202a6f={};var _0x8d91bc={};var _0x1cb0bc;var _0x247504;return db['Automation'][_0x4739('0x4e')]({'where':{'id':_0x2c1837[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x3f41ab,null))[_0x4739('0x26')](function(_0x117379){if(_0x117379){_0x1cb0bc=_0x117379;_0x8d91bc[_0x4739('0x2f')]=_['keys'](db[_0x4739('0x4f')]['rawAttributes']);_0x8d91bc[_0x4739('0x30')]=_[_0x4739('0x31')](_0x2c1837['query']);_0x8d91bc[_0x4739('0x32')]=_['intersection'](_0x8d91bc[_0x4739('0x2f')],_0x8d91bc[_0x4739('0x30')]);_0x202a6f[_0x4739('0x35')]=_[_0x4739('0x33')](_0x8d91bc['model'],qs[_0x4739('0x34')](_0x2c1837[_0x4739('0x30')]['fields']));_0x202a6f[_0x4739('0x35')]=_0x202a6f[_0x4739('0x35')]['length']?_0x202a6f[_0x4739('0x35')]:_0x8d91bc[_0x4739('0x2f')];_0x202a6f[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x2c1837['query'][_0x4739('0x3a')]);_0x202a6f['where']=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x2c1837[_0x4739('0x30')],_0x8d91bc['filters']));if(_0x2c1837[_0x4739('0x30')][_0x4739('0x40')]){_0x202a6f['where']=_[_0x4739('0x3d')](_0x202a6f['where'],{'$or':_[_0x4739('0x2b')](_0x202a6f['attributes'],function(_0x500848){var _0x504f17={};_0x504f17[_0x500848]={'$like':'%'+_0x2c1837[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x504f17;})});}_0x202a6f=_['merge']({},_0x202a6f,_0x2c1837[_0x4739('0x41')]);return _0x1cb0bc[_0x4739('0x4d')](_0x202a6f);}})[_0x4739('0x26')](function(_0x281d86){if(_0x281d86){_0x247504=_0x281d86['length'];if(!_0x2c1837[_0x4739('0x30')]['hasOwnProperty'](_0x4739('0x38'))){_0x202a6f[_0x4739('0x20')]=qs['limit'](_0x2c1837[_0x4739('0x30')]['limit']);_0x202a6f[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x2c1837[_0x4739('0x30')][_0x4739('0x1e')]);}return _0x1cb0bc[_0x4739('0x4d')](_0x202a6f);}})[_0x4739('0x26')](function(_0x2cf0fe){if(_0x2cf0fe){return _0x2cf0fe?{'count':_0x247504,'rows':_0x2cf0fe}:null;}})[_0x4739('0x26')](respondWithResult(_0x3f41ab,null))[_0x4739('0x44')](handleError(_0x3f41ab,null));};exports[_0x4739('0x50')]=function(_0x13b4c2,_0x1a8b49,_0x50ffbb){return db['Action'][_0x4739('0x49')]({'where':{'id':_0x13b4c2[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x1a8b49,null))[_0x4739('0x26')](function(_0x25e040){if(_0x25e040){return _0x25e040['addActions'](_0x13b4c2[_0x4739('0x48')][_0x4739('0x4b')],_['omit'](_0x13b4c2[_0x4739('0x48')],[_0x4739('0x4b'),'id'])||{});}})[_0x4739('0x26')](respondWithResult(_0x1a8b49,null))[_0x4739('0x44')](handleError(_0x1a8b49,null));};exports[_0x4739('0x51')]=function(_0x83c573,_0x27cc28,_0x1a5663){var _0x3f95d9={};var _0x572f4b={};var _0x47a577;var _0x53373d;return db[_0x4739('0x2c')][_0x4739('0x4e')]({'where':{'id':_0x83c573['params']['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x27cc28,null))[_0x4739('0x26')](function(_0x568ed9){if(_0x568ed9){_0x47a577=_0x568ed9;_0x572f4b[_0x4739('0x2f')]=_[_0x4739('0x31')](db[_0x4739('0x52')][_0x4739('0x2d')]);_0x572f4b[_0x4739('0x30')]=_['keys'](_0x83c573['query']);_0x572f4b[_0x4739('0x32')]=_['intersection'](_0x572f4b[_0x4739('0x2f')],_0x572f4b[_0x4739('0x30')]);_0x3f95d9['attributes']=_[_0x4739('0x33')](_0x572f4b[_0x4739('0x2f')],qs[_0x4739('0x34')](_0x83c573[_0x4739('0x30')]['fields']));_0x3f95d9[_0x4739('0x35')]=_0x3f95d9[_0x4739('0x35')][_0x4739('0x36')]?_0x3f95d9[_0x4739('0x35')]:_0x572f4b['model'];_0x3f95d9[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x83c573['query'][_0x4739('0x3a')]);_0x3f95d9[_0x4739('0x3b')]=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x83c573[_0x4739('0x30')],_0x572f4b[_0x4739('0x32')]));if(_0x83c573['query'][_0x4739('0x40')]){_0x3f95d9[_0x4739('0x3b')]=_[_0x4739('0x3d')](_0x3f95d9['where'],{'$or':_[_0x4739('0x2b')](_0x3f95d9['attributes'],function(_0x51b85d){var _0x47676b={};_0x47676b[_0x51b85d]={'$like':'%'+_0x83c573[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x47676b;})});}_0x3f95d9=_['merge']({},_0x3f95d9,_0x83c573[_0x4739('0x41')]);return _0x47a577[_0x4739('0x51')](_0x3f95d9);}})[_0x4739('0x26')](function(_0x536ff9){if(_0x536ff9){_0x53373d=_0x536ff9[_0x4739('0x36')];if(!_0x83c573[_0x4739('0x30')][_0x4739('0x37')](_0x4739('0x38'))){_0x3f95d9['limit']=qs[_0x4739('0x20')](_0x83c573[_0x4739('0x30')][_0x4739('0x20')]);_0x3f95d9[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x83c573['query'][_0x4739('0x1e')]);}return _0x47a577['getActions'](_0x3f95d9);}})[_0x4739('0x26')](function(_0x737057){if(_0x737057){return _0x737057?{'count':_0x53373d,'rows':_0x737057}:null;}})[_0x4739('0x26')](respondWithResult(_0x27cc28,null))[_0x4739('0x44')](handleError(_0x27cc28,null));};
\ No newline at end of file
index 2cca657..b1591e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x1bfe07,_0x35116f){var _0x17e158=function(_0xd542e8){while(--_0xd542e8){_0x1bfe07['push'](_0x1bfe07['shift']());}};_0x17e158(++_0x35116f);}(_0x1af7,0x11c));var _0x71af=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1af7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x71af('0x0'));var util=require(_0x71af('0x1'));var logger=require(_0x71af('0x2'))(_0x71af('0x3'));var moment=require(_0x71af('0x4'));var BPromise=require(_0x71af('0x5'));var rp=require(_0x71af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71af('0x7'));var config=require(_0x71af('0x8'));var attributes=require(_0x71af('0x9'));module[_0x71af('0xa')]=function(_0x30ec80,_0x1906b1){return _0x30ec80[_0x71af('0xb')]('Automation',attributes,{'tableName':_0x71af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfa8=['bluebird','path','rimraf','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x4009e3,_0x5c1e1d){var _0x49a75f=function(_0x2b2d6d){while(--_0x2b2d6d){_0x4009e3['push'](_0x4009e3['shift']());}};_0x49a75f(++_0x5c1e1d);}(_0xcfa8,0x133));var _0x8cfa=function(_0x19548d,_0x1e3502){_0x19548d=_0x19548d-0x0;var _0x2926fe=_0xcfa8[_0x19548d];return _0x2926fe;};'use strict';var _=require(_0x8cfa('0x0'));var util=require(_0x8cfa('0x1'));var logger=require(_0x8cfa('0x2'))(_0x8cfa('0x3'));var moment=require(_0x8cfa('0x4'));var BPromise=require(_0x8cfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cfa('0x6'));var rimraf=require(_0x8cfa('0x7'));var config=require('../../config/environment');var attributes=require(_0x8cfa('0x8'));module['exports']=function(_0x42d714,_0xeefafb){return _0x42d714[_0x8cfa('0x9')](_0x8cfa('0xa'),attributes,{'tableName':_0x8cfa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae9e732..484ed9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb11=['info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x53fcd0,_0x294576){var _0x456acb=function(_0x3a28d2){while(--_0x3a28d2){_0x53fcd0['push'](_0x53fcd0['shift']());}};_0x456acb(++_0x294576);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xfb11[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}
\ No newline at end of file
+var _0x6739=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59a188,_0x475add){var _0x16af5b=function(_0x4b17ce){while(--_0x4b17ce){_0x59a188['push'](_0x59a188['shift']());}};_0x16af5b(++_0x475add);}(_0x6739,0xd3));var _0x9673=function(_0x138cbc,_0xac550){_0x138cbc=_0x138cbc-0x0;var _0x3421bf=_0x6739[_0x138cbc];return _0x3421bf;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var moment=require(_0x9673('0x2'));var BPromise=require(_0x9673('0x3'));var rs=require(_0x9673('0x4'));var fs=require('fs');var Redis=require(_0x9673('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9673('0x6'))('rpc');var config=require(_0x9673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad052,_0x3f82df,_0x4981d9){return new BPromise(function(_0x4e1dd5,_0x39b0f0){return client[_0x9673('0x9')](_0x3ad052,_0x4981d9)[_0x9673('0xa')](function(_0x509966){logger[_0x9673('0xb')](_0x9673('0xc'),_0x3f82df,_0x9673('0xd'));logger['debug'](_0x9673('0xe'),_0x3f82df,_0x9673('0xd'),JSON[_0x9673('0xf')](_0x509966));if(_0x509966[_0x9673('0x10')]){if(_0x509966['error'][_0x9673('0x11')]===0x1f4){logger[_0x9673('0x10')](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')]['message']);return _0x39b0f0(_0x509966[_0x9673('0x10')][_0x9673('0x12')]);}logger['error'](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')][_0x9673('0x12')]);return _0x4e1dd5(_0x509966['error'][_0x9673('0x12')]);}else{logger['info'](_0x9673('0xc'),_0x3f82df,'request\x20sent');_0x4e1dd5(_0x509966['result'][_0x9673('0x12')]);}})['catch'](function(_0x3d5642){logger[_0x9673('0x10')]('Automation,\x20%s,\x20%s',_0x3f82df,_0x3d5642);_0x39b0f0(_0x3d5642);});});}
\ No newline at end of file
index 8ad8946..979aad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c4=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x41b7fb,_0x141853){var _0x22435b=function(_0x474c97){while(--_0x474c97){_0x41b7fb['push'](_0x41b7fb['shift']());}};_0x22435b(++_0x141853);}(_0x49c4,0x9b));var _0x449c=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x49c4[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x449c('0x0'));var util=require('util');var path=require(_0x449c('0x1'));var timeout=require(_0x449c('0x2'));var express=require(_0x449c('0x3'));var router=express[_0x449c('0x4')]();var fs_extra=require(_0x449c('0x5'));var auth=require(_0x449c('0x6'));var interaction=require(_0x449c('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x449c('0x8')]('/',auth[_0x449c('0x9')](),controller[_0x449c('0xa')]);router[_0x449c('0x8')](_0x449c('0xb'),auth[_0x449c('0x9')](),controller[_0x449c('0xc')]);router[_0x449c('0x8')](_0x449c('0xd'),auth[_0x449c('0x9')](),controller[_0x449c('0xe')]);router[_0x449c('0x8')](_0x449c('0xf'),auth[_0x449c('0x9')](),controller[_0x449c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x449c('0x11')]);router[_0x449c('0x12')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x449c('0x12')](_0x449c('0xf'),auth[_0x449c('0x9')](),controller[_0x449c('0x13')]);router['put'](_0x449c('0xb'),auth['isAuthenticated'](),controller[_0x449c('0x14')]);router['delete'](_0x449c('0xb'),auth[_0x449c('0x9')](),controller[_0x449c('0x15')]);module[_0x449c('0x16')]=router;
\ No newline at end of file
+var _0x56e6=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put'];(function(_0x582d6a,_0x501f14){var _0x1837eb=function(_0x5517ee){while(--_0x5517ee){_0x582d6a['push'](_0x582d6a['shift']());}};_0x1837eb(++_0x501f14);}(_0x56e6,0x6b));var _0x656e=function(_0x57cadd,_0x49cac1){_0x57cadd=_0x57cadd-0x0;var _0x46644b=_0x56e6[_0x57cadd];return _0x46644b;};'use strict';var multer=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var path=require(_0x656e('0x2'));var timeout=require(_0x656e('0x3'));var express=require(_0x656e('0x4'));var router=express[_0x656e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x656e('0x6'));var interaction=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var controller=require(_0x656e('0x9'));router[_0x656e('0xa')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0xc')]);router['get'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0xe')]);router[_0x656e('0xa')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x10')]);router[_0x656e('0xa')](_0x656e('0x11'),auth[_0x656e('0xb')](),controller[_0x656e('0x12')]);router[_0x656e('0x13')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0x14')]);router['post']('/:id/conditions',auth[_0x656e('0xb')](),controller[_0x656e('0x15')]);router[_0x656e('0x13')](_0x656e('0x11'),auth['isAuthenticated'](),controller['addActions']);router[_0x656e('0x16')](_0x656e('0xd'),auth['isAuthenticated'](),controller[_0x656e('0x17')]);router['delete'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0x18')]);module[_0x656e('0x19')]=router;
\ No newline at end of file
index 370595b..d11cb51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x870a=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr'];(function(_0x286e00,_0x1d34bb){var _0x146039=function(_0xe96072){while(--_0xe96072){_0x286e00['push'](_0x286e00['shift']());}};_0x146039(++_0x1d34bb);}(_0x870a,0x1e9));var _0xa870=function(_0x485c75,_0x1edc7c){_0x485c75=_0x485c75-0x0;var _0x441e22=_0x870a[_0x485c75];return _0x441e22;};'use strict';var Sequelize=require(_0xa870('0x0'));module[_0xa870('0x1')]={'name':{'type':Sequelize[_0xa870('0x2')],'unique':_0xa870('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa870('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xa870('0x2')]},'active':{'type':Sequelize[_0xa870('0x5')],'defaultValue':0x0,'comment':_0xa870('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa870('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'comment':_0xa870('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa870('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa870('0x2')],'defaultValue':_0xa870('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xa870('0x10')](_0xa870('0x11'),_0xa870('0x12'),_0xa870('0x13')),'defaultValue':_0xa870('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa870('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa870('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa870('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa870('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xa870('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa870('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa870('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa870('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa870('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa870('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa870('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa870('0x10')](_0xa870('0x1b'),_0xa870('0x1c')),'defaultValue':_0xa870('0x1b')},'dialPrefix':{'type':Sequelize[_0xa870('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa870('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x25')}};
\ No newline at end of file
+var _0x5fcc=['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\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','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x5fcc,0x161));var _0xc5fc=function(_0x1416ba,_0xd7bfec){_0x1416ba=_0x1416ba-0x0;var _0x593f41=_0x5fcc[_0x1416ba];return _0x593f41;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module[_0xc5fc('0x1')]={'name':{'type':Sequelize[_0xc5fc('0x2')],'unique':_0xc5fc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc5fc('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xc5fc('0x5')},'description':{'type':Sequelize[_0xc5fc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc5fc('0x6')},'limitCalls':{'type':Sequelize[_0xc5fc('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc5fc('0x4')](_0xc5fc('0xe'),'never',_0xc5fc('0xf')),'defaultValue':_0xc5fc('0xe')},'dialAMDActive':{'type':Sequelize[_0xc5fc('0x10')],'defaultValue':0x0,'comment':_0xc5fc('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc5fc('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc5fc('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc5fc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5fc('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc5fc('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc5fc('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc5fc('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc5fc('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc5fc('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc5fc('0x19'),_0xc5fc('0x1a')),'defaultValue':_0xc5fc('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x25')}};
\ No newline at end of file
index 8691720..2cbb11f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd9f=['h.id','ci.item','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','Campaign','rawAttributes','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','params','keys','fields','length','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','clone','createdAt','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findOne','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_contacts','cm_hopper_additional_phones'];(function(_0x1f5b26,_0x3ea474){var _0x5c7e3d=function(_0x270a3e){while(--_0x270a3e){_0x1f5b26['push'](_0x1f5b26['shift']());}};_0x5c7e3d(++_0x3ea474);}(_0xbd9f,0x98));var _0xfbd9=function(_0x1537d2,_0x60fc97){_0x1537d2=_0x1537d2-0x0;var _0x35e330=_0xbd9f[_0x1537d2];return _0x35e330;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbd9('0x0'));var rp=require('request-promise');var moment=require(_0xfbd9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xfbd9('0x2'));var util=require('util');var path=require(_0xfbd9('0x3'));var sox=require(_0xfbd9('0x4'));var csv=require(_0xfbd9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbd9('0x6'));var _=require('lodash');var squel=require(_0xfbd9('0x7'));var crypto=require(_0xfbd9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfbd9('0x9'));var toCsv=require(_0xfbd9('0x5'));var querystring=require(_0xfbd9('0xa'));var Papa=require('papaparse');var Redis=require(_0xfbd9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xfbd9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbd9('0xd'));var logger=require(_0xfbd9('0xe'))('api');var utils=require(_0xfbd9('0xf'));var config=require(_0xfbd9('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbd9('0x11'))['db'];function respondWithStatusCode(_0x301770,_0x1a4a0e){_0x1a4a0e=_0x1a4a0e||0xcc;return function(_0x527707){if(_0x527707){return _0x301770[_0xfbd9('0x12')](_0x1a4a0e);}return _0x301770['status'](_0x1a4a0e)['end']();};}function respondWithResult(_0x36113b,_0x35adb1){_0x35adb1=_0x35adb1||0xc8;return function(_0x159743){if(_0x159743){return _0x36113b[_0xfbd9('0x13')](_0x35adb1)['json'](_0x159743);}};}function respondWithFilteredResult(_0x2fef54,_0x9f8390){return function(_0x2b9553){if(_0x2b9553){var _0x58d553=typeof _0x9f8390[_0xfbd9('0x14')]===_0xfbd9('0x15')&&typeof _0x9f8390['limit']===_0xfbd9('0x15');var _0x516dcf=_0x2b9553[_0xfbd9('0x16')];var _0x13918f=_0x58d553?0x0:_0x9f8390['offset'];var _0x3ed394=_0x58d553?_0x2b9553[_0xfbd9('0x16')]:_0x9f8390[_0xfbd9('0x14')]+_0x9f8390[_0xfbd9('0x17')];var _0x35bf78;if(_0x3ed394>=_0x516dcf){_0x3ed394=_0x516dcf;_0x35bf78=0xc8;}else{_0x35bf78=0xce;}_0x2fef54[_0xfbd9('0x13')](_0x35bf78);return _0x2fef54[_0xfbd9('0x18')](_0xfbd9('0x19'),_0x13918f+'-'+_0x3ed394+'/'+_0x516dcf)[_0xfbd9('0x1a')](_0x2b9553);}return null;};}function patchUpdates(_0x1b1eea){return function(_0x2d2c6e){try{jsonpatch[_0xfbd9('0x1b')](_0x2d2c6e,_0x1b1eea,!![]);}catch(_0x2fc10b){return BPromise[_0xfbd9('0x1c')](_0x2fc10b);}return _0x2d2c6e[_0xfbd9('0x1d')]();};}function saveUpdates(_0x32f9bb,_0x12140b){return function(_0x4d3020){if(_0x4d3020){return _0x4d3020[_0xfbd9('0x1e')](_0x32f9bb)[_0xfbd9('0x1f')](function(_0x175373){return _0x175373;});}return null;};}function removeEntity(_0x299dd2,_0x237313){return function(_0x39da76){if(_0x39da76){return _0x39da76[_0xfbd9('0x20')]()[_0xfbd9('0x1f')](function(){var _0x3624f3=_0x39da76[_0xfbd9('0x21')]({'plain':!![]});var _0x1b0cc5='IvrCampaigns';return db[_0xfbd9('0x22')][_0xfbd9('0x20')]({'where':{'type':_0x1b0cc5,'resourceId':_0x3624f3['id']}})[_0xfbd9('0x1f')](function(){return _0x39da76;});})['then'](function(){_0x299dd2['status'](0xcc)[_0xfbd9('0x23')]();});}};}function handleEntityNotFound(_0x4d0104,_0x3c8cca){return function(_0x58de44){if(!_0x58de44){_0x4d0104['sendStatus'](0x194);}return _0x58de44;};}function handleError(_0x3a6a0,_0x5a00ff){_0x5a00ff=_0x5a00ff||0x1f4;return function(_0x303257){logger[_0xfbd9('0x24')](_0x303257[_0xfbd9('0x25')]);if(_0x303257[_0xfbd9('0x26')]){delete _0x303257[_0xfbd9('0x26')];}_0x3a6a0[_0xfbd9('0x13')](_0x5a00ff)[_0xfbd9('0x27')](_0x303257);};}exports['index']=function(_0x27dc31,_0x179b8e){var _0x2728c9={},_0x4515b5={},_0x43f09b={'count':0x0,'rows':[]};var _0x17936b=_[_0xfbd9('0x28')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')],function(_0x1f66d1){return{'name':_0x1f66d1['fieldName'],'type':_0x1f66d1['type'][_0xfbd9('0x2b')]};});_0x4515b5[_0xfbd9('0x2c')]=_[_0xfbd9('0x28')](_0x17936b,_0xfbd9('0x26'));_0x4515b5[_0xfbd9('0x2d')]=_['keys'](_0x27dc31[_0xfbd9('0x2d')]);_0x4515b5[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],_0x4515b5[_0xfbd9('0x2d')]);_0x2728c9[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],qs['fields'](_0x27dc31[_0xfbd9('0x2d')]['fields']));_0x2728c9[_0xfbd9('0x30')]=_0x2728c9['attributes']['length']?_0x2728c9[_0xfbd9('0x30')]:_0x4515b5[_0xfbd9('0x2c')];if(!_0x27dc31['query'][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x2728c9[_0xfbd9('0x17')]=qs['limit'](_0x27dc31[_0xfbd9('0x2d')]['limit']);_0x2728c9[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x27dc31['query'][_0xfbd9('0x14')]);}_0x2728c9[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x2728c9[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x27dc31['query'],_0x4515b5[_0xfbd9('0x2e')]),_0x17936b);if(_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x2728c9[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x2728c9['where'],{'$or':_[_0xfbd9('0x28')](_0x17936b,function(_0x5b7040){if(_0x5b7040[_0xfbd9('0x39')]!=='VIRTUAL'){var _0x1b88c5={};_0x1b88c5[_0x5b7040[_0xfbd9('0x26')]]={'$like':'%'+_0x27dc31[_0xfbd9('0x2d')]['filter']+'%'};return _0x1b88c5;}})});}_0x2728c9=_[_0xfbd9('0x38')]({},_0x2728c9,_0x27dc31[_0xfbd9('0x3a')]);var _0x16bfdf={'where':_0x2728c9[_0xfbd9('0x35')]};return db[_0xfbd9('0x29')][_0xfbd9('0x16')](_0x16bfdf)[_0xfbd9('0x1f')](function(_0x55f3dc){_0x43f09b[_0xfbd9('0x16')]=_0x55f3dc;if(_0x27dc31[_0xfbd9('0x2d')]['includeAll']){_0x2728c9[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x29')][_0xfbd9('0x3c')](_0x2728c9);})[_0xfbd9('0x1f')](function(_0x2eaa5d){_0x43f09b['rows']=_0x2eaa5d;return _0x43f09b;})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x179b8e,_0x2728c9))['catch'](handleError(_0x179b8e,null));};exports['show']=function(_0x443cdc,_0x5d8a94){var _0xa19c47={'raw':![],'where':{'id':_0x443cdc[_0xfbd9('0x3d')]['id']}},_0x1aa6d3={};_0x1aa6d3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x1aa6d3['query']=_[_0xfbd9('0x3e')](_0x443cdc[_0xfbd9('0x2d')]);_0x1aa6d3['filters']=_[_0xfbd9('0x2f')](_0x1aa6d3[_0xfbd9('0x2c')],_0x1aa6d3[_0xfbd9('0x2d')]);_0xa19c47[_0xfbd9('0x30')]=_['intersection'](_0x1aa6d3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x443cdc[_0xfbd9('0x2d')]['fields']));_0xa19c47['attributes']=_0xa19c47[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0xa19c47[_0xfbd9('0x30')]:_0x1aa6d3[_0xfbd9('0x2c')];if(_0x443cdc[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0xa19c47[_0xfbd9('0x3b')]=[{'all':!![]}];}_0xa19c47=_[_0xfbd9('0x38')]({},_0xa19c47,_0x443cdc[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')]['find'](_0xa19c47)[_0xfbd9('0x1f')](handleEntityNotFound(_0x5d8a94,null))[_0xfbd9('0x1f')](respondWithResult(_0x5d8a94,null))[_0xfbd9('0x42')](handleError(_0x5d8a94,null));};exports[_0xfbd9('0x43')]=function(_0x4add02,_0x5d2576){return db['Campaign'][_0xfbd9('0x43')](_0x4add02[_0xfbd9('0x44')],{})[_0xfbd9('0x1f')](function(_0x11365a){var _0x484523=_0x4add02['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x484523)throw new Error(_0xfbd9('0x45'));if(_0x484523[_0xfbd9('0x46')]==='user'){var _0x3e3d94=_0x11365a[_0xfbd9('0x21')]({'plain':!![]});var _0x5ccd07=_0xfbd9('0x47');return db[_0xfbd9('0x48')][_0xfbd9('0x49')]({'where':{'name':_0x5ccd07,'userProfileId':_0x484523[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x5dbaa6){if(_0x5dbaa6&&_0x5dbaa6[_0xfbd9('0x4b')]===0x0){return db[_0xfbd9('0x22')][_0xfbd9('0x43')]({'name':_0x3e3d94[_0xfbd9('0x26')],'resourceId':_0x3e3d94['id'],'type':_0x5dbaa6[_0xfbd9('0x26')],'sectionId':_0x5dbaa6['id']},{})['then'](function(){return _0x11365a;});}else{return _0x11365a;}})[_0xfbd9('0x42')](function(_0x310b73){logger[_0xfbd9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x310b73);throw _0x310b73;});}return _0x11365a;})['then'](respondWithResult(_0x5d2576,0xc9))[_0xfbd9('0x42')](handleError(_0x5d2576,null));};exports[_0xfbd9('0x4c')]=function(_0xe4d9f,_0x84cddb){var _0x18ac89={'where':{'id':_0xe4d9f[_0xfbd9('0x3d')]['id']}},_0x3406c8={};_0x3406c8[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x18ac89[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3406c8['model'],qs['fields'](_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x18ac89['attributes']=_0x18ac89[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x18ac89[_0xfbd9('0x30')]:_0x3406c8['model'];if(_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x18ac89[_0xfbd9('0x3b')]=[{'all':!![]}];}_0x18ac89=_['merge']({},_0x18ac89,_0xe4d9f[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')][_0xfbd9('0x49')](_0x18ac89)[_0xfbd9('0x1f')](handleEntityNotFound(_0x84cddb,null))[_0xfbd9('0x1f')](function(_0x5b7187){if(_0x5b7187){var _0x2e53f8=_0x5b7187['get']({'plain':!![]});_0x2e53f8=qs['omit'](_0x2e53f8,['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);_0xe4d9f['body']=_[_0xfbd9('0x4f')](_0xe4d9f['body'],['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);return db[_0xfbd9('0x29')][_0xfbd9('0x43')](_[_0xfbd9('0x38')](_0x2e53f8,_0xe4d9f[_0xfbd9('0x44')]),{'include':_0xe4d9f['query'][_0xfbd9('0x41')]?[{'all':!![]}]:undefined})[_0xfbd9('0x1f')](function(_0x683623){var _0x42bc46=_0xe4d9f['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x42bc46)throw new Error(_0xfbd9('0x45'));if(_0x42bc46['role']==='user'){var _0x5c287b=_0x683623[_0xfbd9('0x21')]({'plain':!![]});var _0x41416a=_0xfbd9('0x47');return db['UserProfileSection'][_0xfbd9('0x49')]({'where':{'name':_0x41416a,'userProfileId':_0x42bc46[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x366b9a){if(_0x366b9a&&_0x366b9a[_0xfbd9('0x4b')]===0x0){return db['UserProfileResource'][_0xfbd9('0x43')]({'name':_0x5c287b[_0xfbd9('0x26')],'resourceId':_0x5c287b['id'],'type':_0x366b9a[_0xfbd9('0x26')],'sectionId':_0x366b9a['id']},{})[_0xfbd9('0x1f')](function(){return _0x683623;});}else{return _0x683623;}})[_0xfbd9('0x42')](function(_0x50651b){logger[_0xfbd9('0x24')](_0xfbd9('0x50'),_0x50651b);throw _0x50651b;});}return _0x683623;});}})[_0xfbd9('0x1f')](respondWithResult(_0x84cddb,0xc9))['catch'](handleError(_0x84cddb,null));};exports[_0xfbd9('0x1e')]=function(_0x5b5284,_0xb25879){if(_0x5b5284[_0xfbd9('0x44')]['id']){delete _0x5b5284[_0xfbd9('0x44')]['id'];}return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x5b5284['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0xb25879,null))[_0xfbd9('0x1f')](saveUpdates(_0x5b5284['body'],null))['then'](respondWithResult(_0xb25879,null))[_0xfbd9('0x42')](handleError(_0xb25879,null));};exports['destroy']=function(_0x6f3c37,_0x260949){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x6f3c37[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x260949,null))['then'](removeEntity(_0x260949,null))['catch'](handleError(_0x260949,null));};exports[_0xfbd9('0x51')]=function(_0x3d1698,_0x2de072,_0x935dc4){var _0x2fb24a={'raw':!![],'where':{}};var _0x3b59c0={};var _0x243b1d={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x3d1698['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x2de072,null))[_0xfbd9('0x1f')](function(_0x7d7cc4){if(_0x7d7cc4){_0x3b59c0['model']=_['keys'](db[_0xfbd9('0x52')]['rawAttributes']);_0x3b59c0['query']=_[_0xfbd9('0x3e')](_0x3d1698[_0xfbd9('0x2d')]);_0x3b59c0['filters']=_[_0xfbd9('0x2f')](_0x3b59c0[_0xfbd9('0x2c')],_0x3b59c0[_0xfbd9('0x2d')]);_0x2fb24a[_0xfbd9('0x30')]=_['intersection'](_0x3b59c0[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x3d1698[_0xfbd9('0x2d')]['fields']));_0x2fb24a[_0xfbd9('0x30')]=_0x2fb24a['attributes'][_0xfbd9('0x40')]?_0x2fb24a[_0xfbd9('0x30')]:_0x3b59c0[_0xfbd9('0x2c')];if(!_0x3d1698[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x2fb24a[_0xfbd9('0x17')]=qs['limit'](_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x2fb24a[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3d1698[_0xfbd9('0x2d')]['offset']);}_0x2fb24a[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x3d1698[_0xfbd9('0x2d')]['sort']);_0x2fb24a['where']=qs['filters'](_['pick'](_0x3d1698[_0xfbd9('0x2d')],_0x3b59c0[_0xfbd9('0x2e')]));_0x2fb24a['where'][_0xfbd9('0x53')]=_0x7d7cc4['id'];if(_0x3d1698[_0xfbd9('0x2d')]['filter']){_0x2fb24a['where']=_[_0xfbd9('0x38')](_0x2fb24a[_0xfbd9('0x35')],{'$or':_['map'](_0x2fb24a[_0xfbd9('0x30')],function(_0x3c97b3){var _0x555d8e={};_0x555d8e[_0x3c97b3]={'$like':'%'+_0x3d1698[_0xfbd9('0x2d')]['filter']+'%'};return _0x555d8e;})});}_0x2fb24a=_['merge']({},_0x2fb24a,_0x3d1698[_0xfbd9('0x3a')]);return db[_0xfbd9('0x52')][_0xfbd9('0x16')]({'where':_0x2fb24a[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x411a37){_0x243b1d['count']=_0x411a37;if(_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x2fb24a[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x52')]['findAll'](_0x2fb24a);})['then'](function(_0x20292a){_0x243b1d[_0xfbd9('0x54')]=_0x20292a;return _0x243b1d;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x2de072,_0x2fb24a))[_0xfbd9('0x42')](handleError(_0x2de072,null));};exports[_0xfbd9('0x55')]=function(_0x527e7b,_0x31e50e,_0xb6f4ee){var _0x1ba4fc={'raw':!![],'where':{}};var _0x26311b={};var _0x4a5a05={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x527e7b['params']['id']}})['then'](handleEntityNotFound(_0x31e50e,null))[_0xfbd9('0x1f')](function(_0x2cd315){if(_0x2cd315){_0x26311b[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x56')][_0xfbd9('0x2a')]);_0x26311b[_0xfbd9('0x2d')]=_[_0xfbd9('0x3e')](_0x527e7b[_0xfbd9('0x2d')]);_0x26311b[_0xfbd9('0x2e')]=_['intersection'](_0x26311b['model'],_0x26311b['query']);_0x1ba4fc[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26311b[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x1ba4fc['attributes']=_0x1ba4fc[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x1ba4fc[_0xfbd9('0x30')]:_0x26311b[_0xfbd9('0x2c')];if(!_0x527e7b[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x1ba4fc[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x1ba4fc[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x527e7b['query'][_0xfbd9('0x14')]);}_0x1ba4fc['order']=qs[_0xfbd9('0x34')](_0x527e7b[_0xfbd9('0x2d')]['sort']);_0x1ba4fc['where']=qs[_0xfbd9('0x2e')](_['pick'](_0x527e7b[_0xfbd9('0x2d')],_0x26311b[_0xfbd9('0x2e')]));_0x1ba4fc[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x2cd315['id'];if(_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x1ba4fc['where']=_[_0xfbd9('0x38')](_0x1ba4fc[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x1ba4fc[_0xfbd9('0x30')],function(_0x596e34){var _0x8049d8={};_0x8049d8[_0x596e34]={'$like':'%'+_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x8049d8;})});}_0x1ba4fc=_[_0xfbd9('0x38')]({},_0x1ba4fc,_0x527e7b[_0xfbd9('0x3a')]);return db['CmHopperHistory'][_0xfbd9('0x16')]({'where':_0x1ba4fc['where']})[_0xfbd9('0x1f')](function(_0x4cf720){_0x4a5a05['count']=_0x4cf720;if(_0x527e7b[_0xfbd9('0x2d')]['includeAll']){_0x1ba4fc[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x56')][_0xfbd9('0x3c')](_0x1ba4fc);})['then'](function(_0x821f1e){_0x4a5a05['rows']=_0x821f1e;return _0x4a5a05;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x31e50e,_0x1ba4fc))[_0xfbd9('0x42')](handleError(_0x31e50e,null));};exports[_0xfbd9('0x57')]=function(_0x304d68,_0x27dd2e,_0x51f33a){var _0x4ddfc6={'raw':!![],'where':{}};var _0x26deb3={};var _0x2bb227={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x304d68[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x27dd2e,null))['then'](function(_0x5a0f34){if(_0x5a0f34){_0x26deb3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db['CmHopperFinal'][_0xfbd9('0x2a')]);_0x26deb3['query']=_[_0xfbd9('0x3e')](_0x304d68[_0xfbd9('0x2d')]);_0x26deb3[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x26deb3['model'],_0x26deb3[_0xfbd9('0x2d')]);_0x4ddfc6[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26deb3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x304d68['query'][_0xfbd9('0x3f')]));_0x4ddfc6[_0xfbd9('0x30')]=_0x4ddfc6[_0xfbd9('0x30')]['length']?_0x4ddfc6['attributes']:_0x26deb3[_0xfbd9('0x2c')];if(!_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x4ddfc6[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x304d68[_0xfbd9('0x2d')]['limit']);_0x4ddfc6[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x4ddfc6[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x4ddfc6[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x304d68[_0xfbd9('0x2d')],_0x26deb3['filters']));_0x4ddfc6['where'][_0xfbd9('0x53')]=_0x5a0f34['id'];if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x4ddfc6[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x4ddfc6['where'],{'$or':_[_0xfbd9('0x28')](_0x4ddfc6[_0xfbd9('0x30')],function(_0x66b429){var _0x4f5ac1={};_0x4f5ac1[_0x66b429]={'$like':'%'+_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x4f5ac1;})});}_0x4ddfc6=_[_0xfbd9('0x38')]({},_0x4ddfc6,_0x304d68[_0xfbd9('0x3a')]);return db[_0xfbd9('0x58')]['count']({'where':_0x4ddfc6['where']})['then'](function(_0x4648b2){_0x2bb227[_0xfbd9('0x16')]=_0x4648b2;if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x4ddfc6['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xfbd9('0x3c')](_0x4ddfc6);})[_0xfbd9('0x1f')](function(_0x27bc94){_0x2bb227['rows']=_0x27bc94;return _0x2bb227;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x27dd2e,_0x4ddfc6))['catch'](handleError(_0x27dd2e,null));};exports['getHopperBlacks']=function(_0x1de195,_0x4c70de,_0x1a3fc5){var _0x304594={'raw':!![],'where':{}};var _0x3582c1={};var _0x239267={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x1de195[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c70de,null))[_0xfbd9('0x1f')](function(_0x5aada3){if(_0x5aada3){_0x3582c1[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x5a')][_0xfbd9('0x2a')]);_0x3582c1['query']=_[_0xfbd9('0x3e')](_0x1de195['query']);_0x3582c1[_0xfbd9('0x2e')]=_['intersection'](_0x3582c1['model'],_0x3582c1['query']);_0x304594[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3582c1[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x1de195['query'][_0xfbd9('0x3f')]));_0x304594['attributes']=_0x304594[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x304594['attributes']:_0x3582c1[_0xfbd9('0x2c')];if(!_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x304594[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x304594[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x304594[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x1de195['query']['sort']);_0x304594[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x1de195[_0xfbd9('0x2d')],_0x3582c1[_0xfbd9('0x2e')]));_0x304594[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x5aada3['id'];if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x304594['where']=_[_0xfbd9('0x38')](_0x304594[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x304594[_0xfbd9('0x30')],function(_0x16ea14){var _0x358cd6={};_0x358cd6[_0x16ea14]={'$like':'%'+_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x358cd6;})});}_0x304594=_['merge']({},_0x304594,_0x1de195[_0xfbd9('0x3a')]);return db[_0xfbd9('0x5a')][_0xfbd9('0x16')]({'where':_0x304594[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x5db30a){_0x239267['count']=_0x5db30a;if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x304594[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x5a')][_0xfbd9('0x3c')](_0x304594);})[_0xfbd9('0x1f')](function(_0x246599){_0x239267[_0xfbd9('0x54')]=_0x246599;return _0x239267;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x4c70de,_0x304594))[_0xfbd9('0x42')](handleError(_0x4c70de,null));};exports['getLists']=function(_0x3b07aa,_0x50fa49,_0x19b565){var _0x5cf769={};var _0x1c6093={};var _0x5a3d9d;var _0x228b74;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x3b07aa[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x50fa49,null))['then'](function(_0x2090bc){if(_0x2090bc){_0x5a3d9d=_0x2090bc;_0x1c6093[_0xfbd9('0x2c')]=_['keys'](db['CmList'][_0xfbd9('0x2a')]);_0x1c6093[_0xfbd9('0x2d')]=_['keys'](_0x3b07aa[_0xfbd9('0x2d')]);_0x1c6093[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x1c6093[_0xfbd9('0x2c')],_0x1c6093['query']);_0x5cf769[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x1c6093['model'],qs[_0xfbd9('0x3f')](_0x3b07aa['query'][_0xfbd9('0x3f')]));_0x5cf769[_0xfbd9('0x30')]=_0x5cf769[_0xfbd9('0x30')]['length']?_0x5cf769['attributes']:_0x1c6093[_0xfbd9('0x2c')];_0x5cf769[_0xfbd9('0x33')]=qs['sort'](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x5cf769[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x3b07aa['query'],_0x1c6093[_0xfbd9('0x2e')]));if(_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x5cf769[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x5cf769[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x5cf769['attributes'],function(_0x1330ca){var _0x23467e={};_0x23467e[_0x1330ca]={'$like':'%'+_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23467e;})});}_0x5cf769=_[_0xfbd9('0x38')]({},_0x5cf769,_0x3b07aa[_0xfbd9('0x3a')]);return _0x5a3d9d[_0xfbd9('0x5b')](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0x3cee54){if(_0x3cee54){_0x228b74=_0x3cee54['length'];if(!_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x5cf769[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x5cf769[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3b07aa['query']['offset']);}return _0x5a3d9d['getLists'](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0xdb663){if(_0xdb663){return _0xdb663?{'count':_0x228b74,'rows':_0xdb663}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x50fa49,null))[_0xfbd9('0x42')](handleError(_0x50fa49,null));};exports[_0xfbd9('0x5c')]=function(_0xed8d73,_0x4226dd,_0x209d04){var _0x359bb8,_0x555179;var _0x16c43=[];var _0x4d2d4a=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0xed8d73[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x4226dd,null))[_0xfbd9('0x1f')](function(_0x6dd950){if(_0x6dd950){_0x555179=_0x6dd950;return _0x6dd950[_0xfbd9('0x5c')](_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x5f')],_[_0xfbd9('0x4f')](_0xed8d73[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})['spread'](function(_0x4186f2){var _0x45b4f6;var _0x57f0c9;_0x359bb8=_0x4186f2||[];var _0x538e9d=[];if(_0x4186f2){for(var _0x26b11a=0x0;_0x26b11a<_0x4186f2[_0xfbd9('0x40')];_0x26b11a+=0x1){var _0x3d3271=_0x4186f2[_0x26b11a][_0xfbd9('0x21')]({'plain':!![]});_0x555179[_0xfbd9('0x60')]=_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x60')]?_0xed8d73[_0xfbd9('0x44')]['dialCheckDuplicateType']:_0x555179['dialCheckDuplicateType'];switch(_0x555179[_0xfbd9('0x60')]){case _0xfbd9('0x61'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),'ContactId',_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),'CampaignId')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27','createdAt')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0xfbd9('0x70'),_0x3d3271['CmListId'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))['where'](_0xfbd9('0x72'),squel['select']()[_0xfbd9('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xfbd9('0x6f')](_0xfbd9('0x73'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]()))[_0xfbd9('0x35')](_0xfbd9('0x72'),squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))['where'](_0xfbd9('0x74'),_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())))[_0xfbd9('0x6e')]();break;case _0xfbd9('0x76'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()['field'](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))['field'](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))['field']('\x27'+_0x4d2d4a+'\x27','updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))[_0xfbd9('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]())))['toString']();break;default:_0x45b4f6=squel[_0xfbd9('0x62')]()['into'](_0xfbd9('0x64'))[_0xfbd9('0x65')]([_0xfbd9('0x6a'),_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')](_0xfbd9('0x6b'),'scheduledAt')['field']('id','ContactId')['field'](_0x3d3271[_0xfbd9('0x6d')]['toString'](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))['from'](_0xfbd9('0x78'))[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71')))['toString']();}_0x57f0c9=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x79'))[_0xfbd9('0x65')](['cmHopperId',_0xfbd9('0x66'),_0xfbd9('0x6a'),'OrderBy',_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x7a'),'id')[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))['field'](_0xfbd9('0x7b'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x7c'),_0xfbd9('0x7d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contact_has_items','ci')[_0xfbd9('0x7e')](_0xfbd9('0x64'),'h',_0xfbd9('0x7f'))[_0xfbd9('0x35')]('h.ListId\x20=\x20?',_0x3d3271['CmListId'][_0xfbd9('0x6e')]())['where']('h.CampaignId=?',_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')]('h.createdAt\x20=\x20?',_0x4d2d4a))['toString']();_0x538e9d['push'](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x45b4f6));_0x16c43[_0xfbd9('0x81')](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x57f0c9));}return BPromise[_0xfbd9('0x82')](_0x538e9d);}})[_0xfbd9('0x1f')](function(){return BPromise['all'](_0x16c43);})['then'](function(){return _0x359bb8;})[_0xfbd9('0x1f')](respondWithResult(_0x4226dd,null))[_0xfbd9('0x42')](handleError(_0x4226dd,null));};exports[_0xfbd9('0x83')]=function(_0x2711e5,_0x166238,_0x59e460){return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x166238,null))[_0xfbd9('0x1f')](function(_0x3e4416){if(_0x3e4416){return _0x3e4416[_0xfbd9('0x83')](_0x2711e5[_0xfbd9('0x2d')]['ids']);}})[_0xfbd9('0x1f')](function(_0xcb6afc){if(_0xcb6afc){return db['CmHopper'][_0xfbd9('0x20')]({'where':{'ListId':_0x2711e5[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](function(){return _0xcb6afc;});}})['then'](respondWithStatusCode(_0x166238,null))['catch'](handleError(_0x166238,null));};exports[_0xfbd9('0x84')]=function(_0xb24a8a,_0x53c930,_0x186429){var _0x411f9e={};var _0x16a131={};var _0x5c444e;var _0x1f97bb;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0xb24a8a[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x53c930,null))[_0xfbd9('0x1f')](function(_0xc4d6ec){if(_0xc4d6ec){_0x5c444e=_0xc4d6ec;_0x16a131['model']=_[_0xfbd9('0x3e')](db['CmList'][_0xfbd9('0x2a')]);_0x16a131['query']=_['keys'](_0xb24a8a[_0xfbd9('0x2d')]);_0x16a131[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x16a131[_0xfbd9('0x2c')],_0x16a131[_0xfbd9('0x2d')]);_0x411f9e['attributes']=_['intersection'](_0x16a131[_0xfbd9('0x2c')],qs['fields'](_0xb24a8a[_0xfbd9('0x2d')]['fields']));_0x411f9e[_0xfbd9('0x30')]=_0x411f9e[_0xfbd9('0x30')]['length']?_0x411f9e['attributes']:_0x16a131['model'];_0x411f9e[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x411f9e[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0xb24a8a['query'],_0x16a131[_0xfbd9('0x2e')]));if(_0xb24a8a['query'][_0xfbd9('0x37')]){_0x411f9e[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x411f9e[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x411f9e[_0xfbd9('0x30')],function(_0x6e7c5f){var _0x23f9a5={};_0x23f9a5[_0x6e7c5f]={'$like':'%'+_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23f9a5;})});}_0x411f9e=_[_0xfbd9('0x38')]({},_0x411f9e,_0xb24a8a['options']);return _0x5c444e['getBlackLists'](_0x411f9e);}})['then'](function(_0x5004a4){if(_0x5004a4){_0x1f97bb=_0x5004a4[_0xfbd9('0x40')];if(!_0xb24a8a['query']['hasOwnProperty'](_0xfbd9('0x32'))){_0x411f9e['limit']=qs[_0xfbd9('0x17')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x411f9e[_0xfbd9('0x14')]=qs['offset'](_0xb24a8a['query'][_0xfbd9('0x14')]);}return _0x5c444e[_0xfbd9('0x84')](_0x411f9e);}})[_0xfbd9('0x1f')](function(_0x1b595b){if(_0x1b595b){return _0x1b595b?{'count':_0x1f97bb,'rows':_0x1b595b}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x53c930,null))[_0xfbd9('0x42')](handleError(_0x53c930,null));};exports[_0xfbd9('0x85')]=function(_0x2e8e68,_0x578b32,_0x4e9cc0){var _0x53326c,_0xc9b979;var _0x390b08=[];var _0x38cfeb=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2e8e68[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x578b32,null))[_0xfbd9('0x1f')](function(_0x3b826d){if(_0x3b826d){_0xc9b979=_0x3b826d;return _0x3b826d[_0xfbd9('0x85')](_0x2e8e68[_0xfbd9('0x44')]['ids'],_[_0xfbd9('0x4f')](_0x2e8e68[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})[_0xfbd9('0x86')](function(_0x38445a){var _0x4555dd;var _0x3aae2a;_0x53326c=_0x38445a||[];var _0x5160f3=[];if(_0x38445a){for(var _0x5acda9=0x0;_0x5acda9<_0x38445a[_0xfbd9('0x40')];_0x5acda9+=0x1){var _0x461471=_0x38445a[_0x5acda9][_0xfbd9('0x21')]({'plain':!![]});_0x4555dd=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x87'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x461471['CmListId'][_0xfbd9('0x6e')](),'ListId')[_0xfbd9('0x69')](_0x2e8e68['params']['id']['toString'](),_0xfbd9('0x53'))['field'](_0xfbd9('0x6b'),_0xfbd9('0x4d'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),'updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')](_0xfbd9('0x70'),_0x461471[_0xfbd9('0x6d')]['toString']())[_0xfbd9('0x35')](_0xfbd9('0x71')))[_0xfbd9('0x6e')]();_0x5160f3[_0xfbd9('0x81')](db['sequelize'][_0xfbd9('0x2d')](_0x4555dd));}return BPromise[_0xfbd9('0x82')](_0x5160f3);}})['then'](function(){return _0x53326c;})[_0xfbd9('0x1f')](respondWithResult(_0x578b32,null))[_0xfbd9('0x42')](handleError(_0x578b32,null));};exports['removeBlackLists']=function(_0x40dd26,_0x192241,_0x2a419b){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x40dd26[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x192241,null))[_0xfbd9('0x1f')](function(_0x19ffd5){if(_0x19ffd5){return _0x19ffd5[_0xfbd9('0x88')](_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')]);}})[_0xfbd9('0x1f')](function(_0x5aa56e){if(_0x5aa56e){return db['CmHopperBlack'][_0xfbd9('0x20')]({'where':{'ListId':_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x40dd26[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](function(){return _0x5aa56e;});}})[_0xfbd9('0x1f')](respondWithStatusCode(_0x192241,null))[_0xfbd9('0x42')](handleError(_0x192241,null));};
\ No newline at end of file
+var _0x09ef=['updatedAt','createdAt','userProfileId','getHoppers','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','from','into','cm_contacts','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','create','body','user','IvrCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x09ef,0x15e));var _0xf09e=function(_0x34da07,_0x458514){_0x34da07=_0x34da07-0x0;var _0xb2467e=_0x09ef[_0x34da07];return _0xb2467e;};'use strict';var emlformat=require(_0xf09e('0x0'));var rimraf=require(_0xf09e('0x1'));var zipdir=require(_0xf09e('0x2'));var jsonpatch=require(_0xf09e('0x3'));var rp=require(_0xf09e('0x4'));var moment=require(_0xf09e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf09e('0x6'));var util=require('util');var path=require(_0xf09e('0x7'));var sox=require(_0xf09e('0x8'));var csv=require(_0xf09e('0x9'));var ejs=require(_0xf09e('0xa'));var fs=require('fs');var fs_extra=require(_0xf09e('0xb'));var _=require(_0xf09e('0xc'));var squel=require(_0xf09e('0xd'));var crypto=require(_0xf09e('0xe'));var jsforce=require(_0xf09e('0xf'));var deskjs=require(_0xf09e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf09e('0x11'));var Papa=require(_0xf09e('0x12'));var Redis=require(_0xf09e('0x13'));var authService=require(_0xf09e('0x14'));var qs=require(_0xf09e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf09e('0x16'))(_0xf09e('0x17'));var utils=require('../../config/utils');var config=require(_0xf09e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf09e('0x19'))['db'];function respondWithStatusCode(_0xcea7b1,_0x2d974f){_0x2d974f=_0x2d974f||0xcc;return function(_0x12ecc3){if(_0x12ecc3){return _0xcea7b1[_0xf09e('0x1a')](_0x2d974f);}return _0xcea7b1[_0xf09e('0x1b')](_0x2d974f)['end']();};}function respondWithResult(_0x43e7e9,_0x505b6d){_0x505b6d=_0x505b6d||0xc8;return function(_0x38f7de){if(_0x38f7de){return _0x43e7e9[_0xf09e('0x1b')](_0x505b6d)[_0xf09e('0x1c')](_0x38f7de);}};}function respondWithFilteredResult(_0x4a3c58,_0x17b604){return function(_0x3a6bd0){if(_0x3a6bd0){var _0x4f88f1=typeof _0x17b604[_0xf09e('0x1d')]===_0xf09e('0x1e')&&typeof _0x17b604[_0xf09e('0x1f')]===_0xf09e('0x1e');var _0x3abeae=_0x3a6bd0['count'];var _0x21d713=_0x4f88f1?0x0:_0x17b604[_0xf09e('0x1d')];var _0x435bb8=_0x4f88f1?_0x3a6bd0[_0xf09e('0x20')]:_0x17b604[_0xf09e('0x1d')]+_0x17b604[_0xf09e('0x1f')];var _0x105934;if(_0x435bb8>=_0x3abeae){_0x435bb8=_0x3abeae;_0x105934=0xc8;}else{_0x105934=0xce;}_0x4a3c58[_0xf09e('0x1b')](_0x105934);return _0x4a3c58[_0xf09e('0x21')](_0xf09e('0x22'),_0x21d713+'-'+_0x435bb8+'/'+_0x3abeae)[_0xf09e('0x1c')](_0x3a6bd0);}return null;};}function patchUpdates(_0x4c5a1f){return function(_0x19c044){try{jsonpatch[_0xf09e('0x23')](_0x19c044,_0x4c5a1f,!![]);}catch(_0x3a24ba){return BPromise[_0xf09e('0x24')](_0x3a24ba);}return _0x19c044['save']();};}function saveUpdates(_0x454133,_0x5e95cb){return function(_0x4533c5){if(_0x4533c5){return _0x4533c5[_0xf09e('0x25')](_0x454133)[_0xf09e('0x26')](function(_0x1dea86){return _0x1dea86;});}return null;};}function removeEntity(_0x18bd4f,_0xb9f4c3){return function(_0x5bb343){if(_0x5bb343){return _0x5bb343[_0xf09e('0x27')]()[_0xf09e('0x26')](function(){var _0x300bc5=_0x5bb343[_0xf09e('0x28')]({'plain':!![]});var _0x5d6d27='IvrCampaigns';return db[_0xf09e('0x29')][_0xf09e('0x27')]({'where':{'type':_0x5d6d27,'resourceId':_0x300bc5['id']}})['then'](function(){return _0x5bb343;});})[_0xf09e('0x26')](function(){_0x18bd4f[_0xf09e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7f76b0,_0x1a698f){return function(_0xf49fc4){if(!_0xf49fc4){_0x7f76b0['sendStatus'](0x194);}return _0xf49fc4;};}function handleError(_0x125717,_0xfa0588){_0xfa0588=_0xfa0588||0x1f4;return function(_0x2fc707){logger[_0xf09e('0x2a')](_0x2fc707[_0xf09e('0x2b')]);if(_0x2fc707['name']){delete _0x2fc707[_0xf09e('0x2c')];}_0x125717[_0xf09e('0x1b')](_0xfa0588)['send'](_0x2fc707);};}exports['index']=function(_0x5efdb9,_0x3e3da0){var _0x32214c={},_0x32e492={},_0x3eeff9={'count':0x0,'rows':[]};var _0x1c787e=_['map'](db[_0xf09e('0x2d')][_0xf09e('0x2e')],function(_0x41a2a0){return{'name':_0x41a2a0[_0xf09e('0x2f')],'type':_0x41a2a0[_0xf09e('0x30')][_0xf09e('0x31')]};});_0x32e492[_0xf09e('0x32')]=_[_0xf09e('0x33')](_0x1c787e,_0xf09e('0x2c'));_0x32e492[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x5efdb9[_0xf09e('0x34')]);_0x32e492['filters']=_[_0xf09e('0x36')](_0x32e492[_0xf09e('0x32')],_0x32e492[_0xf09e('0x34')]);_0x32214c[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x32e492[_0xf09e('0x32')],qs['fields'](_0x5efdb9[_0xf09e('0x34')]['fields']));_0x32214c['attributes']=_0x32214c[_0xf09e('0x37')]['length']?_0x32214c[_0xf09e('0x37')]:_0x32e492[_0xf09e('0x32')];if(!_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x32214c['limit']=qs[_0xf09e('0x1f')](_0x5efdb9['query']['limit']);_0x32214c['offset']=qs[_0xf09e('0x1d')](_0x5efdb9[_0xf09e('0x34')]['offset']);}_0x32214c[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x5efdb9[_0xf09e('0x34')]['sort']);_0x32214c['where']=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x5efdb9['query'],_0x32e492[_0xf09e('0x3c')]),_0x1c787e);if(_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x32214c[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x32214c[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x1c787e,function(_0x5dc2f8){if(_0x5dc2f8[_0xf09e('0x30')]!==_0xf09e('0x41')){var _0x540fc9={};_0x540fc9[_0x5dc2f8[_0xf09e('0x2c')]]={'$like':'%'+_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0x540fc9;}})});}_0x32214c=_[_0xf09e('0x40')]({},_0x32214c,_0x5efdb9[_0xf09e('0x42')]);var _0x1807fa={'where':_0x32214c[_0xf09e('0x3f')]};return db['Campaign'][_0xf09e('0x20')](_0x1807fa)['then'](function(_0x34cc5f){_0x3eeff9['count']=_0x34cc5f;if(_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x43')]){_0x32214c[_0xf09e('0x44')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x32214c);})[_0xf09e('0x26')](function(_0x3a5cf4){_0x3eeff9[_0xf09e('0x45')]=_0x3a5cf4;return _0x3eeff9;})[_0xf09e('0x26')](respondWithFilteredResult(_0x3e3da0,_0x32214c))[_0xf09e('0x46')](handleError(_0x3e3da0,null));};exports[_0xf09e('0x47')]=function(_0x369714,_0x5b5bee){var _0x454371={'raw':![],'where':{'id':_0x369714[_0xf09e('0x48')]['id']}},_0x2e3e9f={};_0x2e3e9f['model']=_[_0xf09e('0x35')](db[_0xf09e('0x2d')][_0xf09e('0x2e')]);_0x2e3e9f[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x369714[_0xf09e('0x34')]);_0x2e3e9f[_0xf09e('0x3c')]=_['intersection'](_0x2e3e9f['model'],_0x2e3e9f[_0xf09e('0x34')]);_0x454371[_0xf09e('0x37')]=_['intersection'](_0x2e3e9f['model'],qs[_0xf09e('0x49')](_0x369714['query'][_0xf09e('0x49')]));_0x454371[_0xf09e('0x37')]=_0x454371[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x454371[_0xf09e('0x37')]:_0x2e3e9f[_0xf09e('0x32')];if(_0x369714[_0xf09e('0x34')][_0xf09e('0x43')]){_0x454371[_0xf09e('0x44')]=[{'all':!![]}];}_0x454371=_[_0xf09e('0x40')]({},_0x454371,_0x369714[_0xf09e('0x42')]);return db['Campaign'][_0xf09e('0x4b')](_0x454371)['then'](handleEntityNotFound(_0x5b5bee,null))[_0xf09e('0x26')](respondWithResult(_0x5b5bee,null))[_0xf09e('0x46')](handleError(_0x5b5bee,null));};exports[_0xf09e('0x4c')]=function(_0x5a27a5,_0x3150e5){return db[_0xf09e('0x2d')][_0xf09e('0x4c')](_0x5a27a5[_0xf09e('0x4d')],{})['then'](function(_0x49563e){var _0x11ae3a=_0x5a27a5['user'][_0xf09e('0x28')]({'plain':!![]});if(!_0x11ae3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11ae3a['role']===_0xf09e('0x4e')){var _0x5c1e65=_0x49563e['get']({'plain':!![]});var _0xf652d6=_0xf09e('0x4f');return db[_0xf09e('0x50')][_0xf09e('0x4b')]({'where':{'name':_0xf652d6,'userProfileId':_0x11ae3a['userProfileId']},'raw':!![]})[_0xf09e('0x26')](function(_0x439a79){if(_0x439a79&&_0x439a79[_0xf09e('0x51')]===0x0){return db[_0xf09e('0x29')][_0xf09e('0x4c')]({'name':_0x5c1e65[_0xf09e('0x2c')],'resourceId':_0x5c1e65['id'],'type':_0x439a79[_0xf09e('0x2c')],'sectionId':_0x439a79['id']},{})[_0xf09e('0x26')](function(){return _0x49563e;});}else{return _0x49563e;}})[_0xf09e('0x46')](function(_0x1f5551){logger[_0xf09e('0x2a')](_0xf09e('0x52'),_0x1f5551);throw _0x1f5551;});}return _0x49563e;})['then'](respondWithResult(_0x3150e5,0xc9))[_0xf09e('0x46')](handleError(_0x3150e5,null));};exports[_0xf09e('0x53')]=function(_0x319b82,_0x3214cb){var _0x4e364d={'where':{'id':_0x319b82[_0xf09e('0x48')]['id']}},_0x3b51f7={};_0x3b51f7['model']=_[_0xf09e('0x35')](db['Campaign'][_0xf09e('0x2e')]);_0x4e364d['attributes']=_[_0xf09e('0x36')](_0x3b51f7[_0xf09e('0x32')],qs['fields'](_0x319b82[_0xf09e('0x34')][_0xf09e('0x49')]));_0x4e364d[_0xf09e('0x37')]=_0x4e364d[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x4e364d[_0xf09e('0x37')]:_0x3b51f7['model'];if(_0x319b82[_0xf09e('0x34')][_0xf09e('0x43')]){_0x4e364d[_0xf09e('0x44')]=[{'all':!![]}];}_0x4e364d=_[_0xf09e('0x40')]({},_0x4e364d,_0x319b82[_0xf09e('0x42')]);return db[_0xf09e('0x2d')][_0xf09e('0x4b')](_0x4e364d)['then'](handleEntityNotFound(_0x3214cb,null))[_0xf09e('0x26')](function(_0x111542){if(_0x111542){var _0x467b56=_0x111542[_0xf09e('0x28')]({'plain':!![]});_0x467b56=qs[_0xf09e('0x54')](_0x467b56,['id','createdAt',_0xf09e('0x55')]);_0x319b82['body']=_[_0xf09e('0x54')](_0x319b82[_0xf09e('0x4d')],['id',_0xf09e('0x56'),_0xf09e('0x55')]);return db[_0xf09e('0x2d')][_0xf09e('0x4c')](_[_0xf09e('0x40')](_0x467b56,_0x319b82[_0xf09e('0x4d')]),{'include':_0x319b82[_0xf09e('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xf09e('0x26')](function(_0x351c77){var _0x15e371=_0x319b82[_0xf09e('0x4e')][_0xf09e('0x28')]({'plain':!![]});if(!_0x15e371)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e371['role']===_0xf09e('0x4e')){var _0xef0ba6=_0x351c77['get']({'plain':!![]});var _0x28e51b='IvrCampaigns';return db[_0xf09e('0x50')][_0xf09e('0x4b')]({'where':{'name':_0x28e51b,'userProfileId':_0x15e371[_0xf09e('0x57')]},'raw':!![]})[_0xf09e('0x26')](function(_0xc0b477){if(_0xc0b477&&_0xc0b477[_0xf09e('0x51')]===0x0){return db[_0xf09e('0x29')][_0xf09e('0x4c')]({'name':_0xef0ba6[_0xf09e('0x2c')],'resourceId':_0xef0ba6['id'],'type':_0xc0b477[_0xf09e('0x2c')],'sectionId':_0xc0b477['id']},{})['then'](function(){return _0x351c77;});}else{return _0x351c77;}})['catch'](function(_0x329540){logger[_0xf09e('0x2a')](_0xf09e('0x52'),_0x329540);throw _0x329540;});}return _0x351c77;});}})['then'](respondWithResult(_0x3214cb,0xc9))[_0xf09e('0x46')](handleError(_0x3214cb,null));};exports[_0xf09e('0x25')]=function(_0x10f4b2,_0x4775d1){if(_0x10f4b2['body']['id']){delete _0x10f4b2[_0xf09e('0x4d')]['id'];}return db[_0xf09e('0x2d')][_0xf09e('0x4b')]({'where':{'id':_0x10f4b2['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x4775d1,null))[_0xf09e('0x26')](saveUpdates(_0x10f4b2[_0xf09e('0x4d')],null))[_0xf09e('0x26')](respondWithResult(_0x4775d1,null))['catch'](handleError(_0x4775d1,null));};exports['destroy']=function(_0x2545e2,_0x33ee1b){return db[_0xf09e('0x2d')][_0xf09e('0x4b')]({'where':{'id':_0x2545e2[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x33ee1b,null))[_0xf09e('0x26')](removeEntity(_0x33ee1b,null))[_0xf09e('0x46')](handleError(_0x33ee1b,null));};exports[_0xf09e('0x58')]=function(_0x8a9d36,_0x4e1b9a,_0x561081){var _0x2a1def={'raw':!![],'where':{}};var _0x2a7017={};var _0x3d9d9d={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x8a9d36[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4e1b9a,null))[_0xf09e('0x26')](function(_0x892b28){if(_0x892b28){_0x2a7017['model']=_[_0xf09e('0x35')](db[_0xf09e('0x5a')][_0xf09e('0x2e')]);_0x2a7017[_0xf09e('0x34')]=_['keys'](_0x8a9d36['query']);_0x2a7017[_0xf09e('0x3c')]=_[_0xf09e('0x36')](_0x2a7017['model'],_0x2a7017['query']);_0x2a1def['attributes']=_[_0xf09e('0x36')](_0x2a7017[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x49')]));_0x2a1def['attributes']=_0x2a1def[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x2a1def[_0xf09e('0x37')]:_0x2a7017[_0xf09e('0x32')];if(!_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x38')]('nolimit')){_0x2a1def['limit']=qs[_0xf09e('0x1f')](_0x8a9d36[_0xf09e('0x34')]['limit']);_0x2a1def[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x8a9d36['query'][_0xf09e('0x1d')]);}_0x2a1def[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x2a1def[_0xf09e('0x3f')]=qs[_0xf09e('0x3c')](_['pick'](_0x8a9d36[_0xf09e('0x34')],_0x2a7017['filters']));_0x2a1def['where']['CampaignId']=_0x892b28['id'];if(_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x2a1def[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x2a1def[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x2a1def[_0xf09e('0x37')],function(_0x16e6f0){var _0x293fa3={};_0x293fa3[_0x16e6f0]={'$like':'%'+_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0x293fa3;})});}_0x2a1def=_[_0xf09e('0x40')]({},_0x2a1def,_0x8a9d36[_0xf09e('0x42')]);return db[_0xf09e('0x5a')][_0xf09e('0x20')]({'where':_0x2a1def[_0xf09e('0x3f')]})[_0xf09e('0x26')](function(_0x3a4b07){_0x3d9d9d[_0xf09e('0x20')]=_0x3a4b07;if(_0x8a9d36['query'][_0xf09e('0x43')]){_0x2a1def[_0xf09e('0x44')]=[{'all':!![]}];}return db[_0xf09e('0x5a')][_0xf09e('0x5b')](_0x2a1def);})[_0xf09e('0x26')](function(_0x15d178){_0x3d9d9d[_0xf09e('0x45')]=_0x15d178;return _0x3d9d9d;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x4e1b9a,_0x2a1def))['catch'](handleError(_0x4e1b9a,null));};exports[_0xf09e('0x5c')]=function(_0x3ee14a,_0x1b83a3,_0x34caeb){var _0x3c8c6d={'raw':!![],'where':{}};var _0x513143={};var _0x3a068f={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x3ee14a[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b83a3,null))[_0xf09e('0x26')](function(_0x4ca72d){if(_0x4ca72d){_0x513143[_0xf09e('0x32')]=_[_0xf09e('0x35')](db[_0xf09e('0x5d')][_0xf09e('0x2e')]);_0x513143[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x3ee14a[_0xf09e('0x34')]);_0x513143['filters']=_[_0xf09e('0x36')](_0x513143[_0xf09e('0x32')],_0x513143['query']);_0x3c8c6d[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x513143['model'],qs[_0xf09e('0x49')](_0x3ee14a[_0xf09e('0x34')]['fields']));_0x3c8c6d[_0xf09e('0x37')]=_0x3c8c6d[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x3c8c6d['attributes']:_0x513143[_0xf09e('0x32')];if(!_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x3c8c6d['limit']=qs[_0xf09e('0x1f')](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x3c8c6d['offset']=qs['offset'](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x3c8c6d[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x3c8c6d[_0xf09e('0x3f')]=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x3ee14a[_0xf09e('0x34')],_0x513143[_0xf09e('0x3c')]));_0x3c8c6d[_0xf09e('0x3f')][_0xf09e('0x5e')]=_0x4ca72d['id'];if(_0x3ee14a[_0xf09e('0x34')]['filter']){_0x3c8c6d['where']=_[_0xf09e('0x40')](_0x3c8c6d[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x3c8c6d[_0xf09e('0x37')],function(_0x21fe79){var _0xe76c68={};_0xe76c68[_0x21fe79]={'$like':'%'+_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0xe76c68;})});}_0x3c8c6d=_[_0xf09e('0x40')]({},_0x3c8c6d,_0x3ee14a[_0xf09e('0x42')]);return db[_0xf09e('0x5d')][_0xf09e('0x20')]({'where':_0x3c8c6d[_0xf09e('0x3f')]})['then'](function(_0x8930b9){_0x3a068f['count']=_0x8930b9;if(_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x43')]){_0x3c8c6d[_0xf09e('0x44')]=[{'all':!![]}];}return db[_0xf09e('0x5d')][_0xf09e('0x5b')](_0x3c8c6d);})[_0xf09e('0x26')](function(_0x2bf284){_0x3a068f[_0xf09e('0x45')]=_0x2bf284;return _0x3a068f;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x1b83a3,_0x3c8c6d))[_0xf09e('0x46')](handleError(_0x1b83a3,null));};exports[_0xf09e('0x5f')]=function(_0x37ba6b,_0x4be762,_0x571d1f){var _0x2e376c={'raw':!![],'where':{}};var _0x1d9a96={};var _0x572e19={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x37ba6b[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x4be762,null))[_0xf09e('0x26')](function(_0x578200){if(_0x578200){_0x1d9a96['model']=_[_0xf09e('0x35')](db[_0xf09e('0x60')][_0xf09e('0x2e')]);_0x1d9a96[_0xf09e('0x34')]=_['keys'](_0x37ba6b[_0xf09e('0x34')]);_0x1d9a96[_0xf09e('0x3c')]=_['intersection'](_0x1d9a96[_0xf09e('0x32')],_0x1d9a96[_0xf09e('0x34')]);_0x2e376c[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x1d9a96[_0xf09e('0x32')],qs['fields'](_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x49')]));_0x2e376c[_0xf09e('0x37')]=_0x2e376c[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x2e376c[_0xf09e('0x37')]:_0x1d9a96['model'];if(!_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x2e376c[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x37ba6b['query'][_0xf09e('0x1f')]);_0x2e376c[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x2e376c[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x37ba6b['query'][_0xf09e('0x3b')]);_0x2e376c['where']=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x37ba6b[_0xf09e('0x34')],_0x1d9a96[_0xf09e('0x3c')]));_0x2e376c['where'][_0xf09e('0x5e')]=_0x578200['id'];if(_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x2e376c[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x2e376c[_0xf09e('0x3f')],{'$or':_['map'](_0x2e376c[_0xf09e('0x37')],function(_0x41504d){var _0x552ced={};_0x552ced[_0x41504d]={'$like':'%'+_0x37ba6b[_0xf09e('0x34')]['filter']+'%'};return _0x552ced;})});}_0x2e376c=_['merge']({},_0x2e376c,_0x37ba6b['options']);return db['CmHopperFinal']['count']({'where':_0x2e376c[_0xf09e('0x3f')]})[_0xf09e('0x26')](function(_0x485da5){_0x572e19[_0xf09e('0x20')]=_0x485da5;if(_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x43')]){_0x2e376c['include']=[{'all':!![]}];}return db[_0xf09e('0x60')][_0xf09e('0x5b')](_0x2e376c);})[_0xf09e('0x26')](function(_0x28d7a1){_0x572e19[_0xf09e('0x45')]=_0x28d7a1;return _0x572e19;});}})['then'](respondWithFilteredResult(_0x4be762,_0x2e376c))[_0xf09e('0x46')](handleError(_0x4be762,null));};exports[_0xf09e('0x61')]=function(_0x2a2969,_0x2cc9df,_0x3f5e99){var _0x380a63={'raw':!![],'where':{}};var _0x17ac0c={};var _0x382dd2={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x2a2969['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x2cc9df,null))[_0xf09e('0x26')](function(_0x342b4c){if(_0x342b4c){_0x17ac0c[_0xf09e('0x32')]=_[_0xf09e('0x35')](db[_0xf09e('0x62')][_0xf09e('0x2e')]);_0x17ac0c[_0xf09e('0x34')]=_['keys'](_0x2a2969[_0xf09e('0x34')]);_0x17ac0c['filters']=_[_0xf09e('0x36')](_0x17ac0c[_0xf09e('0x32')],_0x17ac0c[_0xf09e('0x34')]);_0x380a63[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x17ac0c[_0xf09e('0x32')],qs['fields'](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x49')]));_0x380a63['attributes']=_0x380a63[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x380a63['attributes']:_0x17ac0c['model'];if(!_0x2a2969[_0xf09e('0x34')][_0xf09e('0x38')]('nolimit')){_0x380a63['limit']=qs[_0xf09e('0x1f')](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x380a63['offset']=qs[_0xf09e('0x1d')](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x380a63['order']=qs[_0xf09e('0x3b')](_0x2a2969['query'][_0xf09e('0x3b')]);_0x380a63['where']=qs['filters'](_[_0xf09e('0x3d')](_0x2a2969[_0xf09e('0x34')],_0x17ac0c[_0xf09e('0x3c')]));_0x380a63[_0xf09e('0x3f')][_0xf09e('0x5e')]=_0x342b4c['id'];if(_0x2a2969[_0xf09e('0x34')]['filter']){_0x380a63[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x380a63[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x380a63[_0xf09e('0x37')],function(_0x57e2bb){var _0x443ee5={};_0x443ee5[_0x57e2bb]={'$like':'%'+_0x2a2969[_0xf09e('0x34')]['filter']+'%'};return _0x443ee5;})});}_0x380a63=_[_0xf09e('0x40')]({},_0x380a63,_0x2a2969[_0xf09e('0x42')]);return db[_0xf09e('0x62')][_0xf09e('0x20')]({'where':_0x380a63['where']})['then'](function(_0x282356){_0x382dd2[_0xf09e('0x20')]=_0x282356;if(_0x2a2969[_0xf09e('0x34')][_0xf09e('0x43')]){_0x380a63['include']=[{'all':!![]}];}return db[_0xf09e('0x62')][_0xf09e('0x5b')](_0x380a63);})[_0xf09e('0x26')](function(_0x51d6de){_0x382dd2[_0xf09e('0x45')]=_0x51d6de;return _0x382dd2;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x2cc9df,_0x380a63))[_0xf09e('0x46')](handleError(_0x2cc9df,null));};exports[_0xf09e('0x63')]=function(_0x27e234,_0x1d2910,_0x347b13){var _0x5082a8={};var _0x765d9a={};var _0x103e2b;var _0x196b74;return db[_0xf09e('0x2d')]['findOne']({'where':{'id':_0x27e234[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x1d2910,null))['then'](function(_0x3e80c2){if(_0x3e80c2){_0x103e2b=_0x3e80c2;_0x765d9a[_0xf09e('0x32')]=_[_0xf09e('0x35')](db['CmList'][_0xf09e('0x2e')]);_0x765d9a[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x27e234['query']);_0x765d9a[_0xf09e('0x3c')]=_[_0xf09e('0x36')](_0x765d9a[_0xf09e('0x32')],_0x765d9a['query']);_0x5082a8[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x765d9a[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x49')]));_0x5082a8[_0xf09e('0x37')]=_0x5082a8[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x5082a8[_0xf09e('0x37')]:_0x765d9a[_0xf09e('0x32')];_0x5082a8[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x5082a8[_0xf09e('0x3f')]=qs['filters'](_[_0xf09e('0x3d')](_0x27e234[_0xf09e('0x34')],_0x765d9a[_0xf09e('0x3c')]));if(_0x27e234[_0xf09e('0x34')]['filter']){_0x5082a8[_0xf09e('0x3f')]=_['merge'](_0x5082a8['where'],{'$or':_[_0xf09e('0x33')](_0x5082a8[_0xf09e('0x37')],function(_0x1dcf11){var _0x10d807={};_0x10d807[_0x1dcf11]={'$like':'%'+_0x27e234[_0xf09e('0x34')]['filter']+'%'};return _0x10d807;})});}_0x5082a8=_['merge']({},_0x5082a8,_0x27e234[_0xf09e('0x42')]);return _0x103e2b[_0xf09e('0x63')](_0x5082a8);}})['then'](function(_0x40424c){if(_0x40424c){_0x196b74=_0x40424c[_0xf09e('0x4a')];if(!_0x27e234[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x5082a8[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x5082a8[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x1d')]);}return _0x103e2b[_0xf09e('0x63')](_0x5082a8);}})[_0xf09e('0x26')](function(_0x419fba){if(_0x419fba){return _0x419fba?{'count':_0x196b74,'rows':_0x419fba}:null;}})['then'](respondWithResult(_0x1d2910,null))[_0xf09e('0x46')](handleError(_0x1d2910,null));};exports[_0xf09e('0x64')]=function(_0x39983d,_0x2d44ae,_0x280671){var _0x3f21a7,_0x573479;var _0x29c245=[];var _0x4c2027=moment()[_0xf09e('0x65')](_0xf09e('0x66'));return db[_0xf09e('0x2d')]['find']({'where':{'id':_0x39983d[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x2d44ae,null))['then'](function(_0xb61785){if(_0xb61785){_0x573479=_0xb61785;return _0xb61785['addLists'](_0x39983d[_0xf09e('0x4d')][_0xf09e('0x67')],_['omit'](_0x39983d[_0xf09e('0x4d')],[_0xf09e('0x67'),'id'])||{});}return null;})[_0xf09e('0x68')](function(_0x1baf0b){var _0x46b872;var _0x39ebda;_0x3f21a7=_0x1baf0b||[];var _0x38943c=[];if(_0x1baf0b){for(var _0x51e3fa=0x0;_0x51e3fa<_0x1baf0b[_0xf09e('0x4a')];_0x51e3fa+=0x1){var _0x363379=_0x1baf0b[_0x51e3fa][_0xf09e('0x28')]({'plain':!![]});_0x573479[_0xf09e('0x69')]=_0x39983d[_0xf09e('0x4d')][_0xf09e('0x69')]?_0x39983d[_0xf09e('0x4d')][_0xf09e('0x69')]:_0x573479[_0xf09e('0x69')];switch(_0x573479[_0xf09e('0x69')]){case _0xf09e('0x6a'):_0x46b872=squel[_0xf09e('0x6b')]()['into'](_0xf09e('0x6c'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),_0xf09e('0x70'),_0xf09e('0x71'),'CampaignId',_0xf09e('0x56'),'updatedAt'],squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x6e'),_0xf09e('0x6e'))['field'](_0xf09e('0x74'),'scheduledAt')['field']('id','ContactId')[_0xf09e('0x73')](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))[_0xf09e('0x73')](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))['field']('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))['from']('cm_contacts')['where'](_0xf09e('0x77'))[_0xf09e('0x3f')](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79'))[_0xf09e('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xf09e('0x7a'))['from'](_0xf09e('0x7b'))[_0xf09e('0x3f')](_0xf09e('0x7c'),_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')]()))['where'](_0xf09e('0x7d'),squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x7e'))[_0xf09e('0x7f')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x39983d['params']['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x46b872=squel['insert']()[_0xf09e('0x80')](_0xf09e('0x6c'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),'ContactId','ListId',_0xf09e('0x5e'),'createdAt',_0xf09e('0x55')],squel[_0xf09e('0x72')]()['field'](_0xf09e('0x6e'),_0xf09e('0x6e'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')]('id','ContactId')[_0xf09e('0x73')](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))[_0xf09e('0x73')](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27','updatedAt')['from'](_0xf09e('0x81'))[_0xf09e('0x3f')](_0xf09e('0x77'))['where'](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79'))[_0xf09e('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('COALESCE(phone,\x27\x27)')[_0xf09e('0x7f')]('cm_hopper')[_0xf09e('0x3f')](_0xf09e('0x7c'),_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')]())))[_0xf09e('0x76')]();break;default:_0x46b872=squel['insert']()[_0xf09e('0x80')]('cm_hopper')[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),'ContactId',_0xf09e('0x71'),_0xf09e('0x5e'),_0xf09e('0x56'),_0xf09e('0x55')],squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('phone',_0xf09e('0x6e'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')]('id',_0xf09e('0x70'))['field'](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))['field'](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))['field']('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))[_0xf09e('0x7f')](_0xf09e('0x81'))[_0xf09e('0x3f')](_0xf09e('0x77'))[_0xf09e('0x3f')](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())['where'](_0xf09e('0x79')))[_0xf09e('0x76')]();}_0x39ebda=squel['insert']()[_0xf09e('0x80')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId',_0xf09e('0x6f'),_0xf09e('0x6e'),_0xf09e('0x82'),'createdAt','updatedAt'],squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('h.id','id')[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')](_0xf09e('0x83'),_0xf09e('0x6e'))[_0xf09e('0x73')]('ci.OrderBY',_0xf09e('0x82'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))[_0xf09e('0x7f')](_0xf09e('0x84'),'ci')['join']('cm_hopper','h',_0xf09e('0x85'))['where'](_0xf09e('0x86'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x87'),_0x39983d['params']['id']['toString']())[_0xf09e('0x3f')](_0xf09e('0x88'),_0x4c2027))['toString']();_0x38943c[_0xf09e('0x89')](db[_0xf09e('0x8a')][_0xf09e('0x34')](_0x46b872));_0x29c245[_0xf09e('0x89')](db[_0xf09e('0x8a')]['query'](_0x39ebda));}return BPromise[_0xf09e('0x8b')](_0x38943c);}})[_0xf09e('0x26')](function(){return BPromise[_0xf09e('0x8b')](_0x29c245);})['then'](function(){return _0x3f21a7;})['then'](respondWithResult(_0x2d44ae,null))['catch'](handleError(_0x2d44ae,null));};exports['removeLists']=function(_0x1582c0,_0x486fc7,_0xed5bf7){return db['Campaign'][_0xf09e('0x4b')]({'where':{'id':_0x1582c0[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x486fc7,null))[_0xf09e('0x26')](function(_0x430261){if(_0x430261){return _0x430261[_0xf09e('0x8c')](_0x1582c0['query']['ids']);}})[_0xf09e('0x26')](function(_0x1cd2da){if(_0x1cd2da){return db['CmHopper']['destroy']({'where':{'ListId':_0x1582c0['query'][_0xf09e('0x67')],'CampaignId':_0x1582c0[_0xf09e('0x48')]['id']}})['then'](function(){return _0x1cd2da;});}})[_0xf09e('0x26')](respondWithStatusCode(_0x486fc7,null))[_0xf09e('0x46')](handleError(_0x486fc7,null));};exports[_0xf09e('0x8d')]=function(_0x2b88e3,_0xcaa94e,_0x3f056f){var _0x5b7ca4={};var _0x480950={};var _0x3ef5c8;var _0x16e979;return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x2b88e3[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0xcaa94e,null))[_0xf09e('0x26')](function(_0x1e8449){if(_0x1e8449){_0x3ef5c8=_0x1e8449;_0x480950[_0xf09e('0x32')]=_[_0xf09e('0x35')](db['CmList'][_0xf09e('0x2e')]);_0x480950[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x2b88e3['query']);_0x480950['filters']=_[_0xf09e('0x36')](_0x480950['model'],_0x480950[_0xf09e('0x34')]);_0x5b7ca4[_0xf09e('0x37')]=_['intersection'](_0x480950[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x49')]));_0x5b7ca4[_0xf09e('0x37')]=_0x5b7ca4[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x5b7ca4[_0xf09e('0x37')]:_0x480950[_0xf09e('0x32')];_0x5b7ca4[_0xf09e('0x3a')]=qs['sort'](_0x2b88e3['query']['sort']);_0x5b7ca4[_0xf09e('0x3f')]=qs['filters'](_[_0xf09e('0x3d')](_0x2b88e3[_0xf09e('0x34')],_0x480950[_0xf09e('0x3c')]));if(_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x5b7ca4['where']=_[_0xf09e('0x40')](_0x5b7ca4['where'],{'$or':_[_0xf09e('0x33')](_0x5b7ca4[_0xf09e('0x37')],function(_0xa7a8b7){var _0x3f4f13={};_0x3f4f13[_0xa7a8b7]={'$like':'%'+_0x2b88e3[_0xf09e('0x34')]['filter']+'%'};return _0x3f4f13;})});}_0x5b7ca4=_[_0xf09e('0x40')]({},_0x5b7ca4,_0x2b88e3['options']);return _0x3ef5c8[_0xf09e('0x8d')](_0x5b7ca4);}})[_0xf09e('0x26')](function(_0x26b689){if(_0x26b689){_0x16e979=_0x26b689[_0xf09e('0x4a')];if(!_0x2b88e3[_0xf09e('0x34')]['hasOwnProperty'](_0xf09e('0x39'))){_0x5b7ca4[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x5b7ca4[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x1d')]);}return _0x3ef5c8[_0xf09e('0x8d')](_0x5b7ca4);}})['then'](function(_0x533f0c){if(_0x533f0c){return _0x533f0c?{'count':_0x16e979,'rows':_0x533f0c}:null;}})[_0xf09e('0x26')](respondWithResult(_0xcaa94e,null))[_0xf09e('0x46')](handleError(_0xcaa94e,null));};exports[_0xf09e('0x8e')]=function(_0x34b791,_0x161081,_0x1d0c69){var _0x4b4241,_0x1e8e9b;var _0xdf651c=[];var _0x5083f0=moment()['format'](_0xf09e('0x66'));return db['Campaign'][_0xf09e('0x4b')]({'where':{'id':_0x34b791['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x161081,null))[_0xf09e('0x26')](function(_0x21325d){if(_0x21325d){_0x1e8e9b=_0x21325d;return _0x21325d['addBlackLists'](_0x34b791[_0xf09e('0x4d')][_0xf09e('0x67')],_[_0xf09e('0x54')](_0x34b791[_0xf09e('0x4d')],['ids','id'])||{});}return null;})[_0xf09e('0x68')](function(_0x3b8f0b){var _0x47ea9d;var _0x55b86d;_0x4b4241=_0x3b8f0b||[];var _0x1fc3cb=[];if(_0x3b8f0b){for(var _0x3d2d69=0x0;_0x3d2d69<_0x3b8f0b['length'];_0x3d2d69+=0x1){var _0x15a838=_0x3b8f0b[_0x3d2d69][_0xf09e('0x28')]({'plain':!![]});_0x47ea9d=squel[_0xf09e('0x6b')]()['into'](_0xf09e('0x8f'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x70'),'ListId',_0xf09e('0x5e'),_0xf09e('0x56'),_0xf09e('0x55')],squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x6e'),'phone')[_0xf09e('0x73')]('id',_0xf09e('0x70'))[_0xf09e('0x73')](_0x15a838['CmListId'][_0xf09e('0x76')](),_0xf09e('0x71'))['field'](_0x34b791[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))['field'](_0xf09e('0x74'),_0xf09e('0x56'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x55'))['from'](_0xf09e('0x81'))['where'](_0xf09e('0x77'))['where'](_0xf09e('0x78'),_0x15a838['CmListId'][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79')))['toString']();_0x1fc3cb['push'](db['sequelize'][_0xf09e('0x34')](_0x47ea9d));}return BPromise[_0xf09e('0x8b')](_0x1fc3cb);}})[_0xf09e('0x26')](function(){return _0x4b4241;})[_0xf09e('0x26')](respondWithResult(_0x161081,null))[_0xf09e('0x46')](handleError(_0x161081,null));};exports[_0xf09e('0x90')]=function(_0x34861a,_0x3e0ca9,_0x536ab5){return db['Campaign']['find']({'where':{'id':_0x34861a[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x3e0ca9,null))[_0xf09e('0x26')](function(_0x53000d){if(_0x53000d){return _0x53000d[_0xf09e('0x90')](_0x34861a['query']['ids']);}})[_0xf09e('0x26')](function(_0x1788ac){if(_0x1788ac){return db['CmHopperBlack'][_0xf09e('0x27')]({'where':{'ListId':_0x34861a[_0xf09e('0x34')][_0xf09e('0x67')],'CampaignId':_0x34861a[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](function(){return _0x1788ac;});}})[_0xf09e('0x26')](respondWithStatusCode(_0x3e0ca9,null))[_0xf09e('0x46')](handleError(_0x3e0ca9,null));};
\ No newline at end of file
index 15dbd73..478b3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1850e2,_0x7dab61){var _0x1f5de4=function(_0x2cfb85){while(--_0x2cfb85){_0x1850e2['push'](_0x1850e2['shift']());}};_0x1f5de4(++_0x7dab61);}(_0x7a54,0x106));var _0x47a5=function(_0x13bb5c,_0x456dd0){_0x13bb5c=_0x13bb5c-0x0;var _0x4beac6=_0x7a54[_0x13bb5c];return _0x4beac6;};'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
index e2979a4..b0c6694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c4a=['include','model','map','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit'];(function(_0x1fb4a0,_0x48a602){var _0x1094e7=function(_0x25fcd5){while(--_0x25fcd5){_0x1fb4a0['push'](_0x1fb4a0['shift']());}};_0x1094e7(++_0x48a602);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x5489c5,_0x554605){_0x5489c5=_0x5489c5-0x0;var _0x2f460d=_0x5c4a[_0x5489c5];return _0x2f460d;};'use strict';var _=require('lodash');var util=require(_0xa5c4('0x0'));var moment=require(_0xa5c4('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5c4('0x2'));var fs=require('fs');var Redis=require(_0xa5c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5c4('0x4'));var logger=require(_0xa5c4('0x5'))(_0xa5c4('0x6'));var config=require(_0xa5c4('0x7'));var jayson=require(_0xa5c4('0x8'));var client=jayson['client'][_0xa5c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4210e8,_0x163c03,_0x435ccb){return new BPromise(function(_0x1d7316,_0x123e2b){return client['request'](_0x4210e8,_0x435ccb)[_0xa5c4('0xa')](function(_0x3a4d97){logger[_0xa5c4('0xb')]('Campaign,\x20%s,\x20%s',_0x163c03,'request\x20sent');logger[_0xa5c4('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x163c03,_0xa5c4('0xd'),JSON[_0xa5c4('0xe')](_0x3a4d97));if(_0x3a4d97['error']){if(_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x10')]===0x1f4){logger[_0xa5c4('0xf')](_0xa5c4('0x11'),_0x163c03,_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x12')]);return _0x123e2b(_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x12')]);}logger['error'](_0xa5c4('0x11'),_0x163c03,_0x3a4d97['error']['message']);return _0x1d7316(_0x3a4d97[_0xa5c4('0xf')]['message']);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x163c03,_0xa5c4('0xd'));_0x1d7316(_0x3a4d97[_0xa5c4('0x13')][_0xa5c4('0x12')]);}})[_0xa5c4('0x14')](function(_0x19bc66){logger[_0xa5c4('0xf')]('Campaign,\x20%s,\x20%s',_0x163c03,_0x19bc66);_0x123e2b(_0x19bc66);});});}exports[_0xa5c4('0x15')]=function(_0x4ebdeb){var _0x5dc8ab=this;return new Promise(function(_0x39da3c,_0xab0eb7){return db[_0xa5c4('0x16')]['findAll']({'raw':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x18')]===undefined?!![]:![]:!![],'where':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb['options'][_0xa5c4('0x19')]||null:null,'attributes':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x1a')]||null:null,'limit':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb['options'][_0xa5c4('0x1b')]||null:null,'include':_0x4ebdeb['options']?_0x4ebdeb[_0xa5c4('0x17')]['include']?_['map'](_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x1c')],function(_0x325976){return{'model':db[_0x325976[_0xa5c4('0x1d')]],'as':_0x325976['as'],'attributes':_0x325976[_0xa5c4('0x1a')],'include':_0x325976['include']?_[_0xa5c4('0x1e')](_0x325976[_0xa5c4('0x1c')],function(_0x5a2a2f){return{'model':db[_0x5a2a2f[_0xa5c4('0x1d')]],'as':_0x5a2a2f['as'],'attributes':_0x5a2a2f[_0xa5c4('0x1a')],'include':_0x5a2a2f['include']?_['map'](_0x5a2a2f[_0xa5c4('0x1c')],function(_0x47acf6){return{'model':db[_0x47acf6[_0xa5c4('0x1d')]],'as':_0x47acf6['as'],'attributes':_0x47acf6['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5c4('0xa')](function(_0x106168){logger['info'](_0xa5c4('0x15'),_0x4ebdeb);logger[_0xa5c4('0xc')](_0xa5c4('0x15'),_0x4ebdeb,JSON['stringify'](_0x106168));_0x39da3c(_0x106168);})[_0xa5c4('0x14')](function(_0x51164f){logger[_0xa5c4('0xf')](_0xa5c4('0x15'),_0x51164f[_0xa5c4('0x12')],_0x4ebdeb);_0xab0eb7(_0x5dc8ab[_0xa5c4('0xf')](0x1f4,_0x51164f[_0xa5c4('0x12')]));});});};
\ No newline at end of file
+var _0xadec=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','GetCampaign'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xadec,0x156));var _0xcade=function(_0x54681d,_0x5f28a7){_0x54681d=_0x54681d-0x0;var _0x52357e=_0xadec[_0x54681d];return _0x52357e;};'use strict';var _=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var moment=require(_0xcade('0x2'));var BPromise=require(_0xcade('0x3'));var rs=require(_0xcade('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcade('0x5'))(_0xcade('0x6'));var config=require(_0xcade('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51d665,_0x1fe48f,_0x4c36e8){return new BPromise(function(_0x625da7,_0x5bebbe){return client['request'](_0x51d665,_0x4c36e8)[_0xcade('0x8')](function(_0x182658){logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));logger[_0xcade('0xb')](_0xcade('0xc'),_0x1fe48f,_0xcade('0xa'),JSON[_0xcade('0xd')](_0x182658));if(_0x182658[_0xcade('0xe')]){if(_0x182658[_0xcade('0xe')][_0xcade('0xf')]===0x1f4){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x5bebbe(_0x182658[_0xcade('0xe')][_0xcade('0x11')]);}logger['error'](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x625da7(_0x182658['error'][_0xcade('0x11')]);}else{logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));_0x625da7(_0x182658[_0xcade('0x12')][_0xcade('0x11')]);}})['catch'](function(_0x1678cd){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x1678cd);_0x5bebbe(_0x1678cd);});});}exports['GetCampaign']=function(_0x126272){var _0x124e64=this;return new Promise(function(_0x1c7be1,_0x1c54a0){return db[_0xcade('0x13')][_0xcade('0x14')]({'raw':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x16')]===undefined?!![]:![]:!![],'where':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x17')]||null:null,'attributes':_0x126272[_0xcade('0x15')]?_0x126272['options']['attributes']||null:null,'limit':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x18')]||null:null,'include':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x19')]?_[_0xcade('0x1a')](_0x126272[_0xcade('0x15')][_0xcade('0x19')],function(_0x264df7){return{'model':db[_0x264df7[_0xcade('0x1b')]],'as':_0x264df7['as'],'attributes':_0x264df7[_0xcade('0x1c')],'include':_0x264df7[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x264df7['include'],function(_0x4139b3){return{'model':db[_0x4139b3[_0xcade('0x1b')]],'as':_0x4139b3['as'],'attributes':_0x4139b3['attributes'],'include':_0x4139b3[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x4139b3[_0xcade('0x19')],function(_0x264f53){return{'model':db[_0x264f53[_0xcade('0x1b')]],'as':_0x264f53['as'],'attributes':_0x264f53[_0xcade('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcade('0x8')](function(_0x4bbe2a){logger[_0xcade('0x9')](_0xcade('0x1d'),_0x126272);logger[_0xcade('0xb')](_0xcade('0x1d'),_0x126272,JSON[_0xcade('0xd')](_0x4bbe2a));_0x1c7be1(_0x4bbe2a);})[_0xcade('0x1e')](function(_0x31fe0d){logger[_0xcade('0xe')]('GetCampaign',_0x31fe0d[_0xcade('0x11')],_0x126272);_0x1c54a0(_0x124e64[_0xcade('0xe')](0x1f4,_0x31fe0d[_0xcade('0x11')]));});});};
\ No newline at end of file
index fbfeea9..d27a32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d1a=['get','index','/:id','show','/:id/hoppers','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','addLists','addBlackLists','put','update','destroy','delete','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1d1a,0x1da));var _0xa1d1=function(_0x49c147,_0x50816b){_0x49c147=_0x49c147-0x0;var _0x576ba3=_0x1d1a[_0x49c147];return _0x576ba3;};'use strict';var multer=require(_0xa1d1('0x0'));var util=require(_0xa1d1('0x1'));var path=require(_0xa1d1('0x2'));var timeout=require(_0xa1d1('0x3'));var express=require('express');var router=express[_0xa1d1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa1d1('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xa1d1('0x6')]('/',auth['isAuthenticated'](),controller[_0xa1d1('0x7')]);router[_0xa1d1('0x6')](_0xa1d1('0x8'),auth['isAuthenticated'](),controller[_0xa1d1('0x9')]);router['get'](_0xa1d1('0xa'),auth[_0xa1d1('0xb')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0xc')]);router[_0xa1d1('0x6')](_0xa1d1('0xd'),auth['isAuthenticated'](),controller[_0xa1d1('0xe')]);router[_0xa1d1('0x6')](_0xa1d1('0xf'),auth['isAuthenticated'](),controller[_0xa1d1('0x10')]);router[_0xa1d1('0x6')](_0xa1d1('0x11'),auth['isAuthenticated'](),controller['getLists']);router[_0xa1d1('0x6')]('/:id/blacklists',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x12')]);router[_0xa1d1('0x13')]('/',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x14')]);router[_0xa1d1('0x13')]('/:id/clone',auth[_0xa1d1('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x15')]);router[_0xa1d1('0x13')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xa1d1('0x16')]);router[_0xa1d1('0x17')](_0xa1d1('0x8'),auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x18')]);router['delete'](_0xa1d1('0x8'),auth['isAuthenticated'](),controller[_0xa1d1('0x19')]);router['delete'](_0xa1d1('0x11'),auth[_0xa1d1('0xb')](),controller['removeLists']);router[_0xa1d1('0x1a')](_0xa1d1('0x1b'),auth['isAuthenticated'](),controller[_0xa1d1('0x1c')]);module[_0xa1d1('0x1d')]=router;
\ No newline at end of file
+var _0x93af=['removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists'];(function(_0x1ae56b,_0x5aecab){var _0x2c0594=function(_0x1d50a5){while(--_0x1d50a5){_0x1ae56b['push'](_0x1ae56b['shift']());}};_0x2c0594(++_0x5aecab);}(_0x93af,0x1af));var _0xf93a=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x93af[_0x2ce6d5];return _0x32d272;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf93a('0x0'));var express=require(_0xf93a('0x1'));var router=express[_0xf93a('0x2')]();var fs_extra=require(_0xf93a('0x3'));var auth=require(_0xf93a('0x4'));var interaction=require(_0xf93a('0x5'));var config=require('../../config/environment');var controller=require(_0xf93a('0x6'));router[_0xf93a('0x7')]('/',auth[_0xf93a('0x8')](),controller[_0xf93a('0x9')]);router[_0xf93a('0x7')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller[_0xf93a('0xb')]);router['get'](_0xf93a('0xc'),auth[_0xf93a('0x8')](),controller['getHoppers']);router[_0xf93a('0x7')](_0xf93a('0xd'),auth['isAuthenticated'](),controller[_0xf93a('0xe')]);router[_0xf93a('0x7')](_0xf93a('0xf'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x10')]);router['get'](_0xf93a('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xf93a('0x7')](_0xf93a('0x12'),auth[_0xf93a('0x8')](),controller['getLists']);router[_0xf93a('0x7')](_0xf93a('0x13'),auth['isAuthenticated'](),controller[_0xf93a('0x14')]);router[_0xf93a('0x15')]('/',auth[_0xf93a('0x8')](),controller[_0xf93a('0x16')]);router[_0xf93a('0x15')](_0xf93a('0x17'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x18')]);router[_0xf93a('0x15')]('/:id/lists',auth[_0xf93a('0x8')](),controller[_0xf93a('0x19')]);router[_0xf93a('0x15')](_0xf93a('0x13'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1a')]);router[_0xf93a('0x1b')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1c')]);router[_0xf93a('0x1d')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller['destroy']);router[_0xf93a('0x1d')](_0xf93a('0x12'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1e')]);router[_0xf93a('0x1d')](_0xf93a('0x13'),auth['isAuthenticated'](),controller[_0xf93a('0x1f')]);module[_0xf93a('0x20')]=router;
\ No newline at end of file
index 0c63974..eba7ede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30a3=['exports','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x57e0fa,_0x3151ba){var _0x3ed56f=function(_0x55baa1){while(--_0x55baa1){_0x57e0fa['push'](_0x57e0fa['shift']());}};_0x3ed56f(++_0x3151ba);}(_0x30a3,0x11f));var _0x330a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x330a('0x0'));module[_0x330a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x330a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x330a('0x3')],'get':function(){return this[_0x330a('0x4')](_0x330a('0x5'));}}};
\ No newline at end of file
+var _0x2335=['sequelize','STRING','VIRTUAL','getDataValue','key'];(function(_0x31a119,_0x17e6ca){var _0x2d6e6a=function(_0x3faa80){while(--_0x3faa80){_0x31a119['push'](_0x31a119['shift']());}};_0x2d6e6a(++_0x17e6ca);}(_0x2335,0x177));var _0x5233=function(_0x4ebd43,_0x29607b){_0x4ebd43=_0x4ebd43-0x0;var _0x1ed678=_0x2335[_0x4ebd43];return _0x1ed678;};'use strict';var Sequelize=require(_0x5233('0x0'));module['exports']={'key':{'type':Sequelize[_0x5233('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x5233('0x1')]},'name':{'type':Sequelize[_0x5233('0x2')],'get':function(){return this[_0x5233('0x3')](_0x5233('0x4'));}}};
\ No newline at end of file
index c038ce4..c729548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x429f=['then','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','CannedAnswer','include','findAll','show','rawAttributes','catch','update','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','get','CannedAnswers'];(function(_0xefc2da,_0x4f29e2){var _0x3ba265=function(_0x263855){while(--_0x263855){_0xefc2da['push'](_0xefc2da['shift']());}};_0x3ba265(++_0x4f29e2);}(_0x429f,0x7c));var _0xf429=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x429f[_0x139b85];return _0x1e833f;};'use strict';var emlformat=require(_0xf429('0x0'));var rimraf=require(_0xf429('0x1'));var zipdir=require(_0xf429('0x2'));var jsonpatch=require(_0xf429('0x3'));var rp=require(_0xf429('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf429('0x5'));var util=require(_0xf429('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf429('0x7'));var ejs=require(_0xf429('0x8'));var fs=require('fs');var fs_extra=require(_0xf429('0x9'));var _=require(_0xf429('0xa'));var squel=require(_0xf429('0xb'));var crypto=require(_0xf429('0xc'));var jsforce=require(_0xf429('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf429('0x7'));var querystring=require(_0xf429('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf429('0xf'));var as=require(_0xf429('0x10'));var hardwareService=require(_0xf429('0x11'));var logger=require(_0xf429('0x12'))('api');var utils=require(_0xf429('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf429('0x14'));var db=require(_0xf429('0x15'))['db'];function respondWithStatusCode(_0x844fc7,_0x2576b3){_0x2576b3=_0x2576b3||0xcc;return function(_0x5592db){if(_0x5592db){return _0x844fc7[_0xf429('0x16')](_0x2576b3);}return _0x844fc7[_0xf429('0x17')](_0x2576b3)[_0xf429('0x18')]();};}function respondWithResult(_0x2a52e2,_0x26f8ee){_0x26f8ee=_0x26f8ee||0xc8;return function(_0x53d4c5){if(_0x53d4c5){return _0x2a52e2['status'](_0x26f8ee)[_0xf429('0x19')](_0x53d4c5);}};}function respondWithFilteredResult(_0x1eca0a,_0x43d907){return function(_0x2b51e0){if(_0x2b51e0){var _0x46bbcc=typeof _0x43d907[_0xf429('0x1a')]===_0xf429('0x1b')&&typeof _0x43d907[_0xf429('0x1c')]===_0xf429('0x1b');var _0x263773=_0x2b51e0['count'];var _0x3dd81a=_0x46bbcc?0x0:_0x43d907[_0xf429('0x1a')];var _0x5389d5=_0x46bbcc?_0x2b51e0[_0xf429('0x1d')]:_0x43d907[_0xf429('0x1a')]+_0x43d907[_0xf429('0x1c')];var _0x1e989a;if(_0x5389d5>=_0x263773){_0x5389d5=_0x263773;_0x1e989a=0xc8;}else{_0x1e989a=0xce;}_0x1eca0a[_0xf429('0x17')](_0x1e989a);return _0x1eca0a[_0xf429('0x1e')]('Content-Range',_0x3dd81a+'-'+_0x5389d5+'/'+_0x263773)[_0xf429('0x19')](_0x2b51e0);}return null;};}function patchUpdates(_0x47ddd3){return function(_0x473176){try{jsonpatch['apply'](_0x473176,_0x47ddd3,!![]);}catch(_0x31389a){return BPromise[_0xf429('0x1f')](_0x31389a);}return _0x473176[_0xf429('0x20')]();};}function saveUpdates(_0x7d344d,_0x4e4e8d){return function(_0x1ca28a){if(_0x1ca28a){return _0x1ca28a['update'](_0x7d344d)['then'](function(_0x53b5b2){return _0x53b5b2;});}return null;};}function removeEntity(_0x478d17,_0x4ca3f4){return function(_0x3568ed){if(_0x3568ed){return _0x3568ed[_0xf429('0x21')]()['then'](function(){var _0x139bbb=_0x3568ed[_0xf429('0x22')]({'plain':!![]});var _0x1db4a2=_0xf429('0x23');return db['UserProfileResource'][_0xf429('0x21')]({'where':{'type':_0x1db4a2,'resourceId':_0x139bbb['id']}})[_0xf429('0x24')](function(){return _0x3568ed;});})['then'](function(){_0x478d17['status'](0xcc)[_0xf429('0x18')]();});}};}function handleEntityNotFound(_0x440db4,_0x1d4041){return function(_0x528d82){if(!_0x528d82){_0x440db4[_0xf429('0x16')](0x194);}return _0x528d82;};}function handleError(_0x428fd6,_0x4a2926){_0x4a2926=_0x4a2926||0x1f4;return function(_0x1e81d0){logger[_0xf429('0x25')](_0x1e81d0['stack']);if(_0x1e81d0[_0xf429('0x26')]){delete _0x1e81d0[_0xf429('0x26')];}_0x428fd6[_0xf429('0x17')](_0x4a2926)[_0xf429('0x27')](_0x1e81d0);};}exports[_0xf429('0x28')]=function(_0x4638cb,_0x64e18c){var _0x35fd4d={},_0x5ddf50={},_0x5989a5={'count':0x0,'rows':[]};var _0x4da090=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x3c740d){return{'name':_0x3c740d[_0xf429('0x29')],'type':_0x3c740d[_0xf429('0x2a')][_0xf429('0x2b')]};});_0x5ddf50[_0xf429('0x2c')]=_[_0xf429('0x2d')](_0x4da090,_0xf429('0x26'));_0x5ddf50[_0xf429('0x2e')]=_[_0xf429('0x2f')](_0x4638cb[_0xf429('0x2e')]);_0x5ddf50[_0xf429('0x30')]=_[_0xf429('0x31')](_0x5ddf50[_0xf429('0x2c')],_0x5ddf50[_0xf429('0x2e')]);_0x35fd4d['attributes']=_[_0xf429('0x31')](_0x5ddf50[_0xf429('0x2c')],qs[_0xf429('0x32')](_0x4638cb[_0xf429('0x2e')][_0xf429('0x32')]));_0x35fd4d[_0xf429('0x33')]=_0x35fd4d['attributes'][_0xf429('0x34')]?_0x35fd4d['attributes']:_0x5ddf50[_0xf429('0x2c')];if(!_0x4638cb[_0xf429('0x2e')][_0xf429('0x35')]('nolimit')){_0x35fd4d[_0xf429('0x1c')]=qs[_0xf429('0x1c')](_0x4638cb[_0xf429('0x2e')]['limit']);_0x35fd4d[_0xf429('0x1a')]=qs['offset'](_0x4638cb[_0xf429('0x2e')]['offset']);}_0x35fd4d[_0xf429('0x36')]=qs['sort'](_0x4638cb[_0xf429('0x2e')][_0xf429('0x37')]);_0x35fd4d['where']=qs[_0xf429('0x30')](_[_0xf429('0x38')](_0x4638cb[_0xf429('0x2e')],_0x5ddf50[_0xf429('0x30')]),_0x4da090);if(_0x4638cb['query'][_0xf429('0x39')]){_0x35fd4d['where']=_[_0xf429('0x3a')](_0x35fd4d[_0xf429('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4638cb[_0xf429('0x2e')][_0xf429('0x39')]+'%'}},{'value':{'$like':'%'+_0x4638cb[_0xf429('0x2e')][_0xf429('0x39')]+'%'}}]});}_0x35fd4d=_[_0xf429('0x3a')]({},_0x35fd4d,_0x4638cb[_0xf429('0x3c')]);var _0xaeb4a5={'where':_0x35fd4d['where']};return db[_0xf429('0x3d')]['count'](_0xaeb4a5)['then'](function(_0x57541a){_0x5989a5[_0xf429('0x1d')]=_0x57541a;if(_0x4638cb[_0xf429('0x2e')]['includeAll']){_0x35fd4d[_0xf429('0x3e')]=[{'all':!![]}];}return db[_0xf429('0x3d')][_0xf429('0x3f')](_0x35fd4d);})[_0xf429('0x24')](function(_0x251abe){_0x5989a5['rows']=_0x251abe;return _0x5989a5;})[_0xf429('0x24')](respondWithFilteredResult(_0x64e18c,_0x35fd4d))['catch'](handleError(_0x64e18c,null));};exports[_0xf429('0x40')]=function(_0x5b9a8c,_0x3fa81){var _0x4db010={'raw':!![],'where':{'id':_0x5b9a8c['params']['id']}},_0x4e8d64={};_0x4e8d64[_0xf429('0x2c')]=_[_0xf429('0x2f')](db['CannedAnswer'][_0xf429('0x41')]);_0x4e8d64[_0xf429('0x2e')]=_[_0xf429('0x2f')](_0x5b9a8c[_0xf429('0x2e')]);_0x4e8d64[_0xf429('0x30')]=_[_0xf429('0x31')](_0x4e8d64[_0xf429('0x2c')],_0x4e8d64['query']);_0x4db010[_0xf429('0x33')]=_[_0xf429('0x31')](_0x4e8d64[_0xf429('0x2c')],qs[_0xf429('0x32')](_0x5b9a8c[_0xf429('0x2e')][_0xf429('0x32')]));_0x4db010[_0xf429('0x33')]=_0x4db010[_0xf429('0x33')][_0xf429('0x34')]?_0x4db010[_0xf429('0x33')]:_0x4e8d64[_0xf429('0x2c')];if(_0x5b9a8c['query']['includeAll']){_0x4db010[_0xf429('0x3e')]=[{'all':!![]}];}_0x4db010=_['merge']({},_0x4db010,_0x5b9a8c['options']);return db[_0xf429('0x3d')]['find'](_0x4db010)[_0xf429('0x24')](handleEntityNotFound(_0x3fa81,null))[_0xf429('0x24')](respondWithResult(_0x3fa81,null))[_0xf429('0x42')](handleError(_0x3fa81,null));};exports[_0xf429('0x43')]=function(_0x557921,_0x436bbc){if(_0x557921[_0xf429('0x44')]['id']){delete _0x557921[_0xf429('0x44')]['id'];}return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':{'id':_0x557921['params']['id']}})['then'](handleEntityNotFound(_0x436bbc,null))[_0xf429('0x24')](saveUpdates(_0x557921[_0xf429('0x44')],null))[_0xf429('0x24')](respondWithResult(_0x436bbc,null))['catch'](handleError(_0x436bbc,null));};exports[_0xf429('0x21')]=function(_0x32e02c,_0x48b3d6){return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':{'id':_0x32e02c[_0xf429('0x46')]['id']}})[_0xf429('0x24')](handleEntityNotFound(_0x48b3d6,null))[_0xf429('0x24')](removeEntity(_0x48b3d6,null))[_0xf429('0x42')](handleError(_0x48b3d6,null));};exports[_0xf429('0x47')]=function(_0x4d03f0,_0x487de7){var _0x3237a6={'key':_0x4d03f0[_0xf429('0x44')]['key']};if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x48')]){_0x3237a6[_0xf429('0x48')]=_0x4d03f0[_0xf429('0x44')]['MailAccountId'];}else if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x49')]){_0x3237a6['SmsAccountId']=_0x4d03f0[_0xf429('0x44')][_0xf429('0x49')];}else if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x4a')]){_0x3237a6[_0xf429('0x4a')]=_0x4d03f0[_0xf429('0x44')]['OpenchannelAccountId'];}else if(_0x4d03f0['body']['ChatWebsiteId']){_0x3237a6['ChatWebsiteId']=_0x4d03f0[_0xf429('0x44')]['ChatWebsiteId'];}return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':_0x3237a6})['then'](function(_0x57c8e6){if(_0x57c8e6){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf429('0x3d')]['create'](_0x4d03f0[_0xf429('0x44')]);})['then'](function(_0x47e2af){var _0x3f201c=_0x4d03f0['user'][_0xf429('0x22')]({'plain':!![]});if(!_0x3f201c)throw new Error(_0xf429('0x4b'));if(_0x3f201c[_0xf429('0x4c')]===_0xf429('0x4d')){var _0x22bfdb=_0x47e2af[_0xf429('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf429('0x23'),'userProfileId':_0x3f201c[_0xf429('0x4e')]},'raw':!![]})[_0xf429('0x24')](function(_0x571190){if(_0x571190&&_0x571190[_0xf429('0x4f')]===0x0){return db['UserProfileResource'][_0xf429('0x47')]({'name':_0x22bfdb[_0xf429('0x26')],'resourceId':_0x22bfdb['id'],'type':_0x571190[_0xf429('0x26')],'sectionId':_0x571190['id']},{})['then'](function(){return _0x47e2af;});}else{return _0x47e2af;}})[_0xf429('0x42')](function(_0x4420a1){logger[_0xf429('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4420a1);throw _0x4420a1;});}return _0x47e2af;})[_0xf429('0x24')](respondWithResult(_0x487de7,0xc9))[_0xf429('0x42')](handleError(_0x487de7,null));};
\ No newline at end of file
+var _0xb622=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','offset','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring'];(function(_0xb92641,_0x442c8a){var _0x869bc=function(_0xa98c2d){while(--_0xa98c2d){_0xb92641['push'](_0xb92641['shift']());}};_0x869bc(++_0x442c8a);}(_0xb622,0x9c));var _0x2b62=function(_0x8075e5,_0x1dc2cb){_0x8075e5=_0x8075e5-0x0;var _0x3b4139=_0xb622[_0x8075e5];return _0x3b4139;};'use strict';var emlformat=require(_0x2b62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b62('0x1'));var jsonpatch=require(_0x2b62('0x2'));var rp=require(_0x2b62('0x3'));var moment=require(_0x2b62('0x4'));var BPromise=require(_0x2b62('0x5'));var Mustache=require(_0x2b62('0x6'));var util=require(_0x2b62('0x7'));var path=require(_0x2b62('0x8'));var sox=require(_0x2b62('0x9'));var csv=require(_0x2b62('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b62('0xb'));var _=require(_0x2b62('0xc'));var squel=require(_0x2b62('0xd'));var crypto=require(_0x2b62('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2b62('0xa'));var querystring=require(_0x2b62('0xf'));var Papa=require(_0x2b62('0x10'));var Redis=require(_0x2b62('0x11'));var authService=require(_0x2b62('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b62('0x13'));var hardwareService=require(_0x2b62('0x14'));var logger=require('../../config/logger')(_0x2b62('0x15'));var utils=require(_0x2b62('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b62('0x17'))['db'];function respondWithStatusCode(_0xcf8a02,_0x4fa13f){_0x4fa13f=_0x4fa13f||0xcc;return function(_0x175aa8){if(_0x175aa8){return _0xcf8a02[_0x2b62('0x18')](_0x4fa13f);}return _0xcf8a02[_0x2b62('0x19')](_0x4fa13f)[_0x2b62('0x1a')]();};}function respondWithResult(_0x2cf2db,_0x6cfa34){_0x6cfa34=_0x6cfa34||0xc8;return function(_0x3f52e8){if(_0x3f52e8){return _0x2cf2db[_0x2b62('0x19')](_0x6cfa34)[_0x2b62('0x1b')](_0x3f52e8);}};}function respondWithFilteredResult(_0xc36bf6,_0x5b0d95){return function(_0x5d3c59){if(_0x5d3c59){var _0x426406=typeof _0x5b0d95['offset']===_0x2b62('0x1c')&&typeof _0x5b0d95[_0x2b62('0x1d')]===_0x2b62('0x1c');var _0x306edc=_0x5d3c59[_0x2b62('0x1e')];var _0x20309c=_0x426406?0x0:_0x5b0d95['offset'];var _0x29b296=_0x426406?_0x5d3c59['count']:_0x5b0d95['offset']+_0x5b0d95['limit'];var _0x113fe8;if(_0x29b296>=_0x306edc){_0x29b296=_0x306edc;_0x113fe8=0xc8;}else{_0x113fe8=0xce;}_0xc36bf6['status'](_0x113fe8);return _0xc36bf6['set'](_0x2b62('0x1f'),_0x20309c+'-'+_0x29b296+'/'+_0x306edc)[_0x2b62('0x1b')](_0x5d3c59);}return null;};}function patchUpdates(_0x3ef155){return function(_0x1e4b79){try{jsonpatch[_0x2b62('0x20')](_0x1e4b79,_0x3ef155,!![]);}catch(_0x3f4b61){return BPromise[_0x2b62('0x21')](_0x3f4b61);}return _0x1e4b79[_0x2b62('0x22')]();};}function saveUpdates(_0x11ef4a,_0x165ecb){return function(_0x1b7d53){if(_0x1b7d53){return _0x1b7d53[_0x2b62('0x23')](_0x11ef4a)[_0x2b62('0x24')](function(_0x3cfe5c){return _0x3cfe5c;});}return null;};}function removeEntity(_0xd5a862,_0x8fb80c){return function(_0xc32a20){if(_0xc32a20){return _0xc32a20[_0x2b62('0x25')]()[_0x2b62('0x24')](function(){var _0x504fdf=_0xc32a20[_0x2b62('0x26')]({'plain':!![]});var _0x2f95b4='CannedAnswers';return db[_0x2b62('0x27')][_0x2b62('0x25')]({'where':{'type':_0x2f95b4,'resourceId':_0x504fdf['id']}})['then'](function(){return _0xc32a20;});})[_0x2b62('0x24')](function(){_0xd5a862[_0x2b62('0x19')](0xcc)[_0x2b62('0x1a')]();});}};}function handleEntityNotFound(_0x34f347,_0x553ceb){return function(_0x54063b){if(!_0x54063b){_0x34f347['sendStatus'](0x194);}return _0x54063b;};}function handleError(_0x3a470a,_0xecfc82){_0xecfc82=_0xecfc82||0x1f4;return function(_0x6b8d5c){logger['error'](_0x6b8d5c['stack']);if(_0x6b8d5c[_0x2b62('0x28')]){delete _0x6b8d5c['name'];}_0x3a470a[_0x2b62('0x19')](_0xecfc82)[_0x2b62('0x29')](_0x6b8d5c);};}exports['index']=function(_0x240b96,_0x2b3d86){var _0x44b3cd={},_0x2fed68={},_0x21174a={'count':0x0,'rows':[]};var _0x1c317a=_['map'](db[_0x2b62('0x2a')][_0x2b62('0x2b')],function(_0x9667e1){return{'name':_0x9667e1[_0x2b62('0x2c')],'type':_0x9667e1[_0x2b62('0x2d')][_0x2b62('0x2e')]};});_0x2fed68[_0x2b62('0x2f')]=_[_0x2b62('0x30')](_0x1c317a,_0x2b62('0x28'));_0x2fed68['query']=_['keys'](_0x240b96[_0x2b62('0x31')]);_0x2fed68[_0x2b62('0x32')]=_[_0x2b62('0x33')](_0x2fed68['model'],_0x2fed68[_0x2b62('0x31')]);_0x44b3cd['attributes']=_[_0x2b62('0x33')](_0x2fed68[_0x2b62('0x2f')],qs['fields'](_0x240b96[_0x2b62('0x31')][_0x2b62('0x34')]));_0x44b3cd[_0x2b62('0x35')]=_0x44b3cd[_0x2b62('0x35')]['length']?_0x44b3cd['attributes']:_0x2fed68[_0x2b62('0x2f')];if(!_0x240b96['query']['hasOwnProperty']('nolimit')){_0x44b3cd[_0x2b62('0x1d')]=qs['limit'](_0x240b96[_0x2b62('0x31')][_0x2b62('0x1d')]);_0x44b3cd[_0x2b62('0x36')]=qs[_0x2b62('0x36')](_0x240b96['query'][_0x2b62('0x36')]);}_0x44b3cd['order']=qs[_0x2b62('0x37')](_0x240b96[_0x2b62('0x31')][_0x2b62('0x37')]);_0x44b3cd[_0x2b62('0x38')]=qs[_0x2b62('0x32')](_[_0x2b62('0x39')](_0x240b96[_0x2b62('0x31')],_0x2fed68[_0x2b62('0x32')]),_0x1c317a);if(_0x240b96[_0x2b62('0x31')][_0x2b62('0x3a')]){_0x44b3cd[_0x2b62('0x38')]=_[_0x2b62('0x3b')](_0x44b3cd[_0x2b62('0x38')],{'$or':[{'key':{'$like':'%'+_0x240b96['query'][_0x2b62('0x3a')]+'%'}},{'value':{'$like':'%'+_0x240b96['query'][_0x2b62('0x3a')]+'%'}}]});}_0x44b3cd=_[_0x2b62('0x3b')]({},_0x44b3cd,_0x240b96['options']);var _0x25b618={'where':_0x44b3cd[_0x2b62('0x38')]};return db[_0x2b62('0x2a')][_0x2b62('0x1e')](_0x25b618)[_0x2b62('0x24')](function(_0x239123){_0x21174a[_0x2b62('0x1e')]=_0x239123;if(_0x240b96['query'][_0x2b62('0x3c')]){_0x44b3cd[_0x2b62('0x3d')]=[{'all':!![]}];}return db[_0x2b62('0x2a')][_0x2b62('0x3e')](_0x44b3cd);})[_0x2b62('0x24')](function(_0x2de21a){_0x21174a[_0x2b62('0x3f')]=_0x2de21a;return _0x21174a;})[_0x2b62('0x24')](respondWithFilteredResult(_0x2b3d86,_0x44b3cd))[_0x2b62('0x40')](handleError(_0x2b3d86,null));};exports[_0x2b62('0x41')]=function(_0x56d56d,_0x311ebc){var _0x49eb64={'raw':!![],'where':{'id':_0x56d56d['params']['id']}},_0x330b38={};_0x330b38['model']=_[_0x2b62('0x42')](db[_0x2b62('0x2a')][_0x2b62('0x2b')]);_0x330b38['query']=_['keys'](_0x56d56d[_0x2b62('0x31')]);_0x330b38[_0x2b62('0x32')]=_[_0x2b62('0x33')](_0x330b38[_0x2b62('0x2f')],_0x330b38['query']);_0x49eb64[_0x2b62('0x35')]=_[_0x2b62('0x33')](_0x330b38[_0x2b62('0x2f')],qs['fields'](_0x56d56d[_0x2b62('0x31')][_0x2b62('0x34')]));_0x49eb64[_0x2b62('0x35')]=_0x49eb64[_0x2b62('0x35')][_0x2b62('0x43')]?_0x49eb64['attributes']:_0x330b38[_0x2b62('0x2f')];if(_0x56d56d[_0x2b62('0x31')]['includeAll']){_0x49eb64[_0x2b62('0x3d')]=[{'all':!![]}];}_0x49eb64=_['merge']({},_0x49eb64,_0x56d56d['options']);return db['CannedAnswer'][_0x2b62('0x44')](_0x49eb64)[_0x2b62('0x24')](handleEntityNotFound(_0x311ebc,null))[_0x2b62('0x24')](respondWithResult(_0x311ebc,null))['catch'](handleError(_0x311ebc,null));};exports[_0x2b62('0x23')]=function(_0x525506,_0xdc8987){if(_0x525506[_0x2b62('0x45')]['id']){delete _0x525506['body']['id'];}return db[_0x2b62('0x2a')][_0x2b62('0x44')]({'where':{'id':_0x525506['params']['id']}})['then'](handleEntityNotFound(_0xdc8987,null))[_0x2b62('0x24')](saveUpdates(_0x525506[_0x2b62('0x45')],null))['then'](respondWithResult(_0xdc8987,null))[_0x2b62('0x40')](handleError(_0xdc8987,null));};exports[_0x2b62('0x25')]=function(_0x377b12,_0x5b756a){return db[_0x2b62('0x2a')]['find']({'where':{'id':_0x377b12[_0x2b62('0x46')]['id']}})[_0x2b62('0x24')](handleEntityNotFound(_0x5b756a,null))[_0x2b62('0x24')](removeEntity(_0x5b756a,null))[_0x2b62('0x40')](handleError(_0x5b756a,null));};exports[_0x2b62('0x47')]=function(_0x401605,_0xd0586){var _0x28e2d5={'key':_0x401605['body']['key']};if(_0x401605[_0x2b62('0x45')][_0x2b62('0x48')]){_0x28e2d5[_0x2b62('0x48')]=_0x401605[_0x2b62('0x45')][_0x2b62('0x48')];}else if(_0x401605[_0x2b62('0x45')][_0x2b62('0x49')]){_0x28e2d5[_0x2b62('0x49')]=_0x401605['body'][_0x2b62('0x49')];}else if(_0x401605[_0x2b62('0x45')]['OpenchannelAccountId']){_0x28e2d5['OpenchannelAccountId']=_0x401605[_0x2b62('0x45')][_0x2b62('0x4a')];}else if(_0x401605['body']['ChatWebsiteId']){_0x28e2d5[_0x2b62('0x4b')]=_0x401605['body'][_0x2b62('0x4b')];}return db[_0x2b62('0x2a')][_0x2b62('0x44')]({'where':_0x28e2d5})['then'](function(_0x9f4049){if(_0x9f4049){throw new db['Sequelize'][(_0x2b62('0x4c'))](_0x2b62('0x4d'));}return db[_0x2b62('0x2a')][_0x2b62('0x47')](_0x401605['body']);})['then'](function(_0x24b40b){var _0x44d0ba=_0x401605[_0x2b62('0x4e')][_0x2b62('0x26')]({'plain':!![]});if(!_0x44d0ba)throw new Error(_0x2b62('0x4f'));if(_0x44d0ba[_0x2b62('0x50')]===_0x2b62('0x4e')){var _0x255d89=_0x24b40b[_0x2b62('0x26')]({'plain':!![]});return db[_0x2b62('0x51')][_0x2b62('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x44d0ba[_0x2b62('0x52')]},'raw':!![]})[_0x2b62('0x24')](function(_0x34aefd){if(_0x34aefd&&_0x34aefd[_0x2b62('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x255d89[_0x2b62('0x28')],'resourceId':_0x255d89['id'],'type':_0x34aefd['name'],'sectionId':_0x34aefd['id']},{})[_0x2b62('0x24')](function(){return _0x24b40b;});}else{return _0x24b40b;}})['catch'](function(_0x4cb53f){logger[_0x2b62('0x54')](_0x2b62('0x55'),_0x4cb53f);throw _0x4cb53f;});}return _0x24b40b;})['then'](respondWithResult(_0xd0586,0xc9))[_0x2b62('0x40')](handleError(_0xd0586,null));};
\ No newline at end of file
index aa22889..7c307e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534f=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer'];(function(_0x1fc12c,_0x21650a){var _0x56d915=function(_0x365e1c){while(--_0x365e1c){_0x1fc12c['push'](_0x1fc12c['shift']());}};_0x56d915(++_0x21650a);}(_0x534f,0x1a3));var _0xf534=function(_0xb43e19,_0x375fc8){_0xb43e19=_0xb43e19-0x0;var _0x4f0433=_0x534f[_0xb43e19];return _0x4f0433;};'use strict';var _=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var logger=require(_0xf534('0x2'))(_0xf534('0x3'));var moment=require(_0xf534('0x4'));var BPromise=require(_0xf534('0x5'));var rp=require(_0xf534('0x6'));var fs=require('fs');var path=require(_0xf534('0x7'));var rimraf=require(_0xf534('0x8'));var config=require(_0xf534('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0xf534('0xa')]=function(_0x1469f9,_0x599575){return _0x1469f9[_0xf534('0xb')](_0xf534('0xc'),attributes,{'tableName':_0xf534('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf534('0xe'),'collate':_0xf534('0xf')});};
\ No newline at end of file
+var _0x0be6=['request-promise','rimraf','../../config/environment','exports','tools_canned_answers','utf8mb4','../../config/logger','api','moment'];(function(_0x342905,_0x2c44dd){var _0x4253dc=function(_0x4a61fc){while(--_0x4a61fc){_0x342905['push'](_0x342905['shift']());}};_0x4253dc(++_0x2c44dd);}(_0x0be6,0xa8));var _0x60be=function(_0x127311,_0x868b16){_0x127311=_0x127311-0x0;var _0x40b215=_0x0be6[_0x127311];return _0x40b215;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x60be('0x0'))(_0x60be('0x1'));var moment=require(_0x60be('0x2'));var BPromise=require('bluebird');var rp=require(_0x60be('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60be('0x4'));var config=require(_0x60be('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x60be('0x6')]=function(_0x3c717e,_0x1a53c9){return _0x3c717e['define']('CannedAnswer',attributes,{'tableName':_0x60be('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60be('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 549ebc3..97223c9 100644 (file)
@@ -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(_0x3089cf,_0x5d05f1){var _0x3a4fa5=function(_0x23b413){while(--_0x23b413){_0x3089cf['push'](_0x3089cf['shift']());}};_0x3a4fa5(++_0x5d05f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ 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(_0x4e34a1,_0x2ea388){var _0x39483d=function(_0x410f36){while(--_0x410f36){_0x4e34a1['push'](_0x4e34a1['shift']());}};_0x39483d(++_0x2ea388);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 9a61d03..f1c8f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7205=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x7205,0x1c9));var _0x5720=function(_0x22300c,_0x7c2ef9){_0x22300c=_0x22300c-0x0;var _0x36c7ff=_0x7205[_0x22300c];return _0x36c7ff;};'use strict';var multer=require('multer');var util=require(_0x5720('0x0'));var path=require(_0x5720('0x1'));var timeout=require(_0x5720('0x2'));var express=require(_0x5720('0x3'));var router=express[_0x5720('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5720('0x5'));var interaction=require(_0x5720('0x6'));var config=require(_0x5720('0x7'));var controller=require(_0x5720('0x8'));router[_0x5720('0x9')]('/',auth[_0x5720('0xa')](),controller[_0x5720('0xb')]);router[_0x5720('0x9')](_0x5720('0xc'),auth[_0x5720('0xa')](),controller[_0x5720('0xd')]);router[_0x5720('0xe')]('/',auth['isAuthenticated'](),controller[_0x5720('0xf')]);router['put'](_0x5720('0xc'),auth[_0x5720('0xa')](),controller[_0x5720('0x10')]);router['delete'](_0x5720('0xc'),auth['isAuthenticated'](),controller[_0x5720('0x11')]);module[_0x5720('0x12')]=router;
\ No newline at end of file
+var _0x52ec=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ef05a,_0x48eafc){var _0x2e3898=function(_0x1e5bdb){while(--_0x1e5bdb){_0x3ef05a['push'](_0x3ef05a['shift']());}};_0x2e3898(++_0x48eafc);}(_0x52ec,0xe9));var _0xc52e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x52ec[_0x75f869];return _0x10af8b;};'use strict';var multer=require(_0xc52e('0x0'));var util=require('util');var path=require(_0xc52e('0x1'));var timeout=require(_0xc52e('0x2'));var express=require(_0xc52e('0x3'));var router=express[_0xc52e('0x4')]();var fs_extra=require(_0xc52e('0x5'));var auth=require(_0xc52e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc52e('0x7'));var controller=require('./cannedAnswer.controller');router[_0xc52e('0x8')]('/',auth[_0xc52e('0x9')](),controller[_0xc52e('0xa')]);router[_0xc52e('0x8')](_0xc52e('0xb'),auth[_0xc52e('0x9')](),controller[_0xc52e('0xc')]);router[_0xc52e('0xd')]('/',auth['isAuthenticated'](),controller[_0xc52e('0xe')]);router[_0xc52e('0xf')](_0xc52e('0xb'),auth[_0xc52e('0x9')](),controller[_0xc52e('0x10')]);router[_0xc52e('0x11')]('/:id',auth[_0xc52e('0x9')](),controller[_0xc52e('0x12')]);module[_0xc52e('0x13')]=router;
\ No newline at end of file
index c9a9071..b1772a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5088=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x25f4a8,_0x3138bf){var _0x323777=function(_0x1101d8){while(--_0x1101d8){_0x25f4a8['push'](_0x25f4a8['shift']());}};_0x323777(++_0x3138bf);}(_0x5088,0xa9));var _0x8508=function(_0x54cda0,_0x3bf6e9){_0x54cda0=_0x54cda0-0x0;var _0x26f2c2=_0x5088[_0x54cda0];return _0x26f2c2;};'use strict';var Sequelize=require('sequelize');module[_0x8508('0x0')]={'calldate':{'type':Sequelize[_0x8508('0x1')],'allowNull':![],'defaultValue':_0x8508('0x2')},'clid':{'type':Sequelize[_0x8508('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8508('0x3')]},'dcontext':{'type':Sequelize[_0x8508('0x3')]},'channel':{'type':Sequelize[_0x8508('0x3')]},'dstchannel':{'type':Sequelize[_0x8508('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8508('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8508('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8508('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8508('0x3')]},'userfield':{'type':Sequelize[_0x8508('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8508('0x3')]},'sequence':{'type':Sequelize[_0x8508('0x3')]},'peeraccount':{'type':Sequelize[_0x8508('0x3')]},'type':{'type':Sequelize[_0x8508('0x3')]},'tag':{'type':Sequelize[_0x8508('0x3')]}};
\ No newline at end of file
+var _0x7b37=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x2c6a0d,_0x28a135){var _0x4f9bde=function(_0x2e0f3d){while(--_0x2e0f3d){_0x2c6a0d['push'](_0x2c6a0d['shift']());}};_0x4f9bde(++_0x28a135);}(_0x7b37,0xd9));var _0x77b3=function(_0x48b6c6,_0xba4073){_0x48b6c6=_0x48b6c6-0x0;var _0x1bcc9a=_0x7b37[_0x48b6c6];return _0x1bcc9a;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x77b3('0x2')},'clid':{'type':Sequelize[_0x77b3('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x77b3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77b3('0x3')]},'dstchannel':{'type':Sequelize[_0x77b3('0x3')]},'lastapp':{'type':Sequelize[_0x77b3('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x77b3('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77b3('0x3')]},'linkedid':{'type':Sequelize[_0x77b3('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x77b3('0x3')]},'type':{'type':Sequelize[_0x77b3('0x3')]},'tag':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
index 80e58e2..939e32b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x4371a4,_0xa00fbb){var _0x427524=function(_0x3ab338){while(--_0x3ab338){_0x4371a4['push'](_0x4371a4['shift']());}};_0x427524(++_0xa00fbb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x7fbe[_0x3cea78];return _0x33b66b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['Cdr'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['Cdr'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));};
\ No newline at end of file
+var _0x277c=['destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','Cdr','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x17467c,_0x6fc6e2){var _0x81fc45=function(_0x116413){while(--_0x116413){_0x17467c['push'](_0x17467c['shift']());}};_0x81fc45(++_0x6fc6e2);}(_0x277c,0x153));var _0xc277=function(_0x18f419,_0x5216d1){_0x18f419=_0x18f419-0x0;var _0x429f9e=_0x277c[_0x18f419];return _0x429f9e;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={},_0x3bc773={},_0x37e27b={'count':0x0,'rows':[]};var _0x21c78c=_[_0xc277('0x2b')](db['Cdr'][_0xc277('0x2c')],function(_0x5edf7e){return{'name':_0x5edf7e[_0xc277('0x2d')],'type':_0x5edf7e[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x3bc773[_0xc277('0x30')]=_['map'](_0x21c78c,_0xc277('0x28'));_0x3bc773['query']=_[_0xc277('0x31')](_0x4ebb0f[_0xc277('0x32')]);_0x3bc773[_0xc277('0x33')]=_[_0xc277('0x34')](_0x3bc773['model'],_0x3bc773[_0xc277('0x32')]);_0x388717[_0xc277('0x35')]=_['intersection'](_0x3bc773[_0xc277('0x30')],qs['fields'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x36')]));_0x388717[_0xc277('0x35')]=_0x388717[_0xc277('0x35')][_0xc277('0x37')]?_0x388717[_0xc277('0x35')]:_0x3bc773[_0xc277('0x30')];if(!_0x4ebb0f[_0xc277('0x32')][_0xc277('0x38')](_0xc277('0x39'))){_0x388717[_0xc277('0x1c')]=qs['limit'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1c')]);_0x388717[_0xc277('0x1a')]=qs['offset'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1a')]);}_0x388717[_0xc277('0x3a')]=qs[_0xc277('0x3b')](_0x4ebb0f[_0xc277('0x32')]['sort']);_0x388717['where']=qs[_0xc277('0x33')](_['pick'](_0x4ebb0f[_0xc277('0x32')],_0x3bc773[_0xc277('0x33')]),_0x21c78c);if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]){_0x388717[_0xc277('0x3d')]=_[_0xc277('0x3e')](_0x388717[_0xc277('0x3d')],{'$or':_[_0xc277('0x2b')](_0x21c78c,function(_0x2e35b5){if(_0x2e35b5[_0xc277('0x2e')]!==_0xc277('0x3f')){var _0x4eaa6c={};_0x4eaa6c[_0x2e35b5[_0xc277('0x28')]]={'$like':'%'+_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]+'%'};return _0x4eaa6c;}})});}_0x388717=_['merge']({},_0x388717,_0x4ebb0f[_0xc277('0x40')]);var _0x278a92={'where':_0x388717['where']};return db['Cdr'][_0xc277('0x1d')](_0x278a92)[_0xc277('0x23')](function(_0x22c5b3){_0x37e27b[_0xc277('0x1d')]=_0x22c5b3;if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x41')]){_0x388717[_0xc277('0x42')]=[{'all':!![]}];}return db['Cdr'][_0xc277('0x43')](_0x388717);})[_0xc277('0x23')](function(_0x142ca6){_0x37e27b['rows']=_0x142ca6;return _0x37e27b;})['then'](respondWithFilteredResult(_0x4efc1e,_0x388717))['catch'](handleError(_0x4efc1e,null));};exports['show']=function(_0x519f14,_0x25723a){var _0x4a26e3={'raw':!![],'where':{'id':_0x519f14[_0xc277('0x44')]['id']}},_0x46fda3={};_0x46fda3[_0xc277('0x30')]=_['keys'](db[_0xc277('0x45')][_0xc277('0x2c')]);_0x46fda3[_0xc277('0x32')]=_[_0xc277('0x31')](_0x519f14['query']);_0x46fda3[_0xc277('0x33')]=_[_0xc277('0x34')](_0x46fda3['model'],_0x46fda3[_0xc277('0x32')]);_0x4a26e3[_0xc277('0x35')]=_[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')],qs[_0xc277('0x36')](_0x519f14[_0xc277('0x32')][_0xc277('0x36')]));_0x4a26e3[_0xc277('0x35')]=_0x4a26e3[_0xc277('0x35')][_0xc277('0x37')]?_0x4a26e3[_0xc277('0x35')]:_0x46fda3['model'];if(_0x519f14[_0xc277('0x32')][_0xc277('0x41')]){_0x4a26e3[_0xc277('0x42')]=[{'all':!![]}];}_0x4a26e3=_[_0xc277('0x3e')]({},_0x4a26e3,_0x519f14['options']);return db[_0xc277('0x45')]['find'](_0x4a26e3)[_0xc277('0x23')](handleEntityNotFound(_0x25723a,null))[_0xc277('0x23')](respondWithResult(_0x25723a,null))[_0xc277('0x46')](handleError(_0x25723a,null));};exports[_0xc277('0x47')]=function(_0x4129bc,_0x57c759){return db[_0xc277('0x45')][_0xc277('0x47')](_0x4129bc[_0xc277('0x48')],{})[_0xc277('0x23')](respondWithResult(_0x57c759,0xc9))['catch'](handleError(_0x57c759,null));};exports[_0xc277('0x22')]=function(_0x9c910a,_0x150876){if(_0x9c910a['body']['id']){delete _0x9c910a[_0xc277('0x48')]['id'];}return db['Cdr'][_0xc277('0x49')]({'where':{'id':_0x9c910a[_0xc277('0x44')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x150876,null))[_0xc277('0x23')](saveUpdates(_0x9c910a[_0xc277('0x48')],null))[_0xc277('0x23')](respondWithResult(_0x150876,null))[_0xc277('0x46')](handleError(_0x150876,null));};exports[_0xc277('0x24')]=function(_0x8752f2,_0x25f5e1){return db[_0xc277('0x45')][_0xc277('0x49')]({'where':{'id':_0x8752f2['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x25f5e1,null))['then'](removeEntity(_0x25f5e1,null))[_0xc277('0x46')](handleError(_0x25f5e1,null));};exports[_0xc277('0x4a')]=function(_0x1900ca,_0x33b032){return db[_0xc277('0x45')]['describe']()[_0xc277('0x23')](respondWithResult(_0x33b032,null))[_0xc277('0x46')](handleError(_0x33b032,null));};
\ No newline at end of file
index 61bfba6..cd40fb8 100644 (file)
@@ -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(_0x36237a,_0x18df4a){var _0x40fb5c=function(_0x2dc153){while(--_0x2dc153){_0x36237a['push'](_0x36237a['shift']());}};_0x40fb5c(++_0x18df4a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x3978fa,_0x552b50){var _0x4386ff=function(_0x339007){while(--_0x339007){_0x3978fa['push'](_0x3978fa['shift']());}};_0x4386ff(++_0x552b50);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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
index 00e7dbd..7b9cace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9842=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x9842,0x163));var _0x2984=function(_0x3eeaea,_0x5079d5){_0x3eeaea=_0x3eeaea-0x0;var _0x537079=_0x9842[_0x3eeaea];return _0x537079;};'use strict';var _=require(_0x2984('0x0'));var util=require(_0x2984('0x1'));var moment=require(_0x2984('0x2'));var BPromise=require(_0x2984('0x3'));var rs=require(_0x2984('0x4'));var fs=require('fs');var Redis=require(_0x2984('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2984('0x6'));var logger=require(_0x2984('0x7'))(_0x2984('0x8'));var config=require('../../config/environment');var jayson=require(_0x2984('0x9'));var client=jayson[_0x2984('0xa')][_0x2984('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5850bf,_0x33cae7,_0x6fe7a6){return new BPromise(function(_0x148d40,_0x4b9dc0){return client['request'](_0x5850bf,_0x6fe7a6)['then'](function(_0x5e428f){logger['info'](_0x2984('0xc'),_0x33cae7,'request\x20sent');logger[_0x2984('0xd')](_0x2984('0xe'),_0x33cae7,_0x2984('0xf'),JSON[_0x2984('0x10')](_0x5e428f));if(_0x5e428f[_0x2984('0x11')]){if(_0x5e428f[_0x2984('0x11')]['code']===0x1f4){logger[_0x2984('0x11')]('Cdr,\x20%s,\x20%s',_0x33cae7,_0x5e428f[_0x2984('0x11')][_0x2984('0x12')]);return _0x4b9dc0(_0x5e428f[_0x2984('0x11')]['message']);}logger['error'](_0x2984('0xc'),_0x33cae7,_0x5e428f[_0x2984('0x11')]['message']);return _0x148d40(_0x5e428f[_0x2984('0x11')][_0x2984('0x12')]);}else{logger[_0x2984('0x13')](_0x2984('0xc'),_0x33cae7,'request\x20sent');_0x148d40(_0x5e428f[_0x2984('0x14')][_0x2984('0x12')]);}})[_0x2984('0x15')](function(_0x4c8c3b){logger[_0x2984('0x11')]('Cdr,\x20%s,\x20%s',_0x33cae7,_0x4c8c3b);_0x4b9dc0(_0x4c8c3b);});});}
\ No newline at end of file
+var _0xd22b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1c95e6,_0x12e0b7){var _0x1aa60b=function(_0x2be010){while(--_0x2be010){_0x1c95e6['push'](_0x1c95e6['shift']());}};_0x1aa60b(++_0x12e0b7);}(_0xd22b,0x18a));var _0xbd22=function(_0x285169,_0x8517d7){_0x285169=_0x285169-0x0;var _0x329194=_0xd22b[_0x285169];return _0x329194;};'use strict';var _=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var rs=require(_0xbd22('0x4'));var fs=require('fs');var Redis=require(_0xbd22('0x5'));var db=require(_0xbd22('0x6'))['db'];var utils=require(_0xbd22('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbd22('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d5e4f,_0x6c1fdb,_0x364773){return new BPromise(function(_0x3fe104,_0x23eb3e){return client[_0xbd22('0xa')](_0x3d5e4f,_0x364773)['then'](function(_0x1a2eda){logger[_0xbd22('0xb')](_0xbd22('0xc'),_0x6c1fdb,_0xbd22('0xd'));logger[_0xbd22('0xe')](_0xbd22('0xf'),_0x6c1fdb,_0xbd22('0xd'),JSON[_0xbd22('0x10')](_0x1a2eda));if(_0x1a2eda['error']){if(_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x12')]===0x1f4){logger[_0xbd22('0x11')](_0xbd22('0xc'),_0x6c1fdb,_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x13')]);return _0x23eb3e(_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x6c1fdb,_0x1a2eda[_0xbd22('0x11')]['message']);return _0x3fe104(_0x1a2eda[_0xbd22('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x6c1fdb,_0xbd22('0xd'));_0x3fe104(_0x1a2eda[_0xbd22('0x14')][_0xbd22('0x13')]);}})[_0xbd22('0x15')](function(_0x34305c){logger[_0xbd22('0x11')](_0xbd22('0xc'),_0x6c1fdb,_0x34305c);_0x23eb3e(_0x34305c);});});}
\ No newline at end of file
index 964ce53..ee3ec23 100644 (file)
@@ -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(_0x3766f4,_0x580673){var _0x183f88=function(_0x4be9ac){while(--_0x4be9ac){_0x3766f4['push'](_0x3766f4['shift']());}};_0x183f88(++_0x580673);}(_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
+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(_0x11a3bb,_0x5c5466){var _0x3c3e36=function(_0x59f16f){while(--_0x59f16f){_0x11a3bb['push'](_0x11a3bb['shift']());}};_0x3c3e36(++_0x5c5466);}(_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
index 3789b1b..0fda69a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06e3=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x37ad7e,_0x325e74){var _0x928086=function(_0x4e54da){while(--_0x4e54da){_0x37ad7e['push'](_0x37ad7e['shift']());}};_0x928086(++_0x325e74);}(_0x06e3,0x1b3));var _0x306e=function(_0x47732c,_0x5955e3){_0x47732c=_0x47732c-0x0;var _0x55b2d2=_0x06e3[_0x47732c];return _0x55b2d2;};'use strict';var Sequelize=require('sequelize');module[_0x306e('0x0')]={'priority':{'type':Sequelize[_0x306e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x306e('0x2')],'allowNull':![],'defaultValue':_0x306e('0x3')},'appdata':{'type':Sequelize[_0x306e('0x4')]()},'description':{'type':Sequelize[_0x306e('0x2')]},'interval':{'type':Sequelize[_0x306e('0x2')],'defaultValue':_0x306e('0x5')}};
\ No newline at end of file
+var _0xe0bf=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0xe0bf,0x75));var _0xfe0b=function(_0x2afeb3,_0x43d94d){_0x2afeb3=_0x2afeb3-0x0;var _0x52216f=_0xe0bf[_0x2afeb3];return _0x52216f;};'use strict';var Sequelize=require(_0xfe0b('0x0'));module[_0xfe0b('0x1')]={'priority':{'type':Sequelize[_0xfe0b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfe0b('0x3')],'allowNull':![],'defaultValue':_0xfe0b('0x4')},'appdata':{'type':Sequelize[_0xfe0b('0x5')]()},'description':{'type':Sequelize[_0xfe0b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a453080..31c782a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8721=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8721,0xd9));var _0x1872=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x8721[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x1872('0x0'));var rimraf=require(_0x1872('0x1'));var zipdir=require(_0x1872('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1872('0x4'));var sox=require(_0x1872('0x5'));var csv=require(_0x1872('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1872('0x7'));var squel=require(_0x1872('0x8'));var crypto=require(_0x1872('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1872('0xa'));var toCsv=require(_0x1872('0x6'));var querystring=require(_0x1872('0xb'));var Papa=require(_0x1872('0xc'));var Redis=require(_0x1872('0xd'));var authService=require(_0x1872('0xe'));var qs=require(_0x1872('0xf'));var as=require(_0x1872('0x10'));var hardwareService=require(_0x1872('0x11'));var logger=require(_0x1872('0x12'))(_0x1872('0x13'));var utils=require('../../config/utils');var config=require(_0x1872('0x14'));var licenseUtil=require(_0x1872('0x15'));var db=require(_0x1872('0x16'))['db'];function respondWithStatusCode(_0x4345d0,_0x5122df){_0x5122df=_0x5122df||0xcc;return function(_0x412663){if(_0x412663){return _0x4345d0[_0x1872('0x17')](_0x5122df);}return _0x4345d0[_0x1872('0x18')](_0x5122df)[_0x1872('0x19')]();};}function respondWithResult(_0x4d943c,_0x4df475){_0x4df475=_0x4df475||0xc8;return function(_0xe47f69){if(_0xe47f69){return _0x4d943c[_0x1872('0x18')](_0x4df475)[_0x1872('0x1a')](_0xe47f69);}};}function respondWithFilteredResult(_0x40ee43,_0x1ffc89){return function(_0x5662e6){if(_0x5662e6){var _0x4be58a=typeof _0x1ffc89['offset']===_0x1872('0x1b')&&typeof _0x1ffc89[_0x1872('0x1c')]===_0x1872('0x1b');var _0x47f15f=_0x5662e6[_0x1872('0x1d')];var _0x487791=_0x4be58a?0x0:_0x1ffc89[_0x1872('0x1e')];var _0x34899d=_0x4be58a?_0x5662e6[_0x1872('0x1d')]:_0x1ffc89['offset']+_0x1ffc89[_0x1872('0x1c')];var _0x5a0483;if(_0x34899d>=_0x47f15f){_0x34899d=_0x47f15f;_0x5a0483=0xc8;}else{_0x5a0483=0xce;}_0x40ee43[_0x1872('0x18')](_0x5a0483);return _0x40ee43[_0x1872('0x1f')](_0x1872('0x20'),_0x487791+'-'+_0x34899d+'/'+_0x47f15f)[_0x1872('0x1a')](_0x5662e6);}return null;};}function patchUpdates(_0x15dbbc){return function(_0x506a44){try{jsonpatch[_0x1872('0x21')](_0x506a44,_0x15dbbc,!![]);}catch(_0x18ff91){return BPromise[_0x1872('0x22')](_0x18ff91);}return _0x506a44[_0x1872('0x23')]();};}function saveUpdates(_0xcc4221,_0x3142f8){return function(_0x1fc33f){if(_0x1fc33f){return _0x1fc33f[_0x1872('0x24')](_0xcc4221)[_0x1872('0x25')](function(_0x4908bf){return _0x4908bf;});}return null;};}function removeEntity(_0x54e059,_0x5f29f5){return function(_0x42e0e4){if(_0x42e0e4){return _0x42e0e4[_0x1872('0x26')]()[_0x1872('0x25')](function(){_0x54e059[_0x1872('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x323592,_0x2ac6b8){return function(_0x126ab4){if(!_0x126ab4){_0x323592['sendStatus'](0x194);}return _0x126ab4;};}function handleError(_0x42baba,_0x576efa){_0x576efa=_0x576efa||0x1f4;return function(_0x43e178){logger[_0x1872('0x27')](_0x43e178[_0x1872('0x28')]);if(_0x43e178['name']){delete _0x43e178[_0x1872('0x29')];}_0x42baba[_0x1872('0x18')](_0x576efa)['send'](_0x43e178);};}exports['show']=function(_0x33448e,_0x5bab21){var _0x5469e7={'raw':!![],'where':{'id':_0x33448e['params']['id']}},_0x333961={};_0x333961[_0x1872('0x2a')]=_[_0x1872('0x2b')](db['ChatApplication'][_0x1872('0x2c')]);_0x333961[_0x1872('0x2d')]=_[_0x1872('0x2b')](_0x33448e['query']);_0x333961[_0x1872('0x2e')]=_[_0x1872('0x2f')](_0x333961[_0x1872('0x2a')],_0x333961[_0x1872('0x2d')]);_0x5469e7[_0x1872('0x30')]=_['intersection'](_0x333961[_0x1872('0x2a')],qs[_0x1872('0x31')](_0x33448e[_0x1872('0x2d')][_0x1872('0x31')]));_0x5469e7[_0x1872('0x30')]=_0x5469e7[_0x1872('0x30')]['length']?_0x5469e7[_0x1872('0x30')]:_0x333961[_0x1872('0x2a')];if(_0x33448e[_0x1872('0x2d')][_0x1872('0x32')]){_0x5469e7[_0x1872('0x33')]=[{'all':!![]}];}_0x5469e7=_[_0x1872('0x34')]({},_0x5469e7,_0x33448e[_0x1872('0x35')]);return db[_0x1872('0x36')]['find'](_0x5469e7)['then'](handleEntityNotFound(_0x5bab21,null))[_0x1872('0x25')](respondWithResult(_0x5bab21,null))[_0x1872('0x37')](handleError(_0x5bab21,null));};exports[_0x1872('0x24')]=function(_0x13e46f,_0x12cb14){if(_0x13e46f[_0x1872('0x38')]['id']){delete _0x13e46f['body']['id'];}return db[_0x1872('0x36')][_0x1872('0x39')]({'where':{'id':_0x13e46f['params']['id']}})['then'](handleEntityNotFound(_0x12cb14,null))['then'](saveUpdates(_0x13e46f[_0x1872('0x38')],null))[_0x1872('0x25')](respondWithResult(_0x12cb14,null))[_0x1872('0x37')](handleError(_0x12cb14,null));};exports['destroy']=function(_0x27e5df,_0x111f47){return db[_0x1872('0x36')][_0x1872('0x39')]({'where':{'id':_0x27e5df[_0x1872('0x3a')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x111f47,null))['then'](removeEntity(_0x111f47,null))[_0x1872('0x37')](handleError(_0x111f47,null));};
\ No newline at end of file
+var _0xe3d4=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','destroy','error','name','show','params','ChatApplication','rawAttributes','query','filters','attributes','model','fields','length','includeAll','merge','options','find','then','catch','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x20ef84,_0x737ae0){var _0x1811f3=function(_0x4739f4){while(--_0x4739f4){_0x20ef84['push'](_0x20ef84['shift']());}};_0x1811f3(++_0x737ae0);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xe3d4[_0x1558ab];return _0x53b64a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];function respondWithStatusCode(_0x2fc5f6,_0x30b359){_0x30b359=_0x30b359||0xcc;return function(_0x3556ec){if(_0x3556ec){return _0x2fc5f6[_0x4e3d('0x17')](_0x30b359);}return _0x2fc5f6[_0x4e3d('0x18')](_0x30b359)[_0x4e3d('0x19')]();};}function respondWithResult(_0x54debc,_0x44022b){_0x44022b=_0x44022b||0xc8;return function(_0x4325b4){if(_0x4325b4){return _0x54debc[_0x4e3d('0x18')](_0x44022b)['json'](_0x4325b4);}};}function respondWithFilteredResult(_0x3708be,_0x438973){return function(_0x46bf2b){if(_0x46bf2b){var _0xc20768=typeof _0x438973[_0x4e3d('0x1a')]===_0x4e3d('0x1b')&&typeof _0x438973[_0x4e3d('0x1c')]===_0x4e3d('0x1b');var _0x554ba6=_0x46bf2b[_0x4e3d('0x1d')];var _0x5129d5=_0xc20768?0x0:_0x438973['offset'];var _0x19010b=_0xc20768?_0x46bf2b['count']:_0x438973['offset']+_0x438973[_0x4e3d('0x1c')];var _0x2e37ad;if(_0x19010b>=_0x554ba6){_0x19010b=_0x554ba6;_0x2e37ad=0xc8;}else{_0x2e37ad=0xce;}_0x3708be[_0x4e3d('0x18')](_0x2e37ad);return _0x3708be[_0x4e3d('0x1e')]('Content-Range',_0x5129d5+'-'+_0x19010b+'/'+_0x554ba6)[_0x4e3d('0x1f')](_0x46bf2b);}return null;};}function patchUpdates(_0x552ca7){return function(_0x20c533){try{jsonpatch['apply'](_0x20c533,_0x552ca7,!![]);}catch(_0x170f88){return BPromise[_0x4e3d('0x20')](_0x170f88);}return _0x20c533[_0x4e3d('0x21')]();};}function saveUpdates(_0x534185,_0x224c05){return function(_0x2c8186){if(_0x2c8186){return _0x2c8186['update'](_0x534185)['then'](function(_0x18271a){return _0x18271a;});}return null;};}function removeEntity(_0x7a0b3c,_0x35a31b){return function(_0x49301f){if(_0x49301f){return _0x49301f[_0x4e3d('0x22')]()['then'](function(){_0x7a0b3c[_0x4e3d('0x18')](0xcc)[_0x4e3d('0x19')]();});}};}function handleEntityNotFound(_0x43bc1b,_0x50d9db){return function(_0x2434ea){if(!_0x2434ea){_0x43bc1b[_0x4e3d('0x17')](0x194);}return _0x2434ea;};}function handleError(_0x5b1a18,_0x192cb4){_0x192cb4=_0x192cb4||0x1f4;return function(_0x21d7e4){logger[_0x4e3d('0x23')](_0x21d7e4['stack']);if(_0x21d7e4[_0x4e3d('0x24')]){delete _0x21d7e4['name'];}_0x5b1a18[_0x4e3d('0x18')](_0x192cb4)['send'](_0x21d7e4);};}exports[_0x4e3d('0x25')]=function(_0x2d1991,_0x17c0f4){var _0x4dfc6b={'raw':!![],'where':{'id':_0x2d1991[_0x4e3d('0x26')]['id']}},_0x2c5935={};_0x2c5935['model']=_['keys'](db[_0x4e3d('0x27')][_0x4e3d('0x28')]);_0x2c5935[_0x4e3d('0x29')]=_['keys'](_0x2d1991[_0x4e3d('0x29')]);_0x2c5935[_0x4e3d('0x2a')]=_['intersection'](_0x2c5935['model'],_0x2c5935[_0x4e3d('0x29')]);_0x4dfc6b[_0x4e3d('0x2b')]=_['intersection'](_0x2c5935[_0x4e3d('0x2c')],qs['fields'](_0x2d1991[_0x4e3d('0x29')][_0x4e3d('0x2d')]));_0x4dfc6b['attributes']=_0x4dfc6b[_0x4e3d('0x2b')][_0x4e3d('0x2e')]?_0x4dfc6b[_0x4e3d('0x2b')]:_0x2c5935['model'];if(_0x2d1991[_0x4e3d('0x29')][_0x4e3d('0x2f')]){_0x4dfc6b['include']=[{'all':!![]}];}_0x4dfc6b=_[_0x4e3d('0x30')]({},_0x4dfc6b,_0x2d1991[_0x4e3d('0x31')]);return db['ChatApplication'][_0x4e3d('0x32')](_0x4dfc6b)[_0x4e3d('0x33')](handleEntityNotFound(_0x17c0f4,null))[_0x4e3d('0x33')](respondWithResult(_0x17c0f4,null))[_0x4e3d('0x34')](handleError(_0x17c0f4,null));};exports[_0x4e3d('0x35')]=function(_0x24830d,_0x131c1d){if(_0x24830d[_0x4e3d('0x36')]['id']){delete _0x24830d[_0x4e3d('0x36')]['id'];}return db[_0x4e3d('0x27')][_0x4e3d('0x32')]({'where':{'id':_0x24830d['params']['id']}})[_0x4e3d('0x33')](handleEntityNotFound(_0x131c1d,null))[_0x4e3d('0x33')](saveUpdates(_0x24830d[_0x4e3d('0x36')],null))[_0x4e3d('0x33')](respondWithResult(_0x131c1d,null))[_0x4e3d('0x34')](handleError(_0x131c1d,null));};exports[_0x4e3d('0x22')]=function(_0x4dc1f4,_0x24232c){return db[_0x4e3d('0x27')][_0x4e3d('0x32')]({'where':{'id':_0x4dc1f4[_0x4e3d('0x26')]['id']}})[_0x4e3d('0x33')](handleEntityNotFound(_0x24232c,null))[_0x4e3d('0x33')](removeEntity(_0x24232c,null))[_0x4e3d('0x34')](handleError(_0x24232c,null));};
\ No newline at end of file
index bd8572c..6301905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d22=['lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x451b84,_0x8d39f8){var _0x1d3a9d=function(_0x32cfd5){while(--_0x32cfd5){_0x451b84['push'](_0x451b84['shift']());}};_0x1d3a9d(++_0x8d39f8);}(_0x4d22,0x1ef));var _0x24d2=function(_0x49c54c,_0x54a647){_0x49c54c=_0x49c54c-0x0;var _0x446225=_0x4d22[_0x49c54c];return _0x446225;};'use strict';var _=require(_0x24d2('0x0'));var util=require('util');var logger=require(_0x24d2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x24d2('0x2'));var rp=require(_0x24d2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d2('0x4'));var config=require(_0x24d2('0x5'));var attributes=require(_0x24d2('0x6'));module[_0x24d2('0x7')]=function(_0x5892f6,_0x483801){return _0x5892f6['define'](_0x24d2('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24d2('0x9'),'collate':_0x24d2('0xa')});};
\ No newline at end of file
+var _0xf50a=['util','api','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x2dd2e1,_0x1cc9cc){var _0xdfa1f4=function(_0x348df1){while(--_0x348df1){_0x2dd2e1['push'](_0x2dd2e1['shift']());}};_0xdfa1f4(++_0x1cc9cc);}(_0xf50a,0x1b8));var _0xaf50=function(_0x4dd71c,_0x23a24e){_0x4dd71c=_0x4dd71c-0x0;var _0x8e4e36=_0xf50a[_0x4dd71c];return _0x8e4e36;};'use strict';var _=require('lodash');var util=require(_0xaf50('0x0'));var logger=require('../../config/logger')(_0xaf50('0x1'));var moment=require('moment');var BPromise=require(_0xaf50('0x2'));var rp=require(_0xaf50('0x3'));var fs=require('fs');var path=require(_0xaf50('0x4'));var rimraf=require('rimraf');var config=require(_0xaf50('0x5'));var attributes=require(_0xaf50('0x6'));module['exports']=function(_0x6b142f,_0x55abcd){return _0x6b142f[_0xaf50('0x7')](_0xaf50('0x8'),attributes,{'tableName':_0xaf50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf50('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 3a5100f..4e8329d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4d6=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d76f0,_0x47160f){var _0x3ed573=function(_0x5d3a5f){while(--_0x5d3a5f){_0x4d76f0['push'](_0x4d76f0['shift']());}};_0x3ed573(++_0x47160f);}(_0xe4d6,0xec));var _0x6e4d=function(_0x5378fd,_0x2500d3){_0x5378fd=_0x5378fd-0x0;var _0x3c3a3b=_0xe4d6[_0x5378fd];return _0x3c3a3b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e4d('0x0'));var BPromise=require('bluebird');var rs=require(_0x6e4d('0x1'));var fs=require('fs');var Redis=require(_0x6e4d('0x2'));var db=require(_0x6e4d('0x3'))['db'];var utils=require(_0x6e4d('0x4'));var logger=require(_0x6e4d('0x5'))(_0x6e4d('0x6'));var config=require(_0x6e4d('0x7'));var jayson=require(_0x6e4d('0x8'));var client=jayson[_0x6e4d('0x9')][_0x6e4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3774c4,_0xe4fb38,_0x3b41aa){return new BPromise(function(_0x4af36d,_0x158f9c){return client[_0x6e4d('0xb')](_0x3774c4,_0x3b41aa)[_0x6e4d('0xc')](function(_0x154ca1){logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0xe4fb38,_0x6e4d('0xf'));logger['debug'](_0x6e4d('0x10'),_0xe4fb38,'request\x20sent',JSON['stringify'](_0x154ca1));if(_0x154ca1[_0x6e4d('0x11')]){if(_0x154ca1[_0x6e4d('0x11')][_0x6e4d('0x12')]===0x1f4){logger[_0x6e4d('0x11')](_0x6e4d('0xe'),_0xe4fb38,_0x154ca1[_0x6e4d('0x11')][_0x6e4d('0x13')]);return _0x158f9c(_0x154ca1[_0x6e4d('0x11')]['message']);}logger[_0x6e4d('0x11')]('ChatApplication,\x20%s,\x20%s',_0xe4fb38,_0x154ca1[_0x6e4d('0x11')]['message']);return _0x4af36d(_0x154ca1['error'][_0x6e4d('0x13')]);}else{logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0xe4fb38,_0x6e4d('0xf'));_0x4af36d(_0x154ca1[_0x6e4d('0x14')]['message']);}})[_0x6e4d('0x15')](function(_0x3ae304){logger[_0x6e4d('0x11')](_0x6e4d('0xe'),_0xe4fb38,_0x3ae304);_0x158f9c(_0x3ae304);});});}
\ No newline at end of file
+var _0x3c52=['ChatApplication,\x20%s,\x20%s','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0xe0a009,_0x1a43e9){var _0x246686=function(_0x30ed94){while(--_0x30ed94){_0xe0a009['push'](_0xe0a009['shift']());}};_0x246686(++_0x1a43e9);}(_0x3c52,0xeb));var _0x23c5=function(_0x298f74,_0x4ece46){_0x298f74=_0x298f74-0x0;var _0x22301b=_0x3c52[_0x298f74];return _0x22301b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23c5('0x0'));var BPromise=require('bluebird');var rs=require(_0x23c5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23c5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c5('0x3'))(_0x23c5('0x4'));var config=require(_0x23c5('0x5'));var jayson=require(_0x23c5('0x6'));var client=jayson[_0x23c5('0x7')][_0x23c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b784e,_0x428e7b,_0x2cf541){return new BPromise(function(_0x307395,_0x1f120c){return client[_0x23c5('0x9')](_0x4b784e,_0x2cf541)[_0x23c5('0xa')](function(_0x3196e8){logger['info']('ChatApplication,\x20%s,\x20%s',_0x428e7b,'request\x20sent');logger[_0x23c5('0xb')](_0x23c5('0xc'),_0x428e7b,_0x23c5('0xd'),JSON[_0x23c5('0xe')](_0x3196e8));if(_0x3196e8[_0x23c5('0xf')]){if(_0x3196e8[_0x23c5('0xf')]['code']===0x1f4){logger[_0x23c5('0xf')]('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);return _0x1f120c(_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);}logger[_0x23c5('0xf')](_0x23c5('0x11'),_0x428e7b,_0x3196e8[_0x23c5('0xf')]['message']);return _0x307395(_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x23c5('0xd'));_0x307395(_0x3196e8['result'][_0x23c5('0x10')]);}})['catch'](function(_0x3e573a){logger[_0x23c5('0xf')]('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x3e573a);_0x1f120c(_0x3e573a);});});}
\ No newline at end of file
index 9d4803f..aad5e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1763=['destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put'];(function(_0x5360bf,_0x4be2f9){var _0x359907=function(_0x5a2847){while(--_0x5a2847){_0x5360bf['push'](_0x5360bf['shift']());}};_0x359907(++_0x4be2f9);}(_0x1763,0x116));var _0x3176=function(_0x24dfb7,_0x2bf1bf){_0x24dfb7=_0x24dfb7-0x0;var _0x525851=_0x1763[_0x24dfb7];return _0x525851;};'use strict';var multer=require(_0x3176('0x0'));var util=require('util');var path=require(_0x3176('0x1'));var timeout=require('connect-timeout');var express=require(_0x3176('0x2'));var router=express[_0x3176('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3176('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3176('0x5'));var controller=require('./chatApplication.controller');router[_0x3176('0x6')](_0x3176('0x7'),auth[_0x3176('0x8')](),controller['show']);router[_0x3176('0x9')]('/:id',auth[_0x3176('0x8')](),controller['update']);router['delete'](_0x3176('0x7'),auth[_0x3176('0x8')](),controller[_0x3176('0xa')]);module[_0x3176('0xb')]=router;
\ No newline at end of file
+var _0x0964=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','put','/:id','update'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x0964,0xf1));var _0x4096=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x0964[_0x44946b];return _0x249bc4;};'use strict';var multer=require(_0x4096('0x0'));var util=require(_0x4096('0x1'));var path=require(_0x4096('0x2'));var timeout=require(_0x4096('0x3'));var express=require(_0x4096('0x4'));var router=express[_0x4096('0x5')]();var fs_extra=require(_0x4096('0x6'));var auth=require(_0x4096('0x7'));var interaction=require(_0x4096('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x4096('0x9')]('/:id',auth[_0x4096('0xa')](),controller['show']);router[_0x4096('0xb')](_0x4096('0xc'),auth[_0x4096('0xa')](),controller[_0x4096('0xd')]);router[_0x4096('0xe')]('/:id',auth[_0x4096('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e3fbc2e..1385d18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9169=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9169,0xdd));var _0x9916=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x9169[_0x34232c];return _0x4d4f4e;};'use strict';var Sequelize=require(_0x9916('0x0'));module[_0x9916('0x1')]={'name':{'type':Sequelize[_0x9916('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9916('0x2')]},'write':{'type':Sequelize[_0x9916('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x647c=['exports','STRING','BOOLEAN'];(function(_0x2b5ec3,_0x528ef0){var _0x10b927=function(_0x133435){while(--_0x133435){_0x2b5ec3['push'](_0x2b5ec3['shift']());}};_0x10b927(++_0x528ef0);}(_0x647c,0x105));var _0xc647=function(_0x541a10,_0x53f603){_0x541a10=_0x541a10-0x0;var _0x45a4a6=_0x647c[_0x541a10];return _0x45a4a6;};'use strict';var Sequelize=require('sequelize');module[_0xc647('0x0')]={'name':{'type':Sequelize[_0xc647('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc647('0x1')]},'write':{'type':Sequelize[_0xc647('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index b38932b..bdd198f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b23=['findAll','rows','params','rawAttributes','includeAll','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','sort','pick','removeMembers','addMessage','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','save','update','then','error','name','send','index','ChatGroup','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','include'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6b23,0x195));var _0x36b2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x6b23[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0x36b2('0x0'));var rimraf=require(_0x36b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36b2('0x2'));var rp=require('request-promise');var moment=require(_0x36b2('0x3'));var BPromise=require(_0x36b2('0x4'));var Mustache=require(_0x36b2('0x5'));var util=require(_0x36b2('0x6'));var path=require(_0x36b2('0x7'));var sox=require(_0x36b2('0x8'));var csv=require(_0x36b2('0x9'));var ejs=require(_0x36b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36b2('0xb'));var squel=require(_0x36b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x36b2('0xd'));var toCsv=require(_0x36b2('0x9'));var querystring=require('querystring');var Papa=require(_0x36b2('0xe'));var Redis=require(_0x36b2('0xf'));var authService=require(_0x36b2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x36b2('0x11'));var hardwareService=require(_0x36b2('0x12'));var logger=require(_0x36b2('0x13'))(_0x36b2('0x14'));var utils=require('../../config/utils');var config=require(_0x36b2('0x15'));var licenseUtil=require(_0x36b2('0x16'));var db=require(_0x36b2('0x17'))['db'];config[_0x36b2('0x18')]=_[_0x36b2('0x19')](config[_0x36b2('0x18')],{'host':_0x36b2('0x1a'),'port':0x18eb});var socket=require(_0x36b2('0x1b'))(new Redis(config[_0x36b2('0x18')]));require(_0x36b2('0x1c'))['register'](socket);function respondWithStatusCode(_0x1bd6cf,_0x1c204e){_0x1c204e=_0x1c204e||0xcc;return function(_0x21785c){if(_0x21785c){return _0x1bd6cf[_0x36b2('0x1d')](_0x1c204e);}return _0x1bd6cf[_0x36b2('0x1e')](_0x1c204e)[_0x36b2('0x1f')]();};}function respondWithResult(_0x234087,_0xccd87b){_0xccd87b=_0xccd87b||0xc8;return function(_0xb162b3){if(_0xb162b3){return _0x234087[_0x36b2('0x1e')](_0xccd87b)['json'](_0xb162b3);}};}function respondWithFilteredResult(_0x2105e7,_0x476545){return function(_0x1e8580){if(_0x1e8580){var _0x83f591=typeof _0x476545['offset']===_0x36b2('0x20')&&typeof _0x476545[_0x36b2('0x21')]==='undefined';var _0x2292b6=_0x1e8580['count'];var _0x31924a=_0x83f591?0x0:_0x476545[_0x36b2('0x22')];var _0x497c99=_0x83f591?_0x1e8580[_0x36b2('0x23')]:_0x476545['offset']+_0x476545[_0x36b2('0x21')];var _0x1cab46;if(_0x497c99>=_0x2292b6){_0x497c99=_0x2292b6;_0x1cab46=0xc8;}else{_0x1cab46=0xce;}_0x2105e7[_0x36b2('0x1e')](_0x1cab46);return _0x2105e7[_0x36b2('0x24')]('Content-Range',_0x31924a+'-'+_0x497c99+'/'+_0x2292b6)[_0x36b2('0x25')](_0x1e8580);}return null;};}function patchUpdates(_0x55f49d){return function(_0x260e56){try{jsonpatch[_0x36b2('0x26')](_0x260e56,_0x55f49d,!![]);}catch(_0x3afe2e){return BPromise['reject'](_0x3afe2e);}return _0x260e56[_0x36b2('0x27')]();};}function saveUpdates(_0x261018,_0x35ad09){return function(_0x2af333){if(_0x2af333){return _0x2af333[_0x36b2('0x28')](_0x261018)['then'](function(_0x4b1491){return _0x4b1491;});}return null;};}function removeEntity(_0x5f004c,_0x4a6511){return function(_0xdd34bb){if(_0xdd34bb){return _0xdd34bb['destroy']()[_0x36b2('0x29')](function(){_0x5f004c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d9c5,_0x12cc58){return function(_0x3ff94d){if(!_0x3ff94d){_0x13d9c5[_0x36b2('0x1d')](0x194);}return _0x3ff94d;};}function handleError(_0x2156bb,_0xb19040){_0xb19040=_0xb19040||0x1f4;return function(_0x322348){logger[_0x36b2('0x2a')](_0x322348['stack']);if(_0x322348[_0x36b2('0x2b')]){delete _0x322348[_0x36b2('0x2b')];}_0x2156bb[_0x36b2('0x1e')](_0xb19040)[_0x36b2('0x2c')](_0x322348);};}exports[_0x36b2('0x2d')]=function(_0x2ffb81,_0x520e21){var _0x24be26={},_0x24b27d={},_0x1405d6={'count':0x0,'rows':[]};var _0x159e58=_['map'](db[_0x36b2('0x2e')]['rawAttributes'],function(_0x3de383){return{'name':_0x3de383['fieldName'],'type':_0x3de383[_0x36b2('0x2f')]['key']};});_0x24b27d[_0x36b2('0x30')]=_[_0x36b2('0x31')](_0x159e58,_0x36b2('0x2b'));_0x24b27d['query']=_[_0x36b2('0x32')](_0x2ffb81[_0x36b2('0x33')]);_0x24b27d[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x24b27d[_0x36b2('0x30')],_0x24b27d[_0x36b2('0x33')]);_0x24be26[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x24b27d[_0x36b2('0x30')],qs[_0x36b2('0x37')](_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x37')]));_0x24be26['attributes']=_0x24be26[_0x36b2('0x36')][_0x36b2('0x38')]?_0x24be26[_0x36b2('0x36')]:_0x24b27d[_0x36b2('0x30')];if(!_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x39')](_0x36b2('0x3a'))){_0x24be26['limit']=qs['limit'](_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x21')]);_0x24be26['offset']=qs[_0x36b2('0x22')](_0x2ffb81[_0x36b2('0x33')]['offset']);}_0x24be26['order']=qs['sort'](_0x2ffb81[_0x36b2('0x33')]['sort']);_0x24be26['where']=qs['filters'](_['pick'](_0x2ffb81[_0x36b2('0x33')],_0x24b27d[_0x36b2('0x34')]),_0x159e58);if(_0x2ffb81['query']['filter']){_0x24be26[_0x36b2('0x3b')]=_[_0x36b2('0x3c')](_0x24be26[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x159e58,function(_0x431ba8){if(_0x431ba8[_0x36b2('0x2f')]!==_0x36b2('0x3d')){var _0x2f8841={};_0x2f8841[_0x431ba8['name']]={'$like':'%'+_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x3e')]+'%'};return _0x2f8841;}})});}_0x24be26=_[_0x36b2('0x3c')]({},_0x24be26,_0x2ffb81[_0x36b2('0x3f')]);var _0x370376={'where':_0x24be26[_0x36b2('0x3b')]};return db[_0x36b2('0x2e')][_0x36b2('0x23')](_0x370376)[_0x36b2('0x29')](function(_0x49eeb0){_0x1405d6['count']=_0x49eeb0;if(_0x2ffb81[_0x36b2('0x33')]['includeAll']){_0x24be26[_0x36b2('0x40')]=[{'all':!![]}];}return db['ChatGroup'][_0x36b2('0x41')](_0x24be26);})[_0x36b2('0x29')](function(_0x227914){_0x1405d6[_0x36b2('0x42')]=_0x227914;return _0x1405d6;})[_0x36b2('0x29')](respondWithFilteredResult(_0x520e21,_0x24be26))['catch'](handleError(_0x520e21,null));};exports['show']=function(_0x29b7bd,_0x3ca730){var _0x2883dd={'raw':!![],'where':{'id':_0x29b7bd[_0x36b2('0x43')]['id']}},_0x1da3b1={};_0x1da3b1[_0x36b2('0x30')]=_[_0x36b2('0x32')](db[_0x36b2('0x2e')][_0x36b2('0x44')]);_0x1da3b1[_0x36b2('0x33')]=_['keys'](_0x29b7bd[_0x36b2('0x33')]);_0x1da3b1['filters']=_['intersection'](_0x1da3b1[_0x36b2('0x30')],_0x1da3b1[_0x36b2('0x33')]);_0x2883dd[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x1da3b1[_0x36b2('0x30')],qs['fields'](_0x29b7bd[_0x36b2('0x33')][_0x36b2('0x37')]));_0x2883dd[_0x36b2('0x36')]=_0x2883dd[_0x36b2('0x36')]['length']?_0x2883dd[_0x36b2('0x36')]:_0x1da3b1['model'];if(_0x29b7bd[_0x36b2('0x33')][_0x36b2('0x45')]){_0x2883dd[_0x36b2('0x40')]=[{'all':!![]}];}_0x2883dd=_[_0x36b2('0x3c')]({},_0x2883dd,_0x29b7bd[_0x36b2('0x3f')]);return db[_0x36b2('0x2e')][_0x36b2('0x46')](_0x2883dd)['then'](handleEntityNotFound(_0x3ca730,null))[_0x36b2('0x29')](respondWithResult(_0x3ca730,null))[_0x36b2('0x47')](handleError(_0x3ca730,null));};exports[_0x36b2('0x48')]=function(_0x947227,_0x40ac92){return db['ChatGroup'][_0x36b2('0x48')](_0x947227['body'],{})['then'](respondWithResult(_0x40ac92,0xc9))[_0x36b2('0x47')](handleError(_0x40ac92,null));};exports[_0x36b2('0x28')]=function(_0x1d973c,_0x9d8c33){if(_0x1d973c[_0x36b2('0x49')]['id']){delete _0x1d973c[_0x36b2('0x49')]['id'];}return db[_0x36b2('0x2e')]['find']({'where':{'id':_0x1d973c['params']['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x9d8c33,null))['then'](saveUpdates(_0x1d973c[_0x36b2('0x49')],null))[_0x36b2('0x29')](respondWithResult(_0x9d8c33,null))['catch'](handleError(_0x9d8c33,null));};exports['destroy']=function(_0x231aa9,_0x5c8dc1){return db[_0x36b2('0x2e')][_0x36b2('0x46')]({'where':{'id':_0x231aa9[_0x36b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c8dc1,null))[_0x36b2('0x29')](removeEntity(_0x5c8dc1,null))[_0x36b2('0x47')](handleError(_0x5c8dc1,null));};exports[_0x36b2('0x4a')]=function(_0x12619f,_0x185fe9){return db[_0x36b2('0x2e')][_0x36b2('0x4a')]()[_0x36b2('0x29')](respondWithResult(_0x185fe9,null))[_0x36b2('0x47')](handleError(_0x185fe9,null));};exports[_0x36b2('0x4b')]=function(_0x41493d,_0x18bed9,_0x3c07b2){return db[_0x36b2('0x4c')][_0x36b2('0x23')]({'where':{'ChatGroupId':_0x41493d[_0x36b2('0x43')]['id'],'ToId':_0x41493d[_0x36b2('0x4d')]['id'],'read':![]}})['then'](function(_0x4d4365){return{'id':_['toInteger'](_0x41493d['params']['id']),'count':_0x4d4365};})[_0x36b2('0x29')](respondWithResult(_0x18bed9,null))['catch'](handleError(_0x18bed9,null));};exports[_0x36b2('0x4e')]=function(_0x681067,_0x509b55,_0x32adde){return db[_0x36b2('0x2e')]['find']({'where':{'id':_0x681067[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x509b55,null))[_0x36b2('0x29')](function(_0xed42d6){if(_0xed42d6){return _0xed42d6[_0x36b2('0x4e')](_0x681067['body'][_0x36b2('0x4f')],_[_0x36b2('0x50')](_0x681067[_0x36b2('0x49')],[_0x36b2('0x4f'),'id'])||{});}})[_0x36b2('0x29')](respondWithResult(_0x509b55,null))[_0x36b2('0x47')](handleError(_0x509b55,null));};exports[_0x36b2('0x51')]=function(_0x1d8cb8,_0x564551,_0x55984d){var _0x27fa3e={};var _0x1f76ff={};var _0x360e8a;var _0x91b1ab;return db[_0x36b2('0x2e')][_0x36b2('0x52')]({'where':{'id':_0x1d8cb8['params']['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x564551,null))[_0x36b2('0x29')](function(_0x540dc4){if(_0x540dc4){_0x360e8a=_0x540dc4;_0x1f76ff['model']=_['keys'](db[_0x36b2('0x53')][_0x36b2('0x44')]);_0x1f76ff['query']=_[_0x36b2('0x32')](_0x1d8cb8[_0x36b2('0x33')]);_0x1f76ff[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x1f76ff['model'],_0x1f76ff[_0x36b2('0x33')]);_0x27fa3e[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x1f76ff[_0x36b2('0x30')],qs['fields'](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x37')]));_0x27fa3e[_0x36b2('0x36')]=_0x27fa3e['attributes'][_0x36b2('0x38')]?_0x27fa3e[_0x36b2('0x36')]:_0x1f76ff['model'];_0x27fa3e[_0x36b2('0x54')]=qs[_0x36b2('0x55')](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x55')]);_0x27fa3e['where']=qs[_0x36b2('0x34')](_[_0x36b2('0x56')](_0x1d8cb8[_0x36b2('0x33')],_0x1f76ff[_0x36b2('0x34')]));if(_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x3e')]){_0x27fa3e[_0x36b2('0x3b')]=_['merge'](_0x27fa3e[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x27fa3e[_0x36b2('0x36')],function(_0xa6a2f3){var _0x5c9d50={};_0x5c9d50[_0xa6a2f3]={'$like':'%'+_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x3e')]+'%'};return _0x5c9d50;})});}_0x27fa3e=_['merge']({},_0x27fa3e,_0x1d8cb8['options']);return _0x360e8a[_0x36b2('0x51')](_0x27fa3e);}})['then'](function(_0x2dd15f){if(_0x2dd15f){_0x91b1ab=_0x2dd15f[_0x36b2('0x38')];if(!_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x39')](_0x36b2('0x3a'))){_0x27fa3e[_0x36b2('0x21')]=qs[_0x36b2('0x21')](_0x1d8cb8['query'][_0x36b2('0x21')]);_0x27fa3e[_0x36b2('0x22')]=qs[_0x36b2('0x22')](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x22')]);}return _0x360e8a[_0x36b2('0x51')](_0x27fa3e);}})[_0x36b2('0x29')](function(_0x1b6b39){if(_0x1b6b39){return _0x1b6b39?{'count':_0x91b1ab,'rows':_0x1b6b39}:null;}})['then'](respondWithResult(_0x564551,null))['catch'](handleError(_0x564551,null));};exports[_0x36b2('0x57')]=function(_0x2ee5bf,_0x17166a,_0x5b78a){return db['ChatGroup'][_0x36b2('0x46')]({'where':{'id':_0x2ee5bf[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x17166a,null))[_0x36b2('0x29')](function(_0x422ebc){if(_0x422ebc){return _0x422ebc['removeMembers'](_0x2ee5bf[_0x36b2('0x33')][_0x36b2('0x4f')]);}})[_0x36b2('0x29')](respondWithStatusCode(_0x17166a,null))[_0x36b2('0x47')](handleError(_0x17166a,null));};exports[_0x36b2('0x58')]=function(_0x4acedc,_0x240d37,_0x4eacd3){if(_0x4acedc[_0x36b2('0x49')]['id']){delete _0x4acedc[_0x36b2('0x49')]['id'];}return db[_0x36b2('0x2e')][_0x36b2('0x46')]({'where':{'id':_0x4acedc[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x240d37,null))['then'](function(_0x2939bd){if(_0x2939bd){_0x4acedc[_0x36b2('0x49')][_0x36b2('0x59')]=_0x2939bd['id'];return db[_0x36b2('0x4c')][_0x36b2('0x48')](_0x4acedc[_0x36b2('0x49')]);}})[_0x36b2('0x29')](respondWithResult(_0x240d37,null))[_0x36b2('0x47')](handleError(_0x240d37,null));};exports['getMessages']=function(_0x384bf,_0x66539a,_0x1be255){var _0x14a1f7={};var _0x7c48a={};var _0x237743;var _0x5e2eac;return db[_0x36b2('0x2e')]['findOne']({'where':{'id':_0x384bf[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x66539a,null))[_0x36b2('0x29')](function(_0x4a37fd){if(_0x4a37fd){_0x237743=_0x4a37fd;_0x7c48a[_0x36b2('0x30')]=_[_0x36b2('0x32')](db[_0x36b2('0x4c')][_0x36b2('0x44')]);_0x7c48a[_0x36b2('0x33')]=_['keys'](_0x384bf[_0x36b2('0x33')]);_0x7c48a[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x7c48a['model'],_0x7c48a[_0x36b2('0x33')]);_0x14a1f7[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x7c48a['model'],qs[_0x36b2('0x37')](_0x384bf['query'][_0x36b2('0x37')]));_0x14a1f7['attributes']=_0x14a1f7[_0x36b2('0x36')]['length']?_0x14a1f7[_0x36b2('0x36')]:_0x7c48a[_0x36b2('0x30')];_0x14a1f7['order']=qs[_0x36b2('0x55')](_0x384bf['query'][_0x36b2('0x55')]);_0x14a1f7[_0x36b2('0x3b')]=qs[_0x36b2('0x34')](_[_0x36b2('0x56')](_0x384bf[_0x36b2('0x33')],_0x7c48a[_0x36b2('0x34')]));if(_0x384bf[_0x36b2('0x33')][_0x36b2('0x3e')]){_0x14a1f7[_0x36b2('0x3b')]=_['merge'](_0x14a1f7[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x14a1f7[_0x36b2('0x36')],function(_0x38a95a){var _0x5a635f={};_0x5a635f[_0x38a95a]={'$like':'%'+_0x384bf[_0x36b2('0x33')]['filter']+'%'};return _0x5a635f;})});}if(_0x384bf['query'][_0x36b2('0x5a')]){var _0x328ab9=_0x384bf[_0x36b2('0x33')][_0x36b2('0x5a')][_0x36b2('0x5b')](',');var _0x3274d1={};_0x3274d1[_0x328ab9[0x0]]={'$gte':moment(_0x328ab9[0x1])['format'](_0x36b2('0x5c'))};_0x14a1f7['where']=_[_0x36b2('0x3c')](_0x14a1f7[_0x36b2('0x3b')],_0x3274d1);}_0x14a1f7=_[_0x36b2('0x3c')]({},_0x14a1f7,_0x384bf['options']);return _0x237743[_0x36b2('0x5d')](_0x14a1f7);}})['then'](function(_0x131ed5){if(_0x131ed5){_0x5e2eac=_0x131ed5[_0x36b2('0x38')];if(!_0x384bf[_0x36b2('0x33')][_0x36b2('0x39')]('nolimit')){_0x14a1f7['limit']=qs[_0x36b2('0x21')](_0x384bf[_0x36b2('0x33')][_0x36b2('0x21')]);_0x14a1f7[_0x36b2('0x22')]=qs[_0x36b2('0x22')](_0x384bf[_0x36b2('0x33')][_0x36b2('0x22')]);}return _0x237743[_0x36b2('0x5d')](_0x14a1f7);}})[_0x36b2('0x29')](function(_0x840470){if(_0x840470){return _0x840470?{'count':_0x5e2eac,'rows':_0x840470}:null;}})[_0x36b2('0x29')](respondWithResult(_0x66539a,null))[_0x36b2('0x47')](handleError(_0x66539a,null));};
\ No newline at end of file
+var _0xfa7f=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatGroup','include','rows','show','params','rawAttributes','includeAll','find','create','body','describe','catch','getUnread','ChatInternalMessage','addMembers','ids','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xfa7f,0xef));var _0xffa7=function(_0x3cec41,_0x2ef3c6){_0x3cec41=_0x3cec41-0x0;var _0x2bf49d=_0xfa7f[_0x3cec41];return _0x2bf49d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffa7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffa7('0x1'));var rp=require(_0xffa7('0x2'));var moment=require('moment');var BPromise=require(_0xffa7('0x3'));var Mustache=require(_0xffa7('0x4'));var util=require(_0xffa7('0x5'));var path=require(_0xffa7('0x6'));var sox=require('sox');var csv=require(_0xffa7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffa7('0x8'));var _=require(_0xffa7('0x9'));var squel=require(_0xffa7('0xa'));var crypto=require(_0xffa7('0xb'));var jsforce=require(_0xffa7('0xc'));var deskjs=require(_0xffa7('0xd'));var toCsv=require(_0xffa7('0x7'));var querystring=require(_0xffa7('0xe'));var Papa=require('papaparse');var Redis=require(_0xffa7('0xf'));var authService=require(_0xffa7('0x10'));var qs=require(_0xffa7('0x11'));var as=require(_0xffa7('0x12'));var hardwareService=require(_0xffa7('0x13'));var logger=require(_0xffa7('0x14'))(_0xffa7('0x15'));var utils=require(_0xffa7('0x16'));var config=require(_0xffa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffa7('0x18'))['db'];config[_0xffa7('0x19')]=_[_0xffa7('0x1a')](config[_0xffa7('0x19')],{'host':_0xffa7('0x1b'),'port':0x18eb});var socket=require(_0xffa7('0x1c'))(new Redis(config[_0xffa7('0x19')]));require(_0xffa7('0x1d'))[_0xffa7('0x1e')](socket);function respondWithStatusCode(_0x45b312,_0x2bf1de){_0x2bf1de=_0x2bf1de||0xcc;return function(_0x5e2aa4){if(_0x5e2aa4){return _0x45b312['sendStatus'](_0x2bf1de);}return _0x45b312[_0xffa7('0x1f')](_0x2bf1de)[_0xffa7('0x20')]();};}function respondWithResult(_0x2bda7a,_0x4323e6){_0x4323e6=_0x4323e6||0xc8;return function(_0x13586d){if(_0x13586d){return _0x2bda7a[_0xffa7('0x1f')](_0x4323e6)['json'](_0x13586d);}};}function respondWithFilteredResult(_0x4a48f6,_0x2cdfb7){return function(_0x54fccc){if(_0x54fccc){var _0x39550d=typeof _0x2cdfb7[_0xffa7('0x21')]===_0xffa7('0x22')&&typeof _0x2cdfb7['limit']==='undefined';var _0xba1209=_0x54fccc[_0xffa7('0x23')];var _0x584d17=_0x39550d?0x0:_0x2cdfb7[_0xffa7('0x21')];var _0x1a28a0=_0x39550d?_0x54fccc[_0xffa7('0x23')]:_0x2cdfb7[_0xffa7('0x21')]+_0x2cdfb7[_0xffa7('0x24')];var _0x551a5f;if(_0x1a28a0>=_0xba1209){_0x1a28a0=_0xba1209;_0x551a5f=0xc8;}else{_0x551a5f=0xce;}_0x4a48f6[_0xffa7('0x1f')](_0x551a5f);return _0x4a48f6[_0xffa7('0x25')](_0xffa7('0x26'),_0x584d17+'-'+_0x1a28a0+'/'+_0xba1209)[_0xffa7('0x27')](_0x54fccc);}return null;};}function patchUpdates(_0x161be4){return function(_0x33f5c1){try{jsonpatch[_0xffa7('0x28')](_0x33f5c1,_0x161be4,!![]);}catch(_0x3ab06b){return BPromise[_0xffa7('0x29')](_0x3ab06b);}return _0x33f5c1[_0xffa7('0x2a')]();};}function saveUpdates(_0x4e8ac5,_0x1cbd4a){return function(_0x464bfb){if(_0x464bfb){return _0x464bfb[_0xffa7('0x2b')](_0x4e8ac5)[_0xffa7('0x2c')](function(_0x4d0758){return _0x4d0758;});}return null;};}function removeEntity(_0x6f890c,_0x3ff39e){return function(_0x535356){if(_0x535356){return _0x535356[_0xffa7('0x2d')]()[_0xffa7('0x2c')](function(){_0x6f890c['status'](0xcc)[_0xffa7('0x20')]();});}};}function handleEntityNotFound(_0x534eba,_0x4f943a){return function(_0xdb1175){if(!_0xdb1175){_0x534eba[_0xffa7('0x2e')](0x194);}return _0xdb1175;};}function handleError(_0x34dab3,_0x189e6c){_0x189e6c=_0x189e6c||0x1f4;return function(_0x4383a8){logger[_0xffa7('0x2f')](_0x4383a8[_0xffa7('0x30')]);if(_0x4383a8[_0xffa7('0x31')]){delete _0x4383a8[_0xffa7('0x31')];}_0x34dab3[_0xffa7('0x1f')](_0x189e6c)[_0xffa7('0x32')](_0x4383a8);};}exports['index']=function(_0x2d733a,_0x522866){var _0x429169={},_0x2b7831={},_0x15ee6d={'count':0x0,'rows':[]};var _0x5c0f88=_[_0xffa7('0x33')](db['ChatGroup']['rawAttributes'],function(_0x1592ba){return{'name':_0x1592ba[_0xffa7('0x34')],'type':_0x1592ba[_0xffa7('0x35')]['key']};});_0x2b7831[_0xffa7('0x36')]=_[_0xffa7('0x33')](_0x5c0f88,'name');_0x2b7831[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x2d733a[_0xffa7('0x37')]);_0x2b7831[_0xffa7('0x39')]=_[_0xffa7('0x3a')](_0x2b7831[_0xffa7('0x36')],_0x2b7831['query']);_0x429169[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x2b7831[_0xffa7('0x36')],qs[_0xffa7('0x3c')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x3c')]));_0x429169[_0xffa7('0x3b')]=_0x429169[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x429169[_0xffa7('0x3b')]:_0x2b7831[_0xffa7('0x36')];if(!_0x2d733a[_0xffa7('0x37')]['hasOwnProperty'](_0xffa7('0x3e'))){_0x429169['limit']=qs[_0xffa7('0x24')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x24')]);_0x429169[_0xffa7('0x21')]=qs[_0xffa7('0x21')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x21')]);}_0x429169[_0xffa7('0x3f')]=qs[_0xffa7('0x40')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x40')]);_0x429169[_0xffa7('0x41')]=qs['filters'](_[_0xffa7('0x42')](_0x2d733a['query'],_0x2b7831[_0xffa7('0x39')]),_0x5c0f88);if(_0x2d733a[_0xffa7('0x37')][_0xffa7('0x43')]){_0x429169['where']=_[_0xffa7('0x44')](_0x429169['where'],{'$or':_[_0xffa7('0x33')](_0x5c0f88,function(_0x20c215){if(_0x20c215[_0xffa7('0x35')]!=='VIRTUAL'){var _0x45759e={};_0x45759e[_0x20c215[_0xffa7('0x31')]]={'$like':'%'+_0x2d733a[_0xffa7('0x37')]['filter']+'%'};return _0x45759e;}})});}_0x429169=_[_0xffa7('0x44')]({},_0x429169,_0x2d733a[_0xffa7('0x45')]);var _0x36f915={'where':_0x429169[_0xffa7('0x41')]};return db[_0xffa7('0x46')][_0xffa7('0x23')](_0x36f915)[_0xffa7('0x2c')](function(_0x31b2d5){_0x15ee6d[_0xffa7('0x23')]=_0x31b2d5;if(_0x2d733a[_0xffa7('0x37')]['includeAll']){_0x429169[_0xffa7('0x47')]=[{'all':!![]}];}return db[_0xffa7('0x46')]['findAll'](_0x429169);})['then'](function(_0x555293){_0x15ee6d[_0xffa7('0x48')]=_0x555293;return _0x15ee6d;})[_0xffa7('0x2c')](respondWithFilteredResult(_0x522866,_0x429169))['catch'](handleError(_0x522866,null));};exports[_0xffa7('0x49')]=function(_0x31bd89,_0x3f268e){var _0x514ec3={'raw':!![],'where':{'id':_0x31bd89[_0xffa7('0x4a')]['id']}},_0x215eac={};_0x215eac[_0xffa7('0x36')]=_[_0xffa7('0x38')](db['ChatGroup'][_0xffa7('0x4b')]);_0x215eac[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x31bd89[_0xffa7('0x37')]);_0x215eac['filters']=_[_0xffa7('0x3a')](_0x215eac['model'],_0x215eac[_0xffa7('0x37')]);_0x514ec3[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x215eac[_0xffa7('0x36')],qs['fields'](_0x31bd89[_0xffa7('0x37')]['fields']));_0x514ec3[_0xffa7('0x3b')]=_0x514ec3[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x514ec3[_0xffa7('0x3b')]:_0x215eac[_0xffa7('0x36')];if(_0x31bd89[_0xffa7('0x37')][_0xffa7('0x4c')]){_0x514ec3[_0xffa7('0x47')]=[{'all':!![]}];}_0x514ec3=_[_0xffa7('0x44')]({},_0x514ec3,_0x31bd89[_0xffa7('0x45')]);return db[_0xffa7('0x46')][_0xffa7('0x4d')](_0x514ec3)[_0xffa7('0x2c')](handleEntityNotFound(_0x3f268e,null))[_0xffa7('0x2c')](respondWithResult(_0x3f268e,null))['catch'](handleError(_0x3f268e,null));};exports['create']=function(_0x28e3fe,_0xe0a2d){return db[_0xffa7('0x46')][_0xffa7('0x4e')](_0x28e3fe['body'],{})['then'](respondWithResult(_0xe0a2d,0xc9))['catch'](handleError(_0xe0a2d,null));};exports['update']=function(_0x3c3c3d,_0x27d344){if(_0x3c3c3d[_0xffa7('0x4f')]['id']){delete _0x3c3c3d['body']['id'];}return db[_0xffa7('0x46')][_0xffa7('0x4d')]({'where':{'id':_0x3c3c3d[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x27d344,null))[_0xffa7('0x2c')](saveUpdates(_0x3c3c3d[_0xffa7('0x4f')],null))[_0xffa7('0x2c')](respondWithResult(_0x27d344,null))['catch'](handleError(_0x27d344,null));};exports['destroy']=function(_0x5c627b,_0x1011a9){return db[_0xffa7('0x46')]['find']({'where':{'id':_0x5c627b[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x1011a9,null))[_0xffa7('0x2c')](removeEntity(_0x1011a9,null))['catch'](handleError(_0x1011a9,null));};exports[_0xffa7('0x50')]=function(_0x418852,_0x23ad56){return db[_0xffa7('0x46')][_0xffa7('0x50')]()[_0xffa7('0x2c')](respondWithResult(_0x23ad56,null))[_0xffa7('0x51')](handleError(_0x23ad56,null));};exports[_0xffa7('0x52')]=function(_0x3c591a,_0x4b6d22,_0x19223b){return db[_0xffa7('0x53')][_0xffa7('0x23')]({'where':{'ChatGroupId':_0x3c591a[_0xffa7('0x4a')]['id'],'ToId':_0x3c591a['user']['id'],'read':![]}})['then'](function(_0x28addb){return{'id':_['toInteger'](_0x3c591a[_0xffa7('0x4a')]['id']),'count':_0x28addb};})['then'](respondWithResult(_0x4b6d22,null))['catch'](handleError(_0x4b6d22,null));};exports[_0xffa7('0x54')]=function(_0x14a021,_0x429fd2,_0x5a77be){return db['ChatGroup'][_0xffa7('0x4d')]({'where':{'id':_0x14a021['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x429fd2,null))[_0xffa7('0x2c')](function(_0x419d72){if(_0x419d72){return _0x419d72['addMembers'](_0x14a021[_0xffa7('0x4f')][_0xffa7('0x55')],_['omit'](_0x14a021[_0xffa7('0x4f')],[_0xffa7('0x55'),'id'])||{});}})[_0xffa7('0x2c')](respondWithResult(_0x429fd2,null))[_0xffa7('0x51')](handleError(_0x429fd2,null));};exports[_0xffa7('0x56')]=function(_0x22c532,_0x4dcc17,_0x4d2f78){var _0x5708fd={};var _0x170c64={};var _0x5d66bd;var _0x2737f7;return db['ChatGroup']['findOne']({'where':{'id':_0x22c532[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x4dcc17,null))[_0xffa7('0x2c')](function(_0x6e352){if(_0x6e352){_0x5d66bd=_0x6e352;_0x170c64[_0xffa7('0x36')]=_[_0xffa7('0x38')](db[_0xffa7('0x57')][_0xffa7('0x4b')]);_0x170c64[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x22c532[_0xffa7('0x37')]);_0x170c64[_0xffa7('0x39')]=_[_0xffa7('0x3a')](_0x170c64[_0xffa7('0x36')],_0x170c64[_0xffa7('0x37')]);_0x5708fd[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x170c64[_0xffa7('0x36')],qs['fields'](_0x22c532[_0xffa7('0x37')][_0xffa7('0x3c')]));_0x5708fd['attributes']=_0x5708fd[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x5708fd['attributes']:_0x170c64[_0xffa7('0x36')];_0x5708fd[_0xffa7('0x3f')]=qs[_0xffa7('0x40')](_0x22c532[_0xffa7('0x37')]['sort']);_0x5708fd[_0xffa7('0x41')]=qs['filters'](_[_0xffa7('0x42')](_0x22c532['query'],_0x170c64[_0xffa7('0x39')]));if(_0x22c532[_0xffa7('0x37')][_0xffa7('0x43')]){_0x5708fd[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x5708fd[_0xffa7('0x41')],{'$or':_[_0xffa7('0x33')](_0x5708fd[_0xffa7('0x3b')],function(_0x14e779){var _0x2277e8={};_0x2277e8[_0x14e779]={'$like':'%'+_0x22c532[_0xffa7('0x37')][_0xffa7('0x43')]+'%'};return _0x2277e8;})});}_0x5708fd=_[_0xffa7('0x44')]({},_0x5708fd,_0x22c532[_0xffa7('0x45')]);return _0x5d66bd['getMembers'](_0x5708fd);}})[_0xffa7('0x2c')](function(_0x19e6fe){if(_0x19e6fe){_0x2737f7=_0x19e6fe['length'];if(!_0x22c532[_0xffa7('0x37')][_0xffa7('0x58')]('nolimit')){_0x5708fd[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x22c532[_0xffa7('0x37')][_0xffa7('0x24')]);_0x5708fd['offset']=qs['offset'](_0x22c532[_0xffa7('0x37')][_0xffa7('0x21')]);}return _0x5d66bd['getMembers'](_0x5708fd);}})[_0xffa7('0x2c')](function(_0x5f268d){if(_0x5f268d){return _0x5f268d?{'count':_0x2737f7,'rows':_0x5f268d}:null;}})[_0xffa7('0x2c')](respondWithResult(_0x4dcc17,null))[_0xffa7('0x51')](handleError(_0x4dcc17,null));};exports[_0xffa7('0x59')]=function(_0x22615a,_0x14fd25,_0x18314e){return db[_0xffa7('0x46')]['find']({'where':{'id':_0x22615a[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x14fd25,null))['then'](function(_0x1f83d4){if(_0x1f83d4){return _0x1f83d4[_0xffa7('0x59')](_0x22615a[_0xffa7('0x37')]['ids']);}})[_0xffa7('0x2c')](respondWithStatusCode(_0x14fd25,null))[_0xffa7('0x51')](handleError(_0x14fd25,null));};exports[_0xffa7('0x5a')]=function(_0x314dcf,_0x2e5be5,_0x410b29){if(_0x314dcf['body']['id']){delete _0x314dcf[_0xffa7('0x4f')]['id'];}return db['ChatGroup'][_0xffa7('0x4d')]({'where':{'id':_0x314dcf['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x2e5be5,null))[_0xffa7('0x2c')](function(_0x290a16){if(_0x290a16){_0x314dcf['body'][_0xffa7('0x5b')]=_0x290a16['id'];return db[_0xffa7('0x53')][_0xffa7('0x4e')](_0x314dcf[_0xffa7('0x4f')]);}})[_0xffa7('0x2c')](respondWithResult(_0x2e5be5,null))[_0xffa7('0x51')](handleError(_0x2e5be5,null));};exports[_0xffa7('0x5c')]=function(_0x196753,_0x5d1751,_0x5fc38d){var _0x3fc535={};var _0x579f51={};var _0x42a07a;var _0x22c4ad;return db[_0xffa7('0x46')][_0xffa7('0x5d')]({'where':{'id':_0x196753['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x5d1751,null))[_0xffa7('0x2c')](function(_0x151b4e){if(_0x151b4e){_0x42a07a=_0x151b4e;_0x579f51[_0xffa7('0x36')]=_[_0xffa7('0x38')](db[_0xffa7('0x53')][_0xffa7('0x4b')]);_0x579f51['query']=_[_0xffa7('0x38')](_0x196753[_0xffa7('0x37')]);_0x579f51[_0xffa7('0x39')]=_['intersection'](_0x579f51['model'],_0x579f51[_0xffa7('0x37')]);_0x3fc535['attributes']=_[_0xffa7('0x3a')](_0x579f51['model'],qs['fields'](_0x196753[_0xffa7('0x37')]['fields']));_0x3fc535[_0xffa7('0x3b')]=_0x3fc535[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x3fc535[_0xffa7('0x3b')]:_0x579f51['model'];_0x3fc535['order']=qs['sort'](_0x196753[_0xffa7('0x37')][_0xffa7('0x40')]);_0x3fc535['where']=qs[_0xffa7('0x39')](_['pick'](_0x196753[_0xffa7('0x37')],_0x579f51[_0xffa7('0x39')]));if(_0x196753['query'][_0xffa7('0x43')]){_0x3fc535[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x3fc535[_0xffa7('0x41')],{'$or':_[_0xffa7('0x33')](_0x3fc535[_0xffa7('0x3b')],function(_0x178042){var _0xf8d725={};_0xf8d725[_0x178042]={'$like':'%'+_0x196753[_0xffa7('0x37')][_0xffa7('0x43')]+'%'};return _0xf8d725;})});}if(_0x196753['query'][_0xffa7('0x5e')]){var _0x1f5e8f=_0x196753['query'][_0xffa7('0x5e')][_0xffa7('0x5f')](',');var _0x318904={};_0x318904[_0x1f5e8f[0x0]]={'$gte':moment(_0x1f5e8f[0x1])[_0xffa7('0x60')](_0xffa7('0x61'))};_0x3fc535[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x3fc535[_0xffa7('0x41')],_0x318904);}_0x3fc535=_[_0xffa7('0x44')]({},_0x3fc535,_0x196753[_0xffa7('0x45')]);return _0x42a07a[_0xffa7('0x5c')](_0x3fc535);}})[_0xffa7('0x2c')](function(_0x2155cf){if(_0x2155cf){_0x22c4ad=_0x2155cf[_0xffa7('0x3d')];if(!_0x196753[_0xffa7('0x37')][_0xffa7('0x58')](_0xffa7('0x3e'))){_0x3fc535['limit']=qs[_0xffa7('0x24')](_0x196753[_0xffa7('0x37')][_0xffa7('0x24')]);_0x3fc535[_0xffa7('0x21')]=qs[_0xffa7('0x21')](_0x196753['query']['offset']);}return _0x42a07a['getMessages'](_0x3fc535);}})[_0xffa7('0x2c')](function(_0x3ff5a8){if(_0x3ff5a8){return _0x3ff5a8?{'count':_0x22c4ad,'rows':_0x3ff5a8}:null;}})[_0xffa7('0x2c')](respondWithResult(_0x5d1751,null))[_0xffa7('0x51')](handleError(_0x5d1751,null));};
\ No newline at end of file
index 436a074..8836c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd1b=['exports','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f2624,_0xb969ca){var _0x5be3e5=function(_0x14dfce){while(--_0x14dfce){_0x5f2624['push'](_0x5f2624['shift']());}};_0x5be3e5(++_0xb969ca);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x1392d7,_0x520a68){_0x1392d7=_0x1392d7-0x0;var _0xefc815=_0xfd1b[_0x1392d7];return _0xefc815;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xbfd1('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbfd1('0x1')](0x0);var events={'afterCreate':_0xbfd1('0x2'),'afterUpdate':_0xbfd1('0x3'),'afterDestroy':_0xbfd1('0x4')};function emitEvent(_0x5cc4e8){return function(_0x2adfea,_0x40f31b,_0x2236c4){ChatGroupEvents['emit'](_0x5cc4e8+':'+_0x2adfea['id'],_0x2adfea);ChatGroupEvents[_0xbfd1('0x5')](_0x5cc4e8,_0x2adfea);_0x2236c4(null);};}for(var e in events){if(events[_0xbfd1('0x6')](e)){var event=events[e];ChatGroup[_0xbfd1('0x7')](e,emitEvent(event));}}module[_0xbfd1('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3411=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x477d04,_0x2ff6ce){var _0x219e68=function(_0x9250ee){while(--_0x9250ee){_0x477d04['push'](_0x477d04['shift']());}};_0x219e68(++_0x2ff6ce);}(_0x3411,0x105));var _0x1341=function(_0x1b2299,_0x4809d3){_0x1b2299=_0x1b2299-0x0;var _0x5c2f59=_0x3411[_0x1b2299];return _0x5c2f59;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1341('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1341('0x1')](0x0);var events={'afterCreate':_0x1341('0x2'),'afterUpdate':_0x1341('0x3'),'afterDestroy':_0x1341('0x4')};function emitEvent(_0x2d327f){return function(_0xef6224,_0x538672,_0x23b08a){ChatGroupEvents['emit'](_0x2d327f+':'+_0xef6224['id'],_0xef6224);ChatGroupEvents[_0x1341('0x5')](_0x2d327f,_0xef6224);_0x23b08a(null);};}for(var e in events){if(events[_0x1341('0x6')](e)){var event=events[e];ChatGroup[_0x1341('0x7')](e,emitEvent(event));}}module[_0x1341('0x8')]=ChatGroupEvents;
\ No newline at end of file
index d09a93a..a8b0859 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a8d=['moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x3b0e60,_0x3e3056){var _0x20c751=function(_0x46bcb3){while(--_0x46bcb3){_0x3b0e60['push'](_0x3b0e60['shift']());}};_0x20c751(++_0x3e3056);}(_0x6a8d,0x1cd));var _0xd6a8=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x6a8d[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xd6a8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd6a8('0x1'));var BPromise=require(_0xd6a8('0x2'));var rp=require(_0xd6a8('0x3'));var fs=require('fs');var path=require(_0xd6a8('0x4'));var rimraf=require('rimraf');var config=require(_0xd6a8('0x5'));var attributes=require(_0xd6a8('0x6'));module[_0xd6a8('0x7')]=function(_0x548d80,_0x5c4b04){return _0x548d80[_0xd6a8('0x8')](_0xd6a8('0x9'),attributes,{'tableName':_0xd6a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14a9=['moment','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x7bf42f,_0x291528){var _0x3ecfe4=function(_0xabaf19){while(--_0xabaf19){_0x7bf42f['push'](_0x7bf42f['shift']());}};_0x3ecfe4(++_0x291528);}(_0x14a9,0xef));var _0x914a=function(_0x25be49,_0x47c0f6){_0x25be49=_0x25be49-0x0;var _0x5bf8ac=_0x14a9[_0x25be49];return _0x5bf8ac;};'use strict';var _=require(_0x914a('0x0'));var util=require(_0x914a('0x1'));var logger=require(_0x914a('0x2'))('api');var moment=require(_0x914a('0x3'));var BPromise=require('bluebird');var rp=require(_0x914a('0x4'));var fs=require('fs');var path=require(_0x914a('0x5'));var rimraf=require(_0x914a('0x6'));var config=require('../../config/environment');var attributes=require(_0x914a('0x7'));module['exports']=function(_0x2ea3bb,_0x24400f){return _0x2ea3bb[_0x914a('0x8')](_0x914a('0x9'),attributes,{'tableName':_0x914a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9304699..d116954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x867f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4f1919,_0x31c629){var _0x34f1b2=function(_0x2ce324){while(--_0x2ce324){_0x4f1919['push'](_0x4f1919['shift']());}};_0x34f1b2(++_0x31c629);}(_0x867f,0x7f));var _0xf867=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0x867f[_0x577077];return _0x370769;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf867('0x7'));var jayson=require(_0xf867('0x8'));var client=jayson[_0xf867('0x9')][_0xf867('0xa')]({'port':0x232a});config['redis']=_[_0xf867('0xb')](config[_0xf867('0xc')],{'host':_0xf867('0xd'),'port':0x18eb});var socket=require(_0xf867('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xf867('0xf')](socket);function respondWithRpcPromise(_0x2e25bf,_0x46d754,_0x4d9c51){return new BPromise(function(_0x25699a,_0x4b4e3b){return client[_0xf867('0x10')](_0x2e25bf,_0x4d9c51)[_0xf867('0x11')](function(_0x57cb41){logger['info'](_0xf867('0x12'),_0x46d754,_0xf867('0x13'));logger[_0xf867('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x46d754,_0xf867('0x13'),JSON[_0xf867('0x15')](_0x57cb41));if(_0x57cb41[_0xf867('0x16')]){if(_0x57cb41[_0xf867('0x16')][_0xf867('0x17')]===0x1f4){logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x57cb41[_0xf867('0x16')]['message']);return _0x4b4e3b(_0x57cb41[_0xf867('0x16')]['message']);}logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x57cb41[_0xf867('0x16')][_0xf867('0x18')]);return _0x25699a(_0x57cb41['error'][_0xf867('0x18')]);}else{logger['info'](_0xf867('0x12'),_0x46d754,'request\x20sent');_0x25699a(_0x57cb41[_0xf867('0x19')][_0xf867('0x18')]);}})['catch'](function(_0x91a392){logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x91a392);_0x4b4e3b(_0x91a392);});});}
\ No newline at end of file
+var _0xec46=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0xec46,0x19c));var _0x6ec4=function(_0x473d1e,_0x4df799){_0x473d1e=_0x473d1e-0x0;var _0x503be9=_0xec46[_0x473d1e];return _0x503be9;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});config['redis']=_[_0x6ec4('0xa')](config[_0x6ec4('0xb')],{'host':_0x6ec4('0xc'),'port':0x18eb});var socket=require(_0x6ec4('0xd'))(new Redis(config[_0x6ec4('0xb')]));require(_0x6ec4('0xe'))[_0x6ec4('0xf')](socket);function respondWithRpcPromise(_0x164b81,_0x5e8746,_0x259d07){return new BPromise(function(_0xe51f56,_0x47bfaa){return client['request'](_0x164b81,_0x259d07)[_0x6ec4('0x10')](function(_0x45f738){logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));logger['debug'](_0x6ec4('0x13'),_0x5e8746,'request\x20sent',JSON[_0x6ec4('0x14')](_0x45f738));if(_0x45f738[_0x6ec4('0x15')]){if(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x16')]===0x1f4){logger[_0x6ec4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0x47bfaa(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0xe51f56(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}else{logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));_0xe51f56(_0x45f738['result']['message']);}})[_0x6ec4('0x19')](function(_0x49594b){logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x49594b);_0x47bfaa(_0x49594b);});});}
\ No newline at end of file
index e9585fb..0924715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969c=['register','length','chatGroup:','save','remove','update','emit','removeListener'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x969c,0x123));var _0xc969=function(_0x2477c9,_0x156618){_0x2477c9=_0x2477c9-0x0;var _0x2b2791=_0x969c[_0x2477c9];return _0x2b2791;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc969('0x0'),_0xc969('0x1'),_0xc969('0x2')];function createListener(_0x367463,_0x4b135d){return function(_0x652060){_0x4b135d[_0xc969('0x3')](_0x367463,_0x652060);};}function removeListener(_0x4c4d10,_0x3aaeda){return function(){ChatGroupEvents[_0xc969('0x4')](_0x4c4d10,_0x3aaeda);};}exports[_0xc969('0x5')]=function(_0x2fcc46){for(var _0x5b3632=0x0,_0x23ed1a=events[_0xc969('0x6')];_0x5b3632<_0x23ed1a;_0x5b3632++){var _0x2c5e0b=events[_0x5b3632];var _0x3b3313=createListener(_0xc969('0x7')+_0x2c5e0b,_0x2fcc46);ChatGroupEvents['on'](_0x2c5e0b,_0x3b3313);}};
\ No newline at end of file
+var _0x9314=['length','chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register'];(function(_0x36ee93,_0x502135){var _0x2a936c=function(_0xb6659c){while(--_0xb6659c){_0x36ee93['push'](_0x36ee93['shift']());}};_0x2a936c(++_0x502135);}(_0x9314,0xb2));var _0x4931=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9314[_0x13b02f];return _0x12e9a6;};'use strict';var ChatGroupEvents=require(_0x4931('0x0'));var events=['save',_0x4931('0x1'),_0x4931('0x2')];function createListener(_0x10ba23,_0x3d71b2){return function(_0x2312b5){_0x3d71b2[_0x4931('0x3')](_0x10ba23,_0x2312b5);};}function removeListener(_0xa382d7,_0x3f057f){return function(){ChatGroupEvents[_0x4931('0x4')](_0xa382d7,_0x3f057f);};}exports[_0x4931('0x5')]=function(_0x5766f9){for(var _0x3710d0=0x0,_0x22feb5=events[_0x4931('0x6')];_0x3710d0<_0x22feb5;_0x3710d0++){var _0x44df73=events[_0x3710d0];var _0x2ca31f=createListener(_0x4931('0x7')+_0x44df73,_0x5766f9);ChatGroupEvents['on'](_0x44df73,_0x2ca31f);}};
\ No newline at end of file
index b5d5686..a6fa7b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de2=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3de2,0x137));var _0x23de=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3de2[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x23de('0x0'));var util=require(_0x23de('0x1'));var path=require(_0x23de('0x2'));var timeout=require(_0x23de('0x3'));var express=require(_0x23de('0x4'));var router=express[_0x23de('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23de('0x6'));var interaction=require(_0x23de('0x7'));var config=require(_0x23de('0x8'));var controller=require('./chatGroup.controller');router[_0x23de('0x9')]('/',auth[_0x23de('0xa')](),controller[_0x23de('0xb')]);router[_0x23de('0x9')]('/describe',auth[_0x23de('0xa')](),controller[_0x23de('0xc')]);router[_0x23de('0x9')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0xe')]);router[_0x23de('0x9')](_0x23de('0xf'),auth[_0x23de('0xa')](),controller[_0x23de('0x10')]);router['get'](_0x23de('0x11'),auth['isAuthenticated'](),controller[_0x23de('0x12')]);router[_0x23de('0x9')](_0x23de('0x13'),auth['isAuthenticated'](),controller[_0x23de('0x14')]);router[_0x23de('0x15')]('/',auth['isAuthenticated'](),controller[_0x23de('0x16')]);router[_0x23de('0x15')](_0x23de('0x11'),auth[_0x23de('0xa')](),controller[_0x23de('0x17')]);router['post'](_0x23de('0x13'),auth[_0x23de('0xa')](),controller['addMessage']);router[_0x23de('0x18')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0x19')]);router[_0x23de('0x1a')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0x1b')]);router['delete'](_0x23de('0x11'),auth[_0x23de('0xa')](),controller['removeMembers']);module[_0x23de('0x1c')]=router;
\ No newline at end of file
+var _0x5e50=['destroy','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update'];(function(_0x4afa93,_0x2dccc9){var _0x365be7=function(_0x360c06){while(--_0x360c06){_0x4afa93['push'](_0x4afa93['shift']());}};_0x365be7(++_0x2dccc9);}(_0x5e50,0xb8));var _0x05e5=function(_0x11c3cb,_0x555982){_0x11c3cb=_0x11c3cb-0x0;var _0x14428f=_0x5e50[_0x11c3cb];return _0x14428f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x05e5('0x0'));var express=require(_0x05e5('0x1'));var router=express[_0x05e5('0x2')]();var fs_extra=require(_0x05e5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x05e5('0x4'));var config=require(_0x05e5('0x5'));var controller=require(_0x05e5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x05e5('0x7')]);router[_0x05e5('0x8')](_0x05e5('0x9'),auth[_0x05e5('0xa')](),controller[_0x05e5('0xb')]);router['get'](_0x05e5('0xc'),auth['isAuthenticated'](),controller[_0x05e5('0xd')]);router[_0x05e5('0x8')](_0x05e5('0xe'),auth[_0x05e5('0xa')](),controller['getUnread']);router[_0x05e5('0x8')](_0x05e5('0xf'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x10')]);router['get']('/:id/messages',auth[_0x05e5('0xa')](),controller[_0x05e5('0x11')]);router[_0x05e5('0x12')]('/',auth[_0x05e5('0xa')](),controller[_0x05e5('0x13')]);router[_0x05e5('0x12')]('/:id/members',auth[_0x05e5('0xa')](),controller['addMembers']);router[_0x05e5('0x12')](_0x05e5('0x14'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x15')]);router[_0x05e5('0x16')](_0x05e5('0xc'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x17')]);router['delete'](_0x05e5('0xc'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x18')]);router[_0x05e5('0x19')]('/:id/members',auth[_0x05e5('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index 29bef91..83a152f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0f=['INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out','exports','BOOLEAN'];(function(_0x2421e1,_0x44afaa){var _0x44f3f0=function(_0x4f9990){while(--_0x4f9990){_0x2421e1['push'](_0x2421e1['shift']());}};_0x44f3f0(++_0x44afaa);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x18db4d,_0x381bb1){_0x18db4d=_0x18db4d-0x0;var _0x132535=_0x4b0f[_0x18db4d];return _0x132535;};'use strict';var Sequelize=require('sequelize');module[_0xf4b0('0x0')]={'closed':{'type':Sequelize[_0xf4b0('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf4b0('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xf4b0('0x3'),_0xf4b0('0x4')),'defaultValue':_0xf4b0('0x3')},'ratingMessage':{'type':Sequelize[_0xf4b0('0x5')]},'pathTranscript':{'type':Sequelize[_0xf4b0('0x5')]},'mailTranscript':{'type':Sequelize[_0xf4b0('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf4b0('0x7')]},'disposition':{'type':Sequelize[_0xf4b0('0x6')]},'secondDisposition':{'type':Sequelize[_0xf4b0('0x6')]},'thirdDisposition':{'type':Sequelize[_0xf4b0('0x6')]},'note':{'type':Sequelize[_0xf4b0('0x6')]},'browserName':{'type':Sequelize[_0xf4b0('0x6')]},'browserVersion':{'type':Sequelize[_0xf4b0('0x6')]},'osName':{'type':Sequelize[_0xf4b0('0x6')]},'osVersion':{'type':Sequelize[_0xf4b0('0x6')]},'deviceModel':{'type':Sequelize[_0xf4b0('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf4b0('0x6')]},'referer':{'type':Sequelize[_0xf4b0('0x5')]},'customerIp':{'type':Sequelize[_0xf4b0('0x6')]},'formData':{'type':Sequelize[_0xf4b0('0x5')](_0xf4b0('0x8'))},'read1stAt':{'type':Sequelize[_0xf4b0('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf4b0('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf4b0('0x9')]('in',_0xf4b0('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf4b0('0x6')]},'customerPort':{'type':Sequelize[_0xf4b0('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xf4b0('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xf4b0('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9ffd=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x3f8781,_0x28822f){var _0x55fc61=function(_0x187796){while(--_0x187796){_0x3f8781['push'](_0x3f8781['shift']());}};_0x55fc61(++_0x28822f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56ba7b,_0x967c00){_0x56ba7b=_0x56ba7b-0x0;var _0x4ac606=_0x9ffd[_0x56ba7b];return _0x4ac606;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'closed':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd9ff('0x3')](_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd9ff('0x6')]},'mailTranscript':{'type':Sequelize[_0xd9ff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd9ff('0x7')]},'secondDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'note':{'type':Sequelize[_0xd9ff('0x7')]},'browserName':{'type':Sequelize[_0xd9ff('0x7')]},'browserVersion':{'type':Sequelize[_0xd9ff('0x7')]},'osName':{'type':Sequelize[_0xd9ff('0x7')]},'osVersion':{'type':Sequelize[_0xd9ff('0x7')]},'deviceModel':{'type':Sequelize[_0xd9ff('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd9ff('0x6')](_0xd9ff('0x8'))},'read1stAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xd9ff('0x3')]('in',_0xd9ff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd9ff('0x7')]},'customerPort':{'type':Sequelize[_0xd9ff('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 0c50ab1..750151c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3237=['server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','render','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','catch','create','body','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ContactId','System','customer','%s%d','agentAlias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','nolimit','includeAgent','addTags','setTags','Tag','color','emit','removeTags'];(function(_0x542ab0,_0x4f10d5){var _0x165baa=function(_0x1dfe33){while(--_0x1dfe33){_0x542ab0['push'](_0x542ab0['shift']());}};_0x165baa(++_0x4f10d5);}(_0x3237,0x1d5));var _0x7323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3237[_0x4cf98e];return _0x1623ac;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x7323('0x0'));var rp=require(_0x7323('0x1'));var moment=require(_0x7323('0x2'));var BPromise=require(_0x7323('0x3'));var Mustache=require(_0x7323('0x4'));var util=require(_0x7323('0x5'));var path=require(_0x7323('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7323('0x7'));var Redis=require('ioredis');var interaction=require(_0x7323('0x8'));var qs=require(_0x7323('0x9'));var pdf=require(_0x7323('0xa'));var logger=require(_0x7323('0xb'))(_0x7323('0xc'));var config=require(_0x7323('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7323('0xe')](config[_0x7323('0xf')],{'host':_0x7323('0x10'),'port':0x18eb});var socket=require(_0x7323('0x11'))(new Redis(config['redis']));require(_0x7323('0x12'))[_0x7323('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7323('0x14')][_0x7323('0x15')]({'port':0x232b});var client9004=jayson[_0x7323('0x14')]['http']({'port':0x232c});function respondWithRpcPromise(_0x21c10d,_0x385f86,_0x4529a3,_0x471771){return new BPromise(function(_0x46d48d,_0xc9c921){var _0x8dec00=_0x471771||client;return _0x8dec00['request'](_0x21c10d,_0x4529a3)['then'](function(_0x24d799){logger[_0x7323('0x16')](_0x7323('0x17'),_0x385f86,_0x7323('0x18'));logger[_0x7323('0x19')](_0x7323('0x1a'),_0x385f86,'request\x20sent',JSON['stringify'](_0x24d799));if(_0x24d799['error']){if(_0x24d799[_0x7323('0x1b')][_0x7323('0x1c')]===0x1f4){logger[_0x7323('0x1b')](_0x7323('0x17'),_0x385f86,_0x24d799[_0x7323('0x1b')]['message']);return _0xc9c921(_0x24d799[_0x7323('0x1b')][_0x7323('0x1d')]);}logger[_0x7323('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x385f86,_0x24d799['error'][_0x7323('0x1d')]);return _0x46d48d(_0x24d799[_0x7323('0x1b')][_0x7323('0x1d')]);}else{logger[_0x7323('0x16')](_0x7323('0x17'),_0x385f86,_0x7323('0x18'));_0x46d48d(_0x24d799[_0x7323('0x1e')][_0x7323('0x1d')]);}})['catch'](function(_0x5e9acc){logger[_0x7323('0x1b')](_0x7323('0x17'),_0x385f86,_0x5e9acc);_0xc9c921(_0x5e9acc);});});}function respondWithStatusCode(_0x3f77e9,_0x2170a6){_0x2170a6=_0x2170a6||0xcc;return function(_0x492161){if(_0x492161){return _0x3f77e9['sendStatus'](_0x2170a6);}return _0x3f77e9['status'](_0x2170a6)[_0x7323('0x1f')]();};}function respondWithResult(_0x590038,_0x3671b4){_0x3671b4=_0x3671b4||0xc8;return function(_0x4bb2e2){if(_0x4bb2e2){return _0x590038[_0x7323('0x20')](_0x3671b4)[_0x7323('0x21')](_0x4bb2e2);}};}function respondWithFilteredResult(_0x444a78,_0x1f3156){return function(_0x4d55a5){if(_0x4d55a5){var _0x230358=typeof _0x1f3156[_0x7323('0x22')]===_0x7323('0x23')&&typeof _0x1f3156[_0x7323('0x24')]===_0x7323('0x23');var _0x236d3d=_0x4d55a5[_0x7323('0x25')];var _0x48a93a=_0x230358?0x0:_0x1f3156[_0x7323('0x22')];var _0x323d20=_0x230358?_0x4d55a5['count']:_0x1f3156[_0x7323('0x22')]+_0x1f3156[_0x7323('0x24')];var _0x42ad8d;if(_0x323d20>=_0x236d3d){_0x323d20=_0x236d3d;_0x42ad8d=0xc8;}else{_0x42ad8d=0xce;}_0x444a78[_0x7323('0x20')](_0x42ad8d);return _0x444a78[_0x7323('0x26')](_0x7323('0x27'),_0x48a93a+'-'+_0x323d20+'/'+_0x236d3d)[_0x7323('0x21')](_0x4d55a5);}return null;};}function saveUpdates(_0x533d83){return function(_0xf70958){if(_0xf70958){return _0xf70958[_0x7323('0x28')](_0x533d83)[_0x7323('0x29')](function(_0x20645b){return _0x20645b;});}return null;};}function removeEntity(_0x5832bf){return function(_0x1f0c36){if(_0x1f0c36){return _0x1f0c36[_0x7323('0x2a')]()[_0x7323('0x29')](function(){_0x5832bf[_0x7323('0x20')](0xcc)[_0x7323('0x1f')]();});}};}function handleEntityNotFound(_0x1be7c0){return function(_0x184446){if(!_0x184446){_0x1be7c0[_0x7323('0x2b')](0x194);}return _0x184446;};}function handleError(_0xd5377a,_0x32a72f){_0x32a72f=_0x32a72f||0x1f4;return function(_0x24b07d){logger[_0x7323('0x1b')](_0x24b07d[_0x7323('0x2c')]);if(_0x24b07d['name']){delete _0x24b07d[_0x7323('0x2d')];}_0xd5377a[_0x7323('0x20')](_0x32a72f)[_0x7323('0x2e')](_0x24b07d);};}function getMustacheRender(_0x350e3b,_0x2c43bf){return Mustache[_0x7323('0x2f')](_0x350e3b,_['merge'](_0x2c43bf['body'],{'contact':_0x2c43bf['contact'],'message':_0x2c43bf[_0x7323('0x1d')],'agent':_0x2c43bf[_0x7323('0x30')],'interaction':_0x2c43bf['interaction'],'account':_0x2c43bf[_0x7323('0x31')]}))||'';}exports[_0x7323('0x32')]=function(_0x3d60e1,_0x3b33ed){var _0x5e2f11={};var _0x3be911=_[_0x7323('0x33')](db[_0x7323('0x34')][_0x7323('0x35')],function(_0x4a1a9b){return{'name':_0x4a1a9b[_0x7323('0x36')],'type':_0x4a1a9b[_0x7323('0x37')][_0x7323('0x38')]};});_0x5e2f11=qs[_0x7323('0x39')](_0x3be911,_0x3d60e1);return interaction[_0x7323('0x3a')](_0x7323('0x3b'),_0x3d60e1['query'],_0x3d60e1[_0x7323('0x3c')],_0x5e2f11,_0x3be911)[_0x7323('0x29')](respondWithFilteredResult(_0x3b33ed,_0x5e2f11))['catch'](handleError(_0x3b33ed,null));};exports[_0x7323('0x3d')]=function(_0x5b66b3,_0x4fe9ee){var _0x1ead7a={'raw':![],'where':{'id':_0x5b66b3[_0x7323('0x3e')]['id']}},_0x2dda0d={};_0x2dda0d[_0x7323('0x3f')]=_['keys'](db['ChatInteraction'][_0x7323('0x35')]);_0x2dda0d['query']=_[_0x7323('0x40')](_0x5b66b3[_0x7323('0x41')]);_0x2dda0d[_0x7323('0x42')]=_['intersection'](_0x2dda0d[_0x7323('0x3f')],_0x2dda0d[_0x7323('0x41')]);_0x1ead7a[_0x7323('0x43')]=_[_0x7323('0x44')](_0x2dda0d[_0x7323('0x3f')],qs[_0x7323('0x45')](_0x5b66b3['query'][_0x7323('0x45')]));_0x1ead7a[_0x7323('0x43')]=_0x1ead7a[_0x7323('0x43')][_0x7323('0x46')]?_0x1ead7a[_0x7323('0x43')]:_0x2dda0d['model'];if(_0x5b66b3['query'][_0x7323('0x47')]){_0x1ead7a[_0x7323('0x48')]=[{'all':!![]}];}_0x1ead7a=_[_0x7323('0x49')]({},_0x1ead7a,_0x5b66b3['options']);return db[_0x7323('0x34')]['find'](_0x1ead7a)['then'](handleEntityNotFound(_0x4fe9ee,null))['then'](respondWithResult(_0x4fe9ee,null))[_0x7323('0x4a')](handleError(_0x4fe9ee,null));};exports[_0x7323('0x4b')]=function(_0x1e0484,_0x324d66){return db[_0x7323('0x34')][_0x7323('0x4b')](_0x1e0484[_0x7323('0x4c')],{})['then'](respondWithResult(_0x324d66,0xc9))[_0x7323('0x4a')](handleError(_0x324d66,null));};exports['update']=function(_0x457755,_0x9ef049){if(_0x457755[_0x7323('0x4c')]['id']){delete _0x457755[_0x7323('0x4c')]['id'];}return db[_0x7323('0x34')]['find']({'where':{'id':_0x457755[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x9ef049,null))['then'](saveUpdates(_0x457755[_0x7323('0x4c')],null))[_0x7323('0x29')](respondWithResult(_0x9ef049,null))[_0x7323('0x4a')](handleError(_0x9ef049,null));};exports[_0x7323('0x2a')]=function(_0x51b5d9,_0xba8325){return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x51b5d9['params']['id']}})[_0x7323('0x29')](handleEntityNotFound(_0xba8325,null))[_0x7323('0x29')](removeEntity(_0xba8325,null))[_0x7323('0x4a')](handleError(_0xba8325,null));};exports[_0x7323('0x4e')]=function(_0x275282,_0x110f2f){return db[_0x7323('0x34')][_0x7323('0x4e')]()[_0x7323('0x29')](respondWithResult(_0x110f2f,null))[_0x7323('0x4a')](handleError(_0x110f2f,null));};exports[_0x7323('0x4f')]=function(_0x5e8733,_0x2c35a8){var _0x37cd10=_0x5e8733[_0x7323('0x3e')]['id'];var _0x4296b1;var _0x30cb49;var _0x201a15;return db[_0x7323('0x34')]['findOne']({'where':{'id':_0x37cd10}})[_0x7323('0x29')](function(_0x5c5cc7){_0x4296b1=_0x5c5cc7;return db[_0x7323('0x50')][_0x7323('0x51')]({'where':{'id':_0x5c5cc7[_0x7323('0x52')]},'attributes':['id',_0x7323('0x53'),_0x7323('0x54'),_0x7323('0x55'),_0x7323('0x56'),_0x7323('0x57')],'raw':!![]});})[_0x7323('0x29')](function(_0x3874f5){if(_0x3874f5&&_0x3874f5[_0x7323('0x53')]&&_0x3874f5[_0x7323('0x54')]){_0x30cb49=_0x3874f5;var _0x6ee38c={'interaction':{'id':_0x37cd10},'agent':{'id':_0x5e8733[_0x7323('0x3c')]['id'],'name':_0x5e8733[_0x7323('0x3c')]['name'],'fullname':_0x5e8733['user'][_0x7323('0x58')],'email':_0x5e8733[_0x7323('0x3c')][_0x7323('0x59')]},'contact':_0x5e8733[_0x7323('0x4c')][_0x7323('0x5a')],'account':_0x5e8733[_0x7323('0x4c')][_0x7323('0x31')]};var _0x4822ca={'rejectUnauthorized':![],'method':_0x7323('0x5b'),'url':_0x7323('0x5c'),'headers':{'X-APIKEY':_0x3874f5[_0x7323('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e8733[_0x7323('0x3c')][_0x7323('0x59')]],'buttons':null,'topic':_0x30cb49[_0x7323('0x55')],'note':_[_0x7323('0x5d')](_0x30cb49[_0x7323('0x56')])?null:getMustacheRender(_0x30cb49['vidaooNote'],_0x6ee38c),'metadata':null},'redirect':_0x7323('0x5e'),'json':!![]};try{if(!_['isNull'](_0x30cb49[_0x7323('0x57')])){var _0x52e10e=getMustacheRender(_0x30cb49['vidaooMetadata'],_0x6ee38c);var _0x973268=JSON[_0x7323('0x5f')](_0x52e10e);_0x4822ca[_0x7323('0x4c')][_0x7323('0x60')]=_0x973268;}}catch(_0x4daf96){throw new db['Sequelize']['ValidationError'](_0x7323('0x61'));}return rp(_0x4822ca);}else{throw new db[(_0x7323('0x62'))][(_0x7323('0x63'))](_0x7323('0x64'));}})[_0x7323('0x29')](function(_0x14f45c){_0x201a15=_0x14f45c;if(_0x201a15['id']){var _0x3bb397={'body':_0x201a15['join_url'],'ChatWebsiteId':_0x30cb49['id'],'ChatInteractionId':_0x4296b1['id'],'direction':_0x7323('0x65'),'UserId':_0x5e8733['user']['id']};return db['ChatMessage'][_0x7323('0x4b')](_0x3bb397,{});}else{throw new db['Sequelize']['ValidationError'](_0x7323('0x66'));}})[_0x7323('0x29')](function(){return _0x4296b1['updateAttributes']({'vidaooSessionId':_0x201a15['id']});})[_0x7323('0x29')](respondWithResult(_0x2c35a8,null))[_0x7323('0x4a')](handleError(_0x2c35a8,null));};exports[_0x7323('0x67')]=function(_0x2f90bd,_0x9ce7f7){if(_0x2f90bd[_0x7323('0x4c')]['id']){delete _0x2f90bd[_0x7323('0x4c')]['id'];}return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x2f90bd[_0x7323('0x3e')]['id']},'include':[{'model':db[_0x7323('0x68')],'as':_0x7323('0x69')}]})[_0x7323('0x29')](handleEntityNotFound(_0x9ce7f7,null))[_0x7323('0x29')](saveUpdates(_0x2f90bd[_0x7323('0x4c')],null))[_0x7323('0x29')](respondWithResult(_0x9ce7f7,null))[_0x7323('0x4a')](handleError(_0x9ce7f7,null));};exports[_0x7323('0x6a')]=function(_0x3558f7,_0x4f64a3){if(_0x3558f7['body']['id']){delete _0x3558f7[_0x7323('0x4c')]['id'];}return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x3558f7[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](function(_0x556bda){if(!_0x556bda){logger[_0x7323('0x1b')](_0x7323('0x6b'),_0x7323('0x6a'),0x194,_0x7323('0x6c'));_0x4f64a3[_0x7323('0x2b')](0x194);}else{if(_0x556bda[_0x7323('0x6d')]){throw new db[(_0x7323('0x62'))][(_0x7323('0x63'))](_0x7323('0x6e'));}}return _0x556bda;})['then'](function(_0x566ac5){if(_0x566ac5){return _0x566ac5['update']({'closed':_0x3558f7[_0x7323('0x4c')][_0x7323('0x6f')],'disposition':_0x3558f7[_0x7323('0x4c')][_0x7323('0x70')]})['then'](function(_0x17f9d1){return _0x17f9d1;});}})[_0x7323('0x29')](function(){return respondWithRpcPromise(_0x7323('0x71'),_0x7323('0x6a'),_0x3558f7[_0x7323('0x4c')],client9004);})['then'](respondWithResult(_0x4f64a3,null))['catch'](handleError(_0x4f64a3,null));};exports[_0x7323('0x72')]=function(_0x41e7eb,_0x2546e8){_0x41e7eb[_0x7323('0x4c')]['name']=_0x41e7eb[_0x7323('0x73')][_0x7323('0x74')];_0x41e7eb[_0x7323('0x4c')]['basename']=_0x41e7eb['file'][_0x7323('0x75')];_0x41e7eb[_0x7323('0x4c')]['type']=_0x41e7eb[_0x7323('0x73')][_0x7323('0x76')];return db[_0x7323('0x77')]['create'](_0x41e7eb[_0x7323('0x4c')])['then'](respondWithResult(_0x2546e8,0xc9))['catch'](handleError(_0x2546e8,null));};exports[_0x7323('0x78')]=function(_0x5b0d27,_0x43c913){return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x5b0d27[_0x7323('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43c913,null))[_0x7323('0x29')](function(_0x49f03d){if(_0x49f03d){if(_0x49f03d[_0x7323('0x6f')]){return _0x43c913[_0x7323('0x20')](0x193)[_0x7323('0x21')]({'status':0x193,'message':'Unauthorized'});}return db[_0x7323('0x77')]['findOne']({'where':{'id':_0x5b0d27[_0x7323('0x41')]['attachId']},'raw':!![]})[_0x7323('0x29')](handleEntityNotFound(_0x43c913,null));}})['then'](function(_0x1f7050){if(_0x1f7050){var _0x164e79=_0x1f7050['ChatOfflineMessageId']!==null;var _0x36a1f6=path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0x7b'));if(_0x164e79){_0x36a1f6=path[_0x7323('0x79')](_0x36a1f6,_0x7323('0x7c'));}var _0x2d8530=path[_0x7323('0x79')](_0x36a1f6,_0x1f7050[_0x7323('0x7d')]);return _0x43c913[_0x7323('0x7e')](_0x2d8530);}})[_0x7323('0x4a')](handleError(_0x43c913,null));};exports[_0x7323('0x7f')]=function(_0x1a1a81,_0x2c5141){var _0x5dfad6=null;var _0xee2372=null;var _0x2d7e04=null;if(_0x1a1a81[_0x7323('0x4c')]['id']){delete _0x1a1a81[_0x7323('0x4c')]['id'];}if(_0x1a1a81[_0x7323('0x4c')][_0x7323('0x80')]){_0x2d7e04=path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0x81'),util[_0x7323('0x82')](_0x7323('0x83'),Date[_0x7323('0x84')]()));_0x1a1a81['body'][_0x7323('0x85')]=_0x2d7e04;}return db[_0x7323('0x34')][_0x7323('0x4d')]({'where':{'id':_0x1a1a81[_0x7323('0x3e')]['id']},'include':[{'model':db[_0x7323('0x86')],'as':_0x7323('0x87'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x7323('0x29')](handleEntityNotFound(_0x2c5141,null))[_0x7323('0x29')](saveUpdates(_0x1a1a81['body'],null))[_0x7323('0x29')](function(_0x36de3b){if(_0x36de3b){_0x5dfad6=_0x36de3b;return db[_0x7323('0x50')][_0x7323('0x4d')]({'where':{'id':_0x5dfad6['ChatWebsiteId']}});}})['then'](function(_0x34e6fc){if(_0x34e6fc){_0xee2372=_0x34e6fc;return db[_0x7323('0x68')][_0x7323('0x4d')]({'where':{'id':_0x5dfad6[_0x7323('0x88')]}});}})[_0x7323('0x29')](function(_0xd8da4d){if(_0xd8da4d){if(_0x2d7e04){var _0x5ad78c=null;for(var _0x32903c=0x1;_0x32903c<_0x5dfad6[_0x7323('0x87')]['length'];++_0x32903c){_0x5ad78c=_0x5dfad6[_0x7323('0x87')][_0x32903c];var _0x4161bc=_0x5ad78c['UserId']?util['format']('%s%d',_0xee2372['agentAlias'],_0x5ad78c[_0x7323('0x6d')]):_0x7323('0x89');var _0x19bb05=_0x1a1a81['body'][_0x7323('0x8a')]||util['format'](_0x7323('0x8b'),'Visitor',_0x5ad78c[_0x7323('0x88')]);switch(_0xee2372['agentIdentifier']){case'website_alias':_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?util['format'](_0x7323('0x8b'),_0xee2372[_0x7323('0x8c')],_0x5ad78c['UserId']):_0x7323('0x89');break;case _0x7323('0x8d'):_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?_0x5ad78c[_0x7323('0x8e')][_0x7323('0x8f')]||_0x5ad78c['User'][_0x7323('0x58')]:_0x7323('0x89');break;case _0x7323('0x90'):_0x4161bc=_0x5ad78c['UserId']?_0x5ad78c[_0x7323('0x8e')][_0x7323('0x58')]:_0x7323('0x89');break;default:_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?util['format'](_0x7323('0x8b'),_0xee2372[_0x7323('0x8c')],_0x5ad78c[_0x7323('0x6d')]):_0x7323('0x89');}var _0x1fbe64=util[_0x7323('0x82')](_0x7323('0x91'),moment(_0x5ad78c[_0x7323('0x92')])[_0x7323('0x82')](_0x7323('0x93')),_0x5ad78c['direction']==='in'?_0x19bb05:_0x4161bc,_0x5ad78c[_0x7323('0x4c')]);if(!_0x5ad78c[_0x7323('0x94')]){fs[_0x7323('0x95')](_0x2d7e04,_0x1fbe64);}}return db[_0x7323('0x96')][_0x7323('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0x7323('0x97')],'as':_0x7323('0x98'),'raw':!![],'include':[{'model':db[_0x7323('0x99')],'as':_0x7323('0x99'),'raw':!![]}]}]});}}})['then'](function(_0xb563ee){if(!_0xb563ee||!_0xb563ee[_0x7323('0x98')]||!_0x1a1a81[_0x7323('0x4c')])return _0x5dfad6;var _0x1bcf2c=_0xb563ee[_0x7323('0x9a')]();return respondWithRpcPromise(_0x7323('0x9b'),'sendMail',{'account':_0x1bcf2c,'message':{'from':util[_0x7323('0x82')](_0x7323('0x9c'),_0xb563ee[_0x7323('0x2d')],_0xb563ee[_0x7323('0x59')]||_0xb563ee[_0x7323('0x98')][_0x7323('0x3c')]),'to':_0x1a1a81['body'][_0x7323('0x80')],'subject':_0x7323('0x9d'),'text':util[_0x7323('0x82')](_0x7323('0x9e'),_0x1a1a81['body'][_0x7323('0x80')]),'attachments':[{'path':_0x2d7e04}]}})[_0x7323('0x29')](function(){return _0x5dfad6;})[_0x7323('0x4a')](function(_0x42fc3d){logger[_0x7323('0x1b')](_0x42fc3d);});})[_0x7323('0x29')](respondWithStatusCode(_0x2c5141,0xc8))[_0x7323('0x4a')](handleError(_0x2c5141,null));};exports['addMessage']=function(_0x1a008f,_0x196c99){return db[_0x7323('0x86')][_0x7323('0x4d')]({'where':{'id':_0x1a008f['params']['id']}})['then'](handleEntityNotFound(_0x196c99,null))[_0x7323('0x29')](function(_0x37eb38){if(_0x37eb38){return _0x37eb38[_0x7323('0x9f')](_0x1a008f[_0x7323('0x4c')][_0x7323('0xa0')],_[_0x7323('0xa1')](_0x1a008f[_0x7323('0x4c')],[_0x7323('0xa0'),'id'])||{});}})[_0x7323('0x29')](respondWithResult(_0x196c99,null))[_0x7323('0x4a')](handleError(_0x196c99,null));};exports['getMessages']=function(_0x1482c7,_0x151c0a){var _0x1b04a2={'raw':![],'where':{}};var _0x92616d={};var _0x4e6d16={'count':0x0,'rows':[]};return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x1482c7[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x151c0a,null))[_0x7323('0x29')](function(_0x2d7ff7){if(_0x2d7ff7){_0x92616d['model']=_[_0x7323('0x40')](db['ChatMessage']['rawAttributes']);_0x92616d[_0x7323('0x41')]=_[_0x7323('0x40')](_0x1482c7[_0x7323('0x41')]);_0x92616d[_0x7323('0x42')]=_['intersection'](_0x92616d[_0x7323('0x3f')],_0x92616d[_0x7323('0x41')]);_0x1b04a2['attributes']=_[_0x7323('0x44')](_0x92616d[_0x7323('0x3f')],qs['fields'](_0x1482c7[_0x7323('0x41')]['fields']));_0x1b04a2[_0x7323('0x43')]=_0x1b04a2[_0x7323('0x43')][_0x7323('0x46')]?_0x1b04a2[_0x7323('0x43')]:_0x92616d[_0x7323('0x3f')];if(!_0x1482c7[_0x7323('0x41')][_0x7323('0xa2')]('nolimit')){_0x1b04a2['limit']=qs[_0x7323('0x24')](_0x1482c7[_0x7323('0x41')][_0x7323('0x24')]);_0x1b04a2[_0x7323('0x22')]=qs[_0x7323('0x22')](_0x1482c7['query'][_0x7323('0x22')]);}_0x1b04a2[_0x7323('0xa3')]=qs[_0x7323('0xa4')](_0x1482c7['query']['sort']);_0x1b04a2[_0x7323('0xa5')]=qs[_0x7323('0x42')](_[_0x7323('0xa6')](_0x1482c7[_0x7323('0x41')],_0x92616d[_0x7323('0x42')]));_0x1b04a2[_0x7323('0xa5')][_0x7323('0xa7')]=_0x2d7ff7['id'];if(_0x1482c7[_0x7323('0x41')]['filter']){_0x1b04a2[_0x7323('0xa5')]=_[_0x7323('0x49')](_0x1b04a2['where'],{'$or':_['map'](_0x1b04a2[_0x7323('0x43')],function(_0x37dd3b){var _0x400989={};_0x400989[_0x37dd3b]={'$like':'%'+_0x1482c7['query'][_0x7323('0xa8')]+'%'};return _0x400989;})});}if(_0x1482c7[_0x7323('0x41')][_0x7323('0xa9')]){var _0x22fe2b=_0x1482c7[_0x7323('0x41')][_0x7323('0xa9')]['split'](',');var _0x386b48={};_0x386b48[_0x22fe2b[0x0]]={'$gte':moment(_0x22fe2b[0x1])[_0x7323('0x82')](_0x7323('0xaa'))};_0x1b04a2[_0x7323('0xa5')]=_[_0x7323('0x49')](_0x1b04a2[_0x7323('0xa5')],_0x386b48);}_0x1b04a2=_['merge']({},_0x1b04a2,_0x1482c7[_0x7323('0xab')]);return db[_0x7323('0x86')][_0x7323('0x25')]({'where':_0x1b04a2[_0x7323('0xa5')]})['then'](function(_0x489f2e){_0x4e6d16[_0x7323('0x25')]=_0x489f2e;if(_0x1482c7[_0x7323('0x41')]['includeAll']){_0x1b04a2[_0x7323('0x48')]=[{'all':!![]}];}return db[_0x7323('0x86')][_0x7323('0x3a')](_0x1b04a2);})[_0x7323('0x29')](function(_0x2ddd1d){_0x4e6d16[_0x7323('0xac')]=_0x2ddd1d;return _0x4e6d16;});}})[_0x7323('0x29')](respondWithFilteredResult(_0x151c0a,_0x1b04a2))[_0x7323('0x4a')](handleError(_0x151c0a,null));};exports[_0x7323('0xad')]=function(_0x252404,_0x349e38){var _0x433c16={'where':{}},_0xb3aae7={},_0x1ba542={'count':0x0,'rows':[]};return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x252404[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x349e38,null))['then'](function(_0x13df43){if(_0x13df43){_0xb3aae7['model']=_[_0x7323('0x40')](db['ChatMessage']['rawAttributes']);_0xb3aae7[_0x7323('0x41')]=_['keys'](_0x252404[_0x7323('0x41')]);_0xb3aae7['filters']=_['intersection'](_0xb3aae7[_0x7323('0x3f')],_0xb3aae7['query']);_0x433c16['attributes']=_[_0x7323('0x44')](_0xb3aae7['model'],qs[_0x7323('0x45')](_0x252404[_0x7323('0x41')]['fields']));_0x433c16[_0x7323('0x43')]=_0x433c16[_0x7323('0x43')][_0x7323('0x46')]?_0x433c16[_0x7323('0x43')]:_0xb3aae7['model'];if(!_0x252404[_0x7323('0x41')][_0x7323('0xa2')](_0x7323('0xae'))){_0x433c16[_0x7323('0x24')]=qs['limit'](_0x252404[_0x7323('0x41')][_0x7323('0x24')]);_0x433c16[_0x7323('0x22')]=qs[_0x7323('0x22')](_0x252404[_0x7323('0x41')][_0x7323('0x22')]);}_0x433c16[_0x7323('0xa3')]=qs[_0x7323('0xa4')](_0x252404[_0x7323('0x41')][_0x7323('0xa4')]);_0x433c16[_0x7323('0xa5')]=qs[_0x7323('0x42')](_['pick'](_0x252404[_0x7323('0x41')],_0xb3aae7[_0x7323('0x42')]));_0x433c16[_0x7323('0xa5')][_0x7323('0xa7')]=_0x13df43['id'];if(_0x252404[_0x7323('0x41')]['filter']){_0x433c16['where']=_[_0x7323('0x49')](_0x433c16[_0x7323('0xa5')],{'$or':_[_0x7323('0x33')](_0x433c16[_0x7323('0x43')],function(_0x3c3c27){var _0x40a7d8={};_0x40a7d8[_0x3c3c27]={'$like':'%'+_0x252404[_0x7323('0x41')][_0x7323('0xa8')]+'%'};return _0x40a7d8;})});}_0x433c16[_0x7323('0xa5')][_0x7323('0x94')]=![];if(_0x252404[_0x7323('0x41')]['id']){_0x433c16[_0x7323('0xa5')]['id']={'$gt':_0x252404[_0x7323('0x41')]['id']};}_0x433c16=_[_0x7323('0x49')]({},_0x433c16,_0x252404[_0x7323('0xab')]);return db[_0x7323('0x86')]['count']({'where':_0x433c16['where']})['then'](function(_0x5aef75){_0x1ba542[_0x7323('0x25')]=_0x5aef75;_0x433c16[_0x7323('0x48')]=[];if(_0x252404[_0x7323('0x41')][_0x7323('0xaf')]){_0x433c16[_0x7323('0x48')]['push']({'model':db[_0x7323('0x8e')],'as':'User','attributes':['id',_0x7323('0x58'),_0x7323('0x8f')]});}if(_0x252404[_0x7323('0x41')][_0x7323('0x47')]){_0x433c16[_0x7323('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x7323('0x3a')](_0x433c16);})['then'](function(_0x2bdda6){_0x1ba542[_0x7323('0xac')]=_0x2bdda6;return _0x1ba542;});}})[_0x7323('0x29')](respondWithFilteredResult(_0x349e38,_0x433c16))[_0x7323('0x4a')](handleError(_0x349e38,null));};exports[_0x7323('0xb0')]=function(_0x5608e3,_0x27063f){return db['ChatInteraction']['find']({'where':{'id':_0x5608e3[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x27063f,null))[_0x7323('0x29')](function(_0x4b21f1){if(_0x4b21f1){return _0x4b21f1[_0x7323('0xb1')](_0x5608e3[_0x7323('0x4c')][_0x7323('0xa0')],_[_0x7323('0xa1')](_0x5608e3[_0x7323('0x4c')],[_0x7323('0xa0'),'id'])||{})['spread'](function(){return db[_0x7323('0xb2')][_0x7323('0x3a')]({'attributes':['id',_0x7323('0x2d'),_0x7323('0xb3')],'where':{'id':_0x5608e3[_0x7323('0x4c')][_0x7323('0xa0')]}});})[_0x7323('0x29')](function(_0xfa854f){socket[_0x7323('0xb4')]('chatInteractionTags:save',{'id':Number(_0x5608e3[_0x7323('0x3e')]['id']),'tags':_0xfa854f||[]});return{'id':Number(_0x5608e3[_0x7323('0x3e')]['id']),'tags':_0xfa854f||[]};});}})[_0x7323('0x29')](respondWithResult(_0x27063f,null))[_0x7323('0x4a')](handleError(_0x27063f,null));};exports[_0x7323('0xb5')]=function(_0x472d1f,_0x377327){return db['ChatInteraction']['find']({'where':{'id':_0x472d1f[_0x7323('0x3e')]['id']}})['then'](handleEntityNotFound(_0x377327,null))[_0x7323('0x29')](function(_0x1eb425){if(_0x1eb425){return _0x1eb425['removeTags'](_0x472d1f[_0x7323('0x41')][_0x7323('0xa0')]);}})['then'](respondWithStatusCode(_0x377327,null))[_0x7323('0x4a')](handleError(_0x377327,null));};exports[_0x7323('0x7e')]=function(_0x3dd7ef,_0x3832fe){var _0x2baf41=moment()['unix']()['toString']();var _0xc4810c=path['join'](config[_0x7323('0x7a')],_0x7323('0xb6'),_0x7323('0xb7'),_0x7323('0xb8'));var _0x1b5fdd=path['join'](config[_0x7323('0x7a')],'server',_0x7323('0xb7'),_0x7323('0xb9'));var _0x4423d0=path[_0x7323('0x79')](_0xc4810c,_0x2baf41);var _0x271811=util[_0x7323('0x82')](_0x7323('0xba'),_0x3dd7ef['params']['id'],_0x2baf41);var _0x391ef0=path['join'](_0xc4810c,_0x271811);var _0x32764c=[];_0x32764c[_0x7323('0xbb')]({'model':db['User'],'as':'User','attributes':['id',_0x7323('0x58')],'raw':!![]});_0x32764c['push']({'model':db[_0x7323('0x68')],'as':_0x7323('0x69'),'attributes':['id',_0x7323('0xbc'),_0x7323('0xbd')],'raw':!![]});if(_0x3dd7ef[_0x7323('0x41')]['attachments']){_0x32764c[_0x7323('0xbb')]({'model':db[_0x7323('0x77')],'as':_0x7323('0x77'),'raw':!![]});}var _0x8bcbcb=[{'model':db[_0x7323('0x86')],'as':_0x7323('0x87'),'attributes':['id',_0x7323('0x4c'),_0x7323('0x92'),'direction',_0x7323('0x94'),_0x7323('0xbe')],'include':_0x32764c}];_0x8bcbcb[_0x7323('0xbb')]({'model':db[_0x7323('0x50')],'as':_0x7323('0xbf'),'attributes':['id',_0x7323('0x2d')]});_0x8bcbcb[_0x7323('0xbb')]({'model':db[_0x7323('0x8e')],'as':_0x7323('0xc0'),'attributes':['id',_0x7323('0x58')]});return db['ChatInteraction']['find']({'where':{'id':_0x3dd7ef['params']['id']},'include':_0x8bcbcb})[_0x7323('0x29')](handleEntityNotFound(_0x3832fe,null))['then'](function(_0x11fe27){if(_0x11fe27){var _0x2083ce=_0x11fe27[_0x7323('0xc1')]({'plain':!![]});fs[_0x7323('0xc2')](_0x4423d0);var _0x153067={'channel':_0x7323('0xc3'),'account':_0x2083ce[_0x7323('0xbf')][_0x7323('0x2d')],'agent':_0x2083ce[_0x7323('0xc0')]?_0x2083ce[_0x7323('0xc0')][_0x7323('0x58')]:_0x7323('0xc4'),'createdAt':moment(_0x2083ce[_0x7323('0x92')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2083ce[_0x7323('0x6f')]?moment(_0x2083ce['closedAt'])[_0x7323('0x82')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7323('0xc5')]():'','disposition':_0x2083ce[_0x7323('0x70')],'chatInfo':{'browser':_0x2083ce[_0x7323('0xc6')],'os':_0x2083ce[_0x7323('0xc7')],'referer':_0x2083ce[_0x7323('0xc8')],'customerIp':_0x2083ce[_0x7323('0xc9')],'customerPort':_0x2083ce[_0x7323('0xca')]?_0x2083ce[_0x7323('0xca')]:_0x7323('0xc4')},'messages':_(_0x2083ce[_0x7323('0x87')])[_0x7323('0xcb')]()[_0x7323('0xa8')]({'secret':![]})[_0x7323('0x33')](function(_0x15197e){if(_0x15197e[_0x7323('0x77')]){var _0x4bca=path[_0x7323('0x79')](_0x1b5fdd,_0x15197e[_0x7323('0x77')][_0x7323('0x7d')]);if(fs[_0x7323('0xcc')](_0x4bca)){fs[_0x7323('0xcd')](_0x4bca)['pipe'](fs[_0x7323('0xce')](path[_0x7323('0x79')](_0x4423d0,_0x15197e[_0x7323('0x77')][_0x7323('0x7d')])));}}return{'date':moment(_0x15197e[_0x7323('0x92')])['format'](_0x7323('0xaa'))[_0x7323('0xc5')](),'sender':_0x15197e[_0x7323('0xcf')]===_0x7323('0x65')?_0x15197e[_0x7323('0x8e')]?_0x15197e[_0x7323('0x8e')][_0x7323('0x58')]:_0x7323('0x89'):_0x15197e['Contact'][_0x7323('0xbc')]+(_0x15197e[_0x7323('0x69')][_0x7323('0xbd')]?'\x20'+_0x15197e[_0x7323('0x69')]['lastName']:''),'body':_0x15197e[_0x7323('0x77')]?_0x15197e[_0x7323('0x77')][_0x7323('0x7d')]:_0x15197e[_0x7323('0x4c')],'direction':_0x15197e[_0x7323('0xcf')]===_0x7323('0x65')?'A':'C','secret':_0x15197e[_0x7323('0x94')],'read':_0x15197e['read'],'attachment':_0x15197e['Attachment']};})[_0x7323('0xd0')]()};return ejs[_0x7323('0xd1')](path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0xb6'),_0x7323('0xd2'),_0x7323('0xd3')),{'interaction':_0x153067})[_0x7323('0x29')](function(_0x322552){var _0x5f2056=path[_0x7323('0x79')](_0x4423d0,_0x7323('0xd4')+_0x2083ce['id']+'-'+_0x2baf41+_0x7323('0xd5'));var _0x3621c7={'path':_0x5f2056,'channel':_0x7323('0xc3'),'interactionId':_0x2083ce['id']};return pdf[_0x7323('0xd6')](_0x322552,_0x3621c7);})[_0x7323('0x29')](function(){return new Promise(function(_0xf2e9ec,_0x452cb5){zipdir(_0x4423d0,{'saveTo':_0x391ef0},function(_0xd71d6c,_0x39450b){if(_0xd71d6c)return _0x452cb5(_0xd71d6c);return _0xf2e9ec(_0x39450b);});})[_0x7323('0x29')](function(){return new BPromise(function(_0x58643a,_0x510541){rimraf(_0x4423d0,function(_0x569daa){if(_0x569daa)_0x510541(_0x569daa);return _0x58643a();});});})[_0x7323('0x29')](function(){return _0x3832fe['download'](_0x391ef0,_0x271811,function(_0x41780e){if(_0x41780e){logger[_0x7323('0x1b')](_0x7323('0xd7'),_0x41780e);}else{fs[_0x7323('0xd8')](_0x391ef0);}});});});}else{return _0x3832fe['sendStatus'](0xc8);}})[_0x7323('0x4a')](handleError(_0x3832fe,null));};
\ No newline at end of file
+var _0xb1df=['ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','pick','includeAgent','addTags','setTags','omit','spread','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','createdAt','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','osName','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','views','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','name','send','merge','contact','interaction','index','map','ChatInteraction','type','key','getOptions','findAll','query','user','show','model','rawAttributes','keys','filters','attributes','fields','length','includeAll','include','options','create','body','find','params','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','account','POST','isNull','follow','vidaooMetadata','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','root','server/files/chat/upload/','now','pathTranscript','Messages','User','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3ee24c,_0x5de268){var _0x5ab48c=function(_0x642e89){while(--_0x642e89){_0x3ee24c['push'](_0x3ee24c['shift']());}};_0x5ab48c(++_0x5de268);}(_0xb1df,0x1c7));var _0xfb1d=function(_0x4ba75c,_0x2290d8){_0x4ba75c=_0x4ba75c-0x0;var _0x569f04=_0xb1df[_0x4ba75c];return _0x569f04;};'use strict';var rimraf=require(_0xfb1d('0x0'));var zipdir=require(_0xfb1d('0x1'));var rp=require(_0xfb1d('0x2'));var moment=require('moment');var BPromise=require(_0xfb1d('0x3'));var Mustache=require(_0xfb1d('0x4'));var util=require(_0xfb1d('0x5'));var path=require(_0xfb1d('0x6'));var ejs=require(_0xfb1d('0x7'));var fs=require('fs');var _=require(_0xfb1d('0x8'));var Redis=require(_0xfb1d('0x9'));var interaction=require(_0xfb1d('0xa'));var qs=require(_0xfb1d('0xb'));var pdf=require(_0xfb1d('0xc'));var logger=require(_0xfb1d('0xd'))(_0xfb1d('0xe'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xfb1d('0xf')]=_['defaults'](config['redis'],{'host':_0xfb1d('0x10'),'port':0x18eb});var socket=require(_0xfb1d('0x11'))(new Redis(config[_0xfb1d('0xf')]));require('./chatInteraction.socket')[_0xfb1d('0x12')](socket);var jayson=require(_0xfb1d('0x13'));var client=jayson[_0xfb1d('0x14')]['http']({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x212d14,_0x246de5,_0x301bb6,_0x17fe3f){return new BPromise(function(_0x1c2161,_0x8666ad){var _0x5f5ab5=_0x17fe3f||client;return _0x5f5ab5[_0xfb1d('0x15')](_0x212d14,_0x301bb6)['then'](function(_0x57a7dd){logger[_0xfb1d('0x16')](_0xfb1d('0x17'),_0x246de5,_0xfb1d('0x18'));logger['debug'](_0xfb1d('0x19'),_0x246de5,_0xfb1d('0x18'),JSON['stringify'](_0x57a7dd));if(_0x57a7dd[_0xfb1d('0x1a')]){if(_0x57a7dd[_0xfb1d('0x1a')]['code']===0x1f4){logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);return _0x8666ad(_0x57a7dd['error']['message']);}logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);return _0x1c2161(_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);}else{logger['info'](_0xfb1d('0x17'),_0x246de5,_0xfb1d('0x18'));_0x1c2161(_0x57a7dd[_0xfb1d('0x1c')]['message']);}})[_0xfb1d('0x1d')](function(_0x2e0421){logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x2e0421);_0x8666ad(_0x2e0421);});});}function respondWithStatusCode(_0x5b1ab8,_0x5198b6){_0x5198b6=_0x5198b6||0xcc;return function(_0x52f26f){if(_0x52f26f){return _0x5b1ab8[_0xfb1d('0x1e')](_0x5198b6);}return _0x5b1ab8[_0xfb1d('0x1f')](_0x5198b6)[_0xfb1d('0x20')]();};}function respondWithResult(_0x3b394c,_0x25c0d4){_0x25c0d4=_0x25c0d4||0xc8;return function(_0x36e4be){if(_0x36e4be){return _0x3b394c[_0xfb1d('0x1f')](_0x25c0d4)[_0xfb1d('0x21')](_0x36e4be);}};}function respondWithFilteredResult(_0x418c89,_0x2cfc06){return function(_0x230990){if(_0x230990){var _0x43fcbf=typeof _0x2cfc06[_0xfb1d('0x22')]===_0xfb1d('0x23')&&typeof _0x2cfc06[_0xfb1d('0x24')]===_0xfb1d('0x23');var _0x346913=_0x230990[_0xfb1d('0x25')];var _0x3c2d8b=_0x43fcbf?0x0:_0x2cfc06['offset'];var _0x16ebfb=_0x43fcbf?_0x230990[_0xfb1d('0x25')]:_0x2cfc06[_0xfb1d('0x22')]+_0x2cfc06[_0xfb1d('0x24')];var _0x1316ad;if(_0x16ebfb>=_0x346913){_0x16ebfb=_0x346913;_0x1316ad=0xc8;}else{_0x1316ad=0xce;}_0x418c89[_0xfb1d('0x1f')](_0x1316ad);return _0x418c89[_0xfb1d('0x26')](_0xfb1d('0x27'),_0x3c2d8b+'-'+_0x16ebfb+'/'+_0x346913)['json'](_0x230990);}return null;};}function saveUpdates(_0x4596cc){return function(_0x367906){if(_0x367906){return _0x367906[_0xfb1d('0x28')](_0x4596cc)['then'](function(_0x4ad22b){return _0x4ad22b;});}return null;};}function removeEntity(_0x409c3d){return function(_0x3f7e5b){if(_0x3f7e5b){return _0x3f7e5b['destroy']()[_0xfb1d('0x29')](function(){_0x409c3d['status'](0xcc)[_0xfb1d('0x20')]();});}};}function handleEntityNotFound(_0x1fd165){return function(_0x1ac6db){if(!_0x1ac6db){_0x1fd165[_0xfb1d('0x1e')](0x194);}return _0x1ac6db;};}function handleError(_0x3a92b8,_0x2f6d0e){_0x2f6d0e=_0x2f6d0e||0x1f4;return function(_0x36625d){logger['error'](_0x36625d['stack']);if(_0x36625d[_0xfb1d('0x2a')]){delete _0x36625d[_0xfb1d('0x2a')];}_0x3a92b8[_0xfb1d('0x1f')](_0x2f6d0e)[_0xfb1d('0x2b')](_0x36625d);};}function getMustacheRender(_0x72dc36,_0x27f635){return Mustache['render'](_0x72dc36,_[_0xfb1d('0x2c')](_0x27f635['body'],{'contact':_0x27f635[_0xfb1d('0x2d')],'message':_0x27f635[_0xfb1d('0x1b')],'agent':_0x27f635['agent'],'interaction':_0x27f635[_0xfb1d('0x2e')],'account':_0x27f635['account']}))||'';}exports[_0xfb1d('0x2f')]=function(_0x2b1dc9,_0x778144){var _0x34d01e={};var _0x4231f6=_[_0xfb1d('0x30')](db[_0xfb1d('0x31')]['rawAttributes'],function(_0x53200e){return{'name':_0x53200e['fieldName'],'type':_0x53200e[_0xfb1d('0x32')][_0xfb1d('0x33')]};});_0x34d01e=qs[_0xfb1d('0x34')](_0x4231f6,_0x2b1dc9);return interaction[_0xfb1d('0x35')]('chat',_0x2b1dc9[_0xfb1d('0x36')],_0x2b1dc9[_0xfb1d('0x37')],_0x34d01e,_0x4231f6)['then'](respondWithFilteredResult(_0x778144,_0x34d01e))['catch'](handleError(_0x778144,null));};exports[_0xfb1d('0x38')]=function(_0x59716b,_0x22b69e){var _0x44d0b3={'raw':![],'where':{'id':_0x59716b['params']['id']}},_0x10c021={};_0x10c021[_0xfb1d('0x39')]=_['keys'](db[_0xfb1d('0x31')][_0xfb1d('0x3a')]);_0x10c021[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0x59716b['query']);_0x10c021[_0xfb1d('0x3c')]=_['intersection'](_0x10c021[_0xfb1d('0x39')],_0x10c021['query']);_0x44d0b3[_0xfb1d('0x3d')]=_['intersection'](_0x10c021[_0xfb1d('0x39')],qs[_0xfb1d('0x3e')](_0x59716b[_0xfb1d('0x36')][_0xfb1d('0x3e')]));_0x44d0b3[_0xfb1d('0x3d')]=_0x44d0b3[_0xfb1d('0x3d')][_0xfb1d('0x3f')]?_0x44d0b3['attributes']:_0x10c021[_0xfb1d('0x39')];if(_0x59716b[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0x44d0b3[_0xfb1d('0x41')]=[{'all':!![]}];}_0x44d0b3=_[_0xfb1d('0x2c')]({},_0x44d0b3,_0x59716b[_0xfb1d('0x42')]);return db[_0xfb1d('0x31')]['find'](_0x44d0b3)['then'](handleEntityNotFound(_0x22b69e,null))['then'](respondWithResult(_0x22b69e,null))[_0xfb1d('0x1d')](handleError(_0x22b69e,null));};exports[_0xfb1d('0x43')]=function(_0x27a11e,_0x2f3a72){return db[_0xfb1d('0x31')][_0xfb1d('0x43')](_0x27a11e[_0xfb1d('0x44')],{})[_0xfb1d('0x29')](respondWithResult(_0x2f3a72,0xc9))[_0xfb1d('0x1d')](handleError(_0x2f3a72,null));};exports[_0xfb1d('0x28')]=function(_0x290b9a,_0xd5e91c){if(_0x290b9a[_0xfb1d('0x44')]['id']){delete _0x290b9a[_0xfb1d('0x44')]['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x290b9a[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0xd5e91c,null))[_0xfb1d('0x29')](saveUpdates(_0x290b9a[_0xfb1d('0x44')],null))[_0xfb1d('0x29')](respondWithResult(_0xd5e91c,null))[_0xfb1d('0x1d')](handleError(_0xd5e91c,null));};exports['destroy']=function(_0x23f714,_0x158ed3){return db['ChatInteraction']['find']({'where':{'id':_0x23f714[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x158ed3,null))[_0xfb1d('0x29')](removeEntity(_0x158ed3,null))['catch'](handleError(_0x158ed3,null));};exports[_0xfb1d('0x47')]=function(_0x58903f,_0x451e40){return db[_0xfb1d('0x31')]['describe']()[_0xfb1d('0x29')](respondWithResult(_0x451e40,null))[_0xfb1d('0x1d')](handleError(_0x451e40,null));};exports['createVidaooSession']=function(_0x37c46b,_0x412b3e){var _0x2c3e7e=_0x37c46b[_0xfb1d('0x46')]['id'];var _0x55b410;var _0x50f6b0;var _0x15dde2;return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0x2c3e7e}})[_0xfb1d('0x29')](function(_0x4613cd){_0x55b410=_0x4613cd;return db[_0xfb1d('0x49')][_0xfb1d('0x48')]({'where':{'id':_0x4613cd[_0xfb1d('0x4a')]},'attributes':['id',_0xfb1d('0x4b'),_0xfb1d('0x4c'),_0xfb1d('0x4d'),_0xfb1d('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xfb1d('0x29')](function(_0x2780a9){if(_0x2780a9&&_0x2780a9[_0xfb1d('0x4b')]&&_0x2780a9[_0xfb1d('0x4c')]){_0x50f6b0=_0x2780a9;var _0x329a5c={'interaction':{'id':_0x2c3e7e},'agent':{'id':_0x37c46b[_0xfb1d('0x37')]['id'],'name':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x2a')],'fullname':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x4f')],'email':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x50')]},'contact':_0x37c46b[_0xfb1d('0x44')][_0xfb1d('0x2d')],'account':_0x37c46b[_0xfb1d('0x44')][_0xfb1d('0x51')]};var _0x55da56={'rejectUnauthorized':![],'method':_0xfb1d('0x52'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2780a9[_0xfb1d('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x50')]],'buttons':null,'topic':_0x50f6b0[_0xfb1d('0x4d')],'note':_[_0xfb1d('0x53')](_0x50f6b0[_0xfb1d('0x4e')])?null:getMustacheRender(_0x50f6b0['vidaooNote'],_0x329a5c),'metadata':null},'redirect':_0xfb1d('0x54'),'json':!![]};try{if(!_['isNull'](_0x50f6b0[_0xfb1d('0x55')])){var _0x681717=getMustacheRender(_0x50f6b0['vidaooMetadata'],_0x329a5c);var _0x4b6a1d=JSON[_0xfb1d('0x56')](_0x681717);_0x55da56['body']['metadata']=_0x4b6a1d;}}catch(_0x1cddb5){throw new db['Sequelize'][(_0xfb1d('0x57'))](_0xfb1d('0x58'));}return rp(_0x55da56);}else{throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x5a'));}})[_0xfb1d('0x29')](function(_0x3ddbd4){_0x15dde2=_0x3ddbd4;if(_0x15dde2['id']){var _0x58f9dd={'body':_0x15dde2[_0xfb1d('0x5b')],'ChatWebsiteId':_0x50f6b0['id'],'ChatInteractionId':_0x55b410['id'],'direction':_0xfb1d('0x5c'),'UserId':_0x37c46b[_0xfb1d('0x37')]['id']};return db[_0xfb1d('0x5d')][_0xfb1d('0x43')](_0x58f9dd,{});}else{throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x5e'));}})[_0xfb1d('0x29')](function(){return _0x55b410['updateAttributes']({'vidaooSessionId':_0x15dde2['id']});})[_0xfb1d('0x29')](respondWithResult(_0x412b3e,null))[_0xfb1d('0x1d')](handleError(_0x412b3e,null));};exports[_0xfb1d('0x5f')]=function(_0x52967a,_0x16da21){if(_0x52967a[_0xfb1d('0x44')]['id']){delete _0x52967a['body']['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x52967a[_0xfb1d('0x46')]['id']},'include':[{'model':db[_0xfb1d('0x60')],'as':_0xfb1d('0x61')}]})[_0xfb1d('0x29')](handleEntityNotFound(_0x16da21,null))[_0xfb1d('0x29')](saveUpdates(_0x52967a['body'],null))['then'](respondWithResult(_0x16da21,null))[_0xfb1d('0x1d')](handleError(_0x16da21,null));};exports[_0xfb1d('0x62')]=function(_0x392ccf,_0x22c2d3){if(_0x392ccf['body']['id']){delete _0x392ccf[_0xfb1d('0x44')]['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x392ccf[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](function(_0x1b2ba4){if(!_0x1b2ba4){logger[_0xfb1d('0x1a')](_0xfb1d('0x63'),_0xfb1d('0x62'),0x194,_0xfb1d('0x64'));_0x22c2d3[_0xfb1d('0x1e')](0x194);}else{if(_0x1b2ba4[_0xfb1d('0x65')]){throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x66'));}}return _0x1b2ba4;})[_0xfb1d('0x29')](function(_0x1ef426){if(_0x1ef426){return _0x1ef426[_0xfb1d('0x28')]({'closed':_0x392ccf[_0xfb1d('0x44')][_0xfb1d('0x67')],'disposition':_0x392ccf[_0xfb1d('0x44')]['disposition']})[_0xfb1d('0x29')](function(_0x8f755e){return _0x8f755e;});}})['then'](function(){return respondWithRpcPromise(_0xfb1d('0x68'),_0xfb1d('0x62'),_0x392ccf[_0xfb1d('0x44')],client9004);})[_0xfb1d('0x29')](respondWithResult(_0x22c2d3,null))['catch'](handleError(_0x22c2d3,null));};exports[_0xfb1d('0x69')]=function(_0x14e160,_0x13e099){_0x14e160['body'][_0xfb1d('0x2a')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6b')];_0x14e160[_0xfb1d('0x44')][_0xfb1d('0x6c')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6d')];_0x14e160[_0xfb1d('0x44')][_0xfb1d('0x32')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6e')];return db[_0xfb1d('0x6f')]['create'](_0x14e160[_0xfb1d('0x44')])['then'](respondWithResult(_0x13e099,0xc9))[_0xfb1d('0x1d')](handleError(_0x13e099,null));};exports[_0xfb1d('0x70')]=function(_0x1fd93e,_0x21e7ee){return db[_0xfb1d('0x31')]['findOne']({'where':{'id':_0x1fd93e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x21e7ee,null))['then'](function(_0xbede25){if(_0xbede25){if(_0xbede25[_0xfb1d('0x67')]){return _0x21e7ee[_0xfb1d('0x1f')](0x193)[_0xfb1d('0x21')]({'status':0x193,'message':_0xfb1d('0x71')});}return db[_0xfb1d('0x6f')]['findOne']({'where':{'id':_0x1fd93e['query'][_0xfb1d('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x21e7ee,null));}})[_0xfb1d('0x29')](function(_0x5002e8){if(_0x5002e8){var _0xa769fb=_0x5002e8[_0xfb1d('0x73')]!==null;var _0x4785f1=path[_0xfb1d('0x74')](config['root'],'server/files/attachments/');if(_0xa769fb){_0x4785f1=path[_0xfb1d('0x74')](_0x4785f1,_0xfb1d('0x75'));}var _0x2e3db0=path[_0xfb1d('0x74')](_0x4785f1,_0x5002e8[_0xfb1d('0x6c')]);return _0x21e7ee[_0xfb1d('0x76')](_0x2e3db0);}})[_0xfb1d('0x1d')](handleError(_0x21e7ee,null));};exports['close']=function(_0x3db04a,_0x184e2b){var _0x31fa42=null;var _0x2c3aec=null;var _0x48a63f=null;if(_0x3db04a[_0xfb1d('0x44')]['id']){delete _0x3db04a['body']['id'];}if(_0x3db04a['body']['mailTranscript']){_0x48a63f=path['join'](config[_0xfb1d('0x77')],_0xfb1d('0x78'),util['format']('transcript-%s.txt',Date[_0xfb1d('0x79')]()));_0x3db04a['body'][_0xfb1d('0x7a')]=_0x48a63f;}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x3db04a[_0xfb1d('0x46')]['id']},'include':[{'model':db[_0xfb1d('0x5d')],'as':_0xfb1d('0x7b'),'include':[{'model':db['User'],'as':_0xfb1d('0x7c')}]}]})[_0xfb1d('0x29')](handleEntityNotFound(_0x184e2b,null))[_0xfb1d('0x29')](saveUpdates(_0x3db04a['body'],null))[_0xfb1d('0x29')](function(_0x219450){if(_0x219450){_0x31fa42=_0x219450;return db[_0xfb1d('0x49')][_0xfb1d('0x45')]({'where':{'id':_0x31fa42[_0xfb1d('0x4a')]}});}})[_0xfb1d('0x29')](function(_0x4b2a61){if(_0x4b2a61){_0x2c3aec=_0x4b2a61;return db['CmContact'][_0xfb1d('0x45')]({'where':{'id':_0x31fa42[_0xfb1d('0x7d')]}});}})['then'](function(_0x34867e){if(_0x34867e){if(_0x48a63f){var _0x25b1cd=null;for(var _0x5929bf=0x1;_0x5929bf<_0x31fa42[_0xfb1d('0x7b')][_0xfb1d('0x3f')];++_0x5929bf){_0x25b1cd=_0x31fa42[_0xfb1d('0x7b')][_0x5929bf];var _0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):_0xfb1d('0x80');var _0x5ab33f=_0x3db04a[_0xfb1d('0x44')][_0xfb1d('0x81')]||util[_0xfb1d('0x7e')](_0xfb1d('0x82'),_0xfb1d('0x83'),_0x25b1cd[_0xfb1d('0x7d')]);switch(_0x2c3aec[_0xfb1d('0x84')]){case _0xfb1d('0x85'):_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):_0xfb1d('0x80');break;case _0xfb1d('0x86'):_0x52cb8f=_0x25b1cd['UserId']?_0x25b1cd['User']['alias']||_0x25b1cd[_0xfb1d('0x7c')][_0xfb1d('0x4f')]:_0xfb1d('0x80');break;case _0xfb1d('0x87'):_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?_0x25b1cd[_0xfb1d('0x7c')][_0xfb1d('0x4f')]:_0xfb1d('0x80');break;default:_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):'System';}var _0x936c1e=util[_0xfb1d('0x7e')](_0xfb1d('0x88'),moment(_0x25b1cd['createdAt'])['format'](_0xfb1d('0x89')),_0x25b1cd[_0xfb1d('0x8a')]==='in'?_0x5ab33f:_0x52cb8f,_0x25b1cd[_0xfb1d('0x44')]);if(!_0x25b1cd[_0xfb1d('0x8b')]){fs[_0xfb1d('0x8c')](_0x48a63f,_0x936c1e);}}return db[_0xfb1d('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfb1d('0x8e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xfb1d('0x8f')],'as':_0xfb1d('0x8f'),'raw':!![]}]}]});}}})['then'](function(_0x3d6e9f){if(!_0x3d6e9f||!_0x3d6e9f[_0xfb1d('0x90')]||!_0x3db04a[_0xfb1d('0x44')])return _0x31fa42;var _0x1437ff=_0x3d6e9f[_0xfb1d('0x91')]();return respondWithRpcPromise(_0xfb1d('0x92'),_0xfb1d('0x93'),{'account':_0x1437ff,'message':{'from':util[_0xfb1d('0x7e')]('\x22%s\x22\x20<%s>',_0x3d6e9f[_0xfb1d('0x2a')],_0x3d6e9f[_0xfb1d('0x50')]||_0x3d6e9f['Smtp'][_0xfb1d('0x37')]),'to':_0x3db04a[_0xfb1d('0x44')]['mailTranscript'],'subject':_0xfb1d('0x94'),'text':util[_0xfb1d('0x7e')](_0xfb1d('0x95'),_0x3db04a[_0xfb1d('0x44')][_0xfb1d('0x96')]),'attachments':[{'path':_0x48a63f}]}})['then'](function(){return _0x31fa42;})[_0xfb1d('0x1d')](function(_0x2734ad){logger[_0xfb1d('0x1a')](_0x2734ad);});})[_0xfb1d('0x29')](respondWithStatusCode(_0x184e2b,0xc8))[_0xfb1d('0x1d')](handleError(_0x184e2b,null));};exports['addMessage']=function(_0x17a580,_0x28876a){return db[_0xfb1d('0x5d')]['find']({'where':{'id':_0x17a580[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x28876a,null))[_0xfb1d('0x29')](function(_0x453376){if(_0x453376){return _0x453376[_0xfb1d('0x97')](_0x17a580['body']['ids'],_['omit'](_0x17a580['body'],[_0xfb1d('0x98'),'id'])||{});}})[_0xfb1d('0x29')](respondWithResult(_0x28876a,null))[_0xfb1d('0x1d')](handleError(_0x28876a,null));};exports[_0xfb1d('0x99')]=function(_0x3f9eb2,_0x4a4439){var _0x163713={'raw':![],'where':{}};var _0x55cebf={};var _0x100d65={'count':0x0,'rows':[]};return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0x3f9eb2[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x4a4439,null))[_0xfb1d('0x29')](function(_0x1d8b73){if(_0x1d8b73){_0x55cebf[_0xfb1d('0x39')]=_[_0xfb1d('0x3b')](db[_0xfb1d('0x5d')][_0xfb1d('0x3a')]);_0x55cebf[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0x3f9eb2['query']);_0x55cebf[_0xfb1d('0x3c')]=_[_0xfb1d('0x9a')](_0x55cebf[_0xfb1d('0x39')],_0x55cebf[_0xfb1d('0x36')]);_0x163713[_0xfb1d('0x3d')]=_['intersection'](_0x55cebf['model'],qs[_0xfb1d('0x3e')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x3e')]));_0x163713['attributes']=_0x163713['attributes']['length']?_0x163713[_0xfb1d('0x3d')]:_0x55cebf[_0xfb1d('0x39')];if(!_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x9b')](_0xfb1d('0x9c'))){_0x163713[_0xfb1d('0x24')]=qs[_0xfb1d('0x24')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x24')]);_0x163713['offset']=qs[_0xfb1d('0x22')](_0x3f9eb2['query'][_0xfb1d('0x22')]);}_0x163713[_0xfb1d('0x9d')]=qs[_0xfb1d('0x9e')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x9e')]);_0x163713['where']=qs[_0xfb1d('0x3c')](_['pick'](_0x3f9eb2[_0xfb1d('0x36')],_0x55cebf['filters']));_0x163713[_0xfb1d('0x9f')][_0xfb1d('0xa0')]=_0x1d8b73['id'];if(_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0xa1')]){_0x163713[_0xfb1d('0x9f')]=_[_0xfb1d('0x2c')](_0x163713['where'],{'$or':_[_0xfb1d('0x30')](_0x163713['attributes'],function(_0x26ec67){var _0x4a1067={};_0x4a1067[_0x26ec67]={'$like':'%'+_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0xa1')]+'%'};return _0x4a1067;})});}if(_0x3f9eb2['query'][_0xfb1d('0xa2')]){var _0x411b0d=_0x3f9eb2[_0xfb1d('0x36')]['$gte']['split'](',');var _0xafa48d={};_0xafa48d[_0x411b0d[0x0]]={'$gte':moment(_0x411b0d[0x1])[_0xfb1d('0x7e')](_0xfb1d('0xa3'))};_0x163713[_0xfb1d('0x9f')]=_[_0xfb1d('0x2c')](_0x163713['where'],_0xafa48d);}_0x163713=_[_0xfb1d('0x2c')]({},_0x163713,_0x3f9eb2[_0xfb1d('0x42')]);return db[_0xfb1d('0x5d')][_0xfb1d('0x25')]({'where':_0x163713[_0xfb1d('0x9f')]})[_0xfb1d('0x29')](function(_0x374e02){_0x100d65[_0xfb1d('0x25')]=_0x374e02;if(_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0x163713[_0xfb1d('0x41')]=[{'all':!![]}];}return db[_0xfb1d('0x5d')][_0xfb1d('0x35')](_0x163713);})[_0xfb1d('0x29')](function(_0x3d30de){_0x100d65[_0xfb1d('0xa4')]=_0x3d30de;return _0x100d65;});}})[_0xfb1d('0x29')](respondWithFilteredResult(_0x4a4439,_0x163713))[_0xfb1d('0x1d')](handleError(_0x4a4439,null));};exports['getMyMessages']=function(_0xde3f08,_0x475524){var _0xb3deae={'where':{}},_0xd8a9f3={},_0x1c83e0={'count':0x0,'rows':[]};return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0xde3f08[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x475524,null))[_0xfb1d('0x29')](function(_0x1e9f50){if(_0x1e9f50){_0xd8a9f3[_0xfb1d('0x39')]=_[_0xfb1d('0x3b')](db[_0xfb1d('0x5d')][_0xfb1d('0x3a')]);_0xd8a9f3[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0xde3f08[_0xfb1d('0x36')]);_0xd8a9f3[_0xfb1d('0x3c')]=_[_0xfb1d('0x9a')](_0xd8a9f3[_0xfb1d('0x39')],_0xd8a9f3[_0xfb1d('0x36')]);_0xb3deae[_0xfb1d('0x3d')]=_[_0xfb1d('0x9a')](_0xd8a9f3[_0xfb1d('0x39')],qs[_0xfb1d('0x3e')](_0xde3f08[_0xfb1d('0x36')]['fields']));_0xb3deae[_0xfb1d('0x3d')]=_0xb3deae[_0xfb1d('0x3d')][_0xfb1d('0x3f')]?_0xb3deae['attributes']:_0xd8a9f3[_0xfb1d('0x39')];if(!_0xde3f08[_0xfb1d('0x36')]['hasOwnProperty'](_0xfb1d('0x9c'))){_0xb3deae[_0xfb1d('0x24')]=qs['limit'](_0xde3f08['query'][_0xfb1d('0x24')]);_0xb3deae[_0xfb1d('0x22')]=qs['offset'](_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0x22')]);}_0xb3deae[_0xfb1d('0x9d')]=qs[_0xfb1d('0x9e')](_0xde3f08[_0xfb1d('0x36')]['sort']);_0xb3deae[_0xfb1d('0x9f')]=qs[_0xfb1d('0x3c')](_[_0xfb1d('0xa5')](_0xde3f08[_0xfb1d('0x36')],_0xd8a9f3[_0xfb1d('0x3c')]));_0xb3deae['where'][_0xfb1d('0xa0')]=_0x1e9f50['id'];if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0xa1')]){_0xb3deae['where']=_[_0xfb1d('0x2c')](_0xb3deae[_0xfb1d('0x9f')],{'$or':_[_0xfb1d('0x30')](_0xb3deae[_0xfb1d('0x3d')],function(_0x356999){var _0x457195={};_0x457195[_0x356999]={'$like':'%'+_0xde3f08['query'][_0xfb1d('0xa1')]+'%'};return _0x457195;})});}_0xb3deae[_0xfb1d('0x9f')][_0xfb1d('0x8b')]=![];if(_0xde3f08['query']['id']){_0xb3deae[_0xfb1d('0x9f')]['id']={'$gt':_0xde3f08[_0xfb1d('0x36')]['id']};}_0xb3deae=_[_0xfb1d('0x2c')]({},_0xb3deae,_0xde3f08[_0xfb1d('0x42')]);return db[_0xfb1d('0x5d')][_0xfb1d('0x25')]({'where':_0xb3deae[_0xfb1d('0x9f')]})[_0xfb1d('0x29')](function(_0x3fbbf3){_0x1c83e0[_0xfb1d('0x25')]=_0x3fbbf3;_0xb3deae['include']=[];if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0xa6')]){_0xb3deae['include']['push']({'model':db[_0xfb1d('0x7c')],'as':_0xfb1d('0x7c'),'attributes':['id',_0xfb1d('0x4f'),'alias']});}if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0xb3deae['include']=[{'all':!![]}];}return db['ChatMessage'][_0xfb1d('0x35')](_0xb3deae);})[_0xfb1d('0x29')](function(_0x393448){_0x1c83e0[_0xfb1d('0xa4')]=_0x393448;return _0x1c83e0;});}})[_0xfb1d('0x29')](respondWithFilteredResult(_0x475524,_0xb3deae))[_0xfb1d('0x1d')](handleError(_0x475524,null));};exports[_0xfb1d('0xa7')]=function(_0x55b504,_0x384cc9){return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x55b504[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x384cc9,null))[_0xfb1d('0x29')](function(_0x3448c4){if(_0x3448c4){return _0x3448c4[_0xfb1d('0xa8')](_0x55b504['body'][_0xfb1d('0x98')],_[_0xfb1d('0xa9')](_0x55b504['body'],[_0xfb1d('0x98'),'id'])||{})[_0xfb1d('0xaa')](function(){return db['Tag'][_0xfb1d('0x35')]({'attributes':['id',_0xfb1d('0x2a'),'color'],'where':{'id':_0x55b504['body'][_0xfb1d('0x98')]}});})[_0xfb1d('0x29')](function(_0x1394ea){socket[_0xfb1d('0xab')]('chatInteractionTags:save',{'id':Number(_0x55b504[_0xfb1d('0x46')]['id']),'tags':_0x1394ea||[]});return{'id':Number(_0x55b504['params']['id']),'tags':_0x1394ea||[]};});}})[_0xfb1d('0x29')](respondWithResult(_0x384cc9,null))['catch'](handleError(_0x384cc9,null));};exports[_0xfb1d('0xac')]=function(_0x1c025d,_0x34712a){return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x1c025d[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x34712a,null))[_0xfb1d('0x29')](function(_0x5efaad){if(_0x5efaad){return _0x5efaad['removeTags'](_0x1c025d[_0xfb1d('0x36')][_0xfb1d('0x98')]);}})[_0xfb1d('0x29')](respondWithStatusCode(_0x34712a,null))[_0xfb1d('0x1d')](handleError(_0x34712a,null));};exports['download']=function(_0x58c65f,_0x3e1609){var _0x424731=moment()[_0xfb1d('0xad')]()[_0xfb1d('0xae')]();var _0x15805e=path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xb0'),_0xfb1d('0xb1'));var _0x30b0fe=path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xb0'),_0xfb1d('0xb2'));var _0xa41291=path[_0xfb1d('0x74')](_0x15805e,_0x424731);var _0xa7c953=util[_0xfb1d('0x7e')](_0xfb1d('0xb3'),_0x58c65f['params']['id'],_0x424731);var _0x25ec22=path[_0xfb1d('0x74')](_0x15805e,_0xa7c953);var _0x32c4db=[];_0x32c4db[_0xfb1d('0xb4')]({'model':db[_0xfb1d('0x7c')],'as':'User','attributes':['id',_0xfb1d('0x4f')],'raw':!![]});_0x32c4db[_0xfb1d('0xb4')]({'model':db[_0xfb1d('0x60')],'as':_0xfb1d('0x61'),'attributes':['id',_0xfb1d('0xb5'),_0xfb1d('0xb6')],'raw':!![]});if(_0x58c65f[_0xfb1d('0x36')]['attachments']){_0x32c4db[_0xfb1d('0xb4')]({'model':db['Attachment'],'as':_0xfb1d('0x6f'),'raw':!![]});}var _0x52b92b=[{'model':db[_0xfb1d('0x5d')],'as':'Messages','attributes':['id','body',_0xfb1d('0xb7'),_0xfb1d('0x8a'),'secret',_0xfb1d('0xb8')],'include':_0x32c4db}];_0x52b92b['push']({'model':db['ChatWebsite'],'as':_0xfb1d('0xb9'),'attributes':['id',_0xfb1d('0x2a')]});_0x52b92b['push']({'model':db[_0xfb1d('0x7c')],'as':'Owner','attributes':['id',_0xfb1d('0x4f')]});return db['ChatInteraction'][_0xfb1d('0x45')]({'where':{'id':_0x58c65f[_0xfb1d('0x46')]['id']},'include':_0x52b92b})[_0xfb1d('0x29')](handleEntityNotFound(_0x3e1609,null))[_0xfb1d('0x29')](function(_0x40294a){if(_0x40294a){var _0x147758=_0x40294a[_0xfb1d('0xba')]({'plain':!![]});fs[_0xfb1d('0xbb')](_0xa41291);var _0x764546={'channel':_0xfb1d('0xbc'),'account':_0x147758['Account'][_0xfb1d('0x2a')],'agent':_0x147758[_0xfb1d('0xbd')]?_0x147758['Owner'][_0xfb1d('0x4f')]:_0xfb1d('0xbe'),'createdAt':moment(_0x147758[_0xfb1d('0xb7')])[_0xfb1d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfb1d('0xae')](),'closedAt':_0x147758[_0xfb1d('0x67')]?moment(_0x147758[_0xfb1d('0xbf')])[_0xfb1d('0x7e')](_0xfb1d('0xa3'))[_0xfb1d('0xae')]():'','disposition':_0x147758[_0xfb1d('0xc0')],'chatInfo':{'browser':_0x147758['browserName'],'os':_0x147758[_0xfb1d('0xc1')],'referer':_0x147758['referer'],'customerIp':_0x147758['customerIp'],'customerPort':_0x147758[_0xfb1d('0xc2')]?_0x147758[_0xfb1d('0xc2')]:_0xfb1d('0xbe')},'messages':_(_0x147758['Messages'])[_0xfb1d('0xc3')]()[_0xfb1d('0xa1')]({'secret':![]})[_0xfb1d('0x30')](function(_0x396b6f){if(_0x396b6f[_0xfb1d('0x6f')]){var _0x3dad32=path[_0xfb1d('0x74')](_0x30b0fe,_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')]);if(fs['existsSync'](_0x3dad32)){fs[_0xfb1d('0xc4')](_0x3dad32)[_0xfb1d('0xc5')](fs[_0xfb1d('0xc6')](path[_0xfb1d('0x74')](_0xa41291,_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')])));}}return{'date':moment(_0x396b6f['createdAt'])['format'](_0xfb1d('0xa3'))['toString'](),'sender':_0x396b6f[_0xfb1d('0x8a')]===_0xfb1d('0x5c')?_0x396b6f['User']?_0x396b6f[_0xfb1d('0x7c')]['fullname']:'System':_0x396b6f[_0xfb1d('0x61')]['firstName']+(_0x396b6f[_0xfb1d('0x61')][_0xfb1d('0xb6')]?'\x20'+_0x396b6f['Contact'][_0xfb1d('0xb6')]:''),'body':_0x396b6f['Attachment']?_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')]:_0x396b6f[_0xfb1d('0x44')],'direction':_0x396b6f[_0xfb1d('0x8a')]===_0xfb1d('0x5c')?'A':'C','secret':_0x396b6f[_0xfb1d('0x8b')],'read':_0x396b6f[_0xfb1d('0xb8')],'attachment':_0x396b6f[_0xfb1d('0x6f')]};})['value']()};return ejs[_0xfb1d('0xc7')](path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x764546})[_0xfb1d('0x29')](function(_0xb52222){var _0x1f4eae=path[_0xfb1d('0x74')](_0xa41291,_0xfb1d('0xc9')+_0x147758['id']+'-'+_0x424731+_0xfb1d('0xca'));var _0x4aa5aa={'path':_0x1f4eae,'channel':_0xfb1d('0xbc'),'interactionId':_0x147758['id']};return pdf['createPdfFromHTML'](_0xb52222,_0x4aa5aa);})[_0xfb1d('0x29')](function(){return new Promise(function(_0x53360b,_0x134e28){zipdir(_0xa41291,{'saveTo':_0x25ec22},function(_0x47355d,_0x274f0f){if(_0x47355d)return _0x134e28(_0x47355d);return _0x53360b(_0x274f0f);});})['then'](function(){return new BPromise(function(_0xe2997b,_0x45e959){rimraf(_0xa41291,function(_0x4c4fb5){if(_0x4c4fb5)_0x45e959(_0x4c4fb5);return _0xe2997b();});});})['then'](function(){return _0x3e1609[_0xfb1d('0x76')](_0x25ec22,_0xa7c953,function(_0x3f5832){if(_0x3f5832){logger[_0xfb1d('0x1a')](_0xfb1d('0xcb'),_0x3f5832);}else{fs[_0xfb1d('0xcc')](_0x25ec22);}});});});}else{return _0x3e1609['sendStatus'](0xc8);}})[_0xfb1d('0x1d')](handleError(_0x3e1609,null));};
\ No newline at end of file
index 7336c8f..f9abc3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x389a=['ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction'];(function(_0x5c4321,_0x5f572c){var _0x251f1f=function(_0x5bed18){while(--_0x5bed18){_0x5c4321['push'](_0x5c4321['shift']());}};_0x251f1f(++_0x5f572c);}(_0x389a,0x10c));var _0xa389=function(_0x49a81c,_0x367dcb){_0x49a81c=_0x49a81c-0x0;var _0x326403=_0x389a[_0x49a81c];return _0x326403;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa389('0x0'))['db'][_0xa389('0x1')];var ChatMessage=require(_0xa389('0x0'))['db'][_0xa389('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa389('0x3')](0x0);var events={'afterCreate':_0xa389('0x4'),'afterUpdate':'update','afterDestroy':_0xa389('0x5')};function emitEvent(_0x43814e){return function(_0x293f15,_0x3aceb7,_0x2711d1){_0x293f15[_0xa389('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x330c43){_0x293f15[_0xa389('0x7')](_0xa389('0x8'),_0x330c43['map'](function(_0x2b10df){return{'id':_0x2b10df['id']};}));return ChatMessage[_0xa389('0x9')]({'where':{'ChatInteractionId':_0x293f15['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa389('0xa')](function(_0x4bfbea){_0x293f15[_0xa389('0x7')](_0xa389('0xb'),_0x4bfbea[_0xa389('0xc')]);ChatInteractionEvents[_0xa389('0xd')](_0x43814e+':'+_0x293f15['id'],_0x293f15);ChatInteractionEvents[_0xa389('0xd')](_0x43814e,_0x293f15);_0x2711d1(null);})[_0xa389('0xe')](_0x2711d1(null));};}for(var e in events){if(events[_0xa389('0xf')](e)){var event=events[e];ChatInteraction[_0xa389('0x10')](e,emitEvent(event));}}module[_0xa389('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xef60=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit'];(function(_0x1d3046,_0x8b14e1){var _0x3b9b62=function(_0xb69d69){while(--_0xb69d69){_0x1d3046['push'](_0x1d3046['shift']());}};_0x3b9b62(++_0x8b14e1);}(_0xef60,0x9c));var _0x0ef6=function(_0x77cde4,_0x2d8038){_0x77cde4=_0x77cde4-0x0;var _0x1e42c2=_0xef60[_0x77cde4];return _0x1e42c2;};'use strict';var EventEmitter=require(_0x0ef6('0x0'));var ChatInteraction=require(_0x0ef6('0x1'))['db'][_0x0ef6('0x2')];var ChatMessage=require(_0x0ef6('0x1'))['db'][_0x0ef6('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0ef6('0x4')](0x0);var events={'afterCreate':_0x0ef6('0x5'),'afterUpdate':_0x0ef6('0x6'),'afterDestroy':_0x0ef6('0x7')};function emitEvent(_0x51436a){return function(_0x4d7cc8,_0x1dc68e,_0x51ac71){_0x4d7cc8[_0x0ef6('0x8')]({'attributes':['id'],'raw':!![]})[_0x0ef6('0x9')](function(_0x357bf6){_0x4d7cc8[_0x0ef6('0xa')]('Users',_0x357bf6[_0x0ef6('0xb')](function(_0x1ad04f){return{'id':_0x1ad04f['id']};}));return ChatMessage[_0x0ef6('0xc')]({'where':{'ChatInteractionId':_0x4d7cc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ef6('0x9')](function(_0x4e8e69){_0x4d7cc8['setDataValue'](_0x0ef6('0xd'),_0x4e8e69['length']);ChatInteractionEvents['emit'](_0x51436a+':'+_0x4d7cc8['id'],_0x4d7cc8);ChatInteractionEvents[_0x0ef6('0xe')](_0x51436a,_0x4d7cc8);_0x51ac71(null);})[_0x0ef6('0xf')](_0x51ac71(null));};}for(var e in events){if(events[_0x0ef6('0x10')](e)){var event=events[e];ChatInteraction[_0x0ef6('0x11')](e,emitEvent(event));}}module[_0x0ef6('0x12')]=ChatInteractionEvents;
\ No newline at end of file
index 8c0406c..747fd58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235c=['lodash','api','moment','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3f8a3b,_0x33932a){var _0x1419f1=function(_0x18ebb9){while(--_0x18ebb9){_0x3f8a3b['push'](_0x3f8a3b['shift']());}};_0x1419f1(++_0x33932a);}(_0x235c,0x17a));var _0xc235=function(_0x5024b6,_0x360f4e){_0x5024b6=_0x5024b6-0x0;var _0x7a8ea7=_0x235c[_0x5024b6];return _0x7a8ea7;};'use strict';var _=require(_0xc235('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc235('0x1'));var moment=require(_0xc235('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc235('0x3'));var rimraf=require(_0xc235('0x4'));var config=require('../../config/environment');var attributes=require(_0xc235('0x5'));module[_0xc235('0x6')]=function(_0x154b77,_0x446196){return _0x154b77[_0xc235('0x7')](_0xc235('0x8'),attributes,{'tableName':_0xc235('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35c52a,_0x42967f,_0x1bd7e0){if(_0x35c52a[_0xc235('0xa')]('closed')){_0x35c52a['closedAt']=moment()['format'](_0xc235('0xb'));}_0x1bd7e0(null,_0x35c52a);}},'charset':_0xc235('0xc'),'collate':_0xc235('0xd')});};
\ No newline at end of file
+var _0x09d8=['define','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports'];(function(_0x5a2162,_0x5a90a3){var _0x4561a7=function(_0x11849e){while(--_0x11849e){_0x5a2162['push'](_0x5a2162['shift']());}};_0x4561a7(++_0x5a90a3);}(_0x09d8,0x117));var _0x809d=function(_0x3b00d5,_0x952eec){_0x3b00d5=_0x3b00d5-0x0;var _0x42cd8d=_0x09d8[_0x3b00d5];return _0x42cd8d;};'use strict';var _=require(_0x809d('0x0'));var util=require('util');var logger=require(_0x809d('0x1'))(_0x809d('0x2'));var moment=require(_0x809d('0x3'));var BPromise=require(_0x809d('0x4'));var rp=require(_0x809d('0x5'));var fs=require('fs');var path=require(_0x809d('0x6'));var rimraf=require(_0x809d('0x7'));var config=require('../../config/environment');var attributes=require(_0x809d('0x8'));module[_0x809d('0x9')]=function(_0x58a347,_0x5973af){return _0x58a347[_0x809d('0xa')]('ChatInteraction',attributes,{'tableName':_0x809d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e709,_0x1e7161,_0x517aa7){if(_0x46e709[_0x809d('0xc')](_0x809d('0xd'))){_0x46e709['closedAt']=moment()[_0x809d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x517aa7(null,_0x46e709);}},'charset':_0x809d('0xf'),'collate':_0x809d('0x10')});};
\ No newline at end of file
index 742b017..a2df3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b8e=['ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3b8e,0x1e4));var _0xe3b8=function(_0x17a8b0,_0x20ac87){_0x17a8b0=_0x17a8b0-0x0;var _0x589069=_0x3b8e[_0x17a8b0];return _0x589069;};'use strict';var _=require(_0xe3b8('0x0'));var util=require(_0xe3b8('0x1'));var moment=require(_0xe3b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3b8('0x3'));var fs=require('fs');var Redis=require(_0xe3b8('0x4'));var db=require(_0xe3b8('0x5'))['db'];var utils=require(_0xe3b8('0x6'));var logger=require(_0xe3b8('0x7'))(_0xe3b8('0x8'));var config=require(_0xe3b8('0x9'));var jayson=require(_0xe3b8('0xa'));var client=jayson[_0xe3b8('0xb')][_0xe3b8('0xc')]({'port':0x232a});config[_0xe3b8('0xd')]=_[_0xe3b8('0xe')](config['redis'],{'host':_0xe3b8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3b8('0xd')]));require(_0xe3b8('0x10'))[_0xe3b8('0x11')](socket);function respondWithRpcPromise(_0x5bf964,_0x44fec3,_0x5c6cce){return new BPromise(function(_0x10e327,_0x1655c0){return client['request'](_0x5bf964,_0x5c6cce)[_0xe3b8('0x12')](function(_0x292564){logger[_0xe3b8('0x13')](_0xe3b8('0x14'),_0x44fec3,'request\x20sent');logger[_0xe3b8('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x44fec3,_0xe3b8('0x16'),JSON['stringify'](_0x292564));if(_0x292564[_0xe3b8('0x17')]){if(_0x292564[_0xe3b8('0x17')][_0xe3b8('0x18')]===0x1f4){logger['error'](_0xe3b8('0x14'),_0x44fec3,_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);return _0x1655c0(_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);}logger[_0xe3b8('0x17')](_0xe3b8('0x14'),_0x44fec3,_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);return _0x10e327(_0x292564['error'][_0xe3b8('0x19')]);}else{logger[_0xe3b8('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x44fec3,_0xe3b8('0x16'));_0x10e327(_0x292564[_0xe3b8('0x1a')]['message']);}})[_0xe3b8('0x1b')](function(_0x37a69f){logger[_0xe3b8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x44fec3,_0x37a69f);_0x1655c0(_0x37a69f);});});}exports[_0xe3b8('0x1c')]=function(_0x1d6326){var _0x45d568=this;return new Promise(function(_0x2b26a2,_0x12497b){return db[_0xe3b8('0x1d')][_0xe3b8('0x1e')](_0x1d6326[_0xe3b8('0x1f')],{'raw':_0x1d6326[_0xe3b8('0x20')]?_0x1d6326[_0xe3b8('0x20')][_0xe3b8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6326['options']?_0x1d6326['options'][_0xe3b8('0x22')]||null:null,'attributes':_0x1d6326['options']?_0x1d6326['options'][_0xe3b8('0x23')]||null:null,'limit':_0x1d6326['options']?_0x1d6326[_0xe3b8('0x20')]['limit']||null:null})[_0xe3b8('0x12')](function(_0xf31957){logger['info'](_0xe3b8('0x1c'),_0x1d6326);logger[_0xe3b8('0x15')](_0xe3b8('0x1c'),_0x1d6326,JSON[_0xe3b8('0x24')](_0xf31957));_0x2b26a2(_0xf31957);})['catch'](function(_0x1f4f9b){logger['error'](_0xe3b8('0x1c'),_0x1f4f9b[_0xe3b8('0x19')],_0x1d6326);_0x12497b(_0x45d568[_0xe3b8('0x17')](0x1f4,_0x1f4f9b[_0xe3b8('0x19')]));});});};exports[_0xe3b8('0x25')]=function(_0x1e0994){return new Promise(function(_0x5ac3ca,_0x3405d7){return db[_0xe3b8('0x1d')]['find']({'where':_0x1e0994[_0xe3b8('0x20')]?_0x1e0994[_0xe3b8('0x20')][_0xe3b8('0x22')]||null:null})[_0xe3b8('0x12')](function(_0x453999){if(_0x453999){return _0x453999[_0xe3b8('0x26')](_0x1e0994[_0xe3b8('0x1f')][_0xe3b8('0x27')],_['omit'](_0x1e0994[_0xe3b8('0x1f')],[_0xe3b8('0x27'),'id'])||{});}})[_0xe3b8('0x28')](function(_0x545c8f){logger[_0xe3b8('0x13')](_0xe3b8('0x29'),_0x1e0994);logger[_0xe3b8('0x15')](_0xe3b8('0x29'),_0x1e0994,JSON[_0xe3b8('0x24')](_0x545c8f));_0x5ac3ca(_0x545c8f);})['catch'](function(_0x5a2761){logger['error'](_0xe3b8('0x29'),_0x5a2761[_0xe3b8('0x19')],_0x1e0994);_0x3405d7(_this[_0xe3b8('0x17')](0x1f4,_0x5a2761['message']));});});};
\ No newline at end of file
+var _0x2937=['redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','raw','where','options','attributes','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x23330f,_0x4ce4d0){var _0x2b962f=function(_0x12c122){while(--_0x12c122){_0x23330f['push'](_0x23330f['shift']());}};_0x2b962f(++_0x4ce4d0);}(_0x2937,0x1ad));var _0x7293=function(_0x5116e3,_0x497c07){_0x5116e3=_0x5116e3-0x0;var _0x3b9852=_0x2937[_0x5116e3];return _0x3b9852;};'use strict';var _=require(_0x7293('0x0'));var util=require(_0x7293('0x1'));var moment=require(_0x7293('0x2'));var BPromise=require(_0x7293('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7293('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7293('0x5'));var logger=require(_0x7293('0x6'))('rpc');var config=require(_0x7293('0x7'));var jayson=require(_0x7293('0x8'));var client=jayson[_0x7293('0x9')][_0x7293('0xa')]({'port':0x232a});config[_0x7293('0xb')]=_[_0x7293('0xc')](config[_0x7293('0xb')],{'host':_0x7293('0xd'),'port':0x18eb});var socket=require(_0x7293('0xe'))(new Redis(config[_0x7293('0xb')]));require(_0x7293('0xf'))[_0x7293('0x10')](socket);function respondWithRpcPromise(_0x52b064,_0x2a12e5,_0x1f8341){return new BPromise(function(_0x50d370,_0x491178){return client['request'](_0x52b064,_0x1f8341)[_0x7293('0x11')](function(_0x4a7b74){logger[_0x7293('0x12')](_0x7293('0x13'),_0x2a12e5,_0x7293('0x14'));logger[_0x7293('0x15')](_0x7293('0x16'),_0x2a12e5,'request\x20sent',JSON[_0x7293('0x17')](_0x4a7b74));if(_0x4a7b74[_0x7293('0x18')]){if(_0x4a7b74[_0x7293('0x18')][_0x7293('0x19')]===0x1f4){logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);return _0x491178(_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);}logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);return _0x50d370(_0x4a7b74['error'][_0x7293('0x1a')]);}else{logger[_0x7293('0x12')](_0x7293('0x13'),_0x2a12e5,'request\x20sent');_0x50d370(_0x4a7b74[_0x7293('0x1b')][_0x7293('0x1a')]);}})[_0x7293('0x1c')](function(_0x2ac2d6){logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x2ac2d6);_0x491178(_0x2ac2d6);});});}exports[_0x7293('0x1d')]=function(_0x2d5fff){var _0x396be0=this;return new Promise(function(_0x52c9fe,_0x765c23){return db[_0x7293('0x1e')]['update'](_0x2d5fff['body'],{'raw':_0x2d5fff['options']?_0x2d5fff['options'][_0x7293('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5fff['options']?_0x2d5fff['options'][_0x7293('0x20')]||null:null,'attributes':_0x2d5fff[_0x7293('0x21')]?_0x2d5fff[_0x7293('0x21')][_0x7293('0x22')]||null:null,'limit':_0x2d5fff[_0x7293('0x21')]?_0x2d5fff['options'][_0x7293('0x23')]||null:null})[_0x7293('0x11')](function(_0x4ca1df){logger[_0x7293('0x12')](_0x7293('0x1d'),_0x2d5fff);logger['debug'](_0x7293('0x1d'),_0x2d5fff,JSON[_0x7293('0x17')](_0x4ca1df));_0x52c9fe(_0x4ca1df);})[_0x7293('0x1c')](function(_0x479f3a){logger[_0x7293('0x18')](_0x7293('0x1d'),_0x479f3a[_0x7293('0x1a')],_0x2d5fff);_0x765c23(_0x396be0[_0x7293('0x18')](0x1f4,_0x479f3a[_0x7293('0x1a')]));});});};exports[_0x7293('0x24')]=function(_0x32dbd8){return new Promise(function(_0x571a78,_0x28ba35){return db[_0x7293('0x1e')][_0x7293('0x25')]({'where':_0x32dbd8[_0x7293('0x21')]?_0x32dbd8[_0x7293('0x21')]['where']||null:null})[_0x7293('0x11')](function(_0x907c79){if(_0x907c79){return _0x907c79[_0x7293('0x26')](_0x32dbd8[_0x7293('0x27')][_0x7293('0x28')],_[_0x7293('0x29')](_0x32dbd8[_0x7293('0x27')],[_0x7293('0x28'),'id'])||{});}})[_0x7293('0x2a')](function(_0x1d10bc){logger[_0x7293('0x12')](_0x7293('0x2b'),_0x32dbd8);logger[_0x7293('0x15')](_0x7293('0x2b'),_0x32dbd8,JSON[_0x7293('0x17')](_0x1d10bc));_0x571a78(_0x1d10bc);})['catch'](function(_0x2e0218){logger[_0x7293('0x18')](_0x7293('0x2b'),_0x2e0218[_0x7293('0x1a')],_0x32dbd8);_0x28ba35(_this[_0x7293('0x18')](0x1f4,_0x2e0218[_0x7293('0x1a')]));});});};
\ No newline at end of file
index 0e2254f..574db24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd658=['chatInteraction:','./chatInteraction.events','remove','emit','register','length'];(function(_0x5d49c5,_0x589a0f){var _0x622430=function(_0x22a176){while(--_0x22a176){_0x5d49c5['push'](_0x5d49c5['shift']());}};_0x622430(++_0x589a0f);}(_0xd658,0x151));var _0x8d65=function(_0xc84e8c,_0x3388f0){_0xc84e8c=_0xc84e8c-0x0;var _0xc92ebf=_0xd658[_0xc84e8c];return _0xc92ebf;};'use strict';var ChatInteractionEvents=require(_0x8d65('0x0'));var events=['save',_0x8d65('0x1'),'update'];function createListener(_0x3f4978,_0x311ccb){return function(_0x2b8b32){_0x311ccb[_0x8d65('0x2')](_0x3f4978,_0x2b8b32);};}function removeListener(_0x2ac9e0,_0x52040b){return function(){ChatInteractionEvents['removeListener'](_0x2ac9e0,_0x52040b);};}exports[_0x8d65('0x3')]=function(_0x40480f){for(var _0xd4c678=0x0,_0x4427ce=events[_0x8d65('0x4')];_0xd4c678<_0x4427ce;_0xd4c678++){var _0x422e68=events[_0xd4c678];var _0x6666a0=createListener(_0x8d65('0x5')+_0x422e68,_0x40480f);ChatInteractionEvents['on'](_0x422e68,_0x6666a0);}};
\ No newline at end of file
+var _0xc7e1=['remove','removeListener','register','length','./chatInteraction.events','save'];(function(_0x110065,_0x2ae661){var _0x219dc5=function(_0x511f69){while(--_0x511f69){_0x110065['push'](_0x110065['shift']());}};_0x219dc5(++_0x2ae661);}(_0xc7e1,0x11e));var _0x1c7e=function(_0x22cc91,_0x154bd0){_0x22cc91=_0x22cc91-0x0;var _0x1bdfda=_0xc7e1[_0x22cc91];return _0x1bdfda;};'use strict';var ChatInteractionEvents=require(_0x1c7e('0x0'));var events=[_0x1c7e('0x1'),_0x1c7e('0x2'),'update'];function createListener(_0x5b23e8,_0x161164){return function(_0x5cd0ee){_0x161164['emit'](_0x5b23e8,_0x5cd0ee);};}function removeListener(_0x3bd04c,_0x120014){return function(){ChatInteractionEvents[_0x1c7e('0x3')](_0x3bd04c,_0x120014);};}exports[_0x1c7e('0x4')]=function(_0x54ea0e){for(var _0x75d274=0x0,_0x275546=events[_0x1c7e('0x5')];_0x75d274<_0x275546;_0x75d274++){var _0x552d89=events[_0x75d274];var _0xd3791d=createListener('chatInteraction:'+_0x552d89,_0x54ea0e);ChatInteractionEvents['on'](_0x552d89,_0xd3791d);}};
\ No newline at end of file
index 3dfbe53..d69bc16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5840=['/:id','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x5840,0x111));var _0x0584=function(_0x31d99f,_0x1c55df){_0x31d99f=_0x31d99f-0x0;var _0x5bcd81=_0x5840[_0x31d99f];return _0x5bcd81;};'use strict';var multer=require(_0x0584('0x0'));var util=require('util');var path=require(_0x0584('0x1'));var timeout=require('connect-timeout');var express=require(_0x0584('0x2'));var router=express['Router']();var fs_extra=require(_0x0584('0x3'));var auth=require(_0x0584('0x4'));var interaction=require(_0x0584('0x5'));var config=require(_0x0584('0x6'));var controller=require('./chatInteraction.controller');router[_0x0584('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0584('0x7')](_0x0584('0x8'),auth[_0x0584('0x9')](),controller[_0x0584('0xa')]);router[_0x0584('0x7')]('/:id',auth[_0x0584('0xb')](),controller[_0x0584('0xc')]);router[_0x0584('0x7')](_0x0584('0xd'),auth[_0x0584('0xb')](),controller[_0x0584('0xe')]);router['get'](_0x0584('0xf'),auth[_0x0584('0x9')](),controller['getMessages']);router[_0x0584('0x7')](_0x0584('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x0584('0x11'),auth[_0x0584('0x9')](),controller['download']);router['post']('/',auth[_0x0584('0x9')](),controller['create']);router[_0x0584('0x12')](_0x0584('0x13'),auth[_0x0584('0x9')](),controller[_0x0584('0x14')]);var upload=multer({'storage':multer[_0x0584('0x15')]({'destination':function(_0x4b7e13,_0x5e43cd,_0x56dd50){_0x56dd50(null,path[_0x0584('0x16')](config[_0x0584('0x17')],_0x0584('0x18')));},'filename':function(_0x3f3abd,_0x3fb953,_0x1dac1e){_0x1dac1e(null,util[_0x0584('0x19')](_0x0584('0x1a'),Date[_0x0584('0x1b')](),_0x3fb953[_0x0584('0x1c')][_0x0584('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0584('0x1e'),upload['single'](_0x0584('0x1f')),controller[_0x0584('0x20')]);router['post']('/:id/messages',auth[_0x0584('0xb')](),controller[_0x0584('0x21')]);router[_0x0584('0x12')](_0x0584('0x22'),auth[_0x0584('0x9')](),interaction[_0x0584('0x23')]('chat',_0x0584('0x24')),controller[_0x0584('0x25')]);router[_0x0584('0x26')](_0x0584('0x27'),auth[_0x0584('0x9')](),interaction['tracked'](_0x0584('0x28'),_0x0584('0x29')),controller[_0x0584('0x2a')]);router[_0x0584('0x26')](_0x0584('0x2b'),controller[_0x0584('0x2c')]);router['put'](_0x0584('0x2d'),auth[_0x0584('0xb')](),controller[_0x0584('0x2e')]);router[_0x0584('0x26')]('/:id/close',controller['close']);router['delete'](_0x0584('0x27'),auth[_0x0584('0x9')](),interaction['tracked'](_0x0584('0x28'),_0x0584('0x2f')),controller[_0x0584('0x30')]);router[_0x0584('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0584('0x32')]);module[_0x0584('0x33')]=router;
\ No newline at end of file
+var _0x345b=['/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon'];(function(_0x94f760,_0x4f1b70){var _0x3aec01=function(_0x15c485){while(--_0x15c485){_0x94f760['push'](_0x94f760['shift']());}};_0x3aec01(++_0x4f1b70);}(_0x345b,0x74));var _0xb345=function(_0x41bc6b,_0x5ecf42){_0x41bc6b=_0x41bc6b-0x0;var _0x3c3f76=_0x345b[_0x41bc6b];return _0x3c3f76;};'use strict';var multer=require('multer');var util=require(_0xb345('0x0'));var path=require(_0xb345('0x1'));var timeout=require(_0xb345('0x2'));var express=require('express');var router=express[_0xb345('0x3')]();var fs_extra=require(_0xb345('0x4'));var auth=require(_0xb345('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb345('0x6'));var controller=require(_0xb345('0x7'));router[_0xb345('0x8')]('/',auth[_0xb345('0x9')](),controller[_0xb345('0xa')]);router['get'](_0xb345('0xb'),auth['isAuthenticated'](),controller[_0xb345('0xc')]);router[_0xb345('0x8')](_0xb345('0xd'),auth[_0xb345('0xe')](),controller['show']);router['get'](_0xb345('0xf'),auth[_0xb345('0xe')](),controller[_0xb345('0x10')]);router[_0xb345('0x8')](_0xb345('0x11'),auth['isAuthenticated'](),controller[_0xb345('0x12')]);router['get'](_0xb345('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xb345('0x8')](_0xb345('0x14'),auth[_0xb345('0x9')](),controller[_0xb345('0x15')]);router[_0xb345('0x16')]('/',auth['isAuthenticated'](),controller[_0xb345('0x17')]);router[_0xb345('0x16')](_0xb345('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xb345('0x19')]({'destination':function(_0x4b468f,_0x449bca,_0x211c35){_0x211c35(null,path[_0xb345('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x14f849,_0x1a74c8,_0x160061){_0x160061(null,util[_0xb345('0x1b')](_0xb345('0x1c'),Date['now'](),_0x1a74c8[_0xb345('0x1d')][_0xb345('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb345('0x1f'),upload[_0xb345('0x20')](_0xb345('0x21')),controller[_0xb345('0x22')]);router[_0xb345('0x16')](_0xb345('0x11'),auth[_0xb345('0xe')](),controller['addMessage']);router[_0xb345('0x16')]('/:id/tags',auth[_0xb345('0x9')](),interaction[_0xb345('0x23')](_0xb345('0x24'),_0xb345('0x25')),controller[_0xb345('0x26')]);router[_0xb345('0x27')](_0xb345('0xd'),auth[_0xb345('0x9')](),interaction[_0xb345('0x23')](_0xb345('0x24'),_0xb345('0x28')),controller[_0xb345('0x29')]);router[_0xb345('0x27')](_0xb345('0x2a'),controller[_0xb345('0x2b')]);router[_0xb345('0x27')](_0xb345('0x2c'),auth[_0xb345('0xe')](),controller[_0xb345('0x2d')]);router['put'](_0xb345('0x2e'),controller[_0xb345('0x2f')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked']('chat',_0xb345('0x30')),controller[_0xb345('0x31')]);router[_0xb345('0x32')](_0xb345('0x33'),auth[_0xb345('0x9')](),controller[_0xb345('0x34')]);module[_0xb345('0x35')]=router;
\ No newline at end of file
index 27a3127..7c36cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb8=['INTEGER','exports','medium','BOOLEAN'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfeb8,0x155));var _0x8feb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfeb8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x8feb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8feb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x8feb('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8feb('0x3')]}};
\ No newline at end of file
+var _0x3f9d=['INTEGER','sequelize','exports','TEXT'];(function(_0x1df443,_0x2860fe){var _0x3ee434=function(_0x4a61b6){while(--_0x4a61b6){_0x1df443['push'](_0x1df443['shift']());}};_0x3ee434(++_0x2860fe);}(_0x3f9d,0x109));var _0xd3f9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x3f9d[_0x3ba924];return _0x4cc1df;};'use strict';var Sequelize=require(_0xd3f9('0x0'));module[_0xd3f9('0x1')]={'body':{'type':Sequelize[_0xd3f9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3f9('0x3')]}};
\ No newline at end of file
index 7529c6c..fbca5a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb887=['ToId','read','all','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','json','apply','reject','save','destroy','name','send','index','map','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','then','rows','catch','params','rawAttributes','filters','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','fullname','role','userpic','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId'];(function(_0x319cf9,_0x42c345){var _0x179cec=function(_0x318d2e){while(--_0x318d2e){_0x319cf9['push'](_0x319cf9['shift']());}};_0x179cec(++_0x42c345);}(_0xb887,0x14d));var _0x7b88=function(_0x5d9806,_0x45ef88){_0x5d9806=_0x5d9806-0x0;var _0x335764=_0xb887[_0x5d9806];return _0x335764;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b88('0x0'));var zipdir=require(_0x7b88('0x1'));var jsonpatch=require(_0x7b88('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b88('0x3'));var Mustache=require(_0x7b88('0x4'));var util=require(_0x7b88('0x5'));var path=require(_0x7b88('0x6'));var sox=require(_0x7b88('0x7'));var csv=require('to-csv');var ejs=require(_0x7b88('0x8'));var fs=require('fs');var fs_extra=require(_0x7b88('0x9'));var _=require(_0x7b88('0xa'));var squel=require(_0x7b88('0xb'));var crypto=require('crypto');var jsforce=require(_0x7b88('0xc'));var deskjs=require(_0x7b88('0xd'));var toCsv=require(_0x7b88('0xe'));var querystring=require(_0x7b88('0xf'));var Papa=require(_0x7b88('0x10'));var Redis=require(_0x7b88('0x11'));var authService=require(_0x7b88('0x12'));var qs=require(_0x7b88('0x13'));var as=require(_0x7b88('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b88('0x15'))('api');var utils=require(_0x7b88('0x16'));var config=require(_0x7b88('0x17'));var licenseUtil=require(_0x7b88('0x18'));var db=require(_0x7b88('0x19'))['db'];config[_0x7b88('0x1a')]=_['defaults'](config[_0x7b88('0x1a')],{'host':_0x7b88('0x1b'),'port':0x18eb});var socket=require(_0x7b88('0x1c'))(new Redis(config[_0x7b88('0x1a')]));require(_0x7b88('0x1d'))[_0x7b88('0x1e')](socket);function respondWithStatusCode(_0x144607,_0xd2c9ee){_0xd2c9ee=_0xd2c9ee||0xcc;return function(_0x57b193){if(_0x57b193){return _0x144607[_0x7b88('0x1f')](_0xd2c9ee);}return _0x144607['status'](_0xd2c9ee)[_0x7b88('0x20')]();};}function respondWithResult(_0x4010ab,_0x571941){_0x571941=_0x571941||0xc8;return function(_0x513f2a){if(_0x513f2a){return _0x4010ab['status'](_0x571941)['json'](_0x513f2a);}};}function respondWithFilteredResult(_0xb1193,_0x3e9d7b){return function(_0x32d68e){if(_0x32d68e){var _0x476a19=typeof _0x3e9d7b['offset']==='undefined'&&typeof _0x3e9d7b['limit']===_0x7b88('0x21');var _0x1ae55b=_0x32d68e[_0x7b88('0x22')];var _0xe09cb3=_0x476a19?0x0:_0x3e9d7b['offset'];var _0x44d53f=_0x476a19?_0x32d68e['count']:_0x3e9d7b[_0x7b88('0x23')]+_0x3e9d7b[_0x7b88('0x24')];var _0x1b181a;if(_0x44d53f>=_0x1ae55b){_0x44d53f=_0x1ae55b;_0x1b181a=0xc8;}else{_0x1b181a=0xce;}_0xb1193[_0x7b88('0x25')](_0x1b181a);return _0xb1193[_0x7b88('0x26')](_0x7b88('0x27'),_0xe09cb3+'-'+_0x44d53f+'/'+_0x1ae55b)[_0x7b88('0x28')](_0x32d68e);}return null;};}function patchUpdates(_0x367ba4){return function(_0xd8bfc2){try{jsonpatch[_0x7b88('0x29')](_0xd8bfc2,_0x367ba4,!![]);}catch(_0x5b5ee0){return BPromise[_0x7b88('0x2a')](_0x5b5ee0);}return _0xd8bfc2[_0x7b88('0x2b')]();};}function saveUpdates(_0x12f91f,_0x41f17f){return function(_0x5f3e07){if(_0x5f3e07){return _0x5f3e07['update'](_0x12f91f)['then'](function(_0x16a042){return _0x16a042;});}return null;};}function removeEntity(_0x1c3057,_0x5c8e9f){return function(_0x37349c){if(_0x37349c){return _0x37349c[_0x7b88('0x2c')]()['then'](function(){_0x1c3057[_0x7b88('0x25')](0xcc)[_0x7b88('0x20')]();});}};}function handleEntityNotFound(_0x85bebc,_0xf381){return function(_0x949f03){if(!_0x949f03){_0x85bebc[_0x7b88('0x1f')](0x194);}return _0x949f03;};}function handleError(_0x532358,_0x527f4d){_0x527f4d=_0x527f4d||0x1f4;return function(_0x460a0c){logger['error'](_0x460a0c['stack']);if(_0x460a0c[_0x7b88('0x2d')]){delete _0x460a0c[_0x7b88('0x2d')];}_0x532358[_0x7b88('0x25')](_0x527f4d)[_0x7b88('0x2e')](_0x460a0c);};}exports[_0x7b88('0x2f')]=function(_0x288914,_0x1a6f1a){var _0x5bae3b={},_0x53a5a5={},_0x52e0c7={'count':0x0,'rows':[]};var _0x2e045a=_[_0x7b88('0x30')](db['ChatInternalMessage']['rawAttributes'],function(_0x5e4754){return{'name':_0x5e4754['fieldName'],'type':_0x5e4754['type']['key']};});_0x53a5a5[_0x7b88('0x31')]=_[_0x7b88('0x30')](_0x2e045a,_0x7b88('0x2d'));_0x53a5a5[_0x7b88('0x32')]=_[_0x7b88('0x33')](_0x288914[_0x7b88('0x32')]);_0x53a5a5['filters']=_[_0x7b88('0x34')](_0x53a5a5[_0x7b88('0x31')],_0x53a5a5[_0x7b88('0x32')]);_0x5bae3b[_0x7b88('0x35')]=_[_0x7b88('0x34')](_0x53a5a5[_0x7b88('0x31')],qs[_0x7b88('0x36')](_0x288914[_0x7b88('0x32')][_0x7b88('0x36')]));_0x5bae3b[_0x7b88('0x35')]=_0x5bae3b['attributes'][_0x7b88('0x37')]?_0x5bae3b[_0x7b88('0x35')]:_0x53a5a5[_0x7b88('0x31')];if(!_0x288914['query'][_0x7b88('0x38')](_0x7b88('0x39'))){_0x5bae3b['limit']=qs['limit'](_0x288914['query']['limit']);_0x5bae3b['offset']=qs[_0x7b88('0x23')](_0x288914[_0x7b88('0x32')][_0x7b88('0x23')]);}_0x5bae3b[_0x7b88('0x3a')]=qs[_0x7b88('0x3b')](_0x288914[_0x7b88('0x32')]['sort']);_0x5bae3b[_0x7b88('0x3c')]=qs['filters'](_[_0x7b88('0x3d')](_0x288914[_0x7b88('0x32')],_0x53a5a5['filters']),_0x2e045a);if(_0x288914[_0x7b88('0x32')][_0x7b88('0x3e')]){_0x5bae3b['where']=_[_0x7b88('0x3f')](_0x5bae3b['where'],{'$or':_['map'](_0x2e045a,function(_0x541b3a){if(_0x541b3a[_0x7b88('0x40')]!==_0x7b88('0x41')){var _0x3d3f7f={};_0x3d3f7f[_0x541b3a[_0x7b88('0x2d')]]={'$like':'%'+_0x288914[_0x7b88('0x32')][_0x7b88('0x3e')]+'%'};return _0x3d3f7f;}})});}_0x5bae3b=_[_0x7b88('0x3f')]({},_0x5bae3b,_0x288914[_0x7b88('0x42')]);var _0xa3f8f3={'where':_0x5bae3b[_0x7b88('0x3c')]};return db[_0x7b88('0x43')][_0x7b88('0x22')](_0xa3f8f3)['then'](function(_0xafd838){_0x52e0c7[_0x7b88('0x22')]=_0xafd838;if(_0x288914['query'][_0x7b88('0x44')]){_0x5bae3b[_0x7b88('0x45')]=[{'all':!![]}];}return db[_0x7b88('0x43')][_0x7b88('0x46')](_0x5bae3b);})[_0x7b88('0x47')](function(_0x105982){_0x52e0c7[_0x7b88('0x48')]=_0x105982;return _0x52e0c7;})[_0x7b88('0x47')](respondWithFilteredResult(_0x1a6f1a,_0x5bae3b))[_0x7b88('0x49')](handleError(_0x1a6f1a,null));};exports['show']=function(_0x32d584,_0x3356ff){var _0x4882dd={'raw':!![],'where':{'id':_0x32d584[_0x7b88('0x4a')]['id']}},_0x2ce00f={};_0x2ce00f[_0x7b88('0x31')]=_['keys'](db[_0x7b88('0x43')][_0x7b88('0x4b')]);_0x2ce00f[_0x7b88('0x32')]=_[_0x7b88('0x33')](_0x32d584[_0x7b88('0x32')]);_0x2ce00f[_0x7b88('0x4c')]=_[_0x7b88('0x34')](_0x2ce00f[_0x7b88('0x31')],_0x2ce00f[_0x7b88('0x32')]);_0x4882dd['attributes']=_[_0x7b88('0x34')](_0x2ce00f[_0x7b88('0x31')],qs['fields'](_0x32d584[_0x7b88('0x32')][_0x7b88('0x36')]));_0x4882dd[_0x7b88('0x35')]=_0x4882dd[_0x7b88('0x35')][_0x7b88('0x37')]?_0x4882dd[_0x7b88('0x35')]:_0x2ce00f['model'];if(_0x32d584['query'][_0x7b88('0x44')]){_0x4882dd['include']=[{'all':!![]}];}_0x4882dd=_[_0x7b88('0x3f')]({},_0x4882dd,_0x32d584[_0x7b88('0x42')]);return db[_0x7b88('0x43')][_0x7b88('0x4d')](_0x4882dd)[_0x7b88('0x47')](handleEntityNotFound(_0x3356ff,null))[_0x7b88('0x47')](respondWithResult(_0x3356ff,null))['catch'](handleError(_0x3356ff,null));};exports[_0x7b88('0x4e')]=function(_0x5a534d,_0x415ecc){return db['ChatInternalMessage'][_0x7b88('0x4e')](_0x5a534d['body'],{})[_0x7b88('0x47')](respondWithResult(_0x415ecc,0xc9))[_0x7b88('0x49')](handleError(_0x415ecc,null));};exports['update']=function(_0x1fb632,_0x4e59b7){if(_0x1fb632[_0x7b88('0x4f')]['id']){delete _0x1fb632[_0x7b88('0x4f')]['id'];}return db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'id':_0x1fb632['params']['id']}})[_0x7b88('0x47')](handleEntityNotFound(_0x4e59b7,null))['then'](saveUpdates(_0x1fb632[_0x7b88('0x4f')],null))[_0x7b88('0x47')](respondWithResult(_0x4e59b7,null))[_0x7b88('0x49')](handleError(_0x4e59b7,null));};exports[_0x7b88('0x2c')]=function(_0x119264,_0x15151e){return db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'id':_0x119264[_0x7b88('0x4a')]['id']}})[_0x7b88('0x47')](handleEntityNotFound(_0x15151e,null))[_0x7b88('0x47')](removeEntity(_0x15151e,null))['catch'](handleError(_0x15151e,null));};exports[_0x7b88('0x50')]=function(_0xe9051f,_0x138bbd){return db[_0x7b88('0x43')][_0x7b88('0x50')]()[_0x7b88('0x47')](respondWithResult(_0x138bbd,null))[_0x7b88('0x49')](handleError(_0x138bbd,null));};function wrapUser(_0x543a7b){return function(_0x1d5d13){var _0x10343c=_0x543a7b[_0x7b88('0x51')]({'plain':!![]});_0x10343c['messages']=[];if(_0x1d5d13){_0x10343c[_0x7b88('0x52')]=_0x1d5d13[_0x7b88('0x53')];_0x10343c[_0x7b88('0x54')]=_0x1d5d13;}else{_0x10343c['lastMessageAt']=moment(0x0)[_0x7b88('0x55')](_0x7b88('0x56'));_0x10343c[_0x7b88('0x54')]={};}return _0x10343c;};}exports['getUsers']=function(_0x1d9617,_0x5c6a0a,_0x250673){var _0x2205f4=[];return db[_0x7b88('0x57')]['findAll']({'where':{'role':[_0x7b88('0x58'),_0x7b88('0x59'),'user']},'attributes':['id',_0x7b88('0x5a'),_0x7b88('0x2d'),_0x7b88('0x5b'),_0x7b88('0x5c'),'internal','online',_0x7b88('0x5d'),'allowmessenger',_0x7b88('0x5e')],'order':qs[_0x7b88('0x3b')]('-online'),'include':[{'model':db[_0x7b88('0x5f')],'as':_0x7b88('0x60'),'attributes':['id',_0x7b88('0x2d'),_0x7b88('0x40')],'through':{'attributes':[]}}]})[_0x7b88('0x47')](function(_0x14cb2a){if(_0x14cb2a){var _0xa859af=_0x1d9617[_0x7b88('0x61')][_0x7b88('0x51')]({'plain':!![]});if(!_0xa859af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa859af[_0x7b88('0x5b')]===_0x7b88('0x61')){return db['UserProfileSection']['find']({'where':{'name':_0x7b88('0x62'),'userProfileId':_0xa859af[_0x7b88('0x63')]},'raw':!![]})['then'](function(_0x54cc97){if(_0x54cc97){if(_0x54cc97[_0x7b88('0x64')]===0x0){return db[_0x7b88('0x65')][_0x7b88('0x46')]({'where':{'sectionId':_0x54cc97['id']},'raw':!![]})['then'](function(_0x569e00){var _0x5bd9fa=[];if(_[_0x7b88('0x66')](_0x569e00)){_0x5bd9fa=_[_0x7b88('0x3e')](_0x14cb2a,function(_0x3dc39a){if(_0x3dc39a[_0x7b88('0x5b')]!==_0x7b88('0x58')){return _0x3dc39a;}});return _0x5bd9fa;}else{for(var _0x86d4f=0x0;_0x86d4f<_0x14cb2a['length'];_0x86d4f++){var _0x289faa=_0x14cb2a[_0x86d4f];if(_0x289faa[_0x7b88('0x5b')]==='agent'){var _0x4ad63a=_[_0x7b88('0x4d')](_0x569e00,function(_0x446a91){return _0x446a91[_0x7b88('0x67')]===_0x289faa['id'];});if(_0x4ad63a)_0x5bd9fa[_0x7b88('0x68')](_0x289faa);}else{_0x5bd9fa['push'](_0x289faa);}}return _0x5bd9fa;}});}else{return _0x14cb2a;}}else{var _0x2fca62=_[_0x7b88('0x3e')](_0x14cb2a,function(_0x45e3fd){if(_0x45e3fd[_0x7b88('0x5b')]!==_0x7b88('0x58')){return _0x45e3fd;}});return _0x2fca62;}});}else{return _0x14cb2a;}}})['then'](function(_0x3740be){var _0x2a27fd=[];if(_0x3740be){_0x2205f4=_0x3740be;for(var _0x224394=0x0;_0x224394<_0x3740be[_0x7b88('0x37')];_0x224394+=0x1){_0x2205f4[_0x224394][_0x7b88('0x69')]=[];_0x2a27fd[_0x7b88('0x68')](db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'FromId':[_0x1d9617[_0x7b88('0x61')]['id'],_0x3740be[_0x224394]['id']],'ToId':[_0x1d9617[_0x7b88('0x61')]['id'],_0x3740be[_0x224394]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7b88('0x6a'),_0x7b88('0x6b'),_0x7b88('0x6c'),'body'],'order':qs[_0x7b88('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b88('0x47')](wrapUser(_0x3740be[_0x224394])));}return BPromise[_0x7b88('0x6d')](_0x2a27fd);}return[];})[_0x7b88('0x47')](function(_0x430591){return{'rows':_0x430591,'count':_0x430591[_0x7b88('0x37')]};})['then'](respondWithResult(_0x5c6a0a,null))[_0x7b88('0x49')](handleError(_0x5c6a0a,null));};
\ No newline at end of file
+var _0x7877=['lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','catch','show','filters','fields','include','find','create','body','params','describe'];(function(_0x566c8e,_0x149011){var _0x589258=function(_0x67e117){while(--_0x67e117){_0x566c8e['push'](_0x566c8e['shift']());}};_0x589258(++_0x149011);}(_0x7877,0x1e0));var _0x7787=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0x7877[_0x4c16c4];return _0x2d2ddf;};'use strict';var emlformat=require(_0x7787('0x0'));var rimraf=require(_0x7787('0x1'));var zipdir=require(_0x7787('0x2'));var jsonpatch=require(_0x7787('0x3'));var rp=require(_0x7787('0x4'));var moment=require(_0x7787('0x5'));var BPromise=require(_0x7787('0x6'));var Mustache=require(_0x7787('0x7'));var util=require(_0x7787('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7787('0x9'));var ejs=require(_0x7787('0xa'));var fs=require('fs');var fs_extra=require(_0x7787('0xb'));var _=require(_0x7787('0xc'));var squel=require(_0x7787('0xd'));var crypto=require(_0x7787('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7787('0x9'));var querystring=require('querystring');var Papa=require(_0x7787('0xf'));var Redis=require(_0x7787('0x10'));var authService=require(_0x7787('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7787('0x12'));var hardwareService=require(_0x7787('0x13'));var logger=require(_0x7787('0x14'))(_0x7787('0x15'));var utils=require(_0x7787('0x16'));var config=require(_0x7787('0x17'));var licenseUtil=require(_0x7787('0x18'));var db=require(_0x7787('0x19'))['db'];config[_0x7787('0x1a')]=_[_0x7787('0x1b')](config[_0x7787('0x1a')],{'host':_0x7787('0x1c'),'port':0x18eb});var socket=require(_0x7787('0x1d'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x3882f6,_0x48929f){_0x48929f=_0x48929f||0xcc;return function(_0x4dd3b6){if(_0x4dd3b6){return _0x3882f6[_0x7787('0x1e')](_0x48929f);}return _0x3882f6[_0x7787('0x1f')](_0x48929f)[_0x7787('0x20')]();};}function respondWithResult(_0x2ae6f6,_0x1eea75){_0x1eea75=_0x1eea75||0xc8;return function(_0x28d773){if(_0x28d773){return _0x2ae6f6[_0x7787('0x1f')](_0x1eea75)[_0x7787('0x21')](_0x28d773);}};}function respondWithFilteredResult(_0x393c5f,_0xddf4b5){return function(_0x43f8a5){if(_0x43f8a5){var _0x22a2d3=typeof _0xddf4b5[_0x7787('0x22')]===_0x7787('0x23')&&typeof _0xddf4b5[_0x7787('0x24')]==='undefined';var _0x325e41=_0x43f8a5[_0x7787('0x25')];var _0x50c583=_0x22a2d3?0x0:_0xddf4b5['offset'];var _0x576992=_0x22a2d3?_0x43f8a5[_0x7787('0x25')]:_0xddf4b5[_0x7787('0x22')]+_0xddf4b5[_0x7787('0x24')];var _0x43c6e0;if(_0x576992>=_0x325e41){_0x576992=_0x325e41;_0x43c6e0=0xc8;}else{_0x43c6e0=0xce;}_0x393c5f[_0x7787('0x1f')](_0x43c6e0);return _0x393c5f['set'](_0x7787('0x26'),_0x50c583+'-'+_0x576992+'/'+_0x325e41)[_0x7787('0x21')](_0x43f8a5);}return null;};}function patchUpdates(_0x42afdb){return function(_0x111c84){try{jsonpatch[_0x7787('0x27')](_0x111c84,_0x42afdb,!![]);}catch(_0x3a3465){return BPromise[_0x7787('0x28')](_0x3a3465);}return _0x111c84[_0x7787('0x29')]();};}function saveUpdates(_0x443624,_0x2f33d1){return function(_0x4b1b84){if(_0x4b1b84){return _0x4b1b84[_0x7787('0x2a')](_0x443624)[_0x7787('0x2b')](function(_0x3e4ed6){return _0x3e4ed6;});}return null;};}function removeEntity(_0x38a998,_0x40821d){return function(_0x194367){if(_0x194367){return _0x194367[_0x7787('0x2c')]()[_0x7787('0x2b')](function(){_0x38a998['status'](0xcc)[_0x7787('0x20')]();});}};}function handleEntityNotFound(_0x4bc24f,_0x444d2a){return function(_0x33e0e7){if(!_0x33e0e7){_0x4bc24f['sendStatus'](0x194);}return _0x33e0e7;};}function handleError(_0x14403d,_0x17cded){_0x17cded=_0x17cded||0x1f4;return function(_0x2ae6cf){logger['error'](_0x2ae6cf[_0x7787('0x2d')]);if(_0x2ae6cf[_0x7787('0x2e')]){delete _0x2ae6cf[_0x7787('0x2e')];}_0x14403d[_0x7787('0x1f')](_0x17cded)[_0x7787('0x2f')](_0x2ae6cf);};}exports[_0x7787('0x30')]=function(_0x19d5ad,_0x595b49){var _0xe4c499={},_0x324bea={},_0x59a55d={'count':0x0,'rows':[]};var _0x8a5120=_[_0x7787('0x31')](db[_0x7787('0x32')][_0x7787('0x33')],function(_0x528eaf){return{'name':_0x528eaf[_0x7787('0x34')],'type':_0x528eaf[_0x7787('0x35')][_0x7787('0x36')]};});_0x324bea[_0x7787('0x37')]=_[_0x7787('0x31')](_0x8a5120,_0x7787('0x2e'));_0x324bea[_0x7787('0x38')]=_[_0x7787('0x39')](_0x19d5ad[_0x7787('0x38')]);_0x324bea['filters']=_['intersection'](_0x324bea[_0x7787('0x37')],_0x324bea[_0x7787('0x38')]);_0xe4c499['attributes']=_[_0x7787('0x3a')](_0x324bea[_0x7787('0x37')],qs['fields'](_0x19d5ad[_0x7787('0x38')]['fields']));_0xe4c499[_0x7787('0x3b')]=_0xe4c499[_0x7787('0x3b')][_0x7787('0x3c')]?_0xe4c499[_0x7787('0x3b')]:_0x324bea['model'];if(!_0x19d5ad[_0x7787('0x38')][_0x7787('0x3d')](_0x7787('0x3e'))){_0xe4c499[_0x7787('0x24')]=qs['limit'](_0x19d5ad[_0x7787('0x38')][_0x7787('0x24')]);_0xe4c499['offset']=qs[_0x7787('0x22')](_0x19d5ad[_0x7787('0x38')]['offset']);}_0xe4c499['order']=qs[_0x7787('0x3f')](_0x19d5ad['query'][_0x7787('0x3f')]);_0xe4c499['where']=qs['filters'](_['pick'](_0x19d5ad[_0x7787('0x38')],_0x324bea['filters']),_0x8a5120);if(_0x19d5ad[_0x7787('0x38')][_0x7787('0x40')]){_0xe4c499[_0x7787('0x41')]=_['merge'](_0xe4c499[_0x7787('0x41')],{'$or':_[_0x7787('0x31')](_0x8a5120,function(_0x9a5663){if(_0x9a5663['type']!==_0x7787('0x42')){var _0x5f19fb={};_0x5f19fb[_0x9a5663[_0x7787('0x2e')]]={'$like':'%'+_0x19d5ad[_0x7787('0x38')][_0x7787('0x40')]+'%'};return _0x5f19fb;}})});}_0xe4c499=_[_0x7787('0x43')]({},_0xe4c499,_0x19d5ad[_0x7787('0x44')]);var _0x5e9b7f={'where':_0xe4c499[_0x7787('0x41')]};return db[_0x7787('0x32')][_0x7787('0x25')](_0x5e9b7f)[_0x7787('0x2b')](function(_0x2aec45){_0x59a55d[_0x7787('0x25')]=_0x2aec45;if(_0x19d5ad[_0x7787('0x38')][_0x7787('0x45')]){_0xe4c499['include']=[{'all':!![]}];}return db[_0x7787('0x32')]['findAll'](_0xe4c499);})['then'](function(_0x1a9650){_0x59a55d['rows']=_0x1a9650;return _0x59a55d;})[_0x7787('0x2b')](respondWithFilteredResult(_0x595b49,_0xe4c499))[_0x7787('0x46')](handleError(_0x595b49,null));};exports[_0x7787('0x47')]=function(_0x460fa1,_0x32274c){var _0x23932d={'raw':!![],'where':{'id':_0x460fa1['params']['id']}},_0x96b9c2={};_0x96b9c2[_0x7787('0x37')]=_[_0x7787('0x39')](db['ChatInternalMessage']['rawAttributes']);_0x96b9c2[_0x7787('0x38')]=_[_0x7787('0x39')](_0x460fa1[_0x7787('0x38')]);_0x96b9c2[_0x7787('0x48')]=_['intersection'](_0x96b9c2[_0x7787('0x37')],_0x96b9c2[_0x7787('0x38')]);_0x23932d['attributes']=_[_0x7787('0x3a')](_0x96b9c2[_0x7787('0x37')],qs['fields'](_0x460fa1[_0x7787('0x38')][_0x7787('0x49')]));_0x23932d['attributes']=_0x23932d[_0x7787('0x3b')][_0x7787('0x3c')]?_0x23932d[_0x7787('0x3b')]:_0x96b9c2['model'];if(_0x460fa1[_0x7787('0x38')][_0x7787('0x45')]){_0x23932d[_0x7787('0x4a')]=[{'all':!![]}];}_0x23932d=_['merge']({},_0x23932d,_0x460fa1['options']);return db['ChatInternalMessage'][_0x7787('0x4b')](_0x23932d)[_0x7787('0x2b')](handleEntityNotFound(_0x32274c,null))[_0x7787('0x2b')](respondWithResult(_0x32274c,null))[_0x7787('0x46')](handleError(_0x32274c,null));};exports[_0x7787('0x4c')]=function(_0x42ee6e,_0x1c904a){return db[_0x7787('0x32')]['create'](_0x42ee6e['body'],{})['then'](respondWithResult(_0x1c904a,0xc9))[_0x7787('0x46')](handleError(_0x1c904a,null));};exports[_0x7787('0x2a')]=function(_0x14d1fe,_0x461807){if(_0x14d1fe[_0x7787('0x4d')]['id']){delete _0x14d1fe['body']['id'];}return db[_0x7787('0x32')][_0x7787('0x4b')]({'where':{'id':_0x14d1fe[_0x7787('0x4e')]['id']}})[_0x7787('0x2b')](handleEntityNotFound(_0x461807,null))[_0x7787('0x2b')](saveUpdates(_0x14d1fe[_0x7787('0x4d')],null))['then'](respondWithResult(_0x461807,null))[_0x7787('0x46')](handleError(_0x461807,null));};exports['destroy']=function(_0xe6d878,_0x3accdd){return db['ChatInternalMessage'][_0x7787('0x4b')]({'where':{'id':_0xe6d878['params']['id']}})['then'](handleEntityNotFound(_0x3accdd,null))[_0x7787('0x2b')](removeEntity(_0x3accdd,null))[_0x7787('0x46')](handleError(_0x3accdd,null));};exports[_0x7787('0x4f')]=function(_0x2b0e46,_0x5e4983){return db[_0x7787('0x32')]['describe']()[_0x7787('0x2b')](respondWithResult(_0x5e4983,null))['catch'](handleError(_0x5e4983,null));};function wrapUser(_0x2717fd){return function(_0x5eb413){var _0x1b5b1e=_0x2717fd['get']({'plain':!![]});_0x1b5b1e['messages']=[];if(_0x5eb413){_0x1b5b1e[_0x7787('0x50')]=_0x5eb413[_0x7787('0x51')];_0x1b5b1e[_0x7787('0x52')]=_0x5eb413;}else{_0x1b5b1e[_0x7787('0x50')]=moment(0x0)['format'](_0x7787('0x53'));_0x1b5b1e[_0x7787('0x52')]={};}return _0x1b5b1e;};}exports[_0x7787('0x54')]=function(_0x49f98e,_0x12a978,_0x4cec69){var _0x36ea5a=[];return db[_0x7787('0x55')][_0x7787('0x56')]({'where':{'role':[_0x7787('0x57'),_0x7787('0x58'),_0x7787('0x59')]},'attributes':['id','fullname',_0x7787('0x2e'),'role','userpic',_0x7787('0x5a'),_0x7787('0x5b'),_0x7787('0x5c'),_0x7787('0x5d'),_0x7787('0x5e')],'order':qs['sort'](_0x7787('0x5f')),'include':[{'model':db[_0x7787('0x60')],'as':_0x7787('0x61'),'attributes':['id',_0x7787('0x2e'),_0x7787('0x35')],'through':{'attributes':[]}}]})[_0x7787('0x2b')](function(_0x4da1a4){if(_0x4da1a4){var _0x492767=_0x49f98e[_0x7787('0x59')][_0x7787('0x62')]({'plain':!![]});if(!_0x492767)throw new Error(_0x7787('0x63'));if(_0x492767[_0x7787('0x64')]===_0x7787('0x59')){return db[_0x7787('0x65')][_0x7787('0x4b')]({'where':{'name':_0x7787('0x66'),'userProfileId':_0x492767[_0x7787('0x67')]},'raw':!![]})[_0x7787('0x2b')](function(_0x437862){if(_0x437862){if(_0x437862['autoAssociation']===0x0){return db[_0x7787('0x68')][_0x7787('0x56')]({'where':{'sectionId':_0x437862['id']},'raw':!![]})[_0x7787('0x2b')](function(_0xa406ea){var _0x580cc8=[];if(_[_0x7787('0x69')](_0xa406ea)){_0x580cc8=_[_0x7787('0x40')](_0x4da1a4,function(_0x13b685){if(_0x13b685[_0x7787('0x64')]!==_0x7787('0x57')){return _0x13b685;}});return _0x580cc8;}else{for(var _0x4e08d1=0x0;_0x4e08d1<_0x4da1a4['length'];_0x4e08d1++){var _0x3b181a=_0x4da1a4[_0x4e08d1];if(_0x3b181a[_0x7787('0x64')]===_0x7787('0x57')){var _0x1850ba=_['find'](_0xa406ea,function(_0x2a972a){return _0x2a972a[_0x7787('0x6a')]===_0x3b181a['id'];});if(_0x1850ba)_0x580cc8[_0x7787('0x6b')](_0x3b181a);}else{_0x580cc8[_0x7787('0x6b')](_0x3b181a);}}return _0x580cc8;}});}else{return _0x4da1a4;}}else{var _0x14017f=_[_0x7787('0x40')](_0x4da1a4,function(_0x1828cb){if(_0x1828cb[_0x7787('0x64')]!=='agent'){return _0x1828cb;}});return _0x14017f;}});}else{return _0x4da1a4;}}})[_0x7787('0x2b')](function(_0x1cc6a3){var _0x1e8396=[];if(_0x1cc6a3){_0x36ea5a=_0x1cc6a3;for(var _0x23394b=0x0;_0x23394b<_0x1cc6a3[_0x7787('0x3c')];_0x23394b+=0x1){_0x36ea5a[_0x23394b]['messages']=[];_0x1e8396[_0x7787('0x6b')](db[_0x7787('0x32')][_0x7787('0x4b')]({'where':{'FromId':[_0x49f98e[_0x7787('0x59')]['id'],_0x1cc6a3[_0x23394b]['id']],'ToId':[_0x49f98e[_0x7787('0x59')]['id'],_0x1cc6a3[_0x23394b]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x7787('0x6c'),_0x7787('0x6d'),'body'],'order':qs[_0x7787('0x3f')](_0x7787('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7787('0x2b')](wrapUser(_0x1cc6a3[_0x23394b])));}return BPromise[_0x7787('0x6f')](_0x1e8396);}return[];})['then'](function(_0x58a9dd){return{'rows':_0x58a9dd,'count':_0x58a9dd[_0x7787('0x3c')]};})[_0x7787('0x2b')](respondWithResult(_0x12a978,null))['catch'](handleError(_0x12a978,null));};
\ No newline at end of file
index 5e23ee1..8e663cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc14c=['ChatInternalMessage','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x5ecb3b,_0x187a51){var _0x33b125=function(_0x2f99dd){while(--_0x2f99dd){_0x5ecb3b['push'](_0x5ecb3b['shift']());}};_0x33b125(++_0x187a51);}(_0xc14c,0x1c6));var _0xcc14=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc14c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xcc14('0x0'));var ChatInternalMessage=require(_0xcc14('0x1'))['db'][_0xcc14('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcc14('0x3')](0x0);var events={'afterCreate':_0xcc14('0x4'),'afterUpdate':_0xcc14('0x5'),'afterDestroy':'remove'};function emitEvent(_0x193ac4){return function(_0x2e0ef2,_0x212414,_0x54469f){ChatInternalMessageEvents[_0xcc14('0x6')](_0x193ac4+':'+_0x2e0ef2['id'],_0x2e0ef2);ChatInternalMessageEvents[_0xcc14('0x6')](_0x193ac4,_0x2e0ef2);_0x54469f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xcc14('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5d0e=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x5d0e,0x1d2));var _0xe5d0=function(_0xad00c6,_0x300093){_0xad00c6=_0xad00c6-0x0;var _0x567159=_0x5d0e[_0xad00c6];return _0x567159;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe5d0('0x0'))['db'][_0xe5d0('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d0('0x2')](0x0);var events={'afterCreate':_0xe5d0('0x3'),'afterUpdate':'update','afterDestroy':_0xe5d0('0x4')};function emitEvent(_0x5887e9){return function(_0x27fdd2,_0x1e7c13,_0x49d8de){ChatInternalMessageEvents['emit'](_0x5887e9+':'+_0x27fdd2['id'],_0x27fdd2);ChatInternalMessageEvents[_0xe5d0('0x5')](_0x5887e9,_0x27fdd2);_0x49d8de(null);};}for(var e in events){if(events[_0xe5d0('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe5d0('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index b7c5a79..8cd39c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa99f=['exports','define','ChatInternalMessage','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x59f896,_0x35c890){var _0x50da4a=function(_0x1d398c){while(--_0x1d398c){_0x59f896['push'](_0x59f896['shift']());}};_0x50da4a(++_0x35c890);}(_0xa99f,0xab));var _0xfa99=function(_0x1e563f,_0x1ad013){_0x1e563f=_0x1e563f-0x0;var _0x10615a=_0xa99f[_0x1e563f];return _0x10615a;};'use strict';var _=require(_0xfa99('0x0'));var util=require(_0xfa99('0x1'));var logger=require(_0xfa99('0x2'))(_0xfa99('0x3'));var moment=require(_0xfa99('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa99('0x5'));var rimraf=require(_0xfa99('0x6'));var config=require(_0xfa99('0x7'));var attributes=require(_0xfa99('0x8'));module[_0xfa99('0x9')]=function(_0x584e36,_0x15982e){return _0x584e36[_0xfa99('0xa')](_0xfa99('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xccd4=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x27e8f4,_0x577fc7){var _0xbeb7ef=function(_0x310a10){while(--_0x310a10){_0x27e8f4['push'](_0x27e8f4['shift']());}};_0xbeb7ef(++_0x577fc7);}(_0xccd4,0x16d));var _0x4ccd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xccd4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4ccd('0x0'));var util=require(_0x4ccd('0x1'));var logger=require('../../config/logger')(_0x4ccd('0x2'));var moment=require(_0x4ccd('0x3'));var BPromise=require(_0x4ccd('0x4'));var rp=require(_0x4ccd('0x5'));var fs=require('fs');var path=require(_0x4ccd('0x6'));var rimraf=require(_0x4ccd('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x4ccd('0x8')]=function(_0x3c222a,_0x46ced8){return _0x3c222a[_0x4ccd('0x9')](_0x4ccd('0xa'),attributes,{'tableName':_0x4ccd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ccd('0xc'),'collate':_0x4ccd('0xd')});};
\ No newline at end of file
index 161d5b1..9058f11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f8=['./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x262f11,_0x5316e8){var _0x258a32=function(_0x183f2f){while(--_0x183f2f){_0x262f11['push'](_0x262f11['shift']());}};_0x258a32(++_0x5316e8);}(_0x94f8,0x19e));var _0x894f=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0x94f8[_0x2d58e6];return _0x5bcd81;};'use strict';var _=require('lodash');var util=require(_0x894f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x894f('0x1'))['db'];var utils=require(_0x894f('0x2'));var logger=require(_0x894f('0x3'))('rpc');var config=require(_0x894f('0x4'));var jayson=require(_0x894f('0x5'));var client=jayson[_0x894f('0x6')][_0x894f('0x7')]({'port':0x232a});config[_0x894f('0x8')]=_[_0x894f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x894f('0xa'))(new Redis(config['redis']));require(_0x894f('0xb'))[_0x894f('0xc')](socket);function respondWithRpcPromise(_0x6586c8,_0x3f0a2b,_0x705ee8){return new BPromise(function(_0x6e4a99,_0x5ce4a5){return client[_0x894f('0xd')](_0x6586c8,_0x705ee8)[_0x894f('0xe')](function(_0x215850){logger[_0x894f('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f0a2b,_0x894f('0x10'));logger[_0x894f('0x11')](_0x894f('0x12'),_0x3f0a2b,_0x894f('0x10'),JSON[_0x894f('0x13')](_0x215850));if(_0x215850[_0x894f('0x14')]){if(_0x215850[_0x894f('0x14')]['code']===0x1f4){logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x215850[_0x894f('0x14')][_0x894f('0x16')]);return _0x5ce4a5(_0x215850['error'][_0x894f('0x16')]);}logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x215850[_0x894f('0x14')]['message']);return _0x6e4a99(_0x215850[_0x894f('0x14')]['message']);}else{logger[_0x894f('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f0a2b,_0x894f('0x10'));_0x6e4a99(_0x215850[_0x894f('0x17')][_0x894f('0x16')]);}})[_0x894f('0x18')](function(_0x13e75b){logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x13e75b);_0x5ce4a5(_0x13e75b);});});}
\ No newline at end of file
+var _0xf5c4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util'];(function(_0x14e4d7,_0x21ca39){var _0x2a9b06=function(_0x2cd8d3){while(--_0x2cd8d3){_0x14e4d7['push'](_0x14e4d7['shift']());}};_0x2a9b06(++_0x21ca39);}(_0xf5c4,0x1a7));var _0x4f5c=function(_0xd6d2b9,_0x48c95a){_0xd6d2b9=_0xd6d2b9-0x0;var _0x2a51c5=_0xf5c4[_0xd6d2b9];return _0x2a51c5;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rs=require(_0x4f5c('0x4'));var fs=require('fs');var Redis=require(_0x4f5c('0x5'));var db=require(_0x4f5c('0x6'))['db'];var utils=require(_0x4f5c('0x7'));var logger=require(_0x4f5c('0x8'))(_0x4f5c('0x9'));var config=require(_0x4f5c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4f5c('0xb')]['http']({'port':0x232a});config['redis']=_[_0x4f5c('0xc')](config[_0x4f5c('0xd')],{'host':_0x4f5c('0xe'),'port':0x18eb});var socket=require(_0x4f5c('0xf'))(new Redis(config[_0x4f5c('0xd')]));require('./chatInternalMessage.socket')[_0x4f5c('0x10')](socket);function respondWithRpcPromise(_0x4f97af,_0x415996,_0x237a70){return new BPromise(function(_0x1aebc6,_0x40cf2d){return client['request'](_0x4f97af,_0x237a70)[_0x4f5c('0x11')](function(_0x2c0f9c){logger[_0x4f5c('0x12')](_0x4f5c('0x13'),_0x415996,'request\x20sent');logger['debug'](_0x4f5c('0x14'),_0x415996,_0x4f5c('0x15'),JSON['stringify'](_0x2c0f9c));if(_0x2c0f9c[_0x4f5c('0x16')]){if(_0x2c0f9c['error']['code']===0x1f4){logger[_0x4f5c('0x16')](_0x4f5c('0x13'),_0x415996,_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);return _0x40cf2d(_0x2c0f9c['error'][_0x4f5c('0x17')]);}logger['error'](_0x4f5c('0x13'),_0x415996,_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);return _0x1aebc6(_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);}else{logger[_0x4f5c('0x12')](_0x4f5c('0x13'),_0x415996,_0x4f5c('0x15'));_0x1aebc6(_0x2c0f9c['result'][_0x4f5c('0x17')]);}})[_0x4f5c('0x18')](function(_0x3ece35){logger[_0x4f5c('0x16')](_0x4f5c('0x13'),_0x415996,_0x3ece35);_0x40cf2d(_0x3ece35);});});}
\ No newline at end of file
index 5ce08e7..1c5c9a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc07a=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0xf0377e,_0x54473f){var _0x18f6ee=function(_0x207f0d){while(--_0x207f0d){_0xf0377e['push'](_0xf0377e['shift']());}};_0x18f6ee(++_0x54473f);}(_0xc07a,0x1b6));var _0xac07=function(_0x3a9b11,_0xb6c98){_0x3a9b11=_0x3a9b11-0x0;var _0x5e6324=_0xc07a[_0x3a9b11];return _0x5e6324;};'use strict';var ChatInternalMessageEvents=require(_0xac07('0x0'));var events=[_0xac07('0x1'),'remove',_0xac07('0x2')];function createListener(_0x22616c,_0x545554){return function(_0x3794da){_0x545554[_0xac07('0x3')](_0x22616c,_0x3794da);};}function removeListener(_0x308a78,_0x2b67ac){return function(){ChatInternalMessageEvents[_0xac07('0x4')](_0x308a78,_0x2b67ac);};}exports[_0xac07('0x5')]=function(_0x1c3e5e){for(var _0x4ac23e=0x0,_0x418fce=events[_0xac07('0x6')];_0x4ac23e<_0x418fce;_0x4ac23e++){var _0x20e3d6=events[_0x4ac23e];var _0x4da314=createListener(_0xac07('0x7')+_0x20e3d6,_0x1c3e5e);ChatInternalMessageEvents['on'](_0x20e3d6,_0x4da314);}};
\ No newline at end of file
+var _0xc2a7=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x17e600,_0x1fdf60){var _0x317515=function(_0x5a4607){while(--_0x5a4607){_0x17e600['push'](_0x17e600['shift']());}};_0x317515(++_0x1fdf60);}(_0xc2a7,0x112));var _0x7c2a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2a7[_0x40a045];return _0x1a687c;};'use strict';var ChatInternalMessageEvents=require(_0x7c2a('0x0'));var events=[_0x7c2a('0x1'),_0x7c2a('0x2'),_0x7c2a('0x3')];function createListener(_0x485258,_0x18eabd){return function(_0x57e811){_0x18eabd[_0x7c2a('0x4')](_0x485258,_0x57e811);};}function removeListener(_0x3cc18e,_0x3ed5d3){return function(){ChatInternalMessageEvents[_0x7c2a('0x5')](_0x3cc18e,_0x3ed5d3);};}exports[_0x7c2a('0x6')]=function(_0x15e9fa){for(var _0x1e3d1f=0x0,_0xf1582b=events[_0x7c2a('0x7')];_0x1e3d1f<_0xf1582b;_0x1e3d1f++){var _0x5bc270=events[_0x1e3d1f];var _0x30ec96=createListener(_0x7c2a('0x8')+_0x5bc270,_0x15e9fa);ChatInternalMessageEvents['on'](_0x5bc270,_0x30ec96);}};
\ No newline at end of file
index a960626..3fb1ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x4a901d,_0x5b966b){var _0x810dad=function(_0x2ff2c7){while(--_0x2ff2c7){_0x4a901d['push'](_0x4a901d['shift']());}};_0x810dad(++_0x5b966b);}(_0xe3d4,0x112));var _0x4e3d=function(_0x47e3f8,_0x517bcd){_0x47e3f8=_0x47e3f8-0x0;var _0x4742d5=_0xe3d4[_0x47e3f8];return _0x4742d5;};'use strict';var multer=require(_0x4e3d('0x0'));var util=require(_0x4e3d('0x1'));var path=require(_0x4e3d('0x2'));var timeout=require(_0x4e3d('0x3'));var express=require(_0x4e3d('0x4'));var router=express[_0x4e3d('0x5')]();var fs_extra=require(_0x4e3d('0x6'));var auth=require(_0x4e3d('0x7'));var interaction=require(_0x4e3d('0x8'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x4e3d('0x9')]('/',auth['isAuthenticated'](),controller[_0x4e3d('0xa')]);router['get'](_0x4e3d('0xb'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xd')]);router[_0x4e3d('0x9')](_0x4e3d('0xe'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xf')]);router[_0x4e3d('0x9')]('/:id',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x10')]);router[_0x4e3d('0x11')]('/',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x12')]);router[_0x4e3d('0x13')]('/:id',controller[_0x4e3d('0x14')]);router[_0x4e3d('0x15')]('/:id',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xbdfa=['show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xbdfa,0x1c0));var _0xabdf=function(_0x42ce5a,_0xd71696){_0x42ce5a=_0x42ce5a-0x0;var _0x3f0661=_0xbdfa[_0x42ce5a];return _0x3f0661;};'use strict';var multer=require(_0xabdf('0x0'));var util=require('util');var path=require(_0xabdf('0x1'));var timeout=require(_0xabdf('0x2'));var express=require(_0xabdf('0x3'));var router=express['Router']();var fs_extra=require(_0xabdf('0x4'));var auth=require(_0xabdf('0x5'));var interaction=require(_0xabdf('0x6'));var config=require(_0xabdf('0x7'));var controller=require(_0xabdf('0x8'));router[_0xabdf('0x9')]('/',auth[_0xabdf('0xa')](),controller['index']);router[_0xabdf('0x9')](_0xabdf('0xb'),auth['isAuthenticated'](),controller[_0xabdf('0xc')]);router[_0xabdf('0x9')]('/users',auth[_0xabdf('0xa')](),controller[_0xabdf('0xd')]);router[_0xabdf('0x9')]('/:id',auth[_0xabdf('0xa')](),controller[_0xabdf('0xe')]);router[_0xabdf('0xf')]('/',auth[_0xabdf('0xa')](),controller[_0xabdf('0x10')]);router[_0xabdf('0x11')](_0xabdf('0x12'),controller[_0xabdf('0x13')]);router[_0xabdf('0x14')](_0xabdf('0x12'),auth[_0xabdf('0xa')](),controller['destroy']);module[_0xabdf('0x15')]=router;
\ No newline at end of file
index 9c658c9..cfc9562 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x174b=['medium','BOOLEAN','ENUM','out','TEXT','sequelize'];(function(_0x28b9ea,_0x5b50f2){var _0x4af8f4=function(_0x302d3a){while(--_0x302d3a){_0x28b9ea['push'](_0x28b9ea['shift']());}};_0x4af8f4(++_0x5b50f2);}(_0x174b,0x19d));var _0xb174=function(_0x13d8c4,_0x52b03e){_0x13d8c4=_0x13d8c4-0x0;var _0x3c06c5=_0x174b[_0x13d8c4];return _0x3c06c5;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb174('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb174('0x3')]('in',_0xb174('0x4')),'defaultValue':_0xb174('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb174('0x5')]}};
\ No newline at end of file
+var _0x6d0c=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x3aa965,_0x173e2c){_0x3aa965=_0x3aa965-0x0;var _0xef4dae=_0x6d0c[_0x3aa965];return _0xef4dae;};'use strict';var Sequelize=require(_0xc6d0('0x0'));module[_0xc6d0('0x1')]={'body':{'type':Sequelize[_0xc6d0('0x2')](_0xc6d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc6d0('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc6d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6d0('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc6d0('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 4f6df4b..6c2d33e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b18=['VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat','RejectMessage','SELECT','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','ChatMessage','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x25241e,_0x5dfa0e){var _0x5d9df1=function(_0x4443ce){while(--_0x4443ce){_0x25241e['push'](_0x25241e['shift']());}};_0x5d9df1(++_0x5dfa0e);}(_0x5b18,0xb4));var _0x85b1=function(_0x25fef3,_0x2238b0){_0x25fef3=_0x25fef3-0x0;var _0x5d9ea1=_0x5b18[_0x25fef3];return _0x5d9ea1;};'use strict';var emlformat=require(_0x85b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85b1('0x2'));var moment=require(_0x85b1('0x3'));var BPromise=require(_0x85b1('0x4'));var Mustache=require('mustache');var util=require(_0x85b1('0x5'));var path=require(_0x85b1('0x6'));var sox=require(_0x85b1('0x7'));var csv=require(_0x85b1('0x8'));var ejs=require(_0x85b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85b1('0xa'));var squel=require(_0x85b1('0xb'));var crypto=require(_0x85b1('0xc'));var jsforce=require(_0x85b1('0xd'));var deskjs=require(_0x85b1('0xe'));var toCsv=require(_0x85b1('0x8'));var querystring=require(_0x85b1('0xf'));var Papa=require(_0x85b1('0x10'));var Redis=require(_0x85b1('0x11'));var authService=require(_0x85b1('0x12'));var qs=require(_0x85b1('0x13'));var as=require(_0x85b1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85b1('0x15'))('api');var utils=require(_0x85b1('0x16'));var config=require(_0x85b1('0x17'));var licenseUtil=require(_0x85b1('0x18'));var db=require(_0x85b1('0x19'))['db'];config[_0x85b1('0x1a')]=_[_0x85b1('0x1b')](config['redis'],{'host':_0x85b1('0x1c'),'port':0x18eb});var socket=require(_0x85b1('0x1d'))(new Redis(config[_0x85b1('0x1a')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x85b1('0x1e'));var client=jayson['client'][_0x85b1('0x1f')]({'port':0x232c});var client9002=jayson[_0x85b1('0x20')][_0x85b1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3cdfa8,_0xb0e13a,_0x54b160,_0x395918){return new BPromise(function(_0x362ee4,_0x251516){var _0x5a146c=_0x395918||client;return _0x5a146c[_0x85b1('0x21')](_0x3cdfa8,_0x54b160)[_0x85b1('0x22')](function(_0x252b7c){logger['info'](_0x85b1('0x23'),_0xb0e13a,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xb0e13a,_0x85b1('0x24'),JSON[_0x85b1('0x25')](_0x252b7c));if(_0x252b7c[_0x85b1('0x26')]){if(_0x252b7c[_0x85b1('0x26')][_0x85b1('0x27')]===0x1f4){logger[_0x85b1('0x26')](_0x85b1('0x23'),_0xb0e13a,_0x252b7c[_0x85b1('0x26')]['message']);return _0x251516(_0x252b7c['error'][_0x85b1('0x28')]);}logger['error'](_0x85b1('0x23'),_0xb0e13a,_0x252b7c['error'][_0x85b1('0x28')]);return _0x362ee4(_0x252b7c['error'][_0x85b1('0x28')]);}else{logger['info'](_0x85b1('0x23'),_0xb0e13a,_0x85b1('0x24'));_0x362ee4(_0x252b7c[_0x85b1('0x29')]['message']);}})['catch'](function(_0x77b511){logger[_0x85b1('0x26')](_0x85b1('0x23'),_0xb0e13a,_0x77b511);_0x251516(_0x77b511);});});}function respondWithStatusCode(_0x47143b,_0x4e8f35){_0x4e8f35=_0x4e8f35||0xcc;return function(_0x56af9e){if(_0x56af9e){return _0x47143b[_0x85b1('0x2a')](_0x4e8f35);}return _0x47143b['status'](_0x4e8f35)[_0x85b1('0x2b')]();};}function respondWithResult(_0x2c6637,_0x2b62bf){_0x2b62bf=_0x2b62bf||0xc8;return function(_0xfb3f9b){if(_0xfb3f9b){return _0x2c6637[_0x85b1('0x2c')](_0x2b62bf)[_0x85b1('0x2d')](_0xfb3f9b);}};}function respondWithFilteredResult(_0xa2cfdc,_0x383fba){return function(_0x4d7085){if(_0x4d7085){var _0x1ea309=typeof _0x383fba[_0x85b1('0x2e')]===_0x85b1('0x2f')&&typeof _0x383fba[_0x85b1('0x30')]===_0x85b1('0x2f');var _0x32fa34=_0x4d7085[_0x85b1('0x31')];var _0x1217fb=_0x1ea309?0x0:_0x383fba[_0x85b1('0x2e')];var _0xed0db7=_0x1ea309?_0x4d7085[_0x85b1('0x31')]:_0x383fba['offset']+_0x383fba['limit'];var _0x418fbb;if(_0xed0db7>=_0x32fa34){_0xed0db7=_0x32fa34;_0x418fbb=0xc8;}else{_0x418fbb=0xce;}_0xa2cfdc['status'](_0x418fbb);return _0xa2cfdc[_0x85b1('0x32')](_0x85b1('0x33'),_0x1217fb+'-'+_0xed0db7+'/'+_0x32fa34)[_0x85b1('0x2d')](_0x4d7085);}return null;};}function patchUpdates(_0x55b10d){return function(_0x39d71a){try{jsonpatch[_0x85b1('0x34')](_0x39d71a,_0x55b10d,!![]);}catch(_0x3c4dc3){return BPromise[_0x85b1('0x35')](_0x3c4dc3);}return _0x39d71a[_0x85b1('0x36')]();};}function saveUpdates(_0x178a58,_0x5a50d5){return function(_0xb63e29){if(_0xb63e29){return _0xb63e29[_0x85b1('0x37')](_0x178a58)[_0x85b1('0x22')](function(_0x4fff84){return _0x4fff84;});}return null;};}function removeEntity(_0x604c85,_0x8ba78b){return function(_0x2d5aaf){if(_0x2d5aaf){return _0x2d5aaf[_0x85b1('0x38')]()[_0x85b1('0x22')](function(){_0x604c85[_0x85b1('0x2c')](0xcc)[_0x85b1('0x2b')]();});}};}function handleEntityNotFound(_0x50f14a,_0x35f56e){return function(_0x130cd5){if(!_0x130cd5){_0x50f14a[_0x85b1('0x2a')](0x194);}return _0x130cd5;};}function handleError(_0x229c4a,_0x51c3eb){_0x51c3eb=_0x51c3eb||0x1f4;return function(_0x3592bf){logger[_0x85b1('0x26')](_0x3592bf[_0x85b1('0x39')]);if(_0x3592bf[_0x85b1('0x3a')]){delete _0x3592bf[_0x85b1('0x3a')];}_0x229c4a[_0x85b1('0x2c')](_0x51c3eb)['send'](_0x3592bf);};}exports['index']=function(_0x40f7fb,_0x572c00){var _0x47e0fc={},_0x5e3bec={},_0x10cde3={'count':0x0,'rows':[]};var _0xafeb39=_['map'](db[_0x85b1('0x3b')][_0x85b1('0x3c')],function(_0x387901){return{'name':_0x387901['fieldName'],'type':_0x387901['type'][_0x85b1('0x3d')]};});_0x5e3bec['model']=_[_0x85b1('0x3e')](_0xafeb39,_0x85b1('0x3a'));_0x5e3bec['query']=_[_0x85b1('0x3f')](_0x40f7fb[_0x85b1('0x40')]);_0x5e3bec[_0x85b1('0x41')]=_[_0x85b1('0x42')](_0x5e3bec[_0x85b1('0x43')],_0x5e3bec[_0x85b1('0x40')]);_0x47e0fc[_0x85b1('0x44')]=_[_0x85b1('0x42')](_0x5e3bec['model'],qs[_0x85b1('0x45')](_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x45')]));_0x47e0fc[_0x85b1('0x44')]=_0x47e0fc[_0x85b1('0x44')][_0x85b1('0x46')]?_0x47e0fc['attributes']:_0x5e3bec[_0x85b1('0x43')];if(!_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x47')](_0x85b1('0x48'))){_0x47e0fc[_0x85b1('0x30')]=qs['limit'](_0x40f7fb[_0x85b1('0x40')]['limit']);_0x47e0fc['offset']=qs[_0x85b1('0x2e')](_0x40f7fb[_0x85b1('0x40')]['offset']);}_0x47e0fc[_0x85b1('0x49')]=qs[_0x85b1('0x4a')](_0x40f7fb[_0x85b1('0x40')]['sort']);_0x47e0fc[_0x85b1('0x4b')]=qs[_0x85b1('0x41')](_[_0x85b1('0x4c')](_0x40f7fb[_0x85b1('0x40')],_0x5e3bec[_0x85b1('0x41')]),_0xafeb39);if(_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x4d')]){_0x47e0fc['where']=_[_0x85b1('0x4e')](_0x47e0fc[_0x85b1('0x4b')],{'$or':_[_0x85b1('0x3e')](_0xafeb39,function(_0x2f4903){if(_0x2f4903[_0x85b1('0x4f')]!==_0x85b1('0x50')){var _0x336117={};_0x336117[_0x2f4903[_0x85b1('0x3a')]]={'$like':'%'+_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x4d')]+'%'};return _0x336117;}})});}_0x47e0fc=_[_0x85b1('0x4e')]({},_0x47e0fc,_0x40f7fb[_0x85b1('0x51')]);var _0x1838d3={'where':_0x47e0fc[_0x85b1('0x4b')]};return db['ChatMessage'][_0x85b1('0x31')](_0x1838d3)['then'](function(_0x5e8520){_0x10cde3[_0x85b1('0x31')]=_0x5e8520;if(_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x52')]){_0x47e0fc['include']=[{'all':!![]}];}return db[_0x85b1('0x3b')][_0x85b1('0x53')](_0x47e0fc);})[_0x85b1('0x22')](function(_0x20c0f8){_0x10cde3[_0x85b1('0x54')]=_0x20c0f8;return _0x10cde3;})[_0x85b1('0x22')](respondWithFilteredResult(_0x572c00,_0x47e0fc))[_0x85b1('0x55')](handleError(_0x572c00,null));};exports['show']=function(_0x9565f7,_0xeb33ed){var _0xbded8f={'raw':!![],'where':{'id':_0x9565f7[_0x85b1('0x56')]['id']}},_0x57bd9d={};_0x57bd9d['model']=_[_0x85b1('0x3f')](db[_0x85b1('0x3b')][_0x85b1('0x3c')]);_0x57bd9d[_0x85b1('0x40')]=_['keys'](_0x9565f7['query']);_0x57bd9d[_0x85b1('0x41')]=_['intersection'](_0x57bd9d['model'],_0x57bd9d[_0x85b1('0x40')]);_0xbded8f[_0x85b1('0x44')]=_['intersection'](_0x57bd9d[_0x85b1('0x43')],qs[_0x85b1('0x45')](_0x9565f7['query'][_0x85b1('0x45')]));_0xbded8f[_0x85b1('0x44')]=_0xbded8f[_0x85b1('0x44')]['length']?_0xbded8f[_0x85b1('0x44')]:_0x57bd9d[_0x85b1('0x43')];if(_0x9565f7['query'][_0x85b1('0x52')]){_0xbded8f['include']=[{'all':!![]}];}_0xbded8f=_[_0x85b1('0x4e')]({},_0xbded8f,_0x9565f7[_0x85b1('0x51')]);return db[_0x85b1('0x3b')][_0x85b1('0x57')](_0xbded8f)[_0x85b1('0x22')](handleEntityNotFound(_0xeb33ed,null))[_0x85b1('0x22')](respondWithResult(_0xeb33ed,null))['catch'](handleError(_0xeb33ed,null));};exports['create']=function(_0x1b778e,_0x542601){return db[_0x85b1('0x3b')][_0x85b1('0x58')](_0x1b778e[_0x85b1('0x59')],{})[_0x85b1('0x22')](respondWithResult(_0x542601,0xc9))[_0x85b1('0x55')](handleError(_0x542601,null));};exports[_0x85b1('0x37')]=function(_0x28e4f6,_0x2fe1e8){if(_0x28e4f6[_0x85b1('0x59')]['id']){delete _0x28e4f6['body']['id'];}return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0x28e4f6[_0x85b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fe1e8,null))[_0x85b1('0x22')](saveUpdates(_0x28e4f6[_0x85b1('0x59')],null))[_0x85b1('0x22')](respondWithResult(_0x2fe1e8,null))[_0x85b1('0x55')](handleError(_0x2fe1e8,null));};exports[_0x85b1('0x38')]=function(_0xd93476,_0x6d6415){return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0xd93476[_0x85b1('0x56')]['id']}})[_0x85b1('0x22')](handleEntityNotFound(_0x6d6415,null))[_0x85b1('0x22')](removeEntity(_0x6d6415,null))[_0x85b1('0x55')](handleError(_0x6d6415,null));};exports[_0x85b1('0x5a')]=function(_0x5f5dfe,_0x50d9c3){return db[_0x85b1('0x3b')][_0x85b1('0x5a')]()['then'](respondWithResult(_0x50d9c3,null))[_0x85b1('0x55')](handleError(_0x50d9c3,null));};var interaction_log=require(_0x85b1('0x15'))(_0x85b1('0x5b'));exports[_0x85b1('0x5c')]=function(_0x4c40c6,_0x2c3b88,_0x2c2114){var _0x3033d7={'agent':{},'channel':'chat'};if(_0x4c40c6[_0x85b1('0x59')]['id']){delete _0x4c40c6[_0x85b1('0x59')]['id'];}_0x4c40c6['body']['read']=!![];_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x5d')]=moment()[_0x85b1('0x5e')](_0x85b1('0x5f'));_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')]=_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')]||_0x4c40c6[_0x85b1('0x61')]['id'];_0x3033d7[_0x85b1('0x62')]['id']=_0x4c40c6[_0x85b1('0x59')]['UserId'];return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0x4c40c6[_0x85b1('0x56')]['id'],'UserId':null}})[_0x85b1('0x22')](handleEntityNotFound(_0x2c3b88,null))[_0x85b1('0x22')](saveUpdates(_0x4c40c6[_0x85b1('0x59')],null))[_0x85b1('0x22')](function(_0x35b24f){if(_0x35b24f){_0x3033d7[_0x85b1('0x28')]=_0x35b24f[_0x85b1('0x63')]({'plain':!![]});return db[_0x85b1('0x64')]['find']({'where':{'id':_0x35b24f[_0x85b1('0x65')]}});}return null;})[_0x85b1('0x22')](handleEntityNotFound(_0x2c3b88,null))[_0x85b1('0x22')](function(_0x311ae6){if(_0x311ae6){return _0x311ae6['update']({'UserId':_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')],'read1stAt':_[_0x85b1('0x66')](_0x311ae6['read1stAt'])?moment()[_0x85b1('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x85b1('0x22')](function(_0x12892e){if(_0x12892e){_0x3033d7[_0x85b1('0x67')]=_0x12892e['get']({'plain':!![]});interaction_log[_0x85b1('0x68')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c40c6[_0x85b1('0x61')]['id'],_0x4c40c6[_0x85b1('0x61')][_0x85b1('0x3a')],_0x4c40c6['user'][_0x85b1('0x69')],_0x3033d7[_0x85b1('0x67')]['id'],_0x4c40c6[_0x85b1('0x59')]?JSON['stringify'](_0x4c40c6[_0x85b1('0x59')]):_0x85b1('0x6a'));return respondWithRpcPromise(_0x85b1('0x6b'),'acceptMessage',_0x3033d7);}return null;})[_0x85b1('0x22')](function(_0x26d748){var _0x89ad94=_0x85b1('0x6c')+_0x26d748[_0x85b1('0x28')][_0x85b1('0x6d')];return db[_0x85b1('0x6e')]['query'](_0x89ad94,{'type':db['Sequelize'][_0x85b1('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x540078){return _0x540078;});})[_0x85b1('0x22')](function(_0x23cb9d){if(_0x23cb9d){_0x3033d7['message'][_0x85b1('0x70')]=_0x23cb9d[0x0];if(!_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')])return;return db[_0x85b1('0x71')][_0x85b1('0x57')]({'where':{'id':_0x4c40c6[_0x85b1('0x59')]['UserId'],'role':_0x85b1('0x62')},'attributes':['id',_0x85b1('0x3a'),_0x85b1('0x72'),_0x85b1('0x73'),_0x85b1('0x74')],'raw':!![]});}return null;})['then'](function(_0x46ad41){if(!_0x46ad41)return null;_0x3033d7['message'][_0x85b1('0x62')]=_0x46ad41;return _0x3033d7;})[_0x85b1('0x22')](function(_0x3aad67){if(_0x3aad67){if(_0x4c40c6[_0x85b1('0x59')]['manual']){_0x3033d7['message'][_0x85b1('0x75')]=util[_0x85b1('0x5e')](_0x85b1('0x76'),_0x4c40c6[_0x85b1('0x61')][_0x85b1('0x3a')]);_0x3033d7[_0x85b1('0x28')][_0x85b1('0x77')]=_0x3033d7['channel'];_0x3033d7[_0x85b1('0x28')][_0x85b1('0x78')]=_0x3033d7[_0x85b1('0x77')];_0x3033d7[_0x85b1('0x28')][_0x85b1('0x79')]=_0x85b1('0x5c');return respondWithRpcPromise(_0x85b1('0x7a'),_0x85b1('0x7a'),{'event':_0x85b1('0x7b'),'message':_[_0x85b1('0x4e')](_0x3033d7['message'],JSON[_0x85b1('0x7c')](_0x3033d7['interaction'][_0x85b1('0x7d')]))},client9002)['then'](function(){return _0x3033d7;});}return _0x3033d7;}return null;})[_0x85b1('0x22')](respondWithResult(_0x2c3b88,null))[_0x85b1('0x55')](handleError(_0x2c3b88,null));};var interaction_log=require('../../config/logger')(_0x85b1('0x5b'));exports[_0x85b1('0x35')]=function(_0x104df1,_0x52ff98,_0x52a6c7){var _0x41a772={'agent':{},'channel':_0x85b1('0x7e')};if(_0x104df1[_0x85b1('0x59')]['id']){delete _0x104df1[_0x85b1('0x59')]['id'];}_0x104df1[_0x85b1('0x59')]['UserId']=_0x104df1[_0x85b1('0x59')]['UserId']||_0x104df1[_0x85b1('0x61')]['id'];_0x41a772['agent']['id']=_0x104df1[_0x85b1('0x59')][_0x85b1('0x60')];return db['ChatMessage'][_0x85b1('0x57')]({'where':{'id':_0x104df1[_0x85b1('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52ff98,null))[_0x85b1('0x22')](function(_0x327bc7){if(_0x327bc7){_0x41a772[_0x85b1('0x28')]=_0x327bc7[_0x85b1('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x85b1('0x57')]({'where':{'id':_0x327bc7[_0x85b1('0x65')]}});}return null;})[_0x85b1('0x22')](handleEntityNotFound(_0x52ff98,null))[_0x85b1('0x22')](function(_0x51b182){if(_0x51b182){_0x41a772[_0x85b1('0x67')]=_0x51b182[_0x85b1('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x104df1[_0x85b1('0x61')]['id'],_0x104df1[_0x85b1('0x61')]['name'],_0x104df1[_0x85b1('0x61')]['role'],_0x41a772[_0x85b1('0x67')]['id'],_0x104df1[_0x85b1('0x59')]?JSON[_0x85b1('0x25')](_0x104df1[_0x85b1('0x59')]):'null');return respondWithRpcPromise(_0x85b1('0x7f'),'rejectMessage',_0x41a772);}return null;})[_0x85b1('0x22')](function(_0x3aa10a){var _0x4118ee=_0x85b1('0x6c')+_0x3aa10a[_0x85b1('0x28')][_0x85b1('0x6d')];return db[_0x85b1('0x6e')][_0x85b1('0x40')](_0x4118ee,{'type':db['Sequelize']['QueryTypes'][_0x85b1('0x80')],'raw':!![]})['then'](function(_0x45872b){return _0x45872b;});})[_0x85b1('0x22')](function(_0x4b1ae2){if(_0x4b1ae2){_0x41a772[_0x85b1('0x28')][_0x85b1('0x70')]=_0x4b1ae2[0x0];if(!_0x104df1['body']['UserId'])return;return db[_0x85b1('0x71')][_0x85b1('0x57')]({'where':{'id':_0x104df1['body'][_0x85b1('0x60')],'role':_0x85b1('0x62')},'attributes':['id',_0x85b1('0x3a'),_0x85b1('0x72'),_0x85b1('0x73'),_0x85b1('0x74')],'raw':!![]});}return null;})[_0x85b1('0x22')](function(_0x4d48d9){if(!_0x4d48d9)return null;_0x41a772[_0x85b1('0x28')][_0x85b1('0x62')]=_0x4d48d9;return _0x41a772;})[_0x85b1('0x22')](function(_0x2dd9a3){if(_0x2dd9a3){_0x2dd9a3['message']['interface']=util[_0x85b1('0x5e')](_0x85b1('0x76'),_0x104df1['user'][_0x85b1('0x3a')]);_0x2dd9a3[_0x85b1('0x28')][_0x85b1('0x77')]=_0x41a772['channel'];_0x2dd9a3['message']['motionChannel']=_0x41a772[_0x85b1('0x77')];_0x2dd9a3[_0x85b1('0x28')][_0x85b1('0x79')]='reject';respondWithRpcPromise(_0x85b1('0x7a'),'EventManager',{'event':_0x85b1('0x81'),'message':_[_0x85b1('0x4e')](_0x41a772['message'],JSON[_0x85b1('0x7c')](_0x41a772['interaction'][_0x85b1('0x7d')]))},client9002);return _0x41a772;}return null;})[_0x85b1('0x22')](respondWithResult(_0x52ff98,null))[_0x85b1('0x55')](handleError(_0x52ff98,null));};
\ No newline at end of file
+var _0x9894=['error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','rows','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','sequelize','contact','internal','rejectmessage','formData','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1b7801,_0x3ecdb8){var _0x278754=function(_0x120c6b){while(--_0x120c6b){_0x1b7801['push'](_0x1b7801['shift']());}};_0x278754(++_0x3ecdb8);}(_0x9894,0xe6));var _0x4989=function(_0x5af1e1,_0x29f6b3){_0x5af1e1=_0x5af1e1-0x0;var _0xb10c12=_0x9894[_0x5af1e1];return _0xb10c12;};'use strict';var emlformat=require(_0x4989('0x0'));var rimraf=require(_0x4989('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4989('0x2'));var moment=require('moment');var BPromise=require(_0x4989('0x3'));var Mustache=require('mustache');var util=require(_0x4989('0x4'));var path=require('path');var sox=require(_0x4989('0x5'));var csv=require(_0x4989('0x6'));var ejs=require(_0x4989('0x7'));var fs=require('fs');var fs_extra=require(_0x4989('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4989('0x9'));var jsforce=require(_0x4989('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4989('0x6'));var querystring=require(_0x4989('0xb'));var Papa=require(_0x4989('0xc'));var Redis=require(_0x4989('0xd'));var authService=require(_0x4989('0xe'));var qs=require(_0x4989('0xf'));var as=require(_0x4989('0x10'));var hardwareService=require(_0x4989('0x11'));var logger=require(_0x4989('0x12'))(_0x4989('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4989('0x14'));var db=require(_0x4989('0x15'))['db'];config[_0x4989('0x16')]=_[_0x4989('0x17')](config[_0x4989('0x16')],{'host':_0x4989('0x18'),'port':0x18eb});var socket=require(_0x4989('0x19'))(new Redis(config[_0x4989('0x16')]));require(_0x4989('0x1a'))['register'](socket);var jayson=require(_0x4989('0x1b'));var client=jayson[_0x4989('0x1c')][_0x4989('0x1d')]({'port':0x232c});var client9002=jayson[_0x4989('0x1c')][_0x4989('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x415788,_0x191c67,_0x2ba8a5,_0x5ea124){return new BPromise(function(_0x3c33df,_0x203ae3){var _0x4d1f8c=_0x5ea124||client;return _0x4d1f8c['request'](_0x415788,_0x2ba8a5)[_0x4989('0x1e')](function(_0x34e55a){logger['info'](_0x4989('0x1f'),_0x191c67,_0x4989('0x20'));logger[_0x4989('0x21')](_0x4989('0x22'),_0x191c67,_0x4989('0x20'),JSON[_0x4989('0x23')](_0x34e55a));if(_0x34e55a['error']){if(_0x34e55a[_0x4989('0x24')][_0x4989('0x25')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x191c67,_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);return _0x203ae3(_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);}logger[_0x4989('0x24')](_0x4989('0x1f'),_0x191c67,_0x34e55a[_0x4989('0x24')]['message']);return _0x3c33df(_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);}else{logger[_0x4989('0x27')](_0x4989('0x1f'),_0x191c67,_0x4989('0x20'));_0x3c33df(_0x34e55a[_0x4989('0x28')]['message']);}})[_0x4989('0x29')](function(_0xef4e32){logger[_0x4989('0x24')](_0x4989('0x1f'),_0x191c67,_0xef4e32);_0x203ae3(_0xef4e32);});});}function respondWithStatusCode(_0xedb202,_0x5901ac){_0x5901ac=_0x5901ac||0xcc;return function(_0xf2bf8){if(_0xf2bf8){return _0xedb202[_0x4989('0x2a')](_0x5901ac);}return _0xedb202[_0x4989('0x2b')](_0x5901ac)['end']();};}function respondWithResult(_0x4d1176,_0x2eac37){_0x2eac37=_0x2eac37||0xc8;return function(_0x156819){if(_0x156819){return _0x4d1176['status'](_0x2eac37)[_0x4989('0x2c')](_0x156819);}};}function respondWithFilteredResult(_0x6e321b,_0x325a03){return function(_0xf1ae47){if(_0xf1ae47){var _0x50b8cb=typeof _0x325a03[_0x4989('0x2d')]===_0x4989('0x2e')&&typeof _0x325a03[_0x4989('0x2f')]===_0x4989('0x2e');var _0x2c64cd=_0xf1ae47[_0x4989('0x30')];var _0x104d65=_0x50b8cb?0x0:_0x325a03[_0x4989('0x2d')];var _0x1d2ba2=_0x50b8cb?_0xf1ae47[_0x4989('0x30')]:_0x325a03[_0x4989('0x2d')]+_0x325a03[_0x4989('0x2f')];var _0x183404;if(_0x1d2ba2>=_0x2c64cd){_0x1d2ba2=_0x2c64cd;_0x183404=0xc8;}else{_0x183404=0xce;}_0x6e321b[_0x4989('0x2b')](_0x183404);return _0x6e321b[_0x4989('0x31')](_0x4989('0x32'),_0x104d65+'-'+_0x1d2ba2+'/'+_0x2c64cd)[_0x4989('0x2c')](_0xf1ae47);}return null;};}function patchUpdates(_0x249439){return function(_0x6879db){try{jsonpatch['apply'](_0x6879db,_0x249439,!![]);}catch(_0x5d5675){return BPromise['reject'](_0x5d5675);}return _0x6879db[_0x4989('0x33')]();};}function saveUpdates(_0x52ef22,_0x5e04ce){return function(_0x5f132e){if(_0x5f132e){return _0x5f132e[_0x4989('0x34')](_0x52ef22)['then'](function(_0x18b9de){return _0x18b9de;});}return null;};}function removeEntity(_0x279c06,_0x302330){return function(_0x5023f0){if(_0x5023f0){return _0x5023f0[_0x4989('0x35')]()['then'](function(){_0x279c06[_0x4989('0x2b')](0xcc)[_0x4989('0x36')]();});}};}function handleEntityNotFound(_0x24aa0f,_0x531754){return function(_0x40a8dc){if(!_0x40a8dc){_0x24aa0f[_0x4989('0x2a')](0x194);}return _0x40a8dc;};}function handleError(_0x1836e8,_0xcabcf6){_0xcabcf6=_0xcabcf6||0x1f4;return function(_0x5d0b17){logger[_0x4989('0x24')](_0x5d0b17[_0x4989('0x37')]);if(_0x5d0b17[_0x4989('0x38')]){delete _0x5d0b17['name'];}_0x1836e8[_0x4989('0x2b')](_0xcabcf6)[_0x4989('0x39')](_0x5d0b17);};}exports['index']=function(_0x292849,_0x4b5075){var _0x4a216d={},_0xe24f77={},_0x3c684b={'count':0x0,'rows':[]};var _0x4eafd3=_[_0x4989('0x3a')](db['ChatMessage'][_0x4989('0x3b')],function(_0x545111){return{'name':_0x545111[_0x4989('0x3c')],'type':_0x545111[_0x4989('0x3d')][_0x4989('0x3e')]};});_0xe24f77['model']=_[_0x4989('0x3a')](_0x4eafd3,'name');_0xe24f77[_0x4989('0x3f')]=_[_0x4989('0x40')](_0x292849['query']);_0xe24f77[_0x4989('0x41')]=_[_0x4989('0x42')](_0xe24f77['model'],_0xe24f77[_0x4989('0x3f')]);_0x4a216d[_0x4989('0x43')]=_[_0x4989('0x42')](_0xe24f77[_0x4989('0x44')],qs[_0x4989('0x45')](_0x292849[_0x4989('0x3f')][_0x4989('0x45')]));_0x4a216d[_0x4989('0x43')]=_0x4a216d[_0x4989('0x43')][_0x4989('0x46')]?_0x4a216d[_0x4989('0x43')]:_0xe24f77[_0x4989('0x44')];if(!_0x292849[_0x4989('0x3f')][_0x4989('0x47')](_0x4989('0x48'))){_0x4a216d[_0x4989('0x2f')]=qs[_0x4989('0x2f')](_0x292849['query'][_0x4989('0x2f')]);_0x4a216d[_0x4989('0x2d')]=qs['offset'](_0x292849[_0x4989('0x3f')]['offset']);}_0x4a216d[_0x4989('0x49')]=qs['sort'](_0x292849[_0x4989('0x3f')][_0x4989('0x4a')]);_0x4a216d[_0x4989('0x4b')]=qs['filters'](_['pick'](_0x292849[_0x4989('0x3f')],_0xe24f77[_0x4989('0x41')]),_0x4eafd3);if(_0x292849[_0x4989('0x3f')][_0x4989('0x4c')]){_0x4a216d[_0x4989('0x4b')]=_[_0x4989('0x4d')](_0x4a216d[_0x4989('0x4b')],{'$or':_[_0x4989('0x3a')](_0x4eafd3,function(_0x5f27d2){if(_0x5f27d2['type']!==_0x4989('0x4e')){var _0x773dad={};_0x773dad[_0x5f27d2['name']]={'$like':'%'+_0x292849[_0x4989('0x3f')][_0x4989('0x4c')]+'%'};return _0x773dad;}})});}_0x4a216d=_[_0x4989('0x4d')]({},_0x4a216d,_0x292849[_0x4989('0x4f')]);var _0x2f6b38={'where':_0x4a216d[_0x4989('0x4b')]};return db[_0x4989('0x50')][_0x4989('0x30')](_0x2f6b38)['then'](function(_0x4db44){_0x3c684b[_0x4989('0x30')]=_0x4db44;if(_0x292849[_0x4989('0x3f')][_0x4989('0x51')]){_0x4a216d[_0x4989('0x52')]=[{'all':!![]}];}return db[_0x4989('0x50')]['findAll'](_0x4a216d);})[_0x4989('0x1e')](function(_0x34dd7c){_0x3c684b[_0x4989('0x53')]=_0x34dd7c;return _0x3c684b;})[_0x4989('0x1e')](respondWithFilteredResult(_0x4b5075,_0x4a216d))[_0x4989('0x29')](handleError(_0x4b5075,null));};exports['show']=function(_0x136154,_0x3e72fa){var _0x464e36={'raw':!![],'where':{'id':_0x136154[_0x4989('0x54')]['id']}},_0x37fdd6={};_0x37fdd6[_0x4989('0x44')]=_[_0x4989('0x40')](db[_0x4989('0x50')][_0x4989('0x3b')]);_0x37fdd6[_0x4989('0x3f')]=_[_0x4989('0x40')](_0x136154[_0x4989('0x3f')]);_0x37fdd6[_0x4989('0x41')]=_[_0x4989('0x42')](_0x37fdd6[_0x4989('0x44')],_0x37fdd6['query']);_0x464e36[_0x4989('0x43')]=_[_0x4989('0x42')](_0x37fdd6['model'],qs[_0x4989('0x45')](_0x136154['query'][_0x4989('0x45')]));_0x464e36[_0x4989('0x43')]=_0x464e36['attributes'][_0x4989('0x46')]?_0x464e36[_0x4989('0x43')]:_0x37fdd6[_0x4989('0x44')];if(_0x136154[_0x4989('0x3f')][_0x4989('0x51')]){_0x464e36[_0x4989('0x52')]=[{'all':!![]}];}_0x464e36=_['merge']({},_0x464e36,_0x136154['options']);return db[_0x4989('0x50')][_0x4989('0x55')](_0x464e36)[_0x4989('0x1e')](handleEntityNotFound(_0x3e72fa,null))[_0x4989('0x1e')](respondWithResult(_0x3e72fa,null))[_0x4989('0x29')](handleError(_0x3e72fa,null));};exports['create']=function(_0x20bb96,_0x38ad03){return db[_0x4989('0x50')][_0x4989('0x56')](_0x20bb96['body'],{})[_0x4989('0x1e')](respondWithResult(_0x38ad03,0xc9))[_0x4989('0x29')](handleError(_0x38ad03,null));};exports[_0x4989('0x34')]=function(_0x4c5e98,_0x763cc4){if(_0x4c5e98['body']['id']){delete _0x4c5e98['body']['id'];}return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x4c5e98[_0x4989('0x54')]['id']}})[_0x4989('0x1e')](handleEntityNotFound(_0x763cc4,null))[_0x4989('0x1e')](saveUpdates(_0x4c5e98[_0x4989('0x57')],null))[_0x4989('0x1e')](respondWithResult(_0x763cc4,null))[_0x4989('0x29')](handleError(_0x763cc4,null));};exports['destroy']=function(_0x587fc0,_0x77011){return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x587fc0[_0x4989('0x54')]['id']}})[_0x4989('0x1e')](handleEntityNotFound(_0x77011,null))[_0x4989('0x1e')](removeEntity(_0x77011,null))[_0x4989('0x29')](handleError(_0x77011,null));};exports[_0x4989('0x58')]=function(_0x5a9535,_0x1d0baf){return db[_0x4989('0x50')][_0x4989('0x58')]()[_0x4989('0x1e')](respondWithResult(_0x1d0baf,null))['catch'](handleError(_0x1d0baf,null));};var interaction_log=require('../../config/logger')(_0x4989('0x59'));exports[_0x4989('0x5a')]=function(_0x267f8f,_0x34663c,_0x5e9e5b){var _0x13e0b0={'agent':{},'channel':_0x4989('0x5b')};if(_0x267f8f[_0x4989('0x57')]['id']){delete _0x267f8f[_0x4989('0x57')]['id'];}_0x267f8f[_0x4989('0x57')][_0x4989('0x5c')]=!![];_0x267f8f[_0x4989('0x57')][_0x4989('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x267f8f['body']['UserId']=_0x267f8f['body'][_0x4989('0x5e')]||_0x267f8f[_0x4989('0x5f')]['id'];_0x13e0b0[_0x4989('0x60')]['id']=_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')];return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x267f8f[_0x4989('0x54')]['id'],'UserId':null}})[_0x4989('0x1e')](handleEntityNotFound(_0x34663c,null))[_0x4989('0x1e')](saveUpdates(_0x267f8f[_0x4989('0x57')],null))[_0x4989('0x1e')](function(_0x4585fe){if(_0x4585fe){_0x13e0b0[_0x4989('0x26')]=_0x4585fe[_0x4989('0x61')]({'plain':!![]});return db[_0x4989('0x62')][_0x4989('0x55')]({'where':{'id':_0x4585fe[_0x4989('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x34663c,null))[_0x4989('0x1e')](function(_0x3612f9){if(_0x3612f9){return _0x3612f9[_0x4989('0x34')]({'UserId':_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')],'read1stAt':_[_0x4989('0x64')](_0x3612f9[_0x4989('0x65')])?moment()[_0x4989('0x66')](_0x4989('0x67')):undefined});}return null;})[_0x4989('0x1e')](function(_0x190204){if(_0x190204){_0x13e0b0[_0x4989('0x68')]=_0x190204['get']({'plain':!![]});interaction_log[_0x4989('0x27')](_0x4989('0x69'),_0x267f8f['user']['id'],_0x267f8f[_0x4989('0x5f')][_0x4989('0x38')],_0x267f8f['user']['role'],_0x13e0b0['interaction']['id'],_0x267f8f[_0x4989('0x57')]?JSON['stringify'](_0x267f8f[_0x4989('0x57')]):'null');return respondWithRpcPromise(_0x4989('0x6a'),'acceptMessage',_0x13e0b0);}return null;})[_0x4989('0x1e')](function(_0xc5a734){var _0x5a313f=_0x4989('0x6b')+_0xc5a734[_0x4989('0x26')][_0x4989('0x6c')];return db['sequelize'][_0x4989('0x3f')](_0x5a313f,{'type':db[_0x4989('0x6d')][_0x4989('0x6e')][_0x4989('0x6f')],'raw':!![]})['then'](function(_0x52f259){return _0x52f259;});})[_0x4989('0x1e')](function(_0x149110){if(_0x149110){_0x13e0b0[_0x4989('0x26')]['contact']=_0x149110[0x0];if(!_0x267f8f[_0x4989('0x57')]['UserId'])return;return db['User'][_0x4989('0x55')]({'where':{'id':_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')],'role':'agent'},'attributes':['id','name',_0x4989('0x70'),_0x4989('0x71'),'internal'],'raw':!![]});}return null;})[_0x4989('0x1e')](function(_0x4a5187){if(!_0x4a5187)return null;_0x13e0b0[_0x4989('0x26')][_0x4989('0x60')]=_0x4a5187;return _0x13e0b0;})[_0x4989('0x1e')](function(_0x27688e){if(_0x27688e){if(_0x267f8f[_0x4989('0x57')][_0x4989('0x72')]){_0x13e0b0[_0x4989('0x26')][_0x4989('0x73')]=util[_0x4989('0x66')]('SIP/%s',_0x267f8f[_0x4989('0x5f')][_0x4989('0x38')]);_0x13e0b0[_0x4989('0x26')][_0x4989('0x74')]=_0x13e0b0[_0x4989('0x74')];_0x13e0b0[_0x4989('0x26')][_0x4989('0x75')]=_0x13e0b0[_0x4989('0x74')];_0x13e0b0[_0x4989('0x26')][_0x4989('0x76')]=_0x4989('0x5a');return respondWithRpcPromise(_0x4989('0x77'),_0x4989('0x77'),{'event':_0x4989('0x78'),'message':_[_0x4989('0x4d')](_0x13e0b0[_0x4989('0x26')],JSON[_0x4989('0x79')](_0x13e0b0[_0x4989('0x68')]['formData']))},client9002)[_0x4989('0x1e')](function(){return _0x13e0b0;});}return _0x13e0b0;}return null;})['then'](respondWithResult(_0x34663c,null))[_0x4989('0x29')](handleError(_0x34663c,null));};var interaction_log=require('../../config/logger')(_0x4989('0x59'));exports[_0x4989('0x7a')]=function(_0x3aa6b2,_0x52f970,_0x49304c){var _0x339d6e={'agent':{},'channel':_0x4989('0x5b')};if(_0x3aa6b2['body']['id']){delete _0x3aa6b2['body']['id'];}_0x3aa6b2[_0x4989('0x57')]['UserId']=_0x3aa6b2[_0x4989('0x57')]['UserId']||_0x3aa6b2[_0x4989('0x5f')]['id'];_0x339d6e[_0x4989('0x60')]['id']=_0x3aa6b2[_0x4989('0x57')][_0x4989('0x5e')];return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x3aa6b2['params']['id'],'UserId':null}})[_0x4989('0x1e')](handleEntityNotFound(_0x52f970,null))[_0x4989('0x1e')](function(_0x273226){if(_0x273226){_0x339d6e[_0x4989('0x26')]=_0x273226[_0x4989('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x4989('0x55')]({'where':{'id':_0x273226[_0x4989('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x52f970,null))['then'](function(_0x1c2af9){if(_0x1c2af9){_0x339d6e[_0x4989('0x68')]=_0x1c2af9[_0x4989('0x61')]({'plain':!![]});interaction_log['info'](_0x4989('0x7b'),_0x3aa6b2[_0x4989('0x5f')]['id'],_0x3aa6b2['user']['name'],_0x3aa6b2[_0x4989('0x5f')][_0x4989('0x7c')],_0x339d6e[_0x4989('0x68')]['id'],_0x3aa6b2[_0x4989('0x57')]?JSON['stringify'](_0x3aa6b2[_0x4989('0x57')]):_0x4989('0x7d'));return respondWithRpcPromise(_0x4989('0x7e'),_0x4989('0x7f'),_0x339d6e);}return null;})[_0x4989('0x1e')](function(_0x2afd13){var _0x1cc3db=_0x4989('0x6b')+_0x2afd13[_0x4989('0x26')][_0x4989('0x6c')];return db[_0x4989('0x80')]['query'](_0x1cc3db,{'type':db[_0x4989('0x6d')][_0x4989('0x6e')]['SELECT'],'raw':!![]})[_0x4989('0x1e')](function(_0x3f4139){return _0x3f4139;});})['then'](function(_0x75a505){if(_0x75a505){_0x339d6e[_0x4989('0x26')][_0x4989('0x81')]=_0x75a505[0x0];if(!_0x3aa6b2['body']['UserId'])return;return db['User'][_0x4989('0x55')]({'where':{'id':_0x3aa6b2['body']['UserId'],'role':'agent'},'attributes':['id','name','fullname','email',_0x4989('0x82')],'raw':!![]});}return null;})[_0x4989('0x1e')](function(_0x11ffdb){if(!_0x11ffdb)return null;_0x339d6e[_0x4989('0x26')][_0x4989('0x60')]=_0x11ffdb;return _0x339d6e;})[_0x4989('0x1e')](function(_0x4863a7){if(_0x4863a7){_0x4863a7['message'][_0x4989('0x73')]=util[_0x4989('0x66')]('SIP/%s',_0x3aa6b2[_0x4989('0x5f')][_0x4989('0x38')]);_0x4863a7[_0x4989('0x26')][_0x4989('0x74')]=_0x339d6e[_0x4989('0x74')];_0x4863a7[_0x4989('0x26')][_0x4989('0x75')]=_0x339d6e[_0x4989('0x74')];_0x4863a7[_0x4989('0x26')][_0x4989('0x76')]=_0x4989('0x7a');respondWithRpcPromise('EventManager',_0x4989('0x77'),{'event':_0x4989('0x83'),'message':_[_0x4989('0x4d')](_0x339d6e[_0x4989('0x26')],JSON[_0x4989('0x79')](_0x339d6e[_0x4989('0x68')][_0x4989('0x84')]))},client9002);return _0x339d6e;}return null;})[_0x4989('0x1e')](respondWithResult(_0x52f970,null))[_0x4989('0x29')](handleError(_0x52f970,null));};
\ No newline at end of file
index c574652..91c830b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x976f=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x2910b3,_0x4d44c9){var _0x46fba1=function(_0x3d66f4){while(--_0x3d66f4){_0x2910b3['push'](_0x2910b3['shift']());}};_0x46fba1(++_0x4d44c9);}(_0x976f,0x112));var _0xf976=function(_0x2eb086,_0x6d8dde){_0x2eb086=_0x2eb086-0x0;var _0x3854a6=_0x976f[_0x2eb086];return _0x3854a6;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf976('0x0'))['db'][_0xf976('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf976('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf976('0x3'),'afterDestroy':_0xf976('0x4')};function emitEvent(_0x36f240){return function(_0x4b280d,_0x2b3fe5,_0x160050){ChatMessageEvents[_0xf976('0x5')](_0x36f240+':'+_0x4b280d['id'],_0x4b280d);ChatMessageEvents[_0xf976('0x5')](_0x36f240,_0x4b280d);_0x160050(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf976('0x6')](e,emitEvent(event));}}module[_0xf976('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9b26=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x9b26,0x13f));var _0x69b2=function(_0x207a83,_0x453824){_0x207a83=_0x207a83-0x0;var _0x3186e4=_0x9b26[_0x207a83];return _0x3186e4;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x69b2('0x0'))['db'][_0x69b2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x69b2('0x2')](0x0);var events={'afterCreate':_0x69b2('0x3'),'afterUpdate':_0x69b2('0x4'),'afterDestroy':_0x69b2('0x5')};function emitEvent(_0x20ba1){return function(_0x3559e4,_0x260436,_0xe4a4e7){ChatMessageEvents[_0x69b2('0x6')](_0x20ba1+':'+_0x3559e4['id'],_0x3559e4);ChatMessageEvents['emit'](_0x20ba1,_0x3559e4);_0xe4a4e7(null);};}for(var e in events){if(events[_0x69b2('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 7f5c424..3e2e9ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe64e=['ChatMessage','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define'];(function(_0x297833,_0x2c5611){var _0x36bf74=function(_0x5c2b63){while(--_0x5c2b63){_0x297833['push'](_0x297833['shift']());}};_0x36bf74(++_0x2c5611);}(_0xe64e,0xe4));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xee64('0x0'));var util=require(_0xee64('0x1'));var logger=require(_0xee64('0x2'))(_0xee64('0x3'));var moment=require(_0xee64('0x4'));var BPromise=require(_0xee64('0x5'));var rp=require(_0xee64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee64('0x7'));var config=require(_0xee64('0x8'));var attributes=require(_0xee64('0x9'));module[_0xee64('0xa')]=function(_0x1b9521,_0x85be40){return _0x1b9521[_0xee64('0xb')](_0xee64('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xee64('0xd')],'type':_0xee64('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f6827,_0x393ade,_0x262c90){var _0x340a62=_0x1b9521[_0xee64('0xf')];var _0x4b59d7=_0x1f6827[_0xee64('0x10')]({'plain':!![]});if(_0x4b59d7['direction']['toLowerCase']()==='in'||_0x4b59d7['direction'][_0xee64('0x11')]()===_0xee64('0x12')&&!_0x4b59d7[_0xee64('0x13')]&&!_[_0xee64('0x14')](_0x4b59d7[_0xee64('0x15')])){_0x340a62[_0xee64('0x16')][_0xee64('0x17')]({'where':{'id':_0x4b59d7[_0xee64('0x18')]}})['then'](function(_0x1ce902){if(_0x1ce902){_0x1ce902[_0xee64('0x19')]({'lastMsgAt':_0x4b59d7[_0xee64('0x1a')],'lastMsgDirection':_0x4b59d7['direction'][_0xee64('0x11')]()});}})['catch'](function(_0x2b9b5a){console[_0xee64('0x1b')](_0x2b9b5a);});}_0x262c90();}},'charset':_0xee64('0x1c'),'collate':_0xee64('0x1d')});};
\ No newline at end of file
+var _0x0c2f=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x3e8674,_0x5c4322){var _0xa692cd=function(_0x22560f){while(--_0x22560f){_0x3e8674['push'](_0x3e8674['shift']());}};_0xa692cd(++_0x5c4322);}(_0x0c2f,0x1b6));var _0xf0c2=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x0c2f[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var logger=require(_0xf0c2('0x1'))(_0xf0c2('0x2'));var moment=require('moment');var BPromise=require(_0xf0c2('0x3'));var rp=require(_0xf0c2('0x4'));var fs=require('fs');var path=require(_0xf0c2('0x5'));var rimraf=require(_0xf0c2('0x6'));var config=require(_0xf0c2('0x7'));var attributes=require(_0xf0c2('0x8'));module[_0xf0c2('0x9')]=function(_0x388b26,_0x523119){return _0x388b26[_0xf0c2('0xa')]('ChatMessage',attributes,{'tableName':_0xf0c2('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf0c2('0xc')],'type':_0xf0c2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e8dae,_0x644fc,_0xf98a87){var _0x386f58=_0x388b26[_0xf0c2('0xe')];var _0x933e7=_0x5e8dae[_0xf0c2('0xf')]({'plain':!![]});if(_0x933e7[_0xf0c2('0x10')][_0xf0c2('0x11')]()==='in'||_0x933e7['direction']['toLowerCase']()==='out'&&!_0x933e7[_0xf0c2('0x12')]&&!_[_0xf0c2('0x13')](_0x933e7[_0xf0c2('0x14')])){_0x386f58['ChatInteraction'][_0xf0c2('0x15')]({'where':{'id':_0x933e7['ChatInteractionId']}})[_0xf0c2('0x16')](function(_0x63235){if(_0x63235){_0x63235[_0xf0c2('0x17')]({'lastMsgAt':_0x933e7['createdAt'],'lastMsgDirection':_0x933e7['direction'][_0xf0c2('0x11')]()});}})['catch'](function(_0x580c92){console[_0xf0c2('0x18')](_0x580c92);});}_0xf98a87();}},'charset':'utf8mb4','collate':_0xf0c2('0x19')});};
\ No newline at end of file
index c7aaa3d..84243d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2319=['../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','create','body','options','CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xa9d44f,_0x293dcc){var _0x755908=function(_0x40f872){while(--_0x40f872){_0xa9d44f['push'](_0xa9d44f['shift']());}};_0x755908(++_0x293dcc);}(_0x2319,0x144));var _0x9231=function(_0x46b80b,_0x5b357f){_0x46b80b=_0x46b80b-0x0;var _0x55dc64=_0x2319[_0x46b80b];return _0x55dc64;};'use strict';var _=require(_0x9231('0x0'));var util=require(_0x9231('0x1'));var moment=require(_0x9231('0x2'));var BPromise=require('bluebird');var rs=require(_0x9231('0x3'));var fs=require('fs');var Redis=require(_0x9231('0x4'));var db=require(_0x9231('0x5'))['db'];var utils=require(_0x9231('0x6'));var logger=require('../../config/logger')(_0x9231('0x7'));var config=require('../../config/environment');var jayson=require(_0x9231('0x8'));var client=jayson[_0x9231('0x9')][_0x9231('0xa')]({'port':0x232a});config[_0x9231('0xb')]=_[_0x9231('0xc')](config[_0x9231('0xb')],{'host':_0x9231('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9231('0xb')]));require('./chatMessage.socket')[_0x9231('0xe')](socket);function respondWithRpcPromise(_0x31f7fe,_0x154cec,_0x26dabc){return new BPromise(function(_0x1af492,_0x589d53){return client[_0x9231('0xf')](_0x31f7fe,_0x26dabc)[_0x9231('0x10')](function(_0x2507a3){logger[_0x9231('0x11')]('ChatMessage,\x20%s,\x20%s',_0x154cec,_0x9231('0x12'));logger[_0x9231('0x13')](_0x9231('0x14'),_0x154cec,_0x9231('0x12'),JSON[_0x9231('0x15')](_0x2507a3));if(_0x2507a3[_0x9231('0x16')]){if(_0x2507a3[_0x9231('0x16')][_0x9231('0x17')]===0x1f4){logger[_0x9231('0x16')](_0x9231('0x18'),_0x154cec,_0x2507a3[_0x9231('0x16')][_0x9231('0x19')]);return _0x589d53(_0x2507a3[_0x9231('0x16')]['message']);}logger[_0x9231('0x16')](_0x9231('0x18'),_0x154cec,_0x2507a3['error']['message']);return _0x1af492(_0x2507a3[_0x9231('0x16')][_0x9231('0x19')]);}else{logger[_0x9231('0x11')](_0x9231('0x18'),_0x154cec,'request\x20sent');_0x1af492(_0x2507a3[_0x9231('0x1a')][_0x9231('0x19')]);}})['catch'](function(_0x330109){logger[_0x9231('0x16')]('ChatMessage,\x20%s,\x20%s',_0x154cec,_0x330109);_0x589d53(_0x330109);});});}exports['CreateChatMessage']=function(_0x5b6c0f){var _0x47a11f=this;return new Promise(function(_0x2c7716,_0x2e4e45){return db[_0x9231('0x1b')][_0x9231('0x1c')](_0x5b6c0f[_0x9231('0x1d')],{'raw':_0x5b6c0f['options']?_0x5b6c0f[_0x9231('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x9231('0x10')](function(_0x159665){logger['info'](_0x9231('0x1f'),_0x5b6c0f);logger[_0x9231('0x13')]('CreateChatMessage',_0x5b6c0f,JSON[_0x9231('0x15')](_0x159665));_0x2c7716(_0x159665);})[_0x9231('0x20')](function(_0x3fd69a){logger[_0x9231('0x16')]('CreateChatMessage',_0x3fd69a[_0x9231('0x19')],_0x5b6c0f);_0x2e4e45(_0x47a11f[_0x9231('0x16')](0x1f4,_0x3fd69a['message']));});});};
\ No newline at end of file
+var _0xb815=['defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x30e83e,_0x3bfae5){var _0x4da585=function(_0x2f2b71){while(--_0x2f2b71){_0x30e83e['push'](_0x30e83e['shift']());}};_0x4da585(++_0x3bfae5);}(_0xb815,0x160));var _0x5b81=function(_0x434adb,_0x58959b){_0x434adb=_0x434adb-0x0;var _0x4b7483=_0xb815[_0x434adb];return _0x4b7483;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});config[_0x5b81('0xa')]=_[_0x5b81('0xb')](config[_0x5b81('0xa')],{'host':_0x5b81('0xc'),'port':0x18eb});var socket=require(_0x5b81('0xd'))(new Redis(config[_0x5b81('0xa')]));require(_0x5b81('0xe'))[_0x5b81('0xf')](socket);function respondWithRpcPromise(_0x1bd508,_0x3b480c,_0x5345f8){return new BPromise(function(_0x4153f0,_0x21bb6d){return client['request'](_0x1bd508,_0x5345f8)[_0x5b81('0x10')](function(_0x3d2296){logger[_0x5b81('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));logger[_0x5b81('0x13')](_0x5b81('0x14'),_0x3b480c,_0x5b81('0x12'),JSON[_0x5b81('0x15')](_0x3d2296));if(_0x3d2296[_0x5b81('0x16')]){if(_0x3d2296[_0x5b81('0x16')]['code']===0x1f4){logger[_0x5b81('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x21bb6d(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}logger[_0x5b81('0x16')](_0x5b81('0x18'),_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x4153f0(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}else{logger[_0x5b81('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));_0x4153f0(_0x3d2296[_0x5b81('0x19')][_0x5b81('0x17')]);}})['catch'](function(_0xfa7f55){logger['error'](_0x5b81('0x18'),_0x3b480c,_0xfa7f55);_0x21bb6d(_0xfa7f55);});});}exports[_0x5b81('0x1a')]=function(_0x163357){var _0x97934d=this;return new Promise(function(_0x384504,_0x392cf8){return db[_0x5b81('0x1b')][_0x5b81('0x1c')](_0x163357[_0x5b81('0x1d')],{'raw':_0x163357[_0x5b81('0x1e')]?_0x163357[_0x5b81('0x1e')][_0x5b81('0x1f')]===undefined?!![]:![]:!![]})[_0x5b81('0x10')](function(_0xcde4a5){logger[_0x5b81('0x11')](_0x5b81('0x1a'),_0x163357);logger['debug']('CreateChatMessage',_0x163357,JSON[_0x5b81('0x15')](_0xcde4a5));_0x384504(_0xcde4a5);})[_0x5b81('0x20')](function(_0x2cb087){logger[_0x5b81('0x16')](_0x5b81('0x1a'),_0x2cb087[_0x5b81('0x17')],_0x163357);_0x392cf8(_0x97934d[_0x5b81('0x16')](0x1f4,_0x2cb087[_0x5b81('0x17')]));});});};
\ No newline at end of file
index bdb91ab..9056bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x423b=['update','removeListener','length','chatMessage:','save'];(function(_0x33d21a,_0xfa1f62){var _0x35b44a=function(_0xa32c5d){while(--_0xa32c5d){_0x33d21a['push'](_0x33d21a['shift']());}};_0x35b44a(++_0xfa1f62);}(_0x423b,0x12b));var _0xb423=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x423b[_0x4b73a2];return _0x383c66;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb423('0x0'),'remove',_0xb423('0x1')];function createListener(_0x54e396,_0x3dbb0c){return function(_0x4b4acf){_0x3dbb0c['emit'](_0x54e396,_0x4b4acf);};}function removeListener(_0x50f31a,_0x2fa5da){return function(){ChatMessageEvents[_0xb423('0x2')](_0x50f31a,_0x2fa5da);};}exports['register']=function(_0x1be92e){for(var _0x3e6b18=0x0,_0x49eabb=events[_0xb423('0x3')];_0x3e6b18<_0x49eabb;_0x3e6b18++){var _0x573e95=events[_0x3e6b18];var _0x4119d7=createListener(_0xb423('0x4')+_0x573e95,_0x1be92e);ChatMessageEvents['on'](_0x573e95,_0x4119d7);}};
\ No newline at end of file
+var _0x6596=['update','emit','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x3f2c8e,_0x3e1ae5){var _0x3087e3=function(_0x4faaca){while(--_0x4faaca){_0x3f2c8e['push'](_0x3f2c8e['shift']());}};_0x3087e3(++_0x3e1ae5);}(_0x6596,0x1d3));var _0x6659=function(_0x405fcc,_0x109079){_0x405fcc=_0x405fcc-0x0;var _0x48e0db=_0x6596[_0x405fcc];return _0x48e0db;};'use strict';var ChatMessageEvents=require(_0x6659('0x0'));var events=[_0x6659('0x1'),'remove',_0x6659('0x2')];function createListener(_0x114579,_0x3b1b74){return function(_0x2c58e1){_0x3b1b74[_0x6659('0x3')](_0x114579,_0x2c58e1);};}function removeListener(_0x67ac1d,_0x4bfd3c){return function(){ChatMessageEvents['removeListener'](_0x67ac1d,_0x4bfd3c);};}exports[_0x6659('0x4')]=function(_0x3091f1){for(var _0xd6bf59=0x0,_0x1ed458=events[_0x6659('0x5')];_0xd6bf59<_0x1ed458;_0xd6bf59++){var _0x4a900d=events[_0xd6bf59];var _0x485ea0=createListener(_0x6659('0x6')+_0x4a900d,_0x3091f1);ChatMessageEvents['on'](_0x4a900d,_0x485ea0);}};
\ No newline at end of file
index 755b126..d6ab224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd660=['isAuthenticated','index','get','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x4a5a76,_0x3031c9){var _0x4f32b9=function(_0x30dd33){while(--_0x30dd33){_0x4a5a76['push'](_0x4a5a76['shift']());}};_0x4f32b9(++_0x3031c9);}(_0xd660,0x10c));var _0x0d66=function(_0x1633b3,_0x2d84af){_0x1633b3=_0x1633b3-0x0;var _0x149a74=_0xd660[_0x1633b3];return _0x149a74;};'use strict';var multer=require(_0x0d66('0x0'));var util=require(_0x0d66('0x1'));var path=require(_0x0d66('0x2'));var timeout=require(_0x0d66('0x3'));var express=require('express');var router=express[_0x0d66('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d66('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0d66('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x0d66('0x7')](),controller[_0x0d66('0x8')]);router[_0x0d66('0x9')]('/describe',auth[_0x0d66('0x7')](),controller[_0x0d66('0xa')]);router[_0x0d66('0x9')](_0x0d66('0xb'),auth[_0x0d66('0x7')](),controller[_0x0d66('0xc')]);router[_0x0d66('0xd')]('/',auth[_0x0d66('0x7')](),interaction[_0x0d66('0xe')](_0x0d66('0xf'),_0x0d66('0x10')),controller[_0x0d66('0x11')]);router[_0x0d66('0x12')](_0x0d66('0xb'),controller[_0x0d66('0x13')]);router[_0x0d66('0x12')]('/:id/accept',auth[_0x0d66('0x7')](),controller[_0x0d66('0x14')]);router[_0x0d66('0x12')](_0x0d66('0x15'),auth['isAuthenticated'](),controller[_0x0d66('0x16')]);router['delete'](_0x0d66('0xb'),auth['isAuthenticated'](),controller[_0x0d66('0x17')]);module[_0x0d66('0x18')]=router;
\ No newline at end of file
+var _0x852e=['/:id/accept','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','create','put','update'];(function(_0x3332dd,_0xf4f34c){var _0x27825d=function(_0x137af7){while(--_0x137af7){_0x3332dd['push'](_0x3332dd['shift']());}};_0x27825d(++_0xf4f34c);}(_0x852e,0x1b9));var _0xe852=function(_0x11f3ab,_0x76530e){_0x11f3ab=_0x11f3ab-0x0;var _0x3b1edc=_0x852e[_0x11f3ab];return _0x3b1edc;};'use strict';var multer=require(_0xe852('0x0'));var util=require(_0xe852('0x1'));var path=require(_0xe852('0x2'));var timeout=require(_0xe852('0x3'));var express=require(_0xe852('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(_0xe852('0x5'));var controller=require(_0xe852('0x6'));router[_0xe852('0x7')]('/',auth['isAuthenticated'](),controller[_0xe852('0x8')]);router[_0xe852('0x7')](_0xe852('0x9'),auth[_0xe852('0xa')](),controller[_0xe852('0xb')]);router[_0xe852('0x7')](_0xe852('0xc'),auth[_0xe852('0xa')](),controller[_0xe852('0xd')]);router[_0xe852('0xe')]('/',auth['isAuthenticated'](),interaction[_0xe852('0xf')]('chat','chatmessage:create'),controller[_0xe852('0x10')]);router[_0xe852('0x11')](_0xe852('0xc'),controller[_0xe852('0x12')]);router['put'](_0xe852('0x13'),auth[_0xe852('0xa')](),controller['accept']);router[_0xe852('0x11')]('/:id/reject',auth[_0xe852('0xa')](),controller['reject']);router[_0xe852('0x14')](_0xe852('0xc'),auth['isAuthenticated'](),controller[_0xe852('0x15')]);module[_0xe852('0x16')]=router;
\ No newline at end of file
index b5666f3..6eef4fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x81b8f4,_0x3526ee){var _0x516bfd=function(_0x262d39){while(--_0x262d39){_0x81b8f4['push'](_0x81b8f4['shift']());}};_0x516bfd(++_0x3526ee);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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
+var _0x2032=['medium','exports','TEXT'];(function(_0x5af95d,_0x52dc48){var _0x19c597=function(_0x477378){while(--_0x477378){_0x5af95d['push'](_0x5af95d['shift']());}};_0x19c597(++_0x52dc48);}(_0x2032,0xd9));var _0x2203=function(_0x5d1f02,_0x44161b){_0x5d1f02=_0x5d1f02-0x0;var _0x28d159=_0x2032[_0x5d1f02];return _0x28d159;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
index f1e393d..ce4a8cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x26cfe9,_0x550174){var _0x54c563=function(_0x360c6b){while(--_0x360c6b){_0x26cfe9['push'](_0x26cfe9['shift']());}};_0x54c563(++_0x550174);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0x25de57,_0x36dfee){_0x25de57=_0x25de57-0x0;var _0x2e38b6=_0x7a54[_0x25de57];return _0x2e38b6;};'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
index 5bc61fe..1be01ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc4a=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4788a5,_0x28409c){var _0x522ece=function(_0x479426){while(--_0x479426){_0x4788a5['push'](_0x4788a5['shift']());}};_0x522ece(++_0x28409c);}(_0xbc4a,0x137));var _0xabc4=function(_0xbc47f1,_0x489fcb){_0xbc47f1=_0xbc47f1-0x0;var _0xb3387b=_0xbc4a[_0xbc47f1];return _0xb3387b;};'use strict';var EventEmitter=require(_0xabc4('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xabc4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xabc4('0x2')](0x0);var events={'afterCreate':_0xabc4('0x3'),'afterUpdate':_0xabc4('0x4'),'afterDestroy':_0xabc4('0x5')};function emitEvent(_0x236cb3){return function(_0x1387ac,_0x17af24,_0x17a4d4){ChatOfflineMessageEvents[_0xabc4('0x6')](_0x236cb3+':'+_0x1387ac['id'],_0x1387ac);ChatOfflineMessageEvents[_0xabc4('0x6')](_0x236cb3,_0x1387ac);_0x17a4d4(null);};}for(var e in events){if(events[_0xabc4('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xabc4('0x8')](e,emitEvent(event));}}module[_0xabc4('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x885b=['ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x885b,0x6a));var _0xb885=function(_0x2fbe3c,_0x174e52){_0x2fbe3c=_0x2fbe3c-0x0;var _0x223da1=_0x885b[_0x2fbe3c];return _0x223da1;};'use strict';var EventEmitter=require(_0xb885('0x0'));var ChatOfflineMessage=require(_0xb885('0x1'))['db'][_0xb885('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb885('0x3'),'afterUpdate':'update','afterDestroy':_0xb885('0x4')};function emitEvent(_0x589317){return function(_0x35e26f,_0x4bec7e,_0x4fe6cd){ChatOfflineMessageEvents['emit'](_0x589317+':'+_0x35e26f['id'],_0x35e26f);ChatOfflineMessageEvents[_0xb885('0x5')](_0x589317,_0x35e26f);_0x4fe6cd(null);};}for(var e in events){if(events[_0xb885('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xb885('0x7')](e,emitEvent(event));}}module[_0xb885('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
index b649d76..f170edd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb412=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1a91f0,_0x11e203){var _0x12f862=function(_0x48983c){while(--_0x48983c){_0x1a91f0['push'](_0x1a91f0['shift']());}};_0x12f862(++_0x11e203);}(_0xb412,0xaf));var _0x2b41=function(_0x16eafb,_0x26d0be){_0x16eafb=_0x16eafb-0x0;var _0x3e8fdc=_0xb412[_0x16eafb];return _0x3e8fdc;};'use strict';var attributes=require(_0x2b41('0x0'));module['exports']=function(_0x16725){return _0x16725[_0x2b41('0x1')](_0x2b41('0x2'),attributes,{'tableName':_0x2b41('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b41('0x4'),'collate':_0x2b41('0x5')});};
\ No newline at end of file
+var _0x35ce=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x91cf75,_0x156959){var _0x562f63=function(_0x3f1f8a){while(--_0x3f1f8a){_0x91cf75['push'](_0x91cf75['shift']());}};_0x562f63(++_0x156959);}(_0x35ce,0x103));var _0xe35c=function(_0x28907c,_0x4c35eb){_0x28907c=_0x28907c-0x0;var _0x39b605=_0x35ce[_0x28907c];return _0x39b605;};'use strict';var attributes=require(_0xe35c('0x0'));module['exports']=function(_0x167417){return _0x167417[_0xe35c('0x1')](_0xe35c('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe35c('0x3'),'collate':_0xe35c('0x4')});};
\ No newline at end of file
index d50fa8b..19202f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa27=['jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x458dad,_0x573c0b){var _0x534d3a=function(_0x5889af){while(--_0x5889af){_0x458dad['push'](_0x458dad['shift']());}};_0x534d3a(++_0x573c0b);}(_0xfa27,0x1b2));var _0x7fa2=function(_0x5d4596,_0x2e2147){_0x5d4596=_0x5d4596-0x0;var _0x225f03=_0xfa27[_0x5d4596];return _0x225f03;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7fa2('0x0'));var BPromise=require(_0x7fa2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fa2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fa2('0x3'))(_0x7fa2('0x4'));var config=require(_0x7fa2('0x5'));var jayson=require(_0x7fa2('0x6'));var client=jayson[_0x7fa2('0x7')][_0x7fa2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40cebe,_0x32a6cd,_0x3dd2df){return new BPromise(function(_0x42e47f,_0x2be7e1){return client[_0x7fa2('0x9')](_0x40cebe,_0x3dd2df)[_0x7fa2('0xa')](function(_0x5f54eb){logger[_0x7fa2('0xb')](_0x7fa2('0xc'),_0x32a6cd,_0x7fa2('0xd'));logger[_0x7fa2('0xe')](_0x7fa2('0xf'),_0x32a6cd,_0x7fa2('0xd'),JSON[_0x7fa2('0x10')](_0x5f54eb));if(_0x5f54eb[_0x7fa2('0x11')]){if(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x12')]===0x1f4){logger[_0x7fa2('0x11')](_0x7fa2('0xc'),_0x32a6cd,_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);return _0x2be7e1(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);}logger[_0x7fa2('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a6cd,_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);return _0x42e47f(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);}else{logger[_0x7fa2('0xb')](_0x7fa2('0xc'),_0x32a6cd,_0x7fa2('0xd'));_0x42e47f(_0x5f54eb['result'][_0x7fa2('0x13')]);}})['catch'](function(_0x4a978f){logger[_0x7fa2('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a6cd,_0x4a978f);_0x2be7e1(_0x4a978f);});});}
\ No newline at end of file
+var _0x5bb7=['jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x23a8ec,_0x3ddb28){var _0x2b2ce1=function(_0x598832){while(--_0x598832){_0x23a8ec['push'](_0x23a8ec['shift']());}};_0x2b2ce1(++_0x3ddb28);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x5bb7[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x75bb('0x0'));var util=require(_0x75bb('0x1'));var moment=require(_0x75bb('0x2'));var BPromise=require(_0x75bb('0x3'));var rs=require(_0x75bb('0x4'));var fs=require('fs');var Redis=require(_0x75bb('0x5'));var db=require(_0x75bb('0x6'))['db'];var utils=require(_0x75bb('0x7'));var logger=require('../../config/logger')(_0x75bb('0x8'));var config=require(_0x75bb('0x9'));var jayson=require(_0x75bb('0xa'));var client=jayson[_0x75bb('0xb')][_0x75bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x581208,_0x5099ab,_0x4ce4af){return new BPromise(function(_0x372ade,_0x5e5dfd){return client[_0x75bb('0xd')](_0x581208,_0x4ce4af)[_0x75bb('0xe')](function(_0x14ac96){logger[_0x75bb('0xf')](_0x75bb('0x10'),_0x5099ab,'request\x20sent');logger[_0x75bb('0x11')](_0x75bb('0x12'),_0x5099ab,_0x75bb('0x13'),JSON[_0x75bb('0x14')](_0x14ac96));if(_0x14ac96[_0x75bb('0x15')]){if(_0x14ac96['error']['code']===0x1f4){logger['error'](_0x75bb('0x10'),_0x5099ab,_0x14ac96['error'][_0x75bb('0x16')]);return _0x5e5dfd(_0x14ac96[_0x75bb('0x15')][_0x75bb('0x16')]);}logger[_0x75bb('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5099ab,_0x14ac96['error'][_0x75bb('0x16')]);return _0x372ade(_0x14ac96[_0x75bb('0x15')][_0x75bb('0x16')]);}else{logger[_0x75bb('0xf')](_0x75bb('0x10'),_0x5099ab,_0x75bb('0x13'));_0x372ade(_0x14ac96['result'][_0x75bb('0x16')]);}})[_0x75bb('0x17')](function(_0x3b77e2){logger[_0x75bb('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5099ab,_0x3b77e2);_0x5e5dfd(_0x3b77e2);});});}
\ No newline at end of file
index fb1ff1f..f37f410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc014=['describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc014,0x1e1));var _0x4c01=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xc014[_0xd0a847];return _0x2536ec;};'use strict';var multer=require(_0x4c01('0x0'));var util=require(_0x4c01('0x1'));var path=require(_0x4c01('0x2'));var timeout=require(_0x4c01('0x3'));var express=require(_0x4c01('0x4'));var router=express[_0x4c01('0x5')]();var fs_extra=require(_0x4c01('0x6'));var auth=require(_0x4c01('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c01('0x8'));router['get']('/',auth[_0x4c01('0x9')](),controller[_0x4c01('0xa')]);router[_0x4c01('0xb')](_0x4c01('0xc'),auth[_0x4c01('0x9')](),controller[_0x4c01('0xd')]);router[_0x4c01('0xb')](_0x4c01('0xe'),auth[_0x4c01('0x9')](),controller[_0x4c01('0xf')]);router['post']('/',auth[_0x4c01('0x9')](),controller['create']);router['put']('/:id',auth[_0x4c01('0x9')](),controller['update']);router[_0x4c01('0x10')](_0x4c01('0xe'),auth[_0x4c01('0x9')](),controller[_0x4c01('0x11')]);module[_0x4c01('0x12')]=router;
\ No newline at end of file
+var _0xfcc5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x59f3d4,_0x424a23){var _0x139400=function(_0x3c478c){while(--_0x3c478c){_0x59f3d4['push'](_0x59f3d4['shift']());}};_0x139400(++_0x424a23);}(_0xfcc5,0x15d));var _0x5fcc=function(_0x45327d,_0xcf4973){_0x45327d=_0x45327d-0x0;var _0x547ae1=_0xfcc5[_0x45327d];return _0x547ae1;};'use strict';var multer=require(_0x5fcc('0x0'));var util=require('util');var path=require(_0x5fcc('0x1'));var timeout=require(_0x5fcc('0x2'));var express=require(_0x5fcc('0x3'));var router=express[_0x5fcc('0x4')]();var fs_extra=require(_0x5fcc('0x5'));var auth=require(_0x5fcc('0x6'));var interaction=require(_0x5fcc('0x7'));var config=require(_0x5fcc('0x8'));var controller=require(_0x5fcc('0x9'));router[_0x5fcc('0xa')]('/',auth[_0x5fcc('0xb')](),controller[_0x5fcc('0xc')]);router['get'](_0x5fcc('0xd'),auth[_0x5fcc('0xb')](),controller[_0x5fcc('0xe')]);router['get'](_0x5fcc('0xf'),auth['isAuthenticated'](),controller[_0x5fcc('0x10')]);router[_0x5fcc('0x11')]('/',auth[_0x5fcc('0xb')](),controller[_0x5fcc('0x12')]);router[_0x5fcc('0x13')](_0x5fcc('0xf'),auth['isAuthenticated'](),controller[_0x5fcc('0x14')]);router['delete'](_0x5fcc('0xf'),auth[_0x5fcc('0xb')](),controller[_0x5fcc('0x15')]);module['exports']=router;
\ No newline at end of file
index 363c33c..6e0e2a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb655=['exports','ENUM','timeout','STRING','sequelize'];(function(_0x12260c,_0x1d8909){var _0x440ab1=function(_0x28faa6){while(--_0x28faa6){_0x12260c['push'](_0x12260c['shift']());}};_0x440ab1(++_0x1d8909);}(_0xb655,0x14e));var _0x5b65=function(_0x4dd11f,_0x574e8c){_0x4dd11f=_0x4dd11f-0x0;var _0x6369ad=_0xb655[_0x4dd11f];return _0x6369ad;};'use strict';var Sequelize=require(_0x5b65('0x0'));module[_0x5b65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5b65('0x2')]('mouseOver',_0x5b65('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5b65('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdb7b=['sequelize','exports','STRING','timeout','INTEGER'];(function(_0x905b57,_0x3b9889){var _0x8e7a67=function(_0x5e34ee){while(--_0x5e34ee){_0x905b57['push'](_0x905b57['shift']());}};_0x8e7a67(++_0x3b9889);}(_0xdb7b,0xeb));var _0xbdb7=function(_0x56bbd5,_0x20f4e0){_0x56bbd5=_0x56bbd5-0x0;var _0x42e2aa=_0xdb7b[_0x56bbd5];return _0x42e2aa;};'use strict';var Sequelize=require(_0xbdb7('0x0'));module[_0xbdb7('0x1')]={'name':{'type':Sequelize[_0xbdb7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xbdb7('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbdb7('0x2')]},'timeout':{'type':Sequelize[_0xbdb7('0x4')]}};
\ No newline at end of file
index 8cc6f54..76f9cef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd3=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','name','show','params','keys','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','catch'];(function(_0x2a99f1,_0x198fd7){var _0x6948e5=function(_0x2ae413){while(--_0x2ae413){_0x2a99f1['push'](_0x2a99f1['shift']());}};_0x6948e5(++_0x198fd7);}(_0x2cd3,0xf1));var _0x32cd=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x2cd3[_0x3042c5];return _0x7cd140;};'use strict';var emlformat=require(_0x32cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32cd('0x1'));var jsonpatch=require(_0x32cd('0x2'));var rp=require(_0x32cd('0x3'));var moment=require(_0x32cd('0x4'));var BPromise=require(_0x32cd('0x5'));var Mustache=require(_0x32cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x32cd('0x7'));var csv=require(_0x32cd('0x8'));var ejs=require(_0x32cd('0x9'));var fs=require('fs');var fs_extra=require(_0x32cd('0xa'));var _=require(_0x32cd('0xb'));var squel=require(_0x32cd('0xc'));var crypto=require(_0x32cd('0xd'));var jsforce=require(_0x32cd('0xe'));var deskjs=require(_0x32cd('0xf'));var toCsv=require(_0x32cd('0x8'));var querystring=require(_0x32cd('0x10'));var Papa=require(_0x32cd('0x11'));var Redis=require(_0x32cd('0x12'));var authService=require(_0x32cd('0x13'));var qs=require(_0x32cd('0x14'));var as=require(_0x32cd('0x15'));var hardwareService=require(_0x32cd('0x16'));var logger=require(_0x32cd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x32cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27db2b,_0x4610ed){_0x4610ed=_0x4610ed||0xcc;return function(_0x459f80){if(_0x459f80){return _0x27db2b[_0x32cd('0x19')](_0x4610ed);}return _0x27db2b[_0x32cd('0x1a')](_0x4610ed)[_0x32cd('0x1b')]();};}function respondWithResult(_0x3ce589,_0x542a02){_0x542a02=_0x542a02||0xc8;return function(_0x51b452){if(_0x51b452){return _0x3ce589[_0x32cd('0x1a')](_0x542a02)[_0x32cd('0x1c')](_0x51b452);}};}function respondWithFilteredResult(_0x149448,_0x440984){return function(_0x4a14b5){if(_0x4a14b5){var _0x3a542b=typeof _0x440984['offset']==='undefined'&&typeof _0x440984[_0x32cd('0x1d')]===_0x32cd('0x1e');var _0x3f9c9c=_0x4a14b5[_0x32cd('0x1f')];var _0x4690c9=_0x3a542b?0x0:_0x440984[_0x32cd('0x20')];var _0x4bfabf=_0x3a542b?_0x4a14b5[_0x32cd('0x1f')]:_0x440984[_0x32cd('0x20')]+_0x440984[_0x32cd('0x1d')];var _0x5d36c9;if(_0x4bfabf>=_0x3f9c9c){_0x4bfabf=_0x3f9c9c;_0x5d36c9=0xc8;}else{_0x5d36c9=0xce;}_0x149448['status'](_0x5d36c9);return _0x149448[_0x32cd('0x21')](_0x32cd('0x22'),_0x4690c9+'-'+_0x4bfabf+'/'+_0x3f9c9c)[_0x32cd('0x1c')](_0x4a14b5);}return null;};}function patchUpdates(_0x19ab29){return function(_0x14b3fe){try{jsonpatch['apply'](_0x14b3fe,_0x19ab29,!![]);}catch(_0x4311cb){return BPromise[_0x32cd('0x23')](_0x4311cb);}return _0x14b3fe[_0x32cd('0x24')]();};}function saveUpdates(_0x1a50a6,_0x3bc9c8){return function(_0x192b1d){if(_0x192b1d){return _0x192b1d[_0x32cd('0x25')](_0x1a50a6)[_0x32cd('0x26')](function(_0x575f97){return _0x575f97;});}return null;};}function removeEntity(_0x3eb73c,_0x5ddfaa){return function(_0x4c7f55){if(_0x4c7f55){return _0x4c7f55[_0x32cd('0x27')]()['then'](function(){_0x3eb73c['status'](0xcc)[_0x32cd('0x1b')]();});}};}function handleEntityNotFound(_0x57782c,_0x54be38){return function(_0x48dadb){if(!_0x48dadb){_0x57782c[_0x32cd('0x19')](0x194);}return _0x48dadb;};}function handleError(_0x1abddd,_0x25d9be){_0x25d9be=_0x25d9be||0x1f4;return function(_0x1af82f){logger['error'](_0x1af82f['stack']);if(_0x1af82f['name']){delete _0x1af82f[_0x32cd('0x28')];}_0x1abddd[_0x32cd('0x1a')](_0x25d9be)['send'](_0x1af82f);};}exports[_0x32cd('0x29')]=function(_0x35f798,_0x1a6754){var _0x241424={'raw':!![],'where':{'id':_0x35f798[_0x32cd('0x2a')]['id']}},_0x27bd86={};_0x27bd86['model']=_[_0x32cd('0x2b')](db[_0x32cd('0x2c')][_0x32cd('0x2d')]);_0x27bd86[_0x32cd('0x2e')]=_[_0x32cd('0x2b')](_0x35f798[_0x32cd('0x2e')]);_0x27bd86['filters']=_[_0x32cd('0x2f')](_0x27bd86[_0x32cd('0x30')],_0x27bd86[_0x32cd('0x2e')]);_0x241424[_0x32cd('0x31')]=_[_0x32cd('0x2f')](_0x27bd86[_0x32cd('0x30')],qs['fields'](_0x35f798[_0x32cd('0x2e')][_0x32cd('0x32')]));_0x241424['attributes']=_0x241424[_0x32cd('0x31')][_0x32cd('0x33')]?_0x241424[_0x32cd('0x31')]:_0x27bd86[_0x32cd('0x30')];if(_0x35f798[_0x32cd('0x2e')][_0x32cd('0x34')]){_0x241424[_0x32cd('0x35')]=[{'all':!![]}];}_0x241424=_[_0x32cd('0x36')]({},_0x241424,_0x35f798[_0x32cd('0x37')]);return db[_0x32cd('0x2c')][_0x32cd('0x38')](_0x241424)[_0x32cd('0x26')](handleEntityNotFound(_0x1a6754,null))[_0x32cd('0x26')](respondWithResult(_0x1a6754,null))['catch'](handleError(_0x1a6754,null));};exports[_0x32cd('0x39')]=function(_0x5baa3a,_0x1911c0){return db[_0x32cd('0x2c')]['create'](_0x5baa3a['body'],{})[_0x32cd('0x26')](respondWithResult(_0x1911c0,0xc9))[_0x32cd('0x3a')](handleError(_0x1911c0,null));};exports[_0x32cd('0x25')]=function(_0x481e23,_0x3a4f49){if(_0x481e23[_0x32cd('0x3b')]['id']){delete _0x481e23[_0x32cd('0x3b')]['id'];}return db[_0x32cd('0x2c')][_0x32cd('0x38')]({'where':{'id':_0x481e23[_0x32cd('0x2a')]['id']}})[_0x32cd('0x26')](handleEntityNotFound(_0x3a4f49,null))[_0x32cd('0x26')](saveUpdates(_0x481e23[_0x32cd('0x3b')],null))['then'](respondWithResult(_0x3a4f49,null))[_0x32cd('0x3a')](handleError(_0x3a4f49,null));};exports['destroy']=function(_0xeb31bb,_0x134ea7){return db[_0x32cd('0x2c')][_0x32cd('0x38')]({'where':{'id':_0xeb31bb['params']['id']}})[_0x32cd('0x26')](handleEntityNotFound(_0x134ea7,null))[_0x32cd('0x26')](removeEntity(_0x134ea7,null))[_0x32cd('0x3a')](handleError(_0x134ea7,null));};
\ No newline at end of file
+var _0x6f7b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x6f7b,0x168));var _0xb6f7=function(_0x1b21d3,_0x26e200){_0x1b21d3=_0x1b21d3-0x0;var _0x44e919=_0x6f7b[_0x1b21d3];return _0x44e919;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6f7('0x0'));var zipdir=require(_0xb6f7('0x1'));var jsonpatch=require(_0xb6f7('0x2'));var rp=require(_0xb6f7('0x3'));var moment=require(_0xb6f7('0x4'));var BPromise=require(_0xb6f7('0x5'));var Mustache=require(_0xb6f7('0x6'));var util=require('util');var path=require(_0xb6f7('0x7'));var sox=require('sox');var csv=require(_0xb6f7('0x8'));var ejs=require(_0xb6f7('0x9'));var fs=require('fs');var fs_extra=require(_0xb6f7('0xa'));var _=require(_0xb6f7('0xb'));var squel=require('squel');var crypto=require(_0xb6f7('0xc'));var jsforce=require(_0xb6f7('0xd'));var deskjs=require(_0xb6f7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6f7('0xf'));var authService=require(_0xb6f7('0x10'));var qs=require(_0xb6f7('0x11'));var as=require(_0xb6f7('0x12'));var hardwareService=require(_0xb6f7('0x13'));var logger=require(_0xb6f7('0x14'))(_0xb6f7('0x15'));var utils=require(_0xb6f7('0x16'));var config=require(_0xb6f7('0x17'));var licenseUtil=require(_0xb6f7('0x18'));var db=require(_0xb6f7('0x19'))['db'];function respondWithStatusCode(_0x34960,_0x470b4d){_0x470b4d=_0x470b4d||0xcc;return function(_0x279785){if(_0x279785){return _0x34960[_0xb6f7('0x1a')](_0x470b4d);}return _0x34960[_0xb6f7('0x1b')](_0x470b4d)[_0xb6f7('0x1c')]();};}function respondWithResult(_0x3723d2,_0xa1d946){_0xa1d946=_0xa1d946||0xc8;return function(_0x31099c){if(_0x31099c){return _0x3723d2[_0xb6f7('0x1b')](_0xa1d946)[_0xb6f7('0x1d')](_0x31099c);}};}function respondWithFilteredResult(_0xa3e8fd,_0xc03835){return function(_0x5be484){if(_0x5be484){var _0xc3859c=typeof _0xc03835[_0xb6f7('0x1e')]===_0xb6f7('0x1f')&&typeof _0xc03835[_0xb6f7('0x20')]==='undefined';var _0x17938a=_0x5be484[_0xb6f7('0x21')];var _0x148b87=_0xc3859c?0x0:_0xc03835['offset'];var _0x220951=_0xc3859c?_0x5be484[_0xb6f7('0x21')]:_0xc03835[_0xb6f7('0x1e')]+_0xc03835[_0xb6f7('0x20')];var _0x9b9bde;if(_0x220951>=_0x17938a){_0x220951=_0x17938a;_0x9b9bde=0xc8;}else{_0x9b9bde=0xce;}_0xa3e8fd[_0xb6f7('0x1b')](_0x9b9bde);return _0xa3e8fd[_0xb6f7('0x22')](_0xb6f7('0x23'),_0x148b87+'-'+_0x220951+'/'+_0x17938a)['json'](_0x5be484);}return null;};}function patchUpdates(_0x2a0795){return function(_0x59f716){try{jsonpatch[_0xb6f7('0x24')](_0x59f716,_0x2a0795,!![]);}catch(_0x3b6403){return BPromise['reject'](_0x3b6403);}return _0x59f716[_0xb6f7('0x25')]();};}function saveUpdates(_0x1508d6,_0x6f7593){return function(_0x55c3dd){if(_0x55c3dd){return _0x55c3dd[_0xb6f7('0x26')](_0x1508d6)['then'](function(_0x25b109){return _0x25b109;});}return null;};}function removeEntity(_0x156a12,_0xc9d994){return function(_0x37d24c){if(_0x37d24c){return _0x37d24c[_0xb6f7('0x27')]()[_0xb6f7('0x28')](function(){_0x156a12[_0xb6f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2968a7,_0x21578b){return function(_0x455bf6){if(!_0x455bf6){_0x2968a7['sendStatus'](0x194);}return _0x455bf6;};}function handleError(_0x3cf307,_0x37d70d){_0x37d70d=_0x37d70d||0x1f4;return function(_0x48eded){logger[_0xb6f7('0x29')](_0x48eded[_0xb6f7('0x2a')]);if(_0x48eded[_0xb6f7('0x2b')]){delete _0x48eded[_0xb6f7('0x2b')];}_0x3cf307[_0xb6f7('0x1b')](_0x37d70d)[_0xb6f7('0x2c')](_0x48eded);};}exports[_0xb6f7('0x2d')]=function(_0x53903f,_0x478d75){var _0x3c5f07={'raw':!![],'where':{'id':_0x53903f['params']['id']}},_0x539587={};_0x539587[_0xb6f7('0x2e')]=_[_0xb6f7('0x2f')](db[_0xb6f7('0x30')]['rawAttributes']);_0x539587[_0xb6f7('0x31')]=_['keys'](_0x53903f[_0xb6f7('0x31')]);_0x539587[_0xb6f7('0x32')]=_[_0xb6f7('0x33')](_0x539587['model'],_0x539587[_0xb6f7('0x31')]);_0x3c5f07['attributes']=_[_0xb6f7('0x33')](_0x539587[_0xb6f7('0x2e')],qs['fields'](_0x53903f[_0xb6f7('0x31')][_0xb6f7('0x34')]));_0x3c5f07[_0xb6f7('0x35')]=_0x3c5f07['attributes'][_0xb6f7('0x36')]?_0x3c5f07['attributes']:_0x539587[_0xb6f7('0x2e')];if(_0x53903f[_0xb6f7('0x31')][_0xb6f7('0x37')]){_0x3c5f07[_0xb6f7('0x38')]=[{'all':!![]}];}_0x3c5f07=_[_0xb6f7('0x39')]({},_0x3c5f07,_0x53903f[_0xb6f7('0x3a')]);return db[_0xb6f7('0x30')][_0xb6f7('0x3b')](_0x3c5f07)[_0xb6f7('0x28')](handleEntityNotFound(_0x478d75,null))[_0xb6f7('0x28')](respondWithResult(_0x478d75,null))['catch'](handleError(_0x478d75,null));};exports[_0xb6f7('0x3c')]=function(_0x3c7787,_0x54e5ef){return db[_0xb6f7('0x30')]['create'](_0x3c7787[_0xb6f7('0x3d')],{})[_0xb6f7('0x28')](respondWithResult(_0x54e5ef,0xc9))[_0xb6f7('0x3e')](handleError(_0x54e5ef,null));};exports['update']=function(_0x1708f5,_0x1bbf07){if(_0x1708f5[_0xb6f7('0x3d')]['id']){delete _0x1708f5[_0xb6f7('0x3d')]['id'];}return db[_0xb6f7('0x30')][_0xb6f7('0x3b')]({'where':{'id':_0x1708f5[_0xb6f7('0x3f')]['id']}})[_0xb6f7('0x28')](handleEntityNotFound(_0x1bbf07,null))[_0xb6f7('0x28')](saveUpdates(_0x1708f5['body'],null))[_0xb6f7('0x28')](respondWithResult(_0x1bbf07,null))[_0xb6f7('0x3e')](handleError(_0x1bbf07,null));};exports[_0xb6f7('0x27')]=function(_0x1e202e,_0x3e3c51){return db[_0xb6f7('0x30')][_0xb6f7('0x3b')]({'where':{'id':_0x1e202e[_0xb6f7('0x3f')]['id']}})[_0xb6f7('0x28')](handleEntityNotFound(_0x3e3c51,null))[_0xb6f7('0x28')](removeEntity(_0x3e3c51,null))[_0xb6f7('0x3e')](handleError(_0x3e3c51,null));};
\ No newline at end of file
index 2de7dba..02a495f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4b2=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions','util'];(function(_0x404d52,_0x68f0ae){var _0x433640=function(_0x21b651){while(--_0x21b651){_0x404d52['push'](_0x404d52['shift']());}};_0x433640(++_0x68f0ae);}(_0xe4b2,0x175));var _0x2e4b=function(_0x1c10bc,_0x1fa89c){_0x1c10bc=_0x1c10bc-0x0;var _0x5e09cd=_0xe4b2[_0x1c10bc];return _0x5e09cd;};'use strict';var _=require('lodash');var util=require(_0x2e4b('0x0'));var logger=require(_0x2e4b('0x1'))(_0x2e4b('0x2'));var moment=require(_0x2e4b('0x3'));var BPromise=require(_0x2e4b('0x4'));var rp=require(_0x2e4b('0x5'));var fs=require('fs');var path=require(_0x2e4b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e4b('0x7'));var attributes=require(_0x2e4b('0x8'));module[_0x2e4b('0x9')]=function(_0x19214f,_0x2e496f){return _0x19214f['define']('ChatProactiveAction',attributes,{'tableName':_0x2e4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd207=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x16bfac,_0x3c5483){var _0x8d22fb=function(_0x157138){while(--_0x157138){_0x16bfac['push'](_0x16bfac['shift']());}};_0x8d22fb(++_0x3c5483);}(_0xd207,0x1ca));var _0x7d20=function(_0x1a841e,_0x225b53){_0x1a841e=_0x1a841e-0x0;var _0x1eeeeb=_0xd207[_0x1a841e];return _0x1eeeeb;};'use strict';var _=require(_0x7d20('0x0'));var util=require(_0x7d20('0x1'));var logger=require(_0x7d20('0x2'))(_0x7d20('0x3'));var moment=require(_0x7d20('0x4'));var BPromise=require(_0x7d20('0x5'));var rp=require(_0x7d20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d20('0x7'));var config=require(_0x7d20('0x8'));var attributes=require(_0x7d20('0x9'));module[_0x7d20('0xa')]=function(_0x2a2257,_0x345d82){return _0x2a2257[_0x7d20('0xb')](_0x7d20('0xc'),attributes,{'tableName':_0x7d20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c00aba0..341b537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb624=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x580c4d,_0x2503b6){var _0x5c4b14=function(_0xc843ec){while(--_0xc843ec){_0x580c4d['push'](_0x580c4d['shift']());}};_0x5c4b14(++_0x2503b6);}(_0xb624,0x15a));var _0x4b62=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0xb624[_0x8560d3];return _0x33b1b5;};'use strict';var _=require(_0x4b62('0x0'));var util=require('util');var moment=require(_0x4b62('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b62('0x3'))['db'];var utils=require(_0x4b62('0x4'));var logger=require('../../config/logger')(_0x4b62('0x5'));var config=require(_0x4b62('0x6'));var jayson=require(_0x4b62('0x7'));var client=jayson[_0x4b62('0x8')][_0x4b62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407392,_0x3a3bf4,_0x1b5718){return new BPromise(function(_0x427a3d,_0x59ecd9){return client[_0x4b62('0xa')](_0x407392,_0x1b5718)['then'](function(_0x125000){logger[_0x4b62('0xb')](_0x4b62('0xc'),_0x3a3bf4,_0x4b62('0xd'));logger[_0x4b62('0xe')](_0x4b62('0xf'),_0x3a3bf4,_0x4b62('0xd'),JSON[_0x4b62('0x10')](_0x125000));if(_0x125000[_0x4b62('0x11')]){if(_0x125000[_0x4b62('0x11')][_0x4b62('0x12')]===0x1f4){logger['error'](_0x4b62('0xc'),_0x3a3bf4,_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);return _0x59ecd9(_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);}logger[_0x4b62('0x11')](_0x4b62('0xc'),_0x3a3bf4,_0x125000['error'][_0x4b62('0x13')]);return _0x427a3d(_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);}else{logger['info'](_0x4b62('0xc'),_0x3a3bf4,_0x4b62('0xd'));_0x427a3d(_0x125000[_0x4b62('0x14')][_0x4b62('0x13')]);}})['catch'](function(_0xf23d04){logger['error'](_0x4b62('0xc'),_0x3a3bf4,_0xf23d04);_0x59ecd9(_0xf23d04);});});}
\ No newline at end of file
+var _0x6e14=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x32cb07,_0x439d27){var _0xbb048b=function(_0x5c7830){while(--_0x5c7830){_0x32cb07['push'](_0x32cb07['shift']());}};_0xbb048b(++_0x439d27);}(_0x6e14,0xd1));var _0x46e1=function(_0x80c2dd,_0x492c8c){_0x80c2dd=_0x80c2dd-0x0;var _0x51f554=_0x6e14[_0x80c2dd];return _0x51f554;};'use strict';var _=require(_0x46e1('0x0'));var util=require(_0x46e1('0x1'));var moment=require(_0x46e1('0x2'));var BPromise=require(_0x46e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46e1('0x4'));var db=require(_0x46e1('0x5'))['db'];var utils=require(_0x46e1('0x6'));var logger=require(_0x46e1('0x7'))(_0x46e1('0x8'));var config=require(_0x46e1('0x9'));var jayson=require(_0x46e1('0xa'));var client=jayson[_0x46e1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6afe,_0x1ed85e,_0x1504ac){return new BPromise(function(_0x410af0,_0x3b96bb){return client[_0x46e1('0xc')](_0x5e6afe,_0x1504ac)[_0x46e1('0xd')](function(_0x2b7f3f){logger[_0x46e1('0xe')](_0x46e1('0xf'),_0x1ed85e,'request\x20sent');logger[_0x46e1('0x10')](_0x46e1('0x11'),_0x1ed85e,_0x46e1('0x12'),JSON[_0x46e1('0x13')](_0x2b7f3f));if(_0x2b7f3f['error']){if(_0x2b7f3f[_0x46e1('0x14')]['code']===0x1f4){logger[_0x46e1('0x14')](_0x46e1('0xf'),_0x1ed85e,_0x2b7f3f[_0x46e1('0x14')]['message']);return _0x3b96bb(_0x2b7f3f['error'][_0x46e1('0x15')]);}logger['error'](_0x46e1('0xf'),_0x1ed85e,_0x2b7f3f['error'][_0x46e1('0x15')]);return _0x410af0(_0x2b7f3f[_0x46e1('0x14')]['message']);}else{logger[_0x46e1('0xe')](_0x46e1('0xf'),_0x1ed85e,_0x46e1('0x12'));_0x410af0(_0x2b7f3f[_0x46e1('0x16')][_0x46e1('0x15')]);}})[_0x46e1('0x17')](function(_0xed389){logger[_0x46e1('0x14')](_0x46e1('0xf'),_0x1ed85e,_0xed389);_0x3b96bb(_0xed389);});});}
\ No newline at end of file
index 5533d91..733d671 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x313377,_0x3afbc8){var _0x4fff39=function(_0x287eb7){while(--_0x287eb7){_0x313377['push'](_0x313377['shift']());}};_0x4fff39(++_0x3afbc8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x55fd5c,_0x7db0da){_0x55fd5c=_0x55fd5c-0x0;var _0x5b21e5=_0x3f8a[_0x55fd5c];return _0x5b21e5;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=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(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x98a8,0x12c));var _0x898a=function(_0x395309,_0x2a9d1a){_0x395309=_0x395309-0x0;var _0xe3228a=_0x98a8[_0x395309];return _0xe3228a;};'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
index f7b4adf..ff13710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d4e=['exports','name','STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x1af90a,_0x323b95){var _0x1e0730=function(_0x15f94a){while(--_0x15f94a){_0x1af90a['push'](_0x1af90a['shift']());}};_0x1e0730(++_0x323b95);}(_0x4d4e,0x1bf));var _0xe4d4=function(_0x3b9007,_0x482404){_0x3b9007=_0x3b9007-0x0;var _0xfe01e7=_0x4d4e[_0x3b9007];return _0xfe01e7;};'use strict';var Sequelize=require(_0xe4d4('0x0'));module[_0xe4d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe4d4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4d4('0x3')]},'timeout':{'type':Sequelize[_0xe4d4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe4d4('0x5')]('rrmemory','beepall',_0xe4d4('0x6'))}};
\ No newline at end of file
+var _0x8317=['ENUM','rrmemory','roundrobin','exports','name','STRING','INTEGER'];(function(_0x28a9d7,_0x1e285d){var _0x542d8e=function(_0x30cd93){while(--_0x30cd93){_0x28a9d7['push'](_0x28a9d7['shift']());}};_0x542d8e(++_0x1e285d);}(_0x8317,0x7a));var _0x7831=function(_0x7a7891,_0x43ca68){_0x7a7891=_0x7a7891-0x0;var _0x39a79d=_0x8317[_0x7a7891];return _0x39a79d;};'use strict';var Sequelize=require('sequelize');module[_0x7831('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7831('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7831('0x2')]},'timeout':{'type':Sequelize[_0x7831('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7831('0x4')](_0x7831('0x5'),'beepall',_0x7831('0x6'))}};
\ No newline at end of file
index c36aaec..6692018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb57=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','ChatQueues','UserProfileResource','status','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','destroy','describe','getMembers','findOne','UserChatQueue','User','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfb57,0x85));var _0x7fb5=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xfb57[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x7fb5('0x0'));var rimraf=require(_0x7fb5('0x1'));var zipdir=require(_0x7fb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fb5('0x3'));var moment=require('moment');var BPromise=require(_0x7fb5('0x4'));var Mustache=require(_0x7fb5('0x5'));var util=require(_0x7fb5('0x6'));var path=require(_0x7fb5('0x7'));var sox=require(_0x7fb5('0x8'));var csv=require('to-csv');var ejs=require(_0x7fb5('0x9'));var fs=require('fs');var fs_extra=require(_0x7fb5('0xa'));var _=require(_0x7fb5('0xb'));var squel=require('squel');var crypto=require(_0x7fb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fb5('0xd'));var toCsv=require(_0x7fb5('0xe'));var querystring=require(_0x7fb5('0xf'));var Papa=require(_0x7fb5('0x10'));var Redis=require(_0x7fb5('0x11'));var authService=require(_0x7fb5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb5('0x14'))(_0x7fb5('0x15'));var utils=require(_0x7fb5('0x16'));var config=require(_0x7fb5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb5('0x18'))['db'];config[_0x7fb5('0x19')]=_['defaults'](config[_0x7fb5('0x19')],{'host':_0x7fb5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fb5('0x19')]));require(_0x7fb5('0x1b'))[_0x7fb5('0x1c')](socket);var jayson=require(_0x7fb5('0x1d'));var client=jayson[_0x7fb5('0x1e')][_0x7fb5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4e8879,_0x258bb9,_0x1b187b,_0x15359a){return new BPromise(function(_0x3abb85,_0xbd13b3){var _0x1d6af6=_0x15359a||client;return _0x1d6af6['request'](_0x4e8879,_0x1b187b)[_0x7fb5('0x20')](function(_0x9d6bc4){logger[_0x7fb5('0x21')](_0x7fb5('0x22'),_0x258bb9,'request\x20sent');logger[_0x7fb5('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x258bb9,_0x7fb5('0x24'),JSON[_0x7fb5('0x25')](_0x9d6bc4));if(_0x9d6bc4[_0x7fb5('0x26')]){if(_0x9d6bc4[_0x7fb5('0x26')]['code']===0x1f4){logger[_0x7fb5('0x26')]('ChatQueue,\x20%s,\x20%s',_0x258bb9,_0x9d6bc4[_0x7fb5('0x26')][_0x7fb5('0x27')]);return _0xbd13b3(_0x9d6bc4[_0x7fb5('0x26')][_0x7fb5('0x27')]);}logger[_0x7fb5('0x26')](_0x7fb5('0x22'),_0x258bb9,_0x9d6bc4[_0x7fb5('0x26')]['message']);return _0x3abb85(_0x9d6bc4['error']['message']);}else{logger['info'](_0x7fb5('0x22'),_0x258bb9,'request\x20sent');_0x3abb85(_0x9d6bc4[_0x7fb5('0x28')]['message']);}})[_0x7fb5('0x29')](function(_0x5f5a4c){logger[_0x7fb5('0x26')](_0x7fb5('0x22'),_0x258bb9,_0x5f5a4c);_0xbd13b3(_0x5f5a4c);});});}function respondWithStatusCode(_0x97c140,_0x2ad7a3){_0x2ad7a3=_0x2ad7a3||0xcc;return function(_0x21bb89){if(_0x21bb89){return _0x97c140[_0x7fb5('0x2a')](_0x2ad7a3);}return _0x97c140['status'](_0x2ad7a3)[_0x7fb5('0x2b')]();};}function respondWithResult(_0x18aeb3,_0x5abf95){_0x5abf95=_0x5abf95||0xc8;return function(_0x2326f5){if(_0x2326f5){return _0x18aeb3['status'](_0x5abf95)[_0x7fb5('0x2c')](_0x2326f5);}};}function respondWithFilteredResult(_0x5c2ff9,_0x28e639){return function(_0x26475f){if(_0x26475f){var _0x2f1234=typeof _0x28e639[_0x7fb5('0x2d')]===_0x7fb5('0x2e')&&typeof _0x28e639[_0x7fb5('0x2f')]===_0x7fb5('0x2e');var _0x304cd6=_0x26475f['count'];var _0x4ff037=_0x2f1234?0x0:_0x28e639['offset'];var _0x30d484=_0x2f1234?_0x26475f['count']:_0x28e639['offset']+_0x28e639[_0x7fb5('0x2f')];var _0x5570e7;if(_0x30d484>=_0x304cd6){_0x30d484=_0x304cd6;_0x5570e7=0xc8;}else{_0x5570e7=0xce;}_0x5c2ff9['status'](_0x5570e7);return _0x5c2ff9[_0x7fb5('0x30')](_0x7fb5('0x31'),_0x4ff037+'-'+_0x30d484+'/'+_0x304cd6)[_0x7fb5('0x2c')](_0x26475f);}return null;};}function patchUpdates(_0x1a0df5){return function(_0x4d24af){try{jsonpatch[_0x7fb5('0x32')](_0x4d24af,_0x1a0df5,!![]);}catch(_0x344986){return BPromise[_0x7fb5('0x33')](_0x344986);}return _0x4d24af[_0x7fb5('0x34')]();};}function saveUpdates(_0x5ecefd,_0x325019){return function(_0x20be40){if(_0x20be40){return _0x20be40[_0x7fb5('0x35')](_0x5ecefd)[_0x7fb5('0x20')](function(_0x3b77ca){return _0x3b77ca;});}return null;};}function removeEntity(_0x867d60,_0x8eb259){return function(_0x2a9deb){if(_0x2a9deb){return _0x2a9deb['destroy']()[_0x7fb5('0x20')](function(){var _0x1455a8=_0x2a9deb['get']({'plain':!![]});var _0x313fa9=_0x7fb5('0x36');return db[_0x7fb5('0x37')]['destroy']({'where':{'type':_0x313fa9,'resourceId':_0x1455a8['id']}})[_0x7fb5('0x20')](function(){return _0x2a9deb;});})[_0x7fb5('0x20')](function(){_0x867d60[_0x7fb5('0x38')](0xcc)['end']();});}};}function handleEntityNotFound(_0x866895,_0x12010d){return function(_0x5d0d39){if(!_0x5d0d39){_0x866895[_0x7fb5('0x2a')](0x194);}return _0x5d0d39;};}function handleError(_0x13446f,_0x236e55){_0x236e55=_0x236e55||0x1f4;return function(_0xb93000){logger[_0x7fb5('0x26')](_0xb93000['stack']);if(_0xb93000[_0x7fb5('0x39')]){delete _0xb93000[_0x7fb5('0x39')];}_0x13446f[_0x7fb5('0x38')](_0x236e55)[_0x7fb5('0x3a')](_0xb93000);};}exports[_0x7fb5('0x3b')]=function(_0x583f7d,_0x48b09e){var _0x1da6aa={},_0x1ca2e3={},_0x5bcb66={'count':0x0,'rows':[]};var _0x37efd4=_[_0x7fb5('0x3c')](db[_0x7fb5('0x3d')][_0x7fb5('0x3e')],function(_0x425ef8){return{'name':_0x425ef8[_0x7fb5('0x3f')],'type':_0x425ef8['type'][_0x7fb5('0x40')]};});_0x1ca2e3['model']=_[_0x7fb5('0x3c')](_0x37efd4,_0x7fb5('0x39'));_0x1ca2e3[_0x7fb5('0x41')]=_[_0x7fb5('0x42')](_0x583f7d[_0x7fb5('0x41')]);_0x1ca2e3[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x1ca2e3['model'],_0x1ca2e3[_0x7fb5('0x41')]);_0x1da6aa[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x1ca2e3[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x1da6aa[_0x7fb5('0x45')]=_0x1da6aa[_0x7fb5('0x45')]['length']?_0x1da6aa[_0x7fb5('0x45')]:_0x1ca2e3[_0x7fb5('0x46')];if(!_0x583f7d['query'][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x1da6aa[_0x7fb5('0x2f')]=qs[_0x7fb5('0x2f')](_0x583f7d['query']['limit']);_0x1da6aa[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x583f7d['query']['offset']);}_0x1da6aa[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x4b')]);_0x1da6aa[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_[_0x7fb5('0x4d')](_0x583f7d[_0x7fb5('0x41')],_0x1ca2e3['filters']),_0x37efd4);if(_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x1da6aa[_0x7fb5('0x4c')]=_[_0x7fb5('0x4f')](_0x1da6aa[_0x7fb5('0x4c')],{'$or':_[_0x7fb5('0x3c')](_0x37efd4,function(_0x377839){if(_0x377839[_0x7fb5('0x50')]!==_0x7fb5('0x51')){var _0x48f18f={};_0x48f18f[_0x377839[_0x7fb5('0x39')]]={'$like':'%'+_0x583f7d['query'][_0x7fb5('0x4e')]+'%'};return _0x48f18f;}})});}_0x1da6aa=_[_0x7fb5('0x4f')]({},_0x1da6aa,_0x583f7d[_0x7fb5('0x52')]);var _0x33ed36={'where':_0x1da6aa['where']};return db['ChatQueue'][_0x7fb5('0x53')](_0x33ed36)[_0x7fb5('0x20')](function(_0x367dde){_0x5bcb66[_0x7fb5('0x53')]=_0x367dde;if(_0x583f7d['query'][_0x7fb5('0x54')]){_0x1da6aa[_0x7fb5('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0x7fb5('0x56')](_0x1da6aa);})[_0x7fb5('0x20')](function(_0x53070f){_0x5bcb66['rows']=_0x53070f;return _0x5bcb66;})['then'](respondWithFilteredResult(_0x48b09e,_0x1da6aa))['catch'](handleError(_0x48b09e,null));};exports[_0x7fb5('0x57')]=function(_0xdc2775,_0xf32f5a){var _0x381607={'raw':!![],'where':{'id':_0xdc2775[_0x7fb5('0x58')]['id']}},_0x42a00e={};_0x42a00e[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db[_0x7fb5('0x3d')][_0x7fb5('0x3e')]);_0x42a00e[_0x7fb5('0x41')]=_['keys'](_0xdc2775[_0x7fb5('0x41')]);_0x42a00e[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x42a00e[_0x7fb5('0x46')],_0x42a00e[_0x7fb5('0x41')]);_0x381607[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x42a00e[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0xdc2775[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x381607[_0x7fb5('0x45')]=_0x381607[_0x7fb5('0x45')][_0x7fb5('0x59')]?_0x381607[_0x7fb5('0x45')]:_0x42a00e[_0x7fb5('0x46')];if(_0xdc2775[_0x7fb5('0x41')][_0x7fb5('0x54')]){_0x381607[_0x7fb5('0x55')]=[{'all':!![]}];}_0x381607=_['merge']({},_0x381607,_0xdc2775[_0x7fb5('0x52')]);return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')](_0x381607)[_0x7fb5('0x20')](handleEntityNotFound(_0xf32f5a,null))[_0x7fb5('0x20')](respondWithResult(_0xf32f5a,null))[_0x7fb5('0x29')](handleError(_0xf32f5a,null));};exports[_0x7fb5('0x5b')]=function(_0x2c4c8b,_0x3c8449){return db[_0x7fb5('0x3d')][_0x7fb5('0x5b')](_0x2c4c8b[_0x7fb5('0x5c')],{})[_0x7fb5('0x20')](function(_0x41b386){var _0x9db8e5=_0x2c4c8b[_0x7fb5('0x5d')]['get']({'plain':!![]});if(!_0x9db8e5)throw new Error(_0x7fb5('0x5e'));if(_0x9db8e5[_0x7fb5('0x5f')]===_0x7fb5('0x5d')){var _0x166ef6=_0x41b386[_0x7fb5('0x60')]({'plain':!![]});var _0x5c9d83=_0x7fb5('0x36');return db[_0x7fb5('0x61')][_0x7fb5('0x5a')]({'where':{'name':_0x5c9d83,'userProfileId':_0x9db8e5['userProfileId']},'raw':!![]})[_0x7fb5('0x20')](function(_0x4def82){if(_0x4def82&&_0x4def82[_0x7fb5('0x62')]===0x0){return db['UserProfileResource'][_0x7fb5('0x5b')]({'name':_0x166ef6[_0x7fb5('0x39')],'resourceId':_0x166ef6['id'],'type':_0x4def82['name'],'sectionId':_0x4def82['id']},{})[_0x7fb5('0x20')](function(){return _0x41b386;});}else{return _0x41b386;}})['catch'](function(_0x44cd72){logger[_0x7fb5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44cd72);throw _0x44cd72;});}return _0x41b386;})[_0x7fb5('0x20')](respondWithResult(_0x3c8449,0xc9))[_0x7fb5('0x29')](handleError(_0x3c8449,null));};exports[_0x7fb5('0x35')]=function(_0x6d6b41,_0x7dee4b){if(_0x6d6b41['body']['id']){delete _0x6d6b41[_0x7fb5('0x5c')]['id'];}return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x6d6b41[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x7dee4b,null))['then'](saveUpdates(_0x6d6b41[_0x7fb5('0x5c')],null))[_0x7fb5('0x20')](respondWithResult(_0x7dee4b,null))['catch'](handleError(_0x7dee4b,null));};exports[_0x7fb5('0x63')]=function(_0x359166,_0x100660){return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')]({'where':{'id':_0x359166['params']['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x100660,null))[_0x7fb5('0x20')](removeEntity(_0x100660,null))[_0x7fb5('0x29')](handleError(_0x100660,null));};exports[_0x7fb5('0x64')]=function(_0x55a8dd,_0x395e31){return db[_0x7fb5('0x3d')]['describe']()[_0x7fb5('0x20')](respondWithResult(_0x395e31,null))[_0x7fb5('0x29')](handleError(_0x395e31,null));};exports[_0x7fb5('0x65')]=function(_0x2fbf79,_0x12e6a5,_0x460e12){var _0x167620={'raw':!![],'where':{}},_0x294cdd={},_0x403dc5;return db[_0x7fb5('0x3d')][_0x7fb5('0x66')]({'where':{'id':_0x2fbf79['params']['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x12e6a5,null))[_0x7fb5('0x20')](function(_0x4341b1){if(_0x4341b1){_0x403dc5=_0x4341b1['get']({'plain':!![]});_0x294cdd[_0x7fb5('0x46')]=_['keys'](db[_0x7fb5('0x67')][_0x7fb5('0x3e')]);_0x294cdd['query']=_['keys'](_0x2fbf79[_0x7fb5('0x41')]);_0x294cdd[_0x7fb5('0x43')]=_['intersection'](_0x294cdd['model'],_0x294cdd[_0x7fb5('0x41')]);_0x167620[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x294cdd[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x2fbf79[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x167620[_0x7fb5('0x45')]=_0x167620[_0x7fb5('0x45')][_0x7fb5('0x59')]?_0x167620['attributes']:_0x294cdd['model'];if(!_0x2fbf79['query'][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x167620[_0x7fb5('0x2f')]=qs['limit'](_0x2fbf79['query'][_0x7fb5('0x2f')]);_0x167620[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x2fbf79[_0x7fb5('0x41')]['offset']);}_0x167620[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x2fbf79['query'][_0x7fb5('0x4b')]);_0x167620['where']=qs[_0x7fb5('0x43')](_['pick'](_0x2fbf79[_0x7fb5('0x41')],_0x294cdd['filters']));_0x167620[_0x7fb5('0x4c')]['ChatQueueId']=_0x4341b1['id'];if(_0x2fbf79[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x167620[_0x7fb5('0x4c')]=_[_0x7fb5('0x4f')](_0x167620[_0x7fb5('0x4c')],{'$or':_['map'](_0x167620[_0x7fb5('0x45')],function(_0x2ff327){var _0x10ac8b={};_0x10ac8b[_0x2ff327]={'$like':'%'+_0x2fbf79[_0x7fb5('0x41')]['filter']+'%'};return _0x10ac8b;})});}_0x167620=_['merge']({},_0x167620,_0x2fbf79[_0x7fb5('0x52')]);return db['UserChatQueue'][_0x7fb5('0x56')](_0x167620);}})[_0x7fb5('0x20')](function(_0x15e7ab){if(_0x15e7ab){return db[_0x7fb5('0x68')]['findAndCountAll']({'where':{'id':_[_0x7fb5('0x3c')](_0x15e7ab,_0x7fb5('0x69')),'role':_0x7fb5('0x6a')},'attributes':['id',_0x7fb5('0x39'),_0x7fb5('0x6b'),'updatedAt',_0x7fb5('0x6c')]});}})['then'](function(_0x5e9bfb){if(_0x5e9bfb){return{'count':_0x5e9bfb[_0x7fb5('0x53')],'rows':_['map'](_0x5e9bfb['rows'],function(_0x313e49){return{'membername':_0x313e49[_0x7fb5('0x39')],'UserId':_0x313e49['id'],'queue_name':_0x403dc5[_0x7fb5('0x39')],'ChatQueueId':_0x403dc5['id'],'interface':util[_0x7fb5('0x6d')](_0x7fb5('0x6e'),_0x7fb5('0x6f'),_0x313e49[_0x7fb5('0x39')]),'penalty':0x0,'paused':_0x313e49[_0x7fb5('0x6b')],'createdAt':_0x313e49[_0x7fb5('0x6c')],'updatedAt':_0x313e49[_0x7fb5('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x12e6a5,_0x167620))[_0x7fb5('0x29')](handleError(_0x12e6a5,null));};exports['getTeams']=function(_0x3d5b22,_0x402855,_0x55853f){var _0x5c058a={};var _0x4caad3={};var _0xc1f352;var _0x1da22f;return db[_0x7fb5('0x3d')]['findOne']({'where':{'id':_0x3d5b22[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x402855,null))[_0x7fb5('0x20')](function(_0x278ea6){if(_0x278ea6){_0xc1f352=_0x278ea6;_0x4caad3[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db['Team'][_0x7fb5('0x3e')]);_0x4caad3[_0x7fb5('0x41')]=_['keys'](_0x3d5b22[_0x7fb5('0x41')]);_0x4caad3[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x4caad3[_0x7fb5('0x46')],_0x4caad3[_0x7fb5('0x41')]);_0x5c058a[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x4caad3['model'],qs['fields'](_0x3d5b22['query'][_0x7fb5('0x47')]));_0x5c058a['attributes']=_0x5c058a[_0x7fb5('0x45')]['length']?_0x5c058a[_0x7fb5('0x45')]:_0x4caad3['model'];_0x5c058a[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x3d5b22[_0x7fb5('0x41')]['sort']);_0x5c058a[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_[_0x7fb5('0x4d')](_0x3d5b22[_0x7fb5('0x41')],_0x4caad3[_0x7fb5('0x43')]));if(_0x3d5b22['query']['filter']){_0x5c058a['where']=_[_0x7fb5('0x4f')](_0x5c058a[_0x7fb5('0x4c')],{'$or':_[_0x7fb5('0x3c')](_0x5c058a['attributes'],function(_0x466b87){var _0x232506={};_0x232506[_0x466b87]={'$like':'%'+_0x3d5b22[_0x7fb5('0x41')][_0x7fb5('0x4e')]+'%'};return _0x232506;})});}_0x5c058a=_['merge']({},_0x5c058a,_0x3d5b22[_0x7fb5('0x52')]);return _0xc1f352['getTeams'](_0x5c058a);}})[_0x7fb5('0x20')](function(_0x119fac){if(_0x119fac){_0x1da22f=_0x119fac[_0x7fb5('0x59')];if(!_0x3d5b22[_0x7fb5('0x41')][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x5c058a['limit']=qs[_0x7fb5('0x2f')](_0x3d5b22[_0x7fb5('0x41')]['limit']);_0x5c058a['offset']=qs[_0x7fb5('0x2d')](_0x3d5b22['query'][_0x7fb5('0x2d')]);}return _0xc1f352[_0x7fb5('0x71')](_0x5c058a);}})[_0x7fb5('0x20')](function(_0x4f448b){if(_0x4f448b){return _0x4f448b?{'count':_0x1da22f,'rows':_0x4f448b}:null;}})[_0x7fb5('0x20')](respondWithResult(_0x402855,null))[_0x7fb5('0x29')](handleError(_0x402855,null));};exports['addTeams']=function(_0x2adbeb,_0x29698e,_0x570d29){var _0x527ef6=_0x2adbeb['body'][_0x7fb5('0x72')];return db[_0x7fb5('0x73')]['findAll']({'where':{'id':_0x527ef6},'attributes':['id'],'include':[{'model':db[_0x7fb5('0x68')],'as':_0x7fb5('0x74'),'attributes':['id','name',_0x7fb5('0x75'),_0x7fb5('0x76'),_0x7fb5('0x77')],'raw':!![]}]})[_0x7fb5('0x20')](function(_0x20fdfc){if(_0x20fdfc){var _0x2ebd58=_[_0x7fb5('0x78')](_0x20fdfc,function(_0x48576c){var _0x398eef=_0x48576c['get']({'plain':!![]});return _0x398eef[_0x7fb5('0x74')];});return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x2adbeb[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](function(_0x3c66ad){return db[_0x7fb5('0x79')]['transaction'](function(_0x311fa2){return _0x3c66ad['addTeams'](_0x527ef6,{'transaction':_0x311fa2})[_0x7fb5('0x20')](function(){return BPromise[_0x7fb5('0x7a')](_0x2ebd58,function(_0x159d6e){return db[_0x7fb5('0x67')][_0x7fb5('0x7b')]({'where':{'UserId':_0x159d6e['id'],'ChatQueueId':_0x2adbeb[_0x7fb5('0x58')]['id']},'transaction':_0x311fa2});});})[_0x7fb5('0x20')](function(){_0x2ebd58[_0x7fb5('0x7c')](function(_0x5b4775){socket[_0x7fb5('0x7d')]('userChatQueue:save',{'UserId':_0x5b4775['id'],'ChatQueueId':_0x3c66ad['id']});});});});});}})[_0x7fb5('0x20')](respondWithStatusCode(_0x29698e,null))[_0x7fb5('0x29')](handleError(_0x29698e,null));};exports[_0x7fb5('0x7e')]=function(_0x450080,_0xeece0e,_0x77e71d){return db[_0x7fb5('0x73')]['findAll']({'where':{'id':_0x450080[_0x7fb5('0x41')][_0x7fb5('0x72')]},'attributes':['id'],'include':[{'model':db[_0x7fb5('0x68')],'as':_0x7fb5('0x74'),'attributes':['id'],'raw':!![]}]})[_0x7fb5('0x20')](handleEntityNotFound(_0xeece0e,null))[_0x7fb5('0x20')](function(_0x3ae8f5){var _0x56b43f=_['map'](_0x3ae8f5,'id');var _0x57902f=[];var _0x1fa6d9=[];var _0x19240c=squel[_0x7fb5('0x7f')]();_0x19240c[_0x7fb5('0x80')]('tq.TeamId')[_0x7fb5('0x81')](_0x7fb5('0x82'),'tq')['join']('user_has_teams','ut',_0x7fb5('0x83'))[_0x7fb5('0x4c')](_0x7fb5('0x84'),_0x450080[_0x7fb5('0x58')]['id']);for(var _0x405fdc=0x0;_0x405fdc<_0x3ae8f5[_0x7fb5('0x59')];_0x405fdc+=0x1){let _0xb88478=_0x3ae8f5[_0x405fdc];for(var _0x49eb17=0x0;_0x49eb17<_0xb88478[_0x7fb5('0x74')][_0x7fb5('0x59')];_0x49eb17+=0x1){let _0x22a242=_0xb88478[_0x7fb5('0x74')][_0x49eb17];var _0x509584=_0x19240c[_0x7fb5('0x85')]();_0x509584[_0x7fb5('0x4c')](_0x7fb5('0x86'),_0x22a242['id']);_0x1fa6d9[_0x7fb5('0x87')](db[_0x7fb5('0x79')][_0x7fb5('0x41')](_0x509584['toString'](),{'type':db['sequelize'][_0x7fb5('0x88')]['SELECT']})[_0x7fb5('0x20')](function(_0x465a9a){if(_0x465a9a['length']===0x1){return _0x22a242['id'];}else{var _0xcddba8=_[_0x7fb5('0x89')](_['map'](_0x465a9a,_0x7fb5('0x8a')),function(_0x2fdbd3){return _[_0x7fb5('0x8b')](_0x56b43f,_0x2fdbd3);});if(_0xcddba8){return _0x22a242['id'];}}}));}}return BPromise[_0x7fb5('0x8c')](_0x1fa6d9)['then'](function(_0x136560){_0x57902f=_(_0x57902f)['union'](_0x136560)[_0x7fb5('0x8d')]()[_0x7fb5('0x8e')]();return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x450080[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](function(_0x38eb17){return db[_0x7fb5('0x79')][_0x7fb5('0x8f')](function(_0x22553f){return _0x38eb17[_0x7fb5('0x7e')](_0x450080['query'][_0x7fb5('0x72')],{'transaction':_0x22553f})[_0x7fb5('0x20')](function(){if(!_[_0x7fb5('0x90')](_0x57902f)){return _0x38eb17[_0x7fb5('0x91')](_0x57902f,{'transaction':_0x22553f});}})[_0x7fb5('0x20')](function(){_0x57902f[_0x7fb5('0x7c')](function(_0x4d78d7){socket[_0x7fb5('0x7d')](_0x7fb5('0x92'),{'UserId':_0x4d78d7,'ChatQueueId':_0x38eb17['id']});});});});});});})[_0x7fb5('0x20')](respondWithStatusCode(_0xeece0e,null))['catch'](handleError(_0xeece0e,null));};exports[_0x7fb5('0x93')]=function(_0x2bfbd0,_0xc08a5a,_0x806dee){return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')]({'where':{'id':_0x2bfbd0[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0xc08a5a,null))[_0x7fb5('0x20')](function(_0x395462){if(_0x395462){return _0x395462[_0x7fb5('0x93')](_0x2bfbd0[_0x7fb5('0x5c')]['ids'],_['omit'](_0x2bfbd0['body'],['ids','id'])||{})[_0x7fb5('0x94')](function(_0x3bc4ec){for(var _0x4812c8=0x0;_0x4812c8<_0x2bfbd0[_0x7fb5('0x5c')]['ids'][_0x7fb5('0x59')];_0x4812c8+=0x1){socket['emit'](_0x7fb5('0x95'),{'UserId':Number(_0x2bfbd0[_0x7fb5('0x5c')][_0x7fb5('0x72')][_0x4812c8]),'ChatQueueId':Number(_0x2bfbd0[_0x7fb5('0x58')]['id'])});}return _0x3bc4ec;});}})[_0x7fb5('0x20')](respondWithResult(_0xc08a5a,null))[_0x7fb5('0x29')](handleError(_0xc08a5a,null));};exports[_0x7fb5('0x91')]=function(_0x5dc5eb,_0x42cdf0,_0x52103a){return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x5dc5eb[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x42cdf0,null))[_0x7fb5('0x20')](function(_0x1b1222){if(_0x1b1222){return _0x1b1222['removeAgents'](_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')])[_0x7fb5('0x20')](function(){if(_['isArray'](_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')])){for(var _0x4596d2=0x0;_0x4596d2<_0x5dc5eb[_0x7fb5('0x41')]['ids'][_0x7fb5('0x59')];_0x4596d2+=0x1){socket['emit'](_0x7fb5('0x92'),{'UserId':Number(_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')][_0x4596d2]),'ChatQueueId':Number(_0x5dc5eb[_0x7fb5('0x58')]['id'])});}}else{socket[_0x7fb5('0x7d')](_0x7fb5('0x92'),{'UserId':Number(_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')]),'ChatQueueId':Number(_0x5dc5eb['params']['id'])});}});}})[_0x7fb5('0x20')](respondWithStatusCode(_0x42cdf0,null))['catch'](handleError(_0x42cdf0,null));};exports[_0x7fb5('0x96')]=function(_0x2fa0b1,_0x2d0fed,_0x25496c){var _0x12fbab={};var _0xdaf336={};var _0x545da5;var _0x173461;return db[_0x7fb5('0x3d')]['findOne']({'where':{'id':_0x2fa0b1[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x2d0fed,null))[_0x7fb5('0x20')](function(_0x3afc9f){if(_0x3afc9f){_0x545da5=_0x3afc9f;_0xdaf336[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db[_0x7fb5('0x68')]['rawAttributes']);_0xdaf336[_0x7fb5('0x41')]=_['keys'](_0x2fa0b1[_0x7fb5('0x41')]);_0xdaf336['filters']=_[_0x7fb5('0x44')](_0xdaf336['model'],_0xdaf336[_0x7fb5('0x41')]);_0x12fbab[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0xdaf336[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x12fbab[_0x7fb5('0x45')]=_0x12fbab['attributes'][_0x7fb5('0x59')]?_0x12fbab[_0x7fb5('0x45')]:_0xdaf336[_0x7fb5('0x46')];_0x12fbab[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x2fa0b1['query'][_0x7fb5('0x4b')]);_0x12fbab[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_['pick'](_0x2fa0b1[_0x7fb5('0x41')],_0xdaf336[_0x7fb5('0x43')]));if(_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x12fbab['where']=_[_0x7fb5('0x4f')](_0x12fbab['where'],{'$or':_[_0x7fb5('0x3c')](_0x12fbab[_0x7fb5('0x45')],function(_0x48839b){var _0x7b2fe4={};_0x7b2fe4[_0x48839b]={'$like':'%'+_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x4e')]+'%'};return _0x7b2fe4;})});}_0x12fbab=_[_0x7fb5('0x4f')]({},_0x12fbab,_0x2fa0b1['options']);return _0x545da5[_0x7fb5('0x96')](_0x12fbab);}})[_0x7fb5('0x20')](function(_0x21e60b){if(_0x21e60b){_0x173461=_0x21e60b[_0x7fb5('0x59')];if(!_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x12fbab['limit']=qs[_0x7fb5('0x2f')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x2f')]);_0x12fbab[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x2d')]);}return _0x545da5['getAgents'](_0x12fbab);}})['then'](function(_0x507a6a){if(_0x507a6a){return _0x507a6a?{'count':_0x173461,'rows':_0x507a6a}:null;}})[_0x7fb5('0x20')](respondWithResult(_0x2d0fed,null))[_0x7fb5('0x29')](handleError(_0x2d0fed,null));};
\ No newline at end of file
+var _0xdcfe=['../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','UserId','agent','chatPause','createdAt','format','%s/%s','getTeams','Team','ids','Agents','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','compact','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x5053c0,_0x243534){var _0x340f24=function(_0x5ad9b5){while(--_0x5ad9b5){_0x5053c0['push'](_0x5053c0['shift']());}};_0x340f24(++_0x243534);}(_0xdcfe,0x10f));var _0xedcf=function(_0x13a144,_0x56f897){_0x13a144=_0x13a144-0x0;var _0x201d3b=_0xdcfe[_0x13a144];return _0x201d3b;};'use strict';var emlformat=require(_0xedcf('0x0'));var rimraf=require(_0xedcf('0x1'));var zipdir=require(_0xedcf('0x2'));var jsonpatch=require(_0xedcf('0x3'));var rp=require(_0xedcf('0x4'));var moment=require(_0xedcf('0x5'));var BPromise=require(_0xedcf('0x6'));var Mustache=require(_0xedcf('0x7'));var util=require(_0xedcf('0x8'));var path=require(_0xedcf('0x9'));var sox=require(_0xedcf('0xa'));var csv=require('to-csv');var ejs=require(_0xedcf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedcf('0xc'));var squel=require('squel');var crypto=require(_0xedcf('0xd'));var jsforce=require(_0xedcf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0xf'));var querystring=require(_0xedcf('0x10'));var Papa=require(_0xedcf('0x11'));var Redis=require(_0xedcf('0x12'));var authService=require(_0xedcf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xedcf('0x14'));var hardwareService=require(_0xedcf('0x15'));var logger=require(_0xedcf('0x16'))(_0xedcf('0x17'));var utils=require('../../config/utils');var config=require(_0xedcf('0x18'));var licenseUtil=require(_0xedcf('0x19'));var db=require(_0xedcf('0x1a'))['db'];config[_0xedcf('0x1b')]=_[_0xedcf('0x1c')](config['redis'],{'host':_0xedcf('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedcf('0x1b')]));require(_0xedcf('0x1e'))['register'](socket);var jayson=require(_0xedcf('0x1f'));var client=jayson[_0xedcf('0x20')][_0xedcf('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x415130,_0x259cc3,_0x31797f,_0x14f5c8){return new BPromise(function(_0x52a347,_0xc1a093){var _0x4a0608=_0x14f5c8||client;return _0x4a0608[_0xedcf('0x22')](_0x415130,_0x31797f)[_0xedcf('0x23')](function(_0x486ec6){logger[_0xedcf('0x24')](_0xedcf('0x25'),_0x259cc3,_0xedcf('0x26'));logger[_0xedcf('0x27')](_0xedcf('0x28'),_0x259cc3,_0xedcf('0x26'),JSON[_0xedcf('0x29')](_0x486ec6));if(_0x486ec6[_0xedcf('0x2a')]){if(_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2b')]===0x1f4){logger[_0xedcf('0x2a')](_0xedcf('0x25'),_0x259cc3,_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2c')]);return _0xc1a093(_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2c')]);}logger[_0xedcf('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0x486ec6[_0xedcf('0x2a')]['message']);return _0x52a347(_0x486ec6[_0xedcf('0x2a')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0xedcf('0x26'));_0x52a347(_0x486ec6['result'][_0xedcf('0x2c')]);}})['catch'](function(_0x56f2ad){logger[_0xedcf('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0x56f2ad);_0xc1a093(_0x56f2ad);});});}function respondWithStatusCode(_0x5474b9,_0x19f5b6){_0x19f5b6=_0x19f5b6||0xcc;return function(_0x4acdfd){if(_0x4acdfd){return _0x5474b9[_0xedcf('0x2d')](_0x19f5b6);}return _0x5474b9[_0xedcf('0x2e')](_0x19f5b6)[_0xedcf('0x2f')]();};}function respondWithResult(_0x6df240,_0x192c64){_0x192c64=_0x192c64||0xc8;return function(_0x31bab5){if(_0x31bab5){return _0x6df240[_0xedcf('0x2e')](_0x192c64)['json'](_0x31bab5);}};}function respondWithFilteredResult(_0x2cd776,_0x258037){return function(_0x406173){if(_0x406173){var _0x56a4c4=typeof _0x258037['offset']===_0xedcf('0x30')&&typeof _0x258037[_0xedcf('0x31')]===_0xedcf('0x30');var _0x425453=_0x406173[_0xedcf('0x32')];var _0x2d8d85=_0x56a4c4?0x0:_0x258037[_0xedcf('0x33')];var _0xf5b12c=_0x56a4c4?_0x406173['count']:_0x258037[_0xedcf('0x33')]+_0x258037[_0xedcf('0x31')];var _0x32260b;if(_0xf5b12c>=_0x425453){_0xf5b12c=_0x425453;_0x32260b=0xc8;}else{_0x32260b=0xce;}_0x2cd776[_0xedcf('0x2e')](_0x32260b);return _0x2cd776[_0xedcf('0x34')]('Content-Range',_0x2d8d85+'-'+_0xf5b12c+'/'+_0x425453)[_0xedcf('0x35')](_0x406173);}return null;};}function patchUpdates(_0x3ca322){return function(_0xdcbde5){try{jsonpatch[_0xedcf('0x36')](_0xdcbde5,_0x3ca322,!![]);}catch(_0x8ad0d8){return BPromise[_0xedcf('0x37')](_0x8ad0d8);}return _0xdcbde5[_0xedcf('0x38')]();};}function saveUpdates(_0x43052e,_0x20cc06){return function(_0x4a8b60){if(_0x4a8b60){return _0x4a8b60[_0xedcf('0x39')](_0x43052e)[_0xedcf('0x23')](function(_0x20cbca){return _0x20cbca;});}return null;};}function removeEntity(_0x4dace7,_0x2aed3a){return function(_0x2f53e3){if(_0x2f53e3){return _0x2f53e3['destroy']()[_0xedcf('0x23')](function(){var _0x542ac7=_0x2f53e3['get']({'plain':!![]});var _0xd0be89=_0xedcf('0x3a');return db[_0xedcf('0x3b')][_0xedcf('0x3c')]({'where':{'type':_0xd0be89,'resourceId':_0x542ac7['id']}})[_0xedcf('0x23')](function(){return _0x2f53e3;});})[_0xedcf('0x23')](function(){_0x4dace7[_0xedcf('0x2e')](0xcc)[_0xedcf('0x2f')]();});}};}function handleEntityNotFound(_0x36b6eb,_0x5a83f1){return function(_0xc6340e){if(!_0xc6340e){_0x36b6eb[_0xedcf('0x2d')](0x194);}return _0xc6340e;};}function handleError(_0x5b5d8e,_0x24db41){_0x24db41=_0x24db41||0x1f4;return function(_0x1a3f80){logger[_0xedcf('0x2a')](_0x1a3f80[_0xedcf('0x3d')]);if(_0x1a3f80[_0xedcf('0x3e')]){delete _0x1a3f80['name'];}_0x5b5d8e['status'](_0x24db41)[_0xedcf('0x3f')](_0x1a3f80);};}exports['index']=function(_0x35d369,_0x57d6c3){var _0x459c6f={},_0x30029d={},_0x25dc1f={'count':0x0,'rows':[]};var _0xa258f6=_[_0xedcf('0x40')](db[_0xedcf('0x41')][_0xedcf('0x42')],function(_0x2b257e){return{'name':_0x2b257e[_0xedcf('0x43')],'type':_0x2b257e[_0xedcf('0x44')]['key']};});_0x30029d[_0xedcf('0x45')]=_['map'](_0xa258f6,'name');_0x30029d[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x35d369[_0xedcf('0x46')]);_0x30029d['filters']=_[_0xedcf('0x48')](_0x30029d[_0xedcf('0x45')],_0x30029d[_0xedcf('0x46')]);_0x459c6f[_0xedcf('0x49')]=_['intersection'](_0x30029d[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x459c6f[_0xedcf('0x49')]=_0x459c6f[_0xedcf('0x49')][_0xedcf('0x4b')]?_0x459c6f['attributes']:_0x30029d[_0xedcf('0x45')];if(!_0x35d369['query'][_0xedcf('0x4c')]('nolimit')){_0x459c6f[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x31')]);_0x459c6f[_0xedcf('0x33')]=qs[_0xedcf('0x33')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x33')]);}_0x459c6f[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x4e')]);_0x459c6f[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0x35d369['query'],_0x30029d[_0xedcf('0x50')]),_0xa258f6);if(_0x35d369[_0xedcf('0x46')][_0xedcf('0x52')]){_0x459c6f[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x459c6f['where'],{'$or':_[_0xedcf('0x40')](_0xa258f6,function(_0x2acced){if(_0x2acced[_0xedcf('0x44')]!==_0xedcf('0x54')){var _0x4ab48c={};_0x4ab48c[_0x2acced['name']]={'$like':'%'+_0x35d369['query'][_0xedcf('0x52')]+'%'};return _0x4ab48c;}})});}_0x459c6f=_[_0xedcf('0x53')]({},_0x459c6f,_0x35d369[_0xedcf('0x55')]);var _0x85cae1={'where':_0x459c6f[_0xedcf('0x4f')]};return db[_0xedcf('0x41')][_0xedcf('0x32')](_0x85cae1)['then'](function(_0xb4ed6d){_0x25dc1f[_0xedcf('0x32')]=_0xb4ed6d;if(_0x35d369['query'][_0xedcf('0x56')]){_0x459c6f['include']=[{'all':!![]}];}return db[_0xedcf('0x41')][_0xedcf('0x57')](_0x459c6f);})[_0xedcf('0x23')](function(_0x57188d){_0x25dc1f[_0xedcf('0x58')]=_0x57188d;return _0x25dc1f;})['then'](respondWithFilteredResult(_0x57d6c3,_0x459c6f))[_0xedcf('0x59')](handleError(_0x57d6c3,null));};exports[_0xedcf('0x5a')]=function(_0x587062,_0x183579){var _0x37865e={'raw':!![],'where':{'id':_0x587062['params']['id']}},_0x300cb2={};_0x300cb2[_0xedcf('0x45')]=_['keys'](db[_0xedcf('0x41')][_0xedcf('0x42')]);_0x300cb2[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x587062[_0xedcf('0x46')]);_0x300cb2[_0xedcf('0x50')]=_[_0xedcf('0x48')](_0x300cb2[_0xedcf('0x45')],_0x300cb2[_0xedcf('0x46')]);_0x37865e['attributes']=_[_0xedcf('0x48')](_0x300cb2[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x587062[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x37865e[_0xedcf('0x49')]=_0x37865e[_0xedcf('0x49')]['length']?_0x37865e[_0xedcf('0x49')]:_0x300cb2['model'];if(_0x587062['query'][_0xedcf('0x56')]){_0x37865e[_0xedcf('0x5b')]=[{'all':!![]}];}_0x37865e=_[_0xedcf('0x53')]({},_0x37865e,_0x587062['options']);return db[_0xedcf('0x41')][_0xedcf('0x5c')](_0x37865e)[_0xedcf('0x23')](handleEntityNotFound(_0x183579,null))[_0xedcf('0x23')](respondWithResult(_0x183579,null))[_0xedcf('0x59')](handleError(_0x183579,null));};exports[_0xedcf('0x5d')]=function(_0x1be3e4,_0x1060e2){return db[_0xedcf('0x41')][_0xedcf('0x5d')](_0x1be3e4[_0xedcf('0x5e')],{})[_0xedcf('0x23')](function(_0x592d33){var _0x354ca3=_0x1be3e4[_0xedcf('0x5f')][_0xedcf('0x60')]({'plain':!![]});if(!_0x354ca3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354ca3[_0xedcf('0x61')]==='user'){var _0x154688=_0x592d33[_0xedcf('0x60')]({'plain':!![]});var _0x1edc13='ChatQueues';return db['UserProfileSection'][_0xedcf('0x5c')]({'where':{'name':_0x1edc13,'userProfileId':_0x354ca3['userProfileId']},'raw':!![]})[_0xedcf('0x23')](function(_0x383cab){if(_0x383cab&&_0x383cab[_0xedcf('0x62')]===0x0){return db[_0xedcf('0x3b')][_0xedcf('0x5d')]({'name':_0x154688[_0xedcf('0x3e')],'resourceId':_0x154688['id'],'type':_0x383cab[_0xedcf('0x3e')],'sectionId':_0x383cab['id']},{})[_0xedcf('0x23')](function(){return _0x592d33;});}else{return _0x592d33;}})['catch'](function(_0x44b9b8){logger[_0xedcf('0x2a')](_0xedcf('0x63'),_0x44b9b8);throw _0x44b9b8;});}return _0x592d33;})[_0xedcf('0x23')](respondWithResult(_0x1060e2,0xc9))[_0xedcf('0x59')](handleError(_0x1060e2,null));};exports[_0xedcf('0x39')]=function(_0x5d441d,_0x1f7399){if(_0x5d441d[_0xedcf('0x5e')]['id']){delete _0x5d441d[_0xedcf('0x5e')]['id'];}return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x5d441d[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x1f7399,null))[_0xedcf('0x23')](saveUpdates(_0x5d441d['body'],null))[_0xedcf('0x23')](respondWithResult(_0x1f7399,null))['catch'](handleError(_0x1f7399,null));};exports['destroy']=function(_0x6d266f,_0x84d7e4){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x6d266f[_0xedcf('0x64')]['id']}})['then'](handleEntityNotFound(_0x84d7e4,null))[_0xedcf('0x23')](removeEntity(_0x84d7e4,null))[_0xedcf('0x59')](handleError(_0x84d7e4,null));};exports[_0xedcf('0x65')]=function(_0xbb34f1,_0x378a87){return db[_0xedcf('0x41')][_0xedcf('0x65')]()[_0xedcf('0x23')](respondWithResult(_0x378a87,null))[_0xedcf('0x59')](handleError(_0x378a87,null));};exports[_0xedcf('0x66')]=function(_0x4873ab,_0x5ed679,_0x571c3a){var _0x16a1d8={'raw':!![],'where':{}},_0x10a725={},_0xcc6973;return db[_0xedcf('0x41')][_0xedcf('0x67')]({'where':{'id':_0x4873ab[_0xedcf('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ed679,null))[_0xedcf('0x23')](function(_0x62d9c7){if(_0x62d9c7){_0xcc6973=_0x62d9c7[_0xedcf('0x60')]({'plain':!![]});_0x10a725[_0xedcf('0x45')]=_[_0xedcf('0x47')](db[_0xedcf('0x68')]['rawAttributes']);_0x10a725[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x4873ab[_0xedcf('0x46')]);_0x10a725['filters']=_[_0xedcf('0x48')](_0x10a725[_0xedcf('0x45')],_0x10a725['query']);_0x16a1d8[_0xedcf('0x49')]=_['intersection'](_0x10a725[_0xedcf('0x45')],qs['fields'](_0x4873ab['query'][_0xedcf('0x4a')]));_0x16a1d8['attributes']=_0x16a1d8[_0xedcf('0x49')][_0xedcf('0x4b')]?_0x16a1d8['attributes']:_0x10a725['model'];if(!_0x4873ab[_0xedcf('0x46')]['hasOwnProperty'](_0xedcf('0x69'))){_0x16a1d8[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0x4873ab[_0xedcf('0x46')][_0xedcf('0x31')]);_0x16a1d8[_0xedcf('0x33')]=qs[_0xedcf('0x33')](_0x4873ab[_0xedcf('0x46')][_0xedcf('0x33')]);}_0x16a1d8[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x4873ab['query'][_0xedcf('0x4e')]);_0x16a1d8[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0x4873ab[_0xedcf('0x46')],_0x10a725[_0xedcf('0x50')]));_0x16a1d8['where'][_0xedcf('0x6a')]=_0x62d9c7['id'];if(_0x4873ab[_0xedcf('0x46')]['filter']){_0x16a1d8[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x16a1d8['where'],{'$or':_[_0xedcf('0x40')](_0x16a1d8[_0xedcf('0x49')],function(_0x1699e8){var _0x335d38={};_0x335d38[_0x1699e8]={'$like':'%'+_0x4873ab[_0xedcf('0x46')][_0xedcf('0x52')]+'%'};return _0x335d38;})});}_0x16a1d8=_[_0xedcf('0x53')]({},_0x16a1d8,_0x4873ab[_0xedcf('0x55')]);return db['UserChatQueue'][_0xedcf('0x57')](_0x16a1d8);}})[_0xedcf('0x23')](function(_0x41e16c){if(_0x41e16c){return db[_0xedcf('0x6b')]['findAndCountAll']({'where':{'id':_[_0xedcf('0x40')](_0x41e16c,_0xedcf('0x6c')),'role':_0xedcf('0x6d')},'attributes':['id','name',_0xedcf('0x6e'),'updatedAt',_0xedcf('0x6f')]});}})[_0xedcf('0x23')](function(_0x16671c){if(_0x16671c){return{'count':_0x16671c[_0xedcf('0x32')],'rows':_[_0xedcf('0x40')](_0x16671c[_0xedcf('0x58')],function(_0x580d79){return{'membername':_0x580d79[_0xedcf('0x3e')],'UserId':_0x580d79['id'],'queue_name':_0xcc6973[_0xedcf('0x3e')],'ChatQueueId':_0xcc6973['id'],'interface':util[_0xedcf('0x70')](_0xedcf('0x71'),'SIP',_0x580d79[_0xedcf('0x3e')]),'penalty':0x0,'paused':_0x580d79['chatPause'],'createdAt':_0x580d79[_0xedcf('0x6f')],'updatedAt':_0x580d79['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xedcf('0x23')](respondWithFilteredResult(_0x5ed679,_0x16a1d8))[_0xedcf('0x59')](handleError(_0x5ed679,null));};exports[_0xedcf('0x72')]=function(_0x5a3cc9,_0x3fe188,_0x3d2fa1){var _0x3d34b2={};var _0x27a767={};var _0x249fcf;var _0x32bda6;return db[_0xedcf('0x41')]['findOne']({'where':{'id':_0x5a3cc9[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x3fe188,null))['then'](function(_0x3bd648){if(_0x3bd648){_0x249fcf=_0x3bd648;_0x27a767[_0xedcf('0x45')]=_[_0xedcf('0x47')](db[_0xedcf('0x73')][_0xedcf('0x42')]);_0x27a767[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x5a3cc9['query']);_0x27a767[_0xedcf('0x50')]=_[_0xedcf('0x48')](_0x27a767[_0xedcf('0x45')],_0x27a767[_0xedcf('0x46')]);_0x3d34b2[_0xedcf('0x49')]=_[_0xedcf('0x48')](_0x27a767[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x5a3cc9[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x3d34b2[_0xedcf('0x49')]=_0x3d34b2['attributes'][_0xedcf('0x4b')]?_0x3d34b2['attributes']:_0x27a767[_0xedcf('0x45')];_0x3d34b2[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x5a3cc9[_0xedcf('0x46')]['sort']);_0x3d34b2[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_['pick'](_0x5a3cc9[_0xedcf('0x46')],_0x27a767[_0xedcf('0x50')]));if(_0x5a3cc9['query'][_0xedcf('0x52')]){_0x3d34b2[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x3d34b2['where'],{'$or':_[_0xedcf('0x40')](_0x3d34b2[_0xedcf('0x49')],function(_0x4a3014){var _0x58ea81={};_0x58ea81[_0x4a3014]={'$like':'%'+_0x5a3cc9[_0xedcf('0x46')][_0xedcf('0x52')]+'%'};return _0x58ea81;})});}_0x3d34b2=_[_0xedcf('0x53')]({},_0x3d34b2,_0x5a3cc9[_0xedcf('0x55')]);return _0x249fcf[_0xedcf('0x72')](_0x3d34b2);}})[_0xedcf('0x23')](function(_0x5b4c00){if(_0x5b4c00){_0x32bda6=_0x5b4c00[_0xedcf('0x4b')];if(!_0x5a3cc9[_0xedcf('0x46')]['hasOwnProperty'](_0xedcf('0x69'))){_0x3d34b2[_0xedcf('0x31')]=qs['limit'](_0x5a3cc9['query'][_0xedcf('0x31')]);_0x3d34b2[_0xedcf('0x33')]=qs['offset'](_0x5a3cc9[_0xedcf('0x46')]['offset']);}return _0x249fcf[_0xedcf('0x72')](_0x3d34b2);}})[_0xedcf('0x23')](function(_0x2574c8){if(_0x2574c8){return _0x2574c8?{'count':_0x32bda6,'rows':_0x2574c8}:null;}})[_0xedcf('0x23')](respondWithResult(_0x3fe188,null))[_0xedcf('0x59')](handleError(_0x3fe188,null));};exports['addTeams']=function(_0x5d2b1c,_0x398b64,_0x3b4fb6){var _0x1751c3=_0x5d2b1c[_0xedcf('0x5e')][_0xedcf('0x74')];return db['Team'][_0xedcf('0x57')]({'where':{'id':_0x1751c3},'attributes':['id'],'include':[{'model':db[_0xedcf('0x6b')],'as':_0xedcf('0x75'),'attributes':['id','name','online',_0xedcf('0x76'),_0xedcf('0x77')],'raw':!![]}]})[_0xedcf('0x23')](function(_0x47bfe1){if(_0x47bfe1){var _0x22a436=_['flatMap'](_0x47bfe1,function(_0x3e3015){var _0x269469=_0x3e3015[_0xedcf('0x60')]({'plain':!![]});return _0x269469[_0xedcf('0x75')];});return db['ChatQueue'][_0xedcf('0x5c')]({'where':{'id':_0x5d2b1c[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](function(_0x3a3dc6){return db[_0xedcf('0x78')][_0xedcf('0x79')](function(_0x114df4){return _0x3a3dc6[_0xedcf('0x7a')](_0x1751c3,{'transaction':_0x114df4})['then'](function(){return BPromise['each'](_0x22a436,function(_0x157e38){return db['UserChatQueue'][_0xedcf('0x7b')]({'where':{'UserId':_0x157e38['id'],'ChatQueueId':_0x5d2b1c[_0xedcf('0x64')]['id']},'transaction':_0x114df4});});})[_0xedcf('0x23')](function(){_0x22a436[_0xedcf('0x7c')](function(_0x166c9a){socket[_0xedcf('0x7d')](_0xedcf('0x7e'),{'UserId':_0x166c9a['id'],'ChatQueueId':_0x3a3dc6['id']});});});});});}})[_0xedcf('0x23')](respondWithStatusCode(_0x398b64,null))['catch'](handleError(_0x398b64,null));};exports['removeTeams']=function(_0x30aa28,_0x20cb3b,_0x2ff87c){return db[_0xedcf('0x73')][_0xedcf('0x57')]({'where':{'id':_0x30aa28[_0xedcf('0x46')][_0xedcf('0x74')]},'attributes':['id'],'include':[{'model':db[_0xedcf('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xedcf('0x23')](handleEntityNotFound(_0x20cb3b,null))[_0xedcf('0x23')](function(_0x1a560a){var _0x130f7e=_[_0xedcf('0x40')](_0x1a560a,'id');var _0x25c462=[];var _0x366127=[];var _0x3d874f=squel[_0xedcf('0x7f')]();_0x3d874f[_0xedcf('0x80')](_0xedcf('0x81'))[_0xedcf('0x82')]('team_has_chat_queues','tq')[_0xedcf('0x83')](_0xedcf('0x84'),'ut',_0xedcf('0x85'))[_0xedcf('0x4f')]('ChatQueueId\x20=\x20?',_0x30aa28[_0xedcf('0x64')]['id']);for(var _0x2a5b54=0x0;_0x2a5b54<_0x1a560a[_0xedcf('0x4b')];_0x2a5b54+=0x1){let _0x501933=_0x1a560a[_0x2a5b54];for(var _0x2ab8fc=0x0;_0x2ab8fc<_0x501933[_0xedcf('0x75')][_0xedcf('0x4b')];_0x2ab8fc+=0x1){let _0x46b36d=_0x501933[_0xedcf('0x75')][_0x2ab8fc];var _0x174aae=_0x3d874f['clone']();_0x174aae[_0xedcf('0x4f')](_0xedcf('0x86'),_0x46b36d['id']);_0x366127['push'](db[_0xedcf('0x78')][_0xedcf('0x46')](_0x174aae[_0xedcf('0x87')](),{'type':db[_0xedcf('0x78')][_0xedcf('0x88')][_0xedcf('0x89')]})['then'](function(_0x1b0484){if(_0x1b0484[_0xedcf('0x4b')]===0x1){return _0x46b36d['id'];}else{var _0x3787e9=_['every'](_['map'](_0x1b0484,_0xedcf('0x8a')),function(_0x3253ae){return _['includes'](_0x130f7e,_0x3253ae);});if(_0x3787e9){return _0x46b36d['id'];}}}));}}return BPromise[_0xedcf('0x8b')](_0x366127)[_0xedcf('0x23')](function(_0x193259){_0x25c462=_(_0x25c462)['union'](_0x193259)[_0xedcf('0x8c')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x30aa28['params']['id']}})[_0xedcf('0x23')](function(_0x18be03){return db['sequelize']['transaction'](function(_0x341b48){return _0x18be03[_0xedcf('0x8d')](_0x30aa28[_0xedcf('0x46')][_0xedcf('0x74')],{'transaction':_0x341b48})[_0xedcf('0x23')](function(){if(!_['isEmpty'](_0x25c462)){return _0x18be03[_0xedcf('0x8e')](_0x25c462,{'transaction':_0x341b48});}})[_0xedcf('0x23')](function(){_0x25c462[_0xedcf('0x7c')](function(_0x408f07){socket[_0xedcf('0x7d')](_0xedcf('0x8f'),{'UserId':_0x408f07,'ChatQueueId':_0x18be03['id']});});});});});});})['then'](respondWithStatusCode(_0x20cb3b,null))[_0xedcf('0x59')](handleError(_0x20cb3b,null));};exports['addAgents']=function(_0xda2483,_0x4d5bc9,_0x122431){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0xda2483['params']['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x4d5bc9,null))['then'](function(_0x40b17b){if(_0x40b17b){return _0x40b17b[_0xedcf('0x90')](_0xda2483[_0xedcf('0x5e')]['ids'],_[_0xedcf('0x91')](_0xda2483[_0xedcf('0x5e')],['ids','id'])||{})['spread'](function(_0x4c042e){for(var _0x14b1e5=0x0;_0x14b1e5<_0xda2483[_0xedcf('0x5e')][_0xedcf('0x74')][_0xedcf('0x4b')];_0x14b1e5+=0x1){socket['emit'](_0xedcf('0x7e'),{'UserId':Number(_0xda2483[_0xedcf('0x5e')][_0xedcf('0x74')][_0x14b1e5]),'ChatQueueId':Number(_0xda2483[_0xedcf('0x64')]['id'])});}return _0x4c042e;});}})[_0xedcf('0x23')](respondWithResult(_0x4d5bc9,null))[_0xedcf('0x59')](handleError(_0x4d5bc9,null));};exports[_0xedcf('0x8e')]=function(_0x27431a,_0x34fb05,_0x3a93ad){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x27431a[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x34fb05,null))[_0xedcf('0x23')](function(_0x8e3e3e){if(_0x8e3e3e){return _0x8e3e3e[_0xedcf('0x8e')](_0x27431a[_0xedcf('0x46')][_0xedcf('0x74')])[_0xedcf('0x23')](function(){if(_[_0xedcf('0x92')](_0x27431a[_0xedcf('0x46')]['ids'])){for(var _0x80ec6a=0x0;_0x80ec6a<_0x27431a[_0xedcf('0x46')]['ids'][_0xedcf('0x4b')];_0x80ec6a+=0x1){socket[_0xedcf('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x27431a[_0xedcf('0x46')][_0xedcf('0x74')][_0x80ec6a]),'ChatQueueId':Number(_0x27431a['params']['id'])});}}else{socket['emit'](_0xedcf('0x8f'),{'UserId':Number(_0x27431a['query'][_0xedcf('0x74')]),'ChatQueueId':Number(_0x27431a['params']['id'])});}});}})[_0xedcf('0x23')](respondWithStatusCode(_0x34fb05,null))[_0xedcf('0x59')](handleError(_0x34fb05,null));};exports[_0xedcf('0x93')]=function(_0xe08849,_0x5840b6,_0xa91c){var _0xee2507={};var _0x6a8f5a={};var _0x5f1614;var _0xd341f8;return db[_0xedcf('0x41')][_0xedcf('0x67')]({'where':{'id':_0xe08849[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x5840b6,null))[_0xedcf('0x23')](function(_0x259f7b){if(_0x259f7b){_0x5f1614=_0x259f7b;_0x6a8f5a[_0xedcf('0x45')]=_['keys'](db[_0xedcf('0x6b')][_0xedcf('0x42')]);_0x6a8f5a[_0xedcf('0x46')]=_['keys'](_0xe08849[_0xedcf('0x46')]);_0x6a8f5a['filters']=_[_0xedcf('0x48')](_0x6a8f5a[_0xedcf('0x45')],_0x6a8f5a[_0xedcf('0x46')]);_0xee2507[_0xedcf('0x49')]=_['intersection'](_0x6a8f5a['model'],qs[_0xedcf('0x4a')](_0xe08849[_0xedcf('0x46')][_0xedcf('0x4a')]));_0xee2507[_0xedcf('0x49')]=_0xee2507[_0xedcf('0x49')][_0xedcf('0x4b')]?_0xee2507[_0xedcf('0x49')]:_0x6a8f5a[_0xedcf('0x45')];_0xee2507[_0xedcf('0x4d')]=qs['sort'](_0xe08849[_0xedcf('0x46')][_0xedcf('0x4e')]);_0xee2507[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0xe08849[_0xedcf('0x46')],_0x6a8f5a[_0xedcf('0x50')]));if(_0xe08849['query'][_0xedcf('0x52')]){_0xee2507['where']=_[_0xedcf('0x53')](_0xee2507[_0xedcf('0x4f')],{'$or':_['map'](_0xee2507['attributes'],function(_0x229186){var _0xb7e230={};_0xb7e230[_0x229186]={'$like':'%'+_0xe08849[_0xedcf('0x46')]['filter']+'%'};return _0xb7e230;})});}_0xee2507=_[_0xedcf('0x53')]({},_0xee2507,_0xe08849[_0xedcf('0x55')]);return _0x5f1614[_0xedcf('0x93')](_0xee2507);}})[_0xedcf('0x23')](function(_0x35e0f5){if(_0x35e0f5){_0xd341f8=_0x35e0f5[_0xedcf('0x4b')];if(!_0xe08849[_0xedcf('0x46')][_0xedcf('0x4c')](_0xedcf('0x69'))){_0xee2507[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0xe08849['query'][_0xedcf('0x31')]);_0xee2507['offset']=qs[_0xedcf('0x33')](_0xe08849[_0xedcf('0x46')]['offset']);}return _0x5f1614[_0xedcf('0x93')](_0xee2507);}})[_0xedcf('0x23')](function(_0x2e0b4a){if(_0x2e0b4a){return _0x2e0b4a?{'count':_0xd341f8,'rows':_0x2e0b4a}:null;}})[_0xedcf('0x23')](respondWithResult(_0x5840b6,null))[_0xedcf('0x59')](handleError(_0x5840b6,null));};
\ No newline at end of file
index 9c8c75a..ad05946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfd2=['hook','events','ChatQueue','setMaxListeners','hasOwnProperty'];(function(_0xcfed91,_0x29b51b){var _0x42e245=function(_0x1a131c){while(--_0x1a131c){_0xcfed91['push'](_0xcfed91['shift']());}};_0x42e245(++_0x29b51b);}(_0xbfd2,0x123));var _0x2bfd=function(_0x689c44,_0x4ddbfb){_0x689c44=_0x689c44-0x0;var _0x351f6a=_0xbfd2[_0x689c44];return _0x351f6a;};'use strict';var EventEmitter=require(_0x2bfd('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x2bfd('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2bfd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x43dd0f){return function(_0x524a99,_0x1e40a2,_0x2f81d1){ChatQueueEvents['emit'](_0x43dd0f+':'+_0x524a99['id'],_0x524a99);ChatQueueEvents['emit'](_0x43dd0f,_0x524a99);_0x2f81d1(null);};}for(var e in events){if(events[_0x2bfd('0x3')](e)){var event=events[e];ChatQueue[_0x2bfd('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xd2ce=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4bb26d,_0x1085b0){var _0x42b6d0=function(_0xffa2a2){while(--_0xffa2a2){_0x4bb26d['push'](_0x4bb26d['shift']());}};_0x42b6d0(++_0x1085b0);}(_0xd2ce,0x13c));var _0xed2c=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xd2ce[_0x4dbaad];return _0x226c72;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xed2c('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xed2c('0x1')](0x0);var events={'afterCreate':_0xed2c('0x2'),'afterUpdate':_0xed2c('0x3'),'afterDestroy':_0xed2c('0x4')};function emitEvent(_0x167209){return function(_0x2fe29b,_0x418d1c,_0x5bc2bf){ChatQueueEvents[_0xed2c('0x5')](_0x167209+':'+_0x2fe29b['id'],_0x2fe29b);ChatQueueEvents['emit'](_0x167209,_0x2fe29b);_0x5bc2bf(null);};}for(var e in events){if(events[_0xed2c('0x6')](e)){var event=events[e];ChatQueue[_0xed2c('0x7')](e,emitEvent(event));}}module[_0xed2c('0x8')]=ChatQueueEvents;
\ No newline at end of file
index d159a64..240e6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba4=['define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xcba4,0x117));var _0x4cba=function(_0x9a65e4,_0x3589df){_0x9a65e4=_0x9a65e4-0x0;var _0x2aeb25=_0xcba4[_0x9a65e4];return _0x2aeb25;};'use strict';var _=require(_0x4cba('0x0'));var util=require('util');var logger=require(_0x4cba('0x1'))(_0x4cba('0x2'));var moment=require(_0x4cba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cba('0x4'));var rimraf=require(_0x4cba('0x5'));var config=require(_0x4cba('0x6'));var attributes=require(_0x4cba('0x7'));module[_0x4cba('0x8')]=function(_0x2a9a56,_0xe5fd6c){return _0x2a9a56[_0x4cba('0x9')](_0x4cba('0xa'),attributes,{'tableName':_0x4cba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32ee=['exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4a962f,_0x5e36ea){var _0xf66bad=function(_0x4707b7){while(--_0x4707b7){_0x4a962f['push'](_0x4a962f['shift']());}};_0xf66bad(++_0x5e36ea);}(_0x32ee,0x9e));var _0xe32e=function(_0x53c8af,_0xdb5075){_0x53c8af=_0x53c8af-0x0;var _0x229f1d=_0x32ee[_0x53c8af];return _0x229f1d;};'use strict';var _=require(_0xe32e('0x0'));var util=require('util');var logger=require(_0xe32e('0x1'))(_0xe32e('0x2'));var moment=require(_0xe32e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe32e('0x4'));var rimraf=require(_0xe32e('0x5'));var config=require(_0xe32e('0x6'));var attributes=require('./chatQueue.attributes');module[_0xe32e('0x7')]=function(_0x137097,_0x44d4d4){return _0x137097[_0xe32e('0x8')](_0xe32e('0x9'),attributes,{'tableName':_0xe32e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cd2ee31..718538a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbaf=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','model','include','debug','find','map','ShowChatQueue'];(function(_0x229b42,_0x323c51){var _0x51883c=function(_0x342b81){while(--_0x342b81){_0x229b42['push'](_0x229b42['shift']());}};_0x51883c(++_0x323c51);}(_0xbbaf,0x158));var _0xfbba=function(_0x51ec44,_0x5d81ff){_0x51ec44=_0x51ec44-0x0;var _0x3111dd=_0xbbaf[_0x51ec44];return _0x3111dd;};'use strict';var _=require(_0xfbba('0x0'));var util=require(_0xfbba('0x1'));var moment=require(_0xfbba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbba('0x3'));var db=require(_0xfbba('0x4'))['db'];var utils=require(_0xfbba('0x5'));var logger=require(_0xfbba('0x6'))(_0xfbba('0x7'));var config=require(_0xfbba('0x8'));var jayson=require(_0xfbba('0x9'));var client=jayson[_0xfbba('0xa')][_0xfbba('0xb')]({'port':0x232a});config[_0xfbba('0xc')]=_[_0xfbba('0xd')](config[_0xfbba('0xc')],{'host':_0xfbba('0xe'),'port':0x18eb});var socket=require(_0xfbba('0xf'))(new Redis(config[_0xfbba('0xc')]));require(_0xfbba('0x10'))[_0xfbba('0x11')](socket);function respondWithRpcPromise(_0x294ecc,_0x320523,_0x1e7080){return new BPromise(function(_0x2d416b,_0x509a14){return client['request'](_0x294ecc,_0x1e7080)[_0xfbba('0x12')](function(_0x27df1c){logger['info'](_0xfbba('0x13'),_0x320523,_0xfbba('0x14'));logger['debug'](_0xfbba('0x15'),_0x320523,'request\x20sent',JSON[_0xfbba('0x16')](_0x27df1c));if(_0x27df1c[_0xfbba('0x17')]){if(_0x27df1c[_0xfbba('0x17')][_0xfbba('0x18')]===0x1f4){logger['error'](_0xfbba('0x13'),_0x320523,_0x27df1c[_0xfbba('0x17')]['message']);return _0x509a14(_0x27df1c[_0xfbba('0x17')][_0xfbba('0x19')]);}logger[_0xfbba('0x17')](_0xfbba('0x13'),_0x320523,_0x27df1c[_0xfbba('0x17')][_0xfbba('0x19')]);return _0x2d416b(_0x27df1c['error'][_0xfbba('0x19')]);}else{logger[_0xfbba('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x320523,_0xfbba('0x14'));_0x2d416b(_0x27df1c[_0xfbba('0x1b')][_0xfbba('0x19')]);}})[_0xfbba('0x1c')](function(_0x1e8464){logger['error']('ChatQueue,\x20%s,\x20%s',_0x320523,_0x1e8464);_0x509a14(_0x1e8464);});});}exports[_0xfbba('0x1d')]=function(_0x3e6e29){var _0x19419e=this;return new Promise(function(_0x5a3cdf,_0x1af2a6){return db[_0xfbba('0x1e')][_0xfbba('0x1f')]({'raw':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x21')]===undefined?!![]:![]:!![],'where':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29['options'][_0xfbba('0x22')]||null:null,'attributes':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x23')]||null:null,'limit':_0x3e6e29['options']?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x24')]||null:null,'include':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29['options']['include']?_['map'](_0x3e6e29[_0xfbba('0x20')]['include'],function(_0x2f9829){return{'model':db[_0x2f9829[_0xfbba('0x25')]],'as':_0x2f9829['as'],'attributes':_0x2f9829[_0xfbba('0x23')],'include':_0x2f9829[_0xfbba('0x26')]?_['map'](_0x2f9829[_0xfbba('0x26')],function(_0x2fd203){return{'model':db[_0x2fd203[_0xfbba('0x25')]],'as':_0x2fd203['as'],'attributes':_0x2fd203[_0xfbba('0x23')],'include':_0x2fd203[_0xfbba('0x26')]?_['map'](_0x2fd203[_0xfbba('0x26')],function(_0x3a5af2){return{'model':db[_0x3a5af2['model']],'as':_0x3a5af2['as'],'attributes':_0x3a5af2[_0xfbba('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bf76){logger[_0xfbba('0x1a')]('GetChatQueue',_0x3e6e29);logger[_0xfbba('0x27')]('GetChatQueue',_0x3e6e29,JSON[_0xfbba('0x16')](_0x18bf76));_0x5a3cdf(_0x18bf76);})[_0xfbba('0x1c')](function(_0xa0a64){logger[_0xfbba('0x17')](_0xfbba('0x1d'),_0xa0a64[_0xfbba('0x19')],_0x3e6e29);_0x1af2a6(_0x19419e[_0xfbba('0x17')](0x1f4,_0xa0a64[_0xfbba('0x19')]));});});};exports['ShowChatQueue']=function(_0x296f6b){var _0x158edc=this;return new Promise(function(_0x3fb7a2,_0x219824){return db[_0xfbba('0x1e')][_0xfbba('0x28')]({'raw':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x21')]===undefined?!![]:![]:!![],'where':_0x296f6b['options']?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x22')]||null:null,'attributes':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')]['attributes']||null:null,'include':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x26')]?_['map'](_0x296f6b['options'][_0xfbba('0x26')],function(_0x2f8ef4){return{'model':db[_0x2f8ef4[_0xfbba('0x25')]],'as':_0x2f8ef4['as'],'attributes':_0x2f8ef4[_0xfbba('0x23')],'include':_0x2f8ef4['include']?_[_0xfbba('0x29')](_0x2f8ef4[_0xfbba('0x26')],function(_0x1a2f09){return{'model':db[_0x1a2f09['model']],'as':_0x1a2f09['as'],'attributes':_0x1a2f09[_0xfbba('0x23')],'include':_0x1a2f09['include']?_['map'](_0x1a2f09[_0xfbba('0x26')],function(_0xc408e4){return{'model':db[_0xc408e4[_0xfbba('0x25')]],'as':_0xc408e4['as'],'attributes':_0xc408e4[_0xfbba('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfbba('0x12')](function(_0x5da984){logger[_0xfbba('0x1a')](_0xfbba('0x2a'),_0x296f6b);logger['debug']('ShowChatQueue',_0x296f6b,JSON[_0xfbba('0x16')](_0x5da984));_0x3fb7a2(_0x5da984);})[_0xfbba('0x1c')](function(_0x33ef07){logger[_0xfbba('0x17')]('ShowChatQueue',_0x33ef07[_0xfbba('0x19')],_0x296f6b);_0x219824(_0x158edc['error'](0x1f4,_0x33ef07[_0xfbba('0x19')]));});});};
\ No newline at end of file
+var _0xf4c9=['../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','ChatQueue,\x20%s,\x20%s','request\x20sent','result','options','limit','include','map','model','attributes','GetChatQueue','debug','stringify','ShowChatQueue','ChatQueue','where','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xb6c185,_0x1fba89){var _0x18717b=function(_0x1ac33d){while(--_0x1ac33d){_0xb6c185['push'](_0xb6c185['shift']());}};_0x18717b(++_0x1fba89);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf4c9[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var moment=require(_0x9f4c('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f4c('0x4'))['db'];var utils=require(_0x9f4c('0x5'));var logger=require(_0x9f4c('0x6'))('rpc');var config=require(_0x9f4c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f4c('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9f4c('0x9')],{'host':_0x9f4c('0xa'),'port':0x18eb});var socket=require(_0x9f4c('0xb'))(new Redis(config[_0x9f4c('0x9')]));require(_0x9f4c('0xc'))[_0x9f4c('0xd')](socket);function respondWithRpcPromise(_0x553357,_0x3cc67a,_0x57ff14){return new BPromise(function(_0x20c329,_0x700e2d){return client[_0x9f4c('0xe')](_0x553357,_0x57ff14)[_0x9f4c('0xf')](function(_0x20ab7c){logger[_0x9f4c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,'request\x20sent');logger['debug'](_0x9f4c('0x11'),_0x3cc67a,'request\x20sent',JSON['stringify'](_0x20ab7c));if(_0x20ab7c[_0x9f4c('0x12')]){if(_0x20ab7c['error']['code']===0x1f4){logger[_0x9f4c('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,_0x20ab7c['error'][_0x9f4c('0x13')]);return _0x700e2d(_0x20ab7c['error'][_0x9f4c('0x13')]);}logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x20ab7c[_0x9f4c('0x12')][_0x9f4c('0x13')]);return _0x20c329(_0x20ab7c[_0x9f4c('0x12')]['message']);}else{logger[_0x9f4c('0x10')](_0x9f4c('0x14'),_0x3cc67a,_0x9f4c('0x15'));_0x20c329(_0x20ab7c[_0x9f4c('0x16')][_0x9f4c('0x13')]);}})['catch'](function(_0x272778){logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x272778);_0x700e2d(_0x272778);});});}exports['GetChatQueue']=function(_0x4a33c7){var _0x502a33=this;return new Promise(function(_0x53d301,_0x2040a5){return db['ChatQueue']['findAll']({'raw':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['where']||null:null,'attributes':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options']['attributes']||null:null,'limit':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options'][_0x9f4c('0x18')]||null:null,'include':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x4a33c7[_0x9f4c('0x17')]['include'],function(_0x25b775){return{'model':db[_0x25b775[_0x9f4c('0x1b')]],'as':_0x25b775['as'],'attributes':_0x25b775[_0x9f4c('0x1c')],'include':_0x25b775[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x25b775[_0x9f4c('0x19')],function(_0x945f00){return{'model':db[_0x945f00[_0x9f4c('0x1b')]],'as':_0x945f00['as'],'attributes':_0x945f00[_0x9f4c('0x1c')],'include':_0x945f00[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x945f00[_0x9f4c('0x19')],function(_0x168ed8){return{'model':db[_0x168ed8[_0x9f4c('0x1b')]],'as':_0x168ed8['as'],'attributes':_0x168ed8[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x31d486){logger[_0x9f4c('0x10')](_0x9f4c('0x1d'),_0x4a33c7);logger[_0x9f4c('0x1e')](_0x9f4c('0x1d'),_0x4a33c7,JSON[_0x9f4c('0x1f')](_0x31d486));_0x53d301(_0x31d486);})['catch'](function(_0x4b6d91){logger['error'](_0x9f4c('0x1d'),_0x4b6d91[_0x9f4c('0x13')],_0x4a33c7);_0x2040a5(_0x502a33['error'](0x1f4,_0x4b6d91[_0x9f4c('0x13')]));});});};exports[_0x9f4c('0x20')]=function(_0x2ca433){var _0x4f5c2f=this;return new Promise(function(_0x5b1ddb,_0xa7ebad){return db[_0x9f4c('0x21')]['find']({'raw':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x22')]||null:null,'attributes':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x1c')]||null:null,'include':_0x2ca433['options']?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')],function(_0xe700df){return{'model':db[_0xe700df[_0x9f4c('0x1b')]],'as':_0xe700df['as'],'attributes':_0xe700df[_0x9f4c('0x1c')],'include':_0xe700df[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0xe700df[_0x9f4c('0x19')],function(_0x352b2b){return{'model':db[_0x352b2b[_0x9f4c('0x1b')]],'as':_0x352b2b['as'],'attributes':_0x352b2b['attributes'],'include':_0x352b2b[_0x9f4c('0x19')]?_['map'](_0x352b2b[_0x9f4c('0x19')],function(_0x1e22ed){return{'model':db[_0x1e22ed[_0x9f4c('0x1b')]],'as':_0x1e22ed['as'],'attributes':_0x1e22ed[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x649bc){logger[_0x9f4c('0x10')](_0x9f4c('0x20'),_0x2ca433);logger[_0x9f4c('0x1e')](_0x9f4c('0x20'),_0x2ca433,JSON[_0x9f4c('0x1f')](_0x649bc));_0x5b1ddb(_0x649bc);})[_0x9f4c('0x23')](function(_0x5653ff){logger[_0x9f4c('0x12')](_0x9f4c('0x20'),_0x5653ff[_0x9f4c('0x13')],_0x2ca433);_0xa7ebad(_0x4f5c2f['error'](0x1f4,_0x5653ff[_0x9f4c('0x13')]));});});};
\ No newline at end of file
index bc3e60a..1f1e144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca66=['update','emit','register','length','./chatQueue.events'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xca66,0x8b));var _0x6ca6=function(_0x56bcca,_0x3b684f){_0x56bcca=_0x56bcca-0x0;var _0x4181a4=_0xca66[_0x56bcca];return _0x4181a4;};'use strict';var ChatQueueEvents=require(_0x6ca6('0x0'));var events=['save','remove',_0x6ca6('0x1')];function createListener(_0x1a863a,_0x44d1de){return function(_0x571335){_0x44d1de[_0x6ca6('0x2')](_0x1a863a,_0x571335);};}function removeListener(_0x4b1a10,_0x3ab489){return function(){ChatQueueEvents['removeListener'](_0x4b1a10,_0x3ab489);};}exports[_0x6ca6('0x3')]=function(_0x27d8c6){for(var _0x34836f=0x0,_0x44019c=events[_0x6ca6('0x4')];_0x34836f<_0x44019c;_0x34836f++){var _0x27a210=events[_0x34836f];var _0x27d280=createListener('chatQueue:'+_0x27a210,_0x27d8c6);ChatQueueEvents['on'](_0x27a210,_0x27d280);}};
\ No newline at end of file
+var _0xaba6=['emit','removeListener','./chatQueue.events','save'];(function(_0x354ab5,_0x4dcfef){var _0xf3d138=function(_0x5abfe9){while(--_0x5abfe9){_0x354ab5['push'](_0x354ab5['shift']());}};_0xf3d138(++_0x4dcfef);}(_0xaba6,0xe2));var _0x6aba=function(_0x4dca4f,_0x3d3989){_0x4dca4f=_0x4dca4f-0x0;var _0xb1f24e=_0xaba6[_0x4dca4f];return _0xb1f24e;};'use strict';var ChatQueueEvents=require(_0x6aba('0x0'));var events=[_0x6aba('0x1'),'remove','update'];function createListener(_0x5140ee,_0x596c18){return function(_0x42fd1f){_0x596c18[_0x6aba('0x2')](_0x5140ee,_0x42fd1f);};}function removeListener(_0x58d8a8,_0x1e32a1){return function(){ChatQueueEvents[_0x6aba('0x3')](_0x58d8a8,_0x1e32a1);};}exports['register']=function(_0x4e929a){for(var _0x5ae14c=0x0,_0x39c32a=events['length'];_0x5ae14c<_0x39c32a;_0x5ae14c++){var _0x3766d4=events[_0x5ae14c];var _0x1a4fbc=createListener('chatQueue:'+_0x3766d4,_0x4e929a);ChatQueueEvents['on'](_0x3766d4,_0x1a4fbc);}};
\ No newline at end of file
index 1561b46..db20f01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x404c3e,_0x5d6050){var _0x2595ae=function(_0x3872c3){while(--_0x3872c3){_0x404c3e['push'](_0x404c3e['shift']());}};_0x2595ae(++_0x5d6050);}(_0x7217,0x19e));var _0x7721=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7217[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f2114,_0x1416d4){var _0x87caf5=function(_0x5e68ac){while(--_0x5e68ac){_0x4f2114['push'](_0x4f2114['shift']());}};_0x87caf5(++_0x1416d4);}(_0x55ca,0x126));var _0xa55c=function(_0x312931,_0x22e92b){_0x312931=_0x312931-0x0;var _0xdf26e5=_0x55ca[_0x312931];return _0xdf26e5;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
index e8657e1..68d8318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9576=['DATE','moment','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9576,0x182));var _0x6957=function(_0x4a6eec,_0x7607eb){_0x4a6eec=_0x4a6eec-0x0;var _0x2faff2=_0x9576[_0x4a6eec];return _0x2faff2;};'use strict';var moment=require(_0x6957('0x0'));var Sequelize=require(_0x6957('0x1'));module[_0x6957('0x2')]={'uniqueid':{'type':Sequelize[_0x6957('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6957('0x4')]},'acceptAt':{'type':Sequelize[_0x6957('0x4')]},'exitAt':{'type':Sequelize[_0x6957('0x4')]},'reason':{'type':Sequelize[_0x6957('0x3')]}};
\ No newline at end of file
+var _0x6912=['exports','STRING','DATE','moment'];(function(_0x1736e9,_0x5bdc96){var _0x4fdf3=function(_0x3af4cd){while(--_0x3af4cd){_0x1736e9['push'](_0x1736e9['shift']());}};_0x4fdf3(++_0x5bdc96);}(_0x6912,0x143));var _0x2691=function(_0x67b72e,_0x105a68){_0x67b72e=_0x67b72e-0x0;var _0x4d86d2=_0x6912[_0x67b72e];return _0x4d86d2;};'use strict';var moment=require(_0x2691('0x0'));var Sequelize=require('sequelize');module[_0x2691('0x1')]={'uniqueid':{'type':Sequelize[_0x2691('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2691('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2691('0x3')]},'acceptAt':{'type':Sequelize[_0x2691('0x3')]},'exitAt':{'type':Sequelize[_0x2691('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9f56bcc..3ee8ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','ChatQueueReport','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','create','update','find','catch','destroy','describe','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0x5d58,0x187));var _0x85d5=function(_0x47dab6,_0x24836c){_0x47dab6=_0x47dab6-0x0;var _0xeeb402=_0x5d58[_0x47dab6];return _0xeeb402;};'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(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['ChatQueueReport']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['ChatQueueReport'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')](_0x13ab32['body'],{})[_0x85d5('0x1c')](respondWithResult(_0x12a03,0xc9))['catch'](handleError(_0x12a03,null));};exports[_0x85d5('0x40')]=function(_0xd8db57,_0x219154){if(_0xd8db57['body']['id']){delete _0xd8db57['body']['id'];}return db['ChatQueueReport'][_0x85d5('0x41')]({'where':{'id':_0xd8db57[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x219154,null))['then'](saveUpdates(_0xd8db57['body'],null))[_0x85d5('0x1c')](respondWithResult(_0x219154,null))[_0x85d5('0x42')](handleError(_0x219154,null));};exports[_0x85d5('0x43')]=function(_0x288b56,_0x4b2dce){return db[_0x85d5('0x34')][_0x85d5('0x41')]({'where':{'id':_0x288b56[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x4b2dce,null))[_0x85d5('0x1c')](removeEntity(_0x4b2dce,null))[_0x85d5('0x42')](handleError(_0x4b2dce,null));};exports[_0x85d5('0x44')]=function(_0x34b784,_0x185a70){return db[_0x85d5('0x34')][_0x85d5('0x44')]()[_0x85d5('0x1c')](respondWithResult(_0x185a70,null))[_0x85d5('0x42')](handleError(_0x185a70,null));};
\ No newline at end of file
+var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','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','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x4eedc6,_0x27632a){var _0x1f0ea0=function(_0x545585){while(--_0x545585){_0x4eedc6['push'](_0x4eedc6['shift']());}};_0x1f0ea0(++_0x27632a);}(_0x6050,0x196));var _0x0605=function(_0x3e803e,_0x23a962){_0x3e803e=_0x3e803e-0x0;var _0x3a560a=_0x6050[_0x3e803e];return _0x3a560a;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['ChatQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['ChatQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));};
\ No newline at end of file
index b23fd51..008e289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xccc8e1,_0x4a5076){var _0x30978c=function(_0x17e6f0){while(--_0x17e6f0){_0xccc8e1['push'](_0xccc8e1['shift']());}};_0x30978c(++_0x4a5076);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b21eb,_0x540b6d){_0x5b21eb=_0x5b21eb-0x0;var _0x279c63=_0xb10b[_0x5b21eb];return _0x279c63;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 561b58d..71fb547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0066=['then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xfa191e,_0x2b597f){var _0xcfb50d=function(_0x851fb9){while(--_0x851fb9){_0xfa191e['push'](_0xfa191e['shift']());}};_0xcfb50d(++_0x2b597f);}(_0x0066,0x111));var _0x6006=function(_0x4b004b,_0x15b81d){_0x4b004b=_0x4b004b-0x0;var _0x469af9=_0x0066[_0x4b004b];return _0x469af9;};'use strict';var _=require(_0x6006('0x0'));var util=require(_0x6006('0x1'));var moment=require(_0x6006('0x2'));var BPromise=require(_0x6006('0x3'));var rs=require(_0x6006('0x4'));var fs=require('fs');var Redis=require(_0x6006('0x5'));var db=require(_0x6006('0x6'))['db'];var utils=require(_0x6006('0x7'));var logger=require(_0x6006('0x8'))(_0x6006('0x9'));var config=require(_0x6006('0xa'));var jayson=require(_0x6006('0xb'));var client=jayson[_0x6006('0xc')][_0x6006('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3aee4f,_0x568810,_0x4af6e8){return new BPromise(function(_0xdf0291,_0x5afcb3){return client[_0x6006('0xe')](_0x3aee4f,_0x4af6e8)[_0x6006('0xf')](function(_0x2e6093){logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,'request\x20sent');logger[_0x6006('0x12')](_0x6006('0x13'),_0x568810,'request\x20sent',JSON[_0x6006('0x14')](_0x2e6093));if(_0x2e6093[_0x6006('0x15')]){if(_0x2e6093['error'][_0x6006('0x16')]===0x1f4){logger[_0x6006('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x568810,_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);return _0x5afcb3(_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);}logger[_0x6006('0x15')](_0x6006('0x11'),_0x568810,_0x2e6093['error']['message']);return _0xdf0291(_0x2e6093['error'][_0x6006('0x17')]);}else{logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,_0x6006('0x18'));_0xdf0291(_0x2e6093['result'][_0x6006('0x17')]);}})['catch'](function(_0x5d277e){logger['error'](_0x6006('0x11'),_0x568810,_0x5d277e);_0x5afcb3(_0x5d277e);});});}exports['CreateChatQueueReport']=function(_0x3be2b0){var _0x213493=this;return new Promise(function(_0x49f63f,_0xd97b56){return db[_0x6006('0x19')][_0x6006('0x1a')](_0x3be2b0[_0x6006('0x1b')],{'raw':_0x3be2b0[_0x6006('0x1c')]?_0x3be2b0[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![]})[_0x6006('0xf')](function(_0x62bf30){logger['info'](_0x6006('0x1e'),_0x3be2b0);logger['debug'](_0x6006('0x1e'),_0x3be2b0,JSON[_0x6006('0x14')](_0x62bf30));_0x49f63f(_0x62bf30);})['catch'](function(_0x229ba9){logger[_0x6006('0x15')](_0x6006('0x1e'),_0x229ba9[_0x6006('0x17')],_0x3be2b0);_0xd97b56(_0x213493['error'](0x1f4,_0x229ba9[_0x6006('0x17')]));});});};exports[_0x6006('0x1f')]=function(_0x1e1eb4){var _0x4c52fb=this;return new Promise(function(_0x515952,_0x30744e){return db[_0x6006('0x19')][_0x6006('0x20')](_0x1e1eb4['body'],{'raw':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x21')]||null:null,'attributes':_0x1e1eb4['options']?_0x1e1eb4[_0x6006('0x1c')]['attributes']||null:null,'limit':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4['options'][_0x6006('0x22')]||null:null})[_0x6006('0xf')](function(_0x137b1a){logger[_0x6006('0x10')]('UpdateChatQueueReport',_0x1e1eb4);logger['debug'](_0x6006('0x1f'),_0x1e1eb4,JSON[_0x6006('0x14')](_0x137b1a));_0x515952(_0x137b1a);})[_0x6006('0x23')](function(_0xa63979){logger[_0x6006('0x15')]('UpdateChatQueueReport',_0xa63979['message'],_0x1e1eb4);_0x30744e(_0x4c52fb[_0x6006('0x15')](0x1f4,_0xa63979['message']));});});};
\ No newline at end of file
+var _0x7e12=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ChatQueueReport','create','options','CreateChatQueueReport','UpdateChatQueueReport','update','body','raw','where','attributes','limit','lodash','util','bluebird','randomstring'];(function(_0xc31e71,_0x5b8183){var _0x350a14=function(_0x3ed33f){while(--_0x3ed33f){_0xc31e71['push'](_0xc31e71['shift']());}};_0x350a14(++_0x5b8183);}(_0x7e12,0x17c));var _0x27e1=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x7e12[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0x27e1('0x0'));var util=require(_0x27e1('0x1'));var moment=require('moment');var BPromise=require(_0x27e1('0x2'));var rs=require(_0x27e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27e1('0x4'))['db'];var utils=require(_0x27e1('0x5'));var logger=require('../../config/logger')(_0x27e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x27e1('0x7')][_0x27e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bd783,_0x4768ba,_0x38d22c){return new BPromise(function(_0x23e772,_0x382056){return client[_0x27e1('0x9')](_0x2bd783,_0x38d22c)[_0x27e1('0xa')](function(_0x3ebe62){logger[_0x27e1('0xb')](_0x27e1('0xc'),_0x4768ba,_0x27e1('0xd'));logger[_0x27e1('0xe')](_0x27e1('0xf'),_0x4768ba,_0x27e1('0xd'),JSON[_0x27e1('0x10')](_0x3ebe62));if(_0x3ebe62['error']){if(_0x3ebe62['error'][_0x27e1('0x11')]===0x1f4){logger[_0x27e1('0x12')](_0x27e1('0xc'),_0x4768ba,_0x3ebe62[_0x27e1('0x12')][_0x27e1('0x13')]);return _0x382056(_0x3ebe62['error'][_0x27e1('0x13')]);}logger[_0x27e1('0x12')](_0x27e1('0xc'),_0x4768ba,_0x3ebe62[_0x27e1('0x12')]['message']);return _0x23e772(_0x3ebe62[_0x27e1('0x12')][_0x27e1('0x13')]);}else{logger[_0x27e1('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4768ba,_0x27e1('0xd'));_0x23e772(_0x3ebe62['result'][_0x27e1('0x13')]);}})[_0x27e1('0x14')](function(_0x4cc741){logger['error'](_0x27e1('0xc'),_0x4768ba,_0x4cc741);_0x382056(_0x4cc741);});});}exports['CreateChatQueueReport']=function(_0x511dc9){var _0xef1e90=this;return new Promise(function(_0x93f044,_0x15cc59){return db[_0x27e1('0x15')][_0x27e1('0x16')](_0x511dc9['body'],{'raw':_0x511dc9[_0x27e1('0x17')]?_0x511dc9[_0x27e1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x27e1('0xa')](function(_0x2e0ba7){logger['info'](_0x27e1('0x18'),_0x511dc9);logger['debug'](_0x27e1('0x18'),_0x511dc9,JSON[_0x27e1('0x10')](_0x2e0ba7));_0x93f044(_0x2e0ba7);})[_0x27e1('0x14')](function(_0x7a1000){logger['error'](_0x27e1('0x18'),_0x7a1000[_0x27e1('0x13')],_0x511dc9);_0x15cc59(_0xef1e90['error'](0x1f4,_0x7a1000[_0x27e1('0x13')]));});});};exports[_0x27e1('0x19')]=function(_0x55e772){var _0x35dbb4=this;return new Promise(function(_0x17ed05,_0x5e6df6){return db[_0x27e1('0x15')][_0x27e1('0x1a')](_0x55e772[_0x27e1('0x1b')],{'raw':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e772['options']?_0x55e772['options'][_0x27e1('0x1d')]||null:null,'attributes':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1e')]||null:null,'limit':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1f')]||null:null})[_0x27e1('0xa')](function(_0x1507ab){logger[_0x27e1('0xb')](_0x27e1('0x19'),_0x55e772);logger[_0x27e1('0xe')](_0x27e1('0x19'),_0x55e772,JSON[_0x27e1('0x10')](_0x1507ab));_0x17ed05(_0x1507ab);})[_0x27e1('0x14')](function(_0x4c513f){logger[_0x27e1('0x12')](_0x27e1('0x19'),_0x4c513f['message'],_0x55e772);_0x5e6df6(_0x35dbb4[_0x27e1('0x12')](0x1f4,_0x4c513f[_0x27e1('0x13')]));});});};
\ No newline at end of file
index 58e0392..bc989b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x624b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x624b,0x1a4));var _0xb624=function(_0x2b9336,_0x25980b){_0x2b9336=_0x2b9336-0x0;var _0x4dd80a=_0x624b[_0x2b9336];return _0x4dd80a;};'use strict';var multer=require(_0xb624('0x0'));var util=require(_0xb624('0x1'));var path=require(_0xb624('0x2'));var timeout=require(_0xb624('0x3'));var express=require(_0xb624('0x4'));var router=express[_0xb624('0x5')]();var fs_extra=require(_0xb624('0x6'));var auth=require(_0xb624('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb624('0x8'));var controller=require(_0xb624('0x9'));router[_0xb624('0xa')]('/',auth[_0xb624('0xb')](),controller[_0xb624('0xc')]);router['get'](_0xb624('0xd'),auth[_0xb624('0xb')](),controller['describe']);router[_0xb624('0xa')](_0xb624('0xe'),auth[_0xb624('0xb')](),controller[_0xb624('0xf')]);router[_0xb624('0x10')]('/',auth[_0xb624('0xb')](),controller['create']);router['put'](_0xb624('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xb624('0x11')](_0xb624('0xe'),auth[_0xb624('0xb')](),controller[_0xb624('0x12')]);module[_0xb624('0x13')]=router;
\ No newline at end of file
+var _0x96e1=['destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','put','update','delete'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x96e1,0x190));var _0x196e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x96e1[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x196e('0x0'));var path=require(_0x196e('0x1'));var timeout=require(_0x196e('0x2'));var express=require(_0x196e('0x3'));var router=express['Router']();var fs_extra=require(_0x196e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x196e('0x5'));var config=require(_0x196e('0x6'));var controller=require(_0x196e('0x7'));router[_0x196e('0x8')]('/',auth['isAuthenticated'](),controller[_0x196e('0x9')]);router[_0x196e('0x8')](_0x196e('0xa'),auth['isAuthenticated'](),controller[_0x196e('0xb')]);router['get'](_0x196e('0xc'),auth[_0x196e('0xd')](),controller[_0x196e('0xe')]);router['post']('/',auth[_0x196e('0xd')](),controller['create']);router[_0x196e('0xf')](_0x196e('0xc'),auth[_0x196e('0xd')](),controller[_0x196e('0x10')]);router[_0x196e('0x11')](_0x196e('0xc'),auth['isAuthenticated'](),controller[_0x196e('0x12')]);module['exports']=router;
\ No newline at end of file
index ffe7d88..f1e7cd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x30b94a,_0xfb8634){var _0x291adc=function(_0x47d0c3){while(--_0x47d0c3){_0x30b94a['push'](_0x30b94a['shift']());}};_0x291adc(++_0xfb8634);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x36eed5,_0xdaeafa){var _0x265b98=function(_0x46d297){while(--_0x46d297){_0x36eed5['push'](_0x36eed5['shift']());}};_0x265b98(++_0xdaeafa);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'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
index 95e3b57..6166a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d80=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatTransferReport','findAll','catch','show','intersection','length','includeAll','find','create','body','params','describe','eml-format'];(function(_0x521629,_0x31dfab){var _0x1d3ba5=function(_0x3c2605){while(--_0x3c2605){_0x521629['push'](_0x521629['shift']());}};_0x1d3ba5(++_0x31dfab);}(_0x5d80,0x1cd));var _0x05d8=function(_0x1ec8a2,_0x38e9d1){_0x1ec8a2=_0x1ec8a2-0x0;var _0x37788a=_0x5d80[_0x1ec8a2];return _0x37788a;};'use strict';var emlformat=require(_0x05d8('0x0'));var rimraf=require(_0x05d8('0x1'));var zipdir=require(_0x05d8('0x2'));var jsonpatch=require(_0x05d8('0x3'));var rp=require(_0x05d8('0x4'));var moment=require(_0x05d8('0x5'));var BPromise=require(_0x05d8('0x6'));var Mustache=require(_0x05d8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x05d8('0x8'));var csv=require(_0x05d8('0x9'));var ejs=require(_0x05d8('0xa'));var fs=require('fs');var fs_extra=require(_0x05d8('0xb'));var _=require(_0x05d8('0xc'));var squel=require(_0x05d8('0xd'));var crypto=require(_0x05d8('0xe'));var jsforce=require(_0x05d8('0xf'));var deskjs=require(_0x05d8('0x10'));var toCsv=require(_0x05d8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x05d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x05d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05d8('0x13'));var logger=require(_0x05d8('0x14'))(_0x05d8('0x15'));var utils=require('../../config/utils');var config=require(_0x05d8('0x16'));var licenseUtil=require(_0x05d8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1ffa8,_0x2a47f0){_0x2a47f0=_0x2a47f0||0xcc;return function(_0xc638f){if(_0xc638f){return _0xa1ffa8[_0x05d8('0x18')](_0x2a47f0);}return _0xa1ffa8['status'](_0x2a47f0)[_0x05d8('0x19')]();};}function respondWithResult(_0x138fe0,_0x7fbd37){_0x7fbd37=_0x7fbd37||0xc8;return function(_0xbcefdc){if(_0xbcefdc){return _0x138fe0[_0x05d8('0x1a')](_0x7fbd37)['json'](_0xbcefdc);}};}function respondWithFilteredResult(_0x17bb06,_0x5502d0){return function(_0x3e1973){if(_0x3e1973){var _0x14409d=typeof _0x5502d0[_0x05d8('0x1b')]===_0x05d8('0x1c')&&typeof _0x5502d0['limit']===_0x05d8('0x1c');var _0x19c7de=_0x3e1973[_0x05d8('0x1d')];var _0x2df4dd=_0x14409d?0x0:_0x5502d0[_0x05d8('0x1b')];var _0x420182=_0x14409d?_0x3e1973[_0x05d8('0x1d')]:_0x5502d0['offset']+_0x5502d0[_0x05d8('0x1e')];var _0x4052c4;if(_0x420182>=_0x19c7de){_0x420182=_0x19c7de;_0x4052c4=0xc8;}else{_0x4052c4=0xce;}_0x17bb06[_0x05d8('0x1a')](_0x4052c4);return _0x17bb06[_0x05d8('0x1f')](_0x05d8('0x20'),_0x2df4dd+'-'+_0x420182+'/'+_0x19c7de)[_0x05d8('0x21')](_0x3e1973);}return null;};}function patchUpdates(_0x3b468e){return function(_0x35ce4b){try{jsonpatch[_0x05d8('0x22')](_0x35ce4b,_0x3b468e,!![]);}catch(_0x39d575){return BPromise[_0x05d8('0x23')](_0x39d575);}return _0x35ce4b[_0x05d8('0x24')]();};}function saveUpdates(_0x5cea68,_0x4a2eac){return function(_0x515398){if(_0x515398){return _0x515398[_0x05d8('0x25')](_0x5cea68)[_0x05d8('0x26')](function(_0x470526){return _0x470526;});}return null;};}function removeEntity(_0x123242,_0x53b5bf){return function(_0x2fe000){if(_0x2fe000){return _0x2fe000[_0x05d8('0x27')]()[_0x05d8('0x26')](function(){_0x123242['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbfd4,_0x1d93b5){return function(_0x5d7d9c){if(!_0x5d7d9c){_0x5cbfd4['sendStatus'](0x194);}return _0x5d7d9c;};}function handleError(_0x5c55f9,_0x26a6e4){_0x26a6e4=_0x26a6e4||0x1f4;return function(_0x9d2b61){logger[_0x05d8('0x28')](_0x9d2b61[_0x05d8('0x29')]);if(_0x9d2b61[_0x05d8('0x2a')]){delete _0x9d2b61[_0x05d8('0x2a')];}_0x5c55f9['status'](_0x26a6e4)[_0x05d8('0x2b')](_0x9d2b61);};}exports[_0x05d8('0x2c')]=function(_0x4618c1,_0x27a0fe){var _0x6cd67a={},_0x54f9d6={},_0x39308b={'count':0x0,'rows':[]};var _0x1e900e=_[_0x05d8('0x2d')](db['ChatTransferReport'][_0x05d8('0x2e')],function(_0x47ef9e){return{'name':_0x47ef9e[_0x05d8('0x2f')],'type':_0x47ef9e[_0x05d8('0x30')]['key']};});_0x54f9d6[_0x05d8('0x31')]=_['map'](_0x1e900e,_0x05d8('0x2a'));_0x54f9d6[_0x05d8('0x32')]=_[_0x05d8('0x33')](_0x4618c1[_0x05d8('0x32')]);_0x54f9d6[_0x05d8('0x34')]=_['intersection'](_0x54f9d6[_0x05d8('0x31')],_0x54f9d6[_0x05d8('0x32')]);_0x6cd67a[_0x05d8('0x35')]=_['intersection'](_0x54f9d6[_0x05d8('0x31')],qs[_0x05d8('0x36')](_0x4618c1[_0x05d8('0x32')]['fields']));_0x6cd67a[_0x05d8('0x35')]=_0x6cd67a[_0x05d8('0x35')]['length']?_0x6cd67a['attributes']:_0x54f9d6[_0x05d8('0x31')];if(!_0x4618c1[_0x05d8('0x32')]['hasOwnProperty'](_0x05d8('0x37'))){_0x6cd67a['limit']=qs[_0x05d8('0x1e')](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x1e')]);_0x6cd67a['offset']=qs['offset'](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x1b')]);}_0x6cd67a[_0x05d8('0x38')]=qs[_0x05d8('0x39')](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x39')]);_0x6cd67a[_0x05d8('0x3a')]=qs[_0x05d8('0x34')](_[_0x05d8('0x3b')](_0x4618c1[_0x05d8('0x32')],_0x54f9d6['filters']),_0x1e900e);if(_0x4618c1[_0x05d8('0x32')][_0x05d8('0x3c')]){_0x6cd67a[_0x05d8('0x3a')]=_[_0x05d8('0x3d')](_0x6cd67a[_0x05d8('0x3a')],{'$or':_['map'](_0x1e900e,function(_0x48f3f2){if(_0x48f3f2[_0x05d8('0x30')]!==_0x05d8('0x3e')){var _0x553cec={};_0x553cec[_0x48f3f2['name']]={'$like':'%'+_0x4618c1[_0x05d8('0x32')][_0x05d8('0x3c')]+'%'};return _0x553cec;}})});}_0x6cd67a=_[_0x05d8('0x3d')]({},_0x6cd67a,_0x4618c1[_0x05d8('0x3f')]);var _0x537734={'where':_0x6cd67a[_0x05d8('0x3a')]};return db['ChatTransferReport'][_0x05d8('0x1d')](_0x537734)[_0x05d8('0x26')](function(_0x578025){_0x39308b['count']=_0x578025;if(_0x4618c1[_0x05d8('0x32')]['includeAll']){_0x6cd67a[_0x05d8('0x40')]=[{'all':!![]}];}return db[_0x05d8('0x41')][_0x05d8('0x42')](_0x6cd67a);})[_0x05d8('0x26')](function(_0x582d92){_0x39308b['rows']=_0x582d92;return _0x39308b;})[_0x05d8('0x26')](respondWithFilteredResult(_0x27a0fe,_0x6cd67a))[_0x05d8('0x43')](handleError(_0x27a0fe,null));};exports[_0x05d8('0x44')]=function(_0xfc570,_0x3f00cc){var _0x39d227={'raw':!![],'where':{'id':_0xfc570['params']['id']}},_0x44b4b5={};_0x44b4b5[_0x05d8('0x31')]=_[_0x05d8('0x33')](db[_0x05d8('0x41')][_0x05d8('0x2e')]);_0x44b4b5[_0x05d8('0x32')]=_[_0x05d8('0x33')](_0xfc570[_0x05d8('0x32')]);_0x44b4b5[_0x05d8('0x34')]=_[_0x05d8('0x45')](_0x44b4b5[_0x05d8('0x31')],_0x44b4b5[_0x05d8('0x32')]);_0x39d227[_0x05d8('0x35')]=_[_0x05d8('0x45')](_0x44b4b5[_0x05d8('0x31')],qs[_0x05d8('0x36')](_0xfc570['query'][_0x05d8('0x36')]));_0x39d227[_0x05d8('0x35')]=_0x39d227[_0x05d8('0x35')][_0x05d8('0x46')]?_0x39d227['attributes']:_0x44b4b5[_0x05d8('0x31')];if(_0xfc570[_0x05d8('0x32')][_0x05d8('0x47')]){_0x39d227[_0x05d8('0x40')]=[{'all':!![]}];}_0x39d227=_[_0x05d8('0x3d')]({},_0x39d227,_0xfc570[_0x05d8('0x3f')]);return db[_0x05d8('0x41')][_0x05d8('0x48')](_0x39d227)[_0x05d8('0x26')](handleEntityNotFound(_0x3f00cc,null))[_0x05d8('0x26')](respondWithResult(_0x3f00cc,null))[_0x05d8('0x43')](handleError(_0x3f00cc,null));};exports[_0x05d8('0x49')]=function(_0x414d6b,_0x3b28be){return db['ChatTransferReport'][_0x05d8('0x49')](_0x414d6b[_0x05d8('0x4a')],{})[_0x05d8('0x26')](respondWithResult(_0x3b28be,0xc9))['catch'](handleError(_0x3b28be,null));};exports[_0x05d8('0x25')]=function(_0x42c85c,_0x14ebfe){if(_0x42c85c[_0x05d8('0x4a')]['id']){delete _0x42c85c[_0x05d8('0x4a')]['id'];}return db[_0x05d8('0x41')]['find']({'where':{'id':_0x42c85c[_0x05d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14ebfe,null))['then'](saveUpdates(_0x42c85c[_0x05d8('0x4a')],null))[_0x05d8('0x26')](respondWithResult(_0x14ebfe,null))[_0x05d8('0x43')](handleError(_0x14ebfe,null));};exports[_0x05d8('0x27')]=function(_0x4d3b72,_0x4aad16){return db[_0x05d8('0x41')]['find']({'where':{'id':_0x4d3b72[_0x05d8('0x4b')]['id']}})[_0x05d8('0x26')](handleEntityNotFound(_0x4aad16,null))[_0x05d8('0x26')](removeEntity(_0x4aad16,null))[_0x05d8('0x43')](handleError(_0x4aad16,null));};exports[_0x05d8('0x4c')]=function(_0x565b27,_0x36a943){return db[_0x05d8('0x41')]['describe']()['then'](respondWithResult(_0x36a943,null))[_0x05d8('0x43')](handleError(_0x36a943,null));};
\ No newline at end of file
+var _0xc91e=['params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show'];(function(_0x10c5e2,_0x272dcf){var _0x5bb7ca=function(_0x26289a){while(--_0x26289a){_0x10c5e2['push'](_0x10c5e2['shift']());}};_0x5bb7ca(++_0x272dcf);}(_0xc91e,0xf3));var _0xec91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec91('0x0'));var zipdir=require(_0xec91('0x1'));var jsonpatch=require(_0xec91('0x2'));var rp=require(_0xec91('0x3'));var moment=require(_0xec91('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec91('0x5'));var util=require(_0xec91('0x6'));var path=require(_0xec91('0x7'));var sox=require(_0xec91('0x8'));var csv=require(_0xec91('0x9'));var ejs=require(_0xec91('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec91('0xb'));var squel=require(_0xec91('0xc'));var crypto=require(_0xec91('0xd'));var jsforce=require(_0xec91('0xe'));var deskjs=require(_0xec91('0xf'));var toCsv=require(_0xec91('0x9'));var querystring=require(_0xec91('0x10'));var Papa=require('papaparse');var Redis=require(_0xec91('0x11'));var authService=require(_0xec91('0x12'));var qs=require(_0xec91('0x13'));var as=require(_0xec91('0x14'));var hardwareService=require(_0xec91('0x15'));var logger=require(_0xec91('0x16'))(_0xec91('0x17'));var utils=require(_0xec91('0x18'));var config=require(_0xec91('0x19'));var licenseUtil=require(_0xec91('0x1a'));var db=require(_0xec91('0x1b'))['db'];function respondWithStatusCode(_0x434c9b,_0x12f5a9){_0x12f5a9=_0x12f5a9||0xcc;return function(_0x30c755){if(_0x30c755){return _0x434c9b[_0xec91('0x1c')](_0x12f5a9);}return _0x434c9b[_0xec91('0x1d')](_0x12f5a9)['end']();};}function respondWithResult(_0x1d49e3,_0x45a32e){_0x45a32e=_0x45a32e||0xc8;return function(_0x4e3914){if(_0x4e3914){return _0x1d49e3[_0xec91('0x1d')](_0x45a32e)[_0xec91('0x1e')](_0x4e3914);}};}function respondWithFilteredResult(_0x51d515,_0x14cb67){return function(_0x5e2249){if(_0x5e2249){var _0x2b3847=typeof _0x14cb67[_0xec91('0x1f')]==='undefined'&&typeof _0x14cb67['limit']==='undefined';var _0x1e25e2=_0x5e2249[_0xec91('0x20')];var _0x43138c=_0x2b3847?0x0:_0x14cb67['offset'];var _0x5559a9=_0x2b3847?_0x5e2249[_0xec91('0x20')]:_0x14cb67['offset']+_0x14cb67[_0xec91('0x21')];var _0x493d9c;if(_0x5559a9>=_0x1e25e2){_0x5559a9=_0x1e25e2;_0x493d9c=0xc8;}else{_0x493d9c=0xce;}_0x51d515[_0xec91('0x1d')](_0x493d9c);return _0x51d515[_0xec91('0x22')](_0xec91('0x23'),_0x43138c+'-'+_0x5559a9+'/'+_0x1e25e2)[_0xec91('0x1e')](_0x5e2249);}return null;};}function patchUpdates(_0x377ee2){return function(_0x53d26c){try{jsonpatch[_0xec91('0x24')](_0x53d26c,_0x377ee2,!![]);}catch(_0xfd4310){return BPromise['reject'](_0xfd4310);}return _0x53d26c[_0xec91('0x25')]();};}function saveUpdates(_0x586ecd,_0xfa5403){return function(_0x2f0498){if(_0x2f0498){return _0x2f0498['update'](_0x586ecd)[_0xec91('0x26')](function(_0xb50e80){return _0xb50e80;});}return null;};}function removeEntity(_0x4d4d10,_0x13121b){return function(_0x152ce4){if(_0x152ce4){return _0x152ce4[_0xec91('0x27')]()[_0xec91('0x26')](function(){_0x4d4d10[_0xec91('0x1d')](0xcc)[_0xec91('0x28')]();});}};}function handleEntityNotFound(_0x46fbef,_0x2fe1ee){return function(_0x2065f4){if(!_0x2065f4){_0x46fbef['sendStatus'](0x194);}return _0x2065f4;};}function handleError(_0x3c168e,_0x1976da){_0x1976da=_0x1976da||0x1f4;return function(_0x3ca197){logger[_0xec91('0x29')](_0x3ca197[_0xec91('0x2a')]);if(_0x3ca197[_0xec91('0x2b')]){delete _0x3ca197[_0xec91('0x2b')];}_0x3c168e[_0xec91('0x1d')](_0x1976da)[_0xec91('0x2c')](_0x3ca197);};}exports[_0xec91('0x2d')]=function(_0x374fd2,_0x145489){var _0x46d206={},_0x2da4bf={},_0x58e6ec={'count':0x0,'rows':[]};var _0x4f13d4=_[_0xec91('0x2e')](db[_0xec91('0x2f')][_0xec91('0x30')],function(_0x301919){return{'name':_0x301919[_0xec91('0x31')],'type':_0x301919[_0xec91('0x32')][_0xec91('0x33')]};});_0x2da4bf[_0xec91('0x34')]=_['map'](_0x4f13d4,_0xec91('0x2b'));_0x2da4bf[_0xec91('0x35')]=_[_0xec91('0x36')](_0x374fd2[_0xec91('0x35')]);_0x2da4bf['filters']=_[_0xec91('0x37')](_0x2da4bf[_0xec91('0x34')],_0x2da4bf['query']);_0x46d206['attributes']=_['intersection'](_0x2da4bf[_0xec91('0x34')],qs[_0xec91('0x38')](_0x374fd2['query'][_0xec91('0x38')]));_0x46d206[_0xec91('0x39')]=_0x46d206['attributes'][_0xec91('0x3a')]?_0x46d206[_0xec91('0x39')]:_0x2da4bf[_0xec91('0x34')];if(!_0x374fd2['query']['hasOwnProperty']('nolimit')){_0x46d206[_0xec91('0x21')]=qs['limit'](_0x374fd2['query']['limit']);_0x46d206[_0xec91('0x1f')]=qs[_0xec91('0x1f')](_0x374fd2[_0xec91('0x35')][_0xec91('0x1f')]);}_0x46d206[_0xec91('0x3b')]=qs[_0xec91('0x3c')](_0x374fd2[_0xec91('0x35')][_0xec91('0x3c')]);_0x46d206[_0xec91('0x3d')]=qs[_0xec91('0x3e')](_[_0xec91('0x3f')](_0x374fd2[_0xec91('0x35')],_0x2da4bf[_0xec91('0x3e')]),_0x4f13d4);if(_0x374fd2[_0xec91('0x35')]['filter']){_0x46d206[_0xec91('0x3d')]=_['merge'](_0x46d206[_0xec91('0x3d')],{'$or':_[_0xec91('0x2e')](_0x4f13d4,function(_0x602b62){if(_0x602b62[_0xec91('0x32')]!==_0xec91('0x40')){var _0x34fe54={};_0x34fe54[_0x602b62[_0xec91('0x2b')]]={'$like':'%'+_0x374fd2[_0xec91('0x35')][_0xec91('0x41')]+'%'};return _0x34fe54;}})});}_0x46d206=_[_0xec91('0x42')]({},_0x46d206,_0x374fd2[_0xec91('0x43')]);var _0x581441={'where':_0x46d206[_0xec91('0x3d')]};return db[_0xec91('0x2f')][_0xec91('0x20')](_0x581441)[_0xec91('0x26')](function(_0x4420d5){_0x58e6ec[_0xec91('0x20')]=_0x4420d5;if(_0x374fd2[_0xec91('0x35')]['includeAll']){_0x46d206[_0xec91('0x44')]=[{'all':!![]}];}return db[_0xec91('0x2f')][_0xec91('0x45')](_0x46d206);})['then'](function(_0x145c22){_0x58e6ec[_0xec91('0x46')]=_0x145c22;return _0x58e6ec;})[_0xec91('0x26')](respondWithFilteredResult(_0x145489,_0x46d206))[_0xec91('0x47')](handleError(_0x145489,null));};exports[_0xec91('0x48')]=function(_0x75c3c4,_0x3af6cd){var _0x4e9e4a={'raw':!![],'where':{'id':_0x75c3c4[_0xec91('0x49')]['id']}},_0x3fb7d0={};_0x3fb7d0[_0xec91('0x34')]=_[_0xec91('0x36')](db[_0xec91('0x2f')][_0xec91('0x30')]);_0x3fb7d0[_0xec91('0x35')]=_[_0xec91('0x36')](_0x75c3c4[_0xec91('0x35')]);_0x3fb7d0[_0xec91('0x3e')]=_[_0xec91('0x37')](_0x3fb7d0['model'],_0x3fb7d0[_0xec91('0x35')]);_0x4e9e4a[_0xec91('0x39')]=_[_0xec91('0x37')](_0x3fb7d0[_0xec91('0x34')],qs[_0xec91('0x38')](_0x75c3c4['query']['fields']));_0x4e9e4a[_0xec91('0x39')]=_0x4e9e4a[_0xec91('0x39')][_0xec91('0x3a')]?_0x4e9e4a[_0xec91('0x39')]:_0x3fb7d0['model'];if(_0x75c3c4[_0xec91('0x35')][_0xec91('0x4a')]){_0x4e9e4a[_0xec91('0x44')]=[{'all':!![]}];}_0x4e9e4a=_[_0xec91('0x42')]({},_0x4e9e4a,_0x75c3c4[_0xec91('0x43')]);return db[_0xec91('0x2f')]['find'](_0x4e9e4a)[_0xec91('0x26')](handleEntityNotFound(_0x3af6cd,null))[_0xec91('0x26')](respondWithResult(_0x3af6cd,null))['catch'](handleError(_0x3af6cd,null));};exports[_0xec91('0x4b')]=function(_0x3f44c2,_0x3c9513){return db[_0xec91('0x2f')][_0xec91('0x4b')](_0x3f44c2[_0xec91('0x4c')],{})[_0xec91('0x26')](respondWithResult(_0x3c9513,0xc9))['catch'](handleError(_0x3c9513,null));};exports['update']=function(_0x23bda1,_0x339dff){if(_0x23bda1['body']['id']){delete _0x23bda1[_0xec91('0x4c')]['id'];}return db[_0xec91('0x2f')][_0xec91('0x4d')]({'where':{'id':_0x23bda1[_0xec91('0x49')]['id']}})['then'](handleEntityNotFound(_0x339dff,null))['then'](saveUpdates(_0x23bda1[_0xec91('0x4c')],null))[_0xec91('0x26')](respondWithResult(_0x339dff,null))['catch'](handleError(_0x339dff,null));};exports[_0xec91('0x27')]=function(_0x4e0c2f,_0x1cc81d){return db[_0xec91('0x2f')][_0xec91('0x4d')]({'where':{'id':_0x4e0c2f[_0xec91('0x49')]['id']}})[_0xec91('0x26')](handleEntityNotFound(_0x1cc81d,null))[_0xec91('0x26')](removeEntity(_0x1cc81d,null))[_0xec91('0x47')](handleError(_0x1cc81d,null));};exports['describe']=function(_0x27b2bf,_0x26f440){return db['ChatTransferReport'][_0xec91('0x4e')]()['then'](respondWithResult(_0x26f440,null))['catch'](handleError(_0x26f440,null));};
\ No newline at end of file
index 27bd8de..f476d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eec=['path','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x55415f,_0x5c7014){var _0x5c42ba=function(_0xe01ac7){while(--_0xe01ac7){_0x55415f['push'](_0x55415f['shift']());}};_0x5c42ba(++_0x5c7014);}(_0x0eec,0x69));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require(_0xc0ee('0x1'));var logger=require('../../config/logger')(_0xc0ee('0x2'));var moment=require('moment');var BPromise=require(_0xc0ee('0x3'));var rp=require(_0xc0ee('0x4'));var fs=require('fs');var path=require(_0xc0ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xc0ee('0x6')]=function(_0x14aa90,_0x31cf4a){return _0x14aa90[_0xc0ee('0x7')](_0xc0ee('0x8'),attributes,{'tableName':_0xc0ee('0x9'),'paranoid':![],'indexes':[{'name':_0xc0ee('0xa'),'fields':[_0xc0ee('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4337=['define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatTransferReport.attributes','exports'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x4337,0xee));var _0x7433=function(_0x37b107,_0x4d7147){_0x37b107=_0x37b107-0x0;var _0x21b907=_0x4337[_0x37b107];return _0x21b907;};'use strict';var _=require('lodash');var util=require(_0x7433('0x0'));var logger=require(_0x7433('0x1'))(_0x7433('0x2'));var moment=require(_0x7433('0x3'));var BPromise=require(_0x7433('0x4'));var rp=require(_0x7433('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7433('0x6'));var config=require('../../config/environment');var attributes=require(_0x7433('0x7'));module[_0x7433('0x8')]=function(_0xe881eb,_0x5a5436){return _0xe881eb[_0x7433('0x9')](_0x7433('0xa'),attributes,{'tableName':_0x7433('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7433('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 34a2dec..398d9f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd772=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3b7670,_0x362eb2){var _0x1bf2c7=function(_0x14a9d9){while(--_0x14a9d9){_0x3b7670['push'](_0x3b7670['shift']());}};_0x1bf2c7(++_0x362eb2);}(_0xd772,0x16a));var _0x2d77=function(_0x5b10de,_0x2f8ffe){_0x5b10de=_0x5b10de-0x0;var _0x5e857d=_0xd772[_0x5b10de];return _0x5e857d;};'use strict';var _=require('lodash');var util=require(_0x2d77('0x0'));var moment=require(_0x2d77('0x1'));var BPromise=require(_0x2d77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d77('0x3'))['db'];var utils=require(_0x2d77('0x4'));var logger=require(_0x2d77('0x5'))('rpc');var config=require(_0x2d77('0x6'));var jayson=require(_0x2d77('0x7'));var client=jayson['client'][_0x2d77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb55331,_0x350066,_0x3a1c92){return new BPromise(function(_0x1de630,_0x447a10){return client[_0x2d77('0x9')](_0xb55331,_0x3a1c92)[_0x2d77('0xa')](function(_0x2d685d){logger['info'](_0x2d77('0xb'),_0x350066,_0x2d77('0xc'));logger[_0x2d77('0xd')](_0x2d77('0xe'),_0x350066,'request\x20sent',JSON[_0x2d77('0xf')](_0x2d685d));if(_0x2d685d[_0x2d77('0x10')]){if(_0x2d685d[_0x2d77('0x10')]['code']===0x1f4){logger[_0x2d77('0x10')](_0x2d77('0xb'),_0x350066,_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);return _0x447a10(_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);}logger[_0x2d77('0x10')](_0x2d77('0xb'),_0x350066,_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);return _0x1de630(_0x2d685d[_0x2d77('0x10')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x350066,_0x2d77('0xc'));_0x1de630(_0x2d685d[_0x2d77('0x12')]['message']);}})[_0x2d77('0x13')](function(_0x209d12){logger['error'](_0x2d77('0xb'),_0x350066,_0x209d12);_0x447a10(_0x209d12);});});}
\ No newline at end of file
+var _0x1ca1=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x2fd42d,_0x1e20b4){var _0x1dc0c8=function(_0x104b21){while(--_0x104b21){_0x2fd42d['push'](_0x2fd42d['shift']());}};_0x1dc0c8(++_0x1e20b4);}(_0x1ca1,0x150));var _0x11ca=function(_0x50d753,_0x2427b9){_0x50d753=_0x50d753-0x0;var _0xaef6d9=_0x1ca1[_0x50d753];return _0xaef6d9;};'use strict';var _=require(_0x11ca('0x0'));var util=require(_0x11ca('0x1'));var moment=require(_0x11ca('0x2'));var BPromise=require(_0x11ca('0x3'));var rs=require(_0x11ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x11ca('0x6'))(_0x11ca('0x7'));var config=require(_0x11ca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x11ca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59fda7,_0xf6dc4d,_0x275158){return new BPromise(function(_0x567c47,_0x27aa8a){return client['request'](_0x59fda7,_0x275158)[_0x11ca('0xa')](function(_0x1c9278){logger['info'](_0x11ca('0xb'),_0xf6dc4d,_0x11ca('0xc'));logger[_0x11ca('0xd')](_0x11ca('0xe'),_0xf6dc4d,'request\x20sent',JSON[_0x11ca('0xf')](_0x1c9278));if(_0x1c9278[_0x11ca('0x10')]){if(_0x1c9278[_0x11ca('0x10')][_0x11ca('0x11')]===0x1f4){logger[_0x11ca('0x10')](_0x11ca('0xb'),_0xf6dc4d,_0x1c9278[_0x11ca('0x10')]['message']);return _0x27aa8a(_0x1c9278['error'][_0x11ca('0x12')]);}logger[_0x11ca('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xf6dc4d,_0x1c9278['error']['message']);return _0x567c47(_0x1c9278[_0x11ca('0x10')][_0x11ca('0x12')]);}else{logger[_0x11ca('0x13')](_0x11ca('0xb'),_0xf6dc4d,'request\x20sent');_0x567c47(_0x1c9278['result']['message']);}})[_0x11ca('0x14')](function(_0x1a4b2b){logger[_0x11ca('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xf6dc4d,_0x1a4b2b);_0x27aa8a(_0x1a4b2b);});});}
\ No newline at end of file
index 7249ef6..6e854f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea17=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x21165a,_0x3aab21){var _0x33854b=function(_0x38d844){while(--_0x38d844){_0x21165a['push'](_0x21165a['shift']());}};_0x33854b(++_0x3aab21);}(_0xea17,0x14b));var _0x7ea1=function(_0x54153b,_0x452448){_0x54153b=_0x54153b-0x0;var _0x2a3ea6=_0xea17[_0x54153b];return _0x2a3ea6;};'use strict';var multer=require('multer');var util=require(_0x7ea1('0x0'));var path=require(_0x7ea1('0x1'));var timeout=require(_0x7ea1('0x2'));var express=require(_0x7ea1('0x3'));var router=express['Router']();var fs_extra=require(_0x7ea1('0x4'));var auth=require(_0x7ea1('0x5'));var interaction=require(_0x7ea1('0x6'));var config=require(_0x7ea1('0x7'));var controller=require(_0x7ea1('0x8'));router[_0x7ea1('0x9')]('/',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xb')]);router[_0x7ea1('0x9')](_0x7ea1('0xc'),auth[_0x7ea1('0xa')](),controller['describe']);router['get']('/:id',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xd')]);router[_0x7ea1('0xe')]('/',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xf')]);router[_0x7ea1('0x10')](_0x7ea1('0x11'),auth[_0x7ea1('0xa')](),controller[_0x7ea1('0x12')]);router[_0x7ea1('0x13')](_0x7ea1('0x11'),auth[_0x7ea1('0xa')](),controller[_0x7ea1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xea57=['isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get'];(function(_0x2fdd67,_0x50aefa){var _0x5e3655=function(_0x4055c1){while(--_0x4055c1){_0x2fdd67['push'](_0x2fdd67['shift']());}};_0x5e3655(++_0x50aefa);}(_0xea57,0x124));var _0x7ea5=function(_0x18eaff,_0x4e3865){_0x18eaff=_0x18eaff-0x0;var _0x2571ff=_0xea57[_0x18eaff];return _0x2571ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7ea5('0x0'));var timeout=require('connect-timeout');var express=require(_0x7ea5('0x1'));var router=express[_0x7ea5('0x2')]();var fs_extra=require(_0x7ea5('0x3'));var auth=require(_0x7ea5('0x4'));var interaction=require(_0x7ea5('0x5'));var config=require('../../config/environment');var controller=require(_0x7ea5('0x6'));router[_0x7ea5('0x7')]('/',auth[_0x7ea5('0x8')](),controller[_0x7ea5('0x9')]);router[_0x7ea5('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7ea5('0xa')]);router[_0x7ea5('0x7')](_0x7ea5('0xb'),auth[_0x7ea5('0x8')](),controller[_0x7ea5('0xc')]);router[_0x7ea5('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ea5('0xe')]);router[_0x7ea5('0xf')](_0x7ea5('0xb'),auth[_0x7ea5('0x8')](),controller[_0x7ea5('0x10')]);router[_0x7ea5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7ea5('0x12')]);module[_0x7ea5('0x13')]=router;
\ No newline at end of file
index e81a90e..7f0f501 100644 (file)
@@ -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}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/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(_0x4c3fbc,_0x96541b){var _0x1d33d0=function(_0x2a64fd){while(--_0x2a64fd){_0x4c3fbc['push'](_0x4c3fbc['shift']());}};_0x1d33d0(++_0x96541b);}(_0xb821,0xa7));var _0x1b82=function(_0x2c814b,_0x85ca59){_0x2c814b=_0x2c814b-0x0;var _0xbd4f5a=_0xb821[_0x2c814b];return _0xbd4f5a;};'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 _0x17ba=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x531700,_0xc52598){var _0x4e1068=function(_0x3027f6){while(--_0x3027f6){_0x531700['push'](_0x531700['shift']());}};_0x4e1068(++_0xc52598);}(_0x17ba,0xab));var _0xa17b=function(_0x4303c7,_0x3fc32d){_0x4303c7=_0x4303c7-0x0;var _0x5f2710=_0x17ba[_0x4303c7];return _0x5f2710;};'use strict';var Sequelize=require(_0xa17b('0x0'));var rs=require(_0xa17b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'unique':_0xa17b('0x3')},'description':{'type':Sequelize[_0xa17b('0x2')]},'mapKey':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'key':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x5')},'customerAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa17b('0x2')]},'animation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0xb'),_0xa17b('0xc')),'defaultValue':_0xa17b('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xd')},'start_chat_button':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'header_offline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x10')},'download_transcript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa17b('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'skipMessageButton':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'conditionAgreement':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x16')},'ratingType':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0x17'),'thumb'),'defaultValue':_0xa17b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':function(){return JSON[_0xa17b('0x18')]({'items':[{'type':_0xa17b('0x19'),'variable':null,'config':{'placeholder':_0xa17b('0x1a'),'type':'text','required':!![]},'props':{'title':_0xa17b('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xa17b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa17b('0x1b'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x1b'))):{};},'set':function(_0x3c32a5){return this[_0xa17b('0x1e')]('onlineForm',JSON['stringify'](_0x3c32a5));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa17b('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null},{'type':_0xa17b('0x1f'),'config':{'placeholder':_0xa17b('0x20')},'props':{'title':_0xa17b('0x20'),'helpText':_0xa17b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xa17b('0x1d')](_0xa17b('0x22'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x22'))):{};},'set':function(_0x2dc1f2){return this[_0xa17b('0x1e')]('offlineForm',JSON['stringify'](_0x2dc1f2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa17b('0x23')]();}},'autoclose':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa17b('0x2')]},'forwardOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa17b('0x2')]},'waitingTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x24')},'offlineMessageBody':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa17b('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa17b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa17b('0x26');}},'notificationSound':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x27')},'verticalAlignment':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa17b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x28')},'systemAvatar':{'type':Sequelize[_0xa17b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa17b('0x8')],'comment':_0xa17b('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x468c92){if(!_0x468c92)this[_0xa17b('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa17b('0x1e')](_0xa17b('0x2a'),_0x468c92);}},'vidaooEscalation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa17b('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xa17b('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index f31b42b..d96d06b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ef=['../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','join','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','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','ChatApplication','Applications','account','applications','list','priority','asc','from','contact','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','remove','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','render','verticalAlignment','color','textColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','path','lodash','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg'];(function(_0x528d0a,_0x221b66){var _0x3482a3=function(_0x3e4a14){while(--_0x3e4a14){_0x528d0a['push'](_0x528d0a['shift']());}};_0x3482a3(++_0x221b66);}(_0xd7ef,0xbe));var _0xfd7e=function(_0x3056d4,_0x540d49){_0x3056d4=_0x3056d4-0x0;var _0xf66ece=_0xd7ef[_0x3056d4];return _0xf66ece;};'use strict';var BPromise=require(_0xfd7e('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfd7e('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd7e('0x2'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xfd7e('0x3'))['db'];config[_0xfd7e('0x4')]=_[_0xfd7e('0x5')](config[_0xfd7e('0x4')],{'host':_0xfd7e('0x6'),'port':0x18eb});var socket=require(_0xfd7e('0x7'))(new Redis(config[_0xfd7e('0x4')]));require(_0xfd7e('0x8'))[_0xfd7e('0x9')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xfd7e('0xa'));var client=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232c});var client9002=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232a});var client9003=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232b});var client9001=jayson['client'][_0xfd7e('0xc')]({'port':0x2329});function respondWithRpcPromise(_0x34a9ba,_0x4eeffc,_0x2f2408,_0x12409f){return new BPromise(function(_0x315980,_0xb740ae){var _0x1283e4=_0x12409f||client;return _0x1283e4[_0xfd7e('0xd')](_0x34a9ba,_0x2f2408)[_0xfd7e('0xe')](function(_0x3aa27f){logger[_0xfd7e('0xf')](_0xfd7e('0x10'),_0x4eeffc,_0xfd7e('0x11'));logger['debug'](_0xfd7e('0x12'),_0x4eeffc,_0xfd7e('0x11'),JSON[_0xfd7e('0x13')](_0x3aa27f));if(_0x3aa27f[_0xfd7e('0x14')]){if(_0x3aa27f['error'][_0xfd7e('0x15')]===0x1f4){logger[_0xfd7e('0x14')](_0xfd7e('0x10'),_0x4eeffc,_0x3aa27f['error'][_0xfd7e('0x16')]);return _0xb740ae(_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);}logger[_0xfd7e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4eeffc,_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);return _0x315980(_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);}else{logger[_0xfd7e('0xf')](_0xfd7e('0x10'),_0x4eeffc,_0xfd7e('0x11'));_0x315980(_0x3aa27f[_0xfd7e('0x17')][_0xfd7e('0x16')]);}})[_0xfd7e('0x18')](function(_0x33376f){logger[_0xfd7e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4eeffc,_0x33376f);_0xb740ae(_0x33376f);});});}function respondWithStatusCode(_0x2dac76,_0x40545a){_0x40545a=_0x40545a||0xcc;return function(_0xa17e42){if(_0xa17e42){return _0x2dac76[_0xfd7e('0x19')](_0x40545a);}return _0x2dac76[_0xfd7e('0x1a')](_0x40545a)[_0xfd7e('0x1b')]();};}function respondWithResult(_0x56a12c,_0x2b235e){_0x2b235e=_0x2b235e||0xc8;return function(_0x553edd){if(_0x553edd){return _0x56a12c[_0xfd7e('0x1a')](_0x2b235e)[_0xfd7e('0x1c')](_0x553edd);}};}function respondWithFilteredResult(_0x4b854d,_0x1b3d4d){return function(_0x539598){if(_0x539598){var _0x445ce9=typeof _0x1b3d4d['offset']===_0xfd7e('0x1d')&&typeof _0x1b3d4d[_0xfd7e('0x1e')]===_0xfd7e('0x1d');var _0x286908=_0x539598[_0xfd7e('0x1f')];var _0x411320=_0x445ce9?0x0:_0x1b3d4d[_0xfd7e('0x20')];var _0x51631f=_0x445ce9?_0x539598[_0xfd7e('0x1f')]:_0x1b3d4d[_0xfd7e('0x20')]+_0x1b3d4d[_0xfd7e('0x1e')];var _0xdb73b5;if(_0x51631f>=_0x286908){_0x51631f=_0x286908;_0xdb73b5=0xc8;}else{_0xdb73b5=0xce;}_0x4b854d[_0xfd7e('0x1a')](_0xdb73b5);return _0x4b854d[_0xfd7e('0x21')]('Content-Range',_0x411320+'-'+_0x51631f+'/'+_0x286908)[_0xfd7e('0x1c')](_0x539598);}return null;};}function saveUpdates(_0x14dff8){return function(_0x1c265f){if(_0x1c265f){return _0x1c265f[_0xfd7e('0x22')](_0x14dff8)[_0xfd7e('0xe')](function(_0x36c2ba){return _0x36c2ba;});}return null;};}function removeEntity(_0x5d9340){return function(_0x2da789){if(_0x2da789){return _0x2da789['destroy']()[_0xfd7e('0xe')](function(){var _0x1676a3=_0x2da789[_0xfd7e('0x23')]({'plain':!![]});var _0x10a78d=_0xfd7e('0x24');return db[_0xfd7e('0x25')][_0xfd7e('0x26')]({'where':{'type':_0x10a78d,'resourceId':_0x1676a3['id']}})[_0xfd7e('0xe')](function(){return _0x2da789;});})[_0xfd7e('0xe')](function(){_0x5d9340['status'](0xcc)[_0xfd7e('0x1b')]();});}};}function handleEntityNotFound(_0x55ad7c){return function(_0x3a9f99){if(!_0x3a9f99){_0x55ad7c[_0xfd7e('0x19')](0x194);}return _0x3a9f99;};}function handleError(_0x559d2d,_0x34b8c9){_0x34b8c9=_0x34b8c9||0x1f4;return function(_0x3e5327){logger[_0xfd7e('0x14')](_0x3e5327[_0xfd7e('0x27')]);if(_0x3e5327[_0xfd7e('0x28')]){delete _0x3e5327[_0xfd7e('0x28')];}_0x559d2d[_0xfd7e('0x1a')](_0x34b8c9)['send'](_0x3e5327);};}exports[_0xfd7e('0x29')]=function(_0x5f2886,_0xe6fff){var _0x5c77b9={'include':[{'model':db[_0xfd7e('0x2a')],'as':_0xfd7e('0x2b')}]},_0x21fc66={},_0x2bc81a={'count':0x0,'rows':[]};var _0x30eaaf=_[_0xfd7e('0x2c')](db[_0xfd7e('0x2d')]['rawAttributes'],function(_0x525af4){return{'name':_0x525af4[_0xfd7e('0x2e')],'type':_0x525af4[_0xfd7e('0x2f')]['key']};});_0x21fc66['model']=_[_0xfd7e('0x2c')](_0x30eaaf,_0xfd7e('0x28'));_0x21fc66['query']=_[_0xfd7e('0x30')](_0x5f2886['query']);_0x21fc66[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x21fc66[_0xfd7e('0x33')],_0x21fc66['query']);_0x5c77b9[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x21fc66[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x5f2886[_0xfd7e('0x36')]['fields']));_0x5c77b9[_0xfd7e('0x34')]=_0x5c77b9[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x5c77b9[_0xfd7e('0x34')]:_0x21fc66[_0xfd7e('0x33')];if(!_0x5f2886['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x5c77b9['limit']=qs['limit'](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x5c77b9[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x5c77b9[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x5c77b9['where']=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x5f2886[_0xfd7e('0x36')],_0x21fc66['filters']),_0x30eaaf);if(_0x5f2886[_0xfd7e('0x36')]['filter']){_0x5c77b9[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x5c77b9[_0xfd7e('0x3d')],{'$or':_[_0xfd7e('0x2c')](_0x30eaaf,function(_0x1f609d){if(_0x1f609d[_0xfd7e('0x2f')]!=='VIRTUAL'){var _0x3fa8dc={};_0x3fa8dc[_0x1f609d[_0xfd7e('0x28')]]={'$like':'%'+_0x5f2886[_0xfd7e('0x36')]['filter']+'%'};return _0x3fa8dc;}})});}_0x5c77b9=_[_0xfd7e('0x3e')]({},_0x5c77b9,_0x5f2886[_0xfd7e('0x3f')]);var _0x331f60={'where':_0x5c77b9[_0xfd7e('0x3d')]};return db[_0xfd7e('0x2d')]['count'](_0x331f60)[_0xfd7e('0xe')](function(_0x564cfe){_0x2bc81a['count']=_0x564cfe;if(_0x5f2886['query'][_0xfd7e('0x40')]){_0x5c77b9[_0xfd7e('0x41')]=[{'all':!![]}];}return db[_0xfd7e('0x2d')][_0xfd7e('0x42')](_0x5c77b9);})[_0xfd7e('0xe')](function(_0x268ced){_0x2bc81a[_0xfd7e('0x43')]=_0x268ced;return _0x2bc81a;})[_0xfd7e('0xe')](respondWithFilteredResult(_0xe6fff,_0x5c77b9))[_0xfd7e('0x18')](handleError(_0xe6fff,null));};exports[_0xfd7e('0x44')]=function(_0x468783,_0x54868d){var _0x3ba999={'raw':![],'where':{'id':_0x468783['params']['id']},'include':[{'model':db[_0xfd7e('0x2a')],'as':'mandatoryDispositionPause'}]},_0x18454b={};_0x18454b['model']=_[_0xfd7e('0x30')](db['ChatWebsite'][_0xfd7e('0x45')]);_0x18454b[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x468783[_0xfd7e('0x36')]);_0x18454b[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x18454b[_0xfd7e('0x33')],_0x18454b[_0xfd7e('0x36')]);_0x3ba999[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x18454b[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x468783[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x3ba999['attributes']=_0x3ba999[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x3ba999[_0xfd7e('0x34')]:_0x18454b[_0xfd7e('0x33')];if(_0x468783[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x3ba999['include']=[{'all':!![]}];}_0x3ba999=_[_0xfd7e('0x3e')]({},_0x3ba999,_0x468783[_0xfd7e('0x3f')]);return db[_0xfd7e('0x2d')][_0xfd7e('0x46')](_0x3ba999)[_0xfd7e('0xe')](handleEntityNotFound(_0x54868d,null))[_0xfd7e('0xe')](respondWithResult(_0x54868d,null))['catch'](handleError(_0x54868d,null));};exports[_0xfd7e('0x47')]=function(_0x4b655f,_0x3d3709){return db[_0xfd7e('0x2d')]['create'](_0x4b655f[_0xfd7e('0x48')],{})[_0xfd7e('0xe')](function(_0x28a199){var _0x3a8138=_0x4b655f[_0xfd7e('0x49')][_0xfd7e('0x23')]({'plain':!![]});if(!_0x3a8138)throw new Error(_0xfd7e('0x4a'));if(_0x3a8138[_0xfd7e('0x4b')]===_0xfd7e('0x49')){var _0x513dd4=_0x28a199['get']({'plain':!![]});var _0x21bafc='ChatWebsites';return db[_0xfd7e('0x4c')]['find']({'where':{'name':_0x21bafc,'userProfileId':_0x3a8138[_0xfd7e('0x4d')]},'raw':!![]})['then'](function(_0x4e7b17){if(_0x4e7b17&&_0x4e7b17[_0xfd7e('0x4e')]===0x0){return db[_0xfd7e('0x25')]['create']({'name':_0x513dd4['name'],'resourceId':_0x513dd4['id'],'type':_0x4e7b17['name'],'sectionId':_0x4e7b17['id']},{})[_0xfd7e('0xe')](function(){return _0x28a199;});}else{return _0x28a199;}})[_0xfd7e('0x18')](function(_0x55601b){logger[_0xfd7e('0x14')](_0xfd7e('0x4f'),_0x55601b);throw _0x55601b;});}return _0x28a199;})[_0xfd7e('0xe')](respondWithResult(_0x3d3709,0xc9))[_0xfd7e('0x18')](handleError(_0x3d3709,null));};exports[_0xfd7e('0x22')]=function(_0x216264,_0xfb38e){if(_0x216264['body']['id']){delete _0x216264[_0xfd7e('0x48')]['id'];}return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x216264['params']['id']},'include':[{'model':db[_0xfd7e('0x2a')],'as':_0xfd7e('0x2b')}]})[_0xfd7e('0xe')](handleEntityNotFound(_0xfb38e,null))[_0xfd7e('0xe')](saveUpdates(_0x216264['body'],null))[_0xfd7e('0xe')](respondWithResult(_0xfb38e,null))[_0xfd7e('0x18')](handleError(_0xfb38e,null));};exports['destroy']=function(_0x347076,_0x3240a9){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x347076[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x3240a9,null))[_0xfd7e('0xe')](removeEntity(_0x3240a9,null))[_0xfd7e('0x18')](handleError(_0x3240a9,null));};exports[_0xfd7e('0x51')]=function(_0x1d4ffd,_0x2b6808){return db[_0xfd7e('0x2d')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](respondWithResult(_0x2b6808,null))[_0xfd7e('0x18')](handleError(_0x2b6808,null));};exports[_0xfd7e('0x52')]=function(_0x2cfb6c,_0x46f025){if(_0x2cfb6c[_0xfd7e('0x48')]['id']){delete _0x2cfb6c[_0xfd7e('0x48')]['id'];}return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x2cfb6c[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x46f025,null))[_0xfd7e('0xe')](function(_0x400198){if(_0x400198){_0x2cfb6c[_0xfd7e('0x48')][_0xfd7e('0x53')]=_0x400198['id'];return db[_0xfd7e('0x54')][_0xfd7e('0x47')](_0x2cfb6c[_0xfd7e('0x48')]);}})['then'](respondWithResult(_0x46f025,null))[_0xfd7e('0x18')](handleError(_0x46f025,null));};exports['getDispositions']=function(_0x1d34e4,_0x15cac5){var _0xbd331a={'raw':![],'where':{}};var _0x3604e4={};var _0x227922={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x1d34e4[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x15cac5,null))['then'](function(_0xf07ad4){if(_0xf07ad4){_0x3604e4[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['Disposition'][_0xfd7e('0x45')]);_0x3604e4[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x1d34e4['query']);_0x3604e4['filters']=_[_0xfd7e('0x32')](_0x3604e4['model'],_0x3604e4[_0xfd7e('0x36')]);_0xbd331a['attributes']=_[_0xfd7e('0x32')](_0x3604e4[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0xbd331a['attributes']=_0xbd331a['attributes'][_0xfd7e('0x37')]?_0xbd331a[_0xfd7e('0x34')]:_0x3604e4[_0xfd7e('0x33')];if(!_0x1d34e4['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0xbd331a[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0xbd331a[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x1d34e4[_0xfd7e('0x36')]['offset']);}_0xbd331a[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0xbd331a[_0xfd7e('0x3d')]=qs['filters'](_[_0xfd7e('0x3c')](_0x1d34e4[_0xfd7e('0x36')],_0x3604e4[_0xfd7e('0x31')]));_0xbd331a[_0xfd7e('0x3d')]['ChatWebsiteId']=_0xf07ad4['id'];if(_0x1d34e4['query']['filter']){_0xbd331a[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0xbd331a['where'],{'$or':_['map'](_0xbd331a[_0xfd7e('0x34')],function(_0xd6ea7f){var _0x51cade={};_0x51cade[_0xd6ea7f]={'$like':'%'+_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x51cade;})});}_0xbd331a=_[_0xfd7e('0x3e')]({},_0xbd331a,_0x1d34e4[_0xfd7e('0x3f')]);return db[_0xfd7e('0x54')][_0xfd7e('0x1f')]({'where':_0xbd331a['where']})['then'](function(_0x1fa5d9){_0x227922[_0xfd7e('0x1f')]=_0x1fa5d9;if(_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0xbd331a['include']=[{'all':!![]}];}return db['Disposition'][_0xfd7e('0x42')](_0xbd331a);})['then'](function(_0x20bbae){_0x227922[_0xfd7e('0x43')]=_0x20bbae;return _0x227922;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x15cac5,_0xbd331a))[_0xfd7e('0x18')](handleError(_0x15cac5,null));};exports[_0xfd7e('0x56')]=function(_0x3e93a1,_0x12bc93){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x3e93a1[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x12bc93,null))[_0xfd7e('0xe')](function(_0x38138e){if(_0x38138e){return _0x38138e[_0xfd7e('0x56')](_0x3e93a1[_0xfd7e('0x36')]['ids']);}})[_0xfd7e('0xe')](respondWithStatusCode(_0x12bc93,null))['catch'](handleError(_0x12bc93,null));};exports[_0xfd7e('0x57')]=function(_0x311aae,_0x1424dc){if(_0x311aae['body']['id']){delete _0x311aae['body']['id'];}return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x311aae['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x1424dc,null))[_0xfd7e('0xe')](function(_0x50fb28){if(_0x50fb28){_0x311aae[_0xfd7e('0x48')][_0xfd7e('0x53')]=_0x50fb28['id'];return db[_0xfd7e('0x58')][_0xfd7e('0x47')](_0x311aae[_0xfd7e('0x48')]);}})[_0xfd7e('0xe')](respondWithResult(_0x1424dc,null))[_0xfd7e('0x18')](handleError(_0x1424dc,null));};exports[_0xfd7e('0x59')]=function(_0x46ba2a,_0x3b8b0b){var _0x311b41={'raw':![],'where':{}};var _0x486e22={};var _0x366e65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfd7e('0x5a')]({'where':{'id':_0x46ba2a[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x3b8b0b,null))[_0xfd7e('0xe')](function(_0x4a5f76){if(_0x4a5f76){_0x486e22[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0x58')][_0xfd7e('0x45')]);_0x486e22['query']=_[_0xfd7e('0x30')](_0x46ba2a[_0xfd7e('0x36')]);_0x486e22['filters']=_[_0xfd7e('0x32')](_0x486e22['model'],_0x486e22[_0xfd7e('0x36')]);_0x311b41[_0xfd7e('0x34')]=_['intersection'](_0x486e22[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x46ba2a[_0xfd7e('0x36')]['fields']));_0x311b41[_0xfd7e('0x34')]=_0x311b41['attributes'][_0xfd7e('0x37')]?_0x311b41[_0xfd7e('0x34')]:_0x486e22[_0xfd7e('0x33')];if(!_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x311b41[_0xfd7e('0x1e')]=qs['limit'](_0x46ba2a[_0xfd7e('0x36')]['limit']);_0x311b41[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x311b41['order']=qs[_0xfd7e('0x3b')](_0x46ba2a['query'][_0xfd7e('0x3b')]);_0x311b41[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x46ba2a[_0xfd7e('0x36')],_0x486e22['filters']));_0x311b41[_0xfd7e('0x3d')]['ChatWebsiteId']=_0x4a5f76['id'];if(_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x311b41[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x311b41[_0xfd7e('0x3d')],{'$or':_['map'](_0x311b41[_0xfd7e('0x34')],function(_0x21d178){var _0x53e6ee={};_0x53e6ee[_0x21d178]={'$like':'%'+_0x46ba2a[_0xfd7e('0x36')]['filter']+'%'};return _0x53e6ee;})});}_0x311b41=_[_0xfd7e('0x3e')]({},_0x311b41,_0x46ba2a[_0xfd7e('0x3f')]);return db[_0xfd7e('0x58')]['count']({'where':_0x311b41[_0xfd7e('0x3d')]})['then'](function(_0x63fc32){_0x366e65['count']=_0x63fc32;if(_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x311b41[_0xfd7e('0x41')]=[{'all':!![]}];}return db[_0xfd7e('0x58')][_0xfd7e('0x42')](_0x311b41);})[_0xfd7e('0xe')](function(_0xd25ffc){_0x366e65[_0xfd7e('0x43')]=_0xd25ffc;return _0x366e65;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x3b8b0b,_0x311b41))[_0xfd7e('0x18')](handleError(_0x3b8b0b,null));};exports[_0xfd7e('0x5b')]=function(_0x4ac263,_0x5a645e){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x4ac263[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a645e,null))[_0xfd7e('0xe')](function(_0x2512ca){if(_0x2512ca){return _0x2512ca[_0xfd7e('0x5b')](_0x4ac263[_0xfd7e('0x36')][_0xfd7e('0x5c')]);}})['then'](respondWithStatusCode(_0x5a645e,null))[_0xfd7e('0x18')](handleError(_0x5a645e,null));};exports[_0xfd7e('0x5d')]=function(_0x5aa961,_0x41b36f){_0x5aa961[_0xfd7e('0x48')][_0xfd7e('0x5e')]=_0x5aa961[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x5aa961[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x41b36f,null))['then'](saveUpdates(_0x5aa961['body'],null))[_0xfd7e('0xe')](respondWithResult(_0x41b36f,null))[_0xfd7e('0x18')](handleError(_0x41b36f,null));};exports[_0xfd7e('0x61')]=function(_0x1a8495,_0x4116fd){_0x1a8495[_0xfd7e('0x48')][_0xfd7e('0x62')]=_0x1a8495['file'][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x1a8495[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x4116fd,null))[_0xfd7e('0xe')](saveUpdates(_0x1a8495[_0xfd7e('0x48')],null))[_0xfd7e('0xe')](respondWithResult(_0x4116fd,null))[_0xfd7e('0x18')](handleError(_0x4116fd,null));};exports[_0xfd7e('0x63')]=function(_0x4be5a5,_0x18a5bd){_0x4be5a5['body'][_0xfd7e('0x64')]=_0x4be5a5[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x4be5a5[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x18a5bd,null))[_0xfd7e('0xe')](saveUpdates(_0x4be5a5['body'],null))[_0xfd7e('0xe')](respondWithResult(_0x18a5bd,null))[_0xfd7e('0x18')](handleError(_0x18a5bd,null));};exports[_0xfd7e('0x65')]=function(_0x3ccd01,_0x335a44){_0x3ccd01[_0xfd7e('0x48')][_0xfd7e('0x66')]=_0x3ccd01[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x3ccd01[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x335a44,null))[_0xfd7e('0xe')](saveUpdates(_0x3ccd01[_0xfd7e('0x48')],null))[_0xfd7e('0xe')](respondWithResult(_0x335a44,null))[_0xfd7e('0x18')](handleError(_0x335a44,null));};exports[_0xfd7e('0x67')]=function(_0x47d5a5,_0x2ec31d){var _0x2fda98=path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x69'));var _0x3e2f23={'where':{'id':_0x47d5a5[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x5e')],'raw':!![]};var _0x3798fa=![];return require(_0xfd7e('0x6a'))[_0xfd7e('0x6b')]()['then'](function(_0x30fa45){if(_0x30fa45){_0x3798fa=_0x30fa45[_0xfd7e('0x6c')];}})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')]['find'](_0x3e2f23);})[_0xfd7e('0xe')](handleEntityNotFound(_0x2ec31d,null))[_0xfd7e('0xe')](function(_0x26dfaf){if(_0x26dfaf){if(!_[_0xfd7e('0x6d')](_0x26dfaf[_0xfd7e('0x5e')])){if(fs[_0xfd7e('0x6e')](path['join'](config['root'],'server/files/images/logos/',_0x26dfaf[_0xfd7e('0x5e')]))&&_0x3798fa){_0x2fda98=path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x6f'),_0x26dfaf['sitepic']);}}return _0x2ec31d[_0xfd7e('0x70')](_0x2fda98);}})[_0xfd7e('0x18')](handleError(_0x2ec31d,null));};exports[_0xfd7e('0x71')]=function(_0x1afc8a,_0x2df43d){var _0x4ba546=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x73'));var _0x985dd3={'where':{'id':_0x1afc8a['params']['id']},'attributes':['id',_0xfd7e('0x62')],'raw':!![]};return db[_0xfd7e('0x2d')]['find'](_0x985dd3)['then'](handleEntityNotFound(_0x2df43d,null))['then'](function(_0x442553){if(_0x442553){if(!_[_0xfd7e('0x6d')](_0x442553[_0xfd7e('0x62')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config['root'],_0xfd7e('0x74'),_0x442553[_0xfd7e('0x62')]))){_0x4ba546=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x442553[_0xfd7e('0x62')]);}}return _0x2df43d[_0xfd7e('0x70')](_0x4ba546);}})[_0xfd7e('0x18')](handleError(_0x2df43d,null));};exports[_0xfd7e('0x75')]=function(_0x187055,_0xbcdbb2){var _0x5d196d=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],'server/files/images/avatars/customer_avatar.png');var _0x248604={'where':{'id':_0x187055[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x64'),_0xfd7e('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0x248604)['then'](handleEntityNotFound(_0xbcdbb2,null))[_0xfd7e('0xe')](function(_0x28d152){if(_0x28d152){if(!_[_0xfd7e('0x6d')](_0x28d152[_0xfd7e('0x64')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config['root'],_0xfd7e('0x74'),_0x28d152['customerAvatar']))&&_0x28d152['showCustomerAvatar']){_0x5d196d=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x28d152[_0xfd7e('0x64')]);}}return _0xbcdbb2[_0xfd7e('0x70')](_0x5d196d);}})[_0xfd7e('0x18')](handleError(_0xbcdbb2,null));};exports[_0xfd7e('0x77')]=function(_0x50bdd7,_0x2cc202){var _0x7d5d90=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x78'));var _0x668826={'where':{'id':_0x50bdd7[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x66')],'raw':!![]};return db['ChatWebsite'][_0xfd7e('0x46')](_0x668826)[_0xfd7e('0xe')](handleEntityNotFound(_0x2cc202,null))[_0xfd7e('0xe')](function(_0x238ecf){if(_0x238ecf){if(!_[_0xfd7e('0x6d')](_0x238ecf[_0xfd7e('0x66')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],'server/files/images/avatars/',_0x238ecf[_0xfd7e('0x66')]))){_0x7d5d90=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x238ecf[_0xfd7e('0x66')]);}}return _0x2cc202['download'](_0x7d5d90);}})[_0xfd7e('0x18')](handleError(_0x2cc202,null));};exports[_0xfd7e('0x79')]=function(_0x17f356,_0x27bd7f){var _0x3c615c=require(_0xfd7e('0x7a'));var _0x89867c=new _0x3c615c();var _0xb41d9=_0x89867c[_0xfd7e('0x7b')](_0x17f356['headers'][_0xfd7e('0x7c')])[_0xfd7e('0x7d')]();var _0x358456={'body':_0x17f356[_0xfd7e('0x48')],'channel':_0xfd7e('0x7e')};var _0x235b27=[];var _0x1768c4=[];var _0x1ba4f3={};var _0x130890=![];return db[_0xfd7e('0x7f')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](function(_0x2b490d){if(!_0x2b490d){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x82'));}_0x235b27=_['difference'](_[_0xfd7e('0x30')](_0x2b490d),['createdAt',_0xfd7e('0x83')]);_0x1768c4=_['difference'](_['keys'](_0x2b490d),[_0xfd7e('0x84'),_0xfd7e('0x83'),_0xfd7e('0x85'),_0xfd7e('0x86')]);if(_0x17f356[_0xfd7e('0x48')]['id']){delete _0x17f356[_0xfd7e('0x48')]['id'];}if(_[_0xfd7e('0x6d')](_0x17f356[_0xfd7e('0x48')]['from'])){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x87'));}if(_[_0xfd7e('0x6d')](_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x48')])||_0x17f356[_0xfd7e('0x48')]['body']===''){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x88'));}if(_['isNil'](_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')])){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x8a')+_0x1768c4);}if(!_[_0xfd7e('0x8b')](_0x1768c4,_0x17f356[_0xfd7e('0x48')]['mapKey'])){throw new db['Sequelize'][(_0xfd7e('0x81'))](_0xfd7e('0x8c')+_0x1768c4);}_0x1ba4f3[_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')]]=_0x17f356[_0xfd7e('0x48')]['from'];})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x17f356[_0xfd7e('0x50')]['id']},'include':[{'model':db[_0xfd7e('0x8d')],'as':_0xfd7e('0x8e'),'include':[{'model':db[_0xfd7e('0x7f')],'as':_0xfd7e('0x8f'),'where':_0x1ba4f3,'limit':0x1,'order':[[_0xfd7e('0x83'),'DESC']]}]},{'model':db[_0xfd7e('0x90')],'as':_0xfd7e('0x91')}]});})[_0xfd7e('0xe')](handleEntityNotFound(_0x27bd7f,null))['then'](function(_0x18e751){if(_0x18e751&&_0x18e751[_0xfd7e('0x8e')]){_0x358456[_0xfd7e('0x92')]=_0x18e751;_0x358456[_0xfd7e('0x93')]=_0x18e751[_0xfd7e('0x91')];_0x358456[_0xfd7e('0x94')]=_0x18e751[_0xfd7e('0x8e')];_0x358456[_0xfd7e('0x93')]=_['orderBy'](_0x358456[_0xfd7e('0x93')],[_0xfd7e('0x95')],[_0xfd7e('0x96')]);if(_0x358456[_0xfd7e('0x92')][_0xfd7e('0x91')]){delete _0x358456[_0xfd7e('0x92')]['Applications'];}if(_0x358456[_0xfd7e('0x92')][_0xfd7e('0x8e')]&&_0x358456['account'][_0xfd7e('0x8e')]['Contacts'][_0xfd7e('0x37')]){return _0x358456[_0xfd7e('0x92')][_0xfd7e('0x8e')]['Contacts'][0x0];}var _0x993501=_[_0xfd7e('0x5')](_0x17f356[_0xfd7e('0x48')],{'firstName':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x97')],'ListId':_0x18e751['ListId']});_0x993501[_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')]]=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x97')];return db['CmContact'][_0xfd7e('0x47')](_0x993501,{'fields':_0x235b27,'raw':!![]});}})[_0xfd7e('0xe')](handleEntityNotFound(_0x27bd7f,null))[_0xfd7e('0xe')](function(_0x21c803){_0x358456[_0xfd7e('0x98')]=_0x21c803;var _0x40cea7=_0x17f356[_0xfd7e('0x48')]['customerIp'];if(_0x17f356[_0xfd7e('0x99')]['cf-connecting-ip']){_0x40cea7=_0x17f356[_0xfd7e('0x99')]['cf-connecting-ip'];}else if(_0x17f356['headers'][_0xfd7e('0x9a')]){_0x40cea7=_[_0xfd7e('0x9b')](_0x17f356['headers'][_0xfd7e('0x9a')][_0xfd7e('0x9c')](','));}if(_0x21c803){var _0x257805={'ContactId':_0x21c803['id'],'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'from':(_0x21c803[_0xfd7e('0x9d')]||'')+'\x20'+(_0x21c803[_0xfd7e('0x9e')]||''),'customerIp':_0x40cea7,'customerPort':_0x17f356[_0xfd7e('0x99')][_0xfd7e('0x9f')]?_0x17f356['headers'][_0xfd7e('0x9f')]:null,'referer':_0x17f356['body'][_0xfd7e('0xa0')],'browserName':_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0x28')]&&_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0xa2')]?util[_0xfd7e('0xa3')](_0xfd7e('0xa4'),_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0x28')],_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0xa2')]):'unknown','browserVersion':_0xb41d9['browser'][_0xfd7e('0xa2')]||_0xfd7e('0xa5'),'osName':util['format'](_0xfd7e('0xa4'),_0xb41d9['os'][_0xfd7e('0x28')],_0xb41d9['os']['version']),'osVersion':_0xb41d9['os'][_0xfd7e('0xa2')],'deviceModel':_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0x33')]&&_0xb41d9[_0xfd7e('0xa6')]['vendor']?util[_0xfd7e('0xa3')](_0xfd7e('0xa7'),_0xb41d9['device'][_0xfd7e('0x33')],_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0xa8')],_0xb41d9[_0xfd7e('0xa6')]['type']):null,'deviceVendor':_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0xa8')],'deviceType':_0xb41d9[_0xfd7e('0xa6')]['type'],'formData':JSON['stringify'](_0x17f356[_0xfd7e('0x48')])};var _0x5db71f={'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'closed':![]};if(_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xa9')]){_0x5db71f[_0xfd7e('0xa9')]=_0x17f356['body'][_0xfd7e('0xa9')];return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':_0x5db71f})['then'](function(_0x59f77d){if(_0x59f77d){return[_0x59f77d,![]];}_0x257805[_0xfd7e('0xa9')]=_0x17f356['body'][_0xfd7e('0xa9')];_0x257805[_0xfd7e('0xab')]=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xab')];return db[_0xfd7e('0xaa')]['create'](_0x257805)[_0xfd7e('0xe')](function(_0x13e762){return[_0x13e762,!![]];});});}_0x5db71f[_0xfd7e('0xac')]=_0x21c803['id'];if(_0x17f356['body']['interaction']&&_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xad')]['id']){_0x5db71f['id']=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xad')]['id'];return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':_0x5db71f})[_0xfd7e('0xe')](function(_0x5f4d2d){if(_0x5f4d2d){return[_0x5f4d2d,![]];}return db['ChatInteraction'][_0xfd7e('0x47')](_0x257805)['then'](function(_0x5d1c50){return[_0x5d1c50,!![]];});});}return db[_0xfd7e('0xaa')][_0xfd7e('0x47')](_0x257805)['then'](function(_0xa55813){return[_0xa55813,!![]];});}})['spread'](function(_0x28b35c,_0x3c613c){if(_0x28b35c){_0x130890=_0x3c613c;if(!_0x3c613c){var _0x5c2d6b={'from':(_0x358456[_0xfd7e('0x98')]['firstName']||'')+'\x20'+(_0x358456[_0xfd7e('0x98')]['lastName']||'')};if(_0x17f356[_0xfd7e('0x48')]['threadId']&&_0x17f356['body'][_0xfd7e('0xae')]&&_0x17f356['body']['threadId']!=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xae')]){_0x5c2d6b['threadId']=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xae')];}return _0x28b35c[_0xfd7e('0x22')](_0x5c2d6b);}else{return _0x28b35c;}}})[_0xfd7e('0xe')](function(_0x3b4526){_0x358456['interaction']=_0x3b4526[_0xfd7e('0x23')]({'plain':!![]});_0x358456['interaction'][_0xfd7e('0xaf')]=_0x130890;if(_0x358456[_0xfd7e('0xad')][_0xfd7e('0xaf')]){if(_0x358456['account'][_0xfd7e('0xb0')]){_0x358456[_0xfd7e('0x93')][_0xfd7e('0xb1')]({'id':0x0,'priority':_0x358456[_0xfd7e('0x93')][_0xfd7e('0x37')]+0x1,'app':_0xfd7e('0xb2'),'appdata':_0xfd7e('0xb3'),'interval':_0xfd7e('0xb4')});}}return db[_0xfd7e('0xb5')][_0xfd7e('0x47')]({'body':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x48')],'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'ChatInteractionId':_0x3b4526['id'],'direction':'in','ContactId':_0x358456[_0xfd7e('0x98')]['id'],'AttachmentId':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xb6')]});})[_0xfd7e('0xe')](function(_0x3bc153){_0x358456['message']=_0x3bc153;if(_0x358456['interaction']['UserId']){return db[_0xfd7e('0xb7')]['find']({'attributes':['id',_0xfd7e('0x28')],'where':{'id':_0x358456['interaction'][_0xfd7e('0xb8')]}})['then'](function(_0x381fa9){if(_0x381fa9){_0x358456[_0xfd7e('0x93')][_0xfd7e('0xb9')]({'id':0x0,'priority':0x0,'app':_0xfd7e('0xba'),'appdata':_0x381fa9['name']+','+(_0x358456[_0xfd7e('0x92')][_0xfd7e('0xbb')]||0xa),'interval':_0xfd7e('0xb4')});_0x358456[_0xfd7e('0xbc')]=!![];}return respondWithRpcPromise(_0xfd7e('0xbd'),_0xfd7e('0xbe'),_0x358456);});}return respondWithRpcPromise(_0xfd7e('0xbd'),_0xfd7e('0xbe'),_0x358456);})[_0xfd7e('0xe')](function(_0x4a8d09){respondWithRpcPromise(_0xfd7e('0xbf'),_0xfd7e('0xbf'),{'event':_0xfd7e('0x79'),'message':_0x4a8d09},client9002);return _0x4a8d09;})[_0xfd7e('0xe')](respondWithResult(_0x27bd7f,null))[_0xfd7e('0x18')](handleError(_0x27bd7f,null));};exports[_0xfd7e('0xc0')]=function(_0x3b39fa,_0x41a0cf){var _0x24fc7e,_0x184e64,_0x590e99;var _0x422080=[];var _0x3d7d01={};var _0x5693d1=_0x3b39fa[_0xfd7e('0xc1')]||[];var _0xc5ab7d=[];var _0x5a5447;return db[_0xfd7e('0x7f')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](function(_0x1769da){if(!_0x1769da){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x82'));}_0x422080=_[_0xfd7e('0xc2')](_[_0xfd7e('0x30')](_0x1769da),[_0xfd7e('0x84'),_0xfd7e('0x83'),_0xfd7e('0x85'),_0xfd7e('0x86')]);if(_0x3b39fa['body']['id']){delete _0x3b39fa[_0xfd7e('0x48')]['id'];}if(_[_0xfd7e('0x6d')](_0x3b39fa[_0xfd7e('0x48')]['from'])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db['Sequelize'][(_0xfd7e('0x81'))](_0xfd7e('0x87')));}if(_[_0xfd7e('0x6d')](_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')])||_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')]===''){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)['send'](new db[(_0xfd7e('0x80'))]['ValidationError'](_0xfd7e('0x88')));}if(_[_0xfd7e('0x6d')](_0x3b39fa['body'][_0xfd7e('0xc4')])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db[(_0xfd7e('0x80'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x422080));}if(!_['includes'](_0x422080,_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0xc4')])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db['Sequelize']['ValidationError'](_0xfd7e('0xc5')+_0x422080));}_0x3d7d01[_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0xc4')]]=_0x3b39fa['body'][_0xfd7e('0x97')];})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x3b39fa['params']['id']},'include':[{'model':db[_0xfd7e('0x8d')],'as':_0xfd7e('0x8e')},{'model':db[_0xfd7e('0xc6')],'as':_0xfd7e('0xc6')}]});})[_0xfd7e('0xe')](handleEntityNotFound(_0x41a0cf,null))[_0xfd7e('0xe')](function(_0x5d5903){if(_0x5d5903&&_0x5d5903[_0xfd7e('0x8e')]){_0x184e64=_0x5d5903;var _0x5f10f4=_[_0xfd7e('0x5')](_0x3b39fa[_0xfd7e('0x48')],{'firstName':_0x3b39fa['body']['from'],'phone':_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x97')],'ListId':_0x5d5903[_0xfd7e('0x86')]});_0x5f10f4[_0x3b39fa[_0xfd7e('0x48')]['mapKeyOffline']]=_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x97')];return db[_0xfd7e('0x7f')][_0xfd7e('0xc7')]({'where':_0x3d7d01,'defaults':_0x5f10f4});}})[_0xfd7e('0xc8')](function(_0x5b358d){if(_0x5b358d){_0x590e99=_0x5b358d;var _0x3d2c6d=fs['readFileSync'](path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xc9')),_0xfd7e('0xca'));var _0x42fbc2=ejs['render'](_0x3d2c6d,{'body':_[_0xfd7e('0xcb')](_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')]),'bodyTitle':_0x184e64['offlineMessageBody']});return db[_0xfd7e('0xcc')][_0xfd7e('0x47')]({'body':_0x42fbc2,'plainBody':htmlToText[_0xfd7e('0xcd')](_0x42fbc2),'ContactId':_0x5b358d['id'],'ChatWebsiteId':_0x184e64['id']});}})['then'](function(_0x1f9680){_0x5a5447=_0x1f9680;if(_0x5693d1[_0xfd7e('0x37')]){var _0x18bcb7=_0x5693d1[_0xfd7e('0x2c')](function(_0x539de4){return{'name':_0x539de4[_0xfd7e('0xce')],'basename':_0x539de4[_0xfd7e('0x60')],'type':_0x539de4[_0xfd7e('0xcf')],'ChatOfflineMessageId':_0x1f9680['id']};});_0xc5ab7d=_0x18bcb7[_0xfd7e('0x2c')](_0x563a63=>{var _0x5436f1={'filename':_0x563a63[_0xfd7e('0x28')],'path':path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xd0'),_0xfd7e('0xc1'),_0xfd7e('0xd1'),'offline-chat',_0x563a63[_0xfd7e('0xd2')])};return _0x5436f1;});if(!_0x184e64[_0xfd7e('0xd3')]){return db[_0xfd7e('0xd4')][_0xfd7e('0xd5')](function(_0x2f64e1){return db[_0xfd7e('0xd6')]['bulkCreate'](_0x18bcb7,{'transaction':_0x2f64e1});});}}})[_0xfd7e('0xe')](function(){if(_0x5a5447){_0x24fc7e=_0x5a5447;return db[_0xfd7e('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfd7e('0xd7')],'as':_0xfd7e('0xd8'),'raw':!![],'include':[{'model':db[_0xfd7e('0xd9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xfd7e('0xe')](function(_0x3bef4a){if(_0x3bef4a&&_0x3bef4a['Smtp']&&_0x184e64[_0xfd7e('0xda')]&&_0x184e64[_0xfd7e('0xdb')]){var _0x4facf5=_0x3bef4a[_0xfd7e('0xdc')]();return respondWithRpcPromise(_0xfd7e('0xdd'),_0xfd7e('0xde'),{'account':_0x4facf5,'message':{'from':util['format'](_0xfd7e('0xdf'),_0x3bef4a[_0xfd7e('0x28')],_0x3bef4a[_0xfd7e('0xe0')]||_0x3bef4a[_0xfd7e('0xd8')][_0xfd7e('0x49')]),'to':_0x184e64[_0xfd7e('0xdb')],'subject':_0x184e64[_0xfd7e('0xe1')],'html':_0x24fc7e[_0xfd7e('0x48')],'attachments':_0xc5ab7d}},client9003)[_0xfd7e('0xe')](function(){return _0x24fc7e;})[_0xfd7e('0x18')](function(_0x47bc16){logger[_0xfd7e('0x14')](_0x47bc16);});}})['then'](function(){if(_0x184e64&&_0x184e64[_0xfd7e('0xd3')]&&_0x184e64[_0xfd7e('0xe2')]){var _0x5b0c55=[];if(_0x5693d1[_0xfd7e('0x37')]){_0x5b0c55=_0x5693d1['map'](function(_0x346665){return{'name':_0x346665['originalname'],'basename':_0x346665[_0xfd7e('0x60')],'type':_0x346665['mimetype'],'ChatOfflineMessageId':_0x5a5447['id']};});}var _0x262496;if(!_[_0xfd7e('0x6d')](_0x184e64[_0xfd7e('0xe3')])){var _0x417daa=_[_0xfd7e('0x2c')](_0x3b39fa[_0xfd7e('0x48')],function(_0x240dd5){return _0x240dd5;});var _0x2a880c=_[_0xfd7e('0xe4')](_0x417daa)[0x0];var _0xc364c3=_[_0xfd7e('0xe5')](_0x2a880c,function(_0x55b45e){return _0x55b45e;});_0x262496=_0xc364c3[0x1][_0x184e64[_0xfd7e('0xe3')]];}var _0x4e8739={'from':_0x590e99['email'],'firstName':_0x590e99[_0xfd7e('0x9d')],'lastName':_0x590e99[_0xfd7e('0x9e')],'mapKey':_0xfd7e('0xe0'),'message':{'from':_0x590e99[_0xfd7e('0xe0')],'to':_0x184e64['MailAccount'][_0xfd7e('0xe0')],'cc':'','subject':_[_0xfd7e('0x6d')](_0x262496)?_0x184e64[_0xfd7e('0xe1')]:_0x262496,'messageId':'','sentAt':new Date(),'attach':_0x5b0c55[_0xfd7e('0x37')],'attachments':_0x5b0c55,'originChannel':_0xfd7e('0xe6'),'ChatWebsiteId':_0x184e64['id'],'ChatOfflineMessageId':_0x24fc7e['id'],'originTo':_0x184e64['MailAccount'][_0xfd7e('0xe0')]},'body':_0x24fc7e['body']};var _0x480a42={'account':{'id':_0x184e64[_0xfd7e('0xe2')]},'body':_0x4e8739,'log':_0xfd7e('0xe7')};return respondWithRpcPromise(_0xfd7e('0xe7'),'notifyMail',_0x480a42,client9001)[_0xfd7e('0xe')](function(){return _0x24fc7e;})[_0xfd7e('0x18')](function(_0x2d570f){logger[_0xfd7e('0x14')](_0x2d570f);});}return;})[_0xfd7e('0xe')](function(){if(_0x24fc7e){return _0x24fc7e;}})[_0xfd7e('0xe')](respondWithResult(_0x41a0cf,null))[_0xfd7e('0x18')](function(_0x15daa7){logger[_0xfd7e('0x14')]('catch',_0x15daa7);for(var _0x9a7feb of _0x5693d1){var _0x5b7263=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xd0'),'files',_0xfd7e('0xd1'),_0xfd7e('0xe8'),_0x9a7feb[_0xfd7e('0x60')]);fs_extra[_0xfd7e('0xe9')](_0x5b7263)[_0xfd7e('0x18')](function(_0x4692d5){logger[_0xfd7e('0x14')]('Could\x20not\x20remove\x20attachment\x20file',_0x5b7263,_0x4692d5);});}});};exports[_0xfd7e('0xea')]=function(_0x15506e,_0x17569d){return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':{'id':_0x15506e[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x17569d,null))[_0xfd7e('0xe')](function(_0x1c35b4){if(_0x1c35b4){return _0x1c35b4['addInteraction'](_0x15506e['body'][_0xfd7e('0x5c')],_[_0xfd7e('0xeb')](_0x15506e[_0xfd7e('0x48')],['ids','id'])||{});}})[_0xfd7e('0xe')](respondWithResult(_0x17569d,null))[_0xfd7e('0x18')](handleError(_0x17569d,null));};exports[_0xfd7e('0xec')]=function(_0x14c51c,_0x450d1d){var _0x5516f6={'raw':![],'where':{}};var _0x20c65c={};var _0x8707aa={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x14c51c[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x450d1d,null))[_0xfd7e('0xe')](function(_0x39ab89){if(_0x39ab89){_0x20c65c[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0xaa')]['rawAttributes']);_0x20c65c['query']=_['keys'](_0x14c51c[_0xfd7e('0x36')]);_0x20c65c[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x20c65c[_0xfd7e('0x33')],_0x20c65c[_0xfd7e('0x36')]);_0x5516f6[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x20c65c[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x5516f6[_0xfd7e('0x34')]=_0x5516f6[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x5516f6[_0xfd7e('0x34')]:_0x20c65c[_0xfd7e('0x33')];if(!_0x14c51c[_0xfd7e('0x36')]['hasOwnProperty']('nolimit')){_0x5516f6['limit']=qs[_0xfd7e('0x1e')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x5516f6[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x5516f6[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x5516f6[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x14c51c[_0xfd7e('0x36')],_0x20c65c[_0xfd7e('0x31')]));_0x5516f6[_0xfd7e('0x3d')][_0xfd7e('0x53')]=_0x39ab89['id'];if(_0x14c51c['query'][_0xfd7e('0x55')]){_0x5516f6[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x5516f6['where'],{'$or':_[_0xfd7e('0x2c')](_0x5516f6[_0xfd7e('0x34')],function(_0x4c2a5b){var _0x5287ba={};_0x5287ba[_0x4c2a5b]={'$like':'%'+_0x14c51c['query'][_0xfd7e('0x55')]+'%'};return _0x5287ba;})});}_0x5516f6=_[_0xfd7e('0x3e')]({},_0x5516f6,_0x14c51c[_0xfd7e('0x3f')]);return db[_0xfd7e('0xaa')][_0xfd7e('0x1f')]({'where':_0x5516f6['where']})[_0xfd7e('0xe')](function(_0x52105e){_0x8707aa['count']=_0x52105e;if(_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x5516f6[_0xfd7e('0x41')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xfd7e('0xb7')],'as':_0xfd7e('0xed'),'attributes':['name',_0xfd7e('0xee'),_0xfd7e('0xef')],'required':![]},{'model':db[_0xfd7e('0xf0')],'as':'Tags','attributes':['id',_0xfd7e('0x28'),'color'],'where':_0x14c51c[_0xfd7e('0x36')]['tag']?{'id':_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0xf1')]}:undefined,'required':_0x14c51c['query']['tag']?!![]:![]}];}return db[_0xfd7e('0xaa')][_0xfd7e('0x42')](_0x5516f6);})[_0xfd7e('0xe')](function(_0x3de199){_0x8707aa[_0xfd7e('0x43')]=_0x3de199;return _0x8707aa;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x450d1d,_0x5516f6))['catch'](handleError(_0x450d1d,null));};function iftimePromise(_0x2e1c19,_0x384418){return respondWithRpcPromise(_0xfd7e('0xf2'),'getSnippet',{'command':_0x384418[_0xfd7e('0xf3')]?util[_0xfd7e('0xa3')](_0xfd7e('0xf4'),_0x2e1c19[_0xfd7e('0xf5')],_0x384418[_0xfd7e('0xf3')]):util['format']('iftime\x20%s',_0x2e1c19[_0xfd7e('0xf5')])},client9002)['then'](function(_0x383a64){var _0x2b03ac=_0x383a64&&_0x383a64[_0xfd7e('0xf6')](_0xfd7e('0xf7'))>=0x0?!![]:![];logger[_0xfd7e('0xf')](_0xfd7e('0xf8'),_0x384418['id'],_0x2e1c19['id'],_0x2e1c19[_0xfd7e('0xf5')],_0x2b03ac?_0xfd7e('0xf9'):_0xfd7e('0xfa'),_0x384418[_0xfd7e('0xf3')]?_0x384418[_0xfd7e('0xf3')]:'No\x20timezone');return _0x2b03ac;})[_0xfd7e('0x18')](function(_0x34eee4){logger[_0xfd7e('0x14')](_0xfd7e('0xf8'),_0x384418['id'],_0x2e1c19['id'],_0x2e1c19['interval'],util[_0xfd7e('0xfb')](_0x34eee4,{'showHidden':![],'depth':null}),_0x384418[_0xfd7e('0xf3')]?_0x384418[_0xfd7e('0xf3')]:_0xfd7e('0xfc'));return![];});}exports[_0xfd7e('0xfd')]=function(_0x88ada7,_0x203492){var _0x2188bc=0x0;var _0x1a9e5d=0x0;var _0x3bf1bd=![];var _0x1b09d9;var _0x48128b;return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x88ada7[_0xfd7e('0x50')]['id']},'include':[{'model':db[_0xfd7e('0xfe')],'as':_0xfd7e('0xfe'),'include':[{'model':db[_0xfd7e('0xfe')],'as':'Intervals','attributes':['id',_0xfd7e('0xf5')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x203492,null))[_0xfd7e('0xe')](function(_0x3cd793){if(_0x3cd793){_0x1b09d9=_0x3cd793;return _0x3cd793[_0xfd7e('0xff')]({'raw':!![]});}})[_0xfd7e('0xe')](function(_0x317b5a){if(_0x1b09d9){if(_0x317b5a){_0x48128b=_0x317b5a;}}return require(_0xfd7e('0x6a'))[_0xfd7e('0x6b')]();})['then'](function(_0x134d58){if(_0x134d58){_0x1a9e5d=_0x134d58[_0xfd7e('0x100')];_0x3bf1bd=_0x134d58[_0xfd7e('0x6c')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xfd7e('0xe')](function(_0x3d3722){_0x2188bc=_0x3d3722;if(_0x1a9e5d&&_0x3d3722>_0x1a9e5d){return db[_0xfd7e('0x101')][_0xfd7e('0x5a')]({'where':{'id':0x1}})['then'](function(_0x4b53f1){if(_0x4b53f1){_0x4b53f1['increment'](_0xfd7e('0x102'));}});}})[_0xfd7e('0xe')](function(){if(_0x1b09d9['Interval']&&_0x1b09d9[_0xfd7e('0xfe')][_0xfd7e('0x103')]){var _0x55d480=[];for(var _0x39e546=0x0;_0x39e546<_0x1b09d9[_0xfd7e('0xfe')]['Intervals']['length'];_0x39e546++){var _0x1813f9=_0x1b09d9[_0xfd7e('0xfe')][_0xfd7e('0x103')][_0x39e546][_0xfd7e('0x23')]({'plain':!![]});_0x55d480[_0xfd7e('0xb1')](iftimePromise(_0x1813f9,_0x1b09d9));}return BPromise[_0xfd7e('0x104')](_0x55d480)[_0xfd7e('0xe')](function(_0x2ecba2){return _[_0xfd7e('0x105')](_0x2ecba2);});}else{return!![];}})['then'](function(_0x2400f2){var _0x2f106=fs['readFileSync'](path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x106')),'utf8');var _0x16cc74={'remote':_0x1b09d9[_0xfd7e('0x107')],'query':querystring[_0xfd7e('0x13')](_[_0xfd7e('0x3e')](_0x1b09d9[_0xfd7e('0x23')]({'plain':!![]}),{'customerIp':_0x88ada7[_0xfd7e('0x99')][_0xfd7e('0x9a')]||_0x88ada7['headers'][_0xfd7e('0x108')]||_0x88ada7['connection'][_0xfd7e('0x109')]||_0x88ada7['ip'],'referer':_0x88ada7['headers'][_0xfd7e('0xa0')],'openedInteractions':_0x2188bc,'maxInteractions':_0x1a9e5d,'virtual':_0x3bf1bd[_0xfd7e('0x100')],'online':_0x2400f2,'custom':_0x3bf1bd}))[_0xfd7e('0x10a')](/'/g,'\x5c\x27')};_0x203492[_0xfd7e('0xc3')](ejs['render'](Mustache[_0xfd7e('0x10b')](_0x2f106,_0x16cc74),{'proactiveActions':_0x48128b,'alignment':_0x1b09d9['alignment'],'verticalAlignment':_0x1b09d9[_0xfd7e('0x10c')],'div_color':_0x1b09d9[_0xfd7e('0x10d')],'labelText':_0x1b09d9['labelText'],'text_color':_0x1b09d9[_0xfd7e('0x10e')],'text_button_color':_0x1b09d9['textButtonColor'],'button_color':_0x1b09d9[_0xfd7e('0x10f')],'background_color':_0x1b09d9[_0xfd7e('0x110')],'hideWhenOffline':_0x1b09d9['hideWhenOffline'],'interval':_0x1b09d9['IntervalId']}));})[_0xfd7e('0x18')](handleError(_0x203492,null));};exports[_0xfd7e('0x111')]=function(_0x534da3,_0x332daf){var _0x5f5336=_0x534da3['params']['id'];var _0x531663=_0x534da3[_0xfd7e('0x48')];var _0x35252c=0xc8;var _0x5d9445=null;return db['sequelize'][_0xfd7e('0xd5')]({'isolationLevel':db[_0xfd7e('0xd4')][_0xfd7e('0x112')]['ISOLATION_LEVELS'][_0xfd7e('0x113')]},function(_0x201bba){return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x5f5336},'transaction':_0x201bba})[_0xfd7e('0xe')](function(_0x130cc1){if(_0x130cc1){return db[_0xfd7e('0x90')]['destroy']({'where':{'ChatWebsiteId':_0x5f5336},'transaction':_0x201bba})['then'](function(){var _0x5be76f=_[_0xfd7e('0x2c')](_0x531663,function(_0x4a29c9){_0x4a29c9[_0xfd7e('0x53')]=_0x5f5336;return _0x4a29c9;});return db[_0xfd7e('0x90')][_0xfd7e('0x114')](_0x5be76f,{'transaction':_0x201bba});});}else{_0x35252c=0x194;_0x5d9445=[];}});})[_0xfd7e('0xe')](function(){if(_0x35252c!==0x194){return db[_0xfd7e('0x90')][_0xfd7e('0x115')]({'where':{'ChatWebsiteId':_0x5f5336},'order':'priority'})[_0xfd7e('0xe')](function(_0x5481ac){_0x5d9445=_0x5481ac;});}})['catch'](function(_0x193f23){_0x35252c=0x1f4;logger[_0xfd7e('0x14')](_0x193f23['stack']);if(_0x193f23['name']){delete _0x193f23[_0xfd7e('0x28')];}_0x5d9445=_0x193f23;})['finally'](function(){if(_0x5d9445===null){_0x332daf[_0xfd7e('0x19')](_0x35252c);}else{if(_0x35252c===0x1f4){_0x332daf[_0xfd7e('0x1a')](_0x35252c)[_0xfd7e('0xc3')](_0x5d9445);}else{_0x332daf[_0xfd7e('0x1a')](_0x35252c)['json'](_0x5d9445);}}});};exports['getApplications']=function(_0x2c5305,_0x5ef3a2){var _0x3ad012={};var _0x252662={};var _0x5c74cc;var _0x3c4484;return db['ChatWebsite'][_0xfd7e('0x5a')]({'where':{'id':_0x2c5305['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x5ef3a2,null))[_0xfd7e('0xe')](function(_0x25d55c){if(_0x25d55c){_0x5c74cc=_0x25d55c;_0x252662[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['ChatApplication'][_0xfd7e('0x45')]);_0x252662[_0xfd7e('0x36')]=_['keys'](_0x2c5305[_0xfd7e('0x36')]);_0x252662[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x252662[_0xfd7e('0x33')],_0x252662[_0xfd7e('0x36')]);_0x3ad012[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x252662[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x2c5305[_0xfd7e('0x36')]['fields']));_0x3ad012[_0xfd7e('0x34')]=_0x3ad012[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x3ad012['attributes']:_0x252662['model'];_0x3ad012['order']=qs[_0xfd7e('0x3b')](_0x2c5305['query'][_0xfd7e('0x3b')]);_0x3ad012[_0xfd7e('0x3d')]=qs['filters'](_[_0xfd7e('0x3c')](_0x2c5305[_0xfd7e('0x36')],_0x252662[_0xfd7e('0x31')]));if(_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x3ad012[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x3ad012['where'],{'$or':_[_0xfd7e('0x2c')](_0x3ad012[_0xfd7e('0x34')],function(_0x277a28){var _0x2a595d={};_0x2a595d[_0x277a28]={'$like':'%'+_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x2a595d;})});}_0x3ad012=_[_0xfd7e('0x3e')]({},_0x3ad012,_0x2c5305[_0xfd7e('0x3f')]);return _0x5c74cc['getApplications'](_0x3ad012);}})[_0xfd7e('0xe')](function(_0x19a959){if(_0x19a959){_0x3c4484=_0x19a959[_0xfd7e('0x37')];if(!_0x2c5305['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x3ad012[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x2c5305['query'][_0xfd7e('0x1e')]);_0x3ad012['offset']=qs[_0xfd7e('0x20')](_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x20')]);}return _0x5c74cc[_0xfd7e('0x116')](_0x3ad012);}})[_0xfd7e('0xe')](function(_0x1656c1){if(_0x1656c1){return _0x1656c1?{'count':_0x3c4484,'rows':_0x1656c1}:null;}})[_0xfd7e('0xe')](respondWithResult(_0x5ef3a2,null))[_0xfd7e('0x18')](handleError(_0x5ef3a2,null));};exports[_0xfd7e('0x117')]=function(_0x48cea3,_0x366bdf){return db['chatProactiveAction']['find']({'where':{'id':_0x48cea3[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x366bdf,null))['then'](function(_0x4471af){if(_0x4471af){return _0x4471af[_0xfd7e('0x117')](_0x48cea3[_0xfd7e('0x48')][_0xfd7e('0x5c')],_['omit'](_0x48cea3['body'],[_0xfd7e('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x366bdf,null))[_0xfd7e('0x18')](handleError(_0x366bdf,null));};exports['getProactiveActions']=function(_0x3a9bca,_0x7d500a){var _0x4515a7={};var _0x1ca9ec={};var _0xeea8dc;var _0x3bf417;return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x3a9bca[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x7d500a,null))[_0xfd7e('0xe')](function(_0x5d2569){if(_0x5d2569){_0xeea8dc=_0x5d2569;_0x1ca9ec[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0x118')][_0xfd7e('0x45')]);_0x1ca9ec[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x3a9bca[_0xfd7e('0x36')]);_0x1ca9ec[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x1ca9ec[_0xfd7e('0x33')],_0x1ca9ec[_0xfd7e('0x36')]);_0x4515a7[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x1ca9ec[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x4515a7['attributes']=_0x4515a7[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x4515a7[_0xfd7e('0x34')]:_0x1ca9ec[_0xfd7e('0x33')];_0x4515a7[_0xfd7e('0x3a')]=qs['sort'](_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x4515a7['where']=qs['filters'](_['pick'](_0x3a9bca[_0xfd7e('0x36')],_0x1ca9ec[_0xfd7e('0x31')]));if(_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x4515a7[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x4515a7['where'],{'$or':_[_0xfd7e('0x2c')](_0x4515a7[_0xfd7e('0x34')],function(_0x141dcb){var _0x4cbf59={};_0x4cbf59[_0x141dcb]={'$like':'%'+_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x4cbf59;})});}_0x4515a7=_[_0xfd7e('0x3e')]({},_0x4515a7,_0x3a9bca['options']);return _0xeea8dc[_0xfd7e('0xff')](_0x4515a7);}})['then'](function(_0x19897b){if(_0x19897b){_0x3bf417=_0x19897b[_0xfd7e('0x37')];if(!_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x4515a7[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x3a9bca['query'][_0xfd7e('0x1e')]);_0x4515a7[_0xfd7e('0x20')]=qs['offset'](_0x3a9bca['query'][_0xfd7e('0x20')]);}return _0xeea8dc[_0xfd7e('0xff')](_0x4515a7);}})[_0xfd7e('0xe')](function(_0x15a1f1){if(_0x15a1f1){return _0x15a1f1?{'count':_0x3bf417,'rows':_0x15a1f1}:null;}})[_0xfd7e('0xe')](respondWithResult(_0x7d500a,null))[_0xfd7e('0x18')](handleError(_0x7d500a,null));};exports[_0xfd7e('0x119')]=function(_0x1e8c77,_0x449dd6){var _0x21341e=_0x1e8c77['query']['online']===_0xfd7e('0x11a')?_0xfd7e('0x11b'):_0xfd7e('0x11c');return db['ChatWebsite'][_0xfd7e('0x46')]({'attributes':['id',_0x21341e],'where':{'id':_0x1e8c77[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x449dd6,null))[_0xfd7e('0xe')](function(_0x4f8896){if(_0x4f8896){var _0x1655ee=_0x4f8896[_0x21341e];var _0x580421=_0x1655ee&&_0x1655ee[_0xfd7e('0x11d')]?_0x1655ee[_0xfd7e('0x11d')]:[];_0x449dd6[_0xfd7e('0xc3')]({'fromKey':_['isNil'](_0x1655ee[_0xfd7e('0x11e')])?undefined:_0x1655ee[_0xfd7e('0x11e')],'count':_0x580421[_0xfd7e('0x37')],'rows':_0x580421});}})[_0xfd7e('0x18')](handleError(_0x449dd6,null));};exports[_0xfd7e('0x11f')]=function(_0x135c49,_0x47dbc0){var _0x209181={'raw':![],'where':{}};var _0x5c8c9c={};var _0x12ddf3={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x135c49['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x47dbc0,null))[_0xfd7e('0xe')](function(_0x211697){if(_0x211697){_0x5c8c9c[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['ChatOfflineMessage'][_0xfd7e('0x45')]);_0x5c8c9c[_0xfd7e('0x36')]=_['keys'](_0x135c49['query']);_0x5c8c9c['filters']=_['intersection'](_0x5c8c9c[_0xfd7e('0x33')],_0x5c8c9c[_0xfd7e('0x36')]);_0x209181[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x5c8c9c[_0xfd7e('0x33')],qs['fields'](_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x209181[_0xfd7e('0x34')]=_0x209181[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x209181[_0xfd7e('0x34')]:_0x5c8c9c[_0xfd7e('0x33')];if(!_0x135c49['query']['hasOwnProperty'](_0xfd7e('0x39'))){_0x209181['limit']=qs[_0xfd7e('0x1e')](_0x135c49[_0xfd7e('0x36')]['limit']);_0x209181[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x135c49['query'][_0xfd7e('0x20')]);}_0x209181[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x209181['where']=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x135c49[_0xfd7e('0x36')],_0x5c8c9c['filters']));_0x209181[_0xfd7e('0x3d')][_0xfd7e('0x53')]=_0x211697['id'];if(_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x209181[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x209181[_0xfd7e('0x3d')],{'$or':_['map'](_0x209181['attributes'],function(_0x1aa4d5){var _0x5831c7={};_0x5831c7[_0x1aa4d5]={'$like':'%'+_0x135c49['query'][_0xfd7e('0x55')]+'%'};return _0x5831c7;})});}_0x209181=_['merge']({},_0x209181,_0x135c49[_0xfd7e('0x3f')]);return db[_0xfd7e('0xcc')][_0xfd7e('0x1f')]({'where':_0x209181[_0xfd7e('0x3d')]})[_0xfd7e('0xe')](function(_0x1e055d){_0x12ddf3[_0xfd7e('0x1f')]=_0x1e055d;if(_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x209181['include']=[{'all':!![]}];}else{_0x209181[_0xfd7e('0x41')]=[{'model':db[_0xfd7e('0x7f')],'as':_0xfd7e('0x120'),'required':![]},{'model':db[_0xfd7e('0xd6')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xfd7e('0x42')](_0x209181);})[_0xfd7e('0xe')](function(_0xc53e6){_0x12ddf3[_0xfd7e('0x43')]=_0xc53e6;return _0x12ddf3;});}})['then'](respondWithFilteredResult(_0x47dbc0,_0x209181))['catch'](handleError(_0x47dbc0,null));};exports[_0xfd7e('0x121')]=function(_0x5dd11b,_0xf1a9a0){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x5dd11b[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0xf1a9a0,null))[_0xfd7e('0xe')](function(_0xdb0336){if(_0xdb0336){return _0xdb0336[_0xfd7e('0x121')](_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')],_[_0xfd7e('0xeb')](_0x5dd11b[_0xfd7e('0x48')],['ids','id'])||{})[_0xfd7e('0xc8')](function(_0x4fe4e0){for(var _0x41ad15=0x0;_0x41ad15<_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')][_0xfd7e('0x37')];_0x41ad15+=0x1){socket['emit'](_0xfd7e('0x122'),{'UserId':Number(_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')][_0x41ad15]),'ChatWebsiteId':Number(_0x5dd11b['params']['id'])});}return _0x4fe4e0;});}})[_0xfd7e('0xe')](respondWithResult(_0xf1a9a0,null))[_0xfd7e('0x18')](handleError(_0xf1a9a0,null));};exports[_0xfd7e('0x123')]=function(_0x3c517f,_0x483877){return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x3c517f['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x483877,null))[_0xfd7e('0xe')](function(_0x50d56c){if(_0x50d56c){return _0x50d56c['removeAgents'](_0x3c517f['query'][_0xfd7e('0x5c')])[_0xfd7e('0xe')](function(){if(_[_0xfd7e('0x124')](_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')])){for(var _0x447321=0x0;_0x447321<_0x3c517f['query'][_0xfd7e('0x5c')]['length'];_0x447321+=0x1){socket[_0xfd7e('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')][_0x447321]),'ChatWebsiteId':Number(_0x3c517f['params']['id'])});}}else{socket['emit'](_0xfd7e('0x126'),{'UserId':Number(_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')]),'ChatWebsiteId':Number(_0x3c517f[_0xfd7e('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x483877,null))['catch'](handleError(_0x483877,null));};exports[_0xfd7e('0x127')]=function(_0x675392,_0x865818){var _0x59a82d={};var _0x1d372b={};var _0x22a483;var _0x24f1f5;return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x675392[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x865818,null))['then'](function(_0x1e48de){if(_0x1e48de){_0x22a483=_0x1e48de;_0x1d372b[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0xb7')][_0xfd7e('0x45')]);_0x1d372b[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x675392[_0xfd7e('0x36')]);_0x1d372b[_0xfd7e('0x31')]=_['intersection'](_0x1d372b[_0xfd7e('0x33')],_0x1d372b[_0xfd7e('0x36')]);_0x59a82d['attributes']=_['intersection'](_0x1d372b[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x59a82d[_0xfd7e('0x34')]=_0x59a82d[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x59a82d['attributes']:_0x1d372b[_0xfd7e('0x33')];_0x59a82d[_0xfd7e('0x3a')]=qs['sort'](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x59a82d[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_['pick'](_0x675392[_0xfd7e('0x36')],_0x1d372b[_0xfd7e('0x31')]));if(_0x675392[_0xfd7e('0x36')]['filter']){_0x59a82d[_0xfd7e('0x3d')]=_['merge'](_0x59a82d[_0xfd7e('0x3d')],{'$or':_[_0xfd7e('0x2c')](_0x59a82d['attributes'],function(_0x42d08a){var _0x59cc2c={};_0x59cc2c[_0x42d08a]={'$like':'%'+_0x675392[_0xfd7e('0x36')]['filter']+'%'};return _0x59cc2c;})});}_0x59a82d=_['merge']({},_0x59a82d,_0x675392[_0xfd7e('0x3f')]);return _0x22a483[_0xfd7e('0x127')](_0x59a82d);}})[_0xfd7e('0xe')](function(_0x3127b4){if(_0x3127b4){_0x24f1f5=_0x3127b4['length'];if(!_0x675392['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x59a82d[_0xfd7e('0x1e')]=qs['limit'](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x59a82d[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x675392[_0xfd7e('0x36')]['offset']);}return _0x22a483[_0xfd7e('0x127')](_0x59a82d);}})['then'](function(_0x26a3c7){if(_0x26a3c7){return _0x26a3c7?{'count':_0x24f1f5,'rows':_0x26a3c7}:null;}})['then'](respondWithResult(_0x865818,null))[_0xfd7e('0x18')](handleError(_0x865818,null));};
\ No newline at end of file
+var _0x712e=['READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','mustache','util','path','ejs','fs-extra','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','include','rows','catch','show','params','attributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','order','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','chat','Sequelize','createdAt','difference','updatedAt','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','Contacts','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','agent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','CompanyId','from','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','originalname','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','mimetype','subjectOffline','toPairsIn','lastName','Chat','MailAccountId','NotifyMailAccount','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','Contact','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','inspect','No\x20timezone','Interval','Intervals','../../config/license/util','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS'];(function(_0xc9011c,_0x312360){var _0x169910=function(_0x5262d5){while(--_0x5262d5){_0xc9011c['push'](_0xc9011c['shift']());}};_0x169910(++_0x312360);}(_0x712e,0x139));var _0xe712=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x712e[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xe712('0x0'));var util=require(_0xe712('0x1'));var path=require(_0xe712('0x2'));var ejs=require(_0xe712('0x3'));var fs=require('fs');var fs_extra=require(_0xe712('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0xe712('0x5'));var qs=require(_0xe712('0x6'));var logger=require(_0xe712('0x7'))(_0xe712('0x8'));var config=require('../../config/environment');var db=require(_0xe712('0x9'))['db'];config['redis']=_[_0xe712('0xa')](config['redis'],{'host':_0xe712('0xb'),'port':0x18eb});var socket=require(_0xe712('0xc'))(new Redis(config[_0xe712('0xd')]));require(_0xe712('0xe'))[_0xe712('0xf')](socket);var htmlToText=require(_0xe712('0x10'));var jayson=require(_0xe712('0x11'));var client=jayson[_0xe712('0x12')]['http']({'port':0x232c});var client9002=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x232a});var client9003=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x232b});var client9001=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x59ad51,_0x562fe4,_0x16fcaf,_0xdd6db3){return new BPromise(function(_0x171263,_0x5d58c6){var _0x458117=_0xdd6db3||client;return _0x458117[_0xe712('0x14')](_0x59ad51,_0x16fcaf)[_0xe712('0x15')](function(_0x1a0ff0){logger[_0xe712('0x16')](_0xe712('0x17'),_0x562fe4,'request\x20sent');logger['debug'](_0xe712('0x18'),_0x562fe4,_0xe712('0x19'),JSON[_0xe712('0x1a')](_0x1a0ff0));if(_0x1a0ff0['error']){if(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1c')]===0x1f4){logger[_0xe712('0x1b')](_0xe712('0x17'),_0x562fe4,_0x1a0ff0['error'][_0xe712('0x1d')]);return _0x5d58c6(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1d')]);}logger[_0xe712('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x562fe4,_0x1a0ff0[_0xe712('0x1b')]['message']);return _0x171263(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1d')]);}else{logger[_0xe712('0x16')](_0xe712('0x17'),_0x562fe4,_0xe712('0x19'));_0x171263(_0x1a0ff0['result'][_0xe712('0x1d')]);}})['catch'](function(_0x2acd23){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x562fe4,_0x2acd23);_0x5d58c6(_0x2acd23);});});}function respondWithStatusCode(_0x2d34c3,_0x4a4d14){_0x4a4d14=_0x4a4d14||0xcc;return function(_0x51fe6b){if(_0x51fe6b){return _0x2d34c3[_0xe712('0x1e')](_0x4a4d14);}return _0x2d34c3['status'](_0x4a4d14)['end']();};}function respondWithResult(_0x4fc1da,_0x3b39d3){_0x3b39d3=_0x3b39d3||0xc8;return function(_0x5cc33b){if(_0x5cc33b){return _0x4fc1da[_0xe712('0x1f')](_0x3b39d3)[_0xe712('0x20')](_0x5cc33b);}};}function respondWithFilteredResult(_0x796623,_0x555463){return function(_0x5ed316){if(_0x5ed316){var _0x54a312=typeof _0x555463[_0xe712('0x21')]===_0xe712('0x22')&&typeof _0x555463[_0xe712('0x23')]==='undefined';var _0xeb7e67=_0x5ed316[_0xe712('0x24')];var _0x4ac409=_0x54a312?0x0:_0x555463['offset'];var _0x420ce0=_0x54a312?_0x5ed316['count']:_0x555463[_0xe712('0x21')]+_0x555463['limit'];var _0x46c216;if(_0x420ce0>=_0xeb7e67){_0x420ce0=_0xeb7e67;_0x46c216=0xc8;}else{_0x46c216=0xce;}_0x796623['status'](_0x46c216);return _0x796623['set'](_0xe712('0x25'),_0x4ac409+'-'+_0x420ce0+'/'+_0xeb7e67)['json'](_0x5ed316);}return null;};}function saveUpdates(_0x55c681){return function(_0x5c45d7){if(_0x5c45d7){return _0x5c45d7[_0xe712('0x26')](_0x55c681)[_0xe712('0x15')](function(_0x99e2b2){return _0x99e2b2;});}return null;};}function removeEntity(_0x6bfc45){return function(_0x5efa4f){if(_0x5efa4f){return _0x5efa4f[_0xe712('0x27')]()[_0xe712('0x15')](function(){var _0x1f968b=_0x5efa4f['get']({'plain':!![]});var _0x510281=_0xe712('0x28');return db[_0xe712('0x29')]['destroy']({'where':{'type':_0x510281,'resourceId':_0x1f968b['id']}})[_0xe712('0x15')](function(){return _0x5efa4f;});})[_0xe712('0x15')](function(){_0x6bfc45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e26fa){return function(_0x47bc54){if(!_0x47bc54){_0x4e26fa[_0xe712('0x1e')](0x194);}return _0x47bc54;};}function handleError(_0x13626c,_0x46a01f){_0x46a01f=_0x46a01f||0x1f4;return function(_0x156dd6){logger[_0xe712('0x1b')](_0x156dd6[_0xe712('0x2a')]);if(_0x156dd6[_0xe712('0x2b')]){delete _0x156dd6['name'];}_0x13626c[_0xe712('0x1f')](_0x46a01f)[_0xe712('0x2c')](_0x156dd6);};}exports[_0xe712('0x2d')]=function(_0x263edb,_0x103952){var _0x47788b={'include':[{'model':db['Pause'],'as':_0xe712('0x2e')}]},_0x11ef30={},_0x473552={'count':0x0,'rows':[]};var _0x1bca8b=_[_0xe712('0x2f')](db[_0xe712('0x30')][_0xe712('0x31')],function(_0x379b64){return{'name':_0x379b64[_0xe712('0x32')],'type':_0x379b64[_0xe712('0x33')][_0xe712('0x34')]};});_0x11ef30[_0xe712('0x35')]=_[_0xe712('0x2f')](_0x1bca8b,_0xe712('0x2b'));_0x11ef30[_0xe712('0x36')]=_[_0xe712('0x37')](_0x263edb[_0xe712('0x36')]);_0x11ef30[_0xe712('0x38')]=_[_0xe712('0x39')](_0x11ef30[_0xe712('0x35')],_0x11ef30[_0xe712('0x36')]);_0x47788b['attributes']=_[_0xe712('0x39')](_0x11ef30[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x263edb[_0xe712('0x36')][_0xe712('0x3a')]));_0x47788b['attributes']=_0x47788b['attributes'][_0xe712('0x3b')]?_0x47788b['attributes']:_0x11ef30[_0xe712('0x35')];if(!_0x263edb[_0xe712('0x36')][_0xe712('0x3c')]('nolimit')){_0x47788b[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x263edb[_0xe712('0x36')][_0xe712('0x23')]);_0x47788b['offset']=qs[_0xe712('0x21')](_0x263edb[_0xe712('0x36')][_0xe712('0x21')]);}_0x47788b['order']=qs[_0xe712('0x3d')](_0x263edb[_0xe712('0x36')][_0xe712('0x3d')]);_0x47788b[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x263edb[_0xe712('0x36')],_0x11ef30[_0xe712('0x38')]),_0x1bca8b);if(_0x263edb[_0xe712('0x36')]['filter']){_0x47788b[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x47788b[_0xe712('0x3e')],{'$or':_['map'](_0x1bca8b,function(_0x59d140){if(_0x59d140[_0xe712('0x33')]!=='VIRTUAL'){var _0x4f2825={};_0x4f2825[_0x59d140['name']]={'$like':'%'+_0x263edb[_0xe712('0x36')][_0xe712('0x41')]+'%'};return _0x4f2825;}})});}_0x47788b=_[_0xe712('0x40')]({},_0x47788b,_0x263edb[_0xe712('0x42')]);var _0x5cea80={'where':_0x47788b[_0xe712('0x3e')]};return db[_0xe712('0x30')][_0xe712('0x24')](_0x5cea80)[_0xe712('0x15')](function(_0x1f9920){_0x473552[_0xe712('0x24')]=_0x1f9920;if(_0x263edb['query']['includeAll']){_0x47788b[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x30')]['findAll'](_0x47788b);})[_0xe712('0x15')](function(_0x552fdd){_0x473552[_0xe712('0x44')]=_0x552fdd;return _0x473552;})['then'](respondWithFilteredResult(_0x103952,_0x47788b))[_0xe712('0x45')](handleError(_0x103952,null));};exports[_0xe712('0x46')]=function(_0x461f55,_0x3c3a17){var _0xeaa9a7={'raw':![],'where':{'id':_0x461f55[_0xe712('0x47')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4224d5={};_0x4224d5[_0xe712('0x35')]=_[_0xe712('0x37')](db[_0xe712('0x30')]['rawAttributes']);_0x4224d5[_0xe712('0x36')]=_['keys'](_0x461f55[_0xe712('0x36')]);_0x4224d5['filters']=_[_0xe712('0x39')](_0x4224d5['model'],_0x4224d5[_0xe712('0x36')]);_0xeaa9a7[_0xe712('0x48')]=_[_0xe712('0x39')](_0x4224d5[_0xe712('0x35')],qs['fields'](_0x461f55['query'][_0xe712('0x3a')]));_0xeaa9a7[_0xe712('0x48')]=_0xeaa9a7['attributes'][_0xe712('0x3b')]?_0xeaa9a7[_0xe712('0x48')]:_0x4224d5[_0xe712('0x35')];if(_0x461f55[_0xe712('0x36')][_0xe712('0x49')]){_0xeaa9a7['include']=[{'all':!![]}];}_0xeaa9a7=_[_0xe712('0x40')]({},_0xeaa9a7,_0x461f55['options']);return db[_0xe712('0x30')][_0xe712('0x4a')](_0xeaa9a7)[_0xe712('0x15')](handleEntityNotFound(_0x3c3a17,null))['then'](respondWithResult(_0x3c3a17,null))['catch'](handleError(_0x3c3a17,null));};exports['create']=function(_0x3f2391,_0x546084){return db[_0xe712('0x30')][_0xe712('0x4b')](_0x3f2391[_0xe712('0x4c')],{})['then'](function(_0x4b1974){var _0x124109=_0x3f2391[_0xe712('0x4d')]['get']({'plain':!![]});if(!_0x124109)throw new Error(_0xe712('0x4e'));if(_0x124109[_0xe712('0x4f')]==='user'){var _0x554406=_0x4b1974[_0xe712('0x50')]({'plain':!![]});var _0x18d209=_0xe712('0x28');return db[_0xe712('0x51')][_0xe712('0x4a')]({'where':{'name':_0x18d209,'userProfileId':_0x124109['userProfileId']},'raw':!![]})[_0xe712('0x15')](function(_0x52f9cf){if(_0x52f9cf&&_0x52f9cf['autoAssociation']===0x0){return db[_0xe712('0x29')][_0xe712('0x4b')]({'name':_0x554406[_0xe712('0x2b')],'resourceId':_0x554406['id'],'type':_0x52f9cf[_0xe712('0x2b')],'sectionId':_0x52f9cf['id']},{})[_0xe712('0x15')](function(){return _0x4b1974;});}else{return _0x4b1974;}})[_0xe712('0x45')](function(_0x4756a3){logger[_0xe712('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4756a3);throw _0x4756a3;});}return _0x4b1974;})[_0xe712('0x15')](respondWithResult(_0x546084,0xc9))['catch'](handleError(_0x546084,null));};exports[_0xe712('0x26')]=function(_0x42410c,_0xad7072){if(_0x42410c[_0xe712('0x4c')]['id']){delete _0x42410c[_0xe712('0x4c')]['id'];}return db[_0xe712('0x30')]['find']({'where':{'id':_0x42410c[_0xe712('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xe712('0x2e')}]})['then'](handleEntityNotFound(_0xad7072,null))[_0xe712('0x15')](saveUpdates(_0x42410c[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0xad7072,null))['catch'](handleError(_0xad7072,null));};exports[_0xe712('0x27')]=function(_0x25bde0,_0x2df776){return db[_0xe712('0x30')]['find']({'where':{'id':_0x25bde0['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x2df776,null))['then'](removeEntity(_0x2df776,null))[_0xe712('0x45')](handleError(_0x2df776,null));};exports[_0xe712('0x52')]=function(_0x4f6ddb,_0x39fcb3){return db['ChatWebsite'][_0xe712('0x52')]()[_0xe712('0x15')](respondWithResult(_0x39fcb3,null))[_0xe712('0x45')](handleError(_0x39fcb3,null));};exports[_0xe712('0x53')]=function(_0x61f6d5,_0x4fa087){if(_0x61f6d5[_0xe712('0x4c')]['id']){delete _0x61f6d5['body']['id'];}return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x61f6d5['params']['id']}})['then'](handleEntityNotFound(_0x4fa087,null))[_0xe712('0x15')](function(_0x21b826){if(_0x21b826){_0x61f6d5['body'][_0xe712('0x54')]=_0x21b826['id'];return db[_0xe712('0x55')][_0xe712('0x4b')](_0x61f6d5[_0xe712('0x4c')]);}})[_0xe712('0x15')](respondWithResult(_0x4fa087,null))[_0xe712('0x45')](handleError(_0x4fa087,null));};exports[_0xe712('0x56')]=function(_0x2229bb,_0x9e4f85){var _0x27f904={'raw':![],'where':{}};var _0x127785={};var _0x15ce46={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x2229bb[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x9e4f85,null))[_0xe712('0x15')](function(_0x11113c){if(_0x11113c){_0x127785[_0xe712('0x35')]=_[_0xe712('0x37')](db['Disposition'][_0xe712('0x31')]);_0x127785[_0xe712('0x36')]=_['keys'](_0x2229bb[_0xe712('0x36')]);_0x127785[_0xe712('0x38')]=_[_0xe712('0x39')](_0x127785[_0xe712('0x35')],_0x127785[_0xe712('0x36')]);_0x27f904['attributes']=_['intersection'](_0x127785[_0xe712('0x35')],qs['fields'](_0x2229bb[_0xe712('0x36')][_0xe712('0x3a')]));_0x27f904[_0xe712('0x48')]=_0x27f904[_0xe712('0x48')][_0xe712('0x3b')]?_0x27f904[_0xe712('0x48')]:_0x127785[_0xe712('0x35')];if(!_0x2229bb['query'][_0xe712('0x3c')](_0xe712('0x58'))){_0x27f904[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x2229bb[_0xe712('0x36')][_0xe712('0x23')]);_0x27f904['offset']=qs[_0xe712('0x21')](_0x2229bb[_0xe712('0x36')][_0xe712('0x21')]);}_0x27f904[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x2229bb['query'][_0xe712('0x3d')]);_0x27f904[_0xe712('0x3e')]=qs[_0xe712('0x38')](_['pick'](_0x2229bb[_0xe712('0x36')],_0x127785[_0xe712('0x38')]));_0x27f904[_0xe712('0x3e')][_0xe712('0x54')]=_0x11113c['id'];if(_0x2229bb[_0xe712('0x36')]['filter']){_0x27f904[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x27f904[_0xe712('0x3e')],{'$or':_['map'](_0x27f904[_0xe712('0x48')],function(_0x46d647){var _0x382012={};_0x382012[_0x46d647]={'$like':'%'+_0x2229bb[_0xe712('0x36')]['filter']+'%'};return _0x382012;})});}_0x27f904=_['merge']({},_0x27f904,_0x2229bb[_0xe712('0x42')]);return db[_0xe712('0x55')][_0xe712('0x24')]({'where':_0x27f904[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x516b8d){_0x15ce46[_0xe712('0x24')]=_0x516b8d;if(_0x2229bb[_0xe712('0x36')][_0xe712('0x49')]){_0x27f904[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x55')][_0xe712('0x5a')](_0x27f904);})[_0xe712('0x15')](function(_0x10952a){_0x15ce46[_0xe712('0x44')]=_0x10952a;return _0x15ce46;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x9e4f85,_0x27f904))[_0xe712('0x45')](handleError(_0x9e4f85,null));};exports[_0xe712('0x5b')]=function(_0x448348,_0x3536fd){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x448348[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x3536fd,null))[_0xe712('0x15')](function(_0x51d6c9){if(_0x51d6c9){return _0x51d6c9[_0xe712('0x5b')](_0x448348['query']['ids']);}})[_0xe712('0x15')](respondWithStatusCode(_0x3536fd,null))[_0xe712('0x45')](handleError(_0x3536fd,null));};exports[_0xe712('0x5c')]=function(_0x295702,_0x251533){if(_0x295702['body']['id']){delete _0x295702['body']['id'];}return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x295702[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x251533,null))[_0xe712('0x15')](function(_0x3cf0b9){if(_0x3cf0b9){_0x295702[_0xe712('0x4c')][_0xe712('0x54')]=_0x3cf0b9['id'];return db[_0xe712('0x5d')][_0xe712('0x4b')](_0x295702[_0xe712('0x4c')]);}})[_0xe712('0x15')](respondWithResult(_0x251533,null))[_0xe712('0x45')](handleError(_0x251533,null));};exports['getAnswers']=function(_0x48c121,_0x374e9d){var _0x140ce1={'raw':![],'where':{}};var _0x301e9d={};var _0x8f4250={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x48c121[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x374e9d,null))[_0xe712('0x15')](function(_0x54f3fd){if(_0x54f3fd){_0x301e9d[_0xe712('0x35')]=_[_0xe712('0x37')](db['CannedAnswer'][_0xe712('0x31')]);_0x301e9d[_0xe712('0x36')]=_[_0xe712('0x37')](_0x48c121[_0xe712('0x36')]);_0x301e9d['filters']=_['intersection'](_0x301e9d['model'],_0x301e9d[_0xe712('0x36')]);_0x140ce1[_0xe712('0x48')]=_[_0xe712('0x39')](_0x301e9d['model'],qs[_0xe712('0x3a')](_0x48c121['query'][_0xe712('0x3a')]));_0x140ce1[_0xe712('0x48')]=_0x140ce1[_0xe712('0x48')]['length']?_0x140ce1[_0xe712('0x48')]:_0x301e9d['model'];if(!_0x48c121[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x140ce1['limit']=qs[_0xe712('0x23')](_0x48c121[_0xe712('0x36')][_0xe712('0x23')]);_0x140ce1['offset']=qs['offset'](_0x48c121[_0xe712('0x36')]['offset']);}_0x140ce1['order']=qs[_0xe712('0x3d')](_0x48c121[_0xe712('0x36')][_0xe712('0x3d')]);_0x140ce1['where']=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x48c121[_0xe712('0x36')],_0x301e9d[_0xe712('0x38')]));_0x140ce1[_0xe712('0x3e')][_0xe712('0x54')]=_0x54f3fd['id'];if(_0x48c121['query']['filter']){_0x140ce1[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x140ce1[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x140ce1[_0xe712('0x48')],function(_0x1be0dc){var _0x579403={};_0x579403[_0x1be0dc]={'$like':'%'+_0x48c121['query'][_0xe712('0x41')]+'%'};return _0x579403;})});}_0x140ce1=_[_0xe712('0x40')]({},_0x140ce1,_0x48c121[_0xe712('0x42')]);return db['CannedAnswer'][_0xe712('0x24')]({'where':_0x140ce1[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x4434c9){_0x8f4250[_0xe712('0x24')]=_0x4434c9;if(_0x48c121[_0xe712('0x36')]['includeAll']){_0x140ce1[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x5d')][_0xe712('0x5a')](_0x140ce1);})[_0xe712('0x15')](function(_0x342364){_0x8f4250[_0xe712('0x44')]=_0x342364;return _0x8f4250;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x374e9d,_0x140ce1))[_0xe712('0x45')](handleError(_0x374e9d,null));};exports[_0xe712('0x5e')]=function(_0x4eba67,_0x1743d8){return db['ChatWebsite']['find']({'where':{'id':_0x4eba67[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x1743d8,null))['then'](function(_0x2f2c3){if(_0x2f2c3){return _0x2f2c3[_0xe712('0x5e')](_0x4eba67[_0xe712('0x36')]['ids']);}})[_0xe712('0x15')](respondWithStatusCode(_0x1743d8,null))['catch'](handleError(_0x1743d8,null));};exports[_0xe712('0x5f')]=function(_0x20a5f2,_0x543643){_0x20a5f2[_0xe712('0x4c')]['sitepic']=_0x20a5f2[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x20a5f2[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x543643,null))['then'](saveUpdates(_0x20a5f2[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x543643,null))['catch'](handleError(_0x543643,null));};exports[_0xe712('0x62')]=function(_0x3932b8,_0x478249){_0x3932b8[_0xe712('0x4c')][_0xe712('0x63')]=_0x3932b8[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')]['find']({'where':{'id':_0x3932b8[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x478249,null))[_0xe712('0x15')](saveUpdates(_0x3932b8[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x478249,null))[_0xe712('0x45')](handleError(_0x478249,null));};exports['addCustomerAvatar']=function(_0x5df68e,_0x659a24){_0x5df68e['body'][_0xe712('0x64')]=_0x5df68e[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x5df68e[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x659a24,null))[_0xe712('0x15')](saveUpdates(_0x5df68e[_0xe712('0x4c')],null))['then'](respondWithResult(_0x659a24,null))[_0xe712('0x45')](handleError(_0x659a24,null));};exports[_0xe712('0x65')]=function(_0x2ec051,_0x3fa562){_0x2ec051[_0xe712('0x4c')][_0xe712('0x66')]=_0x2ec051[_0xe712('0x60')][_0xe712('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x2ec051[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fa562,null))[_0xe712('0x15')](saveUpdates(_0x2ec051[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x3fa562,null))[_0xe712('0x45')](handleError(_0x3fa562,null));};exports['getLogo']=function(_0x242ebf,_0x14953a){var _0xd10202=path['join'](config['root'],_0xe712('0x67'));var _0x5e74a8={'where':{'id':_0x242ebf[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x68')],'raw':!![]};var _0xdc52ca=![];return require('../../config/license/util')[_0xe712('0x69')]()['then'](function(_0x2e92c7){if(_0x2e92c7){_0xdc52ca=_0x2e92c7[_0xe712('0x6a')];}})[_0xe712('0x15')](function(){return db['ChatWebsite'][_0xe712('0x4a')](_0x5e74a8);})['then'](handleEntityNotFound(_0x14953a,null))[_0xe712('0x15')](function(_0x423ab3){if(_0x423ab3){if(!_[_0xe712('0x6b')](_0x423ab3[_0xe712('0x68')])){if(fs[_0xe712('0x6c')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x6f'),_0x423ab3['sitepic']))&&_0xdc52ca){_0xd10202=path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x6f'),_0x423ab3[_0xe712('0x68')]);}}return _0x14953a[_0xe712('0x70')](_0xd10202);}})[_0xe712('0x45')](handleError(_0x14953a,null));};exports[_0xe712('0x71')]=function(_0x41ef32,_0x1072e1){var _0x73e17a=path['join'](config[_0xe712('0x6e')],_0xe712('0x72'));var _0x22149d={'where':{'id':_0x41ef32['params']['id']},'attributes':['id',_0xe712('0x63')],'raw':!![]};return db[_0xe712('0x30')][_0xe712('0x4a')](_0x22149d)[_0xe712('0x15')](handleEntityNotFound(_0x1072e1,null))['then'](function(_0x36569c){if(_0x36569c){if(!_['isNil'](_0x36569c[_0xe712('0x63')])){if(fs[_0xe712('0x6c')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x73'),_0x36569c[_0xe712('0x63')]))){_0x73e17a=path['join'](config[_0xe712('0x6e')],_0xe712('0x73'),_0x36569c['agentAvatar']);}}return _0x1072e1['download'](_0x73e17a);}})[_0xe712('0x45')](handleError(_0x1072e1,null));};exports[_0xe712('0x74')]=function(_0x4b77de,_0x4afe67){var _0x40ae7b=path[_0xe712('0x6d')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x4c9c11={'where':{'id':_0x4b77de[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x64'),_0xe712('0x75')],'raw':!![]};return db['ChatWebsite'][_0xe712('0x4a')](_0x4c9c11)[_0xe712('0x15')](handleEntityNotFound(_0x4afe67,null))['then'](function(_0x19fe13){if(_0x19fe13){if(!_[_0xe712('0x6b')](_0x19fe13['customerAvatar'])){if(fs['existsSync'](path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x19fe13['customerAvatar']))&&_0x19fe13[_0xe712('0x75')]){_0x40ae7b=path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x73'),_0x19fe13['customerAvatar']);}}return _0x4afe67['download'](_0x40ae7b);}})[_0xe712('0x45')](handleError(_0x4afe67,null));};exports[_0xe712('0x76')]=function(_0x4afa00,_0x4ee7b9){var _0x7fab8b=path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x432624={'where':{'id':_0x4afa00[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x66')],'raw':!![]};return db[_0xe712('0x30')]['find'](_0x432624)[_0xe712('0x15')](handleEntityNotFound(_0x4ee7b9,null))[_0xe712('0x15')](function(_0x16c2b4){if(_0x16c2b4){if(!_['isNil'](_0x16c2b4['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x16c2b4[_0xe712('0x66')]))){_0x7fab8b=path['join'](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x16c2b4[_0xe712('0x66')]);}}return _0x4ee7b9[_0xe712('0x70')](_0x7fab8b);}})[_0xe712('0x45')](handleError(_0x4ee7b9,null));};exports[_0xe712('0x77')]=function(_0x3a6d85,_0x3dbaea){var _0x21b52c=require('user-agent-parser');var _0x3591d5=new _0x21b52c();var _0x3980c6=_0x3591d5[_0xe712('0x78')](_0x3a6d85[_0xe712('0x79')]['user-agent'])['getResult']();var _0x26e9ac={'body':_0x3a6d85[_0xe712('0x4c')],'channel':_0xe712('0x7a')};var _0x40ed98=[];var _0x54d56c=[];var _0x4974cc={};var _0x258b9f=![];return db['CmContact'][_0xe712('0x52')]()['then'](function(_0x22440c){if(!_0x22440c){throw new db[(_0xe712('0x7b'))]['ValidationError']('no\x20available\x20attributes');}_0x40ed98=_['difference'](_[_0xe712('0x37')](_0x22440c),[_0xe712('0x7c'),'updatedAt']);_0x54d56c=_[_0xe712('0x7d')](_[_0xe712('0x37')](_0x22440c),['createdAt',_0xe712('0x7e'),'CompanyId','ListId']);if(_0x3a6d85[_0xe712('0x4c')]['id']){delete _0x3a6d85[_0xe712('0x4c')]['id'];}if(_[_0xe712('0x6b')](_0x3a6d85['body']['from'])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')])||_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')]===''){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x80'));}if(_[_0xe712('0x6b')](_0x3a6d85[_0xe712('0x4c')][_0xe712('0x81')])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x82')+_0x54d56c);}if(!_[_0xe712('0x83')](_0x54d56c,_0x3a6d85['body'][_0xe712('0x81')])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x84')+_0x54d56c);}_0x4974cc[_0x3a6d85[_0xe712('0x4c')]['mapKey']]=_0x3a6d85['body']['from'];})[_0xe712('0x15')](function(){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x3a6d85[_0xe712('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0xe712('0x85'),'include':[{'model':db[_0xe712('0x86')],'as':'Contacts','where':_0x4974cc,'limit':0x1,'order':[['updatedAt',_0xe712('0x87')]]}]},{'model':db[_0xe712('0x88')],'as':_0xe712('0x89')}]});})[_0xe712('0x15')](handleEntityNotFound(_0x3dbaea,null))[_0xe712('0x15')](function(_0x3375c6){if(_0x3375c6&&_0x3375c6[_0xe712('0x85')]){_0x26e9ac[_0xe712('0x8a')]=_0x3375c6;_0x26e9ac[_0xe712('0x8b')]=_0x3375c6['Applications'];_0x26e9ac[_0xe712('0x8c')]=_0x3375c6['List'];_0x26e9ac['applications']=_[_0xe712('0x8d')](_0x26e9ac[_0xe712('0x8b')],['priority'],[_0xe712('0x8e')]);if(_0x26e9ac['account'][_0xe712('0x89')]){delete _0x26e9ac[_0xe712('0x8a')]['Applications'];}if(_0x26e9ac['account'][_0xe712('0x85')]&&_0x26e9ac[_0xe712('0x8a')][_0xe712('0x85')][_0xe712('0x8f')][_0xe712('0x3b')]){return _0x26e9ac['account'][_0xe712('0x85')][_0xe712('0x8f')][0x0];}var _0x49d3ef=_['defaults'](_0x3a6d85[_0xe712('0x4c')],{'firstName':_0x3a6d85[_0xe712('0x4c')]['from'],'ListId':_0x3375c6[_0xe712('0x90')]});_0x49d3ef[_0x3a6d85[_0xe712('0x4c')][_0xe712('0x81')]]=_0x3a6d85[_0xe712('0x4c')]['from'];return db[_0xe712('0x86')][_0xe712('0x4b')](_0x49d3ef,{'fields':_0x40ed98,'raw':!![]});}})['then'](handleEntityNotFound(_0x3dbaea,null))[_0xe712('0x15')](function(_0x510eef){_0x26e9ac['contact']=_0x510eef;var _0x33570d=_0x3a6d85[_0xe712('0x4c')][_0xe712('0x91')];if(_0x3a6d85[_0xe712('0x79')][_0xe712('0x92')]){_0x33570d=_0x3a6d85[_0xe712('0x79')][_0xe712('0x92')];}else if(_0x3a6d85[_0xe712('0x79')][_0xe712('0x93')]){_0x33570d=_[_0xe712('0x94')](_0x3a6d85['headers']['x-forwarded-for']['split'](','));}if(_0x510eef){var _0x4cee6f={'ContactId':_0x510eef['id'],'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'from':(_0x510eef[_0xe712('0x95')]||'')+'\x20'+(_0x510eef['lastName']||''),'customerIp':_0x33570d,'customerPort':_0x3a6d85['headers'][_0xe712('0x96')]?_0x3a6d85['headers'][_0xe712('0x96')]:null,'referer':_0x3a6d85[_0xe712('0x4c')][_0xe712('0x97')],'browserName':_0x3980c6[_0xe712('0x98')][_0xe712('0x2b')]&&_0x3980c6[_0xe712('0x98')][_0xe712('0x99')]?util[_0xe712('0x9a')](_0xe712('0x9b'),_0x3980c6['browser'][_0xe712('0x2b')],_0x3980c6['browser'][_0xe712('0x99')]):_0xe712('0x9c'),'browserVersion':_0x3980c6[_0xe712('0x98')]['version']||_0xe712('0x9c'),'osName':util['format'](_0xe712('0x9b'),_0x3980c6['os'][_0xe712('0x2b')],_0x3980c6['os'][_0xe712('0x99')]),'osVersion':_0x3980c6['os'][_0xe712('0x99')],'deviceModel':_0x3980c6['device'][_0xe712('0x35')]&&_0x3980c6['device'][_0xe712('0x9d')]?util['format']('%s\x20%s\x20%s',_0x3980c6[_0xe712('0x9e')][_0xe712('0x35')],_0x3980c6[_0xe712('0x9e')]['vendor'],_0x3980c6[_0xe712('0x9e')]['type']):null,'deviceVendor':_0x3980c6[_0xe712('0x9e')][_0xe712('0x9d')],'deviceType':_0x3980c6[_0xe712('0x9e')][_0xe712('0x33')],'formData':JSON[_0xe712('0x1a')](_0x3a6d85['body'])};var _0x507ff6={'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'closed':![]};if(_0x3a6d85[_0xe712('0x4c')][_0xe712('0x9f')]){_0x507ff6[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')]['threadId'];return db[_0xe712('0xa0')]['find']({'where':_0x507ff6})[_0xe712('0x15')](function(_0x8f361e){if(_0x8f361e){return[_0x8f361e,![]];}_0x4cee6f[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')]['threadId'];_0x4cee6f[_0xe712('0xa1')]=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa1')];return db[_0xe712('0xa0')][_0xe712('0x4b')](_0x4cee6f)[_0xe712('0x15')](function(_0xcc4f2f){return[_0xcc4f2f,!![]];});});}_0x507ff6[_0xe712('0xa2')]=_0x510eef['id'];if(_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa3')]&&_0x3a6d85[_0xe712('0x4c')]['interaction']['id']){_0x507ff6['id']=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa3')]['id'];return db[_0xe712('0xa0')][_0xe712('0x4a')]({'where':_0x507ff6})[_0xe712('0x15')](function(_0x57bb63){if(_0x57bb63){return[_0x57bb63,![]];}return db['ChatInteraction'][_0xe712('0x4b')](_0x4cee6f)['then'](function(_0x58d0ee){return[_0x58d0ee,!![]];});});}return db[_0xe712('0xa0')][_0xe712('0x4b')](_0x4cee6f)[_0xe712('0x15')](function(_0x12ada5){return[_0x12ada5,!![]];});}})[_0xe712('0xa4')](function(_0x5475c9,_0x176d93){if(_0x5475c9){_0x258b9f=_0x176d93;if(!_0x176d93){var _0x340b20={'from':(_0x26e9ac[_0xe712('0xa5')][_0xe712('0x95')]||'')+'\x20'+(_0x26e9ac[_0xe712('0xa5')]['lastName']||'')};if(_0x3a6d85['body'][_0xe712('0x9f')]&&_0x3a6d85[_0xe712('0x4c')]['messageId']&&_0x3a6d85[_0xe712('0x4c')][_0xe712('0x9f')]!=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa6')]){_0x340b20[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa6')];}return _0x5475c9[_0xe712('0x26')](_0x340b20);}else{return _0x5475c9;}}})[_0xe712('0x15')](function(_0x4a40a8){_0x26e9ac[_0xe712('0xa3')]=_0x4a40a8[_0xe712('0x50')]({'plain':!![]});_0x26e9ac['interaction'][_0xe712('0xa7')]=_0x258b9f;if(_0x26e9ac[_0xe712('0xa3')]['created']){if(_0x26e9ac['account'][_0xe712('0xa8')]){_0x26e9ac[_0xe712('0x8b')][_0xe712('0xa9')]({'id':0x0,'priority':_0x26e9ac[_0xe712('0x8b')][_0xe712('0x3b')]+0x1,'app':'close','appdata':_0xe712('0xaa'),'interval':_0xe712('0xab')});}}return db[_0xe712('0xac')][_0xe712('0x4b')]({'body':_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')],'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'ChatInteractionId':_0x4a40a8['id'],'direction':'in','ContactId':_0x26e9ac['contact']['id'],'AttachmentId':_0x3a6d85[_0xe712('0x4c')][_0xe712('0xad')]});})[_0xe712('0x15')](function(_0x120131){_0x26e9ac['message']=_0x120131;if(_0x26e9ac[_0xe712('0xa3')]['UserId']){return db[_0xe712('0xae')][_0xe712('0x4a')]({'attributes':['id','name'],'where':{'id':_0x26e9ac[_0xe712('0xa3')][_0xe712('0xaf')]}})[_0xe712('0x15')](function(_0xb44715){if(_0xb44715){_0x26e9ac[_0xe712('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe712('0xb0'),'appdata':_0xb44715[_0xe712('0x2b')]+','+(_0x26e9ac[_0xe712('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0xe712('0xab')});_0x26e9ac[_0xe712('0xb1')]=!![];}return respondWithRpcPromise(_0xe712('0xb2'),_0xe712('0xb3'),_0x26e9ac);});}return respondWithRpcPromise(_0xe712('0xb2'),_0xe712('0xb3'),_0x26e9ac);})[_0xe712('0x15')](function(_0xd6aabd){respondWithRpcPromise(_0xe712('0xb4'),_0xe712('0xb4'),{'event':_0xe712('0x77'),'message':_0xd6aabd},client9002);return _0xd6aabd;})[_0xe712('0x15')](respondWithResult(_0x3dbaea,null))[_0xe712('0x45')](handleError(_0x3dbaea,null));};exports['offline']=function(_0x48bdf8,_0x1b9a45){var _0x541595,_0x53c6ab,_0x1bdd69;var _0x1b05b4=[];var _0x43fbf4={};var _0x34737b=_0x48bdf8[_0xe712('0xb5')]||[];var _0x2579a3=[];var _0x42bb0c;return db['CmContact'][_0xe712('0x52')]()[_0xe712('0x15')](function(_0x1625b4){if(!_0x1625b4){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0xb6'));}_0x1b05b4=_[_0xe712('0x7d')](_[_0xe712('0x37')](_0x1625b4),['createdAt',_0xe712('0x7e'),_0xe712('0xb7'),'ListId']);if(_0x48bdf8[_0xe712('0x4c')]['id']){delete _0x48bdf8[_0xe712('0x4c')]['id'];}if(_[_0xe712('0x6b')](_0x48bdf8['body'][_0xe712('0xb8')])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0xb9')));}if(_['isNil'](_0x48bdf8['body']['body'])||_0x48bdf8[_0xe712('0x4c')][_0xe712('0x4c')]===''){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x80')));}if(_[_0xe712('0x6b')](_0x48bdf8[_0xe712('0x4c')][_0xe712('0xba')])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db['Sequelize']['ValidationError'](_0xe712('0xbb')+_0x1b05b4));}if(!_[_0xe712('0x83')](_0x1b05b4,_0x48bdf8[_0xe712('0x4c')]['mapKeyOffline'])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b05b4));}_0x43fbf4[_0x48bdf8[_0xe712('0x4c')]['mapKeyOffline']]=_0x48bdf8[_0xe712('0x4c')][_0xe712('0xb8')];})[_0xe712('0x15')](function(){return db['ChatWebsite'][_0xe712('0x4a')]({'where':{'id':_0x48bdf8[_0xe712('0x47')]['id']},'include':[{'model':db[_0xe712('0xbc')],'as':_0xe712('0x85')},{'model':db[_0xe712('0xbd')],'as':_0xe712('0xbd')}]});})[_0xe712('0x15')](handleEntityNotFound(_0x1b9a45,null))[_0xe712('0x15')](function(_0x389b43){if(_0x389b43&&_0x389b43[_0xe712('0x85')]){_0x53c6ab=_0x389b43;var _0x17fab4=_[_0xe712('0xa')](_0x48bdf8['body'],{'firstName':_0x48bdf8[_0xe712('0x4c')]['from'],'phone':_0x48bdf8[_0xe712('0x4c')]['from'],'ListId':_0x389b43['ListId']});_0x17fab4[_0x48bdf8[_0xe712('0x4c')][_0xe712('0xba')]]=_0x48bdf8[_0xe712('0x4c')][_0xe712('0xb8')];return db[_0xe712('0x86')][_0xe712('0xbe')]({'where':_0x43fbf4,'defaults':_0x17fab4});}})[_0xe712('0xa4')](function(_0xd312ab){if(_0xd312ab){_0x1bdd69=_0xd312ab;var _0x432a97=fs[_0xe712('0xbf')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0xc0')),_0xe712('0xc1'));var _0x43857b=ejs[_0xe712('0xc2')](_0x432a97,{'body':_[_0xe712('0xc3')](_0x48bdf8[_0xe712('0x4c')][_0xe712('0x4c')]),'bodyTitle':_0x53c6ab['offlineMessageBody']});return db['ChatOfflineMessage'][_0xe712('0x4b')]({'body':_0x43857b,'plainBody':htmlToText['fromString'](_0x43857b),'ContactId':_0xd312ab['id'],'ChatWebsiteId':_0x53c6ab['id']});}})['then'](function(_0x1f88a5){_0x42bb0c=_0x1f88a5;if(_0x34737b[_0xe712('0x3b')]){var _0xca258e=_0x34737b[_0xe712('0x2f')](function(_0x44f598){return{'name':_0x44f598[_0xe712('0xc4')],'basename':_0x44f598[_0xe712('0x61')],'type':_0x44f598['mimetype'],'ChatOfflineMessageId':_0x1f88a5['id']};});_0x2579a3=_0xca258e[_0xe712('0x2f')](_0x42fd3a=>{var _0x107ea9={'filename':_0x42fd3a[_0xe712('0x2b')],'path':path['join'](config[_0xe712('0x6e')],_0xe712('0xc5'),'files',_0xe712('0xc6'),'offline-chat',_0x42fd3a[_0xe712('0xc7')])};return _0x107ea9;});if(!_0x53c6ab['openNewInteraction']){return db[_0xe712('0xc8')][_0xe712('0xc9')](function(_0x211a8a){return db[_0xe712('0xca')][_0xe712('0xcb')](_0xca258e,{'transaction':_0x211a8a});});}}})['then'](function(){if(_0x42bb0c){_0x541595=_0x42bb0c;return db['MailAccount'][_0xe712('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xe712('0xcc')],'as':_0xe712('0xcd'),'raw':!![],'include':[{'model':db[_0xe712('0xce')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x1f67b2){if(_0x1f67b2&&_0x1f67b2[_0xe712('0xcd')]&&_0x53c6ab[_0xe712('0xcf')]&&_0x53c6ab[_0xe712('0xd0')]){var _0x148121=_0x1f67b2[_0xe712('0xd1')]();return respondWithRpcPromise(_0xe712('0xd2'),_0xe712('0xd3'),{'account':_0x148121,'message':{'from':util['format'](_0xe712('0xd4'),_0x1f67b2[_0xe712('0x2b')],_0x1f67b2[_0xe712('0xd5')]||_0x1f67b2[_0xe712('0xcd')][_0xe712('0x4d')]),'to':_0x53c6ab[_0xe712('0xd0')],'subject':_0x53c6ab[_0xe712('0xd6')],'html':_0x541595[_0xe712('0x4c')],'attachments':_0x2579a3}},client9003)['then'](function(){return _0x541595;})[_0xe712('0x45')](function(_0x45bb5e){logger[_0xe712('0x1b')](_0x45bb5e);});}})[_0xe712('0x15')](function(){if(_0x53c6ab&&_0x53c6ab[_0xe712('0xd7')]&&_0x53c6ab['MailAccountId']){var _0x3ba2cf=[];if(_0x34737b[_0xe712('0x3b')]){_0x3ba2cf=_0x34737b['map'](function(_0x116e8f){return{'name':_0x116e8f[_0xe712('0xc4')],'basename':_0x116e8f['filename'],'type':_0x116e8f[_0xe712('0xd8')],'ChatOfflineMessageId':_0x42bb0c['id']};});}var _0x9e6e79;if(!_['isNil'](_0x53c6ab[_0xe712('0xd9')])){var _0x3d6f9d=_[_0xe712('0x2f')](_0x48bdf8['body'],function(_0x38922f){return _0x38922f;});var _0x4abe12=_[_0xe712('0xda')](_0x3d6f9d)[0x0];var _0x244d1d=_['mapValues'](_0x4abe12,function(_0x140a00){return _0x140a00;});_0x9e6e79=_0x244d1d[0x1][_0x53c6ab[_0xe712('0xd9')]];}var _0x30a95a={'from':_0x1bdd69[_0xe712('0xd5')],'firstName':_0x1bdd69['firstName'],'lastName':_0x1bdd69[_0xe712('0xdb')],'mapKey':'email','message':{'from':_0x1bdd69[_0xe712('0xd5')],'to':_0x53c6ab[_0xe712('0xbd')]['email'],'cc':'','subject':_[_0xe712('0x6b')](_0x9e6e79)?_0x53c6ab[_0xe712('0xd6')]:_0x9e6e79,'messageId':'','sentAt':new Date(),'attach':_0x3ba2cf[_0xe712('0x3b')],'attachments':_0x3ba2cf,'originChannel':_0xe712('0xdc'),'ChatWebsiteId':_0x53c6ab['id'],'ChatOfflineMessageId':_0x541595['id'],'originTo':_0x53c6ab[_0xe712('0xbd')][_0xe712('0xd5')]},'body':_0x541595[_0xe712('0x4c')]};var _0x5c4e76={'account':{'id':_0x53c6ab[_0xe712('0xdd')]},'body':_0x30a95a,'log':_0xe712('0xde')};return respondWithRpcPromise(_0xe712('0xde'),'notifyMail',_0x5c4e76,client9001)[_0xe712('0x15')](function(){return _0x541595;})[_0xe712('0x45')](function(_0x2e35a9){logger['error'](_0x2e35a9);});}return;})[_0xe712('0x15')](function(){if(_0x541595){return _0x541595;}})[_0xe712('0x15')](respondWithResult(_0x1b9a45,null))[_0xe712('0x45')](function(_0x5629aa){logger[_0xe712('0x1b')]('catch',_0x5629aa);for(var _0xa97a2c of _0x34737b){var _0x5dfbdc=path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server','files','attachments',_0xe712('0xdf'),_0xa97a2c['filename']);fs_extra['remove'](_0x5dfbdc)[_0xe712('0x45')](function(_0x18d75c){logger[_0xe712('0x1b')](_0xe712('0xe0'),_0x5dfbdc,_0x18d75c);});}});};exports[_0xe712('0xe1')]=function(_0x46fe65,_0x1a89e5){return db['ChatInteraction']['find']({'where':{'id':_0x46fe65['params']['id']}})['then'](handleEntityNotFound(_0x1a89e5,null))[_0xe712('0x15')](function(_0x53fe6a){if(_0x53fe6a){return _0x53fe6a[_0xe712('0xe1')](_0x46fe65[_0xe712('0x4c')][_0xe712('0xe2')],_[_0xe712('0xe3')](_0x46fe65['body'],['ids','id'])||{});}})[_0xe712('0x15')](respondWithResult(_0x1a89e5,null))['catch'](handleError(_0x1a89e5,null));};exports['getInteractions']=function(_0x5071fd,_0x4c0d4d){var _0x326b01={'raw':![],'where':{}};var _0x3923fd={};var _0x26b9a6={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x5071fd[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x4c0d4d,null))['then'](function(_0x5c04d2){if(_0x5c04d2){_0x3923fd[_0xe712('0x35')]=_['keys'](db[_0xe712('0xa0')]['rawAttributes']);_0x3923fd[_0xe712('0x36')]=_[_0xe712('0x37')](_0x5071fd[_0xe712('0x36')]);_0x3923fd['filters']=_[_0xe712('0x39')](_0x3923fd[_0xe712('0x35')],_0x3923fd[_0xe712('0x36')]);_0x326b01['attributes']=_[_0xe712('0x39')](_0x3923fd[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x5071fd['query'][_0xe712('0x3a')]));_0x326b01['attributes']=_0x326b01[_0xe712('0x48')]['length']?_0x326b01['attributes']:_0x3923fd[_0xe712('0x35')];if(!_0x5071fd[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x326b01[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x5071fd[_0xe712('0x36')][_0xe712('0x23')]);_0x326b01[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x5071fd[_0xe712('0x36')]['offset']);}_0x326b01[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x5071fd[_0xe712('0x36')][_0xe712('0x3d')]);_0x326b01[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x5071fd[_0xe712('0x36')],_0x3923fd[_0xe712('0x38')]));_0x326b01[_0xe712('0x3e')][_0xe712('0x54')]=_0x5c04d2['id'];if(_0x5071fd[_0xe712('0x36')][_0xe712('0x41')]){_0x326b01[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x326b01[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x326b01[_0xe712('0x48')],function(_0x2d3493){var _0x412e44={};_0x412e44[_0x2d3493]={'$like':'%'+_0x5071fd['query']['filter']+'%'};return _0x412e44;})});}_0x326b01=_['merge']({},_0x326b01,_0x5071fd[_0xe712('0x42')]);return db['ChatInteraction'][_0xe712('0x24')]({'where':_0x326b01[_0xe712('0x3e')]})['then'](function(_0x56482a){_0x26b9a6['count']=_0x56482a;if(_0x5071fd['query'][_0xe712('0x49')]){_0x326b01[_0xe712('0x43')]=[{'model':db[_0xe712('0x86')],'as':_0xe712('0xe4'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe712('0x2b'),_0xe712('0xe5'),_0xe712('0xe6')],'required':![]},{'model':db['Tag'],'as':_0xe712('0xe7'),'attributes':['id',_0xe712('0x2b'),_0xe712('0xe8')],'where':_0x5071fd[_0xe712('0x36')][_0xe712('0xe9')]?{'id':_0x5071fd[_0xe712('0x36')]['tag']}:undefined,'required':_0x5071fd[_0xe712('0x36')][_0xe712('0xe9')]?!![]:![]}];}return db['ChatInteraction'][_0xe712('0x5a')](_0x326b01);})['then'](function(_0x386cb8){_0x26b9a6[_0xe712('0x44')]=_0x386cb8;return _0x26b9a6;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x4c0d4d,_0x326b01))[_0xe712('0x45')](handleError(_0x4c0d4d,null));};function iftimePromise(_0x4d95ae,_0x22e476){return respondWithRpcPromise(_0xe712('0xea'),_0xe712('0xeb'),{'command':_0x22e476[_0xe712('0xec')]?util[_0xe712('0x9a')](_0xe712('0xed'),_0x4d95ae['interval'],_0x22e476[_0xe712('0xec')]):util['format'](_0xe712('0xee'),_0x4d95ae['interval'])},client9002)[_0xe712('0x15')](function(_0x2da482){var _0x40c308=_0x2da482&&_0x2da482[_0xe712('0xef')]('true')>=0x0?!![]:![];logger[_0xe712('0x16')](_0xe712('0xf0'),_0x22e476['id'],_0x4d95ae['id'],_0x4d95ae[_0xe712('0xf1')],_0x40c308?_0xe712('0xf2'):'OFFLINE',_0x22e476['timezone']?_0x22e476[_0xe712('0xec')]:'No\x20timezone');return _0x40c308;})[_0xe712('0x45')](function(_0x40b980){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x22e476['id'],_0x4d95ae['id'],_0x4d95ae['interval'],util[_0xe712('0xf3')](_0x40b980,{'showHidden':![],'depth':null}),_0x22e476[_0xe712('0xec')]?_0x22e476['timezone']:_0xe712('0xf4'));return![];});}exports[_0xe712('0xeb')]=function(_0x469b02,_0x548221){var _0x5bc3e2=0x0;var _0x2ede4b=0x0;var _0x1c8af6=![];var _0x24aef1;var _0x200839;return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x469b02[_0xe712('0x47')]['id']},'include':[{'model':db[_0xe712('0xf5')],'as':_0xe712('0xf5'),'include':[{'model':db[_0xe712('0xf5')],'as':_0xe712('0xf6'),'attributes':['id',_0xe712('0xf1')],'raw':!![]}]}]})[_0xe712('0x15')](handleEntityNotFound(_0x548221,null))[_0xe712('0x15')](function(_0x15ec1d){if(_0x15ec1d){_0x24aef1=_0x15ec1d;return _0x15ec1d['getProactiveActions']({'raw':!![]});}})['then'](function(_0x2276e1){if(_0x24aef1){if(_0x2276e1){_0x200839=_0x2276e1;}}return require(_0xe712('0xf7'))[_0xe712('0x69')]();})['then'](function(_0x16c366){if(_0x16c366){_0x2ede4b=_0x16c366['virtual'];_0x1c8af6=_0x16c366[_0xe712('0x6a')];}})[_0xe712('0x15')](function(){return db[_0xe712('0xa0')][_0xe712('0x24')]({'where':{'closed':![]}});})[_0xe712('0x15')](function(_0x1f2000){_0x5bc3e2=_0x1f2000;if(_0x2ede4b&&_0x1f2000>_0x2ede4b){return db['License'][_0xe712('0x57')]({'where':{'id':0x1}})[_0xe712('0x15')](function(_0xe62424){if(_0xe62424){_0xe62424[_0xe712('0xf8')](_0xe712('0xf9'));}});}})['then'](function(){if(_0x24aef1[_0xe712('0xf5')]&&_0x24aef1[_0xe712('0xf5')][_0xe712('0xf6')]){var _0x4d3f44=[];for(var _0x7ecbd4=0x0;_0x7ecbd4<_0x24aef1['Interval']['Intervals']['length'];_0x7ecbd4++){var _0x4651cb=_0x24aef1['Interval'][_0xe712('0xf6')][_0x7ecbd4][_0xe712('0x50')]({'plain':!![]});_0x4d3f44[_0xe712('0xa9')](iftimePromise(_0x4651cb,_0x24aef1));}return BPromise[_0xe712('0xfa')](_0x4d3f44)['then'](function(_0x1fc8f5){return _[_0xe712('0xfb')](_0x1fc8f5);});}else{return!![];}})['then'](function(_0x326cd0){var _0x18318f=fs[_0xe712('0xbf')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0xfc')),_0xe712('0xc1'));var _0x56f9bd={'remote':_0x24aef1[_0xe712('0xfd')],'query':querystring[_0xe712('0x1a')](_[_0xe712('0x40')](_0x24aef1[_0xe712('0x50')]({'plain':!![]}),{'customerIp':_0x469b02[_0xe712('0x79')][_0xe712('0x93')]||_0x469b02[_0xe712('0x79')][_0xe712('0xfe')]||_0x469b02['connection'][_0xe712('0xff')]||_0x469b02['ip'],'referer':_0x469b02['headers']['referer'],'openedInteractions':_0x5bc3e2,'maxInteractions':_0x2ede4b,'virtual':_0x1c8af6['virtual'],'online':_0x326cd0,'custom':_0x1c8af6}))[_0xe712('0x100')](/'/g,'\x5c\x27')};_0x548221[_0xe712('0x2c')](ejs[_0xe712('0xc2')](Mustache[_0xe712('0xc2')](_0x18318f,_0x56f9bd),{'proactiveActions':_0x200839,'alignment':_0x24aef1[_0xe712('0x101')],'verticalAlignment':_0x24aef1['verticalAlignment'],'div_color':_0x24aef1[_0xe712('0xe8')],'labelText':_0x24aef1[_0xe712('0x102')],'text_color':_0x24aef1[_0xe712('0x103')],'text_button_color':_0x24aef1[_0xe712('0x104')],'button_color':_0x24aef1[_0xe712('0x105')],'background_color':_0x24aef1[_0xe712('0x106')],'hideWhenOffline':_0x24aef1[_0xe712('0x107')],'interval':_0x24aef1['IntervalId']}));})[_0xe712('0x45')](handleError(_0x548221,null));};exports[_0xe712('0x108')]=function(_0x3c2143,_0x478e6e){var _0x41d159=_0x3c2143[_0xe712('0x47')]['id'];var _0x24d696=_0x3c2143['body'];var _0x5e1c7b=0xc8;var _0x122fbc=null;return db[_0xe712('0xc8')][_0xe712('0xc9')]({'isolationLevel':db['sequelize'][_0xe712('0x109')][_0xe712('0x10a')][_0xe712('0x10b')]},function(_0x4d4338){return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x41d159},'transaction':_0x4d4338})[_0xe712('0x15')](function(_0x95c9bd){if(_0x95c9bd){return db['ChatApplication'][_0xe712('0x27')]({'where':{'ChatWebsiteId':_0x41d159},'transaction':_0x4d4338})['then'](function(){var _0x2f122e=_[_0xe712('0x2f')](_0x24d696,function(_0x4558f3){_0x4558f3['ChatWebsiteId']=_0x41d159;return _0x4558f3;});return db[_0xe712('0x88')]['bulkCreate'](_0x2f122e,{'transaction':_0x4d4338});});}else{_0x5e1c7b=0x194;_0x122fbc=[];}});})[_0xe712('0x15')](function(){if(_0x5e1c7b!==0x194){return db['ChatApplication'][_0xe712('0x10c')]({'where':{'ChatWebsiteId':_0x41d159},'order':_0xe712('0x10d')})['then'](function(_0x2b8f78){_0x122fbc=_0x2b8f78;});}})[_0xe712('0x45')](function(_0x5908a2){_0x5e1c7b=0x1f4;logger[_0xe712('0x1b')](_0x5908a2['stack']);if(_0x5908a2[_0xe712('0x2b')]){delete _0x5908a2[_0xe712('0x2b')];}_0x122fbc=_0x5908a2;})[_0xe712('0x10e')](function(){if(_0x122fbc===null){_0x478e6e['sendStatus'](_0x5e1c7b);}else{if(_0x5e1c7b===0x1f4){_0x478e6e[_0xe712('0x1f')](_0x5e1c7b)['send'](_0x122fbc);}else{_0x478e6e['status'](_0x5e1c7b)[_0xe712('0x20')](_0x122fbc);}}});};exports[_0xe712('0x10f')]=function(_0x365789,_0x2b81ff){var _0x4a9f8c={};var _0x437f86={};var _0x550d4e;var _0x3fab6f;return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x365789[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b81ff,null))['then'](function(_0x55e4c5){if(_0x55e4c5){_0x550d4e=_0x55e4c5;_0x437f86[_0xe712('0x35')]=_[_0xe712('0x37')](db['ChatApplication'][_0xe712('0x31')]);_0x437f86[_0xe712('0x36')]=_[_0xe712('0x37')](_0x365789[_0xe712('0x36')]);_0x437f86[_0xe712('0x38')]=_[_0xe712('0x39')](_0x437f86[_0xe712('0x35')],_0x437f86['query']);_0x4a9f8c[_0xe712('0x48')]=_[_0xe712('0x39')](_0x437f86[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x365789[_0xe712('0x36')][_0xe712('0x3a')]));_0x4a9f8c['attributes']=_0x4a9f8c[_0xe712('0x48')][_0xe712('0x3b')]?_0x4a9f8c['attributes']:_0x437f86[_0xe712('0x35')];_0x4a9f8c[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x365789['query'][_0xe712('0x3d')]);_0x4a9f8c[_0xe712('0x3e')]=qs[_0xe712('0x38')](_['pick'](_0x365789[_0xe712('0x36')],_0x437f86[_0xe712('0x38')]));if(_0x365789[_0xe712('0x36')][_0xe712('0x41')]){_0x4a9f8c[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x4a9f8c[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x4a9f8c[_0xe712('0x48')],function(_0x39939c){var _0x441503={};_0x441503[_0x39939c]={'$like':'%'+_0x365789['query']['filter']+'%'};return _0x441503;})});}_0x4a9f8c=_['merge']({},_0x4a9f8c,_0x365789[_0xe712('0x42')]);return _0x550d4e['getApplications'](_0x4a9f8c);}})[_0xe712('0x15')](function(_0x33bd87){if(_0x33bd87){_0x3fab6f=_0x33bd87[_0xe712('0x3b')];if(!_0x365789[_0xe712('0x36')]['hasOwnProperty'](_0xe712('0x58'))){_0x4a9f8c[_0xe712('0x23')]=qs['limit'](_0x365789[_0xe712('0x36')][_0xe712('0x23')]);_0x4a9f8c[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x365789[_0xe712('0x36')][_0xe712('0x21')]);}return _0x550d4e[_0xe712('0x10f')](_0x4a9f8c);}})[_0xe712('0x15')](function(_0x19f1d8){if(_0x19f1d8){return _0x19f1d8?{'count':_0x3fab6f,'rows':_0x19f1d8}:null;}})['then'](respondWithResult(_0x2b81ff,null))[_0xe712('0x45')](handleError(_0x2b81ff,null));};exports[_0xe712('0x110')]=function(_0x155623,_0x4b5778){return db[_0xe712('0x111')][_0xe712('0x4a')]({'where':{'id':_0x155623[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x4b5778,null))[_0xe712('0x15')](function(_0x4bb2d5){if(_0x4bb2d5){return _0x4bb2d5[_0xe712('0x110')](_0x155623['body']['ids'],_[_0xe712('0xe3')](_0x155623[_0xe712('0x4c')],[_0xe712('0xe2'),'id'])||{});}})[_0xe712('0x15')](respondWithResult(_0x4b5778,null))['catch'](handleError(_0x4b5778,null));};exports['getProactiveActions']=function(_0xad673a,_0x760b79){var _0x2af08f={};var _0x1b3bc6={};var _0x1afd18;var _0x24c49e;return db[_0xe712('0x30')]['findOne']({'where':{'id':_0xad673a['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x760b79,null))[_0xe712('0x15')](function(_0x1ca987){if(_0x1ca987){_0x1afd18=_0x1ca987;_0x1b3bc6[_0xe712('0x35')]=_[_0xe712('0x37')](db[_0xe712('0x112')][_0xe712('0x31')]);_0x1b3bc6[_0xe712('0x36')]=_[_0xe712('0x37')](_0xad673a[_0xe712('0x36')]);_0x1b3bc6[_0xe712('0x38')]=_['intersection'](_0x1b3bc6[_0xe712('0x35')],_0x1b3bc6['query']);_0x2af08f[_0xe712('0x48')]=_[_0xe712('0x39')](_0x1b3bc6[_0xe712('0x35')],qs[_0xe712('0x3a')](_0xad673a[_0xe712('0x36')]['fields']));_0x2af08f[_0xe712('0x48')]=_0x2af08f[_0xe712('0x48')]['length']?_0x2af08f[_0xe712('0x48')]:_0x1b3bc6[_0xe712('0x35')];_0x2af08f[_0xe712('0x59')]=qs['sort'](_0xad673a[_0xe712('0x36')][_0xe712('0x3d')]);_0x2af08f[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0xad673a[_0xe712('0x36')],_0x1b3bc6[_0xe712('0x38')]));if(_0xad673a[_0xe712('0x36')]['filter']){_0x2af08f['where']=_[_0xe712('0x40')](_0x2af08f[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x2af08f[_0xe712('0x48')],function(_0x318e0f){var _0x3aaf3b={};_0x3aaf3b[_0x318e0f]={'$like':'%'+_0xad673a[_0xe712('0x36')]['filter']+'%'};return _0x3aaf3b;})});}_0x2af08f=_[_0xe712('0x40')]({},_0x2af08f,_0xad673a['options']);return _0x1afd18[_0xe712('0x113')](_0x2af08f);}})['then'](function(_0x5afc71){if(_0x5afc71){_0x24c49e=_0x5afc71['length'];if(!_0xad673a[_0xe712('0x36')]['hasOwnProperty'](_0xe712('0x58'))){_0x2af08f[_0xe712('0x23')]=qs[_0xe712('0x23')](_0xad673a[_0xe712('0x36')][_0xe712('0x23')]);_0x2af08f[_0xe712('0x21')]=qs[_0xe712('0x21')](_0xad673a[_0xe712('0x36')]['offset']);}return _0x1afd18[_0xe712('0x113')](_0x2af08f);}})['then'](function(_0x415e86){if(_0x415e86){return _0x415e86?{'count':_0x24c49e,'rows':_0x415e86}:null;}})[_0xe712('0x15')](respondWithResult(_0x760b79,null))[_0xe712('0x45')](handleError(_0x760b79,null));};exports[_0xe712('0x114')]=function(_0x43cf90,_0x4aaf04){var _0x5b820b=_0x43cf90[_0xe712('0x36')][_0xe712('0x115')]===_0xe712('0x116')?_0xe712('0x117'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x5b820b],'where':{'id':_0x43cf90['params']['id']}})['then'](handleEntityNotFound(_0x4aaf04,null))[_0xe712('0x15')](function(_0x3504b9){if(_0x3504b9){var _0x11e211=_0x3504b9[_0x5b820b];var _0x3264de=_0x11e211&&_0x11e211[_0xe712('0x118')]?_0x11e211['items']:[];_0x4aaf04[_0xe712('0x2c')]({'fromKey':_[_0xe712('0x6b')](_0x11e211[_0xe712('0x119')])?undefined:_0x11e211[_0xe712('0x119')],'count':_0x3264de[_0xe712('0x3b')],'rows':_0x3264de});}})[_0xe712('0x45')](handleError(_0x4aaf04,null));};exports[_0xe712('0x11a')]=function(_0x69a2ce,_0x34987a){var _0x2aa5c1={'raw':![],'where':{}};var _0x3dc8c7={};var _0x4ae74a={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x69a2ce[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x34987a,null))[_0xe712('0x15')](function(_0x55de51){if(_0x55de51){_0x3dc8c7['model']=_[_0xe712('0x37')](db[_0xe712('0x11b')]['rawAttributes']);_0x3dc8c7[_0xe712('0x36')]=_[_0xe712('0x37')](_0x69a2ce[_0xe712('0x36')]);_0x3dc8c7[_0xe712('0x38')]=_[_0xe712('0x39')](_0x3dc8c7[_0xe712('0x35')],_0x3dc8c7[_0xe712('0x36')]);_0x2aa5c1['attributes']=_[_0xe712('0x39')](_0x3dc8c7[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x69a2ce[_0xe712('0x36')][_0xe712('0x3a')]));_0x2aa5c1['attributes']=_0x2aa5c1[_0xe712('0x48')][_0xe712('0x3b')]?_0x2aa5c1[_0xe712('0x48')]:_0x3dc8c7[_0xe712('0x35')];if(!_0x69a2ce[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x2aa5c1[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x69a2ce[_0xe712('0x36')]['limit']);_0x2aa5c1[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x69a2ce[_0xe712('0x36')][_0xe712('0x21')]);}_0x2aa5c1['order']=qs[_0xe712('0x3d')](_0x69a2ce['query'][_0xe712('0x3d')]);_0x2aa5c1[_0xe712('0x3e')]=qs['filters'](_[_0xe712('0x3f')](_0x69a2ce['query'],_0x3dc8c7[_0xe712('0x38')]));_0x2aa5c1[_0xe712('0x3e')][_0xe712('0x54')]=_0x55de51['id'];if(_0x69a2ce[_0xe712('0x36')][_0xe712('0x41')]){_0x2aa5c1[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x2aa5c1[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x2aa5c1[_0xe712('0x48')],function(_0xaf7e0d){var _0x54bbcf={};_0x54bbcf[_0xaf7e0d]={'$like':'%'+_0x69a2ce[_0xe712('0x36')][_0xe712('0x41')]+'%'};return _0x54bbcf;})});}_0x2aa5c1=_[_0xe712('0x40')]({},_0x2aa5c1,_0x69a2ce[_0xe712('0x42')]);return db['ChatOfflineMessage'][_0xe712('0x24')]({'where':_0x2aa5c1[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x5ee1d0){_0x4ae74a[_0xe712('0x24')]=_0x5ee1d0;if(_0x69a2ce[_0xe712('0x36')]['includeAll']){_0x2aa5c1[_0xe712('0x43')]=[{'all':!![]}];}else{_0x2aa5c1[_0xe712('0x43')]=[{'model':db['CmContact'],'as':_0xe712('0xe4'),'required':![]},{'model':db[_0xe712('0xca')],'as':_0xe712('0x11c'),'required':![]}];}return db['ChatOfflineMessage'][_0xe712('0x5a')](_0x2aa5c1);})[_0xe712('0x15')](function(_0x5ec669){_0x4ae74a[_0xe712('0x44')]=_0x5ec669;return _0x4ae74a;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x34987a,_0x2aa5c1))[_0xe712('0x45')](handleError(_0x34987a,null));};exports[_0xe712('0x11d')]=function(_0x21ce53,_0x40f95a){return db[_0xe712('0x30')]['find']({'where':{'id':_0x21ce53['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x40f95a,null))[_0xe712('0x15')](function(_0xa4168c){if(_0xa4168c){return _0xa4168c['addAgents'](_0x21ce53['body'][_0xe712('0xe2')],_[_0xe712('0xe3')](_0x21ce53[_0xe712('0x4c')],['ids','id'])||{})[_0xe712('0xa4')](function(_0x23645e){for(var _0x24e2c2=0x0;_0x24e2c2<_0x21ce53['body'][_0xe712('0xe2')][_0xe712('0x3b')];_0x24e2c2+=0x1){socket[_0xe712('0x11e')](_0xe712('0x11f'),{'UserId':Number(_0x21ce53[_0xe712('0x4c')][_0xe712('0xe2')][_0x24e2c2]),'ChatWebsiteId':Number(_0x21ce53[_0xe712('0x47')]['id'])});}return _0x23645e;});}})[_0xe712('0x15')](respondWithResult(_0x40f95a,null))[_0xe712('0x45')](handleError(_0x40f95a,null));};exports[_0xe712('0x120')]=function(_0x375d75,_0x1b1b75){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x375d75[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x1b1b75,null))[_0xe712('0x15')](function(_0xdb8ef0){if(_0xdb8ef0){return _0xdb8ef0[_0xe712('0x120')](_0x375d75['query'][_0xe712('0xe2')])[_0xe712('0x15')](function(){if(_[_0xe712('0x121')](_0x375d75['query']['ids'])){for(var _0x5280cb=0x0;_0x5280cb<_0x375d75[_0xe712('0x36')][_0xe712('0xe2')][_0xe712('0x3b')];_0x5280cb+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x375d75['query'][_0xe712('0xe2')][_0x5280cb]),'ChatWebsiteId':Number(_0x375d75[_0xe712('0x47')]['id'])});}}else{socket[_0xe712('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x375d75[_0xe712('0x36')][_0xe712('0xe2')]),'ChatWebsiteId':Number(_0x375d75[_0xe712('0x47')]['id'])});}});}})[_0xe712('0x15')](respondWithStatusCode(_0x1b1b75,null))[_0xe712('0x45')](handleError(_0x1b1b75,null));};exports['getAgents']=function(_0x2cbd7a,_0x1a43df){var _0x18a845={};var _0x36013d={};var _0x1fbf52;var _0x4d21ef;return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x2cbd7a[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x1a43df,null))[_0xe712('0x15')](function(_0x1b512d){if(_0x1b512d){_0x1fbf52=_0x1b512d;_0x36013d['model']=_['keys'](db['User'][_0xe712('0x31')]);_0x36013d['query']=_[_0xe712('0x37')](_0x2cbd7a[_0xe712('0x36')]);_0x36013d[_0xe712('0x38')]=_[_0xe712('0x39')](_0x36013d[_0xe712('0x35')],_0x36013d[_0xe712('0x36')]);_0x18a845[_0xe712('0x48')]=_[_0xe712('0x39')](_0x36013d[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x3a')]));_0x18a845[_0xe712('0x48')]=_0x18a845[_0xe712('0x48')][_0xe712('0x3b')]?_0x18a845[_0xe712('0x48')]:_0x36013d[_0xe712('0x35')];_0x18a845['order']=qs[_0xe712('0x3d')](_0x2cbd7a[_0xe712('0x36')]['sort']);_0x18a845[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x2cbd7a[_0xe712('0x36')],_0x36013d[_0xe712('0x38')]));if(_0x2cbd7a[_0xe712('0x36')][_0xe712('0x41')]){_0x18a845[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x18a845[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x18a845['attributes'],function(_0x3240bc){var _0x3b5dbe={};_0x3b5dbe[_0x3240bc]={'$like':'%'+_0x2cbd7a['query'][_0xe712('0x41')]+'%'};return _0x3b5dbe;})});}_0x18a845=_[_0xe712('0x40')]({},_0x18a845,_0x2cbd7a[_0xe712('0x42')]);return _0x1fbf52['getAgents'](_0x18a845);}})[_0xe712('0x15')](function(_0x4e5425){if(_0x4e5425){_0x4d21ef=_0x4e5425[_0xe712('0x3b')];if(!_0x2cbd7a[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x18a845[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x23')]);_0x18a845[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x21')]);}return _0x1fbf52['getAgents'](_0x18a845);}})['then'](function(_0x1990c0){if(_0x1990c0){return _0x1990c0?{'count':_0x4d21ef,'rows':_0x1990c0}:null;}})[_0xe712('0x15')](respondWithResult(_0x1a43df,null))[_0xe712('0x45')](handleError(_0x1a43df,null));};
\ No newline at end of file
index 888a37c..34b0dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1bbbfe,_0x3917da){var _0x2ccd29=function(_0xc60402){while(--_0xc60402){_0x1bbbfe['push'](_0x1bbbfe['shift']());}};_0x2ccd29(++_0x3917da);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x489391,_0x58c55e){_0x489391=_0x489391-0x0;var _0x32cb9c=_0x9c5a[_0x489391];return _0x32cb9c;};'use strict';var EventEmitter=require(_0xa9c5('0x0'));var ChatWebsite=require(_0xa9c5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa9c5('0x2')](0x0);var events={'afterCreate':_0xa9c5('0x3'),'afterUpdate':_0xa9c5('0x4'),'afterDestroy':_0xa9c5('0x5')};function emitEvent(_0x4f5552){return function(_0x2acfaf,_0x3051b1,_0x4e9403){ChatWebsiteEvents[_0xa9c5('0x6')](_0x4f5552+':'+_0x2acfaf['id'],_0x2acfaf);ChatWebsiteEvents['emit'](_0x4f5552,_0x2acfaf);_0x4e9403(null);};}for(var e in events){if(events[_0xa9c5('0x7')](e)){var event=events[e];ChatWebsite[_0xa9c5('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x27bf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x5411cb,_0x1cd69d){var _0x32727a=function(_0x22a762){while(--_0x22a762){_0x5411cb['push'](_0x5411cb['shift']());}};_0x32727a(++_0x1cd69d);}(_0x27bf,0x117));var _0xf27b=function(_0x294bdb,_0x2ea616){_0x294bdb=_0x294bdb-0x0;var _0x5b9b54=_0x27bf[_0x294bdb];return _0x5b9b54;};'use strict';var EventEmitter=require(_0xf27b('0x0'));var ChatWebsite=require(_0xf27b('0x1'))['db'][_0xf27b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf27b('0x3')](0x0);var events={'afterCreate':_0xf27b('0x4'),'afterUpdate':_0xf27b('0x5'),'afterDestroy':_0xf27b('0x6')};function emitEvent(_0x2ff64c){return function(_0x339bb9,_0x1542e3,_0x2e1396){ChatWebsiteEvents['emit'](_0x2ff64c+':'+_0x339bb9['id'],_0x339bb9);ChatWebsiteEvents[_0xf27b('0x7')](_0x2ff64c,_0x339bb9);_0x2e1396(null);};}for(var e in events){if(events[_0xf27b('0x8')](e)){var event=events[e];ChatWebsite[_0xf27b('0x9')](e,emitEvent(event));}}module[_0xf27b('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
index 3b1b0f1..0042e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b4=['ChatWebsite','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x2eda54,_0x5a81b5){var _0x5129f6=function(_0x4a2c58){while(--_0x4a2c58){_0x2eda54['push'](_0x2eda54['shift']());}};_0x5129f6(++_0x5a81b5);}(_0xb6b4,0x1e5));var _0x4b6b=function(_0x4c4cd6,_0x14d550){_0x4c4cd6=_0x4c4cd6-0x0;var _0x1cfd0b=_0xb6b4[_0x4c4cd6];return _0x1cfd0b;};'use strict';var _=require('lodash');var util=require(_0x4b6b('0x0'));var logger=require(_0x4b6b('0x1'))(_0x4b6b('0x2'));var moment=require(_0x4b6b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b6b('0x5'));var config=require(_0x4b6b('0x6'));var attributes=require(_0x4b6b('0x7'));module[_0x4b6b('0x8')]=function(_0x27be97,_0xe9aa6c){return _0x27be97[_0x4b6b('0x9')](_0x4b6b('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b79=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path'];(function(_0x9ae56b,_0x599717){var _0x15a414=function(_0x4d9069){while(--_0x4d9069){_0x9ae56b['push'](_0x9ae56b['shift']());}};_0x15a414(++_0x599717);}(_0x3b79,0x10e));var _0x93b7=function(_0x150c8f,_0x1c20ff){_0x150c8f=_0x150c8f-0x0;var _0x578c39=_0x3b79[_0x150c8f];return _0x578c39;};'use strict';var _=require(_0x93b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x93b7('0x1'));var moment=require(_0x93b7('0x2'));var BPromise=require(_0x93b7('0x3'));var rp=require(_0x93b7('0x4'));var fs=require('fs');var path=require(_0x93b7('0x5'));var rimraf=require(_0x93b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x93b7('0x7'));module[_0x93b7('0x8')]=function(_0xc87a01,_0x4e45cf){return _0xc87a01[_0x93b7('0x9')](_0x93b7('0xa'),attributes,{'tableName':_0x93b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfae919..0929791 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfc7=['defaults','redis','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x469558,_0x190c1b){var _0x277ec2=function(_0x1e8e5e){while(--_0x1e8e5e){_0x469558['push'](_0x469558['shift']());}};_0x277ec2(++_0x190c1b);}(_0xbfc7,0x107));var _0x7bfc=function(_0x5ce2ca,_0x5bc6d7){_0x5ce2ca=_0x5ce2ca-0x0;var _0x86fb86=_0xbfc7[_0x5ce2ca];return _0x86fb86;};'use strict';var _=require(_0x7bfc('0x0'));var util=require(_0x7bfc('0x1'));var moment=require(_0x7bfc('0x2'));var BPromise=require(_0x7bfc('0x3'));var rs=require(_0x7bfc('0x4'));var fs=require('fs');var Redis=require(_0x7bfc('0x5'));var db=require(_0x7bfc('0x6'))['db'];var utils=require(_0x7bfc('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7bfc('0x8'));var jayson=require(_0x7bfc('0x9'));var client=jayson[_0x7bfc('0xa')][_0x7bfc('0xb')]({'port':0x232a});config['redis']=_[_0x7bfc('0xc')](config[_0x7bfc('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bfc('0xd')]));require(_0x7bfc('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e7dfa,_0x312a65,_0xa86981){return new BPromise(function(_0x181ff3,_0x16b191){return client[_0x7bfc('0xf')](_0x1e7dfa,_0xa86981)[_0x7bfc('0x10')](function(_0x1e3813){logger['info'](_0x7bfc('0x11'),_0x312a65,'request\x20sent');logger[_0x7bfc('0x12')](_0x7bfc('0x13'),_0x312a65,_0x7bfc('0x14'),JSON[_0x7bfc('0x15')](_0x1e3813));if(_0x1e3813['error']){if(_0x1e3813['error']['code']===0x1f4){logger[_0x7bfc('0x16')](_0x7bfc('0x11'),_0x312a65,_0x1e3813[_0x7bfc('0x16')][_0x7bfc('0x17')]);return _0x16b191(_0x1e3813['error'][_0x7bfc('0x17')]);}logger[_0x7bfc('0x16')](_0x7bfc('0x11'),_0x312a65,_0x1e3813[_0x7bfc('0x16')]['message']);return _0x181ff3(_0x1e3813[_0x7bfc('0x16')][_0x7bfc('0x17')]);}else{logger[_0x7bfc('0x18')](_0x7bfc('0x11'),_0x312a65,'request\x20sent');_0x181ff3(_0x1e3813['result'][_0x7bfc('0x17')]);}})['catch'](function(_0xae5c9f){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x312a65,_0xae5c9f);_0x16b191(_0xae5c9f);});});}
\ No newline at end of file
+var _0xd6cb=['lodash','util','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','catch'];(function(_0x5ba545,_0x95a648){var _0x32d860=function(_0xa943a9){while(--_0xa943a9){_0x5ba545['push'](_0x5ba545['shift']());}};_0x32d860(++_0x95a648);}(_0xd6cb,0x138));var _0xbd6c=function(_0x4f9476,_0x3eadc7){_0x4f9476=_0x4f9476-0x0;var _0x3296a4=_0xd6cb[_0x4f9476];return _0x3296a4;};'use strict';var _=require(_0xbd6c('0x0'));var util=require(_0xbd6c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd6c('0x2'));var logger=require('../../config/logger')(_0xbd6c('0x3'));var config=require('../../config/environment');var jayson=require(_0xbd6c('0x4'));var client=jayson[_0xbd6c('0x5')][_0xbd6c('0x6')]({'port':0x232a});config[_0xbd6c('0x7')]=_['defaults'](config['redis'],{'host':_0xbd6c('0x8'),'port':0x18eb});var socket=require(_0xbd6c('0x9'))(new Redis(config['redis']));require(_0xbd6c('0xa'))[_0xbd6c('0xb')](socket);function respondWithRpcPromise(_0x174199,_0x1fb3b8,_0x52441e){return new BPromise(function(_0x313915,_0x17ad43){return client[_0xbd6c('0xc')](_0x174199,_0x52441e)[_0xbd6c('0xd')](function(_0x57b205){logger[_0xbd6c('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,'request\x20sent');logger[_0xbd6c('0xf')](_0xbd6c('0x10'),_0x1fb3b8,'request\x20sent',JSON[_0xbd6c('0x11')](_0x57b205));if(_0x57b205[_0xbd6c('0x12')]){if(_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x13')]===0x1f4){logger[_0xbd6c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x14')]);return _0x17ad43(_0x57b205[_0xbd6c('0x12')]['message']);}logger['error'](_0xbd6c('0x15'),_0x1fb3b8,_0x57b205['error'][_0xbd6c('0x14')]);return _0x313915(_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x14')]);}else{logger[_0xbd6c('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,_0xbd6c('0x16'));_0x313915(_0x57b205['result'][_0xbd6c('0x14')]);}})[_0xbd6c('0x17')](function(_0x8c41be){logger[_0xbd6c('0x12')](_0xbd6c('0x15'),_0x1fb3b8,_0x8c41be);_0x17ad43(_0x8c41be);});});}
\ No newline at end of file
index 180312a..dea12f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa560=['length','chatWebsite:','save','register'];(function(_0x5beaa1,_0x3a03c1){var _0x4349e3=function(_0x6c0e67){while(--_0x6c0e67){_0x5beaa1['push'](_0x5beaa1['shift']());}};_0x4349e3(++_0x3a03c1);}(_0xa560,0xf2));var _0x0a56=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa560[_0x21a9d9];return _0x46adce;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x0a56('0x0'),'remove','update'];function createListener(_0x436493,_0x235279){return function(_0x3eb5d2){_0x235279['emit'](_0x436493,_0x3eb5d2);};}function removeListener(_0x2e69b7,_0x12e0e1){return function(){ChatWebsiteEvents['removeListener'](_0x2e69b7,_0x12e0e1);};}exports[_0x0a56('0x1')]=function(_0x401f3d){for(var _0x551651=0x0,_0x534e62=events[_0x0a56('0x2')];_0x551651<_0x534e62;_0x551651++){var _0x4ecff7=events[_0x551651];var _0x402351=createListener(_0x0a56('0x3')+_0x4ecff7,_0x401f3d);ChatWebsiteEvents['on'](_0x4ecff7,_0x402351);}};
\ No newline at end of file
+var _0xaf67=['length','save','remove','update','emit','removeListener'];(function(_0x2d0cdd,_0x5b25b4){var _0x30ba3a=function(_0x150a0d){while(--_0x150a0d){_0x2d0cdd['push'](_0x2d0cdd['shift']());}};_0x30ba3a(++_0x5b25b4);}(_0xaf67,0x115));var _0x7af6=function(_0x3d1928,_0x9410ed){_0x3d1928=_0x3d1928-0x0;var _0x1e5a43=_0xaf67[_0x3d1928];return _0x1e5a43;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7af6('0x0'),_0x7af6('0x1'),_0x7af6('0x2')];function createListener(_0x4d912c,_0x27cc9){return function(_0x134e9e){_0x27cc9[_0x7af6('0x3')](_0x4d912c,_0x134e9e);};}function removeListener(_0x4aa82b,_0x45da4c){return function(){ChatWebsiteEvents[_0x7af6('0x4')](_0x4aa82b,_0x45da4c);};}exports['register']=function(_0x1039ca){for(var _0x3405e4=0x0,_0x5c1788=events[_0x7af6('0x5')];_0x3405e4<_0x5c1788;_0x3405e4++){var _0x57a3e8=events[_0x3405e4];var _0x55696f=createListener('chatWebsite:'+_0x57a3e8,_0x1039ca);ChatWebsiteEvents['on'](_0x57a3e8,_0x55696f);}};
\ No newline at end of file
index 2f02297..1bc4d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d4=['/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','join','root','format','now','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0x142040,_0x45796b){var _0x16beea=function(_0xce294a){while(--_0xce294a){_0x142040['push'](_0x142040['shift']());}};_0x16beea(++_0x45796b);}(_0x09d4,0x18d));var _0x409d=function(_0x10d056,_0x4fa586){_0x10d056=_0x10d056-0x0;var _0x243a79=_0x09d4[_0x10d056];return _0x243a79;};'use strict';var multer=require(_0x409d('0x0'));var util=require('util');var path=require(_0x409d('0x1'));var timeout=require(_0x409d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x409d('0x3'));var interaction=require(_0x409d('0x4'));var config=require(_0x409d('0x5'));var controller=require(_0x409d('0x6'));router[_0x409d('0x7')]('/',auth[_0x409d('0x8')](),controller[_0x409d('0x9')]);router['get']('/describe',auth[_0x409d('0x8')](),controller[_0x409d('0xa')]);router['get'](_0x409d('0xb'),auth[_0x409d('0x8')](),controller['show']);router[_0x409d('0x7')](_0x409d('0xc'),auth[_0x409d('0x8')](),controller[_0x409d('0xd')]);router[_0x409d('0x7')]('/:id/canned_answers',auth[_0x409d('0x8')](),controller[_0x409d('0xe')]);router[_0x409d('0x7')](_0x409d('0xf'),controller[_0x409d('0x10')]);router['get'](_0x409d('0x11'),controller[_0x409d('0x12')]);router[_0x409d('0x7')](_0x409d('0x13'),controller['getCustomerAvatar']);router['get'](_0x409d('0x14'),controller['getSystemAvatar']);router['get'](_0x409d('0x15'),auth[_0x409d('0x8')](),controller[_0x409d('0x16')]);router[_0x409d('0x7')](_0x409d('0x17'),controller[_0x409d('0x18')]);router[_0x409d('0x7')](_0x409d('0x19'),auth[_0x409d('0x8')](),controller[_0x409d('0x1a')]);router[_0x409d('0x7')](_0x409d('0x1b'),auth[_0x409d('0x8')](),controller[_0x409d('0x1c')]);router['get'](_0x409d('0x1d'),controller[_0x409d('0x1e')]);router['get'](_0x409d('0x1f'),auth[_0x409d('0x8')](),controller[_0x409d('0x20')]);router[_0x409d('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x409d('0x21')]);router[_0x409d('0x22')]('/',auth[_0x409d('0x8')](),controller['create']);router[_0x409d('0x22')](_0x409d('0xc'),auth[_0x409d('0x8')](),controller[_0x409d('0x23')]);router[_0x409d('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x409d('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54d315,_0x17b99a,_0x107cdc){_0x107cdc(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/logos/'));},'filename':function(_0x329c42,_0x26a963,_0x52ac49){_0x52ac49(null,util[_0x409d('0x27')]('%s-%s',Date[_0x409d('0x28')](),_0x26a963['originalname']));}})});router[_0x409d('0x22')](_0x409d('0xf'),upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x2b')]);var upload=multer({'storage':multer[_0x409d('0x2c')]({'destination':function(_0x17ca64,_0x47ced7,_0x433217){_0x433217(null,path['join'](config[_0x409d('0x26')],_0x409d('0x2d')));},'filename':function(_0x41b991,_0x202c69,_0x1adb8e){_0x1adb8e(null,util['format'](_0x409d('0x2e'),Date[_0x409d('0x28')](),_0x202c69[_0x409d('0x2f')]));}})});router[_0x409d('0x22')]('/:id/avatar',upload['single'](_0x409d('0x2a')),controller[_0x409d('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ef34a,_0x41b34e,_0x1d68c6){_0x1d68c6(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x5ad8fa,_0xb9dfca,_0xda716a){_0xda716a(null,util[_0x409d('0x27')](_0x409d('0x2e'),Date[_0x409d('0x28')](),_0xb9dfca[_0x409d('0x2f')]));}})});router[_0x409d('0x22')](_0x409d('0x13'),upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x470320,_0x5257c4,_0x5c4be6){_0x5c4be6(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x14dbda,_0x294976,_0x4dd6ad){_0x4dd6ad(null,util[_0x409d('0x27')](_0x409d('0x2e'),Date['now'](),_0x294976[_0x409d('0x2f')]));}})});router['post']('/:id/system_avatar',upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x32')]);router[_0x409d('0x22')](_0x409d('0x33'),controller[_0x409d('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x409d('0x2c')]({'destination':function(_0x575951,_0x2b1a60,_0xe306f1){const _0x97d3e5=path[_0x409d('0x25')](config[_0x409d('0x26')],_0x409d('0x35'),'attachments',_0x409d('0x36'));fs_extra['ensureDir'](_0x97d3e5,function(){_0xe306f1(null,_0x97d3e5);});},'filename':function(_0x4a45f7,_0x572eb4,_0x293de8){const _0x4ecfae=_0x572eb4[_0x409d('0x2f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d459a=path[_0x409d('0x37')](_0x4ecfae);const _0x654ba3=Date['now']()+'-'+_0x4ecfae['replace'](_0x3d459a,'')+_0x3d459a;_0x293de8(null,_0x654ba3);}})});router[_0x409d('0x22')](_0x409d('0x38'),offlineUploadMulter[_0x409d('0x39')](),controller[_0x409d('0x3a')]);router[_0x409d('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x409d('0x3b')]);router[_0x409d('0x22')](_0x409d('0x19'),auth[_0x409d('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x409d('0x8')](),controller[_0x409d('0x3c')]);router[_0x409d('0x22')](_0x409d('0x3d'),auth[_0x409d('0x8')](),controller[_0x409d('0x3e')]);router[_0x409d('0x3f')]('/:id',auth[_0x409d('0x8')](),controller[_0x409d('0x40')]);router[_0x409d('0x41')]('/:id',auth[_0x409d('0x8')](),controller[_0x409d('0x42')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x409d('0x43')]);router['delete'](_0x409d('0x44'),auth[_0x409d('0x8')](),controller[_0x409d('0x45')]);router[_0x409d('0x41')]('/:id/users',auth[_0x409d('0x8')](),controller[_0x409d('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0xeb25=['/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','format','now','originalname','file','addLogo','%s-%s','addAvatar','join','server/files/images/avatars/','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','/:id/interactions','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar'];(function(_0x572ebe,_0x447911){var _0x17e98d=function(_0x183431){while(--_0x183431){_0x572ebe['push'](_0x572ebe['shift']());}};_0x17e98d(++_0x447911);}(_0xeb25,0xff));var _0x5eb2=function(_0x52ac80,_0x903b6a){_0x52ac80=_0x52ac80-0x0;var _0x4f86bb=_0xeb25[_0x52ac80];return _0x4f86bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5eb2('0x0'));var express=require(_0x5eb2('0x1'));var router=express[_0x5eb2('0x2')]();var fs_extra=require(_0x5eb2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5eb2('0x4'));var config=require('../../config/environment');var controller=require(_0x5eb2('0x5'));router[_0x5eb2('0x6')]('/',auth['isAuthenticated'](),controller[_0x5eb2('0x7')]);router[_0x5eb2('0x6')]('/describe',auth[_0x5eb2('0x8')](),controller['describe']);router[_0x5eb2('0x6')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller['show']);router[_0x5eb2('0x6')](_0x5eb2('0xa'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0xb')]);router[_0x5eb2('0x6')](_0x5eb2('0xc'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0xd')]);router[_0x5eb2('0x6')](_0x5eb2('0xe'),controller['getLogo']);router[_0x5eb2('0x6')](_0x5eb2('0xf'),controller[_0x5eb2('0x10')]);router[_0x5eb2('0x6')](_0x5eb2('0x11'),controller['getCustomerAvatar']);router[_0x5eb2('0x6')](_0x5eb2('0x12'),controller[_0x5eb2('0x13')]);router['get']('/:id/interactions',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x14')]);router['get']('/:id/snippet',controller[_0x5eb2('0x15')]);router[_0x5eb2('0x6')](_0x5eb2('0x16'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x17')]);router['get'](_0x5eb2('0x18'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x19')]);router['get'](_0x5eb2('0x1a'),controller[_0x5eb2('0x1b')]);router[_0x5eb2('0x6')](_0x5eb2('0x1c'),auth['isAuthenticated'](),controller[_0x5eb2('0x1d')]);router[_0x5eb2('0x6')]('/:id/users',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x1e')]);router[_0x5eb2('0x1f')]('/',auth['isAuthenticated'](),controller[_0x5eb2('0x20')]);router[_0x5eb2('0x1f')](_0x5eb2('0xa'),auth['isAuthenticated'](),controller[_0x5eb2('0x21')]);router[_0x5eb2('0x1f')](_0x5eb2('0xc'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x22')]);var upload=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0x4a194d,_0x2adeae,_0x353542){_0x353542(null,path['join'](config[_0x5eb2('0x24')],'server/files/images/logos/'));},'filename':function(_0x5c3d7b,_0x84bc18,_0xc35bac){_0xc35bac(null,util[_0x5eb2('0x25')]('%s-%s',Date[_0x5eb2('0x26')](),_0x84bc18[_0x5eb2('0x27')]));}})});router[_0x5eb2('0x1f')]('/:id/logo',upload['single'](_0x5eb2('0x28')),controller[_0x5eb2('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfbcd54,_0x2fb37d,_0x5b8a80){_0x5b8a80(null,path['join'](config[_0x5eb2('0x24')],'server/files/images/avatars/'));},'filename':function(_0xc0f4e1,_0x531a41,_0x374d13){_0x374d13(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date[_0x5eb2('0x26')](),_0x531a41[_0x5eb2('0x27')]));}})});router['post']('/:id/avatar',upload['single'](_0x5eb2('0x28')),controller[_0x5eb2('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17569d,_0x18b683,_0x42e0ac){_0x42e0ac(null,path[_0x5eb2('0x2c')](config[_0x5eb2('0x24')],_0x5eb2('0x2d')));},'filename':function(_0x209062,_0x178663,_0x1164e2){_0x1164e2(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date['now'](),_0x178663[_0x5eb2('0x27')]));}})});router[_0x5eb2('0x1f')](_0x5eb2('0x11'),upload[_0x5eb2('0x2e')]('file'),controller[_0x5eb2('0x2f')]);var upload=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0xf3aed,_0x388b1b,_0x520315){_0x520315(null,path['join'](config[_0x5eb2('0x24')],_0x5eb2('0x2d')));},'filename':function(_0x5cf902,_0x269e00,_0xb855f6){_0xb855f6(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date[_0x5eb2('0x26')](),_0x269e00['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x5eb2('0x2e')](_0x5eb2('0x28')),controller[_0x5eb2('0x30')]);router['post'](_0x5eb2('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0x19fc89,_0x49be7a,_0x4ff9d7){const _0x46addb=path['join'](config[_0x5eb2('0x24')],_0x5eb2('0x32'),_0x5eb2('0x33'),_0x5eb2('0x34'));fs_extra['ensureDir'](_0x46addb,function(){_0x4ff9d7(null,_0x46addb);});},'filename':function(_0x388eb2,_0x20e90f,_0x4e3d7d){const _0x53a7ef=_0x20e90f[_0x5eb2('0x27')][_0x5eb2('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xcebe5a=path[_0x5eb2('0x36')](_0x53a7ef);const _0x210074=Date[_0x5eb2('0x26')]()+'-'+_0x53a7ef['replace'](_0xcebe5a,'')+_0xcebe5a;_0x4e3d7d(null,_0x210074);}})});router[_0x5eb2('0x1f')](_0x5eb2('0x37'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x5eb2('0x38'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x39')]);router[_0x5eb2('0x1f')](_0x5eb2('0x16'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3a')]);router[_0x5eb2('0x1f')](_0x5eb2('0x18'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3b')]);router[_0x5eb2('0x3c')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller['update']);router[_0x5eb2('0x3d')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3e')]);router['delete'](_0x5eb2('0xa'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3f')]);router[_0x5eb2('0x3d')](_0x5eb2('0xc'),auth['isAuthenticated'](),controller[_0x5eb2('0x40')]);router[_0x5eb2('0x3d')](_0x5eb2('0x41'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x42')]);module[_0x5eb2('0x43')]=router;
\ No newline at end of file
index 4303f29..6707e67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6212=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service','../config/environment','Router','env'];(function(_0x4671ab,_0x55caec){var _0x4f0532=function(_0x1bac46){while(--_0x1bac46){_0x4671ab['push'](_0x4671ab['shift']());}};_0x4f0532(++_0x55caec);}(_0x6212,0x1b6));var _0x2621=function(_0x85b890,_0x591e74){_0x85b890=_0x85b890-0x0;var _0x5f8d20=_0x6212[_0x85b890];return _0x5f8d20;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x2621('0x0'));var config=require(_0x2621('0x1'));var router=express[_0x2621('0x2')]();var isProduction=config[_0x2621('0x3')]===_0x2621('0x4')||![];function clientSideLogs(_0x33f4c5,_0x2932d0,_0x399e72){var _0x588229=_0x33f4c5[_0x2621('0x5')][_0x2621('0x6')](_0x2621('0x7'));if(!_0x588229){throw new Error(_0x2621('0x8'));}return beaverLogger[_0x2621('0x9')]({'uri':_0x2621('0xa'),'logger':_0x588229,'enableCors':!isProduction})(_0x33f4c5,_0x2932d0,_0x399e72);}router[_0x2621('0xb')](auth[_0x2621('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x1672=['expressEndpoint','exports','beaver-logger/server','express','../components/auth/service','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x1672,0x16d));var _0x2167=function(_0x60bdc5,_0x4e2dda){_0x60bdc5=_0x60bdc5-0x0;var _0x154eaa=_0x1672[_0x60bdc5];return _0x154eaa;};var beaverLogger=require(_0x2167('0x0'));var express=require(_0x2167('0x1'));var auth=require(_0x2167('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x2167('0x3')]===_0x2167('0x4')||![];function clientSideLogs(_0x398fa9,_0x2bc8eb,_0x56a949){var _0x3dfc32=_0x398fa9[_0x2167('0x5')][_0x2167('0x6')](_0x2167('0x7'));if(!_0x3dfc32){throw new Error(_0x2167('0x8'));}return beaverLogger[_0x2167('0x9')]({'uri':'/client-logs','logger':_0x3dfc32,'enableCors':!isProduction})(_0x398fa9,_0x2bc8eb,_0x56a949);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x2167('0xa')]=router;
\ No newline at end of file
index 822b317..43c219b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x031f=['sequelize','exports','ENUM','Google','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x031f,0x12b));var _0xf031=function(_0xdb553d,_0x51b7a8){_0xdb553d=_0xdb553d-0x0;var _0x44fe66=_0x031f[_0xdb553d];return _0x44fe66;};'use strict';var Sequelize=require(_0xf031('0x0'));module[_0xf031('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf031('0x2')]('AmazonAWS',_0xf031('0x3'),_0xf031('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf031('0x2')](_0xf031('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xf031('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0xf031('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xf031('0x8')},'data4':{'type':Sequelize[_0xf031('0x6')],'comment':_0xf031('0x9')},'data5':{'type':Sequelize[_0xf031('0xa')],'comment':_0xf031('0xb')},'data6':{'type':Sequelize[_0xf031('0xa')],'comment':_0xf031('0xc')},'data7':{'type':Sequelize[_0xf031('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x65c6=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x7d2272,_0x41f365){var _0x5bc56e=function(_0x3974af){while(--_0x3974af){_0x7d2272['push'](_0x7d2272['shift']());}};_0x5bc56e(++_0x41f365);}(_0x65c6,0x16e));var _0x665c=function(_0x8e6be,_0x24f0bf){_0x8e6be=_0x8e6be-0x0;var _0x4849bc=_0x65c6[_0x8e6be];return _0x4849bc;};'use strict';var Sequelize=require(_0x665c('0x0'));module[_0x665c('0x1')]={'name':{'type':Sequelize[_0x665c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x665c('0x3'),_0x665c('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x665c('0x5')](_0x665c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x7')},'data2':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x8')},'data3':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x665c('0xa')},'data5':{'type':Sequelize[_0x665c('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x665c('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x665c('0xd')}};
\ No newline at end of file
index d62cb7d..87fae33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3863=['end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','includeAll','find','create','Name\x20parameter\x20not\x20specified','values','includes','body','join','params','encryptString','findOne','user','get','state','parse','from','base64','toString','ascii','oauth2Claims','del','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus'];(function(_0xcd804,_0x4f052f){var _0xbc87d6=function(_0x838488){while(--_0x838488){_0xcd804['push'](_0xcd804['shift']());}};_0xbc87d6(++_0x4f052f);}(_0x3863,0x100));var _0x3386=function(_0x99e049,_0x1326b8){_0x99e049=_0x99e049-0x0;var _0xeab9c8=_0x3863[_0x99e049];return _0xeab9c8;};'use strict';var _=require(_0x3386('0x0'));var Redis=require('ioredis');var qs=require(_0x3386('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x3386('0x2'));var logger=require(_0x3386('0x3'))(_0x3386('0x4'));var db=require(_0x3386('0x5'))['db'];var oauth=require(_0x3386('0x6'));config[_0x3386('0x7')]=_['defaults'](config[_0x3386('0x7')],{'host':_0x3386('0x8'),'port':0x18eb});var socket=require(_0x3386('0x9'))(new Redis(config[_0x3386('0x7')]));var redis=new Redis(config[_0x3386('0x7')]);function respondWithStatusCode(_0x2b8168,_0x4524d0){_0x4524d0=_0x4524d0||0xcc;return function(_0x135646){if(_0x135646){return _0x2b8168[_0x3386('0xa')](_0x4524d0);}return _0x2b8168['status'](_0x4524d0)[_0x3386('0xb')]();};}function respondWithResult(_0x505388,_0x4a5ba4){_0x4a5ba4=_0x4a5ba4||0xc8;return function(_0xae392c){if(_0xae392c){return _0x505388[_0x3386('0xc')](_0x4a5ba4)[_0x3386('0xd')](_0xae392c);}};}function respondWithFilteredResult(_0xbade23,_0x21fe6f){return function(_0x31c507){if(_0x31c507){var _0x548198=typeof _0x21fe6f[_0x3386('0xe')]===_0x3386('0xf')&&typeof _0x21fe6f['limit']===_0x3386('0xf');var _0x21de78=_0x31c507[_0x3386('0x10')];var _0x4981c0=_0x548198?0x0:_0x21fe6f[_0x3386('0xe')];var _0x33b074=_0x548198?_0x31c507[_0x3386('0x10')]:_0x21fe6f[_0x3386('0xe')]+_0x21fe6f[_0x3386('0x11')];var _0x17743b;if(_0x33b074>=_0x21de78){_0x33b074=_0x21de78;_0x17743b=0xc8;}else{_0x17743b=0xce;}_0xbade23[_0x3386('0xc')](_0x17743b);return _0xbade23[_0x3386('0x12')](_0x3386('0x13'),_0x4981c0+'-'+_0x33b074+'/'+_0x21de78)['json'](_0x31c507);}return null;};}function saveUpdates(_0x6f89e9){return function(_0x5a8cf0){if(_0x5a8cf0){return _0x5a8cf0[_0x3386('0x14')](_0x6f89e9)[_0x3386('0x15')](function(_0xc65613){return _0xc65613;});}return null;};}function removeEntity(_0x25a9fe){return function(_0x53d7ba){if(_0x53d7ba){return _0x53d7ba[_0x3386('0x16')]()['then'](function(){_0x25a9fe[_0x3386('0xc')](0xcc)[_0x3386('0xb')]();});}};}function handleEntityNotFound(_0x6a9e7c){return function(_0x251bde){if(!_0x251bde){_0x6a9e7c[_0x3386('0xa')](0x194);}return _0x251bde;};}function handleError(_0x188b1d,_0x1f1a12){_0x1f1a12=_0x1f1a12||0x1f4;return function(_0x543e9c){logger[_0x3386('0x17')](_0x543e9c[_0x3386('0x18')]);if(_0x543e9c[_0x3386('0x19')]){delete _0x543e9c[_0x3386('0x19')];}_0x188b1d[_0x3386('0xc')](_0x1f1a12)[_0x3386('0x1a')](_0x543e9c);};}function maskClientSecret(_0x50d357){return _[_0x3386('0x1b')](_0x50d357[_0x3386('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x140e23,_0x1d55af){var _0x4c1ea1={},_0x10807a={},_0x1e2e18={'count':0x0,'rows':[]};var _0x3cba1e=_[_0x3386('0x1d')](db[_0x3386('0x1e')]['rawAttributes'],function(_0x29519c){return{'name':_0x29519c['fieldName'],'type':_0x29519c['type'][_0x3386('0x1f')]};});_0x10807a['model']=_[_0x3386('0x1d')](_0x3cba1e,_0x3386('0x19'));_0x10807a['query']=_[_0x3386('0x20')](_0x140e23[_0x3386('0x21')]);_0x10807a[_0x3386('0x22')]=_['intersection'](_0x10807a[_0x3386('0x23')],_0x10807a['query']);_0x4c1ea1[_0x3386('0x24')]=_[_0x3386('0x25')](_0x10807a['model'],qs[_0x3386('0x26')](_0x140e23[_0x3386('0x21')]['fields']));_0x4c1ea1[_0x3386('0x24')]=_0x4c1ea1[_0x3386('0x24')][_0x3386('0x27')]?_0x4c1ea1[_0x3386('0x24')]:_0x10807a[_0x3386('0x23')];if(!_0x140e23[_0x3386('0x21')][_0x3386('0x28')](_0x3386('0x29'))){_0x4c1ea1['limit']=qs['limit'](_0x140e23[_0x3386('0x21')][_0x3386('0x11')]);_0x4c1ea1[_0x3386('0xe')]=qs['offset'](_0x140e23[_0x3386('0x21')][_0x3386('0xe')]);}_0x4c1ea1['order']=qs[_0x3386('0x2a')](_0x140e23[_0x3386('0x21')][_0x3386('0x2a')]);_0x4c1ea1[_0x3386('0x2b')]=qs['filters'](_['pick'](_0x140e23['query'],_0x10807a['filters']),_0x3cba1e);if(_0x140e23[_0x3386('0x21')]['filter']){_0x4c1ea1[_0x3386('0x2b')]=_[_0x3386('0x2c')](_0x4c1ea1['where'],{'$or':_[_0x3386('0x1d')](_0x3cba1e,function(_0x43e038){if(_0x43e038['type']!==_0x3386('0x2d')){var _0x754059={};_0x754059[_0x43e038['name']]={'$like':'%'+_0x140e23[_0x3386('0x21')]['filter']+'%'};return _0x754059;}})});}_0x4c1ea1=_[_0x3386('0x2c')]({},_0x4c1ea1,_0x140e23[_0x3386('0x2e')]);var _0x5b701a={'where':_0x4c1ea1['where']};return db[_0x3386('0x1e')]['count'](_0x5b701a)[_0x3386('0x15')](function(_0x2e9e66){_0x1e2e18['count']=_0x2e9e66;if(_0x140e23[_0x3386('0x21')]['includeAll']){_0x4c1ea1[_0x3386('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x3386('0x30')](_0x4c1ea1);})['then'](function(_0x2381e9){_0x1e2e18[_0x3386('0x31')]=_['map'](_0x2381e9,function(_0x4d0bba){if(_0x4d0bba[_0x3386('0x32')]===_0x3386('0x33')){var _0x49e50f=encryptor[_0x3386('0x34')](_0x4d0bba['data3']);_0x4d0bba[_0x3386('0x35')]=maskClientSecret(_0x49e50f);}return _0x4d0bba;});return _0x1e2e18;})['then'](respondWithFilteredResult(_0x1d55af,_0x4c1ea1))[_0x3386('0x36')](handleError(_0x1d55af,null));};exports[_0x3386('0x37')]=function(_0x14b0e8,_0x5c859b){var _0x2066cd={'raw':!![],'where':{'id':_0x14b0e8['params']['id']}},_0x58941e={};_0x58941e[_0x3386('0x23')]=_[_0x3386('0x20')](db['CloudProvider'][_0x3386('0x38')]);_0x58941e['query']=_['keys'](_0x14b0e8[_0x3386('0x21')]);_0x58941e[_0x3386('0x22')]=_[_0x3386('0x25')](_0x58941e[_0x3386('0x23')],_0x58941e[_0x3386('0x21')]);_0x2066cd['attributes']=_['intersection'](_0x58941e['model'],qs[_0x3386('0x26')](_0x14b0e8[_0x3386('0x21')][_0x3386('0x26')]));_0x2066cd[_0x3386('0x24')]=_0x2066cd[_0x3386('0x24')]['length']?_0x2066cd[_0x3386('0x24')]:_0x58941e[_0x3386('0x23')];if(_0x14b0e8['query'][_0x3386('0x39')]){_0x2066cd[_0x3386('0x2f')]=[{'all':!![]}];}_0x2066cd=_[_0x3386('0x2c')]({},_0x2066cd,_0x14b0e8[_0x3386('0x2e')]);return db[_0x3386('0x1e')][_0x3386('0x3a')](_0x2066cd)[_0x3386('0x15')](handleEntityNotFound(_0x5c859b,null))[_0x3386('0x15')](function(_0x4533e1){if(_0x4533e1[_0x3386('0x32')]==='MicrosoftAzure'){var _0x25f63c=encryptor[_0x3386('0x34')](_0x4533e1[_0x3386('0x35')]);_0x4533e1[_0x3386('0x35')]=maskClientSecret(_0x25f63c);}return _0x4533e1;})[_0x3386('0x15')](respondWithResult(_0x5c859b,null))['catch'](handleError(_0x5c859b,null));};exports[_0x3386('0x3b')]=function(_0x393494,_0x2a2be7){if(!_0x393494['body']['name'])throw new Error(_0x3386('0x3c'));if(!_0x393494['body'][_0x3386('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x44cc1f=db[_0x3386('0x1e')][_0x3386('0x38')][_0x3386('0x32')][_0x3386('0x3d')];if(!_0x44cc1f[_0x3386('0x3e')](_0x393494[_0x3386('0x3f')][_0x3386('0x32')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x44cc1f[_0x3386('0x40')](',\x20'));if(_0x393494[_0x3386('0x3f')][_0x3386('0x32')]===_0x3386('0x33')&&_0x393494['body'][_0x3386('0x35')]){_0x393494[_0x3386('0x3f')][_0x3386('0x35')]=encryptor['encryptString'](_0x393494[_0x3386('0x3f')][_0x3386('0x35')]);}return db[_0x3386('0x1e')]['create'](_0x393494[_0x3386('0x3f')],{})['then'](respondWithResult(_0x2a2be7,0xc9))['catch'](handleError(_0x2a2be7,null));};exports[_0x3386('0x14')]=function(_0x1a3e0f,_0xa22cf1){if(_0x1a3e0f[_0x3386('0x3f')]['id']){delete _0x1a3e0f['body']['id'];}return db[_0x3386('0x1e')][_0x3386('0x3a')]({'where':{'id':_0x1a3e0f[_0x3386('0x41')]['id']}})['then'](handleEntityNotFound(_0xa22cf1,null))[_0x3386('0x15')](function(_0x2892cd){if(_0x2892cd[_0x3386('0x32')]===_0x3386('0x33')&&_0x1a3e0f['body'][_0x3386('0x35')]){_0x1a3e0f['body']['data3']=encryptor[_0x3386('0x42')](_0x1a3e0f[_0x3386('0x3f')]['data3']);}return _0x2892cd;})[_0x3386('0x15')](saveUpdates(_0x1a3e0f[_0x3386('0x3f')],null))['then'](respondWithResult(_0xa22cf1,null))[_0x3386('0x36')](handleError(_0xa22cf1,null));};exports[_0x3386('0x16')]=function(_0x3fc9bd,_0x2d9398){return db[_0x3386('0x1e')][_0x3386('0x3a')]({'where':{'id':_0x3fc9bd['params']['id']}})[_0x3386('0x15')](handleEntityNotFound(_0x2d9398,null))[_0x3386('0x15')](removeEntity(_0x2d9398,null))[_0x3386('0x36')](handleError(_0x2d9398,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3ef017,_0xe909dc){return db['CloudProvider'][_0x3386('0x43')]({'where':{'id':_0x3ef017[_0x3386('0x41')]['id']},'raw':!![]})['then'](function(_0x2c1392){if(!_0x2c1392)return _0xe909dc[_0x3386('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2c1392,_0x3ef017[_0x3386('0x44')]['id'])};})[_0x3386('0x15')](respondWithResult(_0xe909dc,null))[_0x3386('0x36')](handleError(_0xe909dc,null));};exports['oauth2MicrosoftCallback']=function(_0x1e964a,_0x419b3b){var _0x2cec13=_0x1e964a[_0x3386('0x3f')];var _0xf61b99;var _0x12197f;if(_0x2cec13['error'])throw _0x2cec13;redis[_0x3386('0x45')](_0x2cec13[_0x3386('0x46')])['then'](function(_0x23c267){if(!_0x23c267)throw new Error('Invalid\x20state\x20parameter');_0xf61b99=JSON[_0x3386('0x47')](_0x23c267);var _0x1d9e23=Buffer[_0x3386('0x48')](_0x2cec13[_0x3386('0x46')],_0x3386('0x49'))[_0x3386('0x4a')](_0x3386('0x4b'));_0x12197f=JSON[_0x3386('0x47')](_0x1d9e23);if(!oauth['isValidIdToken'](_0x2cec13['id_token'],_0xf61b99[_0x3386('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x3386('0x4d')](_0x2cec13['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x2cec13['code'],_0xf61b99);})[_0x3386('0x15')](function(_0x2c00ec){_0xf61b99[_0x3386('0x4e')]=_0x2c00ec[_0x3386('0x4f')];_0xf61b99['data6']=_0x2c00ec[_0x3386('0x50')];return db[_0x3386('0x1e')]['update']({'data5':_0xf61b99['data5'],'data6':_0xf61b99[_0x3386('0x51')]},{'where':{'id':_0xf61b99['id']}});})[_0x3386('0x15')](function(){oauth[_0x3386('0x52')](_0xf61b99);socket[_0x3386('0x53')](_0x3386('0x54'),{'id':_0x12197f['id']});return;})[_0x3386('0x15')](respondWithStatusCode(_0x419b3b,null))['catch'](function(_0x2a8eef){if(_0x12197f){socket[_0x3386('0x53')](_0x3386('0x55'),{'id':_0x12197f['id']});}if(!_0xf61b99){logger[_0x3386('0x17')](_0x3386('0x56'),_0x2a8eef);return _0x419b3b['status'](0x1f4)['send'](_0x2a8eef[_0x3386('0x57')]);}logger[_0x3386('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xf61b99['id'],JSON[_0x3386('0x58')](_0x2a8eef));});};
\ No newline at end of file
+var _0x1d42=['find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','params','merge'];(function(_0x2ec53e,_0x59038e){var _0x3a42d0=function(_0x8dfc05){while(--_0x8dfc05){_0x2ec53e['push'](_0x2ec53e['shift']());}};_0x3a42d0(++_0x59038e);}(_0x1d42,0xda));var _0x21d4=function(_0x248c51,_0xdf9962){_0x248c51=_0x248c51-0x0;var _0x28c4ce=_0x1d42[_0x248c51];return _0x28c4ce;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x21d4('0x0'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x21d4('0x1'))(_0x21d4('0x2'));var db=require(_0x21d4('0x3'))['db'];var oauth=require(_0x21d4('0x4'));config[_0x21d4('0x5')]=_['defaults'](config[_0x21d4('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x21d4('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0x21d4('0x5')]);function respondWithStatusCode(_0x4dd82c,_0x12b625){_0x12b625=_0x12b625||0xcc;return function(_0x554808){if(_0x554808){return _0x4dd82c[_0x21d4('0x7')](_0x12b625);}return _0x4dd82c[_0x21d4('0x8')](_0x12b625)[_0x21d4('0x9')]();};}function respondWithResult(_0x4aa27e,_0x11b9b5){_0x11b9b5=_0x11b9b5||0xc8;return function(_0x1fb3e6){if(_0x1fb3e6){return _0x4aa27e['status'](_0x11b9b5)[_0x21d4('0xa')](_0x1fb3e6);}};}function respondWithFilteredResult(_0x3180ad,_0xd33ff0){return function(_0x1352d5){if(_0x1352d5){var _0x2197ce=typeof _0xd33ff0[_0x21d4('0xb')]===_0x21d4('0xc')&&typeof _0xd33ff0[_0x21d4('0xd')]===_0x21d4('0xc');var _0x5a42ab=_0x1352d5[_0x21d4('0xe')];var _0x1acbc9=_0x2197ce?0x0:_0xd33ff0[_0x21d4('0xb')];var _0xdf2a9f=_0x2197ce?_0x1352d5['count']:_0xd33ff0[_0x21d4('0xb')]+_0xd33ff0[_0x21d4('0xd')];var _0x248e6b;if(_0xdf2a9f>=_0x5a42ab){_0xdf2a9f=_0x5a42ab;_0x248e6b=0xc8;}else{_0x248e6b=0xce;}_0x3180ad[_0x21d4('0x8')](_0x248e6b);return _0x3180ad[_0x21d4('0xf')](_0x21d4('0x10'),_0x1acbc9+'-'+_0xdf2a9f+'/'+_0x5a42ab)[_0x21d4('0xa')](_0x1352d5);}return null;};}function saveUpdates(_0x12d914){return function(_0x4b3621){if(_0x4b3621){return _0x4b3621['update'](_0x12d914)[_0x21d4('0x11')](function(_0x1294c7){return _0x1294c7;});}return null;};}function removeEntity(_0x39eeef){return function(_0x3b2543){if(_0x3b2543){return _0x3b2543[_0x21d4('0x12')]()[_0x21d4('0x11')](function(){_0x39eeef[_0x21d4('0x8')](0xcc)[_0x21d4('0x9')]();});}};}function handleEntityNotFound(_0x50a3d2){return function(_0x4e8ea6){if(!_0x4e8ea6){_0x50a3d2[_0x21d4('0x7')](0x194);}return _0x4e8ea6;};}function handleError(_0x6ccece,_0x5df756){_0x5df756=_0x5df756||0x1f4;return function(_0x4ac815){logger[_0x21d4('0x13')](_0x4ac815['stack']);if(_0x4ac815[_0x21d4('0x14')]){delete _0x4ac815[_0x21d4('0x14')];}_0x6ccece[_0x21d4('0x8')](_0x5df756)['send'](_0x4ac815);};}function maskClientSecret(_0x3b2953){return _[_0x21d4('0x15')](_0x3b2953['slice'](0x0,0x3),0x14,'*');}exports[_0x21d4('0x16')]=function(_0x3a6988,_0x3e3413){var _0x21008e={},_0x508270={},_0x356c9b={'count':0x0,'rows':[]};var _0x2ab8bd=_['map'](db[_0x21d4('0x17')][_0x21d4('0x18')],function(_0x270e08){return{'name':_0x270e08[_0x21d4('0x19')],'type':_0x270e08[_0x21d4('0x1a')][_0x21d4('0x1b')]};});_0x508270[_0x21d4('0x1c')]=_[_0x21d4('0x1d')](_0x2ab8bd,_0x21d4('0x14'));_0x508270[_0x21d4('0x1e')]=_[_0x21d4('0x1f')](_0x3a6988[_0x21d4('0x1e')]);_0x508270[_0x21d4('0x20')]=_['intersection'](_0x508270[_0x21d4('0x1c')],_0x508270[_0x21d4('0x1e')]);_0x21008e['attributes']=_[_0x21d4('0x21')](_0x508270[_0x21d4('0x1c')],qs['fields'](_0x3a6988[_0x21d4('0x1e')][_0x21d4('0x22')]));_0x21008e[_0x21d4('0x23')]=_0x21008e['attributes'][_0x21d4('0x24')]?_0x21008e['attributes']:_0x508270[_0x21d4('0x1c')];if(!_0x3a6988['query']['hasOwnProperty'](_0x21d4('0x25'))){_0x21008e[_0x21d4('0xd')]=qs['limit'](_0x3a6988['query'][_0x21d4('0xd')]);_0x21008e['offset']=qs['offset'](_0x3a6988[_0x21d4('0x1e')]['offset']);}_0x21008e['order']=qs[_0x21d4('0x26')](_0x3a6988['query'][_0x21d4('0x26')]);_0x21008e['where']=qs[_0x21d4('0x20')](_['pick'](_0x3a6988['query'],_0x508270['filters']),_0x2ab8bd);if(_0x3a6988['query'][_0x21d4('0x27')]){_0x21008e[_0x21d4('0x28')]=_['merge'](_0x21008e[_0x21d4('0x28')],{'$or':_[_0x21d4('0x1d')](_0x2ab8bd,function(_0x5d1fa6){if(_0x5d1fa6[_0x21d4('0x1a')]!=='VIRTUAL'){var _0x1a1072={};_0x1a1072[_0x5d1fa6[_0x21d4('0x14')]]={'$like':'%'+_0x3a6988[_0x21d4('0x1e')][_0x21d4('0x27')]+'%'};return _0x1a1072;}})});}_0x21008e=_['merge']({},_0x21008e,_0x3a6988[_0x21d4('0x29')]);var _0x5bf825={'where':_0x21008e['where']};return db[_0x21d4('0x17')]['count'](_0x5bf825)[_0x21d4('0x11')](function(_0x37c632){_0x356c9b[_0x21d4('0xe')]=_0x37c632;if(_0x3a6988['query'][_0x21d4('0x2a')]){_0x21008e[_0x21d4('0x2b')]=[{'all':!![]}];}return db[_0x21d4('0x17')]['findAll'](_0x21008e);})[_0x21d4('0x11')](function(_0x13025b){_0x356c9b[_0x21d4('0x2c')]=_[_0x21d4('0x1d')](_0x13025b,function(_0x3b3f85){if(_0x3b3f85[_0x21d4('0x2d')]===_0x21d4('0x2e')){var _0x19f2ea=encryptor[_0x21d4('0x2f')](_0x3b3f85[_0x21d4('0x30')]);_0x3b3f85[_0x21d4('0x30')]=maskClientSecret(_0x19f2ea);}return _0x3b3f85;});return _0x356c9b;})['then'](respondWithFilteredResult(_0x3e3413,_0x21008e))[_0x21d4('0x31')](handleError(_0x3e3413,null));};exports['show']=function(_0x8b3d45,_0x2812f2){var _0x3fc718={'raw':!![],'where':{'id':_0x8b3d45[_0x21d4('0x32')]['id']}},_0x5005fa={};_0x5005fa[_0x21d4('0x1c')]=_[_0x21d4('0x1f')](db[_0x21d4('0x17')][_0x21d4('0x18')]);_0x5005fa[_0x21d4('0x1e')]=_['keys'](_0x8b3d45['query']);_0x5005fa[_0x21d4('0x20')]=_[_0x21d4('0x21')](_0x5005fa['model'],_0x5005fa[_0x21d4('0x1e')]);_0x3fc718[_0x21d4('0x23')]=_['intersection'](_0x5005fa['model'],qs[_0x21d4('0x22')](_0x8b3d45[_0x21d4('0x1e')][_0x21d4('0x22')]));_0x3fc718['attributes']=_0x3fc718[_0x21d4('0x23')]['length']?_0x3fc718[_0x21d4('0x23')]:_0x5005fa[_0x21d4('0x1c')];if(_0x8b3d45[_0x21d4('0x1e')][_0x21d4('0x2a')]){_0x3fc718[_0x21d4('0x2b')]=[{'all':!![]}];}_0x3fc718=_[_0x21d4('0x33')]({},_0x3fc718,_0x8b3d45['options']);return db['CloudProvider'][_0x21d4('0x34')](_0x3fc718)[_0x21d4('0x11')](handleEntityNotFound(_0x2812f2,null))[_0x21d4('0x11')](function(_0x5d8871){if(_0x5d8871['service']===_0x21d4('0x2e')){var _0x4745c8=encryptor[_0x21d4('0x2f')](_0x5d8871[_0x21d4('0x30')]);_0x5d8871['data3']=maskClientSecret(_0x4745c8);}return _0x5d8871;})[_0x21d4('0x11')](respondWithResult(_0x2812f2,null))['catch'](handleError(_0x2812f2,null));};exports['create']=function(_0x3d9f45,_0x1c1d00){if(!_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x14')])throw new Error(_0x21d4('0x36'));if(!_0x3d9f45['body'][_0x21d4('0x2d')])throw new Error(_0x21d4('0x37'));var _0x592cb4=db[_0x21d4('0x17')][_0x21d4('0x18')]['service']['values'];if(!_0x592cb4[_0x21d4('0x38')](_0x3d9f45['body'][_0x21d4('0x2d')]))throw new Error(_0x21d4('0x39')+_0x592cb4[_0x21d4('0x3a')](',\x20'));if(_0x3d9f45['body'][_0x21d4('0x2d')]==='MicrosoftAzure'&&_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]){_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]=encryptor[_0x21d4('0x3b')](_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]);}return db[_0x21d4('0x17')][_0x21d4('0x3c')](_0x3d9f45[_0x21d4('0x35')],{})[_0x21d4('0x11')](respondWithResult(_0x1c1d00,0xc9))[_0x21d4('0x31')](handleError(_0x1c1d00,null));};exports[_0x21d4('0x3d')]=function(_0x1621c5,_0x587f74){if(_0x1621c5['body']['id']){delete _0x1621c5[_0x21d4('0x35')]['id'];}return db[_0x21d4('0x17')]['find']({'where':{'id':_0x1621c5['params']['id']}})[_0x21d4('0x11')](handleEntityNotFound(_0x587f74,null))['then'](function(_0x35f576){if(_0x35f576[_0x21d4('0x2d')]===_0x21d4('0x2e')&&_0x1621c5[_0x21d4('0x35')]['data3']){_0x1621c5['body'][_0x21d4('0x30')]=encryptor['encryptString'](_0x1621c5[_0x21d4('0x35')][_0x21d4('0x30')]);}return _0x35f576;})['then'](saveUpdates(_0x1621c5['body'],null))[_0x21d4('0x11')](respondWithResult(_0x587f74,null))[_0x21d4('0x31')](handleError(_0x587f74,null));};exports[_0x21d4('0x12')]=function(_0x483a7b,_0x51375f){return db[_0x21d4('0x17')][_0x21d4('0x34')]({'where':{'id':_0x483a7b[_0x21d4('0x32')]['id']}})[_0x21d4('0x11')](handleEntityNotFound(_0x51375f,null))[_0x21d4('0x11')](removeEntity(_0x51375f,null))[_0x21d4('0x31')](handleError(_0x51375f,null));};exports[_0x21d4('0x3e')]=function(_0x1f835c,_0x3313a0){return db[_0x21d4('0x17')][_0x21d4('0x3f')]({'where':{'id':_0x1f835c[_0x21d4('0x32')]['id']},'raw':!![]})[_0x21d4('0x11')](function(_0x3cb43a){if(!_0x3cb43a)return _0x3313a0[_0x21d4('0x7')](0x194);return{'url':oauth[_0x21d4('0x40')](_0x3cb43a,_0x1f835c[_0x21d4('0x41')]['id'])};})['then'](respondWithResult(_0x3313a0,null))[_0x21d4('0x31')](handleError(_0x3313a0,null));};exports[_0x21d4('0x42')]=function(_0x55f67e,_0x5f16ed){var _0x18a9a3=_0x55f67e[_0x21d4('0x35')];var _0x4f3b1a;var _0x4ba9be;if(_0x18a9a3['error'])throw _0x18a9a3;redis[_0x21d4('0x43')](_0x18a9a3[_0x21d4('0x44')])[_0x21d4('0x11')](function(_0x15a0d7){if(!_0x15a0d7)throw new Error(_0x21d4('0x45'));_0x4f3b1a=JSON[_0x21d4('0x46')](_0x15a0d7);var _0x43e601=Buffer[_0x21d4('0x47')](_0x18a9a3['state'],_0x21d4('0x48'))[_0x21d4('0x49')](_0x21d4('0x4a'));_0x4ba9be=JSON[_0x21d4('0x46')](_0x43e601);if(!oauth[_0x21d4('0x4b')](_0x18a9a3[_0x21d4('0x4c')],_0x4f3b1a[_0x21d4('0x4d')]))throw new Error(_0x21d4('0x4e'));redis[_0x21d4('0x4f')](_0x18a9a3[_0x21d4('0x44')]);return oauth['getOauth2MicrosoftAccessToken'](_0x18a9a3['code'],_0x4f3b1a);})['then'](function(_0x32c4c6){_0x4f3b1a[_0x21d4('0x50')]=_0x32c4c6[_0x21d4('0x51')];_0x4f3b1a[_0x21d4('0x52')]=_0x32c4c6['refresh_token'];return db['CloudProvider'][_0x21d4('0x3d')]({'data5':_0x4f3b1a[_0x21d4('0x50')],'data6':_0x4f3b1a[_0x21d4('0x52')]},{'where':{'id':_0x4f3b1a['id']}});})[_0x21d4('0x11')](function(){oauth['startRefreshInterval'](_0x4f3b1a);socket[_0x21d4('0x53')](_0x21d4('0x54'),{'id':_0x4ba9be['id']});return;})[_0x21d4('0x11')](respondWithStatusCode(_0x5f16ed,null))['catch'](function(_0xf1f072){if(_0x4ba9be){socket[_0x21d4('0x53')](_0x21d4('0x55'),{'id':_0x4ba9be['id']});}if(!_0x4f3b1a){logger[_0x21d4('0x13')](_0x21d4('0x56'),_0xf1f072);return _0x5f16ed[_0x21d4('0x8')](0x1f4)[_0x21d4('0x57')](_0xf1f072['message']);}logger['error'](_0x21d4('0x58'),_0x4f3b1a['id'],JSON[_0x21d4('0x59')](_0xf1f072));});};
\ No newline at end of file
index 55ce5a5..72b5ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c19=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x5b7a60,_0x3e3d52){var _0x503ea9=function(_0xfc63e7){while(--_0xfc63e7){_0x5b7a60['push'](_0x5b7a60['shift']());}};_0x503ea9(++_0x3e3d52);}(_0x2c19,0x99));var _0x92c1=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2c19[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x92c1('0x0'));var util=require(_0x92c1('0x1'));var logger=require(_0x92c1('0x2'))(_0x92c1('0x3'));var moment=require(_0x92c1('0x4'));var BPromise=require(_0x92c1('0x5'));var rp=require(_0x92c1('0x6'));var fs=require('fs');var path=require(_0x92c1('0x7'));var rimraf=require(_0x92c1('0x8'));var config=require(_0x92c1('0x9'));var attributes=require(_0x92c1('0xa'));module[_0x92c1('0xb')]=function(_0x106870,_0xc1ff2){return _0x106870[_0x92c1('0xc')](_0x92c1('0xd'),attributes,{'tableName':_0x92c1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9459=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers'];(function(_0x49af06,_0x29490b){var _0x4fbb7d=function(_0x3c3317){while(--_0x3c3317){_0x49af06['push'](_0x49af06['shift']());}};_0x4fbb7d(++_0x29490b);}(_0x9459,0x179));var _0x9945=function(_0x2424d5,_0x3ca3cc){_0x2424d5=_0x2424d5-0x0;var _0x35b0d8=_0x9459[_0x2424d5];return _0x35b0d8;};'use strict';var _=require(_0x9945('0x0'));var util=require(_0x9945('0x1'));var logger=require(_0x9945('0x2'))(_0x9945('0x3'));var moment=require('moment');var BPromise=require(_0x9945('0x4'));var rp=require(_0x9945('0x5'));var fs=require('fs');var path=require(_0x9945('0x6'));var rimraf=require(_0x9945('0x7'));var config=require(_0x9945('0x8'));var attributes=require(_0x9945('0x9'));module[_0x9945('0xa')]=function(_0x2321c2,_0x47108d){return _0x2321c2[_0x9945('0xb')]('CloudProvider',attributes,{'tableName':_0x9945('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20b322c..08d178c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0023=['jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','redis','localhost','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','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','POST','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x0023,0x1a9));var _0x3002=function(_0x5e9b8a,_0x15fc70){_0x5e9b8a=_0x5e9b8a-0x0;var _0xffd6d6=_0x0023[_0x5e9b8a];return _0xffd6d6;};'use strict';var _=require('lodash');var crypto=require(_0x3002('0x0'));var jwt=require(_0x3002('0x1'));var moment=require('moment');var Redis=require(_0x3002('0x2'));var rp=require(_0x3002('0x3'));var util=require('util');var encryptor=require(_0x3002('0x4'));var config=require(_0x3002('0x5'));var logger=require('../../config/logger')('api');var schedule=require(_0x3002('0x6'));var db=require('../../mysqldb')['db'];config[_0x3002('0x7')]=_['defaults'](config[_0x3002('0x7')],{'host':_0x3002('0x8'),'port':0x18eb});var redis=new Redis(config[_0x3002('0x7')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3002('0x9'),_0x3002('0xa'),_0x3002('0xb'),_0x3002('0xc'),_0x3002('0xd'),_0x3002('0xe'),_0x3002('0xf')],'Dynamics365':[_0x3002('0x9'),_0x3002('0xc')]};var MICROSOFT_AUTH_ENDPOINT=_0x3002('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x3002('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x59d955){var _0x13add0=_[_0x3002('0x12')](AZURE_AUTH_SCOPES[_0x59d955[_0x3002('0x13')]]);if(_0x59d955[_0x3002('0x13')]===_0x3002('0x14'))_0x13add0['push'](_0x59d955[_0x3002('0x15')]+_0x3002('0x16'));return _0x13add0[_0x3002('0x17')]('\x20');}function getAccessTokenScope(_0x34a196){if(_0x34a196[_0x3002('0x13')]===_0x3002('0x18'))return _0x3002('0xd');if(_0x34a196[_0x3002('0x13')]===_0x3002('0x14'))return _0x34a196[_0x3002('0x15')]+_0x3002('0x16');}function generateMicrosoftAuthorizationUrl(_0x8b5bc5,_0x31dfa8){var _0x18a962=MICROSOFT_AUTH_URL[_0x3002('0x19')](_0x3002('0x1a'),_0x8b5bc5[_0x3002('0x1b')]);var _0x5daa4a=['code',_0x3002('0x1c')];var _0x4cf589=Buffer[_0x3002('0x1d')](JSON[_0x3002('0x1e')]({'id':_0x31dfa8}))[_0x3002('0x1f')](_0x3002('0x20'));var _0x354fbf=crypto['randomBytes'](0x10)[_0x3002('0x1f')]('hex');var _0x558cd2=getAuthorizationScopes(_0x8b5bc5);var _0x55c917=[{'key':'client_id','value':_0x8b5bc5[_0x3002('0x21')]},{'key':_0x3002('0x22'),'value':encodeURIComponent(_0x5daa4a[_0x3002('0x17')]('\x20'))},{'key':_0x3002('0x23'),'value':_0x8b5bc5['data4']},{'key':_0x3002('0x24'),'value':_0x3002('0x25')},{'key':_0x3002('0x26'),'value':encodeURIComponent(_0x558cd2)},{'key':_0x3002('0x27'),'value':_0x4cf589},{'key':_0x3002('0x28'),'value':_0x354fbf},{'key':_0x3002('0x29'),'value':_0x3002('0x2a')}];var _0x3d57c9=_0x18a962+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x55c917,function(_0x5991ee){return _0x5991ee[_0x3002('0x2b')]+'='+_0x5991ee['value'];})['join']('&');_0x8b5bc5[_0x3002('0x2c')]={'issuer':_0x18a962[_0x3002('0x19')](_0x3002('0x2d'),''),'audience':_0x8b5bc5[_0x3002('0x21')],'state':_0x4cf589,'nonce':_0x354fbf};redis['set'](_0x4cf589,JSON[_0x3002('0x1e')](_0x8b5bc5));return _0x3d57c9;}function isValidIdToken(_0x48ac92,_0x3d72cb){try{var _0x3d752a=jwt['decode'](_0x48ac92,{'complete':!![]});var _0x5b6bad=_0x3d752a['payload'];if(_0x5b6bad['iss']!==_0x3d72cb[_0x3002('0x2e')])return![];if(_0x5b6bad[_0x3002('0x2f')]!==_0x3d72cb[_0x3002('0x30')])return![];if(_0x5b6bad[_0x3002('0x28')]!==_0x3d72cb['nonce'])return![];if(moment()[_0x3002('0x31')](moment[_0x3002('0x32')](_0x5b6bad[_0x3002('0x33')])))return![];return!![];}catch(_0x13250d){throw _0x13250d;}}function refreshOauth2MicrosoftAccessToken(_0x2b89f0){return Promise[_0x3002('0x34')]()[_0x3002('0x35')](function(){if(_0x2b89f0['data3'])return _0x2b89f0;return db[_0x3002('0x36')][_0x3002('0x37')]({'where':{'id':_0x2b89f0['id']},'raw':!![]});})[_0x3002('0x35')](function(_0x834f32){var _0x19cdec={'grant_type':_0x3002('0x38'),'refresh_token':_0x834f32[_0x3002('0x39')],'scope':getAccessTokenScope(_0x834f32),'redirect_uri':_0x834f32[_0x3002('0x3a')],'client_id':_0x834f32[_0x3002('0x21')],'client_secret':encryptor['decryptString'](_0x834f32['data3'])};var _0x2b6133={'method':_0x3002('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x3002('0x19')]('{TENANT_ID}',_0x834f32[_0x3002('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x19cdec,'json':!![]};return rp(_0x2b6133);})['then'](function(_0x269c4b){_0x2b89f0['data5']=_0x269c4b['access_token'];_0x2b89f0['data6']=_0x269c4b[_0x3002('0x38')];return db[_0x3002('0x36')][_0x3002('0x3c')]({'data5':_0x2b89f0['data5'],'data6':_0x2b89f0[_0x3002('0x39')]},{'where':{'id':_0x2b89f0['id']}});})['then'](function(){return _0x2b89f0;})[_0x3002('0x3d')](function(_0xa6d8ad){logger[_0x3002('0x3e')](_0x3002('0x3f'),_0x2b89f0['id'],_0xa6d8ad);});}function getOauth2MicrosoftAccessToken(_0x54c927,_0xc15f29){var _0x22ba17={'grant_type':_0x3002('0x40'),'code':_0x54c927,'scope':getAccessTokenScope(_0xc15f29),'redirect_uri':_0xc15f29['data4'],'client_id':_0xc15f29[_0x3002('0x21')],'client_secret':encryptor[_0x3002('0x41')](_0xc15f29['data3'])};var _0x4dfe56={'method':_0x3002('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x3002('0x19')](_0x3002('0x1a'),_0xc15f29[_0x3002('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x22ba17,'json':!![]};return rp(_0x4dfe56);}function startRefreshInterval(_0x442ea1){var _0x31720d=schedule[_0x3002('0x42')];if(_0x31720d[_0x442ea1['id']])clearInterval(_0x31720d[_0x442ea1['id']]);_0x31720d[_0x442ea1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x442ea1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x31720d;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3002('0x35')](function(_0x66e5af){var _0x4fa940=_0x66e5af[_0x3002('0x12')](function(_0x2b7b83){return refreshOauth2MicrosoftAccessToken(_0x2b7b83)[_0x3002('0x35')](function(_0x4e4bb3){startRefreshInterval(_0x4e4bb3);});});return Promise[_0x3002('0x43')](_0x4fa940);})[_0x3002('0x3d')](function(_0x375a1d){var _0x6e9023=_0x375a1d?util[_0x3002('0x44')](_0x375a1d,{'showHidden':![],'depth':null}):'';logger[_0x3002('0x3e')](_0x3002('0x45'),_0x6e9023);});}module[_0x3002('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x90b8=['stringify','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','state','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','issuer','nonce','unix','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','update','error','authorization_code','bind','intervals','findAll','map','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','data7','/.default','join','Dynamics365','replace','{TENANT_ID}','code','id_token','from'];(function(_0x28d204,_0x702528){var _0xadf793=function(_0x290712){while(--_0x290712){_0x28d204['push'](_0x28d204['shift']());}};_0xadf793(++_0x702528);}(_0x90b8,0xc1));var _0x890b=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x90b8[_0x534c8f];return _0x5a57f5;};'use strict';var _=require(_0x890b('0x0'));var crypto=require(_0x890b('0x1'));var jwt=require(_0x890b('0x2'));var moment=require(_0x890b('0x3'));var Redis=require(_0x890b('0x4'));var rp=require(_0x890b('0x5'));var util=require(_0x890b('0x6'));var encryptor=require(_0x890b('0x7'));var config=require('../../config/environment');var logger=require(_0x890b('0x8'))(_0x890b('0x9'));var schedule=require(_0x890b('0xa'));var db=require(_0x890b('0xb'))['db'];config[_0x890b('0xc')]=_[_0x890b('0xd')](config[_0x890b('0xc')],{'host':_0x890b('0xe'),'port':0x18eb});var redis=new Redis(config[_0x890b('0xc')]);var MICROSOFT_AUTH_URL=_0x890b('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x890b('0x10'),'profile','email',_0x890b('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x890b('0x12'),_0x890b('0x13')],'Dynamics365':[_0x890b('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x890b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x890b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27c77d){var _0x783733=_['map'](AZURE_AUTH_SCOPES[_0x27c77d['type']]);if(_0x27c77d[_0x890b('0x16')]==='Dynamics365')_0x783733['push'](_0x27c77d[_0x890b('0x17')]+_0x890b('0x18'));return _0x783733[_0x890b('0x19')]('\x20');}function getAccessTokenScope(_0x382c1c){if(_0x382c1c[_0x890b('0x16')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x382c1c[_0x890b('0x16')]===_0x890b('0x1a'))return _0x382c1c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x51a625,_0x59f506){var _0x5cb888=MICROSOFT_AUTH_URL[_0x890b('0x1b')](_0x890b('0x1c'),_0x51a625['data2']);var _0x5ae072=[_0x890b('0x1d'),_0x890b('0x1e')];var _0x1d7cc9=Buffer[_0x890b('0x1f')](JSON[_0x890b('0x20')]({'id':_0x59f506}))[_0x890b('0x21')]('base64');var _0x4df824=crypto['randomBytes'](0x10)['toString'](_0x890b('0x22'));var _0x1807f0=getAuthorizationScopes(_0x51a625);var _0x37f336=[{'key':_0x890b('0x23'),'value':_0x51a625[_0x890b('0x24')]},{'key':_0x890b('0x25'),'value':encodeURIComponent(_0x5ae072[_0x890b('0x19')]('\x20'))},{'key':_0x890b('0x26'),'value':_0x51a625[_0x890b('0x27')]},{'key':_0x890b('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x1807f0)},{'key':_0x890b('0x29'),'value':_0x1d7cc9},{'key':'nonce','value':_0x4df824},{'key':_0x890b('0x2a'),'value':_0x890b('0x2b')}];var _0x21fa79=_0x5cb888+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x37f336,function(_0x1341ff){return _0x1341ff[_0x890b('0x2c')]+'='+_0x1341ff[_0x890b('0x2d')];})[_0x890b('0x19')]('&');_0x51a625[_0x890b('0x2e')]={'issuer':_0x5cb888[_0x890b('0x1b')](_0x890b('0x2f'),''),'audience':_0x51a625[_0x890b('0x24')],'state':_0x1d7cc9,'nonce':_0x4df824};redis['set'](_0x1d7cc9,JSON['stringify'](_0x51a625));return _0x21fa79;}function isValidIdToken(_0x17473e,_0x215c34){try{var _0x18c489=jwt[_0x890b('0x30')](_0x17473e,{'complete':!![]});var _0x11efcd=_0x18c489[_0x890b('0x31')];if(_0x11efcd['iss']!==_0x215c34[_0x890b('0x32')])return![];if(_0x11efcd['aud']!==_0x215c34['audience'])return![];if(_0x11efcd[_0x890b('0x33')]!==_0x215c34[_0x890b('0x33')])return![];if(moment()['isAfter'](moment[_0x890b('0x34')](_0x11efcd['exp'])))return![];return!![];}catch(_0x203d95){throw _0x203d95;}}function refreshOauth2MicrosoftAccessToken(_0x1c57c8){return Promise[_0x890b('0x35')]()[_0x890b('0x36')](function(){if(_0x1c57c8[_0x890b('0x37')])return _0x1c57c8;return db[_0x890b('0x38')]['findOne']({'where':{'id':_0x1c57c8['id']},'raw':!![]});})[_0x890b('0x36')](function(_0x3766bb){var _0x10cf3a={'grant_type':_0x890b('0x39'),'refresh_token':_0x3766bb[_0x890b('0x3a')],'scope':getAccessTokenScope(_0x3766bb),'redirect_uri':_0x3766bb[_0x890b('0x27')],'client_id':_0x3766bb['data1'],'client_secret':encryptor[_0x890b('0x3b')](_0x3766bb['data3'])};var _0x48c6b5={'method':_0x890b('0x3c'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3766bb[_0x890b('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10cf3a,'json':!![]};return rp(_0x48c6b5);})[_0x890b('0x36')](function(_0x553d93){_0x1c57c8[_0x890b('0x3e')]=_0x553d93['access_token'];_0x1c57c8[_0x890b('0x3a')]=_0x553d93['refresh_token'];return db['CloudProvider'][_0x890b('0x3f')]({'data5':_0x1c57c8[_0x890b('0x3e')],'data6':_0x1c57c8['data6']},{'where':{'id':_0x1c57c8['id']}});})[_0x890b('0x36')](function(){return _0x1c57c8;})['catch'](function(_0x1e58f3){logger[_0x890b('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1c57c8['id'],_0x1e58f3);});}function getOauth2MicrosoftAccessToken(_0x56b1f8,_0x2390a3){var _0x14a48a={'grant_type':_0x890b('0x41'),'code':_0x56b1f8,'scope':getAccessTokenScope(_0x2390a3),'redirect_uri':_0x2390a3[_0x890b('0x27')],'client_id':_0x2390a3[_0x890b('0x24')],'client_secret':encryptor[_0x890b('0x3b')](_0x2390a3['data3'])};var _0x2da4fd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x890b('0x1b')](_0x890b('0x1c'),_0x2390a3[_0x890b('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14a48a,'json':!![]};return rp(_0x2da4fd);}function startRefreshInterval(_0x18b077){var _0x20e41d=schedule['intervals'];if(_0x20e41d[_0x18b077['id']])clearInterval(_0x20e41d[_0x18b077['id']]);_0x20e41d[_0x18b077['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x890b('0x42')](this,{'id':_0x18b077['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x890b('0x43')]=_0x20e41d;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x890b('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xb290b){var _0x2ccae0=_0xb290b[_0x890b('0x45')](function(_0x5e306b){return refreshOauth2MicrosoftAccessToken(_0x5e306b)[_0x890b('0x36')](function(_0x20bdd3){startRefreshInterval(_0x20bdd3);});});return Promise[_0x890b('0x46')](_0x2ccae0);})[_0x890b('0x47')](function(_0x561a2f){var _0x25b781=_0x561a2f?util[_0x890b('0x48')](_0x561a2f,{'showHidden':![],'depth':null}):'';logger['error'](_0x890b('0x49'),_0x25b781);});}module[_0x890b('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 0bbb3c6..ab6f6b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb19a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x43b96b,_0x3bc895){var _0x3f6e99=function(_0x339fc4){while(--_0x339fc4){_0x43b96b['push'](_0x43b96b['shift']());}};_0x3f6e99(++_0x3bc895);}(_0xb19a,0xd0));var _0xab19=function(_0x116420,_0x5106ae){_0x116420=_0x116420-0x0;var _0x1824de=_0xb19a[_0x116420];return _0x1824de;};'use strict';var _=require(_0xab19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab19('0x2'))['db'];var utils=require(_0xab19('0x3'));var logger=require(_0xab19('0x4'))(_0xab19('0x5'));var config=require(_0xab19('0x6'));var jayson=require(_0xab19('0x7'));var client=jayson[_0xab19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d5c1d,_0x131291,_0x59d282){return new BPromise(function(_0x300038,_0x479d0b){return client[_0xab19('0x9')](_0x9d5c1d,_0x59d282)[_0xab19('0xa')](function(_0x2c6a67){logger[_0xab19('0xb')](_0xab19('0xc'),_0x131291,_0xab19('0xd'));logger[_0xab19('0xe')](_0xab19('0xf'),_0x131291,_0xab19('0xd'),JSON[_0xab19('0x10')](_0x2c6a67));if(_0x2c6a67[_0xab19('0x11')]){if(_0x2c6a67[_0xab19('0x11')]['code']===0x1f4){logger['error'](_0xab19('0xc'),_0x131291,_0x2c6a67['error'][_0xab19('0x12')]);return _0x479d0b(_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);}logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);return _0x300038(_0x2c6a67['error'][_0xab19('0x12')]);}else{logger[_0xab19('0xb')]('CloudProvider,\x20%s,\x20%s',_0x131291,_0xab19('0xd'));_0x300038(_0x2c6a67[_0xab19('0x13')]['message']);}})['catch'](function(_0x2284b8){logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2284b8);_0x479d0b(_0x2284b8);});});}
\ No newline at end of file
+var _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch'];(function(_0x5e2d0d,_0x566431){var _0x6241b2=function(_0x2dcffe){while(--_0x2dcffe){_0x5e2d0d['push'](_0x5e2d0d['shift']());}};_0x6241b2(++_0x566431);}(_0xacc6,0x150));var _0x6acc=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xacc6[_0x5cc8];return _0x450661;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f3a,_0x41edfd,_0x48b1a8){return new BPromise(function(_0x1f95e8,_0x538730){return client[_0x6acc('0xb')](_0x5e7f3a,_0x48b1a8)[_0x6acc('0xc')](function(_0x4d6b7f){logger[_0x6acc('0xd')]('CloudProvider,\x20%s,\x20%s',_0x41edfd,_0x6acc('0xe'));logger[_0x6acc('0xf')](_0x6acc('0x10'),_0x41edfd,_0x6acc('0xe'),JSON[_0x6acc('0x11')](_0x4d6b7f));if(_0x4d6b7f[_0x6acc('0x12')]){if(_0x4d6b7f['error'][_0x6acc('0x13')]===0x1f4){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x538730(_0x4d6b7f['error']['message']);}logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x1f95e8(_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);}else{logger[_0x6acc('0xd')](_0x6acc('0x14'),_0x41edfd,_0x6acc('0xe'));_0x1f95e8(_0x4d6b7f[_0x6acc('0x16')][_0x6acc('0x15')]);}})[_0x6acc('0x17')](function(_0x31c4c2){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x31c4c2);_0x538730(_0x31c4c2);});});}
\ No newline at end of file
index 2f13201..c80ad59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x200fdb,_0x1d483e){var _0x1262bd=function(_0x4197f4){while(--_0x4197f4){_0x200fdb['push'](_0x200fdb['shift']());}};_0x1262bd(++_0x1d483e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x1261,0x144));var _0x1126=function(_0x4b9a62,_0x528ba3){_0x4b9a62=_0x4b9a62-0x0;var _0x45c582=_0x1261[_0x4b9a62];return _0x45c582;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
index ffae7fc..26e9bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd4=['STRING','name'];(function(_0x2a4503,_0x3c241a){var _0x1da7c0=function(_0x49c341){while(--_0x49c341){_0x2a4503['push'](_0x2a4503['shift']());}};_0x1da7c0(++_0x3c241a);}(_0x2dd4,0x173));var _0x42dd=function(_0x4d6c7b,_0x1b177b){_0x4d6c7b=_0x4d6c7b-0x0;var _0x41ed71=_0x2dd4[_0x4d6c7b];return _0x41ed71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x42dd('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x42dd('0x1')]},'companyId':{'type':Sequelize[_0x42dd('0x1')]},'website':{'type':Sequelize[_0x42dd('0x1')]},'phone':{'type':Sequelize[_0x42dd('0x1')]},'fax':{'type':Sequelize[_0x42dd('0x1')]},'type':{'type':Sequelize[_0x42dd('0x1')]},'street':{'type':Sequelize[_0x42dd('0x1')]},'postalCode':{'type':Sequelize[_0x42dd('0x1')]},'city':{'type':Sequelize[_0x42dd('0x1')]},'country':{'type':Sequelize[_0x42dd('0x1')]},'email':{'type':Sequelize[_0x42dd('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x42dd('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x42dd('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb49d=['exports','STRING','sequelize'];(function(_0x3d9055,_0x5a0411){var _0x5e38b1=function(_0x31d6f9){while(--_0x31d6f9){_0x3d9055['push'](_0x3d9055['shift']());}};_0x5e38b1(++_0x5a0411);}(_0xb49d,0x182));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdb49('0x0'));module[_0xdb49('0x1')]={'name':{'type':Sequelize[_0xdb49('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdb49('0x2')]},'companyId':{'type':Sequelize[_0xdb49('0x2')]},'website':{'type':Sequelize[_0xdb49('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xdb49('0x2')]},'type':{'type':Sequelize[_0xdb49('0x2')]},'street':{'type':Sequelize[_0xdb49('0x2')]},'postalCode':{'type':Sequelize[_0xdb49('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdb49('0x2')]},'email':{'type':Sequelize[_0xdb49('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdb49('0x2')]},'sStreet':{'type':Sequelize[_0xdb49('0x2')]},'sPostalCode':{'type':Sequelize[_0xdb49('0x2')]},'sCity':{'type':Sequelize[_0xdb49('0x2')]},'sCountry':{'type':Sequelize[_0xdb49('0x2')]},'description':{'type':Sequelize[_0xdb49('0x2')]}};
\ No newline at end of file
index 800915a..ee419fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc851=['apply','save','then','destroy','get','Companies','UserProfileResource','end','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','map','rimraf','fast-json-patch','request-promise','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xc851,0x1dd));var _0x1c85=function(_0x3e3fb2,_0x27181a){_0x3e3fb2=_0x3e3fb2-0x0;var _0x106b06=_0xc851[_0x3e3fb2];return _0x106b06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c85('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c85('0x1'));var rp=require(_0x1c85('0x2'));var moment=require('moment');var BPromise=require(_0x1c85('0x3'));var Mustache=require(_0x1c85('0x4'));var util=require(_0x1c85('0x5'));var path=require(_0x1c85('0x6'));var sox=require('sox');var csv=require(_0x1c85('0x7'));var ejs=require(_0x1c85('0x8'));var fs=require('fs');var fs_extra=require(_0x1c85('0x9'));var _=require('lodash');var squel=require(_0x1c85('0xa'));var crypto=require(_0x1c85('0xb'));var jsforce=require(_0x1c85('0xc'));var deskjs=require(_0x1c85('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1c85('0xe'));var Papa=require(_0x1c85('0xf'));var Redis=require('ioredis');var authService=require(_0x1c85('0x10'));var qs=require(_0x1c85('0x11'));var as=require(_0x1c85('0x12'));var hardwareService=require(_0x1c85('0x13'));var logger=require(_0x1c85('0x14'))(_0x1c85('0x15'));var utils=require('../../config/utils');var config=require(_0x1c85('0x16'));var licenseUtil=require(_0x1c85('0x17'));var db=require(_0x1c85('0x18'))['db'];function respondWithStatusCode(_0x399ef8,_0x38cd6b){_0x38cd6b=_0x38cd6b||0xcc;return function(_0x380278){if(_0x380278){return _0x399ef8[_0x1c85('0x19')](_0x38cd6b);}return _0x399ef8['status'](_0x38cd6b)['end']();};}function respondWithResult(_0x17ca35,_0x234fc6){_0x234fc6=_0x234fc6||0xc8;return function(_0x52cd95){if(_0x52cd95){return _0x17ca35['status'](_0x234fc6)[_0x1c85('0x1a')](_0x52cd95);}};}function respondWithFilteredResult(_0x553f32,_0x28257d){return function(_0x164f02){if(_0x164f02){var _0x5126e7=typeof _0x28257d[_0x1c85('0x1b')]===_0x1c85('0x1c')&&typeof _0x28257d[_0x1c85('0x1d')]===_0x1c85('0x1c');var _0x405aa1=_0x164f02['count'];var _0x5a2f72=_0x5126e7?0x0:_0x28257d[_0x1c85('0x1b')];var _0x49d82b=_0x5126e7?_0x164f02[_0x1c85('0x1e')]:_0x28257d[_0x1c85('0x1b')]+_0x28257d[_0x1c85('0x1d')];var _0x90baa7;if(_0x49d82b>=_0x405aa1){_0x49d82b=_0x405aa1;_0x90baa7=0xc8;}else{_0x90baa7=0xce;}_0x553f32[_0x1c85('0x1f')](_0x90baa7);return _0x553f32['set'](_0x1c85('0x20'),_0x5a2f72+'-'+_0x49d82b+'/'+_0x405aa1)[_0x1c85('0x1a')](_0x164f02);}return null;};}function patchUpdates(_0x58d5a6){return function(_0x41d77a){try{jsonpatch[_0x1c85('0x21')](_0x41d77a,_0x58d5a6,!![]);}catch(_0x46c356){return BPromise['reject'](_0x46c356);}return _0x41d77a[_0x1c85('0x22')]();};}function saveUpdates(_0x5040ef,_0xd6ed4d){return function(_0x508a2f){if(_0x508a2f){return _0x508a2f['update'](_0x5040ef)[_0x1c85('0x23')](function(_0x1d2792){return _0x1d2792;});}return null;};}function removeEntity(_0x5ecb88,_0x3a7038){return function(_0x1c9af4){if(_0x1c9af4){return _0x1c9af4[_0x1c85('0x24')]()[_0x1c85('0x23')](function(){var _0x2a2459=_0x1c9af4[_0x1c85('0x25')]({'plain':!![]});var _0x6876ba=_0x1c85('0x26');return db[_0x1c85('0x27')][_0x1c85('0x24')]({'where':{'type':_0x6876ba,'resourceId':_0x2a2459['id']}})[_0x1c85('0x23')](function(){return _0x1c9af4;});})[_0x1c85('0x23')](function(){_0x5ecb88[_0x1c85('0x1f')](0xcc)[_0x1c85('0x28')]();});}};}function handleEntityNotFound(_0x2204bb,_0x2b5513){return function(_0xb0d0a0){if(!_0xb0d0a0){_0x2204bb[_0x1c85('0x19')](0x194);}return _0xb0d0a0;};}function handleError(_0x4edb02,_0x28d6a2){_0x28d6a2=_0x28d6a2||0x1f4;return function(_0x524d4c){logger['error'](_0x524d4c['stack']);if(_0x524d4c['name']){delete _0x524d4c['name'];}_0x4edb02[_0x1c85('0x1f')](_0x28d6a2)['send'](_0x524d4c);};}exports[_0x1c85('0x29')]=function(_0x4563d5,_0x2998ab){var _0x4fd7f5={},_0x58002a={},_0x2a937f={'count':0x0,'rows':[]};return db[_0x1c85('0x2a')][_0x1c85('0x2b')]()['then'](function(_0x6b5db6){_0x58002a[_0x1c85('0x2c')]=_['keys'](_0x6b5db6);_0x58002a[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x4563d5[_0x1c85('0x2d')]);_0x58002a[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0x58002a[_0x1c85('0x2c')],_0x58002a[_0x1c85('0x2d')]);_0x4fd7f5[_0x1c85('0x31')]=_['intersection'](_0x58002a['model'],qs[_0x1c85('0x32')](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x32')]));_0x4fd7f5[_0x1c85('0x31')]=_0x4fd7f5[_0x1c85('0x31')][_0x1c85('0x33')]?_0x4fd7f5[_0x1c85('0x31')]:_0x58002a[_0x1c85('0x2c')];if(!_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x34')](_0x1c85('0x35'))){_0x4fd7f5[_0x1c85('0x1d')]=qs['limit'](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x1d')]);_0x4fd7f5[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x1b')]);}_0x4fd7f5[_0x1c85('0x36')]=qs['sort'](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x37')]);_0x4fd7f5[_0x1c85('0x38')]=qs[_0x1c85('0x2f')](_[_0x1c85('0x39')](_0x4563d5[_0x1c85('0x2d')],_0x58002a['filters']),_0x6b5db6);if(_0x4563d5[_0x1c85('0x2d')]['filter']){_0x4fd7f5[_0x1c85('0x38')]=_['merge'](_0x4fd7f5[_0x1c85('0x38')],{'$or':_['map'](_0x4fd7f5['attributes'],function(_0x574fbc){var _0x2558b5={};_0x2558b5[_0x574fbc]={'$like':'%'+_0x4563d5['query'][_0x1c85('0x3a')]+'%'};return _0x2558b5;})});}_0x4fd7f5=_[_0x1c85('0x3b')]({},_0x4fd7f5,_0x4563d5[_0x1c85('0x3c')]);var _0x4dcc64={'where':_0x4fd7f5[_0x1c85('0x38')]};return db[_0x1c85('0x2a')][_0x1c85('0x1e')](_0x4dcc64)['then'](function(_0x20347c){_0x2a937f[_0x1c85('0x1e')]=_0x20347c;if(_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x3d')]){_0x4fd7f5['include']=[{'all':!![]}];}return db[_0x1c85('0x2a')][_0x1c85('0x3e')](_0x4fd7f5);})['then'](function(_0xf49ea1){_0x2a937f['rows']=_0xf49ea1;return _0x2a937f;})[_0x1c85('0x23')](respondWithFilteredResult(_0x2998ab,_0x4fd7f5))[_0x1c85('0x3f')](handleError(_0x2998ab,null));})[_0x1c85('0x3f')](handleError(_0x2998ab,null));};exports[_0x1c85('0x40')]=function(_0x4f8165,_0x9f90fa){var _0x34416b={'raw':![],'where':{'id':_0x4f8165[_0x1c85('0x41')]['id']}},_0x2af227={};_0x2af227[_0x1c85('0x2c')]=_[_0x1c85('0x2e')](db[_0x1c85('0x2a')][_0x1c85('0x42')]);_0x2af227[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x4f8165[_0x1c85('0x2d')]);_0x2af227[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0x2af227[_0x1c85('0x2c')],_0x2af227[_0x1c85('0x2d')]);_0x34416b['attributes']=_[_0x1c85('0x30')](_0x2af227['model'],qs[_0x1c85('0x32')](_0x4f8165[_0x1c85('0x2d')][_0x1c85('0x32')]));_0x34416b[_0x1c85('0x31')]=_0x34416b[_0x1c85('0x31')]['length']?_0x34416b['attributes']:_0x2af227['model'];if(_0x4f8165['query'][_0x1c85('0x3d')]){_0x34416b[_0x1c85('0x43')]=[{'all':!![]}];}_0x34416b=_[_0x1c85('0x3b')]({},_0x34416b,_0x4f8165['options']);return db['CmCompany'][_0x1c85('0x44')](_0x34416b)[_0x1c85('0x23')](handleEntityNotFound(_0x9f90fa,null))[_0x1c85('0x23')](respondWithResult(_0x9f90fa,null))['catch'](handleError(_0x9f90fa,null));};exports['create']=function(_0x37d96c,_0x11de0e){return db[_0x1c85('0x2a')][_0x1c85('0x45')](_0x37d96c[_0x1c85('0x46')],{})[_0x1c85('0x23')](function(_0x2ea559){var _0x868ee7=_0x37d96c[_0x1c85('0x47')][_0x1c85('0x25')]({'plain':!![]});if(!_0x868ee7)throw new Error(_0x1c85('0x48'));if(_0x868ee7[_0x1c85('0x49')]==='user'){var _0x2f39e9=_0x2ea559[_0x1c85('0x25')]({'plain':!![]});var _0x1b4c76=_0x1c85('0x26');return db['UserProfileSection'][_0x1c85('0x44')]({'where':{'name':_0x1b4c76,'userProfileId':_0x868ee7['userProfileId']},'raw':!![]})[_0x1c85('0x23')](function(_0xb63c){if(_0xb63c&&_0xb63c[_0x1c85('0x4a')]===0x0){return db[_0x1c85('0x27')]['create']({'name':_0x2f39e9[_0x1c85('0x4b')],'resourceId':_0x2f39e9['id'],'type':_0xb63c[_0x1c85('0x4b')],'sectionId':_0xb63c['id']},{})[_0x1c85('0x23')](function(){return _0x2ea559;});}else{return _0x2ea559;}})[_0x1c85('0x3f')](function(_0x57141d){logger[_0x1c85('0x4c')](_0x1c85('0x4d'),_0x57141d);throw _0x57141d;});}return _0x2ea559;})[_0x1c85('0x23')](respondWithResult(_0x11de0e,0xc9))['catch'](handleError(_0x11de0e,null));};exports['update']=function(_0x5b2462,_0x5d503b){if(_0x5b2462[_0x1c85('0x46')]['id']){delete _0x5b2462['body']['id'];}return db[_0x1c85('0x2a')][_0x1c85('0x44')]({'where':{'id':_0x5b2462[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x5d503b,null))[_0x1c85('0x23')](saveUpdates(_0x5b2462[_0x1c85('0x46')],null))[_0x1c85('0x23')](respondWithResult(_0x5d503b,null))[_0x1c85('0x3f')](handleError(_0x5d503b,null));};exports[_0x1c85('0x24')]=function(_0x111fef,_0x4d7588){return db[_0x1c85('0x2a')][_0x1c85('0x44')]({'where':{'id':_0x111fef[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x4d7588,null))['then'](removeEntity(_0x4d7588,null))[_0x1c85('0x3f')](handleError(_0x4d7588,null));};exports[_0x1c85('0x2b')]=function(_0x18a861,_0x8654b5){return db['CmCompany'][_0x1c85('0x2b')]()[_0x1c85('0x23')](respondWithResult(_0x8654b5,null))['catch'](handleError(_0x8654b5,null));};exports[_0x1c85('0x4e')]=function(_0x11cde9,_0x27adb3,_0x10e009){return db[_0x1c85('0x4f')][_0x1c85('0x44')]({'where':{'id':_0x11cde9[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x27adb3,null))[_0x1c85('0x23')](function(_0x3ac78c){if(_0x3ac78c){return _0x3ac78c[_0x1c85('0x4e')](_0x11cde9[_0x1c85('0x46')][_0x1c85('0x50')],_[_0x1c85('0x51')](_0x11cde9[_0x1c85('0x46')],[_0x1c85('0x50'),'id'])||{});}})['then'](respondWithResult(_0x27adb3,null))[_0x1c85('0x3f')](handleError(_0x27adb3,null));};exports[_0x1c85('0x52')]=function(_0x35b46b,_0x441de9,_0x4191b0){var _0x590f58={};var _0xbca4b9={};var _0x271997;var _0x3c6d1c;return db[_0x1c85('0x2a')][_0x1c85('0x53')]({'where':{'id':_0x35b46b[_0x1c85('0x41')]['id']}})['then'](handleEntityNotFound(_0x441de9,null))[_0x1c85('0x23')](function(_0x38273e){if(_0x38273e){_0x271997=_0x38273e;_0xbca4b9[_0x1c85('0x2c')]=_['keys'](db[_0x1c85('0x4f')][_0x1c85('0x42')]);_0xbca4b9['query']=_[_0x1c85('0x2e')](_0x35b46b['query']);_0xbca4b9[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0xbca4b9[_0x1c85('0x2c')],_0xbca4b9[_0x1c85('0x2d')]);_0x590f58[_0x1c85('0x31')]=_[_0x1c85('0x30')](_0xbca4b9[_0x1c85('0x2c')],qs[_0x1c85('0x32')](_0x35b46b[_0x1c85('0x2d')]['fields']));_0x590f58['attributes']=_0x590f58[_0x1c85('0x31')][_0x1c85('0x33')]?_0x590f58[_0x1c85('0x31')]:_0xbca4b9[_0x1c85('0x2c')];_0x590f58[_0x1c85('0x36')]=qs['sort'](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x37')]);_0x590f58[_0x1c85('0x38')]=qs[_0x1c85('0x2f')](_['pick'](_0x35b46b[_0x1c85('0x2d')],_0xbca4b9[_0x1c85('0x2f')]));if(_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x3a')]){_0x590f58[_0x1c85('0x38')]=_['merge'](_0x590f58[_0x1c85('0x38')],{'$or':_[_0x1c85('0x54')](_0x590f58[_0x1c85('0x31')],function(_0x4d62e1){var _0x32e46e={};_0x32e46e[_0x4d62e1]={'$like':'%'+_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x3a')]+'%'};return _0x32e46e;})});}_0x590f58=_[_0x1c85('0x3b')]({},_0x590f58,_0x35b46b[_0x1c85('0x3c')]);return _0x271997[_0x1c85('0x52')](_0x590f58);}})['then'](function(_0xd5341e){if(_0xd5341e){_0x3c6d1c=_0xd5341e[_0x1c85('0x33')];if(!_0x35b46b['query'][_0x1c85('0x34')](_0x1c85('0x35'))){_0x590f58[_0x1c85('0x1d')]=qs[_0x1c85('0x1d')](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x1d')]);_0x590f58[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x1b')]);}return _0x271997[_0x1c85('0x52')](_0x590f58);}})['then'](function(_0x4ce57f){if(_0x4ce57f){return _0x4ce57f?{'count':_0x3c6d1c,'rows':_0x4ce57f}:null;}})[_0x1c85('0x23')](respondWithResult(_0x441de9,null))['catch'](handleError(_0x441de9,null));};
\ No newline at end of file
+var _0x8f21=['desk.js','to-csv','querystring','papaparse','ioredis','../../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','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','map','options','where','includeAll','include','findAll','catch','show','rawAttributes','filters','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','body','params','omit','getContacts','CmContact','length','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x5decec,_0x4e5761){var _0x35e1b4=function(_0x27066d){while(--_0x27066d){_0x5decec['push'](_0x5decec['shift']());}};_0x35e1b4(++_0x4e5761);}(_0x8f21,0xf4));var _0x18f2=function(_0x3d5b4c,_0x577b6e){_0x3d5b4c=_0x3d5b4c-0x0;var _0x1ba703=_0x8f21[_0x3d5b4c];return _0x1ba703;};'use strict';var emlformat=require(_0x18f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18f2('0x1'));var jsonpatch=require(_0x18f2('0x2'));var rp=require(_0x18f2('0x3'));var moment=require(_0x18f2('0x4'));var BPromise=require(_0x18f2('0x5'));var Mustache=require('mustache');var util=require(_0x18f2('0x6'));var path=require(_0x18f2('0x7'));var sox=require(_0x18f2('0x8'));var csv=require('to-csv');var ejs=require(_0x18f2('0x9'));var fs=require('fs');var fs_extra=require(_0x18f2('0xa'));var _=require(_0x18f2('0xb'));var squel=require('squel');var crypto=require(_0x18f2('0xc'));var jsforce=require(_0x18f2('0xd'));var deskjs=require(_0x18f2('0xe'));var toCsv=require(_0x18f2('0xf'));var querystring=require(_0x18f2('0x10'));var Papa=require(_0x18f2('0x11'));var Redis=require(_0x18f2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x18f2('0x13'));var as=require(_0x18f2('0x14'));var hardwareService=require(_0x18f2('0x15'));var logger=require(_0x18f2('0x16'))(_0x18f2('0x17'));var utils=require(_0x18f2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x18f2('0x19'));var db=require(_0x18f2('0x1a'))['db'];function respondWithStatusCode(_0x294953,_0x4b5328){_0x4b5328=_0x4b5328||0xcc;return function(_0x413667){if(_0x413667){return _0x294953[_0x18f2('0x1b')](_0x4b5328);}return _0x294953[_0x18f2('0x1c')](_0x4b5328)[_0x18f2('0x1d')]();};}function respondWithResult(_0x88c5fa,_0x432f26){_0x432f26=_0x432f26||0xc8;return function(_0x5e5d91){if(_0x5e5d91){return _0x88c5fa[_0x18f2('0x1c')](_0x432f26)[_0x18f2('0x1e')](_0x5e5d91);}};}function respondWithFilteredResult(_0x2be753,_0x59253a){return function(_0x584c4d){if(_0x584c4d){var _0xa8f2e8=typeof _0x59253a[_0x18f2('0x1f')]===_0x18f2('0x20')&&typeof _0x59253a[_0x18f2('0x21')]===_0x18f2('0x20');var _0x35ac7e=_0x584c4d[_0x18f2('0x22')];var _0x422f39=_0xa8f2e8?0x0:_0x59253a['offset'];var _0x2181b4=_0xa8f2e8?_0x584c4d['count']:_0x59253a['offset']+_0x59253a[_0x18f2('0x21')];var _0x56dbb1;if(_0x2181b4>=_0x35ac7e){_0x2181b4=_0x35ac7e;_0x56dbb1=0xc8;}else{_0x56dbb1=0xce;}_0x2be753['status'](_0x56dbb1);return _0x2be753['set'](_0x18f2('0x23'),_0x422f39+'-'+_0x2181b4+'/'+_0x35ac7e)[_0x18f2('0x1e')](_0x584c4d);}return null;};}function patchUpdates(_0xe78219){return function(_0x158c5c){try{jsonpatch[_0x18f2('0x24')](_0x158c5c,_0xe78219,!![]);}catch(_0x5e529e){return BPromise['reject'](_0x5e529e);}return _0x158c5c[_0x18f2('0x25')]();};}function saveUpdates(_0x3fd77e,_0x568d81){return function(_0xbcde0d){if(_0xbcde0d){return _0xbcde0d[_0x18f2('0x26')](_0x3fd77e)[_0x18f2('0x27')](function(_0x243076){return _0x243076;});}return null;};}function removeEntity(_0x590b76,_0x2171f7){return function(_0x1450b0){if(_0x1450b0){return _0x1450b0[_0x18f2('0x28')]()['then'](function(){var _0x36a743=_0x1450b0['get']({'plain':!![]});var _0x347b5b='Companies';return db[_0x18f2('0x29')][_0x18f2('0x28')]({'where':{'type':_0x347b5b,'resourceId':_0x36a743['id']}})[_0x18f2('0x27')](function(){return _0x1450b0;});})[_0x18f2('0x27')](function(){_0x590b76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcc1249,_0xbb7518){return function(_0xaea3f0){if(!_0xaea3f0){_0xcc1249[_0x18f2('0x1b')](0x194);}return _0xaea3f0;};}function handleError(_0xb15f25,_0x37be74){_0x37be74=_0x37be74||0x1f4;return function(_0xbda91e){logger[_0x18f2('0x2a')](_0xbda91e[_0x18f2('0x2b')]);if(_0xbda91e[_0x18f2('0x2c')]){delete _0xbda91e['name'];}_0xb15f25[_0x18f2('0x1c')](_0x37be74)[_0x18f2('0x2d')](_0xbda91e);};}exports[_0x18f2('0x2e')]=function(_0x50b788,_0x469961){var _0x215db7={},_0xdb9d27={},_0x217dac={'count':0x0,'rows':[]};return db[_0x18f2('0x2f')][_0x18f2('0x30')]()[_0x18f2('0x27')](function(_0x4c35a7){_0xdb9d27[_0x18f2('0x31')]=_[_0x18f2('0x32')](_0x4c35a7);_0xdb9d27[_0x18f2('0x33')]=_[_0x18f2('0x32')](_0x50b788[_0x18f2('0x33')]);_0xdb9d27['filters']=_[_0x18f2('0x34')](_0xdb9d27[_0x18f2('0x31')],_0xdb9d27[_0x18f2('0x33')]);_0x215db7[_0x18f2('0x35')]=_['intersection'](_0xdb9d27[_0x18f2('0x31')],qs['fields'](_0x50b788[_0x18f2('0x33')]['fields']));_0x215db7[_0x18f2('0x35')]=_0x215db7[_0x18f2('0x35')]['length']?_0x215db7['attributes']:_0xdb9d27[_0x18f2('0x31')];if(!_0x50b788['query'][_0x18f2('0x36')](_0x18f2('0x37'))){_0x215db7[_0x18f2('0x21')]=qs[_0x18f2('0x21')](_0x50b788['query'][_0x18f2('0x21')]);_0x215db7[_0x18f2('0x1f')]=qs[_0x18f2('0x1f')](_0x50b788[_0x18f2('0x33')]['offset']);}_0x215db7[_0x18f2('0x38')]=qs[_0x18f2('0x39')](_0x50b788[_0x18f2('0x33')][_0x18f2('0x39')]);_0x215db7['where']=qs['filters'](_['pick'](_0x50b788[_0x18f2('0x33')],_0xdb9d27['filters']),_0x4c35a7);if(_0x50b788['query'][_0x18f2('0x3a')]){_0x215db7['where']=_[_0x18f2('0x3b')](_0x215db7['where'],{'$or':_[_0x18f2('0x3c')](_0x215db7['attributes'],function(_0xb30e6c){var _0xc8e028={};_0xc8e028[_0xb30e6c]={'$like':'%'+_0x50b788[_0x18f2('0x33')][_0x18f2('0x3a')]+'%'};return _0xc8e028;})});}_0x215db7=_[_0x18f2('0x3b')]({},_0x215db7,_0x50b788[_0x18f2('0x3d')]);var _0x3e380e={'where':_0x215db7[_0x18f2('0x3e')]};return db[_0x18f2('0x2f')][_0x18f2('0x22')](_0x3e380e)[_0x18f2('0x27')](function(_0x2a3a1b){_0x217dac['count']=_0x2a3a1b;if(_0x50b788[_0x18f2('0x33')][_0x18f2('0x3f')]){_0x215db7[_0x18f2('0x40')]=[{'all':!![]}];}return db[_0x18f2('0x2f')][_0x18f2('0x41')](_0x215db7);})[_0x18f2('0x27')](function(_0x40b12b){_0x217dac['rows']=_0x40b12b;return _0x217dac;})['then'](respondWithFilteredResult(_0x469961,_0x215db7))[_0x18f2('0x42')](handleError(_0x469961,null));})['catch'](handleError(_0x469961,null));};exports[_0x18f2('0x43')]=function(_0x186049,_0x3147ce){var _0x311e73={'raw':![],'where':{'id':_0x186049['params']['id']}},_0x47a8a9={};_0x47a8a9[_0x18f2('0x31')]=_[_0x18f2('0x32')](db[_0x18f2('0x2f')][_0x18f2('0x44')]);_0x47a8a9[_0x18f2('0x33')]=_[_0x18f2('0x32')](_0x186049[_0x18f2('0x33')]);_0x47a8a9[_0x18f2('0x45')]=_['intersection'](_0x47a8a9[_0x18f2('0x31')],_0x47a8a9[_0x18f2('0x33')]);_0x311e73[_0x18f2('0x35')]=_[_0x18f2('0x34')](_0x47a8a9['model'],qs[_0x18f2('0x46')](_0x186049[_0x18f2('0x33')][_0x18f2('0x46')]));_0x311e73[_0x18f2('0x35')]=_0x311e73[_0x18f2('0x35')]['length']?_0x311e73['attributes']:_0x47a8a9[_0x18f2('0x31')];if(_0x186049['query'][_0x18f2('0x3f')]){_0x311e73[_0x18f2('0x40')]=[{'all':!![]}];}_0x311e73=_[_0x18f2('0x3b')]({},_0x311e73,_0x186049['options']);return db[_0x18f2('0x2f')][_0x18f2('0x47')](_0x311e73)[_0x18f2('0x27')](handleEntityNotFound(_0x3147ce,null))['then'](respondWithResult(_0x3147ce,null))[_0x18f2('0x42')](handleError(_0x3147ce,null));};exports[_0x18f2('0x48')]=function(_0x51cfd8,_0x32dc7a){return db[_0x18f2('0x2f')][_0x18f2('0x48')](_0x51cfd8['body'],{})[_0x18f2('0x27')](function(_0x1c716e){var _0xfd6172=_0x51cfd8[_0x18f2('0x49')][_0x18f2('0x4a')]({'plain':!![]});if(!_0xfd6172)throw new Error(_0x18f2('0x4b'));if(_0xfd6172[_0x18f2('0x4c')]===_0x18f2('0x49')){var _0x620511=_0x1c716e['get']({'plain':!![]});var _0x51a742=_0x18f2('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x51a742,'userProfileId':_0xfd6172['userProfileId']},'raw':!![]})[_0x18f2('0x27')](function(_0x955bf3){if(_0x955bf3&&_0x955bf3[_0x18f2('0x4e')]===0x0){return db['UserProfileResource'][_0x18f2('0x48')]({'name':_0x620511[_0x18f2('0x2c')],'resourceId':_0x620511['id'],'type':_0x955bf3[_0x18f2('0x2c')],'sectionId':_0x955bf3['id']},{})[_0x18f2('0x27')](function(){return _0x1c716e;});}else{return _0x1c716e;}})['catch'](function(_0x521253){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x521253);throw _0x521253;});}return _0x1c716e;})['then'](respondWithResult(_0x32dc7a,0xc9))[_0x18f2('0x42')](handleError(_0x32dc7a,null));};exports['update']=function(_0x4194a9,_0x1f7c26){if(_0x4194a9[_0x18f2('0x4f')]['id']){delete _0x4194a9[_0x18f2('0x4f')]['id'];}return db[_0x18f2('0x2f')][_0x18f2('0x47')]({'where':{'id':_0x4194a9['params']['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x1f7c26,null))[_0x18f2('0x27')](saveUpdates(_0x4194a9[_0x18f2('0x4f')],null))[_0x18f2('0x27')](respondWithResult(_0x1f7c26,null))['catch'](handleError(_0x1f7c26,null));};exports['destroy']=function(_0x4945e2,_0x585bc1){return db[_0x18f2('0x2f')][_0x18f2('0x47')]({'where':{'id':_0x4945e2[_0x18f2('0x50')]['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x585bc1,null))['then'](removeEntity(_0x585bc1,null))['catch'](handleError(_0x585bc1,null));};exports['describe']=function(_0x38fc2f,_0x4e2954){return db[_0x18f2('0x2f')]['describe']()[_0x18f2('0x27')](respondWithResult(_0x4e2954,null))['catch'](handleError(_0x4e2954,null));};exports['addContacts']=function(_0x4745bd,_0x3d7dc7,_0x56fedd){return db['CmContact'][_0x18f2('0x47')]({'where':{'id':_0x4745bd[_0x18f2('0x50')]['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x3d7dc7,null))[_0x18f2('0x27')](function(_0x5c1463){if(_0x5c1463){return _0x5c1463['addContacts'](_0x4745bd[_0x18f2('0x4f')]['ids'],_[_0x18f2('0x51')](_0x4745bd[_0x18f2('0x4f')],['ids','id'])||{});}})[_0x18f2('0x27')](respondWithResult(_0x3d7dc7,null))[_0x18f2('0x42')](handleError(_0x3d7dc7,null));};exports[_0x18f2('0x52')]=function(_0x5dcb4e,_0x47e902,_0x521a6d){var _0x17e914={};var _0x315904={};var _0x5f2097;var _0x252013;return db[_0x18f2('0x2f')]['findOne']({'where':{'id':_0x5dcb4e[_0x18f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x47e902,null))[_0x18f2('0x27')](function(_0x1ca138){if(_0x1ca138){_0x5f2097=_0x1ca138;_0x315904['model']=_[_0x18f2('0x32')](db[_0x18f2('0x53')][_0x18f2('0x44')]);_0x315904[_0x18f2('0x33')]=_['keys'](_0x5dcb4e[_0x18f2('0x33')]);_0x315904[_0x18f2('0x45')]=_[_0x18f2('0x34')](_0x315904[_0x18f2('0x31')],_0x315904[_0x18f2('0x33')]);_0x17e914[_0x18f2('0x35')]=_[_0x18f2('0x34')](_0x315904[_0x18f2('0x31')],qs[_0x18f2('0x46')](_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x46')]));_0x17e914['attributes']=_0x17e914[_0x18f2('0x35')][_0x18f2('0x54')]?_0x17e914[_0x18f2('0x35')]:_0x315904['model'];_0x17e914[_0x18f2('0x38')]=qs[_0x18f2('0x39')](_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x39')]);_0x17e914[_0x18f2('0x3e')]=qs['filters'](_[_0x18f2('0x55')](_0x5dcb4e[_0x18f2('0x33')],_0x315904[_0x18f2('0x45')]));if(_0x5dcb4e['query'][_0x18f2('0x3a')]){_0x17e914[_0x18f2('0x3e')]=_[_0x18f2('0x3b')](_0x17e914[_0x18f2('0x3e')],{'$or':_['map'](_0x17e914[_0x18f2('0x35')],function(_0x4aeab0){var _0x5ea041={};_0x5ea041[_0x4aeab0]={'$like':'%'+_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x3a')]+'%'};return _0x5ea041;})});}_0x17e914=_[_0x18f2('0x3b')]({},_0x17e914,_0x5dcb4e[_0x18f2('0x3d')]);return _0x5f2097[_0x18f2('0x52')](_0x17e914);}})[_0x18f2('0x27')](function(_0x58800e){if(_0x58800e){_0x252013=_0x58800e[_0x18f2('0x54')];if(!_0x5dcb4e['query'][_0x18f2('0x36')]('nolimit')){_0x17e914[_0x18f2('0x21')]=qs[_0x18f2('0x21')](_0x5dcb4e['query'][_0x18f2('0x21')]);_0x17e914[_0x18f2('0x1f')]=qs['offset'](_0x5dcb4e[_0x18f2('0x33')]['offset']);}return _0x5f2097[_0x18f2('0x52')](_0x17e914);}})[_0x18f2('0x27')](function(_0x6dec1){if(_0x6dec1){return _0x6dec1?{'count':_0x252013,'rows':_0x6dec1}:null;}})[_0x18f2('0x27')](respondWithResult(_0x47e902,null))[_0x18f2('0x42')](handleError(_0x47e902,null));};
\ No newline at end of file
index c467f85..2f52d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfccd=['moment','bluebird','request-promise','path','rimraf','define','CmCompany','api'];(function(_0x454899,_0x56d202){var _0x4d576d=function(_0xedb633){while(--_0xedb633){_0x454899['push'](_0x454899['shift']());}};_0x4d576d(++_0x56d202);}(_0xfccd,0x7f));var _0xdfcc=function(_0x5608df,_0xff2326){_0x5608df=_0x5608df-0x0;var _0x4c2e63=_0xfccd[_0x5608df];return _0x4c2e63;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdfcc('0x0'));var moment=require(_0xdfcc('0x1'));var BPromise=require(_0xdfcc('0x2'));var rp=require(_0xdfcc('0x3'));var fs=require('fs');var path=require(_0xdfcc('0x4'));var rimraf=require(_0xdfcc('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0xabf87e,_0x5bd5b5){return _0xabf87e[_0xdfcc('0x6')](_0xdfcc('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2165=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies'];(function(_0x19f19f,_0x150e93){var _0x3b9368=function(_0x34b7d2){while(--_0x34b7d2){_0x19f19f['push'](_0x19f19f['shift']());}};_0x3b9368(++_0x150e93);}(_0x2165,0x179));var _0x5216=function(_0x4d6a8f,_0x565271){_0x4d6a8f=_0x4d6a8f-0x0;var _0x537980=_0x2165[_0x4d6a8f];return _0x537980;};'use strict';var _=require(_0x5216('0x0'));var util=require(_0x5216('0x1'));var logger=require(_0x5216('0x2'))(_0x5216('0x3'));var moment=require(_0x5216('0x4'));var BPromise=require(_0x5216('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5216('0x6'));var rimraf=require(_0x5216('0x7'));var config=require(_0x5216('0x8'));var attributes=require(_0x5216('0x9'));module[_0x5216('0xa')]=function(_0x42f2e4,_0x22f91d){return _0x42f2e4['define'](_0x5216('0xb'),attributes,{'tableName':_0x5216('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12445e6..be845c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cfa=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x7582fc,_0x3fecff){var _0x29395d=function(_0x1af409){while(--_0x1af409){_0x7582fc['push'](_0x7582fc['shift']());}};_0x29395d(++_0x3fecff);}(_0x2cfa,0x96));var _0xa2cf=function(_0x558fe9,_0x1ca3f7){_0x558fe9=_0x558fe9-0x0;var _0x554d2a=_0x2cfa[_0x558fe9];return _0x554d2a;};'use strict';var _=require(_0xa2cf('0x0'));var util=require(_0xa2cf('0x1'));var moment=require('moment');var BPromise=require(_0xa2cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2cf('0x3'))['db'];var utils=require(_0xa2cf('0x4'));var logger=require(_0xa2cf('0x5'))(_0xa2cf('0x6'));var config=require(_0xa2cf('0x7'));var jayson=require(_0xa2cf('0x8'));var client=jayson[_0xa2cf('0x9')][_0xa2cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249459,_0x2b8007,_0x1795c7){return new BPromise(function(_0x3fa342,_0x58e058){return client[_0xa2cf('0xb')](_0x249459,_0x1795c7)['then'](function(_0x12e7df){logger[_0xa2cf('0xc')](_0xa2cf('0xd'),_0x2b8007,'request\x20sent');logger[_0xa2cf('0xe')](_0xa2cf('0xf'),_0x2b8007,_0xa2cf('0x10'),JSON['stringify'](_0x12e7df));if(_0x12e7df[_0xa2cf('0x11')]){if(_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x12')]===0x1f4){logger[_0xa2cf('0x11')](_0xa2cf('0xd'),_0x2b8007,_0x12e7df[_0xa2cf('0x11')]['message']);return _0x58e058(_0x12e7df['error'][_0xa2cf('0x13')]);}logger[_0xa2cf('0x11')](_0xa2cf('0xd'),_0x2b8007,_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x13')]);return _0x3fa342(_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x13')]);}else{logger[_0xa2cf('0xc')](_0xa2cf('0xd'),_0x2b8007,_0xa2cf('0x10'));_0x3fa342(_0x12e7df[_0xa2cf('0x14')][_0xa2cf('0x13')]);}})[_0xa2cf('0x15')](function(_0x346c5d){logger[_0xa2cf('0x11')]('CmCompany,\x20%s,\x20%s',_0x2b8007,_0x346c5d);_0x58e058(_0x346c5d);});});}
\ No newline at end of file
+var _0xbeb6=['debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x4b66c6,_0x53ae84){var _0x530b50=function(_0x467c72){while(--_0x467c72){_0x4b66c6['push'](_0x4b66c6['shift']());}};_0x530b50(++_0x53ae84);}(_0xbeb6,0xcb));var _0x6beb=function(_0x5dc085,_0x35dfd2){_0x5dc085=_0x5dc085-0x0;var _0x2c79db=_0xbeb6[_0x5dc085];return _0x2c79db;};'use strict';var _=require(_0x6beb('0x0'));var util=require(_0x6beb('0x1'));var moment=require('moment');var BPromise=require(_0x6beb('0x2'));var rs=require(_0x6beb('0x3'));var fs=require('fs');var Redis=require(_0x6beb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6beb('0x5'))(_0x6beb('0x6'));var config=require('../../config/environment');var jayson=require(_0x6beb('0x7'));var client=jayson['client'][_0x6beb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29832c,_0x4f705d,_0x1b6135){return new BPromise(function(_0x16ab5a,_0x47ecb8){return client['request'](_0x29832c,_0x1b6135)[_0x6beb('0x9')](function(_0x435a70){logger[_0x6beb('0xa')](_0x6beb('0xb'),_0x4f705d,_0x6beb('0xc'));logger[_0x6beb('0xd')](_0x6beb('0xe'),_0x4f705d,_0x6beb('0xc'),JSON['stringify'](_0x435a70));if(_0x435a70['error']){if(_0x435a70[_0x6beb('0xf')][_0x6beb('0x10')]===0x1f4){logger[_0x6beb('0xf')](_0x6beb('0xb'),_0x4f705d,_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);return _0x47ecb8(_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);}logger[_0x6beb('0xf')](_0x6beb('0xb'),_0x4f705d,_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);return _0x16ab5a(_0x435a70[_0x6beb('0xf')]['message']);}else{logger[_0x6beb('0xa')]('CmCompany,\x20%s,\x20%s',_0x4f705d,'request\x20sent');_0x16ab5a(_0x435a70['result'][_0x6beb('0x11')]);}})['catch'](function(_0x3607b9){logger['error'](_0x6beb('0xb'),_0x4f705d,_0x3607b9);_0x47ecb8(_0x3607b9);});});}
\ No newline at end of file
index 1287214..6f962f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe849=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','getContacts','post','create','/:id/contacts','addContacts','exports','multer'];(function(_0x142ad1,_0x1e31f7){var _0x32e5f1=function(_0x504a08){while(--_0x504a08){_0x142ad1['push'](_0x142ad1['shift']());}};_0x32e5f1(++_0x1e31f7);}(_0xe849,0x12b));var _0x9e84=function(_0x32d017,_0x1aaf95){_0x32d017=_0x32d017-0x0;var _0x4823c1=_0xe849[_0x32d017];return _0x4823c1;};'use strict';var multer=require(_0x9e84('0x0'));var util=require(_0x9e84('0x1'));var path=require(_0x9e84('0x2'));var timeout=require(_0x9e84('0x3'));var express=require(_0x9e84('0x4'));var router=express[_0x9e84('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9e84('0x6'));var interaction=require(_0x9e84('0x7'));var config=require(_0x9e84('0x8'));var controller=require(_0x9e84('0x9'));router[_0x9e84('0xa')]('/',auth[_0x9e84('0xb')](),controller['index']);router[_0x9e84('0xa')](_0x9e84('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9e84('0xa')](_0x9e84('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/contacts',auth[_0x9e84('0xb')](),controller[_0x9e84('0xe')]);router[_0x9e84('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e84('0x10')]);router[_0x9e84('0xf')](_0x9e84('0x11'),auth[_0x9e84('0xb')](),controller[_0x9e84('0x12')]);router['put']('/:id',auth[_0x9e84('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9e84('0x13')]=router;
\ No newline at end of file
+var _0x18a2=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','get','/:id','post','/:id/contacts','addContacts','put','update','delete','exports','multer','util'];(function(_0x34359d,_0x1c0e86){var _0x59474f=function(_0x9c5ecf){while(--_0x9c5ecf){_0x34359d['push'](_0x34359d['shift']());}};_0x59474f(++_0x1c0e86);}(_0x18a2,0xf5));var _0x218a=function(_0x2bba7d,_0x2daffe){_0x2bba7d=_0x2bba7d-0x0;var _0x6b823=_0x18a2[_0x2bba7d];return _0x6b823;};'use strict';var multer=require(_0x218a('0x0'));var util=require(_0x218a('0x1'));var path=require(_0x218a('0x2'));var timeout=require(_0x218a('0x3'));var express=require(_0x218a('0x4'));var router=express['Router']();var fs_extra=require(_0x218a('0x5'));var auth=require(_0x218a('0x6'));var interaction=require(_0x218a('0x7'));var config=require('../../config/environment');var controller=require(_0x218a('0x8'));router['get']('/',auth[_0x218a('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x218a('0xa')](_0x218a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x218a('0xa')]('/:id/contacts',auth[_0x218a('0x9')](),controller['getContacts']);router[_0x218a('0xc')]('/',auth[_0x218a('0x9')](),controller['create']);router[_0x218a('0xc')](_0x218a('0xd'),auth[_0x218a('0x9')](),controller[_0x218a('0xe')]);router[_0x218a('0xf')](_0x218a('0xb'),auth[_0x218a('0x9')](),controller[_0x218a('0x10')]);router[_0x218a('0x11')]('/:id',auth[_0x218a('0x9')](),controller['destroy']);module[_0x218a('0x12')]=router;
\ No newline at end of file
index cc4efee..e19e7f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1fa=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xe1fa,0x150));var _0xae1f=function(_0x2ce7,_0x42de64){_0x2ce7=_0x2ce7-0x0;var _0x3465bf=_0xe1fa[_0x2ce7];return _0x3465bf;};'use strict';var _=require('lodash');var Sequelize=require(_0xae1f('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xae1f('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xae1f('0x1')]},'postalCode':{'type':Sequelize[_0xae1f('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xae1f('0x1')]},'description':{'type':Sequelize[_0xae1f('0x2')]},'phone':{'type':Sequelize[_0xae1f('0x1')]},'mobile':{'type':Sequelize[_0xae1f('0x1')]},'fax':{'type':Sequelize[_0xae1f('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xae1f('0x1')]},'facebook':{'type':Sequelize[_0xae1f('0x1')]},'fb_data':{'type':Sequelize[_0xae1f('0x1')]},'twitter':{'type':Sequelize[_0xae1f('0x1')]},'skype':{'type':Sequelize[_0xae1f('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xae1f('0x1')]},'line':{'type':Sequelize[_0xae1f('0x1')]},'wechat':{'type':Sequelize[_0xae1f('0x1')]},'telegram':{'type':Sequelize[_0xae1f('0x1')]},'UserId':{'type':Sequelize[_0xae1f('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xae1f('0x1')]},'priority':{'type':Sequelize[_0xae1f('0x3')](0x2)[_0xae1f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xae1f('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x58f2=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x1bab3c,_0x12d584){var _0x495cf0=function(_0x580b79){while(--_0x580b79){_0x1bab3c['push'](_0x1bab3c['shift']());}};_0x495cf0(++_0x12d584);}(_0x58f2,0x181));var _0x258f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x258f('0x0'));var Sequelize=require(_0x258f('0x1'));module[_0x258f('0x2')]={'firstName':{'type':Sequelize[_0x258f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x258f('0x3')]},'street':{'type':Sequelize[_0x258f('0x3')]},'postalCode':{'type':Sequelize[_0x258f('0x3')]},'city':{'type':Sequelize[_0x258f('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x258f('0x3')]},'description':{'type':Sequelize[_0x258f('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x258f('0x3')]},'fax':{'type':Sequelize[_0x258f('0x3')]},'email':{'type':Sequelize[_0x258f('0x3')]},'url':{'type':Sequelize[_0x258f('0x3')]},'facebook':{'type':Sequelize[_0x258f('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x258f('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x258f('0x3')]},'line':{'type':Sequelize[_0x258f('0x3')]},'wechat':{'type':Sequelize[_0x258f('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x258f('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x258f('0x3')]},'priority':{'type':Sequelize[_0x258f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x258f('0x6')],'defaultValue':Sequelize[_0x258f('0x7')]},'dialTimezone':{'type':Sequelize[_0x258f('0x3')]},'utcOffset':{'type':Sequelize[_0x258f('0x5')]}};
\ No newline at end of file
index 87df2b9..81f8628 100644 (file)
@@ -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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){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
index b613144..a5b0f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ff=['../../mysqldb','setMaxListeners','save','update','remove','emit','events'];(function(_0x149ec1,_0x55d852){var _0x8d6ba8=function(_0x55466b){while(--_0x55466b){_0x149ec1['push'](_0x149ec1['shift']());}};_0x8d6ba8(++_0x55d852);}(_0x57ff,0x99));var _0xf57f=function(_0x3bdadd,_0x5e586d){_0x3bdadd=_0x3bdadd-0x0;var _0x43535a=_0x57ff[_0x3bdadd];return _0x43535a;};'use strict';var EventEmitter=require(_0xf57f('0x0'));var CmContact=require(_0xf57f('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf57f('0x2')](0x0);var events={'afterCreate':_0xf57f('0x3'),'afterUpdate':_0xf57f('0x4'),'afterDestroy':_0xf57f('0x5')};function emitEvent(_0x3da5f1){return function(_0x56691a,_0x32f01d,_0x25e613){CmContactEvents[_0xf57f('0x6')](_0x3da5f1+':'+_0x56691a['id'],_0x56691a);CmContactEvents[_0xf57f('0x6')](_0x3da5f1,_0x56691a);_0x25e613(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 _0xd32b=['../../mysqldb','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x45aa72,_0x8af642){var _0x75adaa=function(_0x1f6809){while(--_0x1f6809){_0x45aa72['push'](_0x45aa72['shift']());}};_0x75adaa(++_0x8af642);}(_0xd32b,0x88));var _0xbd32=function(_0xade9d1,_0x1af9a3){_0xade9d1=_0xade9d1-0x0;var _0xe9ac3=_0xd32b[_0xade9d1];return _0xe9ac3;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xbd32('0x0'))['db'][_0xbd32('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xbd32('0x2')](0x0);var events={'afterCreate':_0xbd32('0x3'),'afterUpdate':_0xbd32('0x4'),'afterDestroy':'remove'};function emitEvent(_0x34bc2e){return function(_0x5b0a1f,_0x10367d,_0x96fab7){CmContactEvents[_0xbd32('0x5')](_0x34bc2e+':'+_0x5b0a1f['id'],_0x5b0a1f);CmContactEvents[_0xbd32('0x5')](_0x34bc2e,_0x5b0a1f);_0x96fab7(null);};}for(var e in events){if(events[_0xbd32('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xbd32('0x7')]=CmContactEvents;
\ No newline at end of file
index 37bee10..d2996ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d36=['utcOffset','add','minutes','ret','CmHopper','create','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','message','Campaign','onlyIfOpen','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','moment','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','timezones'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x1d36,0x1ca));var _0x61d3=function(_0x5f065b,_0x290325){_0x5f065b=_0x5f065b-0x0;var _0x25c626=_0x1d36[_0x5f065b];return _0x25c626;};'use strict';var _=require(_0x61d3('0x0'));var util=require(_0x61d3('0x1'));var logger=require('../../config/logger')(_0x61d3('0x2'));var moment=require(_0x61d3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61d3('0x4'));var rimraf=require(_0x61d3('0x5'));var config=require(_0x61d3('0x6'));var shared=require('../../config/environment/shared');var attributes=require(_0x61d3('0x7'));module[_0x61d3('0x8')]=function(_0x347cc9,_0x517c7a){return _0x347cc9[_0x61d3('0x9')](_0x61d3('0xa'),attributes,{'tableName':_0x61d3('0xb'),'paranoid':!![],'indexes':[{'name':_0x61d3('0xc'),'fields':[_0x61d3('0xc')]},{'name':'fti_cm_contacts','fields':[_0x61d3('0xd'),'lastName',_0x61d3('0xc'),_0x61d3('0xe'),'fax',_0x61d3('0xf')],'type':_0x61d3('0x10')}],'timestamps':!![],'charset':_0x61d3('0x11'),'collate':_0x61d3('0x12'),'hooks':{'afterCreate':function(_0x26c5df,_0x2f14c,_0x101980){var _0x360a70=_0x347cc9[_0x61d3('0x13')];var _0x2adaa0=_0x26c5df[_0x61d3('0x14')]({'plain':!![]});function _0x23d2b9(){return function(_0x413625){logger[_0x61d3('0x15')](_0x61d3('0x16'),_0x61d3('0x17'),util['inspect'](_0x413625,{'showHidden':![],'depth':null}));};}function _0x339270(_0x5f1918,_0x3128f5){var _0x5771e6=_0x3128f5[_0x61d3('0x18')]?_0x3128f5[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a'));return new BPromise(function(_0x5a1dcf,_0x4d17be){if(_[_0x61d3('0x1b')](_0x3128f5[_0x61d3('0x1c')])){_0x5a1dcf({'ret':_0x5771e6});}else{_0x360a70['VoiceQueue'][_0x61d3('0x1d')]({'where':{'id':_0x5f1918['id']}})[_0x61d3('0x1e')](function(_0x35b812){if(!_['isNil'](_0x35b812)){var _0x4ddd48=_0x35b812[_0x61d3('0x1c')];if(!_[_0x61d3('0x1b')](_0x4ddd48)){var _0x1b0f11=shared[_0x61d3('0x1f')];var _0x3fcad9=_0x1b0f11[_0x4ddd48];var _0x1da282=_0x1b0f11[_0x3128f5[_0x61d3('0x1c')]];if(!_[_0x61d3('0x1b')](_0x3fcad9)&&!_['isNil'](_0x1da282)){var _0x36fe1e=_0x3fcad9[_0x61d3('0x20')]-_0x1da282['utcOffset'];_0x5771e6=_0x3128f5[_0x61d3('0x18')]?_0x3128f5[_0x61d3('0x18')]:moment();var _0x3e8f35=moment(_0x5771e6)[_0x61d3('0x21')](_0x36fe1e,_0x61d3('0x22'));_0x5a1dcf({'ret':_0x3e8f35[_0x61d3('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5a1dcf({'ret':_0x5771e6});}else _0x5a1dcf({'ret':_0x5771e6});}else{_0x5a1dcf({'ret':_0x5771e6});}});}});return 0xa;}var _0x5a63c0=function(_0x525f69){return new BPromise(function(_0x4e2ee1,_0x5abb94){_0x339270(_0x525f69,_0x2adaa0)[_0x61d3('0x1e')](function(_0x59c106){_0x2adaa0['scheduledat']=_0x59c106[_0x61d3('0x23')];_0x360a70['CmHopper'][_0x61d3('0x1d')]({'where':{'phone':_0x2adaa0[_0x61d3('0xc')],'VoiceQueueId':_0x525f69['id']}})[_0x61d3('0x1e')](function(_0x241c69){if(!_[_0x61d3('0x1b')](_0x241c69)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2adaa0[_0x61d3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x525f69['id']);}return _0x360a70[_0x61d3('0x24')][_0x61d3('0x25')]({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0['ListId'],'priority':_0x2adaa0['priority']?_0x2adaa0[_0x61d3('0x26')]:0x2,'scheduledat':_0x2adaa0['scheduledat']?_0x2adaa0[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a')),'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0[_0x61d3('0x27')]?_0x2adaa0[_0x61d3('0x27')]:undefined,'callbackat':_0x2adaa0[_0x61d3('0x27')]?moment()[_0x61d3('0x19')](_0x61d3('0x1a')):undefined,'VoiceQueueId':_0x525f69['id']});})[_0x61d3('0x28')](function(_0x4e1d9c){_0x5abb94(_0x4e1d9c);});});});};var _0x413e81=function(_0x5cae70){return new BPromise(function(_0x19fa49,_0x23b482){_0x339270(_0x5cae70,_0x2adaa0)[_0x61d3('0x1e')](function(_0x6b4572){_0x2adaa0[_0x61d3('0x18')]=_0x6b4572[_0x61d3('0x23')];_0x360a70[_0x61d3('0x24')][_0x61d3('0x1d')]({'where':{'phone':_0x2adaa0[_0x61d3('0xc')],'VoiceQueueId':_0x5cae70['id']}})['then'](function(_0x86b1ec){if(!_[_0x61d3('0x1b')](_0x86b1ec)){throw new Error(_0x61d3('0x29')+_0x2adaa0[_0x61d3('0xc')]+_0x61d3('0x2a')+_0x5cae70['id']);}return _0x360a70[_0x61d3('0x2b')]['findOne']({'where':{'calleridnum':_0x2adaa0[_0x61d3('0xc')],'VoiceQueueId':_0x5cae70['id']}});})[_0x61d3('0x1e')](function(_0x4ef5c8){if(!_[_0x61d3('0x1b')](_0x4ef5c8)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2adaa0[_0x61d3('0xc')]+_0x61d3('0x2c')+_0x5cae70['id']);}return _0x360a70[_0x61d3('0x24')][_0x61d3('0x25')]({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0[_0x61d3('0x2d')],'priority':_0x2adaa0['priority']?_0x2adaa0[_0x61d3('0x26')]:0x2,'scheduledat':_0x2adaa0[_0x61d3('0x18')]?_0x2adaa0[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a')),'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0[_0x61d3('0x27')]?_0x2adaa0[_0x61d3('0x27')]:undefined,'callbackat':_0x2adaa0[_0x61d3('0x27')]?moment()['format'](_0x61d3('0x1a')):undefined,'VoiceQueueId':_0x5cae70['id']});})[_0x61d3('0x28')](function(_0x1910f3){_0x23b482(_0x1910f3);});});});};function _0x5caf12(){return function(_0x5391fe){logger[_0x61d3('0x15')](_0x61d3('0x16'),_0x61d3('0x17'),util['inspect'](_0x5391fe,{'showHidden':![],'depth':null}));};}function _0x73e612(_0x142bf8,_0x588144){var _0x16b537=_0x588144['scheduledat']?_0x588144[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a'));return new BPromise(function(_0x368eb9,_0x3e6f53){if(_[_0x61d3('0x1b')](_0x588144[_0x61d3('0x1c')])){_0x368eb9({'ret':_0x16b537});}else{_0x360a70['Campaign'][_0x61d3('0x1d')]({'where':{'id':_0x142bf8['id']}})[_0x61d3('0x1e')](function(_0x5f18bf){if(!_[_0x61d3('0x1b')](_0x5f18bf)){var _0x1d9170=_0x5f18bf['dialTimezone'];if(!_['isNil'](_0x1d9170)){var _0x3e6106=shared[_0x61d3('0x1f')];var _0x38fa5e=_0x3e6106[_0x1d9170];var _0x391ba4=_0x3e6106[_0x588144[_0x61d3('0x1c')]];if(!_[_0x61d3('0x1b')](_0x38fa5e)&&!_[_0x61d3('0x1b')](_0x391ba4)){var _0x3fae81=_0x38fa5e['utcOffset']-_0x391ba4[_0x61d3('0x20')];_0x16b537=_0x588144[_0x61d3('0x18')]?_0x588144[_0x61d3('0x18')]:moment();var _0x256f41=moment(_0x16b537)[_0x61d3('0x21')](_0x3fae81,_0x61d3('0x22'));_0x368eb9({'ret':_0x256f41[_0x61d3('0x19')](_0x61d3('0x1a'))});}else _0x368eb9({'ret':_0x16b537});}else _0x368eb9({'ret':_0x16b537});}else{_0x368eb9({'ret':_0x16b537});}});}});return 0xa;}var _0x58ab6f=function(_0x354a60){return new BPromise(function(_0x520079,_0x500e66){_0x73e612(_0x354a60,_0x2adaa0)[_0x61d3('0x1e')](function(_0x1f6063){_0x2adaa0['scheduledat']=_0x1f6063[_0x61d3('0x23')];_0x360a70['CmHopper'][_0x61d3('0x1d')]({'where':{'phone':_0x2adaa0[_0x61d3('0xc')],'CampaignId':_0x354a60['id']}})['then'](function(_0x1d3403){if(!_[_0x61d3('0x1b')](_0x1d3403)){throw new Error(_0x61d3('0x29')+_0x2adaa0[_0x61d3('0xc')]+_0x61d3('0x2e')+_0x354a60['id']);}return _0x360a70[_0x61d3('0x24')]['create']({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0['ListId'],'priority':_0x2adaa0[_0x61d3('0x26')]?_0x2adaa0[_0x61d3('0x26')]:0x2,'scheduledat':_0x2adaa0[_0x61d3('0x18')]?_0x2adaa0[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a')),'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0[_0x61d3('0x27')]?_0x2adaa0['callbackUniqueid']:undefined,'callbackat':_0x2adaa0[_0x61d3('0x27')]?moment()[_0x61d3('0x19')](_0x61d3('0x1a')):undefined,'CampaignId':_0x354a60['id']});})[_0x61d3('0x28')](function(_0xdc9db0){_0x500e66(_0xdc9db0);});});});};var _0x56b6ac=function(_0x380a19){return new BPromise(function(_0x551fd9,_0x13f405){_0x73e612(_0x380a19,_0x2adaa0)[_0x61d3('0x1e')](function(_0x9253f1){_0x2adaa0[_0x61d3('0x18')]=_0x9253f1[_0x61d3('0x23')];_0x360a70['CmHopper'][_0x61d3('0x1d')]({'where':{'phone':_0x2adaa0[_0x61d3('0xc')],'CampaignId':_0x380a19['id']}})['then'](function(_0x44d548){if(!_[_0x61d3('0x1b')](_0x44d548)){throw new Error(_0x61d3('0x29')+_0x2adaa0['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x380a19['id']);}return _0x360a70['CmHopperFinal'][_0x61d3('0x1d')]({'where':{'calleridnum':_0x2adaa0[_0x61d3('0xc')],'CampaignId':_0x380a19['id']}});})[_0x61d3('0x1e')](function(_0x27e694){if(!_[_0x61d3('0x1b')](_0x27e694)){throw new Error(_0x61d3('0x2f')+_0x2adaa0[_0x61d3('0xc')]+_0x61d3('0x30')+_0x380a19['id']);}return _0x360a70['CmHopper'][_0x61d3('0x25')]({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0['ListId'],'priority':_0x2adaa0[_0x61d3('0x26')]?_0x2adaa0['priority']:0x2,'scheduledat':_0x2adaa0[_0x61d3('0x18')]?_0x2adaa0['scheduledat']:moment()[_0x61d3('0x19')](_0x61d3('0x1a')),'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0[_0x61d3('0x27')]?_0x2adaa0[_0x61d3('0x27')]:undefined,'callbackat':_0x2adaa0['callbackUniqueid']?moment()[_0x61d3('0x19')](_0x61d3('0x1a')):undefined,'CampaignId':_0x380a19['id']});})[_0x61d3('0x28')](function(_0x563bf9){_0x13f405(_0x563bf9);});});});};if(_0x2adaa0[_0x61d3('0x2d')]){_0x360a70['VoiceQueue'][_0x61d3('0x31')]({'where':{'type':_0x61d3('0x32')},'attributes':['id',_0x61d3('0x33'),'dialTimezone'],'include':[{'model':_0x360a70[_0x61d3('0x34')],'as':_0x61d3('0x35'),'where':{'id':_0x2adaa0[_0x61d3('0x2d')]}}]})[_0x61d3('0x1e')](function(_0x33d249){if(_0x33d249){var _0x5b6879=[];for(var _0x57161d=0x0,_0x51d484;_0x57161d<_0x33d249[_0x61d3('0x36')];_0x57161d+=0x1){_0x51d484=_0x33d249[_0x57161d][_0x61d3('0x14')]({'plain':!![]});switch(_0x51d484[_0x61d3('0x33')]){case _0x61d3('0x37'):_0x413e81(_0x51d484)[_0x61d3('0x28')](_0x23d2b9());break;case'onlyIfOpen':_0x5a63c0(_0x51d484)[_0x61d3('0x28')](_0x23d2b9());break;default:_0x73e612(_0x51d484,_0x2adaa0)[_0x61d3('0x1e')](function(_0x220aa6){_0x2adaa0[_0x61d3('0x18')]=_0x220aa6['ret'];_0x360a70[_0x61d3('0x24')]['create']({'phone':_0x2adaa0['phone'],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0['ListId'],'scheduledat':_0x2adaa0[_0x61d3('0x18')]?_0x2adaa0['scheduledat']:moment()['format'](_0x61d3('0x1a')),'priority':_0x2adaa0[_0x61d3('0x26')]?_0x2adaa0['priority']:0x2,'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0['callbackUniqueid']?_0x2adaa0[_0x61d3('0x27')]:undefined,'callbackat':_0x2adaa0[_0x61d3('0x27')]?moment()[_0x61d3('0x19')](_0x61d3('0x1a')):undefined,'VoiceQueueId':_0x51d484['id']})['catch'](_0x23d2b9());});}}}})[_0x61d3('0x1e')](function(){return _0x360a70['VoiceQueue'][_0x61d3('0x31')]({'where':{'type':_0x61d3('0x32')},'attributes':['id'],'include':[{'model':_0x360a70[_0x61d3('0x34')],'as':_0x61d3('0x38'),'where':{'id':_0x2adaa0['ListId']}}]})[_0x61d3('0x1e')](function(_0x34e6b7){if(_0x34e6b7){var _0x5e75d7=[];for(var _0x453c31=0x0,_0x453d95;_0x453c31<_0x34e6b7['length'];_0x453c31+=0x1){_0x453d95=_0x34e6b7[_0x453c31][_0x61d3('0x14')]({'plain':!![]});_0x360a70['CmHopperBlack'][_0x61d3('0x25')]({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0[_0x61d3('0x2d')],'VoiceQueueId':_0x453d95['id']})['catch'](function(_0x1f0f1b){logger[_0x61d3('0x15')]('cmContact,\x20%s,\x20%s',_0x61d3('0x17'),_0x1f0f1b[_0x61d3('0x39')]);});}}});})['then'](function(){return _0x360a70[_0x61d3('0x3a')]['findAll']({'attributes':['id',_0x61d3('0x33'),_0x61d3('0x1c')],'include':[{'model':_0x360a70[_0x61d3('0x34')],'as':_0x61d3('0x35'),'where':{'id':_0x2adaa0['ListId']}}]})[_0x61d3('0x1e')](function(_0xdb2fe8){if(_0xdb2fe8){var _0x1f6884=[];for(var _0x5a7f6d=0x0,_0x225a7a;_0x5a7f6d<_0xdb2fe8['length'];_0x5a7f6d+=0x1){_0x225a7a=_0xdb2fe8[_0x5a7f6d][_0x61d3('0x14')]({'plain':!![]});switch(_0x225a7a[_0x61d3('0x33')]){case'always':_0x56b6ac(_0x225a7a)[_0x61d3('0x28')](_0x5caf12());break;case _0x61d3('0x3b'):_0x58ab6f(_0x225a7a)[_0x61d3('0x28')](_0x5caf12());break;default:_0x360a70['CmHopper'][_0x61d3('0x25')]({'phone':_0x2adaa0['phone'],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0[_0x61d3('0x2d')],'scheduledat':_0x2adaa0[_0x61d3('0x18')]?_0x2adaa0[_0x61d3('0x18')]:moment()[_0x61d3('0x19')](_0x61d3('0x1a')),'priority':_0x2adaa0[_0x61d3('0x26')]?_0x2adaa0[_0x61d3('0x26')]:0x2,'callback':_0x2adaa0[_0x61d3('0x27')]?!![]:![],'callbackuniqueid':_0x2adaa0[_0x61d3('0x27')]?_0x2adaa0[_0x61d3('0x27')]:undefined,'callbackat':_0x2adaa0[_0x61d3('0x27')]?moment()['format'](_0x61d3('0x1a')):undefined,'CampaignId':_0x225a7a['id']})[_0x61d3('0x28')](_0x5caf12());}}}});})[_0x61d3('0x1e')](function(){return _0x360a70[_0x61d3('0x3a')][_0x61d3('0x31')]({'attributes':['id'],'include':[{'model':_0x360a70[_0x61d3('0x34')],'as':'BlackLists','where':{'id':_0x2adaa0['ListId']}}]})[_0x61d3('0x1e')](function(_0x53d48f){if(_0x53d48f){var _0x5c7ef8=[];for(var _0x3d4659=0x0,_0x31a8ed;_0x3d4659<_0x53d48f[_0x61d3('0x36')];_0x3d4659+=0x1){_0x31a8ed=_0x53d48f[_0x3d4659]['get']({'plain':!![]});_0x360a70['CmHopperBlack']['create']({'phone':_0x2adaa0[_0x61d3('0xc')],'ContactId':_0x2adaa0['id'],'ListId':_0x2adaa0[_0x61d3('0x2d')],'CampaignId':_0x31a8ed['id']})[_0x61d3('0x28')](function(_0x1d361c){logger[_0x61d3('0x15')](_0x61d3('0x3c'),_0x61d3('0x17'),_0x1d361c[_0x61d3('0x39')]);});}}});})[_0x61d3('0x1e')](function(){_0x101980();})[_0x61d3('0x28')](function(_0x2e9fdf){logger[_0x61d3('0x15')](_0x61d3('0x3c'),'afterCreate',_0x2e9fdf[_0x61d3('0x39')]);_0x101980(_0x2e9fdf);});}else{_0x101980(new Error(_0x61d3('0x3d')));}},'afterDestroy':function(_0x5d53ce,_0x358dac,_0x145ea0){var _0x3b6488=_0x347cc9[_0x61d3('0x13')];var _0xfd5322=_0x5d53ce['get']({'plain':!![]});return _0x3b6488['CmHopper'][_0x61d3('0x31')]({'raw':!![],'where':{'ListId':_0xfd5322[_0x61d3('0x2d')],'ContactId':_0xfd5322['id']}})[_0x61d3('0x1e')](function(_0x4986d3){if(!_[_0x61d3('0x3e')](_0x4986d3)){var _0x526275=[];for(var _0x3ca176=0x0;_0x3ca176<_0x4986d3[_0x61d3('0x36')];_0x3ca176+=0x1){var _0x2ff413=_0x3b6488['CmHopper'][_0x61d3('0x3f')]({'where':{'ListId':_0x4986d3[_0x3ca176][_0x61d3('0x2d')],'ContactId':_0x4986d3[_0x3ca176][_0x61d3('0x40')],'VoiceQueueId':_0x4986d3[_0x3ca176]['VoiceQueueId'],'CampaignId':_0x4986d3[_0x3ca176][_0x61d3('0x41')]}});_0x526275[_0x61d3('0x42')](_0x2ff413);}return BPromise[_0x61d3('0x43')](_0x526275);}})['then'](function(_0x5dd93a){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0x61d3('0x44')](_0x5dd93a,{'showHidden':![],'depth':null}));_0x145ea0();})[_0x61d3('0x28')](function(_0x506996){logger[_0x61d3('0x15')](_0x61d3('0x45'),util[_0x61d3('0x44')](_0x506996,{'showHidden':![],'depth':null}));_0x145ea0(_0x506996);});}}});};
\ No newline at end of file
+var _0x5fc2=['add','minutes','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','ret','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\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','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','onlyIfOpen','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','path','rimraf','CmContact','cm_contacts','fti_cm_contacts','firstName','lastName','phone','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x5fc2,0x6b));var _0x25fc=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x5fc2[_0x1aa0e7];return _0x55f771;};'use strict';var _=require(_0x25fc('0x0'));var util=require(_0x25fc('0x1'));var logger=require(_0x25fc('0x2'))('api');var moment=require(_0x25fc('0x3'));var BPromise=require(_0x25fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25fc('0x5'));var rimraf=require(_0x25fc('0x6'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module['exports']=function(_0x1f1092,_0x3ff42f){return _0x1f1092['define'](_0x25fc('0x7'),attributes,{'tableName':_0x25fc('0x8'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x25fc('0x9'),'fields':[_0x25fc('0xa'),_0x25fc('0xb'),_0x25fc('0xc'),'mobile','fax',_0x25fc('0xd')],'type':_0x25fc('0xe')}],'timestamps':!![],'charset':_0x25fc('0xf'),'collate':_0x25fc('0x10'),'hooks':{'afterCreate':function(_0x1a658a,_0x1a2803,_0x3e7173){var _0x1f5595=_0x1f1092[_0x25fc('0x11')];var _0x172045=_0x1a658a[_0x25fc('0x12')]({'plain':!![]});function _0x4958e9(){return function(_0x224d1b){logger[_0x25fc('0x13')](_0x25fc('0x14'),_0x25fc('0x15'),util[_0x25fc('0x16')](_0x224d1b,{'showHidden':![],'depth':null}));};}function _0x312b0f(_0x3e5a19,_0x16a12f){var _0x2e11e6=_0x16a12f[_0x25fc('0x17')]?_0x16a12f[_0x25fc('0x17')]:moment()[_0x25fc('0x18')](_0x25fc('0x19'));return new BPromise(function(_0x439aa9,_0x395a80){if(_[_0x25fc('0x1a')](_0x16a12f[_0x25fc('0x1b')])){_0x439aa9({'ret':_0x2e11e6});}else{_0x1f5595[_0x25fc('0x1c')][_0x25fc('0x1d')]({'where':{'id':_0x3e5a19['id']}})[_0x25fc('0x1e')](function(_0x32abd6){if(!_['isNil'](_0x32abd6)){var _0x508368=_0x32abd6['dialTimezone'];if(!_[_0x25fc('0x1a')](_0x508368)){var _0xabe04e=shared[_0x25fc('0x1f')];var _0x10361c=_0xabe04e[_0x508368];var _0x5ba5af=_0xabe04e[_0x16a12f[_0x25fc('0x1b')]];if(!_[_0x25fc('0x1a')](_0x10361c)&&!_[_0x25fc('0x1a')](_0x5ba5af)){var _0x501133=_0x10361c['utcOffset']-_0x5ba5af[_0x25fc('0x20')];_0x2e11e6=_0x16a12f[_0x25fc('0x17')]?_0x16a12f[_0x25fc('0x17')]:moment();var _0x12ec1e=moment(_0x2e11e6)[_0x25fc('0x21')](_0x501133,_0x25fc('0x22'));_0x439aa9({'ret':_0x12ec1e[_0x25fc('0x18')](_0x25fc('0x19'))});}else _0x439aa9({'ret':_0x2e11e6});}else _0x439aa9({'ret':_0x2e11e6});}else{_0x439aa9({'ret':_0x2e11e6});}});}});return 0xa;}var _0x440544=function(_0x4b4908){return new BPromise(function(_0x58ed7c,_0x2803c8){_0x312b0f(_0x4b4908,_0x172045)[_0x25fc('0x1e')](function(_0x548a6f){_0x172045[_0x25fc('0x17')]=_0x548a6f['ret'];_0x1f5595['CmHopper'][_0x25fc('0x1d')]({'where':{'phone':_0x172045[_0x25fc('0xc')],'VoiceQueueId':_0x4b4908['id']}})[_0x25fc('0x1e')](function(_0x26d97c){if(!_['isNil'](_0x26d97c)){throw new Error(_0x25fc('0x23')+_0x172045['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4b4908['id']);}return _0x1f5595[_0x25fc('0x24')][_0x25fc('0x25')]({'phone':_0x172045['phone'],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'priority':_0x172045[_0x25fc('0x27')]?_0x172045[_0x25fc('0x27')]:0x2,'scheduledat':_0x172045[_0x25fc('0x17')]?_0x172045[_0x25fc('0x17')]:moment()[_0x25fc('0x18')](_0x25fc('0x19')),'callback':_0x172045['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x172045[_0x25fc('0x28')]?_0x172045['callbackUniqueid']:undefined,'callbackat':_0x172045['callbackUniqueid']?moment()[_0x25fc('0x18')](_0x25fc('0x19')):undefined,'VoiceQueueId':_0x4b4908['id']});})[_0x25fc('0x29')](function(_0x4c31b7){_0x2803c8(_0x4c31b7);});});});};var _0x190a25=function(_0x5523aa){return new BPromise(function(_0x3a16e5,_0x44e76a){_0x312b0f(_0x5523aa,_0x172045)['then'](function(_0x2c7357){_0x172045['scheduledat']=_0x2c7357[_0x25fc('0x2a')];_0x1f5595[_0x25fc('0x24')][_0x25fc('0x1d')]({'where':{'phone':_0x172045[_0x25fc('0xc')],'VoiceQueueId':_0x5523aa['id']}})[_0x25fc('0x1e')](function(_0x36098d){if(!_[_0x25fc('0x1a')](_0x36098d)){throw new Error(_0x25fc('0x23')+_0x172045['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5523aa['id']);}return _0x1f5595[_0x25fc('0x2b')][_0x25fc('0x1d')]({'where':{'calleridnum':_0x172045[_0x25fc('0xc')],'VoiceQueueId':_0x5523aa['id']}});})[_0x25fc('0x1e')](function(_0xe85cf1){if(!_[_0x25fc('0x1a')](_0xe85cf1)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x172045['phone']+_0x25fc('0x2c')+_0x5523aa['id']);}return _0x1f5595['CmHopper']['create']({'phone':_0x172045[_0x25fc('0xc')],'ContactId':_0x172045['id'],'ListId':_0x172045['ListId'],'priority':_0x172045[_0x25fc('0x27')]?_0x172045[_0x25fc('0x27')]:0x2,'scheduledat':_0x172045[_0x25fc('0x17')]?_0x172045[_0x25fc('0x17')]:moment()[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x172045[_0x25fc('0x28')]?!![]:![],'callbackuniqueid':_0x172045['callbackUniqueid']?_0x172045['callbackUniqueid']:undefined,'callbackat':_0x172045[_0x25fc('0x28')]?moment()[_0x25fc('0x18')](_0x25fc('0x19')):undefined,'VoiceQueueId':_0x5523aa['id']});})[_0x25fc('0x29')](function(_0x182210){_0x44e76a(_0x182210);});});});};function _0x186699(){return function(_0x36fca6){logger[_0x25fc('0x13')](_0x25fc('0x14'),_0x25fc('0x15'),util[_0x25fc('0x16')](_0x36fca6,{'showHidden':![],'depth':null}));};}function _0x865a8a(_0x55475f,_0x43438f){var _0x1e58e4=_0x43438f[_0x25fc('0x17')]?_0x43438f[_0x25fc('0x17')]:moment()[_0x25fc('0x18')](_0x25fc('0x19'));return new BPromise(function(_0x97529b,_0x610cf0){if(_[_0x25fc('0x1a')](_0x43438f[_0x25fc('0x1b')])){_0x97529b({'ret':_0x1e58e4});}else{_0x1f5595['Campaign'][_0x25fc('0x1d')]({'where':{'id':_0x55475f['id']}})['then'](function(_0x3b831a){if(!_[_0x25fc('0x1a')](_0x3b831a)){var _0x51160e=_0x3b831a[_0x25fc('0x1b')];if(!_['isNil'](_0x51160e)){var _0x2f772b=shared[_0x25fc('0x1f')];var _0x1f6c19=_0x2f772b[_0x51160e];var _0x3d1a8c=_0x2f772b[_0x43438f['dialTimezone']];if(!_[_0x25fc('0x1a')](_0x1f6c19)&&!_['isNil'](_0x3d1a8c)){var _0x2d566a=_0x1f6c19[_0x25fc('0x20')]-_0x3d1a8c['utcOffset'];_0x1e58e4=_0x43438f[_0x25fc('0x17')]?_0x43438f[_0x25fc('0x17')]:moment();var _0x2c61b0=moment(_0x1e58e4)['add'](_0x2d566a,_0x25fc('0x22'));_0x97529b({'ret':_0x2c61b0[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x97529b({'ret':_0x1e58e4});}else _0x97529b({'ret':_0x1e58e4});}else{_0x97529b({'ret':_0x1e58e4});}});}});return 0xa;}var _0x3a9d18=function(_0x774aa5){return new BPromise(function(_0x1e1ab0,_0x28ebca){_0x865a8a(_0x774aa5,_0x172045)[_0x25fc('0x1e')](function(_0x188a27){_0x172045[_0x25fc('0x17')]=_0x188a27[_0x25fc('0x2a')];_0x1f5595[_0x25fc('0x24')][_0x25fc('0x1d')]({'where':{'phone':_0x172045[_0x25fc('0xc')],'CampaignId':_0x774aa5['id']}})[_0x25fc('0x1e')](function(_0xaef189){if(!_[_0x25fc('0x1a')](_0xaef189)){throw new Error('cmContact,\x20afterCreate\x20'+_0x172045[_0x25fc('0xc')]+_0x25fc('0x2d')+_0x774aa5['id']);}return _0x1f5595[_0x25fc('0x24')][_0x25fc('0x25')]({'phone':_0x172045[_0x25fc('0xc')],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'priority':_0x172045[_0x25fc('0x27')]?_0x172045[_0x25fc('0x27')]:0x2,'scheduledat':_0x172045[_0x25fc('0x17')]?_0x172045['scheduledat']:moment()[_0x25fc('0x18')](_0x25fc('0x19')),'callback':_0x172045[_0x25fc('0x28')]?!![]:![],'callbackuniqueid':_0x172045['callbackUniqueid']?_0x172045['callbackUniqueid']:undefined,'callbackat':_0x172045[_0x25fc('0x28')]?moment()[_0x25fc('0x18')](_0x25fc('0x19')):undefined,'CampaignId':_0x774aa5['id']});})[_0x25fc('0x29')](function(_0x360087){_0x28ebca(_0x360087);});});});};var _0x39081a=function(_0x2efea4){return new BPromise(function(_0x360fa2,_0x13855b){_0x865a8a(_0x2efea4,_0x172045)[_0x25fc('0x1e')](function(_0x289432){_0x172045[_0x25fc('0x17')]=_0x289432['ret'];_0x1f5595[_0x25fc('0x24')]['findOne']({'where':{'phone':_0x172045[_0x25fc('0xc')],'CampaignId':_0x2efea4['id']}})[_0x25fc('0x1e')](function(_0x460ec7){if(!_[_0x25fc('0x1a')](_0x460ec7)){throw new Error(_0x25fc('0x23')+_0x172045[_0x25fc('0xc')]+_0x25fc('0x2e')+_0x2efea4['id']);}return _0x1f5595['CmHopperFinal'][_0x25fc('0x1d')]({'where':{'calleridnum':_0x172045[_0x25fc('0xc')],'CampaignId':_0x2efea4['id']}});})[_0x25fc('0x1e')](function(_0x340586){if(!_[_0x25fc('0x1a')](_0x340586)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x172045[_0x25fc('0xc')]+_0x25fc('0x2f')+_0x2efea4['id']);}return _0x1f5595[_0x25fc('0x24')][_0x25fc('0x25')]({'phone':_0x172045[_0x25fc('0xc')],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'priority':_0x172045[_0x25fc('0x27')]?_0x172045['priority']:0x2,'scheduledat':_0x172045[_0x25fc('0x17')]?_0x172045[_0x25fc('0x17')]:moment()[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x172045['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x172045['callbackUniqueid']?_0x172045[_0x25fc('0x28')]:undefined,'callbackat':_0x172045[_0x25fc('0x28')]?moment()[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2efea4['id']});})[_0x25fc('0x29')](function(_0x20cd64){_0x13855b(_0x20cd64);});});});};if(_0x172045['ListId']){_0x1f5595['VoiceQueue'][_0x25fc('0x30')]({'where':{'type':_0x25fc('0x31')},'attributes':['id',_0x25fc('0x32'),_0x25fc('0x1b')],'include':[{'model':_0x1f5595[_0x25fc('0x33')],'as':_0x25fc('0x34'),'where':{'id':_0x172045['ListId']}}]})['then'](function(_0x42ba1b){if(_0x42ba1b){var _0x1586cf=[];for(var _0x289a41=0x0,_0x2d3924;_0x289a41<_0x42ba1b[_0x25fc('0x35')];_0x289a41+=0x1){_0x2d3924=_0x42ba1b[_0x289a41][_0x25fc('0x12')]({'plain':!![]});switch(_0x2d3924[_0x25fc('0x32')]){case _0x25fc('0x36'):_0x190a25(_0x2d3924)[_0x25fc('0x29')](_0x4958e9());break;case'onlyIfOpen':_0x440544(_0x2d3924)[_0x25fc('0x29')](_0x4958e9());break;default:_0x865a8a(_0x2d3924,_0x172045)[_0x25fc('0x1e')](function(_0x5a4b89){_0x172045['scheduledat']=_0x5a4b89[_0x25fc('0x2a')];_0x1f5595[_0x25fc('0x24')][_0x25fc('0x25')]({'phone':_0x172045['phone'],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'scheduledat':_0x172045[_0x25fc('0x17')]?_0x172045[_0x25fc('0x17')]:moment()[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x172045[_0x25fc('0x27')]?_0x172045[_0x25fc('0x27')]:0x2,'callback':_0x172045[_0x25fc('0x28')]?!![]:![],'callbackuniqueid':_0x172045[_0x25fc('0x28')]?_0x172045['callbackUniqueid']:undefined,'callbackat':_0x172045['callbackUniqueid']?moment()[_0x25fc('0x18')](_0x25fc('0x19')):undefined,'VoiceQueueId':_0x2d3924['id']})[_0x25fc('0x29')](_0x4958e9());});}}}})[_0x25fc('0x1e')](function(){return _0x1f5595[_0x25fc('0x1c')]['findAll']({'where':{'type':_0x25fc('0x31')},'attributes':['id'],'include':[{'model':_0x1f5595[_0x25fc('0x33')],'as':_0x25fc('0x37'),'where':{'id':_0x172045[_0x25fc('0x26')]}}]})[_0x25fc('0x1e')](function(_0x59595b){if(_0x59595b){var _0x12c147=[];for(var _0x575d1f=0x0,_0xd1e66e;_0x575d1f<_0x59595b[_0x25fc('0x35')];_0x575d1f+=0x1){_0xd1e66e=_0x59595b[_0x575d1f][_0x25fc('0x12')]({'plain':!![]});_0x1f5595['CmHopperBlack'][_0x25fc('0x25')]({'phone':_0x172045['phone'],'ContactId':_0x172045['id'],'ListId':_0x172045['ListId'],'VoiceQueueId':_0xd1e66e['id']})[_0x25fc('0x29')](function(_0x53b102){logger[_0x25fc('0x13')](_0x25fc('0x38'),_0x25fc('0x15'),_0x53b102[_0x25fc('0x39')]);});}}});})[_0x25fc('0x1e')](function(){return _0x1f5595[_0x25fc('0x3a')][_0x25fc('0x30')]({'attributes':['id','dialCheckDuplicateType',_0x25fc('0x1b')],'include':[{'model':_0x1f5595['CmList'],'as':'Lists','where':{'id':_0x172045['ListId']}}]})['then'](function(_0x509eb6){if(_0x509eb6){var _0x383bef=[];for(var _0x1b4ba7=0x0,_0x1ca72f;_0x1b4ba7<_0x509eb6[_0x25fc('0x35')];_0x1b4ba7+=0x1){_0x1ca72f=_0x509eb6[_0x1b4ba7]['get']({'plain':!![]});switch(_0x1ca72f[_0x25fc('0x32')]){case _0x25fc('0x36'):_0x39081a(_0x1ca72f)[_0x25fc('0x29')](_0x186699());break;case _0x25fc('0x3b'):_0x3a9d18(_0x1ca72f)[_0x25fc('0x29')](_0x186699());break;default:_0x1f5595[_0x25fc('0x24')][_0x25fc('0x25')]({'phone':_0x172045[_0x25fc('0xc')],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'scheduledat':_0x172045['scheduledat']?_0x172045[_0x25fc('0x17')]:moment()[_0x25fc('0x18')](_0x25fc('0x19')),'priority':_0x172045[_0x25fc('0x27')]?_0x172045['priority']:0x2,'callback':_0x172045['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x172045[_0x25fc('0x28')]?_0x172045[_0x25fc('0x28')]:undefined,'callbackat':_0x172045[_0x25fc('0x28')]?moment()[_0x25fc('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1ca72f['id']})[_0x25fc('0x29')](_0x186699());}}}});})[_0x25fc('0x1e')](function(){return _0x1f5595['Campaign'][_0x25fc('0x30')]({'attributes':['id'],'include':[{'model':_0x1f5595[_0x25fc('0x33')],'as':_0x25fc('0x37'),'where':{'id':_0x172045[_0x25fc('0x26')]}}]})[_0x25fc('0x1e')](function(_0x46af2f){if(_0x46af2f){var _0x22b934=[];for(var _0x2e75c6=0x0,_0x116dea;_0x2e75c6<_0x46af2f[_0x25fc('0x35')];_0x2e75c6+=0x1){_0x116dea=_0x46af2f[_0x2e75c6][_0x25fc('0x12')]({'plain':!![]});_0x1f5595[_0x25fc('0x3c')][_0x25fc('0x25')]({'phone':_0x172045[_0x25fc('0xc')],'ContactId':_0x172045['id'],'ListId':_0x172045[_0x25fc('0x26')],'CampaignId':_0x116dea['id']})['catch'](function(_0x31577c){logger[_0x25fc('0x13')](_0x25fc('0x38'),_0x25fc('0x15'),_0x31577c['message']);});}}});})[_0x25fc('0x1e')](function(){_0x3e7173();})[_0x25fc('0x29')](function(_0xccdcd9){logger[_0x25fc('0x13')](_0x25fc('0x38'),_0x25fc('0x15'),_0xccdcd9['message']);_0x3e7173(_0xccdcd9);});}else{_0x3e7173(new Error(_0x25fc('0x3d')));}},'afterDestroy':function(_0x1dea42,_0x22d5f9,_0x30861a){var _0x276204=_0x1f1092[_0x25fc('0x11')];var _0x484ac5=_0x1dea42['get']({'plain':!![]});return _0x276204[_0x25fc('0x24')]['findAll']({'raw':!![],'where':{'ListId':_0x484ac5[_0x25fc('0x26')],'ContactId':_0x484ac5['id']}})['then'](function(_0x3cb9e5){if(!_[_0x25fc('0x3e')](_0x3cb9e5)){var _0x23d864=[];for(var _0x670ab3=0x0;_0x670ab3<_0x3cb9e5[_0x25fc('0x35')];_0x670ab3+=0x1){var _0x5d9ff9=_0x276204[_0x25fc('0x24')][_0x25fc('0x3f')]({'where':{'ListId':_0x3cb9e5[_0x670ab3][_0x25fc('0x26')],'ContactId':_0x3cb9e5[_0x670ab3]['ContactId'],'VoiceQueueId':_0x3cb9e5[_0x670ab3][_0x25fc('0x40')],'CampaignId':_0x3cb9e5[_0x670ab3][_0x25fc('0x41')]}});_0x23d864['push'](_0x5d9ff9);}return BPromise[_0x25fc('0x42')](_0x23d864);}})[_0x25fc('0x1e')](function(_0x296b47){logger[_0x25fc('0x43')](_0x25fc('0x44'),util[_0x25fc('0x16')](_0x296b47,{'showHidden':![],'depth':null}));_0x30861a();})['catch'](function(_0x74a4df){logger[_0x25fc('0x13')](_0x25fc('0x45'),util['inspect'](_0x74a4df,{'showHidden':![],'depth':null}));_0x30861a(_0x74a4df);});}}});};
\ No newline at end of file
index 88054dd..62a57e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a<Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x0a9e('0x2e')];_0x24936a++){var _0x4f41ae=Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x24936a];if(_0x4f41ae[_0x0a9e('0x2f')]('cf_')){_0x5640eb=squel[_0x0a9e('0x30')]()[_0x0a9e('0x31')](_0x0a9e('0x32'))['set'](_0x4f41ae,_0x2cc7a0['body'][_0x4f41ae])[_0x0a9e('0x1d')](_0x0a9e('0x33'),_0x1e8694['id'])['toString']();break;}}if(!_0x5640eb)return _0x1e8694;return db[_0x0a9e('0x34')][_0x0a9e('0x35')](_0x5640eb)[_0x0a9e('0x23')](function(){return _0x1e8694;});})[_0x0a9e('0x23')](function(_0x4b38d9){logger['info'](_0x0a9e('0x36'),_0x2cc7a0);logger[_0x0a9e('0x12')]('CreateCmContact',_0x2cc7a0,JSON[_0x0a9e('0x24')](_0x4b38d9));_0x2b7e7f(_0x4b38d9);})[_0x0a9e('0x18')](function(_0x1459bb){logger['error'](_0x0a9e('0x36'),_0x1459bb[_0x0a9e('0x16')],_0x2cc7a0);_0x3f3d41(_0x14b13f[_0x0a9e('0x14')](0x1f4,_0x1459bb[_0x0a9e('0x16')]));});});};
\ No newline at end of file
+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(_0xee54e1,_0x4f8545){var _0x2a7294=function(_0xca9ea1){while(--_0xca9ea1){_0xee54e1['push'](_0xee54e1['shift']());}};_0x2a7294(++_0x4f8545);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
index 708a850..648067a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.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(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 71d2521..7acd66b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x14f8d1,_0x3db5aa){var _0x25f3d9=function(_0x508dbc){while(--_0x508dbc){_0x14f8d1['push'](_0x14f8d1['shift']());}};_0x25f3d9(++_0x3db5aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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
+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(_0x895dd8,_0x54e21f){var _0x776e46=function(_0x3e606b){while(--_0x3e606b){_0x895dd8['push'](_0x895dd8['shift']());}};_0x776e46(++_0x54e21f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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
index 9ad8f43..bed8598 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x383a=['exports','INTEGER','STRING'];(function(_0x3f5a1a,_0x480fe5){var _0x348f27=function(_0x1f3f8b){while(--_0x1f3f8b){_0x3f5a1a['push'](_0x3f5a1a['shift']());}};_0x348f27(++_0x480fe5);}(_0x383a,0x1ad));var _0xa383=function(_0x5d983c,_0x57b322){_0x5d983c=_0x5d983c-0x0;var _0x45d2f8=_0x383a[_0x5d983c];return _0x45d2f8;};'use strict';var Sequelize=require('sequelize');module[_0xa383('0x0')]={'CmContactId':{'type':Sequelize[_0xa383('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xa383('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xa383('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xa383('0x2')],'defaultValue':null}};
\ No newline at end of file
+var _0x4f29=['PHONE','exports','INTEGER','STRING'];(function(_0x29469f,_0x31869b){var _0xa022ff=function(_0x27bcdf){while(--_0x27bcdf){_0x29469f['push'](_0x29469f['shift']());}};_0xa022ff(++_0x31869b);}(_0x4f29,0xfd));var _0x94f2=function(_0x44d85a,_0x45b2d9){_0x44d85a=_0x44d85a-0x0;var _0x57c93c=_0x4f29[_0x44d85a];return _0x57c93c;};'use strict';var Sequelize=require('sequelize');module[_0x94f2('0x0')]={'CmContactId':{'type':Sequelize[_0x94f2('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x94f2('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x94f2('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x94f2('0x2')],'defaultValue':_0x94f2('0x3')},'OrderBy':{'type':Sequelize[_0x94f2('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x94f2('0x2')],'defaultValue':null}};
\ No newline at end of file
index 1daf3df..9517035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0c=['count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','CmContactHasItem','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','include','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','userProfileId','autoAssociation','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined'];(function(_0x240989,_0x44c405){var _0x23aa83=function(_0x331920){while(--_0x331920){_0x240989['push'](_0x240989['shift']());}};_0x23aa83(++_0x44c405);}(_0x3c0c,0xe3));var _0xc3c0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3c0c[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xc3c0('0x0'));var rimraf=require(_0xc3c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc3c0('0x2'));var rp=require(_0xc3c0('0x3'));var moment=require(_0xc3c0('0x4'));var BPromise=require(_0xc3c0('0x5'));var Mustache=require(_0xc3c0('0x6'));var util=require('util');var path=require(_0xc3c0('0x7'));var sox=require(_0xc3c0('0x8'));var csv=require(_0xc3c0('0x9'));var ejs=require(_0xc3c0('0xa'));var fs=require('fs');var fs_extra=require(_0xc3c0('0xb'));var _=require(_0xc3c0('0xc'));var squel=require(_0xc3c0('0xd'));var crypto=require(_0xc3c0('0xe'));var jsforce=require(_0xc3c0('0xf'));var deskjs=require(_0xc3c0('0x10'));var toCsv=require(_0xc3c0('0x9'));var querystring=require(_0xc3c0('0x11'));var Papa=require(_0xc3c0('0x12'));var Redis=require(_0xc3c0('0x13'));var authService=require(_0xc3c0('0x14'));var qs=require(_0xc3c0('0x15'));var as=require(_0xc3c0('0x16'));var hardwareService=require(_0xc3c0('0x17'));var logger=require('../../config/logger')(_0xc3c0('0x18'));var utils=require('../../config/utils');var config=require(_0xc3c0('0x19'));var licenseUtil=require(_0xc3c0('0x1a'));var db=require(_0xc3c0('0x1b'))['db'];function respondWithStatusCode(_0x5d7657,_0x2e7a01){_0x2e7a01=_0x2e7a01||0xcc;return function(_0xa429f8){if(_0xa429f8){return _0x5d7657['sendStatus'](_0x2e7a01);}return _0x5d7657[_0xc3c0('0x1c')](_0x2e7a01)[_0xc3c0('0x1d')]();};}function respondWithResult(_0x1910e0,_0x13a7a3){_0x13a7a3=_0x13a7a3||0xc8;return function(_0x8b627){if(_0x8b627){return _0x1910e0[_0xc3c0('0x1c')](_0x13a7a3)['json'](_0x8b627);}};}function respondWithFilteredResult(_0x13c613,_0x5afd13){return function(_0x22b5cf){if(_0x22b5cf){var _0x16f5b5=typeof _0x5afd13['offset']==='undefined'&&typeof _0x5afd13['limit']===_0xc3c0('0x1e');var _0x431e04=_0x22b5cf[_0xc3c0('0x1f')];var _0x465e09=_0x16f5b5?0x0:_0x5afd13[_0xc3c0('0x20')];var _0x211739=_0x16f5b5?_0x22b5cf[_0xc3c0('0x1f')]:_0x5afd13['offset']+_0x5afd13[_0xc3c0('0x21')];var _0x4f4984;if(_0x211739>=_0x431e04){_0x211739=_0x431e04;_0x4f4984=0xc8;}else{_0x4f4984=0xce;}_0x13c613[_0xc3c0('0x1c')](_0x4f4984);return _0x13c613[_0xc3c0('0x22')](_0xc3c0('0x23'),_0x465e09+'-'+_0x211739+'/'+_0x431e04)[_0xc3c0('0x24')](_0x22b5cf);}return null;};}function patchUpdates(_0x1d9047){return function(_0x50fc5b){try{jsonpatch[_0xc3c0('0x25')](_0x50fc5b,_0x1d9047,!![]);}catch(_0x780e18){return BPromise['reject'](_0x780e18);}return _0x50fc5b[_0xc3c0('0x26')]();};}function saveUpdates(_0x483d4f,_0x19f55b){return function(_0x45e7d5){if(_0x45e7d5){return _0x45e7d5[_0xc3c0('0x27')](_0x483d4f)[_0xc3c0('0x28')](function(_0x1dea72){return _0x1dea72;});}return null;};}function removeEntity(_0x27462b,_0x51d643){return function(_0x4a98c1){if(_0x4a98c1){return _0x4a98c1[_0xc3c0('0x29')]()[_0xc3c0('0x28')](function(){var _0xe31d16=_0x4a98c1[_0xc3c0('0x2a')]({'plain':!![]});var _0x3e82af='CmContactHasItems';return db[_0xc3c0('0x2b')][_0xc3c0('0x29')]({'where':{'type':_0x3e82af,'resourceId':_0xe31d16['id']}})[_0xc3c0('0x28')](function(){return _0x4a98c1;});})['then'](function(){_0x27462b[_0xc3c0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xecd165,_0x3530bf){return function(_0x29fc85){if(!_0x29fc85){_0xecd165['sendStatus'](0x194);}return _0x29fc85;};}function handleError(_0xd2bb24,_0x115696){_0x115696=_0x115696||0x1f4;return function(_0x493f24){logger[_0xc3c0('0x2c')](_0x493f24[_0xc3c0('0x2d')]);if(_0x493f24[_0xc3c0('0x2e')]){delete _0x493f24[_0xc3c0('0x2e')];}_0xd2bb24[_0xc3c0('0x1c')](_0x115696)[_0xc3c0('0x2f')](_0x493f24);};}exports['index']=function(_0x1bc483,_0x1a6d3d){var _0x56d3f5={},_0x31921d={},_0x325f0e={'count':0x0,'rows':[]};var _0x352d62=_['map'](db[_0xc3c0('0x30')][_0xc3c0('0x31')],function(_0x3ab143){return{'name':_0x3ab143[_0xc3c0('0x32')],'type':_0x3ab143[_0xc3c0('0x33')][_0xc3c0('0x34')]};});_0x31921d[_0xc3c0('0x35')]=_[_0xc3c0('0x36')](_0x352d62,_0xc3c0('0x2e'));_0x31921d[_0xc3c0('0x37')]=_[_0xc3c0('0x38')](_0x1bc483['query']);_0x31921d[_0xc3c0('0x39')]=_[_0xc3c0('0x3a')](_0x31921d[_0xc3c0('0x35')],_0x31921d[_0xc3c0('0x37')]);_0x56d3f5[_0xc3c0('0x3b')]=_['intersection'](_0x31921d[_0xc3c0('0x35')],qs['fields'](_0x1bc483[_0xc3c0('0x37')]['fields']));_0x56d3f5[_0xc3c0('0x3b')]=_0x56d3f5[_0xc3c0('0x3b')][_0xc3c0('0x3c')]?_0x56d3f5['attributes']:_0x31921d['model'];if(!_0x1bc483[_0xc3c0('0x37')][_0xc3c0('0x3d')](_0xc3c0('0x3e'))){_0x56d3f5[_0xc3c0('0x21')]=qs[_0xc3c0('0x21')](_0x1bc483['query']['limit']);_0x56d3f5[_0xc3c0('0x20')]=qs[_0xc3c0('0x20')](_0x1bc483[_0xc3c0('0x37')]['offset']);}_0x56d3f5[_0xc3c0('0x3f')]=qs[_0xc3c0('0x40')](_0x1bc483[_0xc3c0('0x37')]['sort']);_0x56d3f5[_0xc3c0('0x41')]=qs['filters'](_[_0xc3c0('0x42')](_0x1bc483[_0xc3c0('0x37')],_0x31921d[_0xc3c0('0x39')]),_0x352d62);if(_0x1bc483[_0xc3c0('0x37')][_0xc3c0('0x43')]){_0x56d3f5[_0xc3c0('0x41')]=_['merge'](_0x56d3f5['where'],{'$or':_[_0xc3c0('0x36')](_0x352d62,function(_0x59b749){if(_0x59b749[_0xc3c0('0x33')]!==_0xc3c0('0x44')){var _0x4cf64e={};_0x4cf64e[_0x59b749[_0xc3c0('0x2e')]]={'$like':'%'+_0x1bc483['query'][_0xc3c0('0x43')]+'%'};return _0x4cf64e;}})});}_0x56d3f5=_['merge']({},_0x56d3f5,_0x1bc483[_0xc3c0('0x45')]);var _0x5cc789={'where':_0x56d3f5['where']};return db['CmContactHasItem'][_0xc3c0('0x1f')](_0x5cc789)[_0xc3c0('0x28')](function(_0xd767c5){_0x325f0e[_0xc3c0('0x1f')]=_0xd767c5;if(_0x1bc483['query'][_0xc3c0('0x46')]){_0x56d3f5['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0xc3c0('0x47')](_0x56d3f5);})[_0xc3c0('0x28')](function(_0x4a587a){_0x325f0e['rows']=_0x4a587a;return _0x325f0e;})[_0xc3c0('0x28')](respondWithFilteredResult(_0x1a6d3d,_0x56d3f5))[_0xc3c0('0x48')](handleError(_0x1a6d3d,null));};exports[_0xc3c0('0x49')]=function(_0x28cae7,_0x2ee01f){var _0x5aa041={'raw':!![],'where':{'id':_0x28cae7[_0xc3c0('0x4a')]['id']}},_0x3910a2={};_0x3910a2[_0xc3c0('0x35')]=_['keys'](db['CmContactHasItem'][_0xc3c0('0x31')]);_0x3910a2[_0xc3c0('0x37')]=_[_0xc3c0('0x38')](_0x28cae7[_0xc3c0('0x37')]);_0x3910a2['filters']=_['intersection'](_0x3910a2[_0xc3c0('0x35')],_0x3910a2['query']);_0x5aa041[_0xc3c0('0x3b')]=_['intersection'](_0x3910a2['model'],qs[_0xc3c0('0x4b')](_0x28cae7[_0xc3c0('0x37')][_0xc3c0('0x4b')]));_0x5aa041[_0xc3c0('0x3b')]=_0x5aa041['attributes'][_0xc3c0('0x3c')]?_0x5aa041[_0xc3c0('0x3b')]:_0x3910a2['model'];if(_0x28cae7[_0xc3c0('0x37')][_0xc3c0('0x46')]){_0x5aa041[_0xc3c0('0x4c')]=[{'all':!![]}];}_0x5aa041=_[_0xc3c0('0x4d')]({},_0x5aa041,_0x28cae7[_0xc3c0('0x45')]);return db[_0xc3c0('0x30')][_0xc3c0('0x4e')](_0x5aa041)[_0xc3c0('0x28')](handleEntityNotFound(_0x2ee01f,null))[_0xc3c0('0x28')](respondWithResult(_0x2ee01f,null))[_0xc3c0('0x48')](handleError(_0x2ee01f,null));};exports[_0xc3c0('0x4f')]=function(_0x571300,_0x245498){return db[_0xc3c0('0x30')][_0xc3c0('0x4f')](_0x571300['body'],{})['then'](function(_0x13b638){var _0x1085bc=_0x571300[_0xc3c0('0x50')][_0xc3c0('0x2a')]({'plain':!![]});if(!_0x1085bc)throw new Error(_0xc3c0('0x51'));if(_0x1085bc['role']===_0xc3c0('0x50')){var _0x583114=_0x13b638[_0xc3c0('0x2a')]({'plain':!![]});var _0x1a95d4=_0xc3c0('0x52');return db['UserProfileSection']['find']({'where':{'name':_0x1a95d4,'userProfileId':_0x1085bc[_0xc3c0('0x53')]},'raw':!![]})[_0xc3c0('0x28')](function(_0x1586b9){if(_0x1586b9&&_0x1586b9[_0xc3c0('0x54')]===0x0){return db[_0xc3c0('0x2b')][_0xc3c0('0x4f')]({'name':_0x583114[_0xc3c0('0x2e')],'resourceId':_0x583114['id'],'type':_0x1586b9[_0xc3c0('0x2e')],'sectionId':_0x1586b9['id']},{})[_0xc3c0('0x28')](function(){return _0x13b638;});}else{return _0x13b638;}})['catch'](function(_0x832e4f){logger[_0xc3c0('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x832e4f);throw _0x832e4f;});}return _0x13b638;})[_0xc3c0('0x28')](respondWithResult(_0x245498,0xc9))['catch'](handleError(_0x245498,null));};exports[_0xc3c0('0x27')]=function(_0x2e6ff1,_0x5f1ed7){if(_0x2e6ff1[_0xc3c0('0x55')]['id']){delete _0x2e6ff1['body']['id'];}return db[_0xc3c0('0x30')][_0xc3c0('0x4e')]({'where':{'id':_0x2e6ff1[_0xc3c0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f1ed7,null))['then'](saveUpdates(_0x2e6ff1[_0xc3c0('0x55')],null))[_0xc3c0('0x28')](respondWithResult(_0x5f1ed7,null))['catch'](handleError(_0x5f1ed7,null));};exports[_0xc3c0('0x29')]=function(_0x5cf913,_0x3a6c72){return db[_0xc3c0('0x30')][_0xc3c0('0x4e')]({'where':{'id':_0x5cf913[_0xc3c0('0x4a')]['id']}})[_0xc3c0('0x28')](handleEntityNotFound(_0x3a6c72,null))[_0xc3c0('0x28')](removeEntity(_0x3a6c72,null))[_0xc3c0('0x48')](handleError(_0x3a6c72,null));};
\ No newline at end of file
+var _0x7ad9=['order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4b62f1,_0x3ffd10){var _0x4772c2=function(_0x59a237){while(--_0x59a237){_0x4b62f1['push'](_0x4b62f1['shift']());}};_0x4772c2(++_0x3ffd10);}(_0x7ad9,0x6c));var _0x97ad=function(_0x2f5937,_0x4b16da){_0x2f5937=_0x2f5937-0x0;var _0x5e91e5=_0x7ad9[_0x2f5937];return _0x5e91e5;};'use strict';var emlformat=require(_0x97ad('0x0'));var rimraf=require(_0x97ad('0x1'));var zipdir=require(_0x97ad('0x2'));var jsonpatch=require(_0x97ad('0x3'));var rp=require(_0x97ad('0x4'));var moment=require('moment');var BPromise=require(_0x97ad('0x5'));var Mustache=require(_0x97ad('0x6'));var util=require(_0x97ad('0x7'));var path=require(_0x97ad('0x8'));var sox=require('sox');var csv=require(_0x97ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97ad('0xa'));var _=require(_0x97ad('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x97ad('0xc'));var toCsv=require(_0x97ad('0x9'));var querystring=require(_0x97ad('0xd'));var Papa=require(_0x97ad('0xe'));var Redis=require('ioredis');var authService=require(_0x97ad('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97ad('0x10'));var logger=require(_0x97ad('0x11'))(_0x97ad('0x12'));var utils=require(_0x97ad('0x13'));var config=require(_0x97ad('0x14'));var licenseUtil=require(_0x97ad('0x15'));var db=require(_0x97ad('0x16'))['db'];function respondWithStatusCode(_0x17a10f,_0x28c459){_0x28c459=_0x28c459||0xcc;return function(_0x129b2d){if(_0x129b2d){return _0x17a10f[_0x97ad('0x17')](_0x28c459);}return _0x17a10f[_0x97ad('0x18')](_0x28c459)[_0x97ad('0x19')]();};}function respondWithResult(_0x3eeaf4,_0x347e4d){_0x347e4d=_0x347e4d||0xc8;return function(_0x521b01){if(_0x521b01){return _0x3eeaf4['status'](_0x347e4d)[_0x97ad('0x1a')](_0x521b01);}};}function respondWithFilteredResult(_0x4fbdf2,_0x59d413){return function(_0x1819ee){if(_0x1819ee){var _0x22e721=typeof _0x59d413[_0x97ad('0x1b')]===_0x97ad('0x1c')&&typeof _0x59d413[_0x97ad('0x1d')]==='undefined';var _0x6845c5=_0x1819ee[_0x97ad('0x1e')];var _0x55b52b=_0x22e721?0x0:_0x59d413[_0x97ad('0x1b')];var _0x58ced2=_0x22e721?_0x1819ee['count']:_0x59d413[_0x97ad('0x1b')]+_0x59d413[_0x97ad('0x1d')];var _0x265530;if(_0x58ced2>=_0x6845c5){_0x58ced2=_0x6845c5;_0x265530=0xc8;}else{_0x265530=0xce;}_0x4fbdf2['status'](_0x265530);return _0x4fbdf2[_0x97ad('0x1f')](_0x97ad('0x20'),_0x55b52b+'-'+_0x58ced2+'/'+_0x6845c5)[_0x97ad('0x1a')](_0x1819ee);}return null;};}function patchUpdates(_0x4bd165){return function(_0x5a7492){try{jsonpatch[_0x97ad('0x21')](_0x5a7492,_0x4bd165,!![]);}catch(_0x5c0678){return BPromise[_0x97ad('0x22')](_0x5c0678);}return _0x5a7492[_0x97ad('0x23')]();};}function saveUpdates(_0x2e3a4a,_0x521c7a){return function(_0x6f1e73){if(_0x6f1e73){return _0x6f1e73[_0x97ad('0x24')](_0x2e3a4a)[_0x97ad('0x25')](function(_0x201c91){return _0x201c91;});}return null;};}function removeEntity(_0x239a3c,_0x2ec43c){return function(_0x2e4c59){if(_0x2e4c59){return _0x2e4c59['destroy']()[_0x97ad('0x25')](function(){var _0x23824b=_0x2e4c59[_0x97ad('0x26')]({'plain':!![]});var _0x3c3a04=_0x97ad('0x27');return db[_0x97ad('0x28')][_0x97ad('0x29')]({'where':{'type':_0x3c3a04,'resourceId':_0x23824b['id']}})[_0x97ad('0x25')](function(){return _0x2e4c59;});})[_0x97ad('0x25')](function(){_0x239a3c[_0x97ad('0x18')](0xcc)[_0x97ad('0x19')]();});}};}function handleEntityNotFound(_0x589133,_0x56b382){return function(_0x73168b){if(!_0x73168b){_0x589133[_0x97ad('0x17')](0x194);}return _0x73168b;};}function handleError(_0x833e7b,_0x548041){_0x548041=_0x548041||0x1f4;return function(_0x18b17c){logger[_0x97ad('0x2a')](_0x18b17c['stack']);if(_0x18b17c[_0x97ad('0x2b')]){delete _0x18b17c[_0x97ad('0x2b')];}_0x833e7b[_0x97ad('0x18')](_0x548041)[_0x97ad('0x2c')](_0x18b17c);};}exports[_0x97ad('0x2d')]=function(_0x2934d8,_0x4aea39){var _0x1829d5={},_0x3bf063={},_0x2114ed={'count':0x0,'rows':[]};var _0x514ae3=_[_0x97ad('0x2e')](db[_0x97ad('0x2f')][_0x97ad('0x30')],function(_0x4e139f){return{'name':_0x4e139f[_0x97ad('0x31')],'type':_0x4e139f[_0x97ad('0x32')]['key']};});_0x3bf063[_0x97ad('0x33')]=_[_0x97ad('0x2e')](_0x514ae3,_0x97ad('0x2b'));_0x3bf063[_0x97ad('0x34')]=_['keys'](_0x2934d8[_0x97ad('0x34')]);_0x3bf063[_0x97ad('0x35')]=_[_0x97ad('0x36')](_0x3bf063[_0x97ad('0x33')],_0x3bf063['query']);_0x1829d5[_0x97ad('0x37')]=_['intersection'](_0x3bf063[_0x97ad('0x33')],qs['fields'](_0x2934d8['query'][_0x97ad('0x38')]));_0x1829d5['attributes']=_0x1829d5[_0x97ad('0x37')][_0x97ad('0x39')]?_0x1829d5[_0x97ad('0x37')]:_0x3bf063['model'];if(!_0x2934d8[_0x97ad('0x34')][_0x97ad('0x3a')](_0x97ad('0x3b'))){_0x1829d5[_0x97ad('0x1d')]=qs[_0x97ad('0x1d')](_0x2934d8[_0x97ad('0x34')]['limit']);_0x1829d5['offset']=qs[_0x97ad('0x1b')](_0x2934d8['query'][_0x97ad('0x1b')]);}_0x1829d5[_0x97ad('0x3c')]=qs['sort'](_0x2934d8[_0x97ad('0x34')]['sort']);_0x1829d5[_0x97ad('0x3d')]=qs[_0x97ad('0x35')](_[_0x97ad('0x3e')](_0x2934d8[_0x97ad('0x34')],_0x3bf063['filters']),_0x514ae3);if(_0x2934d8[_0x97ad('0x34')][_0x97ad('0x3f')]){_0x1829d5[_0x97ad('0x3d')]=_[_0x97ad('0x40')](_0x1829d5[_0x97ad('0x3d')],{'$or':_['map'](_0x514ae3,function(_0x1be60e){if(_0x1be60e['type']!=='VIRTUAL'){var _0x206d61={};_0x206d61[_0x1be60e[_0x97ad('0x2b')]]={'$like':'%'+_0x2934d8['query'][_0x97ad('0x3f')]+'%'};return _0x206d61;}})});}_0x1829d5=_[_0x97ad('0x40')]({},_0x1829d5,_0x2934d8['options']);var _0x54daf5={'where':_0x1829d5[_0x97ad('0x3d')]};return db['CmContactHasItem'][_0x97ad('0x1e')](_0x54daf5)[_0x97ad('0x25')](function(_0xa87243){_0x2114ed['count']=_0xa87243;if(_0x2934d8[_0x97ad('0x34')][_0x97ad('0x41')]){_0x1829d5[_0x97ad('0x42')]=[{'all':!![]}];}return db[_0x97ad('0x2f')][_0x97ad('0x43')](_0x1829d5);})['then'](function(_0x54c326){_0x2114ed[_0x97ad('0x44')]=_0x54c326;return _0x2114ed;})[_0x97ad('0x25')](respondWithFilteredResult(_0x4aea39,_0x1829d5))[_0x97ad('0x45')](handleError(_0x4aea39,null));};exports[_0x97ad('0x46')]=function(_0x28b944,_0x29b8cc){var _0x371a0f={'raw':!![],'where':{'id':_0x28b944[_0x97ad('0x47')]['id']}},_0x431de2={};_0x431de2['model']=_['keys'](db[_0x97ad('0x2f')][_0x97ad('0x30')]);_0x431de2[_0x97ad('0x34')]=_[_0x97ad('0x48')](_0x28b944['query']);_0x431de2[_0x97ad('0x35')]=_['intersection'](_0x431de2[_0x97ad('0x33')],_0x431de2[_0x97ad('0x34')]);_0x371a0f[_0x97ad('0x37')]=_[_0x97ad('0x36')](_0x431de2['model'],qs[_0x97ad('0x38')](_0x28b944[_0x97ad('0x34')][_0x97ad('0x38')]));_0x371a0f[_0x97ad('0x37')]=_0x371a0f[_0x97ad('0x37')][_0x97ad('0x39')]?_0x371a0f['attributes']:_0x431de2[_0x97ad('0x33')];if(_0x28b944['query'][_0x97ad('0x41')]){_0x371a0f['include']=[{'all':!![]}];}_0x371a0f=_[_0x97ad('0x40')]({},_0x371a0f,_0x28b944[_0x97ad('0x49')]);return db[_0x97ad('0x2f')][_0x97ad('0x4a')](_0x371a0f)[_0x97ad('0x25')](handleEntityNotFound(_0x29b8cc,null))[_0x97ad('0x25')](respondWithResult(_0x29b8cc,null))[_0x97ad('0x45')](handleError(_0x29b8cc,null));};exports[_0x97ad('0x4b')]=function(_0x53b51b,_0x5da856){return db[_0x97ad('0x2f')]['create'](_0x53b51b['body'],{})['then'](function(_0x7b4dc8){var _0x42e831=_0x53b51b[_0x97ad('0x4c')][_0x97ad('0x26')]({'plain':!![]});if(!_0x42e831)throw new Error(_0x97ad('0x4d'));if(_0x42e831[_0x97ad('0x4e')]===_0x97ad('0x4c')){var _0x4ffe3c=_0x7b4dc8[_0x97ad('0x26')]({'plain':!![]});var _0x4b7260=_0x97ad('0x27');return db[_0x97ad('0x4f')]['find']({'where':{'name':_0x4b7260,'userProfileId':_0x42e831[_0x97ad('0x50')]},'raw':!![]})[_0x97ad('0x25')](function(_0x2b3ce8){if(_0x2b3ce8&&_0x2b3ce8[_0x97ad('0x51')]===0x0){return db[_0x97ad('0x28')][_0x97ad('0x4b')]({'name':_0x4ffe3c[_0x97ad('0x2b')],'resourceId':_0x4ffe3c['id'],'type':_0x2b3ce8[_0x97ad('0x2b')],'sectionId':_0x2b3ce8['id']},{})[_0x97ad('0x25')](function(){return _0x7b4dc8;});}else{return _0x7b4dc8;}})[_0x97ad('0x45')](function(_0x350066){logger['error'](_0x97ad('0x52'),_0x350066);throw _0x350066;});}return _0x7b4dc8;})['then'](respondWithResult(_0x5da856,0xc9))[_0x97ad('0x45')](handleError(_0x5da856,null));};exports[_0x97ad('0x24')]=function(_0x11d46f,_0x227d8c){if(_0x11d46f[_0x97ad('0x53')]['id']){delete _0x11d46f['body']['id'];}return db[_0x97ad('0x2f')][_0x97ad('0x4a')]({'where':{'id':_0x11d46f['params']['id']}})[_0x97ad('0x25')](handleEntityNotFound(_0x227d8c,null))[_0x97ad('0x25')](saveUpdates(_0x11d46f[_0x97ad('0x53')],null))[_0x97ad('0x25')](respondWithResult(_0x227d8c,null))[_0x97ad('0x45')](handleError(_0x227d8c,null));};exports[_0x97ad('0x29')]=function(_0x2bf14f,_0x309d75){return db['CmContactHasItem']['find']({'where':{'id':_0x2bf14f[_0x97ad('0x47')]['id']}})[_0x97ad('0x25')](handleEntityNotFound(_0x309d75,null))['then'](removeEntity(_0x309d75,null))[_0x97ad('0x45')](handleError(_0x309d75,null));};
\ No newline at end of file
index 86325db..228d15a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f0=['api','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','lodash','../../config/logger'];(function(_0x3ee558,_0x30e062){var _0x20245e=function(_0x52e262){while(--_0x52e262){_0x3ee558['push'](_0x3ee558['shift']());}};_0x20245e(++_0x30e062);}(_0x04f0,0x170));var _0x004f=function(_0x6001,_0x1807a7){_0x6001=_0x6001-0x0;var _0x4f5ec2=_0x04f0[_0x6001];return _0x4f5ec2;};'use strict';var _=require(_0x004f('0x0'));var util=require('util');var logger=require(_0x004f('0x1'))(_0x004f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x004f('0x3'));var fs=require('fs');var path=require(_0x004f('0x4'));var rimraf=require(_0x004f('0x5'));var config=require(_0x004f('0x6'));var attributes=require(_0x004f('0x7'));module[_0x004f('0x8')]=function(_0x2bfadb,_0x1423e9){return _0x2bfadb['define'](_0x004f('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3521=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items'];(function(_0x2ef3dd,_0xa8d70b){var _0x2fece3=function(_0x4b66bd){while(--_0x4b66bd){_0x2ef3dd['push'](_0x2ef3dd['shift']());}};_0x2fece3(++_0xa8d70b);}(_0x3521,0x129));var _0x1352=function(_0x28b1b2,_0x3524ba){_0x28b1b2=_0x28b1b2-0x0;var _0x15ec0e=_0x3521[_0x28b1b2];return _0x15ec0e;};'use strict';var _=require(_0x1352('0x0'));var util=require('util');var logger=require(_0x1352('0x1'))(_0x1352('0x2'));var moment=require(_0x1352('0x3'));var BPromise=require(_0x1352('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1352('0x5'));var config=require(_0x1352('0x6'));var attributes=require(_0x1352('0x7'));module['exports']=function(_0x26931e,_0x7c4a02){return _0x26931e[_0x1352('0x8')](_0x1352('0x9'),attributes,{'tableName':_0x1352('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a06ba4..b09d9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadfc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash'];(function(_0x58f046,_0x1eafa5){var _0x328bec=function(_0x3d91a7){while(--_0x3d91a7){_0x58f046['push'](_0x58f046['shift']());}};_0x328bec(++_0x1eafa5);}(_0xadfc,0x1a3));var _0xcadf=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xadfc[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xcadf('0x0'));var util=require(_0xcadf('0x1'));var moment=require(_0xcadf('0x2'));var BPromise=require(_0xcadf('0x3'));var rs=require(_0xcadf('0x4'));var fs=require('fs');var Redis=require(_0xcadf('0x5'));var db=require(_0xcadf('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcadf('0x7'));var config=require(_0xcadf('0x8'));var jayson=require(_0xcadf('0x9'));var client=jayson['client'][_0xcadf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xff69aa,_0xd6f2f6,_0x16d383){return new BPromise(function(_0x2e3b51,_0x2db56d){return client[_0xcadf('0xb')](_0xff69aa,_0x16d383)[_0xcadf('0xc')](function(_0x164d00){logger['info'](_0xcadf('0xd'),_0xd6f2f6,_0xcadf('0xe'));logger[_0xcadf('0xf')](_0xcadf('0x10'),_0xd6f2f6,_0xcadf('0xe'),JSON['stringify'](_0x164d00));if(_0x164d00[_0xcadf('0x11')]){if(_0x164d00[_0xcadf('0x11')]['code']===0x1f4){logger['error'](_0xcadf('0xd'),_0xd6f2f6,_0x164d00[_0xcadf('0x11')][_0xcadf('0x12')]);return _0x2db56d(_0x164d00['error'][_0xcadf('0x12')]);}logger[_0xcadf('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0xd6f2f6,_0x164d00[_0xcadf('0x11')][_0xcadf('0x12')]);return _0x2e3b51(_0x164d00[_0xcadf('0x11')][_0xcadf('0x12')]);}else{logger[_0xcadf('0x13')](_0xcadf('0xd'),_0xd6f2f6,_0xcadf('0xe'));_0x2e3b51(_0x164d00['result'][_0xcadf('0x12')]);}})[_0xcadf('0x14')](function(_0x4fddbe){logger[_0xcadf('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0xd6f2f6,_0x4fddbe);_0x2db56d(_0x4fddbe);});});}
\ No newline at end of file
+var _0x1d86=['CmContactHasItem,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x1d86,0x67));var _0x61d8=function(_0x168f77,_0x2db99a){_0x168f77=_0x168f77-0x0;var _0x5b4dc6=_0x1d86[_0x168f77];return _0x5b4dc6;};'use strict';var _=require(_0x61d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x61d8('0x1'));var rs=require(_0x61d8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61d8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x61d8('0x4'))(_0x61d8('0x5'));var config=require('../../config/environment');var jayson=require(_0x61d8('0x6'));var client=jayson[_0x61d8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe3f6e5,_0x4fdfd5,_0x55e3a3){return new BPromise(function(_0x1efc8b,_0x5976ee){return client[_0x61d8('0x8')](_0xe3f6e5,_0x55e3a3)[_0x61d8('0x9')](function(_0x2c62b6){logger[_0x61d8('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x4fdfd5,_0x61d8('0xb'));logger[_0x61d8('0xc')](_0x61d8('0xd'),_0x4fdfd5,'request\x20sent',JSON[_0x61d8('0xe')](_0x2c62b6));if(_0x2c62b6['error']){if(_0x2c62b6[_0x61d8('0xf')][_0x61d8('0x10')]===0x1f4){logger[_0x61d8('0xf')](_0x61d8('0x11'),_0x4fdfd5,_0x2c62b6['error'][_0x61d8('0x12')]);return _0x5976ee(_0x2c62b6[_0x61d8('0xf')]['message']);}logger[_0x61d8('0xf')](_0x61d8('0x11'),_0x4fdfd5,_0x2c62b6[_0x61d8('0xf')][_0x61d8('0x12')]);return _0x1efc8b(_0x2c62b6[_0x61d8('0xf')][_0x61d8('0x12')]);}else{logger[_0x61d8('0xa')](_0x61d8('0x11'),_0x4fdfd5,_0x61d8('0xb'));_0x1efc8b(_0x2c62b6[_0x61d8('0x13')][_0x61d8('0x12')]);}})['catch'](function(_0x1a22fa){logger[_0x61d8('0xf')](_0x61d8('0x11'),_0x4fdfd5,_0x1a22fa);_0x5976ee(_0x1a22fa);});});}
\ No newline at end of file
index 9b9166e..abc66c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3b1841,_0x34908a){var _0x2e14db=function(_0x22c3a4){while(--_0x22c3a4){_0x3b1841['push'](_0x3b1841['shift']());}};_0x2e14db(++_0x34908a);}(_0xc12e,0x13f));var _0xec12=function(_0x26e194,_0x205ea3){_0x26e194=_0x26e194-0x0;var _0x4bc1a8=_0xc12e[_0x26e194];return _0x4bc1a8;};'use strict';var multer=require(_0xec12('0x0'));var util=require(_0xec12('0x1'));var path=require(_0xec12('0x2'));var timeout=require(_0xec12('0x3'));var express=require('express');var router=express[_0xec12('0x4')]();var fs_extra=require(_0xec12('0x5'));var auth=require(_0xec12('0x6'));var interaction=require(_0xec12('0x7'));var config=require(_0xec12('0x8'));var controller=require(_0xec12('0x9'));router[_0xec12('0xa')]('/',auth[_0xec12('0xb')](),controller['index']);router['get']('/:id',auth[_0xec12('0xb')](),controller['show']);router['post']('/',auth[_0xec12('0xb')](),controller[_0xec12('0xc')]);router[_0xec12('0xd')](_0xec12('0xe'),auth[_0xec12('0xb')](),controller[_0xec12('0xf')]);router[_0xec12('0x10')](_0xec12('0xe'),auth[_0xec12('0xb')](),controller[_0xec12('0x11')]);module[_0xec12('0x12')]=router;
\ No newline at end of file
+var _0xa711=['index','get','show','create','update','delete','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa711,0xce));var _0x1a71=function(_0x2e1aa2,_0x279993){_0x2e1aa2=_0x2e1aa2-0x0;var _0x226eed=_0xa711[_0x2e1aa2];return _0x226eed;};'use strict';var multer=require(_0x1a71('0x0'));var util=require('util');var path=require(_0x1a71('0x1'));var timeout=require(_0x1a71('0x2'));var express=require(_0x1a71('0x3'));var router=express[_0x1a71('0x4')]();var fs_extra=require(_0x1a71('0x5'));var auth=require(_0x1a71('0x6'));var interaction=require(_0x1a71('0x7'));var config=require(_0x1a71('0x8'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0xa')]);router[_0x1a71('0xb')]('/:id',auth[_0x1a71('0x9')](),controller[_0x1a71('0xc')]);router['post']('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1a71('0xe')]);router[_0x1a71('0xf')](_0x1a71('0x10'),auth[_0x1a71('0x9')](),controller['destroy']);module[_0x1a71('0x11')]=router;
\ No newline at end of file
index 726df27..093697f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ac=['STRING','setDataValue','getDataValue','name','TEXT','long','type','select','values','stringify','BOOLEAN','ENUM','VIRTUAL','alias'];(function(_0x59ac4f,_0x14d2f2){var _0x3acb55=function(_0x725c0f){while(--_0x725c0f){_0x59ac4f['push'](_0x59ac4f['shift']());}};_0x3acb55(++_0x14d2f2);}(_0x20ac,0x194));var _0xc20a=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x20ac[_0xf26c2e];return _0x46ecb4;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xc20a('0x0')],'get':function(_0x56565a){return this['getDataValue'](_0xc20a('0x1'));}},'alias':{'type':Sequelize[_0xc20a('0x2')],'allowNull':![],'set':function(_0x5d622f){this[_0xc20a('0x3')](_0xc20a('0x1'),_0x5d622f?_0x5d622f:this[_0xc20a('0x4')](_0xc20a('0x5')));}},'type':{'type':Sequelize[_0xc20a('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0xc20a('0x6')](_0xc20a('0x7')),'get':function(){if(this[_0xc20a('0x4')](_0xc20a('0x8'))===_0xc20a('0x9')){return JSON['parse'](this[_0xc20a('0x4')](_0xc20a('0xa')));}else{return this[_0xc20a('0x4')]('values');}},'set':function(_0x1997c4){if(Array['isArray'](_0x1997c4)){this['setDataValue'](_0xc20a('0xa'),JSON[_0xc20a('0xb')](_0x1997c4));}else{this[_0xc20a('0x3')](_0xc20a('0xa'),_0x1997c4);}}},'required':{'type':Sequelize[_0xc20a('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc20a('0xd')]('voice')}};
\ No newline at end of file
+var _0x18cc=['voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','parse','isArray','values','BOOLEAN','ENUM'];(function(_0x23e859,_0x419ccc){var _0xe4964=function(_0x2e2501){while(--_0x2e2501){_0x23e859['push'](_0x23e859['shift']());}};_0xe4964(++_0x419ccc);}(_0x18cc,0xab));var _0xc18c=function(_0x112289,_0x21066d){_0x112289=_0x112289-0x0;var _0x357aa3=_0x18cc[_0x112289];return _0x357aa3;};'use strict';var Sequelize=require(_0xc18c('0x0'));var _=require('lodash');module[_0xc18c('0x1')]={'name':{'type':Sequelize[_0xc18c('0x2')],'get':function(_0xdc86c8){return this[_0xc18c('0x3')](_0xc18c('0x4'));}},'alias':{'type':Sequelize[_0xc18c('0x5')],'allowNull':![],'set':function(_0x59188f){this[_0xc18c('0x6')](_0xc18c('0x4'),_0x59188f?_0x59188f:this[_0xc18c('0x3')](_0xc18c('0x7')));}},'type':{'type':Sequelize[_0xc18c('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xc18c('0x8')),'get':function(){if(this['getDataValue'](_0xc18c('0x9'))===_0xc18c('0xa')){return JSON[_0xc18c('0xb')](this['getDataValue']('values'));}else{return this[_0xc18c('0x3')]('values');}},'set':function(_0x249643){if(Array[_0xc18c('0xc')](_0x249643)){this[_0xc18c('0x6')](_0xc18c('0xd'),JSON['stringify'](_0x249643));}else{this[_0xc18c('0x6')](_0xc18c('0xd'),_0x249643);}}},'required':{'type':Sequelize[_0xc18c('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc18c('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc18c('0xf')](_0xc18c('0x10'))}};
\ No newline at end of file
index 82ba057..1ed66c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ed=['switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','model','differenceBy','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','show','keys','include','find','body','catch','destroy','sequelize','transaction','create','Sequelize','text','TEXT','INTEGER'];(function(_0x2b1112,_0xffdb7){var _0x438c59=function(_0x44e9c8){while(--_0x44e9c8){_0x2b1112['push'](_0x2b1112['shift']());}};_0x438c59(++_0xffdb7);}(_0x01ed,0x104));var _0xd01e=function(_0x447d04,_0x17d2ce){_0x447d04=_0x447d04-0x0;var _0x36a9e7=_0x01ed[_0x447d04];return _0x36a9e7;};'use strict';var emlformat=require(_0xd01e('0x0'));var rimraf=require(_0xd01e('0x1'));var zipdir=require(_0xd01e('0x2'));var jsonpatch=require(_0xd01e('0x3'));var rp=require('request-promise');var moment=require(_0xd01e('0x4'));var BPromise=require(_0xd01e('0x5'));var Mustache=require(_0xd01e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd01e('0x7'));var csv=require(_0xd01e('0x8'));var ejs=require(_0xd01e('0x9'));var fs=require('fs');var fs_extra=require(_0xd01e('0xa'));var _=require(_0xd01e('0xb'));var squel=require('squel');var crypto=require(_0xd01e('0xc'));var jsforce=require(_0xd01e('0xd'));var deskjs=require(_0xd01e('0xe'));var toCsv=require(_0xd01e('0x8'));var querystring=require(_0xd01e('0xf'));var Papa=require(_0xd01e('0x10'));var Redis=require(_0xd01e('0x11'));var authService=require(_0xd01e('0x12'));var qs=require(_0xd01e('0x13'));var as=require(_0xd01e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd01e('0x15'))(_0xd01e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd01e('0x17'))['db'];function respondWithStatusCode(_0x2965ed,_0x4bbc63){_0x4bbc63=_0x4bbc63||0xcc;return function(_0x3d2b85){if(_0x3d2b85){return _0x2965ed[_0xd01e('0x18')](_0x4bbc63);}return _0x2965ed[_0xd01e('0x19')](_0x4bbc63)[_0xd01e('0x1a')]();};}function respondWithResult(_0x27de50,_0x1c1e30){_0x1c1e30=_0x1c1e30||0xc8;return function(_0x36c048){if(_0x36c048){return _0x27de50[_0xd01e('0x19')](_0x1c1e30)['json'](_0x36c048);}};}function respondWithFilteredResult(_0x5368ec,_0x38f111){return function(_0x3e4dd3){if(_0x3e4dd3){var _0x2c8f04=typeof _0x38f111[_0xd01e('0x1b')]===_0xd01e('0x1c')&&typeof _0x38f111[_0xd01e('0x1d')]===_0xd01e('0x1c');var _0x13bcd4=_0x3e4dd3[_0xd01e('0x1e')];var _0x128f6b=_0x2c8f04?0x0:_0x38f111[_0xd01e('0x1b')];var _0x18f945=_0x2c8f04?_0x3e4dd3[_0xd01e('0x1e')]:_0x38f111['offset']+_0x38f111[_0xd01e('0x1d')];var _0x54a4c5;if(_0x18f945>=_0x13bcd4){_0x18f945=_0x13bcd4;_0x54a4c5=0xc8;}else{_0x54a4c5=0xce;}_0x5368ec['status'](_0x54a4c5);return _0x5368ec[_0xd01e('0x1f')]('Content-Range',_0x128f6b+'-'+_0x18f945+'/'+_0x13bcd4)[_0xd01e('0x20')](_0x3e4dd3);}return null;};}function patchUpdates(_0x559aef){return function(_0x38ca84){try{jsonpatch['apply'](_0x38ca84,_0x559aef,!![]);}catch(_0x198122){return BPromise[_0xd01e('0x21')](_0x198122);}return _0x38ca84['save']();};}function saveUpdates(_0x4dd4f7,_0xd6d82f){return function(_0x2e9341){if(_0x2e9341){return _0x2e9341[_0xd01e('0x22')](_0x4dd4f7)[_0xd01e('0x23')](function(_0x1e0235){return _0x1e0235;});}return null;};}function removeEntity(_0x44a251,_0x558a0d){return function(_0x386eaa){if(_0x386eaa){return _0x386eaa['destroy']()[_0xd01e('0x23')](function(){_0x44a251['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x482d84,_0x3fadae){return function(_0x150bbc){if(!_0x150bbc){_0x482d84['sendStatus'](0x194);}return _0x150bbc;};}function handleError(_0x3c8139,_0xa77976){_0xa77976=_0xa77976||0x1f4;return function(_0x116c52){logger[_0xd01e('0x24')](_0x116c52[_0xd01e('0x25')]);if(_0x116c52[_0xd01e('0x26')]){delete _0x116c52[_0xd01e('0x26')];}_0x3c8139[_0xd01e('0x19')](_0xa77976)[_0xd01e('0x27')](_0x116c52);};}exports[_0xd01e('0x28')]=function(_0x108ca1,_0x43ccb7){var _0x278ec7={},_0x569dc9={},_0x41f375={'count':0x0,'rows':[]};var _0x2975d3=_[_0xd01e('0x29')](db[_0xd01e('0x2a')][_0xd01e('0x2b')],function(_0x24cefe){return{'name':_0x24cefe['fieldName'],'type':_0x24cefe['type']['key']};});_0x569dc9[_0xd01e('0x2c')]=_[_0xd01e('0x2d')](_[_0xd01e('0x29')](_0x2975d3,_0xd01e('0x26')),[_0xd01e('0x26')]);_0x569dc9[_0xd01e('0x2e')]=_['keys'](_0x108ca1['query']);_0x569dc9[_0xd01e('0x2f')]=_[_0xd01e('0x30')](_0x569dc9['model'],_0x569dc9['query']);_0x278ec7['attributes']=_[_0xd01e('0x30')](_0x569dc9[_0xd01e('0x2c')],qs[_0xd01e('0x31')](_0x108ca1[_0xd01e('0x2e')][_0xd01e('0x31')]));_0x278ec7[_0xd01e('0x32')]=_0x278ec7[_0xd01e('0x32')]['length']?_0x278ec7['attributes']:_0x569dc9[_0xd01e('0x2c')];if(!_0x108ca1[_0xd01e('0x2e')][_0xd01e('0x33')]('nolimit')){_0x278ec7[_0xd01e('0x1d')]=qs[_0xd01e('0x1d')](_0x108ca1[_0xd01e('0x2e')][_0xd01e('0x1d')]);_0x278ec7[_0xd01e('0x1b')]=qs[_0xd01e('0x1b')](_0x108ca1['query'][_0xd01e('0x1b')]);}_0x278ec7[_0xd01e('0x34')]=qs[_0xd01e('0x35')](_0x108ca1[_0xd01e('0x2e')]['sort']);_0x278ec7[_0xd01e('0x36')]=qs[_0xd01e('0x2f')](_[_0xd01e('0x37')](_0x108ca1[_0xd01e('0x2e')],_0x569dc9[_0xd01e('0x2f')]),_0x2975d3);if(_0x108ca1['query'][_0xd01e('0x38')]){_0x278ec7[_0xd01e('0x36')]=_[_0xd01e('0x39')](_0x278ec7['where'],{'$or':_[_0xd01e('0x29')](_0x2975d3,function(_0x3a4c20){if(_0x3a4c20[_0xd01e('0x3a')]!=='VIRTUAL'){var _0x4bac28={};_0x4bac28[_0x3a4c20[_0xd01e('0x26')]]={'$like':'%'+_0x108ca1['query'][_0xd01e('0x38')]+'%'};return _0x4bac28;}})});}_0x278ec7=_[_0xd01e('0x39')]({},_0x278ec7,_0x108ca1[_0xd01e('0x3b')]);var _0x3201ce={'where':_0x278ec7['where']};return db['CmCustomField']['count'](_0x3201ce)[_0xd01e('0x23')](function(_0x33d2c6){_0x41f375[_0xd01e('0x1e')]=_0x33d2c6;if(_0x108ca1[_0xd01e('0x2e')][_0xd01e('0x3c')]){_0x278ec7['include']=[{'all':!![]}];}return db[_0xd01e('0x2a')][_0xd01e('0x3d')](_0x278ec7);})[_0xd01e('0x23')](function(_0x4cc9f7){_0x41f375['rows']=_0x4cc9f7;return _0x41f375;})[_0xd01e('0x23')](respondWithFilteredResult(_0x43ccb7,_0x278ec7))['catch'](handleError(_0x43ccb7,null));};exports[_0xd01e('0x3e')]=function(_0x345e78,_0x3e841b){var _0x3788c4={'raw':!![],'where':{'id':_0x345e78['params']['id']}},_0x1bae12={};_0x1bae12[_0xd01e('0x2c')]=_[_0xd01e('0x3f')](db[_0xd01e('0x2a')]['rawAttributes']);_0x1bae12[_0xd01e('0x2e')]=_[_0xd01e('0x3f')](_0x345e78[_0xd01e('0x2e')]);_0x1bae12['filters']=_[_0xd01e('0x30')](_0x1bae12[_0xd01e('0x2c')],_0x1bae12[_0xd01e('0x2e')]);_0x3788c4['attributes']=_[_0xd01e('0x30')](_0x1bae12[_0xd01e('0x2c')],qs['fields'](_0x345e78[_0xd01e('0x2e')][_0xd01e('0x31')]));_0x3788c4['attributes']=_0x3788c4[_0xd01e('0x32')]['length']?_0x3788c4[_0xd01e('0x32')]:_0x1bae12['model'];if(_0x345e78['query'][_0xd01e('0x3c')]){_0x3788c4[_0xd01e('0x40')]=[{'all':!![]}];}_0x3788c4=_[_0xd01e('0x39')]({},_0x3788c4,_0x345e78[_0xd01e('0x3b')]);return db['CmCustomField'][_0xd01e('0x41')](_0x3788c4)[_0xd01e('0x23')](handleEntityNotFound(_0x3e841b,null))[_0xd01e('0x23')](respondWithResult(_0x3e841b,null))['catch'](handleError(_0x3e841b,null));};exports[_0xd01e('0x22')]=function(_0x4895fc,_0x4bd9e1){if(_0x4895fc['body']['id']){delete _0x4895fc[_0xd01e('0x42')]['id'];}return db['CmCustomField'][_0xd01e('0x41')]({'where':{'id':_0x4895fc['params']['id']}})[_0xd01e('0x23')](handleEntityNotFound(_0x4bd9e1,null))['then'](saveUpdates(_0x4895fc[_0xd01e('0x42')],null))[_0xd01e('0x23')](respondWithResult(_0x4bd9e1,null))[_0xd01e('0x43')](handleError(_0x4bd9e1,null));};exports[_0xd01e('0x44')]=function(_0x5ab078,_0x4f6dde){return db[_0xd01e('0x2a')][_0xd01e('0x41')]({'where':{'id':_0x5ab078['params']['id']}})[_0xd01e('0x23')](handleEntityNotFound(_0x4f6dde,null))[_0xd01e('0x23')](removeEntity(_0x4f6dde,null))[_0xd01e('0x43')](handleError(_0x4f6dde,null));};exports['create']=function(_0x487295,_0x1a4a7b){var _0x17baf7;return db[_0xd01e('0x45')][_0xd01e('0x46')](function(_0x4fcc5f){return db[_0xd01e('0x2a')][_0xd01e('0x47')](_0x487295['body'],{'transaction':_0x4fcc5f})[_0xd01e('0x23')](function(_0x3f328c){_0x17baf7=_0x3f328c;var _0x9d12e6={'type':db[_0xd01e('0x48')]['TEXT'],'transaction':_0x4fcc5f};switch(_0x487295[_0xd01e('0x42')][_0xd01e('0x3a')]){case _0xd01e('0x49'):_0x9d12e6[_0xd01e('0x3a')]=db[_0xd01e('0x48')][_0xd01e('0x4a')];break;case'number':_0x9d12e6['type']=db[_0xd01e('0x48')][_0xd01e('0x4b')];break;case _0xd01e('0x4c'):_0x9d12e6[_0xd01e('0x3a')]=db[_0xd01e('0x48')][_0xd01e('0x4d')];_0x9d12e6[_0xd01e('0x4e')]=![];break;default:}return db[_0xd01e('0x45')][_0xd01e('0x4f')][_0xd01e('0x50')](_0xd01e('0x51'),util[_0xd01e('0x52')](_0xd01e('0x53'),_0x17baf7['id']),_0x9d12e6);})[_0xd01e('0x23')](function(){return _0x17baf7;});})['then'](respondWithResult(_0x1a4a7b,0xc9))[_0xd01e('0x43')](handleError(_0x1a4a7b,null));};
\ No newline at end of file
+var _0x5767=['filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','body','create','sequelize','transaction','TEXT','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','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','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5767,0x77));var _0x7576=function(_0x3c1e5c,_0x44e699){_0x3c1e5c=_0x3c1e5c-0x0;var _0x36e137=_0x5767[_0x3c1e5c];return _0x36e137;};'use strict';var emlformat=require(_0x7576('0x0'));var rimraf=require(_0x7576('0x1'));var zipdir=require(_0x7576('0x2'));var jsonpatch=require(_0x7576('0x3'));var rp=require('request-promise');var moment=require(_0x7576('0x4'));var BPromise=require(_0x7576('0x5'));var Mustache=require(_0x7576('0x6'));var util=require('util');var path=require(_0x7576('0x7'));var sox=require(_0x7576('0x8'));var csv=require('to-csv');var ejs=require(_0x7576('0x9'));var fs=require('fs');var fs_extra=require(_0x7576('0xa'));var _=require(_0x7576('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7576('0xc'));var deskjs=require(_0x7576('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7576('0xe'));var Papa=require(_0x7576('0xf'));var Redis=require(_0x7576('0x10'));var authService=require(_0x7576('0x11'));var qs=require(_0x7576('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7576('0x13'));var logger=require(_0x7576('0x14'))(_0x7576('0x15'));var utils=require(_0x7576('0x16'));var config=require(_0x7576('0x17'));var licenseUtil=require(_0x7576('0x18'));var db=require(_0x7576('0x19'))['db'];function respondWithStatusCode(_0x553ef8,_0x538962){_0x538962=_0x538962||0xcc;return function(_0x5d48eb){if(_0x5d48eb){return _0x553ef8[_0x7576('0x1a')](_0x538962);}return _0x553ef8[_0x7576('0x1b')](_0x538962)[_0x7576('0x1c')]();};}function respondWithResult(_0x2e4383,_0x2e7a57){_0x2e7a57=_0x2e7a57||0xc8;return function(_0x1ecf69){if(_0x1ecf69){return _0x2e4383['status'](_0x2e7a57)[_0x7576('0x1d')](_0x1ecf69);}};}function respondWithFilteredResult(_0x264f8d,_0x3cf0a0){return function(_0x3ff41c){if(_0x3ff41c){var _0x377d5e=typeof _0x3cf0a0[_0x7576('0x1e')]==='undefined'&&typeof _0x3cf0a0['limit']===_0x7576('0x1f');var _0xb9d113=_0x3ff41c[_0x7576('0x20')];var _0x287c69=_0x377d5e?0x0:_0x3cf0a0[_0x7576('0x1e')];var _0x12ca27=_0x377d5e?_0x3ff41c['count']:_0x3cf0a0[_0x7576('0x1e')]+_0x3cf0a0[_0x7576('0x21')];var _0x538449;if(_0x12ca27>=_0xb9d113){_0x12ca27=_0xb9d113;_0x538449=0xc8;}else{_0x538449=0xce;}_0x264f8d[_0x7576('0x1b')](_0x538449);return _0x264f8d[_0x7576('0x22')](_0x7576('0x23'),_0x287c69+'-'+_0x12ca27+'/'+_0xb9d113)[_0x7576('0x1d')](_0x3ff41c);}return null;};}function patchUpdates(_0x4d36f5){return function(_0x48ac95){try{jsonpatch[_0x7576('0x24')](_0x48ac95,_0x4d36f5,!![]);}catch(_0x49649d){return BPromise[_0x7576('0x25')](_0x49649d);}return _0x48ac95['save']();};}function saveUpdates(_0xd3ff26,_0x30b335){return function(_0x376c81){if(_0x376c81){return _0x376c81[_0x7576('0x26')](_0xd3ff26)[_0x7576('0x27')](function(_0x17dca2){return _0x17dca2;});}return null;};}function removeEntity(_0xe70425,_0x8ef470){return function(_0x58e811){if(_0x58e811){return _0x58e811[_0x7576('0x28')]()[_0x7576('0x27')](function(){_0xe70425[_0x7576('0x1b')](0xcc)[_0x7576('0x1c')]();});}};}function handleEntityNotFound(_0x1c35d7,_0x47f4db){return function(_0x12e89b){if(!_0x12e89b){_0x1c35d7[_0x7576('0x1a')](0x194);}return _0x12e89b;};}function handleError(_0x29eff7,_0x288984){_0x288984=_0x288984||0x1f4;return function(_0x17c3fe){logger[_0x7576('0x29')](_0x17c3fe[_0x7576('0x2a')]);if(_0x17c3fe[_0x7576('0x2b')]){delete _0x17c3fe['name'];}_0x29eff7[_0x7576('0x1b')](_0x288984)[_0x7576('0x2c')](_0x17c3fe);};}exports[_0x7576('0x2d')]=function(_0x13f8e8,_0x3d54a8){var _0x17406a={},_0x108e4a={},_0x5751c1={'count':0x0,'rows':[]};var _0x31f944=_['map'](db[_0x7576('0x2e')][_0x7576('0x2f')],function(_0x162c5b){return{'name':_0x162c5b[_0x7576('0x30')],'type':_0x162c5b[_0x7576('0x31')]['key']};});_0x108e4a['model']=_[_0x7576('0x32')](_[_0x7576('0x33')](_0x31f944,_0x7576('0x2b')),[_0x7576('0x2b')]);_0x108e4a[_0x7576('0x34')]=_[_0x7576('0x35')](_0x13f8e8[_0x7576('0x34')]);_0x108e4a[_0x7576('0x36')]=_[_0x7576('0x37')](_0x108e4a[_0x7576('0x38')],_0x108e4a['query']);_0x17406a[_0x7576('0x39')]=_[_0x7576('0x37')](_0x108e4a[_0x7576('0x38')],qs['fields'](_0x13f8e8[_0x7576('0x34')][_0x7576('0x3a')]));_0x17406a[_0x7576('0x39')]=_0x17406a[_0x7576('0x39')][_0x7576('0x3b')]?_0x17406a['attributes']:_0x108e4a[_0x7576('0x38')];if(!_0x13f8e8[_0x7576('0x34')][_0x7576('0x3c')](_0x7576('0x3d'))){_0x17406a[_0x7576('0x21')]=qs[_0x7576('0x21')](_0x13f8e8[_0x7576('0x34')]['limit']);_0x17406a[_0x7576('0x1e')]=qs['offset'](_0x13f8e8[_0x7576('0x34')]['offset']);}_0x17406a['order']=qs[_0x7576('0x3e')](_0x13f8e8[_0x7576('0x34')]['sort']);_0x17406a[_0x7576('0x3f')]=qs[_0x7576('0x36')](_[_0x7576('0x40')](_0x13f8e8[_0x7576('0x34')],_0x108e4a[_0x7576('0x36')]),_0x31f944);if(_0x13f8e8[_0x7576('0x34')][_0x7576('0x41')]){_0x17406a[_0x7576('0x3f')]=_[_0x7576('0x42')](_0x17406a['where'],{'$or':_['map'](_0x31f944,function(_0x25f21a){if(_0x25f21a[_0x7576('0x31')]!==_0x7576('0x43')){var _0xb032b9={};_0xb032b9[_0x25f21a[_0x7576('0x2b')]]={'$like':'%'+_0x13f8e8[_0x7576('0x34')][_0x7576('0x41')]+'%'};return _0xb032b9;}})});}_0x17406a=_[_0x7576('0x42')]({},_0x17406a,_0x13f8e8['options']);var _0x220711={'where':_0x17406a[_0x7576('0x3f')]};return db[_0x7576('0x2e')][_0x7576('0x20')](_0x220711)[_0x7576('0x27')](function(_0xea6d8c){_0x5751c1[_0x7576('0x20')]=_0xea6d8c;if(_0x13f8e8[_0x7576('0x34')][_0x7576('0x44')]){_0x17406a[_0x7576('0x45')]=[{'all':!![]}];}return db[_0x7576('0x2e')][_0x7576('0x46')](_0x17406a);})[_0x7576('0x27')](function(_0x121531){_0x5751c1['rows']=_0x121531;return _0x5751c1;})[_0x7576('0x27')](respondWithFilteredResult(_0x3d54a8,_0x17406a))['catch'](handleError(_0x3d54a8,null));};exports[_0x7576('0x47')]=function(_0x4a87f5,_0x3cebdc){var _0xeebb93={'raw':!![],'where':{'id':_0x4a87f5[_0x7576('0x48')]['id']}},_0x89e2ff={};_0x89e2ff['model']=_[_0x7576('0x35')](db['CmCustomField'][_0x7576('0x2f')]);_0x89e2ff['query']=_[_0x7576('0x35')](_0x4a87f5['query']);_0x89e2ff[_0x7576('0x36')]=_[_0x7576('0x37')](_0x89e2ff[_0x7576('0x38')],_0x89e2ff[_0x7576('0x34')]);_0xeebb93['attributes']=_['intersection'](_0x89e2ff[_0x7576('0x38')],qs['fields'](_0x4a87f5[_0x7576('0x34')][_0x7576('0x3a')]));_0xeebb93['attributes']=_0xeebb93[_0x7576('0x39')][_0x7576('0x3b')]?_0xeebb93['attributes']:_0x89e2ff['model'];if(_0x4a87f5['query'][_0x7576('0x44')]){_0xeebb93['include']=[{'all':!![]}];}_0xeebb93=_[_0x7576('0x42')]({},_0xeebb93,_0x4a87f5[_0x7576('0x49')]);return db[_0x7576('0x2e')][_0x7576('0x4a')](_0xeebb93)[_0x7576('0x27')](handleEntityNotFound(_0x3cebdc,null))[_0x7576('0x27')](respondWithResult(_0x3cebdc,null))[_0x7576('0x4b')](handleError(_0x3cebdc,null));};exports[_0x7576('0x26')]=function(_0x3f5b79,_0x304b3e){if(_0x3f5b79['body']['id']){delete _0x3f5b79[_0x7576('0x4c')]['id'];}return db[_0x7576('0x2e')]['find']({'where':{'id':_0x3f5b79[_0x7576('0x48')]['id']}})['then'](handleEntityNotFound(_0x304b3e,null))[_0x7576('0x27')](saveUpdates(_0x3f5b79[_0x7576('0x4c')],null))[_0x7576('0x27')](respondWithResult(_0x304b3e,null))['catch'](handleError(_0x304b3e,null));};exports[_0x7576('0x28')]=function(_0x4cbc3f,_0x1fcd1b){return db['CmCustomField'][_0x7576('0x4a')]({'where':{'id':_0x4cbc3f[_0x7576('0x48')]['id']}})[_0x7576('0x27')](handleEntityNotFound(_0x1fcd1b,null))['then'](removeEntity(_0x1fcd1b,null))['catch'](handleError(_0x1fcd1b,null));};exports[_0x7576('0x4d')]=function(_0x45f4a6,_0x195219){var _0x2d03ad;return db[_0x7576('0x4e')][_0x7576('0x4f')](function(_0x53604e){return db[_0x7576('0x2e')][_0x7576('0x4d')](_0x45f4a6[_0x7576('0x4c')],{'transaction':_0x53604e})[_0x7576('0x27')](function(_0x5b3891){_0x2d03ad=_0x5b3891;var _0x232a7c={'type':db['Sequelize'][_0x7576('0x50')],'transaction':_0x53604e};switch(_0x45f4a6['body'][_0x7576('0x31')]){case'text':_0x232a7c[_0x7576('0x31')]=db[_0x7576('0x51')]['TEXT'];break;case _0x7576('0x52'):_0x232a7c[_0x7576('0x31')]=db[_0x7576('0x51')][_0x7576('0x53')];break;case _0x7576('0x54'):_0x232a7c[_0x7576('0x31')]=db[_0x7576('0x51')][_0x7576('0x55')];_0x232a7c[_0x7576('0x56')]=![];break;default:}return db[_0x7576('0x4e')][_0x7576('0x57')][_0x7576('0x58')](_0x7576('0x59'),util[_0x7576('0x5a')](_0x7576('0x5b'),_0x2d03ad['id']),_0x232a7c);})[_0x7576('0x27')](function(){return _0x2d03ad;});})[_0x7576('0x27')](respondWithResult(_0x195219,0xc9))['catch'](handleError(_0x195219,null));};
\ No newline at end of file
index 443b008..1b1acdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b97=['rimraf','../../config/environment','exports','define','CmCustomField','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x8b577c,_0x2dab67){var _0x459d1d=function(_0x42a117){while(--_0x42a117){_0x8b577c['push'](_0x8b577c['shift']());}};_0x459d1d(++_0x2dab67);}(_0x7b97,0x1a7));var _0x77b9=function(_0x3d0016,_0x4a37e0){_0x3d0016=_0x3d0016-0x0;var _0x1dcb28=_0x7b97[_0x3d0016];return _0x1dcb28;};'use strict';var _=require(_0x77b9('0x0'));var util=require(_0x77b9('0x1'));var logger=require(_0x77b9('0x2'))(_0x77b9('0x3'));var moment=require(_0x77b9('0x4'));var BPromise=require('bluebird');var rp=require(_0x77b9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77b9('0x6'));var config=require(_0x77b9('0x7'));var attributes=require('./cmCustomField.attributes');module[_0x77b9('0x8')]=function(_0x275ad7,_0x28dea8){return _0x275ad7[_0x77b9('0x9')](_0x77b9('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26d4=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x26d4,0x70));var _0x426d=function(_0x54423b,_0x43381c){_0x54423b=_0x54423b-0x0;var _0x2184d9=_0x26d4[_0x54423b];return _0x2184d9;};'use strict';var _=require(_0x426d('0x0'));var util=require(_0x426d('0x1'));var logger=require(_0x426d('0x2'))(_0x426d('0x3'));var moment=require(_0x426d('0x4'));var BPromise=require(_0x426d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x426d('0x6'));var rimraf=require(_0x426d('0x7'));var config=require('../../config/environment');var attributes=require(_0x426d('0x8'));module[_0x426d('0x9')]=function(_0x233fd9,_0x4f1ec5){return _0x233fd9[_0x426d('0xa')]('CmCustomField',attributes,{'tableName':_0x426d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fc54a7c..05172ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9bd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x543d44,_0x3500aa){var _0x3340f6=function(_0x2106e9){while(--_0x2106e9){_0x543d44['push'](_0x543d44['shift']());}};_0x3340f6(++_0x3500aa);}(_0xc9bd,0x182));var _0xdc9b=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xc9bd[_0x5d61b4];return _0x183fc5;};'use strict';var _=require('lodash');var util=require(_0xdc9b('0x0'));var moment=require(_0xdc9b('0x1'));var BPromise=require(_0xdc9b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc9b('0x3'));var db=require(_0xdc9b('0x4'))['db'];var utils=require(_0xdc9b('0x5'));var logger=require(_0xdc9b('0x6'))(_0xdc9b('0x7'));var config=require(_0xdc9b('0x8'));var jayson=require(_0xdc9b('0x9'));var client=jayson['client'][_0xdc9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f5147,_0x1a6086,_0x657b8c){return new BPromise(function(_0x371307,_0x54549d){return client['request'](_0x4f5147,_0x657b8c)[_0xdc9b('0xb')](function(_0x31c01e){logger[_0xdc9b('0xc')](_0xdc9b('0xd'),_0x1a6086,_0xdc9b('0xe'));logger[_0xdc9b('0xf')](_0xdc9b('0x10'),_0x1a6086,_0xdc9b('0xe'),JSON[_0xdc9b('0x11')](_0x31c01e));if(_0x31c01e['error']){if(_0x31c01e[_0xdc9b('0x12')][_0xdc9b('0x13')]===0x1f4){logger[_0xdc9b('0x12')](_0xdc9b('0xd'),_0x1a6086,_0x31c01e[_0xdc9b('0x12')][_0xdc9b('0x14')]);return _0x54549d(_0x31c01e[_0xdc9b('0x12')]['message']);}logger[_0xdc9b('0x12')]('CmCustomField,\x20%s,\x20%s',_0x1a6086,_0x31c01e[_0xdc9b('0x12')]['message']);return _0x371307(_0x31c01e[_0xdc9b('0x12')]['message']);}else{logger[_0xdc9b('0xc')](_0xdc9b('0xd'),_0x1a6086,_0xdc9b('0xe'));_0x371307(_0x31c01e[_0xdc9b('0x15')][_0xdc9b('0x14')]);}})[_0xdc9b('0x16')](function(_0x3f1ded){logger['error'](_0xdc9b('0xd'),_0x1a6086,_0x3f1ded);_0x54549d(_0x3f1ded);});});}
\ No newline at end of file
+var _0xedf0=['CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x156fc6,_0x402bc4){var _0x109ac5=function(_0x44dc06){while(--_0x44dc06){_0x156fc6['push'](_0x156fc6['shift']());}};_0x109ac5(++_0x402bc4);}(_0xedf0,0x97));var _0x0edf=function(_0x2276f4,_0x4b0ee5){_0x2276f4=_0x2276f4-0x0;var _0x17186c=_0xedf0[_0x2276f4];return _0x17186c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0edf('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0edf('0x1'))['db'];var utils=require(_0x0edf('0x2'));var logger=require(_0x0edf('0x3'))('rpc');var config=require(_0x0edf('0x4'));var jayson=require(_0x0edf('0x5'));var client=jayson[_0x0edf('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc157cb,_0xa2e38d,_0x2c6182){return new BPromise(function(_0x405f9b,_0x49d705){return client[_0x0edf('0x7')](_0xc157cb,_0x2c6182)[_0x0edf('0x8')](function(_0x26a360){logger['info'](_0x0edf('0x9'),_0xa2e38d,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0xa2e38d,_0x0edf('0xa'),JSON[_0x0edf('0xb')](_0x26a360));if(_0x26a360[_0x0edf('0xc')]){if(_0x26a360[_0x0edf('0xc')][_0x0edf('0xd')]===0x1f4){logger[_0x0edf('0xc')]('CmCustomField,\x20%s,\x20%s',_0xa2e38d,_0x26a360[_0x0edf('0xc')][_0x0edf('0xe')]);return _0x49d705(_0x26a360[_0x0edf('0xc')][_0x0edf('0xe')]);}logger[_0x0edf('0xc')](_0x0edf('0x9'),_0xa2e38d,_0x26a360[_0x0edf('0xc')][_0x0edf('0xe')]);return _0x405f9b(_0x26a360['error'][_0x0edf('0xe')]);}else{logger['info'](_0x0edf('0x9'),_0xa2e38d,_0x0edf('0xa'));_0x405f9b(_0x26a360[_0x0edf('0xf')][_0x0edf('0xe')]);}})['catch'](function(_0x4bd7dc){logger[_0x0edf('0xc')]('CmCustomField,\x20%s,\x20%s',_0xa2e38d,_0x4bd7dc);_0x49d705(_0x4bd7dc);});});}
\ No newline at end of file
index f41c14a..87f414e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29e0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','show','isAuthenticated','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x56eb3b,_0x4697c6){var _0x2da82f=function(_0x56767d){while(--_0x56767d){_0x56eb3b['push'](_0x56eb3b['shift']());}};_0x2da82f(++_0x4697c6);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x029e('0x0'));var util=require(_0x029e('0x1'));var path=require(_0x029e('0x2'));var timeout=require(_0x029e('0x3'));var express=require(_0x029e('0x4'));var router=express[_0x029e('0x5')]();var fs_extra=require(_0x029e('0x6'));var auth=require(_0x029e('0x7'));var interaction=require(_0x029e('0x8'));var config=require(_0x029e('0x9'));var controller=require(_0x029e('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x029e('0xb')]);router[_0x029e('0xc')](_0x029e('0xd'),auth['isAuthenticated'](),controller[_0x029e('0xe')]);router['post']('/',auth[_0x029e('0xf')](),controller[_0x029e('0x10')]);router[_0x029e('0x11')](_0x029e('0xd'),auth[_0x029e('0xf')](),controller[_0x029e('0x12')]);router['delete'](_0x029e('0xd'),auth[_0x029e('0xf')](),controller[_0x029e('0x13')]);module[_0x029e('0x14')]=router;
\ No newline at end of file
+var _0xb6f1=['multer','path','express','Router','fs-extra','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f1,0x118));var _0x1b6f=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xb6f1[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x1b6f('0x0'));var util=require('util');var path=require(_0x1b6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6f('0x2'));var router=express[_0x1b6f('0x3')]();var fs_extra=require(_0x1b6f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1b6f('0x5'));var config=require('../../config/environment');var controller=require(_0x1b6f('0x6'));router[_0x1b6f('0x7')]('/',auth[_0x1b6f('0x8')](),controller['index']);router['get'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xa')]);router['post']('/',auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xb')]);router['put'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xc')]);router[_0x1b6f('0xd')](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f6b1819..1d9ad0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a1=['UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x8a5add,_0x3920fc){var _0x3e3d5f=function(_0xfb818e){while(--_0xfb818e){_0x8a5add['push'](_0x8a5add['shift']());}};_0x3e3d5f(++_0x3920fc);}(_0x84a1,0x157));var _0x184a=function(_0x193bfa,_0x1ae525){_0x193bfa=_0x193bfa-0x0;var _0x15a289=_0x84a1[_0x193bfa];return _0x15a289;};'use strict';var moment=require(_0x184a('0x0'));var Sequelize=require(_0x184a('0x1'));module[_0x184a('0x2')]={'phone':{'type':Sequelize[_0x184a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x184a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x184a('0x5')],'defaultValue':moment()[_0x184a('0x6')](_0x184a('0x7'))},'countbusyretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x184a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x184a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x184a('0x5')]},'priority':{'type':Sequelize[_0x184a('0x8')](0x2)[_0x184a('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x184a('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x184a('0x8')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x184a('0x8')],'unique':_0x184a('0xa')},'UserId':{'type':Sequelize[_0x184a('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x184a('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x184a('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x184a('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x184a('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x184a('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0xa43c=['contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x198933,_0x44cf62){var _0x48cc3a=function(_0x40e85a){while(--_0x40e85a){_0x198933['push'](_0x198933['shift']());}};_0x48cc3a(++_0x44cf62);}(_0xa43c,0x14b));var _0xca43=function(_0x1b87fb,_0x3e6870){_0x1b87fb=_0x1b87fb-0x0;var _0xc7de31=_0xa43c[_0x1b87fb];return _0xc7de31;};'use strict';var moment=require(_0xca43('0x0'));var Sequelize=require('sequelize');module[_0xca43('0x1')]={'phone':{'type':Sequelize[_0xca43('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xca43('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xca43('0x4')],'defaultValue':moment()[_0xca43('0x5')](_0xca43('0x6'))},'countbusyretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xca43('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xca43('0x4')]},'priority':{'type':Sequelize[_0xca43('0x7')](0x2)[_0xca43('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xca43('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xca43('0x7')],'unique':_0xca43('0x9')},'ListId':{'type':Sequelize[_0xca43('0x7')],'unique':_0xca43('0x9')},'UserId':{'type':Sequelize[_0xca43('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xca43('0x7')],'unique':_0xca43('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xca43('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xca43('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xca43('0x4')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 9b99f29..2efd6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','Queue','dialActive','transaction','recallme','Company','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','moment','lodash','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','filters','intersection','concat','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','then','includeAll','findAll','rows','catch','show','params','keys','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','campaign','membername','user','deleted','deletedat','format','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','YYYY-MM-DD\x20HH:mm:ss','value'];(function(_0x484942,_0x42a71d){var _0x51e301=function(_0x4426d1){while(--_0x4426d1){_0x484942['push'](_0x484942['shift']());}};_0x51e301(++_0x42a71d);}(_0x55ca,0x126));var _0xa55c=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x55ca[_0x4706a6];return _0x1bb705;};'use strict';var moment=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];function respondWithResult(_0x5dc716,_0x3b478a){_0x3b478a=_0x3b478a||0xc8;return function(_0x2db02a){if(_0x2db02a){return _0x5dc716[_0xa55c('0x4')](_0x3b478a)[_0xa55c('0x5')](_0x2db02a);}};}function respondWithFilteredResult(_0x3c97c8,_0x279caa){return function(_0x36b623){if(_0x36b623){var _0x4d0624=typeof _0x279caa[_0xa55c('0x6')]===_0xa55c('0x7')&&typeof _0x279caa['limit']===_0xa55c('0x7');var _0x290d28=_0x36b623['count'];var _0x5849ad=_0x4d0624?0x0:_0x279caa[_0xa55c('0x6')];var _0x20c76a=_0x4d0624?_0x36b623[_0xa55c('0x8')]:_0x279caa[_0xa55c('0x6')]+_0x279caa[_0xa55c('0x9')];var _0xe6d826;if(_0x20c76a>=_0x290d28){_0x20c76a=_0x290d28;_0xe6d826=0xc8;}else{_0xe6d826=0xce;}_0x3c97c8[_0xa55c('0x4')](_0xe6d826);return _0x3c97c8[_0xa55c('0xa')](_0xa55c('0xb'),_0x5849ad+'-'+_0x20c76a+'/'+_0x290d28)[_0xa55c('0x5')](_0x36b623);}return null;};}function saveUpdates(_0x5d47ff,_0x59d84a){return function(_0x2a35be){if(_0x2a35be){return _0x2a35be['update'](_0x5d47ff)['then'](function(_0x59ea8d){return _0x59ea8d;});}return null;};}function handleEntityNotFound(_0x18ee85,_0x3930e4){return function(_0x462cd6){if(!_0x462cd6){_0x18ee85[_0xa55c('0xc')](0x194);}return _0x462cd6;};}function handleError(_0x458480,_0x247e77){_0x247e77=_0x247e77||0x1f4;return function(_0x4e0b2f){logger[_0xa55c('0xd')](_0x4e0b2f[_0xa55c('0xe')]);if(_0x4e0b2f[_0xa55c('0xf')]){delete _0x4e0b2f[_0xa55c('0xf')];}_0x458480[_0xa55c('0x4')](_0x247e77)[_0xa55c('0x10')](_0x4e0b2f);};}exports[_0xa55c('0x11')]=function(_0x2d09d8,_0x24783b){var _0x4cee3c={},_0x3d4c9e={},_0x104a99={'count':0x0,'rows':[]};var _0x461284=_[_0xa55c('0x12')](db[_0xa55c('0x13')][_0xa55c('0x14')],function(_0x4c0daf){return{'name':_0x4c0daf['fieldName'],'type':_0x4c0daf[_0xa55c('0x15')][_0xa55c('0x16')]};});_0x3d4c9e[_0xa55c('0x17')]=_['map'](_0x461284,_0xa55c('0xf'));_0x3d4c9e[_0xa55c('0x18')]=_['keys'](_0x2d09d8[_0xa55c('0x18')]);_0x3d4c9e[_0xa55c('0x19')]=_[_0xa55c('0x1a')](_0x3d4c9e[_0xa55c('0x17')],_0x3d4c9e[_0xa55c('0x18')]);_0x3d4c9e['filters']=_[_0xa55c('0x1b')](_0x3d4c9e['filters'],['$and','$or',_0xa55c('0x1c'),'$gte',_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),'$iLike',_0xa55c('0x28'),_0xa55c('0x26'),_0xa55c('0x29'),_0xa55c('0x2a'),'$contained',_0xa55c('0x2b')]);_0x4cee3c[_0xa55c('0x2c')]=_[_0xa55c('0x1a')](_0x3d4c9e[_0xa55c('0x17')],qs[_0xa55c('0x2d')](_0x2d09d8[_0xa55c('0x18')]['fields']));_0x4cee3c[_0xa55c('0x2c')]=_0x4cee3c['attributes'][_0xa55c('0x2e')]?_0x4cee3c[_0xa55c('0x2c')]:_0x3d4c9e[_0xa55c('0x17')];if(!_0x2d09d8[_0xa55c('0x18')]['hasOwnProperty'](_0xa55c('0x2f'))){_0x4cee3c[_0xa55c('0x9')]=qs[_0xa55c('0x9')](_0x2d09d8[_0xa55c('0x18')][_0xa55c('0x9')]);_0x4cee3c[_0xa55c('0x6')]=qs[_0xa55c('0x6')](_0x2d09d8[_0xa55c('0x18')][_0xa55c('0x6')]);}_0x4cee3c[_0xa55c('0x30')]=qs[_0xa55c('0x31')](_0x2d09d8['query']['sort']);_0x4cee3c[_0xa55c('0x32')]=qs[_0xa55c('0x19')](_['pick'](_0x2d09d8[_0xa55c('0x18')],_0x3d4c9e[_0xa55c('0x19')]),_0x461284);if(_0x2d09d8[_0xa55c('0x18')][_0xa55c('0x33')]){_0x4cee3c[_0xa55c('0x32')]=_[_0xa55c('0x34')](_0x4cee3c[_0xa55c('0x32')],{'$or':_[_0xa55c('0x12')](_0x461284,function(_0x3959e3){if(_0x3959e3['type']!=='VIRTUAL'){var _0x4b23d3={};_0x4b23d3[_0x3959e3[_0xa55c('0xf')]]={'$like':'%'+_0x2d09d8[_0xa55c('0x18')][_0xa55c('0x33')]+'%'};return _0x4b23d3;}})});}_0x4cee3c=_['merge']({},_0x4cee3c,_0x2d09d8[_0xa55c('0x35')]);var _0x547930={'where':_0x4cee3c[_0xa55c('0x32')]};return db['CmHopper'][_0xa55c('0x8')](_0x547930)[_0xa55c('0x36')](function(_0x3c0ec1){_0x104a99['count']=_0x3c0ec1;if(_0x2d09d8[_0xa55c('0x18')][_0xa55c('0x37')]){_0x4cee3c['include']=[{'all':!![]}];}return db[_0xa55c('0x13')][_0xa55c('0x38')](_0x4cee3c);})['then'](function(_0x529ff8){_0x104a99[_0xa55c('0x39')]=_0x529ff8;return _0x104a99;})['then'](respondWithFilteredResult(_0x24783b,_0x4cee3c))[_0xa55c('0x3a')](handleError(_0x24783b,null));};exports[_0xa55c('0x3b')]=function(_0x5427bf,_0x542d76){var _0x5e50b6={'raw':!![],'where':{'id':_0x5427bf[_0xa55c('0x3c')]['id']}},_0x4de781={};_0x4de781[_0xa55c('0x17')]=_[_0xa55c('0x3d')](db[_0xa55c('0x13')][_0xa55c('0x14')]);_0x4de781['query']=_[_0xa55c('0x3d')](_0x5427bf[_0xa55c('0x18')]);_0x4de781[_0xa55c('0x19')]=_[_0xa55c('0x1a')](_0x4de781[_0xa55c('0x17')],_0x4de781[_0xa55c('0x18')]);_0x5e50b6['attributes']=_[_0xa55c('0x1a')](_0x4de781['model'],qs['fields'](_0x5427bf[_0xa55c('0x18')][_0xa55c('0x2d')]));_0x5e50b6['attributes']=_0x5e50b6[_0xa55c('0x2c')]['length']?_0x5e50b6['attributes']:_0x4de781[_0xa55c('0x17')];if(_0x5427bf[_0xa55c('0x18')][_0xa55c('0x37')]){_0x5e50b6['include']=[{'all':!![]}];}_0x5e50b6=_[_0xa55c('0x34')]({},_0x5e50b6,_0x5427bf[_0xa55c('0x35')]);return db['CmHopper'][_0xa55c('0x3e')](_0x5e50b6)['then'](handleEntityNotFound(_0x542d76,null))[_0xa55c('0x36')](respondWithResult(_0x542d76,null))[_0xa55c('0x3a')](handleError(_0x542d76,null));};exports['create']=function(_0x66d1de,_0x1dae70){return db['CmHopper'][_0xa55c('0x3f')](_0x66d1de[_0xa55c('0x40')],{})[_0xa55c('0x36')](respondWithResult(_0x1dae70,0xc9))['catch'](handleError(_0x1dae70,null));};exports[_0xa55c('0x41')]=function(_0x582901,_0x2f9717){if(_0x582901[_0xa55c('0x40')]['id']){delete _0x582901[_0xa55c('0x40')]['id'];}return db['CmHopper'][_0xa55c('0x3e')]({'where':{'id':_0x582901[_0xa55c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x36')](saveUpdates(_0x582901[_0xa55c('0x40')],null))['then'](respondWithResult(_0x2f9717,null))[_0xa55c('0x3a')](handleError(_0x2f9717,null));};exports[_0xa55c('0x42')]=function(_0x52f9a7,_0x46f839){return db[_0xa55c('0x13')][_0xa55c('0x42')]()[_0xa55c('0x36')](respondWithResult(_0x46f839,null))['catch'](handleError(_0x46f839,null));};exports[_0xa55c('0x43')]=function(_0x58a7ea,_0x2157d6){var _0x213100;var _0x194a79=_0x58a7ea['params']['id'];return db[_0xa55c('0x13')][_0xa55c('0x3e')]({'where':{'id':_0x58a7ea['params']['id']}})[_0xa55c('0x36')](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x36')](function(_0x3822b7){if(_0x3822b7){return _0x3822b7[_0xa55c('0x43')]()[_0xa55c('0x36')](function(_0x1c84d9){return _0x1c84d9;});}})[_0xa55c('0x36')](function(_0x129626){_0x213100=_0x129626;if(_0x129626){if(_0x129626[_0xa55c('0x44')]||_0x129626[_0xa55c('0x45')]){return db[_0x129626['VoiceQueueId']?_0xa55c('0x46'):_0xa55c('0x47')][_0xa55c('0x3e')]({'where':{'id':_0x129626['VoiceQueueId']?_0x129626[_0xa55c('0x44')]:_0x129626[_0xa55c('0x45')]},'attributes':['id','name'],'raw':!![]});}}})[_0xa55c('0x36')](function(_0x4fa412){var _0x2b6a0e={};if(_0x4fa412){_[_0xa55c('0x34')](_0x2b6a0e,_[_0xa55c('0x48')](_0x213100[_0xa55c('0x49')],[_0xa55c('0x4a'),'updatedAt','id']));_0x2b6a0e[_0xa55c('0x4b')]=0x15;_0x2b6a0e[_0xa55c('0x4c')]='deleted';_0x2b6a0e[_0xa55c('0x4d')]=_0x4fa412[_0xa55c('0xf')];_0x2b6a0e[_0xa55c('0x4e')]=_0x58a7ea[_0xa55c('0x4f')]['name'];_0x2b6a0e['UserId']=_0x58a7ea[_0xa55c('0x4f')]['id'];_0x2b6a0e[_0xa55c('0x50')]=!![];_0x2b6a0e[_0xa55c('0x51')]=moment()[_0xa55c('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b6a0e[_0xa55c('0x53')]=_0x213100['phone'];_0x2b6a0e[_0xa55c('0x54')]=_0x213100[_0xa55c('0x44')]?_0xa55c('0x55'):_0xa55c('0x56');return db[_0xa55c('0x57')]['find']({'where':{'id':_0x2b6a0e[_0xa55c('0x58')]},'attributes':['firstName',_0xa55c('0x59')]})[_0xa55c('0x36')](function(_0x2cfe08){if(!_[_0xa55c('0x5a')](_0x2157d6)&&!_[_0xa55c('0x5a')](_0x2cfe08[_0xa55c('0x5b')])){_0x2b6a0e[_0xa55c('0x5c')]=_0x2cfe08['firstName'];if(!_[_0xa55c('0x5a')](_0x2cfe08[_0xa55c('0x59')])){_0x2b6a0e[_0xa55c('0x5c')]+='\x20'+_0x2cfe08[_0xa55c('0x59')];}}})[_0xa55c('0x5d')](function(){return db['CmHopperFinal'][_0xa55c('0x3f')](_0x2b6a0e);});}})[_0xa55c('0x36')](function(_0x28bac4){return db[_0xa55c('0x5e')][_0xa55c('0x43')]({'where':{'CmHopperId':_0x194a79}});})['then'](function(){return _0x2157d6[_0xa55c('0x4')](0xcc)[_0xa55c('0x5f')]();})[_0xa55c('0x3a')](handleError(_0x2157d6,null));};exports[_0xa55c('0x60')]=function(_0x3ba56d,_0x480dfc){var _0x419fc3=[];return db['CmContact'][_0xa55c('0x42')]()['then'](function(_0x3495a7){_0x419fc3=_['keys'](_0x3495a7);return _0x3ba56d[_0xa55c('0x4f')][_0xa55c('0x61')]({'where':{'type':_0xa55c('0x62'),'dialActive':!![],'dialMethod':_0xa55c('0x63')},'attributes':['id',_0xa55c('0x64'),_0xa55c('0x65')],'raw':!![]});})[_0xa55c('0x36')](function(_0x2f2226){if(_0x2f2226&&_0x2f2226[_0xa55c('0x2e')]){return db[_0xa55c('0x66')]['transaction'](function(_0x150a07){var _0x311bb9={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa55c('0x67'))},'VoiceQueueId':{'$in':_[_0xa55c('0x12')](_0x2f2226,'id')},'$or':[{'UserId':null},{'UserId':_0x3ba56d[_0xa55c('0x4f')]['id']}]};var _0x9fe234={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2f2226)[_0xa55c('0x33')]([_0xa55c('0x65'),0x0])[_0xa55c('0x12')]('id')[_0xa55c('0x68')]()},'$or':[{'UserId':null},{'UserId':_0x3ba56d['user']['id']}]};var _0x1dfaf7={'$or':[_0x311bb9,_0x9fe234]};var _0x475131=[];if(_0x3ba56d[_0xa55c('0x40')][_0xa55c('0x69')]&&_0x3ba56d[_0xa55c('0x40')][_0xa55c('0x69')]===_0xa55c('0x6a')){if(!_[_0xa55c('0x6b')](_0x3ba56d[_0xa55c('0x40')]['hopperIds'])){_0x1dfaf7['id']={'$in':_0x3ba56d[_0xa55c('0x40')][_0xa55c('0x6c')]};}_0x475131=[[_0xa55c('0x6d'),_0xa55c('0x6e')],[_0xa55c('0x6f'),_0x2f2226[0x0][_0xa55c('0x64')]===_0xa55c('0x6e')?_0xa55c('0x70'):_0xa55c('0x6e')],db[_0xa55c('0x66')][_0xa55c('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa55c('0x70')]];}else{if(!_['isEmpty'](_0x3ba56d[_0xa55c('0x40')][_0xa55c('0x6c')])){_0x1dfaf7['id']={'$notIn':_0x3ba56d[_0xa55c('0x40')]['hopperIds']};}_0x475131=[['priority',_0xa55c('0x70')],[_0xa55c('0x6f'),_0x2f2226[0x0][_0xa55c('0x64')]],db[_0xa55c('0x66')]['literal'](_0xa55c('0x72')),['id',_0xa55c('0x6e')]];}return db[_0xa55c('0x13')][_0xa55c('0x73')]({'attributes':['id',_0xa55c('0x74'),'phone','recallme'],'where':_0x1dfaf7,'order':_0x475131,'transaction':_0x150a07,'lock':_0x150a07[_0xa55c('0x75')][_0xa55c('0x76')],'include':[{'model':db[_0xa55c('0x57')],'as':_0xa55c('0x77'),'attributes':_0x419fc3,'include':[{'model':db[_0xa55c('0x78')],'as':'Company','attributes':['id',_0xa55c('0xf')]}]},{'model':db[_0xa55c('0x79')],'as':'List','attributes':['id',_0xa55c('0xf')]},{'model':db[_0xa55c('0x46')],'as':_0xa55c('0x7a'),'attributes':['id','name',_0xa55c('0x7b')]}]})[_0xa55c('0x36')](function(_0xdf94b3){if(_0xdf94b3){return _0xdf94b3[_0xa55c('0x41')]({'UserId':_0x3ba56d[_0xa55c('0x4f')]['id']},{'transaction':_0x150a07});}});});}})['then'](handleEntityNotFound(_0x480dfc,null))[_0xa55c('0x36')](respondWithResult(_0x480dfc,null))[_0xa55c('0x3a')](handleError(_0x480dfc,null));};exports['getPreviewRecall']=function(_0x550dc1,_0x194ddc,_0x4e1cbd){var _0x752a0f=[];var _0x5ca0bc=_0x550dc1[_0xa55c('0x3c')]['id'];var _0x1301fd=_0x550dc1[_0xa55c('0x4f')]['id'];return db[_0xa55c('0x57')][_0xa55c('0x42')]()[_0xa55c('0x36')](function(_0x16dfc6){_0x752a0f=_['keys'](_0x16dfc6);return db[_0xa55c('0x66')][_0xa55c('0x7c')](function(_0x21de68){const _0x20ddd0={'id':_0x5ca0bc};return db['CmHopper'][_0xa55c('0x73')]({'attributes':['id',_0xa55c('0x74'),_0xa55c('0x7d')],'where':_0x20ddd0,'transaction':_0x21de68,'lock':_0x21de68[_0xa55c('0x75')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xa55c('0x77'),'attributes':_0x752a0f,'include':[{'model':db[_0xa55c('0x78')],'as':_0xa55c('0x7e'),'attributes':['id',_0xa55c('0xf')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa55c('0xf')]},{'model':db[_0xa55c('0x46')],'as':_0xa55c('0x7a'),'attributes':['id',_0xa55c('0xf'),_0xa55c('0x7b')]}]})[_0xa55c('0x36')](function(_0x239269){if(_0x239269){return _0x239269['update']({'UserId':_0x1301fd},{'transaction':_0x21de68});}});});})[_0xa55c('0x36')](handleEntityNotFound(_0x194ddc,null))['then'](respondWithResult(_0x194ddc,null))[_0xa55c('0x3a')](handleError(_0x194ddc,null));};exports['getOpenContacts']=function(_0x36ded7,_0x313cdc){return _0x36ded7[_0xa55c('0x4f')][_0xa55c('0x61')]({'where':{'type':_0xa55c('0x62'),'dialActive':!![],'dialMethod':_0xa55c('0x63')},'attributes':['id'],'raw':!![]})[_0xa55c('0x36')](function(_0x2c71ca){if(_0x2c71ca&&_0x2c71ca['length']){return db['CmHopper'][_0xa55c('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa55c('0x52')](_0xa55c('0x67'))},'VoiceQueueId':{'$in':_[_0xa55c('0x12')](_0x2c71ca,'id')},'$or':[{'UserId':null},{'UserId':_0x36ded7[_0xa55c('0x4f')]['id']}]}});}return 0x0;})[_0xa55c('0x36')](function(_0x47e8e2){if(!_[_0xa55c('0x5a')](_0x47e8e2)&&_[_0xa55c('0x7f')](_0x47e8e2)){return _0x313cdc[_0xa55c('0x4')](0xc8)[_0xa55c('0x5')]({'contacts':_0x47e8e2});}else{logger[_0xa55c('0xd')](_0xa55c('0x80'),_0xa55c('0x81'),0x194,_0xa55c('0x82'));_0x313cdc['sendStatus'](0x194);}})[_0xa55c('0x3a')](handleError(_0x313cdc,null));};exports[_0xa55c('0x83')]=function(_0x42d773,_0x25e246){var _0xa957ad=shared['timezones'];var _0x2685d8=[];_[_0xa55c('0x12')](_0xa957ad,function(_0x58296a){_0x2685d8['push']({'id':_0x58296a[_0xa55c('0xf')],'name':_0x58296a[_0xa55c('0xf')],'utcOffset':_0x58296a['utcOffset']});});return _0x25e246['status'](0xc8)['json']({'tz':_0x2685d8});};exports['getTimezone']=function(_0xf8e295,_0xf77ff8){var _0x1f0363=shared[_0xa55c('0x84')];var _0x3e7aa2={};if(!_[_0xa55c('0x5a')](_0x1f0363[_0xf8e295['body']['id']]))_0x3e7aa2=_0x1f0363[_0xf8e295[_0xa55c('0x40')]['id']];return _0xf77ff8[_0xa55c('0x4')](0xc8)[_0xa55c('0x5')](_0x3e7aa2);};
\ No newline at end of file
+var _0x2bd8=['CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','Queue','dialActive','getPreviewRecall','CmContact','describe','UPDATE','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','timezones','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','set','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','find','create','CmHopper','body','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ContactId','firstName','lastName','isNil','calleridname','finally'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2bd8,0x130));var _0x82bd=function(_0x220dae,_0x5d30a4){_0x220dae=_0x220dae-0x0;var _0x1a5776=_0x2bd8[_0x220dae];return _0x1a5776;};'use strict';var moment=require(_0x82bd('0x0'));var _=require('lodash');var qs=require(_0x82bd('0x1'));var logger=require(_0x82bd('0x2'))(_0x82bd('0x3'));var shared=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];function respondWithResult(_0x197dbc,_0x183f76){_0x183f76=_0x183f76||0xc8;return function(_0x572a80){if(_0x572a80){return _0x197dbc[_0x82bd('0x6')](_0x183f76)[_0x82bd('0x7')](_0x572a80);}};}function respondWithFilteredResult(_0x3bf810,_0x5ceb60){return function(_0x19dbb1){if(_0x19dbb1){var _0x77d7a9=typeof _0x5ceb60[_0x82bd('0x8')]===_0x82bd('0x9')&&typeof _0x5ceb60['limit']===_0x82bd('0x9');var _0x480098=_0x19dbb1['count'];var _0x51c6ea=_0x77d7a9?0x0:_0x5ceb60[_0x82bd('0x8')];var _0x5f0434=_0x77d7a9?_0x19dbb1['count']:_0x5ceb60[_0x82bd('0x8')]+_0x5ceb60['limit'];var _0x4e50da;if(_0x5f0434>=_0x480098){_0x5f0434=_0x480098;_0x4e50da=0xc8;}else{_0x4e50da=0xce;}_0x3bf810[_0x82bd('0x6')](_0x4e50da);return _0x3bf810[_0x82bd('0xa')]('Content-Range',_0x51c6ea+'-'+_0x5f0434+'/'+_0x480098)[_0x82bd('0x7')](_0x19dbb1);}return null;};}function saveUpdates(_0x5f1ab9,_0xfaccf7){return function(_0x51e17e){if(_0x51e17e){return _0x51e17e[_0x82bd('0xb')](_0x5f1ab9)[_0x82bd('0xc')](function(_0x1b2324){return _0x1b2324;});}return null;};}function handleEntityNotFound(_0x2ca530,_0x58d82b){return function(_0x446ffc){if(!_0x446ffc){_0x2ca530[_0x82bd('0xd')](0x194);}return _0x446ffc;};}function handleError(_0x52e533,_0x3667ef){_0x3667ef=_0x3667ef||0x1f4;return function(_0x4db39d){logger[_0x82bd('0xe')](_0x4db39d[_0x82bd('0xf')]);if(_0x4db39d[_0x82bd('0x10')]){delete _0x4db39d[_0x82bd('0x10')];}_0x52e533[_0x82bd('0x6')](_0x3667ef)[_0x82bd('0x11')](_0x4db39d);};}exports[_0x82bd('0x12')]=function(_0xb7a986,_0x31a350){var _0xf180aa={},_0x390107={},_0x29b689={'count':0x0,'rows':[]};var _0x1c3779=_[_0x82bd('0x13')](db['CmHopper']['rawAttributes'],function(_0x283ce7){return{'name':_0x283ce7[_0x82bd('0x14')],'type':_0x283ce7[_0x82bd('0x15')][_0x82bd('0x16')]};});_0x390107[_0x82bd('0x17')]=_[_0x82bd('0x13')](_0x1c3779,_0x82bd('0x10'));_0x390107[_0x82bd('0x18')]=_[_0x82bd('0x19')](_0xb7a986[_0x82bd('0x18')]);_0x390107[_0x82bd('0x1a')]=_[_0x82bd('0x1b')](_0x390107[_0x82bd('0x17')],_0x390107[_0x82bd('0x18')]);_0x390107[_0x82bd('0x1a')]=_[_0x82bd('0x1c')](_0x390107[_0x82bd('0x1a')],[_0x82bd('0x1d'),_0x82bd('0x1e'),'$gt','$gte',_0x82bd('0x1f'),_0x82bd('0x20'),_0x82bd('0x21'),_0x82bd('0x22'),_0x82bd('0x23'),_0x82bd('0x24'),_0x82bd('0x25'),_0x82bd('0x26'),_0x82bd('0x27'),_0x82bd('0x28'),'$notLike','$iLike','$notILike','$like',_0x82bd('0x29'),_0x82bd('0x2a'),_0x82bd('0x2b'),_0x82bd('0x2c')]);_0xf180aa[_0x82bd('0x2d')]=_['intersection'](_0x390107['model'],qs['fields'](_0xb7a986[_0x82bd('0x18')][_0x82bd('0x2e')]));_0xf180aa[_0x82bd('0x2d')]=_0xf180aa['attributes'][_0x82bd('0x2f')]?_0xf180aa['attributes']:_0x390107[_0x82bd('0x17')];if(!_0xb7a986[_0x82bd('0x18')][_0x82bd('0x30')](_0x82bd('0x31'))){_0xf180aa[_0x82bd('0x32')]=qs[_0x82bd('0x32')](_0xb7a986['query'][_0x82bd('0x32')]);_0xf180aa[_0x82bd('0x8')]=qs[_0x82bd('0x8')](_0xb7a986['query'][_0x82bd('0x8')]);}_0xf180aa['order']=qs['sort'](_0xb7a986[_0x82bd('0x18')][_0x82bd('0x33')]);_0xf180aa[_0x82bd('0x34')]=qs[_0x82bd('0x1a')](_[_0x82bd('0x35')](_0xb7a986[_0x82bd('0x18')],_0x390107[_0x82bd('0x1a')]),_0x1c3779);if(_0xb7a986[_0x82bd('0x18')][_0x82bd('0x36')]){_0xf180aa[_0x82bd('0x34')]=_[_0x82bd('0x37')](_0xf180aa[_0x82bd('0x34')],{'$or':_[_0x82bd('0x13')](_0x1c3779,function(_0x77a0){if(_0x77a0[_0x82bd('0x15')]!==_0x82bd('0x38')){var _0x1097e3={};_0x1097e3[_0x77a0['name']]={'$like':'%'+_0xb7a986['query']['filter']+'%'};return _0x1097e3;}})});}_0xf180aa=_[_0x82bd('0x37')]({},_0xf180aa,_0xb7a986[_0x82bd('0x39')]);var _0x549a74={'where':_0xf180aa[_0x82bd('0x34')]};return db['CmHopper']['count'](_0x549a74)['then'](function(_0x2b7675){_0x29b689[_0x82bd('0x3a')]=_0x2b7675;if(_0xb7a986[_0x82bd('0x18')][_0x82bd('0x3b')]){_0xf180aa[_0x82bd('0x3c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xf180aa);})['then'](function(_0x64bc54){_0x29b689['rows']=_0x64bc54;return _0x29b689;})['then'](respondWithFilteredResult(_0x31a350,_0xf180aa))[_0x82bd('0x3d')](handleError(_0x31a350,null));};exports[_0x82bd('0x3e')]=function(_0x3192e2,_0x2c5e7d){var _0x3ff054={'raw':!![],'where':{'id':_0x3192e2[_0x82bd('0x3f')]['id']}},_0xd94dc7={};_0xd94dc7[_0x82bd('0x17')]=_[_0x82bd('0x19')](db['CmHopper']['rawAttributes']);_0xd94dc7[_0x82bd('0x18')]=_[_0x82bd('0x19')](_0x3192e2['query']);_0xd94dc7['filters']=_[_0x82bd('0x1b')](_0xd94dc7[_0x82bd('0x17')],_0xd94dc7['query']);_0x3ff054[_0x82bd('0x2d')]=_[_0x82bd('0x1b')](_0xd94dc7[_0x82bd('0x17')],qs[_0x82bd('0x2e')](_0x3192e2[_0x82bd('0x18')][_0x82bd('0x2e')]));_0x3ff054[_0x82bd('0x2d')]=_0x3ff054[_0x82bd('0x2d')][_0x82bd('0x2f')]?_0x3ff054[_0x82bd('0x2d')]:_0xd94dc7[_0x82bd('0x17')];if(_0x3192e2[_0x82bd('0x18')]['includeAll']){_0x3ff054[_0x82bd('0x3c')]=[{'all':!![]}];}_0x3ff054=_[_0x82bd('0x37')]({},_0x3ff054,_0x3192e2['options']);return db['CmHopper'][_0x82bd('0x40')](_0x3ff054)[_0x82bd('0xc')](handleEntityNotFound(_0x2c5e7d,null))[_0x82bd('0xc')](respondWithResult(_0x2c5e7d,null))[_0x82bd('0x3d')](handleError(_0x2c5e7d,null));};exports[_0x82bd('0x41')]=function(_0x4be313,_0x522494){return db[_0x82bd('0x42')][_0x82bd('0x41')](_0x4be313['body'],{})[_0x82bd('0xc')](respondWithResult(_0x522494,0xc9))['catch'](handleError(_0x522494,null));};exports[_0x82bd('0xb')]=function(_0x6d65c6,_0x587aec){if(_0x6d65c6[_0x82bd('0x43')]['id']){delete _0x6d65c6[_0x82bd('0x43')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x6d65c6[_0x82bd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x587aec,null))[_0x82bd('0xc')](saveUpdates(_0x6d65c6[_0x82bd('0x43')],null))[_0x82bd('0xc')](respondWithResult(_0x587aec,null))[_0x82bd('0x3d')](handleError(_0x587aec,null));};exports['describe']=function(_0x53fd25,_0x1852f2){return db[_0x82bd('0x42')]['describe']()[_0x82bd('0xc')](respondWithResult(_0x1852f2,null))[_0x82bd('0x3d')](handleError(_0x1852f2,null));};exports[_0x82bd('0x44')]=function(_0x4d58af,_0x10789b){var _0x92ba88;var _0x1db61b=_0x4d58af[_0x82bd('0x3f')]['id'];return db[_0x82bd('0x42')][_0x82bd('0x40')]({'where':{'id':_0x4d58af[_0x82bd('0x3f')]['id']}})[_0x82bd('0xc')](handleEntityNotFound(_0x10789b,null))[_0x82bd('0xc')](function(_0x1fd682){if(_0x1fd682){return _0x1fd682[_0x82bd('0x44')]()[_0x82bd('0xc')](function(_0x1764da){return _0x1764da;});}})['then'](function(_0x63a2a0){_0x92ba88=_0x63a2a0;if(_0x63a2a0){if(_0x63a2a0[_0x82bd('0x45')]||_0x63a2a0['CampaignId']){return db[_0x63a2a0[_0x82bd('0x45')]?_0x82bd('0x46'):_0x82bd('0x47')][_0x82bd('0x40')]({'where':{'id':_0x63a2a0['VoiceQueueId']?_0x63a2a0['VoiceQueueId']:_0x63a2a0[_0x82bd('0x48')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x39ba36){var _0x4c35dd={};if(_0x39ba36){_['merge'](_0x4c35dd,_[_0x82bd('0x49')](_0x92ba88[_0x82bd('0x4a')],[_0x82bd('0x4b'),_0x82bd('0x4c'),'id']));_0x4c35dd[_0x82bd('0x4d')]=0x15;_0x4c35dd[_0x82bd('0x4e')]=_0x82bd('0x4f');_0x4c35dd[_0x82bd('0x50')]=_0x39ba36[_0x82bd('0x10')];_0x4c35dd[_0x82bd('0x51')]=_0x4d58af[_0x82bd('0x52')][_0x82bd('0x10')];_0x4c35dd[_0x82bd('0x53')]=_0x4d58af[_0x82bd('0x52')]['id'];_0x4c35dd[_0x82bd('0x4f')]=!![];_0x4c35dd['deletedat']=moment()[_0x82bd('0x54')](_0x82bd('0x55'));_0x4c35dd[_0x82bd('0x56')]=_0x92ba88[_0x82bd('0x57')];_0x4c35dd[_0x82bd('0x58')]=_0x92ba88['VoiceQueueId']?'queue':'ivr';return db['CmContact'][_0x82bd('0x40')]({'where':{'id':_0x4c35dd[_0x82bd('0x59')]},'attributes':[_0x82bd('0x5a'),_0x82bd('0x5b')]})['then'](function(_0x56c954){if(!_[_0x82bd('0x5c')](_0x10789b)&&!_[_0x82bd('0x5c')](_0x56c954[_0x82bd('0x5a')])){_0x4c35dd['calleridname']=_0x56c954[_0x82bd('0x5a')];if(!_[_0x82bd('0x5c')](_0x56c954[_0x82bd('0x5b')])){_0x4c35dd[_0x82bd('0x5d')]+='\x20'+_0x56c954[_0x82bd('0x5b')];}}})[_0x82bd('0x5e')](function(){return db[_0x82bd('0x5f')][_0x82bd('0x41')](_0x4c35dd);});}})[_0x82bd('0xc')](function(_0x20b636){return db[_0x82bd('0x60')][_0x82bd('0x44')]({'where':{'CmHopperId':_0x1db61b}});})[_0x82bd('0xc')](function(){return _0x10789b[_0x82bd('0x6')](0xcc)[_0x82bd('0x61')]();})[_0x82bd('0x3d')](handleError(_0x10789b,null));};exports[_0x82bd('0x62')]=function(_0x1fa71d,_0x54d85b){var _0x566b01=[];return db['CmContact']['describe']()[_0x82bd('0xc')](function(_0x4d2305){_0x566b01=_[_0x82bd('0x19')](_0x4d2305);return _0x1fa71d[_0x82bd('0x52')][_0x82bd('0x63')]({'where':{'type':_0x82bd('0x64'),'dialActive':!![],'dialMethod':_0x82bd('0x65')},'attributes':['id',_0x82bd('0x66'),_0x82bd('0x67')],'raw':!![]});})[_0x82bd('0xc')](function(_0x40d6cf){if(_0x40d6cf&&_0x40d6cf[_0x82bd('0x2f')]){return db[_0x82bd('0x68')]['transaction'](function(_0x4c54f0){var _0x419965={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x82bd('0x54')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x40d6cf,'id')},'$or':[{'UserId':null},{'UserId':_0x1fa71d[_0x82bd('0x52')]['id']}]};var _0x210ea9={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x40d6cf)[_0x82bd('0x36')]([_0x82bd('0x67'),0x0])['map']('id')[_0x82bd('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x1fa71d['user']['id']}]};var _0x1a16c1={'$or':[_0x419965,_0x210ea9]};var _0x6ff77c=[];if(_0x1fa71d['body'][_0x82bd('0x6a')]&&_0x1fa71d[_0x82bd('0x43')][_0x82bd('0x6a')]===_0x82bd('0x6b')){if(!_['isEmpty'](_0x1fa71d[_0x82bd('0x43')][_0x82bd('0x6c')])){_0x1a16c1['id']={'$in':_0x1fa71d[_0x82bd('0x43')][_0x82bd('0x6c')]};}_0x6ff77c=[[_0x82bd('0x6d'),_0x82bd('0x6e')],[_0x82bd('0x6f'),_0x40d6cf[0x0][_0x82bd('0x66')]===_0x82bd('0x6e')?'DESC':_0x82bd('0x6e')],db['sequelize']['literal'](_0x82bd('0x70')),['id',_0x82bd('0x71')]];}else{if(!_['isEmpty'](_0x1fa71d[_0x82bd('0x43')]['hopperIds'])){_0x1a16c1['id']={'$notIn':_0x1fa71d[_0x82bd('0x43')][_0x82bd('0x6c')]};}_0x6ff77c=[['priority',_0x82bd('0x71')],[_0x82bd('0x6f'),_0x40d6cf[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x82bd('0x72')),['id',_0x82bd('0x6e')]];}return db['CmHopper'][_0x82bd('0x73')]({'attributes':['id',_0x82bd('0x74'),'phone','recallme'],'where':_0x1a16c1,'order':_0x6ff77c,'transaction':_0x4c54f0,'lock':_0x4c54f0[_0x82bd('0x75')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x82bd('0x76'),'attributes':_0x566b01,'include':[{'model':db[_0x82bd('0x77')],'as':_0x82bd('0x78'),'attributes':['id',_0x82bd('0x10')]}]},{'model':db[_0x82bd('0x79')],'as':'List','attributes':['id',_0x82bd('0x10')]},{'model':db['VoiceQueue'],'as':_0x82bd('0x7a'),'attributes':['id','name',_0x82bd('0x7b')]}]})['then'](function(_0x5f122c){if(_0x5f122c){return _0x5f122c[_0x82bd('0xb')]({'UserId':_0x1fa71d[_0x82bd('0x52')]['id']},{'transaction':_0x4c54f0});}});});}})['then'](handleEntityNotFound(_0x54d85b,null))[_0x82bd('0xc')](respondWithResult(_0x54d85b,null))[_0x82bd('0x3d')](handleError(_0x54d85b,null));};exports[_0x82bd('0x7c')]=function(_0x480a25,_0x4efcf2,_0x197368){var _0x3c476d=[];var _0x528742=_0x480a25[_0x82bd('0x3f')]['id'];var _0x26f0a2=_0x480a25['user']['id'];return db[_0x82bd('0x7d')][_0x82bd('0x7e')]()[_0x82bd('0xc')](function(_0x43c1a2){_0x3c476d=_[_0x82bd('0x19')](_0x43c1a2);return db[_0x82bd('0x68')]['transaction'](function(_0x12cb53){const _0x11fa86={'id':_0x528742};return db[_0x82bd('0x42')]['findOne']({'attributes':['id',_0x82bd('0x74'),'recallme'],'where':_0x11fa86,'transaction':_0x12cb53,'lock':_0x12cb53[_0x82bd('0x75')][_0x82bd('0x7f')],'include':[{'model':db[_0x82bd('0x7d')],'as':_0x82bd('0x76'),'attributes':_0x3c476d,'include':[{'model':db[_0x82bd('0x77')],'as':'Company','attributes':['id',_0x82bd('0x10')]}]},{'model':db[_0x82bd('0x79')],'as':'List','attributes':['id',_0x82bd('0x10')]},{'model':db[_0x82bd('0x46')],'as':'Queue','attributes':['id',_0x82bd('0x10'),_0x82bd('0x7b')]}]})[_0x82bd('0xc')](function(_0x55fe38){if(_0x55fe38){return _0x55fe38['update']({'UserId':_0x26f0a2},{'transaction':_0x12cb53});}});});})[_0x82bd('0xc')](handleEntityNotFound(_0x4efcf2,null))[_0x82bd('0xc')](respondWithResult(_0x4efcf2,null))[_0x82bd('0x3d')](handleError(_0x4efcf2,null));};exports['getOpenContacts']=function(_0x465979,_0x4721c3){return _0x465979[_0x82bd('0x52')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x437463){if(_0x437463&&_0x437463[_0x82bd('0x2f')]){return db['CmHopper'][_0x82bd('0x3a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x82bd('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x437463,'id')},'$or':[{'UserId':null},{'UserId':_0x465979[_0x82bd('0x52')]['id']}]}});}return 0x0;})[_0x82bd('0xc')](function(_0x3ec156){if(!_['isNil'](_0x3ec156)&&_[_0x82bd('0x80')](_0x3ec156)){return _0x4721c3[_0x82bd('0x6')](0xc8)[_0x82bd('0x7')]({'contacts':_0x3ec156});}else{logger[_0x82bd('0xe')](_0x82bd('0x81'),'getOpenContacts',0x194,_0x82bd('0x82'));_0x4721c3[_0x82bd('0xd')](0x194);}})[_0x82bd('0x3d')](handleError(_0x4721c3,null));};exports['getTimezones']=function(_0x4d8785,_0x557706){var _0x25e1ed=shared[_0x82bd('0x83')];var _0x2b8084=[];_[_0x82bd('0x13')](_0x25e1ed,function(_0x385821){_0x2b8084['push']({'id':_0x385821['name'],'name':_0x385821['name'],'utcOffset':_0x385821['utcOffset']});});return _0x557706[_0x82bd('0x6')](0xc8)[_0x82bd('0x7')]({'tz':_0x2b8084});};exports[_0x82bd('0x84')]=function(_0x1d0383,_0x184e8b){var _0x16810f=shared[_0x82bd('0x83')];var _0x5a975d={};if(!_[_0x82bd('0x5c')](_0x16810f[_0x1d0383[_0x82bd('0x43')]['id']]))_0x5a975d=_0x16810f[_0x1d0383[_0x82bd('0x43')]['id']];return _0x184e8b[_0x82bd('0x6')](0xc8)[_0x82bd('0x7')](_0x5a975d);};
\ No newline at end of file
index 0e6212a..85754df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x89fffe,_0x1ef3ba){var _0x4a9fad=function(_0x8690eb){while(--_0x8690eb){_0x89fffe['push'](_0x89fffe['shift']());}};_0x4a9fad(++_0x1ef3ba);}(_0x4975,0x86));var _0x5497=function(_0x390e71,_0x159115){_0x390e71=_0x390e71-0x0;var _0x565eb2=_0x4975[_0x390e71];return _0x565eb2;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['scheduledat']},{'name':_0x5497('0xe'),'fields':['phone']},{'name':_0x5497('0xf'),'fields':[_0x5497('0xf')]}],'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(_0x4aa2ec,_0x3d552a){var _0x534708=function(_0x4255da){while(--_0x4255da){_0x4aa2ec['push'](_0x4aa2ec['shift']());}};_0x534708(++_0x3d552a);}(_0xba34,0x119));var _0x4ba3=function(_0x8e503b,_0x84dae7){_0x8e503b=_0x8e503b-0x0;var _0x51c8ad=_0xba34[_0x8e503b];return _0x51c8ad;};'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
index db18e46..803a1d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758f=['raw','where','attributes','limit','map','include','model','then','info','debug','error','message','ShowCmHopper','find','stringify','catch','CreateCmHopper','create','body','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','transaction','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x758f,0x187));var _0xf758=function(_0x4983f4,_0x107731){_0x4983f4=_0x4983f4-0x0;var _0xbac14f=_0x758f[_0x4983f4];return _0xbac14f;};'use strict';var _=require('lodash');var util=require(_0xf758('0x0'));var moment=require(_0xf758('0x1'));var BPromise=require('bluebird');var db=require(_0xf758('0x2'))['db'];var logger=require(_0xf758('0x3'))(_0xf758('0x4'));exports[_0xf758('0x5')]=function(_0x20b825){var _0x52fc6c=this;return new Promise(function(_0x9daf9b,_0x4fb941){return db[_0xf758('0x6')][_0xf758('0x7')]({'raw':_0x20b825[_0xf758('0x8')]?_0x20b825[_0xf758('0x8')][_0xf758('0x9')]===undefined?!![]:![]:!![],'where':_0x20b825['options']?_0x20b825['options'][_0xf758('0xa')]||null:null,'attributes':_0x20b825[_0xf758('0x8')]?_0x20b825[_0xf758('0x8')][_0xf758('0xb')]||null:null,'limit':_0x20b825[_0xf758('0x8')]?_0x20b825[_0xf758('0x8')][_0xf758('0xc')]||null:null,'include':_0x20b825[_0xf758('0x8')]?_0x20b825[_0xf758('0x8')]['include']?_[_0xf758('0xd')](_0x20b825['options'][_0xf758('0xe')],function(_0x59c0f3){return{'model':db[_0x59c0f3[_0xf758('0xf')]],'as':_0x59c0f3['as'],'attributes':_0x59c0f3[_0xf758('0xb')],'include':_0x59c0f3['include']?_[_0xf758('0xd')](_0x59c0f3[_0xf758('0xe')],function(_0xc35207){return{'model':db[_0xc35207['model']],'as':_0xc35207['as'],'attributes':_0xc35207[_0xf758('0xb')],'include':_0xc35207[_0xf758('0xe')]?_[_0xf758('0xd')](_0xc35207['include'],function(_0x5a25cc){return{'model':db[_0x5a25cc[_0xf758('0xf')]],'as':_0x5a25cc['as'],'attributes':_0x5a25cc[_0xf758('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf758('0x10')](function(_0x40e27f){logger[_0xf758('0x11')](_0xf758('0x5'),_0x20b825);logger[_0xf758('0x12')](_0xf758('0x5'),_0x20b825,JSON['stringify'](_0x40e27f));_0x9daf9b(_0x40e27f);})['catch'](function(_0x1f9025){logger[_0xf758('0x13')]('GetCmHopper',_0x1f9025[_0xf758('0x14')],_0x20b825);_0x4fb941(_0x52fc6c['error'](0x1f4,_0x1f9025[_0xf758('0x14')]));});});};exports[_0xf758('0x15')]=function(_0x3be48a){var _0x2b2cd8=this;return new Promise(function(_0x3df112,_0x373be7){return db[_0xf758('0x6')][_0xf758('0x16')]({'raw':_0x3be48a['options']?_0x3be48a['options'][_0xf758('0x9')]===undefined?!![]:![]:!![],'where':_0x3be48a[_0xf758('0x8')]?_0x3be48a[_0xf758('0x8')][_0xf758('0xa')]||null:null,'attributes':_0x3be48a[_0xf758('0x8')]?_0x3be48a[_0xf758('0x8')][_0xf758('0xb')]||null:null,'include':_0x3be48a[_0xf758('0x8')]?_0x3be48a['options']['include']?_[_0xf758('0xd')](_0x3be48a[_0xf758('0x8')][_0xf758('0xe')],function(_0xca8281){return{'model':db[_0xca8281[_0xf758('0xf')]],'as':_0xca8281['as'],'attributes':_0xca8281['attributes'],'include':_0xca8281[_0xf758('0xe')]?_[_0xf758('0xd')](_0xca8281[_0xf758('0xe')],function(_0x298da8){return{'model':db[_0x298da8[_0xf758('0xf')]],'as':_0x298da8['as'],'attributes':_0x298da8[_0xf758('0xb')],'include':_0x298da8['include']?_[_0xf758('0xd')](_0x298da8['include'],function(_0x447952){return{'model':db[_0x447952['model']],'as':_0x447952['as'],'attributes':_0x447952[_0xf758('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x697d92){logger[_0xf758('0x11')](_0xf758('0x15'),_0x3be48a);logger[_0xf758('0x12')](_0xf758('0x15'),_0x3be48a,JSON[_0xf758('0x17')](_0x697d92));_0x3df112(_0x697d92);})[_0xf758('0x18')](function(_0x3c8fa2){logger[_0xf758('0x13')](_0xf758('0x15'),_0x3c8fa2[_0xf758('0x14')],_0x3be48a);_0x373be7(_0x2b2cd8['error'](0x1f4,_0x3c8fa2[_0xf758('0x14')]));});});};exports[_0xf758('0x19')]=function(_0x103fd3){var _0x1d9010=this;return new Promise(function(_0x3ffaa0,_0x50af01){return db[_0xf758('0x6')][_0xf758('0x1a')](_0x103fd3[_0xf758('0x1b')],{'raw':_0x103fd3['options']?_0x103fd3[_0xf758('0x8')][_0xf758('0x9')]===undefined?!![]:![]:!![]})[_0xf758('0x10')](function(_0x34cccc){logger[_0xf758('0x11')](_0xf758('0x19'),_0x103fd3);logger[_0xf758('0x12')](_0xf758('0x19'),_0x103fd3,JSON['stringify'](_0x34cccc));_0x3ffaa0(_0x34cccc);})[_0xf758('0x18')](function(_0x568826){logger[_0xf758('0x13')]('CreateCmHopper',_0x568826[_0xf758('0x14')],_0x103fd3);_0x50af01(_0x1d9010[_0xf758('0x13')](0x1f4,_0x568826[_0xf758('0x14')]));});});};exports['UpdateCmHopper']=function(_0x7023b1){var _0xb77f7a=this;return new Promise(function(_0x11db17,_0xeebad6){return db[_0xf758('0x6')][_0xf758('0x1c')](_0x7023b1[_0xf758('0x1b')],{'raw':_0x7023b1[_0xf758('0x8')]?_0x7023b1['options'][_0xf758('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7023b1[_0xf758('0x8')]?_0x7023b1[_0xf758('0x8')][_0xf758('0xa')]||null:null,'attributes':_0x7023b1[_0xf758('0x8')]?_0x7023b1[_0xf758('0x8')][_0xf758('0xb')]||null:null,'limit':_0x7023b1['options']?_0x7023b1[_0xf758('0x8')][_0xf758('0xc')]||null:null})[_0xf758('0x10')](function(_0x23b4de){logger[_0xf758('0x11')]('UpdateCmHopper',_0x7023b1);logger['info'](_0xf758('0x1d'),JSON[_0xf758('0x17')](_0x7023b1[_0xf758('0x8')][_0xf758('0xa')]),_0x7023b1['body'][_0xf758('0x1e')]);logger[_0xf758('0x12')](_0xf758('0x1f'),_0x7023b1,JSON['stringify'](_0x23b4de));_0x11db17(_0x23b4de);})['catch'](function(_0x24207b){logger['error']('UpdateCmHopper',_0x24207b[_0xf758('0x14')],_0x7023b1);_0xeebad6(_0xb77f7a['error'](0x1f4,_0x24207b[_0xf758('0x14')]));});});};exports[_0xf758('0x20')]=function(_0x20abdd){var _0x2da6b6=this;return new Promise(function(_0xfd604e,_0x297d58){return db[_0xf758('0x6')][_0xf758('0x21')]({'where':_0x20abdd[_0xf758('0x8')]?_0x20abdd[_0xf758('0x8')][_0xf758('0xa')]||null:null})['then'](function(_0x457b4f){logger[_0xf758('0x11')](_0xf758('0x20'),_0x20abdd);logger[_0xf758('0x12')]('DestroyCmHopper',_0x20abdd,JSON[_0xf758('0x17')](_0x457b4f));_0xfd604e(_0x457b4f);})[_0xf758('0x18')](function(_0x5c7395){logger[_0xf758('0x13')]('DestroyCmHopper',_0x5c7395[_0xf758('0x14')],_0x20abdd);_0x297d58(_0x2da6b6[_0xf758('0x13')](0x1f4,_0x5c7395[_0xf758('0x14')]));});});};exports[_0xf758('0x22')]=function(_0x40de8f){var _0x2a4795=this;return new Promise(function(_0x3479b9,_0x52c110){return db[_0xf758('0x23')]['describe']()[_0xf758('0x10')](function(_0x17ac81){return db['sequelize'][_0xf758('0x24')](function(_0x30587e){return db[_0xf758('0x6')][_0xf758('0x7')]({'where':_0x40de8f[_0xf758('0x8')]?_0x40de8f['options'][_0xf758('0xa')]||null:null,'attributes':_0x40de8f['options']?_0x40de8f[_0xf758('0x8')][_0xf758('0xb')]||null:null,'limit':_0x40de8f[_0xf758('0x8')]?_0x40de8f[_0xf758('0x8')][_0xf758('0xc')]||null:null,'order':_0x40de8f[_0xf758('0x8')]?_0x40de8f[_0xf758('0x8')]['order']||null:null,'transaction':_0x30587e,'lock':_0x30587e[_0xf758('0x25')][_0xf758('0x26')],'include':[{'model':db[_0xf758('0x23')],'as':'Contact','attributes':_[_0xf758('0x27')](_0x17ac81)},{'model':db[_0xf758('0x28')],'as':_0xf758('0x29'),'attributes':['id',_0xf758('0x2a'),_0xf758('0x2b')]}]})['then'](function(_0x3861b0){var _0x38d069=[];var _0x207f22=[];for(var _0x2af2f1=0x0;_0x2af2f1<_0x3861b0[_0xf758('0x2c')];_0x2af2f1+=0x1){var _0x5bc9ff=_0x3861b0[_0x2af2f1][_0xf758('0x2d')];if(_0x5bc9ff===null){_0x38d069[_0xf758('0x2e')](_0x3861b0[_0x2af2f1][_0xf758('0x1c')](_0x40de8f['body'],{'transaction':_0x30587e}));}else if(!_0x207f22[_0xf758('0x2f')](_0x5bc9ff)){_0x207f22[_0xf758('0x2e')](_0x5bc9ff);_0x38d069[_0xf758('0x2e')](_0x3861b0[_0x2af2f1]['update'](_0x40de8f['body'],{'transaction':_0x30587e}));}}return BPromise[_0xf758('0x30')](_0x38d069);});})[_0xf758('0x10')](function(_0x24de25){logger[_0xf758('0x11')](_0xf758('0x22'),_0x40de8f);if(_0x24de25[_0xf758('0x2c')]>0x0){logger[_0xf758('0x11')](_0xf758('0x31'),_0x24de25[0x0][_0xf758('0x32')]['id'],_0x24de25[0x0][_0xf758('0x32')][_0xf758('0x33')],_0x24de25[0x0]['dataValues'][_0xf758('0x1e')]);}logger[_0xf758('0x12')](_0xf758('0x22'),_0x40de8f,JSON[_0xf758('0x17')](_0x24de25));_0x3479b9(_0x24de25);})[_0xf758('0x18')](function(_0x26c634){logger[_0xf758('0x13')](_0xf758('0x22'),_0x26c634[_0xf758('0x14')],_0x40de8f);_0x52c110(_0x2a4795['error'](0x1f4,_0x26c634[_0xf758('0x14')]));});});});};exports[_0xf758('0x34')]=function(_0x380756){var _0x4ff07d=this;return new Promise(function(_0x4c7270,_0x3c83cf){return db[_0xf758('0x35')][_0xf758('0x24')](function(_0x150c6e){return db['CmHopperFinal'][_0xf758('0x1a')](_0x380756[_0xf758('0x1b')],{'raw':_0x380756[_0xf758('0x8')]?_0x380756[_0xf758('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x150c6e})[_0xf758('0x10')](function(){logger[_0xf758('0x11')](_0xf758('0x36'),JSON[_0xf758('0x17')](_0x380756[_0xf758('0x8')]['where']),_0x380756['options'][_0xf758('0xa')][_0xf758('0x1e')]);return db[_0xf758('0x6')][_0xf758('0x21')]({'where':_0x380756['options']?_0x380756['options'][_0xf758('0xa')]||null:null,'transaction':_0x150c6e});});})[_0xf758('0x10')](function(_0x3ec4ec){logger[_0xf758('0x11')](_0xf758('0x34'),_0x380756);logger[_0xf758('0x12')](_0xf758('0x34'),_0x380756,JSON[_0xf758('0x17')](_0x3ec4ec));_0x4c7270(_0x3ec4ec);})['catch'](function(_0x2f16b6){logger[_0xf758('0x13')](_0xf758('0x34'),_0x2f16b6[_0xf758('0x14')],_0x380756);_0x3c83cf(_0x4ff07d[_0xf758('0x13')](0x1f4,_0x2f16b6[_0xf758('0x14')]));});});};exports['CountReScheduled']=function(_0x5d8165){var _0x2132c4=this;return new Promise(function(_0x637537,_0x150dff){return db['CmHopper'][_0xf758('0x7')]({'raw':_0x5d8165[_0xf758('0x8')]?_0x5d8165[_0xf758('0x8')][_0xf758('0x9')]===undefined?!![]:![]:!![],'where':_0x5d8165[_0xf758('0x8')]?_0x5d8165[_0xf758('0x8')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xf758('0x37'),db[_0xf758('0x35')]['fn']('IF',db[_0xf758('0x35')][_0xf758('0x38')]('`scheduledat`\x20>=\x20'+util[_0xf758('0x39')](_0xf758('0x3a'),moment()[_0xf758('0x39')](_0xf758('0x3b')))+_0xf758('0x3c')))),_0xf758('0x3d')]]})[_0xf758('0x10')](function(_0x462c79){logger['info'](_0xf758('0x3e'),_0x5d8165);logger['debug']('CountReScheduled',_0x5d8165,JSON[_0xf758('0x17')](_0x462c79));_0x637537(_0x462c79);})[_0xf758('0x18')](function(_0x2aaafb){logger[_0xf758('0x13')](_0xf758('0x3e'),_0x2aaafb[_0xf758('0x14')],_0x5d8165);_0x150dff(_0x2132c4[_0xf758('0x13')](0x1f4,_0x2aaafb[_0xf758('0x14')]));});});};exports[_0xf758('0x3f')]=function(_0x251143){var _0x47cf4c=this;return new Promise(function(_0x2cd90d,_0x18fe49){return db[_0xf758('0x23')][_0xf758('0x40')]()[_0xf758('0x10')](function(){return db['sequelize'][_0xf758('0x24')](function(_0x893c8e){return db[_0xf758('0x6')][_0xf758('0x7')]({'where':_0x251143[_0xf758('0x8')]?_0x251143[_0xf758('0x8')][_0xf758('0xa')]||null:null,'attributes':_0x251143['options']?_0x251143['options']['attributes']||null:null,'limit':0x1,'order':_0x251143[_0xf758('0x8')]?_0x251143['options']['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x893c8e,'lock':_0x893c8e[_0xf758('0x25')][_0xf758('0x26')],'include':_0x251143[_0xf758('0x8')]?_0x251143[_0xf758('0x8')][_0xf758('0xe')]?_[_0xf758('0xd')](_0x251143[_0xf758('0x8')][_0xf758('0xe')],function(_0x51bc81){return{'model':db[_0x51bc81[_0xf758('0xf')]],'as':_0x51bc81['as'],'attributes':_0x51bc81[_0xf758('0xb')],'include':_0x51bc81[_0xf758('0xe')]?_['map'](_0x51bc81[_0xf758('0xe')],function(_0x11b899){return{'model':db[_0x11b899[_0xf758('0xf')]],'as':_0x11b899['as'],'attributes':_0x11b899[_0xf758('0xb')],'include':_0x11b899[_0xf758('0xe')]?_[_0xf758('0xd')](_0x11b899[_0xf758('0xe')],function(_0x20e6d7){return{'model':db[_0x20e6d7[_0xf758('0xf')]],'as':_0x20e6d7['as'],'attributes':_0x20e6d7[_0xf758('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ab429){var _0x4f4d39=[];for(var _0x1ced79=0x0;_0x1ced79<_0x5ab429[_0xf758('0x2c')];_0x1ced79+=0x1){_0x4f4d39['push'](_0x5ab429[_0x1ced79][_0xf758('0x1c')](_0x251143[_0xf758('0x1b')],{'transaction':_0x893c8e}));}return BPromise[_0xf758('0x30')](_0x4f4d39);});})[_0xf758('0x10')](function(_0x3b21d4){logger[_0xf758('0x11')]('GetContactRecallMe',_0x251143);logger[_0xf758('0x12')](_0xf758('0x3f'),_0x251143,JSON[_0xf758('0x17')](_0x3b21d4));_0x2cd90d(_0x3b21d4);})[_0xf758('0x18')](function(_0x90efe0){logger[_0xf758('0x13')](_0xf758('0x3f'),_0x90efe0[_0xf758('0x14')],_0x251143);_0x18fe49(_0x47cf4c[_0xf758('0x13')](0x1f4,_0x90efe0['message']));});});});};exports[_0xf758('0x41')]=function(_0x24ade1){var _0x583ef4=this;return new Promise(function(_0x2f734d,_0x4023c7){db[_0xf758('0x23')]['describe']()[_0xf758('0x10')](function(_0x154ab2){return db[_0xf758('0x6')][_0xf758('0x7')]({'raw':_0x24ade1[_0xf758('0x8')]?_0x24ade1['options'][_0xf758('0x9')]===undefined?!![]:![]:!![],'where':_0x24ade1[_0xf758('0x8')]?_0x24ade1[_0xf758('0x8')]['where']||null:null,'attributes':_0x24ade1[_0xf758('0x8')]?_0x24ade1[_0xf758('0x8')][_0xf758('0xb')]||null:null,'limit':_0x24ade1[_0xf758('0x8')]?_0x24ade1[_0xf758('0x8')][_0xf758('0xc')]||null:null,'include':_0x24ade1[_0xf758('0x8')]?_0x24ade1[_0xf758('0x8')][_0xf758('0xe')]?_[_0xf758('0xd')](_0x24ade1['options'][_0xf758('0xe')],function(_0x20ca93){return{'model':db[_0x20ca93[_0xf758('0xf')]],'as':_0x20ca93['as'],'attributes':_0x20ca93['as']===_0xf758('0x42')?_[_0xf758('0x27')](_0x154ab2):_0x20ca93[_0xf758('0xb')],'include':_0x20ca93[_0xf758('0xe')]?_[_0xf758('0xd')](_0x20ca93['include'],function(_0x24cbf5){return{'model':db[_0x24cbf5[_0xf758('0xf')]],'as':_0x24cbf5['as'],'attributes':_0x24cbf5[_0xf758('0xb')],'include':_0x24cbf5[_0xf758('0xe')]?_['map'](_0x24cbf5[_0xf758('0xe')],function(_0x34ebb5){return{'model':db[_0x34ebb5[_0xf758('0xf')]],'as':_0x34ebb5['as'],'attributes':_0x34ebb5[_0xf758('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf758('0x10')](function(_0x19d16c){logger['info'](_0xf758('0x5'),_0x24ade1);logger['debug'](_0xf758('0x5'),_0x24ade1,JSON['stringify'](_0x19d16c));_0x2f734d(_0x19d16c);})[_0xf758('0x18')](function(_0x1c07a0){logger[_0xf758('0x13')](_0xf758('0x5'),_0x1c07a0['message'],_0x24ade1);_0x4023c7(_0x583ef4[_0xf758('0x13')](0x1f4,_0x1c07a0[_0xf758('0x14')]));});});});};exports[_0xf758('0x43')]=function(_0x48693e){var _0x3c9f53=this;return new Promise(function(_0x372887,_0x13f86c){return db['CmContact'][_0xf758('0x44')]({'raw':!![],'where':{'phone':_0x48693e[_0xf758('0x8')][_0xf758('0xa')][_0xf758('0x45')]},'attributes':['id',_0xf758('0x46')],'order':[['id',_0xf758('0x47')]]})['then'](function(_0x59acd2){logger['info'](_0xf758('0x48'),_0x48693e);logger[_0xf758('0x12')](_0xf758('0x48'),_0x48693e,JSON[_0xf758('0x17')](_0x59acd2));_0x372887(_0x59acd2);})['catch'](function(_0xd9c238){logger[_0xf758('0x13')](_0xf758('0x48'),_0xd9c238[_0xf758('0x14')],_0x48693e);_0x13f86c(_0x3c9f53[_0xf758('0x13')](0x1f4,_0xd9c238[_0xf758('0x14')]));});});};exports['ResetActiveCalls']=function(_0x25c854){var _0x36a57f=this;return new Promise(function(_0x4d5285,_0x315d93){return db[_0xf758('0x35')][_0xf758('0x24')](function(_0x5bbbfa){var _0x4d7e66=_0x25c854[_0xf758('0x8')]&&_0x25c854[_0xf758('0x8')]['where']?_0x25c854['options'][_0xf758('0xa')]:{};return db[_0xf758('0x6')][_0xf758('0x1c')](_0x25c854[_0xf758('0x1b')],{'where':_0x4d7e66,'transaction':_0x5bbbfa})[_0xf758('0x10')](function(_0x3254a7){logger[_0xf758('0x11')](_0xf758('0x49'),_0x25c854);logger[_0xf758('0x12')](_0xf758('0x49'),_0x25c854,JSON[_0xf758('0x17')](_0x3254a7));_0x4d5285(_0x3254a7);})[_0xf758('0x18')](function(_0x53509b){logger[_0xf758('0x13')](_0xf758('0x49'),_0x53509b[_0xf758('0x14')],_0x25c854);_0x315d93(_0x36a57f[_0xf758('0x13')](0x1f4,_0x53509b[_0xf758('0x14')]));});});});};exports[_0xf758('0x4a')]=function(_0x6d126){var _0xf08514=this;var _0x3010d7=_0x6d126[_0xf758('0x1b')][_0xf758('0xa')]['voiceQueueIds'];var _0xe6aeb4=_0x6d126['body'][_0xf758('0xa')]['interval'];var _0x3cf957=_0x6d126['body'][_0xf758('0xa')][_0xf758('0x4b')];return new Promise(function(_0xa55b72,_0x1757de){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x3010d7},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xf758('0x38')](_0xf758('0x4c')+_0xe6aeb4+_0xf758('0x4d')),'$gt':db[_0xf758('0x35')]['literal'](_0xf758('0x4e'))}},'UserId':{'$in':_0x3cf957}},'include':[{'model':db[_0xf758('0x23')],'as':'Contact'},{'model':db[_0xf758('0x28')],'as':_0xf758('0x29'),'attributes':['id',_0xf758('0x2a'),_0xf758('0x2b')]},{'model':db['CmList'],'as':_0xf758('0x4f')}]})[_0xf758('0x10')](function(_0x38a2a5){if(_0x38a2a5[_0xf758('0x2c')]>0x0){return db['sequelize'][_0xf758('0x24')](function(_0x446977){return db[_0xf758('0x6')][_0xf758('0x1c')]({'recallmeNotifiedDate':db[_0xf758('0x35')]['literal']('NOW()')},{'where':{'id':{'$in':_[_0xf758('0xd')](_0x38a2a5,'id')}},'transaction':_0x446977})[_0xf758('0x10')](function(){_0xa55b72(_0x38a2a5);})['catch'](function(_0x2c945e){logger[_0xf758('0x13')](_0xf758('0x4a'),_0x2c945e[_0xf758('0x14')],_0x6d126);_0x1757de(_0xf08514[_0xf758('0x13')](0x1f4,_0x2c945e[_0xf758('0x14')]));});})['catch'](function(_0x1c75ad){logger[_0xf758('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x1c75ad['message'],_0x6d126);_0x1757de(_0xf08514['error'](0x1f4,_0x1c75ad[_0xf758('0x14')]));});}else{_0xa55b72(_0x38a2a5);}});});};
\ No newline at end of file
+var _0xcecc=['map','model','then','info','debug','error','message','CmHopper','find','raw','ShowCmHopper','stringify','CreateCmHopper','create','body','catch','UpdateCmHopper','where','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','Agent','length','push','includes','update','all','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','voicePause','CmList','CmHopperHandlePreviewRecallNotifications','lodash','moment','../../config/logger','rpc','GetCmHopper','findAll','options','attributes','limit','include'];(function(_0x4e7fa9,_0x29d247){var _0x401f9e=function(_0x2f6a12){while(--_0x2f6a12){_0x4e7fa9['push'](_0x4e7fa9['shift']());}};_0x401f9e(++_0x29d247);}(_0xcecc,0x186));var _0xccec=function(_0x3dbaa1,_0x53ec67){_0x3dbaa1=_0x3dbaa1-0x0;var _0x35ab58=_0xcecc[_0x3dbaa1];return _0x35ab58;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xccec('0x2'))(_0xccec('0x3'));exports[_0xccec('0x4')]=function(_0xa10c6f){var _0x4b1996=this;return new Promise(function(_0x4b0fb9,_0x160675){return db['CmHopper'][_0xccec('0x5')]({'raw':_0xa10c6f[_0xccec('0x6')]?_0xa10c6f[_0xccec('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0xa10c6f[_0xccec('0x6')]?_0xa10c6f[_0xccec('0x6')]['where']||null:null,'attributes':_0xa10c6f[_0xccec('0x6')]?_0xa10c6f[_0xccec('0x6')][_0xccec('0x7')]||null:null,'limit':_0xa10c6f[_0xccec('0x6')]?_0xa10c6f['options'][_0xccec('0x8')]||null:null,'include':_0xa10c6f['options']?_0xa10c6f[_0xccec('0x6')][_0xccec('0x9')]?_['map'](_0xa10c6f[_0xccec('0x6')][_0xccec('0x9')],function(_0x1c1a86){return{'model':db[_0x1c1a86['model']],'as':_0x1c1a86['as'],'attributes':_0x1c1a86[_0xccec('0x7')],'include':_0x1c1a86[_0xccec('0x9')]?_[_0xccec('0xa')](_0x1c1a86[_0xccec('0x9')],function(_0x22b167){return{'model':db[_0x22b167['model']],'as':_0x22b167['as'],'attributes':_0x22b167[_0xccec('0x7')],'include':_0x22b167['include']?_['map'](_0x22b167['include'],function(_0x8ff6a6){return{'model':db[_0x8ff6a6[_0xccec('0xb')]],'as':_0x8ff6a6['as'],'attributes':_0x8ff6a6[_0xccec('0x7')]};}):[]};}):[]};}):[]:[]})[_0xccec('0xc')](function(_0x1d588f){logger[_0xccec('0xd')](_0xccec('0x4'),_0xa10c6f);logger[_0xccec('0xe')](_0xccec('0x4'),_0xa10c6f,JSON['stringify'](_0x1d588f));_0x4b0fb9(_0x1d588f);})['catch'](function(_0x56b926){logger[_0xccec('0xf')]('GetCmHopper',_0x56b926[_0xccec('0x10')],_0xa10c6f);_0x160675(_0x4b1996[_0xccec('0xf')](0x1f4,_0x56b926[_0xccec('0x10')]));});});};exports['ShowCmHopper']=function(_0x2a78cf){var _0x1f3947=this;return new Promise(function(_0x2c29e0,_0x4a7f08){return db[_0xccec('0x11')][_0xccec('0x12')]({'raw':_0x2a78cf[_0xccec('0x6')]?_0x2a78cf['options'][_0xccec('0x13')]===undefined?!![]:![]:!![],'where':_0x2a78cf['options']?_0x2a78cf[_0xccec('0x6')]['where']||null:null,'attributes':_0x2a78cf[_0xccec('0x6')]?_0x2a78cf[_0xccec('0x6')][_0xccec('0x7')]||null:null,'include':_0x2a78cf[_0xccec('0x6')]?_0x2a78cf[_0xccec('0x6')][_0xccec('0x9')]?_[_0xccec('0xa')](_0x2a78cf[_0xccec('0x6')][_0xccec('0x9')],function(_0x5e5a78){return{'model':db[_0x5e5a78[_0xccec('0xb')]],'as':_0x5e5a78['as'],'attributes':_0x5e5a78[_0xccec('0x7')],'include':_0x5e5a78[_0xccec('0x9')]?_[_0xccec('0xa')](_0x5e5a78['include'],function(_0x27b541){return{'model':db[_0x27b541['model']],'as':_0x27b541['as'],'attributes':_0x27b541['attributes'],'include':_0x27b541['include']?_[_0xccec('0xa')](_0x27b541[_0xccec('0x9')],function(_0x207892){return{'model':db[_0x207892[_0xccec('0xb')]],'as':_0x207892['as'],'attributes':_0x207892[_0xccec('0x7')]};}):[]};}):[]};}):[]:[]})[_0xccec('0xc')](function(_0x3ca9c7){logger['info'](_0xccec('0x14'),_0x2a78cf);logger['debug'](_0xccec('0x14'),_0x2a78cf,JSON[_0xccec('0x15')](_0x3ca9c7));_0x2c29e0(_0x3ca9c7);})['catch'](function(_0x55a53a){logger[_0xccec('0xf')](_0xccec('0x14'),_0x55a53a['message'],_0x2a78cf);_0x4a7f08(_0x1f3947[_0xccec('0xf')](0x1f4,_0x55a53a[_0xccec('0x10')]));});});};exports[_0xccec('0x16')]=function(_0x2dde36){var _0x4b58bf=this;return new Promise(function(_0x3e601a,_0x1bcdd1){return db[_0xccec('0x11')][_0xccec('0x17')](_0x2dde36[_0xccec('0x18')],{'raw':_0x2dde36[_0xccec('0x6')]?_0x2dde36[_0xccec('0x6')][_0xccec('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x2d2be9){logger[_0xccec('0xd')](_0xccec('0x16'),_0x2dde36);logger['debug']('CreateCmHopper',_0x2dde36,JSON[_0xccec('0x15')](_0x2d2be9));_0x3e601a(_0x2d2be9);})[_0xccec('0x19')](function(_0x7b2585){logger[_0xccec('0xf')]('CreateCmHopper',_0x7b2585[_0xccec('0x10')],_0x2dde36);_0x1bcdd1(_0x4b58bf['error'](0x1f4,_0x7b2585['message']));});});};exports[_0xccec('0x1a')]=function(_0x87d6d3){var _0x23527f=this;return new Promise(function(_0x22e7c4,_0x28d3fe){return db[_0xccec('0x11')]['update'](_0x87d6d3['body'],{'raw':_0x87d6d3[_0xccec('0x6')]?_0x87d6d3[_0xccec('0x6')][_0xccec('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x87d6d3[_0xccec('0x6')]?_0x87d6d3['options'][_0xccec('0x1b')]||null:null,'attributes':_0x87d6d3['options']?_0x87d6d3[_0xccec('0x6')][_0xccec('0x7')]||null:null,'limit':_0x87d6d3[_0xccec('0x6')]?_0x87d6d3[_0xccec('0x6')][_0xccec('0x8')]||null:null})['then'](function(_0x2a3a54){logger[_0xccec('0xd')]('UpdateCmHopper',_0x87d6d3);logger[_0xccec('0xd')](_0xccec('0x1c'),JSON[_0xccec('0x15')](_0x87d6d3[_0xccec('0x6')]['where']),_0x87d6d3[_0xccec('0x18')][_0xccec('0x1d')]);logger[_0xccec('0xe')]('UpdateCmHopper',_0x87d6d3,JSON[_0xccec('0x15')](_0x2a3a54));_0x22e7c4(_0x2a3a54);})['catch'](function(_0x256e9b){logger[_0xccec('0xf')](_0xccec('0x1a'),_0x256e9b['message'],_0x87d6d3);_0x28d3fe(_0x23527f['error'](0x1f4,_0x256e9b[_0xccec('0x10')]));});});};exports[_0xccec('0x1e')]=function(_0x1ea36f){var _0x4c0184=this;return new Promise(function(_0x39d61d,_0x1fda09){return db[_0xccec('0x11')]['destroy']({'where':_0x1ea36f[_0xccec('0x6')]?_0x1ea36f[_0xccec('0x6')][_0xccec('0x1b')]||null:null})[_0xccec('0xc')](function(_0x4fc36c){logger['info'](_0xccec('0x1e'),_0x1ea36f);logger[_0xccec('0xe')](_0xccec('0x1e'),_0x1ea36f,JSON['stringify'](_0x4fc36c));_0x39d61d(_0x4fc36c);})[_0xccec('0x19')](function(_0x2be250){logger[_0xccec('0xf')](_0xccec('0x1e'),_0x2be250[_0xccec('0x10')],_0x1ea36f);_0x1fda09(_0x4c0184[_0xccec('0xf')](0x1f4,_0x2be250['message']));});});};exports[_0xccec('0x1f')]=function(_0x18c08c){var _0x441218=this;return new Promise(function(_0x33763e,_0x2d5981){return db[_0xccec('0x20')][_0xccec('0x21')]()[_0xccec('0xc')](function(_0x57c8ab){return db[_0xccec('0x22')][_0xccec('0x23')](function(_0x295872){return db[_0xccec('0x11')]['findAll']({'where':_0x18c08c[_0xccec('0x6')]?_0x18c08c[_0xccec('0x6')][_0xccec('0x1b')]||null:null,'attributes':_0x18c08c['options']?_0x18c08c[_0xccec('0x6')]['attributes']||null:null,'limit':_0x18c08c[_0xccec('0x6')]?_0x18c08c[_0xccec('0x6')][_0xccec('0x8')]||null:null,'order':_0x18c08c['options']?_0x18c08c[_0xccec('0x6')][_0xccec('0x24')]||null:null,'transaction':_0x295872,'lock':_0x295872[_0xccec('0x25')]['UPDATE'],'include':[{'model':db[_0xccec('0x20')],'as':_0xccec('0x26'),'attributes':_[_0xccec('0x27')](_0x57c8ab)},{'model':db[_0xccec('0x28')],'as':_0xccec('0x29'),'attributes':['id','name','voicePause']}]})['then'](function(_0x100de9){var _0x3bf328=[];var _0x373c73=[];for(var _0x45d528=0x0;_0x45d528<_0x100de9[_0xccec('0x2a')];_0x45d528+=0x1){var _0x1b16ed=_0x100de9[_0x45d528]['UserId'];if(_0x1b16ed===null){_0x3bf328[_0xccec('0x2b')](_0x100de9[_0x45d528]['update'](_0x18c08c[_0xccec('0x18')],{'transaction':_0x295872}));}else if(!_0x373c73[_0xccec('0x2c')](_0x1b16ed)){_0x373c73['push'](_0x1b16ed);_0x3bf328[_0xccec('0x2b')](_0x100de9[_0x45d528][_0xccec('0x2d')](_0x18c08c[_0xccec('0x18')],{'transaction':_0x295872}));}}return BPromise[_0xccec('0x2e')](_0x3bf328);});})[_0xccec('0xc')](function(_0x21d8b3){logger[_0xccec('0xd')](_0xccec('0x1f'),_0x18c08c);if(_0x21d8b3['length']>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x21d8b3[0x0][_0xccec('0x2f')]['id'],_0x21d8b3[0x0][_0xccec('0x2f')][_0xccec('0x30')],_0x21d8b3[0x0][_0xccec('0x2f')][_0xccec('0x1d')]);}logger['debug'](_0xccec('0x1f'),_0x18c08c,JSON[_0xccec('0x15')](_0x21d8b3));_0x33763e(_0x21d8b3);})['catch'](function(_0x3cf04d){logger[_0xccec('0xf')](_0xccec('0x1f'),_0x3cf04d['message'],_0x18c08c);_0x2d5981(_0x441218['error'](0x1f4,_0x3cf04d[_0xccec('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x2c0527){var _0x24ddee=this;return new Promise(function(_0x55ee0e,_0x28073c){return db[_0xccec('0x22')][_0xccec('0x23')](function(_0x41766f){return db[_0xccec('0x31')][_0xccec('0x17')](_0x2c0527[_0xccec('0x18')],{'raw':_0x2c0527[_0xccec('0x6')]?_0x2c0527[_0xccec('0x6')][_0xccec('0x13')]===undefined?!![]:![]:!![],'transaction':_0x41766f})[_0xccec('0xc')](function(){logger[_0xccec('0xd')](_0xccec('0x32'),JSON[_0xccec('0x15')](_0x2c0527['options'][_0xccec('0x1b')]),_0x2c0527['options'][_0xccec('0x1b')][_0xccec('0x1d')]);return db[_0xccec('0x11')][_0xccec('0x33')]({'where':_0x2c0527['options']?_0x2c0527['options']['where']||null:null,'transaction':_0x41766f});});})[_0xccec('0xc')](function(_0x26fb3c){logger[_0xccec('0xd')](_0xccec('0x34'),_0x2c0527);logger['debug']('MoveContactManagedDialer',_0x2c0527,JSON['stringify'](_0x26fb3c));_0x55ee0e(_0x26fb3c);})[_0xccec('0x19')](function(_0x5db40d){logger[_0xccec('0xf')](_0xccec('0x34'),_0x5db40d['message'],_0x2c0527);_0x28073c(_0x24ddee[_0xccec('0xf')](0x1f4,_0x5db40d[_0xccec('0x10')]));});});};exports['CountReScheduled']=function(_0x2dc4fc){var _0xaf200b=this;return new Promise(function(_0x31646d,_0x21cf28){return db[_0xccec('0x11')][_0xccec('0x5')]({'raw':_0x2dc4fc[_0xccec('0x6')]?_0x2dc4fc[_0xccec('0x6')][_0xccec('0x13')]===undefined?!![]:![]:!![],'where':_0x2dc4fc[_0xccec('0x6')]?_0x2dc4fc['options'][_0xccec('0x1b')]||null:null,'attributes':[[db[_0xccec('0x22')]['fn'](_0xccec('0x35'),db[_0xccec('0x22')]['fn']('IF',db[_0xccec('0x22')]['literal'](_0xccec('0x36')+util[_0xccec('0x37')](_0xccec('0x38'),moment()['format'](_0xccec('0x39')))+_0xccec('0x3a')))),_0xccec('0x3b')]]})[_0xccec('0xc')](function(_0x52d799){logger[_0xccec('0xd')](_0xccec('0x3c'),_0x2dc4fc);logger[_0xccec('0xe')](_0xccec('0x3c'),_0x2dc4fc,JSON['stringify'](_0x52d799));_0x31646d(_0x52d799);})[_0xccec('0x19')](function(_0x46e4cc){logger[_0xccec('0xf')](_0xccec('0x3c'),_0x46e4cc['message'],_0x2dc4fc);_0x21cf28(_0xaf200b[_0xccec('0xf')](0x1f4,_0x46e4cc[_0xccec('0x10')]));});});};exports[_0xccec('0x3d')]=function(_0x4ed039){var _0x3999f5=this;return new Promise(function(_0x3995ec,_0x4c6fc7){return db[_0xccec('0x20')][_0xccec('0x21')]()[_0xccec('0xc')](function(){return db[_0xccec('0x22')][_0xccec('0x23')](function(_0x5a8b7a){return db[_0xccec('0x11')][_0xccec('0x5')]({'where':_0x4ed039[_0xccec('0x6')]?_0x4ed039['options'][_0xccec('0x1b')]||null:null,'attributes':_0x4ed039[_0xccec('0x6')]?_0x4ed039[_0xccec('0x6')][_0xccec('0x7')]||null:null,'limit':0x1,'order':_0x4ed039[_0xccec('0x6')]?_0x4ed039[_0xccec('0x6')]['order']||null:null,'group':db[_0xccec('0x11')][_0xccec('0x3e')],'transaction':_0x5a8b7a,'lock':_0x5a8b7a[_0xccec('0x25')][_0xccec('0x3f')],'include':_0x4ed039['options']?_0x4ed039[_0xccec('0x6')]['include']?_[_0xccec('0xa')](_0x4ed039[_0xccec('0x6')][_0xccec('0x9')],function(_0x488d60){return{'model':db[_0x488d60[_0xccec('0xb')]],'as':_0x488d60['as'],'attributes':_0x488d60[_0xccec('0x7')],'include':_0x488d60[_0xccec('0x9')]?_['map'](_0x488d60[_0xccec('0x9')],function(_0x443510){return{'model':db[_0x443510[_0xccec('0xb')]],'as':_0x443510['as'],'attributes':_0x443510[_0xccec('0x7')],'include':_0x443510[_0xccec('0x9')]?_['map'](_0x443510['include'],function(_0x186ae0){return{'model':db[_0x186ae0[_0xccec('0xb')]],'as':_0x186ae0['as'],'attributes':_0x186ae0['attributes']};}):[]};}):[]};}):[]:[]})[_0xccec('0xc')](function(_0x4e3558){var _0x46d397=[];for(var _0x9e1035=0x0;_0x9e1035<_0x4e3558[_0xccec('0x2a')];_0x9e1035+=0x1){_0x46d397[_0xccec('0x2b')](_0x4e3558[_0x9e1035][_0xccec('0x2d')](_0x4ed039[_0xccec('0x18')],{'transaction':_0x5a8b7a}));}return BPromise[_0xccec('0x2e')](_0x46d397);});})[_0xccec('0xc')](function(_0x2c47e0){logger['info'](_0xccec('0x3d'),_0x4ed039);logger[_0xccec('0xe')](_0xccec('0x3d'),_0x4ed039,JSON[_0xccec('0x15')](_0x2c47e0));_0x3995ec(_0x2c47e0);})[_0xccec('0x19')](function(_0xfa9a9a){logger['error'](_0xccec('0x3d'),_0xfa9a9a['message'],_0x4ed039);_0x4c6fc7(_0x3999f5[_0xccec('0xf')](0x1f4,_0xfa9a9a[_0xccec('0x10')]));});});});};exports[_0xccec('0x40')]=function(_0x3a5cb6){var _0x558d14=this;return new Promise(function(_0x184ead,_0x3cdf40){db[_0xccec('0x20')]['describe']()[_0xccec('0xc')](function(_0x192a1c){return db[_0xccec('0x11')][_0xccec('0x5')]({'raw':_0x3a5cb6[_0xccec('0x6')]?_0x3a5cb6['options'][_0xccec('0x13')]===undefined?!![]:![]:!![],'where':_0x3a5cb6[_0xccec('0x6')]?_0x3a5cb6['options'][_0xccec('0x1b')]||null:null,'attributes':_0x3a5cb6[_0xccec('0x6')]?_0x3a5cb6[_0xccec('0x6')][_0xccec('0x7')]||null:null,'limit':_0x3a5cb6['options']?_0x3a5cb6[_0xccec('0x6')][_0xccec('0x8')]||null:null,'include':_0x3a5cb6[_0xccec('0x6')]?_0x3a5cb6[_0xccec('0x6')]['include']?_['map'](_0x3a5cb6[_0xccec('0x6')]['include'],function(_0x330f79){return{'model':db[_0x330f79[_0xccec('0xb')]],'as':_0x330f79['as'],'attributes':_0x330f79['as']===_0xccec('0x26')?_[_0xccec('0x27')](_0x192a1c):_0x330f79['attributes'],'include':_0x330f79['include']?_[_0xccec('0xa')](_0x330f79['include'],function(_0x129001){return{'model':db[_0x129001['model']],'as':_0x129001['as'],'attributes':_0x129001[_0xccec('0x7')],'include':_0x129001['include']?_[_0xccec('0xa')](_0x129001[_0xccec('0x9')],function(_0x3358a7){return{'model':db[_0x3358a7[_0xccec('0xb')]],'as':_0x3358a7['as'],'attributes':_0x3358a7[_0xccec('0x7')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3112ad){logger['info'](_0xccec('0x4'),_0x3a5cb6);logger[_0xccec('0xe')](_0xccec('0x4'),_0x3a5cb6,JSON[_0xccec('0x15')](_0x3112ad));_0x184ead(_0x3112ad);})['catch'](function(_0x42abec){logger[_0xccec('0xf')]('GetCmHopper',_0x42abec[_0xccec('0x10')],_0x3a5cb6);_0x3cdf40(_0x558d14[_0xccec('0xf')](0x1f4,_0x42abec[_0xccec('0x10')]));});});});};exports[_0xccec('0x41')]=function(_0x7e7ebd){var _0x15dbd3=this;return new Promise(function(_0x18ada4,_0x37dbc9){return db[_0xccec('0x20')]['findOne']({'raw':!![],'where':{'phone':_0x7e7ebd[_0xccec('0x6')][_0xccec('0x1b')][_0xccec('0x42')]},'attributes':['id',_0xccec('0x43')],'order':[['id','DESC']]})['then'](function(_0x51dbbe){logger[_0xccec('0xd')]('getContactByPhone',_0x7e7ebd);logger[_0xccec('0xe')](_0xccec('0x44'),_0x7e7ebd,JSON[_0xccec('0x15')](_0x51dbbe));_0x18ada4(_0x51dbbe);})[_0xccec('0x19')](function(_0x52cce9){logger[_0xccec('0xf')](_0xccec('0x44'),_0x52cce9[_0xccec('0x10')],_0x7e7ebd);_0x37dbc9(_0x15dbd3[_0xccec('0xf')](0x1f4,_0x52cce9[_0xccec('0x10')]));});});};exports[_0xccec('0x45')]=function(_0x4bdb61){var _0x572e05=this;return new Promise(function(_0x55e7e9,_0x280b04){return db[_0xccec('0x22')][_0xccec('0x23')](function(_0x4ede0c){var _0x4f56ef=_0x4bdb61[_0xccec('0x6')]&&_0x4bdb61[_0xccec('0x6')]['where']?_0x4bdb61[_0xccec('0x6')][_0xccec('0x1b')]:{};return db[_0xccec('0x11')][_0xccec('0x2d')](_0x4bdb61[_0xccec('0x18')],{'where':_0x4f56ef,'transaction':_0x4ede0c})[_0xccec('0xc')](function(_0x1a52dc){logger[_0xccec('0xd')](_0xccec('0x45'),_0x4bdb61);logger[_0xccec('0xe')](_0xccec('0x45'),_0x4bdb61,JSON[_0xccec('0x15')](_0x1a52dc));_0x55e7e9(_0x1a52dc);})[_0xccec('0x19')](function(_0x565174){logger['error'](_0xccec('0x45'),_0x565174[_0xccec('0x10')],_0x4bdb61);_0x280b04(_0x572e05[_0xccec('0xf')](0x1f4,_0x565174[_0xccec('0x10')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x52f724){var _0x547ab0=this;var _0x5d31d2=_0x52f724[_0xccec('0x18')][_0xccec('0x1b')]['voiceQueueIds'];var _0x298fd7=_0x52f724[_0xccec('0x18')][_0xccec('0x1b')][_0xccec('0x46')];var _0x438d45=_0x52f724[_0xccec('0x18')]['where'][_0xccec('0x47')];return new Promise(function(_0x3287e4,_0x49b6c9){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x5d31d2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xccec('0x22')][_0xccec('0x48')](_0xccec('0x49')+_0x298fd7+_0xccec('0x4a')),'$gt':db[_0xccec('0x22')]['literal'](_0xccec('0x4b'))}},'UserId':{'$in':_0x438d45}},'include':[{'model':db[_0xccec('0x20')],'as':_0xccec('0x26')},{'model':db['User'],'as':'Agent','attributes':['id',_0xccec('0x4c'),_0xccec('0x4d')]},{'model':db[_0xccec('0x4e')],'as':'List'}]})['then'](function(_0x412851){if(_0x412851[_0xccec('0x2a')]>0x0){return db['sequelize'][_0xccec('0x23')](function(_0x17353a){return db[_0xccec('0x11')]['update']({'recallmeNotifiedDate':db[_0xccec('0x22')][_0xccec('0x48')](_0xccec('0x4b'))},{'where':{'id':{'$in':_[_0xccec('0xa')](_0x412851,'id')}},'transaction':_0x17353a})['then'](function(){_0x3287e4(_0x412851);})['catch'](function(_0x21b7b1){logger[_0xccec('0xf')](_0xccec('0x4f'),_0x21b7b1[_0xccec('0x10')],_0x52f724);_0x49b6c9(_0x547ab0[_0xccec('0xf')](0x1f4,_0x21b7b1['message']));});})[_0xccec('0x19')](function(_0xb7ffd2){logger['error'](_0xccec('0x4f'),_0xb7ffd2['message'],_0x52f724);_0x49b6c9(_0x547ab0[_0xccec('0xf')](0x1f4,_0xb7ffd2[_0xccec('0x10')]));});}else{_0x3287e4(_0x412851);}});});};
\ No newline at end of file
index 971f398..df6f33f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9774=['getTimezone','/:id','update','delete','exports','Router','../../components/auth/service','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id/previewrecall','getPreviewRecall','create','/preview','getPreview'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0x9774,0x1d1));var _0x4977=function(_0x6840b8,_0x160177){_0x6840b8=_0x6840b8-0x0;var _0x1f12f7=_0x9774[_0x6840b8];return _0x1f12f7;};'use strict';var express=require('express');var router=express[_0x4977('0x0')]();var auth=require(_0x4977('0x1'));var controller=require('./cmHopper.controller');router[_0x4977('0x2')]('/',auth[_0x4977('0x3')](),controller[_0x4977('0x4')]);router[_0x4977('0x2')]('/describe',auth[_0x4977('0x3')](),controller[_0x4977('0x5')]);router[_0x4977('0x2')](_0x4977('0x6'),auth[_0x4977('0x3')](),controller[_0x4977('0x7')]);router[_0x4977('0x2')](_0x4977('0x8'),auth[_0x4977('0x3')](),controller[_0x4977('0x9')]);router[_0x4977('0x2')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4977('0x2')](_0x4977('0xa'),auth[_0x4977('0x3')](),controller[_0x4977('0xb')]);router['post']('/',auth[_0x4977('0x3')](),controller[_0x4977('0xc')]);router['post'](_0x4977('0xd'),auth[_0x4977('0x3')](),controller[_0x4977('0xe')]);router['post']('/timezone',auth[_0x4977('0x3')](),controller[_0x4977('0xf')]);router['put'](_0x4977('0x10'),auth[_0x4977('0x3')](),controller[_0x4977('0x11')]);router[_0x4977('0x12')](_0x4977('0x10'),auth[_0x4977('0x3')](),controller['destroy']);module[_0x4977('0x13')]=router;
\ No newline at end of file
+var _0x39de=['/:id','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','put','update','exports','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','getOpenContacts','/timezones','getTimezones'];(function(_0x41fada,_0x3302e9){var _0x4bf00b=function(_0xa1847d){while(--_0xa1847d){_0x41fada['push'](_0x41fada['shift']());}};_0x4bf00b(++_0x3302e9);}(_0x39de,0x14a));var _0xe39d=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x39de[_0x3f5dca];return _0x5b833a;};'use strict';var express=require('express');var router=express[_0xe39d('0x0')]();var auth=require(_0xe39d('0x1'));var controller=require('./cmHopper.controller');router[_0xe39d('0x2')]('/',auth['isAuthenticated'](),controller[_0xe39d('0x3')]);router[_0xe39d('0x2')](_0xe39d('0x4'),auth[_0xe39d('0x5')](),controller[_0xe39d('0x6')]);router[_0xe39d('0x2')]('/opencontacts',auth[_0xe39d('0x5')](),controller[_0xe39d('0x7')]);router[_0xe39d('0x2')](_0xe39d('0x8'),auth[_0xe39d('0x5')](),controller[_0xe39d('0x9')]);router[_0xe39d('0x2')](_0xe39d('0xa'),auth[_0xe39d('0x5')](),controller['show']);router[_0xe39d('0x2')](_0xe39d('0xb'),auth['isAuthenticated'](),controller[_0xe39d('0xc')]);router[_0xe39d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe39d('0xd')](_0xe39d('0xe'),auth[_0xe39d('0x5')](),controller[_0xe39d('0xf')]);router[_0xe39d('0xd')](_0xe39d('0x10'),auth[_0xe39d('0x5')](),controller['getTimezone']);router[_0xe39d('0x11')]('/:id',auth[_0xe39d('0x5')](),controller[_0xe39d('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe39d('0x13')]=router;
\ No newline at end of file
index 37a79c1..4dcc263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd459=['exports','INTEGER','STRING','DATE','format','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd459,0x186));var _0x9d45=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xd459[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0x9d45('0x0'));var Sequelize=require(_0x9d45('0x1'));module[_0x9d45('0x2')]={'CmHopperId':{'type':Sequelize[_0x9d45('0x3')]},'phone':{'type':Sequelize[_0x9d45('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9d45('0x5')],'defaultValue':moment()[_0x9d45('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9d45('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf2c9=['format','moment','exports','INTEGER','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c9,0xaf));var _0x9f2c=function(_0x24fb94,_0x2b18bf){_0x24fb94=_0x24fb94-0x0;var _0x2ade56=_0xf2c9[_0x24fb94];return _0x2ade56;};'use strict';var moment=require(_0x9f2c('0x0'));var Sequelize=require('sequelize');module[_0x9f2c('0x1')]={'CmHopperId':{'type':Sequelize[_0x9f2c('0x2')]},'phone':{'type':Sequelize[_0x9f2c('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9f2c('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9f2c('0x4')],'defaultValue':moment()[_0x9f2c('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9f2c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9f2c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9f2c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9f2c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 20fc619..4cbc75f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67e8=['model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x59fa4d,_0x501edf){var _0x15b350=function(_0x32d0c9){while(--_0x32d0c9){_0x59fa4d['push'](_0x59fa4d['shift']());}};_0x15b350(++_0x501edf);}(_0x67e8,0x181));var _0x867e=function(_0x18917a,_0x526f95){_0x18917a=_0x18917a-0x0;var _0x46418b=_0x67e8[_0x18917a];return _0x46418b;};'use strict';var emlformat=require(_0x867e('0x0'));var rimraf=require(_0x867e('0x1'));var zipdir=require(_0x867e('0x2'));var jsonpatch=require(_0x867e('0x3'));var rp=require(_0x867e('0x4'));var moment=require('moment');var BPromise=require(_0x867e('0x5'));var Mustache=require(_0x867e('0x6'));var util=require(_0x867e('0x7'));var path=require(_0x867e('0x8'));var sox=require(_0x867e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x867e('0xa'));var _=require(_0x867e('0xb'));var squel=require(_0x867e('0xc'));var crypto=require(_0x867e('0xd'));var jsforce=require(_0x867e('0xe'));var deskjs=require(_0x867e('0xf'));var toCsv=require(_0x867e('0x10'));var querystring=require(_0x867e('0x11'));var Papa=require(_0x867e('0x12'));var Redis=require(_0x867e('0x13'));var authService=require(_0x867e('0x14'));var qs=require(_0x867e('0x15'));var as=require(_0x867e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x867e('0x17'))(_0x867e('0x18'));var utils=require(_0x867e('0x19'));var config=require(_0x867e('0x1a'));var licenseUtil=require(_0x867e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e8c0a,_0x2c6ebc){_0x2c6ebc=_0x2c6ebc||0xcc;return function(_0x13fca6){if(_0x13fca6){return _0x1e8c0a[_0x867e('0x1c')](_0x2c6ebc);}return _0x1e8c0a[_0x867e('0x1d')](_0x2c6ebc)['end']();};}function respondWithResult(_0x4511c1,_0x287c4e){_0x287c4e=_0x287c4e||0xc8;return function(_0x57a6d1){if(_0x57a6d1){return _0x4511c1[_0x867e('0x1d')](_0x287c4e)['json'](_0x57a6d1);}};}function respondWithFilteredResult(_0x3d5a97,_0x31963c){return function(_0x27164b){if(_0x27164b){var _0x532116=typeof _0x31963c[_0x867e('0x1e')]==='undefined'&&typeof _0x31963c[_0x867e('0x1f')]===_0x867e('0x20');var _0xd5c56=_0x27164b[_0x867e('0x21')];var _0x2cbbed=_0x532116?0x0:_0x31963c[_0x867e('0x1e')];var _0x41960b=_0x532116?_0x27164b[_0x867e('0x21')]:_0x31963c[_0x867e('0x1e')]+_0x31963c[_0x867e('0x1f')];var _0xd1423f;if(_0x41960b>=_0xd5c56){_0x41960b=_0xd5c56;_0xd1423f=0xc8;}else{_0xd1423f=0xce;}_0x3d5a97['status'](_0xd1423f);return _0x3d5a97[_0x867e('0x22')](_0x867e('0x23'),_0x2cbbed+'-'+_0x41960b+'/'+_0xd5c56)[_0x867e('0x24')](_0x27164b);}return null;};}function patchUpdates(_0xfa6b02){return function(_0x54dea1){try{jsonpatch[_0x867e('0x25')](_0x54dea1,_0xfa6b02,!![]);}catch(_0x197767){return BPromise['reject'](_0x197767);}return _0x54dea1[_0x867e('0x26')]();};}function saveUpdates(_0x41cf60,_0xd34b97){return function(_0x5df6ba){if(_0x5df6ba){return _0x5df6ba[_0x867e('0x27')](_0x41cf60)[_0x867e('0x28')](function(_0x3029e4){return _0x3029e4;});}return null;};}function removeEntity(_0x5b2a3f,_0x4eedf8){return function(_0x43d214){if(_0x43d214){return _0x43d214[_0x867e('0x29')]()[_0x867e('0x28')](function(){var _0x17d29e=_0x43d214[_0x867e('0x2a')]({'plain':!![]});var _0x2adfb8='CmHopperAdditionalPhones';return db[_0x867e('0x2b')][_0x867e('0x29')]({'where':{'type':_0x2adfb8,'resourceId':_0x17d29e['id']}})[_0x867e('0x28')](function(){return _0x43d214;});})[_0x867e('0x28')](function(){_0x5b2a3f[_0x867e('0x1d')](0xcc)[_0x867e('0x2c')]();});}};}function handleEntityNotFound(_0x188caa,_0x59ff48){return function(_0x56c09b){if(!_0x56c09b){_0x188caa[_0x867e('0x1c')](0x194);}return _0x56c09b;};}function handleError(_0x5118d9,_0x4cfd03){_0x4cfd03=_0x4cfd03||0x1f4;return function(_0x1c4a66){logger[_0x867e('0x2d')](_0x1c4a66[_0x867e('0x2e')]);if(_0x1c4a66['name']){delete _0x1c4a66[_0x867e('0x2f')];}_0x5118d9[_0x867e('0x1d')](_0x4cfd03)[_0x867e('0x30')](_0x1c4a66);};}exports[_0x867e('0x31')]=function(_0x440516,_0x59de4c){var _0x3da44c={},_0xd5fd26={},_0x41fd95={'count':0x0,'rows':[]};var _0x44d96c=_[_0x867e('0x32')](db['CmHopperAdditionalPhone'][_0x867e('0x33')],function(_0x2c07f4){return{'name':_0x2c07f4[_0x867e('0x34')],'type':_0x2c07f4[_0x867e('0x35')][_0x867e('0x36')]};});_0xd5fd26[_0x867e('0x37')]=_[_0x867e('0x32')](_0x44d96c,_0x867e('0x2f'));_0xd5fd26[_0x867e('0x38')]=_['keys'](_0x440516['query']);_0xd5fd26['filters']=_[_0x867e('0x39')](_0xd5fd26['model'],_0xd5fd26['query']);_0x3da44c[_0x867e('0x3a')]=_[_0x867e('0x39')](_0xd5fd26[_0x867e('0x37')],qs[_0x867e('0x3b')](_0x440516[_0x867e('0x38')]['fields']));_0x3da44c[_0x867e('0x3a')]=_0x3da44c[_0x867e('0x3a')]['length']?_0x3da44c['attributes']:_0xd5fd26[_0x867e('0x37')];if(!_0x440516[_0x867e('0x38')][_0x867e('0x3c')](_0x867e('0x3d'))){_0x3da44c['limit']=qs['limit'](_0x440516[_0x867e('0x38')][_0x867e('0x1f')]);_0x3da44c[_0x867e('0x1e')]=qs['offset'](_0x440516[_0x867e('0x38')]['offset']);}_0x3da44c[_0x867e('0x3e')]=qs[_0x867e('0x3f')](_0x440516[_0x867e('0x38')][_0x867e('0x3f')]);_0x3da44c[_0x867e('0x40')]=qs['filters'](_['pick'](_0x440516[_0x867e('0x38')],_0xd5fd26[_0x867e('0x41')]),_0x44d96c);if(_0x440516[_0x867e('0x38')]['filter']){_0x3da44c[_0x867e('0x40')]=_[_0x867e('0x42')](_0x3da44c[_0x867e('0x40')],{'$or':_[_0x867e('0x32')](_0x44d96c,function(_0xebbb01){if(_0xebbb01['type']!==_0x867e('0x43')){var _0x358f6a={};_0x358f6a[_0xebbb01['name']]={'$like':'%'+_0x440516['query'][_0x867e('0x44')]+'%'};return _0x358f6a;}})});}_0x3da44c=_[_0x867e('0x42')]({},_0x3da44c,_0x440516[_0x867e('0x45')]);var _0x31e633={'where':_0x3da44c[_0x867e('0x40')]};return db[_0x867e('0x46')]['count'](_0x31e633)[_0x867e('0x28')](function(_0x4a0b18){_0x41fd95[_0x867e('0x21')]=_0x4a0b18;if(_0x440516[_0x867e('0x38')][_0x867e('0x47')]){_0x3da44c[_0x867e('0x48')]=[{'all':!![]}];}return db[_0x867e('0x46')][_0x867e('0x49')](_0x3da44c);})[_0x867e('0x28')](function(_0x502557){_0x41fd95[_0x867e('0x4a')]=_0x502557;return _0x41fd95;})[_0x867e('0x28')](respondWithFilteredResult(_0x59de4c,_0x3da44c))[_0x867e('0x4b')](handleError(_0x59de4c,null));};exports[_0x867e('0x4c')]=function(_0x383515,_0x1da443){var _0x5e323a={'raw':!![],'where':{'id':_0x383515['params']['id']}},_0x526380={};_0x526380['model']=_[_0x867e('0x4d')](db[_0x867e('0x46')]['rawAttributes']);_0x526380[_0x867e('0x38')]=_[_0x867e('0x4d')](_0x383515[_0x867e('0x38')]);_0x526380[_0x867e('0x41')]=_[_0x867e('0x39')](_0x526380['model'],_0x526380['query']);_0x5e323a[_0x867e('0x3a')]=_[_0x867e('0x39')](_0x526380[_0x867e('0x37')],qs['fields'](_0x383515['query']['fields']));_0x5e323a[_0x867e('0x3a')]=_0x5e323a[_0x867e('0x3a')]['length']?_0x5e323a[_0x867e('0x3a')]:_0x526380[_0x867e('0x37')];if(_0x383515[_0x867e('0x38')][_0x867e('0x47')]){_0x5e323a[_0x867e('0x48')]=[{'all':!![]}];}_0x5e323a=_[_0x867e('0x42')]({},_0x5e323a,_0x383515[_0x867e('0x45')]);return db[_0x867e('0x46')]['find'](_0x5e323a)['then'](handleEntityNotFound(_0x1da443,null))[_0x867e('0x28')](respondWithResult(_0x1da443,null))['catch'](handleError(_0x1da443,null));};exports['create']=function(_0x431a09,_0x3a196c){return db[_0x867e('0x46')][_0x867e('0x4e')](_0x431a09[_0x867e('0x4f')],{})[_0x867e('0x28')](function(_0x55fac5){var _0x3b3a57=_0x431a09['user'][_0x867e('0x2a')]({'plain':!![]});if(!_0x3b3a57)throw new Error(_0x867e('0x50'));if(_0x3b3a57['role']===_0x867e('0x51')){var _0x4807ec=_0x55fac5[_0x867e('0x2a')]({'plain':!![]});var _0xb41c3c='CmHopperAdditionalPhones';return db[_0x867e('0x52')][_0x867e('0x53')]({'where':{'name':_0xb41c3c,'userProfileId':_0x3b3a57[_0x867e('0x54')]},'raw':!![]})[_0x867e('0x28')](function(_0xb98eaf){if(_0xb98eaf&&_0xb98eaf[_0x867e('0x55')]===0x0){return db[_0x867e('0x2b')]['create']({'name':_0x4807ec['name'],'resourceId':_0x4807ec['id'],'type':_0xb98eaf['name'],'sectionId':_0xb98eaf['id']},{})['then'](function(){return _0x55fac5;});}else{return _0x55fac5;}})['catch'](function(_0x252575){logger[_0x867e('0x2d')](_0x867e('0x56'),_0x252575);throw _0x252575;});}return _0x55fac5;})[_0x867e('0x28')](respondWithResult(_0x3a196c,0xc9))[_0x867e('0x4b')](handleError(_0x3a196c,null));};exports[_0x867e('0x27')]=function(_0x32082f,_0x590f8a){if(_0x32082f['body']['id']){delete _0x32082f[_0x867e('0x4f')]['id'];}return db[_0x867e('0x46')][_0x867e('0x53')]({'where':{'id':_0x32082f[_0x867e('0x57')]['id']}})[_0x867e('0x28')](handleEntityNotFound(_0x590f8a,null))[_0x867e('0x28')](saveUpdates(_0x32082f[_0x867e('0x4f')],null))[_0x867e('0x28')](respondWithResult(_0x590f8a,null))[_0x867e('0x4b')](handleError(_0x590f8a,null));};exports['destroy']=function(_0x59f06e,_0x197214){return db[_0x867e('0x46')][_0x867e('0x53')]({'where':{'id':_0x59f06e[_0x867e('0x57')]['id']}})[_0x867e('0x28')](handleEntityNotFound(_0x197214,null))[_0x867e('0x28')](removeEntity(_0x197214,null))['catch'](handleError(_0x197214,null));};
\ No newline at end of file
+var _0xf73c=['options','includeAll','include','CmHopperAdditionalPhone','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x2cb4b6,_0xbe1953){var _0x32449e=function(_0x4ce91a){while(--_0x4ce91a){_0x2cb4b6['push'](_0x2cb4b6['shift']());}};_0x32449e(++_0xbe1953);}(_0xf73c,0x68));var _0xcf73=function(_0x1fa89d,_0x4078c4){_0x1fa89d=_0x1fa89d-0x0;var _0x1deaa3=_0xf73c[_0x1fa89d];return _0x1deaa3;};'use strict';var emlformat=require(_0xcf73('0x0'));var rimraf=require(_0xcf73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcf73('0x2'));var moment=require(_0xcf73('0x3'));var BPromise=require(_0xcf73('0x4'));var Mustache=require(_0xcf73('0x5'));var util=require(_0xcf73('0x6'));var path=require(_0xcf73('0x7'));var sox=require(_0xcf73('0x8'));var csv=require('to-csv');var ejs=require(_0xcf73('0x9'));var fs=require('fs');var fs_extra=require(_0xcf73('0xa'));var _=require(_0xcf73('0xb'));var squel=require(_0xcf73('0xc'));var crypto=require(_0xcf73('0xd'));var jsforce=require(_0xcf73('0xe'));var deskjs=require(_0xcf73('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf73('0x10'));var Papa=require('papaparse');var Redis=require(_0xcf73('0x11'));var authService=require(_0xcf73('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf73('0x13'));var logger=require(_0xcf73('0x14'))(_0xcf73('0x15'));var utils=require('../../config/utils');var config=require(_0xcf73('0x16'));var licenseUtil=require(_0xcf73('0x17'));var db=require(_0xcf73('0x18'))['db'];function respondWithStatusCode(_0x439d0f,_0x323980){_0x323980=_0x323980||0xcc;return function(_0xcf05d3){if(_0xcf05d3){return _0x439d0f[_0xcf73('0x19')](_0x323980);}return _0x439d0f[_0xcf73('0x1a')](_0x323980)[_0xcf73('0x1b')]();};}function respondWithResult(_0xba154e,_0x1e1989){_0x1e1989=_0x1e1989||0xc8;return function(_0x4bfdab){if(_0x4bfdab){return _0xba154e['status'](_0x1e1989)[_0xcf73('0x1c')](_0x4bfdab);}};}function respondWithFilteredResult(_0x3b9f0d,_0x116e59){return function(_0x5b9e48){if(_0x5b9e48){var _0x397ea1=typeof _0x116e59['offset']===_0xcf73('0x1d')&&typeof _0x116e59[_0xcf73('0x1e')]===_0xcf73('0x1d');var _0x3cb1c0=_0x5b9e48['count'];var _0x429ddb=_0x397ea1?0x0:_0x116e59['offset'];var _0x3a4968=_0x397ea1?_0x5b9e48[_0xcf73('0x1f')]:_0x116e59[_0xcf73('0x20')]+_0x116e59[_0xcf73('0x1e')];var _0x534d5e;if(_0x3a4968>=_0x3cb1c0){_0x3a4968=_0x3cb1c0;_0x534d5e=0xc8;}else{_0x534d5e=0xce;}_0x3b9f0d[_0xcf73('0x1a')](_0x534d5e);return _0x3b9f0d[_0xcf73('0x21')](_0xcf73('0x22'),_0x429ddb+'-'+_0x3a4968+'/'+_0x3cb1c0)[_0xcf73('0x1c')](_0x5b9e48);}return null;};}function patchUpdates(_0x135edb){return function(_0x12089d){try{jsonpatch[_0xcf73('0x23')](_0x12089d,_0x135edb,!![]);}catch(_0x54b44e){return BPromise[_0xcf73('0x24')](_0x54b44e);}return _0x12089d['save']();};}function saveUpdates(_0x28fcdd,_0x1b59c1){return function(_0x46d19a){if(_0x46d19a){return _0x46d19a['update'](_0x28fcdd)[_0xcf73('0x25')](function(_0x924979){return _0x924979;});}return null;};}function removeEntity(_0x566964,_0xa08ffd){return function(_0x3067f4){if(_0x3067f4){return _0x3067f4[_0xcf73('0x26')]()[_0xcf73('0x25')](function(){var _0xadd98d=_0x3067f4[_0xcf73('0x27')]({'plain':!![]});var _0x4ccd8f='CmHopperAdditionalPhones';return db[_0xcf73('0x28')]['destroy']({'where':{'type':_0x4ccd8f,'resourceId':_0xadd98d['id']}})[_0xcf73('0x25')](function(){return _0x3067f4;});})[_0xcf73('0x25')](function(){_0x566964['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47587b,_0x2d1779){return function(_0x11a7d7){if(!_0x11a7d7){_0x47587b['sendStatus'](0x194);}return _0x11a7d7;};}function handleError(_0x5e4581,_0x40f462){_0x40f462=_0x40f462||0x1f4;return function(_0x48ee47){logger['error'](_0x48ee47[_0xcf73('0x29')]);if(_0x48ee47[_0xcf73('0x2a')]){delete _0x48ee47[_0xcf73('0x2a')];}_0x5e4581[_0xcf73('0x1a')](_0x40f462)['send'](_0x48ee47);};}exports[_0xcf73('0x2b')]=function(_0x3d751e,_0x52050c){var _0x2c418c={},_0x3ca4aa={},_0x5824c9={'count':0x0,'rows':[]};var _0x5b4ef1=_[_0xcf73('0x2c')](db['CmHopperAdditionalPhone'][_0xcf73('0x2d')],function(_0x1bc1ae){return{'name':_0x1bc1ae[_0xcf73('0x2e')],'type':_0x1bc1ae['type']['key']};});_0x3ca4aa[_0xcf73('0x2f')]=_[_0xcf73('0x2c')](_0x5b4ef1,_0xcf73('0x2a'));_0x3ca4aa[_0xcf73('0x30')]=_[_0xcf73('0x31')](_0x3d751e[_0xcf73('0x30')]);_0x3ca4aa[_0xcf73('0x32')]=_[_0xcf73('0x33')](_0x3ca4aa[_0xcf73('0x2f')],_0x3ca4aa['query']);_0x2c418c[_0xcf73('0x34')]=_['intersection'](_0x3ca4aa['model'],qs[_0xcf73('0x35')](_0x3d751e[_0xcf73('0x30')]['fields']));_0x2c418c[_0xcf73('0x34')]=_0x2c418c[_0xcf73('0x34')][_0xcf73('0x36')]?_0x2c418c['attributes']:_0x3ca4aa[_0xcf73('0x2f')];if(!_0x3d751e[_0xcf73('0x30')][_0xcf73('0x37')]('nolimit')){_0x2c418c[_0xcf73('0x1e')]=qs[_0xcf73('0x1e')](_0x3d751e['query'][_0xcf73('0x1e')]);_0x2c418c[_0xcf73('0x20')]=qs['offset'](_0x3d751e[_0xcf73('0x30')][_0xcf73('0x20')]);}_0x2c418c[_0xcf73('0x38')]=qs['sort'](_0x3d751e['query'][_0xcf73('0x39')]);_0x2c418c[_0xcf73('0x3a')]=qs[_0xcf73('0x32')](_[_0xcf73('0x3b')](_0x3d751e[_0xcf73('0x30')],_0x3ca4aa[_0xcf73('0x32')]),_0x5b4ef1);if(_0x3d751e[_0xcf73('0x30')][_0xcf73('0x3c')]){_0x2c418c[_0xcf73('0x3a')]=_[_0xcf73('0x3d')](_0x2c418c[_0xcf73('0x3a')],{'$or':_[_0xcf73('0x2c')](_0x5b4ef1,function(_0x5b50c2){if(_0x5b50c2[_0xcf73('0x3e')]!==_0xcf73('0x3f')){var _0x5bdce4={};_0x5bdce4[_0x5b50c2[_0xcf73('0x2a')]]={'$like':'%'+_0x3d751e[_0xcf73('0x30')][_0xcf73('0x3c')]+'%'};return _0x5bdce4;}})});}_0x2c418c=_[_0xcf73('0x3d')]({},_0x2c418c,_0x3d751e[_0xcf73('0x40')]);var _0x213205={'where':_0x2c418c[_0xcf73('0x3a')]};return db['CmHopperAdditionalPhone']['count'](_0x213205)[_0xcf73('0x25')](function(_0x40cf87){_0x5824c9[_0xcf73('0x1f')]=_0x40cf87;if(_0x3d751e[_0xcf73('0x30')][_0xcf73('0x41')]){_0x2c418c[_0xcf73('0x42')]=[{'all':!![]}];}return db[_0xcf73('0x43')][_0xcf73('0x44')](_0x2c418c);})[_0xcf73('0x25')](function(_0x588ccd){_0x5824c9[_0xcf73('0x45')]=_0x588ccd;return _0x5824c9;})[_0xcf73('0x25')](respondWithFilteredResult(_0x52050c,_0x2c418c))[_0xcf73('0x46')](handleError(_0x52050c,null));};exports[_0xcf73('0x47')]=function(_0x4b0767,_0x78d19f){var _0x288140={'raw':!![],'where':{'id':_0x4b0767['params']['id']}},_0x3b335a={};_0x3b335a[_0xcf73('0x2f')]=_[_0xcf73('0x31')](db[_0xcf73('0x43')]['rawAttributes']);_0x3b335a['query']=_[_0xcf73('0x31')](_0x4b0767[_0xcf73('0x30')]);_0x3b335a[_0xcf73('0x32')]=_[_0xcf73('0x33')](_0x3b335a[_0xcf73('0x2f')],_0x3b335a[_0xcf73('0x30')]);_0x288140['attributes']=_[_0xcf73('0x33')](_0x3b335a['model'],qs[_0xcf73('0x35')](_0x4b0767[_0xcf73('0x30')]['fields']));_0x288140['attributes']=_0x288140[_0xcf73('0x34')]['length']?_0x288140[_0xcf73('0x34')]:_0x3b335a['model'];if(_0x4b0767[_0xcf73('0x30')][_0xcf73('0x41')]){_0x288140[_0xcf73('0x42')]=[{'all':!![]}];}_0x288140=_[_0xcf73('0x3d')]({},_0x288140,_0x4b0767[_0xcf73('0x40')]);return db[_0xcf73('0x43')][_0xcf73('0x48')](_0x288140)[_0xcf73('0x25')](handleEntityNotFound(_0x78d19f,null))[_0xcf73('0x25')](respondWithResult(_0x78d19f,null))['catch'](handleError(_0x78d19f,null));};exports[_0xcf73('0x49')]=function(_0x4a014c,_0x45124a){return db['CmHopperAdditionalPhone'][_0xcf73('0x49')](_0x4a014c[_0xcf73('0x4a')],{})[_0xcf73('0x25')](function(_0x427e3b){var _0x31d5cb=_0x4a014c[_0xcf73('0x4b')][_0xcf73('0x27')]({'plain':!![]});if(!_0x31d5cb)throw new Error(_0xcf73('0x4c'));if(_0x31d5cb[_0xcf73('0x4d')]==='user'){var _0x1fefcc=_0x427e3b['get']({'plain':!![]});var _0x2de36e=_0xcf73('0x4e');return db['UserProfileSection'][_0xcf73('0x48')]({'where':{'name':_0x2de36e,'userProfileId':_0x31d5cb[_0xcf73('0x4f')]},'raw':!![]})[_0xcf73('0x25')](function(_0x46f1d7){if(_0x46f1d7&&_0x46f1d7[_0xcf73('0x50')]===0x0){return db[_0xcf73('0x28')][_0xcf73('0x49')]({'name':_0x1fefcc[_0xcf73('0x2a')],'resourceId':_0x1fefcc['id'],'type':_0x46f1d7['name'],'sectionId':_0x46f1d7['id']},{})[_0xcf73('0x25')](function(){return _0x427e3b;});}else{return _0x427e3b;}})['catch'](function(_0x4901f7){logger['error'](_0xcf73('0x51'),_0x4901f7);throw _0x4901f7;});}return _0x427e3b;})['then'](respondWithResult(_0x45124a,0xc9))[_0xcf73('0x46')](handleError(_0x45124a,null));};exports[_0xcf73('0x52')]=function(_0xfac497,_0xd56f8a){if(_0xfac497[_0xcf73('0x4a')]['id']){delete _0xfac497[_0xcf73('0x4a')]['id'];}return db[_0xcf73('0x43')][_0xcf73('0x48')]({'where':{'id':_0xfac497[_0xcf73('0x53')]['id']}})[_0xcf73('0x25')](handleEntityNotFound(_0xd56f8a,null))[_0xcf73('0x25')](saveUpdates(_0xfac497[_0xcf73('0x4a')],null))[_0xcf73('0x25')](respondWithResult(_0xd56f8a,null))['catch'](handleError(_0xd56f8a,null));};exports[_0xcf73('0x26')]=function(_0x5639c4,_0x248e87){return db[_0xcf73('0x43')][_0xcf73('0x48')]({'where':{'id':_0x5639c4[_0xcf73('0x53')]['id']}})['then'](handleEntityNotFound(_0x248e87,null))[_0xcf73('0x25')](removeEntity(_0x248e87,null))[_0xcf73('0x46')](handleError(_0x248e87,null));};
\ No newline at end of file
index 4807b06..e0774a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd011=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x3c1881,_0x37deb1){var _0x267501=function(_0x416004){while(--_0x416004){_0x3c1881['push'](_0x3c1881['shift']());}};_0x267501(++_0x37deb1);}(_0xd011,0xc6));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d01('0x0'));var util=require(_0x1d01('0x1'));var logger=require('../../config/logger')(_0x1d01('0x2'));var moment=require(_0x1d01('0x3'));var BPromise=require(_0x1d01('0x4'));var rp=require(_0x1d01('0x5'));var fs=require('fs');var path=require(_0x1d01('0x6'));var rimraf=require(_0x1d01('0x7'));var config=require(_0x1d01('0x8'));var attributes=require(_0x1d01('0x9'));module['exports']=function(_0x4afecd,_0x114552){return _0x4afecd[_0x1d01('0xa')](_0x1d01('0xb'),attributes,{'tableName':_0x1d01('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x42a8=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','lodash','util'];(function(_0x35731c,_0x5ab1d1){var _0x2f2957=function(_0x2d6583){while(--_0x2d6583){_0x35731c['push'](_0x35731c['shift']());}};_0x2f2957(++_0x5ab1d1);}(_0x42a8,0x18a));var _0x842a=function(_0x392cc6,_0x3031f7){_0x392cc6=_0x392cc6-0x0;var _0x3f9f22=_0x42a8[_0x392cc6];return _0x3f9f22;};'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':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52cde3c..42bd73a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4899=['IncrementPreviewCounters','field','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','ContactId','duration','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone'];(function(_0x171539,_0x2653e1){var _0x506a1b=function(_0x517ec4){while(--_0x517ec4){_0x171539['push'](_0x171539['shift']());}};_0x506a1b(++_0x2653e1);}(_0x4899,0x74));var _0x9489=function(_0x43ed4f,_0x8bdc9e){_0x43ed4f=_0x43ed4f-0x0;var _0x14e913=_0x4899[_0x43ed4f];return _0x14e913;};'use strict';var _=require(_0x9489('0x0'));var util=require('util');var moment=require(_0x9489('0x1'));var BPromise=require('bluebird');var rs=require(_0x9489('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9489('0x3'))['db'];var utils=require(_0x9489('0x4'));var logger=require(_0x9489('0x5'))(_0x9489('0x6'));var config=require(_0x9489('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9489('0x8')][_0x9489('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x411ebe,_0x31e8c3,_0x574279){return new BPromise(function(_0x553c77,_0x1379eb){return client['request'](_0x411ebe,_0x574279)[_0x9489('0xa')](function(_0xb426d8){logger['info'](_0x9489('0xb'),_0x31e8c3,_0x9489('0xc'));logger[_0x9489('0xd')](_0x9489('0xe'),_0x31e8c3,_0x9489('0xc'),JSON[_0x9489('0xf')](_0xb426d8));if(_0xb426d8[_0x9489('0x10')]){if(_0xb426d8[_0x9489('0x10')]['code']===0x1f4){logger[_0x9489('0x10')](_0x9489('0xb'),_0x31e8c3,_0xb426d8[_0x9489('0x10')]['message']);return _0x1379eb(_0xb426d8['error'][_0x9489('0x11')]);}logger[_0x9489('0x10')](_0x9489('0xb'),_0x31e8c3,_0xb426d8['error'][_0x9489('0x11')]);return _0x553c77(_0xb426d8['error'][_0x9489('0x11')]);}else{logger['info'](_0x9489('0xb'),_0x31e8c3,_0x9489('0xc'));_0x553c77(_0xb426d8[_0x9489('0x12')][_0x9489('0x11')]);}})[_0x9489('0x13')](function(_0x4c1389){logger[_0x9489('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x31e8c3,_0x4c1389);_0x1379eb(_0x4c1389);});});}exports['VerifyAdditionalPhones']=function(_0xdd6007){var _0x1f0a5d=this;return new Promise(function(_0x1a7036,_0x50b7da){return db[_0x9489('0x14')][_0x9489('0x15')]({'raw':!![],'where':{'ContactId':_0xdd6007['body']['ContactId'],'ListId':_0xdd6007[_0x9489('0x16')][_0x9489('0x17')],'VoiceQueueId':_0xdd6007[_0x9489('0x16')][_0x9489('0x18')]===undefined?null:_0xdd6007[_0x9489('0x16')][_0x9489('0x18')],'CampaignId':_0xdd6007[_0x9489('0x16')]['CampaignId']===undefined?null:_0xdd6007[_0x9489('0x16')][_0x9489('0x19')]}})[_0x9489('0xa')](function(_0x5da0e9){if(_0x5da0e9!=null){return db[_0x9489('0x1a')][_0x9489('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5da0e9['id'],'OrderBy':{'$gt':_0x5da0e9[_0x9489('0x1b')]}},'order':[[_0x9489('0x1b'),_0x9489('0x1c')]]})[_0x9489('0xa')](function(_0x551b93){var _0x3a6115=0x0;if(_0x551b93){if(_0x551b93[_0x9489('0x1d')]+_0x551b93[_0x9489('0x1e')]+_0x551b93[_0x9489('0x1f')]+_0x551b93[_0x9489('0x20')]+_0x551b93[_0x9489('0x21')]+_0x551b93[_0x9489('0x22')]+_0x551b93[_0x9489('0x23')]+_0x551b93[_0x9489('0x24')]<_0xdd6007[_0x9489('0x25')][_0x9489('0x26')])_0x3a6115=0x1;_0x1a7036({'additional':_0x3a6115});}else{return db[_0x9489('0x1a')][_0x9489('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5da0e9['id']},'order':[[_0x9489('0x1b'),_0x9489('0x1c')]]})[_0x9489('0xa')](function(_0x515ea8){var _0x21b370=0x0;if(_0x515ea8){if(_0x515ea8['countbusyretry']+_0x515ea8['countcongestionretry']+_0x515ea8['countnoanswerretry']+_0x515ea8[_0x9489('0x20')]+_0x515ea8[_0x9489('0x21')]+_0x515ea8['countabandonedretry']+_0x515ea8[_0x9489('0x23')]+_0x515ea8[_0x9489('0x24')]<_0xdd6007[_0x9489('0x25')]['dialGlobalMaxRetry'])_0x21b370=0x1;_0x1a7036({'additional':_0x21b370});}else{_0x1a7036({'additional':0x0});}})['catch'](function(_0x473117){logger['error'](_0x9489('0x27'),_0x473117[_0x9489('0x11')]);_0x50b7da(_0x1f0a5d[_0x9489('0x10')](0x1f4,_0x473117[_0x9489('0x11')]));});}})[_0x9489('0x13')](function(_0x4edaed){logger['error'](_0x9489('0x27'),_0x4edaed[_0x9489('0x11')]);_0x50b7da(_0x1f0a5d[_0x9489('0x10')](0x1f4,_0x4edaed['message']));});}else _0x1a7036({'additional':0x0});});});};exports[_0x9489('0x28')]=function(_0x4fb9a8){var _0x1b1be2=this;return new Promise(function(_0x8b36e9,_0x27d66d){return db[_0x9489('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x4fb9a8[_0x9489('0x16')][_0x9489('0x29')],'ListId':_0x4fb9a8[_0x9489('0x16')]['ListId'],'VoiceQueueId':_0x4fb9a8[_0x9489('0x16')]['VoiceQueueId']===undefined?null:_0x4fb9a8[_0x9489('0x16')][_0x9489('0x18')],'CampaignId':_0x4fb9a8['body'][_0x9489('0x19')]===undefined?null:_0x4fb9a8[_0x9489('0x16')][_0x9489('0x19')]}})['then'](function(_0x33199d){if(_0x33199d!=null){return db[_0x9489('0x1a')][_0x9489('0x15')]({'raw':!![],'where':{'CmHopperId':_0x33199d['id'],'OrderBy':{'$gte':_0x33199d[_0x9489('0x1b')]}},'order':[[_0x9489('0x1b'),_0x9489('0x1c')]]})[_0x9489('0xa')](function(_0x204f50){if(_0x204f50)return activateAdditionalPhone(_0x33199d,_0x4fb9a8[_0x9489('0x16')],_0x204f50,_0x4fb9a8[_0x9489('0x2a')],_0x4fb9a8[_0x9489('0x2b')])[_0x9489('0xa')](function(_0x3131fe){_0x8b36e9(_0x3131fe);});else{return db[_0x9489('0x1a')][_0x9489('0x15')]({'raw':!![],'where':{'CmHopperId':_0x33199d['id']},'order':[[_0x9489('0x1b'),_0x9489('0x1c')]]})[_0x9489('0xa')](function(_0x3e2d56){if(_0x3e2d56)return activateAdditionalPhone(_0x33199d,_0x4fb9a8[_0x9489('0x16')],_0x3e2d56,_0x4fb9a8[_0x9489('0x2a')],_0x4fb9a8[_0x9489('0x2b')])['then'](function(_0x5f15ce){_0x8b36e9(_0x5f15ce);});else{_0x8b36e9({'id':_0x33199d['id'],'phone':''});}})['catch'](function(_0x453cd2){logger[_0x9489('0x10')](_0x9489('0x27'),_0x453cd2[_0x9489('0x11')]);_0x27d66d(_0x1b1be2[_0x9489('0x10')](0x1f4,_0x453cd2[_0x9489('0x11')]));});}})[_0x9489('0x13')](function(_0xd90f15){logger[_0x9489('0x10')](_0x9489('0x27'),_0xd90f15[_0x9489('0x11')]);_0x27d66d(_0x1b1be2['error'](0x1f4,_0xd90f15[_0x9489('0x11')]));});}else _0x8b36e9(0x1);});});};function activateAdditionalPhone(_0x33e00d,_0xd5a95,_0x1b6f3e,_0x3fcb21,_0x3977ab){return new Promise(function(_0xe0714d,_0x26b316){var _0x1aaeb6;if(_['isNil'](_0x1b6f3e[_0x9489('0x2c')])){_0x1b6f3e[_0x9489('0x2c')]=moment();}if(moment()>moment(_0x1b6f3e[_0x9489('0x2c')])){_0x1aaeb6=moment()[_0x9489('0x2d')](_0x3977ab||0x3,_0x9489('0x2e'));}else{if(_0x1b6f3e[_0x9489('0x1b')]==0x0){_0x1aaeb6=moment(_0x1b6f3e[_0x9489('0x2c')]);}else{_0x1aaeb6=moment()['add'](_0x3977ab||0x3,_0x9489('0x2e'));}}if(_[_0x9489('0x2f')](_0x1aaeb6)){_0x1aaeb6=moment()[_0x9489('0x2d')](_0x3977ab||0x3,_0x9489('0x2e'));}var _0x1cb015={'phone':_0x33e00d[_0x9489('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x33e00d['OrderBy'])?0x0:_0x33e00d['OrderBy'],'scheduledat':moment()[_0x9489('0x2d')](_0x3fcb21||0x1,_0x9489('0x2e')),'countbusyretry':_0xd5a95[_0x9489('0x1d')],'countcongestionretry':_0xd5a95[_0x9489('0x1e')],'countnoanswerretry':_0xd5a95[_0x9489('0x1f')],'countnosuchnumberretry':_0xd5a95[_0x9489('0x20')],'countdropretry':_0xd5a95[_0x9489('0x21')],'countabandonedretry':_0xd5a95[_0x9489('0x22')],'countmachineretry':_0xd5a95[_0x9489('0x23')],'countagentrejectretry':_0xd5a95[_0x9489('0x24')],'createdAt':_0xd5a95[_0x9489('0x31')],'updatedAt':_0xd5a95[_0x9489('0x32')]};var _0x282c23={'CmHopperId':_0x33e00d['id'],'phone':_0x1b6f3e['phone'],'active':0x0,'OrderBy':_[_0x9489('0x2f')](_0x1b6f3e[_0x9489('0x1b')])?0x0:_0x1b6f3e[_0x9489('0x1b')],'scheduledat':_0x1aaeb6,'countbusyretry':_0x1b6f3e[_0x9489('0x1d')],'countcongestionretry':_0x1b6f3e[_0x9489('0x1e')],'countnoanswerretry':_0x1b6f3e['countnoanswerretry'],'countnosuchnumberretry':_0x1b6f3e['countnosuchnumberretry'],'countdropretry':_0x1b6f3e[_0x9489('0x21')],'countabandonedretry':_0x1b6f3e[_0x9489('0x22')],'countmachineretry':_0x1b6f3e[_0x9489('0x23')],'countagentrejectretry':_0x1b6f3e[_0x9489('0x24')],'createdAt':_0x1b6f3e[_0x9489('0x31')],'updatedAt':_0x1b6f3e[_0x9489('0x32')]};return db[_0x9489('0x33')][_0x9489('0x34')](function(_0x25e18d){return db[_0x9489('0x1a')][_0x9489('0x35')](_0x1cb015,{'where':{'id':_0x1b6f3e['id']}},{'transaction':_0x25e18d})[_0x9489('0xa')](function(){return db[_0x9489('0x14')][_0x9489('0x35')](_0x282c23,{'where':{'id':_0x33e00d['id']}},{'transaction':_0x25e18d});});})[_0x9489('0xa')](function(_0x3f5234){_0xe0714d({'id':_0x33e00d['id'],'phone':_0x1b6f3e[_0x9489('0x30')]});})[_0x9489('0x13')](function(_0x3be848){logger[_0x9489('0x10')](_0x9489('0x36'),_0x3be848[_0x9489('0x11')]);_0x26b316({'error':_0x3be848[_0x9489('0x11')]});});});}exports[_0x9489('0x37')]=function(_0x3be80e){var _0x4bb831=this;return new Promise(function(_0x24a965,_0x1a36ef){return db[_0x9489('0x14')][_0x9489('0x35')](_0x3be80e[_0x9489('0x16')][_0x9489('0x38')],{'where':{'id':_0x3be80e[_0x9489('0x16')]['id']}})[_0x9489('0xa')](function(_0x5a5a65){_0x24a965(_0x5a5a65);})['catch'](function(_0x241149){logger['error'](_0x9489('0x37'),_0x241149['message']);_0x1a36ef(_0x4bb831[_0x9489('0x10')](0x1f4,_0x241149[_0x9489('0x11')]));});});};
\ No newline at end of file
+var _0xc216=['jayson/promise','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countmachineretry','VerifyAdditionalPhones','SwapAdditionalPhones','OrderBy','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4b780d,_0x36a809){var _0x364c20=function(_0x2ed4be){while(--_0x2ed4be){_0x4b780d['push'](_0x4b780d['shift']());}};_0x364c20(++_0x36a809);}(_0xc216,0x18e));var _0x6c21=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xc216[_0x55ff3e];return _0x2709eb;};'use strict';var _=require(_0x6c21('0x0'));var util=require(_0x6c21('0x1'));var moment=require(_0x6c21('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c21('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c21('0x5'))(_0x6c21('0x6'));var config=require(_0x6c21('0x7'));var jayson=require(_0x6c21('0x8'));var client=jayson[_0x6c21('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f90d8,_0x137f1b,_0x4e31a2){return new BPromise(function(_0x4a3c1e,_0x3f86d2){return client[_0x6c21('0xa')](_0x1f90d8,_0x4e31a2)[_0x6c21('0xb')](function(_0x12fc15){logger[_0x6c21('0xc')](_0x6c21('0xd'),_0x137f1b,_0x6c21('0xe'));logger[_0x6c21('0xf')](_0x6c21('0x10'),_0x137f1b,_0x6c21('0xe'),JSON[_0x6c21('0x11')](_0x12fc15));if(_0x12fc15[_0x6c21('0x12')]){if(_0x12fc15[_0x6c21('0x12')][_0x6c21('0x13')]===0x1f4){logger[_0x6c21('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x137f1b,_0x12fc15[_0x6c21('0x12')][_0x6c21('0x14')]);return _0x3f86d2(_0x12fc15['error'][_0x6c21('0x14')]);}logger[_0x6c21('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x137f1b,_0x12fc15[_0x6c21('0x12')]['message']);return _0x4a3c1e(_0x12fc15[_0x6c21('0x12')][_0x6c21('0x14')]);}else{logger[_0x6c21('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x137f1b,_0x6c21('0xe'));_0x4a3c1e(_0x12fc15[_0x6c21('0x15')]['message']);}})[_0x6c21('0x16')](function(_0x43ea40){logger[_0x6c21('0x12')](_0x6c21('0xd'),_0x137f1b,_0x43ea40);_0x3f86d2(_0x43ea40);});});}exports['VerifyAdditionalPhones']=function(_0x205789){var _0x57ae73=this;return new Promise(function(_0x293ede,_0x26f990){return db[_0x6c21('0x17')][_0x6c21('0x18')]({'raw':!![],'where':{'ContactId':_0x205789['body']['ContactId'],'ListId':_0x205789[_0x6c21('0x19')][_0x6c21('0x1a')],'VoiceQueueId':_0x205789[_0x6c21('0x19')][_0x6c21('0x1b')]===undefined?null:_0x205789['body'][_0x6c21('0x1b')],'CampaignId':_0x205789[_0x6c21('0x19')][_0x6c21('0x1c')]===undefined?null:_0x205789[_0x6c21('0x19')][_0x6c21('0x1c')]}})[_0x6c21('0xb')](function(_0x52a6d2){if(_0x52a6d2!=null){return db[_0x6c21('0x1d')][_0x6c21('0x18')]({'raw':!![],'where':{'CmHopperId':_0x52a6d2['id'],'OrderBy':{'$gt':_0x52a6d2['OrderBy']}},'order':[['OrderBy',_0x6c21('0x1e')]]})[_0x6c21('0xb')](function(_0x188244){var _0x51b113=0x0;if(_0x188244){if(_0x188244[_0x6c21('0x1f')]+_0x188244[_0x6c21('0x20')]+_0x188244[_0x6c21('0x21')]+_0x188244[_0x6c21('0x22')]+_0x188244[_0x6c21('0x23')]+_0x188244[_0x6c21('0x24')]+_0x188244['countmachineretry']+_0x188244[_0x6c21('0x25')]<_0x205789[_0x6c21('0x26')][_0x6c21('0x27')])_0x51b113=0x1;_0x293ede({'additional':_0x51b113});}else{return db[_0x6c21('0x1d')][_0x6c21('0x18')]({'raw':!![],'where':{'CmHopperId':_0x52a6d2['id']},'order':[['OrderBy','ASC']]})[_0x6c21('0xb')](function(_0xe9c575){var _0x12b0ac=0x0;if(_0xe9c575){if(_0xe9c575[_0x6c21('0x1f')]+_0xe9c575[_0x6c21('0x20')]+_0xe9c575['countnoanswerretry']+_0xe9c575[_0x6c21('0x22')]+_0xe9c575[_0x6c21('0x23')]+_0xe9c575[_0x6c21('0x24')]+_0xe9c575[_0x6c21('0x28')]+_0xe9c575[_0x6c21('0x25')]<_0x205789[_0x6c21('0x26')]['dialGlobalMaxRetry'])_0x12b0ac=0x1;_0x293ede({'additional':_0x12b0ac});}else{_0x293ede({'additional':0x0});}})[_0x6c21('0x16')](function(_0x4e5951){logger[_0x6c21('0x12')]('VerifyAdditionalPhones',_0x4e5951['message']);_0x26f990(_0x57ae73[_0x6c21('0x12')](0x1f4,_0x4e5951[_0x6c21('0x14')]));});}})[_0x6c21('0x16')](function(_0x2d3201){logger['error'](_0x6c21('0x29'),_0x2d3201[_0x6c21('0x14')]);_0x26f990(_0x57ae73['error'](0x1f4,_0x2d3201['message']));});}else _0x293ede({'additional':0x0});});});};exports[_0x6c21('0x2a')]=function(_0x3016d9){var _0x496cff=this;return new Promise(function(_0x107a17,_0x1f4e3d){return db[_0x6c21('0x17')][_0x6c21('0x18')]({'raw':!![],'where':{'ContactId':_0x3016d9[_0x6c21('0x19')]['ContactId'],'ListId':_0x3016d9['body'][_0x6c21('0x1a')],'VoiceQueueId':_0x3016d9['body'][_0x6c21('0x1b')]===undefined?null:_0x3016d9['body']['VoiceQueueId'],'CampaignId':_0x3016d9[_0x6c21('0x19')][_0x6c21('0x1c')]===undefined?null:_0x3016d9[_0x6c21('0x19')][_0x6c21('0x1c')]}})['then'](function(_0x187858){if(_0x187858!=null){return db[_0x6c21('0x1d')][_0x6c21('0x18')]({'raw':!![],'where':{'CmHopperId':_0x187858['id'],'OrderBy':{'$gte':_0x187858[_0x6c21('0x2b')]}},'order':[[_0x6c21('0x2b'),_0x6c21('0x1e')]]})['then'](function(_0x40e016){if(_0x40e016)return activateAdditionalPhone(_0x187858,_0x3016d9[_0x6c21('0x19')],_0x40e016,_0x3016d9[_0x6c21('0x2c')],_0x3016d9[_0x6c21('0x2d')])[_0x6c21('0xb')](function(_0x4ff340){_0x107a17(_0x4ff340);});else{return db[_0x6c21('0x1d')][_0x6c21('0x18')]({'raw':!![],'where':{'CmHopperId':_0x187858['id']},'order':[[_0x6c21('0x2b'),_0x6c21('0x1e')]]})[_0x6c21('0xb')](function(_0xcfd5ff){if(_0xcfd5ff)return activateAdditionalPhone(_0x187858,_0x3016d9['body'],_0xcfd5ff,_0x3016d9['duration'],_0x3016d9['waitTime'])[_0x6c21('0xb')](function(_0x46d7c3){_0x107a17(_0x46d7c3);});else{_0x107a17({'id':_0x187858['id'],'phone':''});}})[_0x6c21('0x16')](function(_0xeb5c13){logger[_0x6c21('0x12')]('VerifyAdditionalPhones',_0xeb5c13[_0x6c21('0x14')]);_0x1f4e3d(_0x496cff[_0x6c21('0x12')](0x1f4,_0xeb5c13['message']));});}})[_0x6c21('0x16')](function(_0x4629c4){logger['error'](_0x6c21('0x29'),_0x4629c4[_0x6c21('0x14')]);_0x1f4e3d(_0x496cff[_0x6c21('0x12')](0x1f4,_0x4629c4[_0x6c21('0x14')]));});}else _0x107a17(0x1);});});};function activateAdditionalPhone(_0x43f780,_0xcba253,_0x22c386,_0x2d18a9,_0x325029){return new Promise(function(_0x344697,_0x475544){var _0x27f875;if(_[_0x6c21('0x2e')](_0x22c386['scheduledat'])){_0x22c386[_0x6c21('0x2f')]=moment();}if(moment()>moment(_0x22c386[_0x6c21('0x2f')])){_0x27f875=moment()['add'](_0x325029||0x3,_0x6c21('0x30'));}else{if(_0x22c386[_0x6c21('0x2b')]==0x0){_0x27f875=moment(_0x22c386[_0x6c21('0x2f')]);}else{_0x27f875=moment()[_0x6c21('0x31')](_0x325029||0x3,_0x6c21('0x30'));}}if(_[_0x6c21('0x2e')](_0x27f875)){_0x27f875=moment()['add'](_0x325029||0x3,_0x6c21('0x30'));}var _0x576c58={'phone':_0x43f780[_0x6c21('0x32')],'active':0x0,'OrderBy':_[_0x6c21('0x2e')](_0x43f780['OrderBy'])?0x0:_0x43f780['OrderBy'],'scheduledat':moment()[_0x6c21('0x31')](_0x2d18a9||0x1,'minutes'),'countbusyretry':_0xcba253[_0x6c21('0x1f')],'countcongestionretry':_0xcba253[_0x6c21('0x20')],'countnoanswerretry':_0xcba253[_0x6c21('0x21')],'countnosuchnumberretry':_0xcba253[_0x6c21('0x22')],'countdropretry':_0xcba253[_0x6c21('0x23')],'countabandonedretry':_0xcba253['countabandonedretry'],'countmachineretry':_0xcba253['countmachineretry'],'countagentrejectretry':_0xcba253[_0x6c21('0x25')],'createdAt':_0xcba253[_0x6c21('0x33')],'updatedAt':_0xcba253['updatedAt']};var _0x2d03ed={'CmHopperId':_0x43f780['id'],'phone':_0x22c386['phone'],'active':0x0,'OrderBy':_['isNil'](_0x22c386[_0x6c21('0x2b')])?0x0:_0x22c386[_0x6c21('0x2b')],'scheduledat':_0x27f875,'countbusyretry':_0x22c386[_0x6c21('0x1f')],'countcongestionretry':_0x22c386[_0x6c21('0x20')],'countnoanswerretry':_0x22c386[_0x6c21('0x21')],'countnosuchnumberretry':_0x22c386['countnosuchnumberretry'],'countdropretry':_0x22c386[_0x6c21('0x23')],'countabandonedretry':_0x22c386['countabandonedretry'],'countmachineretry':_0x22c386[_0x6c21('0x28')],'countagentrejectretry':_0x22c386['countagentrejectretry'],'createdAt':_0x22c386[_0x6c21('0x33')],'updatedAt':_0x22c386[_0x6c21('0x34')]};return db[_0x6c21('0x35')][_0x6c21('0x36')](function(_0x5a0e9d){return db[_0x6c21('0x1d')][_0x6c21('0x37')](_0x576c58,{'where':{'id':_0x22c386['id']}},{'transaction':_0x5a0e9d})[_0x6c21('0xb')](function(){return db[_0x6c21('0x17')][_0x6c21('0x37')](_0x2d03ed,{'where':{'id':_0x43f780['id']}},{'transaction':_0x5a0e9d});});})[_0x6c21('0xb')](function(_0x4a6fe6){_0x344697({'id':_0x43f780['id'],'phone':_0x22c386['phone']});})[_0x6c21('0x16')](function(_0xfd7386){logger[_0x6c21('0x12')]('activateAdditionalPhone',_0xfd7386[_0x6c21('0x14')]);_0x475544({'error':_0xfd7386[_0x6c21('0x14')]});});});}exports[_0x6c21('0x38')]=function(_0x4fc445){var _0x3c864a=this;return new Promise(function(_0x59318c,_0x5628d3){return db['CmHopper'][_0x6c21('0x37')](_0x4fc445['body'][_0x6c21('0x39')],{'where':{'id':_0x4fc445[_0x6c21('0x19')]['id']}})['then'](function(_0x4f43e5){_0x59318c(_0x4f43e5);})['catch'](function(_0x82446b){logger[_0x6c21('0x12')]('IncrementPreviewCounters',_0x82446b[_0x6c21('0x14')]);_0x5628d3(_0x3c864a[_0x6c21('0x12')](0x1f4,_0x82446b[_0x6c21('0x14')]));});});};
\ No newline at end of file
index 32ca08d..f1c776d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7275=['update','/:id','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7275,0x143));var _0x5727=function(_0x3abae0,_0x1cc059){_0x3abae0=_0x3abae0-0x0;var _0x2f88a5=_0x7275[_0x3abae0];return _0x2f88a5;};'use strict';var multer=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var path=require(_0x5727('0x2'));var timeout=require('connect-timeout');var express=require(_0x5727('0x3'));var router=express['Router']();var fs_extra=require(_0x5727('0x4'));var auth=require(_0x5727('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5727('0x6'));var controller=require(_0x5727('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5727('0x8')]('/:id',auth[_0x5727('0x9')](),controller['show']);router[_0x5727('0xa')]('/',auth['isAuthenticated'](),controller[_0x5727('0xb')]);router[_0x5727('0xc')]('/:id',auth[_0x5727('0x9')](),controller[_0x5727('0xd')]);router['delete'](_0x5727('0xe'),auth[_0x5727('0x9')](),controller['destroy']);module[_0x5727('0xf')]=router;
\ No newline at end of file
+var _0x84f2=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0xb500e3,_0x2fd0af){var _0x247028=function(_0x48e85a){while(--_0x48e85a){_0xb500e3['push'](_0xb500e3['shift']());}};_0x247028(++_0x2fd0af);}(_0x84f2,0x1ee));var _0x284f=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x84f2[_0x4ee881];return _0x305f48;};'use strict';var multer=require(_0x284f('0x0'));var util=require(_0x284f('0x1'));var path=require(_0x284f('0x2'));var timeout=require('connect-timeout');var express=require(_0x284f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x284f('0x4'));var interaction=require(_0x284f('0x5'));var config=require(_0x284f('0x6'));var controller=require(_0x284f('0x7'));router[_0x284f('0x8')]('/',auth[_0x284f('0x9')](),controller[_0x284f('0xa')]);router[_0x284f('0x8')](_0x284f('0xb'),auth['isAuthenticated'](),controller[_0x284f('0xc')]);router[_0x284f('0xd')]('/',auth[_0x284f('0x9')](),controller['create']);router[_0x284f('0xe')](_0x284f('0xb'),auth[_0x284f('0x9')](),controller[_0x284f('0xf')]);router[_0x284f('0x10')](_0x284f('0xb'),auth[_0x284f('0x9')](),controller[_0x284f('0x11')]);module[_0x284f('0x12')]=router;
\ No newline at end of file
index ad5eaef..aee20ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb04=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x4cb0('0x0'));var Sequelize=require(_0x4cb0('0x1'));module[_0x4cb0('0x2')]={'phone':{'type':Sequelize[_0x4cb0('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')},'ListId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')},'VoiceQueueId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')}};
\ No newline at end of file
+var _0x8d0a=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x33d177,_0x230bfd){var _0x1c0c80=function(_0x14d8b4){while(--_0x14d8b4){_0x33d177['push'](_0x33d177['shift']());}};_0x1c0c80(++_0x230bfd);}(_0x8d0a,0x172));var _0xa8d0=function(_0x2c8ece,_0x5106c6){_0x2c8ece=_0x2c8ece-0x0;var _0x57ee0e=_0x8d0a[_0x2c8ece];return _0x57ee0e;};'use strict';var moment=require(_0xa8d0('0x0'));var Sequelize=require(_0xa8d0('0x1'));module[_0xa8d0('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa8d0('0x3')],'unique':_0xa8d0('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa8d0('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa8d0('0x3')],'unique':_0xa8d0('0x4')}};
\ No newline at end of file
index 3048d84..116f0d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ad9=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','CmHopperBlack','findAll','rows','catch','show','params','rawAttributes','find','body','describe','zip-dir','fast-json-patch'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x9ad9,0x1a8));var _0x99ad=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x9ad9[_0x118653];return _0xc11fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x99ad('0x0'));var jsonpatch=require(_0x99ad('0x1'));var rp=require(_0x99ad('0x2'));var moment=require(_0x99ad('0x3'));var BPromise=require(_0x99ad('0x4'));var Mustache=require('mustache');var util=require(_0x99ad('0x5'));var path=require(_0x99ad('0x6'));var sox=require(_0x99ad('0x7'));var csv=require(_0x99ad('0x8'));var ejs=require(_0x99ad('0x9'));var fs=require('fs');var fs_extra=require(_0x99ad('0xa'));var _=require(_0x99ad('0xb'));var squel=require(_0x99ad('0xc'));var crypto=require('crypto');var jsforce=require(_0x99ad('0xd'));var deskjs=require(_0x99ad('0xe'));var toCsv=require(_0x99ad('0x8'));var querystring=require(_0x99ad('0xf'));var Papa=require(_0x99ad('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99ad('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x99ad('0x12'));var logger=require('../../config/logger')(_0x99ad('0x13'));var utils=require('../../config/utils');var config=require(_0x99ad('0x14'));var licenseUtil=require(_0x99ad('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41df84,_0x8cbd9b){_0x8cbd9b=_0x8cbd9b||0xcc;return function(_0x5e2041){if(_0x5e2041){return _0x41df84[_0x99ad('0x16')](_0x8cbd9b);}return _0x41df84[_0x99ad('0x17')](_0x8cbd9b)[_0x99ad('0x18')]();};}function respondWithResult(_0x5a4e8a,_0x507988){_0x507988=_0x507988||0xc8;return function(_0x16bd0e){if(_0x16bd0e){return _0x5a4e8a[_0x99ad('0x17')](_0x507988)[_0x99ad('0x19')](_0x16bd0e);}};}function respondWithFilteredResult(_0x5285ab,_0x1afe37){return function(_0x5f37bf){if(_0x5f37bf){var _0x175078=typeof _0x1afe37[_0x99ad('0x1a')]===_0x99ad('0x1b')&&typeof _0x1afe37['limit']===_0x99ad('0x1b');var _0x1d58b2=_0x5f37bf[_0x99ad('0x1c')];var _0x5c8adf=_0x175078?0x0:_0x1afe37[_0x99ad('0x1a')];var _0x252b7c=_0x175078?_0x5f37bf[_0x99ad('0x1c')]:_0x1afe37[_0x99ad('0x1a')]+_0x1afe37[_0x99ad('0x1d')];var _0x4052ef;if(_0x252b7c>=_0x1d58b2){_0x252b7c=_0x1d58b2;_0x4052ef=0xc8;}else{_0x4052ef=0xce;}_0x5285ab[_0x99ad('0x17')](_0x4052ef);return _0x5285ab[_0x99ad('0x1e')](_0x99ad('0x1f'),_0x5c8adf+'-'+_0x252b7c+'/'+_0x1d58b2)[_0x99ad('0x19')](_0x5f37bf);}return null;};}function patchUpdates(_0x4f3b48){return function(_0x4bc752){try{jsonpatch['apply'](_0x4bc752,_0x4f3b48,!![]);}catch(_0x1dc13e){return BPromise[_0x99ad('0x20')](_0x1dc13e);}return _0x4bc752[_0x99ad('0x21')]();};}function saveUpdates(_0x4b0f0c,_0x2bae9f){return function(_0x316538){if(_0x316538){return _0x316538[_0x99ad('0x22')](_0x4b0f0c)['then'](function(_0xb5be9d){return _0xb5be9d;});}return null;};}function removeEntity(_0x5a3b8d,_0x4b5c57){return function(_0x1d367a){if(_0x1d367a){return _0x1d367a[_0x99ad('0x23')]()[_0x99ad('0x24')](function(){_0x5a3b8d[_0x99ad('0x17')](0xcc)[_0x99ad('0x18')]();});}};}function handleEntityNotFound(_0x57d866,_0x2238e0){return function(_0x40c9b7){if(!_0x40c9b7){_0x57d866['sendStatus'](0x194);}return _0x40c9b7;};}function handleError(_0x282c52,_0x42c40b){_0x42c40b=_0x42c40b||0x1f4;return function(_0x395453){logger[_0x99ad('0x25')](_0x395453[_0x99ad('0x26')]);if(_0x395453[_0x99ad('0x27')]){delete _0x395453['name'];}_0x282c52['status'](_0x42c40b)['send'](_0x395453);};}exports['index']=function(_0x43e78d,_0x2fec0f){var _0x534a46={},_0x191a5b={},_0x333daf={'count':0x0,'rows':[]};var _0x1ad4c6=_[_0x99ad('0x28')](db['CmHopperBlack']['rawAttributes'],function(_0x56554b){return{'name':_0x56554b[_0x99ad('0x29')],'type':_0x56554b[_0x99ad('0x2a')][_0x99ad('0x2b')]};});_0x191a5b['model']=_[_0x99ad('0x28')](_0x1ad4c6,_0x99ad('0x27'));_0x191a5b[_0x99ad('0x2c')]=_[_0x99ad('0x2d')](_0x43e78d['query']);_0x191a5b[_0x99ad('0x2e')]=_[_0x99ad('0x2f')](_0x191a5b[_0x99ad('0x30')],_0x191a5b['query']);_0x534a46['attributes']=_['intersection'](_0x191a5b[_0x99ad('0x30')],qs['fields'](_0x43e78d[_0x99ad('0x2c')][_0x99ad('0x31')]));_0x534a46[_0x99ad('0x32')]=_0x534a46[_0x99ad('0x32')][_0x99ad('0x33')]?_0x534a46[_0x99ad('0x32')]:_0x191a5b[_0x99ad('0x30')];if(!_0x43e78d['query']['hasOwnProperty'](_0x99ad('0x34'))){_0x534a46[_0x99ad('0x1d')]=qs['limit'](_0x43e78d[_0x99ad('0x2c')][_0x99ad('0x1d')]);_0x534a46[_0x99ad('0x1a')]=qs[_0x99ad('0x1a')](_0x43e78d[_0x99ad('0x2c')][_0x99ad('0x1a')]);}_0x534a46['order']=qs[_0x99ad('0x35')](_0x43e78d['query']['sort']);_0x534a46['where']=qs[_0x99ad('0x2e')](_['pick'](_0x43e78d[_0x99ad('0x2c')],_0x191a5b[_0x99ad('0x2e')]),_0x1ad4c6);if(_0x43e78d[_0x99ad('0x2c')][_0x99ad('0x36')]){_0x534a46[_0x99ad('0x37')]=_[_0x99ad('0x38')](_0x534a46[_0x99ad('0x37')],{'$or':_[_0x99ad('0x28')](_0x1ad4c6,function(_0x511078){if(_0x511078['type']!==_0x99ad('0x39')){var _0x70b666={};_0x70b666[_0x511078['name']]={'$like':'%'+_0x43e78d['query'][_0x99ad('0x36')]+'%'};return _0x70b666;}})});}_0x534a46=_[_0x99ad('0x38')]({},_0x534a46,_0x43e78d[_0x99ad('0x3a')]);var _0x310bd2={'where':_0x534a46[_0x99ad('0x37')]};return db['CmHopperBlack'][_0x99ad('0x1c')](_0x310bd2)[_0x99ad('0x24')](function(_0x5b5939){_0x333daf[_0x99ad('0x1c')]=_0x5b5939;if(_0x43e78d['query'][_0x99ad('0x3b')]){_0x534a46[_0x99ad('0x3c')]=[{'all':!![]}];}return db[_0x99ad('0x3d')][_0x99ad('0x3e')](_0x534a46);})[_0x99ad('0x24')](function(_0x4a36ee){_0x333daf[_0x99ad('0x3f')]=_0x4a36ee;return _0x333daf;})['then'](respondWithFilteredResult(_0x2fec0f,_0x534a46))[_0x99ad('0x40')](handleError(_0x2fec0f,null));};exports[_0x99ad('0x41')]=function(_0x2e747e,_0x2b1de7){var _0x5980e0={'raw':!![],'where':{'id':_0x2e747e[_0x99ad('0x42')]['id']}},_0x1b02c8={};_0x1b02c8[_0x99ad('0x30')]=_[_0x99ad('0x2d')](db[_0x99ad('0x3d')][_0x99ad('0x43')]);_0x1b02c8['query']=_[_0x99ad('0x2d')](_0x2e747e[_0x99ad('0x2c')]);_0x1b02c8['filters']=_[_0x99ad('0x2f')](_0x1b02c8['model'],_0x1b02c8[_0x99ad('0x2c')]);_0x5980e0['attributes']=_[_0x99ad('0x2f')](_0x1b02c8['model'],qs['fields'](_0x2e747e[_0x99ad('0x2c')]['fields']));_0x5980e0[_0x99ad('0x32')]=_0x5980e0[_0x99ad('0x32')][_0x99ad('0x33')]?_0x5980e0[_0x99ad('0x32')]:_0x1b02c8[_0x99ad('0x30')];if(_0x2e747e[_0x99ad('0x2c')]['includeAll']){_0x5980e0[_0x99ad('0x3c')]=[{'all':!![]}];}_0x5980e0=_['merge']({},_0x5980e0,_0x2e747e[_0x99ad('0x3a')]);return db[_0x99ad('0x3d')][_0x99ad('0x44')](_0x5980e0)[_0x99ad('0x24')](handleEntityNotFound(_0x2b1de7,null))[_0x99ad('0x24')](respondWithResult(_0x2b1de7,null))[_0x99ad('0x40')](handleError(_0x2b1de7,null));};exports['update']=function(_0x5e02a7,_0x27e8b1){if(_0x5e02a7[_0x99ad('0x45')]['id']){delete _0x5e02a7[_0x99ad('0x45')]['id'];}return db[_0x99ad('0x3d')][_0x99ad('0x44')]({'where':{'id':_0x5e02a7[_0x99ad('0x42')]['id']}})[_0x99ad('0x24')](handleEntityNotFound(_0x27e8b1,null))[_0x99ad('0x24')](saveUpdates(_0x5e02a7[_0x99ad('0x45')],null))[_0x99ad('0x24')](respondWithResult(_0x27e8b1,null))['catch'](handleError(_0x27e8b1,null));};exports[_0x99ad('0x23')]=function(_0x5e7311,_0x19d477){return db[_0x99ad('0x3d')]['find']({'where':{'id':_0x5e7311[_0x99ad('0x42')]['id']}})[_0x99ad('0x24')](handleEntityNotFound(_0x19d477,null))[_0x99ad('0x24')](removeEntity(_0x19d477,null))[_0x99ad('0x40')](handleError(_0x19d477,null));};exports[_0x99ad('0x46')]=function(_0x3dfa8f,_0x170517){return db[_0x99ad('0x3d')][_0x99ad('0x46')]()[_0x99ad('0x24')](respondWithResult(_0x170517,null))[_0x99ad('0x40')](handleError(_0x170517,null));};
\ No newline at end of file
+var _0x5911=['index','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','catch','show','keys','include','options','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','then','destroy','error','stack','name'];(function(_0x26bc77,_0x5f09c6){var _0x46117a=function(_0x538ccb){while(--_0x538ccb){_0x26bc77['push'](_0x26bc77['shift']());}};_0x46117a(++_0x5f09c6);}(_0x5911,0x1d4));var _0x1591=function(_0x4f816f,_0x3c646e){_0x4f816f=_0x4f816f-0x0;var _0x5ae9f5=_0x5911[_0x4f816f];return _0x5ae9f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1591('0x0'));var zipdir=require(_0x1591('0x1'));var jsonpatch=require(_0x1591('0x2'));var rp=require(_0x1591('0x3'));var moment=require(_0x1591('0x4'));var BPromise=require(_0x1591('0x5'));var Mustache=require(_0x1591('0x6'));var util=require('util');var path=require(_0x1591('0x7'));var sox=require(_0x1591('0x8'));var csv=require(_0x1591('0x9'));var ejs=require(_0x1591('0xa'));var fs=require('fs');var fs_extra=require(_0x1591('0xb'));var _=require('lodash');var squel=require(_0x1591('0xc'));var crypto=require(_0x1591('0xd'));var jsforce=require(_0x1591('0xe'));var deskjs=require(_0x1591('0xf'));var toCsv=require(_0x1591('0x9'));var querystring=require('querystring');var Papa=require(_0x1591('0x10'));var Redis=require(_0x1591('0x11'));var authService=require(_0x1591('0x12'));var qs=require(_0x1591('0x13'));var as=require(_0x1591('0x14'));var hardwareService=require(_0x1591('0x15'));var logger=require(_0x1591('0x16'))('api');var utils=require(_0x1591('0x17'));var config=require(_0x1591('0x18'));var licenseUtil=require(_0x1591('0x19'));var db=require(_0x1591('0x1a'))['db'];function respondWithStatusCode(_0x911699,_0x5d51a2){_0x5d51a2=_0x5d51a2||0xcc;return function(_0x11f5a4){if(_0x11f5a4){return _0x911699[_0x1591('0x1b')](_0x5d51a2);}return _0x911699[_0x1591('0x1c')](_0x5d51a2)[_0x1591('0x1d')]();};}function respondWithResult(_0xcb031c,_0x4d57ae){_0x4d57ae=_0x4d57ae||0xc8;return function(_0x1c6666){if(_0x1c6666){return _0xcb031c['status'](_0x4d57ae)[_0x1591('0x1e')](_0x1c6666);}};}function respondWithFilteredResult(_0x37e1b2,_0x3d3b45){return function(_0x544d35){if(_0x544d35){var _0x20dbe2=typeof _0x3d3b45[_0x1591('0x1f')]==='undefined'&&typeof _0x3d3b45[_0x1591('0x20')]==='undefined';var _0x1f9f3c=_0x544d35[_0x1591('0x21')];var _0x3d1666=_0x20dbe2?0x0:_0x3d3b45[_0x1591('0x1f')];var _0x5810e8=_0x20dbe2?_0x544d35[_0x1591('0x21')]:_0x3d3b45[_0x1591('0x1f')]+_0x3d3b45['limit'];var _0x2c2872;if(_0x5810e8>=_0x1f9f3c){_0x5810e8=_0x1f9f3c;_0x2c2872=0xc8;}else{_0x2c2872=0xce;}_0x37e1b2[_0x1591('0x1c')](_0x2c2872);return _0x37e1b2[_0x1591('0x22')]('Content-Range',_0x3d1666+'-'+_0x5810e8+'/'+_0x1f9f3c)[_0x1591('0x1e')](_0x544d35);}return null;};}function patchUpdates(_0x2cc961){return function(_0x99f3fd){try{jsonpatch[_0x1591('0x23')](_0x99f3fd,_0x2cc961,!![]);}catch(_0x114394){return BPromise[_0x1591('0x24')](_0x114394);}return _0x99f3fd[_0x1591('0x25')]();};}function saveUpdates(_0x181025,_0x3dbf56){return function(_0x1d5807){if(_0x1d5807){return _0x1d5807['update'](_0x181025)[_0x1591('0x26')](function(_0xc5361b){return _0xc5361b;});}return null;};}function removeEntity(_0xd554f0,_0xe0080e){return function(_0x499d43){if(_0x499d43){return _0x499d43[_0x1591('0x27')]()['then'](function(){_0xd554f0[_0x1591('0x1c')](0xcc)[_0x1591('0x1d')]();});}};}function handleEntityNotFound(_0xa69a5a,_0x98ffd6){return function(_0x383aea){if(!_0x383aea){_0xa69a5a[_0x1591('0x1b')](0x194);}return _0x383aea;};}function handleError(_0x5b75c7,_0x2b1d52){_0x2b1d52=_0x2b1d52||0x1f4;return function(_0x5d0e25){logger[_0x1591('0x28')](_0x5d0e25[_0x1591('0x29')]);if(_0x5d0e25['name']){delete _0x5d0e25[_0x1591('0x2a')];}_0x5b75c7[_0x1591('0x1c')](_0x2b1d52)['send'](_0x5d0e25);};}exports[_0x1591('0x2b')]=function(_0x1b654c,_0x4eb337){var _0x59e4a1={},_0x4f598f={},_0x1915e6={'count':0x0,'rows':[]};var _0x56b0dd=_[_0x1591('0x2c')](db[_0x1591('0x2d')][_0x1591('0x2e')],function(_0x436b57){return{'name':_0x436b57[_0x1591('0x2f')],'type':_0x436b57[_0x1591('0x30')]['key']};});_0x4f598f[_0x1591('0x31')]=_['map'](_0x56b0dd,_0x1591('0x2a'));_0x4f598f['query']=_['keys'](_0x1b654c[_0x1591('0x32')]);_0x4f598f['filters']=_[_0x1591('0x33')](_0x4f598f[_0x1591('0x31')],_0x4f598f[_0x1591('0x32')]);_0x59e4a1[_0x1591('0x34')]=_[_0x1591('0x33')](_0x4f598f[_0x1591('0x31')],qs[_0x1591('0x35')](_0x1b654c[_0x1591('0x32')][_0x1591('0x35')]));_0x59e4a1[_0x1591('0x34')]=_0x59e4a1['attributes'][_0x1591('0x36')]?_0x59e4a1[_0x1591('0x34')]:_0x4f598f['model'];if(!_0x1b654c[_0x1591('0x32')][_0x1591('0x37')]('nolimit')){_0x59e4a1['limit']=qs[_0x1591('0x20')](_0x1b654c['query']['limit']);_0x59e4a1[_0x1591('0x1f')]=qs['offset'](_0x1b654c[_0x1591('0x32')][_0x1591('0x1f')]);}_0x59e4a1[_0x1591('0x38')]=qs['sort'](_0x1b654c[_0x1591('0x32')][_0x1591('0x39')]);_0x59e4a1[_0x1591('0x3a')]=qs[_0x1591('0x3b')](_['pick'](_0x1b654c[_0x1591('0x32')],_0x4f598f['filters']),_0x56b0dd);if(_0x1b654c[_0x1591('0x32')][_0x1591('0x3c')]){_0x59e4a1[_0x1591('0x3a')]=_['merge'](_0x59e4a1[_0x1591('0x3a')],{'$or':_[_0x1591('0x2c')](_0x56b0dd,function(_0x2e9602){if(_0x2e9602[_0x1591('0x30')]!==_0x1591('0x3d')){var _0x19f861={};_0x19f861[_0x2e9602[_0x1591('0x2a')]]={'$like':'%'+_0x1b654c[_0x1591('0x32')][_0x1591('0x3c')]+'%'};return _0x19f861;}})});}_0x59e4a1=_[_0x1591('0x3e')]({},_0x59e4a1,_0x1b654c['options']);var _0x526674={'where':_0x59e4a1['where']};return db['CmHopperBlack']['count'](_0x526674)['then'](function(_0x4caee2){_0x1915e6[_0x1591('0x21')]=_0x4caee2;if(_0x1b654c[_0x1591('0x32')][_0x1591('0x3f')]){_0x59e4a1['include']=[{'all':!![]}];}return db[_0x1591('0x2d')]['findAll'](_0x59e4a1);})[_0x1591('0x26')](function(_0x2bb2e5){_0x1915e6['rows']=_0x2bb2e5;return _0x1915e6;})['then'](respondWithFilteredResult(_0x4eb337,_0x59e4a1))[_0x1591('0x40')](handleError(_0x4eb337,null));};exports[_0x1591('0x41')]=function(_0x2285b8,_0x3aa2ac){var _0x26ff0a={'raw':!![],'where':{'id':_0x2285b8['params']['id']}},_0x529b09={};_0x529b09[_0x1591('0x31')]=_[_0x1591('0x42')](db[_0x1591('0x2d')][_0x1591('0x2e')]);_0x529b09[_0x1591('0x32')]=_[_0x1591('0x42')](_0x2285b8[_0x1591('0x32')]);_0x529b09['filters']=_[_0x1591('0x33')](_0x529b09[_0x1591('0x31')],_0x529b09[_0x1591('0x32')]);_0x26ff0a['attributes']=_[_0x1591('0x33')](_0x529b09[_0x1591('0x31')],qs[_0x1591('0x35')](_0x2285b8[_0x1591('0x32')][_0x1591('0x35')]));_0x26ff0a['attributes']=_0x26ff0a[_0x1591('0x34')][_0x1591('0x36')]?_0x26ff0a[_0x1591('0x34')]:_0x529b09[_0x1591('0x31')];if(_0x2285b8[_0x1591('0x32')][_0x1591('0x3f')]){_0x26ff0a[_0x1591('0x43')]=[{'all':!![]}];}_0x26ff0a=_[_0x1591('0x3e')]({},_0x26ff0a,_0x2285b8[_0x1591('0x44')]);return db[_0x1591('0x2d')]['find'](_0x26ff0a)['then'](handleEntityNotFound(_0x3aa2ac,null))[_0x1591('0x26')](respondWithResult(_0x3aa2ac,null))[_0x1591('0x40')](handleError(_0x3aa2ac,null));};exports['update']=function(_0x2291aa,_0x36388f){if(_0x2291aa[_0x1591('0x45')]['id']){delete _0x2291aa[_0x1591('0x45')]['id'];}return db['CmHopperBlack'][_0x1591('0x46')]({'where':{'id':_0x2291aa['params']['id']}})[_0x1591('0x26')](handleEntityNotFound(_0x36388f,null))[_0x1591('0x26')](saveUpdates(_0x2291aa[_0x1591('0x45')],null))[_0x1591('0x26')](respondWithResult(_0x36388f,null))[_0x1591('0x40')](handleError(_0x36388f,null));};exports[_0x1591('0x27')]=function(_0x4b3fec,_0x48d314){return db[_0x1591('0x2d')][_0x1591('0x46')]({'where':{'id':_0x4b3fec[_0x1591('0x47')]['id']}})['then'](handleEntityNotFound(_0x48d314,null))['then'](removeEntity(_0x48d314,null))[_0x1591('0x40')](handleError(_0x48d314,null));};exports[_0x1591('0x48')]=function(_0x3c7579,_0x380e50){return db[_0x1591('0x2d')][_0x1591('0x48')]()[_0x1591('0x26')](respondWithResult(_0x380e50,null))[_0x1591('0x40')](handleError(_0x380e50,null));};
\ No newline at end of file
index 0abe741..b5c7a70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6114=['rimraf','../../config/environment','exports','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x18ef63,_0x36a29f){var _0x19b20f=function(_0x3d64e8){while(--_0x3d64e8){_0x18ef63['push'](_0x18ef63['shift']());}};_0x19b20f(++_0x36a29f);}(_0x6114,0x1c7));var _0x4611=function(_0x57112d,_0x9ea573){_0x57112d=_0x57112d-0x0;var _0x3c32b9=_0x6114[_0x57112d];return _0x3c32b9;};'use strict';var _=require('lodash');var util=require(_0x4611('0x0'));var logger=require(_0x4611('0x1'))(_0x4611('0x2'));var moment=require(_0x4611('0x3'));var BPromise=require(_0x4611('0x4'));var rp=require(_0x4611('0x5'));var fs=require('fs');var path=require(_0x4611('0x6'));var rimraf=require(_0x4611('0x7'));var config=require(_0x4611('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x4611('0x9')]=function(_0x5dbae1,_0x3bbf6e){return _0x5dbae1['define']('CmHopperBlack',attributes,{'tableName':_0x4611('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcde0=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcde0,0xe3));var _0x0cde=function(_0x38ecea,_0x4fc62f){_0x38ecea=_0x38ecea-0x0;var _0x59ba15=_0xcde0[_0x38ecea];return _0x59ba15;};'use strict';var _=require(_0x0cde('0x0'));var util=require(_0x0cde('0x1'));var logger=require(_0x0cde('0x2'))(_0x0cde('0x3'));var moment=require(_0x0cde('0x4'));var BPromise=require(_0x0cde('0x5'));var rp=require(_0x0cde('0x6'));var fs=require('fs');var path=require(_0x0cde('0x7'));var rimraf=require(_0x0cde('0x8'));var config=require(_0x0cde('0x9'));var attributes=require(_0x0cde('0xa'));module['exports']=function(_0x574c38,_0x145754){return _0x574c38[_0x0cde('0xb')]('CmHopperBlack',attributes,{'tableName':_0x0cde('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f69f1e5..b175b19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9005=['options','raw','where','attributes','limit','include','map','model','then','stringify','UpdateCmHopperBlack','update','DestroyCmHopperBlack','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack'];(function(_0x536a52,_0x43b0a0){var _0x32d141=function(_0x5de435){while(--_0x5de435){_0x536a52['push'](_0x536a52['shift']());}};_0x32d141(++_0x43b0a0);}(_0x9005,0x1a5));var _0x5900=function(_0x2357fa,_0x31300a){_0x2357fa=_0x2357fa-0x0;var _0x3c956b=_0x9005[_0x2357fa];return _0x3c956b;};'use strict';var _=require(_0x5900('0x0'));var util=require('util');var moment=require(_0x5900('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5900('0x2'))['db'];var utils=require(_0x5900('0x3'));var logger=require(_0x5900('0x4'))(_0x5900('0x5'));var config=require('../../config/environment');var jayson=require(_0x5900('0x6'));var client=jayson[_0x5900('0x7')][_0x5900('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d5157,_0x194297,_0x1972cc){return new BPromise(function(_0x1a1e1a,_0x44dc1a){return client[_0x5900('0x9')](_0x3d5157,_0x1972cc)['then'](function(_0x597eec){logger[_0x5900('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x194297,_0x5900('0xb'));logger[_0x5900('0xc')](_0x5900('0xd'),_0x194297,_0x5900('0xb'),JSON['stringify'](_0x597eec));if(_0x597eec[_0x5900('0xe')]){if(_0x597eec['error'][_0x5900('0xf')]===0x1f4){logger[_0x5900('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x194297,_0x597eec['error']['message']);return _0x44dc1a(_0x597eec[_0x5900('0xe')]['message']);}logger[_0x5900('0xe')](_0x5900('0x10'),_0x194297,_0x597eec[_0x5900('0xe')][_0x5900('0x11')]);return _0x1a1e1a(_0x597eec[_0x5900('0xe')]['message']);}else{logger['info'](_0x5900('0x10'),_0x194297,_0x5900('0xb'));_0x1a1e1a(_0x597eec['result']['message']);}})[_0x5900('0x12')](function(_0x1c15f8){logger['error'](_0x5900('0x10'),_0x194297,_0x1c15f8);_0x44dc1a(_0x1c15f8);});});}exports[_0x5900('0x13')]=function(_0x451fa6){var _0x8bcc81=this;return new Promise(function(_0x4f7b9a,_0x59c029){return db[_0x5900('0x14')]['findAll']({'raw':_0x451fa6[_0x5900('0x15')]?_0x451fa6[_0x5900('0x15')][_0x5900('0x16')]===undefined?!![]:![]:!![],'where':_0x451fa6[_0x5900('0x15')]?_0x451fa6[_0x5900('0x15')][_0x5900('0x17')]||null:null,'attributes':_0x451fa6['options']?_0x451fa6[_0x5900('0x15')][_0x5900('0x18')]||null:null,'limit':_0x451fa6[_0x5900('0x15')]?_0x451fa6[_0x5900('0x15')][_0x5900('0x19')]||null:null,'include':_0x451fa6[_0x5900('0x15')]?_0x451fa6[_0x5900('0x15')][_0x5900('0x1a')]?_[_0x5900('0x1b')](_0x451fa6[_0x5900('0x15')][_0x5900('0x1a')],function(_0x2de94a){return{'model':db[_0x2de94a[_0x5900('0x1c')]],'as':_0x2de94a['as'],'attributes':_0x2de94a['attributes'],'include':_0x2de94a[_0x5900('0x1a')]?_[_0x5900('0x1b')](_0x2de94a['include'],function(_0x3a0ef1){return{'model':db[_0x3a0ef1[_0x5900('0x1c')]],'as':_0x3a0ef1['as'],'attributes':_0x3a0ef1[_0x5900('0x18')],'include':_0x3a0ef1[_0x5900('0x1a')]?_[_0x5900('0x1b')](_0x3a0ef1[_0x5900('0x1a')],function(_0x6b027){return{'model':db[_0x6b027[_0x5900('0x1c')]],'as':_0x6b027['as'],'attributes':_0x6b027[_0x5900('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5900('0x1d')](function(_0x102f4){logger[_0x5900('0xa')]('GetCmHopperBlack',_0x451fa6);logger['debug'](_0x5900('0x13'),_0x451fa6,JSON[_0x5900('0x1e')](_0x102f4));_0x4f7b9a(_0x102f4);})[_0x5900('0x12')](function(_0x24d914){logger['error']('GetCmHopperBlack',_0x24d914[_0x5900('0x11')],_0x451fa6);_0x59c029(_0x8bcc81[_0x5900('0xe')](0x1f4,_0x24d914['message']));});});};exports[_0x5900('0x1f')]=function(_0x1117e0){var _0x5d7746=this;return new Promise(function(_0x22e2fb,_0x5c3a4f){return db[_0x5900('0x14')][_0x5900('0x20')](_0x1117e0['body'],{'raw':_0x1117e0[_0x5900('0x15')]?_0x1117e0[_0x5900('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1117e0[_0x5900('0x15')]?_0x1117e0[_0x5900('0x15')][_0x5900('0x17')]||null:null,'attributes':_0x1117e0[_0x5900('0x15')]?_0x1117e0['options'][_0x5900('0x18')]||null:null,'limit':_0x1117e0[_0x5900('0x15')]?_0x1117e0['options'][_0x5900('0x19')]||null:null})[_0x5900('0x1d')](function(_0x5a8085){logger[_0x5900('0xa')](_0x5900('0x1f'),_0x1117e0);logger[_0x5900('0xc')](_0x5900('0x1f'),_0x1117e0,JSON[_0x5900('0x1e')](_0x5a8085));_0x22e2fb(_0x5a8085);})[_0x5900('0x12')](function(_0x1317aa){logger[_0x5900('0xe')](_0x5900('0x1f'),_0x1317aa[_0x5900('0x11')],_0x1117e0);_0x5c3a4f(_0x5d7746['error'](0x1f4,_0x1317aa[_0x5900('0x11')]));});});};exports[_0x5900('0x21')]=function(_0x22c51b){var _0x24d7fc=this;return new Promise(function(_0x3ab52c,_0x17a085){return db[_0x5900('0x14')]['destroy']({'where':_0x22c51b['options']?_0x22c51b['options']['where']||null:null})['then'](function(_0x5e6132){logger[_0x5900('0xa')](_0x5900('0x21'),_0x22c51b);logger[_0x5900('0xc')]('DestroyCmHopperBlack',_0x22c51b,JSON[_0x5900('0x1e')](_0x5e6132));_0x3ab52c(_0x5e6132);})[_0x5900('0x12')](function(_0x26b717){logger[_0x5900('0xe')]('DestroyCmHopperBlack',_0x26b717['message'],_0x22c51b);_0x17a085(_0x24d7fc['error'](0x1f4,_0x26b717[_0x5900('0x11')]));});});};
\ No newline at end of file
+var _0x95ee=['request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','options','raw','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','body','where','debug','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopperBlack,\x20%s,\x20%s'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x95ee,0xc6));var _0xe95e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x95ee[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xe95e('0x0'));var util=require('util');var moment=require(_0xe95e('0x1'));var BPromise=require(_0xe95e('0x2'));var rs=require(_0xe95e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe95e('0x4'));var logger=require('../../config/logger')(_0xe95e('0x5'));var config=require(_0xe95e('0x6'));var jayson=require(_0xe95e('0x7'));var client=jayson[_0xe95e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f74ad,_0x477553,_0x399812){return new BPromise(function(_0x3ebf6a,_0x5ba994){return client['request'](_0x2f74ad,_0x399812)[_0xe95e('0x9')](function(_0x4b779d){logger[_0xe95e('0xa')](_0xe95e('0xb'),_0x477553,_0xe95e('0xc'));logger['debug'](_0xe95e('0xd'),_0x477553,_0xe95e('0xc'),JSON[_0xe95e('0xe')](_0x4b779d));if(_0x4b779d['error']){if(_0x4b779d[_0xe95e('0xf')][_0xe95e('0x10')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x477553,_0x4b779d[_0xe95e('0xf')][_0xe95e('0x11')]);return _0x5ba994(_0x4b779d['error'][_0xe95e('0x11')]);}logger['error'](_0xe95e('0xb'),_0x477553,_0x4b779d[_0xe95e('0xf')][_0xe95e('0x11')]);return _0x3ebf6a(_0x4b779d[_0xe95e('0xf')]['message']);}else{logger[_0xe95e('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x477553,'request\x20sent');_0x3ebf6a(_0x4b779d[_0xe95e('0x12')]['message']);}})[_0xe95e('0x13')](function(_0x285840){logger[_0xe95e('0xf')](_0xe95e('0xb'),_0x477553,_0x285840);_0x5ba994(_0x285840);});});}exports[_0xe95e('0x14')]=function(_0x573f3a){var _0x1c8619=this;return new Promise(function(_0xadf3ad,_0x2e47d7){return db['CmHopperBlack']['findAll']({'raw':_0x573f3a[_0xe95e('0x15')]?_0x573f3a[_0xe95e('0x15')][_0xe95e('0x16')]===undefined?!![]:![]:!![],'where':_0x573f3a[_0xe95e('0x15')]?_0x573f3a[_0xe95e('0x15')]['where']||null:null,'attributes':_0x573f3a['options']?_0x573f3a[_0xe95e('0x15')][_0xe95e('0x17')]||null:null,'limit':_0x573f3a[_0xe95e('0x15')]?_0x573f3a[_0xe95e('0x15')][_0xe95e('0x18')]||null:null,'include':_0x573f3a[_0xe95e('0x15')]?_0x573f3a['options'][_0xe95e('0x19')]?_[_0xe95e('0x1a')](_0x573f3a[_0xe95e('0x15')]['include'],function(_0x2f550a){return{'model':db[_0x2f550a[_0xe95e('0x1b')]],'as':_0x2f550a['as'],'attributes':_0x2f550a[_0xe95e('0x17')],'include':_0x2f550a[_0xe95e('0x19')]?_[_0xe95e('0x1a')](_0x2f550a[_0xe95e('0x19')],function(_0x426181){return{'model':db[_0x426181[_0xe95e('0x1b')]],'as':_0x426181['as'],'attributes':_0x426181[_0xe95e('0x17')],'include':_0x426181[_0xe95e('0x19')]?_['map'](_0x426181['include'],function(_0xde6c72){return{'model':db[_0xde6c72[_0xe95e('0x1b')]],'as':_0xde6c72['as'],'attributes':_0xde6c72[_0xe95e('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe95e('0x9')](function(_0x1a9cc3){logger[_0xe95e('0xa')](_0xe95e('0x14'),_0x573f3a);logger['debug'](_0xe95e('0x14'),_0x573f3a,JSON[_0xe95e('0xe')](_0x1a9cc3));_0xadf3ad(_0x1a9cc3);})['catch'](function(_0x2e6ca2){logger[_0xe95e('0xf')](_0xe95e('0x14'),_0x2e6ca2[_0xe95e('0x11')],_0x573f3a);_0x2e47d7(_0x1c8619[_0xe95e('0xf')](0x1f4,_0x2e6ca2['message']));});});};exports[_0xe95e('0x1c')]=function(_0x378616){var _0x49b9ec=this;return new Promise(function(_0x1613c7,_0x384710){return db[_0xe95e('0x1d')]['update'](_0x378616[_0xe95e('0x1e')],{'raw':_0x378616[_0xe95e('0x15')]?_0x378616['options'][_0xe95e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378616[_0xe95e('0x15')]?_0x378616[_0xe95e('0x15')][_0xe95e('0x1f')]||null:null,'attributes':_0x378616[_0xe95e('0x15')]?_0x378616[_0xe95e('0x15')][_0xe95e('0x17')]||null:null,'limit':_0x378616[_0xe95e('0x15')]?_0x378616['options'][_0xe95e('0x18')]||null:null})['then'](function(_0x460c13){logger[_0xe95e('0xa')](_0xe95e('0x1c'),_0x378616);logger[_0xe95e('0x20')]('UpdateCmHopperBlack',_0x378616,JSON[_0xe95e('0xe')](_0x460c13));_0x1613c7(_0x460c13);})[_0xe95e('0x13')](function(_0x281061){logger[_0xe95e('0xf')]('UpdateCmHopperBlack',_0x281061[_0xe95e('0x11')],_0x378616);_0x384710(_0x49b9ec[_0xe95e('0xf')](0x1f4,_0x281061['message']));});});};exports['DestroyCmHopperBlack']=function(_0x181600){var _0x2686b9=this;return new Promise(function(_0x19a9d0,_0x48169a){return db[_0xe95e('0x1d')][_0xe95e('0x21')]({'where':_0x181600[_0xe95e('0x15')]?_0x181600[_0xe95e('0x15')][_0xe95e('0x1f')]||null:null})[_0xe95e('0x9')](function(_0x25a3f2){logger[_0xe95e('0xa')](_0xe95e('0x22'),_0x181600);logger[_0xe95e('0x20')]('DestroyCmHopperBlack',_0x181600,JSON[_0xe95e('0xe')](_0x25a3f2));_0x19a9d0(_0x25a3f2);})[_0xe95e('0x13')](function(_0x427530){logger[_0xe95e('0xf')](_0xe95e('0x22'),_0x427530[_0xe95e('0x11')],_0x181600);_0x48169a(_0x2686b9[_0xe95e('0xf')](0x1f4,_0x427530[_0xe95e('0x11')]));});});};
\ No newline at end of file
index 6d0b03e..736545b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy'];(function(_0x447cae,_0x20c227){var _0x3f7765=function(_0x5dd876){while(--_0x5dd876){_0x447cae['push'](_0x447cae['shift']());}};_0x3f7765(++_0x20c227);}(_0xafc4,0x69));var _0x4afc=function(_0x5474e4,_0x6e8072){_0x5474e4=_0x5474e4-0x0;var _0x3130f3=_0xafc4[_0x5474e4];return _0x3130f3;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4afc('0xd')]('/:id',auth[_0x4afc('0x7')](),controller[_0x4afc('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x77d4=['get','isAuthenticated','index','describe','show','put','/:id','delete','destroy','util','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperBlack.controller'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x77d4,0x108));var _0x477d=function(_0x34da1e,_0x38364b){_0x34da1e=_0x34da1e-0x0;var _0x4f291c=_0x77d4[_0x34da1e];return _0x4f291c;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var fs_extra=require(_0x477d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x477d('0x4'));var controller=require(_0x477d('0x5'));router[_0x477d('0x6')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0x8')]);router[_0x477d('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x477d('0x9')]);router['get']('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0xa')]);router[_0x477d('0xb')](_0x477d('0xc'),auth[_0x477d('0x7')](),controller['update']);router[_0x477d('0xd')]('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0xe')]);module['exports']=router;
\ No newline at end of file
index 10f3056..7d37f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfebb=['setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','endtime'];(function(_0x4db679,_0x5520ed){var _0x18c325=function(_0x58ffaf){while(--_0x58ffaf){_0x4db679['push'](_0x4db679['shift']());}};_0x18c325(++_0x5520ed);}(_0xfebb,0x1f0));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbfeb('0x0'));var moment=require(_0xbfeb('0x1'));module[_0xbfeb('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xbfeb('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xbfeb('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbfeb('0x3')]},'calleridnum':{'type':Sequelize[_0xbfeb('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xbfeb('0x5')]},'responsetime':{'type':Sequelize[_0xbfeb('0x5')]},'answertime':{'type':Sequelize[_0xbfeb('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbfeb('0x5')]},'ringtime':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbfeb('0x3')]},'campaign':{'type':Sequelize[_0xbfeb('0x3')]},'campaigntype':{'type':Sequelize[_0xbfeb('0x3')]},'membername':{'type':Sequelize[_0xbfeb('0x3')]},'reason':{'type':Sequelize[_0xbfeb('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbfeb('0x3')]},'dispositionat':{'type':Sequelize[_0xbfeb('0x5')],'set':function(_0x5c0c59){var _0x15f80b=this[_0xbfeb('0x6')](_0xbfeb('0x7'));if(_0x15f80b&&_0x5c0c59){this[_0xbfeb('0x8')](_0xbfeb('0x9'),moment(_0x5c0c59)['diff'](moment(_0x15f80b),_0xbfeb('0xa')));}}},'amd':{'type':Sequelize[_0xbfeb('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbfeb('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xbfeb('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xbfeb('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xbfeb('0x5')]},'callback':{'type':Sequelize[_0xbfeb('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbfeb('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xbfeb('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbfeb('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x287f=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x287f,0xa3));var _0xf287=function(_0x2dc3cc,_0x3f4c9d){_0x2dc3cc=_0x2dc3cc-0x0;var _0x3caf31=_0x287f[_0x2dc3cc];return _0x3caf31;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf287('0x0')]={'state':{'type':Sequelize[_0xf287('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf287('0x2')]},'scheduledat':{'type':Sequelize[_0xf287('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf287('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xf287('0x2')]},'calleridnum':{'type':Sequelize[_0xf287('0x2')]},'calleridname':{'type':Sequelize[_0xf287('0x2')]},'starttime':{'type':Sequelize[_0xf287('0x3')]},'responsetime':{'type':Sequelize[_0xf287('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xf287('0x3')]},'endtime':{'type':Sequelize[_0xf287('0x3')]},'ringtime':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf287('0x2')]},'campaign':{'type':Sequelize[_0xf287('0x2')]},'campaigntype':{'type':Sequelize[_0xf287('0x2')]},'membername':{'type':Sequelize[_0xf287('0x2')]},'reason':{'type':Sequelize[_0xf287('0x2')]},'disposition':{'type':Sequelize[_0xf287('0x2')]},'secondDisposition':{'type':Sequelize[_0xf287('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xf287('0x3')],'set':function(_0x4b3137){var _0x3c8572=this[_0xf287('0x4')](_0xf287('0x5'));if(_0x3c8572&&_0x4b3137){this[_0xf287('0x6')](_0xf287('0x7'),moment(_0x4b3137)[_0xf287('0x8')](moment(_0x3c8572),_0xf287('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf287('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf287('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf287('0x3')]},'callback':{'type':Sequelize[_0xf287('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf287('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xf287('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf287('0x3')]},'recallme':{'type':Sequelize[_0xf287('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf287('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf287('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 75e14b0..01e929c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../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','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`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','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5d17,0x114));var _0x75d1=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x5d17[_0x26dfc5];return _0x566350;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));};
\ No newline at end of file
+var _0xf494=['find','describe','body','uniqueid','params','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','COUNT','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','ANY_VALUE(calleridnum)','field','NOW()','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','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','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','rows','catch','length'];(function(_0x2ccfec,_0x140d21){var _0x1223ba=function(_0x3d43d8){while(--_0x3d43d8){_0x2ccfec['push'](_0x2ccfec['shift']());}};_0x1223ba(++_0x140d21);}(_0xf494,0x1c6));var _0x4f49=function(_0x148366,_0x3ed660){_0x148366=_0x148366-0x0;var _0x4ff2fd=_0xf494[_0x148366];return _0x4ff2fd;};'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'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['CmHopperFinal'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['CmHopperFinal'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['describe']()[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,null))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x973099,_0x3ec266){if(_0x973099[_0x4f49('0x48')][_0x4f49('0x49')]){delete _0x973099[_0x4f49('0x48')][_0x4f49('0x49')];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'uniqueid':_0x973099[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x3ec266,null))[_0x4f49('0x25')](saveUpdates(_0x973099[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x3ec266,null))['catch'](handleError(_0x3ec266,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xce5121,_0x197670,_0x36bcc2){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'VoiceQueueId':_0xce5121[_0x4f49('0x4a')]['id']},'attributes':[[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x4f')))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f49('0x4b')]['literal'](_0x4f49('0x53')))),'congestionContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x54')))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x56')))),_0x4f49('0x57')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),'answeringMachine']]})[_0x4f49('0x25')](handleEntityNotFound(_0x197670,null))['then'](respondWithResult(_0x197670,null))[_0x4f49('0x44')](handleError(_0x197670,null));};exports[_0x4f49('0x5a')]=function(_0x2a2b0d,_0x4aae7c,_0x1dade6){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'CampaignId':_0x2a2b0d[_0x4f49('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x203,\x201,\x20null'))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x53')))),_0x4f49('0x5b')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x56')))),'abandonedContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x58')))),_0x4f49('0x5c')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),_0x4f49('0x5d')]]})[_0x4f49('0x25')](handleEntityNotFound(_0x4aae7c,null))[_0x4f49('0x25')](respondWithResult(_0x4aae7c,null))[_0x4f49('0x44')](handleError(_0x4aae7c,null));};exports[_0x4f49('0x5e')]=function(_0x1f9161,_0x1434ea,_0x2c3962){return db[_0x4f49('0x5f')][_0x4f49('0x46')]({'where':{'id':_0x1f9161[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x1434ea,null))['then'](function(_0x3e9460){var _0x4ff0c1;if(_0x3e9460){_0x4ff0c1=squel[_0x4f49('0x60')]()[_0x4f49('0x61')](_0x4f49('0x62'))[_0x4f49('0x63')]([_0x4f49('0x64'),_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x68'),'createdAt','updatedAt'],squel[_0x4f49('0x69')]()['field'](_0x4f49('0x6a'),_0x4f49('0x64'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x65'))['field']('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')]('ANY_VALUE(ListId)',_0x4f49('0x67'))[_0x4f49('0x6b')]('ANY_VALUE(VoiceQueueId)',_0x4f49('0x68'))['field'](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x71'),_0x1f9161['params']['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x73'),_0x1f9161['body'][_0x4f49('0x74')]['toString']())[_0x4f49('0x38')](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')]('phone')[_0x4f49('0x6f')]('cm_hopper')[_0x4f49('0x38')]('VoiceQueueId\x20=\x20?',_0x1f9161['params']['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')](_0x4f49('0x77'))['from']('cm_hopper_final')['where'](_0x4f49('0x71'),_0x1f9161[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x78')))['group'](_0x4f49('0x66')))[_0x4f49('0x72')]();return db[_0x4f49('0x4b')]['query'](_0x4ff0c1);}return[];})[_0x4f49('0x25')](respondWithResult(_0x1434ea,null))[_0x4f49('0x44')](handleError(_0x1434ea,null));};exports[_0x4f49('0x79')]=function(_0x2902a1,_0x5ea6b4,_0x249799){return db[_0x4f49('0x7a')][_0x4f49('0x46')]({'where':{'id':_0x2902a1[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x5ea6b4,null))['then'](function(_0x2409a8){var _0x32539c;if(_0x2409a8){_0x32539c=squel['insert']()[_0x4f49('0x61')]('cm_hopper')[_0x4f49('0x63')](['phone',_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x7b'),_0x4f49('0x6d'),'updatedAt'],squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x6a'),_0x4f49('0x64'))['field'](_0x4f49('0x6c'),'scheduledAt')[_0x4f49('0x6b')]('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')](_0x4f49('0x7c'),_0x4f49('0x67'))[_0x4f49('0x6b')](_0x4f49('0x7d'),_0x4f49('0x7b'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1['params']['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x73'),_0x2902a1[_0x4f49('0x48')]['state'][_0x4f49('0x72')]())['where'](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()['field'](_0x4f49('0x64'))[_0x4f49('0x6f')](_0x4f49('0x62'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x77'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x78')))[_0x4f49('0x7f')](_0x4f49('0x66')))[_0x4f49('0x72')]();return db['sequelize'][_0x4f49('0x2f')](_0x32539c);}return[];})[_0x4f49('0x25')](respondWithResult(_0x5ea6b4,null))['catch'](handleError(_0x5ea6b4,null));};exports[_0x4f49('0x80')]=function(_0x57c86c,_0xf6bc4c,_0x3bc245){return db[_0x4f49('0x81')][_0x4f49('0x82')]({'where':{'VoiceQueueId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x68')],'CampaignId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x7b')],'ContactId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x66')]}})['then'](handleEntityNotFound(_0xf6bc4c,null))['then'](function(_0x32b4b4){if(_0x32b4b4){return _0x32b4b4;}return null;})['then'](respondWithResult(_0xf6bc4c,null))[_0x4f49('0x44')](handleError(_0xf6bc4c,null));};
\ No newline at end of file
index fb52dd7..dec29f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd5=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api'];(function(_0x4b92f2,_0x3c9438){var _0x1d42a2=function(_0x3e8d64){while(--_0x3e8d64){_0x4b92f2['push'](_0x4b92f2['shift']());}};_0x1d42a2(++_0x3c9438);}(_0x0fd5,0x177));var _0x50fd=function(_0xa4a4b6,_0x2240d8){_0xa4a4b6=_0xa4a4b6-0x0;var _0x2ccf18=_0x0fd5[_0xa4a4b6];return _0x2ccf18;};'use strict';var _=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var logger=require('../../config/logger')(_0x50fd('0x2'));var moment=require('moment');var BPromise=require(_0x50fd('0x3'));var rp=require(_0x50fd('0x4'));var fs=require('fs');var path=require(_0x50fd('0x5'));var rimraf=require(_0x50fd('0x6'));var config=require(_0x50fd('0x7'));var attributes=require(_0x50fd('0x8'));module['exports']=function(_0x51edaf,_0x13c79f){return _0x51edaf[_0x50fd('0x9')](_0x50fd('0xa'),attributes,{'tableName':_0x50fd('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x50fd('0xc')]},{'name':_0x50fd('0xd'),'fields':[_0x50fd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7415=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1e2cd3,_0x2682a6){var _0x2a4ab1=function(_0x84eb2e){while(--_0x84eb2e){_0x1e2cd3['push'](_0x1e2cd3['shift']());}};_0x2a4ab1(++_0x2682a6);}(_0x7415,0x1eb));var _0x5741=function(_0x3ae58f,_0x4fbdfb){_0x3ae58f=_0x3ae58f-0x0;var _0x4ffc39=_0x7415[_0x3ae58f];return _0x4ffc39;};'use strict';var _=require(_0x5741('0x0'));var util=require(_0x5741('0x1'));var logger=require(_0x5741('0x2'))(_0x5741('0x3'));var moment=require(_0x5741('0x4'));var BPromise=require(_0x5741('0x5'));var rp=require(_0x5741('0x6'));var fs=require('fs');var path=require(_0x5741('0x7'));var rimraf=require(_0x5741('0x8'));var config=require(_0x5741('0x9'));var attributes=require('./cmHopperFinal.attributes');module[_0x5741('0xa')]=function(_0x40405e,_0x5bb89f){return _0x40405e[_0x5741('0xb')](_0x5741('0xc'),attributes,{'tableName':_0x5741('0xd'),'paranoid':![],'indexes':[{'name':_0x5741('0xe'),'fields':[_0x5741('0xe')]},{'name':_0x5741('0xf'),'fields':[_0x5741('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index a1eb2e2..0e93945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x418eb7,_0x468f51){var _0x19348b=function(_0x1517a0){while(--_0x1517a0){_0x418eb7['push'](_0x418eb7['shift']());}};_0x19348b(++_0x468f51);}(_0xb10b,0x12a));var _0xbb10=function(_0x56aad3,_0x3d48bc){_0x56aad3=_0x56aad3-0x0;var _0x1d165a=_0xb10b[_0x56aad3];return _0x1d165a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x182101,_0x51b146){var _0xe67937=function(_0x127f04){while(--_0x127f04){_0x182101['push'](_0x182101['shift']());}};_0xe67937(++_0x51b146);}(_0xb10b,0x12a));var _0xbb10=function(_0x42fbdd,_0xbb21a3){_0x42fbdd=_0x42fbdd-0x0;var _0x525b95=_0xb10b[_0x42fbdd];return _0x525b95;};'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
index 3dae7a5..55625cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7f6=['/checkContactHopper','checkContactHopper','put','update','multer','util','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x26e487,_0x32d077){var _0x2d598a=function(_0x3ca0ad){while(--_0x3ca0ad){_0x26e487['push'](_0x26e487['shift']());}};_0x2d598a(++_0x32d077);}(_0xd7f6,0x154));var _0x6d7f=function(_0x51903c,_0x4334d9){_0x51903c=_0x51903c-0x0;var _0x2c0684=_0xd7f6[_0x51903c];return _0x2c0684;};'use strict';var multer=require(_0x6d7f('0x0'));var util=require(_0x6d7f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d7f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6d7f('0x3'));var interaction=require(_0x6d7f('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x6d7f('0x5')]('/',auth['isAuthenticated'](),controller[_0x6d7f('0x6')]);router[_0x6d7f('0x5')](_0x6d7f('0x7'),auth[_0x6d7f('0x8')](),controller[_0x6d7f('0x9')]);router['get'](_0x6d7f('0xa'),auth[_0x6d7f('0x8')](),controller[_0x6d7f('0xb')]);router[_0x6d7f('0x5')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x6d7f('0x5')](_0x6d7f('0xc'),auth[_0x6d7f('0x8')](),controller[_0x6d7f('0xd')]);router[_0x6d7f('0xe')]('/voice/queue/moveContacts/:id',auth[_0x6d7f('0x8')](),controller[_0x6d7f('0xf')]);router['post'](_0x6d7f('0x10'),auth[_0x6d7f('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x6d7f('0xe')](_0x6d7f('0x11'),auth[_0x6d7f('0x8')](),controller[_0x6d7f('0x12')]);router[_0x6d7f('0x13')](_0x6d7f('0xa'),auth[_0x6d7f('0x8')](),controller[_0x6d7f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x79c7=['/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79c7,0x1ad));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x779c('0x0'));var timeout=require(_0x779c('0x1'));var express=require(_0x779c('0x2'));var router=express[_0x779c('0x3')]();var fs_extra=require(_0x779c('0x4'));var auth=require(_0x779c('0x5'));var interaction=require(_0x779c('0x6'));var config=require(_0x779c('0x7'));var controller=require(_0x779c('0x8'));router[_0x779c('0x9')]('/',auth[_0x779c('0xa')](),controller[_0x779c('0xb')]);router[_0x779c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x779c('0xc')]);router[_0x779c('0x9')](_0x779c('0xd'),auth[_0x779c('0xa')](),controller['show']);router[_0x779c('0x9')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x779c('0xe')]);router[_0x779c('0x9')](_0x779c('0xf'),auth[_0x779c('0xa')](),controller[_0x779c('0x10')]);router[_0x779c('0x11')](_0x779c('0x12'),auth['isAuthenticated'](),controller[_0x779c('0x13')]);router[_0x779c('0x11')](_0x779c('0x14'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x779c('0x11')](_0x779c('0x15'),auth[_0x779c('0xa')](),controller[_0x779c('0x16')]);router[_0x779c('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x779c('0x18')]);module[_0x779c('0x19')]=router;
\ No newline at end of file
index 5e064b7..ee0c342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4031=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5a058a,_0x1348a3){var _0xe610e6=function(_0x484d25){while(--_0x484d25){_0x5a058a['push'](_0x5a058a['shift']());}};_0xe610e6(++_0x1348a3);}(_0x4031,0xf7));var _0x1403=function(_0x781488,_0x13c2df){_0x781488=_0x781488-0x0;var _0x24d34e=_0x4031[_0x781488];return _0x24d34e;};'use strict';var Sequelize=require(_0x1403('0x0'));module[_0x1403('0x1')]={'state':{'type':Sequelize[_0x1403('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1403('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1403('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1403('0x3')]},'calleridnum':{'type':Sequelize[_0x1403('0x3')]},'calleridname':{'type':Sequelize[_0x1403('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1403('0x4')]},'answertime':{'type':Sequelize[_0x1403('0x4')]},'droptime':{'type':Sequelize[_0x1403('0x4')]},'endtime':{'type':Sequelize[_0x1403('0x4')]},'ringtime':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1403('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x1403('0x3')]},'membername':{'type':Sequelize[_0x1403('0x3')]},'reason':{'type':Sequelize[_0x1403('0x3')]},'amd':{'type':Sequelize[_0x1403('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x1403('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1403('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x1403('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1403('0x4')]},'edited':{'type':Sequelize[_0x1403('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1403('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1403('0x3')]}};
\ No newline at end of file
+var _0xa8a0=['DATE','BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x363b15,_0x349093){var _0x30e930=function(_0xa71c9a){while(--_0xa71c9a){_0x363b15['push'](_0x363b15['shift']());}};_0x30e930(++_0x349093);}(_0xa8a0,0x9e));var _0x0a8a=function(_0x193bf7,_0x56c61a){_0x193bf7=_0x193bf7-0x0;var _0x27bae0=_0xa8a0[_0x193bf7];return _0x27bae0;};'use strict';var Sequelize=require(_0x0a8a('0x0'));module[_0x0a8a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0a8a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0a8a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0a8a('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0a8a('0x2')]},'calleridnum':{'type':Sequelize[_0x0a8a('0x2')]},'calleridname':{'type':Sequelize[_0x0a8a('0x2')]},'starttime':{'type':Sequelize[_0x0a8a('0x4')]},'responsetime':{'type':Sequelize[_0x0a8a('0x4')]},'answertime':{'type':Sequelize[_0x0a8a('0x4')]},'droptime':{'type':Sequelize[_0x0a8a('0x4')]},'endtime':{'type':Sequelize[_0x0a8a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0a8a('0x2')]},'membername':{'type':Sequelize[_0x0a8a('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0a8a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0a8a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0a8a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0a8a('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0a8a('0x4')]},'edited':{'type':Sequelize[_0x0a8a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0a8a('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0a8a('0x2')]}};
\ No newline at end of file
index a298df7..877d468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aae=['then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','merge','find','create','describe','uniqueid','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x460d7c,_0x110e7d){var _0x3fb2fa=function(_0x4a52e3){while(--_0x4a52e3){_0x460d7c['push'](_0x460d7c['shift']());}};_0x3fb2fa(++_0x110e7d);}(_0x6aae,0x1e4));var _0xe6aa=function(_0x1a6145,_0xfc79cf){_0x1a6145=_0x1a6145-0x0;var _0x5402f8=_0x6aae[_0x1a6145];return _0x5402f8;};'use strict';var emlformat=require(_0xe6aa('0x0'));var rimraf=require(_0xe6aa('0x1'));var zipdir=require(_0xe6aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe6aa('0x3'));var BPromise=require(_0xe6aa('0x4'));var Mustache=require('mustache');var util=require(_0xe6aa('0x5'));var path=require(_0xe6aa('0x6'));var sox=require(_0xe6aa('0x7'));var csv=require(_0xe6aa('0x8'));var ejs=require(_0xe6aa('0x9'));var fs=require('fs');var fs_extra=require(_0xe6aa('0xa'));var _=require(_0xe6aa('0xb'));var squel=require(_0xe6aa('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6aa('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe6aa('0xe'));var qs=require(_0xe6aa('0xf'));var as=require(_0xe6aa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6aa('0x11'))('api');var utils=require(_0xe6aa('0x12'));var config=require(_0xe6aa('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6aa('0x14'))['db'];function respondWithStatusCode(_0x3f8bd1,_0x5aa899){_0x5aa899=_0x5aa899||0xcc;return function(_0x470719){if(_0x470719){return _0x3f8bd1[_0xe6aa('0x15')](_0x5aa899);}return _0x3f8bd1[_0xe6aa('0x16')](_0x5aa899)[_0xe6aa('0x17')]();};}function respondWithResult(_0x36f309,_0x4b89fa){_0x4b89fa=_0x4b89fa||0xc8;return function(_0x10a06f){if(_0x10a06f){return _0x36f309['status'](_0x4b89fa)[_0xe6aa('0x18')](_0x10a06f);}};}function respondWithFilteredResult(_0x22fbc1,_0x4ad1b3){return function(_0x5ae7cb){if(_0x5ae7cb){var _0x46ac5d=typeof _0x4ad1b3[_0xe6aa('0x19')]===_0xe6aa('0x1a')&&typeof _0x4ad1b3[_0xe6aa('0x1b')]===_0xe6aa('0x1a');var _0x5a97f0=_0x5ae7cb['count'];var _0x307684=_0x46ac5d?0x0:_0x4ad1b3[_0xe6aa('0x19')];var _0x18dbec=_0x46ac5d?_0x5ae7cb[_0xe6aa('0x1c')]:_0x4ad1b3[_0xe6aa('0x19')]+_0x4ad1b3[_0xe6aa('0x1b')];var _0x2a9864;if(_0x18dbec>=_0x5a97f0){_0x18dbec=_0x5a97f0;_0x2a9864=0xc8;}else{_0x2a9864=0xce;}_0x22fbc1['status'](_0x2a9864);return _0x22fbc1[_0xe6aa('0x1d')](_0xe6aa('0x1e'),_0x307684+'-'+_0x18dbec+'/'+_0x5a97f0)['json'](_0x5ae7cb);}return null;};}function patchUpdates(_0x34ded3){return function(_0x3b2225){try{jsonpatch[_0xe6aa('0x1f')](_0x3b2225,_0x34ded3,!![]);}catch(_0x259175){return BPromise['reject'](_0x259175);}return _0x3b2225[_0xe6aa('0x20')]();};}function saveUpdates(_0x3518ae,_0x4a1a91){return function(_0x3fc891){if(_0x3fc891){return _0x3fc891[_0xe6aa('0x21')](_0x3518ae)[_0xe6aa('0x22')](function(_0x19f151){return _0x19f151;});}return null;};}function removeEntity(_0x30c585,_0x48c8e2){return function(_0x930eed){if(_0x930eed){return _0x930eed[_0xe6aa('0x23')]()[_0xe6aa('0x22')](function(){_0x30c585[_0xe6aa('0x16')](0xcc)[_0xe6aa('0x17')]();});}};}function handleEntityNotFound(_0x50ac56,_0x16c3c1){return function(_0x42d029){if(!_0x42d029){_0x50ac56[_0xe6aa('0x15')](0x194);}return _0x42d029;};}function handleError(_0x253824,_0x2a3a5a){_0x2a3a5a=_0x2a3a5a||0x1f4;return function(_0x38840e){logger[_0xe6aa('0x24')](_0x38840e[_0xe6aa('0x25')]);if(_0x38840e['name']){delete _0x38840e[_0xe6aa('0x26')];}_0x253824[_0xe6aa('0x16')](_0x2a3a5a)[_0xe6aa('0x27')](_0x38840e);};}exports[_0xe6aa('0x28')]=function(_0x3f837a,_0x5cee2b){var _0x1397dc={},_0x1f1c8c={},_0x18d174={'count':0x0,'rows':[]};var _0x441554=_[_0xe6aa('0x29')](db[_0xe6aa('0x2a')][_0xe6aa('0x2b')],function(_0x530659){return{'name':_0x530659[_0xe6aa('0x2c')],'type':_0x530659[_0xe6aa('0x2d')][_0xe6aa('0x2e')]};});_0x1f1c8c[_0xe6aa('0x2f')]=_[_0xe6aa('0x29')](_0x441554,_0xe6aa('0x26'));_0x1f1c8c[_0xe6aa('0x30')]=_[_0xe6aa('0x31')](_0x3f837a[_0xe6aa('0x30')]);_0x1f1c8c[_0xe6aa('0x32')]=_['intersection'](_0x1f1c8c[_0xe6aa('0x2f')],_0x1f1c8c[_0xe6aa('0x30')]);_0x1397dc[_0xe6aa('0x33')]=_[_0xe6aa('0x34')](_0x1f1c8c['model'],qs['fields'](_0x3f837a[_0xe6aa('0x30')][_0xe6aa('0x35')]));_0x1397dc['attributes']=_0x1397dc[_0xe6aa('0x33')]['length']?_0x1397dc[_0xe6aa('0x33')]:_0x1f1c8c['model'];if(!_0x3f837a[_0xe6aa('0x30')]['hasOwnProperty']('nolimit')){_0x1397dc[_0xe6aa('0x1b')]=qs[_0xe6aa('0x1b')](_0x3f837a[_0xe6aa('0x30')]['limit']);_0x1397dc['offset']=qs['offset'](_0x3f837a[_0xe6aa('0x30')][_0xe6aa('0x19')]);}_0x1397dc[_0xe6aa('0x36')]=qs[_0xe6aa('0x37')](_0x3f837a[_0xe6aa('0x30')]['sort']);_0x1397dc[_0xe6aa('0x38')]=qs[_0xe6aa('0x32')](_[_0xe6aa('0x39')](_0x3f837a[_0xe6aa('0x30')],_0x1f1c8c[_0xe6aa('0x32')]),_0x441554);if(_0x3f837a[_0xe6aa('0x30')][_0xe6aa('0x3a')]){_0x1397dc['where']=_['merge'](_0x1397dc[_0xe6aa('0x38')],{'$or':_[_0xe6aa('0x29')](_0x441554,function(_0x26c911){if(_0x26c911[_0xe6aa('0x2d')]!==_0xe6aa('0x3b')){var _0x95afbb={};_0x95afbb[_0x26c911[_0xe6aa('0x26')]]={'$like':'%'+_0x3f837a[_0xe6aa('0x30')][_0xe6aa('0x3a')]+'%'};return _0x95afbb;}})});}_0x1397dc=_['merge']({},_0x1397dc,_0x3f837a[_0xe6aa('0x3c')]);var _0x2e43e6={'where':_0x1397dc['where']};return db[_0xe6aa('0x2a')][_0xe6aa('0x1c')](_0x2e43e6)[_0xe6aa('0x22')](function(_0x200fd9){_0x18d174[_0xe6aa('0x1c')]=_0x200fd9;if(_0x3f837a[_0xe6aa('0x30')][_0xe6aa('0x3d')]){_0x1397dc[_0xe6aa('0x3e')]=[{'all':!![]}];}return db[_0xe6aa('0x2a')][_0xe6aa('0x3f')](_0x1397dc);})[_0xe6aa('0x22')](function(_0x2572b5){_0x18d174['rows']=_0x2572b5;return _0x18d174;})[_0xe6aa('0x22')](respondWithFilteredResult(_0x5cee2b,_0x1397dc))[_0xe6aa('0x40')](handleError(_0x5cee2b,null));};exports[_0xe6aa('0x41')]=function(_0x1471c8,_0x4f8e9a){var _0x5da81a={'raw':!![],'where':{'id':_0x1471c8[_0xe6aa('0x42')]['id']}},_0x550aa4={};_0x550aa4[_0xe6aa('0x2f')]=_['keys'](db[_0xe6aa('0x2a')][_0xe6aa('0x2b')]);_0x550aa4[_0xe6aa('0x30')]=_[_0xe6aa('0x31')](_0x1471c8[_0xe6aa('0x30')]);_0x550aa4[_0xe6aa('0x32')]=_[_0xe6aa('0x34')](_0x550aa4[_0xe6aa('0x2f')],_0x550aa4[_0xe6aa('0x30')]);_0x5da81a[_0xe6aa('0x33')]=_[_0xe6aa('0x34')](_0x550aa4[_0xe6aa('0x2f')],qs[_0xe6aa('0x35')](_0x1471c8[_0xe6aa('0x30')][_0xe6aa('0x35')]));_0x5da81a[_0xe6aa('0x33')]=_0x5da81a[_0xe6aa('0x33')][_0xe6aa('0x43')]?_0x5da81a['attributes']:_0x550aa4[_0xe6aa('0x2f')];if(_0x1471c8[_0xe6aa('0x30')]['includeAll']){_0x5da81a[_0xe6aa('0x3e')]=[{'all':!![]}];}_0x5da81a=_[_0xe6aa('0x44')]({},_0x5da81a,_0x1471c8[_0xe6aa('0x3c')]);return db[_0xe6aa('0x2a')][_0xe6aa('0x45')](_0x5da81a)[_0xe6aa('0x22')](handleEntityNotFound(_0x4f8e9a,null))[_0xe6aa('0x22')](respondWithResult(_0x4f8e9a,null))['catch'](handleError(_0x4f8e9a,null));};exports[_0xe6aa('0x46')]=function(_0xed0b5e,_0x437890){return db['CmHopperHistory'][_0xe6aa('0x46')](_0xed0b5e['body'],{})[_0xe6aa('0x22')](respondWithResult(_0x437890,0xc9))[_0xe6aa('0x40')](handleError(_0x437890,null));};exports[_0xe6aa('0x47')]=function(_0xacb38c,_0x9f8a6e){return db['CmHopperHistory'][_0xe6aa('0x47')]()[_0xe6aa('0x22')](respondWithResult(_0x9f8a6e,null))[_0xe6aa('0x40')](handleError(_0x9f8a6e,null));};exports[_0xe6aa('0x21')]=function(_0x5f2125,_0x4479ac){if(_0x5f2125['body'][_0xe6aa('0x48')]){delete _0x5f2125[_0xe6aa('0x49')]['uniqueid'];}return db[_0xe6aa('0x2a')][_0xe6aa('0x45')]({'where':{'uniqueid':_0x5f2125['params']['id']}})[_0xe6aa('0x22')](handleEntityNotFound(_0x4479ac,null))[_0xe6aa('0x22')](saveUpdates(_0x5f2125[_0xe6aa('0x49')],null))['then'](respondWithResult(_0x4479ac,null))[_0xe6aa('0x40')](handleError(_0x4479ac,null));};
\ No newline at end of file
+var _0x56b9=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','rows','catch','params','length','include','options','find','create','body','describe','uniqueid','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0x56b9,0xdd));var _0x956b=function(_0x24c9b3,_0xcad610){_0x24c9b3=_0x24c9b3-0x0;var _0xc570f8=_0x56b9[_0x24c9b3];return _0xc570f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x956b('0x0'));var jsonpatch=require(_0x956b('0x1'));var rp=require(_0x956b('0x2'));var moment=require(_0x956b('0x3'));var BPromise=require(_0x956b('0x4'));var Mustache=require('mustache');var util=require(_0x956b('0x5'));var path=require(_0x956b('0x6'));var sox=require(_0x956b('0x7'));var csv=require(_0x956b('0x8'));var ejs=require(_0x956b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x956b('0xa'));var squel=require(_0x956b('0xb'));var crypto=require(_0x956b('0xc'));var jsforce=require(_0x956b('0xd'));var deskjs=require(_0x956b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x956b('0xf'));var Papa=require(_0x956b('0x10'));var Redis=require(_0x956b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x956b('0x12'));var as=require(_0x956b('0x13'));var hardwareService=require(_0x956b('0x14'));var logger=require(_0x956b('0x15'))(_0x956b('0x16'));var utils=require(_0x956b('0x17'));var config=require(_0x956b('0x18'));var licenseUtil=require(_0x956b('0x19'));var db=require(_0x956b('0x1a'))['db'];function respondWithStatusCode(_0x29a555,_0x53d22e){_0x53d22e=_0x53d22e||0xcc;return function(_0x2c02d6){if(_0x2c02d6){return _0x29a555[_0x956b('0x1b')](_0x53d22e);}return _0x29a555['status'](_0x53d22e)[_0x956b('0x1c')]();};}function respondWithResult(_0x3cffdb,_0x2a4c3c){_0x2a4c3c=_0x2a4c3c||0xc8;return function(_0x4b362e){if(_0x4b362e){return _0x3cffdb[_0x956b('0x1d')](_0x2a4c3c)[_0x956b('0x1e')](_0x4b362e);}};}function respondWithFilteredResult(_0x5351cc,_0x3c6220){return function(_0xf5528){if(_0xf5528){var _0x546c8d=typeof _0x3c6220[_0x956b('0x1f')]===_0x956b('0x20')&&typeof _0x3c6220['limit']==='undefined';var _0x17ba3f=_0xf5528[_0x956b('0x21')];var _0x5394ca=_0x546c8d?0x0:_0x3c6220['offset'];var _0x1c35d0=_0x546c8d?_0xf5528['count']:_0x3c6220[_0x956b('0x1f')]+_0x3c6220[_0x956b('0x22')];var _0x366e2f;if(_0x1c35d0>=_0x17ba3f){_0x1c35d0=_0x17ba3f;_0x366e2f=0xc8;}else{_0x366e2f=0xce;}_0x5351cc[_0x956b('0x1d')](_0x366e2f);return _0x5351cc['set'](_0x956b('0x23'),_0x5394ca+'-'+_0x1c35d0+'/'+_0x17ba3f)[_0x956b('0x1e')](_0xf5528);}return null;};}function patchUpdates(_0x24afc7){return function(_0x209071){try{jsonpatch[_0x956b('0x24')](_0x209071,_0x24afc7,!![]);}catch(_0x3adc48){return BPromise[_0x956b('0x25')](_0x3adc48);}return _0x209071[_0x956b('0x26')]();};}function saveUpdates(_0x3c812f,_0x149126){return function(_0x2de854){if(_0x2de854){return _0x2de854[_0x956b('0x27')](_0x3c812f)[_0x956b('0x28')](function(_0xa809a4){return _0xa809a4;});}return null;};}function removeEntity(_0x485656,_0x228554){return function(_0x2d8fed){if(_0x2d8fed){return _0x2d8fed[_0x956b('0x29')]()['then'](function(){_0x485656['status'](0xcc)[_0x956b('0x1c')]();});}};}function handleEntityNotFound(_0x535fb7,_0x59bc4c){return function(_0x25a255){if(!_0x25a255){_0x535fb7[_0x956b('0x1b')](0x194);}return _0x25a255;};}function handleError(_0x563ab4,_0x532e3a){_0x532e3a=_0x532e3a||0x1f4;return function(_0x3e3a0a){logger[_0x956b('0x2a')](_0x3e3a0a['stack']);if(_0x3e3a0a[_0x956b('0x2b')]){delete _0x3e3a0a[_0x956b('0x2b')];}_0x563ab4[_0x956b('0x1d')](_0x532e3a)[_0x956b('0x2c')](_0x3e3a0a);};}exports[_0x956b('0x2d')]=function(_0x15a3ff,_0x2fdcd3){var _0x59f520={},_0x13bba1={},_0x1024de={'count':0x0,'rows':[]};var _0x5a5921=_[_0x956b('0x2e')](db[_0x956b('0x2f')][_0x956b('0x30')],function(_0x4293fe){return{'name':_0x4293fe[_0x956b('0x31')],'type':_0x4293fe[_0x956b('0x32')][_0x956b('0x33')]};});_0x13bba1['model']=_[_0x956b('0x2e')](_0x5a5921,_0x956b('0x2b'));_0x13bba1[_0x956b('0x34')]=_[_0x956b('0x35')](_0x15a3ff[_0x956b('0x34')]);_0x13bba1[_0x956b('0x36')]=_['intersection'](_0x13bba1[_0x956b('0x37')],_0x13bba1[_0x956b('0x34')]);_0x59f520[_0x956b('0x38')]=_[_0x956b('0x39')](_0x13bba1[_0x956b('0x37')],qs[_0x956b('0x3a')](_0x15a3ff['query'][_0x956b('0x3a')]));_0x59f520[_0x956b('0x38')]=_0x59f520['attributes']['length']?_0x59f520[_0x956b('0x38')]:_0x13bba1[_0x956b('0x37')];if(!_0x15a3ff[_0x956b('0x34')]['hasOwnProperty'](_0x956b('0x3b'))){_0x59f520['limit']=qs['limit'](_0x15a3ff[_0x956b('0x34')][_0x956b('0x22')]);_0x59f520[_0x956b('0x1f')]=qs[_0x956b('0x1f')](_0x15a3ff[_0x956b('0x34')][_0x956b('0x1f')]);}_0x59f520[_0x956b('0x3c')]=qs['sort'](_0x15a3ff[_0x956b('0x34')][_0x956b('0x3d')]);_0x59f520['where']=qs[_0x956b('0x36')](_['pick'](_0x15a3ff[_0x956b('0x34')],_0x13bba1['filters']),_0x5a5921);if(_0x15a3ff[_0x956b('0x34')][_0x956b('0x3e')]){_0x59f520[_0x956b('0x3f')]=_[_0x956b('0x40')](_0x59f520[_0x956b('0x3f')],{'$or':_[_0x956b('0x2e')](_0x5a5921,function(_0x35f0cd){if(_0x35f0cd['type']!==_0x956b('0x41')){var _0x1fc36e={};_0x1fc36e[_0x35f0cd[_0x956b('0x2b')]]={'$like':'%'+_0x15a3ff[_0x956b('0x34')][_0x956b('0x3e')]+'%'};return _0x1fc36e;}})});}_0x59f520=_['merge']({},_0x59f520,_0x15a3ff['options']);var _0x4fe163={'where':_0x59f520['where']};return db[_0x956b('0x2f')][_0x956b('0x21')](_0x4fe163)[_0x956b('0x28')](function(_0x3d9d35){_0x1024de[_0x956b('0x21')]=_0x3d9d35;if(_0x15a3ff[_0x956b('0x34')][_0x956b('0x42')]){_0x59f520['include']=[{'all':!![]}];}return db[_0x956b('0x2f')]['findAll'](_0x59f520);})[_0x956b('0x28')](function(_0x5c191c){_0x1024de[_0x956b('0x43')]=_0x5c191c;return _0x1024de;})[_0x956b('0x28')](respondWithFilteredResult(_0x2fdcd3,_0x59f520))[_0x956b('0x44')](handleError(_0x2fdcd3,null));};exports['show']=function(_0x4b9ec1,_0x301b38){var _0x5c562f={'raw':!![],'where':{'id':_0x4b9ec1[_0x956b('0x45')]['id']}},_0x394177={};_0x394177[_0x956b('0x37')]=_[_0x956b('0x35')](db[_0x956b('0x2f')]['rawAttributes']);_0x394177[_0x956b('0x34')]=_[_0x956b('0x35')](_0x4b9ec1['query']);_0x394177[_0x956b('0x36')]=_[_0x956b('0x39')](_0x394177[_0x956b('0x37')],_0x394177[_0x956b('0x34')]);_0x5c562f[_0x956b('0x38')]=_[_0x956b('0x39')](_0x394177[_0x956b('0x37')],qs[_0x956b('0x3a')](_0x4b9ec1[_0x956b('0x34')][_0x956b('0x3a')]));_0x5c562f[_0x956b('0x38')]=_0x5c562f[_0x956b('0x38')][_0x956b('0x46')]?_0x5c562f['attributes']:_0x394177[_0x956b('0x37')];if(_0x4b9ec1[_0x956b('0x34')][_0x956b('0x42')]){_0x5c562f[_0x956b('0x47')]=[{'all':!![]}];}_0x5c562f=_[_0x956b('0x40')]({},_0x5c562f,_0x4b9ec1[_0x956b('0x48')]);return db[_0x956b('0x2f')][_0x956b('0x49')](_0x5c562f)[_0x956b('0x28')](handleEntityNotFound(_0x301b38,null))[_0x956b('0x28')](respondWithResult(_0x301b38,null))[_0x956b('0x44')](handleError(_0x301b38,null));};exports[_0x956b('0x4a')]=function(_0x2dce62,_0x32929f){return db['CmHopperHistory'][_0x956b('0x4a')](_0x2dce62[_0x956b('0x4b')],{})[_0x956b('0x28')](respondWithResult(_0x32929f,0xc9))['catch'](handleError(_0x32929f,null));};exports[_0x956b('0x4c')]=function(_0x5d5138,_0xace316){return db[_0x956b('0x2f')]['describe']()[_0x956b('0x28')](respondWithResult(_0xace316,null))['catch'](handleError(_0xace316,null));};exports['update']=function(_0x38456c,_0x359cca){if(_0x38456c['body'][_0x956b('0x4d')]){delete _0x38456c[_0x956b('0x4b')]['uniqueid'];}return db[_0x956b('0x2f')][_0x956b('0x49')]({'where':{'uniqueid':_0x38456c[_0x956b('0x45')]['id']}})[_0x956b('0x28')](handleEntityNotFound(_0x359cca,null))['then'](saveUpdates(_0x38456c[_0x956b('0x4b')],null))[_0x956b('0x28')](respondWithResult(_0x359cca,null))[_0x956b('0x44')](handleError(_0x359cca,null));};
\ No newline at end of file
index 5da8741..b672c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6e=['request-promise','path','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','bluebird'];(function(_0x2bd0b4,_0x4d42b5){var _0x3096dd=function(_0x3bd8ba){while(--_0x3bd8ba){_0x2bd0b4['push'](_0x2bd0b4['shift']());}};_0x3096dd(++_0x4d42b5);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x22f2be,_0xe46a1){_0x22f2be=_0x22f2be-0x0;var _0x187b5c=_0x5b6e[_0x22f2be];return _0x187b5c;};'use strict';var _=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var logger=require('../../config/logger')(_0xe5b6('0x2'));var moment=require('moment');var BPromise=require(_0xe5b6('0x3'));var rp=require(_0xe5b6('0x4'));var fs=require('fs');var path=require(_0xe5b6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5b6('0x6'));module[_0xe5b6('0x7')]=function(_0x2dea90,_0x2dea7d){return _0x2dea90['define'](_0xe5b6('0x8'),attributes,{'tableName':_0xe5b6('0x9'),'paranoid':![],'indexes':[{'name':_0xe5b6('0xa'),'fields':['endtime']},{'name':_0xe5b6('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c45=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime'];(function(_0x6b89e8,_0x4f04ac){var _0x26336c=function(_0x114250){while(--_0x114250){_0x6b89e8['push'](_0x6b89e8['shift']());}};_0x26336c(++_0x4f04ac);}(_0x6c45,0xb1));var _0x56c4=function(_0x564062,_0x22c384){_0x564062=_0x564062-0x0;var _0x31c628=_0x6c45[_0x564062];return _0x31c628;};'use strict';var _=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var logger=require('../../config/logger')(_0x56c4('0x2'));var moment=require(_0x56c4('0x3'));var BPromise=require(_0x56c4('0x4'));var rp=require(_0x56c4('0x5'));var fs=require('fs');var path=require(_0x56c4('0x6'));var rimraf=require(_0x56c4('0x7'));var config=require(_0x56c4('0x8'));var attributes=require(_0x56c4('0x9'));module[_0x56c4('0xa')]=function(_0x3cc49e,_0x1fcb9e){return _0x3cc49e[_0x56c4('0xb')](_0x56c4('0xc'),attributes,{'tableName':_0x56c4('0xd'),'paranoid':![],'indexes':[{'name':_0x56c4('0xe'),'fields':[_0x56c4('0xe')]},{'name':_0x56c4('0xf'),'fields':[_0x56c4('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 0d600dd..c4e51be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x151a=['`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','catch','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x151a,0x12f));var _0xa151=function(_0x13cf7a,_0x479809){_0x13cf7a=_0x13cf7a-0x0;var _0x5cb678=_0x151a[_0x13cf7a];return _0x5cb678;};'use strict';var _=require(_0xa151('0x0'));var util=require(_0xa151('0x1'));var moment=require(_0xa151('0x2'));var BPromise=require(_0xa151('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa151('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa151('0x5'));var logger=require('../../config/logger')(_0xa151('0x6'));var config=require(_0xa151('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa151('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47040f,_0x331be1,_0x2e5ae3){return new BPromise(function(_0x1eed07,_0x242531){return client['request'](_0x47040f,_0x2e5ae3)[_0xa151('0x9')](function(_0x2f8c69){logger[_0xa151('0xa')](_0xa151('0xb'),_0x331be1,_0xa151('0xc'));logger[_0xa151('0xd')](_0xa151('0xe'),_0x331be1,_0xa151('0xc'),JSON[_0xa151('0xf')](_0x2f8c69));if(_0x2f8c69[_0xa151('0x10')]){if(_0x2f8c69['error'][_0xa151('0x11')]===0x1f4){logger[_0xa151('0x10')](_0xa151('0xb'),_0x331be1,_0x2f8c69['error'][_0xa151('0x12')]);return _0x242531(_0x2f8c69['error'][_0xa151('0x12')]);}logger[_0xa151('0x10')](_0xa151('0xb'),_0x331be1,_0x2f8c69[_0xa151('0x10')][_0xa151('0x12')]);return _0x1eed07(_0x2f8c69[_0xa151('0x10')][_0xa151('0x12')]);}else{logger['info'](_0xa151('0xb'),_0x331be1,'request\x20sent');_0x1eed07(_0x2f8c69[_0xa151('0x13')][_0xa151('0x12')]);}})['catch'](function(_0xf297e0){logger[_0xa151('0x10')](_0xa151('0xb'),_0x331be1,_0xf297e0);_0x242531(_0xf297e0);});});}exports[_0xa151('0x14')]=function(_0x3bb57f){var _0x4fa75e=this;return new Promise(function(_0x1c4438,_0x147904){return db[_0xa151('0x15')][_0xa151('0x16')](_0x3bb57f[_0xa151('0x17')],{'raw':_0x3bb57f[_0xa151('0x18')]?_0x3bb57f['options'][_0xa151('0x19')]===undefined?!![]:![]:!![]})[_0xa151('0x9')](function(_0x409e0a){logger[_0xa151('0xa')](_0xa151('0x14'),_0x3bb57f);logger[_0xa151('0xd')](_0xa151('0x14'),_0x3bb57f,JSON[_0xa151('0xf')](_0x409e0a));_0x1c4438(_0x409e0a);})[_0xa151('0x1a')](function(_0x4ba9c4){logger['error'](_0xa151('0x14'),_0x4ba9c4['message'],_0x3bb57f);_0x147904(_0x4fa75e['error'](0x1f4,_0x4ba9c4['message']));});});};exports['AvgHandleTime']=function(_0x181a97){var _0x2a6365=this;return new Promise(function(_0x3a14c6,_0x26e4df){return db[_0xa151('0x15')][_0xa151('0x1b')]({'raw':_0x181a97[_0xa151('0x18')]?_0x181a97[_0xa151('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x181a97[_0xa151('0x18')]?_0x181a97[_0xa151('0x18')][_0xa151('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')][_0xa151('0x1f')]('id')),_0xa151('0x20')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x22')))),_0xa151('0x23')],[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x24')))),_0xa151('0x25')],[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize'][_0xa151('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0xa151('0x26')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x27'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize'][_0xa151('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa151('0x1e')]['fn'](_0xa151('0x27'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x3aefb2){logger[_0xa151('0xa')]('AvgHandleTime',_0x181a97);logger[_0xa151('0xd')](_0xa151('0x28'),_0x181a97,JSON[_0xa151('0xf')](_0x3aefb2));_0x3a14c6(_0x3aefb2);})['catch'](function(_0x47885e){logger['error'](_0xa151('0x28'),_0x47885e['message'],_0x181a97);_0x26e4df(_0x2a6365[_0xa151('0x10')](0x1f4,_0x47885e['message']));});});};exports[_0xa151('0x29')]=function(_0x38ca73){var _0x8a4d9e=this;return new Promise(function(_0x57a6e2,_0x36a4e7){return db['CmHopperHistory']['findAll']({'raw':_0x38ca73[_0xa151('0x18')]?_0x38ca73[_0xa151('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x38ca73['options']?_0x38ca73[_0xa151('0x18')][_0xa151('0x1c')]||null:null,'attributes':[[_0xa151('0x2a'),'name'],[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xa151('0x2b')))),_0xa151('0x2c')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xa151('0x21')](_0xa151('0x2d')))),'outboundNoAnswerCallsDay'],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xa151('0x2e')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x2f')))),_0xa151('0x30')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize'][_0xa151('0x21')](_0xa151('0x31')))),_0xa151('0x32')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x33')))),_0xa151('0x34')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x35')))),_0xa151('0x36')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')]['literal'](_0xa151('0x37')))),_0xa151('0x38')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize'][_0xa151('0x21')](_0xa151('0x39')))),_0xa151('0x3a')],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db['sequelize']['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x3b')))),_0xa151('0x3c')],[db[_0xa151('0x1e')]['fn']('COUNT',db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')]['literal'](_0xa151('0x3d')))),_0xa151('0x3e')],[db[_0xa151('0x1e')]['fn']('COUNT',db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x3f')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')]['fn']('IF',db['sequelize'][_0xa151('0x21')](_0xa151('0x40')))),_0xa151('0x3e')],[db[_0xa151('0x1e')]['fn']('COUNT',db[_0xa151('0x1e')]['fn']('IF',db[_0xa151('0x1e')][_0xa151('0x21')](_0xa151('0x41')))),_0xa151('0x42')]],'group':[_0xa151('0x2a')]})[_0xa151('0x9')](function(_0x3571c9){logger['info'](_0xa151('0x29'),_0x38ca73);logger[_0xa151('0xd')](_0xa151('0x29'),_0x38ca73,JSON['stringify'](_0x3571c9));_0x57a6e2(_0x3571c9);})[_0xa151('0x1a')](function(_0x2236cc){logger['error'](_0xa151('0x29'),_0x2236cc['message'],_0x38ca73);_0x36a4e7(_0x8a4d9e[_0xa151('0x10')](0x1f4,_0x2236cc[_0xa151('0x12')]));});});};exports[_0xa151('0x43')]=function(_0x41ed13){var _0x59a5cd=this;return new Promise(function(_0x14924e,_0x16f538){return db[_0xa151('0x15')][_0xa151('0x1b')]({'raw':_0x41ed13[_0xa151('0x18')]?_0x41ed13['options'][_0xa151('0x19')]===undefined?!![]:![]:!![],'where':_0x41ed13[_0xa151('0x18')]?_0x41ed13[_0xa151('0x18')][_0xa151('0x1c')]||null:null,'attributes':[[_0xa151('0x2a'),_0xa151('0x44')],[db['sequelize']['fn'](_0xa151('0x1d'),db[_0xa151('0x1e')][_0xa151('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0xa151('0x1e')]['fn'](_0xa151('0x1d'),db['sequelize']['fn']('IF',db[_0xa151('0x1e')]['literal'](_0xa151('0x22')))),_0xa151('0x45')]],'group':[_0xa151('0x2a')]})['then'](function(_0x37bed2){logger[_0xa151('0xa')](_0xa151('0x43'),_0x41ed13);logger[_0xa151('0xd')](_0xa151('0x43'),_0x41ed13,JSON[_0xa151('0xf')](_0x37bed2));_0x14924e(_0x37bed2);})[_0xa151('0x1a')](function(_0x395f77){logger[_0xa151('0x10')]('GetCampaignHopperHistory',_0x395f77[_0xa151('0x12')],_0x41ed13);_0x16f538(_0x59a5cd[_0xa151('0x10')](0x1f4,_0x395f77[_0xa151('0x12')]));});});};
\ No newline at end of file
+var _0xfc4c=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','info','CmHopperHistory,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','campaign','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','lodash','util'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0xfc4c,0xca));var _0xcfc4=function(_0x169748,_0x1eec30){_0x169748=_0x169748-0x0;var _0x4b03f9=_0xfc4c[_0x169748];return _0x4b03f9;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var moment=require(_0xcfc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc4('0x3'));var fs=require('fs');var Redis=require(_0xcfc4('0x4'));var db=require(_0xcfc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfc4('0x6'));var config=require(_0xcfc4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53486d,_0x560b1c,_0x4578f4){return new BPromise(function(_0x520566,_0x13b9f6){return client['request'](_0x53486d,_0x4578f4)['then'](function(_0x49b787){logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,'request\x20sent');logger[_0xcfc4('0xb')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x560b1c,'request\x20sent',JSON[_0xcfc4('0xc')](_0x49b787));if(_0x49b787[_0xcfc4('0xd')]){if(_0x49b787[_0xcfc4('0xd')][_0xcfc4('0xe')]===0x1f4){logger[_0xcfc4('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x560b1c,_0x49b787[_0xcfc4('0xd')]['message']);return _0x13b9f6(_0x49b787[_0xcfc4('0xd')]['message']);}logger[_0xcfc4('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x560b1c,_0x49b787['error'][_0xcfc4('0xf')]);return _0x520566(_0x49b787[_0xcfc4('0xd')]['message']);}else{logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,_0xcfc4('0x10'));_0x520566(_0x49b787['result']['message']);}})[_0xcfc4('0x11')](function(_0x47db36){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x560b1c,_0x47db36);_0x13b9f6(_0x47db36);});});}exports[_0xcfc4('0x12')]=function(_0x52cd7b){var _0x472694=this;return new Promise(function(_0x19887b,_0x5ac260){return db[_0xcfc4('0x13')][_0xcfc4('0x14')](_0x52cd7b[_0xcfc4('0x15')],{'raw':_0x52cd7b['options']?_0x52cd7b[_0xcfc4('0x16')][_0xcfc4('0x17')]===undefined?!![]:![]:!![]})[_0xcfc4('0x18')](function(_0x5ab7f5){logger[_0xcfc4('0x9')](_0xcfc4('0x12'),_0x52cd7b);logger[_0xcfc4('0xb')](_0xcfc4('0x12'),_0x52cd7b,JSON[_0xcfc4('0xc')](_0x5ab7f5));_0x19887b(_0x5ab7f5);})[_0xcfc4('0x11')](function(_0x467e3f){logger[_0xcfc4('0xd')](_0xcfc4('0x12'),_0x467e3f[_0xcfc4('0xf')],_0x52cd7b);_0x5ac260(_0x472694[_0xcfc4('0xd')](0x1f4,_0x467e3f['message']));});});};exports[_0xcfc4('0x19')]=function(_0x1fa48d){var _0x33c6d0=this;return new Promise(function(_0x486fd4,_0x390986){return db['CmHopperHistory'][_0xcfc4('0x1a')]({'raw':_0x1fa48d[_0xcfc4('0x16')]?_0x1fa48d[_0xcfc4('0x16')][_0xcfc4('0x17')]===undefined?!![]:![]:!![],'where':_0x1fa48d[_0xcfc4('0x16')]?_0x1fa48d[_0xcfc4('0x16')]['where']||null:null,'attributes':[[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')][_0xcfc4('0x1d')]('id')),_0xcfc4('0x1e')],[db['sequelize']['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x20')))),_0xcfc4('0x21')],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x22')))),_0xcfc4('0x23')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x25')))),_0xcfc4('0x26')],[db['sequelize']['fn'](_0xcfc4('0x24'),db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x27')))),_0xcfc4('0x28')]]})[_0xcfc4('0x18')](function(_0x3433c1){logger['info'](_0xcfc4('0x19'),_0x1fa48d);logger['debug'](_0xcfc4('0x19'),_0x1fa48d,JSON[_0xcfc4('0xc')](_0x3433c1));_0x486fd4(_0x3433c1);})[_0xcfc4('0x11')](function(_0xbe8f8){logger[_0xcfc4('0xd')](_0xcfc4('0x19'),_0xbe8f8[_0xcfc4('0xf')],_0x1fa48d);_0x390986(_0x33c6d0[_0xcfc4('0xd')](0x1f4,_0xbe8f8[_0xcfc4('0xf')]));});});};exports[_0xcfc4('0x29')]=function(_0x5dddab){var _0x6815da=this;return new Promise(function(_0x158920,_0x92af3e){return db[_0xcfc4('0x13')][_0xcfc4('0x1a')]({'raw':_0x5dddab['options']?_0x5dddab[_0xcfc4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5dddab[_0xcfc4('0x16')]?_0x5dddab[_0xcfc4('0x16')]['where']||null:null,'attributes':[['campaign','name'],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')]['literal'](_0xcfc4('0x2a')))),_0xcfc4('0x2b')],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x2c')))),_0xcfc4('0x2d')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db['sequelize']['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0xcfc4('0x2e')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x2f')))),_0xcfc4('0x30')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db['sequelize']['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x31')))),_0xcfc4('0x32')],[db['sequelize']['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x33')))),_0xcfc4('0x34')],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0xcfc4('0x35')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x36')))),_0xcfc4('0x37')],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xcfc4('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x39')))),_0xcfc4('0x3a')],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db[_0xcfc4('0x1b')]['fn']('IF',db[_0xcfc4('0x1b')][_0xcfc4('0x1f')](_0xcfc4('0x3c')))),'outboundRejectCallsDay'],[db[_0xcfc4('0x1b')]['fn'](_0xcfc4('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x3d')))),_0xcfc4('0x3e')]],'group':['campaign']})[_0xcfc4('0x18')](function(_0x44d0e5){logger[_0xcfc4('0x9')]('GetVoiceQueueHopperHistory',_0x5dddab);logger['debug'](_0xcfc4('0x29'),_0x5dddab,JSON[_0xcfc4('0xc')](_0x44d0e5));_0x158920(_0x44d0e5);})[_0xcfc4('0x11')](function(_0x6db24f){logger[_0xcfc4('0xd')]('GetVoiceQueueHopperHistory',_0x6db24f[_0xcfc4('0xf')],_0x5dddab);_0x92af3e(_0x6815da[_0xcfc4('0xd')](0x1f4,_0x6db24f[_0xcfc4('0xf')]));});});};exports[_0xcfc4('0x3f')]=function(_0x5147d8){var _0xfa3ad8=this;return new Promise(function(_0x18a99f,_0x3ac079){return db[_0xcfc4('0x13')][_0xcfc4('0x1a')]({'raw':_0x5147d8['options']?_0x5147d8[_0xcfc4('0x16')][_0xcfc4('0x17')]===undefined?!![]:![]:!![],'where':_0x5147d8[_0xcfc4('0x16')]?_0x5147d8[_0xcfc4('0x16')][_0xcfc4('0x40')]||null:null,'attributes':[[_0xcfc4('0x41'),'name'],[db['sequelize']['fn']('COUNT',db['sequelize'][_0xcfc4('0x1d')]('id')),'ivrTotalCallsDays'],[db[_0xcfc4('0x1b')]['fn']('COUNT',db[_0xcfc4('0x1b')]['fn']('IF',db['sequelize'][_0xcfc4('0x1f')](_0xcfc4('0x42')))),_0xcfc4('0x43')]],'group':[_0xcfc4('0x41')]})[_0xcfc4('0x18')](function(_0x1386bc){logger[_0xcfc4('0x9')](_0xcfc4('0x3f'),_0x5147d8);logger['debug'](_0xcfc4('0x3f'),_0x5147d8,JSON[_0xcfc4('0xc')](_0x1386bc));_0x18a99f(_0x1386bc);})[_0xcfc4('0x11')](function(_0x49ba8f){logger[_0xcfc4('0xd')](_0xcfc4('0x3f'),_0x49ba8f['message'],_0x5147d8);_0x3ac079(_0xfa3ad8[_0xcfc4('0xd')](0x1f4,_0x49ba8f['message']));});});};
\ No newline at end of file
index 7f98462..4d019a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e50=['get','/describe','/:id','isAuthenticated','show','post','create','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller'];(function(_0x435775,_0x463329){var _0x3823b6=function(_0x743703){while(--_0x743703){_0x435775['push'](_0x435775['shift']());}};_0x3823b6(++_0x463329);}(_0x3e50,0xe6));var _0x03e5=function(_0x4e4f82,_0x5e560f){_0x4e4f82=_0x4e4f82-0x0;var _0x538b22=_0x3e50[_0x4e4f82];return _0x538b22;};'use strict';var multer=require('multer');var util=require(_0x03e5('0x0'));var path=require(_0x03e5('0x1'));var timeout=require(_0x03e5('0x2'));var express=require(_0x03e5('0x3'));var router=express[_0x03e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03e5('0x5'));var interaction=require(_0x03e5('0x6'));var config=require('../../config/environment');var controller=require(_0x03e5('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x03e5('0x8')](_0x03e5('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x03e5('0xa'),auth[_0x03e5('0xb')](),controller[_0x03e5('0xc')]);router[_0x03e5('0xd')]('/',auth['isAuthenticated'](),controller[_0x03e5('0xe')]);router[_0x03e5('0xf')]('/:id',auth[_0x03e5('0xb')](),controller['update']);module[_0x03e5('0x10')]=router;
\ No newline at end of file
+var _0xaca0=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','update','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaca0,0x1cf));var _0x0aca=function(_0x563554,_0x5a6cf4){_0x563554=_0x563554-0x0;var _0x530a64=_0xaca0[_0x563554];return _0x530a64;};'use strict';var multer=require(_0x0aca('0x0'));var util=require('util');var path=require(_0x0aca('0x1'));var timeout=require('connect-timeout');var express=require(_0x0aca('0x2'));var router=express[_0x0aca('0x3')]();var fs_extra=require(_0x0aca('0x4'));var auth=require(_0x0aca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0aca('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x0aca('0x7')]('/',auth['isAuthenticated'](),controller[_0x0aca('0x8')]);router[_0x0aca('0x7')]('/describe',auth[_0x0aca('0x9')](),controller[_0x0aca('0xa')]);router[_0x0aca('0x7')](_0x0aca('0xb'),auth[_0x0aca('0x9')](),controller[_0x0aca('0xc')]);router['post']('/',auth[_0x0aca('0x9')](),controller[_0x0aca('0xd')]);router['put'](_0x0aca('0xb'),auth['isAuthenticated'](),controller[_0x0aca('0xe')]);module[_0x0aca('0xf')]=router;
\ No newline at end of file
index ab54bed..a3a340c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92f0=['STRING','exports'];(function(_0x4b8c1d,_0x139620){var _0x492880=function(_0x4156ed){while(--_0x4156ed){_0x4b8c1d['push'](_0x4b8c1d['shift']());}};_0x492880(++_0x139620);}(_0x92f0,0x10d));var _0x092f=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x92f0[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require('sequelize');module[_0x092f('0x0')]={'name':{'type':Sequelize[_0x092f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x092f('0x1')]},'dialPrefix':{'type':Sequelize[_0x092f('0x1')]}};
\ No newline at end of file
+var _0xc15b=['sequelize','STRING','name'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xc15b,0xe4));var _0xbc15=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xc15b[_0x31eb67];return _0x2a8cb8;};'use strict';var Sequelize=require(_0xbc15('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc15('0x1')],'unique':_0xbc15('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbc15('0x1')]},'dialPrefix':{'type':Sequelize[_0xbc15('0x1')]}};
\ No newline at end of file
index 8b11d84..3dff9ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc169=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmList','include','findAll','rows','params','includeAll','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','findOne','Disposition','removeDispositions','addContacts','tags','isArray','push','each','CmContact','omit','ids','success','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','order','ContactItemType','OrderBy','CmCustomField','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','additionalPhone_','description','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','toString','now','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','info','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','Lists','destroy','sendStatus','stack','name','map','rawAttributes','type','key','query','keys'];(function(_0x56c3f6,_0x26c937){var _0x5e48f7=function(_0x41ddaf){while(--_0x41ddaf){_0x56c3f6['push'](_0x56c3f6['shift']());}};_0x5e48f7(++_0x26c937);}(_0xc169,0x6c));var _0x9c16=function(_0x3eff47,_0x2796a1){_0x3eff47=_0x3eff47-0x0;var _0x8c1be2=_0xc169[_0x3eff47];return _0x8c1be2;};'use strict';var emlformat=require(_0x9c16('0x0'));var rimraf=require(_0x9c16('0x1'));var zipdir=require(_0x9c16('0x2'));var jsonpatch=require(_0x9c16('0x3'));var rp=require(_0x9c16('0x4'));var moment=require('moment');var BPromise=require(_0x9c16('0x5'));var Mustache=require(_0x9c16('0x6'));var util=require(_0x9c16('0x7'));var path=require(_0x9c16('0x8'));var sox=require('sox');var csv=require(_0x9c16('0x9'));var ejs=require(_0x9c16('0xa'));var fs=require('fs');var fs_extra=require(_0x9c16('0xb'));var _=require(_0x9c16('0xc'));var squel=require(_0x9c16('0xd'));var crypto=require(_0x9c16('0xe'));var jsforce=require(_0x9c16('0xf'));var deskjs=require(_0x9c16('0x10'));var toCsv=require(_0x9c16('0x9'));var querystring=require(_0x9c16('0x11'));var Papa=require(_0x9c16('0x12'));var Redis=require(_0x9c16('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9c16('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c16('0x15'));var logger=require('../../config/logger')(_0x9c16('0x16'));var utils=require(_0x9c16('0x17'));var config=require(_0x9c16('0x18'));var licenseUtil=require(_0x9c16('0x19'));var db=require(_0x9c16('0x1a'))['db'];var csv_results;config['redis']=_[_0x9c16('0x1b')](config[_0x9c16('0x1c')],{'host':_0x9c16('0x1d'),'port':0x18eb});var socket=require(_0x9c16('0x1e'))(new Redis(config[_0x9c16('0x1c')]));require(_0x9c16('0x1f'))[_0x9c16('0x20')](socket);function respondWithStatusCode(_0x2517a9,_0x29fefc){_0x29fefc=_0x29fefc||0xcc;return function(_0x2f5f17){if(_0x2f5f17){return _0x2517a9['sendStatus'](_0x29fefc);}return _0x2517a9[_0x9c16('0x21')](_0x29fefc)[_0x9c16('0x22')]();};}function respondWithResult(_0x1feefe,_0x10c414){_0x10c414=_0x10c414||0xc8;return function(_0x20a368){if(_0x20a368){return _0x1feefe['status'](_0x10c414)[_0x9c16('0x23')](_0x20a368);}};}function respondWithFilteredResult(_0x342de0,_0x1aab14){return function(_0x3e6be0){if(_0x3e6be0){var _0x3e7996=typeof _0x1aab14['offset']===_0x9c16('0x24')&&typeof _0x1aab14[_0x9c16('0x25')]==='undefined';var _0x5edc1e=_0x3e6be0[_0x9c16('0x26')];var _0x1b4305=_0x3e7996?0x0:_0x1aab14[_0x9c16('0x27')];var _0x247645=_0x3e7996?_0x3e6be0[_0x9c16('0x26')]:_0x1aab14[_0x9c16('0x27')]+_0x1aab14[_0x9c16('0x25')];var _0x1d01f1;if(_0x247645>=_0x5edc1e){_0x247645=_0x5edc1e;_0x1d01f1=0xc8;}else{_0x1d01f1=0xce;}_0x342de0[_0x9c16('0x21')](_0x1d01f1);return _0x342de0[_0x9c16('0x28')](_0x9c16('0x29'),_0x1b4305+'-'+_0x247645+'/'+_0x5edc1e)[_0x9c16('0x23')](_0x3e6be0);}return null;};}function patchUpdates(_0x51722e){return function(_0x5c379b){try{jsonpatch[_0x9c16('0x2a')](_0x5c379b,_0x51722e,!![]);}catch(_0xa843e7){return BPromise['reject'](_0xa843e7);}return _0x5c379b[_0x9c16('0x2b')]();};}function saveUpdates(_0xf8716e,_0x2fa1f8){return function(_0xe9e03e){if(_0xe9e03e){return _0xe9e03e['update'](_0xf8716e)[_0x9c16('0x2c')](function(_0x481063){return _0x481063;});}return null;};}function removeEntity(_0x179edb,_0x2b6049){return function(_0x1d5fab){if(_0x1d5fab){return _0x1d5fab['destroy']()['then'](function(){var _0x220117=_0x1d5fab['get']({'plain':!![]});var _0xe5eb1a=_0x9c16('0x2d');return db['UserProfileResource'][_0x9c16('0x2e')]({'where':{'type':_0xe5eb1a,'resourceId':_0x220117['id']}})[_0x9c16('0x2c')](function(){return _0x1d5fab;});})[_0x9c16('0x2c')](function(){_0x179edb[_0x9c16('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7089,_0x3b5010){return function(_0x5a2984){if(!_0x5a2984){_0x4f7089[_0x9c16('0x2f')](0x194);}return _0x5a2984;};}function handleError(_0x3f94cb,_0x3c43b6){_0x3c43b6=_0x3c43b6||0x1f4;return function(_0x17cf9c){logger['error'](_0x17cf9c[_0x9c16('0x30')]);if(_0x17cf9c[_0x9c16('0x31')]){delete _0x17cf9c[_0x9c16('0x31')];}_0x3f94cb[_0x9c16('0x21')](_0x3c43b6)['send'](_0x17cf9c);};}exports['index']=function(_0x51ec1e,_0x1aa424){var _0x36fb5b={},_0x23d414={},_0x489780={'count':0x0,'rows':[]};var _0x513066=_[_0x9c16('0x32')](db['CmList'][_0x9c16('0x33')],function(_0x5ba374){return{'name':_0x5ba374['fieldName'],'type':_0x5ba374[_0x9c16('0x34')][_0x9c16('0x35')]};});_0x23d414['model']=_['map'](_0x513066,_0x9c16('0x31'));_0x23d414[_0x9c16('0x36')]=_[_0x9c16('0x37')](_0x51ec1e[_0x9c16('0x36')]);_0x23d414['filters']=_[_0x9c16('0x38')](_0x23d414[_0x9c16('0x39')],_0x23d414['query']);_0x36fb5b['attributes']=_[_0x9c16('0x38')](_0x23d414[_0x9c16('0x39')],qs[_0x9c16('0x3a')](_0x51ec1e[_0x9c16('0x36')]['fields']));_0x36fb5b[_0x9c16('0x3b')]=_0x36fb5b[_0x9c16('0x3b')][_0x9c16('0x3c')]?_0x36fb5b[_0x9c16('0x3b')]:_0x23d414['model'];if(!_0x51ec1e['query'][_0x9c16('0x3d')](_0x9c16('0x3e'))){_0x36fb5b['limit']=qs[_0x9c16('0x25')](_0x51ec1e[_0x9c16('0x36')][_0x9c16('0x25')]);_0x36fb5b[_0x9c16('0x27')]=qs[_0x9c16('0x27')](_0x51ec1e[_0x9c16('0x36')]['offset']);}_0x36fb5b['order']=qs['sort'](_0x51ec1e[_0x9c16('0x36')][_0x9c16('0x3f')]);_0x36fb5b[_0x9c16('0x40')]=qs[_0x9c16('0x41')](_[_0x9c16('0x42')](_0x51ec1e[_0x9c16('0x36')],_0x23d414['filters']),_0x513066);if(_0x51ec1e[_0x9c16('0x36')][_0x9c16('0x43')]){_0x36fb5b['where']=_[_0x9c16('0x44')](_0x36fb5b[_0x9c16('0x40')],{'$or':_['map'](_0x513066,function(_0x20b553){if(_0x20b553['type']!==_0x9c16('0x45')){var _0x3a9f17={};_0x3a9f17[_0x20b553[_0x9c16('0x31')]]={'$like':'%'+_0x51ec1e[_0x9c16('0x36')][_0x9c16('0x43')]+'%'};return _0x3a9f17;}})});}_0x36fb5b=_[_0x9c16('0x44')]({},_0x36fb5b,_0x51ec1e[_0x9c16('0x46')]);var _0xdb226c={'where':_0x36fb5b['where']};return db[_0x9c16('0x47')]['count'](_0xdb226c)[_0x9c16('0x2c')](function(_0x539424){_0x489780[_0x9c16('0x26')]=_0x539424;if(_0x51ec1e['query']['includeAll']){_0x36fb5b[_0x9c16('0x48')]=[{'all':!![]}];}return db[_0x9c16('0x47')][_0x9c16('0x49')](_0x36fb5b);})[_0x9c16('0x2c')](function(_0x593e51){_0x489780[_0x9c16('0x4a')]=_0x593e51;return _0x489780;})[_0x9c16('0x2c')](respondWithFilteredResult(_0x1aa424,_0x36fb5b))['catch'](handleError(_0x1aa424,null));};exports['show']=function(_0x5c116e,_0x379ab9){var _0x576ff3={'raw':![],'where':{'id':_0x5c116e[_0x9c16('0x4b')]['id']}},_0x72fb64={};_0x72fb64[_0x9c16('0x39')]=_[_0x9c16('0x37')](db[_0x9c16('0x47')][_0x9c16('0x33')]);_0x72fb64['query']=_[_0x9c16('0x37')](_0x5c116e[_0x9c16('0x36')]);_0x72fb64[_0x9c16('0x41')]=_[_0x9c16('0x38')](_0x72fb64[_0x9c16('0x39')],_0x72fb64[_0x9c16('0x36')]);_0x576ff3[_0x9c16('0x3b')]=_['intersection'](_0x72fb64[_0x9c16('0x39')],qs[_0x9c16('0x3a')](_0x5c116e['query'][_0x9c16('0x3a')]));_0x576ff3[_0x9c16('0x3b')]=_0x576ff3['attributes'][_0x9c16('0x3c')]?_0x576ff3[_0x9c16('0x3b')]:_0x72fb64[_0x9c16('0x39')];if(_0x5c116e['query'][_0x9c16('0x4c')]){_0x576ff3[_0x9c16('0x48')]=[{'all':!![]}];}_0x576ff3=_[_0x9c16('0x44')]({},_0x576ff3,_0x5c116e[_0x9c16('0x46')]);return db[_0x9c16('0x47')]['find'](_0x576ff3)[_0x9c16('0x2c')](handleEntityNotFound(_0x379ab9,null))[_0x9c16('0x2c')](respondWithResult(_0x379ab9,null))[_0x9c16('0x4d')](handleError(_0x379ab9,null));};exports['create']=function(_0x127726,_0x3d680e){return db[_0x9c16('0x47')][_0x9c16('0x4e')](_0x127726[_0x9c16('0x4f')],{})['then'](function(_0x2a251b){var _0x2e8cd1=_0x127726['user'][_0x9c16('0x50')]({'plain':!![]});if(!_0x2e8cd1)throw new Error(_0x9c16('0x51'));if(_0x2e8cd1[_0x9c16('0x52')]===_0x9c16('0x53')){var _0x108308=_0x2a251b['get']({'plain':!![]});var _0x50ecf5=_0x9c16('0x2d');return db[_0x9c16('0x54')][_0x9c16('0x55')]({'where':{'name':_0x50ecf5,'userProfileId':_0x2e8cd1['userProfileId']},'raw':!![]})['then'](function(_0x546a0e){if(_0x546a0e&&_0x546a0e[_0x9c16('0x56')]===0x0){return db[_0x9c16('0x57')][_0x9c16('0x4e')]({'name':_0x108308[_0x9c16('0x31')],'resourceId':_0x108308['id'],'type':_0x546a0e['name'],'sectionId':_0x546a0e['id']},{})[_0x9c16('0x2c')](function(){return _0x2a251b;});}else{return _0x2a251b;}})[_0x9c16('0x4d')](function(_0x303618){logger[_0x9c16('0x58')](_0x9c16('0x59'),_0x303618);throw _0x303618;});}return _0x2a251b;})['then'](respondWithResult(_0x3d680e,0xc9))[_0x9c16('0x4d')](handleError(_0x3d680e,null));};exports[_0x9c16('0x5a')]=function(_0x1f6435,_0xc465e1){if(_0x1f6435['body']['id']){delete _0x1f6435[_0x9c16('0x4f')]['id'];}return db['CmList'][_0x9c16('0x55')]({'where':{'id':_0x1f6435[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0xc465e1,null))[_0x9c16('0x2c')](saveUpdates(_0x1f6435[_0x9c16('0x4f')],null))['then'](respondWithResult(_0xc465e1,null))[_0x9c16('0x4d')](handleError(_0xc465e1,null));};exports['destroy']=function(_0x385bea,_0x17062b){return db[_0x9c16('0x47')]['find']({'where':{'id':_0x385bea[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x17062b,null))['then'](removeEntity(_0x17062b,null))[_0x9c16('0x4d')](handleError(_0x17062b,null));};exports[_0x9c16('0x5b')]=function(_0x31851e,_0x3b86bc){return db[_0x9c16('0x47')][_0x9c16('0x5b')]()[_0x9c16('0x2c')](respondWithResult(_0x3b86bc,null))[_0x9c16('0x4d')](handleError(_0x3b86bc,null));};exports[_0x9c16('0x5c')]=function(_0x4835a1,_0x543e3d,_0x242929){if(_0x4835a1[_0x9c16('0x4f')]['id']){delete _0x4835a1[_0x9c16('0x4f')]['id'];}return db['CmList'][_0x9c16('0x55')]({'where':{'id':_0x4835a1[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x543e3d,null))['then'](function(_0x5c4804){if(_0x5c4804){_0x4835a1[_0x9c16('0x4f')][_0x9c16('0x5d')]=_0x5c4804['id'];return db['Disposition'][_0x9c16('0x4e')](_0x4835a1[_0x9c16('0x4f')]);}})[_0x9c16('0x2c')](respondWithResult(_0x543e3d,null))[_0x9c16('0x4d')](handleError(_0x543e3d,null));};exports[_0x9c16('0x5e')]=function(_0x393720,_0x31dce3,_0x15db5a){var _0x1c9fe3={'raw':![],'where':{}};var _0x1350d5={};var _0xb1dcd={'count':0x0,'rows':[]};return db[_0x9c16('0x47')][_0x9c16('0x5f')]({'where':{'id':_0x393720['params']['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x31dce3,null))[_0x9c16('0x2c')](function(_0x4d77ec){if(_0x4d77ec){_0x1350d5['model']=_[_0x9c16('0x37')](db[_0x9c16('0x60')][_0x9c16('0x33')]);_0x1350d5['query']=_[_0x9c16('0x37')](_0x393720['query']);_0x1350d5['filters']=_[_0x9c16('0x38')](_0x1350d5[_0x9c16('0x39')],_0x1350d5[_0x9c16('0x36')]);_0x1c9fe3[_0x9c16('0x3b')]=_['intersection'](_0x1350d5['model'],qs[_0x9c16('0x3a')](_0x393720[_0x9c16('0x36')]['fields']));_0x1c9fe3[_0x9c16('0x3b')]=_0x1c9fe3['attributes'][_0x9c16('0x3c')]?_0x1c9fe3[_0x9c16('0x3b')]:_0x1350d5[_0x9c16('0x39')];if(!_0x393720['query'][_0x9c16('0x3d')](_0x9c16('0x3e'))){_0x1c9fe3[_0x9c16('0x25')]=qs[_0x9c16('0x25')](_0x393720[_0x9c16('0x36')][_0x9c16('0x25')]);_0x1c9fe3[_0x9c16('0x27')]=qs[_0x9c16('0x27')](_0x393720[_0x9c16('0x36')][_0x9c16('0x27')]);}_0x1c9fe3['order']=qs[_0x9c16('0x3f')](_0x393720[_0x9c16('0x36')]['sort']);_0x1c9fe3['where']=qs['filters'](_[_0x9c16('0x42')](_0x393720[_0x9c16('0x36')],_0x1350d5[_0x9c16('0x41')]));_0x1c9fe3[_0x9c16('0x40')]['ListId']=_0x4d77ec['id'];if(_0x393720['query']['filter']){_0x1c9fe3[_0x9c16('0x40')]=_['merge'](_0x1c9fe3[_0x9c16('0x40')],{'$or':_[_0x9c16('0x32')](_0x1c9fe3[_0x9c16('0x3b')],function(_0x35cb78){var _0x365e7b={};_0x365e7b[_0x35cb78]={'$like':'%'+_0x393720[_0x9c16('0x36')]['filter']+'%'};return _0x365e7b;})});}_0x1c9fe3=_[_0x9c16('0x44')]({},_0x1c9fe3,_0x393720[_0x9c16('0x46')]);return db[_0x9c16('0x60')]['count']({'where':_0x1c9fe3[_0x9c16('0x40')]})[_0x9c16('0x2c')](function(_0x5e3af2){_0xb1dcd[_0x9c16('0x26')]=_0x5e3af2;if(_0x393720[_0x9c16('0x36')]['includeAll']){_0x1c9fe3['include']=[{'all':!![]}];}return db['Disposition'][_0x9c16('0x49')](_0x1c9fe3);})['then'](function(_0x215446){_0xb1dcd[_0x9c16('0x4a')]=_0x215446;return _0xb1dcd;});}})[_0x9c16('0x2c')](respondWithFilteredResult(_0x31dce3,_0x1c9fe3))[_0x9c16('0x4d')](handleError(_0x31dce3,null));};exports[_0x9c16('0x61')]=function(_0x39913a,_0x236057,_0x1511e9){return db[_0x9c16('0x47')]['find']({'where':{'id':_0x39913a[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x236057,null))[_0x9c16('0x2c')](function(_0x57f22c){if(_0x57f22c){return _0x57f22c[_0x9c16('0x61')](_0x39913a[_0x9c16('0x36')]['ids']);}})[_0x9c16('0x2c')](respondWithStatusCode(_0x236057,null))['catch'](handleError(_0x236057,null));};exports[_0x9c16('0x62')]=function(_0x194fba,_0x4686bd,_0x28df15){return db['CmList'][_0x9c16('0x55')]({'where':{'id':_0x194fba['params']['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x4686bd,null))[_0x9c16('0x2c')](function(_0x111266){if(_0x111266){var _0x2e53d7=[];var _0xa23b0f={'success':[],'errors':[]};return db['CmContact'][_0x9c16('0x5b')]()[_0x9c16('0x2c')](function(_0x629cf3){if(_0x194fba['body']['tags']&&_['isArray'](_0x194fba[_0x9c16('0x4f')][_0x9c16('0x63')])){if(_0x194fba[_0x9c16('0x4f')][_0x9c16('0x63')]['length']){_0x194fba[_0x9c16('0x4f')]['tags']=_0x194fba[_0x9c16('0x4f')][_0x9c16('0x63')]['join'](';')+';';}else{_0x194fba[_0x9c16('0x4f')][_0x9c16('0x63')]=null;}}else{_0x194fba[_0x9c16('0x4f')][_0x9c16('0x63')]=null;}if(_0x194fba[_0x9c16('0x4f')]&&_[_0x9c16('0x64')](_0x194fba[_0x9c16('0x4f')])){for(var _0x3d129c=0x0;_0x3d129c<_0x194fba[_0x9c16('0x4f')]['length'];_0x3d129c+=0x1){_0x194fba[_0x9c16('0x4f')][_0x3d129c]['ListId']=_0x194fba[_0x9c16('0x4b')]['id'];_0x2e53d7[_0x9c16('0x65')](_0x194fba['body'][_0x3d129c]);}return BPromise[_0x9c16('0x66')](_0x2e53d7,function(_0x45d434){return db[_0x9c16('0x67')][_0x9c16('0x4e')](_[_0x9c16('0x68')](_0x45d434,[_0x9c16('0x69'),'id'])||{},{'fields':_[_0x9c16('0x37')](_0x629cf3),'raw':!![]})['then'](function(_0x24070f){_0xa23b0f[_0x9c16('0x6a')][_0x9c16('0x65')](_0x24070f['dataValues']);})[_0x9c16('0x4d')](function(_0x341ad0){_0xa23b0f[_0x9c16('0x6b')][_0x9c16('0x65')]({'data':_0x45d434,'error':_0x341ad0[_0x9c16('0x6c')]});});})['then'](function(_0x3f6271){return _0xa23b0f;})['catch'](function(_0x52438d){return _0x52438d;});}else{_0x4686bd[_0x9c16('0x21')](0x190)['json']({'message':_0x9c16('0x6d')});}});}})[_0x9c16('0x2c')](respondWithResult(_0x4686bd,null))[_0x9c16('0x4d')](handleError(_0x4686bd,null));};exports[_0x9c16('0x6e')]=function(_0x26ebdc,_0x5d28dd,_0x2d7601){var _0xba8953;return db[_0x9c16('0x47')][_0x9c16('0x55')]({'where':{'id':_0x26ebdc[_0x9c16('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x9c16('0x6f')}]})[_0x9c16('0x2c')](handleEntityNotFound(_0x5d28dd,null))[_0x9c16('0x2c')](function(_0x8c9596){if(_0x8c9596){_0xba8953=_0x8c9596;return db[_0x9c16('0x67')][_0x9c16('0x33')];}})[_0x9c16('0x2c')](function(_0x1a726d){if(_0x1a726d){var _0x3d2d0a={};var _0x5c9d76={};_0x5c9d76[_0x9c16('0x39')]=_['concat'](_[_0x9c16('0x37')](_0x1a726d),_['map'](_0xba8953[_0x9c16('0x6f')],function(_0x4b2720){return util[_0x9c16('0x70')](_0x9c16('0x71'),_0x4b2720['id']);}));_0x5c9d76[_0x9c16('0x36')]=_['keys'](_0x26ebdc[_0x9c16('0x36')]);_0x5c9d76['filters']=_['intersection'](_0x5c9d76['model'],_0x5c9d76[_0x9c16('0x36')]);_0x3d2d0a['attributes']=_[_0x9c16('0x38')](_0x5c9d76[_0x9c16('0x39')],qs[_0x9c16('0x3a')](_0x26ebdc[_0x9c16('0x36')]['fields']));_0x3d2d0a['attributes']=_0x3d2d0a['attributes']['length']?_0x3d2d0a[_0x9c16('0x3b')]:_0x5c9d76[_0x9c16('0x39')];if(!_0x26ebdc['query'][_0x9c16('0x3d')](_0x9c16('0x3e'))){_0x3d2d0a[_0x9c16('0x25')]=qs[_0x9c16('0x25')](_0x26ebdc[_0x9c16('0x36')][_0x9c16('0x25')]);_0x3d2d0a[_0x9c16('0x27')]=qs['offset'](_0x26ebdc[_0x9c16('0x36')]['offset']);}_0x3d2d0a[_0x9c16('0x72')]=qs['sort'](_0x26ebdc[_0x9c16('0x36')][_0x9c16('0x3f')]);_0x3d2d0a[_0x9c16('0x40')]=qs[_0x9c16('0x41')](_['pick'](_0x26ebdc[_0x9c16('0x36')],_0x5c9d76[_0x9c16('0x41')]));_0x3d2d0a['raw']=!![];if(_0x26ebdc[_0x9c16('0x36')][_0x9c16('0x43')]){_0x3d2d0a[_0x9c16('0x40')]=_[_0x9c16('0x44')](_0x3d2d0a[_0x9c16('0x40')],{'$or':_['map'](_0x3d2d0a[_0x9c16('0x3b')],function(_0x1fd4a4){var _0x1b47ae={};_0x1b47ae[_0x1fd4a4]={'$like':'%'+_0x26ebdc['query'][_0x9c16('0x43')]+'%'};return _0x1b47ae;})});}_0x3d2d0a=_['merge']({},_0x3d2d0a,_0x26ebdc[_0x9c16('0x46')]);return _0xba8953['getContacts'](_0x3d2d0a);}})[_0x9c16('0x2c')](respondWithResult(_0x5d28dd,null))[_0x9c16('0x4d')](handleError(_0x5d28dd,null));};exports['getContactsCsv']=function(_0xd92104,_0x3c837f,_0x59df93){var _0x2cdea1;var _0x32c658;var _0x445fda;var _0x32c860=_0xd92104[_0x9c16('0x4b')]['id'];csv_results=[];return db[_0x9c16('0x73')][_0x9c16('0x49')]({'attributes':['id',_0x9c16('0x31')],'raw':!![],'order':[_0x9c16('0x74')]})[_0x9c16('0x2c')](function(_0x22ea4a){_0x2cdea1=_0x22ea4a;var _0xcc60fa=_['keys'](db[_0x9c16('0x67')]['rawAttributes']);return db[_0x9c16('0x75')][_0x9c16('0x49')]({'raw':!![],'attributes':['id','alias']})[_0x9c16('0x2c')](function(_0x28403c){_0x32c658=_0x28403c;var _0x491017=squel[_0x9c16('0x76')]()[_0x9c16('0x3a')](_0xcc60fa)[_0x9c16('0x77')](_0x9c16('0x78'),'c')[_0x9c16('0x40')]('c.ListId\x20=\x20?',_0x32c860)[_0x9c16('0x40')](_0x9c16('0x79'))[_0x9c16('0x7a')]();for(var _0x1b0218=0x0;_0x1b0218<_0x32c658[_0x9c16('0x3c')];_0x1b0218++){_0x491017[_0x9c16('0x7b')](_0x9c16('0x7c')+_0x32c658[_0x1b0218]['id'],_0x9c16('0x7d')+_0x32c658[_0x1b0218][_0x9c16('0x7e')]);}for(var _0x1b0218=0x0;_0x1b0218<_0x2cdea1[_0x9c16('0x3c')];_0x1b0218++){_0x491017['field'](squel[_0x9c16('0x76')]()[_0x9c16('0x7b')](_0x9c16('0x7f'))[_0x9c16('0x77')](_0x9c16('0x80'))['where']('ItemTypeId\x20=\x20?',_0x2cdea1[_0x1b0218]['id'])[_0x9c16('0x40')]('CmContactId\x20=\x20c.id'),_0x9c16('0x81')+_0x2cdea1[_0x1b0218][_0x9c16('0x31')]);_0x491017[_0x9c16('0x7b')](squel['select']()[_0x9c16('0x7b')](_0x9c16('0x82'))['from'](_0x9c16('0x80'))[_0x9c16('0x40')](_0x9c16('0x83'),_0x2cdea1[_0x1b0218]['id'])[_0x9c16('0x40')](_0x9c16('0x84')),'description_additionalPhone_'+_0x2cdea1[_0x1b0218]['name']);}var _0x557543=[];_0x557543[_0x9c16('0x65')](_0x491017[_0x9c16('0x85')]());BPromise[_0x9c16('0x66')](_0x557543,handleQuery)[_0x9c16('0x2c')](function(_0x192e1b){handleQuery(_0x491017[_0x9c16('0x85')]());var _0x4ca1ce=csv_results[0x0];if(!_['isEmpty'](_0x4ca1ce)){var _0x57e0af=toCsv(_0x4ca1ce);var _0x5e8ec1=Date[_0x9c16('0x86')]();fs['writeFileSync'](util[_0x9c16('0x70')](_0x9c16('0x87'),_0x32c860,_0x5e8ec1),_0x57e0af);_0x3c837f[_0x9c16('0x88')]('Content-disposition',_0x9c16('0x89')+util[_0x9c16('0x70')](_0x9c16('0x8a'),_0x32c860,_0x5e8ec1));_0x3c837f[_0x9c16('0x88')](_0x9c16('0x8b'),'text/csv');return _0x3c837f[_0x9c16('0x8c')](util[_0x9c16('0x70')](_0x9c16('0x87'),_0x32c860,_0x5e8ec1));}else{return _0x3c837f['sendStatus'](0xcc);}});});});};exports[_0x9c16('0x8d')]=function(_0x3aa898,_0x17c8b1,_0x240c2e){var _0x5740ae;delete _0x3aa898['body']['id'];return db['CmList']['findOne']({'where':{'id':_0x3aa898[_0x9c16('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17c8b1,null))['then'](function(_0x5e6edd){if(_0x5e6edd){return db[_0x9c16('0x8e')][_0x9c16('0x8f')](function(_0x155467){return db[_0x9c16('0x75')][_0x9c16('0x4e')](_0x3aa898[_0x9c16('0x4f')],{'transaction':_0x155467})['then'](function(_0x48fea8){_0x5740ae=_0x48fea8;return _0x5e6edd[_0x9c16('0x90')](_0x48fea8,{'transaction':_0x155467});})['then'](function(){var _0xfbae95={'type':db[_0x9c16('0x91')][_0x9c16('0x92')],'transaction':_0x155467};switch(_0x3aa898['body'][_0x9c16('0x34')]){case'text':_0xfbae95[_0x9c16('0x34')]=db[_0x9c16('0x91')]['TEXT'];break;case _0x9c16('0x93'):_0xfbae95[_0x9c16('0x34')]=db['Sequelize'][_0x9c16('0x94')];break;case _0x9c16('0x95'):_0xfbae95[_0x9c16('0x34')]=db['Sequelize'][_0x9c16('0x96')];_0xfbae95[_0x9c16('0x97')]=![];break;default:}return db[_0x9c16('0x8e')][_0x9c16('0x98')][_0x9c16('0x99')](_0x9c16('0x78'),util[_0x9c16('0x70')](_0x9c16('0x9a'),_0x5740ae['id']),_0xfbae95);})[_0x9c16('0x2c')](function(){return _0x5740ae;});});}})[_0x9c16('0x2c')](respondWithResult(_0x17c8b1,null))[_0x9c16('0x4d')](handleError(_0x17c8b1,null));};exports['getCustomFields']=function(_0x245aac,_0x125f8,_0x5a6eea){var _0x45dd05={};var _0x312b1c={};var _0x15c050;var _0x310229;return db[_0x9c16('0x47')][_0x9c16('0x5f')]({'where':{'id':_0x245aac['params']['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x125f8,null))[_0x9c16('0x2c')](function(_0x5332f3){if(_0x5332f3){_0x15c050=_0x5332f3;_0x312b1c[_0x9c16('0x39')]=_[_0x9c16('0x37')](db[_0x9c16('0x75')][_0x9c16('0x33')]);_0x312b1c[_0x9c16('0x36')]=_[_0x9c16('0x37')](_0x245aac[_0x9c16('0x36')]);_0x312b1c[_0x9c16('0x41')]=_[_0x9c16('0x38')](_0x312b1c[_0x9c16('0x39')],_0x312b1c[_0x9c16('0x36')]);_0x45dd05[_0x9c16('0x3b')]=_[_0x9c16('0x38')](_0x312b1c['model'],qs[_0x9c16('0x3a')](_0x245aac['query'][_0x9c16('0x3a')]));_0x45dd05[_0x9c16('0x3b')]=_0x45dd05['attributes'][_0x9c16('0x3c')]?_0x45dd05[_0x9c16('0x3b')]:_0x312b1c[_0x9c16('0x39')];_0x45dd05[_0x9c16('0x72')]=qs[_0x9c16('0x3f')](_0x245aac[_0x9c16('0x36')][_0x9c16('0x3f')]);_0x45dd05['where']=qs[_0x9c16('0x41')](_[_0x9c16('0x42')](_0x245aac['query'],_0x312b1c['filters']));_0x45dd05[_0x9c16('0x40')]=_[_0x9c16('0x44')](_0x45dd05[_0x9c16('0x40')],{'$or':[{'ListId':_0x5332f3['id']},{'ListId':null}]});if(_0x245aac[_0x9c16('0x36')][_0x9c16('0x43')]){_0x45dd05['where']=_['merge'](_0x45dd05['where'],{'$or':_[_0x9c16('0x32')](_0x45dd05['attributes'],function(_0x293841){var _0x5cdaf6={};_0x5cdaf6[_0x293841]={'$like':'%'+_0x245aac['query'][_0x9c16('0x43')]+'%'};return _0x5cdaf6;})});}_0x45dd05=_[_0x9c16('0x44')]({},_0x45dd05,_0x245aac[_0x9c16('0x46')]);return db['CmCustomField'][_0x9c16('0x9b')](_0x45dd05);}})[_0x9c16('0x2c')](respondWithResult(_0x125f8,null))[_0x9c16('0x4d')](handleError(_0x125f8,null));};exports['getGlobalCustomFields']=function(_0x115fb2,_0x1fcf57){return db[_0x9c16('0x75')]['findAndCountAll']({'where':{'ListId':null}})[_0x9c16('0x2c')](handleEntityNotFound(_0x1fcf57,null))[_0x9c16('0x2c')](function(_0x3ff3e1){return _0x3ff3e1;})[_0x9c16('0x2c')](respondWithResult(_0x1fcf57,null))[_0x9c16('0x4d')](handleError(_0x1fcf57,null));};exports[_0x9c16('0x9c')]=function(_0x2337cf,_0xecfb2,_0x56c713){return db['CmList']['find']({'where':{'id':_0x2337cf[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0xecfb2,null))[_0x9c16('0x2c')](function(_0x1c86cc){if(_0x1c86cc){return _0x1c86cc[_0x9c16('0x9c')](_0x2337cf[_0x9c16('0x4f')][_0x9c16('0x69')],_['omit'](_0x2337cf['body'],[_0x9c16('0x69'),'id'])||{})['spread'](function(_0x12d352){for(var _0x4dc4b3=0x0;_0x4dc4b3<_0x2337cf[_0x9c16('0x4f')][_0x9c16('0x69')][_0x9c16('0x3c')];_0x4dc4b3+=0x1){socket[_0x9c16('0x9d')](_0x9c16('0x9e'),{'UserId':Number(_0x2337cf[_0x9c16('0x4f')][_0x9c16('0x69')][_0x4dc4b3]),'CmListId':Number(_0x2337cf['params']['id'])});}return _0x12d352;});}})[_0x9c16('0x2c')](respondWithResult(_0xecfb2,null))[_0x9c16('0x4d')](handleError(_0xecfb2,null));};exports[_0x9c16('0x9f')]=function(_0x2014a8,_0x139e24,_0x1a1695){return db[_0x9c16('0x47')][_0x9c16('0x55')]({'where':{'id':_0x2014a8[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x139e24,null))['then'](function(_0xb3df87){if(_0xb3df87){return _0xb3df87[_0x9c16('0x9f')](_0x2014a8['query']['ids'])[_0x9c16('0x2c')](function(){if(_[_0x9c16('0x64')](_0x2014a8[_0x9c16('0x36')][_0x9c16('0x69')])){for(var _0x9ca27e=0x0;_0x9ca27e<_0x2014a8[_0x9c16('0x36')][_0x9c16('0x69')][_0x9c16('0x3c')];_0x9ca27e+=0x1){socket[_0x9c16('0x9d')](_0x9c16('0xa0'),{'UserId':Number(_0x2014a8[_0x9c16('0x36')][_0x9c16('0x69')][_0x9ca27e]),'CmListId':Number(_0x2014a8[_0x9c16('0x4b')]['id'])});}}else{socket['emit'](_0x9c16('0xa0'),{'UserId':Number(_0x2014a8[_0x9c16('0x36')]['ids']),'CmListId':Number(_0x2014a8[_0x9c16('0x4b')]['id'])});}});}})[_0x9c16('0x2c')](respondWithStatusCode(_0x139e24,null))[_0x9c16('0x4d')](handleError(_0x139e24,null));};exports['getAgents']=function(_0x235dd5,_0x2aa23f,_0x373e23){var _0x44b44f={};var _0x134f5a={};var _0x1d188e;var _0x57d4c3;return db[_0x9c16('0x47')]['findOne']({'where':{'id':_0x235dd5[_0x9c16('0x4b')]['id']}})[_0x9c16('0x2c')](handleEntityNotFound(_0x2aa23f,null))['then'](function(_0x9d8eec){if(_0x9d8eec){_0x1d188e=_0x9d8eec;_0x134f5a[_0x9c16('0x39')]=_[_0x9c16('0x37')](db[_0x9c16('0xa1')][_0x9c16('0x33')]);_0x134f5a[_0x9c16('0x36')]=_['keys'](_0x235dd5[_0x9c16('0x36')]);_0x134f5a[_0x9c16('0x41')]=_[_0x9c16('0x38')](_0x134f5a[_0x9c16('0x39')],_0x134f5a[_0x9c16('0x36')]);_0x44b44f['attributes']=_[_0x9c16('0x38')](_0x134f5a[_0x9c16('0x39')],qs[_0x9c16('0x3a')](_0x235dd5['query'][_0x9c16('0x3a')]));_0x44b44f['attributes']=_0x44b44f[_0x9c16('0x3b')]['length']?_0x44b44f[_0x9c16('0x3b')]:_0x134f5a[_0x9c16('0x39')];_0x44b44f[_0x9c16('0x72')]=qs[_0x9c16('0x3f')](_0x235dd5['query']['sort']);_0x44b44f['where']=qs['filters'](_[_0x9c16('0x42')](_0x235dd5[_0x9c16('0x36')],_0x134f5a[_0x9c16('0x41')]));if(_0x235dd5[_0x9c16('0x36')][_0x9c16('0x43')]){_0x44b44f[_0x9c16('0x40')]=_[_0x9c16('0x44')](_0x44b44f['where'],{'$or':_[_0x9c16('0x32')](_0x44b44f[_0x9c16('0x3b')],function(_0x7fb14a){var _0x8aa4bd={};_0x8aa4bd[_0x7fb14a]={'$like':'%'+_0x235dd5[_0x9c16('0x36')]['filter']+'%'};return _0x8aa4bd;})});}_0x44b44f=_[_0x9c16('0x44')]({},_0x44b44f,_0x235dd5[_0x9c16('0x46')]);return _0x1d188e['getAgents'](_0x44b44f);}})[_0x9c16('0x2c')](function(_0x1c7327){if(_0x1c7327){_0x57d4c3=_0x1c7327[_0x9c16('0x3c')];if(!_0x235dd5[_0x9c16('0x36')]['hasOwnProperty'](_0x9c16('0x3e'))){_0x44b44f[_0x9c16('0x25')]=qs[_0x9c16('0x25')](_0x235dd5['query'][_0x9c16('0x25')]);_0x44b44f[_0x9c16('0x27')]=qs[_0x9c16('0x27')](_0x235dd5['query']['offset']);}return _0x1d188e['getAgents'](_0x44b44f);}})['then'](function(_0x458aa0){if(_0x458aa0){return _0x458aa0?{'count':_0x57d4c3,'rows':_0x458aa0}:null;}})[_0x9c16('0x2c')](respondWithResult(_0x2aa23f,null))['catch'](handleError(_0x2aa23f,null));};function handleQuery(_0x17267c){logger[_0x9c16('0xa2')](_0x17267c);return db[_0x9c16('0x8e')][_0x9c16('0x36')](_0x17267c)[_0x9c16('0xa3')](function(_0x21f224){csv_results[_0x9c16('0x65')](_0x21f224);})[_0x9c16('0x4d')](function(_0x1f3a02){logger[_0x9c16('0x58')](_0x1f3a02[_0x9c16('0x6c')]);});}
\ No newline at end of file
+var _0x8c3a=['filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','describe','addDisposition','Disposition','getDispositions','findOne','sort','ListId','options','removeDispositions','addContacts','tags','join','isArray','CmContact','ids','success','errors','push','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','c.cf_','customField_','field','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','toString','each','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','destroy','end','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x8c3a,0x1b9));var _0xa8c3=function(_0x8ee91e,_0x185445){_0x8ee91e=_0x8ee91e-0x0;var _0x18031b=_0x8c3a[_0x8ee91e];return _0x18031b;};'use strict';var emlformat=require(_0xa8c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa8c3('0x1'));var rp=require(_0xa8c3('0x2'));var moment=require(_0xa8c3('0x3'));var BPromise=require(_0xa8c3('0x4'));var Mustache=require(_0xa8c3('0x5'));var util=require(_0xa8c3('0x6'));var path=require('path');var sox=require(_0xa8c3('0x7'));var csv=require(_0xa8c3('0x8'));var ejs=require(_0xa8c3('0x9'));var fs=require('fs');var fs_extra=require(_0xa8c3('0xa'));var _=require(_0xa8c3('0xb'));var squel=require(_0xa8c3('0xc'));var crypto=require(_0xa8c3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8c3('0x8'));var querystring=require(_0xa8c3('0xe'));var Papa=require(_0xa8c3('0xf'));var Redis=require(_0xa8c3('0x10'));var authService=require(_0xa8c3('0x11'));var qs=require(_0xa8c3('0x12'));var as=require(_0xa8c3('0x13'));var hardwareService=require(_0xa8c3('0x14'));var logger=require(_0xa8c3('0x15'))(_0xa8c3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa8c3('0x17'));var db=require(_0xa8c3('0x18'))['db'];var csv_results;config[_0xa8c3('0x19')]=_[_0xa8c3('0x1a')](config[_0xa8c3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8c3('0x1b'))(new Redis(config[_0xa8c3('0x19')]));require(_0xa8c3('0x1c'))[_0xa8c3('0x1d')](socket);function respondWithStatusCode(_0x5a036d,_0x117d9c){_0x117d9c=_0x117d9c||0xcc;return function(_0x2789e7){if(_0x2789e7){return _0x5a036d[_0xa8c3('0x1e')](_0x117d9c);}return _0x5a036d[_0xa8c3('0x1f')](_0x117d9c)['end']();};}function respondWithResult(_0x39e0e9,_0x2564bd){_0x2564bd=_0x2564bd||0xc8;return function(_0x482016){if(_0x482016){return _0x39e0e9[_0xa8c3('0x1f')](_0x2564bd)[_0xa8c3('0x20')](_0x482016);}};}function respondWithFilteredResult(_0x28c665,_0x1a1d67){return function(_0x4e66a5){if(_0x4e66a5){var _0x35da24=typeof _0x1a1d67[_0xa8c3('0x21')]==='undefined'&&typeof _0x1a1d67[_0xa8c3('0x22')]===_0xa8c3('0x23');var _0x49b568=_0x4e66a5[_0xa8c3('0x24')];var _0x1861be=_0x35da24?0x0:_0x1a1d67[_0xa8c3('0x21')];var _0x492cad=_0x35da24?_0x4e66a5[_0xa8c3('0x24')]:_0x1a1d67[_0xa8c3('0x21')]+_0x1a1d67[_0xa8c3('0x22')];var _0x2c9ed5;if(_0x492cad>=_0x49b568){_0x492cad=_0x49b568;_0x2c9ed5=0xc8;}else{_0x2c9ed5=0xce;}_0x28c665[_0xa8c3('0x1f')](_0x2c9ed5);return _0x28c665[_0xa8c3('0x25')]('Content-Range',_0x1861be+'-'+_0x492cad+'/'+_0x49b568)[_0xa8c3('0x20')](_0x4e66a5);}return null;};}function patchUpdates(_0x23f107){return function(_0x4ad629){try{jsonpatch[_0xa8c3('0x26')](_0x4ad629,_0x23f107,!![]);}catch(_0x2b0768){return BPromise[_0xa8c3('0x27')](_0x2b0768);}return _0x4ad629[_0xa8c3('0x28')]();};}function saveUpdates(_0x184a4b,_0x471139){return function(_0x1d4d52){if(_0x1d4d52){return _0x1d4d52[_0xa8c3('0x29')](_0x184a4b)[_0xa8c3('0x2a')](function(_0x4efa7e){return _0x4efa7e;});}return null;};}function removeEntity(_0x337b69,_0x30b232){return function(_0x57df9e){if(_0x57df9e){return _0x57df9e['destroy']()[_0xa8c3('0x2a')](function(){var _0x1b5073=_0x57df9e[_0xa8c3('0x2b')]({'plain':!![]});var _0x39ea11='Lists';return db['UserProfileResource'][_0xa8c3('0x2c')]({'where':{'type':_0x39ea11,'resourceId':_0x1b5073['id']}})['then'](function(){return _0x57df9e;});})['then'](function(){_0x337b69[_0xa8c3('0x1f')](0xcc)[_0xa8c3('0x2d')]();});}};}function handleEntityNotFound(_0x2c34fc,_0x6b0793){return function(_0x42c450){if(!_0x42c450){_0x2c34fc[_0xa8c3('0x1e')](0x194);}return _0x42c450;};}function handleError(_0x244b93,_0x53f786){_0x53f786=_0x53f786||0x1f4;return function(_0xb05e38){logger['error'](_0xb05e38[_0xa8c3('0x2e')]);if(_0xb05e38[_0xa8c3('0x2f')]){delete _0xb05e38[_0xa8c3('0x2f')];}_0x244b93[_0xa8c3('0x1f')](_0x53f786)[_0xa8c3('0x30')](_0xb05e38);};}exports[_0xa8c3('0x31')]=function(_0x538ee8,_0x33d8a9){var _0x2e7217={},_0x531b5f={},_0x5eb0d1={'count':0x0,'rows':[]};var _0x218bf0=_['map'](db[_0xa8c3('0x32')][_0xa8c3('0x33')],function(_0x9d7987){return{'name':_0x9d7987[_0xa8c3('0x34')],'type':_0x9d7987[_0xa8c3('0x35')][_0xa8c3('0x36')]};});_0x531b5f[_0xa8c3('0x37')]=_[_0xa8c3('0x38')](_0x218bf0,'name');_0x531b5f[_0xa8c3('0x39')]=_[_0xa8c3('0x3a')](_0x538ee8[_0xa8c3('0x39')]);_0x531b5f[_0xa8c3('0x3b')]=_['intersection'](_0x531b5f[_0xa8c3('0x37')],_0x531b5f['query']);_0x2e7217[_0xa8c3('0x3c')]=_[_0xa8c3('0x3d')](_0x531b5f[_0xa8c3('0x37')],qs[_0xa8c3('0x3e')](_0x538ee8[_0xa8c3('0x39')][_0xa8c3('0x3e')]));_0x2e7217[_0xa8c3('0x3c')]=_0x2e7217[_0xa8c3('0x3c')][_0xa8c3('0x3f')]?_0x2e7217['attributes']:_0x531b5f['model'];if(!_0x538ee8[_0xa8c3('0x39')][_0xa8c3('0x40')](_0xa8c3('0x41'))){_0x2e7217['limit']=qs['limit'](_0x538ee8[_0xa8c3('0x39')][_0xa8c3('0x22')]);_0x2e7217['offset']=qs[_0xa8c3('0x21')](_0x538ee8[_0xa8c3('0x39')][_0xa8c3('0x21')]);}_0x2e7217[_0xa8c3('0x42')]=qs['sort'](_0x538ee8[_0xa8c3('0x39')]['sort']);_0x2e7217[_0xa8c3('0x43')]=qs[_0xa8c3('0x3b')](_[_0xa8c3('0x44')](_0x538ee8['query'],_0x531b5f[_0xa8c3('0x3b')]),_0x218bf0);if(_0x538ee8[_0xa8c3('0x39')][_0xa8c3('0x45')]){_0x2e7217[_0xa8c3('0x43')]=_[_0xa8c3('0x46')](_0x2e7217[_0xa8c3('0x43')],{'$or':_[_0xa8c3('0x38')](_0x218bf0,function(_0x2a0e54){if(_0x2a0e54['type']!=='VIRTUAL'){var _0x4b9013={};_0x4b9013[_0x2a0e54[_0xa8c3('0x2f')]]={'$like':'%'+_0x538ee8['query'][_0xa8c3('0x45')]+'%'};return _0x4b9013;}})});}_0x2e7217=_[_0xa8c3('0x46')]({},_0x2e7217,_0x538ee8['options']);var _0x32d834={'where':_0x2e7217[_0xa8c3('0x43')]};return db[_0xa8c3('0x32')][_0xa8c3('0x24')](_0x32d834)['then'](function(_0x20e97a){_0x5eb0d1['count']=_0x20e97a;if(_0x538ee8[_0xa8c3('0x39')]['includeAll']){_0x2e7217[_0xa8c3('0x47')]=[{'all':!![]}];}return db[_0xa8c3('0x32')][_0xa8c3('0x48')](_0x2e7217);})[_0xa8c3('0x2a')](function(_0x3766dd){_0x5eb0d1[_0xa8c3('0x49')]=_0x3766dd;return _0x5eb0d1;})[_0xa8c3('0x2a')](respondWithFilteredResult(_0x33d8a9,_0x2e7217))[_0xa8c3('0x4a')](handleError(_0x33d8a9,null));};exports[_0xa8c3('0x4b')]=function(_0x38fb5f,_0x517bf9){var _0x2a92eb={'raw':![],'where':{'id':_0x38fb5f[_0xa8c3('0x4c')]['id']}},_0x22b558={};_0x22b558[_0xa8c3('0x37')]=_[_0xa8c3('0x3a')](db[_0xa8c3('0x32')][_0xa8c3('0x33')]);_0x22b558[_0xa8c3('0x39')]=_[_0xa8c3('0x3a')](_0x38fb5f[_0xa8c3('0x39')]);_0x22b558[_0xa8c3('0x3b')]=_[_0xa8c3('0x3d')](_0x22b558[_0xa8c3('0x37')],_0x22b558[_0xa8c3('0x39')]);_0x2a92eb[_0xa8c3('0x3c')]=_[_0xa8c3('0x3d')](_0x22b558[_0xa8c3('0x37')],qs['fields'](_0x38fb5f['query']['fields']));_0x2a92eb['attributes']=_0x2a92eb[_0xa8c3('0x3c')][_0xa8c3('0x3f')]?_0x2a92eb['attributes']:_0x22b558['model'];if(_0x38fb5f[_0xa8c3('0x39')][_0xa8c3('0x4d')]){_0x2a92eb[_0xa8c3('0x47')]=[{'all':!![]}];}_0x2a92eb=_['merge']({},_0x2a92eb,_0x38fb5f['options']);return db[_0xa8c3('0x32')][_0xa8c3('0x4e')](_0x2a92eb)[_0xa8c3('0x2a')](handleEntityNotFound(_0x517bf9,null))[_0xa8c3('0x2a')](respondWithResult(_0x517bf9,null))[_0xa8c3('0x4a')](handleError(_0x517bf9,null));};exports[_0xa8c3('0x4f')]=function(_0x4df8ed,_0x44ffee){return db['CmList']['create'](_0x4df8ed['body'],{})[_0xa8c3('0x2a')](function(_0x66acc5){var _0x5076ac=_0x4df8ed[_0xa8c3('0x50')][_0xa8c3('0x2b')]({'plain':!![]});if(!_0x5076ac)throw new Error(_0xa8c3('0x51'));if(_0x5076ac['role']===_0xa8c3('0x50')){var _0x1b2e89=_0x66acc5[_0xa8c3('0x2b')]({'plain':!![]});var _0x1b4df5=_0xa8c3('0x52');return db[_0xa8c3('0x53')][_0xa8c3('0x4e')]({'where':{'name':_0x1b4df5,'userProfileId':_0x5076ac[_0xa8c3('0x54')]},'raw':!![]})[_0xa8c3('0x2a')](function(_0x22a683){if(_0x22a683&&_0x22a683[_0xa8c3('0x55')]===0x0){return db[_0xa8c3('0x56')]['create']({'name':_0x1b2e89[_0xa8c3('0x2f')],'resourceId':_0x1b2e89['id'],'type':_0x22a683[_0xa8c3('0x2f')],'sectionId':_0x22a683['id']},{})['then'](function(){return _0x66acc5;});}else{return _0x66acc5;}})[_0xa8c3('0x4a')](function(_0x2a6069){logger[_0xa8c3('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a6069);throw _0x2a6069;});}return _0x66acc5;})[_0xa8c3('0x2a')](respondWithResult(_0x44ffee,0xc9))[_0xa8c3('0x4a')](handleError(_0x44ffee,null));};exports[_0xa8c3('0x29')]=function(_0x4ce250,_0x4cf879){if(_0x4ce250[_0xa8c3('0x58')]['id']){delete _0x4ce250[_0xa8c3('0x58')]['id'];}return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x4ce250['params']['id']}})['then'](handleEntityNotFound(_0x4cf879,null))[_0xa8c3('0x2a')](saveUpdates(_0x4ce250[_0xa8c3('0x58')],null))['then'](respondWithResult(_0x4cf879,null))[_0xa8c3('0x4a')](handleError(_0x4cf879,null));};exports[_0xa8c3('0x2c')]=function(_0x1c49b9,_0x16d346){return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x1c49b9[_0xa8c3('0x4c')]['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x16d346,null))['then'](removeEntity(_0x16d346,null))[_0xa8c3('0x4a')](handleError(_0x16d346,null));};exports[_0xa8c3('0x59')]=function(_0x4eb9a3,_0x309c4f){return db[_0xa8c3('0x32')][_0xa8c3('0x59')]()[_0xa8c3('0x2a')](respondWithResult(_0x309c4f,null))['catch'](handleError(_0x309c4f,null));};exports[_0xa8c3('0x5a')]=function(_0x32cfc2,_0x4be330,_0x403d89){if(_0x32cfc2['body']['id']){delete _0x32cfc2[_0xa8c3('0x58')]['id'];}return db[_0xa8c3('0x32')]['find']({'where':{'id':_0x32cfc2[_0xa8c3('0x4c')]['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x4be330,null))['then'](function(_0x275d63){if(_0x275d63){_0x32cfc2[_0xa8c3('0x58')]['ListId']=_0x275d63['id'];return db[_0xa8c3('0x5b')]['create'](_0x32cfc2['body']);}})[_0xa8c3('0x2a')](respondWithResult(_0x4be330,null))[_0xa8c3('0x4a')](handleError(_0x4be330,null));};exports[_0xa8c3('0x5c')]=function(_0x2b2abc,_0x3eee65,_0x130fc3){var _0x421ce={'raw':![],'where':{}};var _0x5e7382={};var _0x3d5072={'count':0x0,'rows':[]};return db['CmList'][_0xa8c3('0x5d')]({'where':{'id':_0x2b2abc[_0xa8c3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3eee65,null))[_0xa8c3('0x2a')](function(_0x1511e4){if(_0x1511e4){_0x5e7382[_0xa8c3('0x37')]=_['keys'](db['Disposition']['rawAttributes']);_0x5e7382[_0xa8c3('0x39')]=_[_0xa8c3('0x3a')](_0x2b2abc[_0xa8c3('0x39')]);_0x5e7382[_0xa8c3('0x3b')]=_[_0xa8c3('0x3d')](_0x5e7382['model'],_0x5e7382[_0xa8c3('0x39')]);_0x421ce[_0xa8c3('0x3c')]=_[_0xa8c3('0x3d')](_0x5e7382[_0xa8c3('0x37')],qs['fields'](_0x2b2abc[_0xa8c3('0x39')][_0xa8c3('0x3e')]));_0x421ce[_0xa8c3('0x3c')]=_0x421ce[_0xa8c3('0x3c')]['length']?_0x421ce[_0xa8c3('0x3c')]:_0x5e7382[_0xa8c3('0x37')];if(!_0x2b2abc[_0xa8c3('0x39')][_0xa8c3('0x40')](_0xa8c3('0x41'))){_0x421ce[_0xa8c3('0x22')]=qs['limit'](_0x2b2abc[_0xa8c3('0x39')][_0xa8c3('0x22')]);_0x421ce[_0xa8c3('0x21')]=qs['offset'](_0x2b2abc[_0xa8c3('0x39')][_0xa8c3('0x21')]);}_0x421ce[_0xa8c3('0x42')]=qs[_0xa8c3('0x5e')](_0x2b2abc['query'][_0xa8c3('0x5e')]);_0x421ce[_0xa8c3('0x43')]=qs[_0xa8c3('0x3b')](_[_0xa8c3('0x44')](_0x2b2abc[_0xa8c3('0x39')],_0x5e7382['filters']));_0x421ce[_0xa8c3('0x43')][_0xa8c3('0x5f')]=_0x1511e4['id'];if(_0x2b2abc['query'][_0xa8c3('0x45')]){_0x421ce[_0xa8c3('0x43')]=_[_0xa8c3('0x46')](_0x421ce[_0xa8c3('0x43')],{'$or':_[_0xa8c3('0x38')](_0x421ce['attributes'],function(_0x3ebdf3){var _0x4b1535={};_0x4b1535[_0x3ebdf3]={'$like':'%'+_0x2b2abc[_0xa8c3('0x39')][_0xa8c3('0x45')]+'%'};return _0x4b1535;})});}_0x421ce=_[_0xa8c3('0x46')]({},_0x421ce,_0x2b2abc[_0xa8c3('0x60')]);return db[_0xa8c3('0x5b')][_0xa8c3('0x24')]({'where':_0x421ce[_0xa8c3('0x43')]})[_0xa8c3('0x2a')](function(_0x14eda5){_0x3d5072[_0xa8c3('0x24')]=_0x14eda5;if(_0x2b2abc['query']['includeAll']){_0x421ce[_0xa8c3('0x47')]=[{'all':!![]}];}return db['Disposition'][_0xa8c3('0x48')](_0x421ce);})[_0xa8c3('0x2a')](function(_0x386043){_0x3d5072[_0xa8c3('0x49')]=_0x386043;return _0x3d5072;});}})[_0xa8c3('0x2a')](respondWithFilteredResult(_0x3eee65,_0x421ce))[_0xa8c3('0x4a')](handleError(_0x3eee65,null));};exports[_0xa8c3('0x61')]=function(_0x516a70,_0x40938e,_0xe31b6a){return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x516a70['params']['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x40938e,null))[_0xa8c3('0x2a')](function(_0x363071){if(_0x363071){return _0x363071['removeDispositions'](_0x516a70[_0xa8c3('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x40938e,null))[_0xa8c3('0x4a')](handleError(_0x40938e,null));};exports[_0xa8c3('0x62')]=function(_0x3f8d8a,_0x1817a5,_0x37ce7b){return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x3f8d8a['params']['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x1817a5,null))['then'](function(_0x58980f){if(_0x58980f){var _0x34164d=[];var _0x35b9dc={'success':[],'errors':[]};return db['CmContact'][_0xa8c3('0x59')]()[_0xa8c3('0x2a')](function(_0x2cda9a){if(_0x3f8d8a['body'][_0xa8c3('0x63')]&&_['isArray'](_0x3f8d8a[_0xa8c3('0x58')]['tags'])){if(_0x3f8d8a[_0xa8c3('0x58')][_0xa8c3('0x63')][_0xa8c3('0x3f')]){_0x3f8d8a[_0xa8c3('0x58')]['tags']=_0x3f8d8a[_0xa8c3('0x58')][_0xa8c3('0x63')][_0xa8c3('0x64')](';')+';';}else{_0x3f8d8a[_0xa8c3('0x58')]['tags']=null;}}else{_0x3f8d8a['body'][_0xa8c3('0x63')]=null;}if(_0x3f8d8a['body']&&_[_0xa8c3('0x65')](_0x3f8d8a[_0xa8c3('0x58')])){for(var _0x1d1f0d=0x0;_0x1d1f0d<_0x3f8d8a[_0xa8c3('0x58')][_0xa8c3('0x3f')];_0x1d1f0d+=0x1){_0x3f8d8a['body'][_0x1d1f0d][_0xa8c3('0x5f')]=_0x3f8d8a[_0xa8c3('0x4c')]['id'];_0x34164d['push'](_0x3f8d8a[_0xa8c3('0x58')][_0x1d1f0d]);}return BPromise['each'](_0x34164d,function(_0x1e4ff4){return db[_0xa8c3('0x66')][_0xa8c3('0x4f')](_['omit'](_0x1e4ff4,[_0xa8c3('0x67'),'id'])||{},{'fields':_['keys'](_0x2cda9a),'raw':!![]})[_0xa8c3('0x2a')](function(_0x2b00ca){_0x35b9dc[_0xa8c3('0x68')]['push'](_0x2b00ca['dataValues']);})[_0xa8c3('0x4a')](function(_0x39d2c4){_0x35b9dc[_0xa8c3('0x69')][_0xa8c3('0x6a')]({'data':_0x1e4ff4,'error':_0x39d2c4[_0xa8c3('0x6b')]});});})[_0xa8c3('0x2a')](function(_0x10d070){return _0x35b9dc;})[_0xa8c3('0x4a')](function(_0x39b65d){return _0x39b65d;});}else{_0x1817a5[_0xa8c3('0x1f')](0x190)['json']({'message':_0xa8c3('0x6c')});}});}})[_0xa8c3('0x2a')](respondWithResult(_0x1817a5,null))[_0xa8c3('0x4a')](handleError(_0x1817a5,null));};exports['getContacts']=function(_0x5cc064,_0x5a4f8b,_0x1079ea){var _0x8174f3;return db['CmList'][_0xa8c3('0x4e')]({'where':{'id':_0x5cc064[_0xa8c3('0x4c')]['id']},'include':[{'model':db[_0xa8c3('0x6d')],'as':_0xa8c3('0x6e')}]})[_0xa8c3('0x2a')](handleEntityNotFound(_0x5a4f8b,null))[_0xa8c3('0x2a')](function(_0x4758fe){if(_0x4758fe){_0x8174f3=_0x4758fe;return db[_0xa8c3('0x66')]['rawAttributes'];}})['then'](function(_0xb4a912){if(_0xb4a912){var _0x4245c1={};var _0x5cc9ca={};_0x5cc9ca[_0xa8c3('0x37')]=_[_0xa8c3('0x6f')](_[_0xa8c3('0x3a')](_0xb4a912),_['map'](_0x8174f3[_0xa8c3('0x6e')],function(_0x1b7caf){return util['format'](_0xa8c3('0x70'),_0x1b7caf['id']);}));_0x5cc9ca[_0xa8c3('0x39')]=_[_0xa8c3('0x3a')](_0x5cc064[_0xa8c3('0x39')]);_0x5cc9ca[_0xa8c3('0x3b')]=_[_0xa8c3('0x3d')](_0x5cc9ca[_0xa8c3('0x37')],_0x5cc9ca[_0xa8c3('0x39')]);_0x4245c1[_0xa8c3('0x3c')]=_['intersection'](_0x5cc9ca[_0xa8c3('0x37')],qs[_0xa8c3('0x3e')](_0x5cc064[_0xa8c3('0x39')][_0xa8c3('0x3e')]));_0x4245c1[_0xa8c3('0x3c')]=_0x4245c1[_0xa8c3('0x3c')]['length']?_0x4245c1['attributes']:_0x5cc9ca['model'];if(!_0x5cc064['query']['hasOwnProperty']('nolimit')){_0x4245c1[_0xa8c3('0x22')]=qs['limit'](_0x5cc064[_0xa8c3('0x39')]['limit']);_0x4245c1[_0xa8c3('0x21')]=qs[_0xa8c3('0x21')](_0x5cc064['query'][_0xa8c3('0x21')]);}_0x4245c1[_0xa8c3('0x42')]=qs[_0xa8c3('0x5e')](_0x5cc064[_0xa8c3('0x39')][_0xa8c3('0x5e')]);_0x4245c1['where']=qs[_0xa8c3('0x3b')](_[_0xa8c3('0x44')](_0x5cc064[_0xa8c3('0x39')],_0x5cc9ca[_0xa8c3('0x3b')]));_0x4245c1[_0xa8c3('0x71')]=!![];if(_0x5cc064[_0xa8c3('0x39')]['filter']){_0x4245c1[_0xa8c3('0x43')]=_['merge'](_0x4245c1[_0xa8c3('0x43')],{'$or':_[_0xa8c3('0x38')](_0x4245c1[_0xa8c3('0x3c')],function(_0x142c9a){var _0x44bacf={};_0x44bacf[_0x142c9a]={'$like':'%'+_0x5cc064[_0xa8c3('0x39')]['filter']+'%'};return _0x44bacf;})});}_0x4245c1=_[_0xa8c3('0x46')]({},_0x4245c1,_0x5cc064[_0xa8c3('0x60')]);return _0x8174f3[_0xa8c3('0x72')](_0x4245c1);}})['then'](respondWithResult(_0x5a4f8b,null))[_0xa8c3('0x4a')](handleError(_0x5a4f8b,null));};exports[_0xa8c3('0x73')]=function(_0x575258,_0x28ef6c,_0x33b9a5){var _0x584465;var _0x57bac0;var _0x135967;var _0x3223d5=_0x575258[_0xa8c3('0x4c')]['id'];csv_results=[];return db[_0xa8c3('0x74')][_0xa8c3('0x48')]({'attributes':['id',_0xa8c3('0x2f')],'raw':!![],'order':[_0xa8c3('0x75')]})[_0xa8c3('0x2a')](function(_0x397bf8){_0x584465=_0x397bf8;var _0x136ac9=_[_0xa8c3('0x3a')](db[_0xa8c3('0x66')][_0xa8c3('0x33')]);return db['CmCustomField'][_0xa8c3('0x48')]({'raw':!![],'attributes':['id',_0xa8c3('0x76')]})['then'](function(_0x3a3c7e){_0x57bac0=_0x3a3c7e;var _0xbdd64b=squel[_0xa8c3('0x77')]()['fields'](_0x136ac9)[_0xa8c3('0x78')](_0xa8c3('0x79'),'c')[_0xa8c3('0x43')](_0xa8c3('0x7a'),_0x3223d5)[_0xa8c3('0x43')]('c.deletedAt\x20is\x20null')[_0xa8c3('0x7b')]();for(var _0x2426e5=0x0;_0x2426e5<_0x57bac0[_0xa8c3('0x3f')];_0x2426e5++){_0xbdd64b['field'](_0xa8c3('0x7c')+_0x57bac0[_0x2426e5]['id'],_0xa8c3('0x7d')+_0x57bac0[_0x2426e5][_0xa8c3('0x76')]);}for(var _0x2426e5=0x0;_0x2426e5<_0x584465['length'];_0x2426e5++){_0xbdd64b['field'](squel[_0xa8c3('0x77')]()[_0xa8c3('0x7e')](_0xa8c3('0x7f'))[_0xa8c3('0x78')]('cm_contact_has_items')[_0xa8c3('0x43')](_0xa8c3('0x80'),_0x584465[_0x2426e5]['id'])['where'](_0xa8c3('0x81')),_0xa8c3('0x82')+_0x584465[_0x2426e5][_0xa8c3('0x2f')]);_0xbdd64b['field'](squel[_0xa8c3('0x77')]()[_0xa8c3('0x7e')](_0xa8c3('0x83'))[_0xa8c3('0x78')](_0xa8c3('0x84'))['where'](_0xa8c3('0x80'),_0x584465[_0x2426e5]['id'])[_0xa8c3('0x43')](_0xa8c3('0x81')),'description_additionalPhone_'+_0x584465[_0x2426e5]['name']);}var _0x142cae=[];_0x142cae[_0xa8c3('0x6a')](_0xbdd64b[_0xa8c3('0x85')]());BPromise[_0xa8c3('0x86')](_0x142cae,handleQuery)['then'](function(_0x27fd5b){handleQuery(_0xbdd64b[_0xa8c3('0x85')]());var _0x5a2c63=csv_results[0x0];if(!_[_0xa8c3('0x87')](_0x5a2c63)){var _0xbd3689=toCsv(_0x5a2c63);var _0x1d6ca2=Date[_0xa8c3('0x88')]();fs[_0xa8c3('0x89')](util[_0xa8c3('0x8a')](_0xa8c3('0x8b'),_0x3223d5,_0x1d6ca2),_0xbd3689);_0x28ef6c[_0xa8c3('0x8c')](_0xa8c3('0x8d'),'attachment;\x20filename='+util['format'](_0xa8c3('0x8e'),_0x3223d5,_0x1d6ca2));_0x28ef6c[_0xa8c3('0x8c')](_0xa8c3('0x8f'),_0xa8c3('0x90'));return _0x28ef6c[_0xa8c3('0x91')](util[_0xa8c3('0x8a')]('/tmp/list_%d_%s.csv',_0x3223d5,_0x1d6ca2));}else{return _0x28ef6c['sendStatus'](0xcc);}});});});};exports[_0xa8c3('0x92')]=function(_0x2d4317,_0x4899bf,_0x9aa9a2){var _0x1bc35e;delete _0x2d4317[_0xa8c3('0x58')]['id'];return db['CmList'][_0xa8c3('0x5d')]({'where':{'id':_0x2d4317['params']['id']}})['then'](handleEntityNotFound(_0x4899bf,null))[_0xa8c3('0x2a')](function(_0x50dec5){if(_0x50dec5){return db[_0xa8c3('0x93')][_0xa8c3('0x94')](function(_0x1caceb){return db[_0xa8c3('0x6d')][_0xa8c3('0x4f')](_0x2d4317[_0xa8c3('0x58')],{'transaction':_0x1caceb})[_0xa8c3('0x2a')](function(_0x13157b){_0x1bc35e=_0x13157b;return _0x50dec5[_0xa8c3('0x95')](_0x13157b,{'transaction':_0x1caceb});})[_0xa8c3('0x2a')](function(){var _0x43f884={'type':db[_0xa8c3('0x96')][_0xa8c3('0x97')],'transaction':_0x1caceb};switch(_0x2d4317[_0xa8c3('0x58')][_0xa8c3('0x35')]){case'text':_0x43f884['type']=db[_0xa8c3('0x96')]['TEXT'];break;case _0xa8c3('0x98'):_0x43f884['type']=db['Sequelize'][_0xa8c3('0x99')];break;case'switch':_0x43f884['type']=db['Sequelize'][_0xa8c3('0x9a')];_0x43f884[_0xa8c3('0x9b')]=![];break;default:}return db[_0xa8c3('0x93')][_0xa8c3('0x9c')]['addColumn'](_0xa8c3('0x79'),util['format'](_0xa8c3('0x9d'),_0x1bc35e['id']),_0x43f884);})[_0xa8c3('0x2a')](function(){return _0x1bc35e;});});}})['then'](respondWithResult(_0x4899bf,null))['catch'](handleError(_0x4899bf,null));};exports[_0xa8c3('0x9e')]=function(_0x418730,_0x63a3,_0x2ab187){var _0x1e67fa={};var _0x2290aa={};var _0x350db4;var _0x14aa8d;return db[_0xa8c3('0x32')][_0xa8c3('0x5d')]({'where':{'id':_0x418730[_0xa8c3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x63a3,null))[_0xa8c3('0x2a')](function(_0x49ae40){if(_0x49ae40){_0x350db4=_0x49ae40;_0x2290aa['model']=_['keys'](db[_0xa8c3('0x6d')][_0xa8c3('0x33')]);_0x2290aa[_0xa8c3('0x39')]=_['keys'](_0x418730['query']);_0x2290aa['filters']=_[_0xa8c3('0x3d')](_0x2290aa[_0xa8c3('0x37')],_0x2290aa[_0xa8c3('0x39')]);_0x1e67fa[_0xa8c3('0x3c')]=_['intersection'](_0x2290aa['model'],qs[_0xa8c3('0x3e')](_0x418730[_0xa8c3('0x39')][_0xa8c3('0x3e')]));_0x1e67fa['attributes']=_0x1e67fa[_0xa8c3('0x3c')][_0xa8c3('0x3f')]?_0x1e67fa['attributes']:_0x2290aa[_0xa8c3('0x37')];_0x1e67fa[_0xa8c3('0x42')]=qs[_0xa8c3('0x5e')](_0x418730[_0xa8c3('0x39')][_0xa8c3('0x5e')]);_0x1e67fa[_0xa8c3('0x43')]=qs[_0xa8c3('0x3b')](_[_0xa8c3('0x44')](_0x418730[_0xa8c3('0x39')],_0x2290aa[_0xa8c3('0x3b')]));_0x1e67fa[_0xa8c3('0x43')]=_['merge'](_0x1e67fa[_0xa8c3('0x43')],{'$or':[{'ListId':_0x49ae40['id']},{'ListId':null}]});if(_0x418730['query'][_0xa8c3('0x45')]){_0x1e67fa[_0xa8c3('0x43')]=_[_0xa8c3('0x46')](_0x1e67fa['where'],{'$or':_[_0xa8c3('0x38')](_0x1e67fa[_0xa8c3('0x3c')],function(_0x29e8f4){var _0x16de2c={};_0x16de2c[_0x29e8f4]={'$like':'%'+_0x418730[_0xa8c3('0x39')][_0xa8c3('0x45')]+'%'};return _0x16de2c;})});}_0x1e67fa=_['merge']({},_0x1e67fa,_0x418730[_0xa8c3('0x60')]);return db[_0xa8c3('0x6d')][_0xa8c3('0x9f')](_0x1e67fa);}})['then'](respondWithResult(_0x63a3,null))[_0xa8c3('0x4a')](handleError(_0x63a3,null));};exports['getGlobalCustomFields']=function(_0x284cf0,_0x498f53){return db[_0xa8c3('0x6d')]['findAndCountAll']({'where':{'ListId':null}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x498f53,null))[_0xa8c3('0x2a')](function(_0x24ed58){return _0x24ed58;})[_0xa8c3('0x2a')](respondWithResult(_0x498f53,null))['catch'](handleError(_0x498f53,null));};exports[_0xa8c3('0xa0')]=function(_0x44c889,_0xa1871f,_0x215f44){return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x44c889[_0xa8c3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa1871f,null))[_0xa8c3('0x2a')](function(_0x2250e7){if(_0x2250e7){return _0x2250e7[_0xa8c3('0xa0')](_0x44c889[_0xa8c3('0x58')][_0xa8c3('0x67')],_[_0xa8c3('0xa1')](_0x44c889[_0xa8c3('0x58')],[_0xa8c3('0x67'),'id'])||{})[_0xa8c3('0xa2')](function(_0x388d6c){for(var _0x58c489=0x0;_0x58c489<_0x44c889[_0xa8c3('0x58')][_0xa8c3('0x67')]['length'];_0x58c489+=0x1){socket[_0xa8c3('0xa3')](_0xa8c3('0xa4'),{'UserId':Number(_0x44c889[_0xa8c3('0x58')][_0xa8c3('0x67')][_0x58c489]),'CmListId':Number(_0x44c889['params']['id'])});}return _0x388d6c;});}})[_0xa8c3('0x2a')](respondWithResult(_0xa1871f,null))[_0xa8c3('0x4a')](handleError(_0xa1871f,null));};exports[_0xa8c3('0xa5')]=function(_0x504c74,_0x147c15,_0x4bec2d){return db[_0xa8c3('0x32')][_0xa8c3('0x4e')]({'where':{'id':_0x504c74['params']['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x147c15,null))[_0xa8c3('0x2a')](function(_0x48342a){if(_0x48342a){return _0x48342a['removeAgents'](_0x504c74[_0xa8c3('0x39')][_0xa8c3('0x67')])[_0xa8c3('0x2a')](function(){if(_[_0xa8c3('0x65')](_0x504c74[_0xa8c3('0x39')][_0xa8c3('0x67')])){for(var _0x173038=0x0;_0x173038<_0x504c74[_0xa8c3('0x39')]['ids'][_0xa8c3('0x3f')];_0x173038+=0x1){socket[_0xa8c3('0xa3')](_0xa8c3('0xa6'),{'UserId':Number(_0x504c74['query'][_0xa8c3('0x67')][_0x173038]),'CmListId':Number(_0x504c74[_0xa8c3('0x4c')]['id'])});}}else{socket[_0xa8c3('0xa3')](_0xa8c3('0xa6'),{'UserId':Number(_0x504c74[_0xa8c3('0x39')][_0xa8c3('0x67')]),'CmListId':Number(_0x504c74[_0xa8c3('0x4c')]['id'])});}});}})[_0xa8c3('0x2a')](respondWithStatusCode(_0x147c15,null))[_0xa8c3('0x4a')](handleError(_0x147c15,null));};exports[_0xa8c3('0xa7')]=function(_0x1735c3,_0x520b15,_0x1d4bb3){var _0x2a4807={};var _0x449773={};var _0x33d3bf;var _0x28cf45;return db['CmList'][_0xa8c3('0x5d')]({'where':{'id':_0x1735c3[_0xa8c3('0x4c')]['id']}})[_0xa8c3('0x2a')](handleEntityNotFound(_0x520b15,null))[_0xa8c3('0x2a')](function(_0x4b6be4){if(_0x4b6be4){_0x33d3bf=_0x4b6be4;_0x449773[_0xa8c3('0x37')]=_['keys'](db[_0xa8c3('0xa8')][_0xa8c3('0x33')]);_0x449773[_0xa8c3('0x39')]=_['keys'](_0x1735c3[_0xa8c3('0x39')]);_0x449773['filters']=_[_0xa8c3('0x3d')](_0x449773['model'],_0x449773[_0xa8c3('0x39')]);_0x2a4807[_0xa8c3('0x3c')]=_[_0xa8c3('0x3d')](_0x449773[_0xa8c3('0x37')],qs['fields'](_0x1735c3['query'][_0xa8c3('0x3e')]));_0x2a4807[_0xa8c3('0x3c')]=_0x2a4807[_0xa8c3('0x3c')][_0xa8c3('0x3f')]?_0x2a4807['attributes']:_0x449773[_0xa8c3('0x37')];_0x2a4807['order']=qs[_0xa8c3('0x5e')](_0x1735c3['query']['sort']);_0x2a4807[_0xa8c3('0x43')]=qs[_0xa8c3('0x3b')](_[_0xa8c3('0x44')](_0x1735c3[_0xa8c3('0x39')],_0x449773[_0xa8c3('0x3b')]));if(_0x1735c3['query'][_0xa8c3('0x45')]){_0x2a4807['where']=_['merge'](_0x2a4807[_0xa8c3('0x43')],{'$or':_[_0xa8c3('0x38')](_0x2a4807[_0xa8c3('0x3c')],function(_0x429cdf){var _0x5994dc={};_0x5994dc[_0x429cdf]={'$like':'%'+_0x1735c3[_0xa8c3('0x39')][_0xa8c3('0x45')]+'%'};return _0x5994dc;})});}_0x2a4807=_['merge']({},_0x2a4807,_0x1735c3[_0xa8c3('0x60')]);return _0x33d3bf['getAgents'](_0x2a4807);}})[_0xa8c3('0x2a')](function(_0x416c6e){if(_0x416c6e){_0x28cf45=_0x416c6e[_0xa8c3('0x3f')];if(!_0x1735c3['query'][_0xa8c3('0x40')](_0xa8c3('0x41'))){_0x2a4807[_0xa8c3('0x22')]=qs[_0xa8c3('0x22')](_0x1735c3[_0xa8c3('0x39')][_0xa8c3('0x22')]);_0x2a4807['offset']=qs[_0xa8c3('0x21')](_0x1735c3[_0xa8c3('0x39')][_0xa8c3('0x21')]);}return _0x33d3bf[_0xa8c3('0xa7')](_0x2a4807);}})[_0xa8c3('0x2a')](function(_0x30142c){if(_0x30142c){return _0x30142c?{'count':_0x28cf45,'rows':_0x30142c}:null;}})[_0xa8c3('0x2a')](respondWithResult(_0x520b15,null))['catch'](handleError(_0x520b15,null));};function handleQuery(_0x56b5fb){logger[_0xa8c3('0xa9')](_0x56b5fb);return db[_0xa8c3('0x93')]['query'](_0x56b5fb)[_0xa8c3('0xa2')](function(_0x3ce645){csv_results['push'](_0x3ce645);})[_0xa8c3('0x4a')](function(_0x731c55){logger['error'](_0x731c55[_0xa8c3('0x6b')]);});}
\ No newline at end of file
index 96a4b07..a8a0315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x55ca,0x126));var _0xa55c=function(_0x13bea0,_0x210a0c){_0x13bea0=_0x13bea0-0x0;var _0x3f12df=_0x55ca[_0x13bea0];return _0x3f12df;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x4afdce,_0x2d1a6a){var _0x5a163f=function(_0x392115){while(--_0x392115){_0x4afdce['push'](_0x4afdce['shift']());}};_0x5a163f(++_0x2d1a6a);}(_0x7217,0x19e));var _0x7721=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7217[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
index 7599f1c..20f4d15 100644 (file)
@@ -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(_0x7b6dae,_0x5f52b4){var _0x2ed4e=function(_0x410bcf){while(--_0x410bcf){_0x7b6dae['push'](_0x7b6dae['shift']());}};_0x2ed4e(++_0x5f52b4);}(_0x3c81,0x102));var _0x13c8=function(_0x25af9c,_0x1e73a6){_0x25af9c=_0x25af9c-0x0;var _0x1ca6ea=_0x3c81[_0x25af9c];return _0x1ca6ea;};'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 _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x2dcaf6,_0x3c8ccc){var _0x3eb1e6=function(_0xe9858c){while(--_0xe9858c){_0x2dcaf6['push'](_0x2dcaf6['shift']());}};_0x3eb1e6(++_0x3c8ccc);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3d2e4c,_0x3df254){_0x3d2e4c=_0x3d2e4c-0x0;var _0x14821f=_0x5ff3[_0x3d2e4c];return _0x14821f;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f3f6e43..c8695be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4503=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x453aca,_0xa73f95){var _0x33ef13=function(_0x4f93dc){while(--_0x4f93dc){_0x453aca['push'](_0x453aca['shift']());}};_0x33ef13(++_0xa73f95);}(_0x4503,0x1e7));var _0x3450=function(_0x8a310e,_0x5f0e8b){_0x8a310e=_0x8a310e-0x0;var _0x126b1b=_0x4503[_0x8a310e];return _0x126b1b;};'use strict';var _=require(_0x3450('0x0'));var util=require(_0x3450('0x1'));var moment=require(_0x3450('0x2'));var BPromise=require(_0x3450('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3450('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3450('0x5'));var logger=require(_0x3450('0x6'))(_0x3450('0x7'));var config=require(_0x3450('0x8'));var jayson=require(_0x3450('0x9'));var client=jayson['client'][_0x3450('0xa')]({'port':0x232a});config[_0x3450('0xb')]=_[_0x3450('0xc')](config[_0x3450('0xb')],{'host':_0x3450('0xd'),'port':0x18eb});var socket=require(_0x3450('0xe'))(new Redis(config[_0x3450('0xb')]));require(_0x3450('0xf'))[_0x3450('0x10')](socket);function respondWithRpcPromise(_0x30040b,_0x2d0dca,_0x1c7683){return new BPromise(function(_0x46ef4d,_0x13eb41){return client[_0x3450('0x11')](_0x30040b,_0x1c7683)[_0x3450('0x12')](function(_0x18affc){logger[_0x3450('0x13')](_0x3450('0x14'),_0x2d0dca,_0x3450('0x15'));logger[_0x3450('0x16')](_0x3450('0x17'),_0x2d0dca,_0x3450('0x15'),JSON['stringify'](_0x18affc));if(_0x18affc[_0x3450('0x18')]){if(_0x18affc[_0x3450('0x18')][_0x3450('0x19')]===0x1f4){logger['error'](_0x3450('0x14'),_0x2d0dca,_0x18affc[_0x3450('0x18')][_0x3450('0x1a')]);return _0x13eb41(_0x18affc[_0x3450('0x18')][_0x3450('0x1a')]);}logger[_0x3450('0x18')](_0x3450('0x14'),_0x2d0dca,_0x18affc['error']['message']);return _0x46ef4d(_0x18affc[_0x3450('0x18')]['message']);}else{logger[_0x3450('0x13')](_0x3450('0x14'),_0x2d0dca,_0x3450('0x15'));_0x46ef4d(_0x18affc[_0x3450('0x1b')][_0x3450('0x1a')]);}})[_0x3450('0x1c')](function(_0x46792f){logger['error'](_0x3450('0x14'),_0x2d0dca,_0x46792f);_0x13eb41(_0x46792f);});});}
\ No newline at end of file
+var _0x8874=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x5c3bc,_0x70299a){var _0xc841af=function(_0x3a449e){while(--_0x3a449e){_0x5c3bc['push'](_0x5c3bc['shift']());}};_0xc841af(++_0x70299a);}(_0x8874,0x1c5));var _0x4887=function(_0x3cefa8,_0x1b7b79){_0x3cefa8=_0x3cefa8-0x0;var _0x5beb5e=_0x8874[_0x3cefa8];return _0x5beb5e;};'use strict';var _=require('lodash');var util=require(_0x4887('0x0'));var moment=require(_0x4887('0x1'));var BPromise=require(_0x4887('0x2'));var rs=require(_0x4887('0x3'));var fs=require('fs');var Redis=require(_0x4887('0x4'));var db=require(_0x4887('0x5'))['db'];var utils=require(_0x4887('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4887('0x7'));var jayson=require(_0x4887('0x8'));var client=jayson[_0x4887('0x9')][_0x4887('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4887('0xb')],{'host':_0x4887('0xc'),'port':0x18eb});var socket=require(_0x4887('0xd'))(new Redis(config[_0x4887('0xb')]));require('./cmList.socket')[_0x4887('0xe')](socket);function respondWithRpcPromise(_0x4b067f,_0x185b95,_0x5e871c){return new BPromise(function(_0x4f215b,_0x2a27ca){return client[_0x4887('0xf')](_0x4b067f,_0x5e871c)['then'](function(_0x3ead8e){logger[_0x4887('0x10')](_0x4887('0x11'),_0x185b95,_0x4887('0x12'));logger['debug'](_0x4887('0x13'),_0x185b95,_0x4887('0x12'),JSON['stringify'](_0x3ead8e));if(_0x3ead8e['error']){if(_0x3ead8e['error'][_0x4887('0x14')]===0x1f4){logger[_0x4887('0x15')](_0x4887('0x11'),_0x185b95,_0x3ead8e[_0x4887('0x15')][_0x4887('0x16')]);return _0x2a27ca(_0x3ead8e[_0x4887('0x15')][_0x4887('0x16')]);}logger[_0x4887('0x15')](_0x4887('0x11'),_0x185b95,_0x3ead8e[_0x4887('0x15')][_0x4887('0x16')]);return _0x4f215b(_0x3ead8e[_0x4887('0x15')][_0x4887('0x16')]);}else{logger[_0x4887('0x10')]('CmList,\x20%s,\x20%s',_0x185b95,_0x4887('0x12'));_0x4f215b(_0x3ead8e[_0x4887('0x17')]['message']);}})[_0x4887('0x18')](function(_0x5d059f){logger[_0x4887('0x15')](_0x4887('0x11'),_0x185b95,_0x5d059f);_0x2a27ca(_0x5d059f);});});}
\ No newline at end of file
index 6ba8529..96be14b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77cb=['register','length','cmList:','update','emit','removeListener'];(function(_0xa9ed4,_0x2f0238){var _0x53eca5=function(_0x5a7d16){while(--_0x5a7d16){_0xa9ed4['push'](_0xa9ed4['shift']());}};_0x53eca5(++_0x2f0238);}(_0x77cb,0x141));var _0xb77c=function(_0x3fbeb6,_0x2635fe){_0x3fbeb6=_0x3fbeb6-0x0;var _0x28fa4f=_0x77cb[_0x3fbeb6];return _0x28fa4f;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove',_0xb77c('0x0')];function createListener(_0x1d0924,_0x5384be){return function(_0x3ec6b2){_0x5384be[_0xb77c('0x1')](_0x1d0924,_0x3ec6b2);};}function removeListener(_0x2e4a12,_0x455f12){return function(){CmListEvents[_0xb77c('0x2')](_0x2e4a12,_0x455f12);};}exports[_0xb77c('0x3')]=function(_0x38fc78){for(var _0x3504b0=0x0,_0x4f3087=events[_0xb77c('0x4')];_0x3504b0<_0x4f3087;_0x3504b0++){var _0x1be01b=events[_0x3504b0];var _0x154447=createListener(_0xb77c('0x5')+_0x1be01b,_0x38fc78);CmListEvents['on'](_0x1be01b,_0x154447);}};
\ No newline at end of file
+var _0xa8b4=['./cmList.events','save','remove','update','removeListener','register','cmList:'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xa8b4,0xc4));var _0x4a8b=function(_0x2bcab0,_0x1416e6){_0x2bcab0=_0x2bcab0-0x0;var _0x18cd64=_0xa8b4[_0x2bcab0];return _0x18cd64;};'use strict';var CmListEvents=require(_0x4a8b('0x0'));var events=[_0x4a8b('0x1'),_0x4a8b('0x2'),_0x4a8b('0x3')];function createListener(_0x1844c1,_0x55b159){return function(_0x3d7309){_0x55b159['emit'](_0x1844c1,_0x3d7309);};}function removeListener(_0x56c96e,_0x3ecb01){return function(){CmListEvents[_0x4a8b('0x4')](_0x56c96e,_0x3ecb01);};}exports[_0x4a8b('0x5')]=function(_0x2c175a){for(var _0x4ae733=0x0,_0x26e13e=events['length'];_0x4ae733<_0x26e13e;_0x4ae733++){var _0x4ce07d=events[_0x4ae733];var _0x5bdb58=createListener(_0x4a8b('0x6')+_0x4ce07d,_0x2c175a);CmListEvents['on'](_0x4ce07d,_0x5bdb58);}};
\ No newline at end of file
index a105368..139cbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5376=['show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','addContacts','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','describe','/global_fields','isAuthenticated','/:id'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5376,0x19f));var _0x6537=function(_0x208bc9,_0x4f36f6){_0x208bc9=_0x208bc9-0x0;var _0x2675a8=_0x5376[_0x208bc9];return _0x2675a8;};'use strict';var multer=require(_0x6537('0x0'));var util=require(_0x6537('0x1'));var path=require(_0x6537('0x2'));var timeout=require(_0x6537('0x3'));var express=require(_0x6537('0x4'));var router=express[_0x6537('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6537('0x6'));var interaction=require(_0x6537('0x7'));var config=require(_0x6537('0x8'));var controller=require(_0x6537('0x9'));router[_0x6537('0xa')]('/',auth['isAuthenticated'](),controller[_0x6537('0xb')]);router[_0x6537('0xa')](_0x6537('0xc'),auth['isAuthenticated'](),controller[_0x6537('0xd')]);router[_0x6537('0xa')](_0x6537('0xe'),auth[_0x6537('0xf')](),controller['getGlobalCustomFields']);router[_0x6537('0xa')](_0x6537('0x10'),auth[_0x6537('0xf')](),controller[_0x6537('0x11')]);router[_0x6537('0xa')](_0x6537('0x12'),auth[_0x6537('0xf')](),controller[_0x6537('0x13')]);router['get'](_0x6537('0x14'),auth[_0x6537('0xf')](),controller['getContacts']);router['get'](_0x6537('0x15'),auth['isAuthenticated'](),controller[_0x6537('0x16')]);router[_0x6537('0xa')](_0x6537('0x17'),auth[_0x6537('0xf')](),controller['getCustomFields']);router['get'](_0x6537('0x18'),auth[_0x6537('0xf')](),controller[_0x6537('0x19')]);router[_0x6537('0x1a')]('/',auth[_0x6537('0xf')](),controller[_0x6537('0x1b')]);router[_0x6537('0x1a')]('/:id/dispositions',auth[_0x6537('0xf')](),controller['addDisposition']);router['post'](_0x6537('0x14'),auth['isAuthenticated'](),controller[_0x6537('0x1c')]);router['post'](_0x6537('0x17'),auth['isAuthenticated'](),controller['addCustomField']);router[_0x6537('0x1a')]('/:id/users',auth[_0x6537('0xf')](),controller[_0x6537('0x1d')]);router['put'](_0x6537('0x10'),auth[_0x6537('0xf')](),controller[_0x6537('0x1e')]);router[_0x6537('0x1f')](_0x6537('0x10'),auth[_0x6537('0xf')](),controller[_0x6537('0x20')]);router[_0x6537('0x1f')](_0x6537('0x12'),auth['isAuthenticated'](),controller[_0x6537('0x21')]);router[_0x6537('0x1f')](_0x6537('0x18'),auth[_0x6537('0xf')](),controller[_0x6537('0x22')]);module[_0x6537('0x23')]=router;
\ No newline at end of file
+var _0xcf14=['getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts'];(function(_0x3592f4,_0x238b67){var _0x55e7b2=function(_0x3a3ec1){while(--_0x3a3ec1){_0x3592f4['push'](_0x3592f4['shift']());}};_0x55e7b2(++_0x238b67);}(_0xcf14,0xa1));var _0x4cf1=function(_0x1ff8b9,_0x31637e){_0x1ff8b9=_0x1ff8b9-0x0;var _0x2737cc=_0xcf14[_0x1ff8b9];return _0x2737cc;};'use strict';var multer=require(_0x4cf1('0x0'));var util=require('util');var path=require(_0x4cf1('0x1'));var timeout=require(_0x4cf1('0x2'));var express=require('express');var router=express[_0x4cf1('0x3')]();var fs_extra=require(_0x4cf1('0x4'));var auth=require(_0x4cf1('0x5'));var interaction=require(_0x4cf1('0x6'));var config=require('../../config/environment');var controller=require(_0x4cf1('0x7'));router[_0x4cf1('0x8')]('/',auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xa')]);router[_0x4cf1('0x8')](_0x4cf1('0xb'),auth[_0x4cf1('0x9')](),controller['describe']);router[_0x4cf1('0x8')](_0x4cf1('0xc'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xd')]);router[_0x4cf1('0x8')](_0x4cf1('0xe'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xf')]);router[_0x4cf1('0x8')](_0x4cf1('0x10'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x11')]);router[_0x4cf1('0x8')](_0x4cf1('0x12'),auth['isAuthenticated'](),controller[_0x4cf1('0x13')]);router[_0x4cf1('0x8')](_0x4cf1('0x14'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x15')]);router[_0x4cf1('0x8')](_0x4cf1('0x16'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x17')]);router[_0x4cf1('0x8')](_0x4cf1('0x18'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x19')]);router[_0x4cf1('0x1a')]('/',auth[_0x4cf1('0x9')](),controller['create']);router[_0x4cf1('0x1a')]('/:id/dispositions',auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1b')]);router[_0x4cf1('0x1a')](_0x4cf1('0x12'),auth[_0x4cf1('0x9')](),controller['addContacts']);router[_0x4cf1('0x1a')](_0x4cf1('0x16'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1c')]);router['post']('/:id/users',auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1d')]);router['put'](_0x4cf1('0xe'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1e')]);router[_0x4cf1('0x1f')]('/:id',auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x20')]);router[_0x4cf1('0x1f')](_0x4cf1('0x10'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x21')]);router['delete'](_0x4cf1('0x18'),auth['isAuthenticated'](),controller[_0x4cf1('0x22')]);module[_0x4cf1('0x23')]=router;
\ No newline at end of file
index d0dfb7f..3fe9318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe788=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x122553,_0x488965){var _0x42d3f3=function(_0x13e974){while(--_0x13e974){_0x122553['push'](_0x122553['shift']());}};_0x42d3f3(++_0x488965);}(_0xe788,0x85));var _0x8e78=function(_0x3bedcd,_0x5e7af7){_0x3bedcd=_0x3bedcd-0x0;var _0x2993eb=_0xe788[_0x3bedcd];return _0x2993eb;};'use strict';var Sequelize=require(_0x8e78('0x0'));module['exports']={'name':{'type':Sequelize[_0x8e78('0x1')],'get':function(_0x54bbd6){return this[_0x8e78('0x2')](_0x8e78('0x3'));}},'field':{'type':Sequelize[_0x8e78('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x8e78('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x8e78('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xdcb9=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x27c436,_0x283d5f){var _0x453a21=function(_0x15f3cb){while(--_0x15f3cb){_0x27c436['push'](_0x27c436['shift']());}};_0x453a21(++_0x283d5f);}(_0xdcb9,0x164));var _0x9dcb=function(_0x388590,_0x3c19ed){_0x388590=_0x388590-0x0;var _0x2b4fc0=_0xdcb9[_0x388590];return _0x2b4fc0;};'use strict';var Sequelize=require('sequelize');module[_0x9dcb('0x0')]={'name':{'type':Sequelize[_0x9dcb('0x1')],'get':function(_0x5bdaae){return this[_0x9dcb('0x2')](_0x9dcb('0x3'));}},'field':{'type':Sequelize[_0x9dcb('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x9dcb('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x9dcb('0x4')],'allowNull':![]}};
\ No newline at end of file
index 9499342..18ab6c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x498fd2,_0x5b1c05){var _0x4c0e8d=function(_0xa640ec){while(--_0xa640ec){_0x498fd2['push'](_0x498fd2['shift']());}};_0x4c0e8d(++_0x5b1c05);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _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(_0x2f82b4,_0x3e8fd6){var _0x47d3d7=function(_0x2bf72e){while(--_0x2bf72e){_0x2f82b4['push'](_0x2f82b4['shift']());}};_0x47d3d7(++_0x3e8fd6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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
index 349c152..2993f0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bbe=['bluebird','request-promise','path','rimraf','../../config/environment','exports','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0x258d6e,_0x54387b){var _0x1654f2=function(_0x1d58a7){while(--_0x1d58a7){_0x258d6e['push'](_0x258d6e['shift']());}};_0x1654f2(++_0x54387b);}(_0x8bbe,0x188));var _0xe8bb=function(_0x50bbc3,_0x5e6775){_0x50bbc3=_0x50bbc3-0x0;var _0x40451e=_0x8bbe[_0x50bbc3];return _0x40451e;};'use strict';var _=require(_0xe8bb('0x0'));var util=require('util');var logger=require(_0xe8bb('0x1'))(_0xe8bb('0x2'));var moment=require(_0xe8bb('0x3'));var BPromise=require(_0xe8bb('0x4'));var rp=require(_0xe8bb('0x5'));var fs=require('fs');var path=require(_0xe8bb('0x6'));var rimraf=require(_0xe8bb('0x7'));var config=require(_0xe8bb('0x8'));var attributes=require('./condition.attributes');module[_0xe8bb('0x9')]=function(_0x2fe289,_0x3674b1){return _0x2fe289['define']('Condition',attributes,{'tableName':_0xe8bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbee5=['tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x28b660,_0x8807b7){var _0x2663fc=function(_0x45f24c){while(--_0x45f24c){_0x28b660['push'](_0x28b660['shift']());}};_0x2663fc(++_0x8807b7);}(_0xbee5,0xe1));var _0x5bee=function(_0x370d02,_0x3b8b62){_0x370d02=_0x370d02-0x0;var _0x4c2ca3=_0xbee5[_0x370d02];return _0x4c2ca3;};'use strict';var _=require(_0x5bee('0x0'));var util=require(_0x5bee('0x1'));var logger=require(_0x5bee('0x2'))(_0x5bee('0x3'));var moment=require(_0x5bee('0x4'));var BPromise=require('bluebird');var rp=require(_0x5bee('0x5'));var fs=require('fs');var path=require(_0x5bee('0x6'));var rimraf=require(_0x5bee('0x7'));var config=require(_0x5bee('0x8'));var attributes=require(_0x5bee('0x9'));module[_0x5bee('0xa')]=function(_0x3841e2,_0x48ead9){return _0x3841e2[_0x5bee('0xb')](_0x5bee('0xc'),attributes,{'tableName':_0x5bee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2fa4f08..fa101e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58d2=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x36438b,_0xe76dbb){var _0x336189=function(_0x3c431e){while(--_0x3c431e){_0x36438b['push'](_0x36438b['shift']());}};_0x336189(++_0xe76dbb);}(_0x58d2,0x7c));var _0x258d=function(_0x2b2aef,_0x47ea8e){_0x2b2aef=_0x2b2aef-0x0;var _0x333cb1=_0x58d2[_0x2b2aef];return _0x333cb1;};'use strict';var _=require(_0x258d('0x0'));var util=require(_0x258d('0x1'));var moment=require('moment');var BPromise=require(_0x258d('0x2'));var rs=require(_0x258d('0x3'));var fs=require('fs');var Redis=require(_0x258d('0x4'));var db=require(_0x258d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x258d('0x6'));var config=require(_0x258d('0x7'));var jayson=require(_0x258d('0x8'));var client=jayson[_0x258d('0x9')][_0x258d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f3707,_0x6db380,_0x2782bc){return new BPromise(function(_0x1d25ed,_0x30e92e){return client[_0x258d('0xb')](_0x9f3707,_0x2782bc)[_0x258d('0xc')](function(_0x44b593){logger[_0x258d('0xd')](_0x258d('0xe'),_0x6db380,_0x258d('0xf'));logger[_0x258d('0x10')](_0x258d('0x11'),_0x6db380,_0x258d('0xf'),JSON[_0x258d('0x12')](_0x44b593));if(_0x44b593[_0x258d('0x13')]){if(_0x44b593[_0x258d('0x13')][_0x258d('0x14')]===0x1f4){logger['error'](_0x258d('0xe'),_0x6db380,_0x44b593[_0x258d('0x13')][_0x258d('0x15')]);return _0x30e92e(_0x44b593[_0x258d('0x13')][_0x258d('0x15')]);}logger[_0x258d('0x13')](_0x258d('0xe'),_0x6db380,_0x44b593[_0x258d('0x13')][_0x258d('0x15')]);return _0x1d25ed(_0x44b593['error']['message']);}else{logger['info'](_0x258d('0xe'),_0x6db380,_0x258d('0xf'));_0x1d25ed(_0x44b593[_0x258d('0x16')][_0x258d('0x15')]);}})[_0x258d('0x17')](function(_0x15477f){logger[_0x258d('0x13')](_0x258d('0xe'),_0x6db380,_0x15477f);_0x30e92e(_0x15477f);});});}
\ No newline at end of file
+var _0x49bd=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x49bd,0xa3));var _0xd49b=function(_0x1b1b22,_0x20a582){_0x1b1b22=_0x1b1b22-0x0;var _0x2b7d9c=_0x49bd[_0x1b1b22];return _0x2b7d9c;};'use strict';var _=require(_0xd49b('0x0'));var util=require(_0xd49b('0x1'));var moment=require(_0xd49b('0x2'));var BPromise=require(_0xd49b('0x3'));var rs=require(_0xd49b('0x4'));var fs=require('fs');var Redis=require(_0xd49b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd49b('0x6'));var logger=require(_0xd49b('0x7'))(_0xd49b('0x8'));var config=require(_0xd49b('0x9'));var jayson=require(_0xd49b('0xa'));var client=jayson[_0xd49b('0xb')][_0xd49b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x75899,_0x52c1b5,_0x55afa8){return new BPromise(function(_0x4d256b,_0x57726c){return client[_0xd49b('0xd')](_0x75899,_0x55afa8)[_0xd49b('0xe')](function(_0x24cf4f){logger['info'](_0xd49b('0xf'),_0x52c1b5,'request\x20sent');logger[_0xd49b('0x10')](_0xd49b('0x11'),_0x52c1b5,'request\x20sent',JSON['stringify'](_0x24cf4f));if(_0x24cf4f[_0xd49b('0x12')]){if(_0x24cf4f[_0xd49b('0x12')]['code']===0x1f4){logger[_0xd49b('0x12')](_0xd49b('0xf'),_0x52c1b5,_0x24cf4f[_0xd49b('0x12')][_0xd49b('0x13')]);return _0x57726c(_0x24cf4f[_0xd49b('0x12')]['message']);}logger[_0xd49b('0x12')](_0xd49b('0xf'),_0x52c1b5,_0x24cf4f[_0xd49b('0x12')][_0xd49b('0x13')]);return _0x4d256b(_0x24cf4f[_0xd49b('0x12')][_0xd49b('0x13')]);}else{logger[_0xd49b('0x14')]('Condition,\x20%s,\x20%s',_0x52c1b5,_0xd49b('0x15'));_0x4d256b(_0x24cf4f[_0xd49b('0x16')][_0xd49b('0x13')]);}})[_0xd49b('0x17')](function(_0xac15be){logger['error'](_0xd49b('0xf'),_0x52c1b5,_0xac15be);_0x57726c(_0xac15be);});});}
\ No newline at end of file
index b69e5b1..fa57e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x043b=['../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x2f6d91,_0x50d7ce){var _0x2c495e=function(_0x264342){while(--_0x264342){_0x2f6d91['push'](_0x2f6d91['shift']());}};_0x2c495e(++_0x50d7ce);}(_0x043b,0xf7));var _0xb043=function(_0x144502,_0x432463){_0x144502=_0x144502-0x0;var _0x3d2217=_0x043b[_0x144502];return _0x3d2217;};'use strict';var multer=require(_0xb043('0x0'));var util=require(_0xb043('0x1'));var path=require('path');var timeout=require(_0xb043('0x2'));var express=require(_0xb043('0x3'));var router=express['Router']();var fs_extra=require(_0xb043('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb043('0x5'));var config=require(_0xb043('0x6'));var controller=require('./condition.controller');router['put'](_0xb043('0x7'),auth[_0xb043('0x8')](),controller[_0xb043('0x9')]);router[_0xb043('0xa')](_0xb043('0x7'),auth[_0xb043('0x8')](),controller['destroy']);module[_0xb043('0xb')]=router;
\ No newline at end of file
+var _0x103d=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3ab14c,_0x4093a1){var _0x423753=function(_0x278031){while(--_0x278031){_0x3ab14c['push'](_0x3ab14c['shift']());}};_0x423753(++_0x4093a1);}(_0x103d,0xea));var _0xd103=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x103d[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0xd103('0x0'));var util=require(_0xd103('0x1'));var path=require(_0xd103('0x2'));var timeout=require(_0xd103('0x3'));var express=require(_0xd103('0x4'));var router=express[_0xd103('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd103('0x6'));var config=require(_0xd103('0x7'));var controller=require(_0xd103('0x8'));router[_0xd103('0x9')](_0xd103('0xa'),auth[_0xd103('0xb')](),controller[_0xd103('0xc')]);router[_0xd103('0xd')](_0xd103('0xa'),auth[_0xd103('0xb')](),controller[_0xd103('0xe')]);module[_0xd103('0xf')]=router;
\ No newline at end of file
index ea4184b..d9b027f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x744b=['STRING','sequelize','exports','name','INTEGER'];(function(_0x1eabe2,_0x24666c){var _0x39adc0=function(_0x3149e4){while(--_0x3149e4){_0x1eabe2['push'](_0x1eabe2['shift']());}};_0x39adc0(++_0x24666c);}(_0x744b,0x123));var _0xb744=function(_0x5de237,_0x2058e8){_0x5de237=_0x5de237-0x0;var _0x3b3d4d=_0x744b[_0x5de237];return _0x3b3d4d;};'use strict';var Sequelize=require(_0xb744('0x0'));module[_0xb744('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb744('0x2')},'OrderBy':{'type':Sequelize[_0xb744('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb744('0x4')],'allowNull':!![]}};
\ No newline at end of file
+var _0x7873=['STRING','name','INTEGER','sequelize'];(function(_0x17f339,_0x1c4422){var _0x529dc2=function(_0x3ff2fd){while(--_0x3ff2fd){_0x17f339['push'](_0x17f339['shift']());}};_0x529dc2(++_0x1c4422);}(_0x7873,0x163));var _0x3787=function(_0x492e7f,_0x526c25){_0x492e7f=_0x492e7f-0x0;var _0x139c1b=_0x7873[_0x492e7f];return _0x139c1b;};'use strict';var Sequelize=require(_0x3787('0x0'));module['exports']={'name':{'type':Sequelize[_0x3787('0x1')],'allowNull':![],'unique':_0x3787('0x2')},'OrderBy':{'type':Sequelize[_0x3787('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x3787('0x1')],'allowNull':!![]}};
\ No newline at end of file
index d3038cf..fd3e9bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e3=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','get','UserProfileResource','then','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ContactItemTypes','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf2e3[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x3f2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f2e('0x1'));var jsonpatch=require(_0x3f2e('0x2'));var rp=require(_0x3f2e('0x3'));var moment=require(_0x3f2e('0x4'));var BPromise=require(_0x3f2e('0x5'));var Mustache=require(_0x3f2e('0x6'));var util=require(_0x3f2e('0x7'));var path=require(_0x3f2e('0x8'));var sox=require(_0x3f2e('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2e('0xb'));var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0x11'));var querystring=require(_0x3f2e('0x12'));var Papa=require(_0x3f2e('0x13'));var Redis=require(_0x3f2e('0x14'));var authService=require(_0x3f2e('0x15'));var qs=require(_0x3f2e('0x16'));var as=require(_0x3f2e('0x17'));var hardwareService=require(_0x3f2e('0x18'));var logger=require(_0x3f2e('0x19'))(_0x3f2e('0x1a'));var utils=require(_0x3f2e('0x1b'));var config=require(_0x3f2e('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f2e('0x1d'))['db'];function respondWithStatusCode(_0xaa6ef5,_0x5471f9){_0x5471f9=_0x5471f9||0xcc;return function(_0xe83663){if(_0xe83663){return _0xaa6ef5[_0x3f2e('0x1e')](_0x5471f9);}return _0xaa6ef5[_0x3f2e('0x1f')](_0x5471f9)[_0x3f2e('0x20')]();};}function respondWithResult(_0x3d20d1,_0x57cba7){_0x57cba7=_0x57cba7||0xc8;return function(_0x298080){if(_0x298080){return _0x3d20d1[_0x3f2e('0x1f')](_0x57cba7)[_0x3f2e('0x21')](_0x298080);}};}function respondWithFilteredResult(_0x4f2e38,_0x43f69e){return function(_0x218b44){if(_0x218b44){var _0x17ef58=typeof _0x43f69e[_0x3f2e('0x22')]===_0x3f2e('0x23')&&typeof _0x43f69e[_0x3f2e('0x24')]===_0x3f2e('0x23');var _0x155411=_0x218b44[_0x3f2e('0x25')];var _0xc00add=_0x17ef58?0x0:_0x43f69e[_0x3f2e('0x22')];var _0x5b9989=_0x17ef58?_0x218b44[_0x3f2e('0x25')]:_0x43f69e[_0x3f2e('0x22')]+_0x43f69e[_0x3f2e('0x24')];var _0xbe899c;if(_0x5b9989>=_0x155411){_0x5b9989=_0x155411;_0xbe899c=0xc8;}else{_0xbe899c=0xce;}_0x4f2e38[_0x3f2e('0x1f')](_0xbe899c);return _0x4f2e38['set']('Content-Range',_0xc00add+'-'+_0x5b9989+'/'+_0x155411)[_0x3f2e('0x21')](_0x218b44);}return null;};}function patchUpdates(_0x11f84c){return function(_0x38bbae){try{jsonpatch[_0x3f2e('0x26')](_0x38bbae,_0x11f84c,!![]);}catch(_0x4381e5){return BPromise[_0x3f2e('0x27')](_0x4381e5);}return _0x38bbae['save']();};}function saveUpdates(_0x5a7047,_0xf81165){return function(_0x37dab2){if(_0x37dab2){return _0x37dab2['update'](_0x5a7047)['then'](function(_0x46bb1c){return _0x46bb1c;});}return null;};}function removeEntity(_0x5646f5,_0x1b8c67){return function(_0x401ed9){if(_0x401ed9){return _0x401ed9['destroy']()['then'](function(){var _0x52803d=_0x401ed9[_0x3f2e('0x28')]({'plain':!![]});var _0x3d7631='ContactItemTypes';return db[_0x3f2e('0x29')]['destroy']({'where':{'type':_0x3d7631,'resourceId':_0x52803d['id']}})[_0x3f2e('0x2a')](function(){return _0x401ed9;});})['then'](function(){_0x5646f5[_0x3f2e('0x1f')](0xcc)[_0x3f2e('0x20')]();});}};}function handleEntityNotFound(_0x12926e,_0x9c6c34){return function(_0x11bad1){if(!_0x11bad1){_0x12926e['sendStatus'](0x194);}return _0x11bad1;};}function handleError(_0x426d68,_0x28ef64){_0x28ef64=_0x28ef64||0x1f4;return function(_0x5eab38){logger['error'](_0x5eab38[_0x3f2e('0x2b')]);if(_0x5eab38[_0x3f2e('0x2c')]){delete _0x5eab38[_0x3f2e('0x2c')];}_0x426d68[_0x3f2e('0x1f')](_0x28ef64)['send'](_0x5eab38);};}exports[_0x3f2e('0x2d')]=function(_0x465a94,_0x37ddfe){var _0x4d9b8c={},_0x349ed4={},_0x2741d0={'count':0x0,'rows':[]};var _0xa6a8ab=_['map'](db[_0x3f2e('0x2e')][_0x3f2e('0x2f')],function(_0x71568e){return{'name':_0x71568e[_0x3f2e('0x30')],'type':_0x71568e[_0x3f2e('0x31')][_0x3f2e('0x32')]};});_0x349ed4['model']=_[_0x3f2e('0x33')](_0xa6a8ab,_0x3f2e('0x2c'));_0x349ed4[_0x3f2e('0x34')]=_[_0x3f2e('0x35')](_0x465a94[_0x3f2e('0x34')]);_0x349ed4[_0x3f2e('0x36')]=_[_0x3f2e('0x37')](_0x349ed4['model'],_0x349ed4[_0x3f2e('0x34')]);_0x4d9b8c[_0x3f2e('0x38')]=_[_0x3f2e('0x37')](_0x349ed4[_0x3f2e('0x39')],qs['fields'](_0x465a94['query'][_0x3f2e('0x3a')]));_0x4d9b8c[_0x3f2e('0x38')]=_0x4d9b8c[_0x3f2e('0x38')][_0x3f2e('0x3b')]?_0x4d9b8c[_0x3f2e('0x38')]:_0x349ed4[_0x3f2e('0x39')];if(!_0x465a94[_0x3f2e('0x34')][_0x3f2e('0x3c')](_0x3f2e('0x3d'))){_0x4d9b8c[_0x3f2e('0x24')]=qs['limit'](_0x465a94[_0x3f2e('0x34')][_0x3f2e('0x24')]);_0x4d9b8c[_0x3f2e('0x22')]=qs[_0x3f2e('0x22')](_0x465a94['query'][_0x3f2e('0x22')]);}_0x4d9b8c[_0x3f2e('0x3e')]=qs[_0x3f2e('0x3f')](_0x465a94[_0x3f2e('0x34')][_0x3f2e('0x3f')]);_0x4d9b8c[_0x3f2e('0x40')]=qs[_0x3f2e('0x36')](_[_0x3f2e('0x41')](_0x465a94['query'],_0x349ed4[_0x3f2e('0x36')]),_0xa6a8ab);if(_0x465a94[_0x3f2e('0x34')][_0x3f2e('0x42')]){_0x4d9b8c[_0x3f2e('0x40')]=_['merge'](_0x4d9b8c[_0x3f2e('0x40')],{'$or':_[_0x3f2e('0x33')](_0xa6a8ab,function(_0x4cb56b){if(_0x4cb56b[_0x3f2e('0x31')]!==_0x3f2e('0x43')){var _0x596124={};_0x596124[_0x4cb56b[_0x3f2e('0x2c')]]={'$like':'%'+_0x465a94[_0x3f2e('0x34')][_0x3f2e('0x42')]+'%'};return _0x596124;}})});}_0x4d9b8c=_[_0x3f2e('0x44')]({},_0x4d9b8c,_0x465a94['options']);var _0x39d324={'where':_0x4d9b8c[_0x3f2e('0x40')]};return db['ContactItemType']['count'](_0x39d324)[_0x3f2e('0x2a')](function(_0x23de01){_0x2741d0[_0x3f2e('0x25')]=_0x23de01;if(_0x465a94['query'][_0x3f2e('0x45')]){_0x4d9b8c[_0x3f2e('0x46')]=[{'all':!![]}];}return db[_0x3f2e('0x2e')][_0x3f2e('0x47')](_0x4d9b8c);})[_0x3f2e('0x2a')](function(_0x3668dc){_0x2741d0[_0x3f2e('0x48')]=_0x3668dc;return _0x2741d0;})[_0x3f2e('0x2a')](respondWithFilteredResult(_0x37ddfe,_0x4d9b8c))[_0x3f2e('0x49')](handleError(_0x37ddfe,null));};exports[_0x3f2e('0x4a')]=function(_0x50f446,_0x5d14b7){var _0x32f295={'raw':!![],'where':{'id':_0x50f446['params']['id']}},_0x38900c={};_0x38900c['model']=_[_0x3f2e('0x35')](db[_0x3f2e('0x2e')][_0x3f2e('0x2f')]);_0x38900c['query']=_[_0x3f2e('0x35')](_0x50f446[_0x3f2e('0x34')]);_0x38900c[_0x3f2e('0x36')]=_['intersection'](_0x38900c[_0x3f2e('0x39')],_0x38900c[_0x3f2e('0x34')]);_0x32f295[_0x3f2e('0x38')]=_['intersection'](_0x38900c[_0x3f2e('0x39')],qs[_0x3f2e('0x3a')](_0x50f446[_0x3f2e('0x34')]['fields']));_0x32f295[_0x3f2e('0x38')]=_0x32f295['attributes'][_0x3f2e('0x3b')]?_0x32f295['attributes']:_0x38900c['model'];if(_0x50f446[_0x3f2e('0x34')][_0x3f2e('0x45')]){_0x32f295[_0x3f2e('0x46')]=[{'all':!![]}];}_0x32f295=_[_0x3f2e('0x44')]({},_0x32f295,_0x50f446[_0x3f2e('0x4b')]);return db['ContactItemType']['find'](_0x32f295)[_0x3f2e('0x2a')](handleEntityNotFound(_0x5d14b7,null))[_0x3f2e('0x2a')](respondWithResult(_0x5d14b7,null))[_0x3f2e('0x49')](handleError(_0x5d14b7,null));};exports[_0x3f2e('0x4c')]=function(_0x39dbd1,_0xb891b2){return db[_0x3f2e('0x2e')][_0x3f2e('0x4c')](_0x39dbd1[_0x3f2e('0x4d')],{})['then'](function(_0x4f65fe){var _0x2fe0c3=_0x39dbd1['user'][_0x3f2e('0x28')]({'plain':!![]});if(!_0x2fe0c3)throw new Error(_0x3f2e('0x4e'));if(_0x2fe0c3[_0x3f2e('0x4f')]===_0x3f2e('0x50')){var _0x4b6950=_0x4f65fe[_0x3f2e('0x28')]({'plain':!![]});var _0x4e7491=_0x3f2e('0x51');return db[_0x3f2e('0x52')]['find']({'where':{'name':_0x4e7491,'userProfileId':_0x2fe0c3[_0x3f2e('0x53')]},'raw':!![]})['then'](function(_0x81a50d){if(_0x81a50d&&_0x81a50d[_0x3f2e('0x54')]===0x0){return db[_0x3f2e('0x29')]['create']({'name':_0x4b6950[_0x3f2e('0x2c')],'resourceId':_0x4b6950['id'],'type':_0x81a50d[_0x3f2e('0x2c')],'sectionId':_0x81a50d['id']},{})[_0x3f2e('0x2a')](function(){return _0x4f65fe;});}else{return _0x4f65fe;}})[_0x3f2e('0x49')](function(_0x3c4cbe){logger[_0x3f2e('0x55')](_0x3f2e('0x56'),_0x3c4cbe);throw _0x3c4cbe;});}return _0x4f65fe;})[_0x3f2e('0x2a')](respondWithResult(_0xb891b2,0xc9))[_0x3f2e('0x49')](handleError(_0xb891b2,null));};exports[_0x3f2e('0x57')]=function(_0x519afe,_0x2634a1){if(_0x519afe[_0x3f2e('0x4d')]['id']){delete _0x519afe[_0x3f2e('0x4d')]['id'];}return db[_0x3f2e('0x2e')][_0x3f2e('0x58')]({'where':{'id':_0x519afe[_0x3f2e('0x59')]['id']}})[_0x3f2e('0x2a')](handleEntityNotFound(_0x2634a1,null))[_0x3f2e('0x2a')](saveUpdates(_0x519afe['body'],null))[_0x3f2e('0x2a')](respondWithResult(_0x2634a1,null))[_0x3f2e('0x49')](handleError(_0x2634a1,null));};exports[_0x3f2e('0x5a')]=function(_0xb6e744,_0x11f48d){return db['ContactItemType']['find']({'where':{'id':_0xb6e744[_0x3f2e('0x59')]['id']}})[_0x3f2e('0x2a')](handleEntityNotFound(_0x11f48d,null))[_0x3f2e('0x2a')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0xb6e744['params']['id']}}))[_0x3f2e('0x2a')](removeEntity(_0x11f48d,null))[_0x3f2e('0x49')](handleError(_0x11f48d,null));};
\ No newline at end of file
+var _0xfef3=['catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','ContactItemTypes','UserProfileResource','then','error','stack','name','send','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0xfef3,0x118));var _0x3fef=function(_0x1a8d4a,_0x374281){_0x1a8d4a=_0x1a8d4a-0x0;var _0x5242ff=_0xfef3[_0x1a8d4a];return _0x5242ff;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){var _0x4d462c=_0x3ba38d['get']({'plain':!![]});var _0x45464b=_0x3fef('0x28');return db[_0x3fef('0x29')][_0x3fef('0x27')]({'where':{'type':_0x45464b,'resourceId':_0x4d462c['id']}})[_0x3fef('0x2a')](function(){return _0x3ba38d;});})['then'](function(){_0x50025f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x121ff0,_0x3baa52){return function(_0x4ea2ab){if(!_0x4ea2ab){_0x121ff0[_0x3fef('0x19')](0x194);}return _0x4ea2ab;};}function handleError(_0x6d08cd,_0x4e08d8){_0x4e08d8=_0x4e08d8||0x1f4;return function(_0x30a954){logger[_0x3fef('0x2b')](_0x30a954[_0x3fef('0x2c')]);if(_0x30a954[_0x3fef('0x2d')]){delete _0x30a954[_0x3fef('0x2d')];}_0x6d08cd[_0x3fef('0x20')](_0x4e08d8)[_0x3fef('0x2e')](_0x30a954);};}exports['index']=function(_0x34576a,_0xc20ce5){var _0x21aad4={},_0x11bd40={},_0x5dbbc0={'count':0x0,'rows':[]};var _0xcd635d=_['map'](db[_0x3fef('0x2f')][_0x3fef('0x30')],function(_0x16009a){return{'name':_0x16009a[_0x3fef('0x31')],'type':_0x16009a[_0x3fef('0x32')][_0x3fef('0x33')]};});_0x11bd40[_0x3fef('0x34')]=_[_0x3fef('0x35')](_0xcd635d,_0x3fef('0x2d'));_0x11bd40[_0x3fef('0x36')]=_['keys'](_0x34576a['query']);_0x11bd40[_0x3fef('0x37')]=_['intersection'](_0x11bd40[_0x3fef('0x34')],_0x11bd40[_0x3fef('0x36')]);_0x21aad4[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x11bd40[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x21aad4[_0x3fef('0x38')]=_0x21aad4[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x21aad4[_0x3fef('0x38')]:_0x11bd40[_0x3fef('0x34')];if(!_0x34576a[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x21aad4[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x21aad4[_0x3fef('0x1c')]=qs['offset'](_0x34576a['query'][_0x3fef('0x1c')]);}_0x21aad4[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x21aad4[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x34576a[_0x3fef('0x36')],_0x11bd40[_0x3fef('0x37')]),_0xcd635d);if(_0x34576a[_0x3fef('0x36')]['filter']){_0x21aad4[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x21aad4['where'],{'$or':_['map'](_0xcd635d,function(_0x37c4af){if(_0x37c4af[_0x3fef('0x32')]!==_0x3fef('0x42')){var _0x21c531={};_0x21c531[_0x37c4af[_0x3fef('0x2d')]]={'$like':'%'+_0x34576a[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x21c531;}})});}_0x21aad4=_[_0x3fef('0x41')]({},_0x21aad4,_0x34576a['options']);var _0x107d42={'where':_0x21aad4[_0x3fef('0x3f')]};return db[_0x3fef('0x2f')][_0x3fef('0x1f')](_0x107d42)[_0x3fef('0x2a')](function(_0x2143ec){_0x5dbbc0[_0x3fef('0x1f')]=_0x2143ec;if(_0x34576a[_0x3fef('0x36')][_0x3fef('0x44')]){_0x21aad4[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x2f')][_0x3fef('0x46')](_0x21aad4);})[_0x3fef('0x2a')](function(_0x15d2c7){_0x5dbbc0[_0x3fef('0x47')]=_0x15d2c7;return _0x5dbbc0;})['then'](respondWithFilteredResult(_0xc20ce5,_0x21aad4))[_0x3fef('0x48')](handleError(_0xc20ce5,null));};exports[_0x3fef('0x49')]=function(_0x421fd1,_0x2120fd){var _0x1879c1={'raw':!![],'where':{'id':_0x421fd1['params']['id']}},_0x33b145={};_0x33b145[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x2f')][_0x3fef('0x30')]);_0x33b145['query']=_[_0x3fef('0x4a')](_0x421fd1['query']);_0x33b145[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],_0x33b145[_0x3fef('0x36')]);_0x1879c1[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x421fd1[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x1879c1[_0x3fef('0x38')]=_0x1879c1[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x1879c1['attributes']:_0x33b145[_0x3fef('0x34')];if(_0x421fd1[_0x3fef('0x36')]['includeAll']){_0x1879c1[_0x3fef('0x45')]=[{'all':!![]}];}_0x1879c1=_[_0x3fef('0x41')]({},_0x1879c1,_0x421fd1[_0x3fef('0x4b')]);return db['ContactItemType'][_0x3fef('0x4c')](_0x1879c1)[_0x3fef('0x2a')](handleEntityNotFound(_0x2120fd,null))['then'](respondWithResult(_0x2120fd,null))[_0x3fef('0x48')](handleError(_0x2120fd,null));};exports['create']=function(_0x48322c,_0x15fb2c){return db['ContactItemType'][_0x3fef('0x4d')](_0x48322c[_0x3fef('0x4e')],{})['then'](function(_0x4535e8){var _0x2823f4=_0x48322c[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x2823f4)throw new Error(_0x3fef('0x50'));if(_0x2823f4[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0x5b1acb=_0x4535e8[_0x3fef('0x52')]({'plain':!![]});var _0x154311=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x154311,'userProfileId':_0x2823f4['userProfileId']},'raw':!![]})[_0x3fef('0x2a')](function(_0xbbf255){if(_0xbbf255&&_0xbbf255[_0x3fef('0x54')]===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0x5b1acb[_0x3fef('0x2d')],'resourceId':_0x5b1acb['id'],'type':_0xbbf255[_0x3fef('0x2d')],'sectionId':_0xbbf255['id']},{})[_0x3fef('0x2a')](function(){return _0x4535e8;});}else{return _0x4535e8;}})[_0x3fef('0x48')](function(_0x4862a5){logger['error'](_0x3fef('0x55'),_0x4862a5);throw _0x4862a5;});}return _0x4535e8;})[_0x3fef('0x2a')](respondWithResult(_0x15fb2c,0xc9))[_0x3fef('0x48')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x26')]=function(_0xd57af2,_0x192f91){if(_0xd57af2[_0x3fef('0x4e')]['id']){delete _0xd57af2[_0x3fef('0x4e')]['id'];}return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0xd57af2[_0x3fef('0x56')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x192f91,null))['then'](saveUpdates(_0xd57af2[_0x3fef('0x4e')],null))[_0x3fef('0x2a')](respondWithResult(_0x192f91,null))[_0x3fef('0x48')](handleError(_0x192f91,null));};exports[_0x3fef('0x27')]=function(_0x5b0415,_0x114191){return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x5b0415[_0x3fef('0x56')]['id']}})['then'](handleEntityNotFound(_0x114191,null))[_0x3fef('0x2a')](db[_0x3fef('0x57')][_0x3fef('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5b0415['params']['id']}}))['then'](removeEntity(_0x114191,null))[_0x3fef('0x48')](handleError(_0x114191,null));};
\ No newline at end of file
index 1ca6ecc..2d01546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x178e=['rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','request-promise','path'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x178e,0x195));var _0xe178=function(_0x4227f7,_0x5e2633){_0x4227f7=_0x4227f7-0x0;var _0x4d394e=_0x178e[_0x4227f7];return _0x4d394e;};'use strict';var _=require(_0xe178('0x0'));var util=require('util');var logger=require(_0xe178('0x1'))(_0xe178('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe178('0x3'));var fs=require('fs');var path=require(_0xe178('0x4'));var rimraf=require(_0xe178('0x5'));var config=require(_0xe178('0x6'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x453a31,_0x1ad3f6){return _0x453a31[_0xe178('0x7')](_0xe178('0x8'),attributes,{'tableName':_0xe178('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdafd=['../../config/environment','./contactItemType.attributes','define','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c774b,_0xdc5f14){var _0x445e28=function(_0x5518f7){while(--_0x5518f7){_0x3c774b['push'](_0x3c774b['shift']());}};_0x445e28(++_0xdc5f14);}(_0xdafd,0x19b));var _0xddaf=function(_0x1c3063,_0x537425){_0x1c3063=_0x1c3063-0x0;var _0x43d17=_0xdafd[_0x1c3063];return _0x43d17;};'use strict';var _=require(_0xddaf('0x0'));var util=require('util');var logger=require(_0xddaf('0x1'))(_0xddaf('0x2'));var moment=require(_0xddaf('0x3'));var BPromise=require(_0xddaf('0x4'));var rp=require(_0xddaf('0x5'));var fs=require('fs');var path=require(_0xddaf('0x6'));var rimraf=require('rimraf');var config=require(_0xddaf('0x7'));var attributes=require(_0xddaf('0x8'));module['exports']=function(_0xde69b7,_0x535117){return _0xde69b7[_0xddaf('0x9')]('ContactItemType',attributes,{'tableName':_0xddaf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 599fd94..7fde516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8138=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8138,0xed));var _0x8813=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x8138[_0x52bfa5];return _0x26f80b;};'use strict';var _=require(_0x8813('0x0'));var util=require(_0x8813('0x1'));var moment=require('moment');var BPromise=require(_0x8813('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8813('0x3'))['db'];var utils=require(_0x8813('0x4'));var logger=require(_0x8813('0x5'))(_0x8813('0x6'));var config=require(_0x8813('0x7'));var jayson=require(_0x8813('0x8'));var client=jayson[_0x8813('0x9')][_0x8813('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x483c2b,_0x39bcf7,_0x552021){return new BPromise(function(_0x33b9a3,_0x8fee94){return client[_0x8813('0xb')](_0x483c2b,_0x552021)[_0x8813('0xc')](function(_0x4fcfc9){logger[_0x8813('0xd')]('ContactItemType,\x20%s,\x20%s',_0x39bcf7,_0x8813('0xe'));logger[_0x8813('0xf')](_0x8813('0x10'),_0x39bcf7,_0x8813('0xe'),JSON[_0x8813('0x11')](_0x4fcfc9));if(_0x4fcfc9[_0x8813('0x12')]){if(_0x4fcfc9[_0x8813('0x12')][_0x8813('0x13')]===0x1f4){logger[_0x8813('0x12')](_0x8813('0x14'),_0x39bcf7,_0x4fcfc9['error'][_0x8813('0x15')]);return _0x8fee94(_0x4fcfc9[_0x8813('0x12')][_0x8813('0x15')]);}logger[_0x8813('0x12')]('ContactItemType,\x20%s,\x20%s',_0x39bcf7,_0x4fcfc9['error'][_0x8813('0x15')]);return _0x33b9a3(_0x4fcfc9['error'][_0x8813('0x15')]);}else{logger[_0x8813('0xd')]('ContactItemType,\x20%s,\x20%s',_0x39bcf7,_0x8813('0xe'));_0x33b9a3(_0x4fcfc9[_0x8813('0x16')][_0x8813('0x15')]);}})[_0x8813('0x17')](function(_0x249b09){logger[_0x8813('0x12')](_0x8813('0x14'),_0x39bcf7,_0x249b09);_0x8fee94(_0x249b09);});});}
\ No newline at end of file
+var _0x8f09=['result','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x83609a,_0x4623de){var _0x3de3aa=function(_0x46d4e6){while(--_0x46d4e6){_0x83609a['push'](_0x83609a['shift']());}};_0x3de3aa(++_0x4623de);}(_0x8f09,0x157));var _0x98f0=function(_0x1d1e10,_0x22b596){_0x1d1e10=_0x1d1e10-0x0;var _0x431515=_0x8f09[_0x1d1e10];return _0x431515;};'use strict';var _=require(_0x98f0('0x0'));var util=require('util');var moment=require(_0x98f0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98f0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f0('0x3'));var logger=require(_0x98f0('0x4'))(_0x98f0('0x5'));var config=require(_0x98f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x98f0('0x7')][_0x98f0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2836db,_0x3fba41,_0x3c8b1d){return new BPromise(function(_0x542417,_0x3243b0){return client['request'](_0x2836db,_0x3c8b1d)[_0x98f0('0x9')](function(_0x145f59){logger['info'](_0x98f0('0xa'),_0x3fba41,'request\x20sent');logger[_0x98f0('0xb')](_0x98f0('0xc'),_0x3fba41,'request\x20sent',JSON[_0x98f0('0xd')](_0x145f59));if(_0x145f59[_0x98f0('0xe')]){if(_0x145f59['error'][_0x98f0('0xf')]===0x1f4){logger[_0x98f0('0xe')](_0x98f0('0xa'),_0x3fba41,_0x145f59[_0x98f0('0xe')][_0x98f0('0x10')]);return _0x3243b0(_0x145f59['error'][_0x98f0('0x10')]);}logger[_0x98f0('0xe')](_0x98f0('0xa'),_0x3fba41,_0x145f59[_0x98f0('0xe')][_0x98f0('0x10')]);return _0x542417(_0x145f59['error'][_0x98f0('0x10')]);}else{logger['info'](_0x98f0('0xa'),_0x3fba41,_0x98f0('0x11'));_0x542417(_0x145f59[_0x98f0('0x12')][_0x98f0('0x10')]);}})['catch'](function(_0x3213fd){logger[_0x98f0('0xe')](_0x98f0('0xa'),_0x3fba41,_0x3213fd);_0x3243b0(_0x3213fd);});});}
\ No newline at end of file
index 37da004..498c614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb23=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','put'];(function(_0x11f9cb,_0x242176){var _0x367478=function(_0x57dfc0){while(--_0x57dfc0){_0x11f9cb['push'](_0x11f9cb['shift']());}};_0x367478(++_0x242176);}(_0xcb23,0xd7));var _0x3cb2=function(_0x33aa99,_0x2b2709){_0x33aa99=_0x33aa99-0x0;var _0xcaab6d=_0xcb23[_0x33aa99];return _0xcaab6d;};'use strict';var multer=require(_0x3cb2('0x0'));var util=require('util');var path=require(_0x3cb2('0x1'));var timeout=require(_0x3cb2('0x2'));var express=require(_0x3cb2('0x3'));var router=express[_0x3cb2('0x4')]();var fs_extra=require(_0x3cb2('0x5'));var auth=require(_0x3cb2('0x6'));var interaction=require(_0x3cb2('0x7'));var config=require(_0x3cb2('0x8'));var controller=require(_0x3cb2('0x9'));router[_0x3cb2('0xa')]('/',auth[_0x3cb2('0xb')](),controller['index']);router[_0x3cb2('0xa')]('/:id',auth[_0x3cb2('0xb')](),controller[_0x3cb2('0xc')]);router[_0x3cb2('0xd')]('/',auth['isAuthenticated'](),controller[_0x3cb2('0xe')]);router[_0x3cb2('0xf')](_0x3cb2('0x10'),auth[_0x3cb2('0xb')](),controller[_0x3cb2('0x11')]);router[_0x3cb2('0x12')](_0x3cb2('0x10'),auth['isAuthenticated'](),controller[_0x3cb2('0x13')]);module[_0x3cb2('0x14')]=router;
\ No newline at end of file
+var _0x6e0d=['index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated'];(function(_0x1b9e32,_0x22ba6f){var _0x4db419=function(_0xaf1584){while(--_0xaf1584){_0x1b9e32['push'](_0x1b9e32['shift']());}};_0x4db419(++_0x22ba6f);}(_0x6e0d,0xbd));var _0xd6e0=function(_0x642d4d,_0x611a6c){_0x642d4d=_0x642d4d-0x0;var _0x4d12e2=_0x6e0d[_0x642d4d];return _0x4d12e2;};'use strict';var multer=require('multer');var util=require(_0xd6e0('0x0'));var path=require(_0xd6e0('0x1'));var timeout=require(_0xd6e0('0x2'));var express=require(_0xd6e0('0x3'));var router=express[_0xd6e0('0x4')]();var fs_extra=require(_0xd6e0('0x5'));var auth=require(_0xd6e0('0x6'));var interaction=require(_0xd6e0('0x7'));var config=require('../../config/environment');var controller=require(_0xd6e0('0x8'));router[_0xd6e0('0x9')]('/',auth[_0xd6e0('0xa')](),controller[_0xd6e0('0xb')]);router['get'](_0xd6e0('0xc'),auth[_0xd6e0('0xa')](),controller[_0xd6e0('0xd')]);router[_0xd6e0('0xe')]('/',auth[_0xd6e0('0xa')](),controller[_0xd6e0('0xf')]);router[_0xd6e0('0x10')](_0xd6e0('0xc'),auth['isAuthenticated'](),controller[_0xd6e0('0x11')]);router[_0xd6e0('0x12')](_0xd6e0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd6e0('0x13')]=router;
\ No newline at end of file
index 6f1caf5..ac52188 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x5dd542,_0x2beffd){var _0x4f3684=function(_0x57beee){while(--_0x57beee){_0x5dd542['push'](_0x5dd542['shift']());}};_0x4f3684(++_0x2beffd);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b78e5,_0x3126f8){_0x2b78e5=_0x2b78e5-0x0;var _0xa8d52d=_0xb10b[_0x2b78e5];return _0xa8d52d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xb7e7=['STRING','sequelize'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
index 9ed3b7f..119c662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0af=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrWhatsappAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','nolimit','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','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','redis','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x34579d,_0x441af0){var _0x35e882=function(_0x2bbd89){while(--_0x2bbd89){_0x34579d['push'](_0x34579d['shift']());}};_0x35e882(++_0x441af0);}(_0xa0af,0x132));var _0xfa0a=function(_0x2c668e,_0x7fd1b1){_0x2c668e=_0x2c668e-0x0;var _0x1c5a8d=_0xa0af[_0x2c668e];return _0x1c5a8d;};'use strict';var emlformat=require(_0xfa0a('0x0'));var rimraf=require(_0xfa0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa0a('0x2'));var moment=require(_0xfa0a('0x3'));var BPromise=require(_0xfa0a('0x4'));var Mustache=require(_0xfa0a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfa0a('0x6'));var csv=require(_0xfa0a('0x7'));var ejs=require(_0xfa0a('0x8'));var fs=require('fs');var fs_extra=require(_0xfa0a('0x9'));var _=require(_0xfa0a('0xa'));var squel=require(_0xfa0a('0xb'));var crypto=require(_0xfa0a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfa0a('0xd'));var toCsv=require(_0xfa0a('0x7'));var querystring=require(_0xfa0a('0xe'));var Papa=require(_0xfa0a('0xf'));var Redis=require('ioredis');var authService=require(_0xfa0a('0x10'));var qs=require(_0xfa0a('0x11'));var as=require(_0xfa0a('0x12'));var hardwareService=require(_0xfa0a('0x13'));var logger=require(_0xfa0a('0x14'))(_0xfa0a('0x15'));var utils=require(_0xfa0a('0x16'));var config=require(_0xfa0a('0x17'));var licenseUtil=require(_0xfa0a('0x18'));var db=require(_0xfa0a('0x19'))['db'];config[_0xfa0a('0x1a')]=_['defaults'](config[_0xfa0a('0x1a')],{'host':_0xfa0a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa0a('0x1a')]));require(_0xfa0a('0x1c'))[_0xfa0a('0x1d')](socket);function respondWithStatusCode(_0x783210,_0x4cfcac){_0x4cfcac=_0x4cfcac||0xcc;return function(_0x2ce26d){if(_0x2ce26d){return _0x783210[_0xfa0a('0x1e')](_0x4cfcac);}return _0x783210[_0xfa0a('0x1f')](_0x4cfcac)[_0xfa0a('0x20')]();};}function respondWithResult(_0x3c0285,_0x3a22c6){_0x3a22c6=_0x3a22c6||0xc8;return function(_0x226362){if(_0x226362){return _0x3c0285[_0xfa0a('0x1f')](_0x3a22c6)[_0xfa0a('0x21')](_0x226362);}};}function respondWithFilteredResult(_0x519218,_0x214d39){return function(_0x3d4df8){if(_0x3d4df8){var _0x38b3d9=typeof _0x214d39[_0xfa0a('0x22')]===_0xfa0a('0x23')&&typeof _0x214d39[_0xfa0a('0x24')]===_0xfa0a('0x23');var _0x4dd8f1=_0x3d4df8['count'];var _0x5f3306=_0x38b3d9?0x0:_0x214d39[_0xfa0a('0x22')];var _0x285c25=_0x38b3d9?_0x3d4df8[_0xfa0a('0x25')]:_0x214d39[_0xfa0a('0x22')]+_0x214d39[_0xfa0a('0x24')];var _0xe50fa5;if(_0x285c25>=_0x4dd8f1){_0x285c25=_0x4dd8f1;_0xe50fa5=0xc8;}else{_0xe50fa5=0xce;}_0x519218[_0xfa0a('0x1f')](_0xe50fa5);return _0x519218[_0xfa0a('0x26')](_0xfa0a('0x27'),_0x5f3306+'-'+_0x285c25+'/'+_0x4dd8f1)[_0xfa0a('0x21')](_0x3d4df8);}return null;};}function patchUpdates(_0x1ab4b8){return function(_0x237a93){try{jsonpatch[_0xfa0a('0x28')](_0x237a93,_0x1ab4b8,!![]);}catch(_0x7080f5){return BPromise[_0xfa0a('0x29')](_0x7080f5);}return _0x237a93[_0xfa0a('0x2a')]();};}function saveUpdates(_0x8ef394,_0x3a6526){return function(_0x40ba03){if(_0x40ba03){return _0x40ba03[_0xfa0a('0x2b')](_0x8ef394)['then'](function(_0x757620){return _0x757620;});}return null;};}function removeEntity(_0x372c68,_0x33c5cc){return function(_0x3158ce){if(_0x3158ce){return _0x3158ce[_0xfa0a('0x2c')]()[_0xfa0a('0x2d')](function(){var _0x268ffd=_0x3158ce[_0xfa0a('0x2e')]({'plain':!![]});var _0x195bdd=_0xfa0a('0x2f');return db[_0xfa0a('0x30')][_0xfa0a('0x2c')]({'where':{'type':_0x195bdd,'resourceId':_0x268ffd['id']}})[_0xfa0a('0x2d')](function(){return _0x3158ce;});})[_0xfa0a('0x2d')](function(){_0x372c68[_0xfa0a('0x1f')](0xcc)[_0xfa0a('0x20')]();});}};}function handleEntityNotFound(_0x3e35e1,_0x46249c){return function(_0xa9991c){if(!_0xa9991c){_0x3e35e1[_0xfa0a('0x1e')](0x194);}return _0xa9991c;};}function handleError(_0x349518,_0x113a86){_0x113a86=_0x113a86||0x1f4;return function(_0x308620){logger[_0xfa0a('0x31')](_0x308620[_0xfa0a('0x32')]);if(_0x308620['name']){delete _0x308620[_0xfa0a('0x33')];}_0x349518['status'](_0x113a86)[_0xfa0a('0x34')](_0x308620);};}exports[_0xfa0a('0x35')]=function(_0x1e112d,_0x189857){var _0x12cc52={},_0x267949={},_0x1f4d36={'count':0x0,'rows':[]};var _0x53f378=_[_0xfa0a('0x36')](db[_0xfa0a('0x37')][_0xfa0a('0x38')],function(_0x3688e1){return{'name':_0x3688e1[_0xfa0a('0x39')],'type':_0x3688e1['type'][_0xfa0a('0x3a')]};});_0x267949[_0xfa0a('0x3b')]=_[_0xfa0a('0x36')](_0x53f378,_0xfa0a('0x33'));_0x267949[_0xfa0a('0x3c')]=_[_0xfa0a('0x3d')](_0x1e112d[_0xfa0a('0x3c')]);_0x267949[_0xfa0a('0x3e')]=_[_0xfa0a('0x3f')](_0x267949[_0xfa0a('0x3b')],_0x267949[_0xfa0a('0x3c')]);_0x12cc52[_0xfa0a('0x40')]=_[_0xfa0a('0x3f')](_0x267949['model'],qs[_0xfa0a('0x41')](_0x1e112d[_0xfa0a('0x3c')]['fields']));_0x12cc52[_0xfa0a('0x40')]=_0x12cc52[_0xfa0a('0x40')][_0xfa0a('0x42')]?_0x12cc52['attributes']:_0x267949['model'];if(!_0x1e112d[_0xfa0a('0x3c')][_0xfa0a('0x43')]('nolimit')){_0x12cc52[_0xfa0a('0x24')]=qs[_0xfa0a('0x24')](_0x1e112d[_0xfa0a('0x3c')]['limit']);_0x12cc52[_0xfa0a('0x22')]=qs[_0xfa0a('0x22')](_0x1e112d['query']['offset']);}_0x12cc52[_0xfa0a('0x44')]=qs[_0xfa0a('0x45')](_0x1e112d[_0xfa0a('0x3c')]['sort']);_0x12cc52['where']=qs[_0xfa0a('0x3e')](_['pick'](_0x1e112d['query'],_0x267949[_0xfa0a('0x3e')]),_0x53f378);if(_0x1e112d[_0xfa0a('0x3c')]['filter']){_0x12cc52[_0xfa0a('0x46')]=_[_0xfa0a('0x47')](_0x12cc52[_0xfa0a('0x46')],{'$or':_[_0xfa0a('0x36')](_0x53f378,function(_0x419e0c){if(_0x419e0c[_0xfa0a('0x48')]!=='VIRTUAL'){var _0x488ea5={};_0x488ea5[_0x419e0c[_0xfa0a('0x33')]]={'$like':'%'+_0x1e112d[_0xfa0a('0x3c')][_0xfa0a('0x49')]+'%'};return _0x488ea5;}})});}_0x12cc52=_[_0xfa0a('0x47')]({},_0x12cc52,_0x1e112d[_0xfa0a('0x4a')]);var _0x375acd={'where':_0x12cc52[_0xfa0a('0x46')]};return db[_0xfa0a('0x37')][_0xfa0a('0x25')](_0x375acd)[_0xfa0a('0x2d')](function(_0x44c724){_0x1f4d36[_0xfa0a('0x25')]=_0x44c724;if(_0x1e112d[_0xfa0a('0x3c')][_0xfa0a('0x4b')]){_0x12cc52[_0xfa0a('0x4c')]=[{'all':!![]}];}return db[_0xfa0a('0x37')][_0xfa0a('0x4d')](_0x12cc52);})[_0xfa0a('0x2d')](function(_0x2e7998){_0x1f4d36[_0xfa0a('0x4e')]=_0x2e7998;return _0x1f4d36;})[_0xfa0a('0x2d')](respondWithFilteredResult(_0x189857,_0x12cc52))[_0xfa0a('0x4f')](handleError(_0x189857,null));};exports['show']=function(_0x3bbb44,_0x57fbee){var _0x49ccea={'raw':![],'where':{'id':_0x3bbb44[_0xfa0a('0x50')]['id']}},_0x16736d={};_0x16736d[_0xfa0a('0x3b')]=_[_0xfa0a('0x3d')](db[_0xfa0a('0x37')][_0xfa0a('0x38')]);_0x16736d[_0xfa0a('0x3c')]=_[_0xfa0a('0x3d')](_0x3bbb44[_0xfa0a('0x3c')]);_0x16736d['filters']=_[_0xfa0a('0x3f')](_0x16736d[_0xfa0a('0x3b')],_0x16736d[_0xfa0a('0x3c')]);_0x49ccea['attributes']=_[_0xfa0a('0x3f')](_0x16736d['model'],qs['fields'](_0x3bbb44[_0xfa0a('0x3c')][_0xfa0a('0x41')]));_0x49ccea[_0xfa0a('0x40')]=_0x49ccea['attributes']['length']?_0x49ccea[_0xfa0a('0x40')]:_0x16736d[_0xfa0a('0x3b')];if(_0x3bbb44[_0xfa0a('0x3c')][_0xfa0a('0x4b')]){_0x49ccea[_0xfa0a('0x4c')]=[{'all':!![]}];}_0x49ccea=_[_0xfa0a('0x47')]({},_0x49ccea,_0x3bbb44['options']);return db[_0xfa0a('0x37')][_0xfa0a('0x51')](_0x49ccea)[_0xfa0a('0x2d')](handleEntityNotFound(_0x57fbee,null))[_0xfa0a('0x2d')](respondWithResult(_0x57fbee,null))[_0xfa0a('0x4f')](handleError(_0x57fbee,null));};exports[_0xfa0a('0x52')]=function(_0x47dc96,_0x541f0d){return db[_0xfa0a('0x37')][_0xfa0a('0x52')](_0x47dc96['body'],{})['then'](function(_0x5a0c8b){var _0x5bfa99=_0x47dc96[_0xfa0a('0x53')]['get']({'plain':!![]});if(!_0x5bfa99)throw new Error(_0xfa0a('0x54'));if(_0x5bfa99[_0xfa0a('0x55')]===_0xfa0a('0x53')){var _0x49d686=_0x5a0c8b[_0xfa0a('0x2e')]({'plain':!![]});var _0x328b8c='CustomDashboards';return db[_0xfa0a('0x56')][_0xfa0a('0x51')]({'where':{'name':_0x328b8c,'userProfileId':_0x5bfa99[_0xfa0a('0x57')]},'raw':!![]})[_0xfa0a('0x2d')](function(_0x161a42){if(_0x161a42&&_0x161a42[_0xfa0a('0x58')]===0x0){return db[_0xfa0a('0x30')][_0xfa0a('0x52')]({'name':_0x49d686['name'],'resourceId':_0x49d686['id'],'type':_0x161a42['name'],'sectionId':_0x161a42['id']},{})[_0xfa0a('0x2d')](function(){return _0x5a0c8b;});}else{return _0x5a0c8b;}})[_0xfa0a('0x4f')](function(_0x5cba83){logger['error'](_0xfa0a('0x59'),_0x5cba83);throw _0x5cba83;});}return _0x5a0c8b;})[_0xfa0a('0x2d')](respondWithResult(_0x541f0d,0xc9))[_0xfa0a('0x4f')](handleError(_0x541f0d,null));};exports[_0xfa0a('0x5a')]=function(_0x209cdc,_0x20ea93){var _0x1729c1={'where':{'id':_0x209cdc['params']['id']}},_0x202203={};_0x202203['model']=_[_0xfa0a('0x3d')](db[_0xfa0a('0x37')][_0xfa0a('0x38')]);_0x1729c1[_0xfa0a('0x40')]=_[_0xfa0a('0x3f')](_0x202203[_0xfa0a('0x3b')],qs[_0xfa0a('0x41')](_0x209cdc['query'][_0xfa0a('0x41')]));_0x1729c1[_0xfa0a('0x40')]=_0x1729c1[_0xfa0a('0x40')]['length']?_0x1729c1[_0xfa0a('0x40')]:_0x202203['model'];if(_0x209cdc[_0xfa0a('0x3c')]['includeAll']){_0x1729c1[_0xfa0a('0x4c')]=[{'all':!![]}];}_0x1729c1=_[_0xfa0a('0x47')]({},_0x1729c1,_0x209cdc[_0xfa0a('0x4a')]);return db['Dashboard'][_0xfa0a('0x51')](_0x1729c1)[_0xfa0a('0x2d')](handleEntityNotFound(_0x20ea93,null))[_0xfa0a('0x2d')](function(_0x1a0907){if(_0x1a0907){var _0x405fba=_0x1a0907[_0xfa0a('0x2e')]({'plain':!![]});_0x405fba=qs[_0xfa0a('0x5b')](_0x405fba,['id','createdAt','updatedAt']);_0x209cdc[_0xfa0a('0x5c')]=_[_0xfa0a('0x5b')](_0x209cdc[_0xfa0a('0x5c')],['id',_0xfa0a('0x5d'),_0xfa0a('0x5e')]);return db[_0xfa0a('0x37')][_0xfa0a('0x52')](_[_0xfa0a('0x47')](_0x405fba,_0x209cdc[_0xfa0a('0x5c')]),{'include':_0x209cdc[_0xfa0a('0x3c')][_0xfa0a('0x4b')]?[{'all':!![]}]:undefined})[_0xfa0a('0x2d')](function(_0x5ade41){var _0x22d6c8=_0x209cdc[_0xfa0a('0x53')][_0xfa0a('0x2e')]({'plain':!![]});if(!_0x22d6c8)throw new Error(_0xfa0a('0x54'));if(_0x22d6c8['role']==='user'){var _0x84f9f2=_0x5ade41[_0xfa0a('0x2e')]({'plain':!![]});var _0xc8ae40=_0xfa0a('0x2f');return db['UserProfileSection'][_0xfa0a('0x51')]({'where':{'name':_0xc8ae40,'userProfileId':_0x22d6c8[_0xfa0a('0x57')]},'raw':!![]})[_0xfa0a('0x2d')](function(_0x7623b){if(_0x7623b&&_0x7623b[_0xfa0a('0x58')]===0x0){return db[_0xfa0a('0x30')][_0xfa0a('0x52')]({'name':_0x84f9f2[_0xfa0a('0x33')],'resourceId':_0x84f9f2['id'],'type':_0x7623b[_0xfa0a('0x33')],'sectionId':_0x7623b['id']},{})[_0xfa0a('0x2d')](function(){return _0x5ade41;});}else{return _0x5ade41;}})[_0xfa0a('0x4f')](function(_0x9acc8f){logger[_0xfa0a('0x31')](_0xfa0a('0x59'),_0x9acc8f);throw _0x9acc8f;});}return _0x5ade41;});}})['then'](respondWithResult(_0x20ea93,0xc9))[_0xfa0a('0x4f')](handleError(_0x20ea93,null));};exports[_0xfa0a('0x2b')]=function(_0x3a3bda,_0x1802fc){if(_0x3a3bda[_0xfa0a('0x5c')]['id']){delete _0x3a3bda['body']['id'];}return db[_0xfa0a('0x37')]['find']({'where':{'id':_0x3a3bda[_0xfa0a('0x50')]['id']}})[_0xfa0a('0x2d')](handleEntityNotFound(_0x1802fc,null))[_0xfa0a('0x2d')](saveUpdates(_0x3a3bda[_0xfa0a('0x5c')],null))[_0xfa0a('0x2d')](respondWithResult(_0x1802fc,null))[_0xfa0a('0x4f')](handleError(_0x1802fc,null));};exports[_0xfa0a('0x2c')]=function(_0x3e8dca,_0x42314a){return db[_0xfa0a('0x37')][_0xfa0a('0x51')]({'where':{'id':_0x3e8dca[_0xfa0a('0x50')]['id']}})[_0xfa0a('0x2d')](handleEntityNotFound(_0x42314a,null))['then'](removeEntity(_0x42314a,null))[_0xfa0a('0x4f')](handleError(_0x42314a,null));};function widgetAttributes(_0x1daaf4){try{switch(_0x1daaf4['type']){case _0xfa0a('0x5f'):return[{'name':_0xfa0a('0x60'),'value':_0x1daaf4[_0xfa0a('0x60')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4['attrs'][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0][_0xfa0a('0x62')]:undefined)||_0xfa0a('0x63')}];case _0xfa0a('0x64'):return[{'name':_0xfa0a('0x65'),'value':_0x1daaf4[_0xfa0a('0x65')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4['attrs'][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0][_0xfa0a('0x62')]:undefined)||''}];case _0xfa0a('0x66'):return[{'name':'attrHourFormat','value':_0x1daaf4[_0xfa0a('0x67')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4['attrs'][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0]['value']:undefined)||_0xfa0a('0x68')},{'name':_0xfa0a('0x69'),'value':_0x1daaf4['attrTimezone']||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x1]?_0x1daaf4['attrs'][0x1][_0xfa0a('0x62')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x1daaf4[_0xfa0a('0x6a')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x2]?_0x1daaf4[_0xfa0a('0x61')][0x2][_0xfa0a('0x62')]:undefined)||0xc}];case _0xfa0a('0x6b'):return[{'name':'attrMetric','value':_0x1daaf4[_0xfa0a('0x6c')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x0]?_0x1daaf4['attrs'][0x0][_0xfa0a('0x62')]:undefined)||'total'},{'name':_0xfa0a('0x6d'),'value':_0x1daaf4[_0xfa0a('0x6d')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x1]?_0x1daaf4[_0xfa0a('0x61')][0x1][_0xfa0a('0x62')]:undefined)||[]},{'name':_0xfa0a('0x6a'),'value':_0x1daaf4[_0xfa0a('0x6a')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x2]?_0x1daaf4['attrs'][0x2][_0xfa0a('0x62')]:undefined)||0x14},{'name':_0xfa0a('0x6e'),'value':_0x1daaf4['attrChannel']||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4['attrs'][0x3]?_0x1daaf4[_0xfa0a('0x61')][0x3][_0xfa0a('0x62')]:undefined)||_0xfa0a('0x6f')},{'name':_0xfa0a('0x70'),'value':_0x1daaf4[_0xfa0a('0x70')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x4]?_0x1daaf4['attrs'][0x4][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x71'),'value':_0x1daaf4[_0xfa0a('0x71')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x5]?_0x1daaf4['attrs'][0x5]['value']:undefined)||''},{'name':_0xfa0a('0x72'),'value':_0x1daaf4[_0xfa0a('0x72')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x6]?_0x1daaf4[_0xfa0a('0x61')][0x6][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x73'),'value':_0x1daaf4[_0xfa0a('0x73')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x7]?_0x1daaf4[_0xfa0a('0x61')][0x7][_0xfa0a('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1daaf4['attrWhatsappAccounts']||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x8]?_0x1daaf4[_0xfa0a('0x61')][0x8][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x74'),'value':_0x1daaf4['attrChatWebsites']||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x9]?_0x1daaf4['attrs'][0x9]['value']:undefined)||''}];case _0xfa0a('0x75'):case'pie-chart':return[{'name':_0xfa0a('0x76'),'value':_0x1daaf4[_0xfa0a('0x76')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4['attrs'][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0][_0xfa0a('0x62')]:undefined)||_0xfa0a('0x77')},{'name':_0xfa0a('0x78'),'value':_0x1daaf4[_0xfa0a('0x78')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x1]?_0x1daaf4['attrs'][0x1][_0xfa0a('0x62')]:undefined)||null},{'name':_0xfa0a('0x79'),'value':_0x1daaf4[_0xfa0a('0x79')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x2]?_0x1daaf4[_0xfa0a('0x61')][0x2][_0xfa0a('0x62')]:undefined)||null},{'name':_0xfa0a('0x6d'),'value':_0x1daaf4[_0xfa0a('0x6d')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x3]?_0x1daaf4[_0xfa0a('0x61')][0x3]['value']:undefined)||[]},{'name':_0xfa0a('0x6e'),'value':_0x1daaf4[_0xfa0a('0x6e')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x4]?_0x1daaf4[_0xfa0a('0x61')][0x4][_0xfa0a('0x62')]:undefined)||'voice'},{'name':_0xfa0a('0x70'),'value':_0x1daaf4[_0xfa0a('0x70')]||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x5]?_0x1daaf4[_0xfa0a('0x61')][0x5][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x71'),'value':_0x1daaf4[_0xfa0a('0x71')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x6]?_0x1daaf4[_0xfa0a('0x61')][0x6][_0xfa0a('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1daaf4[_0xfa0a('0x72')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x7]?_0x1daaf4[_0xfa0a('0x61')][0x7][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x73'),'value':_0x1daaf4['attrOpenchannelAccounts']||(_0x1daaf4['attrs']&&_0x1daaf4[_0xfa0a('0x61')][0x8]?_0x1daaf4['attrs'][0x8]['value']:undefined)||''},{'name':_0xfa0a('0x7a'),'value':_0x1daaf4[_0xfa0a('0x7a')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x9]?_0x1daaf4[_0xfa0a('0x61')][0x9][_0xfa0a('0x62')]:undefined)||''},{'name':_0xfa0a('0x74'),'value':_0x1daaf4[_0xfa0a('0x74')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0xa]?_0x1daaf4[_0xfa0a('0x61')][0xa][_0xfa0a('0x62')]:undefined)||''}];case'web-report':return[{'name':_0xfa0a('0x7b'),'type':_0x1daaf4['reportType']||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0][_0xfa0a('0x48')]:undefined)||null,'value':_0x1daaf4[_0xfa0a('0x7b')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x0]?_0x1daaf4[_0xfa0a('0x61')][0x0][_0xfa0a('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x1daaf4[_0xfa0a('0x7c')]||(_0x1daaf4[_0xfa0a('0x61')]&&_0x1daaf4[_0xfa0a('0x61')][0x1]?_0x1daaf4['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x27a7c1){logger[_0xfa0a('0x31')](_0xfa0a('0x7d'),JSON['stringify'](_0x27a7c1));return[];}}exports[_0xfa0a('0x7e')]=function(_0x2ac007,_0x534176,_0x58ed5e){if(_0x2ac007[_0xfa0a('0x5c')]['id']){delete _0x2ac007[_0xfa0a('0x5c')]['id'];}return db[_0xfa0a('0x37')][_0xfa0a('0x51')]({'where':{'id':_0x2ac007[_0xfa0a('0x50')]['id']}})[_0xfa0a('0x2d')](handleEntityNotFound(_0x534176,null))[_0xfa0a('0x2d')](function(_0x43a26c){if(_0x43a26c){_0x2ac007[_0xfa0a('0x5c')][_0xfa0a('0x7f')]=_0x43a26c['id'];_0x2ac007[_0xfa0a('0x5c')][_0xfa0a('0x61')]=widgetAttributes(_0x2ac007[_0xfa0a('0x5c')]);return db[_0xfa0a('0x80')][_0xfa0a('0x52')](_0x2ac007[_0xfa0a('0x5c')]);}})['then'](respondWithResult(_0x534176,null))[_0xfa0a('0x4f')](handleError(_0x534176,null));};exports[_0xfa0a('0x81')]=function(_0x10d678,_0x2243a2,_0x3f3f50){var _0x4b7c62={};var _0x425976={};var _0x36c2d1;var _0x420841;return db[_0xfa0a('0x37')]['findOne']({'where':{'id':_0x10d678['params']['id']}})[_0xfa0a('0x2d')](handleEntityNotFound(_0x2243a2,null))[_0xfa0a('0x2d')](function(_0x3ba89b){if(_0x3ba89b){_0x36c2d1=_0x3ba89b;_0x425976[_0xfa0a('0x3b')]=_[_0xfa0a('0x3d')](db['DashboardItem']['rawAttributes']);_0x425976['query']=_[_0xfa0a('0x3d')](_0x10d678[_0xfa0a('0x3c')]);_0x425976['filters']=_[_0xfa0a('0x3f')](_0x425976[_0xfa0a('0x3b')],_0x425976[_0xfa0a('0x3c')]);_0x4b7c62['attributes']=_['intersection'](_0x425976['model'],qs[_0xfa0a('0x41')](_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x41')]));_0x4b7c62[_0xfa0a('0x40')]=_0x4b7c62[_0xfa0a('0x40')]['length']?_0x4b7c62[_0xfa0a('0x40')]:_0x425976[_0xfa0a('0x3b')];_0x4b7c62[_0xfa0a('0x44')]=qs[_0xfa0a('0x45')](_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x45')]);_0x4b7c62[_0xfa0a('0x46')]=qs['filters'](_['pick'](_0x10d678[_0xfa0a('0x3c')],_0x425976[_0xfa0a('0x3e')]));if(_0x10d678[_0xfa0a('0x3c')]['filter']){_0x4b7c62[_0xfa0a('0x46')]=_['merge'](_0x4b7c62[_0xfa0a('0x46')],{'$or':_[_0xfa0a('0x36')](_0x4b7c62[_0xfa0a('0x40')],function(_0x54ac9e){var _0x17dc21={};_0x17dc21[_0x54ac9e]={'$like':'%'+_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x49')]+'%'};return _0x17dc21;})});}_0x4b7c62=_[_0xfa0a('0x47')]({},_0x4b7c62,_0x10d678[_0xfa0a('0x4a')]);return _0x36c2d1[_0xfa0a('0x81')](_0x4b7c62);}})[_0xfa0a('0x2d')](function(_0xb362c0){if(_0xb362c0){_0x420841=_0xb362c0['length'];if(!_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x43')](_0xfa0a('0x82'))){_0x4b7c62[_0xfa0a('0x24')]=qs[_0xfa0a('0x24')](_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x24')]);_0x4b7c62['offset']=qs['offset'](_0x10d678[_0xfa0a('0x3c')][_0xfa0a('0x22')]);}return _0x36c2d1[_0xfa0a('0x81')](_0x4b7c62);}})[_0xfa0a('0x2d')](function(_0x33e545){if(_0x33e545){return _0x33e545?{'count':_0x420841,'rows':_0x33e545}:null;}})[_0xfa0a('0x2d')](respondWithResult(_0x2243a2,null))[_0xfa0a('0x4f')](handleError(_0x2243a2,null));};
\ No newline at end of file
+var _0x51c1=['attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','findOne','order','hasOwnProperty','getItems','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','end','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','autoAssociation','error','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','voice','web-report'];(function(_0x4006fa,_0xd0c7fb){var _0x2edacc=function(_0x42a8dc){while(--_0x42a8dc){_0x4006fa['push'](_0x4006fa['shift']());}};_0x2edacc(++_0xd0c7fb);}(_0x51c1,0x8b));var _0x151c=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0x51c1[_0x254abd];return _0x31bf1b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x151c('0x0'));var zipdir=require(_0x151c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x151c('0x2'));var moment=require(_0x151c('0x3'));var BPromise=require(_0x151c('0x4'));var Mustache=require('mustache');var util=require(_0x151c('0x5'));var path=require(_0x151c('0x6'));var sox=require(_0x151c('0x7'));var csv=require('to-csv');var ejs=require(_0x151c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x151c('0x9'));var squel=require(_0x151c('0xa'));var crypto=require(_0x151c('0xb'));var jsforce=require(_0x151c('0xc'));var deskjs=require(_0x151c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x151c('0xe'));var Papa=require(_0x151c('0xf'));var Redis=require(_0x151c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x151c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x151c('0x12'));var logger=require('../../config/logger')(_0x151c('0x13'));var utils=require(_0x151c('0x14'));var config=require(_0x151c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x151c('0x16'))['db'];config['redis']=_[_0x151c('0x17')](config[_0x151c('0x18')],{'host':_0x151c('0x19'),'port':0x18eb});var socket=require(_0x151c('0x1a'))(new Redis(config[_0x151c('0x18')]));require('./dashboard.socket')[_0x151c('0x1b')](socket);function respondWithStatusCode(_0x2a6109,_0x113cb0){_0x113cb0=_0x113cb0||0xcc;return function(_0x1dbdb2){if(_0x1dbdb2){return _0x2a6109[_0x151c('0x1c')](_0x113cb0);}return _0x2a6109[_0x151c('0x1d')](_0x113cb0)['end']();};}function respondWithResult(_0x3f470a,_0x1f29f8){_0x1f29f8=_0x1f29f8||0xc8;return function(_0x20932a){if(_0x20932a){return _0x3f470a['status'](_0x1f29f8)[_0x151c('0x1e')](_0x20932a);}};}function respondWithFilteredResult(_0x3bcc6a,_0x5c7105){return function(_0x165ffe){if(_0x165ffe){var _0x1367fc=typeof _0x5c7105[_0x151c('0x1f')]===_0x151c('0x20')&&typeof _0x5c7105['limit']===_0x151c('0x20');var _0x42021a=_0x165ffe[_0x151c('0x21')];var _0x438453=_0x1367fc?0x0:_0x5c7105[_0x151c('0x1f')];var _0x1577a0=_0x1367fc?_0x165ffe[_0x151c('0x21')]:_0x5c7105[_0x151c('0x1f')]+_0x5c7105[_0x151c('0x22')];var _0x2bd4e1;if(_0x1577a0>=_0x42021a){_0x1577a0=_0x42021a;_0x2bd4e1=0xc8;}else{_0x2bd4e1=0xce;}_0x3bcc6a[_0x151c('0x1d')](_0x2bd4e1);return _0x3bcc6a[_0x151c('0x23')](_0x151c('0x24'),_0x438453+'-'+_0x1577a0+'/'+_0x42021a)[_0x151c('0x1e')](_0x165ffe);}return null;};}function patchUpdates(_0x536eb1){return function(_0x549f41){try{jsonpatch[_0x151c('0x25')](_0x549f41,_0x536eb1,!![]);}catch(_0xa66265){return BPromise[_0x151c('0x26')](_0xa66265);}return _0x549f41['save']();};}function saveUpdates(_0x2a0fb9,_0x37aa1e){return function(_0x391d44){if(_0x391d44){return _0x391d44[_0x151c('0x27')](_0x2a0fb9)[_0x151c('0x28')](function(_0x5b57cd){return _0x5b57cd;});}return null;};}function removeEntity(_0xc35311,_0x344277){return function(_0x9983a3){if(_0x9983a3){return _0x9983a3[_0x151c('0x29')]()[_0x151c('0x28')](function(){var _0x553836=_0x9983a3[_0x151c('0x2a')]({'plain':!![]});var _0x1ef5ef=_0x151c('0x2b');return db[_0x151c('0x2c')][_0x151c('0x29')]({'where':{'type':_0x1ef5ef,'resourceId':_0x553836['id']}})[_0x151c('0x28')](function(){return _0x9983a3;});})[_0x151c('0x28')](function(){_0xc35311[_0x151c('0x1d')](0xcc)[_0x151c('0x2d')]();});}};}function handleEntityNotFound(_0x9eee1a,_0x23128e){return function(_0x390009){if(!_0x390009){_0x9eee1a['sendStatus'](0x194);}return _0x390009;};}function handleError(_0x48ae37,_0x208e7b){_0x208e7b=_0x208e7b||0x1f4;return function(_0x3f4c36){logger['error'](_0x3f4c36['stack']);if(_0x3f4c36['name']){delete _0x3f4c36[_0x151c('0x2e')];}_0x48ae37[_0x151c('0x1d')](_0x208e7b)[_0x151c('0x2f')](_0x3f4c36);};}exports[_0x151c('0x30')]=function(_0x1a4c2f,_0xee087b){var _0x1ba7a1={},_0x34be48={},_0x16d6f3={'count':0x0,'rows':[]};var _0x4dabb0=_['map'](db[_0x151c('0x31')][_0x151c('0x32')],function(_0x26f08b){return{'name':_0x26f08b[_0x151c('0x33')],'type':_0x26f08b[_0x151c('0x34')][_0x151c('0x35')]};});_0x34be48[_0x151c('0x36')]=_[_0x151c('0x37')](_0x4dabb0,'name');_0x34be48[_0x151c('0x38')]=_[_0x151c('0x39')](_0x1a4c2f[_0x151c('0x38')]);_0x34be48[_0x151c('0x3a')]=_[_0x151c('0x3b')](_0x34be48[_0x151c('0x36')],_0x34be48[_0x151c('0x38')]);_0x1ba7a1['attributes']=_['intersection'](_0x34be48[_0x151c('0x36')],qs[_0x151c('0x3c')](_0x1a4c2f[_0x151c('0x38')][_0x151c('0x3c')]));_0x1ba7a1[_0x151c('0x3d')]=_0x1ba7a1[_0x151c('0x3d')][_0x151c('0x3e')]?_0x1ba7a1[_0x151c('0x3d')]:_0x34be48[_0x151c('0x36')];if(!_0x1a4c2f[_0x151c('0x38')]['hasOwnProperty'](_0x151c('0x3f'))){_0x1ba7a1['limit']=qs[_0x151c('0x22')](_0x1a4c2f[_0x151c('0x38')][_0x151c('0x22')]);_0x1ba7a1['offset']=qs[_0x151c('0x1f')](_0x1a4c2f[_0x151c('0x38')][_0x151c('0x1f')]);}_0x1ba7a1['order']=qs[_0x151c('0x40')](_0x1a4c2f[_0x151c('0x38')][_0x151c('0x40')]);_0x1ba7a1[_0x151c('0x41')]=qs[_0x151c('0x3a')](_['pick'](_0x1a4c2f['query'],_0x34be48['filters']),_0x4dabb0);if(_0x1a4c2f[_0x151c('0x38')][_0x151c('0x42')]){_0x1ba7a1[_0x151c('0x41')]=_[_0x151c('0x43')](_0x1ba7a1[_0x151c('0x41')],{'$or':_[_0x151c('0x37')](_0x4dabb0,function(_0x8c5679){if(_0x8c5679['type']!==_0x151c('0x44')){var _0x2000d4={};_0x2000d4[_0x8c5679[_0x151c('0x2e')]]={'$like':'%'+_0x1a4c2f['query'][_0x151c('0x42')]+'%'};return _0x2000d4;}})});}_0x1ba7a1=_['merge']({},_0x1ba7a1,_0x1a4c2f[_0x151c('0x45')]);var _0x23362f={'where':_0x1ba7a1[_0x151c('0x41')]};return db[_0x151c('0x31')][_0x151c('0x21')](_0x23362f)['then'](function(_0x41717b){_0x16d6f3[_0x151c('0x21')]=_0x41717b;if(_0x1a4c2f[_0x151c('0x38')]['includeAll']){_0x1ba7a1[_0x151c('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x151c('0x47')](_0x1ba7a1);})['then'](function(_0x15fd4a){_0x16d6f3[_0x151c('0x48')]=_0x15fd4a;return _0x16d6f3;})[_0x151c('0x28')](respondWithFilteredResult(_0xee087b,_0x1ba7a1))[_0x151c('0x49')](handleError(_0xee087b,null));};exports['show']=function(_0x548e13,_0x34e02d){var _0x443af6={'raw':![],'where':{'id':_0x548e13[_0x151c('0x4a')]['id']}},_0x26ebf9={};_0x26ebf9[_0x151c('0x36')]=_['keys'](db['Dashboard'][_0x151c('0x32')]);_0x26ebf9['query']=_[_0x151c('0x39')](_0x548e13[_0x151c('0x38')]);_0x26ebf9['filters']=_[_0x151c('0x3b')](_0x26ebf9['model'],_0x26ebf9[_0x151c('0x38')]);_0x443af6['attributes']=_[_0x151c('0x3b')](_0x26ebf9[_0x151c('0x36')],qs[_0x151c('0x3c')](_0x548e13[_0x151c('0x38')][_0x151c('0x3c')]));_0x443af6[_0x151c('0x3d')]=_0x443af6[_0x151c('0x3d')][_0x151c('0x3e')]?_0x443af6[_0x151c('0x3d')]:_0x26ebf9[_0x151c('0x36')];if(_0x548e13[_0x151c('0x38')][_0x151c('0x4b')]){_0x443af6[_0x151c('0x46')]=[{'all':!![]}];}_0x443af6=_[_0x151c('0x43')]({},_0x443af6,_0x548e13[_0x151c('0x45')]);return db[_0x151c('0x31')]['find'](_0x443af6)[_0x151c('0x28')](handleEntityNotFound(_0x34e02d,null))[_0x151c('0x28')](respondWithResult(_0x34e02d,null))[_0x151c('0x49')](handleError(_0x34e02d,null));};exports['create']=function(_0x25a01a,_0x41f91a){return db[_0x151c('0x31')][_0x151c('0x4c')](_0x25a01a[_0x151c('0x4d')],{})[_0x151c('0x28')](function(_0x76bca4){var _0x26327d=_0x25a01a[_0x151c('0x4e')][_0x151c('0x2a')]({'plain':!![]});if(!_0x26327d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26327d[_0x151c('0x4f')]===_0x151c('0x4e')){var _0x14b8b8=_0x76bca4['get']({'plain':!![]});var _0x3eda0c=_0x151c('0x2b');return db['UserProfileSection'][_0x151c('0x50')]({'where':{'name':_0x3eda0c,'userProfileId':_0x26327d[_0x151c('0x51')]},'raw':!![]})[_0x151c('0x28')](function(_0x2edab6){if(_0x2edab6&&_0x2edab6['autoAssociation']===0x0){return db[_0x151c('0x2c')][_0x151c('0x4c')]({'name':_0x14b8b8[_0x151c('0x2e')],'resourceId':_0x14b8b8['id'],'type':_0x2edab6[_0x151c('0x2e')],'sectionId':_0x2edab6['id']},{})['then'](function(){return _0x76bca4;});}else{return _0x76bca4;}})[_0x151c('0x49')](function(_0x587b2f){logger['error'](_0x151c('0x52'),_0x587b2f);throw _0x587b2f;});}return _0x76bca4;})[_0x151c('0x28')](respondWithResult(_0x41f91a,0xc9))[_0x151c('0x49')](handleError(_0x41f91a,null));};exports[_0x151c('0x53')]=function(_0xf2be14,_0x55bb44){var _0xe2f014={'where':{'id':_0xf2be14['params']['id']}},_0x2dc6d5={};_0x2dc6d5[_0x151c('0x36')]=_[_0x151c('0x39')](db[_0x151c('0x31')]['rawAttributes']);_0xe2f014[_0x151c('0x3d')]=_[_0x151c('0x3b')](_0x2dc6d5[_0x151c('0x36')],qs[_0x151c('0x3c')](_0xf2be14['query'][_0x151c('0x3c')]));_0xe2f014[_0x151c('0x3d')]=_0xe2f014['attributes']['length']?_0xe2f014['attributes']:_0x2dc6d5[_0x151c('0x36')];if(_0xf2be14[_0x151c('0x38')]['includeAll']){_0xe2f014[_0x151c('0x46')]=[{'all':!![]}];}_0xe2f014=_[_0x151c('0x43')]({},_0xe2f014,_0xf2be14['options']);return db[_0x151c('0x31')][_0x151c('0x50')](_0xe2f014)[_0x151c('0x28')](handleEntityNotFound(_0x55bb44,null))[_0x151c('0x28')](function(_0x209816){if(_0x209816){var _0x11e20f=_0x209816[_0x151c('0x2a')]({'plain':!![]});_0x11e20f=qs['omit'](_0x11e20f,['id',_0x151c('0x54'),_0x151c('0x55')]);_0xf2be14[_0x151c('0x4d')]=_[_0x151c('0x56')](_0xf2be14[_0x151c('0x4d')],['id',_0x151c('0x54'),_0x151c('0x55')]);return db[_0x151c('0x31')][_0x151c('0x4c')](_['merge'](_0x11e20f,_0xf2be14[_0x151c('0x4d')]),{'include':_0xf2be14['query'][_0x151c('0x4b')]?[{'all':!![]}]:undefined})[_0x151c('0x28')](function(_0x48dcef){var _0x55876f=_0xf2be14[_0x151c('0x4e')][_0x151c('0x2a')]({'plain':!![]});if(!_0x55876f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55876f[_0x151c('0x4f')]===_0x151c('0x4e')){var _0x2b2efc=_0x48dcef[_0x151c('0x2a')]({'plain':!![]});var _0x4c605c=_0x151c('0x2b');return db[_0x151c('0x57')]['find']({'where':{'name':_0x4c605c,'userProfileId':_0x55876f['userProfileId']},'raw':!![]})[_0x151c('0x28')](function(_0x249038){if(_0x249038&&_0x249038[_0x151c('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x2b2efc[_0x151c('0x2e')],'resourceId':_0x2b2efc['id'],'type':_0x249038[_0x151c('0x2e')],'sectionId':_0x249038['id']},{})[_0x151c('0x28')](function(){return _0x48dcef;});}else{return _0x48dcef;}})[_0x151c('0x49')](function(_0x1fdb78){logger[_0x151c('0x59')](_0x151c('0x52'),_0x1fdb78);throw _0x1fdb78;});}return _0x48dcef;});}})['then'](respondWithResult(_0x55bb44,0xc9))['catch'](handleError(_0x55bb44,null));};exports['update']=function(_0x1bec8b,_0x25ea1a){if(_0x1bec8b[_0x151c('0x4d')]['id']){delete _0x1bec8b[_0x151c('0x4d')]['id'];}return db[_0x151c('0x31')][_0x151c('0x50')]({'where':{'id':_0x1bec8b[_0x151c('0x4a')]['id']}})[_0x151c('0x28')](handleEntityNotFound(_0x25ea1a,null))['then'](saveUpdates(_0x1bec8b[_0x151c('0x4d')],null))[_0x151c('0x28')](respondWithResult(_0x25ea1a,null))[_0x151c('0x49')](handleError(_0x25ea1a,null));};exports[_0x151c('0x29')]=function(_0x362bdf,_0xb48a9){return db[_0x151c('0x31')]['find']({'where':{'id':_0x362bdf[_0x151c('0x4a')]['id']}})[_0x151c('0x28')](handleEntityNotFound(_0xb48a9,null))[_0x151c('0x28')](removeEntity(_0xb48a9,null))[_0x151c('0x49')](handleError(_0xb48a9,null));};function widgetAttributes(_0xbd60e3){try{switch(_0xbd60e3[_0x151c('0x34')]){case _0x151c('0x5a'):return[{'name':_0x151c('0x5b'),'value':_0xbd60e3['attrUrl']||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x0]?_0xbd60e3[_0x151c('0x5c')][0x0][_0x151c('0x5d')]:undefined)||_0x151c('0x5e')}];case _0x151c('0x5f'):return[{'name':_0x151c('0x60'),'value':_0xbd60e3[_0x151c('0x60')]||(_0xbd60e3['attrs']&&_0xbd60e3['attrs'][0x0]?_0xbd60e3[_0x151c('0x5c')][0x0][_0x151c('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x151c('0x61'),'value':_0xbd60e3[_0x151c('0x61')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x0]?_0xbd60e3[_0x151c('0x5c')][0x0]['value']:undefined)||_0x151c('0x62')},{'name':_0x151c('0x63'),'value':_0xbd60e3[_0x151c('0x63')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x1]?_0xbd60e3[_0x151c('0x5c')][0x1]['value']:undefined)||_0x151c('0x64')},{'name':_0x151c('0x65'),'value':_0xbd60e3[_0x151c('0x65')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x2]?_0xbd60e3['attrs'][0x2][_0x151c('0x5d')]:undefined)||0xc}];case _0x151c('0x66'):return[{'name':'attrMetric','value':_0xbd60e3['attrMetric']||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x0]?_0xbd60e3[_0x151c('0x5c')][0x0][_0x151c('0x5d')]:undefined)||_0x151c('0x67')},{'name':_0x151c('0x68'),'value':_0xbd60e3[_0x151c('0x68')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x1]?_0xbd60e3[_0x151c('0x5c')][0x1][_0x151c('0x5d')]:undefined)||[]},{'name':_0x151c('0x65'),'value':_0xbd60e3[_0x151c('0x65')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x2]?_0xbd60e3['attrs'][0x2][_0x151c('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0xbd60e3[_0x151c('0x69')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x3]?_0xbd60e3[_0x151c('0x5c')][0x3][_0x151c('0x5d')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xbd60e3[_0x151c('0x6a')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x4]?_0xbd60e3[_0x151c('0x5c')][0x4][_0x151c('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xbd60e3[_0x151c('0x6b')]||(_0xbd60e3['attrs']&&_0xbd60e3[_0x151c('0x5c')][0x5]?_0xbd60e3[_0x151c('0x5c')][0x5][_0x151c('0x5d')]:undefined)||''},{'name':_0x151c('0x6c'),'value':_0xbd60e3[_0x151c('0x6c')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x6]?_0xbd60e3['attrs'][0x6][_0x151c('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xbd60e3[_0x151c('0x6d')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x7]?_0xbd60e3[_0x151c('0x5c')][0x7]['value']:undefined)||''},{'name':_0x151c('0x6e'),'value':_0xbd60e3[_0x151c('0x6e')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x8]?_0xbd60e3['attrs'][0x8][_0x151c('0x5d')]:undefined)||''},{'name':_0x151c('0x6f'),'value':_0xbd60e3[_0x151c('0x6f')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x9]?_0xbd60e3[_0x151c('0x5c')][0x9]['value']:undefined)||''}];case _0x151c('0x70'):case'pie-chart':return[{'name':_0x151c('0x71'),'value':_0xbd60e3[_0x151c('0x71')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x0]?_0xbd60e3[_0x151c('0x5c')][0x0][_0x151c('0x5d')]:undefined)||'total'},{'name':_0x151c('0x72'),'value':_0xbd60e3[_0x151c('0x72')]||(_0xbd60e3['attrs']&&_0xbd60e3[_0x151c('0x5c')][0x1]?_0xbd60e3[_0x151c('0x5c')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0xbd60e3['attrSerie3']||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x2]?_0xbd60e3[_0x151c('0x5c')][0x2][_0x151c('0x5d')]:undefined)||null},{'name':_0x151c('0x68'),'value':_0xbd60e3[_0x151c('0x68')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x3]?_0xbd60e3[_0x151c('0x5c')][0x3][_0x151c('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0xbd60e3[_0x151c('0x69')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x4]?_0xbd60e3[_0x151c('0x5c')][0x4][_0x151c('0x5d')]:undefined)||_0x151c('0x73')},{'name':_0x151c('0x6a'),'value':_0xbd60e3['attrEmailAccounts']||(_0xbd60e3['attrs']&&_0xbd60e3['attrs'][0x5]?_0xbd60e3[_0x151c('0x5c')][0x5]['value']:undefined)||''},{'name':_0x151c('0x6b'),'value':_0xbd60e3[_0x151c('0x6b')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x6]?_0xbd60e3[_0x151c('0x5c')][0x6]['value']:undefined)||''},{'name':_0x151c('0x6c'),'value':_0xbd60e3[_0x151c('0x6c')]||(_0xbd60e3['attrs']&&_0xbd60e3[_0x151c('0x5c')][0x7]?_0xbd60e3['attrs'][0x7][_0x151c('0x5d')]:undefined)||''},{'name':_0x151c('0x6d'),'value':_0xbd60e3['attrOpenchannelAccounts']||(_0xbd60e3['attrs']&&_0xbd60e3[_0x151c('0x5c')][0x8]?_0xbd60e3[_0x151c('0x5c')][0x8]['value']:undefined)||''},{'name':_0x151c('0x6e'),'value':_0xbd60e3[_0x151c('0x6e')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0x9]?_0xbd60e3[_0x151c('0x5c')][0x9]['value']:undefined)||''},{'name':_0x151c('0x6f'),'value':_0xbd60e3[_0x151c('0x6f')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3['attrs'][0xa]?_0xbd60e3[_0x151c('0x5c')][0xa][_0x151c('0x5d')]:undefined)||''}];case _0x151c('0x74'):return[{'name':_0x151c('0x75'),'type':_0xbd60e3[_0x151c('0x76')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x0]?_0xbd60e3['attrs'][0x0][_0x151c('0x34')]:undefined)||null,'value':_0xbd60e3[_0x151c('0x75')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x0]?_0xbd60e3['attrs'][0x0][_0x151c('0x5d')]:undefined)||null},{'name':_0x151c('0x77'),'value':_0xbd60e3[_0x151c('0x77')]||(_0xbd60e3[_0x151c('0x5c')]&&_0xbd60e3[_0x151c('0x5c')][0x1]?_0xbd60e3[_0x151c('0x5c')][0x1][_0x151c('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x4c54cb){logger[_0x151c('0x59')](_0x151c('0x78'),JSON[_0x151c('0x79')](_0x4c54cb));return[];}}exports[_0x151c('0x7a')]=function(_0x1429ba,_0x30ae28,_0x5c2b4){if(_0x1429ba[_0x151c('0x4d')]['id']){delete _0x1429ba[_0x151c('0x4d')]['id'];}return db['Dashboard'][_0x151c('0x50')]({'where':{'id':_0x1429ba[_0x151c('0x4a')]['id']}})[_0x151c('0x28')](handleEntityNotFound(_0x30ae28,null))[_0x151c('0x28')](function(_0x2149b1){if(_0x2149b1){_0x1429ba[_0x151c('0x4d')]['DashboardId']=_0x2149b1['id'];_0x1429ba[_0x151c('0x4d')][_0x151c('0x5c')]=widgetAttributes(_0x1429ba[_0x151c('0x4d')]);return db[_0x151c('0x7b')][_0x151c('0x4c')](_0x1429ba[_0x151c('0x4d')]);}})[_0x151c('0x28')](respondWithResult(_0x30ae28,null))[_0x151c('0x49')](handleError(_0x30ae28,null));};exports['getItems']=function(_0x395ede,_0x289cda,_0x474089){var _0x329cef={};var _0xebdeee={};var _0x25cee2;var _0x47a4f9;return db[_0x151c('0x31')][_0x151c('0x7c')]({'where':{'id':_0x395ede[_0x151c('0x4a')]['id']}})[_0x151c('0x28')](handleEntityNotFound(_0x289cda,null))[_0x151c('0x28')](function(_0x4f4f42){if(_0x4f4f42){_0x25cee2=_0x4f4f42;_0xebdeee['model']=_[_0x151c('0x39')](db[_0x151c('0x7b')][_0x151c('0x32')]);_0xebdeee[_0x151c('0x38')]=_[_0x151c('0x39')](_0x395ede['query']);_0xebdeee[_0x151c('0x3a')]=_[_0x151c('0x3b')](_0xebdeee[_0x151c('0x36')],_0xebdeee['query']);_0x329cef['attributes']=_[_0x151c('0x3b')](_0xebdeee[_0x151c('0x36')],qs[_0x151c('0x3c')](_0x395ede[_0x151c('0x38')]['fields']));_0x329cef[_0x151c('0x3d')]=_0x329cef[_0x151c('0x3d')]['length']?_0x329cef[_0x151c('0x3d')]:_0xebdeee[_0x151c('0x36')];_0x329cef[_0x151c('0x7d')]=qs[_0x151c('0x40')](_0x395ede['query']['sort']);_0x329cef['where']=qs[_0x151c('0x3a')](_['pick'](_0x395ede[_0x151c('0x38')],_0xebdeee['filters']));if(_0x395ede[_0x151c('0x38')][_0x151c('0x42')]){_0x329cef['where']=_[_0x151c('0x43')](_0x329cef['where'],{'$or':_[_0x151c('0x37')](_0x329cef[_0x151c('0x3d')],function(_0xb100e4){var _0x27b187={};_0x27b187[_0xb100e4]={'$like':'%'+_0x395ede[_0x151c('0x38')][_0x151c('0x42')]+'%'};return _0x27b187;})});}_0x329cef=_['merge']({},_0x329cef,_0x395ede['options']);return _0x25cee2['getItems'](_0x329cef);}})['then'](function(_0x22bb3e){if(_0x22bb3e){_0x47a4f9=_0x22bb3e[_0x151c('0x3e')];if(!_0x395ede[_0x151c('0x38')][_0x151c('0x7e')](_0x151c('0x3f'))){_0x329cef['limit']=qs['limit'](_0x395ede[_0x151c('0x38')][_0x151c('0x22')]);_0x329cef[_0x151c('0x1f')]=qs[_0x151c('0x1f')](_0x395ede[_0x151c('0x38')][_0x151c('0x1f')]);}return _0x25cee2[_0x151c('0x7f')](_0x329cef);}})[_0x151c('0x28')](function(_0x419951){if(_0x419951){return _0x419951?{'count':_0x47a4f9,'rows':_0x419951}:null;}})[_0x151c('0x28')](respondWithResult(_0x289cda,null))[_0x151c('0x49')](handleError(_0x289cda,null));};
\ No newline at end of file
index 73071a5..52f6225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e7c=['events','Dashboard','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xacd3d5,_0x531902){var _0x4589df=function(_0x7c6bfe){while(--_0x7c6bfe){_0xacd3d5['push'](_0xacd3d5['shift']());}};_0x4589df(++_0x531902);}(_0x1e7c,0x132));var _0xc1e7=function(_0x570435,_0x41f2ff){_0x570435=_0x570435-0x0;var _0x53ae9f=_0x1e7c[_0x570435];return _0x53ae9f;};'use strict';var EventEmitter=require(_0xc1e7('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xc1e7('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1e7('0x2'),'afterUpdate':_0xc1e7('0x3'),'afterDestroy':_0xc1e7('0x4')};function emitEvent(_0x41c7d5){return function(_0x49f0fb,_0x92eaa,_0x5362d9){DashboardEvents[_0xc1e7('0x5')](_0x41c7d5+':'+_0x49f0fb['id'],_0x49f0fb);DashboardEvents[_0xc1e7('0x5')](_0x41c7d5,_0x49f0fb);_0x5362d9(null);};}for(var e in events){if(events[_0xc1e7('0x6')](e)){var event=events[e];Dashboard[_0xc1e7('0x7')](e,emitEvent(event));}}module[_0xc1e7('0x8')]=DashboardEvents;
\ No newline at end of file
+var _0xf5e6=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e6,0x132));var _0x6f5e=function(_0x203ffd,_0x1d1d50){_0x203ffd=_0x203ffd-0x0;var _0x41df29=_0xf5e6[_0x203ffd];return _0x41df29;};'use strict';var EventEmitter=require(_0x6f5e('0x0'));var Dashboard=require(_0x6f5e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6f5e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f5e('0x3'),'afterDestroy':_0x6f5e('0x4')};function emitEvent(_0x2fbe80){return function(_0x37ecb7,_0x343b80,_0x17edd7){DashboardEvents[_0x6f5e('0x5')](_0x2fbe80+':'+_0x37ecb7['id'],_0x37ecb7);DashboardEvents[_0x6f5e('0x5')](_0x2fbe80,_0x37ecb7);_0x17edd7(null);};}for(var e in events){if(events[_0x6f5e('0x6')](e)){var event=events[e];Dashboard[_0x6f5e('0x7')](e,emitEvent(event));}}module[_0x6f5e('0x8')]=DashboardEvents;
\ No newline at end of file
index bf16cbe..e464797 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d7f=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x1d7f,0x6a));var _0xf1d7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1d7f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf1d7('0x0'));var util=require(_0xf1d7('0x1'));var logger=require('../../config/logger')(_0xf1d7('0x2'));var moment=require(_0xf1d7('0x3'));var BPromise=require(_0xf1d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1d7('0x5'));var rimraf=require(_0xf1d7('0x6'));var config=require(_0xf1d7('0x7'));var attributes=require(_0xf1d7('0x8'));module[_0xf1d7('0x9')]=function(_0x1905a1,_0x2ef314){return _0x1905a1[_0xf1d7('0xa')]('Dashboard',attributes,{'tableName':_0xf1d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc88f=['request-promise','rimraf','../../config/environment','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3d784f,_0x100ef1){var _0x32340e=function(_0xfd0c00){while(--_0xfd0c00){_0x3d784f['push'](_0x3d784f['shift']());}};_0x32340e(++_0x100ef1);}(_0xc88f,0xed));var _0xfc88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc88f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc88('0x0'));var util=require('util');var logger=require(_0xfc88('0x1'))(_0xfc88('0x2'));var moment=require(_0xfc88('0x3'));var BPromise=require(_0xfc88('0x4'));var rp=require(_0xfc88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc88('0x6'));var config=require(_0xfc88('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x11512f,_0xd94ffe){return _0x11512f[_0xfc88('0x8')](_0xfc88('0x9'),attributes,{'tableName':_0xfc88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f104c48..6d4d3e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf904=['Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info'];(function(_0x39a8f7,_0x21f5ca){var _0x564a1b=function(_0x1dd107){while(--_0x1dd107){_0x39a8f7['push'](_0x39a8f7['shift']());}};_0x564a1b(++_0x21f5ca);}(_0xf904,0xea));var _0x4f90=function(_0x305701,_0xc02f37){_0x305701=_0x305701-0x0;var _0x3591ce=_0xf904[_0x305701];return _0x3591ce;};'use strict';var _=require(_0x4f90('0x0'));var util=require('util');var moment=require(_0x4f90('0x1'));var BPromise=require(_0x4f90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f90('0x3'));var db=require(_0x4f90('0x4'))['db'];var utils=require(_0x4f90('0x5'));var logger=require('../../config/logger')(_0x4f90('0x6'));var config=require(_0x4f90('0x7'));var jayson=require(_0x4f90('0x8'));var client=jayson[_0x4f90('0x9')][_0x4f90('0xa')]({'port':0x232a});config[_0x4f90('0xb')]=_['defaults'](config[_0x4f90('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f90('0xb')]));require('./dashboard.socket')[_0x4f90('0xc')](socket);function respondWithRpcPromise(_0x2b2ec3,_0x36a47a,_0x431fca){return new BPromise(function(_0x1b70a3,_0x4950f2){return client[_0x4f90('0xd')](_0x2b2ec3,_0x431fca)[_0x4f90('0xe')](function(_0x5d8aad){logger[_0x4f90('0xf')](_0x4f90('0x10'),_0x36a47a,'request\x20sent');logger['debug'](_0x4f90('0x11'),_0x36a47a,_0x4f90('0x12'),JSON[_0x4f90('0x13')](_0x5d8aad));if(_0x5d8aad[_0x4f90('0x14')]){if(_0x5d8aad[_0x4f90('0x14')][_0x4f90('0x15')]===0x1f4){logger[_0x4f90('0x14')](_0x4f90('0x10'),_0x36a47a,_0x5d8aad['error']['message']);return _0x4950f2(_0x5d8aad[_0x4f90('0x14')][_0x4f90('0x16')]);}logger[_0x4f90('0x14')](_0x4f90('0x10'),_0x36a47a,_0x5d8aad[_0x4f90('0x14')][_0x4f90('0x16')]);return _0x1b70a3(_0x5d8aad['error']['message']);}else{logger[_0x4f90('0xf')](_0x4f90('0x10'),_0x36a47a,'request\x20sent');_0x1b70a3(_0x5d8aad[_0x4f90('0x17')]['message']);}})[_0x4f90('0x18')](function(_0x3d5f2a){logger[_0x4f90('0x14')]('Dashboard,\x20%s,\x20%s',_0x36a47a,_0x3d5f2a);_0x4950f2(_0x3d5f2a);});});}
\ No newline at end of file
+var _0xe186=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis','./dashboard.socket','register','request','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','Dashboard,\x20%s,\x20%s','message','catch','lodash'];(function(_0x358ce5,_0x1b2c7d){var _0x542051=function(_0x3cfe76){while(--_0x3cfe76){_0x358ce5['push'](_0x358ce5['shift']());}};_0x542051(++_0x1b2c7d);}(_0xe186,0x1df));var _0x6e18=function(_0x4285cc,_0xe8eda0){_0x4285cc=_0x4285cc-0x0;var _0x575f64=_0xe186[_0x4285cc];return _0x575f64;};'use strict';var _=require(_0x6e18('0x0'));var util=require(_0x6e18('0x1'));var moment=require('moment');var BPromise=require(_0x6e18('0x2'));var rs=require(_0x6e18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e18('0x4'))['db'];var utils=require(_0x6e18('0x5'));var logger=require('../../config/logger')(_0x6e18('0x6'));var config=require(_0x6e18('0x7'));var jayson=require(_0x6e18('0x8'));var client=jayson[_0x6e18('0x9')]['http']({'port':0x232a});config['redis']=_[_0x6e18('0xa')](config['redis'],{'host':_0x6e18('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e18('0xc')]));require(_0x6e18('0xd'))[_0x6e18('0xe')](socket);function respondWithRpcPromise(_0x6fa600,_0x40fc92,_0x3dac70){return new BPromise(function(_0x49edb1,_0x4555fb){return client[_0x6e18('0xf')](_0x6fa600,_0x3dac70)['then'](function(_0x3390d3){logger[_0x6e18('0x10')]('Dashboard,\x20%s,\x20%s',_0x40fc92,_0x6e18('0x11'));logger[_0x6e18('0x12')](_0x6e18('0x13'),_0x40fc92,_0x6e18('0x11'),JSON['stringify'](_0x3390d3));if(_0x3390d3[_0x6e18('0x14')]){if(_0x3390d3['error']['code']===0x1f4){logger[_0x6e18('0x14')](_0x6e18('0x15'),_0x40fc92,_0x3390d3[_0x6e18('0x14')]['message']);return _0x4555fb(_0x3390d3[_0x6e18('0x14')][_0x6e18('0x16')]);}logger['error'](_0x6e18('0x15'),_0x40fc92,_0x3390d3[_0x6e18('0x14')][_0x6e18('0x16')]);return _0x49edb1(_0x3390d3['error'][_0x6e18('0x16')]);}else{logger['info'](_0x6e18('0x15'),_0x40fc92,_0x6e18('0x11'));_0x49edb1(_0x3390d3['result'][_0x6e18('0x16')]);}})[_0x6e18('0x17')](function(_0x7de1ed){logger[_0x6e18('0x14')](_0x6e18('0x15'),_0x40fc92,_0x7de1ed);_0x4555fb(_0x7de1ed);});});}
\ No newline at end of file
index 119fb54..3ed61d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd78=['register','length','./dashboard.events','save','removeListener'];(function(_0x1b36aa,_0x233708){var _0x17c8b3=function(_0x16cdf9){while(--_0x16cdf9){_0x1b36aa['push'](_0x1b36aa['shift']());}};_0x17c8b3(++_0x233708);}(_0xbd78,0xb1));var _0x8bd7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbd78[_0x1facfa];return _0x9ec701;};'use strict';var DashboardEvents=require(_0x8bd7('0x0'));var events=[_0x8bd7('0x1'),'remove','update'];function createListener(_0x1dfa26,_0x5643e9){return function(_0x6d0fd8){_0x5643e9['emit'](_0x1dfa26,_0x6d0fd8);};}function removeListener(_0x332c7f,_0x29a75b){return function(){DashboardEvents[_0x8bd7('0x2')](_0x332c7f,_0x29a75b);};}exports[_0x8bd7('0x3')]=function(_0x4a9041){for(var _0x11d7ca=0x0,_0x2bf788=events[_0x8bd7('0x4')];_0x11d7ca<_0x2bf788;_0x11d7ca++){var _0x524f0a=events[_0x11d7ca];var _0x3828cb=createListener('dashboard:'+_0x524f0a,_0x4a9041);DashboardEvents['on'](_0x524f0a,_0x3828cb);}};
\ No newline at end of file
+var _0xff37=['remove','update','emit','removeListener','length','dashboard:','./dashboard.events','save'];(function(_0x5cfc5f,_0x1f5b9c){var _0x20e121=function(_0x1b94a3){while(--_0x1b94a3){_0x5cfc5f['push'](_0x5cfc5f['shift']());}};_0x20e121(++_0x1f5b9c);}(_0xff37,0x18e));var _0x7ff3=function(_0x4f9818,_0x54325d){_0x4f9818=_0x4f9818-0x0;var _0x5e90b7=_0xff37[_0x4f9818];return _0x5e90b7;};'use strict';var DashboardEvents=require(_0x7ff3('0x0'));var events=[_0x7ff3('0x1'),_0x7ff3('0x2'),_0x7ff3('0x3')];function createListener(_0x7ed30b,_0x2f234a){return function(_0x1f2048){_0x2f234a[_0x7ff3('0x4')](_0x7ed30b,_0x1f2048);};}function removeListener(_0x286957,_0x272a06){return function(){DashboardEvents[_0x7ff3('0x5')](_0x286957,_0x272a06);};}exports['register']=function(_0x4662d5){for(var _0x71b643=0x0,_0xdc01a0=events[_0x7ff3('0x6')];_0x71b643<_0xdc01a0;_0x71b643++){var _0x24ae16=events[_0x71b643];var _0x4b1330=createListener(_0x7ff3('0x7')+_0x24ae16,_0x4662d5);DashboardEvents['on'](_0x24ae16,_0x4b1330);}};
\ No newline at end of file
index 28179b0..c075e7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6917=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','getItems','post','/:id/clone','clone','/:id/items','put','delete'];(function(_0x2ce7a2,_0x11b784){var _0x2281e7=function(_0x4f1e54){while(--_0x4f1e54){_0x2ce7a2['push'](_0x2ce7a2['shift']());}};_0x2281e7(++_0x11b784);}(_0x6917,0x1a6));var _0x7691=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x6917[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x7691('0x0'));var util=require(_0x7691('0x1'));var path=require(_0x7691('0x2'));var timeout=require(_0x7691('0x3'));var express=require('express');var router=express[_0x7691('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7691('0x5'));var interaction=require(_0x7691('0x6'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x7691('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7691('0x8'),auth[_0x7691('0x9')](),controller[_0x7691('0xa')]);router[_0x7691('0x7')]('/:id/items',auth[_0x7691('0x9')](),controller[_0x7691('0xb')]);router[_0x7691('0xc')]('/',auth[_0x7691('0x9')](),controller['create']);router[_0x7691('0xc')](_0x7691('0xd'),auth[_0x7691('0x9')](),controller[_0x7691('0xe')]);router[_0x7691('0xc')](_0x7691('0xf'),auth[_0x7691('0x9')](),controller['addItem']);router[_0x7691('0x10')]('/:id',auth[_0x7691('0x9')](),controller['update']);router[_0x7691('0x11')](_0x7691('0x8'),auth['isAuthenticated'](),controller[_0x7691('0x12')]);module[_0x7691('0x13')]=router;
\ No newline at end of file
+var _0x57b5=['index','/:id','/:id/items','getItems','post','create','addItem','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x5ce2a6,_0x1b2f1e){var _0x5b970d=function(_0x13abd3){while(--_0x13abd3){_0x5ce2a6['push'](_0x5ce2a6['shift']());}};_0x5b970d(++_0x1b2f1e);}(_0x57b5,0xf0));var _0x557b=function(_0x2494f5,_0x1f1d3c){_0x2494f5=_0x2494f5-0x0;var _0x5c60a4=_0x57b5[_0x2494f5];return _0x5c60a4;};'use strict';var multer=require(_0x557b('0x0'));var util=require(_0x557b('0x1'));var path=require(_0x557b('0x2'));var timeout=require(_0x557b('0x3'));var express=require(_0x557b('0x4'));var router=express[_0x557b('0x5')]();var fs_extra=require(_0x557b('0x6'));var auth=require(_0x557b('0x7'));var interaction=require(_0x557b('0x8'));var config=require(_0x557b('0x9'));var controller=require(_0x557b('0xa'));router[_0x557b('0xb')]('/',auth[_0x557b('0xc')](),controller[_0x557b('0xd')]);router[_0x557b('0xb')](_0x557b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x557b('0xb')](_0x557b('0xf'),auth[_0x557b('0xc')](),controller[_0x557b('0x10')]);router[_0x557b('0x11')]('/',auth[_0x557b('0xc')](),controller[_0x557b('0x12')]);router[_0x557b('0x11')]('/:id/clone',auth[_0x557b('0xc')](),controller['clone']);router['post'](_0x557b('0xf'),auth['isAuthenticated'](),controller[_0x557b('0x13')]);router[_0x557b('0x14')](_0x557b('0xe'),auth[_0x557b('0xc')](),controller['update']);router[_0x557b('0x15')](_0x557b('0xe'),auth[_0x557b('0xc')](),controller[_0x557b('0x16')]);module['exports']=router;
\ No newline at end of file
index acaba83..75d45f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x37cfeb,_0x27e7de){var _0x646620=function(_0x179ff9){while(--_0x179ff9){_0x37cfeb['push'](_0x37cfeb['shift']());}};_0x646620(++_0x27e7de);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x33ef7c,_0x4e26a2){var _0x5eb7ea=function(_0x55fcc1){while(--_0x55fcc1){_0x33ef7c['push'](_0x33ef7c['shift']());}};_0x5eb7ea(++_0x4e26a2);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x417906,_0x389ed7){_0x417906=_0x417906-0x0;var _0x413489=_0xc1c6[_0x417906];return _0x413489;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index 439031d..29a8a86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['redis','defaults','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','include','merge','find','catch','params','type','attrs','value','https://','attrPath','clock','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x27fded,_0x33ce1a){var _0x26056c=function(_0x2b9b70){while(--_0x2b9b70){_0x27fded['push'](_0x27fded['shift']());}};_0x26056c(++_0x33ce1a);}(_0xabce,0x103));var _0xeabc=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xabce[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];config[_0xeabc('0x1a')]=_[_0xeabc('0x1b')](config[_0xeabc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xeabc('0x1c'))(new Redis(config[_0xeabc('0x1a')]));require(_0xeabc('0x1d'))['register'](socket);function respondWithStatusCode(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1e')](_0x3170ea);}return _0x5f4ee8['status'](_0x3170ea)[_0xeabc('0x1f')]();};}function respondWithResult(_0x638976,_0x49f2d8){_0x49f2d8=_0x49f2d8||0xc8;return function(_0x53fe28){if(_0x53fe28){return _0x638976[_0xeabc('0x20')](_0x49f2d8)['json'](_0x53fe28);}};}function respondWithFilteredResult(_0x3d0e21,_0x1b64b9){return function(_0x58a3c0){if(_0x58a3c0){var _0x16f08b=typeof _0x1b64b9[_0xeabc('0x21')]===_0xeabc('0x22')&&typeof _0x1b64b9[_0xeabc('0x23')]===_0xeabc('0x22');var _0x5d92e5=_0x58a3c0[_0xeabc('0x24')];var _0x4d68ea=_0x16f08b?0x0:_0x1b64b9[_0xeabc('0x21')];var _0x16530c=_0x16f08b?_0x58a3c0['count']:_0x1b64b9[_0xeabc('0x21')]+_0x1b64b9[_0xeabc('0x23')];var _0x254590;if(_0x16530c>=_0x5d92e5){_0x16530c=_0x5d92e5;_0x254590=0xc8;}else{_0x254590=0xce;}_0x3d0e21[_0xeabc('0x20')](_0x254590);return _0x3d0e21[_0xeabc('0x25')]('Content-Range',_0x4d68ea+'-'+_0x16530c+'/'+_0x5d92e5)[_0xeabc('0x26')](_0x58a3c0);}return null;};}function patchUpdates(_0x10c675){return function(_0x91ab00){try{jsonpatch['apply'](_0x91ab00,_0x10c675,!![]);}catch(_0x457f27){return BPromise[_0xeabc('0x27')](_0x457f27);}return _0x91ab00[_0xeabc('0x28')]();};}function saveUpdates(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['update'](_0x319119)[_0xeabc('0x29')](function(_0x4d4e29){return _0x4d4e29;});}return null;};}function removeEntity(_0x811f0d,_0x12acbd){return function(_0x269621){if(_0x269621){return _0x269621[_0xeabc('0x2a')]()[_0xeabc('0x29')](function(){_0x811f0d[_0xeabc('0x20')](0xcc)[_0xeabc('0x1f')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2b')](_0x48fb52[_0xeabc('0x2c')]);if(_0x48fb52[_0xeabc('0x2d')]){delete _0x48fb52[_0xeabc('0x2d')];}_0x3c1b5b[_0xeabc('0x20')](_0x2b342c)[_0xeabc('0x2e')](_0x48fb52);};}exports[_0xeabc('0x2f')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={'raw':![],'where':{'id':_0x38dc0a['params']['id']}},_0x5b34dd={};_0x5b34dd[_0xeabc('0x30')]=_[_0xeabc('0x31')](db[_0xeabc('0x32')][_0xeabc('0x33')]);_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x31')](_0x38dc0a[_0xeabc('0x34')]);_0x5b34dd['filters']=_[_0xeabc('0x35')](_0x5b34dd[_0xeabc('0x30')],_0x5b34dd[_0xeabc('0x34')]);_0x5ebb86['attributes']=_[_0xeabc('0x35')](_0x5b34dd[_0xeabc('0x30')],qs[_0xeabc('0x36')](_0x38dc0a['query'][_0xeabc('0x36')]));_0x5ebb86[_0xeabc('0x37')]=_0x5ebb86[_0xeabc('0x37')]['length']?_0x5ebb86[_0xeabc('0x37')]:_0x5b34dd[_0xeabc('0x30')];if(_0x38dc0a['query']['includeAll']){_0x5ebb86[_0xeabc('0x38')]=[{'all':!![]}];}_0x5ebb86=_[_0xeabc('0x39')]({},_0x5ebb86,_0x38dc0a['options']);return db[_0xeabc('0x32')][_0xeabc('0x3a')](_0x5ebb86)[_0xeabc('0x29')](handleEntityNotFound(_0x2915c1,null))[_0xeabc('0x29')](respondWithResult(_0x2915c1,null))[_0xeabc('0x3b')](handleError(_0x2915c1,null));};exports['destroy']=function(_0x353e48,_0x5b61fa){return db[_0xeabc('0x32')][_0xeabc('0x3a')]({'where':{'id':_0x353e48[_0xeabc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5b61fa,null))['then'](removeEntity(_0x5b61fa,null))[_0xeabc('0x3b')](handleError(_0x5b61fa,null));};function widgetAttributes(_0x560d4a){try{switch(_0x560d4a[_0xeabc('0x3d')]){case'iframe':return[{'name':'attrUrl','value':_0x560d4a['attrUrl']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a['attrs'][0x0][_0xeabc('0x3f')]:undefined)||_0xeabc('0x40')}];case'custom':return[{'name':_0xeabc('0x41'),'value':_0x560d4a['attrPath']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||''}];case _0xeabc('0x42'):return[{'name':'attrHourFormat','value':_0x560d4a['attrHourFormat']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x560d4a[_0xeabc('0x43')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x1]?_0x560d4a[_0xeabc('0x3e')][0x1]['value']:undefined)||_0xeabc('0x44')},{'name':'attrFontSize','value':_0x560d4a['attrFontSize']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||0xc}];case _0xeabc('0x45'):return[{'name':'attrMetric','value':_0x560d4a[_0xeabc('0x46')]||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||_0xeabc('0x47')},{'name':_0xeabc('0x48'),'value':_0x560d4a['attrVoiceQueues']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a['attrs'][0x1][_0xeabc('0x3f')]:undefined)||[]},{'name':_0xeabc('0x49'),'value':_0x560d4a['attrFontSize']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||0x14},{'name':_0xeabc('0x4a'),'value':_0x560d4a[_0xeabc('0x4a')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x3]?_0x560d4a[_0xeabc('0x3e')][0x3][_0xeabc('0x3f')]:undefined)||_0xeabc('0x4b')},{'name':_0xeabc('0x4c'),'value':_0x560d4a[_0xeabc('0x4c')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x4]?_0x560d4a[_0xeabc('0x3e')][0x4][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4d'),'value':_0x560d4a['attrFaxAccounts']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x5]?_0x560d4a[_0xeabc('0x3e')][0x5][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4e'),'value':_0x560d4a[_0xeabc('0x4e')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x6]?_0x560d4a[_0xeabc('0x3e')][0x6][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4f'),'value':_0x560d4a[_0xeabc('0x4f')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x7]?_0x560d4a[_0xeabc('0x3e')][0x7][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x50'),'value':_0x560d4a[_0xeabc('0x50')]||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x8]?_0x560d4a[_0xeabc('0x3e')][0x8]['value']:undefined)||''},{'name':_0xeabc('0x51'),'value':_0x560d4a['attrChatWebsites']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x9]?_0x560d4a[_0xeabc('0x3e')][0x9][_0xeabc('0x3f')]:undefined)||''}];case _0xeabc('0x52'):case _0xeabc('0x53'):return[{'name':_0xeabc('0x54'),'value':_0x560d4a[_0xeabc('0x54')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||'total'},{'name':_0xeabc('0x55'),'value':_0x560d4a[_0xeabc('0x55')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a['attrs'][0x1][_0xeabc('0x3f')]:undefined)||null},{'name':_0xeabc('0x56'),'value':_0x560d4a[_0xeabc('0x56')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||null},{'name':_0xeabc('0x48'),'value':_0x560d4a[_0xeabc('0x48')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x3]?_0x560d4a[_0xeabc('0x3e')][0x3][_0xeabc('0x3f')]:undefined)||[]},{'name':_0xeabc('0x4a'),'value':_0x560d4a['attrChannel']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x4]?_0x560d4a['attrs'][0x4]['value']:undefined)||_0xeabc('0x4b')},{'name':_0xeabc('0x4c'),'value':_0x560d4a[_0xeabc('0x4c')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x5]?_0x560d4a[_0xeabc('0x3e')][0x5]['value']:undefined)||''},{'name':_0xeabc('0x4d'),'value':_0x560d4a[_0xeabc('0x4d')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x6]?_0x560d4a[_0xeabc('0x3e')][0x6][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4e'),'value':_0x560d4a[_0xeabc('0x4e')]||(_0x560d4a['attrs']&&_0x560d4a['attrs'][0x7]?_0x560d4a[_0xeabc('0x3e')][0x7][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4f'),'value':_0x560d4a['attrOpenchannelAccounts']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x8]?_0x560d4a['attrs'][0x8][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x50'),'value':_0x560d4a[_0xeabc('0x50')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x9]?_0x560d4a[_0xeabc('0x3e')][0x9]['value']:undefined)||''},{'name':_0xeabc('0x51'),'value':_0x560d4a[_0xeabc('0x51')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0xa]?_0x560d4a[_0xeabc('0x3e')][0xa][_0xeabc('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0xeabc('0x57'),'type':_0x560d4a[_0xeabc('0x58')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3d')]:undefined)||null,'value':_0x560d4a[_0xeabc('0x57')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a['attrs'][0x0][_0xeabc('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x560d4a[_0xeabc('0x59')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a[_0xeabc('0x3e')][0x1][_0xeabc('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x1a3ef2){logger[_0xeabc('0x2b')](_0xeabc('0x5a'),JSON[_0xeabc('0x5b')](_0x1a3ef2));return[];}}exports[_0xeabc('0x5c')]=function(_0x5702cb,_0x3fa31b){if(_0x5702cb[_0xeabc('0x5d')]){_0x5702cb[_0xeabc('0x5d')][_0xeabc('0x3e')]=widgetAttributes(_0x5702cb['body']);}return db[_0xeabc('0x32')]['create'](_0x5702cb['body'],{})[_0xeabc('0x29')](respondWithResult(_0x3fa31b,0xc9))[_0xeabc('0x3b')](handleError(_0x3fa31b,null));};exports[_0xeabc('0x5e')]=function(_0x1c91e4,_0x4b7730){if(_0x1c91e4['body']['id']){delete _0x1c91e4[_0xeabc('0x5d')]['id'];}_0x1c91e4['body']['attrs']=widgetAttributes(_0x1c91e4[_0xeabc('0x5d')]);return db['DashboardItem']['find']({'where':{'id':_0x1c91e4[_0xeabc('0x3c')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4b7730,null))['then'](saveUpdates(_0x1c91e4['body'],null))[_0xeabc('0x29')](respondWithResult(_0x4b7730,null))['catch'](handleError(_0x4b7730,null));};
\ No newline at end of file
+var _0xafca=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','merge','options','find','params','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x2c5958,_0x1eecb4){var _0x2c1530=function(_0x12deb3){while(--_0x12deb3){_0x2c5958['push'](_0x2c5958['shift']());}};_0x2c1530(++_0x1eecb4);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xaafc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaafc('0x1'));var jsonpatch=require(_0xaafc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaafc('0x3'));var Mustache=require(_0xaafc('0x4'));var util=require(_0xaafc('0x5'));var path=require(_0xaafc('0x6'));var sox=require(_0xaafc('0x7'));var csv=require('to-csv');var ejs=require(_0xaafc('0x8'));var fs=require('fs');var fs_extra=require(_0xaafc('0x9'));var _=require(_0xaafc('0xa'));var squel=require(_0xaafc('0xb'));var crypto=require(_0xaafc('0xc'));var jsforce=require(_0xaafc('0xd'));var deskjs=require(_0xaafc('0xe'));var toCsv=require(_0xaafc('0xf'));var querystring=require(_0xaafc('0x10'));var Papa=require(_0xaafc('0x11'));var Redis=require(_0xaafc('0x12'));var authService=require(_0xaafc('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaafc('0x14'));var logger=require('../../config/logger')(_0xaafc('0x15'));var utils=require('../../config/utils');var config=require(_0xaafc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaafc('0x17'))['db'];config[_0xaafc('0x18')]=_[_0xaafc('0x19')](config[_0xaafc('0x18')],{'host':_0xaafc('0x1a'),'port':0x18eb});var socket=require(_0xaafc('0x1b'))(new Redis(config[_0xaafc('0x18')]));require(_0xaafc('0x1c'))[_0xaafc('0x1d')](socket);function respondWithStatusCode(_0x3313ae,_0x2505ea){_0x2505ea=_0x2505ea||0xcc;return function(_0x54d69b){if(_0x54d69b){return _0x3313ae[_0xaafc('0x1e')](_0x2505ea);}return _0x3313ae[_0xaafc('0x1f')](_0x2505ea)[_0xaafc('0x20')]();};}function respondWithResult(_0x42ef58,_0x404ddf){_0x404ddf=_0x404ddf||0xc8;return function(_0x1248ac){if(_0x1248ac){return _0x42ef58[_0xaafc('0x1f')](_0x404ddf)[_0xaafc('0x21')](_0x1248ac);}};}function respondWithFilteredResult(_0x34b7e0,_0x2af27e){return function(_0x48c266){if(_0x48c266){var _0x1b0d6d=typeof _0x2af27e['offset']===_0xaafc('0x22')&&typeof _0x2af27e[_0xaafc('0x23')]===_0xaafc('0x22');var _0x30b49c=_0x48c266[_0xaafc('0x24')];var _0x3ba411=_0x1b0d6d?0x0:_0x2af27e[_0xaafc('0x25')];var _0x331763=_0x1b0d6d?_0x48c266[_0xaafc('0x24')]:_0x2af27e['offset']+_0x2af27e[_0xaafc('0x23')];var _0x990ed9;if(_0x331763>=_0x30b49c){_0x331763=_0x30b49c;_0x990ed9=0xc8;}else{_0x990ed9=0xce;}_0x34b7e0['status'](_0x990ed9);return _0x34b7e0[_0xaafc('0x26')](_0xaafc('0x27'),_0x3ba411+'-'+_0x331763+'/'+_0x30b49c)[_0xaafc('0x21')](_0x48c266);}return null;};}function patchUpdates(_0x521f26){return function(_0x4421a7){try{jsonpatch[_0xaafc('0x28')](_0x4421a7,_0x521f26,!![]);}catch(_0x1d2091){return BPromise['reject'](_0x1d2091);}return _0x4421a7[_0xaafc('0x29')]();};}function saveUpdates(_0xd3b1a2,_0x48e541){return function(_0x3c598c){if(_0x3c598c){return _0x3c598c[_0xaafc('0x2a')](_0xd3b1a2)[_0xaafc('0x2b')](function(_0x4103fc){return _0x4103fc;});}return null;};}function removeEntity(_0x1f5522,_0x386bac){return function(_0x5c047c){if(_0x5c047c){return _0x5c047c[_0xaafc('0x2c')]()[_0xaafc('0x2b')](function(){_0x1f5522[_0xaafc('0x1f')](0xcc)[_0xaafc('0x20')]();});}};}function handleEntityNotFound(_0x59a97f,_0x43e3f1){return function(_0x239037){if(!_0x239037){_0x59a97f[_0xaafc('0x1e')](0x194);}return _0x239037;};}function handleError(_0xf9e586,_0x143dda){_0x143dda=_0x143dda||0x1f4;return function(_0x44e207){logger[_0xaafc('0x2d')](_0x44e207[_0xaafc('0x2e')]);if(_0x44e207[_0xaafc('0x2f')]){delete _0x44e207[_0xaafc('0x2f')];}_0xf9e586[_0xaafc('0x1f')](_0x143dda)[_0xaafc('0x30')](_0x44e207);};}exports[_0xaafc('0x31')]=function(_0x3eacd2,_0x32c110){var _0x6d3ed4={'raw':![],'where':{'id':_0x3eacd2['params']['id']}},_0x35a29f={};_0x35a29f['model']=_['keys'](db[_0xaafc('0x32')][_0xaafc('0x33')]);_0x35a29f[_0xaafc('0x34')]=_['keys'](_0x3eacd2[_0xaafc('0x34')]);_0x35a29f[_0xaafc('0x35')]=_[_0xaafc('0x36')](_0x35a29f[_0xaafc('0x37')],_0x35a29f[_0xaafc('0x34')]);_0x6d3ed4['attributes']=_['intersection'](_0x35a29f['model'],qs[_0xaafc('0x38')](_0x3eacd2[_0xaafc('0x34')][_0xaafc('0x38')]));_0x6d3ed4[_0xaafc('0x39')]=_0x6d3ed4[_0xaafc('0x39')]['length']?_0x6d3ed4[_0xaafc('0x39')]:_0x35a29f[_0xaafc('0x37')];if(_0x3eacd2[_0xaafc('0x34')][_0xaafc('0x3a')]){_0x6d3ed4[_0xaafc('0x3b')]=[{'all':!![]}];}_0x6d3ed4=_[_0xaafc('0x3c')]({},_0x6d3ed4,_0x3eacd2[_0xaafc('0x3d')]);return db['DashboardItem']['find'](_0x6d3ed4)[_0xaafc('0x2b')](handleEntityNotFound(_0x32c110,null))[_0xaafc('0x2b')](respondWithResult(_0x32c110,null))['catch'](handleError(_0x32c110,null));};exports[_0xaafc('0x2c')]=function(_0x118a97,_0x35f761){return db[_0xaafc('0x32')][_0xaafc('0x3e')]({'where':{'id':_0x118a97[_0xaafc('0x3f')]['id']}})[_0xaafc('0x2b')](handleEntityNotFound(_0x35f761,null))[_0xaafc('0x2b')](removeEntity(_0x35f761,null))[_0xaafc('0x40')](handleError(_0x35f761,null));};function widgetAttributes(_0x3b8c95){try{switch(_0x3b8c95[_0xaafc('0x41')]){case _0xaafc('0x42'):return[{'name':_0xaafc('0x43'),'value':_0x3b8c95[_0xaafc('0x43')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95['attrs'][0x0][_0xaafc('0x45')]:undefined)||_0xaafc('0x46')}];case _0xaafc('0x47'):return[{'name':_0xaafc('0x48'),'value':_0x3b8c95[_0xaafc('0x48')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95['attrs'][0x0][_0xaafc('0x45')]:undefined)||''}];case _0xaafc('0x49'):return[{'name':_0xaafc('0x4a'),'value':_0x3b8c95[_0xaafc('0x4a')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95['attrs'][0x0][_0xaafc('0x45')]:undefined)||_0xaafc('0x4b')},{'name':'attrTimezone','value':_0x3b8c95['attrTimezone']||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x1]?_0x3b8c95[_0xaafc('0x44')][0x1][_0xaafc('0x45')]:undefined)||_0xaafc('0x4c')},{'name':_0xaafc('0x4d'),'value':_0x3b8c95['attrFontSize']||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x2]?_0x3b8c95['attrs'][0x2][_0xaafc('0x45')]:undefined)||0xc}];case _0xaafc('0x4e'):return[{'name':'attrMetric','value':_0x3b8c95[_0xaafc('0x4f')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95['attrs'][0x0]?_0x3b8c95[_0xaafc('0x44')][0x0]['value']:undefined)||_0xaafc('0x50')},{'name':_0xaafc('0x51'),'value':_0x3b8c95[_0xaafc('0x51')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x1]?_0x3b8c95[_0xaafc('0x44')][0x1][_0xaafc('0x45')]:undefined)||[]},{'name':'attrFontSize','value':_0x3b8c95[_0xaafc('0x4d')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x2]?_0x3b8c95['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xaafc('0x52'),'value':_0x3b8c95[_0xaafc('0x52')]||(_0x3b8c95['attrs']&&_0x3b8c95['attrs'][0x3]?_0x3b8c95[_0xaafc('0x44')][0x3][_0xaafc('0x45')]:undefined)||_0xaafc('0x53')},{'name':_0xaafc('0x54'),'value':_0x3b8c95[_0xaafc('0x54')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x4]?_0x3b8c95[_0xaafc('0x44')][0x4][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x55'),'value':_0x3b8c95[_0xaafc('0x55')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95['attrs'][0x5]?_0x3b8c95[_0xaafc('0x44')][0x5][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x56'),'value':_0x3b8c95[_0xaafc('0x56')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x6]?_0x3b8c95['attrs'][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3b8c95[_0xaafc('0x57')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x7]?_0x3b8c95['attrs'][0x7][_0xaafc('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3b8c95[_0xaafc('0x58')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x8]?_0x3b8c95['attrs'][0x8][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x59'),'value':_0x3b8c95[_0xaafc('0x59')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95['attrs'][0x9]?_0x3b8c95[_0xaafc('0x44')][0x9][_0xaafc('0x45')]:undefined)||''}];case _0xaafc('0x5a'):case _0xaafc('0x5b'):return[{'name':'attrSerie1','value':_0x3b8c95[_0xaafc('0x5c')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95[_0xaafc('0x44')][0x0][_0xaafc('0x45')]:undefined)||_0xaafc('0x50')},{'name':'attrSerie2','value':_0x3b8c95['attrSerie2']||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x1]?_0x3b8c95[_0xaafc('0x44')][0x1]['value']:undefined)||null},{'name':_0xaafc('0x5d'),'value':_0x3b8c95[_0xaafc('0x5d')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95['attrs'][0x2]?_0x3b8c95[_0xaafc('0x44')][0x2][_0xaafc('0x45')]:undefined)||null},{'name':_0xaafc('0x51'),'value':_0x3b8c95[_0xaafc('0x51')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x3]?_0x3b8c95['attrs'][0x3][_0xaafc('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x3b8c95[_0xaafc('0x52')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x4]?_0x3b8c95[_0xaafc('0x44')][0x4][_0xaafc('0x45')]:undefined)||_0xaafc('0x53')},{'name':_0xaafc('0x54'),'value':_0x3b8c95['attrEmailAccounts']||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x5]?_0x3b8c95[_0xaafc('0x44')][0x5]['value']:undefined)||''},{'name':_0xaafc('0x55'),'value':_0x3b8c95[_0xaafc('0x55')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x6]?_0x3b8c95['attrs'][0x6][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x56'),'value':_0x3b8c95[_0xaafc('0x56')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x7]?_0x3b8c95[_0xaafc('0x44')][0x7][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x57'),'value':_0x3b8c95['attrOpenchannelAccounts']||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x8]?_0x3b8c95[_0xaafc('0x44')][0x8][_0xaafc('0x45')]:undefined)||''},{'name':_0xaafc('0x58'),'value':_0x3b8c95[_0xaafc('0x58')]||(_0x3b8c95['attrs']&&_0x3b8c95['attrs'][0x9]?_0x3b8c95[_0xaafc('0x44')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3b8c95[_0xaafc('0x59')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0xa]?_0x3b8c95[_0xaafc('0x44')][0xa][_0xaafc('0x45')]:undefined)||''}];case'web-report':return[{'name':_0xaafc('0x5e'),'type':_0x3b8c95[_0xaafc('0x5f')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95['attrs'][0x0][_0xaafc('0x41')]:undefined)||null,'value':_0x3b8c95[_0xaafc('0x5e')]||(_0x3b8c95['attrs']&&_0x3b8c95[_0xaafc('0x44')][0x0]?_0x3b8c95[_0xaafc('0x44')][0x0][_0xaafc('0x45')]:undefined)||null},{'name':_0xaafc('0x60'),'value':_0x3b8c95[_0xaafc('0x60')]||(_0x3b8c95[_0xaafc('0x44')]&&_0x3b8c95['attrs'][0x1]?_0x3b8c95[_0xaafc('0x44')][0x1][_0xaafc('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x44b98a){logger['error'](_0xaafc('0x61'),JSON[_0xaafc('0x62')](_0x44b98a));return[];}}exports[_0xaafc('0x63')]=function(_0x57e219,_0x59733f){if(_0x57e219[_0xaafc('0x64')]){_0x57e219[_0xaafc('0x64')][_0xaafc('0x44')]=widgetAttributes(_0x57e219[_0xaafc('0x64')]);}return db[_0xaafc('0x32')][_0xaafc('0x63')](_0x57e219[_0xaafc('0x64')],{})['then'](respondWithResult(_0x59733f,0xc9))[_0xaafc('0x40')](handleError(_0x59733f,null));};exports[_0xaafc('0x2a')]=function(_0x289383,_0x1f019b){if(_0x289383[_0xaafc('0x64')]['id']){delete _0x289383[_0xaafc('0x64')]['id'];}_0x289383[_0xaafc('0x64')]['attrs']=widgetAttributes(_0x289383[_0xaafc('0x64')]);return db[_0xaafc('0x32')]['find']({'where':{'id':_0x289383[_0xaafc('0x3f')]['id']}})[_0xaafc('0x2b')](handleEntityNotFound(_0x1f019b,null))[_0xaafc('0x2b')](saveUpdates(_0x289383[_0xaafc('0x64')],null))[_0xaafc('0x2b')](respondWithResult(_0x1f019b,null))['catch'](handleError(_0x1f019b,null));};
\ No newline at end of file
index edbc975..094bef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ad=['DashboardItem','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x46ad,0x73));var _0xd46a=function(_0x2c1913,_0x301cfd){_0x2c1913=_0x2c1913-0x0;var _0x40b00b=_0x46ad[_0x2c1913];return _0x40b00b;};'use strict';var EventEmitter=require(_0xd46a('0x0'));var DashboardItem=require(_0xd46a('0x1'))['db'][_0xd46a('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd46a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd46a('0x4'),'afterDestroy':_0xd46a('0x5')};function emitEvent(_0x1a7268){return function(_0x454699,_0x310d09,_0x34914e){DashboardItemEvents[_0xd46a('0x6')](_0x1a7268+':'+_0x454699['id'],_0x454699);DashboardItemEvents[_0xd46a('0x6')](_0x1a7268,_0x454699);_0x34914e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xd46a('0x7')](e,emitEvent(event));}}module[_0xd46a('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0xfef9=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x133bbc,_0x3fe600){var _0x38f6ad=function(_0x39db03){while(--_0x39db03){_0x133bbc['push'](_0x133bbc['shift']());}};_0x38f6ad(++_0x3fe600);}(_0xfef9,0xd3));var _0x9fef=function(_0x447725,_0x49753b){_0x447725=_0x447725-0x0;var _0x399167=_0xfef9[_0x447725];return _0x399167;};'use strict';var EventEmitter=require(_0x9fef('0x0'));var DashboardItem=require(_0x9fef('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9fef('0x2')](0x0);var events={'afterCreate':_0x9fef('0x3'),'afterUpdate':'update','afterDestroy':_0x9fef('0x4')};function emitEvent(_0x59a4de){return function(_0x3af68f,_0x525f4a,_0xe0da14){DashboardItemEvents[_0x9fef('0x5')](_0x59a4de+':'+_0x3af68f['id'],_0x3af68f);DashboardItemEvents['emit'](_0x59a4de,_0x3af68f);_0xe0da14(null);};}for(var e in events){if(events[_0x9fef('0x6')](e)){var event=events[e];DashboardItem[_0x9fef('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 11fde42..4eec15d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffcc=['DashboardItem','util','api','moment','rimraf','./dashboardItem.attributes','define'];(function(_0x386078,_0x49ad4f){var _0xd6675c=function(_0x1573c9){while(--_0x1573c9){_0x386078['push'](_0x386078['shift']());}};_0xd6675c(++_0x49ad4f);}(_0xffcc,0x112));var _0xcffc=function(_0x42e3b9,_0x2c721d){_0x42e3b9=_0x42e3b9-0x0;var _0x5e8c2f=_0xffcc[_0x42e3b9];return _0x5e8c2f;};'use strict';var _=require('lodash');var util=require(_0xcffc('0x0'));var logger=require('../../config/logger')(_0xcffc('0x1'));var moment=require(_0xcffc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcffc('0x3'));var config=require('../../config/environment');var attributes=require(_0xcffc('0x4'));module['exports']=function(_0x3e3133,_0x4563a2){return _0x3e3133[_0xcffc('0x5')](_0xcffc('0x6'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bc7=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b4402,_0xc778b1){var _0x2fa1c6=function(_0x53b71a){while(--_0x53b71a){_0x3b4402['push'](_0x3b4402['shift']());}};_0x2fa1c6(++_0xc778b1);}(_0x9bc7,0xda));var _0x79bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9bc7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x79bc('0x0'));var util=require(_0x79bc('0x1'));var logger=require(_0x79bc('0x2'))(_0x79bc('0x3'));var moment=require(_0x79bc('0x4'));var BPromise=require(_0x79bc('0x5'));var rp=require(_0x79bc('0x6'));var fs=require('fs');var path=require(_0x79bc('0x7'));var rimraf=require(_0x79bc('0x8'));var config=require(_0x79bc('0x9'));var attributes=require(_0x79bc('0xa'));module[_0x79bc('0xb')]=function(_0x45a333,_0x3795da){return _0x45a333[_0x79bc('0xc')](_0x79bc('0xd'),attributes,{'tableName':_0x79bc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3e0ec7..0da3197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958d=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x3b3a51,_0x37cbaf){var _0x4a93ea=function(_0x212675){while(--_0x212675){_0x3b3a51['push'](_0x3b3a51['shift']());}};_0x4a93ea(++_0x37cbaf);}(_0x958d,0xff));var _0xd958=function(_0xdbcbab,_0x3c7935){_0xdbcbab=_0xdbcbab-0x0;var _0x484144=_0x958d[_0xdbcbab];return _0x484144;};'use strict';var _=require(_0xd958('0x0'));var util=require(_0xd958('0x1'));var moment=require('moment');var BPromise=require(_0xd958('0x2'));var rs=require(_0xd958('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd958('0x4'))['db'];var utils=require(_0xd958('0x5'));var logger=require('../../config/logger')(_0xd958('0x6'));var config=require(_0xd958('0x7'));var jayson=require(_0xd958('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd958('0x9')]=_[_0xd958('0xa')](config[_0xd958('0x9')],{'host':_0xd958('0xb'),'port':0x18eb});var socket=require(_0xd958('0xc'))(new Redis(config[_0xd958('0x9')]));require(_0xd958('0xd'))[_0xd958('0xe')](socket);function respondWithRpcPromise(_0x7e5a07,_0x120572,_0x397e1b){return new BPromise(function(_0x2f1a2c,_0x1e05ab){return client[_0xd958('0xf')](_0x7e5a07,_0x397e1b)[_0xd958('0x10')](function(_0x1c5d23){logger[_0xd958('0x11')](_0xd958('0x12'),_0x120572,_0xd958('0x13'));logger[_0xd958('0x14')](_0xd958('0x15'),_0x120572,_0xd958('0x13'),JSON[_0xd958('0x16')](_0x1c5d23));if(_0x1c5d23[_0xd958('0x17')]){if(_0x1c5d23[_0xd958('0x17')][_0xd958('0x18')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x120572,_0x1c5d23[_0xd958('0x17')]['message']);return _0x1e05ab(_0x1c5d23['error'][_0xd958('0x19')]);}logger[_0xd958('0x17')]('DashboardItem,\x20%s,\x20%s',_0x120572,_0x1c5d23[_0xd958('0x17')]['message']);return _0x2f1a2c(_0x1c5d23['error'][_0xd958('0x19')]);}else{logger[_0xd958('0x11')]('DashboardItem,\x20%s,\x20%s',_0x120572,_0xd958('0x13'));_0x2f1a2c(_0x1c5d23['result'][_0xd958('0x19')]);}})[_0xd958('0x1a')](function(_0x42b60c){logger[_0xd958('0x17')](_0xd958('0x12'),_0x120572,_0x42b60c);_0x1e05ab(_0x42b60c);});});}
\ No newline at end of file
+var _0xb058=['http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4619eb,_0x32f200){var _0x598544=function(_0x26962a){while(--_0x26962a){_0x4619eb['push'](_0x4619eb['shift']());}};_0x598544(++_0x32f200);}(_0xb058,0x116));var _0x8b05=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb058[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x8b05('0x0'));var util=require(_0x8b05('0x1'));var moment=require(_0x8b05('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b05('0x3'));var fs=require('fs');var Redis=require(_0x8b05('0x4'));var db=require(_0x8b05('0x5'))['db'];var utils=require(_0x8b05('0x6'));var logger=require(_0x8b05('0x7'))(_0x8b05('0x8'));var config=require(_0x8b05('0x9'));var jayson=require(_0x8b05('0xa'));var client=jayson[_0x8b05('0xb')][_0x8b05('0xc')]({'port':0x232a});config[_0x8b05('0xd')]=_[_0x8b05('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8b05('0xf'))(new Redis(config[_0x8b05('0xd')]));require(_0x8b05('0x10'))[_0x8b05('0x11')](socket);function respondWithRpcPromise(_0x4a7810,_0x31c94a,_0x2a3ea9){return new BPromise(function(_0x13a039,_0x37866d){return client[_0x8b05('0x12')](_0x4a7810,_0x2a3ea9)['then'](function(_0x475e43){logger[_0x8b05('0x13')](_0x8b05('0x14'),_0x31c94a,_0x8b05('0x15'));logger[_0x8b05('0x16')](_0x8b05('0x17'),_0x31c94a,_0x8b05('0x15'),JSON[_0x8b05('0x18')](_0x475e43));if(_0x475e43[_0x8b05('0x19')]){if(_0x475e43[_0x8b05('0x19')][_0x8b05('0x1a')]===0x1f4){logger[_0x8b05('0x19')](_0x8b05('0x14'),_0x31c94a,_0x475e43['error']['message']);return _0x37866d(_0x475e43['error']['message']);}logger[_0x8b05('0x19')]('DashboardItem,\x20%s,\x20%s',_0x31c94a,_0x475e43[_0x8b05('0x19')][_0x8b05('0x1b')]);return _0x13a039(_0x475e43['error']['message']);}else{logger[_0x8b05('0x13')](_0x8b05('0x14'),_0x31c94a,_0x8b05('0x15'));_0x13a039(_0x475e43['result'][_0x8b05('0x1b')]);}})[_0x8b05('0x1c')](function(_0x2d54fa){logger[_0x8b05('0x19')]('DashboardItem,\x20%s,\x20%s',_0x31c94a,_0x2d54fa);_0x37866d(_0x2d54fa);});});}
\ No newline at end of file
index 1e25ada..df7bcfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aee=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x1a72ed,_0x365a7a){var _0x20671a=function(_0x160090){while(--_0x160090){_0x1a72ed['push'](_0x1a72ed['shift']());}};_0x20671a(++_0x365a7a);}(_0x3aee,0x89));var _0xe3ae=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x3aee[_0x491cbe];return _0x59449d;};'use strict';var DashboardItemEvents=require(_0xe3ae('0x0'));var events=[_0xe3ae('0x1'),_0xe3ae('0x2'),_0xe3ae('0x3')];function createListener(_0x5d0b13,_0x1f6699){return function(_0x96d577){_0x1f6699[_0xe3ae('0x4')](_0x5d0b13,_0x96d577);};}function removeListener(_0x1507d9,_0x3d80ea){return function(){DashboardItemEvents[_0xe3ae('0x5')](_0x1507d9,_0x3d80ea);};}exports[_0xe3ae('0x6')]=function(_0x13dac0){for(var _0x428818=0x0,_0x105af3=events[_0xe3ae('0x7')];_0x428818<_0x105af3;_0x428818++){var _0x29cb03=events[_0x428818];var _0x534751=createListener(_0xe3ae('0x8')+_0x29cb03,_0x13dac0);DashboardItemEvents['on'](_0x29cb03,_0x534751);}};
\ No newline at end of file
+var _0x6e35=['save','remove','update','length','./dashboardItem.events'];(function(_0x32f21d,_0x5b955f){var _0x3cde36=function(_0x5448a7){while(--_0x5448a7){_0x32f21d['push'](_0x32f21d['shift']());}};_0x3cde36(++_0x5b955f);}(_0x6e35,0xd6));var _0x56e3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x6e35[_0x68c979];return _0x4f0001;};'use strict';var DashboardItemEvents=require(_0x56e3('0x0'));var events=[_0x56e3('0x1'),_0x56e3('0x2'),_0x56e3('0x3')];function createListener(_0x5d0d0d,_0x13c0d5){return function(_0x120348){_0x13c0d5['emit'](_0x5d0d0d,_0x120348);};}function removeListener(_0x257bba,_0x361683){return function(){DashboardItemEvents['removeListener'](_0x257bba,_0x361683);};}exports['register']=function(_0x313744){for(var _0x34d86a=0x0,_0x5aa478=events[_0x56e3('0x4')];_0x34d86a<_0x5aa478;_0x34d86a++){var _0x4a2207=events[_0x34d86a];var _0x368ec6=createListener('dashboardItem:'+_0x4a2207,_0x313744);DashboardItemEvents['on'](_0x4a2207,_0x368ec6);}};
\ No newline at end of file
index 97d7c05..0607181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5299=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x24ae01,_0x357736){var _0x3b7e5d=function(_0x572a40){while(--_0x572a40){_0x24ae01['push'](_0x24ae01['shift']());}};_0x3b7e5d(++_0x357736);}(_0x5299,0xb5));var _0x9529=function(_0x283e4b,_0x179bea){_0x283e4b=_0x283e4b-0x0;var _0x4b9b30=_0x5299[_0x283e4b];return _0x4b9b30;};'use strict';var multer=require(_0x9529('0x0'));var util=require('util');var path=require(_0x9529('0x1'));var timeout=require('connect-timeout');var express=require(_0x9529('0x2'));var router=express[_0x9529('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9529('0x4'));var interaction=require(_0x9529('0x5'));var config=require(_0x9529('0x6'));var controller=require(_0x9529('0x7'));router[_0x9529('0x8')](_0x9529('0x9'),auth[_0x9529('0xa')](),controller[_0x9529('0xb')]);router[_0x9529('0xc')]('/',auth[_0x9529('0xa')](),controller[_0x9529('0xd')]);router['put'](_0x9529('0x9'),auth[_0x9529('0xa')](),controller[_0x9529('0xe')]);router[_0x9529('0xf')](_0x9529('0x9'),auth[_0x9529('0xa')](),controller[_0x9529('0x10')]);module[_0x9529('0x11')]=router;
\ No newline at end of file
+var _0xe389=['express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1a87db,_0x2c282c){var _0x15a8ad=function(_0x23e933){while(--_0x23e933){_0x1a87db['push'](_0x1a87db['shift']());}};_0x15a8ad(++_0x2c282c);}(_0xe389,0x12d));var _0x9e38=function(_0x2b769e,_0x484cfe){_0x2b769e=_0x2b769e-0x0;var _0x45b392=_0xe389[_0x2b769e];return _0x45b392;};'use strict';var multer=require(_0x9e38('0x0'));var util=require(_0x9e38('0x1'));var path=require('path');var timeout=require(_0x9e38('0x2'));var express=require(_0x9e38('0x3'));var router=express[_0x9e38('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e38('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e38('0x6'));var controller=require(_0x9e38('0x7'));router[_0x9e38('0x8')]('/:id',auth[_0x9e38('0x9')](),controller[_0x9e38('0xa')]);router[_0x9e38('0xb')]('/',auth['isAuthenticated'](),controller[_0x9e38('0xc')]);router[_0x9e38('0xd')](_0x9e38('0xe'),auth[_0x9e38('0x9')](),controller[_0x9e38('0xf')]);router[_0x9e38('0x10')]('/:id',auth[_0x9e38('0x9')](),controller[_0x9e38('0x11')]);module[_0x9e38('0x12')]=router;
\ No newline at end of file
index 6d7ef0c..5e977b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd92a=['STRING','ENUM','first'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xd92a,0x120));var _0xad92=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd92a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xad92('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xad92('0x1')](_0xad92('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xad92('0x2')},'description':{'type':Sequelize[_0xad92('0x0')]}};
\ No newline at end of file
+var _0x5401=['ENUM','first','third','sequelize','exports'];(function(_0x4d1988,_0x914c84){var _0x541930=function(_0x169394){while(--_0x169394){_0x4d1988['push'](_0x4d1988['shift']());}};_0x541930(++_0x914c84);}(_0x5401,0xe9));var _0x1540=function(_0x40aaca,_0x4803f4){_0x40aaca=_0x40aaca-0x0;var _0x1252f7=_0x5401[_0x40aaca];return _0x1252f7;};'use strict';var Sequelize=require(_0x1540('0x0'));module[_0x1540('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x1540('0x2')](_0x1540('0x3'),'second',_0x1540('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 70ca004..e3dfc16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd064=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','name','send','index','map','Disposition','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','keys','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd064,0xe8));var _0x4d06=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xd064[_0x9dfc10];return _0x4f938a;};'use strict';var emlformat=require(_0x4d06('0x0'));var rimraf=require(_0x4d06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d06('0x2'));var rp=require(_0x4d06('0x3'));var moment=require('moment');var BPromise=require(_0x4d06('0x4'));var Mustache=require(_0x4d06('0x5'));var util=require(_0x4d06('0x6'));var path=require(_0x4d06('0x7'));var sox=require(_0x4d06('0x8'));var csv=require(_0x4d06('0x9'));var ejs=require(_0x4d06('0xa'));var fs=require('fs');var fs_extra=require(_0x4d06('0xb'));var _=require(_0x4d06('0xc'));var squel=require('squel');var crypto=require(_0x4d06('0xd'));var jsforce=require(_0x4d06('0xe'));var deskjs=require(_0x4d06('0xf'));var toCsv=require(_0x4d06('0x9'));var querystring=require(_0x4d06('0x10'));var Papa=require(_0x4d06('0x11'));var Redis=require(_0x4d06('0x12'));var authService=require(_0x4d06('0x13'));var qs=require(_0x4d06('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d06('0x15'));var logger=require(_0x4d06('0x16'))(_0x4d06('0x17'));var utils=require(_0x4d06('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4d06('0x19'));var db=require(_0x4d06('0x1a'))['db'];function respondWithStatusCode(_0x1aa0de,_0x216dbd){_0x216dbd=_0x216dbd||0xcc;return function(_0x9b5c1d){if(_0x9b5c1d){return _0x1aa0de[_0x4d06('0x1b')](_0x216dbd);}return _0x1aa0de[_0x4d06('0x1c')](_0x216dbd)[_0x4d06('0x1d')]();};}function respondWithResult(_0xd2908d,_0x1cc0db){_0x1cc0db=_0x1cc0db||0xc8;return function(_0x43e277){if(_0x43e277){return _0xd2908d['status'](_0x1cc0db)[_0x4d06('0x1e')](_0x43e277);}};}function respondWithFilteredResult(_0x3dbfbd,_0x5f3834){return function(_0x2ce86f){if(_0x2ce86f){var _0x4c462a=typeof _0x5f3834[_0x4d06('0x1f')]===_0x4d06('0x20')&&typeof _0x5f3834['limit']===_0x4d06('0x20');var _0x4a9860=_0x2ce86f[_0x4d06('0x21')];var _0x366c5b=_0x4c462a?0x0:_0x5f3834[_0x4d06('0x1f')];var _0xdd37d1=_0x4c462a?_0x2ce86f[_0x4d06('0x21')]:_0x5f3834[_0x4d06('0x1f')]+_0x5f3834['limit'];var _0x335e9b;if(_0xdd37d1>=_0x4a9860){_0xdd37d1=_0x4a9860;_0x335e9b=0xc8;}else{_0x335e9b=0xce;}_0x3dbfbd['status'](_0x335e9b);return _0x3dbfbd[_0x4d06('0x22')](_0x4d06('0x23'),_0x366c5b+'-'+_0xdd37d1+'/'+_0x4a9860)[_0x4d06('0x1e')](_0x2ce86f);}return null;};}function patchUpdates(_0x33dee9){return function(_0x3125fa){try{jsonpatch[_0x4d06('0x24')](_0x3125fa,_0x33dee9,!![]);}catch(_0x38a79b){return BPromise[_0x4d06('0x25')](_0x38a79b);}return _0x3125fa[_0x4d06('0x26')]();};}function saveUpdates(_0x40d142,_0x5b5ec4){return function(_0x1cbd8a){if(_0x1cbd8a){return _0x1cbd8a[_0x4d06('0x27')](_0x40d142)[_0x4d06('0x28')](function(_0x43619f){return _0x43619f;});}return null;};}function removeEntity(_0x4c5688,_0x4f7148){return function(_0x1b1f15){if(_0x1b1f15){return _0x1b1f15[_0x4d06('0x29')]()[_0x4d06('0x28')](function(){var _0x353839=_0x1b1f15[_0x4d06('0x2a')]({'plain':!![]});var _0x4d269e=_0x4d06('0x2b');return db[_0x4d06('0x2c')][_0x4d06('0x29')]({'where':{'type':_0x4d269e,'resourceId':_0x353839['id']}})[_0x4d06('0x28')](function(){return _0x1b1f15;});})['then'](function(){_0x4c5688[_0x4d06('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c11df,_0x560d5a){return function(_0x1049cb){if(!_0x1049cb){_0x3c11df[_0x4d06('0x1b')](0x194);}return _0x1049cb;};}function handleError(_0x399e87,_0x5c7dca){_0x5c7dca=_0x5c7dca||0x1f4;return function(_0x3d892f){logger['error'](_0x3d892f['stack']);if(_0x3d892f[_0x4d06('0x2d')]){delete _0x3d892f['name'];}_0x399e87['status'](_0x5c7dca)[_0x4d06('0x2e')](_0x3d892f);};}exports[_0x4d06('0x2f')]=function(_0x6c0b3e,_0x4e36bf){var _0x507803={},_0x5c754={},_0x5c06ee={'count':0x0,'rows':[]};var _0x3c8216=_[_0x4d06('0x30')](db[_0x4d06('0x31')]['rawAttributes'],function(_0x27354c){return{'name':_0x27354c[_0x4d06('0x32')],'type':_0x27354c[_0x4d06('0x33')][_0x4d06('0x34')]};});_0x5c754[_0x4d06('0x35')]=_['map'](_0x3c8216,_0x4d06('0x2d'));_0x5c754[_0x4d06('0x36')]=_['keys'](_0x6c0b3e[_0x4d06('0x36')]);_0x5c754[_0x4d06('0x37')]=_[_0x4d06('0x38')](_0x5c754[_0x4d06('0x35')],_0x5c754[_0x4d06('0x36')]);_0x507803['attributes']=_[_0x4d06('0x38')](_0x5c754['model'],qs[_0x4d06('0x39')](_0x6c0b3e['query'][_0x4d06('0x39')]));_0x507803['attributes']=_0x507803[_0x4d06('0x3a')][_0x4d06('0x3b')]?_0x507803[_0x4d06('0x3a')]:_0x5c754['model'];if(!_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x3c')](_0x4d06('0x3d'))){_0x507803['limit']=qs[_0x4d06('0x3e')](_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x3e')]);_0x507803[_0x4d06('0x1f')]=qs[_0x4d06('0x1f')](_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x1f')]);}_0x507803[_0x4d06('0x3f')]=qs['sort'](_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x40')]);_0x507803['where']=qs[_0x4d06('0x37')](_[_0x4d06('0x41')](_0x6c0b3e[_0x4d06('0x36')],_0x5c754['filters']),_0x3c8216);if(_0x6c0b3e[_0x4d06('0x36')]['filter']){_0x507803[_0x4d06('0x42')]=_[_0x4d06('0x43')](_0x507803[_0x4d06('0x42')],{'$or':_[_0x4d06('0x30')](_0x3c8216,function(_0x443e45){if(_0x443e45[_0x4d06('0x33')]!==_0x4d06('0x44')){var _0x52cec3={};_0x52cec3[_0x443e45['name']]={'$like':'%'+_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x45')]+'%'};return _0x52cec3;}})});}_0x507803=_['merge']({},_0x507803,_0x6c0b3e[_0x4d06('0x46')]);var _0x3aa0eb={'where':_0x507803[_0x4d06('0x42')]};return db[_0x4d06('0x31')][_0x4d06('0x21')](_0x3aa0eb)[_0x4d06('0x28')](function(_0x1bb5bf){_0x5c06ee[_0x4d06('0x21')]=_0x1bb5bf;if(_0x6c0b3e[_0x4d06('0x36')][_0x4d06('0x47')]){_0x507803['include']=[{'all':!![]}];}return db[_0x4d06('0x31')]['findAll'](_0x507803);})[_0x4d06('0x28')](function(_0x5c6247){_0x5c06ee[_0x4d06('0x48')]=_0x5c6247;return _0x5c06ee;})[_0x4d06('0x28')](respondWithFilteredResult(_0x4e36bf,_0x507803))[_0x4d06('0x49')](handleError(_0x4e36bf,null));};exports[_0x4d06('0x4a')]=function(_0x40b9be,_0x3fa26d){var _0x26ca7f={'raw':!![],'where':{'id':_0x40b9be['params']['id']}},_0x1acf49={};_0x1acf49[_0x4d06('0x35')]=_['keys'](db[_0x4d06('0x31')]['rawAttributes']);_0x1acf49[_0x4d06('0x36')]=_[_0x4d06('0x4b')](_0x40b9be[_0x4d06('0x36')]);_0x1acf49['filters']=_[_0x4d06('0x38')](_0x1acf49[_0x4d06('0x35')],_0x1acf49[_0x4d06('0x36')]);_0x26ca7f[_0x4d06('0x3a')]=_[_0x4d06('0x38')](_0x1acf49[_0x4d06('0x35')],qs[_0x4d06('0x39')](_0x40b9be[_0x4d06('0x36')]['fields']));_0x26ca7f[_0x4d06('0x3a')]=_0x26ca7f[_0x4d06('0x3a')][_0x4d06('0x3b')]?_0x26ca7f['attributes']:_0x1acf49['model'];if(_0x40b9be[_0x4d06('0x36')][_0x4d06('0x47')]){_0x26ca7f['include']=[{'all':!![]}];}_0x26ca7f=_['merge']({},_0x26ca7f,_0x40b9be[_0x4d06('0x46')]);return db[_0x4d06('0x31')]['find'](_0x26ca7f)[_0x4d06('0x28')](handleEntityNotFound(_0x3fa26d,null))[_0x4d06('0x28')](respondWithResult(_0x3fa26d,null))[_0x4d06('0x49')](handleError(_0x3fa26d,null));};exports[_0x4d06('0x4c')]=function(_0x4fb56e,_0x232869){return db[_0x4d06('0x31')][_0x4d06('0x4c')](_0x4fb56e[_0x4d06('0x4d')],{})[_0x4d06('0x28')](function(_0x3a3935){var _0x2c9bf5=_0x4fb56e[_0x4d06('0x4e')]['get']({'plain':!![]});if(!_0x2c9bf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c9bf5[_0x4d06('0x4f')]===_0x4d06('0x4e')){var _0x2210c8=_0x3a3935[_0x4d06('0x2a')]({'plain':!![]});var _0x25f898='Dispositions';return db['UserProfileSection'][_0x4d06('0x50')]({'where':{'name':_0x25f898,'userProfileId':_0x2c9bf5[_0x4d06('0x51')]},'raw':!![]})[_0x4d06('0x28')](function(_0x41ea09){if(_0x41ea09&&_0x41ea09[_0x4d06('0x52')]===0x0){return db[_0x4d06('0x2c')][_0x4d06('0x4c')]({'name':_0x2210c8['name'],'resourceId':_0x2210c8['id'],'type':_0x41ea09[_0x4d06('0x2d')],'sectionId':_0x41ea09['id']},{})['then'](function(){return _0x3a3935;});}else{return _0x3a3935;}})['catch'](function(_0x5e58b3){logger['error'](_0x4d06('0x53'),_0x5e58b3);throw _0x5e58b3;});}return _0x3a3935;})[_0x4d06('0x28')](respondWithResult(_0x232869,0xc9))['catch'](handleError(_0x232869,null));};exports[_0x4d06('0x27')]=function(_0x12ddca,_0x36ce2b){if(_0x12ddca['body']['id']){delete _0x12ddca[_0x4d06('0x4d')]['id'];}return db[_0x4d06('0x31')][_0x4d06('0x50')]({'where':{'id':_0x12ddca[_0x4d06('0x54')]['id']}})[_0x4d06('0x28')](handleEntityNotFound(_0x36ce2b,null))[_0x4d06('0x28')](saveUpdates(_0x12ddca[_0x4d06('0x4d')],null))[_0x4d06('0x28')](respondWithResult(_0x36ce2b,null))[_0x4d06('0x49')](handleError(_0x36ce2b,null));};exports[_0x4d06('0x29')]=function(_0x2ed007,_0x2aa6be){return db[_0x4d06('0x31')][_0x4d06('0x50')]({'where':{'id':_0x2ed007[_0x4d06('0x54')]['id']}})[_0x4d06('0x28')](handleEntityNotFound(_0x2aa6be,null))[_0x4d06('0x28')](removeEntity(_0x2aa6be,null))[_0x4d06('0x49')](handleError(_0x2aa6be,null));};
\ No newline at end of file
+var _0x5ed3=['query','keys','filters','intersection','attributes','fields','limit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','rawAttributes','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','name','send','map','Disposition','fieldName','type','model'];(function(_0x1ee04d,_0x4b9f61){var _0x46a06e=function(_0x515e3a){while(--_0x515e3a){_0x1ee04d['push'](_0x1ee04d['shift']());}};_0x46a06e(++_0x4b9f61);}(_0x5ed3,0x1f3));var _0x35ed=function(_0x194d05,_0x4e3a72){_0x194d05=_0x194d05-0x0;var _0x2a3da7=_0x5ed3[_0x194d05];return _0x2a3da7;};'use strict';var emlformat=require(_0x35ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35ed('0x1'));var jsonpatch=require(_0x35ed('0x2'));var rp=require(_0x35ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35ed('0x4'));var util=require(_0x35ed('0x5'));var path=require(_0x35ed('0x6'));var sox=require('sox');var csv=require(_0x35ed('0x7'));var ejs=require(_0x35ed('0x8'));var fs=require('fs');var fs_extra=require(_0x35ed('0x9'));var _=require(_0x35ed('0xa'));var squel=require('squel');var crypto=require(_0x35ed('0xb'));var jsforce=require(_0x35ed('0xc'));var deskjs=require(_0x35ed('0xd'));var toCsv=require(_0x35ed('0x7'));var querystring=require(_0x35ed('0xe'));var Papa=require(_0x35ed('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x35ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x35ed('0x11'))(_0x35ed('0x12'));var utils=require(_0x35ed('0x13'));var config=require(_0x35ed('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x35ed('0x15'))['db'];function respondWithStatusCode(_0x7b2467,_0xd89531){_0xd89531=_0xd89531||0xcc;return function(_0x189ae6){if(_0x189ae6){return _0x7b2467[_0x35ed('0x16')](_0xd89531);}return _0x7b2467[_0x35ed('0x17')](_0xd89531)[_0x35ed('0x18')]();};}function respondWithResult(_0x4f3cec,_0x1d2da2){_0x1d2da2=_0x1d2da2||0xc8;return function(_0x4338a7){if(_0x4338a7){return _0x4f3cec[_0x35ed('0x17')](_0x1d2da2)[_0x35ed('0x19')](_0x4338a7);}};}function respondWithFilteredResult(_0x27f3ca,_0x6dd34e){return function(_0x5472d8){if(_0x5472d8){var _0x5a9505=typeof _0x6dd34e[_0x35ed('0x1a')]===_0x35ed('0x1b')&&typeof _0x6dd34e['limit']===_0x35ed('0x1b');var _0x1f43ec=_0x5472d8[_0x35ed('0x1c')];var _0x58405c=_0x5a9505?0x0:_0x6dd34e[_0x35ed('0x1a')];var _0x25f05b=_0x5a9505?_0x5472d8[_0x35ed('0x1c')]:_0x6dd34e[_0x35ed('0x1a')]+_0x6dd34e['limit'];var _0x5f4d09;if(_0x25f05b>=_0x1f43ec){_0x25f05b=_0x1f43ec;_0x5f4d09=0xc8;}else{_0x5f4d09=0xce;}_0x27f3ca['status'](_0x5f4d09);return _0x27f3ca[_0x35ed('0x1d')](_0x35ed('0x1e'),_0x58405c+'-'+_0x25f05b+'/'+_0x1f43ec)[_0x35ed('0x19')](_0x5472d8);}return null;};}function patchUpdates(_0x47bd4b){return function(_0x42fcf7){try{jsonpatch[_0x35ed('0x1f')](_0x42fcf7,_0x47bd4b,!![]);}catch(_0x5f4f2f){return BPromise[_0x35ed('0x20')](_0x5f4f2f);}return _0x42fcf7[_0x35ed('0x21')]();};}function saveUpdates(_0x520d13,_0x49bcab){return function(_0x234ffe){if(_0x234ffe){return _0x234ffe[_0x35ed('0x22')](_0x520d13)[_0x35ed('0x23')](function(_0x4f9001){return _0x4f9001;});}return null;};}function removeEntity(_0x3af8a2,_0x3fa61e){return function(_0x2c0a87){if(_0x2c0a87){return _0x2c0a87[_0x35ed('0x24')]()[_0x35ed('0x23')](function(){var _0x543305=_0x2c0a87[_0x35ed('0x25')]({'plain':!![]});var _0x5b71e6=_0x35ed('0x26');return db['UserProfileResource'][_0x35ed('0x24')]({'where':{'type':_0x5b71e6,'resourceId':_0x543305['id']}})[_0x35ed('0x23')](function(){return _0x2c0a87;});})[_0x35ed('0x23')](function(){_0x3af8a2[_0x35ed('0x17')](0xcc)[_0x35ed('0x18')]();});}};}function handleEntityNotFound(_0x499b99,_0x2ee501){return function(_0x446e70){if(!_0x446e70){_0x499b99[_0x35ed('0x16')](0x194);}return _0x446e70;};}function handleError(_0x497593,_0x11c65e){_0x11c65e=_0x11c65e||0x1f4;return function(_0x4d0d8e){logger[_0x35ed('0x27')](_0x4d0d8e['stack']);if(_0x4d0d8e[_0x35ed('0x28')]){delete _0x4d0d8e[_0x35ed('0x28')];}_0x497593['status'](_0x11c65e)[_0x35ed('0x29')](_0x4d0d8e);};}exports['index']=function(_0x1a9a3e,_0x277aad){var _0x3f7f06={},_0x58c04e={},_0x431280={'count':0x0,'rows':[]};var _0x2e15ac=_[_0x35ed('0x2a')](db[_0x35ed('0x2b')]['rawAttributes'],function(_0x3fd1b0){return{'name':_0x3fd1b0[_0x35ed('0x2c')],'type':_0x3fd1b0[_0x35ed('0x2d')]['key']};});_0x58c04e[_0x35ed('0x2e')]=_[_0x35ed('0x2a')](_0x2e15ac,_0x35ed('0x28'));_0x58c04e[_0x35ed('0x2f')]=_[_0x35ed('0x30')](_0x1a9a3e[_0x35ed('0x2f')]);_0x58c04e[_0x35ed('0x31')]=_[_0x35ed('0x32')](_0x58c04e[_0x35ed('0x2e')],_0x58c04e[_0x35ed('0x2f')]);_0x3f7f06[_0x35ed('0x33')]=_['intersection'](_0x58c04e[_0x35ed('0x2e')],qs[_0x35ed('0x34')](_0x1a9a3e[_0x35ed('0x2f')][_0x35ed('0x34')]));_0x3f7f06[_0x35ed('0x33')]=_0x3f7f06[_0x35ed('0x33')]['length']?_0x3f7f06[_0x35ed('0x33')]:_0x58c04e[_0x35ed('0x2e')];if(!_0x1a9a3e['query']['hasOwnProperty']('nolimit')){_0x3f7f06[_0x35ed('0x35')]=qs[_0x35ed('0x35')](_0x1a9a3e[_0x35ed('0x2f')][_0x35ed('0x35')]);_0x3f7f06[_0x35ed('0x1a')]=qs['offset'](_0x1a9a3e[_0x35ed('0x2f')][_0x35ed('0x1a')]);}_0x3f7f06['order']=qs['sort'](_0x1a9a3e[_0x35ed('0x2f')][_0x35ed('0x36')]);_0x3f7f06[_0x35ed('0x37')]=qs[_0x35ed('0x31')](_[_0x35ed('0x38')](_0x1a9a3e[_0x35ed('0x2f')],_0x58c04e[_0x35ed('0x31')]),_0x2e15ac);if(_0x1a9a3e[_0x35ed('0x2f')]['filter']){_0x3f7f06['where']=_[_0x35ed('0x39')](_0x3f7f06['where'],{'$or':_[_0x35ed('0x2a')](_0x2e15ac,function(_0x239e23){if(_0x239e23[_0x35ed('0x2d')]!==_0x35ed('0x3a')){var _0x1f682a={};_0x1f682a[_0x239e23[_0x35ed('0x28')]]={'$like':'%'+_0x1a9a3e['query'][_0x35ed('0x3b')]+'%'};return _0x1f682a;}})});}_0x3f7f06=_[_0x35ed('0x39')]({},_0x3f7f06,_0x1a9a3e[_0x35ed('0x3c')]);var _0x59302f={'where':_0x3f7f06['where']};return db['Disposition'][_0x35ed('0x1c')](_0x59302f)[_0x35ed('0x23')](function(_0x3dda0a){_0x431280[_0x35ed('0x1c')]=_0x3dda0a;if(_0x1a9a3e['query']['includeAll']){_0x3f7f06['include']=[{'all':!![]}];}return db[_0x35ed('0x2b')][_0x35ed('0x3d')](_0x3f7f06);})[_0x35ed('0x23')](function(_0x25a67b){_0x431280[_0x35ed('0x3e')]=_0x25a67b;return _0x431280;})[_0x35ed('0x23')](respondWithFilteredResult(_0x277aad,_0x3f7f06))[_0x35ed('0x3f')](handleError(_0x277aad,null));};exports['show']=function(_0x2168bf,_0xec327e){var _0x556700={'raw':!![],'where':{'id':_0x2168bf['params']['id']}},_0x20e5aa={};_0x20e5aa[_0x35ed('0x2e')]=_[_0x35ed('0x30')](db['Disposition'][_0x35ed('0x40')]);_0x20e5aa[_0x35ed('0x2f')]=_[_0x35ed('0x30')](_0x2168bf[_0x35ed('0x2f')]);_0x20e5aa[_0x35ed('0x31')]=_[_0x35ed('0x32')](_0x20e5aa['model'],_0x20e5aa[_0x35ed('0x2f')]);_0x556700[_0x35ed('0x33')]=_[_0x35ed('0x32')](_0x20e5aa[_0x35ed('0x2e')],qs[_0x35ed('0x34')](_0x2168bf['query'][_0x35ed('0x34')]));_0x556700[_0x35ed('0x33')]=_0x556700[_0x35ed('0x33')][_0x35ed('0x41')]?_0x556700[_0x35ed('0x33')]:_0x20e5aa['model'];if(_0x2168bf['query'][_0x35ed('0x42')]){_0x556700[_0x35ed('0x43')]=[{'all':!![]}];}_0x556700=_[_0x35ed('0x39')]({},_0x556700,_0x2168bf[_0x35ed('0x3c')]);return db['Disposition'][_0x35ed('0x44')](_0x556700)['then'](handleEntityNotFound(_0xec327e,null))['then'](respondWithResult(_0xec327e,null))[_0x35ed('0x3f')](handleError(_0xec327e,null));};exports[_0x35ed('0x45')]=function(_0xaffa79,_0x5adde1){return db[_0x35ed('0x2b')]['create'](_0xaffa79[_0x35ed('0x46')],{})[_0x35ed('0x23')](function(_0x13eda6){var _0x6f369f=_0xaffa79[_0x35ed('0x47')][_0x35ed('0x25')]({'plain':!![]});if(!_0x6f369f)throw new Error(_0x35ed('0x48'));if(_0x6f369f['role']===_0x35ed('0x47')){var _0x4afce4=_0x13eda6[_0x35ed('0x25')]({'plain':!![]});var _0x529631=_0x35ed('0x26');return db[_0x35ed('0x49')][_0x35ed('0x44')]({'where':{'name':_0x529631,'userProfileId':_0x6f369f[_0x35ed('0x4a')]},'raw':!![]})[_0x35ed('0x23')](function(_0x32a9fb){if(_0x32a9fb&&_0x32a9fb['autoAssociation']===0x0){return db[_0x35ed('0x4b')][_0x35ed('0x45')]({'name':_0x4afce4[_0x35ed('0x28')],'resourceId':_0x4afce4['id'],'type':_0x32a9fb[_0x35ed('0x28')],'sectionId':_0x32a9fb['id']},{})[_0x35ed('0x23')](function(){return _0x13eda6;});}else{return _0x13eda6;}})['catch'](function(_0x5c5595){logger[_0x35ed('0x27')](_0x35ed('0x4c'),_0x5c5595);throw _0x5c5595;});}return _0x13eda6;})[_0x35ed('0x23')](respondWithResult(_0x5adde1,0xc9))[_0x35ed('0x3f')](handleError(_0x5adde1,null));};exports[_0x35ed('0x22')]=function(_0x3b4c33,_0x53f9f4){if(_0x3b4c33[_0x35ed('0x46')]['id']){delete _0x3b4c33['body']['id'];}return db[_0x35ed('0x2b')][_0x35ed('0x44')]({'where':{'id':_0x3b4c33[_0x35ed('0x4d')]['id']}})[_0x35ed('0x23')](handleEntityNotFound(_0x53f9f4,null))['then'](saveUpdates(_0x3b4c33[_0x35ed('0x46')],null))[_0x35ed('0x23')](respondWithResult(_0x53f9f4,null))[_0x35ed('0x3f')](handleError(_0x53f9f4,null));};exports['destroy']=function(_0x7aeed4,_0x3e69e1){return db[_0x35ed('0x2b')][_0x35ed('0x44')]({'where':{'id':_0x7aeed4[_0x35ed('0x4d')]['id']}})[_0x35ed('0x23')](handleEntityNotFound(_0x3e69e1,null))['then'](removeEntity(_0x3e69e1,null))['catch'](handleError(_0x3e69e1,null));};
\ No newline at end of file
index 0233947..ce4c931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x113f=['exports','define','Disposition','tools_dispositions','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16d345,_0x13c7c8){var _0x293935=function(_0x307dbd){while(--_0x307dbd){_0x16d345['push'](_0x16d345['shift']());}};_0x293935(++_0x13c7c8);}(_0x113f,0xf6));var _0xf113=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x113f[_0x18b191];return _0x43e146;};'use strict';var _=require('lodash');var util=require(_0xf113('0x0'));var logger=require(_0xf113('0x1'))(_0xf113('0x2'));var moment=require(_0xf113('0x3'));var BPromise=require(_0xf113('0x4'));var rp=require(_0xf113('0x5'));var fs=require('fs');var path=require(_0xf113('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xf113('0x7')]=function(_0x2039c9,_0x394742){return _0x2039c9[_0xf113('0x8')](_0xf113('0x9'),attributes,{'tableName':_0xf113('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xf113('0xb'),'ListId']},{'unique':!![],'name':_0xf113('0xc'),'fields':[_0xf113('0xb'),_0xf113('0xd')]},{'unique':!![],'name':_0xf113('0xe'),'fields':[_0xf113('0xb'),_0xf113('0xf')]},{'unique':!![],'name':_0xf113('0x10'),'fields':['name',_0xf113('0x11')]},{'unique':!![],'name':_0xf113('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xf113('0x13'),'fields':[_0xf113('0xb'),_0xf113('0x14')]},{'unique':!![],'name':_0xf113('0x15'),'fields':['name',_0xf113('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x30ab=['exports','define','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c3a94,_0x4a436f){var _0x2160ac=function(_0x17b0a7){while(--_0x17b0a7){_0x1c3a94['push'](_0x1c3a94['shift']());}};_0x2160ac(++_0x4a436f);}(_0x30ab,0x179));var _0xb30a=function(_0x1ddcce,_0x2a3c57){_0x1ddcce=_0x1ddcce-0x0;var _0x4caf06=_0x30ab[_0x1ddcce];return _0x4caf06;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb30a('0x0'))(_0xb30a('0x1'));var moment=require(_0xb30a('0x2'));var BPromise=require(_0xb30a('0x3'));var rp=require(_0xb30a('0x4'));var fs=require('fs');var path=require(_0xb30a('0x5'));var rimraf=require(_0xb30a('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xb30a('0x7')]=function(_0x2979cd,_0x2e237f){return _0x2979cd[_0xb30a('0x8')]('Disposition',attributes,{'tableName':_0xb30a('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb30a('0xa'),'fields':['name',_0xb30a('0xb')]},{'unique':!![],'name':_0xb30a('0xc'),'fields':[_0xb30a('0xd'),_0xb30a('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xb30a('0xd'),_0xb30a('0xf')]},{'unique':!![],'name':_0xb30a('0x10'),'fields':[_0xb30a('0xd'),_0xb30a('0x11')]},{'unique':!![],'name':_0xb30a('0x12'),'fields':[_0xb30a('0xd'),_0xb30a('0x13')]},{'unique':!![],'name':_0xb30a('0x14'),'fields':['name',_0xb30a('0x15')]},{'unique':!![],'name':_0xb30a('0x16'),'fields':[_0xb30a('0xd'),_0xb30a('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
index e30fb2f..1c979d3 100644 (file)
@@ -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(_0x1276d8,_0x80b88c){var _0x433a81=function(_0x1f9608){while(--_0x1f9608){_0x1276d8['push'](_0x1276d8['shift']());}};_0x433a81(++_0x80b88c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x8eaef6,_0x4f215f){var _0x19d1b3=function(_0x36d61a){while(--_0x36d61a){_0x8eaef6['push'](_0x8eaef6['shift']());}};_0x19d1b3(++_0x4f215f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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
index a9e96bd..d5f113c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ddf=['get','isAuthenticated','index','/:id','show','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x33e566,_0x3e90f4){var _0x828b80=function(_0x2b67d2){while(--_0x2b67d2){_0x33e566['push'](_0x33e566['shift']());}};_0x828b80(++_0x3e90f4);}(_0x1ddf,0x18f));var _0xf1dd=function(_0xc6b2ff,_0x1558d7){_0xc6b2ff=_0xc6b2ff-0x0;var _0x47f7a4=_0x1ddf[_0xc6b2ff];return _0x47f7a4;};'use strict';var multer=require('multer');var util=require(_0xf1dd('0x0'));var path=require(_0xf1dd('0x1'));var timeout=require(_0xf1dd('0x2'));var express=require(_0xf1dd('0x3'));var router=express['Router']();var fs_extra=require(_0xf1dd('0x4'));var auth=require(_0xf1dd('0x5'));var interaction=require(_0xf1dd('0x6'));var config=require(_0xf1dd('0x7'));var controller=require(_0xf1dd('0x8'));router[_0xf1dd('0x9')]('/',auth[_0xf1dd('0xa')](),controller[_0xf1dd('0xb')]);router[_0xf1dd('0x9')](_0xf1dd('0xc'),auth[_0xf1dd('0xa')](),controller[_0xf1dd('0xd')]);router['post']('/',auth[_0xf1dd('0xa')](),controller['create']);router[_0xf1dd('0xe')](_0xf1dd('0xc'),auth[_0xf1dd('0xa')](),controller['update']);router[_0xf1dd('0xf')](_0xf1dd('0xc'),auth[_0xf1dd('0xa')](),controller['destroy']);module[_0xf1dd('0x10')]=router;
\ No newline at end of file
+var _0xd9b4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x284e24,_0x1d6f78){var _0x190539=function(_0x49100c){while(--_0x49100c){_0x284e24['push'](_0x284e24['shift']());}};_0x190539(++_0x1d6f78);}(_0xd9b4,0x11d));var _0x4d9b=function(_0x8ee89b,_0x5d19c1){_0x8ee89b=_0x8ee89b-0x0;var _0x1522c3=_0xd9b4[_0x8ee89b];return _0x1522c3;};'use strict';var multer=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var path=require(_0x4d9b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d9b('0x3'));var router=express[_0x4d9b('0x4')]();var fs_extra=require(_0x4d9b('0x5'));var auth=require(_0x4d9b('0x6'));var interaction=require(_0x4d9b('0x7'));var config=require(_0x4d9b('0x8'));var controller=require('./disposition.controller');router['get']('/',auth[_0x4d9b('0x9')](),controller['index']);router[_0x4d9b('0xa')](_0x4d9b('0xb'),auth['isAuthenticated'](),controller[_0x4d9b('0xc')]);router['post']('/',auth[_0x4d9b('0x9')](),controller[_0x4d9b('0xd')]);router[_0x4d9b('0xe')](_0x4d9b('0xb'),auth[_0x4d9b('0x9')](),controller[_0x4d9b('0xf')]);router['delete'](_0x4d9b('0xb'),auth[_0x4d9b('0x9')](),controller[_0x4d9b('0x10')]);module[_0x4d9b('0x11')]=router;
\ No newline at end of file
index a6c6f20..8b68aca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17cb=['exports','STRING','ENUM','yes','localstationid','2400','9600','4800','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x1e6485,_0x2920b8){var _0x3d8913=function(_0x5e6016){while(--_0x5e6016){_0x1e6485['push'](_0x1e6485['shift']());}};_0x3d8913(++_0x2920b8);}(_0x17cb,0x158));var _0xb17c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17cb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb17c('0x0'));module[_0xb17c('0x1')]={'name':{'type':Sequelize[_0xb17c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb17c('0x2')]},'ecm':{'type':Sequelize[_0xb17c('0x3')](_0xb17c('0x4'),'no'),'defaultValue':_0xb17c('0x4')},'headerinfo':{'type':Sequelize[_0xb17c('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xb17c('0x5')},'minrate':{'type':Sequelize[_0xb17c('0x3')](_0xb17c('0x6'),'4800','7200',_0xb17c('0x7'),'12000','14400'),'defaultValue':_0xb17c('0x8')},'maxrate':{'type':Sequelize[_0xb17c('0x3')](_0xb17c('0x6'),_0xb17c('0x8'),'7200',_0xb17c('0x7'),_0xb17c('0x9'),_0xb17c('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xb17c('0x2')],'defaultValue':_0xb17c('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb17c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb17c('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xb17c('0xd'),_0xb17c('0xe'),_0xb17c('0xf'),_0xb17c('0x10')),'defaultValue':_0xb17c('0xd')},'key':{'type':Sequelize[_0xb17c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb17c('0x11')],'defaultValue':function(){return _0xb17c('0x12');}},'notificationSound':{'type':Sequelize[_0xb17c('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb17c('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb17c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb17c('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb17c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb17c('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb17c('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xb17c('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xb17c('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4945a3){if(!_0x4945a3)this[_0xb17c('0x15')](_0xb17c('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x4945a3);}}};
\ No newline at end of file
+var _0xc570=['9600','12000','14400','v17,v27,v29','IAX','DADHI','KHOMP','SIP','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200'];(function(_0x387ec3,_0x585fbc){var _0x582853=function(_0x3c127c){while(--_0x3c127c){_0x387ec3['push'](_0x387ec3['shift']());}};_0x582853(++_0x585fbc);}(_0xc570,0x12c));var _0x0c57=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xc570[_0x59c301];return _0x3866b9;};'use strict';var Sequelize=require(_0x0c57('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c57('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0c57('0x1')]},'ecm':{'type':Sequelize[_0x0c57('0x2')]('yes','no'),'defaultValue':_0x0c57('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x0c57('0x4')},'localstationid':{'type':Sequelize[_0x0c57('0x1')],'unique':_0x0c57('0x5')},'minrate':{'type':Sequelize['ENUM']('2400',_0x0c57('0x6'),_0x0c57('0x7'),_0x0c57('0x8'),_0x0c57('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x0c57('0x2')]('2400',_0x0c57('0x6'),'7200',_0x0c57('0x8'),_0x0c57('0x9'),'14400'),'defaultValue':_0x0c57('0xa')},'modem':{'type':Sequelize[_0x0c57('0x1')],'defaultValue':_0x0c57('0xb')},'gateway':{'type':Sequelize[_0x0c57('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0c57('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0c57('0x2')]('SIP',_0x0c57('0xc'),_0x0c57('0xd'),_0x0c57('0xe')),'defaultValue':_0x0c57('0xf')},'key':{'type':Sequelize[_0x0c57('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0c57('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0c57('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0c57('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0c57('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0c57('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0c57('0x11')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0c57('0x10')],'defaultValue':![],'comment':_0x0c57('0x12'),'set':function(_0x352199){if(!_0x352199)this[_0x0c57('0x13')](_0x0c57('0x14'),null);this[_0x0c57('0x13')](_0x0c57('0x15'),_0x352199);}}};
\ No newline at end of file
index a11fbb6..150cfea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c5=['where','merge','VIRTUAL','FaxAccount','include','findAll','rows','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','localstationid','app','description','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','isNil','path','from','format','\x22%s\x22\x20<%s>','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0xe19e33,_0x7388af){var _0x1312d6=function(_0x56fadb){while(--_0x56fadb){_0xe19e33['push'](_0xe19e33['shift']());}};_0x1312d6(++_0x7388af);}(_0xe1c5,0x1eb));var _0x5e1c=function(_0x1d80da,_0x23433e){_0x1d80da=_0x1d80da-0x0;var _0x3abddf=_0xe1c5[_0x1d80da];return _0x3abddf;};'use strict';var emlformat=require(_0x5e1c('0x0'));var rimraf=require(_0x5e1c('0x1'));var zipdir=require(_0x5e1c('0x2'));var jsonpatch=require(_0x5e1c('0x3'));var rp=require(_0x5e1c('0x4'));var moment=require(_0x5e1c('0x5'));var BPromise=require(_0x5e1c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5e1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e1c('0x8'));var crypto=require(_0x5e1c('0x9'));var jsforce=require(_0x5e1c('0xa'));var deskjs=require(_0x5e1c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5e1c('0xc'));var Redis=require('ioredis');var authService=require(_0x5e1c('0xd'));var qs=require(_0x5e1c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e1c('0xf'));var logger=require(_0x5e1c('0x10'))(_0x5e1c('0x11'));var utils=require(_0x5e1c('0x12'));var config=require(_0x5e1c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5e1c('0x14')]=_[_0x5e1c('0x15')](config[_0x5e1c('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e1c('0x14')]));require('./faxAccount.socket')[_0x5e1c('0x16')](socket);var jayson=require(_0x5e1c('0x17'));var client=jayson[_0x5e1c('0x18')][_0x5e1c('0x19')]({'port':0x232c});var client9002=jayson[_0x5e1c('0x18')][_0x5e1c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x124556,_0x2f1151,_0x22b6fc,_0x44ade7){return new BPromise(function(_0x17d1ef,_0x32431d){var _0x3ce8c9=_0x44ade7||client;return _0x3ce8c9['request'](_0x124556,_0x22b6fc)[_0x5e1c('0x1a')](function(_0x228de5){logger[_0x5e1c('0x1b')](_0x5e1c('0x1c'),_0x2f1151,'request\x20sent');logger[_0x5e1c('0x1d')](_0x5e1c('0x1e'),_0x2f1151,'request\x20sent',JSON['stringify'](_0x228de5));if(_0x228de5['error']){if(_0x228de5['error']['code']===0x1f4){logger[_0x5e1c('0x1f')](_0x5e1c('0x1c'),_0x2f1151,_0x228de5[_0x5e1c('0x1f')][_0x5e1c('0x20')]);return _0x32431d(_0x228de5[_0x5e1c('0x1f')]['message']);}logger['error'](_0x5e1c('0x1c'),_0x2f1151,_0x228de5[_0x5e1c('0x1f')]['message']);return _0x17d1ef(_0x228de5[_0x5e1c('0x1f')]['message']);}else{logger[_0x5e1c('0x1b')](_0x5e1c('0x1c'),_0x2f1151,_0x5e1c('0x21'));_0x17d1ef(_0x228de5['result'][_0x5e1c('0x20')]);}})[_0x5e1c('0x22')](function(_0x5f3546){logger[_0x5e1c('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x2f1151,_0x5f3546);_0x32431d(_0x5f3546);});});}function respondWithStatusCode(_0x16c0d4,_0x15e535){_0x15e535=_0x15e535||0xcc;return function(_0x4bfef6){if(_0x4bfef6){return _0x16c0d4['sendStatus'](_0x15e535);}return _0x16c0d4[_0x5e1c('0x23')](_0x15e535)[_0x5e1c('0x24')]();};}function respondWithResult(_0x1be695,_0x1f1040){_0x1f1040=_0x1f1040||0xc8;return function(_0x5de3b3){if(_0x5de3b3){return _0x1be695['status'](_0x1f1040)[_0x5e1c('0x25')](_0x5de3b3);}};}function respondWithFilteredResult(_0x5250db,_0x11daed){return function(_0x52c795){if(_0x52c795){var _0x3d3154=typeof _0x11daed[_0x5e1c('0x26')]==='undefined'&&typeof _0x11daed[_0x5e1c('0x27')]===_0x5e1c('0x28');var _0x3f97b1=_0x52c795[_0x5e1c('0x29')];var _0xd6834=_0x3d3154?0x0:_0x11daed[_0x5e1c('0x26')];var _0x1f70dd=_0x3d3154?_0x52c795[_0x5e1c('0x29')]:_0x11daed[_0x5e1c('0x26')]+_0x11daed[_0x5e1c('0x27')];var _0x48b463;if(_0x1f70dd>=_0x3f97b1){_0x1f70dd=_0x3f97b1;_0x48b463=0xc8;}else{_0x48b463=0xce;}_0x5250db['status'](_0x48b463);return _0x5250db['set'](_0x5e1c('0x2a'),_0xd6834+'-'+_0x1f70dd+'/'+_0x3f97b1)[_0x5e1c('0x25')](_0x52c795);}return null;};}function patchUpdates(_0x17da7b){return function(_0x29eed7){try{jsonpatch[_0x5e1c('0x2b')](_0x29eed7,_0x17da7b,!![]);}catch(_0x21ffef){return BPromise[_0x5e1c('0x2c')](_0x21ffef);}return _0x29eed7[_0x5e1c('0x2d')]();};}function saveUpdates(_0x4b6da2,_0x179d28){return function(_0xb33f4e){if(_0xb33f4e){return _0xb33f4e['update'](_0x4b6da2)['then'](function(_0x11943e){return _0x11943e;});}return null;};}function removeEntity(_0x218d6c,_0x119b34){return function(_0x283c9e){if(_0x283c9e){return _0x283c9e[_0x5e1c('0x2e')]()['then'](function(){var _0x19d0aa=_0x283c9e[_0x5e1c('0x2f')]({'plain':!![]});var _0x1127c0='FaxAccounts';return db[_0x5e1c('0x30')][_0x5e1c('0x2e')]({'where':{'type':_0x1127c0,'resourceId':_0x19d0aa['id']}})[_0x5e1c('0x1a')](function(){return _0x283c9e;});})[_0x5e1c('0x1a')](function(){_0x218d6c[_0x5e1c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea6407,_0x258231){return function(_0x6e53bd){if(!_0x6e53bd){_0xea6407[_0x5e1c('0x31')](0x194);}return _0x6e53bd;};}function handleError(_0x487d01,_0x13bca7){_0x13bca7=_0x13bca7||0x1f4;return function(_0x438c31){logger[_0x5e1c('0x1f')](_0x438c31[_0x5e1c('0x32')]);if(_0x438c31[_0x5e1c('0x33')]){delete _0x438c31[_0x5e1c('0x33')];}_0x487d01[_0x5e1c('0x23')](_0x13bca7)['send'](_0x438c31);};}exports[_0x5e1c('0x34')]=function(_0x418959,_0x47fb62){var _0x266edd={'include':[{'model':db[_0x5e1c('0x35')],'as':_0x5e1c('0x36')}]},_0x278de2={},_0x4adad1={'count':0x0,'rows':[]};var _0x330aa4=_[_0x5e1c('0x37')](db['FaxAccount'][_0x5e1c('0x38')],function(_0x98c04){return{'name':_0x98c04[_0x5e1c('0x39')],'type':_0x98c04[_0x5e1c('0x3a')][_0x5e1c('0x3b')]};});_0x278de2[_0x5e1c('0x3c')]=_[_0x5e1c('0x37')](_0x330aa4,'name');_0x278de2[_0x5e1c('0x3d')]=_[_0x5e1c('0x3e')](_0x418959[_0x5e1c('0x3d')]);_0x278de2[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x278de2[_0x5e1c('0x3c')],_0x278de2[_0x5e1c('0x3d')]);_0x266edd[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x278de2[_0x5e1c('0x3c')],qs[_0x5e1c('0x42')](_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x42')]));_0x266edd[_0x5e1c('0x41')]=_0x266edd[_0x5e1c('0x41')][_0x5e1c('0x43')]?_0x266edd[_0x5e1c('0x41')]:_0x278de2[_0x5e1c('0x3c')];if(!_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x44')](_0x5e1c('0x45'))){_0x266edd[_0x5e1c('0x27')]=qs[_0x5e1c('0x27')](_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x266edd[_0x5e1c('0x26')]=qs[_0x5e1c('0x26')](_0x418959[_0x5e1c('0x3d')]['offset']);}_0x266edd['order']=qs[_0x5e1c('0x46')](_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x46')]);_0x266edd['where']=qs[_0x5e1c('0x3f')](_[_0x5e1c('0x47')](_0x418959[_0x5e1c('0x3d')],_0x278de2[_0x5e1c('0x3f')]),_0x330aa4);if(_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x48')]){_0x266edd[_0x5e1c('0x49')]=_[_0x5e1c('0x4a')](_0x266edd[_0x5e1c('0x49')],{'$or':_[_0x5e1c('0x37')](_0x330aa4,function(_0x569e54){if(_0x569e54[_0x5e1c('0x3a')]!==_0x5e1c('0x4b')){var _0x1d0687={};_0x1d0687[_0x569e54['name']]={'$like':'%'+_0x418959[_0x5e1c('0x3d')][_0x5e1c('0x48')]+'%'};return _0x1d0687;}})});}_0x266edd=_[_0x5e1c('0x4a')]({},_0x266edd,_0x418959['options']);var _0x2537c1={'where':_0x266edd[_0x5e1c('0x49')]};return db[_0x5e1c('0x4c')][_0x5e1c('0x29')](_0x2537c1)[_0x5e1c('0x1a')](function(_0x301740){_0x4adad1[_0x5e1c('0x29')]=_0x301740;if(_0x418959['query']['includeAll']){_0x266edd[_0x5e1c('0x4d')]=[{'all':!![]}];}return db['FaxAccount'][_0x5e1c('0x4e')](_0x266edd);})['then'](function(_0x2eba08){_0x4adad1[_0x5e1c('0x4f')]=_0x2eba08;return _0x4adad1;})['then'](respondWithFilteredResult(_0x47fb62,_0x266edd))[_0x5e1c('0x22')](handleError(_0x47fb62,null));};exports[_0x5e1c('0x50')]=function(_0x35701e,_0x3b098a){var _0x2c4373={'raw':![],'where':{'id':_0x35701e[_0x5e1c('0x51')]['id']},'include':[{'model':db[_0x5e1c('0x35')],'as':_0x5e1c('0x36')}]},_0x32907c={};_0x32907c[_0x5e1c('0x3c')]=_[_0x5e1c('0x3e')](db[_0x5e1c('0x4c')]['rawAttributes']);_0x32907c['query']=_['keys'](_0x35701e[_0x5e1c('0x3d')]);_0x32907c[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x32907c[_0x5e1c('0x3c')],_0x32907c[_0x5e1c('0x3d')]);_0x2c4373[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x32907c[_0x5e1c('0x3c')],qs['fields'](_0x35701e['query'][_0x5e1c('0x42')]));_0x2c4373[_0x5e1c('0x41')]=_0x2c4373[_0x5e1c('0x41')]['length']?_0x2c4373['attributes']:_0x32907c[_0x5e1c('0x3c')];if(_0x35701e[_0x5e1c('0x3d')][_0x5e1c('0x52')]){_0x2c4373[_0x5e1c('0x4d')]=[{'all':!![]}];}_0x2c4373=_['merge']({},_0x2c4373,_0x35701e[_0x5e1c('0x53')]);return db[_0x5e1c('0x4c')][_0x5e1c('0x54')](_0x2c4373)[_0x5e1c('0x1a')](handleEntityNotFound(_0x3b098a,null))[_0x5e1c('0x1a')](respondWithResult(_0x3b098a,null))[_0x5e1c('0x22')](handleError(_0x3b098a,null));};exports[_0x5e1c('0x55')]=function(_0x3cd926,_0x31f316){return db[_0x5e1c('0x4c')]['create'](_0x3cd926[_0x5e1c('0x56')],{})[_0x5e1c('0x1a')](function(_0x169a3a){var _0x2c0d7e=_0x3cd926[_0x5e1c('0x57')][_0x5e1c('0x2f')]({'plain':!![]});if(!_0x2c0d7e)throw new Error(_0x5e1c('0x58'));if(_0x2c0d7e[_0x5e1c('0x59')]===_0x5e1c('0x57')){var _0x536cf7=_0x169a3a[_0x5e1c('0x2f')]({'plain':!![]});var _0x1ffd52='FaxAccounts';return db[_0x5e1c('0x5a')]['find']({'where':{'name':_0x1ffd52,'userProfileId':_0x2c0d7e['userProfileId']},'raw':!![]})[_0x5e1c('0x1a')](function(_0x49d2b3){if(_0x49d2b3&&_0x49d2b3['autoAssociation']===0x0){return db['UserProfileResource'][_0x5e1c('0x55')]({'name':_0x536cf7[_0x5e1c('0x33')],'resourceId':_0x536cf7['id'],'type':_0x49d2b3['name'],'sectionId':_0x49d2b3['id']},{})['then'](function(){return _0x169a3a;});}else{return _0x169a3a;}})[_0x5e1c('0x22')](function(_0x3ab83a){logger[_0x5e1c('0x1f')](_0x5e1c('0x5b'),_0x3ab83a);throw _0x3ab83a;});}return _0x169a3a;})[_0x5e1c('0x1a')](respondWithResult(_0x31f316,0xc9))[_0x5e1c('0x22')](handleError(_0x31f316,null));};exports[_0x5e1c('0x5c')]=function(_0x5629c0,_0x5188bb){if(_0x5629c0[_0x5e1c('0x56')]['id']){delete _0x5629c0['body']['id'];}return db[_0x5e1c('0x4c')][_0x5e1c('0x54')]({'where':{'id':_0x5629c0[_0x5e1c('0x51')]['id']},'include':[{'model':db[_0x5e1c('0x35')],'as':_0x5e1c('0x36')}]})[_0x5e1c('0x1a')](handleEntityNotFound(_0x5188bb,null))[_0x5e1c('0x1a')](saveUpdates(_0x5629c0[_0x5e1c('0x56')],null))[_0x5e1c('0x1a')](respondWithResult(_0x5188bb,null))[_0x5e1c('0x22')](handleError(_0x5188bb,null));};exports[_0x5e1c('0x2e')]=function(_0x2e805a,_0x7f1178){return db['FaxAccount'][_0x5e1c('0x54')]({'where':{'id':_0x2e805a[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x7f1178,null))[_0x5e1c('0x1a')](removeEntity(_0x7f1178,null))[_0x5e1c('0x22')](handleError(_0x7f1178,null));};exports[_0x5e1c('0x5d')]=function(_0x2b7411,_0x465be7){return db[_0x5e1c('0x4c')][_0x5e1c('0x5d')]()['then'](respondWithResult(_0x465be7,null))[_0x5e1c('0x22')](handleError(_0x465be7,null));};exports['addDisposition']=function(_0x495246,_0xee84e5,_0x4d339d){if(_0x495246[_0x5e1c('0x56')]['id']){delete _0x495246[_0x5e1c('0x56')]['id'];}return db[_0x5e1c('0x4c')][_0x5e1c('0x54')]({'where':{'id':_0x495246[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0xee84e5,null))[_0x5e1c('0x1a')](function(_0x3d9835){if(_0x3d9835){_0x495246[_0x5e1c('0x56')][_0x5e1c('0x5e')]=_0x3d9835['id'];return db[_0x5e1c('0x5f')][_0x5e1c('0x55')](_0x495246['body']);}})[_0x5e1c('0x1a')](respondWithResult(_0xee84e5,null))[_0x5e1c('0x22')](handleError(_0xee84e5,null));};exports[_0x5e1c('0x60')]=function(_0x1417f5,_0x35c37d,_0xcd5382){var _0x21acfe={'raw':![],'where':{}};var _0x29abc5={};var _0x16b004={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5e1c('0x61')]({'where':{'id':_0x1417f5[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x35c37d,null))['then'](function(_0x218724){if(_0x218724){_0x29abc5[_0x5e1c('0x3c')]=_[_0x5e1c('0x3e')](db[_0x5e1c('0x5f')][_0x5e1c('0x38')]);_0x29abc5[_0x5e1c('0x3d')]=_['keys'](_0x1417f5['query']);_0x29abc5[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x29abc5['model'],_0x29abc5['query']);_0x21acfe[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x29abc5['model'],qs['fields'](_0x1417f5[_0x5e1c('0x3d')]['fields']));_0x21acfe[_0x5e1c('0x41')]=_0x21acfe[_0x5e1c('0x41')][_0x5e1c('0x43')]?_0x21acfe[_0x5e1c('0x41')]:_0x29abc5[_0x5e1c('0x3c')];if(!_0x1417f5['query']['hasOwnProperty']('nolimit')){_0x21acfe[_0x5e1c('0x27')]=qs['limit'](_0x1417f5[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x21acfe['offset']=qs[_0x5e1c('0x26')](_0x1417f5[_0x5e1c('0x3d')]['offset']);}_0x21acfe[_0x5e1c('0x62')]=qs['sort'](_0x1417f5['query']['sort']);_0x21acfe[_0x5e1c('0x49')]=qs[_0x5e1c('0x3f')](_[_0x5e1c('0x47')](_0x1417f5[_0x5e1c('0x3d')],_0x29abc5[_0x5e1c('0x3f')]));_0x21acfe['where'][_0x5e1c('0x5e')]=_0x218724['id'];if(_0x1417f5[_0x5e1c('0x3d')]['filter']){_0x21acfe[_0x5e1c('0x49')]=_[_0x5e1c('0x4a')](_0x21acfe[_0x5e1c('0x49')],{'$or':_[_0x5e1c('0x37')](_0x21acfe['attributes'],function(_0x1bdce5){var _0x478526={};_0x478526[_0x1bdce5]={'$like':'%'+_0x1417f5[_0x5e1c('0x3d')][_0x5e1c('0x48')]+'%'};return _0x478526;})});}_0x21acfe=_[_0x5e1c('0x4a')]({},_0x21acfe,_0x1417f5['options']);return db[_0x5e1c('0x5f')][_0x5e1c('0x29')]({'where':_0x21acfe[_0x5e1c('0x49')]})[_0x5e1c('0x1a')](function(_0x3446c6){_0x16b004[_0x5e1c('0x29')]=_0x3446c6;if(_0x1417f5[_0x5e1c('0x3d')]['includeAll']){_0x21acfe[_0x5e1c('0x4d')]=[{'all':!![]}];}return db[_0x5e1c('0x5f')][_0x5e1c('0x4e')](_0x21acfe);})[_0x5e1c('0x1a')](function(_0x1626ac){_0x16b004[_0x5e1c('0x4f')]=_0x1626ac;return _0x16b004;});}})[_0x5e1c('0x1a')](respondWithFilteredResult(_0x35c37d,_0x21acfe))[_0x5e1c('0x22')](handleError(_0x35c37d,null));};exports[_0x5e1c('0x63')]=function(_0x5f58b6,_0x5371a8,_0x402038){return db[_0x5e1c('0x4c')]['find']({'where':{'id':_0x5f58b6[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x5371a8,null))[_0x5e1c('0x1a')](function(_0x316c46){if(_0x316c46){return _0x316c46['removeDispositions'](_0x5f58b6[_0x5e1c('0x3d')][_0x5e1c('0x64')]);}})['then'](respondWithStatusCode(_0x5371a8,null))[_0x5e1c('0x22')](handleError(_0x5371a8,null));};exports[_0x5e1c('0x65')]=function(_0x5c24bb,_0x25c4d4,_0x16696b){if(_0x5c24bb[_0x5e1c('0x56')]['id']){delete _0x5c24bb['body']['id'];}return db[_0x5e1c('0x4c')][_0x5e1c('0x54')]({'where':{'id':_0x5c24bb[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x25c4d4,null))[_0x5e1c('0x1a')](function(_0x11095f){if(_0x11095f){_0x5c24bb[_0x5e1c('0x56')]['FaxAccountId']=_0x11095f['id'];return db[_0x5e1c('0x66')]['create'](_0x5c24bb[_0x5e1c('0x56')]);}})[_0x5e1c('0x1a')](respondWithResult(_0x25c4d4,null))[_0x5e1c('0x22')](handleError(_0x25c4d4,null));};exports[_0x5e1c('0x67')]=function(_0xbc3038,_0x91a065,_0x1469b8){var _0x4cadc9={'raw':![],'where':{}};var _0x2df765={};var _0x47811e={'count':0x0,'rows':[]};return db[_0x5e1c('0x4c')][_0x5e1c('0x61')]({'where':{'id':_0xbc3038[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x91a065,null))[_0x5e1c('0x1a')](function(_0x2b4197){if(_0x2b4197){_0x2df765['model']=_[_0x5e1c('0x3e')](db[_0x5e1c('0x66')][_0x5e1c('0x38')]);_0x2df765[_0x5e1c('0x3d')]=_[_0x5e1c('0x3e')](_0xbc3038[_0x5e1c('0x3d')]);_0x2df765[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x2df765[_0x5e1c('0x3c')],_0x2df765[_0x5e1c('0x3d')]);_0x4cadc9[_0x5e1c('0x41')]=_['intersection'](_0x2df765['model'],qs[_0x5e1c('0x42')](_0xbc3038[_0x5e1c('0x3d')][_0x5e1c('0x42')]));_0x4cadc9[_0x5e1c('0x41')]=_0x4cadc9['attributes'][_0x5e1c('0x43')]?_0x4cadc9[_0x5e1c('0x41')]:_0x2df765[_0x5e1c('0x3c')];if(!_0xbc3038['query'][_0x5e1c('0x44')]('nolimit')){_0x4cadc9[_0x5e1c('0x27')]=qs['limit'](_0xbc3038['query'][_0x5e1c('0x27')]);_0x4cadc9[_0x5e1c('0x26')]=qs[_0x5e1c('0x26')](_0xbc3038[_0x5e1c('0x3d')][_0x5e1c('0x26')]);}_0x4cadc9['order']=qs['sort'](_0xbc3038[_0x5e1c('0x3d')][_0x5e1c('0x46')]);_0x4cadc9['where']=qs[_0x5e1c('0x3f')](_['pick'](_0xbc3038[_0x5e1c('0x3d')],_0x2df765[_0x5e1c('0x3f')]));_0x4cadc9[_0x5e1c('0x49')][_0x5e1c('0x5e')]=_0x2b4197['id'];if(_0xbc3038[_0x5e1c('0x3d')][_0x5e1c('0x48')]){_0x4cadc9[_0x5e1c('0x49')]=_[_0x5e1c('0x4a')](_0x4cadc9[_0x5e1c('0x49')],{'$or':_[_0x5e1c('0x37')](_0x4cadc9[_0x5e1c('0x41')],function(_0xdbcd13){var _0x38f33a={};_0x38f33a[_0xdbcd13]={'$like':'%'+_0xbc3038['query'][_0x5e1c('0x48')]+'%'};return _0x38f33a;})});}_0x4cadc9=_[_0x5e1c('0x4a')]({},_0x4cadc9,_0xbc3038[_0x5e1c('0x53')]);return db[_0x5e1c('0x66')][_0x5e1c('0x29')]({'where':_0x4cadc9[_0x5e1c('0x49')]})[_0x5e1c('0x1a')](function(_0x560012){_0x47811e['count']=_0x560012;if(_0xbc3038[_0x5e1c('0x3d')][_0x5e1c('0x52')]){_0x4cadc9[_0x5e1c('0x4d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5e1c('0x4e')](_0x4cadc9);})[_0x5e1c('0x1a')](function(_0x539302){_0x47811e[_0x5e1c('0x4f')]=_0x539302;return _0x47811e;});}})['then'](respondWithFilteredResult(_0x91a065,_0x4cadc9))[_0x5e1c('0x22')](handleError(_0x91a065,null));};exports[_0x5e1c('0x68')]=function(_0x4c719b,_0x13a467,_0x3c8ddb){return db['FaxAccount'][_0x5e1c('0x54')]({'where':{'id':_0x4c719b[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x13a467,null))[_0x5e1c('0x1a')](function(_0x225c96){if(_0x225c96){return _0x225c96[_0x5e1c('0x68')](_0x4c719b[_0x5e1c('0x3d')][_0x5e1c('0x64')]);}})[_0x5e1c('0x1a')](respondWithStatusCode(_0x13a467,null))[_0x5e1c('0x22')](handleError(_0x13a467,null));};exports['addInteraction']=function(_0x4b315b,_0x32bfbb,_0x1e50f7){return db[_0x5e1c('0x69')][_0x5e1c('0x54')]({'where':{'id':_0x4b315b['params']['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x32bfbb,null))[_0x5e1c('0x1a')](function(_0x559abc){if(_0x559abc){return _0x559abc[_0x5e1c('0x6a')](_0x4b315b['body']['ids'],_[_0x5e1c('0x6b')](_0x4b315b[_0x5e1c('0x56')],[_0x5e1c('0x64'),'id'])||{});}})[_0x5e1c('0x1a')](respondWithResult(_0x32bfbb,null))['catch'](handleError(_0x32bfbb,null));};exports[_0x5e1c('0x6c')]=function(_0x4e4d57,_0x242936,_0x3b08c3){var _0x3d2a8c={'raw':![],'where':{}};var _0x498b3e={};var _0x4d9925={'count':0x0,'rows':[]};return db[_0x5e1c('0x4c')]['findOne']({'where':{'id':_0x4e4d57[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x242936,null))['then'](function(_0x19c161){if(_0x19c161){_0x498b3e['model']=_[_0x5e1c('0x3e')](db[_0x5e1c('0x69')][_0x5e1c('0x38')]);_0x498b3e[_0x5e1c('0x3d')]=_[_0x5e1c('0x3e')](_0x4e4d57[_0x5e1c('0x3d')]);_0x498b3e[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x498b3e[_0x5e1c('0x3c')],_0x498b3e[_0x5e1c('0x3d')]);_0x3d2a8c['attributes']=_[_0x5e1c('0x40')](_0x498b3e[_0x5e1c('0x3c')],qs[_0x5e1c('0x42')](_0x4e4d57['query'][_0x5e1c('0x42')]));_0x3d2a8c[_0x5e1c('0x41')]=_0x3d2a8c[_0x5e1c('0x41')][_0x5e1c('0x43')]?_0x3d2a8c[_0x5e1c('0x41')]:_0x498b3e[_0x5e1c('0x3c')];if(!_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x44')](_0x5e1c('0x45'))){_0x3d2a8c['limit']=qs[_0x5e1c('0x27')](_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x3d2a8c['offset']=qs[_0x5e1c('0x26')](_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x26')]);}_0x3d2a8c[_0x5e1c('0x62')]=qs[_0x5e1c('0x46')](_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x46')]);_0x3d2a8c[_0x5e1c('0x49')]=qs[_0x5e1c('0x3f')](_[_0x5e1c('0x47')](_0x4e4d57[_0x5e1c('0x3d')],_0x498b3e[_0x5e1c('0x3f')]));_0x3d2a8c[_0x5e1c('0x49')]['FaxAccountId']=_0x19c161['id'];if(_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x48')]){_0x3d2a8c[_0x5e1c('0x49')]=_['merge'](_0x3d2a8c[_0x5e1c('0x49')],{'$or':_[_0x5e1c('0x37')](_0x3d2a8c[_0x5e1c('0x41')],function(_0x32d3ff){var _0x47fb3e={};_0x47fb3e[_0x32d3ff]={'$like':'%'+_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x48')]+'%'};return _0x47fb3e;})});}_0x3d2a8c=_[_0x5e1c('0x4a')]({},_0x3d2a8c,_0x4e4d57['options']);return db[_0x5e1c('0x69')][_0x5e1c('0x29')]({'where':_0x3d2a8c[_0x5e1c('0x49')]})[_0x5e1c('0x1a')](function(_0x4ac91e){_0x4d9925[_0x5e1c('0x29')]=_0x4ac91e;if(_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x52')]){_0x3d2a8c[_0x5e1c('0x4d')]=[{'model':db[_0x5e1c('0x6d')],'as':'Contact','required':![]},{'model':db[_0x5e1c('0x6e')],'as':_0x5e1c('0x6f'),'attributes':[_0x5e1c('0x33'),_0x5e1c('0x70'),_0x5e1c('0x71')],'required':![]},{'model':db[_0x5e1c('0x72')],'as':'Tags','attributes':['id',_0x5e1c('0x33'),_0x5e1c('0x73')],'where':_0x4e4d57[_0x5e1c('0x3d')]['tag']?{'id':_0x4e4d57[_0x5e1c('0x3d')][_0x5e1c('0x74')]}:undefined,'required':_0x4e4d57['query']['tag']?!![]:![]}];}return db[_0x5e1c('0x69')][_0x5e1c('0x4e')](_0x3d2a8c);})[_0x5e1c('0x1a')](function(_0x1a295d){_0x4d9925[_0x5e1c('0x4f')]=_0x1a295d;return _0x4d9925;});}})[_0x5e1c('0x1a')](respondWithFilteredResult(_0x242936,_0x3d2a8c))[_0x5e1c('0x22')](handleError(_0x242936,null));};exports[_0x5e1c('0x75')]=function(_0x4c0bff,_0x48025b){var _0x476e38=_0x4c0bff['params']['id'];var _0x294596=_0x4c0bff[_0x5e1c('0x56')];var _0x13a039=0xc8;var _0xa9db04=null;return db[_0x5e1c('0x76')][_0x5e1c('0x77')]({'isolationLevel':db[_0x5e1c('0x76')][_0x5e1c('0x78')][_0x5e1c('0x79')][_0x5e1c('0x7a')]},function(_0xd91e80){return db[_0x5e1c('0x4c')]['findOne']({'where':{'id':_0x476e38},'transaction':_0xd91e80})['then'](function(_0x447f96){if(_0x447f96){return db[_0x5e1c('0x7b')]['destroy']({'where':{'FaxAccountId':_0x476e38},'transaction':_0xd91e80})['then'](function(){var _0x512f2b=_[_0x5e1c('0x37')](_0x294596,function(_0x5b55ea){_0x5b55ea[_0x5e1c('0x5e')]=_0x476e38;return _0x5b55ea;});return db[_0x5e1c('0x7b')][_0x5e1c('0x7c')](_0x512f2b,{'transaction':_0xd91e80});});}else{_0x13a039=0x194;_0xa9db04=[];}});})[_0x5e1c('0x1a')](function(){if(_0x13a039!==0x194){return db[_0x5e1c('0x7b')][_0x5e1c('0x7d')]({'where':{'FaxAccountId':_0x476e38},'order':_0x5e1c('0x7e')})[_0x5e1c('0x1a')](function(_0x287579){_0xa9db04=_0x287579;});}})['catch'](function(_0x437f5e){_0x13a039=0x1f4;logger['error'](_0x437f5e[_0x5e1c('0x32')]);if(_0x437f5e[_0x5e1c('0x33')]){delete _0x437f5e[_0x5e1c('0x33')];}_0xa9db04=_0x437f5e;})[_0x5e1c('0x7f')](function(){if(_0xa9db04===null){_0x48025b[_0x5e1c('0x31')](_0x13a039);}else{if(_0x13a039===0x1f4){_0x48025b[_0x5e1c('0x23')](_0x13a039)[_0x5e1c('0x80')](_0xa9db04);}else{_0x48025b[_0x5e1c('0x23')](_0x13a039)['json'](_0xa9db04);}}});};exports[_0x5e1c('0x81')]=function(_0x703227,_0x12f4fc,_0x346706){var _0x55fe0c={};var _0x3a5a6f={};var _0x397be9;var _0x41d986;return db[_0x5e1c('0x4c')]['findOne']({'where':{'id':_0x703227['params']['id']}})['then'](handleEntityNotFound(_0x12f4fc,null))[_0x5e1c('0x1a')](function(_0x191101){if(_0x191101){_0x397be9=_0x191101;_0x3a5a6f[_0x5e1c('0x3c')]=_[_0x5e1c('0x3e')](db[_0x5e1c('0x7b')][_0x5e1c('0x38')]);_0x3a5a6f[_0x5e1c('0x3d')]=_[_0x5e1c('0x3e')](_0x703227[_0x5e1c('0x3d')]);_0x3a5a6f[_0x5e1c('0x3f')]=_['intersection'](_0x3a5a6f[_0x5e1c('0x3c')],_0x3a5a6f[_0x5e1c('0x3d')]);_0x55fe0c[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x3a5a6f['model'],qs[_0x5e1c('0x42')](_0x703227[_0x5e1c('0x3d')][_0x5e1c('0x42')]));_0x55fe0c[_0x5e1c('0x41')]=_0x55fe0c[_0x5e1c('0x41')]['length']?_0x55fe0c[_0x5e1c('0x41')]:_0x3a5a6f[_0x5e1c('0x3c')];_0x55fe0c[_0x5e1c('0x62')]=qs[_0x5e1c('0x46')](_0x703227['query'][_0x5e1c('0x46')]);_0x55fe0c[_0x5e1c('0x49')]=qs[_0x5e1c('0x3f')](_[_0x5e1c('0x47')](_0x703227['query'],_0x3a5a6f[_0x5e1c('0x3f')]));if(_0x703227[_0x5e1c('0x3d')][_0x5e1c('0x48')]){_0x55fe0c[_0x5e1c('0x49')]=_[_0x5e1c('0x4a')](_0x55fe0c[_0x5e1c('0x49')],{'$or':_['map'](_0x55fe0c[_0x5e1c('0x41')],function(_0x4f77c8){var _0x4480f8={};_0x4480f8[_0x4f77c8]={'$like':'%'+_0x703227[_0x5e1c('0x3d')][_0x5e1c('0x48')]+'%'};return _0x4480f8;})});}_0x55fe0c=_[_0x5e1c('0x4a')]({},_0x55fe0c,_0x703227['options']);return _0x397be9[_0x5e1c('0x81')](_0x55fe0c);}})['then'](function(_0x1f4ac4){if(_0x1f4ac4){_0x41d986=_0x1f4ac4[_0x5e1c('0x43')];if(!_0x703227['query'][_0x5e1c('0x44')](_0x5e1c('0x45'))){_0x55fe0c[_0x5e1c('0x27')]=qs[_0x5e1c('0x27')](_0x703227[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x55fe0c[_0x5e1c('0x26')]=qs[_0x5e1c('0x26')](_0x703227[_0x5e1c('0x3d')][_0x5e1c('0x26')]);}return _0x397be9['getApplications'](_0x55fe0c);}})[_0x5e1c('0x1a')](function(_0x4156fd){if(_0x4156fd){return _0x4156fd?{'count':_0x41d986,'rows':_0x4156fd}:null;}})[_0x5e1c('0x1a')](respondWithResult(_0x12f4fc,null))[_0x5e1c('0x22')](handleError(_0x12f4fc,null));};function Extension(_0x337916,_0x1463be,_0x449ca1,_0x3a795a){this['context']='from-voip-provider';this['exten']=_0x337916[_0x5e1c('0x82')];this[_0x5e1c('0x83')]=_0x3a795a;this[_0x5e1c('0x3a')]='system';this[_0x5e1c('0x84')]='Fax\x20Extension';this[_0x5e1c('0x5e')]=_0x337916['id'];this[_0x5e1c('0x7e')]=_0x1463be;this['appdata']=_0x449ca1;}function createExtensionsReciveFax(_0x38fefe){var _0x49cdc1=0x1;var _0x19a913=[];_0x19a913[_0x5e1c('0x85')](new Extension(_0x38fefe,_0x49cdc1,'',_0x5e1c('0x86')));_0x49cdc1+=0x1;_0x19a913[_0x5e1c('0x85')](new Extension(_0x38fefe,_0x49cdc1,_0x5e1c('0x87'),_0x5e1c('0x88')));_0x49cdc1+=0x1;for(var _0x6fb16e in _0x38fefe){if(_0x38fefe[_0x5e1c('0x44')](_0x6fb16e)&&(_0x6fb16e===_0x5e1c('0x89')||_0x6fb16e===_0x5e1c('0x82')||_0x6fb16e==='gateway'||_0x6fb16e===_0x5e1c('0x8a')||_0x6fb16e===_0x5e1c('0x8b')||_0x6fb16e===_0x5e1c('0x8c')||_0x6fb16e==='minrate'||_0x6fb16e===_0x5e1c('0x8d')||_0x6fb16e===_0x5e1c('0x8e'))){_0x19a913[_0x5e1c('0x85')](new Extension(_0x38fefe,_0x49cdc1,_0x5e1c('0x8f')+_0x6fb16e+')='+_0x38fefe[_0x6fb16e],_0x5e1c('0x88')));_0x49cdc1+=0x1;}}_0x19a913[_0x5e1c('0x85')](new Extension(_0x38fefe,_0x49cdc1,'6','Wait'));_0x49cdc1+=0x1;_0x19a913[_0x5e1c('0x85')](new Extension(_0x38fefe,_0x49cdc1,'/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'));_0x49cdc1=0x0;return _0x19a913;}exports[_0x5e1c('0x90')]=function(_0x2d318d,_0x3a831b,_0xb6bf79){var _0xbb080d;return db[_0x5e1c('0x76')][_0x5e1c('0x77')](function(_0x326341){return db[_0x5e1c('0x4c')]['create'](_0x2d318d[_0x5e1c('0x56')],{'transaction':_0x326341})[_0x5e1c('0x1a')](function(_0x305285){_0xbb080d=_0x305285[_0x5e1c('0x2f')]({'plain':!![]});return db[_0x5e1c('0x91')][_0x5e1c('0x7c')](createExtensionsReciveFax(_0xbb080d),{'transaction':_0x326341});});})['then'](function(){return _0xbb080d;})[_0x5e1c('0x1a')](respondWithResult(_0x3a831b,null))[_0x5e1c('0x22')](handleError(_0x3a831b,null));};exports[_0x5e1c('0x92')]=function(_0x195579,_0x22dfa5,_0x392aaf){var _0xb8bc67;return db[_0x5e1c('0x76')][_0x5e1c('0x77')](function(_0x2350fc){return db[_0x5e1c('0x4c')]['update'](_0x195579[_0x5e1c('0x56')],{'where':{'id':_0x195579[_0x5e1c('0x56')]['id']},'transaction':_0x2350fc})[_0x5e1c('0x1a')](function(_0xa66d2){return db[_0x5e1c('0x91')]['destroy']({'where':{'FaxAccountId':_0x195579[_0x5e1c('0x56')]['id']},'transaction':_0x2350fc})['then'](function(_0x2f96a0){return db[_0x5e1c('0x91')][_0x5e1c('0x7c')](createExtensionsReciveFax(_[_0x5e1c('0x6b')](_0x195579[_0x5e1c('0x56')],[_0x5e1c('0x93'),_0x5e1c('0x3b'),_0x5e1c('0x94'),_0x5e1c('0x95'),'TrunkId','ListId'])),{'transaction':_0x2350fc});});});})['then'](function(){return db[_0x5e1c('0x4c')][_0x5e1c('0x96')](_0x195579[_0x5e1c('0x56')]['id']);})[_0x5e1c('0x1a')](respondWithResult(_0x22dfa5,null))[_0x5e1c('0x22')](handleError(_0x22dfa5,null));};exports[_0x5e1c('0x97')]=function(_0x2f1535,_0x5b65ed,_0x31ea02){var _0x378c47={'raw':!![],'where':{}};var _0x33eca3={};var _0x4ba9f9={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5e1c('0x61')]({'where':{'id':_0x2f1535[_0x5e1c('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b65ed,null))[_0x5e1c('0x1a')](function(_0x2386d2){if(_0x2386d2){_0x33eca3[_0x5e1c('0x3c')]=_[_0x5e1c('0x3e')](db['FaxMessage']['rawAttributes']);_0x33eca3[_0x5e1c('0x3d')]=_['keys'](_0x2f1535[_0x5e1c('0x3d')]);_0x33eca3[_0x5e1c('0x3f')]=_[_0x5e1c('0x40')](_0x33eca3[_0x5e1c('0x3c')],_0x33eca3[_0x5e1c('0x3d')]);_0x378c47[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x33eca3['model'],qs[_0x5e1c('0x42')](_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x42')]));_0x378c47[_0x5e1c('0x41')]=_0x378c47['attributes']['length']?_0x378c47['attributes']:_0x33eca3[_0x5e1c('0x3c')];if(!_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x44')](_0x5e1c('0x45'))){_0x378c47[_0x5e1c('0x27')]=qs[_0x5e1c('0x27')](_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x378c47[_0x5e1c('0x26')]=qs[_0x5e1c('0x26')](_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x26')]);}_0x378c47[_0x5e1c('0x62')]=qs[_0x5e1c('0x46')](_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x46')]);_0x378c47[_0x5e1c('0x49')]=qs[_0x5e1c('0x3f')](_[_0x5e1c('0x47')](_0x2f1535[_0x5e1c('0x3d')],_0x33eca3[_0x5e1c('0x3f')]));_0x378c47['where']['FaxAccountId']=_0x2386d2['id'];if(_0x2f1535['query'][_0x5e1c('0x48')]){_0x378c47['where']=_[_0x5e1c('0x4a')](_0x378c47[_0x5e1c('0x49')],{'$or':_[_0x5e1c('0x37')](_0x378c47[_0x5e1c('0x41')],function(_0xce9c25){var _0x130185={};_0x130185[_0xce9c25]={'$like':'%'+_0x2f1535['query'][_0x5e1c('0x48')]+'%'};return _0x130185;})});}if(_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x98')]){var _0x301731=_0x2f1535[_0x5e1c('0x3d')][_0x5e1c('0x98')][_0x5e1c('0x99')](',');var _0x3f447e={};_0x3f447e[_0x301731[0x0]]={'$gte':moment(_0x301731[0x1])['format'](_0x5e1c('0x9a'))};_0x378c47[_0x5e1c('0x49')]=_['merge'](_0x378c47[_0x5e1c('0x49')],_0x3f447e);}_0x378c47=_[_0x5e1c('0x4a')]({},_0x378c47,_0x2f1535['options']);return db['FaxMessage']['count']({'where':_0x378c47[_0x5e1c('0x49')]})['then'](function(_0x16e532){_0x4ba9f9[_0x5e1c('0x29')]=_0x16e532;if(_0x2f1535[_0x5e1c('0x3d')]['includeAll']){_0x378c47[_0x5e1c('0x4d')]=[{'all':!![]}];}return db[_0x5e1c('0x9b')][_0x5e1c('0x4e')](_0x378c47);})[_0x5e1c('0x1a')](function(_0x48fed8){_0x4ba9f9['rows']=_0x48fed8;return _0x4ba9f9;});}})[_0x5e1c('0x1a')](respondWithFilteredResult(_0x5b65ed,_0x378c47))[_0x5e1c('0x22')](handleError(_0x5b65ed,null));};exports['send']=function(_0x469d97,_0x4b203a,_0x4e65de){var _0x1021fa,_0x54c1fb={},_0x4ced2b;if(_0x469d97[_0x5e1c('0x56')]['to']){_0x4ced2b=_0x469d97[_0x5e1c('0x56')]['to'][0x0];}return db[_0x5e1c('0x4c')]['find']({'where':{'id':_0x469d97[_0x5e1c('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x5e1c('0x9c'),'include':[{'model':db[_0x5e1c('0x6d')],'as':_0x5e1c('0x9d'),'where':{'fax':_0x4ced2b},'limit':0x1,'order':[[_0x5e1c('0x95'),_0x5e1c('0x9e')]]}]}]})[_0x5e1c('0x1a')](handleEntityNotFound(_0x4b203a,null))['then'](function(_0xede06e){_0x1021fa=_0xede06e;if(_0x469d97[_0x5e1c('0x56')]['attachments']&&_0x469d97['body'][_0x5e1c('0x9f')][_0x5e1c('0x43')]){for(var _0x369768=0x0;_0x369768<_0x469d97[_0x5e1c('0x56')]['attachments'][_0x5e1c('0x43')];_0x369768+=0x1){_0x469d97['body']['attachments'][_0x369768]={'filename':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][_0x369768][_0x5e1c('0x33')],'id':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][_0x369768]['id'],'path':path[_0x5e1c('0xa0')](config[_0x5e1c('0xa1')],_0x5e1c('0xa2'),_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][_0x369768][_0x5e1c('0xa3')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x469d97[_0x5e1c('0x51')]['id'])?undefined:_0x469d97[_0x5e1c('0x51')]['id'],'path':_[_0x5e1c('0xa4')](_0x469d97['body']['attachments'][0x0][_0x5e1c('0xa5')])?undefined:_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0][_0x5e1c('0xa5')],'fax':_[_0x5e1c('0xa4')](_0x469d97[_0x5e1c('0x56')]['to'][0x0])?undefined:_0x469d97[_0x5e1c('0x56')]['to'][0x0]},client9002);})[_0x5e1c('0x1a')](function(){if(_0x1021fa){if(_[_0x5e1c('0xa4')](_0x469d97[_0x5e1c('0x56')][_0x5e1c('0xa6')])){_0x469d97['body'][_0x5e1c('0xa6')]=util[_0x5e1c('0xa7')](_0x5e1c('0xa8'),_0x1021fa['name'],_0x1021fa['fax']);}if(_0x1021fa[_0x5e1c('0x9c')]){if(_0x1021fa['List'][_0x5e1c('0x9d')][_0x5e1c('0x43')]){return _0x1021fa[_0x5e1c('0x9c')][_0x5e1c('0x9d')][0x0];}else{return db[_0x5e1c('0x6d')]['create'](_['defaults'](_0x469d97['body'],{'firstName':_0x469d97[_0x5e1c('0x56')]['to'][0x0],'phone':_0x469d97['body']['to'][0x0],'fax':_0x469d97[_0x5e1c('0x56')]['to'][0x0],'ListId':_0x1021fa[_0x5e1c('0xa9')]}));}}else{throw new Error(_0x5e1c('0xaa'));}}else{throw new Error(_0x5e1c('0xab'));}})['then'](function(_0x760a1a){if(_0x760a1a){return db['FaxInteraction'][_0x5e1c('0x54')]({'where':{'ContactId':_0x760a1a['id'],'closed':![],'FaxAccountId':_0x1021fa['id']}})['then'](function(_0x37a2b4){if(_0x37a2b4){return[_0x37a2b4,![]];}return db[_0x5e1c('0x69')][_0x5e1c('0x55')]({'UserId':_0x469d97[_0x5e1c('0x57')]['id'],'ContactId':_0x760a1a['id'],'FaxAccountId':_0x1021fa['id'],'fax':_0x469d97[_0x5e1c('0x56')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x5e1c('0x4a')](_0x469d97[_0x5e1c('0x56')],{'read':![],'body':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0][_0x5e1c('0xac')],'FaxAccountId':_0x1021fa['id'],'UserId':_0x469d97[_0x5e1c('0x57')]['id'],'ContactId':_0x760a1a['id'],'AttachmentId':_0x469d97['body'][_0x5e1c('0x9f')][0x0]['id']})]},{'include':[{'model':db[_0x5e1c('0x9b')],'as':_0x5e1c('0xad')}]})['then'](function(_0x580f76){return[_0x580f76,!![]];});});}else{throw new Error(_0x5e1c('0xae'));}})[_0x5e1c('0xaf')](function(_0x537f30,_0x43df57){if(_0x43df57){return _0x537f30;}return db[_0x5e1c('0x9b')][_0x5e1c('0x55')]({'direction':_0x5e1c('0xb0'),'read':![],'body':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0]['filename'],'FaxAccountId':_0x1021fa['id'],'FaxInteractionId':_0x537f30['id'],'UserId':_0x469d97[_0x5e1c('0x57')]['id'],'ContactId':_0x537f30[_0x5e1c('0xb1')],'AttachmentId':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0]['id']})['then'](function(_0x4d190e){_0x537f30[_0x5e1c('0xb2')][_0x5e1c('0xad')]=[];_0x537f30[_0x5e1c('0xb2')]['Messages'][_0x5e1c('0x85')](_0x4d190e[_0x5e1c('0xb2')]);return _0x537f30;});})[_0x5e1c('0x1a')](function(_0x1e6ea3){respondWithRpcPromise('SendFax',_0x5e1c('0xb3'),{'FaxAccountId':_['isNil'](_0x469d97[_0x5e1c('0x51')]['id'])?undefined:_0x469d97['params']['id'],'path':_['isNil'](_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0][_0x5e1c('0xa5')])?undefined:_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0]['path'],'fax':_[_0x5e1c('0xa4')](_0x469d97[_0x5e1c('0x56')]['to'][0x0])?undefined:_0x469d97['body']['to'][0x0],'AttachmentId':_0x469d97[_0x5e1c('0x56')][_0x5e1c('0x9f')][0x0]['id']},client9002)[_0x5e1c('0x1a')](function(_0x20ea4d){logger[_0x5e1c('0x1b')](_0x5e1c('0xb4'),_0x20ea4d);})[_0x5e1c('0x22')](function(_0x5b0c41){logger[_0x5e1c('0x1b')](_0x5e1c('0xb4'),_0x5b0c41);});return _0x1e6ea3;})[_0x5e1c('0x1a')](respondWithResult(_0x4b203a,null))['catch'](handleError(_0x4b203a,null));};exports[_0x5e1c('0xb5')]=function(_0xb3e96a,_0x2f786c,_0x540a0e){return db[_0x5e1c('0x4c')][_0x5e1c('0x54')]({'where':{'id':_0xb3e96a['params']['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x2f786c,null))['then'](function(_0x34c4d6){if(_0x34c4d6){return _0x34c4d6['addAgents'](_0xb3e96a[_0x5e1c('0x56')][_0x5e1c('0x64')],_['omit'](_0xb3e96a['body'],[_0x5e1c('0x64'),'id'])||{})[_0x5e1c('0xaf')](function(_0x155f73){for(var _0x4cf775=0x0;_0x4cf775<_0xb3e96a[_0x5e1c('0x56')][_0x5e1c('0x64')][_0x5e1c('0x43')];_0x4cf775+=0x1){socket['emit'](_0x5e1c('0xb6'),{'UserId':Number(_0xb3e96a['body'][_0x5e1c('0x64')][_0x4cf775]),'FaxAccountId':Number(_0xb3e96a[_0x5e1c('0x51')]['id'])});}return _0x155f73;});}})[_0x5e1c('0x1a')](respondWithResult(_0x2f786c,null))[_0x5e1c('0x22')](handleError(_0x2f786c,null));};exports[_0x5e1c('0xb7')]=function(_0x51b0ad,_0x191b89,_0x1ada7e){return db[_0x5e1c('0x4c')][_0x5e1c('0x54')]({'where':{'id':_0x51b0ad[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x191b89,null))[_0x5e1c('0x1a')](function(_0x36adca){if(_0x36adca){return _0x36adca[_0x5e1c('0xb7')](_0x51b0ad[_0x5e1c('0x3d')]['ids'])[_0x5e1c('0x1a')](function(){if(_[_0x5e1c('0xb8')](_0x51b0ad[_0x5e1c('0x3d')]['ids'])){for(var _0x68bc3a=0x0;_0x68bc3a<_0x51b0ad[_0x5e1c('0x3d')][_0x5e1c('0x64')][_0x5e1c('0x43')];_0x68bc3a+=0x1){socket[_0x5e1c('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x51b0ad['query'][_0x5e1c('0x64')][_0x68bc3a]),'FaxAccountId':Number(_0x51b0ad['params']['id'])});}}else{socket['emit'](_0x5e1c('0xba'),{'UserId':Number(_0x51b0ad['query'][_0x5e1c('0x64')]),'FaxAccountId':Number(_0x51b0ad['params']['id'])});}});}})['then'](respondWithStatusCode(_0x191b89,null))[_0x5e1c('0x22')](handleError(_0x191b89,null));};exports[_0x5e1c('0xbb')]=function(_0x550da8,_0x298de7,_0x17aa17){var _0x3ce015={};var _0x4afbe2={};var _0x33534a;var _0x2b89ca;return db[_0x5e1c('0x4c')][_0x5e1c('0x61')]({'where':{'id':_0x550da8[_0x5e1c('0x51')]['id']}})[_0x5e1c('0x1a')](handleEntityNotFound(_0x298de7,null))[_0x5e1c('0x1a')](function(_0x322c0c){if(_0x322c0c){_0x33534a=_0x322c0c;_0x4afbe2['model']=_[_0x5e1c('0x3e')](db[_0x5e1c('0x6e')]['rawAttributes']);_0x4afbe2[_0x5e1c('0x3d')]=_[_0x5e1c('0x3e')](_0x550da8[_0x5e1c('0x3d')]);_0x4afbe2[_0x5e1c('0x3f')]=_['intersection'](_0x4afbe2[_0x5e1c('0x3c')],_0x4afbe2[_0x5e1c('0x3d')]);_0x3ce015[_0x5e1c('0x41')]=_[_0x5e1c('0x40')](_0x4afbe2[_0x5e1c('0x3c')],qs[_0x5e1c('0x42')](_0x550da8['query'][_0x5e1c('0x42')]));_0x3ce015[_0x5e1c('0x41')]=_0x3ce015['attributes'][_0x5e1c('0x43')]?_0x3ce015[_0x5e1c('0x41')]:_0x4afbe2[_0x5e1c('0x3c')];_0x3ce015['order']=qs['sort'](_0x550da8[_0x5e1c('0x3d')]['sort']);_0x3ce015[_0x5e1c('0x49')]=qs[_0x5e1c('0x3f')](_['pick'](_0x550da8[_0x5e1c('0x3d')],_0x4afbe2[_0x5e1c('0x3f')]));if(_0x550da8[_0x5e1c('0x3d')][_0x5e1c('0x48')]){_0x3ce015['where']=_[_0x5e1c('0x4a')](_0x3ce015['where'],{'$or':_['map'](_0x3ce015[_0x5e1c('0x41')],function(_0x126c0b){var _0x41d78d={};_0x41d78d[_0x126c0b]={'$like':'%'+_0x550da8[_0x5e1c('0x3d')][_0x5e1c('0x48')]+'%'};return _0x41d78d;})});}_0x3ce015=_['merge']({},_0x3ce015,_0x550da8['options']);return _0x33534a['getAgents'](_0x3ce015);}})[_0x5e1c('0x1a')](function(_0x36fed0){if(_0x36fed0){_0x2b89ca=_0x36fed0['length'];if(!_0x550da8['query'][_0x5e1c('0x44')]('nolimit')){_0x3ce015[_0x5e1c('0x27')]=qs[_0x5e1c('0x27')](_0x550da8[_0x5e1c('0x3d')][_0x5e1c('0x27')]);_0x3ce015['offset']=qs['offset'](_0x550da8[_0x5e1c('0x3d')][_0x5e1c('0x26')]);}return _0x33534a[_0x5e1c('0xbb')](_0x3ce015);}})[_0x5e1c('0x1a')](function(_0x3fa24a){if(_0x3fa24a){return _0x3fa24a?{'count':_0x2b89ca,'rows':_0x3fa24a}:null;}})['then'](respondWithResult(_0x298de7,null))[_0x5e1c('0x22')](handleError(_0x298de7,null));};
\ No newline at end of file
+var _0x699d=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','Pause','keys','length','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','params','FaxAccountId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','stack','finally','json','getApplications','context','from-voip-provider','exten','localstationid','system','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','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','transaction','VoiceExtension','updateAccountApplications','tech','updatedAt','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x35de8a,_0x7acd4b){var _0x9c759d=function(_0x1fc3d3){while(--_0x1fc3d3){_0x35de8a['push'](_0x35de8a['shift']());}};_0x9c759d(++_0x7acd4b);}(_0x699d,0x13c));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd699('0x0'));var jsonpatch=require(_0xd699('0x1'));var rp=require('request-promise');var moment=require(_0xd699('0x2'));var BPromise=require(_0xd699('0x3'));var Mustache=require(_0xd699('0x4'));var util=require(_0xd699('0x5'));var path=require(_0xd699('0x6'));var sox=require('sox');var csv=require(_0xd699('0x7'));var ejs=require(_0xd699('0x8'));var fs=require('fs');var fs_extra=require(_0xd699('0x9'));var _=require(_0xd699('0xa'));var squel=require(_0xd699('0xb'));var crypto=require(_0xd699('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd699('0xd'));var toCsv=require(_0xd699('0x7'));var querystring=require(_0xd699('0xe'));var Papa=require(_0xd699('0xf'));var Redis=require('ioredis');var authService=require(_0xd699('0x10'));var qs=require(_0xd699('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd699('0x12'));var logger=require('../../config/logger')(_0xd699('0x13'));var utils=require(_0xd699('0x14'));var config=require(_0xd699('0x15'));var licenseUtil=require(_0xd699('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd699('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd699('0x18')]));require(_0xd699('0x19'))[_0xd699('0x1a')](socket);var jayson=require(_0xd699('0x1b'));var client=jayson[_0xd699('0x1c')][_0xd699('0x1d')]({'port':0x232c});var client9002=jayson[_0xd699('0x1c')][_0xd699('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x22d0e8,_0x20243a,_0x1c4b5a,_0x3b7f90){return new BPromise(function(_0x116df4,_0x4e5163){var _0x45d086=_0x3b7f90||client;return _0x45d086[_0xd699('0x1e')](_0x22d0e8,_0x1c4b5a)['then'](function(_0x1919b1){logger[_0xd699('0x1f')](_0xd699('0x20'),_0x20243a,_0xd699('0x21'));logger[_0xd699('0x22')](_0xd699('0x23'),_0x20243a,_0xd699('0x21'),JSON[_0xd699('0x24')](_0x1919b1));if(_0x1919b1['error']){if(_0x1919b1[_0xd699('0x25')][_0xd699('0x26')]===0x1f4){logger[_0xd699('0x25')](_0xd699('0x20'),_0x20243a,_0x1919b1[_0xd699('0x25')][_0xd699('0x27')]);return _0x4e5163(_0x1919b1[_0xd699('0x25')][_0xd699('0x27')]);}logger[_0xd699('0x25')](_0xd699('0x20'),_0x20243a,_0x1919b1[_0xd699('0x25')][_0xd699('0x27')]);return _0x116df4(_0x1919b1[_0xd699('0x25')][_0xd699('0x27')]);}else{logger[_0xd699('0x1f')](_0xd699('0x20'),_0x20243a,_0xd699('0x21'));_0x116df4(_0x1919b1[_0xd699('0x28')][_0xd699('0x27')]);}})[_0xd699('0x29')](function(_0x3b356e){logger['error'](_0xd699('0x20'),_0x20243a,_0x3b356e);_0x4e5163(_0x3b356e);});});}function respondWithStatusCode(_0x33a43e,_0x1e06aa){_0x1e06aa=_0x1e06aa||0xcc;return function(_0xb68614){if(_0xb68614){return _0x33a43e['sendStatus'](_0x1e06aa);}return _0x33a43e[_0xd699('0x2a')](_0x1e06aa)[_0xd699('0x2b')]();};}function respondWithResult(_0x139bb8,_0x26745d){_0x26745d=_0x26745d||0xc8;return function(_0x57e7b2){if(_0x57e7b2){return _0x139bb8[_0xd699('0x2a')](_0x26745d)['json'](_0x57e7b2);}};}function respondWithFilteredResult(_0x5680db,_0x2f61c0){return function(_0x29cef7){if(_0x29cef7){var _0x3a23cd=typeof _0x2f61c0[_0xd699('0x2c')]==='undefined'&&typeof _0x2f61c0[_0xd699('0x2d')]==='undefined';var _0x14cefb=_0x29cef7['count'];var _0x2ae88a=_0x3a23cd?0x0:_0x2f61c0[_0xd699('0x2c')];var _0x1930b5=_0x3a23cd?_0x29cef7[_0xd699('0x2e')]:_0x2f61c0[_0xd699('0x2c')]+_0x2f61c0[_0xd699('0x2d')];var _0x4e216c;if(_0x1930b5>=_0x14cefb){_0x1930b5=_0x14cefb;_0x4e216c=0xc8;}else{_0x4e216c=0xce;}_0x5680db[_0xd699('0x2a')](_0x4e216c);return _0x5680db['set'](_0xd699('0x2f'),_0x2ae88a+'-'+_0x1930b5+'/'+_0x14cefb)['json'](_0x29cef7);}return null;};}function patchUpdates(_0x141f87){return function(_0x49c811){try{jsonpatch[_0xd699('0x30')](_0x49c811,_0x141f87,!![]);}catch(_0x34aca4){return BPromise[_0xd699('0x31')](_0x34aca4);}return _0x49c811[_0xd699('0x32')]();};}function saveUpdates(_0x19d520,_0x5c07d5){return function(_0xfa63f0){if(_0xfa63f0){return _0xfa63f0[_0xd699('0x33')](_0x19d520)['then'](function(_0x639994){return _0x639994;});}return null;};}function removeEntity(_0x58a963,_0x575e61){return function(_0x31a0d1){if(_0x31a0d1){return _0x31a0d1[_0xd699('0x34')]()[_0xd699('0x35')](function(){var _0x160117=_0x31a0d1[_0xd699('0x36')]({'plain':!![]});var _0x523ff5=_0xd699('0x37');return db[_0xd699('0x38')]['destroy']({'where':{'type':_0x523ff5,'resourceId':_0x160117['id']}})[_0xd699('0x35')](function(){return _0x31a0d1;});})['then'](function(){_0x58a963[_0xd699('0x2a')](0xcc)[_0xd699('0x2b')]();});}};}function handleEntityNotFound(_0x32bdf0,_0x1dad80){return function(_0x130774){if(!_0x130774){_0x32bdf0[_0xd699('0x39')](0x194);}return _0x130774;};}function handleError(_0x27831b,_0xdbaf7){_0xdbaf7=_0xdbaf7||0x1f4;return function(_0x374e11){logger[_0xd699('0x25')](_0x374e11['stack']);if(_0x374e11[_0xd699('0x3a')]){delete _0x374e11['name'];}_0x27831b[_0xd699('0x2a')](_0xdbaf7)[_0xd699('0x3b')](_0x374e11);};}exports[_0xd699('0x3c')]=function(_0x5c2e61,_0x356ed8){var _0x4f0e39={'include':[{'model':db['Pause'],'as':_0xd699('0x3d')}]},_0x132eb4={},_0x5b8732={'count':0x0,'rows':[]};var _0x10fffb=_[_0xd699('0x3e')](db[_0xd699('0x3f')][_0xd699('0x40')],function(_0x4a42b2){return{'name':_0x4a42b2['fieldName'],'type':_0x4a42b2[_0xd699('0x41')][_0xd699('0x42')]};});_0x132eb4['model']=_[_0xd699('0x3e')](_0x10fffb,_0xd699('0x3a'));_0x132eb4[_0xd699('0x43')]=_['keys'](_0x5c2e61[_0xd699('0x43')]);_0x132eb4[_0xd699('0x44')]=_[_0xd699('0x45')](_0x132eb4[_0xd699('0x46')],_0x132eb4[_0xd699('0x43')]);_0x4f0e39[_0xd699('0x47')]=_[_0xd699('0x45')](_0x132eb4[_0xd699('0x46')],qs[_0xd699('0x48')](_0x5c2e61[_0xd699('0x43')][_0xd699('0x48')]));_0x4f0e39['attributes']=_0x4f0e39[_0xd699('0x47')]['length']?_0x4f0e39[_0xd699('0x47')]:_0x132eb4['model'];if(!_0x5c2e61[_0xd699('0x43')][_0xd699('0x49')](_0xd699('0x4a'))){_0x4f0e39[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x5c2e61[_0xd699('0x43')][_0xd699('0x2d')]);_0x4f0e39[_0xd699('0x2c')]=qs[_0xd699('0x2c')](_0x5c2e61['query'][_0xd699('0x2c')]);}_0x4f0e39[_0xd699('0x4b')]=qs['sort'](_0x5c2e61[_0xd699('0x43')][_0xd699('0x4c')]);_0x4f0e39[_0xd699('0x4d')]=qs[_0xd699('0x44')](_[_0xd699('0x4e')](_0x5c2e61['query'],_0x132eb4['filters']),_0x10fffb);if(_0x5c2e61['query'][_0xd699('0x4f')]){_0x4f0e39[_0xd699('0x4d')]=_[_0xd699('0x50')](_0x4f0e39[_0xd699('0x4d')],{'$or':_[_0xd699('0x3e')](_0x10fffb,function(_0x304dc6){if(_0x304dc6[_0xd699('0x41')]!==_0xd699('0x51')){var _0x38c33c={};_0x38c33c[_0x304dc6[_0xd699('0x3a')]]={'$like':'%'+_0x5c2e61[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x38c33c;}})});}_0x4f0e39=_['merge']({},_0x4f0e39,_0x5c2e61[_0xd699('0x52')]);var _0x39a119={'where':_0x4f0e39[_0xd699('0x4d')]};return db[_0xd699('0x3f')][_0xd699('0x2e')](_0x39a119)['then'](function(_0x335c7e){_0x5b8732[_0xd699('0x2e')]=_0x335c7e;if(_0x5c2e61[_0xd699('0x43')][_0xd699('0x53')]){_0x4f0e39['include']=[{'all':!![]}];}return db[_0xd699('0x3f')][_0xd699('0x54')](_0x4f0e39);})[_0xd699('0x35')](function(_0x5033da){_0x5b8732[_0xd699('0x55')]=_0x5033da;return _0x5b8732;})[_0xd699('0x35')](respondWithFilteredResult(_0x356ed8,_0x4f0e39))[_0xd699('0x29')](handleError(_0x356ed8,null));};exports['show']=function(_0x26ef15,_0x5e8943){var _0x23369d={'raw':![],'where':{'id':_0x26ef15['params']['id']},'include':[{'model':db[_0xd699('0x56')],'as':_0xd699('0x3d')}]},_0x12f36b={};_0x12f36b[_0xd699('0x46')]=_[_0xd699('0x57')](db[_0xd699('0x3f')][_0xd699('0x40')]);_0x12f36b[_0xd699('0x43')]=_[_0xd699('0x57')](_0x26ef15[_0xd699('0x43')]);_0x12f36b[_0xd699('0x44')]=_['intersection'](_0x12f36b['model'],_0x12f36b['query']);_0x23369d[_0xd699('0x47')]=_[_0xd699('0x45')](_0x12f36b['model'],qs[_0xd699('0x48')](_0x26ef15[_0xd699('0x43')][_0xd699('0x48')]));_0x23369d[_0xd699('0x47')]=_0x23369d[_0xd699('0x47')][_0xd699('0x58')]?_0x23369d[_0xd699('0x47')]:_0x12f36b['model'];if(_0x26ef15[_0xd699('0x43')][_0xd699('0x53')]){_0x23369d[_0xd699('0x59')]=[{'all':!![]}];}_0x23369d=_[_0xd699('0x50')]({},_0x23369d,_0x26ef15[_0xd699('0x52')]);return db[_0xd699('0x3f')]['find'](_0x23369d)[_0xd699('0x35')](handleEntityNotFound(_0x5e8943,null))[_0xd699('0x35')](respondWithResult(_0x5e8943,null))['catch'](handleError(_0x5e8943,null));};exports[_0xd699('0x5a')]=function(_0x47c726,_0x427b11){return db['FaxAccount'][_0xd699('0x5a')](_0x47c726['body'],{})[_0xd699('0x35')](function(_0x1d2716){var _0x3128e4=_0x47c726['user'][_0xd699('0x36')]({'plain':!![]});if(!_0x3128e4)throw new Error(_0xd699('0x5b'));if(_0x3128e4[_0xd699('0x5c')]===_0xd699('0x5d')){var _0x16b2fe=_0x1d2716[_0xd699('0x36')]({'plain':!![]});var _0x5453f5=_0xd699('0x37');return db[_0xd699('0x5e')]['find']({'where':{'name':_0x5453f5,'userProfileId':_0x3128e4['userProfileId']},'raw':!![]})[_0xd699('0x35')](function(_0x136219){if(_0x136219&&_0x136219[_0xd699('0x5f')]===0x0){return db[_0xd699('0x38')]['create']({'name':_0x16b2fe[_0xd699('0x3a')],'resourceId':_0x16b2fe['id'],'type':_0x136219[_0xd699('0x3a')],'sectionId':_0x136219['id']},{})[_0xd699('0x35')](function(){return _0x1d2716;});}else{return _0x1d2716;}})[_0xd699('0x29')](function(_0x11a508){logger[_0xd699('0x25')](_0xd699('0x60'),_0x11a508);throw _0x11a508;});}return _0x1d2716;})[_0xd699('0x35')](respondWithResult(_0x427b11,0xc9))[_0xd699('0x29')](handleError(_0x427b11,null));};exports[_0xd699('0x33')]=function(_0x855899,_0x3bd154){if(_0x855899[_0xd699('0x61')]['id']){delete _0x855899['body']['id'];}return db['FaxAccount'][_0xd699('0x62')]({'where':{'id':_0x855899['params']['id']},'include':[{'model':db[_0xd699('0x56')],'as':_0xd699('0x3d')}]})[_0xd699('0x35')](handleEntityNotFound(_0x3bd154,null))[_0xd699('0x35')](saveUpdates(_0x855899[_0xd699('0x61')],null))[_0xd699('0x35')](respondWithResult(_0x3bd154,null))[_0xd699('0x29')](handleError(_0x3bd154,null));};exports[_0xd699('0x34')]=function(_0x4112c8,_0x10cb90){return db[_0xd699('0x3f')][_0xd699('0x62')]({'where':{'id':_0x4112c8['params']['id']}})['then'](handleEntityNotFound(_0x10cb90,null))[_0xd699('0x35')](removeEntity(_0x10cb90,null))[_0xd699('0x29')](handleError(_0x10cb90,null));};exports['describe']=function(_0x518542,_0xb00d1e){return db['FaxAccount'][_0xd699('0x63')]()[_0xd699('0x35')](respondWithResult(_0xb00d1e,null))[_0xd699('0x29')](handleError(_0xb00d1e,null));};exports[_0xd699('0x64')]=function(_0x132336,_0x59411f,_0x54aeb8){if(_0x132336[_0xd699('0x61')]['id']){delete _0x132336[_0xd699('0x61')]['id'];}return db[_0xd699('0x3f')][_0xd699('0x62')]({'where':{'id':_0x132336[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x59411f,null))[_0xd699('0x35')](function(_0x439da3){if(_0x439da3){_0x132336[_0xd699('0x61')][_0xd699('0x66')]=_0x439da3['id'];return db['Disposition']['create'](_0x132336[_0xd699('0x61')]);}})[_0xd699('0x35')](respondWithResult(_0x59411f,null))[_0xd699('0x29')](handleError(_0x59411f,null));};exports[_0xd699('0x67')]=function(_0x433c50,_0x5590a7,_0x5c997a){var _0x7643bf={'raw':![],'where':{}};var _0x44154e={};var _0x4da350={'count':0x0,'rows':[]};return db[_0xd699('0x3f')]['findOne']({'where':{'id':_0x433c50[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x5590a7,null))['then'](function(_0x3b4c6a){if(_0x3b4c6a){_0x44154e[_0xd699('0x46')]=_[_0xd699('0x57')](db[_0xd699('0x68')][_0xd699('0x40')]);_0x44154e[_0xd699('0x43')]=_['keys'](_0x433c50[_0xd699('0x43')]);_0x44154e[_0xd699('0x44')]=_[_0xd699('0x45')](_0x44154e[_0xd699('0x46')],_0x44154e[_0xd699('0x43')]);_0x7643bf[_0xd699('0x47')]=_[_0xd699('0x45')](_0x44154e[_0xd699('0x46')],qs[_0xd699('0x48')](_0x433c50[_0xd699('0x43')][_0xd699('0x48')]));_0x7643bf[_0xd699('0x47')]=_0x7643bf[_0xd699('0x47')][_0xd699('0x58')]?_0x7643bf['attributes']:_0x44154e[_0xd699('0x46')];if(!_0x433c50[_0xd699('0x43')][_0xd699('0x49')](_0xd699('0x4a'))){_0x7643bf[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x433c50[_0xd699('0x43')][_0xd699('0x2d')]);_0x7643bf['offset']=qs[_0xd699('0x2c')](_0x433c50[_0xd699('0x43')][_0xd699('0x2c')]);}_0x7643bf['order']=qs[_0xd699('0x4c')](_0x433c50[_0xd699('0x43')][_0xd699('0x4c')]);_0x7643bf[_0xd699('0x4d')]=qs['filters'](_[_0xd699('0x4e')](_0x433c50[_0xd699('0x43')],_0x44154e[_0xd699('0x44')]));_0x7643bf[_0xd699('0x4d')][_0xd699('0x66')]=_0x3b4c6a['id'];if(_0x433c50['query']['filter']){_0x7643bf[_0xd699('0x4d')]=_['merge'](_0x7643bf[_0xd699('0x4d')],{'$or':_[_0xd699('0x3e')](_0x7643bf[_0xd699('0x47')],function(_0x35eb02){var _0x32174b={};_0x32174b[_0x35eb02]={'$like':'%'+_0x433c50[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x32174b;})});}_0x7643bf=_[_0xd699('0x50')]({},_0x7643bf,_0x433c50[_0xd699('0x52')]);return db[_0xd699('0x68')]['count']({'where':_0x7643bf[_0xd699('0x4d')]})[_0xd699('0x35')](function(_0x330a41){_0x4da350[_0xd699('0x2e')]=_0x330a41;if(_0x433c50[_0xd699('0x43')]['includeAll']){_0x7643bf[_0xd699('0x59')]=[{'all':!![]}];}return db[_0xd699('0x68')][_0xd699('0x54')](_0x7643bf);})[_0xd699('0x35')](function(_0x36a1f0){_0x4da350['rows']=_0x36a1f0;return _0x4da350;});}})[_0xd699('0x35')](respondWithFilteredResult(_0x5590a7,_0x7643bf))['catch'](handleError(_0x5590a7,null));};exports[_0xd699('0x69')]=function(_0x1c8435,_0x234b14,_0x388e66){return db[_0xd699('0x3f')][_0xd699('0x62')]({'where':{'id':_0x1c8435[_0xd699('0x65')]['id']}})['then'](handleEntityNotFound(_0x234b14,null))[_0xd699('0x35')](function(_0x7ccf8){if(_0x7ccf8){return _0x7ccf8[_0xd699('0x69')](_0x1c8435['query'][_0xd699('0x6a')]);}})[_0xd699('0x35')](respondWithStatusCode(_0x234b14,null))[_0xd699('0x29')](handleError(_0x234b14,null));};exports[_0xd699('0x6b')]=function(_0x228cd0,_0x40c080,_0x5231cc){if(_0x228cd0[_0xd699('0x61')]['id']){delete _0x228cd0[_0xd699('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x228cd0['params']['id']}})['then'](handleEntityNotFound(_0x40c080,null))['then'](function(_0x5e3127){if(_0x5e3127){_0x228cd0[_0xd699('0x61')][_0xd699('0x66')]=_0x5e3127['id'];return db[_0xd699('0x6c')][_0xd699('0x5a')](_0x228cd0[_0xd699('0x61')]);}})[_0xd699('0x35')](respondWithResult(_0x40c080,null))[_0xd699('0x29')](handleError(_0x40c080,null));};exports['getAnswers']=function(_0x26a6c3,_0x2326de,_0x4f2cb1){var _0x456c5f={'raw':![],'where':{}};var _0x104c8b={};var _0x4467df={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd699('0x6d')]({'where':{'id':_0x26a6c3[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x2326de,null))[_0xd699('0x35')](function(_0x3e9e0c){if(_0x3e9e0c){_0x104c8b['model']=_[_0xd699('0x57')](db['CannedAnswer'][_0xd699('0x40')]);_0x104c8b[_0xd699('0x43')]=_[_0xd699('0x57')](_0x26a6c3[_0xd699('0x43')]);_0x104c8b[_0xd699('0x44')]=_[_0xd699('0x45')](_0x104c8b[_0xd699('0x46')],_0x104c8b[_0xd699('0x43')]);_0x456c5f[_0xd699('0x47')]=_[_0xd699('0x45')](_0x104c8b['model'],qs[_0xd699('0x48')](_0x26a6c3[_0xd699('0x43')]['fields']));_0x456c5f[_0xd699('0x47')]=_0x456c5f[_0xd699('0x47')][_0xd699('0x58')]?_0x456c5f['attributes']:_0x104c8b[_0xd699('0x46')];if(!_0x26a6c3['query'][_0xd699('0x49')](_0xd699('0x4a'))){_0x456c5f[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x26a6c3['query'][_0xd699('0x2d')]);_0x456c5f[_0xd699('0x2c')]=qs['offset'](_0x26a6c3['query'][_0xd699('0x2c')]);}_0x456c5f['order']=qs['sort'](_0x26a6c3[_0xd699('0x43')]['sort']);_0x456c5f[_0xd699('0x4d')]=qs[_0xd699('0x44')](_[_0xd699('0x4e')](_0x26a6c3[_0xd699('0x43')],_0x104c8b[_0xd699('0x44')]));_0x456c5f[_0xd699('0x4d')][_0xd699('0x66')]=_0x3e9e0c['id'];if(_0x26a6c3[_0xd699('0x43')][_0xd699('0x4f')]){_0x456c5f[_0xd699('0x4d')]=_['merge'](_0x456c5f['where'],{'$or':_[_0xd699('0x3e')](_0x456c5f['attributes'],function(_0x5ce263){var _0x2dfeb5={};_0x2dfeb5[_0x5ce263]={'$like':'%'+_0x26a6c3[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x2dfeb5;})});}_0x456c5f=_[_0xd699('0x50')]({},_0x456c5f,_0x26a6c3[_0xd699('0x52')]);return db[_0xd699('0x6c')][_0xd699('0x2e')]({'where':_0x456c5f[_0xd699('0x4d')]})[_0xd699('0x35')](function(_0x326381){_0x4467df[_0xd699('0x2e')]=_0x326381;if(_0x26a6c3['query'][_0xd699('0x53')]){_0x456c5f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xd699('0x54')](_0x456c5f);})[_0xd699('0x35')](function(_0x145e78){_0x4467df[_0xd699('0x55')]=_0x145e78;return _0x4467df;});}})[_0xd699('0x35')](respondWithFilteredResult(_0x2326de,_0x456c5f))[_0xd699('0x29')](handleError(_0x2326de,null));};exports[_0xd699('0x6e')]=function(_0x28fe6b,_0x18a389,_0x3c7a9a){return db['FaxAccount'][_0xd699('0x62')]({'where':{'id':_0x28fe6b[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x18a389,null))['then'](function(_0x3b81a6){if(_0x3b81a6){return _0x3b81a6[_0xd699('0x6e')](_0x28fe6b['query'][_0xd699('0x6a')]);}})['then'](respondWithStatusCode(_0x18a389,null))[_0xd699('0x29')](handleError(_0x18a389,null));};exports[_0xd699('0x6f')]=function(_0x450f68,_0x5d6d67,_0x5571d6){return db['FaxInteraction'][_0xd699('0x62')]({'where':{'id':_0x450f68[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x5d6d67,null))['then'](function(_0x50c737){if(_0x50c737){return _0x50c737[_0xd699('0x6f')](_0x450f68[_0xd699('0x61')]['ids'],_[_0xd699('0x70')](_0x450f68[_0xd699('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d6d67,null))[_0xd699('0x29')](handleError(_0x5d6d67,null));};exports[_0xd699('0x71')]=function(_0x43db1e,_0x45b7bc,_0x51320c){var _0x39f38a={'raw':![],'where':{}};var _0x2a6063={};var _0x217297={'count':0x0,'rows':[]};return db[_0xd699('0x3f')][_0xd699('0x6d')]({'where':{'id':_0x43db1e['params']['id']}})['then'](handleEntityNotFound(_0x45b7bc,null))[_0xd699('0x35')](function(_0x1bbe14){if(_0x1bbe14){_0x2a6063[_0xd699('0x46')]=_[_0xd699('0x57')](db[_0xd699('0x72')][_0xd699('0x40')]);_0x2a6063[_0xd699('0x43')]=_['keys'](_0x43db1e['query']);_0x2a6063['filters']=_[_0xd699('0x45')](_0x2a6063[_0xd699('0x46')],_0x2a6063['query']);_0x39f38a[_0xd699('0x47')]=_[_0xd699('0x45')](_0x2a6063['model'],qs[_0xd699('0x48')](_0x43db1e['query'][_0xd699('0x48')]));_0x39f38a['attributes']=_0x39f38a[_0xd699('0x47')][_0xd699('0x58')]?_0x39f38a['attributes']:_0x2a6063[_0xd699('0x46')];if(!_0x43db1e['query']['hasOwnProperty'](_0xd699('0x4a'))){_0x39f38a[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x43db1e[_0xd699('0x43')][_0xd699('0x2d')]);_0x39f38a[_0xd699('0x2c')]=qs[_0xd699('0x2c')](_0x43db1e[_0xd699('0x43')][_0xd699('0x2c')]);}_0x39f38a[_0xd699('0x4b')]=qs['sort'](_0x43db1e['query']['sort']);_0x39f38a[_0xd699('0x4d')]=qs[_0xd699('0x44')](_[_0xd699('0x4e')](_0x43db1e['query'],_0x2a6063[_0xd699('0x44')]));_0x39f38a[_0xd699('0x4d')][_0xd699('0x66')]=_0x1bbe14['id'];if(_0x43db1e['query'][_0xd699('0x4f')]){_0x39f38a[_0xd699('0x4d')]=_[_0xd699('0x50')](_0x39f38a[_0xd699('0x4d')],{'$or':_[_0xd699('0x3e')](_0x39f38a[_0xd699('0x47')],function(_0x51c530){var _0x3f9cd8={};_0x3f9cd8[_0x51c530]={'$like':'%'+_0x43db1e[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x3f9cd8;})});}_0x39f38a=_[_0xd699('0x50')]({},_0x39f38a,_0x43db1e[_0xd699('0x52')]);return db[_0xd699('0x72')][_0xd699('0x2e')]({'where':_0x39f38a[_0xd699('0x4d')]})[_0xd699('0x35')](function(_0x4de12a){_0x217297[_0xd699('0x2e')]=_0x4de12a;if(_0x43db1e[_0xd699('0x43')]['includeAll']){_0x39f38a[_0xd699('0x59')]=[{'model':db['CmContact'],'as':_0xd699('0x73'),'required':![]},{'model':db[_0xd699('0x74')],'as':_0xd699('0x75'),'attributes':['name',_0xd699('0x76'),_0xd699('0x77')],'required':![]},{'model':db[_0xd699('0x78')],'as':_0xd699('0x79'),'attributes':['id',_0xd699('0x3a'),_0xd699('0x7a')],'where':_0x43db1e[_0xd699('0x43')][_0xd699('0x7b')]?{'id':_0x43db1e[_0xd699('0x43')][_0xd699('0x7b')]}:undefined,'required':_0x43db1e[_0xd699('0x43')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0xd699('0x54')](_0x39f38a);})['then'](function(_0x167200){_0x217297['rows']=_0x167200;return _0x217297;});}})[_0xd699('0x35')](respondWithFilteredResult(_0x45b7bc,_0x39f38a))[_0xd699('0x29')](handleError(_0x45b7bc,null));};exports[_0xd699('0x7c')]=function(_0x27ee5d,_0x364454){var _0x135cfd=_0x27ee5d['params']['id'];var _0x3176c2=_0x27ee5d[_0xd699('0x61')];var _0x19f385=0xc8;var _0xc42666=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xd699('0x7d')]['Transaction'][_0xd699('0x7e')][_0xd699('0x7f')]},function(_0x1ca1e6){return db['FaxAccount'][_0xd699('0x6d')]({'where':{'id':_0x135cfd},'transaction':_0x1ca1e6})[_0xd699('0x35')](function(_0x5e3a96){if(_0x5e3a96){return db[_0xd699('0x80')][_0xd699('0x34')]({'where':{'FaxAccountId':_0x135cfd},'transaction':_0x1ca1e6})[_0xd699('0x35')](function(){var _0x2c8967=_[_0xd699('0x3e')](_0x3176c2,function(_0x11fba5){_0x11fba5['FaxAccountId']=_0x135cfd;return _0x11fba5;});return db[_0xd699('0x80')][_0xd699('0x81')](_0x2c8967,{'transaction':_0x1ca1e6});});}else{_0x19f385=0x194;_0xc42666=[];}});})[_0xd699('0x35')](function(){if(_0x19f385!==0x194){return db[_0xd699('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x135cfd},'order':'priority'})[_0xd699('0x35')](function(_0xe057b3){_0xc42666=_0xe057b3;});}})['catch'](function(_0x2aadc9){_0x19f385=0x1f4;logger[_0xd699('0x25')](_0x2aadc9[_0xd699('0x82')]);if(_0x2aadc9[_0xd699('0x3a')]){delete _0x2aadc9[_0xd699('0x3a')];}_0xc42666=_0x2aadc9;})[_0xd699('0x83')](function(){if(_0xc42666===null){_0x364454[_0xd699('0x39')](_0x19f385);}else{if(_0x19f385===0x1f4){_0x364454[_0xd699('0x2a')](_0x19f385)[_0xd699('0x3b')](_0xc42666);}else{_0x364454['status'](_0x19f385)[_0xd699('0x84')](_0xc42666);}}});};exports[_0xd699('0x85')]=function(_0x50182a,_0xda1e2d,_0x13a4e9){var _0x298328={};var _0x36c472={};var _0xdfa6f6;var _0x1d262b;return db[_0xd699('0x3f')]['findOne']({'where':{'id':_0x50182a[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0xda1e2d,null))[_0xd699('0x35')](function(_0x2657ee){if(_0x2657ee){_0xdfa6f6=_0x2657ee;_0x36c472[_0xd699('0x46')]=_[_0xd699('0x57')](db[_0xd699('0x80')][_0xd699('0x40')]);_0x36c472['query']=_['keys'](_0x50182a[_0xd699('0x43')]);_0x36c472[_0xd699('0x44')]=_[_0xd699('0x45')](_0x36c472[_0xd699('0x46')],_0x36c472[_0xd699('0x43')]);_0x298328[_0xd699('0x47')]=_[_0xd699('0x45')](_0x36c472[_0xd699('0x46')],qs[_0xd699('0x48')](_0x50182a[_0xd699('0x43')][_0xd699('0x48')]));_0x298328[_0xd699('0x47')]=_0x298328['attributes']['length']?_0x298328[_0xd699('0x47')]:_0x36c472[_0xd699('0x46')];_0x298328[_0xd699('0x4b')]=qs[_0xd699('0x4c')](_0x50182a[_0xd699('0x43')][_0xd699('0x4c')]);_0x298328['where']=qs[_0xd699('0x44')](_['pick'](_0x50182a[_0xd699('0x43')],_0x36c472[_0xd699('0x44')]));if(_0x50182a[_0xd699('0x43')]['filter']){_0x298328[_0xd699('0x4d')]=_[_0xd699('0x50')](_0x298328[_0xd699('0x4d')],{'$or':_[_0xd699('0x3e')](_0x298328['attributes'],function(_0x4ebd7a){var _0x52c82c={};_0x52c82c[_0x4ebd7a]={'$like':'%'+_0x50182a[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x52c82c;})});}_0x298328=_[_0xd699('0x50')]({},_0x298328,_0x50182a[_0xd699('0x52')]);return _0xdfa6f6[_0xd699('0x85')](_0x298328);}})[_0xd699('0x35')](function(_0x504bf0){if(_0x504bf0){_0x1d262b=_0x504bf0[_0xd699('0x58')];if(!_0x50182a[_0xd699('0x43')]['hasOwnProperty'](_0xd699('0x4a'))){_0x298328[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x50182a['query'][_0xd699('0x2d')]);_0x298328[_0xd699('0x2c')]=qs[_0xd699('0x2c')](_0x50182a['query'][_0xd699('0x2c')]);}return _0xdfa6f6[_0xd699('0x85')](_0x298328);}})[_0xd699('0x35')](function(_0x3228c9){if(_0x3228c9){return _0x3228c9?{'count':_0x1d262b,'rows':_0x3228c9}:null;}})[_0xd699('0x35')](respondWithResult(_0xda1e2d,null))[_0xd699('0x29')](handleError(_0xda1e2d,null));};function Extension(_0x2eb8c8,_0xb0456d,_0x2c8095,_0x21a893){this[_0xd699('0x86')]=_0xd699('0x87');this[_0xd699('0x88')]=_0x2eb8c8[_0xd699('0x89')];this['app']=_0x21a893;this[_0xd699('0x41')]=_0xd699('0x8a');this['description']=_0xd699('0x8b');this[_0xd699('0x66')]=_0x2eb8c8['id'];this[_0xd699('0x8c')]=_0xb0456d;this[_0xd699('0x8d')]=_0x2c8095;}function createExtensionsReciveFax(_0x377594){var _0xaff888=0x1;var _0x427141=[];_0x427141[_0xd699('0x8e')](new Extension(_0x377594,_0xaff888,'',_0xd699('0x8f')));_0xaff888+=0x1;_0x427141[_0xd699('0x8e')](new Extension(_0x377594,_0xaff888,'CDR(type)=inbound-fax',_0xd699('0x90')));_0xaff888+=0x1;for(var _0x24d6b3 in _0x377594){if(_0x377594[_0xd699('0x49')](_0x24d6b3)&&(_0x24d6b3===_0xd699('0x91')||_0x24d6b3===_0xd699('0x89')||_0x24d6b3===_0xd699('0x92')||_0x24d6b3===_0xd699('0x93')||_0x24d6b3===_0xd699('0x94')||_0x24d6b3===_0xd699('0x95')||_0x24d6b3===_0xd699('0x96')||_0x24d6b3===_0xd699('0x97')||_0x24d6b3===_0xd699('0x98'))){_0x427141[_0xd699('0x8e')](new Extension(_0x377594,_0xaff888,'FAXOPT('+_0x24d6b3+')='+_0x377594[_0x24d6b3],_0xd699('0x90')));_0xaff888+=0x1;}}_0x427141[_0xd699('0x8e')](new Extension(_0x377594,_0xaff888,'6',_0xd699('0x99')));_0xaff888+=0x1;_0x427141['push'](new Extension(_0x377594,_0xaff888,_0xd699('0x9a'),_0xd699('0x9b')));_0xaff888=0x0;return _0x427141;}exports[_0xd699('0x9c')]=function(_0x32d2ad,_0x345ae8,_0x33044d){var _0x5ca129;return db[_0xd699('0x7d')][_0xd699('0x9d')](function(_0x3876c6){return db[_0xd699('0x3f')]['create'](_0x32d2ad[_0xd699('0x61')],{'transaction':_0x3876c6})[_0xd699('0x35')](function(_0x458f2d){_0x5ca129=_0x458f2d['get']({'plain':!![]});return db[_0xd699('0x9e')][_0xd699('0x81')](createExtensionsReciveFax(_0x5ca129),{'transaction':_0x3876c6});});})[_0xd699('0x35')](function(){return _0x5ca129;})[_0xd699('0x35')](respondWithResult(_0x345ae8,null))[_0xd699('0x29')](handleError(_0x345ae8,null));};exports[_0xd699('0x9f')]=function(_0x2292ea,_0x21a69d,_0x52e4e7){var _0x3f81d8;return db[_0xd699('0x7d')]['transaction'](function(_0x2e22b6){return db[_0xd699('0x3f')][_0xd699('0x33')](_0x2292ea[_0xd699('0x61')],{'where':{'id':_0x2292ea[_0xd699('0x61')]['id']},'transaction':_0x2e22b6})[_0xd699('0x35')](function(_0x366c89){return db[_0xd699('0x9e')]['destroy']({'where':{'FaxAccountId':_0x2292ea[_0xd699('0x61')]['id']},'transaction':_0x2e22b6})[_0xd699('0x35')](function(_0x439cc6){return db[_0xd699('0x9e')]['bulkCreate'](createExtensionsReciveFax(_[_0xd699('0x70')](_0x2292ea['body'],[_0xd699('0xa0'),_0xd699('0x42'),'createdAt',_0xd699('0xa1'),'TrunkId',_0xd699('0xa2')])),{'transaction':_0x2e22b6});});});})[_0xd699('0x35')](function(){return db['FaxAccount'][_0xd699('0xa3')](_0x2292ea[_0xd699('0x61')]['id']);})[_0xd699('0x35')](respondWithResult(_0x21a69d,null))[_0xd699('0x29')](handleError(_0x21a69d,null));};exports['getMessages']=function(_0x4838af,_0x5d1636,_0x369695){var _0x4e8572={'raw':!![],'where':{}};var _0x50bae7={};var _0x32034b={'count':0x0,'rows':[]};return db[_0xd699('0x3f')][_0xd699('0x6d')]({'where':{'id':_0x4838af[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x5d1636,null))[_0xd699('0x35')](function(_0x253571){if(_0x253571){_0x50bae7[_0xd699('0x46')]=_[_0xd699('0x57')](db[_0xd699('0xa4')][_0xd699('0x40')]);_0x50bae7[_0xd699('0x43')]=_[_0xd699('0x57')](_0x4838af['query']);_0x50bae7['filters']=_['intersection'](_0x50bae7[_0xd699('0x46')],_0x50bae7[_0xd699('0x43')]);_0x4e8572['attributes']=_['intersection'](_0x50bae7[_0xd699('0x46')],qs[_0xd699('0x48')](_0x4838af['query'][_0xd699('0x48')]));_0x4e8572['attributes']=_0x4e8572[_0xd699('0x47')]['length']?_0x4e8572['attributes']:_0x50bae7[_0xd699('0x46')];if(!_0x4838af[_0xd699('0x43')][_0xd699('0x49')](_0xd699('0x4a'))){_0x4e8572[_0xd699('0x2d')]=qs[_0xd699('0x2d')](_0x4838af[_0xd699('0x43')]['limit']);_0x4e8572[_0xd699('0x2c')]=qs['offset'](_0x4838af['query']['offset']);}_0x4e8572[_0xd699('0x4b')]=qs[_0xd699('0x4c')](_0x4838af[_0xd699('0x43')][_0xd699('0x4c')]);_0x4e8572[_0xd699('0x4d')]=qs[_0xd699('0x44')](_[_0xd699('0x4e')](_0x4838af[_0xd699('0x43')],_0x50bae7['filters']));_0x4e8572[_0xd699('0x4d')][_0xd699('0x66')]=_0x253571['id'];if(_0x4838af[_0xd699('0x43')][_0xd699('0x4f')]){_0x4e8572[_0xd699('0x4d')]=_[_0xd699('0x50')](_0x4e8572[_0xd699('0x4d')],{'$or':_[_0xd699('0x3e')](_0x4e8572[_0xd699('0x47')],function(_0x59c789){var _0x1e2149={};_0x1e2149[_0x59c789]={'$like':'%'+_0x4838af[_0xd699('0x43')]['filter']+'%'};return _0x1e2149;})});}if(_0x4838af[_0xd699('0x43')][_0xd699('0xa5')]){var _0x24e127=_0x4838af[_0xd699('0x43')][_0xd699('0xa5')]['split'](',');var _0xc5870d={};_0xc5870d[_0x24e127[0x0]]={'$gte':moment(_0x24e127[0x1])[_0xd699('0xa6')](_0xd699('0xa7'))};_0x4e8572[_0xd699('0x4d')]=_['merge'](_0x4e8572[_0xd699('0x4d')],_0xc5870d);}_0x4e8572=_[_0xd699('0x50')]({},_0x4e8572,_0x4838af[_0xd699('0x52')]);return db['FaxMessage']['count']({'where':_0x4e8572[_0xd699('0x4d')]})['then'](function(_0x3674e4){_0x32034b[_0xd699('0x2e')]=_0x3674e4;if(_0x4838af['query'][_0xd699('0x53')]){_0x4e8572[_0xd699('0x59')]=[{'all':!![]}];}return db[_0xd699('0xa4')]['findAll'](_0x4e8572);})[_0xd699('0x35')](function(_0xaab571){_0x32034b['rows']=_0xaab571;return _0x32034b;});}})[_0xd699('0x35')](respondWithFilteredResult(_0x5d1636,_0x4e8572))[_0xd699('0x29')](handleError(_0x5d1636,null));};exports[_0xd699('0x3b')]=function(_0x474cc4,_0x3c8cb0,_0x4fb4b0){var _0x5f14e8,_0x39929a={},_0xf54b70;if(_0x474cc4[_0xd699('0x61')]['to']){_0xf54b70=_0x474cc4[_0xd699('0x61')]['to'][0x0];}return db[_0xd699('0x3f')]['find']({'where':{'id':_0x474cc4[_0xd699('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0xd699('0xa8'),'include':[{'model':db[_0xd699('0xa9')],'as':'Contacts','where':{'fax':_0xf54b70},'limit':0x1,'order':[[_0xd699('0xa1'),_0xd699('0xaa')]]}]}]})['then'](handleEntityNotFound(_0x3c8cb0,null))[_0xd699('0x35')](function(_0xc50f04){_0x5f14e8=_0xc50f04;if(_0x474cc4[_0xd699('0x61')][_0xd699('0xab')]&&_0x474cc4[_0xd699('0x61')]['attachments']['length']){for(var _0xa8a224=0x0;_0xa8a224<_0x474cc4['body'][_0xd699('0xab')][_0xd699('0x58')];_0xa8a224+=0x1){_0x474cc4['body'][_0xd699('0xab')][_0xa8a224]={'filename':_0x474cc4['body']['attachments'][_0xa8a224]['name'],'id':_0x474cc4['body'][_0xd699('0xab')][_0xa8a224]['id'],'path':path['join'](config[_0xd699('0xac')],_0xd699('0xad'),_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][_0xa8a224][_0xd699('0xae')])};}}return respondWithRpcPromise(_0xd699('0xaf'),_0xd699('0xaf'),{'FaxAccountId':_['isNil'](_0x474cc4[_0xd699('0x65')]['id'])?undefined:_0x474cc4[_0xd699('0x65')]['id'],'path':_['isNil'](_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][0x0][_0xd699('0x6')])?undefined:_0x474cc4[_0xd699('0x61')]['attachments'][0x0][_0xd699('0x6')],'fax':_[_0xd699('0xb0')](_0x474cc4[_0xd699('0x61')]['to'][0x0])?undefined:_0x474cc4[_0xd699('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x5f14e8){if(_['isNil'](_0x474cc4[_0xd699('0x61')][_0xd699('0xb1')])){_0x474cc4['body'][_0xd699('0xb1')]=util['format']('\x22%s\x22\x20<%s>',_0x5f14e8[_0xd699('0x3a')],_0x5f14e8[_0xd699('0xb2')]);}if(_0x5f14e8[_0xd699('0xa8')]){if(_0x5f14e8[_0xd699('0xa8')][_0xd699('0xb3')]['length']){return _0x5f14e8['List'][_0xd699('0xb3')][0x0];}else{return db[_0xd699('0xa9')][_0xd699('0x5a')](_[_0xd699('0x17')](_0x474cc4[_0xd699('0x61')],{'firstName':_0x474cc4['body']['to'][0x0],'phone':_0x474cc4[_0xd699('0x61')]['to'][0x0],'fax':_0x474cc4[_0xd699('0x61')]['to'][0x0],'ListId':_0x5f14e8[_0xd699('0xa2')]}));}}else{throw new Error(_0xd699('0xb4'));}}else{throw new Error(_0xd699('0xb5'));}})[_0xd699('0x35')](function(_0x51e4f8){if(_0x51e4f8){return db[_0xd699('0x72')][_0xd699('0x62')]({'where':{'ContactId':_0x51e4f8['id'],'closed':![],'FaxAccountId':_0x5f14e8['id']}})[_0xd699('0x35')](function(_0x2fec2b){if(_0x2fec2b){return[_0x2fec2b,![]];}return db['FaxInteraction'][_0xd699('0x5a')]({'UserId':_0x474cc4[_0xd699('0x5d')]['id'],'ContactId':_0x51e4f8['id'],'FaxAccountId':_0x5f14e8['id'],'fax':_0x474cc4[_0xd699('0x61')]['to'][0x0],'firstMsgDirection':_0xd699('0xb6'),'Messages':[_[_0xd699('0x50')](_0x474cc4[_0xd699('0x61')],{'read':![],'body':_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][0x0][_0xd699('0xb7')],'FaxAccountId':_0x5f14e8['id'],'UserId':_0x474cc4[_0xd699('0x5d')]['id'],'ContactId':_0x51e4f8['id'],'AttachmentId':_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xd699('0xa4')],'as':'Messages'}]})['then'](function(_0x47f3c1){return[_0x47f3c1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd699('0xb8')](function(_0x5864ef,_0x51e023){if(_0x51e023){return _0x5864ef;}return db[_0xd699('0xa4')][_0xd699('0x5a')]({'direction':_0xd699('0xb6'),'read':![],'body':_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][0x0]['filename'],'FaxAccountId':_0x5f14e8['id'],'FaxInteractionId':_0x5864ef['id'],'UserId':_0x474cc4[_0xd699('0x5d')]['id'],'ContactId':_0x5864ef['ContactId'],'AttachmentId':_0x474cc4[_0xd699('0x61')]['attachments'][0x0]['id']})[_0xd699('0x35')](function(_0x455d38){_0x5864ef['dataValues'][_0xd699('0xb9')]=[];_0x5864ef[_0xd699('0xba')][_0xd699('0xb9')][_0xd699('0x8e')](_0x455d38[_0xd699('0xba')]);return _0x5864ef;});})[_0xd699('0x35')](function(_0x39c514){respondWithRpcPromise(_0xd699('0xbb'),'SendFax',{'FaxAccountId':_[_0xd699('0xb0')](_0x474cc4[_0xd699('0x65')]['id'])?undefined:_0x474cc4[_0xd699('0x65')]['id'],'path':_[_0xd699('0xb0')](_0x474cc4['body'][_0xd699('0xab')][0x0][_0xd699('0x6')])?undefined:_0x474cc4[_0xd699('0x61')][_0xd699('0xab')][0x0][_0xd699('0x6')],'fax':_[_0xd699('0xb0')](_0x474cc4[_0xd699('0x61')]['to'][0x0])?undefined:_0x474cc4[_0xd699('0x61')]['to'][0x0],'AttachmentId':_0x474cc4[_0xd699('0x61')]['attachments'][0x0]['id']},client9002)[_0xd699('0x35')](function(_0x7322a8){logger[_0xd699('0x1f')](_0xd699('0xbc'),_0x7322a8);})[_0xd699('0x29')](function(_0x25be99){logger[_0xd699('0x1f')](_0xd699('0xbc'),_0x25be99);});return _0x39c514;})[_0xd699('0x35')](respondWithResult(_0x3c8cb0,null))['catch'](handleError(_0x3c8cb0,null));};exports[_0xd699('0xbd')]=function(_0x1a7ca3,_0x919687,_0x4d839c){return db[_0xd699('0x3f')][_0xd699('0x62')]({'where':{'id':_0x1a7ca3[_0xd699('0x65')]['id']}})[_0xd699('0x35')](handleEntityNotFound(_0x919687,null))[_0xd699('0x35')](function(_0x1f41b7){if(_0x1f41b7){return _0x1f41b7['addAgents'](_0x1a7ca3[_0xd699('0x61')]['ids'],_[_0xd699('0x70')](_0x1a7ca3[_0xd699('0x61')],[_0xd699('0x6a'),'id'])||{})[_0xd699('0xb8')](function(_0x164af7){for(var _0x3dfbb4=0x0;_0x3dfbb4<_0x1a7ca3[_0xd699('0x61')][_0xd699('0x6a')][_0xd699('0x58')];_0x3dfbb4+=0x1){socket['emit'](_0xd699('0xbe'),{'UserId':Number(_0x1a7ca3[_0xd699('0x61')]['ids'][_0x3dfbb4]),'FaxAccountId':Number(_0x1a7ca3[_0xd699('0x65')]['id'])});}return _0x164af7;});}})[_0xd699('0x35')](respondWithResult(_0x919687,null))[_0xd699('0x29')](handleError(_0x919687,null));};exports['removeAgents']=function(_0x507490,_0x4e2b95,_0x2579a8){return db[_0xd699('0x3f')][_0xd699('0x62')]({'where':{'id':_0x507490[_0xd699('0x65')]['id']}})['then'](handleEntityNotFound(_0x4e2b95,null))['then'](function(_0x12c011){if(_0x12c011){return _0x12c011[_0xd699('0xbf')](_0x507490[_0xd699('0x43')][_0xd699('0x6a')])[_0xd699('0x35')](function(){if(_[_0xd699('0xc0')](_0x507490['query']['ids'])){for(var _0x5281e3=0x0;_0x5281e3<_0x507490[_0xd699('0x43')][_0xd699('0x6a')][_0xd699('0x58')];_0x5281e3+=0x1){socket[_0xd699('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x507490[_0xd699('0x43')][_0xd699('0x6a')][_0x5281e3]),'FaxAccountId':Number(_0x507490[_0xd699('0x65')]['id'])});}}else{socket[_0xd699('0xc1')](_0xd699('0xc2'),{'UserId':Number(_0x507490[_0xd699('0x43')][_0xd699('0x6a')]),'FaxAccountId':Number(_0x507490[_0xd699('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e2b95,null))['catch'](handleError(_0x4e2b95,null));};exports[_0xd699('0xc3')]=function(_0xee47f6,_0x1a77c7,_0xffaddb){var _0x2917b4={};var _0x4d0113={};var _0x4bf3d9;var _0x177a77;return db[_0xd699('0x3f')][_0xd699('0x6d')]({'where':{'id':_0xee47f6['params']['id']}})['then'](handleEntityNotFound(_0x1a77c7,null))[_0xd699('0x35')](function(_0x560586){if(_0x560586){_0x4bf3d9=_0x560586;_0x4d0113[_0xd699('0x46')]=_[_0xd699('0x57')](db['User'][_0xd699('0x40')]);_0x4d0113[_0xd699('0x43')]=_[_0xd699('0x57')](_0xee47f6[_0xd699('0x43')]);_0x4d0113['filters']=_[_0xd699('0x45')](_0x4d0113[_0xd699('0x46')],_0x4d0113['query']);_0x2917b4[_0xd699('0x47')]=_[_0xd699('0x45')](_0x4d0113[_0xd699('0x46')],qs['fields'](_0xee47f6[_0xd699('0x43')][_0xd699('0x48')]));_0x2917b4[_0xd699('0x47')]=_0x2917b4['attributes'][_0xd699('0x58')]?_0x2917b4[_0xd699('0x47')]:_0x4d0113[_0xd699('0x46')];_0x2917b4['order']=qs[_0xd699('0x4c')](_0xee47f6[_0xd699('0x43')][_0xd699('0x4c')]);_0x2917b4[_0xd699('0x4d')]=qs['filters'](_[_0xd699('0x4e')](_0xee47f6[_0xd699('0x43')],_0x4d0113[_0xd699('0x44')]));if(_0xee47f6['query'][_0xd699('0x4f')]){_0x2917b4[_0xd699('0x4d')]=_[_0xd699('0x50')](_0x2917b4[_0xd699('0x4d')],{'$or':_['map'](_0x2917b4[_0xd699('0x47')],function(_0x3e56ae){var _0x11bc70={};_0x11bc70[_0x3e56ae]={'$like':'%'+_0xee47f6[_0xd699('0x43')][_0xd699('0x4f')]+'%'};return _0x11bc70;})});}_0x2917b4=_[_0xd699('0x50')]({},_0x2917b4,_0xee47f6[_0xd699('0x52')]);return _0x4bf3d9[_0xd699('0xc3')](_0x2917b4);}})[_0xd699('0x35')](function(_0x296a70){if(_0x296a70){_0x177a77=_0x296a70[_0xd699('0x58')];if(!_0xee47f6[_0xd699('0x43')][_0xd699('0x49')](_0xd699('0x4a'))){_0x2917b4['limit']=qs[_0xd699('0x2d')](_0xee47f6[_0xd699('0x43')]['limit']);_0x2917b4['offset']=qs[_0xd699('0x2c')](_0xee47f6[_0xd699('0x43')][_0xd699('0x2c')]);}return _0x4bf3d9[_0xd699('0xc3')](_0x2917b4);}})['then'](function(_0x1aa120){if(_0x1aa120){return _0x1aa120?{'count':_0x177a77,'rows':_0x1aa120}:null;}})[_0xd699('0x35')](respondWithResult(_0x1a77c7,null))['catch'](handleError(_0x1a77c7,null));};
\ No newline at end of file
index f7625cf..e085af6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7599=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x3ada92,_0x221087){var _0x30535d=function(_0x5d3019){while(--_0x5d3019){_0x3ada92['push'](_0x3ada92['shift']());}};_0x30535d(++_0x221087);}(_0x7599,0x14f));var _0x9759=function(_0x515d8e,_0x50c40a){_0x515d8e=_0x515d8e-0x0;var _0x2b4582=_0x7599[_0x515d8e];return _0x2b4582;};'use strict';var EventEmitter=require(_0x9759('0x0'));var FaxAccount=require(_0x9759('0x1'))['db'][_0x9759('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9759('0x3')](0x0);var events={'afterCreate':_0x9759('0x4'),'afterUpdate':_0x9759('0x5'),'afterDestroy':_0x9759('0x6')};function emitEvent(_0x3212df){return function(_0x10884d,_0x46fdc5,_0x44ef96){FaxAccountEvents[_0x9759('0x7')](_0x3212df+':'+_0x10884d['id'],_0x10884d);FaxAccountEvents[_0x9759('0x7')](_0x3212df,_0x10884d);_0x44ef96(null);};}for(var e in events){if(events[_0x9759('0x8')](e)){var event=events[e];FaxAccount[_0x9759('0x9')](e,emitEvent(event));}}module[_0x9759('0xa')]=FaxAccountEvents;
\ No newline at end of file
+var _0xf99f=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x5de889,_0x115fc4){var _0x549a4f=function(_0x1255e8){while(--_0x1255e8){_0x5de889['push'](_0x5de889['shift']());}};_0x549a4f(++_0x115fc4);}(_0xf99f,0xb5));var _0xff99=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0xf99f[_0x209bbf];return _0x592d4b;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xff99('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xff99('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff99('0x2'),'afterDestroy':_0xff99('0x3')};function emitEvent(_0x44fe4e){return function(_0x1137b1,_0x47b90c,_0x4f0e49){FaxAccountEvents['emit'](_0x44fe4e+':'+_0x1137b1['id'],_0x1137b1);FaxAccountEvents[_0xff99('0x4')](_0x44fe4e,_0x1137b1);_0x4f0e49(null);};}for(var e in events){if(events[_0xff99('0x5')](e)){var event=events[e];FaxAccount[_0xff99('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index be7a4c8..b8a812c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa42=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxAccount','fax_accounts','util'];(function(_0x8e85d9,_0x396cc0){var _0x61dacd=function(_0x359813){while(--_0x359813){_0x8e85d9['push'](_0x8e85d9['shift']());}};_0x61dacd(++_0x396cc0);}(_0xfa42,0x6b));var _0x2fa4=function(_0x1df4c9,_0x54e09a){_0x1df4c9=_0x1df4c9-0x0;var _0x53de50=_0xfa42[_0x1df4c9];return _0x53de50;};'use strict';var _=require('lodash');var util=require(_0x2fa4('0x0'));var logger=require(_0x2fa4('0x1'))(_0x2fa4('0x2'));var moment=require(_0x2fa4('0x3'));var BPromise=require(_0x2fa4('0x4'));var rp=require(_0x2fa4('0x5'));var fs=require('fs');var path=require(_0x2fa4('0x6'));var rimraf=require(_0x2fa4('0x7'));var config=require(_0x2fa4('0x8'));var attributes=require('./faxAccount.attributes');module[_0x2fa4('0x9')]=function(_0xf0b612,_0x178f6f){return _0xf0b612['define'](_0x2fa4('0xa'),attributes,{'tableName':_0x2fa4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3552=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount'];(function(_0x1f57e7,_0x31455f){var _0xc38613=function(_0x3a13dc){while(--_0x3a13dc){_0x1f57e7['push'](_0x1f57e7['shift']());}};_0xc38613(++_0x31455f);}(_0x3552,0x15f));var _0x2355=function(_0x17c3eb,_0x11f576){_0x17c3eb=_0x17c3eb-0x0;var _0x5943f4=_0x3552[_0x17c3eb];return _0x5943f4;};'use strict';var _=require(_0x2355('0x0'));var util=require(_0x2355('0x1'));var logger=require(_0x2355('0x2'))(_0x2355('0x3'));var moment=require(_0x2355('0x4'));var BPromise=require(_0x2355('0x5'));var rp=require(_0x2355('0x6'));var fs=require('fs');var path=require(_0x2355('0x7'));var rimraf=require(_0x2355('0x8'));var config=require(_0x2355('0x9'));var attributes=require(_0x2355('0xa'));module['exports']=function(_0xd34cb5,_0x5fb1e7){return _0xd34cb5[_0x2355('0xb')](_0x2355('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 494af09..91ead58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4771=['Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','options','raw','attributes','limit','map','include','model','debug','catch','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','keys','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','from','create','contact','FaxInteraction'];(function(_0x5459b0,_0x4d2ef8){var _0x675a35=function(_0x538e11){while(--_0x538e11){_0x5459b0['push'](_0x5459b0['shift']());}};_0x675a35(++_0x4d2ef8);}(_0x4771,0x127));var _0x1477=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x4771[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x1477('0x0'));var util=require(_0x1477('0x1'));var moment=require(_0x1477('0x2'));var BPromise=require(_0x1477('0x3'));var rs=require(_0x1477('0x4'));var fs=require('fs');var Redis=require(_0x1477('0x5'));var db=require(_0x1477('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1477('0x7'))(_0x1477('0x8'));var config=require('../../config/environment');var jayson=require(_0x1477('0x9'));var client=jayson[_0x1477('0xa')][_0x1477('0xb')]({'port':0x232c});config[_0x1477('0xc')]=_[_0x1477('0xd')](config[_0x1477('0xc')],{'host':_0x1477('0xe'),'port':0x18eb});var socket=require(_0x1477('0xf'))(new Redis(config[_0x1477('0xc')]));require(_0x1477('0x10'))[_0x1477('0x11')](socket);function respondWithRpcPromise(_0x4261a7,_0x5c6a9d,_0x20ba12){return new BPromise(function(_0x21ec37,_0x2dd1b9){return client[_0x1477('0x12')](_0x4261a7,_0x20ba12)[_0x1477('0x13')](function(_0x23c7fd){logger[_0x1477('0x14')]('FaxAccount,\x20%s,\x20%s',_0x5c6a9d,_0x1477('0x15'));logger['debug'](_0x1477('0x16'),_0x5c6a9d,'request\x20sent',JSON[_0x1477('0x17')](_0x23c7fd));if(_0x23c7fd[_0x1477('0x18')]){if(_0x23c7fd[_0x1477('0x18')][_0x1477('0x19')]===0x1f4){logger[_0x1477('0x18')](_0x1477('0x1a'),_0x5c6a9d,_0x23c7fd[_0x1477('0x18')][_0x1477('0x1b')]);return _0x2dd1b9(_0x23c7fd[_0x1477('0x18')][_0x1477('0x1b')]);}logger[_0x1477('0x18')](_0x1477('0x1a'),_0x5c6a9d,_0x23c7fd[_0x1477('0x18')][_0x1477('0x1b')]);return _0x21ec37(_0x23c7fd[_0x1477('0x18')][_0x1477('0x1b')]);}else{logger[_0x1477('0x14')](_0x1477('0x1a'),_0x5c6a9d,'request\x20sent');_0x21ec37(_0x23c7fd[_0x1477('0x1c')][_0x1477('0x1b')]);}})['catch'](function(_0x39acb8){logger[_0x1477('0x18')](_0x1477('0x1a'),_0x5c6a9d,_0x39acb8);_0x2dd1b9(_0x39acb8);});});}exports[_0x1477('0x1d')]=function(_0x55d72d){var _0x2de968=this;return new Promise(function(_0x515616,_0x1710e2){return db[_0x1477('0x1e')]['findAll']({'raw':_0x55d72d[_0x1477('0x1f')]?_0x55d72d['options'][_0x1477('0x20')]===undefined?!![]:![]:!![],'where':_0x55d72d[_0x1477('0x1f')]?_0x55d72d[_0x1477('0x1f')]['where']||null:null,'attributes':_0x55d72d[_0x1477('0x1f')]?_0x55d72d[_0x1477('0x1f')][_0x1477('0x21')]||null:null,'limit':_0x55d72d[_0x1477('0x1f')]?_0x55d72d[_0x1477('0x1f')][_0x1477('0x22')]||null:null,'include':_0x55d72d['options']?_0x55d72d[_0x1477('0x1f')]['include']?_[_0x1477('0x23')](_0x55d72d[_0x1477('0x1f')][_0x1477('0x24')],function(_0x540bd8){return{'model':db[_0x540bd8['model']],'as':_0x540bd8['as'],'attributes':_0x540bd8['attributes'],'include':_0x540bd8['include']?_[_0x1477('0x23')](_0x540bd8[_0x1477('0x24')],function(_0x3322c8){return{'model':db[_0x3322c8[_0x1477('0x25')]],'as':_0x3322c8['as'],'attributes':_0x3322c8[_0x1477('0x21')],'include':_0x3322c8[_0x1477('0x24')]?_[_0x1477('0x23')](_0x3322c8['include'],function(_0x21298c){return{'model':db[_0x21298c['model']],'as':_0x21298c['as'],'attributes':_0x21298c[_0x1477('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39f00a){logger[_0x1477('0x14')](_0x1477('0x1d'),_0x55d72d);logger[_0x1477('0x26')](_0x1477('0x1d'),_0x55d72d,JSON[_0x1477('0x17')](_0x39f00a));_0x515616(_0x39f00a);})[_0x1477('0x27')](function(_0x3ed1f1){logger[_0x1477('0x18')]('GetFaxAccount',_0x3ed1f1[_0x1477('0x1b')],_0x55d72d);_0x1710e2(_0x2de968[_0x1477('0x18')](0x1f4,_0x3ed1f1['message']));});});};exports[_0x1477('0x28')]=function(_0x2ba403,_0x1270f1,_0x12025c){var _0x36bf55=this;return new Promise(function(_0x7f68f9,_0x804aab){var _0x78d655={'body':_0x2ba403[_0x1477('0x29')],'channel':_0x1477('0x2a')};var _0x23611c=[];var _0x5a4b4f=[];var _0x153c3a={};return db[_0x1477('0x2b')]['describe']()['then'](function(_0x42c3d7){if(!_0x42c3d7){throw new db[(_0x1477('0x2c'))][(_0x1477('0x2d'))](_0x1477('0x2e'));}_0x23611c=_['difference'](_['keys'](_0x42c3d7),[_0x1477('0x2f'),_0x1477('0x30')]);_0x5a4b4f=_[_0x1477('0x31')](_[_0x1477('0x32')](_0x42c3d7),[_0x1477('0x2f'),_0x1477('0x30'),'CompanyId',_0x1477('0x33')]);if(_0x2ba403['body']['id']){delete _0x2ba403[_0x1477('0x29')]['id'];}if(_['isNil'](_0x2ba403[_0x1477('0x29')]['from'])){throw new db['Sequelize'][(_0x1477('0x2d'))](_0x1477('0x34'));}if(_[_0x1477('0x35')](_0x2ba403[_0x1477('0x29')]['body'])||_0x2ba403[_0x1477('0x29')][_0x1477('0x29')]===''){throw new db['Sequelize'][(_0x1477('0x2d'))](_0x1477('0x36'));}if(_['isNil'](_0x2ba403[_0x1477('0x29')]['mapKey'])){throw new db['Sequelize'][(_0x1477('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a4b4f);}if(!_[_0x1477('0x37')](_0x5a4b4f,_0x2ba403[_0x1477('0x29')][_0x1477('0x38')])){throw new db[(_0x1477('0x2c'))][(_0x1477('0x2d'))](_0x1477('0x39')+_0x5a4b4f);}_0x153c3a[_0x2ba403[_0x1477('0x29')]['mapKey']]=_0x2ba403[_0x1477('0x29')]['from'];})[_0x1477('0x13')](function(){return db[_0x1477('0x1e')][_0x1477('0x3a')]({'where':{'id':_0x2ba403[_0x1477('0x3b')]['id']},'include':[{'model':db[_0x1477('0x3c')],'as':_0x1477('0x3d'),'include':[{'model':db[_0x1477('0x2b')],'as':_0x1477('0x3e'),'where':_0x153c3a,'limit':0x1,'order':[[_0x1477('0x30'),_0x1477('0x3f')]]}]},{'model':db[_0x1477('0x40')],'as':_0x1477('0x41')}]});})[_0x1477('0x13')](function(_0x3d18b0){if(_0x3d18b0&&_0x3d18b0[_0x1477('0x3d')]){var _0x2549a3=_0x3d18b0[_0x1477('0x42')]({'plain':!![]});_0x78d655[_0x1477('0x3b')]=_0x2549a3;_0x78d655[_0x1477('0x43')]=_0x2549a3[_0x1477('0x41')];_0x78d655[_0x1477('0x44')]=_0x2549a3[_0x1477('0x3d')];_0x78d655[_0x1477('0x43')]=_[_0x1477('0x45')](_0x78d655[_0x1477('0x43')],[_0x1477('0x46')],[_0x1477('0x47')]);if(_0x78d655[_0x1477('0x3b')][_0x1477('0x41')]){delete _0x78d655['account'][_0x1477('0x41')];}if(_0x78d655[_0x1477('0x3b')][_0x1477('0x3d')]&&_0x78d655[_0x1477('0x3b')][_0x1477('0x3d')][_0x1477('0x3e')][_0x1477('0x48')]){return _0x78d655[_0x1477('0x3b')][_0x1477('0x3d')][_0x1477('0x3e')][0x0];}var _0xac43a2=_[_0x1477('0xd')](_0x2ba403[_0x1477('0x29')],{'firstName':_0x2ba403[_0x1477('0x29')][_0x1477('0x49')],'ListId':_0x2549a3[_0x1477('0x33')]});_0xac43a2[_0x2ba403[_0x1477('0x29')][_0x1477('0x38')]]=_0x2ba403['body'][_0x1477('0x49')];return db[_0x1477('0x2b')][_0x1477('0x4a')](_0xac43a2,{'fields':_0x23611c,'raw':!![]});}})[_0x1477('0x13')](function(_0x50eba8){_0x78d655[_0x1477('0x4b')]=_0x50eba8;if(_0x50eba8){var _0x1ebffe={'ContactId':_0x50eba8['id'],'FaxAccountId':_0x2ba403[_0x1477('0x3b')]['id'],'fax':_0x50eba8[_0x1477('0x2a')]};return db[_0x1477('0x4c')]['find']({'where':{'ContactId':_0x50eba8['id'],'closed':![],'FaxAccountId':_0x2ba403['account']['id']}})[_0x1477('0x13')](function(_0x11663b){if(_0x11663b){return[_0x11663b,![]];}return db[_0x1477('0x4c')][_0x1477('0x4a')](_0x1ebffe)[_0x1477('0x13')](function(_0xe8a572){return[_0xe8a572,!![]];});});}else{throw new Error(_0x1477('0x4d'));}})[_0x1477('0x4e')](function(_0x71eba2,_0x61c381){var _0x42fbbc=_0x71eba2[_0x1477('0x42')]({'plain':!![]});if(_0x61c381){if(_0x78d655['account']['autoclose']){_0x78d655['applications'][_0x1477('0x4f')]({'id':0x0,'priority':_0x78d655[_0x1477('0x43')]['length']+0x1,'app':_0x1477('0x50'),'appdata':_0x1477('0x51'),'interval':_0x1477('0x52')});}_0x42fbbc['created']=!![];}else{_0x42fbbc[_0x1477('0x53')]=![];}_0x78d655[_0x1477('0x54')]=_0x42fbbc;return db[_0x1477('0x55')][_0x1477('0x4a')]({'body':_0x2ba403[_0x1477('0x29')][_0x1477('0x29')],'FaxAccountId':_0x2ba403[_0x1477('0x3b')]['id'],'FaxInteractionId':_0x71eba2['id'],'direction':'in','ContactId':_0x71eba2[_0x1477('0x56')],'AttachmentId':_0x2ba403['body'][_0x1477('0x57')]});})['then'](function(_0x54c32c){_0x78d655[_0x1477('0x1b')]=_0x54c32c;if(_0x78d655[_0x1477('0x54')]['UserId']){return db[_0x1477('0x58')][_0x1477('0x3a')]({'attributes':['id',_0x1477('0x59')],'where':{'id':_0x78d655[_0x1477('0x54')][_0x1477('0x5a')]}})[_0x1477('0x13')](function(_0x16aa79){if(_0x16aa79){_0x78d655[_0x1477('0x43')][_0x1477('0x5b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x16aa79['name']+','+(_0x78d655[_0x1477('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1477('0x5c'),'startRouting',_0x78d655);});}return respondWithRpcPromise(_0x1477('0x5c'),'startRouting',_0x78d655);})['then'](function(_0x3c6103){_0x7f68f9(_0x3c6103);})[_0x1477('0x27')](function(_0x3fb4ea){_0x804aab(_0x36bf55[_0x1477('0x18')](0x1f4,_0x3fb4ea['message']));});});};
\ No newline at end of file
+var _0x7567=['./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','*,*,*,*','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x840106,_0x59c538){var _0x41edcd=function(_0x4c1dc1){while(--_0x4c1dc1){_0x840106['push'](_0x840106['shift']());}};_0x41edcd(++_0x59c538);}(_0x7567,0x1c7));var _0x7756=function(_0x57da6c,_0x165c70){_0x57da6c=_0x57da6c-0x0;var _0x5ef97d=_0x7567[_0x57da6c];return _0x5ef97d;};'use strict';var _=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var moment=require(_0x7756('0x2'));var BPromise=require('bluebird');var rs=require(_0x7756('0x3'));var fs=require('fs');var Redis=require(_0x7756('0x4'));var db=require(_0x7756('0x5'))['db'];var utils=require(_0x7756('0x6'));var logger=require(_0x7756('0x7'))(_0x7756('0x8'));var config=require('../../config/environment');var jayson=require(_0x7756('0x9'));var client=jayson[_0x7756('0xa')][_0x7756('0xb')]({'port':0x232c});config[_0x7756('0xc')]=_[_0x7756('0xd')](config[_0x7756('0xc')],{'host':_0x7756('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7756('0xc')]));require(_0x7756('0xf'))[_0x7756('0x10')](socket);function respondWithRpcPromise(_0x37b5d6,_0xcdc322,_0x2a1753){return new BPromise(function(_0x39d1a8,_0x42deab){return client[_0x7756('0x11')](_0x37b5d6,_0x2a1753)[_0x7756('0x12')](function(_0x23a1c4){logger[_0x7756('0x13')](_0x7756('0x14'),_0xcdc322,_0x7756('0x15'));logger[_0x7756('0x16')](_0x7756('0x17'),_0xcdc322,_0x7756('0x15'),JSON[_0x7756('0x18')](_0x23a1c4));if(_0x23a1c4['error']){if(_0x23a1c4[_0x7756('0x19')][_0x7756('0x1a')]===0x1f4){logger[_0x7756('0x19')](_0x7756('0x14'),_0xcdc322,_0x23a1c4[_0x7756('0x19')][_0x7756('0x1b')]);return _0x42deab(_0x23a1c4[_0x7756('0x19')][_0x7756('0x1b')]);}logger[_0x7756('0x19')](_0x7756('0x14'),_0xcdc322,_0x23a1c4[_0x7756('0x19')][_0x7756('0x1b')]);return _0x39d1a8(_0x23a1c4['error'][_0x7756('0x1b')]);}else{logger[_0x7756('0x13')]('FaxAccount,\x20%s,\x20%s',_0xcdc322,_0x7756('0x15'));_0x39d1a8(_0x23a1c4[_0x7756('0x1c')][_0x7756('0x1b')]);}})[_0x7756('0x1d')](function(_0xde0db1){logger[_0x7756('0x19')](_0x7756('0x14'),_0xcdc322,_0xde0db1);_0x42deab(_0xde0db1);});});}exports[_0x7756('0x1e')]=function(_0x3c5da4){var _0x3bea77=this;return new Promise(function(_0x5c26eb,_0x3b98ac){return db[_0x7756('0x1f')][_0x7756('0x20')]({'raw':_0x3c5da4[_0x7756('0x21')]?_0x3c5da4['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c5da4['options']?_0x3c5da4['options'][_0x7756('0x22')]||null:null,'attributes':_0x3c5da4[_0x7756('0x21')]?_0x3c5da4[_0x7756('0x21')][_0x7756('0x23')]||null:null,'limit':_0x3c5da4[_0x7756('0x21')]?_0x3c5da4[_0x7756('0x21')][_0x7756('0x24')]||null:null,'include':_0x3c5da4[_0x7756('0x21')]?_0x3c5da4[_0x7756('0x21')]['include']?_['map'](_0x3c5da4[_0x7756('0x21')][_0x7756('0x25')],function(_0x40b424){return{'model':db[_0x40b424['model']],'as':_0x40b424['as'],'attributes':_0x40b424['attributes'],'include':_0x40b424[_0x7756('0x25')]?_[_0x7756('0x26')](_0x40b424[_0x7756('0x25')],function(_0x22eaa8){return{'model':db[_0x22eaa8['model']],'as':_0x22eaa8['as'],'attributes':_0x22eaa8['attributes'],'include':_0x22eaa8[_0x7756('0x25')]?_[_0x7756('0x26')](_0x22eaa8[_0x7756('0x25')],function(_0x33f686){return{'model':db[_0x33f686[_0x7756('0x27')]],'as':_0x33f686['as'],'attributes':_0x33f686[_0x7756('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40b9b0){logger[_0x7756('0x13')]('GetFaxAccount',_0x3c5da4);logger[_0x7756('0x16')](_0x7756('0x1e'),_0x3c5da4,JSON['stringify'](_0x40b9b0));_0x5c26eb(_0x40b9b0);})[_0x7756('0x1d')](function(_0x4ce7c4){logger[_0x7756('0x19')](_0x7756('0x1e'),_0x4ce7c4['message'],_0x3c5da4);_0x3b98ac(_0x3bea77[_0x7756('0x19')](0x1f4,_0x4ce7c4[_0x7756('0x1b')]));});});};exports[_0x7756('0x28')]=function(_0x1552bf,_0x112e01,_0x60b33f){var _0x4dedcf=this;return new Promise(function(_0x1ed51c,_0x357360){var _0x1f57be={'body':_0x1552bf[_0x7756('0x29')],'channel':_0x7756('0x2a')};var _0x1080ac=[];var _0x258f3b=[];var _0x75a5f9={};return db[_0x7756('0x2b')]['describe']()[_0x7756('0x12')](function(_0x14d7fd){if(!_0x14d7fd){throw new db[(_0x7756('0x2c'))]['ValidationError'](_0x7756('0x2d'));}_0x1080ac=_[_0x7756('0x2e')](_['keys'](_0x14d7fd),[_0x7756('0x2f'),'updatedAt']);_0x258f3b=_[_0x7756('0x2e')](_[_0x7756('0x30')](_0x14d7fd),[_0x7756('0x2f'),_0x7756('0x31'),_0x7756('0x32'),_0x7756('0x33')]);if(_0x1552bf['body']['id']){delete _0x1552bf[_0x7756('0x29')]['id'];}if(_[_0x7756('0x34')](_0x1552bf[_0x7756('0x29')][_0x7756('0x35')])){throw new db[(_0x7756('0x2c'))][(_0x7756('0x36'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1552bf['body'][_0x7756('0x29')])||_0x1552bf[_0x7756('0x29')]['body']===''){throw new db['Sequelize'][(_0x7756('0x36'))](_0x7756('0x37'));}if(_[_0x7756('0x34')](_0x1552bf[_0x7756('0x29')]['mapKey'])){throw new db[(_0x7756('0x2c'))][(_0x7756('0x36'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x258f3b);}if(!_[_0x7756('0x38')](_0x258f3b,_0x1552bf[_0x7756('0x29')][_0x7756('0x39')])){throw new db['Sequelize'][(_0x7756('0x36'))](_0x7756('0x3a')+_0x258f3b);}_0x75a5f9[_0x1552bf[_0x7756('0x29')]['mapKey']]=_0x1552bf[_0x7756('0x29')][_0x7756('0x35')];})[_0x7756('0x12')](function(){return db[_0x7756('0x1f')][_0x7756('0x3b')]({'where':{'id':_0x1552bf[_0x7756('0x3c')]['id']},'include':[{'model':db[_0x7756('0x3d')],'as':_0x7756('0x3e'),'include':[{'model':db[_0x7756('0x2b')],'as':'Contacts','where':_0x75a5f9,'limit':0x1,'order':[[_0x7756('0x31'),_0x7756('0x3f')]]}]},{'model':db[_0x7756('0x40')],'as':_0x7756('0x41')}]});})[_0x7756('0x12')](function(_0x448d4d){if(_0x448d4d&&_0x448d4d[_0x7756('0x3e')]){var _0x226d44=_0x448d4d[_0x7756('0x42')]({'plain':!![]});_0x1f57be[_0x7756('0x3c')]=_0x226d44;_0x1f57be[_0x7756('0x43')]=_0x226d44[_0x7756('0x41')];_0x1f57be[_0x7756('0x44')]=_0x226d44['List'];_0x1f57be['applications']=_[_0x7756('0x45')](_0x1f57be[_0x7756('0x43')],[_0x7756('0x46')],[_0x7756('0x47')]);if(_0x1f57be[_0x7756('0x3c')][_0x7756('0x41')]){delete _0x1f57be[_0x7756('0x3c')]['Applications'];}if(_0x1f57be[_0x7756('0x3c')][_0x7756('0x3e')]&&_0x1f57be[_0x7756('0x3c')][_0x7756('0x3e')][_0x7756('0x48')][_0x7756('0x49')]){return _0x1f57be['account'][_0x7756('0x3e')][_0x7756('0x48')][0x0];}var _0x977145=_[_0x7756('0xd')](_0x1552bf[_0x7756('0x29')],{'firstName':_0x1552bf[_0x7756('0x29')][_0x7756('0x35')],'ListId':_0x226d44[_0x7756('0x33')]});_0x977145[_0x1552bf[_0x7756('0x29')][_0x7756('0x39')]]=_0x1552bf['body']['from'];return db[_0x7756('0x2b')]['create'](_0x977145,{'fields':_0x1080ac,'raw':!![]});}})['then'](function(_0xeecbfd){_0x1f57be[_0x7756('0x4a')]=_0xeecbfd;if(_0xeecbfd){var _0x103fb9={'ContactId':_0xeecbfd['id'],'FaxAccountId':_0x1552bf['account']['id'],'fax':_0xeecbfd[_0x7756('0x2a')]};return db[_0x7756('0x4b')][_0x7756('0x3b')]({'where':{'ContactId':_0xeecbfd['id'],'closed':![],'FaxAccountId':_0x1552bf[_0x7756('0x3c')]['id']}})[_0x7756('0x12')](function(_0x3289a9){if(_0x3289a9){return[_0x3289a9,![]];}return db['FaxInteraction']['create'](_0x103fb9)[_0x7756('0x12')](function(_0x14e8d5){return[_0x14e8d5,!![]];});});}else{throw new Error(_0x7756('0x4c'));}})[_0x7756('0x4d')](function(_0x385bed,_0x440b7a){var _0x5886ec=_0x385bed[_0x7756('0x42')]({'plain':!![]});if(_0x440b7a){if(_0x1f57be[_0x7756('0x3c')][_0x7756('0x4e')]){_0x1f57be[_0x7756('0x43')][_0x7756('0x4f')]({'id':0x0,'priority':_0x1f57be[_0x7756('0x43')][_0x7756('0x49')]+0x1,'app':'close','appdata':_0x7756('0x50'),'interval':'*,*,*,*'});}_0x5886ec[_0x7756('0x51')]=!![];}else{_0x5886ec[_0x7756('0x51')]=![];}_0x1f57be[_0x7756('0x52')]=_0x5886ec;return db[_0x7756('0x53')]['create']({'body':_0x1552bf[_0x7756('0x29')][_0x7756('0x29')],'FaxAccountId':_0x1552bf['account']['id'],'FaxInteractionId':_0x385bed['id'],'direction':'in','ContactId':_0x385bed[_0x7756('0x54')],'AttachmentId':_0x1552bf[_0x7756('0x29')][_0x7756('0x55')]});})[_0x7756('0x12')](function(_0x1d7b08){_0x1f57be['message']=_0x1d7b08;if(_0x1f57be[_0x7756('0x52')][_0x7756('0x56')]){return db[_0x7756('0x57')][_0x7756('0x3b')]({'attributes':['id','name'],'where':{'id':_0x1f57be['interaction']['UserId']}})[_0x7756('0x12')](function(_0x43c5de){if(_0x43c5de){_0x1f57be[_0x7756('0x43')][_0x7756('0x58')]({'id':0x0,'priority':0x0,'app':_0x7756('0x59'),'appdata':_0x43c5de[_0x7756('0x5a')]+','+(_0x1f57be['account']['waitForTheAssignedAgent']||0xa),'interval':_0x7756('0x5b')});}return respondWithRpcPromise(_0x7756('0x5c'),'startRouting',_0x1f57be);});}return respondWithRpcPromise(_0x7756('0x5c'),_0x7756('0x5d'),_0x1f57be);})[_0x7756('0x12')](function(_0x48c08c){_0x1ed51c(_0x48c08c);})['catch'](function(_0x2bb066){_0x357360(_0x4dedcf[_0x7756('0x19')](0x1f4,_0x2bb066[_0x7756('0x1b')]));});});};
\ No newline at end of file
index c3336f2..b2de0da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1537=['emit','register','length','./faxAccount.events','remove'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x1537,0x143));var _0x7153=function(_0x2c69b0,_0x147997){_0x2c69b0=_0x2c69b0-0x0;var _0x3c8425=_0x1537[_0x2c69b0];return _0x3c8425;};'use strict';var FaxAccountEvents=require(_0x7153('0x0'));var events=['save',_0x7153('0x1'),'update'];function createListener(_0x3e7427,_0xb47d23){return function(_0x5a363a){_0xb47d23[_0x7153('0x2')](_0x3e7427,_0x5a363a);};}function removeListener(_0x363b49,_0x4c6684){return function(){FaxAccountEvents['removeListener'](_0x363b49,_0x4c6684);};}exports[_0x7153('0x3')]=function(_0x21146d){for(var _0x47e1a9=0x0,_0xbba897=events[_0x7153('0x4')];_0x47e1a9<_0xbba897;_0x47e1a9++){var _0x201599=events[_0x47e1a9];var _0x4a0c67=createListener('faxAccount:'+_0x201599,_0x21146d);FaxAccountEvents['on'](_0x201599,_0x4a0c67);}};
\ No newline at end of file
+var _0x9de2=['faxAccount:','./faxAccount.events','save','emit','register','length'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x9de2,0x1ab));var _0x29de=function(_0x114203,_0x341680){_0x114203=_0x114203-0x0;var _0x2a79a0=_0x9de2[_0x114203];return _0x2a79a0;};'use strict';var FaxAccountEvents=require(_0x29de('0x0'));var events=[_0x29de('0x1'),'remove','update'];function createListener(_0x479e62,_0x11e578){return function(_0x1a39c0){_0x11e578[_0x29de('0x2')](_0x479e62,_0x1a39c0);};}function removeListener(_0x528d22,_0x2bd2f6){return function(){FaxAccountEvents['removeListener'](_0x528d22,_0x2bd2f6);};}exports[_0x29de('0x3')]=function(_0x38337d){for(var _0x1cd2e5=0x0,_0x5e2324=events[_0x29de('0x4')];_0x1cd2e5<_0x5e2324;_0x1cd2e5++){var _0x327281=events[_0x1cd2e5];var _0x670c5f=createListener(_0x29de('0x5')+_0x327281,_0x38337d);FaxAccountEvents['on'](_0x327281,_0x670c5f);}};
\ No newline at end of file
index 7df1059..bfaa679 100644 (file)
@@ -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(_0x25829a,_0x2f3735){var _0x3fead6=function(_0x227bee){while(--_0x227bee){_0x25829a['push'](_0x25829a['shift']());}};_0x3fead6(++_0x2f3735);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x2b778d,_0x5dd9e4){var _0x46a581=function(_0x3eb2ee){while(--_0x3eb2ee){_0x2b778d['push'](_0x2b778d['shift']());}};_0x46a581(++_0x5dd9e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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
index 31d899b..467edf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2656=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x2656,0x127));var _0x6265=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x2656[_0x12a554];return _0x244ba0;};'use strict';var Sequelize=require(_0x6265('0x0'));module[_0x6265('0x1')]={'priority':{'type':Sequelize[_0x6265('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6265('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6265('0x3')]},'interval':{'type':Sequelize[_0x6265('0x3')],'defaultValue':_0x6265('0x4')}};
\ No newline at end of file
+var _0x9bd7=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x38b672,_0x1961fa){var _0x800ee9=function(_0x353c51){while(--_0x353c51){_0x38b672['push'](_0x38b672['shift']());}};_0x800ee9(++_0x1961fa);}(_0x9bd7,0x1f1));var _0x79bd=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x9bd7[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x79bd('0x0'));module['exports']={'priority':{'type':Sequelize[_0x79bd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x79bd('0x2')],'allowNull':![],'defaultValue':_0x79bd('0x3')},'appdata':{'type':Sequelize[_0x79bd('0x4')]()},'description':{'type':Sequelize[_0x79bd('0x2')]},'interval':{'type':Sequelize[_0x79bd('0x2')],'defaultValue':_0x79bd('0x5')}};
\ No newline at end of file
index 1b0ad9a..bb5a63c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc59=['stack','name','send','index','map','FaxApplication','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x38aa39,_0x563f65){var _0x1ff3a5=function(_0x49213c){while(--_0x49213c){_0x38aa39['push'](_0x38aa39['shift']());}};_0x1ff3a5(++_0x563f65);}(_0xbc59,0x18c));var _0x9bc5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc59[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9bc5('0x0'));var rimraf=require(_0x9bc5('0x1'));var zipdir=require(_0x9bc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9bc5('0x3'));var BPromise=require(_0x9bc5('0x4'));var Mustache=require(_0x9bc5('0x5'));var util=require('util');var path=require(_0x9bc5('0x6'));var sox=require('sox');var csv=require(_0x9bc5('0x7'));var ejs=require(_0x9bc5('0x8'));var fs=require('fs');var fs_extra=require(_0x9bc5('0x9'));var _=require('lodash');var squel=require(_0x9bc5('0xa'));var crypto=require(_0x9bc5('0xb'));var jsforce=require(_0x9bc5('0xc'));var deskjs=require(_0x9bc5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bc5('0xe'));var Papa=require('papaparse');var Redis=require(_0x9bc5('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bc5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9bc5('0x11'));var config=require(_0x9bc5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9bc5('0x13'))['db'];function respondWithStatusCode(_0x5521dc,_0x260942){_0x260942=_0x260942||0xcc;return function(_0x2a0ec0){if(_0x2a0ec0){return _0x5521dc[_0x9bc5('0x14')](_0x260942);}return _0x5521dc[_0x9bc5('0x15')](_0x260942)[_0x9bc5('0x16')]();};}function respondWithResult(_0xcb02b0,_0xa16369){_0xa16369=_0xa16369||0xc8;return function(_0x40dc2a){if(_0x40dc2a){return _0xcb02b0[_0x9bc5('0x15')](_0xa16369)[_0x9bc5('0x17')](_0x40dc2a);}};}function respondWithFilteredResult(_0xf77413,_0x47f3ee){return function(_0x34c0d9){if(_0x34c0d9){var _0x51e179=typeof _0x47f3ee[_0x9bc5('0x18')]===_0x9bc5('0x19')&&typeof _0x47f3ee[_0x9bc5('0x1a')]===_0x9bc5('0x19');var _0x1c1c65=_0x34c0d9['count'];var _0x4e6f3c=_0x51e179?0x0:_0x47f3ee['offset'];var _0x20244f=_0x51e179?_0x34c0d9['count']:_0x47f3ee['offset']+_0x47f3ee['limit'];var _0xc9643;if(_0x20244f>=_0x1c1c65){_0x20244f=_0x1c1c65;_0xc9643=0xc8;}else{_0xc9643=0xce;}_0xf77413[_0x9bc5('0x15')](_0xc9643);return _0xf77413[_0x9bc5('0x1b')](_0x9bc5('0x1c'),_0x4e6f3c+'-'+_0x20244f+'/'+_0x1c1c65)[_0x9bc5('0x17')](_0x34c0d9);}return null;};}function patchUpdates(_0x3b0892){return function(_0x413602){try{jsonpatch[_0x9bc5('0x1d')](_0x413602,_0x3b0892,!![]);}catch(_0x3b729f){return BPromise[_0x9bc5('0x1e')](_0x3b729f);}return _0x413602[_0x9bc5('0x1f')]();};}function saveUpdates(_0x494b8e,_0x5cdf32){return function(_0x20a14f){if(_0x20a14f){return _0x20a14f[_0x9bc5('0x20')](_0x494b8e)[_0x9bc5('0x21')](function(_0x419488){return _0x419488;});}return null;};}function removeEntity(_0x384500,_0x571b84){return function(_0x4a9eb0){if(_0x4a9eb0){return _0x4a9eb0[_0x9bc5('0x22')]()[_0x9bc5('0x21')](function(){_0x384500[_0x9bc5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd3be,_0xd3a482){return function(_0x12edb5){if(!_0x12edb5){_0x4fd3be[_0x9bc5('0x14')](0x194);}return _0x12edb5;};}function handleError(_0x39518a,_0x4d211f){_0x4d211f=_0x4d211f||0x1f4;return function(_0x55c4c6){logger[_0x9bc5('0x23')](_0x55c4c6[_0x9bc5('0x24')]);if(_0x55c4c6[_0x9bc5('0x25')]){delete _0x55c4c6[_0x9bc5('0x25')];}_0x39518a[_0x9bc5('0x15')](_0x4d211f)[_0x9bc5('0x26')](_0x55c4c6);};}exports[_0x9bc5('0x27')]=function(_0x44944e,_0x45d845){var _0x384029={},_0x12452d={},_0x56c9e1={'count':0x0,'rows':[]};var _0x40375f=_[_0x9bc5('0x28')](db[_0x9bc5('0x29')][_0x9bc5('0x2a')],function(_0x2d7a90){return{'name':_0x2d7a90['fieldName'],'type':_0x2d7a90[_0x9bc5('0x2b')][_0x9bc5('0x2c')]};});_0x12452d['model']=_[_0x9bc5('0x28')](_0x40375f,_0x9bc5('0x25'));_0x12452d[_0x9bc5('0x2d')]=_[_0x9bc5('0x2e')](_0x44944e[_0x9bc5('0x2d')]);_0x12452d['filters']=_[_0x9bc5('0x2f')](_0x12452d[_0x9bc5('0x30')],_0x12452d[_0x9bc5('0x2d')]);_0x384029[_0x9bc5('0x31')]=_[_0x9bc5('0x2f')](_0x12452d[_0x9bc5('0x30')],qs[_0x9bc5('0x32')](_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x32')]));_0x384029['attributes']=_0x384029[_0x9bc5('0x31')][_0x9bc5('0x33')]?_0x384029[_0x9bc5('0x31')]:_0x12452d['model'];if(!_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x34')](_0x9bc5('0x35'))){_0x384029[_0x9bc5('0x1a')]=qs[_0x9bc5('0x1a')](_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x1a')]);_0x384029['offset']=qs[_0x9bc5('0x18')](_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x18')]);}_0x384029[_0x9bc5('0x36')]=qs['sort'](_0x44944e[_0x9bc5('0x2d')]['sort']);_0x384029[_0x9bc5('0x37')]=qs[_0x9bc5('0x38')](_[_0x9bc5('0x39')](_0x44944e[_0x9bc5('0x2d')],_0x12452d['filters']),_0x40375f);if(_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x3a')]){_0x384029[_0x9bc5('0x37')]=_[_0x9bc5('0x3b')](_0x384029[_0x9bc5('0x37')],{'$or':_['map'](_0x40375f,function(_0x189888){if(_0x189888[_0x9bc5('0x2b')]!==_0x9bc5('0x3c')){var _0x3d1198={};_0x3d1198[_0x189888['name']]={'$like':'%'+_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x3a')]+'%'};return _0x3d1198;}})});}_0x384029=_[_0x9bc5('0x3b')]({},_0x384029,_0x44944e[_0x9bc5('0x3d')]);var _0x219840={'where':_0x384029[_0x9bc5('0x37')]};return db[_0x9bc5('0x29')]['count'](_0x219840)[_0x9bc5('0x21')](function(_0xf03444){_0x56c9e1[_0x9bc5('0x3e')]=_0xf03444;if(_0x44944e[_0x9bc5('0x2d')][_0x9bc5('0x3f')]){_0x384029[_0x9bc5('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0x9bc5('0x41')](_0x384029);})[_0x9bc5('0x21')](function(_0x41f97f){_0x56c9e1[_0x9bc5('0x42')]=_0x41f97f;return _0x56c9e1;})[_0x9bc5('0x21')](respondWithFilteredResult(_0x45d845,_0x384029))[_0x9bc5('0x43')](handleError(_0x45d845,null));};exports['show']=function(_0x57e8eb,_0x5b7244){var _0x5801ad={'raw':!![],'where':{'id':_0x57e8eb['params']['id']}},_0x2695af={};_0x2695af['model']=_[_0x9bc5('0x2e')](db[_0x9bc5('0x29')][_0x9bc5('0x2a')]);_0x2695af[_0x9bc5('0x2d')]=_[_0x9bc5('0x2e')](_0x57e8eb[_0x9bc5('0x2d')]);_0x2695af[_0x9bc5('0x38')]=_[_0x9bc5('0x2f')](_0x2695af[_0x9bc5('0x30')],_0x2695af[_0x9bc5('0x2d')]);_0x5801ad[_0x9bc5('0x31')]=_[_0x9bc5('0x2f')](_0x2695af[_0x9bc5('0x30')],qs[_0x9bc5('0x32')](_0x57e8eb[_0x9bc5('0x2d')][_0x9bc5('0x32')]));_0x5801ad[_0x9bc5('0x31')]=_0x5801ad['attributes']['length']?_0x5801ad[_0x9bc5('0x31')]:_0x2695af['model'];if(_0x57e8eb[_0x9bc5('0x2d')]['includeAll']){_0x5801ad[_0x9bc5('0x40')]=[{'all':!![]}];}_0x5801ad=_[_0x9bc5('0x3b')]({},_0x5801ad,_0x57e8eb[_0x9bc5('0x3d')]);return db[_0x9bc5('0x29')][_0x9bc5('0x44')](_0x5801ad)[_0x9bc5('0x21')](handleEntityNotFound(_0x5b7244,null))['then'](respondWithResult(_0x5b7244,null))[_0x9bc5('0x43')](handleError(_0x5b7244,null));};exports[_0x9bc5('0x45')]=function(_0x4a7b98,_0x42fcdc){return db[_0x9bc5('0x29')][_0x9bc5('0x45')](_0x4a7b98[_0x9bc5('0x46')],{})[_0x9bc5('0x21')](respondWithResult(_0x42fcdc,0xc9))['catch'](handleError(_0x42fcdc,null));};exports[_0x9bc5('0x20')]=function(_0x1ed772,_0x2fed1c){if(_0x1ed772[_0x9bc5('0x46')]['id']){delete _0x1ed772[_0x9bc5('0x46')]['id'];}return db[_0x9bc5('0x29')][_0x9bc5('0x44')]({'where':{'id':_0x1ed772['params']['id']}})[_0x9bc5('0x21')](handleEntityNotFound(_0x2fed1c,null))['then'](saveUpdates(_0x1ed772[_0x9bc5('0x46')],null))[_0x9bc5('0x21')](respondWithResult(_0x2fed1c,null))[_0x9bc5('0x43')](handleError(_0x2fed1c,null));};exports[_0x9bc5('0x22')]=function(_0x462d7b,_0x286970){return db[_0x9bc5('0x29')]['find']({'where':{'id':_0x462d7b[_0x9bc5('0x47')]['id']}})[_0x9bc5('0x21')](handleEntityNotFound(_0x286970,null))[_0x9bc5('0x21')](removeEntity(_0x286970,null))[_0x9bc5('0x43')](handleError(_0x286970,null));};
\ No newline at end of file
+var _0xa4d4=['key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FaxApplication','include','findAll','rows','show','params','length','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','update','then','error','stack','index','map','rawAttributes','fieldName','type'];(function(_0xe2ab1,_0xb15b6c){var _0x462cfb=function(_0x439be1){while(--_0x439be1){_0xe2ab1['push'](_0xe2ab1['shift']());}};_0x462cfb(++_0xb15b6c);}(_0xa4d4,0x13d));var _0x4a4d=function(_0x2f3f46,_0x51e622){_0x2f3f46=_0x2f3f46-0x0;var _0xa7bfda=_0xa4d4[_0x2f3f46];return _0xa7bfda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a4d('0x0'));var zipdir=require(_0x4a4d('0x1'));var jsonpatch=require(_0x4a4d('0x2'));var rp=require(_0x4a4d('0x3'));var moment=require('moment');var BPromise=require(_0x4a4d('0x4'));var Mustache=require(_0x4a4d('0x5'));var util=require(_0x4a4d('0x6'));var path=require(_0x4a4d('0x7'));var sox=require(_0x4a4d('0x8'));var csv=require(_0x4a4d('0x9'));var ejs=require(_0x4a4d('0xa'));var fs=require('fs');var fs_extra=require(_0x4a4d('0xb'));var _=require(_0x4a4d('0xc'));var squel=require('squel');var crypto=require(_0x4a4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a4d('0xe'));var toCsv=require(_0x4a4d('0x9'));var querystring=require('querystring');var Papa=require(_0x4a4d('0xf'));var Redis=require('ioredis');var authService=require(_0x4a4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4a4d('0x11'));var hardwareService=require(_0x4a4d('0x12'));var logger=require(_0x4a4d('0x13'))('api');var utils=require(_0x4a4d('0x14'));var config=require(_0x4a4d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a4d('0x16'))['db'];function respondWithStatusCode(_0x23befe,_0x25994a){_0x25994a=_0x25994a||0xcc;return function(_0x512a62){if(_0x512a62){return _0x23befe[_0x4a4d('0x17')](_0x25994a);}return _0x23befe[_0x4a4d('0x18')](_0x25994a)[_0x4a4d('0x19')]();};}function respondWithResult(_0x5687f3,_0x35b156){_0x35b156=_0x35b156||0xc8;return function(_0x1ae625){if(_0x1ae625){return _0x5687f3[_0x4a4d('0x18')](_0x35b156)[_0x4a4d('0x1a')](_0x1ae625);}};}function respondWithFilteredResult(_0x3ad1b0,_0x3ff1fd){return function(_0x57397a){if(_0x57397a){var _0x388498=typeof _0x3ff1fd['offset']===_0x4a4d('0x1b')&&typeof _0x3ff1fd[_0x4a4d('0x1c')]===_0x4a4d('0x1b');var _0x83cd56=_0x57397a['count'];var _0x442db8=_0x388498?0x0:_0x3ff1fd[_0x4a4d('0x1d')];var _0xa89c18=_0x388498?_0x57397a[_0x4a4d('0x1e')]:_0x3ff1fd['offset']+_0x3ff1fd['limit'];var _0x1f8efd;if(_0xa89c18>=_0x83cd56){_0xa89c18=_0x83cd56;_0x1f8efd=0xc8;}else{_0x1f8efd=0xce;}_0x3ad1b0['status'](_0x1f8efd);return _0x3ad1b0[_0x4a4d('0x1f')]('Content-Range',_0x442db8+'-'+_0xa89c18+'/'+_0x83cd56)[_0x4a4d('0x1a')](_0x57397a);}return null;};}function patchUpdates(_0x2c801a){return function(_0x18708d){try{jsonpatch[_0x4a4d('0x20')](_0x18708d,_0x2c801a,!![]);}catch(_0x4dacc4){return BPromise[_0x4a4d('0x21')](_0x4dacc4);}return _0x18708d['save']();};}function saveUpdates(_0x194709,_0x1e8492){return function(_0x2a1179){if(_0x2a1179){return _0x2a1179[_0x4a4d('0x22')](_0x194709)[_0x4a4d('0x23')](function(_0x44d2d0){return _0x44d2d0;});}return null;};}function removeEntity(_0x599666,_0x25983b){return function(_0x3df3e2){if(_0x3df3e2){return _0x3df3e2['destroy']()['then'](function(){_0x599666[_0x4a4d('0x18')](0xcc)[_0x4a4d('0x19')]();});}};}function handleEntityNotFound(_0x5d7a8b,_0x560b6b){return function(_0x168a72){if(!_0x168a72){_0x5d7a8b[_0x4a4d('0x17')](0x194);}return _0x168a72;};}function handleError(_0x584dae,_0x4c0efd){_0x4c0efd=_0x4c0efd||0x1f4;return function(_0x564793){logger[_0x4a4d('0x24')](_0x564793[_0x4a4d('0x25')]);if(_0x564793['name']){delete _0x564793['name'];}_0x584dae['status'](_0x4c0efd)['send'](_0x564793);};}exports[_0x4a4d('0x26')]=function(_0x4b6053,_0x406d48){var _0x34c4b4={},_0x598904={},_0x492c6b={'count':0x0,'rows':[]};var _0x2c5293=_[_0x4a4d('0x27')](db['FaxApplication'][_0x4a4d('0x28')],function(_0x551cae){return{'name':_0x551cae[_0x4a4d('0x29')],'type':_0x551cae[_0x4a4d('0x2a')][_0x4a4d('0x2b')]};});_0x598904[_0x4a4d('0x2c')]=_[_0x4a4d('0x27')](_0x2c5293,_0x4a4d('0x2d'));_0x598904[_0x4a4d('0x2e')]=_[_0x4a4d('0x2f')](_0x4b6053['query']);_0x598904[_0x4a4d('0x30')]=_[_0x4a4d('0x31')](_0x598904['model'],_0x598904[_0x4a4d('0x2e')]);_0x34c4b4[_0x4a4d('0x32')]=_[_0x4a4d('0x31')](_0x598904['model'],qs[_0x4a4d('0x33')](_0x4b6053['query']['fields']));_0x34c4b4[_0x4a4d('0x32')]=_0x34c4b4[_0x4a4d('0x32')]['length']?_0x34c4b4[_0x4a4d('0x32')]:_0x598904[_0x4a4d('0x2c')];if(!_0x4b6053[_0x4a4d('0x2e')]['hasOwnProperty'](_0x4a4d('0x34'))){_0x34c4b4[_0x4a4d('0x1c')]=qs['limit'](_0x4b6053['query']['limit']);_0x34c4b4[_0x4a4d('0x1d')]=qs[_0x4a4d('0x1d')](_0x4b6053[_0x4a4d('0x2e')]['offset']);}_0x34c4b4['order']=qs[_0x4a4d('0x35')](_0x4b6053[_0x4a4d('0x2e')][_0x4a4d('0x35')]);_0x34c4b4[_0x4a4d('0x36')]=qs[_0x4a4d('0x30')](_[_0x4a4d('0x37')](_0x4b6053[_0x4a4d('0x2e')],_0x598904[_0x4a4d('0x30')]),_0x2c5293);if(_0x4b6053[_0x4a4d('0x2e')][_0x4a4d('0x38')]){_0x34c4b4[_0x4a4d('0x36')]=_['merge'](_0x34c4b4[_0x4a4d('0x36')],{'$or':_['map'](_0x2c5293,function(_0x45851f){if(_0x45851f[_0x4a4d('0x2a')]!==_0x4a4d('0x39')){var _0x3845ed={};_0x3845ed[_0x45851f['name']]={'$like':'%'+_0x4b6053['query']['filter']+'%'};return _0x3845ed;}})});}_0x34c4b4=_[_0x4a4d('0x3a')]({},_0x34c4b4,_0x4b6053[_0x4a4d('0x3b')]);var _0x237112={'where':_0x34c4b4['where']};return db[_0x4a4d('0x3c')][_0x4a4d('0x1e')](_0x237112)[_0x4a4d('0x23')](function(_0x25d9ad){_0x492c6b['count']=_0x25d9ad;if(_0x4b6053[_0x4a4d('0x2e')]['includeAll']){_0x34c4b4[_0x4a4d('0x3d')]=[{'all':!![]}];}return db[_0x4a4d('0x3c')][_0x4a4d('0x3e')](_0x34c4b4);})['then'](function(_0x240036){_0x492c6b[_0x4a4d('0x3f')]=_0x240036;return _0x492c6b;})[_0x4a4d('0x23')](respondWithFilteredResult(_0x406d48,_0x34c4b4))['catch'](handleError(_0x406d48,null));};exports[_0x4a4d('0x40')]=function(_0x365c1f,_0x8ae4e0){var _0x17770e={'raw':!![],'where':{'id':_0x365c1f[_0x4a4d('0x41')]['id']}},_0x577303={};_0x577303[_0x4a4d('0x2c')]=_['keys'](db['FaxApplication'][_0x4a4d('0x28')]);_0x577303[_0x4a4d('0x2e')]=_[_0x4a4d('0x2f')](_0x365c1f['query']);_0x577303[_0x4a4d('0x30')]=_[_0x4a4d('0x31')](_0x577303[_0x4a4d('0x2c')],_0x577303[_0x4a4d('0x2e')]);_0x17770e[_0x4a4d('0x32')]=_[_0x4a4d('0x31')](_0x577303[_0x4a4d('0x2c')],qs[_0x4a4d('0x33')](_0x365c1f[_0x4a4d('0x2e')][_0x4a4d('0x33')]));_0x17770e['attributes']=_0x17770e[_0x4a4d('0x32')][_0x4a4d('0x42')]?_0x17770e['attributes']:_0x577303[_0x4a4d('0x2c')];if(_0x365c1f[_0x4a4d('0x2e')]['includeAll']){_0x17770e['include']=[{'all':!![]}];}_0x17770e=_[_0x4a4d('0x3a')]({},_0x17770e,_0x365c1f[_0x4a4d('0x3b')]);return db[_0x4a4d('0x3c')][_0x4a4d('0x43')](_0x17770e)[_0x4a4d('0x23')](handleEntityNotFound(_0x8ae4e0,null))[_0x4a4d('0x23')](respondWithResult(_0x8ae4e0,null))[_0x4a4d('0x44')](handleError(_0x8ae4e0,null));};exports[_0x4a4d('0x45')]=function(_0x396dba,_0x59c621){return db[_0x4a4d('0x3c')][_0x4a4d('0x45')](_0x396dba['body'],{})[_0x4a4d('0x23')](respondWithResult(_0x59c621,0xc9))[_0x4a4d('0x44')](handleError(_0x59c621,null));};exports[_0x4a4d('0x22')]=function(_0x5db694,_0x8ea272){if(_0x5db694[_0x4a4d('0x46')]['id']){delete _0x5db694[_0x4a4d('0x46')]['id'];}return db[_0x4a4d('0x3c')][_0x4a4d('0x43')]({'where':{'id':_0x5db694[_0x4a4d('0x41')]['id']}})[_0x4a4d('0x23')](handleEntityNotFound(_0x8ea272,null))[_0x4a4d('0x23')](saveUpdates(_0x5db694[_0x4a4d('0x46')],null))[_0x4a4d('0x23')](respondWithResult(_0x8ea272,null))[_0x4a4d('0x44')](handleError(_0x8ea272,null));};exports[_0x4a4d('0x47')]=function(_0x21ab59,_0x40c880){return db[_0x4a4d('0x3c')][_0x4a4d('0x43')]({'where':{'id':_0x21ab59['params']['id']}})[_0x4a4d('0x23')](handleEntityNotFound(_0x40c880,null))[_0x4a4d('0x23')](removeEntity(_0x40c880,null))['catch'](handleError(_0x40c880,null));};
\ No newline at end of file
index 3d04b44..31ba4f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6b3=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird'];(function(_0x3e7054,_0x2e467f){var _0x504dd4=function(_0x28532d){while(--_0x28532d){_0x3e7054['push'](_0x3e7054['shift']());}};_0x504dd4(++_0x2e467f);}(_0xd6b3,0x184));var _0x3d6b=function(_0x76ca18,_0x1e2264){_0x76ca18=_0x76ca18-0x0;var _0x381362=_0xd6b3[_0x76ca18];return _0x381362;};'use strict';var _=require(_0x3d6b('0x0'));var util=require('util');var logger=require(_0x3d6b('0x1'))('api');var moment=require(_0x3d6b('0x2'));var BPromise=require(_0x3d6b('0x3'));var rp=require(_0x3d6b('0x4'));var fs=require('fs');var path=require(_0x3d6b('0x5'));var rimraf=require(_0x3d6b('0x6'));var config=require(_0x3d6b('0x7'));var attributes=require(_0x3d6b('0x8'));module[_0x3d6b('0x9')]=function(_0x283de2,_0x3f761e){return _0x283de2['define'](_0x3d6b('0xa'),attributes,{'tableName':_0x3d6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d6b('0xc'),'collate':_0x3d6b('0xd')});};
\ No newline at end of file
+var _0xe79c=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xe79c,0xa7));var _0xce79=function(_0x4ae9a3,_0x2a541b){_0x4ae9a3=_0x4ae9a3-0x0;var _0x92bcd8=_0xe79c[_0x4ae9a3];return _0x92bcd8;};'use strict';var _=require(_0xce79('0x0'));var util=require(_0xce79('0x1'));var logger=require(_0xce79('0x2'))(_0xce79('0x3'));var moment=require(_0xce79('0x4'));var BPromise=require(_0xce79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce79('0x6'));var config=require(_0xce79('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x41913a,_0x14d670){return _0x41913a[_0xce79('0x8')](_0xce79('0x9'),attributes,{'tableName':_0xce79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce79('0xb'),'collate':_0xce79('0xc')});};
\ No newline at end of file
index 79cee37..f5e28ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11fe=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateFaxApplication','update','options','where','attributes','limit','debug','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x10f30d,_0x13cc69){var _0x399a1c=function(_0x3df413){while(--_0x3df413){_0x10f30d['push'](_0x10f30d['shift']());}};_0x399a1c(++_0x13cc69);}(_0x11fe,0xb8));var _0xe11f=function(_0x24a077,_0x14e017){_0x24a077=_0x24a077-0x0;var _0x3c616a=_0x11fe[_0x24a077];return _0x3c616a;};'use strict';var _=require('lodash');var util=require(_0xe11f('0x0'));var moment=require(_0xe11f('0x1'));var BPromise=require(_0xe11f('0x2'));var rs=require(_0xe11f('0x3'));var fs=require('fs');var Redis=require(_0xe11f('0x4'));var db=require(_0xe11f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe11f('0x6'))(_0xe11f('0x7'));var config=require('../../config/environment');var jayson=require(_0xe11f('0x8'));var client=jayson['client'][_0xe11f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5660c6,_0x3b73ab,_0x5b7284){return new BPromise(function(_0x1e5b75,_0x4d71e6){return client[_0xe11f('0xa')](_0x5660c6,_0x5b7284)[_0xe11f('0xb')](function(_0x1ca19d){logger[_0xe11f('0xc')](_0xe11f('0xd'),_0x3b73ab,_0xe11f('0xe'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3b73ab,'request\x20sent',JSON['stringify'](_0x1ca19d));if(_0x1ca19d[_0xe11f('0xf')]){if(_0x1ca19d[_0xe11f('0xf')][_0xe11f('0x10')]===0x1f4){logger[_0xe11f('0xf')](_0xe11f('0xd'),_0x3b73ab,_0x1ca19d[_0xe11f('0xf')]['message']);return _0x4d71e6(_0x1ca19d['error'][_0xe11f('0x11')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x3b73ab,_0x1ca19d[_0xe11f('0xf')][_0xe11f('0x11')]);return _0x1e5b75(_0x1ca19d[_0xe11f('0xf')][_0xe11f('0x11')]);}else{logger[_0xe11f('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3b73ab,'request\x20sent');_0x1e5b75(_0x1ca19d['result'][_0xe11f('0x11')]);}})[_0xe11f('0x12')](function(_0x177271){logger[_0xe11f('0xf')](_0xe11f('0xd'),_0x3b73ab,_0x177271);_0x4d71e6(_0x177271);});});}exports[_0xe11f('0x13')]=function(_0x41da46){var _0x722e51=this;return new Promise(function(_0x2d570a,_0x42dfb8){return db['FaxApplication'][_0xe11f('0x14')](_0x41da46['body'],{'raw':_0x41da46[_0xe11f('0x15')]?_0x41da46['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41da46[_0xe11f('0x15')]?_0x41da46[_0xe11f('0x15')][_0xe11f('0x16')]||null:null,'attributes':_0x41da46['options']?_0x41da46[_0xe11f('0x15')][_0xe11f('0x17')]||null:null,'limit':_0x41da46[_0xe11f('0x15')]?_0x41da46[_0xe11f('0x15')][_0xe11f('0x18')]||null:null})[_0xe11f('0xb')](function(_0x18e80b){logger[_0xe11f('0xc')]('UpdateFaxApplication',_0x41da46);logger[_0xe11f('0x19')](_0xe11f('0x13'),_0x41da46,JSON[_0xe11f('0x1a')](_0x18e80b));_0x2d570a(_0x18e80b);})[_0xe11f('0x12')](function(_0x312d1c){logger[_0xe11f('0xf')](_0xe11f('0x13'),_0x312d1c['message'],_0x41da46);_0x42dfb8(_0x722e51[_0xe11f('0xf')](0x1f4,_0x312d1c[_0xe11f('0x11')]));});});};
\ No newline at end of file
+var _0x1268=['update','body','options','raw','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateFaxApplication','FaxApplication'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x1268,0x1b6));var _0x8126=function(_0x428cfd,_0xabf4ee){_0x428cfd=_0x428cfd-0x0;var _0x5308ab=_0x1268[_0x428cfd];return _0x5308ab;};'use strict';var _=require(_0x8126('0x0'));var util=require('util');var moment=require(_0x8126('0x1'));var BPromise=require('bluebird');var rs=require(_0x8126('0x2'));var fs=require('fs');var Redis=require(_0x8126('0x3'));var db=require(_0x8126('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8126('0x5'))(_0x8126('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8126('0x7')][_0x8126('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c7dcc,_0xd8f19,_0x4c9875){return new BPromise(function(_0x3233ec,_0x24f947){return client['request'](_0x5c7dcc,_0x4c9875)[_0x8126('0x9')](function(_0x4ee24b){logger['info'](_0x8126('0xa'),_0xd8f19,_0x8126('0xb'));logger['debug'](_0x8126('0xc'),_0xd8f19,_0x8126('0xb'),JSON[_0x8126('0xd')](_0x4ee24b));if(_0x4ee24b[_0x8126('0xe')]){if(_0x4ee24b[_0x8126('0xe')][_0x8126('0xf')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0xd8f19,_0x4ee24b[_0x8126('0xe')][_0x8126('0x10')]);return _0x24f947(_0x4ee24b[_0x8126('0xe')][_0x8126('0x10')]);}logger[_0x8126('0xe')]('FaxApplication,\x20%s,\x20%s',_0xd8f19,_0x4ee24b[_0x8126('0xe')]['message']);return _0x3233ec(_0x4ee24b[_0x8126('0xe')][_0x8126('0x10')]);}else{logger[_0x8126('0x11')]('FaxApplication,\x20%s,\x20%s',_0xd8f19,_0x8126('0xb'));_0x3233ec(_0x4ee24b['result'][_0x8126('0x10')]);}})[_0x8126('0x12')](function(_0x39f890){logger[_0x8126('0xe')](_0x8126('0xa'),_0xd8f19,_0x39f890);_0x24f947(_0x39f890);});});}exports[_0x8126('0x13')]=function(_0x20fc44){var _0x5d6369=this;return new Promise(function(_0x59cbb9,_0x3b4d66){return db[_0x8126('0x14')][_0x8126('0x15')](_0x20fc44[_0x8126('0x16')],{'raw':_0x20fc44[_0x8126('0x17')]?_0x20fc44[_0x8126('0x17')][_0x8126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fc44[_0x8126('0x17')]?_0x20fc44[_0x8126('0x17')]['where']||null:null,'attributes':_0x20fc44[_0x8126('0x17')]?_0x20fc44[_0x8126('0x17')]['attributes']||null:null,'limit':_0x20fc44[_0x8126('0x17')]?_0x20fc44[_0x8126('0x17')][_0x8126('0x19')]||null:null})['then'](function(_0x52e3ad){logger[_0x8126('0x11')](_0x8126('0x13'),_0x20fc44);logger[_0x8126('0x1a')]('UpdateFaxApplication',_0x20fc44,JSON['stringify'](_0x52e3ad));_0x59cbb9(_0x52e3ad);})[_0x8126('0x12')](function(_0x21f597){logger[_0x8126('0xe')](_0x8126('0x13'),_0x21f597['message'],_0x20fc44);_0x3b4d66(_0x5d6369[_0x8126('0xe')](0x1f4,_0x21f597[_0x8126('0x10')]));});});};
\ No newline at end of file
index 614389e..d0b6ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0x8603,0x190));var _0x3860=function(_0x4812dd,_0x38e4db){_0x4812dd=_0x4812dd-0x0;var _0x5bade8=_0x8603[_0x4812dd];return _0x5bade8;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
+var _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0xdbbe09,_0x1469b1){var _0x52d026=function(_0x27f008){while(--_0x27f008){_0xdbbe09['push'](_0xdbbe09['shift']());}};_0x52d026(++_0x1469b1);}(_0xb62e,0x1de));var _0xeb62=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb62e[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router;
\ No newline at end of file
index 5c4820d..eeb3be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e9=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x22ad27,_0x300b99){var _0x1bdd68=function(_0x2c11c0){while(--_0x2c11c0){_0x22ad27['push'](_0x22ad27['shift']());}};_0x1bdd68(++_0x300b99);}(_0x98e9,0x169));var _0x998e=function(_0x7a5dc6,_0x5a81d1){_0x7a5dc6=_0x7a5dc6-0x0;var _0x29d989=_0x98e9[_0x7a5dc6];return _0x29d989;};'use strict';var Sequelize=require(_0x998e('0x0'));module[_0x998e('0x1')]={'closed':{'type':Sequelize[_0x998e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x998e('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x998e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x998e('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x998e('0x5')]('in',_0x998e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x998e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x998e('0x5')]('in',_0x998e('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xa1b1=['sequelize','exports','STRING','DATE','ENUM','out'];(function(_0x4d7df6,_0x3f6139){var _0x4c0d29=function(_0x12ae02){while(--_0x12ae02){_0x4d7df6['push'](_0x4d7df6['shift']());}};_0x4c0d29(++_0x3f6139);}(_0xa1b1,0x138));var _0x1a1b=function(_0x3d7f0e,_0x104d69){_0x3d7f0e=_0x3d7f0e-0x0;var _0x3e45dd=_0xa1b1[_0x3d7f0e];return _0x3e45dd;};'use strict';var Sequelize=require(_0x1a1b('0x0'));module[_0x1a1b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1a1b('0x2')]},'secondDisposition':{'type':Sequelize[_0x1a1b('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1a1b('0x2')]},'read1stAt':{'type':Sequelize[_0x1a1b('0x3')]},'fax':{'type':Sequelize[_0x1a1b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1a1b('0x4')]('in',_0x1a1b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1a1b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1a1b('0x4')]('in',_0x1a1b('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 4301797..3982b33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cf6=['limit','set','Content-Range','json','update','then','destroy','error','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','user','show','model','keys','query','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','params','describe','addMessage','ids','findOne','FaxMessage','filters','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags','setTags','omit','spread','Tag','faxInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','resolve','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count'];(function(_0x47d1fa,_0x43de69){var _0x45ce37=function(_0x18c07c){while(--_0x18c07c){_0x47d1fa['push'](_0x47d1fa['shift']());}};_0x45ce37(++_0x43de69);}(_0x7cf6,0x124));var _0x67cf=function(_0x364860,_0x36286f){_0x364860=_0x364860-0x0;var _0x5a9381=_0x7cf6[_0x364860];return _0x5a9381;};'use strict';var rimraf=require(_0x67cf('0x0'));var zipdir=require(_0x67cf('0x1'));var moment=require(_0x67cf('0x2'));var BPromise=require(_0x67cf('0x3'));var util=require(_0x67cf('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x67cf('0x5'));var Redis=require(_0x67cf('0x6'));var interaction=require(_0x67cf('0x7'));var qs=require(_0x67cf('0x8'));var logger=require(_0x67cf('0x9'))(_0x67cf('0xa'));var config=require(_0x67cf('0xb'));var db=require('../../mysqldb')['db'];config[_0x67cf('0xc')]=_[_0x67cf('0xd')](config[_0x67cf('0xc')],{'host':_0x67cf('0xe'),'port':0x18eb});var socket=require(_0x67cf('0xf'))(new Redis(config[_0x67cf('0xc')]));require('./faxInteraction.socket')[_0x67cf('0x10')](socket);function respondWithStatusCode(_0x23f083,_0x505357){_0x505357=_0x505357||0xcc;return function(_0x59c6f5){if(_0x59c6f5){return _0x23f083[_0x67cf('0x11')](_0x505357);}return _0x23f083[_0x67cf('0x12')](_0x505357)[_0x67cf('0x13')]();};}function respondWithResult(_0x500db9,_0x26ed4d){_0x26ed4d=_0x26ed4d||0xc8;return function(_0xac93ee){if(_0xac93ee){return _0x500db9[_0x67cf('0x12')](_0x26ed4d)['json'](_0xac93ee);}};}function respondWithFilteredResult(_0x313baf,_0x525371){return function(_0x21a646){if(_0x21a646){var _0x3ad424=typeof _0x525371[_0x67cf('0x14')]===_0x67cf('0x15')&&typeof _0x525371['limit']===_0x67cf('0x15');var _0x3bb425=_0x21a646[_0x67cf('0x16')];var _0x1a4735=_0x3ad424?0x0:_0x525371[_0x67cf('0x14')];var _0x104cb3=_0x3ad424?_0x21a646[_0x67cf('0x16')]:_0x525371[_0x67cf('0x14')]+_0x525371[_0x67cf('0x17')];var _0x1d4827;if(_0x104cb3>=_0x3bb425){_0x104cb3=_0x3bb425;_0x1d4827=0xc8;}else{_0x1d4827=0xce;}_0x313baf[_0x67cf('0x12')](_0x1d4827);return _0x313baf[_0x67cf('0x18')](_0x67cf('0x19'),_0x1a4735+'-'+_0x104cb3+'/'+_0x3bb425)[_0x67cf('0x1a')](_0x21a646);}return null;};}function saveUpdates(_0x3024df){return function(_0x2ff5be){if(_0x2ff5be){return _0x2ff5be[_0x67cf('0x1b')](_0x3024df)[_0x67cf('0x1c')](function(_0x289b87){return _0x289b87;});}return null;};}function removeEntity(_0x219967){return function(_0xbe1d7c){if(_0xbe1d7c){return _0xbe1d7c[_0x67cf('0x1d')]()[_0x67cf('0x1c')](function(){_0x219967['status'](0xcc)[_0x67cf('0x13')]();});}};}function handleEntityNotFound(_0x4c2a7d){return function(_0x52071d){if(!_0x52071d){_0x4c2a7d['sendStatus'](0x194);}return _0x52071d;};}function handleError(_0x475f38,_0xb5298f){_0xb5298f=_0xb5298f||0x1f4;return function(_0x4184d8){logger[_0x67cf('0x1e')](_0x4184d8['stack']);if(_0x4184d8[_0x67cf('0x1f')]){delete _0x4184d8[_0x67cf('0x1f')];}_0x475f38[_0x67cf('0x12')](_0xb5298f)[_0x67cf('0x20')](_0x4184d8);};}exports[_0x67cf('0x21')]=function(_0x3148e2,_0x24b355){var _0x198db8={};var _0xdbda24=_[_0x67cf('0x22')](db[_0x67cf('0x23')][_0x67cf('0x24')],function(_0x51e64a){return{'name':_0x51e64a['fieldName'],'type':_0x51e64a[_0x67cf('0x25')][_0x67cf('0x26')]};});_0x198db8=qs[_0x67cf('0x27')](_0xdbda24,_0x3148e2);return interaction[_0x67cf('0x28')]('fax',_0x3148e2['query'],_0x3148e2[_0x67cf('0x29')],_0x198db8,_0xdbda24)[_0x67cf('0x1c')](respondWithFilteredResult(_0x24b355,_0x198db8))['catch'](handleError(_0x24b355,null));};exports[_0x67cf('0x2a')]=function(_0x8b3c26,_0x15e416){var _0x34e704={'raw':![],'where':{'id':_0x8b3c26['params']['id']}},_0x3c4880={};_0x3c4880[_0x67cf('0x2b')]=_[_0x67cf('0x2c')](db[_0x67cf('0x23')]['rawAttributes']);_0x3c4880[_0x67cf('0x2d')]=_[_0x67cf('0x2c')](_0x8b3c26[_0x67cf('0x2d')]);_0x3c4880['filters']=_[_0x67cf('0x2e')](_0x3c4880[_0x67cf('0x2b')],_0x3c4880['query']);_0x34e704[_0x67cf('0x2f')]=_['intersection'](_0x3c4880[_0x67cf('0x2b')],qs[_0x67cf('0x30')](_0x8b3c26[_0x67cf('0x2d')]['fields']));_0x34e704[_0x67cf('0x2f')]=_0x34e704['attributes'][_0x67cf('0x31')]?_0x34e704[_0x67cf('0x2f')]:_0x3c4880[_0x67cf('0x2b')];if(_0x8b3c26[_0x67cf('0x2d')][_0x67cf('0x32')]){_0x34e704['include']=[{'all':!![]}];}_0x34e704=_[_0x67cf('0x33')]({},_0x34e704,_0x8b3c26['options']);return db[_0x67cf('0x23')][_0x67cf('0x34')](_0x34e704)[_0x67cf('0x1c')](handleEntityNotFound(_0x15e416,null))[_0x67cf('0x1c')](respondWithResult(_0x15e416,null))[_0x67cf('0x35')](handleError(_0x15e416,null));};exports[_0x67cf('0x36')]=function(_0x4d9d3b,_0x2e3e7c){return db[_0x67cf('0x23')][_0x67cf('0x36')](_0x4d9d3b[_0x67cf('0x37')],{})[_0x67cf('0x1c')](respondWithResult(_0x2e3e7c,0xc9))[_0x67cf('0x35')](handleError(_0x2e3e7c,null));};exports[_0x67cf('0x1b')]=function(_0x4fe91c,_0x2f8126){if(_0x4fe91c['body']['id']){delete _0x4fe91c['body']['id'];}return db[_0x67cf('0x23')][_0x67cf('0x34')]({'where':{'id':_0x4fe91c[_0x67cf('0x38')]['id']}})[_0x67cf('0x1c')](handleEntityNotFound(_0x2f8126,null))[_0x67cf('0x1c')](saveUpdates(_0x4fe91c[_0x67cf('0x37')],null))[_0x67cf('0x1c')](respondWithResult(_0x2f8126,null))['catch'](handleError(_0x2f8126,null));};exports['destroy']=function(_0x156602,_0xbf19b5){return db[_0x67cf('0x23')][_0x67cf('0x34')]({'where':{'id':_0x156602[_0x67cf('0x38')]['id']}})['then'](handleEntityNotFound(_0xbf19b5,null))[_0x67cf('0x1c')](removeEntity(_0xbf19b5,null))[_0x67cf('0x35')](handleError(_0xbf19b5,null));};exports['describe']=function(_0x2b08a5,_0x5c46c9){return db[_0x67cf('0x23')][_0x67cf('0x39')]()['then'](respondWithResult(_0x5c46c9,null))[_0x67cf('0x35')](handleError(_0x5c46c9,null));};exports[_0x67cf('0x3a')]=function(_0x5608b0,_0x3bdab5){return db['FaxMessage'][_0x67cf('0x34')]({'where':{'id':_0x5608b0[_0x67cf('0x38')]['id']}})['then'](handleEntityNotFound(_0x3bdab5,null))[_0x67cf('0x1c')](function(_0x560866){if(_0x560866){return _0x560866[_0x67cf('0x3a')](_0x5608b0[_0x67cf('0x37')]['ids'],_['omit'](_0x5608b0[_0x67cf('0x37')],[_0x67cf('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x3bdab5,null))[_0x67cf('0x35')](handleError(_0x3bdab5,null));};exports['getMessages']=function(_0x38da7d,_0x1a4daa){var _0x4b56d3={'raw':![],'where':{}};var _0x4139c8={};var _0x175a0a={'count':0x0,'rows':[]};return db[_0x67cf('0x23')][_0x67cf('0x3c')]({'where':{'id':_0x38da7d['params']['id']}})[_0x67cf('0x1c')](handleEntityNotFound(_0x1a4daa,null))[_0x67cf('0x1c')](function(_0x3efe3b){if(_0x3efe3b){_0x4139c8[_0x67cf('0x2b')]=_[_0x67cf('0x2c')](db[_0x67cf('0x3d')][_0x67cf('0x24')]);_0x4139c8[_0x67cf('0x2d')]=_[_0x67cf('0x2c')](_0x38da7d[_0x67cf('0x2d')]);_0x4139c8[_0x67cf('0x3e')]=_[_0x67cf('0x2e')](_0x4139c8[_0x67cf('0x2b')],_0x4139c8['query']);_0x4b56d3[_0x67cf('0x2f')]=_[_0x67cf('0x2e')](_0x4139c8[_0x67cf('0x2b')],qs[_0x67cf('0x30')](_0x38da7d[_0x67cf('0x2d')][_0x67cf('0x30')]));_0x4b56d3[_0x67cf('0x2f')]=_0x4b56d3[_0x67cf('0x2f')][_0x67cf('0x31')]?_0x4b56d3[_0x67cf('0x2f')]:_0x4139c8['model'];if(!_0x38da7d[_0x67cf('0x2d')][_0x67cf('0x3f')](_0x67cf('0x40'))){_0x4b56d3[_0x67cf('0x17')]=qs[_0x67cf('0x17')](_0x38da7d[_0x67cf('0x2d')][_0x67cf('0x17')]);_0x4b56d3[_0x67cf('0x14')]=qs['offset'](_0x38da7d['query'][_0x67cf('0x14')]);}_0x4b56d3[_0x67cf('0x41')]=qs[_0x67cf('0x42')](_0x38da7d['query'][_0x67cf('0x42')]);_0x4b56d3[_0x67cf('0x43')]=qs[_0x67cf('0x3e')](_['pick'](_0x38da7d[_0x67cf('0x2d')],_0x4139c8[_0x67cf('0x3e')]));_0x4b56d3[_0x67cf('0x43')][_0x67cf('0x44')]=_0x3efe3b['id'];if(_0x38da7d[_0x67cf('0x2d')][_0x67cf('0x45')]){_0x4b56d3[_0x67cf('0x43')]=_[_0x67cf('0x33')](_0x4b56d3['where'],{'$or':_[_0x67cf('0x22')](_0x4b56d3[_0x67cf('0x2f')],function(_0x32c62a){var _0xae949c={};_0xae949c[_0x32c62a]={'$like':'%'+_0x38da7d['query']['filter']+'%'};return _0xae949c;})});}if(_0x38da7d[_0x67cf('0x2d')][_0x67cf('0x46')]){var _0x169d69=_0x38da7d['query'][_0x67cf('0x46')][_0x67cf('0x47')](',');var _0x2b1dd3={};_0x2b1dd3[_0x169d69[0x0]]={'$gte':moment(_0x169d69[0x1])[_0x67cf('0x48')](_0x67cf('0x49'))};_0x4b56d3[_0x67cf('0x43')]=_[_0x67cf('0x33')](_0x4b56d3[_0x67cf('0x43')],_0x2b1dd3);}_0x4b56d3=_[_0x67cf('0x33')]({},_0x4b56d3,_0x38da7d[_0x67cf('0x4a')]);return db[_0x67cf('0x3d')][_0x67cf('0x16')]({'where':_0x4b56d3[_0x67cf('0x43')]})[_0x67cf('0x1c')](function(_0x72fedf){_0x175a0a[_0x67cf('0x16')]=_0x72fedf;if(_0x38da7d['query'][_0x67cf('0x32')]){_0x4b56d3[_0x67cf('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x67cf('0x28')](_0x4b56d3);})[_0x67cf('0x1c')](function(_0x3e602e){_0x175a0a[_0x67cf('0x4c')]=_0x3e602e;return _0x175a0a;});}})[_0x67cf('0x1c')](respondWithFilteredResult(_0x1a4daa,_0x4b56d3))[_0x67cf('0x35')](handleError(_0x1a4daa,null));};exports[_0x67cf('0x4d')]=function(_0x3052e1,_0x5b9db5){return db['FaxInteraction'][_0x67cf('0x34')]({'where':{'id':_0x3052e1['params']['id']}})[_0x67cf('0x1c')](handleEntityNotFound(_0x5b9db5,null))['then'](function(_0x47eebe){if(_0x47eebe){return _0x47eebe[_0x67cf('0x4e')](_0x3052e1[_0x67cf('0x37')][_0x67cf('0x3b')],_[_0x67cf('0x4f')](_0x3052e1[_0x67cf('0x37')],[_0x67cf('0x3b'),'id'])||{})[_0x67cf('0x50')](function(){return db[_0x67cf('0x51')][_0x67cf('0x28')]({'attributes':['id',_0x67cf('0x1f'),'color'],'where':{'id':_0x3052e1[_0x67cf('0x37')]['ids']}});})[_0x67cf('0x1c')](function(_0x2b3508){socket['emit'](_0x67cf('0x52'),{'id':Number(_0x3052e1[_0x67cf('0x38')]['id']),'tags':_0x2b3508||[]});return{'id':Number(_0x3052e1[_0x67cf('0x38')]['id']),'tags':_0x2b3508||[]};});}})[_0x67cf('0x1c')](respondWithResult(_0x5b9db5,null))[_0x67cf('0x35')](handleError(_0x5b9db5,null));};exports[_0x67cf('0x53')]=function(_0x3602c3,_0xb5aa31){return db[_0x67cf('0x23')][_0x67cf('0x34')]({'where':{'id':_0x3602c3['params']['id']}})[_0x67cf('0x1c')](handleEntityNotFound(_0xb5aa31,null))[_0x67cf('0x1c')](function(_0x1de757){if(_0x1de757){return _0x1de757[_0x67cf('0x53')](_0x3602c3['query'][_0x67cf('0x3b')]);}})['then'](respondWithStatusCode(_0xb5aa31,null))[_0x67cf('0x35')](handleError(_0xb5aa31,null));};exports['download']=function(_0x2010b3,_0x29651c){var _0x345091=moment()[_0x67cf('0x54')]()[_0x67cf('0x55')]();var _0x64dfb0=path[_0x67cf('0x56')](config[_0x67cf('0x57')],_0x67cf('0x58'),_0x67cf('0x59'),_0x67cf('0x5a'));var _0x2a83c6=path[_0x67cf('0x56')](config[_0x67cf('0x57')],_0x67cf('0x58'),_0x67cf('0x59'),_0x67cf('0x5b'));var _0x227898=path[_0x67cf('0x56')](_0x64dfb0,_0x345091);var _0x1596d1=util[_0x67cf('0x48')]('transcript-%d-%s.zip',_0x2010b3[_0x67cf('0x38')]['id'],_0x345091);var _0x5bdf48=path[_0x67cf('0x56')](_0x64dfb0,_0x1596d1);var _0x3f4bcb=[];_0x3f4bcb[_0x67cf('0x5c')]({'model':db[_0x67cf('0x5d')],'as':_0x67cf('0x5d'),'raw':!![]});var _0x4b5eb6=[{'model':db['FaxMessage'],'as':_0x67cf('0x5e'),'attributes':['id',_0x67cf('0x37'),'createdAt'],'include':_0x3f4bcb}];return db[_0x67cf('0x23')][_0x67cf('0x34')]({'where':{'id':_0x2010b3['params']['id']},'include':_0x4b5eb6})[_0x67cf('0x1c')](handleEntityNotFound(_0x29651c,null))['then'](function(_0x520a1f){if(_0x520a1f&&_0x520a1f[_0x67cf('0x5e')]){var _0x35acb7=_0x520a1f[_0x67cf('0x5f')]({'plain':!![]});fs[_0x67cf('0x60')](_0x227898);for(var _0x27f780=0x0;_0x27f780<_0x35acb7[_0x67cf('0x5e')][_0x67cf('0x31')];_0x27f780++){var _0x7fab05=_0x35acb7['Messages'][_0x27f780]['Attachment'];if(_0x7fab05){var _0x72769d=path[_0x67cf('0x56')](_0x2a83c6,_0x7fab05[_0x67cf('0x61')]);if(fs[_0x67cf('0x62')](_0x72769d)){fs['createReadStream'](_0x72769d)[_0x67cf('0x63')](fs['createWriteStream'](path[_0x67cf('0x56')](_0x227898,_0x7fab05[_0x67cf('0x61')])));}}}return BPromise[_0x67cf('0x64')]()[_0x67cf('0x1c')](function(){return new BPromise(function(_0x351741,_0x40b13a){zipdir(_0x227898,{'saveTo':_0x5bdf48},function(_0x4edd20,_0x1f331a){if(_0x4edd20)return _0x40b13a(_0x4edd20);return _0x351741(_0x1f331a);});})[_0x67cf('0x1c')](function(){return new BPromise(function(_0x4841ad,_0x5b4e94){rimraf(_0x227898,function(_0x23551a){if(_0x23551a)_0x5b4e94(_0x23551a);return _0x4841ad();});});})['then'](function(){return _0x29651c[_0x67cf('0x65')](_0x5bdf48,_0x1596d1,function(_0xbb10c2){if(_0xbb10c2){console[_0x67cf('0x66')](_0x67cf('0x67'),_0xbb10c2);}else{fs[_0x67cf('0x68')](_0x5bdf48);}});});});}else{return _0x29651c[_0x67cf('0x11')](0xc8);}})[_0x67cf('0x35')](handleError(_0x29651c,null));};
\ No newline at end of file
+var _0x7f5c=['api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','fax','query','user','catch','show','params','keys','filters','model','attributes','length','includeAll','include','options','find','body','addMessage','FaxMessage','ids','omit','getMessages','findOne','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','Tag','name','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../config/logger'];(function(_0x321c6d,_0x6e6f64){var _0x2f36da=function(_0x11c29a){while(--_0x11c29a){_0x321c6d['push'](_0x321c6d['shift']());}};_0x2f36da(++_0x6e6f64);}(_0x7f5c,0xc9));var _0xc7f5=function(_0x34198b,_0x109998){_0x34198b=_0x34198b-0x0;var _0x185a04=_0x7f5c[_0x34198b];return _0x185a04;};'use strict';var rimraf=require(_0xc7f5('0x0'));var zipdir=require(_0xc7f5('0x1'));var moment=require(_0xc7f5('0x2'));var BPromise=require(_0xc7f5('0x3'));var util=require(_0xc7f5('0x4'));var path=require(_0xc7f5('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc7f5('0x6'));var interaction=require(_0xc7f5('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xc7f5('0x8'))(_0xc7f5('0x9'));var config=require(_0xc7f5('0xa'));var db=require(_0xc7f5('0xb'))['db'];config[_0xc7f5('0xc')]=_[_0xc7f5('0xd')](config[_0xc7f5('0xc')],{'host':_0xc7f5('0xe'),'port':0x18eb});var socket=require(_0xc7f5('0xf'))(new Redis(config[_0xc7f5('0xc')]));require(_0xc7f5('0x10'))[_0xc7f5('0x11')](socket);function respondWithStatusCode(_0x4b22cd,_0x3dc003){_0x3dc003=_0x3dc003||0xcc;return function(_0x29587c){if(_0x29587c){return _0x4b22cd[_0xc7f5('0x12')](_0x3dc003);}return _0x4b22cd['status'](_0x3dc003)[_0xc7f5('0x13')]();};}function respondWithResult(_0x2ce67f,_0x1b9fdd){_0x1b9fdd=_0x1b9fdd||0xc8;return function(_0x36f5c6){if(_0x36f5c6){return _0x2ce67f[_0xc7f5('0x14')](_0x1b9fdd)[_0xc7f5('0x15')](_0x36f5c6);}};}function respondWithFilteredResult(_0x52309e,_0x2b85e6){return function(_0xff535e){if(_0xff535e){var _0x2807e6=typeof _0x2b85e6[_0xc7f5('0x16')]===_0xc7f5('0x17')&&typeof _0x2b85e6[_0xc7f5('0x18')]==='undefined';var _0x2a7ede=_0xff535e[_0xc7f5('0x19')];var _0x5d0652=_0x2807e6?0x0:_0x2b85e6['offset'];var _0x22e835=_0x2807e6?_0xff535e[_0xc7f5('0x19')]:_0x2b85e6[_0xc7f5('0x16')]+_0x2b85e6[_0xc7f5('0x18')];var _0x15a9dc;if(_0x22e835>=_0x2a7ede){_0x22e835=_0x2a7ede;_0x15a9dc=0xc8;}else{_0x15a9dc=0xce;}_0x52309e[_0xc7f5('0x14')](_0x15a9dc);return _0x52309e[_0xc7f5('0x1a')](_0xc7f5('0x1b'),_0x5d0652+'-'+_0x22e835+'/'+_0x2a7ede)[_0xc7f5('0x15')](_0xff535e);}return null;};}function saveUpdates(_0x39b65d){return function(_0x4b0880){if(_0x4b0880){return _0x4b0880[_0xc7f5('0x1c')](_0x39b65d)[_0xc7f5('0x1d')](function(_0x279e5){return _0x279e5;});}return null;};}function removeEntity(_0x7940a6){return function(_0x41469c){if(_0x41469c){return _0x41469c[_0xc7f5('0x1e')]()[_0xc7f5('0x1d')](function(){_0x7940a6[_0xc7f5('0x14')](0xcc)[_0xc7f5('0x13')]();});}};}function handleEntityNotFound(_0xf88a93){return function(_0x4c3781){if(!_0x4c3781){_0xf88a93[_0xc7f5('0x12')](0x194);}return _0x4c3781;};}function handleError(_0x1b5f41,_0xd009de){_0xd009de=_0xd009de||0x1f4;return function(_0x48bc71){logger[_0xc7f5('0x1f')](_0x48bc71['stack']);if(_0x48bc71['name']){delete _0x48bc71['name'];}_0x1b5f41['status'](_0xd009de)['send'](_0x48bc71);};}exports['index']=function(_0x1b82b0,_0x4e1c96){var _0x2cd5d1={};var _0x7f6802=_['map'](db[_0xc7f5('0x20')][_0xc7f5('0x21')],function(_0x5a9a35){return{'name':_0x5a9a35[_0xc7f5('0x22')],'type':_0x5a9a35['type'][_0xc7f5('0x23')]};});_0x2cd5d1=qs[_0xc7f5('0x24')](_0x7f6802,_0x1b82b0);return interaction[_0xc7f5('0x25')](_0xc7f5('0x26'),_0x1b82b0[_0xc7f5('0x27')],_0x1b82b0[_0xc7f5('0x28')],_0x2cd5d1,_0x7f6802)[_0xc7f5('0x1d')](respondWithFilteredResult(_0x4e1c96,_0x2cd5d1))[_0xc7f5('0x29')](handleError(_0x4e1c96,null));};exports[_0xc7f5('0x2a')]=function(_0x4d4dbc,_0x509ea3){var _0x52e81d={'raw':![],'where':{'id':_0x4d4dbc[_0xc7f5('0x2b')]['id']}},_0x3b7442={};_0x3b7442['model']=_[_0xc7f5('0x2c')](db[_0xc7f5('0x20')][_0xc7f5('0x21')]);_0x3b7442['query']=_[_0xc7f5('0x2c')](_0x4d4dbc[_0xc7f5('0x27')]);_0x3b7442[_0xc7f5('0x2d')]=_['intersection'](_0x3b7442[_0xc7f5('0x2e')],_0x3b7442[_0xc7f5('0x27')]);_0x52e81d[_0xc7f5('0x2f')]=_['intersection'](_0x3b7442['model'],qs['fields'](_0x4d4dbc['query']['fields']));_0x52e81d[_0xc7f5('0x2f')]=_0x52e81d[_0xc7f5('0x2f')][_0xc7f5('0x30')]?_0x52e81d[_0xc7f5('0x2f')]:_0x3b7442['model'];if(_0x4d4dbc[_0xc7f5('0x27')][_0xc7f5('0x31')]){_0x52e81d[_0xc7f5('0x32')]=[{'all':!![]}];}_0x52e81d=_['merge']({},_0x52e81d,_0x4d4dbc[_0xc7f5('0x33')]);return db['FaxInteraction'][_0xc7f5('0x34')](_0x52e81d)[_0xc7f5('0x1d')](handleEntityNotFound(_0x509ea3,null))[_0xc7f5('0x1d')](respondWithResult(_0x509ea3,null))[_0xc7f5('0x29')](handleError(_0x509ea3,null));};exports['create']=function(_0x5ae30a,_0x2ca5dc){return db[_0xc7f5('0x20')]['create'](_0x5ae30a['body'],{})[_0xc7f5('0x1d')](respondWithResult(_0x2ca5dc,0xc9))[_0xc7f5('0x29')](handleError(_0x2ca5dc,null));};exports['update']=function(_0x115968,_0x319f8b){if(_0x115968['body']['id']){delete _0x115968[_0xc7f5('0x35')]['id'];}return db['FaxInteraction'][_0xc7f5('0x34')]({'where':{'id':_0x115968[_0xc7f5('0x2b')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x319f8b,null))[_0xc7f5('0x1d')](saveUpdates(_0x115968[_0xc7f5('0x35')],null))['then'](respondWithResult(_0x319f8b,null))[_0xc7f5('0x29')](handleError(_0x319f8b,null));};exports[_0xc7f5('0x1e')]=function(_0x33e472,_0x168000){return db['FaxInteraction'][_0xc7f5('0x34')]({'where':{'id':_0x33e472['params']['id']}})['then'](handleEntityNotFound(_0x168000,null))['then'](removeEntity(_0x168000,null))['catch'](handleError(_0x168000,null));};exports['describe']=function(_0x2e8386,_0x1c063c){return db[_0xc7f5('0x20')]['describe']()[_0xc7f5('0x1d')](respondWithResult(_0x1c063c,null))[_0xc7f5('0x29')](handleError(_0x1c063c,null));};exports[_0xc7f5('0x36')]=function(_0x52f67a,_0x59298e){return db[_0xc7f5('0x37')][_0xc7f5('0x34')]({'where':{'id':_0x52f67a[_0xc7f5('0x2b')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x59298e,null))[_0xc7f5('0x1d')](function(_0x548328){if(_0x548328){return _0x548328[_0xc7f5('0x36')](_0x52f67a[_0xc7f5('0x35')][_0xc7f5('0x38')],_[_0xc7f5('0x39')](_0x52f67a[_0xc7f5('0x35')],[_0xc7f5('0x38'),'id'])||{});}})[_0xc7f5('0x1d')](respondWithResult(_0x59298e,null))[_0xc7f5('0x29')](handleError(_0x59298e,null));};exports[_0xc7f5('0x3a')]=function(_0x1dfb59,_0x2c781e){var _0x3de1c1={'raw':![],'where':{}};var _0x38c89c={};var _0x5cb068={'count':0x0,'rows':[]};return db[_0xc7f5('0x20')][_0xc7f5('0x3b')]({'where':{'id':_0x1dfb59[_0xc7f5('0x2b')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x2c781e,null))[_0xc7f5('0x1d')](function(_0x33125e){if(_0x33125e){_0x38c89c[_0xc7f5('0x2e')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x38c89c['query']=_['keys'](_0x1dfb59[_0xc7f5('0x27')]);_0x38c89c[_0xc7f5('0x2d')]=_[_0xc7f5('0x3c')](_0x38c89c['model'],_0x38c89c[_0xc7f5('0x27')]);_0x3de1c1[_0xc7f5('0x2f')]=_[_0xc7f5('0x3c')](_0x38c89c[_0xc7f5('0x2e')],qs[_0xc7f5('0x3d')](_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x3d')]));_0x3de1c1['attributes']=_0x3de1c1['attributes']['length']?_0x3de1c1['attributes']:_0x38c89c[_0xc7f5('0x2e')];if(!_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x3e')](_0xc7f5('0x3f'))){_0x3de1c1['limit']=qs[_0xc7f5('0x18')](_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x18')]);_0x3de1c1[_0xc7f5('0x16')]=qs[_0xc7f5('0x16')](_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x16')]);}_0x3de1c1[_0xc7f5('0x40')]=qs[_0xc7f5('0x41')](_0x1dfb59[_0xc7f5('0x27')]['sort']);_0x3de1c1['where']=qs[_0xc7f5('0x2d')](_[_0xc7f5('0x42')](_0x1dfb59[_0xc7f5('0x27')],_0x38c89c['filters']));_0x3de1c1[_0xc7f5('0x43')][_0xc7f5('0x44')]=_0x33125e['id'];if(_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x45')]){_0x3de1c1[_0xc7f5('0x43')]=_[_0xc7f5('0x46')](_0x3de1c1['where'],{'$or':_['map'](_0x3de1c1[_0xc7f5('0x2f')],function(_0x13c6a9){var _0x57cae8={};_0x57cae8[_0x13c6a9]={'$like':'%'+_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x45')]+'%'};return _0x57cae8;})});}if(_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x47')]){var _0x3684c9=_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x47')][_0xc7f5('0x48')](',');var _0x7691e8={};_0x7691e8[_0x3684c9[0x0]]={'$gte':moment(_0x3684c9[0x1])[_0xc7f5('0x49')](_0xc7f5('0x4a'))};_0x3de1c1['where']=_[_0xc7f5('0x46')](_0x3de1c1[_0xc7f5('0x43')],_0x7691e8);}_0x3de1c1=_['merge']({},_0x3de1c1,_0x1dfb59[_0xc7f5('0x33')]);return db[_0xc7f5('0x37')]['count']({'where':_0x3de1c1['where']})['then'](function(_0x24ac62){_0x5cb068[_0xc7f5('0x19')]=_0x24ac62;if(_0x1dfb59[_0xc7f5('0x27')][_0xc7f5('0x31')]){_0x3de1c1[_0xc7f5('0x32')]=[{'all':!![]}];}return db[_0xc7f5('0x37')][_0xc7f5('0x25')](_0x3de1c1);})['then'](function(_0x3b0e7f){_0x5cb068['rows']=_0x3b0e7f;return _0x5cb068;});}})[_0xc7f5('0x1d')](respondWithFilteredResult(_0x2c781e,_0x3de1c1))[_0xc7f5('0x29')](handleError(_0x2c781e,null));};exports[_0xc7f5('0x4b')]=function(_0x5c2d87,_0x4adfae){return db[_0xc7f5('0x20')][_0xc7f5('0x34')]({'where':{'id':_0x5c2d87[_0xc7f5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4adfae,null))['then'](function(_0x28f46d){if(_0x28f46d){return _0x28f46d['setTags'](_0x5c2d87[_0xc7f5('0x35')]['ids'],_[_0xc7f5('0x39')](_0x5c2d87[_0xc7f5('0x35')],[_0xc7f5('0x38'),'id'])||{})['spread'](function(){return db[_0xc7f5('0x4c')][_0xc7f5('0x25')]({'attributes':['id',_0xc7f5('0x4d'),_0xc7f5('0x4e')],'where':{'id':_0x5c2d87[_0xc7f5('0x35')][_0xc7f5('0x38')]}});})[_0xc7f5('0x1d')](function(_0x1adbfb){socket[_0xc7f5('0x4f')](_0xc7f5('0x50'),{'id':Number(_0x5c2d87[_0xc7f5('0x2b')]['id']),'tags':_0x1adbfb||[]});return{'id':Number(_0x5c2d87[_0xc7f5('0x2b')]['id']),'tags':_0x1adbfb||[]};});}})[_0xc7f5('0x1d')](respondWithResult(_0x4adfae,null))[_0xc7f5('0x29')](handleError(_0x4adfae,null));};exports[_0xc7f5('0x51')]=function(_0x5ed55d,_0x165224){return db[_0xc7f5('0x20')][_0xc7f5('0x34')]({'where':{'id':_0x5ed55d[_0xc7f5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x165224,null))['then'](function(_0x509d51){if(_0x509d51){return _0x509d51[_0xc7f5('0x51')](_0x5ed55d[_0xc7f5('0x27')][_0xc7f5('0x38')]);}})['then'](respondWithStatusCode(_0x165224,null))['catch'](handleError(_0x165224,null));};exports[_0xc7f5('0x52')]=function(_0x44574c,_0x5063ba){var _0x52441b=moment()[_0xc7f5('0x53')]()[_0xc7f5('0x54')]();var _0x5bf0ae=path[_0xc7f5('0x55')](config[_0xc7f5('0x56')],_0xc7f5('0x57'),_0xc7f5('0x58'),_0xc7f5('0x59'));var _0x38ab17=path[_0xc7f5('0x55')](config[_0xc7f5('0x56')],_0xc7f5('0x57'),_0xc7f5('0x58'),_0xc7f5('0x5a'));var _0x48c7dc=path[_0xc7f5('0x55')](_0x5bf0ae,_0x52441b);var _0x2a2b40=util[_0xc7f5('0x49')](_0xc7f5('0x5b'),_0x44574c['params']['id'],_0x52441b);var _0x21c0a1=path[_0xc7f5('0x55')](_0x5bf0ae,_0x2a2b40);var _0x5f2a3a=[];_0x5f2a3a[_0xc7f5('0x5c')]({'model':db[_0xc7f5('0x5d')],'as':_0xc7f5('0x5d'),'raw':!![]});var _0x4abd61=[{'model':db[_0xc7f5('0x37')],'as':'Messages','attributes':['id',_0xc7f5('0x35'),_0xc7f5('0x5e')],'include':_0x5f2a3a}];return db[_0xc7f5('0x20')]['find']({'where':{'id':_0x44574c[_0xc7f5('0x2b')]['id']},'include':_0x4abd61})[_0xc7f5('0x1d')](handleEntityNotFound(_0x5063ba,null))[_0xc7f5('0x1d')](function(_0x50fb71){if(_0x50fb71&&_0x50fb71[_0xc7f5('0x5f')]){var _0x404d56=_0x50fb71[_0xc7f5('0x60')]({'plain':!![]});fs['mkdirSync'](_0x48c7dc);for(var _0x19052f=0x0;_0x19052f<_0x404d56[_0xc7f5('0x5f')][_0xc7f5('0x30')];_0x19052f++){var _0x45fcf7=_0x404d56[_0xc7f5('0x5f')][_0x19052f][_0xc7f5('0x5d')];if(_0x45fcf7){var _0xd00346=path[_0xc7f5('0x55')](_0x38ab17,_0x45fcf7[_0xc7f5('0x61')]);if(fs[_0xc7f5('0x62')](_0xd00346)){fs[_0xc7f5('0x63')](_0xd00346)['pipe'](fs[_0xc7f5('0x64')](path[_0xc7f5('0x55')](_0x48c7dc,_0x45fcf7[_0xc7f5('0x61')])));}}}return BPromise[_0xc7f5('0x65')]()[_0xc7f5('0x1d')](function(){return new BPromise(function(_0x5efd03,_0x12692f){zipdir(_0x48c7dc,{'saveTo':_0x21c0a1},function(_0x37b590,_0x48e2b1){if(_0x37b590)return _0x12692f(_0x37b590);return _0x5efd03(_0x48e2b1);});})[_0xc7f5('0x1d')](function(){return new BPromise(function(_0x2df1bd,_0x1703e4){rimraf(_0x48c7dc,function(_0x4adf91){if(_0x4adf91)_0x1703e4(_0x4adf91);return _0x2df1bd();});});})[_0xc7f5('0x1d')](function(){return _0x5063ba[_0xc7f5('0x52')](_0x21c0a1,_0x2a2b40,function(_0x33995a){if(_0x33995a){console[_0xc7f5('0x66')](_0xc7f5('0x67'),_0x33995a);}else{fs[_0xc7f5('0x68')](_0x21c0a1);}});});});}else{return _0x5063ba[_0xc7f5('0x12')](0xc8);}})[_0xc7f5('0x29')](handleError(_0x5063ba,null));};
\ No newline at end of file
index fe3b805..fb41471 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x003e=['then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x55fb8f,_0x574d3a){var _0x2c841a=function(_0x17a322){while(--_0x17a322){_0x55fb8f['push'](_0x55fb8f['shift']());}};_0x2c841a(++_0x574d3a);}(_0x003e,0x90));var _0xe003=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x003e[_0x513545];return _0x18b7c5;};'use strict';var EventEmitter=require(_0xe003('0x0'));var FaxInteraction=require(_0xe003('0x1'))['db'][_0xe003('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xe003('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe003('0x4')](0x0);var events={'afterCreate':_0xe003('0x5'),'afterUpdate':_0xe003('0x6'),'afterDestroy':_0xe003('0x7')};function emitEvent(_0x5bdb3f){return function(_0x5e1487,_0xff00de,_0x194c24){_0x5e1487[_0xe003('0x8')]({'attributes':['id'],'raw':!![]})[_0xe003('0x9')](function(_0x516b9f){_0x5e1487[_0xe003('0xa')](_0xe003('0xb'),_0x516b9f[_0xe003('0xc')](function(_0x5d2373){return{'id':_0x5d2373['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5e1487['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe003('0x9')](function(_0x15c2b4){_0x5e1487[_0xe003('0xa')](_0xe003('0xd'),_0x15c2b4['length']);FaxInteractionEvents[_0xe003('0xe')](_0x5bdb3f+':'+_0x5e1487['id'],_0x5e1487);FaxInteractionEvents[_0xe003('0xe')](_0x5bdb3f,_0x5e1487);_0x194c24(null);})['catch'](_0x194c24(null));};}for(var e in events){if(events[_0xe003('0xf')](e)){var event=events[e];FaxInteraction[_0xe003('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x877a=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue'];(function(_0x2e4c9d,_0x2aa0ce){var _0x55647d=function(_0x3c9386){while(--_0x3c9386){_0x2e4c9d['push'](_0x2e4c9d['shift']());}};_0x55647d(++_0x2aa0ce);}(_0x877a,0x1d5));var _0xa877=function(_0xc2f78c,_0x3bcb46){_0xc2f78c=_0xc2f78c-0x0;var _0x2bddf1=_0x877a[_0xc2f78c];return _0x2bddf1;};'use strict';var EventEmitter=require(_0xa877('0x0'));var FaxInteraction=require(_0xa877('0x1'))['db'][_0xa877('0x2')];var FaxMessage=require(_0xa877('0x1'))['db'][_0xa877('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa877('0x4')](0x0);var events={'afterCreate':_0xa877('0x5'),'afterUpdate':_0xa877('0x6'),'afterDestroy':_0xa877('0x7')};function emitEvent(_0x10946b){return function(_0x4f44b0,_0x41a7fe,_0x14a8e9){_0x4f44b0[_0xa877('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c8932){_0x4f44b0['setDataValue'](_0xa877('0x9'),_0x2c8932[_0xa877('0xa')](function(_0x2ae681){return{'id':_0x2ae681['id']};}));return FaxMessage[_0xa877('0xb')]({'where':{'FaxInteractionId':_0x4f44b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa877('0xc')](function(_0x50dcd5){_0x4f44b0[_0xa877('0xd')](_0xa877('0xe'),_0x50dcd5[_0xa877('0xf')]);FaxInteractionEvents[_0xa877('0x10')](_0x10946b+':'+_0x4f44b0['id'],_0x4f44b0);FaxInteractionEvents[_0xa877('0x10')](_0x10946b,_0x4f44b0);_0x14a8e9(null);})[_0xa877('0x11')](_0x14a8e9(null));};}for(var e in events){if(events[_0xa877('0x12')](e)){var event=events[e];FaxInteraction[_0xa877('0x13')](e,emitEvent(event));}}module[_0xa877('0x14')]=FaxInteractionEvents;
\ No newline at end of file
index e1b01fe..cc3e351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd19=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','request-promise','path','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x5d4eec,_0x25751d){var _0x5062d9=function(_0x4a65b6){while(--_0x4a65b6){_0x5d4eec['push'](_0x5d4eec['shift']());}};_0x5062d9(++_0x25751d);}(_0xbd19,0x1f0));var _0x9bd1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xbd19[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var logger=require('../../config/logger')(_0x9bd1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9bd1('0x3'));var fs=require('fs');var path=require(_0x9bd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9bd1('0x5'));module[_0x9bd1('0x6')]=function(_0x1036eb,_0x1e8127){return _0x1036eb['define'](_0x9bd1('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e5cdf,_0x2abf1e,_0x591ade){if(_0x4e5cdf[_0x9bd1('0x8')](_0x9bd1('0x9'))){_0x4e5cdf[_0x9bd1('0xa')]=moment()['format'](_0x9bd1('0xb'));}_0x591ade(null,_0x4e5cdf);}}});};
\ No newline at end of file
+var _0x266a=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x266a,0x144));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var logger=require(_0xa266('0x2'))(_0xa266('0x3'));var moment=require(_0xa266('0x4'));var BPromise=require('bluebird');var rp=require(_0xa266('0x5'));var fs=require('fs');var path=require(_0xa266('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa266('0x7'));module[_0xa266('0x8')]=function(_0x24bd8b,_0x377bd2){return _0x24bd8b[_0xa266('0x9')](_0xa266('0xa'),attributes,{'tableName':_0xa266('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21f3fa,_0x38347a,_0x8b49b9){if(_0x21f3fa[_0xa266('0xc')](_0xa266('0xd'))){_0x21f3fa[_0xa266('0xe')]=moment()[_0xa266('0xf')](_0xa266('0x10'));}_0x8b49b9(null,_0x21f3fa);}}});};
\ No newline at end of file
index fef762a..e1fe449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8239=['register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','AddTagsToFaxInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x8239,0x18c));var _0x9823=function(_0x59c3a6,_0x4a9ca2){_0x59c3a6=_0x59c3a6-0x0;var _0x57a7af=_0x8239[_0x59c3a6];return _0x57a7af;};'use strict';var _=require(_0x9823('0x0'));var util=require('util');var moment=require(_0x9823('0x1'));var BPromise=require(_0x9823('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9823('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9823('0x4'));var logger=require(_0x9823('0x5'))('rpc');var config=require(_0x9823('0x6'));var jayson=require(_0x9823('0x7'));var client=jayson[_0x9823('0x8')][_0x9823('0x9')]({'port':0x232a});config[_0x9823('0xa')]=_[_0x9823('0xb')](config[_0x9823('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9823('0xc'))(new Redis(config[_0x9823('0xa')]));require(_0x9823('0xd'))[_0x9823('0xe')](socket);function respondWithRpcPromise(_0x16ae25,_0x16fe42,_0x30ef01){return new BPromise(function(_0x2c1c0e,_0x11299e){return client['request'](_0x16ae25,_0x30ef01)[_0x9823('0xf')](function(_0x15c729){logger[_0x9823('0x10')](_0x9823('0x11'),_0x16fe42,_0x9823('0x12'));logger[_0x9823('0x13')](_0x9823('0x14'),_0x16fe42,'request\x20sent',JSON[_0x9823('0x15')](_0x15c729));if(_0x15c729[_0x9823('0x16')]){if(_0x15c729[_0x9823('0x16')][_0x9823('0x17')]===0x1f4){logger['error'](_0x9823('0x11'),_0x16fe42,_0x15c729[_0x9823('0x16')][_0x9823('0x18')]);return _0x11299e(_0x15c729['error'][_0x9823('0x18')]);}logger[_0x9823('0x16')](_0x9823('0x11'),_0x16fe42,_0x15c729[_0x9823('0x16')][_0x9823('0x18')]);return _0x2c1c0e(_0x15c729['error'][_0x9823('0x18')]);}else{logger['info'](_0x9823('0x11'),_0x16fe42,_0x9823('0x12'));_0x2c1c0e(_0x15c729[_0x9823('0x19')][_0x9823('0x18')]);}})[_0x9823('0x1a')](function(_0x2a3ba5){logger[_0x9823('0x16')](_0x9823('0x11'),_0x16fe42,_0x2a3ba5);_0x11299e(_0x2a3ba5);});});}exports[_0x9823('0x1b')]=function(_0x15a6c5){var _0xb057f3=this;return new Promise(function(_0x255934,_0x22ce07){return db[_0x9823('0x1c')][_0x9823('0x1d')](_0x15a6c5['body'],{'raw':_0x15a6c5[_0x9823('0x1e')]?_0x15a6c5[_0x9823('0x1e')][_0x9823('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15a6c5['options']?_0x15a6c5[_0x9823('0x1e')][_0x9823('0x20')]||null:null,'attributes':_0x15a6c5[_0x9823('0x1e')]?_0x15a6c5['options']['attributes']||null:null,'limit':_0x15a6c5[_0x9823('0x1e')]?_0x15a6c5[_0x9823('0x1e')]['limit']||null:null})[_0x9823('0xf')](function(_0x401973){logger['info']('UpdateFaxInteraction',_0x15a6c5);logger[_0x9823('0x13')](_0x9823('0x1b'),_0x15a6c5,JSON[_0x9823('0x15')](_0x401973));_0x255934(_0x401973);})[_0x9823('0x1a')](function(_0x4a900d){logger[_0x9823('0x16')](_0x9823('0x1b'),_0x4a900d[_0x9823('0x18')],_0x15a6c5);_0x22ce07(_0xb057f3[_0x9823('0x16')](0x1f4,_0x4a900d[_0x9823('0x18')]));});});};exports[_0x9823('0x21')]=function(_0x56ac7b){return new Promise(function(_0x44a1f4,_0x1fa9b6){return db[_0x9823('0x1c')][_0x9823('0x22')]({'where':_0x56ac7b[_0x9823('0x1e')]?_0x56ac7b['options'][_0x9823('0x20')]||null:null})['then'](function(_0x2717dd){if(_0x2717dd){return _0x2717dd[_0x9823('0x23')](_0x56ac7b[_0x9823('0x24')][_0x9823('0x25')],_[_0x9823('0x26')](_0x56ac7b[_0x9823('0x24')],[_0x9823('0x25'),'id'])||{});}})[_0x9823('0x27')](function(_0x3a48f4){logger[_0x9823('0x10')]('AddTags',_0x56ac7b);logger[_0x9823('0x13')](_0x9823('0x28'),_0x56ac7b,JSON[_0x9823('0x15')](_0x3a48f4));_0x44a1f4(_0x3a48f4);})[_0x9823('0x1a')](function(_0x4040ee){logger['error']('AddTags',_0x4040ee[_0x9823('0x18')],_0x56ac7b);_0x1fa9b6(_this[_0x9823('0x16')](0x1f4,_0x4040ee['message']));});});};
\ No newline at end of file
+var _0x261f=['FaxInteraction','update','options','raw','where','attributes','limit','catch','find','then','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x261f,0x94));var _0xf261=function(_0x1a97cd,_0x283589){_0x1a97cd=_0x1a97cd-0x0;var _0x24a437=_0x261f[_0x1a97cd];return _0x24a437;};'use strict';var _=require(_0xf261('0x0'));var util=require('util');var moment=require(_0xf261('0x1'));var BPromise=require(_0xf261('0x2'));var rs=require(_0xf261('0x3'));var fs=require('fs');var Redis=require(_0xf261('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf261('0x5'));var logger=require(_0xf261('0x6'))(_0xf261('0x7'));var config=require(_0xf261('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf261('0x9')][_0xf261('0xa')]({'port':0x232a});config[_0xf261('0xb')]=_[_0xf261('0xc')](config[_0xf261('0xb')],{'host':_0xf261('0xd'),'port':0x18eb});var socket=require(_0xf261('0xe'))(new Redis(config[_0xf261('0xb')]));require(_0xf261('0xf'))[_0xf261('0x10')](socket);function respondWithRpcPromise(_0x592420,_0x301362,_0x36c781){return new BPromise(function(_0x84c66f,_0xad1311){return client[_0xf261('0x11')](_0x592420,_0x36c781)['then'](function(_0x3199d1){logger[_0xf261('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x301362,_0xf261('0x13'));logger[_0xf261('0x14')](_0xf261('0x15'),_0x301362,_0xf261('0x13'),JSON[_0xf261('0x16')](_0x3199d1));if(_0x3199d1[_0xf261('0x17')]){if(_0x3199d1[_0xf261('0x17')]['code']===0x1f4){logger[_0xf261('0x17')](_0xf261('0x18'),_0x301362,_0x3199d1[_0xf261('0x17')]['message']);return _0xad1311(_0x3199d1['error'][_0xf261('0x19')]);}logger[_0xf261('0x17')](_0xf261('0x18'),_0x301362,_0x3199d1['error'][_0xf261('0x19')]);return _0x84c66f(_0x3199d1['error'][_0xf261('0x19')]);}else{logger[_0xf261('0x12')](_0xf261('0x18'),_0x301362,_0xf261('0x13'));_0x84c66f(_0x3199d1[_0xf261('0x1a')][_0xf261('0x19')]);}})['catch'](function(_0x4a130b){logger[_0xf261('0x17')](_0xf261('0x18'),_0x301362,_0x4a130b);_0xad1311(_0x4a130b);});});}exports[_0xf261('0x1b')]=function(_0x4ae4ea){var _0x3992ad=this;return new Promise(function(_0x574abc,_0xd39e7f){return db[_0xf261('0x1c')][_0xf261('0x1d')](_0x4ae4ea['body'],{'raw':_0x4ae4ea[_0xf261('0x1e')]?_0x4ae4ea['options'][_0xf261('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ae4ea[_0xf261('0x1e')]?_0x4ae4ea[_0xf261('0x1e')][_0xf261('0x20')]||null:null,'attributes':_0x4ae4ea[_0xf261('0x1e')]?_0x4ae4ea[_0xf261('0x1e')][_0xf261('0x21')]||null:null,'limit':_0x4ae4ea[_0xf261('0x1e')]?_0x4ae4ea[_0xf261('0x1e')][_0xf261('0x22')]||null:null})['then'](function(_0x1021c9){logger['info']('UpdateFaxInteraction',_0x4ae4ea);logger[_0xf261('0x14')](_0xf261('0x1b'),_0x4ae4ea,JSON['stringify'](_0x1021c9));_0x574abc(_0x1021c9);})[_0xf261('0x23')](function(_0x52b982){logger[_0xf261('0x17')](_0xf261('0x1b'),_0x52b982[_0xf261('0x19')],_0x4ae4ea);_0xd39e7f(_0x3992ad[_0xf261('0x17')](0x1f4,_0x52b982[_0xf261('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4a2d41){return new Promise(function(_0x5d8096,_0x516784){return db[_0xf261('0x1c')][_0xf261('0x24')]({'where':_0x4a2d41[_0xf261('0x1e')]?_0x4a2d41[_0xf261('0x1e')]['where']||null:null})[_0xf261('0x25')](function(_0x2c06b6){if(_0x2c06b6){return _0x2c06b6[_0xf261('0x26')](_0x4a2d41[_0xf261('0x27')][_0xf261('0x28')],_[_0xf261('0x29')](_0x4a2d41[_0xf261('0x27')],['ids','id'])||{});}})[_0xf261('0x2a')](function(_0x44d7fa){logger[_0xf261('0x12')]('AddTags',_0x4a2d41);logger[_0xf261('0x14')](_0xf261('0x2b'),_0x4a2d41,JSON[_0xf261('0x16')](_0x44d7fa));_0x5d8096(_0x44d7fa);})[_0xf261('0x23')](function(_0x5321b4){logger[_0xf261('0x17')](_0xf261('0x2b'),_0x5321b4[_0xf261('0x19')],_0x4a2d41);_0x516784(_this['error'](0x1f4,_0x5321b4['message']));});});};
\ No newline at end of file
index 571d9e5..2c41787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3741=['removeListener','register','length','remove'];(function(_0x3d6c92,_0x338992){var _0x3dc49a=function(_0x4ee66e){while(--_0x4ee66e){_0x3d6c92['push'](_0x3d6c92['shift']());}};_0x3dc49a(++_0x338992);}(_0x3741,0xb7));var _0x1374=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x3741[_0xdc37a1];return _0x99b4fe;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x1374('0x0'),'update'];function createListener(_0x38fb1c,_0x571924){return function(_0x30ca3d){_0x571924['emit'](_0x38fb1c,_0x30ca3d);};}function removeListener(_0x1433b2,_0x39c5a0){return function(){FaxInteractionEvents[_0x1374('0x1')](_0x1433b2,_0x39c5a0);};}exports[_0x1374('0x2')]=function(_0x3729f3){for(var _0x4dff32=0x0,_0x26cd63=events[_0x1374('0x3')];_0x4dff32<_0x26cd63;_0x4dff32++){var _0xbddb60=events[_0x4dff32];var _0x643f06=createListener('faxInteraction:'+_0xbddb60,_0x3729f3);FaxInteractionEvents['on'](_0xbddb60,_0x643f06);}};
\ No newline at end of file
+var _0xbb3f=['remove','update','register','length','faxInteraction:','save'];(function(_0x80aa19,_0xb8cf35){var _0x14d82c=function(_0x1fb4df){while(--_0x1fb4df){_0x80aa19['push'](_0x80aa19['shift']());}};_0x14d82c(++_0xb8cf35);}(_0xbb3f,0x1bb));var _0xfbb3=function(_0x3dd031,_0x223ea1){_0x3dd031=_0x3dd031-0x0;var _0x4188c3=_0xbb3f[_0x3dd031];return _0x4188c3;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xfbb3('0x0'),_0xfbb3('0x1'),_0xfbb3('0x2')];function createListener(_0x2307af,_0x3be355){return function(_0x43079b){_0x3be355['emit'](_0x2307af,_0x43079b);};}function removeListener(_0x1a5da2,_0x811288){return function(){FaxInteractionEvents['removeListener'](_0x1a5da2,_0x811288);};}exports[_0xfbb3('0x3')]=function(_0x52b3aa){for(var _0xc0f2a0=0x0,_0xee58c7=events[_0xfbb3('0x4')];_0xc0f2a0<_0xee58c7;_0xc0f2a0++){var _0x1672a2=events[_0xc0f2a0];var _0x519f1f=createListener(_0xfbb3('0x5')+_0x1672a2,_0x52b3aa);FaxInteractionEvents['on'](_0x1672a2,_0x519f1f);}};
\ No newline at end of file
index 38873ff..b5fc37c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b04=['/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:destroy','destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4a0099,_0x120a52){var _0x5df3a3=function(_0x44edda){while(--_0x44edda){_0x4a0099['push'](_0x4a0099['shift']());}};_0x5df3a3(++_0x120a52);}(_0x7b04,0x12b));var _0x47b0=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7b04[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require('multer');var util=require(_0x47b0('0x0'));var path=require(_0x47b0('0x1'));var timeout=require(_0x47b0('0x2'));var express=require('express');var router=express[_0x47b0('0x3')]();var fs_extra=require(_0x47b0('0x4'));var auth=require(_0x47b0('0x5'));var interaction=require(_0x47b0('0x6'));var config=require(_0x47b0('0x7'));var controller=require('./faxInteraction.controller');router[_0x47b0('0x8')]('/',auth[_0x47b0('0x9')](),controller[_0x47b0('0xa')]);router[_0x47b0('0x8')](_0x47b0('0xb'),auth[_0x47b0('0x9')](),controller[_0x47b0('0xc')]);router[_0x47b0('0x8')](_0x47b0('0xd'),auth['isAuthenticated'](),controller[_0x47b0('0xe')]);router[_0x47b0('0x8')](_0x47b0('0xf'),auth[_0x47b0('0x9')](),controller[_0x47b0('0x10')]);router['get']('/:id/download',auth[_0x47b0('0x9')](),controller[_0x47b0('0x11')]);router['post']('/',auth[_0x47b0('0x9')](),controller['create']);router[_0x47b0('0x12')]('/:id/messages',auth[_0x47b0('0x9')](),controller[_0x47b0('0x13')]);router[_0x47b0('0x12')](_0x47b0('0x14'),auth[_0x47b0('0x9')](),interaction[_0x47b0('0x15')](_0x47b0('0x16'),_0x47b0('0x17')),controller[_0x47b0('0x18')]);router[_0x47b0('0x19')](_0x47b0('0xd'),auth[_0x47b0('0x9')](),interaction[_0x47b0('0x15')]('fax','faxinteraction:update'),controller['update']);router['delete'](_0x47b0('0xd'),auth[_0x47b0('0x9')](),interaction[_0x47b0('0x15')]('fax',_0x47b0('0x1a')),controller[_0x47b0('0x1b')]);router[_0x47b0('0x1c')](_0x47b0('0x14'),auth[_0x47b0('0x9')](),controller[_0x47b0('0x1d')]);module[_0x47b0('0x1e')]=router;
\ No newline at end of file
+var _0x452f=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','fax','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express'];(function(_0x8ec70c,_0x1f0823){var _0x249465=function(_0x3d73c2){while(--_0x3d73c2){_0x8ec70c['push'](_0x8ec70c['shift']());}};_0x249465(++_0x1f0823);}(_0x452f,0x74));var _0xf452=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x452f[_0x19b84f];return _0x18067b;};'use strict';var multer=require(_0xf452('0x0'));var util=require(_0xf452('0x1'));var path=require('path');var timeout=require(_0xf452('0x2'));var express=require(_0xf452('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf452('0x4'));var config=require(_0xf452('0x5'));var controller=require(_0xf452('0x6'));router[_0xf452('0x7')]('/',auth['isAuthenticated'](),controller[_0xf452('0x8')]);router['get']('/describe',auth[_0xf452('0x9')](),controller[_0xf452('0xa')]);router[_0xf452('0x7')](_0xf452('0xb'),auth[_0xf452('0x9')](),controller[_0xf452('0xc')]);router[_0xf452('0x7')](_0xf452('0xd'),auth[_0xf452('0x9')](),controller[_0xf452('0xe')]);router[_0xf452('0x7')](_0xf452('0xf'),auth[_0xf452('0x9')](),controller['download']);router[_0xf452('0x10')]('/',auth['isAuthenticated'](),controller[_0xf452('0x11')]);router[_0xf452('0x10')](_0xf452('0xd'),auth[_0xf452('0x9')](),controller[_0xf452('0x12')]);router[_0xf452('0x10')]('/:id/tags',auth[_0xf452('0x9')](),interaction[_0xf452('0x13')](_0xf452('0x14'),'faxinteraction:addtags'),controller[_0xf452('0x15')]);router[_0xf452('0x16')](_0xf452('0xb'),auth[_0xf452('0x9')](),interaction[_0xf452('0x13')](_0xf452('0x14'),_0xf452('0x17')),controller[_0xf452('0x18')]);router[_0xf452('0x19')](_0xf452('0xb'),auth[_0xf452('0x9')](),interaction[_0xf452('0x13')](_0xf452('0x14'),_0xf452('0x1a')),controller['destroy']);router['delete'](_0xf452('0x1b'),auth[_0xf452('0x9')](),controller[_0xf452('0x1c')]);module[_0xf452('0x1d')]=router;
\ No newline at end of file
index 485671c..6c5bd93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['TEXT','ENUM','DATE','exports'];(function(_0x565441,_0x2bd484){var _0x5e5086=function(_0x15e222){while(--_0x15e222){_0x565441['push'](_0x565441['shift']());}};_0x5e5086(++_0x2bd484);}(_0xb821,0xa7));var _0x1b82=function(_0x5e6917,_0x1abdd3){_0x5e6917=_0x5e6917-0x0;var _0x230109=_0xb821[_0x5e6917];return _0x230109;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'body':{'type':Sequelize[_0x1b82('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1b82('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x1b82('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1b82('0x3')]}};
\ No newline at end of file
+var _0x22fb=['ENUM','out','TEXT','BOOLEAN'];(function(_0x5843d2,_0x56ead1){var _0x45c44c=function(_0x3b7685){while(--_0x3b7685){_0x5843d2['push'](_0x5843d2['shift']());}};_0x45c44c(++_0x56ead1);}(_0x22fb,0x192));var _0xb22f=function(_0x34dce9,_0x262cf5){_0x34dce9=_0x34dce9-0x0;var _0x3d7e2f=_0x22fb[_0x34dce9];return _0x3d7e2f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb22f('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb22f('0x2')]('in',_0xb22f('0x3')),'defaultValue':_0xb22f('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 375d286..d2ebb86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f4=['fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','body','find','describe','fax-interactions','readAt','format','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','fax','null','rejectMessage','ContactId','User','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','Attachment','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes'];(function(_0x38831b,_0x4611ea){var _0x5a508a=function(_0x2df441){while(--_0x2df441){_0x38831b['push'](_0x38831b['shift']());}};_0x5a508a(++_0x4611ea);}(_0x55f4,0x1f1));var _0x455f=function(_0x3c5924,_0x4d295f){_0x3c5924=_0x3c5924-0x0;var _0x576958=_0x55f4[_0x3c5924];return _0x576958;};'use strict';var emlformat=require(_0x455f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x455f('0x1'));var jsonpatch=require(_0x455f('0x2'));var rp=require(_0x455f('0x3'));var moment=require('moment');var BPromise=require(_0x455f('0x4'));var Mustache=require(_0x455f('0x5'));var util=require(_0x455f('0x6'));var path=require(_0x455f('0x7'));var sox=require(_0x455f('0x8'));var csv=require('to-csv');var ejs=require(_0x455f('0x9'));var fs=require('fs');var fs_extra=require(_0x455f('0xa'));var _=require(_0x455f('0xb'));var squel=require(_0x455f('0xc'));var crypto=require('crypto');var jsforce=require(_0x455f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x455f('0xe'));var querystring=require(_0x455f('0xf'));var Papa=require(_0x455f('0x10'));var Redis=require(_0x455f('0x11'));var authService=require(_0x455f('0x12'));var qs=require(_0x455f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x455f('0x14'));var logger=require(_0x455f('0x15'))(_0x455f('0x16'));var utils=require(_0x455f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x455f('0x18'))['db'];config['redis']=_[_0x455f('0x19')](config[_0x455f('0x1a')],{'host':_0x455f('0x1b'),'port':0x18eb});var socket=require(_0x455f('0x1c'))(new Redis(config[_0x455f('0x1a')]));require(_0x455f('0x1d'))[_0x455f('0x1e')](socket);var jayson=require(_0x455f('0x1f'));var client=jayson[_0x455f('0x20')][_0x455f('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x455f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1221e3,_0x3c3c3a,_0x1572f0,_0x1dd8a6){return new BPromise(function(_0x153ef8,_0x549e37){var _0x582b54=_0x1dd8a6||client;return _0x582b54[_0x455f('0x22')](_0x1221e3,_0x1572f0)[_0x455f('0x23')](function(_0x2f1f0c){logger[_0x455f('0x24')](_0x455f('0x25'),_0x3c3c3a,_0x455f('0x26'));logger[_0x455f('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3c3c3a,_0x455f('0x26'),JSON['stringify'](_0x2f1f0c));if(_0x2f1f0c['error']){if(_0x2f1f0c[_0x455f('0x28')]['code']===0x1f4){logger[_0x455f('0x28')]('FaxMessage,\x20%s,\x20%s',_0x3c3c3a,_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);return _0x549e37(_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);}logger['error'](_0x455f('0x25'),_0x3c3c3a,_0x2f1f0c[_0x455f('0x28')][_0x455f('0x29')]);return _0x153ef8(_0x2f1f0c[_0x455f('0x28')]['message']);}else{logger[_0x455f('0x24')](_0x455f('0x25'),_0x3c3c3a,_0x455f('0x26'));_0x153ef8(_0x2f1f0c[_0x455f('0x2a')]['message']);}})[_0x455f('0x2b')](function(_0x199de4){logger[_0x455f('0x28')](_0x455f('0x25'),_0x3c3c3a,_0x199de4);_0x549e37(_0x199de4);});});}function respondWithStatusCode(_0x425693,_0x32f214){_0x32f214=_0x32f214||0xcc;return function(_0x2be7cd){if(_0x2be7cd){return _0x425693[_0x455f('0x2c')](_0x32f214);}return _0x425693['status'](_0x32f214)[_0x455f('0x2d')]();};}function respondWithResult(_0x74fc0,_0x3d4ea1){_0x3d4ea1=_0x3d4ea1||0xc8;return function(_0x2bc8ae){if(_0x2bc8ae){return _0x74fc0[_0x455f('0x2e')](_0x3d4ea1)[_0x455f('0x2f')](_0x2bc8ae);}};}function respondWithFilteredResult(_0x3edd4c,_0x1f3ab1){return function(_0x4f37d8){if(_0x4f37d8){var _0x116a5b=typeof _0x1f3ab1[_0x455f('0x30')]===_0x455f('0x31')&&typeof _0x1f3ab1[_0x455f('0x32')]==='undefined';var _0x51461e=_0x4f37d8[_0x455f('0x33')];var _0x253267=_0x116a5b?0x0:_0x1f3ab1[_0x455f('0x30')];var _0x3fc0b2=_0x116a5b?_0x4f37d8[_0x455f('0x33')]:_0x1f3ab1['offset']+_0x1f3ab1['limit'];var _0xa43a50;if(_0x3fc0b2>=_0x51461e){_0x3fc0b2=_0x51461e;_0xa43a50=0xc8;}else{_0xa43a50=0xce;}_0x3edd4c['status'](_0xa43a50);return _0x3edd4c[_0x455f('0x34')](_0x455f('0x35'),_0x253267+'-'+_0x3fc0b2+'/'+_0x51461e)[_0x455f('0x2f')](_0x4f37d8);}return null;};}function patchUpdates(_0x399c40){return function(_0x56d4cf){try{jsonpatch[_0x455f('0x36')](_0x56d4cf,_0x399c40,!![]);}catch(_0x5b383c){return BPromise['reject'](_0x5b383c);}return _0x56d4cf[_0x455f('0x37')]();};}function saveUpdates(_0x5a9190,_0x4789ad){return function(_0x31becf){if(_0x31becf){return _0x31becf[_0x455f('0x38')](_0x5a9190)[_0x455f('0x23')](function(_0x551c79){return _0x551c79;});}return null;};}function removeEntity(_0x352931,_0x1fb394){return function(_0x1a1962){if(_0x1a1962){return _0x1a1962[_0x455f('0x39')]()[_0x455f('0x23')](function(){_0x352931[_0x455f('0x2e')](0xcc)[_0x455f('0x2d')]();});}};}function handleEntityNotFound(_0x593964,_0x3003b3){return function(_0x405031){if(!_0x405031){_0x593964[_0x455f('0x2c')](0x194);}return _0x405031;};}function handleError(_0x5ec54b,_0x2ed2b1){_0x2ed2b1=_0x2ed2b1||0x1f4;return function(_0x307c69){logger['error'](_0x307c69['stack']);if(_0x307c69[_0x455f('0x3a')]){delete _0x307c69[_0x455f('0x3a')];}_0x5ec54b[_0x455f('0x2e')](_0x2ed2b1)[_0x455f('0x3b')](_0x307c69);};}exports['index']=function(_0xfd178b,_0x249d02){var _0x2eea6b={},_0x1b34f5={},_0x1c848a={'count':0x0,'rows':[]};var _0x843517=_[_0x455f('0x3c')](db[_0x455f('0x3d')][_0x455f('0x3e')],function(_0x1fd1e9){return{'name':_0x1fd1e9[_0x455f('0x3f')],'type':_0x1fd1e9[_0x455f('0x40')][_0x455f('0x41')]};});_0x1b34f5[_0x455f('0x42')]=_[_0x455f('0x3c')](_0x843517,_0x455f('0x3a'));_0x1b34f5['query']=_[_0x455f('0x43')](_0xfd178b[_0x455f('0x44')]);_0x1b34f5['filters']=_[_0x455f('0x45')](_0x1b34f5[_0x455f('0x42')],_0x1b34f5['query']);_0x2eea6b[_0x455f('0x46')]=_[_0x455f('0x45')](_0x1b34f5[_0x455f('0x42')],qs[_0x455f('0x47')](_0xfd178b['query'][_0x455f('0x47')]));_0x2eea6b[_0x455f('0x46')]=_0x2eea6b[_0x455f('0x46')]['length']?_0x2eea6b[_0x455f('0x46')]:_0x1b34f5['model'];if(!_0xfd178b[_0x455f('0x44')][_0x455f('0x48')](_0x455f('0x49'))){_0x2eea6b['limit']=qs['limit'](_0xfd178b[_0x455f('0x44')][_0x455f('0x32')]);_0x2eea6b[_0x455f('0x30')]=qs[_0x455f('0x30')](_0xfd178b[_0x455f('0x44')][_0x455f('0x30')]);}_0x2eea6b[_0x455f('0x4a')]=qs[_0x455f('0x4b')](_0xfd178b[_0x455f('0x44')][_0x455f('0x4b')]);_0x2eea6b['where']=qs[_0x455f('0x4c')](_['pick'](_0xfd178b[_0x455f('0x44')],_0x1b34f5[_0x455f('0x4c')]),_0x843517);if(_0xfd178b[_0x455f('0x44')]['filter']){_0x2eea6b[_0x455f('0x4d')]=_[_0x455f('0x4e')](_0x2eea6b[_0x455f('0x4d')],{'$or':_[_0x455f('0x3c')](_0x843517,function(_0x297edb){if(_0x297edb[_0x455f('0x40')]!==_0x455f('0x4f')){var _0x2c7a11={};_0x2c7a11[_0x297edb[_0x455f('0x3a')]]={'$like':'%'+_0xfd178b[_0x455f('0x44')]['filter']+'%'};return _0x2c7a11;}})});}_0x2eea6b=_[_0x455f('0x4e')]({},_0x2eea6b,_0xfd178b[_0x455f('0x50')]);var _0x405294={'where':_0x2eea6b[_0x455f('0x4d')]};return db[_0x455f('0x3d')][_0x455f('0x33')](_0x405294)[_0x455f('0x23')](function(_0x3c9e6e){_0x1c848a[_0x455f('0x33')]=_0x3c9e6e;if(_0xfd178b['query'][_0x455f('0x51')]){_0x2eea6b[_0x455f('0x52')]=[{'all':!![]}];}return db[_0x455f('0x3d')][_0x455f('0x53')](_0x2eea6b);})[_0x455f('0x23')](function(_0x464192){_0x1c848a[_0x455f('0x54')]=_0x464192;return _0x1c848a;})['then'](respondWithFilteredResult(_0x249d02,_0x2eea6b))[_0x455f('0x2b')](handleError(_0x249d02,null));};exports[_0x455f('0x55')]=function(_0x4aec06,_0x3e4bd0){var _0x3d6822={'raw':!![],'where':{'id':_0x4aec06[_0x455f('0x56')]['id']}},_0x1565fb={};_0x1565fb['model']=_[_0x455f('0x43')](db[_0x455f('0x3d')][_0x455f('0x3e')]);_0x1565fb[_0x455f('0x44')]=_['keys'](_0x4aec06[_0x455f('0x44')]);_0x1565fb['filters']=_[_0x455f('0x45')](_0x1565fb[_0x455f('0x42')],_0x1565fb[_0x455f('0x44')]);_0x3d6822[_0x455f('0x46')]=_['intersection'](_0x1565fb[_0x455f('0x42')],qs[_0x455f('0x47')](_0x4aec06[_0x455f('0x44')][_0x455f('0x47')]));_0x3d6822['attributes']=_0x3d6822[_0x455f('0x46')][_0x455f('0x57')]?_0x3d6822[_0x455f('0x46')]:_0x1565fb[_0x455f('0x42')];if(_0x4aec06['query']['includeAll']){_0x3d6822['include']=[{'all':!![]}];}_0x3d6822=_[_0x455f('0x4e')]({},_0x3d6822,_0x4aec06['options']);return db[_0x455f('0x3d')]['find'](_0x3d6822)[_0x455f('0x23')](handleEntityNotFound(_0x3e4bd0,null))[_0x455f('0x23')](respondWithResult(_0x3e4bd0,null))[_0x455f('0x2b')](handleError(_0x3e4bd0,null));};exports[_0x455f('0x38')]=function(_0x24d7bd,_0x1f0c86){if(_0x24d7bd[_0x455f('0x58')]['id']){delete _0x24d7bd[_0x455f('0x58')]['id'];}return db[_0x455f('0x3d')][_0x455f('0x59')]({'where':{'id':_0x24d7bd[_0x455f('0x56')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x1f0c86,null))['then'](saveUpdates(_0x24d7bd['body'],null))[_0x455f('0x23')](respondWithResult(_0x1f0c86,null))[_0x455f('0x2b')](handleError(_0x1f0c86,null));};exports[_0x455f('0x39')]=function(_0x4f7d6d,_0x6ef266){return db[_0x455f('0x3d')][_0x455f('0x59')]({'where':{'id':_0x4f7d6d[_0x455f('0x56')]['id']}})[_0x455f('0x23')](handleEntityNotFound(_0x6ef266,null))[_0x455f('0x23')](removeEntity(_0x6ef266,null))[_0x455f('0x2b')](handleError(_0x6ef266,null));};exports[_0x455f('0x5a')]=function(_0x3ebbe0,_0x2af5d3){return db[_0x455f('0x3d')][_0x455f('0x5a')]()['then'](respondWithResult(_0x2af5d3,null))[_0x455f('0x2b')](handleError(_0x2af5d3,null));};var interaction_log=require('../../config/logger')(_0x455f('0x5b'));exports['accept']=function(_0xfbc80b,_0xacc289,_0x371309){var _0x26da12={'agent':{},'channel':'fax'};if(_0xfbc80b[_0x455f('0x58')]['id']){delete _0xfbc80b[_0x455f('0x58')]['id'];}_0xfbc80b[_0x455f('0x58')]['read']=!![];_0xfbc80b[_0x455f('0x58')][_0x455f('0x5c')]=moment()[_0x455f('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0xfbc80b[_0x455f('0x58')]['UserId']=_0xfbc80b[_0x455f('0x58')][_0x455f('0x5e')]||_0xfbc80b['user']['id'];_0x26da12[_0x455f('0x5f')]['id']=_0xfbc80b[_0x455f('0x58')]['UserId'];return db['FaxMessage'][_0x455f('0x59')]({'where':{'id':_0xfbc80b[_0x455f('0x56')]['id'],'UserId':null}})[_0x455f('0x23')](handleEntityNotFound(_0xacc289,null))[_0x455f('0x23')](saveUpdates(_0xfbc80b[_0x455f('0x58')],null))[_0x455f('0x23')](function(_0x773b90){if(_0x773b90){_0x26da12['message']=_0x773b90[_0x455f('0x60')]({'plain':!![]});return db[_0x455f('0x61')][_0x455f('0x59')]({'where':{'id':_0x773b90[_0x455f('0x62')]}});}return null;})[_0x455f('0x23')](handleEntityNotFound(_0xacc289,null))['then'](function(_0x5e10d4){if(_0x5e10d4){return _0x5e10d4[_0x455f('0x38')]({'UserId':_0xfbc80b[_0x455f('0x58')][_0x455f('0x5e')],'read1stAt':_[_0x455f('0x63')](_0x5e10d4['read1stAt'])?moment()[_0x455f('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x41b06b){if(_0x41b06b){_0x26da12[_0x455f('0x64')]=_0x41b06b[_0x455f('0x60')]({'plain':!![]});interaction_log[_0x455f('0x24')](_0x455f('0x65'),_0xfbc80b['user']['id'],_0xfbc80b[_0x455f('0x66')]['name'],_0xfbc80b['user']['role'],_0x26da12[_0x455f('0x64')]['id'],_0xfbc80b['body']?JSON[_0x455f('0x67')](_0xfbc80b[_0x455f('0x58')]):'null');return respondWithRpcPromise(_0x455f('0x68'),'acceptMessage',_0x26da12);}return null;})[_0x455f('0x23')](function(_0x193f5f){var _0x3452a3=_0x455f('0x69')+_0x193f5f[_0x455f('0x29')]['ContactId'];return db[_0x455f('0x6a')][_0x455f('0x44')](_0x3452a3,{'type':db[_0x455f('0x6b')][_0x455f('0x6c')][_0x455f('0x6d')],'raw':!![]})[_0x455f('0x23')](function(_0x46add6){return _0x46add6;});})[_0x455f('0x23')](function(_0x40e7f3){if(_0x40e7f3){_0x26da12['message'][_0x455f('0x6e')]=_0x40e7f3[0x0];if(!_0xfbc80b[_0x455f('0x58')]['UserId'])return;return db['User'][_0x455f('0x59')]({'where':{'id':_0xfbc80b[_0x455f('0x58')][_0x455f('0x5e')],'role':_0x455f('0x5f')},'attributes':['id','name',_0x455f('0x6f'),_0x455f('0x70'),_0x455f('0x71')],'raw':!![]});}return null;})[_0x455f('0x23')](function(_0x1dbce0){if(!_0x1dbce0)return null;_0x26da12['message']['agent']=_0x1dbce0;return _0x26da12;})[_0x455f('0x23')](function(_0x42c5e8){if(_0x42c5e8){if(_0xfbc80b[_0x455f('0x58')][_0x455f('0x72')]){_0x26da12[_0x455f('0x29')][_0x455f('0x73')]=util[_0x455f('0x5d')](_0x455f('0x74'),_0xfbc80b[_0x455f('0x66')][_0x455f('0x3a')]);_0x26da12[_0x455f('0x29')][_0x455f('0x75')]=_0x26da12[_0x455f('0x75')];_0x26da12['message'][_0x455f('0x76')]=_0x26da12[_0x455f('0x75')];_0x26da12[_0x455f('0x29')][_0x455f('0x77')]=_0x455f('0x78');return respondWithRpcPromise(_0x455f('0x79'),'EventManager',{'event':'acceptmessage','message':_0x26da12[_0x455f('0x29')]},client9002)[_0x455f('0x23')](function(){return _0x26da12;});}return _0x26da12;}return null;})[_0x455f('0x23')](respondWithResult(_0xacc289,null))[_0x455f('0x2b')](handleError(_0xacc289,null));};var interaction_log=require('../../config/logger')(_0x455f('0x5b'));exports['reject']=function(_0x57e4ba,_0xe1ec37,_0x1706cd){var _0x31ca88={'agent':{},'channel':_0x455f('0x7a')};if(_0x57e4ba[_0x455f('0x58')]['id']){delete _0x57e4ba[_0x455f('0x58')]['id'];}_0x57e4ba['body'][_0x455f('0x5e')]=_0x57e4ba['body']['UserId']||_0x57e4ba[_0x455f('0x66')]['id'];_0x31ca88[_0x455f('0x5f')]['id']=_0x57e4ba[_0x455f('0x58')]['UserId'];return db['FaxMessage'][_0x455f('0x59')]({'where':{'id':_0x57e4ba[_0x455f('0x56')]['id'],'UserId':null}})[_0x455f('0x23')](handleEntityNotFound(_0xe1ec37,null))[_0x455f('0x23')](function(_0x398884){if(_0x398884){_0x31ca88[_0x455f('0x29')]=_0x398884[_0x455f('0x60')]({'plain':!![]});return db[_0x455f('0x61')][_0x455f('0x59')]({'where':{'id':_0x398884[_0x455f('0x62')]}});}return null;})[_0x455f('0x23')](handleEntityNotFound(_0xe1ec37,null))[_0x455f('0x23')](function(_0x5e1443){if(_0x5e1443){_0x31ca88['interaction']=_0x5e1443[_0x455f('0x60')]({'plain':!![]});interaction_log[_0x455f('0x24')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57e4ba[_0x455f('0x66')]['id'],_0x57e4ba[_0x455f('0x66')][_0x455f('0x3a')],_0x57e4ba[_0x455f('0x66')]['role'],_0x31ca88[_0x455f('0x64')]['id'],_0x57e4ba['body']?JSON[_0x455f('0x67')](_0x57e4ba[_0x455f('0x58')]):_0x455f('0x7b'));return respondWithRpcPromise('RejectMessage',_0x455f('0x7c'),_0x31ca88);}return null;})[_0x455f('0x23')](function(_0x599f2a){var _0x5138d5=_0x455f('0x69')+_0x599f2a[_0x455f('0x29')][_0x455f('0x7d')];return db[_0x455f('0x6a')][_0x455f('0x44')](_0x5138d5,{'type':db[_0x455f('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x84a4bf){return _0x84a4bf;});})[_0x455f('0x23')](function(_0x31b5cf){if(_0x31b5cf){_0x31ca88[_0x455f('0x29')][_0x455f('0x6e')]=_0x31b5cf[0x0];if(!_0x57e4ba[_0x455f('0x58')][_0x455f('0x5e')])return;return db[_0x455f('0x7e')][_0x455f('0x59')]({'where':{'id':_0x57e4ba[_0x455f('0x58')][_0x455f('0x5e')],'role':_0x455f('0x5f')},'attributes':['id',_0x455f('0x3a'),_0x455f('0x6f'),'email',_0x455f('0x71')],'raw':!![]});}return null;})[_0x455f('0x23')](function(_0x1cd42b){if(!_0x1cd42b)return null;_0x31ca88[_0x455f('0x29')]['agent']=_0x1cd42b;return _0x31ca88;})[_0x455f('0x23')](function(_0x2d0276){if(_0x2d0276){_0x2d0276[_0x455f('0x29')][_0x455f('0x73')]=util['format']('SIP/%s',_0x57e4ba['user'][_0x455f('0x3a')]);_0x2d0276[_0x455f('0x29')][_0x455f('0x75')]=_0x31ca88['channel'];_0x2d0276[_0x455f('0x29')][_0x455f('0x76')]=_0x31ca88[_0x455f('0x75')];_0x2d0276['message'][_0x455f('0x77')]='reject';respondWithRpcPromise(_0x455f('0x79'),_0x455f('0x79'),{'event':_0x455f('0x7f'),'message':_0x2d0276[_0x455f('0x29')]},client9002);return _0x31ca88;}return null;})['then'](respondWithResult(_0xe1ec37,null))[_0x455f('0x2b')](handleError(_0xe1ec37,null));};exports['create']=function(_0x2b3b61,_0x22cf02){var _0x1ec836;return db['FaxMessage'][_0x455f('0x80')](_0x2b3b61[_0x455f('0x58')],{})[_0x455f('0x23')](function(_0x59a985){_0x1ec836=_0x59a985;return db[_0x455f('0x81')][_0x455f('0x82')]({'where':{'id':_0x1ec836[_0x455f('0x7d')]}});})[_0x455f('0x23')](function(_0x109962){if(_[_0x455f('0x63')](_0x109962)){return;}else{_0x1ec836[_0x455f('0x7a')]=_0x109962[_0x455f('0x7a')];return db['Attachment'][_0x455f('0x82')]({'where':{'id':_0x1ec836[_0x455f('0x83')]}});}})[_0x455f('0x23')](function(_0x6a7767){return respondWithRpcPromise(_0x455f('0x84'),_0x455f('0x84'),{'FaxAccountId':_[_0x455f('0x63')](_0x2b3b61[_0x455f('0x58')])?undefined:_0x2b3b61['body'][_0x455f('0x85')],'path':_[_0x455f('0x63')](_0x6a7767)?undefined:util['format'](_0x455f('0x86'),_0x6a7767[_0x455f('0x87')]),'fax':_['isNil'](_0x1ec836[_0x455f('0x7a')])?undefined:_0x1ec836[_0x455f('0x7a')],'AttachmentId':_0x1ec836[_0x455f('0x83')]},client9002);})['then'](respondWithResult(_0x22cf02,0xc9))['catch'](handleError(_0x22cf02,null));};exports['download']=function(_0x42a9cb,_0x10a6e8){var _0x50adc8=path[_0x455f('0x88')](config[_0x455f('0x89')],_0x455f('0x8a'),'files',_0x455f('0x8b'));return db[_0x455f('0x3d')]['find']({'where':{'id':_0x42a9cb[_0x455f('0x56')]['id']},'include':[{'model':db[_0x455f('0x8c')],'as':_0x455f('0x8c')}]})['then'](handleEntityNotFound(_0x10a6e8,null))[_0x455f('0x23')](function(_0x15ef3c){if(_0x15ef3c){return _0x10a6e8[_0x455f('0x8d')](path[_0x455f('0x88')](_0x50adc8,_0x15ef3c[_0x455f('0x8c')][_0x455f('0x87')]));}})[_0x455f('0x2b')](handleError(_0x10a6e8,null));};
\ No newline at end of file
+var _0x57ce=['internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','SELECT','contact','create','CmContact','findOne','isNil','AttachmentId','SendFax','FaxAccountId','basename','download','root','server','files','attachments','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','FaxInteractionId','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','fullname','email'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x57ce,0xb3));var _0xe57c=function(_0x258ee3,_0x4e983b){_0x258ee3=_0x258ee3-0x0;var _0x5b2228=_0x57ce[_0x258ee3];return _0x5b2228;};'use strict';var emlformat=require(_0xe57c('0x0'));var rimraf=require(_0xe57c('0x1'));var zipdir=require(_0xe57c('0x2'));var jsonpatch=require(_0xe57c('0x3'));var rp=require(_0xe57c('0x4'));var moment=require(_0xe57c('0x5'));var BPromise=require(_0xe57c('0x6'));var Mustache=require('mustache');var util=require(_0xe57c('0x7'));var path=require(_0xe57c('0x8'));var sox=require(_0xe57c('0x9'));var csv=require('to-csv');var ejs=require(_0xe57c('0xa'));var fs=require('fs');var fs_extra=require(_0xe57c('0xb'));var _=require(_0xe57c('0xc'));var squel=require('squel');var crypto=require(_0xe57c('0xd'));var jsforce=require(_0xe57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe57c('0xf'));var querystring=require(_0xe57c('0x10'));var Papa=require(_0xe57c('0x11'));var Redis=require(_0xe57c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe57c('0x13'));var hardwareService=require(_0xe57c('0x14'));var logger=require(_0xe57c('0x15'))(_0xe57c('0x16'));var utils=require(_0xe57c('0x17'));var config=require(_0xe57c('0x18'));var licenseUtil=require(_0xe57c('0x19'));var db=require(_0xe57c('0x1a'))['db'];config['redis']=_[_0xe57c('0x1b')](config[_0xe57c('0x1c')],{'host':_0xe57c('0x1d'),'port':0x18eb});var socket=require(_0xe57c('0x1e'))(new Redis(config[_0xe57c('0x1c')]));require(_0xe57c('0x1f'))[_0xe57c('0x20')](socket);var jayson=require(_0xe57c('0x21'));var client=jayson[_0xe57c('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xe57c('0x22')][_0xe57c('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xc38dec,_0x5943e1,_0x1f56c5,_0x5ec863){return new BPromise(function(_0x41894a,_0x1f801b){var _0x5666f8=_0x5ec863||client;return _0x5666f8[_0xe57c('0x24')](_0xc38dec,_0x1f56c5)[_0xe57c('0x25')](function(_0x321a03){logger[_0xe57c('0x26')]('FaxMessage,\x20%s,\x20%s',_0x5943e1,_0xe57c('0x27'));logger[_0xe57c('0x28')](_0xe57c('0x29'),_0x5943e1,_0xe57c('0x27'),JSON['stringify'](_0x321a03));if(_0x321a03[_0xe57c('0x2a')]){if(_0x321a03[_0xe57c('0x2a')][_0xe57c('0x2b')]===0x1f4){logger[_0xe57c('0x2a')](_0xe57c('0x2c'),_0x5943e1,_0x321a03[_0xe57c('0x2a')]['message']);return _0x1f801b(_0x321a03[_0xe57c('0x2a')][_0xe57c('0x2d')]);}logger['error'](_0xe57c('0x2c'),_0x5943e1,_0x321a03[_0xe57c('0x2a')]['message']);return _0x41894a(_0x321a03['error'][_0xe57c('0x2d')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x5943e1,_0xe57c('0x27'));_0x41894a(_0x321a03['result'][_0xe57c('0x2d')]);}})['catch'](function(_0x491fbd){logger['error'](_0xe57c('0x2c'),_0x5943e1,_0x491fbd);_0x1f801b(_0x491fbd);});});}function respondWithStatusCode(_0x500e26,_0x4f3a3d){_0x4f3a3d=_0x4f3a3d||0xcc;return function(_0x1e9474){if(_0x1e9474){return _0x500e26[_0xe57c('0x2e')](_0x4f3a3d);}return _0x500e26[_0xe57c('0x2f')](_0x4f3a3d)['end']();};}function respondWithResult(_0x3cf0cf,_0x1ffb12){_0x1ffb12=_0x1ffb12||0xc8;return function(_0x5e7855){if(_0x5e7855){return _0x3cf0cf[_0xe57c('0x2f')](_0x1ffb12)[_0xe57c('0x30')](_0x5e7855);}};}function respondWithFilteredResult(_0x44e16b,_0x58cf33){return function(_0x1878e2){if(_0x1878e2){var _0x5448cd=typeof _0x58cf33[_0xe57c('0x31')]==='undefined'&&typeof _0x58cf33[_0xe57c('0x32')]===_0xe57c('0x33');var _0x7c4c74=_0x1878e2[_0xe57c('0x34')];var _0x187a39=_0x5448cd?0x0:_0x58cf33[_0xe57c('0x31')];var _0x2d8653=_0x5448cd?_0x1878e2[_0xe57c('0x34')]:_0x58cf33[_0xe57c('0x31')]+_0x58cf33[_0xe57c('0x32')];var _0x448573;if(_0x2d8653>=_0x7c4c74){_0x2d8653=_0x7c4c74;_0x448573=0xc8;}else{_0x448573=0xce;}_0x44e16b['status'](_0x448573);return _0x44e16b[_0xe57c('0x35')](_0xe57c('0x36'),_0x187a39+'-'+_0x2d8653+'/'+_0x7c4c74)[_0xe57c('0x30')](_0x1878e2);}return null;};}function patchUpdates(_0x2fe993){return function(_0x3e241e){try{jsonpatch[_0xe57c('0x37')](_0x3e241e,_0x2fe993,!![]);}catch(_0xe4e271){return BPromise[_0xe57c('0x38')](_0xe4e271);}return _0x3e241e[_0xe57c('0x39')]();};}function saveUpdates(_0x3b5200,_0x3dd29c){return function(_0x30f11a){if(_0x30f11a){return _0x30f11a[_0xe57c('0x3a')](_0x3b5200)[_0xe57c('0x25')](function(_0xe0b5f0){return _0xe0b5f0;});}return null;};}function removeEntity(_0x46e974,_0x28fd4d){return function(_0x1e3471){if(_0x1e3471){return _0x1e3471[_0xe57c('0x3b')]()[_0xe57c('0x25')](function(){_0x46e974[_0xe57c('0x2f')](0xcc)[_0xe57c('0x3c')]();});}};}function handleEntityNotFound(_0x2e2321,_0x4ad46e){return function(_0x3433da){if(!_0x3433da){_0x2e2321['sendStatus'](0x194);}return _0x3433da;};}function handleError(_0x540538,_0x351859){_0x351859=_0x351859||0x1f4;return function(_0x30d3b2){logger[_0xe57c('0x2a')](_0x30d3b2[_0xe57c('0x3d')]);if(_0x30d3b2['name']){delete _0x30d3b2[_0xe57c('0x3e')];}_0x540538['status'](_0x351859)['send'](_0x30d3b2);};}exports[_0xe57c('0x3f')]=function(_0x1c54ab,_0x4166ca){var _0x5478a0={},_0x22f4be={},_0x5d80bc={'count':0x0,'rows':[]};var _0x3941cc=_[_0xe57c('0x40')](db[_0xe57c('0x41')][_0xe57c('0x42')],function(_0x56c90a){return{'name':_0x56c90a[_0xe57c('0x43')],'type':_0x56c90a[_0xe57c('0x44')][_0xe57c('0x45')]};});_0x22f4be[_0xe57c('0x46')]=_[_0xe57c('0x40')](_0x3941cc,_0xe57c('0x3e'));_0x22f4be['query']=_[_0xe57c('0x47')](_0x1c54ab[_0xe57c('0x48')]);_0x22f4be['filters']=_[_0xe57c('0x49')](_0x22f4be[_0xe57c('0x46')],_0x22f4be['query']);_0x5478a0[_0xe57c('0x4a')]=_[_0xe57c('0x49')](_0x22f4be['model'],qs[_0xe57c('0x4b')](_0x1c54ab[_0xe57c('0x48')]['fields']));_0x5478a0[_0xe57c('0x4a')]=_0x5478a0[_0xe57c('0x4a')][_0xe57c('0x4c')]?_0x5478a0[_0xe57c('0x4a')]:_0x22f4be[_0xe57c('0x46')];if(!_0x1c54ab[_0xe57c('0x48')][_0xe57c('0x4d')](_0xe57c('0x4e'))){_0x5478a0[_0xe57c('0x32')]=qs[_0xe57c('0x32')](_0x1c54ab[_0xe57c('0x48')][_0xe57c('0x32')]);_0x5478a0[_0xe57c('0x31')]=qs[_0xe57c('0x31')](_0x1c54ab[_0xe57c('0x48')][_0xe57c('0x31')]);}_0x5478a0[_0xe57c('0x4f')]=qs[_0xe57c('0x50')](_0x1c54ab[_0xe57c('0x48')][_0xe57c('0x50')]);_0x5478a0[_0xe57c('0x51')]=qs[_0xe57c('0x52')](_['pick'](_0x1c54ab[_0xe57c('0x48')],_0x22f4be[_0xe57c('0x52')]),_0x3941cc);if(_0x1c54ab['query'][_0xe57c('0x53')]){_0x5478a0[_0xe57c('0x51')]=_['merge'](_0x5478a0[_0xe57c('0x51')],{'$or':_[_0xe57c('0x40')](_0x3941cc,function(_0x37b92d){if(_0x37b92d['type']!==_0xe57c('0x54')){var _0x26f408={};_0x26f408[_0x37b92d[_0xe57c('0x3e')]]={'$like':'%'+_0x1c54ab['query'][_0xe57c('0x53')]+'%'};return _0x26f408;}})});}_0x5478a0=_[_0xe57c('0x55')]({},_0x5478a0,_0x1c54ab[_0xe57c('0x56')]);var _0x52e03d={'where':_0x5478a0['where']};return db['FaxMessage']['count'](_0x52e03d)[_0xe57c('0x25')](function(_0x1fa720){_0x5d80bc[_0xe57c('0x34')]=_0x1fa720;if(_0x1c54ab[_0xe57c('0x48')]['includeAll']){_0x5478a0[_0xe57c('0x57')]=[{'all':!![]}];}return db[_0xe57c('0x41')][_0xe57c('0x58')](_0x5478a0);})[_0xe57c('0x25')](function(_0x5e2449){_0x5d80bc[_0xe57c('0x59')]=_0x5e2449;return _0x5d80bc;})[_0xe57c('0x25')](respondWithFilteredResult(_0x4166ca,_0x5478a0))[_0xe57c('0x5a')](handleError(_0x4166ca,null));};exports[_0xe57c('0x5b')]=function(_0x31607e,_0x4c4b37){var _0x432ecc={'raw':!![],'where':{'id':_0x31607e[_0xe57c('0x5c')]['id']}},_0x165339={};_0x165339[_0xe57c('0x46')]=_['keys'](db['FaxMessage'][_0xe57c('0x42')]);_0x165339[_0xe57c('0x48')]=_[_0xe57c('0x47')](_0x31607e[_0xe57c('0x48')]);_0x165339[_0xe57c('0x52')]=_[_0xe57c('0x49')](_0x165339[_0xe57c('0x46')],_0x165339['query']);_0x432ecc[_0xe57c('0x4a')]=_[_0xe57c('0x49')](_0x165339[_0xe57c('0x46')],qs[_0xe57c('0x4b')](_0x31607e[_0xe57c('0x48')][_0xe57c('0x4b')]));_0x432ecc[_0xe57c('0x4a')]=_0x432ecc[_0xe57c('0x4a')][_0xe57c('0x4c')]?_0x432ecc['attributes']:_0x165339[_0xe57c('0x46')];if(_0x31607e[_0xe57c('0x48')]['includeAll']){_0x432ecc[_0xe57c('0x57')]=[{'all':!![]}];}_0x432ecc=_[_0xe57c('0x55')]({},_0x432ecc,_0x31607e[_0xe57c('0x56')]);return db[_0xe57c('0x41')]['find'](_0x432ecc)['then'](handleEntityNotFound(_0x4c4b37,null))[_0xe57c('0x25')](respondWithResult(_0x4c4b37,null))['catch'](handleError(_0x4c4b37,null));};exports[_0xe57c('0x3a')]=function(_0x4a553d,_0x3c06fd){if(_0x4a553d[_0xe57c('0x5d')]['id']){delete _0x4a553d[_0xe57c('0x5d')]['id'];}return db[_0xe57c('0x41')][_0xe57c('0x5e')]({'where':{'id':_0x4a553d[_0xe57c('0x5c')]['id']}})[_0xe57c('0x25')](handleEntityNotFound(_0x3c06fd,null))[_0xe57c('0x25')](saveUpdates(_0x4a553d[_0xe57c('0x5d')],null))[_0xe57c('0x25')](respondWithResult(_0x3c06fd,null))[_0xe57c('0x5a')](handleError(_0x3c06fd,null));};exports[_0xe57c('0x3b')]=function(_0x44e771,_0x2b1f0a){return db[_0xe57c('0x41')][_0xe57c('0x5e')]({'where':{'id':_0x44e771[_0xe57c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b1f0a,null))[_0xe57c('0x25')](removeEntity(_0x2b1f0a,null))[_0xe57c('0x5a')](handleError(_0x2b1f0a,null));};exports[_0xe57c('0x5f')]=function(_0x393f5f,_0x8b0022){return db['FaxMessage'][_0xe57c('0x5f')]()['then'](respondWithResult(_0x8b0022,null))[_0xe57c('0x5a')](handleError(_0x8b0022,null));};var interaction_log=require(_0xe57c('0x15'))(_0xe57c('0x60'));exports[_0xe57c('0x61')]=function(_0x9e77c7,_0x360c75,_0x3c0829){var _0xab5c9d={'agent':{},'channel':_0xe57c('0x62')};if(_0x9e77c7[_0xe57c('0x5d')]['id']){delete _0x9e77c7['body']['id'];}_0x9e77c7[_0xe57c('0x5d')][_0xe57c('0x63')]=!![];_0x9e77c7[_0xe57c('0x5d')][_0xe57c('0x64')]=moment()[_0xe57c('0x65')](_0xe57c('0x66'));_0x9e77c7[_0xe57c('0x5d')]['UserId']=_0x9e77c7[_0xe57c('0x5d')]['UserId']||_0x9e77c7[_0xe57c('0x67')]['id'];_0xab5c9d[_0xe57c('0x68')]['id']=_0x9e77c7['body'][_0xe57c('0x69')];return db[_0xe57c('0x41')][_0xe57c('0x5e')]({'where':{'id':_0x9e77c7[_0xe57c('0x5c')]['id'],'UserId':null}})[_0xe57c('0x25')](handleEntityNotFound(_0x360c75,null))[_0xe57c('0x25')](saveUpdates(_0x9e77c7[_0xe57c('0x5d')],null))[_0xe57c('0x25')](function(_0x2e4270){if(_0x2e4270){_0xab5c9d[_0xe57c('0x2d')]=_0x2e4270[_0xe57c('0x6a')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x2e4270[_0xe57c('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x360c75,null))[_0xe57c('0x25')](function(_0x55366){if(_0x55366){return _0x55366[_0xe57c('0x3a')]({'UserId':_0x9e77c7[_0xe57c('0x5d')][_0xe57c('0x69')],'read1stAt':_['isNil'](_0x55366['read1stAt'])?moment()[_0xe57c('0x65')](_0xe57c('0x66')):undefined});}return null;})[_0xe57c('0x25')](function(_0x5f4bb0){if(_0x5f4bb0){_0xab5c9d[_0xe57c('0x6c')]=_0x5f4bb0[_0xe57c('0x6a')]({'plain':!![]});interaction_log[_0xe57c('0x26')](_0xe57c('0x6d'),_0x9e77c7[_0xe57c('0x67')]['id'],_0x9e77c7['user'][_0xe57c('0x3e')],_0x9e77c7[_0xe57c('0x67')][_0xe57c('0x6e')],_0xab5c9d[_0xe57c('0x6c')]['id'],_0x9e77c7['body']?JSON[_0xe57c('0x6f')](_0x9e77c7[_0xe57c('0x5d')]):_0xe57c('0x70'));return respondWithRpcPromise(_0xe57c('0x71'),'acceptMessage',_0xab5c9d);}return null;})[_0xe57c('0x25')](function(_0x440ae3){var _0x44aa33=_0xe57c('0x72')+_0x440ae3['message']['ContactId'];return db[_0xe57c('0x73')][_0xe57c('0x48')](_0x44aa33,{'type':db[_0xe57c('0x74')][_0xe57c('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x2154bf){return _0x2154bf;});})[_0xe57c('0x25')](function(_0x17826c){if(_0x17826c){_0xab5c9d[_0xe57c('0x2d')]['contact']=_0x17826c[0x0];if(!_0x9e77c7[_0xe57c('0x5d')]['UserId'])return;return db[_0xe57c('0x76')][_0xe57c('0x5e')]({'where':{'id':_0x9e77c7[_0xe57c('0x5d')]['UserId'],'role':'agent'},'attributes':['id',_0xe57c('0x3e'),_0xe57c('0x77'),_0xe57c('0x78'),_0xe57c('0x79')],'raw':!![]});}return null;})[_0xe57c('0x25')](function(_0x142014){if(!_0x142014)return null;_0xab5c9d[_0xe57c('0x2d')][_0xe57c('0x68')]=_0x142014;return _0xab5c9d;})[_0xe57c('0x25')](function(_0x345acc){if(_0x345acc){if(_0x9e77c7[_0xe57c('0x5d')][_0xe57c('0x7a')]){_0xab5c9d[_0xe57c('0x2d')][_0xe57c('0x7b')]=util[_0xe57c('0x65')](_0xe57c('0x7c'),_0x9e77c7[_0xe57c('0x67')][_0xe57c('0x3e')]);_0xab5c9d[_0xe57c('0x2d')][_0xe57c('0x7d')]=_0xab5c9d[_0xe57c('0x7d')];_0xab5c9d['message'][_0xe57c('0x7e')]=_0xab5c9d[_0xe57c('0x7d')];_0xab5c9d[_0xe57c('0x2d')][_0xe57c('0x7f')]='accept';return respondWithRpcPromise(_0xe57c('0x80'),_0xe57c('0x80'),{'event':_0xe57c('0x81'),'message':_0xab5c9d[_0xe57c('0x2d')]},client9002)[_0xe57c('0x25')](function(){return _0xab5c9d;});}return _0xab5c9d;}return null;})[_0xe57c('0x25')](respondWithResult(_0x360c75,null))['catch'](handleError(_0x360c75,null));};var interaction_log=require(_0xe57c('0x15'))(_0xe57c('0x60'));exports[_0xe57c('0x38')]=function(_0x12dc51,_0x12c761,_0x4d67b7){var _0xa57059={'agent':{},'channel':_0xe57c('0x62')};if(_0x12dc51['body']['id']){delete _0x12dc51[_0xe57c('0x5d')]['id'];}_0x12dc51[_0xe57c('0x5d')]['UserId']=_0x12dc51[_0xe57c('0x5d')][_0xe57c('0x69')]||_0x12dc51[_0xe57c('0x67')]['id'];_0xa57059['agent']['id']=_0x12dc51[_0xe57c('0x5d')]['UserId'];return db[_0xe57c('0x41')][_0xe57c('0x5e')]({'where':{'id':_0x12dc51[_0xe57c('0x5c')]['id'],'UserId':null}})[_0xe57c('0x25')](handleEntityNotFound(_0x12c761,null))[_0xe57c('0x25')](function(_0x4a37f2){if(_0x4a37f2){_0xa57059[_0xe57c('0x2d')]=_0x4a37f2[_0xe57c('0x6a')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4a37f2[_0xe57c('0x6b')]}});}return null;})[_0xe57c('0x25')](handleEntityNotFound(_0x12c761,null))[_0xe57c('0x25')](function(_0x21fafa){if(_0x21fafa){_0xa57059[_0xe57c('0x6c')]=_0x21fafa['get']({'plain':!![]});interaction_log[_0xe57c('0x26')](_0xe57c('0x82'),_0x12dc51[_0xe57c('0x67')]['id'],_0x12dc51[_0xe57c('0x67')][_0xe57c('0x3e')],_0x12dc51[_0xe57c('0x67')]['role'],_0xa57059['interaction']['id'],_0x12dc51[_0xe57c('0x5d')]?JSON[_0xe57c('0x6f')](_0x12dc51['body']):_0xe57c('0x70'));return respondWithRpcPromise('RejectMessage',_0xe57c('0x83'),_0xa57059);}return null;})[_0xe57c('0x25')](function(_0x2ea30d){var _0x3d1164=_0xe57c('0x72')+_0x2ea30d['message'][_0xe57c('0x84')];return db['sequelize'][_0xe57c('0x48')](_0x3d1164,{'type':db[_0xe57c('0x74')][_0xe57c('0x75')][_0xe57c('0x85')],'raw':!![]})[_0xe57c('0x25')](function(_0x277e5b){return _0x277e5b;});})[_0xe57c('0x25')](function(_0x24ba4a){if(_0x24ba4a){_0xa57059['message'][_0xe57c('0x86')]=_0x24ba4a[0x0];if(!_0x12dc51[_0xe57c('0x5d')][_0xe57c('0x69')])return;return db[_0xe57c('0x76')][_0xe57c('0x5e')]({'where':{'id':_0x12dc51[_0xe57c('0x5d')]['UserId'],'role':_0xe57c('0x68')},'attributes':['id','name',_0xe57c('0x77'),_0xe57c('0x78'),'internal'],'raw':!![]});}return null;})[_0xe57c('0x25')](function(_0x239884){if(!_0x239884)return null;_0xa57059[_0xe57c('0x2d')][_0xe57c('0x68')]=_0x239884;return _0xa57059;})[_0xe57c('0x25')](function(_0x8f7227){if(_0x8f7227){_0x8f7227[_0xe57c('0x2d')][_0xe57c('0x7b')]=util[_0xe57c('0x65')](_0xe57c('0x7c'),_0x12dc51[_0xe57c('0x67')][_0xe57c('0x3e')]);_0x8f7227[_0xe57c('0x2d')]['channel']=_0xa57059[_0xe57c('0x7d')];_0x8f7227[_0xe57c('0x2d')][_0xe57c('0x7e')]=_0xa57059[_0xe57c('0x7d')];_0x8f7227[_0xe57c('0x2d')][_0xe57c('0x7f')]=_0xe57c('0x38');respondWithRpcPromise(_0xe57c('0x80'),'EventManager',{'event':'rejectmessage','message':_0x8f7227['message']},client9002);return _0xa57059;}return null;})[_0xe57c('0x25')](respondWithResult(_0x12c761,null))[_0xe57c('0x5a')](handleError(_0x12c761,null));};exports[_0xe57c('0x87')]=function(_0x411a14,_0x45d291){var _0xb28809;return db[_0xe57c('0x41')][_0xe57c('0x87')](_0x411a14['body'],{})[_0xe57c('0x25')](function(_0x23ea11){_0xb28809=_0x23ea11;return db[_0xe57c('0x88')][_0xe57c('0x89')]({'where':{'id':_0xb28809[_0xe57c('0x84')]}});})[_0xe57c('0x25')](function(_0x5ce199){if(_[_0xe57c('0x8a')](_0x5ce199)){return;}else{_0xb28809[_0xe57c('0x62')]=_0x5ce199[_0xe57c('0x62')];return db['Attachment'][_0xe57c('0x89')]({'where':{'id':_0xb28809[_0xe57c('0x8b')]}});}})['then'](function(_0x124a79){return respondWithRpcPromise('SendFax',_0xe57c('0x8c'),{'FaxAccountId':_['isNil'](_0x411a14[_0xe57c('0x5d')])?undefined:_0x411a14[_0xe57c('0x5d')][_0xe57c('0x8d')],'path':_[_0xe57c('0x8a')](_0x124a79)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x124a79[_0xe57c('0x8e')]),'fax':_['isNil'](_0xb28809[_0xe57c('0x62')])?undefined:_0xb28809['fax'],'AttachmentId':_0xb28809['AttachmentId']},client9002);})[_0xe57c('0x25')](respondWithResult(_0x45d291,0xc9))[_0xe57c('0x5a')](handleError(_0x45d291,null));};exports[_0xe57c('0x8f')]=function(_0x44ece2,_0x36e948){var _0x1214f9=path['join'](config[_0xe57c('0x90')],_0xe57c('0x91'),_0xe57c('0x92'),_0xe57c('0x93'));return db[_0xe57c('0x41')][_0xe57c('0x5e')]({'where':{'id':_0x44ece2[_0xe57c('0x5c')]['id']},'include':[{'model':db[_0xe57c('0x94')],'as':_0xe57c('0x94')}]})['then'](handleEntityNotFound(_0x36e948,null))['then'](function(_0x291432){if(_0x291432){return _0x36e948['download'](path[_0xe57c('0x95')](_0x1214f9,_0x291432[_0xe57c('0x94')]['basename']));}})[_0xe57c('0x5a')](handleError(_0x36e948,null));};
\ No newline at end of file
index 09231fa..eb04c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb67=['hook','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xbb67,0x161));var _0x7bb6=function(_0x439f69,_0x3e7d7e){_0x439f69=_0x439f69-0x0;var _0x36b544=_0xbb67[_0x439f69];return _0x36b544;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7bb6('0x0'))['db'][_0x7bb6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7bb6('0x2')](0x0);var events={'afterCreate':_0x7bb6('0x3'),'afterUpdate':_0x7bb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33a5c4){return function(_0x2c1ddb,_0x1f527c,_0x7fb7c9){FaxMessageEvents[_0x7bb6('0x5')](_0x33a5c4+':'+_0x2c1ddb['id'],_0x2c1ddb);FaxMessageEvents[_0x7bb6('0x5')](_0x33a5c4,_0x2c1ddb);_0x7fb7c9(null);};}for(var e in events){if(events[_0x7bb6('0x6')](e)){var event=events[e];FaxMessage[_0x7bb6('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0xda81=['exports','events','../../mysqldb','FaxMessage','save','update','remove','emit','hook'];(function(_0x50d81b,_0x108795){var _0x32ef5f=function(_0x20d397){while(--_0x20d397){_0x50d81b['push'](_0x50d81b['shift']());}};_0x32ef5f(++_0x108795);}(_0xda81,0x1c3));var _0x1da8=function(_0x344927,_0x1e6ecf){_0x344927=_0x344927-0x0;var _0x7b7ca0=_0xda81[_0x344927];return _0x7b7ca0;};'use strict';var EventEmitter=require(_0x1da8('0x0'));var FaxMessage=require(_0x1da8('0x1'))['db'][_0x1da8('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1da8('0x3'),'afterUpdate':_0x1da8('0x4'),'afterDestroy':_0x1da8('0x5')};function emitEvent(_0x177870){return function(_0x48421c,_0x3357ac,_0x2692c1){FaxMessageEvents['emit'](_0x177870+':'+_0x48421c['id'],_0x48421c);FaxMessageEvents[_0x1da8('0x6')](_0x177870,_0x48421c);_0x2692c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x1da8('0x7')](e,emitEvent(event));}}module[_0x1da8('0x8')]=FaxMessageEvents;
\ No newline at end of file
index 4a4bc66..db04ee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd86a=['then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xd86a,0xa1));var _0xad86=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xd86a[_0x21b36c];return _0x236627;};'use strict';var _=require(_0xad86('0x0'));var util=require(_0xad86('0x1'));var logger=require(_0xad86('0x2'))(_0xad86('0x3'));var moment=require(_0xad86('0x4'));var BPromise=require(_0xad86('0x5'));var rp=require(_0xad86('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad86('0x7'));var config=require('../../config/environment');var attributes=require(_0xad86('0x8'));module[_0xad86('0x9')]=function(_0x531288,_0x3eb3af){return _0x531288[_0xad86('0xa')](_0xad86('0xb'),attributes,{'tableName':_0xad86('0xc'),'paranoid':![],'indexes':[{'name':_0xad86('0xd'),'fields':[_0xad86('0xe')],'type':_0xad86('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d7c5e,_0x5c7de6,_0x12a5a9){var _0x57f62d=_0x531288['models'];var _0x38f1ef=_0x2d7c5e[_0xad86('0x10')]({'plain':!![]});if(_0x38f1ef[_0xad86('0x11')][_0xad86('0x12')]()==='in'||_0x38f1ef[_0xad86('0x11')]['toLowerCase']()===_0xad86('0x13')&&!_0x38f1ef['secret']&&!_[_0xad86('0x14')](_0x38f1ef[_0xad86('0x15')])){_0x57f62d[_0xad86('0x16')][_0xad86('0x17')]({'where':{'id':_0x38f1ef[_0xad86('0x18')]}})[_0xad86('0x19')](function(_0x12251a){if(_0x12251a){_0x12251a[_0xad86('0x1a')]({'lastMsgAt':_0x38f1ef[_0xad86('0x1b')],'lastMsgDirection':_0x38f1ef['direction'][_0xad86('0x12')]()});}})[_0xad86('0x1c')](function(_0x261a43){console[_0xad86('0x1d')](_0x261a43);});}_0x12a5a9();}},'charset':'utf8mb4','collate':_0xad86('0x1e')});};
\ No newline at end of file
+var _0x477f=['FaxMessage','body','FULLTEXT','models','get','direction','secret','isNil','UserId','FaxInteraction','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define'];(function(_0x39ed9b,_0x2a283e){var _0x6eba5a=function(_0x42baa2){while(--_0x42baa2){_0x39ed9b['push'](_0x39ed9b['shift']());}};_0x6eba5a(++_0x2a283e);}(_0x477f,0x6c));var _0xf477=function(_0x1ef55e,_0x3a4390){_0x1ef55e=_0x1ef55e-0x0;var _0x5c016d=_0x477f[_0x1ef55e];return _0x5c016d;};'use strict';var _=require('lodash');var util=require(_0xf477('0x0'));var logger=require(_0xf477('0x1'))(_0xf477('0x2'));var moment=require(_0xf477('0x3'));var BPromise=require(_0xf477('0x4'));var rp=require(_0xf477('0x5'));var fs=require('fs');var path=require(_0xf477('0x6'));var rimraf=require(_0xf477('0x7'));var config=require(_0xf477('0x8'));var attributes=require(_0xf477('0x9'));module[_0xf477('0xa')]=function(_0x274195,_0x2cb538){return _0x274195[_0xf477('0xb')](_0xf477('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xf477('0xd')],'type':_0xf477('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d902a,_0xbf82de,_0x152ad9){var _0x2844b8=_0x274195[_0xf477('0xf')];var _0x12e3f4=_0x4d902a[_0xf477('0x10')]({'plain':!![]});if(_0x12e3f4[_0xf477('0x11')]['toLowerCase']()==='in'||_0x12e3f4[_0xf477('0x11')]['toLowerCase']()==='out'&&!_0x12e3f4[_0xf477('0x12')]&&!_[_0xf477('0x13')](_0x12e3f4[_0xf477('0x14')])){_0x2844b8[_0xf477('0x15')]['findOne']({'where':{'id':_0x12e3f4['FaxInteractionId']}})[_0xf477('0x16')](function(_0x90b4b8){if(_0x90b4b8){_0x90b4b8[_0xf477('0x17')]({'lastMsgAt':_0x12e3f4[_0xf477('0x18')],'lastMsgDirection':_0x12e3f4[_0xf477('0x11')][_0xf477('0x19')]()});}})[_0xf477('0x1a')](function(_0x9d4676){console[_0xf477('0x1b')](_0x9d4676);});}_0x152ad9();}},'charset':_0xf477('0x1c'),'collate':_0xf477('0x1d')});};
\ No newline at end of file
index cf8e695..45492dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['CreateFaxMessage','FaxMessage','create','body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4bc3[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});config[_0x34bc('0xb')]=_['defaults'](config['redis'],{'host':_0x34bc('0xc'),'port':0x18eb});var socket=require(_0x34bc('0xd'))(new Redis(config[_0x34bc('0xb')]));require(_0x34bc('0xe'))[_0x34bc('0xf')](socket);function respondWithRpcPromise(_0x41b2ff,_0x5de8b5,_0x5a478d){return new BPromise(function(_0x2b8112,_0x33025c){return client[_0x34bc('0x10')](_0x41b2ff,_0x5a478d)['then'](function(_0x41960e){logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));logger[_0x34bc('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5de8b5,_0x34bc('0x12'),JSON['stringify'](_0x41960e));if(_0x41960e[_0x34bc('0x14')]){if(_0x41960e[_0x34bc('0x14')][_0x34bc('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x41960e[_0x34bc('0x14')]['message']);return _0x33025c(_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);}logger[_0x34bc('0x14')](_0x34bc('0x11'),_0x5de8b5,_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);return _0x2b8112(_0x41960e['error']['message']);}else{logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));_0x2b8112(_0x41960e[_0x34bc('0x17')][_0x34bc('0x16')]);}})['catch'](function(_0x46aa24){logger[_0x34bc('0x14')]('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x46aa24);_0x33025c(_0x46aa24);});});}exports[_0x34bc('0x18')]=function(_0x9e9f14){var _0x4d2d5e=this;return new Promise(function(_0x14cec8,_0x26cdec){return db[_0x34bc('0x19')][_0x34bc('0x1a')](_0x9e9f14[_0x34bc('0x1b')],{'raw':_0x9e9f14[_0x34bc('0x1c')]?_0x9e9f14['options'][_0x34bc('0x1d')]===undefined?!![]:![]:!![]})[_0x34bc('0x1e')](function(_0x38882c){logger['info']('CreateFaxMessage',_0x9e9f14);logger[_0x34bc('0x13')](_0x34bc('0x18'),_0x9e9f14,JSON[_0x34bc('0x1f')](_0x38882c));_0x14cec8(_0x38882c);})[_0x34bc('0x20')](function(_0x13094a){logger[_0x34bc('0x14')](_0x34bc('0x18'),_0x13094a[_0x34bc('0x16')],_0x9e9f14);_0x26cdec(_0x4d2d5e[_0x34bc('0x14')](0x1f4,_0x13094a[_0x34bc('0x16')]));});});};exports[_0x34bc('0x21')]=function(_0x1edcb0){var _0x4fd589=this;return new Promise(function(_0x43e527,_0x48ec13){return db['FaxMessage'][_0x34bc('0x22')](_0x1edcb0['body'],{'raw':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edcb0['options']?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x23')]||null:null,'attributes':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x24')]||null:null,'limit':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0['options'][_0x34bc('0x25')]||null:null})[_0x34bc('0x1e')](function(_0x22aacc){logger[_0x34bc('0x26')](_0x34bc('0x21'),_0x1edcb0);logger[_0x34bc('0x13')]('UpdateFaxMessage',_0x1edcb0,JSON[_0x34bc('0x1f')](_0x22aacc));_0x43e527(_0x22aacc);})['catch'](function(_0x530748){logger[_0x34bc('0x14')]('UpdateFaxMessage',_0x530748[_0x34bc('0x16')],_0x1edcb0);_0x48ec13(_0x4fd589[_0x34bc('0x14')](0x1f4,_0x530748[_0x34bc('0x16')]));});});};
\ No newline at end of file
+var _0x99e9=['register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x99e9,0xb4));var _0x999e=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0x99e9[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});config[_0x999e('0xa')]=_[_0x999e('0xb')](config['redis'],{'host':_0x999e('0xc'),'port':0x18eb});var socket=require(_0x999e('0xd'))(new Redis(config[_0x999e('0xa')]));require(_0x999e('0xe'))[_0x999e('0xf')](socket);function respondWithRpcPromise(_0x175042,_0x3f2c24,_0x180846){return new BPromise(function(_0x3cb1c2,_0xf40130){return client[_0x999e('0x10')](_0x175042,_0x180846)[_0x999e('0x11')](function(_0x4246b1){logger[_0x999e('0x12')](_0x999e('0x13'),_0x3f2c24,_0x999e('0x14'));logger[_0x999e('0x15')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3f2c24,_0x999e('0x14'),JSON['stringify'](_0x4246b1));if(_0x4246b1[_0x999e('0x16')]){if(_0x4246b1[_0x999e('0x16')][_0x999e('0x17')]===0x1f4){logger['error'](_0x999e('0x13'),_0x3f2c24,_0x4246b1['error'][_0x999e('0x18')]);return _0xf40130(_0x4246b1['error']['message']);}logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);return _0x3cb1c2(_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3f2c24,'request\x20sent');_0x3cb1c2(_0x4246b1[_0x999e('0x19')][_0x999e('0x18')]);}})[_0x999e('0x1a')](function(_0x302f52){logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x302f52);_0xf40130(_0x302f52);});});}exports['CreateFaxMessage']=function(_0x5d86d4){var _0xc20d3e=this;return new Promise(function(_0x3f4d7c,_0x3b3642){return db['FaxMessage'][_0x999e('0x1b')](_0x5d86d4[_0x999e('0x1c')],{'raw':_0x5d86d4[_0x999e('0x1d')]?_0x5d86d4[_0x999e('0x1d')][_0x999e('0x1e')]===undefined?!![]:![]:!![]})[_0x999e('0x11')](function(_0x427bcf){logger['info']('CreateFaxMessage',_0x5d86d4);logger[_0x999e('0x15')](_0x999e('0x1f'),_0x5d86d4,JSON['stringify'](_0x427bcf));_0x3f4d7c(_0x427bcf);})[_0x999e('0x1a')](function(_0xe324d8){logger[_0x999e('0x16')](_0x999e('0x1f'),_0xe324d8[_0x999e('0x18')],_0x5d86d4);_0x3b3642(_0xc20d3e[_0x999e('0x16')](0x1f4,_0xe324d8['message']));});});};exports[_0x999e('0x20')]=function(_0x4199ff){var _0x11068e=this;return new Promise(function(_0x12b9ad,_0x1b7adb){return db[_0x999e('0x21')][_0x999e('0x22')](_0x4199ff['body'],{'raw':_0x4199ff[_0x999e('0x1d')]?_0x4199ff['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x23')]||null:null,'attributes':_0x4199ff['options']?_0x4199ff[_0x999e('0x1d')][_0x999e('0x24')]||null:null,'limit':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x25')]||null:null})[_0x999e('0x11')](function(_0x82e067){logger[_0x999e('0x12')](_0x999e('0x20'),_0x4199ff);logger[_0x999e('0x15')]('UpdateFaxMessage',_0x4199ff,JSON[_0x999e('0x26')](_0x82e067));_0x12b9ad(_0x82e067);})[_0x999e('0x1a')](function(_0x371613){logger['error'](_0x999e('0x20'),_0x371613['message'],_0x4199ff);_0x1b7adb(_0x11068e['error'](0x1f4,_0x371613[_0x999e('0x18')]));});});};
\ No newline at end of file
index 669089c..aad8c29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6664=['remove','update','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x5d6392,_0x271a01){var _0x5808ab=function(_0x1851a6){while(--_0x1851a6){_0x5d6392['push'](_0x5d6392['shift']());}};_0x5808ab(++_0x271a01);}(_0x6664,0x1ce));var _0x4666=function(_0x5f4583,_0x381c0b){_0x5f4583=_0x5f4583-0x0;var _0x454051=_0x6664[_0x5f4583];return _0x454051;};'use strict';var FaxMessageEvents=require(_0x4666('0x0'));var events=[_0x4666('0x1'),_0x4666('0x2'),_0x4666('0x3')];function createListener(_0x2f2573,_0x554fe2){return function(_0x814daf){_0x554fe2['emit'](_0x2f2573,_0x814daf);};}function removeListener(_0x1766dd,_0x5cd082){return function(){FaxMessageEvents[_0x4666('0x4')](_0x1766dd,_0x5cd082);};}exports[_0x4666('0x5')]=function(_0x281fe6){for(var _0x10add6=0x0,_0x284c64=events[_0x4666('0x6')];_0x10add6<_0x284c64;_0x10add6++){var _0x16b547=events[_0x10add6];var _0x9d4107=createListener(_0x4666('0x7')+_0x16b547,_0x281fe6);FaxMessageEvents['on'](_0x16b547,_0x9d4107);}};
\ No newline at end of file
+var _0x91e0=['emit','removeListener','register','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x306368,_0x2fc5e4){var _0x294718=function(_0x4445ba){while(--_0x4445ba){_0x306368['push'](_0x306368['shift']());}};_0x294718(++_0x2fc5e4);}(_0x91e0,0x1dc));var _0x091e=function(_0x4ae097,_0x464ccc){_0x4ae097=_0x4ae097-0x0;var _0x2fb89a=_0x91e0[_0x4ae097];return _0x2fb89a;};'use strict';var FaxMessageEvents=require(_0x091e('0x0'));var events=[_0x091e('0x1'),_0x091e('0x2'),_0x091e('0x3')];function createListener(_0xf82f5a,_0xb50e5b){return function(_0x4f1708){_0xb50e5b[_0x091e('0x4')](_0xf82f5a,_0x4f1708);};}function removeListener(_0x3595ad,_0x3fd01c){return function(){FaxMessageEvents[_0x091e('0x5')](_0x3595ad,_0x3fd01c);};}exports[_0x091e('0x6')]=function(_0x2fc201){for(var _0x171ff8=0x0,_0x581943=events['length'];_0x171ff8<_0x581943;_0x171ff8++){var _0x5c9704=events[_0x171ff8];var _0x73b94d=createListener(_0x091e('0x7')+_0x5c9704,_0x2fc201);FaxMessageEvents['on'](_0x5c9704,_0x73b94d);}};
\ No newline at end of file
index eef2919..8360a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd9=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/reject','reject','delete','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x17d271,_0x42d423){var _0x40cda3=function(_0x329e61){while(--_0x329e61){_0x17d271['push'](_0x17d271['shift']());}};_0x40cda3(++_0x42d423);}(_0x0fd9,0xa3));var _0x90fd=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0fd9[_0x3c4dad];return _0x1a4f49;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),interaction[_0x90fd('0x10')](_0x90fd('0x11'),'faxmessage:create'),controller[_0x90fd('0x12')]);router[_0x90fd('0x13')]('/:id',auth[_0x90fd('0x9')](),controller[_0x90fd('0x14')]);router[_0x90fd('0x13')]('/:id/accept',auth[_0x90fd('0x9')](),controller['accept']);router[_0x90fd('0x13')](_0x90fd('0x15'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x16')]);router[_0x90fd('0x17')](_0x90fd('0xb'),auth[_0x90fd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x878f=['update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','/:id','/:id/download','isAuthenticated','post','fax','create','put'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x878f,0x173));var _0xf878=function(_0x32e8c2,_0x1b48e1){_0x32e8c2=_0x32e8c2-0x0;var _0x49773c=_0x878f[_0x32e8c2];return _0x49773c;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['download']);router[_0xf878('0xf')]('/',auth[_0xf878('0xe')](),interaction['tracked'](_0xf878('0x10'),'faxmessage:create'),controller[_0xf878('0x11')]);router[_0xf878('0x12')](_0xf878('0xc'),auth['isAuthenticated'](),controller[_0xf878('0x13')]);router[_0xf878('0x12')](_0xf878('0x14'),auth['isAuthenticated'](),controller[_0xf878('0x15')]);router[_0xf878('0x12')](_0xf878('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xf878('0x17')](_0xf878('0xc'),auth[_0xf878('0xe')](),controller[_0xf878('0x18')]);module[_0xf878('0x19')]=router;
\ No newline at end of file
index a0ed641..65c410b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd01d=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','name'];(function(_0x3a0dc5,_0x540eb0){var _0x1d48a3=function(_0x3e4f72){while(--_0x3e4f72){_0x3a0dc5['push'](_0x3a0dc5['shift']());}};_0x1d48a3(++_0x540eb0);}(_0xd01d,0xbe));var _0xdd01=function(_0x25721c,_0x17342a){_0x25721c=_0x25721c-0x0;var _0x3063d9=_0xd01d[_0x25721c];return _0x3063d9;};'use strict';var Sequelize=require('sequelize');module[_0xdd01('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xdd01('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdd01('0x2')]},'timeout':{'type':Sequelize[_0xdd01('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdd01('0x4')](_0xdd01('0x5'),_0xdd01('0x6'),_0xdd01('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdd01('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf27d=['beepall','roundrobin','INTEGER','sequelize','STRING','rrmemory'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf27d,0xc3));var _0xdf27=function(_0x441d8d,_0x4c964c){_0x441d8d=_0x441d8d-0x0;var _0x35ac69=_0xf27d[_0x441d8d];return _0x35ac69;};'use strict';var Sequelize=require(_0xdf27('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf27('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdf27('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xdf27('0x2'),_0xdf27('0x3'),_0xdf27('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdf27('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 53746dc..abe5a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd6=['keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','%s/%s','updatedAt','getTeams','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','Team','ids','select','tq.TeamId','from','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','addAgents','spread','emit','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','map','FaxQueue','rawAttributes','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4a3dca,_0x487567){var _0x180820=function(_0x482a9b){while(--_0x482a9b){_0x4a3dca['push'](_0x4a3dca['shift']());}};_0x180820(++_0x487567);}(_0xfcd6,0xc5));var _0x6fcd=function(_0x487683,_0x58b9b8){_0x487683=_0x487683-0x0;var _0x178a4d=_0xfcd6[_0x487683];return _0x178a4d;};'use strict';var emlformat=require(_0x6fcd('0x0'));var rimraf=require(_0x6fcd('0x1'));var zipdir=require(_0x6fcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6fcd('0x3'));var BPromise=require(_0x6fcd('0x4'));var Mustache=require('mustache');var util=require(_0x6fcd('0x5'));var path=require(_0x6fcd('0x6'));var sox=require(_0x6fcd('0x7'));var csv=require(_0x6fcd('0x8'));var ejs=require(_0x6fcd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6fcd('0xa'));var squel=require(_0x6fcd('0xb'));var crypto=require(_0x6fcd('0xc'));var jsforce=require(_0x6fcd('0xd'));var deskjs=require(_0x6fcd('0xe'));var toCsv=require(_0x6fcd('0x8'));var querystring=require('querystring');var Papa=require(_0x6fcd('0xf'));var Redis=require('ioredis');var authService=require(_0x6fcd('0x10'));var qs=require(_0x6fcd('0x11'));var as=require(_0x6fcd('0x12'));var hardwareService=require(_0x6fcd('0x13'));var logger=require(_0x6fcd('0x14'))(_0x6fcd('0x15'));var utils=require(_0x6fcd('0x16'));var config=require(_0x6fcd('0x17'));var licenseUtil=require(_0x6fcd('0x18'));var db=require(_0x6fcd('0x19'))['db'];config['redis']=_[_0x6fcd('0x1a')](config[_0x6fcd('0x1b')],{'host':_0x6fcd('0x1c'),'port':0x18eb});var socket=require(_0x6fcd('0x1d'))(new Redis(config[_0x6fcd('0x1b')]));require(_0x6fcd('0x1e'))[_0x6fcd('0x1f')](socket);function respondWithStatusCode(_0x577973,_0x29900f){_0x29900f=_0x29900f||0xcc;return function(_0x30ea9f){if(_0x30ea9f){return _0x577973[_0x6fcd('0x20')](_0x29900f);}return _0x577973[_0x6fcd('0x21')](_0x29900f)[_0x6fcd('0x22')]();};}function respondWithResult(_0x4db7ce,_0xa38a11){_0xa38a11=_0xa38a11||0xc8;return function(_0x30ba1c){if(_0x30ba1c){return _0x4db7ce[_0x6fcd('0x21')](_0xa38a11)[_0x6fcd('0x23')](_0x30ba1c);}};}function respondWithFilteredResult(_0xbb3f66,_0x314945){return function(_0xf15a5d){if(_0xf15a5d){var _0x1bac4b=typeof _0x314945['offset']===_0x6fcd('0x24')&&typeof _0x314945['limit']===_0x6fcd('0x24');var _0x1ecbbb=_0xf15a5d[_0x6fcd('0x25')];var _0x33803e=_0x1bac4b?0x0:_0x314945[_0x6fcd('0x26')];var _0x492743=_0x1bac4b?_0xf15a5d[_0x6fcd('0x25')]:_0x314945[_0x6fcd('0x26')]+_0x314945[_0x6fcd('0x27')];var _0xeaec01;if(_0x492743>=_0x1ecbbb){_0x492743=_0x1ecbbb;_0xeaec01=0xc8;}else{_0xeaec01=0xce;}_0xbb3f66[_0x6fcd('0x21')](_0xeaec01);return _0xbb3f66['set']('Content-Range',_0x33803e+'-'+_0x492743+'/'+_0x1ecbbb)['json'](_0xf15a5d);}return null;};}function patchUpdates(_0x5377e3){return function(_0x16d069){try{jsonpatch[_0x6fcd('0x28')](_0x16d069,_0x5377e3,!![]);}catch(_0x105e62){return BPromise[_0x6fcd('0x29')](_0x105e62);}return _0x16d069[_0x6fcd('0x2a')]();};}function saveUpdates(_0x2f4a93,_0x15dd50){return function(_0x3b4a76){if(_0x3b4a76){return _0x3b4a76[_0x6fcd('0x2b')](_0x2f4a93)[_0x6fcd('0x2c')](function(_0x48d17){return _0x48d17;});}return null;};}function removeEntity(_0x432829,_0x115fa7){return function(_0xe68aed){if(_0xe68aed){return _0xe68aed[_0x6fcd('0x2d')]()[_0x6fcd('0x2c')](function(){var _0x30af17=_0xe68aed[_0x6fcd('0x2e')]({'plain':!![]});var _0x523268=_0x6fcd('0x2f');return db[_0x6fcd('0x30')][_0x6fcd('0x2d')]({'where':{'type':_0x523268,'resourceId':_0x30af17['id']}})[_0x6fcd('0x2c')](function(){return _0xe68aed;});})[_0x6fcd('0x2c')](function(){_0x432829[_0x6fcd('0x21')](0xcc)[_0x6fcd('0x22')]();});}};}function handleEntityNotFound(_0x1334d9,_0x19cae0){return function(_0x31db51){if(!_0x31db51){_0x1334d9[_0x6fcd('0x20')](0x194);}return _0x31db51;};}function handleError(_0x3f46fb,_0xf61e18){_0xf61e18=_0xf61e18||0x1f4;return function(_0x4067cc){logger[_0x6fcd('0x31')](_0x4067cc['stack']);if(_0x4067cc[_0x6fcd('0x32')]){delete _0x4067cc[_0x6fcd('0x32')];}_0x3f46fb[_0x6fcd('0x21')](_0xf61e18)[_0x6fcd('0x33')](_0x4067cc);};}exports['index']=function(_0x3ebbf3,_0x36b6ad){var _0x2d3347={},_0x249ce0={},_0x582caf={'count':0x0,'rows':[]};var _0x8f26d5=_[_0x6fcd('0x34')](db[_0x6fcd('0x35')][_0x6fcd('0x36')],function(_0x4d26b1){return{'name':_0x4d26b1['fieldName'],'type':_0x4d26b1['type'][_0x6fcd('0x37')]};});_0x249ce0[_0x6fcd('0x38')]=_[_0x6fcd('0x34')](_0x8f26d5,_0x6fcd('0x32'));_0x249ce0[_0x6fcd('0x39')]=_['keys'](_0x3ebbf3[_0x6fcd('0x39')]);_0x249ce0['filters']=_[_0x6fcd('0x3a')](_0x249ce0['model'],_0x249ce0[_0x6fcd('0x39')]);_0x2d3347[_0x6fcd('0x3b')]=_[_0x6fcd('0x3a')](_0x249ce0[_0x6fcd('0x38')],qs['fields'](_0x3ebbf3[_0x6fcd('0x39')]['fields']));_0x2d3347['attributes']=_0x2d3347[_0x6fcd('0x3b')][_0x6fcd('0x3c')]?_0x2d3347[_0x6fcd('0x3b')]:_0x249ce0[_0x6fcd('0x38')];if(!_0x3ebbf3[_0x6fcd('0x39')][_0x6fcd('0x3d')](_0x6fcd('0x3e'))){_0x2d3347[_0x6fcd('0x27')]=qs[_0x6fcd('0x27')](_0x3ebbf3[_0x6fcd('0x39')]['limit']);_0x2d3347[_0x6fcd('0x26')]=qs[_0x6fcd('0x26')](_0x3ebbf3[_0x6fcd('0x39')]['offset']);}_0x2d3347[_0x6fcd('0x3f')]=qs['sort'](_0x3ebbf3[_0x6fcd('0x39')][_0x6fcd('0x40')]);_0x2d3347[_0x6fcd('0x41')]=qs[_0x6fcd('0x42')](_[_0x6fcd('0x43')](_0x3ebbf3[_0x6fcd('0x39')],_0x249ce0[_0x6fcd('0x42')]),_0x8f26d5);if(_0x3ebbf3['query'][_0x6fcd('0x44')]){_0x2d3347[_0x6fcd('0x41')]=_[_0x6fcd('0x45')](_0x2d3347[_0x6fcd('0x41')],{'$or':_[_0x6fcd('0x34')](_0x8f26d5,function(_0x1994a2){if(_0x1994a2[_0x6fcd('0x46')]!==_0x6fcd('0x47')){var _0x447928={};_0x447928[_0x1994a2[_0x6fcd('0x32')]]={'$like':'%'+_0x3ebbf3['query'][_0x6fcd('0x44')]+'%'};return _0x447928;}})});}_0x2d3347=_[_0x6fcd('0x45')]({},_0x2d3347,_0x3ebbf3[_0x6fcd('0x48')]);var _0x41a55f={'where':_0x2d3347['where']};return db[_0x6fcd('0x35')][_0x6fcd('0x25')](_0x41a55f)[_0x6fcd('0x2c')](function(_0x49dc96){_0x582caf['count']=_0x49dc96;if(_0x3ebbf3[_0x6fcd('0x39')][_0x6fcd('0x49')]){_0x2d3347[_0x6fcd('0x4a')]=[{'all':!![]}];}return db[_0x6fcd('0x35')]['findAll'](_0x2d3347);})['then'](function(_0x3c5423){_0x582caf[_0x6fcd('0x4b')]=_0x3c5423;return _0x582caf;})[_0x6fcd('0x2c')](respondWithFilteredResult(_0x36b6ad,_0x2d3347))[_0x6fcd('0x4c')](handleError(_0x36b6ad,null));};exports['show']=function(_0xa9d672,_0x5dd155){var _0x3b7a91={'raw':!![],'where':{'id':_0xa9d672['params']['id']}},_0x9abcc2={};_0x9abcc2[_0x6fcd('0x38')]=_[_0x6fcd('0x4d')](db[_0x6fcd('0x35')]['rawAttributes']);_0x9abcc2[_0x6fcd('0x39')]=_[_0x6fcd('0x4d')](_0xa9d672[_0x6fcd('0x39')]);_0x9abcc2[_0x6fcd('0x42')]=_[_0x6fcd('0x3a')](_0x9abcc2[_0x6fcd('0x38')],_0x9abcc2[_0x6fcd('0x39')]);_0x3b7a91[_0x6fcd('0x3b')]=_[_0x6fcd('0x3a')](_0x9abcc2['model'],qs[_0x6fcd('0x4e')](_0xa9d672[_0x6fcd('0x39')]['fields']));_0x3b7a91[_0x6fcd('0x3b')]=_0x3b7a91[_0x6fcd('0x3b')][_0x6fcd('0x3c')]?_0x3b7a91['attributes']:_0x9abcc2['model'];if(_0xa9d672[_0x6fcd('0x39')]['includeAll']){_0x3b7a91[_0x6fcd('0x4a')]=[{'all':!![]}];}_0x3b7a91=_[_0x6fcd('0x45')]({},_0x3b7a91,_0xa9d672[_0x6fcd('0x48')]);return db[_0x6fcd('0x35')][_0x6fcd('0x4f')](_0x3b7a91)[_0x6fcd('0x2c')](handleEntityNotFound(_0x5dd155,null))[_0x6fcd('0x2c')](respondWithResult(_0x5dd155,null))[_0x6fcd('0x4c')](handleError(_0x5dd155,null));};exports[_0x6fcd('0x50')]=function(_0xba9e75,_0x68822d){return db[_0x6fcd('0x35')]['create'](_0xba9e75[_0x6fcd('0x51')],{})['then'](function(_0x4831ed){var _0x4c6646=_0xba9e75[_0x6fcd('0x52')][_0x6fcd('0x2e')]({'plain':!![]});if(!_0x4c6646)throw new Error(_0x6fcd('0x53'));if(_0x4c6646['role']===_0x6fcd('0x52')){var _0x5698ba=_0x4831ed['get']({'plain':!![]});var _0x1d4e08=_0x6fcd('0x2f');return db['UserProfileSection'][_0x6fcd('0x4f')]({'where':{'name':_0x1d4e08,'userProfileId':_0x4c6646['userProfileId']},'raw':!![]})[_0x6fcd('0x2c')](function(_0x141924){if(_0x141924&&_0x141924[_0x6fcd('0x54')]===0x0){return db[_0x6fcd('0x30')][_0x6fcd('0x50')]({'name':_0x5698ba[_0x6fcd('0x32')],'resourceId':_0x5698ba['id'],'type':_0x141924['name'],'sectionId':_0x141924['id']},{})[_0x6fcd('0x2c')](function(){return _0x4831ed;});}else{return _0x4831ed;}})[_0x6fcd('0x4c')](function(_0x4c4bf3){logger['error'](_0x6fcd('0x55'),_0x4c4bf3);throw _0x4c4bf3;});}return _0x4831ed;})['then'](respondWithResult(_0x68822d,0xc9))['catch'](handleError(_0x68822d,null));};exports['update']=function(_0x5d12d5,_0x555be6){if(_0x5d12d5[_0x6fcd('0x51')]['id']){delete _0x5d12d5[_0x6fcd('0x51')]['id'];}return db[_0x6fcd('0x35')][_0x6fcd('0x4f')]({'where':{'id':_0x5d12d5[_0x6fcd('0x56')]['id']}})[_0x6fcd('0x2c')](handleEntityNotFound(_0x555be6,null))[_0x6fcd('0x2c')](saveUpdates(_0x5d12d5['body'],null))[_0x6fcd('0x2c')](respondWithResult(_0x555be6,null))[_0x6fcd('0x4c')](handleError(_0x555be6,null));};exports['destroy']=function(_0x2161f9,_0x2a36ee){return db[_0x6fcd('0x35')][_0x6fcd('0x4f')]({'where':{'id':_0x2161f9['params']['id']}})[_0x6fcd('0x2c')](handleEntityNotFound(_0x2a36ee,null))[_0x6fcd('0x2c')](removeEntity(_0x2a36ee,null))[_0x6fcd('0x4c')](handleError(_0x2a36ee,null));};exports[_0x6fcd('0x57')]=function(_0x44c466,_0x48f9bf){return db[_0x6fcd('0x35')][_0x6fcd('0x57')]()['then'](respondWithResult(_0x48f9bf,null))['catch'](handleError(_0x48f9bf,null));};exports['getMembers']=function(_0x1b17c9,_0x38cf2c,_0x9de6bf){var _0x501358={'raw':!![],'where':{}},_0x3aaf60={},_0x28dfcd;return db[_0x6fcd('0x35')]['findOne']({'where':{'id':_0x1b17c9['params']['id']}})['then'](handleEntityNotFound(_0x38cf2c,null))[_0x6fcd('0x2c')](function(_0x1b59da){if(_0x1b59da){_0x28dfcd=_0x1b59da['get']({'plain':!![]});_0x3aaf60[_0x6fcd('0x38')]=_['keys'](db[_0x6fcd('0x58')]['rawAttributes']);_0x3aaf60[_0x6fcd('0x39')]=_['keys'](_0x1b17c9[_0x6fcd('0x39')]);_0x3aaf60[_0x6fcd('0x42')]=_[_0x6fcd('0x3a')](_0x3aaf60[_0x6fcd('0x38')],_0x3aaf60[_0x6fcd('0x39')]);_0x501358[_0x6fcd('0x3b')]=_['intersection'](_0x3aaf60[_0x6fcd('0x38')],qs[_0x6fcd('0x4e')](_0x1b17c9[_0x6fcd('0x39')][_0x6fcd('0x4e')]));_0x501358['attributes']=_0x501358[_0x6fcd('0x3b')][_0x6fcd('0x3c')]?_0x501358[_0x6fcd('0x3b')]:_0x3aaf60['model'];if(!_0x1b17c9[_0x6fcd('0x39')][_0x6fcd('0x3d')](_0x6fcd('0x3e'))){_0x501358['limit']=qs[_0x6fcd('0x27')](_0x1b17c9[_0x6fcd('0x39')][_0x6fcd('0x27')]);_0x501358[_0x6fcd('0x26')]=qs[_0x6fcd('0x26')](_0x1b17c9[_0x6fcd('0x39')]['offset']);}_0x501358[_0x6fcd('0x3f')]=qs[_0x6fcd('0x40')](_0x1b17c9[_0x6fcd('0x39')][_0x6fcd('0x40')]);_0x501358[_0x6fcd('0x41')]=qs[_0x6fcd('0x42')](_[_0x6fcd('0x43')](_0x1b17c9[_0x6fcd('0x39')],_0x3aaf60[_0x6fcd('0x42')]));_0x501358[_0x6fcd('0x41')][_0x6fcd('0x59')]=_0x1b59da['id'];if(_0x1b17c9['query']['filter']){_0x501358['where']=_[_0x6fcd('0x45')](_0x501358[_0x6fcd('0x41')],{'$or':_[_0x6fcd('0x34')](_0x501358[_0x6fcd('0x3b')],function(_0x399714){var _0x3528b3={};_0x3528b3[_0x399714]={'$like':'%'+_0x1b17c9[_0x6fcd('0x39')][_0x6fcd('0x44')]+'%'};return _0x3528b3;})});}_0x501358=_[_0x6fcd('0x45')]({},_0x501358,_0x1b17c9['options']);return db[_0x6fcd('0x58')][_0x6fcd('0x5a')](_0x501358);}})[_0x6fcd('0x2c')](function(_0x215406){if(_0x215406){return db[_0x6fcd('0x5b')][_0x6fcd('0x5c')]({'where':{'id':_['map'](_0x215406,_0x6fcd('0x5d')),'role':_0x6fcd('0x5e')},'attributes':['id',_0x6fcd('0x32'),_0x6fcd('0x5f'),'updatedAt',_0x6fcd('0x60')]});}})[_0x6fcd('0x2c')](function(_0x15f66e){if(_0x15f66e){return{'count':_0x15f66e['count'],'rows':_[_0x6fcd('0x34')](_0x15f66e['rows'],function(_0x93d2ca){return{'membername':_0x93d2ca[_0x6fcd('0x32')],'UserId':_0x93d2ca['id'],'queue_name':_0x28dfcd[_0x6fcd('0x32')],'FaxQueueId':_0x28dfcd['id'],'interface':util['format'](_0x6fcd('0x61'),'SIP',_0x93d2ca['name']),'penalty':0x0,'paused':_0x93d2ca[_0x6fcd('0x5f')],'createdAt':_0x93d2ca[_0x6fcd('0x60')],'updatedAt':_0x93d2ca[_0x6fcd('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6fcd('0x2c')](respondWithFilteredResult(_0x38cf2c,_0x501358))[_0x6fcd('0x4c')](handleError(_0x38cf2c,null));};exports['getTeams']=function(_0x1260f8,_0x2105a5,_0x39d11f){var _0x4a51be={};var _0x2db1cf={};var _0x15cc99;var _0x432ac3;return db[_0x6fcd('0x35')]['findOne']({'where':{'id':_0x1260f8['params']['id']}})[_0x6fcd('0x2c')](handleEntityNotFound(_0x2105a5,null))[_0x6fcd('0x2c')](function(_0x18881a){if(_0x18881a){_0x15cc99=_0x18881a;_0x2db1cf[_0x6fcd('0x38')]=_[_0x6fcd('0x4d')](db['Team'][_0x6fcd('0x36')]);_0x2db1cf[_0x6fcd('0x39')]=_[_0x6fcd('0x4d')](_0x1260f8[_0x6fcd('0x39')]);_0x2db1cf[_0x6fcd('0x42')]=_[_0x6fcd('0x3a')](_0x2db1cf['model'],_0x2db1cf[_0x6fcd('0x39')]);_0x4a51be['attributes']=_[_0x6fcd('0x3a')](_0x2db1cf['model'],qs[_0x6fcd('0x4e')](_0x1260f8['query']['fields']));_0x4a51be['attributes']=_0x4a51be[_0x6fcd('0x3b')][_0x6fcd('0x3c')]?_0x4a51be[_0x6fcd('0x3b')]:_0x2db1cf[_0x6fcd('0x38')];_0x4a51be[_0x6fcd('0x3f')]=qs[_0x6fcd('0x40')](_0x1260f8[_0x6fcd('0x39')][_0x6fcd('0x40')]);_0x4a51be[_0x6fcd('0x41')]=qs[_0x6fcd('0x42')](_['pick'](_0x1260f8[_0x6fcd('0x39')],_0x2db1cf['filters']));if(_0x1260f8[_0x6fcd('0x39')][_0x6fcd('0x44')]){_0x4a51be['where']=_['merge'](_0x4a51be[_0x6fcd('0x41')],{'$or':_[_0x6fcd('0x34')](_0x4a51be[_0x6fcd('0x3b')],function(_0x4dfb33){var _0x5cc45f={};_0x5cc45f[_0x4dfb33]={'$like':'%'+_0x1260f8['query'][_0x6fcd('0x44')]+'%'};return _0x5cc45f;})});}_0x4a51be=_[_0x6fcd('0x45')]({},_0x4a51be,_0x1260f8['options']);return _0x15cc99['getTeams'](_0x4a51be);}})[_0x6fcd('0x2c')](function(_0x443f59){if(_0x443f59){_0x432ac3=_0x443f59['length'];if(!_0x1260f8[_0x6fcd('0x39')][_0x6fcd('0x3d')](_0x6fcd('0x3e'))){_0x4a51be[_0x6fcd('0x27')]=qs[_0x6fcd('0x27')](_0x1260f8[_0x6fcd('0x39')][_0x6fcd('0x27')]);_0x4a51be[_0x6fcd('0x26')]=qs[_0x6fcd('0x26')](_0x1260f8[_0x6fcd('0x39')][_0x6fcd('0x26')]);}return _0x15cc99[_0x6fcd('0x63')](_0x4a51be);}})[_0x6fcd('0x2c')](function(_0x1c4e3a){if(_0x1c4e3a){return _0x1c4e3a?{'count':_0x432ac3,'rows':_0x1c4e3a}:null;}})[_0x6fcd('0x2c')](respondWithResult(_0x2105a5,null))[_0x6fcd('0x4c')](handleError(_0x2105a5,null));};exports[_0x6fcd('0x64')]=function(_0x40e755,_0x3709ff,_0x320bf8){var _0x541d61=_0x40e755[_0x6fcd('0x51')]['ids'];return db['Team']['findAll']({'where':{'id':_0x541d61},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6fcd('0x65'),'attributes':['id','name',_0x6fcd('0x66'),_0x6fcd('0x67'),_0x6fcd('0x68')],'raw':!![]}]})[_0x6fcd('0x2c')](function(_0x3f7651){if(_0x3f7651){var _0x37769a=_['flatMap'](_0x3f7651,function(_0x65f622){var _0x50be96=_0x65f622[_0x6fcd('0x2e')]({'plain':!![]});return _0x50be96[_0x6fcd('0x65')];});return db['FaxQueue']['find']({'where':{'id':_0x40e755[_0x6fcd('0x56')]['id']}})[_0x6fcd('0x2c')](function(_0x55ea93){return db[_0x6fcd('0x69')][_0x6fcd('0x6a')](function(_0x453c8e){return _0x55ea93['addTeams'](_0x541d61,{'transaction':_0x453c8e})[_0x6fcd('0x2c')](function(){return BPromise[_0x6fcd('0x6b')](_0x37769a,function(_0x262376){return db[_0x6fcd('0x58')][_0x6fcd('0x6c')]({'where':{'UserId':_0x262376['id'],'FaxQueueId':_0x40e755[_0x6fcd('0x56')]['id']},'transaction':_0x453c8e});});})[_0x6fcd('0x2c')](function(){_0x37769a[_0x6fcd('0x6d')](function(_0x410116){socket['emit'](_0x6fcd('0x6e'),{'UserId':_0x410116['id'],'FaxQueueId':_0x55ea93['id']});});});});});}})[_0x6fcd('0x2c')](respondWithStatusCode(_0x3709ff,null))[_0x6fcd('0x4c')](handleError(_0x3709ff,null));};exports[_0x6fcd('0x6f')]=function(_0x417da5,_0x35be5b,_0x1ed499){return db[_0x6fcd('0x70')][_0x6fcd('0x5a')]({'where':{'id':_0x417da5[_0x6fcd('0x39')][_0x6fcd('0x71')]},'attributes':['id'],'include':[{'model':db[_0x6fcd('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6fcd('0x2c')](handleEntityNotFound(_0x35be5b,null))[_0x6fcd('0x2c')](function(_0x12b29b){var _0x3e2b0d=_[_0x6fcd('0x34')](_0x12b29b,'id');var _0x534553=[];var _0x5e7ac6=[];var _0x37bd3d=squel[_0x6fcd('0x72')]();_0x37bd3d['field'](_0x6fcd('0x73'))[_0x6fcd('0x74')](_0x6fcd('0x75'),'tq')['join'](_0x6fcd('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6fcd('0x41')](_0x6fcd('0x77'),_0x417da5[_0x6fcd('0x56')]['id']);for(var _0x30ebfa=0x0;_0x30ebfa<_0x12b29b['length'];_0x30ebfa+=0x1){let _0x197507=_0x12b29b[_0x30ebfa];for(var _0x47413c=0x0;_0x47413c<_0x197507[_0x6fcd('0x65')][_0x6fcd('0x3c')];_0x47413c+=0x1){let _0x536129=_0x197507[_0x6fcd('0x65')][_0x47413c];var _0x4de953=_0x37bd3d[_0x6fcd('0x78')]();_0x4de953[_0x6fcd('0x41')](_0x6fcd('0x79'),_0x536129['id']);_0x5e7ac6['push'](db[_0x6fcd('0x69')][_0x6fcd('0x39')](_0x4de953[_0x6fcd('0x7a')](),{'type':db['sequelize'][_0x6fcd('0x7b')][_0x6fcd('0x7c')]})[_0x6fcd('0x2c')](function(_0x44461e){if(_0x44461e[_0x6fcd('0x3c')]===0x1){return _0x536129['id'];}else{var _0x45358e=_[_0x6fcd('0x7d')](_[_0x6fcd('0x34')](_0x44461e,_0x6fcd('0x7e')),function(_0x55e728){return _[_0x6fcd('0x7f')](_0x3e2b0d,_0x55e728);});if(_0x45358e){return _0x536129['id'];}}}));}}return BPromise['all'](_0x5e7ac6)[_0x6fcd('0x2c')](function(_0x1375a7){_0x534553=_(_0x534553)[_0x6fcd('0x80')](_0x1375a7)[_0x6fcd('0x81')]()['value']();return db[_0x6fcd('0x35')][_0x6fcd('0x4f')]({'where':{'id':_0x417da5[_0x6fcd('0x56')]['id']}})[_0x6fcd('0x2c')](function(_0x1ce295){return db['sequelize'][_0x6fcd('0x6a')](function(_0x4faf37){return _0x1ce295['removeTeams'](_0x417da5[_0x6fcd('0x39')][_0x6fcd('0x71')],{'transaction':_0x4faf37})[_0x6fcd('0x2c')](function(){if(!_['isEmpty'](_0x534553)){return _0x1ce295['removeAgents'](_0x534553,{'transaction':_0x4faf37});}})[_0x6fcd('0x2c')](function(){_0x534553['forEach'](function(_0x5db9c6){socket['emit']('userFaxQueue:remove',{'UserId':_0x5db9c6,'FaxQueueId':_0x1ce295['id']});});});});});});})[_0x6fcd('0x2c')](respondWithStatusCode(_0x35be5b,null))['catch'](handleError(_0x35be5b,null));};exports[_0x6fcd('0x82')]=function(_0x143aad,_0x2d2366,_0x3257c2){return db['FaxQueue'][_0x6fcd('0x4f')]({'where':{'id':_0x143aad[_0x6fcd('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d2366,null))[_0x6fcd('0x2c')](function(_0x58418f){if(_0x58418f){return _0x58418f[_0x6fcd('0x82')](_0x143aad[_0x6fcd('0x51')][_0x6fcd('0x71')],_['omit'](_0x143aad[_0x6fcd('0x51')],[_0x6fcd('0x71'),'id'])||{})[_0x6fcd('0x83')](function(_0x488e31){for(var _0x4d87c2=0x0;_0x4d87c2<_0x143aad['body']['ids'][_0x6fcd('0x3c')];_0x4d87c2+=0x1){socket[_0x6fcd('0x84')]('userFaxQueue:save',{'UserId':Number(_0x143aad[_0x6fcd('0x51')][_0x6fcd('0x71')][_0x4d87c2]),'FaxQueueId':Number(_0x143aad[_0x6fcd('0x56')]['id'])});}return _0x488e31;});}})['then'](respondWithResult(_0x2d2366,null))[_0x6fcd('0x4c')](handleError(_0x2d2366,null));};exports[_0x6fcd('0x85')]=function(_0x1553e2,_0x4e3c67,_0x3fcc94){return db[_0x6fcd('0x35')][_0x6fcd('0x4f')]({'where':{'id':_0x1553e2[_0x6fcd('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e3c67,null))[_0x6fcd('0x2c')](function(_0x54d011){if(_0x54d011){return _0x54d011['removeAgents'](_0x1553e2[_0x6fcd('0x39')][_0x6fcd('0x71')])['then'](function(){if(_[_0x6fcd('0x86')](_0x1553e2['query'][_0x6fcd('0x71')])){for(var _0x64d521=0x0;_0x64d521<_0x1553e2[_0x6fcd('0x39')][_0x6fcd('0x71')]['length'];_0x64d521+=0x1){socket[_0x6fcd('0x84')](_0x6fcd('0x87'),{'UserId':Number(_0x1553e2['query'][_0x6fcd('0x71')][_0x64d521]),'FaxQueueId':Number(_0x1553e2[_0x6fcd('0x56')]['id'])});}}else{socket['emit'](_0x6fcd('0x87'),{'UserId':Number(_0x1553e2[_0x6fcd('0x39')]['ids']),'FaxQueueId':Number(_0x1553e2[_0x6fcd('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e3c67,null))[_0x6fcd('0x4c')](handleError(_0x4e3c67,null));};exports[_0x6fcd('0x88')]=function(_0x10c818,_0x54cdc9,_0x36fe71){var _0x2b5bcd={};var _0x5322a5={};var _0x588bb0;var _0x26e870;return db[_0x6fcd('0x35')]['findOne']({'where':{'id':_0x10c818[_0x6fcd('0x56')]['id']}})[_0x6fcd('0x2c')](handleEntityNotFound(_0x54cdc9,null))[_0x6fcd('0x2c')](function(_0x428f7e){if(_0x428f7e){_0x588bb0=_0x428f7e;_0x5322a5[_0x6fcd('0x38')]=_[_0x6fcd('0x4d')](db[_0x6fcd('0x5b')][_0x6fcd('0x36')]);_0x5322a5[_0x6fcd('0x39')]=_['keys'](_0x10c818[_0x6fcd('0x39')]);_0x5322a5['filters']=_['intersection'](_0x5322a5['model'],_0x5322a5['query']);_0x2b5bcd[_0x6fcd('0x3b')]=_['intersection'](_0x5322a5[_0x6fcd('0x38')],qs['fields'](_0x10c818[_0x6fcd('0x39')][_0x6fcd('0x4e')]));_0x2b5bcd[_0x6fcd('0x3b')]=_0x2b5bcd[_0x6fcd('0x3b')][_0x6fcd('0x3c')]?_0x2b5bcd[_0x6fcd('0x3b')]:_0x5322a5['model'];_0x2b5bcd[_0x6fcd('0x3f')]=qs['sort'](_0x10c818[_0x6fcd('0x39')][_0x6fcd('0x40')]);_0x2b5bcd[_0x6fcd('0x41')]=qs['filters'](_[_0x6fcd('0x43')](_0x10c818[_0x6fcd('0x39')],_0x5322a5[_0x6fcd('0x42')]));if(_0x10c818[_0x6fcd('0x39')]['filter']){_0x2b5bcd[_0x6fcd('0x41')]=_[_0x6fcd('0x45')](_0x2b5bcd[_0x6fcd('0x41')],{'$or':_[_0x6fcd('0x34')](_0x2b5bcd[_0x6fcd('0x3b')],function(_0x55ff19){var _0xf9fa69={};_0xf9fa69[_0x55ff19]={'$like':'%'+_0x10c818[_0x6fcd('0x39')][_0x6fcd('0x44')]+'%'};return _0xf9fa69;})});}_0x2b5bcd=_[_0x6fcd('0x45')]({},_0x2b5bcd,_0x10c818[_0x6fcd('0x48')]);return _0x588bb0[_0x6fcd('0x88')](_0x2b5bcd);}})[_0x6fcd('0x2c')](function(_0x117136){if(_0x117136){_0x26e870=_0x117136[_0x6fcd('0x3c')];if(!_0x10c818[_0x6fcd('0x39')][_0x6fcd('0x3d')]('nolimit')){_0x2b5bcd[_0x6fcd('0x27')]=qs[_0x6fcd('0x27')](_0x10c818[_0x6fcd('0x39')][_0x6fcd('0x27')]);_0x2b5bcd[_0x6fcd('0x26')]=qs['offset'](_0x10c818['query']['offset']);}return _0x588bb0[_0x6fcd('0x88')](_0x2b5bcd);}})[_0x6fcd('0x2c')](function(_0x16f583){if(_0x16f583){return _0x16f583?{'count':_0x26e870,'rows':_0x16f583}:null;}})[_0x6fcd('0x2c')](respondWithResult(_0x54cdc9,null))['catch'](handleError(_0x54cdc9,null));};
\ No newline at end of file
+var _0xc5ec=['localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','count','set','apply','reject','save','update','then','destroy','get','error','stack','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','filter','merge','includeAll','include','findAll','show','params','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','order','FaxQueueId','options','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userFaxQueue:save','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis'];(function(_0x24a0b4,_0x3fe369){var _0xcf1442=function(_0x1a146d){while(--_0x1a146d){_0x24a0b4['push'](_0x24a0b4['shift']());}};_0xcf1442(++_0x3fe369);}(_0xc5ec,0x70));var _0xcc5e=function(_0x237d49,_0xbf5e4b){_0x237d49=_0x237d49-0x0;var _0x2a98e7=_0xc5ec[_0x237d49];return _0x2a98e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc5e('0x0'));var jsonpatch=require(_0xcc5e('0x1'));var rp=require('request-promise');var moment=require(_0xcc5e('0x2'));var BPromise=require(_0xcc5e('0x3'));var Mustache=require(_0xcc5e('0x4'));var util=require(_0xcc5e('0x5'));var path=require(_0xcc5e('0x6'));var sox=require(_0xcc5e('0x7'));var csv=require(_0xcc5e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc5e('0x9'));var _=require('lodash');var squel=require(_0xcc5e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcc5e('0xb'));var Papa=require(_0xcc5e('0xc'));var Redis=require('ioredis');var authService=require(_0xcc5e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcc5e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc5e('0xf'))(_0xcc5e('0x10'));var utils=require(_0xcc5e('0x11'));var config=require(_0xcc5e('0x12'));var licenseUtil=require(_0xcc5e('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcc5e('0x14')](config[_0xcc5e('0x15')],{'host':_0xcc5e('0x16'),'port':0x18eb});var socket=require(_0xcc5e('0x17'))(new Redis(config[_0xcc5e('0x15')]));require('./faxQueue.socket')[_0xcc5e('0x18')](socket);function respondWithStatusCode(_0x8d5d47,_0x373e2d){_0x373e2d=_0x373e2d||0xcc;return function(_0x4dd0cf){if(_0x4dd0cf){return _0x8d5d47[_0xcc5e('0x19')](_0x373e2d);}return _0x8d5d47[_0xcc5e('0x1a')](_0x373e2d)[_0xcc5e('0x1b')]();};}function respondWithResult(_0x438c99,_0x533dd8){_0x533dd8=_0x533dd8||0xc8;return function(_0x4a11e2){if(_0x4a11e2){return _0x438c99[_0xcc5e('0x1a')](_0x533dd8)['json'](_0x4a11e2);}};}function respondWithFilteredResult(_0x3ecbe7,_0x43a38f){return function(_0x315644){if(_0x315644){var _0x2726cb=typeof _0x43a38f[_0xcc5e('0x1c')]==='undefined'&&typeof _0x43a38f[_0xcc5e('0x1d')]==='undefined';var _0x3732d4=_0x315644[_0xcc5e('0x1e')];var _0x52548b=_0x2726cb?0x0:_0x43a38f[_0xcc5e('0x1c')];var _0x569abc=_0x2726cb?_0x315644['count']:_0x43a38f[_0xcc5e('0x1c')]+_0x43a38f[_0xcc5e('0x1d')];var _0x3b13e7;if(_0x569abc>=_0x3732d4){_0x569abc=_0x3732d4;_0x3b13e7=0xc8;}else{_0x3b13e7=0xce;}_0x3ecbe7['status'](_0x3b13e7);return _0x3ecbe7[_0xcc5e('0x1f')]('Content-Range',_0x52548b+'-'+_0x569abc+'/'+_0x3732d4)['json'](_0x315644);}return null;};}function patchUpdates(_0xc25cb4){return function(_0x3e8265){try{jsonpatch[_0xcc5e('0x20')](_0x3e8265,_0xc25cb4,!![]);}catch(_0x5b9f3a){return BPromise[_0xcc5e('0x21')](_0x5b9f3a);}return _0x3e8265[_0xcc5e('0x22')]();};}function saveUpdates(_0x29517b,_0x4592c1){return function(_0x2bc231){if(_0x2bc231){return _0x2bc231[_0xcc5e('0x23')](_0x29517b)[_0xcc5e('0x24')](function(_0x358d9c){return _0x358d9c;});}return null;};}function removeEntity(_0x2e00da,_0x251664){return function(_0x1642f5){if(_0x1642f5){return _0x1642f5[_0xcc5e('0x25')]()[_0xcc5e('0x24')](function(){var _0xd7ddac=_0x1642f5[_0xcc5e('0x26')]({'plain':!![]});var _0x2c10bf='FaxQueues';return db['UserProfileResource'][_0xcc5e('0x25')]({'where':{'type':_0x2c10bf,'resourceId':_0xd7ddac['id']}})[_0xcc5e('0x24')](function(){return _0x1642f5;});})[_0xcc5e('0x24')](function(){_0x2e00da['status'](0xcc)[_0xcc5e('0x1b')]();});}};}function handleEntityNotFound(_0x81b18a,_0x535f4b){return function(_0x5c2d08){if(!_0x5c2d08){_0x81b18a['sendStatus'](0x194);}return _0x5c2d08;};}function handleError(_0x48160e,_0x1ca95c){_0x1ca95c=_0x1ca95c||0x1f4;return function(_0x2293fe){logger[_0xcc5e('0x27')](_0x2293fe[_0xcc5e('0x28')]);if(_0x2293fe['name']){delete _0x2293fe['name'];}_0x48160e[_0xcc5e('0x1a')](_0x1ca95c)[_0xcc5e('0x29')](_0x2293fe);};}exports[_0xcc5e('0x2a')]=function(_0x4930c8,_0x4dd9c7){var _0x337ff3={},_0x4b705a={},_0x3f9dec={'count':0x0,'rows':[]};var _0x416e82=_['map'](db[_0xcc5e('0x2b')][_0xcc5e('0x2c')],function(_0x4b48c9){return{'name':_0x4b48c9[_0xcc5e('0x2d')],'type':_0x4b48c9[_0xcc5e('0x2e')][_0xcc5e('0x2f')]};});_0x4b705a[_0xcc5e('0x30')]=_['map'](_0x416e82,_0xcc5e('0x31'));_0x4b705a['query']=_[_0xcc5e('0x32')](_0x4930c8[_0xcc5e('0x33')]);_0x4b705a[_0xcc5e('0x34')]=_[_0xcc5e('0x35')](_0x4b705a[_0xcc5e('0x30')],_0x4b705a[_0xcc5e('0x33')]);_0x337ff3[_0xcc5e('0x36')]=_[_0xcc5e('0x35')](_0x4b705a[_0xcc5e('0x30')],qs[_0xcc5e('0x37')](_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x37')]));_0x337ff3[_0xcc5e('0x36')]=_0x337ff3['attributes'][_0xcc5e('0x38')]?_0x337ff3[_0xcc5e('0x36')]:_0x4b705a[_0xcc5e('0x30')];if(!_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x39')](_0xcc5e('0x3a'))){_0x337ff3['limit']=qs['limit'](_0x4930c8['query'][_0xcc5e('0x1d')]);_0x337ff3['offset']=qs[_0xcc5e('0x1c')](_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x1c')]);}_0x337ff3['order']=qs[_0xcc5e('0x3b')](_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x3b')]);_0x337ff3[_0xcc5e('0x3c')]=qs['filters'](_[_0xcc5e('0x3d')](_0x4930c8['query'],_0x4b705a[_0xcc5e('0x34')]),_0x416e82);if(_0x4930c8['query']['filter']){_0x337ff3[_0xcc5e('0x3c')]=_['merge'](_0x337ff3['where'],{'$or':_[_0xcc5e('0x3e')](_0x416e82,function(_0x518320){if(_0x518320['type']!=='VIRTUAL'){var _0x3218e2={};_0x3218e2[_0x518320[_0xcc5e('0x31')]]={'$like':'%'+_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x3f')]+'%'};return _0x3218e2;}})});}_0x337ff3=_[_0xcc5e('0x40')]({},_0x337ff3,_0x4930c8['options']);var _0x31f56d={'where':_0x337ff3[_0xcc5e('0x3c')]};return db[_0xcc5e('0x2b')][_0xcc5e('0x1e')](_0x31f56d)[_0xcc5e('0x24')](function(_0xbcc71){_0x3f9dec[_0xcc5e('0x1e')]=_0xbcc71;if(_0x4930c8[_0xcc5e('0x33')][_0xcc5e('0x41')]){_0x337ff3[_0xcc5e('0x42')]=[{'all':!![]}];}return db['FaxQueue'][_0xcc5e('0x43')](_0x337ff3);})[_0xcc5e('0x24')](function(_0x4fbd2d){_0x3f9dec['rows']=_0x4fbd2d;return _0x3f9dec;})[_0xcc5e('0x24')](respondWithFilteredResult(_0x4dd9c7,_0x337ff3))['catch'](handleError(_0x4dd9c7,null));};exports[_0xcc5e('0x44')]=function(_0x1220a1,_0x43f645){var _0x3c78a1={'raw':!![],'where':{'id':_0x1220a1[_0xcc5e('0x45')]['id']}},_0x1d5b67={};_0x1d5b67[_0xcc5e('0x30')]=_[_0xcc5e('0x32')](db[_0xcc5e('0x2b')]['rawAttributes']);_0x1d5b67['query']=_[_0xcc5e('0x32')](_0x1220a1[_0xcc5e('0x33')]);_0x1d5b67[_0xcc5e('0x34')]=_[_0xcc5e('0x35')](_0x1d5b67[_0xcc5e('0x30')],_0x1d5b67['query']);_0x3c78a1[_0xcc5e('0x36')]=_[_0xcc5e('0x35')](_0x1d5b67[_0xcc5e('0x30')],qs[_0xcc5e('0x37')](_0x1220a1[_0xcc5e('0x33')][_0xcc5e('0x37')]));_0x3c78a1[_0xcc5e('0x36')]=_0x3c78a1[_0xcc5e('0x36')][_0xcc5e('0x38')]?_0x3c78a1[_0xcc5e('0x36')]:_0x1d5b67[_0xcc5e('0x30')];if(_0x1220a1[_0xcc5e('0x33')][_0xcc5e('0x41')]){_0x3c78a1[_0xcc5e('0x42')]=[{'all':!![]}];}_0x3c78a1=_[_0xcc5e('0x40')]({},_0x3c78a1,_0x1220a1['options']);return db[_0xcc5e('0x2b')]['find'](_0x3c78a1)['then'](handleEntityNotFound(_0x43f645,null))[_0xcc5e('0x24')](respondWithResult(_0x43f645,null))[_0xcc5e('0x46')](handleError(_0x43f645,null));};exports['create']=function(_0xcfe433,_0x165e8a){return db[_0xcc5e('0x2b')]['create'](_0xcfe433[_0xcc5e('0x47')],{})[_0xcc5e('0x24')](function(_0x37461c){var _0x15042e=_0xcfe433[_0xcc5e('0x48')]['get']({'plain':!![]});if(!_0x15042e)throw new Error(_0xcc5e('0x49'));if(_0x15042e['role']===_0xcc5e('0x48')){var _0x442013=_0x37461c[_0xcc5e('0x26')]({'plain':!![]});var _0x125962='FaxQueues';return db[_0xcc5e('0x4a')]['find']({'where':{'name':_0x125962,'userProfileId':_0x15042e[_0xcc5e('0x4b')]},'raw':!![]})[_0xcc5e('0x24')](function(_0x30cd6b){if(_0x30cd6b&&_0x30cd6b[_0xcc5e('0x4c')]===0x0){return db[_0xcc5e('0x4d')]['create']({'name':_0x442013[_0xcc5e('0x31')],'resourceId':_0x442013['id'],'type':_0x30cd6b[_0xcc5e('0x31')],'sectionId':_0x30cd6b['id']},{})['then'](function(){return _0x37461c;});}else{return _0x37461c;}})[_0xcc5e('0x46')](function(_0x3c47d4){logger[_0xcc5e('0x27')](_0xcc5e('0x4e'),_0x3c47d4);throw _0x3c47d4;});}return _0x37461c;})[_0xcc5e('0x24')](respondWithResult(_0x165e8a,0xc9))[_0xcc5e('0x46')](handleError(_0x165e8a,null));};exports[_0xcc5e('0x23')]=function(_0x17af33,_0x3089f7){if(_0x17af33[_0xcc5e('0x47')]['id']){delete _0x17af33[_0xcc5e('0x47')]['id'];}return db[_0xcc5e('0x2b')][_0xcc5e('0x4f')]({'where':{'id':_0x17af33['params']['id']}})[_0xcc5e('0x24')](handleEntityNotFound(_0x3089f7,null))[_0xcc5e('0x24')](saveUpdates(_0x17af33[_0xcc5e('0x47')],null))['then'](respondWithResult(_0x3089f7,null))[_0xcc5e('0x46')](handleError(_0x3089f7,null));};exports['destroy']=function(_0x1b8ebd,_0x21afa2){return db['FaxQueue'][_0xcc5e('0x4f')]({'where':{'id':_0x1b8ebd[_0xcc5e('0x45')]['id']}})[_0xcc5e('0x24')](handleEntityNotFound(_0x21afa2,null))['then'](removeEntity(_0x21afa2,null))[_0xcc5e('0x46')](handleError(_0x21afa2,null));};exports['describe']=function(_0x4be687,_0x53bad2){return db['FaxQueue'][_0xcc5e('0x50')]()[_0xcc5e('0x24')](respondWithResult(_0x53bad2,null))[_0xcc5e('0x46')](handleError(_0x53bad2,null));};exports[_0xcc5e('0x51')]=function(_0x2b9a57,_0xad6f12,_0x54e91f){var _0x3b2c2b={'raw':!![],'where':{}},_0x1c321d={},_0x39574d;return db[_0xcc5e('0x2b')][_0xcc5e('0x52')]({'where':{'id':_0x2b9a57[_0xcc5e('0x45')]['id']}})[_0xcc5e('0x24')](handleEntityNotFound(_0xad6f12,null))[_0xcc5e('0x24')](function(_0x2a1311){if(_0x2a1311){_0x39574d=_0x2a1311[_0xcc5e('0x26')]({'plain':!![]});_0x1c321d[_0xcc5e('0x30')]=_[_0xcc5e('0x32')](db['UserFaxQueue']['rawAttributes']);_0x1c321d['query']=_['keys'](_0x2b9a57['query']);_0x1c321d[_0xcc5e('0x34')]=_[_0xcc5e('0x35')](_0x1c321d[_0xcc5e('0x30')],_0x1c321d[_0xcc5e('0x33')]);_0x3b2c2b[_0xcc5e('0x36')]=_[_0xcc5e('0x35')](_0x1c321d[_0xcc5e('0x30')],qs[_0xcc5e('0x37')](_0x2b9a57[_0xcc5e('0x33')]['fields']));_0x3b2c2b[_0xcc5e('0x36')]=_0x3b2c2b[_0xcc5e('0x36')][_0xcc5e('0x38')]?_0x3b2c2b['attributes']:_0x1c321d[_0xcc5e('0x30')];if(!_0x2b9a57[_0xcc5e('0x33')]['hasOwnProperty'](_0xcc5e('0x3a'))){_0x3b2c2b[_0xcc5e('0x1d')]=qs[_0xcc5e('0x1d')](_0x2b9a57[_0xcc5e('0x33')][_0xcc5e('0x1d')]);_0x3b2c2b[_0xcc5e('0x1c')]=qs[_0xcc5e('0x1c')](_0x2b9a57[_0xcc5e('0x33')][_0xcc5e('0x1c')]);}_0x3b2c2b[_0xcc5e('0x53')]=qs[_0xcc5e('0x3b')](_0x2b9a57[_0xcc5e('0x33')][_0xcc5e('0x3b')]);_0x3b2c2b[_0xcc5e('0x3c')]=qs[_0xcc5e('0x34')](_[_0xcc5e('0x3d')](_0x2b9a57['query'],_0x1c321d['filters']));_0x3b2c2b[_0xcc5e('0x3c')][_0xcc5e('0x54')]=_0x2a1311['id'];if(_0x2b9a57[_0xcc5e('0x33')]['filter']){_0x3b2c2b['where']=_['merge'](_0x3b2c2b[_0xcc5e('0x3c')],{'$or':_[_0xcc5e('0x3e')](_0x3b2c2b[_0xcc5e('0x36')],function(_0x568dd7){var _0x3a7715={};_0x3a7715[_0x568dd7]={'$like':'%'+_0x2b9a57['query'][_0xcc5e('0x3f')]+'%'};return _0x3a7715;})});}_0x3b2c2b=_[_0xcc5e('0x40')]({},_0x3b2c2b,_0x2b9a57[_0xcc5e('0x55')]);return db[_0xcc5e('0x56')][_0xcc5e('0x43')](_0x3b2c2b);}})[_0xcc5e('0x24')](function(_0x1815d6){if(_0x1815d6){return db[_0xcc5e('0x57')]['findAndCountAll']({'where':{'id':_[_0xcc5e('0x3e')](_0x1815d6,_0xcc5e('0x58')),'role':_0xcc5e('0x59')},'attributes':['id',_0xcc5e('0x31'),_0xcc5e('0x5a'),_0xcc5e('0x5b'),_0xcc5e('0x5c')]});}})[_0xcc5e('0x24')](function(_0x40e5e0){if(_0x40e5e0){return{'count':_0x40e5e0['count'],'rows':_[_0xcc5e('0x3e')](_0x40e5e0[_0xcc5e('0x5d')],function(_0x10d750){return{'membername':_0x10d750['name'],'UserId':_0x10d750['id'],'queue_name':_0x39574d[_0xcc5e('0x31')],'FaxQueueId':_0x39574d['id'],'interface':util[_0xcc5e('0x5e')](_0xcc5e('0x5f'),_0xcc5e('0x60'),_0x10d750['name']),'penalty':0x0,'paused':_0x10d750['faxPause'],'createdAt':_0x10d750[_0xcc5e('0x5c')],'updatedAt':_0x10d750[_0xcc5e('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcc5e('0x24')](respondWithFilteredResult(_0xad6f12,_0x3b2c2b))['catch'](handleError(_0xad6f12,null));};exports[_0xcc5e('0x61')]=function(_0x1e1823,_0x45bd29,_0x7366b1){var _0x1b018b={};var _0x1b49ad={};var _0x1ac0f5;var _0x550085;return db['FaxQueue'][_0xcc5e('0x52')]({'where':{'id':_0x1e1823['params']['id']}})['then'](handleEntityNotFound(_0x45bd29,null))[_0xcc5e('0x24')](function(_0x1aec7a){if(_0x1aec7a){_0x1ac0f5=_0x1aec7a;_0x1b49ad['model']=_[_0xcc5e('0x32')](db[_0xcc5e('0x62')]['rawAttributes']);_0x1b49ad['query']=_[_0xcc5e('0x32')](_0x1e1823['query']);_0x1b49ad['filters']=_[_0xcc5e('0x35')](_0x1b49ad[_0xcc5e('0x30')],_0x1b49ad[_0xcc5e('0x33')]);_0x1b018b[_0xcc5e('0x36')]=_['intersection'](_0x1b49ad[_0xcc5e('0x30')],qs['fields'](_0x1e1823[_0xcc5e('0x33')][_0xcc5e('0x37')]));_0x1b018b['attributes']=_0x1b018b[_0xcc5e('0x36')]['length']?_0x1b018b[_0xcc5e('0x36')]:_0x1b49ad[_0xcc5e('0x30')];_0x1b018b['order']=qs[_0xcc5e('0x3b')](_0x1e1823[_0xcc5e('0x33')]['sort']);_0x1b018b['where']=qs[_0xcc5e('0x34')](_[_0xcc5e('0x3d')](_0x1e1823[_0xcc5e('0x33')],_0x1b49ad['filters']));if(_0x1e1823['query'][_0xcc5e('0x3f')]){_0x1b018b['where']=_[_0xcc5e('0x40')](_0x1b018b[_0xcc5e('0x3c')],{'$or':_[_0xcc5e('0x3e')](_0x1b018b[_0xcc5e('0x36')],function(_0x982df7){var _0xaa9161={};_0xaa9161[_0x982df7]={'$like':'%'+_0x1e1823[_0xcc5e('0x33')]['filter']+'%'};return _0xaa9161;})});}_0x1b018b=_[_0xcc5e('0x40')]({},_0x1b018b,_0x1e1823[_0xcc5e('0x55')]);return _0x1ac0f5[_0xcc5e('0x61')](_0x1b018b);}})[_0xcc5e('0x24')](function(_0x3f5c22){if(_0x3f5c22){_0x550085=_0x3f5c22[_0xcc5e('0x38')];if(!_0x1e1823[_0xcc5e('0x33')][_0xcc5e('0x39')]('nolimit')){_0x1b018b[_0xcc5e('0x1d')]=qs[_0xcc5e('0x1d')](_0x1e1823['query']['limit']);_0x1b018b[_0xcc5e('0x1c')]=qs[_0xcc5e('0x1c')](_0x1e1823[_0xcc5e('0x33')][_0xcc5e('0x1c')]);}return _0x1ac0f5[_0xcc5e('0x61')](_0x1b018b);}})[_0xcc5e('0x24')](function(_0x58b48a){if(_0x58b48a){return _0x58b48a?{'count':_0x550085,'rows':_0x58b48a}:null;}})[_0xcc5e('0x24')](respondWithResult(_0x45bd29,null))['catch'](handleError(_0x45bd29,null));};exports['addTeams']=function(_0x356a6d,_0x4759fe,_0x3c23d9){var _0x15e489=_0x356a6d['body'][_0xcc5e('0x63')];return db[_0xcc5e('0x62')][_0xcc5e('0x43')]({'where':{'id':_0x15e489},'attributes':['id'],'include':[{'model':db[_0xcc5e('0x57')],'as':_0xcc5e('0x64'),'attributes':['id',_0xcc5e('0x31'),'online',_0xcc5e('0x65'),_0xcc5e('0x66')],'raw':!![]}]})[_0xcc5e('0x24')](function(_0x425e20){if(_0x425e20){var _0x169960=_[_0xcc5e('0x67')](_0x425e20,function(_0x5651c3){var _0x539e1c=_0x5651c3['get']({'plain':!![]});return _0x539e1c['Agents'];});return db[_0xcc5e('0x2b')][_0xcc5e('0x4f')]({'where':{'id':_0x356a6d[_0xcc5e('0x45')]['id']}})['then'](function(_0x8a25af){return db[_0xcc5e('0x68')][_0xcc5e('0x69')](function(_0x3e7828){return _0x8a25af[_0xcc5e('0x6a')](_0x15e489,{'transaction':_0x3e7828})[_0xcc5e('0x24')](function(){return BPromise[_0xcc5e('0x6b')](_0x169960,function(_0x19f41a){return db[_0xcc5e('0x56')]['findOrCreate']({'where':{'UserId':_0x19f41a['id'],'FaxQueueId':_0x356a6d['params']['id']},'transaction':_0x3e7828});});})[_0xcc5e('0x24')](function(){_0x169960[_0xcc5e('0x6c')](function(_0x690fcc){socket[_0xcc5e('0x6d')](_0xcc5e('0x6e'),{'UserId':_0x690fcc['id'],'FaxQueueId':_0x8a25af['id']});});});});});}})[_0xcc5e('0x24')](respondWithStatusCode(_0x4759fe,null))[_0xcc5e('0x46')](handleError(_0x4759fe,null));};exports['removeTeams']=function(_0x46bed0,_0x242dbd,_0xcf50ba){return db[_0xcc5e('0x62')]['findAll']({'where':{'id':_0x46bed0[_0xcc5e('0x33')][_0xcc5e('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcc5e('0x64'),'attributes':['id'],'raw':!![]}]})[_0xcc5e('0x24')](handleEntityNotFound(_0x242dbd,null))[_0xcc5e('0x24')](function(_0x318102){var _0x428e3c=_[_0xcc5e('0x3e')](_0x318102,'id');var _0x50b154=[];var _0x238af0=[];var _0x2032dc=squel['select']();_0x2032dc[_0xcc5e('0x6f')](_0xcc5e('0x70'))[_0xcc5e('0x71')]('team_has_fax_queues','tq')[_0xcc5e('0x72')](_0xcc5e('0x73'),'ut',_0xcc5e('0x74'))[_0xcc5e('0x3c')](_0xcc5e('0x75'),_0x46bed0[_0xcc5e('0x45')]['id']);for(var _0x2b0605=0x0;_0x2b0605<_0x318102[_0xcc5e('0x38')];_0x2b0605+=0x1){let _0x242d6e=_0x318102[_0x2b0605];for(var _0x4e1e48=0x0;_0x4e1e48<_0x242d6e[_0xcc5e('0x64')][_0xcc5e('0x38')];_0x4e1e48+=0x1){let _0x3944b0=_0x242d6e[_0xcc5e('0x64')][_0x4e1e48];var _0x21c117=_0x2032dc['clone']();_0x21c117['where'](_0xcc5e('0x76'),_0x3944b0['id']);_0x238af0['push'](db['sequelize']['query'](_0x21c117[_0xcc5e('0x77')](),{'type':db[_0xcc5e('0x68')][_0xcc5e('0x78')]['SELECT']})[_0xcc5e('0x24')](function(_0x2cac1f){if(_0x2cac1f['length']===0x1){return _0x3944b0['id'];}else{var _0x34c0f0=_[_0xcc5e('0x79')](_[_0xcc5e('0x3e')](_0x2cac1f,'TeamId'),function(_0x4748de){return _[_0xcc5e('0x7a')](_0x428e3c,_0x4748de);});if(_0x34c0f0){return _0x3944b0['id'];}}}));}}return BPromise[_0xcc5e('0x7b')](_0x238af0)[_0xcc5e('0x24')](function(_0x3f4c7d){_0x50b154=_(_0x50b154)[_0xcc5e('0x7c')](_0x3f4c7d)[_0xcc5e('0x7d')]()['value']();return db[_0xcc5e('0x2b')][_0xcc5e('0x4f')]({'where':{'id':_0x46bed0[_0xcc5e('0x45')]['id']}})[_0xcc5e('0x24')](function(_0x2b47a5){return db[_0xcc5e('0x68')][_0xcc5e('0x69')](function(_0x13642b){return _0x2b47a5['removeTeams'](_0x46bed0[_0xcc5e('0x33')]['ids'],{'transaction':_0x13642b})['then'](function(){if(!_[_0xcc5e('0x7e')](_0x50b154)){return _0x2b47a5[_0xcc5e('0x7f')](_0x50b154,{'transaction':_0x13642b});}})[_0xcc5e('0x24')](function(){_0x50b154[_0xcc5e('0x6c')](function(_0x1c759f){socket[_0xcc5e('0x6d')](_0xcc5e('0x80'),{'UserId':_0x1c759f,'FaxQueueId':_0x2b47a5['id']});});});});});});})[_0xcc5e('0x24')](respondWithStatusCode(_0x242dbd,null))[_0xcc5e('0x46')](handleError(_0x242dbd,null));};exports[_0xcc5e('0x81')]=function(_0x43bcb8,_0x49c06e,_0x40d266){return db[_0xcc5e('0x2b')]['find']({'where':{'id':_0x43bcb8['params']['id']}})[_0xcc5e('0x24')](handleEntityNotFound(_0x49c06e,null))[_0xcc5e('0x24')](function(_0x1d6c3b){if(_0x1d6c3b){return _0x1d6c3b[_0xcc5e('0x81')](_0x43bcb8[_0xcc5e('0x47')][_0xcc5e('0x63')],_[_0xcc5e('0x82')](_0x43bcb8[_0xcc5e('0x47')],[_0xcc5e('0x63'),'id'])||{})[_0xcc5e('0x83')](function(_0x5b4701){for(var _0x52337d=0x0;_0x52337d<_0x43bcb8[_0xcc5e('0x47')][_0xcc5e('0x63')][_0xcc5e('0x38')];_0x52337d+=0x1){socket[_0xcc5e('0x6d')]('userFaxQueue:save',{'UserId':Number(_0x43bcb8[_0xcc5e('0x47')][_0xcc5e('0x63')][_0x52337d]),'FaxQueueId':Number(_0x43bcb8['params']['id'])});}return _0x5b4701;});}})[_0xcc5e('0x24')](respondWithResult(_0x49c06e,null))[_0xcc5e('0x46')](handleError(_0x49c06e,null));};exports[_0xcc5e('0x7f')]=function(_0x52fda2,_0x12eaf1,_0x453c3e){return db[_0xcc5e('0x2b')][_0xcc5e('0x4f')]({'where':{'id':_0x52fda2['params']['id']}})['then'](handleEntityNotFound(_0x12eaf1,null))[_0xcc5e('0x24')](function(_0x1d00a4){if(_0x1d00a4){return _0x1d00a4[_0xcc5e('0x7f')](_0x52fda2[_0xcc5e('0x33')][_0xcc5e('0x63')])['then'](function(){if(_[_0xcc5e('0x84')](_0x52fda2['query'][_0xcc5e('0x63')])){for(var _0x36014f=0x0;_0x36014f<_0x52fda2['query'][_0xcc5e('0x63')]['length'];_0x36014f+=0x1){socket[_0xcc5e('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x52fda2[_0xcc5e('0x33')]['ids'][_0x36014f]),'FaxQueueId':Number(_0x52fda2['params']['id'])});}}else{socket['emit'](_0xcc5e('0x80'),{'UserId':Number(_0x52fda2['query']['ids']),'FaxQueueId':Number(_0x52fda2[_0xcc5e('0x45')]['id'])});}});}})[_0xcc5e('0x24')](respondWithStatusCode(_0x12eaf1,null))[_0xcc5e('0x46')](handleError(_0x12eaf1,null));};exports[_0xcc5e('0x85')]=function(_0x2c87c4,_0x318e40,_0x1f0827){var _0xa3e8db={};var _0xa37f44={};var _0x2e1928;var _0x59c8b6;return db['FaxQueue'][_0xcc5e('0x52')]({'where':{'id':_0x2c87c4[_0xcc5e('0x45')]['id']}})['then'](handleEntityNotFound(_0x318e40,null))[_0xcc5e('0x24')](function(_0x5c13df){if(_0x5c13df){_0x2e1928=_0x5c13df;_0xa37f44[_0xcc5e('0x30')]=_[_0xcc5e('0x32')](db['User'][_0xcc5e('0x2c')]);_0xa37f44[_0xcc5e('0x33')]=_[_0xcc5e('0x32')](_0x2c87c4[_0xcc5e('0x33')]);_0xa37f44[_0xcc5e('0x34')]=_[_0xcc5e('0x35')](_0xa37f44[_0xcc5e('0x30')],_0xa37f44[_0xcc5e('0x33')]);_0xa3e8db[_0xcc5e('0x36')]=_['intersection'](_0xa37f44['model'],qs[_0xcc5e('0x37')](_0x2c87c4[_0xcc5e('0x33')]['fields']));_0xa3e8db[_0xcc5e('0x36')]=_0xa3e8db['attributes'][_0xcc5e('0x38')]?_0xa3e8db[_0xcc5e('0x36')]:_0xa37f44[_0xcc5e('0x30')];_0xa3e8db[_0xcc5e('0x53')]=qs[_0xcc5e('0x3b')](_0x2c87c4['query'][_0xcc5e('0x3b')]);_0xa3e8db[_0xcc5e('0x3c')]=qs[_0xcc5e('0x34')](_[_0xcc5e('0x3d')](_0x2c87c4[_0xcc5e('0x33')],_0xa37f44[_0xcc5e('0x34')]));if(_0x2c87c4[_0xcc5e('0x33')][_0xcc5e('0x3f')]){_0xa3e8db[_0xcc5e('0x3c')]=_[_0xcc5e('0x40')](_0xa3e8db[_0xcc5e('0x3c')],{'$or':_['map'](_0xa3e8db['attributes'],function(_0x1952e0){var _0x55a991={};_0x55a991[_0x1952e0]={'$like':'%'+_0x2c87c4[_0xcc5e('0x33')][_0xcc5e('0x3f')]+'%'};return _0x55a991;})});}_0xa3e8db=_[_0xcc5e('0x40')]({},_0xa3e8db,_0x2c87c4['options']);return _0x2e1928[_0xcc5e('0x85')](_0xa3e8db);}})[_0xcc5e('0x24')](function(_0x4d6d87){if(_0x4d6d87){_0x59c8b6=_0x4d6d87[_0xcc5e('0x38')];if(!_0x2c87c4[_0xcc5e('0x33')][_0xcc5e('0x39')](_0xcc5e('0x3a'))){_0xa3e8db[_0xcc5e('0x1d')]=qs[_0xcc5e('0x1d')](_0x2c87c4['query']['limit']);_0xa3e8db[_0xcc5e('0x1c')]=qs['offset'](_0x2c87c4[_0xcc5e('0x33')][_0xcc5e('0x1c')]);}return _0x2e1928[_0xcc5e('0x85')](_0xa3e8db);}})['then'](function(_0x1b2318){if(_0x1b2318){return _0x1b2318?{'count':_0x59c8b6,'rows':_0x1b2318}:null;}})['then'](respondWithResult(_0x318e40,null))[_0xcc5e('0x46')](handleError(_0x318e40,null));};
\ No newline at end of file
index 80b4966..32d63ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cff=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x4cff,0x164));var _0xf4cf=function(_0x2d7923,_0x341993){_0x2d7923=_0x2d7923-0x0;var _0x158aa5=_0x4cff[_0x2d7923];return _0x158aa5;};'use strict';var EventEmitter=require(_0xf4cf('0x0'));var FaxQueue=require(_0xf4cf('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4cf('0x2'),'afterUpdate':_0xf4cf('0x3'),'afterDestroy':_0xf4cf('0x4')};function emitEvent(_0x3c931b){return function(_0x337a55,_0x5418d5,_0xa97345){FaxQueueEvents[_0xf4cf('0x5')](_0x3c931b+':'+_0x337a55['id'],_0x337a55);FaxQueueEvents['emit'](_0x3c931b,_0x337a55);_0xa97345(null);};}for(var e in events){if(events[_0xf4cf('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xf4cf('0x7')]=FaxQueueEvents;
\ No newline at end of file
+var _0xd12d=['events','../../mysqldb','FaxQueue','setMaxListeners','save','remove','hook','exports'];(function(_0x558668,_0x406458){var _0x5bcf60=function(_0x5ded0c){while(--_0x5ded0c){_0x558668['push'](_0x558668['shift']());}};_0x5bcf60(++_0x406458);}(_0xd12d,0xd0));var _0xdd12=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xd12d[_0x35885a];return _0xe86249;};'use strict';var EventEmitter=require(_0xdd12('0x0'));var FaxQueue=require(_0xdd12('0x1'))['db'][_0xdd12('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xdd12('0x3')](0x0);var events={'afterCreate':_0xdd12('0x4'),'afterUpdate':'update','afterDestroy':_0xdd12('0x5')};function emitEvent(_0x43cfe0){return function(_0x2e9162,_0x4e4f5b,_0x3f977d){FaxQueueEvents['emit'](_0x43cfe0+':'+_0x2e9162['id'],_0x2e9162);FaxQueueEvents['emit'](_0x43cfe0,_0x2e9162);_0x3f977d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xdd12('0x6')](e,emitEvent(event));}}module[_0xdd12('0x7')]=FaxQueueEvents;
\ No newline at end of file
index 03a4a1f..4a85a1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb1a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash'];(function(_0x4187c0,_0x5f563c){var _0x2f8dc4=function(_0x409dfe){while(--_0x409dfe){_0x4187c0['push'](_0x4187c0['shift']());}};_0x2f8dc4(++_0x5f563c);}(_0xfb1a,0xd7));var _0xafb1=function(_0x3383ca,_0x281206){_0x3383ca=_0x3383ca-0x0;var _0xe02659=_0xfb1a[_0x3383ca];return _0xe02659;};'use strict';var _=require(_0xafb1('0x0'));var util=require(_0xafb1('0x1'));var logger=require(_0xafb1('0x2'))(_0xafb1('0x3'));var moment=require(_0xafb1('0x4'));var BPromise=require(_0xafb1('0x5'));var rp=require(_0xafb1('0x6'));var fs=require('fs');var path=require(_0xafb1('0x7'));var rimraf=require(_0xafb1('0x8'));var config=require(_0xafb1('0x9'));var attributes=require(_0xafb1('0xa'));module['exports']=function(_0x564d5f,_0x51350c){return _0x564d5f['define'](_0xafb1('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5dfb=['moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','FaxQueue','lodash','util','../../config/logger','api'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x5dfb,0xb7));var _0xb5df=function(_0x56e027,_0x496a98){_0x56e027=_0x56e027-0x0;var _0x33ffc4=_0x5dfb[_0x56e027];return _0x33ffc4;};'use strict';var _=require(_0xb5df('0x0'));var util=require(_0xb5df('0x1'));var logger=require(_0xb5df('0x2'))(_0xb5df('0x3'));var moment=require(_0xb5df('0x4'));var BPromise=require(_0xb5df('0x5'));var rp=require(_0xb5df('0x6'));var fs=require('fs');var path=require(_0xb5df('0x7'));var rimraf=require('rimraf');var config=require(_0xb5df('0x8'));var attributes=require(_0xb5df('0x9'));module['exports']=function(_0x5c66a7,_0x3beea6){return _0x5c66a7['define'](_0xb5df('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1e358e7..fd2a62c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x772d=['GetFaxQueue','ShowFaxQueue','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxQueue','findAll','options','include','map','model','attributes'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0x772d,0x1bc));var _0xd772=function(_0x5709ea,_0x5c0089){_0x5709ea=_0x5709ea-0x0;var _0x1998b4=_0x772d[_0x5709ea];return _0x1998b4;};'use strict';var _=require(_0xd772('0x0'));var util=require(_0xd772('0x1'));var moment=require(_0xd772('0x2'));var BPromise=require(_0xd772('0x3'));var rs=require(_0xd772('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd772('0x5'))['db'];var utils=require(_0xd772('0x6'));var logger=require('../../config/logger')(_0xd772('0x7'));var config=require(_0xd772('0x8'));var jayson=require(_0xd772('0x9'));var client=jayson[_0xd772('0xa')][_0xd772('0xb')]({'port':0x232a});config['redis']=_[_0xd772('0xc')](config[_0xd772('0xd')],{'host':_0xd772('0xe'),'port':0x18eb});var socket=require(_0xd772('0xf'))(new Redis(config[_0xd772('0xd')]));require(_0xd772('0x10'))[_0xd772('0x11')](socket);function respondWithRpcPromise(_0xcdc56,_0x15e190,_0xe81449){return new BPromise(function(_0x5ed9d5,_0x271d6b){return client[_0xd772('0x12')](_0xcdc56,_0xe81449)[_0xd772('0x13')](function(_0x4d4f11){logger[_0xd772('0x14')](_0xd772('0x15'),_0x15e190,_0xd772('0x16'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x15e190,_0xd772('0x16'),JSON[_0xd772('0x17')](_0x4d4f11));if(_0x4d4f11['error']){if(_0x4d4f11[_0xd772('0x18')][_0xd772('0x19')]===0x1f4){logger[_0xd772('0x18')](_0xd772('0x15'),_0x15e190,_0x4d4f11['error'][_0xd772('0x1a')]);return _0x271d6b(_0x4d4f11['error'][_0xd772('0x1a')]);}logger[_0xd772('0x18')](_0xd772('0x15'),_0x15e190,_0x4d4f11[_0xd772('0x18')][_0xd772('0x1a')]);return _0x5ed9d5(_0x4d4f11['error'][_0xd772('0x1a')]);}else{logger[_0xd772('0x14')](_0xd772('0x15'),_0x15e190,_0xd772('0x16'));_0x5ed9d5(_0x4d4f11[_0xd772('0x1b')][_0xd772('0x1a')]);}})[_0xd772('0x1c')](function(_0x508212){logger[_0xd772('0x18')](_0xd772('0x15'),_0x15e190,_0x508212);_0x271d6b(_0x508212);});});}exports['GetFaxQueue']=function(_0x460e0d){var _0x3a4d5e=this;return new Promise(function(_0xbe7e94,_0x44b898){return db[_0xd772('0x1d')][_0xd772('0x1e')]({'raw':_0x460e0d['options']?_0x460e0d[_0xd772('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x460e0d[_0xd772('0x1f')]?_0x460e0d['options']['where']||null:null,'attributes':_0x460e0d[_0xd772('0x1f')]?_0x460e0d[_0xd772('0x1f')]['attributes']||null:null,'limit':_0x460e0d[_0xd772('0x1f')]?_0x460e0d[_0xd772('0x1f')]['limit']||null:null,'include':_0x460e0d[_0xd772('0x1f')]?_0x460e0d['options'][_0xd772('0x20')]?_[_0xd772('0x21')](_0x460e0d[_0xd772('0x1f')][_0xd772('0x20')],function(_0x3296ed){return{'model':db[_0x3296ed[_0xd772('0x22')]],'as':_0x3296ed['as'],'attributes':_0x3296ed[_0xd772('0x23')],'include':_0x3296ed[_0xd772('0x20')]?_[_0xd772('0x21')](_0x3296ed[_0xd772('0x20')],function(_0x4a34bc){return{'model':db[_0x4a34bc[_0xd772('0x22')]],'as':_0x4a34bc['as'],'attributes':_0x4a34bc[_0xd772('0x23')],'include':_0x4a34bc[_0xd772('0x20')]?_[_0xd772('0x21')](_0x4a34bc['include'],function(_0xebe862){return{'model':db[_0xebe862[_0xd772('0x22')]],'as':_0xebe862['as'],'attributes':_0xebe862[_0xd772('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd772('0x13')](function(_0x323999){logger[_0xd772('0x14')](_0xd772('0x24'),_0x460e0d);logger['debug']('GetFaxQueue',_0x460e0d,JSON[_0xd772('0x17')](_0x323999));_0xbe7e94(_0x323999);})[_0xd772('0x1c')](function(_0x35727c){logger[_0xd772('0x18')](_0xd772('0x24'),_0x35727c[_0xd772('0x1a')],_0x460e0d);_0x44b898(_0x3a4d5e[_0xd772('0x18')](0x1f4,_0x35727c[_0xd772('0x1a')]));});});};exports[_0xd772('0x25')]=function(_0x2ed786){var _0x32c218=this;return new Promise(function(_0x535ba3,_0x4cabf8){return db[_0xd772('0x1d')]['find']({'raw':_0x2ed786[_0xd772('0x1f')]?_0x2ed786[_0xd772('0x1f')][_0xd772('0x26')]===undefined?!![]:![]:!![],'where':_0x2ed786[_0xd772('0x1f')]?_0x2ed786[_0xd772('0x1f')]['where']||null:null,'attributes':_0x2ed786[_0xd772('0x1f')]?_0x2ed786[_0xd772('0x1f')][_0xd772('0x23')]||null:null,'include':_0x2ed786[_0xd772('0x1f')]?_0x2ed786['options'][_0xd772('0x20')]?_[_0xd772('0x21')](_0x2ed786[_0xd772('0x1f')][_0xd772('0x20')],function(_0x2f2d05){return{'model':db[_0x2f2d05['model']],'as':_0x2f2d05['as'],'attributes':_0x2f2d05[_0xd772('0x23')],'include':_0x2f2d05[_0xd772('0x20')]?_[_0xd772('0x21')](_0x2f2d05[_0xd772('0x20')],function(_0x28e51a){return{'model':db[_0x28e51a[_0xd772('0x22')]],'as':_0x28e51a['as'],'attributes':_0x28e51a[_0xd772('0x23')],'include':_0x28e51a[_0xd772('0x20')]?_[_0xd772('0x21')](_0x28e51a['include'],function(_0x1a7a01){return{'model':db[_0x1a7a01[_0xd772('0x22')]],'as':_0x1a7a01['as'],'attributes':_0x1a7a01[_0xd772('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd772('0x13')](function(_0x2373ec){logger[_0xd772('0x14')](_0xd772('0x25'),_0x2ed786);logger[_0xd772('0x27')](_0xd772('0x25'),_0x2ed786,JSON['stringify'](_0x2373ec));_0x535ba3(_0x2373ec);})['catch'](function(_0x1619cb){logger[_0xd772('0x18')](_0xd772('0x25'),_0x1619cb['message'],_0x2ed786);_0x4cabf8(_0x32c218['error'](0x1f4,_0x1619cb['message']));});});};
\ No newline at end of file
+var _0x331a=['options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFaxQueue','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0xce7e41,_0x471fa1){var _0x1c5793=function(_0x45698c){while(--_0x45698c){_0xce7e41['push'](_0xce7e41['shift']());}};_0x1c5793(++_0x471fa1);}(_0x331a,0x9c));var _0xa331=function(_0x1805ce,_0x565a64){_0x1805ce=_0x1805ce-0x0;var _0x344d75=_0x331a[_0x1805ce];return _0x344d75;};'use strict';var _=require(_0xa331('0x0'));var util=require(_0xa331('0x1'));var moment=require('moment');var BPromise=require(_0xa331('0x2'));var rs=require(_0xa331('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa331('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa331('0x5'));var jayson=require(_0xa331('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xa331('0x7')]=_[_0xa331('0x8')](config[_0xa331('0x7')],{'host':_0xa331('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa331('0x7')]));require(_0xa331('0xa'))[_0xa331('0xb')](socket);function respondWithRpcPromise(_0x59bc32,_0x2b195a,_0x4a397e){return new BPromise(function(_0x150cef,_0x301b32){return client[_0xa331('0xc')](_0x59bc32,_0x4a397e)[_0xa331('0xd')](function(_0x5dc3cd){logger[_0xa331('0xe')](_0xa331('0xf'),_0x2b195a,_0xa331('0x10'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2b195a,_0xa331('0x10'),JSON['stringify'](_0x5dc3cd));if(_0x5dc3cd[_0xa331('0x11')]){if(_0x5dc3cd[_0xa331('0x11')]['code']===0x1f4){logger[_0xa331('0x11')](_0xa331('0xf'),_0x2b195a,_0x5dc3cd[_0xa331('0x11')][_0xa331('0x12')]);return _0x301b32(_0x5dc3cd[_0xa331('0x11')][_0xa331('0x12')]);}logger[_0xa331('0x11')](_0xa331('0xf'),_0x2b195a,_0x5dc3cd[_0xa331('0x11')][_0xa331('0x12')]);return _0x150cef(_0x5dc3cd['error']['message']);}else{logger[_0xa331('0xe')]('FaxQueue,\x20%s,\x20%s',_0x2b195a,'request\x20sent');_0x150cef(_0x5dc3cd[_0xa331('0x13')][_0xa331('0x12')]);}})[_0xa331('0x14')](function(_0xb2e722){logger[_0xa331('0x11')](_0xa331('0xf'),_0x2b195a,_0xb2e722);_0x301b32(_0xb2e722);});});}exports[_0xa331('0x15')]=function(_0x293579){var _0x1a1297=this;return new Promise(function(_0x4a6679,_0x2604ed){return db[_0xa331('0x16')][_0xa331('0x17')]({'raw':_0x293579[_0xa331('0x18')]?_0x293579[_0xa331('0x18')][_0xa331('0x19')]===undefined?!![]:![]:!![],'where':_0x293579[_0xa331('0x18')]?_0x293579[_0xa331('0x18')][_0xa331('0x1a')]||null:null,'attributes':_0x293579['options']?_0x293579[_0xa331('0x18')][_0xa331('0x1b')]||null:null,'limit':_0x293579[_0xa331('0x18')]?_0x293579[_0xa331('0x18')][_0xa331('0x1c')]||null:null,'include':_0x293579[_0xa331('0x18')]?_0x293579['options'][_0xa331('0x1d')]?_[_0xa331('0x1e')](_0x293579[_0xa331('0x18')][_0xa331('0x1d')],function(_0x1b2e91){return{'model':db[_0x1b2e91[_0xa331('0x1f')]],'as':_0x1b2e91['as'],'attributes':_0x1b2e91[_0xa331('0x1b')],'include':_0x1b2e91[_0xa331('0x1d')]?_['map'](_0x1b2e91[_0xa331('0x1d')],function(_0x45efee){return{'model':db[_0x45efee[_0xa331('0x1f')]],'as':_0x45efee['as'],'attributes':_0x45efee[_0xa331('0x1b')],'include':_0x45efee[_0xa331('0x1d')]?_[_0xa331('0x1e')](_0x45efee[_0xa331('0x1d')],function(_0x578464){return{'model':db[_0x578464['model']],'as':_0x578464['as'],'attributes':_0x578464[_0xa331('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa331('0xd')](function(_0x1d6cb8){logger[_0xa331('0xe')]('GetFaxQueue',_0x293579);logger[_0xa331('0x20')](_0xa331('0x15'),_0x293579,JSON[_0xa331('0x21')](_0x1d6cb8));_0x4a6679(_0x1d6cb8);})[_0xa331('0x14')](function(_0x3210d5){logger[_0xa331('0x11')](_0xa331('0x15'),_0x3210d5['message'],_0x293579);_0x2604ed(_0x1a1297['error'](0x1f4,_0x3210d5[_0xa331('0x12')]));});});};exports[_0xa331('0x22')]=function(_0x23534c){var _0x40e8c8=this;return new Promise(function(_0x12362b,_0x21491a){return db[_0xa331('0x16')][_0xa331('0x23')]({'raw':_0x23534c[_0xa331('0x18')]?_0x23534c[_0xa331('0x18')][_0xa331('0x19')]===undefined?!![]:![]:!![],'where':_0x23534c[_0xa331('0x18')]?_0x23534c[_0xa331('0x18')][_0xa331('0x1a')]||null:null,'attributes':_0x23534c[_0xa331('0x18')]?_0x23534c[_0xa331('0x18')][_0xa331('0x1b')]||null:null,'include':_0x23534c[_0xa331('0x18')]?_0x23534c[_0xa331('0x18')][_0xa331('0x1d')]?_[_0xa331('0x1e')](_0x23534c[_0xa331('0x18')]['include'],function(_0x496bd8){return{'model':db[_0x496bd8['model']],'as':_0x496bd8['as'],'attributes':_0x496bd8[_0xa331('0x1b')],'include':_0x496bd8[_0xa331('0x1d')]?_[_0xa331('0x1e')](_0x496bd8[_0xa331('0x1d')],function(_0x49983e){return{'model':db[_0x49983e[_0xa331('0x1f')]],'as':_0x49983e['as'],'attributes':_0x49983e[_0xa331('0x1b')],'include':_0x49983e[_0xa331('0x1d')]?_[_0xa331('0x1e')](_0x49983e[_0xa331('0x1d')],function(_0x356be6){return{'model':db[_0x356be6[_0xa331('0x1f')]],'as':_0x356be6['as'],'attributes':_0x356be6[_0xa331('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa331('0xd')](function(_0x3bb865){logger[_0xa331('0xe')](_0xa331('0x22'),_0x23534c);logger[_0xa331('0x20')](_0xa331('0x22'),_0x23534c,JSON[_0xa331('0x21')](_0x3bb865));_0x12362b(_0x3bb865);})[_0xa331('0x14')](function(_0x5cc484){logger[_0xa331('0x11')]('ShowFaxQueue',_0x5cc484['message'],_0x23534c);_0x21491a(_0x40e8c8[_0xa331('0x11')](0x1f4,_0x5cc484[_0xa331('0x12')]));});});};
\ No newline at end of file
index 81c7d6b..104763a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc42f=['register','length','faxQueue:','save','remove','update','emit'];(function(_0x303353,_0x19a7b1){var _0x17eda9=function(_0xb1b7ab){while(--_0xb1b7ab){_0x303353['push'](_0x303353['shift']());}};_0x17eda9(++_0x19a7b1);}(_0xc42f,0xab));var _0xfc42=function(_0x3ab2a0,_0x1d63ce){_0x3ab2a0=_0x3ab2a0-0x0;var _0x303f0a=_0xc42f[_0x3ab2a0];return _0x303f0a;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xfc42('0x0'),_0xfc42('0x1'),_0xfc42('0x2')];function createListener(_0x1c018e,_0x22bbd5){return function(_0x5b1ab6){_0x22bbd5[_0xfc42('0x3')](_0x1c018e,_0x5b1ab6);};}function removeListener(_0xa6bdaa,_0x14f824){return function(){FaxQueueEvents['removeListener'](_0xa6bdaa,_0x14f824);};}exports[_0xfc42('0x4')]=function(_0x4df648){for(var _0x25c691=0x0,_0xd00931=events[_0xfc42('0x5')];_0x25c691<_0xd00931;_0x25c691++){var _0x4a70ab=events[_0x25c691];var _0x3d084c=createListener(_0xfc42('0x6')+_0x4a70ab,_0x4df648);FaxQueueEvents['on'](_0x4a70ab,_0x3d084c);}};
\ No newline at end of file
+var _0x49d7=['length','faxQueue:','remove','emit','register'];(function(_0x203c4a,_0x370068){var _0x79915c=function(_0x2cf2bb){while(--_0x2cf2bb){_0x203c4a['push'](_0x203c4a['shift']());}};_0x79915c(++_0x370068);}(_0x49d7,0x133));var _0x749d=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x49d7[_0x1969a7];return _0x3d665f;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x749d('0x0'),'update'];function createListener(_0x40c222,_0x1ebdda){return function(_0x401aea){_0x1ebdda[_0x749d('0x1')](_0x40c222,_0x401aea);};}function removeListener(_0x48dcc5,_0x5e06c4){return function(){FaxQueueEvents['removeListener'](_0x48dcc5,_0x5e06c4);};}exports[_0x749d('0x2')]=function(_0x2c5712){for(var _0x23cd30=0x0,_0xafed18=events[_0x749d('0x3')];_0x23cd30<_0xafed18;_0x23cd30++){var _0x1e2a6d=events[_0x23cd30];var _0x2871eb=createListener(_0x749d('0x4')+_0x1e2a6d,_0x2c5712);FaxQueueEvents['on'](_0x1e2a6d,_0x2871eb);}};
\ No newline at end of file
index 45404e8..56f19fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba18=['addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','show','getMembers','/:id/teams','/:id/users','getAgents','post'];(function(_0x54cc60,_0x22f521){var _0x5b341c=function(_0x2b79a9){while(--_0x2b79a9){_0x54cc60['push'](_0x54cc60['shift']());}};_0x5b341c(++_0x22f521);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var path=require(_0x8ba1('0x2'));var timeout=require(_0x8ba1('0x3'));var express=require(_0x8ba1('0x4'));var router=express[_0x8ba1('0x5')]();var fs_extra=require(_0x8ba1('0x6'));var auth=require(_0x8ba1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ba1('0x8'));var controller=require(_0x8ba1('0x9'));router[_0x8ba1('0xa')]('/',auth[_0x8ba1('0xb')](),controller[_0x8ba1('0xc')]);router[_0x8ba1('0xa')]('/describe',auth[_0x8ba1('0xb')](),controller[_0x8ba1('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8ba1('0xe')]);router[_0x8ba1('0xa')]('/:id/members',auth[_0x8ba1('0xb')](),controller[_0x8ba1('0xf')]);router[_0x8ba1('0xa')](_0x8ba1('0x10'),auth[_0x8ba1('0xb')](),controller['getTeams']);router[_0x8ba1('0xa')](_0x8ba1('0x11'),auth[_0x8ba1('0xb')](),controller[_0x8ba1('0x12')]);router[_0x8ba1('0x13')]('/',auth[_0x8ba1('0xb')](),controller['create']);router[_0x8ba1('0x13')](_0x8ba1('0x10'),auth[_0x8ba1('0xb')](),controller[_0x8ba1('0x14')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8ba1('0x15')]);router[_0x8ba1('0x16')](_0x8ba1('0x17'),auth[_0x8ba1('0xb')](),controller[_0x8ba1('0x18')]);router[_0x8ba1('0x19')](_0x8ba1('0x17'),auth[_0x8ba1('0xb')](),controller[_0x8ba1('0x1a')]);router[_0x8ba1('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8ba1('0x1b')]);router[_0x8ba1('0x19')]('/:id/users',auth[_0x8ba1('0xb')](),controller[_0x8ba1('0x1c')]);module[_0x8ba1('0x1d')]=router;
\ No newline at end of file
+var _0xcb22=['/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0xcb22,0xc8));var _0x2cb2=function(_0x5f0b1b,_0x3d63a6){_0x5f0b1b=_0x5f0b1b-0x0;var _0x5932d7=_0xcb22[_0x5f0b1b];return _0x5932d7;};'use strict';var multer=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var path=require(_0x2cb2('0x2'));var timeout=require(_0x2cb2('0x3'));var express=require(_0x2cb2('0x4'));var router=express[_0x2cb2('0x5')]();var fs_extra=require(_0x2cb2('0x6'));var auth=require(_0x2cb2('0x7'));var interaction=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var controller=require(_0x2cb2('0xa'));router['get']('/',auth[_0x2cb2('0xb')](),controller[_0x2cb2('0xc')]);router[_0x2cb2('0xd')](_0x2cb2('0xe'),auth[_0x2cb2('0xb')](),controller['describe']);router[_0x2cb2('0xd')](_0x2cb2('0xf'),auth['isAuthenticated'](),controller[_0x2cb2('0x10')]);router[_0x2cb2('0xd')](_0x2cb2('0x11'),auth[_0x2cb2('0xb')](),controller[_0x2cb2('0x12')]);router[_0x2cb2('0xd')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2cb2('0x13')]);router[_0x2cb2('0xd')]('/:id/users',auth['isAuthenticated'](),controller[_0x2cb2('0x14')]);router['post']('/',auth[_0x2cb2('0xb')](),controller['create']);router[_0x2cb2('0x15')](_0x2cb2('0x16'),auth['isAuthenticated'](),controller[_0x2cb2('0x17')]);router[_0x2cb2('0x15')](_0x2cb2('0x18'),auth['isAuthenticated'](),controller[_0x2cb2('0x19')]);router[_0x2cb2('0x1a')]('/:id',auth[_0x2cb2('0xb')](),controller['update']);router[_0x2cb2('0x1b')](_0x2cb2('0xf'),auth[_0x2cb2('0xb')](),controller[_0x2cb2('0x1c')]);router[_0x2cb2('0x1b')](_0x2cb2('0x16'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x2cb2('0xb')](),controller[_0x2cb2('0x1d')]);module[_0x2cb2('0x1e')]=router;
\ No newline at end of file
index f0e4fd1..69ac657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd866=['DATE','sequelize','STRING'];(function(_0x17cded,_0xa51b6b){var _0x41b11f=function(_0xa647a){while(--_0xa647a){_0x17cded['push'](_0x17cded['shift']());}};_0x41b11f(++_0xa51b6b);}(_0xd866,0x1d2));var _0x6d86=function(_0x59df57,_0x3a95d8){_0x59df57=_0x59df57-0x0;var _0x261675=_0xd866[_0x59df57];return _0x261675;};'use strict';var moment=require('moment');var Sequelize=require(_0x6d86('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x6d86('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6d86('0x2')]},'leaveAt':{'type':Sequelize[_0x6d86('0x2')]},'acceptAt':{'type':Sequelize[_0x6d86('0x2')]},'exitAt':{'type':Sequelize[_0x6d86('0x2')]},'reason':{'type':Sequelize[_0x6d86('0x1')]}};
\ No newline at end of file
+var _0x54d7=['moment','exports','STRING','DATE'];(function(_0x44fed9,_0x50857f){var _0x1941a6=function(_0x5f8ccc){while(--_0x5f8ccc){_0x44fed9['push'](_0x44fed9['shift']());}};_0x1941a6(++_0x50857f);}(_0x54d7,0x1d8));var _0x754d=function(_0x161ad9,_0x114523){_0x161ad9=_0x161ad9-0x0;var _0x4cc055=_0x54d7[_0x161ad9];return _0x4cc055;};'use strict';var moment=require(_0x754d('0x0'));var Sequelize=require('sequelize');module[_0x754d('0x1')]={'uniqueid':{'type':Sequelize[_0x754d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x754d('0x2')]},'joinAt':{'type':Sequelize[_0x754d('0x3')]},'leaveAt':{'type':Sequelize[_0x754d('0x3')]},'acceptAt':{'type':Sequelize[_0x754d('0x3')]},'exitAt':{'type':Sequelize[_0x754d('0x3')]},'reason':{'type':Sequelize[_0x754d('0x2')]}};
\ No newline at end of file
index e4a0d27..595770c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb13=['query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','key','model','keys'];(function(_0x124728,_0x463dca){var _0x8eb20f=function(_0x49d9de){while(--_0x49d9de){_0x124728['push'](_0x124728['shift']());}};_0x8eb20f(++_0x463dca);}(_0xdb13,0x10c));var _0x3db1=function(_0xf7abb2,_0x1ccbec){_0xf7abb2=_0xf7abb2-0x0;var _0x4bcf5c=_0xdb13[_0xf7abb2];return _0x4bcf5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3db1('0x0'));var zipdir=require(_0x3db1('0x1'));var jsonpatch=require(_0x3db1('0x2'));var rp=require(_0x3db1('0x3'));var moment=require(_0x3db1('0x4'));var BPromise=require(_0x3db1('0x5'));var Mustache=require('mustache');var util=require(_0x3db1('0x6'));var path=require(_0x3db1('0x7'));var sox=require(_0x3db1('0x8'));var csv=require(_0x3db1('0x9'));var ejs=require(_0x3db1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3db1('0xb'));var squel=require(_0x3db1('0xc'));var crypto=require(_0x3db1('0xd'));var jsforce=require(_0x3db1('0xe'));var deskjs=require(_0x3db1('0xf'));var toCsv=require(_0x3db1('0x9'));var querystring=require(_0x3db1('0x10'));var Papa=require(_0x3db1('0x11'));var Redis=require(_0x3db1('0x12'));var authService=require(_0x3db1('0x13'));var qs=require(_0x3db1('0x14'));var as=require(_0x3db1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3db1('0x16'))(_0x3db1('0x17'));var utils=require(_0x3db1('0x18'));var config=require(_0x3db1('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d3cd,_0x12a973){_0x12a973=_0x12a973||0xcc;return function(_0x35954c){if(_0x35954c){return _0x13d3cd[_0x3db1('0x1a')](_0x12a973);}return _0x13d3cd[_0x3db1('0x1b')](_0x12a973)['end']();};}function respondWithResult(_0x59667f,_0x528650){_0x528650=_0x528650||0xc8;return function(_0x5f1633){if(_0x5f1633){return _0x59667f[_0x3db1('0x1b')](_0x528650)[_0x3db1('0x1c')](_0x5f1633);}};}function respondWithFilteredResult(_0x10be63,_0x2b4038){return function(_0xe390b3){if(_0xe390b3){var _0x24d8d6=typeof _0x2b4038['offset']===_0x3db1('0x1d')&&typeof _0x2b4038[_0x3db1('0x1e')]==='undefined';var _0x2d76e9=_0xe390b3[_0x3db1('0x1f')];var _0x549a0e=_0x24d8d6?0x0:_0x2b4038[_0x3db1('0x20')];var _0x5f3203=_0x24d8d6?_0xe390b3[_0x3db1('0x1f')]:_0x2b4038[_0x3db1('0x20')]+_0x2b4038[_0x3db1('0x1e')];var _0x435a76;if(_0x5f3203>=_0x2d76e9){_0x5f3203=_0x2d76e9;_0x435a76=0xc8;}else{_0x435a76=0xce;}_0x10be63['status'](_0x435a76);return _0x10be63[_0x3db1('0x21')](_0x3db1('0x22'),_0x549a0e+'-'+_0x5f3203+'/'+_0x2d76e9)[_0x3db1('0x1c')](_0xe390b3);}return null;};}function patchUpdates(_0x5ae404){return function(_0x365d65){try{jsonpatch[_0x3db1('0x23')](_0x365d65,_0x5ae404,!![]);}catch(_0x3eeca8){return BPromise[_0x3db1('0x24')](_0x3eeca8);}return _0x365d65[_0x3db1('0x25')]();};}function saveUpdates(_0x347555,_0x12f970){return function(_0x3a84aa){if(_0x3a84aa){return _0x3a84aa[_0x3db1('0x26')](_0x347555)[_0x3db1('0x27')](function(_0x3ad8f6){return _0x3ad8f6;});}return null;};}function removeEntity(_0x1ae9af,_0x1ee0c6){return function(_0x47c187){if(_0x47c187){return _0x47c187[_0x3db1('0x28')]()['then'](function(){_0x1ae9af[_0x3db1('0x1b')](0xcc)[_0x3db1('0x29')]();});}};}function handleEntityNotFound(_0x2263c6,_0x58b990){return function(_0x218f71){if(!_0x218f71){_0x2263c6[_0x3db1('0x1a')](0x194);}return _0x218f71;};}function handleError(_0x9792ff,_0x8ba38c){_0x8ba38c=_0x8ba38c||0x1f4;return function(_0x5bd826){logger[_0x3db1('0x2a')](_0x5bd826[_0x3db1('0x2b')]);if(_0x5bd826['name']){delete _0x5bd826[_0x3db1('0x2c')];}_0x9792ff[_0x3db1('0x1b')](_0x8ba38c)[_0x3db1('0x2d')](_0x5bd826);};}exports['index']=function(_0x2d139d,_0x226846){var _0x4164eb={},_0x51ec2f={},_0x4d0572={'count':0x0,'rows':[]};var _0xa731b3=_[_0x3db1('0x2e')](db['FaxQueueReport']['rawAttributes'],function(_0x2d8930){return{'name':_0x2d8930[_0x3db1('0x2f')],'type':_0x2d8930[_0x3db1('0x30')][_0x3db1('0x31')]};});_0x51ec2f[_0x3db1('0x32')]=_[_0x3db1('0x2e')](_0xa731b3,_0x3db1('0x2c'));_0x51ec2f['query']=_[_0x3db1('0x33')](_0x2d139d[_0x3db1('0x34')]);_0x51ec2f[_0x3db1('0x35')]=_[_0x3db1('0x36')](_0x51ec2f[_0x3db1('0x32')],_0x51ec2f[_0x3db1('0x34')]);_0x4164eb[_0x3db1('0x37')]=_[_0x3db1('0x36')](_0x51ec2f[_0x3db1('0x32')],qs['fields'](_0x2d139d[_0x3db1('0x34')]['fields']));_0x4164eb['attributes']=_0x4164eb[_0x3db1('0x37')]['length']?_0x4164eb[_0x3db1('0x37')]:_0x51ec2f['model'];if(!_0x2d139d[_0x3db1('0x34')][_0x3db1('0x38')](_0x3db1('0x39'))){_0x4164eb['limit']=qs['limit'](_0x2d139d['query'][_0x3db1('0x1e')]);_0x4164eb[_0x3db1('0x20')]=qs[_0x3db1('0x20')](_0x2d139d[_0x3db1('0x34')]['offset']);}_0x4164eb[_0x3db1('0x3a')]=qs[_0x3db1('0x3b')](_0x2d139d[_0x3db1('0x34')][_0x3db1('0x3b')]);_0x4164eb[_0x3db1('0x3c')]=qs[_0x3db1('0x35')](_[_0x3db1('0x3d')](_0x2d139d['query'],_0x51ec2f['filters']),_0xa731b3);if(_0x2d139d[_0x3db1('0x34')][_0x3db1('0x3e')]){_0x4164eb[_0x3db1('0x3c')]=_[_0x3db1('0x3f')](_0x4164eb[_0x3db1('0x3c')],{'$or':_['map'](_0xa731b3,function(_0x48fb83){if(_0x48fb83[_0x3db1('0x30')]!==_0x3db1('0x40')){var _0x3d0f20={};_0x3d0f20[_0x48fb83[_0x3db1('0x2c')]]={'$like':'%'+_0x2d139d['query'][_0x3db1('0x3e')]+'%'};return _0x3d0f20;}})});}_0x4164eb=_[_0x3db1('0x3f')]({},_0x4164eb,_0x2d139d[_0x3db1('0x41')]);var _0x594910={'where':_0x4164eb['where']};return db[_0x3db1('0x42')][_0x3db1('0x1f')](_0x594910)[_0x3db1('0x27')](function(_0x4da38d){_0x4d0572['count']=_0x4da38d;if(_0x2d139d[_0x3db1('0x34')][_0x3db1('0x43')]){_0x4164eb['include']=[{'all':!![]}];}return db[_0x3db1('0x42')][_0x3db1('0x44')](_0x4164eb);})[_0x3db1('0x27')](function(_0x511527){_0x4d0572[_0x3db1('0x45')]=_0x511527;return _0x4d0572;})['then'](respondWithFilteredResult(_0x226846,_0x4164eb))[_0x3db1('0x46')](handleError(_0x226846,null));};exports[_0x3db1('0x47')]=function(_0x405eba,_0x414269){var _0x1bd8c1={'raw':!![],'where':{'id':_0x405eba[_0x3db1('0x48')]['id']}},_0x432804={};_0x432804[_0x3db1('0x32')]=_[_0x3db1('0x33')](db[_0x3db1('0x42')][_0x3db1('0x49')]);_0x432804[_0x3db1('0x34')]=_[_0x3db1('0x33')](_0x405eba[_0x3db1('0x34')]);_0x432804[_0x3db1('0x35')]=_['intersection'](_0x432804[_0x3db1('0x32')],_0x432804[_0x3db1('0x34')]);_0x1bd8c1[_0x3db1('0x37')]=_[_0x3db1('0x36')](_0x432804['model'],qs['fields'](_0x405eba[_0x3db1('0x34')][_0x3db1('0x4a')]));_0x1bd8c1[_0x3db1('0x37')]=_0x1bd8c1[_0x3db1('0x37')]['length']?_0x1bd8c1[_0x3db1('0x37')]:_0x432804['model'];if(_0x405eba[_0x3db1('0x34')]['includeAll']){_0x1bd8c1[_0x3db1('0x4b')]=[{'all':!![]}];}_0x1bd8c1=_[_0x3db1('0x3f')]({},_0x1bd8c1,_0x405eba['options']);return db[_0x3db1('0x42')][_0x3db1('0x4c')](_0x1bd8c1)[_0x3db1('0x27')](handleEntityNotFound(_0x414269,null))[_0x3db1('0x27')](respondWithResult(_0x414269,null))[_0x3db1('0x46')](handleError(_0x414269,null));};exports[_0x3db1('0x4d')]=function(_0x45682a,_0x2c0946){return db[_0x3db1('0x42')]['create'](_0x45682a[_0x3db1('0x4e')],{})['then'](respondWithResult(_0x2c0946,0xc9))[_0x3db1('0x46')](handleError(_0x2c0946,null));};exports[_0x3db1('0x26')]=function(_0xb34b3e,_0x5c7c6a){if(_0xb34b3e[_0x3db1('0x4e')]['id']){delete _0xb34b3e['body']['id'];}return db[_0x3db1('0x42')][_0x3db1('0x4c')]({'where':{'id':_0xb34b3e[_0x3db1('0x48')]['id']}})[_0x3db1('0x27')](handleEntityNotFound(_0x5c7c6a,null))[_0x3db1('0x27')](saveUpdates(_0xb34b3e[_0x3db1('0x4e')],null))[_0x3db1('0x27')](respondWithResult(_0x5c7c6a,null))['catch'](handleError(_0x5c7c6a,null));};exports[_0x3db1('0x28')]=function(_0x2e60a0,_0x2c7e97){return db[_0x3db1('0x42')]['find']({'where':{'id':_0x2e60a0[_0x3db1('0x48')]['id']}})[_0x3db1('0x27')](handleEntityNotFound(_0x2c7e97,null))['then'](removeEntity(_0x2c7e97,null))[_0x3db1('0x46')](handleError(_0x2c7e97,null));};exports[_0x3db1('0x4f')]=function(_0x3675fa,_0x27cf50){return db[_0x3db1('0x42')][_0x3db1('0x4f')]()[_0x3db1('0x27')](respondWithResult(_0x27cf50,null))[_0x3db1('0x46')](handleError(_0x27cf50,null));};
\ No newline at end of file
+var _0xd73a=['show','keys','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','send','map','rawAttributes','fieldName','key','model','name','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','FaxQueueReport','include','rows','catch'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd73a,0x171));var _0xad73=function(_0x3373d9,_0x48b4ca){_0x3373d9=_0x3373d9-0x0;var _0x2711b4=_0xd73a[_0x3373d9];return _0x2711b4;};'use strict';var emlformat=require(_0xad73('0x0'));var rimraf=require(_0xad73('0x1'));var zipdir=require(_0xad73('0x2'));var jsonpatch=require(_0xad73('0x3'));var rp=require(_0xad73('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad73('0x5'));var util=require(_0xad73('0x6'));var path=require(_0xad73('0x7'));var sox=require(_0xad73('0x8'));var csv=require(_0xad73('0x9'));var ejs=require(_0xad73('0xa'));var fs=require('fs');var fs_extra=require(_0xad73('0xb'));var _=require(_0xad73('0xc'));var squel=require(_0xad73('0xd'));var crypto=require(_0xad73('0xe'));var jsforce=require(_0xad73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xad73('0x9'));var querystring=require('querystring');var Papa=require(_0xad73('0x10'));var Redis=require(_0xad73('0x11'));var authService=require(_0xad73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xad73('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad73('0x14'))('api');var utils=require(_0xad73('0x15'));var config=require(_0xad73('0x16'));var licenseUtil=require(_0xad73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1045be,_0x241ff5){_0x241ff5=_0x241ff5||0xcc;return function(_0x488787){if(_0x488787){return _0x1045be[_0xad73('0x18')](_0x241ff5);}return _0x1045be[_0xad73('0x19')](_0x241ff5)[_0xad73('0x1a')]();};}function respondWithResult(_0x27a9d2,_0x15f72d){_0x15f72d=_0x15f72d||0xc8;return function(_0x82fe13){if(_0x82fe13){return _0x27a9d2['status'](_0x15f72d)[_0xad73('0x1b')](_0x82fe13);}};}function respondWithFilteredResult(_0x35c2c5,_0x4336fa){return function(_0x155548){if(_0x155548){var _0x2f0dcd=typeof _0x4336fa[_0xad73('0x1c')]===_0xad73('0x1d')&&typeof _0x4336fa[_0xad73('0x1e')]===_0xad73('0x1d');var _0xad072c=_0x155548['count'];var _0x47381a=_0x2f0dcd?0x0:_0x4336fa['offset'];var _0x5bd242=_0x2f0dcd?_0x155548[_0xad73('0x1f')]:_0x4336fa[_0xad73('0x1c')]+_0x4336fa[_0xad73('0x1e')];var _0x578068;if(_0x5bd242>=_0xad072c){_0x5bd242=_0xad072c;_0x578068=0xc8;}else{_0x578068=0xce;}_0x35c2c5[_0xad73('0x19')](_0x578068);return _0x35c2c5[_0xad73('0x20')]('Content-Range',_0x47381a+'-'+_0x5bd242+'/'+_0xad072c)[_0xad73('0x1b')](_0x155548);}return null;};}function patchUpdates(_0x4289df){return function(_0x3e02ed){try{jsonpatch[_0xad73('0x21')](_0x3e02ed,_0x4289df,!![]);}catch(_0x2e6cdb){return BPromise[_0xad73('0x22')](_0x2e6cdb);}return _0x3e02ed[_0xad73('0x23')]();};}function saveUpdates(_0x497c3d,_0xfe2758){return function(_0x31f5c4){if(_0x31f5c4){return _0x31f5c4[_0xad73('0x24')](_0x497c3d)[_0xad73('0x25')](function(_0xb3e0b0){return _0xb3e0b0;});}return null;};}function removeEntity(_0x2a1295,_0xbfb297){return function(_0x439f09){if(_0x439f09){return _0x439f09[_0xad73('0x26')]()[_0xad73('0x25')](function(){_0x2a1295[_0xad73('0x19')](0xcc)[_0xad73('0x1a')]();});}};}function handleEntityNotFound(_0x182805,_0xfec523){return function(_0x1b7d84){if(!_0x1b7d84){_0x182805[_0xad73('0x18')](0x194);}return _0x1b7d84;};}function handleError(_0x34f8c4,_0x920ffc){_0x920ffc=_0x920ffc||0x1f4;return function(_0xb7700c){logger[_0xad73('0x27')](_0xb7700c['stack']);if(_0xb7700c['name']){delete _0xb7700c['name'];}_0x34f8c4[_0xad73('0x19')](_0x920ffc)[_0xad73('0x28')](_0xb7700c);};}exports['index']=function(_0x3f1f80,_0x54a8f9){var _0x54eadc={},_0x1f826c={},_0x377273={'count':0x0,'rows':[]};var _0x34fe4d=_[_0xad73('0x29')](db['FaxQueueReport'][_0xad73('0x2a')],function(_0x3fab83){return{'name':_0x3fab83[_0xad73('0x2b')],'type':_0x3fab83['type'][_0xad73('0x2c')]};});_0x1f826c[_0xad73('0x2d')]=_[_0xad73('0x29')](_0x34fe4d,_0xad73('0x2e'));_0x1f826c[_0xad73('0x2f')]=_['keys'](_0x3f1f80['query']);_0x1f826c['filters']=_[_0xad73('0x30')](_0x1f826c['model'],_0x1f826c[_0xad73('0x2f')]);_0x54eadc['attributes']=_[_0xad73('0x30')](_0x1f826c[_0xad73('0x2d')],qs['fields'](_0x3f1f80['query'][_0xad73('0x31')]));_0x54eadc[_0xad73('0x32')]=_0x54eadc['attributes']['length']?_0x54eadc[_0xad73('0x32')]:_0x1f826c['model'];if(!_0x3f1f80[_0xad73('0x2f')][_0xad73('0x33')]('nolimit')){_0x54eadc[_0xad73('0x1e')]=qs['limit'](_0x3f1f80[_0xad73('0x2f')][_0xad73('0x1e')]);_0x54eadc[_0xad73('0x1c')]=qs[_0xad73('0x1c')](_0x3f1f80[_0xad73('0x2f')][_0xad73('0x1c')]);}_0x54eadc[_0xad73('0x34')]=qs[_0xad73('0x35')](_0x3f1f80[_0xad73('0x2f')]['sort']);_0x54eadc[_0xad73('0x36')]=qs[_0xad73('0x37')](_['pick'](_0x3f1f80[_0xad73('0x2f')],_0x1f826c[_0xad73('0x37')]),_0x34fe4d);if(_0x3f1f80[_0xad73('0x2f')][_0xad73('0x38')]){_0x54eadc[_0xad73('0x36')]=_[_0xad73('0x39')](_0x54eadc[_0xad73('0x36')],{'$or':_[_0xad73('0x29')](_0x34fe4d,function(_0x18e9ec){if(_0x18e9ec['type']!==_0xad73('0x3a')){var _0x390c2a={};_0x390c2a[_0x18e9ec[_0xad73('0x2e')]]={'$like':'%'+_0x3f1f80['query']['filter']+'%'};return _0x390c2a;}})});}_0x54eadc=_[_0xad73('0x39')]({},_0x54eadc,_0x3f1f80['options']);var _0x539e3a={'where':_0x54eadc[_0xad73('0x36')]};return db[_0xad73('0x3b')][_0xad73('0x1f')](_0x539e3a)[_0xad73('0x25')](function(_0x4e68b5){_0x377273[_0xad73('0x1f')]=_0x4e68b5;if(_0x3f1f80[_0xad73('0x2f')]['includeAll']){_0x54eadc[_0xad73('0x3c')]=[{'all':!![]}];}return db[_0xad73('0x3b')]['findAll'](_0x54eadc);})[_0xad73('0x25')](function(_0x46f3e8){_0x377273[_0xad73('0x3d')]=_0x46f3e8;return _0x377273;})['then'](respondWithFilteredResult(_0x54a8f9,_0x54eadc))[_0xad73('0x3e')](handleError(_0x54a8f9,null));};exports[_0xad73('0x3f')]=function(_0xfa6386,_0x3d2ef0){var _0x1f46bf={'raw':!![],'where':{'id':_0xfa6386['params']['id']}},_0x4ee68d={};_0x4ee68d['model']=_[_0xad73('0x40')](db[_0xad73('0x3b')][_0xad73('0x2a')]);_0x4ee68d[_0xad73('0x2f')]=_[_0xad73('0x40')](_0xfa6386[_0xad73('0x2f')]);_0x4ee68d[_0xad73('0x37')]=_['intersection'](_0x4ee68d[_0xad73('0x2d')],_0x4ee68d[_0xad73('0x2f')]);_0x1f46bf['attributes']=_['intersection'](_0x4ee68d[_0xad73('0x2d')],qs[_0xad73('0x31')](_0xfa6386[_0xad73('0x2f')][_0xad73('0x31')]));_0x1f46bf['attributes']=_0x1f46bf[_0xad73('0x32')][_0xad73('0x41')]?_0x1f46bf[_0xad73('0x32')]:_0x4ee68d['model'];if(_0xfa6386[_0xad73('0x2f')][_0xad73('0x42')]){_0x1f46bf[_0xad73('0x3c')]=[{'all':!![]}];}_0x1f46bf=_[_0xad73('0x39')]({},_0x1f46bf,_0xfa6386['options']);return db['FaxQueueReport'][_0xad73('0x43')](_0x1f46bf)[_0xad73('0x25')](handleEntityNotFound(_0x3d2ef0,null))[_0xad73('0x25')](respondWithResult(_0x3d2ef0,null))[_0xad73('0x3e')](handleError(_0x3d2ef0,null));};exports[_0xad73('0x44')]=function(_0x449afb,_0x21d57f){return db[_0xad73('0x3b')][_0xad73('0x44')](_0x449afb['body'],{})['then'](respondWithResult(_0x21d57f,0xc9))[_0xad73('0x3e')](handleError(_0x21d57f,null));};exports[_0xad73('0x24')]=function(_0xd5f21,_0x5b6e41){if(_0xd5f21[_0xad73('0x45')]['id']){delete _0xd5f21[_0xad73('0x45')]['id'];}return db[_0xad73('0x3b')][_0xad73('0x43')]({'where':{'id':_0xd5f21['params']['id']}})[_0xad73('0x25')](handleEntityNotFound(_0x5b6e41,null))[_0xad73('0x25')](saveUpdates(_0xd5f21[_0xad73('0x45')],null))['then'](respondWithResult(_0x5b6e41,null))[_0xad73('0x3e')](handleError(_0x5b6e41,null));};exports[_0xad73('0x26')]=function(_0x3e884f,_0x15478a){return db['FaxQueueReport']['find']({'where':{'id':_0x3e884f[_0xad73('0x46')]['id']}})[_0xad73('0x25')](handleEntityNotFound(_0x15478a,null))[_0xad73('0x25')](removeEntity(_0x15478a,null))['catch'](handleError(_0x15478a,null));};exports[_0xad73('0x47')]=function(_0xe01f9a,_0x1e412f){return db[_0xad73('0x3b')][_0xad73('0x47')]()[_0xad73('0x25')](respondWithResult(_0x1e412f,null))[_0xad73('0x3e')](handleError(_0x1e412f,null));};
\ No newline at end of file
index 04eda99..80caeef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1556c5,_0xab7744){_0x1556c5=_0x1556c5-0x0;var _0x67c4c7=_0x1cb9[_0x1556c5];return _0x67c4c7;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x512994,_0x45f9d4){var _0x468c9b=function(_0x1fc350){while(--_0x1fc350){_0x512994['push'](_0x512994['shift']());}};_0x468c9b(++_0x45f9d4);}(_0x4975,0x86));var _0x5497=function(_0x4dc9aa,_0x5351ba){_0x4dc9aa=_0x4dc9aa-0x0;var _0xd3708a=_0x4975[_0x4dc9aa];return _0xd3708a;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8f9a01e..d33f9f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe8=['error','code','message','result','catch','create','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c23a3,_0x28568b){var _0xacf8c4=function(_0x47e988){while(--_0x47e988){_0x3c23a3['push'](_0x3c23a3['shift']());}};_0xacf8c4(++_0x28568b);}(_0x2fe8,0x17a));var _0x82fe=function(_0x29d420,_0x1a4cbe){_0x29d420=_0x29d420-0x0;var _0xcfd191=_0x2fe8[_0x29d420];return _0xcfd191;};'use strict';var _=require(_0x82fe('0x0'));var util=require(_0x82fe('0x1'));var moment=require(_0x82fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x82fe('0x3'));var fs=require('fs');var Redis=require(_0x82fe('0x4'));var db=require(_0x82fe('0x5'))['db'];var utils=require(_0x82fe('0x6'));var logger=require(_0x82fe('0x7'))(_0x82fe('0x8'));var config=require(_0x82fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x82fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x434ddd,_0x3f4882,_0x2b2913){return new BPromise(function(_0x1cc94c,_0x412e0c){return client['request'](_0x434ddd,_0x2b2913)[_0x82fe('0xb')](function(_0x517e4b){logger[_0x82fe('0xc')](_0x82fe('0xd'),_0x3f4882,_0x82fe('0xe'));logger[_0x82fe('0xf')](_0x82fe('0x10'),_0x3f4882,'request\x20sent',JSON[_0x82fe('0x11')](_0x517e4b));if(_0x517e4b[_0x82fe('0x12')]){if(_0x517e4b['error'][_0x82fe('0x13')]===0x1f4){logger[_0x82fe('0x12')](_0x82fe('0xd'),_0x3f4882,_0x517e4b[_0x82fe('0x12')][_0x82fe('0x14')]);return _0x412e0c(_0x517e4b[_0x82fe('0x12')][_0x82fe('0x14')]);}logger[_0x82fe('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x3f4882,_0x517e4b[_0x82fe('0x12')]['message']);return _0x1cc94c(_0x517e4b[_0x82fe('0x12')]['message']);}else{logger[_0x82fe('0xc')](_0x82fe('0xd'),_0x3f4882,'request\x20sent');_0x1cc94c(_0x517e4b[_0x82fe('0x15')][_0x82fe('0x14')]);}})[_0x82fe('0x16')](function(_0x446ab6){logger[_0x82fe('0x12')](_0x82fe('0xd'),_0x3f4882,_0x446ab6);_0x412e0c(_0x446ab6);});});}exports['CreateFaxQueueReport']=function(_0x343b0b){var _0x50e26c=this;return new Promise(function(_0x402ddc,_0x388e95){return db['FaxQueueReport'][_0x82fe('0x17')](_0x343b0b['body'],{'raw':_0x343b0b[_0x82fe('0x18')]?_0x343b0b['options'][_0x82fe('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2fe9bf){logger['info'](_0x82fe('0x1a'),_0x343b0b);logger[_0x82fe('0xf')](_0x82fe('0x1a'),_0x343b0b,JSON['stringify'](_0x2fe9bf));_0x402ddc(_0x2fe9bf);})[_0x82fe('0x16')](function(_0x10019e){logger[_0x82fe('0x12')](_0x82fe('0x1a'),_0x10019e[_0x82fe('0x14')],_0x343b0b);_0x388e95(_0x50e26c[_0x82fe('0x12')](0x1f4,_0x10019e[_0x82fe('0x14')]));});});};exports[_0x82fe('0x1b')]=function(_0x17d936){var _0x24c2e7=this;return new Promise(function(_0x505190,_0x133fd3){return db[_0x82fe('0x1c')][_0x82fe('0x1d')](_0x17d936['body'],{'raw':_0x17d936['options']?_0x17d936['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17d936[_0x82fe('0x18')]?_0x17d936[_0x82fe('0x18')][_0x82fe('0x1e')]||null:null,'attributes':_0x17d936[_0x82fe('0x18')]?_0x17d936[_0x82fe('0x18')][_0x82fe('0x1f')]||null:null,'limit':_0x17d936[_0x82fe('0x18')]?_0x17d936['options'][_0x82fe('0x20')]||null:null})[_0x82fe('0xb')](function(_0x4bcaae){logger[_0x82fe('0xc')](_0x82fe('0x1b'),_0x17d936);logger[_0x82fe('0xf')](_0x82fe('0x1b'),_0x17d936,JSON[_0x82fe('0x11')](_0x4bcaae));_0x505190(_0x4bcaae);})[_0x82fe('0x16')](function(_0x274627){logger[_0x82fe('0x12')](_0x82fe('0x1b'),_0x274627[_0x82fe('0x14')],_0x17d936);_0x133fd3(_0x24c2e7[_0x82fe('0x12')](0x1f4,_0x274627[_0x82fe('0x14')]));});});};
\ No newline at end of file
+var _0xdb0c=['request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','create','body','options','then','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','FaxQueueReport','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1f3eee,_0x1fe184){var _0x446467=function(_0x251076){while(--_0x251076){_0x1f3eee['push'](_0x1f3eee['shift']());}};_0x446467(++_0x1fe184);}(_0xdb0c,0x180));var _0xcdb0=function(_0x1161cc,_0x2fa0a0){_0x1161cc=_0x1161cc-0x0;var _0x27a5df=_0xdb0c[_0x1161cc];return _0x27a5df;};'use strict';var _=require(_0xcdb0('0x0'));var util=require(_0xcdb0('0x1'));var moment=require(_0xcdb0('0x2'));var BPromise=require('bluebird');var rs=require(_0xcdb0('0x3'));var fs=require('fs');var Redis=require(_0xcdb0('0x4'));var db=require(_0xcdb0('0x5'))['db'];var utils=require(_0xcdb0('0x6'));var logger=require(_0xcdb0('0x7'))(_0xcdb0('0x8'));var config=require(_0xcdb0('0x9'));var jayson=require(_0xcdb0('0xa'));var client=jayson[_0xcdb0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc5a0cb,_0x2dbb5e,_0x255b25){return new BPromise(function(_0x47584d,_0x8d6295){return client[_0xcdb0('0xc')](_0xc5a0cb,_0x255b25)['then'](function(_0x3ea993){logger[_0xcdb0('0xd')](_0xcdb0('0xe'),_0x2dbb5e,_0xcdb0('0xf'));logger[_0xcdb0('0x10')](_0xcdb0('0x11'),_0x2dbb5e,_0xcdb0('0xf'),JSON['stringify'](_0x3ea993));if(_0x3ea993[_0xcdb0('0x12')]){if(_0x3ea993[_0xcdb0('0x12')]['code']===0x1f4){logger[_0xcdb0('0x12')](_0xcdb0('0xe'),_0x2dbb5e,_0x3ea993[_0xcdb0('0x12')][_0xcdb0('0x13')]);return _0x8d6295(_0x3ea993[_0xcdb0('0x12')][_0xcdb0('0x13')]);}logger[_0xcdb0('0x12')](_0xcdb0('0xe'),_0x2dbb5e,_0x3ea993[_0xcdb0('0x12')][_0xcdb0('0x13')]);return _0x47584d(_0x3ea993[_0xcdb0('0x12')]['message']);}else{logger['info'](_0xcdb0('0xe'),_0x2dbb5e,_0xcdb0('0xf'));_0x47584d(_0x3ea993['result'][_0xcdb0('0x13')]);}})[_0xcdb0('0x14')](function(_0x56d41e){logger[_0xcdb0('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2dbb5e,_0x56d41e);_0x8d6295(_0x56d41e);});});}exports['CreateFaxQueueReport']=function(_0xd3894e){var _0x3b8d32=this;return new Promise(function(_0x10c315,_0x2e96a4){return db['FaxQueueReport'][_0xcdb0('0x15')](_0xd3894e[_0xcdb0('0x16')],{'raw':_0xd3894e[_0xcdb0('0x17')]?_0xd3894e['options']['raw']===undefined?!![]:![]:!![]})[_0xcdb0('0x18')](function(_0x4a6a53){logger[_0xcdb0('0xd')]('CreateFaxQueueReport',_0xd3894e);logger[_0xcdb0('0x10')](_0xcdb0('0x19'),_0xd3894e,JSON[_0xcdb0('0x1a')](_0x4a6a53));_0x10c315(_0x4a6a53);})[_0xcdb0('0x14')](function(_0x31b7e8){logger[_0xcdb0('0x12')](_0xcdb0('0x19'),_0x31b7e8[_0xcdb0('0x13')],_0xd3894e);_0x2e96a4(_0x3b8d32[_0xcdb0('0x12')](0x1f4,_0x31b7e8[_0xcdb0('0x13')]));});});};exports[_0xcdb0('0x1b')]=function(_0x2eb4d6){var _0x3e7aaa=this;return new Promise(function(_0x192808,_0x510378){return db[_0xcdb0('0x1c')]['update'](_0x2eb4d6[_0xcdb0('0x16')],{'raw':_0x2eb4d6[_0xcdb0('0x17')]?_0x2eb4d6[_0xcdb0('0x17')][_0xcdb0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eb4d6['options']?_0x2eb4d6[_0xcdb0('0x17')][_0xcdb0('0x1e')]||null:null,'attributes':_0x2eb4d6[_0xcdb0('0x17')]?_0x2eb4d6[_0xcdb0('0x17')][_0xcdb0('0x1f')]||null:null,'limit':_0x2eb4d6[_0xcdb0('0x17')]?_0x2eb4d6[_0xcdb0('0x17')][_0xcdb0('0x20')]||null:null})['then'](function(_0x1f8e6f){logger[_0xcdb0('0xd')]('UpdateFaxQueueReport',_0x2eb4d6);logger[_0xcdb0('0x10')](_0xcdb0('0x1b'),_0x2eb4d6,JSON[_0xcdb0('0x1a')](_0x1f8e6f));_0x192808(_0x1f8e6f);})[_0xcdb0('0x14')](function(_0x20f8e7){logger[_0xcdb0('0x12')](_0xcdb0('0x1b'),_0x20f8e7['message'],_0x2eb4d6);_0x510378(_0x3e7aaa[_0xcdb0('0x12')](0x1f4,_0x20f8e7[_0xcdb0('0x13')]));});});};
\ No newline at end of file
index 35dc066..d89c46f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8968=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','/describe','describe','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x8968,0x1d0));var _0x8896=function(_0x47a72d,_0x42f970){_0x47a72d=_0x47a72d-0x0;var _0x34a01e=_0x8968[_0x47a72d];return _0x34a01e;};'use strict';var multer=require(_0x8896('0x0'));var util=require('util');var path=require(_0x8896('0x1'));var timeout=require(_0x8896('0x2'));var express=require(_0x8896('0x3'));var router=express[_0x8896('0x4')]();var fs_extra=require(_0x8896('0x5'));var auth=require(_0x8896('0x6'));var interaction=require(_0x8896('0x7'));var config=require('../../config/environment');var controller=require(_0x8896('0x8'));router[_0x8896('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8896('0x9')](_0x8896('0xa'),auth['isAuthenticated'](),controller[_0x8896('0xb')]);router[_0x8896('0x9')]('/:id',auth[_0x8896('0xc')](),controller[_0x8896('0xd')]);router[_0x8896('0xe')]('/',auth[_0x8896('0xc')](),controller[_0x8896('0xf')]);router[_0x8896('0x10')](_0x8896('0x11'),auth['isAuthenticated'](),controller[_0x8896('0x12')]);router[_0x8896('0x13')](_0x8896('0x11'),auth[_0x8896('0xc')](),controller[_0x8896('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xfcba=['destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update'];(function(_0x4cfa3d,_0xb89a54){var _0x70e106=function(_0x125dfe){while(--_0x125dfe){_0x4cfa3d['push'](_0x4cfa3d['shift']());}};_0x70e106(++_0xb89a54);}(_0xfcba,0x132));var _0xafcb=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xfcba[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require(_0xafcb('0x0'));var path=require(_0xafcb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xafcb('0x2')]();var fs_extra=require(_0xafcb('0x3'));var auth=require(_0xafcb('0x4'));var interaction=require(_0xafcb('0x5'));var config=require(_0xafcb('0x6'));var controller=require(_0xafcb('0x7'));router[_0xafcb('0x8')]('/',auth[_0xafcb('0x9')](),controller[_0xafcb('0xa')]);router[_0xafcb('0x8')](_0xafcb('0xb'),auth[_0xafcb('0x9')](),controller['describe']);router[_0xafcb('0x8')](_0xafcb('0xc'),auth[_0xafcb('0x9')](),controller[_0xafcb('0xd')]);router[_0xafcb('0xe')]('/',auth[_0xafcb('0x9')](),controller['create']);router[_0xafcb('0xf')]('/:id',auth[_0xafcb('0x9')](),controller[_0xafcb('0x10')]);router['delete'](_0xafcb('0xc'),auth[_0xafcb('0x9')](),controller[_0xafcb('0x11')]);module[_0xafcb('0x12')]=router;
\ No newline at end of file
index 2feeb78..8db5004 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x14349b,_0x1eb24d){var _0x34f8cb=function(_0x100008){while(--_0x100008){_0x14349b['push'](_0x14349b['shift']());}};_0x34f8cb(++_0x1eb24d);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4e3305,_0x1c42b0){var _0x10cc88=function(_0x4b7197){while(--_0x4b7197){_0x4e3305['push'](_0x4e3305['shift']());}};_0x10cc88(++_0x1c42b0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xf3cd[_0x41cfd4];return _0x190f48;};'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
index a494e7a..2ead643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef98=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','sendStatus','error','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x5430ce,_0x21bb2e){var _0x3331b5=function(_0x32b195){while(--_0x32b195){_0x5430ce['push'](_0x5430ce['shift']());}};_0x3331b5(++_0x21bb2e);}(_0xef98,0x178));var _0x8ef9=function(_0x29d050,_0xca9e0f){_0x29d050=_0x29d050-0x0;var _0x109b77=_0xef98[_0x29d050];return _0x109b77;};'use strict';var emlformat=require(_0x8ef9('0x0'));var rimraf=require(_0x8ef9('0x1'));var zipdir=require(_0x8ef9('0x2'));var jsonpatch=require(_0x8ef9('0x3'));var rp=require(_0x8ef9('0x4'));var moment=require(_0x8ef9('0x5'));var BPromise=require(_0x8ef9('0x6'));var Mustache=require('mustache');var util=require(_0x8ef9('0x7'));var path=require(_0x8ef9('0x8'));var sox=require(_0x8ef9('0x9'));var csv=require(_0x8ef9('0xa'));var ejs=require(_0x8ef9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8ef9('0xc'));var crypto=require(_0x8ef9('0xd'));var jsforce=require(_0x8ef9('0xe'));var deskjs=require(_0x8ef9('0xf'));var toCsv=require(_0x8ef9('0xa'));var querystring=require(_0x8ef9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ef9('0x11'));var qs=require(_0x8ef9('0x12'));var as=require(_0x8ef9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ef9('0x14'))(_0x8ef9('0x15'));var utils=require(_0x8ef9('0x16'));var config=require(_0x8ef9('0x17'));var licenseUtil=require(_0x8ef9('0x18'));var db=require(_0x8ef9('0x19'))['db'];function respondWithStatusCode(_0x5152f4,_0x37832f){_0x37832f=_0x37832f||0xcc;return function(_0x134eb8){if(_0x134eb8){return _0x5152f4['sendStatus'](_0x37832f);}return _0x5152f4[_0x8ef9('0x1a')](_0x37832f)['end']();};}function respondWithResult(_0x4e786c,_0x42a92f){_0x42a92f=_0x42a92f||0xc8;return function(_0x1bbc67){if(_0x1bbc67){return _0x4e786c[_0x8ef9('0x1a')](_0x42a92f)[_0x8ef9('0x1b')](_0x1bbc67);}};}function respondWithFilteredResult(_0x73552b,_0x557451){return function(_0x457daa){if(_0x457daa){var _0x1bd45e=typeof _0x557451[_0x8ef9('0x1c')]===_0x8ef9('0x1d')&&typeof _0x557451[_0x8ef9('0x1e')]===_0x8ef9('0x1d');var _0x7fbd73=_0x457daa[_0x8ef9('0x1f')];var _0x4c84f6=_0x1bd45e?0x0:_0x557451[_0x8ef9('0x1c')];var _0x3f0be8=_0x1bd45e?_0x457daa[_0x8ef9('0x1f')]:_0x557451[_0x8ef9('0x1c')]+_0x557451[_0x8ef9('0x1e')];var _0x4997aa;if(_0x3f0be8>=_0x7fbd73){_0x3f0be8=_0x7fbd73;_0x4997aa=0xc8;}else{_0x4997aa=0xce;}_0x73552b['status'](_0x4997aa);return _0x73552b['set']('Content-Range',_0x4c84f6+'-'+_0x3f0be8+'/'+_0x7fbd73)[_0x8ef9('0x1b')](_0x457daa);}return null;};}function patchUpdates(_0x22d637){return function(_0x35dd23){try{jsonpatch[_0x8ef9('0x20')](_0x35dd23,_0x22d637,!![]);}catch(_0x10bc08){return BPromise[_0x8ef9('0x21')](_0x10bc08);}return _0x35dd23[_0x8ef9('0x22')]();};}function saveUpdates(_0x4c364a,_0xbdd7d0){return function(_0x39f35a){if(_0x39f35a){return _0x39f35a[_0x8ef9('0x23')](_0x4c364a)[_0x8ef9('0x24')](function(_0x29f02b){return _0x29f02b;});}return null;};}function removeEntity(_0x59d29a,_0x5420c6){return function(_0x373f74){if(_0x373f74){return _0x373f74[_0x8ef9('0x25')]()[_0x8ef9('0x24')](function(){_0x59d29a[_0x8ef9('0x1a')](0xcc)[_0x8ef9('0x26')]();});}};}function handleEntityNotFound(_0x3ae858,_0x55d70c){return function(_0xee27d1){if(!_0xee27d1){_0x3ae858[_0x8ef9('0x27')](0x194);}return _0xee27d1;};}function handleError(_0x88b5b0,_0x2f38bb){_0x2f38bb=_0x2f38bb||0x1f4;return function(_0x428903){logger[_0x8ef9('0x28')](_0x428903['stack']);if(_0x428903['name']){delete _0x428903['name'];}_0x88b5b0[_0x8ef9('0x1a')](_0x2f38bb)[_0x8ef9('0x29')](_0x428903);};}exports[_0x8ef9('0x2a')]=function(_0x3a7096,_0x543ed0){var _0x25df7b={},_0x1ea8a2={},_0x477baf={'count':0x0,'rows':[]};var _0x2ee486=_['map'](db[_0x8ef9('0x2b')][_0x8ef9('0x2c')],function(_0x1f1456){return{'name':_0x1f1456[_0x8ef9('0x2d')],'type':_0x1f1456[_0x8ef9('0x2e')][_0x8ef9('0x2f')]};});_0x1ea8a2['model']=_[_0x8ef9('0x30')](_0x2ee486,'name');_0x1ea8a2[_0x8ef9('0x31')]=_[_0x8ef9('0x32')](_0x3a7096[_0x8ef9('0x31')]);_0x1ea8a2[_0x8ef9('0x33')]=_[_0x8ef9('0x34')](_0x1ea8a2[_0x8ef9('0x35')],_0x1ea8a2[_0x8ef9('0x31')]);_0x25df7b['attributes']=_[_0x8ef9('0x34')](_0x1ea8a2[_0x8ef9('0x35')],qs[_0x8ef9('0x36')](_0x3a7096[_0x8ef9('0x31')][_0x8ef9('0x36')]));_0x25df7b[_0x8ef9('0x37')]=_0x25df7b['attributes'][_0x8ef9('0x38')]?_0x25df7b[_0x8ef9('0x37')]:_0x1ea8a2['model'];if(!_0x3a7096[_0x8ef9('0x31')][_0x8ef9('0x39')](_0x8ef9('0x3a'))){_0x25df7b['limit']=qs[_0x8ef9('0x1e')](_0x3a7096['query'][_0x8ef9('0x1e')]);_0x25df7b[_0x8ef9('0x1c')]=qs[_0x8ef9('0x1c')](_0x3a7096[_0x8ef9('0x31')][_0x8ef9('0x1c')]);}_0x25df7b[_0x8ef9('0x3b')]=qs[_0x8ef9('0x3c')](_0x3a7096[_0x8ef9('0x31')]['sort']);_0x25df7b['where']=qs[_0x8ef9('0x33')](_[_0x8ef9('0x3d')](_0x3a7096[_0x8ef9('0x31')],_0x1ea8a2[_0x8ef9('0x33')]),_0x2ee486);if(_0x3a7096[_0x8ef9('0x31')][_0x8ef9('0x3e')]){_0x25df7b[_0x8ef9('0x3f')]=_[_0x8ef9('0x40')](_0x25df7b[_0x8ef9('0x3f')],{'$or':_[_0x8ef9('0x30')](_0x2ee486,function(_0x12b693){if(_0x12b693['type']!==_0x8ef9('0x41')){var _0x2c90c2={};_0x2c90c2[_0x12b693[_0x8ef9('0x42')]]={'$like':'%'+_0x3a7096['query'][_0x8ef9('0x3e')]+'%'};return _0x2c90c2;}})});}_0x25df7b=_['merge']({},_0x25df7b,_0x3a7096[_0x8ef9('0x43')]);var _0xac3d92={'where':_0x25df7b[_0x8ef9('0x3f')]};return db[_0x8ef9('0x2b')][_0x8ef9('0x1f')](_0xac3d92)[_0x8ef9('0x24')](function(_0x43374b){_0x477baf[_0x8ef9('0x1f')]=_0x43374b;if(_0x3a7096[_0x8ef9('0x31')][_0x8ef9('0x44')]){_0x25df7b['include']=[{'all':!![]}];}return db[_0x8ef9('0x2b')][_0x8ef9('0x45')](_0x25df7b);})['then'](function(_0x84001e){_0x477baf[_0x8ef9('0x46')]=_0x84001e;return _0x477baf;})[_0x8ef9('0x24')](respondWithFilteredResult(_0x543ed0,_0x25df7b))[_0x8ef9('0x47')](handleError(_0x543ed0,null));};exports[_0x8ef9('0x48')]=function(_0x1c9c18,_0x5a5bf0){var _0x573d38={'raw':!![],'where':{'id':_0x1c9c18[_0x8ef9('0x49')]['id']}},_0x17609c={};_0x17609c[_0x8ef9('0x35')]=_[_0x8ef9('0x32')](db['FaxTransferReport'][_0x8ef9('0x2c')]);_0x17609c[_0x8ef9('0x31')]=_[_0x8ef9('0x32')](_0x1c9c18[_0x8ef9('0x31')]);_0x17609c['filters']=_['intersection'](_0x17609c[_0x8ef9('0x35')],_0x17609c[_0x8ef9('0x31')]);_0x573d38[_0x8ef9('0x37')]=_[_0x8ef9('0x34')](_0x17609c['model'],qs['fields'](_0x1c9c18['query'][_0x8ef9('0x36')]));_0x573d38['attributes']=_0x573d38['attributes']['length']?_0x573d38[_0x8ef9('0x37')]:_0x17609c[_0x8ef9('0x35')];if(_0x1c9c18[_0x8ef9('0x31')][_0x8ef9('0x44')]){_0x573d38['include']=[{'all':!![]}];}_0x573d38=_[_0x8ef9('0x40')]({},_0x573d38,_0x1c9c18['options']);return db[_0x8ef9('0x2b')][_0x8ef9('0x4a')](_0x573d38)[_0x8ef9('0x24')](handleEntityNotFound(_0x5a5bf0,null))[_0x8ef9('0x24')](respondWithResult(_0x5a5bf0,null))[_0x8ef9('0x47')](handleError(_0x5a5bf0,null));};exports[_0x8ef9('0x4b')]=function(_0x33c3dd,_0x3b8000){return db[_0x8ef9('0x2b')][_0x8ef9('0x4b')](_0x33c3dd[_0x8ef9('0x4c')],{})['then'](respondWithResult(_0x3b8000,0xc9))['catch'](handleError(_0x3b8000,null));};exports[_0x8ef9('0x23')]=function(_0x1bc6a3,_0x8c13e3){if(_0x1bc6a3['body']['id']){delete _0x1bc6a3[_0x8ef9('0x4c')]['id'];}return db['FaxTransferReport'][_0x8ef9('0x4a')]({'where':{'id':_0x1bc6a3[_0x8ef9('0x49')]['id']}})[_0x8ef9('0x24')](handleEntityNotFound(_0x8c13e3,null))[_0x8ef9('0x24')](saveUpdates(_0x1bc6a3['body'],null))[_0x8ef9('0x24')](respondWithResult(_0x8c13e3,null))[_0x8ef9('0x47')](handleError(_0x8c13e3,null));};exports[_0x8ef9('0x25')]=function(_0x4a7c44,_0x136041){return db[_0x8ef9('0x2b')][_0x8ef9('0x4a')]({'where':{'id':_0x4a7c44['params']['id']}})[_0x8ef9('0x24')](handleEntityNotFound(_0x136041,null))['then'](removeEntity(_0x136041,null))[_0x8ef9('0x47')](handleError(_0x136041,null));};exports[_0x8ef9('0x4d')]=function(_0x53d2ac,_0xc66a56){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0xc66a56,null))[_0x8ef9('0x47')](handleError(_0xc66a56,null));};
\ No newline at end of file
+var _0x5f40=['FaxTransferReport','catch','show','params','includeAll','find','then','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','stack','name','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include'];(function(_0x4ceed7,_0x1f4875){var _0x45953a=function(_0x11121e){while(--_0x11121e){_0x4ceed7['push'](_0x4ceed7['shift']());}};_0x45953a(++_0x1f4875);}(_0x5f40,0x197));var _0x05f4=function(_0x499ffd,_0x481e0c){_0x499ffd=_0x499ffd-0x0;var _0x50fad1=_0x5f40[_0x499ffd];return _0x50fad1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05f4('0x0'));var zipdir=require(_0x05f4('0x1'));var jsonpatch=require(_0x05f4('0x2'));var rp=require(_0x05f4('0x3'));var moment=require(_0x05f4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x05f4('0x5'));var path=require(_0x05f4('0x6'));var sox=require(_0x05f4('0x7'));var csv=require(_0x05f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05f4('0x9'));var squel=require(_0x05f4('0xa'));var crypto=require(_0x05f4('0xb'));var jsforce=require(_0x05f4('0xc'));var deskjs=require(_0x05f4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x05f4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x05f4('0xf'));var as=require(_0x05f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x05f4('0x11'));var config=require(_0x05f4('0x12'));var licenseUtil=require(_0x05f4('0x13'));var db=require(_0x05f4('0x14'))['db'];function respondWithStatusCode(_0x48ce6d,_0x127ff6){_0x127ff6=_0x127ff6||0xcc;return function(_0xf949cf){if(_0xf949cf){return _0x48ce6d[_0x05f4('0x15')](_0x127ff6);}return _0x48ce6d[_0x05f4('0x16')](_0x127ff6)[_0x05f4('0x17')]();};}function respondWithResult(_0x45b374,_0x5c7871){_0x5c7871=_0x5c7871||0xc8;return function(_0xa35400){if(_0xa35400){return _0x45b374[_0x05f4('0x16')](_0x5c7871)[_0x05f4('0x18')](_0xa35400);}};}function respondWithFilteredResult(_0x631bae,_0x27a8fa){return function(_0x5027cb){if(_0x5027cb){var _0x454fc9=typeof _0x27a8fa[_0x05f4('0x19')]===_0x05f4('0x1a')&&typeof _0x27a8fa['limit']==='undefined';var _0x507a26=_0x5027cb[_0x05f4('0x1b')];var _0x384521=_0x454fc9?0x0:_0x27a8fa['offset'];var _0x92ef7d=_0x454fc9?_0x5027cb[_0x05f4('0x1b')]:_0x27a8fa[_0x05f4('0x19')]+_0x27a8fa[_0x05f4('0x1c')];var _0xa9ae48;if(_0x92ef7d>=_0x507a26){_0x92ef7d=_0x507a26;_0xa9ae48=0xc8;}else{_0xa9ae48=0xce;}_0x631bae[_0x05f4('0x16')](_0xa9ae48);return _0x631bae[_0x05f4('0x1d')](_0x05f4('0x1e'),_0x384521+'-'+_0x92ef7d+'/'+_0x507a26)[_0x05f4('0x18')](_0x5027cb);}return null;};}function patchUpdates(_0x4280b4){return function(_0x3f4a06){try{jsonpatch[_0x05f4('0x1f')](_0x3f4a06,_0x4280b4,!![]);}catch(_0x4ad181){return BPromise[_0x05f4('0x20')](_0x4ad181);}return _0x3f4a06['save']();};}function saveUpdates(_0x8d5a0b,_0x4819c7){return function(_0x2fbc36){if(_0x2fbc36){return _0x2fbc36['update'](_0x8d5a0b)['then'](function(_0x46a5fd){return _0x46a5fd;});}return null;};}function removeEntity(_0x3fcd7b,_0x11d0a4){return function(_0x10f89e){if(_0x10f89e){return _0x10f89e[_0x05f4('0x21')]()['then'](function(){_0x3fcd7b['status'](0xcc)[_0x05f4('0x17')]();});}};}function handleEntityNotFound(_0x152e8c,_0x17ef37){return function(_0x3f478c){if(!_0x3f478c){_0x152e8c[_0x05f4('0x15')](0x194);}return _0x3f478c;};}function handleError(_0x381093,_0xbd5732){_0xbd5732=_0xbd5732||0x1f4;return function(_0x5bcf3f){logger['error'](_0x5bcf3f[_0x05f4('0x22')]);if(_0x5bcf3f[_0x05f4('0x23')]){delete _0x5bcf3f[_0x05f4('0x23')];}_0x381093['status'](_0xbd5732)['send'](_0x5bcf3f);};}exports['index']=function(_0x43dd01,_0x21c02c){var _0x4f7f96={},_0x3b4417={},_0x4d57f0={'count':0x0,'rows':[]};var _0xb5cfef=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x2b2176){return{'name':_0x2b2176['fieldName'],'type':_0x2b2176[_0x05f4('0x24')][_0x05f4('0x25')]};});_0x3b4417[_0x05f4('0x26')]=_['map'](_0xb5cfef,_0x05f4('0x23'));_0x3b4417[_0x05f4('0x27')]=_['keys'](_0x43dd01[_0x05f4('0x27')]);_0x3b4417[_0x05f4('0x28')]=_[_0x05f4('0x29')](_0x3b4417[_0x05f4('0x26')],_0x3b4417['query']);_0x4f7f96[_0x05f4('0x2a')]=_[_0x05f4('0x29')](_0x3b4417[_0x05f4('0x26')],qs['fields'](_0x43dd01['query'][_0x05f4('0x2b')]));_0x4f7f96[_0x05f4('0x2a')]=_0x4f7f96[_0x05f4('0x2a')][_0x05f4('0x2c')]?_0x4f7f96[_0x05f4('0x2a')]:_0x3b4417['model'];if(!_0x43dd01[_0x05f4('0x27')]['hasOwnProperty'](_0x05f4('0x2d'))){_0x4f7f96[_0x05f4('0x1c')]=qs[_0x05f4('0x1c')](_0x43dd01['query'][_0x05f4('0x1c')]);_0x4f7f96[_0x05f4('0x19')]=qs['offset'](_0x43dd01[_0x05f4('0x27')]['offset']);}_0x4f7f96[_0x05f4('0x2e')]=qs['sort'](_0x43dd01[_0x05f4('0x27')][_0x05f4('0x2f')]);_0x4f7f96['where']=qs['filters'](_[_0x05f4('0x30')](_0x43dd01[_0x05f4('0x27')],_0x3b4417[_0x05f4('0x28')]),_0xb5cfef);if(_0x43dd01['query'][_0x05f4('0x31')]){_0x4f7f96[_0x05f4('0x32')]=_[_0x05f4('0x33')](_0x4f7f96[_0x05f4('0x32')],{'$or':_['map'](_0xb5cfef,function(_0x4065bd){if(_0x4065bd['type']!==_0x05f4('0x34')){var _0x151839={};_0x151839[_0x4065bd['name']]={'$like':'%'+_0x43dd01[_0x05f4('0x27')][_0x05f4('0x31')]+'%'};return _0x151839;}})});}_0x4f7f96=_[_0x05f4('0x33')]({},_0x4f7f96,_0x43dd01[_0x05f4('0x35')]);var _0x781fa8={'where':_0x4f7f96['where']};return db['FaxTransferReport'][_0x05f4('0x1b')](_0x781fa8)['then'](function(_0x9588ec){_0x4d57f0[_0x05f4('0x1b')]=_0x9588ec;if(_0x43dd01['query']['includeAll']){_0x4f7f96[_0x05f4('0x36')]=[{'all':!![]}];}return db[_0x05f4('0x37')]['findAll'](_0x4f7f96);})['then'](function(_0x448abd){_0x4d57f0['rows']=_0x448abd;return _0x4d57f0;})['then'](respondWithFilteredResult(_0x21c02c,_0x4f7f96))[_0x05f4('0x38')](handleError(_0x21c02c,null));};exports[_0x05f4('0x39')]=function(_0x539841,_0x338169){var _0x47e3e4={'raw':!![],'where':{'id':_0x539841[_0x05f4('0x3a')]['id']}},_0x333462={};_0x333462['model']=_['keys'](db[_0x05f4('0x37')]['rawAttributes']);_0x333462[_0x05f4('0x27')]=_['keys'](_0x539841[_0x05f4('0x27')]);_0x333462[_0x05f4('0x28')]=_[_0x05f4('0x29')](_0x333462['model'],_0x333462[_0x05f4('0x27')]);_0x47e3e4[_0x05f4('0x2a')]=_[_0x05f4('0x29')](_0x333462['model'],qs['fields'](_0x539841[_0x05f4('0x27')][_0x05f4('0x2b')]));_0x47e3e4[_0x05f4('0x2a')]=_0x47e3e4['attributes'][_0x05f4('0x2c')]?_0x47e3e4[_0x05f4('0x2a')]:_0x333462['model'];if(_0x539841['query'][_0x05f4('0x3b')]){_0x47e3e4[_0x05f4('0x36')]=[{'all':!![]}];}_0x47e3e4=_[_0x05f4('0x33')]({},_0x47e3e4,_0x539841[_0x05f4('0x35')]);return db[_0x05f4('0x37')][_0x05f4('0x3c')](_0x47e3e4)[_0x05f4('0x3d')](handleEntityNotFound(_0x338169,null))[_0x05f4('0x3d')](respondWithResult(_0x338169,null))[_0x05f4('0x38')](handleError(_0x338169,null));};exports[_0x05f4('0x3e')]=function(_0x4fc198,_0x39e96f){return db[_0x05f4('0x37')]['create'](_0x4fc198[_0x05f4('0x3f')],{})[_0x05f4('0x3d')](respondWithResult(_0x39e96f,0xc9))[_0x05f4('0x38')](handleError(_0x39e96f,null));};exports[_0x05f4('0x40')]=function(_0x5cc26d,_0x160dcc){if(_0x5cc26d['body']['id']){delete _0x5cc26d['body']['id'];}return db[_0x05f4('0x37')]['find']({'where':{'id':_0x5cc26d[_0x05f4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x160dcc,null))['then'](saveUpdates(_0x5cc26d[_0x05f4('0x3f')],null))[_0x05f4('0x3d')](respondWithResult(_0x160dcc,null))[_0x05f4('0x38')](handleError(_0x160dcc,null));};exports[_0x05f4('0x21')]=function(_0x272b6c,_0x397ee0){return db[_0x05f4('0x37')][_0x05f4('0x3c')]({'where':{'id':_0x272b6c[_0x05f4('0x3a')]['id']}})[_0x05f4('0x3d')](handleEntityNotFound(_0x397ee0,null))[_0x05f4('0x3d')](removeEntity(_0x397ee0,null))['catch'](handleError(_0x397ee0,null));};exports['describe']=function(_0x5344e5,_0x246ee7){return db[_0x05f4('0x37')][_0x05f4('0x41')]()[_0x05f4('0x3d')](respondWithResult(_0x246ee7,null))[_0x05f4('0x38')](handleError(_0x246ee7,null));};
\ No newline at end of file
index d945ff7..fc6bc36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2028=['../../config/logger','api','moment','request-promise','path','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid'];(function(_0x30e141,_0x450f41){var _0x1d25ab=function(_0x224f09){while(--_0x224f09){_0x30e141['push'](_0x30e141['shift']());}};_0x1d25ab(++_0x450f41);}(_0x2028,0x64));var _0x8202=function(_0x4907a1,_0xd7ed29){_0x4907a1=_0x4907a1-0x0;var _0x2b1e11=_0x2028[_0x4907a1];return _0x2b1e11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8202('0x0'))(_0x8202('0x1'));var moment=require(_0x8202('0x2'));var BPromise=require('bluebird');var rp=require(_0x8202('0x3'));var fs=require('fs');var path=require(_0x8202('0x4'));var rimraf=require(_0x8202('0x5'));var config=require('../../config/environment');var attributes=require(_0x8202('0x6'));module['exports']=function(_0xab1a88,_0x86e6d8){return _0xab1a88[_0x8202('0x7')](_0x8202('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x8202('0x9'),'fields':[_0x8202('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb68a=['bluebird','request-promise','rimraf','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0xd12f0f,_0x176947){var _0x5a0473=function(_0x22f225){while(--_0x22f225){_0xd12f0f['push'](_0xd12f0f['shift']());}};_0x5a0473(++_0x176947);}(_0xb68a,0x93));var _0xab68=function(_0x3c7c5c,_0x33c775){_0x3c7c5c=_0x3c7c5c-0x0;var _0x40d9b5=_0xb68a[_0x3c7c5c];return _0x40d9b5;};'use strict';var _=require(_0xab68('0x0'));var util=require('util');var logger=require(_0xab68('0x1'))('api');var moment=require(_0xab68('0x2'));var BPromise=require(_0xab68('0x3'));var rp=require(_0xab68('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab68('0x5'));var config=require('../../config/environment');var attributes=require(_0xab68('0x6'));module['exports']=function(_0x3b5309,_0x395c65){return _0x3b5309[_0xab68('0x7')]('FaxTransferReport',attributes,{'tableName':_0xab68('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xab68('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index c4820cf..3f6c36f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad4=['error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x57baa6,_0x3af298){var _0x303fbf=function(_0x24c318){while(--_0x24c318){_0x57baa6['push'](_0x57baa6['shift']());}};_0x303fbf(++_0x3af298);}(_0x4ad4,0xcb));var _0x44ad=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x4ad4[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0x44ad('0x0'));var util=require(_0x44ad('0x1'));var moment=require(_0x44ad('0x2'));var BPromise=require('bluebird');var rs=require(_0x44ad('0x3'));var fs=require('fs');var Redis=require(_0x44ad('0x4'));var db=require(_0x44ad('0x5'))['db'];var utils=require(_0x44ad('0x6'));var logger=require(_0x44ad('0x7'))('rpc');var config=require(_0x44ad('0x8'));var jayson=require(_0x44ad('0x9'));var client=jayson[_0x44ad('0xa')][_0x44ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45376,_0x53de8c,_0x5e0c1d){return new BPromise(function(_0x27c29f,_0x79d76c){return client[_0x44ad('0xc')](_0x45376,_0x5e0c1d)[_0x44ad('0xd')](function(_0x26392b){logger['info'](_0x44ad('0xe'),_0x53de8c,'request\x20sent');logger['debug'](_0x44ad('0xf'),_0x53de8c,_0x44ad('0x10'),JSON['stringify'](_0x26392b));if(_0x26392b['error']){if(_0x26392b[_0x44ad('0x11')][_0x44ad('0x12')]===0x1f4){logger['error'](_0x44ad('0xe'),_0x53de8c,_0x26392b[_0x44ad('0x11')]['message']);return _0x79d76c(_0x26392b[_0x44ad('0x11')][_0x44ad('0x13')]);}logger[_0x44ad('0x11')](_0x44ad('0xe'),_0x53de8c,_0x26392b[_0x44ad('0x11')][_0x44ad('0x13')]);return _0x27c29f(_0x26392b[_0x44ad('0x11')][_0x44ad('0x13')]);}else{logger[_0x44ad('0x14')](_0x44ad('0xe'),_0x53de8c,_0x44ad('0x10'));_0x27c29f(_0x26392b['result'][_0x44ad('0x13')]);}})[_0x44ad('0x15')](function(_0x556589){logger[_0x44ad('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x53de8c,_0x556589);_0x79d76c(_0x556589);});});}
\ No newline at end of file
+var _0x5611=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5611,0x1a2));var _0x1561=function(_0x4d5255,_0x1eeedb){_0x4d5255=_0x4d5255-0x0;var _0x58d58c=_0x5611[_0x4d5255];return _0x58d58c;};'use strict';var _=require(_0x1561('0x0'));var util=require(_0x1561('0x1'));var moment=require(_0x1561('0x2'));var BPromise=require(_0x1561('0x3'));var rs=require(_0x1561('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1561('0x5'))['db'];var utils=require(_0x1561('0x6'));var logger=require(_0x1561('0x7'))('rpc');var config=require(_0x1561('0x8'));var jayson=require(_0x1561('0x9'));var client=jayson[_0x1561('0xa')][_0x1561('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feae8,_0x3057ca,_0x55f605){return new BPromise(function(_0xbe14bc,_0x2948f1){return client[_0x1561('0xc')](_0x1feae8,_0x55f605)['then'](function(_0x43a034){logger[_0x1561('0xd')](_0x1561('0xe'),_0x3057ca,_0x1561('0xf'));logger[_0x1561('0x10')](_0x1561('0x11'),_0x3057ca,'request\x20sent',JSON['stringify'](_0x43a034));if(_0x43a034[_0x1561('0x12')]){if(_0x43a034[_0x1561('0x12')][_0x1561('0x13')]===0x1f4){logger[_0x1561('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x3057ca,_0x43a034['error'][_0x1561('0x14')]);return _0x2948f1(_0x43a034[_0x1561('0x12')][_0x1561('0x14')]);}logger[_0x1561('0x12')](_0x1561('0xe'),_0x3057ca,_0x43a034[_0x1561('0x12')][_0x1561('0x14')]);return _0xbe14bc(_0x43a034[_0x1561('0x12')][_0x1561('0x14')]);}else{logger['info'](_0x1561('0xe'),_0x3057ca,'request\x20sent');_0xbe14bc(_0x43a034[_0x1561('0x15')][_0x1561('0x14')]);}})[_0x1561('0x16')](function(_0x54d196){logger[_0x1561('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x3057ca,_0x54d196);_0x2948f1(_0x54d196);});});}
\ No newline at end of file
index 6184584..f13889a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeafa=['put','update','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeafa,0xb6));var _0xaeaf=function(_0x45ad5d,_0x40cf14){_0x45ad5d=_0x45ad5d-0x0;var _0xe504ad=_0xeafa[_0x45ad5d];return _0xe504ad;};'use strict';var multer=require(_0xaeaf('0x0'));var util=require('util');var path=require(_0xaeaf('0x1'));var timeout=require(_0xaeaf('0x2'));var express=require('express');var router=express[_0xaeaf('0x3')]();var fs_extra=require(_0xaeaf('0x4'));var auth=require(_0xaeaf('0x5'));var interaction=require(_0xaeaf('0x6'));var config=require(_0xaeaf('0x7'));var controller=require(_0xaeaf('0x8'));router[_0xaeaf('0x9')]('/',auth[_0xaeaf('0xa')](),controller[_0xaeaf('0xb')]);router[_0xaeaf('0x9')](_0xaeaf('0xc'),auth[_0xaeaf('0xa')](),controller[_0xaeaf('0xd')]);router[_0xaeaf('0x9')](_0xaeaf('0xe'),auth[_0xaeaf('0xa')](),controller[_0xaeaf('0xf')]);router[_0xaeaf('0x10')]('/',auth[_0xaeaf('0xa')](),controller[_0xaeaf('0x11')]);router[_0xaeaf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaeaf('0x13')]);router['delete'](_0xaeaf('0xe'),auth[_0xaeaf('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x32ef=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x32ef,0x1c9));var _0xf32e=function(_0x5ba59c,_0x2c07a6){_0x5ba59c=_0x5ba59c-0x0;var _0x3de502=_0x32ef[_0x5ba59c];return _0x3de502;};'use strict';var multer=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var path=require(_0xf32e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf32e('0x3'));var router=express[_0xf32e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf32e('0x5'));var interaction=require(_0xf32e('0x6'));var config=require('../../config/environment');var controller=require(_0xf32e('0x7'));router[_0xf32e('0x8')]('/',auth[_0xf32e('0x9')](),controller['index']);router[_0xf32e('0x8')](_0xf32e('0xa'),auth[_0xf32e('0x9')](),controller[_0xf32e('0xb')]);router[_0xf32e('0x8')](_0xf32e('0xc'),auth['isAuthenticated'](),controller[_0xf32e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf32e('0xe')]);router['put'](_0xf32e('0xc'),auth[_0xf32e('0x9')](),controller[_0xf32e('0xf')]);router[_0xf32e('0x10')](_0xf32e('0xc'),auth['isAuthenticated'](),controller[_0xf32e('0x11')]);module[_0xf32e('0x12')]=router;
\ No newline at end of file
index 3e0b65b..85186aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ea=['getFields','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','show','get','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x6051d0,_0x5b5734){var _0x14d313=function(_0x248290){while(--_0x248290){_0x6051d0['push'](_0x6051d0['shift']());}};_0x14d313(++_0x5b5734);}(_0x71ea,0x98));var _0xa71e=function(_0xbc10b1,_0x175ea4){_0xbc10b1=_0xbc10b1-0x0;var _0x4f500c=_0x71ea[_0xbc10b1];return _0x4f500c;};'use strict';var multer=require(_0xa71e('0x0'));var util=require(_0xa71e('0x1'));var path=require(_0xa71e('0x2'));var timeout=require(_0xa71e('0x3'));var express=require(_0xa71e('0x4'));var router=express[_0xa71e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa71e('0x6'));var config=require(_0xa71e('0x7'));var controller=require(_0xa71e('0x8'));router['get']('/',auth[_0xa71e('0x9')](),controller[_0xa71e('0xa')]);router['get']('/:id',auth[_0xa71e('0x9')](),controller[_0xa71e('0xb')]);router[_0xa71e('0xc')](_0xa71e('0xd'),auth[_0xa71e('0x9')](),controller[_0xa71e('0xe')]);router[_0xa71e('0xc')](_0xa71e('0xf'),auth[_0xa71e('0x9')](),controller[_0xa71e('0x10')]);router[_0xa71e('0x11')]('/',auth[_0xa71e('0x9')](),controller['create']);router[_0xa71e('0x11')]('/:id/configurations',auth[_0xa71e('0x9')](),controller[_0xa71e('0x12')]);router[_0xa71e('0x13')](_0xa71e('0x14'),auth[_0xa71e('0x9')](),controller[_0xa71e('0x15')]);router[_0xa71e('0x16')]('/:id',auth[_0xa71e('0x9')](),controller['destroy']);module[_0xa71e('0x17')]=router;
\ No newline at end of file
+var _0x2074=['get','index','/:id','isAuthenticated','show','getConfigurations','post','create','/:id/configurations','addConfiguration','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x39a2b5,_0x3fdfea){var _0x453c8f=function(_0xbcad97){while(--_0xbcad97){_0x39a2b5['push'](_0x39a2b5['shift']());}};_0x453c8f(++_0x3fdfea);}(_0x2074,0x10f));var _0x4207=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2074[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x4207('0x0'));var util=require(_0x4207('0x1'));var path=require(_0x4207('0x2'));var timeout=require(_0x4207('0x3'));var express=require(_0x4207('0x4'));var router=express['Router']();var fs_extra=require(_0x4207('0x5'));var auth=require(_0x4207('0x6'));var interaction=require(_0x4207('0x7'));var config=require(_0x4207('0x8'));var controller=require('./intDeskAccount.controller');router[_0x4207('0x9')]('/',auth['isAuthenticated'](),controller[_0x4207('0xa')]);router[_0x4207('0x9')](_0x4207('0xb'),auth[_0x4207('0xc')](),controller[_0x4207('0xd')]);router[_0x4207('0x9')]('/:id/configurations',auth[_0x4207('0xc')](),controller[_0x4207('0xe')]);router[_0x4207('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x4207('0xf')]('/',auth[_0x4207('0xc')](),controller[_0x4207('0x10')]);router[_0x4207('0xf')](_0x4207('0x11'),auth[_0x4207('0xc')](),controller[_0x4207('0x12')]);router['put'](_0x4207('0xb'),auth[_0x4207('0xc')](),controller['update']);router[_0x4207('0x13')](_0x4207('0xb'),auth[_0x4207('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 44c7ce4..8ccfab3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6496=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6496,0x8c));var _0x6649=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x6496[_0x2e0ffa];return _0x24d627;};'use strict';var Sequelize=require(_0x6649('0x0'));module[_0x6649('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6649('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x6649('0x3')](_0x6649('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x6649('0x2')]},'consumerSecret':{'type':Sequelize[_0x6649('0x2')]},'token':{'type':Sequelize[_0x6649('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6649('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6649('0x3')](_0x6649('0x5'),_0x6649('0x6')),'defaultValue':_0x6649('0x5')}};
\ No newline at end of file
+var _0x3130=['STRING','basic','ENUM','integrationTab','newTab'];(function(_0x405732,_0x8e677e){var _0x27d1bd=function(_0x3f32d2){while(--_0x3f32d2){_0x405732['push'](_0x405732['shift']());}};_0x27d1bd(++_0x8e677e);}(_0x3130,0x163));var _0x0313=function(_0x500eb8,_0x351b1c){_0x500eb8=_0x500eb8-0x0;var _0x21260b=_0x3130[_0x500eb8];return _0x21260b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0313('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x0313('0x1')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0313('0x0')]},'token':{'type':Sequelize[_0x0313('0x0')]},'tokenSecret':{'type':Sequelize[_0x0313('0x0')]},'serverUrl':{'type':Sequelize[_0x0313('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x0313('0x2')](_0x0313('0x3'),_0x0313('0x4')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 4a6332b..23f5c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30ff=['test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/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','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','getConfigurations','findOne','DeskConfiguration','nolimit','AccountId','getDescriptions','channel','DeskField','getFields','priority','remoteUri','username','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','password','base64','concat','_embedded','entries','active','label'];(function(_0x20e283,_0x2b5a6e){var _0x199e10=function(_0xaccd3a){while(--_0xaccd3a){_0x20e283['push'](_0x20e283['shift']());}};_0x199e10(++_0x2b5a6e);}(_0x30ff,0x1dd));var _0xf30f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x30ff[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf30f('0x0'));var zipdir=require(_0xf30f('0x1'));var jsonpatch=require(_0xf30f('0x2'));var rp=require(_0xf30f('0x3'));var moment=require(_0xf30f('0x4'));var BPromise=require(_0xf30f('0x5'));var Mustache=require(_0xf30f('0x6'));var util=require(_0xf30f('0x7'));var path=require(_0xf30f('0x8'));var sox=require(_0xf30f('0x9'));var csv=require(_0xf30f('0xa'));var ejs=require(_0xf30f('0xb'));var fs=require('fs');var fs_extra=require(_0xf30f('0xc'));var _=require(_0xf30f('0xd'));var squel=require(_0xf30f('0xe'));var crypto=require(_0xf30f('0xf'));var jsforce=require(_0xf30f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf30f('0xa'));var querystring=require('querystring');var Papa=require(_0xf30f('0x11'));var Redis=require(_0xf30f('0x12'));var authService=require(_0xf30f('0x13'));var qs=require(_0xf30f('0x14'));var as=require(_0xf30f('0x15'));var hardwareService=require(_0xf30f('0x16'));var logger=require('../../config/logger')(_0xf30f('0x17'));var utils=require(_0xf30f('0x18'));var config=require(_0xf30f('0x19'));var licenseUtil=require(_0xf30f('0x1a'));var db=require(_0xf30f('0x1b'))['db'];var integrations=require(_0xf30f('0x1c'));function respondWithStatusCode(_0xdd2ab7,_0x1d836c){_0x1d836c=_0x1d836c||0xcc;return function(_0x2d962f){if(_0x2d962f){return _0xdd2ab7[_0xf30f('0x1d')](_0x1d836c);}return _0xdd2ab7[_0xf30f('0x1e')](_0x1d836c)[_0xf30f('0x1f')]();};}function respondWithResult(_0x490fc9,_0x16c2b4){_0x16c2b4=_0x16c2b4||0xc8;return function(_0x4b04db){if(_0x4b04db){return _0x490fc9[_0xf30f('0x1e')](_0x16c2b4)[_0xf30f('0x20')](_0x4b04db);}};}function respondWithFilteredResult(_0x17968,_0x25cdd7){return function(_0x527e3a){if(_0x527e3a){var _0x2780b6=typeof _0x25cdd7[_0xf30f('0x21')]===_0xf30f('0x22')&&typeof _0x25cdd7[_0xf30f('0x23')]===_0xf30f('0x22');var _0x23ead0=_0x527e3a['count'];var _0x5e758f=_0x2780b6?0x0:_0x25cdd7[_0xf30f('0x21')];var _0x3e4dac=_0x2780b6?_0x527e3a['count']:_0x25cdd7[_0xf30f('0x21')]+_0x25cdd7[_0xf30f('0x23')];var _0x5de3c7;if(_0x3e4dac>=_0x23ead0){_0x3e4dac=_0x23ead0;_0x5de3c7=0xc8;}else{_0x5de3c7=0xce;}_0x17968['status'](_0x5de3c7);return _0x17968['set'](_0xf30f('0x24'),_0x5e758f+'-'+_0x3e4dac+'/'+_0x23ead0)[_0xf30f('0x20')](_0x527e3a);}return null;};}function patchUpdates(_0x133f0f){return function(_0x3e8c0c){try{jsonpatch[_0xf30f('0x25')](_0x3e8c0c,_0x133f0f,!![]);}catch(_0x41e23f){return BPromise[_0xf30f('0x26')](_0x41e23f);}return _0x3e8c0c[_0xf30f('0x27')]();};}function saveUpdates(_0x5126f7,_0x264a09){return function(_0x1003c0){if(_0x1003c0){return _0x1003c0[_0xf30f('0x28')](_0x5126f7)[_0xf30f('0x29')](function(_0x45924d){return _0x45924d;});}return null;};}function removeEntity(_0x3dd2b1,_0x33d875){return function(_0x368fc3){if(_0x368fc3){return _0x368fc3[_0xf30f('0x2a')]()['then'](function(){_0x3dd2b1[_0xf30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d8c4f,_0x1052f6){return function(_0x499c3f){if(!_0x499c3f){_0x1d8c4f[_0xf30f('0x1d')](0x194);}return _0x499c3f;};}function handleError(_0x57602f,_0x34842d){_0x34842d=_0x34842d||0x1f4;return function(_0x5097cf){logger['error'](_0x5097cf[_0xf30f('0x2b')]);if(_0x5097cf['name']){delete _0x5097cf[_0xf30f('0x2c')];}_0x57602f[_0xf30f('0x1e')](_0x34842d)['send'](_0x5097cf);};}exports[_0xf30f('0x2d')]=function(_0xcfe176,_0x53be95){var _0x1d2e8e={},_0x5d8e58={},_0x297733={'count':0x0,'rows':[]};var _0x49668b=_[_0xf30f('0x2e')](db[_0xf30f('0x2f')][_0xf30f('0x30')],function(_0x5fb67d){return{'name':_0x5fb67d[_0xf30f('0x31')],'type':_0x5fb67d[_0xf30f('0x32')][_0xf30f('0x33')]};});_0x5d8e58[_0xf30f('0x34')]=_[_0xf30f('0x2e')](_0x49668b,_0xf30f('0x2c'));_0x5d8e58['query']=_[_0xf30f('0x35')](_0xcfe176[_0xf30f('0x36')]);_0x5d8e58[_0xf30f('0x37')]=_['intersection'](_0x5d8e58[_0xf30f('0x34')],_0x5d8e58[_0xf30f('0x36')]);_0x1d2e8e[_0xf30f('0x38')]=_[_0xf30f('0x39')](_0x5d8e58[_0xf30f('0x34')],qs['fields'](_0xcfe176[_0xf30f('0x36')][_0xf30f('0x3a')]));_0x1d2e8e['attributes']=_0x1d2e8e[_0xf30f('0x38')][_0xf30f('0x3b')]?_0x1d2e8e[_0xf30f('0x38')]:_0x5d8e58[_0xf30f('0x34')];if(!_0xcfe176[_0xf30f('0x36')][_0xf30f('0x3c')]('nolimit')){_0x1d2e8e[_0xf30f('0x23')]=qs['limit'](_0xcfe176[_0xf30f('0x36')][_0xf30f('0x23')]);_0x1d2e8e['offset']=qs[_0xf30f('0x21')](_0xcfe176[_0xf30f('0x36')][_0xf30f('0x21')]);}_0x1d2e8e[_0xf30f('0x3d')]=qs[_0xf30f('0x3e')](_0xcfe176[_0xf30f('0x36')][_0xf30f('0x3e')]);_0x1d2e8e[_0xf30f('0x3f')]=qs[_0xf30f('0x37')](_[_0xf30f('0x40')](_0xcfe176['query'],_0x5d8e58[_0xf30f('0x37')]),_0x49668b);if(_0xcfe176['query'][_0xf30f('0x41')]){_0x1d2e8e['where']=_['merge'](_0x1d2e8e[_0xf30f('0x3f')],{'$or':_[_0xf30f('0x2e')](_0x49668b,function(_0x1aa7ea){if(_0x1aa7ea[_0xf30f('0x32')]!==_0xf30f('0x42')){var _0x4bfb46={};_0x4bfb46[_0x1aa7ea[_0xf30f('0x2c')]]={'$like':'%'+_0xcfe176[_0xf30f('0x36')][_0xf30f('0x41')]+'%'};return _0x4bfb46;}})});}_0x1d2e8e=_[_0xf30f('0x43')]({},_0x1d2e8e,_0xcfe176[_0xf30f('0x44')]);var _0x3bcbeb={'where':_0x1d2e8e[_0xf30f('0x3f')]};return db[_0xf30f('0x2f')][_0xf30f('0x45')](_0x3bcbeb)[_0xf30f('0x29')](function(_0x41337d){_0x297733[_0xf30f('0x45')]=_0x41337d;if(_0xcfe176['query']['includeAll']){_0x1d2e8e[_0xf30f('0x46')]=[{'all':!![]}];}return db[_0xf30f('0x2f')][_0xf30f('0x47')](_0x1d2e8e);})[_0xf30f('0x29')](function(_0x1af65e){_0x297733[_0xf30f('0x48')]=_0x1af65e;return _0x297733;})['then'](respondWithFilteredResult(_0x53be95,_0x1d2e8e))[_0xf30f('0x49')](handleError(_0x53be95,null));};exports['show']=function(_0x5ad981,_0x5003a1){var _0x41a8f5={'raw':![],'where':{'id':_0x5ad981[_0xf30f('0x4a')]['id']}},_0x3dad7b={};_0x3dad7b[_0xf30f('0x34')]=_[_0xf30f('0x35')](db[_0xf30f('0x2f')][_0xf30f('0x30')]);_0x3dad7b[_0xf30f('0x36')]=_[_0xf30f('0x35')](_0x5ad981[_0xf30f('0x36')]);_0x3dad7b[_0xf30f('0x37')]=_['intersection'](_0x3dad7b[_0xf30f('0x34')],_0x3dad7b[_0xf30f('0x36')]);_0x41a8f5[_0xf30f('0x38')]=_[_0xf30f('0x39')](_0x3dad7b[_0xf30f('0x34')],qs['fields'](_0x5ad981[_0xf30f('0x36')][_0xf30f('0x3a')]));_0x41a8f5[_0xf30f('0x38')]=_0x41a8f5[_0xf30f('0x38')][_0xf30f('0x3b')]?_0x41a8f5[_0xf30f('0x38')]:_0x3dad7b['model'];if(_0x5ad981[_0xf30f('0x36')][_0xf30f('0x4b')]){_0x41a8f5[_0xf30f('0x46')]=[{'all':!![]}];}_0x41a8f5=_['merge']({},_0x41a8f5,_0x5ad981['options']);return db[_0xf30f('0x2f')][_0xf30f('0x4c')](_0x41a8f5)[_0xf30f('0x29')](handleEntityNotFound(_0x5003a1,null))[_0xf30f('0x29')](respondWithResult(_0x5003a1,null))[_0xf30f('0x49')](handleError(_0x5003a1,null));};exports['create']=function(_0x56c6e8,_0xaacf14){return db[_0xf30f('0x2f')][_0xf30f('0x4d')](_0x56c6e8[_0xf30f('0x4e')],{})['then'](respondWithResult(_0xaacf14,0xc9))[_0xf30f('0x49')](handleError(_0xaacf14,null));};exports[_0xf30f('0x28')]=function(_0x1e2a4b,_0x487c84){if(_0x1e2a4b[_0xf30f('0x4e')]['id']){delete _0x1e2a4b['body']['id'];}return db['DeskAccount'][_0xf30f('0x4c')]({'where':{'id':_0x1e2a4b[_0xf30f('0x4a')]['id']}})[_0xf30f('0x29')](handleEntityNotFound(_0x487c84,null))[_0xf30f('0x29')](saveUpdates(_0x1e2a4b['body'],null))[_0xf30f('0x29')](respondWithResult(_0x487c84,null))[_0xf30f('0x49')](handleError(_0x487c84,null));};exports[_0xf30f('0x2a')]=function(_0x5a553a,_0x2a5852){return db['DeskAccount']['find']({'where':{'id':_0x5a553a['params']['id']}})[_0xf30f('0x29')](handleEntityNotFound(_0x2a5852,null))[_0xf30f('0x29')](removeEntity(_0x2a5852,null))[_0xf30f('0x49')](handleError(_0x2a5852,null));};exports[_0xf30f('0x4f')]=function(_0x55589b,_0x1150a2,_0x1523fd){var _0xe5d76c={};var _0xe045ab={};var _0x1cc7d7;var _0x5ab686;return db[_0xf30f('0x2f')][_0xf30f('0x50')]({'where':{'id':_0x55589b[_0xf30f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1150a2,null))[_0xf30f('0x29')](function(_0x41f2b1){if(_0x41f2b1){_0x1cc7d7=_0x41f2b1;_0xe045ab[_0xf30f('0x34')]=_['keys'](db[_0xf30f('0x51')]['rawAttributes']);_0xe045ab['query']=_[_0xf30f('0x35')](_0x55589b[_0xf30f('0x36')]);_0xe045ab[_0xf30f('0x37')]=_[_0xf30f('0x39')](_0xe045ab[_0xf30f('0x34')],_0xe045ab[_0xf30f('0x36')]);_0xe5d76c['attributes']=_[_0xf30f('0x39')](_0xe045ab[_0xf30f('0x34')],qs[_0xf30f('0x3a')](_0x55589b[_0xf30f('0x36')]['fields']));_0xe5d76c[_0xf30f('0x38')]=_0xe5d76c[_0xf30f('0x38')][_0xf30f('0x3b')]?_0xe5d76c['attributes']:_0xe045ab[_0xf30f('0x34')];_0xe5d76c[_0xf30f('0x3d')]=qs[_0xf30f('0x3e')](_0x55589b['query']['sort']);_0xe5d76c[_0xf30f('0x3f')]=qs[_0xf30f('0x37')](_[_0xf30f('0x40')](_0x55589b[_0xf30f('0x36')],_0xe045ab[_0xf30f('0x37')]));if(_0x55589b[_0xf30f('0x36')][_0xf30f('0x41')]){_0xe5d76c['where']=_[_0xf30f('0x43')](_0xe5d76c[_0xf30f('0x3f')],{'$or':_[_0xf30f('0x2e')](_0xe5d76c[_0xf30f('0x38')],function(_0xeb150){var _0x2ee231={};_0x2ee231[_0xeb150]={'$like':'%'+_0x55589b[_0xf30f('0x36')]['filter']+'%'};return _0x2ee231;})});}_0xe5d76c=_['merge']({},_0xe5d76c,_0x55589b[_0xf30f('0x44')]);return _0x1cc7d7['getConfigurations'](_0xe5d76c);}})[_0xf30f('0x29')](function(_0x18b9e7){if(_0x18b9e7){_0x5ab686=_0x18b9e7['length'];if(!_0x55589b[_0xf30f('0x36')]['hasOwnProperty'](_0xf30f('0x52'))){_0xe5d76c['limit']=qs[_0xf30f('0x23')](_0x55589b[_0xf30f('0x36')][_0xf30f('0x23')]);_0xe5d76c['offset']=qs[_0xf30f('0x21')](_0x55589b[_0xf30f('0x36')][_0xf30f('0x21')]);}return _0x1cc7d7[_0xf30f('0x4f')](_0xe5d76c);}})['then'](function(_0x137566){if(_0x137566){return _0x137566?{'count':_0x5ab686,'rows':_0x137566}:null;}})[_0xf30f('0x29')](respondWithResult(_0x1150a2,null))[_0xf30f('0x49')](handleError(_0x1150a2,null));};exports['addConfiguration']=function(_0x485e35,_0x1ecc4a,_0x390585){if(_0x485e35['body']['id']){delete _0x485e35[_0xf30f('0x4e')]['id'];}return db[_0xf30f('0x2f')][_0xf30f('0x50')]({'where':{'id':_0x485e35[_0xf30f('0x4a')]['id']}})[_0xf30f('0x29')](handleEntityNotFound(_0x1ecc4a,null))[_0xf30f('0x29')](function(_0x3a6369){if(_0x3a6369){_0x485e35[_0xf30f('0x4e')][_0xf30f('0x53')]=_0x3a6369['id'];_0x485e35[_0xf30f('0x4e')]['Subjects']=integrations['getSubjects'](_0x485e35[_0xf30f('0x4e')]['channel'],_0x485e35[_0xf30f('0x4e')][_0xf30f('0x32')]);_0x485e35[_0xf30f('0x4e')]['Descriptions']=integrations[_0xf30f('0x54')](_0x485e35['body'][_0xf30f('0x55')],_0x485e35['body'][_0xf30f('0x32')]);return db[_0xf30f('0x51')][_0xf30f('0x4d')](_0x485e35[_0xf30f('0x4e')],{'include':[{'model':db[_0xf30f('0x56')],'as':'Subjects'},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xf30f('0x29')](respondWithResult(_0x1ecc4a,null))['catch'](handleError(_0x1ecc4a,null));};exports[_0xf30f('0x57')]=function(_0x32cb44,_0x14e067,_0x30d1ae){var _0x151e27=[{'name':'priority','label':_0xf30f('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x40ac2b='';return db['DeskAccount'][_0xf30f('0x50')]({'where':{'id':_0x32cb44[_0xf30f('0x4a')]['id']},'attributes':['id',_0xf30f('0x59'),'authType',_0xf30f('0x5a'),'password',_0xf30f('0x5b'),_0xf30f('0x5c'),_0xf30f('0x5d'),'tokenSecret']})['then'](handleEntityNotFound(_0x14e067,null))['then'](function(_0xe55c0a){if(_0xe55c0a){_0x40ac2b=_0xe55c0a[_0xf30f('0x59')];var _0x3cf8b0=_0x40ac2b[_0xf30f('0x5e')](-0x1);if(_0x3cf8b0==='/'){_0x40ac2b=_0x40ac2b[_0xf30f('0x5f')](0x0,_0x40ac2b[_0xf30f('0x60')](_0x3cf8b0));}var _0x2a47b0={'method':_0xf30f('0x61'),'uri':util['format'](_0xf30f('0x62'),_0x40ac2b),'headers':{'Content-Type':_0xf30f('0x63'),'Accept':_0xf30f('0x63')},'json':!![]};if(_0xe55c0a['authType']===_0xf30f('0x64')){_0x2a47b0[_0xf30f('0x65')][_0xf30f('0x66')]=util[_0xf30f('0x67')](_0xf30f('0x68'),new Buffer(util[_0xf30f('0x67')](_0xf30f('0x69'),_0xe55c0a[_0xf30f('0x5a')],_0xe55c0a[_0xf30f('0x6a')]))['toString'](_0xf30f('0x6b')));}return rp(_0x2a47b0)['then'](function(_0x184841){return _0x151e27[_0xf30f('0x6c')](_[_0xf30f('0x2e')](_0x184841[_0xf30f('0x6d')][_0xf30f('0x6e')],function(_0x58d356){return{'id':_0x58d356[_0xf30f('0x2c')],'name':_0x58d356[_0xf30f('0x2c')],'type':_0x58d356[_0xf30f('0x32')],'active':_0x58d356[_0xf30f('0x6f')],'label':_0x58d356[_0xf30f('0x70')],'custom':!![]};}));});}})[_0xf30f('0x29')](function(_0x4402d6){return{'count':_0x4402d6[_0xf30f('0x3b')],'rows':_0x4402d6};})[_0xf30f('0x29')](respondWithResult(_0x14e067,null))['catch'](function(_0xb88021){var _0xf4daa4=_0x32cb44[_0xf30f('0x36')][_0xf30f('0x71')]?0x1f4:_0xb88021[_0xf30f('0x72')]||0x1f4;logger['error'](_0xf30f('0x73'),'getFields',_0xf4daa4,JSON['stringify'](_0xb88021));delete _0xb88021[_0xf30f('0x2c')];if(_0xf4daa4===0x191){_0xf4daa4=0x190;}_0x14e067[_0xf30f('0x1e')](_0xf4daa4)[_0xf30f('0x74')](_0x32cb44[_0xf30f('0x36')]['test']?{'message':_0xf30f('0x75'),'statusCode':_0xb88021[_0xf30f('0x72')]}:_0xb88021);});};
\ No newline at end of file
+var _0x0488=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','toString','base64','concat','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x0488,0x159));var _0x8048=function(_0x1ba99b,_0x128fc0){_0x1ba99b=_0x1ba99b-0x0;var _0x48f741=_0x0488[_0x1ba99b];return _0x48f741;};'use strict';var emlformat=require(_0x8048('0x0'));var rimraf=require(_0x8048('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8048('0x2'));var rp=require(_0x8048('0x3'));var moment=require(_0x8048('0x4'));var BPromise=require(_0x8048('0x5'));var Mustache=require(_0x8048('0x6'));var util=require(_0x8048('0x7'));var path=require(_0x8048('0x8'));var sox=require(_0x8048('0x9'));var csv=require(_0x8048('0xa'));var ejs=require(_0x8048('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8048('0xc'));var squel=require(_0x8048('0xd'));var crypto=require(_0x8048('0xe'));var jsforce=require(_0x8048('0xf'));var deskjs=require(_0x8048('0x10'));var toCsv=require(_0x8048('0xa'));var querystring=require(_0x8048('0x11'));var Papa=require(_0x8048('0x12'));var Redis=require(_0x8048('0x13'));var authService=require(_0x8048('0x14'));var qs=require(_0x8048('0x15'));var as=require(_0x8048('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8048('0x17'))(_0x8048('0x18'));var utils=require('../../config/utils');var config=require(_0x8048('0x19'));var licenseUtil=require(_0x8048('0x1a'));var db=require(_0x8048('0x1b'))['db'];var integrations=require(_0x8048('0x1c'));function respondWithStatusCode(_0x5c92d7,_0x12bf57){_0x12bf57=_0x12bf57||0xcc;return function(_0x9b8f16){if(_0x9b8f16){return _0x5c92d7['sendStatus'](_0x12bf57);}return _0x5c92d7[_0x8048('0x1d')](_0x12bf57)[_0x8048('0x1e')]();};}function respondWithResult(_0x3c6f25,_0x160ebf){_0x160ebf=_0x160ebf||0xc8;return function(_0x346db7){if(_0x346db7){return _0x3c6f25[_0x8048('0x1d')](_0x160ebf)[_0x8048('0x1f')](_0x346db7);}};}function respondWithFilteredResult(_0x3c1810,_0x33e104){return function(_0xc8d69c){if(_0xc8d69c){var _0x160420=typeof _0x33e104['offset']==='undefined'&&typeof _0x33e104[_0x8048('0x20')]==='undefined';var _0x2de85d=_0xc8d69c[_0x8048('0x21')];var _0x115270=_0x160420?0x0:_0x33e104[_0x8048('0x22')];var _0x1beef5=_0x160420?_0xc8d69c['count']:_0x33e104[_0x8048('0x22')]+_0x33e104[_0x8048('0x20')];var _0x536ab0;if(_0x1beef5>=_0x2de85d){_0x1beef5=_0x2de85d;_0x536ab0=0xc8;}else{_0x536ab0=0xce;}_0x3c1810[_0x8048('0x1d')](_0x536ab0);return _0x3c1810[_0x8048('0x23')](_0x8048('0x24'),_0x115270+'-'+_0x1beef5+'/'+_0x2de85d)[_0x8048('0x1f')](_0xc8d69c);}return null;};}function patchUpdates(_0x5a939b){return function(_0x50debb){try{jsonpatch[_0x8048('0x25')](_0x50debb,_0x5a939b,!![]);}catch(_0x32efee){return BPromise[_0x8048('0x26')](_0x32efee);}return _0x50debb[_0x8048('0x27')]();};}function saveUpdates(_0x1faa74,_0x8f8d53){return function(_0x5704be){if(_0x5704be){return _0x5704be[_0x8048('0x28')](_0x1faa74)['then'](function(_0x30dddf){return _0x30dddf;});}return null;};}function removeEntity(_0x2f124b,_0x50ad0c){return function(_0x4508a3){if(_0x4508a3){return _0x4508a3[_0x8048('0x29')]()[_0x8048('0x2a')](function(){_0x2f124b[_0x8048('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe05a79,_0x165f47){return function(_0x5b2f8b){if(!_0x5b2f8b){_0xe05a79[_0x8048('0x2b')](0x194);}return _0x5b2f8b;};}function handleError(_0x35a6c5,_0x337879){_0x337879=_0x337879||0x1f4;return function(_0xfea3c){logger[_0x8048('0x2c')](_0xfea3c['stack']);if(_0xfea3c[_0x8048('0x2d')]){delete _0xfea3c[_0x8048('0x2d')];}_0x35a6c5[_0x8048('0x1d')](_0x337879)['send'](_0xfea3c);};}exports[_0x8048('0x2e')]=function(_0xe3eee8,_0x26be21){var _0x50efa5={},_0x3f076f={},_0x2d12b6={'count':0x0,'rows':[]};var _0x4a7382=_[_0x8048('0x2f')](db[_0x8048('0x30')][_0x8048('0x31')],function(_0x177a8b){return{'name':_0x177a8b[_0x8048('0x32')],'type':_0x177a8b[_0x8048('0x33')][_0x8048('0x34')]};});_0x3f076f['model']=_[_0x8048('0x2f')](_0x4a7382,_0x8048('0x2d'));_0x3f076f[_0x8048('0x35')]=_[_0x8048('0x36')](_0xe3eee8[_0x8048('0x35')]);_0x3f076f[_0x8048('0x37')]=_[_0x8048('0x38')](_0x3f076f[_0x8048('0x39')],_0x3f076f[_0x8048('0x35')]);_0x50efa5[_0x8048('0x3a')]=_[_0x8048('0x38')](_0x3f076f['model'],qs[_0x8048('0x3b')](_0xe3eee8[_0x8048('0x35')]['fields']));_0x50efa5[_0x8048('0x3a')]=_0x50efa5[_0x8048('0x3a')][_0x8048('0x3c')]?_0x50efa5[_0x8048('0x3a')]:_0x3f076f[_0x8048('0x39')];if(!_0xe3eee8[_0x8048('0x35')][_0x8048('0x3d')](_0x8048('0x3e'))){_0x50efa5[_0x8048('0x20')]=qs[_0x8048('0x20')](_0xe3eee8['query'][_0x8048('0x20')]);_0x50efa5[_0x8048('0x22')]=qs['offset'](_0xe3eee8['query'][_0x8048('0x22')]);}_0x50efa5[_0x8048('0x3f')]=qs[_0x8048('0x40')](_0xe3eee8[_0x8048('0x35')][_0x8048('0x40')]);_0x50efa5[_0x8048('0x41')]=qs['filters'](_[_0x8048('0x42')](_0xe3eee8[_0x8048('0x35')],_0x3f076f['filters']),_0x4a7382);if(_0xe3eee8['query'][_0x8048('0x43')]){_0x50efa5['where']=_[_0x8048('0x44')](_0x50efa5[_0x8048('0x41')],{'$or':_[_0x8048('0x2f')](_0x4a7382,function(_0x144610){if(_0x144610[_0x8048('0x33')]!==_0x8048('0x45')){var _0x197162={};_0x197162[_0x144610[_0x8048('0x2d')]]={'$like':'%'+_0xe3eee8[_0x8048('0x35')][_0x8048('0x43')]+'%'};return _0x197162;}})});}_0x50efa5=_[_0x8048('0x44')]({},_0x50efa5,_0xe3eee8['options']);var _0x3f0f71={'where':_0x50efa5[_0x8048('0x41')]};return db[_0x8048('0x30')][_0x8048('0x21')](_0x3f0f71)[_0x8048('0x2a')](function(_0x1cbaee){_0x2d12b6[_0x8048('0x21')]=_0x1cbaee;if(_0xe3eee8['query'][_0x8048('0x46')]){_0x50efa5['include']=[{'all':!![]}];}return db[_0x8048('0x30')]['findAll'](_0x50efa5);})[_0x8048('0x2a')](function(_0x4c692f){_0x2d12b6[_0x8048('0x47')]=_0x4c692f;return _0x2d12b6;})[_0x8048('0x2a')](respondWithFilteredResult(_0x26be21,_0x50efa5))[_0x8048('0x48')](handleError(_0x26be21,null));};exports[_0x8048('0x49')]=function(_0x3dbb0e,_0x3d6950){var _0x149f17={'raw':![],'where':{'id':_0x3dbb0e[_0x8048('0x4a')]['id']}},_0x37030a={};_0x37030a[_0x8048('0x39')]=_['keys'](db['DeskAccount'][_0x8048('0x31')]);_0x37030a[_0x8048('0x35')]=_['keys'](_0x3dbb0e[_0x8048('0x35')]);_0x37030a['filters']=_[_0x8048('0x38')](_0x37030a['model'],_0x37030a[_0x8048('0x35')]);_0x149f17['attributes']=_[_0x8048('0x38')](_0x37030a['model'],qs[_0x8048('0x3b')](_0x3dbb0e[_0x8048('0x35')][_0x8048('0x3b')]));_0x149f17[_0x8048('0x3a')]=_0x149f17[_0x8048('0x3a')][_0x8048('0x3c')]?_0x149f17['attributes']:_0x37030a[_0x8048('0x39')];if(_0x3dbb0e[_0x8048('0x35')]['includeAll']){_0x149f17[_0x8048('0x4b')]=[{'all':!![]}];}_0x149f17=_[_0x8048('0x44')]({},_0x149f17,_0x3dbb0e[_0x8048('0x4c')]);return db[_0x8048('0x30')][_0x8048('0x4d')](_0x149f17)['then'](handleEntityNotFound(_0x3d6950,null))['then'](respondWithResult(_0x3d6950,null))[_0x8048('0x48')](handleError(_0x3d6950,null));};exports['create']=function(_0x3c1d7a,_0x96f34){return db[_0x8048('0x30')][_0x8048('0x4e')](_0x3c1d7a[_0x8048('0x4f')],{})[_0x8048('0x2a')](respondWithResult(_0x96f34,0xc9))[_0x8048('0x48')](handleError(_0x96f34,null));};exports[_0x8048('0x28')]=function(_0x5c218c,_0x21d92e){if(_0x5c218c[_0x8048('0x4f')]['id']){delete _0x5c218c[_0x8048('0x4f')]['id'];}return db[_0x8048('0x30')][_0x8048('0x4d')]({'where':{'id':_0x5c218c[_0x8048('0x4a')]['id']}})[_0x8048('0x2a')](handleEntityNotFound(_0x21d92e,null))[_0x8048('0x2a')](saveUpdates(_0x5c218c[_0x8048('0x4f')],null))['then'](respondWithResult(_0x21d92e,null))[_0x8048('0x48')](handleError(_0x21d92e,null));};exports['destroy']=function(_0x56aff7,_0x153360){return db[_0x8048('0x30')][_0x8048('0x4d')]({'where':{'id':_0x56aff7['params']['id']}})[_0x8048('0x2a')](handleEntityNotFound(_0x153360,null))[_0x8048('0x2a')](removeEntity(_0x153360,null))[_0x8048('0x48')](handleError(_0x153360,null));};exports[_0x8048('0x50')]=function(_0x437c3f,_0x3b431c,_0x4f34bb){var _0x522b81={};var _0x278b9b={};var _0x43e490;var _0x81dab0;return db[_0x8048('0x30')][_0x8048('0x51')]({'where':{'id':_0x437c3f[_0x8048('0x4a')]['id']}})[_0x8048('0x2a')](handleEntityNotFound(_0x3b431c,null))[_0x8048('0x2a')](function(_0x4aa521){if(_0x4aa521){_0x43e490=_0x4aa521;_0x278b9b[_0x8048('0x39')]=_[_0x8048('0x36')](db[_0x8048('0x52')][_0x8048('0x31')]);_0x278b9b[_0x8048('0x35')]=_[_0x8048('0x36')](_0x437c3f['query']);_0x278b9b[_0x8048('0x37')]=_['intersection'](_0x278b9b[_0x8048('0x39')],_0x278b9b[_0x8048('0x35')]);_0x522b81[_0x8048('0x3a')]=_[_0x8048('0x38')](_0x278b9b[_0x8048('0x39')],qs[_0x8048('0x3b')](_0x437c3f[_0x8048('0x35')]['fields']));_0x522b81['attributes']=_0x522b81[_0x8048('0x3a')]['length']?_0x522b81[_0x8048('0x3a')]:_0x278b9b['model'];_0x522b81['order']=qs[_0x8048('0x40')](_0x437c3f[_0x8048('0x35')]['sort']);_0x522b81[_0x8048('0x41')]=qs[_0x8048('0x37')](_['pick'](_0x437c3f[_0x8048('0x35')],_0x278b9b[_0x8048('0x37')]));if(_0x437c3f[_0x8048('0x35')][_0x8048('0x43')]){_0x522b81[_0x8048('0x41')]=_['merge'](_0x522b81[_0x8048('0x41')],{'$or':_[_0x8048('0x2f')](_0x522b81[_0x8048('0x3a')],function(_0x3a9b03){var _0x5f010a={};_0x5f010a[_0x3a9b03]={'$like':'%'+_0x437c3f['query'][_0x8048('0x43')]+'%'};return _0x5f010a;})});}_0x522b81=_['merge']({},_0x522b81,_0x437c3f['options']);return _0x43e490[_0x8048('0x50')](_0x522b81);}})[_0x8048('0x2a')](function(_0x693d1c){if(_0x693d1c){_0x81dab0=_0x693d1c['length'];if(!_0x437c3f['query']['hasOwnProperty'](_0x8048('0x3e'))){_0x522b81[_0x8048('0x20')]=qs[_0x8048('0x20')](_0x437c3f[_0x8048('0x35')][_0x8048('0x20')]);_0x522b81['offset']=qs[_0x8048('0x22')](_0x437c3f[_0x8048('0x35')][_0x8048('0x22')]);}return _0x43e490[_0x8048('0x50')](_0x522b81);}})[_0x8048('0x2a')](function(_0x50db61){if(_0x50db61){return _0x50db61?{'count':_0x81dab0,'rows':_0x50db61}:null;}})[_0x8048('0x2a')](respondWithResult(_0x3b431c,null))[_0x8048('0x48')](handleError(_0x3b431c,null));};exports[_0x8048('0x53')]=function(_0xf0e579,_0x4be3c7,_0x3163cc){if(_0xf0e579['body']['id']){delete _0xf0e579[_0x8048('0x4f')]['id'];}return db[_0x8048('0x30')][_0x8048('0x51')]({'where':{'id':_0xf0e579[_0x8048('0x4a')]['id']}})[_0x8048('0x2a')](handleEntityNotFound(_0x4be3c7,null))[_0x8048('0x2a')](function(_0x3a2e75){if(_0x3a2e75){_0xf0e579['body'][_0x8048('0x54')]=_0x3a2e75['id'];_0xf0e579[_0x8048('0x4f')][_0x8048('0x55')]=integrations[_0x8048('0x56')](_0xf0e579[_0x8048('0x4f')][_0x8048('0x57')],_0xf0e579[_0x8048('0x4f')]['type']);_0xf0e579[_0x8048('0x4f')][_0x8048('0x58')]=integrations['getDescriptions'](_0xf0e579[_0x8048('0x4f')][_0x8048('0x57')],_0xf0e579['body'][_0x8048('0x33')]);return db['DeskConfiguration'][_0x8048('0x4e')](_0xf0e579[_0x8048('0x4f')],{'include':[{'model':db[_0x8048('0x59')],'as':_0x8048('0x55')},{'model':db[_0x8048('0x59')],'as':'Descriptions'}]});}return null;})[_0x8048('0x2a')](respondWithResult(_0x4be3c7,null))[_0x8048('0x48')](handleError(_0x4be3c7,null));};exports[_0x8048('0x5a')]=function(_0x5b1f79,_0x231ab4,_0x40d327){var _0x4cb349=[{'name':_0x8048('0x5b'),'label':_0x8048('0x5b'),'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 _0x2ebcda='';return db[_0x8048('0x30')][_0x8048('0x51')]({'where':{'id':_0x5b1f79[_0x8048('0x4a')]['id']},'attributes':['id',_0x8048('0x5c'),_0x8048('0x5d'),_0x8048('0x5e'),_0x8048('0x5f'),'consumerKey','consumerSecret',_0x8048('0x60'),_0x8048('0x61')]})['then'](handleEntityNotFound(_0x231ab4,null))['then'](function(_0xa875eb){if(_0xa875eb){_0x2ebcda=_0xa875eb['remoteUri'];var _0x31185e=_0x2ebcda[_0x8048('0x62')](-0x1);if(_0x31185e==='/'){_0x2ebcda=_0x2ebcda[_0x8048('0x63')](0x0,_0x2ebcda[_0x8048('0x64')](_0x31185e));}var _0x13b47d={'method':_0x8048('0x65'),'uri':util[_0x8048('0x66')](_0x8048('0x67'),_0x2ebcda),'headers':{'Content-Type':'application/json','Accept':_0x8048('0x68')},'json':!![]};if(_0xa875eb[_0x8048('0x5d')]==='basic'){_0x13b47d[_0x8048('0x69')][_0x8048('0x6a')]=util[_0x8048('0x66')](_0x8048('0x6b'),new Buffer(util[_0x8048('0x66')]('%s:%s',_0xa875eb[_0x8048('0x5e')],_0xa875eb[_0x8048('0x5f')]))[_0x8048('0x6c')](_0x8048('0x6d')));}return rp(_0x13b47d)[_0x8048('0x2a')](function(_0x23f454){return _0x4cb349[_0x8048('0x6e')](_[_0x8048('0x2f')](_0x23f454['_embedded']['entries'],function(_0x296a25){return{'id':_0x296a25[_0x8048('0x2d')],'name':_0x296a25[_0x8048('0x2d')],'type':_0x296a25[_0x8048('0x33')],'active':_0x296a25[_0x8048('0x6f')],'label':_0x296a25[_0x8048('0x70')],'custom':!![]};}));});}})[_0x8048('0x2a')](function(_0x20c823){return{'count':_0x20c823['length'],'rows':_0x20c823};})[_0x8048('0x2a')](respondWithResult(_0x231ab4,null))[_0x8048('0x48')](function(_0x48ec3){var _0x497550=_0x5b1f79[_0x8048('0x35')][_0x8048('0x71')]?0x1f4:_0x48ec3[_0x8048('0x72')]||0x1f4;logger[_0x8048('0x2c')](_0x8048('0x73'),'getFields',_0x497550,JSON[_0x8048('0x74')](_0x48ec3));delete _0x48ec3[_0x8048('0x2d')];if(_0x497550===0x191){_0x497550=0x190;}_0x231ab4[_0x8048('0x1d')](_0x497550)[_0x8048('0x75')](_0x5b1f79[_0x8048('0x35')]['test']?{'message':_0x8048('0x76'),'statusCode':_0x48ec3['statusCode']}:_0x48ec3);});};
\ No newline at end of file
index 74735fe..20e5826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049e=['path','rimraf','../../config/environment','./intDeskAccount.attributes','define','int_desk_accounts','lodash','../../config/logger','moment','bluebird'];(function(_0x4aa7b8,_0xc69b67){var _0x310986=function(_0x1d18e7){while(--_0x1d18e7){_0x4aa7b8['push'](_0x4aa7b8['shift']());}};_0x310986(++_0xc69b67);}(_0x049e,0xce));var _0xe049=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x049e[_0x352d28];return _0x387d7e;};'use strict';var _=require(_0xe049('0x0'));var util=require('util');var logger=require(_0xe049('0x1'))('api');var moment=require(_0xe049('0x2'));var BPromise=require(_0xe049('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe049('0x4'));var rimraf=require(_0xe049('0x5'));var config=require(_0xe049('0x6'));var attributes=require(_0xe049('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x35f72d,_0x44c523){return _0x35f72d[_0xe049('0x8')]('DeskAccount',attributes,{'tableName':_0xe049('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4872=['int_desk_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x135835,_0x200526){var _0x2ee790=function(_0x486dd2){while(--_0x486dd2){_0x135835['push'](_0x135835['shift']());}};_0x2ee790(++_0x200526);}(_0x4872,0x187));var _0x2487=function(_0x551926,_0x201309){_0x551926=_0x551926-0x0;var _0x5350ad=_0x4872[_0x551926];return _0x5350ad;};'use strict';var _=require(_0x2487('0x0'));var util=require(_0x2487('0x1'));var logger=require(_0x2487('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2487('0x3'));var rp=require(_0x2487('0x4'));var fs=require('fs');var path=require(_0x2487('0x5'));var rimraf=require(_0x2487('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x2487('0x7')]=function(_0x12a22d,_0x458fb3){return _0x12a22d[_0x2487('0x8')]('DeskAccount',attributes,{'tableName':_0x2487('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e805d5a..e19e0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe866=['find','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','findAll','raw','options','where','attributes','limit','model','include','map','then','GetDeskAccount','ShowDeskAccount','DeskAccount'];(function(_0x5900e8,_0x424021){var _0x5e1cb0=function(_0x887bbd){while(--_0x887bbd){_0x5900e8['push'](_0x5900e8['shift']());}};_0x5e1cb0(++_0x424021);}(_0xe866,0x6b));var _0x6e86=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe866[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x6e86('0x0'));var moment=require(_0x6e86('0x1'));var BPromise=require(_0x6e86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e86('0x3'));var db=require(_0x6e86('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e86('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e86('0x6'));var client=jayson[_0x6e86('0x7')][_0x6e86('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4af6a2,_0x13b0a2,_0x2405f8){return new BPromise(function(_0xb1b144,_0x57ab07){return client[_0x6e86('0x9')](_0x4af6a2,_0x2405f8)['then'](function(_0x5ba332){logger[_0x6e86('0xa')]('DeskAccount,\x20%s,\x20%s',_0x13b0a2,'request\x20sent');logger[_0x6e86('0xb')](_0x6e86('0xc'),_0x13b0a2,_0x6e86('0xd'),JSON['stringify'](_0x5ba332));if(_0x5ba332[_0x6e86('0xe')]){if(_0x5ba332[_0x6e86('0xe')][_0x6e86('0xf')]===0x1f4){logger[_0x6e86('0xe')](_0x6e86('0x10'),_0x13b0a2,_0x5ba332['error'][_0x6e86('0x11')]);return _0x57ab07(_0x5ba332['error'][_0x6e86('0x11')]);}logger['error'](_0x6e86('0x10'),_0x13b0a2,_0x5ba332[_0x6e86('0xe')][_0x6e86('0x11')]);return _0xb1b144(_0x5ba332[_0x6e86('0xe')][_0x6e86('0x11')]);}else{logger[_0x6e86('0xa')]('DeskAccount,\x20%s,\x20%s',_0x13b0a2,_0x6e86('0xd'));_0xb1b144(_0x5ba332[_0x6e86('0x12')][_0x6e86('0x11')]);}})[_0x6e86('0x13')](function(_0x50aa93){logger[_0x6e86('0xe')]('DeskAccount,\x20%s,\x20%s',_0x13b0a2,_0x50aa93);_0x57ab07(_0x50aa93);});});}exports['GetDeskAccount']=function(_0x30751a){var _0x17e681=this;return new Promise(function(_0x4966e2,_0x666b83){return db['DeskAccount'][_0x6e86('0x14')]({'raw':_0x30751a['options']?_0x30751a['options'][_0x6e86('0x15')]===undefined?!![]:![]:!![],'where':_0x30751a[_0x6e86('0x16')]?_0x30751a[_0x6e86('0x16')][_0x6e86('0x17')]||null:null,'attributes':_0x30751a[_0x6e86('0x16')]?_0x30751a[_0x6e86('0x16')][_0x6e86('0x18')]||null:null,'limit':_0x30751a[_0x6e86('0x16')]?_0x30751a[_0x6e86('0x16')][_0x6e86('0x19')]||null:null,'include':_0x30751a[_0x6e86('0x16')]?_0x30751a[_0x6e86('0x16')]['include']?_['map'](_0x30751a[_0x6e86('0x16')]['include'],function(_0x5effbf){return{'model':db[_0x5effbf[_0x6e86('0x1a')]],'as':_0x5effbf['as'],'attributes':_0x5effbf[_0x6e86('0x18')],'include':_0x5effbf[_0x6e86('0x1b')]?_[_0x6e86('0x1c')](_0x5effbf[_0x6e86('0x1b')],function(_0x1ffee5){return{'model':db[_0x1ffee5[_0x6e86('0x1a')]],'as':_0x1ffee5['as'],'attributes':_0x1ffee5[_0x6e86('0x18')],'include':_0x1ffee5[_0x6e86('0x1b')]?_[_0x6e86('0x1c')](_0x1ffee5[_0x6e86('0x1b')],function(_0x17057f){return{'model':db[_0x17057f['model']],'as':_0x17057f['as'],'attributes':_0x17057f[_0x6e86('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6e86('0x1d')](function(_0x8f9536){logger[_0x6e86('0xa')]('GetDeskAccount',_0x30751a);logger[_0x6e86('0xb')](_0x6e86('0x1e'),_0x30751a,JSON['stringify'](_0x8f9536));_0x4966e2(_0x8f9536);})[_0x6e86('0x13')](function(_0x316a8a){logger[_0x6e86('0xe')](_0x6e86('0x1e'),_0x316a8a[_0x6e86('0x11')],_0x30751a);_0x666b83(_0x17e681['error'](0x1f4,_0x316a8a[_0x6e86('0x11')]));});});};exports[_0x6e86('0x1f')]=function(_0x5569d8){var _0x4b3a61=this;return new Promise(function(_0x5aadd4,_0x2431c4){return db[_0x6e86('0x20')][_0x6e86('0x21')]({'raw':_0x5569d8['options']?_0x5569d8[_0x6e86('0x16')][_0x6e86('0x15')]===undefined?!![]:![]:!![],'where':_0x5569d8[_0x6e86('0x16')]?_0x5569d8['options'][_0x6e86('0x17')]||null:null,'attributes':_0x5569d8['options']?_0x5569d8['options'][_0x6e86('0x18')]||null:null,'include':_0x5569d8[_0x6e86('0x16')]?_0x5569d8[_0x6e86('0x16')][_0x6e86('0x1b')]?_[_0x6e86('0x1c')](_0x5569d8[_0x6e86('0x16')]['include'],function(_0x4aa797){return{'model':db[_0x4aa797[_0x6e86('0x1a')]],'as':_0x4aa797['as'],'attributes':_0x4aa797[_0x6e86('0x18')],'include':_0x4aa797[_0x6e86('0x1b')]?_[_0x6e86('0x1c')](_0x4aa797[_0x6e86('0x1b')],function(_0x2b37a8){return{'model':db[_0x2b37a8['model']],'as':_0x2b37a8['as'],'attributes':_0x2b37a8[_0x6e86('0x18')],'include':_0x2b37a8[_0x6e86('0x1b')]?_[_0x6e86('0x1c')](_0x2b37a8[_0x6e86('0x1b')],function(_0x4a793c){return{'model':db[_0x4a793c[_0x6e86('0x1a')]],'as':_0x4a793c['as'],'attributes':_0x4a793c[_0x6e86('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6e86('0x1d')](function(_0x37f692){logger[_0x6e86('0xa')](_0x6e86('0x1f'),_0x5569d8);logger[_0x6e86('0xb')](_0x6e86('0x1f'),_0x5569d8,JSON[_0x6e86('0x22')](_0x37f692));_0x5aadd4(_0x37f692);})[_0x6e86('0x13')](function(_0x57b035){logger[_0x6e86('0xe')]('ShowDeskAccount',_0x57b035[_0x6e86('0x11')],_0x5569d8);_0x2431c4(_0x4b3a61[_0x6e86('0xe')](0x1f4,_0x57b035[_0x6e86('0x11')]));});});};
\ No newline at end of file
+var _0xa6c3=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','include','model','map','info','ShowDeskAccount','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x85c2bf,_0x103270){var _0x2e6ada=function(_0x503bd2){while(--_0x503bd2){_0x85c2bf['push'](_0x85c2bf['shift']());}};_0x2e6ada(++_0x103270);}(_0xa6c3,0x17f));var _0x3a6c=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xa6c3[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x3a6c('0x0'));var util=require(_0x3a6c('0x1'));var moment=require(_0x3a6c('0x2'));var BPromise=require(_0x3a6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a6c('0x4'))['db'];var utils=require(_0x3a6c('0x5'));var logger=require(_0x3a6c('0x6'))(_0x3a6c('0x7'));var config=require(_0x3a6c('0x8'));var jayson=require(_0x3a6c('0x9'));var client=jayson[_0x3a6c('0xa')][_0x3a6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda8dc7,_0x366b35,_0x5f4c03){return new BPromise(function(_0x1715bd,_0x146014){return client['request'](_0xda8dc7,_0x5f4c03)[_0x3a6c('0xc')](function(_0x48cb3e){logger['info'](_0x3a6c('0xd'),_0x366b35,_0x3a6c('0xe'));logger[_0x3a6c('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x366b35,_0x3a6c('0xe'),JSON[_0x3a6c('0x10')](_0x48cb3e));if(_0x48cb3e[_0x3a6c('0x11')]){if(_0x48cb3e[_0x3a6c('0x11')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x366b35,_0x48cb3e[_0x3a6c('0x11')][_0x3a6c('0x12')]);return _0x146014(_0x48cb3e['error']['message']);}logger[_0x3a6c('0x11')](_0x3a6c('0xd'),_0x366b35,_0x48cb3e[_0x3a6c('0x11')]['message']);return _0x1715bd(_0x48cb3e[_0x3a6c('0x11')][_0x3a6c('0x12')]);}else{logger['info'](_0x3a6c('0xd'),_0x366b35,_0x3a6c('0xe'));_0x1715bd(_0x48cb3e[_0x3a6c('0x13')][_0x3a6c('0x12')]);}})[_0x3a6c('0x14')](function(_0xfa9f0d){logger['error'](_0x3a6c('0xd'),_0x366b35,_0xfa9f0d);_0x146014(_0xfa9f0d);});});}exports[_0x3a6c('0x15')]=function(_0x5c776a){var _0x6588b4=this;return new Promise(function(_0x2134f5,_0x441760){return db['DeskAccount'][_0x3a6c('0x16')]({'raw':_0x5c776a[_0x3a6c('0x17')]?_0x5c776a[_0x3a6c('0x17')][_0x3a6c('0x18')]===undefined?!![]:![]:!![],'where':_0x5c776a[_0x3a6c('0x17')]?_0x5c776a[_0x3a6c('0x17')][_0x3a6c('0x19')]||null:null,'attributes':_0x5c776a[_0x3a6c('0x17')]?_0x5c776a['options'][_0x3a6c('0x1a')]||null:null,'limit':_0x5c776a[_0x3a6c('0x17')]?_0x5c776a[_0x3a6c('0x17')]['limit']||null:null,'include':_0x5c776a[_0x3a6c('0x17')]?_0x5c776a[_0x3a6c('0x17')]['include']?_['map'](_0x5c776a[_0x3a6c('0x17')][_0x3a6c('0x1b')],function(_0x48d36f){return{'model':db[_0x48d36f[_0x3a6c('0x1c')]],'as':_0x48d36f['as'],'attributes':_0x48d36f[_0x3a6c('0x1a')],'include':_0x48d36f[_0x3a6c('0x1b')]?_[_0x3a6c('0x1d')](_0x48d36f[_0x3a6c('0x1b')],function(_0x12c6f6){return{'model':db[_0x12c6f6['model']],'as':_0x12c6f6['as'],'attributes':_0x12c6f6['attributes'],'include':_0x12c6f6[_0x3a6c('0x1b')]?_[_0x3a6c('0x1d')](_0x12c6f6[_0x3a6c('0x1b')],function(_0x33e9cb){return{'model':db[_0x33e9cb[_0x3a6c('0x1c')]],'as':_0x33e9cb['as'],'attributes':_0x33e9cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a6c('0xc')](function(_0x42d3cf){logger[_0x3a6c('0x1e')](_0x3a6c('0x15'),_0x5c776a);logger['debug'](_0x3a6c('0x15'),_0x5c776a,JSON[_0x3a6c('0x10')](_0x42d3cf));_0x2134f5(_0x42d3cf);})[_0x3a6c('0x14')](function(_0x5df6dc){logger[_0x3a6c('0x11')](_0x3a6c('0x15'),_0x5df6dc[_0x3a6c('0x12')],_0x5c776a);_0x441760(_0x6588b4['error'](0x1f4,_0x5df6dc['message']));});});};exports[_0x3a6c('0x1f')]=function(_0x4aa5f6){var _0x49349f=this;return new Promise(function(_0x440ec7,_0x9fc97c){return db['DeskAccount'][_0x3a6c('0x20')]({'raw':_0x4aa5f6[_0x3a6c('0x17')]?_0x4aa5f6['options'][_0x3a6c('0x18')]===undefined?!![]:![]:!![],'where':_0x4aa5f6['options']?_0x4aa5f6[_0x3a6c('0x17')]['where']||null:null,'attributes':_0x4aa5f6['options']?_0x4aa5f6[_0x3a6c('0x17')][_0x3a6c('0x1a')]||null:null,'include':_0x4aa5f6['options']?_0x4aa5f6[_0x3a6c('0x17')][_0x3a6c('0x1b')]?_['map'](_0x4aa5f6[_0x3a6c('0x17')][_0x3a6c('0x1b')],function(_0x36ea72){return{'model':db[_0x36ea72[_0x3a6c('0x1c')]],'as':_0x36ea72['as'],'attributes':_0x36ea72[_0x3a6c('0x1a')],'include':_0x36ea72[_0x3a6c('0x1b')]?_['map'](_0x36ea72[_0x3a6c('0x1b')],function(_0x4cea09){return{'model':db[_0x4cea09[_0x3a6c('0x1c')]],'as':_0x4cea09['as'],'attributes':_0x4cea09['attributes'],'include':_0x4cea09[_0x3a6c('0x1b')]?_[_0x3a6c('0x1d')](_0x4cea09[_0x3a6c('0x1b')],function(_0x247c2b){return{'model':db[_0x247c2b[_0x3a6c('0x1c')]],'as':_0x247c2b['as'],'attributes':_0x247c2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a6c('0xc')](function(_0x5befa4){logger[_0x3a6c('0x1e')](_0x3a6c('0x1f'),_0x4aa5f6);logger[_0x3a6c('0xf')](_0x3a6c('0x1f'),_0x4aa5f6,JSON['stringify'](_0x5befa4));_0x440ec7(_0x5befa4);})['catch'](function(_0x3c5813){logger['error'](_0x3a6c('0x1f'),_0x3c5813['message'],_0x4aa5f6);_0x9fc97c(_0x49349f['error'](0x1f4,_0x3c5813[_0x3a6c('0x12')]));});});};
\ No newline at end of file
index 695f142..a91b32a 100644 (file)
@@ -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(_0x3544cb,_0x23da73){var _0xab6f16=function(_0x4a4e89){while(--_0x4a4e89){_0x3544cb['push'](_0x3544cb['shift']());}};_0xab6f16(++_0x23da73);}(_0x008c,0x188));var _0xc008=function(_0x556e63,_0x16abaf){_0x556e63=_0x556e63-0x0;var _0x1f18a9=_0x008c[_0x556e63];return _0x1f18a9;};'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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x1d0424,_0x4f31b4){var _0x45cde3=function(_0x590087){while(--_0x590087){_0x1d0424['push'](_0x1d0424['shift']());}};_0x45cde3(++_0x4f31b4);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router;
\ No newline at end of file
index c8e608f..ab06a08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x681f=['exports','STRING','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x681f,0x17c));var _0xf681=function(_0x40ecd0,_0x27de55){_0x40ecd0=_0x40ecd0-0x0;var _0x5a9953=_0x681f[_0x40ecd0];return _0x5a9953;};'use strict';var Sequelize=require(_0xf681('0x0'));module[_0xf681('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf681('0x2')]}};
\ No newline at end of file
+var _0xc107=['sequelize','exports','STRING'];(function(_0x2e5981,_0xe4e846){var _0x6e4fef=function(_0x252b0c){while(--_0x252b0c){_0x2e5981['push'](_0x2e5981['shift']());}};_0x6e4fef(++_0xe4e846);}(_0xc107,0x15f));var _0x7c10=function(_0x2f843a,_0x40dd0b){_0x2f843a=_0x2f843a-0x0;var _0x35cf5a=_0xc107[_0x2f843a];return _0x35cf5a;};'use strict';var Sequelize=require(_0x7c10('0x0'));module[_0x7c10('0x1')]={'name':{'type':Sequelize[_0x7c10('0x2')]},'description':{'type':Sequelize[_0x7c10('0x2')]}};
\ No newline at end of file
index d3d135c..fe597cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d4d=['order','sort','filters','pick','merge','where','VIRTUAL','filter','options','DeskConfiguration','includeAll','include','findAll','rows','catch','params','length','find','create','body','getFields','DeskField','rawAttributes','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','send','map','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x52be0d,_0x57aacd){var _0x25740a=function(_0x22d28e){while(--_0x22d28e){_0x52be0d['push'](_0x52be0d['shift']());}};_0x25740a(++_0x57aacd);}(_0x8d4d,0x114));var _0xd8d4=function(_0x3124f3,_0x38d604){_0x3124f3=_0x3124f3-0x0;var _0x57813b=_0x8d4d[_0x3124f3];return _0x57813b;};'use strict';var emlformat=require(_0xd8d4('0x0'));var rimraf=require(_0xd8d4('0x1'));var zipdir=require(_0xd8d4('0x2'));var jsonpatch=require(_0xd8d4('0x3'));var rp=require(_0xd8d4('0x4'));var moment=require(_0xd8d4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd8d4('0x6'));var sox=require('sox');var csv=require(_0xd8d4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8d4('0x8'));var _=require('lodash');var squel=require(_0xd8d4('0x9'));var crypto=require(_0xd8d4('0xa'));var jsforce=require(_0xd8d4('0xb'));var deskjs=require(_0xd8d4('0xc'));var toCsv=require(_0xd8d4('0x7'));var querystring=require(_0xd8d4('0xd'));var Papa=require(_0xd8d4('0xe'));var Redis=require('ioredis');var authService=require(_0xd8d4('0xf'));var qs=require(_0xd8d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8d4('0x11'));var logger=require('../../config/logger')(_0xd8d4('0x12'));var utils=require(_0xd8d4('0x13'));var config=require(_0xd8d4('0x14'));var licenseUtil=require(_0xd8d4('0x15'));var db=require(_0xd8d4('0x16'))['db'];function respondWithStatusCode(_0x577040,_0x2e538a){_0x2e538a=_0x2e538a||0xcc;return function(_0x417c26){if(_0x417c26){return _0x577040['sendStatus'](_0x2e538a);}return _0x577040[_0xd8d4('0x17')](_0x2e538a)[_0xd8d4('0x18')]();};}function respondWithResult(_0x3b29fe,_0x193fab){_0x193fab=_0x193fab||0xc8;return function(_0x546f51){if(_0x546f51){return _0x3b29fe[_0xd8d4('0x17')](_0x193fab)[_0xd8d4('0x19')](_0x546f51);}};}function respondWithFilteredResult(_0x704f95,_0x1a1562){return function(_0x24a2f8){if(_0x24a2f8){var _0x431bff=typeof _0x1a1562[_0xd8d4('0x1a')]===_0xd8d4('0x1b')&&typeof _0x1a1562[_0xd8d4('0x1c')]===_0xd8d4('0x1b');var _0x3141fb=_0x24a2f8[_0xd8d4('0x1d')];var _0x5f4ac5=_0x431bff?0x0:_0x1a1562[_0xd8d4('0x1a')];var _0x567e1e=_0x431bff?_0x24a2f8['count']:_0x1a1562['offset']+_0x1a1562['limit'];var _0x1987a6;if(_0x567e1e>=_0x3141fb){_0x567e1e=_0x3141fb;_0x1987a6=0xc8;}else{_0x1987a6=0xce;}_0x704f95[_0xd8d4('0x17')](_0x1987a6);return _0x704f95[_0xd8d4('0x1e')](_0xd8d4('0x1f'),_0x5f4ac5+'-'+_0x567e1e+'/'+_0x3141fb)[_0xd8d4('0x19')](_0x24a2f8);}return null;};}function patchUpdates(_0x395129){return function(_0x42054d){try{jsonpatch['apply'](_0x42054d,_0x395129,!![]);}catch(_0x8bb2ff){return BPromise[_0xd8d4('0x20')](_0x8bb2ff);}return _0x42054d['save']();};}function saveUpdates(_0x2a023f,_0x2e6a79){return function(_0x317c6b){if(_0x317c6b){return _0x317c6b[_0xd8d4('0x21')](_0x2a023f)[_0xd8d4('0x22')](function(_0x31d108){return _0x31d108;});}return null;};}function removeEntity(_0x2d73d1,_0xd2ce07){return function(_0x2a5d73){if(_0x2a5d73){return _0x2a5d73[_0xd8d4('0x23')]()[_0xd8d4('0x22')](function(){_0x2d73d1[_0xd8d4('0x17')](0xcc)[_0xd8d4('0x18')]();});}};}function handleEntityNotFound(_0x3ca81e,_0x566c56){return function(_0x1ee461){if(!_0x1ee461){_0x3ca81e[_0xd8d4('0x24')](0x194);}return _0x1ee461;};}function handleError(_0x1b9e71,_0x1f7334){_0x1f7334=_0x1f7334||0x1f4;return function(_0x5b5a51){logger[_0xd8d4('0x25')](_0x5b5a51[_0xd8d4('0x26')]);if(_0x5b5a51['name']){delete _0x5b5a51['name'];}_0x1b9e71[_0xd8d4('0x17')](_0x1f7334)[_0xd8d4('0x27')](_0x5b5a51);};}exports['index']=function(_0x1a87a4,_0x4a6f30){var _0x4bd3b6={},_0x5ad021={},_0x3cba0d={'count':0x0,'rows':[]};var _0xf587eb=_[_0xd8d4('0x28')](db['DeskConfiguration']['rawAttributes'],function(_0x4459c1){return{'name':_0x4459c1['fieldName'],'type':_0x4459c1[_0xd8d4('0x29')][_0xd8d4('0x2a')]};});_0x5ad021[_0xd8d4('0x2b')]=_[_0xd8d4('0x28')](_0xf587eb,_0xd8d4('0x2c'));_0x5ad021[_0xd8d4('0x2d')]=_[_0xd8d4('0x2e')](_0x1a87a4[_0xd8d4('0x2d')]);_0x5ad021['filters']=_['intersection'](_0x5ad021[_0xd8d4('0x2b')],_0x5ad021['query']);_0x4bd3b6['attributes']=_[_0xd8d4('0x2f')](_0x5ad021[_0xd8d4('0x2b')],qs[_0xd8d4('0x30')](_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x30')]));_0x4bd3b6[_0xd8d4('0x31')]=_0x4bd3b6[_0xd8d4('0x31')]['length']?_0x4bd3b6[_0xd8d4('0x31')]:_0x5ad021[_0xd8d4('0x2b')];if(!_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x32')](_0xd8d4('0x33'))){_0x4bd3b6[_0xd8d4('0x1c')]=qs['limit'](_0x1a87a4[_0xd8d4('0x2d')]['limit']);_0x4bd3b6['offset']=qs[_0xd8d4('0x1a')](_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x1a')]);}_0x4bd3b6[_0xd8d4('0x34')]=qs[_0xd8d4('0x35')](_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x35')]);_0x4bd3b6['where']=qs[_0xd8d4('0x36')](_[_0xd8d4('0x37')](_0x1a87a4['query'],_0x5ad021[_0xd8d4('0x36')]),_0xf587eb);if(_0x1a87a4[_0xd8d4('0x2d')]['filter']){_0x4bd3b6['where']=_[_0xd8d4('0x38')](_0x4bd3b6[_0xd8d4('0x39')],{'$or':_[_0xd8d4('0x28')](_0xf587eb,function(_0x220200){if(_0x220200[_0xd8d4('0x29')]!==_0xd8d4('0x3a')){var _0x41e46c={};_0x41e46c[_0x220200[_0xd8d4('0x2c')]]={'$like':'%'+_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x3b')]+'%'};return _0x41e46c;}})});}_0x4bd3b6=_[_0xd8d4('0x38')]({},_0x4bd3b6,_0x1a87a4[_0xd8d4('0x3c')]);var _0x24d556={'where':_0x4bd3b6['where']};return db[_0xd8d4('0x3d')][_0xd8d4('0x1d')](_0x24d556)[_0xd8d4('0x22')](function(_0x28d767){_0x3cba0d[_0xd8d4('0x1d')]=_0x28d767;if(_0x1a87a4[_0xd8d4('0x2d')][_0xd8d4('0x3e')]){_0x4bd3b6[_0xd8d4('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd8d4('0x40')](_0x4bd3b6);})[_0xd8d4('0x22')](function(_0x17b050){_0x3cba0d[_0xd8d4('0x41')]=_0x17b050;return _0x3cba0d;})[_0xd8d4('0x22')](respondWithFilteredResult(_0x4a6f30,_0x4bd3b6))[_0xd8d4('0x42')](handleError(_0x4a6f30,null));};exports['show']=function(_0x50b12b,_0x2268cc){var _0xb0c8a6={'raw':![],'where':{'id':_0x50b12b[_0xd8d4('0x43')]['id']}},_0x5316ff={};_0x5316ff[_0xd8d4('0x2b')]=_[_0xd8d4('0x2e')](db[_0xd8d4('0x3d')]['rawAttributes']);_0x5316ff['query']=_[_0xd8d4('0x2e')](_0x50b12b[_0xd8d4('0x2d')]);_0x5316ff[_0xd8d4('0x36')]=_[_0xd8d4('0x2f')](_0x5316ff['model'],_0x5316ff[_0xd8d4('0x2d')]);_0xb0c8a6[_0xd8d4('0x31')]=_['intersection'](_0x5316ff[_0xd8d4('0x2b')],qs['fields'](_0x50b12b[_0xd8d4('0x2d')][_0xd8d4('0x30')]));_0xb0c8a6['attributes']=_0xb0c8a6['attributes'][_0xd8d4('0x44')]?_0xb0c8a6[_0xd8d4('0x31')]:_0x5316ff['model'];if(_0x50b12b['query'][_0xd8d4('0x3e')]){_0xb0c8a6['include']=[{'all':!![]}];}_0xb0c8a6=_[_0xd8d4('0x38')]({},_0xb0c8a6,_0x50b12b['options']);return db[_0xd8d4('0x3d')][_0xd8d4('0x45')](_0xb0c8a6)[_0xd8d4('0x22')](handleEntityNotFound(_0x2268cc,null))[_0xd8d4('0x22')](respondWithResult(_0x2268cc,null))[_0xd8d4('0x42')](handleError(_0x2268cc,null));};exports['create']=function(_0x553e55,_0x60c288){return db[_0xd8d4('0x3d')][_0xd8d4('0x46')](_0x553e55[_0xd8d4('0x47')],{})[_0xd8d4('0x22')](respondWithResult(_0x60c288,0xc9))[_0xd8d4('0x42')](handleError(_0x60c288,null));};exports[_0xd8d4('0x21')]=function(_0x4ae2e8,_0x296777){if(_0x4ae2e8[_0xd8d4('0x47')]['id']){delete _0x4ae2e8[_0xd8d4('0x47')]['id'];}return db['DeskConfiguration'][_0xd8d4('0x45')]({'where':{'id':_0x4ae2e8[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x296777,null))[_0xd8d4('0x22')](saveUpdates(_0x4ae2e8[_0xd8d4('0x47')],null))[_0xd8d4('0x22')](respondWithResult(_0x296777,null))[_0xd8d4('0x42')](handleError(_0x296777,null));};exports[_0xd8d4('0x23')]=function(_0x4120bd,_0x59a0f4){return db[_0xd8d4('0x3d')][_0xd8d4('0x45')]({'where':{'id':_0x4120bd[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x59a0f4,null))[_0xd8d4('0x22')](removeEntity(_0x59a0f4,null))[_0xd8d4('0x42')](handleError(_0x59a0f4,null));};exports[_0xd8d4('0x48')]=function(_0x4f296d,_0x47a07b,_0x5e2b5a){var _0x4faa01={};var _0x4f9c6a={};var _0x45f6b0;var _0x3ccde2;return db[_0xd8d4('0x3d')]['findOne']({'where':{'id':_0x4f296d[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x47a07b,null))[_0xd8d4('0x22')](function(_0x3c608d){if(_0x3c608d){_0x45f6b0=_0x3c608d;_0x4f9c6a[_0xd8d4('0x2b')]=_[_0xd8d4('0x2e')](db[_0xd8d4('0x49')][_0xd8d4('0x4a')]);_0x4f9c6a[_0xd8d4('0x2d')]=_[_0xd8d4('0x2e')](_0x4f296d[_0xd8d4('0x2d')]);_0x4f9c6a['filters']=_['intersection'](_0x4f9c6a[_0xd8d4('0x2b')],_0x4f9c6a['query']);_0x4faa01[_0xd8d4('0x31')]=_[_0xd8d4('0x2f')](_0x4f9c6a['model'],qs['fields'](_0x4f296d[_0xd8d4('0x2d')][_0xd8d4('0x30')]));_0x4faa01['attributes']=_0x4faa01[_0xd8d4('0x31')][_0xd8d4('0x44')]?_0x4faa01[_0xd8d4('0x31')]:_0x4f9c6a[_0xd8d4('0x2b')];_0x4faa01['order']=qs[_0xd8d4('0x35')](_0x4f296d[_0xd8d4('0x2d')]['sort']);_0x4faa01[_0xd8d4('0x39')]=qs[_0xd8d4('0x36')](_[_0xd8d4('0x37')](_0x4f296d['query'],_0x4f9c6a[_0xd8d4('0x36')]));if(_0x4f296d[_0xd8d4('0x2d')]['filter']){_0x4faa01[_0xd8d4('0x39')]=_[_0xd8d4('0x38')](_0x4faa01[_0xd8d4('0x39')],{'$or':_[_0xd8d4('0x28')](_0x4faa01[_0xd8d4('0x31')],function(_0xe3bb18){var _0x1f5123={};_0x1f5123[_0xe3bb18]={'$like':'%'+_0x4f296d[_0xd8d4('0x2d')]['filter']+'%'};return _0x1f5123;})});}_0x4faa01=_[_0xd8d4('0x38')]({},_0x4faa01,_0x4f296d[_0xd8d4('0x3c')]);return _0x45f6b0[_0xd8d4('0x48')](_0x4faa01);}})['then'](function(_0x518a5b){if(_0x518a5b){_0x3ccde2=_0x518a5b['length'];if(!_0x4f296d[_0xd8d4('0x2d')]['hasOwnProperty']('nolimit')){_0x4faa01['limit']=qs['limit'](_0x4f296d[_0xd8d4('0x2d')][_0xd8d4('0x1c')]);_0x4faa01['offset']=qs[_0xd8d4('0x1a')](_0x4f296d[_0xd8d4('0x2d')][_0xd8d4('0x1a')]);}return _0x45f6b0[_0xd8d4('0x48')](_0x4faa01);}})[_0xd8d4('0x22')](function(_0xa8c0a8){if(_0xa8c0a8){return _0xa8c0a8?{'count':_0x3ccde2,'rows':_0xa8c0a8}:null;}})[_0xd8d4('0x22')](respondWithResult(_0x47a07b,null))[_0xd8d4('0x42')](handleError(_0x47a07b,null));};exports['getSubjects']=function(_0x380ae5,_0x2ab04a,_0x241626){var _0x31e8a1={};var _0x502bef={};var _0x45e569;var _0x5ef8f3;return db[_0xd8d4('0x3d')][_0xd8d4('0x4b')]({'where':{'id':_0x380ae5[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x2ab04a,null))[_0xd8d4('0x22')](function(_0x25780d){if(_0x25780d){_0x45e569=_0x25780d;_0x502bef[_0xd8d4('0x2b')]=_[_0xd8d4('0x2e')](db[_0xd8d4('0x49')][_0xd8d4('0x4a')]);_0x502bef[_0xd8d4('0x2d')]=_[_0xd8d4('0x2e')](_0x380ae5[_0xd8d4('0x2d')]);_0x502bef['filters']=_[_0xd8d4('0x2f')](_0x502bef[_0xd8d4('0x2b')],_0x502bef[_0xd8d4('0x2d')]);_0x31e8a1['attributes']=_[_0xd8d4('0x2f')](_0x502bef[_0xd8d4('0x2b')],qs['fields'](_0x380ae5['query'][_0xd8d4('0x30')]));_0x31e8a1[_0xd8d4('0x31')]=_0x31e8a1[_0xd8d4('0x31')][_0xd8d4('0x44')]?_0x31e8a1['attributes']:_0x502bef[_0xd8d4('0x2b')];_0x31e8a1[_0xd8d4('0x34')]=qs[_0xd8d4('0x35')](_0x380ae5[_0xd8d4('0x2d')][_0xd8d4('0x35')]);_0x31e8a1[_0xd8d4('0x39')]=qs['filters'](_['pick'](_0x380ae5[_0xd8d4('0x2d')],_0x502bef[_0xd8d4('0x36')]));if(_0x380ae5[_0xd8d4('0x2d')][_0xd8d4('0x3b')]){_0x31e8a1[_0xd8d4('0x39')]=_['merge'](_0x31e8a1['where'],{'$or':_[_0xd8d4('0x28')](_0x31e8a1[_0xd8d4('0x31')],function(_0x2b3ac6){var _0x18c458={};_0x18c458[_0x2b3ac6]={'$like':'%'+_0x380ae5[_0xd8d4('0x2d')][_0xd8d4('0x3b')]+'%'};return _0x18c458;})});}_0x31e8a1=_[_0xd8d4('0x38')]({},_0x31e8a1,_0x380ae5[_0xd8d4('0x3c')]);return _0x45e569[_0xd8d4('0x4c')](_0x31e8a1);}})[_0xd8d4('0x22')](function(_0x2de034){if(_0x2de034){_0x5ef8f3=_0x2de034[_0xd8d4('0x44')];if(!_0x380ae5[_0xd8d4('0x2d')][_0xd8d4('0x32')](_0xd8d4('0x33'))){_0x31e8a1[_0xd8d4('0x1c')]=qs[_0xd8d4('0x1c')](_0x380ae5[_0xd8d4('0x2d')][_0xd8d4('0x1c')]);_0x31e8a1[_0xd8d4('0x1a')]=qs[_0xd8d4('0x1a')](_0x380ae5[_0xd8d4('0x2d')]['offset']);}return _0x45e569[_0xd8d4('0x4c')](_0x31e8a1);}})['then'](function(_0x1cfe10){if(_0x1cfe10){return _0x1cfe10?{'count':_0x5ef8f3,'rows':_0x1cfe10}:null;}})[_0xd8d4('0x22')](respondWithResult(_0x2ab04a,null))[_0xd8d4('0x42')](handleError(_0x2ab04a,null));};exports['getDescriptions']=function(_0x250e2d,_0x57974a,_0x314b58){var _0x3760fa={};var _0xead7d3={};var _0x30e110;var _0x3c2e14;return db['DeskConfiguration'][_0xd8d4('0x4b')]({'where':{'id':_0x250e2d[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x57974a,null))[_0xd8d4('0x22')](function(_0x4af282){if(_0x4af282){_0x30e110=_0x4af282;_0xead7d3[_0xd8d4('0x2b')]=_[_0xd8d4('0x2e')](db[_0xd8d4('0x49')][_0xd8d4('0x4a')]);_0xead7d3[_0xd8d4('0x2d')]=_[_0xd8d4('0x2e')](_0x250e2d[_0xd8d4('0x2d')]);_0xead7d3[_0xd8d4('0x36')]=_['intersection'](_0xead7d3[_0xd8d4('0x2b')],_0xead7d3['query']);_0x3760fa[_0xd8d4('0x31')]=_[_0xd8d4('0x2f')](_0xead7d3['model'],qs[_0xd8d4('0x30')](_0x250e2d[_0xd8d4('0x2d')][_0xd8d4('0x30')]));_0x3760fa[_0xd8d4('0x31')]=_0x3760fa[_0xd8d4('0x31')]['length']?_0x3760fa[_0xd8d4('0x31')]:_0xead7d3[_0xd8d4('0x2b')];_0x3760fa[_0xd8d4('0x34')]=qs[_0xd8d4('0x35')](_0x250e2d['query']['sort']);_0x3760fa['where']=qs[_0xd8d4('0x36')](_['pick'](_0x250e2d['query'],_0xead7d3[_0xd8d4('0x36')]));if(_0x250e2d['query'][_0xd8d4('0x3b')]){_0x3760fa['where']=_[_0xd8d4('0x38')](_0x3760fa[_0xd8d4('0x39')],{'$or':_[_0xd8d4('0x28')](_0x3760fa[_0xd8d4('0x31')],function(_0x7353c9){var _0xcbee0={};_0xcbee0[_0x7353c9]={'$like':'%'+_0x250e2d[_0xd8d4('0x2d')][_0xd8d4('0x3b')]+'%'};return _0xcbee0;})});}_0x3760fa=_['merge']({},_0x3760fa,_0x250e2d[_0xd8d4('0x3c')]);return _0x30e110[_0xd8d4('0x4d')](_0x3760fa);}})[_0xd8d4('0x22')](function(_0xd5a1dd){if(_0xd5a1dd){_0x3c2e14=_0xd5a1dd[_0xd8d4('0x44')];if(!_0x250e2d[_0xd8d4('0x2d')][_0xd8d4('0x32')](_0xd8d4('0x33'))){_0x3760fa['limit']=qs[_0xd8d4('0x1c')](_0x250e2d['query'][_0xd8d4('0x1c')]);_0x3760fa[_0xd8d4('0x1a')]=qs[_0xd8d4('0x1a')](_0x250e2d['query'][_0xd8d4('0x1a')]);}return _0x30e110['getDescriptions'](_0x3760fa);}})[_0xd8d4('0x22')](function(_0x51fb26){if(_0x51fb26){return _0x51fb26?{'count':_0x3c2e14,'rows':_0x51fb26}:null;}})['then'](respondWithResult(_0x57974a,null))['catch'](handleError(_0x57974a,null));};exports[_0xd8d4('0x4e')]=function(_0x28988e,_0x8c990a,_0x2f4862){var _0x17feac={};var _0x414fa2={};var _0x49f3c9;var _0x3151cc;return db[_0xd8d4('0x3d')]['findOne']({'where':{'id':_0x28988e['params']['id']}})['then'](handleEntityNotFound(_0x8c990a,null))[_0xd8d4('0x22')](function(_0x2a754d){if(_0x2a754d){_0x49f3c9=_0x2a754d;_0x414fa2[_0xd8d4('0x2b')]=_[_0xd8d4('0x2e')](db[_0xd8d4('0x4f')]['rawAttributes']);_0x414fa2[_0xd8d4('0x2d')]=_['keys'](_0x28988e[_0xd8d4('0x2d')]);_0x414fa2[_0xd8d4('0x36')]=_['intersection'](_0x414fa2[_0xd8d4('0x2b')],_0x414fa2[_0xd8d4('0x2d')]);_0x17feac[_0xd8d4('0x31')]=_[_0xd8d4('0x2f')](_0x414fa2[_0xd8d4('0x2b')],qs[_0xd8d4('0x30')](_0x28988e[_0xd8d4('0x2d')][_0xd8d4('0x30')]));_0x17feac['attributes']=_0x17feac[_0xd8d4('0x31')]['length']?_0x17feac[_0xd8d4('0x31')]:_0x414fa2[_0xd8d4('0x2b')];_0x17feac[_0xd8d4('0x34')]=qs[_0xd8d4('0x35')](_0x28988e[_0xd8d4('0x2d')][_0xd8d4('0x35')]);_0x17feac[_0xd8d4('0x39')]=qs[_0xd8d4('0x36')](_[_0xd8d4('0x37')](_0x28988e[_0xd8d4('0x2d')],_0x414fa2[_0xd8d4('0x36')]));if(_0x28988e[_0xd8d4('0x2d')]['filter']){_0x17feac[_0xd8d4('0x39')]=_['merge'](_0x17feac[_0xd8d4('0x39')],{'$or':_[_0xd8d4('0x28')](_0x17feac[_0xd8d4('0x31')],function(_0x10a15a){var _0x4b271e={};_0x4b271e[_0x10a15a]={'$like':'%'+_0x28988e[_0xd8d4('0x2d')][_0xd8d4('0x3b')]+'%'};return _0x4b271e;})});}_0x17feac=_[_0xd8d4('0x38')]({},_0x17feac,_0x28988e[_0xd8d4('0x3c')]);return _0x49f3c9[_0xd8d4('0x4e')](_0x17feac);}})[_0xd8d4('0x22')](function(_0x290d54){if(_0x290d54){_0x3151cc=_0x290d54[_0xd8d4('0x44')];if(!_0x28988e['query'][_0xd8d4('0x32')]('nolimit')){_0x17feac[_0xd8d4('0x1c')]=qs[_0xd8d4('0x1c')](_0x28988e[_0xd8d4('0x2d')]['limit']);_0x17feac[_0xd8d4('0x1a')]=qs['offset'](_0x28988e[_0xd8d4('0x2d')][_0xd8d4('0x1a')]);}return _0x49f3c9[_0xd8d4('0x4e')](_0x17feac);}})[_0xd8d4('0x22')](function(_0x50857b){if(_0x50857b){return _0x50857b?{'count':_0x3151cc,'rows':_0x50857b}:null;}})[_0xd8d4('0x22')](respondWithResult(_0x8c990a,null))[_0xd8d4('0x42')](handleError(_0x8c990a,null));};exports[_0xd8d4('0x50')]=function(_0x595a20,_0x4c6dbd,_0xd410c8){if(_0x595a20[_0xd8d4('0x47')]['id']){delete _0x595a20[_0xd8d4('0x47')]['id'];}return db[_0xd8d4('0x3d')]['findOne']({'where':{'id':_0x595a20[_0xd8d4('0x43')]['id']}})[_0xd8d4('0x22')](handleEntityNotFound(_0x4c6dbd,null))['then'](function(_0x501cc9){if(_0x501cc9){return _0x501cc9[_0xd8d4('0x50')](_0x595a20['body'][_0xd8d4('0x51')]||[]);}return null;})[_0xd8d4('0x22')](respondWithResult(_0x4c6dbd,null))[_0xd8d4('0x42')](handleError(_0x4c6dbd,null));};
\ No newline at end of file
+var _0x5be5=['include','findAll','rows','show','params','keys','catch','create','body','find','findOne','DeskField','length','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x3c57c5,_0x1bcd12){var _0x3a2ac9=function(_0x185475){while(--_0x185475){_0x3c57c5['push'](_0x3c57c5['shift']());}};_0x3a2ac9(++_0x1bcd12);}(_0x5be5,0xbf));var _0x55be=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0x5be5[_0x367995];return _0x22daa8;};'use strict';var emlformat=require(_0x55be('0x0'));var rimraf=require(_0x55be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55be('0x2'));var rp=require(_0x55be('0x3'));var moment=require(_0x55be('0x4'));var BPromise=require(_0x55be('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x55be('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x55be('0x7'));var fs=require('fs');var fs_extra=require(_0x55be('0x8'));var _=require('lodash');var squel=require(_0x55be('0x9'));var crypto=require(_0x55be('0xa'));var jsforce=require(_0x55be('0xb'));var deskjs=require(_0x55be('0xc'));var toCsv=require(_0x55be('0xd'));var querystring=require(_0x55be('0xe'));var Papa=require(_0x55be('0xf'));var Redis=require('ioredis');var authService=require(_0x55be('0x10'));var qs=require(_0x55be('0x11'));var as=require(_0x55be('0x12'));var hardwareService=require(_0x55be('0x13'));var logger=require(_0x55be('0x14'))('api');var utils=require(_0x55be('0x15'));var config=require(_0x55be('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x55be('0x17'))['db'];function respondWithStatusCode(_0x1adc20,_0x33dce7){_0x33dce7=_0x33dce7||0xcc;return function(_0x48740a){if(_0x48740a){return _0x1adc20[_0x55be('0x18')](_0x33dce7);}return _0x1adc20[_0x55be('0x19')](_0x33dce7)[_0x55be('0x1a')]();};}function respondWithResult(_0x30fa5f,_0xa1d11f){_0xa1d11f=_0xa1d11f||0xc8;return function(_0x4c8ae1){if(_0x4c8ae1){return _0x30fa5f[_0x55be('0x19')](_0xa1d11f)[_0x55be('0x1b')](_0x4c8ae1);}};}function respondWithFilteredResult(_0xf21fd7,_0x520f55){return function(_0x34e8ed){if(_0x34e8ed){var _0x2dfacf=typeof _0x520f55['offset']===_0x55be('0x1c')&&typeof _0x520f55['limit']==='undefined';var _0x529ba9=_0x34e8ed[_0x55be('0x1d')];var _0x513bf1=_0x2dfacf?0x0:_0x520f55[_0x55be('0x1e')];var _0x32c4c2=_0x2dfacf?_0x34e8ed['count']:_0x520f55['offset']+_0x520f55['limit'];var _0x290487;if(_0x32c4c2>=_0x529ba9){_0x32c4c2=_0x529ba9;_0x290487=0xc8;}else{_0x290487=0xce;}_0xf21fd7['status'](_0x290487);return _0xf21fd7[_0x55be('0x1f')](_0x55be('0x20'),_0x513bf1+'-'+_0x32c4c2+'/'+_0x529ba9)[_0x55be('0x1b')](_0x34e8ed);}return null;};}function patchUpdates(_0x49c26d){return function(_0x3fc9ed){try{jsonpatch[_0x55be('0x21')](_0x3fc9ed,_0x49c26d,!![]);}catch(_0x93bda5){return BPromise[_0x55be('0x22')](_0x93bda5);}return _0x3fc9ed[_0x55be('0x23')]();};}function saveUpdates(_0x143777,_0x37748e){return function(_0x472fcc){if(_0x472fcc){return _0x472fcc[_0x55be('0x24')](_0x143777)[_0x55be('0x25')](function(_0x41ba5a){return _0x41ba5a;});}return null;};}function removeEntity(_0x2aa8f6,_0x5246bb){return function(_0x31c737){if(_0x31c737){return _0x31c737[_0x55be('0x26')]()[_0x55be('0x25')](function(){_0x2aa8f6[_0x55be('0x19')](0xcc)[_0x55be('0x1a')]();});}};}function handleEntityNotFound(_0x34bb35,_0x6db448){return function(_0xdb4b16){if(!_0xdb4b16){_0x34bb35['sendStatus'](0x194);}return _0xdb4b16;};}function handleError(_0x142e9b,_0x3c8621){_0x3c8621=_0x3c8621||0x1f4;return function(_0x2ac352){logger[_0x55be('0x27')](_0x2ac352[_0x55be('0x28')]);if(_0x2ac352[_0x55be('0x29')]){delete _0x2ac352['name'];}_0x142e9b[_0x55be('0x19')](_0x3c8621)[_0x55be('0x2a')](_0x2ac352);};}exports[_0x55be('0x2b')]=function(_0x4499c1,_0x5738ea){var _0x32fc2c={},_0x438a46={},_0x32314f={'count':0x0,'rows':[]};var _0x5a369c=_[_0x55be('0x2c')](db[_0x55be('0x2d')][_0x55be('0x2e')],function(_0x4f3ffc){return{'name':_0x4f3ffc[_0x55be('0x2f')],'type':_0x4f3ffc['type'][_0x55be('0x30')]};});_0x438a46[_0x55be('0x31')]=_['map'](_0x5a369c,_0x55be('0x29'));_0x438a46[_0x55be('0x32')]=_['keys'](_0x4499c1[_0x55be('0x32')]);_0x438a46[_0x55be('0x33')]=_[_0x55be('0x34')](_0x438a46[_0x55be('0x31')],_0x438a46[_0x55be('0x32')]);_0x32fc2c['attributes']=_[_0x55be('0x34')](_0x438a46['model'],qs[_0x55be('0x35')](_0x4499c1[_0x55be('0x32')][_0x55be('0x35')]));_0x32fc2c[_0x55be('0x36')]=_0x32fc2c[_0x55be('0x36')]['length']?_0x32fc2c[_0x55be('0x36')]:_0x438a46[_0x55be('0x31')];if(!_0x4499c1[_0x55be('0x32')][_0x55be('0x37')](_0x55be('0x38'))){_0x32fc2c[_0x55be('0x39')]=qs['limit'](_0x4499c1['query'][_0x55be('0x39')]);_0x32fc2c[_0x55be('0x1e')]=qs[_0x55be('0x1e')](_0x4499c1[_0x55be('0x32')][_0x55be('0x1e')]);}_0x32fc2c[_0x55be('0x3a')]=qs[_0x55be('0x3b')](_0x4499c1[_0x55be('0x32')][_0x55be('0x3b')]);_0x32fc2c[_0x55be('0x3c')]=qs['filters'](_[_0x55be('0x3d')](_0x4499c1[_0x55be('0x32')],_0x438a46[_0x55be('0x33')]),_0x5a369c);if(_0x4499c1[_0x55be('0x32')][_0x55be('0x3e')]){_0x32fc2c[_0x55be('0x3c')]=_[_0x55be('0x3f')](_0x32fc2c[_0x55be('0x3c')],{'$or':_[_0x55be('0x2c')](_0x5a369c,function(_0x4ba3f5){if(_0x4ba3f5['type']!==_0x55be('0x40')){var _0x217b99={};_0x217b99[_0x4ba3f5[_0x55be('0x29')]]={'$like':'%'+_0x4499c1[_0x55be('0x32')][_0x55be('0x3e')]+'%'};return _0x217b99;}})});}_0x32fc2c=_['merge']({},_0x32fc2c,_0x4499c1[_0x55be('0x41')]);var _0x3182b6={'where':_0x32fc2c[_0x55be('0x3c')]};return db['DeskConfiguration'][_0x55be('0x1d')](_0x3182b6)[_0x55be('0x25')](function(_0x238db){_0x32314f[_0x55be('0x1d')]=_0x238db;if(_0x4499c1[_0x55be('0x32')][_0x55be('0x42')]){_0x32fc2c[_0x55be('0x43')]=[{'all':!![]}];}return db[_0x55be('0x2d')][_0x55be('0x44')](_0x32fc2c);})[_0x55be('0x25')](function(_0x352db2){_0x32314f[_0x55be('0x45')]=_0x352db2;return _0x32314f;})[_0x55be('0x25')](respondWithFilteredResult(_0x5738ea,_0x32fc2c))['catch'](handleError(_0x5738ea,null));};exports[_0x55be('0x46')]=function(_0x35b93b,_0x4ea85e){var _0x5ac654={'raw':![],'where':{'id':_0x35b93b[_0x55be('0x47')]['id']}},_0x14b7e8={};_0x14b7e8[_0x55be('0x31')]=_[_0x55be('0x48')](db[_0x55be('0x2d')]['rawAttributes']);_0x14b7e8[_0x55be('0x32')]=_['keys'](_0x35b93b[_0x55be('0x32')]);_0x14b7e8[_0x55be('0x33')]=_[_0x55be('0x34')](_0x14b7e8[_0x55be('0x31')],_0x14b7e8['query']);_0x5ac654['attributes']=_[_0x55be('0x34')](_0x14b7e8[_0x55be('0x31')],qs[_0x55be('0x35')](_0x35b93b['query']['fields']));_0x5ac654[_0x55be('0x36')]=_0x5ac654[_0x55be('0x36')]['length']?_0x5ac654[_0x55be('0x36')]:_0x14b7e8[_0x55be('0x31')];if(_0x35b93b['query'][_0x55be('0x42')]){_0x5ac654['include']=[{'all':!![]}];}_0x5ac654=_[_0x55be('0x3f')]({},_0x5ac654,_0x35b93b[_0x55be('0x41')]);return db['DeskConfiguration']['find'](_0x5ac654)[_0x55be('0x25')](handleEntityNotFound(_0x4ea85e,null))[_0x55be('0x25')](respondWithResult(_0x4ea85e,null))[_0x55be('0x49')](handleError(_0x4ea85e,null));};exports[_0x55be('0x4a')]=function(_0x412a56,_0x14dbb2){return db[_0x55be('0x2d')]['create'](_0x412a56[_0x55be('0x4b')],{})[_0x55be('0x25')](respondWithResult(_0x14dbb2,0xc9))[_0x55be('0x49')](handleError(_0x14dbb2,null));};exports['update']=function(_0x493708,_0x8d97d4){if(_0x493708[_0x55be('0x4b')]['id']){delete _0x493708[_0x55be('0x4b')]['id'];}return db[_0x55be('0x2d')]['find']({'where':{'id':_0x493708[_0x55be('0x47')]['id']}})[_0x55be('0x25')](handleEntityNotFound(_0x8d97d4,null))[_0x55be('0x25')](saveUpdates(_0x493708['body'],null))[_0x55be('0x25')](respondWithResult(_0x8d97d4,null))[_0x55be('0x49')](handleError(_0x8d97d4,null));};exports[_0x55be('0x26')]=function(_0x5db8f8,_0x59e577){return db[_0x55be('0x2d')][_0x55be('0x4c')]({'where':{'id':_0x5db8f8['params']['id']}})[_0x55be('0x25')](handleEntityNotFound(_0x59e577,null))['then'](removeEntity(_0x59e577,null))[_0x55be('0x49')](handleError(_0x59e577,null));};exports['getFields']=function(_0x323dd4,_0x23fb57,_0xdca82d){var _0x41c417={};var _0x1fe309={};var _0x3b5986;var _0x4cf01e;return db[_0x55be('0x2d')][_0x55be('0x4d')]({'where':{'id':_0x323dd4['params']['id']}})[_0x55be('0x25')](handleEntityNotFound(_0x23fb57,null))[_0x55be('0x25')](function(_0x578e0b){if(_0x578e0b){_0x3b5986=_0x578e0b;_0x1fe309[_0x55be('0x31')]=_[_0x55be('0x48')](db[_0x55be('0x4e')][_0x55be('0x2e')]);_0x1fe309['query']=_[_0x55be('0x48')](_0x323dd4[_0x55be('0x32')]);_0x1fe309[_0x55be('0x33')]=_[_0x55be('0x34')](_0x1fe309[_0x55be('0x31')],_0x1fe309[_0x55be('0x32')]);_0x41c417[_0x55be('0x36')]=_[_0x55be('0x34')](_0x1fe309['model'],qs[_0x55be('0x35')](_0x323dd4[_0x55be('0x32')]['fields']));_0x41c417[_0x55be('0x36')]=_0x41c417[_0x55be('0x36')][_0x55be('0x4f')]?_0x41c417['attributes']:_0x1fe309['model'];_0x41c417['order']=qs[_0x55be('0x3b')](_0x323dd4[_0x55be('0x32')]['sort']);_0x41c417[_0x55be('0x3c')]=qs[_0x55be('0x33')](_[_0x55be('0x3d')](_0x323dd4[_0x55be('0x32')],_0x1fe309[_0x55be('0x33')]));if(_0x323dd4['query'][_0x55be('0x3e')]){_0x41c417[_0x55be('0x3c')]=_[_0x55be('0x3f')](_0x41c417['where'],{'$or':_[_0x55be('0x2c')](_0x41c417[_0x55be('0x36')],function(_0x29ba3b){var _0x1eaaee={};_0x1eaaee[_0x29ba3b]={'$like':'%'+_0x323dd4[_0x55be('0x32')][_0x55be('0x3e')]+'%'};return _0x1eaaee;})});}_0x41c417=_[_0x55be('0x3f')]({},_0x41c417,_0x323dd4[_0x55be('0x41')]);return _0x3b5986[_0x55be('0x50')](_0x41c417);}})['then'](function(_0x142c1f){if(_0x142c1f){_0x4cf01e=_0x142c1f[_0x55be('0x4f')];if(!_0x323dd4[_0x55be('0x32')][_0x55be('0x37')](_0x55be('0x38'))){_0x41c417[_0x55be('0x39')]=qs[_0x55be('0x39')](_0x323dd4['query']['limit']);_0x41c417[_0x55be('0x1e')]=qs['offset'](_0x323dd4[_0x55be('0x32')]['offset']);}return _0x3b5986[_0x55be('0x50')](_0x41c417);}})['then'](function(_0x19b1eb){if(_0x19b1eb){return _0x19b1eb?{'count':_0x4cf01e,'rows':_0x19b1eb}:null;}})[_0x55be('0x25')](respondWithResult(_0x23fb57,null))[_0x55be('0x49')](handleError(_0x23fb57,null));};exports[_0x55be('0x51')]=function(_0x4fafeb,_0x1735cb,_0x38dfd4){var _0x521c4f={};var _0x23a62b={};var _0xc5f09e;var _0x6a8159;return db[_0x55be('0x2d')][_0x55be('0x4d')]({'where':{'id':_0x4fafeb['params']['id']}})[_0x55be('0x25')](handleEntityNotFound(_0x1735cb,null))[_0x55be('0x25')](function(_0x570111){if(_0x570111){_0xc5f09e=_0x570111;_0x23a62b[_0x55be('0x31')]=_['keys'](db[_0x55be('0x4e')][_0x55be('0x2e')]);_0x23a62b[_0x55be('0x32')]=_[_0x55be('0x48')](_0x4fafeb[_0x55be('0x32')]);_0x23a62b['filters']=_[_0x55be('0x34')](_0x23a62b['model'],_0x23a62b[_0x55be('0x32')]);_0x521c4f[_0x55be('0x36')]=_[_0x55be('0x34')](_0x23a62b[_0x55be('0x31')],qs[_0x55be('0x35')](_0x4fafeb[_0x55be('0x32')]['fields']));_0x521c4f[_0x55be('0x36')]=_0x521c4f[_0x55be('0x36')][_0x55be('0x4f')]?_0x521c4f[_0x55be('0x36')]:_0x23a62b[_0x55be('0x31')];_0x521c4f[_0x55be('0x3a')]=qs[_0x55be('0x3b')](_0x4fafeb[_0x55be('0x32')][_0x55be('0x3b')]);_0x521c4f[_0x55be('0x3c')]=qs[_0x55be('0x33')](_['pick'](_0x4fafeb[_0x55be('0x32')],_0x23a62b[_0x55be('0x33')]));if(_0x4fafeb['query']['filter']){_0x521c4f['where']=_[_0x55be('0x3f')](_0x521c4f[_0x55be('0x3c')],{'$or':_['map'](_0x521c4f[_0x55be('0x36')],function(_0x1fdb32){var _0x364c37={};_0x364c37[_0x1fdb32]={'$like':'%'+_0x4fafeb[_0x55be('0x32')][_0x55be('0x3e')]+'%'};return _0x364c37;})});}_0x521c4f=_[_0x55be('0x3f')]({},_0x521c4f,_0x4fafeb[_0x55be('0x41')]);return _0xc5f09e[_0x55be('0x51')](_0x521c4f);}})[_0x55be('0x25')](function(_0xfd49b6){if(_0xfd49b6){_0x6a8159=_0xfd49b6[_0x55be('0x4f')];if(!_0x4fafeb[_0x55be('0x32')]['hasOwnProperty'](_0x55be('0x38'))){_0x521c4f[_0x55be('0x39')]=qs[_0x55be('0x39')](_0x4fafeb[_0x55be('0x32')]['limit']);_0x521c4f[_0x55be('0x1e')]=qs[_0x55be('0x1e')](_0x4fafeb['query'][_0x55be('0x1e')]);}return _0xc5f09e[_0x55be('0x51')](_0x521c4f);}})[_0x55be('0x25')](function(_0x21f808){if(_0x21f808){return _0x21f808?{'count':_0x6a8159,'rows':_0x21f808}:null;}})[_0x55be('0x25')](respondWithResult(_0x1735cb,null))[_0x55be('0x49')](handleError(_0x1735cb,null));};exports[_0x55be('0x52')]=function(_0x260c56,_0x55b029,_0x253db9){var _0x1b9a5d={};var _0x57b8fa={};var _0xb0b47d;var _0x3568b6;return db[_0x55be('0x2d')][_0x55be('0x4d')]({'where':{'id':_0x260c56[_0x55be('0x47')]['id']}})[_0x55be('0x25')](handleEntityNotFound(_0x55b029,null))[_0x55be('0x25')](function(_0x4467d9){if(_0x4467d9){_0xb0b47d=_0x4467d9;_0x57b8fa['model']=_[_0x55be('0x48')](db[_0x55be('0x4e')][_0x55be('0x2e')]);_0x57b8fa[_0x55be('0x32')]=_[_0x55be('0x48')](_0x260c56[_0x55be('0x32')]);_0x57b8fa[_0x55be('0x33')]=_['intersection'](_0x57b8fa[_0x55be('0x31')],_0x57b8fa[_0x55be('0x32')]);_0x1b9a5d[_0x55be('0x36')]=_['intersection'](_0x57b8fa[_0x55be('0x31')],qs[_0x55be('0x35')](_0x260c56['query'][_0x55be('0x35')]));_0x1b9a5d[_0x55be('0x36')]=_0x1b9a5d['attributes']['length']?_0x1b9a5d[_0x55be('0x36')]:_0x57b8fa[_0x55be('0x31')];_0x1b9a5d['order']=qs[_0x55be('0x3b')](_0x260c56[_0x55be('0x32')][_0x55be('0x3b')]);_0x1b9a5d[_0x55be('0x3c')]=qs[_0x55be('0x33')](_[_0x55be('0x3d')](_0x260c56[_0x55be('0x32')],_0x57b8fa['filters']));if(_0x260c56[_0x55be('0x32')]['filter']){_0x1b9a5d[_0x55be('0x3c')]=_[_0x55be('0x3f')](_0x1b9a5d[_0x55be('0x3c')],{'$or':_['map'](_0x1b9a5d['attributes'],function(_0x568085){var _0x30848e={};_0x30848e[_0x568085]={'$like':'%'+_0x260c56[_0x55be('0x32')][_0x55be('0x3e')]+'%'};return _0x30848e;})});}_0x1b9a5d=_['merge']({},_0x1b9a5d,_0x260c56['options']);return _0xb0b47d[_0x55be('0x52')](_0x1b9a5d);}})[_0x55be('0x25')](function(_0x14ad9f){if(_0x14ad9f){_0x3568b6=_0x14ad9f['length'];if(!_0x260c56[_0x55be('0x32')]['hasOwnProperty'](_0x55be('0x38'))){_0x1b9a5d[_0x55be('0x39')]=qs[_0x55be('0x39')](_0x260c56['query'][_0x55be('0x39')]);_0x1b9a5d[_0x55be('0x1e')]=qs[_0x55be('0x1e')](_0x260c56[_0x55be('0x32')][_0x55be('0x1e')]);}return _0xb0b47d[_0x55be('0x52')](_0x1b9a5d);}})['then'](function(_0x368d35){if(_0x368d35){return _0x368d35?{'count':_0x3568b6,'rows':_0x368d35}:null;}})[_0x55be('0x25')](respondWithResult(_0x55b029,null))[_0x55be('0x49')](handleError(_0x55b029,null));};exports[_0x55be('0x53')]=function(_0x30a6cf,_0x5a127b,_0xbc3d2c){var _0x5f3f71={};var _0x268655={};var _0x42864e;var _0x68addb;return db[_0x55be('0x2d')]['findOne']({'where':{'id':_0x30a6cf[_0x55be('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a127b,null))[_0x55be('0x25')](function(_0x2aa947){if(_0x2aa947){_0x42864e=_0x2aa947;_0x268655[_0x55be('0x31')]=_[_0x55be('0x48')](db['Tag'][_0x55be('0x2e')]);_0x268655[_0x55be('0x32')]=_[_0x55be('0x48')](_0x30a6cf[_0x55be('0x32')]);_0x268655[_0x55be('0x33')]=_[_0x55be('0x34')](_0x268655[_0x55be('0x31')],_0x268655[_0x55be('0x32')]);_0x5f3f71['attributes']=_[_0x55be('0x34')](_0x268655[_0x55be('0x31')],qs[_0x55be('0x35')](_0x30a6cf['query'][_0x55be('0x35')]));_0x5f3f71[_0x55be('0x36')]=_0x5f3f71[_0x55be('0x36')][_0x55be('0x4f')]?_0x5f3f71[_0x55be('0x36')]:_0x268655[_0x55be('0x31')];_0x5f3f71['order']=qs[_0x55be('0x3b')](_0x30a6cf[_0x55be('0x32')]['sort']);_0x5f3f71['where']=qs[_0x55be('0x33')](_[_0x55be('0x3d')](_0x30a6cf[_0x55be('0x32')],_0x268655[_0x55be('0x33')]));if(_0x30a6cf[_0x55be('0x32')]['filter']){_0x5f3f71[_0x55be('0x3c')]=_[_0x55be('0x3f')](_0x5f3f71['where'],{'$or':_[_0x55be('0x2c')](_0x5f3f71['attributes'],function(_0x47761f){var _0x5f2285={};_0x5f2285[_0x47761f]={'$like':'%'+_0x30a6cf[_0x55be('0x32')][_0x55be('0x3e')]+'%'};return _0x5f2285;})});}_0x5f3f71=_[_0x55be('0x3f')]({},_0x5f3f71,_0x30a6cf[_0x55be('0x41')]);return _0x42864e[_0x55be('0x53')](_0x5f3f71);}})[_0x55be('0x25')](function(_0x2ec464){if(_0x2ec464){_0x68addb=_0x2ec464['length'];if(!_0x30a6cf[_0x55be('0x32')][_0x55be('0x37')](_0x55be('0x38'))){_0x5f3f71[_0x55be('0x39')]=qs[_0x55be('0x39')](_0x30a6cf[_0x55be('0x32')][_0x55be('0x39')]);_0x5f3f71['offset']=qs[_0x55be('0x1e')](_0x30a6cf[_0x55be('0x32')][_0x55be('0x1e')]);}return _0x42864e[_0x55be('0x53')](_0x5f3f71);}})['then'](function(_0x1b3451){if(_0x1b3451){return _0x1b3451?{'count':_0x68addb,'rows':_0x1b3451}:null;}})[_0x55be('0x25')](respondWithResult(_0x5a127b,null))[_0x55be('0x49')](handleError(_0x5a127b,null));};exports[_0x55be('0x54')]=function(_0x301932,_0x5b89a4,_0x244265){if(_0x301932['body']['id']){delete _0x301932[_0x55be('0x4b')]['id'];}return db[_0x55be('0x2d')][_0x55be('0x4d')]({'where':{'id':_0x301932[_0x55be('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b89a4,null))[_0x55be('0x25')](function(_0x1eb1ab){if(_0x1eb1ab){return _0x1eb1ab[_0x55be('0x54')](_0x301932[_0x55be('0x4b')][_0x55be('0x55')]||[]);}return null;})[_0x55be('0x25')](respondWithResult(_0x5b89a4,null))[_0x55be('0x49')](handleError(_0x5b89a4,null));};
\ No newline at end of file
index 85d52cf..288937f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b0=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xe5b0,0x156));var _0x0e5b=function(_0x5c866e,_0x125ba0){_0x5c866e=_0x5c866e-0x0;var _0x1e37cc=_0xe5b0[_0x5c866e];return _0x1e37cc;};'use strict';var _=require(_0x0e5b('0x0'));var util=require(_0x0e5b('0x1'));var logger=require('../../config/logger')(_0x0e5b('0x2'));var moment=require(_0x0e5b('0x3'));var BPromise=require(_0x0e5b('0x4'));var rp=require(_0x0e5b('0x5'));var fs=require('fs');var path=require(_0x0e5b('0x6'));var rimraf=require(_0x0e5b('0x7'));var config=require(_0x0e5b('0x8'));var attributes=require(_0x0e5b('0x9'));module[_0x0e5b('0xa')]=function(_0x48e605,_0x293099){return _0x48e605[_0x0e5b('0xb')](_0x0e5b('0xc'),attributes,{'tableName':_0x0e5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3189=['./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x15c861,_0x46b39b){var _0x5e9a4e=function(_0x2f861){while(--_0x2f861){_0x15c861['push'](_0x15c861['shift']());}};_0x5e9a4e(++_0x46b39b);}(_0x3189,0xae));var _0x9318=function(_0x5b07db,_0x288d7d){_0x5b07db=_0x5b07db-0x0;var _0x3edec2=_0x3189[_0x5b07db];return _0x3edec2;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var logger=require('../../config/logger')(_0x9318('0x2'));var moment=require(_0x9318('0x3'));var BPromise=require(_0x9318('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9318('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9318('0x6'));module[_0x9318('0x7')]=function(_0x50b157,_0x1175d3){return _0x50b157['define']('DeskConfiguration',attributes,{'tableName':_0x9318('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c9c94a0..5d1bc41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cf5=['rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0x2cf5,0x19f));var _0x52cf=function(_0x556195,_0x26f6f8){_0x556195=_0x556195-0x0;var _0x101fbc=_0x2cf5[_0x556195];return _0x101fbc;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var moment=require('moment');var BPromise=require(_0x52cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52cf('0x3'));var db=require(_0x52cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52cf('0x5'));var config=require(_0x52cf('0x6'));var jayson=require(_0x52cf('0x7'));var client=jayson[_0x52cf('0x8')][_0x52cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13d2fe,_0x1ab7cd,_0x390162){return new BPromise(function(_0x41d874,_0x23b2ab){return client[_0x52cf('0xa')](_0x13d2fe,_0x390162)['then'](function(_0x46d7ac){logger[_0x52cf('0xb')](_0x52cf('0xc'),_0x1ab7cd,_0x52cf('0xd'));logger['debug'](_0x52cf('0xe'),_0x1ab7cd,_0x52cf('0xd'),JSON[_0x52cf('0xf')](_0x46d7ac));if(_0x46d7ac['error']){if(_0x46d7ac[_0x52cf('0x10')][_0x52cf('0x11')]===0x1f4){logger[_0x52cf('0x10')](_0x52cf('0xc'),_0x1ab7cd,_0x46d7ac[_0x52cf('0x10')][_0x52cf('0x12')]);return _0x23b2ab(_0x46d7ac['error']['message']);}logger[_0x52cf('0x10')](_0x52cf('0xc'),_0x1ab7cd,_0x46d7ac[_0x52cf('0x10')][_0x52cf('0x12')]);return _0x41d874(_0x46d7ac[_0x52cf('0x10')][_0x52cf('0x12')]);}else{logger[_0x52cf('0xb')](_0x52cf('0xc'),_0x1ab7cd,'request\x20sent');_0x41d874(_0x46d7ac[_0x52cf('0x13')][_0x52cf('0x12')]);}})[_0x52cf('0x14')](function(_0x580154){logger[_0x52cf('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x1ab7cd,_0x580154);_0x23b2ab(_0x580154);});});}
\ No newline at end of file
+var _0x9c30=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x56bb14,_0x2d6905){var _0x5bc862=function(_0x514c37){while(--_0x514c37){_0x56bb14['push'](_0x56bb14['shift']());}};_0x5bc862(++_0x2d6905);}(_0x9c30,0x11a));var _0x09c3=function(_0x508bb8,_0x471405){_0x508bb8=_0x508bb8-0x0;var _0x295396=_0x9c30[_0x508bb8];return _0x295396;};'use strict';var _=require(_0x09c3('0x0'));var util=require('util');var moment=require(_0x09c3('0x1'));var BPromise=require(_0x09c3('0x2'));var rs=require(_0x09c3('0x3'));var fs=require('fs');var Redis=require(_0x09c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x09c3('0x6'));var client=jayson[_0x09c3('0x7')][_0x09c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8916,_0x27358b,_0x4a39b7){return new BPromise(function(_0x4aff86,_0x306ae5){return client[_0x09c3('0x9')](_0x1b8916,_0x4a39b7)[_0x09c3('0xa')](function(_0xcc28d8){logger[_0x09c3('0xb')](_0x09c3('0xc'),_0x27358b,'request\x20sent');logger[_0x09c3('0xd')](_0x09c3('0xe'),_0x27358b,_0x09c3('0xf'),JSON['stringify'](_0xcc28d8));if(_0xcc28d8[_0x09c3('0x10')]){if(_0xcc28d8[_0x09c3('0x10')][_0x09c3('0x11')]===0x1f4){logger[_0x09c3('0x10')](_0x09c3('0xc'),_0x27358b,_0xcc28d8[_0x09c3('0x10')][_0x09c3('0x12')]);return _0x306ae5(_0xcc28d8[_0x09c3('0x10')]['message']);}logger[_0x09c3('0x10')](_0x09c3('0xc'),_0x27358b,_0xcc28d8[_0x09c3('0x10')]['message']);return _0x4aff86(_0xcc28d8[_0x09c3('0x10')][_0x09c3('0x12')]);}else{logger[_0x09c3('0xb')](_0x09c3('0xc'),_0x27358b,_0x09c3('0xf'));_0x4aff86(_0xcc28d8[_0x09c3('0x13')][_0x09c3('0x12')]);}})['catch'](function(_0x243a98){logger[_0x09c3('0x10')](_0x09c3('0xc'),_0x27358b,_0x243a98);_0x306ae5(_0x243a98);});});}
\ No newline at end of file
index 2b91c12..5785a8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','/:id','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x32f9e6,_0x55ed80){var _0x11a5ea=function(_0x1862ab){while(--_0x1862ab){_0x32f9e6['push'](_0x32f9e6['shift']());}};_0x11a5ea(++_0x55ed80);}(_0x4bab,0xc8));var _0xb4ba=function(_0x424e00,_0x1f6329){_0x424e00=_0x424e00-0x0;var _0x31aad6=_0x4bab[_0x424e00];return _0x31aad6;};'use strict';var multer=require('multer');var util=require(_0xb4ba('0x0'));var path=require(_0xb4ba('0x1'));var timeout=require(_0xb4ba('0x2'));var express=require(_0xb4ba('0x3'));var router=express[_0xb4ba('0x4')]();var fs_extra=require(_0xb4ba('0x5'));var auth=require(_0xb4ba('0x6'));var interaction=require(_0xb4ba('0x7'));var config=require('../../config/environment');var controller=require(_0xb4ba('0x8'));router[_0xb4ba('0x9')]('/',auth[_0xb4ba('0xa')](),controller['index']);router[_0xb4ba('0x9')](_0xb4ba('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0xc')]);router[_0xb4ba('0xd')](_0xb4ba('0xb'),auth[_0xb4ba('0xa')](),controller['update']);router[_0xb4ba('0xe')](_0xb4ba('0xb'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0xf')]);module[_0xb4ba('0x10')]=router;
\ No newline at end of file
+var _0x89b3=['/:id','create','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x5cf175,_0x4de5af){var _0x1a44b4=function(_0x3b13d1){while(--_0x3b13d1){_0x5cf175['push'](_0x5cf175['shift']());}};_0x1a44b4(++_0x4de5af);}(_0x89b3,0x12a));var _0x389b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89b3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x389b('0x0'));var util=require(_0x389b('0x1'));var path=require(_0x389b('0x2'));var timeout=require(_0x389b('0x3'));var express=require('express');var router=express[_0x389b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x389b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x389b('0x6'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x389b('0x7')](),controller[_0x389b('0x8')]);router[_0x389b('0x9')](_0x389b('0xa'),auth[_0x389b('0x7')](),controller['show']);router['post']('/',auth[_0x389b('0x7')](),controller[_0x389b('0xb')]);router['put'](_0x389b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x389b('0xc')](_0x389b('0xa'),auth[_0x389b('0x7')](),controller['destroy']);module[_0x389b('0xd')]=router;
\ No newline at end of file
index adbcbb9..421a9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb71b=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x394038,_0x516690){var _0x2b036c=function(_0x11171b){while(--_0x11171b){_0x394038['push'](_0x394038['shift']());}};_0x2b036c(++_0x516690);}(_0xb71b,0x12a));var _0xbb71=function(_0x52c14d,_0x17e954){_0x52c14d=_0x52c14d-0x0;var _0x268d78=_0xb71b[_0x52c14d];return _0x268d78;};'use strict';var Sequelize=require(_0xbb71('0x0'));module['exports']={'type':{'type':Sequelize[_0xbb71('0x1')](_0xbb71('0x2'),_0xbb71('0x3'),_0xbb71('0x4'),_0xbb71('0x5'),_0xbb71('0x6')),'defaultValue':_0xbb71('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbb71('0x7')]},'keyType':{'type':Sequelize[_0xbb71('0x1')](_0xbb71('0x2'),_0xbb71('0x3'),_0xbb71('0x4'))},'keyContent':{'type':Sequelize[_0xbb71('0x7')]},'idField':{'type':Sequelize[_0xbb71('0x7')]},'nameField':{'type':Sequelize[_0xbb71('0x7')]},'customField':{'type':Sequelize[_0xbb71('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd864=['exports','ENUM','string','variable','picklist','STRING','customVariable','sequelize'];(function(_0x96e023,_0x36b00a){var _0x2821c8=function(_0x437194){while(--_0x437194){_0x96e023['push'](_0x96e023['shift']());}};_0x2821c8(++_0x36b00a);}(_0xd864,0xef));var _0x4d86=function(_0x266386,_0x2452a6){_0x266386=_0x266386-0x0;var _0x510249=_0xd864[_0x266386];return _0x510249;};'use strict';var Sequelize=require(_0x4d86('0x0'));module[_0x4d86('0x1')]={'type':{'type':Sequelize[_0x4d86('0x2')](_0x4d86('0x3'),_0x4d86('0x4'),'customVariable','keyValue',_0x4d86('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4d86('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x4d86('0x3'),_0x4d86('0x4'),_0x4d86('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4d86('0x6')]},'nameField':{'type':Sequelize[_0x4d86('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d86('0x6')]}};
\ No newline at end of file
index eac48b8..d1313bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec13=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','show','params','DeskField','find','create','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x443a86,_0x5c2c80){var _0x5a29cc=function(_0x54dc55){while(--_0x54dc55){_0x443a86['push'](_0x443a86['shift']());}};_0x5a29cc(++_0x5c2c80);}(_0xec13,0x8f));var _0x3ec1=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xec13[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x3ec1('0x0'));var rimraf=require(_0x3ec1('0x1'));var zipdir=require(_0x3ec1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ec1('0x3'));var moment=require(_0x3ec1('0x4'));var BPromise=require(_0x3ec1('0x5'));var Mustache=require('mustache');var util=require(_0x3ec1('0x6'));var path=require(_0x3ec1('0x7'));var sox=require('sox');var csv=require(_0x3ec1('0x8'));var ejs=require(_0x3ec1('0x9'));var fs=require('fs');var fs_extra=require(_0x3ec1('0xa'));var _=require('lodash');var squel=require(_0x3ec1('0xb'));var crypto=require(_0x3ec1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3ec1('0xd'));var toCsv=require(_0x3ec1('0x8'));var querystring=require(_0x3ec1('0xe'));var Papa=require(_0x3ec1('0xf'));var Redis=require(_0x3ec1('0x10'));var authService=require(_0x3ec1('0x11'));var qs=require(_0x3ec1('0x12'));var as=require(_0x3ec1('0x13'));var hardwareService=require(_0x3ec1('0x14'));var logger=require(_0x3ec1('0x15'))(_0x3ec1('0x16'));var utils=require(_0x3ec1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ec1('0x18'));var db=require(_0x3ec1('0x19'))['db'];function respondWithStatusCode(_0x5eaf3a,_0x22fe86){_0x22fe86=_0x22fe86||0xcc;return function(_0x5af222){if(_0x5af222){return _0x5eaf3a[_0x3ec1('0x1a')](_0x22fe86);}return _0x5eaf3a[_0x3ec1('0x1b')](_0x22fe86)[_0x3ec1('0x1c')]();};}function respondWithResult(_0x3f39d7,_0x1bae90){_0x1bae90=_0x1bae90||0xc8;return function(_0x56b1ec){if(_0x56b1ec){return _0x3f39d7[_0x3ec1('0x1b')](_0x1bae90)[_0x3ec1('0x1d')](_0x56b1ec);}};}function respondWithFilteredResult(_0xc479d4,_0x33ce2b){return function(_0x342b1f){if(_0x342b1f){var _0x39e89c=typeof _0x33ce2b['offset']==='undefined'&&typeof _0x33ce2b[_0x3ec1('0x1e')]===_0x3ec1('0x1f');var _0x365bbd=_0x342b1f['count'];var _0x489ea0=_0x39e89c?0x0:_0x33ce2b[_0x3ec1('0x20')];var _0x31ea5e=_0x39e89c?_0x342b1f['count']:_0x33ce2b[_0x3ec1('0x20')]+_0x33ce2b['limit'];var _0x4ebdcc;if(_0x31ea5e>=_0x365bbd){_0x31ea5e=_0x365bbd;_0x4ebdcc=0xc8;}else{_0x4ebdcc=0xce;}_0xc479d4['status'](_0x4ebdcc);return _0xc479d4[_0x3ec1('0x21')](_0x3ec1('0x22'),_0x489ea0+'-'+_0x31ea5e+'/'+_0x365bbd)[_0x3ec1('0x1d')](_0x342b1f);}return null;};}function patchUpdates(_0x5b3484){return function(_0x2123b4){try{jsonpatch[_0x3ec1('0x23')](_0x2123b4,_0x5b3484,!![]);}catch(_0x488d10){return BPromise[_0x3ec1('0x24')](_0x488d10);}return _0x2123b4[_0x3ec1('0x25')]();};}function saveUpdates(_0x7f9b71,_0x59543b){return function(_0x299d7f){if(_0x299d7f){return _0x299d7f[_0x3ec1('0x26')](_0x7f9b71)[_0x3ec1('0x27')](function(_0x2ad2af){return _0x2ad2af;});}return null;};}function removeEntity(_0x5efd6e,_0x88ebac){return function(_0x15ef3b){if(_0x15ef3b){return _0x15ef3b[_0x3ec1('0x28')]()['then'](function(){_0x5efd6e['status'](0xcc)[_0x3ec1('0x1c')]();});}};}function handleEntityNotFound(_0x120cb3,_0x13a344){return function(_0x2d5ced){if(!_0x2d5ced){_0x120cb3['sendStatus'](0x194);}return _0x2d5ced;};}function handleError(_0x42eb51,_0x48b816){_0x48b816=_0x48b816||0x1f4;return function(_0x4f9572){logger[_0x3ec1('0x29')](_0x4f9572[_0x3ec1('0x2a')]);if(_0x4f9572[_0x3ec1('0x2b')]){delete _0x4f9572[_0x3ec1('0x2b')];}_0x42eb51[_0x3ec1('0x1b')](_0x48b816)[_0x3ec1('0x2c')](_0x4f9572);};}exports[_0x3ec1('0x2d')]=function(_0xf1146,_0x383e2b){var _0x47dfd5={},_0x481dd9={},_0x2407e6={'count':0x0,'rows':[]};var _0x53e0d9=_[_0x3ec1('0x2e')](db['DeskField'][_0x3ec1('0x2f')],function(_0x26bc87){return{'name':_0x26bc87['fieldName'],'type':_0x26bc87['type']['key']};});_0x481dd9[_0x3ec1('0x30')]=_[_0x3ec1('0x2e')](_0x53e0d9,_0x3ec1('0x2b'));_0x481dd9['query']=_[_0x3ec1('0x31')](_0xf1146[_0x3ec1('0x32')]);_0x481dd9[_0x3ec1('0x33')]=_[_0x3ec1('0x34')](_0x481dd9[_0x3ec1('0x30')],_0x481dd9['query']);_0x47dfd5[_0x3ec1('0x35')]=_['intersection'](_0x481dd9[_0x3ec1('0x30')],qs['fields'](_0xf1146[_0x3ec1('0x32')][_0x3ec1('0x36')]));_0x47dfd5[_0x3ec1('0x35')]=_0x47dfd5[_0x3ec1('0x35')][_0x3ec1('0x37')]?_0x47dfd5['attributes']:_0x481dd9[_0x3ec1('0x30')];if(!_0xf1146[_0x3ec1('0x32')][_0x3ec1('0x38')](_0x3ec1('0x39'))){_0x47dfd5[_0x3ec1('0x1e')]=qs[_0x3ec1('0x1e')](_0xf1146[_0x3ec1('0x32')]['limit']);_0x47dfd5[_0x3ec1('0x20')]=qs['offset'](_0xf1146[_0x3ec1('0x32')][_0x3ec1('0x20')]);}_0x47dfd5[_0x3ec1('0x3a')]=qs[_0x3ec1('0x3b')](_0xf1146['query'][_0x3ec1('0x3b')]);_0x47dfd5[_0x3ec1('0x3c')]=qs[_0x3ec1('0x33')](_[_0x3ec1('0x3d')](_0xf1146[_0x3ec1('0x32')],_0x481dd9['filters']),_0x53e0d9);if(_0xf1146[_0x3ec1('0x32')]['filter']){_0x47dfd5['where']=_[_0x3ec1('0x3e')](_0x47dfd5[_0x3ec1('0x3c')],{'$or':_[_0x3ec1('0x2e')](_0x53e0d9,function(_0x3af4e2){if(_0x3af4e2[_0x3ec1('0x3f')]!==_0x3ec1('0x40')){var _0x475bfe={};_0x475bfe[_0x3af4e2['name']]={'$like':'%'+_0xf1146[_0x3ec1('0x32')][_0x3ec1('0x41')]+'%'};return _0x475bfe;}})});}_0x47dfd5=_[_0x3ec1('0x3e')]({},_0x47dfd5,_0xf1146[_0x3ec1('0x42')]);var _0x4d8ebc={'where':_0x47dfd5['where']};return db['DeskField']['count'](_0x4d8ebc)[_0x3ec1('0x27')](function(_0x4cf944){_0x2407e6[_0x3ec1('0x43')]=_0x4cf944;if(_0xf1146[_0x3ec1('0x32')][_0x3ec1('0x44')]){_0x47dfd5[_0x3ec1('0x45')]=[{'all':!![]}];}return db['DeskField'][_0x3ec1('0x46')](_0x47dfd5);})[_0x3ec1('0x27')](function(_0x29dbd5){_0x2407e6['rows']=_0x29dbd5;return _0x2407e6;})[_0x3ec1('0x27')](respondWithFilteredResult(_0x383e2b,_0x47dfd5))['catch'](handleError(_0x383e2b,null));};exports[_0x3ec1('0x47')]=function(_0x11b31d,_0x19460a){var _0x3bd304={'raw':!![],'where':{'id':_0x11b31d[_0x3ec1('0x48')]['id']}},_0x27b720={};_0x27b720[_0x3ec1('0x30')]=_[_0x3ec1('0x31')](db[_0x3ec1('0x49')][_0x3ec1('0x2f')]);_0x27b720['query']=_[_0x3ec1('0x31')](_0x11b31d[_0x3ec1('0x32')]);_0x27b720[_0x3ec1('0x33')]=_[_0x3ec1('0x34')](_0x27b720[_0x3ec1('0x30')],_0x27b720[_0x3ec1('0x32')]);_0x3bd304['attributes']=_[_0x3ec1('0x34')](_0x27b720['model'],qs[_0x3ec1('0x36')](_0x11b31d['query'][_0x3ec1('0x36')]));_0x3bd304['attributes']=_0x3bd304[_0x3ec1('0x35')][_0x3ec1('0x37')]?_0x3bd304['attributes']:_0x27b720[_0x3ec1('0x30')];if(_0x11b31d[_0x3ec1('0x32')][_0x3ec1('0x44')]){_0x3bd304[_0x3ec1('0x45')]=[{'all':!![]}];}_0x3bd304=_['merge']({},_0x3bd304,_0x11b31d[_0x3ec1('0x42')]);return db['DeskField'][_0x3ec1('0x4a')](_0x3bd304)['then'](handleEntityNotFound(_0x19460a,null))['then'](respondWithResult(_0x19460a,null))['catch'](handleError(_0x19460a,null));};exports[_0x3ec1('0x4b')]=function(_0x2035f7,_0x86bef1){return db[_0x3ec1('0x49')][_0x3ec1('0x4b')](_0x2035f7['body'],{})['then'](respondWithResult(_0x86bef1,0xc9))[_0x3ec1('0x4c')](handleError(_0x86bef1,null));};exports[_0x3ec1('0x26')]=function(_0x10f52b,_0x5c9695){if(_0x10f52b[_0x3ec1('0x4d')]['id']){delete _0x10f52b['body']['id'];}return db['DeskField'][_0x3ec1('0x4a')]({'where':{'id':_0x10f52b[_0x3ec1('0x48')]['id']}})[_0x3ec1('0x27')](handleEntityNotFound(_0x5c9695,null))[_0x3ec1('0x27')](saveUpdates(_0x10f52b[_0x3ec1('0x4d')],null))['then'](respondWithResult(_0x5c9695,null))['catch'](handleError(_0x5c9695,null));};exports[_0x3ec1('0x28')]=function(_0x1725e2,_0x1754b8){return db[_0x3ec1('0x49')][_0x3ec1('0x4a')]({'where':{'id':_0x1725e2[_0x3ec1('0x48')]['id']}})['then'](handleEntityNotFound(_0x1754b8,null))[_0x3ec1('0x27')](removeEntity(_0x1754b8,null))[_0x3ec1('0x4c')](handleError(_0x1754b8,null));};
\ No newline at end of file
+var _0x1488=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','DeskField','count','include','findAll','show','params','keys','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xbdde9f,_0x58001d){var _0xb76631=function(_0x281a91){while(--_0x281a91){_0xbdde9f['push'](_0xbdde9f['shift']());}};_0xb76631(++_0x58001d);}(_0x1488,0x88));var _0x8148=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x1488[_0x12ddb2];return _0x10b6dd;};'use strict';var emlformat=require(_0x8148('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8148('0x1'));var jsonpatch=require(_0x8148('0x2'));var rp=require(_0x8148('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8148('0x4'));var util=require('util');var path=require(_0x8148('0x5'));var sox=require(_0x8148('0x6'));var csv=require(_0x8148('0x7'));var ejs=require(_0x8148('0x8'));var fs=require('fs');var fs_extra=require(_0x8148('0x9'));var _=require(_0x8148('0xa'));var squel=require(_0x8148('0xb'));var crypto=require(_0x8148('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8148('0xd'));var toCsv=require(_0x8148('0x7'));var querystring=require(_0x8148('0xe'));var Papa=require(_0x8148('0xf'));var Redis=require(_0x8148('0x10'));var authService=require(_0x8148('0x11'));var qs=require(_0x8148('0x12'));var as=require(_0x8148('0x13'));var hardwareService=require(_0x8148('0x14'));var logger=require(_0x8148('0x15'))(_0x8148('0x16'));var utils=require(_0x8148('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8148('0x18'));var db=require(_0x8148('0x19'))['db'];function respondWithStatusCode(_0x14a40a,_0x50d09d){_0x50d09d=_0x50d09d||0xcc;return function(_0x4ca1a4){if(_0x4ca1a4){return _0x14a40a[_0x8148('0x1a')](_0x50d09d);}return _0x14a40a[_0x8148('0x1b')](_0x50d09d)['end']();};}function respondWithResult(_0x1bf571,_0x15478c){_0x15478c=_0x15478c||0xc8;return function(_0x431dcb){if(_0x431dcb){return _0x1bf571[_0x8148('0x1b')](_0x15478c)[_0x8148('0x1c')](_0x431dcb);}};}function respondWithFilteredResult(_0x5b99a2,_0x41c69f){return function(_0x544034){if(_0x544034){var _0x4f9ce4=typeof _0x41c69f[_0x8148('0x1d')]==='undefined'&&typeof _0x41c69f['limit']===_0x8148('0x1e');var _0x4a3135=_0x544034['count'];var _0x48391c=_0x4f9ce4?0x0:_0x41c69f[_0x8148('0x1d')];var _0x58d1b8=_0x4f9ce4?_0x544034['count']:_0x41c69f[_0x8148('0x1d')]+_0x41c69f['limit'];var _0x1e5e6b;if(_0x58d1b8>=_0x4a3135){_0x58d1b8=_0x4a3135;_0x1e5e6b=0xc8;}else{_0x1e5e6b=0xce;}_0x5b99a2['status'](_0x1e5e6b);return _0x5b99a2[_0x8148('0x1f')](_0x8148('0x20'),_0x48391c+'-'+_0x58d1b8+'/'+_0x4a3135)[_0x8148('0x1c')](_0x544034);}return null;};}function patchUpdates(_0x3d1e67){return function(_0x23bff1){try{jsonpatch[_0x8148('0x21')](_0x23bff1,_0x3d1e67,!![]);}catch(_0x3c0113){return BPromise[_0x8148('0x22')](_0x3c0113);}return _0x23bff1[_0x8148('0x23')]();};}function saveUpdates(_0x209079,_0xcb268d){return function(_0x1a2fb6){if(_0x1a2fb6){return _0x1a2fb6[_0x8148('0x24')](_0x209079)[_0x8148('0x25')](function(_0x5b128a){return _0x5b128a;});}return null;};}function removeEntity(_0x243a7a,_0xba5a07){return function(_0x52e0d4){if(_0x52e0d4){return _0x52e0d4['destroy']()[_0x8148('0x25')](function(){_0x243a7a['status'](0xcc)[_0x8148('0x26')]();});}};}function handleEntityNotFound(_0x122dc0,_0x150304){return function(_0x5af4d2){if(!_0x5af4d2){_0x122dc0['sendStatus'](0x194);}return _0x5af4d2;};}function handleError(_0x29b4cc,_0x25c2b9){_0x25c2b9=_0x25c2b9||0x1f4;return function(_0x482d40){logger[_0x8148('0x27')](_0x482d40[_0x8148('0x28')]);if(_0x482d40['name']){delete _0x482d40[_0x8148('0x29')];}_0x29b4cc[_0x8148('0x1b')](_0x25c2b9)[_0x8148('0x2a')](_0x482d40);};}exports['index']=function(_0x37deec,_0x41844e){var _0x4487ba={},_0x3aa8a8={},_0x54ea46={'count':0x0,'rows':[]};var _0x454856=_['map'](db['DeskField'][_0x8148('0x2b')],function(_0x5b3120){return{'name':_0x5b3120[_0x8148('0x2c')],'type':_0x5b3120[_0x8148('0x2d')][_0x8148('0x2e')]};});_0x3aa8a8[_0x8148('0x2f')]=_[_0x8148('0x30')](_0x454856,_0x8148('0x29'));_0x3aa8a8[_0x8148('0x31')]=_['keys'](_0x37deec[_0x8148('0x31')]);_0x3aa8a8[_0x8148('0x32')]=_[_0x8148('0x33')](_0x3aa8a8['model'],_0x3aa8a8[_0x8148('0x31')]);_0x4487ba[_0x8148('0x34')]=_[_0x8148('0x33')](_0x3aa8a8[_0x8148('0x2f')],qs[_0x8148('0x35')](_0x37deec['query'][_0x8148('0x35')]));_0x4487ba[_0x8148('0x34')]=_0x4487ba[_0x8148('0x34')][_0x8148('0x36')]?_0x4487ba[_0x8148('0x34')]:_0x3aa8a8[_0x8148('0x2f')];if(!_0x37deec[_0x8148('0x31')][_0x8148('0x37')](_0x8148('0x38'))){_0x4487ba[_0x8148('0x39')]=qs['limit'](_0x37deec[_0x8148('0x31')][_0x8148('0x39')]);_0x4487ba[_0x8148('0x1d')]=qs[_0x8148('0x1d')](_0x37deec[_0x8148('0x31')][_0x8148('0x1d')]);}_0x4487ba['order']=qs[_0x8148('0x3a')](_0x37deec['query']['sort']);_0x4487ba[_0x8148('0x3b')]=qs[_0x8148('0x32')](_[_0x8148('0x3c')](_0x37deec[_0x8148('0x31')],_0x3aa8a8['filters']),_0x454856);if(_0x37deec[_0x8148('0x31')][_0x8148('0x3d')]){_0x4487ba[_0x8148('0x3b')]=_[_0x8148('0x3e')](_0x4487ba[_0x8148('0x3b')],{'$or':_[_0x8148('0x30')](_0x454856,function(_0x5012b4){if(_0x5012b4[_0x8148('0x2d')]!==_0x8148('0x3f')){var _0x455449={};_0x455449[_0x5012b4[_0x8148('0x29')]]={'$like':'%'+_0x37deec['query']['filter']+'%'};return _0x455449;}})});}_0x4487ba=_[_0x8148('0x3e')]({},_0x4487ba,_0x37deec[_0x8148('0x40')]);var _0x3398ba={'where':_0x4487ba['where']};return db[_0x8148('0x41')][_0x8148('0x42')](_0x3398ba)[_0x8148('0x25')](function(_0x39a901){_0x54ea46['count']=_0x39a901;if(_0x37deec[_0x8148('0x31')]['includeAll']){_0x4487ba[_0x8148('0x43')]=[{'all':!![]}];}return db[_0x8148('0x41')][_0x8148('0x44')](_0x4487ba);})['then'](function(_0xa4ba8e){_0x54ea46['rows']=_0xa4ba8e;return _0x54ea46;})[_0x8148('0x25')](respondWithFilteredResult(_0x41844e,_0x4487ba))['catch'](handleError(_0x41844e,null));};exports[_0x8148('0x45')]=function(_0x931d97,_0x1980ed){var _0x1d75e4={'raw':!![],'where':{'id':_0x931d97[_0x8148('0x46')]['id']}},_0xcd9484={};_0xcd9484[_0x8148('0x2f')]=_[_0x8148('0x47')](db[_0x8148('0x41')][_0x8148('0x2b')]);_0xcd9484[_0x8148('0x31')]=_['keys'](_0x931d97[_0x8148('0x31')]);_0xcd9484[_0x8148('0x32')]=_[_0x8148('0x33')](_0xcd9484['model'],_0xcd9484[_0x8148('0x31')]);_0x1d75e4['attributes']=_['intersection'](_0xcd9484['model'],qs[_0x8148('0x35')](_0x931d97[_0x8148('0x31')]['fields']));_0x1d75e4[_0x8148('0x34')]=_0x1d75e4['attributes']['length']?_0x1d75e4[_0x8148('0x34')]:_0xcd9484[_0x8148('0x2f')];if(_0x931d97['query'][_0x8148('0x48')]){_0x1d75e4[_0x8148('0x43')]=[{'all':!![]}];}_0x1d75e4=_['merge']({},_0x1d75e4,_0x931d97['options']);return db[_0x8148('0x41')][_0x8148('0x49')](_0x1d75e4)[_0x8148('0x25')](handleEntityNotFound(_0x1980ed,null))[_0x8148('0x25')](respondWithResult(_0x1980ed,null))[_0x8148('0x4a')](handleError(_0x1980ed,null));};exports[_0x8148('0x4b')]=function(_0x1421a5,_0x509262){return db[_0x8148('0x41')][_0x8148('0x4b')](_0x1421a5[_0x8148('0x4c')],{})[_0x8148('0x25')](respondWithResult(_0x509262,0xc9))[_0x8148('0x4a')](handleError(_0x509262,null));};exports[_0x8148('0x24')]=function(_0x14c8a9,_0x6c3d22){if(_0x14c8a9[_0x8148('0x4c')]['id']){delete _0x14c8a9['body']['id'];}return db[_0x8148('0x41')][_0x8148('0x49')]({'where':{'id':_0x14c8a9[_0x8148('0x46')]['id']}})[_0x8148('0x25')](handleEntityNotFound(_0x6c3d22,null))['then'](saveUpdates(_0x14c8a9[_0x8148('0x4c')],null))[_0x8148('0x25')](respondWithResult(_0x6c3d22,null))[_0x8148('0x4a')](handleError(_0x6c3d22,null));};exports['destroy']=function(_0x5c4427,_0x365567){return db[_0x8148('0x41')][_0x8148('0x49')]({'where':{'id':_0x5c4427[_0x8148('0x46')]['id']}})['then'](handleEntityNotFound(_0x365567,null))[_0x8148('0x25')](removeEntity(_0x365567,null))[_0x8148('0x4a')](handleError(_0x365567,null));};
\ No newline at end of file
index de725d0..f7d1254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3608=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','lodash'];(function(_0x5b9b45,_0x457eb3){var _0x3bdb18=function(_0x2534f7){while(--_0x2534f7){_0x5b9b45['push'](_0x5b9b45['shift']());}};_0x3bdb18(++_0x457eb3);}(_0x3608,0x141));var _0x8360=function(_0x2c55dc,_0x3eff4a){_0x2c55dc=_0x2c55dc-0x0;var _0x2858b6=_0x3608[_0x2c55dc];return _0x2858b6;};'use strict';var _=require(_0x8360('0x0'));var util=require('util');var logger=require(_0x8360('0x1'))(_0x8360('0x2'));var moment=require(_0x8360('0x3'));var BPromise=require(_0x8360('0x4'));var rp=require(_0x8360('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8360('0x6'));var config=require(_0x8360('0x7'));var attributes=require(_0x8360('0x8'));module[_0x8360('0x9')]=function(_0x186f9d,_0x24b0b2){return _0x186f9d[_0x8360('0xa')](_0x8360('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x8360('0xc'),'fields':[_0x8360('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3f3=['moment','request-promise','path','rimraf','../../config/environment','DeskField','int_desk_fields','desk_unique_index','lodash','util','../../config/logger','api'];(function(_0x4ca308,_0xaf2907){var _0x188f56=function(_0x449539){while(--_0x449539){_0x4ca308['push'](_0x4ca308['shift']());}};_0x188f56(++_0xaf2907);}(_0xa3f3,0x98));var _0x3a3f=function(_0x40f3c1,_0x48c25f){_0x40f3c1=_0x40f3c1-0x0;var _0x1cb940=_0xa3f3[_0x40f3c1];return _0x1cb940;};'use strict';var _=require(_0x3a3f('0x0'));var util=require(_0x3a3f('0x1'));var logger=require(_0x3a3f('0x2'))(_0x3a3f('0x3'));var moment=require(_0x3a3f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3a3f('0x5'));var fs=require('fs');var path=require(_0x3a3f('0x6'));var rimraf=require(_0x3a3f('0x7'));var config=require(_0x3a3f('0x8'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x3dad1f,_0x19bdbf){return _0x3dad1f['define'](_0x3a3f('0x9'),attributes,{'tableName':_0x3a3f('0xa'),'paranoid':![],'indexes':[{'name':_0x3a3f('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 34ba1ec..4d8b87b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd034=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x2065c5,_0x15d9ae){var _0x185c25=function(_0x3c29bd){while(--_0x3c29bd){_0x2065c5['push'](_0x2065c5['shift']());}};_0x185c25(++_0x15d9ae);}(_0xd034,0x1ea));var _0x4d03=function(_0x39e740,_0x3a3084){_0x39e740=_0x39e740-0x0;var _0x49d5fc=_0xd034[_0x39e740];return _0x49d5fc;};'use strict';var _=require(_0x4d03('0x0'));var util=require(_0x4d03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d03('0x2'));var fs=require('fs');var Redis=require(_0x4d03('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d03('0x4'));var config=require(_0x4d03('0x5'));var jayson=require(_0x4d03('0x6'));var client=jayson[_0x4d03('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40030d,_0x3b7e1c,_0x5f20c5){return new BPromise(function(_0x4771ec,_0x2d5a54){return client[_0x4d03('0x8')](_0x40030d,_0x5f20c5)[_0x4d03('0x9')](function(_0x40d3a1){logger[_0x4d03('0xa')](_0x4d03('0xb'),_0x3b7e1c,'request\x20sent');logger[_0x4d03('0xc')](_0x4d03('0xd'),_0x3b7e1c,_0x4d03('0xe'),JSON[_0x4d03('0xf')](_0x40d3a1));if(_0x40d3a1[_0x4d03('0x10')]){if(_0x40d3a1[_0x4d03('0x10')][_0x4d03('0x11')]===0x1f4){logger[_0x4d03('0x10')](_0x4d03('0xb'),_0x3b7e1c,_0x40d3a1[_0x4d03('0x10')]['message']);return _0x2d5a54(_0x40d3a1[_0x4d03('0x10')][_0x4d03('0x12')]);}logger[_0x4d03('0x10')](_0x4d03('0xb'),_0x3b7e1c,_0x40d3a1[_0x4d03('0x10')][_0x4d03('0x12')]);return _0x4771ec(_0x40d3a1['error'][_0x4d03('0x12')]);}else{logger[_0x4d03('0xa')]('DeskField,\x20%s,\x20%s',_0x3b7e1c,'request\x20sent');_0x4771ec(_0x40d3a1[_0x4d03('0x13')][_0x4d03('0x12')]);}})[_0x4d03('0x14')](function(_0x2822cf){logger[_0x4d03('0x10')](_0x4d03('0xb'),_0x3b7e1c,_0x2822cf);_0x2d5a54(_0x2822cf);});});}
\ No newline at end of file
+var _0xbd8b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xbd8b,0x80));var _0xbbd8=function(_0x5aba1c,_0x4455e9){_0x5aba1c=_0x5aba1c-0x0;var _0x91fff7=_0xbd8b[_0x5aba1c];return _0x91fff7;};'use strict';var _=require(_0xbbd8('0x0'));var util=require(_0xbbd8('0x1'));var moment=require(_0xbbd8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbd8('0x3'));var db=require(_0xbbd8('0x4'))['db'];var utils=require(_0xbbd8('0x5'));var logger=require(_0xbbd8('0x6'))('rpc');var config=require(_0xbbd8('0x7'));var jayson=require(_0xbbd8('0x8'));var client=jayson[_0xbbd8('0x9')][_0xbbd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b3525,_0x3484ef,_0x5096e9){return new BPromise(function(_0x143fe9,_0x46dae2){return client[_0xbbd8('0xb')](_0x5b3525,_0x5096e9)['then'](function(_0x2861ef){logger[_0xbbd8('0xc')](_0xbbd8('0xd'),_0x3484ef,_0xbbd8('0xe'));logger[_0xbbd8('0xf')](_0xbbd8('0x10'),_0x3484ef,_0xbbd8('0xe'),JSON[_0xbbd8('0x11')](_0x2861ef));if(_0x2861ef['error']){if(_0x2861ef[_0xbbd8('0x12')][_0xbbd8('0x13')]===0x1f4){logger['error'](_0xbbd8('0xd'),_0x3484ef,_0x2861ef[_0xbbd8('0x12')][_0xbbd8('0x14')]);return _0x46dae2(_0x2861ef[_0xbbd8('0x12')][_0xbbd8('0x14')]);}logger[_0xbbd8('0x12')]('DeskField,\x20%s,\x20%s',_0x3484ef,_0x2861ef['error'][_0xbbd8('0x14')]);return _0x143fe9(_0x2861ef[_0xbbd8('0x12')][_0xbbd8('0x14')]);}else{logger[_0xbbd8('0xc')](_0xbbd8('0xd'),_0x3484ef,_0xbbd8('0xe'));_0x143fe9(_0x2861ef[_0xbbd8('0x15')][_0xbbd8('0x14')]);}})['catch'](function(_0x2dd544){logger[_0xbbd8('0x12')](_0xbbd8('0xd'),_0x3484ef,_0x2dd544);_0x46dae2(_0x2dd544);});});}
\ No newline at end of file
index b683ac3..72d427d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd37b=['path','connect-timeout','express','Router','../../components/interaction/service','./intDynamics365Account.controller','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd37b,0x8f));var _0xbd37=function(_0xd316ad,_0x1fb017){_0xd316ad=_0xd316ad-0x0;var _0x31845a=_0xd37b[_0xd316ad];return _0x31845a;};'use strict';var multer=require(_0xbd37('0x0'));var util=require('util');var path=require(_0xbd37('0x1'));var timeout=require(_0xbd37('0x2'));var express=require(_0xbd37('0x3'));var router=express[_0xbd37('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbd37('0x5'));var config=require('../../config/environment');var controller=require(_0xbd37('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xbd37('0x7')]);router[_0xbd37('0x8')](_0xbd37('0x9'),auth['isAuthenticated'](),controller[_0xbd37('0xa')]);router['get'](_0xbd37('0xb'),auth['isAuthenticated'](),controller[_0xbd37('0xc')]);router['get'](_0xbd37('0xd'),auth[_0xbd37('0xe')](),controller[_0xbd37('0xf')]);router[_0xbd37('0x10')]('/',auth['isAuthenticated'](),controller[_0xbd37('0x11')]);router[_0xbd37('0x10')](_0xbd37('0xb'),auth[_0xbd37('0xe')](),controller[_0xbd37('0x12')]);router[_0xbd37('0x13')](_0xbd37('0x9'),auth[_0xbd37('0xe')](),controller[_0xbd37('0x14')]);router[_0xbd37('0x15')]('/:id',auth[_0xbd37('0xe')](),controller[_0xbd37('0x16')]);module[_0xbd37('0x17')]=router;
\ No newline at end of file
+var _0xf585=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x43a954,_0x1d73d7){var _0x1973f6=function(_0x3de96c){while(--_0x3de96c){_0x43a954['push'](_0x43a954['shift']());}};_0x1973f6(++_0x1d73d7);}(_0xf585,0x14c));var _0x5f58=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf585[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x5f58('0x0'));var util=require(_0x5f58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f58('0x2'));var router=express[_0x5f58('0x3')]();var fs_extra=require(_0x5f58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f58('0x5'));var config=require('../../config/environment');var controller=require(_0x5f58('0x6'));router[_0x5f58('0x7')]('/',auth[_0x5f58('0x8')](),controller[_0x5f58('0x9')]);router[_0x5f58('0x7')](_0x5f58('0xa'),auth[_0x5f58('0x8')](),controller[_0x5f58('0xb')]);router[_0x5f58('0x7')](_0x5f58('0xc'),auth[_0x5f58('0x8')](),controller[_0x5f58('0xd')]);router[_0x5f58('0x7')](_0x5f58('0xe'),auth[_0x5f58('0x8')](),controller[_0x5f58('0xf')]);router[_0x5f58('0x10')]('/',auth[_0x5f58('0x8')](),controller[_0x5f58('0x11')]);router['post'](_0x5f58('0xc'),auth['isAuthenticated'](),controller[_0x5f58('0x12')]);router[_0x5f58('0x13')](_0x5f58('0xa'),auth['isAuthenticated'](),controller[_0x5f58('0x14')]);router[_0x5f58('0x15')](_0x5f58('0xa'),auth[_0x5f58('0x8')](),controller['destroy']);module[_0x5f58('0x16')]=router;
\ No newline at end of file
index d8b19af..125a21e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126e=['exports','STRING','BOOLEAN'];(function(_0x5b9dba,_0x2952dc){var _0x299040=function(_0x2a0f4b){while(--_0x2a0f4b){_0x5b9dba['push'](_0x5b9dba['shift']());}};_0x299040(++_0x2952dc);}(_0x126e,0x108));var _0xe126=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x126e[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'name':{'type':Sequelize[_0xe126('0x1')]},'username':{'type':Sequelize[_0xe126('0x1')]},'password':{'type':Sequelize[_0xe126('0x1')]},'remoteUri':{'type':Sequelize[_0xe126('0x1')]},'tenantId':{'type':Sequelize[_0xe126('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xe126('0x1')]},'serverUrl':{'type':Sequelize[_0xe126('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe126('0x1')]},'modernAuthentication':{'type':Sequelize[_0xe126('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6688=['sequelize','exports','STRING'];(function(_0x22193e,_0x2ae001){var _0x10c378=function(_0x411e3f){while(--_0x411e3f){_0x22193e['push'](_0x22193e['shift']());}};_0x10c378(++_0x2ae001);}(_0x6688,0x10e));var _0x8668=function(_0x48bc72,_0x447d7b){_0x48bc72=_0x48bc72-0x0;var _0x5a2dd3=_0x6688[_0x48bc72];return _0x5a2dd3;};'use strict';var Sequelize=require(_0x8668('0x0'));module[_0x8668('0x1')]={'name':{'type':Sequelize[_0x8668('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8668('0x2')]},'remoteUri':{'type':Sequelize[_0x8668('0x2')]},'tenantId':{'type':Sequelize[_0x8668('0x2')]},'clientId':{'type':Sequelize[_0x8668('0x2')]},'clientSecret':{'type':Sequelize[_0x8668('0x2')]},'serverUrl':{'type':Sequelize[_0x8668('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8668('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index d6d883c..131d172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6e0=['getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','ticketType','incident','PhoneCall','title','description','customerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','clientId','modernAuthentication','CloudProvider','data5','access_token','remoteUri','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','password','GET','4.0','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','findAll','rows','length','include','options','catch','create','body','find','params'];(function(_0x5afb9b,_0x53dc0b){var _0x59c8b5=function(_0x50e5e0){while(--_0x50e5e0){_0x5afb9b['push'](_0x5afb9b['shift']());}};_0x59c8b5(++_0x53dc0b);}(_0xc6e0,0x14a));var _0x0c6e=function(_0x95f40b,_0x27b12f){_0x95f40b=_0x95f40b-0x0;var _0x431c67=_0xc6e0[_0x95f40b];return _0x431c67;};'use strict';var rp=require('request-promise');var util=require(_0x0c6e('0x0'));var _=require(_0x0c6e('0x1'));var qs=require(_0x0c6e('0x2'));var logger=require(_0x0c6e('0x3'))(_0x0c6e('0x4'));var db=require(_0x0c6e('0x5'))['db'];var integrations=require(_0x0c6e('0x6'));function respondWithResult(_0x1234a9,_0x4278af){_0x4278af=_0x4278af||0xc8;return function(_0x458222){if(_0x458222){return _0x1234a9[_0x0c6e('0x7')](_0x4278af)['json'](_0x458222);}};}function respondWithFilteredResult(_0xbd6bbc,_0x17bb90){return function(_0x291db1){if(_0x291db1){var _0x5a7552=typeof _0x17bb90[_0x0c6e('0x8')]===_0x0c6e('0x9')&&typeof _0x17bb90[_0x0c6e('0xa')]===_0x0c6e('0x9');var _0x231e22=_0x291db1[_0x0c6e('0xb')];var _0x274b72=_0x5a7552?0x0:_0x17bb90[_0x0c6e('0x8')];var _0x3f9fba=_0x5a7552?_0x291db1[_0x0c6e('0xb')]:_0x17bb90[_0x0c6e('0x8')]+_0x17bb90[_0x0c6e('0xa')];var _0x4685eb;if(_0x3f9fba>=_0x231e22){_0x3f9fba=_0x231e22;_0x4685eb=0xc8;}else{_0x4685eb=0xce;}_0xbd6bbc[_0x0c6e('0x7')](_0x4685eb);return _0xbd6bbc[_0x0c6e('0xc')]('Content-Range',_0x274b72+'-'+_0x3f9fba+'/'+_0x231e22)[_0x0c6e('0xd')](_0x291db1);}return null;};}function saveUpdates(_0x2b6622){return function(_0x553aac){if(_0x553aac){return _0x553aac[_0x0c6e('0xe')](_0x2b6622)[_0x0c6e('0xf')](function(_0x4ebdb8){return _0x4ebdb8;});}return null;};}function removeEntity(_0x2d63c5){return function(_0x591a99){if(_0x591a99){return _0x591a99[_0x0c6e('0x10')]()[_0x0c6e('0xf')](function(){_0x2d63c5['status'](0xcc)[_0x0c6e('0x11')]();});}};}function handleEntityNotFound(_0x4a65cc){return function(_0x436b34){if(!_0x436b34){_0x4a65cc[_0x0c6e('0x12')](0x194);}return _0x436b34;};}function handleError(_0x31a07b,_0x47a477){_0x47a477=_0x47a477||0x1f4;return function(_0x13c791){logger[_0x0c6e('0x13')](_0x13c791[_0x0c6e('0x14')]);if(_0x13c791[_0x0c6e('0x15')]){delete _0x13c791[_0x0c6e('0x15')];}_0x31a07b[_0x0c6e('0x7')](_0x47a477)[_0x0c6e('0x16')](_0x13c791);};}exports[_0x0c6e('0x17')]=function(_0x3c908a,_0x215fd8){var _0x47c5c8={},_0xffee3a={},_0x1c0986={'count':0x0,'rows':[]};var _0x2cf292=_[_0x0c6e('0x18')](db[_0x0c6e('0x19')][_0x0c6e('0x1a')],function(_0x1a504a){return{'name':_0x1a504a[_0x0c6e('0x1b')],'type':_0x1a504a[_0x0c6e('0x1c')][_0x0c6e('0x1d')]};});_0xffee3a[_0x0c6e('0x1e')]=_['map'](_0x2cf292,_0x0c6e('0x15'));_0xffee3a[_0x0c6e('0x1f')]=_[_0x0c6e('0x20')](_0x3c908a['query']);_0xffee3a['filters']=_['intersection'](_0xffee3a[_0x0c6e('0x1e')],_0xffee3a[_0x0c6e('0x1f')]);_0x47c5c8[_0x0c6e('0x21')]=_[_0x0c6e('0x22')](_0xffee3a[_0x0c6e('0x1e')],qs[_0x0c6e('0x23')](_0x3c908a[_0x0c6e('0x1f')][_0x0c6e('0x23')]));_0x47c5c8[_0x0c6e('0x21')]=_0x47c5c8[_0x0c6e('0x21')]['length']?_0x47c5c8[_0x0c6e('0x21')]:_0xffee3a[_0x0c6e('0x1e')];if(!_0x3c908a[_0x0c6e('0x1f')][_0x0c6e('0x24')](_0x0c6e('0x25'))){_0x47c5c8[_0x0c6e('0xa')]=qs[_0x0c6e('0xa')](_0x3c908a[_0x0c6e('0x1f')][_0x0c6e('0xa')]);_0x47c5c8['offset']=qs[_0x0c6e('0x8')](_0x3c908a['query']['offset']);}_0x47c5c8['order']=qs[_0x0c6e('0x26')](_0x3c908a['query'][_0x0c6e('0x26')]);_0x47c5c8['where']=qs[_0x0c6e('0x27')](_[_0x0c6e('0x28')](_0x3c908a[_0x0c6e('0x1f')],_0xffee3a['filters']),_0x2cf292);if(_0x3c908a[_0x0c6e('0x1f')]['filter']){_0x47c5c8['where']=_[_0x0c6e('0x29')](_0x47c5c8[_0x0c6e('0x2a')],{'$or':_['map'](_0x2cf292,function(_0x325fa7){if(_0x325fa7[_0x0c6e('0x1c')]!==_0x0c6e('0x2b')){var _0x51eb60={};_0x51eb60[_0x325fa7[_0x0c6e('0x15')]]={'$like':'%'+_0x3c908a[_0x0c6e('0x1f')][_0x0c6e('0x2c')]+'%'};return _0x51eb60;}})});}_0x47c5c8=_[_0x0c6e('0x29')]({},_0x47c5c8,_0x3c908a['options']);var _0x4b666={'where':_0x47c5c8[_0x0c6e('0x2a')]};return db[_0x0c6e('0x19')][_0x0c6e('0xb')](_0x4b666)[_0x0c6e('0xf')](function(_0x38a7aa){_0x1c0986['count']=_0x38a7aa;if(_0x3c908a[_0x0c6e('0x1f')][_0x0c6e('0x2d')]){_0x47c5c8['include']=[{'all':!![]}];}return db[_0x0c6e('0x19')][_0x0c6e('0x2e')](_0x47c5c8);})[_0x0c6e('0xf')](function(_0x50f66b){_0x1c0986[_0x0c6e('0x2f')]=_0x50f66b;return _0x1c0986;})[_0x0c6e('0xf')](respondWithFilteredResult(_0x215fd8,_0x47c5c8))['catch'](handleError(_0x215fd8,null));};exports['show']=function(_0x5607be,_0x575a12){var _0x538abc={'raw':![],'where':{'id':_0x5607be['params']['id']}},_0x221158={};_0x221158['model']=_[_0x0c6e('0x20')](db['Dynamics365Account']['rawAttributes']);_0x221158[_0x0c6e('0x1f')]=_[_0x0c6e('0x20')](_0x5607be[_0x0c6e('0x1f')]);_0x221158[_0x0c6e('0x27')]=_['intersection'](_0x221158[_0x0c6e('0x1e')],_0x221158['query']);_0x538abc[_0x0c6e('0x21')]=_[_0x0c6e('0x22')](_0x221158[_0x0c6e('0x1e')],qs[_0x0c6e('0x23')](_0x5607be[_0x0c6e('0x1f')]['fields']));_0x538abc['attributes']=_0x538abc[_0x0c6e('0x21')][_0x0c6e('0x30')]?_0x538abc[_0x0c6e('0x21')]:_0x221158[_0x0c6e('0x1e')];if(_0x5607be[_0x0c6e('0x1f')][_0x0c6e('0x2d')]){_0x538abc[_0x0c6e('0x31')]=[{'all':!![]}];}_0x538abc=_[_0x0c6e('0x29')]({},_0x538abc,_0x5607be[_0x0c6e('0x32')]);return db[_0x0c6e('0x19')]['find'](_0x538abc)[_0x0c6e('0xf')](handleEntityNotFound(_0x575a12,null))[_0x0c6e('0xf')](respondWithResult(_0x575a12,null))[_0x0c6e('0x33')](handleError(_0x575a12,null));};exports[_0x0c6e('0x34')]=function(_0x9b6913,_0x1be728){return db['Dynamics365Account'][_0x0c6e('0x34')](_0x9b6913['body'],{})[_0x0c6e('0xf')](respondWithResult(_0x1be728,0xc9))[_0x0c6e('0x33')](handleError(_0x1be728,null));};exports[_0x0c6e('0xe')]=function(_0xfb52af,_0x29db46){if(_0xfb52af[_0x0c6e('0x35')]['id']){delete _0xfb52af[_0x0c6e('0x35')]['id'];}return db[_0x0c6e('0x19')][_0x0c6e('0x36')]({'where':{'id':_0xfb52af['params']['id']}})[_0x0c6e('0xf')](handleEntityNotFound(_0x29db46,null))['then'](saveUpdates(_0xfb52af[_0x0c6e('0x35')],null))[_0x0c6e('0xf')](respondWithResult(_0x29db46,null))[_0x0c6e('0x33')](handleError(_0x29db46,null));};exports[_0x0c6e('0x10')]=function(_0x56126b,_0x37215a){return db[_0x0c6e('0x19')][_0x0c6e('0x36')]({'where':{'id':_0x56126b[_0x0c6e('0x37')]['id']}})[_0x0c6e('0xf')](handleEntityNotFound(_0x37215a,null))[_0x0c6e('0xf')](removeEntity(_0x37215a,null))['catch'](handleError(_0x37215a,null));};exports[_0x0c6e('0x38')]=function(_0x98b7e6,_0x35f797){var _0x2af1c5={};var _0x255940={};var _0x2825fb;var _0x4eb89d;return db[_0x0c6e('0x19')][_0x0c6e('0x39')]({'where':{'id':_0x98b7e6[_0x0c6e('0x37')]['id']}})[_0x0c6e('0xf')](handleEntityNotFound(_0x35f797,null))[_0x0c6e('0xf')](function(_0x3dac36){if(_0x3dac36){_0x2825fb=_0x3dac36;_0x255940[_0x0c6e('0x1e')]=_[_0x0c6e('0x20')](db[_0x0c6e('0x3a')]['rawAttributes']);_0x255940[_0x0c6e('0x1f')]=_[_0x0c6e('0x20')](_0x98b7e6['query']);_0x255940['filters']=_[_0x0c6e('0x22')](_0x255940['model'],_0x255940[_0x0c6e('0x1f')]);_0x2af1c5[_0x0c6e('0x21')]=_[_0x0c6e('0x22')](_0x255940[_0x0c6e('0x1e')],qs[_0x0c6e('0x23')](_0x98b7e6[_0x0c6e('0x1f')]['fields']));_0x2af1c5[_0x0c6e('0x21')]=_0x2af1c5['attributes'][_0x0c6e('0x30')]?_0x2af1c5['attributes']:_0x255940[_0x0c6e('0x1e')];_0x2af1c5[_0x0c6e('0x3b')]=qs[_0x0c6e('0x26')](_0x98b7e6[_0x0c6e('0x1f')][_0x0c6e('0x26')]);_0x2af1c5[_0x0c6e('0x2a')]=qs[_0x0c6e('0x27')](_[_0x0c6e('0x28')](_0x98b7e6[_0x0c6e('0x1f')],_0x255940[_0x0c6e('0x27')]));if(_0x98b7e6[_0x0c6e('0x1f')]['filter']){_0x2af1c5[_0x0c6e('0x2a')]=_[_0x0c6e('0x29')](_0x2af1c5[_0x0c6e('0x2a')],{'$or':_['map'](_0x2af1c5[_0x0c6e('0x21')],function(_0x40b969){var _0x468616={};_0x468616[_0x40b969]={'$like':'%'+_0x98b7e6[_0x0c6e('0x1f')][_0x0c6e('0x2c')]+'%'};return _0x468616;})});}_0x2af1c5=_[_0x0c6e('0x29')]({},_0x2af1c5,_0x98b7e6[_0x0c6e('0x32')]);return _0x2825fb[_0x0c6e('0x38')](_0x2af1c5);}})[_0x0c6e('0xf')](function(_0xebad16){if(_0xebad16){_0x4eb89d=_0xebad16['length'];if(!_0x98b7e6[_0x0c6e('0x1f')][_0x0c6e('0x24')](_0x0c6e('0x25'))){_0x2af1c5['limit']=qs['limit'](_0x98b7e6[_0x0c6e('0x1f')][_0x0c6e('0xa')]);_0x2af1c5[_0x0c6e('0x8')]=qs[_0x0c6e('0x8')](_0x98b7e6[_0x0c6e('0x1f')][_0x0c6e('0x8')]);}return _0x2825fb['getConfigurations'](_0x2af1c5);}})[_0x0c6e('0xf')](function(_0x5ab87a){if(_0x5ab87a){return _0x5ab87a?{'count':_0x4eb89d,'rows':_0x5ab87a}:null;}})[_0x0c6e('0xf')](respondWithResult(_0x35f797,null))[_0x0c6e('0x33')](handleError(_0x35f797,null));};exports[_0x0c6e('0x3c')]=function(_0x3b336c,_0x202d93){if(_0x3b336c[_0x0c6e('0x35')]['id']){delete _0x3b336c[_0x0c6e('0x35')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x3b336c[_0x0c6e('0x37')]['id']}})['then'](handleEntityNotFound(_0x202d93,null))[_0x0c6e('0xf')](function(_0x4da0ae){if(_0x4da0ae){_0x3b336c[_0x0c6e('0x35')][_0x0c6e('0x3d')]=_0x4da0ae['id'];_0x3b336c[_0x0c6e('0x35')][_0x0c6e('0x3e')]=integrations[_0x0c6e('0x3f')](_0x3b336c[_0x0c6e('0x35')][_0x0c6e('0x40')],_0x3b336c['body']['type']);_0x3b336c[_0x0c6e('0x35')][_0x0c6e('0x41')]=integrations[_0x0c6e('0x42')](_0x3b336c['body']['channel'],_0x3b336c[_0x0c6e('0x35')][_0x0c6e('0x1c')]);return db['Dynamics365Configuration'][_0x0c6e('0x34')](_0x3b336c[_0x0c6e('0x35')],{'include':[{'model':db[_0x0c6e('0x43')],'as':_0x0c6e('0x3e')},{'model':db[_0x0c6e('0x43')],'as':_0x0c6e('0x41')}]});}return null;})[_0x0c6e('0xf')](respondWithResult(_0x202d93,null))['catch'](handleError(_0x202d93,null));};function sanitizeRemoteUri(_0x3dca1a){var _0x4b1f4d=_0x3dca1a[_0x0c6e('0x44')](-0x1);if(_0x4b1f4d==='/')return _0x3dca1a[_0x0c6e('0x45')](0x0,_0x3dca1a[_0x0c6e('0x46')](_0x4b1f4d));return _0x3dca1a;}function getWebApiUrl(_0x5677b7){return util[_0x0c6e('0x47')]('%s/api/data/v9.0/',_0x5677b7);}exports['getFields']=function(_0x572ded,_0x4c2b60){var _0x326c04=_0x572ded[_0x0c6e('0x1f')][_0x0c6e('0x48')];var _0x8953d5=_0x326c04===_0x0c6e('0x49')?'Incident':_0x0c6e('0x4a');var _0x4770e2='';var _0x3f2dca='';var _0x30fae6='';var _0x1ef03b='';var _0x3b7af1='';var _0x41786b='';var _0x5c26ea='';var _0x19805c='';var _0x8ed1d1=[_0x0c6e('0x4b'),_0x0c6e('0x4c'),_0x0c6e('0x4d'),'ownerid',_0x0c6e('0x4e'),'subject',_0x0c6e('0x4f'),'regardingobjectid',_0x0c6e('0x50'),_0x0c6e('0x51')];var _0x12b774=[_0x0c6e('0x52'),'accountidyominame',_0x0c6e('0x53'),'billedserviceunits',_0x0c6e('0x54'),_0x0c6e('0x55'),_0x0c6e('0x56'),_0x0c6e('0x57'),_0x0c6e('0x58'),_0x0c6e('0x59'),_0x0c6e('0x5a'),_0x0c6e('0x5b'),'createdon',_0x0c6e('0x5c'),_0x0c6e('0x5d'),_0x0c6e('0x5e'),_0x0c6e('0x5f'),_0x0c6e('0x60'),_0x0c6e('0x61'),_0x0c6e('0x62'),_0x0c6e('0x63'),_0x0c6e('0x64'),_0x0c6e('0x65'),_0x0c6e('0x66'),_0x0c6e('0x67'),_0x0c6e('0x68'),'importsequencenumber',_0x0c6e('0x69'),_0x0c6e('0x6a'),_0x0c6e('0x6b'),'masteridname',_0x0c6e('0x6c'),'modifiedbyexternalpartyyominame',_0x0c6e('0x6d'),_0x0c6e('0x6e'),_0x0c6e('0x6f'),_0x0c6e('0x70'),'modifiedonbehalfbyyominame',_0x0c6e('0x71'),_0x0c6e('0x72'),'numberofchildincidents',_0x0c6e('0x73'),_0x0c6e('0x74'),_0x0c6e('0x75'),_0x0c6e('0x76'),_0x0c6e('0x77'),_0x0c6e('0x78'),_0x0c6e('0x79'),_0x0c6e('0x7a'),_0x0c6e('0x7b'),_0x0c6e('0x7c'),_0x0c6e('0x7d'),'resolveby',_0x0c6e('0x7e'),'responseby',_0x0c6e('0x7f'),_0x0c6e('0x80'),_0x0c6e('0x81'),_0x0c6e('0x82'),_0x0c6e('0x83'),_0x0c6e('0x84'),_0x0c6e('0x85'),'statuscode',_0x0c6e('0x86'),_0x0c6e('0x87'),_0x0c6e('0x88'),_0x0c6e('0x89'),_0x0c6e('0x8a'),_0x0c6e('0x8b'),_0x0c6e('0x8c')];var _0x376e60=_0x8ed1d1['concat'](_0x12b774);return db['Dynamics365Account'][_0x0c6e('0x39')]({'where':{'id':_0x572ded[_0x0c6e('0x37')]['id']},'attributes':['id',_0x0c6e('0x8d'),'password','remoteUri','tenantId',_0x0c6e('0x8e'),'clientSecret',_0x0c6e('0x8f')],'include':[{'model':db[_0x0c6e('0x90')],'as':'CloudProvider','attributes':['id',_0x0c6e('0x91'),'data7']}]})[_0x0c6e('0xf')](handleEntityNotFound(_0x4c2b60,null))[_0x0c6e('0xf')](function(_0x231af1){if(_0x231af1){if(_0x231af1[_0x0c6e('0x8f')]){_0x231af1[_0x0c6e('0x92')]=_0x231af1[_0x0c6e('0x90')][_0x0c6e('0x91')];_0x19805c=sanitizeRemoteUri(_0x231af1['CloudProvider']['data7']);_0x5c26ea=getWebApiUrl(_0x19805c);return _0x231af1;}_0x19805c=sanitizeRemoteUri(_0x231af1[_0x0c6e('0x93')]);_0x5c26ea=getWebApiUrl(_0x19805c);var _0x43ad1d={'method':_0x0c6e('0x94'),'uri':_0x0c6e('0x95')+_0x231af1[_0x0c6e('0x96')]+_0x0c6e('0x97'),'form':{'client_id':_0x231af1[_0x0c6e('0x8e')],'resource':_0x19805c,'username':_0x231af1[_0x0c6e('0x8d')],'password':_0x231af1[_0x0c6e('0x98')],'grant_type':_0x0c6e('0x98'),'client_secret':_0x231af1['clientSecret']},'json':!![]};return rp(_0x43ad1d);}})[_0x0c6e('0xf')](function(_0x11f3da){_0x41786b=_0x11f3da[_0x0c6e('0x92')];var _0x7b404a={'method':_0x0c6e('0x99'),'uri':encodeURI(_0x5c26ea+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x8953d5+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x41786b,'If-None-Match':null,'OData-Version':_0x0c6e('0x9a')},'json':!![]};return rp(_0x7b404a);})[_0x0c6e('0xf')](function(_0x303bce){var _0x280516=_0x303bce['value'][0x0];var _0x16f386=_0x280516[_0x0c6e('0x9b')];var _0x1590b4={'method':_0x0c6e('0x99'),'uri':_0x5c26ea+_0x0c6e('0x9c')+_0x16f386+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x41786b,'If-None-Match':null,'OData-Version':_0x0c6e('0x9a')},'json':!![]};return rp(_0x1590b4);})['then'](function(_0x4202e4){_0x4770e2=_0x4202e4;_0x3f2dca=_0x4770e2[_0x0c6e('0x9d')];_0x3f2dca=_['remove'](_0x3f2dca,function(_0x1c074c){return!_0x376e60[_0x0c6e('0x9e')](_0x1c074c[_0x0c6e('0x9f')]);});var _0x104271=[];var _0x222fe0=[];_0x3f2dca[_0x0c6e('0xa0')](function(_0x5a1b9e){if(_0x5a1b9e['@odata.type']){var _0x4e2f4a=_0x5a1b9e[_0x0c6e('0xa1')]['substring'](_0x5a1b9e[_0x0c6e('0xa1')]['lastIndexOf']('.')+0x1);if(_0x4e2f4a===_0x0c6e('0xa2')){_0x104271[_0x0c6e('0xa3')](getSelectList(_0x5c26ea,_0x326c04,_0x222fe0,_0x4770e2[_0x0c6e('0x9b')],_0x5a1b9e['MetadataId'],_0x41786b));}}});return Promise[_0x0c6e('0xa4')](_0x104271);})['then'](function(_0x4c1f8c){_0x30fae6=_0x4c1f8c[0x0];var _0x5c10f7=[];var _0x109213=[];_0x3f2dca[_0x0c6e('0xa0')](function(_0x31751a){if(!_[_0x0c6e('0xa5')](_0x31751a['@odata.type'])){var _0x24655b=_0x31751a[_0x0c6e('0xa1')][_0x0c6e('0x45')](_0x31751a[_0x0c6e('0xa1')][_0x0c6e('0x46')]('.')+0x1);if(_0x24655b===_0x0c6e('0xa6')){_0x5c10f7[_0x0c6e('0xa3')](getBooleanList(_0x5c26ea,_0x326c04,_0x109213,_0x4770e2[_0x0c6e('0x9b')],_0x31751a['MetadataId'],_0x41786b));}}});return Promise[_0x0c6e('0xa4')](_0x5c10f7);})['then'](function(_0x2307f7){_0x1ef03b=_0x2307f7[0x0];var _0x5e21ce=[];var _0x574452=[];_0x3f2dca[_0x0c6e('0xa0')](function(_0x2ce04f){if(_0x2ce04f[_0x0c6e('0xa1')]){var _0x386122=_0x2ce04f[_0x0c6e('0xa1')][_0x0c6e('0x45')](_0x2ce04f[_0x0c6e('0xa1')][_0x0c6e('0x46')]('.')+0x1);if(_0x386122==='StringAttributeMetadata'||_0x386122===_0x0c6e('0xa7')||_0x386122==='BigIntAttributeMetadata'||_0x386122===_0x0c6e('0xa8')||_0x386122===_0x0c6e('0xa9')||_0x386122===_0x0c6e('0xaa')||_0x386122===_0x0c6e('0xab')||_0x386122===_0x0c6e('0xac')||_0x386122===_0x0c6e('0xad')||_0x386122===_0x0c6e('0xae')){_0x5e21ce[_0x0c6e('0xa3')](getInputList(_0x5c26ea,_0x326c04,_0x386122,_0x574452,_0x4770e2[_0x0c6e('0x9b')],_0x2ce04f['MetadataId'],_0x41786b));}}});return Promise['all'](_0x5e21ce);})['then'](function(_0x582c13){_0x3b7af1=_0x582c13[0x0];var _0x114958=_0x30fae6[_0x0c6e('0xaf')](_0x1ef03b)['concat'](_0x3b7af1);var _0x23e00c={'count':_0x114958[_0x0c6e('0x30')],'rows':_0x114958};return _0x23e00c;})['then'](respondWithResult(_0x4c2b60,null))[_0x0c6e('0x33')](function(_0x192f4f){var _0x379262=_0x572ded[_0x0c6e('0x1f')][_0x0c6e('0xb0')]?0x1f4:_0x192f4f[_0x0c6e('0xb1')]||0x1f4;logger['error'](_0x192f4f[_0x0c6e('0x14')]);delete _0x192f4f[_0x0c6e('0x15')];if(_0x379262===0x191){_0x379262=0x190;}_0x4c2b60[_0x0c6e('0x7')](_0x379262)['send'](_0x572ded['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x192f4f[_0x0c6e('0xb1')]}:_0x192f4f);});};function getSelectList(_0x26f915,_0x49f154,_0x223420,_0x49d802,_0x17d6dd,_0x3e80ac){var _0x693363={'method':_0x0c6e('0x99'),'uri':_0x26f915+_0x0c6e('0x9c')+_0x49d802+')/Attributes('+_0x17d6dd+_0x0c6e('0xb2')+_0x0c6e('0xb3'),'headers':{'Authorization':_0x0c6e('0xb4')+_0x3e80ac,'If-None-Match':null,'OData-Version':_0x0c6e('0x9a')},'json':!![]};return rp(_0x693363)[_0x0c6e('0xf')](function(_0x54b390){var _0x6e2ef3=[];var _0x541a4c=_0x54b390['OptionSet'][_0x0c6e('0xb5')];_0x541a4c[_0x0c6e('0xa0')](function(_0x350ac0){_0x6e2ef3[_0x0c6e('0xa3')]({'name':_0x350ac0[_0x0c6e('0xb6')][_0x0c6e('0xb7')][_0x0c6e('0xb6')],'value':String(_0x350ac0[_0x0c6e('0xb8')])});});var _0xf8041b={'id':_0x49f154+'_'+_0x54b390[_0x0c6e('0x9f')],'name':_0x54b390['DisplayName'][_0x0c6e('0xb7')][_0x0c6e('0xb6')],'custom':![],'options':_0x6e2ef3};_0x223420[_0x0c6e('0xa3')](_0xf8041b);return _0x223420;});}function getBooleanList(_0x1e6bed,_0x4b2a5e,_0x4bb820,_0x4613a2,_0x1fd991,_0x1a9053){var _0x52d425={'method':_0x0c6e('0x99'),'uri':_0x1e6bed+_0x0c6e('0x9c')+_0x4613a2+_0x0c6e('0xb9')+_0x1fd991+_0x0c6e('0xba'),'headers':{'Authorization':_0x0c6e('0xb4')+_0x1a9053,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52d425)[_0x0c6e('0xf')](function(_0x3adbf0){var _0x1c24c4=[];_0x1c24c4[_0x0c6e('0xa3')]({'name':_0x3adbf0[_0x0c6e('0xbb')][_0x0c6e('0xbc')]['Label'][_0x0c6e('0xb7')][_0x0c6e('0xb6')],'value':'true'},{'name':_0x3adbf0['OptionSet'][_0x0c6e('0xbd')][_0x0c6e('0xb6')][_0x0c6e('0xb7')][_0x0c6e('0xb6')],'value':_0x0c6e('0xbe')});var _0x38e93a={'id':_0x4b2a5e+'_'+_0x3adbf0[_0x0c6e('0x9f')],'name':_0x3adbf0[_0x0c6e('0xbf')][_0x0c6e('0xb7')]['Label'],'custom':![],'options':_0x1c24c4};_0x4bb820['push'](_0x38e93a);return _0x4bb820;});}function getInputList(_0x296bac,_0x19183c,_0x56df31,_0x54b586,_0x21961e,_0xb5ad9e,_0x542be6){var _0x3818f0={'method':_0x0c6e('0x99'),'uri':_0x296bac+_0x0c6e('0x9c')+_0x21961e+_0x0c6e('0xb9')+_0xb5ad9e+')/Microsoft.Dynamics.CRM.'+_0x56df31+_0x0c6e('0xc0'),'headers':{'Authorization':_0x0c6e('0xb4')+_0x542be6,'If-None-Match':null,'OData-Version':_0x0c6e('0x9a')},'json':!![]};return rp(_0x3818f0)['then'](function(_0x1ce459){var _0x1352a0={'id':_0x19183c+'_'+_0x1ce459[_0x0c6e('0x9f')],'name':_0x1ce459['DisplayName'][_0x0c6e('0xb7')]?_0x1ce459[_0x0c6e('0xbf')]['UserLocalizedLabel'][_0x0c6e('0xb6')]:_0x1ce459[_0x0c6e('0x9f')],'custom':![],'options':[]};_0x54b586[_0x0c6e('0xa3')](_0x1352a0);return _0x54b586;});}
\ No newline at end of file
+var _0xdeb2=['actualserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','tenantId','Bearer\x20','4.0','value','MetadataId','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','GET','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','keys','query','filters','fields','attributes','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','intersection','length','options','body','find','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame'];(function(_0x4c050a,_0x8225e3){var _0x1a2a1f=function(_0xe98369){while(--_0xe98369){_0x4c050a['push'](_0x4c050a['shift']());}};_0x1a2a1f(++_0x8225e3);}(_0xdeb2,0x64));var _0x2deb=function(_0x1c0058,_0x25d0cf){_0x1c0058=_0x1c0058-0x0;var _0x480919=_0xdeb2[_0x1c0058];return _0x480919;};'use strict';var rp=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var _=require(_0x2deb('0x2'));var qs=require(_0x2deb('0x3'));var logger=require(_0x2deb('0x4'))('api');var db=require(_0x2deb('0x5'))['db'];var integrations=require(_0x2deb('0x6'));function respondWithResult(_0x59e9c1,_0x3fa0b4){_0x3fa0b4=_0x3fa0b4||0xc8;return function(_0x24c743){if(_0x24c743){return _0x59e9c1[_0x2deb('0x7')](_0x3fa0b4)['json'](_0x24c743);}};}function respondWithFilteredResult(_0x472c20,_0xa082c1){return function(_0xefa827){if(_0xefa827){var _0x296534=typeof _0xa082c1[_0x2deb('0x8')]===_0x2deb('0x9')&&typeof _0xa082c1[_0x2deb('0xa')]==='undefined';var _0x3b463a=_0xefa827[_0x2deb('0xb')];var _0xc6f8e7=_0x296534?0x0:_0xa082c1[_0x2deb('0x8')];var _0x4fa24a=_0x296534?_0xefa827[_0x2deb('0xb')]:_0xa082c1['offset']+_0xa082c1[_0x2deb('0xa')];var _0x30c072;if(_0x4fa24a>=_0x3b463a){_0x4fa24a=_0x3b463a;_0x30c072=0xc8;}else{_0x30c072=0xce;}_0x472c20[_0x2deb('0x7')](_0x30c072);return _0x472c20[_0x2deb('0xc')](_0x2deb('0xd'),_0xc6f8e7+'-'+_0x4fa24a+'/'+_0x3b463a)['json'](_0xefa827);}return null;};}function saveUpdates(_0x480444){return function(_0x4ffe33){if(_0x4ffe33){return _0x4ffe33[_0x2deb('0xe')](_0x480444)[_0x2deb('0xf')](function(_0x26fa25){return _0x26fa25;});}return null;};}function removeEntity(_0x217180){return function(_0x5e851a){if(_0x5e851a){return _0x5e851a[_0x2deb('0x10')]()[_0x2deb('0xf')](function(){_0x217180[_0x2deb('0x7')](0xcc)[_0x2deb('0x11')]();});}};}function handleEntityNotFound(_0x4b147d){return function(_0x14e785){if(!_0x14e785){_0x4b147d[_0x2deb('0x12')](0x194);}return _0x14e785;};}function handleError(_0x51f366,_0x4f119f){_0x4f119f=_0x4f119f||0x1f4;return function(_0x34d97f){logger[_0x2deb('0x13')](_0x34d97f[_0x2deb('0x14')]);if(_0x34d97f[_0x2deb('0x15')]){delete _0x34d97f[_0x2deb('0x15')];}_0x51f366[_0x2deb('0x7')](_0x4f119f)[_0x2deb('0x16')](_0x34d97f);};}exports[_0x2deb('0x17')]=function(_0x2552e4,_0x4672b5){var _0x5860ae={},_0x85a333={},_0x2c5620={'count':0x0,'rows':[]};var _0x30782d=_['map'](db[_0x2deb('0x18')][_0x2deb('0x19')],function(_0x30cec9){return{'name':_0x30cec9[_0x2deb('0x1a')],'type':_0x30cec9[_0x2deb('0x1b')][_0x2deb('0x1c')]};});_0x85a333[_0x2deb('0x1d')]=_[_0x2deb('0x1e')](_0x30782d,_0x2deb('0x15'));_0x85a333['query']=_[_0x2deb('0x1f')](_0x2552e4[_0x2deb('0x20')]);_0x85a333[_0x2deb('0x21')]=_['intersection'](_0x85a333[_0x2deb('0x1d')],_0x85a333[_0x2deb('0x20')]);_0x5860ae['attributes']=_['intersection'](_0x85a333[_0x2deb('0x1d')],qs[_0x2deb('0x22')](_0x2552e4['query'][_0x2deb('0x22')]));_0x5860ae[_0x2deb('0x23')]=_0x5860ae[_0x2deb('0x23')]['length']?_0x5860ae['attributes']:_0x85a333[_0x2deb('0x1d')];if(!_0x2552e4[_0x2deb('0x20')]['hasOwnProperty'](_0x2deb('0x24'))){_0x5860ae[_0x2deb('0xa')]=qs['limit'](_0x2552e4[_0x2deb('0x20')][_0x2deb('0xa')]);_0x5860ae[_0x2deb('0x8')]=qs[_0x2deb('0x8')](_0x2552e4[_0x2deb('0x20')][_0x2deb('0x8')]);}_0x5860ae[_0x2deb('0x25')]=qs[_0x2deb('0x26')](_0x2552e4['query'][_0x2deb('0x26')]);_0x5860ae['where']=qs[_0x2deb('0x21')](_['pick'](_0x2552e4['query'],_0x85a333[_0x2deb('0x21')]),_0x30782d);if(_0x2552e4[_0x2deb('0x20')][_0x2deb('0x27')]){_0x5860ae[_0x2deb('0x28')]=_[_0x2deb('0x29')](_0x5860ae[_0x2deb('0x28')],{'$or':_[_0x2deb('0x1e')](_0x30782d,function(_0x38c4cf){if(_0x38c4cf[_0x2deb('0x1b')]!==_0x2deb('0x2a')){var _0x12b4cd={};_0x12b4cd[_0x38c4cf[_0x2deb('0x15')]]={'$like':'%'+_0x2552e4['query']['filter']+'%'};return _0x12b4cd;}})});}_0x5860ae=_[_0x2deb('0x29')]({},_0x5860ae,_0x2552e4['options']);var _0x48349e={'where':_0x5860ae[_0x2deb('0x28')]};return db[_0x2deb('0x18')][_0x2deb('0xb')](_0x48349e)['then'](function(_0x56667b){_0x2c5620[_0x2deb('0xb')]=_0x56667b;if(_0x2552e4['query'][_0x2deb('0x2b')]){_0x5860ae[_0x2deb('0x2c')]=[{'all':!![]}];}return db[_0x2deb('0x18')][_0x2deb('0x2d')](_0x5860ae);})[_0x2deb('0xf')](function(_0x452b50){_0x2c5620[_0x2deb('0x2e')]=_0x452b50;return _0x2c5620;})[_0x2deb('0xf')](respondWithFilteredResult(_0x4672b5,_0x5860ae))[_0x2deb('0x2f')](handleError(_0x4672b5,null));};exports['show']=function(_0x113eb5,_0x1a2110){var _0xa9e148={'raw':![],'where':{'id':_0x113eb5[_0x2deb('0x30')]['id']}},_0x1b8705={};_0x1b8705[_0x2deb('0x1d')]=_[_0x2deb('0x1f')](db[_0x2deb('0x18')]['rawAttributes']);_0x1b8705[_0x2deb('0x20')]=_[_0x2deb('0x1f')](_0x113eb5[_0x2deb('0x20')]);_0x1b8705[_0x2deb('0x21')]=_[_0x2deb('0x31')](_0x1b8705[_0x2deb('0x1d')],_0x1b8705[_0x2deb('0x20')]);_0xa9e148[_0x2deb('0x23')]=_[_0x2deb('0x31')](_0x1b8705[_0x2deb('0x1d')],qs[_0x2deb('0x22')](_0x113eb5[_0x2deb('0x20')][_0x2deb('0x22')]));_0xa9e148['attributes']=_0xa9e148[_0x2deb('0x23')][_0x2deb('0x32')]?_0xa9e148[_0x2deb('0x23')]:_0x1b8705[_0x2deb('0x1d')];if(_0x113eb5[_0x2deb('0x20')][_0x2deb('0x2b')]){_0xa9e148['include']=[{'all':!![]}];}_0xa9e148=_['merge']({},_0xa9e148,_0x113eb5[_0x2deb('0x33')]);return db['Dynamics365Account']['find'](_0xa9e148)[_0x2deb('0xf')](handleEntityNotFound(_0x1a2110,null))[_0x2deb('0xf')](respondWithResult(_0x1a2110,null))[_0x2deb('0x2f')](handleError(_0x1a2110,null));};exports['create']=function(_0x138e2b,_0x315d3a){return db[_0x2deb('0x18')]['create'](_0x138e2b[_0x2deb('0x34')],{})[_0x2deb('0xf')](respondWithResult(_0x315d3a,0xc9))[_0x2deb('0x2f')](handleError(_0x315d3a,null));};exports[_0x2deb('0xe')]=function(_0x500a5a,_0x51cb4c){if(_0x500a5a[_0x2deb('0x34')]['id']){delete _0x500a5a[_0x2deb('0x34')]['id'];}return db[_0x2deb('0x18')][_0x2deb('0x35')]({'where':{'id':_0x500a5a[_0x2deb('0x30')]['id']}})[_0x2deb('0xf')](handleEntityNotFound(_0x51cb4c,null))[_0x2deb('0xf')](saveUpdates(_0x500a5a['body'],null))[_0x2deb('0xf')](respondWithResult(_0x51cb4c,null))[_0x2deb('0x2f')](handleError(_0x51cb4c,null));};exports['destroy']=function(_0x7ff824,_0x314b09){return db[_0x2deb('0x18')][_0x2deb('0x35')]({'where':{'id':_0x7ff824[_0x2deb('0x30')]['id']}})[_0x2deb('0xf')](handleEntityNotFound(_0x314b09,null))[_0x2deb('0xf')](removeEntity(_0x314b09,null))[_0x2deb('0x2f')](handleError(_0x314b09,null));};exports[_0x2deb('0x36')]=function(_0x3f7985,_0x70fb0d){var _0x163330={};var _0x5dfb88={};var _0x3f018c;var _0x2cd72f;return db[_0x2deb('0x18')]['findOne']({'where':{'id':_0x3f7985['params']['id']}})[_0x2deb('0xf')](handleEntityNotFound(_0x70fb0d,null))['then'](function(_0x5c0fd5){if(_0x5c0fd5){_0x3f018c=_0x5c0fd5;_0x5dfb88[_0x2deb('0x1d')]=_[_0x2deb('0x1f')](db['Dynamics365Configuration'][_0x2deb('0x19')]);_0x5dfb88[_0x2deb('0x20')]=_[_0x2deb('0x1f')](_0x3f7985['query']);_0x5dfb88[_0x2deb('0x21')]=_[_0x2deb('0x31')](_0x5dfb88[_0x2deb('0x1d')],_0x5dfb88['query']);_0x163330['attributes']=_[_0x2deb('0x31')](_0x5dfb88[_0x2deb('0x1d')],qs[_0x2deb('0x22')](_0x3f7985[_0x2deb('0x20')][_0x2deb('0x22')]));_0x163330['attributes']=_0x163330[_0x2deb('0x23')][_0x2deb('0x32')]?_0x163330['attributes']:_0x5dfb88[_0x2deb('0x1d')];_0x163330[_0x2deb('0x25')]=qs[_0x2deb('0x26')](_0x3f7985[_0x2deb('0x20')][_0x2deb('0x26')]);_0x163330['where']=qs[_0x2deb('0x21')](_['pick'](_0x3f7985[_0x2deb('0x20')],_0x5dfb88[_0x2deb('0x21')]));if(_0x3f7985['query'][_0x2deb('0x27')]){_0x163330['where']=_[_0x2deb('0x29')](_0x163330[_0x2deb('0x28')],{'$or':_[_0x2deb('0x1e')](_0x163330[_0x2deb('0x23')],function(_0x16a347){var _0xe3b6b7={};_0xe3b6b7[_0x16a347]={'$like':'%'+_0x3f7985[_0x2deb('0x20')][_0x2deb('0x27')]+'%'};return _0xe3b6b7;})});}_0x163330=_[_0x2deb('0x29')]({},_0x163330,_0x3f7985[_0x2deb('0x33')]);return _0x3f018c[_0x2deb('0x36')](_0x163330);}})[_0x2deb('0xf')](function(_0x1b6fb5){if(_0x1b6fb5){_0x2cd72f=_0x1b6fb5[_0x2deb('0x32')];if(!_0x3f7985[_0x2deb('0x20')][_0x2deb('0x37')](_0x2deb('0x24'))){_0x163330['limit']=qs[_0x2deb('0xa')](_0x3f7985[_0x2deb('0x20')][_0x2deb('0xa')]);_0x163330[_0x2deb('0x8')]=qs[_0x2deb('0x8')](_0x3f7985[_0x2deb('0x20')]['offset']);}return _0x3f018c[_0x2deb('0x36')](_0x163330);}})[_0x2deb('0xf')](function(_0x4e5d5c){if(_0x4e5d5c){return _0x4e5d5c?{'count':_0x2cd72f,'rows':_0x4e5d5c}:null;}})[_0x2deb('0xf')](respondWithResult(_0x70fb0d,null))[_0x2deb('0x2f')](handleError(_0x70fb0d,null));};exports[_0x2deb('0x38')]=function(_0x49350b,_0x1b77bb){if(_0x49350b[_0x2deb('0x34')]['id']){delete _0x49350b[_0x2deb('0x34')]['id'];}return db[_0x2deb('0x18')][_0x2deb('0x39')]({'where':{'id':_0x49350b[_0x2deb('0x30')]['id']}})[_0x2deb('0xf')](handleEntityNotFound(_0x1b77bb,null))[_0x2deb('0xf')](function(_0x1de366){if(_0x1de366){_0x49350b[_0x2deb('0x34')][_0x2deb('0x3a')]=_0x1de366['id'];_0x49350b['body'][_0x2deb('0x3b')]=integrations[_0x2deb('0x3c')](_0x49350b['body'][_0x2deb('0x3d')],_0x49350b[_0x2deb('0x34')][_0x2deb('0x1b')]);_0x49350b[_0x2deb('0x34')][_0x2deb('0x3e')]=integrations[_0x2deb('0x3f')](_0x49350b['body'][_0x2deb('0x3d')],_0x49350b[_0x2deb('0x34')][_0x2deb('0x1b')]);return db['Dynamics365Configuration']['create'](_0x49350b['body'],{'include':[{'model':db[_0x2deb('0x40')],'as':_0x2deb('0x3b')},{'model':db[_0x2deb('0x40')],'as':_0x2deb('0x3e')}]});}return null;})[_0x2deb('0xf')](respondWithResult(_0x1b77bb,null))[_0x2deb('0x2f')](handleError(_0x1b77bb,null));};function sanitizeRemoteUri(_0x546913){var _0x26d179=_0x546913['slice'](-0x1);if(_0x26d179==='/')return _0x546913[_0x2deb('0x41')](0x0,_0x546913[_0x2deb('0x42')](_0x26d179));return _0x546913;}function getWebApiUrl(_0x3a7134){return util['format'](_0x2deb('0x43'),_0x3a7134);}exports['getFields']=function(_0x57d65e,_0x3d8a34){var _0x3ad6b2=_0x57d65e[_0x2deb('0x20')][_0x2deb('0x44')];var _0xd9ac74=_0x3ad6b2===_0x2deb('0x45')?_0x2deb('0x46'):_0x2deb('0x47');var _0x2f2d16='';var _0x5cd523='';var _0x769e92='';var _0x1ee4ad='';var _0x2f2b6b='';var _0x128e69='';var _0x5d52ee='';var _0x161651='';var _0x455bdb=[_0x2deb('0x48'),_0x2deb('0x49'),_0x2deb('0x4a'),_0x2deb('0x4b'),_0x2deb('0x4c'),_0x2deb('0x4d'),'phonenumber',_0x2deb('0x4e'),_0x2deb('0x4f'),'phonecall_activity_parties'];var _0x2f5eaf=[_0x2deb('0x50'),_0x2deb('0x51'),_0x2deb('0x52'),'billedserviceunits','contactidname','contactidyominame',_0x2deb('0x53'),_0x2deb('0x54'),_0x2deb('0x55'),_0x2deb('0x56'),_0x2deb('0x57'),_0x2deb('0x58'),_0x2deb('0x59'),_0x2deb('0x5a'),_0x2deb('0x5b'),_0x2deb('0x5c'),_0x2deb('0x5d'),_0x2deb('0x5e'),_0x2deb('0x5f'),_0x2deb('0x60'),'entityimage_timestamp','entityimage_url',_0x2deb('0x61'),_0x2deb('0x62'),_0x2deb('0x63'),'followupby',_0x2deb('0x64'),'influencescore','kbarticleidname',_0x2deb('0x65'),'masteridname',_0x2deb('0x66'),'modifiedbyexternalpartyyominame',_0x2deb('0x67'),_0x2deb('0x68'),_0x2deb('0x69'),'modifiedonbehalfbyname',_0x2deb('0x6a'),_0x2deb('0x6b'),'msdyn_iotalertname',_0x2deb('0x6c'),_0x2deb('0x6d'),_0x2deb('0x6e'),_0x2deb('0x6f'),'owneridtype',_0x2deb('0x70'),_0x2deb('0x71'),_0x2deb('0x72'),'primarycontactidyominame',_0x2deb('0x73'),_0x2deb('0x74'),_0x2deb('0x75'),_0x2deb('0x76'),_0x2deb('0x77'),_0x2deb('0x78'),'responsiblecontactidname','responsiblecontactidyominame',_0x2deb('0x79'),_0x2deb('0x7a'),_0x2deb('0x7b'),'socialprofileidname',_0x2deb('0x7c'),_0x2deb('0x7d'),_0x2deb('0x7e'),'ticketnumber',_0x2deb('0x7f'),'transactioncurrencyidname','traversedpath',_0x2deb('0x80'),_0x2deb('0x81')];var _0xbe51a=_0x455bdb[_0x2deb('0x82')](_0x2f5eaf);return db['Dynamics365Account'][_0x2deb('0x39')]({'where':{'id':_0x57d65e[_0x2deb('0x30')]['id']},'attributes':['id','username',_0x2deb('0x83'),_0x2deb('0x84'),'tenantId',_0x2deb('0x85'),_0x2deb('0x86'),_0x2deb('0x87')],'include':[{'model':db[_0x2deb('0x88')],'as':'CloudProvider','attributes':['id','data5',_0x2deb('0x89')]}]})[_0x2deb('0xf')](handleEntityNotFound(_0x3d8a34,null))[_0x2deb('0xf')](function(_0x46303a){if(_0x46303a){if(_0x46303a['modernAuthentication']){_0x46303a[_0x2deb('0x8a')]=_0x46303a[_0x2deb('0x88')][_0x2deb('0x8b')];_0x161651=sanitizeRemoteUri(_0x46303a[_0x2deb('0x88')]['data7']);_0x5d52ee=getWebApiUrl(_0x161651);return _0x46303a;}_0x161651=sanitizeRemoteUri(_0x46303a[_0x2deb('0x84')]);_0x5d52ee=getWebApiUrl(_0x161651);var _0x13863d={'method':_0x2deb('0x8c'),'uri':_0x2deb('0x8d')+_0x46303a[_0x2deb('0x8e')]+'/oauth2/token','form':{'client_id':_0x46303a[_0x2deb('0x85')],'resource':_0x161651,'username':_0x46303a['username'],'password':_0x46303a['password'],'grant_type':_0x2deb('0x83'),'client_secret':_0x46303a[_0x2deb('0x86')]},'json':!![]};return rp(_0x13863d);}})[_0x2deb('0xf')](function(_0x297b5a){_0x128e69=_0x297b5a[_0x2deb('0x8a')];var _0x4ddd62={'method':'GET','uri':encodeURI(_0x5d52ee+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0xd9ac74+'\x27'),'headers':{'Authorization':_0x2deb('0x8f')+_0x128e69,'If-None-Match':null,'OData-Version':_0x2deb('0x90')},'json':!![]};return rp(_0x4ddd62);})[_0x2deb('0xf')](function(_0x42c9dd){var _0x879dc5=_0x42c9dd[_0x2deb('0x91')][0x0];var _0x324d22=_0x879dc5[_0x2deb('0x92')];var _0x456e9f={'method':'GET','uri':_0x5d52ee+'EntityDefinitions('+_0x324d22+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x128e69,'If-None-Match':null,'OData-Version':_0x2deb('0x90')},'json':!![]};return rp(_0x456e9f);})[_0x2deb('0xf')](function(_0x1a8440){_0x2f2d16=_0x1a8440;_0x5cd523=_0x2f2d16[_0x2deb('0x93')];_0x5cd523=_['remove'](_0x5cd523,function(_0x258f0c){return!_0xbe51a[_0x2deb('0x94')](_0x258f0c[_0x2deb('0x95')]);});var _0x5adf69=[];var _0x8cac3d=[];_0x5cd523[_0x2deb('0x96')](function(_0x5629e8){if(_0x5629e8['@odata.type']){var _0x3ac648=_0x5629e8[_0x2deb('0x97')][_0x2deb('0x41')](_0x5629e8[_0x2deb('0x97')][_0x2deb('0x42')]('.')+0x1);if(_0x3ac648===_0x2deb('0x98')){_0x5adf69[_0x2deb('0x99')](getSelectList(_0x5d52ee,_0x3ad6b2,_0x8cac3d,_0x2f2d16[_0x2deb('0x92')],_0x5629e8[_0x2deb('0x92')],_0x128e69));}}});return Promise[_0x2deb('0x9a')](_0x5adf69);})[_0x2deb('0xf')](function(_0x128913){_0x769e92=_0x128913[0x0];var _0x36a3ec=[];var _0x545fe1=[];_0x5cd523[_0x2deb('0x96')](function(_0x3bd83b){if(!_[_0x2deb('0x9b')](_0x3bd83b[_0x2deb('0x97')])){var _0x547003=_0x3bd83b[_0x2deb('0x97')][_0x2deb('0x41')](_0x3bd83b['@odata.type'][_0x2deb('0x42')]('.')+0x1);if(_0x547003===_0x2deb('0x9c')){_0x36a3ec[_0x2deb('0x99')](getBooleanList(_0x5d52ee,_0x3ad6b2,_0x545fe1,_0x2f2d16[_0x2deb('0x92')],_0x3bd83b[_0x2deb('0x92')],_0x128e69));}}});return Promise[_0x2deb('0x9a')](_0x36a3ec);})[_0x2deb('0xf')](function(_0x56f069){_0x1ee4ad=_0x56f069[0x0];var _0x2ce80b=[];var _0x246b98=[];_0x5cd523[_0x2deb('0x96')](function(_0x205d1d){if(_0x205d1d[_0x2deb('0x97')]){var _0x520db6=_0x205d1d[_0x2deb('0x97')]['substring'](_0x205d1d[_0x2deb('0x97')][_0x2deb('0x42')]('.')+0x1);if(_0x520db6===_0x2deb('0x9d')||_0x520db6==='DoubleAttributeMetadata'||_0x520db6===_0x2deb('0x9e')||_0x520db6===_0x2deb('0x9f')||_0x520db6===_0x2deb('0xa0')||_0x520db6===_0x2deb('0xa1')||_0x520db6===_0x2deb('0xa2')||_0x520db6==='EntityNameAttributeMetadata'||_0x520db6===_0x2deb('0xa3')||_0x520db6===_0x2deb('0xa4')){_0x2ce80b[_0x2deb('0x99')](getInputList(_0x5d52ee,_0x3ad6b2,_0x520db6,_0x246b98,_0x2f2d16[_0x2deb('0x92')],_0x205d1d[_0x2deb('0x92')],_0x128e69));}}});return Promise[_0x2deb('0x9a')](_0x2ce80b);})['then'](function(_0x1a7fc2){_0x2f2b6b=_0x1a7fc2[0x0];var _0x3370af=_0x769e92['concat'](_0x1ee4ad)[_0x2deb('0x82')](_0x2f2b6b);var _0x5c8943={'count':_0x3370af['length'],'rows':_0x3370af};return _0x5c8943;})[_0x2deb('0xf')](respondWithResult(_0x3d8a34,null))['catch'](function(_0x3415fb){var _0x4b6d29=_0x57d65e['query'][_0x2deb('0xa5')]?0x1f4:_0x3415fb['statusCode']||0x1f4;logger[_0x2deb('0x13')](_0x3415fb[_0x2deb('0x14')]);delete _0x3415fb[_0x2deb('0x15')];if(_0x4b6d29===0x191){_0x4b6d29=0x190;}_0x3d8a34[_0x2deb('0x7')](_0x4b6d29)['send'](_0x57d65e[_0x2deb('0x20')][_0x2deb('0xa5')]?{'message':_0x2deb('0xa6'),'statusCode':_0x3415fb['statusCode']}:_0x3415fb);});};function getSelectList(_0x1773b7,_0xb6b608,_0x3e2939,_0x397116,_0x3476d4,_0x350db7){var _0x1b612a={'method':_0x2deb('0xa7'),'uri':_0x1773b7+_0x2deb('0xa8')+_0x397116+_0x2deb('0xa9')+_0x3476d4+_0x2deb('0xaa')+_0x2deb('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x350db7,'If-None-Match':null,'OData-Version':_0x2deb('0x90')},'json':!![]};return rp(_0x1b612a)[_0x2deb('0xf')](function(_0x6a79f9){var _0x400100=[];var _0x4b95a0=_0x6a79f9[_0x2deb('0xac')][_0x2deb('0xad')];_0x4b95a0[_0x2deb('0x96')](function(_0x471a03){_0x400100['push']({'name':_0x471a03[_0x2deb('0xae')][_0x2deb('0xaf')][_0x2deb('0xae')],'value':String(_0x471a03[_0x2deb('0xb0')])});});var _0x39e617={'id':_0xb6b608+'_'+_0x6a79f9[_0x2deb('0x95')],'name':_0x6a79f9[_0x2deb('0xb1')][_0x2deb('0xaf')]['Label'],'custom':![],'options':_0x400100};_0x3e2939[_0x2deb('0x99')](_0x39e617);return _0x3e2939;});}function getBooleanList(_0x295c6e,_0x3e11bf,_0x60c611,_0x541823,_0x396366,_0x43946e){var _0x2c423a={'method':_0x2deb('0xa7'),'uri':_0x295c6e+'EntityDefinitions('+_0x541823+_0x2deb('0xa9')+_0x396366+_0x2deb('0xb2'),'headers':{'Authorization':_0x2deb('0x8f')+_0x43946e,'If-None-Match':null,'OData-Version':_0x2deb('0x90')},'json':!![]};return rp(_0x2c423a)[_0x2deb('0xf')](function(_0x23f99d){var _0xa745d9=[];_0xa745d9['push']({'name':_0x23f99d['OptionSet']['TrueOption'][_0x2deb('0xae')][_0x2deb('0xaf')][_0x2deb('0xae')],'value':'true'},{'name':_0x23f99d[_0x2deb('0xac')][_0x2deb('0xb3')]['Label']['UserLocalizedLabel']['Label'],'value':_0x2deb('0xb4')});var _0x484a9a={'id':_0x3e11bf+'_'+_0x23f99d[_0x2deb('0x95')],'name':_0x23f99d[_0x2deb('0xb1')][_0x2deb('0xaf')][_0x2deb('0xae')],'custom':![],'options':_0xa745d9};_0x60c611[_0x2deb('0x99')](_0x484a9a);return _0x60c611;});}function getInputList(_0x5a21d4,_0x1e027b,_0x1264a1,_0x11f594,_0x424458,_0x2e7121,_0x5b27ec){var _0x4f2aa2={'method':_0x2deb('0xa7'),'uri':_0x5a21d4+_0x2deb('0xa8')+_0x424458+_0x2deb('0xa9')+_0x2e7121+')/Microsoft.Dynamics.CRM.'+_0x1264a1+_0x2deb('0xb5'),'headers':{'Authorization':_0x2deb('0x8f')+_0x5b27ec,'If-None-Match':null,'OData-Version':_0x2deb('0x90')},'json':!![]};return rp(_0x4f2aa2)[_0x2deb('0xf')](function(_0x5537e3){var _0x49f970={'id':_0x1e027b+'_'+_0x5537e3['LogicalName'],'name':_0x5537e3['DisplayName'][_0x2deb('0xaf')]?_0x5537e3[_0x2deb('0xb1')][_0x2deb('0xaf')][_0x2deb('0xae')]:_0x5537e3[_0x2deb('0x95')],'custom':![],'options':[]};_0x11f594[_0x2deb('0x99')](_0x49f970);return _0x11f594;});}
\ No newline at end of file
index 5eb85b3..42b3340 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x24ee56,_0x136374){var _0x2e3bfa=function(_0x48371a){while(--_0x48371a){_0x24ee56['push'](_0x24ee56['shift']());}};_0x2e3bfa(++_0x136374);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xcb91[_0x2ca9d4];return _0x258956;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x3da4a6,_0xb895bd){var _0x2eb8ec=function(_0x2fafde){while(--_0x2fafde){_0x3da4a6['push'](_0x3da4a6['shift']());}};_0x2eb8ec(++_0xb895bd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 884b42c..9bbda11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe99a=['message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','Dynamics365Account,\x20%s,\x20%s','error'];(function(_0x3afebd,_0x315db2){var _0x49858c=function(_0x3a3296){while(--_0x3a3296){_0x3afebd['push'](_0x3afebd['shift']());}};_0x49858c(++_0x315db2);}(_0xe99a,0x11a));var _0xae99=function(_0x4dd82b,_0x51a9e2){_0x4dd82b=_0x4dd82b-0x0;var _0x11e91f=_0xe99a[_0x4dd82b];return _0x11e91f;};'use strict';var _=require(_0xae99('0x0'));var util=require(_0xae99('0x1'));var moment=require(_0xae99('0x2'));var BPromise=require(_0xae99('0x3'));var rs=require(_0xae99('0x4'));var fs=require('fs');var Redis=require(_0xae99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xae99('0x6'));var logger=require(_0xae99('0x7'))(_0xae99('0x8'));var config=require(_0xae99('0x9'));var jayson=require(_0xae99('0xa'));var client=jayson[_0xae99('0xb')][_0xae99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe34ee8,_0x41d300,_0x260eec){return new BPromise(function(_0x22920c,_0x1cc451){return client[_0xae99('0xd')](_0xe34ee8,_0x260eec)['then'](function(_0x5f52dd){logger[_0xae99('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x41d300,_0xae99('0xf'));logger[_0xae99('0x10')](_0xae99('0x11'),_0x41d300,_0xae99('0xf'),JSON[_0xae99('0x12')](_0x5f52dd));if(_0x5f52dd['error']){if(_0x5f52dd['error'][_0xae99('0x13')]===0x1f4){logger['error'](_0xae99('0x14'),_0x41d300,_0x5f52dd[_0xae99('0x15')][_0xae99('0x16')]);return _0x1cc451(_0x5f52dd[_0xae99('0x15')][_0xae99('0x16')]);}logger[_0xae99('0x15')](_0xae99('0x14'),_0x41d300,_0x5f52dd[_0xae99('0x15')][_0xae99('0x16')]);return _0x22920c(_0x5f52dd[_0xae99('0x15')][_0xae99('0x16')]);}else{logger[_0xae99('0xe')](_0xae99('0x14'),_0x41d300,_0xae99('0xf'));_0x22920c(_0x5f52dd[_0xae99('0x17')]['message']);}})[_0xae99('0x18')](function(_0x5577a5){logger[_0xae99('0x15')](_0xae99('0x14'),_0x41d300,_0x5577a5);_0x1cc451(_0x5577a5);});});}exports[_0xae99('0x19')]=function(_0x555058){var _0x1df45f=this;return new Promise(function(_0x3968ec,_0x415c3a){return db[_0xae99('0x1a')][_0xae99('0x1b')]({'raw':_0x555058[_0xae99('0x1c')]?_0x555058['options'][_0xae99('0x1d')]===undefined?!![]:![]:!![],'where':_0x555058[_0xae99('0x1c')]?_0x555058['options'][_0xae99('0x1e')]||null:null,'attributes':_0x555058[_0xae99('0x1c')]?_0x555058[_0xae99('0x1c')]['attributes']||null:null,'limit':_0x555058['options']?_0x555058[_0xae99('0x1c')][_0xae99('0x1f')]||null:null,'include':_0x555058[_0xae99('0x1c')]?_0x555058['options'][_0xae99('0x20')]?_[_0xae99('0x21')](_0x555058['options'][_0xae99('0x20')],function(_0x34e780){return{'model':db[_0x34e780[_0xae99('0x22')]],'as':_0x34e780['as'],'attributes':_0x34e780[_0xae99('0x23')],'include':_0x34e780[_0xae99('0x20')]?_[_0xae99('0x21')](_0x34e780[_0xae99('0x20')],function(_0x1aab90){return{'model':db[_0x1aab90[_0xae99('0x22')]],'as':_0x1aab90['as'],'attributes':_0x1aab90['attributes'],'include':_0x1aab90[_0xae99('0x20')]?_[_0xae99('0x21')](_0x1aab90['include'],function(_0x2fb75d){return{'model':db[_0x2fb75d[_0xae99('0x22')]],'as':_0x2fb75d['as'],'attributes':_0x2fb75d[_0xae99('0x23')]};}):[]};}):[]};}):[]:[]})[_0xae99('0x24')](function(_0x2bba41){logger[_0xae99('0xe')](_0xae99('0x19'),_0x555058);logger[_0xae99('0x10')](_0xae99('0x19'),_0x555058,JSON[_0xae99('0x12')](_0x2bba41));_0x3968ec(_0x2bba41);})['catch'](function(_0x230e8b){logger['error']('GetDynamics365Account',_0x230e8b[_0xae99('0x16')],_0x555058);_0x415c3a(_0x1df45f[_0xae99('0x15')](0x1f4,_0x230e8b[_0xae99('0x16')]));});});};exports[_0xae99('0x25')]=function(_0x196108){var _0x258d45=this;return new Promise(function(_0x23ea62,_0x58f893){return db[_0xae99('0x1a')]['find']({'raw':_0x196108['options']?_0x196108['options'][_0xae99('0x1d')]===undefined?!![]:![]:!![],'where':_0x196108[_0xae99('0x1c')]?_0x196108[_0xae99('0x1c')][_0xae99('0x1e')]||null:null,'attributes':_0x196108[_0xae99('0x1c')]?_0x196108[_0xae99('0x1c')][_0xae99('0x23')]||null:null,'include':_0x196108[_0xae99('0x1c')]?_0x196108[_0xae99('0x1c')][_0xae99('0x20')]?_[_0xae99('0x21')](_0x196108[_0xae99('0x1c')][_0xae99('0x20')],function(_0x11e1a1){return{'model':db[_0x11e1a1[_0xae99('0x22')]],'as':_0x11e1a1['as'],'attributes':_0x11e1a1[_0xae99('0x23')],'include':_0x11e1a1[_0xae99('0x20')]?_['map'](_0x11e1a1[_0xae99('0x20')],function(_0x38d801){return{'model':db[_0x38d801['model']],'as':_0x38d801['as'],'attributes':_0x38d801['attributes'],'include':_0x38d801['include']?_[_0xae99('0x21')](_0x38d801[_0xae99('0x20')],function(_0x1bca8c){return{'model':db[_0x1bca8c['model']],'as':_0x1bca8c['as'],'attributes':_0x1bca8c[_0xae99('0x23')]};}):[]};}):[]};}):[]:[]})[_0xae99('0x24')](function(_0x15b80a){logger['info'](_0xae99('0x25'),_0x196108);logger[_0xae99('0x10')](_0xae99('0x25'),_0x196108,JSON[_0xae99('0x12')](_0x15b80a));_0x23ea62(_0x15b80a);})[_0xae99('0x18')](function(_0x42e19a){logger[_0xae99('0x15')](_0xae99('0x25'),_0x42e19a[_0xae99('0x16')],_0x196108);_0x58f893(_0x258d45[_0xae99('0x15')](0x1f4,_0x42e19a['message']));});});};
\ No newline at end of file
+var _0x76b5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','model','map','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x76b5,0xb7));var _0x576b=function(_0xd0cd54,_0x613e58){_0xd0cd54=_0xd0cd54-0x0;var _0x5f3f4f=_0x76b5[_0xd0cd54];return _0x5f3f4f;};'use strict';var _=require(_0x576b('0x0'));var util=require(_0x576b('0x1'));var moment=require(_0x576b('0x2'));var BPromise=require(_0x576b('0x3'));var rs=require(_0x576b('0x4'));var fs=require('fs');var Redis=require(_0x576b('0x5'));var db=require(_0x576b('0x6'))['db'];var utils=require(_0x576b('0x7'));var logger=require(_0x576b('0x8'))(_0x576b('0x9'));var config=require(_0x576b('0xa'));var jayson=require(_0x576b('0xb'));var client=jayson[_0x576b('0xc')][_0x576b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x117c9e,_0x59b23f,_0x1862d8){return new BPromise(function(_0xd69603,_0x5dcae2){return client[_0x576b('0xe')](_0x117c9e,_0x1862d8)[_0x576b('0xf')](function(_0x8ad90f){logger['info'](_0x576b('0x10'),_0x59b23f,_0x576b('0x11'));logger[_0x576b('0x12')](_0x576b('0x13'),_0x59b23f,_0x576b('0x11'),JSON[_0x576b('0x14')](_0x8ad90f));if(_0x8ad90f[_0x576b('0x15')]){if(_0x8ad90f[_0x576b('0x15')][_0x576b('0x16')]===0x1f4){logger[_0x576b('0x15')](_0x576b('0x10'),_0x59b23f,_0x8ad90f[_0x576b('0x15')]['message']);return _0x5dcae2(_0x8ad90f['error'][_0x576b('0x17')]);}logger[_0x576b('0x15')](_0x576b('0x10'),_0x59b23f,_0x8ad90f[_0x576b('0x15')]['message']);return _0xd69603(_0x8ad90f[_0x576b('0x15')][_0x576b('0x17')]);}else{logger[_0x576b('0x18')](_0x576b('0x10'),_0x59b23f,_0x576b('0x11'));_0xd69603(_0x8ad90f[_0x576b('0x19')][_0x576b('0x17')]);}})[_0x576b('0x1a')](function(_0xc1edf2){logger[_0x576b('0x15')](_0x576b('0x10'),_0x59b23f,_0xc1edf2);_0x5dcae2(_0xc1edf2);});});}exports[_0x576b('0x1b')]=function(_0x165222){var _0x474a23=this;return new Promise(function(_0x34e0f8,_0x1112ee){return db[_0x576b('0x1c')]['findAll']({'raw':_0x165222['options']?_0x165222[_0x576b('0x1d')][_0x576b('0x1e')]===undefined?!![]:![]:!![],'where':_0x165222[_0x576b('0x1d')]?_0x165222[_0x576b('0x1d')][_0x576b('0x1f')]||null:null,'attributes':_0x165222[_0x576b('0x1d')]?_0x165222[_0x576b('0x1d')][_0x576b('0x20')]||null:null,'limit':_0x165222[_0x576b('0x1d')]?_0x165222[_0x576b('0x1d')]['limit']||null:null,'include':_0x165222[_0x576b('0x1d')]?_0x165222['options'][_0x576b('0x21')]?_['map'](_0x165222['options'][_0x576b('0x21')],function(_0x53deea){return{'model':db[_0x53deea[_0x576b('0x22')]],'as':_0x53deea['as'],'attributes':_0x53deea['attributes'],'include':_0x53deea[_0x576b('0x21')]?_[_0x576b('0x23')](_0x53deea['include'],function(_0xeb8cab){return{'model':db[_0xeb8cab[_0x576b('0x22')]],'as':_0xeb8cab['as'],'attributes':_0xeb8cab['attributes'],'include':_0xeb8cab[_0x576b('0x21')]?_[_0x576b('0x23')](_0xeb8cab[_0x576b('0x21')],function(_0x1cfcab){return{'model':db[_0x1cfcab[_0x576b('0x22')]],'as':_0x1cfcab['as'],'attributes':_0x1cfcab[_0x576b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x576b('0xf')](function(_0x2665b5){logger[_0x576b('0x18')](_0x576b('0x1b'),_0x165222);logger[_0x576b('0x12')](_0x576b('0x1b'),_0x165222,JSON[_0x576b('0x14')](_0x2665b5));_0x34e0f8(_0x2665b5);})[_0x576b('0x1a')](function(_0x3458b1){logger[_0x576b('0x15')](_0x576b('0x1b'),_0x3458b1['message'],_0x165222);_0x1112ee(_0x474a23['error'](0x1f4,_0x3458b1['message']));});});};exports[_0x576b('0x24')]=function(_0x115262){var _0x1c8a72=this;return new Promise(function(_0x174e6e,_0x407a9b){return db[_0x576b('0x1c')][_0x576b('0x25')]({'raw':_0x115262[_0x576b('0x1d')]?_0x115262['options']['raw']===undefined?!![]:![]:!![],'where':_0x115262[_0x576b('0x1d')]?_0x115262[_0x576b('0x1d')][_0x576b('0x1f')]||null:null,'attributes':_0x115262[_0x576b('0x1d')]?_0x115262[_0x576b('0x1d')]['attributes']||null:null,'include':_0x115262['options']?_0x115262[_0x576b('0x1d')]['include']?_[_0x576b('0x23')](_0x115262[_0x576b('0x1d')][_0x576b('0x21')],function(_0x27a139){return{'model':db[_0x27a139['model']],'as':_0x27a139['as'],'attributes':_0x27a139[_0x576b('0x20')],'include':_0x27a139[_0x576b('0x21')]?_[_0x576b('0x23')](_0x27a139[_0x576b('0x21')],function(_0x236d6c){return{'model':db[_0x236d6c[_0x576b('0x22')]],'as':_0x236d6c['as'],'attributes':_0x236d6c[_0x576b('0x20')],'include':_0x236d6c[_0x576b('0x21')]?_[_0x576b('0x23')](_0x236d6c[_0x576b('0x21')],function(_0x22a34c){return{'model':db[_0x22a34c[_0x576b('0x22')]],'as':_0x22a34c['as'],'attributes':_0x22a34c[_0x576b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x576b('0xf')](function(_0x28f534){logger['info'](_0x576b('0x24'),_0x115262);logger['debug'](_0x576b('0x24'),_0x115262,JSON[_0x576b('0x14')](_0x28f534));_0x174e6e(_0x28f534);})[_0x576b('0x1a')](function(_0x3b63a0){logger['error']('ShowDynamics365Account',_0x3b63a0[_0x576b('0x17')],_0x115262);_0x407a9b(_0x1c8a72['error'](0x1f4,_0x3b63a0[_0x576b('0x17')]));});});};
\ No newline at end of file
index a4efd0f..82071ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe730=['isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x56fc90,_0x48ea9d){var _0x20fd2c=function(_0xffd2a1){while(--_0xffd2a1){_0x56fc90['push'](_0x56fc90['shift']());}};_0x20fd2c(++_0x48ea9d);}(_0xe730,0xf2));var _0x0e73=function(_0x2cd023,_0x3298d1){_0x2cd023=_0x2cd023-0x0;var _0x281196=_0xe730[_0x2cd023];return _0x281196;};'use strict';var multer=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var path=require(_0x0e73('0x2'));var timeout=require(_0x0e73('0x3'));var express=require(_0x0e73('0x4'));var router=express[_0x0e73('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e73('0x6'));var config=require(_0x0e73('0x7'));var controller=require(_0x0e73('0x8'));router[_0x0e73('0x9')]('/',auth[_0x0e73('0xa')](),controller[_0x0e73('0xb')]);router[_0x0e73('0x9')](_0x0e73('0xc'),auth[_0x0e73('0xa')](),controller[_0x0e73('0xd')]);router[_0x0e73('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0e73('0xe')]);router['get']('/:id/subjects',auth[_0x0e73('0xa')](),controller[_0x0e73('0xf')]);router[_0x0e73('0x9')](_0x0e73('0x10'),auth[_0x0e73('0xa')](),controller['getDescriptions']);router[_0x0e73('0x11')]('/',auth[_0x0e73('0xa')](),controller['create']);router['put'](_0x0e73('0xc'),auth[_0x0e73('0xa')](),controller[_0x0e73('0x12')]);router[_0x0e73('0x13')]('/:id',auth[_0x0e73('0xa')](),controller['destroy']);module[_0x0e73('0x14')]=router;
\ No newline at end of file
+var _0x0c1a=['delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update'];(function(_0x549953,_0x58b1aa){var _0x136cdb=function(_0x23300e){while(--_0x23300e){_0x549953['push'](_0x549953['shift']());}};_0x136cdb(++_0x58b1aa);}(_0x0c1a,0x127));var _0xa0c1=function(_0x5d64ea,_0x3678c9){_0x5d64ea=_0x5d64ea-0x0;var _0x583e50=_0x0c1a[_0x5d64ea];return _0x583e50;};'use strict';var multer=require(_0xa0c1('0x0'));var util=require(_0xa0c1('0x1'));var path=require(_0xa0c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0c1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa0c1('0x4'));var interaction=require(_0xa0c1('0x5'));var config=require(_0xa0c1('0x6'));var controller=require(_0xa0c1('0x7'));router[_0xa0c1('0x8')]('/',auth[_0xa0c1('0x9')](),controller[_0xa0c1('0xa')]);router[_0xa0c1('0x8')](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller['show']);router[_0xa0c1('0x8')](_0xa0c1('0xc'),auth[_0xa0c1('0x9')](),controller[_0xa0c1('0xd')]);router[_0xa0c1('0x8')](_0xa0c1('0xe'),auth['isAuthenticated'](),controller[_0xa0c1('0xf')]);router['get'](_0xa0c1('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa0c1('0x11')]('/',auth[_0xa0c1('0x9')](),controller[_0xa0c1('0x12')]);router['put'](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller[_0xa0c1('0x13')]);router[_0xa0c1('0x14')](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fc6ae3d..526978f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82cb=['ENUM','incident','contact','BOOLEAN','sequelize','exports','STRING'];(function(_0x6f0915,_0x259cac){var _0x167d1f=function(_0x33df85){while(--_0x33df85){_0x6f0915['push'](_0x6f0915['shift']());}};_0x167d1f(++_0x259cac);}(_0x82cb,0xeb));var _0xb82c=function(_0x486373,_0x414c3c){_0x486373=_0x486373-0x0;var _0x3fa1a9=_0x82cb[_0x486373];return _0x3fa1a9;};'use strict';var Sequelize=require(_0xb82c('0x0'));module[_0xb82c('0x1')]={'name':{'type':Sequelize[_0xb82c('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb82c('0x3')](_0xb82c('0x4'),'phonecall'),'defaultValue':_0xb82c('0x4')},'moduleCreate':{'type':Sequelize[_0xb82c('0x3')](_0xb82c('0x5'),'nothing'),'defaultValue':_0xb82c('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb82c('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xb82c('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x662d=['exports','incident','ENUM','nothing','BOOLEAN','sequelize'];(function(_0x49340f,_0x394f9f){var _0x466272=function(_0x205af6){while(--_0x205af6){_0x49340f['push'](_0x49340f['shift']());}};_0x466272(++_0x394f9f);}(_0x662d,0x119));var _0xd662=function(_0x30cfa3,_0x12044d){_0x30cfa3=_0x30cfa3-0x0;var _0x344cff=_0x662d[_0x30cfa3];return _0x344cff;};'use strict';var Sequelize=require(_0xd662('0x0'));module[_0xd662('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xd662('0x2'),'phonecall'),'defaultValue':_0xd662('0x2')},'moduleCreate':{'type':Sequelize[_0xd662('0x3')]('contact',_0xd662('0x4')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xd662('0x5')],'defaultValue':!![]}};
\ No newline at end of file
index c5a9d61..1bcf105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1926=['show','keys','includeAll','include','find','catch','create','body','params','destroy','getFields','Dynamics365Field','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','end','error','stack','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','options','findAll','rows'];(function(_0x484a20,_0x3de29b){var _0x2602d2=function(_0x449d26){while(--_0x449d26){_0x484a20['push'](_0x484a20['shift']());}};_0x2602d2(++_0x3de29b);}(_0x1926,0xb1));var _0x6192=function(_0x2b0af0,_0x48d46a){_0x2b0af0=_0x2b0af0-0x0;var _0x219fb6=_0x1926[_0x2b0af0];return _0x219fb6;};'use strict';var emlformat=require(_0x6192('0x0'));var rimraf=require(_0x6192('0x1'));var zipdir=require(_0x6192('0x2'));var jsonpatch=require(_0x6192('0x3'));var rp=require(_0x6192('0x4'));var moment=require('moment');var BPromise=require(_0x6192('0x5'));var Mustache=require('mustache');var util=require(_0x6192('0x6'));var path=require(_0x6192('0x7'));var sox=require(_0x6192('0x8'));var csv=require('to-csv');var ejs=require(_0x6192('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6192('0xa'));var crypto=require(_0x6192('0xb'));var jsforce=require(_0x6192('0xc'));var deskjs=require(_0x6192('0xd'));var toCsv=require(_0x6192('0xe'));var querystring=require('querystring');var Papa=require(_0x6192('0xf'));var Redis=require('ioredis');var authService=require(_0x6192('0x10'));var qs=require(_0x6192('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6192('0x12'));var logger=require(_0x6192('0x13'))(_0x6192('0x14'));var utils=require(_0x6192('0x15'));var config=require(_0x6192('0x16'));var licenseUtil=require(_0x6192('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540d1d,_0x3f725c){_0x3f725c=_0x3f725c||0xcc;return function(_0x3259c9){if(_0x3259c9){return _0x540d1d[_0x6192('0x18')](_0x3f725c);}return _0x540d1d['status'](_0x3f725c)['end']();};}function respondWithResult(_0x5c7f76,_0x527e5c){_0x527e5c=_0x527e5c||0xc8;return function(_0x342d85){if(_0x342d85){return _0x5c7f76[_0x6192('0x19')](_0x527e5c)['json'](_0x342d85);}};}function respondWithFilteredResult(_0x36e687,_0x2ad495){return function(_0x5c043c){if(_0x5c043c){var _0x8d8ccc=typeof _0x2ad495[_0x6192('0x1a')]===_0x6192('0x1b')&&typeof _0x2ad495[_0x6192('0x1c')]===_0x6192('0x1b');var _0x223bed=_0x5c043c[_0x6192('0x1d')];var _0x30e340=_0x8d8ccc?0x0:_0x2ad495[_0x6192('0x1a')];var _0x2ab940=_0x8d8ccc?_0x5c043c[_0x6192('0x1d')]:_0x2ad495[_0x6192('0x1a')]+_0x2ad495[_0x6192('0x1c')];var _0x5af5ec;if(_0x2ab940>=_0x223bed){_0x2ab940=_0x223bed;_0x5af5ec=0xc8;}else{_0x5af5ec=0xce;}_0x36e687['status'](_0x5af5ec);return _0x36e687[_0x6192('0x1e')](_0x6192('0x1f'),_0x30e340+'-'+_0x2ab940+'/'+_0x223bed)[_0x6192('0x20')](_0x5c043c);}return null;};}function patchUpdates(_0x663077){return function(_0x577625){try{jsonpatch['apply'](_0x577625,_0x663077,!![]);}catch(_0x2766b2){return BPromise[_0x6192('0x21')](_0x2766b2);}return _0x577625[_0x6192('0x22')]();};}function saveUpdates(_0x263bcd,_0x15cfeb){return function(_0x4023bd){if(_0x4023bd){return _0x4023bd[_0x6192('0x23')](_0x263bcd)[_0x6192('0x24')](function(_0x335032){return _0x335032;});}return null;};}function removeEntity(_0x5c609a,_0x47f310){return function(_0x59e018){if(_0x59e018){return _0x59e018['destroy']()[_0x6192('0x24')](function(){_0x5c609a['status'](0xcc)[_0x6192('0x25')]();});}};}function handleEntityNotFound(_0x41843a,_0x60ce93){return function(_0x43ba22){if(!_0x43ba22){_0x41843a[_0x6192('0x18')](0x194);}return _0x43ba22;};}function handleError(_0x25ce59,_0x1d72ef){_0x1d72ef=_0x1d72ef||0x1f4;return function(_0x13da77){logger[_0x6192('0x26')](_0x13da77[_0x6192('0x27')]);if(_0x13da77['name']){delete _0x13da77['name'];}_0x25ce59['status'](_0x1d72ef)['send'](_0x13da77);};}exports[_0x6192('0x28')]=function(_0x3a70e9,_0x256d36){var _0x5d64f8={},_0x2ac163={},_0x4c95fd={'count':0x0,'rows':[]};var _0x566978=_[_0x6192('0x29')](db[_0x6192('0x2a')][_0x6192('0x2b')],function(_0x183aff){return{'name':_0x183aff[_0x6192('0x2c')],'type':_0x183aff[_0x6192('0x2d')][_0x6192('0x2e')]};});_0x2ac163[_0x6192('0x2f')]=_[_0x6192('0x29')](_0x566978,'name');_0x2ac163['query']=_['keys'](_0x3a70e9[_0x6192('0x30')]);_0x2ac163[_0x6192('0x31')]=_[_0x6192('0x32')](_0x2ac163['model'],_0x2ac163[_0x6192('0x30')]);_0x5d64f8[_0x6192('0x33')]=_['intersection'](_0x2ac163['model'],qs['fields'](_0x3a70e9[_0x6192('0x30')][_0x6192('0x34')]));_0x5d64f8[_0x6192('0x33')]=_0x5d64f8[_0x6192('0x33')][_0x6192('0x35')]?_0x5d64f8[_0x6192('0x33')]:_0x2ac163[_0x6192('0x2f')];if(!_0x3a70e9[_0x6192('0x30')][_0x6192('0x36')](_0x6192('0x37'))){_0x5d64f8[_0x6192('0x1c')]=qs[_0x6192('0x1c')](_0x3a70e9['query'][_0x6192('0x1c')]);_0x5d64f8[_0x6192('0x1a')]=qs[_0x6192('0x1a')](_0x3a70e9[_0x6192('0x30')][_0x6192('0x1a')]);}_0x5d64f8[_0x6192('0x38')]=qs[_0x6192('0x39')](_0x3a70e9[_0x6192('0x30')][_0x6192('0x39')]);_0x5d64f8['where']=qs['filters'](_[_0x6192('0x3a')](_0x3a70e9[_0x6192('0x30')],_0x2ac163[_0x6192('0x31')]),_0x566978);if(_0x3a70e9[_0x6192('0x30')][_0x6192('0x3b')]){_0x5d64f8[_0x6192('0x3c')]=_[_0x6192('0x3d')](_0x5d64f8[_0x6192('0x3c')],{'$or':_[_0x6192('0x29')](_0x566978,function(_0x5cb5aa){if(_0x5cb5aa[_0x6192('0x2d')]!=='VIRTUAL'){var _0x1a5129={};_0x1a5129[_0x5cb5aa[_0x6192('0x3e')]]={'$like':'%'+_0x3a70e9[_0x6192('0x30')][_0x6192('0x3b')]+'%'};return _0x1a5129;}})});}_0x5d64f8=_[_0x6192('0x3d')]({},_0x5d64f8,_0x3a70e9[_0x6192('0x3f')]);var _0x11deb4={'where':_0x5d64f8['where']};return db[_0x6192('0x2a')][_0x6192('0x1d')](_0x11deb4)[_0x6192('0x24')](function(_0x212e20){_0x4c95fd[_0x6192('0x1d')]=_0x212e20;if(_0x3a70e9[_0x6192('0x30')]['includeAll']){_0x5d64f8['include']=[{'all':!![]}];}return db[_0x6192('0x2a')][_0x6192('0x40')](_0x5d64f8);})[_0x6192('0x24')](function(_0x479553){_0x4c95fd[_0x6192('0x41')]=_0x479553;return _0x4c95fd;})[_0x6192('0x24')](respondWithFilteredResult(_0x256d36,_0x5d64f8))['catch'](handleError(_0x256d36,null));};exports[_0x6192('0x42')]=function(_0x22ad74,_0x181f9a){var _0x3d207e={'raw':![],'where':{'id':_0x22ad74['params']['id']}},_0x697376={};_0x697376[_0x6192('0x2f')]=_[_0x6192('0x43')](db[_0x6192('0x2a')]['rawAttributes']);_0x697376[_0x6192('0x30')]=_[_0x6192('0x43')](_0x22ad74['query']);_0x697376['filters']=_['intersection'](_0x697376[_0x6192('0x2f')],_0x697376[_0x6192('0x30')]);_0x3d207e[_0x6192('0x33')]=_[_0x6192('0x32')](_0x697376['model'],qs[_0x6192('0x34')](_0x22ad74['query'][_0x6192('0x34')]));_0x3d207e[_0x6192('0x33')]=_0x3d207e[_0x6192('0x33')][_0x6192('0x35')]?_0x3d207e[_0x6192('0x33')]:_0x697376[_0x6192('0x2f')];if(_0x22ad74[_0x6192('0x30')][_0x6192('0x44')]){_0x3d207e[_0x6192('0x45')]=[{'all':!![]}];}_0x3d207e=_[_0x6192('0x3d')]({},_0x3d207e,_0x22ad74[_0x6192('0x3f')]);return db['Dynamics365Configuration'][_0x6192('0x46')](_0x3d207e)[_0x6192('0x24')](handleEntityNotFound(_0x181f9a,null))[_0x6192('0x24')](respondWithResult(_0x181f9a,null))[_0x6192('0x47')](handleError(_0x181f9a,null));};exports[_0x6192('0x48')]=function(_0x57a1f7,_0x2f33bd){return db['Dynamics365Configuration'][_0x6192('0x48')](_0x57a1f7[_0x6192('0x49')],{})[_0x6192('0x24')](respondWithResult(_0x2f33bd,0xc9))[_0x6192('0x47')](handleError(_0x2f33bd,null));};exports['update']=function(_0x19eb20,_0x2c23fa){if(_0x19eb20[_0x6192('0x49')]['id']){delete _0x19eb20[_0x6192('0x49')]['id'];}return db[_0x6192('0x2a')][_0x6192('0x46')]({'where':{'id':_0x19eb20[_0x6192('0x4a')]['id']}})[_0x6192('0x24')](handleEntityNotFound(_0x2c23fa,null))[_0x6192('0x24')](saveUpdates(_0x19eb20[_0x6192('0x49')],null))['then'](respondWithResult(_0x2c23fa,null))['catch'](handleError(_0x2c23fa,null));};exports[_0x6192('0x4b')]=function(_0x2e94b7,_0x570eb5){return db[_0x6192('0x2a')][_0x6192('0x46')]({'where':{'id':_0x2e94b7['params']['id']}})[_0x6192('0x24')](handleEntityNotFound(_0x570eb5,null))['then'](removeEntity(_0x570eb5,null))[_0x6192('0x47')](handleError(_0x570eb5,null));};exports[_0x6192('0x4c')]=function(_0x524ee3,_0x41973d,_0x5aae1b){var _0x281019={};var _0x52fc1f={};var _0x40210b;var _0x531a74;return db[_0x6192('0x2a')]['findOne']({'where':{'id':_0x524ee3[_0x6192('0x4a')]['id']}})[_0x6192('0x24')](handleEntityNotFound(_0x41973d,null))[_0x6192('0x24')](function(_0x53962e){if(_0x53962e){_0x40210b=_0x53962e;_0x52fc1f['model']=_[_0x6192('0x43')](db[_0x6192('0x4d')]['rawAttributes']);_0x52fc1f[_0x6192('0x30')]=_[_0x6192('0x43')](_0x524ee3[_0x6192('0x30')]);_0x52fc1f['filters']=_[_0x6192('0x32')](_0x52fc1f[_0x6192('0x2f')],_0x52fc1f[_0x6192('0x30')]);_0x281019[_0x6192('0x33')]=_[_0x6192('0x32')](_0x52fc1f[_0x6192('0x2f')],qs[_0x6192('0x34')](_0x524ee3[_0x6192('0x30')]['fields']));_0x281019[_0x6192('0x33')]=_0x281019[_0x6192('0x33')]['length']?_0x281019[_0x6192('0x33')]:_0x52fc1f[_0x6192('0x2f')];_0x281019[_0x6192('0x38')]=qs[_0x6192('0x39')](_0x524ee3[_0x6192('0x30')][_0x6192('0x39')]);_0x281019['where']=qs['filters'](_[_0x6192('0x3a')](_0x524ee3['query'],_0x52fc1f[_0x6192('0x31')]));if(_0x524ee3[_0x6192('0x30')][_0x6192('0x3b')]){_0x281019[_0x6192('0x3c')]=_[_0x6192('0x3d')](_0x281019['where'],{'$or':_[_0x6192('0x29')](_0x281019[_0x6192('0x33')],function(_0x564e7d){var _0x3dc841={};_0x3dc841[_0x564e7d]={'$like':'%'+_0x524ee3['query'][_0x6192('0x3b')]+'%'};return _0x3dc841;})});}_0x281019=_[_0x6192('0x3d')]({},_0x281019,_0x524ee3[_0x6192('0x3f')]);return _0x40210b[_0x6192('0x4c')](_0x281019);}})[_0x6192('0x24')](function(_0x857fcb){if(_0x857fcb){_0x531a74=_0x857fcb[_0x6192('0x35')];if(!_0x524ee3[_0x6192('0x30')][_0x6192('0x36')]('nolimit')){_0x281019[_0x6192('0x1c')]=qs[_0x6192('0x1c')](_0x524ee3['query'][_0x6192('0x1c')]);_0x281019[_0x6192('0x1a')]=qs[_0x6192('0x1a')](_0x524ee3[_0x6192('0x30')][_0x6192('0x1a')]);}return _0x40210b[_0x6192('0x4c')](_0x281019);}})[_0x6192('0x24')](function(_0x1439ab){if(_0x1439ab){return _0x1439ab?{'count':_0x531a74,'rows':_0x1439ab}:null;}})[_0x6192('0x24')](respondWithResult(_0x41973d,null))['catch'](handleError(_0x41973d,null));};exports[_0x6192('0x4e')]=function(_0x6bf967,_0x23df6c,_0x10718e){var _0x2c1125={};var _0x498f25={};var _0xf40eff;var _0x5ba3dc;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x6bf967['params']['id']}})[_0x6192('0x24')](handleEntityNotFound(_0x23df6c,null))[_0x6192('0x24')](function(_0x4f487b){if(_0x4f487b){_0xf40eff=_0x4f487b;_0x498f25[_0x6192('0x2f')]=_[_0x6192('0x43')](db[_0x6192('0x4d')][_0x6192('0x2b')]);_0x498f25[_0x6192('0x30')]=_[_0x6192('0x43')](_0x6bf967[_0x6192('0x30')]);_0x498f25[_0x6192('0x31')]=_[_0x6192('0x32')](_0x498f25[_0x6192('0x2f')],_0x498f25[_0x6192('0x30')]);_0x2c1125['attributes']=_[_0x6192('0x32')](_0x498f25[_0x6192('0x2f')],qs['fields'](_0x6bf967[_0x6192('0x30')]['fields']));_0x2c1125[_0x6192('0x33')]=_0x2c1125[_0x6192('0x33')]['length']?_0x2c1125[_0x6192('0x33')]:_0x498f25[_0x6192('0x2f')];_0x2c1125[_0x6192('0x38')]=qs['sort'](_0x6bf967[_0x6192('0x30')][_0x6192('0x39')]);_0x2c1125[_0x6192('0x3c')]=qs[_0x6192('0x31')](_[_0x6192('0x3a')](_0x6bf967[_0x6192('0x30')],_0x498f25['filters']));if(_0x6bf967[_0x6192('0x30')]['filter']){_0x2c1125[_0x6192('0x3c')]=_[_0x6192('0x3d')](_0x2c1125[_0x6192('0x3c')],{'$or':_[_0x6192('0x29')](_0x2c1125[_0x6192('0x33')],function(_0x3b7b56){var _0x2e2ba4={};_0x2e2ba4[_0x3b7b56]={'$like':'%'+_0x6bf967[_0x6192('0x30')][_0x6192('0x3b')]+'%'};return _0x2e2ba4;})});}_0x2c1125=_['merge']({},_0x2c1125,_0x6bf967[_0x6192('0x3f')]);return _0xf40eff['getSubjects'](_0x2c1125);}})[_0x6192('0x24')](function(_0x273108){if(_0x273108){_0x5ba3dc=_0x273108['length'];if(!_0x6bf967[_0x6192('0x30')]['hasOwnProperty'](_0x6192('0x37'))){_0x2c1125[_0x6192('0x1c')]=qs[_0x6192('0x1c')](_0x6bf967[_0x6192('0x30')][_0x6192('0x1c')]);_0x2c1125[_0x6192('0x1a')]=qs[_0x6192('0x1a')](_0x6bf967[_0x6192('0x30')]['offset']);}return _0xf40eff[_0x6192('0x4e')](_0x2c1125);}})['then'](function(_0x38986f){if(_0x38986f){return _0x38986f?{'count':_0x5ba3dc,'rows':_0x38986f}:null;}})[_0x6192('0x24')](respondWithResult(_0x23df6c,null))['catch'](handleError(_0x23df6c,null));};exports[_0x6192('0x4f')]=function(_0x2abf59,_0x145331,_0x4f8390){var _0x3fb20a={};var _0x13c6ce={};var _0x54ad90;var _0x27982;return db[_0x6192('0x2a')][_0x6192('0x50')]({'where':{'id':_0x2abf59[_0x6192('0x4a')]['id']}})[_0x6192('0x24')](handleEntityNotFound(_0x145331,null))[_0x6192('0x24')](function(_0x49da34){if(_0x49da34){_0x54ad90=_0x49da34;_0x13c6ce[_0x6192('0x2f')]=_[_0x6192('0x43')](db[_0x6192('0x4d')]['rawAttributes']);_0x13c6ce[_0x6192('0x30')]=_['keys'](_0x2abf59[_0x6192('0x30')]);_0x13c6ce[_0x6192('0x31')]=_[_0x6192('0x32')](_0x13c6ce['model'],_0x13c6ce[_0x6192('0x30')]);_0x3fb20a[_0x6192('0x33')]=_[_0x6192('0x32')](_0x13c6ce['model'],qs[_0x6192('0x34')](_0x2abf59[_0x6192('0x30')][_0x6192('0x34')]));_0x3fb20a['attributes']=_0x3fb20a[_0x6192('0x33')][_0x6192('0x35')]?_0x3fb20a[_0x6192('0x33')]:_0x13c6ce[_0x6192('0x2f')];_0x3fb20a['order']=qs[_0x6192('0x39')](_0x2abf59[_0x6192('0x30')]['sort']);_0x3fb20a[_0x6192('0x3c')]=qs[_0x6192('0x31')](_[_0x6192('0x3a')](_0x2abf59[_0x6192('0x30')],_0x13c6ce[_0x6192('0x31')]));if(_0x2abf59[_0x6192('0x30')][_0x6192('0x3b')]){_0x3fb20a[_0x6192('0x3c')]=_[_0x6192('0x3d')](_0x3fb20a[_0x6192('0x3c')],{'$or':_[_0x6192('0x29')](_0x3fb20a[_0x6192('0x33')],function(_0xb93e3e){var _0x152c25={};_0x152c25[_0xb93e3e]={'$like':'%'+_0x2abf59[_0x6192('0x30')]['filter']+'%'};return _0x152c25;})});}_0x3fb20a=_[_0x6192('0x3d')]({},_0x3fb20a,_0x2abf59[_0x6192('0x3f')]);return _0x54ad90[_0x6192('0x4f')](_0x3fb20a);}})[_0x6192('0x24')](function(_0xc277a6){if(_0xc277a6){_0x27982=_0xc277a6[_0x6192('0x35')];if(!_0x2abf59[_0x6192('0x30')][_0x6192('0x36')](_0x6192('0x37'))){_0x3fb20a['limit']=qs[_0x6192('0x1c')](_0x2abf59[_0x6192('0x30')][_0x6192('0x1c')]);_0x3fb20a[_0x6192('0x1a')]=qs[_0x6192('0x1a')](_0x2abf59[_0x6192('0x30')][_0x6192('0x1a')]);}return _0x54ad90['getDescriptions'](_0x3fb20a);}})['then'](function(_0x459ced){if(_0x459ced){return _0x459ced?{'count':_0x27982,'rows':_0x459ced}:null;}})[_0x6192('0x24')](respondWithResult(_0x145331,null))[_0x6192('0x47')](handleError(_0x145331,null));};
\ No newline at end of file
+var _0xce02=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','name','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','findOne','getFields','hasOwnProperty','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x37bc87,_0x358d11){var _0x298615=function(_0x58fb3f){while(--_0x58fb3f){_0x37bc87['push'](_0x37bc87['shift']());}};_0x298615(++_0x358d11);}(_0xce02,0x17c));var _0x2ce0=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xce02[_0x5d9867];return _0x7d2118;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ce0('0x0'));var zipdir=require(_0x2ce0('0x1'));var jsonpatch=require(_0x2ce0('0x2'));var rp=require('request-promise');var moment=require(_0x2ce0('0x3'));var BPromise=require(_0x2ce0('0x4'));var Mustache=require(_0x2ce0('0x5'));var util=require('util');var path=require(_0x2ce0('0x6'));var sox=require(_0x2ce0('0x7'));var csv=require(_0x2ce0('0x8'));var ejs=require(_0x2ce0('0x9'));var fs=require('fs');var fs_extra=require(_0x2ce0('0xa'));var _=require(_0x2ce0('0xb'));var squel=require(_0x2ce0('0xc'));var crypto=require(_0x2ce0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2ce0('0xe'));var toCsv=require(_0x2ce0('0x8'));var querystring=require(_0x2ce0('0xf'));var Papa=require(_0x2ce0('0x10'));var Redis=require('ioredis');var authService=require(_0x2ce0('0x11'));var qs=require(_0x2ce0('0x12'));var as=require(_0x2ce0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2ce0('0x14'));var utils=require('../../config/utils');var config=require(_0x2ce0('0x15'));var licenseUtil=require(_0x2ce0('0x16'));var db=require(_0x2ce0('0x17'))['db'];function respondWithStatusCode(_0x48ef8b,_0xa2354f){_0xa2354f=_0xa2354f||0xcc;return function(_0x1f41f0){if(_0x1f41f0){return _0x48ef8b[_0x2ce0('0x18')](_0xa2354f);}return _0x48ef8b[_0x2ce0('0x19')](_0xa2354f)['end']();};}function respondWithResult(_0x85ea26,_0x5f0fa8){_0x5f0fa8=_0x5f0fa8||0xc8;return function(_0x109bbf){if(_0x109bbf){return _0x85ea26[_0x2ce0('0x19')](_0x5f0fa8)['json'](_0x109bbf);}};}function respondWithFilteredResult(_0x1ebdbc,_0x44c2b9){return function(_0x319fcb){if(_0x319fcb){var _0xd0108c=typeof _0x44c2b9[_0x2ce0('0x1a')]==='undefined'&&typeof _0x44c2b9[_0x2ce0('0x1b')]===_0x2ce0('0x1c');var _0x85eeda=_0x319fcb[_0x2ce0('0x1d')];var _0x4da22f=_0xd0108c?0x0:_0x44c2b9[_0x2ce0('0x1a')];var _0x5d9551=_0xd0108c?_0x319fcb['count']:_0x44c2b9['offset']+_0x44c2b9[_0x2ce0('0x1b')];var _0x1c343d;if(_0x5d9551>=_0x85eeda){_0x5d9551=_0x85eeda;_0x1c343d=0xc8;}else{_0x1c343d=0xce;}_0x1ebdbc[_0x2ce0('0x19')](_0x1c343d);return _0x1ebdbc['set'](_0x2ce0('0x1e'),_0x4da22f+'-'+_0x5d9551+'/'+_0x85eeda)[_0x2ce0('0x1f')](_0x319fcb);}return null;};}function patchUpdates(_0x11bf23){return function(_0x38215e){try{jsonpatch[_0x2ce0('0x20')](_0x38215e,_0x11bf23,!![]);}catch(_0x434fb0){return BPromise[_0x2ce0('0x21')](_0x434fb0);}return _0x38215e[_0x2ce0('0x22')]();};}function saveUpdates(_0x323ce3,_0x4177ad){return function(_0x3ff34e){if(_0x3ff34e){return _0x3ff34e[_0x2ce0('0x23')](_0x323ce3)[_0x2ce0('0x24')](function(_0x26f601){return _0x26f601;});}return null;};}function removeEntity(_0x5320e9,_0x8af221){return function(_0x42d186){if(_0x42d186){return _0x42d186[_0x2ce0('0x25')]()[_0x2ce0('0x24')](function(){_0x5320e9[_0x2ce0('0x19')](0xcc)[_0x2ce0('0x26')]();});}};}function handleEntityNotFound(_0x4425c0,_0xaa1ad8){return function(_0x234562){if(!_0x234562){_0x4425c0[_0x2ce0('0x18')](0x194);}return _0x234562;};}function handleError(_0x533400,_0x4db163){_0x4db163=_0x4db163||0x1f4;return function(_0x1d4da2){logger['error'](_0x1d4da2['stack']);if(_0x1d4da2['name']){delete _0x1d4da2[_0x2ce0('0x27')];}_0x533400[_0x2ce0('0x19')](_0x4db163)['send'](_0x1d4da2);};}exports[_0x2ce0('0x28')]=function(_0x193fd7,_0x5f395f){var _0x25b686={},_0x409c66={},_0x520790={'count':0x0,'rows':[]};var _0x32deec=_[_0x2ce0('0x29')](db[_0x2ce0('0x2a')]['rawAttributes'],function(_0x200769){return{'name':_0x200769[_0x2ce0('0x2b')],'type':_0x200769[_0x2ce0('0x2c')][_0x2ce0('0x2d')]};});_0x409c66[_0x2ce0('0x2e')]=_[_0x2ce0('0x29')](_0x32deec,'name');_0x409c66[_0x2ce0('0x2f')]=_[_0x2ce0('0x30')](_0x193fd7[_0x2ce0('0x2f')]);_0x409c66[_0x2ce0('0x31')]=_['intersection'](_0x409c66[_0x2ce0('0x2e')],_0x409c66[_0x2ce0('0x2f')]);_0x25b686[_0x2ce0('0x32')]=_[_0x2ce0('0x33')](_0x409c66[_0x2ce0('0x2e')],qs[_0x2ce0('0x34')](_0x193fd7[_0x2ce0('0x2f')][_0x2ce0('0x34')]));_0x25b686[_0x2ce0('0x32')]=_0x25b686['attributes']['length']?_0x25b686[_0x2ce0('0x32')]:_0x409c66[_0x2ce0('0x2e')];if(!_0x193fd7[_0x2ce0('0x2f')]['hasOwnProperty'](_0x2ce0('0x35'))){_0x25b686[_0x2ce0('0x1b')]=qs[_0x2ce0('0x1b')](_0x193fd7['query']['limit']);_0x25b686[_0x2ce0('0x1a')]=qs['offset'](_0x193fd7[_0x2ce0('0x2f')][_0x2ce0('0x1a')]);}_0x25b686[_0x2ce0('0x36')]=qs[_0x2ce0('0x37')](_0x193fd7[_0x2ce0('0x2f')][_0x2ce0('0x37')]);_0x25b686[_0x2ce0('0x38')]=qs[_0x2ce0('0x31')](_[_0x2ce0('0x39')](_0x193fd7['query'],_0x409c66['filters']),_0x32deec);if(_0x193fd7[_0x2ce0('0x2f')][_0x2ce0('0x3a')]){_0x25b686['where']=_['merge'](_0x25b686[_0x2ce0('0x38')],{'$or':_['map'](_0x32deec,function(_0x57e20e){if(_0x57e20e['type']!=='VIRTUAL'){var _0x53576d={};_0x53576d[_0x57e20e[_0x2ce0('0x27')]]={'$like':'%'+_0x193fd7[_0x2ce0('0x2f')]['filter']+'%'};return _0x53576d;}})});}_0x25b686=_[_0x2ce0('0x3b')]({},_0x25b686,_0x193fd7[_0x2ce0('0x3c')]);var _0x3fb872={'where':_0x25b686[_0x2ce0('0x38')]};return db['Dynamics365Configuration']['count'](_0x3fb872)['then'](function(_0x17bf98){_0x520790[_0x2ce0('0x1d')]=_0x17bf98;if(_0x193fd7[_0x2ce0('0x2f')]['includeAll']){_0x25b686[_0x2ce0('0x3d')]=[{'all':!![]}];}return db[_0x2ce0('0x2a')][_0x2ce0('0x3e')](_0x25b686);})['then'](function(_0x3903af){_0x520790[_0x2ce0('0x3f')]=_0x3903af;return _0x520790;})[_0x2ce0('0x24')](respondWithFilteredResult(_0x5f395f,_0x25b686))[_0x2ce0('0x40')](handleError(_0x5f395f,null));};exports[_0x2ce0('0x41')]=function(_0x24a9d9,_0x212658){var _0x2e63b9={'raw':![],'where':{'id':_0x24a9d9[_0x2ce0('0x42')]['id']}},_0x156d79={};_0x156d79['model']=_['keys'](db[_0x2ce0('0x2a')][_0x2ce0('0x43')]);_0x156d79[_0x2ce0('0x2f')]=_[_0x2ce0('0x30')](_0x24a9d9[_0x2ce0('0x2f')]);_0x156d79[_0x2ce0('0x31')]=_['intersection'](_0x156d79[_0x2ce0('0x2e')],_0x156d79[_0x2ce0('0x2f')]);_0x2e63b9[_0x2ce0('0x32')]=_[_0x2ce0('0x33')](_0x156d79[_0x2ce0('0x2e')],qs[_0x2ce0('0x34')](_0x24a9d9[_0x2ce0('0x2f')]['fields']));_0x2e63b9['attributes']=_0x2e63b9[_0x2ce0('0x32')][_0x2ce0('0x44')]?_0x2e63b9[_0x2ce0('0x32')]:_0x156d79[_0x2ce0('0x2e')];if(_0x24a9d9[_0x2ce0('0x2f')][_0x2ce0('0x45')]){_0x2e63b9[_0x2ce0('0x3d')]=[{'all':!![]}];}_0x2e63b9=_[_0x2ce0('0x3b')]({},_0x2e63b9,_0x24a9d9[_0x2ce0('0x3c')]);return db['Dynamics365Configuration']['find'](_0x2e63b9)['then'](handleEntityNotFound(_0x212658,null))['then'](respondWithResult(_0x212658,null))[_0x2ce0('0x40')](handleError(_0x212658,null));};exports[_0x2ce0('0x46')]=function(_0x494fd6,_0x150b18){return db[_0x2ce0('0x2a')][_0x2ce0('0x46')](_0x494fd6[_0x2ce0('0x47')],{})[_0x2ce0('0x24')](respondWithResult(_0x150b18,0xc9))['catch'](handleError(_0x150b18,null));};exports[_0x2ce0('0x23')]=function(_0x40f0f6,_0x4ee381){if(_0x40f0f6[_0x2ce0('0x47')]['id']){delete _0x40f0f6[_0x2ce0('0x47')]['id'];}return db[_0x2ce0('0x2a')]['find']({'where':{'id':_0x40f0f6[_0x2ce0('0x42')]['id']}})[_0x2ce0('0x24')](handleEntityNotFound(_0x4ee381,null))[_0x2ce0('0x24')](saveUpdates(_0x40f0f6['body'],null))[_0x2ce0('0x24')](respondWithResult(_0x4ee381,null))[_0x2ce0('0x40')](handleError(_0x4ee381,null));};exports['destroy']=function(_0x24781a,_0x3397cc){return db[_0x2ce0('0x2a')][_0x2ce0('0x48')]({'where':{'id':_0x24781a['params']['id']}})[_0x2ce0('0x24')](handleEntityNotFound(_0x3397cc,null))['then'](removeEntity(_0x3397cc,null))[_0x2ce0('0x40')](handleError(_0x3397cc,null));};exports['getFields']=function(_0x44c3f5,_0x114025,_0x2b5b3b){var _0x56407e={};var _0x42f7db={};var _0x2b6438;var _0x102533;return db[_0x2ce0('0x2a')][_0x2ce0('0x49')]({'where':{'id':_0x44c3f5[_0x2ce0('0x42')]['id']}})[_0x2ce0('0x24')](handleEntityNotFound(_0x114025,null))[_0x2ce0('0x24')](function(_0x4db181){if(_0x4db181){_0x2b6438=_0x4db181;_0x42f7db[_0x2ce0('0x2e')]=_['keys'](db['Dynamics365Field'][_0x2ce0('0x43')]);_0x42f7db['query']=_[_0x2ce0('0x30')](_0x44c3f5[_0x2ce0('0x2f')]);_0x42f7db['filters']=_['intersection'](_0x42f7db[_0x2ce0('0x2e')],_0x42f7db[_0x2ce0('0x2f')]);_0x56407e[_0x2ce0('0x32')]=_[_0x2ce0('0x33')](_0x42f7db['model'],qs[_0x2ce0('0x34')](_0x44c3f5['query'][_0x2ce0('0x34')]));_0x56407e['attributes']=_0x56407e['attributes']['length']?_0x56407e[_0x2ce0('0x32')]:_0x42f7db['model'];_0x56407e[_0x2ce0('0x36')]=qs[_0x2ce0('0x37')](_0x44c3f5['query'][_0x2ce0('0x37')]);_0x56407e[_0x2ce0('0x38')]=qs[_0x2ce0('0x31')](_[_0x2ce0('0x39')](_0x44c3f5['query'],_0x42f7db[_0x2ce0('0x31')]));if(_0x44c3f5[_0x2ce0('0x2f')][_0x2ce0('0x3a')]){_0x56407e['where']=_[_0x2ce0('0x3b')](_0x56407e[_0x2ce0('0x38')],{'$or':_[_0x2ce0('0x29')](_0x56407e['attributes'],function(_0x5a977c){var _0x103141={};_0x103141[_0x5a977c]={'$like':'%'+_0x44c3f5[_0x2ce0('0x2f')][_0x2ce0('0x3a')]+'%'};return _0x103141;})});}_0x56407e=_[_0x2ce0('0x3b')]({},_0x56407e,_0x44c3f5[_0x2ce0('0x3c')]);return _0x2b6438[_0x2ce0('0x4a')](_0x56407e);}})[_0x2ce0('0x24')](function(_0x5ccaa8){if(_0x5ccaa8){_0x102533=_0x5ccaa8['length'];if(!_0x44c3f5[_0x2ce0('0x2f')][_0x2ce0('0x4b')](_0x2ce0('0x35'))){_0x56407e[_0x2ce0('0x1b')]=qs[_0x2ce0('0x1b')](_0x44c3f5[_0x2ce0('0x2f')][_0x2ce0('0x1b')]);_0x56407e[_0x2ce0('0x1a')]=qs[_0x2ce0('0x1a')](_0x44c3f5[_0x2ce0('0x2f')][_0x2ce0('0x1a')]);}return _0x2b6438['getFields'](_0x56407e);}})['then'](function(_0x11a1f2){if(_0x11a1f2){return _0x11a1f2?{'count':_0x102533,'rows':_0x11a1f2}:null;}})[_0x2ce0('0x24')](respondWithResult(_0x114025,null))[_0x2ce0('0x40')](handleError(_0x114025,null));};exports['getSubjects']=function(_0x1dc1b5,_0x404e12,_0x26cd3f){var _0x378b11={};var _0x4bfea1={};var _0x3fb35d;var _0x129881;return db[_0x2ce0('0x2a')][_0x2ce0('0x49')]({'where':{'id':_0x1dc1b5[_0x2ce0('0x42')]['id']}})[_0x2ce0('0x24')](handleEntityNotFound(_0x404e12,null))[_0x2ce0('0x24')](function(_0x2b596a){if(_0x2b596a){_0x3fb35d=_0x2b596a;_0x4bfea1[_0x2ce0('0x2e')]=_[_0x2ce0('0x30')](db[_0x2ce0('0x4c')][_0x2ce0('0x43')]);_0x4bfea1['query']=_['keys'](_0x1dc1b5[_0x2ce0('0x2f')]);_0x4bfea1[_0x2ce0('0x31')]=_[_0x2ce0('0x33')](_0x4bfea1[_0x2ce0('0x2e')],_0x4bfea1[_0x2ce0('0x2f')]);_0x378b11['attributes']=_[_0x2ce0('0x33')](_0x4bfea1['model'],qs[_0x2ce0('0x34')](_0x1dc1b5[_0x2ce0('0x2f')][_0x2ce0('0x34')]));_0x378b11[_0x2ce0('0x32')]=_0x378b11[_0x2ce0('0x32')][_0x2ce0('0x44')]?_0x378b11[_0x2ce0('0x32')]:_0x4bfea1[_0x2ce0('0x2e')];_0x378b11[_0x2ce0('0x36')]=qs[_0x2ce0('0x37')](_0x1dc1b5[_0x2ce0('0x2f')][_0x2ce0('0x37')]);_0x378b11[_0x2ce0('0x38')]=qs['filters'](_[_0x2ce0('0x39')](_0x1dc1b5[_0x2ce0('0x2f')],_0x4bfea1[_0x2ce0('0x31')]));if(_0x1dc1b5['query'][_0x2ce0('0x3a')]){_0x378b11[_0x2ce0('0x38')]=_[_0x2ce0('0x3b')](_0x378b11[_0x2ce0('0x38')],{'$or':_[_0x2ce0('0x29')](_0x378b11[_0x2ce0('0x32')],function(_0x571ca5){var _0x2781b1={};_0x2781b1[_0x571ca5]={'$like':'%'+_0x1dc1b5[_0x2ce0('0x2f')][_0x2ce0('0x3a')]+'%'};return _0x2781b1;})});}_0x378b11=_[_0x2ce0('0x3b')]({},_0x378b11,_0x1dc1b5['options']);return _0x3fb35d[_0x2ce0('0x4d')](_0x378b11);}})[_0x2ce0('0x24')](function(_0x4bc3ad){if(_0x4bc3ad){_0x129881=_0x4bc3ad[_0x2ce0('0x44')];if(!_0x1dc1b5[_0x2ce0('0x2f')][_0x2ce0('0x4b')](_0x2ce0('0x35'))){_0x378b11[_0x2ce0('0x1b')]=qs[_0x2ce0('0x1b')](_0x1dc1b5[_0x2ce0('0x2f')][_0x2ce0('0x1b')]);_0x378b11[_0x2ce0('0x1a')]=qs['offset'](_0x1dc1b5['query'][_0x2ce0('0x1a')]);}return _0x3fb35d[_0x2ce0('0x4d')](_0x378b11);}})['then'](function(_0x9bb27a){if(_0x9bb27a){return _0x9bb27a?{'count':_0x129881,'rows':_0x9bb27a}:null;}})['then'](respondWithResult(_0x404e12,null))[_0x2ce0('0x40')](handleError(_0x404e12,null));};exports['getDescriptions']=function(_0x401a92,_0x288f1f,_0x3871a6){var _0x4af31b={};var _0x34eb6f={};var _0x4e4043;var _0x2bff1f;return db[_0x2ce0('0x2a')]['findOne']({'where':{'id':_0x401a92[_0x2ce0('0x42')]['id']}})['then'](handleEntityNotFound(_0x288f1f,null))['then'](function(_0x36b129){if(_0x36b129){_0x4e4043=_0x36b129;_0x34eb6f[_0x2ce0('0x2e')]=_[_0x2ce0('0x30')](db[_0x2ce0('0x4c')][_0x2ce0('0x43')]);_0x34eb6f[_0x2ce0('0x2f')]=_[_0x2ce0('0x30')](_0x401a92[_0x2ce0('0x2f')]);_0x34eb6f[_0x2ce0('0x31')]=_[_0x2ce0('0x33')](_0x34eb6f['model'],_0x34eb6f['query']);_0x4af31b[_0x2ce0('0x32')]=_[_0x2ce0('0x33')](_0x34eb6f[_0x2ce0('0x2e')],qs['fields'](_0x401a92[_0x2ce0('0x2f')]['fields']));_0x4af31b['attributes']=_0x4af31b[_0x2ce0('0x32')][_0x2ce0('0x44')]?_0x4af31b[_0x2ce0('0x32')]:_0x34eb6f['model'];_0x4af31b[_0x2ce0('0x36')]=qs[_0x2ce0('0x37')](_0x401a92[_0x2ce0('0x2f')][_0x2ce0('0x37')]);_0x4af31b[_0x2ce0('0x38')]=qs[_0x2ce0('0x31')](_[_0x2ce0('0x39')](_0x401a92[_0x2ce0('0x2f')],_0x34eb6f['filters']));if(_0x401a92['query'][_0x2ce0('0x3a')]){_0x4af31b[_0x2ce0('0x38')]=_[_0x2ce0('0x3b')](_0x4af31b[_0x2ce0('0x38')],{'$or':_['map'](_0x4af31b['attributes'],function(_0x148999){var _0xa4c8a3={};_0xa4c8a3[_0x148999]={'$like':'%'+_0x401a92[_0x2ce0('0x2f')][_0x2ce0('0x3a')]+'%'};return _0xa4c8a3;})});}_0x4af31b=_[_0x2ce0('0x3b')]({},_0x4af31b,_0x401a92[_0x2ce0('0x3c')]);return _0x4e4043[_0x2ce0('0x4e')](_0x4af31b);}})[_0x2ce0('0x24')](function(_0x584eb5){if(_0x584eb5){_0x2bff1f=_0x584eb5['length'];if(!_0x401a92[_0x2ce0('0x2f')][_0x2ce0('0x4b')](_0x2ce0('0x35'))){_0x4af31b[_0x2ce0('0x1b')]=qs['limit'](_0x401a92[_0x2ce0('0x2f')]['limit']);_0x4af31b[_0x2ce0('0x1a')]=qs[_0x2ce0('0x1a')](_0x401a92[_0x2ce0('0x2f')][_0x2ce0('0x1a')]);}return _0x4e4043[_0x2ce0('0x4e')](_0x4af31b);}})[_0x2ce0('0x24')](function(_0x2233c5){if(_0x2233c5){return _0x2233c5?{'count':_0x2bff1f,'rows':_0x2233c5}:null;}})['then'](respondWithResult(_0x288f1f,null))['catch'](handleError(_0x288f1f,null));};
\ No newline at end of file
index 3704f5a..192d3a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x4e46fd,_0x5993bb){var _0x4dc5cf=function(_0xb9c857){while(--_0xb9c857){_0x4e46fd['push'](_0x4e46fd['shift']());}};_0x4dc5cf(++_0x5993bb);}(_0x008c,0x188));var _0xc008=function(_0xac3027,_0x59d1d9){_0xac3027=_0xac3027-0x0;var _0x4cc775=_0x008c[_0xac3027];return _0x4cc775;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x1830a9,_0x1583bd){var _0x2b6166=function(_0x4cf0e6){while(--_0x4cf0e6){_0x1830a9['push'](_0x1830a9['shift']());}};_0x2b6166(++_0x1583bd);}(_0x3e74,0x175));var _0x43e7=function(_0xdee9af,_0xcb7ede){_0xdee9af=_0xdee9af-0x0;var _0x51740c=_0x3e74[_0xdee9af];return _0x51740c;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 606de19..4a739ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1afc=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x1afc,0x14d));var _0xc1af=function(_0x2947b2,_0x3d27e6){_0x2947b2=_0x2947b2-0x0;var _0xbf0f25=_0x1afc[_0x2947b2];return _0xbf0f25;};'use strict';var _=require('lodash');var util=require(_0xc1af('0x0'));var moment=require(_0xc1af('0x1'));var BPromise=require(_0xc1af('0x2'));var rs=require(_0xc1af('0x3'));var fs=require('fs');var Redis=require(_0xc1af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1af('0x5'));var logger=require('../../config/logger')(_0xc1af('0x6'));var config=require(_0xc1af('0x7'));var jayson=require(_0xc1af('0x8'));var client=jayson[_0xc1af('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d8d22,_0x309b3f,_0x27f1f8){return new BPromise(function(_0x67c26a,_0x188477){return client[_0xc1af('0xa')](_0x4d8d22,_0x27f1f8)[_0xc1af('0xb')](function(_0x566f90){logger[_0xc1af('0xc')](_0xc1af('0xd'),_0x309b3f,'request\x20sent');logger[_0xc1af('0xe')](_0xc1af('0xf'),_0x309b3f,'request\x20sent',JSON[_0xc1af('0x10')](_0x566f90));if(_0x566f90[_0xc1af('0x11')]){if(_0x566f90[_0xc1af('0x11')]['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x309b3f,_0x566f90[_0xc1af('0x11')]['message']);return _0x188477(_0x566f90[_0xc1af('0x11')][_0xc1af('0x12')]);}logger[_0xc1af('0x11')](_0xc1af('0xd'),_0x309b3f,_0x566f90['error'][_0xc1af('0x12')]);return _0x67c26a(_0x566f90[_0xc1af('0x11')][_0xc1af('0x12')]);}else{logger[_0xc1af('0xc')](_0xc1af('0xd'),_0x309b3f,'request\x20sent');_0x67c26a(_0x566f90[_0xc1af('0x13')][_0xc1af('0x12')]);}})[_0xc1af('0x14')](function(_0x6540d2){logger[_0xc1af('0x11')](_0xc1af('0xd'),_0x309b3f,_0x6540d2);_0x188477(_0x6540d2);});});}
\ No newline at end of file
+var _0xc6e2=['Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3757cc,_0x180882){var _0x505de2=function(_0x4af848){while(--_0x4af848){_0x3757cc['push'](_0x3757cc['shift']());}};_0x505de2(++_0x180882);}(_0xc6e2,0x153));var _0x2c6e=function(_0x2174bb,_0x287e47){_0x2174bb=_0x2174bb-0x0;var _0x1120e5=_0xc6e2[_0x2174bb];return _0x1120e5;};'use strict';var _=require(_0x2c6e('0x0'));var util=require(_0x2c6e('0x1'));var moment=require('moment');var BPromise=require(_0x2c6e('0x2'));var rs=require(_0x2c6e('0x3'));var fs=require('fs');var Redis=require(_0x2c6e('0x4'));var db=require(_0x2c6e('0x5'))['db'];var utils=require(_0x2c6e('0x6'));var logger=require(_0x2c6e('0x7'))(_0x2c6e('0x8'));var config=require(_0x2c6e('0x9'));var jayson=require(_0x2c6e('0xa'));var client=jayson[_0x2c6e('0xb')][_0x2c6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24f9c1,_0x3fdb6a,_0x27d0e7){return new BPromise(function(_0x34551d,_0x576158){return client[_0x2c6e('0xd')](_0x24f9c1,_0x27d0e7)[_0x2c6e('0xe')](function(_0x9d924){logger[_0x2c6e('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3fdb6a,_0x2c6e('0x10'));logger['debug'](_0x2c6e('0x11'),_0x3fdb6a,'request\x20sent',JSON[_0x2c6e('0x12')](_0x9d924));if(_0x9d924[_0x2c6e('0x13')]){if(_0x9d924[_0x2c6e('0x13')][_0x2c6e('0x14')]===0x1f4){logger[_0x2c6e('0x13')](_0x2c6e('0x15'),_0x3fdb6a,_0x9d924['error']['message']);return _0x576158(_0x9d924[_0x2c6e('0x13')][_0x2c6e('0x16')]);}logger[_0x2c6e('0x13')](_0x2c6e('0x15'),_0x3fdb6a,_0x9d924[_0x2c6e('0x13')][_0x2c6e('0x16')]);return _0x34551d(_0x9d924[_0x2c6e('0x13')][_0x2c6e('0x16')]);}else{logger[_0x2c6e('0xf')](_0x2c6e('0x15'),_0x3fdb6a,_0x2c6e('0x10'));_0x34551d(_0x9d924['result']['message']);}})[_0x2c6e('0x17')](function(_0x2156ca){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3fdb6a,_0x2156ca);_0x576158(_0x2156ca);});});}
\ No newline at end of file
index 331ac6d..1f160a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2623=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','create','update','destroy'];(function(_0x3e5cea,_0x8a2bd5){var _0x57c2f2=function(_0x1464e5){while(--_0x1464e5){_0x3e5cea['push'](_0x3e5cea['shift']());}};_0x57c2f2(++_0x8a2bd5);}(_0x2623,0x1b2));var _0x3262=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x2623[_0x3e21f4];return _0x40fc49;};'use strict';var multer=require('multer');var util=require(_0x3262('0x0'));var path=require(_0x3262('0x1'));var timeout=require('connect-timeout');var express=require(_0x3262('0x2'));var router=express[_0x3262('0x3')]();var fs_extra=require(_0x3262('0x4'));var auth=require(_0x3262('0x5'));var interaction=require(_0x3262('0x6'));var config=require(_0x3262('0x7'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x3262('0x8')](),controller['index']);router[_0x3262('0x9')](_0x3262('0xa'),auth[_0x3262('0x8')](),controller['show']);router['post']('/',auth[_0x3262('0x8')](),controller[_0x3262('0xb')]);router['put'](_0x3262('0xa'),auth[_0x3262('0x8')](),controller[_0x3262('0xc')]);router['delete'](_0x3262('0xa'),auth[_0x3262('0x8')](),controller[_0x3262('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x5c92=['connect-timeout','express','../../components/auth/service','get','isAuthenticated','/:id','show','post','create','update','delete','multer','util','path'];(function(_0x503998,_0x9f9ed4){var _0x50bb47=function(_0x2597a4){while(--_0x2597a4){_0x503998['push'](_0x503998['shift']());}};_0x50bb47(++_0x9f9ed4);}(_0x5c92,0x14d));var _0x25c9=function(_0x31d54b,_0x45ecb4){_0x31d54b=_0x31d54b-0x0;var _0x5ad52e=_0x5c92[_0x31d54b];return _0x5ad52e;};'use strict';var multer=require(_0x25c9('0x0'));var util=require(_0x25c9('0x1'));var path=require(_0x25c9('0x2'));var timeout=require(_0x25c9('0x3'));var express=require(_0x25c9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x25c9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x25c9('0x6')]('/',auth[_0x25c9('0x7')](),controller['index']);router[_0x25c9('0x6')](_0x25c9('0x8'),auth[_0x25c9('0x7')](),controller[_0x25c9('0x9')]);router[_0x25c9('0xa')]('/',auth[_0x25c9('0x7')](),controller[_0x25c9('0xb')]);router['put'](_0x25c9('0x8'),auth['isAuthenticated'](),controller[_0x25c9('0xc')]);router[_0x25c9('0xd')](_0x25c9('0x8'),auth[_0x25c9('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4aa6ee0..d6f3a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90e4=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dea5f,_0x29f048){var _0x464099=function(_0x2e1b34){while(--_0x2e1b34){_0x3dea5f['push'](_0x3dea5f['shift']());}};_0x464099(++_0x29f048);}(_0x90e4,0x116));var _0x490e=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x90e4[_0x53afe9];return _0x396396;};'use strict';var Sequelize=require(_0x490e('0x0'));module[_0x490e('0x1')]={'type':{'type':Sequelize[_0x490e('0x2')]('string',_0x490e('0x3'),_0x490e('0x4'),_0x490e('0x5'),_0x490e('0x6')),'defaultValue':_0x490e('0x7')},'content':{'type':Sequelize[_0x490e('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x490e('0x2')](_0x490e('0x7'),_0x490e('0x3'),_0x490e('0x4'))},'keyContent':{'type':Sequelize[_0x490e('0x8')]},'idField':{'type':Sequelize[_0x490e('0x8')]},'nameField':{'type':Sequelize[_0x490e('0x8')]},'customField':{'type':Sequelize[_0x490e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x490e('0x8')]}};
\ No newline at end of file
+var _0xe551=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x1e4687,_0x497c1a){var _0x366eb6=function(_0x59aa9d){while(--_0x59aa9d){_0x1e4687['push'](_0x1e4687['shift']());}};_0x366eb6(++_0x497c1a);}(_0xe551,0xb7));var _0x1e55=function(_0x2bf2c6,_0x4a9ab4){_0x2bf2c6=_0x2bf2c6-0x0;var _0x392a53=_0xe551[_0x2bf2c6];return _0x392a53;};'use strict';var Sequelize=require(_0x1e55('0x0'));module[_0x1e55('0x1')]={'type':{'type':Sequelize[_0x1e55('0x2')](_0x1e55('0x3'),_0x1e55('0x4'),_0x1e55('0x5'),'keyValue',_0x1e55('0x6')),'defaultValue':_0x1e55('0x3')},'content':{'type':Sequelize[_0x1e55('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1e55('0x2')](_0x1e55('0x3'),_0x1e55('0x4'),_0x1e55('0x5'))},'keyContent':{'type':Sequelize[_0x1e55('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1e55('0x7')]},'customField':{'type':Sequelize[_0x1e55('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ca5664d..f12b98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x288c=['util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','send','index','map','rawAttributes','fieldName','model','name','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x50fb7c,_0xb20f3e){var _0x2a92f8=function(_0x4e115d){while(--_0x4e115d){_0x50fb7c['push'](_0x50fb7c['shift']());}};_0x2a92f8(++_0xb20f3e);}(_0x288c,0xde));var _0xc288=function(_0x3bc022,_0x398082){_0x3bc022=_0x3bc022-0x0;var _0x4a19c6=_0x288c[_0x3bc022];return _0x4a19c6;};'use strict';var emlformat=require(_0xc288('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc288('0x1'));var rp=require(_0xc288('0x2'));var moment=require(_0xc288('0x3'));var BPromise=require(_0xc288('0x4'));var Mustache=require(_0xc288('0x5'));var util=require(_0xc288('0x6'));var path=require(_0xc288('0x7'));var sox=require(_0xc288('0x8'));var csv=require(_0xc288('0x9'));var ejs=require(_0xc288('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc288('0xb'));var crypto=require(_0xc288('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc288('0xd'));var toCsv=require(_0xc288('0x9'));var querystring=require(_0xc288('0xe'));var Papa=require(_0xc288('0xf'));var Redis=require(_0xc288('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc288('0x11'));var as=require(_0xc288('0x12'));var hardwareService=require(_0xc288('0x13'));var logger=require('../../config/logger')(_0xc288('0x14'));var utils=require(_0xc288('0x15'));var config=require(_0xc288('0x16'));var licenseUtil=require(_0xc288('0x17'));var db=require(_0xc288('0x18'))['db'];function respondWithStatusCode(_0x5db754,_0x5d3774){_0x5d3774=_0x5d3774||0xcc;return function(_0x29cb66){if(_0x29cb66){return _0x5db754[_0xc288('0x19')](_0x5d3774);}return _0x5db754[_0xc288('0x1a')](_0x5d3774)[_0xc288('0x1b')]();};}function respondWithResult(_0x3f4aeb,_0x242982){_0x242982=_0x242982||0xc8;return function(_0x3ad7fd){if(_0x3ad7fd){return _0x3f4aeb['status'](_0x242982)[_0xc288('0x1c')](_0x3ad7fd);}};}function respondWithFilteredResult(_0xd5ebf2,_0x5c94a7){return function(_0x408f63){if(_0x408f63){var _0x11ffc3=typeof _0x5c94a7['offset']==='undefined'&&typeof _0x5c94a7[_0xc288('0x1d')]===_0xc288('0x1e');var _0x19dff3=_0x408f63[_0xc288('0x1f')];var _0x1f46d5=_0x11ffc3?0x0:_0x5c94a7[_0xc288('0x20')];var _0x1b431e=_0x11ffc3?_0x408f63[_0xc288('0x1f')]:_0x5c94a7[_0xc288('0x20')]+_0x5c94a7['limit'];var _0x12dead;if(_0x1b431e>=_0x19dff3){_0x1b431e=_0x19dff3;_0x12dead=0xc8;}else{_0x12dead=0xce;}_0xd5ebf2['status'](_0x12dead);return _0xd5ebf2[_0xc288('0x21')](_0xc288('0x22'),_0x1f46d5+'-'+_0x1b431e+'/'+_0x19dff3)['json'](_0x408f63);}return null;};}function patchUpdates(_0x2ab97c){return function(_0xead450){try{jsonpatch[_0xc288('0x23')](_0xead450,_0x2ab97c,!![]);}catch(_0x536f){return BPromise[_0xc288('0x24')](_0x536f);}return _0xead450[_0xc288('0x25')]();};}function saveUpdates(_0x5a29a9,_0x3d9092){return function(_0x51bd18){if(_0x51bd18){return _0x51bd18[_0xc288('0x26')](_0x5a29a9)[_0xc288('0x27')](function(_0x173b37){return _0x173b37;});}return null;};}function removeEntity(_0x443f88,_0x34a392){return function(_0x179ae1){if(_0x179ae1){return _0x179ae1['destroy']()['then'](function(){_0x443f88[_0xc288('0x1a')](0xcc)[_0xc288('0x1b')]();});}};}function handleEntityNotFound(_0x15a48d,_0xd1aa0){return function(_0x111129){if(!_0x111129){_0x15a48d[_0xc288('0x19')](0x194);}return _0x111129;};}function handleError(_0x371825,_0x1c18f8){_0x1c18f8=_0x1c18f8||0x1f4;return function(_0x289ec5){logger[_0xc288('0x28')](_0x289ec5['stack']);if(_0x289ec5['name']){delete _0x289ec5['name'];}_0x371825[_0xc288('0x1a')](_0x1c18f8)[_0xc288('0x29')](_0x289ec5);};}exports[_0xc288('0x2a')]=function(_0x35d2b4,_0x302438){var _0x568ace={},_0xcdc72a={},_0x335a4a={'count':0x0,'rows':[]};var _0x50f07f=_[_0xc288('0x2b')](db['Dynamics365Field'][_0xc288('0x2c')],function(_0x4ec0b6){return{'name':_0x4ec0b6[_0xc288('0x2d')],'type':_0x4ec0b6['type']['key']};});_0xcdc72a[_0xc288('0x2e')]=_[_0xc288('0x2b')](_0x50f07f,_0xc288('0x2f'));_0xcdc72a['query']=_['keys'](_0x35d2b4[_0xc288('0x30')]);_0xcdc72a[_0xc288('0x31')]=_[_0xc288('0x32')](_0xcdc72a[_0xc288('0x2e')],_0xcdc72a[_0xc288('0x30')]);_0x568ace['attributes']=_[_0xc288('0x32')](_0xcdc72a['model'],qs[_0xc288('0x33')](_0x35d2b4['query']['fields']));_0x568ace[_0xc288('0x34')]=_0x568ace[_0xc288('0x34')][_0xc288('0x35')]?_0x568ace[_0xc288('0x34')]:_0xcdc72a['model'];if(!_0x35d2b4[_0xc288('0x30')]['hasOwnProperty']('nolimit')){_0x568ace[_0xc288('0x1d')]=qs[_0xc288('0x1d')](_0x35d2b4['query'][_0xc288('0x1d')]);_0x568ace[_0xc288('0x20')]=qs['offset'](_0x35d2b4[_0xc288('0x30')][_0xc288('0x20')]);}_0x568ace[_0xc288('0x36')]=qs['sort'](_0x35d2b4[_0xc288('0x30')][_0xc288('0x37')]);_0x568ace[_0xc288('0x38')]=qs[_0xc288('0x31')](_[_0xc288('0x39')](_0x35d2b4[_0xc288('0x30')],_0xcdc72a[_0xc288('0x31')]),_0x50f07f);if(_0x35d2b4[_0xc288('0x30')][_0xc288('0x3a')]){_0x568ace['where']=_[_0xc288('0x3b')](_0x568ace['where'],{'$or':_[_0xc288('0x2b')](_0x50f07f,function(_0x505e04){if(_0x505e04[_0xc288('0x3c')]!==_0xc288('0x3d')){var _0x4adc7f={};_0x4adc7f[_0x505e04[_0xc288('0x2f')]]={'$like':'%'+_0x35d2b4[_0xc288('0x30')][_0xc288('0x3a')]+'%'};return _0x4adc7f;}})});}_0x568ace=_[_0xc288('0x3b')]({},_0x568ace,_0x35d2b4[_0xc288('0x3e')]);var _0x596f9e={'where':_0x568ace[_0xc288('0x38')]};return db[_0xc288('0x3f')][_0xc288('0x1f')](_0x596f9e)[_0xc288('0x27')](function(_0x2c941e){_0x335a4a['count']=_0x2c941e;if(_0x35d2b4['query'][_0xc288('0x40')]){_0x568ace[_0xc288('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xc288('0x42')](_0x568ace);})['then'](function(_0x3232e9){_0x335a4a[_0xc288('0x43')]=_0x3232e9;return _0x335a4a;})[_0xc288('0x27')](respondWithFilteredResult(_0x302438,_0x568ace))['catch'](handleError(_0x302438,null));};exports[_0xc288('0x44')]=function(_0x1fcd36,_0x29fffe){var _0x59fad1={'raw':!![],'where':{'id':_0x1fcd36['params']['id']}},_0x144a14={};_0x144a14[_0xc288('0x2e')]=_[_0xc288('0x45')](db[_0xc288('0x3f')][_0xc288('0x2c')]);_0x144a14[_0xc288('0x30')]=_[_0xc288('0x45')](_0x1fcd36[_0xc288('0x30')]);_0x144a14['filters']=_[_0xc288('0x32')](_0x144a14[_0xc288('0x2e')],_0x144a14['query']);_0x59fad1[_0xc288('0x34')]=_[_0xc288('0x32')](_0x144a14[_0xc288('0x2e')],qs['fields'](_0x1fcd36[_0xc288('0x30')][_0xc288('0x33')]));_0x59fad1[_0xc288('0x34')]=_0x59fad1[_0xc288('0x34')][_0xc288('0x35')]?_0x59fad1['attributes']:_0x144a14[_0xc288('0x2e')];if(_0x1fcd36['query']['includeAll']){_0x59fad1['include']=[{'all':!![]}];}_0x59fad1=_[_0xc288('0x3b')]({},_0x59fad1,_0x1fcd36[_0xc288('0x3e')]);return db['Dynamics365Field'][_0xc288('0x46')](_0x59fad1)[_0xc288('0x27')](handleEntityNotFound(_0x29fffe,null))[_0xc288('0x27')](respondWithResult(_0x29fffe,null))[_0xc288('0x47')](handleError(_0x29fffe,null));};exports['create']=function(_0x2bb347,_0x15ab2f){return db['Dynamics365Field'][_0xc288('0x48')](_0x2bb347[_0xc288('0x49')],{})[_0xc288('0x27')](respondWithResult(_0x15ab2f,0xc9))['catch'](handleError(_0x15ab2f,null));};exports[_0xc288('0x26')]=function(_0xf4f51c,_0x4c238b){if(_0xf4f51c['body']['id']){delete _0xf4f51c[_0xc288('0x49')]['id'];}return db[_0xc288('0x3f')]['find']({'where':{'id':_0xf4f51c[_0xc288('0x4a')]['id']}})[_0xc288('0x27')](handleEntityNotFound(_0x4c238b,null))['then'](saveUpdates(_0xf4f51c[_0xc288('0x49')],null))[_0xc288('0x27')](respondWithResult(_0x4c238b,null))['catch'](handleError(_0x4c238b,null));};exports[_0xc288('0x4b')]=function(_0x2045b2,_0x4fc999){return db[_0xc288('0x3f')]['find']({'where':{'id':_0x2045b2[_0xc288('0x4a')]['id']}})[_0xc288('0x27')](handleEntityNotFound(_0x4fc999,null))[_0xc288('0x27')](removeEntity(_0x4fc999,null))['catch'](handleError(_0x4fc999,null));};
\ No newline at end of file
+var _0xcdf0=['merge','includeAll','findAll','catch','params','keys','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xcdf0,0x181));var _0x0cdf=function(_0x2a29da,_0xf5eb5e){_0x2a29da=_0x2a29da-0x0;var _0x2c2836=_0xcdf0[_0x2a29da];return _0x2c2836;};'use strict';var emlformat=require(_0x0cdf('0x0'));var rimraf=require(_0x0cdf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cdf('0x2'));var rp=require('request-promise');var moment=require(_0x0cdf('0x3'));var BPromise=require(_0x0cdf('0x4'));var Mustache=require(_0x0cdf('0x5'));var util=require(_0x0cdf('0x6'));var path=require(_0x0cdf('0x7'));var sox=require('sox');var csv=require(_0x0cdf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cdf('0x9'));var _=require(_0x0cdf('0xa'));var squel=require(_0x0cdf('0xb'));var crypto=require(_0x0cdf('0xc'));var jsforce=require(_0x0cdf('0xd'));var deskjs=require(_0x0cdf('0xe'));var toCsv=require(_0x0cdf('0x8'));var querystring=require(_0x0cdf('0xf'));var Papa=require(_0x0cdf('0x10'));var Redis=require(_0x0cdf('0x11'));var authService=require(_0x0cdf('0x12'));var qs=require(_0x0cdf('0x13'));var as=require(_0x0cdf('0x14'));var hardwareService=require(_0x0cdf('0x15'));var logger=require(_0x0cdf('0x16'))('api');var utils=require(_0x0cdf('0x17'));var config=require(_0x0cdf('0x18'));var licenseUtil=require(_0x0cdf('0x19'));var db=require(_0x0cdf('0x1a'))['db'];function respondWithStatusCode(_0x4b3e5f,_0x456f8c){_0x456f8c=_0x456f8c||0xcc;return function(_0x5b3952){if(_0x5b3952){return _0x4b3e5f[_0x0cdf('0x1b')](_0x456f8c);}return _0x4b3e5f[_0x0cdf('0x1c')](_0x456f8c)[_0x0cdf('0x1d')]();};}function respondWithResult(_0x30596f,_0x1249be){_0x1249be=_0x1249be||0xc8;return function(_0xf76264){if(_0xf76264){return _0x30596f[_0x0cdf('0x1c')](_0x1249be)[_0x0cdf('0x1e')](_0xf76264);}};}function respondWithFilteredResult(_0x433a28,_0x10dc7e){return function(_0x21f936){if(_0x21f936){var _0x71bd48=typeof _0x10dc7e[_0x0cdf('0x1f')]===_0x0cdf('0x20')&&typeof _0x10dc7e[_0x0cdf('0x21')]===_0x0cdf('0x20');var _0x3fb54b=_0x21f936[_0x0cdf('0x22')];var _0x35f065=_0x71bd48?0x0:_0x10dc7e[_0x0cdf('0x1f')];var _0x190613=_0x71bd48?_0x21f936[_0x0cdf('0x22')]:_0x10dc7e[_0x0cdf('0x1f')]+_0x10dc7e[_0x0cdf('0x21')];var _0x2bf74f;if(_0x190613>=_0x3fb54b){_0x190613=_0x3fb54b;_0x2bf74f=0xc8;}else{_0x2bf74f=0xce;}_0x433a28[_0x0cdf('0x1c')](_0x2bf74f);return _0x433a28[_0x0cdf('0x23')]('Content-Range',_0x35f065+'-'+_0x190613+'/'+_0x3fb54b)['json'](_0x21f936);}return null;};}function patchUpdates(_0x2ff38f){return function(_0x1f8b32){try{jsonpatch[_0x0cdf('0x24')](_0x1f8b32,_0x2ff38f,!![]);}catch(_0x1c51a7){return BPromise[_0x0cdf('0x25')](_0x1c51a7);}return _0x1f8b32[_0x0cdf('0x26')]();};}function saveUpdates(_0x303d8c,_0x5d8367){return function(_0x453c84){if(_0x453c84){return _0x453c84[_0x0cdf('0x27')](_0x303d8c)[_0x0cdf('0x28')](function(_0x2e0c59){return _0x2e0c59;});}return null;};}function removeEntity(_0x265f84,_0x2a9c20){return function(_0x31cc28){if(_0x31cc28){return _0x31cc28[_0x0cdf('0x29')]()[_0x0cdf('0x28')](function(){_0x265f84['status'](0xcc)[_0x0cdf('0x1d')]();});}};}function handleEntityNotFound(_0x52b79f,_0x3ddd6d){return function(_0x47ea5f){if(!_0x47ea5f){_0x52b79f['sendStatus'](0x194);}return _0x47ea5f;};}function handleError(_0x4ad304,_0x112004){_0x112004=_0x112004||0x1f4;return function(_0x2a60b4){logger[_0x0cdf('0x2a')](_0x2a60b4[_0x0cdf('0x2b')]);if(_0x2a60b4[_0x0cdf('0x2c')]){delete _0x2a60b4[_0x0cdf('0x2c')];}_0x4ad304[_0x0cdf('0x1c')](_0x112004)[_0x0cdf('0x2d')](_0x2a60b4);};}exports[_0x0cdf('0x2e')]=function(_0x105496,_0x28e0d5){var _0x6a5e35={},_0x349653={},_0xc15dfe={'count':0x0,'rows':[]};var _0x514d1e=_[_0x0cdf('0x2f')](db[_0x0cdf('0x30')][_0x0cdf('0x31')],function(_0x3dcb65){return{'name':_0x3dcb65[_0x0cdf('0x32')],'type':_0x3dcb65[_0x0cdf('0x33')]['key']};});_0x349653[_0x0cdf('0x34')]=_['map'](_0x514d1e,_0x0cdf('0x2c'));_0x349653[_0x0cdf('0x35')]=_['keys'](_0x105496[_0x0cdf('0x35')]);_0x349653[_0x0cdf('0x36')]=_['intersection'](_0x349653[_0x0cdf('0x34')],_0x349653['query']);_0x6a5e35[_0x0cdf('0x37')]=_[_0x0cdf('0x38')](_0x349653[_0x0cdf('0x34')],qs['fields'](_0x105496[_0x0cdf('0x35')][_0x0cdf('0x39')]));_0x6a5e35[_0x0cdf('0x37')]=_0x6a5e35[_0x0cdf('0x37')][_0x0cdf('0x3a')]?_0x6a5e35['attributes']:_0x349653[_0x0cdf('0x34')];if(!_0x105496['query'][_0x0cdf('0x3b')](_0x0cdf('0x3c'))){_0x6a5e35[_0x0cdf('0x21')]=qs[_0x0cdf('0x21')](_0x105496[_0x0cdf('0x35')][_0x0cdf('0x21')]);_0x6a5e35[_0x0cdf('0x1f')]=qs[_0x0cdf('0x1f')](_0x105496[_0x0cdf('0x35')][_0x0cdf('0x1f')]);}_0x6a5e35['order']=qs['sort'](_0x105496[_0x0cdf('0x35')][_0x0cdf('0x3d')]);_0x6a5e35['where']=qs[_0x0cdf('0x36')](_['pick'](_0x105496[_0x0cdf('0x35')],_0x349653[_0x0cdf('0x36')]),_0x514d1e);if(_0x105496[_0x0cdf('0x35')][_0x0cdf('0x3e')]){_0x6a5e35[_0x0cdf('0x3f')]=_['merge'](_0x6a5e35[_0x0cdf('0x3f')],{'$or':_[_0x0cdf('0x2f')](_0x514d1e,function(_0x80ac80){if(_0x80ac80[_0x0cdf('0x33')]!==_0x0cdf('0x40')){var _0x268116={};_0x268116[_0x80ac80[_0x0cdf('0x2c')]]={'$like':'%'+_0x105496[_0x0cdf('0x35')][_0x0cdf('0x3e')]+'%'};return _0x268116;}})});}_0x6a5e35=_[_0x0cdf('0x41')]({},_0x6a5e35,_0x105496['options']);var _0x429196={'where':_0x6a5e35['where']};return db['Dynamics365Field'][_0x0cdf('0x22')](_0x429196)[_0x0cdf('0x28')](function(_0x49cf69){_0xc15dfe['count']=_0x49cf69;if(_0x105496[_0x0cdf('0x35')][_0x0cdf('0x42')]){_0x6a5e35['include']=[{'all':!![]}];}return db[_0x0cdf('0x30')][_0x0cdf('0x43')](_0x6a5e35);})[_0x0cdf('0x28')](function(_0x28bc12){_0xc15dfe['rows']=_0x28bc12;return _0xc15dfe;})['then'](respondWithFilteredResult(_0x28e0d5,_0x6a5e35))[_0x0cdf('0x44')](handleError(_0x28e0d5,null));};exports['show']=function(_0x408116,_0x226999){var _0x37fe00={'raw':!![],'where':{'id':_0x408116[_0x0cdf('0x45')]['id']}},_0x564a74={};_0x564a74['model']=_['keys'](db['Dynamics365Field'][_0x0cdf('0x31')]);_0x564a74[_0x0cdf('0x35')]=_[_0x0cdf('0x46')](_0x408116['query']);_0x564a74[_0x0cdf('0x36')]=_['intersection'](_0x564a74['model'],_0x564a74[_0x0cdf('0x35')]);_0x37fe00[_0x0cdf('0x37')]=_[_0x0cdf('0x38')](_0x564a74['model'],qs[_0x0cdf('0x39')](_0x408116['query']['fields']));_0x37fe00[_0x0cdf('0x37')]=_0x37fe00[_0x0cdf('0x37')][_0x0cdf('0x3a')]?_0x37fe00[_0x0cdf('0x37')]:_0x564a74[_0x0cdf('0x34')];if(_0x408116['query'][_0x0cdf('0x42')]){_0x37fe00[_0x0cdf('0x47')]=[{'all':!![]}];}_0x37fe00=_[_0x0cdf('0x41')]({},_0x37fe00,_0x408116['options']);return db[_0x0cdf('0x30')][_0x0cdf('0x48')](_0x37fe00)[_0x0cdf('0x28')](handleEntityNotFound(_0x226999,null))[_0x0cdf('0x28')](respondWithResult(_0x226999,null))[_0x0cdf('0x44')](handleError(_0x226999,null));};exports[_0x0cdf('0x49')]=function(_0x33c790,_0x32f1f3){return db[_0x0cdf('0x30')][_0x0cdf('0x49')](_0x33c790[_0x0cdf('0x4a')],{})['then'](respondWithResult(_0x32f1f3,0xc9))['catch'](handleError(_0x32f1f3,null));};exports[_0x0cdf('0x27')]=function(_0xbf1e7e,_0x5b6452){if(_0xbf1e7e[_0x0cdf('0x4a')]['id']){delete _0xbf1e7e[_0x0cdf('0x4a')]['id'];}return db[_0x0cdf('0x30')][_0x0cdf('0x48')]({'where':{'id':_0xbf1e7e['params']['id']}})['then'](handleEntityNotFound(_0x5b6452,null))[_0x0cdf('0x28')](saveUpdates(_0xbf1e7e['body'],null))[_0x0cdf('0x28')](respondWithResult(_0x5b6452,null))[_0x0cdf('0x44')](handleError(_0x5b6452,null));};exports['destroy']=function(_0x418190,_0x15095e){return db[_0x0cdf('0x30')]['find']({'where':{'id':_0x418190['params']['id']}})['then'](handleEntityNotFound(_0x15095e,null))['then'](removeEntity(_0x15095e,null))[_0x0cdf('0x44')](handleError(_0x15095e,null));};
\ No newline at end of file
index 804a319..bebfef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d63=['dynamics365_unique_index','FieldId','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','Dynamics365Field','int_dynamics365_fields'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5d63,0x192));var _0x35d6=function(_0x335efc,_0xdd8bb0){_0x335efc=_0x335efc-0x0;var _0x5a54e0=_0x5d63[_0x335efc];return _0x5a54e0;};'use strict';var _=require(_0x35d6('0x0'));var util=require('util');var logger=require(_0x35d6('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x35d6('0x2'));var fs=require('fs');var path=require(_0x35d6('0x3'));var rimraf=require(_0x35d6('0x4'));var config=require(_0x35d6('0x5'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x3af40c,_0x38c8fd){return _0x3af40c['define'](_0x35d6('0x6'),attributes,{'tableName':_0x35d6('0x7'),'paranoid':![],'indexes':[{'name':_0x35d6('0x8'),'fields':['idField',_0x35d6('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x95ad=['dynamics365_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields'];(function(_0x5de1fd,_0x28895d){var _0x11ab3f=function(_0xdfa47f){while(--_0xdfa47f){_0x5de1fd['push'](_0x5de1fd['shift']());}};_0x11ab3f(++_0x28895d);}(_0x95ad,0x73));var _0xd95a=function(_0x2c9cc4,_0x4cffb7){_0x2c9cc4=_0x2c9cc4-0x0;var _0x52acaa=_0x95ad[_0x2c9cc4];return _0x52acaa;};'use strict';var _=require(_0xd95a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd95a('0x1'));var moment=require(_0xd95a('0x2'));var BPromise=require(_0xd95a('0x3'));var rp=require(_0xd95a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd95a('0x5'));var config=require(_0xd95a('0x6'));var attributes=require(_0xd95a('0x7'));module[_0xd95a('0x8')]=function(_0x13e45d,_0x4dba13){return _0x13e45d[_0xd95a('0x9')]('Dynamics365Field',attributes,{'tableName':_0xd95a('0xa'),'paranoid':![],'indexes':[{'name':_0xd95a('0xb'),'fields':[_0xd95a('0xc'),_0xd95a('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c07611f..ce6d5e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd05=['client','http','request','then','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x258339,_0x188fe0){var _0x2c8f44=function(_0x481159){while(--_0x481159){_0x258339['push'](_0x258339['shift']());}};_0x2c8f44(++_0x188fe0);}(_0xbd05,0xdc));var _0x5bd0=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0xbd05[_0x5dafd0];return _0x364354;};'use strict';var _=require(_0x5bd0('0x0'));var util=require(_0x5bd0('0x1'));var moment=require(_0x5bd0('0x2'));var BPromise=require(_0x5bd0('0x3'));var rs=require(_0x5bd0('0x4'));var fs=require('fs');var Redis=require(_0x5bd0('0x5'));var db=require(_0x5bd0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bd0('0x7'))(_0x5bd0('0x8'));var config=require(_0x5bd0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bd0('0xa')][_0x5bd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e2bbb,_0x5375ce,_0x32fd63){return new BPromise(function(_0x44534f,_0x34dafc){return client[_0x5bd0('0xc')](_0x5e2bbb,_0x32fd63)[_0x5bd0('0xd')](function(_0x157c6c){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x5375ce,_0x5bd0('0xe'));logger[_0x5bd0('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5375ce,_0x5bd0('0xe'),JSON[_0x5bd0('0x10')](_0x157c6c));if(_0x157c6c['error']){if(_0x157c6c[_0x5bd0('0x11')][_0x5bd0('0x12')]===0x1f4){logger[_0x5bd0('0x11')](_0x5bd0('0x13'),_0x5375ce,_0x157c6c[_0x5bd0('0x11')][_0x5bd0('0x14')]);return _0x34dafc(_0x157c6c[_0x5bd0('0x11')][_0x5bd0('0x14')]);}logger['error'](_0x5bd0('0x13'),_0x5375ce,_0x157c6c['error']['message']);return _0x44534f(_0x157c6c[_0x5bd0('0x11')]['message']);}else{logger['info'](_0x5bd0('0x13'),_0x5375ce,_0x5bd0('0xe'));_0x44534f(_0x157c6c[_0x5bd0('0x15')][_0x5bd0('0x14')]);}})[_0x5bd0('0x16')](function(_0xd480a1){logger[_0x5bd0('0x11')](_0x5bd0('0x13'),_0x5375ce,_0xd480a1);_0x34dafc(_0xd480a1);});});}
\ No newline at end of file
+var _0x9732=['then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x456827,_0x122dd8){var _0x422b4f=function(_0x3c61f5){while(--_0x3c61f5){_0x456827['push'](_0x456827['shift']());}};_0x422b4f(++_0x122dd8);}(_0x9732,0x185));var _0x2973=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9732[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2973('0x0'));var util=require(_0x2973('0x1'));var moment=require(_0x2973('0x2'));var BPromise=require(_0x2973('0x3'));var rs=require(_0x2973('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2973('0x5'));var logger=require('../../config/logger')(_0x2973('0x6'));var config=require('../../config/environment');var jayson=require(_0x2973('0x7'));var client=jayson[_0x2973('0x8')][_0x2973('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dfc1,_0x349106,_0x5880b3){return new BPromise(function(_0x4faea9,_0x1727b9){return client['request'](_0xc1dfc1,_0x5880b3)[_0x2973('0xa')](function(_0xcb8d87){logger['info'](_0x2973('0xb'),_0x349106,_0x2973('0xc'));logger[_0x2973('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x349106,_0x2973('0xc'),JSON[_0x2973('0xe')](_0xcb8d87));if(_0xcb8d87[_0x2973('0xf')]){if(_0xcb8d87[_0x2973('0xf')][_0x2973('0x10')]===0x1f4){logger[_0x2973('0xf')](_0x2973('0xb'),_0x349106,_0xcb8d87['error'][_0x2973('0x11')]);return _0x1727b9(_0xcb8d87[_0x2973('0xf')][_0x2973('0x11')]);}logger[_0x2973('0xf')](_0x2973('0xb'),_0x349106,_0xcb8d87[_0x2973('0xf')][_0x2973('0x11')]);return _0x4faea9(_0xcb8d87[_0x2973('0xf')][_0x2973('0x11')]);}else{logger[_0x2973('0x12')](_0x2973('0xb'),_0x349106,_0x2973('0xc'));_0x4faea9(_0xcb8d87[_0x2973('0x13')][_0x2973('0x11')]);}})[_0x2973('0x14')](function(_0x3d67d2){logger[_0x2973('0xf')](_0x2973('0xb'),_0x349106,_0x3d67d2);_0x1727b9(_0x3d67d2);});});}
\ No newline at end of file
index 80b05c3..ce7cd9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0307=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete','exports','multer','util','path'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x0307,0x1c9));var _0x7030=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x0307[_0x872b02];return _0x1a6b24;};'use strict';var multer=require(_0x7030('0x0'));var util=require(_0x7030('0x1'));var path=require(_0x7030('0x2'));var timeout=require(_0x7030('0x3'));var express=require(_0x7030('0x4'));var router=express[_0x7030('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7030('0x6'));var interaction=require(_0x7030('0x7'));var config=require(_0x7030('0x8'));var controller=require(_0x7030('0x9'));router[_0x7030('0xa')]('/',auth[_0x7030('0xb')](),controller[_0x7030('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7030('0xd')]);router[_0x7030('0xa')]('/:id/configurations',auth[_0x7030('0xb')](),controller[_0x7030('0xe')]);router[_0x7030('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7030('0xf')]);router[_0x7030('0x10')]('/',auth[_0x7030('0xb')](),controller[_0x7030('0x11')]);router['post']('/:id/configurations',auth[_0x7030('0xb')](),controller[_0x7030('0x12')]);router['put'](_0x7030('0x13'),auth[_0x7030('0xb')](),controller[_0x7030('0x14')]);router[_0x7030('0x15')](_0x7030('0x13'),auth[_0x7030('0xb')](),controller['destroy']);module[_0x7030('0x16')]=router;
\ No newline at end of file
+var _0xc69a=['./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','fs-extra','../../config/environment'];(function(_0x4f31bc,_0x595d24){var _0x453e63=function(_0x3baec6){while(--_0x3baec6){_0x4f31bc['push'](_0x4f31bc['shift']());}};_0x453e63(++_0x595d24);}(_0xc69a,0x1ea));var _0xac69=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc69a[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xac69('0x0'));var util=require('util');var path=require(_0xac69('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xac69('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac69('0x3'));var controller=require(_0xac69('0x4'));router[_0xac69('0x5')]('/',auth[_0xac69('0x6')](),controller[_0xac69('0x7')]);router[_0xac69('0x5')](_0xac69('0x8'),auth[_0xac69('0x6')](),controller[_0xac69('0x9')]);router[_0xac69('0x5')]('/:id/configurations',auth[_0xac69('0x6')](),controller[_0xac69('0xa')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xac69('0x6')](),controller[_0xac69('0xb')]);router['post'](_0xac69('0xc'),auth[_0xac69('0x6')](),controller[_0xac69('0xd')]);router[_0xac69('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xac69('0xf')]);router[_0xac69('0x10')](_0xac69('0x8'),auth[_0xac69('0x6')](),controller[_0xac69('0x11')]);module[_0xac69('0x12')]=router;
\ No newline at end of file
index d6581d0..e5cb5a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x58f8d6,_0x3de6e9){var _0x249399=function(_0x5a2d88){while(--_0x5a2d88){_0x58f8d6['push'](_0x58f8d6['shift']());}};_0x249399(++_0x3de6e9);}(_0x32b6,0x1d1));var _0x632b=function(_0x340766,_0x2f83a3){_0x340766=_0x340766-0x0;var _0x3cf66d=_0x32b6[_0x340766];return _0x3cf66d;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x3805e9,_0x33a4ed){var _0x207e20=function(_0x293840){while(--_0x293840){_0x3805e9['push'](_0x3805e9['shift']());}};_0x207e20(++_0x33a4ed);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x2cfc25,_0x536c9f){_0x2cfc25=_0x2cfc25-0x0;var _0x2663c6=_0x4e2e[_0x2cfc25];return _0x2663c6;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}};
\ No newline at end of file
index 1040f16..7310824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbfa=['Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','keys','fields','includeAll','options','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects'];(function(_0x20a1ee,_0x49438d){var _0x38a0ef=function(_0x112cd3){while(--_0x112cd3){_0x20a1ee['push'](_0x20a1ee['shift']());}};_0x38a0ef(++_0x49438d);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0xbbfa[_0x5706fb];return _0x21799d;};'use strict';var emlformat=require(_0xabbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabbf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabbf('0x2'));var moment=require(_0xabbf('0x3'));var BPromise=require(_0xabbf('0x4'));var Mustache=require(_0xabbf('0x5'));var util=require(_0xabbf('0x6'));var path=require(_0xabbf('0x7'));var sox=require(_0xabbf('0x8'));var csv=require(_0xabbf('0x9'));var ejs=require(_0xabbf('0xa'));var fs=require('fs');var fs_extra=require(_0xabbf('0xb'));var _=require(_0xabbf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabbf('0xd'));var toCsv=require(_0xabbf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabbf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xabbf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabbf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xabbf('0x11'));var config=require(_0xabbf('0x12'));var licenseUtil=require(_0xabbf('0x13'));var db=require(_0xabbf('0x14'))['db'];var integrations=require(_0xabbf('0x15'));function respondWithStatusCode(_0x1cc1a0,_0x28fb83){_0x28fb83=_0x28fb83||0xcc;return function(_0x1fa6e8){if(_0x1fa6e8){return _0x1cc1a0[_0xabbf('0x16')](_0x28fb83);}return _0x1cc1a0['status'](_0x28fb83)[_0xabbf('0x17')]();};}function respondWithResult(_0x5e6866,_0x3c6e6d){_0x3c6e6d=_0x3c6e6d||0xc8;return function(_0x59ae96){if(_0x59ae96){return _0x5e6866[_0xabbf('0x18')](_0x3c6e6d)[_0xabbf('0x19')](_0x59ae96);}};}function respondWithFilteredResult(_0x1df763,_0x13b970){return function(_0x529af0){if(_0x529af0){var _0x39cfec=typeof _0x13b970[_0xabbf('0x1a')]===_0xabbf('0x1b')&&typeof _0x13b970[_0xabbf('0x1c')]===_0xabbf('0x1b');var _0x5d1d03=_0x529af0[_0xabbf('0x1d')];var _0xfa3da6=_0x39cfec?0x0:_0x13b970['offset'];var _0x7568c0=_0x39cfec?_0x529af0[_0xabbf('0x1d')]:_0x13b970['offset']+_0x13b970[_0xabbf('0x1c')];var _0x343948;if(_0x7568c0>=_0x5d1d03){_0x7568c0=_0x5d1d03;_0x343948=0xc8;}else{_0x343948=0xce;}_0x1df763[_0xabbf('0x18')](_0x343948);return _0x1df763['set']('Content-Range',_0xfa3da6+'-'+_0x7568c0+'/'+_0x5d1d03)[_0xabbf('0x19')](_0x529af0);}return null;};}function patchUpdates(_0x4d4efb){return function(_0x2015ef){try{jsonpatch[_0xabbf('0x1e')](_0x2015ef,_0x4d4efb,!![]);}catch(_0x537bf0){return BPromise['reject'](_0x537bf0);}return _0x2015ef[_0xabbf('0x1f')]();};}function saveUpdates(_0x45cf44,_0x2eaa02){return function(_0xd2e79d){if(_0xd2e79d){return _0xd2e79d[_0xabbf('0x20')](_0x45cf44)[_0xabbf('0x21')](function(_0x17d684){return _0x17d684;});}return null;};}function removeEntity(_0x573d83,_0x281b36){return function(_0x1bb794){if(_0x1bb794){return _0x1bb794[_0xabbf('0x22')]()['then'](function(){_0x573d83[_0xabbf('0x18')](0xcc)[_0xabbf('0x17')]();});}};}function handleEntityNotFound(_0x26bd52,_0x28a5a1){return function(_0x3cdfcb){if(!_0x3cdfcb){_0x26bd52['sendStatus'](0x194);}return _0x3cdfcb;};}function handleError(_0x3a0eca,_0x4ef7cf){_0x4ef7cf=_0x4ef7cf||0x1f4;return function(_0x59d44c){logger[_0xabbf('0x23')](_0x59d44c[_0xabbf('0x24')]);if(_0x59d44c['name']){delete _0x59d44c[_0xabbf('0x25')];}_0x3a0eca[_0xabbf('0x18')](_0x4ef7cf)['send'](_0x59d44c);};}exports['index']=function(_0x53e49a,_0x58c8bc){var _0xf50e5f={},_0x1c8439={},_0x242132={'count':0x0,'rows':[]};var _0x46c314=_[_0xabbf('0x26')](db[_0xabbf('0x27')][_0xabbf('0x28')],function(_0x3d8ffc){return{'name':_0x3d8ffc[_0xabbf('0x29')],'type':_0x3d8ffc[_0xabbf('0x2a')]['key']};});_0x1c8439[_0xabbf('0x2b')]=_['map'](_0x46c314,_0xabbf('0x25'));_0x1c8439[_0xabbf('0x2c')]=_['keys'](_0x53e49a[_0xabbf('0x2c')]);_0x1c8439[_0xabbf('0x2d')]=_[_0xabbf('0x2e')](_0x1c8439[_0xabbf('0x2b')],_0x1c8439[_0xabbf('0x2c')]);_0xf50e5f[_0xabbf('0x2f')]=_[_0xabbf('0x2e')](_0x1c8439['model'],qs['fields'](_0x53e49a[_0xabbf('0x2c')]['fields']));_0xf50e5f[_0xabbf('0x2f')]=_0xf50e5f[_0xabbf('0x2f')][_0xabbf('0x30')]?_0xf50e5f[_0xabbf('0x2f')]:_0x1c8439[_0xabbf('0x2b')];if(!_0x53e49a[_0xabbf('0x2c')][_0xabbf('0x31')]('nolimit')){_0xf50e5f[_0xabbf('0x1c')]=qs[_0xabbf('0x1c')](_0x53e49a[_0xabbf('0x2c')]['limit']);_0xf50e5f[_0xabbf('0x1a')]=qs[_0xabbf('0x1a')](_0x53e49a[_0xabbf('0x2c')][_0xabbf('0x1a')]);}_0xf50e5f[_0xabbf('0x32')]=qs[_0xabbf('0x33')](_0x53e49a[_0xabbf('0x2c')][_0xabbf('0x33')]);_0xf50e5f[_0xabbf('0x34')]=qs['filters'](_[_0xabbf('0x35')](_0x53e49a[_0xabbf('0x2c')],_0x1c8439[_0xabbf('0x2d')]),_0x46c314);if(_0x53e49a[_0xabbf('0x2c')][_0xabbf('0x36')]){_0xf50e5f['where']=_[_0xabbf('0x37')](_0xf50e5f[_0xabbf('0x34')],{'$or':_[_0xabbf('0x26')](_0x46c314,function(_0x456bb5){if(_0x456bb5[_0xabbf('0x2a')]!=='VIRTUAL'){var _0x49de21={};_0x49de21[_0x456bb5[_0xabbf('0x25')]]={'$like':'%'+_0x53e49a['query'][_0xabbf('0x36')]+'%'};return _0x49de21;}})});}_0xf50e5f=_[_0xabbf('0x37')]({},_0xf50e5f,_0x53e49a['options']);var _0x5a3199={'where':_0xf50e5f[_0xabbf('0x34')]};return db[_0xabbf('0x27')]['count'](_0x5a3199)[_0xabbf('0x21')](function(_0x502748){_0x242132[_0xabbf('0x1d')]=_0x502748;if(_0x53e49a[_0xabbf('0x2c')]['includeAll']){_0xf50e5f[_0xabbf('0x38')]=[{'all':!![]}];}return db[_0xabbf('0x27')][_0xabbf('0x39')](_0xf50e5f);})[_0xabbf('0x21')](function(_0xfdd995){_0x242132[_0xabbf('0x3a')]=_0xfdd995;return _0x242132;})[_0xabbf('0x21')](respondWithFilteredResult(_0x58c8bc,_0xf50e5f))[_0xabbf('0x3b')](handleError(_0x58c8bc,null));};exports[_0xabbf('0x3c')]=function(_0x47b425,_0x477f1c){var _0x547672={'raw':![],'where':{'id':_0x47b425[_0xabbf('0x3d')]['id']}},_0x58303e={};_0x58303e[_0xabbf('0x2b')]=_[_0xabbf('0x3e')](db[_0xabbf('0x27')][_0xabbf('0x28')]);_0x58303e[_0xabbf('0x2c')]=_[_0xabbf('0x3e')](_0x47b425[_0xabbf('0x2c')]);_0x58303e[_0xabbf('0x2d')]=_[_0xabbf('0x2e')](_0x58303e[_0xabbf('0x2b')],_0x58303e[_0xabbf('0x2c')]);_0x547672[_0xabbf('0x2f')]=_['intersection'](_0x58303e[_0xabbf('0x2b')],qs[_0xabbf('0x3f')](_0x47b425['query'][_0xabbf('0x3f')]));_0x547672[_0xabbf('0x2f')]=_0x547672[_0xabbf('0x2f')][_0xabbf('0x30')]?_0x547672[_0xabbf('0x2f')]:_0x58303e[_0xabbf('0x2b')];if(_0x47b425[_0xabbf('0x2c')][_0xabbf('0x40')]){_0x547672[_0xabbf('0x38')]=[{'all':!![]}];}_0x547672=_[_0xabbf('0x37')]({},_0x547672,_0x47b425[_0xabbf('0x41')]);return db[_0xabbf('0x27')][_0xabbf('0x42')](_0x547672)[_0xabbf('0x21')](handleEntityNotFound(_0x477f1c,null))[_0xabbf('0x21')](respondWithResult(_0x477f1c,null))[_0xabbf('0x3b')](handleError(_0x477f1c,null));};exports[_0xabbf('0x43')]=function(_0x2cecb6,_0x3fc04f){return db[_0xabbf('0x27')]['create'](_0x2cecb6[_0xabbf('0x44')],{})[_0xabbf('0x21')](respondWithResult(_0x3fc04f,0xc9))[_0xabbf('0x3b')](handleError(_0x3fc04f,null));};exports[_0xabbf('0x20')]=function(_0x60d9d6,_0x55d0cb){if(_0x60d9d6[_0xabbf('0x44')]['id']){delete _0x60d9d6[_0xabbf('0x44')]['id'];}return db['FreshdeskAccount'][_0xabbf('0x42')]({'where':{'id':_0x60d9d6[_0xabbf('0x3d')]['id']}})[_0xabbf('0x21')](handleEntityNotFound(_0x55d0cb,null))[_0xabbf('0x21')](saveUpdates(_0x60d9d6[_0xabbf('0x44')],null))[_0xabbf('0x21')](respondWithResult(_0x55d0cb,null))[_0xabbf('0x3b')](handleError(_0x55d0cb,null));};exports['destroy']=function(_0x1588af,_0x41dc9d){return db['FreshdeskAccount'][_0xabbf('0x42')]({'where':{'id':_0x1588af[_0xabbf('0x3d')]['id']}})[_0xabbf('0x21')](handleEntityNotFound(_0x41dc9d,null))[_0xabbf('0x21')](removeEntity(_0x41dc9d,null))[_0xabbf('0x3b')](handleError(_0x41dc9d,null));};exports[_0xabbf('0x45')]=function(_0x1be10a,_0x2609d6,_0x370699){var _0x285f69={};var _0x4e76c3={};var _0xabfaf;var _0x4fcc5b;return db[_0xabbf('0x27')][_0xabbf('0x46')]({'where':{'id':_0x1be10a[_0xabbf('0x3d')]['id']}})[_0xabbf('0x21')](handleEntityNotFound(_0x2609d6,null))[_0xabbf('0x21')](function(_0x216972){if(_0x216972){_0xabfaf=_0x216972;_0x4e76c3[_0xabbf('0x2b')]=_[_0xabbf('0x3e')](db[_0xabbf('0x47')][_0xabbf('0x28')]);_0x4e76c3[_0xabbf('0x2c')]=_[_0xabbf('0x3e')](_0x1be10a['query']);_0x4e76c3['filters']=_['intersection'](_0x4e76c3[_0xabbf('0x2b')],_0x4e76c3[_0xabbf('0x2c')]);_0x285f69[_0xabbf('0x2f')]=_['intersection'](_0x4e76c3[_0xabbf('0x2b')],qs[_0xabbf('0x3f')](_0x1be10a[_0xabbf('0x2c')]['fields']));_0x285f69['attributes']=_0x285f69[_0xabbf('0x2f')][_0xabbf('0x30')]?_0x285f69['attributes']:_0x4e76c3[_0xabbf('0x2b')];_0x285f69[_0xabbf('0x32')]=qs[_0xabbf('0x33')](_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x33')]);_0x285f69[_0xabbf('0x34')]=qs[_0xabbf('0x2d')](_[_0xabbf('0x35')](_0x1be10a[_0xabbf('0x2c')],_0x4e76c3[_0xabbf('0x2d')]));if(_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x36')]){_0x285f69[_0xabbf('0x34')]=_[_0xabbf('0x37')](_0x285f69['where'],{'$or':_['map'](_0x285f69[_0xabbf('0x2f')],function(_0x2e1f52){var _0xa78d9d={};_0xa78d9d[_0x2e1f52]={'$like':'%'+_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x36')]+'%'};return _0xa78d9d;})});}_0x285f69=_[_0xabbf('0x37')]({},_0x285f69,_0x1be10a[_0xabbf('0x41')]);return _0xabfaf[_0xabbf('0x45')](_0x285f69);}})[_0xabbf('0x21')](function(_0x1ea9be){if(_0x1ea9be){_0x4fcc5b=_0x1ea9be[_0xabbf('0x30')];if(!_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x31')]('nolimit')){_0x285f69[_0xabbf('0x1c')]=qs[_0xabbf('0x1c')](_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x1c')]);_0x285f69['offset']=qs[_0xabbf('0x1a')](_0x1be10a[_0xabbf('0x2c')][_0xabbf('0x1a')]);}return _0xabfaf[_0xabbf('0x45')](_0x285f69);}})[_0xabbf('0x21')](function(_0x34fbee){if(_0x34fbee){return _0x34fbee?{'count':_0x4fcc5b,'rows':_0x34fbee}:null;}})[_0xabbf('0x21')](respondWithResult(_0x2609d6,null))['catch'](handleError(_0x2609d6,null));};exports[_0xabbf('0x48')]=function(_0x5726e6,_0x13b813,_0x550e9b){if(_0x5726e6[_0xabbf('0x44')]['id']){delete _0x5726e6[_0xabbf('0x44')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x5726e6['params']['id']}})[_0xabbf('0x21')](handleEntityNotFound(_0x13b813,null))[_0xabbf('0x21')](function(_0x714e8c){if(_0x714e8c){_0x5726e6[_0xabbf('0x44')][_0xabbf('0x49')]=_0x714e8c['id'];_0x5726e6[_0xabbf('0x44')][_0xabbf('0x4a')]=integrations[_0xabbf('0x4b')](_0x5726e6[_0xabbf('0x44')]['channel'],_0x5726e6['body'][_0xabbf('0x2a')]);_0x5726e6[_0xabbf('0x44')][_0xabbf('0x4c')]=integrations[_0xabbf('0x4d')](_0x5726e6['body'][_0xabbf('0x4e')],_0x5726e6[_0xabbf('0x44')]['type']);return db['FreshdeskConfiguration'][_0xabbf('0x43')](_0x5726e6['body'],{'include':[{'model':db[_0xabbf('0x4f')],'as':_0xabbf('0x4a')},{'model':db[_0xabbf('0x4f')],'as':_0xabbf('0x4c')}]});}return null;})[_0xabbf('0x21')](respondWithResult(_0x13b813,null))[_0xabbf('0x3b')](handleError(_0x13b813,null));};exports[_0xabbf('0x50')]=function(_0x1bc07f,_0x167146,_0x2cdd1b){var _0x4d570d='';return db[_0xabbf('0x27')][_0xabbf('0x46')]({'where':{'id':_0x1bc07f[_0xabbf('0x3d')]['id']},'attributes':['id',_0xabbf('0x51'),_0xabbf('0x52')]})[_0xabbf('0x21')](handleEntityNotFound(_0x167146,null))[_0xabbf('0x21')](function(_0x1c2635){if(_0x1c2635){_0x4d570d=_0x1c2635[_0xabbf('0x51')];var _0x86a4d=_0x4d570d[_0xabbf('0x53')](-0x1);if(_0x86a4d==='/'){_0x4d570d=_0x4d570d[_0xabbf('0x54')](0x0,_0x4d570d[_0xabbf('0x55')](_0x86a4d));}return rp({'method':'GET','uri':util[_0xabbf('0x56')](_0xabbf('0x57'),_0x4d570d,_0xabbf('0x58')),'headers':{'Authorization':util[_0xabbf('0x56')](_0xabbf('0x59'),new Buffer(util[_0xabbf('0x56')](_0xabbf('0x5a'),_0x1c2635[_0xabbf('0x52')]))[_0xabbf('0x5b')](_0xabbf('0x5c')))},'json':!![]});}})[_0xabbf('0x21')](function(_0x5de1f4){if(_0x5de1f4){var _0x37c9ed=[_0xabbf('0x5d'),_0xabbf('0x5e'),_0xabbf('0x5f'),'description',_0xabbf('0x18'),'priority',_0xabbf('0x60'),_0xabbf('0x61'),_0xabbf('0x62'),_0xabbf('0x60'),_0xabbf('0x63')];_['remove'](_0x5de1f4,function(_0x1ad17a){return _0x37c9ed[_0xabbf('0x64')](_0x1ad17a[_0xabbf('0x25')])||!_0x1ad17a[_0xabbf('0x65')]&&_0x1ad17a['type']!==_0xabbf('0x66')&&_0x1ad17a[_0xabbf('0x2a')]!==_0xabbf('0x67');});return{'count':_0x5de1f4[_0xabbf('0x30')],'rows':_[_0xabbf('0x26')](_0x5de1f4,function(_0x267aa4){return{'id':_0x267aa4[_0xabbf('0x25')],'name':_0x267aa4[_0xabbf('0x68')],'custom':!_0x267aa4[_0xabbf('0x65')],'options':_0x267aa4[_0xabbf('0x69')]?_['map'](_0x267aa4[_0xabbf('0x69')],function(_0x32eb2a){return{'name':_[_0xabbf('0x6a')](_0x32eb2a),'value':_0x32eb2a};}):[]};})};}})[_0xabbf('0x21')](respondWithResult(_0x167146,null))['catch'](function(_0x306b5a){var _0x54aacf=_0x1bc07f['query'][_0xabbf('0x6b')]?0x1f4:_0x306b5a[_0xabbf('0x6c')]||0x1f4;logger[_0xabbf('0x23')](_0xabbf('0x6d'),'getFields',_0x54aacf,JSON[_0xabbf('0x6e')](_0x306b5a));delete _0x306b5a[_0xabbf('0x25')];if(_0x54aacf===0x191){_0x54aacf=0x190;}_0x167146[_0xabbf('0x18')](_0x54aacf)[_0xabbf('0x6f')](_0x1bc07f[_0xabbf('0x2c')]['test']?{'message':_0xabbf('0x70'),'statusCode':_0x306b5a[_0xabbf('0x6c')]}:_0x306b5a);});};
\ No newline at end of file
+var _0x7fce=['path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','getSubjects','getDescriptions','FreshdeskField','Descriptions','remoteUri','apiKey','slice','substring','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','custom_text','custom_dropdown','default','choices','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util'];(function(_0x48b0c9,_0x3cb775){var _0x3df2f5=function(_0x30dda5){while(--_0x30dda5){_0x48b0c9['push'](_0x48b0c9['shift']());}};_0x3df2f5(++_0x3cb775);}(_0x7fce,0xdc));var _0xe7fc=function(_0x2fb1a3,_0x3bb42a){_0x2fb1a3=_0x2fb1a3-0x0;var _0x273274=_0x7fce[_0x2fb1a3];return _0x273274;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xe7fc('0x15'));function respondWithStatusCode(_0x59da2e,_0x38512a){_0x38512a=_0x38512a||0xcc;return function(_0x4e32e9){if(_0x4e32e9){return _0x59da2e['sendStatus'](_0x38512a);}return _0x59da2e[_0xe7fc('0x16')](_0x38512a)[_0xe7fc('0x17')]();};}function respondWithResult(_0x235692,_0x307f58){_0x307f58=_0x307f58||0xc8;return function(_0x293cf4){if(_0x293cf4){return _0x235692['status'](_0x307f58)[_0xe7fc('0x18')](_0x293cf4);}};}function respondWithFilteredResult(_0x5ce83f,_0x4da73b){return function(_0x1302e5){if(_0x1302e5){var _0x249725=typeof _0x4da73b[_0xe7fc('0x19')]===_0xe7fc('0x1a')&&typeof _0x4da73b['limit']==='undefined';var _0x4e549a=_0x1302e5['count'];var _0x52902f=_0x249725?0x0:_0x4da73b['offset'];var _0x14515d=_0x249725?_0x1302e5['count']:_0x4da73b[_0xe7fc('0x19')]+_0x4da73b[_0xe7fc('0x1b')];var _0x10230c;if(_0x14515d>=_0x4e549a){_0x14515d=_0x4e549a;_0x10230c=0xc8;}else{_0x10230c=0xce;}_0x5ce83f[_0xe7fc('0x16')](_0x10230c);return _0x5ce83f[_0xe7fc('0x1c')](_0xe7fc('0x1d'),_0x52902f+'-'+_0x14515d+'/'+_0x4e549a)[_0xe7fc('0x18')](_0x1302e5);}return null;};}function patchUpdates(_0x763103){return function(_0x597fde){try{jsonpatch[_0xe7fc('0x1e')](_0x597fde,_0x763103,!![]);}catch(_0x2eb35a){return BPromise['reject'](_0x2eb35a);}return _0x597fde['save']();};}function saveUpdates(_0x35bb53,_0x3c31e7){return function(_0x338613){if(_0x338613){return _0x338613[_0xe7fc('0x1f')](_0x35bb53)[_0xe7fc('0x20')](function(_0x11c5a3){return _0x11c5a3;});}return null;};}function removeEntity(_0x3f850f,_0x1731b6){return function(_0xb00cb9){if(_0xb00cb9){return _0xb00cb9[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x3f850f[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x17')]();});}};}function handleEntityNotFound(_0x5255b7,_0x2d9e77){return function(_0x158d6e){if(!_0x158d6e){_0x5255b7[_0xe7fc('0x22')](0x194);}return _0x158d6e;};}function handleError(_0x3be1fd,_0x2249ed){_0x2249ed=_0x2249ed||0x1f4;return function(_0x474592){logger['error'](_0x474592[_0xe7fc('0x23')]);if(_0x474592[_0xe7fc('0x24')]){delete _0x474592[_0xe7fc('0x24')];}_0x3be1fd[_0xe7fc('0x16')](_0x2249ed)[_0xe7fc('0x25')](_0x474592);};}exports[_0xe7fc('0x26')]=function(_0x383ca6,_0x4da084){var _0x36a68b={},_0x2a08a4={},_0x512518={'count':0x0,'rows':[]};var _0x37ab14=_['map'](db[_0xe7fc('0x27')][_0xe7fc('0x28')],function(_0x547219){return{'name':_0x547219[_0xe7fc('0x29')],'type':_0x547219['type'][_0xe7fc('0x2a')]};});_0x2a08a4[_0xe7fc('0x2b')]=_[_0xe7fc('0x2c')](_0x37ab14,'name');_0x2a08a4[_0xe7fc('0x2d')]=_['keys'](_0x383ca6[_0xe7fc('0x2d')]);_0x2a08a4[_0xe7fc('0x2e')]=_['intersection'](_0x2a08a4['model'],_0x2a08a4['query']);_0x36a68b['attributes']=_[_0xe7fc('0x2f')](_0x2a08a4[_0xe7fc('0x2b')],qs[_0xe7fc('0x30')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x36a68b[_0xe7fc('0x31')]=_0x36a68b[_0xe7fc('0x31')][_0xe7fc('0x32')]?_0x36a68b[_0xe7fc('0x31')]:_0x2a08a4[_0xe7fc('0x2b')];if(!_0x383ca6['query'][_0xe7fc('0x33')](_0xe7fc('0x34'))){_0x36a68b[_0xe7fc('0x1b')]=qs[_0xe7fc('0x1b')](_0x383ca6[_0xe7fc('0x2d')]['limit']);_0x36a68b[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x19')]);}_0x36a68b[_0xe7fc('0x35')]=qs[_0xe7fc('0x36')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x36')]);_0x36a68b[_0xe7fc('0x37')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x38')](_0x383ca6[_0xe7fc('0x2d')],_0x2a08a4['filters']),_0x37ab14);if(_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x39')]){_0x36a68b[_0xe7fc('0x37')]=_[_0xe7fc('0x3a')](_0x36a68b[_0xe7fc('0x37')],{'$or':_['map'](_0x37ab14,function(_0x23f53c){if(_0x23f53c[_0xe7fc('0x3b')]!==_0xe7fc('0x3c')){var _0x10d476={};_0x10d476[_0x23f53c[_0xe7fc('0x24')]]={'$like':'%'+_0x383ca6[_0xe7fc('0x2d')]['filter']+'%'};return _0x10d476;}})});}_0x36a68b=_['merge']({},_0x36a68b,_0x383ca6['options']);var _0x530e08={'where':_0x36a68b['where']};return db[_0xe7fc('0x27')][_0xe7fc('0x3d')](_0x530e08)['then'](function(_0x1bcf1a){_0x512518['count']=_0x1bcf1a;if(_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x3e')]){_0x36a68b[_0xe7fc('0x3f')]=[{'all':!![]}];}return db[_0xe7fc('0x27')][_0xe7fc('0x40')](_0x36a68b);})[_0xe7fc('0x20')](function(_0x48e123){_0x512518[_0xe7fc('0x41')]=_0x48e123;return _0x512518;})['then'](respondWithFilteredResult(_0x4da084,_0x36a68b))[_0xe7fc('0x42')](handleError(_0x4da084,null));};exports[_0xe7fc('0x43')]=function(_0x533f26,_0x636368){var _0x3ce7ad={'raw':![],'where':{'id':_0x533f26[_0xe7fc('0x44')]['id']}},_0x44c825={};_0x44c825[_0xe7fc('0x2b')]=_[_0xe7fc('0x45')](db[_0xe7fc('0x27')][_0xe7fc('0x28')]);_0x44c825[_0xe7fc('0x2d')]=_[_0xe7fc('0x45')](_0x533f26[_0xe7fc('0x2d')]);_0x44c825[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x44c825[_0xe7fc('0x2b')],_0x44c825[_0xe7fc('0x2d')]);_0x3ce7ad[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x44c825['model'],qs[_0xe7fc('0x30')](_0x533f26[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x3ce7ad['attributes']=_0x3ce7ad[_0xe7fc('0x31')][_0xe7fc('0x32')]?_0x3ce7ad[_0xe7fc('0x31')]:_0x44c825[_0xe7fc('0x2b')];if(_0x533f26[_0xe7fc('0x2d')]['includeAll']){_0x3ce7ad['include']=[{'all':!![]}];}_0x3ce7ad=_[_0xe7fc('0x3a')]({},_0x3ce7ad,_0x533f26[_0xe7fc('0x46')]);return db[_0xe7fc('0x27')][_0xe7fc('0x47')](_0x3ce7ad)[_0xe7fc('0x20')](handleEntityNotFound(_0x636368,null))['then'](respondWithResult(_0x636368,null))[_0xe7fc('0x42')](handleError(_0x636368,null));};exports[_0xe7fc('0x48')]=function(_0x2807ff,_0x1ae0e4){return db[_0xe7fc('0x27')][_0xe7fc('0x48')](_0x2807ff[_0xe7fc('0x49')],{})[_0xe7fc('0x20')](respondWithResult(_0x1ae0e4,0xc9))[_0xe7fc('0x42')](handleError(_0x1ae0e4,null));};exports[_0xe7fc('0x1f')]=function(_0x533f31,_0x3e61c3){if(_0x533f31['body']['id']){delete _0x533f31[_0xe7fc('0x49')]['id'];}return db[_0xe7fc('0x27')][_0xe7fc('0x47')]({'where':{'id':_0x533f31[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3e61c3,null))[_0xe7fc('0x20')](saveUpdates(_0x533f31[_0xe7fc('0x49')],null))[_0xe7fc('0x20')](respondWithResult(_0x3e61c3,null))[_0xe7fc('0x42')](handleError(_0x3e61c3,null));};exports['destroy']=function(_0x63a8bf,_0xf553c1){return db[_0xe7fc('0x27')][_0xe7fc('0x47')]({'where':{'id':_0x63a8bf[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0xf553c1,null))['then'](removeEntity(_0xf553c1,null))[_0xe7fc('0x42')](handleError(_0xf553c1,null));};exports[_0xe7fc('0x4a')]=function(_0x29af8c,_0x3ffdd1,_0x2f3a91){var _0x2469c8={};var _0x47db6e={};var _0x588619;var _0x3d5f19;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x29af8c[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3ffdd1,null))[_0xe7fc('0x20')](function(_0x2cf52f){if(_0x2cf52f){_0x588619=_0x2cf52f;_0x47db6e[_0xe7fc('0x2b')]=_[_0xe7fc('0x45')](db[_0xe7fc('0x4b')][_0xe7fc('0x28')]);_0x47db6e[_0xe7fc('0x2d')]=_[_0xe7fc('0x45')](_0x29af8c[_0xe7fc('0x2d')]);_0x47db6e['filters']=_[_0xe7fc('0x2f')](_0x47db6e['model'],_0x47db6e[_0xe7fc('0x2d')]);_0x2469c8[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x47db6e[_0xe7fc('0x2b')],qs[_0xe7fc('0x30')](_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x2469c8[_0xe7fc('0x31')]=_0x2469c8['attributes'][_0xe7fc('0x32')]?_0x2469c8[_0xe7fc('0x31')]:_0x47db6e['model'];_0x2469c8[_0xe7fc('0x35')]=qs[_0xe7fc('0x36')](_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x36')]);_0x2469c8[_0xe7fc('0x37')]=qs['filters'](_[_0xe7fc('0x38')](_0x29af8c[_0xe7fc('0x2d')],_0x47db6e[_0xe7fc('0x2e')]));if(_0x29af8c[_0xe7fc('0x2d')]['filter']){_0x2469c8[_0xe7fc('0x37')]=_[_0xe7fc('0x3a')](_0x2469c8[_0xe7fc('0x37')],{'$or':_['map'](_0x2469c8['attributes'],function(_0x323c66){var _0x40bd01={};_0x40bd01[_0x323c66]={'$like':'%'+_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x39')]+'%'};return _0x40bd01;})});}_0x2469c8=_[_0xe7fc('0x3a')]({},_0x2469c8,_0x29af8c[_0xe7fc('0x46')]);return _0x588619['getConfigurations'](_0x2469c8);}})[_0xe7fc('0x20')](function(_0x4d9a11){if(_0x4d9a11){_0x3d5f19=_0x4d9a11[_0xe7fc('0x32')];if(!_0x29af8c[_0xe7fc('0x2d')]['hasOwnProperty'](_0xe7fc('0x34'))){_0x2469c8['limit']=qs['limit'](_0x29af8c['query'][_0xe7fc('0x1b')]);_0x2469c8[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x29af8c['query']['offset']);}return _0x588619['getConfigurations'](_0x2469c8);}})['then'](function(_0x3ea15b){if(_0x3ea15b){return _0x3ea15b?{'count':_0x3d5f19,'rows':_0x3ea15b}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x3ffdd1,null))[_0xe7fc('0x42')](handleError(_0x3ffdd1,null));};exports[_0xe7fc('0x4c')]=function(_0x149f53,_0x187f2f,_0x13a1c4){if(_0x149f53[_0xe7fc('0x49')]['id']){delete _0x149f53[_0xe7fc('0x49')]['id'];}return db['FreshdeskAccount'][_0xe7fc('0x4d')]({'where':{'id':_0x149f53['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x187f2f,null))[_0xe7fc('0x20')](function(_0x30c2e1){if(_0x30c2e1){_0x149f53['body'][_0xe7fc('0x4e')]=_0x30c2e1['id'];_0x149f53[_0xe7fc('0x49')]['Subjects']=integrations[_0xe7fc('0x4f')](_0x149f53[_0xe7fc('0x49')]['channel'],_0x149f53[_0xe7fc('0x49')][_0xe7fc('0x3b')]);_0x149f53[_0xe7fc('0x49')]['Descriptions']=integrations[_0xe7fc('0x50')](_0x149f53['body']['channel'],_0x149f53[_0xe7fc('0x49')][_0xe7fc('0x3b')]);return db[_0xe7fc('0x4b')][_0xe7fc('0x48')](_0x149f53[_0xe7fc('0x49')],{'include':[{'model':db[_0xe7fc('0x51')],'as':'Subjects'},{'model':db[_0xe7fc('0x51')],'as':_0xe7fc('0x52')}]});}return null;})[_0xe7fc('0x20')](respondWithResult(_0x187f2f,null))[_0xe7fc('0x42')](handleError(_0x187f2f,null));};exports['getFields']=function(_0x1b9dff,_0x21d85d,_0xbe9ac8){var _0x5ede3a='';return db[_0xe7fc('0x27')][_0xe7fc('0x4d')]({'where':{'id':_0x1b9dff['params']['id']},'attributes':['id',_0xe7fc('0x53'),_0xe7fc('0x54')]})[_0xe7fc('0x20')](handleEntityNotFound(_0x21d85d,null))[_0xe7fc('0x20')](function(_0xa75e96){if(_0xa75e96){_0x5ede3a=_0xa75e96[_0xe7fc('0x53')];var _0x33baac=_0x5ede3a[_0xe7fc('0x55')](-0x1);if(_0x33baac==='/'){_0x5ede3a=_0x5ede3a[_0xe7fc('0x56')](0x0,_0x5ede3a['lastIndexOf'](_0x33baac));}return rp({'method':'GET','uri':util['format'](_0xe7fc('0x57'),_0x5ede3a,_0xe7fc('0x58')),'headers':{'Authorization':util['format'](_0xe7fc('0x59'),new Buffer(util['format'](_0xe7fc('0x5a'),_0xa75e96['apiKey']))[_0xe7fc('0x5b')](_0xe7fc('0x5c')))},'json':!![]});}})[_0xe7fc('0x20')](function(_0x13cf1d){if(_0x13cf1d){var _0x15b4dc=[_0xe7fc('0x5d'),_0xe7fc('0x5e'),_0xe7fc('0x5f'),_0xe7fc('0x60'),_0xe7fc('0x16'),_0xe7fc('0x61'),'group',_0xe7fc('0x62'),_0xe7fc('0x63'),_0xe7fc('0x64'),_0xe7fc('0x65')];_['remove'](_0x13cf1d,function(_0xb548e9){return _0x15b4dc[_0xe7fc('0x66')](_0xb548e9[_0xe7fc('0x24')])||!_0xb548e9['default']&&_0xb548e9[_0xe7fc('0x3b')]!==_0xe7fc('0x67')&&_0xb548e9[_0xe7fc('0x3b')]!==_0xe7fc('0x68');});return{'count':_0x13cf1d[_0xe7fc('0x32')],'rows':_[_0xe7fc('0x2c')](_0x13cf1d,function(_0x469166){return{'id':_0x469166[_0xe7fc('0x24')],'name':_0x469166['label'],'custom':!_0x469166[_0xe7fc('0x69')],'options':_0x469166['choices']?_[_0xe7fc('0x2c')](_0x469166[_0xe7fc('0x6a')],function(_0x11973e){return{'name':_['capitalize'](_0x11973e),'value':_0x11973e};}):[]};})};}})[_0xe7fc('0x20')](respondWithResult(_0x21d85d,null))[_0xe7fc('0x42')](function(_0x31431c){var _0x5e06d3=_0x1b9dff[_0xe7fc('0x2d')]['test']?0x1f4:_0x31431c[_0xe7fc('0x6b')]||0x1f4;logger[_0xe7fc('0x6c')](_0xe7fc('0x6d'),_0xe7fc('0x6e'),_0x5e06d3,JSON[_0xe7fc('0x6f')](_0x31431c));delete _0x31431c['name'];if(_0x5e06d3===0x191){_0x5e06d3=0x190;}_0x21d85d[_0xe7fc('0x16')](_0x5e06d3)[_0xe7fc('0x25')](_0x1b9dff[_0xe7fc('0x2d')]['test']?{'message':_0xe7fc('0x70'),'statusCode':_0x31431c['statusCode']}:_0x31431c);});};
\ No newline at end of file
index d37b943..44b0ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x492a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash'];(function(_0x9b0bcf,_0x59ba33){var _0x2fe068=function(_0xb6545e){while(--_0xb6545e){_0x9b0bcf['push'](_0x9b0bcf['shift']());}};_0x2fe068(++_0x59ba33);}(_0x492a,0x8e));var _0xa492=function(_0x125106,_0x1a5f5d){_0x125106=_0x125106-0x0;var _0xc1ffd5=_0x492a[_0x125106];return _0xc1ffd5;};'use strict';var _=require(_0xa492('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa492('0x1'));var moment=require(_0xa492('0x2'));var BPromise=require(_0xa492('0x3'));var rp=require(_0xa492('0x4'));var fs=require('fs');var path=require(_0xa492('0x5'));var rimraf=require(_0xa492('0x6'));var config=require(_0xa492('0x7'));var attributes=require(_0xa492('0x8'));var integrations=require(_0xa492('0x9'));module[_0xa492('0xa')]=function(_0x17e423,_0xd945bc){return _0x17e423[_0xa492('0xb')](_0xa492('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c5a=['api','moment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x2f202e,_0x5ed293){var _0x398ac6=function(_0x49bda9){while(--_0x49bda9){_0x2f202e['push'](_0x2f202e['shift']());}};_0x398ac6(++_0x5ed293);}(_0x3c5a,0x16f));var _0xa3c5=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x3c5a[_0x5c18ef];return _0x33789d;};'use strict';var _=require(_0xa3c5('0x0'));var util=require(_0xa3c5('0x1'));var logger=require('../../config/logger')(_0xa3c5('0x2'));var moment=require(_0xa3c5('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('../../config/environment');var attributes=require(_0xa3c5('0x4'));var integrations=require(_0xa3c5('0x5'));module['exports']=function(_0x51ad46,_0x37b636){return _0x51ad46[_0xa3c5('0x6')](_0xa3c5('0x7'),attributes,{'tableName':_0xa3c5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91af08b..67770ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ab=['attributes','include','map','model','ShowFreshdeskAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where'];(function(_0x5ca163,_0x32d2d0){var _0x4d1b57=function(_0x46e62d){while(--_0x46e62d){_0x5ca163['push'](_0x5ca163['shift']());}};_0x4d1b57(++_0x32d2d0);}(_0x59ab,0x6f));var _0xb59a=function(_0x5f22a1,_0x54f605){_0x5f22a1=_0x5f22a1-0x0;var _0x52bee2=_0x59ab[_0x5f22a1];return _0x52bee2;};'use strict';var _=require(_0xb59a('0x0'));var util=require('util');var moment=require(_0xb59a('0x1'));var BPromise=require('bluebird');var rs=require(_0xb59a('0x2'));var fs=require('fs');var Redis=require(_0xb59a('0x3'));var db=require(_0xb59a('0x4'))['db'];var utils=require(_0xb59a('0x5'));var logger=require(_0xb59a('0x6'))('rpc');var config=require(_0xb59a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb59a('0x8')][_0xb59a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40591e,_0x5afc10,_0x94721f){return new BPromise(function(_0x3ecad7,_0x43635e){return client[_0xb59a('0xa')](_0x40591e,_0x94721f)[_0xb59a('0xb')](function(_0x1f128c){logger[_0xb59a('0xc')](_0xb59a('0xd'),_0x5afc10,_0xb59a('0xe'));logger[_0xb59a('0xf')](_0xb59a('0x10'),_0x5afc10,_0xb59a('0xe'),JSON[_0xb59a('0x11')](_0x1f128c));if(_0x1f128c[_0xb59a('0x12')]){if(_0x1f128c['error'][_0xb59a('0x13')]===0x1f4){logger[_0xb59a('0x12')](_0xb59a('0xd'),_0x5afc10,_0x1f128c[_0xb59a('0x12')][_0xb59a('0x14')]);return _0x43635e(_0x1f128c[_0xb59a('0x12')][_0xb59a('0x14')]);}logger['error'](_0xb59a('0xd'),_0x5afc10,_0x1f128c[_0xb59a('0x12')]['message']);return _0x3ecad7(_0x1f128c[_0xb59a('0x12')]['message']);}else{logger[_0xb59a('0xc')](_0xb59a('0xd'),_0x5afc10,_0xb59a('0xe'));_0x3ecad7(_0x1f128c[_0xb59a('0x15')][_0xb59a('0x14')]);}})[_0xb59a('0x16')](function(_0x2984de){logger[_0xb59a('0x12')](_0xb59a('0xd'),_0x5afc10,_0x2984de);_0x43635e(_0x2984de);});});}exports[_0xb59a('0x17')]=function(_0x5eedf4){var _0x284c30=this;return new Promise(function(_0xd83376,_0x257760){return db[_0xb59a('0x18')][_0xb59a('0x19')]({'raw':_0x5eedf4[_0xb59a('0x1a')]?_0x5eedf4[_0xb59a('0x1a')][_0xb59a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5eedf4['options']?_0x5eedf4[_0xb59a('0x1a')][_0xb59a('0x1c')]||null:null,'attributes':_0x5eedf4[_0xb59a('0x1a')]?_0x5eedf4[_0xb59a('0x1a')][_0xb59a('0x1d')]||null:null,'limit':_0x5eedf4['options']?_0x5eedf4[_0xb59a('0x1a')]['limit']||null:null,'include':_0x5eedf4[_0xb59a('0x1a')]?_0x5eedf4[_0xb59a('0x1a')][_0xb59a('0x1e')]?_[_0xb59a('0x1f')](_0x5eedf4[_0xb59a('0x1a')][_0xb59a('0x1e')],function(_0x3fb452){return{'model':db[_0x3fb452[_0xb59a('0x20')]],'as':_0x3fb452['as'],'attributes':_0x3fb452[_0xb59a('0x1d')],'include':_0x3fb452[_0xb59a('0x1e')]?_[_0xb59a('0x1f')](_0x3fb452[_0xb59a('0x1e')],function(_0x2cd8d3){return{'model':db[_0x2cd8d3['model']],'as':_0x2cd8d3['as'],'attributes':_0x2cd8d3['attributes'],'include':_0x2cd8d3[_0xb59a('0x1e')]?_[_0xb59a('0x1f')](_0x2cd8d3[_0xb59a('0x1e')],function(_0x3ee71e){return{'model':db[_0x3ee71e[_0xb59a('0x20')]],'as':_0x3ee71e['as'],'attributes':_0x3ee71e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb59a('0xb')](function(_0x3e08ec){logger['info'](_0xb59a('0x17'),_0x5eedf4);logger[_0xb59a('0xf')](_0xb59a('0x17'),_0x5eedf4,JSON[_0xb59a('0x11')](_0x3e08ec));_0xd83376(_0x3e08ec);})[_0xb59a('0x16')](function(_0x21ea23){logger[_0xb59a('0x12')](_0xb59a('0x17'),_0x21ea23['message'],_0x5eedf4);_0x257760(_0x284c30[_0xb59a('0x12')](0x1f4,_0x21ea23['message']));});});};exports[_0xb59a('0x21')]=function(_0x13f702){var _0x281f0a=this;return new Promise(function(_0x4548b9,_0x4f1c12){return db[_0xb59a('0x18')][_0xb59a('0x22')]({'raw':_0x13f702[_0xb59a('0x1a')]?_0x13f702[_0xb59a('0x1a')][_0xb59a('0x1b')]===undefined?!![]:![]:!![],'where':_0x13f702[_0xb59a('0x1a')]?_0x13f702['options']['where']||null:null,'attributes':_0x13f702[_0xb59a('0x1a')]?_0x13f702['options'][_0xb59a('0x1d')]||null:null,'include':_0x13f702[_0xb59a('0x1a')]?_0x13f702['options']['include']?_[_0xb59a('0x1f')](_0x13f702[_0xb59a('0x1a')][_0xb59a('0x1e')],function(_0x39c80f){return{'model':db[_0x39c80f[_0xb59a('0x20')]],'as':_0x39c80f['as'],'attributes':_0x39c80f[_0xb59a('0x1d')],'include':_0x39c80f[_0xb59a('0x1e')]?_[_0xb59a('0x1f')](_0x39c80f[_0xb59a('0x1e')],function(_0xc7e79){return{'model':db[_0xc7e79[_0xb59a('0x20')]],'as':_0xc7e79['as'],'attributes':_0xc7e79[_0xb59a('0x1d')],'include':_0xc7e79[_0xb59a('0x1e')]?_[_0xb59a('0x1f')](_0xc7e79[_0xb59a('0x1e')],function(_0x1a74ee){return{'model':db[_0x1a74ee[_0xb59a('0x20')]],'as':_0x1a74ee['as'],'attributes':_0x1a74ee[_0xb59a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb59a('0xb')](function(_0x5ecebd){logger[_0xb59a('0xc')](_0xb59a('0x21'),_0x13f702);logger[_0xb59a('0xf')](_0xb59a('0x21'),_0x13f702,JSON[_0xb59a('0x11')](_0x5ecebd));_0x4548b9(_0x5ecebd);})[_0xb59a('0x16')](function(_0x5f5d63){logger['error'](_0xb59a('0x21'),_0x5f5d63[_0xb59a('0x14')],_0x13f702);_0x4f1c12(_0x281f0a['error'](0x1f4,_0x5f5d63['message']));});});};
\ No newline at end of file
+var _0x02ff=['model','map','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include'];(function(_0x2a2689,_0x458593){var _0x2321a3=function(_0x338fd4){while(--_0x338fd4){_0x2a2689['push'](_0x2a2689['shift']());}};_0x2321a3(++_0x458593);}(_0x02ff,0x16c));var _0xf02f=function(_0x158126,_0x520924){_0x158126=_0x158126-0x0;var _0x550d62=_0x02ff[_0x158126];return _0x550d62;};'use strict';var _=require(_0xf02f('0x0'));var util=require(_0xf02f('0x1'));var moment=require(_0xf02f('0x2'));var BPromise=require(_0xf02f('0x3'));var rs=require(_0xf02f('0x4'));var fs=require('fs');var Redis=require(_0xf02f('0x5'));var db=require(_0xf02f('0x6'))['db'];var utils=require(_0xf02f('0x7'));var logger=require('../../config/logger')(_0xf02f('0x8'));var config=require(_0xf02f('0x9'));var jayson=require(_0xf02f('0xa'));var client=jayson[_0xf02f('0xb')][_0xf02f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x134d55,_0x51242a,_0x3bc7e8){return new BPromise(function(_0x3e0e72,_0x4b52ec){return client[_0xf02f('0xd')](_0x134d55,_0x3bc7e8)[_0xf02f('0xe')](function(_0x12d365){logger[_0xf02f('0xf')](_0xf02f('0x10'),_0x51242a,_0xf02f('0x11'));logger[_0xf02f('0x12')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x51242a,'request\x20sent',JSON[_0xf02f('0x13')](_0x12d365));if(_0x12d365[_0xf02f('0x14')]){if(_0x12d365[_0xf02f('0x14')][_0xf02f('0x15')]===0x1f4){logger['error'](_0xf02f('0x10'),_0x51242a,_0x12d365[_0xf02f('0x14')][_0xf02f('0x16')]);return _0x4b52ec(_0x12d365[_0xf02f('0x14')][_0xf02f('0x16')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x51242a,_0x12d365[_0xf02f('0x14')][_0xf02f('0x16')]);return _0x3e0e72(_0x12d365['error'][_0xf02f('0x16')]);}else{logger[_0xf02f('0xf')](_0xf02f('0x10'),_0x51242a,_0xf02f('0x11'));_0x3e0e72(_0x12d365[_0xf02f('0x17')][_0xf02f('0x16')]);}})[_0xf02f('0x18')](function(_0x3983ca){logger[_0xf02f('0x14')](_0xf02f('0x10'),_0x51242a,_0x3983ca);_0x4b52ec(_0x3983ca);});});}exports['GetFreshdeskAccount']=function(_0x2a195b){var _0x30347e=this;return new Promise(function(_0x1094f2,_0x1ffbf5){return db[_0xf02f('0x19')][_0xf02f('0x1a')]({'raw':_0x2a195b[_0xf02f('0x1b')]?_0x2a195b[_0xf02f('0x1b')][_0xf02f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a195b['options']?_0x2a195b['options']['where']||null:null,'attributes':_0x2a195b[_0xf02f('0x1b')]?_0x2a195b[_0xf02f('0x1b')][_0xf02f('0x1d')]||null:null,'limit':_0x2a195b[_0xf02f('0x1b')]?_0x2a195b['options'][_0xf02f('0x1e')]||null:null,'include':_0x2a195b[_0xf02f('0x1b')]?_0x2a195b[_0xf02f('0x1b')][_0xf02f('0x1f')]?_['map'](_0x2a195b['options'][_0xf02f('0x1f')],function(_0x4dab7f){return{'model':db[_0x4dab7f[_0xf02f('0x20')]],'as':_0x4dab7f['as'],'attributes':_0x4dab7f['attributes'],'include':_0x4dab7f[_0xf02f('0x1f')]?_['map'](_0x4dab7f[_0xf02f('0x1f')],function(_0x2314c0){return{'model':db[_0x2314c0[_0xf02f('0x20')]],'as':_0x2314c0['as'],'attributes':_0x2314c0[_0xf02f('0x1d')],'include':_0x2314c0[_0xf02f('0x1f')]?_[_0xf02f('0x21')](_0x2314c0[_0xf02f('0x1f')],function(_0x209225){return{'model':db[_0x209225[_0xf02f('0x20')]],'as':_0x209225['as'],'attributes':_0x209225[_0xf02f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf02f('0xe')](function(_0x11fc63){logger[_0xf02f('0xf')](_0xf02f('0x22'),_0x2a195b);logger[_0xf02f('0x12')](_0xf02f('0x22'),_0x2a195b,JSON[_0xf02f('0x13')](_0x11fc63));_0x1094f2(_0x11fc63);})[_0xf02f('0x18')](function(_0x1c3553){logger['error'](_0xf02f('0x22'),_0x1c3553[_0xf02f('0x16')],_0x2a195b);_0x1ffbf5(_0x30347e['error'](0x1f4,_0x1c3553[_0xf02f('0x16')]));});});};exports['ShowFreshdeskAccount']=function(_0x1e91e3){var _0x2d2558=this;return new Promise(function(_0x1c8b69,_0x52818d){return db[_0xf02f('0x19')]['find']({'raw':_0x1e91e3[_0xf02f('0x1b')]?_0x1e91e3[_0xf02f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1e91e3[_0xf02f('0x1b')]?_0x1e91e3[_0xf02f('0x1b')]['where']||null:null,'attributes':_0x1e91e3['options']?_0x1e91e3['options'][_0xf02f('0x1d')]||null:null,'include':_0x1e91e3[_0xf02f('0x1b')]?_0x1e91e3[_0xf02f('0x1b')][_0xf02f('0x1f')]?_[_0xf02f('0x21')](_0x1e91e3[_0xf02f('0x1b')][_0xf02f('0x1f')],function(_0x455018){return{'model':db[_0x455018['model']],'as':_0x455018['as'],'attributes':_0x455018[_0xf02f('0x1d')],'include':_0x455018[_0xf02f('0x1f')]?_[_0xf02f('0x21')](_0x455018[_0xf02f('0x1f')],function(_0x2695dd){return{'model':db[_0x2695dd['model']],'as':_0x2695dd['as'],'attributes':_0x2695dd[_0xf02f('0x1d')],'include':_0x2695dd[_0xf02f('0x1f')]?_[_0xf02f('0x21')](_0x2695dd['include'],function(_0x13a918){return{'model':db[_0x13a918['model']],'as':_0x13a918['as'],'attributes':_0x13a918[_0xf02f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf02f('0xe')](function(_0x534ae0){logger[_0xf02f('0xf')](_0xf02f('0x23'),_0x1e91e3);logger[_0xf02f('0x12')]('ShowFreshdeskAccount',_0x1e91e3,JSON[_0xf02f('0x13')](_0x534ae0));_0x1c8b69(_0x534ae0);})['catch'](function(_0x22e359){logger[_0xf02f('0x14')]('ShowFreshdeskAccount',_0x22e359[_0xf02f('0x16')],_0x1e91e3);_0x52818d(_0x2d2558[_0xf02f('0x14')](0x1f4,_0x22e359[_0xf02f('0x16')]));});});};
\ No newline at end of file
index ae1eb90..aef19fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3cc=['/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','get','/:id','isAuthenticated','show'];(function(_0x25ccf6,_0xa85be){var _0x34a1d0=function(_0x225056){while(--_0x225056){_0x25ccf6['push'](_0x25ccf6['shift']());}};_0x34a1d0(++_0xa85be);}(_0xa3cc,0x79));var _0xca3c=function(_0x183ef1,_0x388ca7){_0x183ef1=_0x183ef1-0x0;var _0x42c122=_0xa3cc[_0x183ef1];return _0x42c122;};'use strict';var multer=require(_0xca3c('0x0'));var util=require(_0xca3c('0x1'));var path=require(_0xca3c('0x2'));var timeout=require('connect-timeout');var express=require(_0xca3c('0x3'));var router=express[_0xca3c('0x4')]();var fs_extra=require(_0xca3c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca3c('0x6'));var config=require(_0xca3c('0x7'));var controller=require(_0xca3c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xca3c('0x9')]);router[_0xca3c('0xa')](_0xca3c('0xb'),auth[_0xca3c('0xc')](),controller[_0xca3c('0xd')]);router[_0xca3c('0xa')](_0xca3c('0xe'),auth[_0xca3c('0xc')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xca3c('0xf')]);router[_0xca3c('0xa')](_0xca3c('0x10'),auth[_0xca3c('0xc')](),controller[_0xca3c('0x11')]);router[_0xca3c('0xa')](_0xca3c('0x12'),auth[_0xca3c('0xc')](),controller[_0xca3c('0x13')]);router[_0xca3c('0x14')]('/',auth['isAuthenticated'](),controller[_0xca3c('0x15')]);router[_0xca3c('0x14')](_0xca3c('0x12'),auth[_0xca3c('0xc')](),controller[_0xca3c('0x16')]);router[_0xca3c('0x17')](_0xca3c('0xb'),auth[_0xca3c('0xc')](),controller[_0xca3c('0x18')]);router[_0xca3c('0x19')]('/:id',auth[_0xca3c('0xc')](),controller['destroy']);module[_0xca3c('0x1a')]=router;
\ No newline at end of file
+var _0xa7cd=['/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects'];(function(_0x385af0,_0x3d7789){var _0x5c27f3=function(_0x2538d1){while(--_0x2538d1){_0x385af0['push'](_0x385af0['shift']());}};_0x5c27f3(++_0x3d7789);}(_0xa7cd,0x75));var _0xda7c=function(_0x3d010a,_0x578986){_0x3d010a=_0x3d010a-0x0;var _0x1b6c57=_0xa7cd[_0x3d010a];return _0x1b6c57;};'use strict';var multer=require(_0xda7c('0x0'));var util=require('util');var path=require(_0xda7c('0x1'));var timeout=require(_0xda7c('0x2'));var express=require(_0xda7c('0x3'));var router=express[_0xda7c('0x4')]();var fs_extra=require(_0xda7c('0x5'));var auth=require(_0xda7c('0x6'));var interaction=require(_0xda7c('0x7'));var config=require(_0xda7c('0x8'));var controller=require(_0xda7c('0x9'));router[_0xda7c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda7c('0xa')](_0xda7c('0xb'),auth['isAuthenticated'](),controller[_0xda7c('0xc')]);router[_0xda7c('0xa')](_0xda7c('0xd'),auth[_0xda7c('0xe')](),controller[_0xda7c('0xf')]);router[_0xda7c('0xa')](_0xda7c('0x10'),auth[_0xda7c('0xe')](),controller[_0xda7c('0x11')]);router[_0xda7c('0xa')]('/:id/descriptions',auth[_0xda7c('0xe')](),controller['getDescriptions']);router[_0xda7c('0xa')](_0xda7c('0x12'),auth[_0xda7c('0xe')](),controller[_0xda7c('0x13')]);router[_0xda7c('0x14')]('/',auth['isAuthenticated'](),controller[_0xda7c('0x15')]);router[_0xda7c('0x14')](_0xda7c('0x12'),auth['isAuthenticated'](),controller[_0xda7c('0x16')]);router[_0xda7c('0x17')](_0xda7c('0xb'),auth[_0xda7c('0xe')](),controller[_0xda7c('0x18')]);router[_0xda7c('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xda7c('0x1a')]=router;
\ No newline at end of file
index f9c480d..a9efa84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5711=['sequelize','exports','STRING'];(function(_0x10601d,_0x4a3ba3){var _0x26ff50=function(_0x50a838){while(--_0x50a838){_0x10601d['push'](_0x10601d['shift']());}};_0x26ff50(++_0x4a3ba3);}(_0x5711,0xf6));var _0x1571=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x5711[_0x1bf809];return _0x1caa4e;};'use strict';var Sequelize=require(_0x1571('0x0'));module[_0x1571('0x1')]={'name':{'type':Sequelize[_0x1571('0x2')]},'description':{'type':Sequelize[_0x1571('0x2')]}};
\ No newline at end of file
+var _0x03cc=['STRING','sequelize'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x03cc,0x1f1));var _0xc03c=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x03cc[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0xc03c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc03c('0x1')]},'description':{'type':Sequelize[_0xc03c('0x1')]}};
\ No newline at end of file
index e800bbc..792a946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdce=['mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','catch','show','params','keys','include','find','create','body','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xfdce,0xa2));var _0xefdc=function(_0x1f51f0,_0x5f2499){_0x1f51f0=_0x1f51f0-0x0;var _0x3e31ea=_0xfdce[_0x1f51f0];return _0x3e31ea;};'use strict';var emlformat=require(_0xefdc('0x0'));var rimraf=require(_0xefdc('0x1'));var zipdir=require(_0xefdc('0x2'));var jsonpatch=require(_0xefdc('0x3'));var rp=require('request-promise');var moment=require(_0xefdc('0x4'));var BPromise=require(_0xefdc('0x5'));var Mustache=require(_0xefdc('0x6'));var util=require(_0xefdc('0x7'));var path=require('path');var sox=require(_0xefdc('0x8'));var csv=require(_0xefdc('0x9'));var ejs=require(_0xefdc('0xa'));var fs=require('fs');var fs_extra=require(_0xefdc('0xb'));var _=require('lodash');var squel=require(_0xefdc('0xc'));var crypto=require(_0xefdc('0xd'));var jsforce=require(_0xefdc('0xe'));var deskjs=require(_0xefdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xefdc('0x10'));var Papa=require('papaparse');var Redis=require(_0xefdc('0x11'));var authService=require(_0xefdc('0x12'));var qs=require(_0xefdc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefdc('0x14'));var logger=require(_0xefdc('0x15'))('api');var utils=require(_0xefdc('0x16'));var config=require(_0xefdc('0x17'));var licenseUtil=require(_0xefdc('0x18'));var db=require(_0xefdc('0x19'))['db'];function respondWithStatusCode(_0x287d72,_0x59472f){_0x59472f=_0x59472f||0xcc;return function(_0x25efe8){if(_0x25efe8){return _0x287d72[_0xefdc('0x1a')](_0x59472f);}return _0x287d72[_0xefdc('0x1b')](_0x59472f)[_0xefdc('0x1c')]();};}function respondWithResult(_0x2ed76f,_0x40a7b9){_0x40a7b9=_0x40a7b9||0xc8;return function(_0x14e410){if(_0x14e410){return _0x2ed76f[_0xefdc('0x1b')](_0x40a7b9)[_0xefdc('0x1d')](_0x14e410);}};}function respondWithFilteredResult(_0x3ed1a2,_0x44dd14){return function(_0x387151){if(_0x387151){var _0x5541ba=typeof _0x44dd14['offset']===_0xefdc('0x1e')&&typeof _0x44dd14[_0xefdc('0x1f')]===_0xefdc('0x1e');var _0x58393f=_0x387151[_0xefdc('0x20')];var _0x3513c9=_0x5541ba?0x0:_0x44dd14[_0xefdc('0x21')];var _0x50f164=_0x5541ba?_0x387151['count']:_0x44dd14[_0xefdc('0x21')]+_0x44dd14[_0xefdc('0x1f')];var _0x5790bb;if(_0x50f164>=_0x58393f){_0x50f164=_0x58393f;_0x5790bb=0xc8;}else{_0x5790bb=0xce;}_0x3ed1a2['status'](_0x5790bb);return _0x3ed1a2['set']('Content-Range',_0x3513c9+'-'+_0x50f164+'/'+_0x58393f)['json'](_0x387151);}return null;};}function patchUpdates(_0x1e7497){return function(_0x9b0217){try{jsonpatch[_0xefdc('0x22')](_0x9b0217,_0x1e7497,!![]);}catch(_0x4e21f0){return BPromise[_0xefdc('0x23')](_0x4e21f0);}return _0x9b0217[_0xefdc('0x24')]();};}function saveUpdates(_0xc51178,_0x463604){return function(_0x101761){if(_0x101761){return _0x101761[_0xefdc('0x25')](_0xc51178)[_0xefdc('0x26')](function(_0x22beaa){return _0x22beaa;});}return null;};}function removeEntity(_0x4f2640,_0x13cfce){return function(_0x2c0ffd){if(_0x2c0ffd){return _0x2c0ffd[_0xefdc('0x27')]()[_0xefdc('0x26')](function(){_0x4f2640[_0xefdc('0x1b')](0xcc)[_0xefdc('0x1c')]();});}};}function handleEntityNotFound(_0x2e3891,_0x4a90dd){return function(_0x42f0f8){if(!_0x42f0f8){_0x2e3891['sendStatus'](0x194);}return _0x42f0f8;};}function handleError(_0x5e55b9,_0x3b52ae){_0x3b52ae=_0x3b52ae||0x1f4;return function(_0x1524d3){logger['error'](_0x1524d3[_0xefdc('0x28')]);if(_0x1524d3[_0xefdc('0x29')]){delete _0x1524d3[_0xefdc('0x29')];}_0x5e55b9[_0xefdc('0x1b')](_0x3b52ae)[_0xefdc('0x2a')](_0x1524d3);};}exports[_0xefdc('0x2b')]=function(_0x281aed,_0x4dbe5d){var _0x24fc0f={},_0x2378c6={},_0x3c6642={'count':0x0,'rows':[]};var _0x21a876=_['map'](db[_0xefdc('0x2c')][_0xefdc('0x2d')],function(_0x524e51){return{'name':_0x524e51['fieldName'],'type':_0x524e51['type'][_0xefdc('0x2e')]};});_0x2378c6[_0xefdc('0x2f')]=_[_0xefdc('0x30')](_0x21a876,_0xefdc('0x29'));_0x2378c6['query']=_['keys'](_0x281aed[_0xefdc('0x31')]);_0x2378c6[_0xefdc('0x32')]=_['intersection'](_0x2378c6['model'],_0x2378c6[_0xefdc('0x31')]);_0x24fc0f[_0xefdc('0x33')]=_[_0xefdc('0x34')](_0x2378c6[_0xefdc('0x2f')],qs[_0xefdc('0x35')](_0x281aed['query'][_0xefdc('0x35')]));_0x24fc0f[_0xefdc('0x33')]=_0x24fc0f[_0xefdc('0x33')][_0xefdc('0x36')]?_0x24fc0f[_0xefdc('0x33')]:_0x2378c6['model'];if(!_0x281aed['query']['hasOwnProperty'](_0xefdc('0x37'))){_0x24fc0f[_0xefdc('0x1f')]=qs[_0xefdc('0x1f')](_0x281aed[_0xefdc('0x31')][_0xefdc('0x1f')]);_0x24fc0f['offset']=qs['offset'](_0x281aed['query'][_0xefdc('0x21')]);}_0x24fc0f[_0xefdc('0x38')]=qs[_0xefdc('0x39')](_0x281aed[_0xefdc('0x31')][_0xefdc('0x39')]);_0x24fc0f[_0xefdc('0x3a')]=qs['filters'](_[_0xefdc('0x3b')](_0x281aed[_0xefdc('0x31')],_0x2378c6['filters']),_0x21a876);if(_0x281aed['query']['filter']){_0x24fc0f[_0xefdc('0x3a')]=_[_0xefdc('0x3c')](_0x24fc0f['where'],{'$or':_[_0xefdc('0x30')](_0x21a876,function(_0x21da86){if(_0x21da86[_0xefdc('0x3d')]!==_0xefdc('0x3e')){var _0x549af9={};_0x549af9[_0x21da86['name']]={'$like':'%'+_0x281aed['query'][_0xefdc('0x3f')]+'%'};return _0x549af9;}})});}_0x24fc0f=_[_0xefdc('0x3c')]({},_0x24fc0f,_0x281aed[_0xefdc('0x40')]);var _0x817d9e={'where':_0x24fc0f[_0xefdc('0x3a')]};return db[_0xefdc('0x2c')][_0xefdc('0x20')](_0x817d9e)[_0xefdc('0x26')](function(_0x45ee88){_0x3c6642[_0xefdc('0x20')]=_0x45ee88;if(_0x281aed[_0xefdc('0x31')][_0xefdc('0x41')]){_0x24fc0f['include']=[{'all':!![]}];}return db[_0xefdc('0x2c')]['findAll'](_0x24fc0f);})['then'](function(_0x17364e){_0x3c6642['rows']=_0x17364e;return _0x3c6642;})[_0xefdc('0x26')](respondWithFilteredResult(_0x4dbe5d,_0x24fc0f))[_0xefdc('0x42')](handleError(_0x4dbe5d,null));};exports[_0xefdc('0x43')]=function(_0x54db3d,_0x37b5a7){var _0x24d862={'raw':![],'where':{'id':_0x54db3d[_0xefdc('0x44')]['id']}},_0x2eaad2={};_0x2eaad2[_0xefdc('0x2f')]=_[_0xefdc('0x45')](db[_0xefdc('0x2c')][_0xefdc('0x2d')]);_0x2eaad2[_0xefdc('0x31')]=_[_0xefdc('0x45')](_0x54db3d['query']);_0x2eaad2[_0xefdc('0x32')]=_['intersection'](_0x2eaad2[_0xefdc('0x2f')],_0x2eaad2[_0xefdc('0x31')]);_0x24d862[_0xefdc('0x33')]=_['intersection'](_0x2eaad2[_0xefdc('0x2f')],qs['fields'](_0x54db3d[_0xefdc('0x31')][_0xefdc('0x35')]));_0x24d862[_0xefdc('0x33')]=_0x24d862[_0xefdc('0x33')][_0xefdc('0x36')]?_0x24d862[_0xefdc('0x33')]:_0x2eaad2[_0xefdc('0x2f')];if(_0x54db3d[_0xefdc('0x31')]['includeAll']){_0x24d862[_0xefdc('0x46')]=[{'all':!![]}];}_0x24d862=_[_0xefdc('0x3c')]({},_0x24d862,_0x54db3d[_0xefdc('0x40')]);return db[_0xefdc('0x2c')][_0xefdc('0x47')](_0x24d862)[_0xefdc('0x26')](handleEntityNotFound(_0x37b5a7,null))[_0xefdc('0x26')](respondWithResult(_0x37b5a7,null))['catch'](handleError(_0x37b5a7,null));};exports['create']=function(_0xc8aac0,_0x5e96d7){return db[_0xefdc('0x2c')][_0xefdc('0x48')](_0xc8aac0[_0xefdc('0x49')],{})[_0xefdc('0x26')](respondWithResult(_0x5e96d7,0xc9))[_0xefdc('0x42')](handleError(_0x5e96d7,null));};exports['update']=function(_0x54c92f,_0x35dddc){if(_0x54c92f[_0xefdc('0x49')]['id']){delete _0x54c92f['body']['id'];}return db[_0xefdc('0x2c')]['find']({'where':{'id':_0x54c92f['params']['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0x35dddc,null))[_0xefdc('0x26')](saveUpdates(_0x54c92f['body'],null))[_0xefdc('0x26')](respondWithResult(_0x35dddc,null))[_0xefdc('0x42')](handleError(_0x35dddc,null));};exports['destroy']=function(_0x10f584,_0x1ab7d3){return db[_0xefdc('0x2c')][_0xefdc('0x47')]({'where':{'id':_0x10f584[_0xefdc('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ab7d3,null))[_0xefdc('0x26')](removeEntity(_0x1ab7d3,null))[_0xefdc('0x42')](handleError(_0x1ab7d3,null));};exports[_0xefdc('0x4a')]=function(_0x238472,_0x1b7b71,_0x83f515){var _0x47edd1={};var _0x151b0e={};var _0x389961;var _0x44a81a;return db[_0xefdc('0x2c')][_0xefdc('0x4b')]({'where':{'id':_0x238472[_0xefdc('0x44')]['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0x1b7b71,null))[_0xefdc('0x26')](function(_0x2b6698){if(_0x2b6698){_0x389961=_0x2b6698;_0x151b0e[_0xefdc('0x2f')]=_[_0xefdc('0x45')](db[_0xefdc('0x4c')]['rawAttributes']);_0x151b0e[_0xefdc('0x31')]=_[_0xefdc('0x45')](_0x238472[_0xefdc('0x31')]);_0x151b0e[_0xefdc('0x32')]=_[_0xefdc('0x34')](_0x151b0e[_0xefdc('0x2f')],_0x151b0e[_0xefdc('0x31')]);_0x47edd1[_0xefdc('0x33')]=_[_0xefdc('0x34')](_0x151b0e[_0xefdc('0x2f')],qs[_0xefdc('0x35')](_0x238472['query'][_0xefdc('0x35')]));_0x47edd1['attributes']=_0x47edd1[_0xefdc('0x33')]['length']?_0x47edd1['attributes']:_0x151b0e[_0xefdc('0x2f')];_0x47edd1[_0xefdc('0x38')]=qs['sort'](_0x238472[_0xefdc('0x31')]['sort']);_0x47edd1['where']=qs['filters'](_[_0xefdc('0x3b')](_0x238472['query'],_0x151b0e[_0xefdc('0x32')]));if(_0x238472[_0xefdc('0x31')]['filter']){_0x47edd1['where']=_[_0xefdc('0x3c')](_0x47edd1[_0xefdc('0x3a')],{'$or':_['map'](_0x47edd1[_0xefdc('0x33')],function(_0x599565){var _0x3f5baa={};_0x3f5baa[_0x599565]={'$like':'%'+_0x238472[_0xefdc('0x31')][_0xefdc('0x3f')]+'%'};return _0x3f5baa;})});}_0x47edd1=_['merge']({},_0x47edd1,_0x238472[_0xefdc('0x40')]);return _0x389961[_0xefdc('0x4a')](_0x47edd1);}})[_0xefdc('0x26')](function(_0x2705c1){if(_0x2705c1){_0x44a81a=_0x2705c1[_0xefdc('0x36')];if(!_0x238472[_0xefdc('0x31')][_0xefdc('0x4d')]('nolimit')){_0x47edd1[_0xefdc('0x1f')]=qs[_0xefdc('0x1f')](_0x238472[_0xefdc('0x31')][_0xefdc('0x1f')]);_0x47edd1['offset']=qs[_0xefdc('0x21')](_0x238472[_0xefdc('0x31')][_0xefdc('0x21')]);}return _0x389961[_0xefdc('0x4a')](_0x47edd1);}})[_0xefdc('0x26')](function(_0x11a334){if(_0x11a334){return _0x11a334?{'count':_0x44a81a,'rows':_0x11a334}:null;}})[_0xefdc('0x26')](respondWithResult(_0x1b7b71,null))[_0xefdc('0x42')](handleError(_0x1b7b71,null));};exports[_0xefdc('0x4e')]=function(_0x1ae204,_0x24de64,_0x337511){var _0x3d73e5={};var _0x13934c={};var _0x85cbf5;var _0x4b0014;return db[_0xefdc('0x2c')][_0xefdc('0x4b')]({'where':{'id':_0x1ae204[_0xefdc('0x44')]['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0x24de64,null))[_0xefdc('0x26')](function(_0x1c24af){if(_0x1c24af){_0x85cbf5=_0x1c24af;_0x13934c[_0xefdc('0x2f')]=_[_0xefdc('0x45')](db[_0xefdc('0x4c')][_0xefdc('0x2d')]);_0x13934c[_0xefdc('0x31')]=_[_0xefdc('0x45')](_0x1ae204['query']);_0x13934c[_0xefdc('0x32')]=_[_0xefdc('0x34')](_0x13934c['model'],_0x13934c[_0xefdc('0x31')]);_0x3d73e5[_0xefdc('0x33')]=_[_0xefdc('0x34')](_0x13934c[_0xefdc('0x2f')],qs[_0xefdc('0x35')](_0x1ae204[_0xefdc('0x31')][_0xefdc('0x35')]));_0x3d73e5[_0xefdc('0x33')]=_0x3d73e5[_0xefdc('0x33')]['length']?_0x3d73e5[_0xefdc('0x33')]:_0x13934c['model'];_0x3d73e5[_0xefdc('0x38')]=qs[_0xefdc('0x39')](_0x1ae204[_0xefdc('0x31')][_0xefdc('0x39')]);_0x3d73e5[_0xefdc('0x3a')]=qs[_0xefdc('0x32')](_[_0xefdc('0x3b')](_0x1ae204[_0xefdc('0x31')],_0x13934c[_0xefdc('0x32')]));if(_0x1ae204['query'][_0xefdc('0x3f')]){_0x3d73e5[_0xefdc('0x3a')]=_[_0xefdc('0x3c')](_0x3d73e5[_0xefdc('0x3a')],{'$or':_[_0xefdc('0x30')](_0x3d73e5[_0xefdc('0x33')],function(_0x1a35f4){var _0x54d309={};_0x54d309[_0x1a35f4]={'$like':'%'+_0x1ae204[_0xefdc('0x31')][_0xefdc('0x3f')]+'%'};return _0x54d309;})});}_0x3d73e5=_[_0xefdc('0x3c')]({},_0x3d73e5,_0x1ae204[_0xefdc('0x40')]);return _0x85cbf5[_0xefdc('0x4e')](_0x3d73e5);}})[_0xefdc('0x26')](function(_0x5ed4a0){if(_0x5ed4a0){_0x4b0014=_0x5ed4a0['length'];if(!_0x1ae204[_0xefdc('0x31')]['hasOwnProperty'](_0xefdc('0x37'))){_0x3d73e5[_0xefdc('0x1f')]=qs[_0xefdc('0x1f')](_0x1ae204[_0xefdc('0x31')][_0xefdc('0x1f')]);_0x3d73e5[_0xefdc('0x21')]=qs[_0xefdc('0x21')](_0x1ae204['query'][_0xefdc('0x21')]);}return _0x85cbf5[_0xefdc('0x4e')](_0x3d73e5);}})[_0xefdc('0x26')](function(_0x4ad07a){if(_0x4ad07a){return _0x4ad07a?{'count':_0x4b0014,'rows':_0x4ad07a}:null;}})[_0xefdc('0x26')](respondWithResult(_0x24de64,null))['catch'](handleError(_0x24de64,null));};exports[_0xefdc('0x4f')]=function(_0xa37128,_0x250af6,_0x582dd0){var _0x4c8de0={};var _0x228769={};var _0x408260;var _0x1adb13;return db[_0xefdc('0x2c')]['findOne']({'where':{'id':_0xa37128['params']['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0x250af6,null))[_0xefdc('0x26')](function(_0x4e2d99){if(_0x4e2d99){_0x408260=_0x4e2d99;_0x228769['model']=_[_0xefdc('0x45')](db[_0xefdc('0x4c')]['rawAttributes']);_0x228769[_0xefdc('0x31')]=_[_0xefdc('0x45')](_0xa37128[_0xefdc('0x31')]);_0x228769['filters']=_['intersection'](_0x228769[_0xefdc('0x2f')],_0x228769[_0xefdc('0x31')]);_0x4c8de0['attributes']=_[_0xefdc('0x34')](_0x228769[_0xefdc('0x2f')],qs['fields'](_0xa37128['query'][_0xefdc('0x35')]));_0x4c8de0[_0xefdc('0x33')]=_0x4c8de0['attributes'][_0xefdc('0x36')]?_0x4c8de0[_0xefdc('0x33')]:_0x228769[_0xefdc('0x2f')];_0x4c8de0[_0xefdc('0x38')]=qs[_0xefdc('0x39')](_0xa37128[_0xefdc('0x31')][_0xefdc('0x39')]);_0x4c8de0[_0xefdc('0x3a')]=qs[_0xefdc('0x32')](_[_0xefdc('0x3b')](_0xa37128[_0xefdc('0x31')],_0x228769[_0xefdc('0x32')]));if(_0xa37128[_0xefdc('0x31')][_0xefdc('0x3f')]){_0x4c8de0[_0xefdc('0x3a')]=_[_0xefdc('0x3c')](_0x4c8de0['where'],{'$or':_[_0xefdc('0x30')](_0x4c8de0['attributes'],function(_0x488f45){var _0x4cc186={};_0x4cc186[_0x488f45]={'$like':'%'+_0xa37128['query'][_0xefdc('0x3f')]+'%'};return _0x4cc186;})});}_0x4c8de0=_[_0xefdc('0x3c')]({},_0x4c8de0,_0xa37128['options']);return _0x408260['getDescriptions'](_0x4c8de0);}})['then'](function(_0x4ecdb5){if(_0x4ecdb5){_0x1adb13=_0x4ecdb5[_0xefdc('0x36')];if(!_0xa37128[_0xefdc('0x31')][_0xefdc('0x4d')](_0xefdc('0x37'))){_0x4c8de0[_0xefdc('0x1f')]=qs[_0xefdc('0x1f')](_0xa37128['query']['limit']);_0x4c8de0[_0xefdc('0x21')]=qs[_0xefdc('0x21')](_0xa37128[_0xefdc('0x31')][_0xefdc('0x21')]);}return _0x408260['getDescriptions'](_0x4c8de0);}})[_0xefdc('0x26')](function(_0x57d1cb){if(_0x57d1cb){return _0x57d1cb?{'count':_0x1adb13,'rows':_0x57d1cb}:null;}})['then'](respondWithResult(_0x250af6,null))[_0xefdc('0x42')](handleError(_0x250af6,null));};exports[_0xefdc('0x50')]=function(_0x2ec692,_0x4d2e62,_0x43dffe){var _0x4b5672={};var _0x52f824={};var _0x240e8e;var _0x22bcc2;return db[_0xefdc('0x2c')]['findOne']({'where':{'id':_0x2ec692[_0xefdc('0x44')]['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0x4d2e62,null))[_0xefdc('0x26')](function(_0xeb05cd){if(_0xeb05cd){_0x240e8e=_0xeb05cd;_0x52f824[_0xefdc('0x2f')]=_[_0xefdc('0x45')](db[_0xefdc('0x51')]['rawAttributes']);_0x52f824['query']=_[_0xefdc('0x45')](_0x2ec692[_0xefdc('0x31')]);_0x52f824[_0xefdc('0x32')]=_[_0xefdc('0x34')](_0x52f824[_0xefdc('0x2f')],_0x52f824[_0xefdc('0x31')]);_0x4b5672['attributes']=_[_0xefdc('0x34')](_0x52f824['model'],qs['fields'](_0x2ec692['query']['fields']));_0x4b5672[_0xefdc('0x33')]=_0x4b5672[_0xefdc('0x33')][_0xefdc('0x36')]?_0x4b5672[_0xefdc('0x33')]:_0x52f824['model'];_0x4b5672[_0xefdc('0x38')]=qs[_0xefdc('0x39')](_0x2ec692[_0xefdc('0x31')]['sort']);_0x4b5672['where']=qs[_0xefdc('0x32')](_['pick'](_0x2ec692[_0xefdc('0x31')],_0x52f824[_0xefdc('0x32')]));if(_0x2ec692['query']['filter']){_0x4b5672[_0xefdc('0x3a')]=_[_0xefdc('0x3c')](_0x4b5672[_0xefdc('0x3a')],{'$or':_[_0xefdc('0x30')](_0x4b5672[_0xefdc('0x33')],function(_0x220045){var _0x4e4648={};_0x4e4648[_0x220045]={'$like':'%'+_0x2ec692[_0xefdc('0x31')][_0xefdc('0x3f')]+'%'};return _0x4e4648;})});}_0x4b5672=_[_0xefdc('0x3c')]({},_0x4b5672,_0x2ec692[_0xefdc('0x40')]);return _0x240e8e[_0xefdc('0x50')](_0x4b5672);}})[_0xefdc('0x26')](function(_0x5d832f){if(_0x5d832f){_0x22bcc2=_0x5d832f['length'];if(!_0x2ec692[_0xefdc('0x31')]['hasOwnProperty']('nolimit')){_0x4b5672[_0xefdc('0x1f')]=qs[_0xefdc('0x1f')](_0x2ec692[_0xefdc('0x31')][_0xefdc('0x1f')]);_0x4b5672[_0xefdc('0x21')]=qs['offset'](_0x2ec692[_0xefdc('0x31')]['offset']);}return _0x240e8e['getTags'](_0x4b5672);}})[_0xefdc('0x26')](function(_0xfcc0a2){if(_0xfcc0a2){return _0xfcc0a2?{'count':_0x22bcc2,'rows':_0xfcc0a2}:null;}})[_0xefdc('0x26')](respondWithResult(_0x4d2e62,null))[_0xefdc('0x42')](handleError(_0x4d2e62,null));};exports[_0xefdc('0x52')]=function(_0x2541c1,_0xcbf1f,_0x5bae0d){if(_0x2541c1[_0xefdc('0x49')]['id']){delete _0x2541c1[_0xefdc('0x49')]['id'];}return db[_0xefdc('0x2c')][_0xefdc('0x4b')]({'where':{'id':_0x2541c1[_0xefdc('0x44')]['id']}})[_0xefdc('0x26')](handleEntityNotFound(_0xcbf1f,null))[_0xefdc('0x26')](function(_0xe2003e){if(_0xe2003e){return _0xe2003e[_0xefdc('0x52')](_0x2541c1['body'][_0xefdc('0x53')]||[]);}return null;})[_0xefdc('0x26')](respondWithResult(_0xcbf1f,null))[_0xefdc('0x42')](handleError(_0xcbf1f,null));};
\ No newline at end of file
+var _0xc7e2=['zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf'];(function(_0x175428,_0x941f94){var _0xc7101a=function(_0x341c17){while(--_0x341c17){_0x175428['push'](_0x175428['shift']());}};_0xc7101a(++_0x941f94);}(_0xc7e2,0x14e));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2c7e('0x0'));var rimraf=require(_0x2c7e('0x1'));var zipdir=require(_0x2c7e('0x2'));var jsonpatch=require(_0x2c7e('0x3'));var rp=require('request-promise');var moment=require(_0x2c7e('0x4'));var BPromise=require(_0x2c7e('0x5'));var Mustache=require('mustache');var util=require(_0x2c7e('0x6'));var path=require(_0x2c7e('0x7'));var sox=require(_0x2c7e('0x8'));var csv=require(_0x2c7e('0x9'));var ejs=require(_0x2c7e('0xa'));var fs=require('fs');var fs_extra=require(_0x2c7e('0xb'));var _=require('lodash');var squel=require(_0x2c7e('0xc'));var crypto=require(_0x2c7e('0xd'));var jsforce=require(_0x2c7e('0xe'));var deskjs=require(_0x2c7e('0xf'));var toCsv=require(_0x2c7e('0x9'));var querystring=require(_0x2c7e('0x10'));var Papa=require('papaparse');var Redis=require(_0x2c7e('0x11'));var authService=require(_0x2c7e('0x12'));var qs=require(_0x2c7e('0x13'));var as=require(_0x2c7e('0x14'));var hardwareService=require(_0x2c7e('0x15'));var logger=require(_0x2c7e('0x16'))('api');var utils=require(_0x2c7e('0x17'));var config=require(_0x2c7e('0x18'));var licenseUtil=require(_0x2c7e('0x19'));var db=require(_0x2c7e('0x1a'))['db'];function respondWithStatusCode(_0xc9a7b0,_0x57c318){_0x57c318=_0x57c318||0xcc;return function(_0x58dd94){if(_0x58dd94){return _0xc9a7b0[_0x2c7e('0x1b')](_0x57c318);}return _0xc9a7b0[_0x2c7e('0x1c')](_0x57c318)['end']();};}function respondWithResult(_0x59d00a,_0x54aa86){_0x54aa86=_0x54aa86||0xc8;return function(_0x1165e0){if(_0x1165e0){return _0x59d00a[_0x2c7e('0x1c')](_0x54aa86)[_0x2c7e('0x1d')](_0x1165e0);}};}function respondWithFilteredResult(_0x528616,_0x59ae60){return function(_0x510a42){if(_0x510a42){var _0x22bcb3=typeof _0x59ae60[_0x2c7e('0x1e')]===_0x2c7e('0x1f')&&typeof _0x59ae60[_0x2c7e('0x20')]===_0x2c7e('0x1f');var _0x81c166=_0x510a42[_0x2c7e('0x21')];var _0x5d0f1b=_0x22bcb3?0x0:_0x59ae60[_0x2c7e('0x1e')];var _0x30db6a=_0x22bcb3?_0x510a42[_0x2c7e('0x21')]:_0x59ae60[_0x2c7e('0x1e')]+_0x59ae60[_0x2c7e('0x20')];var _0x909619;if(_0x30db6a>=_0x81c166){_0x30db6a=_0x81c166;_0x909619=0xc8;}else{_0x909619=0xce;}_0x528616[_0x2c7e('0x1c')](_0x909619);return _0x528616['set'](_0x2c7e('0x22'),_0x5d0f1b+'-'+_0x30db6a+'/'+_0x81c166)[_0x2c7e('0x1d')](_0x510a42);}return null;};}function patchUpdates(_0x50eee2){return function(_0x1b841a){try{jsonpatch[_0x2c7e('0x23')](_0x1b841a,_0x50eee2,!![]);}catch(_0x570aad){return BPromise['reject'](_0x570aad);}return _0x1b841a[_0x2c7e('0x24')]();};}function saveUpdates(_0x363a48,_0x539580){return function(_0xf6aa8b){if(_0xf6aa8b){return _0xf6aa8b['update'](_0x363a48)[_0x2c7e('0x25')](function(_0xb9c994){return _0xb9c994;});}return null;};}function removeEntity(_0x380e3f,_0x110821){return function(_0x523b8d){if(_0x523b8d){return _0x523b8d[_0x2c7e('0x26')]()[_0x2c7e('0x25')](function(){_0x380e3f[_0x2c7e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e6cc,_0x57d551){return function(_0x3756aa){if(!_0x3756aa){_0x47e6cc['sendStatus'](0x194);}return _0x3756aa;};}function handleError(_0x70b807,_0x4a0253){_0x4a0253=_0x4a0253||0x1f4;return function(_0x4e7c0a){logger[_0x2c7e('0x27')](_0x4e7c0a[_0x2c7e('0x28')]);if(_0x4e7c0a[_0x2c7e('0x29')]){delete _0x4e7c0a[_0x2c7e('0x29')];}_0x70b807['status'](_0x4a0253)[_0x2c7e('0x2a')](_0x4e7c0a);};}exports[_0x2c7e('0x2b')]=function(_0x73dbf2,_0x16f8ae){var _0x587dbf={},_0x2882a0={},_0x42e74a={'count':0x0,'rows':[]};var _0x354345=_[_0x2c7e('0x2c')](db[_0x2c7e('0x2d')][_0x2c7e('0x2e')],function(_0x5217cc){return{'name':_0x5217cc['fieldName'],'type':_0x5217cc[_0x2c7e('0x2f')][_0x2c7e('0x30')]};});_0x2882a0[_0x2c7e('0x31')]=_['map'](_0x354345,_0x2c7e('0x29'));_0x2882a0[_0x2c7e('0x32')]=_[_0x2c7e('0x33')](_0x73dbf2['query']);_0x2882a0[_0x2c7e('0x34')]=_['intersection'](_0x2882a0[_0x2c7e('0x31')],_0x2882a0[_0x2c7e('0x32')]);_0x587dbf[_0x2c7e('0x35')]=_[_0x2c7e('0x36')](_0x2882a0[_0x2c7e('0x31')],qs[_0x2c7e('0x37')](_0x73dbf2[_0x2c7e('0x32')][_0x2c7e('0x37')]));_0x587dbf['attributes']=_0x587dbf[_0x2c7e('0x35')][_0x2c7e('0x38')]?_0x587dbf[_0x2c7e('0x35')]:_0x2882a0[_0x2c7e('0x31')];if(!_0x73dbf2['query'][_0x2c7e('0x39')](_0x2c7e('0x3a'))){_0x587dbf['limit']=qs['limit'](_0x73dbf2['query'][_0x2c7e('0x20')]);_0x587dbf[_0x2c7e('0x1e')]=qs[_0x2c7e('0x1e')](_0x73dbf2['query']['offset']);}_0x587dbf['order']=qs[_0x2c7e('0x3b')](_0x73dbf2[_0x2c7e('0x32')]['sort']);_0x587dbf['where']=qs[_0x2c7e('0x34')](_[_0x2c7e('0x3c')](_0x73dbf2[_0x2c7e('0x32')],_0x2882a0[_0x2c7e('0x34')]),_0x354345);if(_0x73dbf2['query'][_0x2c7e('0x3d')]){_0x587dbf[_0x2c7e('0x3e')]=_[_0x2c7e('0x3f')](_0x587dbf[_0x2c7e('0x3e')],{'$or':_[_0x2c7e('0x2c')](_0x354345,function(_0x5166db){if(_0x5166db[_0x2c7e('0x2f')]!==_0x2c7e('0x40')){var _0x4648d3={};_0x4648d3[_0x5166db[_0x2c7e('0x29')]]={'$like':'%'+_0x73dbf2['query']['filter']+'%'};return _0x4648d3;}})});}_0x587dbf=_[_0x2c7e('0x3f')]({},_0x587dbf,_0x73dbf2[_0x2c7e('0x41')]);var _0x2e4d0d={'where':_0x587dbf[_0x2c7e('0x3e')]};return db[_0x2c7e('0x2d')]['count'](_0x2e4d0d)[_0x2c7e('0x25')](function(_0x40f8da){_0x42e74a[_0x2c7e('0x21')]=_0x40f8da;if(_0x73dbf2[_0x2c7e('0x32')][_0x2c7e('0x42')]){_0x587dbf[_0x2c7e('0x43')]=[{'all':!![]}];}return db[_0x2c7e('0x2d')][_0x2c7e('0x44')](_0x587dbf);})[_0x2c7e('0x25')](function(_0x358433){_0x42e74a['rows']=_0x358433;return _0x42e74a;})[_0x2c7e('0x25')](respondWithFilteredResult(_0x16f8ae,_0x587dbf))['catch'](handleError(_0x16f8ae,null));};exports[_0x2c7e('0x45')]=function(_0x1d40ca,_0x4755b9){var _0x2c46b9={'raw':![],'where':{'id':_0x1d40ca[_0x2c7e('0x46')]['id']}},_0x3be01f={};_0x3be01f[_0x2c7e('0x31')]=_['keys'](db[_0x2c7e('0x2d')]['rawAttributes']);_0x3be01f[_0x2c7e('0x32')]=_[_0x2c7e('0x33')](_0x1d40ca[_0x2c7e('0x32')]);_0x3be01f[_0x2c7e('0x34')]=_[_0x2c7e('0x36')](_0x3be01f['model'],_0x3be01f['query']);_0x2c46b9[_0x2c7e('0x35')]=_[_0x2c7e('0x36')](_0x3be01f[_0x2c7e('0x31')],qs[_0x2c7e('0x37')](_0x1d40ca[_0x2c7e('0x32')][_0x2c7e('0x37')]));_0x2c46b9[_0x2c7e('0x35')]=_0x2c46b9[_0x2c7e('0x35')][_0x2c7e('0x38')]?_0x2c46b9[_0x2c7e('0x35')]:_0x3be01f[_0x2c7e('0x31')];if(_0x1d40ca[_0x2c7e('0x32')]['includeAll']){_0x2c46b9['include']=[{'all':!![]}];}_0x2c46b9=_[_0x2c7e('0x3f')]({},_0x2c46b9,_0x1d40ca[_0x2c7e('0x41')]);return db[_0x2c7e('0x2d')][_0x2c7e('0x47')](_0x2c46b9)[_0x2c7e('0x25')](handleEntityNotFound(_0x4755b9,null))[_0x2c7e('0x25')](respondWithResult(_0x4755b9,null))[_0x2c7e('0x48')](handleError(_0x4755b9,null));};exports['create']=function(_0x4970a8,_0x5243fa){return db[_0x2c7e('0x2d')][_0x2c7e('0x49')](_0x4970a8['body'],{})['then'](respondWithResult(_0x5243fa,0xc9))[_0x2c7e('0x48')](handleError(_0x5243fa,null));};exports['update']=function(_0x88332d,_0x542fda){if(_0x88332d[_0x2c7e('0x4a')]['id']){delete _0x88332d[_0x2c7e('0x4a')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x88332d['params']['id']}})['then'](handleEntityNotFound(_0x542fda,null))['then'](saveUpdates(_0x88332d['body'],null))[_0x2c7e('0x25')](respondWithResult(_0x542fda,null))['catch'](handleError(_0x542fda,null));};exports[_0x2c7e('0x26')]=function(_0x2e0d31,_0x1a9826){return db[_0x2c7e('0x2d')]['find']({'where':{'id':_0x2e0d31['params']['id']}})[_0x2c7e('0x25')](handleEntityNotFound(_0x1a9826,null))[_0x2c7e('0x25')](removeEntity(_0x1a9826,null))[_0x2c7e('0x48')](handleError(_0x1a9826,null));};exports['getFields']=function(_0x3220cd,_0x5b146f,_0x20381c){var _0x4a4321={};var _0x2f3d0b={};var _0xe61355;var _0x3686ae;return db[_0x2c7e('0x2d')][_0x2c7e('0x4b')]({'where':{'id':_0x3220cd[_0x2c7e('0x46')]['id']}})[_0x2c7e('0x25')](handleEntityNotFound(_0x5b146f,null))[_0x2c7e('0x25')](function(_0x4d399e){if(_0x4d399e){_0xe61355=_0x4d399e;_0x2f3d0b['model']=_['keys'](db[_0x2c7e('0x4c')]['rawAttributes']);_0x2f3d0b[_0x2c7e('0x32')]=_[_0x2c7e('0x33')](_0x3220cd[_0x2c7e('0x32')]);_0x2f3d0b[_0x2c7e('0x34')]=_['intersection'](_0x2f3d0b[_0x2c7e('0x31')],_0x2f3d0b['query']);_0x4a4321[_0x2c7e('0x35')]=_[_0x2c7e('0x36')](_0x2f3d0b['model'],qs[_0x2c7e('0x37')](_0x3220cd[_0x2c7e('0x32')]['fields']));_0x4a4321[_0x2c7e('0x35')]=_0x4a4321['attributes'][_0x2c7e('0x38')]?_0x4a4321['attributes']:_0x2f3d0b[_0x2c7e('0x31')];_0x4a4321[_0x2c7e('0x4d')]=qs[_0x2c7e('0x3b')](_0x3220cd['query']['sort']);_0x4a4321[_0x2c7e('0x3e')]=qs[_0x2c7e('0x34')](_[_0x2c7e('0x3c')](_0x3220cd[_0x2c7e('0x32')],_0x2f3d0b[_0x2c7e('0x34')]));if(_0x3220cd['query'][_0x2c7e('0x3d')]){_0x4a4321[_0x2c7e('0x3e')]=_[_0x2c7e('0x3f')](_0x4a4321[_0x2c7e('0x3e')],{'$or':_[_0x2c7e('0x2c')](_0x4a4321['attributes'],function(_0x2b570f){var _0x5be40c={};_0x5be40c[_0x2b570f]={'$like':'%'+_0x3220cd[_0x2c7e('0x32')][_0x2c7e('0x3d')]+'%'};return _0x5be40c;})});}_0x4a4321=_['merge']({},_0x4a4321,_0x3220cd[_0x2c7e('0x41')]);return _0xe61355[_0x2c7e('0x4e')](_0x4a4321);}})[_0x2c7e('0x25')](function(_0x58a0f){if(_0x58a0f){_0x3686ae=_0x58a0f[_0x2c7e('0x38')];if(!_0x3220cd[_0x2c7e('0x32')]['hasOwnProperty'](_0x2c7e('0x3a'))){_0x4a4321['limit']=qs[_0x2c7e('0x20')](_0x3220cd[_0x2c7e('0x32')]['limit']);_0x4a4321[_0x2c7e('0x1e')]=qs[_0x2c7e('0x1e')](_0x3220cd[_0x2c7e('0x32')][_0x2c7e('0x1e')]);}return _0xe61355[_0x2c7e('0x4e')](_0x4a4321);}})[_0x2c7e('0x25')](function(_0x302d01){if(_0x302d01){return _0x302d01?{'count':_0x3686ae,'rows':_0x302d01}:null;}})[_0x2c7e('0x25')](respondWithResult(_0x5b146f,null))[_0x2c7e('0x48')](handleError(_0x5b146f,null));};exports[_0x2c7e('0x4f')]=function(_0x178b85,_0x3244b0,_0x1b4981){var _0x56b9ea={};var _0x52012e={};var _0x23a826;var _0x58c874;return db['FreshdeskConfiguration'][_0x2c7e('0x4b')]({'where':{'id':_0x178b85[_0x2c7e('0x46')]['id']}})[_0x2c7e('0x25')](handleEntityNotFound(_0x3244b0,null))[_0x2c7e('0x25')](function(_0x2fdd0d){if(_0x2fdd0d){_0x23a826=_0x2fdd0d;_0x52012e[_0x2c7e('0x31')]=_['keys'](db['FreshdeskField'][_0x2c7e('0x2e')]);_0x52012e['query']=_['keys'](_0x178b85['query']);_0x52012e['filters']=_[_0x2c7e('0x36')](_0x52012e[_0x2c7e('0x31')],_0x52012e[_0x2c7e('0x32')]);_0x56b9ea[_0x2c7e('0x35')]=_[_0x2c7e('0x36')](_0x52012e[_0x2c7e('0x31')],qs[_0x2c7e('0x37')](_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x37')]));_0x56b9ea['attributes']=_0x56b9ea[_0x2c7e('0x35')][_0x2c7e('0x38')]?_0x56b9ea[_0x2c7e('0x35')]:_0x52012e[_0x2c7e('0x31')];_0x56b9ea[_0x2c7e('0x4d')]=qs[_0x2c7e('0x3b')](_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x3b')]);_0x56b9ea['where']=qs[_0x2c7e('0x34')](_['pick'](_0x178b85[_0x2c7e('0x32')],_0x52012e[_0x2c7e('0x34')]));if(_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x3d')]){_0x56b9ea[_0x2c7e('0x3e')]=_['merge'](_0x56b9ea['where'],{'$or':_[_0x2c7e('0x2c')](_0x56b9ea[_0x2c7e('0x35')],function(_0x49632d){var _0x50993d={};_0x50993d[_0x49632d]={'$like':'%'+_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x3d')]+'%'};return _0x50993d;})});}_0x56b9ea=_[_0x2c7e('0x3f')]({},_0x56b9ea,_0x178b85[_0x2c7e('0x41')]);return _0x23a826[_0x2c7e('0x4f')](_0x56b9ea);}})[_0x2c7e('0x25')](function(_0x222325){if(_0x222325){_0x58c874=_0x222325[_0x2c7e('0x38')];if(!_0x178b85[_0x2c7e('0x32')]['hasOwnProperty'](_0x2c7e('0x3a'))){_0x56b9ea[_0x2c7e('0x20')]=qs[_0x2c7e('0x20')](_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x20')]);_0x56b9ea[_0x2c7e('0x1e')]=qs['offset'](_0x178b85[_0x2c7e('0x32')][_0x2c7e('0x1e')]);}return _0x23a826['getSubjects'](_0x56b9ea);}})[_0x2c7e('0x25')](function(_0x2fecd8){if(_0x2fecd8){return _0x2fecd8?{'count':_0x58c874,'rows':_0x2fecd8}:null;}})['then'](respondWithResult(_0x3244b0,null))['catch'](handleError(_0x3244b0,null));};exports[_0x2c7e('0x50')]=function(_0x28e5bf,_0x575177,_0x51ba5e){var _0x4ee9f8={};var _0x524ac4={};var _0x4155f8;var _0x14e47d;return db['FreshdeskConfiguration'][_0x2c7e('0x4b')]({'where':{'id':_0x28e5bf[_0x2c7e('0x46')]['id']}})[_0x2c7e('0x25')](handleEntityNotFound(_0x575177,null))['then'](function(_0x187f4a){if(_0x187f4a){_0x4155f8=_0x187f4a;_0x524ac4[_0x2c7e('0x31')]=_[_0x2c7e('0x33')](db[_0x2c7e('0x4c')][_0x2c7e('0x2e')]);_0x524ac4['query']=_[_0x2c7e('0x33')](_0x28e5bf[_0x2c7e('0x32')]);_0x524ac4['filters']=_[_0x2c7e('0x36')](_0x524ac4[_0x2c7e('0x31')],_0x524ac4[_0x2c7e('0x32')]);_0x4ee9f8[_0x2c7e('0x35')]=_['intersection'](_0x524ac4['model'],qs[_0x2c7e('0x37')](_0x28e5bf[_0x2c7e('0x32')]['fields']));_0x4ee9f8[_0x2c7e('0x35')]=_0x4ee9f8[_0x2c7e('0x35')][_0x2c7e('0x38')]?_0x4ee9f8[_0x2c7e('0x35')]:_0x524ac4['model'];_0x4ee9f8[_0x2c7e('0x4d')]=qs[_0x2c7e('0x3b')](_0x28e5bf[_0x2c7e('0x32')]['sort']);_0x4ee9f8['where']=qs[_0x2c7e('0x34')](_[_0x2c7e('0x3c')](_0x28e5bf[_0x2c7e('0x32')],_0x524ac4['filters']));if(_0x28e5bf['query'][_0x2c7e('0x3d')]){_0x4ee9f8[_0x2c7e('0x3e')]=_[_0x2c7e('0x3f')](_0x4ee9f8[_0x2c7e('0x3e')],{'$or':_[_0x2c7e('0x2c')](_0x4ee9f8['attributes'],function(_0x31474f){var _0x23d37b={};_0x23d37b[_0x31474f]={'$like':'%'+_0x28e5bf[_0x2c7e('0x32')][_0x2c7e('0x3d')]+'%'};return _0x23d37b;})});}_0x4ee9f8=_['merge']({},_0x4ee9f8,_0x28e5bf[_0x2c7e('0x41')]);return _0x4155f8[_0x2c7e('0x50')](_0x4ee9f8);}})[_0x2c7e('0x25')](function(_0x23919e){if(_0x23919e){_0x14e47d=_0x23919e['length'];if(!_0x28e5bf[_0x2c7e('0x32')][_0x2c7e('0x39')](_0x2c7e('0x3a'))){_0x4ee9f8[_0x2c7e('0x20')]=qs[_0x2c7e('0x20')](_0x28e5bf[_0x2c7e('0x32')][_0x2c7e('0x20')]);_0x4ee9f8[_0x2c7e('0x1e')]=qs[_0x2c7e('0x1e')](_0x28e5bf['query'][_0x2c7e('0x1e')]);}return _0x4155f8[_0x2c7e('0x50')](_0x4ee9f8);}})[_0x2c7e('0x25')](function(_0x358e18){if(_0x358e18){return _0x358e18?{'count':_0x14e47d,'rows':_0x358e18}:null;}})[_0x2c7e('0x25')](respondWithResult(_0x575177,null))[_0x2c7e('0x48')](handleError(_0x575177,null));};exports[_0x2c7e('0x51')]=function(_0x38681e,_0x40a045,_0x52be09){var _0x2580da={};var _0x1da600={};var _0xa18579;var _0x214eb0;return db[_0x2c7e('0x2d')]['findOne']({'where':{'id':_0x38681e[_0x2c7e('0x46')]['id']}})[_0x2c7e('0x25')](handleEntityNotFound(_0x40a045,null))[_0x2c7e('0x25')](function(_0x28424f){if(_0x28424f){_0xa18579=_0x28424f;_0x1da600['model']=_[_0x2c7e('0x33')](db[_0x2c7e('0x52')][_0x2c7e('0x2e')]);_0x1da600['query']=_['keys'](_0x38681e[_0x2c7e('0x32')]);_0x1da600[_0x2c7e('0x34')]=_['intersection'](_0x1da600[_0x2c7e('0x31')],_0x1da600['query']);_0x2580da[_0x2c7e('0x35')]=_[_0x2c7e('0x36')](_0x1da600[_0x2c7e('0x31')],qs[_0x2c7e('0x37')](_0x38681e[_0x2c7e('0x32')][_0x2c7e('0x37')]));_0x2580da['attributes']=_0x2580da[_0x2c7e('0x35')][_0x2c7e('0x38')]?_0x2580da[_0x2c7e('0x35')]:_0x1da600[_0x2c7e('0x31')];_0x2580da[_0x2c7e('0x4d')]=qs['sort'](_0x38681e[_0x2c7e('0x32')][_0x2c7e('0x3b')]);_0x2580da[_0x2c7e('0x3e')]=qs[_0x2c7e('0x34')](_[_0x2c7e('0x3c')](_0x38681e['query'],_0x1da600[_0x2c7e('0x34')]));if(_0x38681e['query'][_0x2c7e('0x3d')]){_0x2580da[_0x2c7e('0x3e')]=_[_0x2c7e('0x3f')](_0x2580da[_0x2c7e('0x3e')],{'$or':_[_0x2c7e('0x2c')](_0x2580da['attributes'],function(_0x157c6a){var _0xd62c3b={};_0xd62c3b[_0x157c6a]={'$like':'%'+_0x38681e[_0x2c7e('0x32')]['filter']+'%'};return _0xd62c3b;})});}_0x2580da=_['merge']({},_0x2580da,_0x38681e[_0x2c7e('0x41')]);return _0xa18579[_0x2c7e('0x51')](_0x2580da);}})['then'](function(_0x2db7b4){if(_0x2db7b4){_0x214eb0=_0x2db7b4[_0x2c7e('0x38')];if(!_0x38681e[_0x2c7e('0x32')][_0x2c7e('0x39')](_0x2c7e('0x3a'))){_0x2580da['limit']=qs[_0x2c7e('0x20')](_0x38681e[_0x2c7e('0x32')][_0x2c7e('0x20')]);_0x2580da[_0x2c7e('0x1e')]=qs[_0x2c7e('0x1e')](_0x38681e[_0x2c7e('0x32')][_0x2c7e('0x1e')]);}return _0xa18579[_0x2c7e('0x51')](_0x2580da);}})[_0x2c7e('0x25')](function(_0x19e4b1){if(_0x19e4b1){return _0x19e4b1?{'count':_0x214eb0,'rows':_0x19e4b1}:null;}})[_0x2c7e('0x25')](respondWithResult(_0x40a045,null))[_0x2c7e('0x48')](handleError(_0x40a045,null));};exports[_0x2c7e('0x53')]=function(_0x5b3f8f,_0x23c540,_0x39aa0a){if(_0x5b3f8f['body']['id']){delete _0x5b3f8f['body']['id'];}return db['FreshdeskConfiguration'][_0x2c7e('0x4b')]({'where':{'id':_0x5b3f8f['params']['id']}})['then'](handleEntityNotFound(_0x23c540,null))['then'](function(_0x4366e1){if(_0x4366e1){return _0x4366e1[_0x2c7e('0x53')](_0x5b3f8f[_0x2c7e('0x4a')]['ids']||[]);}return null;})[_0x2c7e('0x25')](respondWithResult(_0x23c540,null))[_0x2c7e('0x48')](handleError(_0x23c540,null));};
\ No newline at end of file
index 7756c38..0838a92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd8a=['define','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x24a33d,_0x35d24d){var _0x378800=function(_0x105dfd){while(--_0x105dfd){_0x24a33d['push'](_0x24a33d['shift']());}};_0x378800(++_0x35d24d);}(_0xbd8a,0x1ba));var _0xabd8=function(_0x88eed3,_0x1741d7){_0x88eed3=_0x88eed3-0x0;var _0xf8b3a6=_0xbd8a[_0x88eed3];return _0xf8b3a6;};'use strict';var _=require('lodash');var util=require(_0xabd8('0x0'));var logger=require(_0xabd8('0x1'))(_0xabd8('0x2'));var moment=require(_0xabd8('0x3'));var BPromise=require(_0xabd8('0x4'));var rp=require(_0xabd8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabd8('0x6'));var config=require(_0xabd8('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xabd8('0x8')]=function(_0x5b5753,_0x2f9d54){return _0x5b5753[_0xabd8('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0xabd8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ae3=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','api'];(function(_0x198c22,_0x2e24bc){var _0x224a36=function(_0x195768){while(--_0x195768){_0x198c22['push'](_0x198c22['shift']());}};_0x224a36(++_0x2e24bc);}(_0x4ae3,0x6a));var _0x34ae=function(_0xf89ad3,_0x4a4a05){_0xf89ad3=_0xf89ad3-0x0;var _0x324449=_0x4ae3[_0xf89ad3];return _0x324449;};'use strict';var _=require(_0x34ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x34ae('0x1'));var moment=require('moment');var BPromise=require(_0x34ae('0x2'));var rp=require(_0x34ae('0x3'));var fs=require('fs');var path=require(_0x34ae('0x4'));var rimraf=require(_0x34ae('0x5'));var config=require(_0x34ae('0x6'));var attributes=require(_0x34ae('0x7'));module[_0x34ae('0x8')]=function(_0x4ed6d9,_0x35e682){return _0x4ed6d9[_0x34ae('0x9')](_0x34ae('0xa'),attributes,{'tableName':_0x34ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ab4a9bb..0aafb0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe19e=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x93d42c,_0x2352f0){var _0x3d22bc=function(_0x59489a){while(--_0x59489a){_0x93d42c['push'](_0x93d42c['shift']());}};_0x3d22bc(++_0x2352f0);}(_0xe19e,0x9d));var _0xee19=function(_0x1f4a54,_0x2c4ed8){_0x1f4a54=_0x1f4a54-0x0;var _0x5990ac=_0xe19e[_0x1f4a54];return _0x5990ac;};'use strict';var _=require(_0xee19('0x0'));var util=require('util');var moment=require(_0xee19('0x1'));var BPromise=require(_0xee19('0x2'));var rs=require(_0xee19('0x3'));var fs=require('fs');var Redis=require(_0xee19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xee19('0x5'));var logger=require('../../config/logger')(_0xee19('0x6'));var config=require(_0xee19('0x7'));var jayson=require(_0xee19('0x8'));var client=jayson[_0xee19('0x9')][_0xee19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x309092,_0x2b6eaa,_0x48cf9a){return new BPromise(function(_0x2e4da0,_0x559530){return client[_0xee19('0xb')](_0x309092,_0x48cf9a)[_0xee19('0xc')](function(_0x50ee72){logger[_0xee19('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b6eaa,_0xee19('0xe'));logger['debug'](_0xee19('0xf'),_0x2b6eaa,_0xee19('0xe'),JSON[_0xee19('0x10')](_0x50ee72));if(_0x50ee72[_0xee19('0x11')]){if(_0x50ee72['error'][_0xee19('0x12')]===0x1f4){logger[_0xee19('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b6eaa,_0x50ee72[_0xee19('0x11')][_0xee19('0x13')]);return _0x559530(_0x50ee72[_0xee19('0x11')][_0xee19('0x13')]);}logger[_0xee19('0x11')](_0xee19('0x14'),_0x2b6eaa,_0x50ee72['error'][_0xee19('0x13')]);return _0x2e4da0(_0x50ee72[_0xee19('0x11')][_0xee19('0x13')]);}else{logger[_0xee19('0xd')](_0xee19('0x14'),_0x2b6eaa,_0xee19('0xe'));_0x2e4da0(_0x50ee72[_0xee19('0x15')][_0xee19('0x13')]);}})[_0xee19('0x16')](function(_0x2a19e1){logger[_0xee19('0x11')](_0xee19('0x14'),_0x2b6eaa,_0x2a19e1);_0x559530(_0x2a19e1);});});}
\ No newline at end of file
+var _0x2acb=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2acb,0x1e5));var _0xb2ac=function(_0x2aff4e,_0x25ff1e){_0x2aff4e=_0x2aff4e-0x0;var _0x144aef=_0x2acb[_0x2aff4e];return _0x144aef;};'use strict';var _=require(_0xb2ac('0x0'));var util=require(_0xb2ac('0x1'));var moment=require(_0xb2ac('0x2'));var BPromise=require(_0xb2ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2ac('0x4'));var db=require(_0xb2ac('0x5'))['db'];var utils=require(_0xb2ac('0x6'));var logger=require(_0xb2ac('0x7'))(_0xb2ac('0x8'));var config=require(_0xb2ac('0x9'));var jayson=require(_0xb2ac('0xa'));var client=jayson[_0xb2ac('0xb')][_0xb2ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29821a,_0x2d51e4,_0x3321a7){return new BPromise(function(_0x1d1570,_0x5e01cb){return client['request'](_0x29821a,_0x3321a7)[_0xb2ac('0xd')](function(_0x276fb4){logger[_0xb2ac('0xe')](_0xb2ac('0xf'),_0x2d51e4,_0xb2ac('0x10'));logger[_0xb2ac('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2d51e4,_0xb2ac('0x10'),JSON[_0xb2ac('0x12')](_0x276fb4));if(_0x276fb4['error']){if(_0x276fb4[_0xb2ac('0x13')][_0xb2ac('0x14')]===0x1f4){logger[_0xb2ac('0x13')](_0xb2ac('0xf'),_0x2d51e4,_0x276fb4[_0xb2ac('0x13')]['message']);return _0x5e01cb(_0x276fb4[_0xb2ac('0x13')]['message']);}logger[_0xb2ac('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d51e4,_0x276fb4['error'][_0xb2ac('0x15')]);return _0x1d1570(_0x276fb4[_0xb2ac('0x13')][_0xb2ac('0x15')]);}else{logger['info'](_0xb2ac('0xf'),_0x2d51e4,_0xb2ac('0x10'));_0x1d1570(_0x276fb4[_0xb2ac('0x16')][_0xb2ac('0x15')]);}})[_0xb2ac('0x17')](function(_0x20b7ad){logger[_0xb2ac('0x13')](_0xb2ac('0xf'),_0x2d51e4,_0x20b7ad);_0x5e01cb(_0x20b7ad);});});}
\ No newline at end of file
index 905c976..5c8d564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d73=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1b41b9,_0x5e41fa){var _0x51841e=function(_0x70eb93){while(--_0x70eb93){_0x1b41b9['push'](_0x1b41b9['shift']());}};_0x51841e(++_0x5e41fa);}(_0x2d73,0x1c7));var _0x32d7=function(_0x596de3,_0xf801c0){_0x596de3=_0x596de3-0x0;var _0xbf541f=_0x2d73[_0x596de3];return _0xbf541f;};'use strict';var multer=require(_0x32d7('0x0'));var util=require(_0x32d7('0x1'));var path=require(_0x32d7('0x2'));var timeout=require(_0x32d7('0x3'));var express=require('express');var router=express[_0x32d7('0x4')]();var fs_extra=require(_0x32d7('0x5'));var auth=require(_0x32d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x32d7('0x7'));var controller=require(_0x32d7('0x8'));router[_0x32d7('0x9')]('/',auth[_0x32d7('0xa')](),controller[_0x32d7('0xb')]);router['get'](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0xd')]);router[_0x32d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x32d7('0xf')]);router[_0x32d7('0x10')](_0x32d7('0xc'),auth[_0x32d7('0xa')](),controller[_0x32d7('0x11')]);router[_0x32d7('0x12')](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0x13')]);module[_0x32d7('0x14')]=router;
\ No newline at end of file
+var _0xf556=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service'];(function(_0x43b6d3,_0x35f085){var _0x31a998=function(_0x1d057b){while(--_0x1d057b){_0x43b6d3['push'](_0x43b6d3['shift']());}};_0x31a998(++_0x35f085);}(_0xf556,0x1d8));var _0x6f55=function(_0x88281e,_0x502f0b){_0x88281e=_0x88281e-0x0;var _0x4c8edf=_0xf556[_0x88281e];return _0x4c8edf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f55('0x0'));var timeout=require('connect-timeout');var express=require(_0x6f55('0x1'));var router=express['Router']();var fs_extra=require(_0x6f55('0x2'));var auth=require(_0x6f55('0x3'));var interaction=require(_0x6f55('0x4'));var config=require(_0x6f55('0x5'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x6f55('0x6')](),controller[_0x6f55('0x7')]);router[_0x6f55('0x8')](_0x6f55('0x9'),auth[_0x6f55('0x6')](),controller[_0x6f55('0xa')]);router[_0x6f55('0xb')]('/',auth[_0x6f55('0x6')](),controller['create']);router[_0x6f55('0xc')](_0x6f55('0x9'),auth[_0x6f55('0x6')](),controller[_0x6f55('0xd')]);router[_0x6f55('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6f55('0xf')]);module[_0x6f55('0x10')]=router;
\ No newline at end of file
index 4f14b65..68d5790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x526a=['STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5d718c,_0x169efe){var _0x3a89db=function(_0x44d296){while(--_0x44d296){_0x5d718c['push'](_0x5d718c['shift']());}};_0x3a89db(++_0x169efe);}(_0x526a,0x158));var _0xa526=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x526a[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0xa526('0x0')]={'type':{'type':Sequelize[_0xa526('0x1')](_0xa526('0x2'),_0xa526('0x3'),_0xa526('0x4'),_0xa526('0x5'),'picklist'),'defaultValue':_0xa526('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa526('0x6')]},'keyType':{'type':Sequelize[_0xa526('0x1')](_0xa526('0x2'),_0xa526('0x3'),_0xa526('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa526('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa526('0x6')]}};
\ No newline at end of file
+var _0x6546=['string','variable','customVariable','keyValue','STRING','ENUM','sequelize'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x6546,0x99));var _0x6654=function(_0x46733e,_0x47dfd3){_0x46733e=_0x46733e-0x0;var _0x109e09=_0x6546[_0x46733e];return _0x109e09;};'use strict';var Sequelize=require(_0x6654('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6654('0x1'),_0x6654('0x2'),_0x6654('0x3'),_0x6654('0x4'),'picklist'),'defaultValue':_0x6654('0x1')},'content':{'type':Sequelize[_0x6654('0x5')]},'key':{'type':Sequelize[_0x6654('0x5')]},'keyType':{'type':Sequelize[_0x6654('0x6')]('string',_0x6654('0x2'),_0x6654('0x3'))},'keyContent':{'type':Sequelize[_0x6654('0x5')]},'idField':{'type':Sequelize[_0x6654('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6654('0x5')]}};
\ No newline at end of file
index 7457cfe..d59ec39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263f=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','findAll','catch','show','params','length','includeAll','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','model'];(function(_0x34cc63,_0x59a1a1){var _0x30b342=function(_0xb95b15){while(--_0xb95b15){_0x34cc63['push'](_0x34cc63['shift']());}};_0x30b342(++_0x59a1a1);}(_0x263f,0x182));var _0xf263=function(_0x222dc5,_0x5335ef){_0x222dc5=_0x222dc5-0x0;var _0x2293ab=_0x263f[_0x222dc5];return _0x2293ab;};'use strict';var emlformat=require(_0xf263('0x0'));var rimraf=require(_0xf263('0x1'));var zipdir=require(_0xf263('0x2'));var jsonpatch=require(_0xf263('0x3'));var rp=require(_0xf263('0x4'));var moment=require(_0xf263('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf263('0x6'));var util=require(_0xf263('0x7'));var path=require(_0xf263('0x8'));var sox=require('sox');var csv=require(_0xf263('0x9'));var ejs=require(_0xf263('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf263('0xb'));var crypto=require(_0xf263('0xc'));var jsforce=require(_0xf263('0xd'));var deskjs=require(_0xf263('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf263('0xf'));var Papa=require(_0xf263('0x10'));var Redis=require(_0xf263('0x11'));var authService=require(_0xf263('0x12'));var qs=require(_0xf263('0x13'));var as=require(_0xf263('0x14'));var hardwareService=require(_0xf263('0x15'));var logger=require('../../config/logger')(_0xf263('0x16'));var utils=require('../../config/utils');var config=require(_0xf263('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc9f0,_0x2b1145){_0x2b1145=_0x2b1145||0xcc;return function(_0x17471d){if(_0x17471d){return _0x2fc9f0[_0xf263('0x18')](_0x2b1145);}return _0x2fc9f0[_0xf263('0x19')](_0x2b1145)[_0xf263('0x1a')]();};}function respondWithResult(_0xc75366,_0x559c6c){_0x559c6c=_0x559c6c||0xc8;return function(_0x2f40d8){if(_0x2f40d8){return _0xc75366['status'](_0x559c6c)[_0xf263('0x1b')](_0x2f40d8);}};}function respondWithFilteredResult(_0x27b16a,_0x3ac432){return function(_0x402739){if(_0x402739){var _0x16b4dd=typeof _0x3ac432[_0xf263('0x1c')]===_0xf263('0x1d')&&typeof _0x3ac432['limit']==='undefined';var _0x2bbe2f=_0x402739[_0xf263('0x1e')];var _0x325a84=_0x16b4dd?0x0:_0x3ac432[_0xf263('0x1c')];var _0x1ea46b=_0x16b4dd?_0x402739['count']:_0x3ac432[_0xf263('0x1c')]+_0x3ac432['limit'];var _0x39205b;if(_0x1ea46b>=_0x2bbe2f){_0x1ea46b=_0x2bbe2f;_0x39205b=0xc8;}else{_0x39205b=0xce;}_0x27b16a[_0xf263('0x19')](_0x39205b);return _0x27b16a[_0xf263('0x1f')]('Content-Range',_0x325a84+'-'+_0x1ea46b+'/'+_0x2bbe2f)[_0xf263('0x1b')](_0x402739);}return null;};}function patchUpdates(_0x169328){return function(_0x127135){try{jsonpatch['apply'](_0x127135,_0x169328,!![]);}catch(_0x41627f){return BPromise[_0xf263('0x20')](_0x41627f);}return _0x127135[_0xf263('0x21')]();};}function saveUpdates(_0x426667,_0xa0695){return function(_0x2c0996){if(_0x2c0996){return _0x2c0996[_0xf263('0x22')](_0x426667)[_0xf263('0x23')](function(_0x6a1dd2){return _0x6a1dd2;});}return null;};}function removeEntity(_0xe32b07,_0x29eb45){return function(_0x4de045){if(_0x4de045){return _0x4de045['destroy']()['then'](function(){_0xe32b07[_0xf263('0x19')](0xcc)[_0xf263('0x1a')]();});}};}function handleEntityNotFound(_0x231748,_0x1b3603){return function(_0x36df8e){if(!_0x36df8e){_0x231748[_0xf263('0x18')](0x194);}return _0x36df8e;};}function handleError(_0x16af55,_0x41fab2){_0x41fab2=_0x41fab2||0x1f4;return function(_0x3c44f1){logger[_0xf263('0x24')](_0x3c44f1[_0xf263('0x25')]);if(_0x3c44f1['name']){delete _0x3c44f1[_0xf263('0x26')];}_0x16af55['status'](_0x41fab2)[_0xf263('0x27')](_0x3c44f1);};}exports['index']=function(_0x368cfc,_0x3500b2){var _0x5a11bf={},_0x57ae2f={},_0x43f306={'count':0x0,'rows':[]};var _0x339b3b=_[_0xf263('0x28')](db[_0xf263('0x29')][_0xf263('0x2a')],function(_0x28288b){return{'name':_0x28288b[_0xf263('0x2b')],'type':_0x28288b[_0xf263('0x2c')]['key']};});_0x57ae2f[_0xf263('0x2d')]=_[_0xf263('0x28')](_0x339b3b,_0xf263('0x26'));_0x57ae2f[_0xf263('0x2e')]=_[_0xf263('0x2f')](_0x368cfc[_0xf263('0x2e')]);_0x57ae2f[_0xf263('0x30')]=_[_0xf263('0x31')](_0x57ae2f[_0xf263('0x2d')],_0x57ae2f['query']);_0x5a11bf[_0xf263('0x32')]=_['intersection'](_0x57ae2f['model'],qs[_0xf263('0x33')](_0x368cfc[_0xf263('0x2e')]['fields']));_0x5a11bf[_0xf263('0x32')]=_0x5a11bf[_0xf263('0x32')]['length']?_0x5a11bf[_0xf263('0x32')]:_0x57ae2f[_0xf263('0x2d')];if(!_0x368cfc[_0xf263('0x2e')][_0xf263('0x34')](_0xf263('0x35'))){_0x5a11bf[_0xf263('0x36')]=qs['limit'](_0x368cfc[_0xf263('0x2e')][_0xf263('0x36')]);_0x5a11bf['offset']=qs['offset'](_0x368cfc[_0xf263('0x2e')][_0xf263('0x1c')]);}_0x5a11bf[_0xf263('0x37')]=qs[_0xf263('0x38')](_0x368cfc['query'][_0xf263('0x38')]);_0x5a11bf[_0xf263('0x39')]=qs[_0xf263('0x30')](_[_0xf263('0x3a')](_0x368cfc[_0xf263('0x2e')],_0x57ae2f['filters']),_0x339b3b);if(_0x368cfc[_0xf263('0x2e')][_0xf263('0x3b')]){_0x5a11bf[_0xf263('0x39')]=_['merge'](_0x5a11bf[_0xf263('0x39')],{'$or':_[_0xf263('0x28')](_0x339b3b,function(_0x3f2670){if(_0x3f2670[_0xf263('0x2c')]!==_0xf263('0x3c')){var _0x5eb46a={};_0x5eb46a[_0x3f2670[_0xf263('0x26')]]={'$like':'%'+_0x368cfc[_0xf263('0x2e')][_0xf263('0x3b')]+'%'};return _0x5eb46a;}})});}_0x5a11bf=_['merge']({},_0x5a11bf,_0x368cfc[_0xf263('0x3d')]);var _0x2d20a5={'where':_0x5a11bf[_0xf263('0x39')]};return db['FreshdeskField'][_0xf263('0x1e')](_0x2d20a5)['then'](function(_0x3bb081){_0x43f306[_0xf263('0x1e')]=_0x3bb081;if(_0x368cfc[_0xf263('0x2e')]['includeAll']){_0x5a11bf['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xf263('0x3e')](_0x5a11bf);})[_0xf263('0x23')](function(_0x56303f){_0x43f306['rows']=_0x56303f;return _0x43f306;})[_0xf263('0x23')](respondWithFilteredResult(_0x3500b2,_0x5a11bf))[_0xf263('0x3f')](handleError(_0x3500b2,null));};exports[_0xf263('0x40')]=function(_0x11205c,_0x1bc12a){var _0x54d8e4={'raw':!![],'where':{'id':_0x11205c[_0xf263('0x41')]['id']}},_0x1577c9={};_0x1577c9[_0xf263('0x2d')]=_[_0xf263('0x2f')](db[_0xf263('0x29')]['rawAttributes']);_0x1577c9[_0xf263('0x2e')]=_[_0xf263('0x2f')](_0x11205c[_0xf263('0x2e')]);_0x1577c9['filters']=_['intersection'](_0x1577c9[_0xf263('0x2d')],_0x1577c9['query']);_0x54d8e4['attributes']=_[_0xf263('0x31')](_0x1577c9[_0xf263('0x2d')],qs[_0xf263('0x33')](_0x11205c['query'][_0xf263('0x33')]));_0x54d8e4[_0xf263('0x32')]=_0x54d8e4['attributes'][_0xf263('0x42')]?_0x54d8e4[_0xf263('0x32')]:_0x1577c9['model'];if(_0x11205c[_0xf263('0x2e')][_0xf263('0x43')]){_0x54d8e4['include']=[{'all':!![]}];}_0x54d8e4=_[_0xf263('0x44')]({},_0x54d8e4,_0x11205c[_0xf263('0x3d')]);return db[_0xf263('0x29')][_0xf263('0x45')](_0x54d8e4)[_0xf263('0x23')](handleEntityNotFound(_0x1bc12a,null))[_0xf263('0x23')](respondWithResult(_0x1bc12a,null))[_0xf263('0x3f')](handleError(_0x1bc12a,null));};exports['create']=function(_0x11eb85,_0x2e8cbe){return db[_0xf263('0x29')][_0xf263('0x46')](_0x11eb85[_0xf263('0x47')],{})[_0xf263('0x23')](respondWithResult(_0x2e8cbe,0xc9))[_0xf263('0x3f')](handleError(_0x2e8cbe,null));};exports[_0xf263('0x22')]=function(_0x5da8ba,_0x8993f7){if(_0x5da8ba[_0xf263('0x47')]['id']){delete _0x5da8ba[_0xf263('0x47')]['id'];}return db[_0xf263('0x29')]['find']({'where':{'id':_0x5da8ba[_0xf263('0x41')]['id']}})['then'](handleEntityNotFound(_0x8993f7,null))[_0xf263('0x23')](saveUpdates(_0x5da8ba[_0xf263('0x47')],null))[_0xf263('0x23')](respondWithResult(_0x8993f7,null))['catch'](handleError(_0x8993f7,null));};exports['destroy']=function(_0x5b5585,_0x4f5578){return db['FreshdeskField'][_0xf263('0x45')]({'where':{'id':_0x5b5585[_0xf263('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f5578,null))[_0xf263('0x23')](removeEntity(_0x4f5578,null))[_0xf263('0x3f')](handleError(_0x4f5578,null));};
\ No newline at end of file
+var _0xb9a7=['merge','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','rawAttributes','intersection','create','body','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','map','FreshdeskField','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xb9a7,0x112));var _0x7b9a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xb9a7[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)[_0x7b9a('0x15')]();});}};}function handleEntityNotFound(_0x23219e,_0x5809f5){return function(_0x39b7ec){if(!_0x39b7ec){_0x23219e['sendStatus'](0x194);}return _0x39b7ec;};}function handleError(_0x31eb67,_0x3091ab){_0x3091ab=_0x3091ab||0x1f4;return function(_0x4c2271){logger['error'](_0x4c2271[_0x7b9a('0x20')]);if(_0x4c2271['name']){delete _0x4c2271['name'];}_0x31eb67[_0x7b9a('0x14')](_0x3091ab)['send'](_0x4c2271);};}exports['index']=function(_0x3847b4,_0x4d5880){var _0x5c89b6={},_0x314b6d={},_0x4fee38={'count':0x0,'rows':[]};var _0x1553ae=_[_0x7b9a('0x21')](db[_0x7b9a('0x22')]['rawAttributes'],function(_0x45ccf5){return{'name':_0x45ccf5[_0x7b9a('0x23')],'type':_0x45ccf5[_0x7b9a('0x24')][_0x7b9a('0x25')]};});_0x314b6d[_0x7b9a('0x26')]=_[_0x7b9a('0x21')](_0x1553ae,'name');_0x314b6d['query']=_[_0x7b9a('0x27')](_0x3847b4[_0x7b9a('0x28')]);_0x314b6d[_0x7b9a('0x29')]=_['intersection'](_0x314b6d[_0x7b9a('0x26')],_0x314b6d[_0x7b9a('0x28')]);_0x5c89b6['attributes']=_['intersection'](_0x314b6d[_0x7b9a('0x26')],qs[_0x7b9a('0x2a')](_0x3847b4['query'][_0x7b9a('0x2a')]));_0x5c89b6[_0x7b9a('0x2b')]=_0x5c89b6[_0x7b9a('0x2b')][_0x7b9a('0x2c')]?_0x5c89b6[_0x7b9a('0x2b')]:_0x314b6d['model'];if(!_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x2d')](_0x7b9a('0x2e'))){_0x5c89b6[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x3847b4[_0x7b9a('0x28')]['limit']);_0x5c89b6['offset']=qs[_0x7b9a('0x17')](_0x3847b4[_0x7b9a('0x28')]['offset']);}_0x5c89b6[_0x7b9a('0x2f')]=qs[_0x7b9a('0x30')](_0x3847b4[_0x7b9a('0x28')]['sort']);_0x5c89b6[_0x7b9a('0x31')]=qs[_0x7b9a('0x29')](_['pick'](_0x3847b4['query'],_0x314b6d[_0x7b9a('0x29')]),_0x1553ae);if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]){_0x5c89b6[_0x7b9a('0x31')]=_[_0x7b9a('0x33')](_0x5c89b6[_0x7b9a('0x31')],{'$or':_[_0x7b9a('0x21')](_0x1553ae,function(_0x380f4b){if(_0x380f4b['type']!==_0x7b9a('0x34')){var _0x5ac175={};_0x5ac175[_0x380f4b[_0x7b9a('0x35')]]={'$like':'%'+_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]+'%'};return _0x5ac175;}})});}_0x5c89b6=_[_0x7b9a('0x33')]({},_0x5c89b6,_0x3847b4[_0x7b9a('0x36')]);var _0x89951b={'where':_0x5c89b6['where']};return db[_0x7b9a('0x22')][_0x7b9a('0x19')](_0x89951b)[_0x7b9a('0x1e')](function(_0x1bc1f0){_0x4fee38['count']=_0x1bc1f0;if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x5c89b6[_0x7b9a('0x38')]=[{'all':!![]}];}return db[_0x7b9a('0x22')]['findAll'](_0x5c89b6);})[_0x7b9a('0x1e')](function(_0x53d89a){_0x4fee38[_0x7b9a('0x39')]=_0x53d89a;return _0x4fee38;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x4d5880,_0x5c89b6))[_0x7b9a('0x3a')](handleError(_0x4d5880,null));};exports[_0x7b9a('0x3b')]=function(_0x43fad0,_0x41f541){var _0x56e274={'raw':!![],'where':{'id':_0x43fad0[_0x7b9a('0x3c')]['id']}},_0x33edc6={};_0x33edc6[_0x7b9a('0x26')]=_['keys'](db['FreshdeskField'][_0x7b9a('0x3d')]);_0x33edc6[_0x7b9a('0x28')]=_[_0x7b9a('0x27')](_0x43fad0[_0x7b9a('0x28')]);_0x33edc6[_0x7b9a('0x29')]=_[_0x7b9a('0x3e')](_0x33edc6['model'],_0x33edc6['query']);_0x56e274['attributes']=_[_0x7b9a('0x3e')](_0x33edc6[_0x7b9a('0x26')],qs['fields'](_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x2a')]));_0x56e274[_0x7b9a('0x2b')]=_0x56e274['attributes'][_0x7b9a('0x2c')]?_0x56e274['attributes']:_0x33edc6[_0x7b9a('0x26')];if(_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x56e274[_0x7b9a('0x38')]=[{'all':!![]}];}_0x56e274=_[_0x7b9a('0x33')]({},_0x56e274,_0x43fad0['options']);return db[_0x7b9a('0x22')]['find'](_0x56e274)[_0x7b9a('0x1e')](handleEntityNotFound(_0x41f541,null))['then'](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0x7b9a('0x3f')]=function(_0x3727ef,_0x717d08){return db[_0x7b9a('0x22')][_0x7b9a('0x3f')](_0x3727ef[_0x7b9a('0x40')],{})[_0x7b9a('0x1e')](respondWithResult(_0x717d08,0xc9))[_0x7b9a('0x3a')](handleError(_0x717d08,null));};exports[_0x7b9a('0x1d')]=function(_0x5088c7,_0x1d7957){if(_0x5088c7[_0x7b9a('0x40')]['id']){delete _0x5088c7['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x5088c7[_0x7b9a('0x3c')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1d7957,null))[_0x7b9a('0x1e')](saveUpdates(_0x5088c7[_0x7b9a('0x40')],null))['then'](respondWithResult(_0x1d7957,null))[_0x7b9a('0x3a')](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1f')]=function(_0x287dea,_0x33b200){return db[_0x7b9a('0x22')]['find']({'where':{'id':_0x287dea[_0x7b9a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x33b200,null))[_0x7b9a('0x1e')](removeEntity(_0x33b200,null))[_0x7b9a('0x3a')](handleError(_0x33b200,null));};
\ No newline at end of file
index 7602d27..e31bc51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b30=['exports','FreshdeskField','int_freshdesk_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x0b30,0x1a7));var _0x00b3=function(_0x1ee84f,_0x3375a9){_0x1ee84f=_0x1ee84f-0x0;var _0xebd053=_0x0b30[_0x1ee84f];return _0xebd053;};'use strict';var _=require(_0x00b3('0x0'));var util=require(_0x00b3('0x1'));var logger=require(_0x00b3('0x2'))(_0x00b3('0x3'));var moment=require(_0x00b3('0x4'));var BPromise=require(_0x00b3('0x5'));var rp=require(_0x00b3('0x6'));var fs=require('fs');var path=require(_0x00b3('0x7'));var rimraf=require(_0x00b3('0x8'));var config=require(_0x00b3('0x9'));var attributes=require(_0x00b3('0xa'));module[_0x00b3('0xb')]=function(_0x3cc5e8,_0x5d6898){return _0x3cc5e8['define'](_0x00b3('0xc'),attributes,{'tableName':_0x00b3('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa895=['bluebird','request-promise','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x483351,_0xb26b44){var _0x2f9d65=function(_0x4b88eb){while(--_0x4b88eb){_0x483351['push'](_0x483351['shift']());}};_0x2f9d65(++_0xb26b44);}(_0xa895,0x145));var _0x5a89=function(_0x9979f9,_0x22dba0){_0x9979f9=_0x9979f9-0x0;var _0x53b7fe=_0xa895[_0x9979f9];return _0x53b7fe;};'use strict';var _=require(_0x5a89('0x0'));var util=require(_0x5a89('0x1'));var logger=require(_0x5a89('0x2'))(_0x5a89('0x3'));var moment=require(_0x5a89('0x4'));var BPromise=require(_0x5a89('0x5'));var rp=require(_0x5a89('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5a89('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x5a89('0x8')]=function(_0x2bc4d5,_0x2f6517){return _0x2bc4d5[_0x5a89('0x9')](_0x5a89('0xa'),attributes,{'tableName':_0x5a89('0xb'),'paranoid':![],'indexes':[{'name':_0x5a89('0xc'),'fields':[_0x5a89('0xd'),_0x5a89('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index aff515b..f881dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe975=['client','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe975,0x1da));var _0x5e97=function(_0x3974ca,_0x10219d){_0x3974ca=_0x3974ca-0x0;var _0x3ac4d2=_0xe975[_0x3974ca];return _0x3ac4d2;};'use strict';var _=require('lodash');var util=require(_0x5e97('0x0'));var moment=require(_0x5e97('0x1'));var BPromise=require(_0x5e97('0x2'));var rs=require(_0x5e97('0x3'));var fs=require('fs');var Redis=require(_0x5e97('0x4'));var db=require(_0x5e97('0x5'))['db'];var utils=require(_0x5e97('0x6'));var logger=require('../../config/logger')(_0x5e97('0x7'));var config=require(_0x5e97('0x8'));var jayson=require(_0x5e97('0x9'));var client=jayson[_0x5e97('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f40a7,_0x44080d,_0x9f8fce){return new BPromise(function(_0x4b36f8,_0x45250e){return client[_0x5e97('0xb')](_0x1f40a7,_0x9f8fce)['then'](function(_0x655176){logger[_0x5e97('0xc')](_0x5e97('0xd'),_0x44080d,_0x5e97('0xe'));logger['debug'](_0x5e97('0xf'),_0x44080d,_0x5e97('0xe'),JSON[_0x5e97('0x10')](_0x655176));if(_0x655176['error']){if(_0x655176[_0x5e97('0x11')][_0x5e97('0x12')]===0x1f4){logger['error'](_0x5e97('0xd'),_0x44080d,_0x655176[_0x5e97('0x11')][_0x5e97('0x13')]);return _0x45250e(_0x655176['error'][_0x5e97('0x13')]);}logger['error'](_0x5e97('0xd'),_0x44080d,_0x655176[_0x5e97('0x11')][_0x5e97('0x13')]);return _0x4b36f8(_0x655176[_0x5e97('0x11')]['message']);}else{logger[_0x5e97('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x44080d,_0x5e97('0xe'));_0x4b36f8(_0x655176[_0x5e97('0x14')][_0x5e97('0x13')]);}})[_0x5e97('0x15')](function(_0x49e58a){logger[_0x5e97('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x44080d,_0x49e58a);_0x45250e(_0x49e58a);});});}
\ No newline at end of file
+var _0x08b3=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x108893,_0x26e755){var _0xdb330=function(_0x17bc39){while(--_0x17bc39){_0x108893['push'](_0x108893['shift']());}};_0xdb330(++_0x26e755);}(_0x08b3,0x111));var _0x308b=function(_0x4aaade,_0x3580d0){_0x4aaade=_0x4aaade-0x0;var _0x5c9d3d=_0x08b3[_0x4aaade];return _0x5c9d3d;};'use strict';var _=require(_0x308b('0x0'));var util=require(_0x308b('0x1'));var moment=require(_0x308b('0x2'));var BPromise=require(_0x308b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308b('0x4'));var db=require(_0x308b('0x5'))['db'];var utils=require(_0x308b('0x6'));var logger=require(_0x308b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x308b('0x8'));var client=jayson[_0x308b('0x9')][_0x308b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aa27c,_0x2c8a20,_0x1fdb1f){return new BPromise(function(_0x3df96e,_0x487999){return client['request'](_0x3aa27c,_0x1fdb1f)['then'](function(_0x2a47b4){logger[_0x308b('0xb')](_0x308b('0xc'),_0x2c8a20,_0x308b('0xd'));logger[_0x308b('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2c8a20,'request\x20sent',JSON[_0x308b('0xf')](_0x2a47b4));if(_0x2a47b4['error']){if(_0x2a47b4[_0x308b('0x10')][_0x308b('0x11')]===0x1f4){logger['error'](_0x308b('0xc'),_0x2c8a20,_0x2a47b4[_0x308b('0x10')][_0x308b('0x12')]);return _0x487999(_0x2a47b4[_0x308b('0x10')][_0x308b('0x12')]);}logger['error'](_0x308b('0xc'),_0x2c8a20,_0x2a47b4['error'][_0x308b('0x12')]);return _0x3df96e(_0x2a47b4['error']['message']);}else{logger[_0x308b('0xb')](_0x308b('0xc'),_0x2c8a20,_0x308b('0xd'));_0x3df96e(_0x2a47b4[_0x308b('0x13')][_0x308b('0x12')]);}})[_0x308b('0x14')](function(_0x1f34b1){logger[_0x308b('0x10')](_0x308b('0xc'),_0x2c8a20,_0x1f34b1);_0x487999(_0x1f34b1);});});}
\ No newline at end of file
index 2515dae..5d63e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2547=['addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x1b2bc7,_0x31e55a){var _0x22af55=function(_0xea77fc){while(--_0xea77fc){_0x1b2bc7['push'](_0x1b2bc7['shift']());}};_0x22af55(++_0x31e55a);}(_0x2547,0x1cd));var _0x7254=function(_0x3407ca,_0x48f42b){_0x3407ca=_0x3407ca-0x0;var _0x2a8e21=_0x2547[_0x3407ca];return _0x2a8e21;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0x12')]);router['post'](_0x7254('0xe'),auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['put'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x15')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x16')]);module[_0x7254('0x17')]=router;
\ No newline at end of file
+var _0xe605=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','/:id','update','delete'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe605,0x92));var _0x5e60=function(_0x2128f4,_0x480280){_0x2128f4=_0x2128f4-0x0;var _0x370622=_0xe605[_0x2128f4];return _0x370622;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['get']('/:id/configurations',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['post']('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x10')](_0x5e60('0x11'),auth[_0x5e60('0xb')](),controller['addConfiguration']);router[_0x5e60('0x12')](_0x5e60('0x13'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x14')]);router[_0x5e60('0x15')](_0x5e60('0x13'),auth['isAuthenticated'](),controller[_0x5e60('0x16')]);module[_0x5e60('0x17')]=router;
\ No newline at end of file
index a046fbf..3ade4a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x495b86,_0x2f84cc){var _0x50260d=function(_0x252adc){while(--_0x252adc){_0x495b86['push'](_0x495b86['shift']());}};_0x50260d(++_0x2f84cc);}(_0x4991,0xf7));var _0x1499=function(_0x503711,_0x5abce4){_0x503711=_0x503711-0x0;var _0x3cc929=_0x4991[_0x503711];return _0x3cc929;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x4312ac,_0x178faf){var _0x19b266=function(_0x4fed24){while(--_0x4fed24){_0x4312ac['push'](_0x4312ac['shift']());}};_0x19b266(++_0x178faf);}(_0x02ce,0x1ac));var _0xe02c=function(_0xf84d6e,_0x3ce8f1){_0xf84d6e=_0xf84d6e-0x0;var _0x54a9e8=_0x02ce[_0xf84d6e];return _0x54a9e8;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]}};
\ No newline at end of file
index e078590..3bfab8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x053b=['json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','type','model','keys','filters','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','slice','GET','format','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x053b,0x1d3));var _0xb053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb053('0x0'));var rimraf=require(_0xb053('0x1'));var zipdir=require(_0xb053('0x2'));var jsonpatch=require(_0xb053('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb053('0x4'));var Mustache=require(_0xb053('0x5'));var util=require(_0xb053('0x6'));var path=require(_0xb053('0x7'));var sox=require('sox');var csv=require(_0xb053('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb053('0x9'));var squel=require(_0xb053('0xa'));var crypto=require(_0xb053('0xb'));var jsforce=require(_0xb053('0xc'));var deskjs=require(_0xb053('0xd'));var toCsv=require(_0xb053('0x8'));var querystring=require(_0xb053('0xe'));var Papa=require(_0xb053('0xf'));var Redis=require(_0xb053('0x10'));var authService=require(_0xb053('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb053('0x12'));var logger=require(_0xb053('0x13'))(_0xb053('0x14'));var utils=require(_0xb053('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb053('0x16'));var db=require(_0xb053('0x17'))['db'];var integrations=require(_0xb053('0x18'));function respondWithStatusCode(_0x50a693,_0x5775f5){_0x5775f5=_0x5775f5||0xcc;return function(_0x530cbb){if(_0x530cbb){return _0x50a693[_0xb053('0x19')](_0x5775f5);}return _0x50a693[_0xb053('0x1a')](_0x5775f5)[_0xb053('0x1b')]();};}function respondWithResult(_0x55c359,_0x30d2bc){_0x30d2bc=_0x30d2bc||0xc8;return function(_0x31d3c0){if(_0x31d3c0){return _0x55c359[_0xb053('0x1a')](_0x30d2bc)[_0xb053('0x1c')](_0x31d3c0);}};}function respondWithFilteredResult(_0x16648d,_0x4816c4){return function(_0x6c61ca){if(_0x6c61ca){var _0x45a79c=typeof _0x4816c4[_0xb053('0x1d')]==='undefined'&&typeof _0x4816c4['limit']===_0xb053('0x1e');var _0x50d388=_0x6c61ca[_0xb053('0x1f')];var _0x6d97de=_0x45a79c?0x0:_0x4816c4[_0xb053('0x1d')];var _0x1212af=_0x45a79c?_0x6c61ca[_0xb053('0x1f')]:_0x4816c4[_0xb053('0x1d')]+_0x4816c4['limit'];var _0x4693d0;if(_0x1212af>=_0x50d388){_0x1212af=_0x50d388;_0x4693d0=0xc8;}else{_0x4693d0=0xce;}_0x16648d[_0xb053('0x1a')](_0x4693d0);return _0x16648d[_0xb053('0x20')](_0xb053('0x21'),_0x6d97de+'-'+_0x1212af+'/'+_0x50d388)[_0xb053('0x1c')](_0x6c61ca);}return null;};}function patchUpdates(_0x5ac6f7){return function(_0x1eea14){try{jsonpatch[_0xb053('0x22')](_0x1eea14,_0x5ac6f7,!![]);}catch(_0x52e7e){return BPromise[_0xb053('0x23')](_0x52e7e);}return _0x1eea14[_0xb053('0x24')]();};}function saveUpdates(_0x87f723,_0x5e1916){return function(_0x361bf3){if(_0x361bf3){return _0x361bf3[_0xb053('0x25')](_0x87f723)[_0xb053('0x26')](function(_0x20b743){return _0x20b743;});}return null;};}function removeEntity(_0x38223a,_0x22d420){return function(_0x7dc46d){if(_0x7dc46d){return _0x7dc46d[_0xb053('0x27')]()[_0xb053('0x26')](function(){_0x38223a[_0xb053('0x1a')](0xcc)[_0xb053('0x1b')]();});}};}function handleEntityNotFound(_0x38cc18,_0x2bdef2){return function(_0x23a9c3){if(!_0x23a9c3){_0x38cc18['sendStatus'](0x194);}return _0x23a9c3;};}function handleError(_0x1304f1,_0x3c01cd){_0x3c01cd=_0x3c01cd||0x1f4;return function(_0x559d8f){logger[_0xb053('0x28')](_0x559d8f[_0xb053('0x29')]);if(_0x559d8f[_0xb053('0x2a')]){delete _0x559d8f[_0xb053('0x2a')];}_0x1304f1[_0xb053('0x1a')](_0x3c01cd)[_0xb053('0x2b')](_0x559d8f);};}exports[_0xb053('0x2c')]=function(_0x108761,_0x26281d){var _0x507e94={},_0x5c9b34={},_0x45d0ab={'count':0x0,'rows':[]};var _0x4009cf=_[_0xb053('0x2d')](db[_0xb053('0x2e')]['rawAttributes'],function(_0x43e140){return{'name':_0x43e140['fieldName'],'type':_0x43e140[_0xb053('0x2f')]['key']};});_0x5c9b34[_0xb053('0x30')]=_[_0xb053('0x2d')](_0x4009cf,_0xb053('0x2a'));_0x5c9b34['query']=_[_0xb053('0x31')](_0x108761['query']);_0x5c9b34[_0xb053('0x32')]=_['intersection'](_0x5c9b34[_0xb053('0x30')],_0x5c9b34[_0xb053('0x33')]);_0x507e94['attributes']=_[_0xb053('0x34')](_0x5c9b34[_0xb053('0x30')],qs[_0xb053('0x35')](_0x108761[_0xb053('0x33')][_0xb053('0x35')]));_0x507e94['attributes']=_0x507e94[_0xb053('0x36')][_0xb053('0x37')]?_0x507e94[_0xb053('0x36')]:_0x5c9b34[_0xb053('0x30')];if(!_0x108761[_0xb053('0x33')]['hasOwnProperty'](_0xb053('0x38'))){_0x507e94[_0xb053('0x39')]=qs['limit'](_0x108761[_0xb053('0x33')]['limit']);_0x507e94['offset']=qs[_0xb053('0x1d')](_0x108761[_0xb053('0x33')]['offset']);}_0x507e94[_0xb053('0x3a')]=qs[_0xb053('0x3b')](_0x108761[_0xb053('0x33')][_0xb053('0x3b')]);_0x507e94[_0xb053('0x3c')]=qs['filters'](_[_0xb053('0x3d')](_0x108761['query'],_0x5c9b34['filters']),_0x4009cf);if(_0x108761[_0xb053('0x33')][_0xb053('0x3e')]){_0x507e94[_0xb053('0x3c')]=_[_0xb053('0x3f')](_0x507e94['where'],{'$or':_[_0xb053('0x2d')](_0x4009cf,function(_0x61d684){if(_0x61d684['type']!=='VIRTUAL'){var _0x2bf8d2={};_0x2bf8d2[_0x61d684[_0xb053('0x2a')]]={'$like':'%'+_0x108761[_0xb053('0x33')][_0xb053('0x3e')]+'%'};return _0x2bf8d2;}})});}_0x507e94=_[_0xb053('0x3f')]({},_0x507e94,_0x108761[_0xb053('0x40')]);var _0x14c0c5={'where':_0x507e94[_0xb053('0x3c')]};return db[_0xb053('0x2e')]['count'](_0x14c0c5)[_0xb053('0x26')](function(_0x1d7ee6){_0x45d0ab[_0xb053('0x1f')]=_0x1d7ee6;if(_0x108761['query'][_0xb053('0x41')]){_0x507e94['include']=[{'all':!![]}];}return db[_0xb053('0x2e')][_0xb053('0x42')](_0x507e94);})[_0xb053('0x26')](function(_0x37bb05){_0x45d0ab['rows']=_0x37bb05;return _0x45d0ab;})[_0xb053('0x26')](respondWithFilteredResult(_0x26281d,_0x507e94))[_0xb053('0x43')](handleError(_0x26281d,null));};exports['show']=function(_0x6e59c7,_0x212e22){var _0x253d02={'raw':![],'where':{'id':_0x6e59c7[_0xb053('0x44')]['id']}},_0x90461f={};_0x90461f[_0xb053('0x30')]=_['keys'](db['FreshsalesAccount'][_0xb053('0x45')]);_0x90461f[_0xb053('0x33')]=_['keys'](_0x6e59c7['query']);_0x90461f['filters']=_[_0xb053('0x34')](_0x90461f[_0xb053('0x30')],_0x90461f[_0xb053('0x33')]);_0x253d02[_0xb053('0x36')]=_['intersection'](_0x90461f[_0xb053('0x30')],qs['fields'](_0x6e59c7['query'][_0xb053('0x35')]));_0x253d02[_0xb053('0x36')]=_0x253d02[_0xb053('0x36')]['length']?_0x253d02[_0xb053('0x36')]:_0x90461f[_0xb053('0x30')];if(_0x6e59c7['query'][_0xb053('0x41')]){_0x253d02[_0xb053('0x46')]=[{'all':!![]}];}_0x253d02=_[_0xb053('0x3f')]({},_0x253d02,_0x6e59c7[_0xb053('0x40')]);return db['FreshsalesAccount'][_0xb053('0x47')](_0x253d02)[_0xb053('0x26')](handleEntityNotFound(_0x212e22,null))[_0xb053('0x26')](respondWithResult(_0x212e22,null))[_0xb053('0x43')](handleError(_0x212e22,null));};exports[_0xb053('0x48')]=function(_0x399c25,_0x3629dd){return db[_0xb053('0x2e')][_0xb053('0x48')](_0x399c25[_0xb053('0x49')],{})[_0xb053('0x26')](respondWithResult(_0x3629dd,0xc9))[_0xb053('0x43')](handleError(_0x3629dd,null));};exports['update']=function(_0x11e0db,_0x15e17c){if(_0x11e0db['body']['id']){delete _0x11e0db[_0xb053('0x49')]['id'];}return db[_0xb053('0x2e')][_0xb053('0x47')]({'where':{'id':_0x11e0db['params']['id']}})[_0xb053('0x26')](handleEntityNotFound(_0x15e17c,null))[_0xb053('0x26')](saveUpdates(_0x11e0db[_0xb053('0x49')],null))['then'](respondWithResult(_0x15e17c,null))[_0xb053('0x43')](handleError(_0x15e17c,null));};exports[_0xb053('0x27')]=function(_0x555e1c,_0xea0139){return db[_0xb053('0x2e')][_0xb053('0x47')]({'where':{'id':_0x555e1c[_0xb053('0x44')]['id']}})[_0xb053('0x26')](handleEntityNotFound(_0xea0139,null))[_0xb053('0x26')](removeEntity(_0xea0139,null))[_0xb053('0x43')](handleError(_0xea0139,null));};exports['getConfigurations']=function(_0x5eef24,_0x2c467c,_0x96178f){var _0x3cc2ea={};var _0x29497a={};var _0x52e2c7;var _0x2c68d2;return db[_0xb053('0x2e')][_0xb053('0x4a')]({'where':{'id':_0x5eef24[_0xb053('0x44')]['id']}})[_0xb053('0x26')](handleEntityNotFound(_0x2c467c,null))[_0xb053('0x26')](function(_0x217b24){if(_0x217b24){_0x52e2c7=_0x217b24;_0x29497a[_0xb053('0x30')]=_[_0xb053('0x31')](db['FreshsalesConfiguration'][_0xb053('0x45')]);_0x29497a['query']=_[_0xb053('0x31')](_0x5eef24[_0xb053('0x33')]);_0x29497a[_0xb053('0x32')]=_[_0xb053('0x34')](_0x29497a[_0xb053('0x30')],_0x29497a[_0xb053('0x33')]);_0x3cc2ea[_0xb053('0x36')]=_[_0xb053('0x34')](_0x29497a[_0xb053('0x30')],qs[_0xb053('0x35')](_0x5eef24['query'][_0xb053('0x35')]));_0x3cc2ea[_0xb053('0x36')]=_0x3cc2ea[_0xb053('0x36')][_0xb053('0x37')]?_0x3cc2ea[_0xb053('0x36')]:_0x29497a[_0xb053('0x30')];_0x3cc2ea['order']=qs['sort'](_0x5eef24[_0xb053('0x33')][_0xb053('0x3b')]);_0x3cc2ea[_0xb053('0x3c')]=qs[_0xb053('0x32')](_[_0xb053('0x3d')](_0x5eef24[_0xb053('0x33')],_0x29497a['filters']));if(_0x5eef24[_0xb053('0x33')]['filter']){_0x3cc2ea[_0xb053('0x3c')]=_[_0xb053('0x3f')](_0x3cc2ea[_0xb053('0x3c')],{'$or':_[_0xb053('0x2d')](_0x3cc2ea[_0xb053('0x36')],function(_0x4b588d){var _0x30c7ef={};_0x30c7ef[_0x4b588d]={'$like':'%'+_0x5eef24['query'][_0xb053('0x3e')]+'%'};return _0x30c7ef;})});}_0x3cc2ea=_[_0xb053('0x3f')]({},_0x3cc2ea,_0x5eef24['options']);return _0x52e2c7[_0xb053('0x4b')](_0x3cc2ea);}})[_0xb053('0x26')](function(_0x4c151f){if(_0x4c151f){_0x2c68d2=_0x4c151f[_0xb053('0x37')];if(!_0x5eef24[_0xb053('0x33')][_0xb053('0x4c')](_0xb053('0x38'))){_0x3cc2ea['limit']=qs['limit'](_0x5eef24[_0xb053('0x33')]['limit']);_0x3cc2ea[_0xb053('0x1d')]=qs[_0xb053('0x1d')](_0x5eef24[_0xb053('0x33')][_0xb053('0x1d')]);}return _0x52e2c7[_0xb053('0x4b')](_0x3cc2ea);}})['then'](function(_0x7aabe9){if(_0x7aabe9){return _0x7aabe9?{'count':_0x2c68d2,'rows':_0x7aabe9}:null;}})[_0xb053('0x26')](respondWithResult(_0x2c467c,null))[_0xb053('0x43')](handleError(_0x2c467c,null));};exports[_0xb053('0x4d')]=function(_0x174fb1,_0x569447,_0x13b8a6){if(_0x174fb1['body']['id']){delete _0x174fb1[_0xb053('0x49')]['id'];}return db[_0xb053('0x2e')][_0xb053('0x4a')]({'where':{'id':_0x174fb1[_0xb053('0x44')]['id']}})[_0xb053('0x26')](handleEntityNotFound(_0x569447,null))[_0xb053('0x26')](function(_0x14a582){if(_0x14a582){_0x174fb1[_0xb053('0x49')][_0xb053('0x4e')]=_0x14a582['id'];_0x174fb1[_0xb053('0x49')][_0xb053('0x4f')]=integrations[_0xb053('0x50')](_0x174fb1['body'][_0xb053('0x51')],_0x174fb1['body']['type']);_0x174fb1['body'][_0xb053('0x52')]=integrations[_0xb053('0x53')](_0x174fb1['body'][_0xb053('0x51')],_0x174fb1[_0xb053('0x49')][_0xb053('0x2f')]);return db[_0xb053('0x54')][_0xb053('0x48')](_0x174fb1[_0xb053('0x49')],{'include':[{'model':db[_0xb053('0x55')],'as':_0xb053('0x4f')},{'model':db[_0xb053('0x55')],'as':_0xb053('0x52')}]});}return null;})[_0xb053('0x26')](respondWithResult(_0x569447,null))[_0xb053('0x43')](handleError(_0x569447,null));};exports['getFields']=function(_0x40f5a8,_0x6d8a88,_0x1013d7){var _0x47c8df='';var _0x580e01='';return db[_0xb053('0x2e')][_0xb053('0x4a')]({'where':{'id':_0x40f5a8[_0xb053('0x44')]['id']},'attributes':['id',_0xb053('0x56'),_0xb053('0x57'),_0xb053('0x58')]})[_0xb053('0x26')](handleEntityNotFound(_0x6d8a88,null))[_0xb053('0x26')](function(_0x346129){if(_0x346129){_0x580e01=_0x346129[_0xb053('0x56')];_0x47c8df=_0x346129[_0xb053('0x57')];var _0x267c6a=_0x346129['remoteUri'][_0xb053('0x59')](-0x1);if(_0x267c6a==='/'){_0x47c8df=_0x47c8df['substring'](0x0,_0x47c8df['lastIndexOf'](_0x267c6a));}return rp({'method':_0xb053('0x5a'),'uri':util[_0xb053('0x5b')]('%s%s',_0x47c8df,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x346129[_0xb053('0x58')]},'json':!![]});}})[_0xb053('0x26')](function(_0x386e5e){if(_0x386e5e){var _0x481b4b=_0x386e5e[_0xb053('0x5c')];var _0x521fd8=![];var _0x3b9892=null;for(_0x3b9892=0x0;_0x3b9892<_0x481b4b[_0xb053('0x37')];_0x3b9892++){if(_0x481b4b[_0x3b9892]['email']===_0x580e01){_0x521fd8=!![];}}if(_0x521fd8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb053('0x5d')});}}})[_0xb053('0x26')](respondWithResult(_0x6d8a88,null))[_0xb053('0x43')](function(_0x5269aa){var _0x3c42d5=_0x40f5a8[_0xb053('0x33')][_0xb053('0x5e')]?0x1f4:_0x5269aa[_0xb053('0x5f')]||0x1f4;logger[_0xb053('0x28')](_0xb053('0x60'),_0xb053('0x61'),_0x3c42d5,JSON['stringify'](_0x5269aa));delete _0x5269aa[_0xb053('0x2a')];if(_0x3c42d5===0x191){_0x3c42d5=0x190;}_0x6d8a88[_0xb053('0x1a')](_0x3c42d5)[_0xb053('0x2b')](_0x40f5a8['query'][_0xb053('0x5e')]?{'message':_0xb053('0x62'),'statusCode':_0x5269aa[_0xb053('0x5f')]}:_0x5269aa);});};
\ No newline at end of file
+var _0x2c1e=['type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','length','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','remoteUri','username','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','offset','limit','undefined','count','set','save','update','then','destroy','sendStatus','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName'];(function(_0x1cbf8d,_0x43ad72){var _0x5c4fca=function(_0x11aaf6){while(--_0x11aaf6){_0x1cbf8d['push'](_0x1cbf8d['shift']());}};_0x5c4fca(++_0x43ad72);}(_0x2c1e,0x162));var _0xe2c1=function(_0x22fb75,_0x14674b){_0x22fb75=_0x22fb75-0x0;var _0x4572e8=_0x2c1e[_0x22fb75];return _0x4572e8;};'use strict';var emlformat=require(_0xe2c1('0x0'));var rimraf=require(_0xe2c1('0x1'));var zipdir=require(_0xe2c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2c1('0x3'));var moment=require('moment');var BPromise=require(_0xe2c1('0x4'));var Mustache=require(_0xe2c1('0x5'));var util=require('util');var path=require(_0xe2c1('0x6'));var sox=require(_0xe2c1('0x7'));var csv=require('to-csv');var ejs=require(_0xe2c1('0x8'));var fs=require('fs');var fs_extra=require(_0xe2c1('0x9'));var _=require(_0xe2c1('0xa'));var squel=require(_0xe2c1('0xb'));var crypto=require(_0xe2c1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe2c1('0xd'));var toCsv=require(_0xe2c1('0xe'));var querystring=require(_0xe2c1('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2c1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe2c1('0x11'));var hardwareService=require(_0xe2c1('0x12'));var logger=require('../../config/logger')(_0xe2c1('0x13'));var utils=require(_0xe2c1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe2c1('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x425db5,_0x28569e){_0x28569e=_0x28569e||0xcc;return function(_0x541811){if(_0x541811){return _0x425db5['sendStatus'](_0x28569e);}return _0x425db5[_0xe2c1('0x16')](_0x28569e)['end']();};}function respondWithResult(_0x8e56c3,_0x541a68){_0x541a68=_0x541a68||0xc8;return function(_0x33ea0d){if(_0x33ea0d){return _0x8e56c3[_0xe2c1('0x16')](_0x541a68)[_0xe2c1('0x17')](_0x33ea0d);}};}function respondWithFilteredResult(_0x2f7f3f,_0x38bd65){return function(_0x2455f2){if(_0x2455f2){var _0x4aedbe=typeof _0x38bd65[_0xe2c1('0x18')]==='undefined'&&typeof _0x38bd65[_0xe2c1('0x19')]===_0xe2c1('0x1a');var _0xf02a3=_0x2455f2[_0xe2c1('0x1b')];var _0x80801e=_0x4aedbe?0x0:_0x38bd65[_0xe2c1('0x18')];var _0x41f914=_0x4aedbe?_0x2455f2[_0xe2c1('0x1b')]:_0x38bd65[_0xe2c1('0x18')]+_0x38bd65[_0xe2c1('0x19')];var _0x4b6230;if(_0x41f914>=_0xf02a3){_0x41f914=_0xf02a3;_0x4b6230=0xc8;}else{_0x4b6230=0xce;}_0x2f7f3f['status'](_0x4b6230);return _0x2f7f3f[_0xe2c1('0x1c')]('Content-Range',_0x80801e+'-'+_0x41f914+'/'+_0xf02a3)[_0xe2c1('0x17')](_0x2455f2);}return null;};}function patchUpdates(_0x1a62aa){return function(_0x4b9727){try{jsonpatch['apply'](_0x4b9727,_0x1a62aa,!![]);}catch(_0x4a9c6c){return BPromise['reject'](_0x4a9c6c);}return _0x4b9727[_0xe2c1('0x1d')]();};}function saveUpdates(_0x11c91b,_0x28a656){return function(_0x264879){if(_0x264879){return _0x264879[_0xe2c1('0x1e')](_0x11c91b)[_0xe2c1('0x1f')](function(_0x5c68d3){return _0x5c68d3;});}return null;};}function removeEntity(_0x18fea7,_0x4e84a8){return function(_0x5b39c9){if(_0x5b39c9){return _0x5b39c9[_0xe2c1('0x20')]()[_0xe2c1('0x1f')](function(){_0x18fea7[_0xe2c1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d804,_0x240e29){return function(_0x318748){if(!_0x318748){_0x50d804[_0xe2c1('0x21')](0x194);}return _0x318748;};}function handleError(_0x4fbe14,_0xa1b594){_0xa1b594=_0xa1b594||0x1f4;return function(_0x5c2895){logger[_0xe2c1('0x22')](_0x5c2895[_0xe2c1('0x23')]);if(_0x5c2895[_0xe2c1('0x24')]){delete _0x5c2895['name'];}_0x4fbe14[_0xe2c1('0x16')](_0xa1b594)[_0xe2c1('0x25')](_0x5c2895);};}exports['index']=function(_0x320b74,_0x44ff15){var _0x5ae224={},_0x4c03d7={},_0x4c0211={'count':0x0,'rows':[]};var _0xb74cf1=_[_0xe2c1('0x26')](db[_0xe2c1('0x27')][_0xe2c1('0x28')],function(_0x5aa3a9){return{'name':_0x5aa3a9[_0xe2c1('0x29')],'type':_0x5aa3a9[_0xe2c1('0x2a')][_0xe2c1('0x2b')]};});_0x4c03d7[_0xe2c1('0x2c')]=_['map'](_0xb74cf1,_0xe2c1('0x24'));_0x4c03d7['query']=_['keys'](_0x320b74[_0xe2c1('0x2d')]);_0x4c03d7[_0xe2c1('0x2e')]=_[_0xe2c1('0x2f')](_0x4c03d7[_0xe2c1('0x2c')],_0x4c03d7[_0xe2c1('0x2d')]);_0x5ae224[_0xe2c1('0x30')]=_['intersection'](_0x4c03d7[_0xe2c1('0x2c')],qs[_0xe2c1('0x31')](_0x320b74[_0xe2c1('0x2d')][_0xe2c1('0x31')]));_0x5ae224[_0xe2c1('0x30')]=_0x5ae224[_0xe2c1('0x30')]['length']?_0x5ae224[_0xe2c1('0x30')]:_0x4c03d7['model'];if(!_0x320b74['query'][_0xe2c1('0x32')](_0xe2c1('0x33'))){_0x5ae224['limit']=qs[_0xe2c1('0x19')](_0x320b74['query']['limit']);_0x5ae224[_0xe2c1('0x18')]=qs[_0xe2c1('0x18')](_0x320b74[_0xe2c1('0x2d')]['offset']);}_0x5ae224[_0xe2c1('0x34')]=qs[_0xe2c1('0x35')](_0x320b74[_0xe2c1('0x2d')][_0xe2c1('0x35')]);_0x5ae224[_0xe2c1('0x36')]=qs['filters'](_[_0xe2c1('0x37')](_0x320b74[_0xe2c1('0x2d')],_0x4c03d7['filters']),_0xb74cf1);if(_0x320b74['query'][_0xe2c1('0x38')]){_0x5ae224[_0xe2c1('0x36')]=_[_0xe2c1('0x39')](_0x5ae224[_0xe2c1('0x36')],{'$or':_[_0xe2c1('0x26')](_0xb74cf1,function(_0x232eeb){if(_0x232eeb[_0xe2c1('0x2a')]!==_0xe2c1('0x3a')){var _0x1a9537={};_0x1a9537[_0x232eeb[_0xe2c1('0x24')]]={'$like':'%'+_0x320b74['query'][_0xe2c1('0x38')]+'%'};return _0x1a9537;}})});}_0x5ae224=_[_0xe2c1('0x39')]({},_0x5ae224,_0x320b74['options']);var _0x2e92dc={'where':_0x5ae224[_0xe2c1('0x36')]};return db['FreshsalesAccount'][_0xe2c1('0x1b')](_0x2e92dc)[_0xe2c1('0x1f')](function(_0x11bbd9){_0x4c0211[_0xe2c1('0x1b')]=_0x11bbd9;if(_0x320b74[_0xe2c1('0x2d')][_0xe2c1('0x3b')]){_0x5ae224[_0xe2c1('0x3c')]=[{'all':!![]}];}return db[_0xe2c1('0x27')][_0xe2c1('0x3d')](_0x5ae224);})[_0xe2c1('0x1f')](function(_0x57db80){_0x4c0211[_0xe2c1('0x3e')]=_0x57db80;return _0x4c0211;})[_0xe2c1('0x1f')](respondWithFilteredResult(_0x44ff15,_0x5ae224))[_0xe2c1('0x3f')](handleError(_0x44ff15,null));};exports[_0xe2c1('0x40')]=function(_0x40a608,_0x1ba750){var _0x1f38db={'raw':![],'where':{'id':_0x40a608['params']['id']}},_0x216d3e={};_0x216d3e[_0xe2c1('0x2c')]=_[_0xe2c1('0x41')](db['FreshsalesAccount']['rawAttributes']);_0x216d3e[_0xe2c1('0x2d')]=_[_0xe2c1('0x41')](_0x40a608[_0xe2c1('0x2d')]);_0x216d3e[_0xe2c1('0x2e')]=_[_0xe2c1('0x2f')](_0x216d3e[_0xe2c1('0x2c')],_0x216d3e[_0xe2c1('0x2d')]);_0x1f38db['attributes']=_[_0xe2c1('0x2f')](_0x216d3e['model'],qs[_0xe2c1('0x31')](_0x40a608[_0xe2c1('0x2d')]['fields']));_0x1f38db[_0xe2c1('0x30')]=_0x1f38db[_0xe2c1('0x30')]['length']?_0x1f38db[_0xe2c1('0x30')]:_0x216d3e[_0xe2c1('0x2c')];if(_0x40a608[_0xe2c1('0x2d')][_0xe2c1('0x3b')]){_0x1f38db[_0xe2c1('0x3c')]=[{'all':!![]}];}_0x1f38db=_[_0xe2c1('0x39')]({},_0x1f38db,_0x40a608[_0xe2c1('0x42')]);return db['FreshsalesAccount'][_0xe2c1('0x43')](_0x1f38db)['then'](handleEntityNotFound(_0x1ba750,null))[_0xe2c1('0x1f')](respondWithResult(_0x1ba750,null))['catch'](handleError(_0x1ba750,null));};exports['create']=function(_0x3d7a69,_0x48be78){return db[_0xe2c1('0x27')][_0xe2c1('0x44')](_0x3d7a69[_0xe2c1('0x45')],{})['then'](respondWithResult(_0x48be78,0xc9))[_0xe2c1('0x3f')](handleError(_0x48be78,null));};exports[_0xe2c1('0x1e')]=function(_0x3aa6ad,_0x46181c){if(_0x3aa6ad[_0xe2c1('0x45')]['id']){delete _0x3aa6ad[_0xe2c1('0x45')]['id'];}return db[_0xe2c1('0x27')][_0xe2c1('0x43')]({'where':{'id':_0x3aa6ad[_0xe2c1('0x46')]['id']}})[_0xe2c1('0x1f')](handleEntityNotFound(_0x46181c,null))[_0xe2c1('0x1f')](saveUpdates(_0x3aa6ad[_0xe2c1('0x45')],null))['then'](respondWithResult(_0x46181c,null))['catch'](handleError(_0x46181c,null));};exports[_0xe2c1('0x20')]=function(_0x41f96d,_0x3c5adc){return db[_0xe2c1('0x27')][_0xe2c1('0x43')]({'where':{'id':_0x41f96d[_0xe2c1('0x46')]['id']}})[_0xe2c1('0x1f')](handleEntityNotFound(_0x3c5adc,null))[_0xe2c1('0x1f')](removeEntity(_0x3c5adc,null))[_0xe2c1('0x3f')](handleError(_0x3c5adc,null));};exports[_0xe2c1('0x47')]=function(_0xcfa34e,_0x5c5b4a,_0x4cb630){var _0x2c2a9a={};var _0x4b993d={};var _0x5849e3;var _0x3dc963;return db[_0xe2c1('0x27')][_0xe2c1('0x48')]({'where':{'id':_0xcfa34e[_0xe2c1('0x46')]['id']}})[_0xe2c1('0x1f')](handleEntityNotFound(_0x5c5b4a,null))[_0xe2c1('0x1f')](function(_0x283f1f){if(_0x283f1f){_0x5849e3=_0x283f1f;_0x4b993d[_0xe2c1('0x2c')]=_[_0xe2c1('0x41')](db[_0xe2c1('0x49')][_0xe2c1('0x28')]);_0x4b993d[_0xe2c1('0x2d')]=_[_0xe2c1('0x41')](_0xcfa34e[_0xe2c1('0x2d')]);_0x4b993d[_0xe2c1('0x2e')]=_[_0xe2c1('0x2f')](_0x4b993d['model'],_0x4b993d[_0xe2c1('0x2d')]);_0x2c2a9a[_0xe2c1('0x30')]=_[_0xe2c1('0x2f')](_0x4b993d[_0xe2c1('0x2c')],qs[_0xe2c1('0x31')](_0xcfa34e[_0xe2c1('0x2d')]['fields']));_0x2c2a9a[_0xe2c1('0x30')]=_0x2c2a9a['attributes']['length']?_0x2c2a9a['attributes']:_0x4b993d['model'];_0x2c2a9a[_0xe2c1('0x34')]=qs['sort'](_0xcfa34e[_0xe2c1('0x2d')][_0xe2c1('0x35')]);_0x2c2a9a[_0xe2c1('0x36')]=qs[_0xe2c1('0x2e')](_[_0xe2c1('0x37')](_0xcfa34e[_0xe2c1('0x2d')],_0x4b993d[_0xe2c1('0x2e')]));if(_0xcfa34e['query']['filter']){_0x2c2a9a['where']=_[_0xe2c1('0x39')](_0x2c2a9a['where'],{'$or':_[_0xe2c1('0x26')](_0x2c2a9a['attributes'],function(_0x4173ec){var _0x5e9c38={};_0x5e9c38[_0x4173ec]={'$like':'%'+_0xcfa34e[_0xe2c1('0x2d')][_0xe2c1('0x38')]+'%'};return _0x5e9c38;})});}_0x2c2a9a=_[_0xe2c1('0x39')]({},_0x2c2a9a,_0xcfa34e['options']);return _0x5849e3[_0xe2c1('0x47')](_0x2c2a9a);}})['then'](function(_0x2aec4f){if(_0x2aec4f){_0x3dc963=_0x2aec4f[_0xe2c1('0x4a')];if(!_0xcfa34e[_0xe2c1('0x2d')]['hasOwnProperty'](_0xe2c1('0x33'))){_0x2c2a9a['limit']=qs['limit'](_0xcfa34e[_0xe2c1('0x2d')][_0xe2c1('0x19')]);_0x2c2a9a[_0xe2c1('0x18')]=qs['offset'](_0xcfa34e[_0xe2c1('0x2d')][_0xe2c1('0x18')]);}return _0x5849e3[_0xe2c1('0x47')](_0x2c2a9a);}})[_0xe2c1('0x1f')](function(_0x441e7f){if(_0x441e7f){return _0x441e7f?{'count':_0x3dc963,'rows':_0x441e7f}:null;}})[_0xe2c1('0x1f')](respondWithResult(_0x5c5b4a,null))['catch'](handleError(_0x5c5b4a,null));};exports[_0xe2c1('0x4b')]=function(_0x4e4d8d,_0x2b7f28,_0x36719e){if(_0x4e4d8d[_0xe2c1('0x45')]['id']){delete _0x4e4d8d[_0xe2c1('0x45')]['id'];}return db[_0xe2c1('0x27')][_0xe2c1('0x48')]({'where':{'id':_0x4e4d8d[_0xe2c1('0x46')]['id']}})[_0xe2c1('0x1f')](handleEntityNotFound(_0x2b7f28,null))[_0xe2c1('0x1f')](function(_0x4b3bd6){if(_0x4b3bd6){_0x4e4d8d['body'][_0xe2c1('0x4c')]=_0x4b3bd6['id'];_0x4e4d8d[_0xe2c1('0x45')]['Subjects']=integrations[_0xe2c1('0x4d')](_0x4e4d8d[_0xe2c1('0x45')]['channel'],_0x4e4d8d[_0xe2c1('0x45')][_0xe2c1('0x2a')]);_0x4e4d8d[_0xe2c1('0x45')][_0xe2c1('0x4e')]=integrations[_0xe2c1('0x4f')](_0x4e4d8d[_0xe2c1('0x45')][_0xe2c1('0x50')],_0x4e4d8d[_0xe2c1('0x45')][_0xe2c1('0x2a')]);return db['FreshsalesConfiguration'][_0xe2c1('0x44')](_0x4e4d8d['body'],{'include':[{'model':db[_0xe2c1('0x51')],'as':_0xe2c1('0x52')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2b7f28,null))[_0xe2c1('0x3f')](handleError(_0x2b7f28,null));};exports[_0xe2c1('0x53')]=function(_0x34083e,_0x59dc1e,_0x24b74c){var _0x1fde7b='';var _0xbd6537='';return db[_0xe2c1('0x27')][_0xe2c1('0x48')]({'where':{'id':_0x34083e['params']['id']},'attributes':['id','username',_0xe2c1('0x54'),'apiKey']})[_0xe2c1('0x1f')](handleEntityNotFound(_0x59dc1e,null))['then'](function(_0x527198){if(_0x527198){_0xbd6537=_0x527198[_0xe2c1('0x55')];_0x1fde7b=_0x527198[_0xe2c1('0x54')];var _0x5404ad=_0x527198[_0xe2c1('0x54')][_0xe2c1('0x56')](-0x1);if(_0x5404ad==='/'){_0x1fde7b=_0x1fde7b['substring'](0x0,_0x1fde7b[_0xe2c1('0x57')](_0x5404ad));}return rp({'method':'GET','uri':util[_0xe2c1('0x58')](_0xe2c1('0x59'),_0x1fde7b,_0xe2c1('0x5a')),'headers':{'Authorization':_0xe2c1('0x5b')+_0x527198['apiKey']},'json':!![]});}})[_0xe2c1('0x1f')](function(_0x2210dc){if(_0x2210dc){var _0x15ca9d=_0x2210dc[_0xe2c1('0x5c')];var _0x1edd84=![];var _0x31a986=null;for(_0x31a986=0x0;_0x31a986<_0x15ca9d['length'];_0x31a986++){if(_0x15ca9d[_0x31a986][_0xe2c1('0x5d')]===_0xbd6537){_0x1edd84=!![];}}if(_0x1edd84){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe2c1('0x5e')});}}})['then'](respondWithResult(_0x59dc1e,null))['catch'](function(_0x1ce167){var _0x100238=_0x34083e[_0xe2c1('0x2d')][_0xe2c1('0x5f')]?0x1f4:_0x1ce167[_0xe2c1('0x60')]||0x1f4;logger[_0xe2c1('0x22')](_0xe2c1('0x61'),_0xe2c1('0x53'),_0x100238,JSON[_0xe2c1('0x62')](_0x1ce167));delete _0x1ce167['name'];if(_0x100238===0x191){_0x100238=0x190;}_0x59dc1e[_0xe2c1('0x16')](_0x100238)[_0xe2c1('0x25')](_0x34083e['query'][_0xe2c1('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x1ce167['statusCode']}:_0x1ce167);});};
\ No newline at end of file
index acacfdf..404105d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x85f059,_0x27d70e){var _0x3520f7=function(_0x5b7c68){while(--_0x5b7c68){_0x85f059['push'](_0x85f059['shift']());}};_0x3520f7(++_0x27d70e);}(_0x187d,0x93));var _0xd187=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x187d[_0x501510];return _0x1e6ee5;};'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'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68b3=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x984863,_0x3fe6a3){var _0x241e5e=function(_0x42d2e6){while(--_0x42d2e6){_0x984863['push'](_0x984863['shift']());}};_0x241e5e(++_0x3fe6a3);}(_0x68b3,0x1d8));var _0x368b=function(_0x7b8ad7,_0x47128f){_0x7b8ad7=_0x7b8ad7-0x0;var _0x5c65c5=_0x68b3[_0x7b8ad7];return _0x5c65c5;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x368b('0x9'));module[_0x368b('0xa')]=function(_0x104dad,_0x23584a){return _0x104dad[_0x368b('0xb')](_0x368b('0xc'),attributes,{'tableName':_0x368b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9be360e..95ea830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2fbfc6,_0x1d888d){var _0x5a2521=function(_0x1f2550){while(--_0x1f2550){_0x2fbfc6['push'](_0x2fbfc6['shift']());}};_0x5a2521(++_0x1d888d);}(_0x3a6d,0x143));var _0xd3a6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3a6d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});};
\ No newline at end of file
+var _0x160f=['../../config/environment','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')]({'raw':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8185[_0xf160('0x19')]?_0x4b8185['options'][_0xf160('0x1b')]||null:null,'attributes':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')]['attributes']||null:null,'limit':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1c')]||null:null,'include':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4b8185['options'][_0xf160('0x1d')],function(_0x28bf27){return{'model':db[_0x28bf27[_0xf160('0x1f')]],'as':_0x28bf27['as'],'attributes':_0x28bf27[_0xf160('0x20')],'include':_0x28bf27['include']?_[_0xf160('0x1e')](_0x28bf27[_0xf160('0x1d')],function(_0x4a8003){return{'model':db[_0x4a8003['model']],'as':_0x4a8003['as'],'attributes':_0x4a8003[_0xf160('0x20')],'include':_0x4a8003[_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4a8003['include'],function(_0xcfa9bd){return{'model':db[_0xcfa9bd[_0xf160('0x1f')]],'as':_0xcfa9bd['as'],'attributes':_0xcfa9bd[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x135e0f){logger[_0xf160('0xd')]('GetFreshsalesAccount',_0x4b8185);logger['debug']('GetFreshsalesAccount',_0x4b8185,JSON[_0xf160('0x11')](_0x135e0f));_0x1cf6ba(_0x135e0f);})[_0xf160('0x15')](function(_0xcaab39){logger[_0xf160('0x12')](_0xf160('0x16'),_0xcaab39['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0xcaab39[_0xf160('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4ce478){var _0x22c2e3=this;return new Promise(function(_0x3a35b3,_0x5497f6){return db[_0xf160('0x17')][_0xf160('0x21')]({'raw':_0x4ce478['options']?_0x4ce478['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ce478['options']?_0x4ce478[_0xf160('0x19')][_0xf160('0x1b')]||null:null,'attributes':_0x4ce478[_0xf160('0x19')]?_0x4ce478[_0xf160('0x19')][_0xf160('0x20')]||null:null,'include':_0x4ce478[_0xf160('0x19')]?_0x4ce478['options']['include']?_['map'](_0x4ce478[_0xf160('0x19')]['include'],function(_0x5c65d2){return{'model':db[_0x5c65d2[_0xf160('0x1f')]],'as':_0x5c65d2['as'],'attributes':_0x5c65d2[_0xf160('0x20')],'include':_0x5c65d2['include']?_[_0xf160('0x1e')](_0x5c65d2[_0xf160('0x1d')],function(_0x272efe){return{'model':db[_0x272efe[_0xf160('0x1f')]],'as':_0x272efe['as'],'attributes':_0x272efe[_0xf160('0x20')],'include':_0x272efe['include']?_[_0xf160('0x1e')](_0x272efe[_0xf160('0x1d')],function(_0x15070a){return{'model':db[_0x15070a['model']],'as':_0x15070a['as'],'attributes':_0x15070a[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x1e4bd6){logger[_0xf160('0xd')](_0xf160('0x22'),_0x4ce478);logger[_0xf160('0x23')]('ShowFreshsalesAccount',_0x4ce478,JSON['stringify'](_0x1e4bd6));_0x3a35b3(_0x1e4bd6);})[_0xf160('0x15')](function(_0x21c248){logger[_0xf160('0x12')](_0xf160('0x22'),_0x21c248[_0xf160('0x14')],_0x4ce478);_0x5497f6(_0x22c2e3[_0xf160('0x12')](0x1f4,_0x21c248[_0xf160('0x14')]));});});};
\ No newline at end of file
index 0e64e30..d7f1064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbefe=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','getDescriptions','/:id/fields','getFields','post','put','update'];(function(_0x383c94,_0x57d6b7){var _0x4df493=function(_0xd34d59){while(--_0xd34d59){_0x383c94['push'](_0x383c94['shift']());}};_0x4df493(++_0x57d6b7);}(_0xbefe,0x15c));var _0xebef=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0xbefe[_0x4de1b5];return _0xed55cf;};'use strict';var multer=require('multer');var util=require(_0xebef('0x0'));var path=require(_0xebef('0x1'));var timeout=require(_0xebef('0x2'));var express=require(_0xebef('0x3'));var router=express[_0xebef('0x4')]();var fs_extra=require(_0xebef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var controller=require(_0xebef('0x8'));router[_0xebef('0x9')]('/',auth[_0xebef('0xa')](),controller[_0xebef('0xb')]);router[_0xebef('0x9')](_0xebef('0xc'),auth[_0xebef('0xa')](),controller['show']);router[_0xebef('0x9')]('/:id/subjects',auth[_0xebef('0xa')](),controller[_0xebef('0xd')]);router[_0xebef('0x9')]('/:id/descriptions',auth[_0xebef('0xa')](),controller[_0xebef('0xe')]);router[_0xebef('0x9')](_0xebef('0xf'),auth['isAuthenticated'](),controller[_0xebef('0x10')]);router[_0xebef('0x11')]('/',auth[_0xebef('0xa')](),controller['create']);router[_0xebef('0x12')](_0xebef('0xc'),auth[_0xebef('0xa')](),controller[_0xebef('0x13')]);router[_0xebef('0x14')](_0xebef('0xc'),auth[_0xebef('0xa')](),controller[_0xebef('0x15')]);module[_0xebef('0x16')]=router;
\ No newline at end of file
+var _0x5306=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/descriptions','/:id/fields','getFields','post','create','update','delete','destroy'];(function(_0x19bd29,_0x2404f0){var _0xae1e33=function(_0x1e5c40){while(--_0x1e5c40){_0x19bd29['push'](_0x19bd29['shift']());}};_0xae1e33(++_0x2404f0);}(_0x5306,0xfe));var _0x6530=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5306[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6530('0x0'));var path=require('path');var timeout=require(_0x6530('0x1'));var express=require(_0x6530('0x2'));var router=express[_0x6530('0x3')]();var fs_extra=require(_0x6530('0x4'));var auth=require(_0x6530('0x5'));var interaction=require(_0x6530('0x6'));var config=require(_0x6530('0x7'));var controller=require(_0x6530('0x8'));router[_0x6530('0x9')]('/',auth[_0x6530('0xa')](),controller[_0x6530('0xb')]);router[_0x6530('0x9')](_0x6530('0xc'),auth['isAuthenticated'](),controller[_0x6530('0xd')]);router[_0x6530('0x9')]('/:id/subjects',auth[_0x6530('0xa')](),controller['getSubjects']);router[_0x6530('0x9')](_0x6530('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6530('0x9')](_0x6530('0xf'),auth['isAuthenticated'](),controller[_0x6530('0x10')]);router[_0x6530('0x11')]('/',auth[_0x6530('0xa')](),controller[_0x6530('0x12')]);router['put'](_0x6530('0xc'),auth['isAuthenticated'](),controller[_0x6530('0x13')]);router[_0x6530('0x14')](_0x6530('0xc'),auth[_0x6530('0xa')](),controller[_0x6530('0x15')]);module[_0x6530('0x16')]=router;
\ No newline at end of file
index 1b7641d..37e1b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x580c=['sequelize','exports','STRING'];(function(_0x23a97d,_0x342dc3){var _0x36fee9=function(_0x2b3bc2){while(--_0x2b3bc2){_0x23a97d['push'](_0x23a97d['shift']());}};_0x36fee9(++_0x342dc3);}(_0x580c,0x16e));var _0xc580=function(_0x49348a,_0x2ca546){_0x49348a=_0x49348a-0x0;var _0x209919=_0x580c[_0x49348a];return _0x209919;};'use strict';var Sequelize=require(_0xc580('0x0'));module[_0xc580('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc580('0x2')]}};
\ No newline at end of file
+var _0x2a42=['STRING','sequelize','exports'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x2a42,0xb2));var _0x22a4=function(_0x18644b,_0x5b2e62){_0x18644b=_0x18644b-0x0;var _0x287ebe=_0x2a42[_0x18644b];return _0x287ebe;};'use strict';var Sequelize=require(_0x22a4('0x0'));module[_0x22a4('0x1')]={'name':{'type':Sequelize[_0x22a4('0x2')]},'description':{'type':Sequelize[_0x22a4('0x2')]}};
\ No newline at end of file
index f0411fc..e80161c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea44=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','update','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5b02a2,_0x3bd051){var _0x3ef65e=function(_0x4644cd){while(--_0x4644cd){_0x5b02a2['push'](_0x5b02a2['shift']());}};_0x3ef65e(++_0x3bd051);}(_0xea44,0xf6));var _0x4ea4=function(_0x2fe5ec,_0x49baeb){_0x2fe5ec=_0x2fe5ec-0x0;var _0x124fb9=_0xea44[_0x2fe5ec];return _0x124fb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ea4('0x0'));var zipdir=require(_0x4ea4('0x1'));var jsonpatch=require(_0x4ea4('0x2'));var rp=require(_0x4ea4('0x3'));var moment=require(_0x4ea4('0x4'));var BPromise=require(_0x4ea4('0x5'));var Mustache=require(_0x4ea4('0x6'));var util=require(_0x4ea4('0x7'));var path=require(_0x4ea4('0x8'));var sox=require('sox');var csv=require(_0x4ea4('0x9'));var ejs=require(_0x4ea4('0xa'));var fs=require('fs');var fs_extra=require(_0x4ea4('0xb'));var _=require(_0x4ea4('0xc'));var squel=require(_0x4ea4('0xd'));var crypto=require('crypto');var jsforce=require(_0x4ea4('0xe'));var deskjs=require(_0x4ea4('0xf'));var toCsv=require(_0x4ea4('0x9'));var querystring=require(_0x4ea4('0x10'));var Papa=require(_0x4ea4('0x11'));var Redis=require(_0x4ea4('0x12'));var authService=require(_0x4ea4('0x13'));var qs=require(_0x4ea4('0x14'));var as=require(_0x4ea4('0x15'));var hardwareService=require(_0x4ea4('0x16'));var logger=require(_0x4ea4('0x17'))(_0x4ea4('0x18'));var utils=require(_0x4ea4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4ea4('0x1a'));var db=require(_0x4ea4('0x1b'))['db'];function respondWithStatusCode(_0x2f397c,_0x24f8b0){_0x24f8b0=_0x24f8b0||0xcc;return function(_0x35f26a){if(_0x35f26a){return _0x2f397c[_0x4ea4('0x1c')](_0x24f8b0);}return _0x2f397c[_0x4ea4('0x1d')](_0x24f8b0)[_0x4ea4('0x1e')]();};}function respondWithResult(_0x18fb3a,_0x399ad4){_0x399ad4=_0x399ad4||0xc8;return function(_0x1fb93e){if(_0x1fb93e){return _0x18fb3a[_0x4ea4('0x1d')](_0x399ad4)['json'](_0x1fb93e);}};}function respondWithFilteredResult(_0x1ac17c,_0x4bcb5c){return function(_0x4b73ef){if(_0x4b73ef){var _0x4a11c0=typeof _0x4bcb5c[_0x4ea4('0x1f')]===_0x4ea4('0x20')&&typeof _0x4bcb5c[_0x4ea4('0x21')]==='undefined';var _0x15cb80=_0x4b73ef['count'];var _0x169bed=_0x4a11c0?0x0:_0x4bcb5c[_0x4ea4('0x1f')];var _0x18d8e7=_0x4a11c0?_0x4b73ef[_0x4ea4('0x22')]:_0x4bcb5c[_0x4ea4('0x1f')]+_0x4bcb5c['limit'];var _0x208200;if(_0x18d8e7>=_0x15cb80){_0x18d8e7=_0x15cb80;_0x208200=0xc8;}else{_0x208200=0xce;}_0x1ac17c[_0x4ea4('0x1d')](_0x208200);return _0x1ac17c[_0x4ea4('0x23')](_0x4ea4('0x24'),_0x169bed+'-'+_0x18d8e7+'/'+_0x15cb80)['json'](_0x4b73ef);}return null;};}function patchUpdates(_0x702b68){return function(_0x44b354){try{jsonpatch['apply'](_0x44b354,_0x702b68,!![]);}catch(_0x4fc34d){return BPromise[_0x4ea4('0x25')](_0x4fc34d);}return _0x44b354[_0x4ea4('0x26')]();};}function saveUpdates(_0x4f557d,_0x17cae8){return function(_0x2ebdfa){if(_0x2ebdfa){return _0x2ebdfa['update'](_0x4f557d)[_0x4ea4('0x27')](function(_0x23eb1b){return _0x23eb1b;});}return null;};}function removeEntity(_0x241dd3,_0x4432c2){return function(_0x4c6281){if(_0x4c6281){return _0x4c6281[_0x4ea4('0x28')]()[_0x4ea4('0x27')](function(){_0x241dd3['status'](0xcc)[_0x4ea4('0x1e')]();});}};}function handleEntityNotFound(_0x2e5c2a,_0x1690b5){return function(_0x376fb7){if(!_0x376fb7){_0x2e5c2a[_0x4ea4('0x1c')](0x194);}return _0x376fb7;};}function handleError(_0x6856c9,_0x8da0a){_0x8da0a=_0x8da0a||0x1f4;return function(_0x230989){logger[_0x4ea4('0x29')](_0x230989['stack']);if(_0x230989[_0x4ea4('0x2a')]){delete _0x230989['name'];}_0x6856c9[_0x4ea4('0x1d')](_0x8da0a)[_0x4ea4('0x2b')](_0x230989);};}exports[_0x4ea4('0x2c')]=function(_0x367fdb,_0x371c27){var _0x1438db={},_0x2b8466={},_0x3451ea={'count':0x0,'rows':[]};var _0x466dcc=_['map'](db[_0x4ea4('0x2d')][_0x4ea4('0x2e')],function(_0x45025c){return{'name':_0x45025c[_0x4ea4('0x2f')],'type':_0x45025c['type'][_0x4ea4('0x30')]};});_0x2b8466[_0x4ea4('0x31')]=_[_0x4ea4('0x32')](_0x466dcc,_0x4ea4('0x2a'));_0x2b8466[_0x4ea4('0x33')]=_[_0x4ea4('0x34')](_0x367fdb[_0x4ea4('0x33')]);_0x2b8466[_0x4ea4('0x35')]=_[_0x4ea4('0x36')](_0x2b8466[_0x4ea4('0x31')],_0x2b8466[_0x4ea4('0x33')]);_0x1438db['attributes']=_[_0x4ea4('0x36')](_0x2b8466[_0x4ea4('0x31')],qs['fields'](_0x367fdb[_0x4ea4('0x33')][_0x4ea4('0x37')]));_0x1438db[_0x4ea4('0x38')]=_0x1438db['attributes'][_0x4ea4('0x39')]?_0x1438db[_0x4ea4('0x38')]:_0x2b8466[_0x4ea4('0x31')];if(!_0x367fdb[_0x4ea4('0x33')]['hasOwnProperty'](_0x4ea4('0x3a'))){_0x1438db[_0x4ea4('0x21')]=qs[_0x4ea4('0x21')](_0x367fdb[_0x4ea4('0x33')]['limit']);_0x1438db[_0x4ea4('0x1f')]=qs[_0x4ea4('0x1f')](_0x367fdb[_0x4ea4('0x33')][_0x4ea4('0x1f')]);}_0x1438db[_0x4ea4('0x3b')]=qs[_0x4ea4('0x3c')](_0x367fdb[_0x4ea4('0x33')][_0x4ea4('0x3c')]);_0x1438db[_0x4ea4('0x3d')]=qs[_0x4ea4('0x35')](_[_0x4ea4('0x3e')](_0x367fdb[_0x4ea4('0x33')],_0x2b8466['filters']),_0x466dcc);if(_0x367fdb[_0x4ea4('0x33')]['filter']){_0x1438db['where']=_[_0x4ea4('0x3f')](_0x1438db['where'],{'$or':_[_0x4ea4('0x32')](_0x466dcc,function(_0xcaff77){if(_0xcaff77[_0x4ea4('0x40')]!=='VIRTUAL'){var _0x1a04a4={};_0x1a04a4[_0xcaff77[_0x4ea4('0x2a')]]={'$like':'%'+_0x367fdb['query'][_0x4ea4('0x41')]+'%'};return _0x1a04a4;}})});}_0x1438db=_[_0x4ea4('0x3f')]({},_0x1438db,_0x367fdb['options']);var _0x3ac5a5={'where':_0x1438db[_0x4ea4('0x3d')]};return db['FreshsalesConfiguration'][_0x4ea4('0x22')](_0x3ac5a5)[_0x4ea4('0x27')](function(_0x356e16){_0x3451ea[_0x4ea4('0x22')]=_0x356e16;if(_0x367fdb[_0x4ea4('0x33')][_0x4ea4('0x42')]){_0x1438db[_0x4ea4('0x43')]=[{'all':!![]}];}return db[_0x4ea4('0x2d')][_0x4ea4('0x44')](_0x1438db);})['then'](function(_0x403d81){_0x3451ea[_0x4ea4('0x45')]=_0x403d81;return _0x3451ea;})[_0x4ea4('0x27')](respondWithFilteredResult(_0x371c27,_0x1438db))['catch'](handleError(_0x371c27,null));};exports[_0x4ea4('0x46')]=function(_0x299637,_0x2e7ebb){var _0xa78df0={'raw':![],'where':{'id':_0x299637[_0x4ea4('0x47')]['id']}},_0x346b16={};_0x346b16[_0x4ea4('0x31')]=_[_0x4ea4('0x34')](db[_0x4ea4('0x2d')][_0x4ea4('0x2e')]);_0x346b16[_0x4ea4('0x33')]=_[_0x4ea4('0x34')](_0x299637[_0x4ea4('0x33')]);_0x346b16[_0x4ea4('0x35')]=_['intersection'](_0x346b16['model'],_0x346b16[_0x4ea4('0x33')]);_0xa78df0[_0x4ea4('0x38')]=_['intersection'](_0x346b16[_0x4ea4('0x31')],qs[_0x4ea4('0x37')](_0x299637['query']['fields']));_0xa78df0['attributes']=_0xa78df0[_0x4ea4('0x38')][_0x4ea4('0x39')]?_0xa78df0[_0x4ea4('0x38')]:_0x346b16[_0x4ea4('0x31')];if(_0x299637[_0x4ea4('0x33')][_0x4ea4('0x42')]){_0xa78df0[_0x4ea4('0x43')]=[{'all':!![]}];}_0xa78df0=_[_0x4ea4('0x3f')]({},_0xa78df0,_0x299637[_0x4ea4('0x48')]);return db['FreshsalesConfiguration'][_0x4ea4('0x49')](_0xa78df0)[_0x4ea4('0x27')](handleEntityNotFound(_0x2e7ebb,null))['then'](respondWithResult(_0x2e7ebb,null))[_0x4ea4('0x4a')](handleError(_0x2e7ebb,null));};exports[_0x4ea4('0x4b')]=function(_0x398727,_0xa34fd9){return db[_0x4ea4('0x2d')][_0x4ea4('0x4b')](_0x398727['body'],{})[_0x4ea4('0x27')](respondWithResult(_0xa34fd9,0xc9))[_0x4ea4('0x4a')](handleError(_0xa34fd9,null));};exports[_0x4ea4('0x4c')]=function(_0x882564,_0x3584db){if(_0x882564[_0x4ea4('0x4d')]['id']){delete _0x882564['body']['id'];}return db[_0x4ea4('0x2d')]['find']({'where':{'id':_0x882564['params']['id']}})[_0x4ea4('0x27')](handleEntityNotFound(_0x3584db,null))[_0x4ea4('0x27')](saveUpdates(_0x882564[_0x4ea4('0x4d')],null))[_0x4ea4('0x27')](respondWithResult(_0x3584db,null))[_0x4ea4('0x4a')](handleError(_0x3584db,null));};exports[_0x4ea4('0x28')]=function(_0x379efe,_0x833394){return db[_0x4ea4('0x2d')][_0x4ea4('0x49')]({'where':{'id':_0x379efe[_0x4ea4('0x47')]['id']}})[_0x4ea4('0x27')](handleEntityNotFound(_0x833394,null))[_0x4ea4('0x27')](removeEntity(_0x833394,null))[_0x4ea4('0x4a')](handleError(_0x833394,null));};exports[_0x4ea4('0x4e')]=function(_0x323ebd,_0x55c46d,_0x2accb5){var _0x2eef84={};var _0x5886b5={};var _0x2cc579;var _0x45c84;return db[_0x4ea4('0x2d')][_0x4ea4('0x4f')]({'where':{'id':_0x323ebd['params']['id']}})[_0x4ea4('0x27')](handleEntityNotFound(_0x55c46d,null))['then'](function(_0x470e3f){if(_0x470e3f){_0x2cc579=_0x470e3f;_0x5886b5[_0x4ea4('0x31')]=_['keys'](db[_0x4ea4('0x50')][_0x4ea4('0x2e')]);_0x5886b5[_0x4ea4('0x33')]=_[_0x4ea4('0x34')](_0x323ebd[_0x4ea4('0x33')]);_0x5886b5[_0x4ea4('0x35')]=_[_0x4ea4('0x36')](_0x5886b5[_0x4ea4('0x31')],_0x5886b5[_0x4ea4('0x33')]);_0x2eef84['attributes']=_['intersection'](_0x5886b5[_0x4ea4('0x31')],qs[_0x4ea4('0x37')](_0x323ebd[_0x4ea4('0x33')][_0x4ea4('0x37')]));_0x2eef84[_0x4ea4('0x38')]=_0x2eef84['attributes']['length']?_0x2eef84[_0x4ea4('0x38')]:_0x5886b5[_0x4ea4('0x31')];_0x2eef84[_0x4ea4('0x3b')]=qs[_0x4ea4('0x3c')](_0x323ebd['query'][_0x4ea4('0x3c')]);_0x2eef84[_0x4ea4('0x3d')]=qs[_0x4ea4('0x35')](_[_0x4ea4('0x3e')](_0x323ebd[_0x4ea4('0x33')],_0x5886b5[_0x4ea4('0x35')]));if(_0x323ebd[_0x4ea4('0x33')][_0x4ea4('0x41')]){_0x2eef84[_0x4ea4('0x3d')]=_[_0x4ea4('0x3f')](_0x2eef84['where'],{'$or':_['map'](_0x2eef84[_0x4ea4('0x38')],function(_0x590f34){var _0x1b4105={};_0x1b4105[_0x590f34]={'$like':'%'+_0x323ebd['query']['filter']+'%'};return _0x1b4105;})});}_0x2eef84=_['merge']({},_0x2eef84,_0x323ebd[_0x4ea4('0x48')]);return _0x2cc579['getSubjects'](_0x2eef84);}})['then'](function(_0x193de5){if(_0x193de5){_0x45c84=_0x193de5[_0x4ea4('0x39')];if(!_0x323ebd['query'][_0x4ea4('0x51')]('nolimit')){_0x2eef84[_0x4ea4('0x21')]=qs[_0x4ea4('0x21')](_0x323ebd[_0x4ea4('0x33')][_0x4ea4('0x21')]);_0x2eef84[_0x4ea4('0x1f')]=qs['offset'](_0x323ebd['query'][_0x4ea4('0x1f')]);}return _0x2cc579[_0x4ea4('0x4e')](_0x2eef84);}})[_0x4ea4('0x27')](function(_0x17329d){if(_0x17329d){return _0x17329d?{'count':_0x45c84,'rows':_0x17329d}:null;}})['then'](respondWithResult(_0x55c46d,null))[_0x4ea4('0x4a')](handleError(_0x55c46d,null));};exports[_0x4ea4('0x52')]=function(_0x487447,_0x165ce8,_0x21c12a){var _0x2f7954={};var _0x4e1e33={};var _0x58216a;var _0x5c18be;return db[_0x4ea4('0x2d')][_0x4ea4('0x4f')]({'where':{'id':_0x487447['params']['id']}})[_0x4ea4('0x27')](handleEntityNotFound(_0x165ce8,null))[_0x4ea4('0x27')](function(_0x4a75ee){if(_0x4a75ee){_0x58216a=_0x4a75ee;_0x4e1e33[_0x4ea4('0x31')]=_[_0x4ea4('0x34')](db['FreshsalesField'][_0x4ea4('0x2e')]);_0x4e1e33[_0x4ea4('0x33')]=_['keys'](_0x487447[_0x4ea4('0x33')]);_0x4e1e33['filters']=_[_0x4ea4('0x36')](_0x4e1e33[_0x4ea4('0x31')],_0x4e1e33['query']);_0x2f7954[_0x4ea4('0x38')]=_[_0x4ea4('0x36')](_0x4e1e33['model'],qs[_0x4ea4('0x37')](_0x487447[_0x4ea4('0x33')]['fields']));_0x2f7954['attributes']=_0x2f7954[_0x4ea4('0x38')][_0x4ea4('0x39')]?_0x2f7954['attributes']:_0x4e1e33[_0x4ea4('0x31')];_0x2f7954[_0x4ea4('0x3b')]=qs[_0x4ea4('0x3c')](_0x487447[_0x4ea4('0x33')][_0x4ea4('0x3c')]);_0x2f7954[_0x4ea4('0x3d')]=qs[_0x4ea4('0x35')](_[_0x4ea4('0x3e')](_0x487447[_0x4ea4('0x33')],_0x4e1e33[_0x4ea4('0x35')]));if(_0x487447[_0x4ea4('0x33')][_0x4ea4('0x41')]){_0x2f7954[_0x4ea4('0x3d')]=_[_0x4ea4('0x3f')](_0x2f7954[_0x4ea4('0x3d')],{'$or':_[_0x4ea4('0x32')](_0x2f7954[_0x4ea4('0x38')],function(_0xfb4ff3){var _0x1eabbb={};_0x1eabbb[_0xfb4ff3]={'$like':'%'+_0x487447['query']['filter']+'%'};return _0x1eabbb;})});}_0x2f7954=_[_0x4ea4('0x3f')]({},_0x2f7954,_0x487447[_0x4ea4('0x48')]);return _0x58216a[_0x4ea4('0x52')](_0x2f7954);}})['then'](function(_0x1bd2c6){if(_0x1bd2c6){_0x5c18be=_0x1bd2c6['length'];if(!_0x487447[_0x4ea4('0x33')]['hasOwnProperty'](_0x4ea4('0x3a'))){_0x2f7954[_0x4ea4('0x21')]=qs[_0x4ea4('0x21')](_0x487447['query']['limit']);_0x2f7954[_0x4ea4('0x1f')]=qs[_0x4ea4('0x1f')](_0x487447[_0x4ea4('0x33')][_0x4ea4('0x1f')]);}return _0x58216a[_0x4ea4('0x52')](_0x2f7954);}})[_0x4ea4('0x27')](function(_0x2bd52e){if(_0x2bd52e){return _0x2bd52e?{'count':_0x5c18be,'rows':_0x2bd52e}:null;}})['then'](respondWithResult(_0x165ce8,null))[_0x4ea4('0x4a')](handleError(_0x165ce8,null));};exports['getFields']=function(_0x166935,_0x2317c6,_0x42528f){var _0x3f3915={};var _0x5dcd06={};var _0x163613;var _0x4c0bfa;return db[_0x4ea4('0x2d')][_0x4ea4('0x4f')]({'where':{'id':_0x166935[_0x4ea4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2317c6,null))[_0x4ea4('0x27')](function(_0x5e4999){if(_0x5e4999){_0x163613=_0x5e4999;_0x5dcd06['model']=_[_0x4ea4('0x34')](db['FreshsalesField'][_0x4ea4('0x2e')]);_0x5dcd06[_0x4ea4('0x33')]=_[_0x4ea4('0x34')](_0x166935[_0x4ea4('0x33')]);_0x5dcd06[_0x4ea4('0x35')]=_[_0x4ea4('0x36')](_0x5dcd06['model'],_0x5dcd06[_0x4ea4('0x33')]);_0x3f3915[_0x4ea4('0x38')]=_[_0x4ea4('0x36')](_0x5dcd06[_0x4ea4('0x31')],qs['fields'](_0x166935[_0x4ea4('0x33')][_0x4ea4('0x37')]));_0x3f3915[_0x4ea4('0x38')]=_0x3f3915[_0x4ea4('0x38')][_0x4ea4('0x39')]?_0x3f3915['attributes']:_0x5dcd06['model'];_0x3f3915[_0x4ea4('0x3b')]=qs[_0x4ea4('0x3c')](_0x166935['query'][_0x4ea4('0x3c')]);_0x3f3915[_0x4ea4('0x3d')]=qs['filters'](_['pick'](_0x166935['query'],_0x5dcd06['filters']));if(_0x166935[_0x4ea4('0x33')][_0x4ea4('0x41')]){_0x3f3915[_0x4ea4('0x3d')]=_[_0x4ea4('0x3f')](_0x3f3915['where'],{'$or':_['map'](_0x3f3915['attributes'],function(_0x289dbd){var _0x232a52={};_0x232a52[_0x289dbd]={'$like':'%'+_0x166935[_0x4ea4('0x33')][_0x4ea4('0x41')]+'%'};return _0x232a52;})});}_0x3f3915=_['merge']({},_0x3f3915,_0x166935[_0x4ea4('0x48')]);return _0x163613[_0x4ea4('0x53')](_0x3f3915);}})[_0x4ea4('0x27')](function(_0xa97f7b){if(_0xa97f7b){_0x4c0bfa=_0xa97f7b[_0x4ea4('0x39')];if(!_0x166935[_0x4ea4('0x33')][_0x4ea4('0x51')](_0x4ea4('0x3a'))){_0x3f3915[_0x4ea4('0x21')]=qs[_0x4ea4('0x21')](_0x166935[_0x4ea4('0x33')][_0x4ea4('0x21')]);_0x3f3915['offset']=qs['offset'](_0x166935['query']['offset']);}return _0x163613[_0x4ea4('0x53')](_0x3f3915);}})[_0x4ea4('0x27')](function(_0x4be736){if(_0x4be736){return _0x4be736?{'count':_0x4c0bfa,'rows':_0x4be736}:null;}})['then'](respondWithResult(_0x2317c6,null))[_0x4ea4('0x4a')](handleError(_0x2317c6,null));};
\ No newline at end of file
+var _0x6bef=['mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','FreshsalesConfiguration','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','length','find','catch','create','body','params','getSubjects','findOne','FreshsalesField','rawAttributes','order','map','getDescriptions','pick','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x52756e,_0x1dfa40){var _0x20255c=function(_0x4dbd57){while(--_0x4dbd57){_0x52756e['push'](_0x52756e['shift']());}};_0x20255c(++_0x1dfa40);}(_0x6bef,0x152));var _0xf6be=function(_0x228c97,_0x198beb){_0x228c97=_0x228c97-0x0;var _0x54d858=_0x6bef[_0x228c97];return _0x54d858;};'use strict';var emlformat=require(_0xf6be('0x0'));var rimraf=require(_0xf6be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6be('0x2'));var rp=require(_0xf6be('0x3'));var moment=require(_0xf6be('0x4'));var BPromise=require(_0xf6be('0x5'));var Mustache=require(_0xf6be('0x6'));var util=require(_0xf6be('0x7'));var path=require('path');var sox=require(_0xf6be('0x8'));var csv=require('to-csv');var ejs=require(_0xf6be('0x9'));var fs=require('fs');var fs_extra=require(_0xf6be('0xa'));var _=require(_0xf6be('0xb'));var squel=require(_0xf6be('0xc'));var crypto=require(_0xf6be('0xd'));var jsforce=require(_0xf6be('0xe'));var deskjs=require(_0xf6be('0xf'));var toCsv=require(_0xf6be('0x10'));var querystring=require('querystring');var Papa=require(_0xf6be('0x11'));var Redis=require(_0xf6be('0x12'));var authService=require(_0xf6be('0x13'));var qs=require(_0xf6be('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6be('0x15'));var logger=require(_0xf6be('0x16'))(_0xf6be('0x17'));var utils=require(_0xf6be('0x18'));var config=require(_0xf6be('0x19'));var licenseUtil=require(_0xf6be('0x1a'));var db=require(_0xf6be('0x1b'))['db'];function respondWithStatusCode(_0x224844,_0x478270){_0x478270=_0x478270||0xcc;return function(_0x4d365b){if(_0x4d365b){return _0x224844[_0xf6be('0x1c')](_0x478270);}return _0x224844[_0xf6be('0x1d')](_0x478270)[_0xf6be('0x1e')]();};}function respondWithResult(_0x3b874a,_0x374c39){_0x374c39=_0x374c39||0xc8;return function(_0x38f255){if(_0x38f255){return _0x3b874a['status'](_0x374c39)[_0xf6be('0x1f')](_0x38f255);}};}function respondWithFilteredResult(_0x5a18b4,_0x160379){return function(_0x4980c1){if(_0x4980c1){var _0x33a642=typeof _0x160379[_0xf6be('0x20')]===_0xf6be('0x21')&&typeof _0x160379['limit']==='undefined';var _0x337951=_0x4980c1['count'];var _0x14defa=_0x33a642?0x0:_0x160379[_0xf6be('0x20')];var _0x5cd8a6=_0x33a642?_0x4980c1['count']:_0x160379[_0xf6be('0x20')]+_0x160379[_0xf6be('0x22')];var _0x960515;if(_0x5cd8a6>=_0x337951){_0x5cd8a6=_0x337951;_0x960515=0xc8;}else{_0x960515=0xce;}_0x5a18b4[_0xf6be('0x1d')](_0x960515);return _0x5a18b4['set'](_0xf6be('0x23'),_0x14defa+'-'+_0x5cd8a6+'/'+_0x337951)[_0xf6be('0x1f')](_0x4980c1);}return null;};}function patchUpdates(_0x33062c){return function(_0x4ea1d9){try{jsonpatch[_0xf6be('0x24')](_0x4ea1d9,_0x33062c,!![]);}catch(_0x2b4de0){return BPromise[_0xf6be('0x25')](_0x2b4de0);}return _0x4ea1d9[_0xf6be('0x26')]();};}function saveUpdates(_0x164278,_0x1c7930){return function(_0x31ce22){if(_0x31ce22){return _0x31ce22[_0xf6be('0x27')](_0x164278)[_0xf6be('0x28')](function(_0x267e0b){return _0x267e0b;});}return null;};}function removeEntity(_0x2a16b0,_0x3e3a47){return function(_0x5a58d3){if(_0x5a58d3){return _0x5a58d3[_0xf6be('0x29')]()[_0xf6be('0x28')](function(){_0x2a16b0[_0xf6be('0x1d')](0xcc)[_0xf6be('0x1e')]();});}};}function handleEntityNotFound(_0x542601,_0x3208a8){return function(_0x8b2d3b){if(!_0x8b2d3b){_0x542601[_0xf6be('0x1c')](0x194);}return _0x8b2d3b;};}function handleError(_0x3de10d,_0x3c1f07){_0x3c1f07=_0x3c1f07||0x1f4;return function(_0x3f4f00){logger[_0xf6be('0x2a')](_0x3f4f00[_0xf6be('0x2b')]);if(_0x3f4f00['name']){delete _0x3f4f00['name'];}_0x3de10d[_0xf6be('0x1d')](_0x3c1f07)[_0xf6be('0x2c')](_0x3f4f00);};}exports[_0xf6be('0x2d')]=function(_0x1089b6,_0x39a9cd){var _0x20fbcb={},_0x3e3359={},_0x135f18={'count':0x0,'rows':[]};var _0x4fe3a8=_['map'](db[_0xf6be('0x2e')]['rawAttributes'],function(_0x39915c){return{'name':_0x39915c[_0xf6be('0x2f')],'type':_0x39915c[_0xf6be('0x30')][_0xf6be('0x31')]};});_0x3e3359['model']=_['map'](_0x4fe3a8,_0xf6be('0x32'));_0x3e3359[_0xf6be('0x33')]=_[_0xf6be('0x34')](_0x1089b6['query']);_0x3e3359[_0xf6be('0x35')]=_[_0xf6be('0x36')](_0x3e3359[_0xf6be('0x37')],_0x3e3359[_0xf6be('0x33')]);_0x20fbcb[_0xf6be('0x38')]=_[_0xf6be('0x36')](_0x3e3359[_0xf6be('0x37')],qs['fields'](_0x1089b6[_0xf6be('0x33')][_0xf6be('0x39')]));_0x20fbcb[_0xf6be('0x38')]=_0x20fbcb['attributes']['length']?_0x20fbcb[_0xf6be('0x38')]:_0x3e3359[_0xf6be('0x37')];if(!_0x1089b6[_0xf6be('0x33')][_0xf6be('0x3a')](_0xf6be('0x3b'))){_0x20fbcb[_0xf6be('0x22')]=qs['limit'](_0x1089b6[_0xf6be('0x33')][_0xf6be('0x22')]);_0x20fbcb[_0xf6be('0x20')]=qs[_0xf6be('0x20')](_0x1089b6['query'][_0xf6be('0x20')]);}_0x20fbcb['order']=qs['sort'](_0x1089b6[_0xf6be('0x33')][_0xf6be('0x3c')]);_0x20fbcb[_0xf6be('0x3d')]=qs[_0xf6be('0x35')](_['pick'](_0x1089b6[_0xf6be('0x33')],_0x3e3359[_0xf6be('0x35')]),_0x4fe3a8);if(_0x1089b6['query'][_0xf6be('0x3e')]){_0x20fbcb['where']=_[_0xf6be('0x3f')](_0x20fbcb[_0xf6be('0x3d')],{'$or':_['map'](_0x4fe3a8,function(_0x23864c){if(_0x23864c[_0xf6be('0x30')]!==_0xf6be('0x40')){var _0x27d0ef={};_0x27d0ef[_0x23864c[_0xf6be('0x32')]]={'$like':'%'+_0x1089b6[_0xf6be('0x33')][_0xf6be('0x3e')]+'%'};return _0x27d0ef;}})});}_0x20fbcb=_[_0xf6be('0x3f')]({},_0x20fbcb,_0x1089b6[_0xf6be('0x41')]);var _0x4b681c={'where':_0x20fbcb[_0xf6be('0x3d')]};return db[_0xf6be('0x2e')][_0xf6be('0x42')](_0x4b681c)[_0xf6be('0x28')](function(_0x28d7d1){_0x135f18[_0xf6be('0x42')]=_0x28d7d1;if(_0x1089b6[_0xf6be('0x33')][_0xf6be('0x43')]){_0x20fbcb[_0xf6be('0x44')]=[{'all':!![]}];}return db[_0xf6be('0x2e')][_0xf6be('0x45')](_0x20fbcb);})[_0xf6be('0x28')](function(_0x446a63){_0x135f18['rows']=_0x446a63;return _0x135f18;})[_0xf6be('0x28')](respondWithFilteredResult(_0x39a9cd,_0x20fbcb))['catch'](handleError(_0x39a9cd,null));};exports[_0xf6be('0x46')]=function(_0x4c34f1,_0x4ade8c){var _0x27b175={'raw':![],'where':{'id':_0x4c34f1['params']['id']}},_0x145f04={};_0x145f04[_0xf6be('0x37')]=_[_0xf6be('0x34')](db[_0xf6be('0x2e')]['rawAttributes']);_0x145f04['query']=_['keys'](_0x4c34f1[_0xf6be('0x33')]);_0x145f04['filters']=_[_0xf6be('0x36')](_0x145f04['model'],_0x145f04[_0xf6be('0x33')]);_0x27b175['attributes']=_[_0xf6be('0x36')](_0x145f04[_0xf6be('0x37')],qs['fields'](_0x4c34f1[_0xf6be('0x33')][_0xf6be('0x39')]));_0x27b175['attributes']=_0x27b175[_0xf6be('0x38')][_0xf6be('0x47')]?_0x27b175[_0xf6be('0x38')]:_0x145f04[_0xf6be('0x37')];if(_0x4c34f1['query'][_0xf6be('0x43')]){_0x27b175['include']=[{'all':!![]}];}_0x27b175=_[_0xf6be('0x3f')]({},_0x27b175,_0x4c34f1['options']);return db['FreshsalesConfiguration'][_0xf6be('0x48')](_0x27b175)[_0xf6be('0x28')](handleEntityNotFound(_0x4ade8c,null))[_0xf6be('0x28')](respondWithResult(_0x4ade8c,null))[_0xf6be('0x49')](handleError(_0x4ade8c,null));};exports[_0xf6be('0x4a')]=function(_0xe5dc01,_0x5d7e80){return db['FreshsalesConfiguration'][_0xf6be('0x4a')](_0xe5dc01[_0xf6be('0x4b')],{})[_0xf6be('0x28')](respondWithResult(_0x5d7e80,0xc9))[_0xf6be('0x49')](handleError(_0x5d7e80,null));};exports[_0xf6be('0x27')]=function(_0x123a55,_0x35e87d){if(_0x123a55[_0xf6be('0x4b')]['id']){delete _0x123a55[_0xf6be('0x4b')]['id'];}return db[_0xf6be('0x2e')]['find']({'where':{'id':_0x123a55['params']['id']}})[_0xf6be('0x28')](handleEntityNotFound(_0x35e87d,null))['then'](saveUpdates(_0x123a55[_0xf6be('0x4b')],null))['then'](respondWithResult(_0x35e87d,null))[_0xf6be('0x49')](handleError(_0x35e87d,null));};exports['destroy']=function(_0x19c76d,_0x5ae023){return db['FreshsalesConfiguration'][_0xf6be('0x48')]({'where':{'id':_0x19c76d[_0xf6be('0x4c')]['id']}})[_0xf6be('0x28')](handleEntityNotFound(_0x5ae023,null))[_0xf6be('0x28')](removeEntity(_0x5ae023,null))[_0xf6be('0x49')](handleError(_0x5ae023,null));};exports[_0xf6be('0x4d')]=function(_0xe2ed04,_0x449057,_0x2eaa2){var _0x544131={};var _0x301c08={};var _0x44f427;var _0x517962;return db[_0xf6be('0x2e')][_0xf6be('0x4e')]({'where':{'id':_0xe2ed04[_0xf6be('0x4c')]['id']}})[_0xf6be('0x28')](handleEntityNotFound(_0x449057,null))['then'](function(_0xa368cd){if(_0xa368cd){_0x44f427=_0xa368cd;_0x301c08[_0xf6be('0x37')]=_[_0xf6be('0x34')](db[_0xf6be('0x4f')][_0xf6be('0x50')]);_0x301c08['query']=_[_0xf6be('0x34')](_0xe2ed04[_0xf6be('0x33')]);_0x301c08[_0xf6be('0x35')]=_[_0xf6be('0x36')](_0x301c08[_0xf6be('0x37')],_0x301c08[_0xf6be('0x33')]);_0x544131[_0xf6be('0x38')]=_['intersection'](_0x301c08[_0xf6be('0x37')],qs['fields'](_0xe2ed04[_0xf6be('0x33')][_0xf6be('0x39')]));_0x544131['attributes']=_0x544131['attributes'][_0xf6be('0x47')]?_0x544131['attributes']:_0x301c08[_0xf6be('0x37')];_0x544131[_0xf6be('0x51')]=qs[_0xf6be('0x3c')](_0xe2ed04[_0xf6be('0x33')][_0xf6be('0x3c')]);_0x544131['where']=qs['filters'](_['pick'](_0xe2ed04[_0xf6be('0x33')],_0x301c08[_0xf6be('0x35')]));if(_0xe2ed04[_0xf6be('0x33')]['filter']){_0x544131[_0xf6be('0x3d')]=_[_0xf6be('0x3f')](_0x544131[_0xf6be('0x3d')],{'$or':_[_0xf6be('0x52')](_0x544131['attributes'],function(_0x7e11d9){var _0xf7da4b={};_0xf7da4b[_0x7e11d9]={'$like':'%'+_0xe2ed04['query'][_0xf6be('0x3e')]+'%'};return _0xf7da4b;})});}_0x544131=_[_0xf6be('0x3f')]({},_0x544131,_0xe2ed04[_0xf6be('0x41')]);return _0x44f427[_0xf6be('0x4d')](_0x544131);}})[_0xf6be('0x28')](function(_0x3eec71){if(_0x3eec71){_0x517962=_0x3eec71[_0xf6be('0x47')];if(!_0xe2ed04[_0xf6be('0x33')][_0xf6be('0x3a')](_0xf6be('0x3b'))){_0x544131[_0xf6be('0x22')]=qs[_0xf6be('0x22')](_0xe2ed04[_0xf6be('0x33')][_0xf6be('0x22')]);_0x544131[_0xf6be('0x20')]=qs[_0xf6be('0x20')](_0xe2ed04[_0xf6be('0x33')][_0xf6be('0x20')]);}return _0x44f427[_0xf6be('0x4d')](_0x544131);}})[_0xf6be('0x28')](function(_0xd7a129){if(_0xd7a129){return _0xd7a129?{'count':_0x517962,'rows':_0xd7a129}:null;}})[_0xf6be('0x28')](respondWithResult(_0x449057,null))[_0xf6be('0x49')](handleError(_0x449057,null));};exports[_0xf6be('0x53')]=function(_0x144a5f,_0x1d4f67,_0x4472f0){var _0x1491f4={};var _0x5ad6e9={};var _0x2dcf49;var _0x3323f8;return db[_0xf6be('0x2e')][_0xf6be('0x4e')]({'where':{'id':_0x144a5f[_0xf6be('0x4c')]['id']}})[_0xf6be('0x28')](handleEntityNotFound(_0x1d4f67,null))[_0xf6be('0x28')](function(_0x2a720d){if(_0x2a720d){_0x2dcf49=_0x2a720d;_0x5ad6e9['model']=_[_0xf6be('0x34')](db['FreshsalesField'][_0xf6be('0x50')]);_0x5ad6e9[_0xf6be('0x33')]=_[_0xf6be('0x34')](_0x144a5f[_0xf6be('0x33')]);_0x5ad6e9[_0xf6be('0x35')]=_[_0xf6be('0x36')](_0x5ad6e9[_0xf6be('0x37')],_0x5ad6e9[_0xf6be('0x33')]);_0x1491f4[_0xf6be('0x38')]=_[_0xf6be('0x36')](_0x5ad6e9[_0xf6be('0x37')],qs['fields'](_0x144a5f[_0xf6be('0x33')][_0xf6be('0x39')]));_0x1491f4[_0xf6be('0x38')]=_0x1491f4[_0xf6be('0x38')][_0xf6be('0x47')]?_0x1491f4['attributes']:_0x5ad6e9[_0xf6be('0x37')];_0x1491f4[_0xf6be('0x51')]=qs[_0xf6be('0x3c')](_0x144a5f[_0xf6be('0x33')]['sort']);_0x1491f4[_0xf6be('0x3d')]=qs[_0xf6be('0x35')](_[_0xf6be('0x54')](_0x144a5f[_0xf6be('0x33')],_0x5ad6e9[_0xf6be('0x35')]));if(_0x144a5f[_0xf6be('0x33')][_0xf6be('0x3e')]){_0x1491f4[_0xf6be('0x3d')]=_[_0xf6be('0x3f')](_0x1491f4[_0xf6be('0x3d')],{'$or':_['map'](_0x1491f4['attributes'],function(_0x2cbe10){var _0x389687={};_0x389687[_0x2cbe10]={'$like':'%'+_0x144a5f[_0xf6be('0x33')][_0xf6be('0x3e')]+'%'};return _0x389687;})});}_0x1491f4=_[_0xf6be('0x3f')]({},_0x1491f4,_0x144a5f[_0xf6be('0x41')]);return _0x2dcf49[_0xf6be('0x53')](_0x1491f4);}})[_0xf6be('0x28')](function(_0x4e3220){if(_0x4e3220){_0x3323f8=_0x4e3220[_0xf6be('0x47')];if(!_0x144a5f['query']['hasOwnProperty'](_0xf6be('0x3b'))){_0x1491f4[_0xf6be('0x22')]=qs[_0xf6be('0x22')](_0x144a5f['query'][_0xf6be('0x22')]);_0x1491f4['offset']=qs['offset'](_0x144a5f[_0xf6be('0x33')]['offset']);}return _0x2dcf49[_0xf6be('0x53')](_0x1491f4);}})[_0xf6be('0x28')](function(_0x3af869){if(_0x3af869){return _0x3af869?{'count':_0x3323f8,'rows':_0x3af869}:null;}})[_0xf6be('0x28')](respondWithResult(_0x1d4f67,null))[_0xf6be('0x49')](handleError(_0x1d4f67,null));};exports['getFields']=function(_0xd6a7d9,_0x45e701,_0x468418){var _0x184583={};var _0x5cdd68={};var _0x5caff3;var _0x100294;return db['FreshsalesConfiguration'][_0xf6be('0x4e')]({'where':{'id':_0xd6a7d9[_0xf6be('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45e701,null))[_0xf6be('0x28')](function(_0x39b421){if(_0x39b421){_0x5caff3=_0x39b421;_0x5cdd68[_0xf6be('0x37')]=_[_0xf6be('0x34')](db[_0xf6be('0x4f')][_0xf6be('0x50')]);_0x5cdd68[_0xf6be('0x33')]=_[_0xf6be('0x34')](_0xd6a7d9[_0xf6be('0x33')]);_0x5cdd68['filters']=_[_0xf6be('0x36')](_0x5cdd68[_0xf6be('0x37')],_0x5cdd68[_0xf6be('0x33')]);_0x184583[_0xf6be('0x38')]=_[_0xf6be('0x36')](_0x5cdd68[_0xf6be('0x37')],qs[_0xf6be('0x39')](_0xd6a7d9[_0xf6be('0x33')][_0xf6be('0x39')]));_0x184583[_0xf6be('0x38')]=_0x184583[_0xf6be('0x38')][_0xf6be('0x47')]?_0x184583[_0xf6be('0x38')]:_0x5cdd68[_0xf6be('0x37')];_0x184583['order']=qs[_0xf6be('0x3c')](_0xd6a7d9[_0xf6be('0x33')][_0xf6be('0x3c')]);_0x184583[_0xf6be('0x3d')]=qs[_0xf6be('0x35')](_[_0xf6be('0x54')](_0xd6a7d9[_0xf6be('0x33')],_0x5cdd68[_0xf6be('0x35')]));if(_0xd6a7d9['query']['filter']){_0x184583[_0xf6be('0x3d')]=_[_0xf6be('0x3f')](_0x184583[_0xf6be('0x3d')],{'$or':_['map'](_0x184583[_0xf6be('0x38')],function(_0x184d86){var _0x52bd4a={};_0x52bd4a[_0x184d86]={'$like':'%'+_0xd6a7d9['query'][_0xf6be('0x3e')]+'%'};return _0x52bd4a;})});}_0x184583=_[_0xf6be('0x3f')]({},_0x184583,_0xd6a7d9[_0xf6be('0x41')]);return _0x5caff3[_0xf6be('0x55')](_0x184583);}})[_0xf6be('0x28')](function(_0x1a9e78){if(_0x1a9e78){_0x100294=_0x1a9e78[_0xf6be('0x47')];if(!_0xd6a7d9[_0xf6be('0x33')][_0xf6be('0x3a')]('nolimit')){_0x184583[_0xf6be('0x22')]=qs[_0xf6be('0x22')](_0xd6a7d9[_0xf6be('0x33')][_0xf6be('0x22')]);_0x184583['offset']=qs[_0xf6be('0x20')](_0xd6a7d9[_0xf6be('0x33')][_0xf6be('0x20')]);}return _0x5caff3['getFields'](_0x184583);}})[_0xf6be('0x28')](function(_0x2485c4){if(_0x2485c4){return _0x2485c4?{'count':_0x100294,'rows':_0x2485c4}:null;}})['then'](respondWithResult(_0x45e701,null))[_0xf6be('0x49')](handleError(_0x45e701,null));};
\ No newline at end of file
index 9236636..9afd071 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8eb=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1ade0c,_0x984fdb){var _0x497a15=function(_0x5dfd46){while(--_0x5dfd46){_0x1ade0c['push'](_0x1ade0c['shift']());}};_0x497a15(++_0x984fdb);}(_0xc8eb,0x87));var _0xbc8e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc8eb[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xbc8e('0x0'));var util=require('util');var logger=require(_0xbc8e('0x1'))(_0xbc8e('0x2'));var moment=require(_0xbc8e('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc8e('0x4'));var fs=require('fs');var path=require(_0xbc8e('0x5'));var rimraf=require(_0xbc8e('0x6'));var config=require(_0xbc8e('0x7'));var attributes=require(_0xbc8e('0x8'));module['exports']=function(_0x3ddfb4,_0x322181){return _0x3ddfb4['define']('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe63=['path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','api','moment','bluebird','request-promise'];(function(_0x34f3c7,_0x393441){var _0x258767=function(_0x1528d1){while(--_0x1528d1){_0x34f3c7['push'](_0x34f3c7['shift']());}};_0x258767(++_0x393441);}(_0xfe63,0x88));var _0x3fe6=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xfe63[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3fe6('0x0'));var moment=require(_0x3fe6('0x1'));var BPromise=require(_0x3fe6('0x2'));var rp=require(_0x3fe6('0x3'));var fs=require('fs');var path=require(_0x3fe6('0x4'));var rimraf=require('rimraf');var config=require(_0x3fe6('0x5'));var attributes=require(_0x3fe6('0x6'));module[_0x3fe6('0x7')]=function(_0x415c5a,_0x412578){return _0x415c5a[_0x3fe6('0x8')](_0x3fe6('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4941946..20ba33b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5da=['message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0xf5da,0x19a));var _0xaf5d=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0xf5da[_0x2e0ffa];return _0x24d627;};'use strict';var _=require(_0xaf5d('0x0'));var util=require(_0xaf5d('0x1'));var moment=require(_0xaf5d('0x2'));var BPromise=require(_0xaf5d('0x3'));var rs=require(_0xaf5d('0x4'));var fs=require('fs');var Redis=require(_0xaf5d('0x5'));var db=require(_0xaf5d('0x6'))['db'];var utils=require(_0xaf5d('0x7'));var logger=require(_0xaf5d('0x8'))(_0xaf5d('0x9'));var config=require(_0xaf5d('0xa'));var jayson=require(_0xaf5d('0xb'));var client=jayson['client'][_0xaf5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cf493,_0x53277a,_0x335e57){return new BPromise(function(_0x2355bc,_0x5bbb73){return client[_0xaf5d('0xd')](_0x3cf493,_0x335e57)[_0xaf5d('0xe')](function(_0x49e82d){logger['info'](_0xaf5d('0xf'),_0x53277a,_0xaf5d('0x10'));logger[_0xaf5d('0x11')](_0xaf5d('0x12'),_0x53277a,_0xaf5d('0x10'),JSON[_0xaf5d('0x13')](_0x49e82d));if(_0x49e82d['error']){if(_0x49e82d[_0xaf5d('0x14')][_0xaf5d('0x15')]===0x1f4){logger[_0xaf5d('0x14')](_0xaf5d('0xf'),_0x53277a,_0x49e82d[_0xaf5d('0x14')][_0xaf5d('0x16')]);return _0x5bbb73(_0x49e82d[_0xaf5d('0x14')][_0xaf5d('0x16')]);}logger[_0xaf5d('0x14')](_0xaf5d('0xf'),_0x53277a,_0x49e82d[_0xaf5d('0x14')][_0xaf5d('0x16')]);return _0x2355bc(_0x49e82d[_0xaf5d('0x14')][_0xaf5d('0x16')]);}else{logger[_0xaf5d('0x17')](_0xaf5d('0xf'),_0x53277a,_0xaf5d('0x10'));_0x2355bc(_0x49e82d['result'][_0xaf5d('0x16')]);}})['catch'](function(_0xe0eef0){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x53277a,_0xe0eef0);_0x5bbb73(_0xe0eef0);});});}
\ No newline at end of file
+var _0xefbe=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0xefbe,0x169));var _0xeefb=function(_0x2d7183,_0x426bab){_0x2d7183=_0x2d7183-0x0;var _0x394403=_0xefbe[_0x2d7183];return _0x394403;};'use strict';var _=require(_0xeefb('0x0'));var util=require(_0xeefb('0x1'));var moment=require('moment');var BPromise=require(_0xeefb('0x2'));var rs=require(_0xeefb('0x3'));var fs=require('fs');var Redis=require(_0xeefb('0x4'));var db=require(_0xeefb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeefb('0x6'))('rpc');var config=require(_0xeefb('0x7'));var jayson=require(_0xeefb('0x8'));var client=jayson[_0xeefb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x316671,_0x34d46f,_0x123d0d){return new BPromise(function(_0x1355e3,_0x329ec5){return client['request'](_0x316671,_0x123d0d)[_0xeefb('0xa')](function(_0x10b501){logger[_0xeefb('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34d46f,_0xeefb('0xc'));logger[_0xeefb('0xd')](_0xeefb('0xe'),_0x34d46f,'request\x20sent',JSON[_0xeefb('0xf')](_0x10b501));if(_0x10b501['error']){if(_0x10b501[_0xeefb('0x10')][_0xeefb('0x11')]===0x1f4){logger[_0xeefb('0x10')](_0xeefb('0x12'),_0x34d46f,_0x10b501['error'][_0xeefb('0x13')]);return _0x329ec5(_0x10b501[_0xeefb('0x10')][_0xeefb('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x34d46f,_0x10b501[_0xeefb('0x10')][_0xeefb('0x13')]);return _0x1355e3(_0x10b501[_0xeefb('0x10')]['message']);}else{logger['info'](_0xeefb('0x12'),_0x34d46f,_0xeefb('0xc'));_0x1355e3(_0x10b501[_0xeefb('0x14')][_0xeefb('0x13')]);}})[_0xeefb('0x15')](function(_0x1f6dbc){logger[_0xeefb('0x10')](_0xeefb('0x12'),_0x34d46f,_0x1f6dbc);_0x329ec5(_0x1f6dbc);});});}
\ No newline at end of file
index cf7142f..f9cb343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['post','create','put','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4e282c,_0x37f069){var _0x3e7948=function(_0x1e9d70){while(--_0x1e9d70){_0x4e282c['push'](_0x4e282c['shift']());}};_0x3e7948(++_0x37f069);}(_0x5636,0x102));var _0x6563=function(_0x43da51,_0x5b3720){_0x43da51=_0x43da51-0x0;var _0x5c9528=_0x5636[_0x43da51];return _0x5c9528;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0xc')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router[_0x6563('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6563('0xf')]);router[_0x6563('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6563('0x11')]=router;
\ No newline at end of file
+var _0xf2c7=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x5bd018,_0x466a03){var _0x182190=function(_0x5ad4a6){while(--_0x5ad4a6){_0x5bd018['push'](_0x5bd018['shift']());}};_0x182190(++_0x466a03);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0xf2c7[_0x2f32c4];return _0x3f3018;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var path=require(_0x7f2c('0x2'));var timeout=require(_0x7f2c('0x3'));var express=require('express');var router=express[_0x7f2c('0x4')]();var fs_extra=require(_0x7f2c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f2c('0x6'));var controller=require('./intFreshsalesField.controller');router[_0x7f2c('0x7')]('/',auth[_0x7f2c('0x8')](),controller['index']);router[_0x7f2c('0x7')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['show']);router[_0x7f2c('0xa')]('/',auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xb')]);router[_0x7f2c('0xc')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['update']);router[_0x7f2c('0xd')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xe')]);module[_0x7f2c('0xf')]=router;
\ No newline at end of file
index da9a4dc..32f0c0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d7=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x56968c,_0x1e4877){var _0x3e3524=function(_0x3374c2){while(--_0x3374c2){_0x56968c['push'](_0x56968c['shift']());}};_0x3e3524(++_0x1e4877);}(_0xf7d7,0x1ce));var _0x7f7d=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xf7d7[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x7f7d('0x0'));module['exports']={'type':{'type':Sequelize[_0x7f7d('0x1')](_0x7f7d('0x2'),_0x7f7d('0x3'),_0x7f7d('0x4'),_0x7f7d('0x5'),_0x7f7d('0x6')),'defaultValue':_0x7f7d('0x2')},'content':{'type':Sequelize[_0x7f7d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7f7d('0x1')](_0x7f7d('0x2'),_0x7f7d('0x3'),_0x7f7d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7f7d('0x7')]},'nameField':{'type':Sequelize[_0x7f7d('0x7')]},'customField':{'type':Sequelize[_0x7f7d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f7d('0x7')]}};
\ No newline at end of file
+var _0x95a2=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','string'];(function(_0x483df0,_0x589660){var _0x16e608=function(_0x26f65c){while(--_0x26f65c){_0x483df0['push'](_0x483df0['shift']());}};_0x16e608(++_0x589660);}(_0x95a2,0xc6));var _0x295a=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x95a2[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0x295a('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x295a('0x1'),_0x295a('0x2'),_0x295a('0x3'),_0x295a('0x4'),_0x295a('0x5')),'defaultValue':_0x295a('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x295a('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x295a('0x1'),_0x295a('0x2'),_0x295a('0x3'))},'keyContent':{'type':Sequelize[_0x295a('0x6')]},'idField':{'type':Sequelize[_0x295a('0x6')]},'nameField':{'type':Sequelize[_0x295a('0x6')]},'customField':{'type':Sequelize[_0x295a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x295a('0x6')]}};
\ No newline at end of file
index 7726ad9..7f612b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafd8=['../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','Content-Range','save','update','then','end','sendStatus','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xafd8,0xe9));var _0x8afd=function(_0x36c063,_0x233be3){_0x36c063=_0x36c063-0x0;var _0x1b6102=_0xafd8[_0x36c063];return _0x1b6102;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8afd('0x0'));var jsonpatch=require(_0x8afd('0x1'));var rp=require('request-promise');var moment=require(_0x8afd('0x2'));var BPromise=require(_0x8afd('0x3'));var Mustache=require('mustache');var util=require(_0x8afd('0x4'));var path=require('path');var sox=require(_0x8afd('0x5'));var csv=require(_0x8afd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8afd('0x7'));var deskjs=require(_0x8afd('0x8'));var toCsv=require(_0x8afd('0x6'));var querystring=require(_0x8afd('0x9'));var Papa=require(_0x8afd('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8afd('0xb'));var as=require(_0x8afd('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8afd('0xd'))('api');var utils=require(_0x8afd('0xe'));var config=require(_0x8afd('0xf'));var licenseUtil=require(_0x8afd('0x10'));var db=require(_0x8afd('0x11'))['db'];function respondWithStatusCode(_0x2b5bfe,_0xe0b6e2){_0xe0b6e2=_0xe0b6e2||0xcc;return function(_0x2cbd28){if(_0x2cbd28){return _0x2b5bfe['sendStatus'](_0xe0b6e2);}return _0x2b5bfe[_0x8afd('0x12')](_0xe0b6e2)['end']();};}function respondWithResult(_0x312900,_0x3ad554){_0x3ad554=_0x3ad554||0xc8;return function(_0x54af13){if(_0x54af13){return _0x312900[_0x8afd('0x12')](_0x3ad554)['json'](_0x54af13);}};}function respondWithFilteredResult(_0x25d704,_0x58df25){return function(_0x4e1abb){if(_0x4e1abb){var _0x475bc2=typeof _0x58df25[_0x8afd('0x13')]===_0x8afd('0x14')&&typeof _0x58df25['limit']===_0x8afd('0x14');var _0x407c03=_0x4e1abb[_0x8afd('0x15')];var _0x1b4dc1=_0x475bc2?0x0:_0x58df25[_0x8afd('0x13')];var _0x5e71bd=_0x475bc2?_0x4e1abb['count']:_0x58df25[_0x8afd('0x13')]+_0x58df25['limit'];var _0x5ad57b;if(_0x5e71bd>=_0x407c03){_0x5e71bd=_0x407c03;_0x5ad57b=0xc8;}else{_0x5ad57b=0xce;}_0x25d704['status'](_0x5ad57b);return _0x25d704['set'](_0x8afd('0x16'),_0x1b4dc1+'-'+_0x5e71bd+'/'+_0x407c03)['json'](_0x4e1abb);}return null;};}function patchUpdates(_0x30741b){return function(_0x1f9ead){try{jsonpatch['apply'](_0x1f9ead,_0x30741b,!![]);}catch(_0x2b1eea){return BPromise['reject'](_0x2b1eea);}return _0x1f9ead[_0x8afd('0x17')]();};}function saveUpdates(_0x21b863,_0x314159){return function(_0x48029c){if(_0x48029c){return _0x48029c[_0x8afd('0x18')](_0x21b863)[_0x8afd('0x19')](function(_0x1cc942){return _0x1cc942;});}return null;};}function removeEntity(_0x5e1e7d,_0x5bbb86){return function(_0x44abe4){if(_0x44abe4){return _0x44abe4['destroy']()[_0x8afd('0x19')](function(){_0x5e1e7d['status'](0xcc)[_0x8afd('0x1a')]();});}};}function handleEntityNotFound(_0x887602,_0x3c1b89){return function(_0x48457a){if(!_0x48457a){_0x887602[_0x8afd('0x1b')](0x194);}return _0x48457a;};}function handleError(_0x382eaf,_0x2e44cd){_0x2e44cd=_0x2e44cd||0x1f4;return function(_0x51cb41){logger['error'](_0x51cb41[_0x8afd('0x1c')]);if(_0x51cb41[_0x8afd('0x1d')]){delete _0x51cb41[_0x8afd('0x1d')];}_0x382eaf[_0x8afd('0x12')](_0x2e44cd)['send'](_0x51cb41);};}exports[_0x8afd('0x1e')]=function(_0x110459,_0x190b3b){var _0x557d0b={},_0x52ab54={},_0x34733f={'count':0x0,'rows':[]};var _0x369214=_[_0x8afd('0x1f')](db[_0x8afd('0x20')][_0x8afd('0x21')],function(_0x1dc002){return{'name':_0x1dc002[_0x8afd('0x22')],'type':_0x1dc002[_0x8afd('0x23')]['key']};});_0x52ab54[_0x8afd('0x24')]=_[_0x8afd('0x1f')](_0x369214,'name');_0x52ab54[_0x8afd('0x25')]=_[_0x8afd('0x26')](_0x110459[_0x8afd('0x25')]);_0x52ab54[_0x8afd('0x27')]=_[_0x8afd('0x28')](_0x52ab54['model'],_0x52ab54[_0x8afd('0x25')]);_0x557d0b[_0x8afd('0x29')]=_['intersection'](_0x52ab54[_0x8afd('0x24')],qs['fields'](_0x110459[_0x8afd('0x25')][_0x8afd('0x2a')]));_0x557d0b['attributes']=_0x557d0b[_0x8afd('0x29')][_0x8afd('0x2b')]?_0x557d0b[_0x8afd('0x29')]:_0x52ab54['model'];if(!_0x110459[_0x8afd('0x25')]['hasOwnProperty'](_0x8afd('0x2c'))){_0x557d0b[_0x8afd('0x2d')]=qs[_0x8afd('0x2d')](_0x110459[_0x8afd('0x25')][_0x8afd('0x2d')]);_0x557d0b[_0x8afd('0x13')]=qs[_0x8afd('0x13')](_0x110459[_0x8afd('0x25')][_0x8afd('0x13')]);}_0x557d0b['order']=qs[_0x8afd('0x2e')](_0x110459[_0x8afd('0x25')][_0x8afd('0x2e')]);_0x557d0b[_0x8afd('0x2f')]=qs[_0x8afd('0x27')](_['pick'](_0x110459[_0x8afd('0x25')],_0x52ab54['filters']),_0x369214);if(_0x110459['query'][_0x8afd('0x30')]){_0x557d0b[_0x8afd('0x2f')]=_[_0x8afd('0x31')](_0x557d0b[_0x8afd('0x2f')],{'$or':_[_0x8afd('0x1f')](_0x369214,function(_0x1345f5){if(_0x1345f5[_0x8afd('0x23')]!==_0x8afd('0x32')){var _0x27b913={};_0x27b913[_0x1345f5[_0x8afd('0x1d')]]={'$like':'%'+_0x110459[_0x8afd('0x25')][_0x8afd('0x30')]+'%'};return _0x27b913;}})});}_0x557d0b=_[_0x8afd('0x31')]({},_0x557d0b,_0x110459[_0x8afd('0x33')]);var _0x451f6e={'where':_0x557d0b[_0x8afd('0x2f')]};return db['FreshsalesField']['count'](_0x451f6e)[_0x8afd('0x19')](function(_0x981b78){_0x34733f[_0x8afd('0x15')]=_0x981b78;if(_0x110459[_0x8afd('0x25')][_0x8afd('0x34')]){_0x557d0b[_0x8afd('0x35')]=[{'all':!![]}];}return db[_0x8afd('0x20')][_0x8afd('0x36')](_0x557d0b);})[_0x8afd('0x19')](function(_0x867adb){_0x34733f['rows']=_0x867adb;return _0x34733f;})[_0x8afd('0x19')](respondWithFilteredResult(_0x190b3b,_0x557d0b))[_0x8afd('0x37')](handleError(_0x190b3b,null));};exports[_0x8afd('0x38')]=function(_0x193de6,_0x43540a){var _0x5e5916={'raw':!![],'where':{'id':_0x193de6[_0x8afd('0x39')]['id']}},_0x39a0cc={};_0x39a0cc[_0x8afd('0x24')]=_[_0x8afd('0x26')](db['FreshsalesField']['rawAttributes']);_0x39a0cc['query']=_[_0x8afd('0x26')](_0x193de6[_0x8afd('0x25')]);_0x39a0cc['filters']=_[_0x8afd('0x28')](_0x39a0cc[_0x8afd('0x24')],_0x39a0cc[_0x8afd('0x25')]);_0x5e5916[_0x8afd('0x29')]=_[_0x8afd('0x28')](_0x39a0cc['model'],qs[_0x8afd('0x2a')](_0x193de6[_0x8afd('0x25')][_0x8afd('0x2a')]));_0x5e5916[_0x8afd('0x29')]=_0x5e5916[_0x8afd('0x29')][_0x8afd('0x2b')]?_0x5e5916['attributes']:_0x39a0cc['model'];if(_0x193de6['query']['includeAll']){_0x5e5916[_0x8afd('0x35')]=[{'all':!![]}];}_0x5e5916=_[_0x8afd('0x31')]({},_0x5e5916,_0x193de6[_0x8afd('0x33')]);return db['FreshsalesField']['find'](_0x5e5916)[_0x8afd('0x19')](handleEntityNotFound(_0x43540a,null))[_0x8afd('0x19')](respondWithResult(_0x43540a,null))[_0x8afd('0x37')](handleError(_0x43540a,null));};exports[_0x8afd('0x3a')]=function(_0x1978d2,_0xa3f05d){return db[_0x8afd('0x20')][_0x8afd('0x3a')](_0x1978d2[_0x8afd('0x3b')],{})[_0x8afd('0x19')](respondWithResult(_0xa3f05d,0xc9))[_0x8afd('0x37')](handleError(_0xa3f05d,null));};exports['update']=function(_0x5d9fef,_0x244669){if(_0x5d9fef[_0x8afd('0x3b')]['id']){delete _0x5d9fef[_0x8afd('0x3b')]['id'];}return db[_0x8afd('0x20')][_0x8afd('0x3c')]({'where':{'id':_0x5d9fef[_0x8afd('0x39')]['id']}})['then'](handleEntityNotFound(_0x244669,null))[_0x8afd('0x19')](saveUpdates(_0x5d9fef['body'],null))['then'](respondWithResult(_0x244669,null))['catch'](handleError(_0x244669,null));};exports[_0x8afd('0x3d')]=function(_0x4015f6,_0x4829ff){return db[_0x8afd('0x20')][_0x8afd('0x3c')]({'where':{'id':_0x4015f6[_0x8afd('0x39')]['id']}})['then'](handleEntityNotFound(_0x4829ff,null))[_0x8afd('0x19')](removeEntity(_0x4829ff,null))[_0x8afd('0x37')](handleError(_0x4829ff,null));};
\ No newline at end of file
+var _0x7fcf=['find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','name','send','FreshsalesField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params'];(function(_0x2d6ae6,_0x36241e){var _0x5be2f6=function(_0x505432){while(--_0x505432){_0x2d6ae6['push'](_0x2d6ae6['shift']());}};_0x5be2f6(++_0x36241e);}(_0x7fcf,0x15e));var _0xf7fc=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x7fcf[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xf7fc('0x0'));var rimraf=require(_0xf7fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7fc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7fc('0x3'));var Mustache=require(_0xf7fc('0x4'));var util=require('util');var path=require(_0xf7fc('0x5'));var sox=require(_0xf7fc('0x6'));var csv=require(_0xf7fc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7fc('0x8'));var _=require(_0xf7fc('0x9'));var squel=require('squel');var crypto=require(_0xf7fc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf7fc('0xb'));var Papa=require('papaparse');var Redis=require(_0xf7fc('0xc'));var authService=require(_0xf7fc('0xd'));var qs=require(_0xf7fc('0xe'));var as=require(_0xf7fc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7fc('0x10'))(_0xf7fc('0x11'));var utils=require(_0xf7fc('0x12'));var config=require(_0xf7fc('0x13'));var licenseUtil=require(_0xf7fc('0x14'));var db=require(_0xf7fc('0x15'))['db'];function respondWithStatusCode(_0x45905d,_0xd6f0f6){_0xd6f0f6=_0xd6f0f6||0xcc;return function(_0x51abe5){if(_0x51abe5){return _0x45905d[_0xf7fc('0x16')](_0xd6f0f6);}return _0x45905d[_0xf7fc('0x17')](_0xd6f0f6)[_0xf7fc('0x18')]();};}function respondWithResult(_0x2bfc0e,_0x3a31a6){_0x3a31a6=_0x3a31a6||0xc8;return function(_0x81affe){if(_0x81affe){return _0x2bfc0e[_0xf7fc('0x17')](_0x3a31a6)[_0xf7fc('0x19')](_0x81affe);}};}function respondWithFilteredResult(_0x3f205d,_0x4ce468){return function(_0x22a0df){if(_0x22a0df){var _0x191d1b=typeof _0x4ce468[_0xf7fc('0x1a')]===_0xf7fc('0x1b')&&typeof _0x4ce468['limit']==='undefined';var _0x2b7a95=_0x22a0df[_0xf7fc('0x1c')];var _0x5b65e5=_0x191d1b?0x0:_0x4ce468[_0xf7fc('0x1a')];var _0x560616=_0x191d1b?_0x22a0df[_0xf7fc('0x1c')]:_0x4ce468[_0xf7fc('0x1a')]+_0x4ce468['limit'];var _0x503c0a;if(_0x560616>=_0x2b7a95){_0x560616=_0x2b7a95;_0x503c0a=0xc8;}else{_0x503c0a=0xce;}_0x3f205d['status'](_0x503c0a);return _0x3f205d[_0xf7fc('0x1d')](_0xf7fc('0x1e'),_0x5b65e5+'-'+_0x560616+'/'+_0x2b7a95)[_0xf7fc('0x19')](_0x22a0df);}return null;};}function patchUpdates(_0x52ffbc){return function(_0x4396fc){try{jsonpatch['apply'](_0x4396fc,_0x52ffbc,!![]);}catch(_0x55a2ed){return BPromise[_0xf7fc('0x1f')](_0x55a2ed);}return _0x4396fc['save']();};}function saveUpdates(_0x1c31a1,_0x4e4cdd){return function(_0x8c74ed){if(_0x8c74ed){return _0x8c74ed[_0xf7fc('0x20')](_0x1c31a1)[_0xf7fc('0x21')](function(_0x501884){return _0x501884;});}return null;};}function removeEntity(_0x22fa12,_0x156a0e){return function(_0x5ef949){if(_0x5ef949){return _0x5ef949['destroy']()['then'](function(){_0x22fa12[_0xf7fc('0x17')](0xcc)[_0xf7fc('0x18')]();});}};}function handleEntityNotFound(_0x2884b1,_0x124309){return function(_0x21a0aa){if(!_0x21a0aa){_0x2884b1[_0xf7fc('0x16')](0x194);}return _0x21a0aa;};}function handleError(_0x44b46d,_0xc323bd){_0xc323bd=_0xc323bd||0x1f4;return function(_0x2c0ea0){logger['error'](_0x2c0ea0['stack']);if(_0x2c0ea0[_0xf7fc('0x22')]){delete _0x2c0ea0[_0xf7fc('0x22')];}_0x44b46d[_0xf7fc('0x17')](_0xc323bd)[_0xf7fc('0x23')](_0x2c0ea0);};}exports['index']=function(_0xa852b,_0x23c3e9){var _0x3c217f={},_0x595433={},_0x261e2c={'count':0x0,'rows':[]};var _0x70b14f=_['map'](db[_0xf7fc('0x24')][_0xf7fc('0x25')],function(_0x3512d4){return{'name':_0x3512d4[_0xf7fc('0x26')],'type':_0x3512d4[_0xf7fc('0x27')]['key']};});_0x595433[_0xf7fc('0x28')]=_[_0xf7fc('0x29')](_0x70b14f,_0xf7fc('0x22'));_0x595433[_0xf7fc('0x2a')]=_[_0xf7fc('0x2b')](_0xa852b[_0xf7fc('0x2a')]);_0x595433[_0xf7fc('0x2c')]=_[_0xf7fc('0x2d')](_0x595433[_0xf7fc('0x28')],_0x595433[_0xf7fc('0x2a')]);_0x3c217f[_0xf7fc('0x2e')]=_[_0xf7fc('0x2d')](_0x595433['model'],qs[_0xf7fc('0x2f')](_0xa852b[_0xf7fc('0x2a')][_0xf7fc('0x2f')]));_0x3c217f[_0xf7fc('0x2e')]=_0x3c217f['attributes'][_0xf7fc('0x30')]?_0x3c217f[_0xf7fc('0x2e')]:_0x595433[_0xf7fc('0x28')];if(!_0xa852b[_0xf7fc('0x2a')][_0xf7fc('0x31')]('nolimit')){_0x3c217f['limit']=qs[_0xf7fc('0x32')](_0xa852b[_0xf7fc('0x2a')]['limit']);_0x3c217f['offset']=qs[_0xf7fc('0x1a')](_0xa852b[_0xf7fc('0x2a')][_0xf7fc('0x1a')]);}_0x3c217f[_0xf7fc('0x33')]=qs[_0xf7fc('0x34')](_0xa852b[_0xf7fc('0x2a')][_0xf7fc('0x34')]);_0x3c217f['where']=qs[_0xf7fc('0x2c')](_[_0xf7fc('0x35')](_0xa852b[_0xf7fc('0x2a')],_0x595433[_0xf7fc('0x2c')]),_0x70b14f);if(_0xa852b[_0xf7fc('0x2a')][_0xf7fc('0x36')]){_0x3c217f[_0xf7fc('0x37')]=_[_0xf7fc('0x38')](_0x3c217f[_0xf7fc('0x37')],{'$or':_[_0xf7fc('0x29')](_0x70b14f,function(_0x2b88e6){if(_0x2b88e6[_0xf7fc('0x27')]!==_0xf7fc('0x39')){var _0x470dbe={};_0x470dbe[_0x2b88e6[_0xf7fc('0x22')]]={'$like':'%'+_0xa852b['query'][_0xf7fc('0x36')]+'%'};return _0x470dbe;}})});}_0x3c217f=_[_0xf7fc('0x38')]({},_0x3c217f,_0xa852b[_0xf7fc('0x3a')]);var _0x26e3ee={'where':_0x3c217f[_0xf7fc('0x37')]};return db['FreshsalesField'][_0xf7fc('0x1c')](_0x26e3ee)[_0xf7fc('0x21')](function(_0x2d5bb5){_0x261e2c[_0xf7fc('0x1c')]=_0x2d5bb5;if(_0xa852b['query'][_0xf7fc('0x3b')]){_0x3c217f['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xf7fc('0x3c')](_0x3c217f);})[_0xf7fc('0x21')](function(_0x577d5c){_0x261e2c[_0xf7fc('0x3d')]=_0x577d5c;return _0x261e2c;})[_0xf7fc('0x21')](respondWithFilteredResult(_0x23c3e9,_0x3c217f))['catch'](handleError(_0x23c3e9,null));};exports[_0xf7fc('0x3e')]=function(_0x33d70e,_0x3c447b){var _0x5586ec={'raw':!![],'where':{'id':_0x33d70e[_0xf7fc('0x3f')]['id']}},_0x313aa6={};_0x313aa6['model']=_[_0xf7fc('0x2b')](db['FreshsalesField']['rawAttributes']);_0x313aa6[_0xf7fc('0x2a')]=_[_0xf7fc('0x2b')](_0x33d70e[_0xf7fc('0x2a')]);_0x313aa6['filters']=_[_0xf7fc('0x2d')](_0x313aa6[_0xf7fc('0x28')],_0x313aa6['query']);_0x5586ec['attributes']=_[_0xf7fc('0x2d')](_0x313aa6[_0xf7fc('0x28')],qs[_0xf7fc('0x2f')](_0x33d70e[_0xf7fc('0x2a')]['fields']));_0x5586ec[_0xf7fc('0x2e')]=_0x5586ec[_0xf7fc('0x2e')][_0xf7fc('0x30')]?_0x5586ec[_0xf7fc('0x2e')]:_0x313aa6[_0xf7fc('0x28')];if(_0x33d70e[_0xf7fc('0x2a')][_0xf7fc('0x3b')]){_0x5586ec['include']=[{'all':!![]}];}_0x5586ec=_['merge']({},_0x5586ec,_0x33d70e[_0xf7fc('0x3a')]);return db['FreshsalesField'][_0xf7fc('0x40')](_0x5586ec)[_0xf7fc('0x21')](handleEntityNotFound(_0x3c447b,null))[_0xf7fc('0x21')](respondWithResult(_0x3c447b,null))[_0xf7fc('0x41')](handleError(_0x3c447b,null));};exports[_0xf7fc('0x42')]=function(_0x30b66a,_0x490a49){return db['FreshsalesField'][_0xf7fc('0x42')](_0x30b66a[_0xf7fc('0x43')],{})[_0xf7fc('0x21')](respondWithResult(_0x490a49,0xc9))[_0xf7fc('0x41')](handleError(_0x490a49,null));};exports['update']=function(_0x575bc5,_0x4ca97f){if(_0x575bc5[_0xf7fc('0x43')]['id']){delete _0x575bc5[_0xf7fc('0x43')]['id'];}return db[_0xf7fc('0x24')][_0xf7fc('0x40')]({'where':{'id':_0x575bc5[_0xf7fc('0x3f')]['id']}})[_0xf7fc('0x21')](handleEntityNotFound(_0x4ca97f,null))[_0xf7fc('0x21')](saveUpdates(_0x575bc5[_0xf7fc('0x43')],null))['then'](respondWithResult(_0x4ca97f,null))[_0xf7fc('0x41')](handleError(_0x4ca97f,null));};exports[_0xf7fc('0x44')]=function(_0x56fad9,_0x536aa8){return db[_0xf7fc('0x24')][_0xf7fc('0x40')]({'where':{'id':_0x56fad9[_0xf7fc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x536aa8,null))[_0xf7fc('0x21')](removeEntity(_0x536aa8,null))['catch'](handleError(_0x536aa8,null));};
\ No newline at end of file
index f460c66..d296782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab8=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x4adb63,_0x3b7fdf){var _0x45b8bb=function(_0x2379f2){while(--_0x2379f2){_0x4adb63['push'](_0x4adb63['shift']());}};_0x45b8bb(++_0x3b7fdf);}(_0x9ab8,0x81));var _0x89ab=function(_0x5e767b,_0x4e99e5){_0x5e767b=_0x5e767b-0x0;var _0x21a062=_0x9ab8[_0x5e767b];return _0x21a062;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var logger=require(_0x89ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0x89ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ab('0x4'));var rimraf=require(_0x89ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x89ab('0x6'));module[_0x89ab('0x7')]=function(_0x2dcf12,_0xb9ec6e){return _0x2dcf12[_0x89ab('0x8')](_0x89ab('0x9'),attributes,{'tableName':_0x89ab('0xa'),'paranoid':![],'indexes':[{'name':_0x89ab('0xb'),'fields':[_0x89ab('0xc'),_0x89ab('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x4df787,_0x337596){var _0x20fe58=function(_0x177bf2){while(--_0x177bf2){_0x4df787['push'](_0x4df787['shift']());}};_0x20fe58(++_0x337596);}(_0xabad,0x150));var _0xdaba=function(_0x4cad49,_0x5c3bb3){_0x4cad49=_0x4cad49-0x0;var _0x5e0a00=_0xabad[_0x4cad49];return _0x5e0a00;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xdaba('0xc'),_0xdaba('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 46ece39..a142d23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x92308,_0x2c5965){var _0x3e6f92=function(_0x51d4f8){while(--_0x51d4f8){_0x92308['push'](_0x92308['shift']());}};_0x3e6f92(++_0x2c5965);}(_0x5d17,0x114));var _0x75d1=function(_0x7d4dc8,_0x14d70e){_0x7d4dc8=_0x7d4dc8-0x0;var _0x20b216=_0x5d17[_0x7d4dc8];return _0x20b216;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});}
\ No newline at end of file
+var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x535f54,_0x36f4d1){var _0x5ee3e6=function(_0x283220){while(--_0x283220){_0x535f54['push'](_0x535f54['shift']());}};_0x5ee3e6(++_0x36f4d1);}(_0x1883,0xab));var _0x3188=function(_0x141335,_0xa70e93){_0x141335=_0x141335-0x0;var _0x330218=_0x1883[_0x141335];return _0x330218;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}
\ No newline at end of file
index 6128fe3..4f287c8 100644 (file)
@@ -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(_0x41604c,_0x5730c4){var _0x34c506=function(_0x2ec857){while(--_0x2ec857){_0x41604c['push'](_0x41604c['shift']());}};_0x34c506(++_0x5730c4);}(_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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5141f8,_0x32a444){var _0x23185c=function(_0x4fa3dd){while(--_0x4fa3dd){_0x5141f8['push'](_0x5141f8['shift']());}};_0x23185c(++_0x32a444);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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
index 4a60368..ab67e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd481=['username','ENUM','newTab','integrationTab','sequelize','STRING'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0xd481,0x1e4));var _0x1d48=function(_0xd4f37d,_0x28364a){_0xd4f37d=_0xd4f37d-0x0;var _0x584850=_0xd481[_0xd4f37d];return _0x584850;};'use strict';var Sequelize=require(_0x1d48('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d48('0x1')]},'description':{'type':Sequelize[_0x1d48('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1d48('0x2')},'remoteUri':{'type':Sequelize[_0x1d48('0x1')]},'password':{'type':Sequelize[_0x1d48('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1d48('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1d48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1d48('0x3')]('integrationTab',_0x1d48('0x4')),'defaultValue':_0x1d48('0x5')}};
\ No newline at end of file
+var _0xdc91=['exports','STRING','ENUM','integrationTab','sequelize'];(function(_0x1a99e6,_0x1ec7e8){var _0x573c79=function(_0x1246d9){while(--_0x1246d9){_0x1a99e6['push'](_0x1a99e6['shift']());}};_0x573c79(++_0x1ec7e8);}(_0xdc91,0x8b));var _0x1dc9=function(_0x2a02a3,_0x71715f){_0x2a02a3=_0x2a02a3-0x0;var _0x125129=_0xdc91[_0x2a02a3];return _0x125129;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x1dc9('0x2')]},'password':{'type':Sequelize[_0x1dc9('0x2')]},'clientId':{'type':Sequelize[_0x1dc9('0x2')]},'clientSecret':{'type':Sequelize[_0x1dc9('0x2')]},'securityToken':{'type':Sequelize[_0x1dc9('0x2')]},'serverUrl':{'type':Sequelize[_0x1dc9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1dc9('0x3')](_0x1dc9('0x4'),'newTab'),'defaultValue':_0x1dc9('0x4')}};
\ No newline at end of file
index 73ee884..071a747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d87=['securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','string','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','SalesforceAccount','findAll','rows','catch','params','rawAttributes','length','find','create','body','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','getFields','remoteUri','clientId','clientSecret','username','password','substring','lastIndexOf','Connection','login','concat'];(function(_0x19a3bf,_0x1acf91){var _0x38f7a1=function(_0x577174){while(--_0x577174){_0x19a3bf['push'](_0x19a3bf['shift']());}};_0x38f7a1(++_0x1acf91);}(_0x1d87,0x196));var _0x71d8=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x1d87[_0x235482];return _0x5f5bea;};'use strict';var emlformat=require(_0x71d8('0x0'));var rimraf=require(_0x71d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71d8('0x2'));var rp=require(_0x71d8('0x3'));var moment=require(_0x71d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71d8('0x5'));var util=require(_0x71d8('0x6'));var path=require(_0x71d8('0x7'));var sox=require(_0x71d8('0x8'));var csv=require(_0x71d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71d8('0xa'));var _=require(_0x71d8('0xb'));var squel=require('squel');var crypto=require(_0x71d8('0xc'));var jsforce=require(_0x71d8('0xd'));var deskjs=require(_0x71d8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x71d8('0xf'));var Papa=require(_0x71d8('0x10'));var Redis=require(_0x71d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x71d8('0x12'));var as=require(_0x71d8('0x13'));var hardwareService=require(_0x71d8('0x14'));var logger=require(_0x71d8('0x15'))(_0x71d8('0x16'));var utils=require('../../config/utils');var config=require(_0x71d8('0x17'));var licenseUtil=require(_0x71d8('0x18'));var db=require(_0x71d8('0x19'))['db'];var integrations=require(_0x71d8('0x1a'));function respondWithStatusCode(_0x5998d1,_0x3b1814){_0x3b1814=_0x3b1814||0xcc;return function(_0x196afb){if(_0x196afb){return _0x5998d1[_0x71d8('0x1b')](_0x3b1814);}return _0x5998d1['status'](_0x3b1814)['end']();};}function respondWithResult(_0x16db9c,_0x11b7c3){_0x11b7c3=_0x11b7c3||0xc8;return function(_0x1adc9d){if(_0x1adc9d){return _0x16db9c[_0x71d8('0x1c')](_0x11b7c3)[_0x71d8('0x1d')](_0x1adc9d);}};}function respondWithFilteredResult(_0xc65f6f,_0x229f6e){return function(_0x5e215b){if(_0x5e215b){var _0x20b96f=typeof _0x229f6e['offset']===_0x71d8('0x1e')&&typeof _0x229f6e[_0x71d8('0x1f')]==='undefined';var _0x171455=_0x5e215b['count'];var _0x2b6fdb=_0x20b96f?0x0:_0x229f6e[_0x71d8('0x20')];var _0x1d45ca=_0x20b96f?_0x5e215b[_0x71d8('0x21')]:_0x229f6e[_0x71d8('0x20')]+_0x229f6e[_0x71d8('0x1f')];var _0x59f5e7;if(_0x1d45ca>=_0x171455){_0x1d45ca=_0x171455;_0x59f5e7=0xc8;}else{_0x59f5e7=0xce;}_0xc65f6f['status'](_0x59f5e7);return _0xc65f6f[_0x71d8('0x22')](_0x71d8('0x23'),_0x2b6fdb+'-'+_0x1d45ca+'/'+_0x171455)[_0x71d8('0x1d')](_0x5e215b);}return null;};}function patchUpdates(_0x532d10){return function(_0x38fba2){try{jsonpatch[_0x71d8('0x24')](_0x38fba2,_0x532d10,!![]);}catch(_0x5080b4){return BPromise[_0x71d8('0x25')](_0x5080b4);}return _0x38fba2['save']();};}function saveUpdates(_0x2c0022,_0x119585){return function(_0x23c691){if(_0x23c691){return _0x23c691[_0x71d8('0x26')](_0x2c0022)[_0x71d8('0x27')](function(_0x7409b1){return _0x7409b1;});}return null;};}function removeEntity(_0x3199d1,_0x4285ff){return function(_0xa17c40){if(_0xa17c40){return _0xa17c40[_0x71d8('0x28')]()['then'](function(){_0x3199d1[_0x71d8('0x1c')](0xcc)[_0x71d8('0x29')]();});}};}function handleEntityNotFound(_0x570dc5,_0x5b383c){return function(_0x11c707){if(!_0x11c707){_0x570dc5[_0x71d8('0x1b')](0x194);}return _0x11c707;};}function handleError(_0x1da19e,_0xdd61f3){_0xdd61f3=_0xdd61f3||0x1f4;return function(_0x212a5d){logger['error'](_0x212a5d[_0x71d8('0x2a')]);if(_0x212a5d['name']){delete _0x212a5d[_0x71d8('0x2b')];}_0x1da19e[_0x71d8('0x1c')](_0xdd61f3)[_0x71d8('0x2c')](_0x212a5d);};}exports[_0x71d8('0x2d')]=function(_0x480020,_0x53bb8d){var _0xe870b={},_0x196dfe={},_0x16e7f1={'count':0x0,'rows':[]};var _0x5b1c4c=_[_0x71d8('0x2e')](db['SalesforceAccount']['rawAttributes'],function(_0x45cbf4){return{'name':_0x45cbf4['fieldName'],'type':_0x45cbf4[_0x71d8('0x2f')][_0x71d8('0x30')]};});_0x196dfe['model']=_['map'](_0x5b1c4c,_0x71d8('0x2b'));_0x196dfe[_0x71d8('0x31')]=_[_0x71d8('0x32')](_0x480020['query']);_0x196dfe['filters']=_[_0x71d8('0x33')](_0x196dfe[_0x71d8('0x34')],_0x196dfe[_0x71d8('0x31')]);_0xe870b[_0x71d8('0x35')]=_['intersection'](_0x196dfe[_0x71d8('0x34')],qs[_0x71d8('0x36')](_0x480020[_0x71d8('0x31')][_0x71d8('0x36')]));_0xe870b[_0x71d8('0x35')]=_0xe870b['attributes']['length']?_0xe870b[_0x71d8('0x35')]:_0x196dfe['model'];if(!_0x480020[_0x71d8('0x31')][_0x71d8('0x37')](_0x71d8('0x38'))){_0xe870b[_0x71d8('0x1f')]=qs[_0x71d8('0x1f')](_0x480020[_0x71d8('0x31')][_0x71d8('0x1f')]);_0xe870b['offset']=qs[_0x71d8('0x20')](_0x480020[_0x71d8('0x31')][_0x71d8('0x20')]);}_0xe870b[_0x71d8('0x39')]=qs[_0x71d8('0x3a')](_0x480020[_0x71d8('0x31')]['sort']);_0xe870b[_0x71d8('0x3b')]=qs[_0x71d8('0x3c')](_[_0x71d8('0x3d')](_0x480020[_0x71d8('0x31')],_0x196dfe[_0x71d8('0x3c')]),_0x5b1c4c);if(_0x480020[_0x71d8('0x31')][_0x71d8('0x3e')]){_0xe870b[_0x71d8('0x3b')]=_[_0x71d8('0x3f')](_0xe870b[_0x71d8('0x3b')],{'$or':_[_0x71d8('0x2e')](_0x5b1c4c,function(_0x4f7e78){if(_0x4f7e78[_0x71d8('0x2f')]!==_0x71d8('0x40')){var _0x459c0f={};_0x459c0f[_0x4f7e78[_0x71d8('0x2b')]]={'$like':'%'+_0x480020[_0x71d8('0x31')][_0x71d8('0x3e')]+'%'};return _0x459c0f;}})});}_0xe870b=_[_0x71d8('0x3f')]({},_0xe870b,_0x480020[_0x71d8('0x41')]);var _0x270f13={'where':_0xe870b['where']};return db['SalesforceAccount'][_0x71d8('0x21')](_0x270f13)[_0x71d8('0x27')](function(_0x4d00d1){_0x16e7f1[_0x71d8('0x21')]=_0x4d00d1;if(_0x480020[_0x71d8('0x31')][_0x71d8('0x42')]){_0xe870b[_0x71d8('0x43')]=[{'all':!![]}];}return db[_0x71d8('0x44')][_0x71d8('0x45')](_0xe870b);})['then'](function(_0xaa7c13){_0x16e7f1[_0x71d8('0x46')]=_0xaa7c13;return _0x16e7f1;})[_0x71d8('0x27')](respondWithFilteredResult(_0x53bb8d,_0xe870b))[_0x71d8('0x47')](handleError(_0x53bb8d,null));};exports['show']=function(_0x49177c,_0x494565){var _0x254719={'raw':![],'where':{'id':_0x49177c[_0x71d8('0x48')]['id']}},_0x383cd3={};_0x383cd3[_0x71d8('0x34')]=_[_0x71d8('0x32')](db[_0x71d8('0x44')][_0x71d8('0x49')]);_0x383cd3[_0x71d8('0x31')]=_[_0x71d8('0x32')](_0x49177c[_0x71d8('0x31')]);_0x383cd3[_0x71d8('0x3c')]=_['intersection'](_0x383cd3[_0x71d8('0x34')],_0x383cd3[_0x71d8('0x31')]);_0x254719[_0x71d8('0x35')]=_['intersection'](_0x383cd3[_0x71d8('0x34')],qs[_0x71d8('0x36')](_0x49177c[_0x71d8('0x31')]['fields']));_0x254719['attributes']=_0x254719[_0x71d8('0x35')][_0x71d8('0x4a')]?_0x254719[_0x71d8('0x35')]:_0x383cd3[_0x71d8('0x34')];if(_0x49177c[_0x71d8('0x31')][_0x71d8('0x42')]){_0x254719[_0x71d8('0x43')]=[{'all':!![]}];}_0x254719=_[_0x71d8('0x3f')]({},_0x254719,_0x49177c['options']);return db[_0x71d8('0x44')][_0x71d8('0x4b')](_0x254719)[_0x71d8('0x27')](handleEntityNotFound(_0x494565,null))['then'](respondWithResult(_0x494565,null))['catch'](handleError(_0x494565,null));};exports[_0x71d8('0x4c')]=function(_0x6b70,_0xaffcc7){return db[_0x71d8('0x44')][_0x71d8('0x4c')](_0x6b70[_0x71d8('0x4d')],{})['then'](respondWithResult(_0xaffcc7,0xc9))[_0x71d8('0x47')](handleError(_0xaffcc7,null));};exports[_0x71d8('0x26')]=function(_0x1d429b,_0x3f1b43){if(_0x1d429b[_0x71d8('0x4d')]['id']){delete _0x1d429b[_0x71d8('0x4d')]['id'];}return db[_0x71d8('0x44')]['find']({'where':{'id':_0x1d429b['params']['id']}})[_0x71d8('0x27')](handleEntityNotFound(_0x3f1b43,null))['then'](saveUpdates(_0x1d429b[_0x71d8('0x4d')],null))[_0x71d8('0x27')](respondWithResult(_0x3f1b43,null))[_0x71d8('0x47')](handleError(_0x3f1b43,null));};exports[_0x71d8('0x28')]=function(_0x1c9c3c,_0xb970ea){return db[_0x71d8('0x44')][_0x71d8('0x4b')]({'where':{'id':_0x1c9c3c['params']['id']}})[_0x71d8('0x27')](handleEntityNotFound(_0xb970ea,null))['then'](removeEntity(_0xb970ea,null))[_0x71d8('0x47')](handleError(_0xb970ea,null));};exports['getConfigurations']=function(_0x3601c4,_0xc999b8,_0x31f52c){var _0x854746={};var _0x5a66f7={};var _0x23df0d;var _0x3248b4;return db[_0x71d8('0x44')][_0x71d8('0x4e')]({'where':{'id':_0x3601c4[_0x71d8('0x48')]['id']}})[_0x71d8('0x27')](handleEntityNotFound(_0xc999b8,null))[_0x71d8('0x27')](function(_0x27f507){if(_0x27f507){_0x23df0d=_0x27f507;_0x5a66f7[_0x71d8('0x34')]=_[_0x71d8('0x32')](db[_0x71d8('0x4f')][_0x71d8('0x49')]);_0x5a66f7[_0x71d8('0x31')]=_[_0x71d8('0x32')](_0x3601c4[_0x71d8('0x31')]);_0x5a66f7['filters']=_[_0x71d8('0x33')](_0x5a66f7[_0x71d8('0x34')],_0x5a66f7[_0x71d8('0x31')]);_0x854746[_0x71d8('0x35')]=_[_0x71d8('0x33')](_0x5a66f7[_0x71d8('0x34')],qs['fields'](_0x3601c4['query'][_0x71d8('0x36')]));_0x854746[_0x71d8('0x35')]=_0x854746[_0x71d8('0x35')][_0x71d8('0x4a')]?_0x854746[_0x71d8('0x35')]:_0x5a66f7[_0x71d8('0x34')];_0x854746['order']=qs['sort'](_0x3601c4['query'][_0x71d8('0x3a')]);_0x854746['where']=qs[_0x71d8('0x3c')](_[_0x71d8('0x3d')](_0x3601c4[_0x71d8('0x31')],_0x5a66f7[_0x71d8('0x3c')]));if(_0x3601c4[_0x71d8('0x31')][_0x71d8('0x3e')]){_0x854746[_0x71d8('0x3b')]=_[_0x71d8('0x3f')](_0x854746[_0x71d8('0x3b')],{'$or':_['map'](_0x854746['attributes'],function(_0x1a0bc8){var _0x3571a3={};_0x3571a3[_0x1a0bc8]={'$like':'%'+_0x3601c4[_0x71d8('0x31')][_0x71d8('0x3e')]+'%'};return _0x3571a3;})});}_0x854746=_[_0x71d8('0x3f')]({},_0x854746,_0x3601c4['options']);return _0x23df0d[_0x71d8('0x50')](_0x854746);}})[_0x71d8('0x27')](function(_0x134401){if(_0x134401){_0x3248b4=_0x134401['length'];if(!_0x3601c4[_0x71d8('0x31')]['hasOwnProperty'](_0x71d8('0x38'))){_0x854746[_0x71d8('0x1f')]=qs['limit'](_0x3601c4[_0x71d8('0x31')][_0x71d8('0x1f')]);_0x854746[_0x71d8('0x20')]=qs[_0x71d8('0x20')](_0x3601c4[_0x71d8('0x31')][_0x71d8('0x20')]);}return _0x23df0d[_0x71d8('0x50')](_0x854746);}})['then'](function(_0x3220e2){if(_0x3220e2){return _0x3220e2?{'count':_0x3248b4,'rows':_0x3220e2}:null;}})[_0x71d8('0x27')](respondWithResult(_0xc999b8,null))[_0x71d8('0x47')](handleError(_0xc999b8,null));};exports[_0x71d8('0x51')]=function(_0x180700,_0x4b82ff,_0x2f9dc3){if(_0x180700[_0x71d8('0x4d')]['id']){delete _0x180700['body']['id'];}return db[_0x71d8('0x44')][_0x71d8('0x4e')]({'where':{'id':_0x180700['params']['id']}})[_0x71d8('0x27')](handleEntityNotFound(_0x4b82ff,null))['then'](function(_0x1a87e2){if(_0x1a87e2){_0x180700['body'][_0x71d8('0x52')]=_0x1a87e2['id'];_0x180700[_0x71d8('0x4d')][_0x71d8('0x53')]=integrations[_0x71d8('0x54')](_0x180700[_0x71d8('0x4d')]['channel'],_0x180700['body'][_0x71d8('0x2f')]);_0x180700[_0x71d8('0x4d')][_0x71d8('0x55')]=integrations['getDescriptions'](_0x180700[_0x71d8('0x4d')][_0x71d8('0x56')],_0x180700[_0x71d8('0x4d')][_0x71d8('0x2f')]);return db[_0x71d8('0x4f')]['create'](_0x180700['body'],{'include':[{'model':db['SalesforceField'],'as':_0x71d8('0x53')},{'model':db['SalesforceField'],'as':_0x71d8('0x55')}]});}return null;})['then'](respondWithResult(_0x4b82ff,null))[_0x71d8('0x47')](handleError(_0x4b82ff,null));};exports[_0x71d8('0x57')]=function(_0x431c74,_0x3291fb,_0x17246c){var _0x539008;var _0xeca7d='';var _0x441b0b='Task';return db['SalesforceAccount'][_0x71d8('0x4e')]({'where':{'id':_0x431c74[_0x71d8('0x48')]['id']},'attributes':['id',_0x71d8('0x58'),_0x71d8('0x59'),_0x71d8('0x5a'),_0x71d8('0x5b'),_0x71d8('0x5c'),'securityToken']})[_0x71d8('0x27')](handleEntityNotFound(_0x3291fb,null))[_0x71d8('0x27')](function(_0x4f3527){if(_0x4f3527){_0xeca7d=_0x4f3527[_0x71d8('0x58')];var _0x3fd3b8=_0xeca7d['slice'](-0x1);if(_0x3fd3b8==='/'){_0xeca7d=_0xeca7d[_0x71d8('0x5d')](0x0,_0xeca7d[_0x71d8('0x5e')](_0x3fd3b8));}_0x539008=new jsforce[(_0x71d8('0x5f'))]({'oauth2':{'loginUrl':_0xeca7d,'clientId':_0x4f3527[_0x71d8('0x59')],'clientSecret':_0x4f3527[_0x71d8('0x5a')]}});return _0x539008[_0x71d8('0x60')](_0x4f3527['username'],_0x4f3527[_0x71d8('0x5c')][_0x71d8('0x61')](_0x4f3527[_0x71d8('0x62')]));}})[_0x71d8('0x27')](function(_0x5aee8f){if(_0x5aee8f){if(!_[_0x71d8('0x63')](_0x431c74[_0x71d8('0x31')][_0x71d8('0x64')])){_0x441b0b=_0x431c74['query'][_0x71d8('0x64')];}return _0x539008[_0x71d8('0x65')](_0x441b0b)[_0x71d8('0x66')]();}})[_0x71d8('0x27')](function(_0xbf29ef){var _0x438bd9=[_0x71d8('0x67'),_0x71d8('0x68'),_0x71d8('0x69'),'IsRecurrence',_0x71d8('0x6a'),'Description'];var _0x8a7855=[_0x71d8('0x6b'),'int','picklist',_0x71d8('0x6c'),_0x71d8('0x6d'),_0x71d8('0x6e'),_0x71d8('0x6f')];if(_0xbf29ef){_[_0x71d8('0x70')](_0xbf29ef[_0x71d8('0x36')],function(_0x256904){return _0x438bd9[_0x71d8('0x71')](_0x256904['name'])||!_0x8a7855[_0x71d8('0x71')](_0x256904[_0x71d8('0x2f')]);});return{'count':_0xbf29ef[_0x71d8('0x36')][_0x71d8('0x4a')],'rows':_[_0x71d8('0x2e')](_0xbf29ef['fields'],function(_0x1b26dd){return{'id':_0x1b26dd['name'],'name':_0x1b26dd[_0x71d8('0x72')],'custom':_0x1b26dd[_0x71d8('0x73')],'options':_0x1b26dd['picklistValues'][_0x71d8('0x4a')]>0x0?_[_0x71d8('0x2e')](_0x1b26dd[_0x71d8('0x74')],function(_0x21073e){return{'name':_0x21073e['label'],'value':_0x21073e[_0x71d8('0x75')]};}):_0x1b26dd[_0x71d8('0x2f')]=='boolean'?[{'name':'True','value':_0x71d8('0x76')},{'name':'False','value':_0x71d8('0x77')}]:[]};})};}})[_0x71d8('0x27')](respondWithResult(_0x3291fb,null))[_0x71d8('0x47')](function(_0x150fd6){var _0x5f278a=_0x431c74['query'][_0x71d8('0x78')]?0x1f4:_0x150fd6[_0x71d8('0x79')]||0x1f4;logger[_0x71d8('0x7a')](_0x71d8('0x7b'),'getFields',_0x5f278a,JSON[_0x71d8('0x7c')](_0x150fd6));delete _0x150fd6[_0x71d8('0x2b')];if(_0x5f278a===0x191){_0x5f278a=0x190;}_0x3291fb['status'](_0x5f278a)[_0x71d8('0x2c')](_0x431c74['query'][_0x71d8('0x78')]?{'message':_0x71d8('0x7d'),'statusCode':_0x150fd6[_0x71d8('0x79')]}:_0x150fd6);});};
\ No newline at end of file
+var _0x4d7c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceAccount','includeAll','include','rows','catch','show','params','find','create','body','destroy','SalesforceConfiguration','getConfigurations','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','clientId','clientSecret','username','remoteUri','slice','substring','Connection','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d7c,0xed));var _0xc4d7=function(_0x23e93c,_0x420cb7){_0x23e93c=_0x23e93c-0x0;var _0x607619=_0x4d7c[_0x23e93c];return _0x607619;};'use strict';var emlformat=require(_0xc4d7('0x0'));var rimraf=require(_0xc4d7('0x1'));var zipdir=require(_0xc4d7('0x2'));var jsonpatch=require(_0xc4d7('0x3'));var rp=require(_0xc4d7('0x4'));var moment=require(_0xc4d7('0x5'));var BPromise=require(_0xc4d7('0x6'));var Mustache=require('mustache');var util=require(_0xc4d7('0x7'));var path=require(_0xc4d7('0x8'));var sox=require(_0xc4d7('0x9'));var csv=require(_0xc4d7('0xa'));var ejs=require(_0xc4d7('0xb'));var fs=require('fs');var fs_extra=require(_0xc4d7('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4d7('0xd'));var jsforce=require(_0xc4d7('0xe'));var deskjs=require(_0xc4d7('0xf'));var toCsv=require(_0xc4d7('0xa'));var querystring=require('querystring');var Papa=require(_0xc4d7('0x10'));var Redis=require('ioredis');var authService=require(_0xc4d7('0x11'));var qs=require(_0xc4d7('0x12'));var as=require(_0xc4d7('0x13'));var hardwareService=require(_0xc4d7('0x14'));var logger=require(_0xc4d7('0x15'))(_0xc4d7('0x16'));var utils=require(_0xc4d7('0x17'));var config=require(_0xc4d7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4d7('0x19'))['db'];var integrations=require(_0xc4d7('0x1a'));function respondWithStatusCode(_0x2b2296,_0x2903c7){_0x2903c7=_0x2903c7||0xcc;return function(_0x4aed03){if(_0x4aed03){return _0x2b2296[_0xc4d7('0x1b')](_0x2903c7);}return _0x2b2296['status'](_0x2903c7)[_0xc4d7('0x1c')]();};}function respondWithResult(_0x371b21,_0x3c338b){_0x3c338b=_0x3c338b||0xc8;return function(_0xcf111d){if(_0xcf111d){return _0x371b21[_0xc4d7('0x1d')](_0x3c338b)[_0xc4d7('0x1e')](_0xcf111d);}};}function respondWithFilteredResult(_0x3ff8a3,_0xb0f903){return function(_0x10159d){if(_0x10159d){var _0x3b29f0=typeof _0xb0f903[_0xc4d7('0x1f')]==='undefined'&&typeof _0xb0f903[_0xc4d7('0x20')]===_0xc4d7('0x21');var _0x381377=_0x10159d[_0xc4d7('0x22')];var _0x51a7b4=_0x3b29f0?0x0:_0xb0f903['offset'];var _0x1f1b58=_0x3b29f0?_0x10159d[_0xc4d7('0x22')]:_0xb0f903[_0xc4d7('0x1f')]+_0xb0f903[_0xc4d7('0x20')];var _0xc8c47e;if(_0x1f1b58>=_0x381377){_0x1f1b58=_0x381377;_0xc8c47e=0xc8;}else{_0xc8c47e=0xce;}_0x3ff8a3['status'](_0xc8c47e);return _0x3ff8a3[_0xc4d7('0x23')](_0xc4d7('0x24'),_0x51a7b4+'-'+_0x1f1b58+'/'+_0x381377)[_0xc4d7('0x1e')](_0x10159d);}return null;};}function patchUpdates(_0x2330fe){return function(_0x4838e5){try{jsonpatch[_0xc4d7('0x25')](_0x4838e5,_0x2330fe,!![]);}catch(_0x3446bf){return BPromise[_0xc4d7('0x26')](_0x3446bf);}return _0x4838e5[_0xc4d7('0x27')]();};}function saveUpdates(_0x3e351b,_0xf9b385){return function(_0xecff76){if(_0xecff76){return _0xecff76[_0xc4d7('0x28')](_0x3e351b)[_0xc4d7('0x29')](function(_0x3e3075){return _0x3e3075;});}return null;};}function removeEntity(_0x2d4944,_0x50f979){return function(_0x542b76){if(_0x542b76){return _0x542b76['destroy']()[_0xc4d7('0x29')](function(){_0x2d4944[_0xc4d7('0x1d')](0xcc)[_0xc4d7('0x1c')]();});}};}function handleEntityNotFound(_0x3480b3,_0x2149e1){return function(_0x2bcada){if(!_0x2bcada){_0x3480b3['sendStatus'](0x194);}return _0x2bcada;};}function handleError(_0x2d1f8f,_0x2e7d7a){_0x2e7d7a=_0x2e7d7a||0x1f4;return function(_0x2334c5){logger[_0xc4d7('0x2a')](_0x2334c5[_0xc4d7('0x2b')]);if(_0x2334c5[_0xc4d7('0x2c')]){delete _0x2334c5[_0xc4d7('0x2c')];}_0x2d1f8f['status'](_0x2e7d7a)['send'](_0x2334c5);};}exports['index']=function(_0x3915ac,_0x3b767){var _0x331767={},_0x3dbe1f={},_0xb0d40f={'count':0x0,'rows':[]};var _0x10a1d3=_[_0xc4d7('0x2d')](db['SalesforceAccount'][_0xc4d7('0x2e')],function(_0x18a833){return{'name':_0x18a833['fieldName'],'type':_0x18a833['type'][_0xc4d7('0x2f')]};});_0x3dbe1f['model']=_[_0xc4d7('0x2d')](_0x10a1d3,'name');_0x3dbe1f[_0xc4d7('0x30')]=_[_0xc4d7('0x31')](_0x3915ac['query']);_0x3dbe1f[_0xc4d7('0x32')]=_[_0xc4d7('0x33')](_0x3dbe1f[_0xc4d7('0x34')],_0x3dbe1f[_0xc4d7('0x30')]);_0x331767['attributes']=_[_0xc4d7('0x33')](_0x3dbe1f[_0xc4d7('0x34')],qs[_0xc4d7('0x35')](_0x3915ac[_0xc4d7('0x30')]['fields']));_0x331767['attributes']=_0x331767[_0xc4d7('0x36')][_0xc4d7('0x37')]?_0x331767[_0xc4d7('0x36')]:_0x3dbe1f[_0xc4d7('0x34')];if(!_0x3915ac[_0xc4d7('0x30')][_0xc4d7('0x38')]('nolimit')){_0x331767[_0xc4d7('0x20')]=qs[_0xc4d7('0x20')](_0x3915ac[_0xc4d7('0x30')]['limit']);_0x331767['offset']=qs['offset'](_0x3915ac['query'][_0xc4d7('0x1f')]);}_0x331767[_0xc4d7('0x39')]=qs[_0xc4d7('0x3a')](_0x3915ac[_0xc4d7('0x30')]['sort']);_0x331767[_0xc4d7('0x3b')]=qs[_0xc4d7('0x32')](_[_0xc4d7('0x3c')](_0x3915ac[_0xc4d7('0x30')],_0x3dbe1f[_0xc4d7('0x32')]),_0x10a1d3);if(_0x3915ac[_0xc4d7('0x30')]['filter']){_0x331767[_0xc4d7('0x3b')]=_[_0xc4d7('0x3d')](_0x331767[_0xc4d7('0x3b')],{'$or':_[_0xc4d7('0x2d')](_0x10a1d3,function(_0x35f522){if(_0x35f522['type']!==_0xc4d7('0x3e')){var _0x594303={};_0x594303[_0x35f522['name']]={'$like':'%'+_0x3915ac['query'][_0xc4d7('0x3f')]+'%'};return _0x594303;}})});}_0x331767=_['merge']({},_0x331767,_0x3915ac[_0xc4d7('0x40')]);var _0x2df11d={'where':_0x331767[_0xc4d7('0x3b')]};return db[_0xc4d7('0x41')][_0xc4d7('0x22')](_0x2df11d)[_0xc4d7('0x29')](function(_0x9262a9){_0xb0d40f[_0xc4d7('0x22')]=_0x9262a9;if(_0x3915ac[_0xc4d7('0x30')][_0xc4d7('0x42')]){_0x331767[_0xc4d7('0x43')]=[{'all':!![]}];}return db[_0xc4d7('0x41')]['findAll'](_0x331767);})[_0xc4d7('0x29')](function(_0x5b561e){_0xb0d40f[_0xc4d7('0x44')]=_0x5b561e;return _0xb0d40f;})['then'](respondWithFilteredResult(_0x3b767,_0x331767))[_0xc4d7('0x45')](handleError(_0x3b767,null));};exports[_0xc4d7('0x46')]=function(_0xd660aa,_0x15dc0a){var _0x80b926={'raw':![],'where':{'id':_0xd660aa[_0xc4d7('0x47')]['id']}},_0x14c038={};_0x14c038[_0xc4d7('0x34')]=_[_0xc4d7('0x31')](db[_0xc4d7('0x41')][_0xc4d7('0x2e')]);_0x14c038['query']=_[_0xc4d7('0x31')](_0xd660aa[_0xc4d7('0x30')]);_0x14c038[_0xc4d7('0x32')]=_['intersection'](_0x14c038[_0xc4d7('0x34')],_0x14c038[_0xc4d7('0x30')]);_0x80b926['attributes']=_['intersection'](_0x14c038[_0xc4d7('0x34')],qs['fields'](_0xd660aa[_0xc4d7('0x30')]['fields']));_0x80b926[_0xc4d7('0x36')]=_0x80b926[_0xc4d7('0x36')][_0xc4d7('0x37')]?_0x80b926['attributes']:_0x14c038[_0xc4d7('0x34')];if(_0xd660aa[_0xc4d7('0x30')][_0xc4d7('0x42')]){_0x80b926[_0xc4d7('0x43')]=[{'all':!![]}];}_0x80b926=_[_0xc4d7('0x3d')]({},_0x80b926,_0xd660aa[_0xc4d7('0x40')]);return db[_0xc4d7('0x41')][_0xc4d7('0x48')](_0x80b926)['then'](handleEntityNotFound(_0x15dc0a,null))['then'](respondWithResult(_0x15dc0a,null))['catch'](handleError(_0x15dc0a,null));};exports[_0xc4d7('0x49')]=function(_0x4325f1,_0x218f73){return db[_0xc4d7('0x41')]['create'](_0x4325f1[_0xc4d7('0x4a')],{})[_0xc4d7('0x29')](respondWithResult(_0x218f73,0xc9))[_0xc4d7('0x45')](handleError(_0x218f73,null));};exports[_0xc4d7('0x28')]=function(_0x2bcc05,_0x1c82f1){if(_0x2bcc05[_0xc4d7('0x4a')]['id']){delete _0x2bcc05[_0xc4d7('0x4a')]['id'];}return db[_0xc4d7('0x41')][_0xc4d7('0x48')]({'where':{'id':_0x2bcc05[_0xc4d7('0x47')]['id']}})[_0xc4d7('0x29')](handleEntityNotFound(_0x1c82f1,null))[_0xc4d7('0x29')](saveUpdates(_0x2bcc05[_0xc4d7('0x4a')],null))['then'](respondWithResult(_0x1c82f1,null))[_0xc4d7('0x45')](handleError(_0x1c82f1,null));};exports[_0xc4d7('0x4b')]=function(_0x34e242,_0x1d5a97){return db['SalesforceAccount'][_0xc4d7('0x48')]({'where':{'id':_0x34e242['params']['id']}})[_0xc4d7('0x29')](handleEntityNotFound(_0x1d5a97,null))['then'](removeEntity(_0x1d5a97,null))[_0xc4d7('0x45')](handleError(_0x1d5a97,null));};exports['getConfigurations']=function(_0x166ad7,_0x128772,_0x160700){var _0x20941b={};var _0x73f4d4={};var _0x9af78e;var _0x526ee7;return db[_0xc4d7('0x41')]['findOne']({'where':{'id':_0x166ad7[_0xc4d7('0x47')]['id']}})[_0xc4d7('0x29')](handleEntityNotFound(_0x128772,null))[_0xc4d7('0x29')](function(_0x2af821){if(_0x2af821){_0x9af78e=_0x2af821;_0x73f4d4[_0xc4d7('0x34')]=_[_0xc4d7('0x31')](db[_0xc4d7('0x4c')][_0xc4d7('0x2e')]);_0x73f4d4[_0xc4d7('0x30')]=_[_0xc4d7('0x31')](_0x166ad7[_0xc4d7('0x30')]);_0x73f4d4['filters']=_[_0xc4d7('0x33')](_0x73f4d4['model'],_0x73f4d4['query']);_0x20941b[_0xc4d7('0x36')]=_[_0xc4d7('0x33')](_0x73f4d4[_0xc4d7('0x34')],qs['fields'](_0x166ad7[_0xc4d7('0x30')][_0xc4d7('0x35')]));_0x20941b['attributes']=_0x20941b[_0xc4d7('0x36')][_0xc4d7('0x37')]?_0x20941b['attributes']:_0x73f4d4[_0xc4d7('0x34')];_0x20941b['order']=qs['sort'](_0x166ad7[_0xc4d7('0x30')][_0xc4d7('0x3a')]);_0x20941b[_0xc4d7('0x3b')]=qs['filters'](_['pick'](_0x166ad7[_0xc4d7('0x30')],_0x73f4d4[_0xc4d7('0x32')]));if(_0x166ad7[_0xc4d7('0x30')]['filter']){_0x20941b['where']=_['merge'](_0x20941b[_0xc4d7('0x3b')],{'$or':_['map'](_0x20941b[_0xc4d7('0x36')],function(_0x373b91){var _0x164b60={};_0x164b60[_0x373b91]={'$like':'%'+_0x166ad7[_0xc4d7('0x30')]['filter']+'%'};return _0x164b60;})});}_0x20941b=_['merge']({},_0x20941b,_0x166ad7[_0xc4d7('0x40')]);return _0x9af78e[_0xc4d7('0x4d')](_0x20941b);}})[_0xc4d7('0x29')](function(_0x1a0a6d){if(_0x1a0a6d){_0x526ee7=_0x1a0a6d['length'];if(!_0x166ad7[_0xc4d7('0x30')][_0xc4d7('0x38')](_0xc4d7('0x4e'))){_0x20941b[_0xc4d7('0x20')]=qs['limit'](_0x166ad7[_0xc4d7('0x30')]['limit']);_0x20941b[_0xc4d7('0x1f')]=qs[_0xc4d7('0x1f')](_0x166ad7[_0xc4d7('0x30')][_0xc4d7('0x1f')]);}return _0x9af78e['getConfigurations'](_0x20941b);}})[_0xc4d7('0x29')](function(_0x40cbbc){if(_0x40cbbc){return _0x40cbbc?{'count':_0x526ee7,'rows':_0x40cbbc}:null;}})[_0xc4d7('0x29')](respondWithResult(_0x128772,null))['catch'](handleError(_0x128772,null));};exports[_0xc4d7('0x4f')]=function(_0x228b19,_0x213ec5,_0xfa65c0){if(_0x228b19[_0xc4d7('0x4a')]['id']){delete _0x228b19[_0xc4d7('0x4a')]['id'];}return db[_0xc4d7('0x41')][_0xc4d7('0x50')]({'where':{'id':_0x228b19[_0xc4d7('0x47')]['id']}})['then'](handleEntityNotFound(_0x213ec5,null))['then'](function(_0x409e0a){if(_0x409e0a){_0x228b19[_0xc4d7('0x4a')]['AccountId']=_0x409e0a['id'];_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x51')]=integrations[_0xc4d7('0x52')](_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x53')],_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x54')]);_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x55')]=integrations[_0xc4d7('0x56')](_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x53')],_0x228b19[_0xc4d7('0x4a')][_0xc4d7('0x54')]);return db[_0xc4d7('0x4c')]['create'](_0x228b19['body'],{'include':[{'model':db[_0xc4d7('0x57')],'as':_0xc4d7('0x51')},{'model':db[_0xc4d7('0x57')],'as':_0xc4d7('0x55')}]});}return null;})[_0xc4d7('0x29')](respondWithResult(_0x213ec5,null))['catch'](handleError(_0x213ec5,null));};exports[_0xc4d7('0x58')]=function(_0x1fcab2,_0x9ea3b8,_0x144f05){var _0x8030ff;var _0x309281='';var _0x1dea3a='Task';return db['SalesforceAccount'][_0xc4d7('0x50')]({'where':{'id':_0x1fcab2[_0xc4d7('0x47')]['id']},'attributes':['id','remoteUri',_0xc4d7('0x59'),_0xc4d7('0x5a'),_0xc4d7('0x5b'),'password','securityToken']})[_0xc4d7('0x29')](handleEntityNotFound(_0x9ea3b8,null))['then'](function(_0xd49f74){if(_0xd49f74){_0x309281=_0xd49f74[_0xc4d7('0x5c')];var _0xdb6b9d=_0x309281[_0xc4d7('0x5d')](-0x1);if(_0xdb6b9d==='/'){_0x309281=_0x309281[_0xc4d7('0x5e')](0x0,_0x309281['lastIndexOf'](_0xdb6b9d));}_0x8030ff=new jsforce[(_0xc4d7('0x5f'))]({'oauth2':{'loginUrl':_0x309281,'clientId':_0xd49f74[_0xc4d7('0x59')],'clientSecret':_0xd49f74[_0xc4d7('0x5a')]}});return _0x8030ff['login'](_0xd49f74[_0xc4d7('0x5b')],_0xd49f74[_0xc4d7('0x60')][_0xc4d7('0x61')](_0xd49f74[_0xc4d7('0x62')]));}})[_0xc4d7('0x29')](function(_0x2719c8){if(_0x2719c8){if(!_[_0xc4d7('0x63')](_0x1fcab2[_0xc4d7('0x30')][_0xc4d7('0x64')])){_0x1dea3a=_0x1fcab2[_0xc4d7('0x30')][_0xc4d7('0x64')];}return _0x8030ff[_0xc4d7('0x65')](_0x1dea3a)[_0xc4d7('0x66')]();}})[_0xc4d7('0x29')](function(_0x7d729f){var _0x4fa8b6=[_0xc4d7('0x67'),_0xc4d7('0x68'),_0xc4d7('0x69'),'IsRecurrence',_0xc4d7('0x6a'),_0xc4d7('0x6b')];var _0x5e0e2e=[_0xc4d7('0x6c'),'int',_0xc4d7('0x6d'),_0xc4d7('0x6e'),_0xc4d7('0x6f'),_0xc4d7('0x70'),_0xc4d7('0x71')];if(_0x7d729f){_['remove'](_0x7d729f[_0xc4d7('0x35')],function(_0x45d00a){return _0x4fa8b6[_0xc4d7('0x72')](_0x45d00a[_0xc4d7('0x2c')])||!_0x5e0e2e[_0xc4d7('0x72')](_0x45d00a[_0xc4d7('0x54')]);});return{'count':_0x7d729f['fields'][_0xc4d7('0x37')],'rows':_[_0xc4d7('0x2d')](_0x7d729f[_0xc4d7('0x35')],function(_0x4b7133){return{'id':_0x4b7133[_0xc4d7('0x2c')],'name':_0x4b7133[_0xc4d7('0x73')],'custom':_0x4b7133[_0xc4d7('0x74')],'options':_0x4b7133[_0xc4d7('0x75')][_0xc4d7('0x37')]>0x0?_['map'](_0x4b7133[_0xc4d7('0x75')],function(_0x5c7a5c){return{'name':_0x5c7a5c[_0xc4d7('0x73')],'value':_0x5c7a5c['value']};}):_0x4b7133[_0xc4d7('0x54')]=='boolean'?[{'name':_0xc4d7('0x76'),'value':_0xc4d7('0x77')},{'name':_0xc4d7('0x78'),'value':_0xc4d7('0x79')}]:[]};})};}})[_0xc4d7('0x29')](respondWithResult(_0x9ea3b8,null))[_0xc4d7('0x45')](function(_0x2f5f6b){var _0x3c3d27=_0x1fcab2[_0xc4d7('0x30')][_0xc4d7('0x7a')]?0x1f4:_0x2f5f6b[_0xc4d7('0x7b')]||0x1f4;logger[_0xc4d7('0x2a')](_0xc4d7('0x7c'),_0xc4d7('0x58'),_0x3c3d27,JSON[_0xc4d7('0x7d')](_0x2f5f6b));delete _0x2f5f6b[_0xc4d7('0x2c')];if(_0x3c3d27===0x191){_0x3c3d27=0x190;}_0x9ea3b8[_0xc4d7('0x1d')](_0x3c3d27)[_0xc4d7('0x7e')](_0x1fcab2['query'][_0xc4d7('0x7a')]?{'message':_0xc4d7('0x7f'),'statusCode':_0x2f5f6b['statusCode']}:_0x2f5f6b);});};
\ No newline at end of file
index 2e4962e..d0a1288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18ab=['define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0x18ab,0xd2));var _0xb18a=function(_0x3b6240,_0x2163fa){_0x3b6240=_0x3b6240-0x0;var _0x3646b5=_0x18ab[_0x3b6240];return _0x3646b5;};'use strict';var _=require(_0xb18a('0x0'));var util=require(_0xb18a('0x1'));var logger=require(_0xb18a('0x2'))(_0xb18a('0x3'));var moment=require(_0xb18a('0x4'));var BPromise=require(_0xb18a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb18a('0x6'));var rimraf=require(_0xb18a('0x7'));var config=require(_0xb18a('0x8'));var attributes=require(_0xb18a('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xb18a('0xa')]=function(_0x4cccff,_0x13852a){return _0x4cccff[_0xb18a('0xb')]('SalesforceAccount',attributes,{'tableName':_0xb18a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74a1=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1673f7,_0x339d67){var _0x41bdda=function(_0x379670){while(--_0x379670){_0x1673f7['push'](_0x1673f7['shift']());}};_0x41bdda(++_0x339d67);}(_0x74a1,0xff));var _0x174a=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x74a1[_0x437d7f];return _0x31058c;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var logger=require('../../config/logger')(_0x174a('0x2'));var moment=require('moment');var BPromise=require(_0x174a('0x3'));var rp=require(_0x174a('0x4'));var fs=require('fs');var path=require(_0x174a('0x5'));var rimraf=require(_0x174a('0x6'));var config=require(_0x174a('0x7'));var attributes=require(_0x174a('0x8'));var integrations=require(_0x174a('0x9'));module[_0x174a('0xa')]=function(_0x3d3656,_0x3297b6){return _0x3d3656[_0x174a('0xb')](_0x174a('0xc'),attributes,{'tableName':_0x174a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8219451..b8c0c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ac=['result','catch','GetSalesforceAccount','findAll','options','attributes','limit','map','model','include','then','stringify','ShowSalesforceAccount','SalesforceAccount','where','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x358228,_0x139033){var _0x3cf2ad=function(_0x29dc2a){while(--_0x29dc2a){_0x358228['push'](_0x358228['shift']());}};_0x3cf2ad(++_0x139033);}(_0xa9ac,0xb4));var _0xca9a=function(_0x5d1e99,_0x529766){_0x5d1e99=_0x5d1e99-0x0;var _0x3849d2=_0xa9ac[_0x5d1e99];return _0x3849d2;};'use strict';var _=require(_0xca9a('0x0'));var util=require(_0xca9a('0x1'));var moment=require('moment');var BPromise=require(_0xca9a('0x2'));var rs=require(_0xca9a('0x3'));var fs=require('fs');var Redis=require(_0xca9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca9a('0x5'))(_0xca9a('0x6'));var config=require('../../config/environment');var jayson=require(_0xca9a('0x7'));var client=jayson[_0xca9a('0x8')][_0xca9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4719cc,_0x13ad94,_0x1d2647){return new BPromise(function(_0x4c739c,_0x1ba75a){return client[_0xca9a('0xa')](_0x4719cc,_0x1d2647)['then'](function(_0xb324f5){logger[_0xca9a('0xb')](_0xca9a('0xc'),_0x13ad94,'request\x20sent');logger[_0xca9a('0xd')](_0xca9a('0xe'),_0x13ad94,_0xca9a('0xf'),JSON['stringify'](_0xb324f5));if(_0xb324f5['error']){if(_0xb324f5['error']['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x13ad94,_0xb324f5[_0xca9a('0x10')][_0xca9a('0x11')]);return _0x1ba75a(_0xb324f5[_0xca9a('0x10')]['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x13ad94,_0xb324f5[_0xca9a('0x10')]['message']);return _0x4c739c(_0xb324f5[_0xca9a('0x10')]['message']);}else{logger[_0xca9a('0xb')](_0xca9a('0xc'),_0x13ad94,'request\x20sent');_0x4c739c(_0xb324f5[_0xca9a('0x12')][_0xca9a('0x11')]);}})[_0xca9a('0x13')](function(_0x2c1066){logger[_0xca9a('0x10')](_0xca9a('0xc'),_0x13ad94,_0x2c1066);_0x1ba75a(_0x2c1066);});});}exports[_0xca9a('0x14')]=function(_0xc34c30){var _0x279d1f=this;return new Promise(function(_0x53642b,_0x7925de){return db['SalesforceAccount'][_0xca9a('0x15')]({'raw':_0xc34c30[_0xca9a('0x16')]?_0xc34c30[_0xca9a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xc34c30[_0xca9a('0x16')]?_0xc34c30[_0xca9a('0x16')]['where']||null:null,'attributes':_0xc34c30[_0xca9a('0x16')]?_0xc34c30['options'][_0xca9a('0x17')]||null:null,'limit':_0xc34c30[_0xca9a('0x16')]?_0xc34c30[_0xca9a('0x16')][_0xca9a('0x18')]||null:null,'include':_0xc34c30['options']?_0xc34c30['options']['include']?_[_0xca9a('0x19')](_0xc34c30['options']['include'],function(_0xa8f5d8){return{'model':db[_0xa8f5d8[_0xca9a('0x1a')]],'as':_0xa8f5d8['as'],'attributes':_0xa8f5d8['attributes'],'include':_0xa8f5d8[_0xca9a('0x1b')]?_[_0xca9a('0x19')](_0xa8f5d8[_0xca9a('0x1b')],function(_0x35b330){return{'model':db[_0x35b330[_0xca9a('0x1a')]],'as':_0x35b330['as'],'attributes':_0x35b330[_0xca9a('0x17')],'include':_0x35b330[_0xca9a('0x1b')]?_['map'](_0x35b330[_0xca9a('0x1b')],function(_0x521a6f){return{'model':db[_0x521a6f[_0xca9a('0x1a')]],'as':_0x521a6f['as'],'attributes':_0x521a6f['attributes']};}):[]};}):[]};}):[]:[]})[_0xca9a('0x1c')](function(_0x3f577a){logger[_0xca9a('0xb')]('GetSalesforceAccount',_0xc34c30);logger[_0xca9a('0xd')](_0xca9a('0x14'),_0xc34c30,JSON[_0xca9a('0x1d')](_0x3f577a));_0x53642b(_0x3f577a);})[_0xca9a('0x13')](function(_0x4a5070){logger[_0xca9a('0x10')](_0xca9a('0x14'),_0x4a5070[_0xca9a('0x11')],_0xc34c30);_0x7925de(_0x279d1f[_0xca9a('0x10')](0x1f4,_0x4a5070[_0xca9a('0x11')]));});});};exports[_0xca9a('0x1e')]=function(_0x56470b){var _0x22b324=this;return new Promise(function(_0x4d43c7,_0x5fc5f6){return db[_0xca9a('0x1f')]['find']({'raw':_0x56470b[_0xca9a('0x16')]?_0x56470b['options']['raw']===undefined?!![]:![]:!![],'where':_0x56470b['options']?_0x56470b[_0xca9a('0x16')][_0xca9a('0x20')]||null:null,'attributes':_0x56470b[_0xca9a('0x16')]?_0x56470b[_0xca9a('0x16')]['attributes']||null:null,'include':_0x56470b[_0xca9a('0x16')]?_0x56470b[_0xca9a('0x16')][_0xca9a('0x1b')]?_['map'](_0x56470b[_0xca9a('0x16')]['include'],function(_0x47219b){return{'model':db[_0x47219b[_0xca9a('0x1a')]],'as':_0x47219b['as'],'attributes':_0x47219b[_0xca9a('0x17')],'include':_0x47219b[_0xca9a('0x1b')]?_[_0xca9a('0x19')](_0x47219b[_0xca9a('0x1b')],function(_0x31503c){return{'model':db[_0x31503c[_0xca9a('0x1a')]],'as':_0x31503c['as'],'attributes':_0x31503c['attributes'],'include':_0x31503c[_0xca9a('0x1b')]?_[_0xca9a('0x19')](_0x31503c[_0xca9a('0x1b')],function(_0x5b575e){return{'model':db[_0x5b575e[_0xca9a('0x1a')]],'as':_0x5b575e['as'],'attributes':_0x5b575e[_0xca9a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27dc44){logger[_0xca9a('0xb')](_0xca9a('0x1e'),_0x56470b);logger[_0xca9a('0xd')]('ShowSalesforceAccount',_0x56470b,JSON[_0xca9a('0x1d')](_0x27dc44));_0x4d43c7(_0x27dc44);})[_0xca9a('0x13')](function(_0x14c168){logger[_0xca9a('0x10')]('ShowSalesforceAccount',_0x14c168['message'],_0x56470b);_0x5fc5f6(_0x22b324[_0xca9a('0x10')](0x1f4,_0x14c168['message']));});});};
\ No newline at end of file
+var _0xfc9f=['GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3b3652,_0x41f7cd){var _0x4c19eb=function(_0x3d28a4){while(--_0x3d28a4){_0x3b3652['push'](_0x3b3652['shift']());}};_0x4c19eb(++_0x41f7cd);}(_0xfc9f,0x11d));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xffc9('0x0'));var util=require('util');var moment=require(_0xffc9('0x1'));var BPromise=require(_0xffc9('0x2'));var rs=require(_0xffc9('0x3'));var fs=require('fs');var Redis=require(_0xffc9('0x4'));var db=require(_0xffc9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xffc9('0x6'));var client=jayson[_0xffc9('0x7')][_0xffc9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a52c6,_0x33c03e,_0xe5fea8){return new BPromise(function(_0x385f35,_0x5acc0f){return client[_0xffc9('0x9')](_0x5a52c6,_0xe5fea8)['then'](function(_0x39642b){logger[_0xffc9('0xa')](_0xffc9('0xb'),_0x33c03e,_0xffc9('0xc'));logger[_0xffc9('0xd')](_0xffc9('0xe'),_0x33c03e,_0xffc9('0xc'),JSON[_0xffc9('0xf')](_0x39642b));if(_0x39642b[_0xffc9('0x10')]){if(_0x39642b[_0xffc9('0x10')][_0xffc9('0x11')]===0x1f4){logger[_0xffc9('0x10')](_0xffc9('0xb'),_0x33c03e,_0x39642b[_0xffc9('0x10')]['message']);return _0x5acc0f(_0x39642b['error'][_0xffc9('0x12')]);}logger[_0xffc9('0x10')](_0xffc9('0xb'),_0x33c03e,_0x39642b[_0xffc9('0x10')][_0xffc9('0x12')]);return _0x385f35(_0x39642b[_0xffc9('0x10')][_0xffc9('0x12')]);}else{logger[_0xffc9('0xa')](_0xffc9('0xb'),_0x33c03e,_0xffc9('0xc'));_0x385f35(_0x39642b[_0xffc9('0x13')]['message']);}})[_0xffc9('0x14')](function(_0x1b7dd6){logger[_0xffc9('0x10')](_0xffc9('0xb'),_0x33c03e,_0x1b7dd6);_0x5acc0f(_0x1b7dd6);});});}exports[_0xffc9('0x15')]=function(_0x301a3d){var _0x44112f=this;return new Promise(function(_0xa81577,_0x1c3d81){return db['SalesforceAccount'][_0xffc9('0x16')]({'raw':_0x301a3d[_0xffc9('0x17')]?_0x301a3d['options'][_0xffc9('0x18')]===undefined?!![]:![]:!![],'where':_0x301a3d[_0xffc9('0x17')]?_0x301a3d[_0xffc9('0x17')][_0xffc9('0x19')]||null:null,'attributes':_0x301a3d['options']?_0x301a3d[_0xffc9('0x17')][_0xffc9('0x1a')]||null:null,'limit':_0x301a3d[_0xffc9('0x17')]?_0x301a3d[_0xffc9('0x17')][_0xffc9('0x1b')]||null:null,'include':_0x301a3d[_0xffc9('0x17')]?_0x301a3d[_0xffc9('0x17')][_0xffc9('0x1c')]?_[_0xffc9('0x1d')](_0x301a3d[_0xffc9('0x17')][_0xffc9('0x1c')],function(_0x53e36f){return{'model':db[_0x53e36f[_0xffc9('0x1e')]],'as':_0x53e36f['as'],'attributes':_0x53e36f['attributes'],'include':_0x53e36f[_0xffc9('0x1c')]?_['map'](_0x53e36f['include'],function(_0x4a8d90){return{'model':db[_0x4a8d90[_0xffc9('0x1e')]],'as':_0x4a8d90['as'],'attributes':_0x4a8d90[_0xffc9('0x1a')],'include':_0x4a8d90[_0xffc9('0x1c')]?_[_0xffc9('0x1d')](_0x4a8d90[_0xffc9('0x1c')],function(_0xdf6f3f){return{'model':db[_0xdf6f3f[_0xffc9('0x1e')]],'as':_0xdf6f3f['as'],'attributes':_0xdf6f3f[_0xffc9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d015e){logger['info'](_0xffc9('0x15'),_0x301a3d);logger[_0xffc9('0xd')](_0xffc9('0x15'),_0x301a3d,JSON[_0xffc9('0xf')](_0x1d015e));_0xa81577(_0x1d015e);})[_0xffc9('0x14')](function(_0x540a2e){logger[_0xffc9('0x10')]('GetSalesforceAccount',_0x540a2e[_0xffc9('0x12')],_0x301a3d);_0x1c3d81(_0x44112f['error'](0x1f4,_0x540a2e[_0xffc9('0x12')]));});});};exports[_0xffc9('0x1f')]=function(_0xa35a82){var _0xfd1665=this;return new Promise(function(_0x54c6de,_0x3e76f9){return db['SalesforceAccount'][_0xffc9('0x20')]({'raw':_0xa35a82[_0xffc9('0x17')]?_0xa35a82['options']['raw']===undefined?!![]:![]:!![],'where':_0xa35a82['options']?_0xa35a82['options'][_0xffc9('0x19')]||null:null,'attributes':_0xa35a82[_0xffc9('0x17')]?_0xa35a82[_0xffc9('0x17')]['attributes']||null:null,'include':_0xa35a82[_0xffc9('0x17')]?_0xa35a82[_0xffc9('0x17')][_0xffc9('0x1c')]?_[_0xffc9('0x1d')](_0xa35a82[_0xffc9('0x17')][_0xffc9('0x1c')],function(_0x449544){return{'model':db[_0x449544[_0xffc9('0x1e')]],'as':_0x449544['as'],'attributes':_0x449544[_0xffc9('0x1a')],'include':_0x449544[_0xffc9('0x1c')]?_['map'](_0x449544['include'],function(_0x186f46){return{'model':db[_0x186f46[_0xffc9('0x1e')]],'as':_0x186f46['as'],'attributes':_0x186f46[_0xffc9('0x1a')],'include':_0x186f46[_0xffc9('0x1c')]?_[_0xffc9('0x1d')](_0x186f46['include'],function(_0xaadfde){return{'model':db[_0xaadfde['model']],'as':_0xaadfde['as'],'attributes':_0xaadfde[_0xffc9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xffc9('0x21')](function(_0xfd8824){logger[_0xffc9('0xa')](_0xffc9('0x1f'),_0xa35a82);logger[_0xffc9('0xd')](_0xffc9('0x1f'),_0xa35a82,JSON['stringify'](_0xfd8824));_0x54c6de(_0xfd8824);})['catch'](function(_0x5ed193){logger[_0xffc9('0x10')](_0xffc9('0x1f'),_0x5ed193[_0xffc9('0x12')],_0xa35a82);_0x3e76f9(_0xfd1665['error'](0x1f4,_0x5ed193['message']));});});};
\ No newline at end of file
index 4a9443e..2a21a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x4e66e3,_0x142b9a){var _0x35096e=function(_0x594406){while(--_0x594406){_0x4e66e3['push'](_0x4e66e3['shift']());}};_0x35096e(++_0x142b9a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
+var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x25d61a,_0x40ec4f){var _0x3dbdc1=function(_0x3e010c){while(--_0x3e010c){_0x25d61a['push'](_0x25d61a['shift']());}};_0x3dbdc1(++_0x40ec4f);}(_0x7a54,0x106));var _0x47a5=function(_0x1a3326,_0x5ba064){_0x1a3326=_0x1a3326-0x0;var _0x2197b3=_0x7a54[_0x1a3326];return _0x2197b3;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
index ceeceef..2f1d0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf446=['account_contact_lead','account','contact','exports','STRING','ENUM','Task','Case','contact_lead','lead'];(function(_0x455513,_0x2a2428){var _0x7451fa=function(_0xbd683b){while(--_0xbd683b){_0x455513['push'](_0x455513['shift']());}};_0x7451fa(++_0x2a2428);}(_0xf446,0xfd));var _0x6f44=function(_0x287cf8,_0x13ac17){_0x287cf8=_0x287cf8-0x0;var _0x782b13=_0xf446[_0x287cf8];return _0x782b13;};'use strict';var Sequelize=require('sequelize');module[_0x6f44('0x0')]={'name':{'type':Sequelize[_0x6f44('0x1')]},'description':{'type':Sequelize[_0x6f44('0x1')]},'ticketType':{'type':Sequelize[_0x6f44('0x2')](_0x6f44('0x3'),_0x6f44('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x6f44('0x5'),'contact',_0x6f44('0x6'),_0x6f44('0x7'),_0x6f44('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6f44('0x2')]('nothing',_0x6f44('0x9'),_0x6f44('0x6'),_0x6f44('0x8')),'defaultValue':_0x6f44('0x6')},'leadId':{'type':Sequelize[_0x6f44('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6f44('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4242=['nothing','sequelize','exports','STRING','Case','Task','ENUM','contact','lead','account_contact_lead','account','contact_lead'];(function(_0x1b6285,_0x2f6f46){var _0x3b38a6=function(_0x34b779){while(--_0x34b779){_0x1b6285['push'](_0x1b6285['shift']());}};_0x3b38a6(++_0x2f6f46);}(_0x4242,0xb5));var _0x2424=function(_0x1be9f7,_0x2a8c60){_0x1be9f7=_0x1be9f7-0x0;var _0xf821ca=_0x4242[_0x1be9f7];return _0xf821ca;};'use strict';var Sequelize=require(_0x2424('0x0'));module[_0x2424('0x1')]={'name':{'type':Sequelize[_0x2424('0x2')]},'description':{'type':Sequelize[_0x2424('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x2424('0x3')),'defaultValue':_0x2424('0x4')},'moduleSearch':{'type':Sequelize[_0x2424('0x5')]('contact_lead',_0x2424('0x6'),_0x2424('0x7'),_0x2424('0x8'),_0x2424('0x9')),'defaultValue':_0x2424('0xa')},'moduleCreate':{'type':Sequelize['ENUM'](_0x2424('0xb'),'contact','lead',_0x2424('0x9')),'defaultValue':_0x2424('0x7')},'leadId':{'type':Sequelize[_0x2424('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x2424('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
index dd76bd6..6a84939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['jsforce','desk.js','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','offset','undefined','count','set','Content-Range','json','save','destroy','then','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','update','body','getFields','SalesforceField','order','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x43b469,_0x2f1d60){var _0x50eed6=function(_0x24a7fd){while(--_0x24a7fd){_0x43b469['push'](_0x43b469['shift']());}};_0x50eed6(++_0x2f1d60);}(_0xa786,0x1d2));var _0x6a78=function(_0x37de59,_0x5bef13){_0x37de59=_0x37de59-0x0;var _0x37756f=_0xa786[_0x37de59];return _0x37756f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a78('0x0'));var jsonpatch=require(_0x6a78('0x1'));var rp=require(_0x6a78('0x2'));var moment=require(_0x6a78('0x3'));var BPromise=require(_0x6a78('0x4'));var Mustache=require(_0x6a78('0x5'));var util=require(_0x6a78('0x6'));var path=require('path');var sox=require(_0x6a78('0x7'));var csv=require(_0x6a78('0x8'));var ejs=require(_0x6a78('0x9'));var fs=require('fs');var fs_extra=require(_0x6a78('0xa'));var _=require(_0x6a78('0xb'));var squel=require(_0x6a78('0xc'));var crypto=require(_0x6a78('0xd'));var jsforce=require(_0x6a78('0xe'));var deskjs=require(_0x6a78('0xf'));var toCsv=require(_0x6a78('0x8'));var querystring=require(_0x6a78('0x10'));var Papa=require(_0x6a78('0x11'));var Redis=require(_0x6a78('0x12'));var authService=require(_0x6a78('0x13'));var qs=require(_0x6a78('0x14'));var as=require(_0x6a78('0x15'));var hardwareService=require(_0x6a78('0x16'));var logger=require(_0x6a78('0x17'))(_0x6a78('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a78('0x19'));var db=require(_0x6a78('0x1a'))['db'];function respondWithStatusCode(_0x4f8b72,_0x20fd59){_0x20fd59=_0x20fd59||0xcc;return function(_0x35b334){if(_0x35b334){return _0x4f8b72[_0x6a78('0x1b')](_0x20fd59);}return _0x4f8b72[_0x6a78('0x1c')](_0x20fd59)[_0x6a78('0x1d')]();};}function respondWithResult(_0xfca4fe,_0x9df26e){_0x9df26e=_0x9df26e||0xc8;return function(_0x5ac964){if(_0x5ac964){return _0xfca4fe['status'](_0x9df26e)['json'](_0x5ac964);}};}function respondWithFilteredResult(_0x36114f,_0x2deaa9){return function(_0xe2cf95){if(_0xe2cf95){var _0x535dc8=typeof _0x2deaa9[_0x6a78('0x1e')]===_0x6a78('0x1f')&&typeof _0x2deaa9['limit']===_0x6a78('0x1f');var _0x136df2=_0xe2cf95[_0x6a78('0x20')];var _0x44f646=_0x535dc8?0x0:_0x2deaa9[_0x6a78('0x1e')];var _0xe0e5e6=_0x535dc8?_0xe2cf95[_0x6a78('0x20')]:_0x2deaa9[_0x6a78('0x1e')]+_0x2deaa9['limit'];var _0x2d6ef3;if(_0xe0e5e6>=_0x136df2){_0xe0e5e6=_0x136df2;_0x2d6ef3=0xc8;}else{_0x2d6ef3=0xce;}_0x36114f['status'](_0x2d6ef3);return _0x36114f[_0x6a78('0x21')](_0x6a78('0x22'),_0x44f646+'-'+_0xe0e5e6+'/'+_0x136df2)[_0x6a78('0x23')](_0xe2cf95);}return null;};}function patchUpdates(_0x5d135e){return function(_0x3e0dfc){try{jsonpatch['apply'](_0x3e0dfc,_0x5d135e,!![]);}catch(_0x184637){return BPromise['reject'](_0x184637);}return _0x3e0dfc[_0x6a78('0x24')]();};}function saveUpdates(_0x49eb18,_0x598cde){return function(_0x4fbf83){if(_0x4fbf83){return _0x4fbf83['update'](_0x49eb18)['then'](function(_0x3b7bea){return _0x3b7bea;});}return null;};}function removeEntity(_0x3d96a2,_0x677af6){return function(_0x590657){if(_0x590657){return _0x590657[_0x6a78('0x25')]()[_0x6a78('0x26')](function(){_0x3d96a2[_0x6a78('0x1c')](0xcc)[_0x6a78('0x1d')]();});}};}function handleEntityNotFound(_0x56b7c2,_0xa401cb){return function(_0x5ba74f){if(!_0x5ba74f){_0x56b7c2[_0x6a78('0x1b')](0x194);}return _0x5ba74f;};}function handleError(_0x14a3c6,_0x8e8513){_0x8e8513=_0x8e8513||0x1f4;return function(_0x20db54){logger['error'](_0x20db54[_0x6a78('0x27')]);if(_0x20db54[_0x6a78('0x28')]){delete _0x20db54['name'];}_0x14a3c6[_0x6a78('0x1c')](_0x8e8513)['send'](_0x20db54);};}exports[_0x6a78('0x29')]=function(_0x48c692,_0x20a593){var _0x195978={},_0x573903={},_0x31ca28={'count':0x0,'rows':[]};var _0x231f1a=_['map'](db[_0x6a78('0x2a')][_0x6a78('0x2b')],function(_0x5abf0b){return{'name':_0x5abf0b[_0x6a78('0x2c')],'type':_0x5abf0b[_0x6a78('0x2d')][_0x6a78('0x2e')]};});_0x573903[_0x6a78('0x2f')]=_[_0x6a78('0x30')](_0x231f1a,_0x6a78('0x28'));_0x573903[_0x6a78('0x31')]=_['keys'](_0x48c692[_0x6a78('0x31')]);_0x573903[_0x6a78('0x32')]=_['intersection'](_0x573903[_0x6a78('0x2f')],_0x573903['query']);_0x195978[_0x6a78('0x33')]=_[_0x6a78('0x34')](_0x573903['model'],qs[_0x6a78('0x35')](_0x48c692[_0x6a78('0x31')]['fields']));_0x195978[_0x6a78('0x33')]=_0x195978['attributes'][_0x6a78('0x36')]?_0x195978[_0x6a78('0x33')]:_0x573903['model'];if(!_0x48c692['query'][_0x6a78('0x37')](_0x6a78('0x38'))){_0x195978[_0x6a78('0x39')]=qs[_0x6a78('0x39')](_0x48c692['query']['limit']);_0x195978[_0x6a78('0x1e')]=qs['offset'](_0x48c692[_0x6a78('0x31')][_0x6a78('0x1e')]);}_0x195978['order']=qs[_0x6a78('0x3a')](_0x48c692['query'][_0x6a78('0x3a')]);_0x195978[_0x6a78('0x3b')]=qs['filters'](_[_0x6a78('0x3c')](_0x48c692['query'],_0x573903[_0x6a78('0x32')]),_0x231f1a);if(_0x48c692[_0x6a78('0x31')][_0x6a78('0x3d')]){_0x195978[_0x6a78('0x3b')]=_[_0x6a78('0x3e')](_0x195978[_0x6a78('0x3b')],{'$or':_[_0x6a78('0x30')](_0x231f1a,function(_0x24c9ac){if(_0x24c9ac[_0x6a78('0x2d')]!=='VIRTUAL'){var _0x2ede51={};_0x2ede51[_0x24c9ac[_0x6a78('0x28')]]={'$like':'%'+_0x48c692[_0x6a78('0x31')][_0x6a78('0x3d')]+'%'};return _0x2ede51;}})});}_0x195978=_[_0x6a78('0x3e')]({},_0x195978,_0x48c692[_0x6a78('0x3f')]);var _0x403a67={'where':_0x195978[_0x6a78('0x3b')]};return db[_0x6a78('0x2a')][_0x6a78('0x20')](_0x403a67)[_0x6a78('0x26')](function(_0x4d3ad7){_0x31ca28[_0x6a78('0x20')]=_0x4d3ad7;if(_0x48c692['query'][_0x6a78('0x40')]){_0x195978[_0x6a78('0x41')]=[{'all':!![]}];}return db[_0x6a78('0x2a')]['findAll'](_0x195978);})[_0x6a78('0x26')](function(_0x2ec0f9){_0x31ca28[_0x6a78('0x42')]=_0x2ec0f9;return _0x31ca28;})[_0x6a78('0x26')](respondWithFilteredResult(_0x20a593,_0x195978))[_0x6a78('0x43')](handleError(_0x20a593,null));};exports[_0x6a78('0x44')]=function(_0x1e6efd,_0x415481){var _0x3146f8={'raw':![],'where':{'id':_0x1e6efd[_0x6a78('0x45')]['id']}},_0x27221d={};_0x27221d[_0x6a78('0x2f')]=_[_0x6a78('0x46')](db[_0x6a78('0x2a')][_0x6a78('0x2b')]);_0x27221d['query']=_[_0x6a78('0x46')](_0x1e6efd[_0x6a78('0x31')]);_0x27221d[_0x6a78('0x32')]=_[_0x6a78('0x34')](_0x27221d[_0x6a78('0x2f')],_0x27221d[_0x6a78('0x31')]);_0x3146f8[_0x6a78('0x33')]=_[_0x6a78('0x34')](_0x27221d[_0x6a78('0x2f')],qs['fields'](_0x1e6efd[_0x6a78('0x31')][_0x6a78('0x35')]));_0x3146f8['attributes']=_0x3146f8[_0x6a78('0x33')][_0x6a78('0x36')]?_0x3146f8[_0x6a78('0x33')]:_0x27221d[_0x6a78('0x2f')];if(_0x1e6efd[_0x6a78('0x31')]['includeAll']){_0x3146f8[_0x6a78('0x41')]=[{'all':!![]}];}_0x3146f8=_['merge']({},_0x3146f8,_0x1e6efd[_0x6a78('0x3f')]);return db[_0x6a78('0x2a')][_0x6a78('0x47')](_0x3146f8)[_0x6a78('0x26')](handleEntityNotFound(_0x415481,null))[_0x6a78('0x26')](respondWithResult(_0x415481,null))[_0x6a78('0x43')](handleError(_0x415481,null));};exports[_0x6a78('0x48')]=function(_0x1f35e0,_0xede538){return db[_0x6a78('0x2a')][_0x6a78('0x48')](_0x1f35e0['body'],{})[_0x6a78('0x26')](respondWithResult(_0xede538,0xc9))[_0x6a78('0x43')](handleError(_0xede538,null));};exports[_0x6a78('0x49')]=function(_0x5a64e0,_0x4400f1){if(_0x5a64e0[_0x6a78('0x4a')]['id']){delete _0x5a64e0[_0x6a78('0x4a')]['id'];}return db[_0x6a78('0x2a')][_0x6a78('0x47')]({'where':{'id':_0x5a64e0[_0x6a78('0x45')]['id']}})['then'](handleEntityNotFound(_0x4400f1,null))['then'](saveUpdates(_0x5a64e0['body'],null))[_0x6a78('0x26')](respondWithResult(_0x4400f1,null))[_0x6a78('0x43')](handleError(_0x4400f1,null));};exports[_0x6a78('0x25')]=function(_0x253376,_0x2bcb06){return db[_0x6a78('0x2a')][_0x6a78('0x47')]({'where':{'id':_0x253376[_0x6a78('0x45')]['id']}})[_0x6a78('0x26')](handleEntityNotFound(_0x2bcb06,null))[_0x6a78('0x26')](removeEntity(_0x2bcb06,null))[_0x6a78('0x43')](handleError(_0x2bcb06,null));};exports[_0x6a78('0x4b')]=function(_0x9b1b2,_0x326e59,_0x334dbc){var _0x1d9e08={};var _0x1dcff2={};var _0x57be29;var _0x471be9;return db[_0x6a78('0x2a')]['findOne']({'where':{'id':_0x9b1b2['params']['id']}})[_0x6a78('0x26')](handleEntityNotFound(_0x326e59,null))['then'](function(_0x4e528e){if(_0x4e528e){_0x57be29=_0x4e528e;_0x1dcff2[_0x6a78('0x2f')]=_[_0x6a78('0x46')](db[_0x6a78('0x4c')][_0x6a78('0x2b')]);_0x1dcff2[_0x6a78('0x31')]=_[_0x6a78('0x46')](_0x9b1b2['query']);_0x1dcff2[_0x6a78('0x32')]=_[_0x6a78('0x34')](_0x1dcff2[_0x6a78('0x2f')],_0x1dcff2[_0x6a78('0x31')]);_0x1d9e08[_0x6a78('0x33')]=_['intersection'](_0x1dcff2['model'],qs[_0x6a78('0x35')](_0x9b1b2[_0x6a78('0x31')][_0x6a78('0x35')]));_0x1d9e08['attributes']=_0x1d9e08[_0x6a78('0x33')][_0x6a78('0x36')]?_0x1d9e08[_0x6a78('0x33')]:_0x1dcff2[_0x6a78('0x2f')];_0x1d9e08[_0x6a78('0x4d')]=qs[_0x6a78('0x3a')](_0x9b1b2['query'][_0x6a78('0x3a')]);_0x1d9e08['where']=qs['filters'](_['pick'](_0x9b1b2[_0x6a78('0x31')],_0x1dcff2[_0x6a78('0x32')]));if(_0x9b1b2[_0x6a78('0x31')][_0x6a78('0x3d')]){_0x1d9e08[_0x6a78('0x3b')]=_[_0x6a78('0x3e')](_0x1d9e08[_0x6a78('0x3b')],{'$or':_[_0x6a78('0x30')](_0x1d9e08[_0x6a78('0x33')],function(_0x502de3){var _0x43090a={};_0x43090a[_0x502de3]={'$like':'%'+_0x9b1b2[_0x6a78('0x31')][_0x6a78('0x3d')]+'%'};return _0x43090a;})});}_0x1d9e08=_[_0x6a78('0x3e')]({},_0x1d9e08,_0x9b1b2['options']);return _0x57be29[_0x6a78('0x4b')](_0x1d9e08);}})[_0x6a78('0x26')](function(_0x233c64){if(_0x233c64){_0x471be9=_0x233c64[_0x6a78('0x36')];if(!_0x9b1b2['query'][_0x6a78('0x37')]('nolimit')){_0x1d9e08[_0x6a78('0x39')]=qs[_0x6a78('0x39')](_0x9b1b2[_0x6a78('0x31')][_0x6a78('0x39')]);_0x1d9e08[_0x6a78('0x1e')]=qs['offset'](_0x9b1b2['query'][_0x6a78('0x1e')]);}return _0x57be29[_0x6a78('0x4b')](_0x1d9e08);}})[_0x6a78('0x26')](function(_0x4af2d8){if(_0x4af2d8){return _0x4af2d8?{'count':_0x471be9,'rows':_0x4af2d8}:null;}})['then'](respondWithResult(_0x326e59,null))['catch'](handleError(_0x326e59,null));};exports['getSubjects']=function(_0x459f51,_0x587c9f,_0x4d0ecf){var _0x44d2b3={};var _0x5451b5={};var _0x42ed3c;var _0x1c0490;return db[_0x6a78('0x2a')]['findOne']({'where':{'id':_0x459f51[_0x6a78('0x45')]['id']}})[_0x6a78('0x26')](handleEntityNotFound(_0x587c9f,null))['then'](function(_0x17c3e1){if(_0x17c3e1){_0x42ed3c=_0x17c3e1;_0x5451b5[_0x6a78('0x2f')]=_['keys'](db[_0x6a78('0x4c')]['rawAttributes']);_0x5451b5[_0x6a78('0x31')]=_[_0x6a78('0x46')](_0x459f51[_0x6a78('0x31')]);_0x5451b5[_0x6a78('0x32')]=_[_0x6a78('0x34')](_0x5451b5[_0x6a78('0x2f')],_0x5451b5[_0x6a78('0x31')]);_0x44d2b3['attributes']=_['intersection'](_0x5451b5[_0x6a78('0x2f')],qs[_0x6a78('0x35')](_0x459f51['query'][_0x6a78('0x35')]));_0x44d2b3[_0x6a78('0x33')]=_0x44d2b3[_0x6a78('0x33')]['length']?_0x44d2b3['attributes']:_0x5451b5[_0x6a78('0x2f')];_0x44d2b3[_0x6a78('0x4d')]=qs[_0x6a78('0x3a')](_0x459f51[_0x6a78('0x31')][_0x6a78('0x3a')]);_0x44d2b3[_0x6a78('0x3b')]=qs[_0x6a78('0x32')](_[_0x6a78('0x3c')](_0x459f51['query'],_0x5451b5[_0x6a78('0x32')]));if(_0x459f51[_0x6a78('0x31')]['filter']){_0x44d2b3[_0x6a78('0x3b')]=_['merge'](_0x44d2b3[_0x6a78('0x3b')],{'$or':_['map'](_0x44d2b3['attributes'],function(_0x2fe9c3){var _0x216469={};_0x216469[_0x2fe9c3]={'$like':'%'+_0x459f51[_0x6a78('0x31')][_0x6a78('0x3d')]+'%'};return _0x216469;})});}_0x44d2b3=_[_0x6a78('0x3e')]({},_0x44d2b3,_0x459f51[_0x6a78('0x3f')]);return _0x42ed3c['getSubjects'](_0x44d2b3);}})[_0x6a78('0x26')](function(_0x28491e){if(_0x28491e){_0x1c0490=_0x28491e[_0x6a78('0x36')];if(!_0x459f51[_0x6a78('0x31')][_0x6a78('0x37')](_0x6a78('0x38'))){_0x44d2b3[_0x6a78('0x39')]=qs[_0x6a78('0x39')](_0x459f51[_0x6a78('0x31')]['limit']);_0x44d2b3[_0x6a78('0x1e')]=qs[_0x6a78('0x1e')](_0x459f51[_0x6a78('0x31')][_0x6a78('0x1e')]);}return _0x42ed3c['getSubjects'](_0x44d2b3);}})[_0x6a78('0x26')](function(_0xf2ca4d){if(_0xf2ca4d){return _0xf2ca4d?{'count':_0x1c0490,'rows':_0xf2ca4d}:null;}})[_0x6a78('0x26')](respondWithResult(_0x587c9f,null))[_0x6a78('0x43')](handleError(_0x587c9f,null));};exports[_0x6a78('0x4e')]=function(_0x3847bf,_0x572195,_0x4a2181){var _0x330275={};var _0x58220f={};var _0x1098e7;var _0x500eb8;return db['SalesforceConfiguration'][_0x6a78('0x4f')]({'where':{'id':_0x3847bf[_0x6a78('0x45')]['id']}})['then'](handleEntityNotFound(_0x572195,null))[_0x6a78('0x26')](function(_0x3b63c0){if(_0x3b63c0){_0x1098e7=_0x3b63c0;_0x58220f['model']=_[_0x6a78('0x46')](db[_0x6a78('0x4c')][_0x6a78('0x2b')]);_0x58220f[_0x6a78('0x31')]=_[_0x6a78('0x46')](_0x3847bf['query']);_0x58220f['filters']=_[_0x6a78('0x34')](_0x58220f[_0x6a78('0x2f')],_0x58220f[_0x6a78('0x31')]);_0x330275[_0x6a78('0x33')]=_[_0x6a78('0x34')](_0x58220f['model'],qs[_0x6a78('0x35')](_0x3847bf['query'][_0x6a78('0x35')]));_0x330275['attributes']=_0x330275['attributes'][_0x6a78('0x36')]?_0x330275[_0x6a78('0x33')]:_0x58220f['model'];_0x330275['order']=qs['sort'](_0x3847bf[_0x6a78('0x31')]['sort']);_0x330275[_0x6a78('0x3b')]=qs[_0x6a78('0x32')](_[_0x6a78('0x3c')](_0x3847bf[_0x6a78('0x31')],_0x58220f[_0x6a78('0x32')]));if(_0x3847bf[_0x6a78('0x31')][_0x6a78('0x3d')]){_0x330275['where']=_[_0x6a78('0x3e')](_0x330275['where'],{'$or':_[_0x6a78('0x30')](_0x330275['attributes'],function(_0x3e93dd){var _0x151beb={};_0x151beb[_0x3e93dd]={'$like':'%'+_0x3847bf[_0x6a78('0x31')]['filter']+'%'};return _0x151beb;})});}_0x330275=_[_0x6a78('0x3e')]({},_0x330275,_0x3847bf['options']);return _0x1098e7['getDescriptions'](_0x330275);}})['then'](function(_0x273883){if(_0x273883){_0x500eb8=_0x273883[_0x6a78('0x36')];if(!_0x3847bf[_0x6a78('0x31')][_0x6a78('0x37')](_0x6a78('0x38'))){_0x330275[_0x6a78('0x39')]=qs[_0x6a78('0x39')](_0x3847bf[_0x6a78('0x31')][_0x6a78('0x39')]);_0x330275[_0x6a78('0x1e')]=qs[_0x6a78('0x1e')](_0x3847bf[_0x6a78('0x31')][_0x6a78('0x1e')]);}return _0x1098e7[_0x6a78('0x4e')](_0x330275);}})['then'](function(_0x74f682){if(_0x74f682){return _0x74f682?{'count':_0x500eb8,'rows':_0x74f682}:null;}})[_0x6a78('0x26')](respondWithResult(_0x572195,null))['catch'](handleError(_0x572195,null));};
\ No newline at end of file
+var _0xa92e=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','SalesforceConfiguration','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','getFields','findOne','SalesforceField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2e7beb,_0x1327fe){var _0xedc0fa=function(_0x1ee291){while(--_0x1ee291){_0x2e7beb['push'](_0x2e7beb['shift']());}};_0xedc0fa(++_0x1327fe);}(_0xa92e,0x1e5));var _0xea92=function(_0x528b74,_0xb4471b){_0x528b74=_0x528b74-0x0;var _0x13e688=_0xa92e[_0x528b74];return _0x13e688;};'use strict';var emlformat=require(_0xea92('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea92('0x1'));var jsonpatch=require(_0xea92('0x2'));var rp=require(_0xea92('0x3'));var moment=require(_0xea92('0x4'));var BPromise=require(_0xea92('0x5'));var Mustache=require(_0xea92('0x6'));var util=require(_0xea92('0x7'));var path=require(_0xea92('0x8'));var sox=require('sox');var csv=require(_0xea92('0x9'));var ejs=require(_0xea92('0xa'));var fs=require('fs');var fs_extra=require(_0xea92('0xb'));var _=require(_0xea92('0xc'));var squel=require(_0xea92('0xd'));var crypto=require(_0xea92('0xe'));var jsforce=require(_0xea92('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xea92('0x9'));var querystring=require('querystring');var Papa=require(_0xea92('0x10'));var Redis=require('ioredis');var authService=require(_0xea92('0x11'));var qs=require(_0xea92('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea92('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xea92('0x14'));var config=require(_0xea92('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xea92('0x16'))['db'];function respondWithStatusCode(_0x219274,_0x2f4870){_0x2f4870=_0x2f4870||0xcc;return function(_0x408b96){if(_0x408b96){return _0x219274[_0xea92('0x17')](_0x2f4870);}return _0x219274[_0xea92('0x18')](_0x2f4870)[_0xea92('0x19')]();};}function respondWithResult(_0x4b02c4,_0x282266){_0x282266=_0x282266||0xc8;return function(_0x4826e7){if(_0x4826e7){return _0x4b02c4[_0xea92('0x18')](_0x282266)[_0xea92('0x1a')](_0x4826e7);}};}function respondWithFilteredResult(_0x39edba,_0x573786){return function(_0x3685db){if(_0x3685db){var _0xecd91=typeof _0x573786[_0xea92('0x1b')]===_0xea92('0x1c')&&typeof _0x573786[_0xea92('0x1d')]===_0xea92('0x1c');var _0x553422=_0x3685db[_0xea92('0x1e')];var _0x4b3713=_0xecd91?0x0:_0x573786[_0xea92('0x1b')];var _0x4704f8=_0xecd91?_0x3685db[_0xea92('0x1e')]:_0x573786[_0xea92('0x1b')]+_0x573786[_0xea92('0x1d')];var _0x1371ea;if(_0x4704f8>=_0x553422){_0x4704f8=_0x553422;_0x1371ea=0xc8;}else{_0x1371ea=0xce;}_0x39edba[_0xea92('0x18')](_0x1371ea);return _0x39edba[_0xea92('0x1f')](_0xea92('0x20'),_0x4b3713+'-'+_0x4704f8+'/'+_0x553422)[_0xea92('0x1a')](_0x3685db);}return null;};}function patchUpdates(_0x48da7f){return function(_0x2740bc){try{jsonpatch['apply'](_0x2740bc,_0x48da7f,!![]);}catch(_0x3133ed){return BPromise[_0xea92('0x21')](_0x3133ed);}return _0x2740bc[_0xea92('0x22')]();};}function saveUpdates(_0x1c846c,_0x130481){return function(_0x28df92){if(_0x28df92){return _0x28df92[_0xea92('0x23')](_0x1c846c)[_0xea92('0x24')](function(_0x4a0e0a){return _0x4a0e0a;});}return null;};}function removeEntity(_0x325228,_0x5c4078){return function(_0x41cbb6){if(_0x41cbb6){return _0x41cbb6['destroy']()[_0xea92('0x24')](function(){_0x325228['status'](0xcc)[_0xea92('0x19')]();});}};}function handleEntityNotFound(_0x4fe877,_0x2e7d79){return function(_0x44de2e){if(!_0x44de2e){_0x4fe877['sendStatus'](0x194);}return _0x44de2e;};}function handleError(_0x26ae6b,_0x4d645c){_0x4d645c=_0x4d645c||0x1f4;return function(_0x366c59){logger[_0xea92('0x25')](_0x366c59[_0xea92('0x26')]);if(_0x366c59['name']){delete _0x366c59[_0xea92('0x27')];}_0x26ae6b[_0xea92('0x18')](_0x4d645c)[_0xea92('0x28')](_0x366c59);};}exports[_0xea92('0x29')]=function(_0x51238e,_0xf758f4){var _0x4b1016={},_0x4ebb32={},_0x2e964a={'count':0x0,'rows':[]};var _0x2f16db=_[_0xea92('0x2a')](db['SalesforceConfiguration'][_0xea92('0x2b')],function(_0x4ad68f){return{'name':_0x4ad68f[_0xea92('0x2c')],'type':_0x4ad68f[_0xea92('0x2d')][_0xea92('0x2e')]};});_0x4ebb32[_0xea92('0x2f')]=_[_0xea92('0x2a')](_0x2f16db,_0xea92('0x27'));_0x4ebb32['query']=_[_0xea92('0x30')](_0x51238e[_0xea92('0x31')]);_0x4ebb32[_0xea92('0x32')]=_[_0xea92('0x33')](_0x4ebb32['model'],_0x4ebb32[_0xea92('0x31')]);_0x4b1016[_0xea92('0x34')]=_[_0xea92('0x33')](_0x4ebb32[_0xea92('0x2f')],qs[_0xea92('0x35')](_0x51238e[_0xea92('0x31')][_0xea92('0x35')]));_0x4b1016[_0xea92('0x34')]=_0x4b1016['attributes'][_0xea92('0x36')]?_0x4b1016[_0xea92('0x34')]:_0x4ebb32[_0xea92('0x2f')];if(!_0x51238e['query']['hasOwnProperty'](_0xea92('0x37'))){_0x4b1016[_0xea92('0x1d')]=qs['limit'](_0x51238e[_0xea92('0x31')][_0xea92('0x1d')]);_0x4b1016[_0xea92('0x1b')]=qs[_0xea92('0x1b')](_0x51238e['query'][_0xea92('0x1b')]);}_0x4b1016[_0xea92('0x38')]=qs[_0xea92('0x39')](_0x51238e[_0xea92('0x31')][_0xea92('0x39')]);_0x4b1016[_0xea92('0x3a')]=qs[_0xea92('0x32')](_['pick'](_0x51238e[_0xea92('0x31')],_0x4ebb32[_0xea92('0x32')]),_0x2f16db);if(_0x51238e[_0xea92('0x31')]['filter']){_0x4b1016['where']=_[_0xea92('0x3b')](_0x4b1016[_0xea92('0x3a')],{'$or':_[_0xea92('0x2a')](_0x2f16db,function(_0x3aab2f){if(_0x3aab2f[_0xea92('0x2d')]!==_0xea92('0x3c')){var _0x13e01e={};_0x13e01e[_0x3aab2f[_0xea92('0x27')]]={'$like':'%'+_0x51238e[_0xea92('0x31')][_0xea92('0x3d')]+'%'};return _0x13e01e;}})});}_0x4b1016=_[_0xea92('0x3b')]({},_0x4b1016,_0x51238e['options']);var _0xd87e5={'where':_0x4b1016[_0xea92('0x3a')]};return db[_0xea92('0x3e')][_0xea92('0x1e')](_0xd87e5)['then'](function(_0x5ecb8e){_0x2e964a[_0xea92('0x1e')]=_0x5ecb8e;if(_0x51238e[_0xea92('0x31')]['includeAll']){_0x4b1016[_0xea92('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xea92('0x40')](_0x4b1016);})[_0xea92('0x24')](function(_0x1afefa){_0x2e964a[_0xea92('0x41')]=_0x1afefa;return _0x2e964a;})[_0xea92('0x24')](respondWithFilteredResult(_0xf758f4,_0x4b1016))[_0xea92('0x42')](handleError(_0xf758f4,null));};exports[_0xea92('0x43')]=function(_0x4c4ee4,_0x3b7cb8){var _0xa5943d={'raw':![],'where':{'id':_0x4c4ee4[_0xea92('0x44')]['id']}},_0x14ad32={};_0x14ad32[_0xea92('0x2f')]=_[_0xea92('0x30')](db[_0xea92('0x3e')]['rawAttributes']);_0x14ad32[_0xea92('0x31')]=_[_0xea92('0x30')](_0x4c4ee4[_0xea92('0x31')]);_0x14ad32['filters']=_['intersection'](_0x14ad32[_0xea92('0x2f')],_0x14ad32[_0xea92('0x31')]);_0xa5943d[_0xea92('0x34')]=_['intersection'](_0x14ad32[_0xea92('0x2f')],qs[_0xea92('0x35')](_0x4c4ee4[_0xea92('0x31')][_0xea92('0x35')]));_0xa5943d['attributes']=_0xa5943d[_0xea92('0x34')]['length']?_0xa5943d[_0xea92('0x34')]:_0x14ad32[_0xea92('0x2f')];if(_0x4c4ee4[_0xea92('0x31')][_0xea92('0x45')]){_0xa5943d[_0xea92('0x3f')]=[{'all':!![]}];}_0xa5943d=_[_0xea92('0x3b')]({},_0xa5943d,_0x4c4ee4[_0xea92('0x46')]);return db[_0xea92('0x3e')][_0xea92('0x47')](_0xa5943d)[_0xea92('0x24')](handleEntityNotFound(_0x3b7cb8,null))[_0xea92('0x24')](respondWithResult(_0x3b7cb8,null))[_0xea92('0x42')](handleError(_0x3b7cb8,null));};exports[_0xea92('0x48')]=function(_0x9b0353,_0x1fc4b7){return db[_0xea92('0x3e')][_0xea92('0x48')](_0x9b0353[_0xea92('0x49')],{})['then'](respondWithResult(_0x1fc4b7,0xc9))['catch'](handleError(_0x1fc4b7,null));};exports['update']=function(_0x1d73fa,_0x43ff48){if(_0x1d73fa[_0xea92('0x49')]['id']){delete _0x1d73fa[_0xea92('0x49')]['id'];}return db['SalesforceConfiguration'][_0xea92('0x47')]({'where':{'id':_0x1d73fa['params']['id']}})[_0xea92('0x24')](handleEntityNotFound(_0x43ff48,null))[_0xea92('0x24')](saveUpdates(_0x1d73fa[_0xea92('0x49')],null))[_0xea92('0x24')](respondWithResult(_0x43ff48,null))[_0xea92('0x42')](handleError(_0x43ff48,null));};exports[_0xea92('0x4a')]=function(_0x4de25f,_0xe4b099){return db[_0xea92('0x3e')][_0xea92('0x47')]({'where':{'id':_0x4de25f[_0xea92('0x44')]['id']}})[_0xea92('0x24')](handleEntityNotFound(_0xe4b099,null))[_0xea92('0x24')](removeEntity(_0xe4b099,null))['catch'](handleError(_0xe4b099,null));};exports[_0xea92('0x4b')]=function(_0x35c424,_0x51f41a,_0x2f9477){var _0x5e81ef={};var _0x1653d3={};var _0x12baee;var _0x1191a7;return db[_0xea92('0x3e')][_0xea92('0x4c')]({'where':{'id':_0x35c424[_0xea92('0x44')]['id']}})[_0xea92('0x24')](handleEntityNotFound(_0x51f41a,null))[_0xea92('0x24')](function(_0x7fad91){if(_0x7fad91){_0x12baee=_0x7fad91;_0x1653d3[_0xea92('0x2f')]=_[_0xea92('0x30')](db[_0xea92('0x4d')][_0xea92('0x2b')]);_0x1653d3[_0xea92('0x31')]=_[_0xea92('0x30')](_0x35c424['query']);_0x1653d3['filters']=_[_0xea92('0x33')](_0x1653d3[_0xea92('0x2f')],_0x1653d3['query']);_0x5e81ef[_0xea92('0x34')]=_[_0xea92('0x33')](_0x1653d3[_0xea92('0x2f')],qs[_0xea92('0x35')](_0x35c424[_0xea92('0x31')][_0xea92('0x35')]));_0x5e81ef[_0xea92('0x34')]=_0x5e81ef[_0xea92('0x34')][_0xea92('0x36')]?_0x5e81ef[_0xea92('0x34')]:_0x1653d3[_0xea92('0x2f')];_0x5e81ef['order']=qs[_0xea92('0x39')](_0x35c424[_0xea92('0x31')][_0xea92('0x39')]);_0x5e81ef['where']=qs[_0xea92('0x32')](_[_0xea92('0x4e')](_0x35c424[_0xea92('0x31')],_0x1653d3[_0xea92('0x32')]));if(_0x35c424[_0xea92('0x31')][_0xea92('0x3d')]){_0x5e81ef[_0xea92('0x3a')]=_[_0xea92('0x3b')](_0x5e81ef[_0xea92('0x3a')],{'$or':_[_0xea92('0x2a')](_0x5e81ef[_0xea92('0x34')],function(_0xb0b797){var _0x4343d8={};_0x4343d8[_0xb0b797]={'$like':'%'+_0x35c424[_0xea92('0x31')][_0xea92('0x3d')]+'%'};return _0x4343d8;})});}_0x5e81ef=_[_0xea92('0x3b')]({},_0x5e81ef,_0x35c424['options']);return _0x12baee['getFields'](_0x5e81ef);}})[_0xea92('0x24')](function(_0x284a82){if(_0x284a82){_0x1191a7=_0x284a82['length'];if(!_0x35c424['query'][_0xea92('0x4f')]('nolimit')){_0x5e81ef[_0xea92('0x1d')]=qs['limit'](_0x35c424[_0xea92('0x31')][_0xea92('0x1d')]);_0x5e81ef[_0xea92('0x1b')]=qs['offset'](_0x35c424[_0xea92('0x31')]['offset']);}return _0x12baee['getFields'](_0x5e81ef);}})[_0xea92('0x24')](function(_0x358ca4){if(_0x358ca4){return _0x358ca4?{'count':_0x1191a7,'rows':_0x358ca4}:null;}})[_0xea92('0x24')](respondWithResult(_0x51f41a,null))[_0xea92('0x42')](handleError(_0x51f41a,null));};exports[_0xea92('0x50')]=function(_0x3a1270,_0x33ee1c,_0x204a38){var _0x166b4d={};var _0x2c0652={};var _0x1590c6;var _0x5a92eb;return db[_0xea92('0x3e')]['findOne']({'where':{'id':_0x3a1270[_0xea92('0x44')]['id']}})['then'](handleEntityNotFound(_0x33ee1c,null))[_0xea92('0x24')](function(_0xca2360){if(_0xca2360){_0x1590c6=_0xca2360;_0x2c0652[_0xea92('0x2f')]=_[_0xea92('0x30')](db[_0xea92('0x4d')][_0xea92('0x2b')]);_0x2c0652[_0xea92('0x31')]=_['keys'](_0x3a1270[_0xea92('0x31')]);_0x2c0652[_0xea92('0x32')]=_['intersection'](_0x2c0652[_0xea92('0x2f')],_0x2c0652[_0xea92('0x31')]);_0x166b4d[_0xea92('0x34')]=_['intersection'](_0x2c0652[_0xea92('0x2f')],qs[_0xea92('0x35')](_0x3a1270[_0xea92('0x31')][_0xea92('0x35')]));_0x166b4d[_0xea92('0x34')]=_0x166b4d[_0xea92('0x34')][_0xea92('0x36')]?_0x166b4d[_0xea92('0x34')]:_0x2c0652['model'];_0x166b4d['order']=qs[_0xea92('0x39')](_0x3a1270[_0xea92('0x31')]['sort']);_0x166b4d[_0xea92('0x3a')]=qs[_0xea92('0x32')](_[_0xea92('0x4e')](_0x3a1270[_0xea92('0x31')],_0x2c0652[_0xea92('0x32')]));if(_0x3a1270['query'][_0xea92('0x3d')]){_0x166b4d[_0xea92('0x3a')]=_[_0xea92('0x3b')](_0x166b4d[_0xea92('0x3a')],{'$or':_[_0xea92('0x2a')](_0x166b4d['attributes'],function(_0x5b2a21){var _0x271d18={};_0x271d18[_0x5b2a21]={'$like':'%'+_0x3a1270['query'][_0xea92('0x3d')]+'%'};return _0x271d18;})});}_0x166b4d=_['merge']({},_0x166b4d,_0x3a1270[_0xea92('0x46')]);return _0x1590c6[_0xea92('0x50')](_0x166b4d);}})[_0xea92('0x24')](function(_0x4334f2){if(_0x4334f2){_0x5a92eb=_0x4334f2[_0xea92('0x36')];if(!_0x3a1270[_0xea92('0x31')]['hasOwnProperty'](_0xea92('0x37'))){_0x166b4d[_0xea92('0x1d')]=qs[_0xea92('0x1d')](_0x3a1270[_0xea92('0x31')][_0xea92('0x1d')]);_0x166b4d['offset']=qs[_0xea92('0x1b')](_0x3a1270[_0xea92('0x31')][_0xea92('0x1b')]);}return _0x1590c6[_0xea92('0x50')](_0x166b4d);}})['then'](function(_0x2ac94f){if(_0x2ac94f){return _0x2ac94f?{'count':_0x5a92eb,'rows':_0x2ac94f}:null;}})['then'](respondWithResult(_0x33ee1c,null))[_0xea92('0x42')](handleError(_0x33ee1c,null));};exports[_0xea92('0x51')]=function(_0x2248fa,_0x1087ed,_0x4b3545){var _0xa33e40={};var _0x10432d={};var _0x1fd928;var _0x1070db;return db[_0xea92('0x3e')][_0xea92('0x4c')]({'where':{'id':_0x2248fa[_0xea92('0x44')]['id']}})[_0xea92('0x24')](handleEntityNotFound(_0x1087ed,null))[_0xea92('0x24')](function(_0x272d95){if(_0x272d95){_0x1fd928=_0x272d95;_0x10432d['model']=_[_0xea92('0x30')](db[_0xea92('0x4d')][_0xea92('0x2b')]);_0x10432d[_0xea92('0x31')]=_[_0xea92('0x30')](_0x2248fa['query']);_0x10432d['filters']=_[_0xea92('0x33')](_0x10432d[_0xea92('0x2f')],_0x10432d['query']);_0xa33e40[_0xea92('0x34')]=_[_0xea92('0x33')](_0x10432d['model'],qs[_0xea92('0x35')](_0x2248fa[_0xea92('0x31')]['fields']));_0xa33e40['attributes']=_0xa33e40[_0xea92('0x34')][_0xea92('0x36')]?_0xa33e40[_0xea92('0x34')]:_0x10432d[_0xea92('0x2f')];_0xa33e40['order']=qs['sort'](_0x2248fa[_0xea92('0x31')][_0xea92('0x39')]);_0xa33e40[_0xea92('0x3a')]=qs[_0xea92('0x32')](_[_0xea92('0x4e')](_0x2248fa['query'],_0x10432d['filters']));if(_0x2248fa[_0xea92('0x31')][_0xea92('0x3d')]){_0xa33e40[_0xea92('0x3a')]=_[_0xea92('0x3b')](_0xa33e40[_0xea92('0x3a')],{'$or':_[_0xea92('0x2a')](_0xa33e40[_0xea92('0x34')],function(_0x3dcef2){var _0x5d1eb0={};_0x5d1eb0[_0x3dcef2]={'$like':'%'+_0x2248fa[_0xea92('0x31')][_0xea92('0x3d')]+'%'};return _0x5d1eb0;})});}_0xa33e40=_[_0xea92('0x3b')]({},_0xa33e40,_0x2248fa[_0xea92('0x46')]);return _0x1fd928[_0xea92('0x51')](_0xa33e40);}})[_0xea92('0x24')](function(_0x2a7cf3){if(_0x2a7cf3){_0x1070db=_0x2a7cf3[_0xea92('0x36')];if(!_0x2248fa['query'][_0xea92('0x4f')](_0xea92('0x37'))){_0xa33e40[_0xea92('0x1d')]=qs[_0xea92('0x1d')](_0x2248fa['query'][_0xea92('0x1d')]);_0xa33e40[_0xea92('0x1b')]=qs['offset'](_0x2248fa['query'][_0xea92('0x1b')]);}return _0x1fd928[_0xea92('0x51')](_0xa33e40);}})[_0xea92('0x24')](function(_0x39d9b3){if(_0x39d9b3){return _0x39d9b3?{'count':_0x1070db,'rows':_0x39d9b3}:null;}})[_0xea92('0x24')](respondWithResult(_0x1087ed,null))[_0xea92('0x42')](handleError(_0x1087ed,null));};
\ No newline at end of file
index 091f02a..08baed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ea=['path','rimraf','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','util','../../config/logger','moment','request-promise'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x08ea,0x1e6));var _0xa08e=function(_0xa6e9bb,_0x42d198){_0xa6e9bb=_0xa6e9bb-0x0;var _0x4a9d88=_0x08ea[_0xa6e9bb];return _0x4a9d88;};'use strict';var _=require('lodash');var util=require(_0xa08e('0x0'));var logger=require(_0xa08e('0x1'))('api');var moment=require(_0xa08e('0x2'));var BPromise=require('bluebird');var rp=require(_0xa08e('0x3'));var fs=require('fs');var path=require(_0xa08e('0x4'));var rimraf=require(_0xa08e('0x5'));var config=require('../../config/environment');var attributes=require(_0xa08e('0x6'));module[_0xa08e('0x7')]=function(_0x20da61,_0x22c2e2){return _0x20da61[_0xa08e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xa08e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb16=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x432d38,_0x201399){var _0x39c577=function(_0x436c2a){while(--_0x436c2a){_0x432d38['push'](_0x432d38['shift']());}};_0x39c577(++_0x201399);}(_0xfb16,0x7d));var _0x6fb1=function(_0x36ba55,_0x3b7941){_0x36ba55=_0x36ba55-0x0;var _0x3c6daf=_0xfb16[_0x36ba55];return _0x3c6daf;};'use strict';var _=require('lodash');var util=require(_0x6fb1('0x0'));var logger=require(_0x6fb1('0x1'))(_0x6fb1('0x2'));var moment=require(_0x6fb1('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fb1('0x4'));var fs=require('fs');var path=require(_0x6fb1('0x5'));var rimraf=require(_0x6fb1('0x6'));var config=require(_0x6fb1('0x7'));var attributes=require(_0x6fb1('0x8'));module[_0x6fb1('0x9')]=function(_0x4cbccb,_0x25eed2){return _0x4cbccb[_0x6fb1('0xa')](_0x6fb1('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f0eaad9..0db034c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6350=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x91407c,_0x5cf5b6){var _0x8bf5e8=function(_0x208e75){while(--_0x208e75){_0x91407c['push'](_0x91407c['shift']());}};_0x8bf5e8(++_0x5cf5b6);}(_0x6350,0x76));var _0x0635=function(_0x288bff,_0x5bca93){_0x288bff=_0x288bff-0x0;var _0x4b61bb=_0x6350[_0x288bff];return _0x4b61bb;};'use strict';var _=require(_0x0635('0x0'));var util=require(_0x0635('0x1'));var moment=require('moment');var BPromise=require(_0x0635('0x2'));var rs=require(_0x0635('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0635('0x4'))['db'];var utils=require(_0x0635('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0635('0x6'));var jayson=require(_0x0635('0x7'));var client=jayson[_0x0635('0x8')][_0x0635('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f2ad9,_0x1da112,_0x3c776a){return new BPromise(function(_0x53e92d,_0x33ee7b){return client[_0x0635('0xa')](_0x5f2ad9,_0x3c776a)[_0x0635('0xb')](function(_0x466ca1){logger[_0x0635('0xc')](_0x0635('0xd'),_0x1da112,_0x0635('0xe'));logger['debug'](_0x0635('0xf'),_0x1da112,'request\x20sent',JSON['stringify'](_0x466ca1));if(_0x466ca1[_0x0635('0x10')]){if(_0x466ca1[_0x0635('0x10')][_0x0635('0x11')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x1da112,_0x466ca1[_0x0635('0x10')][_0x0635('0x12')]);return _0x33ee7b(_0x466ca1[_0x0635('0x10')][_0x0635('0x12')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x1da112,_0x466ca1[_0x0635('0x10')][_0x0635('0x12')]);return _0x53e92d(_0x466ca1[_0x0635('0x10')][_0x0635('0x12')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x1da112,_0x0635('0xe'));_0x53e92d(_0x466ca1[_0x0635('0x13')]['message']);}})[_0x0635('0x14')](function(_0x54677c){logger[_0x0635('0x10')](_0x0635('0xd'),_0x1da112,_0x54677c);_0x33ee7b(_0x54677c);});});}
\ No newline at end of file
+var _0x6006=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x670950,_0x477d9b){var _0x3a42f0=function(_0x3f1987){while(--_0x3f1987){_0x670950['push'](_0x670950['shift']());}};_0x3a42f0(++_0x477d9b);}(_0x6006,0x11c));var _0x6600=function(_0x2abcbd,_0x228598){_0x2abcbd=_0x2abcbd-0x0;var _0x22b9b2=_0x6006[_0x2abcbd];return _0x22b9b2;};'use strict';var _=require(_0x6600('0x0'));var util=require('util');var moment=require(_0x6600('0x1'));var BPromise=require('bluebird');var rs=require(_0x6600('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6600('0x3'))['db'];var utils=require(_0x6600('0x4'));var logger=require(_0x6600('0x5'))(_0x6600('0x6'));var config=require(_0x6600('0x7'));var jayson=require(_0x6600('0x8'));var client=jayson[_0x6600('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483acd,_0x14e761,_0xc71e62){return new BPromise(function(_0x334ed3,_0x244970){return client['request'](_0x483acd,_0xc71e62)[_0x6600('0xa')](function(_0x540932){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x14e761,_0x6600('0xb'));logger['debug'](_0x6600('0xc'),_0x14e761,_0x6600('0xb'),JSON['stringify'](_0x540932));if(_0x540932[_0x6600('0xd')]){if(_0x540932[_0x6600('0xd')][_0x6600('0xe')]===0x1f4){logger[_0x6600('0xd')](_0x6600('0xf'),_0x14e761,_0x540932[_0x6600('0xd')]['message']);return _0x244970(_0x540932[_0x6600('0xd')][_0x6600('0x10')]);}logger[_0x6600('0xd')](_0x6600('0xf'),_0x14e761,_0x540932[_0x6600('0xd')][_0x6600('0x10')]);return _0x334ed3(_0x540932[_0x6600('0xd')][_0x6600('0x10')]);}else{logger[_0x6600('0x11')](_0x6600('0xf'),_0x14e761,_0x6600('0xb'));_0x334ed3(_0x540932[_0x6600('0x12')][_0x6600('0x10')]);}})['catch'](function(_0x4ebe81){logger[_0x6600('0xd')](_0x6600('0xf'),_0x14e761,_0x4ebe81);_0x244970(_0x4ebe81);});});}
\ No newline at end of file
index 488613a..824e1a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c8c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x6fb108,_0x2c8939){var _0xfe4bb4=function(_0x4cd262){while(--_0x4cd262){_0x6fb108['push'](_0x6fb108['shift']());}};_0xfe4bb4(++_0x2c8939);}(_0x5c8c,0x164));var _0xc5c8=function(_0x3458b8,_0x330e57){_0x3458b8=_0x3458b8-0x0;var _0x46f2b3=_0x5c8c[_0x3458b8];return _0x46f2b3;};'use strict';var multer=require(_0xc5c8('0x0'));var util=require(_0xc5c8('0x1'));var path=require(_0xc5c8('0x2'));var timeout=require(_0xc5c8('0x3'));var express=require('express');var router=express[_0xc5c8('0x4')]();var fs_extra=require(_0xc5c8('0x5'));var auth=require(_0xc5c8('0x6'));var interaction=require(_0xc5c8('0x7'));var config=require(_0xc5c8('0x8'));var controller=require(_0xc5c8('0x9'));router[_0xc5c8('0xa')]('/',auth[_0xc5c8('0xb')](),controller[_0xc5c8('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc5c8('0xd')]);router[_0xc5c8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xc5c8('0xb')](),controller[_0xc5c8('0xf')]);router[_0xc5c8('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc5c8('0x11')]=router;
\ No newline at end of file
+var _0x1e92=['create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1e92,0x1cd));var _0x21e9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1e92[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x21e9('0x0'));var util=require(_0x21e9('0x1'));var path=require('path');var timeout=require(_0x21e9('0x2'));var express=require(_0x21e9('0x3'));var router=express[_0x21e9('0x4')]();var fs_extra=require(_0x21e9('0x5'));var auth=require(_0x21e9('0x6'));var interaction=require(_0x21e9('0x7'));var config=require(_0x21e9('0x8'));var controller=require(_0x21e9('0x9'));router[_0x21e9('0xa')]('/',auth[_0x21e9('0xb')](),controller[_0x21e9('0xc')]);router['get']('/:id',auth[_0x21e9('0xb')](),controller[_0x21e9('0xd')]);router['post']('/',auth[_0x21e9('0xb')](),controller[_0x21e9('0xe')]);router[_0x21e9('0xf')](_0x21e9('0x10'),auth[_0x21e9('0xb')](),controller[_0x21e9('0x11')]);router['delete'](_0x21e9('0x10'),auth[_0x21e9('0xb')](),controller[_0x21e9('0x12')]);module['exports']=router;
\ No newline at end of file
index dc765c4..022f719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e5f=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','string','variable'];(function(_0x4ef805,_0x60a093){var _0x463fe0=function(_0x4f6239){while(--_0x4f6239){_0x4ef805['push'](_0x4ef805['shift']());}};_0x463fe0(++_0x60a093);}(_0x8e5f,0x6d));var _0xf8e5=function(_0x307ff4,_0x2b76a5){_0x307ff4=_0x307ff4-0x0;var _0x59d945=_0x8e5f[_0x307ff4];return _0x59d945;};'use strict';var Sequelize=require(_0xf8e5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf8e5('0x1'),_0xf8e5('0x2'),_0xf8e5('0x3'),_0xf8e5('0x4'),_0xf8e5('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf8e5('0x6')]},'key':{'type':Sequelize[_0xf8e5('0x6')]},'keyType':{'type':Sequelize[_0xf8e5('0x7')]('string','variable',_0xf8e5('0x3'))},'keyContent':{'type':Sequelize[_0xf8e5('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xea35=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports','string'];(function(_0x4a5010,_0x1e1621){var _0x211365=function(_0x4f061c){while(--_0x4f061c){_0x4a5010['push'](_0x4a5010['shift']());}};_0x211365(++_0x1e1621);}(_0xea35,0x7d));var _0x5ea3=function(_0x4ccaba,_0x3417d1){_0x4ccaba=_0x4ccaba-0x0;var _0x3f38ba=_0xea35[_0x4ccaba];return _0x3f38ba;};'use strict';var Sequelize=require(_0x5ea3('0x0'));module[_0x5ea3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ea3('0x2'),'variable',_0x5ea3('0x3'),_0x5ea3('0x4'),_0x5ea3('0x5')),'defaultValue':_0x5ea3('0x2')},'content':{'type':Sequelize[_0x5ea3('0x6')]},'key':{'type':Sequelize[_0x5ea3('0x6')]},'keyType':{'type':Sequelize[_0x5ea3('0x7')]('string','variable',_0x5ea3('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5ea3('0x6')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1ca823b..b6d8c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4864=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','rows','show','params','fields','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4fefea,_0x13d2ec){var _0x106105=function(_0x536863){while(--_0x536863){_0x4fefea['push'](_0x4fefea['shift']());}};_0x106105(++_0x13d2ec);}(_0x4864,0x16b));var _0x4486=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x4864[_0x51ed62];return _0x34aee3;};'use strict';var emlformat=require(_0x4486('0x0'));var rimraf=require(_0x4486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4486('0x2'));var rp=require(_0x4486('0x3'));var moment=require(_0x4486('0x4'));var BPromise=require(_0x4486('0x5'));var Mustache=require(_0x4486('0x6'));var util=require(_0x4486('0x7'));var path=require(_0x4486('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4486('0x9'));var fs=require('fs');var fs_extra=require(_0x4486('0xa'));var _=require('lodash');var squel=require(_0x4486('0xb'));var crypto=require(_0x4486('0xc'));var jsforce=require(_0x4486('0xd'));var deskjs=require(_0x4486('0xe'));var toCsv=require(_0x4486('0xf'));var querystring=require(_0x4486('0x10'));var Papa=require(_0x4486('0x11'));var Redis=require('ioredis');var authService=require(_0x4486('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4486('0x13'));var hardwareService=require(_0x4486('0x14'));var logger=require(_0x4486('0x15'))(_0x4486('0x16'));var utils=require('../../config/utils');var config=require(_0x4486('0x17'));var licenseUtil=require(_0x4486('0x18'));var db=require(_0x4486('0x19'))['db'];function respondWithStatusCode(_0xd47c87,_0x2de8f6){_0x2de8f6=_0x2de8f6||0xcc;return function(_0x1890f2){if(_0x1890f2){return _0xd47c87[_0x4486('0x1a')](_0x2de8f6);}return _0xd47c87[_0x4486('0x1b')](_0x2de8f6)[_0x4486('0x1c')]();};}function respondWithResult(_0x7ec13b,_0x5ead3c){_0x5ead3c=_0x5ead3c||0xc8;return function(_0x4e3ffd){if(_0x4e3ffd){return _0x7ec13b[_0x4486('0x1b')](_0x5ead3c)[_0x4486('0x1d')](_0x4e3ffd);}};}function respondWithFilteredResult(_0x262904,_0x47bc4d){return function(_0x397889){if(_0x397889){var _0x416235=typeof _0x47bc4d[_0x4486('0x1e')]===_0x4486('0x1f')&&typeof _0x47bc4d[_0x4486('0x20')]==='undefined';var _0x188010=_0x397889[_0x4486('0x21')];var _0x36fa78=_0x416235?0x0:_0x47bc4d[_0x4486('0x1e')];var _0x469c9c=_0x416235?_0x397889[_0x4486('0x21')]:_0x47bc4d[_0x4486('0x1e')]+_0x47bc4d[_0x4486('0x20')];var _0x44e988;if(_0x469c9c>=_0x188010){_0x469c9c=_0x188010;_0x44e988=0xc8;}else{_0x44e988=0xce;}_0x262904[_0x4486('0x1b')](_0x44e988);return _0x262904['set'](_0x4486('0x22'),_0x36fa78+'-'+_0x469c9c+'/'+_0x188010)[_0x4486('0x1d')](_0x397889);}return null;};}function patchUpdates(_0x2329f3){return function(_0x40b934){try{jsonpatch[_0x4486('0x23')](_0x40b934,_0x2329f3,!![]);}catch(_0x4ff6c8){return BPromise[_0x4486('0x24')](_0x4ff6c8);}return _0x40b934[_0x4486('0x25')]();};}function saveUpdates(_0x1c6c2d,_0x5d5a0f){return function(_0x24b843){if(_0x24b843){return _0x24b843[_0x4486('0x26')](_0x1c6c2d)[_0x4486('0x27')](function(_0x51316d){return _0x51316d;});}return null;};}function removeEntity(_0xc7e6d2,_0x14da2f){return function(_0x58d3fb){if(_0x58d3fb){return _0x58d3fb[_0x4486('0x28')]()[_0x4486('0x27')](function(){_0xc7e6d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x407149,_0x36bf4f){return function(_0x31f1be){if(!_0x31f1be){_0x407149[_0x4486('0x1a')](0x194);}return _0x31f1be;};}function handleError(_0x1c91a0,_0x26c457){_0x26c457=_0x26c457||0x1f4;return function(_0x3239cf){logger[_0x4486('0x29')](_0x3239cf[_0x4486('0x2a')]);if(_0x3239cf['name']){delete _0x3239cf[_0x4486('0x2b')];}_0x1c91a0['status'](_0x26c457)[_0x4486('0x2c')](_0x3239cf);};}exports[_0x4486('0x2d')]=function(_0x5916ca,_0x29b149){var _0x5c3f6e={},_0x1ce932={},_0x1fd93b={'count':0x0,'rows':[]};var _0x3b7ee3=_[_0x4486('0x2e')](db['SalesforceField'][_0x4486('0x2f')],function(_0x4177b2){return{'name':_0x4177b2[_0x4486('0x30')],'type':_0x4177b2[_0x4486('0x31')]['key']};});_0x1ce932[_0x4486('0x32')]=_[_0x4486('0x2e')](_0x3b7ee3,'name');_0x1ce932['query']=_[_0x4486('0x33')](_0x5916ca[_0x4486('0x34')]);_0x1ce932[_0x4486('0x35')]=_['intersection'](_0x1ce932['model'],_0x1ce932['query']);_0x5c3f6e[_0x4486('0x36')]=_[_0x4486('0x37')](_0x1ce932['model'],qs['fields'](_0x5916ca[_0x4486('0x34')]['fields']));_0x5c3f6e[_0x4486('0x36')]=_0x5c3f6e[_0x4486('0x36')][_0x4486('0x38')]?_0x5c3f6e[_0x4486('0x36')]:_0x1ce932[_0x4486('0x32')];if(!_0x5916ca[_0x4486('0x34')][_0x4486('0x39')]('nolimit')){_0x5c3f6e['limit']=qs[_0x4486('0x20')](_0x5916ca[_0x4486('0x34')][_0x4486('0x20')]);_0x5c3f6e[_0x4486('0x1e')]=qs[_0x4486('0x1e')](_0x5916ca['query'][_0x4486('0x1e')]);}_0x5c3f6e[_0x4486('0x3a')]=qs['sort'](_0x5916ca[_0x4486('0x34')][_0x4486('0x3b')]);_0x5c3f6e[_0x4486('0x3c')]=qs[_0x4486('0x35')](_[_0x4486('0x3d')](_0x5916ca['query'],_0x1ce932[_0x4486('0x35')]),_0x3b7ee3);if(_0x5916ca['query'][_0x4486('0x3e')]){_0x5c3f6e[_0x4486('0x3c')]=_[_0x4486('0x3f')](_0x5c3f6e[_0x4486('0x3c')],{'$or':_[_0x4486('0x2e')](_0x3b7ee3,function(_0x134406){if(_0x134406[_0x4486('0x31')]!==_0x4486('0x40')){var _0x3792eb={};_0x3792eb[_0x134406[_0x4486('0x2b')]]={'$like':'%'+_0x5916ca[_0x4486('0x34')]['filter']+'%'};return _0x3792eb;}})});}_0x5c3f6e=_[_0x4486('0x3f')]({},_0x5c3f6e,_0x5916ca[_0x4486('0x41')]);var _0x5c4ab9={'where':_0x5c3f6e[_0x4486('0x3c')]};return db[_0x4486('0x42')][_0x4486('0x21')](_0x5c4ab9)[_0x4486('0x27')](function(_0x22a45c){_0x1fd93b[_0x4486('0x21')]=_0x22a45c;if(_0x5916ca[_0x4486('0x34')][_0x4486('0x43')]){_0x5c3f6e[_0x4486('0x44')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x5c3f6e);})[_0x4486('0x27')](function(_0x45612e){_0x1fd93b[_0x4486('0x45')]=_0x45612e;return _0x1fd93b;})[_0x4486('0x27')](respondWithFilteredResult(_0x29b149,_0x5c3f6e))['catch'](handleError(_0x29b149,null));};exports[_0x4486('0x46')]=function(_0x572ace,_0x405416){var _0x3ac8b9={'raw':!![],'where':{'id':_0x572ace[_0x4486('0x47')]['id']}},_0x10bd1c={};_0x10bd1c[_0x4486('0x32')]=_[_0x4486('0x33')](db[_0x4486('0x42')][_0x4486('0x2f')]);_0x10bd1c['query']=_[_0x4486('0x33')](_0x572ace[_0x4486('0x34')]);_0x10bd1c[_0x4486('0x35')]=_['intersection'](_0x10bd1c[_0x4486('0x32')],_0x10bd1c[_0x4486('0x34')]);_0x3ac8b9[_0x4486('0x36')]=_[_0x4486('0x37')](_0x10bd1c[_0x4486('0x32')],qs['fields'](_0x572ace[_0x4486('0x34')][_0x4486('0x48')]));_0x3ac8b9[_0x4486('0x36')]=_0x3ac8b9['attributes'][_0x4486('0x38')]?_0x3ac8b9[_0x4486('0x36')]:_0x10bd1c['model'];if(_0x572ace['query'][_0x4486('0x43')]){_0x3ac8b9[_0x4486('0x44')]=[{'all':!![]}];}_0x3ac8b9=_[_0x4486('0x3f')]({},_0x3ac8b9,_0x572ace[_0x4486('0x41')]);return db['SalesforceField']['find'](_0x3ac8b9)[_0x4486('0x27')](handleEntityNotFound(_0x405416,null))[_0x4486('0x27')](respondWithResult(_0x405416,null))[_0x4486('0x49')](handleError(_0x405416,null));};exports[_0x4486('0x4a')]=function(_0x5ece92,_0x2c7f01){return db[_0x4486('0x42')][_0x4486('0x4a')](_0x5ece92['body'],{})[_0x4486('0x27')](respondWithResult(_0x2c7f01,0xc9))[_0x4486('0x49')](handleError(_0x2c7f01,null));};exports[_0x4486('0x26')]=function(_0x36d188,_0x36a6d5){if(_0x36d188[_0x4486('0x4b')]['id']){delete _0x36d188[_0x4486('0x4b')]['id'];}return db[_0x4486('0x42')][_0x4486('0x4c')]({'where':{'id':_0x36d188[_0x4486('0x47')]['id']}})['then'](handleEntityNotFound(_0x36a6d5,null))[_0x4486('0x27')](saveUpdates(_0x36d188[_0x4486('0x4b')],null))['then'](respondWithResult(_0x36a6d5,null))[_0x4486('0x49')](handleError(_0x36a6d5,null));};exports['destroy']=function(_0x30348b,_0x4b65fb){return db[_0x4486('0x42')][_0x4486('0x4c')]({'where':{'id':_0x30348b[_0x4486('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b65fb,null))[_0x4486('0x27')](removeEntity(_0x4b65fb,null))[_0x4486('0x49')](handleError(_0x4b65fb,null));};
\ No newline at end of file
+var _0x67bc=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','then','end','error','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x67bc,0x1ee));var _0xc67b=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0x67bc[_0x400766];return _0x3ae58b;};'use strict';var emlformat=require(_0xc67b('0x0'));var rimraf=require(_0xc67b('0x1'));var zipdir=require(_0xc67b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc67b('0x3'));var moment=require('moment');var BPromise=require(_0xc67b('0x4'));var Mustache=require(_0xc67b('0x5'));var util=require(_0xc67b('0x6'));var path=require('path');var sox=require(_0xc67b('0x7'));var csv=require(_0xc67b('0x8'));var ejs=require(_0xc67b('0x9'));var fs=require('fs');var fs_extra=require(_0xc67b('0xa'));var _=require(_0xc67b('0xb'));var squel=require(_0xc67b('0xc'));var crypto=require(_0xc67b('0xd'));var jsforce=require(_0xc67b('0xe'));var deskjs=require(_0xc67b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc67b('0x10'));var authService=require(_0xc67b('0x11'));var qs=require(_0xc67b('0x12'));var as=require(_0xc67b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc67b('0x14'))(_0xc67b('0x15'));var utils=require(_0xc67b('0x16'));var config=require(_0xc67b('0x17'));var licenseUtil=require(_0xc67b('0x18'));var db=require(_0xc67b('0x19'))['db'];function respondWithStatusCode(_0x256d67,_0x3a57f9){_0x3a57f9=_0x3a57f9||0xcc;return function(_0x4d8bad){if(_0x4d8bad){return _0x256d67[_0xc67b('0x1a')](_0x3a57f9);}return _0x256d67[_0xc67b('0x1b')](_0x3a57f9)['end']();};}function respondWithResult(_0x3b730b,_0x3c91c8){_0x3c91c8=_0x3c91c8||0xc8;return function(_0x31c6f6){if(_0x31c6f6){return _0x3b730b[_0xc67b('0x1b')](_0x3c91c8)['json'](_0x31c6f6);}};}function respondWithFilteredResult(_0x365071,_0x394bdf){return function(_0x1fcad1){if(_0x1fcad1){var _0x14b62a=typeof _0x394bdf[_0xc67b('0x1c')]===_0xc67b('0x1d')&&typeof _0x394bdf['limit']===_0xc67b('0x1d');var _0x23890a=_0x1fcad1[_0xc67b('0x1e')];var _0x4a6f9b=_0x14b62a?0x0:_0x394bdf[_0xc67b('0x1c')];var _0x271258=_0x14b62a?_0x1fcad1[_0xc67b('0x1e')]:_0x394bdf[_0xc67b('0x1c')]+_0x394bdf[_0xc67b('0x1f')];var _0x4b2d6f;if(_0x271258>=_0x23890a){_0x271258=_0x23890a;_0x4b2d6f=0xc8;}else{_0x4b2d6f=0xce;}_0x365071[_0xc67b('0x1b')](_0x4b2d6f);return _0x365071['set'](_0xc67b('0x20'),_0x4a6f9b+'-'+_0x271258+'/'+_0x23890a)[_0xc67b('0x21')](_0x1fcad1);}return null;};}function patchUpdates(_0x2ba0ef){return function(_0x404207){try{jsonpatch[_0xc67b('0x22')](_0x404207,_0x2ba0ef,!![]);}catch(_0x15cab0){return BPromise['reject'](_0x15cab0);}return _0x404207[_0xc67b('0x23')]();};}function saveUpdates(_0x538cca,_0x407f94){return function(_0x7abbb5){if(_0x7abbb5){return _0x7abbb5['update'](_0x538cca)[_0xc67b('0x24')](function(_0xf5f331){return _0xf5f331;});}return null;};}function removeEntity(_0x2cd3c9,_0x23b3f0){return function(_0x4935b8){if(_0x4935b8){return _0x4935b8['destroy']()['then'](function(){_0x2cd3c9[_0xc67b('0x1b')](0xcc)[_0xc67b('0x25')]();});}};}function handleEntityNotFound(_0x5501f0,_0x22d065){return function(_0x35f2f2){if(!_0x35f2f2){_0x5501f0[_0xc67b('0x1a')](0x194);}return _0x35f2f2;};}function handleError(_0xea708e,_0x56ad90){_0x56ad90=_0x56ad90||0x1f4;return function(_0x6bafce){logger[_0xc67b('0x26')](_0x6bafce['stack']);if(_0x6bafce[_0xc67b('0x27')]){delete _0x6bafce[_0xc67b('0x27')];}_0xea708e['status'](_0x56ad90)['send'](_0x6bafce);};}exports[_0xc67b('0x28')]=function(_0x12659b,_0x10ea30){var _0x50bc19={},_0x8f25ff={},_0xdf4bc4={'count':0x0,'rows':[]};var _0x3c7e6e=_[_0xc67b('0x29')](db[_0xc67b('0x2a')][_0xc67b('0x2b')],function(_0x1bc4b8){return{'name':_0x1bc4b8[_0xc67b('0x2c')],'type':_0x1bc4b8['type'][_0xc67b('0x2d')]};});_0x8f25ff[_0xc67b('0x2e')]=_[_0xc67b('0x29')](_0x3c7e6e,'name');_0x8f25ff[_0xc67b('0x2f')]=_[_0xc67b('0x30')](_0x12659b[_0xc67b('0x2f')]);_0x8f25ff[_0xc67b('0x31')]=_[_0xc67b('0x32')](_0x8f25ff[_0xc67b('0x2e')],_0x8f25ff[_0xc67b('0x2f')]);_0x50bc19[_0xc67b('0x33')]=_[_0xc67b('0x32')](_0x8f25ff[_0xc67b('0x2e')],qs[_0xc67b('0x34')](_0x12659b['query'][_0xc67b('0x34')]));_0x50bc19['attributes']=_0x50bc19[_0xc67b('0x33')]['length']?_0x50bc19['attributes']:_0x8f25ff[_0xc67b('0x2e')];if(!_0x12659b[_0xc67b('0x2f')]['hasOwnProperty'](_0xc67b('0x35'))){_0x50bc19[_0xc67b('0x1f')]=qs[_0xc67b('0x1f')](_0x12659b[_0xc67b('0x2f')]['limit']);_0x50bc19['offset']=qs[_0xc67b('0x1c')](_0x12659b[_0xc67b('0x2f')][_0xc67b('0x1c')]);}_0x50bc19[_0xc67b('0x36')]=qs[_0xc67b('0x37')](_0x12659b[_0xc67b('0x2f')]['sort']);_0x50bc19[_0xc67b('0x38')]=qs[_0xc67b('0x31')](_[_0xc67b('0x39')](_0x12659b[_0xc67b('0x2f')],_0x8f25ff[_0xc67b('0x31')]),_0x3c7e6e);if(_0x12659b[_0xc67b('0x2f')]['filter']){_0x50bc19[_0xc67b('0x38')]=_['merge'](_0x50bc19[_0xc67b('0x38')],{'$or':_[_0xc67b('0x29')](_0x3c7e6e,function(_0x1ed340){if(_0x1ed340[_0xc67b('0x3a')]!==_0xc67b('0x3b')){var _0xa02ef={};_0xa02ef[_0x1ed340[_0xc67b('0x27')]]={'$like':'%'+_0x12659b[_0xc67b('0x2f')]['filter']+'%'};return _0xa02ef;}})});}_0x50bc19=_[_0xc67b('0x3c')]({},_0x50bc19,_0x12659b['options']);var _0x2800d2={'where':_0x50bc19[_0xc67b('0x38')]};return db[_0xc67b('0x2a')]['count'](_0x2800d2)[_0xc67b('0x24')](function(_0x392370){_0xdf4bc4[_0xc67b('0x1e')]=_0x392370;if(_0x12659b[_0xc67b('0x2f')][_0xc67b('0x3d')]){_0x50bc19['include']=[{'all':!![]}];}return db['SalesforceField'][_0xc67b('0x3e')](_0x50bc19);})[_0xc67b('0x24')](function(_0x5d3410){_0xdf4bc4[_0xc67b('0x3f')]=_0x5d3410;return _0xdf4bc4;})['then'](respondWithFilteredResult(_0x10ea30,_0x50bc19))[_0xc67b('0x40')](handleError(_0x10ea30,null));};exports[_0xc67b('0x41')]=function(_0x3cfc34,_0x5c2578){var _0x380131={'raw':!![],'where':{'id':_0x3cfc34[_0xc67b('0x42')]['id']}},_0x3404d9={};_0x3404d9[_0xc67b('0x2e')]=_[_0xc67b('0x30')](db['SalesforceField']['rawAttributes']);_0x3404d9['query']=_['keys'](_0x3cfc34['query']);_0x3404d9[_0xc67b('0x31')]=_[_0xc67b('0x32')](_0x3404d9[_0xc67b('0x2e')],_0x3404d9['query']);_0x380131[_0xc67b('0x33')]=_[_0xc67b('0x32')](_0x3404d9[_0xc67b('0x2e')],qs[_0xc67b('0x34')](_0x3cfc34[_0xc67b('0x2f')]['fields']));_0x380131[_0xc67b('0x33')]=_0x380131[_0xc67b('0x33')][_0xc67b('0x43')]?_0x380131[_0xc67b('0x33')]:_0x3404d9[_0xc67b('0x2e')];if(_0x3cfc34[_0xc67b('0x2f')][_0xc67b('0x3d')]){_0x380131[_0xc67b('0x44')]=[{'all':!![]}];}_0x380131=_['merge']({},_0x380131,_0x3cfc34['options']);return db[_0xc67b('0x2a')][_0xc67b('0x45')](_0x380131)[_0xc67b('0x24')](handleEntityNotFound(_0x5c2578,null))[_0xc67b('0x24')](respondWithResult(_0x5c2578,null))[_0xc67b('0x40')](handleError(_0x5c2578,null));};exports['create']=function(_0xd9c3d5,_0x375967){return db['SalesforceField'][_0xc67b('0x46')](_0xd9c3d5[_0xc67b('0x47')],{})[_0xc67b('0x24')](respondWithResult(_0x375967,0xc9))['catch'](handleError(_0x375967,null));};exports[_0xc67b('0x48')]=function(_0x2ba842,_0x4e6288){if(_0x2ba842[_0xc67b('0x47')]['id']){delete _0x2ba842[_0xc67b('0x47')]['id'];}return db[_0xc67b('0x2a')]['find']({'where':{'id':_0x2ba842[_0xc67b('0x42')]['id']}})[_0xc67b('0x24')](handleEntityNotFound(_0x4e6288,null))[_0xc67b('0x24')](saveUpdates(_0x2ba842[_0xc67b('0x47')],null))[_0xc67b('0x24')](respondWithResult(_0x4e6288,null))[_0xc67b('0x40')](handleError(_0x4e6288,null));};exports[_0xc67b('0x49')]=function(_0xac772,_0x45a08c){return db[_0xc67b('0x2a')][_0xc67b('0x45')]({'where':{'id':_0xac772[_0xc67b('0x42')]['id']}})[_0xc67b('0x24')](handleEntityNotFound(_0x45a08c,null))[_0xc67b('0x24')](removeEntity(_0x45a08c,null))[_0xc67b('0x40')](handleError(_0x45a08c,null));};
\ No newline at end of file
index 7afa0d7..fb8edba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16c9=['define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','moment','bluebird','rimraf','exports'];(function(_0x216aa0,_0x901ccb){var _0x21b416=function(_0x5cf37c){while(--_0x5cf37c){_0x216aa0['push'](_0x216aa0['shift']());}};_0x21b416(++_0x901ccb);}(_0x16c9,0x102));var _0x916c=function(_0x5243e2,_0x20d1f1){_0x5243e2=_0x5243e2-0x0;var _0x539682=_0x16c9[_0x5243e2];return _0x539682;};'use strict';var _=require('lodash');var util=require(_0x916c('0x0'));var logger=require(_0x916c('0x1'))('api');var moment=require(_0x916c('0x2'));var BPromise=require(_0x916c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x916c('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x916c('0x5')]=function(_0x4f1e11,_0x48f347){return _0x4f1e11[_0x916c('0x6')](_0x916c('0x7'),attributes,{'tableName':_0x916c('0x8'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x916c('0x9'),_0x916c('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x481f=['request-promise','path','rimraf','define','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','api'];(function(_0x4c7d49,_0x284cdf){var _0x212fb0=function(_0x12e185){while(--_0x12e185){_0x4c7d49['push'](_0x4c7d49['shift']());}};_0x212fb0(++_0x284cdf);}(_0x481f,0x89));var _0xf481=function(_0x2eece1,_0x119148){_0x2eece1=_0x2eece1-0x0;var _0x2d04d5=_0x481f[_0x2eece1];return _0x2d04d5;};'use strict';var _=require(_0xf481('0x0'));var util=require(_0xf481('0x1'));var logger=require('../../config/logger')(_0xf481('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf481('0x3'));var fs=require('fs');var path=require(_0xf481('0x4'));var rimraf=require(_0xf481('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x40e002,_0x525d8f){return _0x40e002[_0xf481('0x6')]('SalesforceField',attributes,{'tableName':_0xf481('0x7'),'paranoid':![],'indexes':[{'name':_0xf481('0x8'),'fields':[_0xf481('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6fa4327..beee1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dac=['../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x577747,_0x41bd05){var _0x3dbc0e=function(_0x56c0d9){while(--_0x56c0d9){_0x577747['push'](_0x577747['shift']());}};_0x3dbc0e(++_0x41bd05);}(_0x3dac,0x123));var _0xc3da=function(_0x365e48,_0x1167d5){_0x365e48=_0x365e48-0x0;var _0x49d672=_0x3dac[_0x365e48];return _0x49d672;};'use strict';var _=require(_0xc3da('0x0'));var util=require(_0xc3da('0x1'));var moment=require('moment');var BPromise=require(_0xc3da('0x2'));var rs=require(_0xc3da('0x3'));var fs=require('fs');var Redis=require(_0xc3da('0x4'));var db=require(_0xc3da('0x5'))['db'];var utils=require(_0xc3da('0x6'));var logger=require(_0xc3da('0x7'))(_0xc3da('0x8'));var config=require(_0xc3da('0x9'));var jayson=require(_0xc3da('0xa'));var client=jayson[_0xc3da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c8a4,_0x488f1e,_0x397efa){return new BPromise(function(_0x2d680e,_0xc29c0c){return client[_0xc3da('0xc')](_0x41c8a4,_0x397efa)[_0xc3da('0xd')](function(_0x25a83a){logger[_0xc3da('0xe')](_0xc3da('0xf'),_0x488f1e,_0xc3da('0x10'));logger[_0xc3da('0x11')](_0xc3da('0x12'),_0x488f1e,_0xc3da('0x10'),JSON[_0xc3da('0x13')](_0x25a83a));if(_0x25a83a[_0xc3da('0x14')]){if(_0x25a83a['error'][_0xc3da('0x15')]===0x1f4){logger['error'](_0xc3da('0xf'),_0x488f1e,_0x25a83a[_0xc3da('0x14')][_0xc3da('0x16')]);return _0xc29c0c(_0x25a83a['error'][_0xc3da('0x16')]);}logger[_0xc3da('0x14')](_0xc3da('0xf'),_0x488f1e,_0x25a83a[_0xc3da('0x14')]['message']);return _0x2d680e(_0x25a83a[_0xc3da('0x14')]['message']);}else{logger[_0xc3da('0xe')](_0xc3da('0xf'),_0x488f1e,_0xc3da('0x10'));_0x2d680e(_0x25a83a[_0xc3da('0x17')][_0xc3da('0x16')]);}})[_0xc3da('0x18')](function(_0x170aed){logger['error'](_0xc3da('0xf'),_0x488f1e,_0x170aed);_0xc29c0c(_0x170aed);});});}
\ No newline at end of file
+var _0x4f4f=['stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x7c1ec4,_0x49585d){var _0x71295=function(_0x500831){while(--_0x500831){_0x7c1ec4['push'](_0x7c1ec4['shift']());}};_0x71295(++_0x49585d);}(_0x4f4f,0x14e));var _0xf4f4=function(_0x31f22e,_0x434db1){_0x31f22e=_0x31f22e-0x0;var _0x16e1b0=_0x4f4f[_0x31f22e];return _0x16e1b0;};'use strict';var _=require('lodash');var util=require(_0xf4f4('0x0'));var moment=require(_0xf4f4('0x1'));var BPromise=require(_0xf4f4('0x2'));var rs=require(_0xf4f4('0x3'));var fs=require('fs');var Redis=require(_0xf4f4('0x4'));var db=require(_0xf4f4('0x5'))['db'];var utils=require(_0xf4f4('0x6'));var logger=require('../../config/logger')(_0xf4f4('0x7'));var config=require(_0xf4f4('0x8'));var jayson=require(_0xf4f4('0x9'));var client=jayson[_0xf4f4('0xa')][_0xf4f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe258c6,_0x2b7fdb,_0x553578){return new BPromise(function(_0x2cc5fa,_0x292df4){return client['request'](_0xe258c6,_0x553578)[_0xf4f4('0xc')](function(_0x368d62){logger[_0xf4f4('0xd')](_0xf4f4('0xe'),_0x2b7fdb,_0xf4f4('0xf'));logger[_0xf4f4('0x10')](_0xf4f4('0x11'),_0x2b7fdb,_0xf4f4('0xf'),JSON[_0xf4f4('0x12')](_0x368d62));if(_0x368d62[_0xf4f4('0x13')]){if(_0x368d62[_0xf4f4('0x13')]['code']===0x1f4){logger[_0xf4f4('0x13')](_0xf4f4('0xe'),_0x2b7fdb,_0x368d62['error'][_0xf4f4('0x14')]);return _0x292df4(_0x368d62[_0xf4f4('0x13')]['message']);}logger['error'](_0xf4f4('0xe'),_0x2b7fdb,_0x368d62[_0xf4f4('0x13')][_0xf4f4('0x14')]);return _0x2cc5fa(_0x368d62[_0xf4f4('0x13')][_0xf4f4('0x14')]);}else{logger[_0xf4f4('0xd')](_0xf4f4('0xe'),_0x2b7fdb,'request\x20sent');_0x2cc5fa(_0x368d62[_0xf4f4('0x15')][_0xf4f4('0x14')]);}})['catch'](function(_0x2386ac){logger[_0xf4f4('0x13')](_0xf4f4('0xe'),_0x2b7fdb,_0x2386ac);_0x292df4(_0x2386ac);});});}
\ No newline at end of file
index 8a7158f..7252d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb5f=['update','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x10345b,_0x8e85dc){var _0x2274ad=function(_0x215304){while(--_0x215304){_0x10345b['push'](_0x10345b['shift']());}};_0x2274ad(++_0x8e85dc);}(_0xbb5f,0x16a));var _0xfbb5=function(_0x416fed,_0x4c686b){_0x416fed=_0x416fed-0x0;var _0x2fb52b=_0xbb5f[_0x416fed];return _0x2fb52b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfbb5('0x0'));var timeout=require('connect-timeout');var express=require(_0xfbb5('0x1'));var router=express[_0xfbb5('0x2')]();var fs_extra=require(_0xfbb5('0x3'));var auth=require(_0xfbb5('0x4'));var interaction=require(_0xfbb5('0x5'));var config=require(_0xfbb5('0x6'));var controller=require(_0xfbb5('0x7'));router[_0xfbb5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfbb5('0x8')](_0xfbb5('0x9'),auth[_0xfbb5('0xa')](),controller[_0xfbb5('0xb')]);router[_0xfbb5('0x8')](_0xfbb5('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xfbb5('0xa')](),controller[_0xfbb5('0xd')]);router[_0xfbb5('0xe')]('/',auth[_0xfbb5('0xa')](),controller[_0xfbb5('0xf')]);router[_0xfbb5('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfbb5('0x10')]);router[_0xfbb5('0x11')](_0xfbb5('0x9'),auth[_0xfbb5('0xa')](),controller[_0xfbb5('0x12')]);router['delete'](_0xfbb5('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x1596=['/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post'];(function(_0x360a9a,_0x5d1183){var _0x265c30=function(_0x9380a9){while(--_0x9380a9){_0x360a9a['push'](_0x360a9a['shift']());}};_0x265c30(++_0x5d1183);}(_0x1596,0x16f));var _0x6159=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1596[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var path=require(_0x6159('0x2'));var timeout=require(_0x6159('0x3'));var express=require('express');var router=express[_0x6159('0x4')]();var fs_extra=require(_0x6159('0x5'));var auth=require(_0x6159('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6159('0x7'));var controller=require(_0x6159('0x8'));router[_0x6159('0x9')]('/',auth['isAuthenticated'](),controller[_0x6159('0xa')]);router[_0x6159('0x9')](_0x6159('0xb'),auth[_0x6159('0xc')](),controller[_0x6159('0xd')]);router[_0x6159('0x9')]('/:id/configurations',auth[_0x6159('0xc')](),controller['getConfigurations']);router[_0x6159('0x9')](_0x6159('0xe'),auth['isAuthenticated'](),controller[_0x6159('0xf')]);router[_0x6159('0x10')]('/',auth[_0x6159('0xc')](),controller['create']);router['post'](_0x6159('0x11'),auth[_0x6159('0xc')](),controller[_0x6159('0x12')]);router[_0x6159('0x13')](_0x6159('0xb'),auth[_0x6159('0xc')](),controller[_0x6159('0x14')]);router[_0x6159('0x15')](_0x6159('0xb'),auth[_0x6159('0xc')](),controller[_0x6159('0x16')]);module[_0x6159('0x17')]=router;
\ No newline at end of file
index 91be915..3678688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c65=['STRING','username','remoteUri','exports'];(function(_0x4d6675,_0x23beaa){var _0x2bd5bc=function(_0x573d07){while(--_0x573d07){_0x4d6675['push'](_0x4d6675['shift']());}};_0x2bd5bc(++_0x23beaa);}(_0x1c65,0x83));var _0x51c6=function(_0x3ab48c,_0x496403){_0x3ab48c=_0x3ab48c-0x0;var _0x225705=_0x1c65[_0x3ab48c];return _0x225705;};'use strict';var Sequelize=require('sequelize');module[_0x51c6('0x0')]={'name':{'type':Sequelize[_0x51c6('0x1')]},'description':{'type':Sequelize[_0x51c6('0x1')]},'username':{'type':Sequelize[_0x51c6('0x1')],'unique':_0x51c6('0x2')},'password':{'type':Sequelize[_0x51c6('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x51c6('0x3')},'serverUrl':{'type':Sequelize[_0x51c6('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x072b=['exports','STRING','username','remoteUri'];(function(_0xfb634e,_0x1d5c17){var _0x354bdb=function(_0x383823){while(--_0x383823){_0xfb634e['push'](_0xfb634e['shift']());}};_0x354bdb(++_0x1d5c17);}(_0x072b,0x1cc));var _0xb072=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x072b[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0xb072('0x0')]={'name':{'type':Sequelize[_0xb072('0x1')]},'description':{'type':Sequelize[_0xb072('0x1')]},'username':{'type':Sequelize[_0xb072('0x1')],'unique':_0xb072('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb072('0x1')],'unique':_0xb072('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 9310cee..9f365d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd582=['time_worked','expected_start','opened_at','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','error','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','destroy','then','end','stack','send','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','subcategory','notify','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','cmdb_ci','impact','active','business_service','priority','sys_domain_path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd582,0x100));var _0x2d58=function(_0x358642,_0x5046a1){_0x358642=_0x358642-0x0;var _0x3a1660=_0xd582[_0x358642];return _0x3a1660;};'use strict';var emlformat=require(_0x2d58('0x0'));var rimraf=require(_0x2d58('0x1'));var zipdir=require(_0x2d58('0x2'));var jsonpatch=require(_0x2d58('0x3'));var rp=require(_0x2d58('0x4'));var moment=require(_0x2d58('0x5'));var BPromise=require(_0x2d58('0x6'));var Mustache=require(_0x2d58('0x7'));var util=require(_0x2d58('0x8'));var path=require(_0x2d58('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d58('0xa'));var fs=require('fs');var fs_extra=require(_0x2d58('0xb'));var _=require('lodash');var squel=require(_0x2d58('0xc'));var crypto=require('crypto');var jsforce=require(_0x2d58('0xd'));var deskjs=require(_0x2d58('0xe'));var toCsv=require(_0x2d58('0xf'));var querystring=require(_0x2d58('0x10'));var Papa=require(_0x2d58('0x11'));var Redis=require(_0x2d58('0x12'));var authService=require(_0x2d58('0x13'));var qs=require(_0x2d58('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d58('0x15'));var logger=require(_0x2d58('0x16'))(_0x2d58('0x17'));var utils=require(_0x2d58('0x18'));var config=require(_0x2d58('0x19'));var licenseUtil=require(_0x2d58('0x1a'));var db=require(_0x2d58('0x1b'))['db'];var integrations=require(_0x2d58('0x1c'));function respondWithStatusCode(_0x21b5d4,_0x16aa84){_0x16aa84=_0x16aa84||0xcc;return function(_0x591664){if(_0x591664){return _0x21b5d4[_0x2d58('0x1d')](_0x16aa84);}return _0x21b5d4[_0x2d58('0x1e')](_0x16aa84)['end']();};}function respondWithResult(_0x528604,_0x526ecf){_0x526ecf=_0x526ecf||0xc8;return function(_0x35a358){if(_0x35a358){return _0x528604['status'](_0x526ecf)[_0x2d58('0x1f')](_0x35a358);}};}function respondWithFilteredResult(_0x43ebbb,_0x5776be){return function(_0x1c2d95){if(_0x1c2d95){var _0x67a13a=typeof _0x5776be['offset']===_0x2d58('0x20')&&typeof _0x5776be['limit']===_0x2d58('0x20');var _0x21722d=_0x1c2d95['count'];var _0x517277=_0x67a13a?0x0:_0x5776be[_0x2d58('0x21')];var _0x1c5d8d=_0x67a13a?_0x1c2d95[_0x2d58('0x22')]:_0x5776be['offset']+_0x5776be[_0x2d58('0x23')];var _0x5a464c;if(_0x1c5d8d>=_0x21722d){_0x1c5d8d=_0x21722d;_0x5a464c=0xc8;}else{_0x5a464c=0xce;}_0x43ebbb['status'](_0x5a464c);return _0x43ebbb[_0x2d58('0x24')](_0x2d58('0x25'),_0x517277+'-'+_0x1c5d8d+'/'+_0x21722d)[_0x2d58('0x1f')](_0x1c2d95);}return null;};}function patchUpdates(_0x5604d5){return function(_0xb42e4f){try{jsonpatch[_0x2d58('0x26')](_0xb42e4f,_0x5604d5,!![]);}catch(_0x561965){return BPromise[_0x2d58('0x27')](_0x561965);}return _0xb42e4f['save']();};}function saveUpdates(_0x1d3fb5,_0x5f1cda){return function(_0x13fcf1){if(_0x13fcf1){return _0x13fcf1['update'](_0x1d3fb5)['then'](function(_0x3572db){return _0x3572db;});}return null;};}function removeEntity(_0x532e51,_0x4b605d){return function(_0x17b416){if(_0x17b416){return _0x17b416[_0x2d58('0x28')]()[_0x2d58('0x29')](function(){_0x532e51[_0x2d58('0x1e')](0xcc)[_0x2d58('0x2a')]();});}};}function handleEntityNotFound(_0xba3a94,_0x1e6ea0){return function(_0x4fd76b){if(!_0x4fd76b){_0xba3a94[_0x2d58('0x1d')](0x194);}return _0x4fd76b;};}function handleError(_0x2ae0ac,_0x47b051){_0x47b051=_0x47b051||0x1f4;return function(_0x52d625){logger['error'](_0x52d625[_0x2d58('0x2b')]);if(_0x52d625['name']){delete _0x52d625['name'];}_0x2ae0ac[_0x2d58('0x1e')](_0x47b051)[_0x2d58('0x2c')](_0x52d625);};}exports[_0x2d58('0x2d')]=function(_0x465e41,_0x9e81ff){var _0x53da6e={},_0x465bb7={},_0x131e11={'count':0x0,'rows':[]};var _0x555e21=_[_0x2d58('0x2e')](db[_0x2d58('0x2f')][_0x2d58('0x30')],function(_0xb1f124){return{'name':_0xb1f124['fieldName'],'type':_0xb1f124[_0x2d58('0x31')][_0x2d58('0x32')]};});_0x465bb7[_0x2d58('0x33')]=_['map'](_0x555e21,'name');_0x465bb7[_0x2d58('0x34')]=_[_0x2d58('0x35')](_0x465e41[_0x2d58('0x34')]);_0x465bb7[_0x2d58('0x36')]=_['intersection'](_0x465bb7[_0x2d58('0x33')],_0x465bb7[_0x2d58('0x34')]);_0x53da6e[_0x2d58('0x37')]=_['intersection'](_0x465bb7[_0x2d58('0x33')],qs['fields'](_0x465e41[_0x2d58('0x34')][_0x2d58('0x38')]));_0x53da6e['attributes']=_0x53da6e['attributes']['length']?_0x53da6e[_0x2d58('0x37')]:_0x465bb7[_0x2d58('0x33')];if(!_0x465e41['query'][_0x2d58('0x39')]('nolimit')){_0x53da6e[_0x2d58('0x23')]=qs[_0x2d58('0x23')](_0x465e41['query'][_0x2d58('0x23')]);_0x53da6e[_0x2d58('0x21')]=qs[_0x2d58('0x21')](_0x465e41['query'][_0x2d58('0x21')]);}_0x53da6e[_0x2d58('0x3a')]=qs[_0x2d58('0x3b')](_0x465e41[_0x2d58('0x34')][_0x2d58('0x3b')]);_0x53da6e['where']=qs['filters'](_[_0x2d58('0x3c')](_0x465e41[_0x2d58('0x34')],_0x465bb7[_0x2d58('0x36')]),_0x555e21);if(_0x465e41[_0x2d58('0x34')][_0x2d58('0x3d')]){_0x53da6e[_0x2d58('0x3e')]=_[_0x2d58('0x3f')](_0x53da6e[_0x2d58('0x3e')],{'$or':_[_0x2d58('0x2e')](_0x555e21,function(_0x23603d){if(_0x23603d[_0x2d58('0x31')]!==_0x2d58('0x40')){var _0x4f1447={};_0x4f1447[_0x23603d[_0x2d58('0x41')]]={'$like':'%'+_0x465e41['query'][_0x2d58('0x3d')]+'%'};return _0x4f1447;}})});}_0x53da6e=_['merge']({},_0x53da6e,_0x465e41[_0x2d58('0x42')]);var _0x33d5e9={'where':_0x53da6e[_0x2d58('0x3e')]};return db[_0x2d58('0x2f')][_0x2d58('0x22')](_0x33d5e9)[_0x2d58('0x29')](function(_0x303f72){_0x131e11['count']=_0x303f72;if(_0x465e41[_0x2d58('0x34')][_0x2d58('0x43')]){_0x53da6e[_0x2d58('0x44')]=[{'all':!![]}];}return db[_0x2d58('0x2f')][_0x2d58('0x45')](_0x53da6e);})[_0x2d58('0x29')](function(_0x336995){_0x131e11[_0x2d58('0x46')]=_0x336995;return _0x131e11;})[_0x2d58('0x29')](respondWithFilteredResult(_0x9e81ff,_0x53da6e))[_0x2d58('0x47')](handleError(_0x9e81ff,null));};exports[_0x2d58('0x48')]=function(_0xe61cf8,_0x421cf3){var _0x5858ba={'raw':![],'where':{'id':_0xe61cf8[_0x2d58('0x49')]['id']}},_0x43de59={};_0x43de59[_0x2d58('0x33')]=_[_0x2d58('0x35')](db['ServicenowAccount'][_0x2d58('0x30')]);_0x43de59[_0x2d58('0x34')]=_[_0x2d58('0x35')](_0xe61cf8[_0x2d58('0x34')]);_0x43de59[_0x2d58('0x36')]=_['intersection'](_0x43de59[_0x2d58('0x33')],_0x43de59[_0x2d58('0x34')]);_0x5858ba[_0x2d58('0x37')]=_[_0x2d58('0x4a')](_0x43de59['model'],qs[_0x2d58('0x38')](_0xe61cf8[_0x2d58('0x34')]['fields']));_0x5858ba[_0x2d58('0x37')]=_0x5858ba[_0x2d58('0x37')][_0x2d58('0x4b')]?_0x5858ba[_0x2d58('0x37')]:_0x43de59['model'];if(_0xe61cf8[_0x2d58('0x34')][_0x2d58('0x43')]){_0x5858ba['include']=[{'all':!![]}];}_0x5858ba=_[_0x2d58('0x3f')]({},_0x5858ba,_0xe61cf8[_0x2d58('0x42')]);return db['ServicenowAccount'][_0x2d58('0x4c')](_0x5858ba)['then'](handleEntityNotFound(_0x421cf3,null))[_0x2d58('0x29')](respondWithResult(_0x421cf3,null))[_0x2d58('0x47')](handleError(_0x421cf3,null));};exports[_0x2d58('0x4d')]=function(_0x4c8892,_0x3579be){return db[_0x2d58('0x2f')][_0x2d58('0x4d')](_0x4c8892[_0x2d58('0x4e')],{})[_0x2d58('0x29')](respondWithResult(_0x3579be,0xc9))['catch'](handleError(_0x3579be,null));};exports[_0x2d58('0x4f')]=function(_0x4b930b,_0x584c22){if(_0x4b930b[_0x2d58('0x4e')]['id']){delete _0x4b930b['body']['id'];}return db['ServicenowAccount'][_0x2d58('0x4c')]({'where':{'id':_0x4b930b[_0x2d58('0x49')]['id']}})[_0x2d58('0x29')](handleEntityNotFound(_0x584c22,null))[_0x2d58('0x29')](saveUpdates(_0x4b930b[_0x2d58('0x4e')],null))[_0x2d58('0x29')](respondWithResult(_0x584c22,null))[_0x2d58('0x47')](handleError(_0x584c22,null));};exports[_0x2d58('0x28')]=function(_0x50f807,_0x36fb9d){return db[_0x2d58('0x2f')][_0x2d58('0x4c')]({'where':{'id':_0x50f807['params']['id']}})[_0x2d58('0x29')](handleEntityNotFound(_0x36fb9d,null))[_0x2d58('0x29')](removeEntity(_0x36fb9d,null))[_0x2d58('0x47')](handleError(_0x36fb9d,null));};exports[_0x2d58('0x50')]=function(_0x4fe61c,_0x33e02e,_0xf6dbc3){var _0x2a5cbd={};var _0x40992d={};var _0x1fbbb6;var _0x4ca92b;return db[_0x2d58('0x2f')][_0x2d58('0x51')]({'where':{'id':_0x4fe61c['params']['id']}})[_0x2d58('0x29')](handleEntityNotFound(_0x33e02e,null))[_0x2d58('0x29')](function(_0x25269e){if(_0x25269e){_0x1fbbb6=_0x25269e;_0x40992d[_0x2d58('0x33')]=_[_0x2d58('0x35')](db[_0x2d58('0x52')][_0x2d58('0x30')]);_0x40992d[_0x2d58('0x34')]=_[_0x2d58('0x35')](_0x4fe61c[_0x2d58('0x34')]);_0x40992d['filters']=_[_0x2d58('0x4a')](_0x40992d[_0x2d58('0x33')],_0x40992d[_0x2d58('0x34')]);_0x2a5cbd[_0x2d58('0x37')]=_['intersection'](_0x40992d[_0x2d58('0x33')],qs[_0x2d58('0x38')](_0x4fe61c['query']['fields']));_0x2a5cbd['attributes']=_0x2a5cbd[_0x2d58('0x37')][_0x2d58('0x4b')]?_0x2a5cbd[_0x2d58('0x37')]:_0x40992d[_0x2d58('0x33')];_0x2a5cbd[_0x2d58('0x3a')]=qs['sort'](_0x4fe61c[_0x2d58('0x34')][_0x2d58('0x3b')]);_0x2a5cbd[_0x2d58('0x3e')]=qs[_0x2d58('0x36')](_['pick'](_0x4fe61c['query'],_0x40992d[_0x2d58('0x36')]));if(_0x4fe61c['query'][_0x2d58('0x3d')]){_0x2a5cbd[_0x2d58('0x3e')]=_['merge'](_0x2a5cbd[_0x2d58('0x3e')],{'$or':_[_0x2d58('0x2e')](_0x2a5cbd['attributes'],function(_0x380cd5){var _0x49003f={};_0x49003f[_0x380cd5]={'$like':'%'+_0x4fe61c[_0x2d58('0x34')]['filter']+'%'};return _0x49003f;})});}_0x2a5cbd=_[_0x2d58('0x3f')]({},_0x2a5cbd,_0x4fe61c['options']);return _0x1fbbb6['getConfigurations'](_0x2a5cbd);}})[_0x2d58('0x29')](function(_0x3f8a73){if(_0x3f8a73){_0x4ca92b=_0x3f8a73[_0x2d58('0x4b')];if(!_0x4fe61c[_0x2d58('0x34')][_0x2d58('0x39')](_0x2d58('0x53'))){_0x2a5cbd['limit']=qs[_0x2d58('0x23')](_0x4fe61c['query'][_0x2d58('0x23')]);_0x2a5cbd[_0x2d58('0x21')]=qs[_0x2d58('0x21')](_0x4fe61c['query']['offset']);}return _0x1fbbb6[_0x2d58('0x50')](_0x2a5cbd);}})[_0x2d58('0x29')](function(_0x2522df){if(_0x2522df){return _0x2522df?{'count':_0x4ca92b,'rows':_0x2522df}:null;}})['then'](respondWithResult(_0x33e02e,null))['catch'](handleError(_0x33e02e,null));};exports[_0x2d58('0x54')]=function(_0x2f8bae,_0x17823c,_0x3ab7d5){if(_0x2f8bae[_0x2d58('0x4e')]['id']){delete _0x2f8bae[_0x2d58('0x4e')]['id'];}return db[_0x2d58('0x2f')][_0x2d58('0x51')]({'where':{'id':_0x2f8bae['params']['id']}})[_0x2d58('0x29')](handleEntityNotFound(_0x17823c,null))[_0x2d58('0x29')](function(_0x5e7af7){if(_0x5e7af7){_0x2f8bae['body'][_0x2d58('0x55')]=_0x5e7af7['id'];_0x2f8bae[_0x2d58('0x4e')][_0x2d58('0x56')]=integrations['getSubjects'](_0x2f8bae[_0x2d58('0x4e')][_0x2d58('0x57')],_0x2f8bae[_0x2d58('0x4e')]['type']);_0x2f8bae['body'][_0x2d58('0x58')]=integrations[_0x2d58('0x59')](_0x2f8bae[_0x2d58('0x4e')][_0x2d58('0x57')],_0x2f8bae[_0x2d58('0x4e')][_0x2d58('0x31')]);return db[_0x2d58('0x52')][_0x2d58('0x4d')](_0x2f8bae[_0x2d58('0x4e')],{'include':[{'model':db[_0x2d58('0x5a')],'as':_0x2d58('0x56')},{'model':db[_0x2d58('0x5a')],'as':_0x2d58('0x58')}]});}return null;})['then'](respondWithResult(_0x17823c,null))[_0x2d58('0x47')](handleError(_0x17823c,null));};exports[_0x2d58('0x5b')]=function(_0x23b16e,_0x446093,_0x11618a){var _0x35b292=['made_sla','hold_reason','knowledge',_0x2d58('0x5c'),'close_code',_0x2d58('0x5d'),'incident_state',_0x2d58('0x5e'),_0x2d58('0x5f')];var _0x1ecf7e=[_0x2d58('0x60'),'made_sla','caused_by',_0x2d58('0x61'),_0x2d58('0x62'),_0x2d58('0x63'),_0x2d58('0x64'),_0x2d58('0x65'),'approval_history',_0x2d58('0x66'),_0x2d58('0x67'),_0x2d58('0x68'),_0x2d58('0x69'),_0x2d58('0x6a'),_0x2d58('0x6b'),_0x2d58('0x6c'),_0x2d58('0x6d'),'sys_created_by','knowledge','order','calendar_stc','closed_at',_0x2d58('0x6e'),'delivery_plan',_0x2d58('0x6f'),_0x2d58('0x70'),'work_notes_list',_0x2d58('0x71'),_0x2d58('0x72'),_0x2d58('0x73'),'rfc',_0x2d58('0x74'),_0x2d58('0x75'),_0x2d58('0x76'),'business_duration',_0x2d58('0x77'),'work_end',_0x2d58('0x78'),_0x2d58('0x79'),_0x2d58('0x7a'),_0x2d58('0x7b'),_0x2d58('0x5c'),_0x2d58('0x7c'),_0x2d58('0x7d'),'close_code',_0x2d58('0x7e'),'delivery_task',_0x2d58('0x7f'),_0x2d58('0x80'),'business_stc','additional_assignee_list','description','calendar_duration',_0x2d58('0x5d'),_0x2d58('0x81'),_0x2d58('0x82'),_0x2d58('0x83'),_0x2d58('0x84'),'parent_incident',_0x2d58('0x85'),_0x2d58('0x86'),_0x2d58('0x87'),_0x2d58('0x88'),_0x2d58('0x89'),'problem_id',_0x2d58('0x8a'),_0x2d58('0x8b'),_0x2d58('0x8c'),'assigned_to','severity','comments',_0x2d58('0x8d'),_0x2d58('0x8e'),_0x2d58('0x8f'),'due_date','sys_mod_count',_0x2d58('0x90'),_0x2d58('0x91'),_0x2d58('0x92'),_0x2d58('0x93'),_0x2d58('0x94'),_0x2d58('0x95'),'category'];var _0x4edb5f='';var _0x55ec43='';var _0x17a18a=[];var _0x55d0d5='';var _0x43664f='';var _0x39e7c3=[];var _0x2df140='';var _0x5d2155='';var _0x45f7b0={};var _0x198121='';return db[_0x2d58('0x2f')][_0x2d58('0x51')]({'where':{'id':_0x23b16e[_0x2d58('0x49')]['id']},'attributes':['id',_0x2d58('0x96'),_0x2d58('0x97'),'email',_0x2d58('0x98'),_0x2d58('0x99')]})[_0x2d58('0x29')](handleEntityNotFound(_0x446093,null))['then'](function(_0x41a1db){if(_0x41a1db){_0x198121=_0x41a1db[_0x2d58('0x98')];var _0x12f8f9=_0x198121[_0x2d58('0x9a')](-0x1);if(_0x12f8f9==='/'){_0x198121=_0x198121[_0x2d58('0x9b')](0x0,_0x198121[_0x2d58('0x9c')](_0x12f8f9));}_0x5d2155=util[_0x2d58('0x9d')](_0x2d58('0x9e'),_0x198121);_0x2df140=util[_0x2d58('0x9d')](_0x2d58('0x9f'),_0x198121);_0x45f7b0={'user':_0x41a1db[_0x2d58('0x96')],'pass':_0x41a1db[_0x2d58('0x97')]};var _0x1393f7={'method':_0x2d58('0xa0'),'uri':_0x5d2155+_0x2d58('0xa1'),'auth':_0x45f7b0,'json':!![]};return rp(_0x1393f7);}})['then'](function(_0x267308){if(_0x267308[_0x2d58('0xa2')]['length']>0x0){_0x4edb5f=_0x267308['result'];}console[_0x2d58('0xa3')]('incident\x20table\x20objects',_0x4edb5f);_0x39e7c3=[];_0x55ec43=Object['assign']([],_0x4edb5f);_[_0x2d58('0xa4')](_0x55ec43,function(_0x3cd86d){return!_0x35b292[_0x2d58('0xa5')](_0x3cd86d[_0x2d58('0x41')]);});_0x55ec43[_0x2d58('0xa6')](function(_0x2b1109){var _0xf992c3=createFieldObject(_0x2df140,_0x45f7b0,_0x2b1109['internalType'],_0x2b1109[_0x2d58('0x41')],_0x2b1109[_0x2d58('0xa7')],![]);_0x39e7c3[_0x2d58('0xa8')](_0xf992c3);});return Promise[_0x2d58('0xa9')](_0x39e7c3);})['then'](function(_0x14c568){_0x17a18a=_0x14c568;_0x55d0d5=Object[_0x2d58('0xaa')]([],_0x4edb5f);console[_0x2d58('0xa3')](_0x2d58('0xab'),_0x4edb5f);_['remove'](_0x55d0d5,function(_0x3de26e){return _0x1ecf7e[_0x2d58('0xa5')](_0x3de26e[_0x2d58('0x41')]);});console[_0x2d58('0xa3')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x55d0d5);_0x39e7c3=[];_0x55d0d5[_0x2d58('0xa6')](function(_0x1d6745){var _0x5ac867=createFieldObject(_0x2df140,_0x45f7b0,_0x1d6745[_0x2d58('0xac')],_0x1d6745[_0x2d58('0x41')],_0x1d6745[_0x2d58('0xa7')],!![]);_0x39e7c3['push'](_0x5ac867);});return Promise['all'](_0x39e7c3);})[_0x2d58('0x29')](function(_0x149b51){_0x43664f=_0x149b51;var _0x5f5860=_0x17a18a[_0x2d58('0xad')](_0x43664f);return{'count':_0x5f5860[_0x2d58('0x4b')],'rows':_0x5f5860};})['then'](respondWithResult(_0x446093,null))[_0x2d58('0x47')](function(_0x159cfa){console['log'](_0x2d58('0xae')+_0x159cfa);var _0x2df55c=_0x23b16e[_0x2d58('0x34')][_0x2d58('0xaf')]?0x1f4:_0x159cfa[_0x2d58('0xb0')]||0x1f4;logger[_0x2d58('0xb1')](_0x159cfa[_0x2d58('0x2b')]);delete _0x159cfa[_0x2d58('0x41')];if(_0x2df55c===0x191){_0x2df55c=0x190;}_0x446093[_0x2d58('0x1e')](_0x2df55c)['send'](_0x23b16e[_0x2d58('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x159cfa[_0x2d58('0xb0')]}:_0x159cfa);});};function createFieldObject(_0xc0ce12,_0x1b3b1f,_0x363e21,_0x2cd1b7,_0x5582b1,_0x4473bc){return new Promise(function(_0x36e7f5,_0x3f5b21){var _0xf02d2f={'id':_0x2cd1b7,'name':_0x5582b1,'custom':_0x4473bc};if(_0x363e21===_0x2d58('0xb2')){_0xf02d2f[_0x2d58('0x42')]=[{'name':_0x2d58('0xb3'),'value':_0x2d58('0xb4')},{'name':_0x2d58('0xb5'),'value':_0x2d58('0xb6')}];_0x36e7f5(_0xf02d2f);}else{var _0x3b1491={'method':'GET','uri':_0xc0ce12+_0x2d58('0xb7')+_0x2cd1b7,'auth':_0x1b3b1f,'json':!![]};return rp(_0x3b1491)[_0x2d58('0x29')](function(_0x205423){var _0x2d2dbb=[];if(_0x205423['result'][_0x2d58('0x4b')]>0x0){_0x205423['result']['forEach'](function(_0x384197){if(_0x384197[_0x2d58('0xb8')]===_0x2d58('0xb6')){var _0x4fd103={'name':_0x384197[_0x2d58('0xa7')],'value':_0x384197[_0x2d58('0xb9')]};_0x2d2dbb['push'](_0x4fd103);}});}_0xf02d2f[_0x2d58('0x42')]=_0x2d2dbb;if(_0xf02d2f[_0x2d58('0x42')][_0x2d58('0x4b')]>0x0){_0x36e7f5(_0xf02d2f);}else{if(_0x4473bc==![]){_0x36e7f5();}else{_0x36e7f5(_0xf02d2f);}}});}});}
\ No newline at end of file
+var _0xaaf4=['reopened_time','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','incident?sysparm_display_value=all','result','log','remove','includes','internalType','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','push','concat','statusCode','error','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end','stack','send','index','ServicenowAccount','rawAttributes','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','getFields','made_sla','hold_reason','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','opened_by','user_input','sys_domain','state','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end'];(function(_0x4d81c5,_0x1f7776){var _0x495d2f=function(_0x3e60bc){while(--_0x3e60bc){_0x4d81c5['push'](_0x4d81c5['shift']());}};_0x495d2f(++_0x1f7776);}(_0xaaf4,0xfe));var _0x4aaf=function(_0xbe6beb,_0x1c1791){_0xbe6beb=_0xbe6beb-0x0;var _0x1d3245=_0xaaf4[_0xbe6beb];return _0x1d3245;};'use strict';var emlformat=require(_0x4aaf('0x0'));var rimraf=require(_0x4aaf('0x1'));var zipdir=require(_0x4aaf('0x2'));var jsonpatch=require(_0x4aaf('0x3'));var rp=require(_0x4aaf('0x4'));var moment=require('moment');var BPromise=require(_0x4aaf('0x5'));var Mustache=require('mustache');var util=require(_0x4aaf('0x6'));var path=require(_0x4aaf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aaf('0x8'));var _=require(_0x4aaf('0x9'));var squel=require('squel');var crypto=require(_0x4aaf('0xa'));var jsforce=require(_0x4aaf('0xb'));var deskjs=require(_0x4aaf('0xc'));var toCsv=require(_0x4aaf('0xd'));var querystring=require(_0x4aaf('0xe'));var Papa=require(_0x4aaf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4aaf('0x10'));var hardwareService=require(_0x4aaf('0x11'));var logger=require(_0x4aaf('0x12'))(_0x4aaf('0x13'));var utils=require(_0x4aaf('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4aaf('0x15'))['db'];var integrations=require(_0x4aaf('0x16'));function respondWithStatusCode(_0x39773f,_0xaebdab){_0xaebdab=_0xaebdab||0xcc;return function(_0x345a9f){if(_0x345a9f){return _0x39773f[_0x4aaf('0x17')](_0xaebdab);}return _0x39773f[_0x4aaf('0x18')](_0xaebdab)['end']();};}function respondWithResult(_0x998ef1,_0x138813){_0x138813=_0x138813||0xc8;return function(_0x508f51){if(_0x508f51){return _0x998ef1['status'](_0x138813)[_0x4aaf('0x19')](_0x508f51);}};}function respondWithFilteredResult(_0x15e0c6,_0x3a5330){return function(_0x472c82){if(_0x472c82){var _0x19a659=typeof _0x3a5330[_0x4aaf('0x1a')]===_0x4aaf('0x1b')&&typeof _0x3a5330[_0x4aaf('0x1c')]===_0x4aaf('0x1b');var _0x194d70=_0x472c82['count'];var _0x2c3405=_0x19a659?0x0:_0x3a5330[_0x4aaf('0x1a')];var _0x26e118=_0x19a659?_0x472c82['count']:_0x3a5330[_0x4aaf('0x1a')]+_0x3a5330['limit'];var _0x18b55;if(_0x26e118>=_0x194d70){_0x26e118=_0x194d70;_0x18b55=0xc8;}else{_0x18b55=0xce;}_0x15e0c6['status'](_0x18b55);return _0x15e0c6[_0x4aaf('0x1d')](_0x4aaf('0x1e'),_0x2c3405+'-'+_0x26e118+'/'+_0x194d70)[_0x4aaf('0x19')](_0x472c82);}return null;};}function patchUpdates(_0x23510d){return function(_0x1f7a64){try{jsonpatch[_0x4aaf('0x1f')](_0x1f7a64,_0x23510d,!![]);}catch(_0x4c40ec){return BPromise[_0x4aaf('0x20')](_0x4c40ec);}return _0x1f7a64[_0x4aaf('0x21')]();};}function saveUpdates(_0x159ff7,_0x10aa96){return function(_0x4680d5){if(_0x4680d5){return _0x4680d5[_0x4aaf('0x22')](_0x159ff7)[_0x4aaf('0x23')](function(_0x294daa){return _0x294daa;});}return null;};}function removeEntity(_0x8bdcb9,_0x312a2b){return function(_0x203eb2){if(_0x203eb2){return _0x203eb2['destroy']()[_0x4aaf('0x23')](function(){_0x8bdcb9[_0x4aaf('0x18')](0xcc)[_0x4aaf('0x24')]();});}};}function handleEntityNotFound(_0x316621,_0x2f512){return function(_0x37831d){if(!_0x37831d){_0x316621[_0x4aaf('0x17')](0x194);}return _0x37831d;};}function handleError(_0x43efb4,_0x5a747c){_0x5a747c=_0x5a747c||0x1f4;return function(_0x54b37a){logger['error'](_0x54b37a[_0x4aaf('0x25')]);if(_0x54b37a['name']){delete _0x54b37a['name'];}_0x43efb4[_0x4aaf('0x18')](_0x5a747c)[_0x4aaf('0x26')](_0x54b37a);};}exports[_0x4aaf('0x27')]=function(_0x2a3414,_0x414cb2){var _0x17d489={},_0x133352={},_0x3e5d61={'count':0x0,'rows':[]};var _0x1b50fd=_['map'](db[_0x4aaf('0x28')][_0x4aaf('0x29')],function(_0x18c2d0){return{'name':_0x18c2d0['fieldName'],'type':_0x18c2d0['type'][_0x4aaf('0x2a')]};});_0x133352['model']=_[_0x4aaf('0x2b')](_0x1b50fd,_0x4aaf('0x2c'));_0x133352[_0x4aaf('0x2d')]=_[_0x4aaf('0x2e')](_0x2a3414[_0x4aaf('0x2d')]);_0x133352[_0x4aaf('0x2f')]=_[_0x4aaf('0x30')](_0x133352[_0x4aaf('0x31')],_0x133352[_0x4aaf('0x2d')]);_0x17d489[_0x4aaf('0x32')]=_[_0x4aaf('0x30')](_0x133352[_0x4aaf('0x31')],qs[_0x4aaf('0x33')](_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x33')]));_0x17d489['attributes']=_0x17d489[_0x4aaf('0x32')][_0x4aaf('0x34')]?_0x17d489[_0x4aaf('0x32')]:_0x133352['model'];if(!_0x2a3414['query'][_0x4aaf('0x35')](_0x4aaf('0x36'))){_0x17d489[_0x4aaf('0x1c')]=qs['limit'](_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x1c')]);_0x17d489[_0x4aaf('0x1a')]=qs[_0x4aaf('0x1a')](_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x1a')]);}_0x17d489['order']=qs[_0x4aaf('0x37')](_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x37')]);_0x17d489[_0x4aaf('0x38')]=qs[_0x4aaf('0x2f')](_[_0x4aaf('0x39')](_0x2a3414[_0x4aaf('0x2d')],_0x133352[_0x4aaf('0x2f')]),_0x1b50fd);if(_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x3a')]){_0x17d489[_0x4aaf('0x38')]=_[_0x4aaf('0x3b')](_0x17d489['where'],{'$or':_[_0x4aaf('0x2b')](_0x1b50fd,function(_0x236bd0){if(_0x236bd0[_0x4aaf('0x3c')]!==_0x4aaf('0x3d')){var _0x41177a={};_0x41177a[_0x236bd0[_0x4aaf('0x2c')]]={'$like':'%'+_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x3a')]+'%'};return _0x41177a;}})});}_0x17d489=_[_0x4aaf('0x3b')]({},_0x17d489,_0x2a3414[_0x4aaf('0x3e')]);var _0x39144f={'where':_0x17d489[_0x4aaf('0x38')]};return db['ServicenowAccount'][_0x4aaf('0x3f')](_0x39144f)['then'](function(_0x344988){_0x3e5d61[_0x4aaf('0x3f')]=_0x344988;if(_0x2a3414[_0x4aaf('0x2d')][_0x4aaf('0x40')]){_0x17d489[_0x4aaf('0x41')]=[{'all':!![]}];}return db[_0x4aaf('0x28')][_0x4aaf('0x42')](_0x17d489);})['then'](function(_0x5c3206){_0x3e5d61[_0x4aaf('0x43')]=_0x5c3206;return _0x3e5d61;})[_0x4aaf('0x23')](respondWithFilteredResult(_0x414cb2,_0x17d489))[_0x4aaf('0x44')](handleError(_0x414cb2,null));};exports[_0x4aaf('0x45')]=function(_0x24dfaf,_0x514083){var _0x3e0269={'raw':![],'where':{'id':_0x24dfaf[_0x4aaf('0x46')]['id']}},_0x244617={};_0x244617[_0x4aaf('0x31')]=_[_0x4aaf('0x2e')](db['ServicenowAccount'][_0x4aaf('0x29')]);_0x244617['query']=_[_0x4aaf('0x2e')](_0x24dfaf[_0x4aaf('0x2d')]);_0x244617['filters']=_[_0x4aaf('0x30')](_0x244617[_0x4aaf('0x31')],_0x244617[_0x4aaf('0x2d')]);_0x3e0269['attributes']=_['intersection'](_0x244617[_0x4aaf('0x31')],qs[_0x4aaf('0x33')](_0x24dfaf[_0x4aaf('0x2d')]['fields']));_0x3e0269[_0x4aaf('0x32')]=_0x3e0269['attributes'][_0x4aaf('0x34')]?_0x3e0269[_0x4aaf('0x32')]:_0x244617[_0x4aaf('0x31')];if(_0x24dfaf[_0x4aaf('0x2d')]['includeAll']){_0x3e0269[_0x4aaf('0x41')]=[{'all':!![]}];}_0x3e0269=_[_0x4aaf('0x3b')]({},_0x3e0269,_0x24dfaf['options']);return db[_0x4aaf('0x28')][_0x4aaf('0x47')](_0x3e0269)[_0x4aaf('0x23')](handleEntityNotFound(_0x514083,null))[_0x4aaf('0x23')](respondWithResult(_0x514083,null))[_0x4aaf('0x44')](handleError(_0x514083,null));};exports[_0x4aaf('0x48')]=function(_0x265815,_0x4717bb){return db[_0x4aaf('0x28')][_0x4aaf('0x48')](_0x265815[_0x4aaf('0x49')],{})[_0x4aaf('0x23')](respondWithResult(_0x4717bb,0xc9))[_0x4aaf('0x44')](handleError(_0x4717bb,null));};exports['update']=function(_0x138c8b,_0x31a0a1){if(_0x138c8b[_0x4aaf('0x49')]['id']){delete _0x138c8b['body']['id'];}return db['ServicenowAccount'][_0x4aaf('0x47')]({'where':{'id':_0x138c8b[_0x4aaf('0x46')]['id']}})[_0x4aaf('0x23')](handleEntityNotFound(_0x31a0a1,null))[_0x4aaf('0x23')](saveUpdates(_0x138c8b['body'],null))[_0x4aaf('0x23')](respondWithResult(_0x31a0a1,null))['catch'](handleError(_0x31a0a1,null));};exports[_0x4aaf('0x4a')]=function(_0x1c0640,_0x50c903){return db[_0x4aaf('0x28')][_0x4aaf('0x47')]({'where':{'id':_0x1c0640[_0x4aaf('0x46')]['id']}})[_0x4aaf('0x23')](handleEntityNotFound(_0x50c903,null))[_0x4aaf('0x23')](removeEntity(_0x50c903,null))[_0x4aaf('0x44')](handleError(_0x50c903,null));};exports[_0x4aaf('0x4b')]=function(_0x43df0a,_0x38dcda,_0x4cfdb9){var _0x2a3e83={};var _0x591678={};var _0x3d5ea2;var _0xa5509f;return db[_0x4aaf('0x28')][_0x4aaf('0x4c')]({'where':{'id':_0x43df0a['params']['id']}})[_0x4aaf('0x23')](handleEntityNotFound(_0x38dcda,null))[_0x4aaf('0x23')](function(_0x3c74b6){if(_0x3c74b6){_0x3d5ea2=_0x3c74b6;_0x591678[_0x4aaf('0x31')]=_[_0x4aaf('0x2e')](db['ServicenowConfiguration'][_0x4aaf('0x29')]);_0x591678['query']=_['keys'](_0x43df0a['query']);_0x591678[_0x4aaf('0x2f')]=_['intersection'](_0x591678['model'],_0x591678[_0x4aaf('0x2d')]);_0x2a3e83[_0x4aaf('0x32')]=_[_0x4aaf('0x30')](_0x591678[_0x4aaf('0x31')],qs[_0x4aaf('0x33')](_0x43df0a[_0x4aaf('0x2d')][_0x4aaf('0x33')]));_0x2a3e83[_0x4aaf('0x32')]=_0x2a3e83[_0x4aaf('0x32')][_0x4aaf('0x34')]?_0x2a3e83['attributes']:_0x591678[_0x4aaf('0x31')];_0x2a3e83[_0x4aaf('0x4d')]=qs['sort'](_0x43df0a[_0x4aaf('0x2d')][_0x4aaf('0x37')]);_0x2a3e83[_0x4aaf('0x38')]=qs[_0x4aaf('0x2f')](_['pick'](_0x43df0a[_0x4aaf('0x2d')],_0x591678[_0x4aaf('0x2f')]));if(_0x43df0a[_0x4aaf('0x2d')][_0x4aaf('0x3a')]){_0x2a3e83[_0x4aaf('0x38')]=_[_0x4aaf('0x3b')](_0x2a3e83[_0x4aaf('0x38')],{'$or':_[_0x4aaf('0x2b')](_0x2a3e83[_0x4aaf('0x32')],function(_0x19ecab){var _0x18eab4={};_0x18eab4[_0x19ecab]={'$like':'%'+_0x43df0a[_0x4aaf('0x2d')]['filter']+'%'};return _0x18eab4;})});}_0x2a3e83=_[_0x4aaf('0x3b')]({},_0x2a3e83,_0x43df0a['options']);return _0x3d5ea2[_0x4aaf('0x4b')](_0x2a3e83);}})[_0x4aaf('0x23')](function(_0x3991cc){if(_0x3991cc){_0xa5509f=_0x3991cc[_0x4aaf('0x34')];if(!_0x43df0a[_0x4aaf('0x2d')][_0x4aaf('0x35')](_0x4aaf('0x36'))){_0x2a3e83[_0x4aaf('0x1c')]=qs[_0x4aaf('0x1c')](_0x43df0a[_0x4aaf('0x2d')][_0x4aaf('0x1c')]);_0x2a3e83['offset']=qs[_0x4aaf('0x1a')](_0x43df0a[_0x4aaf('0x2d')]['offset']);}return _0x3d5ea2[_0x4aaf('0x4b')](_0x2a3e83);}})[_0x4aaf('0x23')](function(_0x4ca630){if(_0x4ca630){return _0x4ca630?{'count':_0xa5509f,'rows':_0x4ca630}:null;}})['then'](respondWithResult(_0x38dcda,null))[_0x4aaf('0x44')](handleError(_0x38dcda,null));};exports[_0x4aaf('0x4e')]=function(_0x4a9e89,_0x5a8bd8,_0x4cd093){if(_0x4a9e89['body']['id']){delete _0x4a9e89['body']['id'];}return db[_0x4aaf('0x28')][_0x4aaf('0x4c')]({'where':{'id':_0x4a9e89[_0x4aaf('0x46')]['id']}})[_0x4aaf('0x23')](handleEntityNotFound(_0x5a8bd8,null))[_0x4aaf('0x23')](function(_0x5927d5){if(_0x5927d5){_0x4a9e89[_0x4aaf('0x49')]['AccountId']=_0x5927d5['id'];_0x4a9e89[_0x4aaf('0x49')][_0x4aaf('0x4f')]=integrations[_0x4aaf('0x50')](_0x4a9e89[_0x4aaf('0x49')][_0x4aaf('0x51')],_0x4a9e89[_0x4aaf('0x49')][_0x4aaf('0x3c')]);_0x4a9e89[_0x4aaf('0x49')][_0x4aaf('0x52')]=integrations[_0x4aaf('0x53')](_0x4a9e89['body']['channel'],_0x4a9e89['body'][_0x4aaf('0x3c')]);return db[_0x4aaf('0x54')][_0x4aaf('0x48')](_0x4a9e89[_0x4aaf('0x49')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x4aaf('0x52')}]});}return null;})[_0x4aaf('0x23')](respondWithResult(_0x5a8bd8,null))['catch'](handleError(_0x5a8bd8,null));};exports[_0x4aaf('0x55')]=function(_0x4061ca,_0x1ef89f,_0x1eaa88){var _0x1c9e0b=[_0x4aaf('0x56'),_0x4aaf('0x57'),'knowledge',_0x4aaf('0x58'),'close_code',_0x4aaf('0x59'),_0x4aaf('0x5a'),_0x4aaf('0x5b'),_0x4aaf('0x5c')];var _0x28b2df=[_0x4aaf('0x5d'),_0x4aaf('0x56'),_0x4aaf('0x5e'),_0x4aaf('0x5f'),_0x4aaf('0x60'),_0x4aaf('0x61'),_0x4aaf('0x62'),_0x4aaf('0x57'),'approval_history',_0x4aaf('0x63'),_0x4aaf('0x64'),'sys_updated_by',_0x4aaf('0x65'),_0x4aaf('0x66'),'sys_created_on',_0x4aaf('0x67'),_0x4aaf('0x68'),'sys_created_by',_0x4aaf('0x69'),'order',_0x4aaf('0x6a'),_0x4aaf('0x6b'),_0x4aaf('0x6c'),_0x4aaf('0x6d'),_0x4aaf('0x6e'),'active',_0x4aaf('0x6f'),'business_service',_0x4aaf('0x70'),_0x4aaf('0x71'),_0x4aaf('0x72'),_0x4aaf('0x73'),_0x4aaf('0x74'),_0x4aaf('0x75'),'business_duration',_0x4aaf('0x76'),_0x4aaf('0x77'),_0x4aaf('0x78'),'resolved_at',_0x4aaf('0x79'),_0x4aaf('0x7a'),'subcategory',_0x4aaf('0x7b'),_0x4aaf('0x7c'),_0x4aaf('0x7d'),_0x4aaf('0x7e'),_0x4aaf('0x7f'),_0x4aaf('0x80'),_0x4aaf('0x81'),_0x4aaf('0x82'),'additional_assignee_list','description',_0x4aaf('0x83'),_0x4aaf('0x59'),_0x4aaf('0x84'),_0x4aaf('0x85'),'closed_by',_0x4aaf('0x86'),_0x4aaf('0x87'),'sys_id',_0x4aaf('0x88'),'reopened_by','incident_state',_0x4aaf('0x89'),_0x4aaf('0x8a'),_0x4aaf('0x8b'),_0x4aaf('0x8c'),_0x4aaf('0x8d'),_0x4aaf('0x8e'),_0x4aaf('0x5b'),_0x4aaf('0x8f'),_0x4aaf('0x90'),'approval','comments_and_work_notes',_0x4aaf('0x91'),_0x4aaf('0x92'),_0x4aaf('0x93'),_0x4aaf('0x94'),_0x4aaf('0x95'),'upon_approval',_0x4aaf('0x96'),_0x4aaf('0x97'),_0x4aaf('0x5c')];var _0x491ce5='';var _0x5e9867='';var _0x264315=[];var _0x5cbe2a='';var _0x5316b1='';var _0x583f8c=[];var _0x43a4ca='';var _0x2c4c92='';var _0x1412d0={};var _0x10e5fb='';return db[_0x4aaf('0x28')][_0x4aaf('0x4c')]({'where':{'id':_0x4061ca['params']['id']},'attributes':['id','username',_0x4aaf('0x98'),_0x4aaf('0x99'),_0x4aaf('0x9a'),'serverUrl']})['then'](handleEntityNotFound(_0x1ef89f,null))['then'](function(_0x4cfa30){if(_0x4cfa30){_0x10e5fb=_0x4cfa30[_0x4aaf('0x9a')];var _0x54e17d=_0x10e5fb[_0x4aaf('0x9b')](-0x1);if(_0x54e17d==='/'){_0x10e5fb=_0x10e5fb[_0x4aaf('0x9c')](0x0,_0x10e5fb[_0x4aaf('0x9d')](_0x54e17d));}_0x2c4c92=util[_0x4aaf('0x9e')](_0x4aaf('0x9f'),_0x10e5fb);_0x43a4ca=util[_0x4aaf('0x9e')]('%s/api/now/table/',_0x10e5fb);_0x1412d0={'user':_0x4cfa30[_0x4aaf('0xa0')],'pass':_0x4cfa30[_0x4aaf('0x98')]};var _0x3848d5={'method':_0x4aaf('0xa1'),'uri':_0x2c4c92+_0x4aaf('0xa2'),'auth':_0x1412d0,'json':!![]};return rp(_0x3848d5);}})['then'](function(_0x74af0d){if(_0x74af0d[_0x4aaf('0xa3')][_0x4aaf('0x34')]>0x0){_0x491ce5=_0x74af0d['result'];}console[_0x4aaf('0xa4')]('incident\x20table\x20objects',_0x491ce5);_0x583f8c=[];_0x5e9867=Object['assign']([],_0x491ce5);_[_0x4aaf('0xa5')](_0x5e9867,function(_0x569db6){return!_0x1c9e0b[_0x4aaf('0xa6')](_0x569db6[_0x4aaf('0x2c')]);});_0x5e9867['forEach'](function(_0x2ad885){var _0x39c016=createFieldObject(_0x43a4ca,_0x1412d0,_0x2ad885[_0x4aaf('0xa7')],_0x2ad885[_0x4aaf('0x2c')],_0x2ad885['label'],![]);_0x583f8c['push'](_0x39c016);});return Promise[_0x4aaf('0xa8')](_0x583f8c);})['then'](function(_0x3a6c83){_0x264315=_0x3a6c83;_0x5cbe2a=Object['assign']([],_0x491ce5);console[_0x4aaf('0xa4')](_0x4aaf('0xa9'),_0x491ce5);_['remove'](_0x5cbe2a,function(_0x265a9a){return _0x28b2df[_0x4aaf('0xa6')](_0x265a9a[_0x4aaf('0x2c')]);});console[_0x4aaf('0xa4')](_0x4aaf('0xaa'),_0x5cbe2a);_0x583f8c=[];_0x5cbe2a[_0x4aaf('0xab')](function(_0x12518a){var _0x234647=createFieldObject(_0x43a4ca,_0x1412d0,_0x12518a[_0x4aaf('0xa7')],_0x12518a[_0x4aaf('0x2c')],_0x12518a[_0x4aaf('0xac')],!![]);_0x583f8c[_0x4aaf('0xad')](_0x234647);});return Promise[_0x4aaf('0xa8')](_0x583f8c);})[_0x4aaf('0x23')](function(_0x42cf7b){_0x5316b1=_0x42cf7b;var _0x45d91d=_0x264315[_0x4aaf('0xae')](_0x5316b1);return{'count':_0x45d91d[_0x4aaf('0x34')],'rows':_0x45d91d};})[_0x4aaf('0x23')](respondWithResult(_0x1ef89f,null))['catch'](function(_0x87ecd1){console[_0x4aaf('0xa4')]('ServiceNow\x20error:\x20'+_0x87ecd1);var _0x3ff07b=_0x4061ca[_0x4aaf('0x2d')]['test']?0x1f4:_0x87ecd1[_0x4aaf('0xaf')]||0x1f4;logger[_0x4aaf('0xb0')](_0x87ecd1[_0x4aaf('0x25')]);delete _0x87ecd1[_0x4aaf('0x2c')];if(_0x3ff07b===0x191){_0x3ff07b=0x190;}_0x1ef89f[_0x4aaf('0x18')](_0x3ff07b)[_0x4aaf('0x26')](_0x4061ca[_0x4aaf('0x2d')][_0x4aaf('0xb1')]?{'message':_0x4aaf('0xb2'),'statusCode':_0x87ecd1['statusCode']}:_0x87ecd1);});};function createFieldObject(_0x4e8ca2,_0x1e8aa6,_0x2fb2b7,_0x17a12b,_0x5671e7,_0xbfba81){return new Promise(function(_0x397db8,_0x38e25a){var _0x34fbd0={'id':_0x17a12b,'name':_0x5671e7,'custom':_0xbfba81};if(_0x2fb2b7===_0x4aaf('0xb3')){_0x34fbd0[_0x4aaf('0x3e')]=[{'name':_0x4aaf('0xb4'),'value':_0x4aaf('0xb5')},{'name':_0x4aaf('0xb6'),'value':_0x4aaf('0xb7')}];_0x397db8(_0x34fbd0);}else{var _0x58aaa6={'method':_0x4aaf('0xa1'),'uri':_0x4e8ca2+_0x4aaf('0xb8')+_0x17a12b,'auth':_0x1e8aa6,'json':!![]};return rp(_0x58aaa6)[_0x4aaf('0x23')](function(_0x55eb79){var _0x5bea97=[];if(_0x55eb79[_0x4aaf('0xa3')][_0x4aaf('0x34')]>0x0){_0x55eb79[_0x4aaf('0xa3')][_0x4aaf('0xab')](function(_0x4e3f38){if(_0x4e3f38[_0x4aaf('0xb9')]==='false'){var _0xe78d55={'name':_0x4e3f38[_0x4aaf('0xac')],'value':_0x4e3f38[_0x4aaf('0xba')]};_0x5bea97[_0x4aaf('0xad')](_0xe78d55);}});}_0x34fbd0['options']=_0x5bea97;if(_0x34fbd0['options'][_0x4aaf('0x34')]>0x0){_0x397db8(_0x34fbd0);}else{if(_0xbfba81==![]){_0x397db8();}else{_0x397db8(_0x34fbd0);}}});}});}
\ No newline at end of file
index 5ba7d22..3e476b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['path','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x226841,_0x2afd8a){var _0x3e9044=function(_0x568f1f){while(--_0x568f1f){_0x226841['push'](_0x226841['shift']());}};_0x3e9044(++_0x2afd8a);}(_0x1623,0xab));var _0x3162=function(_0x4d3485,_0x224da6){_0x4d3485=_0x4d3485-0x0;var _0x1fb1aa=_0x1623[_0x4d3485];return _0x1fb1aa;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3162('0x7')]=function(_0x428de6,_0x53260d){return _0x428de6[_0x3162('0x8')](_0x3162('0x9'),attributes,{'tableName':_0x3162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x2dbc8f,_0x1afb20){var _0x50a150=function(_0x1c994c){while(--_0x1c994c){_0x2dbc8f['push'](_0x2dbc8f['shift']());}};_0x50a150(++_0x1afb20);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3f72e2,_0x35b476){_0x3f72e2=_0x3f72e2-0x0;var _0x490731=_0xc1c6[_0x3f72e2];return _0x490731;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f4ce9b..34f2a88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28d4=['request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','findAll','options','raw','where','include','attributes','map','model','debug','stringify','ServicenowAccount','find','ShowServicenowAccount','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5f4a14,_0x4bd523){var _0x383207=function(_0x23a03d){while(--_0x23a03d){_0x5f4a14['push'](_0x5f4a14['shift']());}};_0x383207(++_0x4bd523);}(_0x28d4,0x103));var _0x428d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x28d4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x428d('0x0'));var moment=require(_0x428d('0x1'));var BPromise=require(_0x428d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x428d('0x3'));var logger=require(_0x428d('0x4'))(_0x428d('0x5'));var config=require(_0x428d('0x6'));var jayson=require(_0x428d('0x7'));var client=jayson[_0x428d('0x8')][_0x428d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x162d0d,_0x97b85c,_0x160e2b){return new BPromise(function(_0x5c31ba,_0x484deb){return client[_0x428d('0xa')](_0x162d0d,_0x160e2b)[_0x428d('0xb')](function(_0x3869ad){logger[_0x428d('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x97b85c,_0x428d('0xd'));logger['debug'](_0x428d('0xe'),_0x97b85c,_0x428d('0xd'),JSON['stringify'](_0x3869ad));if(_0x3869ad[_0x428d('0xf')]){if(_0x3869ad[_0x428d('0xf')][_0x428d('0x10')]===0x1f4){logger[_0x428d('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x97b85c,_0x3869ad['error']['message']);return _0x484deb(_0x3869ad[_0x428d('0xf')]['message']);}logger[_0x428d('0xf')](_0x428d('0x11'),_0x97b85c,_0x3869ad[_0x428d('0xf')]['message']);return _0x5c31ba(_0x3869ad['error'][_0x428d('0x12')]);}else{logger[_0x428d('0xc')](_0x428d('0x11'),_0x97b85c,_0x428d('0xd'));_0x5c31ba(_0x3869ad['result'][_0x428d('0x12')]);}})[_0x428d('0x13')](function(_0xd349ad){logger[_0x428d('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x97b85c,_0xd349ad);_0x484deb(_0xd349ad);});});}exports[_0x428d('0x14')]=function(_0x2be5cc){var _0x172a27=this;return new Promise(function(_0x432c6b,_0x54c48b){return db['ServicenowAccount'][_0x428d('0x15')]({'raw':_0x2be5cc[_0x428d('0x16')]?_0x2be5cc[_0x428d('0x16')][_0x428d('0x17')]===undefined?!![]:![]:!![],'where':_0x2be5cc[_0x428d('0x16')]?_0x2be5cc[_0x428d('0x16')][_0x428d('0x18')]||null:null,'attributes':_0x2be5cc[_0x428d('0x16')]?_0x2be5cc[_0x428d('0x16')]['attributes']||null:null,'limit':_0x2be5cc[_0x428d('0x16')]?_0x2be5cc[_0x428d('0x16')]['limit']||null:null,'include':_0x2be5cc[_0x428d('0x16')]?_0x2be5cc[_0x428d('0x16')][_0x428d('0x19')]?_['map'](_0x2be5cc[_0x428d('0x16')]['include'],function(_0x8d852d){return{'model':db[_0x8d852d['model']],'as':_0x8d852d['as'],'attributes':_0x8d852d[_0x428d('0x1a')],'include':_0x8d852d[_0x428d('0x19')]?_[_0x428d('0x1b')](_0x8d852d[_0x428d('0x19')],function(_0x8f5919){return{'model':db[_0x8f5919[_0x428d('0x1c')]],'as':_0x8f5919['as'],'attributes':_0x8f5919[_0x428d('0x1a')],'include':_0x8f5919[_0x428d('0x19')]?_[_0x428d('0x1b')](_0x8f5919[_0x428d('0x19')],function(_0x358858){return{'model':db[_0x358858[_0x428d('0x1c')]],'as':_0x358858['as'],'attributes':_0x358858['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x39b902){logger['info']('GetServicenowAccount',_0x2be5cc);logger[_0x428d('0x1d')](_0x428d('0x14'),_0x2be5cc,JSON[_0x428d('0x1e')](_0x39b902));_0x432c6b(_0x39b902);})[_0x428d('0x13')](function(_0x15017b){logger['error'](_0x428d('0x14'),_0x15017b[_0x428d('0x12')],_0x2be5cc);_0x54c48b(_0x172a27[_0x428d('0xf')](0x1f4,_0x15017b['message']));});});};exports['ShowServicenowAccount']=function(_0x3dbb38){var _0xcb8189=this;return new Promise(function(_0x4a9cc9,_0xd5b182){return db[_0x428d('0x1f')][_0x428d('0x20')]({'raw':_0x3dbb38[_0x428d('0x16')]?_0x3dbb38[_0x428d('0x16')][_0x428d('0x17')]===undefined?!![]:![]:!![],'where':_0x3dbb38[_0x428d('0x16')]?_0x3dbb38[_0x428d('0x16')]['where']||null:null,'attributes':_0x3dbb38[_0x428d('0x16')]?_0x3dbb38[_0x428d('0x16')]['attributes']||null:null,'include':_0x3dbb38['options']?_0x3dbb38[_0x428d('0x16')][_0x428d('0x19')]?_['map'](_0x3dbb38[_0x428d('0x16')][_0x428d('0x19')],function(_0x58e93e){return{'model':db[_0x58e93e[_0x428d('0x1c')]],'as':_0x58e93e['as'],'attributes':_0x58e93e[_0x428d('0x1a')],'include':_0x58e93e[_0x428d('0x19')]?_[_0x428d('0x1b')](_0x58e93e[_0x428d('0x19')],function(_0x182cef){return{'model':db[_0x182cef[_0x428d('0x1c')]],'as':_0x182cef['as'],'attributes':_0x182cef[_0x428d('0x1a')],'include':_0x182cef[_0x428d('0x19')]?_[_0x428d('0x1b')](_0x182cef['include'],function(_0x2225a7){return{'model':db[_0x2225a7['model']],'as':_0x2225a7['as'],'attributes':_0x2225a7[_0x428d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x428d('0xb')](function(_0x94b0c7){logger[_0x428d('0xc')]('ShowServicenowAccount',_0x3dbb38);logger[_0x428d('0x1d')](_0x428d('0x21'),_0x3dbb38,JSON['stringify'](_0x94b0c7));_0x4a9cc9(_0x94b0c7);})[_0x428d('0x13')](function(_0x27e89c){logger[_0x428d('0xf')]('ShowServicenowAccount',_0x27e89c['message'],_0x3dbb38);_0xd5b182(_0xcb8189['error'](0x1f4,_0x27e89c['message']));});});};
\ No newline at end of file
+var _0x0e2a=['debug','error','code','message','result','GetServicenowAccount','findAll','options','raw','limit','include','map','model','attributes','stringify','catch','ShowServicenowAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2b4c1b,_0x37e665){var _0x3d4664=function(_0x1b8601){while(--_0x1b8601){_0x2b4c1b['push'](_0x2b4c1b['shift']());}};_0x3d4664(++_0x37e665);}(_0x0e2a,0x7c));var _0xa0e2=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x0e2a[_0x482214];return _0x38d0cb;};'use strict';var _=require('lodash');var util=require(_0xa0e2('0x0'));var moment=require(_0xa0e2('0x1'));var BPromise=require(_0xa0e2('0x2'));var rs=require(_0xa0e2('0x3'));var fs=require('fs');var Redis=require(_0xa0e2('0x4'));var db=require(_0xa0e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa0e2('0x6'));var config=require(_0xa0e2('0x7'));var jayson=require(_0xa0e2('0x8'));var client=jayson[_0xa0e2('0x9')][_0xa0e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21306b,_0x3c1960,_0x47bf24){return new BPromise(function(_0x589650,_0x2d9814){return client[_0xa0e2('0xb')](_0x21306b,_0x47bf24)[_0xa0e2('0xc')](function(_0x189a0e){logger[_0xa0e2('0xd')](_0xa0e2('0xe'),_0x3c1960,_0xa0e2('0xf'));logger[_0xa0e2('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3c1960,_0xa0e2('0xf'),JSON['stringify'](_0x189a0e));if(_0x189a0e[_0xa0e2('0x11')]){if(_0x189a0e[_0xa0e2('0x11')][_0xa0e2('0x12')]===0x1f4){logger[_0xa0e2('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x3c1960,_0x189a0e[_0xa0e2('0x11')][_0xa0e2('0x13')]);return _0x2d9814(_0x189a0e['error'][_0xa0e2('0x13')]);}logger[_0xa0e2('0x11')](_0xa0e2('0xe'),_0x3c1960,_0x189a0e[_0xa0e2('0x11')]['message']);return _0x589650(_0x189a0e[_0xa0e2('0x11')][_0xa0e2('0x13')]);}else{logger[_0xa0e2('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x3c1960,'request\x20sent');_0x589650(_0x189a0e[_0xa0e2('0x14')][_0xa0e2('0x13')]);}})['catch'](function(_0x350e8f){logger['error'](_0xa0e2('0xe'),_0x3c1960,_0x350e8f);_0x2d9814(_0x350e8f);});});}exports[_0xa0e2('0x15')]=function(_0x49311d){var _0xea6ba3=this;return new Promise(function(_0x1d76f0,_0x1251e9){return db['ServicenowAccount'][_0xa0e2('0x16')]({'raw':_0x49311d[_0xa0e2('0x17')]?_0x49311d[_0xa0e2('0x17')][_0xa0e2('0x18')]===undefined?!![]:![]:!![],'where':_0x49311d[_0xa0e2('0x17')]?_0x49311d[_0xa0e2('0x17')]['where']||null:null,'attributes':_0x49311d['options']?_0x49311d['options']['attributes']||null:null,'limit':_0x49311d[_0xa0e2('0x17')]?_0x49311d[_0xa0e2('0x17')][_0xa0e2('0x19')]||null:null,'include':_0x49311d['options']?_0x49311d[_0xa0e2('0x17')][_0xa0e2('0x1a')]?_[_0xa0e2('0x1b')](_0x49311d[_0xa0e2('0x17')][_0xa0e2('0x1a')],function(_0x1a7b1f){return{'model':db[_0x1a7b1f[_0xa0e2('0x1c')]],'as':_0x1a7b1f['as'],'attributes':_0x1a7b1f[_0xa0e2('0x1d')],'include':_0x1a7b1f[_0xa0e2('0x1a')]?_[_0xa0e2('0x1b')](_0x1a7b1f[_0xa0e2('0x1a')],function(_0x573624){return{'model':db[_0x573624[_0xa0e2('0x1c')]],'as':_0x573624['as'],'attributes':_0x573624[_0xa0e2('0x1d')],'include':_0x573624[_0xa0e2('0x1a')]?_[_0xa0e2('0x1b')](_0x573624[_0xa0e2('0x1a')],function(_0x6ce6f6){return{'model':db[_0x6ce6f6[_0xa0e2('0x1c')]],'as':_0x6ce6f6['as'],'attributes':_0x6ce6f6[_0xa0e2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0e2('0xc')](function(_0x4cdc3c){logger['info'](_0xa0e2('0x15'),_0x49311d);logger['debug'](_0xa0e2('0x15'),_0x49311d,JSON[_0xa0e2('0x1e')](_0x4cdc3c));_0x1d76f0(_0x4cdc3c);})[_0xa0e2('0x1f')](function(_0x3b8108){logger[_0xa0e2('0x11')](_0xa0e2('0x15'),_0x3b8108[_0xa0e2('0x13')],_0x49311d);_0x1251e9(_0xea6ba3['error'](0x1f4,_0x3b8108['message']));});});};exports[_0xa0e2('0x20')]=function(_0x3a1082){var _0x159215=this;return new Promise(function(_0x5f1cd7,_0x522700){return db['ServicenowAccount'][_0xa0e2('0x21')]({'raw':_0x3a1082[_0xa0e2('0x17')]?_0x3a1082[_0xa0e2('0x17')][_0xa0e2('0x18')]===undefined?!![]:![]:!![],'where':_0x3a1082[_0xa0e2('0x17')]?_0x3a1082[_0xa0e2('0x17')][_0xa0e2('0x22')]||null:null,'attributes':_0x3a1082['options']?_0x3a1082['options'][_0xa0e2('0x1d')]||null:null,'include':_0x3a1082[_0xa0e2('0x17')]?_0x3a1082['options']['include']?_['map'](_0x3a1082['options'][_0xa0e2('0x1a')],function(_0x387263){return{'model':db[_0x387263['model']],'as':_0x387263['as'],'attributes':_0x387263[_0xa0e2('0x1d')],'include':_0x387263[_0xa0e2('0x1a')]?_[_0xa0e2('0x1b')](_0x387263[_0xa0e2('0x1a')],function(_0x4728dc){return{'model':db[_0x4728dc['model']],'as':_0x4728dc['as'],'attributes':_0x4728dc[_0xa0e2('0x1d')],'include':_0x4728dc[_0xa0e2('0x1a')]?_['map'](_0x4728dc[_0xa0e2('0x1a')],function(_0x2faf0f){return{'model':db[_0x2faf0f[_0xa0e2('0x1c')]],'as':_0x2faf0f['as'],'attributes':_0x2faf0f[_0xa0e2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0e2('0xc')](function(_0x1a09f6){logger[_0xa0e2('0xd')]('ShowServicenowAccount',_0x3a1082);logger['debug']('ShowServicenowAccount',_0x3a1082,JSON[_0xa0e2('0x1e')](_0x1a09f6));_0x5f1cd7(_0x1a09f6);})['catch'](function(_0x48a30d){logger['error'](_0xa0e2('0x20'),_0x48a30d[_0xa0e2('0x13')],_0x3a1082);_0x522700(_0x159215[_0xa0e2('0x11')](0x1f4,_0x48a30d['message']));});});};
\ No newline at end of file
index 848ed72..9fd4790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfe=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x3e2435,_0xc531a1){var _0x5d49e7=function(_0x214b4f){while(--_0x214b4f){_0x3e2435['push'](_0x3e2435['shift']());}};_0x5d49e7(++_0xc531a1);}(_0xdbfe,0x1ab));var _0xedbf=function(_0x38c316,_0x26be24){_0x38c316=_0x38c316-0x0;var _0x39ec0e=_0xdbfe[_0x38c316];return _0x39ec0e;};'use strict';var multer=require(_0xedbf('0x0'));var util=require(_0xedbf('0x1'));var path=require(_0xedbf('0x2'));var timeout=require(_0xedbf('0x3'));var express=require(_0xedbf('0x4'));var router=express['Router']();var fs_extra=require(_0xedbf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xedbf('0x6'));var config=require(_0xedbf('0x7'));var controller=require(_0xedbf('0x8'));router[_0xedbf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xedbf('0x9')](_0xedbf('0xa'),auth['isAuthenticated'](),controller[_0xedbf('0xb')]);router[_0xedbf('0x9')](_0xedbf('0xc'),auth[_0xedbf('0xd')](),controller[_0xedbf('0xe')]);router[_0xedbf('0x9')](_0xedbf('0xf'),auth[_0xedbf('0xd')](),controller[_0xedbf('0x10')]);router[_0xedbf('0x9')](_0xedbf('0x11'),auth['isAuthenticated'](),controller[_0xedbf('0x12')]);router[_0xedbf('0x13')]('/',auth[_0xedbf('0xd')](),controller[_0xedbf('0x14')]);router[_0xedbf('0x15')](_0xedbf('0xa'),auth[_0xedbf('0xd')](),controller[_0xedbf('0x16')]);router[_0xedbf('0x17')](_0xedbf('0xa'),auth['isAuthenticated'](),controller[_0xedbf('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x742f=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1a9e9a,_0x17f44a){var _0x13a357=function(_0x49f088){while(--_0x49f088){_0x1a9e9a['push'](_0x1a9e9a['shift']());}};_0x13a357(++_0x17f44a);}(_0x742f,0x72));var _0xf742=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x742f[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0xf742('0x0'));var util=require(_0xf742('0x1'));var path=require(_0xf742('0x2'));var timeout=require(_0xf742('0x3'));var express=require(_0xf742('0x4'));var router=express[_0xf742('0x5')]();var fs_extra=require(_0xf742('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf742('0x7'));var config=require(_0xf742('0x8'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xf742('0x9')](),controller[_0xf742('0xa')]);router[_0xf742('0xb')](_0xf742('0xc'),auth[_0xf742('0x9')](),controller[_0xf742('0xd')]);router[_0xf742('0xb')](_0xf742('0xe'),auth['isAuthenticated'](),controller[_0xf742('0xf')]);router[_0xf742('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xf742('0x10')]);router[_0xf742('0xb')](_0xf742('0x11'),auth[_0xf742('0x9')](),controller['getDescriptions']);router[_0xf742('0x12')]('/',auth[_0xf742('0x9')](),controller[_0xf742('0x13')]);router[_0xf742('0x14')](_0xf742('0xc'),auth[_0xf742('0x9')](),controller[_0xf742('0x15')]);router[_0xf742('0x16')](_0xf742('0xc'),auth['isAuthenticated'](),controller[_0xf742('0x17')]);module['exports']=router;
\ No newline at end of file
index 97f7b33..a1ceefd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f1=['STRING','sequelize'];(function(_0xfa6937,_0x2e9b51){var _0x1613b0=function(_0x42e4cf){while(--_0x42e4cf){_0xfa6937['push'](_0xfa6937['shift']());}};_0x1613b0(++_0x2e9b51);}(_0x78f1,0xcb));var _0x178f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x78f1[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x178f('0x0'));module['exports']={'name':{'type':Sequelize[_0x178f('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa1a3=['exports','STRING'];(function(_0x644668,_0x7e646d){var _0x4c9344=function(_0x287743){while(--_0x287743){_0x644668['push'](_0x644668['shift']());}};_0x4c9344(++_0x7e646d);}(_0xa1a3,0xa6));var _0x3a1a=function(_0x583013,_0x455c9d){_0x583013=_0x583013-0x0;var _0x11a3c7=_0xa1a3[_0x583013];return _0x11a3c7;};'use strict';var Sequelize=require('sequelize');module[_0x3a1a('0x0')]={'name':{'type':Sequelize[_0x3a1a('0x1')]},'description':{'type':Sequelize[_0x3a1a('0x1')]}};
\ No newline at end of file
index d74feda..513880f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2af8=['undefined','limit','set','Content-Range','apply','reject','save','destroy','then','end','error','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','getFields','findOne','order','getSubjects','ServicenowField','getDescriptions','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','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x2af8,0x12e));var _0x82af=function(_0x1b5c54,_0x11d5cc){_0x1b5c54=_0x1b5c54-0x0;var _0x18529b=_0x2af8[_0x1b5c54];return _0x18529b;};'use strict';var emlformat=require(_0x82af('0x0'));var rimraf=require(_0x82af('0x1'));var zipdir=require(_0x82af('0x2'));var jsonpatch=require(_0x82af('0x3'));var rp=require(_0x82af('0x4'));var moment=require(_0x82af('0x5'));var BPromise=require(_0x82af('0x6'));var Mustache=require(_0x82af('0x7'));var util=require(_0x82af('0x8'));var path=require('path');var sox=require(_0x82af('0x9'));var csv=require('to-csv');var ejs=require(_0x82af('0xa'));var fs=require('fs');var fs_extra=require(_0x82af('0xb'));var _=require(_0x82af('0xc'));var squel=require(_0x82af('0xd'));var crypto=require(_0x82af('0xe'));var jsforce=require(_0x82af('0xf'));var deskjs=require(_0x82af('0x10'));var toCsv=require(_0x82af('0x11'));var querystring=require(_0x82af('0x12'));var Papa=require(_0x82af('0x13'));var Redis=require(_0x82af('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82af('0x15'));var logger=require(_0x82af('0x16'))(_0x82af('0x17'));var utils=require(_0x82af('0x18'));var config=require(_0x82af('0x19'));var licenseUtil=require(_0x82af('0x1a'));var db=require(_0x82af('0x1b'))['db'];function respondWithStatusCode(_0x328237,_0x5027fe){_0x5027fe=_0x5027fe||0xcc;return function(_0x53aac4){if(_0x53aac4){return _0x328237[_0x82af('0x1c')](_0x5027fe);}return _0x328237[_0x82af('0x1d')](_0x5027fe)['end']();};}function respondWithResult(_0x557021,_0x175eb5){_0x175eb5=_0x175eb5||0xc8;return function(_0x267c7a){if(_0x267c7a){return _0x557021[_0x82af('0x1d')](_0x175eb5)['json'](_0x267c7a);}};}function respondWithFilteredResult(_0x3d77d4,_0x57e744){return function(_0x5c07a0){if(_0x5c07a0){var _0x47f771=typeof _0x57e744['offset']===_0x82af('0x1e')&&typeof _0x57e744[_0x82af('0x1f')]===_0x82af('0x1e');var _0x493e54=_0x5c07a0['count'];var _0x337bf9=_0x47f771?0x0:_0x57e744['offset'];var _0x26f461=_0x47f771?_0x5c07a0['count']:_0x57e744['offset']+_0x57e744[_0x82af('0x1f')];var _0x4ce8fe;if(_0x26f461>=_0x493e54){_0x26f461=_0x493e54;_0x4ce8fe=0xc8;}else{_0x4ce8fe=0xce;}_0x3d77d4[_0x82af('0x1d')](_0x4ce8fe);return _0x3d77d4[_0x82af('0x20')](_0x82af('0x21'),_0x337bf9+'-'+_0x26f461+'/'+_0x493e54)['json'](_0x5c07a0);}return null;};}function patchUpdates(_0x570086){return function(_0x51740d){try{jsonpatch[_0x82af('0x22')](_0x51740d,_0x570086,!![]);}catch(_0x2a715a){return BPromise[_0x82af('0x23')](_0x2a715a);}return _0x51740d[_0x82af('0x24')]();};}function saveUpdates(_0x4ea5a6,_0x25349c){return function(_0x33971e){if(_0x33971e){return _0x33971e['update'](_0x4ea5a6)['then'](function(_0x666260){return _0x666260;});}return null;};}function removeEntity(_0x26752c,_0x4f43e6){return function(_0x1dabc5){if(_0x1dabc5){return _0x1dabc5[_0x82af('0x25')]()[_0x82af('0x26')](function(){_0x26752c['status'](0xcc)[_0x82af('0x27')]();});}};}function handleEntityNotFound(_0x249b4d,_0x249821){return function(_0x56e0cd){if(!_0x56e0cd){_0x249b4d[_0x82af('0x1c')](0x194);}return _0x56e0cd;};}function handleError(_0x178dc6,_0x4982ca){_0x4982ca=_0x4982ca||0x1f4;return function(_0x561f7a){logger[_0x82af('0x28')](_0x561f7a['stack']);if(_0x561f7a[_0x82af('0x29')]){delete _0x561f7a[_0x82af('0x29')];}_0x178dc6[_0x82af('0x1d')](_0x4982ca)['send'](_0x561f7a);};}exports['index']=function(_0x29e610,_0x1158ab){var _0x2708c5={},_0x277687={},_0x525cd0={'count':0x0,'rows':[]};var _0x169a7e=_[_0x82af('0x2a')](db['ServicenowConfiguration'][_0x82af('0x2b')],function(_0x5aa52b){return{'name':_0x5aa52b[_0x82af('0x2c')],'type':_0x5aa52b[_0x82af('0x2d')][_0x82af('0x2e')]};});_0x277687['model']=_[_0x82af('0x2a')](_0x169a7e,_0x82af('0x29'));_0x277687[_0x82af('0x2f')]=_[_0x82af('0x30')](_0x29e610['query']);_0x277687[_0x82af('0x31')]=_[_0x82af('0x32')](_0x277687['model'],_0x277687[_0x82af('0x2f')]);_0x2708c5[_0x82af('0x33')]=_[_0x82af('0x32')](_0x277687[_0x82af('0x34')],qs[_0x82af('0x35')](_0x29e610[_0x82af('0x2f')]['fields']));_0x2708c5[_0x82af('0x33')]=_0x2708c5[_0x82af('0x33')][_0x82af('0x36')]?_0x2708c5[_0x82af('0x33')]:_0x277687['model'];if(!_0x29e610[_0x82af('0x2f')][_0x82af('0x37')](_0x82af('0x38'))){_0x2708c5[_0x82af('0x1f')]=qs[_0x82af('0x1f')](_0x29e610[_0x82af('0x2f')][_0x82af('0x1f')]);_0x2708c5['offset']=qs[_0x82af('0x39')](_0x29e610['query'][_0x82af('0x39')]);}_0x2708c5['order']=qs[_0x82af('0x3a')](_0x29e610[_0x82af('0x2f')][_0x82af('0x3a')]);_0x2708c5['where']=qs[_0x82af('0x31')](_[_0x82af('0x3b')](_0x29e610[_0x82af('0x2f')],_0x277687[_0x82af('0x31')]),_0x169a7e);if(_0x29e610['query'][_0x82af('0x3c')]){_0x2708c5[_0x82af('0x3d')]=_[_0x82af('0x3e')](_0x2708c5[_0x82af('0x3d')],{'$or':_[_0x82af('0x2a')](_0x169a7e,function(_0x15d6e9){if(_0x15d6e9[_0x82af('0x2d')]!==_0x82af('0x3f')){var _0x127974={};_0x127974[_0x15d6e9[_0x82af('0x29')]]={'$like':'%'+_0x29e610[_0x82af('0x2f')][_0x82af('0x3c')]+'%'};return _0x127974;}})});}_0x2708c5=_[_0x82af('0x3e')]({},_0x2708c5,_0x29e610[_0x82af('0x40')]);var _0x3f696d={'where':_0x2708c5[_0x82af('0x3d')]};return db[_0x82af('0x41')]['count'](_0x3f696d)[_0x82af('0x26')](function(_0x2d5bf0){_0x525cd0['count']=_0x2d5bf0;if(_0x29e610['query'][_0x82af('0x42')]){_0x2708c5[_0x82af('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x82af('0x44')](_0x2708c5);})[_0x82af('0x26')](function(_0x441e64){_0x525cd0[_0x82af('0x45')]=_0x441e64;return _0x525cd0;})[_0x82af('0x26')](respondWithFilteredResult(_0x1158ab,_0x2708c5))['catch'](handleError(_0x1158ab,null));};exports[_0x82af('0x46')]=function(_0x9b112b,_0x23b1f5){var _0x21cecf={'raw':![],'where':{'id':_0x9b112b[_0x82af('0x47')]['id']}},_0x29a1fa={};_0x29a1fa[_0x82af('0x34')]=_[_0x82af('0x30')](db[_0x82af('0x41')]['rawAttributes']);_0x29a1fa[_0x82af('0x2f')]=_['keys'](_0x9b112b[_0x82af('0x2f')]);_0x29a1fa[_0x82af('0x31')]=_['intersection'](_0x29a1fa[_0x82af('0x34')],_0x29a1fa[_0x82af('0x2f')]);_0x21cecf['attributes']=_[_0x82af('0x32')](_0x29a1fa[_0x82af('0x34')],qs['fields'](_0x9b112b['query'][_0x82af('0x35')]));_0x21cecf[_0x82af('0x33')]=_0x21cecf[_0x82af('0x33')][_0x82af('0x36')]?_0x21cecf['attributes']:_0x29a1fa[_0x82af('0x34')];if(_0x9b112b[_0x82af('0x2f')][_0x82af('0x42')]){_0x21cecf[_0x82af('0x43')]=[{'all':!![]}];}_0x21cecf=_[_0x82af('0x3e')]({},_0x21cecf,_0x9b112b['options']);return db[_0x82af('0x41')][_0x82af('0x48')](_0x21cecf)[_0x82af('0x26')](handleEntityNotFound(_0x23b1f5,null))['then'](respondWithResult(_0x23b1f5,null))[_0x82af('0x49')](handleError(_0x23b1f5,null));};exports[_0x82af('0x4a')]=function(_0x36f56b,_0x4764ff){return db[_0x82af('0x41')][_0x82af('0x4a')](_0x36f56b[_0x82af('0x4b')],{})[_0x82af('0x26')](respondWithResult(_0x4764ff,0xc9))['catch'](handleError(_0x4764ff,null));};exports[_0x82af('0x4c')]=function(_0x55e55a,_0x336657){if(_0x55e55a[_0x82af('0x4b')]['id']){delete _0x55e55a[_0x82af('0x4b')]['id'];}return db[_0x82af('0x41')][_0x82af('0x48')]({'where':{'id':_0x55e55a['params']['id']}})[_0x82af('0x26')](handleEntityNotFound(_0x336657,null))[_0x82af('0x26')](saveUpdates(_0x55e55a['body'],null))[_0x82af('0x26')](respondWithResult(_0x336657,null))[_0x82af('0x49')](handleError(_0x336657,null));};exports[_0x82af('0x25')]=function(_0x59907e,_0x1d9614){return db[_0x82af('0x41')][_0x82af('0x48')]({'where':{'id':_0x59907e['params']['id']}})[_0x82af('0x26')](handleEntityNotFound(_0x1d9614,null))[_0x82af('0x26')](removeEntity(_0x1d9614,null))[_0x82af('0x49')](handleError(_0x1d9614,null));};exports[_0x82af('0x4d')]=function(_0x18b2bb,_0x2f3fbd,_0x19824e){var _0x587d6e={};var _0x329c46={};var _0xe943f6;var _0x34dbfe;return db[_0x82af('0x41')][_0x82af('0x4e')]({'where':{'id':_0x18b2bb[_0x82af('0x47')]['id']}})[_0x82af('0x26')](handleEntityNotFound(_0x2f3fbd,null))[_0x82af('0x26')](function(_0x4276ad){if(_0x4276ad){_0xe943f6=_0x4276ad;_0x329c46[_0x82af('0x34')]=_[_0x82af('0x30')](db['ServicenowField'][_0x82af('0x2b')]);_0x329c46[_0x82af('0x2f')]=_[_0x82af('0x30')](_0x18b2bb[_0x82af('0x2f')]);_0x329c46[_0x82af('0x31')]=_[_0x82af('0x32')](_0x329c46[_0x82af('0x34')],_0x329c46['query']);_0x587d6e[_0x82af('0x33')]=_[_0x82af('0x32')](_0x329c46[_0x82af('0x34')],qs['fields'](_0x18b2bb['query'][_0x82af('0x35')]));_0x587d6e['attributes']=_0x587d6e[_0x82af('0x33')][_0x82af('0x36')]?_0x587d6e['attributes']:_0x329c46[_0x82af('0x34')];_0x587d6e[_0x82af('0x4f')]=qs[_0x82af('0x3a')](_0x18b2bb['query']['sort']);_0x587d6e[_0x82af('0x3d')]=qs[_0x82af('0x31')](_[_0x82af('0x3b')](_0x18b2bb[_0x82af('0x2f')],_0x329c46[_0x82af('0x31')]));if(_0x18b2bb[_0x82af('0x2f')]['filter']){_0x587d6e[_0x82af('0x3d')]=_[_0x82af('0x3e')](_0x587d6e[_0x82af('0x3d')],{'$or':_[_0x82af('0x2a')](_0x587d6e[_0x82af('0x33')],function(_0x44434a){var _0x413a1e={};_0x413a1e[_0x44434a]={'$like':'%'+_0x18b2bb[_0x82af('0x2f')][_0x82af('0x3c')]+'%'};return _0x413a1e;})});}_0x587d6e=_[_0x82af('0x3e')]({},_0x587d6e,_0x18b2bb[_0x82af('0x40')]);return _0xe943f6[_0x82af('0x4d')](_0x587d6e);}})['then'](function(_0xa10e6a){if(_0xa10e6a){_0x34dbfe=_0xa10e6a['length'];if(!_0x18b2bb['query'][_0x82af('0x37')]('nolimit')){_0x587d6e[_0x82af('0x1f')]=qs['limit'](_0x18b2bb[_0x82af('0x2f')]['limit']);_0x587d6e[_0x82af('0x39')]=qs[_0x82af('0x39')](_0x18b2bb[_0x82af('0x2f')][_0x82af('0x39')]);}return _0xe943f6[_0x82af('0x4d')](_0x587d6e);}})[_0x82af('0x26')](function(_0x5b5aaa){if(_0x5b5aaa){return _0x5b5aaa?{'count':_0x34dbfe,'rows':_0x5b5aaa}:null;}})['then'](respondWithResult(_0x2f3fbd,null))[_0x82af('0x49')](handleError(_0x2f3fbd,null));};exports[_0x82af('0x50')]=function(_0x44d5cc,_0x5b72e4,_0x191c6e){var _0x6019ea={};var _0xb36a8e={};var _0x4b5f0a;var _0x4456e0;return db['ServicenowConfiguration'][_0x82af('0x4e')]({'where':{'id':_0x44d5cc[_0x82af('0x47')]['id']}})[_0x82af('0x26')](handleEntityNotFound(_0x5b72e4,null))[_0x82af('0x26')](function(_0x5db59c){if(_0x5db59c){_0x4b5f0a=_0x5db59c;_0xb36a8e['model']=_['keys'](db[_0x82af('0x51')][_0x82af('0x2b')]);_0xb36a8e[_0x82af('0x2f')]=_[_0x82af('0x30')](_0x44d5cc[_0x82af('0x2f')]);_0xb36a8e['filters']=_['intersection'](_0xb36a8e[_0x82af('0x34')],_0xb36a8e['query']);_0x6019ea[_0x82af('0x33')]=_['intersection'](_0xb36a8e['model'],qs[_0x82af('0x35')](_0x44d5cc[_0x82af('0x2f')][_0x82af('0x35')]));_0x6019ea[_0x82af('0x33')]=_0x6019ea['attributes'][_0x82af('0x36')]?_0x6019ea[_0x82af('0x33')]:_0xb36a8e[_0x82af('0x34')];_0x6019ea[_0x82af('0x4f')]=qs[_0x82af('0x3a')](_0x44d5cc['query'][_0x82af('0x3a')]);_0x6019ea[_0x82af('0x3d')]=qs['filters'](_['pick'](_0x44d5cc['query'],_0xb36a8e[_0x82af('0x31')]));if(_0x44d5cc[_0x82af('0x2f')][_0x82af('0x3c')]){_0x6019ea[_0x82af('0x3d')]=_[_0x82af('0x3e')](_0x6019ea[_0x82af('0x3d')],{'$or':_[_0x82af('0x2a')](_0x6019ea[_0x82af('0x33')],function(_0x9457ac){var _0x3c6a9b={};_0x3c6a9b[_0x9457ac]={'$like':'%'+_0x44d5cc['query'][_0x82af('0x3c')]+'%'};return _0x3c6a9b;})});}_0x6019ea=_[_0x82af('0x3e')]({},_0x6019ea,_0x44d5cc[_0x82af('0x40')]);return _0x4b5f0a[_0x82af('0x50')](_0x6019ea);}})['then'](function(_0x22627f){if(_0x22627f){_0x4456e0=_0x22627f['length'];if(!_0x44d5cc[_0x82af('0x2f')]['hasOwnProperty'](_0x82af('0x38'))){_0x6019ea[_0x82af('0x1f')]=qs['limit'](_0x44d5cc[_0x82af('0x2f')]['limit']);_0x6019ea[_0x82af('0x39')]=qs[_0x82af('0x39')](_0x44d5cc[_0x82af('0x2f')][_0x82af('0x39')]);}return _0x4b5f0a[_0x82af('0x50')](_0x6019ea);}})[_0x82af('0x26')](function(_0x2aa437){if(_0x2aa437){return _0x2aa437?{'count':_0x4456e0,'rows':_0x2aa437}:null;}})[_0x82af('0x26')](respondWithResult(_0x5b72e4,null))[_0x82af('0x49')](handleError(_0x5b72e4,null));};exports['getDescriptions']=function(_0x52180f,_0x318314,_0x4c32ca){var _0x5cd0ed={};var _0x28f902={};var _0x391d82;var _0x3ba1e9;return db[_0x82af('0x41')]['findOne']({'where':{'id':_0x52180f['params']['id']}})[_0x82af('0x26')](handleEntityNotFound(_0x318314,null))[_0x82af('0x26')](function(_0x4b3e66){if(_0x4b3e66){_0x391d82=_0x4b3e66;_0x28f902[_0x82af('0x34')]=_['keys'](db[_0x82af('0x51')][_0x82af('0x2b')]);_0x28f902[_0x82af('0x2f')]=_[_0x82af('0x30')](_0x52180f[_0x82af('0x2f')]);_0x28f902[_0x82af('0x31')]=_[_0x82af('0x32')](_0x28f902[_0x82af('0x34')],_0x28f902[_0x82af('0x2f')]);_0x5cd0ed[_0x82af('0x33')]=_[_0x82af('0x32')](_0x28f902[_0x82af('0x34')],qs[_0x82af('0x35')](_0x52180f[_0x82af('0x2f')][_0x82af('0x35')]));_0x5cd0ed[_0x82af('0x33')]=_0x5cd0ed[_0x82af('0x33')][_0x82af('0x36')]?_0x5cd0ed[_0x82af('0x33')]:_0x28f902[_0x82af('0x34')];_0x5cd0ed[_0x82af('0x4f')]=qs[_0x82af('0x3a')](_0x52180f[_0x82af('0x2f')][_0x82af('0x3a')]);_0x5cd0ed[_0x82af('0x3d')]=qs[_0x82af('0x31')](_['pick'](_0x52180f['query'],_0x28f902[_0x82af('0x31')]));if(_0x52180f[_0x82af('0x2f')][_0x82af('0x3c')]){_0x5cd0ed[_0x82af('0x3d')]=_[_0x82af('0x3e')](_0x5cd0ed[_0x82af('0x3d')],{'$or':_[_0x82af('0x2a')](_0x5cd0ed[_0x82af('0x33')],function(_0x2c492d){var _0x152c85={};_0x152c85[_0x2c492d]={'$like':'%'+_0x52180f[_0x82af('0x2f')][_0x82af('0x3c')]+'%'};return _0x152c85;})});}_0x5cd0ed=_[_0x82af('0x3e')]({},_0x5cd0ed,_0x52180f['options']);return _0x391d82[_0x82af('0x52')](_0x5cd0ed);}})[_0x82af('0x26')](function(_0x27b24a){if(_0x27b24a){_0x3ba1e9=_0x27b24a[_0x82af('0x36')];if(!_0x52180f['query']['hasOwnProperty'](_0x82af('0x38'))){_0x5cd0ed[_0x82af('0x1f')]=qs['limit'](_0x52180f[_0x82af('0x2f')][_0x82af('0x1f')]);_0x5cd0ed['offset']=qs['offset'](_0x52180f['query'][_0x82af('0x39')]);}return _0x391d82[_0x82af('0x52')](_0x5cd0ed);}})[_0x82af('0x26')](function(_0x4ec519){if(_0x4ec519){return _0x4ec519?{'count':_0x3ba1e9,'rows':_0x4ec519}:null;}})['then'](respondWithResult(_0x318314,null))[_0x82af('0x49')](handleError(_0x318314,null));};
\ No newline at end of file
+var _0x2745=['count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','find','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','pick','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit'];(function(_0x5406c6,_0x15cec7){var _0x28ac78=function(_0xbd2b1e){while(--_0xbd2b1e){_0x5406c6['push'](_0x5406c6['shift']());}};_0x28ac78(++_0x15cec7);}(_0x2745,0xd7));var _0x5274=function(_0x2dcc49,_0x553aff){_0x2dcc49=_0x2dcc49-0x0;var _0x2a7b1e=_0x2745[_0x2dcc49];return _0x2a7b1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5274('0x0'));var jsonpatch=require(_0x5274('0x1'));var rp=require(_0x5274('0x2'));var moment=require(_0x5274('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5274('0x4'));var util=require(_0x5274('0x5'));var path=require(_0x5274('0x6'));var sox=require(_0x5274('0x7'));var csv=require(_0x5274('0x8'));var ejs=require(_0x5274('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5274('0xa'));var squel=require(_0x5274('0xb'));var crypto=require(_0x5274('0xc'));var jsforce=require(_0x5274('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5274('0xe'));var Redis=require('ioredis');var authService=require(_0x5274('0xf'));var qs=require(_0x5274('0x10'));var as=require(_0x5274('0x11'));var hardwareService=require(_0x5274('0x12'));var logger=require(_0x5274('0x13'))(_0x5274('0x14'));var utils=require(_0x5274('0x15'));var config=require(_0x5274('0x16'));var licenseUtil=require(_0x5274('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27c0c6,_0x4c1924){_0x4c1924=_0x4c1924||0xcc;return function(_0x4c3a4f){if(_0x4c3a4f){return _0x27c0c6['sendStatus'](_0x4c1924);}return _0x27c0c6[_0x5274('0x18')](_0x4c1924)['end']();};}function respondWithResult(_0x1725f5,_0x5a8458){_0x5a8458=_0x5a8458||0xc8;return function(_0x45b693){if(_0x45b693){return _0x1725f5['status'](_0x5a8458)['json'](_0x45b693);}};}function respondWithFilteredResult(_0x1e1b28,_0x4b8173){return function(_0x4de506){if(_0x4de506){var _0x560b6c=typeof _0x4b8173[_0x5274('0x19')]===_0x5274('0x1a')&&typeof _0x4b8173[_0x5274('0x1b')]===_0x5274('0x1a');var _0xc4040f=_0x4de506[_0x5274('0x1c')];var _0x308a27=_0x560b6c?0x0:_0x4b8173['offset'];var _0x801109=_0x560b6c?_0x4de506['count']:_0x4b8173[_0x5274('0x19')]+_0x4b8173[_0x5274('0x1b')];var _0x26a0df;if(_0x801109>=_0xc4040f){_0x801109=_0xc4040f;_0x26a0df=0xc8;}else{_0x26a0df=0xce;}_0x1e1b28['status'](_0x26a0df);return _0x1e1b28['set'](_0x5274('0x1d'),_0x308a27+'-'+_0x801109+'/'+_0xc4040f)[_0x5274('0x1e')](_0x4de506);}return null;};}function patchUpdates(_0x12f1a3){return function(_0x56e2fb){try{jsonpatch[_0x5274('0x1f')](_0x56e2fb,_0x12f1a3,!![]);}catch(_0x2d7e86){return BPromise[_0x5274('0x20')](_0x2d7e86);}return _0x56e2fb[_0x5274('0x21')]();};}function saveUpdates(_0x347fba,_0xc369cc){return function(_0x3b1cf5){if(_0x3b1cf5){return _0x3b1cf5[_0x5274('0x22')](_0x347fba)[_0x5274('0x23')](function(_0x41efad){return _0x41efad;});}return null;};}function removeEntity(_0x7ba0ad,_0x5a5fab){return function(_0x3f9fd8){if(_0x3f9fd8){return _0x3f9fd8[_0x5274('0x24')]()[_0x5274('0x23')](function(){_0x7ba0ad[_0x5274('0x18')](0xcc)[_0x5274('0x25')]();});}};}function handleEntityNotFound(_0x10d46a,_0x2a446a){return function(_0x5ccc56){if(!_0x5ccc56){_0x10d46a[_0x5274('0x26')](0x194);}return _0x5ccc56;};}function handleError(_0xb5e2f9,_0x3bcc42){_0x3bcc42=_0x3bcc42||0x1f4;return function(_0x2be19d){logger['error'](_0x2be19d[_0x5274('0x27')]);if(_0x2be19d[_0x5274('0x28')]){delete _0x2be19d['name'];}_0xb5e2f9['status'](_0x3bcc42)[_0x5274('0x29')](_0x2be19d);};}exports[_0x5274('0x2a')]=function(_0x4a8d5e,_0x1ee8c8){var _0x3ca3a6={},_0x23af48={},_0x17f81d={'count':0x0,'rows':[]};var _0x5d204e=_[_0x5274('0x2b')](db[_0x5274('0x2c')][_0x5274('0x2d')],function(_0x2a5a4d){return{'name':_0x2a5a4d[_0x5274('0x2e')],'type':_0x2a5a4d['type'][_0x5274('0x2f')]};});_0x23af48[_0x5274('0x30')]=_[_0x5274('0x2b')](_0x5d204e,'name');_0x23af48[_0x5274('0x31')]=_[_0x5274('0x32')](_0x4a8d5e['query']);_0x23af48['filters']=_[_0x5274('0x33')](_0x23af48[_0x5274('0x30')],_0x23af48['query']);_0x3ca3a6['attributes']=_[_0x5274('0x33')](_0x23af48['model'],qs['fields'](_0x4a8d5e[_0x5274('0x31')][_0x5274('0x34')]));_0x3ca3a6[_0x5274('0x35')]=_0x3ca3a6[_0x5274('0x35')][_0x5274('0x36')]?_0x3ca3a6[_0x5274('0x35')]:_0x23af48['model'];if(!_0x4a8d5e[_0x5274('0x31')]['hasOwnProperty'](_0x5274('0x37'))){_0x3ca3a6[_0x5274('0x1b')]=qs[_0x5274('0x1b')](_0x4a8d5e[_0x5274('0x31')][_0x5274('0x1b')]);_0x3ca3a6[_0x5274('0x19')]=qs['offset'](_0x4a8d5e[_0x5274('0x31')][_0x5274('0x19')]);}_0x3ca3a6[_0x5274('0x38')]=qs[_0x5274('0x39')](_0x4a8d5e[_0x5274('0x31')][_0x5274('0x39')]);_0x3ca3a6[_0x5274('0x3a')]=qs['filters'](_['pick'](_0x4a8d5e[_0x5274('0x31')],_0x23af48[_0x5274('0x3b')]),_0x5d204e);if(_0x4a8d5e[_0x5274('0x31')][_0x5274('0x3c')]){_0x3ca3a6[_0x5274('0x3a')]=_[_0x5274('0x3d')](_0x3ca3a6[_0x5274('0x3a')],{'$or':_[_0x5274('0x2b')](_0x5d204e,function(_0x1ad045){if(_0x1ad045[_0x5274('0x3e')]!==_0x5274('0x3f')){var _0x24ad00={};_0x24ad00[_0x1ad045[_0x5274('0x28')]]={'$like':'%'+_0x4a8d5e[_0x5274('0x31')][_0x5274('0x3c')]+'%'};return _0x24ad00;}})});}_0x3ca3a6=_[_0x5274('0x3d')]({},_0x3ca3a6,_0x4a8d5e[_0x5274('0x40')]);var _0x4a0d5c={'where':_0x3ca3a6['where']};return db[_0x5274('0x2c')][_0x5274('0x1c')](_0x4a0d5c)[_0x5274('0x23')](function(_0x1ecc5c){_0x17f81d[_0x5274('0x1c')]=_0x1ecc5c;if(_0x4a8d5e['query'][_0x5274('0x41')]){_0x3ca3a6[_0x5274('0x42')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5274('0x43')](_0x3ca3a6);})[_0x5274('0x23')](function(_0x59befa){_0x17f81d[_0x5274('0x44')]=_0x59befa;return _0x17f81d;})[_0x5274('0x23')](respondWithFilteredResult(_0x1ee8c8,_0x3ca3a6))['catch'](handleError(_0x1ee8c8,null));};exports['show']=function(_0x42a472,_0x44d25e){var _0x54c337={'raw':![],'where':{'id':_0x42a472[_0x5274('0x45')]['id']}},_0x438cbe={};_0x438cbe['model']=_[_0x5274('0x32')](db['ServicenowConfiguration'][_0x5274('0x2d')]);_0x438cbe[_0x5274('0x31')]=_[_0x5274('0x32')](_0x42a472[_0x5274('0x31')]);_0x438cbe[_0x5274('0x3b')]=_[_0x5274('0x33')](_0x438cbe['model'],_0x438cbe[_0x5274('0x31')]);_0x54c337[_0x5274('0x35')]=_[_0x5274('0x33')](_0x438cbe[_0x5274('0x30')],qs['fields'](_0x42a472[_0x5274('0x31')][_0x5274('0x34')]));_0x54c337[_0x5274('0x35')]=_0x54c337['attributes'][_0x5274('0x36')]?_0x54c337[_0x5274('0x35')]:_0x438cbe[_0x5274('0x30')];if(_0x42a472[_0x5274('0x31')][_0x5274('0x41')]){_0x54c337[_0x5274('0x42')]=[{'all':!![]}];}_0x54c337=_[_0x5274('0x3d')]({},_0x54c337,_0x42a472[_0x5274('0x40')]);return db[_0x5274('0x2c')]['find'](_0x54c337)[_0x5274('0x23')](handleEntityNotFound(_0x44d25e,null))[_0x5274('0x23')](respondWithResult(_0x44d25e,null))[_0x5274('0x46')](handleError(_0x44d25e,null));};exports[_0x5274('0x47')]=function(_0x1d7a05,_0x596542){return db[_0x5274('0x2c')][_0x5274('0x47')](_0x1d7a05[_0x5274('0x48')],{})[_0x5274('0x23')](respondWithResult(_0x596542,0xc9))['catch'](handleError(_0x596542,null));};exports[_0x5274('0x22')]=function(_0x296d99,_0xe43a88){if(_0x296d99['body']['id']){delete _0x296d99['body']['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x296d99[_0x5274('0x45')]['id']}})['then'](handleEntityNotFound(_0xe43a88,null))['then'](saveUpdates(_0x296d99[_0x5274('0x48')],null))[_0x5274('0x23')](respondWithResult(_0xe43a88,null))[_0x5274('0x46')](handleError(_0xe43a88,null));};exports[_0x5274('0x24')]=function(_0x539218,_0x261f97){return db[_0x5274('0x2c')][_0x5274('0x49')]({'where':{'id':_0x539218['params']['id']}})[_0x5274('0x23')](handleEntityNotFound(_0x261f97,null))[_0x5274('0x23')](removeEntity(_0x261f97,null))[_0x5274('0x46')](handleError(_0x261f97,null));};exports[_0x5274('0x4a')]=function(_0x4dad3d,_0x2a1080,_0x2d441d){var _0x3a20b0={};var _0x4c9765={};var _0x262587;var _0x1ccb2d;return db[_0x5274('0x2c')][_0x5274('0x4b')]({'where':{'id':_0x4dad3d[_0x5274('0x45')]['id']}})[_0x5274('0x23')](handleEntityNotFound(_0x2a1080,null))['then'](function(_0x1aa019){if(_0x1aa019){_0x262587=_0x1aa019;_0x4c9765['model']=_['keys'](db[_0x5274('0x4c')]['rawAttributes']);_0x4c9765[_0x5274('0x31')]=_[_0x5274('0x32')](_0x4dad3d[_0x5274('0x31')]);_0x4c9765[_0x5274('0x3b')]=_[_0x5274('0x33')](_0x4c9765[_0x5274('0x30')],_0x4c9765['query']);_0x3a20b0['attributes']=_[_0x5274('0x33')](_0x4c9765[_0x5274('0x30')],qs['fields'](_0x4dad3d[_0x5274('0x31')][_0x5274('0x34')]));_0x3a20b0['attributes']=_0x3a20b0['attributes'][_0x5274('0x36')]?_0x3a20b0[_0x5274('0x35')]:_0x4c9765[_0x5274('0x30')];_0x3a20b0[_0x5274('0x38')]=qs[_0x5274('0x39')](_0x4dad3d[_0x5274('0x31')][_0x5274('0x39')]);_0x3a20b0[_0x5274('0x3a')]=qs[_0x5274('0x3b')](_['pick'](_0x4dad3d[_0x5274('0x31')],_0x4c9765[_0x5274('0x3b')]));if(_0x4dad3d[_0x5274('0x31')][_0x5274('0x3c')]){_0x3a20b0[_0x5274('0x3a')]=_[_0x5274('0x3d')](_0x3a20b0[_0x5274('0x3a')],{'$or':_[_0x5274('0x2b')](_0x3a20b0[_0x5274('0x35')],function(_0x5b7875){var _0x1d483b={};_0x1d483b[_0x5b7875]={'$like':'%'+_0x4dad3d['query'][_0x5274('0x3c')]+'%'};return _0x1d483b;})});}_0x3a20b0=_['merge']({},_0x3a20b0,_0x4dad3d[_0x5274('0x40')]);return _0x262587[_0x5274('0x4a')](_0x3a20b0);}})[_0x5274('0x23')](function(_0x5e1fc8){if(_0x5e1fc8){_0x1ccb2d=_0x5e1fc8[_0x5274('0x36')];if(!_0x4dad3d[_0x5274('0x31')][_0x5274('0x4d')](_0x5274('0x37'))){_0x3a20b0[_0x5274('0x1b')]=qs[_0x5274('0x1b')](_0x4dad3d[_0x5274('0x31')][_0x5274('0x1b')]);_0x3a20b0[_0x5274('0x19')]=qs[_0x5274('0x19')](_0x4dad3d[_0x5274('0x31')][_0x5274('0x19')]);}return _0x262587[_0x5274('0x4a')](_0x3a20b0);}})[_0x5274('0x23')](function(_0x5dc912){if(_0x5dc912){return _0x5dc912?{'count':_0x1ccb2d,'rows':_0x5dc912}:null;}})[_0x5274('0x23')](respondWithResult(_0x2a1080,null))[_0x5274('0x46')](handleError(_0x2a1080,null));};exports['getSubjects']=function(_0x22b20b,_0x3c44cd,_0x56ffe9){var _0x5427ea={};var _0x18ef06={};var _0x12b2b8;var _0x5ac785;return db[_0x5274('0x2c')][_0x5274('0x4b')]({'where':{'id':_0x22b20b[_0x5274('0x45')]['id']}})[_0x5274('0x23')](handleEntityNotFound(_0x3c44cd,null))[_0x5274('0x23')](function(_0x3a0c42){if(_0x3a0c42){_0x12b2b8=_0x3a0c42;_0x18ef06[_0x5274('0x30')]=_['keys'](db[_0x5274('0x4c')]['rawAttributes']);_0x18ef06[_0x5274('0x31')]=_['keys'](_0x22b20b[_0x5274('0x31')]);_0x18ef06['filters']=_['intersection'](_0x18ef06[_0x5274('0x30')],_0x18ef06[_0x5274('0x31')]);_0x5427ea['attributes']=_[_0x5274('0x33')](_0x18ef06[_0x5274('0x30')],qs['fields'](_0x22b20b[_0x5274('0x31')][_0x5274('0x34')]));_0x5427ea[_0x5274('0x35')]=_0x5427ea[_0x5274('0x35')][_0x5274('0x36')]?_0x5427ea[_0x5274('0x35')]:_0x18ef06[_0x5274('0x30')];_0x5427ea[_0x5274('0x38')]=qs[_0x5274('0x39')](_0x22b20b[_0x5274('0x31')]['sort']);_0x5427ea[_0x5274('0x3a')]=qs[_0x5274('0x3b')](_['pick'](_0x22b20b[_0x5274('0x31')],_0x18ef06['filters']));if(_0x22b20b[_0x5274('0x31')][_0x5274('0x3c')]){_0x5427ea['where']=_[_0x5274('0x3d')](_0x5427ea[_0x5274('0x3a')],{'$or':_[_0x5274('0x2b')](_0x5427ea[_0x5274('0x35')],function(_0x4a6d31){var _0x4124bd={};_0x4124bd[_0x4a6d31]={'$like':'%'+_0x22b20b[_0x5274('0x31')]['filter']+'%'};return _0x4124bd;})});}_0x5427ea=_[_0x5274('0x3d')]({},_0x5427ea,_0x22b20b[_0x5274('0x40')]);return _0x12b2b8['getSubjects'](_0x5427ea);}})[_0x5274('0x23')](function(_0x1bea9b){if(_0x1bea9b){_0x5ac785=_0x1bea9b[_0x5274('0x36')];if(!_0x22b20b[_0x5274('0x31')][_0x5274('0x4d')](_0x5274('0x37'))){_0x5427ea[_0x5274('0x1b')]=qs['limit'](_0x22b20b[_0x5274('0x31')][_0x5274('0x1b')]);_0x5427ea['offset']=qs[_0x5274('0x19')](_0x22b20b['query'][_0x5274('0x19')]);}return _0x12b2b8[_0x5274('0x4e')](_0x5427ea);}})[_0x5274('0x23')](function(_0x4ea290){if(_0x4ea290){return _0x4ea290?{'count':_0x5ac785,'rows':_0x4ea290}:null;}})[_0x5274('0x23')](respondWithResult(_0x3c44cd,null))[_0x5274('0x46')](handleError(_0x3c44cd,null));};exports[_0x5274('0x4f')]=function(_0xff4153,_0x2a64f6,_0x2942bc){var _0x27e2b5={};var _0x4af8ea={};var _0xf64392;var _0x2aa8b8;return db[_0x5274('0x2c')][_0x5274('0x4b')]({'where':{'id':_0xff4153[_0x5274('0x45')]['id']}})[_0x5274('0x23')](handleEntityNotFound(_0x2a64f6,null))[_0x5274('0x23')](function(_0x570c5e){if(_0x570c5e){_0xf64392=_0x570c5e;_0x4af8ea[_0x5274('0x30')]=_[_0x5274('0x32')](db[_0x5274('0x4c')][_0x5274('0x2d')]);_0x4af8ea['query']=_[_0x5274('0x32')](_0xff4153[_0x5274('0x31')]);_0x4af8ea[_0x5274('0x3b')]=_[_0x5274('0x33')](_0x4af8ea[_0x5274('0x30')],_0x4af8ea[_0x5274('0x31')]);_0x27e2b5[_0x5274('0x35')]=_[_0x5274('0x33')](_0x4af8ea['model'],qs[_0x5274('0x34')](_0xff4153['query'][_0x5274('0x34')]));_0x27e2b5[_0x5274('0x35')]=_0x27e2b5[_0x5274('0x35')][_0x5274('0x36')]?_0x27e2b5[_0x5274('0x35')]:_0x4af8ea[_0x5274('0x30')];_0x27e2b5[_0x5274('0x38')]=qs['sort'](_0xff4153['query'][_0x5274('0x39')]);_0x27e2b5[_0x5274('0x3a')]=qs[_0x5274('0x3b')](_[_0x5274('0x50')](_0xff4153['query'],_0x4af8ea['filters']));if(_0xff4153[_0x5274('0x31')][_0x5274('0x3c')]){_0x27e2b5[_0x5274('0x3a')]=_[_0x5274('0x3d')](_0x27e2b5[_0x5274('0x3a')],{'$or':_[_0x5274('0x2b')](_0x27e2b5[_0x5274('0x35')],function(_0x376b45){var _0x45870f={};_0x45870f[_0x376b45]={'$like':'%'+_0xff4153[_0x5274('0x31')][_0x5274('0x3c')]+'%'};return _0x45870f;})});}_0x27e2b5=_[_0x5274('0x3d')]({},_0x27e2b5,_0xff4153[_0x5274('0x40')]);return _0xf64392['getDescriptions'](_0x27e2b5);}})['then'](function(_0x295ebe){if(_0x295ebe){_0x2aa8b8=_0x295ebe[_0x5274('0x36')];if(!_0xff4153[_0x5274('0x31')][_0x5274('0x4d')]('nolimit')){_0x27e2b5[_0x5274('0x1b')]=qs[_0x5274('0x1b')](_0xff4153[_0x5274('0x31')][_0x5274('0x1b')]);_0x27e2b5['offset']=qs['offset'](_0xff4153[_0x5274('0x31')][_0x5274('0x19')]);}return _0xf64392[_0x5274('0x4f')](_0x27e2b5);}})[_0x5274('0x23')](function(_0x2e35d7){if(_0x2e35d7){return _0x2e35d7?{'count':_0x2aa8b8,'rows':_0x2e35d7}:null;}})[_0x5274('0x23')](respondWithResult(_0x2a64f6,null))[_0x5274('0x46')](handleError(_0x2a64f6,null));};
\ No newline at end of file
index b185d69..5636391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['lodash','util','api','moment','request-promise','rimraf','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0xa249,0x183));var _0x9a24=function(_0x401da4,_0xdb050d){_0x401da4=_0x401da4-0x0;var _0x3369d0=_0xa249[_0x401da4];return _0x3369d0;};'use strict';var _=require(_0x9a24('0x0'));var util=require(_0x9a24('0x1'));var logger=require('../../config/logger')(_0x9a24('0x2'));var moment=require(_0x9a24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a24('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a24('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x1b0728,_0x167980){return _0x1b0728[_0x9a24('0x6')](_0x9a24('0x7'),attributes,{'tableName':_0x9a24('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x1f4ff2,_0x4f1b55){_0x1f4ff2=_0x1f4ff2-0x0;var _0x2b0595=_0xd4f4[_0x1f4ff2];return _0x2b0595;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 920a17e..afc6f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95fe=['randomstring','ioredis','../../config/logger','../../config/environment','client','http','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment'];(function(_0x36042b,_0x58860e){var _0x557945=function(_0x6213a2){while(--_0x6213a2){_0x36042b['push'](_0x36042b['shift']());}};_0x557945(++_0x58860e);}(_0x95fe,0x154));var _0xe95f=function(_0x1c25c7,_0x335fab){_0x1c25c7=_0x1c25c7-0x0;var _0x5e0173=_0x95fe[_0x1c25c7];return _0x5e0173;};'use strict';var _=require('lodash');var util=require(_0xe95f('0x0'));var moment=require(_0xe95f('0x1'));var BPromise=require('bluebird');var rs=require(_0xe95f('0x2'));var fs=require('fs');var Redis=require(_0xe95f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe95f('0x4'))('rpc');var config=require(_0xe95f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe95f('0x6')][_0xe95f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f709b,_0x571d5c,_0x2123a4){return new BPromise(function(_0x81b820,_0x502426){return client['request'](_0x1f709b,_0x2123a4)['then'](function(_0x247b3d){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x571d5c,_0xe95f('0x8'));logger[_0xe95f('0x9')](_0xe95f('0xa'),_0x571d5c,_0xe95f('0x8'),JSON[_0xe95f('0xb')](_0x247b3d));if(_0x247b3d[_0xe95f('0xc')]){if(_0x247b3d['error'][_0xe95f('0xd')]===0x1f4){logger[_0xe95f('0xc')](_0xe95f('0xe'),_0x571d5c,_0x247b3d[_0xe95f('0xc')][_0xe95f('0xf')]);return _0x502426(_0x247b3d[_0xe95f('0xc')][_0xe95f('0xf')]);}logger['error'](_0xe95f('0xe'),_0x571d5c,_0x247b3d[_0xe95f('0xc')][_0xe95f('0xf')]);return _0x81b820(_0x247b3d[_0xe95f('0xc')][_0xe95f('0xf')]);}else{logger[_0xe95f('0x10')](_0xe95f('0xe'),_0x571d5c,'request\x20sent');_0x81b820(_0x247b3d[_0xe95f('0x11')][_0xe95f('0xf')]);}})[_0xe95f('0x12')](function(_0xfa05dc){logger[_0xe95f('0xc')](_0xe95f('0xe'),_0x571d5c,_0xfa05dc);_0x502426(_0xfa05dc);});});}
\ No newline at end of file
+var _0x55f9=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x55f9,0x1b8));var _0x955f=function(_0x587f63,_0xb2b10b){_0x587f63=_0x587f63-0x0;var _0x948251=_0x55f9[_0x587f63];return _0x948251;};'use strict';var _=require(_0x955f('0x0'));var util=require(_0x955f('0x1'));var moment=require(_0x955f('0x2'));var BPromise=require(_0x955f('0x3'));var rs=require(_0x955f('0x4'));var fs=require('fs');var Redis=require(_0x955f('0x5'));var db=require(_0x955f('0x6'))['db'];var utils=require(_0x955f('0x7'));var logger=require(_0x955f('0x8'))(_0x955f('0x9'));var config=require(_0x955f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x955f('0xb')][_0x955f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53ed29,_0x44db0a,_0x389c02){return new BPromise(function(_0x97682e,_0x3db55f){return client['request'](_0x53ed29,_0x389c02)[_0x955f('0xd')](function(_0x2abc2b){logger[_0x955f('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x44db0a,'request\x20sent');logger['debug'](_0x955f('0xf'),_0x44db0a,'request\x20sent',JSON['stringify'](_0x2abc2b));if(_0x2abc2b['error']){if(_0x2abc2b[_0x955f('0x10')][_0x955f('0x11')]===0x1f4){logger[_0x955f('0x10')](_0x955f('0x12'),_0x44db0a,_0x2abc2b[_0x955f('0x10')][_0x955f('0x13')]);return _0x3db55f(_0x2abc2b[_0x955f('0x10')]['message']);}logger['error'](_0x955f('0x12'),_0x44db0a,_0x2abc2b['error'][_0x955f('0x13')]);return _0x97682e(_0x2abc2b[_0x955f('0x10')][_0x955f('0x13')]);}else{logger[_0x955f('0xe')](_0x955f('0x12'),_0x44db0a,_0x955f('0x14'));_0x97682e(_0x2abc2b[_0x955f('0x15')][_0x955f('0x13')]);}})[_0x955f('0x16')](function(_0xb9e71){logger['error'](_0x955f('0x12'),_0x44db0a,_0xb9e71);_0x3db55f(_0xb9e71);});});}
\ No newline at end of file
index 0872a6b..4db6185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ae=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ae,0x1b3));var _0xe57a=function(_0x6b563e,_0x1895f4){_0x6b563e=_0x6b563e-0x0;var _0x90b348=_0x57ae[_0x6b563e];return _0x90b348;};'use strict';var multer=require(_0xe57a('0x0'));var util=require(_0xe57a('0x1'));var path=require(_0xe57a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe57a('0x3'));var router=express[_0xe57a('0x4')]();var fs_extra=require(_0xe57a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe57a('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0xe57a('0x7')]('/',auth[_0xe57a('0x8')](),controller['index']);router[_0xe57a('0x7')](_0xe57a('0x9'),auth[_0xe57a('0x8')](),controller[_0xe57a('0xa')]);router['post']('/',auth[_0xe57a('0x8')](),controller['create']);router[_0xe57a('0xb')](_0xe57a('0x9'),auth[_0xe57a('0x8')](),controller[_0xe57a('0xc')]);router[_0xe57a('0xd')]('/:id',auth[_0xe57a('0x8')](),controller[_0xe57a('0xe')]);module[_0xe57a('0xf')]=router;
\ No newline at end of file
+var _0x925e=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x31f364,_0x564cd6){var _0x2bacdc=function(_0x2d2b3a){while(--_0x2d2b3a){_0x31f364['push'](_0x31f364['shift']());}};_0x2bacdc(++_0x564cd6);}(_0x925e,0x1c5));var _0xe925=function(_0x4f0e97,_0x343fee){_0x4f0e97=_0x4f0e97-0x0;var _0x55297e=_0x925e[_0x4f0e97];return _0x55297e;};'use strict';var multer=require(_0xe925('0x0'));var util=require(_0xe925('0x1'));var path=require(_0xe925('0x2'));var timeout=require(_0xe925('0x3'));var express=require(_0xe925('0x4'));var router=express[_0xe925('0x5')]();var fs_extra=require(_0xe925('0x6'));var auth=require(_0xe925('0x7'));var interaction=require(_0xe925('0x8'));var config=require(_0xe925('0x9'));var controller=require('./intServicenowField.controller');router[_0xe925('0xa')]('/',auth[_0xe925('0xb')](),controller[_0xe925('0xc')]);router[_0xe925('0xa')](_0xe925('0xd'),auth[_0xe925('0xb')](),controller[_0xe925('0xe')]);router[_0xe925('0xf')]('/',auth['isAuthenticated'](),controller[_0xe925('0x10')]);router[_0xe925('0x11')]('/:id',auth[_0xe925('0xb')](),controller[_0xe925('0x12')]);router[_0xe925('0x13')](_0xe925('0xd'),auth['isAuthenticated'](),controller[_0xe925('0x14')]);module[_0xe925('0x15')]=router;
\ No newline at end of file
index 5756835..b07185b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9be=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0x2537cf,_0x207eb8){var _0x206495=function(_0x436f00){while(--_0x436f00){_0x2537cf['push'](_0x2537cf['shift']());}};_0x206495(++_0x207eb8);}(_0xf9be,0x126));var _0xef9b=function(_0x58ecb4,_0x2c03c4){_0x58ecb4=_0x58ecb4-0x0;var _0x4b2adc=_0xf9be[_0x58ecb4];return _0x4b2adc;};'use strict';var Sequelize=require(_0xef9b('0x0'));module[_0xef9b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xef9b('0x2'),_0xef9b('0x3'),_0xef9b('0x4'),_0xef9b('0x5')),'defaultValue':_0xef9b('0x6')},'content':{'type':Sequelize[_0xef9b('0x7')]},'key':{'type':Sequelize[_0xef9b('0x7')]},'keyType':{'type':Sequelize[_0xef9b('0x8')]('string',_0xef9b('0x2'),_0xef9b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xef9b('0x7')]},'nameField':{'type':Sequelize[_0xef9b('0x7')]},'customField':{'type':Sequelize[_0xef9b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef9b('0x7')]}};
\ No newline at end of file
+var _0xb403=['keyValue','picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x111832,_0x5b9113){var _0x667ea1=function(_0x2d19da){while(--_0x2d19da){_0x111832['push'](_0x111832['shift']());}};_0x667ea1(++_0x5b9113);}(_0xb403,0xba));var _0x3b40=function(_0x58a0bb,_0x3464b8){_0x58a0bb=_0x58a0bb-0x0;var _0x1f1146=_0xb403[_0x58a0bb];return _0x1f1146;};'use strict';var Sequelize=require(_0x3b40('0x0'));module[_0x3b40('0x1')]={'type':{'type':Sequelize[_0x3b40('0x2')](_0x3b40('0x3'),'variable','customVariable',_0x3b40('0x4'),_0x3b40('0x5')),'defaultValue':_0x3b40('0x3')},'content':{'type':Sequelize[_0x3b40('0x6')]},'key':{'type':Sequelize[_0x3b40('0x6')]},'keyType':{'type':Sequelize[_0x3b40('0x2')]('string',_0x3b40('0x7'),_0x3b40('0x8'))},'keyContent':{'type':Sequelize[_0x3b40('0x6')]},'idField':{'type':Sequelize[_0x3b40('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3b40('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b40('0x6')]}};
\ No newline at end of file
index b46fd2f..20aedb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e7a=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','ServicenowField','fieldName','type','key','query','filters','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','options','rows','catch','params','keys','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x215d98,_0x1a69cf){var _0x39c402=function(_0x12cb6a){while(--_0x12cb6a){_0x215d98['push'](_0x215d98['shift']());}};_0x39c402(++_0x1a69cf);}(_0x7e7a,0x76));var _0xa7e7=function(_0x4458a2,_0x288e43){_0x4458a2=_0x4458a2-0x0;var _0x52dc0e=_0x7e7a[_0x4458a2];return _0x52dc0e;};'use strict';var emlformat=require(_0xa7e7('0x0'));var rimraf=require(_0xa7e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7e7('0x2'));var rp=require(_0xa7e7('0x3'));var moment=require(_0xa7e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa7e7('0x5'));var util=require(_0xa7e7('0x6'));var path=require(_0xa7e7('0x7'));var sox=require(_0xa7e7('0x8'));var csv=require(_0xa7e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7e7('0xa'));var _=require(_0xa7e7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7e7('0x9'));var querystring=require(_0xa7e7('0xc'));var Papa=require(_0xa7e7('0xd'));var Redis=require(_0xa7e7('0xe'));var authService=require(_0xa7e7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa7e7('0x10'));var hardwareService=require(_0xa7e7('0x11'));var logger=require(_0xa7e7('0x12'))(_0xa7e7('0x13'));var utils=require(_0xa7e7('0x14'));var config=require(_0xa7e7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7e7('0x16'))['db'];function respondWithStatusCode(_0x400eaf,_0x1dead4){_0x1dead4=_0x1dead4||0xcc;return function(_0x35a15d){if(_0x35a15d){return _0x400eaf[_0xa7e7('0x17')](_0x1dead4);}return _0x400eaf[_0xa7e7('0x18')](_0x1dead4)[_0xa7e7('0x19')]();};}function respondWithResult(_0x1e1c52,_0x3faec2){_0x3faec2=_0x3faec2||0xc8;return function(_0x263d50){if(_0x263d50){return _0x1e1c52[_0xa7e7('0x18')](_0x3faec2)[_0xa7e7('0x1a')](_0x263d50);}};}function respondWithFilteredResult(_0x4b16a3,_0x343c13){return function(_0x3c34d9){if(_0x3c34d9){var _0x174512=typeof _0x343c13[_0xa7e7('0x1b')]===_0xa7e7('0x1c')&&typeof _0x343c13[_0xa7e7('0x1d')]===_0xa7e7('0x1c');var _0x4772ef=_0x3c34d9[_0xa7e7('0x1e')];var _0x5d691f=_0x174512?0x0:_0x343c13['offset'];var _0x217765=_0x174512?_0x3c34d9['count']:_0x343c13[_0xa7e7('0x1b')]+_0x343c13['limit'];var _0x5f442b;if(_0x217765>=_0x4772ef){_0x217765=_0x4772ef;_0x5f442b=0xc8;}else{_0x5f442b=0xce;}_0x4b16a3[_0xa7e7('0x18')](_0x5f442b);return _0x4b16a3[_0xa7e7('0x1f')](_0xa7e7('0x20'),_0x5d691f+'-'+_0x217765+'/'+_0x4772ef)[_0xa7e7('0x1a')](_0x3c34d9);}return null;};}function patchUpdates(_0x3175ae){return function(_0x303839){try{jsonpatch[_0xa7e7('0x21')](_0x303839,_0x3175ae,!![]);}catch(_0x495a1b){return BPromise[_0xa7e7('0x22')](_0x495a1b);}return _0x303839['save']();};}function saveUpdates(_0x446b97,_0x5ab70b){return function(_0x15f34d){if(_0x15f34d){return _0x15f34d['update'](_0x446b97)[_0xa7e7('0x23')](function(_0x1f4b30){return _0x1f4b30;});}return null;};}function removeEntity(_0xaac323,_0x5988db){return function(_0x1725f1){if(_0x1725f1){return _0x1725f1[_0xa7e7('0x24')]()[_0xa7e7('0x23')](function(){_0xaac323[_0xa7e7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20f2fb,_0x4a8c12){return function(_0x8d8f2a){if(!_0x8d8f2a){_0x20f2fb[_0xa7e7('0x17')](0x194);}return _0x8d8f2a;};}function handleError(_0x3581e6,_0x344b7b){_0x344b7b=_0x344b7b||0x1f4;return function(_0x92d906){logger[_0xa7e7('0x25')](_0x92d906[_0xa7e7('0x26')]);if(_0x92d906[_0xa7e7('0x27')]){delete _0x92d906[_0xa7e7('0x27')];}_0x3581e6[_0xa7e7('0x18')](_0x344b7b)[_0xa7e7('0x28')](_0x92d906);};}exports[_0xa7e7('0x29')]=function(_0x73a6a3,_0x22c59d){var _0x1c15bc={},_0x5b88b1={},_0x4d239d={'count':0x0,'rows':[]};var _0x33a885=_[_0xa7e7('0x2a')](db[_0xa7e7('0x2b')]['rawAttributes'],function(_0x470b25){return{'name':_0x470b25[_0xa7e7('0x2c')],'type':_0x470b25[_0xa7e7('0x2d')][_0xa7e7('0x2e')]};});_0x5b88b1['model']=_[_0xa7e7('0x2a')](_0x33a885,_0xa7e7('0x27'));_0x5b88b1[_0xa7e7('0x2f')]=_['keys'](_0x73a6a3[_0xa7e7('0x2f')]);_0x5b88b1[_0xa7e7('0x30')]=_['intersection'](_0x5b88b1['model'],_0x5b88b1[_0xa7e7('0x2f')]);_0x1c15bc[_0xa7e7('0x31')]=_['intersection'](_0x5b88b1[_0xa7e7('0x32')],qs[_0xa7e7('0x33')](_0x73a6a3[_0xa7e7('0x2f')][_0xa7e7('0x33')]));_0x1c15bc['attributes']=_0x1c15bc[_0xa7e7('0x31')][_0xa7e7('0x34')]?_0x1c15bc['attributes']:_0x5b88b1[_0xa7e7('0x32')];if(!_0x73a6a3[_0xa7e7('0x2f')]['hasOwnProperty'](_0xa7e7('0x35'))){_0x1c15bc[_0xa7e7('0x1d')]=qs[_0xa7e7('0x1d')](_0x73a6a3[_0xa7e7('0x2f')][_0xa7e7('0x1d')]);_0x1c15bc['offset']=qs[_0xa7e7('0x1b')](_0x73a6a3['query'][_0xa7e7('0x1b')]);}_0x1c15bc[_0xa7e7('0x36')]=qs['sort'](_0x73a6a3[_0xa7e7('0x2f')][_0xa7e7('0x37')]);_0x1c15bc[_0xa7e7('0x38')]=qs[_0xa7e7('0x30')](_['pick'](_0x73a6a3[_0xa7e7('0x2f')],_0x5b88b1[_0xa7e7('0x30')]),_0x33a885);if(_0x73a6a3[_0xa7e7('0x2f')][_0xa7e7('0x39')]){_0x1c15bc[_0xa7e7('0x38')]=_[_0xa7e7('0x3a')](_0x1c15bc['where'],{'$or':_[_0xa7e7('0x2a')](_0x33a885,function(_0x46a045){if(_0x46a045[_0xa7e7('0x2d')]!=='VIRTUAL'){var _0x59ceef={};_0x59ceef[_0x46a045[_0xa7e7('0x27')]]={'$like':'%'+_0x73a6a3[_0xa7e7('0x2f')][_0xa7e7('0x39')]+'%'};return _0x59ceef;}})});}_0x1c15bc=_[_0xa7e7('0x3a')]({},_0x1c15bc,_0x73a6a3[_0xa7e7('0x3b')]);var _0x57a485={'where':_0x1c15bc[_0xa7e7('0x38')]};return db[_0xa7e7('0x2b')][_0xa7e7('0x1e')](_0x57a485)['then'](function(_0x25eb20){_0x4d239d[_0xa7e7('0x1e')]=_0x25eb20;if(_0x73a6a3[_0xa7e7('0x2f')]['includeAll']){_0x1c15bc['include']=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x1c15bc);})['then'](function(_0x1a3904){_0x4d239d[_0xa7e7('0x3c')]=_0x1a3904;return _0x4d239d;})['then'](respondWithFilteredResult(_0x22c59d,_0x1c15bc))[_0xa7e7('0x3d')](handleError(_0x22c59d,null));};exports['show']=function(_0x182af6,_0x3c5ac2){var _0x449880={'raw':!![],'where':{'id':_0x182af6[_0xa7e7('0x3e')]['id']}},_0x499391={};_0x499391['model']=_[_0xa7e7('0x3f')](db[_0xa7e7('0x2b')][_0xa7e7('0x40')]);_0x499391[_0xa7e7('0x2f')]=_[_0xa7e7('0x3f')](_0x182af6['query']);_0x499391[_0xa7e7('0x30')]=_[_0xa7e7('0x41')](_0x499391[_0xa7e7('0x32')],_0x499391['query']);_0x449880['attributes']=_[_0xa7e7('0x41')](_0x499391[_0xa7e7('0x32')],qs['fields'](_0x182af6[_0xa7e7('0x2f')][_0xa7e7('0x33')]));_0x449880[_0xa7e7('0x31')]=_0x449880[_0xa7e7('0x31')][_0xa7e7('0x34')]?_0x449880[_0xa7e7('0x31')]:_0x499391[_0xa7e7('0x32')];if(_0x182af6[_0xa7e7('0x2f')]['includeAll']){_0x449880[_0xa7e7('0x42')]=[{'all':!![]}];}_0x449880=_[_0xa7e7('0x3a')]({},_0x449880,_0x182af6['options']);return db[_0xa7e7('0x2b')][_0xa7e7('0x43')](_0x449880)['then'](handleEntityNotFound(_0x3c5ac2,null))['then'](respondWithResult(_0x3c5ac2,null))[_0xa7e7('0x3d')](handleError(_0x3c5ac2,null));};exports[_0xa7e7('0x44')]=function(_0x2e4955,_0x46ec6d){return db[_0xa7e7('0x2b')]['create'](_0x2e4955[_0xa7e7('0x45')],{})[_0xa7e7('0x23')](respondWithResult(_0x46ec6d,0xc9))[_0xa7e7('0x3d')](handleError(_0x46ec6d,null));};exports[_0xa7e7('0x46')]=function(_0x318cff,_0x39f80a){if(_0x318cff[_0xa7e7('0x45')]['id']){delete _0x318cff['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x318cff['params']['id']}})['then'](handleEntityNotFound(_0x39f80a,null))['then'](saveUpdates(_0x318cff[_0xa7e7('0x45')],null))['then'](respondWithResult(_0x39f80a,null))[_0xa7e7('0x3d')](handleError(_0x39f80a,null));};exports[_0xa7e7('0x24')]=function(_0x1bbe17,_0x5a8138){return db['ServicenowField'][_0xa7e7('0x43')]({'where':{'id':_0x1bbe17['params']['id']}})['then'](handleEntityNotFound(_0x5a8138,null))[_0xa7e7('0x23')](removeEntity(_0x5a8138,null))['catch'](handleError(_0x5a8138,null));};
\ No newline at end of file
+var _0x0c18=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','send','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','name','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1a3660,_0x71ced6){var _0x255bc2=function(_0x4da008){while(--_0x4da008){_0x1a3660['push'](_0x1a3660['shift']());}};_0x255bc2(++_0x71ced6);}(_0x0c18,0x108));var _0x80c1=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x0c18[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require(_0x80c1('0x0'));var rimraf=require(_0x80c1('0x1'));var zipdir=require(_0x80c1('0x2'));var jsonpatch=require(_0x80c1('0x3'));var rp=require('request-promise');var moment=require(_0x80c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x80c1('0x5'));var util=require(_0x80c1('0x6'));var path=require(_0x80c1('0x7'));var sox=require(_0x80c1('0x8'));var csv=require(_0x80c1('0x9'));var ejs=require(_0x80c1('0xa'));var fs=require('fs');var fs_extra=require(_0x80c1('0xb'));var _=require(_0x80c1('0xc'));var squel=require(_0x80c1('0xd'));var crypto=require(_0x80c1('0xe'));var jsforce=require(_0x80c1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x80c1('0x9'));var querystring=require(_0x80c1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x80c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80c1('0x12'))(_0x80c1('0x13'));var utils=require(_0x80c1('0x14'));var config=require(_0x80c1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x80c1('0x16'))['db'];function respondWithStatusCode(_0x31c594,_0x184e1a){_0x184e1a=_0x184e1a||0xcc;return function(_0x13b266){if(_0x13b266){return _0x31c594[_0x80c1('0x17')](_0x184e1a);}return _0x31c594[_0x80c1('0x18')](_0x184e1a)[_0x80c1('0x19')]();};}function respondWithResult(_0x33fb52,_0x45171a){_0x45171a=_0x45171a||0xc8;return function(_0x102497){if(_0x102497){return _0x33fb52[_0x80c1('0x18')](_0x45171a)[_0x80c1('0x1a')](_0x102497);}};}function respondWithFilteredResult(_0x1f6235,_0x2a5350){return function(_0xddb560){if(_0xddb560){var _0x18c204=typeof _0x2a5350[_0x80c1('0x1b')]===_0x80c1('0x1c')&&typeof _0x2a5350[_0x80c1('0x1d')]===_0x80c1('0x1c');var _0x2e1d70=_0xddb560[_0x80c1('0x1e')];var _0x4d5a43=_0x18c204?0x0:_0x2a5350[_0x80c1('0x1b')];var _0x4a8279=_0x18c204?_0xddb560[_0x80c1('0x1e')]:_0x2a5350[_0x80c1('0x1b')]+_0x2a5350[_0x80c1('0x1d')];var _0x14e4c4;if(_0x4a8279>=_0x2e1d70){_0x4a8279=_0x2e1d70;_0x14e4c4=0xc8;}else{_0x14e4c4=0xce;}_0x1f6235[_0x80c1('0x18')](_0x14e4c4);return _0x1f6235[_0x80c1('0x1f')](_0x80c1('0x20'),_0x4d5a43+'-'+_0x4a8279+'/'+_0x2e1d70)['json'](_0xddb560);}return null;};}function patchUpdates(_0x1f8196){return function(_0x1d3ecf){try{jsonpatch[_0x80c1('0x21')](_0x1d3ecf,_0x1f8196,!![]);}catch(_0x4f3c29){return BPromise['reject'](_0x4f3c29);}return _0x1d3ecf['save']();};}function saveUpdates(_0x3a5f7a,_0x5b694b){return function(_0x4bee3a){if(_0x4bee3a){return _0x4bee3a[_0x80c1('0x22')](_0x3a5f7a)[_0x80c1('0x23')](function(_0x23c79c){return _0x23c79c;});}return null;};}function removeEntity(_0x24dd5b,_0xb5bb74){return function(_0x51c74d){if(_0x51c74d){return _0x51c74d[_0x80c1('0x24')]()[_0x80c1('0x23')](function(){_0x24dd5b[_0x80c1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393cba,_0x3daf72){return function(_0x417dd9){if(!_0x417dd9){_0x393cba[_0x80c1('0x17')](0x194);}return _0x417dd9;};}function handleError(_0x4ddf78,_0x428a19){_0x428a19=_0x428a19||0x1f4;return function(_0x57bfba){logger[_0x80c1('0x25')](_0x57bfba[_0x80c1('0x26')]);if(_0x57bfba['name']){delete _0x57bfba['name'];}_0x4ddf78['status'](_0x428a19)[_0x80c1('0x27')](_0x57bfba);};}exports['index']=function(_0x242ca7,_0x1474fd){var _0x4a35cd={},_0x57f395={},_0x43da95={'count':0x0,'rows':[]};var _0x2d2b2e=_[_0x80c1('0x28')](db[_0x80c1('0x29')][_0x80c1('0x2a')],function(_0x1e1dee){return{'name':_0x1e1dee[_0x80c1('0x2b')],'type':_0x1e1dee[_0x80c1('0x2c')][_0x80c1('0x2d')]};});_0x57f395[_0x80c1('0x2e')]=_[_0x80c1('0x28')](_0x2d2b2e,'name');_0x57f395[_0x80c1('0x2f')]=_[_0x80c1('0x30')](_0x242ca7[_0x80c1('0x2f')]);_0x57f395[_0x80c1('0x31')]=_[_0x80c1('0x32')](_0x57f395[_0x80c1('0x2e')],_0x57f395[_0x80c1('0x2f')]);_0x4a35cd[_0x80c1('0x33')]=_['intersection'](_0x57f395['model'],qs['fields'](_0x242ca7[_0x80c1('0x2f')][_0x80c1('0x34')]));_0x4a35cd[_0x80c1('0x33')]=_0x4a35cd[_0x80c1('0x33')][_0x80c1('0x35')]?_0x4a35cd[_0x80c1('0x33')]:_0x57f395[_0x80c1('0x2e')];if(!_0x242ca7[_0x80c1('0x2f')]['hasOwnProperty'](_0x80c1('0x36'))){_0x4a35cd[_0x80c1('0x1d')]=qs['limit'](_0x242ca7['query'][_0x80c1('0x1d')]);_0x4a35cd[_0x80c1('0x1b')]=qs['offset'](_0x242ca7[_0x80c1('0x2f')][_0x80c1('0x1b')]);}_0x4a35cd[_0x80c1('0x37')]=qs[_0x80c1('0x38')](_0x242ca7['query'][_0x80c1('0x38')]);_0x4a35cd[_0x80c1('0x39')]=qs[_0x80c1('0x31')](_[_0x80c1('0x3a')](_0x242ca7[_0x80c1('0x2f')],_0x57f395[_0x80c1('0x31')]),_0x2d2b2e);if(_0x242ca7['query']['filter']){_0x4a35cd[_0x80c1('0x39')]=_['merge'](_0x4a35cd[_0x80c1('0x39')],{'$or':_[_0x80c1('0x28')](_0x2d2b2e,function(_0x2aadfd){if(_0x2aadfd[_0x80c1('0x2c')]!==_0x80c1('0x3b')){var _0x5bd8cb={};_0x5bd8cb[_0x2aadfd[_0x80c1('0x3c')]]={'$like':'%'+_0x242ca7[_0x80c1('0x2f')]['filter']+'%'};return _0x5bd8cb;}})});}_0x4a35cd=_[_0x80c1('0x3d')]({},_0x4a35cd,_0x242ca7[_0x80c1('0x3e')]);var _0x1704df={'where':_0x4a35cd[_0x80c1('0x39')]};return db['ServicenowField'][_0x80c1('0x1e')](_0x1704df)[_0x80c1('0x23')](function(_0x224305){_0x43da95[_0x80c1('0x1e')]=_0x224305;if(_0x242ca7[_0x80c1('0x2f')][_0x80c1('0x3f')]){_0x4a35cd[_0x80c1('0x40')]=[{'all':!![]}];}return db[_0x80c1('0x29')][_0x80c1('0x41')](_0x4a35cd);})[_0x80c1('0x23')](function(_0x58313d){_0x43da95['rows']=_0x58313d;return _0x43da95;})[_0x80c1('0x23')](respondWithFilteredResult(_0x1474fd,_0x4a35cd))[_0x80c1('0x42')](handleError(_0x1474fd,null));};exports[_0x80c1('0x43')]=function(_0x21ee09,_0x2d1f4b){var _0x52e2ee={'raw':!![],'where':{'id':_0x21ee09[_0x80c1('0x44')]['id']}},_0x10eaa2={};_0x10eaa2[_0x80c1('0x2e')]=_[_0x80c1('0x30')](db[_0x80c1('0x29')]['rawAttributes']);_0x10eaa2['query']=_['keys'](_0x21ee09[_0x80c1('0x2f')]);_0x10eaa2[_0x80c1('0x31')]=_[_0x80c1('0x32')](_0x10eaa2[_0x80c1('0x2e')],_0x10eaa2[_0x80c1('0x2f')]);_0x52e2ee[_0x80c1('0x33')]=_[_0x80c1('0x32')](_0x10eaa2[_0x80c1('0x2e')],qs[_0x80c1('0x34')](_0x21ee09['query'][_0x80c1('0x34')]));_0x52e2ee['attributes']=_0x52e2ee['attributes']['length']?_0x52e2ee[_0x80c1('0x33')]:_0x10eaa2[_0x80c1('0x2e')];if(_0x21ee09[_0x80c1('0x2f')][_0x80c1('0x3f')]){_0x52e2ee[_0x80c1('0x40')]=[{'all':!![]}];}_0x52e2ee=_[_0x80c1('0x3d')]({},_0x52e2ee,_0x21ee09[_0x80c1('0x3e')]);return db['ServicenowField'][_0x80c1('0x45')](_0x52e2ee)[_0x80c1('0x23')](handleEntityNotFound(_0x2d1f4b,null))['then'](respondWithResult(_0x2d1f4b,null))['catch'](handleError(_0x2d1f4b,null));};exports[_0x80c1('0x46')]=function(_0xa084ff,_0x4706b3){return db[_0x80c1('0x29')][_0x80c1('0x46')](_0xa084ff['body'],{})[_0x80c1('0x23')](respondWithResult(_0x4706b3,0xc9))[_0x80c1('0x42')](handleError(_0x4706b3,null));};exports[_0x80c1('0x22')]=function(_0x27dde9,_0x20036a){if(_0x27dde9[_0x80c1('0x47')]['id']){delete _0x27dde9[_0x80c1('0x47')]['id'];}return db[_0x80c1('0x29')]['find']({'where':{'id':_0x27dde9[_0x80c1('0x44')]['id']}})[_0x80c1('0x23')](handleEntityNotFound(_0x20036a,null))[_0x80c1('0x23')](saveUpdates(_0x27dde9['body'],null))[_0x80c1('0x23')](respondWithResult(_0x20036a,null))[_0x80c1('0x42')](handleError(_0x20036a,null));};exports[_0x80c1('0x24')]=function(_0x55e6e7,_0x7b97f){return db[_0x80c1('0x29')]['find']({'where':{'id':_0x55e6e7[_0x80c1('0x44')]['id']}})[_0x80c1('0x23')](handleEntityNotFound(_0x7b97f,null))[_0x80c1('0x23')](removeEntity(_0x7b97f,null))[_0x80c1('0x42')](handleError(_0x7b97f,null));};
\ No newline at end of file
index 4bfb51f..ab5f2c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ec1=['moment','request-promise','path','rimraf','exports','int_servicenow_fields','servicenow_unique_index','idField','lodash','../../config/logger','api'];(function(_0x39713f,_0x3991c7){var _0x137d42=function(_0x852a2f){while(--_0x852a2f){_0x39713f['push'](_0x39713f['shift']());}};_0x137d42(++_0x3991c7);}(_0x8ec1,0xad));var _0x18ec=function(_0x39a6ca,_0x10c9f0){_0x39a6ca=_0x39a6ca-0x0;var _0x752c2f=_0x8ec1[_0x39a6ca];return _0x752c2f;};'use strict';var _=require(_0x18ec('0x0'));var util=require('util');var logger=require(_0x18ec('0x1'))(_0x18ec('0x2'));var moment=require(_0x18ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x18ec('0x4'));var fs=require('fs');var path=require(_0x18ec('0x5'));var rimraf=require(_0x18ec('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x18ec('0x7')]=function(_0x9f0e6d,_0x1ff5c5){return _0x9f0e6d['define']('ServicenowField',attributes,{'tableName':_0x18ec('0x8'),'paranoid':![],'indexes':[{'name':_0x18ec('0x9'),'fields':[_0x18ec('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x33e8=['moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api'];(function(_0x30f910,_0x8e3a23){var _0x836515=function(_0x1742eb){while(--_0x1742eb){_0x30f910['push'](_0x30f910['shift']());}};_0x836515(++_0x8e3a23);}(_0x33e8,0x116));var _0x833e=function(_0x541525,_0x5c7ace){_0x541525=_0x541525-0x0;var _0x5031ff=_0x33e8[_0x541525];return _0x5031ff;};'use strict';var _=require('lodash');var util=require(_0x833e('0x0'));var logger=require('../../config/logger')(_0x833e('0x1'));var moment=require(_0x833e('0x2'));var BPromise=require(_0x833e('0x3'));var rp=require(_0x833e('0x4'));var fs=require('fs');var path=require(_0x833e('0x5'));var rimraf=require(_0x833e('0x6'));var config=require('../../config/environment');var attributes=require(_0x833e('0x7'));module[_0x833e('0x8')]=function(_0x313a70,_0x27f17f){return _0x313a70[_0x833e('0x9')]('ServicenowField',attributes,{'tableName':_0x833e('0xa'),'paranoid':![],'indexes':[{'name':_0x833e('0xb'),'fields':[_0x833e('0xc'),_0x833e('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 11a45e2..0bb774f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x362d1b,_0x107613){var _0x4b1536=function(_0x4ed572){while(--_0x4ed572){_0x362d1b['push'](_0x362d1b['shift']());}};_0x4b1536(++_0x107613);}(_0xe706,0xa3));var _0x6e70=function(_0x4f25f9,_0x255051){_0x4f25f9=_0x4f25f9-0x0;var _0x92083c=_0xe706[_0x4f25f9];return _0x92083c;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0xbdb7[_0x3a3d20];return _0x33bc94;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
index 24ac15c..7e9990f 100644 (file)
@@ -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(_0x155b4d,_0x169326){var _0x195e3c=function(_0x5c1fba){while(--_0x5c1fba){_0x155b4d['push'](_0x155b4d['shift']());}};_0x195e3c(++_0x169326);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x482454,_0x1d91dc){var _0x1de85a=function(_0x78f0d0){while(--_0x78f0d0){_0x482454['push'](_0x482454['shift']());}};_0x1de85a(++_0x1d91dc);}(_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
index bd15492..9d85988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1c3f67,_0x359a1d){var _0x4e0ad7=function(_0x6ee8f9){while(--_0x6ee8f9){_0x1c3f67['push'](_0x1c3f67['shift']());}};_0x4e0ad7(++_0x359a1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x1b08ea,_0x4476df){var _0x5750bb=function(_0x5e9875){while(--_0x5e9875){_0x1b08ea['push'](_0x1b08ea['shift']());}};_0x5750bb(++_0x4476df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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
index 7ca34ec..e2e8e35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfef=['rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','includeAll','findAll','rows','catch','show','length','include','options','find','create','body','update','params','getConfigurations','findOne','SugarcrmConfiguration','pick','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','password','remoteUri','slice','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','remove','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','destroy','then','error','stack','name','index','map','SugarcrmAccount'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcfef,0xc1));var _0xfcfe=function(_0x58634f,_0x17f0d5){_0x58634f=_0x58634f-0x0;var _0x45e524=_0xcfef[_0x58634f];return _0x45e524;};'use strict';var emlformat=require(_0xfcfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcfe('0x1'));var jsonpatch=require(_0xfcfe('0x2'));var rp=require(_0xfcfe('0x3'));var moment=require(_0xfcfe('0x4'));var BPromise=require(_0xfcfe('0x5'));var Mustache=require(_0xfcfe('0x6'));var util=require(_0xfcfe('0x7'));var path=require(_0xfcfe('0x8'));var sox=require(_0xfcfe('0x9'));var csv=require('to-csv');var ejs=require(_0xfcfe('0xa'));var fs=require('fs');var fs_extra=require(_0xfcfe('0xb'));var _=require(_0xfcfe('0xc'));var squel=require(_0xfcfe('0xd'));var crypto=require(_0xfcfe('0xe'));var jsforce=require(_0xfcfe('0xf'));var deskjs=require(_0xfcfe('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfcfe('0x11'));var Redis=require(_0xfcfe('0x12'));var authService=require(_0xfcfe('0x13'));var qs=require(_0xfcfe('0x14'));var as=require(_0xfcfe('0x15'));var hardwareService=require(_0xfcfe('0x16'));var logger=require(_0xfcfe('0x17'))(_0xfcfe('0x18'));var utils=require(_0xfcfe('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xfcfe('0x1a'));var db=require(_0xfcfe('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x392a4b,_0x583177){_0x583177=_0x583177||0xcc;return function(_0x1cff95){if(_0x1cff95){return _0x392a4b[_0xfcfe('0x1c')](_0x583177);}return _0x392a4b[_0xfcfe('0x1d')](_0x583177)['end']();};}function respondWithResult(_0x7504cb,_0x11e70c){_0x11e70c=_0x11e70c||0xc8;return function(_0x51f6a6){if(_0x51f6a6){return _0x7504cb['status'](_0x11e70c)[_0xfcfe('0x1e')](_0x51f6a6);}};}function respondWithFilteredResult(_0x5ad8e7,_0x313140){return function(_0x138cca){if(_0x138cca){var _0x4f29b0=typeof _0x313140[_0xfcfe('0x1f')]===_0xfcfe('0x20')&&typeof _0x313140[_0xfcfe('0x21')]===_0xfcfe('0x20');var _0x217534=_0x138cca[_0xfcfe('0x22')];var _0x1b76f8=_0x4f29b0?0x0:_0x313140['offset'];var _0x25c873=_0x4f29b0?_0x138cca[_0xfcfe('0x22')]:_0x313140[_0xfcfe('0x1f')]+_0x313140[_0xfcfe('0x21')];var _0x43d8a4;if(_0x25c873>=_0x217534){_0x25c873=_0x217534;_0x43d8a4=0xc8;}else{_0x43d8a4=0xce;}_0x5ad8e7[_0xfcfe('0x1d')](_0x43d8a4);return _0x5ad8e7['set'](_0xfcfe('0x23'),_0x1b76f8+'-'+_0x25c873+'/'+_0x217534)[_0xfcfe('0x1e')](_0x138cca);}return null;};}function patchUpdates(_0x4ec655){return function(_0xea77c5){try{jsonpatch['apply'](_0xea77c5,_0x4ec655,!![]);}catch(_0x268a35){return BPromise['reject'](_0x268a35);}return _0xea77c5[_0xfcfe('0x24')]();};}function saveUpdates(_0x144902,_0x39276a){return function(_0x21a601){if(_0x21a601){return _0x21a601['update'](_0x144902)['then'](function(_0x26de39){return _0x26de39;});}return null;};}function removeEntity(_0xe821f2,_0x1f4a9b){return function(_0xa697b1){if(_0xa697b1){return _0xa697b1[_0xfcfe('0x25')]()[_0xfcfe('0x26')](function(){_0xe821f2[_0xfcfe('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ccd8,_0x578419){return function(_0x1d2ddc){if(!_0x1d2ddc){_0x41ccd8[_0xfcfe('0x1c')](0x194);}return _0x1d2ddc;};}function handleError(_0x2b47d8,_0x1fdd5b){_0x1fdd5b=_0x1fdd5b||0x1f4;return function(_0x30614e){logger[_0xfcfe('0x27')](_0x30614e[_0xfcfe('0x28')]);if(_0x30614e[_0xfcfe('0x29')]){delete _0x30614e['name'];}_0x2b47d8[_0xfcfe('0x1d')](_0x1fdd5b)['send'](_0x30614e);};}exports[_0xfcfe('0x2a')]=function(_0x1d2cbe,_0x1440f1){var _0x221e4c={},_0x4b04f0={},_0x3236fe={'count':0x0,'rows':[]};var _0x19c381=_[_0xfcfe('0x2b')](db[_0xfcfe('0x2c')][_0xfcfe('0x2d')],function(_0x50aa73){return{'name':_0x50aa73['fieldName'],'type':_0x50aa73['type'][_0xfcfe('0x2e')]};});_0x4b04f0[_0xfcfe('0x2f')]=_[_0xfcfe('0x2b')](_0x19c381,'name');_0x4b04f0[_0xfcfe('0x30')]=_[_0xfcfe('0x31')](_0x1d2cbe['query']);_0x4b04f0['filters']=_[_0xfcfe('0x32')](_0x4b04f0['model'],_0x4b04f0[_0xfcfe('0x30')]);_0x221e4c[_0xfcfe('0x33')]=_[_0xfcfe('0x32')](_0x4b04f0['model'],qs[_0xfcfe('0x34')](_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x34')]));_0x221e4c[_0xfcfe('0x33')]=_0x221e4c[_0xfcfe('0x33')]['length']?_0x221e4c['attributes']:_0x4b04f0[_0xfcfe('0x2f')];if(!_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x35')](_0xfcfe('0x36'))){_0x221e4c['limit']=qs['limit'](_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x21')]);_0x221e4c[_0xfcfe('0x1f')]=qs[_0xfcfe('0x1f')](_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x1f')]);}_0x221e4c[_0xfcfe('0x37')]=qs[_0xfcfe('0x38')](_0x1d2cbe['query']['sort']);_0x221e4c[_0xfcfe('0x39')]=qs['filters'](_['pick'](_0x1d2cbe[_0xfcfe('0x30')],_0x4b04f0[_0xfcfe('0x3a')]),_0x19c381);if(_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x3b')]){_0x221e4c[_0xfcfe('0x39')]=_[_0xfcfe('0x3c')](_0x221e4c['where'],{'$or':_['map'](_0x19c381,function(_0x8a96fc){if(_0x8a96fc[_0xfcfe('0x3d')]!=='VIRTUAL'){var _0x6c61b1={};_0x6c61b1[_0x8a96fc[_0xfcfe('0x29')]]={'$like':'%'+_0x1d2cbe[_0xfcfe('0x30')][_0xfcfe('0x3b')]+'%'};return _0x6c61b1;}})});}_0x221e4c=_['merge']({},_0x221e4c,_0x1d2cbe['options']);var _0x14b6d8={'where':_0x221e4c[_0xfcfe('0x39')]};return db['SugarcrmAccount'][_0xfcfe('0x22')](_0x14b6d8)[_0xfcfe('0x26')](function(_0x5112e6){_0x3236fe[_0xfcfe('0x22')]=_0x5112e6;if(_0x1d2cbe['query'][_0xfcfe('0x3e')]){_0x221e4c['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xfcfe('0x3f')](_0x221e4c);})[_0xfcfe('0x26')](function(_0x3eef07){_0x3236fe[_0xfcfe('0x40')]=_0x3eef07;return _0x3236fe;})[_0xfcfe('0x26')](respondWithFilteredResult(_0x1440f1,_0x221e4c))[_0xfcfe('0x41')](handleError(_0x1440f1,null));};exports[_0xfcfe('0x42')]=function(_0x2dc802,_0x1479ea){var _0xeaddf4={'raw':![],'where':{'id':_0x2dc802['params']['id']}},_0x363ed0={};_0x363ed0['model']=_[_0xfcfe('0x31')](db[_0xfcfe('0x2c')][_0xfcfe('0x2d')]);_0x363ed0[_0xfcfe('0x30')]=_['keys'](_0x2dc802[_0xfcfe('0x30')]);_0x363ed0[_0xfcfe('0x3a')]=_[_0xfcfe('0x32')](_0x363ed0[_0xfcfe('0x2f')],_0x363ed0[_0xfcfe('0x30')]);_0xeaddf4[_0xfcfe('0x33')]=_[_0xfcfe('0x32')](_0x363ed0[_0xfcfe('0x2f')],qs[_0xfcfe('0x34')](_0x2dc802[_0xfcfe('0x30')][_0xfcfe('0x34')]));_0xeaddf4[_0xfcfe('0x33')]=_0xeaddf4[_0xfcfe('0x33')][_0xfcfe('0x43')]?_0xeaddf4[_0xfcfe('0x33')]:_0x363ed0[_0xfcfe('0x2f')];if(_0x2dc802['query']['includeAll']){_0xeaddf4[_0xfcfe('0x44')]=[{'all':!![]}];}_0xeaddf4=_['merge']({},_0xeaddf4,_0x2dc802[_0xfcfe('0x45')]);return db['SugarcrmAccount'][_0xfcfe('0x46')](_0xeaddf4)[_0xfcfe('0x26')](handleEntityNotFound(_0x1479ea,null))[_0xfcfe('0x26')](respondWithResult(_0x1479ea,null))[_0xfcfe('0x41')](handleError(_0x1479ea,null));};exports[_0xfcfe('0x47')]=function(_0x582ab6,_0x5b3f7a){return db[_0xfcfe('0x2c')][_0xfcfe('0x47')](_0x582ab6[_0xfcfe('0x48')],{})['then'](respondWithResult(_0x5b3f7a,0xc9))['catch'](handleError(_0x5b3f7a,null));};exports[_0xfcfe('0x49')]=function(_0x2bcc81,_0x30fc62){if(_0x2bcc81[_0xfcfe('0x48')]['id']){delete _0x2bcc81['body']['id'];}return db[_0xfcfe('0x2c')]['find']({'where':{'id':_0x2bcc81[_0xfcfe('0x4a')]['id']}})[_0xfcfe('0x26')](handleEntityNotFound(_0x30fc62,null))[_0xfcfe('0x26')](saveUpdates(_0x2bcc81['body'],null))[_0xfcfe('0x26')](respondWithResult(_0x30fc62,null))[_0xfcfe('0x41')](handleError(_0x30fc62,null));};exports[_0xfcfe('0x25')]=function(_0x3d6dbb,_0x503fd5){return db[_0xfcfe('0x2c')]['find']({'where':{'id':_0x3d6dbb[_0xfcfe('0x4a')]['id']}})['then'](handleEntityNotFound(_0x503fd5,null))['then'](removeEntity(_0x503fd5,null))[_0xfcfe('0x41')](handleError(_0x503fd5,null));};exports[_0xfcfe('0x4b')]=function(_0x54c648,_0x4710b4,_0x26e76f){var _0x53f831={};var _0x333500={};var _0x2ec6c4;var _0x4122db;return db['SugarcrmAccount'][_0xfcfe('0x4c')]({'where':{'id':_0x54c648[_0xfcfe('0x4a')]['id']}})[_0xfcfe('0x26')](handleEntityNotFound(_0x4710b4,null))[_0xfcfe('0x26')](function(_0x136cc1){if(_0x136cc1){_0x2ec6c4=_0x136cc1;_0x333500[_0xfcfe('0x2f')]=_[_0xfcfe('0x31')](db[_0xfcfe('0x4d')][_0xfcfe('0x2d')]);_0x333500['query']=_['keys'](_0x54c648[_0xfcfe('0x30')]);_0x333500[_0xfcfe('0x3a')]=_[_0xfcfe('0x32')](_0x333500[_0xfcfe('0x2f')],_0x333500[_0xfcfe('0x30')]);_0x53f831[_0xfcfe('0x33')]=_['intersection'](_0x333500[_0xfcfe('0x2f')],qs[_0xfcfe('0x34')](_0x54c648[_0xfcfe('0x30')]['fields']));_0x53f831[_0xfcfe('0x33')]=_0x53f831[_0xfcfe('0x33')][_0xfcfe('0x43')]?_0x53f831[_0xfcfe('0x33')]:_0x333500[_0xfcfe('0x2f')];_0x53f831[_0xfcfe('0x37')]=qs[_0xfcfe('0x38')](_0x54c648[_0xfcfe('0x30')]['sort']);_0x53f831[_0xfcfe('0x39')]=qs[_0xfcfe('0x3a')](_[_0xfcfe('0x4e')](_0x54c648[_0xfcfe('0x30')],_0x333500[_0xfcfe('0x3a')]));if(_0x54c648[_0xfcfe('0x30')][_0xfcfe('0x3b')]){_0x53f831[_0xfcfe('0x39')]=_[_0xfcfe('0x3c')](_0x53f831[_0xfcfe('0x39')],{'$or':_[_0xfcfe('0x2b')](_0x53f831[_0xfcfe('0x33')],function(_0x19931e){var _0x10463c={};_0x10463c[_0x19931e]={'$like':'%'+_0x54c648[_0xfcfe('0x30')][_0xfcfe('0x3b')]+'%'};return _0x10463c;})});}_0x53f831=_[_0xfcfe('0x3c')]({},_0x53f831,_0x54c648[_0xfcfe('0x45')]);return _0x2ec6c4[_0xfcfe('0x4b')](_0x53f831);}})[_0xfcfe('0x26')](function(_0x27a151){if(_0x27a151){_0x4122db=_0x27a151[_0xfcfe('0x43')];if(!_0x54c648['query']['hasOwnProperty'](_0xfcfe('0x36'))){_0x53f831[_0xfcfe('0x21')]=qs[_0xfcfe('0x21')](_0x54c648[_0xfcfe('0x30')][_0xfcfe('0x21')]);_0x53f831['offset']=qs[_0xfcfe('0x1f')](_0x54c648[_0xfcfe('0x30')][_0xfcfe('0x1f')]);}return _0x2ec6c4[_0xfcfe('0x4b')](_0x53f831);}})[_0xfcfe('0x26')](function(_0x49c480){if(_0x49c480){return _0x49c480?{'count':_0x4122db,'rows':_0x49c480}:null;}})[_0xfcfe('0x26')](respondWithResult(_0x4710b4,null))[_0xfcfe('0x41')](handleError(_0x4710b4,null));};exports['addConfiguration']=function(_0x47e296,_0x441f41,_0x450dac){if(_0x47e296[_0xfcfe('0x48')]['id']){delete _0x47e296[_0xfcfe('0x48')]['id'];}return db[_0xfcfe('0x2c')]['findOne']({'where':{'id':_0x47e296[_0xfcfe('0x4a')]['id']}})[_0xfcfe('0x26')](handleEntityNotFound(_0x441f41,null))[_0xfcfe('0x26')](function(_0x243bad){if(_0x243bad){_0x47e296[_0xfcfe('0x48')]['AccountId']=_0x243bad['id'];_0x47e296[_0xfcfe('0x48')][_0xfcfe('0x4f')]=integrations[_0xfcfe('0x50')](_0x47e296['body'][_0xfcfe('0x51')],_0x47e296[_0xfcfe('0x48')][_0xfcfe('0x3d')]);_0x47e296['body']['Descriptions']=integrations[_0xfcfe('0x52')](_0x47e296[_0xfcfe('0x48')][_0xfcfe('0x51')],_0x47e296['body'][_0xfcfe('0x3d')]);return db[_0xfcfe('0x4d')][_0xfcfe('0x47')](_0x47e296[_0xfcfe('0x48')],{'include':[{'model':db[_0xfcfe('0x53')],'as':_0xfcfe('0x4f')},{'model':db[_0xfcfe('0x53')],'as':_0xfcfe('0x54')}]});}return null;})[_0xfcfe('0x26')](respondWithResult(_0x441f41,null))[_0xfcfe('0x41')](handleError(_0x441f41,null));};exports[_0xfcfe('0x55')]=function(_0x3f5d23,_0x3258f8,_0x5d34da){var _0x55dbc6='';var _0x3b4485=['id',_0xfcfe('0x29'),_0xfcfe('0x56'),_0xfcfe('0x57'),_0xfcfe('0x58'),_0xfcfe('0x59'),_0xfcfe('0x5a'),_0xfcfe('0x5b'),_0xfcfe('0x5c'),_0xfcfe('0x5d'),'parent_name','direction'];return db[_0xfcfe('0x2c')][_0xfcfe('0x4c')]({'where':{'id':_0x3f5d23[_0xfcfe('0x4a')]['id']},'attributes':['id','username',_0xfcfe('0x5e'),_0xfcfe('0x5f')]})[_0xfcfe('0x26')](handleEntityNotFound(_0x3258f8,null))[_0xfcfe('0x26')](function(_0x581a59){if(_0x581a59){_0x55dbc6=_0x581a59[_0xfcfe('0x5f')];var _0x36bf81=_0x55dbc6[_0xfcfe('0x60')](-0x1);if(_0x36bf81==='/'){_0x55dbc6=_0x55dbc6['substring'](0x0,_0x55dbc6[_0xfcfe('0x61')](_0x36bf81));}return rp({'method':_0xfcfe('0x62'),'uri':util[_0xfcfe('0x63')]('%s%s',_0x55dbc6,_0xfcfe('0x64')),'json':!![],'form':{'method':_0xfcfe('0x65'),'input_type':'JSON','response_type':_0xfcfe('0x66'),'rest_data':JSON[_0xfcfe('0x67')]({'user_auth':{'user_name':_0x581a59[_0xfcfe('0x68')],'password':_0x581a59['password'],'encryption':'PLAIN'},'application':_0xfcfe('0x69')})}});}})[_0xfcfe('0x26')](function(_0x3fb576){if(_0x3fb576&&_0x3fb576[_0xfcfe('0x29')]!==_0xfcfe('0x6a')&&_0x3fb576[_0xfcfe('0x29')]!==_0xfcfe('0x6b')){return rp({'method':_0xfcfe('0x62'),'uri':util[_0xfcfe('0x63')]('%s%s',_0x55dbc6,_0xfcfe('0x64')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xfcfe('0x66'),'response_type':_0xfcfe('0x66'),'rest_data':JSON[_0xfcfe('0x67')]({'session':_0x3fb576['id'],'module_name':_0xfcfe('0x6c')})}})['then'](function(_0x39719f){if(_0x39719f){var _0x45f89f=_[_0xfcfe('0x6d')](_0x39719f[_0xfcfe('0x6e')]);_[_0xfcfe('0x6f')](_0x45f89f,function(_0x38922f){return _0x3b4485['includes'](_0x38922f[_0xfcfe('0x29')]);});return{'count':_0x45f89f[_0xfcfe('0x43')],'rows':_['map'](_0x45f89f,function(_0x114746){return{'id':_0x114746[_0xfcfe('0x29')],'name':_0x114746['label'],'custom':_[_0xfcfe('0x70')](_0x114746[_0xfcfe('0x29')],'_c')?!![]:![],'options':_0x114746['options']?_['map'](_[_0xfcfe('0x6d')](_0x114746[_0xfcfe('0x45')]),function(_0x2c9570){return{'name':_0x2c9570[_0xfcfe('0x71')],'value':_0x2c9570[_0xfcfe('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x3258f8,null))[_0xfcfe('0x41')](function(_0x511bab){var _0x4653a0=_0x3f5d23[_0xfcfe('0x30')]['test']?0x1f4:_0x511bab[_0xfcfe('0x72')]||0x1f4;logger[_0xfcfe('0x27')](_0xfcfe('0x73'),'getFields',_0x4653a0,JSON['stringify'](_0x511bab));delete _0x511bab[_0xfcfe('0x29')];if(_0x4653a0===0x191){_0x4653a0=0x190;}_0x3258f8[_0xfcfe('0x1d')](_0x4653a0)[_0xfcfe('0x74')](_0x3f5d23[_0xfcfe('0x30')][_0xfcfe('0x75')]?{'message':_0xfcfe('0x76'),'statusCode':_0x511bab[_0xfcfe('0x72')]}:_0x511bab);});}else{var _0x485fb8=0x1f4;_0x3258f8[_0xfcfe('0x1d')](_0x485fb8)['send']({'message':_0xfcfe('0x76'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x4428=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','rawAttributes','include','create','body','update','find','params','getConfigurations','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','direction','findOne','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','get_module_fields','Calls','values','module_fields','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4428,0xf3));var _0x8442=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x4428[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x8442('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8442('0x1'));var rp=require(_0x8442('0x2'));var moment=require(_0x8442('0x3'));var BPromise=require(_0x8442('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8442('0x5'));var sox=require(_0x8442('0x6'));var csv=require(_0x8442('0x7'));var ejs=require(_0x8442('0x8'));var fs=require('fs');var fs_extra=require(_0x8442('0x9'));var _=require(_0x8442('0xa'));var squel=require(_0x8442('0xb'));var crypto=require(_0x8442('0xc'));var jsforce=require(_0x8442('0xd'));var deskjs=require(_0x8442('0xe'));var toCsv=require(_0x8442('0x7'));var querystring=require(_0x8442('0xf'));var Papa=require(_0x8442('0x10'));var Redis=require(_0x8442('0x11'));var authService=require(_0x8442('0x12'));var qs=require(_0x8442('0x13'));var as=require(_0x8442('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8442('0x15'))(_0x8442('0x16'));var utils=require(_0x8442('0x17'));var config=require(_0x8442('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8442('0x19'))['db'];var integrations=require(_0x8442('0x1a'));function respondWithStatusCode(_0x1262d3,_0x2d0206){_0x2d0206=_0x2d0206||0xcc;return function(_0xef7e58){if(_0xef7e58){return _0x1262d3['sendStatus'](_0x2d0206);}return _0x1262d3['status'](_0x2d0206)[_0x8442('0x1b')]();};}function respondWithResult(_0x3a8575,_0x32399b){_0x32399b=_0x32399b||0xc8;return function(_0x3cb68c){if(_0x3cb68c){return _0x3a8575[_0x8442('0x1c')](_0x32399b)[_0x8442('0x1d')](_0x3cb68c);}};}function respondWithFilteredResult(_0x5da0a0,_0x128f5c){return function(_0x49b7e7){if(_0x49b7e7){var _0x4a06a0=typeof _0x128f5c['offset']==='undefined'&&typeof _0x128f5c[_0x8442('0x1e')]===_0x8442('0x1f');var _0x379878=_0x49b7e7[_0x8442('0x20')];var _0x1a67c4=_0x4a06a0?0x0:_0x128f5c['offset'];var _0x52394a=_0x4a06a0?_0x49b7e7[_0x8442('0x20')]:_0x128f5c[_0x8442('0x21')]+_0x128f5c[_0x8442('0x1e')];var _0x2ec34a;if(_0x52394a>=_0x379878){_0x52394a=_0x379878;_0x2ec34a=0xc8;}else{_0x2ec34a=0xce;}_0x5da0a0[_0x8442('0x1c')](_0x2ec34a);return _0x5da0a0[_0x8442('0x22')](_0x8442('0x23'),_0x1a67c4+'-'+_0x52394a+'/'+_0x379878)['json'](_0x49b7e7);}return null;};}function patchUpdates(_0x52c4b5){return function(_0x4a5183){try{jsonpatch[_0x8442('0x24')](_0x4a5183,_0x52c4b5,!![]);}catch(_0x3aa27b){return BPromise[_0x8442('0x25')](_0x3aa27b);}return _0x4a5183[_0x8442('0x26')]();};}function saveUpdates(_0x59049a,_0x42b578){return function(_0x4653dc){if(_0x4653dc){return _0x4653dc['update'](_0x59049a)[_0x8442('0x27')](function(_0x12706d){return _0x12706d;});}return null;};}function removeEntity(_0xebc7b6,_0x42d3a3){return function(_0x2d1e69){if(_0x2d1e69){return _0x2d1e69[_0x8442('0x28')]()[_0x8442('0x27')](function(){_0xebc7b6['status'](0xcc)[_0x8442('0x1b')]();});}};}function handleEntityNotFound(_0x101a63,_0x3faaf2){return function(_0x4a0f60){if(!_0x4a0f60){_0x101a63[_0x8442('0x29')](0x194);}return _0x4a0f60;};}function handleError(_0x55c649,_0x508494){_0x508494=_0x508494||0x1f4;return function(_0x51fe6a){logger[_0x8442('0x2a')](_0x51fe6a[_0x8442('0x2b')]);if(_0x51fe6a[_0x8442('0x2c')]){delete _0x51fe6a[_0x8442('0x2c')];}_0x55c649[_0x8442('0x1c')](_0x508494)[_0x8442('0x2d')](_0x51fe6a);};}exports[_0x8442('0x2e')]=function(_0x11fe63,_0x1da88d){var _0x197a0f={},_0xbf7bd8={},_0x469bd1={'count':0x0,'rows':[]};var _0x58a7e0=_[_0x8442('0x2f')](db[_0x8442('0x30')]['rawAttributes'],function(_0x16c6db){return{'name':_0x16c6db[_0x8442('0x31')],'type':_0x16c6db[_0x8442('0x32')]['key']};});_0xbf7bd8[_0x8442('0x33')]=_[_0x8442('0x2f')](_0x58a7e0,'name');_0xbf7bd8[_0x8442('0x34')]=_[_0x8442('0x35')](_0x11fe63[_0x8442('0x34')]);_0xbf7bd8[_0x8442('0x36')]=_[_0x8442('0x37')](_0xbf7bd8[_0x8442('0x33')],_0xbf7bd8[_0x8442('0x34')]);_0x197a0f['attributes']=_[_0x8442('0x37')](_0xbf7bd8['model'],qs[_0x8442('0x38')](_0x11fe63[_0x8442('0x34')]['fields']));_0x197a0f['attributes']=_0x197a0f[_0x8442('0x39')][_0x8442('0x3a')]?_0x197a0f[_0x8442('0x39')]:_0xbf7bd8['model'];if(!_0x11fe63[_0x8442('0x34')][_0x8442('0x3b')](_0x8442('0x3c'))){_0x197a0f[_0x8442('0x1e')]=qs['limit'](_0x11fe63['query'][_0x8442('0x1e')]);_0x197a0f[_0x8442('0x21')]=qs[_0x8442('0x21')](_0x11fe63[_0x8442('0x34')]['offset']);}_0x197a0f[_0x8442('0x3d')]=qs[_0x8442('0x3e')](_0x11fe63[_0x8442('0x34')][_0x8442('0x3e')]);_0x197a0f[_0x8442('0x3f')]=qs[_0x8442('0x36')](_[_0x8442('0x40')](_0x11fe63[_0x8442('0x34')],_0xbf7bd8[_0x8442('0x36')]),_0x58a7e0);if(_0x11fe63[_0x8442('0x34')][_0x8442('0x41')]){_0x197a0f['where']=_[_0x8442('0x42')](_0x197a0f[_0x8442('0x3f')],{'$or':_[_0x8442('0x2f')](_0x58a7e0,function(_0x428b03){if(_0x428b03[_0x8442('0x32')]!==_0x8442('0x43')){var _0x17dfa9={};_0x17dfa9[_0x428b03['name']]={'$like':'%'+_0x11fe63[_0x8442('0x34')][_0x8442('0x41')]+'%'};return _0x17dfa9;}})});}_0x197a0f=_[_0x8442('0x42')]({},_0x197a0f,_0x11fe63[_0x8442('0x44')]);var _0x1f3bba={'where':_0x197a0f[_0x8442('0x3f')]};return db[_0x8442('0x30')][_0x8442('0x20')](_0x1f3bba)[_0x8442('0x27')](function(_0xc153be){_0x469bd1['count']=_0xc153be;if(_0x11fe63[_0x8442('0x34')]['includeAll']){_0x197a0f['include']=[{'all':!![]}];}return db[_0x8442('0x30')][_0x8442('0x45')](_0x197a0f);})['then'](function(_0x567ae7){_0x469bd1[_0x8442('0x46')]=_0x567ae7;return _0x469bd1;})[_0x8442('0x27')](respondWithFilteredResult(_0x1da88d,_0x197a0f))[_0x8442('0x47')](handleError(_0x1da88d,null));};exports['show']=function(_0x486984,_0x38ded7){var _0x570cd2={'raw':![],'where':{'id':_0x486984['params']['id']}},_0x20f594={};_0x20f594[_0x8442('0x33')]=_[_0x8442('0x35')](db[_0x8442('0x30')][_0x8442('0x48')]);_0x20f594[_0x8442('0x34')]=_[_0x8442('0x35')](_0x486984[_0x8442('0x34')]);_0x20f594[_0x8442('0x36')]=_[_0x8442('0x37')](_0x20f594[_0x8442('0x33')],_0x20f594[_0x8442('0x34')]);_0x570cd2[_0x8442('0x39')]=_[_0x8442('0x37')](_0x20f594['model'],qs['fields'](_0x486984[_0x8442('0x34')][_0x8442('0x38')]));_0x570cd2[_0x8442('0x39')]=_0x570cd2[_0x8442('0x39')][_0x8442('0x3a')]?_0x570cd2['attributes']:_0x20f594['model'];if(_0x486984[_0x8442('0x34')]['includeAll']){_0x570cd2[_0x8442('0x49')]=[{'all':!![]}];}_0x570cd2=_[_0x8442('0x42')]({},_0x570cd2,_0x486984[_0x8442('0x44')]);return db[_0x8442('0x30')]['find'](_0x570cd2)[_0x8442('0x27')](handleEntityNotFound(_0x38ded7,null))[_0x8442('0x27')](respondWithResult(_0x38ded7,null))[_0x8442('0x47')](handleError(_0x38ded7,null));};exports[_0x8442('0x4a')]=function(_0x53dfb8,_0x3c4f63){return db[_0x8442('0x30')][_0x8442('0x4a')](_0x53dfb8[_0x8442('0x4b')],{})[_0x8442('0x27')](respondWithResult(_0x3c4f63,0xc9))[_0x8442('0x47')](handleError(_0x3c4f63,null));};exports[_0x8442('0x4c')]=function(_0x6dbecb,_0x4b1095){if(_0x6dbecb[_0x8442('0x4b')]['id']){delete _0x6dbecb['body']['id'];}return db['SugarcrmAccount'][_0x8442('0x4d')]({'where':{'id':_0x6dbecb[_0x8442('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b1095,null))[_0x8442('0x27')](saveUpdates(_0x6dbecb['body'],null))['then'](respondWithResult(_0x4b1095,null))[_0x8442('0x47')](handleError(_0x4b1095,null));};exports[_0x8442('0x28')]=function(_0x441854,_0x5ec901){return db[_0x8442('0x30')][_0x8442('0x4d')]({'where':{'id':_0x441854[_0x8442('0x4e')]['id']}})[_0x8442('0x27')](handleEntityNotFound(_0x5ec901,null))[_0x8442('0x27')](removeEntity(_0x5ec901,null))[_0x8442('0x47')](handleError(_0x5ec901,null));};exports[_0x8442('0x4f')]=function(_0x223468,_0x86f7f3,_0x85635d){var _0x204c3e={};var _0x4fa134={};var _0x166097;var _0x1ab741;return db[_0x8442('0x30')]['findOne']({'where':{'id':_0x223468[_0x8442('0x4e')]['id']}})[_0x8442('0x27')](handleEntityNotFound(_0x86f7f3,null))[_0x8442('0x27')](function(_0x4058e3){if(_0x4058e3){_0x166097=_0x4058e3;_0x4fa134[_0x8442('0x33')]=_['keys'](db[_0x8442('0x50')][_0x8442('0x48')]);_0x4fa134[_0x8442('0x34')]=_[_0x8442('0x35')](_0x223468[_0x8442('0x34')]);_0x4fa134[_0x8442('0x36')]=_[_0x8442('0x37')](_0x4fa134[_0x8442('0x33')],_0x4fa134['query']);_0x204c3e['attributes']=_[_0x8442('0x37')](_0x4fa134['model'],qs['fields'](_0x223468['query'][_0x8442('0x38')]));_0x204c3e[_0x8442('0x39')]=_0x204c3e['attributes']['length']?_0x204c3e[_0x8442('0x39')]:_0x4fa134[_0x8442('0x33')];_0x204c3e[_0x8442('0x3d')]=qs[_0x8442('0x3e')](_0x223468[_0x8442('0x34')][_0x8442('0x3e')]);_0x204c3e['where']=qs[_0x8442('0x36')](_['pick'](_0x223468[_0x8442('0x34')],_0x4fa134[_0x8442('0x36')]));if(_0x223468[_0x8442('0x34')][_0x8442('0x41')]){_0x204c3e[_0x8442('0x3f')]=_[_0x8442('0x42')](_0x204c3e[_0x8442('0x3f')],{'$or':_[_0x8442('0x2f')](_0x204c3e[_0x8442('0x39')],function(_0x2f0167){var _0x325dcc={};_0x325dcc[_0x2f0167]={'$like':'%'+_0x223468[_0x8442('0x34')][_0x8442('0x41')]+'%'};return _0x325dcc;})});}_0x204c3e=_[_0x8442('0x42')]({},_0x204c3e,_0x223468[_0x8442('0x44')]);return _0x166097[_0x8442('0x4f')](_0x204c3e);}})['then'](function(_0x2c9d1a){if(_0x2c9d1a){_0x1ab741=_0x2c9d1a[_0x8442('0x3a')];if(!_0x223468['query'][_0x8442('0x3b')](_0x8442('0x3c'))){_0x204c3e['limit']=qs[_0x8442('0x1e')](_0x223468[_0x8442('0x34')][_0x8442('0x1e')]);_0x204c3e[_0x8442('0x21')]=qs[_0x8442('0x21')](_0x223468[_0x8442('0x34')]['offset']);}return _0x166097[_0x8442('0x4f')](_0x204c3e);}})[_0x8442('0x27')](function(_0x204a8d){if(_0x204a8d){return _0x204a8d?{'count':_0x1ab741,'rows':_0x204a8d}:null;}})[_0x8442('0x27')](respondWithResult(_0x86f7f3,null))[_0x8442('0x47')](handleError(_0x86f7f3,null));};exports[_0x8442('0x51')]=function(_0x335f43,_0x54936d,_0xfba2f2){if(_0x335f43[_0x8442('0x4b')]['id']){delete _0x335f43['body']['id'];}return db[_0x8442('0x30')]['findOne']({'where':{'id':_0x335f43[_0x8442('0x4e')]['id']}})[_0x8442('0x27')](handleEntityNotFound(_0x54936d,null))[_0x8442('0x27')](function(_0x5cbc7f){if(_0x5cbc7f){_0x335f43[_0x8442('0x4b')][_0x8442('0x52')]=_0x5cbc7f['id'];_0x335f43[_0x8442('0x4b')][_0x8442('0x53')]=integrations[_0x8442('0x54')](_0x335f43[_0x8442('0x4b')][_0x8442('0x55')],_0x335f43['body']['type']);_0x335f43[_0x8442('0x4b')][_0x8442('0x56')]=integrations[_0x8442('0x57')](_0x335f43[_0x8442('0x4b')][_0x8442('0x55')],_0x335f43[_0x8442('0x4b')]['type']);return db[_0x8442('0x50')][_0x8442('0x4a')](_0x335f43[_0x8442('0x4b')],{'include':[{'model':db[_0x8442('0x58')],'as':'Subjects'},{'model':db[_0x8442('0x58')],'as':_0x8442('0x56')}]});}return null;})[_0x8442('0x27')](respondWithResult(_0x54936d,null))[_0x8442('0x47')](handleError(_0x54936d,null));};exports[_0x8442('0x59')]=function(_0xbfc418,_0x2596e1,_0x576dea){var _0x509c67='';var _0x22d2ab=['id',_0x8442('0x2c'),_0x8442('0x5a'),_0x8442('0x5b'),_0x8442('0x5c'),_0x8442('0x5d'),'duration_hours',_0x8442('0x5e'),_0x8442('0x5f'),'parent_type',_0x8442('0x60'),_0x8442('0x61')];return db[_0x8442('0x30')][_0x8442('0x62')]({'where':{'id':_0xbfc418[_0x8442('0x4e')]['id']},'attributes':['id',_0x8442('0x63'),_0x8442('0x64'),'remoteUri']})[_0x8442('0x27')](handleEntityNotFound(_0x2596e1,null))[_0x8442('0x27')](function(_0x287fe6){if(_0x287fe6){_0x509c67=_0x287fe6[_0x8442('0x65')];var _0x118da5=_0x509c67[_0x8442('0x66')](-0x1);if(_0x118da5==='/'){_0x509c67=_0x509c67[_0x8442('0x67')](0x0,_0x509c67[_0x8442('0x68')](_0x118da5));}return rp({'method':_0x8442('0x69'),'uri':util[_0x8442('0x6a')](_0x8442('0x6b'),_0x509c67,_0x8442('0x6c')),'json':!![],'form':{'method':_0x8442('0x6d'),'input_type':_0x8442('0x6e'),'response_type':_0x8442('0x6e'),'rest_data':JSON[_0x8442('0x6f')]({'user_auth':{'user_name':_0x287fe6[_0x8442('0x63')],'password':_0x287fe6[_0x8442('0x64')],'encryption':_0x8442('0x70')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x8442('0x27')](function(_0x33beb9){if(_0x33beb9&&_0x33beb9[_0x8442('0x2c')]!==_0x8442('0x71')&&_0x33beb9['name']!=='Password\x20Expired'){return rp({'method':_0x8442('0x69'),'uri':util['format'](_0x8442('0x6b'),_0x509c67,_0x8442('0x6c')),'json':!![],'form':{'method':_0x8442('0x72'),'input_type':_0x8442('0x6e'),'response_type':_0x8442('0x6e'),'rest_data':JSON['stringify']({'session':_0x33beb9['id'],'module_name':_0x8442('0x73')})}})['then'](function(_0x50f3aa){if(_0x50f3aa){var _0xcb895e=_[_0x8442('0x74')](_0x50f3aa[_0x8442('0x75')]);_['remove'](_0xcb895e,function(_0x4412e7){return _0x22d2ab['includes'](_0x4412e7[_0x8442('0x2c')]);});return{'count':_0xcb895e[_0x8442('0x3a')],'rows':_['map'](_0xcb895e,function(_0x46dcb6){return{'id':_0x46dcb6[_0x8442('0x2c')],'name':_0x46dcb6[_0x8442('0x76')],'custom':_['endsWith'](_0x46dcb6[_0x8442('0x2c')],'_c')?!![]:![],'options':_0x46dcb6[_0x8442('0x44')]?_[_0x8442('0x2f')](_[_0x8442('0x74')](_0x46dcb6['options']),function(_0x3770af){return{'name':_0x3770af[_0x8442('0x77')],'value':_0x3770af['name']};}):[]};})};}})[_0x8442('0x27')](respondWithResult(_0x2596e1,null))[_0x8442('0x47')](function(_0x5cb7a1){var _0x58d4c2=_0xbfc418['query']['test']?0x1f4:_0x5cb7a1[_0x8442('0x78')]||0x1f4;logger[_0x8442('0x2a')](_0x8442('0x79'),_0x8442('0x59'),_0x58d4c2,JSON[_0x8442('0x6f')](_0x5cb7a1));delete _0x5cb7a1[_0x8442('0x2c')];if(_0x58d4c2===0x191){_0x58d4c2=0x190;}_0x2596e1[_0x8442('0x1c')](_0x58d4c2)[_0x8442('0x2d')](_0xbfc418[_0x8442('0x34')][_0x8442('0x7a')]?{'message':_0x8442('0x7b'),'statusCode':_0x5cb7a1['statusCode']}:_0x5cb7a1);});}else{var _0x15d9cc=0x1f4;_0x2596e1[_0x8442('0x1c')](_0x15d9cc)['send']({'message':_0x8442('0x7b'),'statusCode':0x190});}});};
\ No newline at end of file
index 07c75d1..8b18e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11b1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','util'];(function(_0x4d774b,_0x13b67c){var _0x5017b1=function(_0x54dae6){while(--_0x54dae6){_0x4d774b['push'](_0x4d774b['shift']());}};_0x5017b1(++_0x13b67c);}(_0x11b1,0x1ed));var _0x111b=function(_0x1a23f9,_0xf1da2e){_0x1a23f9=_0x1a23f9-0x0;var _0x5d25f6=_0x11b1[_0x1a23f9];return _0x5d25f6;};'use strict';var _=require('lodash');var util=require(_0x111b('0x0'));var logger=require(_0x111b('0x1'))(_0x111b('0x2'));var moment=require(_0x111b('0x3'));var BPromise=require(_0x111b('0x4'));var rp=require(_0x111b('0x5'));var fs=require('fs');var path=require(_0x111b('0x6'));var rimraf=require(_0x111b('0x7'));var config=require(_0x111b('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x111b('0x9'));module['exports']=function(_0x549abb,_0x148c3b){return _0x549abb[_0x111b('0xa')](_0x111b('0xb'),attributes,{'tableName':_0x111b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1d6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','lodash','util','../../config/logger'];(function(_0x3500d5,_0x2062fd){var _0x37e58a=function(_0x143a35){while(--_0x143a35){_0x3500d5['push'](_0x3500d5['shift']());}};_0x37e58a(++_0x2062fd);}(_0xf1d6,0x135));var _0x6f1d=function(_0x380b5c,_0x196ad9){_0x380b5c=_0x380b5c-0x0;var _0xfd1319=_0xf1d6[_0x380b5c];return _0xfd1319;};'use strict';var _=require(_0x6f1d('0x0'));var util=require(_0x6f1d('0x1'));var logger=require(_0x6f1d('0x2'))(_0x6f1d('0x3'));var moment=require(_0x6f1d('0x4'));var BPromise=require(_0x6f1d('0x5'));var rp=require(_0x6f1d('0x6'));var fs=require('fs');var path=require(_0x6f1d('0x7'));var rimraf=require(_0x6f1d('0x8'));var config=require(_0x6f1d('0x9'));var attributes=require(_0x6f1d('0xa'));var integrations=require(_0x6f1d('0xb'));module['exports']=function(_0x3d7f23,_0x284cf4){return _0x3d7f23[_0x6f1d('0xc')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ccf84bb..a927fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44cd=['limit','include','model','map','ShowSugarcrmAccount','SugarcrmAccount','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x44cd,0xe7));var _0xd44c=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x44cd[_0x4e7c1c];return _0x47adb2;};'use strict';var _=require('lodash');var util=require(_0xd44c('0x0'));var moment=require(_0xd44c('0x1'));var BPromise=require(_0xd44c('0x2'));var rs=require(_0xd44c('0x3'));var fs=require('fs');var Redis=require(_0xd44c('0x4'));var db=require(_0xd44c('0x5'))['db'];var utils=require(_0xd44c('0x6'));var logger=require(_0xd44c('0x7'))(_0xd44c('0x8'));var config=require('../../config/environment');var jayson=require(_0xd44c('0x9'));var client=jayson[_0xd44c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43cb5f,_0xcb5df1,_0xae3b5){return new BPromise(function(_0x3146df,_0x8a7bf6){return client['request'](_0x43cb5f,_0xae3b5)['then'](function(_0x347095){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xcb5df1,_0xd44c('0xb'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xcb5df1,_0xd44c('0xb'),JSON[_0xd44c('0xc')](_0x347095));if(_0x347095[_0xd44c('0xd')]){if(_0x347095[_0xd44c('0xd')][_0xd44c('0xe')]===0x1f4){logger[_0xd44c('0xd')](_0xd44c('0xf'),_0xcb5df1,_0x347095[_0xd44c('0xd')][_0xd44c('0x10')]);return _0x8a7bf6(_0x347095[_0xd44c('0xd')]['message']);}logger['error'](_0xd44c('0xf'),_0xcb5df1,_0x347095[_0xd44c('0xd')]['message']);return _0x3146df(_0x347095['error'][_0xd44c('0x10')]);}else{logger[_0xd44c('0x11')](_0xd44c('0xf'),_0xcb5df1,'request\x20sent');_0x3146df(_0x347095['result'][_0xd44c('0x10')]);}})[_0xd44c('0x12')](function(_0x64ec0){logger[_0xd44c('0xd')](_0xd44c('0xf'),_0xcb5df1,_0x64ec0);_0x8a7bf6(_0x64ec0);});});}exports[_0xd44c('0x13')]=function(_0x2fd306){var _0x19393c=this;return new Promise(function(_0x2aef45,_0x204d75){return db['SugarcrmAccount'][_0xd44c('0x14')]({'raw':_0x2fd306[_0xd44c('0x15')]?_0x2fd306[_0xd44c('0x15')][_0xd44c('0x16')]===undefined?!![]:![]:!![],'where':_0x2fd306[_0xd44c('0x15')]?_0x2fd306[_0xd44c('0x15')][_0xd44c('0x17')]||null:null,'attributes':_0x2fd306[_0xd44c('0x15')]?_0x2fd306[_0xd44c('0x15')][_0xd44c('0x18')]||null:null,'limit':_0x2fd306['options']?_0x2fd306[_0xd44c('0x15')][_0xd44c('0x19')]||null:null,'include':_0x2fd306['options']?_0x2fd306[_0xd44c('0x15')][_0xd44c('0x1a')]?_['map'](_0x2fd306[_0xd44c('0x15')][_0xd44c('0x1a')],function(_0x1f9bae){return{'model':db[_0x1f9bae[_0xd44c('0x1b')]],'as':_0x1f9bae['as'],'attributes':_0x1f9bae[_0xd44c('0x18')],'include':_0x1f9bae[_0xd44c('0x1a')]?_[_0xd44c('0x1c')](_0x1f9bae[_0xd44c('0x1a')],function(_0x528b44){return{'model':db[_0x528b44[_0xd44c('0x1b')]],'as':_0x528b44['as'],'attributes':_0x528b44[_0xd44c('0x18')],'include':_0x528b44[_0xd44c('0x1a')]?_[_0xd44c('0x1c')](_0x528b44['include'],function(_0x1a5611){return{'model':db[_0x1a5611[_0xd44c('0x1b')]],'as':_0x1a5611['as'],'attributes':_0x1a5611[_0xd44c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e0f97){logger[_0xd44c('0x11')](_0xd44c('0x13'),_0x2fd306);logger['debug']('GetSugarcrmAccount',_0x2fd306,JSON[_0xd44c('0xc')](_0x5e0f97));_0x2aef45(_0x5e0f97);})[_0xd44c('0x12')](function(_0x4441a5){logger[_0xd44c('0xd')](_0xd44c('0x13'),_0x4441a5['message'],_0x2fd306);_0x204d75(_0x19393c[_0xd44c('0xd')](0x1f4,_0x4441a5[_0xd44c('0x10')]));});});};exports[_0xd44c('0x1d')]=function(_0x41aa5f){var _0x16fea4=this;return new Promise(function(_0x217d2d,_0x400a87){return db[_0xd44c('0x1e')]['find']({'raw':_0x41aa5f['options']?_0x41aa5f[_0xd44c('0x15')][_0xd44c('0x16')]===undefined?!![]:![]:!![],'where':_0x41aa5f[_0xd44c('0x15')]?_0x41aa5f[_0xd44c('0x15')][_0xd44c('0x17')]||null:null,'attributes':_0x41aa5f[_0xd44c('0x15')]?_0x41aa5f['options'][_0xd44c('0x18')]||null:null,'include':_0x41aa5f[_0xd44c('0x15')]?_0x41aa5f['options'][_0xd44c('0x1a')]?_['map'](_0x41aa5f['options']['include'],function(_0x5bbab9){return{'model':db[_0x5bbab9['model']],'as':_0x5bbab9['as'],'attributes':_0x5bbab9[_0xd44c('0x18')],'include':_0x5bbab9['include']?_['map'](_0x5bbab9[_0xd44c('0x1a')],function(_0x116b23){return{'model':db[_0x116b23[_0xd44c('0x1b')]],'as':_0x116b23['as'],'attributes':_0x116b23[_0xd44c('0x18')],'include':_0x116b23[_0xd44c('0x1a')]?_[_0xd44c('0x1c')](_0x116b23['include'],function(_0x2dfe4a){return{'model':db[_0x2dfe4a['model']],'as':_0x2dfe4a['as'],'attributes':_0x2dfe4a[_0xd44c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd44c('0x1f')](function(_0x5806d0){logger[_0xd44c('0x11')](_0xd44c('0x1d'),_0x41aa5f);logger['debug']('ShowSugarcrmAccount',_0x41aa5f,JSON[_0xd44c('0xc')](_0x5806d0));_0x217d2d(_0x5806d0);})[_0xd44c('0x12')](function(_0x42c4de){logger[_0xd44c('0xd')](_0xd44c('0x1d'),_0x42c4de[_0xd44c('0x10')],_0x41aa5f);_0x400a87(_0x16fea4[_0xd44c('0xd')](0x1f4,_0x42c4de[_0xd44c('0x10')]));});});};
\ No newline at end of file
+var _0x32b2=['catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result'];(function(_0x261abd,_0x2f2e52){var _0x345c8e=function(_0x5841ee){while(--_0x5841ee){_0x261abd['push'](_0x261abd['shift']());}};_0x345c8e(++_0x2f2e52);}(_0x32b2,0xdb));var _0x232b=function(_0x5debd6,_0x554e98){_0x5debd6=_0x5debd6-0x0;var _0x458cb2=_0x32b2[_0x5debd6];return _0x458cb2;};'use strict';var _=require('lodash');var util=require(_0x232b('0x0'));var moment=require(_0x232b('0x1'));var BPromise=require('bluebird');var rs=require(_0x232b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x232b('0x3'))['db'];var utils=require(_0x232b('0x4'));var logger=require(_0x232b('0x5'))(_0x232b('0x6'));var config=require(_0x232b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x232b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x129d64,_0xed5060,_0x32c80b){return new BPromise(function(_0x11cfe9,_0x297e85){return client[_0x232b('0x9')](_0x129d64,_0x32c80b)['then'](function(_0x55181e){logger[_0x232b('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0xed5060,_0x232b('0xb'));logger[_0x232b('0xc')](_0x232b('0xd'),_0xed5060,_0x232b('0xb'),JSON['stringify'](_0x55181e));if(_0x55181e[_0x232b('0xe')]){if(_0x55181e[_0x232b('0xe')][_0x232b('0xf')]===0x1f4){logger[_0x232b('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0xed5060,_0x55181e['error'][_0x232b('0x10')]);return _0x297e85(_0x55181e[_0x232b('0xe')]['message']);}logger[_0x232b('0xe')](_0x232b('0x11'),_0xed5060,_0x55181e[_0x232b('0xe')][_0x232b('0x10')]);return _0x11cfe9(_0x55181e['error'][_0x232b('0x10')]);}else{logger[_0x232b('0xa')](_0x232b('0x11'),_0xed5060,_0x232b('0xb'));_0x11cfe9(_0x55181e[_0x232b('0x12')][_0x232b('0x10')]);}})[_0x232b('0x13')](function(_0xba2ca2){logger['error'](_0x232b('0x11'),_0xed5060,_0xba2ca2);_0x297e85(_0xba2ca2);});});}exports['GetSugarcrmAccount']=function(_0x1a55c9){var _0x34601c=this;return new Promise(function(_0x173d8b,_0x3bbe46){return db[_0x232b('0x14')][_0x232b('0x15')]({'raw':_0x1a55c9[_0x232b('0x16')]?_0x1a55c9[_0x232b('0x16')][_0x232b('0x17')]===undefined?!![]:![]:!![],'where':_0x1a55c9[_0x232b('0x16')]?_0x1a55c9[_0x232b('0x16')][_0x232b('0x18')]||null:null,'attributes':_0x1a55c9['options']?_0x1a55c9[_0x232b('0x16')][_0x232b('0x19')]||null:null,'limit':_0x1a55c9['options']?_0x1a55c9[_0x232b('0x16')][_0x232b('0x1a')]||null:null,'include':_0x1a55c9['options']?_0x1a55c9[_0x232b('0x16')][_0x232b('0x1b')]?_['map'](_0x1a55c9[_0x232b('0x16')]['include'],function(_0x390933){return{'model':db[_0x390933[_0x232b('0x1c')]],'as':_0x390933['as'],'attributes':_0x390933[_0x232b('0x19')],'include':_0x390933[_0x232b('0x1b')]?_[_0x232b('0x1d')](_0x390933[_0x232b('0x1b')],function(_0x393ffb){return{'model':db[_0x393ffb['model']],'as':_0x393ffb['as'],'attributes':_0x393ffb[_0x232b('0x19')],'include':_0x393ffb[_0x232b('0x1b')]?_['map'](_0x393ffb[_0x232b('0x1b')],function(_0x5bd664){return{'model':db[_0x5bd664[_0x232b('0x1c')]],'as':_0x5bd664['as'],'attributes':_0x5bd664[_0x232b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x232b('0x1e')](function(_0x5ef4f7){logger[_0x232b('0xa')](_0x232b('0x1f'),_0x1a55c9);logger[_0x232b('0xc')](_0x232b('0x1f'),_0x1a55c9,JSON['stringify'](_0x5ef4f7));_0x173d8b(_0x5ef4f7);})[_0x232b('0x13')](function(_0x122083){logger[_0x232b('0xe')](_0x232b('0x1f'),_0x122083[_0x232b('0x10')],_0x1a55c9);_0x3bbe46(_0x34601c['error'](0x1f4,_0x122083[_0x232b('0x10')]));});});};exports[_0x232b('0x20')]=function(_0xab6218){var _0x23024e=this;return new Promise(function(_0x3d675f,_0x3ede79){return db['SugarcrmAccount'][_0x232b('0x21')]({'raw':_0xab6218[_0x232b('0x16')]?_0xab6218[_0x232b('0x16')][_0x232b('0x17')]===undefined?!![]:![]:!![],'where':_0xab6218[_0x232b('0x16')]?_0xab6218[_0x232b('0x16')][_0x232b('0x18')]||null:null,'attributes':_0xab6218[_0x232b('0x16')]?_0xab6218[_0x232b('0x16')][_0x232b('0x19')]||null:null,'include':_0xab6218[_0x232b('0x16')]?_0xab6218[_0x232b('0x16')][_0x232b('0x1b')]?_[_0x232b('0x1d')](_0xab6218[_0x232b('0x16')][_0x232b('0x1b')],function(_0x33d1f5){return{'model':db[_0x33d1f5[_0x232b('0x1c')]],'as':_0x33d1f5['as'],'attributes':_0x33d1f5[_0x232b('0x19')],'include':_0x33d1f5[_0x232b('0x1b')]?_[_0x232b('0x1d')](_0x33d1f5[_0x232b('0x1b')],function(_0x3182ce){return{'model':db[_0x3182ce[_0x232b('0x1c')]],'as':_0x3182ce['as'],'attributes':_0x3182ce['attributes'],'include':_0x3182ce[_0x232b('0x1b')]?_[_0x232b('0x1d')](_0x3182ce[_0x232b('0x1b')],function(_0x11d218){return{'model':db[_0x11d218['model']],'as':_0x11d218['as'],'attributes':_0x11d218[_0x232b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x232b('0x1e')](function(_0x1af2b8){logger[_0x232b('0xa')]('ShowSugarcrmAccount',_0xab6218);logger[_0x232b('0xc')](_0x232b('0x20'),_0xab6218,JSON['stringify'](_0x1af2b8));_0x3d675f(_0x1af2b8);})[_0x232b('0x13')](function(_0x507220){logger['error'](_0x232b('0x20'),_0x507220[_0x232b('0x10')],_0xab6218);_0x3ede79(_0x23024e[_0x232b('0xe')](0x1f4,_0x507220[_0x232b('0x10')]));});});};
\ No newline at end of file
index 318261d..c7dd7e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b38=['update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x26d122,_0x581aa6){var _0x5b2754=function(_0x587dca){while(--_0x587dca){_0x26d122['push'](_0x26d122['shift']());}};_0x5b2754(++_0x581aa6);}(_0x8b38,0xca));var _0x88b3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8b38[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var path=require(_0x88b3('0x2'));var timeout=require(_0x88b3('0x3'));var express=require(_0x88b3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x88b3('0x5'));var interaction=require(_0x88b3('0x6'));var config=require(_0x88b3('0x7'));var controller=require(_0x88b3('0x8'));router[_0x88b3('0x9')]('/',auth[_0x88b3('0xa')](),controller[_0x88b3('0xb')]);router['get'](_0x88b3('0xc'),auth[_0x88b3('0xa')](),controller['show']);router[_0x88b3('0x9')]('/:id/fields',auth[_0x88b3('0xa')](),controller['getFields']);router[_0x88b3('0x9')](_0x88b3('0xd'),auth[_0x88b3('0xa')](),controller['getSubjects']);router[_0x88b3('0x9')](_0x88b3('0xe'),auth[_0x88b3('0xa')](),controller[_0x88b3('0xf')]);router[_0x88b3('0x10')]('/',auth[_0x88b3('0xa')](),controller[_0x88b3('0x11')]);router['put']('/:id',auth[_0x88b3('0xa')](),controller[_0x88b3('0x12')]);router['delete'](_0x88b3('0xc'),auth[_0x88b3('0xa')](),controller['destroy']);module[_0x88b3('0x13')]=router;
\ No newline at end of file
+var _0x43b5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getDescriptions','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x391c1c,_0x55ce3d){var _0x5eb580=function(_0x1ce093){while(--_0x1ce093){_0x391c1c['push'](_0x391c1c['shift']());}};_0x5eb580(++_0x55ce3d);}(_0x43b5,0xc3));var _0x543b=function(_0x29fccd,_0x25f32d){_0x29fccd=_0x29fccd-0x0;var _0x48aa25=_0x43b5[_0x29fccd];return _0x48aa25;};'use strict';var multer=require(_0x543b('0x0'));var util=require(_0x543b('0x1'));var path=require(_0x543b('0x2'));var timeout=require(_0x543b('0x3'));var express=require(_0x543b('0x4'));var router=express[_0x543b('0x5')]();var fs_extra=require(_0x543b('0x6'));var auth=require(_0x543b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x543b('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x543b('0x9')]('/',auth[_0x543b('0xa')](),controller[_0x543b('0xb')]);router[_0x543b('0x9')]('/:id',auth[_0x543b('0xa')](),controller[_0x543b('0xc')]);router['get'](_0x543b('0xd'),auth[_0x543b('0xa')](),controller['getFields']);router['get'](_0x543b('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x543b('0xa')](),controller[_0x543b('0xf')]);router[_0x543b('0x10')]('/',auth[_0x543b('0xa')](),controller[_0x543b('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x543b('0x12')]);router[_0x543b('0x13')]('/:id',auth[_0x543b('0xa')](),controller[_0x543b('0x14')]);module[_0x543b('0x15')]=router;
\ No newline at end of file
index d84fcd8..2113356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3caf=['sequelize','STRING'];(function(_0x184b2b,_0x59bd8d){var _0x25d2a6=function(_0x497db8){while(--_0x497db8){_0x184b2b['push'](_0x184b2b['shift']());}};_0x25d2a6(++_0x59bd8d);}(_0x3caf,0x12a));var _0xf3ca=function(_0x2fa371,_0x50a68b){_0x2fa371=_0x2fa371-0x0;var _0x36744a=_0x3caf[_0x2fa371];return _0x36744a;};'use strict';var Sequelize=require(_0xf3ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xf3ca('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xde71=['exports','STRING','sequelize'];(function(_0x4ca9b4,_0x5075f5){var _0x433d97=function(_0x42fe25){while(--_0x42fe25){_0x4ca9b4['push'](_0x4ca9b4['shift']());}};_0x433d97(++_0x5075f5);}(_0xde71,0x1af));var _0x1de7=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xde71[_0x32729c];return _0x482cfd;};'use strict';var Sequelize=require(_0x1de7('0x0'));module[_0x1de7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1de7('0x2')]}};
\ No newline at end of file
index ad81a0a..22fa141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa44=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','rows','catch','show','params','includeAll','include','find','create','body','update','getFields','sort','options','getSubjects','findOne','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0xfce277,_0x2f4ca5){var _0x464029=function(_0x126fcf){while(--_0x126fcf){_0xfce277['push'](_0xfce277['shift']());}};_0x464029(++_0x2f4ca5);}(_0xfa44,0x11c));var _0x4fa4=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xfa44[_0x3f993e];return _0x39c135;};'use strict';var emlformat=require(_0x4fa4('0x0'));var rimraf=require(_0x4fa4('0x1'));var zipdir=require(_0x4fa4('0x2'));var jsonpatch=require(_0x4fa4('0x3'));var rp=require(_0x4fa4('0x4'));var moment=require(_0x4fa4('0x5'));var BPromise=require(_0x4fa4('0x6'));var Mustache=require(_0x4fa4('0x7'));var util=require('util');var path=require(_0x4fa4('0x8'));var sox=require(_0x4fa4('0x9'));var csv=require(_0x4fa4('0xa'));var ejs=require(_0x4fa4('0xb'));var fs=require('fs');var fs_extra=require(_0x4fa4('0xc'));var _=require(_0x4fa4('0xd'));var squel=require(_0x4fa4('0xe'));var crypto=require(_0x4fa4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4fa4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4fa4('0x11'));var Papa=require(_0x4fa4('0x12'));var Redis=require('ioredis');var authService=require(_0x4fa4('0x13'));var qs=require(_0x4fa4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fa4('0x15'));var logger=require('../../config/logger')(_0x4fa4('0x16'));var utils=require(_0x4fa4('0x17'));var config=require(_0x4fa4('0x18'));var licenseUtil=require(_0x4fa4('0x19'));var db=require(_0x4fa4('0x1a'))['db'];function respondWithStatusCode(_0x1fc1c3,_0x42e1ff){_0x42e1ff=_0x42e1ff||0xcc;return function(_0x419ca9){if(_0x419ca9){return _0x1fc1c3[_0x4fa4('0x1b')](_0x42e1ff);}return _0x1fc1c3[_0x4fa4('0x1c')](_0x42e1ff)[_0x4fa4('0x1d')]();};}function respondWithResult(_0x5ef439,_0x20c0f2){_0x20c0f2=_0x20c0f2||0xc8;return function(_0x1ae004){if(_0x1ae004){return _0x5ef439['status'](_0x20c0f2)[_0x4fa4('0x1e')](_0x1ae004);}};}function respondWithFilteredResult(_0x384933,_0x5705c8){return function(_0x1e3586){if(_0x1e3586){var _0x397d3d=typeof _0x5705c8[_0x4fa4('0x1f')]===_0x4fa4('0x20')&&typeof _0x5705c8[_0x4fa4('0x21')]===_0x4fa4('0x20');var _0x5bf362=_0x1e3586['count'];var _0x297739=_0x397d3d?0x0:_0x5705c8[_0x4fa4('0x1f')];var _0x7cf43b=_0x397d3d?_0x1e3586[_0x4fa4('0x22')]:_0x5705c8['offset']+_0x5705c8[_0x4fa4('0x21')];var _0x1a7019;if(_0x7cf43b>=_0x5bf362){_0x7cf43b=_0x5bf362;_0x1a7019=0xc8;}else{_0x1a7019=0xce;}_0x384933[_0x4fa4('0x1c')](_0x1a7019);return _0x384933['set'](_0x4fa4('0x23'),_0x297739+'-'+_0x7cf43b+'/'+_0x5bf362)[_0x4fa4('0x1e')](_0x1e3586);}return null;};}function patchUpdates(_0x1e5bac){return function(_0x4ada61){try{jsonpatch[_0x4fa4('0x24')](_0x4ada61,_0x1e5bac,!![]);}catch(_0x140043){return BPromise[_0x4fa4('0x25')](_0x140043);}return _0x4ada61['save']();};}function saveUpdates(_0xbaaae1,_0x42fa82){return function(_0xdc41a2){if(_0xdc41a2){return _0xdc41a2['update'](_0xbaaae1)[_0x4fa4('0x26')](function(_0x5da16c){return _0x5da16c;});}return null;};}function removeEntity(_0xd013f1,_0x1e4eef){return function(_0x29ad31){if(_0x29ad31){return _0x29ad31[_0x4fa4('0x27')]()['then'](function(){_0xd013f1[_0x4fa4('0x1c')](0xcc)[_0x4fa4('0x1d')]();});}};}function handleEntityNotFound(_0x1b6142,_0x8d9e81){return function(_0x4fe5b8){if(!_0x4fe5b8){_0x1b6142['sendStatus'](0x194);}return _0x4fe5b8;};}function handleError(_0x3ff72c,_0x5e2c2c){_0x5e2c2c=_0x5e2c2c||0x1f4;return function(_0x5b4b78){logger[_0x4fa4('0x28')](_0x5b4b78[_0x4fa4('0x29')]);if(_0x5b4b78['name']){delete _0x5b4b78[_0x4fa4('0x2a')];}_0x3ff72c[_0x4fa4('0x1c')](_0x5e2c2c)[_0x4fa4('0x2b')](_0x5b4b78);};}exports[_0x4fa4('0x2c')]=function(_0x3336b6,_0x4aa411){var _0x32eded={},_0x5b7aaf={},_0x43d5ff={'count':0x0,'rows':[]};var _0x190c03=_[_0x4fa4('0x2d')](db[_0x4fa4('0x2e')][_0x4fa4('0x2f')],function(_0x106d54){return{'name':_0x106d54[_0x4fa4('0x30')],'type':_0x106d54[_0x4fa4('0x31')][_0x4fa4('0x32')]};});_0x5b7aaf[_0x4fa4('0x33')]=_[_0x4fa4('0x2d')](_0x190c03,_0x4fa4('0x2a'));_0x5b7aaf[_0x4fa4('0x34')]=_[_0x4fa4('0x35')](_0x3336b6[_0x4fa4('0x34')]);_0x5b7aaf[_0x4fa4('0x36')]=_[_0x4fa4('0x37')](_0x5b7aaf[_0x4fa4('0x33')],_0x5b7aaf[_0x4fa4('0x34')]);_0x32eded['attributes']=_[_0x4fa4('0x37')](_0x5b7aaf[_0x4fa4('0x33')],qs['fields'](_0x3336b6[_0x4fa4('0x34')][_0x4fa4('0x38')]));_0x32eded[_0x4fa4('0x39')]=_0x32eded[_0x4fa4('0x39')][_0x4fa4('0x3a')]?_0x32eded[_0x4fa4('0x39')]:_0x5b7aaf['model'];if(!_0x3336b6[_0x4fa4('0x34')][_0x4fa4('0x3b')](_0x4fa4('0x3c'))){_0x32eded[_0x4fa4('0x21')]=qs['limit'](_0x3336b6[_0x4fa4('0x34')][_0x4fa4('0x21')]);_0x32eded['offset']=qs[_0x4fa4('0x1f')](_0x3336b6['query'][_0x4fa4('0x1f')]);}_0x32eded[_0x4fa4('0x3d')]=qs['sort'](_0x3336b6[_0x4fa4('0x34')]['sort']);_0x32eded['where']=qs['filters'](_[_0x4fa4('0x3e')](_0x3336b6[_0x4fa4('0x34')],_0x5b7aaf[_0x4fa4('0x36')]),_0x190c03);if(_0x3336b6[_0x4fa4('0x34')][_0x4fa4('0x3f')]){_0x32eded[_0x4fa4('0x40')]=_[_0x4fa4('0x41')](_0x32eded[_0x4fa4('0x40')],{'$or':_[_0x4fa4('0x2d')](_0x190c03,function(_0x555f71){if(_0x555f71[_0x4fa4('0x31')]!==_0x4fa4('0x42')){var _0x2fa5fd={};_0x2fa5fd[_0x555f71['name']]={'$like':'%'+_0x3336b6[_0x4fa4('0x34')][_0x4fa4('0x3f')]+'%'};return _0x2fa5fd;}})});}_0x32eded=_['merge']({},_0x32eded,_0x3336b6['options']);var _0x316a4c={'where':_0x32eded[_0x4fa4('0x40')]};return db[_0x4fa4('0x2e')][_0x4fa4('0x22')](_0x316a4c)[_0x4fa4('0x26')](function(_0x2100a3){_0x43d5ff[_0x4fa4('0x22')]=_0x2100a3;if(_0x3336b6['query']['includeAll']){_0x32eded['include']=[{'all':!![]}];}return db[_0x4fa4('0x2e')]['findAll'](_0x32eded);})[_0x4fa4('0x26')](function(_0x495e72){_0x43d5ff[_0x4fa4('0x43')]=_0x495e72;return _0x43d5ff;})[_0x4fa4('0x26')](respondWithFilteredResult(_0x4aa411,_0x32eded))[_0x4fa4('0x44')](handleError(_0x4aa411,null));};exports[_0x4fa4('0x45')]=function(_0x5ef4ad,_0x1ea3cc){var _0x188ad4={'raw':![],'where':{'id':_0x5ef4ad[_0x4fa4('0x46')]['id']}},_0x506fdf={};_0x506fdf[_0x4fa4('0x33')]=_[_0x4fa4('0x35')](db[_0x4fa4('0x2e')][_0x4fa4('0x2f')]);_0x506fdf[_0x4fa4('0x34')]=_[_0x4fa4('0x35')](_0x5ef4ad[_0x4fa4('0x34')]);_0x506fdf['filters']=_[_0x4fa4('0x37')](_0x506fdf[_0x4fa4('0x33')],_0x506fdf[_0x4fa4('0x34')]);_0x188ad4[_0x4fa4('0x39')]=_[_0x4fa4('0x37')](_0x506fdf['model'],qs[_0x4fa4('0x38')](_0x5ef4ad[_0x4fa4('0x34')]['fields']));_0x188ad4[_0x4fa4('0x39')]=_0x188ad4[_0x4fa4('0x39')][_0x4fa4('0x3a')]?_0x188ad4['attributes']:_0x506fdf[_0x4fa4('0x33')];if(_0x5ef4ad[_0x4fa4('0x34')][_0x4fa4('0x47')]){_0x188ad4[_0x4fa4('0x48')]=[{'all':!![]}];}_0x188ad4=_[_0x4fa4('0x41')]({},_0x188ad4,_0x5ef4ad['options']);return db[_0x4fa4('0x2e')][_0x4fa4('0x49')](_0x188ad4)['then'](handleEntityNotFound(_0x1ea3cc,null))[_0x4fa4('0x26')](respondWithResult(_0x1ea3cc,null))[_0x4fa4('0x44')](handleError(_0x1ea3cc,null));};exports[_0x4fa4('0x4a')]=function(_0x1cc296,_0x3a74bd){return db[_0x4fa4('0x2e')][_0x4fa4('0x4a')](_0x1cc296[_0x4fa4('0x4b')],{})[_0x4fa4('0x26')](respondWithResult(_0x3a74bd,0xc9))['catch'](handleError(_0x3a74bd,null));};exports[_0x4fa4('0x4c')]=function(_0x5e3c0e,_0x10e342){if(_0x5e3c0e['body']['id']){delete _0x5e3c0e[_0x4fa4('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0x4fa4('0x49')]({'where':{'id':_0x5e3c0e[_0x4fa4('0x46')]['id']}})[_0x4fa4('0x26')](handleEntityNotFound(_0x10e342,null))[_0x4fa4('0x26')](saveUpdates(_0x5e3c0e[_0x4fa4('0x4b')],null))[_0x4fa4('0x26')](respondWithResult(_0x10e342,null))['catch'](handleError(_0x10e342,null));};exports[_0x4fa4('0x27')]=function(_0x45a21c,_0x3684b7){return db[_0x4fa4('0x2e')]['find']({'where':{'id':_0x45a21c['params']['id']}})[_0x4fa4('0x26')](handleEntityNotFound(_0x3684b7,null))['then'](removeEntity(_0x3684b7,null))[_0x4fa4('0x44')](handleError(_0x3684b7,null));};exports[_0x4fa4('0x4d')]=function(_0xe7cae4,_0xa408e1,_0x4fc2ee){var _0x6165a5={};var _0x120bc8={};var _0x565ca5;var _0x101f9b;return db[_0x4fa4('0x2e')]['findOne']({'where':{'id':_0xe7cae4[_0x4fa4('0x46')]['id']}})[_0x4fa4('0x26')](handleEntityNotFound(_0xa408e1,null))[_0x4fa4('0x26')](function(_0x39c545){if(_0x39c545){_0x565ca5=_0x39c545;_0x120bc8[_0x4fa4('0x33')]=_[_0x4fa4('0x35')](db['SugarcrmField'][_0x4fa4('0x2f')]);_0x120bc8[_0x4fa4('0x34')]=_[_0x4fa4('0x35')](_0xe7cae4[_0x4fa4('0x34')]);_0x120bc8['filters']=_['intersection'](_0x120bc8[_0x4fa4('0x33')],_0x120bc8[_0x4fa4('0x34')]);_0x6165a5[_0x4fa4('0x39')]=_[_0x4fa4('0x37')](_0x120bc8[_0x4fa4('0x33')],qs['fields'](_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x38')]));_0x6165a5['attributes']=_0x6165a5[_0x4fa4('0x39')][_0x4fa4('0x3a')]?_0x6165a5['attributes']:_0x120bc8[_0x4fa4('0x33')];_0x6165a5[_0x4fa4('0x3d')]=qs[_0x4fa4('0x4e')](_0xe7cae4['query'][_0x4fa4('0x4e')]);_0x6165a5[_0x4fa4('0x40')]=qs[_0x4fa4('0x36')](_['pick'](_0xe7cae4[_0x4fa4('0x34')],_0x120bc8[_0x4fa4('0x36')]));if(_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x3f')]){_0x6165a5[_0x4fa4('0x40')]=_[_0x4fa4('0x41')](_0x6165a5[_0x4fa4('0x40')],{'$or':_[_0x4fa4('0x2d')](_0x6165a5[_0x4fa4('0x39')],function(_0x84b430){var _0x3dc5be={};_0x3dc5be[_0x84b430]={'$like':'%'+_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x3f')]+'%'};return _0x3dc5be;})});}_0x6165a5=_[_0x4fa4('0x41')]({},_0x6165a5,_0xe7cae4[_0x4fa4('0x4f')]);return _0x565ca5[_0x4fa4('0x4d')](_0x6165a5);}})[_0x4fa4('0x26')](function(_0x38c7ef){if(_0x38c7ef){_0x101f9b=_0x38c7ef[_0x4fa4('0x3a')];if(!_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x3b')](_0x4fa4('0x3c'))){_0x6165a5['limit']=qs[_0x4fa4('0x21')](_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x21')]);_0x6165a5[_0x4fa4('0x1f')]=qs[_0x4fa4('0x1f')](_0xe7cae4[_0x4fa4('0x34')][_0x4fa4('0x1f')]);}return _0x565ca5[_0x4fa4('0x4d')](_0x6165a5);}})['then'](function(_0x46a649){if(_0x46a649){return _0x46a649?{'count':_0x101f9b,'rows':_0x46a649}:null;}})['then'](respondWithResult(_0xa408e1,null))[_0x4fa4('0x44')](handleError(_0xa408e1,null));};exports[_0x4fa4('0x50')]=function(_0x4e00e5,_0x18e85b,_0xd5d1e2){var _0x306e15={};var _0x3e5bd6={};var _0x57528e;var _0x4cd450;return db[_0x4fa4('0x2e')][_0x4fa4('0x51')]({'where':{'id':_0x4e00e5[_0x4fa4('0x46')]['id']}})[_0x4fa4('0x26')](handleEntityNotFound(_0x18e85b,null))[_0x4fa4('0x26')](function(_0x1d0e47){if(_0x1d0e47){_0x57528e=_0x1d0e47;_0x3e5bd6[_0x4fa4('0x33')]=_[_0x4fa4('0x35')](db[_0x4fa4('0x52')][_0x4fa4('0x2f')]);_0x3e5bd6[_0x4fa4('0x34')]=_[_0x4fa4('0x35')](_0x4e00e5[_0x4fa4('0x34')]);_0x3e5bd6[_0x4fa4('0x36')]=_['intersection'](_0x3e5bd6[_0x4fa4('0x33')],_0x3e5bd6[_0x4fa4('0x34')]);_0x306e15['attributes']=_[_0x4fa4('0x37')](_0x3e5bd6['model'],qs['fields'](_0x4e00e5[_0x4fa4('0x34')][_0x4fa4('0x38')]));_0x306e15[_0x4fa4('0x39')]=_0x306e15[_0x4fa4('0x39')][_0x4fa4('0x3a')]?_0x306e15[_0x4fa4('0x39')]:_0x3e5bd6['model'];_0x306e15[_0x4fa4('0x3d')]=qs[_0x4fa4('0x4e')](_0x4e00e5[_0x4fa4('0x34')][_0x4fa4('0x4e')]);_0x306e15[_0x4fa4('0x40')]=qs[_0x4fa4('0x36')](_['pick'](_0x4e00e5[_0x4fa4('0x34')],_0x3e5bd6[_0x4fa4('0x36')]));if(_0x4e00e5[_0x4fa4('0x34')][_0x4fa4('0x3f')]){_0x306e15[_0x4fa4('0x40')]=_[_0x4fa4('0x41')](_0x306e15['where'],{'$or':_[_0x4fa4('0x2d')](_0x306e15[_0x4fa4('0x39')],function(_0x2a60ad){var _0x32e289={};_0x32e289[_0x2a60ad]={'$like':'%'+_0x4e00e5['query'][_0x4fa4('0x3f')]+'%'};return _0x32e289;})});}_0x306e15=_[_0x4fa4('0x41')]({},_0x306e15,_0x4e00e5[_0x4fa4('0x4f')]);return _0x57528e[_0x4fa4('0x50')](_0x306e15);}})[_0x4fa4('0x26')](function(_0x367b57){if(_0x367b57){_0x4cd450=_0x367b57[_0x4fa4('0x3a')];if(!_0x4e00e5[_0x4fa4('0x34')]['hasOwnProperty'](_0x4fa4('0x3c'))){_0x306e15[_0x4fa4('0x21')]=qs[_0x4fa4('0x21')](_0x4e00e5[_0x4fa4('0x34')][_0x4fa4('0x21')]);_0x306e15[_0x4fa4('0x1f')]=qs[_0x4fa4('0x1f')](_0x4e00e5[_0x4fa4('0x34')][_0x4fa4('0x1f')]);}return _0x57528e[_0x4fa4('0x50')](_0x306e15);}})[_0x4fa4('0x26')](function(_0x849b60){if(_0x849b60){return _0x849b60?{'count':_0x4cd450,'rows':_0x849b60}:null;}})[_0x4fa4('0x26')](respondWithResult(_0x18e85b,null))[_0x4fa4('0x44')](handleError(_0x18e85b,null));};exports['getDescriptions']=function(_0x4d9c49,_0x3e271d,_0x342a88){var _0x108990={};var _0x432f85={};var _0x2d5f3a;var _0x24e587;return db[_0x4fa4('0x2e')][_0x4fa4('0x51')]({'where':{'id':_0x4d9c49['params']['id']}})[_0x4fa4('0x26')](handleEntityNotFound(_0x3e271d,null))['then'](function(_0x285aef){if(_0x285aef){_0x2d5f3a=_0x285aef;_0x432f85[_0x4fa4('0x33')]=_['keys'](db[_0x4fa4('0x52')][_0x4fa4('0x2f')]);_0x432f85[_0x4fa4('0x34')]=_['keys'](_0x4d9c49[_0x4fa4('0x34')]);_0x432f85[_0x4fa4('0x36')]=_[_0x4fa4('0x37')](_0x432f85['model'],_0x432f85[_0x4fa4('0x34')]);_0x108990[_0x4fa4('0x39')]=_[_0x4fa4('0x37')](_0x432f85['model'],qs[_0x4fa4('0x38')](_0x4d9c49[_0x4fa4('0x34')]['fields']));_0x108990['attributes']=_0x108990[_0x4fa4('0x39')]['length']?_0x108990[_0x4fa4('0x39')]:_0x432f85[_0x4fa4('0x33')];_0x108990[_0x4fa4('0x3d')]=qs[_0x4fa4('0x4e')](_0x4d9c49[_0x4fa4('0x34')][_0x4fa4('0x4e')]);_0x108990[_0x4fa4('0x40')]=qs[_0x4fa4('0x36')](_[_0x4fa4('0x3e')](_0x4d9c49['query'],_0x432f85[_0x4fa4('0x36')]));if(_0x4d9c49['query'][_0x4fa4('0x3f')]){_0x108990['where']=_[_0x4fa4('0x41')](_0x108990[_0x4fa4('0x40')],{'$or':_[_0x4fa4('0x2d')](_0x108990[_0x4fa4('0x39')],function(_0xd60c6b){var _0x98296={};_0x98296[_0xd60c6b]={'$like':'%'+_0x4d9c49[_0x4fa4('0x34')][_0x4fa4('0x3f')]+'%'};return _0x98296;})});}_0x108990=_[_0x4fa4('0x41')]({},_0x108990,_0x4d9c49[_0x4fa4('0x4f')]);return _0x2d5f3a[_0x4fa4('0x53')](_0x108990);}})['then'](function(_0x1c04b8){if(_0x1c04b8){_0x24e587=_0x1c04b8[_0x4fa4('0x3a')];if(!_0x4d9c49[_0x4fa4('0x34')][_0x4fa4('0x3b')]('nolimit')){_0x108990['limit']=qs[_0x4fa4('0x21')](_0x4d9c49[_0x4fa4('0x34')][_0x4fa4('0x21')]);_0x108990['offset']=qs[_0x4fa4('0x1f')](_0x4d9c49[_0x4fa4('0x34')][_0x4fa4('0x1f')]);}return _0x2d5f3a[_0x4fa4('0x53')](_0x108990);}})[_0x4fa4('0x26')](function(_0x32a20d){if(_0x32a20d){return _0x32a20d?{'count':_0x24e587,'rows':_0x32a20d}:null;}})[_0x4fa4('0x26')](respondWithResult(_0x3e271d,null))[_0x4fa4('0x44')](handleError(_0x3e271d,null));};
\ No newline at end of file
+var _0x7cb8=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmConfiguration','show','params','find','catch','create','body','findOne','SugarcrmField','pick','getFields','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5f19be,_0x43b908){var _0x2244b2=function(_0x2ec84d){while(--_0x2ec84d){_0x5f19be['push'](_0x5f19be['shift']());}};_0x2244b2(++_0x43b908);}(_0x7cb8,0x132));var _0x87cb=function(_0x144ecc,_0x247a97){_0x144ecc=_0x144ecc-0x0;var _0x50eccd=_0x7cb8[_0x144ecc];return _0x50eccd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87cb('0x1'));var rp=require(_0x87cb('0x2'));var moment=require(_0x87cb('0x3'));var BPromise=require(_0x87cb('0x4'));var Mustache=require(_0x87cb('0x5'));var util=require(_0x87cb('0x6'));var path=require(_0x87cb('0x7'));var sox=require(_0x87cb('0x8'));var csv=require('to-csv');var ejs=require(_0x87cb('0x9'));var fs=require('fs');var fs_extra=require(_0x87cb('0xa'));var _=require('lodash');var squel=require(_0x87cb('0xb'));var crypto=require(_0x87cb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x87cb('0xd'));var toCsv=require(_0x87cb('0xe'));var querystring=require(_0x87cb('0xf'));var Papa=require('papaparse');var Redis=require(_0x87cb('0x10'));var authService=require(_0x87cb('0x11'));var qs=require(_0x87cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87cb('0x13'));var logger=require(_0x87cb('0x14'))(_0x87cb('0x15'));var utils=require('../../config/utils');var config=require(_0x87cb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x87cb('0x17'))['db'];function respondWithStatusCode(_0x2f7228,_0xf3e11){_0xf3e11=_0xf3e11||0xcc;return function(_0x2e7f76){if(_0x2e7f76){return _0x2f7228[_0x87cb('0x18')](_0xf3e11);}return _0x2f7228[_0x87cb('0x19')](_0xf3e11)[_0x87cb('0x1a')]();};}function respondWithResult(_0x301ce7,_0x51bd45){_0x51bd45=_0x51bd45||0xc8;return function(_0x53d58d){if(_0x53d58d){return _0x301ce7[_0x87cb('0x19')](_0x51bd45)[_0x87cb('0x1b')](_0x53d58d);}};}function respondWithFilteredResult(_0x328908,_0xad536c){return function(_0x4b8af4){if(_0x4b8af4){var _0x3f6dcf=typeof _0xad536c[_0x87cb('0x1c')]==='undefined'&&typeof _0xad536c[_0x87cb('0x1d')]===_0x87cb('0x1e');var _0x198b97=_0x4b8af4[_0x87cb('0x1f')];var _0x34a1dc=_0x3f6dcf?0x0:_0xad536c[_0x87cb('0x1c')];var _0x1819c6=_0x3f6dcf?_0x4b8af4[_0x87cb('0x1f')]:_0xad536c[_0x87cb('0x1c')]+_0xad536c[_0x87cb('0x1d')];var _0x3294b8;if(_0x1819c6>=_0x198b97){_0x1819c6=_0x198b97;_0x3294b8=0xc8;}else{_0x3294b8=0xce;}_0x328908[_0x87cb('0x19')](_0x3294b8);return _0x328908[_0x87cb('0x20')](_0x87cb('0x21'),_0x34a1dc+'-'+_0x1819c6+'/'+_0x198b97)[_0x87cb('0x1b')](_0x4b8af4);}return null;};}function patchUpdates(_0x5c51d3){return function(_0x36aba9){try{jsonpatch[_0x87cb('0x22')](_0x36aba9,_0x5c51d3,!![]);}catch(_0x6919af){return BPromise[_0x87cb('0x23')](_0x6919af);}return _0x36aba9[_0x87cb('0x24')]();};}function saveUpdates(_0x30aae5,_0x3833e6){return function(_0x30d7d3){if(_0x30d7d3){return _0x30d7d3[_0x87cb('0x25')](_0x30aae5)[_0x87cb('0x26')](function(_0x12e231){return _0x12e231;});}return null;};}function removeEntity(_0x129041,_0x1fc389){return function(_0x6b243b){if(_0x6b243b){return _0x6b243b[_0x87cb('0x27')]()[_0x87cb('0x26')](function(){_0x129041['status'](0xcc)[_0x87cb('0x1a')]();});}};}function handleEntityNotFound(_0x338b15,_0x49f29f){return function(_0x5e20fd){if(!_0x5e20fd){_0x338b15['sendStatus'](0x194);}return _0x5e20fd;};}function handleError(_0x24ce19,_0x225115){_0x225115=_0x225115||0x1f4;return function(_0x2c02fb){logger[_0x87cb('0x28')](_0x2c02fb[_0x87cb('0x29')]);if(_0x2c02fb[_0x87cb('0x2a')]){delete _0x2c02fb[_0x87cb('0x2a')];}_0x24ce19['status'](_0x225115)[_0x87cb('0x2b')](_0x2c02fb);};}exports[_0x87cb('0x2c')]=function(_0xd27058,_0x31f33e){var _0x17401d={},_0x538fe2={},_0x1420d6={'count':0x0,'rows':[]};var _0x3c30b6=_[_0x87cb('0x2d')](db['SugarcrmConfiguration'][_0x87cb('0x2e')],function(_0x4fcb57){return{'name':_0x4fcb57[_0x87cb('0x2f')],'type':_0x4fcb57[_0x87cb('0x30')][_0x87cb('0x31')]};});_0x538fe2[_0x87cb('0x32')]=_['map'](_0x3c30b6,_0x87cb('0x2a'));_0x538fe2[_0x87cb('0x33')]=_[_0x87cb('0x34')](_0xd27058[_0x87cb('0x33')]);_0x538fe2[_0x87cb('0x35')]=_[_0x87cb('0x36')](_0x538fe2['model'],_0x538fe2[_0x87cb('0x33')]);_0x17401d[_0x87cb('0x37')]=_['intersection'](_0x538fe2[_0x87cb('0x32')],qs[_0x87cb('0x38')](_0xd27058['query']['fields']));_0x17401d[_0x87cb('0x37')]=_0x17401d[_0x87cb('0x37')][_0x87cb('0x39')]?_0x17401d[_0x87cb('0x37')]:_0x538fe2[_0x87cb('0x32')];if(!_0xd27058['query'][_0x87cb('0x3a')](_0x87cb('0x3b'))){_0x17401d[_0x87cb('0x1d')]=qs[_0x87cb('0x1d')](_0xd27058[_0x87cb('0x33')][_0x87cb('0x1d')]);_0x17401d[_0x87cb('0x1c')]=qs[_0x87cb('0x1c')](_0xd27058[_0x87cb('0x33')]['offset']);}_0x17401d[_0x87cb('0x3c')]=qs[_0x87cb('0x3d')](_0xd27058[_0x87cb('0x33')]['sort']);_0x17401d[_0x87cb('0x3e')]=qs['filters'](_['pick'](_0xd27058[_0x87cb('0x33')],_0x538fe2[_0x87cb('0x35')]),_0x3c30b6);if(_0xd27058['query'][_0x87cb('0x3f')]){_0x17401d[_0x87cb('0x3e')]=_[_0x87cb('0x40')](_0x17401d[_0x87cb('0x3e')],{'$or':_['map'](_0x3c30b6,function(_0x1a6096){if(_0x1a6096[_0x87cb('0x30')]!==_0x87cb('0x41')){var _0x1df90c={};_0x1df90c[_0x1a6096['name']]={'$like':'%'+_0xd27058[_0x87cb('0x33')][_0x87cb('0x3f')]+'%'};return _0x1df90c;}})});}_0x17401d=_[_0x87cb('0x40')]({},_0x17401d,_0xd27058[_0x87cb('0x42')]);var _0x3f1a35={'where':_0x17401d[_0x87cb('0x3e')]};return db['SugarcrmConfiguration'][_0x87cb('0x1f')](_0x3f1a35)[_0x87cb('0x26')](function(_0x112172){_0x1420d6[_0x87cb('0x1f')]=_0x112172;if(_0xd27058[_0x87cb('0x33')][_0x87cb('0x43')]){_0x17401d[_0x87cb('0x44')]=[{'all':!![]}];}return db[_0x87cb('0x45')]['findAll'](_0x17401d);})[_0x87cb('0x26')](function(_0xae5632){_0x1420d6['rows']=_0xae5632;return _0x1420d6;})['then'](respondWithFilteredResult(_0x31f33e,_0x17401d))['catch'](handleError(_0x31f33e,null));};exports[_0x87cb('0x46')]=function(_0x5eda2a,_0x55807f){var _0x356a88={'raw':![],'where':{'id':_0x5eda2a[_0x87cb('0x47')]['id']}},_0x5d8195={};_0x5d8195[_0x87cb('0x32')]=_['keys'](db['SugarcrmConfiguration'][_0x87cb('0x2e')]);_0x5d8195[_0x87cb('0x33')]=_['keys'](_0x5eda2a[_0x87cb('0x33')]);_0x5d8195['filters']=_[_0x87cb('0x36')](_0x5d8195[_0x87cb('0x32')],_0x5d8195[_0x87cb('0x33')]);_0x356a88[_0x87cb('0x37')]=_[_0x87cb('0x36')](_0x5d8195[_0x87cb('0x32')],qs[_0x87cb('0x38')](_0x5eda2a['query'][_0x87cb('0x38')]));_0x356a88['attributes']=_0x356a88['attributes'][_0x87cb('0x39')]?_0x356a88[_0x87cb('0x37')]:_0x5d8195[_0x87cb('0x32')];if(_0x5eda2a[_0x87cb('0x33')][_0x87cb('0x43')]){_0x356a88[_0x87cb('0x44')]=[{'all':!![]}];}_0x356a88=_['merge']({},_0x356a88,_0x5eda2a[_0x87cb('0x42')]);return db[_0x87cb('0x45')][_0x87cb('0x48')](_0x356a88)[_0x87cb('0x26')](handleEntityNotFound(_0x55807f,null))['then'](respondWithResult(_0x55807f,null))[_0x87cb('0x49')](handleError(_0x55807f,null));};exports[_0x87cb('0x4a')]=function(_0x8e7811,_0x11f6b4){return db['SugarcrmConfiguration'][_0x87cb('0x4a')](_0x8e7811[_0x87cb('0x4b')],{})['then'](respondWithResult(_0x11f6b4,0xc9))['catch'](handleError(_0x11f6b4,null));};exports[_0x87cb('0x25')]=function(_0x3adfcf,_0x24758a){if(_0x3adfcf[_0x87cb('0x4b')]['id']){delete _0x3adfcf['body']['id'];}return db[_0x87cb('0x45')]['find']({'where':{'id':_0x3adfcf[_0x87cb('0x47')]['id']}})[_0x87cb('0x26')](handleEntityNotFound(_0x24758a,null))[_0x87cb('0x26')](saveUpdates(_0x3adfcf[_0x87cb('0x4b')],null))[_0x87cb('0x26')](respondWithResult(_0x24758a,null))[_0x87cb('0x49')](handleError(_0x24758a,null));};exports[_0x87cb('0x27')]=function(_0x5740fc,_0x44df1f){return db[_0x87cb('0x45')]['find']({'where':{'id':_0x5740fc[_0x87cb('0x47')]['id']}})[_0x87cb('0x26')](handleEntityNotFound(_0x44df1f,null))['then'](removeEntity(_0x44df1f,null))[_0x87cb('0x49')](handleError(_0x44df1f,null));};exports['getFields']=function(_0x8c65f5,_0x5755bc,_0x47520a){var _0x47e77f={};var _0x53ad9f={};var _0x418961;var _0x34092f;return db[_0x87cb('0x45')][_0x87cb('0x4c')]({'where':{'id':_0x8c65f5['params']['id']}})[_0x87cb('0x26')](handleEntityNotFound(_0x5755bc,null))['then'](function(_0x550c99){if(_0x550c99){_0x418961=_0x550c99;_0x53ad9f[_0x87cb('0x32')]=_[_0x87cb('0x34')](db[_0x87cb('0x4d')]['rawAttributes']);_0x53ad9f[_0x87cb('0x33')]=_[_0x87cb('0x34')](_0x8c65f5[_0x87cb('0x33')]);_0x53ad9f[_0x87cb('0x35')]=_[_0x87cb('0x36')](_0x53ad9f[_0x87cb('0x32')],_0x53ad9f[_0x87cb('0x33')]);_0x47e77f[_0x87cb('0x37')]=_[_0x87cb('0x36')](_0x53ad9f[_0x87cb('0x32')],qs[_0x87cb('0x38')](_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x38')]));_0x47e77f[_0x87cb('0x37')]=_0x47e77f[_0x87cb('0x37')][_0x87cb('0x39')]?_0x47e77f[_0x87cb('0x37')]:_0x53ad9f[_0x87cb('0x32')];_0x47e77f[_0x87cb('0x3c')]=qs['sort'](_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x3d')]);_0x47e77f['where']=qs['filters'](_[_0x87cb('0x4e')](_0x8c65f5[_0x87cb('0x33')],_0x53ad9f[_0x87cb('0x35')]));if(_0x8c65f5[_0x87cb('0x33')]['filter']){_0x47e77f[_0x87cb('0x3e')]=_[_0x87cb('0x40')](_0x47e77f['where'],{'$or':_[_0x87cb('0x2d')](_0x47e77f[_0x87cb('0x37')],function(_0x4a0cd0){var _0x300d0b={};_0x300d0b[_0x4a0cd0]={'$like':'%'+_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x3f')]+'%'};return _0x300d0b;})});}_0x47e77f=_[_0x87cb('0x40')]({},_0x47e77f,_0x8c65f5[_0x87cb('0x42')]);return _0x418961[_0x87cb('0x4f')](_0x47e77f);}})['then'](function(_0x367cfd){if(_0x367cfd){_0x34092f=_0x367cfd[_0x87cb('0x39')];if(!_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x3a')](_0x87cb('0x3b'))){_0x47e77f[_0x87cb('0x1d')]=qs[_0x87cb('0x1d')](_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x1d')]);_0x47e77f[_0x87cb('0x1c')]=qs[_0x87cb('0x1c')](_0x8c65f5[_0x87cb('0x33')][_0x87cb('0x1c')]);}return _0x418961['getFields'](_0x47e77f);}})[_0x87cb('0x26')](function(_0x21537c){if(_0x21537c){return _0x21537c?{'count':_0x34092f,'rows':_0x21537c}:null;}})['then'](respondWithResult(_0x5755bc,null))[_0x87cb('0x49')](handleError(_0x5755bc,null));};exports['getSubjects']=function(_0x12774d,_0x96cd24,_0x8c2e34){var _0x5327c2={};var _0x47a27b={};var _0xbaeba1;var _0xaa9046;return db[_0x87cb('0x45')][_0x87cb('0x4c')]({'where':{'id':_0x12774d[_0x87cb('0x47')]['id']}})[_0x87cb('0x26')](handleEntityNotFound(_0x96cd24,null))[_0x87cb('0x26')](function(_0x5b51f5){if(_0x5b51f5){_0xbaeba1=_0x5b51f5;_0x47a27b[_0x87cb('0x32')]=_[_0x87cb('0x34')](db[_0x87cb('0x4d')]['rawAttributes']);_0x47a27b[_0x87cb('0x33')]=_[_0x87cb('0x34')](_0x12774d['query']);_0x47a27b['filters']=_[_0x87cb('0x36')](_0x47a27b[_0x87cb('0x32')],_0x47a27b[_0x87cb('0x33')]);_0x5327c2[_0x87cb('0x37')]=_['intersection'](_0x47a27b['model'],qs[_0x87cb('0x38')](_0x12774d['query'][_0x87cb('0x38')]));_0x5327c2[_0x87cb('0x37')]=_0x5327c2[_0x87cb('0x37')]['length']?_0x5327c2[_0x87cb('0x37')]:_0x47a27b[_0x87cb('0x32')];_0x5327c2[_0x87cb('0x3c')]=qs[_0x87cb('0x3d')](_0x12774d[_0x87cb('0x33')][_0x87cb('0x3d')]);_0x5327c2['where']=qs['filters'](_[_0x87cb('0x4e')](_0x12774d[_0x87cb('0x33')],_0x47a27b[_0x87cb('0x35')]));if(_0x12774d['query'][_0x87cb('0x3f')]){_0x5327c2['where']=_[_0x87cb('0x40')](_0x5327c2['where'],{'$or':_[_0x87cb('0x2d')](_0x5327c2['attributes'],function(_0x5be5ae){var _0x1ec69b={};_0x1ec69b[_0x5be5ae]={'$like':'%'+_0x12774d['query'][_0x87cb('0x3f')]+'%'};return _0x1ec69b;})});}_0x5327c2=_['merge']({},_0x5327c2,_0x12774d[_0x87cb('0x42')]);return _0xbaeba1[_0x87cb('0x50')](_0x5327c2);}})[_0x87cb('0x26')](function(_0x5ee306){if(_0x5ee306){_0xaa9046=_0x5ee306['length'];if(!_0x12774d['query'][_0x87cb('0x3a')]('nolimit')){_0x5327c2[_0x87cb('0x1d')]=qs['limit'](_0x12774d['query'][_0x87cb('0x1d')]);_0x5327c2['offset']=qs[_0x87cb('0x1c')](_0x12774d[_0x87cb('0x33')][_0x87cb('0x1c')]);}return _0xbaeba1[_0x87cb('0x50')](_0x5327c2);}})[_0x87cb('0x26')](function(_0x1e0d3c){if(_0x1e0d3c){return _0x1e0d3c?{'count':_0xaa9046,'rows':_0x1e0d3c}:null;}})[_0x87cb('0x26')](respondWithResult(_0x96cd24,null))[_0x87cb('0x49')](handleError(_0x96cd24,null));};exports[_0x87cb('0x51')]=function(_0x2202ea,_0x22c7a7,_0x26ab31){var _0x54653c={};var _0x581dd2={};var _0x285f1a;var _0xf6f96e;return db[_0x87cb('0x45')]['findOne']({'where':{'id':_0x2202ea[_0x87cb('0x47')]['id']}})[_0x87cb('0x26')](handleEntityNotFound(_0x22c7a7,null))[_0x87cb('0x26')](function(_0x5b8bee){if(_0x5b8bee){_0x285f1a=_0x5b8bee;_0x581dd2[_0x87cb('0x32')]=_[_0x87cb('0x34')](db[_0x87cb('0x4d')][_0x87cb('0x2e')]);_0x581dd2[_0x87cb('0x33')]=_[_0x87cb('0x34')](_0x2202ea[_0x87cb('0x33')]);_0x581dd2[_0x87cb('0x35')]=_[_0x87cb('0x36')](_0x581dd2[_0x87cb('0x32')],_0x581dd2[_0x87cb('0x33')]);_0x54653c['attributes']=_[_0x87cb('0x36')](_0x581dd2[_0x87cb('0x32')],qs[_0x87cb('0x38')](_0x2202ea['query'][_0x87cb('0x38')]));_0x54653c[_0x87cb('0x37')]=_0x54653c['attributes']['length']?_0x54653c[_0x87cb('0x37')]:_0x581dd2['model'];_0x54653c['order']=qs[_0x87cb('0x3d')](_0x2202ea['query']['sort']);_0x54653c['where']=qs[_0x87cb('0x35')](_[_0x87cb('0x4e')](_0x2202ea[_0x87cb('0x33')],_0x581dd2['filters']));if(_0x2202ea[_0x87cb('0x33')][_0x87cb('0x3f')]){_0x54653c[_0x87cb('0x3e')]=_['merge'](_0x54653c[_0x87cb('0x3e')],{'$or':_[_0x87cb('0x2d')](_0x54653c[_0x87cb('0x37')],function(_0x3199e3){var _0x2ee1e6={};_0x2ee1e6[_0x3199e3]={'$like':'%'+_0x2202ea['query'][_0x87cb('0x3f')]+'%'};return _0x2ee1e6;})});}_0x54653c=_[_0x87cb('0x40')]({},_0x54653c,_0x2202ea[_0x87cb('0x42')]);return _0x285f1a[_0x87cb('0x51')](_0x54653c);}})[_0x87cb('0x26')](function(_0x421af6){if(_0x421af6){_0xf6f96e=_0x421af6['length'];if(!_0x2202ea[_0x87cb('0x33')][_0x87cb('0x3a')](_0x87cb('0x3b'))){_0x54653c['limit']=qs['limit'](_0x2202ea[_0x87cb('0x33')][_0x87cb('0x1d')]);_0x54653c['offset']=qs[_0x87cb('0x1c')](_0x2202ea['query'][_0x87cb('0x1c')]);}return _0x285f1a[_0x87cb('0x51')](_0x54653c);}})[_0x87cb('0x26')](function(_0x68fe78){if(_0x68fe78){return _0x68fe78?{'count':_0xf6f96e,'rows':_0x68fe78}:null;}})[_0x87cb('0x26')](respondWithResult(_0x22c7a7,null))['catch'](handleError(_0x22c7a7,null));};
\ No newline at end of file
index 52179dc..63f6ea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373e=['rimraf','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x163c7c,_0x45634e){var _0x2f56cd=function(_0x111a34){while(--_0x111a34){_0x163c7c['push'](_0x163c7c['shift']());}};_0x2f56cd(++_0x45634e);}(_0x373e,0xb7));var _0xe373=function(_0x7ac1e7,_0x8433b8){_0x7ac1e7=_0x7ac1e7-0x0;var _0x1b9a7f=_0x373e[_0x7ac1e7];return _0x1b9a7f;};'use strict';var _=require(_0xe373('0x0'));var util=require(_0xe373('0x1'));var logger=require(_0xe373('0x2'))(_0xe373('0x3'));var moment=require(_0xe373('0x4'));var BPromise=require(_0xe373('0x5'));var rp=require(_0xe373('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe373('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xe373('0x8')]=function(_0x23043b,_0x27c160){return _0x23043b['define'](_0xe373('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89cc=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x5d156f,_0xae5308){var _0x5b60f6=function(_0x14f7c1){while(--_0x14f7c1){_0x5d156f['push'](_0x5d156f['shift']());}};_0x5b60f6(++_0xae5308);}(_0x89cc,0x194));var _0xc89c=function(_0x2c652d,_0x1ef634){_0x2c652d=_0x2c652d-0x0;var _0x531be1=_0x89cc[_0x2c652d];return _0x531be1;};'use strict';var _=require(_0xc89c('0x0'));var util=require(_0xc89c('0x1'));var logger=require(_0xc89c('0x2'))(_0xc89c('0x3'));var moment=require(_0xc89c('0x4'));var BPromise=require(_0xc89c('0x5'));var rp=require(_0xc89c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc89c('0x7'));var attributes=require(_0xc89c('0x8'));module[_0xc89c('0x9')]=function(_0xcf18e3,_0x4b0a36){return _0xcf18e3[_0xc89c('0xa')](_0xc89c('0xb'),attributes,{'tableName':_0xc89c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6423744..9f4059e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4611=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug'];(function(_0x10fe10,_0x3bf222){var _0x1a02c1=function(_0xacabad){while(--_0xacabad){_0x10fe10['push'](_0x10fe10['shift']());}};_0x1a02c1(++_0x3bf222);}(_0x4611,0x1d2));var _0x1461=function(_0x51e0df,_0x48d457){_0x51e0df=_0x51e0df-0x0;var _0x3495de=_0x4611[_0x51e0df];return _0x3495de;};'use strict';var _=require(_0x1461('0x0'));var util=require('util');var moment=require(_0x1461('0x1'));var BPromise=require(_0x1461('0x2'));var rs=require(_0x1461('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1461('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1461('0x5'))(_0x1461('0x6'));var config=require('../../config/environment');var jayson=require(_0x1461('0x7'));var client=jayson[_0x1461('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa5e06e,_0x46f945,_0x21f19d){return new BPromise(function(_0x551811,_0xcb174a){return client[_0x1461('0x9')](_0xa5e06e,_0x21f19d)[_0x1461('0xa')](function(_0x2bc66f){logger[_0x1461('0xb')](_0x1461('0xc'),_0x46f945,'request\x20sent');logger[_0x1461('0xd')](_0x1461('0xe'),_0x46f945,_0x1461('0xf'),JSON[_0x1461('0x10')](_0x2bc66f));if(_0x2bc66f[_0x1461('0x11')]){if(_0x2bc66f[_0x1461('0x11')]['code']===0x1f4){logger[_0x1461('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x46f945,_0x2bc66f['error'][_0x1461('0x12')]);return _0xcb174a(_0x2bc66f['error'][_0x1461('0x12')]);}logger[_0x1461('0x11')](_0x1461('0xc'),_0x46f945,_0x2bc66f[_0x1461('0x11')][_0x1461('0x12')]);return _0x551811(_0x2bc66f[_0x1461('0x11')]['message']);}else{logger[_0x1461('0xb')](_0x1461('0xc'),_0x46f945,'request\x20sent');_0x551811(_0x2bc66f['result'][_0x1461('0x12')]);}})[_0x1461('0x13')](function(_0x1f23be){logger[_0x1461('0x11')](_0x1461('0xc'),_0x46f945,_0x1f23be);_0xcb174a(_0x1f23be);});});}
\ No newline at end of file
+var _0x4c6f=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4c6f,0x8e));var _0xf4c6=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x4c6f[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0xf4c6('0x0'));var util=require(_0xf4c6('0x1'));var moment=require(_0xf4c6('0x2'));var BPromise=require(_0xf4c6('0x3'));var rs=require(_0xf4c6('0x4'));var fs=require('fs');var Redis=require(_0xf4c6('0x5'));var db=require(_0xf4c6('0x6'))['db'];var utils=require(_0xf4c6('0x7'));var logger=require('../../config/logger')(_0xf4c6('0x8'));var config=require(_0xf4c6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fe69a,_0x1e779b,_0x55defc){return new BPromise(function(_0x467993,_0x200226){return client[_0xf4c6('0xb')](_0x4fe69a,_0x55defc)[_0xf4c6('0xc')](function(_0x3ddc39){logger[_0xf4c6('0xd')](_0xf4c6('0xe'),_0x1e779b,_0xf4c6('0xf'));logger[_0xf4c6('0x10')](_0xf4c6('0x11'),_0x1e779b,_0xf4c6('0xf'),JSON[_0xf4c6('0x12')](_0x3ddc39));if(_0x3ddc39[_0xf4c6('0x13')]){if(_0x3ddc39[_0xf4c6('0x13')][_0xf4c6('0x14')]===0x1f4){logger[_0xf4c6('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e779b,_0x3ddc39[_0xf4c6('0x13')][_0xf4c6('0x15')]);return _0x200226(_0x3ddc39[_0xf4c6('0x13')][_0xf4c6('0x15')]);}logger[_0xf4c6('0x13')](_0xf4c6('0xe'),_0x1e779b,_0x3ddc39['error'][_0xf4c6('0x15')]);return _0x467993(_0x3ddc39[_0xf4c6('0x13')][_0xf4c6('0x15')]);}else{logger[_0xf4c6('0xd')](_0xf4c6('0xe'),_0x1e779b,_0xf4c6('0xf'));_0x467993(_0x3ddc39['result'][_0xf4c6('0x15')]);}})['catch'](function(_0x2ede12){logger['error'](_0xf4c6('0xe'),_0x1e779b,_0x2ede12);_0x200226(_0x2ede12);});});}
\ No newline at end of file
index 7d0d0c2..28e6ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6623=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','create','put'];(function(_0x7d85f6,_0x181e43){var _0x17a4c9=function(_0x372fe2){while(--_0x372fe2){_0x7d85f6['push'](_0x7d85f6['shift']());}};_0x17a4c9(++_0x181e43);}(_0x6623,0x89));var _0x3662=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6623[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x3662('0x0'));var util=require(_0x3662('0x1'));var path=require(_0x3662('0x2'));var timeout=require(_0x3662('0x3'));var express=require('express');var router=express[_0x3662('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3662('0x5'));var interaction=require(_0x3662('0x6'));var config=require(_0x3662('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x3662('0x8')](),controller['index']);router[_0x3662('0x9')](_0x3662('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3662('0x8')](),controller[_0x3662('0xb')]);router[_0x3662('0xc')](_0x3662('0xa'),auth[_0x3662('0x8')](),controller[_0x3662('0xd')]);router[_0x3662('0xe')](_0x3662('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x18ff=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy'];(function(_0x3a4318,_0x13c6eb){var _0x36d746=function(_0x508617){while(--_0x508617){_0x3a4318['push'](_0x3a4318['shift']());}};_0x36d746(++_0x13c6eb);}(_0x18ff,0x199));var _0xf18f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x18ff[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xf18f('0x0'));var path=require(_0xf18f('0x1'));var timeout=require(_0xf18f('0x2'));var express=require('express');var router=express[_0xf18f('0x3')]();var fs_extra=require(_0xf18f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf18f('0x5'));var config=require(_0xf18f('0x6'));var controller=require(_0xf18f('0x7'));router[_0xf18f('0x8')]('/',auth[_0xf18f('0x9')](),controller['index']);router['get'](_0xf18f('0xa'),auth[_0xf18f('0x9')](),controller[_0xf18f('0xb')]);router['post']('/',auth[_0xf18f('0x9')](),controller[_0xf18f('0xc')]);router['put'](_0xf18f('0xa'),auth['isAuthenticated'](),controller[_0xf18f('0xd')]);router[_0xf18f('0xe')]('/:id',auth[_0xf18f('0x9')](),controller[_0xf18f('0xf')]);module[_0xf18f('0x10')]=router;
\ No newline at end of file
index b352a3e..933f65f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ced=['STRING','ENUM','variable','sequelize','exports','string','customVariable','keyValue','picklist'];(function(_0x5ad70c,_0x442c3d){var _0x4b22f1=function(_0x2523f7){while(--_0x2523f7){_0x5ad70c['push'](_0x5ad70c['shift']());}};_0x4b22f1(++_0x442c3d);}(_0x6ced,0xe4));var _0xd6ce=function(_0x5ee782,_0x52b15e){_0x5ee782=_0x5ee782-0x0;var _0x438a2f=_0x6ced[_0x5ee782];return _0x438a2f;};'use strict';var Sequelize=require(_0xd6ce('0x0'));module[_0xd6ce('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd6ce('0x2'),'variable',_0xd6ce('0x3'),_0xd6ce('0x4'),_0xd6ce('0x5')),'defaultValue':_0xd6ce('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd6ce('0x6')]},'keyType':{'type':Sequelize[_0xd6ce('0x7')](_0xd6ce('0x2'),_0xd6ce('0x8'),_0xd6ce('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd6ce('0x6')]},'nameField':{'type':Sequelize[_0xd6ce('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6ce('0x6')]}};
\ No newline at end of file
+var _0xa4bc=['variable','customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x4a752c,_0xe23d38){var _0x25283f=function(_0x101976){while(--_0x101976){_0x4a752c['push'](_0x4a752c['shift']());}};_0x25283f(++_0xe23d38);}(_0xa4bc,0x11d));var _0xca4b=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xa4bc[_0x5ecadc];return _0x565037;};'use strict';var Sequelize=require(_0xca4b('0x0'));module[_0xca4b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xca4b('0x2'),_0xca4b('0x3'),'keyValue','picklist'),'defaultValue':_0xca4b('0x4')},'content':{'type':Sequelize[_0xca4b('0x5')]},'key':{'type':Sequelize[_0xca4b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xca4b('0x4'),'variable',_0xca4b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xca4b('0x5')]},'nameField':{'type':Sequelize[_0xca4b('0x5')]},'customField':{'type':Sequelize[_0xca4b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca4b('0x5')]}};
\ No newline at end of file
index ff24863..b7ff179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf135=['sort','filters','pick','where','VIRTUAL','filter','include','findAll','show','params','rawAttributes','includeAll','merge','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','SugarcrmField','fieldName','type','key','map','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0xf135,0xec));var _0x5f13=function(_0x4b6475,_0x3b3dcd){_0x4b6475=_0x4b6475-0x0;var _0x9411a9=_0xf135[_0x4b6475];return _0x9411a9;};'use strict';var emlformat=require(_0x5f13('0x0'));var rimraf=require(_0x5f13('0x1'));var zipdir=require(_0x5f13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f13('0x3'));var moment=require('moment');var BPromise=require(_0x5f13('0x4'));var Mustache=require('mustache');var util=require(_0x5f13('0x5'));var path=require(_0x5f13('0x6'));var sox=require(_0x5f13('0x7'));var csv=require(_0x5f13('0x8'));var ejs=require(_0x5f13('0x9'));var fs=require('fs');var fs_extra=require(_0x5f13('0xa'));var _=require(_0x5f13('0xb'));var squel=require('squel');var crypto=require(_0x5f13('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f13('0xd'));var toCsv=require(_0x5f13('0x8'));var querystring=require(_0x5f13('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f13('0xf'));var qs=require(_0x5f13('0x10'));var as=require(_0x5f13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f13('0x12'))(_0x5f13('0x13'));var utils=require(_0x5f13('0x14'));var config=require(_0x5f13('0x15'));var licenseUtil=require(_0x5f13('0x16'));var db=require(_0x5f13('0x17'))['db'];function respondWithStatusCode(_0x2d1fd4,_0x18c3ab){_0x18c3ab=_0x18c3ab||0xcc;return function(_0x238fdf){if(_0x238fdf){return _0x2d1fd4[_0x5f13('0x18')](_0x18c3ab);}return _0x2d1fd4[_0x5f13('0x19')](_0x18c3ab)['end']();};}function respondWithResult(_0x1594c2,_0xe99098){_0xe99098=_0xe99098||0xc8;return function(_0x2cbc41){if(_0x2cbc41){return _0x1594c2[_0x5f13('0x19')](_0xe99098)['json'](_0x2cbc41);}};}function respondWithFilteredResult(_0x1fa35b,_0x914636){return function(_0x91b887){if(_0x91b887){var _0x5e523a=typeof _0x914636['offset']===_0x5f13('0x1a')&&typeof _0x914636[_0x5f13('0x1b')]===_0x5f13('0x1a');var _0x7a4094=_0x91b887[_0x5f13('0x1c')];var _0x502149=_0x5e523a?0x0:_0x914636[_0x5f13('0x1d')];var _0x2e6742=_0x5e523a?_0x91b887['count']:_0x914636[_0x5f13('0x1d')]+_0x914636[_0x5f13('0x1b')];var _0x271ad8;if(_0x2e6742>=_0x7a4094){_0x2e6742=_0x7a4094;_0x271ad8=0xc8;}else{_0x271ad8=0xce;}_0x1fa35b[_0x5f13('0x19')](_0x271ad8);return _0x1fa35b[_0x5f13('0x1e')](_0x5f13('0x1f'),_0x502149+'-'+_0x2e6742+'/'+_0x7a4094)[_0x5f13('0x20')](_0x91b887);}return null;};}function patchUpdates(_0x3fce68){return function(_0x3540df){try{jsonpatch[_0x5f13('0x21')](_0x3540df,_0x3fce68,!![]);}catch(_0x3436a3){return BPromise[_0x5f13('0x22')](_0x3436a3);}return _0x3540df[_0x5f13('0x23')]();};}function saveUpdates(_0x44d387,_0x4f0900){return function(_0xd22a1f){if(_0xd22a1f){return _0xd22a1f[_0x5f13('0x24')](_0x44d387)[_0x5f13('0x25')](function(_0x2b60e3){return _0x2b60e3;});}return null;};}function removeEntity(_0x1e0c2e,_0x17cedc){return function(_0x56165f){if(_0x56165f){return _0x56165f[_0x5f13('0x26')]()[_0x5f13('0x25')](function(){_0x1e0c2e[_0x5f13('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1910fc,_0x38efd6){return function(_0xe516b4){if(!_0xe516b4){_0x1910fc[_0x5f13('0x18')](0x194);}return _0xe516b4;};}function handleError(_0x4d429a,_0x30bef6){_0x30bef6=_0x30bef6||0x1f4;return function(_0x550942){logger['error'](_0x550942[_0x5f13('0x27')]);if(_0x550942[_0x5f13('0x28')]){delete _0x550942[_0x5f13('0x28')];}_0x4d429a['status'](_0x30bef6)[_0x5f13('0x29')](_0x550942);};}exports['index']=function(_0xf658a1,_0x235e2e){var _0x52e09c={},_0x25ae47={},_0x1f3022={'count':0x0,'rows':[]};var _0x5ba428=_['map'](db[_0x5f13('0x2a')]['rawAttributes'],function(_0x2e3583){return{'name':_0x2e3583[_0x5f13('0x2b')],'type':_0x2e3583[_0x5f13('0x2c')][_0x5f13('0x2d')]};});_0x25ae47['model']=_[_0x5f13('0x2e')](_0x5ba428,_0x5f13('0x28'));_0x25ae47['query']=_[_0x5f13('0x2f')](_0xf658a1[_0x5f13('0x30')]);_0x25ae47['filters']=_[_0x5f13('0x31')](_0x25ae47['model'],_0x25ae47[_0x5f13('0x30')]);_0x52e09c[_0x5f13('0x32')]=_[_0x5f13('0x31')](_0x25ae47[_0x5f13('0x33')],qs[_0x5f13('0x34')](_0xf658a1[_0x5f13('0x30')][_0x5f13('0x34')]));_0x52e09c[_0x5f13('0x32')]=_0x52e09c['attributes'][_0x5f13('0x35')]?_0x52e09c[_0x5f13('0x32')]:_0x25ae47[_0x5f13('0x33')];if(!_0xf658a1[_0x5f13('0x30')][_0x5f13('0x36')](_0x5f13('0x37'))){_0x52e09c[_0x5f13('0x1b')]=qs[_0x5f13('0x1b')](_0xf658a1[_0x5f13('0x30')]['limit']);_0x52e09c[_0x5f13('0x1d')]=qs['offset'](_0xf658a1[_0x5f13('0x30')][_0x5f13('0x1d')]);}_0x52e09c['order']=qs['sort'](_0xf658a1[_0x5f13('0x30')][_0x5f13('0x38')]);_0x52e09c['where']=qs[_0x5f13('0x39')](_[_0x5f13('0x3a')](_0xf658a1[_0x5f13('0x30')],_0x25ae47[_0x5f13('0x39')]),_0x5ba428);if(_0xf658a1[_0x5f13('0x30')]['filter']){_0x52e09c['where']=_['merge'](_0x52e09c[_0x5f13('0x3b')],{'$or':_[_0x5f13('0x2e')](_0x5ba428,function(_0x5549f1){if(_0x5549f1['type']!==_0x5f13('0x3c')){var _0x59d37c={};_0x59d37c[_0x5549f1[_0x5f13('0x28')]]={'$like':'%'+_0xf658a1[_0x5f13('0x30')][_0x5f13('0x3d')]+'%'};return _0x59d37c;}})});}_0x52e09c=_['merge']({},_0x52e09c,_0xf658a1['options']);var _0x221a1b={'where':_0x52e09c[_0x5f13('0x3b')]};return db['SugarcrmField'][_0x5f13('0x1c')](_0x221a1b)['then'](function(_0x3299da){_0x1f3022[_0x5f13('0x1c')]=_0x3299da;if(_0xf658a1[_0x5f13('0x30')]['includeAll']){_0x52e09c[_0x5f13('0x3e')]=[{'all':!![]}];}return db[_0x5f13('0x2a')][_0x5f13('0x3f')](_0x52e09c);})['then'](function(_0x1d89bc){_0x1f3022['rows']=_0x1d89bc;return _0x1f3022;})[_0x5f13('0x25')](respondWithFilteredResult(_0x235e2e,_0x52e09c))['catch'](handleError(_0x235e2e,null));};exports[_0x5f13('0x40')]=function(_0x4da687,_0x29335f){var _0x3d188e={'raw':!![],'where':{'id':_0x4da687[_0x5f13('0x41')]['id']}},_0x3bfefc={};_0x3bfefc[_0x5f13('0x33')]=_['keys'](db['SugarcrmField'][_0x5f13('0x42')]);_0x3bfefc[_0x5f13('0x30')]=_[_0x5f13('0x2f')](_0x4da687[_0x5f13('0x30')]);_0x3bfefc[_0x5f13('0x39')]=_[_0x5f13('0x31')](_0x3bfefc[_0x5f13('0x33')],_0x3bfefc[_0x5f13('0x30')]);_0x3d188e[_0x5f13('0x32')]=_[_0x5f13('0x31')](_0x3bfefc[_0x5f13('0x33')],qs[_0x5f13('0x34')](_0x4da687[_0x5f13('0x30')][_0x5f13('0x34')]));_0x3d188e[_0x5f13('0x32')]=_0x3d188e['attributes'][_0x5f13('0x35')]?_0x3d188e[_0x5f13('0x32')]:_0x3bfefc[_0x5f13('0x33')];if(_0x4da687[_0x5f13('0x30')][_0x5f13('0x43')]){_0x3d188e[_0x5f13('0x3e')]=[{'all':!![]}];}_0x3d188e=_[_0x5f13('0x44')]({},_0x3d188e,_0x4da687['options']);return db[_0x5f13('0x2a')]['find'](_0x3d188e)[_0x5f13('0x25')](handleEntityNotFound(_0x29335f,null))[_0x5f13('0x25')](respondWithResult(_0x29335f,null))[_0x5f13('0x45')](handleError(_0x29335f,null));};exports[_0x5f13('0x46')]=function(_0xa0be3,_0x4f2a24){return db[_0x5f13('0x2a')]['create'](_0xa0be3['body'],{})[_0x5f13('0x25')](respondWithResult(_0x4f2a24,0xc9))[_0x5f13('0x45')](handleError(_0x4f2a24,null));};exports[_0x5f13('0x24')]=function(_0x5141ec,_0x1582d){if(_0x5141ec[_0x5f13('0x47')]['id']){delete _0x5141ec[_0x5f13('0x47')]['id'];}return db[_0x5f13('0x2a')]['find']({'where':{'id':_0x5141ec['params']['id']}})['then'](handleEntityNotFound(_0x1582d,null))[_0x5f13('0x25')](saveUpdates(_0x5141ec[_0x5f13('0x47')],null))['then'](respondWithResult(_0x1582d,null))[_0x5f13('0x45')](handleError(_0x1582d,null));};exports[_0x5f13('0x26')]=function(_0x4bb410,_0x378dd0){return db[_0x5f13('0x2a')][_0x5f13('0x48')]({'where':{'id':_0x4bb410['params']['id']}})[_0x5f13('0x25')](handleEntityNotFound(_0x378dd0,null))[_0x5f13('0x25')](removeEntity(_0x378dd0,null))[_0x5f13('0x45')](handleError(_0x378dd0,null));};
\ No newline at end of file
+var _0x502d=['../../config/license/hardware','api','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','then','destroy','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','keys','length','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x506762,_0x230948){var _0x2da0fd=function(_0x48b616){while(--_0x48b616){_0x506762['push'](_0x506762['shift']());}};_0x2da0fd(++_0x230948);}(_0x502d,0x14f));var _0xd502=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0x502d[_0x2142c8];return _0x4286e9;};'use strict';var emlformat=require(_0xd502('0x0'));var rimraf=require(_0xd502('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd502('0x2'));var rp=require(_0xd502('0x3'));var moment=require(_0xd502('0x4'));var BPromise=require(_0xd502('0x5'));var Mustache=require('mustache');var util=require(_0xd502('0x6'));var path=require(_0xd502('0x7'));var sox=require(_0xd502('0x8'));var csv=require(_0xd502('0x9'));var ejs=require(_0xd502('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd502('0xb'));var jsforce=require(_0xd502('0xc'));var deskjs=require(_0xd502('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd502('0xe'));var Papa=require(_0xd502('0xf'));var Redis=require(_0xd502('0x10'));var authService=require(_0xd502('0x11'));var qs=require(_0xd502('0x12'));var as=require(_0xd502('0x13'));var hardwareService=require(_0xd502('0x14'));var logger=require('../../config/logger')(_0xd502('0x15'));var utils=require('../../config/utils');var config=require(_0xd502('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6aa7ac,_0x464d35){_0x464d35=_0x464d35||0xcc;return function(_0xb2c0a1){if(_0xb2c0a1){return _0x6aa7ac[_0xd502('0x17')](_0x464d35);}return _0x6aa7ac[_0xd502('0x18')](_0x464d35)[_0xd502('0x19')]();};}function respondWithResult(_0x10e5d8,_0x7d6c2d){_0x7d6c2d=_0x7d6c2d||0xc8;return function(_0x4dcc66){if(_0x4dcc66){return _0x10e5d8[_0xd502('0x18')](_0x7d6c2d)['json'](_0x4dcc66);}};}function respondWithFilteredResult(_0x330584,_0x3d3794){return function(_0x270ea6){if(_0x270ea6){var _0xe3ab62=typeof _0x3d3794[_0xd502('0x1a')]===_0xd502('0x1b')&&typeof _0x3d3794['limit']===_0xd502('0x1b');var _0x35e773=_0x270ea6['count'];var _0x37e038=_0xe3ab62?0x0:_0x3d3794['offset'];var _0x36d819=_0xe3ab62?_0x270ea6[_0xd502('0x1c')]:_0x3d3794[_0xd502('0x1a')]+_0x3d3794[_0xd502('0x1d')];var _0x24f045;if(_0x36d819>=_0x35e773){_0x36d819=_0x35e773;_0x24f045=0xc8;}else{_0x24f045=0xce;}_0x330584['status'](_0x24f045);return _0x330584[_0xd502('0x1e')]('Content-Range',_0x37e038+'-'+_0x36d819+'/'+_0x35e773)[_0xd502('0x1f')](_0x270ea6);}return null;};}function patchUpdates(_0x1ae0bc){return function(_0x341f7f){try{jsonpatch['apply'](_0x341f7f,_0x1ae0bc,!![]);}catch(_0x48e296){return BPromise[_0xd502('0x20')](_0x48e296);}return _0x341f7f[_0xd502('0x21')]();};}function saveUpdates(_0x19d7d1,_0x4ea0ed){return function(_0x2802cc){if(_0x2802cc){return _0x2802cc[_0xd502('0x22')](_0x19d7d1)[_0xd502('0x23')](function(_0x5d098b){return _0x5d098b;});}return null;};}function removeEntity(_0x88ac0d,_0x256d1a){return function(_0x4c0d66){if(_0x4c0d66){return _0x4c0d66[_0xd502('0x24')]()[_0xd502('0x23')](function(){_0x88ac0d[_0xd502('0x18')](0xcc)[_0xd502('0x19')]();});}};}function handleEntityNotFound(_0x13cd4c,_0x25e224){return function(_0x228653){if(!_0x228653){_0x13cd4c[_0xd502('0x17')](0x194);}return _0x228653;};}function handleError(_0x269d89,_0x175536){_0x175536=_0x175536||0x1f4;return function(_0x4cbc7a){logger['error'](_0x4cbc7a[_0xd502('0x25')]);if(_0x4cbc7a[_0xd502('0x26')]){delete _0x4cbc7a[_0xd502('0x26')];}_0x269d89['status'](_0x175536)[_0xd502('0x27')](_0x4cbc7a);};}exports['index']=function(_0x3f1968,_0x4000f4){var _0x472075={},_0x543b87={},_0xd765b={'count':0x0,'rows':[]};var _0x5f18bd=_[_0xd502('0x28')](db[_0xd502('0x29')][_0xd502('0x2a')],function(_0x2fe252){return{'name':_0x2fe252[_0xd502('0x2b')],'type':_0x2fe252[_0xd502('0x2c')]['key']};});_0x543b87[_0xd502('0x2d')]=_[_0xd502('0x28')](_0x5f18bd,_0xd502('0x26'));_0x543b87[_0xd502('0x2e')]=_['keys'](_0x3f1968['query']);_0x543b87[_0xd502('0x2f')]=_[_0xd502('0x30')](_0x543b87[_0xd502('0x2d')],_0x543b87[_0xd502('0x2e')]);_0x472075[_0xd502('0x31')]=_[_0xd502('0x30')](_0x543b87['model'],qs[_0xd502('0x32')](_0x3f1968[_0xd502('0x2e')][_0xd502('0x32')]));_0x472075['attributes']=_0x472075[_0xd502('0x31')]['length']?_0x472075['attributes']:_0x543b87[_0xd502('0x2d')];if(!_0x3f1968[_0xd502('0x2e')][_0xd502('0x33')]('nolimit')){_0x472075[_0xd502('0x1d')]=qs[_0xd502('0x1d')](_0x3f1968['query'][_0xd502('0x1d')]);_0x472075[_0xd502('0x1a')]=qs['offset'](_0x3f1968[_0xd502('0x2e')][_0xd502('0x1a')]);}_0x472075[_0xd502('0x34')]=qs[_0xd502('0x35')](_0x3f1968['query'][_0xd502('0x35')]);_0x472075[_0xd502('0x36')]=qs[_0xd502('0x2f')](_['pick'](_0x3f1968[_0xd502('0x2e')],_0x543b87[_0xd502('0x2f')]),_0x5f18bd);if(_0x3f1968[_0xd502('0x2e')][_0xd502('0x37')]){_0x472075[_0xd502('0x36')]=_['merge'](_0x472075['where'],{'$or':_[_0xd502('0x28')](_0x5f18bd,function(_0x37f3ea){if(_0x37f3ea[_0xd502('0x2c')]!==_0xd502('0x38')){var _0x4e57dc={};_0x4e57dc[_0x37f3ea[_0xd502('0x26')]]={'$like':'%'+_0x3f1968[_0xd502('0x2e')]['filter']+'%'};return _0x4e57dc;}})});}_0x472075=_[_0xd502('0x39')]({},_0x472075,_0x3f1968['options']);var _0x1dcd5c={'where':_0x472075['where']};return db['SugarcrmField']['count'](_0x1dcd5c)['then'](function(_0xe66ed7){_0xd765b[_0xd502('0x1c')]=_0xe66ed7;if(_0x3f1968[_0xd502('0x2e')][_0xd502('0x3a')]){_0x472075[_0xd502('0x3b')]=[{'all':!![]}];}return db[_0xd502('0x29')][_0xd502('0x3c')](_0x472075);})[_0xd502('0x23')](function(_0x4e9921){_0xd765b[_0xd502('0x3d')]=_0x4e9921;return _0xd765b;})[_0xd502('0x23')](respondWithFilteredResult(_0x4000f4,_0x472075))[_0xd502('0x3e')](handleError(_0x4000f4,null));};exports[_0xd502('0x3f')]=function(_0x3bedc6,_0x987b59){var _0x1b069e={'raw':!![],'where':{'id':_0x3bedc6['params']['id']}},_0x285a60={};_0x285a60[_0xd502('0x2d')]=_['keys'](db[_0xd502('0x29')][_0xd502('0x2a')]);_0x285a60['query']=_[_0xd502('0x40')](_0x3bedc6[_0xd502('0x2e')]);_0x285a60[_0xd502('0x2f')]=_['intersection'](_0x285a60['model'],_0x285a60[_0xd502('0x2e')]);_0x1b069e[_0xd502('0x31')]=_[_0xd502('0x30')](_0x285a60[_0xd502('0x2d')],qs[_0xd502('0x32')](_0x3bedc6[_0xd502('0x2e')][_0xd502('0x32')]));_0x1b069e[_0xd502('0x31')]=_0x1b069e[_0xd502('0x31')][_0xd502('0x41')]?_0x1b069e[_0xd502('0x31')]:_0x285a60[_0xd502('0x2d')];if(_0x3bedc6[_0xd502('0x2e')][_0xd502('0x3a')]){_0x1b069e[_0xd502('0x3b')]=[{'all':!![]}];}_0x1b069e=_[_0xd502('0x39')]({},_0x1b069e,_0x3bedc6[_0xd502('0x42')]);return db[_0xd502('0x29')][_0xd502('0x43')](_0x1b069e)[_0xd502('0x23')](handleEntityNotFound(_0x987b59,null))[_0xd502('0x23')](respondWithResult(_0x987b59,null))[_0xd502('0x3e')](handleError(_0x987b59,null));};exports[_0xd502('0x44')]=function(_0x243000,_0x50d2f8){return db[_0xd502('0x29')][_0xd502('0x44')](_0x243000['body'],{})['then'](respondWithResult(_0x50d2f8,0xc9))[_0xd502('0x3e')](handleError(_0x50d2f8,null));};exports[_0xd502('0x22')]=function(_0x2be4ae,_0x2e22a3){if(_0x2be4ae[_0xd502('0x45')]['id']){delete _0x2be4ae[_0xd502('0x45')]['id'];}return db[_0xd502('0x29')][_0xd502('0x43')]({'where':{'id':_0x2be4ae[_0xd502('0x46')]['id']}})[_0xd502('0x23')](handleEntityNotFound(_0x2e22a3,null))[_0xd502('0x23')](saveUpdates(_0x2be4ae[_0xd502('0x45')],null))['then'](respondWithResult(_0x2e22a3,null))[_0xd502('0x3e')](handleError(_0x2e22a3,null));};exports['destroy']=function(_0x521106,_0xc7a27d){return db[_0xd502('0x29')][_0xd502('0x43')]({'where':{'id':_0x521106[_0xd502('0x46')]['id']}})['then'](handleEntityNotFound(_0xc7a27d,null))[_0xd502('0x23')](removeEntity(_0xc7a27d,null))['catch'](handleError(_0xc7a27d,null));};
\ No newline at end of file
index d370642..67ecbd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefcc=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3c1631,_0x568311){var _0x435e88=function(_0xccb84d){while(--_0xccb84d){_0x3c1631['push'](_0x3c1631['shift']());}};_0x435e88(++_0x568311);}(_0xefcc,0xf9));var _0xcefc=function(_0x3340d4,_0x418571){_0x3340d4=_0x3340d4-0x0;var _0x30d830=_0xefcc[_0x3340d4];return _0x30d830;};'use strict';var _=require(_0xcefc('0x0'));var util=require(_0xcefc('0x1'));var logger=require(_0xcefc('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcefc('0x3'));var rp=require(_0xcefc('0x4'));var fs=require('fs');var path=require(_0xcefc('0x5'));var rimraf=require(_0xcefc('0x6'));var config=require(_0xcefc('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0xcefc('0x8')]=function(_0x4a85c4,_0x229344){return _0x4a85c4[_0xcefc('0x9')]('SugarcrmField',attributes,{'tableName':_0xcefc('0xa'),'paranoid':![],'indexes':[{'name':_0xcefc('0xb'),'fields':[_0xcefc('0xc'),_0xcefc('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2bd=['exports','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intSugarcrmField.attributes'];(function(_0x45ee7e,_0x584cf2){var _0x4224bb=function(_0x595c39){while(--_0x595c39){_0x45ee7e['push'](_0x45ee7e['shift']());}};_0x4224bb(++_0x584cf2);}(_0xf2bd,0xf4));var _0xdf2b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf2bd[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xdf2b('0x0'));var util=require('util');var logger=require(_0xdf2b('0x1'))(_0xdf2b('0x2'));var moment=require(_0xdf2b('0x3'));var BPromise=require(_0xdf2b('0x4'));var rp=require(_0xdf2b('0x5'));var fs=require('fs');var path=require(_0xdf2b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf2b('0x7'));module[_0xdf2b('0x8')]=function(_0x11bd78,_0x51b92b){return _0x11bd78['define']('SugarcrmField',attributes,{'tableName':_0xdf2b('0x9'),'paranoid':![],'indexes':[{'name':_0xdf2b('0xa'),'fields':[_0xdf2b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9e6abe1..5eb37e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8264=['debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x193cf0,_0x361623){var _0x2726ac=function(_0x2c8b42){while(--_0x2c8b42){_0x193cf0['push'](_0x193cf0['shift']());}};_0x2726ac(++_0x361623);}(_0x8264,0x1e1));var _0x4826=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x8264[_0x3d34da];return _0xcf6af8;};'use strict';var _=require(_0x4826('0x0'));var util=require(_0x4826('0x1'));var moment=require(_0x4826('0x2'));var BPromise=require(_0x4826('0x3'));var rs=require(_0x4826('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4826('0x5'));var config=require(_0x4826('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4826('0x7')][_0x4826('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d3028,_0x494cdc,_0x4ab005){return new BPromise(function(_0x32d65e,_0x544c3e){return client[_0x4826('0x9')](_0x1d3028,_0x4ab005)[_0x4826('0xa')](function(_0x4862e7){logger[_0x4826('0xb')](_0x4826('0xc'),_0x494cdc,'request\x20sent');logger[_0x4826('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x494cdc,_0x4826('0xe'),JSON[_0x4826('0xf')](_0x4862e7));if(_0x4862e7[_0x4826('0x10')]){if(_0x4862e7[_0x4826('0x10')][_0x4826('0x11')]===0x1f4){logger[_0x4826('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x494cdc,_0x4862e7[_0x4826('0x10')][_0x4826('0x12')]);return _0x544c3e(_0x4862e7[_0x4826('0x10')][_0x4826('0x12')]);}logger[_0x4826('0x10')](_0x4826('0xc'),_0x494cdc,_0x4862e7['error']['message']);return _0x32d65e(_0x4862e7[_0x4826('0x10')][_0x4826('0x12')]);}else{logger['info'](_0x4826('0xc'),_0x494cdc,_0x4826('0xe'));_0x32d65e(_0x4862e7['result']['message']);}})['catch'](function(_0x51f16f){logger[_0x4826('0x10')](_0x4826('0xc'),_0x494cdc,_0x51f16f);_0x544c3e(_0x51f16f);});});}
\ No newline at end of file
+var _0xb454=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb454,0x14e));var _0x4b45=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb454[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x4b45('0x0'));var util=require('util');var moment=require(_0x4b45('0x1'));var BPromise=require(_0x4b45('0x2'));var rs=require(_0x4b45('0x3'));var fs=require('fs');var Redis=require(_0x4b45('0x4'));var db=require(_0x4b45('0x5'))['db'];var utils=require(_0x4b45('0x6'));var logger=require(_0x4b45('0x7'))(_0x4b45('0x8'));var config=require(_0x4b45('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32fc22,_0x1972e1,_0x229133){return new BPromise(function(_0x1f2f1b,_0x36f102){return client[_0x4b45('0xb')](_0x32fc22,_0x229133)[_0x4b45('0xc')](function(_0xd7a46e){logger[_0x4b45('0xd')](_0x4b45('0xe'),_0x1972e1,_0x4b45('0xf'));logger[_0x4b45('0x10')](_0x4b45('0x11'),_0x1972e1,_0x4b45('0xf'),JSON[_0x4b45('0x12')](_0xd7a46e));if(_0xd7a46e[_0x4b45('0x13')]){if(_0xd7a46e['error']['code']===0x1f4){logger[_0x4b45('0x13')](_0x4b45('0xe'),_0x1972e1,_0xd7a46e[_0x4b45('0x13')]['message']);return _0x36f102(_0xd7a46e[_0x4b45('0x13')][_0x4b45('0x14')]);}logger[_0x4b45('0x13')](_0x4b45('0xe'),_0x1972e1,_0xd7a46e[_0x4b45('0x13')][_0x4b45('0x14')]);return _0x1f2f1b(_0xd7a46e['error'][_0x4b45('0x14')]);}else{logger[_0x4b45('0xd')](_0x4b45('0xe'),_0x1972e1,_0x4b45('0xf'));_0x1f2f1b(_0xd7a46e[_0x4b45('0x15')]['message']);}})[_0x4b45('0x16')](function(_0x58bfcc){logger[_0x4b45('0x13')](_0x4b45('0xe'),_0x1972e1,_0x58bfcc);_0x36f102(_0x58bfcc);});});}
\ No newline at end of file
index 5db4b5b..07e4700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ade=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x5ea7b0,_0x5f367f){var _0x1ceb39=function(_0x48d714){while(--_0x48d714){_0x5ea7b0['push'](_0x5ea7b0['shift']());}};_0x1ceb39(++_0x5f367f);}(_0x9ade,0x107));var _0xe9ad=function(_0x14474a,_0x5be492){_0x14474a=_0x14474a-0x0;var _0x1f8b71=_0x9ade[_0x14474a];return _0x1f8b71;};'use strict';var multer=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe9ad('0x2'));var router=express['Router']();var fs_extra=require(_0xe9ad('0x3'));var auth=require(_0xe9ad('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe9ad('0x5'));router[_0xe9ad('0x6')]('/',auth[_0xe9ad('0x7')](),controller[_0xe9ad('0x8')]);router[_0xe9ad('0x6')](_0xe9ad('0x9'),auth[_0xe9ad('0x7')](),controller[_0xe9ad('0xa')]);router['get'](_0xe9ad('0xb'),auth[_0xe9ad('0x7')](),controller[_0xe9ad('0xc')]);router[_0xe9ad('0x6')](_0xe9ad('0xd'),auth[_0xe9ad('0x7')](),controller[_0xe9ad('0xe')]);router[_0xe9ad('0xf')]('/',auth[_0xe9ad('0x7')](),controller[_0xe9ad('0x10')]);router[_0xe9ad('0xf')](_0xe9ad('0xb'),auth['isAuthenticated'](),controller[_0xe9ad('0x11')]);router[_0xe9ad('0x12')](_0xe9ad('0x9'),auth[_0xe9ad('0x7')](),controller['update']);router[_0xe9ad('0x13')](_0xe9ad('0x9'),auth[_0xe9ad('0x7')](),controller[_0xe9ad('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1c42=['./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a135a,_0xc2dcb9){var _0x52a534=function(_0x43defc){while(--_0x43defc){_0x5a135a['push'](_0x5a135a['shift']());}};_0x52a534(++_0xc2dcb9);}(_0x1c42,0x13a));var _0x21c4=function(_0x467a63,_0x3c1c67){_0x467a63=_0x467a63-0x0;var _0x57e2d6=_0x1c42[_0x467a63];return _0x57e2d6;};'use strict';var multer=require('multer');var util=require(_0x21c4('0x0'));var path=require(_0x21c4('0x1'));var timeout=require(_0x21c4('0x2'));var express=require('express');var router=express[_0x21c4('0x3')]();var fs_extra=require(_0x21c4('0x4'));var auth=require(_0x21c4('0x5'));var interaction=require(_0x21c4('0x6'));var config=require(_0x21c4('0x7'));var controller=require(_0x21c4('0x8'));router[_0x21c4('0x9')]('/',auth[_0x21c4('0xa')](),controller['index']);router[_0x21c4('0x9')](_0x21c4('0xb'),auth['isAuthenticated'](),controller[_0x21c4('0xc')]);router['get'](_0x21c4('0xd'),auth[_0x21c4('0xa')](),controller[_0x21c4('0xe')]);router[_0x21c4('0x9')](_0x21c4('0xf'),auth[_0x21c4('0xa')](),controller[_0x21c4('0x10')]);router[_0x21c4('0x11')]('/',auth[_0x21c4('0xa')](),controller['create']);router[_0x21c4('0x11')]('/:id/configurations',auth[_0x21c4('0xa')](),controller['addConfiguration']);router[_0x21c4('0x12')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller[_0x21c4('0x13')]);router[_0x21c4('0x14')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller[_0x21c4('0x15')]);module[_0x21c4('0x16')]=router;
\ No newline at end of file
index e17ea1b..30ebbf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38dd=['HelpDesk','exports','STRING'];(function(_0x9f5662,_0x3fca83){var _0x49c11d=function(_0x1dabdf){while(--_0x1dabdf){_0x9f5662['push'](_0x9f5662['shift']());}};_0x49c11d(++_0x3fca83);}(_0x38dd,0x11b));var _0xd38d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x38dd[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0xd38d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd38d('0x1')]},'username':{'type':Sequelize[_0xd38d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd38d('0x1')],'allowNull':![],'defaultValue':_0xd38d('0x2')},'remoteUri':{'type':Sequelize[_0xd38d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd38d('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd38d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x2c50=['exports','STRING'];(function(_0x4c71fc,_0x564cdb){var _0x35187a=function(_0x484b76){while(--_0x484b76){_0x4c71fc['push'](_0x4c71fc['shift']());}};_0x35187a(++_0x564cdb);}(_0x2c50,0x166));var _0x02c5=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x2c50[_0x2e76a7];return _0x454cde;};'use strict';var Sequelize=require('sequelize');module[_0x02c5('0x0')]={'name':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x02c5('0x1')]},'username':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x02c5('0x1')],'allowNull':![]}};
\ No newline at end of file
index ed286b4..cc64b15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdb0=['value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','type','model','name','query','intersection','attributes','fields','nolimit','offset','order','sort','where','filters','pick','filter','VtigerAccount','includeAll','include','show','params','keys','length','merge','options','find','create','catch','body','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','GET','getchallenge','success','POST','login','result','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues'];(function(_0x34219a,_0x1ab11b){var _0x352570=function(_0x3c6426){while(--_0x3c6426){_0x34219a['push'](_0x34219a['shift']());}};_0x352570(++_0x1ab11b);}(_0xfdb0,0x84));var _0x0fdb=function(_0x157099,_0x4be9ff){_0x157099=_0x157099-0x0;var _0x2dc8c5=_0xfdb0[_0x157099];return _0x2dc8c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fdb('0x0'));var zipdir=require(_0x0fdb('0x1'));var jsonpatch=require(_0x0fdb('0x2'));var rp=require(_0x0fdb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0fdb('0x4'));var util=require(_0x0fdb('0x5'));var path=require(_0x0fdb('0x6'));var sox=require('sox');var csv=require(_0x0fdb('0x7'));var ejs=require(_0x0fdb('0x8'));var fs=require('fs');var fs_extra=require(_0x0fdb('0x9'));var _=require(_0x0fdb('0xa'));var squel=require(_0x0fdb('0xb'));var crypto=require(_0x0fdb('0xc'));var jsforce=require(_0x0fdb('0xd'));var deskjs=require(_0x0fdb('0xe'));var toCsv=require(_0x0fdb('0x7'));var querystring=require('querystring');var Papa=require(_0x0fdb('0xf'));var Redis=require(_0x0fdb('0x10'));var authService=require(_0x0fdb('0x11'));var qs=require(_0x0fdb('0x12'));var as=require(_0x0fdb('0x13'));var hardwareService=require(_0x0fdb('0x14'));var logger=require(_0x0fdb('0x15'))(_0x0fdb('0x16'));var utils=require(_0x0fdb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0fdb('0x18'));var db=require(_0x0fdb('0x19'))['db'];var integrations=require(_0x0fdb('0x1a'));function respondWithStatusCode(_0x57157a,_0x966453){_0x966453=_0x966453||0xcc;return function(_0x3db79c){if(_0x3db79c){return _0x57157a[_0x0fdb('0x1b')](_0x966453);}return _0x57157a[_0x0fdb('0x1c')](_0x966453)[_0x0fdb('0x1d')]();};}function respondWithResult(_0x2fbcf5,_0x2610b6){_0x2610b6=_0x2610b6||0xc8;return function(_0x28c5f9){if(_0x28c5f9){return _0x2fbcf5['status'](_0x2610b6)['json'](_0x28c5f9);}};}function respondWithFilteredResult(_0x1952c1,_0x332ade){return function(_0x442ed4){if(_0x442ed4){var _0x421bee=typeof _0x332ade['offset']==='undefined'&&typeof _0x332ade['limit']===_0x0fdb('0x1e');var _0x149bcc=_0x442ed4[_0x0fdb('0x1f')];var _0x2bd232=_0x421bee?0x0:_0x332ade['offset'];var _0x45dc78=_0x421bee?_0x442ed4['count']:_0x332ade['offset']+_0x332ade[_0x0fdb('0x20')];var _0x1b4a81;if(_0x45dc78>=_0x149bcc){_0x45dc78=_0x149bcc;_0x1b4a81=0xc8;}else{_0x1b4a81=0xce;}_0x1952c1[_0x0fdb('0x1c')](_0x1b4a81);return _0x1952c1['set'](_0x0fdb('0x21'),_0x2bd232+'-'+_0x45dc78+'/'+_0x149bcc)[_0x0fdb('0x22')](_0x442ed4);}return null;};}function patchUpdates(_0x6875ca){return function(_0x55d8e7){try{jsonpatch[_0x0fdb('0x23')](_0x55d8e7,_0x6875ca,!![]);}catch(_0x118f60){return BPromise[_0x0fdb('0x24')](_0x118f60);}return _0x55d8e7[_0x0fdb('0x25')]();};}function saveUpdates(_0x3a27f6,_0x508291){return function(_0x35e215){if(_0x35e215){return _0x35e215[_0x0fdb('0x26')](_0x3a27f6)[_0x0fdb('0x27')](function(_0x4bf087){return _0x4bf087;});}return null;};}function removeEntity(_0x4b3325,_0x553c6a){return function(_0x424c57){if(_0x424c57){return _0x424c57[_0x0fdb('0x28')]()[_0x0fdb('0x27')](function(){_0x4b3325[_0x0fdb('0x1c')](0xcc)[_0x0fdb('0x1d')]();});}};}function handleEntityNotFound(_0x3c15e7,_0x55338d){return function(_0x629a05){if(!_0x629a05){_0x3c15e7[_0x0fdb('0x1b')](0x194);}return _0x629a05;};}function handleError(_0x1bb7c9,_0xb1fe3b){_0xb1fe3b=_0xb1fe3b||0x1f4;return function(_0x5ede5b){logger[_0x0fdb('0x29')](_0x5ede5b[_0x0fdb('0x2a')]);if(_0x5ede5b['name']){delete _0x5ede5b['name'];}_0x1bb7c9['status'](_0xb1fe3b)['send'](_0x5ede5b);};}exports[_0x0fdb('0x2b')]=function(_0x555119,_0x37adc9){var _0x34d251={},_0x503fab={},_0x5357a1={'count':0x0,'rows':[]};var _0x522eaa=_[_0x0fdb('0x2c')](db['VtigerAccount'][_0x0fdb('0x2d')],function(_0x3c66a9){return{'name':_0x3c66a9[_0x0fdb('0x2e')],'type':_0x3c66a9[_0x0fdb('0x2f')]['key']};});_0x503fab[_0x0fdb('0x30')]=_[_0x0fdb('0x2c')](_0x522eaa,_0x0fdb('0x31'));_0x503fab[_0x0fdb('0x32')]=_['keys'](_0x555119[_0x0fdb('0x32')]);_0x503fab['filters']=_[_0x0fdb('0x33')](_0x503fab[_0x0fdb('0x30')],_0x503fab[_0x0fdb('0x32')]);_0x34d251[_0x0fdb('0x34')]=_[_0x0fdb('0x33')](_0x503fab['model'],qs[_0x0fdb('0x35')](_0x555119[_0x0fdb('0x32')][_0x0fdb('0x35')]));_0x34d251[_0x0fdb('0x34')]=_0x34d251[_0x0fdb('0x34')]['length']?_0x34d251['attributes']:_0x503fab[_0x0fdb('0x30')];if(!_0x555119['query']['hasOwnProperty'](_0x0fdb('0x36'))){_0x34d251[_0x0fdb('0x20')]=qs[_0x0fdb('0x20')](_0x555119[_0x0fdb('0x32')][_0x0fdb('0x20')]);_0x34d251['offset']=qs['offset'](_0x555119['query'][_0x0fdb('0x37')]);}_0x34d251[_0x0fdb('0x38')]=qs[_0x0fdb('0x39')](_0x555119[_0x0fdb('0x32')][_0x0fdb('0x39')]);_0x34d251[_0x0fdb('0x3a')]=qs[_0x0fdb('0x3b')](_[_0x0fdb('0x3c')](_0x555119['query'],_0x503fab[_0x0fdb('0x3b')]),_0x522eaa);if(_0x555119[_0x0fdb('0x32')][_0x0fdb('0x3d')]){_0x34d251[_0x0fdb('0x3a')]=_['merge'](_0x34d251[_0x0fdb('0x3a')],{'$or':_[_0x0fdb('0x2c')](_0x522eaa,function(_0x46087b){if(_0x46087b[_0x0fdb('0x2f')]!=='VIRTUAL'){var _0x95be6d={};_0x95be6d[_0x46087b[_0x0fdb('0x31')]]={'$like':'%'+_0x555119[_0x0fdb('0x32')][_0x0fdb('0x3d')]+'%'};return _0x95be6d;}})});}_0x34d251=_['merge']({},_0x34d251,_0x555119['options']);var _0x1e05ea={'where':_0x34d251[_0x0fdb('0x3a')]};return db[_0x0fdb('0x3e')][_0x0fdb('0x1f')](_0x1e05ea)['then'](function(_0x30b998){_0x5357a1[_0x0fdb('0x1f')]=_0x30b998;if(_0x555119[_0x0fdb('0x32')][_0x0fdb('0x3f')]){_0x34d251[_0x0fdb('0x40')]=[{'all':!![]}];}return db[_0x0fdb('0x3e')]['findAll'](_0x34d251);})['then'](function(_0x545949){_0x5357a1['rows']=_0x545949;return _0x5357a1;})[_0x0fdb('0x27')](respondWithFilteredResult(_0x37adc9,_0x34d251))['catch'](handleError(_0x37adc9,null));};exports[_0x0fdb('0x41')]=function(_0x4303a6,_0x7f8c4e){var _0x44bf99={'raw':![],'where':{'id':_0x4303a6[_0x0fdb('0x42')]['id']}},_0x5b7ba3={};_0x5b7ba3[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x3e')][_0x0fdb('0x2d')]);_0x5b7ba3[_0x0fdb('0x32')]=_[_0x0fdb('0x43')](_0x4303a6[_0x0fdb('0x32')]);_0x5b7ba3[_0x0fdb('0x3b')]=_['intersection'](_0x5b7ba3[_0x0fdb('0x30')],_0x5b7ba3[_0x0fdb('0x32')]);_0x44bf99['attributes']=_[_0x0fdb('0x33')](_0x5b7ba3[_0x0fdb('0x30')],qs['fields'](_0x4303a6[_0x0fdb('0x32')][_0x0fdb('0x35')]));_0x44bf99[_0x0fdb('0x34')]=_0x44bf99[_0x0fdb('0x34')][_0x0fdb('0x44')]?_0x44bf99['attributes']:_0x5b7ba3[_0x0fdb('0x30')];if(_0x4303a6[_0x0fdb('0x32')][_0x0fdb('0x3f')]){_0x44bf99[_0x0fdb('0x40')]=[{'all':!![]}];}_0x44bf99=_[_0x0fdb('0x45')]({},_0x44bf99,_0x4303a6[_0x0fdb('0x46')]);return db['VtigerAccount'][_0x0fdb('0x47')](_0x44bf99)[_0x0fdb('0x27')](handleEntityNotFound(_0x7f8c4e,null))[_0x0fdb('0x27')](respondWithResult(_0x7f8c4e,null))['catch'](handleError(_0x7f8c4e,null));};exports['create']=function(_0x3ff3f1,_0x520086){return db[_0x0fdb('0x3e')][_0x0fdb('0x48')](_0x3ff3f1['body'],{})['then'](respondWithResult(_0x520086,0xc9))[_0x0fdb('0x49')](handleError(_0x520086,null));};exports[_0x0fdb('0x26')]=function(_0x1a82f7,_0x374f25){if(_0x1a82f7[_0x0fdb('0x4a')]['id']){delete _0x1a82f7['body']['id'];}return db[_0x0fdb('0x3e')][_0x0fdb('0x47')]({'where':{'id':_0x1a82f7['params']['id']}})['then'](handleEntityNotFound(_0x374f25,null))['then'](saveUpdates(_0x1a82f7[_0x0fdb('0x4a')],null))[_0x0fdb('0x27')](respondWithResult(_0x374f25,null))[_0x0fdb('0x49')](handleError(_0x374f25,null));};exports[_0x0fdb('0x28')]=function(_0x3692b5,_0x3b3c64){return db[_0x0fdb('0x3e')]['find']({'where':{'id':_0x3692b5['params']['id']}})[_0x0fdb('0x27')](handleEntityNotFound(_0x3b3c64,null))['then'](removeEntity(_0x3b3c64,null))[_0x0fdb('0x49')](handleError(_0x3b3c64,null));};exports[_0x0fdb('0x4b')]=function(_0x30b3cd,_0x30d548,_0x406ad1){var _0x1f62ab={};var _0x1163f8={};var _0x4af888;var _0x101287;return db['VtigerAccount'][_0x0fdb('0x4c')]({'where':{'id':_0x30b3cd[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x27')](handleEntityNotFound(_0x30d548,null))[_0x0fdb('0x27')](function(_0x1050d7){if(_0x1050d7){_0x4af888=_0x1050d7;_0x1163f8[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x4d')]['rawAttributes']);_0x1163f8[_0x0fdb('0x32')]=_[_0x0fdb('0x43')](_0x30b3cd['query']);_0x1163f8[_0x0fdb('0x3b')]=_[_0x0fdb('0x33')](_0x1163f8[_0x0fdb('0x30')],_0x1163f8['query']);_0x1f62ab[_0x0fdb('0x34')]=_[_0x0fdb('0x33')](_0x1163f8[_0x0fdb('0x30')],qs['fields'](_0x30b3cd['query']['fields']));_0x1f62ab[_0x0fdb('0x34')]=_0x1f62ab[_0x0fdb('0x34')][_0x0fdb('0x44')]?_0x1f62ab[_0x0fdb('0x34')]:_0x1163f8[_0x0fdb('0x30')];_0x1f62ab['order']=qs['sort'](_0x30b3cd[_0x0fdb('0x32')][_0x0fdb('0x39')]);_0x1f62ab[_0x0fdb('0x3a')]=qs['filters'](_['pick'](_0x30b3cd[_0x0fdb('0x32')],_0x1163f8[_0x0fdb('0x3b')]));if(_0x30b3cd[_0x0fdb('0x32')]['filter']){_0x1f62ab[_0x0fdb('0x3a')]=_[_0x0fdb('0x45')](_0x1f62ab[_0x0fdb('0x3a')],{'$or':_[_0x0fdb('0x2c')](_0x1f62ab[_0x0fdb('0x34')],function(_0x22ad39){var _0x228846={};_0x228846[_0x22ad39]={'$like':'%'+_0x30b3cd[_0x0fdb('0x32')][_0x0fdb('0x3d')]+'%'};return _0x228846;})});}_0x1f62ab=_['merge']({},_0x1f62ab,_0x30b3cd[_0x0fdb('0x46')]);return _0x4af888[_0x0fdb('0x4b')](_0x1f62ab);}})[_0x0fdb('0x27')](function(_0x468d3c){if(_0x468d3c){_0x101287=_0x468d3c[_0x0fdb('0x44')];if(!_0x30b3cd[_0x0fdb('0x32')][_0x0fdb('0x4e')]('nolimit')){_0x1f62ab[_0x0fdb('0x20')]=qs[_0x0fdb('0x20')](_0x30b3cd[_0x0fdb('0x32')][_0x0fdb('0x20')]);_0x1f62ab['offset']=qs[_0x0fdb('0x37')](_0x30b3cd[_0x0fdb('0x32')]['offset']);}return _0x4af888[_0x0fdb('0x4b')](_0x1f62ab);}})[_0x0fdb('0x27')](function(_0x46a2b7){if(_0x46a2b7){return _0x46a2b7?{'count':_0x101287,'rows':_0x46a2b7}:null;}})[_0x0fdb('0x27')](respondWithResult(_0x30d548,null))['catch'](handleError(_0x30d548,null));};exports[_0x0fdb('0x4f')]=function(_0x553790,_0x42e225,_0x4e8915){if(_0x553790[_0x0fdb('0x4a')]['id']){delete _0x553790[_0x0fdb('0x4a')]['id'];}return db['VtigerAccount'][_0x0fdb('0x4c')]({'where':{'id':_0x553790[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x27')](handleEntityNotFound(_0x42e225,null))['then'](function(_0x7ae8c7){if(_0x7ae8c7){_0x553790['body']['AccountId']=_0x7ae8c7['id'];_0x553790[_0x0fdb('0x4a')][_0x0fdb('0x50')]=integrations[_0x0fdb('0x51')](_0x553790[_0x0fdb('0x4a')][_0x0fdb('0x52')],_0x553790['body']['type']);_0x553790[_0x0fdb('0x4a')][_0x0fdb('0x53')]=integrations[_0x0fdb('0x54')](_0x553790[_0x0fdb('0x4a')]['channel'],_0x553790[_0x0fdb('0x4a')]['type']);return db[_0x0fdb('0x4d')][_0x0fdb('0x48')](_0x553790[_0x0fdb('0x4a')],{'include':[{'model':db[_0x0fdb('0x55')],'as':'Subjects'},{'model':db[_0x0fdb('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x42e225,null))[_0x0fdb('0x49')](handleError(_0x42e225,null));};var md5=require(_0x0fdb('0x56'));exports[_0x0fdb('0x57')]=function(_0x4cd5c0,_0x11680e,_0x554398){var _0x34b90c=null;var _0x389bb4=null;var _0x3bd311=null;var _0x35f16d=null;var _0x10ecf8='';return db[_0x0fdb('0x3e')][_0x0fdb('0x4c')]({'where':{'id':_0x4cd5c0[_0x0fdb('0x42')]['id']},'attributes':['id',_0x0fdb('0x31'),_0x0fdb('0x58'),_0x0fdb('0x59'),_0x0fdb('0x5a'),_0x0fdb('0x5b'),_0x0fdb('0x5c'),_0x0fdb('0x5d')]})[_0x0fdb('0x27')](handleEntityNotFound(_0x11680e,null))['then'](function(_0x2d225b){if(_0x2d225b){_0x34b90c=_0x2d225b[_0x0fdb('0x58')];_0x389bb4=_0x2d225b['accessKey'];_0x3bd311=_0x2d225b[_0x0fdb('0x5a')];_0x10ecf8=_0x2d225b[_0x0fdb('0x5b')];var _0x38d2d4=_0x10ecf8[_0x0fdb('0x5e')](-0x1);if(_0x38d2d4==='/'){_0x10ecf8=_0x10ecf8[_0x0fdb('0x5f')](0x0,_0x10ecf8['lastIndexOf'](_0x38d2d4));}_0x35f16d=util[_0x0fdb('0x60')]('%s/webservice.php',_0x10ecf8);var _0x15025c={'method':_0x0fdb('0x61'),'uri':_0x35f16d,'qs':{'operation':_0x0fdb('0x62'),'username':_0x2d225b[_0x0fdb('0x58')]},'json':!![]};return rp(_0x15025c);}})['then'](function(_0x31b2c3){if(_0x31b2c3[_0x0fdb('0x63')]){var _0x5ce53e={'method':_0x0fdb('0x64'),'uri':_0x35f16d,'form':{'operation':_0x0fdb('0x65'),'username':_0x34b90c,'accessKey':md5(_0x31b2c3[_0x0fdb('0x66')]['token']+_0x389bb4)},'json':!![]};return rp(_0x5ce53e);}})[_0x0fdb('0x27')](function(_0x3a78a3){if(_0x3a78a3['success']){var _0xc31c63={'method':_0x0fdb('0x61'),'uri':_0x35f16d,'qs':{'operation':_0x0fdb('0x67'),'username':_0x34b90c,'sessionName':_0x3a78a3[_0x0fdb('0x66')][_0x0fdb('0x68')],'elementType':_0x3bd311},'json':!![]};return rp(_0xc31c63);}})['then'](function(_0x53a132){if(_0x53a132[_0x0fdb('0x63')]){var _0x3ec9a7=[_0x0fdb('0x69'),_0x0fdb('0x6a'),_0x0fdb('0x6b')];_[_0x0fdb('0x6c')](_0x53a132[_0x0fdb('0x66')][_0x0fdb('0x35')],function(_0x3a49f5){return _0x3ec9a7[_0x0fdb('0x6d')](_0x3a49f5[_0x0fdb('0x2f')][_0x0fdb('0x31')]);});_[_0x0fdb('0x6c')](_0x53a132['result']['fields'],function(_0x66d06b){return _0x66d06b['editable']===_0x0fdb('0x6e');});return{'count':_0x53a132[_0x0fdb('0x66')][_0x0fdb('0x35')][_0x0fdb('0x44')],'rows':_['map'](_0x53a132[_0x0fdb('0x66')][_0x0fdb('0x35')],function(_0x10fb60){return{'id':_0x10fb60[_0x0fdb('0x31')],'name':_0x10fb60[_0x0fdb('0x6f')],'custom':_[_0x0fdb('0x70')](_0x10fb60[_0x0fdb('0x31')],_0x0fdb('0x71'))?!![]:![],'options':_0x10fb60[_0x0fdb('0x2f')]['name']===_0x0fdb('0x72')&&_0x10fb60[_0x0fdb('0x2f')][_0x0fdb('0x73')][_0x0fdb('0x44')]>0x0?_['map'](_0x10fb60['type'][_0x0fdb('0x73')],function(_0xfc7053){return{'name':_0xfc7053[_0x0fdb('0x6f')],'value':_0xfc7053[_0x0fdb('0x74')]};}):[]};})};}})[_0x0fdb('0x27')](respondWithResult(_0x11680e,null))[_0x0fdb('0x49')](function(_0x36a936){console[_0x0fdb('0x75')](_0x0fdb('0x76')+_0x36a936);var _0x57299d=_0x4cd5c0[_0x0fdb('0x32')][_0x0fdb('0x77')]?0x1f4:_0x36a936[_0x0fdb('0x78')]||0x1f4;logger[_0x0fdb('0x29')](_0x0fdb('0x79'),_0x0fdb('0x57'),_0x57299d,JSON['stringify'](_0x36a936));delete _0x36a936[_0x0fdb('0x31')];if(_0x57299d===0x191){_0x57299d=0x190;}_0x11680e[_0x0fdb('0x1c')](_0x57299d)[_0x0fdb('0x7a')](_0x4cd5c0[_0x0fdb('0x32')][_0x0fdb('0x77')]?{'message':_0x0fdb('0x7b'),'statusCode':_0x36a936[_0x0fdb('0x78')]}:_0x36a936);});};
\ No newline at end of file
+var _0x1e82=['owner','remove','includes','false','startsWith','picklist','picklistValues','label','value','log','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','destroy','then','end','name','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','includeAll','VtigerAccount','findAll','rows','show','params','rawAttributes','include','options','find','create','body','catch','update','getConfigurations','VtigerConfiguration','order','pick','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','findOne','description','remoteUri','accessKey','username','moduleName','substring','lastIndexOf','format','GET','getchallenge','success','login','result','token','describe','sessionName','reference'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1e82,0x7e));var _0x21e8=function(_0xd20146,_0x5b914c){_0xd20146=_0xd20146-0x0;var _0x38aa68=_0x1e82[_0xd20146];return _0x38aa68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21e8('0x0'));var zipdir=require(_0x21e8('0x1'));var jsonpatch=require(_0x21e8('0x2'));var rp=require('request-promise');var moment=require(_0x21e8('0x3'));var BPromise=require(_0x21e8('0x4'));var Mustache=require('mustache');var util=require(_0x21e8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x21e8('0x6'));var ejs=require(_0x21e8('0x7'));var fs=require('fs');var fs_extra=require(_0x21e8('0x8'));var _=require('lodash');var squel=require(_0x21e8('0x9'));var crypto=require(_0x21e8('0xa'));var jsforce=require(_0x21e8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x21e8('0x6'));var querystring=require(_0x21e8('0xc'));var Papa=require(_0x21e8('0xd'));var Redis=require(_0x21e8('0xe'));var authService=require(_0x21e8('0xf'));var qs=require(_0x21e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21e8('0x11'));var logger=require('../../config/logger')(_0x21e8('0x12'));var utils=require(_0x21e8('0x13'));var config=require(_0x21e8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x21e8('0x15'))['db'];var integrations=require(_0x21e8('0x16'));function respondWithStatusCode(_0x11ef18,_0x1326ae){_0x1326ae=_0x1326ae||0xcc;return function(_0x1292cd){if(_0x1292cd){return _0x11ef18[_0x21e8('0x17')](_0x1326ae);}return _0x11ef18[_0x21e8('0x18')](_0x1326ae)['end']();};}function respondWithResult(_0x1d3cef,_0x1c3871){_0x1c3871=_0x1c3871||0xc8;return function(_0x546a81){if(_0x546a81){return _0x1d3cef[_0x21e8('0x18')](_0x1c3871)['json'](_0x546a81);}};}function respondWithFilteredResult(_0x456eb2,_0x1a2ffe){return function(_0x115179){if(_0x115179){var _0x15e2b0=typeof _0x1a2ffe[_0x21e8('0x19')]===_0x21e8('0x1a')&&typeof _0x1a2ffe[_0x21e8('0x1b')]==='undefined';var _0x3dd712=_0x115179[_0x21e8('0x1c')];var _0x1c6c47=_0x15e2b0?0x0:_0x1a2ffe[_0x21e8('0x19')];var _0x549be2=_0x15e2b0?_0x115179[_0x21e8('0x1c')]:_0x1a2ffe['offset']+_0x1a2ffe[_0x21e8('0x1b')];var _0x825680;if(_0x549be2>=_0x3dd712){_0x549be2=_0x3dd712;_0x825680=0xc8;}else{_0x825680=0xce;}_0x456eb2['status'](_0x825680);return _0x456eb2[_0x21e8('0x1d')](_0x21e8('0x1e'),_0x1c6c47+'-'+_0x549be2+'/'+_0x3dd712)[_0x21e8('0x1f')](_0x115179);}return null;};}function patchUpdates(_0x2670ac){return function(_0x160cab){try{jsonpatch[_0x21e8('0x20')](_0x160cab,_0x2670ac,!![]);}catch(_0x477f30){return BPromise['reject'](_0x477f30);}return _0x160cab['save']();};}function saveUpdates(_0x35f373,_0x25ffeb){return function(_0x13ecab){if(_0x13ecab){return _0x13ecab['update'](_0x35f373)['then'](function(_0x228139){return _0x228139;});}return null;};}function removeEntity(_0x5c0a71,_0x1dec1d){return function(_0x2b5f6b){if(_0x2b5f6b){return _0x2b5f6b[_0x21e8('0x21')]()[_0x21e8('0x22')](function(){_0x5c0a71[_0x21e8('0x18')](0xcc)[_0x21e8('0x23')]();});}};}function handleEntityNotFound(_0xb5c722,_0x1cebf6){return function(_0x49ce48){if(!_0x49ce48){_0xb5c722[_0x21e8('0x17')](0x194);}return _0x49ce48;};}function handleError(_0x11ba6c,_0x57fa27){_0x57fa27=_0x57fa27||0x1f4;return function(_0x2d06c3){logger['error'](_0x2d06c3['stack']);if(_0x2d06c3[_0x21e8('0x24')]){delete _0x2d06c3[_0x21e8('0x24')];}_0x11ba6c[_0x21e8('0x18')](_0x57fa27)['send'](_0x2d06c3);};}exports['index']=function(_0x1fd6e4,_0xaf3a36){var _0x2d4d60={},_0xf0d235={},_0x159e9e={'count':0x0,'rows':[]};var _0x56eb31=_[_0x21e8('0x25')](db['VtigerAccount']['rawAttributes'],function(_0x55ab3a){return{'name':_0x55ab3a[_0x21e8('0x26')],'type':_0x55ab3a['type']['key']};});_0xf0d235[_0x21e8('0x27')]=_[_0x21e8('0x25')](_0x56eb31,'name');_0xf0d235[_0x21e8('0x28')]=_[_0x21e8('0x29')](_0x1fd6e4[_0x21e8('0x28')]);_0xf0d235[_0x21e8('0x2a')]=_[_0x21e8('0x2b')](_0xf0d235[_0x21e8('0x27')],_0xf0d235['query']);_0x2d4d60['attributes']=_[_0x21e8('0x2b')](_0xf0d235[_0x21e8('0x27')],qs[_0x21e8('0x2c')](_0x1fd6e4['query'][_0x21e8('0x2c')]));_0x2d4d60[_0x21e8('0x2d')]=_0x2d4d60[_0x21e8('0x2d')][_0x21e8('0x2e')]?_0x2d4d60[_0x21e8('0x2d')]:_0xf0d235['model'];if(!_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x2f')](_0x21e8('0x30'))){_0x2d4d60[_0x21e8('0x1b')]=qs[_0x21e8('0x1b')](_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x1b')]);_0x2d4d60['offset']=qs['offset'](_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x19')]);}_0x2d4d60['order']=qs['sort'](_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x31')]);_0x2d4d60[_0x21e8('0x32')]=qs['filters'](_['pick'](_0x1fd6e4[_0x21e8('0x28')],_0xf0d235[_0x21e8('0x2a')]),_0x56eb31);if(_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x33')]){_0x2d4d60['where']=_[_0x21e8('0x34')](_0x2d4d60[_0x21e8('0x32')],{'$or':_[_0x21e8('0x25')](_0x56eb31,function(_0x1e50b6){if(_0x1e50b6[_0x21e8('0x35')]!=='VIRTUAL'){var _0x70393a={};_0x70393a[_0x1e50b6[_0x21e8('0x24')]]={'$like':'%'+_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x33')]+'%'};return _0x70393a;}})});}_0x2d4d60=_[_0x21e8('0x34')]({},_0x2d4d60,_0x1fd6e4['options']);var _0x35199a={'where':_0x2d4d60['where']};return db['VtigerAccount'][_0x21e8('0x1c')](_0x35199a)[_0x21e8('0x22')](function(_0x5f43a0){_0x159e9e['count']=_0x5f43a0;if(_0x1fd6e4[_0x21e8('0x28')][_0x21e8('0x36')]){_0x2d4d60['include']=[{'all':!![]}];}return db[_0x21e8('0x37')][_0x21e8('0x38')](_0x2d4d60);})['then'](function(_0x21d1e2){_0x159e9e[_0x21e8('0x39')]=_0x21d1e2;return _0x159e9e;})[_0x21e8('0x22')](respondWithFilteredResult(_0xaf3a36,_0x2d4d60))['catch'](handleError(_0xaf3a36,null));};exports[_0x21e8('0x3a')]=function(_0x11bc86,_0x18b898){var _0x365140={'raw':![],'where':{'id':_0x11bc86[_0x21e8('0x3b')]['id']}},_0x3a7b8b={};_0x3a7b8b[_0x21e8('0x27')]=_['keys'](db['VtigerAccount'][_0x21e8('0x3c')]);_0x3a7b8b[_0x21e8('0x28')]=_['keys'](_0x11bc86['query']);_0x3a7b8b[_0x21e8('0x2a')]=_[_0x21e8('0x2b')](_0x3a7b8b['model'],_0x3a7b8b[_0x21e8('0x28')]);_0x365140[_0x21e8('0x2d')]=_['intersection'](_0x3a7b8b['model'],qs[_0x21e8('0x2c')](_0x11bc86['query'][_0x21e8('0x2c')]));_0x365140['attributes']=_0x365140[_0x21e8('0x2d')][_0x21e8('0x2e')]?_0x365140[_0x21e8('0x2d')]:_0x3a7b8b[_0x21e8('0x27')];if(_0x11bc86[_0x21e8('0x28')][_0x21e8('0x36')]){_0x365140[_0x21e8('0x3d')]=[{'all':!![]}];}_0x365140=_[_0x21e8('0x34')]({},_0x365140,_0x11bc86[_0x21e8('0x3e')]);return db[_0x21e8('0x37')][_0x21e8('0x3f')](_0x365140)['then'](handleEntityNotFound(_0x18b898,null))[_0x21e8('0x22')](respondWithResult(_0x18b898,null))['catch'](handleError(_0x18b898,null));};exports[_0x21e8('0x40')]=function(_0x1b871b,_0x2cda05){return db['VtigerAccount'][_0x21e8('0x40')](_0x1b871b[_0x21e8('0x41')],{})[_0x21e8('0x22')](respondWithResult(_0x2cda05,0xc9))[_0x21e8('0x42')](handleError(_0x2cda05,null));};exports[_0x21e8('0x43')]=function(_0x3d5da7,_0x81981a){if(_0x3d5da7[_0x21e8('0x41')]['id']){delete _0x3d5da7[_0x21e8('0x41')]['id'];}return db[_0x21e8('0x37')][_0x21e8('0x3f')]({'where':{'id':_0x3d5da7[_0x21e8('0x3b')]['id']}})[_0x21e8('0x22')](handleEntityNotFound(_0x81981a,null))[_0x21e8('0x22')](saveUpdates(_0x3d5da7['body'],null))[_0x21e8('0x22')](respondWithResult(_0x81981a,null))[_0x21e8('0x42')](handleError(_0x81981a,null));};exports[_0x21e8('0x21')]=function(_0x1af524,_0x54b0c9){return db[_0x21e8('0x37')][_0x21e8('0x3f')]({'where':{'id':_0x1af524[_0x21e8('0x3b')]['id']}})[_0x21e8('0x22')](handleEntityNotFound(_0x54b0c9,null))[_0x21e8('0x22')](removeEntity(_0x54b0c9,null))['catch'](handleError(_0x54b0c9,null));};exports[_0x21e8('0x44')]=function(_0x391b1e,_0x3c2bab,_0x267223){var _0x2b77ec={};var _0x1c0501={};var _0xab949f;var _0x11fe17;return db[_0x21e8('0x37')]['findOne']({'where':{'id':_0x391b1e[_0x21e8('0x3b')]['id']}})[_0x21e8('0x22')](handleEntityNotFound(_0x3c2bab,null))['then'](function(_0x285f24){if(_0x285f24){_0xab949f=_0x285f24;_0x1c0501[_0x21e8('0x27')]=_[_0x21e8('0x29')](db[_0x21e8('0x45')][_0x21e8('0x3c')]);_0x1c0501[_0x21e8('0x28')]=_[_0x21e8('0x29')](_0x391b1e['query']);_0x1c0501[_0x21e8('0x2a')]=_[_0x21e8('0x2b')](_0x1c0501[_0x21e8('0x27')],_0x1c0501[_0x21e8('0x28')]);_0x2b77ec[_0x21e8('0x2d')]=_[_0x21e8('0x2b')](_0x1c0501[_0x21e8('0x27')],qs['fields'](_0x391b1e[_0x21e8('0x28')]['fields']));_0x2b77ec[_0x21e8('0x2d')]=_0x2b77ec['attributes']['length']?_0x2b77ec[_0x21e8('0x2d')]:_0x1c0501[_0x21e8('0x27')];_0x2b77ec[_0x21e8('0x46')]=qs[_0x21e8('0x31')](_0x391b1e[_0x21e8('0x28')][_0x21e8('0x31')]);_0x2b77ec[_0x21e8('0x32')]=qs[_0x21e8('0x2a')](_[_0x21e8('0x47')](_0x391b1e[_0x21e8('0x28')],_0x1c0501['filters']));if(_0x391b1e[_0x21e8('0x28')][_0x21e8('0x33')]){_0x2b77ec[_0x21e8('0x32')]=_[_0x21e8('0x34')](_0x2b77ec['where'],{'$or':_[_0x21e8('0x25')](_0x2b77ec['attributes'],function(_0x4d5f9c){var _0x7f9624={};_0x7f9624[_0x4d5f9c]={'$like':'%'+_0x391b1e['query']['filter']+'%'};return _0x7f9624;})});}_0x2b77ec=_['merge']({},_0x2b77ec,_0x391b1e['options']);return _0xab949f[_0x21e8('0x44')](_0x2b77ec);}})[_0x21e8('0x22')](function(_0x2bb499){if(_0x2bb499){_0x11fe17=_0x2bb499[_0x21e8('0x2e')];if(!_0x391b1e[_0x21e8('0x28')]['hasOwnProperty'](_0x21e8('0x30'))){_0x2b77ec['limit']=qs[_0x21e8('0x1b')](_0x391b1e[_0x21e8('0x28')][_0x21e8('0x1b')]);_0x2b77ec[_0x21e8('0x19')]=qs['offset'](_0x391b1e[_0x21e8('0x28')][_0x21e8('0x19')]);}return _0xab949f[_0x21e8('0x44')](_0x2b77ec);}})[_0x21e8('0x22')](function(_0x572aa3){if(_0x572aa3){return _0x572aa3?{'count':_0x11fe17,'rows':_0x572aa3}:null;}})[_0x21e8('0x22')](respondWithResult(_0x3c2bab,null))[_0x21e8('0x42')](handleError(_0x3c2bab,null));};exports['addConfiguration']=function(_0x447d9d,_0x2fa537,_0x45b7d5){if(_0x447d9d[_0x21e8('0x41')]['id']){delete _0x447d9d[_0x21e8('0x41')]['id'];}return db[_0x21e8('0x37')]['findOne']({'where':{'id':_0x447d9d[_0x21e8('0x3b')]['id']}})[_0x21e8('0x22')](handleEntityNotFound(_0x2fa537,null))[_0x21e8('0x22')](function(_0x5b17d3){if(_0x5b17d3){_0x447d9d[_0x21e8('0x41')]['AccountId']=_0x5b17d3['id'];_0x447d9d['body']['Subjects']=integrations[_0x21e8('0x48')](_0x447d9d[_0x21e8('0x41')][_0x21e8('0x49')],_0x447d9d[_0x21e8('0x41')][_0x21e8('0x35')]);_0x447d9d['body'][_0x21e8('0x4a')]=integrations[_0x21e8('0x4b')](_0x447d9d[_0x21e8('0x41')][_0x21e8('0x49')],_0x447d9d[_0x21e8('0x41')][_0x21e8('0x35')]);return db[_0x21e8('0x45')][_0x21e8('0x40')](_0x447d9d['body'],{'include':[{'model':db[_0x21e8('0x4c')],'as':'Subjects'},{'model':db[_0x21e8('0x4c')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2fa537,null))[_0x21e8('0x42')](handleError(_0x2fa537,null));};var md5=require(_0x21e8('0x4d'));exports['getFields']=function(_0x93f95e,_0x13b29f,_0xfda12f){var _0x5f45a0=null;var _0x929e18=null;var _0x16f93e=null;var _0x1d5c5d=null;var _0x3a9297='';return db[_0x21e8('0x37')][_0x21e8('0x4e')]({'where':{'id':_0x93f95e[_0x21e8('0x3b')]['id']},'attributes':['id',_0x21e8('0x24'),'username',_0x21e8('0x4f'),'moduleName',_0x21e8('0x50'),'serverUrl',_0x21e8('0x51')]})['then'](handleEntityNotFound(_0x13b29f,null))[_0x21e8('0x22')](function(_0x1d274e){if(_0x1d274e){_0x5f45a0=_0x1d274e[_0x21e8('0x52')];_0x929e18=_0x1d274e[_0x21e8('0x51')];_0x16f93e=_0x1d274e[_0x21e8('0x53')];_0x3a9297=_0x1d274e[_0x21e8('0x50')];var _0x1fed8d=_0x3a9297['slice'](-0x1);if(_0x1fed8d==='/'){_0x3a9297=_0x3a9297[_0x21e8('0x54')](0x0,_0x3a9297[_0x21e8('0x55')](_0x1fed8d));}_0x1d5c5d=util[_0x21e8('0x56')]('%s/webservice.php',_0x3a9297);var _0x3b0fb4={'method':_0x21e8('0x57'),'uri':_0x1d5c5d,'qs':{'operation':_0x21e8('0x58'),'username':_0x1d274e[_0x21e8('0x52')]},'json':!![]};return rp(_0x3b0fb4);}})[_0x21e8('0x22')](function(_0x22aa9d){if(_0x22aa9d[_0x21e8('0x59')]){var _0x4f3b5d={'method':'POST','uri':_0x1d5c5d,'form':{'operation':_0x21e8('0x5a'),'username':_0x5f45a0,'accessKey':md5(_0x22aa9d[_0x21e8('0x5b')][_0x21e8('0x5c')]+_0x929e18)},'json':!![]};return rp(_0x4f3b5d);}})[_0x21e8('0x22')](function(_0x546bb4){if(_0x546bb4[_0x21e8('0x59')]){var _0x3738f2={'method':_0x21e8('0x57'),'uri':_0x1d5c5d,'qs':{'operation':_0x21e8('0x5d'),'username':_0x5f45a0,'sessionName':_0x546bb4[_0x21e8('0x5b')][_0x21e8('0x5e')],'elementType':_0x16f93e},'json':!![]};return rp(_0x3738f2);}})['then'](function(_0x4e288a){if(_0x4e288a['success']){var _0x30560a=['autogenerated',_0x21e8('0x5f'),_0x21e8('0x60')];_[_0x21e8('0x61')](_0x4e288a[_0x21e8('0x5b')]['fields'],function(_0x30e801){return _0x30560a[_0x21e8('0x62')](_0x30e801[_0x21e8('0x35')][_0x21e8('0x24')]);});_['remove'](_0x4e288a['result'][_0x21e8('0x2c')],function(_0x3ee073){return _0x3ee073['editable']===_0x21e8('0x63');});return{'count':_0x4e288a['result'][_0x21e8('0x2c')]['length'],'rows':_['map'](_0x4e288a[_0x21e8('0x5b')][_0x21e8('0x2c')],function(_0x3d48aa){return{'id':_0x3d48aa[_0x21e8('0x24')],'name':_0x3d48aa['label'],'custom':_[_0x21e8('0x64')](_0x3d48aa['name'],'cf_')?!![]:![],'options':_0x3d48aa[_0x21e8('0x35')][_0x21e8('0x24')]===_0x21e8('0x65')&&_0x3d48aa['type']['picklistValues'][_0x21e8('0x2e')]>0x0?_[_0x21e8('0x25')](_0x3d48aa['type'][_0x21e8('0x66')],function(_0x352304){return{'name':_0x352304[_0x21e8('0x67')],'value':_0x352304[_0x21e8('0x68')]};}):[]};})};}})[_0x21e8('0x22')](respondWithResult(_0x13b29f,null))[_0x21e8('0x42')](function(_0x16b4a9){console[_0x21e8('0x69')]('vTiger\x20error:\x20'+_0x16b4a9);var _0x45d667=_0x93f95e['query'][_0x21e8('0x6a')]?0x1f4:_0x16b4a9[_0x21e8('0x6b')]||0x1f4;logger[_0x21e8('0x6c')](_0x21e8('0x6d'),'getFields',_0x45d667,JSON['stringify'](_0x16b4a9));delete _0x16b4a9['name'];if(_0x45d667===0x191){_0x45d667=0x190;}_0x13b29f[_0x21e8('0x18')](_0x45d667)['send'](_0x93f95e[_0x21e8('0x28')][_0x21e8('0x6a')]?{'message':_0x21e8('0x6e'),'statusCode':_0x16b4a9[_0x21e8('0x6b')]}:_0x16b4a9);});};
\ No newline at end of file
index e439298..821dff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7948=['int_vtiger_accounts','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x9a8878,_0x2ef1b8){var _0x5f36a8=function(_0x5b6079){while(--_0x5b6079){_0x9a8878['push'](_0x9a8878['shift']());}};_0x5f36a8(++_0x2ef1b8);}(_0x7948,0xc7));var _0x8794=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x7948[_0x259d17];return _0x407535;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8794('0x0'))(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require('bluebird');var rp=require(_0x8794('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8794('0x4'));var config=require(_0x8794('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x8794('0x6'));module[_0x8794('0x7')]=function(_0x870a5e,_0xa8baa4){return _0x870a5e[_0x8794('0x8')](_0x8794('0x9'),attributes,{'tableName':_0x8794('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d38=['define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x3d38,0xe3));var _0x83d3=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x3d38[_0x55bd12];return _0x1941dd;};'use strict';var _=require(_0x83d3('0x0'));var util=require('util');var logger=require(_0x83d3('0x1'))(_0x83d3('0x2'));var moment=require(_0x83d3('0x3'));var BPromise=require(_0x83d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83d3('0x5'));var rimraf=require(_0x83d3('0x6'));var config=require(_0x83d3('0x7'));var attributes=require(_0x83d3('0x8'));var integrations=require(_0x83d3('0x9'));module[_0x83d3('0xa')]=function(_0x7d3da3,_0x37e689){return _0x7d3da3[_0x83d3('0xb')](_0x83d3('0xc'),attributes,{'tableName':_0x83d3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 466676b..25e742d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b8=['jayson/promise','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5d4898,_0x57d66e){var _0x4d2ebc=function(_0x53026d){while(--_0x53026d){_0x5d4898['push'](_0x5d4898['shift']());}};_0x4d2ebc(++_0x57d66e);}(_0x04b8,0x159));var _0x804b=function(_0x4c1736,_0x2e3450){_0x4c1736=_0x4c1736-0x0;var _0x12543a=_0x04b8[_0x4c1736];return _0x12543a;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')]({'raw':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x16')]||null:null,'attributes':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x17')]||null:null,'limit':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x18')]||null:null,'include':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['include']?_[_0x804b('0x19')](_0x3a05c0[_0x804b('0x15')]['include'],function(_0x44a921){return{'model':db[_0x44a921[_0x804b('0x1a')]],'as':_0x44a921['as'],'attributes':_0x44a921[_0x804b('0x17')],'include':_0x44a921[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x44a921['include'],function(_0x2de812){return{'model':db[_0x2de812[_0x804b('0x1a')]],'as':_0x2de812['as'],'attributes':_0x2de812['attributes'],'include':_0x2de812[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x2de812[_0x804b('0x1b')],function(_0x27d5ec){return{'model':db[_0x27d5ec[_0x804b('0x1a')]],'as':_0x27d5ec['as'],'attributes':_0x27d5ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x804b('0x9')](function(_0x22f822){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x1c')]('GetVtigerAccount',_0x3a05c0,JSON[_0x804b('0xe')](_0x22f822));_0x871d6c(_0x22f822);})[_0x804b('0x1d')](function(_0x410871){logger['error'](_0x804b('0x12'),_0x410871[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x410871['message']));});});};exports[_0x804b('0x1e')]=function(_0x471c04){var _0x5e8f85=this;return new Promise(function(_0x391376,_0x37dd3e){return db[_0x804b('0x13')][_0x804b('0x1f')]({'raw':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x16')]||null:null,'attributes':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x17')]||null:null,'include':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x1b')]?_[_0x804b('0x19')](_0x471c04[_0x804b('0x15')][_0x804b('0x1b')],function(_0x34d5d0){return{'model':db[_0x34d5d0[_0x804b('0x1a')]],'as':_0x34d5d0['as'],'attributes':_0x34d5d0[_0x804b('0x17')],'include':_0x34d5d0[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x34d5d0[_0x804b('0x1b')],function(_0xf47023){return{'model':db[_0xf47023[_0x804b('0x1a')]],'as':_0xf47023['as'],'attributes':_0xf47023[_0x804b('0x17')],'include':_0xf47023[_0x804b('0x1b')]?_[_0x804b('0x19')](_0xf47023[_0x804b('0x1b')],function(_0x35150b){return{'model':db[_0x35150b['model']],'as':_0x35150b['as'],'attributes':_0x35150b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da331){logger[_0x804b('0xa')](_0x804b('0x1e'),_0x471c04);logger['debug']('ShowVtigerAccount',_0x471c04,JSON['stringify'](_0x3da331));_0x391376(_0x3da331);})[_0x804b('0x1d')](function(_0x1aaa47){logger[_0x804b('0xf')](_0x804b('0x1e'),_0x1aaa47[_0x804b('0x11')],_0x471c04);_0x37dd3e(_0x5e8f85[_0x804b('0xf')](0x1f4,_0x1aaa47[_0x804b('0x11')]));});});};
\ No newline at end of file
+var _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x14f456,_0x3b6bb7){var _0x444e80=function(_0x76c6f3){while(--_0x76c6f3){_0x14f456['push'](_0x14f456['shift']());}};_0x444e80(++_0x3b6bb7);}(_0xda3f,0xec));var _0xfda3=function(_0x36968a,_0x55b46d){_0x36968a=_0x36968a-0x0;var _0x4af5b5=_0xda3f[_0x36968a];return _0x4af5b5;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});};
\ No newline at end of file
index 80943ef..36f7556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb160=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x46b43c,_0x165b74){var _0x534daa=function(_0x4b9c22){while(--_0x4b9c22){_0x46b43c['push'](_0x46b43c['shift']());}};_0x534daa(++_0x165b74);}(_0xb160,0x1ca));var _0x0b16=function(_0x1c2ca8,_0x5ec20d){_0x1c2ca8=_0x1c2ca8-0x0;var _0x5e48af=_0xb160[_0x1c2ca8];return _0x5e48af;};'use strict';var multer=require(_0x0b16('0x0'));var util=require(_0x0b16('0x1'));var path=require(_0x0b16('0x2'));var timeout=require(_0x0b16('0x3'));var express=require('express');var router=express[_0x0b16('0x4')]();var fs_extra=require(_0x0b16('0x5'));var auth=require(_0x0b16('0x6'));var interaction=require(_0x0b16('0x7'));var config=require(_0x0b16('0x8'));var controller=require(_0x0b16('0x9'));router['get']('/',auth[_0x0b16('0xa')](),controller['index']);router[_0x0b16('0xb')](_0x0b16('0xc'),auth[_0x0b16('0xa')](),controller[_0x0b16('0xd')]);router['get'](_0x0b16('0xe'),auth[_0x0b16('0xa')](),controller['getFields']);router[_0x0b16('0xb')](_0x0b16('0xf'),auth[_0x0b16('0xa')](),controller['getSubjects']);router['get'](_0x0b16('0x10'),auth[_0x0b16('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x0b16('0xa')](),controller[_0x0b16('0x11')]);router[_0x0b16('0x12')](_0x0b16('0xc'),auth[_0x0b16('0xa')](),controller[_0x0b16('0x13')]);router['delete'](_0x0b16('0xc'),auth[_0x0b16('0xa')](),controller[_0x0b16('0x14')]);module[_0x0b16('0x15')]=router;
\ No newline at end of file
+var _0x3808=['getFields','/:id/subjects','getSubjects','post','create','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x763b9,_0x17e0e7){var _0x2a3d09=function(_0x4690d2){while(--_0x4690d2){_0x763b9['push'](_0x763b9['shift']());}};_0x2a3d09(++_0x17e0e7);}(_0x3808,0x1c0));var _0x8380=function(_0x26af6c,_0x287c5c){_0x26af6c=_0x26af6c-0x0;var _0x489d2f=_0x3808[_0x26af6c];return _0x489d2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8380('0x0'));var timeout=require(_0x8380('0x1'));var express=require(_0x8380('0x2'));var router=express[_0x8380('0x3')]();var fs_extra=require(_0x8380('0x4'));var auth=require(_0x8380('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8380('0x6'));var controller=require(_0x8380('0x7'));router[_0x8380('0x8')]('/',auth['isAuthenticated'](),controller[_0x8380('0x9')]);router[_0x8380('0x8')](_0x8380('0xa'),auth[_0x8380('0xb')](),controller[_0x8380('0xc')]);router['get'](_0x8380('0xd'),auth['isAuthenticated'](),controller[_0x8380('0xe')]);router['get'](_0x8380('0xf'),auth['isAuthenticated'](),controller[_0x8380('0x10')]);router[_0x8380('0x8')]('/:id/descriptions',auth[_0x8380('0xb')](),controller['getDescriptions']);router[_0x8380('0x11')]('/',auth[_0x8380('0xb')](),controller[_0x8380('0x12')]);router['put'](_0x8380('0xa'),auth[_0x8380('0xb')](),controller['update']);router['delete']('/:id',auth[_0x8380('0xb')](),controller[_0x8380('0x13')]);module[_0x8380('0x14')]=router;
\ No newline at end of file
index 5d3cd01..50476ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32de=['STRING','sequelize','exports'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x32de,0xaf));var _0xe32d=function(_0x1fdf47,_0x1da0d0){_0x1fdf47=_0x1fdf47-0x0;var _0x2f42d3=_0x32de[_0x1fdf47];return _0x2f42d3;};'use strict';var Sequelize=require(_0xe32d('0x0'));module[_0xe32d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe32d('0x2')]}};
\ No newline at end of file
+var _0x7114=['exports','STRING'];(function(_0x13451f,_0x54718a){var _0x550056=function(_0x59515f){while(--_0x59515f){_0x13451f['push'](_0x13451f['shift']());}};_0x550056(++_0x54718a);}(_0x7114,0x154));var _0x4711=function(_0x3c2180,_0x4b42fa){_0x3c2180=_0x3c2180-0x0;var _0x1aab89=_0x7114[_0x3c2180];return _0x1aab89;};'use strict';var Sequelize=require('sequelize');module[_0x4711('0x0')]={'name':{'type':Sequelize[_0x4711('0x1')]},'description':{'type':Sequelize[_0x4711('0x1')]}};
\ No newline at end of file
index 35a7127..8cbadde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96c7=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','filters','intersection','query','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','getFields','VtigerField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x34771f,_0x3d02d5){var _0x5d1952=function(_0x407f8e){while(--_0x407f8e){_0x34771f['push'](_0x34771f['shift']());}};_0x5d1952(++_0x3d02d5);}(_0x96c7,0xe0));var _0x796c=function(_0x268568,_0x29e496){_0x268568=_0x268568-0x0;var _0x40b6f4=_0x96c7[_0x268568];return _0x40b6f4;};'use strict';var emlformat=require(_0x796c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x796c('0x1'));var moment=require(_0x796c('0x2'));var BPromise=require(_0x796c('0x3'));var Mustache=require(_0x796c('0x4'));var util=require(_0x796c('0x5'));var path=require(_0x796c('0x6'));var sox=require(_0x796c('0x7'));var csv=require(_0x796c('0x8'));var ejs=require(_0x796c('0x9'));var fs=require('fs');var fs_extra=require(_0x796c('0xa'));var _=require('lodash');var squel=require(_0x796c('0xb'));var crypto=require(_0x796c('0xc'));var jsforce=require(_0x796c('0xd'));var deskjs=require(_0x796c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x796c('0xf'));var Redis=require(_0x796c('0x10'));var authService=require(_0x796c('0x11'));var qs=require(_0x796c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x796c('0x13'));var logger=require(_0x796c('0x14'))(_0x796c('0x15'));var utils=require(_0x796c('0x16'));var config=require(_0x796c('0x17'));var licenseUtil=require(_0x796c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x549582,_0x2c5afc){_0x2c5afc=_0x2c5afc||0xcc;return function(_0x532d9a){if(_0x532d9a){return _0x549582[_0x796c('0x19')](_0x2c5afc);}return _0x549582['status'](_0x2c5afc)[_0x796c('0x1a')]();};}function respondWithResult(_0x40bcb6,_0x4b21e5){_0x4b21e5=_0x4b21e5||0xc8;return function(_0x12b095){if(_0x12b095){return _0x40bcb6[_0x796c('0x1b')](_0x4b21e5)['json'](_0x12b095);}};}function respondWithFilteredResult(_0x181a1c,_0x1a8ff3){return function(_0x358cb7){if(_0x358cb7){var _0x283a79=typeof _0x1a8ff3[_0x796c('0x1c')]==='undefined'&&typeof _0x1a8ff3['limit']===_0x796c('0x1d');var _0x176a1a=_0x358cb7['count'];var _0x57807b=_0x283a79?0x0:_0x1a8ff3[_0x796c('0x1c')];var _0x406f65=_0x283a79?_0x358cb7[_0x796c('0x1e')]:_0x1a8ff3['offset']+_0x1a8ff3['limit'];var _0x2c2f6c;if(_0x406f65>=_0x176a1a){_0x406f65=_0x176a1a;_0x2c2f6c=0xc8;}else{_0x2c2f6c=0xce;}_0x181a1c['status'](_0x2c2f6c);return _0x181a1c[_0x796c('0x1f')]('Content-Range',_0x57807b+'-'+_0x406f65+'/'+_0x176a1a)[_0x796c('0x20')](_0x358cb7);}return null;};}function patchUpdates(_0x4f3774){return function(_0x27a7aa){try{jsonpatch[_0x796c('0x21')](_0x27a7aa,_0x4f3774,!![]);}catch(_0x4dba2a){return BPromise[_0x796c('0x22')](_0x4dba2a);}return _0x27a7aa[_0x796c('0x23')]();};}function saveUpdates(_0x219a90,_0x5a2327){return function(_0x26a41a){if(_0x26a41a){return _0x26a41a[_0x796c('0x24')](_0x219a90)['then'](function(_0x29cd48){return _0x29cd48;});}return null;};}function removeEntity(_0x502047,_0x315be0){return function(_0x24e018){if(_0x24e018){return _0x24e018[_0x796c('0x25')]()[_0x796c('0x26')](function(){_0x502047['status'](0xcc)[_0x796c('0x1a')]();});}};}function handleEntityNotFound(_0x1a589f,_0x375258){return function(_0x33f097){if(!_0x33f097){_0x1a589f[_0x796c('0x19')](0x194);}return _0x33f097;};}function handleError(_0x4dacbf,_0x1ba852){_0x1ba852=_0x1ba852||0x1f4;return function(_0x9f5d5d){logger[_0x796c('0x27')](_0x9f5d5d[_0x796c('0x28')]);if(_0x9f5d5d['name']){delete _0x9f5d5d[_0x796c('0x29')];}_0x4dacbf[_0x796c('0x1b')](_0x1ba852)['send'](_0x9f5d5d);};}exports[_0x796c('0x2a')]=function(_0x1d8246,_0x5939f8){var _0xe8df5={},_0x43794d={},_0x569e67={'count':0x0,'rows':[]};var _0x394fb3=_[_0x796c('0x2b')](db[_0x796c('0x2c')][_0x796c('0x2d')],function(_0x331116){return{'name':_0x331116[_0x796c('0x2e')],'type':_0x331116[_0x796c('0x2f')]['key']};});_0x43794d[_0x796c('0x30')]=_['map'](_0x394fb3,'name');_0x43794d['query']=_['keys'](_0x1d8246['query']);_0x43794d[_0x796c('0x31')]=_[_0x796c('0x32')](_0x43794d[_0x796c('0x30')],_0x43794d[_0x796c('0x33')]);_0xe8df5['attributes']=_[_0x796c('0x32')](_0x43794d[_0x796c('0x30')],qs[_0x796c('0x34')](_0x1d8246[_0x796c('0x33')][_0x796c('0x34')]));_0xe8df5[_0x796c('0x35')]=_0xe8df5[_0x796c('0x35')][_0x796c('0x36')]?_0xe8df5[_0x796c('0x35')]:_0x43794d[_0x796c('0x30')];if(!_0x1d8246[_0x796c('0x33')]['hasOwnProperty'](_0x796c('0x37'))){_0xe8df5[_0x796c('0x38')]=qs['limit'](_0x1d8246['query'][_0x796c('0x38')]);_0xe8df5[_0x796c('0x1c')]=qs[_0x796c('0x1c')](_0x1d8246[_0x796c('0x33')][_0x796c('0x1c')]);}_0xe8df5[_0x796c('0x39')]=qs[_0x796c('0x3a')](_0x1d8246[_0x796c('0x33')][_0x796c('0x3a')]);_0xe8df5[_0x796c('0x3b')]=qs[_0x796c('0x31')](_[_0x796c('0x3c')](_0x1d8246[_0x796c('0x33')],_0x43794d['filters']),_0x394fb3);if(_0x1d8246[_0x796c('0x33')][_0x796c('0x3d')]){_0xe8df5[_0x796c('0x3b')]=_['merge'](_0xe8df5[_0x796c('0x3b')],{'$or':_['map'](_0x394fb3,function(_0x2e936d){if(_0x2e936d['type']!==_0x796c('0x3e')){var _0x574cbc={};_0x574cbc[_0x2e936d[_0x796c('0x29')]]={'$like':'%'+_0x1d8246[_0x796c('0x33')][_0x796c('0x3d')]+'%'};return _0x574cbc;}})});}_0xe8df5=_[_0x796c('0x3f')]({},_0xe8df5,_0x1d8246[_0x796c('0x40')]);var _0x1b182a={'where':_0xe8df5[_0x796c('0x3b')]};return db[_0x796c('0x2c')][_0x796c('0x1e')](_0x1b182a)[_0x796c('0x26')](function(_0x2f7f28){_0x569e67['count']=_0x2f7f28;if(_0x1d8246['query'][_0x796c('0x41')]){_0xe8df5[_0x796c('0x42')]=[{'all':!![]}];}return db[_0x796c('0x2c')][_0x796c('0x43')](_0xe8df5);})['then'](function(_0x15d6aa){_0x569e67['rows']=_0x15d6aa;return _0x569e67;})[_0x796c('0x26')](respondWithFilteredResult(_0x5939f8,_0xe8df5))['catch'](handleError(_0x5939f8,null));};exports[_0x796c('0x44')]=function(_0x135e19,_0x485bec){var _0x4d2250={'raw':![],'where':{'id':_0x135e19[_0x796c('0x45')]['id']}},_0xefe20e={};_0xefe20e['model']=_[_0x796c('0x46')](db[_0x796c('0x2c')][_0x796c('0x2d')]);_0xefe20e[_0x796c('0x33')]=_[_0x796c('0x46')](_0x135e19[_0x796c('0x33')]);_0xefe20e[_0x796c('0x31')]=_[_0x796c('0x32')](_0xefe20e[_0x796c('0x30')],_0xefe20e[_0x796c('0x33')]);_0x4d2250[_0x796c('0x35')]=_[_0x796c('0x32')](_0xefe20e['model'],qs[_0x796c('0x34')](_0x135e19['query'][_0x796c('0x34')]));_0x4d2250[_0x796c('0x35')]=_0x4d2250['attributes'][_0x796c('0x36')]?_0x4d2250[_0x796c('0x35')]:_0xefe20e[_0x796c('0x30')];if(_0x135e19[_0x796c('0x33')][_0x796c('0x41')]){_0x4d2250[_0x796c('0x42')]=[{'all':!![]}];}_0x4d2250=_[_0x796c('0x3f')]({},_0x4d2250,_0x135e19[_0x796c('0x40')]);return db[_0x796c('0x2c')]['find'](_0x4d2250)[_0x796c('0x26')](handleEntityNotFound(_0x485bec,null))[_0x796c('0x26')](respondWithResult(_0x485bec,null))[_0x796c('0x47')](handleError(_0x485bec,null));};exports[_0x796c('0x48')]=function(_0x405b13,_0x596778){return db[_0x796c('0x2c')][_0x796c('0x48')](_0x405b13[_0x796c('0x49')],{})['then'](respondWithResult(_0x596778,0xc9))[_0x796c('0x47')](handleError(_0x596778,null));};exports[_0x796c('0x24')]=function(_0x4a5f76,_0xa3d70d){if(_0x4a5f76[_0x796c('0x49')]['id']){delete _0x4a5f76[_0x796c('0x49')]['id'];}return db[_0x796c('0x2c')][_0x796c('0x4a')]({'where':{'id':_0x4a5f76[_0x796c('0x45')]['id']}})[_0x796c('0x26')](handleEntityNotFound(_0xa3d70d,null))['then'](saveUpdates(_0x4a5f76[_0x796c('0x49')],null))[_0x796c('0x26')](respondWithResult(_0xa3d70d,null))[_0x796c('0x47')](handleError(_0xa3d70d,null));};exports[_0x796c('0x25')]=function(_0xec8f24,_0x43ed95){return db[_0x796c('0x2c')]['find']({'where':{'id':_0xec8f24[_0x796c('0x45')]['id']}})['then'](handleEntityNotFound(_0x43ed95,null))[_0x796c('0x26')](removeEntity(_0x43ed95,null))[_0x796c('0x47')](handleError(_0x43ed95,null));};exports[_0x796c('0x4b')]=function(_0x30fcd0,_0x4d807f,_0x161554){var _0x39c159={};var _0x2cc277={};var _0x2aa88e;var _0x470f02;return db[_0x796c('0x2c')]['findOne']({'where':{'id':_0x30fcd0[_0x796c('0x45')]['id']}})[_0x796c('0x26')](handleEntityNotFound(_0x4d807f,null))[_0x796c('0x26')](function(_0x1013cc){if(_0x1013cc){_0x2aa88e=_0x1013cc;_0x2cc277[_0x796c('0x30')]=_[_0x796c('0x46')](db[_0x796c('0x4c')][_0x796c('0x2d')]);_0x2cc277['query']=_[_0x796c('0x46')](_0x30fcd0[_0x796c('0x33')]);_0x2cc277[_0x796c('0x31')]=_[_0x796c('0x32')](_0x2cc277['model'],_0x2cc277[_0x796c('0x33')]);_0x39c159[_0x796c('0x35')]=_[_0x796c('0x32')](_0x2cc277['model'],qs['fields'](_0x30fcd0[_0x796c('0x33')]['fields']));_0x39c159[_0x796c('0x35')]=_0x39c159[_0x796c('0x35')]['length']?_0x39c159[_0x796c('0x35')]:_0x2cc277[_0x796c('0x30')];_0x39c159['order']=qs['sort'](_0x30fcd0[_0x796c('0x33')][_0x796c('0x3a')]);_0x39c159['where']=qs['filters'](_[_0x796c('0x3c')](_0x30fcd0['query'],_0x2cc277['filters']));if(_0x30fcd0[_0x796c('0x33')][_0x796c('0x3d')]){_0x39c159[_0x796c('0x3b')]=_['merge'](_0x39c159['where'],{'$or':_[_0x796c('0x2b')](_0x39c159['attributes'],function(_0x1cecc6){var _0x3098da={};_0x3098da[_0x1cecc6]={'$like':'%'+_0x30fcd0['query']['filter']+'%'};return _0x3098da;})});}_0x39c159=_['merge']({},_0x39c159,_0x30fcd0['options']);return _0x2aa88e['getFields'](_0x39c159);}})[_0x796c('0x26')](function(_0x275604){if(_0x275604){_0x470f02=_0x275604[_0x796c('0x36')];if(!_0x30fcd0[_0x796c('0x33')][_0x796c('0x4d')](_0x796c('0x37'))){_0x39c159[_0x796c('0x38')]=qs[_0x796c('0x38')](_0x30fcd0[_0x796c('0x33')]['limit']);_0x39c159['offset']=qs[_0x796c('0x1c')](_0x30fcd0[_0x796c('0x33')][_0x796c('0x1c')]);}return _0x2aa88e['getFields'](_0x39c159);}})[_0x796c('0x26')](function(_0x43ba91){if(_0x43ba91){return _0x43ba91?{'count':_0x470f02,'rows':_0x43ba91}:null;}})[_0x796c('0x26')](respondWithResult(_0x4d807f,null))[_0x796c('0x47')](handleError(_0x4d807f,null));};exports[_0x796c('0x4e')]=function(_0xaf7b3f,_0x1b4ad0,_0x338b79){var _0x431cf0={};var _0x356caf={};var _0x37c84b;var _0x5a1aba;return db[_0x796c('0x2c')][_0x796c('0x4f')]({'where':{'id':_0xaf7b3f[_0x796c('0x45')]['id']}})[_0x796c('0x26')](handleEntityNotFound(_0x1b4ad0,null))[_0x796c('0x26')](function(_0x44bee1){if(_0x44bee1){_0x37c84b=_0x44bee1;_0x356caf[_0x796c('0x30')]=_[_0x796c('0x46')](db[_0x796c('0x4c')][_0x796c('0x2d')]);_0x356caf[_0x796c('0x33')]=_[_0x796c('0x46')](_0xaf7b3f[_0x796c('0x33')]);_0x356caf['filters']=_[_0x796c('0x32')](_0x356caf[_0x796c('0x30')],_0x356caf['query']);_0x431cf0[_0x796c('0x35')]=_['intersection'](_0x356caf[_0x796c('0x30')],qs[_0x796c('0x34')](_0xaf7b3f[_0x796c('0x33')]['fields']));_0x431cf0[_0x796c('0x35')]=_0x431cf0['attributes']['length']?_0x431cf0[_0x796c('0x35')]:_0x356caf['model'];_0x431cf0['order']=qs['sort'](_0xaf7b3f[_0x796c('0x33')]['sort']);_0x431cf0[_0x796c('0x3b')]=qs[_0x796c('0x31')](_[_0x796c('0x3c')](_0xaf7b3f['query'],_0x356caf[_0x796c('0x31')]));if(_0xaf7b3f[_0x796c('0x33')]['filter']){_0x431cf0[_0x796c('0x3b')]=_[_0x796c('0x3f')](_0x431cf0[_0x796c('0x3b')],{'$or':_[_0x796c('0x2b')](_0x431cf0[_0x796c('0x35')],function(_0x108505){var _0x4ab316={};_0x4ab316[_0x108505]={'$like':'%'+_0xaf7b3f[_0x796c('0x33')][_0x796c('0x3d')]+'%'};return _0x4ab316;})});}_0x431cf0=_[_0x796c('0x3f')]({},_0x431cf0,_0xaf7b3f['options']);return _0x37c84b[_0x796c('0x4e')](_0x431cf0);}})[_0x796c('0x26')](function(_0x1801e9){if(_0x1801e9){_0x5a1aba=_0x1801e9[_0x796c('0x36')];if(!_0xaf7b3f[_0x796c('0x33')][_0x796c('0x4d')](_0x796c('0x37'))){_0x431cf0[_0x796c('0x38')]=qs[_0x796c('0x38')](_0xaf7b3f[_0x796c('0x33')][_0x796c('0x38')]);_0x431cf0['offset']=qs[_0x796c('0x1c')](_0xaf7b3f[_0x796c('0x33')]['offset']);}return _0x37c84b[_0x796c('0x4e')](_0x431cf0);}})[_0x796c('0x26')](function(_0x1a23a9){if(_0x1a23a9){return _0x1a23a9?{'count':_0x5a1aba,'rows':_0x1a23a9}:null;}})[_0x796c('0x26')](respondWithResult(_0x1b4ad0,null))['catch'](handleError(_0x1b4ad0,null));};exports[_0x796c('0x50')]=function(_0x372d17,_0x59ab25,_0x36da94){var _0x43236a={};var _0x544395={};var _0x7dc118;var _0x16ea5f;return db[_0x796c('0x2c')]['findOne']({'where':{'id':_0x372d17['params']['id']}})[_0x796c('0x26')](handleEntityNotFound(_0x59ab25,null))[_0x796c('0x26')](function(_0xaefcb5){if(_0xaefcb5){_0x7dc118=_0xaefcb5;_0x544395[_0x796c('0x30')]=_['keys'](db['VtigerField']['rawAttributes']);_0x544395[_0x796c('0x33')]=_[_0x796c('0x46')](_0x372d17[_0x796c('0x33')]);_0x544395[_0x796c('0x31')]=_[_0x796c('0x32')](_0x544395[_0x796c('0x30')],_0x544395[_0x796c('0x33')]);_0x43236a['attributes']=_[_0x796c('0x32')](_0x544395[_0x796c('0x30')],qs[_0x796c('0x34')](_0x372d17['query'][_0x796c('0x34')]));_0x43236a[_0x796c('0x35')]=_0x43236a['attributes'][_0x796c('0x36')]?_0x43236a[_0x796c('0x35')]:_0x544395['model'];_0x43236a[_0x796c('0x39')]=qs[_0x796c('0x3a')](_0x372d17[_0x796c('0x33')]['sort']);_0x43236a[_0x796c('0x3b')]=qs['filters'](_[_0x796c('0x3c')](_0x372d17[_0x796c('0x33')],_0x544395['filters']));if(_0x372d17[_0x796c('0x33')]['filter']){_0x43236a[_0x796c('0x3b')]=_[_0x796c('0x3f')](_0x43236a['where'],{'$or':_[_0x796c('0x2b')](_0x43236a[_0x796c('0x35')],function(_0x58439e){var _0xdfecc1={};_0xdfecc1[_0x58439e]={'$like':'%'+_0x372d17[_0x796c('0x33')][_0x796c('0x3d')]+'%'};return _0xdfecc1;})});}_0x43236a=_[_0x796c('0x3f')]({},_0x43236a,_0x372d17['options']);return _0x7dc118['getDescriptions'](_0x43236a);}})[_0x796c('0x26')](function(_0x58086e){if(_0x58086e){_0x16ea5f=_0x58086e[_0x796c('0x36')];if(!_0x372d17['query'][_0x796c('0x4d')]('nolimit')){_0x43236a[_0x796c('0x38')]=qs['limit'](_0x372d17[_0x796c('0x33')]['limit']);_0x43236a[_0x796c('0x1c')]=qs[_0x796c('0x1c')](_0x372d17['query'][_0x796c('0x1c')]);}return _0x7dc118[_0x796c('0x50')](_0x43236a);}})['then'](function(_0x31c0bb){if(_0x31c0bb){return _0x31c0bb?{'count':_0x16ea5f,'rows':_0x31c0bb}:null;}})[_0x796c('0x26')](respondWithResult(_0x59ab25,null))[_0x796c('0x47')](handleError(_0x59ab25,null));};
\ No newline at end of file
+var _0xec15=['undefined','limit','count','offset','set','apply','update','then','destroy','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','sort','filter','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xec15,0x167));var _0x5ec1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec15[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5ec1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ec1('0x1'));var jsonpatch=require(_0x5ec1('0x2'));var rp=require('request-promise');var moment=require(_0x5ec1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5ec1('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ec1('0x5'));var _=require(_0x5ec1('0x6'));var squel=require(_0x5ec1('0x7'));var crypto=require(_0x5ec1('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ec1('0x9'));var toCsv=require(_0x5ec1('0xa'));var querystring=require('querystring');var Papa=require(_0x5ec1('0xb'));var Redis=require(_0x5ec1('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5ec1('0xd'));var as=require(_0x5ec1('0xe'));var hardwareService=require(_0x5ec1('0xf'));var logger=require(_0x5ec1('0x10'))(_0x5ec1('0x11'));var utils=require(_0x5ec1('0x12'));var config=require(_0x5ec1('0x13'));var licenseUtil=require(_0x5ec1('0x14'));var db=require(_0x5ec1('0x15'))['db'];function respondWithStatusCode(_0x3309b5,_0x3ce4a9){_0x3ce4a9=_0x3ce4a9||0xcc;return function(_0x14513c){if(_0x14513c){return _0x3309b5[_0x5ec1('0x16')](_0x3ce4a9);}return _0x3309b5[_0x5ec1('0x17')](_0x3ce4a9)[_0x5ec1('0x18')]();};}function respondWithResult(_0x1dd3e7,_0x9be0cc){_0x9be0cc=_0x9be0cc||0xc8;return function(_0x280cac){if(_0x280cac){return _0x1dd3e7[_0x5ec1('0x17')](_0x9be0cc)[_0x5ec1('0x19')](_0x280cac);}};}function respondWithFilteredResult(_0x597db2,_0x44e7b6){return function(_0x8921cb){if(_0x8921cb){var _0x2cbb56=typeof _0x44e7b6['offset']===_0x5ec1('0x1a')&&typeof _0x44e7b6[_0x5ec1('0x1b')]===_0x5ec1('0x1a');var _0x1b95ee=_0x8921cb[_0x5ec1('0x1c')];var _0x236355=_0x2cbb56?0x0:_0x44e7b6[_0x5ec1('0x1d')];var _0x119df2=_0x2cbb56?_0x8921cb[_0x5ec1('0x1c')]:_0x44e7b6[_0x5ec1('0x1d')]+_0x44e7b6[_0x5ec1('0x1b')];var _0x12b825;if(_0x119df2>=_0x1b95ee){_0x119df2=_0x1b95ee;_0x12b825=0xc8;}else{_0x12b825=0xce;}_0x597db2['status'](_0x12b825);return _0x597db2[_0x5ec1('0x1e')]('Content-Range',_0x236355+'-'+_0x119df2+'/'+_0x1b95ee)['json'](_0x8921cb);}return null;};}function patchUpdates(_0x83025a){return function(_0x204368){try{jsonpatch[_0x5ec1('0x1f')](_0x204368,_0x83025a,!![]);}catch(_0x439ce0){return BPromise['reject'](_0x439ce0);}return _0x204368['save']();};}function saveUpdates(_0x5b6a96,_0x237861){return function(_0x26a0d1){if(_0x26a0d1){return _0x26a0d1[_0x5ec1('0x20')](_0x5b6a96)[_0x5ec1('0x21')](function(_0x5ade1f){return _0x5ade1f;});}return null;};}function removeEntity(_0x37c3b9,_0x50a03c){return function(_0x205715){if(_0x205715){return _0x205715[_0x5ec1('0x22')]()['then'](function(){_0x37c3b9[_0x5ec1('0x17')](0xcc)[_0x5ec1('0x18')]();});}};}function handleEntityNotFound(_0x3fdbfe,_0x488d33){return function(_0x574c55){if(!_0x574c55){_0x3fdbfe[_0x5ec1('0x16')](0x194);}return _0x574c55;};}function handleError(_0xc7a91f,_0x5322cf){_0x5322cf=_0x5322cf||0x1f4;return function(_0x4b2a47){logger[_0x5ec1('0x23')](_0x4b2a47[_0x5ec1('0x24')]);if(_0x4b2a47[_0x5ec1('0x25')]){delete _0x4b2a47[_0x5ec1('0x25')];}_0xc7a91f['status'](_0x5322cf)['send'](_0x4b2a47);};}exports[_0x5ec1('0x26')]=function(_0x2dd781,_0x2f0bec){var _0xbedf66={},_0x5733b7={},_0x1d8744={'count':0x0,'rows':[]};var _0x45c153=_[_0x5ec1('0x27')](db[_0x5ec1('0x28')][_0x5ec1('0x29')],function(_0x2bd890){return{'name':_0x2bd890[_0x5ec1('0x2a')],'type':_0x2bd890[_0x5ec1('0x2b')][_0x5ec1('0x2c')]};});_0x5733b7[_0x5ec1('0x2d')]=_['map'](_0x45c153,_0x5ec1('0x25'));_0x5733b7[_0x5ec1('0x2e')]=_[_0x5ec1('0x2f')](_0x2dd781[_0x5ec1('0x2e')]);_0x5733b7[_0x5ec1('0x30')]=_[_0x5ec1('0x31')](_0x5733b7[_0x5ec1('0x2d')],_0x5733b7[_0x5ec1('0x2e')]);_0xbedf66[_0x5ec1('0x32')]=_['intersection'](_0x5733b7[_0x5ec1('0x2d')],qs['fields'](_0x2dd781[_0x5ec1('0x2e')][_0x5ec1('0x33')]));_0xbedf66[_0x5ec1('0x32')]=_0xbedf66[_0x5ec1('0x32')][_0x5ec1('0x34')]?_0xbedf66[_0x5ec1('0x32')]:_0x5733b7['model'];if(!_0x2dd781[_0x5ec1('0x2e')]['hasOwnProperty'](_0x5ec1('0x35'))){_0xbedf66[_0x5ec1('0x1b')]=qs[_0x5ec1('0x1b')](_0x2dd781[_0x5ec1('0x2e')]['limit']);_0xbedf66['offset']=qs[_0x5ec1('0x1d')](_0x2dd781['query'][_0x5ec1('0x1d')]);}_0xbedf66[_0x5ec1('0x36')]=qs['sort'](_0x2dd781[_0x5ec1('0x2e')]['sort']);_0xbedf66[_0x5ec1('0x37')]=qs[_0x5ec1('0x30')](_[_0x5ec1('0x38')](_0x2dd781[_0x5ec1('0x2e')],_0x5733b7[_0x5ec1('0x30')]),_0x45c153);if(_0x2dd781[_0x5ec1('0x2e')]['filter']){_0xbedf66['where']=_[_0x5ec1('0x39')](_0xbedf66[_0x5ec1('0x37')],{'$or':_[_0x5ec1('0x27')](_0x45c153,function(_0x479d1c){if(_0x479d1c['type']!==_0x5ec1('0x3a')){var _0x210535={};_0x210535[_0x479d1c[_0x5ec1('0x25')]]={'$like':'%'+_0x2dd781['query']['filter']+'%'};return _0x210535;}})});}_0xbedf66=_[_0x5ec1('0x39')]({},_0xbedf66,_0x2dd781[_0x5ec1('0x3b')]);var _0x5daedd={'where':_0xbedf66[_0x5ec1('0x37')]};return db[_0x5ec1('0x28')][_0x5ec1('0x1c')](_0x5daedd)['then'](function(_0xdf449b){_0x1d8744[_0x5ec1('0x1c')]=_0xdf449b;if(_0x2dd781[_0x5ec1('0x2e')][_0x5ec1('0x3c')]){_0xbedf66[_0x5ec1('0x3d')]=[{'all':!![]}];}return db[_0x5ec1('0x28')][_0x5ec1('0x3e')](_0xbedf66);})[_0x5ec1('0x21')](function(_0x73e8c0){_0x1d8744[_0x5ec1('0x3f')]=_0x73e8c0;return _0x1d8744;})[_0x5ec1('0x21')](respondWithFilteredResult(_0x2f0bec,_0xbedf66))[_0x5ec1('0x40')](handleError(_0x2f0bec,null));};exports['show']=function(_0x4d4f39,_0x430abe){var _0x39f248={'raw':![],'where':{'id':_0x4d4f39[_0x5ec1('0x41')]['id']}},_0x15b505={};_0x15b505[_0x5ec1('0x2d')]=_[_0x5ec1('0x2f')](db[_0x5ec1('0x28')][_0x5ec1('0x29')]);_0x15b505[_0x5ec1('0x2e')]=_[_0x5ec1('0x2f')](_0x4d4f39[_0x5ec1('0x2e')]);_0x15b505['filters']=_['intersection'](_0x15b505['model'],_0x15b505['query']);_0x39f248['attributes']=_[_0x5ec1('0x31')](_0x15b505[_0x5ec1('0x2d')],qs['fields'](_0x4d4f39[_0x5ec1('0x2e')][_0x5ec1('0x33')]));_0x39f248[_0x5ec1('0x32')]=_0x39f248[_0x5ec1('0x32')][_0x5ec1('0x34')]?_0x39f248['attributes']:_0x15b505[_0x5ec1('0x2d')];if(_0x4d4f39['query']['includeAll']){_0x39f248[_0x5ec1('0x3d')]=[{'all':!![]}];}_0x39f248=_[_0x5ec1('0x39')]({},_0x39f248,_0x4d4f39['options']);return db[_0x5ec1('0x28')][_0x5ec1('0x42')](_0x39f248)[_0x5ec1('0x21')](handleEntityNotFound(_0x430abe,null))[_0x5ec1('0x21')](respondWithResult(_0x430abe,null))[_0x5ec1('0x40')](handleError(_0x430abe,null));};exports['create']=function(_0x104dce,_0xd4b6b0){return db[_0x5ec1('0x28')][_0x5ec1('0x43')](_0x104dce[_0x5ec1('0x44')],{})[_0x5ec1('0x21')](respondWithResult(_0xd4b6b0,0xc9))[_0x5ec1('0x40')](handleError(_0xd4b6b0,null));};exports[_0x5ec1('0x20')]=function(_0x2695a8,_0x27144b){if(_0x2695a8[_0x5ec1('0x44')]['id']){delete _0x2695a8[_0x5ec1('0x44')]['id'];}return db[_0x5ec1('0x28')]['find']({'where':{'id':_0x2695a8[_0x5ec1('0x41')]['id']}})['then'](handleEntityNotFound(_0x27144b,null))[_0x5ec1('0x21')](saveUpdates(_0x2695a8['body'],null))[_0x5ec1('0x21')](respondWithResult(_0x27144b,null))[_0x5ec1('0x40')](handleError(_0x27144b,null));};exports['destroy']=function(_0x57296e,_0xf73ac7){return db['VtigerConfiguration'][_0x5ec1('0x42')]({'where':{'id':_0x57296e[_0x5ec1('0x41')]['id']}})[_0x5ec1('0x21')](handleEntityNotFound(_0xf73ac7,null))[_0x5ec1('0x21')](removeEntity(_0xf73ac7,null))[_0x5ec1('0x40')](handleError(_0xf73ac7,null));};exports[_0x5ec1('0x45')]=function(_0x160781,_0x65a49c,_0x1c52a0){var _0x3a38ec={};var _0x112196={};var _0x3b3458;var _0x25d2f2;return db[_0x5ec1('0x28')][_0x5ec1('0x46')]({'where':{'id':_0x160781[_0x5ec1('0x41')]['id']}})[_0x5ec1('0x21')](handleEntityNotFound(_0x65a49c,null))[_0x5ec1('0x21')](function(_0x2a44c0){if(_0x2a44c0){_0x3b3458=_0x2a44c0;_0x112196['model']=_[_0x5ec1('0x2f')](db[_0x5ec1('0x47')]['rawAttributes']);_0x112196[_0x5ec1('0x2e')]=_['keys'](_0x160781[_0x5ec1('0x2e')]);_0x112196[_0x5ec1('0x30')]=_[_0x5ec1('0x31')](_0x112196[_0x5ec1('0x2d')],_0x112196[_0x5ec1('0x2e')]);_0x3a38ec[_0x5ec1('0x32')]=_[_0x5ec1('0x31')](_0x112196[_0x5ec1('0x2d')],qs[_0x5ec1('0x33')](_0x160781[_0x5ec1('0x2e')][_0x5ec1('0x33')]));_0x3a38ec[_0x5ec1('0x32')]=_0x3a38ec['attributes']['length']?_0x3a38ec[_0x5ec1('0x32')]:_0x112196[_0x5ec1('0x2d')];_0x3a38ec[_0x5ec1('0x36')]=qs[_0x5ec1('0x48')](_0x160781[_0x5ec1('0x2e')][_0x5ec1('0x48')]);_0x3a38ec['where']=qs[_0x5ec1('0x30')](_[_0x5ec1('0x38')](_0x160781['query'],_0x112196[_0x5ec1('0x30')]));if(_0x160781[_0x5ec1('0x2e')][_0x5ec1('0x49')]){_0x3a38ec[_0x5ec1('0x37')]=_[_0x5ec1('0x39')](_0x3a38ec[_0x5ec1('0x37')],{'$or':_[_0x5ec1('0x27')](_0x3a38ec[_0x5ec1('0x32')],function(_0x470fba){var _0x1188da={};_0x1188da[_0x470fba]={'$like':'%'+_0x160781[_0x5ec1('0x2e')][_0x5ec1('0x49')]+'%'};return _0x1188da;})});}_0x3a38ec=_[_0x5ec1('0x39')]({},_0x3a38ec,_0x160781[_0x5ec1('0x3b')]);return _0x3b3458[_0x5ec1('0x45')](_0x3a38ec);}})['then'](function(_0x389437){if(_0x389437){_0x25d2f2=_0x389437[_0x5ec1('0x34')];if(!_0x160781[_0x5ec1('0x2e')][_0x5ec1('0x4a')](_0x5ec1('0x35'))){_0x3a38ec[_0x5ec1('0x1b')]=qs[_0x5ec1('0x1b')](_0x160781[_0x5ec1('0x2e')]['limit']);_0x3a38ec[_0x5ec1('0x1d')]=qs['offset'](_0x160781[_0x5ec1('0x2e')]['offset']);}return _0x3b3458[_0x5ec1('0x45')](_0x3a38ec);}})[_0x5ec1('0x21')](function(_0x3016eb){if(_0x3016eb){return _0x3016eb?{'count':_0x25d2f2,'rows':_0x3016eb}:null;}})['then'](respondWithResult(_0x65a49c,null))[_0x5ec1('0x40')](handleError(_0x65a49c,null));};exports[_0x5ec1('0x4b')]=function(_0x29490,_0x1a9542,_0x5238ab){var _0x3474a3={};var _0x4cf265={};var _0x26d80c;var _0x2b843a;return db[_0x5ec1('0x28')][_0x5ec1('0x46')]({'where':{'id':_0x29490[_0x5ec1('0x41')]['id']}})[_0x5ec1('0x21')](handleEntityNotFound(_0x1a9542,null))[_0x5ec1('0x21')](function(_0x208fe6){if(_0x208fe6){_0x26d80c=_0x208fe6;_0x4cf265[_0x5ec1('0x2d')]=_['keys'](db[_0x5ec1('0x47')]['rawAttributes']);_0x4cf265[_0x5ec1('0x2e')]=_[_0x5ec1('0x2f')](_0x29490[_0x5ec1('0x2e')]);_0x4cf265[_0x5ec1('0x30')]=_[_0x5ec1('0x31')](_0x4cf265[_0x5ec1('0x2d')],_0x4cf265[_0x5ec1('0x2e')]);_0x3474a3['attributes']=_[_0x5ec1('0x31')](_0x4cf265['model'],qs[_0x5ec1('0x33')](_0x29490['query'][_0x5ec1('0x33')]));_0x3474a3[_0x5ec1('0x32')]=_0x3474a3[_0x5ec1('0x32')][_0x5ec1('0x34')]?_0x3474a3[_0x5ec1('0x32')]:_0x4cf265['model'];_0x3474a3[_0x5ec1('0x36')]=qs['sort'](_0x29490[_0x5ec1('0x2e')][_0x5ec1('0x48')]);_0x3474a3[_0x5ec1('0x37')]=qs[_0x5ec1('0x30')](_[_0x5ec1('0x38')](_0x29490[_0x5ec1('0x2e')],_0x4cf265[_0x5ec1('0x30')]));if(_0x29490[_0x5ec1('0x2e')]['filter']){_0x3474a3[_0x5ec1('0x37')]=_[_0x5ec1('0x39')](_0x3474a3[_0x5ec1('0x37')],{'$or':_['map'](_0x3474a3[_0x5ec1('0x32')],function(_0x117b13){var _0x4126b3={};_0x4126b3[_0x117b13]={'$like':'%'+_0x29490['query'][_0x5ec1('0x49')]+'%'};return _0x4126b3;})});}_0x3474a3=_[_0x5ec1('0x39')]({},_0x3474a3,_0x29490['options']);return _0x26d80c['getSubjects'](_0x3474a3);}})[_0x5ec1('0x21')](function(_0x14cb8d){if(_0x14cb8d){_0x2b843a=_0x14cb8d['length'];if(!_0x29490[_0x5ec1('0x2e')][_0x5ec1('0x4a')](_0x5ec1('0x35'))){_0x3474a3['limit']=qs[_0x5ec1('0x1b')](_0x29490[_0x5ec1('0x2e')][_0x5ec1('0x1b')]);_0x3474a3['offset']=qs[_0x5ec1('0x1d')](_0x29490[_0x5ec1('0x2e')]['offset']);}return _0x26d80c[_0x5ec1('0x4b')](_0x3474a3);}})[_0x5ec1('0x21')](function(_0x32dcc5){if(_0x32dcc5){return _0x32dcc5?{'count':_0x2b843a,'rows':_0x32dcc5}:null;}})['then'](respondWithResult(_0x1a9542,null))[_0x5ec1('0x40')](handleError(_0x1a9542,null));};exports[_0x5ec1('0x4c')]=function(_0x574360,_0x299a50,_0x1a11fa){var _0x40960c={};var _0x38b2c3={};var _0x230f56;var _0x3eb66a;return db[_0x5ec1('0x28')][_0x5ec1('0x46')]({'where':{'id':_0x574360['params']['id']}})[_0x5ec1('0x21')](handleEntityNotFound(_0x299a50,null))[_0x5ec1('0x21')](function(_0x34c099){if(_0x34c099){_0x230f56=_0x34c099;_0x38b2c3['model']=_[_0x5ec1('0x2f')](db['VtigerField'][_0x5ec1('0x29')]);_0x38b2c3[_0x5ec1('0x2e')]=_['keys'](_0x574360[_0x5ec1('0x2e')]);_0x38b2c3[_0x5ec1('0x30')]=_[_0x5ec1('0x31')](_0x38b2c3[_0x5ec1('0x2d')],_0x38b2c3[_0x5ec1('0x2e')]);_0x40960c[_0x5ec1('0x32')]=_[_0x5ec1('0x31')](_0x38b2c3[_0x5ec1('0x2d')],qs['fields'](_0x574360[_0x5ec1('0x2e')]['fields']));_0x40960c[_0x5ec1('0x32')]=_0x40960c[_0x5ec1('0x32')]['length']?_0x40960c[_0x5ec1('0x32')]:_0x38b2c3[_0x5ec1('0x2d')];_0x40960c['order']=qs[_0x5ec1('0x48')](_0x574360[_0x5ec1('0x2e')][_0x5ec1('0x48')]);_0x40960c[_0x5ec1('0x37')]=qs[_0x5ec1('0x30')](_['pick'](_0x574360[_0x5ec1('0x2e')],_0x38b2c3[_0x5ec1('0x30')]));if(_0x574360[_0x5ec1('0x2e')]['filter']){_0x40960c[_0x5ec1('0x37')]=_[_0x5ec1('0x39')](_0x40960c[_0x5ec1('0x37')],{'$or':_['map'](_0x40960c[_0x5ec1('0x32')],function(_0x51fee1){var _0x375345={};_0x375345[_0x51fee1]={'$like':'%'+_0x574360['query'][_0x5ec1('0x49')]+'%'};return _0x375345;})});}_0x40960c=_[_0x5ec1('0x39')]({},_0x40960c,_0x574360[_0x5ec1('0x3b')]);return _0x230f56[_0x5ec1('0x4c')](_0x40960c);}})[_0x5ec1('0x21')](function(_0x394828){if(_0x394828){_0x3eb66a=_0x394828[_0x5ec1('0x34')];if(!_0x574360[_0x5ec1('0x2e')]['hasOwnProperty'](_0x5ec1('0x35'))){_0x40960c[_0x5ec1('0x1b')]=qs[_0x5ec1('0x1b')](_0x574360[_0x5ec1('0x2e')][_0x5ec1('0x1b')]);_0x40960c['offset']=qs[_0x5ec1('0x1d')](_0x574360[_0x5ec1('0x2e')][_0x5ec1('0x1d')]);}return _0x230f56[_0x5ec1('0x4c')](_0x40960c);}})[_0x5ec1('0x21')](function(_0x5a9c95){if(_0x5a9c95){return _0x5a9c95?{'count':_0x3eb66a,'rows':_0x5a9c95}:null;}})[_0x5ec1('0x21')](respondWithResult(_0x299a50,null))[_0x5ec1('0x40')](handleError(_0x299a50,null));};
\ No newline at end of file
index 5057c22..9c2da1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8735=['int_vtiger_configurations','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration'];(function(_0x29af80,_0x11b6f3){var _0x9e6cc=function(_0x59177b){while(--_0x59177b){_0x29af80['push'](_0x29af80['shift']());}};_0x9e6cc(++_0x11b6f3);}(_0x8735,0x123));var _0x5873=function(_0x3d4555,_0xf8ddb){_0x3d4555=_0x3d4555-0x0;var _0x29576e=_0x8735[_0x3d4555];return _0x29576e;};'use strict';var _=require(_0x5873('0x0'));var util=require(_0x5873('0x1'));var logger=require(_0x5873('0x2'))('api');var moment=require(_0x5873('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5873('0x4'));var rimraf=require(_0x5873('0x5'));var config=require(_0x5873('0x6'));var attributes=require(_0x5873('0x7'));module['exports']=function(_0x50fa5a,_0x94c290){return _0x50fa5a['define'](_0x5873('0x8'),attributes,{'tableName':_0x5873('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3722=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations'];(function(_0x1f227b,_0x1d171b){var _0x5daa43=function(_0x426847){while(--_0x426847){_0x1f227b['push'](_0x1f227b['shift']());}};_0x5daa43(++_0x1d171b);}(_0x3722,0xc6));var _0x2372=function(_0x543460,_0x2c3426){_0x543460=_0x543460-0x0;var _0x1a8fc9=_0x3722[_0x543460];return _0x1a8fc9;};'use strict';var _=require(_0x2372('0x0'));var util=require(_0x2372('0x1'));var logger=require(_0x2372('0x2'))(_0x2372('0x3'));var moment=require(_0x2372('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2372('0x5'));var config=require(_0x2372('0x6'));var attributes=require(_0x2372('0x7'));module[_0x2372('0x8')]=function(_0x56f4a0,_0xf48f62){return _0x56f4a0['define'](_0x2372('0x9'),attributes,{'tableName':_0x2372('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5eed4fb..b9ce5e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ce=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x2a1648,_0x573997){var _0x5ada4d=function(_0x31728c){while(--_0x31728c){_0x2a1648['push'](_0x2a1648['shift']());}};_0x5ada4d(++_0x573997);}(_0x32ce,0x1eb));var _0xe32c=function(_0x309993,_0x4e9f52){_0x309993=_0x309993-0x0;var _0x59b953=_0x32ce[_0x309993];return _0x59b953;};'use strict';var _=require(_0xe32c('0x0'));var util=require('util');var moment=require(_0xe32c('0x1'));var BPromise=require(_0xe32c('0x2'));var rs=require(_0xe32c('0x3'));var fs=require('fs');var Redis=require(_0xe32c('0x4'));var db=require(_0xe32c('0x5'))['db'];var utils=require(_0xe32c('0x6'));var logger=require(_0xe32c('0x7'))(_0xe32c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe32c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb007,_0x2b61f4,_0x2763ae){return new BPromise(function(_0x47f8f7,_0x264835){return client[_0xe32c('0xa')](_0xbb007,_0x2763ae)[_0xe32c('0xb')](function(_0x3b2632){logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');logger['debug'](_0xe32c('0xd'),_0x2b61f4,'request\x20sent',JSON[_0xe32c('0xe')](_0x3b2632));if(_0x3b2632[_0xe32c('0xf')]){if(_0x3b2632['error'][_0xe32c('0x10')]===0x1f4){logger[_0xe32c('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x264835(_0x3b2632['error'][_0xe32c('0x11')]);}logger['error'](_0xe32c('0xc'),_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x47f8f7(_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);}else{logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');_0x47f8f7(_0x3b2632['result'][_0xe32c('0x11')]);}})[_0xe32c('0x12')](function(_0x3eb689){logger[_0xe32c('0xf')](_0xe32c('0xc'),_0x2b61f4,_0x3eb689);_0x264835(_0x3eb689);});});}
\ No newline at end of file
+var _0xf2e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xf2e2,0xca));var _0x2f2e=function(_0x1b5c6a,_0x26b00d){_0x1b5c6a=_0x1b5c6a-0x0;var _0x4e80ad=_0xf2e2[_0x1b5c6a];return _0x4e80ad;};'use strict';var _=require(_0x2f2e('0x0'));var util=require(_0x2f2e('0x1'));var moment=require(_0x2f2e('0x2'));var BPromise=require(_0x2f2e('0x3'));var rs=require(_0x2f2e('0x4'));var fs=require('fs');var Redis=require(_0x2f2e('0x5'));var db=require(_0x2f2e('0x6'))['db'];var utils=require(_0x2f2e('0x7'));var logger=require(_0x2f2e('0x8'))(_0x2f2e('0x9'));var config=require(_0x2f2e('0xa'));var jayson=require(_0x2f2e('0xb'));var client=jayson['client'][_0x2f2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b55d7,_0x417f27,_0x3c7348){return new BPromise(function(_0x3962d5,_0x3c7ce7){return client['request'](_0x1b55d7,_0x3c7348)['then'](function(_0x5b9284){logger[_0x2f2e('0xd')](_0x2f2e('0xe'),_0x417f27,'request\x20sent');logger[_0x2f2e('0xf')](_0x2f2e('0x10'),_0x417f27,_0x2f2e('0x11'),JSON[_0x2f2e('0x12')](_0x5b9284));if(_0x5b9284['error']){if(_0x5b9284[_0x2f2e('0x13')][_0x2f2e('0x14')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x417f27,_0x5b9284[_0x2f2e('0x13')][_0x2f2e('0x15')]);return _0x3c7ce7(_0x5b9284['error'][_0x2f2e('0x15')]);}logger[_0x2f2e('0x13')](_0x2f2e('0xe'),_0x417f27,_0x5b9284[_0x2f2e('0x13')][_0x2f2e('0x15')]);return _0x3962d5(_0x5b9284[_0x2f2e('0x13')][_0x2f2e('0x15')]);}else{logger[_0x2f2e('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x417f27,_0x2f2e('0x11'));_0x3962d5(_0x5b9284['result'][_0x2f2e('0x15')]);}})[_0x2f2e('0x16')](function(_0x43883e){logger[_0x2f2e('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x417f27,_0x43883e);_0x3c7ce7(_0x43883e);});});}
\ No newline at end of file
index 7a85731..bf045e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4882=['../../config/environment','./intVtigerField.controller','get','/:id','isAuthenticated','show','post','create','put','delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x95a42,_0x56a756){var _0x46167=function(_0x7675ee){while(--_0x7675ee){_0x95a42['push'](_0x95a42['shift']());}};_0x46167(++_0x56a756);}(_0x4882,0x1aa));var _0x2488=function(_0x29450a,_0x32813c){_0x29450a=_0x29450a-0x0;var _0x3a1a85=_0x4882[_0x29450a];return _0x3a1a85;};'use strict';var multer=require(_0x2488('0x0'));var util=require(_0x2488('0x1'));var path=require(_0x2488('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2488('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2488('0x4'));var interaction=require(_0x2488('0x5'));var config=require(_0x2488('0x6'));var controller=require(_0x2488('0x7'));router[_0x2488('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2488('0x8')](_0x2488('0x9'),auth[_0x2488('0xa')](),controller[_0x2488('0xb')]);router[_0x2488('0xc')]('/',auth[_0x2488('0xa')](),controller[_0x2488('0xd')]);router[_0x2488('0xe')](_0x2488('0x9'),auth[_0x2488('0xa')](),controller['update']);router[_0x2488('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x27bb=['show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','index','/:id'];(function(_0x243cca,_0x514c2d){var _0xf94771=function(_0x42d3de){while(--_0x42d3de){_0x243cca['push'](_0x243cca['shift']());}};_0xf94771(++_0x514c2d);}(_0x27bb,0x1d6));var _0xb27b=function(_0x137228,_0x2b1818){_0x137228=_0x137228-0x0;var _0x9cb8fc=_0x27bb[_0x137228];return _0x9cb8fc;};'use strict';var multer=require(_0xb27b('0x0'));var util=require(_0xb27b('0x1'));var path=require(_0xb27b('0x2'));var timeout=require(_0xb27b('0x3'));var express=require(_0xb27b('0x4'));var router=express[_0xb27b('0x5')]();var fs_extra=require(_0xb27b('0x6'));var auth=require(_0xb27b('0x7'));var interaction=require(_0xb27b('0x8'));var config=require('../../config/environment');var controller=require(_0xb27b('0x9'));router[_0xb27b('0xa')]('/',auth['isAuthenticated'](),controller[_0xb27b('0xb')]);router['get'](_0xb27b('0xc'),auth['isAuthenticated'](),controller[_0xb27b('0xd')]);router[_0xb27b('0xe')]('/',auth[_0xb27b('0xf')](),controller[_0xb27b('0x10')]);router[_0xb27b('0x11')](_0xb27b('0xc'),auth['isAuthenticated'](),controller[_0xb27b('0x12')]);router[_0xb27b('0x13')](_0xb27b('0xc'),auth[_0xb27b('0xf')](),controller['destroy']);module[_0xb27b('0x14')]=router;
\ No newline at end of file
index 1e364f0..0c5bc15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481d=['ENUM','customVariable','picklist','string','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x38bd8e,_0x569e8d){var _0x3f86be=function(_0x1e699f){while(--_0x1e699f){_0x38bd8e['push'](_0x38bd8e['shift']());}};_0x3f86be(++_0x569e8d);}(_0x481d,0x139));var _0xd481=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x481d[_0x119705];return _0x2affc2;};'use strict';var Sequelize=require(_0xd481('0x0'));module[_0xd481('0x1')]={'type':{'type':Sequelize[_0xd481('0x2')]('string','variable',_0xd481('0x3'),'keyValue',_0xd481('0x4')),'defaultValue':_0xd481('0x5')},'content':{'type':Sequelize[_0xd481('0x6')]},'key':{'type':Sequelize[_0xd481('0x6')]},'keyType':{'type':Sequelize[_0xd481('0x2')]('string',_0xd481('0x7'),_0xd481('0x3'))},'keyContent':{'type':Sequelize[_0xd481('0x6')]},'idField':{'type':Sequelize[_0xd481('0x6')]},'nameField':{'type':Sequelize[_0xd481('0x6')]},'customField':{'type':Sequelize[_0xd481('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd481('0x6')]}};
\ No newline at end of file
+var _0x7003=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7003,0x171));var _0x3700=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0x7003[_0x35387d];return _0x3aba56;};'use strict';var Sequelize=require(_0x3700('0x0'));module[_0x3700('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3700('0x2'),_0x3700('0x3'),_0x3700('0x4'),_0x3700('0x5'),'picklist'),'defaultValue':_0x3700('0x2')},'content':{'type':Sequelize[_0x3700('0x6')]},'key':{'type':Sequelize[_0x3700('0x6')]},'keyType':{'type':Sequelize[_0x3700('0x7')]('string',_0x3700('0x3'),_0x3700('0x4'))},'keyContent':{'type':Sequelize[_0x3700('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3700('0x6')]},'customField':{'type':Sequelize[_0x3700('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3700('0x6')]}};
\ No newline at end of file
index 7584fa6..35379b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9d0=['squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','VtigerField','include','findAll','rows','catch','show','includeAll','find','body','params','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash'];(function(_0x5aa5d2,_0x350735){var _0x5ed5dd=function(_0xac921){while(--_0xac921){_0x5aa5d2['push'](_0x5aa5d2['shift']());}};_0x5ed5dd(++_0x350735);}(_0xa9d0,0x7f));var _0x0a9d=function(_0x579fda,_0x35afa7){_0x579fda=_0x579fda-0x0;var _0x40054f=_0xa9d0[_0x579fda];return _0x40054f;};'use strict';var emlformat=require(_0x0a9d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a9d('0x1'));var rp=require(_0x0a9d('0x2'));var moment=require(_0x0a9d('0x3'));var BPromise=require(_0x0a9d('0x4'));var Mustache=require('mustache');var util=require(_0x0a9d('0x5'));var path=require(_0x0a9d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9d('0x7'));var _=require(_0x0a9d('0x8'));var squel=require(_0x0a9d('0x9'));var crypto=require(_0x0a9d('0xa'));var jsforce=require(_0x0a9d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a9d('0xd'));var qs=require(_0x0a9d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0a9d('0xf'));var config=require(_0x0a9d('0x10'));var licenseUtil=require(_0x0a9d('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4116c4,_0x2e0bd1){_0x2e0bd1=_0x2e0bd1||0xcc;return function(_0x2fd1c8){if(_0x2fd1c8){return _0x4116c4[_0x0a9d('0x12')](_0x2e0bd1);}return _0x4116c4[_0x0a9d('0x13')](_0x2e0bd1)[_0x0a9d('0x14')]();};}function respondWithResult(_0x32adf6,_0x2ad2e9){_0x2ad2e9=_0x2ad2e9||0xc8;return function(_0x254db9){if(_0x254db9){return _0x32adf6['status'](_0x2ad2e9)[_0x0a9d('0x15')](_0x254db9);}};}function respondWithFilteredResult(_0x1766b6,_0x5b9e05){return function(_0x2c906c){if(_0x2c906c){var _0x14da86=typeof _0x5b9e05[_0x0a9d('0x16')]===_0x0a9d('0x17')&&typeof _0x5b9e05[_0x0a9d('0x18')]===_0x0a9d('0x17');var _0x3a83ff=_0x2c906c[_0x0a9d('0x19')];var _0x4a5222=_0x14da86?0x0:_0x5b9e05[_0x0a9d('0x16')];var _0x37aea2=_0x14da86?_0x2c906c[_0x0a9d('0x19')]:_0x5b9e05['offset']+_0x5b9e05['limit'];var _0x562d30;if(_0x37aea2>=_0x3a83ff){_0x37aea2=_0x3a83ff;_0x562d30=0xc8;}else{_0x562d30=0xce;}_0x1766b6[_0x0a9d('0x13')](_0x562d30);return _0x1766b6[_0x0a9d('0x1a')]('Content-Range',_0x4a5222+'-'+_0x37aea2+'/'+_0x3a83ff)[_0x0a9d('0x15')](_0x2c906c);}return null;};}function patchUpdates(_0x3006d2){return function(_0x17c294){try{jsonpatch[_0x0a9d('0x1b')](_0x17c294,_0x3006d2,!![]);}catch(_0x2767a6){return BPromise['reject'](_0x2767a6);}return _0x17c294['save']();};}function saveUpdates(_0x16a2a0,_0x2e3feb){return function(_0x2428fd){if(_0x2428fd){return _0x2428fd[_0x0a9d('0x1c')](_0x16a2a0)['then'](function(_0x451da8){return _0x451da8;});}return null;};}function removeEntity(_0x1b1a12,_0x141b48){return function(_0x139f8){if(_0x139f8){return _0x139f8['destroy']()[_0x0a9d('0x1d')](function(){_0x1b1a12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2beb74,_0x3a6163){return function(_0x4b18fc){if(!_0x4b18fc){_0x2beb74['sendStatus'](0x194);}return _0x4b18fc;};}function handleError(_0xc12687,_0x3343f1){_0x3343f1=_0x3343f1||0x1f4;return function(_0x2e8caf){logger[_0x0a9d('0x1e')](_0x2e8caf['stack']);if(_0x2e8caf[_0x0a9d('0x1f')]){delete _0x2e8caf[_0x0a9d('0x1f')];}_0xc12687[_0x0a9d('0x13')](_0x3343f1)[_0x0a9d('0x20')](_0x2e8caf);};}exports[_0x0a9d('0x21')]=function(_0x3515dd,_0xa87c29){var _0x22a501={},_0x28a225={},_0xf155bd={'count':0x0,'rows':[]};var _0x3a450e=_['map'](db['VtigerField'][_0x0a9d('0x22')],function(_0x434d3b){return{'name':_0x434d3b[_0x0a9d('0x23')],'type':_0x434d3b[_0x0a9d('0x24')][_0x0a9d('0x25')]};});_0x28a225[_0x0a9d('0x26')]=_[_0x0a9d('0x27')](_0x3a450e,_0x0a9d('0x1f'));_0x28a225[_0x0a9d('0x28')]=_[_0x0a9d('0x29')](_0x3515dd['query']);_0x28a225[_0x0a9d('0x2a')]=_[_0x0a9d('0x2b')](_0x28a225['model'],_0x28a225[_0x0a9d('0x28')]);_0x22a501[_0x0a9d('0x2c')]=_[_0x0a9d('0x2b')](_0x28a225[_0x0a9d('0x26')],qs[_0x0a9d('0x2d')](_0x3515dd['query'][_0x0a9d('0x2d')]));_0x22a501[_0x0a9d('0x2c')]=_0x22a501[_0x0a9d('0x2c')][_0x0a9d('0x2e')]?_0x22a501['attributes']:_0x28a225[_0x0a9d('0x26')];if(!_0x3515dd[_0x0a9d('0x28')][_0x0a9d('0x2f')](_0x0a9d('0x30'))){_0x22a501[_0x0a9d('0x18')]=qs['limit'](_0x3515dd[_0x0a9d('0x28')][_0x0a9d('0x18')]);_0x22a501[_0x0a9d('0x16')]=qs[_0x0a9d('0x16')](_0x3515dd[_0x0a9d('0x28')]['offset']);}_0x22a501[_0x0a9d('0x31')]=qs[_0x0a9d('0x32')](_0x3515dd[_0x0a9d('0x28')][_0x0a9d('0x32')]);_0x22a501['where']=qs[_0x0a9d('0x2a')](_[_0x0a9d('0x33')](_0x3515dd[_0x0a9d('0x28')],_0x28a225[_0x0a9d('0x2a')]),_0x3a450e);if(_0x3515dd['query']['filter']){_0x22a501['where']=_[_0x0a9d('0x34')](_0x22a501[_0x0a9d('0x35')],{'$or':_[_0x0a9d('0x27')](_0x3a450e,function(_0x245251){if(_0x245251[_0x0a9d('0x24')]!==_0x0a9d('0x36')){var _0x1b8bbb={};_0x1b8bbb[_0x245251['name']]={'$like':'%'+_0x3515dd[_0x0a9d('0x28')][_0x0a9d('0x37')]+'%'};return _0x1b8bbb;}})});}_0x22a501=_[_0x0a9d('0x34')]({},_0x22a501,_0x3515dd[_0x0a9d('0x38')]);var _0x3fe8be={'where':_0x22a501[_0x0a9d('0x35')]};return db[_0x0a9d('0x39')][_0x0a9d('0x19')](_0x3fe8be)[_0x0a9d('0x1d')](function(_0x45d664){_0xf155bd['count']=_0x45d664;if(_0x3515dd[_0x0a9d('0x28')]['includeAll']){_0x22a501[_0x0a9d('0x3a')]=[{'all':!![]}];}return db[_0x0a9d('0x39')][_0x0a9d('0x3b')](_0x22a501);})[_0x0a9d('0x1d')](function(_0xd3963a){_0xf155bd[_0x0a9d('0x3c')]=_0xd3963a;return _0xf155bd;})[_0x0a9d('0x1d')](respondWithFilteredResult(_0xa87c29,_0x22a501))[_0x0a9d('0x3d')](handleError(_0xa87c29,null));};exports[_0x0a9d('0x3e')]=function(_0x533a94,_0x4d9d14){var _0x32ea32={'raw':!![],'where':{'id':_0x533a94['params']['id']}},_0x3e4341={};_0x3e4341['model']=_[_0x0a9d('0x29')](db[_0x0a9d('0x39')][_0x0a9d('0x22')]);_0x3e4341[_0x0a9d('0x28')]=_[_0x0a9d('0x29')](_0x533a94[_0x0a9d('0x28')]);_0x3e4341[_0x0a9d('0x2a')]=_[_0x0a9d('0x2b')](_0x3e4341['model'],_0x3e4341[_0x0a9d('0x28')]);_0x32ea32['attributes']=_[_0x0a9d('0x2b')](_0x3e4341['model'],qs[_0x0a9d('0x2d')](_0x533a94['query'][_0x0a9d('0x2d')]));_0x32ea32[_0x0a9d('0x2c')]=_0x32ea32['attributes']['length']?_0x32ea32[_0x0a9d('0x2c')]:_0x3e4341['model'];if(_0x533a94[_0x0a9d('0x28')][_0x0a9d('0x3f')]){_0x32ea32['include']=[{'all':!![]}];}_0x32ea32=_['merge']({},_0x32ea32,_0x533a94['options']);return db[_0x0a9d('0x39')][_0x0a9d('0x40')](_0x32ea32)[_0x0a9d('0x1d')](handleEntityNotFound(_0x4d9d14,null))[_0x0a9d('0x1d')](respondWithResult(_0x4d9d14,null))['catch'](handleError(_0x4d9d14,null));};exports['create']=function(_0x1fcadc,_0x270689){return db['VtigerField']['create'](_0x1fcadc[_0x0a9d('0x41')],{})[_0x0a9d('0x1d')](respondWithResult(_0x270689,0xc9))[_0x0a9d('0x3d')](handleError(_0x270689,null));};exports[_0x0a9d('0x1c')]=function(_0x1d8e15,_0x5a7286){if(_0x1d8e15[_0x0a9d('0x41')]['id']){delete _0x1d8e15[_0x0a9d('0x41')]['id'];}return db['VtigerField'][_0x0a9d('0x40')]({'where':{'id':_0x1d8e15[_0x0a9d('0x42')]['id']}})[_0x0a9d('0x1d')](handleEntityNotFound(_0x5a7286,null))[_0x0a9d('0x1d')](saveUpdates(_0x1d8e15[_0x0a9d('0x41')],null))[_0x0a9d('0x1d')](respondWithResult(_0x5a7286,null))[_0x0a9d('0x3d')](handleError(_0x5a7286,null));};exports[_0x0a9d('0x43')]=function(_0x45f1cd,_0x398cb5){return db[_0x0a9d('0x39')][_0x0a9d('0x40')]({'where':{'id':_0x45f1cd[_0x0a9d('0x42')]['id']}})['then'](handleEntityNotFound(_0x398cb5,null))[_0x0a9d('0x1d')](removeEntity(_0x398cb5,null))[_0x0a9d('0x3d')](handleError(_0x398cb5,null));};
\ No newline at end of file
+var _0x3279=['catch','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VtigerField','includeAll','include','findAll','rows'];(function(_0x919e3a,_0x2faea6){var _0x3e30e6=function(_0x4fd7ab){while(--_0x4fd7ab){_0x919e3a['push'](_0x919e3a['shift']());}};_0x3e30e6(++_0x2faea6);}(_0x3279,0xda));var _0x9327=function(_0x11a1bc,_0x53503d){_0x11a1bc=_0x11a1bc-0x0;var _0x3daebe=_0x3279[_0x11a1bc];return _0x3daebe;};'use strict';var emlformat=require(_0x9327('0x0'));var rimraf=require(_0x9327('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9327('0x2'));var rp=require(_0x9327('0x3'));var moment=require('moment');var BPromise=require(_0x9327('0x4'));var Mustache=require('mustache');var util=require(_0x9327('0x5'));var path=require(_0x9327('0x6'));var sox=require('sox');var csv=require(_0x9327('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9327('0x8'));var squel=require(_0x9327('0x9'));var crypto=require('crypto');var jsforce=require(_0x9327('0xa'));var deskjs=require(_0x9327('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9327('0xc'));var Papa=require(_0x9327('0xd'));var Redis=require('ioredis');var authService=require(_0x9327('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9327('0xf'));var hardwareService=require(_0x9327('0x10'));var logger=require(_0x9327('0x11'))(_0x9327('0x12'));var utils=require(_0x9327('0x13'));var config=require(_0x9327('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9327('0x15'))['db'];function respondWithStatusCode(_0x331201,_0x1fbbbb){_0x1fbbbb=_0x1fbbbb||0xcc;return function(_0x5a06ad){if(_0x5a06ad){return _0x331201['sendStatus'](_0x1fbbbb);}return _0x331201[_0x9327('0x16')](_0x1fbbbb)[_0x9327('0x17')]();};}function respondWithResult(_0x4d70dc,_0x535609){_0x535609=_0x535609||0xc8;return function(_0x156896){if(_0x156896){return _0x4d70dc['status'](_0x535609)[_0x9327('0x18')](_0x156896);}};}function respondWithFilteredResult(_0x2a5a9d,_0x23f872){return function(_0x13870e){if(_0x13870e){var _0x3569fb=typeof _0x23f872[_0x9327('0x19')]===_0x9327('0x1a')&&typeof _0x23f872['limit']==='undefined';var _0x2a8e5f=_0x13870e['count'];var _0x96c457=_0x3569fb?0x0:_0x23f872[_0x9327('0x19')];var _0x4aa43f=_0x3569fb?_0x13870e[_0x9327('0x1b')]:_0x23f872[_0x9327('0x19')]+_0x23f872[_0x9327('0x1c')];var _0x4ce17c;if(_0x4aa43f>=_0x2a8e5f){_0x4aa43f=_0x2a8e5f;_0x4ce17c=0xc8;}else{_0x4ce17c=0xce;}_0x2a5a9d[_0x9327('0x16')](_0x4ce17c);return _0x2a5a9d[_0x9327('0x1d')]('Content-Range',_0x96c457+'-'+_0x4aa43f+'/'+_0x2a8e5f)[_0x9327('0x18')](_0x13870e);}return null;};}function patchUpdates(_0x1ad378){return function(_0x105b03){try{jsonpatch[_0x9327('0x1e')](_0x105b03,_0x1ad378,!![]);}catch(_0x51881f){return BPromise[_0x9327('0x1f')](_0x51881f);}return _0x105b03[_0x9327('0x20')]();};}function saveUpdates(_0x1c36b4,_0x3cd7b8){return function(_0x179d35){if(_0x179d35){return _0x179d35[_0x9327('0x21')](_0x1c36b4)[_0x9327('0x22')](function(_0x9b8239){return _0x9b8239;});}return null;};}function removeEntity(_0x3e1c40,_0x1cb8a4){return function(_0x21ae71){if(_0x21ae71){return _0x21ae71[_0x9327('0x23')]()[_0x9327('0x22')](function(){_0x3e1c40[_0x9327('0x16')](0xcc)[_0x9327('0x17')]();});}};}function handleEntityNotFound(_0x12ac4d,_0xfac719){return function(_0x512445){if(!_0x512445){_0x12ac4d[_0x9327('0x24')](0x194);}return _0x512445;};}function handleError(_0xe38daa,_0x37f888){_0x37f888=_0x37f888||0x1f4;return function(_0x49f1d6){logger['error'](_0x49f1d6['stack']);if(_0x49f1d6[_0x9327('0x25')]){delete _0x49f1d6[_0x9327('0x25')];}_0xe38daa[_0x9327('0x16')](_0x37f888)[_0x9327('0x26')](_0x49f1d6);};}exports[_0x9327('0x27')]=function(_0x234219,_0x944636){var _0x521a81={},_0x4c9751={},_0x22fca1={'count':0x0,'rows':[]};var _0x5ebd96=_['map'](db['VtigerField'][_0x9327('0x28')],function(_0x576e6d){return{'name':_0x576e6d[_0x9327('0x29')],'type':_0x576e6d[_0x9327('0x2a')]['key']};});_0x4c9751[_0x9327('0x2b')]=_['map'](_0x5ebd96,_0x9327('0x25'));_0x4c9751['query']=_[_0x9327('0x2c')](_0x234219[_0x9327('0x2d')]);_0x4c9751[_0x9327('0x2e')]=_[_0x9327('0x2f')](_0x4c9751[_0x9327('0x2b')],_0x4c9751['query']);_0x521a81['attributes']=_[_0x9327('0x2f')](_0x4c9751[_0x9327('0x2b')],qs['fields'](_0x234219[_0x9327('0x2d')][_0x9327('0x30')]));_0x521a81[_0x9327('0x31')]=_0x521a81['attributes'][_0x9327('0x32')]?_0x521a81[_0x9327('0x31')]:_0x4c9751[_0x9327('0x2b')];if(!_0x234219[_0x9327('0x2d')][_0x9327('0x33')](_0x9327('0x34'))){_0x521a81[_0x9327('0x1c')]=qs[_0x9327('0x1c')](_0x234219[_0x9327('0x2d')][_0x9327('0x1c')]);_0x521a81[_0x9327('0x19')]=qs['offset'](_0x234219[_0x9327('0x2d')]['offset']);}_0x521a81[_0x9327('0x35')]=qs['sort'](_0x234219[_0x9327('0x2d')][_0x9327('0x36')]);_0x521a81[_0x9327('0x37')]=qs[_0x9327('0x2e')](_[_0x9327('0x38')](_0x234219[_0x9327('0x2d')],_0x4c9751['filters']),_0x5ebd96);if(_0x234219[_0x9327('0x2d')][_0x9327('0x39')]){_0x521a81[_0x9327('0x37')]=_['merge'](_0x521a81['where'],{'$or':_['map'](_0x5ebd96,function(_0x44437f){if(_0x44437f[_0x9327('0x2a')]!==_0x9327('0x3a')){var _0x5451f4={};_0x5451f4[_0x44437f[_0x9327('0x25')]]={'$like':'%'+_0x234219['query'][_0x9327('0x39')]+'%'};return _0x5451f4;}})});}_0x521a81=_[_0x9327('0x3b')]({},_0x521a81,_0x234219[_0x9327('0x3c')]);var _0x27e263={'where':_0x521a81[_0x9327('0x37')]};return db[_0x9327('0x3d')][_0x9327('0x1b')](_0x27e263)[_0x9327('0x22')](function(_0x517cec){_0x22fca1[_0x9327('0x1b')]=_0x517cec;if(_0x234219[_0x9327('0x2d')][_0x9327('0x3e')]){_0x521a81[_0x9327('0x3f')]=[{'all':!![]}];}return db[_0x9327('0x3d')][_0x9327('0x40')](_0x521a81);})['then'](function(_0x5573a4){_0x22fca1[_0x9327('0x41')]=_0x5573a4;return _0x22fca1;})[_0x9327('0x22')](respondWithFilteredResult(_0x944636,_0x521a81))[_0x9327('0x42')](handleError(_0x944636,null));};exports['show']=function(_0x30c81d,_0x37b78e){var _0x49ba37={'raw':!![],'where':{'id':_0x30c81d['params']['id']}},_0x1175cb={};_0x1175cb[_0x9327('0x2b')]=_[_0x9327('0x2c')](db[_0x9327('0x3d')][_0x9327('0x28')]);_0x1175cb[_0x9327('0x2d')]=_[_0x9327('0x2c')](_0x30c81d[_0x9327('0x2d')]);_0x1175cb[_0x9327('0x2e')]=_['intersection'](_0x1175cb[_0x9327('0x2b')],_0x1175cb[_0x9327('0x2d')]);_0x49ba37[_0x9327('0x31')]=_[_0x9327('0x2f')](_0x1175cb['model'],qs[_0x9327('0x30')](_0x30c81d['query'][_0x9327('0x30')]));_0x49ba37['attributes']=_0x49ba37[_0x9327('0x31')][_0x9327('0x32')]?_0x49ba37[_0x9327('0x31')]:_0x1175cb['model'];if(_0x30c81d[_0x9327('0x2d')]['includeAll']){_0x49ba37[_0x9327('0x3f')]=[{'all':!![]}];}_0x49ba37=_['merge']({},_0x49ba37,_0x30c81d[_0x9327('0x3c')]);return db[_0x9327('0x3d')][_0x9327('0x43')](_0x49ba37)['then'](handleEntityNotFound(_0x37b78e,null))['then'](respondWithResult(_0x37b78e,null))[_0x9327('0x42')](handleError(_0x37b78e,null));};exports[_0x9327('0x44')]=function(_0x12901e,_0x48c508){return db[_0x9327('0x3d')][_0x9327('0x44')](_0x12901e[_0x9327('0x45')],{})['then'](respondWithResult(_0x48c508,0xc9))[_0x9327('0x42')](handleError(_0x48c508,null));};exports[_0x9327('0x21')]=function(_0x124aa2,_0x3bf87a){if(_0x124aa2[_0x9327('0x45')]['id']){delete _0x124aa2['body']['id'];}return db[_0x9327('0x3d')]['find']({'where':{'id':_0x124aa2[_0x9327('0x46')]['id']}})[_0x9327('0x22')](handleEntityNotFound(_0x3bf87a,null))[_0x9327('0x22')](saveUpdates(_0x124aa2['body'],null))[_0x9327('0x22')](respondWithResult(_0x3bf87a,null))[_0x9327('0x42')](handleError(_0x3bf87a,null));};exports['destroy']=function(_0xb0d55c,_0x17eab9){return db['VtigerField'][_0x9327('0x43')]({'where':{'id':_0xb0d55c[_0x9327('0x46')]['id']}})[_0x9327('0x22')](handleEntityNotFound(_0x17eab9,null))[_0x9327('0x22')](removeEntity(_0x17eab9,null))[_0x9327('0x42')](handleError(_0x17eab9,null));};
\ No newline at end of file
index 625289b..fc516a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1016=['idField','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerField','vtiger_unique_index'];(function(_0x368a57,_0x427b1d){var _0x34edb5=function(_0x2119b0){while(--_0x2119b0){_0x368a57['push'](_0x368a57['shift']());}};_0x34edb5(++_0x427b1d);}(_0x1016,0x1ae));var _0x6101=function(_0x428102,_0x28f634){_0x428102=_0x428102-0x0;var _0x3df8b9=_0x1016[_0x428102];return _0x3df8b9;};'use strict';var _=require('lodash');var util=require(_0x6101('0x0'));var logger=require(_0x6101('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6101('0x2'));var rp=require(_0x6101('0x3'));var fs=require('fs');var path=require(_0x6101('0x4'));var rimraf=require(_0x6101('0x5'));var config=require(_0x6101('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x209866,_0x1cc40e){return _0x209866[_0x6101('0x7')](_0x6101('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x6101('0x9'),'fields':[_0x6101('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd12f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x296d1a,_0x122b24){var _0x46d644=function(_0x3dfb59){while(--_0x3dfb59){_0x296d1a['push'](_0x296d1a['shift']());}};_0x46d644(++_0x122b24);}(_0xd12f,0x9e));var _0xfd12=function(_0x777a68,_0x526ba2){_0x777a68=_0x777a68-0x0;var _0x5796e6=_0xd12f[_0x777a68];return _0x5796e6;};'use strict';var _=require('lodash');var util=require(_0xfd12('0x0'));var logger=require(_0xfd12('0x1'))(_0xfd12('0x2'));var moment=require(_0xfd12('0x3'));var BPromise=require(_0xfd12('0x4'));var rp=require(_0xfd12('0x5'));var fs=require('fs');var path=require(_0xfd12('0x6'));var rimraf=require(_0xfd12('0x7'));var config=require(_0xfd12('0x8'));var attributes=require(_0xfd12('0x9'));module[_0xfd12('0xa')]=function(_0x933f8c,_0x46d156){return _0x933f8c['define'](_0xfd12('0xb'),attributes,{'tableName':_0xfd12('0xc'),'paranoid':![],'indexes':[{'name':_0xfd12('0xd'),'fields':[_0xfd12('0xe'),_0xfd12('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b48d1ff..88ef056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb0=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdeb0,0x1a2));var _0x0deb=function(_0x47cde9,_0x19d013){_0x47cde9=_0x47cde9-0x0;var _0x26fdf1=_0xdeb0[_0x47cde9];return _0x26fdf1;};'use strict';var _=require(_0x0deb('0x0'));var util=require(_0x0deb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0deb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0deb('0x3'))['db'];var utils=require(_0x0deb('0x4'));var logger=require(_0x0deb('0x5'))(_0x0deb('0x6'));var config=require(_0x0deb('0x7'));var jayson=require(_0x0deb('0x8'));var client=jayson[_0x0deb('0x9')][_0x0deb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x349f42,_0x152939,_0x2b187a){return new BPromise(function(_0x42ced5,_0x4043fc){return client[_0x0deb('0xb')](_0x349f42,_0x2b187a)[_0x0deb('0xc')](function(_0x57a69c){logger['info'](_0x0deb('0xd'),_0x152939,_0x0deb('0xe'));logger[_0x0deb('0xf')](_0x0deb('0x10'),_0x152939,_0x0deb('0xe'),JSON[_0x0deb('0x11')](_0x57a69c));if(_0x57a69c[_0x0deb('0x12')]){if(_0x57a69c['error'][_0x0deb('0x13')]===0x1f4){logger[_0x0deb('0x12')](_0x0deb('0xd'),_0x152939,_0x57a69c[_0x0deb('0x12')][_0x0deb('0x14')]);return _0x4043fc(_0x57a69c[_0x0deb('0x12')][_0x0deb('0x14')]);}logger[_0x0deb('0x12')](_0x0deb('0xd'),_0x152939,_0x57a69c[_0x0deb('0x12')][_0x0deb('0x14')]);return _0x42ced5(_0x57a69c['error'][_0x0deb('0x14')]);}else{logger[_0x0deb('0x15')](_0x0deb('0xd'),_0x152939,_0x0deb('0xe'));_0x42ced5(_0x57a69c[_0x0deb('0x16')]['message']);}})[_0x0deb('0x17')](function(_0x6a65c2){logger[_0x0deb('0x12')](_0x0deb('0xd'),_0x152939,_0x6a65c2);_0x4043fc(_0x6a65c2);});});}
\ No newline at end of file
+var _0x7ddf=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc4ce31,_0x4b5b97){var _0xc37685=function(_0x13eb92){while(--_0x13eb92){_0xc4ce31['push'](_0xc4ce31['shift']());}};_0xc37685(++_0x4b5b97);}(_0x7ddf,0x174));var _0xf7dd=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x7ddf[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0xf7dd('0x0'));var util=require(_0xf7dd('0x1'));var moment=require(_0xf7dd('0x2'));var BPromise=require(_0xf7dd('0x3'));var rs=require(_0xf7dd('0x4'));var fs=require('fs');var Redis=require(_0xf7dd('0x5'));var db=require(_0xf7dd('0x6'))['db'];var utils=require(_0xf7dd('0x7'));var logger=require(_0xf7dd('0x8'))(_0xf7dd('0x9'));var config=require(_0xf7dd('0xa'));var jayson=require(_0xf7dd('0xb'));var client=jayson[_0xf7dd('0xc')][_0xf7dd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x165ae6,_0x2057da,_0x35a8ea){return new BPromise(function(_0xd2669d,_0x5a97a6){return client[_0xf7dd('0xe')](_0x165ae6,_0x35a8ea)[_0xf7dd('0xf')](function(_0x57d3db){logger[_0xf7dd('0x10')](_0xf7dd('0x11'),_0x2057da,_0xf7dd('0x12'));logger['debug'](_0xf7dd('0x13'),_0x2057da,_0xf7dd('0x12'),JSON[_0xf7dd('0x14')](_0x57d3db));if(_0x57d3db['error']){if(_0x57d3db['error']['code']===0x1f4){logger[_0xf7dd('0x15')](_0xf7dd('0x11'),_0x2057da,_0x57d3db['error'][_0xf7dd('0x16')]);return _0x5a97a6(_0x57d3db[_0xf7dd('0x15')][_0xf7dd('0x16')]);}logger[_0xf7dd('0x15')](_0xf7dd('0x11'),_0x2057da,_0x57d3db[_0xf7dd('0x15')][_0xf7dd('0x16')]);return _0xd2669d(_0x57d3db[_0xf7dd('0x15')][_0xf7dd('0x16')]);}else{logger[_0xf7dd('0x10')](_0xf7dd('0x11'),_0x2057da,'request\x20sent');_0xd2669d(_0x57d3db['result']['message']);}})[_0xf7dd('0x17')](function(_0x3c6ec6){logger[_0xf7dd('0x15')](_0xf7dd('0x11'),_0x2057da,_0x3c6ec6);_0x5a97a6(_0x3c6ec6);});});}
\ No newline at end of file
index 8d81be0..e253681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0309=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','/:id'];(function(_0x24d282,_0x3d13d9){var _0x138c47=function(_0x3aaefd){while(--_0x3aaefd){_0x24d282['push'](_0x24d282['shift']());}};_0x138c47(++_0x3d13d9);}(_0x0309,0x8d));var _0x9030=function(_0x15355b,_0x505ba0){_0x15355b=_0x15355b-0x0;var _0x269040=_0x0309[_0x15355b];return _0x269040;};'use strict';var multer=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var path=require(_0x9030('0x2'));var timeout=require(_0x9030('0x3'));var express=require(_0x9030('0x4'));var router=express['Router']();var fs_extra=require(_0x9030('0x5'));var auth=require(_0x9030('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9030('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9030('0x8')]('/:id',auth[_0x9030('0x9')](),controller[_0x9030('0xa')]);router[_0x9030('0x8')](_0x9030('0xb'),auth[_0x9030('0x9')](),controller[_0x9030('0xc')]);router[_0x9030('0x8')](_0x9030('0xd'),auth[_0x9030('0x9')](),controller['getFields']);router[_0x9030('0xe')]('/',auth['isAuthenticated'](),controller[_0x9030('0xf')]);router[_0x9030('0xe')]('/:id/configurations',auth[_0x9030('0x9')](),controller['addConfiguration']);router[_0x9030('0x10')]('/:id',auth[_0x9030('0x9')](),controller['update']);router[_0x9030('0x11')](_0x9030('0x12'),auth[_0x9030('0x9')](),controller[_0x9030('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xf494=['delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x549462,_0x1f064a){_0x549462=_0x549462-0x0;var _0x16cfff=_0xf494[_0x549462];return _0x16cfff;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getFields']);router[_0x4f49('0x11')]('/',auth[_0x4f49('0xb')](),controller['create']);router[_0x4f49('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router[_0x4f49('0x13')]('/:id',auth[_0x4f49('0xb')](),controller[_0x4f49('0x14')]);router[_0x4f49('0x15')](_0x4f49('0x16'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x17')]);module[_0x4f49('0x18')]=router;
\ No newline at end of file
index 875da0c..5375e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a38=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1a38,0xb0));var _0x81a3=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0x1a38[_0x39106e];return _0x892aec;};'use strict';var Sequelize=require(_0x81a3('0x0'));module[_0x81a3('0x1')]={'name':{'type':Sequelize[_0x81a3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x81a3('0x2')]},'token':{'type':Sequelize[_0x81a3('0x2')]},'remoteUri':{'type':Sequelize[_0x81a3('0x2')],'unique':_0x81a3('0x3')},'authType':{'type':Sequelize[_0x81a3('0x4')](_0x81a3('0x5'),_0x81a3('0x6')),'defaultValue':_0x81a3('0x5')},'serverUrl':{'type':Sequelize[_0x81a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x81a3('0x4')](_0x81a3('0x7'),_0x81a3('0x8')),'defaultValue':_0x81a3('0x7')}};
\ No newline at end of file
+var _0x1883=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0x37d4bb,_0x39d56e){var _0x3cec6f=function(_0x4a79d0){while(--_0x4a79d0){_0x37d4bb['push'](_0x37d4bb['shift']());}};_0x3cec6f(++_0x39d56e);}(_0x1883,0xab));var _0x3188=function(_0x40176b,_0x168e9f){_0x40176b=_0x40176b-0x0;var _0x874f78=_0x1883[_0x40176b];return _0x874f78;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')]},'description':{'type':Sequelize[_0x3188('0x2')]},'username':{'type':Sequelize[_0x3188('0x2')],'unique':_0x3188('0x3')},'password':{'type':Sequelize[_0x3188('0x2')]},'token':{'type':Sequelize[_0x3188('0x2')]},'remoteUri':{'type':Sequelize[_0x3188('0x2')],'unique':_0x3188('0x4')},'authType':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6'),_0x3188('0x7')),'defaultValue':_0x3188('0x6')},'serverUrl':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x8'),'newTab'),'defaultValue':_0x3188('0x8')}};
\ No newline at end of file
index 2d76eee..00a72df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x2ecefc,_0x168d05){_0x2ecefc=_0x2ecefc-0x0;var _0x5b77ae=_0xb58b[_0x2ecefc];return _0x5b77ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});};
\ No newline at end of file
+var _0x7916=['hasOwnProperty','order','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','findOne','password','token','remoteUri','slice','substring','GET','format','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','username','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','limit','status','set','apply','save','then','destroy','error','name','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x508e8e,_0x162c7e){var _0x1de4d6=function(_0x4ea616){while(--_0x4ea616){_0x508e8e['push'](_0x508e8e['shift']());}};_0x1de4d6(++_0x162c7e);}(_0x7916,0x128));var _0x6791=function(_0x517c7c,_0x32f634){_0x517c7c=_0x517c7c-0x0;var _0x1a9832=_0x7916[_0x517c7c];return _0x1a9832;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];var integrations=require(_0x6791('0x17'));function respondWithStatusCode(_0x16c62b,_0x423e22){_0x423e22=_0x423e22||0xcc;return function(_0x11c730){if(_0x11c730){return _0x16c62b[_0x6791('0x18')](_0x423e22);}return _0x16c62b['status'](_0x423e22)['end']();};}function respondWithResult(_0x34b28d,_0x5122f9){_0x5122f9=_0x5122f9||0xc8;return function(_0x2a9151){if(_0x2a9151){return _0x34b28d['status'](_0x5122f9)[_0x6791('0x19')](_0x2a9151);}};}function respondWithFilteredResult(_0x163898,_0x517910){return function(_0x3e4792){if(_0x3e4792){var _0x4b80ed=typeof _0x517910[_0x6791('0x1a')]===_0x6791('0x1b')&&typeof _0x517910['limit']===_0x6791('0x1b');var _0x36d7a1=_0x3e4792['count'];var _0x1872f5=_0x4b80ed?0x0:_0x517910['offset'];var _0xe55dba=_0x4b80ed?_0x3e4792[_0x6791('0x1c')]:_0x517910[_0x6791('0x1a')]+_0x517910[_0x6791('0x1d')];var _0x25adbc;if(_0xe55dba>=_0x36d7a1){_0xe55dba=_0x36d7a1;_0x25adbc=0xc8;}else{_0x25adbc=0xce;}_0x163898[_0x6791('0x1e')](_0x25adbc);return _0x163898[_0x6791('0x1f')]('Content-Range',_0x1872f5+'-'+_0xe55dba+'/'+_0x36d7a1)[_0x6791('0x19')](_0x3e4792);}return null;};}function patchUpdates(_0x306acb){return function(_0x51368e){try{jsonpatch[_0x6791('0x20')](_0x51368e,_0x306acb,!![]);}catch(_0x3b57f0){return BPromise['reject'](_0x3b57f0);}return _0x51368e[_0x6791('0x21')]();};}function saveUpdates(_0x309610,_0x15b9ab){return function(_0x12d83b){if(_0x12d83b){return _0x12d83b['update'](_0x309610)[_0x6791('0x22')](function(_0x1b516d){return _0x1b516d;});}return null;};}function removeEntity(_0x4a8717,_0x53bb44){return function(_0x4b23bc){if(_0x4b23bc){return _0x4b23bc[_0x6791('0x23')]()['then'](function(){_0x4a8717[_0x6791('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a092,_0x496273){return function(_0x5cadc){if(!_0x5cadc){_0x54a092[_0x6791('0x18')](0x194);}return _0x5cadc;};}function handleError(_0xd49b84,_0x56a74e){_0x56a74e=_0x56a74e||0x1f4;return function(_0x3def2e){logger[_0x6791('0x24')](_0x3def2e['stack']);if(_0x3def2e[_0x6791('0x25')]){delete _0x3def2e['name'];}_0xd49b84[_0x6791('0x1e')](_0x56a74e)['send'](_0x3def2e);};}exports['index']=function(_0x270a1d,_0x551718){var _0x2f56a2={},_0x34b006={},_0x483d6c={'count':0x0,'rows':[]};var _0x240a9f=_[_0x6791('0x26')](db[_0x6791('0x27')][_0x6791('0x28')],function(_0x5d9d54){return{'name':_0x5d9d54['fieldName'],'type':_0x5d9d54[_0x6791('0x29')]['key']};});_0x34b006[_0x6791('0x2a')]=_[_0x6791('0x26')](_0x240a9f,_0x6791('0x25'));_0x34b006[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x270a1d[_0x6791('0x2b')]);_0x34b006[_0x6791('0x2d')]=_[_0x6791('0x2e')](_0x34b006[_0x6791('0x2a')],_0x34b006[_0x6791('0x2b')]);_0x2f56a2['attributes']=_[_0x6791('0x2e')](_0x34b006[_0x6791('0x2a')],qs[_0x6791('0x2f')](_0x270a1d[_0x6791('0x2b')][_0x6791('0x2f')]));_0x2f56a2[_0x6791('0x30')]=_0x2f56a2['attributes']['length']?_0x2f56a2['attributes']:_0x34b006[_0x6791('0x2a')];if(!_0x270a1d[_0x6791('0x2b')][_0x6791('0x31')]('nolimit')){_0x2f56a2['limit']=qs[_0x6791('0x1d')](_0x270a1d[_0x6791('0x2b')][_0x6791('0x1d')]);_0x2f56a2[_0x6791('0x1a')]=qs['offset'](_0x270a1d[_0x6791('0x2b')][_0x6791('0x1a')]);}_0x2f56a2[_0x6791('0x32')]=qs['sort'](_0x270a1d[_0x6791('0x2b')]['sort']);_0x2f56a2['where']=qs[_0x6791('0x2d')](_[_0x6791('0x33')](_0x270a1d['query'],_0x34b006[_0x6791('0x2d')]),_0x240a9f);if(_0x270a1d[_0x6791('0x2b')][_0x6791('0x34')]){_0x2f56a2[_0x6791('0x35')]=_[_0x6791('0x36')](_0x2f56a2['where'],{'$or':_[_0x6791('0x26')](_0x240a9f,function(_0xc95516){if(_0xc95516[_0x6791('0x29')]!=='VIRTUAL'){var _0x3a6062={};_0x3a6062[_0xc95516[_0x6791('0x25')]]={'$like':'%'+_0x270a1d[_0x6791('0x2b')]['filter']+'%'};return _0x3a6062;}})});}_0x2f56a2=_[_0x6791('0x36')]({},_0x2f56a2,_0x270a1d[_0x6791('0x37')]);var _0x13be81={'where':_0x2f56a2[_0x6791('0x35')]};return db['ZendeskAccount'][_0x6791('0x1c')](_0x13be81)[_0x6791('0x22')](function(_0x3e95b6){_0x483d6c[_0x6791('0x1c')]=_0x3e95b6;if(_0x270a1d[_0x6791('0x2b')][_0x6791('0x38')]){_0x2f56a2[_0x6791('0x39')]=[{'all':!![]}];}return db[_0x6791('0x27')][_0x6791('0x3a')](_0x2f56a2);})['then'](function(_0x52c03a){_0x483d6c[_0x6791('0x3b')]=_0x52c03a;return _0x483d6c;})[_0x6791('0x22')](respondWithFilteredResult(_0x551718,_0x2f56a2))['catch'](handleError(_0x551718,null));};exports[_0x6791('0x3c')]=function(_0x1c9913,_0x1c6803){var _0x3edb86={'raw':![],'where':{'id':_0x1c9913[_0x6791('0x3d')]['id']}},_0x1a922e={};_0x1a922e[_0x6791('0x2a')]=_['keys'](db[_0x6791('0x27')]['rawAttributes']);_0x1a922e[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x1c9913[_0x6791('0x2b')]);_0x1a922e[_0x6791('0x2d')]=_['intersection'](_0x1a922e[_0x6791('0x2a')],_0x1a922e[_0x6791('0x2b')]);_0x3edb86[_0x6791('0x30')]=_[_0x6791('0x2e')](_0x1a922e[_0x6791('0x2a')],qs[_0x6791('0x2f')](_0x1c9913[_0x6791('0x2b')][_0x6791('0x2f')]));_0x3edb86['attributes']=_0x3edb86[_0x6791('0x30')][_0x6791('0x3e')]?_0x3edb86[_0x6791('0x30')]:_0x1a922e[_0x6791('0x2a')];if(_0x1c9913['query'][_0x6791('0x38')]){_0x3edb86[_0x6791('0x39')]=[{'all':!![]}];}_0x3edb86=_['merge']({},_0x3edb86,_0x1c9913[_0x6791('0x37')]);return db['ZendeskAccount'][_0x6791('0x3f')](_0x3edb86)[_0x6791('0x22')](handleEntityNotFound(_0x1c6803,null))[_0x6791('0x22')](respondWithResult(_0x1c6803,null))[_0x6791('0x40')](handleError(_0x1c6803,null));};exports[_0x6791('0x41')]=function(_0xb2a2,_0x4163f5){return db[_0x6791('0x27')][_0x6791('0x41')](_0xb2a2['body'],{})[_0x6791('0x22')](respondWithResult(_0x4163f5,0xc9))['catch'](handleError(_0x4163f5,null));};exports[_0x6791('0x42')]=function(_0x2bb86a,_0x276002){if(_0x2bb86a[_0x6791('0x43')]['id']){delete _0x2bb86a[_0x6791('0x43')]['id'];}return db['ZendeskAccount'][_0x6791('0x3f')]({'where':{'id':_0x2bb86a[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x276002,null))[_0x6791('0x22')](saveUpdates(_0x2bb86a[_0x6791('0x43')],null))['then'](respondWithResult(_0x276002,null))[_0x6791('0x40')](handleError(_0x276002,null));};exports[_0x6791('0x23')]=function(_0x4ff9f4,_0x3df699){return db['ZendeskAccount'][_0x6791('0x3f')]({'where':{'id':_0x4ff9f4[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x3df699,null))[_0x6791('0x22')](removeEntity(_0x3df699,null))['catch'](handleError(_0x3df699,null));};exports[_0x6791('0x44')]=function(_0x243faf,_0x5655c8,_0x189b22){var _0x4370ab={};var _0x3a895b={};var _0x5df56e;var _0x355e97;return db[_0x6791('0x27')]['findOne']({'where':{'id':_0x243faf[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x5655c8,null))['then'](function(_0x169531){if(_0x169531){_0x5df56e=_0x169531;_0x3a895b[_0x6791('0x2a')]=_[_0x6791('0x2c')](db[_0x6791('0x45')]['rawAttributes']);_0x3a895b[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x243faf[_0x6791('0x2b')]);_0x3a895b['filters']=_['intersection'](_0x3a895b[_0x6791('0x2a')],_0x3a895b[_0x6791('0x2b')]);_0x4370ab[_0x6791('0x30')]=_[_0x6791('0x2e')](_0x3a895b[_0x6791('0x2a')],qs['fields'](_0x243faf['query'][_0x6791('0x2f')]));_0x4370ab['attributes']=_0x4370ab['attributes'][_0x6791('0x3e')]?_0x4370ab[_0x6791('0x30')]:_0x3a895b[_0x6791('0x2a')];_0x4370ab[_0x6791('0x32')]=qs[_0x6791('0x46')](_0x243faf[_0x6791('0x2b')]['sort']);_0x4370ab['where']=qs[_0x6791('0x2d')](_[_0x6791('0x33')](_0x243faf['query'],_0x3a895b[_0x6791('0x2d')]));if(_0x243faf['query'][_0x6791('0x34')]){_0x4370ab[_0x6791('0x35')]=_['merge'](_0x4370ab[_0x6791('0x35')],{'$or':_[_0x6791('0x26')](_0x4370ab[_0x6791('0x30')],function(_0x49ed65){var _0x3ba679={};_0x3ba679[_0x49ed65]={'$like':'%'+_0x243faf[_0x6791('0x2b')][_0x6791('0x34')]+'%'};return _0x3ba679;})});}_0x4370ab=_[_0x6791('0x36')]({},_0x4370ab,_0x243faf[_0x6791('0x37')]);return _0x5df56e['getConfigurations'](_0x4370ab);}})['then'](function(_0x1a9acd){if(_0x1a9acd){_0x355e97=_0x1a9acd[_0x6791('0x3e')];if(!_0x243faf['query'][_0x6791('0x31')](_0x6791('0x47'))){_0x4370ab[_0x6791('0x1d')]=qs[_0x6791('0x1d')](_0x243faf[_0x6791('0x2b')][_0x6791('0x1d')]);_0x4370ab[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x243faf['query'][_0x6791('0x1a')]);}return _0x5df56e[_0x6791('0x44')](_0x4370ab);}})[_0x6791('0x22')](function(_0x1a9a2e){if(_0x1a9a2e){return _0x1a9a2e?{'count':_0x355e97,'rows':_0x1a9a2e}:null;}})['then'](respondWithResult(_0x5655c8,null))[_0x6791('0x40')](handleError(_0x5655c8,null));};exports[_0x6791('0x48')]=function(_0xa8a8dd,_0x5ca809,_0x205320){if(_0xa8a8dd[_0x6791('0x43')]['id']){delete _0xa8a8dd[_0x6791('0x43')]['id'];}return db[_0x6791('0x27')]['findOne']({'where':{'id':_0xa8a8dd[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x5ca809,null))['then'](function(_0x1114d4){if(_0x1114d4){_0xa8a8dd[_0x6791('0x43')][_0x6791('0x49')]=_0x1114d4['id'];_0xa8a8dd[_0x6791('0x43')][_0x6791('0x4a')]=integrations[_0x6791('0x4b')](_0xa8a8dd['body'][_0x6791('0x4c')],_0xa8a8dd[_0x6791('0x43')][_0x6791('0x29')]);_0xa8a8dd['body'][_0x6791('0x4d')]=integrations['getDescriptions'](_0xa8a8dd[_0x6791('0x43')][_0x6791('0x4c')],_0xa8a8dd[_0x6791('0x43')][_0x6791('0x29')]);return db[_0x6791('0x45')]['create'](_0xa8a8dd[_0x6791('0x43')],{'include':[{'model':db[_0x6791('0x4e')],'as':_0x6791('0x4a')},{'model':db[_0x6791('0x4e')],'as':'Descriptions'}]});}return null;})[_0x6791('0x22')](respondWithResult(_0x5ca809,null))[_0x6791('0x40')](handleError(_0x5ca809,null));};exports['getFields']=function(_0x34691c,_0x1fa44a,_0x567302){var _0x201465='';return db[_0x6791('0x27')][_0x6791('0x4f')]({'where':{'id':_0x34691c[_0x6791('0x3d')]['id']},'attributes':['id','username',_0x6791('0x50'),_0x6791('0x51'),'authType',_0x6791('0x52')]})[_0x6791('0x22')](handleEntityNotFound(_0x1fa44a,null))[_0x6791('0x22')](function(_0x20c736){if(_0x20c736){_0x201465=_0x20c736[_0x6791('0x52')];var _0x4ecf62=_0x201465[_0x6791('0x53')](-0x1);if(_0x4ecf62==='/'){_0x201465=_0x201465[_0x6791('0x54')](0x0,_0x201465['lastIndexOf'](_0x4ecf62));}var _0x4463ef={'method':_0x6791('0x55'),'uri':util[_0x6791('0x56')]('%s/%s',_0x201465,_0x6791('0x57')),'json':!![]};switch(_0x20c736[_0x6791('0x58')]){case _0x6791('0x50'):_0x4463ef[_0x6791('0x59')]={'Authorization':util[_0x6791('0x56')](_0x6791('0x5a'),new Buffer(util[_0x6791('0x56')](_0x6791('0x5b'),_0x20c736['username'],_0x20c736[_0x6791('0x50')]))[_0x6791('0x5c')]('base64'))};break;case _0x6791('0x51'):_0x4463ef[_0x6791('0x59')]={'Authorization':util[_0x6791('0x56')]('Basic\x20%s',new Buffer(util[_0x6791('0x56')]('%s/token:%s',_0x20c736[_0x6791('0x5d')],_0x20c736[_0x6791('0x51')]))[_0x6791('0x5c')](_0x6791('0x5e')))};break;default:throw new db[(_0x6791('0x5f'))][(_0x6791('0x60'))](_0x6791('0x61'));}return rp(_0x4463ef);}})[_0x6791('0x22')](function(_0x23e0d3){if(_0x23e0d3){var _0x1fa853=[_0x6791('0x62'),_0x6791('0x63'),_0x6791('0x64'),_0x6791('0x65')];_[_0x6791('0x66')](_0x23e0d3[_0x6791('0x57')],function(_0x3b53b8){return _0x1fa853[_0x6791('0x67')](_0x3b53b8[_0x6791('0x29')]);});return{'count':_0x23e0d3['ticket_fields']['length'],'rows':_['map'](_0x23e0d3[_0x6791('0x57')],function(_0x31c1a8){return{'id':_0x31c1a8['id'],'name':_0x31c1a8[_0x6791('0x68')]>0x7?_0x31c1a8[_0x6791('0x69')]:_0x31c1a8[_0x6791('0x29')],'custom':_0x31c1a8[_0x6791('0x68')]>0x7?!![]:![],'options':_0x31c1a8[_0x6791('0x6a')]?_0x31c1a8[_0x6791('0x6a')]:_0x31c1a8[_0x6791('0x6b')]?_0x31c1a8[_0x6791('0x6b')]:[]};})};}})[_0x6791('0x22')](respondWithResult(_0x1fa44a,null))[_0x6791('0x40')](function(_0x44ec4d){var _0x4047b6=_0x34691c[_0x6791('0x2b')][_0x6791('0x6c')]?0x1f4:_0x44ec4d[_0x6791('0x6d')]||0x1f4;logger[_0x6791('0x24')](_0x6791('0x6e'),_0x6791('0x6f'),_0x4047b6,JSON[_0x6791('0x70')](_0x44ec4d));delete _0x44ec4d[_0x6791('0x25')];if(_0x4047b6===0x191){_0x4047b6=0x190;}_0x1fa44a[_0x6791('0x1e')](_0x4047b6)[_0x6791('0x71')](_0x34691c[_0x6791('0x2b')]['test']?{'message':_0x6791('0x72'),'statusCode':_0x44ec4d['statusCode']}:_0x44ec4d);});};
\ No newline at end of file
index 77c89d1..c9eff3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6cc=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes'];(function(_0x2af46c,_0x182828){var _0x891575=function(_0x2083cf){while(--_0x2083cf){_0x2af46c['push'](_0x2af46c['shift']());}};_0x891575(++_0x182828);}(_0xd6cc,0x101));var _0xcd6c=function(_0x305a2,_0x402623){_0x305a2=_0x305a2-0x0;var _0x27747d=_0xd6cc[_0x305a2];return _0x27747d;};'use strict';var _=require(_0xcd6c('0x0'));var util=require(_0xcd6c('0x1'));var logger=require(_0xcd6c('0x2'))(_0xcd6c('0x3'));var moment=require(_0xcd6c('0x4'));var BPromise=require(_0xcd6c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd6c('0x6'));var rimraf=require('rimraf');var config=require(_0xcd6c('0x7'));var attributes=require(_0xcd6c('0x8'));var integrations=require(_0xcd6c('0x9'));module[_0xcd6c('0xa')]=function(_0x6be118,_0x4050ef){return _0x6be118[_0xcd6c('0xb')](_0xcd6c('0xc'),attributes,{'tableName':_0xcd6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c20=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','../../config/logger','api','moment','bluebird'];(function(_0x356994,_0x1c0948){var _0x1534cb=function(_0x31f70d){while(--_0x31f70d){_0x356994['push'](_0x356994['shift']());}};_0x1534cb(++_0x1c0948);}(_0x4c20,0x14c));var _0x04c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04c2('0x0'))(_0x04c2('0x1'));var moment=require(_0x04c2('0x2'));var BPromise=require(_0x04c2('0x3'));var rp=require(_0x04c2('0x4'));var fs=require('fs');var path=require(_0x04c2('0x5'));var rimraf=require(_0x04c2('0x6'));var config=require(_0x04c2('0x7'));var attributes=require(_0x04c2('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x04c2('0x9')]=function(_0x5098a7,_0x425713){return _0x5098a7[_0x04c2('0xa')](_0x04c2('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e9fd9db..ab369fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf360=['attributes','include','map','model','then','debug','ZendeskAccount','find','where','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','options','raw'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xf360,0x13c));var _0x0f36=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf360[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x0f36('0x0'));var util=require('util');var moment=require(_0x0f36('0x1'));var BPromise=require(_0x0f36('0x2'));var rs=require(_0x0f36('0x3'));var fs=require('fs');var Redis=require(_0x0f36('0x4'));var db=require(_0x0f36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f36('0x6'))(_0x0f36('0x7'));var config=require(_0x0f36('0x8'));var jayson=require(_0x0f36('0x9'));var client=jayson['client'][_0x0f36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b90,_0x202b8c,_0x306e95){return new BPromise(function(_0x5411b3,_0x33a575){return client[_0x0f36('0xb')](_0x2f0b90,_0x306e95)['then'](function(_0x409925){logger[_0x0f36('0xc')](_0x0f36('0xd'),_0x202b8c,_0x0f36('0xe'));logger['debug'](_0x0f36('0xf'),_0x202b8c,_0x0f36('0xe'),JSON[_0x0f36('0x10')](_0x409925));if(_0x409925[_0x0f36('0x11')]){if(_0x409925['error']['code']===0x1f4){logger[_0x0f36('0x11')](_0x0f36('0xd'),_0x202b8c,_0x409925[_0x0f36('0x11')][_0x0f36('0x12')]);return _0x33a575(_0x409925['error'][_0x0f36('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x202b8c,_0x409925[_0x0f36('0x11')]['message']);return _0x5411b3(_0x409925[_0x0f36('0x11')][_0x0f36('0x12')]);}else{logger[_0x0f36('0xc')](_0x0f36('0xd'),_0x202b8c,_0x0f36('0xe'));_0x5411b3(_0x409925[_0x0f36('0x13')]['message']);}})[_0x0f36('0x14')](function(_0x4be078){logger[_0x0f36('0x11')](_0x0f36('0xd'),_0x202b8c,_0x4be078);_0x33a575(_0x4be078);});});}exports[_0x0f36('0x15')]=function(_0x3b6956){var _0x44729b=this;return new Promise(function(_0x7e27c1,_0x4300d7){return db['ZendeskAccount']['findAll']({'raw':_0x3b6956[_0x0f36('0x16')]?_0x3b6956[_0x0f36('0x16')][_0x0f36('0x17')]===undefined?!![]:![]:!![],'where':_0x3b6956[_0x0f36('0x16')]?_0x3b6956[_0x0f36('0x16')]['where']||null:null,'attributes':_0x3b6956[_0x0f36('0x16')]?_0x3b6956[_0x0f36('0x16')][_0x0f36('0x18')]||null:null,'limit':_0x3b6956[_0x0f36('0x16')]?_0x3b6956[_0x0f36('0x16')]['limit']||null:null,'include':_0x3b6956[_0x0f36('0x16')]?_0x3b6956[_0x0f36('0x16')][_0x0f36('0x19')]?_[_0x0f36('0x1a')](_0x3b6956['options'][_0x0f36('0x19')],function(_0x1de3fc){return{'model':db[_0x1de3fc[_0x0f36('0x1b')]],'as':_0x1de3fc['as'],'attributes':_0x1de3fc[_0x0f36('0x18')],'include':_0x1de3fc[_0x0f36('0x19')]?_[_0x0f36('0x1a')](_0x1de3fc['include'],function(_0xe2690b){return{'model':db[_0xe2690b[_0x0f36('0x1b')]],'as':_0xe2690b['as'],'attributes':_0xe2690b[_0x0f36('0x18')],'include':_0xe2690b[_0x0f36('0x19')]?_[_0x0f36('0x1a')](_0xe2690b[_0x0f36('0x19')],function(_0x283d2e){return{'model':db[_0x283d2e['model']],'as':_0x283d2e['as'],'attributes':_0x283d2e[_0x0f36('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0f36('0x1c')](function(_0x5c2339){logger[_0x0f36('0xc')](_0x0f36('0x15'),_0x3b6956);logger[_0x0f36('0x1d')](_0x0f36('0x15'),_0x3b6956,JSON[_0x0f36('0x10')](_0x5c2339));_0x7e27c1(_0x5c2339);})[_0x0f36('0x14')](function(_0x42119d){logger[_0x0f36('0x11')]('GetZendeskAccount',_0x42119d[_0x0f36('0x12')],_0x3b6956);_0x4300d7(_0x44729b['error'](0x1f4,_0x42119d[_0x0f36('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x513a96){var _0x5231ee=this;return new Promise(function(_0x168233,_0x621886){return db[_0x0f36('0x1e')][_0x0f36('0x1f')]({'raw':_0x513a96[_0x0f36('0x16')]?_0x513a96[_0x0f36('0x16')][_0x0f36('0x17')]===undefined?!![]:![]:!![],'where':_0x513a96['options']?_0x513a96[_0x0f36('0x16')][_0x0f36('0x20')]||null:null,'attributes':_0x513a96[_0x0f36('0x16')]?_0x513a96['options']['attributes']||null:null,'include':_0x513a96[_0x0f36('0x16')]?_0x513a96[_0x0f36('0x16')][_0x0f36('0x19')]?_[_0x0f36('0x1a')](_0x513a96['options'][_0x0f36('0x19')],function(_0x21b9b9){return{'model':db[_0x21b9b9[_0x0f36('0x1b')]],'as':_0x21b9b9['as'],'attributes':_0x21b9b9[_0x0f36('0x18')],'include':_0x21b9b9[_0x0f36('0x19')]?_[_0x0f36('0x1a')](_0x21b9b9[_0x0f36('0x19')],function(_0x34adb9){return{'model':db[_0x34adb9['model']],'as':_0x34adb9['as'],'attributes':_0x34adb9[_0x0f36('0x18')],'include':_0x34adb9['include']?_[_0x0f36('0x1a')](_0x34adb9['include'],function(_0x26f558){return{'model':db[_0x26f558[_0x0f36('0x1b')]],'as':_0x26f558['as'],'attributes':_0x26f558[_0x0f36('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0f36('0x1c')](function(_0x496f99){logger[_0x0f36('0xc')](_0x0f36('0x21'),_0x513a96);logger[_0x0f36('0x1d')](_0x0f36('0x21'),_0x513a96,JSON[_0x0f36('0x10')](_0x496f99));_0x168233(_0x496f99);})[_0x0f36('0x14')](function(_0x28fd1d){logger[_0x0f36('0x11')](_0x0f36('0x21'),_0x28fd1d[_0x0f36('0x12')],_0x513a96);_0x621886(_0x5231ee[_0x0f36('0x11')](0x1f4,_0x28fd1d[_0x0f36('0x12')]));});});};
\ No newline at end of file
+var _0x8e89=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZendeskAccount','lodash','util','randomstring'];(function(_0x381dbb,_0x4a1419){var _0x301378=function(_0xd1993c){while(--_0xd1993c){_0x381dbb['push'](_0x381dbb['shift']());}};_0x301378(++_0x4a1419);}(_0x8e89,0x189));var _0x98e8=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x8e89[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x98e8('0x0'));var util=require(_0x98e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x98e8('0x2'));var fs=require('fs');var Redis=require(_0x98e8('0x3'));var db=require(_0x98e8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x98e8('0x5'))(_0x98e8('0x6'));var config=require(_0x98e8('0x7'));var jayson=require(_0x98e8('0x8'));var client=jayson[_0x98e8('0x9')][_0x98e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ddeb5,_0x3df450,_0x360245){return new BPromise(function(_0x4ca3b5,_0x4525a3){return client[_0x98e8('0xb')](_0x1ddeb5,_0x360245)[_0x98e8('0xc')](function(_0x86e89e){logger[_0x98e8('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x3df450,_0x98e8('0xe'));logger[_0x98e8('0xf')](_0x98e8('0x10'),_0x3df450,_0x98e8('0xe'),JSON[_0x98e8('0x11')](_0x86e89e));if(_0x86e89e[_0x98e8('0x12')]){if(_0x86e89e[_0x98e8('0x12')]['code']===0x1f4){logger[_0x98e8('0x12')](_0x98e8('0x13'),_0x3df450,_0x86e89e[_0x98e8('0x12')][_0x98e8('0x14')]);return _0x4525a3(_0x86e89e['error'][_0x98e8('0x14')]);}logger[_0x98e8('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x3df450,_0x86e89e[_0x98e8('0x12')][_0x98e8('0x14')]);return _0x4ca3b5(_0x86e89e[_0x98e8('0x12')][_0x98e8('0x14')]);}else{logger[_0x98e8('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x3df450,_0x98e8('0xe'));_0x4ca3b5(_0x86e89e[_0x98e8('0x15')][_0x98e8('0x14')]);}})[_0x98e8('0x16')](function(_0x5bb6a3){logger[_0x98e8('0x12')](_0x98e8('0x13'),_0x3df450,_0x5bb6a3);_0x4525a3(_0x5bb6a3);});});}exports[_0x98e8('0x17')]=function(_0x25f11e){var _0x137aa7=this;return new Promise(function(_0x5b5d5d,_0x2e06ba){return db[_0x98e8('0x18')][_0x98e8('0x19')]({'raw':_0x25f11e[_0x98e8('0x1a')]?_0x25f11e[_0x98e8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x25f11e['options']?_0x25f11e[_0x98e8('0x1a')][_0x98e8('0x1b')]||null:null,'attributes':_0x25f11e[_0x98e8('0x1a')]?_0x25f11e[_0x98e8('0x1a')][_0x98e8('0x1c')]||null:null,'limit':_0x25f11e[_0x98e8('0x1a')]?_0x25f11e[_0x98e8('0x1a')][_0x98e8('0x1d')]||null:null,'include':_0x25f11e[_0x98e8('0x1a')]?_0x25f11e['options'][_0x98e8('0x1e')]?_[_0x98e8('0x1f')](_0x25f11e[_0x98e8('0x1a')][_0x98e8('0x1e')],function(_0x429ac4){return{'model':db[_0x429ac4['model']],'as':_0x429ac4['as'],'attributes':_0x429ac4[_0x98e8('0x1c')],'include':_0x429ac4['include']?_[_0x98e8('0x1f')](_0x429ac4['include'],function(_0x4000e4){return{'model':db[_0x4000e4[_0x98e8('0x20')]],'as':_0x4000e4['as'],'attributes':_0x4000e4[_0x98e8('0x1c')],'include':_0x4000e4[_0x98e8('0x1e')]?_['map'](_0x4000e4[_0x98e8('0x1e')],function(_0x557a1e){return{'model':db[_0x557a1e[_0x98e8('0x20')]],'as':_0x557a1e['as'],'attributes':_0x557a1e[_0x98e8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x98e8('0xc')](function(_0x55b665){logger['info'](_0x98e8('0x17'),_0x25f11e);logger[_0x98e8('0xf')]('GetZendeskAccount',_0x25f11e,JSON[_0x98e8('0x11')](_0x55b665));_0x5b5d5d(_0x55b665);})[_0x98e8('0x16')](function(_0x56a696){logger[_0x98e8('0x12')]('GetZendeskAccount',_0x56a696['message'],_0x25f11e);_0x2e06ba(_0x137aa7[_0x98e8('0x12')](0x1f4,_0x56a696[_0x98e8('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x317f77){var _0xac16b0=this;return new Promise(function(_0x3af9ca,_0x1c0f05){return db['ZendeskAccount'][_0x98e8('0x21')]({'raw':_0x317f77[_0x98e8('0x1a')]?_0x317f77['options'][_0x98e8('0x22')]===undefined?!![]:![]:!![],'where':_0x317f77[_0x98e8('0x1a')]?_0x317f77[_0x98e8('0x1a')][_0x98e8('0x1b')]||null:null,'attributes':_0x317f77[_0x98e8('0x1a')]?_0x317f77[_0x98e8('0x1a')][_0x98e8('0x1c')]||null:null,'include':_0x317f77['options']?_0x317f77['options'][_0x98e8('0x1e')]?_[_0x98e8('0x1f')](_0x317f77[_0x98e8('0x1a')][_0x98e8('0x1e')],function(_0x4de29b){return{'model':db[_0x4de29b[_0x98e8('0x20')]],'as':_0x4de29b['as'],'attributes':_0x4de29b['attributes'],'include':_0x4de29b[_0x98e8('0x1e')]?_[_0x98e8('0x1f')](_0x4de29b[_0x98e8('0x1e')],function(_0x495e3d){return{'model':db[_0x495e3d['model']],'as':_0x495e3d['as'],'attributes':_0x495e3d[_0x98e8('0x1c')],'include':_0x495e3d[_0x98e8('0x1e')]?_[_0x98e8('0x1f')](_0x495e3d[_0x98e8('0x1e')],function(_0x1bd509){return{'model':db[_0x1bd509[_0x98e8('0x20')]],'as':_0x1bd509['as'],'attributes':_0x1bd509['attributes']};}):[]};}):[]};}):[]:[]})[_0x98e8('0xc')](function(_0x1c8d08){logger[_0x98e8('0xd')](_0x98e8('0x23'),_0x317f77);logger[_0x98e8('0xf')]('ShowZendeskAccount',_0x317f77,JSON[_0x98e8('0x11')](_0x1c8d08));_0x3af9ca(_0x1c8d08);})[_0x98e8('0x16')](function(_0x3a1588){logger[_0x98e8('0x12')](_0x98e8('0x23'),_0x3a1588[_0x98e8('0x14')],_0x317f77);_0x1c0f05(_0xac16b0[_0x98e8('0x12')](0x1f4,_0x3a1588[_0x98e8('0x14')]));});});};
\ No newline at end of file
index 0647367..4b6ff9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x63b4b3,_0x5e2fd2){var _0x4fea99=function(_0x2baf3e){while(--_0x2baf3e){_0x63b4b3['push'](_0x63b4b3['shift']());}};_0x4fea99(++_0x5e2fd2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router;
\ No newline at end of file
+var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x173e65,_0x24a8bf){var _0x37d496=function(_0x34b441){while(--_0x34b441){_0x173e65['push'](_0x173e65['shift']());}};_0x37d496(++_0x24a8bf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xcb91[_0x1694f5];return _0x5b4321;};'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')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router;
\ No newline at end of file
index a9c9e38..ed06e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa528=['STRING','exports'];(function(_0x34adf5,_0x3ca405){var _0xf43b60=function(_0x30d418){while(--_0x30d418){_0x34adf5['push'](_0x34adf5['shift']());}};_0xf43b60(++_0x3ca405);}(_0xa528,0x19f));var _0x8a52=function(_0x4a4c78,_0x13d5b7){_0x4a4c78=_0x4a4c78-0x0;var _0xd58f32=_0xa528[_0x4a4c78];return _0xd58f32;};'use strict';var Sequelize=require('sequelize');module[_0x8a52('0x0')]={'name':{'type':Sequelize[_0x8a52('0x1')]},'description':{'type':Sequelize[_0x8a52('0x1')]}};
\ No newline at end of file
+var _0x3b11=['exports','STRING','sequelize'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0x3b11,0x1dc));var _0x13b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b11[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x13b1('0x0'));module[_0x13b1('0x1')]={'name':{'type':Sequelize[_0x13b1('0x2')]},'description':{'type':Sequelize[_0x13b1('0x2')]}};
\ No newline at end of file
index 9ff13a3..758be3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aaa=['request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','sendStatus','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','filters','intersection','model','attributes','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','keys','length','merge','find','create','update','body','getFields','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch'];(function(_0x24a207,_0x3f99ad){var _0x4c6844=function(_0xee8e5c){while(--_0xee8e5c){_0x24a207['push'](_0x24a207['shift']());}};_0x4c6844(++_0x3f99ad);}(_0x6aaa,0x1a1));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6aa('0x0'));var zipdir=require(_0xa6aa('0x1'));var jsonpatch=require(_0xa6aa('0x2'));var rp=require(_0xa6aa('0x3'));var moment=require(_0xa6aa('0x4'));var BPromise=require(_0xa6aa('0x5'));var Mustache=require(_0xa6aa('0x6'));var util=require('util');var path=require(_0xa6aa('0x7'));var sox=require(_0xa6aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6aa('0x9'));var _=require('lodash');var squel=require(_0xa6aa('0xa'));var crypto=require('crypto');var jsforce=require(_0xa6aa('0xb'));var deskjs=require(_0xa6aa('0xc'));var toCsv=require(_0xa6aa('0xd'));var querystring=require('querystring');var Papa=require(_0xa6aa('0xe'));var Redis=require(_0xa6aa('0xf'));var authService=require(_0xa6aa('0x10'));var qs=require(_0xa6aa('0x11'));var as=require(_0xa6aa('0x12'));var hardwareService=require(_0xa6aa('0x13'));var logger=require(_0xa6aa('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa6aa('0x15'));var licenseUtil=require(_0xa6aa('0x16'));var db=require(_0xa6aa('0x17'))['db'];function respondWithStatusCode(_0x5b49a4,_0x313fb1){_0x313fb1=_0x313fb1||0xcc;return function(_0x45cf26){if(_0x45cf26){return _0x5b49a4['sendStatus'](_0x313fb1);}return _0x5b49a4[_0xa6aa('0x18')](_0x313fb1)[_0xa6aa('0x19')]();};}function respondWithResult(_0x3e3eb5,_0x5c5a54){_0x5c5a54=_0x5c5a54||0xc8;return function(_0x1587c8){if(_0x1587c8){return _0x3e3eb5['status'](_0x5c5a54)[_0xa6aa('0x1a')](_0x1587c8);}};}function respondWithFilteredResult(_0x52a4de,_0x3d5908){return function(_0x5e2127){if(_0x5e2127){var _0x212789=typeof _0x3d5908[_0xa6aa('0x1b')]===_0xa6aa('0x1c')&&typeof _0x3d5908[_0xa6aa('0x1d')]===_0xa6aa('0x1c');var _0x498ca0=_0x5e2127['count'];var _0x4af53c=_0x212789?0x0:_0x3d5908['offset'];var _0x3ec427=_0x212789?_0x5e2127[_0xa6aa('0x1e')]:_0x3d5908[_0xa6aa('0x1b')]+_0x3d5908[_0xa6aa('0x1d')];var _0x3a714b;if(_0x3ec427>=_0x498ca0){_0x3ec427=_0x498ca0;_0x3a714b=0xc8;}else{_0x3a714b=0xce;}_0x52a4de['status'](_0x3a714b);return _0x52a4de[_0xa6aa('0x1f')](_0xa6aa('0x20'),_0x4af53c+'-'+_0x3ec427+'/'+_0x498ca0)[_0xa6aa('0x1a')](_0x5e2127);}return null;};}function patchUpdates(_0x5cc682){return function(_0x318afa){try{jsonpatch['apply'](_0x318afa,_0x5cc682,!![]);}catch(_0x57eeba){return BPromise[_0xa6aa('0x21')](_0x57eeba);}return _0x318afa['save']();};}function saveUpdates(_0x1d951f,_0x5e3686){return function(_0x4c893c){if(_0x4c893c){return _0x4c893c['update'](_0x1d951f)['then'](function(_0x496f96){return _0x496f96;});}return null;};}function removeEntity(_0x3026d2,_0x47692f){return function(_0x30029b){if(_0x30029b){return _0x30029b[_0xa6aa('0x22')]()['then'](function(){_0x3026d2[_0xa6aa('0x18')](0xcc)[_0xa6aa('0x19')]();});}};}function handleEntityNotFound(_0xc5c84b,_0x56d299){return function(_0x316e4b){if(!_0x316e4b){_0xc5c84b[_0xa6aa('0x23')](0x194);}return _0x316e4b;};}function handleError(_0x34178e,_0x3e5f2c){_0x3e5f2c=_0x3e5f2c||0x1f4;return function(_0x19adc7){logger[_0xa6aa('0x24')](_0x19adc7['stack']);if(_0x19adc7[_0xa6aa('0x25')]){delete _0x19adc7[_0xa6aa('0x25')];}_0x34178e[_0xa6aa('0x18')](_0x3e5f2c)[_0xa6aa('0x26')](_0x19adc7);};}exports[_0xa6aa('0x27')]=function(_0x2718ed,_0x40443f){var _0x1c60c0={},_0x456e80={},_0x1cc1da={'count':0x0,'rows':[]};var _0x50e885=_[_0xa6aa('0x28')](db[_0xa6aa('0x29')][_0xa6aa('0x2a')],function(_0x5b2eda){return{'name':_0x5b2eda[_0xa6aa('0x2b')],'type':_0x5b2eda[_0xa6aa('0x2c')][_0xa6aa('0x2d')]};});_0x456e80['model']=_['map'](_0x50e885,_0xa6aa('0x25'));_0x456e80['query']=_['keys'](_0x2718ed['query']);_0x456e80[_0xa6aa('0x2e')]=_[_0xa6aa('0x2f')](_0x456e80[_0xa6aa('0x30')],_0x456e80['query']);_0x1c60c0[_0xa6aa('0x31')]=_[_0xa6aa('0x2f')](_0x456e80[_0xa6aa('0x30')],qs['fields'](_0x2718ed[_0xa6aa('0x32')][_0xa6aa('0x33')]));_0x1c60c0[_0xa6aa('0x31')]=_0x1c60c0[_0xa6aa('0x31')]['length']?_0x1c60c0[_0xa6aa('0x31')]:_0x456e80[_0xa6aa('0x30')];if(!_0x2718ed[_0xa6aa('0x32')][_0xa6aa('0x34')](_0xa6aa('0x35'))){_0x1c60c0['limit']=qs[_0xa6aa('0x1d')](_0x2718ed['query'][_0xa6aa('0x1d')]);_0x1c60c0[_0xa6aa('0x1b')]=qs[_0xa6aa('0x1b')](_0x2718ed[_0xa6aa('0x32')][_0xa6aa('0x1b')]);}_0x1c60c0[_0xa6aa('0x36')]=qs['sort'](_0x2718ed['query'][_0xa6aa('0x37')]);_0x1c60c0[_0xa6aa('0x38')]=qs[_0xa6aa('0x2e')](_[_0xa6aa('0x39')](_0x2718ed[_0xa6aa('0x32')],_0x456e80[_0xa6aa('0x2e')]),_0x50e885);if(_0x2718ed[_0xa6aa('0x32')][_0xa6aa('0x3a')]){_0x1c60c0['where']=_['merge'](_0x1c60c0['where'],{'$or':_[_0xa6aa('0x28')](_0x50e885,function(_0xe2482d){if(_0xe2482d[_0xa6aa('0x2c')]!==_0xa6aa('0x3b')){var _0x573226={};_0x573226[_0xe2482d[_0xa6aa('0x25')]]={'$like':'%'+_0x2718ed[_0xa6aa('0x32')][_0xa6aa('0x3a')]+'%'};return _0x573226;}})});}_0x1c60c0=_['merge']({},_0x1c60c0,_0x2718ed[_0xa6aa('0x3c')]);var _0x46a5e6={'where':_0x1c60c0[_0xa6aa('0x38')]};return db[_0xa6aa('0x29')]['count'](_0x46a5e6)['then'](function(_0x15788a){_0x1cc1da[_0xa6aa('0x1e')]=_0x15788a;if(_0x2718ed['query'][_0xa6aa('0x3d')]){_0x1c60c0[_0xa6aa('0x3e')]=[{'all':!![]}];}return db[_0xa6aa('0x29')][_0xa6aa('0x3f')](_0x1c60c0);})[_0xa6aa('0x40')](function(_0x1f8829){_0x1cc1da[_0xa6aa('0x41')]=_0x1f8829;return _0x1cc1da;})[_0xa6aa('0x40')](respondWithFilteredResult(_0x40443f,_0x1c60c0))[_0xa6aa('0x42')](handleError(_0x40443f,null));};exports[_0xa6aa('0x43')]=function(_0x5bc02a,_0x332c39){var _0x5e1638={'raw':![],'where':{'id':_0x5bc02a[_0xa6aa('0x44')]['id']}},_0x3e6313={};_0x3e6313['model']=_['keys'](db[_0xa6aa('0x29')]['rawAttributes']);_0x3e6313[_0xa6aa('0x32')]=_[_0xa6aa('0x45')](_0x5bc02a['query']);_0x3e6313[_0xa6aa('0x2e')]=_['intersection'](_0x3e6313[_0xa6aa('0x30')],_0x3e6313[_0xa6aa('0x32')]);_0x5e1638['attributes']=_[_0xa6aa('0x2f')](_0x3e6313[_0xa6aa('0x30')],qs[_0xa6aa('0x33')](_0x5bc02a[_0xa6aa('0x32')][_0xa6aa('0x33')]));_0x5e1638[_0xa6aa('0x31')]=_0x5e1638[_0xa6aa('0x31')][_0xa6aa('0x46')]?_0x5e1638[_0xa6aa('0x31')]:_0x3e6313['model'];if(_0x5bc02a[_0xa6aa('0x32')][_0xa6aa('0x3d')]){_0x5e1638[_0xa6aa('0x3e')]=[{'all':!![]}];}_0x5e1638=_[_0xa6aa('0x47')]({},_0x5e1638,_0x5bc02a['options']);return db[_0xa6aa('0x29')][_0xa6aa('0x48')](_0x5e1638)[_0xa6aa('0x40')](handleEntityNotFound(_0x332c39,null))[_0xa6aa('0x40')](respondWithResult(_0x332c39,null))[_0xa6aa('0x42')](handleError(_0x332c39,null));};exports[_0xa6aa('0x49')]=function(_0x11f581,_0x3b9c53){return db[_0xa6aa('0x29')][_0xa6aa('0x49')](_0x11f581['body'],{})['then'](respondWithResult(_0x3b9c53,0xc9))[_0xa6aa('0x42')](handleError(_0x3b9c53,null));};exports[_0xa6aa('0x4a')]=function(_0x256320,_0x3ee29e){if(_0x256320['body']['id']){delete _0x256320[_0xa6aa('0x4b')]['id'];}return db['ZendeskConfiguration'][_0xa6aa('0x48')]({'where':{'id':_0x256320[_0xa6aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ee29e,null))[_0xa6aa('0x40')](saveUpdates(_0x256320[_0xa6aa('0x4b')],null))[_0xa6aa('0x40')](respondWithResult(_0x3ee29e,null))[_0xa6aa('0x42')](handleError(_0x3ee29e,null));};exports[_0xa6aa('0x22')]=function(_0xcd600a,_0x151a24){return db[_0xa6aa('0x29')][_0xa6aa('0x48')]({'where':{'id':_0xcd600a[_0xa6aa('0x44')]['id']}})[_0xa6aa('0x40')](handleEntityNotFound(_0x151a24,null))[_0xa6aa('0x40')](removeEntity(_0x151a24,null))[_0xa6aa('0x42')](handleError(_0x151a24,null));};exports['getFields']=function(_0x386cb3,_0x595b38,_0x4a32de){var _0x4fbc72={};var _0x5e7ef0={};var _0x24199f;var _0x285170;return db[_0xa6aa('0x29')]['findOne']({'where':{'id':_0x386cb3[_0xa6aa('0x44')]['id']}})[_0xa6aa('0x40')](handleEntityNotFound(_0x595b38,null))[_0xa6aa('0x40')](function(_0x3d854e){if(_0x3d854e){_0x24199f=_0x3d854e;_0x5e7ef0[_0xa6aa('0x30')]=_[_0xa6aa('0x45')](db['ZendeskField'][_0xa6aa('0x2a')]);_0x5e7ef0[_0xa6aa('0x32')]=_[_0xa6aa('0x45')](_0x386cb3[_0xa6aa('0x32')]);_0x5e7ef0[_0xa6aa('0x2e')]=_[_0xa6aa('0x2f')](_0x5e7ef0[_0xa6aa('0x30')],_0x5e7ef0[_0xa6aa('0x32')]);_0x4fbc72['attributes']=_[_0xa6aa('0x2f')](_0x5e7ef0[_0xa6aa('0x30')],qs['fields'](_0x386cb3[_0xa6aa('0x32')]['fields']));_0x4fbc72[_0xa6aa('0x31')]=_0x4fbc72[_0xa6aa('0x31')][_0xa6aa('0x46')]?_0x4fbc72[_0xa6aa('0x31')]:_0x5e7ef0[_0xa6aa('0x30')];_0x4fbc72['order']=qs[_0xa6aa('0x37')](_0x386cb3[_0xa6aa('0x32')][_0xa6aa('0x37')]);_0x4fbc72[_0xa6aa('0x38')]=qs[_0xa6aa('0x2e')](_[_0xa6aa('0x39')](_0x386cb3['query'],_0x5e7ef0['filters']));if(_0x386cb3[_0xa6aa('0x32')][_0xa6aa('0x3a')]){_0x4fbc72['where']=_[_0xa6aa('0x47')](_0x4fbc72[_0xa6aa('0x38')],{'$or':_[_0xa6aa('0x28')](_0x4fbc72[_0xa6aa('0x31')],function(_0x2c7dd4){var _0x5c1629={};_0x5c1629[_0x2c7dd4]={'$like':'%'+_0x386cb3[_0xa6aa('0x32')][_0xa6aa('0x3a')]+'%'};return _0x5c1629;})});}_0x4fbc72=_['merge']({},_0x4fbc72,_0x386cb3['options']);return _0x24199f[_0xa6aa('0x4c')](_0x4fbc72);}})[_0xa6aa('0x40')](function(_0x19feb7){if(_0x19feb7){_0x285170=_0x19feb7[_0xa6aa('0x46')];if(!_0x386cb3[_0xa6aa('0x32')][_0xa6aa('0x34')](_0xa6aa('0x35'))){_0x4fbc72[_0xa6aa('0x1d')]=qs['limit'](_0x386cb3['query'][_0xa6aa('0x1d')]);_0x4fbc72[_0xa6aa('0x1b')]=qs[_0xa6aa('0x1b')](_0x386cb3['query'][_0xa6aa('0x1b')]);}return _0x24199f[_0xa6aa('0x4c')](_0x4fbc72);}})[_0xa6aa('0x40')](function(_0x4538e2){if(_0x4538e2){return _0x4538e2?{'count':_0x285170,'rows':_0x4538e2}:null;}})[_0xa6aa('0x40')](respondWithResult(_0x595b38,null))[_0xa6aa('0x42')](handleError(_0x595b38,null));};exports[_0xa6aa('0x4d')]=function(_0x2a8394,_0x480156,_0x377153){var _0x201a20={};var _0x277c70={};var _0x4c1303;var _0x3011cc;return db[_0xa6aa('0x29')]['findOne']({'where':{'id':_0x2a8394['params']['id']}})[_0xa6aa('0x40')](handleEntityNotFound(_0x480156,null))[_0xa6aa('0x40')](function(_0x3dd153){if(_0x3dd153){_0x4c1303=_0x3dd153;_0x277c70[_0xa6aa('0x30')]=_[_0xa6aa('0x45')](db['ZendeskField'][_0xa6aa('0x2a')]);_0x277c70[_0xa6aa('0x32')]=_[_0xa6aa('0x45')](_0x2a8394[_0xa6aa('0x32')]);_0x277c70[_0xa6aa('0x2e')]=_[_0xa6aa('0x2f')](_0x277c70[_0xa6aa('0x30')],_0x277c70['query']);_0x201a20[_0xa6aa('0x31')]=_[_0xa6aa('0x2f')](_0x277c70[_0xa6aa('0x30')],qs['fields'](_0x2a8394['query'][_0xa6aa('0x33')]));_0x201a20[_0xa6aa('0x31')]=_0x201a20['attributes']['length']?_0x201a20[_0xa6aa('0x31')]:_0x277c70['model'];_0x201a20[_0xa6aa('0x36')]=qs[_0xa6aa('0x37')](_0x2a8394[_0xa6aa('0x32')][_0xa6aa('0x37')]);_0x201a20[_0xa6aa('0x38')]=qs[_0xa6aa('0x2e')](_[_0xa6aa('0x39')](_0x2a8394[_0xa6aa('0x32')],_0x277c70['filters']));if(_0x2a8394['query']['filter']){_0x201a20[_0xa6aa('0x38')]=_[_0xa6aa('0x47')](_0x201a20[_0xa6aa('0x38')],{'$or':_['map'](_0x201a20[_0xa6aa('0x31')],function(_0x3a6991){var _0x175883={};_0x175883[_0x3a6991]={'$like':'%'+_0x2a8394['query'][_0xa6aa('0x3a')]+'%'};return _0x175883;})});}_0x201a20=_[_0xa6aa('0x47')]({},_0x201a20,_0x2a8394[_0xa6aa('0x3c')]);return _0x4c1303[_0xa6aa('0x4d')](_0x201a20);}})[_0xa6aa('0x40')](function(_0x309b8e){if(_0x309b8e){_0x3011cc=_0x309b8e[_0xa6aa('0x46')];if(!_0x2a8394[_0xa6aa('0x32')][_0xa6aa('0x34')](_0xa6aa('0x35'))){_0x201a20[_0xa6aa('0x1d')]=qs[_0xa6aa('0x1d')](_0x2a8394['query'][_0xa6aa('0x1d')]);_0x201a20[_0xa6aa('0x1b')]=qs[_0xa6aa('0x1b')](_0x2a8394[_0xa6aa('0x32')]['offset']);}return _0x4c1303[_0xa6aa('0x4d')](_0x201a20);}})[_0xa6aa('0x40')](function(_0x3ba3f9){if(_0x3ba3f9){return _0x3ba3f9?{'count':_0x3011cc,'rows':_0x3ba3f9}:null;}})[_0xa6aa('0x40')](respondWithResult(_0x480156,null))[_0xa6aa('0x42')](handleError(_0x480156,null));};exports[_0xa6aa('0x4e')]=function(_0x18d368,_0x20a61e,_0x52110b){var _0xe91ac={};var _0x105f01={};var _0x5c4544;var _0x49f564;return db[_0xa6aa('0x29')][_0xa6aa('0x4f')]({'where':{'id':_0x18d368[_0xa6aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x20a61e,null))[_0xa6aa('0x40')](function(_0x1f08e7){if(_0x1f08e7){_0x5c4544=_0x1f08e7;_0x105f01[_0xa6aa('0x30')]=_[_0xa6aa('0x45')](db['ZendeskField'][_0xa6aa('0x2a')]);_0x105f01[_0xa6aa('0x32')]=_[_0xa6aa('0x45')](_0x18d368[_0xa6aa('0x32')]);_0x105f01[_0xa6aa('0x2e')]=_[_0xa6aa('0x2f')](_0x105f01[_0xa6aa('0x30')],_0x105f01[_0xa6aa('0x32')]);_0xe91ac[_0xa6aa('0x31')]=_[_0xa6aa('0x2f')](_0x105f01[_0xa6aa('0x30')],qs[_0xa6aa('0x33')](_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x33')]));_0xe91ac['attributes']=_0xe91ac[_0xa6aa('0x31')]['length']?_0xe91ac[_0xa6aa('0x31')]:_0x105f01[_0xa6aa('0x30')];_0xe91ac[_0xa6aa('0x36')]=qs[_0xa6aa('0x37')](_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x37')]);_0xe91ac[_0xa6aa('0x38')]=qs[_0xa6aa('0x2e')](_['pick'](_0x18d368[_0xa6aa('0x32')],_0x105f01[_0xa6aa('0x2e')]));if(_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x3a')]){_0xe91ac['where']=_[_0xa6aa('0x47')](_0xe91ac['where'],{'$or':_[_0xa6aa('0x28')](_0xe91ac[_0xa6aa('0x31')],function(_0x261d07){var _0x141087={};_0x141087[_0x261d07]={'$like':'%'+_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x3a')]+'%'};return _0x141087;})});}_0xe91ac=_[_0xa6aa('0x47')]({},_0xe91ac,_0x18d368['options']);return _0x5c4544['getDescriptions'](_0xe91ac);}})['then'](function(_0x5c5270){if(_0x5c5270){_0x49f564=_0x5c5270[_0xa6aa('0x46')];if(!_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x34')]('nolimit')){_0xe91ac['limit']=qs[_0xa6aa('0x1d')](_0x18d368[_0xa6aa('0x32')][_0xa6aa('0x1d')]);_0xe91ac['offset']=qs[_0xa6aa('0x1b')](_0x18d368['query'][_0xa6aa('0x1b')]);}return _0x5c4544[_0xa6aa('0x4e')](_0xe91ac);}})[_0xa6aa('0x40')](function(_0x1eabd9){if(_0x1eabd9){return _0x1eabd9?{'count':_0x49f564,'rows':_0x1eabd9}:null;}})['then'](respondWithResult(_0x20a61e,null))[_0xa6aa('0x42')](handleError(_0x20a61e,null));};exports[_0xa6aa('0x50')]=function(_0x40130a,_0x4f181d,_0x442b87){var _0x1a5d3f={};var _0xb162de={};var _0x231efe;var _0x2e30a1;return db[_0xa6aa('0x29')][_0xa6aa('0x4f')]({'where':{'id':_0x40130a['params']['id']}})[_0xa6aa('0x40')](handleEntityNotFound(_0x4f181d,null))[_0xa6aa('0x40')](function(_0x57b301){if(_0x57b301){_0x231efe=_0x57b301;_0xb162de[_0xa6aa('0x30')]=_[_0xa6aa('0x45')](db[_0xa6aa('0x51')][_0xa6aa('0x2a')]);_0xb162de[_0xa6aa('0x32')]=_[_0xa6aa('0x45')](_0x40130a[_0xa6aa('0x32')]);_0xb162de['filters']=_[_0xa6aa('0x2f')](_0xb162de['model'],_0xb162de['query']);_0x1a5d3f[_0xa6aa('0x31')]=_[_0xa6aa('0x2f')](_0xb162de[_0xa6aa('0x30')],qs[_0xa6aa('0x33')](_0x40130a[_0xa6aa('0x32')][_0xa6aa('0x33')]));_0x1a5d3f['attributes']=_0x1a5d3f['attributes'][_0xa6aa('0x46')]?_0x1a5d3f[_0xa6aa('0x31')]:_0xb162de[_0xa6aa('0x30')];_0x1a5d3f[_0xa6aa('0x36')]=qs['sort'](_0x40130a[_0xa6aa('0x32')][_0xa6aa('0x37')]);_0x1a5d3f['where']=qs[_0xa6aa('0x2e')](_['pick'](_0x40130a[_0xa6aa('0x32')],_0xb162de[_0xa6aa('0x2e')]));if(_0x40130a[_0xa6aa('0x32')][_0xa6aa('0x3a')]){_0x1a5d3f[_0xa6aa('0x38')]=_[_0xa6aa('0x47')](_0x1a5d3f['where'],{'$or':_[_0xa6aa('0x28')](_0x1a5d3f[_0xa6aa('0x31')],function(_0x45a545){var _0x34de2f={};_0x34de2f[_0x45a545]={'$like':'%'+_0x40130a['query'][_0xa6aa('0x3a')]+'%'};return _0x34de2f;})});}_0x1a5d3f=_['merge']({},_0x1a5d3f,_0x40130a['options']);return _0x231efe[_0xa6aa('0x50')](_0x1a5d3f);}})[_0xa6aa('0x40')](function(_0x214daa){if(_0x214daa){_0x2e30a1=_0x214daa[_0xa6aa('0x46')];if(!_0x40130a['query']['hasOwnProperty']('nolimit')){_0x1a5d3f['limit']=qs[_0xa6aa('0x1d')](_0x40130a[_0xa6aa('0x32')]['limit']);_0x1a5d3f[_0xa6aa('0x1b')]=qs[_0xa6aa('0x1b')](_0x40130a[_0xa6aa('0x32')][_0xa6aa('0x1b')]);}return _0x231efe[_0xa6aa('0x50')](_0x1a5d3f);}})['then'](function(_0x37e3c5){if(_0x37e3c5){return _0x37e3c5?{'count':_0x2e30a1,'rows':_0x37e3c5}:null;}})[_0xa6aa('0x40')](respondWithResult(_0x4f181d,null))[_0xa6aa('0x42')](handleError(_0x4f181d,null));};exports['setTags']=function(_0x5a9e21,_0x48c29b,_0x4fe940){if(_0x5a9e21[_0xa6aa('0x4b')]['id']){delete _0x5a9e21[_0xa6aa('0x4b')]['id'];}return db[_0xa6aa('0x29')]['findOne']({'where':{'id':_0x5a9e21[_0xa6aa('0x44')]['id']}})[_0xa6aa('0x40')](handleEntityNotFound(_0x48c29b,null))[_0xa6aa('0x40')](function(_0x605a1){if(_0x605a1){return _0x605a1[_0xa6aa('0x52')](_0x5a9e21[_0xa6aa('0x4b')][_0xa6aa('0x53')]||[]);}return null;})[_0xa6aa('0x40')](respondWithResult(_0x48c29b,null))[_0xa6aa('0x42')](handleError(_0x48c29b,null));};
\ No newline at end of file
+var _0x8ff6=['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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','ZendeskConfiguration','findAll','rows','catch','show','find','create','body','params','destroy','getFields','ZendeskField','rawAttributes','fields','options','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ff6,0xa7));var _0x68ff=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x8ff6[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0x68ff('0x0'));var rimraf=require(_0x68ff('0x1'));var zipdir=require(_0x68ff('0x2'));var jsonpatch=require(_0x68ff('0x3'));var rp=require('request-promise');var moment=require(_0x68ff('0x4'));var BPromise=require(_0x68ff('0x5'));var Mustache=require('mustache');var util=require(_0x68ff('0x6'));var path=require(_0x68ff('0x7'));var sox=require('sox');var csv=require(_0x68ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ff('0x9'));var squel=require(_0x68ff('0xa'));var crypto=require(_0x68ff('0xb'));var jsforce=require(_0x68ff('0xc'));var deskjs=require(_0x68ff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x68ff('0xe'));var Papa=require(_0x68ff('0xf'));var Redis=require(_0x68ff('0x10'));var authService=require(_0x68ff('0x11'));var qs=require(_0x68ff('0x12'));var as=require(_0x68ff('0x13'));var hardwareService=require(_0x68ff('0x14'));var logger=require('../../config/logger')(_0x68ff('0x15'));var utils=require(_0x68ff('0x16'));var config=require(_0x68ff('0x17'));var licenseUtil=require(_0x68ff('0x18'));var db=require(_0x68ff('0x19'))['db'];function respondWithStatusCode(_0x4fd708,_0xe38388){_0xe38388=_0xe38388||0xcc;return function(_0x2f5a01){if(_0x2f5a01){return _0x4fd708[_0x68ff('0x1a')](_0xe38388);}return _0x4fd708[_0x68ff('0x1b')](_0xe38388)[_0x68ff('0x1c')]();};}function respondWithResult(_0x25f10e,_0x5217b7){_0x5217b7=_0x5217b7||0xc8;return function(_0xd222ee){if(_0xd222ee){return _0x25f10e[_0x68ff('0x1b')](_0x5217b7)[_0x68ff('0x1d')](_0xd222ee);}};}function respondWithFilteredResult(_0x51e79f,_0x11fc6a){return function(_0x31b3b0){if(_0x31b3b0){var _0x31ecd7=typeof _0x11fc6a['offset']===_0x68ff('0x1e')&&typeof _0x11fc6a[_0x68ff('0x1f')]==='undefined';var _0x513142=_0x31b3b0['count'];var _0x368cbf=_0x31ecd7?0x0:_0x11fc6a[_0x68ff('0x20')];var _0x42a81e=_0x31ecd7?_0x31b3b0[_0x68ff('0x21')]:_0x11fc6a[_0x68ff('0x20')]+_0x11fc6a[_0x68ff('0x1f')];var _0x7d0180;if(_0x42a81e>=_0x513142){_0x42a81e=_0x513142;_0x7d0180=0xc8;}else{_0x7d0180=0xce;}_0x51e79f[_0x68ff('0x1b')](_0x7d0180);return _0x51e79f[_0x68ff('0x22')](_0x68ff('0x23'),_0x368cbf+'-'+_0x42a81e+'/'+_0x513142)[_0x68ff('0x1d')](_0x31b3b0);}return null;};}function patchUpdates(_0x2d5d54){return function(_0x40e09f){try{jsonpatch[_0x68ff('0x24')](_0x40e09f,_0x2d5d54,!![]);}catch(_0x3f9a64){return BPromise[_0x68ff('0x25')](_0x3f9a64);}return _0x40e09f[_0x68ff('0x26')]();};}function saveUpdates(_0x4f94b0,_0x4b19d6){return function(_0x581e4c){if(_0x581e4c){return _0x581e4c[_0x68ff('0x27')](_0x4f94b0)[_0x68ff('0x28')](function(_0x52f902){return _0x52f902;});}return null;};}function removeEntity(_0x31dc41,_0x374ba3){return function(_0x1a4537){if(_0x1a4537){return _0x1a4537['destroy']()[_0x68ff('0x28')](function(){_0x31dc41['status'](0xcc)[_0x68ff('0x1c')]();});}};}function handleEntityNotFound(_0x5c709,_0x154e70){return function(_0x5eccea){if(!_0x5eccea){_0x5c709[_0x68ff('0x1a')](0x194);}return _0x5eccea;};}function handleError(_0x1cb16e,_0x41a885){_0x41a885=_0x41a885||0x1f4;return function(_0x3b699f){logger[_0x68ff('0x29')](_0x3b699f[_0x68ff('0x2a')]);if(_0x3b699f[_0x68ff('0x2b')]){delete _0x3b699f[_0x68ff('0x2b')];}_0x1cb16e[_0x68ff('0x1b')](_0x41a885)[_0x68ff('0x2c')](_0x3b699f);};}exports[_0x68ff('0x2d')]=function(_0x5232da,_0x204161){var _0x195202={},_0x3b8b43={},_0x20eace={'count':0x0,'rows':[]};var _0x4fd28a=_[_0x68ff('0x2e')](db['ZendeskConfiguration']['rawAttributes'],function(_0x5c3d89){return{'name':_0x5c3d89[_0x68ff('0x2f')],'type':_0x5c3d89[_0x68ff('0x30')][_0x68ff('0x31')]};});_0x3b8b43['model']=_[_0x68ff('0x2e')](_0x4fd28a,'name');_0x3b8b43[_0x68ff('0x32')]=_[_0x68ff('0x33')](_0x5232da['query']);_0x3b8b43[_0x68ff('0x34')]=_[_0x68ff('0x35')](_0x3b8b43[_0x68ff('0x36')],_0x3b8b43[_0x68ff('0x32')]);_0x195202[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x3b8b43[_0x68ff('0x36')],qs['fields'](_0x5232da[_0x68ff('0x32')]['fields']));_0x195202[_0x68ff('0x37')]=_0x195202['attributes'][_0x68ff('0x38')]?_0x195202[_0x68ff('0x37')]:_0x3b8b43[_0x68ff('0x36')];if(!_0x5232da[_0x68ff('0x32')]['hasOwnProperty'](_0x68ff('0x39'))){_0x195202[_0x68ff('0x1f')]=qs[_0x68ff('0x1f')](_0x5232da[_0x68ff('0x32')]['limit']);_0x195202[_0x68ff('0x20')]=qs[_0x68ff('0x20')](_0x5232da[_0x68ff('0x32')][_0x68ff('0x20')]);}_0x195202[_0x68ff('0x3a')]=qs[_0x68ff('0x3b')](_0x5232da[_0x68ff('0x32')][_0x68ff('0x3b')]);_0x195202[_0x68ff('0x3c')]=qs[_0x68ff('0x34')](_[_0x68ff('0x3d')](_0x5232da[_0x68ff('0x32')],_0x3b8b43['filters']),_0x4fd28a);if(_0x5232da['query'][_0x68ff('0x3e')]){_0x195202[_0x68ff('0x3c')]=_[_0x68ff('0x3f')](_0x195202[_0x68ff('0x3c')],{'$or':_['map'](_0x4fd28a,function(_0x749e95){if(_0x749e95[_0x68ff('0x30')]!==_0x68ff('0x40')){var _0x3e12a8={};_0x3e12a8[_0x749e95['name']]={'$like':'%'+_0x5232da[_0x68ff('0x32')][_0x68ff('0x3e')]+'%'};return _0x3e12a8;}})});}_0x195202=_[_0x68ff('0x3f')]({},_0x195202,_0x5232da['options']);var _0x6a8bd5={'where':_0x195202['where']};return db['ZendeskConfiguration'][_0x68ff('0x21')](_0x6a8bd5)[_0x68ff('0x28')](function(_0x2a65c9){_0x20eace[_0x68ff('0x21')]=_0x2a65c9;if(_0x5232da[_0x68ff('0x32')]['includeAll']){_0x195202[_0x68ff('0x41')]=[{'all':!![]}];}return db[_0x68ff('0x42')][_0x68ff('0x43')](_0x195202);})[_0x68ff('0x28')](function(_0x282995){_0x20eace[_0x68ff('0x44')]=_0x282995;return _0x20eace;})[_0x68ff('0x28')](respondWithFilteredResult(_0x204161,_0x195202))[_0x68ff('0x45')](handleError(_0x204161,null));};exports[_0x68ff('0x46')]=function(_0x3ab20a,_0x221d4a){var _0x337453={'raw':![],'where':{'id':_0x3ab20a['params']['id']}},_0x14ad24={};_0x14ad24[_0x68ff('0x36')]=_[_0x68ff('0x33')](db['ZendeskConfiguration']['rawAttributes']);_0x14ad24[_0x68ff('0x32')]=_['keys'](_0x3ab20a[_0x68ff('0x32')]);_0x14ad24[_0x68ff('0x34')]=_[_0x68ff('0x35')](_0x14ad24[_0x68ff('0x36')],_0x14ad24[_0x68ff('0x32')]);_0x337453[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x14ad24['model'],qs['fields'](_0x3ab20a['query']['fields']));_0x337453[_0x68ff('0x37')]=_0x337453['attributes']['length']?_0x337453['attributes']:_0x14ad24[_0x68ff('0x36')];if(_0x3ab20a['query']['includeAll']){_0x337453['include']=[{'all':!![]}];}_0x337453=_[_0x68ff('0x3f')]({},_0x337453,_0x3ab20a['options']);return db[_0x68ff('0x42')][_0x68ff('0x47')](_0x337453)['then'](handleEntityNotFound(_0x221d4a,null))['then'](respondWithResult(_0x221d4a,null))[_0x68ff('0x45')](handleError(_0x221d4a,null));};exports[_0x68ff('0x48')]=function(_0x3e4ce9,_0x27e750){return db[_0x68ff('0x42')][_0x68ff('0x48')](_0x3e4ce9[_0x68ff('0x49')],{})[_0x68ff('0x28')](respondWithResult(_0x27e750,0xc9))['catch'](handleError(_0x27e750,null));};exports['update']=function(_0x5ebb48,_0x3ca1fb){if(_0x5ebb48[_0x68ff('0x49')]['id']){delete _0x5ebb48[_0x68ff('0x49')]['id'];}return db[_0x68ff('0x42')][_0x68ff('0x47')]({'where':{'id':_0x5ebb48[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0x3ca1fb,null))['then'](saveUpdates(_0x5ebb48['body'],null))[_0x68ff('0x28')](respondWithResult(_0x3ca1fb,null))['catch'](handleError(_0x3ca1fb,null));};exports[_0x68ff('0x4b')]=function(_0x2d915e,_0xfeb0e8){return db['ZendeskConfiguration'][_0x68ff('0x47')]({'where':{'id':_0x2d915e[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0xfeb0e8,null))[_0x68ff('0x28')](removeEntity(_0xfeb0e8,null))['catch'](handleError(_0xfeb0e8,null));};exports[_0x68ff('0x4c')]=function(_0x359f8a,_0xba528f,_0x347044){var _0x531584={};var _0x2c1eff={};var _0x4a9859;var _0x2a4069;return db[_0x68ff('0x42')]['findOne']({'where':{'id':_0x359f8a[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0xba528f,null))[_0x68ff('0x28')](function(_0x5056ba){if(_0x5056ba){_0x4a9859=_0x5056ba;_0x2c1eff['model']=_[_0x68ff('0x33')](db[_0x68ff('0x4d')][_0x68ff('0x4e')]);_0x2c1eff[_0x68ff('0x32')]=_[_0x68ff('0x33')](_0x359f8a[_0x68ff('0x32')]);_0x2c1eff[_0x68ff('0x34')]=_['intersection'](_0x2c1eff[_0x68ff('0x36')],_0x2c1eff[_0x68ff('0x32')]);_0x531584[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x2c1eff[_0x68ff('0x36')],qs[_0x68ff('0x4f')](_0x359f8a[_0x68ff('0x32')][_0x68ff('0x4f')]));_0x531584[_0x68ff('0x37')]=_0x531584[_0x68ff('0x37')][_0x68ff('0x38')]?_0x531584[_0x68ff('0x37')]:_0x2c1eff[_0x68ff('0x36')];_0x531584[_0x68ff('0x3a')]=qs[_0x68ff('0x3b')](_0x359f8a['query'][_0x68ff('0x3b')]);_0x531584['where']=qs[_0x68ff('0x34')](_['pick'](_0x359f8a[_0x68ff('0x32')],_0x2c1eff[_0x68ff('0x34')]));if(_0x359f8a[_0x68ff('0x32')][_0x68ff('0x3e')]){_0x531584[_0x68ff('0x3c')]=_[_0x68ff('0x3f')](_0x531584[_0x68ff('0x3c')],{'$or':_[_0x68ff('0x2e')](_0x531584[_0x68ff('0x37')],function(_0x1f43aa){var _0xebef7={};_0xebef7[_0x1f43aa]={'$like':'%'+_0x359f8a[_0x68ff('0x32')][_0x68ff('0x3e')]+'%'};return _0xebef7;})});}_0x531584=_['merge']({},_0x531584,_0x359f8a[_0x68ff('0x50')]);return _0x4a9859['getFields'](_0x531584);}})[_0x68ff('0x28')](function(_0x4461af){if(_0x4461af){_0x2a4069=_0x4461af['length'];if(!_0x359f8a[_0x68ff('0x32')][_0x68ff('0x51')]('nolimit')){_0x531584['limit']=qs[_0x68ff('0x1f')](_0x359f8a[_0x68ff('0x32')][_0x68ff('0x1f')]);_0x531584[_0x68ff('0x20')]=qs[_0x68ff('0x20')](_0x359f8a[_0x68ff('0x32')][_0x68ff('0x20')]);}return _0x4a9859['getFields'](_0x531584);}})[_0x68ff('0x28')](function(_0x4d6e3d){if(_0x4d6e3d){return _0x4d6e3d?{'count':_0x2a4069,'rows':_0x4d6e3d}:null;}})[_0x68ff('0x28')](respondWithResult(_0xba528f,null))[_0x68ff('0x45')](handleError(_0xba528f,null));};exports[_0x68ff('0x52')]=function(_0x4f2b83,_0x4eab98,_0x293589){var _0x5742de={};var _0x178bc8={};var _0x3c1844;var _0xa30207;return db[_0x68ff('0x42')][_0x68ff('0x53')]({'where':{'id':_0x4f2b83[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0x4eab98,null))[_0x68ff('0x28')](function(_0x303925){if(_0x303925){_0x3c1844=_0x303925;_0x178bc8['model']=_['keys'](db[_0x68ff('0x4d')][_0x68ff('0x4e')]);_0x178bc8[_0x68ff('0x32')]=_['keys'](_0x4f2b83['query']);_0x178bc8[_0x68ff('0x34')]=_[_0x68ff('0x35')](_0x178bc8[_0x68ff('0x36')],_0x178bc8[_0x68ff('0x32')]);_0x5742de[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x178bc8[_0x68ff('0x36')],qs[_0x68ff('0x4f')](_0x4f2b83[_0x68ff('0x32')][_0x68ff('0x4f')]));_0x5742de[_0x68ff('0x37')]=_0x5742de[_0x68ff('0x37')][_0x68ff('0x38')]?_0x5742de[_0x68ff('0x37')]:_0x178bc8[_0x68ff('0x36')];_0x5742de[_0x68ff('0x3a')]=qs[_0x68ff('0x3b')](_0x4f2b83['query']['sort']);_0x5742de[_0x68ff('0x3c')]=qs[_0x68ff('0x34')](_[_0x68ff('0x3d')](_0x4f2b83['query'],_0x178bc8[_0x68ff('0x34')]));if(_0x4f2b83[_0x68ff('0x32')][_0x68ff('0x3e')]){_0x5742de['where']=_[_0x68ff('0x3f')](_0x5742de[_0x68ff('0x3c')],{'$or':_[_0x68ff('0x2e')](_0x5742de[_0x68ff('0x37')],function(_0x1e6fb5){var _0x227a26={};_0x227a26[_0x1e6fb5]={'$like':'%'+_0x4f2b83[_0x68ff('0x32')]['filter']+'%'};return _0x227a26;})});}_0x5742de=_['merge']({},_0x5742de,_0x4f2b83[_0x68ff('0x50')]);return _0x3c1844['getSubjects'](_0x5742de);}})[_0x68ff('0x28')](function(_0x52140b){if(_0x52140b){_0xa30207=_0x52140b['length'];if(!_0x4f2b83[_0x68ff('0x32')][_0x68ff('0x51')](_0x68ff('0x39'))){_0x5742de[_0x68ff('0x1f')]=qs[_0x68ff('0x1f')](_0x4f2b83[_0x68ff('0x32')][_0x68ff('0x1f')]);_0x5742de[_0x68ff('0x20')]=qs['offset'](_0x4f2b83[_0x68ff('0x32')][_0x68ff('0x20')]);}return _0x3c1844['getSubjects'](_0x5742de);}})[_0x68ff('0x28')](function(_0xf6550f){if(_0xf6550f){return _0xf6550f?{'count':_0xa30207,'rows':_0xf6550f}:null;}})[_0x68ff('0x28')](respondWithResult(_0x4eab98,null))[_0x68ff('0x45')](handleError(_0x4eab98,null));};exports[_0x68ff('0x54')]=function(_0x18387a,_0x3c698f,_0x299d85){var _0x5bf289={};var _0x5a3e6a={};var _0x24cad6;var _0x234c67;return db[_0x68ff('0x42')]['findOne']({'where':{'id':_0x18387a[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0x3c698f,null))['then'](function(_0x2e624f){if(_0x2e624f){_0x24cad6=_0x2e624f;_0x5a3e6a[_0x68ff('0x36')]=_['keys'](db[_0x68ff('0x4d')][_0x68ff('0x4e')]);_0x5a3e6a['query']=_[_0x68ff('0x33')](_0x18387a[_0x68ff('0x32')]);_0x5a3e6a[_0x68ff('0x34')]=_[_0x68ff('0x35')](_0x5a3e6a['model'],_0x5a3e6a['query']);_0x5bf289[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x5a3e6a[_0x68ff('0x36')],qs[_0x68ff('0x4f')](_0x18387a[_0x68ff('0x32')][_0x68ff('0x4f')]));_0x5bf289[_0x68ff('0x37')]=_0x5bf289[_0x68ff('0x37')][_0x68ff('0x38')]?_0x5bf289[_0x68ff('0x37')]:_0x5a3e6a[_0x68ff('0x36')];_0x5bf289[_0x68ff('0x3a')]=qs[_0x68ff('0x3b')](_0x18387a[_0x68ff('0x32')]['sort']);_0x5bf289[_0x68ff('0x3c')]=qs[_0x68ff('0x34')](_[_0x68ff('0x3d')](_0x18387a[_0x68ff('0x32')],_0x5a3e6a['filters']));if(_0x18387a['query'][_0x68ff('0x3e')]){_0x5bf289[_0x68ff('0x3c')]=_['merge'](_0x5bf289[_0x68ff('0x3c')],{'$or':_['map'](_0x5bf289[_0x68ff('0x37')],function(_0x5abcd3){var _0xd708bf={};_0xd708bf[_0x5abcd3]={'$like':'%'+_0x18387a['query'][_0x68ff('0x3e')]+'%'};return _0xd708bf;})});}_0x5bf289=_['merge']({},_0x5bf289,_0x18387a[_0x68ff('0x50')]);return _0x24cad6['getDescriptions'](_0x5bf289);}})['then'](function(_0xd8b32b){if(_0xd8b32b){_0x234c67=_0xd8b32b[_0x68ff('0x38')];if(!_0x18387a['query'][_0x68ff('0x51')](_0x68ff('0x39'))){_0x5bf289[_0x68ff('0x1f')]=qs[_0x68ff('0x1f')](_0x18387a['query'][_0x68ff('0x1f')]);_0x5bf289['offset']=qs['offset'](_0x18387a[_0x68ff('0x32')][_0x68ff('0x20')]);}return _0x24cad6[_0x68ff('0x54')](_0x5bf289);}})['then'](function(_0x2fbe05){if(_0x2fbe05){return _0x2fbe05?{'count':_0x234c67,'rows':_0x2fbe05}:null;}})[_0x68ff('0x28')](respondWithResult(_0x3c698f,null))[_0x68ff('0x45')](handleError(_0x3c698f,null));};exports[_0x68ff('0x55')]=function(_0x417033,_0x42c040,_0x48915f){var _0x1f4f49={};var _0x124496={};var _0x56ea8a;var _0x10d574;return db[_0x68ff('0x42')]['findOne']({'where':{'id':_0x417033['params']['id']}})['then'](handleEntityNotFound(_0x42c040,null))[_0x68ff('0x28')](function(_0xc7a9c0){if(_0xc7a9c0){_0x56ea8a=_0xc7a9c0;_0x124496[_0x68ff('0x36')]=_[_0x68ff('0x33')](db[_0x68ff('0x56')]['rawAttributes']);_0x124496[_0x68ff('0x32')]=_[_0x68ff('0x33')](_0x417033[_0x68ff('0x32')]);_0x124496[_0x68ff('0x34')]=_[_0x68ff('0x35')](_0x124496['model'],_0x124496[_0x68ff('0x32')]);_0x1f4f49[_0x68ff('0x37')]=_[_0x68ff('0x35')](_0x124496['model'],qs[_0x68ff('0x4f')](_0x417033['query'][_0x68ff('0x4f')]));_0x1f4f49[_0x68ff('0x37')]=_0x1f4f49[_0x68ff('0x37')]['length']?_0x1f4f49[_0x68ff('0x37')]:_0x124496[_0x68ff('0x36')];_0x1f4f49[_0x68ff('0x3a')]=qs[_0x68ff('0x3b')](_0x417033['query']['sort']);_0x1f4f49[_0x68ff('0x3c')]=qs[_0x68ff('0x34')](_[_0x68ff('0x3d')](_0x417033[_0x68ff('0x32')],_0x124496[_0x68ff('0x34')]));if(_0x417033[_0x68ff('0x32')][_0x68ff('0x3e')]){_0x1f4f49['where']=_[_0x68ff('0x3f')](_0x1f4f49['where'],{'$or':_[_0x68ff('0x2e')](_0x1f4f49[_0x68ff('0x37')],function(_0x5d579e){var _0x1a4976={};_0x1a4976[_0x5d579e]={'$like':'%'+_0x417033['query'][_0x68ff('0x3e')]+'%'};return _0x1a4976;})});}_0x1f4f49=_[_0x68ff('0x3f')]({},_0x1f4f49,_0x417033[_0x68ff('0x50')]);return _0x56ea8a[_0x68ff('0x55')](_0x1f4f49);}})['then'](function(_0x3cb783){if(_0x3cb783){_0x10d574=_0x3cb783['length'];if(!_0x417033['query'][_0x68ff('0x51')](_0x68ff('0x39'))){_0x1f4f49[_0x68ff('0x1f')]=qs['limit'](_0x417033[_0x68ff('0x32')][_0x68ff('0x1f')]);_0x1f4f49['offset']=qs['offset'](_0x417033[_0x68ff('0x32')]['offset']);}return _0x56ea8a[_0x68ff('0x55')](_0x1f4f49);}})['then'](function(_0x49231c){if(_0x49231c){return _0x49231c?{'count':_0x10d574,'rows':_0x49231c}:null;}})[_0x68ff('0x28')](respondWithResult(_0x42c040,null))[_0x68ff('0x45')](handleError(_0x42c040,null));};exports[_0x68ff('0x57')]=function(_0x44f8e9,_0x1bd746,_0x5d2f58){if(_0x44f8e9[_0x68ff('0x49')]['id']){delete _0x44f8e9['body']['id'];}return db[_0x68ff('0x42')][_0x68ff('0x53')]({'where':{'id':_0x44f8e9[_0x68ff('0x4a')]['id']}})[_0x68ff('0x28')](handleEntityNotFound(_0x1bd746,null))['then'](function(_0x1f79c7){if(_0x1f79c7){return _0x1f79c7[_0x68ff('0x57')](_0x44f8e9['body']['ids']||[]);}return null;})[_0x68ff('0x28')](respondWithResult(_0x1bd746,null))[_0x68ff('0x45')](handleError(_0x1bd746,null));};
\ No newline at end of file
index 7af125a..1606b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['ZendeskConfiguration','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x57e951,_0xd9b67f){var _0x398051=function(_0x3f6aa6){while(--_0x3f6aa6){_0x57e951['push'](_0x57e951['shift']());}};_0x398051(++_0xd9b67f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfef3=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0xe27c95,_0x371843){var _0x5dec06=function(_0x46b8eb){while(--_0x46b8eb){_0xe27c95['push'](_0xe27c95['shift']());}};_0x5dec06(++_0x371843);}(_0xfef3,0x118));var _0x3fef=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xfef3[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d65c679..de6b4a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f1=['../../config/logger','rpc','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0xd511d2,_0x2391c6){var _0x3af4db=function(_0x5f24ba){while(--_0x5f24ba){_0xd511d2['push'](_0xd511d2['shift']());}};_0x3af4db(++_0x2391c6);}(_0x98f1,0x18b));var _0x198f=function(_0x3de421,_0x1b6a9e){_0x3de421=_0x3de421-0x0;var _0x13a3b8=_0x98f1[_0x3de421];return _0x13a3b8;};'use strict';var _=require(_0x198f('0x0'));var util=require('util');var moment=require(_0x198f('0x1'));var BPromise=require(_0x198f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x198f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x198f('0x4'));var logger=require(_0x198f('0x5'))(_0x198f('0x6'));var config=require('../../config/environment');var jayson=require(_0x198f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x105c64,_0x557fc9,_0x2b7200){return new BPromise(function(_0x3a78d9,_0x56b5e2){return client[_0x198f('0x8')](_0x105c64,_0x2b7200)[_0x198f('0x9')](function(_0x2f04e6){logger[_0x198f('0xa')](_0x198f('0xb'),_0x557fc9,_0x198f('0xc'));logger[_0x198f('0xd')](_0x198f('0xe'),_0x557fc9,_0x198f('0xc'),JSON[_0x198f('0xf')](_0x2f04e6));if(_0x2f04e6[_0x198f('0x10')]){if(_0x2f04e6['error'][_0x198f('0x11')]===0x1f4){logger[_0x198f('0x10')](_0x198f('0xb'),_0x557fc9,_0x2f04e6[_0x198f('0x10')][_0x198f('0x12')]);return _0x56b5e2(_0x2f04e6['error'][_0x198f('0x12')]);}logger[_0x198f('0x10')](_0x198f('0xb'),_0x557fc9,_0x2f04e6['error']['message']);return _0x3a78d9(_0x2f04e6['error'][_0x198f('0x12')]);}else{logger['info'](_0x198f('0xb'),_0x557fc9,_0x198f('0xc'));_0x3a78d9(_0x2f04e6[_0x198f('0x13')][_0x198f('0x12')]);}})['catch'](function(_0x10a924){logger[_0x198f('0x10')](_0x198f('0xb'),_0x557fc9,_0x10a924);_0x56b5e2(_0x10a924);});});}
\ No newline at end of file
+var _0x81c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x81c7,0x189));var _0x781c=function(_0x2959e3,_0x4602e6){_0x2959e3=_0x2959e3-0x0;var _0x46305a=_0x81c7[_0x2959e3];return _0x46305a;};'use strict';var _=require(_0x781c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x781c('0x1'));var rs=require(_0x781c('0x2'));var fs=require('fs');var Redis=require(_0x781c('0x3'));var db=require(_0x781c('0x4'))['db'];var utils=require(_0x781c('0x5'));var logger=require(_0x781c('0x6'))(_0x781c('0x7'));var config=require(_0x781c('0x8'));var jayson=require(_0x781c('0x9'));var client=jayson[_0x781c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527322,_0x4442a6,_0x29810d){return new BPromise(function(_0x40eef6,_0x2fe3c1){return client[_0x781c('0xb')](_0x527322,_0x29810d)[_0x781c('0xc')](function(_0x4b32fd){logger[_0x781c('0xd')](_0x781c('0xe'),_0x4442a6,_0x781c('0xf'));logger[_0x781c('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4442a6,'request\x20sent',JSON[_0x781c('0x11')](_0x4b32fd));if(_0x4b32fd[_0x781c('0x12')]){if(_0x4b32fd['error']['code']===0x1f4){logger[_0x781c('0x12')](_0x781c('0xe'),_0x4442a6,_0x4b32fd[_0x781c('0x12')][_0x781c('0x13')]);return _0x2fe3c1(_0x4b32fd[_0x781c('0x12')]['message']);}logger[_0x781c('0x12')](_0x781c('0xe'),_0x4442a6,_0x4b32fd[_0x781c('0x12')]['message']);return _0x40eef6(_0x4b32fd['error'][_0x781c('0x13')]);}else{logger[_0x781c('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4442a6,_0x781c('0xf'));_0x40eef6(_0x4b32fd[_0x781c('0x14')][_0x781c('0x13')]);}})[_0x781c('0x15')](function(_0xcb1f39){logger['error'](_0x781c('0xe'),_0x4442a6,_0xcb1f39);_0x2fe3c1(_0xcb1f39);});});}
\ No newline at end of file
index 740aef0..372d339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6f4=['/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x1dfac2,_0x2c5939){var _0x127264=function(_0x5afb0b){while(--_0x5afb0b){_0x1dfac2['push'](_0x1dfac2['shift']());}};_0x127264(++_0x2c5939);}(_0xa6f4,0xb0));var _0x4a6f=function(_0x18de89,_0x4c9417){_0x18de89=_0x18de89-0x0;var _0x42ccb4=_0xa6f4[_0x18de89];return _0x42ccb4;};'use strict';var multer=require(_0x4a6f('0x0'));var util=require('util');var path=require(_0x4a6f('0x1'));var timeout=require(_0x4a6f('0x2'));var express=require(_0x4a6f('0x3'));var router=express[_0x4a6f('0x4')]();var fs_extra=require(_0x4a6f('0x5'));var auth=require(_0x4a6f('0x6'));var interaction=require(_0x4a6f('0x7'));var config=require(_0x4a6f('0x8'));var controller=require(_0x4a6f('0x9'));router[_0x4a6f('0xa')]('/',auth[_0x4a6f('0xb')](),controller[_0x4a6f('0xc')]);router[_0x4a6f('0xa')](_0x4a6f('0xd'),auth[_0x4a6f('0xb')](),controller[_0x4a6f('0xe')]);router[_0x4a6f('0xf')]('/',auth[_0x4a6f('0xb')](),controller[_0x4a6f('0x10')]);router[_0x4a6f('0x11')](_0x4a6f('0xd'),auth['isAuthenticated'](),controller[_0x4a6f('0x12')]);router['delete'](_0x4a6f('0xd'),auth[_0x4a6f('0xb')](),controller[_0x4a6f('0x13')]);module[_0x4a6f('0x14')]=router;
\ No newline at end of file
+var _0x88e8=['Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0x88e8,0x13f));var _0x888e=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x88e8[_0x42f687];return _0x108838;};'use strict';var multer=require('multer');var util=require(_0x888e('0x0'));var path=require(_0x888e('0x1'));var timeout=require(_0x888e('0x2'));var express=require(_0x888e('0x3'));var router=express[_0x888e('0x4')]();var fs_extra=require(_0x888e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x888e('0x6'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x888e('0x7')](),controller[_0x888e('0x8')]);router[_0x888e('0x9')](_0x888e('0xa'),auth[_0x888e('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x888e('0xb')]);router[_0x888e('0xc')](_0x888e('0xa'),auth['isAuthenticated'](),controller[_0x888e('0xd')]);router[_0x888e('0xe')](_0x888e('0xa'),auth[_0x888e('0x7')](),controller[_0x888e('0xf')]);module[_0x888e('0x10')]=router;
\ No newline at end of file
index 6db1448..3088073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa143=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','variable'];(function(_0x918478,_0x2decdb){var _0x4dc889=function(_0x16b372){while(--_0x16b372){_0x918478['push'](_0x918478['shift']());}};_0x4dc889(++_0x2decdb);}(_0xa143,0x17e));var _0x3a14=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa143[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x3a14('0x0'));module[_0x3a14('0x1')]={'type':{'type':Sequelize[_0x3a14('0x2')](_0x3a14('0x3'),'variable',_0x3a14('0x4'),_0x3a14('0x5'),_0x3a14('0x6')),'defaultValue':_0x3a14('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x3a14('0x7'),_0x3a14('0x4'))},'keyContent':{'type':Sequelize[_0x3a14('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3a14('0x8')]},'customField':{'type':Sequelize[_0x3a14('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a14('0x8')]}};
\ No newline at end of file
+var _0x822f=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x31a123,_0x41f4c3){var _0x2fe0a3=function(_0x43c0a4){while(--_0x43c0a4){_0x31a123['push'](_0x31a123['shift']());}};_0x2fe0a3(++_0x41f4c3);}(_0x822f,0x1d7));var _0xf822=function(_0x37917c,_0x375ea6){_0x37917c=_0x37917c-0x0;var _0x1e586a=_0x822f[_0x37917c];return _0x1e586a;};'use strict';var Sequelize=require(_0xf822('0x0'));module[_0xf822('0x1')]={'type':{'type':Sequelize[_0xf822('0x2')](_0xf822('0x3'),_0xf822('0x4'),_0xf822('0x5'),'keyValue',_0xf822('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf822('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf822('0x2')](_0xf822('0x3'),_0xf822('0x4'),_0xf822('0x5'))},'keyContent':{'type':Sequelize[_0xf822('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf822('0x7')]},'customField':{'type':Sequelize[_0xf822('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf822('0x7')]}};
\ No newline at end of file
index 80d854f..ba63c1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c6=['options','include','ZendeskField','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x94c6,0xa2));var _0x694c=function(_0x24bb2b,_0x1d4a5a){_0x24bb2b=_0x24bb2b-0x0;var _0x15f787=_0x94c6[_0x24bb2b];return _0x15f787;};'use strict';var emlformat=require(_0x694c('0x0'));var rimraf=require(_0x694c('0x1'));var zipdir=require(_0x694c('0x2'));var jsonpatch=require(_0x694c('0x3'));var rp=require(_0x694c('0x4'));var moment=require(_0x694c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x694c('0x6'));var path=require('path');var sox=require(_0x694c('0x7'));var csv=require(_0x694c('0x8'));var ejs=require(_0x694c('0x9'));var fs=require('fs');var fs_extra=require(_0x694c('0xa'));var _=require(_0x694c('0xb'));var squel=require(_0x694c('0xc'));var crypto=require('crypto');var jsforce=require(_0x694c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x694c('0x8'));var querystring=require(_0x694c('0xe'));var Papa=require(_0x694c('0xf'));var Redis=require('ioredis');var authService=require(_0x694c('0x10'));var qs=require(_0x694c('0x11'));var as=require(_0x694c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x694c('0x13'))(_0x694c('0x14'));var utils=require(_0x694c('0x15'));var config=require(_0x694c('0x16'));var licenseUtil=require(_0x694c('0x17'));var db=require(_0x694c('0x18'))['db'];function respondWithStatusCode(_0x199c9a,_0x223ab5){_0x223ab5=_0x223ab5||0xcc;return function(_0xb933d6){if(_0xb933d6){return _0x199c9a[_0x694c('0x19')](_0x223ab5);}return _0x199c9a[_0x694c('0x1a')](_0x223ab5)[_0x694c('0x1b')]();};}function respondWithResult(_0xa2ba2b,_0x197e19){_0x197e19=_0x197e19||0xc8;return function(_0x2ba4d3){if(_0x2ba4d3){return _0xa2ba2b['status'](_0x197e19)[_0x694c('0x1c')](_0x2ba4d3);}};}function respondWithFilteredResult(_0x337862,_0x4ab8d0){return function(_0xcdb0f4){if(_0xcdb0f4){var _0x5036cc=typeof _0x4ab8d0[_0x694c('0x1d')]===_0x694c('0x1e')&&typeof _0x4ab8d0[_0x694c('0x1f')]===_0x694c('0x1e');var _0x1e3ee8=_0xcdb0f4[_0x694c('0x20')];var _0x54f132=_0x5036cc?0x0:_0x4ab8d0[_0x694c('0x1d')];var _0xf6836e=_0x5036cc?_0xcdb0f4[_0x694c('0x20')]:_0x4ab8d0[_0x694c('0x1d')]+_0x4ab8d0['limit'];var _0x404a1a;if(_0xf6836e>=_0x1e3ee8){_0xf6836e=_0x1e3ee8;_0x404a1a=0xc8;}else{_0x404a1a=0xce;}_0x337862[_0x694c('0x1a')](_0x404a1a);return _0x337862[_0x694c('0x21')](_0x694c('0x22'),_0x54f132+'-'+_0xf6836e+'/'+_0x1e3ee8)[_0x694c('0x1c')](_0xcdb0f4);}return null;};}function patchUpdates(_0x4cf438){return function(_0x2eaaab){try{jsonpatch[_0x694c('0x23')](_0x2eaaab,_0x4cf438,!![]);}catch(_0x1f48dd){return BPromise[_0x694c('0x24')](_0x1f48dd);}return _0x2eaaab[_0x694c('0x25')]();};}function saveUpdates(_0x534b72,_0x41862d){return function(_0x37118e){if(_0x37118e){return _0x37118e[_0x694c('0x26')](_0x534b72)[_0x694c('0x27')](function(_0x2614e5){return _0x2614e5;});}return null;};}function removeEntity(_0x2ec16f,_0xaadc9d){return function(_0x233dc5){if(_0x233dc5){return _0x233dc5['destroy']()[_0x694c('0x27')](function(){_0x2ec16f[_0x694c('0x1a')](0xcc)[_0x694c('0x1b')]();});}};}function handleEntityNotFound(_0x304200,_0x2ccd0f){return function(_0x384ac5){if(!_0x384ac5){_0x304200[_0x694c('0x19')](0x194);}return _0x384ac5;};}function handleError(_0xc3f5c8,_0x545788){_0x545788=_0x545788||0x1f4;return function(_0x589656){logger['error'](_0x589656[_0x694c('0x28')]);if(_0x589656[_0x694c('0x29')]){delete _0x589656['name'];}_0xc3f5c8[_0x694c('0x1a')](_0x545788)[_0x694c('0x2a')](_0x589656);};}exports['index']=function(_0x3fb972,_0x1fdea3){var _0x5d201f={},_0x1a7753={},_0x37239e={'count':0x0,'rows':[]};var _0x5794b0=_['map'](db['ZendeskField']['rawAttributes'],function(_0x19aaab){return{'name':_0x19aaab[_0x694c('0x2b')],'type':_0x19aaab['type'][_0x694c('0x2c')]};});_0x1a7753[_0x694c('0x2d')]=_['map'](_0x5794b0,_0x694c('0x29'));_0x1a7753[_0x694c('0x2e')]=_[_0x694c('0x2f')](_0x3fb972['query']);_0x1a7753[_0x694c('0x30')]=_[_0x694c('0x31')](_0x1a7753['model'],_0x1a7753[_0x694c('0x2e')]);_0x5d201f[_0x694c('0x32')]=_['intersection'](_0x1a7753[_0x694c('0x2d')],qs['fields'](_0x3fb972[_0x694c('0x2e')][_0x694c('0x33')]));_0x5d201f[_0x694c('0x32')]=_0x5d201f[_0x694c('0x32')][_0x694c('0x34')]?_0x5d201f[_0x694c('0x32')]:_0x1a7753[_0x694c('0x2d')];if(!_0x3fb972[_0x694c('0x2e')][_0x694c('0x35')]('nolimit')){_0x5d201f[_0x694c('0x1f')]=qs[_0x694c('0x1f')](_0x3fb972['query'][_0x694c('0x1f')]);_0x5d201f[_0x694c('0x1d')]=qs[_0x694c('0x1d')](_0x3fb972['query'][_0x694c('0x1d')]);}_0x5d201f[_0x694c('0x36')]=qs[_0x694c('0x37')](_0x3fb972[_0x694c('0x2e')]['sort']);_0x5d201f['where']=qs['filters'](_[_0x694c('0x38')](_0x3fb972[_0x694c('0x2e')],_0x1a7753[_0x694c('0x30')]),_0x5794b0);if(_0x3fb972[_0x694c('0x2e')][_0x694c('0x39')]){_0x5d201f[_0x694c('0x3a')]=_[_0x694c('0x3b')](_0x5d201f['where'],{'$or':_[_0x694c('0x3c')](_0x5794b0,function(_0xc086f5){if(_0xc086f5[_0x694c('0x3d')]!==_0x694c('0x3e')){var _0xb1f74a={};_0xb1f74a[_0xc086f5['name']]={'$like':'%'+_0x3fb972[_0x694c('0x2e')]['filter']+'%'};return _0xb1f74a;}})});}_0x5d201f=_[_0x694c('0x3b')]({},_0x5d201f,_0x3fb972[_0x694c('0x3f')]);var _0x5d65b7={'where':_0x5d201f['where']};return db['ZendeskField']['count'](_0x5d65b7)['then'](function(_0x4a7097){_0x37239e['count']=_0x4a7097;if(_0x3fb972[_0x694c('0x2e')]['includeAll']){_0x5d201f[_0x694c('0x40')]=[{'all':!![]}];}return db[_0x694c('0x41')][_0x694c('0x42')](_0x5d201f);})[_0x694c('0x27')](function(_0x2b7d87){_0x37239e[_0x694c('0x43')]=_0x2b7d87;return _0x37239e;})[_0x694c('0x27')](respondWithFilteredResult(_0x1fdea3,_0x5d201f))[_0x694c('0x44')](handleError(_0x1fdea3,null));};exports[_0x694c('0x45')]=function(_0x3525c4,_0x3d40c7){var _0x2e3332={'raw':!![],'where':{'id':_0x3525c4[_0x694c('0x46')]['id']}},_0x54667e={};_0x54667e['model']=_['keys'](db[_0x694c('0x41')]['rawAttributes']);_0x54667e[_0x694c('0x2e')]=_[_0x694c('0x2f')](_0x3525c4[_0x694c('0x2e')]);_0x54667e[_0x694c('0x30')]=_[_0x694c('0x31')](_0x54667e['model'],_0x54667e[_0x694c('0x2e')]);_0x2e3332[_0x694c('0x32')]=_[_0x694c('0x31')](_0x54667e['model'],qs[_0x694c('0x33')](_0x3525c4['query'][_0x694c('0x33')]));_0x2e3332[_0x694c('0x32')]=_0x2e3332['attributes'][_0x694c('0x34')]?_0x2e3332[_0x694c('0x32')]:_0x54667e[_0x694c('0x2d')];if(_0x3525c4['query'][_0x694c('0x47')]){_0x2e3332['include']=[{'all':!![]}];}_0x2e3332=_[_0x694c('0x3b')]({},_0x2e3332,_0x3525c4['options']);return db[_0x694c('0x41')][_0x694c('0x48')](_0x2e3332)[_0x694c('0x27')](handleEntityNotFound(_0x3d40c7,null))['then'](respondWithResult(_0x3d40c7,null))[_0x694c('0x44')](handleError(_0x3d40c7,null));};exports[_0x694c('0x49')]=function(_0x41546a,_0x5f1712){return db[_0x694c('0x41')][_0x694c('0x49')](_0x41546a[_0x694c('0x4a')],{})[_0x694c('0x27')](respondWithResult(_0x5f1712,0xc9))[_0x694c('0x44')](handleError(_0x5f1712,null));};exports[_0x694c('0x26')]=function(_0x5488a0,_0x3e10ff){if(_0x5488a0[_0x694c('0x4a')]['id']){delete _0x5488a0['body']['id'];}return db[_0x694c('0x41')]['find']({'where':{'id':_0x5488a0[_0x694c('0x46')]['id']}})[_0x694c('0x27')](handleEntityNotFound(_0x3e10ff,null))[_0x694c('0x27')](saveUpdates(_0x5488a0['body'],null))[_0x694c('0x27')](respondWithResult(_0x3e10ff,null))['catch'](handleError(_0x3e10ff,null));};exports['destroy']=function(_0x4e2843,_0x37d594){return db[_0x694c('0x41')][_0x694c('0x48')]({'where':{'id':_0x4e2843[_0x694c('0x46')]['id']}})['then'](handleEntityNotFound(_0x37d594,null))[_0x694c('0x27')](removeEntity(_0x37d594,null))[_0x694c('0x44')](handleError(_0x37d594,null));};
\ No newline at end of file
+var _0x7e35=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4ecf10,_0x381e84){var _0x1bb9e1=function(_0x53f943){while(--_0x53f943){_0x4ecf10['push'](_0x4ecf10['shift']());}};_0x1bb9e1(++_0x381e84);}(_0x7e35,0xc9));var _0x57e3=function(_0x3f8a2b,_0x397811){_0x3f8a2b=_0x3f8a2b-0x0;var _0x417ee5=_0x7e35[_0x3f8a2b];return _0x417ee5;};'use strict';var emlformat=require(_0x57e3('0x0'));var rimraf=require(_0x57e3('0x1'));var zipdir=require(_0x57e3('0x2'));var jsonpatch=require(_0x57e3('0x3'));var rp=require(_0x57e3('0x4'));var moment=require(_0x57e3('0x5'));var BPromise=require(_0x57e3('0x6'));var Mustache=require(_0x57e3('0x7'));var util=require(_0x57e3('0x8'));var path=require(_0x57e3('0x9'));var sox=require(_0x57e3('0xa'));var csv=require(_0x57e3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e3('0xc'));var _=require(_0x57e3('0xd'));var squel=require(_0x57e3('0xe'));var crypto=require(_0x57e3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x57e3('0x10'));var toCsv=require(_0x57e3('0xb'));var querystring=require(_0x57e3('0x11'));var Papa=require('papaparse');var Redis=require(_0x57e3('0x12'));var authService=require(_0x57e3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57e3('0x14'));var logger=require(_0x57e3('0x15'))(_0x57e3('0x16'));var utils=require(_0x57e3('0x17'));var config=require(_0x57e3('0x18'));var licenseUtil=require(_0x57e3('0x19'));var db=require(_0x57e3('0x1a'))['db'];function respondWithStatusCode(_0x5062fb,_0xf92968){_0xf92968=_0xf92968||0xcc;return function(_0x11d1d9){if(_0x11d1d9){return _0x5062fb[_0x57e3('0x1b')](_0xf92968);}return _0x5062fb[_0x57e3('0x1c')](_0xf92968)[_0x57e3('0x1d')]();};}function respondWithResult(_0x102768,_0x2945d1){_0x2945d1=_0x2945d1||0xc8;return function(_0xb54dc2){if(_0xb54dc2){return _0x102768[_0x57e3('0x1c')](_0x2945d1)[_0x57e3('0x1e')](_0xb54dc2);}};}function respondWithFilteredResult(_0x26fa14,_0x294182){return function(_0x506ce2){if(_0x506ce2){var _0x1feed9=typeof _0x294182['offset']==='undefined'&&typeof _0x294182[_0x57e3('0x1f')]==='undefined';var _0x119cd9=_0x506ce2[_0x57e3('0x20')];var _0xe013b0=_0x1feed9?0x0:_0x294182[_0x57e3('0x21')];var _0x29a64a=_0x1feed9?_0x506ce2[_0x57e3('0x20')]:_0x294182[_0x57e3('0x21')]+_0x294182['limit'];var _0x385568;if(_0x29a64a>=_0x119cd9){_0x29a64a=_0x119cd9;_0x385568=0xc8;}else{_0x385568=0xce;}_0x26fa14[_0x57e3('0x1c')](_0x385568);return _0x26fa14[_0x57e3('0x22')](_0x57e3('0x23'),_0xe013b0+'-'+_0x29a64a+'/'+_0x119cd9)[_0x57e3('0x1e')](_0x506ce2);}return null;};}function patchUpdates(_0x3f2028){return function(_0x272476){try{jsonpatch[_0x57e3('0x24')](_0x272476,_0x3f2028,!![]);}catch(_0x16d086){return BPromise['reject'](_0x16d086);}return _0x272476[_0x57e3('0x25')]();};}function saveUpdates(_0x4686db,_0x54227e){return function(_0x5189ab){if(_0x5189ab){return _0x5189ab[_0x57e3('0x26')](_0x4686db)[_0x57e3('0x27')](function(_0x50a438){return _0x50a438;});}return null;};}function removeEntity(_0x358788,_0x505e18){return function(_0x28fc9e){if(_0x28fc9e){return _0x28fc9e[_0x57e3('0x28')]()['then'](function(){_0x358788[_0x57e3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a001b,_0x22d77f){return function(_0x5a0ee5){if(!_0x5a0ee5){_0x3a001b[_0x57e3('0x1b')](0x194);}return _0x5a0ee5;};}function handleError(_0x49b5f2,_0x552286){_0x552286=_0x552286||0x1f4;return function(_0x625c2d){logger[_0x57e3('0x29')](_0x625c2d[_0x57e3('0x2a')]);if(_0x625c2d['name']){delete _0x625c2d[_0x57e3('0x2b')];}_0x49b5f2['status'](_0x552286)[_0x57e3('0x2c')](_0x625c2d);};}exports[_0x57e3('0x2d')]=function(_0x16ecff,_0x3c00f9){var _0x3e616b={},_0x5b02fa={},_0x215449={'count':0x0,'rows':[]};var _0xc92b5=_[_0x57e3('0x2e')](db[_0x57e3('0x2f')][_0x57e3('0x30')],function(_0x125662){return{'name':_0x125662['fieldName'],'type':_0x125662[_0x57e3('0x31')]['key']};});_0x5b02fa['model']=_[_0x57e3('0x2e')](_0xc92b5,_0x57e3('0x2b'));_0x5b02fa[_0x57e3('0x32')]=_[_0x57e3('0x33')](_0x16ecff['query']);_0x5b02fa[_0x57e3('0x34')]=_[_0x57e3('0x35')](_0x5b02fa[_0x57e3('0x36')],_0x5b02fa[_0x57e3('0x32')]);_0x3e616b[_0x57e3('0x37')]=_[_0x57e3('0x35')](_0x5b02fa[_0x57e3('0x36')],qs[_0x57e3('0x38')](_0x16ecff[_0x57e3('0x32')]['fields']));_0x3e616b[_0x57e3('0x37')]=_0x3e616b[_0x57e3('0x37')]['length']?_0x3e616b[_0x57e3('0x37')]:_0x5b02fa[_0x57e3('0x36')];if(!_0x16ecff[_0x57e3('0x32')][_0x57e3('0x39')](_0x57e3('0x3a'))){_0x3e616b['limit']=qs[_0x57e3('0x1f')](_0x16ecff['query']['limit']);_0x3e616b[_0x57e3('0x21')]=qs[_0x57e3('0x21')](_0x16ecff[_0x57e3('0x32')][_0x57e3('0x21')]);}_0x3e616b[_0x57e3('0x3b')]=qs[_0x57e3('0x3c')](_0x16ecff[_0x57e3('0x32')]['sort']);_0x3e616b[_0x57e3('0x3d')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3e')](_0x16ecff[_0x57e3('0x32')],_0x5b02fa['filters']),_0xc92b5);if(_0x16ecff[_0x57e3('0x32')][_0x57e3('0x3f')]){_0x3e616b[_0x57e3('0x3d')]=_[_0x57e3('0x40')](_0x3e616b[_0x57e3('0x3d')],{'$or':_['map'](_0xc92b5,function(_0x5d9b38){if(_0x5d9b38[_0x57e3('0x31')]!=='VIRTUAL'){var _0xa45599={};_0xa45599[_0x5d9b38[_0x57e3('0x2b')]]={'$like':'%'+_0x16ecff[_0x57e3('0x32')][_0x57e3('0x3f')]+'%'};return _0xa45599;}})});}_0x3e616b=_[_0x57e3('0x40')]({},_0x3e616b,_0x16ecff['options']);var _0x35e752={'where':_0x3e616b['where']};return db['ZendeskField'][_0x57e3('0x20')](_0x35e752)[_0x57e3('0x27')](function(_0x2cbfe2){_0x215449[_0x57e3('0x20')]=_0x2cbfe2;if(_0x16ecff[_0x57e3('0x32')][_0x57e3('0x41')]){_0x3e616b[_0x57e3('0x42')]=[{'all':!![]}];}return db[_0x57e3('0x2f')]['findAll'](_0x3e616b);})['then'](function(_0xabffc1){_0x215449['rows']=_0xabffc1;return _0x215449;})['then'](respondWithFilteredResult(_0x3c00f9,_0x3e616b))[_0x57e3('0x43')](handleError(_0x3c00f9,null));};exports[_0x57e3('0x44')]=function(_0x87de58,_0x5b2757){var _0x557314={'raw':!![],'where':{'id':_0x87de58[_0x57e3('0x45')]['id']}},_0xe7d4be={};_0xe7d4be[_0x57e3('0x36')]=_[_0x57e3('0x33')](db[_0x57e3('0x2f')][_0x57e3('0x30')]);_0xe7d4be[_0x57e3('0x32')]=_['keys'](_0x87de58[_0x57e3('0x32')]);_0xe7d4be[_0x57e3('0x34')]=_[_0x57e3('0x35')](_0xe7d4be['model'],_0xe7d4be[_0x57e3('0x32')]);_0x557314[_0x57e3('0x37')]=_[_0x57e3('0x35')](_0xe7d4be['model'],qs[_0x57e3('0x38')](_0x87de58[_0x57e3('0x32')][_0x57e3('0x38')]));_0x557314[_0x57e3('0x37')]=_0x557314[_0x57e3('0x37')][_0x57e3('0x46')]?_0x557314[_0x57e3('0x37')]:_0xe7d4be[_0x57e3('0x36')];if(_0x87de58[_0x57e3('0x32')][_0x57e3('0x41')]){_0x557314['include']=[{'all':!![]}];}_0x557314=_[_0x57e3('0x40')]({},_0x557314,_0x87de58[_0x57e3('0x47')]);return db[_0x57e3('0x2f')][_0x57e3('0x48')](_0x557314)['then'](handleEntityNotFound(_0x5b2757,null))[_0x57e3('0x27')](respondWithResult(_0x5b2757,null))[_0x57e3('0x43')](handleError(_0x5b2757,null));};exports[_0x57e3('0x49')]=function(_0x4567ad,_0x412ad5){return db[_0x57e3('0x2f')]['create'](_0x4567ad['body'],{})[_0x57e3('0x27')](respondWithResult(_0x412ad5,0xc9))[_0x57e3('0x43')](handleError(_0x412ad5,null));};exports['update']=function(_0x17939b,_0x2883ce){if(_0x17939b[_0x57e3('0x4a')]['id']){delete _0x17939b[_0x57e3('0x4a')]['id'];}return db[_0x57e3('0x2f')]['find']({'where':{'id':_0x17939b[_0x57e3('0x45')]['id']}})[_0x57e3('0x27')](handleEntityNotFound(_0x2883ce,null))[_0x57e3('0x27')](saveUpdates(_0x17939b[_0x57e3('0x4a')],null))[_0x57e3('0x27')](respondWithResult(_0x2883ce,null))[_0x57e3('0x43')](handleError(_0x2883ce,null));};exports['destroy']=function(_0x20f666,_0x200888){return db[_0x57e3('0x2f')][_0x57e3('0x48')]({'where':{'id':_0x20f666[_0x57e3('0x45')]['id']}})[_0x57e3('0x27')](handleEntityNotFound(_0x200888,null))[_0x57e3('0x27')](removeEntity(_0x200888,null))['catch'](handleError(_0x200888,null));};
\ No newline at end of file
index 5331121..a1773ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa182=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ZendeskField','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x5cd6cb,_0x33431){var _0x42462d=function(_0x2d7362){while(--_0x2d7362){_0x5cd6cb['push'](_0x5cd6cb['shift']());}};_0x42462d(++_0x33431);}(_0xa182,0x1c7));var _0x2a18=function(_0x5480c6,_0x55d989){_0x5480c6=_0x5480c6-0x0;var _0x57e072=_0xa182[_0x5480c6];return _0x57e072;};'use strict';var _=require(_0x2a18('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a18('0x1'));var moment=require(_0x2a18('0x2'));var BPromise=require(_0x2a18('0x3'));var rp=require(_0x2a18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a18('0x5'));var config=require(_0x2a18('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x2a18('0x7')]=function(_0xc8ed04,_0x26a16b){return _0xc8ed04['define'](_0x2a18('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x2a18('0x9'),'fields':[_0x2a18('0xa'),_0x2a18('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d8f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField'];(function(_0x266d29,_0x2b6b29){var _0x33bbbd=function(_0x3b934d){while(--_0x3b934d){_0x266d29['push'](_0x266d29['shift']());}};_0x33bbbd(++_0x2b6b29);}(_0x0d8f,0x12c));var _0xf0d8=function(_0x2247ab,_0x3f4162){_0x2247ab=_0x2247ab-0x0;var _0x430062=_0x0d8f[_0x2247ab];return _0x430062;};'use strict';var _=require(_0xf0d8('0x0'));var util=require(_0xf0d8('0x1'));var logger=require(_0xf0d8('0x2'))(_0xf0d8('0x3'));var moment=require(_0xf0d8('0x4'));var BPromise=require(_0xf0d8('0x5'));var rp=require(_0xf0d8('0x6'));var fs=require('fs');var path=require(_0xf0d8('0x7'));var rimraf=require(_0xf0d8('0x8'));var config=require('../../config/environment');var attributes=require(_0xf0d8('0x9'));module[_0xf0d8('0xa')]=function(_0x1d3e7d,_0x4227be){return _0x1d3e7d[_0xf0d8('0xb')](_0xf0d8('0xc'),attributes,{'tableName':_0xf0d8('0xd'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xf0d8('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7ec2736..9f266ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e05=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5cd23e,_0x20777b){var _0x216550=function(_0x2935bb){while(--_0x2935bb){_0x5cd23e['push'](_0x5cd23e['shift']());}};_0x216550(++_0x20777b);}(_0x8e05,0xc8));var _0x58e0=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x8e05[_0x2797c6];return _0x54809f;};'use strict';var _=require('lodash');var util=require(_0x58e0('0x0'));var moment=require(_0x58e0('0x1'));var BPromise=require(_0x58e0('0x2'));var rs=require(_0x58e0('0x3'));var fs=require('fs');var Redis=require(_0x58e0('0x4'));var db=require(_0x58e0('0x5'))['db'];var utils=require(_0x58e0('0x6'));var logger=require(_0x58e0('0x7'))('rpc');var config=require(_0x58e0('0x8'));var jayson=require(_0x58e0('0x9'));var client=jayson[_0x58e0('0xa')][_0x58e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c02e3,_0xb47baa,_0x3f1767){return new BPromise(function(_0x8ab28f,_0xe57427){return client[_0x58e0('0xc')](_0x3c02e3,_0x3f1767)['then'](function(_0x28512c){logger[_0x58e0('0xd')](_0x58e0('0xe'),_0xb47baa,_0x58e0('0xf'));logger[_0x58e0('0x10')](_0x58e0('0x11'),_0xb47baa,_0x58e0('0xf'),JSON[_0x58e0('0x12')](_0x28512c));if(_0x28512c['error']){if(_0x28512c[_0x58e0('0x13')][_0x58e0('0x14')]===0x1f4){logger[_0x58e0('0x13')](_0x58e0('0xe'),_0xb47baa,_0x28512c[_0x58e0('0x13')][_0x58e0('0x15')]);return _0xe57427(_0x28512c[_0x58e0('0x13')][_0x58e0('0x15')]);}logger[_0x58e0('0x13')](_0x58e0('0xe'),_0xb47baa,_0x28512c[_0x58e0('0x13')][_0x58e0('0x15')]);return _0x8ab28f(_0x28512c['error'][_0x58e0('0x15')]);}else{logger[_0x58e0('0xd')](_0x58e0('0xe'),_0xb47baa,_0x58e0('0xf'));_0x8ab28f(_0x28512c['result'][_0x58e0('0x15')]);}})[_0x58e0('0x16')](function(_0x2c1dfa){logger[_0x58e0('0x13')](_0x58e0('0xe'),_0xb47baa,_0x2c1dfa);_0xe57427(_0x2c1dfa);});});}
\ No newline at end of file
+var _0x383a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ZendeskField,\x20%s,\x20%s','message','result','lodash','util','randomstring'];(function(_0x19c68e,_0x23886e){var _0x362c4b=function(_0xfc45cb){while(--_0xfc45cb){_0x19c68e['push'](_0x19c68e['shift']());}};_0x362c4b(++_0x23886e);}(_0x383a,0x177));var _0xa383=function(_0x4f5c2a,_0x465535){_0x4f5c2a=_0x4f5c2a-0x0;var _0x1b2e6e=_0x383a[_0x4f5c2a];return _0x1b2e6e;};'use strict';var _=require(_0xa383('0x0'));var util=require(_0xa383('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa383('0x2'));var fs=require('fs');var Redis=require(_0xa383('0x3'));var db=require(_0xa383('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa383('0x5'))(_0xa383('0x6'));var config=require(_0xa383('0x7'));var jayson=require(_0xa383('0x8'));var client=jayson[_0xa383('0x9')][_0xa383('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30a80f,_0x5a1247,_0x13a643){return new BPromise(function(_0x34fa44,_0x62af7){return client[_0xa383('0xb')](_0x30a80f,_0x13a643)[_0xa383('0xc')](function(_0x4d87f6){logger[_0xa383('0xd')]('ZendeskField,\x20%s,\x20%s',_0x5a1247,_0xa383('0xe'));logger[_0xa383('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5a1247,_0xa383('0xe'),JSON[_0xa383('0x10')](_0x4d87f6));if(_0x4d87f6['error']){if(_0x4d87f6[_0xa383('0x11')]['code']===0x1f4){logger[_0xa383('0x11')](_0xa383('0x12'),_0x5a1247,_0x4d87f6[_0xa383('0x11')]['message']);return _0x62af7(_0x4d87f6[_0xa383('0x11')][_0xa383('0x13')]);}logger[_0xa383('0x11')](_0xa383('0x12'),_0x5a1247,_0x4d87f6['error'][_0xa383('0x13')]);return _0x34fa44(_0x4d87f6[_0xa383('0x11')][_0xa383('0x13')]);}else{logger['info'](_0xa383('0x12'),_0x5a1247,_0xa383('0xe'));_0x34fa44(_0x4d87f6[_0xa383('0x14')][_0xa383('0x13')]);}})['catch'](function(_0x3fc1bd){logger['error'](_0xa383('0x12'),_0x5a1247,_0x3fc1bd);_0x62af7(_0x3fc1bd);});});}
\ No newline at end of file
index 74ad663..eaef9f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x623f=['getFields','post','create','addConfiguration','put','update','delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x623f,0xef));var _0xf623=function(_0x524379,_0x176e26){_0x524379=_0x524379-0x0;var _0x497ac0=_0x623f[_0x524379];return _0x497ac0;};'use strict';var multer=require('multer');var util=require(_0xf623('0x0'));var path=require(_0xf623('0x1'));var timeout=require('connect-timeout');var express=require(_0xf623('0x2'));var router=express[_0xf623('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf623('0x4'));var config=require(_0xf623('0x5'));var controller=require(_0xf623('0x6'));router[_0xf623('0x7')]('/',auth[_0xf623('0x8')](),controller['index']);router[_0xf623('0x7')](_0xf623('0x9'),auth[_0xf623('0x8')](),controller[_0xf623('0xa')]);router[_0xf623('0x7')](_0xf623('0xb'),auth[_0xf623('0x8')](),controller[_0xf623('0xc')]);router[_0xf623('0x7')]('/:id/fields',auth[_0xf623('0x8')](),controller[_0xf623('0xd')]);router[_0xf623('0xe')]('/',auth['isAuthenticated'](),controller[_0xf623('0xf')]);router[_0xf623('0xe')]('/:id/configurations',auth[_0xf623('0x8')](),controller[_0xf623('0x10')]);router[_0xf623('0x11')]('/:id',auth[_0xf623('0x8')](),controller[_0xf623('0x12')]);router[_0xf623('0x13')](_0xf623('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf623('0x14')]=router;
\ No newline at end of file
+var _0x6455=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x49af24,_0x483d38){var _0x455345=function(_0xfadae2){while(--_0xfadae2){_0x49af24['push'](_0x49af24['shift']());}};_0x455345(++_0x483d38);}(_0x6455,0x1bb));var _0x5645=function(_0x3c0b91,_0x41b9ab){_0x3c0b91=_0x3c0b91-0x0;var _0xd0b383=_0x6455[_0x3c0b91];return _0xd0b383;};'use strict';var multer=require('multer');var util=require(_0x5645('0x0'));var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require(_0x5645('0x7'));var config=require(_0x5645('0x8'));var controller=require(_0x5645('0x9'));router[_0x5645('0xa')]('/',auth[_0x5645('0xb')](),controller[_0x5645('0xc')]);router[_0x5645('0xa')](_0x5645('0xd'),auth['isAuthenticated'](),controller[_0x5645('0xe')]);router[_0x5645('0xa')](_0x5645('0xf'),auth[_0x5645('0xb')](),controller[_0x5645('0x10')]);router[_0x5645('0xa')](_0x5645('0x11'),auth[_0x5645('0xb')](),controller[_0x5645('0x12')]);router[_0x5645('0x13')]('/',auth[_0x5645('0xb')](),controller[_0x5645('0x14')]);router[_0x5645('0x13')](_0x5645('0xf'),auth[_0x5645('0xb')](),controller[_0x5645('0x15')]);router['put'](_0x5645('0xd'),auth[_0x5645('0xb')](),controller[_0x5645('0x16')]);router[_0x5645('0x17')](_0x5645('0xd'),auth[_0x5645('0xb')](),controller['destroy']);module[_0x5645('0x18')]=router;
\ No newline at end of file
index e0b5985..c9925ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e9=['exports','STRING'];(function(_0x4d62eb,_0x113957){var _0x40d1b5=function(_0x508980){while(--_0x508980){_0x4d62eb['push'](_0x4d62eb['shift']());}};_0x40d1b5(++_0x113957);}(_0x99e9,0xb4));var _0x999e=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x99e9[_0x27638d];return _0x35da35;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}};
\ No newline at end of file
+var _0x2dae=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2dae,0xc3));var _0xe2da=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x2dae[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')]},'description':{'type':Sequelize[_0xe2da('0x1')]},'host':{'type':Sequelize[_0xe2da('0x1')]},'zone':{'type':Sequelize[_0xe2da('0x1')]},'clientId':{'type':Sequelize[_0xe2da('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe2da('0x1')]},'refreshToken':{'type':Sequelize[_0xe2da('0x1')]}};
\ No newline at end of file
index cd12592..a64636f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eca=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','ZohoAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','length','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','code','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Result','includes','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3eca,0x1db));var _0xa3ec=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x3eca[_0x5a7d5f];return _0x5dcded;};'use strict';var emlformat=require(_0xa3ec('0x0'));var rimraf=require(_0xa3ec('0x1'));var zipdir=require(_0xa3ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3ec('0x3'));var moment=require(_0xa3ec('0x4'));var BPromise=require(_0xa3ec('0x5'));var Mustache=require(_0xa3ec('0x6'));var util=require(_0xa3ec('0x7'));var path=require(_0xa3ec('0x8'));var sox=require(_0xa3ec('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ec('0xa'));var crypto=require(_0xa3ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa3ec('0xc'));var toCsv=require(_0xa3ec('0xd'));var querystring=require(_0xa3ec('0xe'));var Papa=require('papaparse');var Redis=require(_0xa3ec('0xf'));var authService=require(_0xa3ec('0x10'));var qs=require(_0xa3ec('0x11'));var as=require(_0xa3ec('0x12'));var hardwareService=require(_0xa3ec('0x13'));var logger=require('../../config/logger')(_0xa3ec('0x14'));var utils=require('../../config/utils');var config=require(_0xa3ec('0x15'));var licenseUtil=require(_0xa3ec('0x16'));var db=require(_0xa3ec('0x17'))['db'];var integrations=require(_0xa3ec('0x18'));function respondWithStatusCode(_0x1f1c36,_0x28211a){_0x28211a=_0x28211a||0xcc;return function(_0x48da34){if(_0x48da34){return _0x1f1c36[_0xa3ec('0x19')](_0x28211a);}return _0x1f1c36[_0xa3ec('0x1a')](_0x28211a)[_0xa3ec('0x1b')]();};}function respondWithResult(_0x106a9c,_0x54256b){_0x54256b=_0x54256b||0xc8;return function(_0x5b6bca){if(_0x5b6bca){return _0x106a9c[_0xa3ec('0x1a')](_0x54256b)[_0xa3ec('0x1c')](_0x5b6bca);}};}function respondWithFilteredResult(_0x106c69,_0x230ac9){return function(_0x4e14ef){if(_0x4e14ef){var _0x3b4ac7=typeof _0x230ac9[_0xa3ec('0x1d')]==='undefined'&&typeof _0x230ac9[_0xa3ec('0x1e')]===_0xa3ec('0x1f');var _0x1803f3=_0x4e14ef[_0xa3ec('0x20')];var _0x34cb43=_0x3b4ac7?0x0:_0x230ac9[_0xa3ec('0x1d')];var _0x1a8aa3=_0x3b4ac7?_0x4e14ef[_0xa3ec('0x20')]:_0x230ac9['offset']+_0x230ac9[_0xa3ec('0x1e')];var _0x456f7e;if(_0x1a8aa3>=_0x1803f3){_0x1a8aa3=_0x1803f3;_0x456f7e=0xc8;}else{_0x456f7e=0xce;}_0x106c69['status'](_0x456f7e);return _0x106c69[_0xa3ec('0x21')]('Content-Range',_0x34cb43+'-'+_0x1a8aa3+'/'+_0x1803f3)[_0xa3ec('0x1c')](_0x4e14ef);}return null;};}function patchUpdates(_0xca0e32){return function(_0x349f96){try{jsonpatch[_0xa3ec('0x22')](_0x349f96,_0xca0e32,!![]);}catch(_0x1edc92){return BPromise[_0xa3ec('0x23')](_0x1edc92);}return _0x349f96[_0xa3ec('0x24')]();};}function saveUpdates(_0x467781,_0x3ae1fb){return function(_0x4c73b8){if(_0x4c73b8){return _0x4c73b8[_0xa3ec('0x25')](_0x467781)[_0xa3ec('0x26')](function(_0x58090d){return _0x58090d;});}return null;};}function removeEntity(_0x3bbc04,_0x3bf8d9){return function(_0x3333fd){if(_0x3333fd){return _0x3333fd[_0xa3ec('0x27')]()[_0xa3ec('0x26')](function(){_0x3bbc04['status'](0xcc)[_0xa3ec('0x1b')]();});}};}function handleEntityNotFound(_0x57a358,_0x35beaa){return function(_0x5d7ce2){if(!_0x5d7ce2){_0x57a358['sendStatus'](0x194);}return _0x5d7ce2;};}function handleError(_0x3dfd7a,_0x25b3a5){_0x25b3a5=_0x25b3a5||0x1f4;return function(_0x27c1cb){logger[_0xa3ec('0x28')](_0x27c1cb[_0xa3ec('0x29')]);if(_0x27c1cb[_0xa3ec('0x2a')]){delete _0x27c1cb['name'];}_0x3dfd7a['status'](_0x25b3a5)[_0xa3ec('0x2b')](_0x27c1cb);};}exports['index']=function(_0x4ee9b0,_0x3de7e4){var _0x22f3ee={},_0x51957b={},_0x7f3702={'count':0x0,'rows':[]};var _0x20dd6f=_['map'](db[_0xa3ec('0x2c')][_0xa3ec('0x2d')],function(_0x47f389){return{'name':_0x47f389['fieldName'],'type':_0x47f389[_0xa3ec('0x2e')]['key']};});_0x51957b[_0xa3ec('0x2f')]=_['map'](_0x20dd6f,_0xa3ec('0x2a'));_0x51957b[_0xa3ec('0x30')]=_[_0xa3ec('0x31')](_0x4ee9b0['query']);_0x51957b[_0xa3ec('0x32')]=_[_0xa3ec('0x33')](_0x51957b[_0xa3ec('0x2f')],_0x51957b[_0xa3ec('0x30')]);_0x22f3ee[_0xa3ec('0x34')]=_[_0xa3ec('0x33')](_0x51957b['model'],qs[_0xa3ec('0x35')](_0x4ee9b0[_0xa3ec('0x30')][_0xa3ec('0x35')]));_0x22f3ee[_0xa3ec('0x34')]=_0x22f3ee[_0xa3ec('0x34')]['length']?_0x22f3ee[_0xa3ec('0x34')]:_0x51957b['model'];if(!_0x4ee9b0['query']['hasOwnProperty'](_0xa3ec('0x36'))){_0x22f3ee[_0xa3ec('0x1e')]=qs[_0xa3ec('0x1e')](_0x4ee9b0[_0xa3ec('0x30')][_0xa3ec('0x1e')]);_0x22f3ee['offset']=qs[_0xa3ec('0x1d')](_0x4ee9b0[_0xa3ec('0x30')][_0xa3ec('0x1d')]);}_0x22f3ee[_0xa3ec('0x37')]=qs[_0xa3ec('0x38')](_0x4ee9b0[_0xa3ec('0x30')]['sort']);_0x22f3ee[_0xa3ec('0x39')]=qs['filters'](_[_0xa3ec('0x3a')](_0x4ee9b0[_0xa3ec('0x30')],_0x51957b[_0xa3ec('0x32')]),_0x20dd6f);if(_0x4ee9b0[_0xa3ec('0x30')][_0xa3ec('0x3b')]){_0x22f3ee[_0xa3ec('0x39')]=_[_0xa3ec('0x3c')](_0x22f3ee[_0xa3ec('0x39')],{'$or':_[_0xa3ec('0x3d')](_0x20dd6f,function(_0xf0dbb){if(_0xf0dbb[_0xa3ec('0x2e')]!=='VIRTUAL'){var _0x6dfe11={};_0x6dfe11[_0xf0dbb['name']]={'$like':'%'+_0x4ee9b0[_0xa3ec('0x30')]['filter']+'%'};return _0x6dfe11;}})});}_0x22f3ee=_[_0xa3ec('0x3c')]({},_0x22f3ee,_0x4ee9b0[_0xa3ec('0x3e')]);var _0x1300fc={'where':_0x22f3ee[_0xa3ec('0x39')]};return db[_0xa3ec('0x2c')][_0xa3ec('0x20')](_0x1300fc)[_0xa3ec('0x26')](function(_0x411a5b){_0x7f3702[_0xa3ec('0x20')]=_0x411a5b;if(_0x4ee9b0[_0xa3ec('0x30')][_0xa3ec('0x3f')]){_0x22f3ee[_0xa3ec('0x40')]=[{'all':!![]}];}return db['ZohoAccount'][_0xa3ec('0x41')](_0x22f3ee);})[_0xa3ec('0x26')](function(_0xd2ee9b){_0x7f3702[_0xa3ec('0x42')]=_0xd2ee9b;return _0x7f3702;})[_0xa3ec('0x26')](respondWithFilteredResult(_0x3de7e4,_0x22f3ee))[_0xa3ec('0x43')](handleError(_0x3de7e4,null));};exports[_0xa3ec('0x44')]=function(_0x388595,_0x3dab60){var _0x5d24f6={'raw':![],'where':{'id':_0x388595[_0xa3ec('0x45')]['id']}},_0x30a92e={};_0x30a92e[_0xa3ec('0x2f')]=_['keys'](db[_0xa3ec('0x2c')][_0xa3ec('0x2d')]);_0x30a92e[_0xa3ec('0x30')]=_[_0xa3ec('0x31')](_0x388595[_0xa3ec('0x30')]);_0x30a92e[_0xa3ec('0x32')]=_['intersection'](_0x30a92e[_0xa3ec('0x2f')],_0x30a92e[_0xa3ec('0x30')]);_0x5d24f6[_0xa3ec('0x34')]=_['intersection'](_0x30a92e['model'],qs[_0xa3ec('0x35')](_0x388595['query'][_0xa3ec('0x35')]));_0x5d24f6[_0xa3ec('0x34')]=_0x5d24f6['attributes'][_0xa3ec('0x46')]?_0x5d24f6[_0xa3ec('0x34')]:_0x30a92e['model'];if(_0x388595['query'][_0xa3ec('0x3f')]){_0x5d24f6[_0xa3ec('0x40')]=[{'all':!![]}];}_0x5d24f6=_['merge']({},_0x5d24f6,_0x388595[_0xa3ec('0x3e')]);return db[_0xa3ec('0x2c')]['find'](_0x5d24f6)['then'](handleEntityNotFound(_0x3dab60,null))[_0xa3ec('0x26')](respondWithResult(_0x3dab60,null))[_0xa3ec('0x43')](handleError(_0x3dab60,null));};exports['create']=function(_0x5ac7ce,_0x2b3bdb){return db[_0xa3ec('0x2c')]['create'](_0x5ac7ce[_0xa3ec('0x47')],{})[_0xa3ec('0x26')](respondWithResult(_0x2b3bdb,0xc9))['catch'](handleError(_0x2b3bdb,null));};exports[_0xa3ec('0x25')]=function(_0x5479e6,_0x221ed2){if(_0x5479e6['body']['id']){delete _0x5479e6['body']['id'];}return db[_0xa3ec('0x2c')][_0xa3ec('0x48')]({'where':{'id':_0x5479e6['params']['id']}})['then'](handleEntityNotFound(_0x221ed2,null))[_0xa3ec('0x26')](saveUpdates(_0x5479e6['body'],null))[_0xa3ec('0x26')](respondWithResult(_0x221ed2,null))['catch'](handleError(_0x221ed2,null));};exports[_0xa3ec('0x27')]=function(_0x17360a,_0x4dc800){return db[_0xa3ec('0x2c')][_0xa3ec('0x48')]({'where':{'id':_0x17360a['params']['id']}})[_0xa3ec('0x26')](handleEntityNotFound(_0x4dc800,null))['then'](removeEntity(_0x4dc800,null))[_0xa3ec('0x43')](handleError(_0x4dc800,null));};exports[_0xa3ec('0x49')]=function(_0x374088,_0x592abe,_0xa8d331){var _0x2cad78={};var _0x268f1c={};var _0x427e9f;var _0x4710bd;return db[_0xa3ec('0x2c')][_0xa3ec('0x4a')]({'where':{'id':_0x374088[_0xa3ec('0x45')]['id']}})[_0xa3ec('0x26')](handleEntityNotFound(_0x592abe,null))[_0xa3ec('0x26')](function(_0x4045d4){if(_0x4045d4){_0x427e9f=_0x4045d4;_0x268f1c['model']=_[_0xa3ec('0x31')](db['ZohoConfiguration'][_0xa3ec('0x2d')]);_0x268f1c[_0xa3ec('0x30')]=_[_0xa3ec('0x31')](_0x374088[_0xa3ec('0x30')]);_0x268f1c[_0xa3ec('0x32')]=_['intersection'](_0x268f1c[_0xa3ec('0x2f')],_0x268f1c['query']);_0x2cad78[_0xa3ec('0x34')]=_['intersection'](_0x268f1c[_0xa3ec('0x2f')],qs['fields'](_0x374088[_0xa3ec('0x30')][_0xa3ec('0x35')]));_0x2cad78[_0xa3ec('0x34')]=_0x2cad78[_0xa3ec('0x34')]['length']?_0x2cad78[_0xa3ec('0x34')]:_0x268f1c['model'];_0x2cad78[_0xa3ec('0x37')]=qs[_0xa3ec('0x38')](_0x374088['query'][_0xa3ec('0x38')]);_0x2cad78[_0xa3ec('0x39')]=qs[_0xa3ec('0x32')](_[_0xa3ec('0x3a')](_0x374088[_0xa3ec('0x30')],_0x268f1c['filters']));if(_0x374088[_0xa3ec('0x30')][_0xa3ec('0x3b')]){_0x2cad78[_0xa3ec('0x39')]=_[_0xa3ec('0x3c')](_0x2cad78[_0xa3ec('0x39')],{'$or':_[_0xa3ec('0x3d')](_0x2cad78[_0xa3ec('0x34')],function(_0x3c44ba){var _0x3ceb34={};_0x3ceb34[_0x3c44ba]={'$like':'%'+_0x374088['query'][_0xa3ec('0x3b')]+'%'};return _0x3ceb34;})});}_0x2cad78=_['merge']({},_0x2cad78,_0x374088['options']);return _0x427e9f[_0xa3ec('0x49')](_0x2cad78);}})[_0xa3ec('0x26')](function(_0x427aca){if(_0x427aca){_0x4710bd=_0x427aca[_0xa3ec('0x46')];if(!_0x374088[_0xa3ec('0x30')][_0xa3ec('0x4b')]('nolimit')){_0x2cad78[_0xa3ec('0x1e')]=qs[_0xa3ec('0x1e')](_0x374088[_0xa3ec('0x30')]['limit']);_0x2cad78[_0xa3ec('0x1d')]=qs[_0xa3ec('0x1d')](_0x374088[_0xa3ec('0x30')][_0xa3ec('0x1d')]);}return _0x427e9f[_0xa3ec('0x49')](_0x2cad78);}})[_0xa3ec('0x26')](function(_0x311569){if(_0x311569){return _0x311569?{'count':_0x4710bd,'rows':_0x311569}:null;}})[_0xa3ec('0x26')](respondWithResult(_0x592abe,null))[_0xa3ec('0x43')](handleError(_0x592abe,null));};exports[_0xa3ec('0x4c')]=function(_0x32aeca,_0x4c9818,_0x13ed38){if(_0x32aeca[_0xa3ec('0x47')]['id']){delete _0x32aeca[_0xa3ec('0x47')]['id'];}return db[_0xa3ec('0x2c')]['findOne']({'where':{'id':_0x32aeca[_0xa3ec('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c9818,null))[_0xa3ec('0x26')](function(_0x303a64){if(_0x303a64){_0x32aeca[_0xa3ec('0x47')][_0xa3ec('0x4d')]=_0x303a64['id'];_0x32aeca[_0xa3ec('0x47')][_0xa3ec('0x4e')]=integrations[_0xa3ec('0x4f')](_0x32aeca['body'][_0xa3ec('0x50')],_0x32aeca['body'][_0xa3ec('0x2e')]);_0x32aeca['body'][_0xa3ec('0x51')]=integrations[_0xa3ec('0x52')](_0x32aeca[_0xa3ec('0x47')][_0xa3ec('0x50')],_0x32aeca['body'][_0xa3ec('0x2e')]);return db[_0xa3ec('0x53')]['create'](_0x32aeca[_0xa3ec('0x47')],{'include':[{'model':db[_0xa3ec('0x54')],'as':_0xa3ec('0x4e')},{'model':db['ZohoField'],'as':_0xa3ec('0x51')}]});}return null;})[_0xa3ec('0x26')](respondWithResult(_0x4c9818,null))[_0xa3ec('0x43')](handleError(_0x4c9818,null));};function getAccessToken(_0x5827dd){return new Promise(function(_0x209ee7,_0x135b5b){var _0x541a55;switch(_0x5827dd[_0xa3ec('0x55')]){case'US':_0x541a55=_0xa3ec('0x56');break;case'AU':_0x541a55=_0xa3ec('0x57');break;case'EU':_0x541a55='https://accounts.zoho.eu';break;case'IN':_0x541a55=_0xa3ec('0x58');break;case'CN':_0x541a55='https://accounts.zoho.com.cn';break;default:_0x541a55='https://accounts.zoho.eu';break;}var _0x14b06f={'method':'POST','uri':_0x541a55+_0xa3ec('0x59'),'qs':{'refresh_token':_0x5827dd[_0xa3ec('0x5a')],'client_id':_0x5827dd[_0xa3ec('0x5b')],'client_secret':_0x5827dd['clientSecret'],'grant_type':_0xa3ec('0x5c')},'json':!![]};return rp(_0x14b06f)['then'](function(_0x219aa5){if(_0x219aa5['access_token']){_0x209ee7(_0x219aa5['access_token']);}else{_0x135b5b(_0xa3ec('0x5d'));}})['catch'](function(_0x3d322e){_0x135b5b(_0x3d322e);});});}exports[_0xa3ec('0x5e')]=function(_0x31c3a6,_0x238eff,_0x3c6f17){var _0x39c101,_0x48ee44,_0x1f9f82,_0x36ec01,_0x24c149;return db[_0xa3ec('0x2c')][_0xa3ec('0x4a')]({'where':{'id':_0x31c3a6['params']['id']},'attributes':['id',_0xa3ec('0x5f'),_0xa3ec('0x55'),'clientId',_0xa3ec('0x60'),_0xa3ec('0x61'),_0xa3ec('0x62'),_0xa3ec('0x5a')]})['then'](handleEntityNotFound(_0x238eff,null))[_0xa3ec('0x26')](function(_0x5269f2){_0x24c149=_0x5269f2;_0x39c101=_0x24c149[_0xa3ec('0x5f')];_0x48ee44=_0x39c101===_0xa3ec('0x63')?'eu':'com';_0x1f9f82=_0x24c149['serverUrl'];var _0x26b642=_0x1f9f82[_0xa3ec('0x64')](-0x1);if(_0x26b642==='/'||_0x26b642==='\x5c'||_0x26b642===':'){_0x1f9f82=_0x1f9f82[_0xa3ec('0x65')](0x0,_0x1f9f82['lastIndexOf'](_0x26b642));}if(!_0x24c149[_0xa3ec('0x5a')]){throw new Error(_0xa3ec('0x66'));}return getAccessToken(_0x24c149);})[_0xa3ec('0x26')](function(_0x3d8fb4){if(_0x3d8fb4){return rp({'method':_0xa3ec('0x67'),'uri':util[_0xa3ec('0x68')](_0xa3ec('0x69'),_0x48ee44),'qs':{'module':'Calls'},'headers':{'Authorization':_0xa3ec('0x6a')+_0x3d8fb4},'json':!![]});}})[_0xa3ec('0x26')](function(_0x28c918){if(_0x28c918){if(_0x28c918[_0xa3ec('0x6b')]&&_0x28c918['response']['error']){throw new Error(_0x28c918[_0xa3ec('0x6b')][_0xa3ec('0x28')][_0xa3ec('0x6c')]);}var _0x3f73ea=[];var _0x78b87=[];var _0x2d0ac2=[_0xa3ec('0x6d'),'Subject',_0xa3ec('0x6e'),_0xa3ec('0x6f'),'Call_Duration',_0xa3ec('0x70'),'Call_Start_Time','Call_Type'];_0x78b87=_['remove'](_0x28c918[_0xa3ec('0x35')],function(_0x1fde8c){return _0x2d0ac2[_0xa3ec('0x71')](_0x1fde8c[_0xa3ec('0x72')]);});for(var _0x1b56c7=0x0;_0x1b56c7<_0x78b87[_0xa3ec('0x46')];_0x1b56c7++){if(_0x78b87[_0x1b56c7][_0xa3ec('0x73')]===![]){_0x3f73ea['push']({'id':_0x78b87[_0x1b56c7]['id'],'name':_0x78b87[_0x1b56c7]['display_label'],'custom':_0x78b87[_0x1b56c7][_0xa3ec('0x74')],'options':_0x78b87[_0x1b56c7][_0xa3ec('0x75')]===_0xa3ec('0x76')&&_0x78b87[_0x1b56c7][_0xa3ec('0x77')][_0xa3ec('0x46')]>-0x1?_[_0xa3ec('0x3d')](_0x78b87[_0x1b56c7][_0xa3ec('0x77')],function(_0x1c7f30){return{'name':_0x1c7f30,'value':_0x1c7f30};}):[]});}}return{'count':_0x3f73ea['length'],'rows':_0x3f73ea};}else{return{'count':0x0,'rows':[]};}})[_0xa3ec('0x26')](respondWithResult(_0x238eff,null))[_0xa3ec('0x43')](function(_0x471c38){var _0x4b878b=_0x31c3a6[_0xa3ec('0x30')]['test']?0x1f4:_0x471c38['statusCode']||0x1f4;logger[_0xa3ec('0x28')](_0xa3ec('0x78'),'getFields',_0x4b878b,JSON[_0xa3ec('0x79')](_0x471c38));delete _0x471c38[_0xa3ec('0x2a')];if(_0x4b878b===0x191){_0x4b878b=0x190;}_0x238eff[_0xa3ec('0x1a')](_0x4b878b)[_0xa3ec('0x2b')](_0x31c3a6['query'][_0xa3ec('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x471c38[_0xa3ec('0x7b')]}:_0x471c38);});};
\ No newline at end of file
+var _0x56fd=['map','ZohoAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','length','find','body','update','params','catch','getConfigurations','findOne','ZohoConfiguration','order','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','create','ZohoField','Subjects','zone','https://accounts.zoho.com.au','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','code','com','serverUrl','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send'];(function(_0x544462,_0x2b87cf){var _0x376e4a=function(_0x5bd5e4){while(--_0x5bd5e4){_0x544462['push'](_0x544462['shift']());}};_0x376e4a(++_0x2b87cf);}(_0x56fd,0x1d7));var _0xd56f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56fd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd56f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd56f('0x1'));var jsonpatch=require(_0xd56f('0x2'));var rp=require(_0xd56f('0x3'));var moment=require(_0xd56f('0x4'));var BPromise=require(_0xd56f('0x5'));var Mustache=require(_0xd56f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd56f('0x7'));var csv=require(_0xd56f('0x8'));var ejs=require(_0xd56f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd56f('0xa'));var squel=require(_0xd56f('0xb'));var crypto=require(_0xd56f('0xc'));var jsforce=require(_0xd56f('0xd'));var deskjs=require(_0xd56f('0xe'));var toCsv=require(_0xd56f('0x8'));var querystring=require(_0xd56f('0xf'));var Papa=require('papaparse');var Redis=require(_0xd56f('0x10'));var authService=require(_0xd56f('0x11'));var qs=require(_0xd56f('0x12'));var as=require(_0xd56f('0x13'));var hardwareService=require(_0xd56f('0x14'));var logger=require('../../config/logger')(_0xd56f('0x15'));var utils=require('../../config/utils');var config=require(_0xd56f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd56f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x31ef73,_0x3b21ff){_0x3b21ff=_0x3b21ff||0xcc;return function(_0x3d848b){if(_0x3d848b){return _0x31ef73['sendStatus'](_0x3b21ff);}return _0x31ef73[_0xd56f('0x18')](_0x3b21ff)[_0xd56f('0x19')]();};}function respondWithResult(_0x21f8ac,_0x178fa7){_0x178fa7=_0x178fa7||0xc8;return function(_0x2a51eb){if(_0x2a51eb){return _0x21f8ac[_0xd56f('0x18')](_0x178fa7)[_0xd56f('0x1a')](_0x2a51eb);}};}function respondWithFilteredResult(_0x1d353e,_0x3e8e53){return function(_0x195f94){if(_0x195f94){var _0x5959ec=typeof _0x3e8e53[_0xd56f('0x1b')]===_0xd56f('0x1c')&&typeof _0x3e8e53[_0xd56f('0x1d')]===_0xd56f('0x1c');var _0x56b703=_0x195f94[_0xd56f('0x1e')];var _0x6152a1=_0x5959ec?0x0:_0x3e8e53[_0xd56f('0x1b')];var _0x26e343=_0x5959ec?_0x195f94[_0xd56f('0x1e')]:_0x3e8e53[_0xd56f('0x1b')]+_0x3e8e53[_0xd56f('0x1d')];var _0x16c7d6;if(_0x26e343>=_0x56b703){_0x26e343=_0x56b703;_0x16c7d6=0xc8;}else{_0x16c7d6=0xce;}_0x1d353e['status'](_0x16c7d6);return _0x1d353e['set'](_0xd56f('0x1f'),_0x6152a1+'-'+_0x26e343+'/'+_0x56b703)[_0xd56f('0x1a')](_0x195f94);}return null;};}function patchUpdates(_0x363941){return function(_0x4aabd8){try{jsonpatch[_0xd56f('0x20')](_0x4aabd8,_0x363941,!![]);}catch(_0x5661ca){return BPromise['reject'](_0x5661ca);}return _0x4aabd8[_0xd56f('0x21')]();};}function saveUpdates(_0x376f9c,_0x23cfb8){return function(_0x31cfcb){if(_0x31cfcb){return _0x31cfcb['update'](_0x376f9c)['then'](function(_0x110721){return _0x110721;});}return null;};}function removeEntity(_0x39d5e2,_0xb6d3ef){return function(_0x303eca){if(_0x303eca){return _0x303eca[_0xd56f('0x22')]()[_0xd56f('0x23')](function(){_0x39d5e2[_0xd56f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18847c,_0x2fcfd4){return function(_0x2e9478){if(!_0x2e9478){_0x18847c[_0xd56f('0x24')](0x194);}return _0x2e9478;};}function handleError(_0xb49867,_0x19bd28){_0x19bd28=_0x19bd28||0x1f4;return function(_0x9c4111){logger[_0xd56f('0x25')](_0x9c4111[_0xd56f('0x26')]);if(_0x9c4111[_0xd56f('0x27')]){delete _0x9c4111[_0xd56f('0x27')];}_0xb49867[_0xd56f('0x18')](_0x19bd28)[_0xd56f('0x28')](_0x9c4111);};}exports['index']=function(_0x53e521,_0x4014df){var _0x1c0cc9={},_0x11b996={},_0x445e12={'count':0x0,'rows':[]};var _0x4a2497=_[_0xd56f('0x29')](db[_0xd56f('0x2a')][_0xd56f('0x2b')],function(_0x28ddb5){return{'name':_0x28ddb5['fieldName'],'type':_0x28ddb5[_0xd56f('0x2c')][_0xd56f('0x2d')]};});_0x11b996[_0xd56f('0x2e')]=_[_0xd56f('0x29')](_0x4a2497,_0xd56f('0x27'));_0x11b996[_0xd56f('0x2f')]=_[_0xd56f('0x30')](_0x53e521[_0xd56f('0x2f')]);_0x11b996['filters']=_[_0xd56f('0x31')](_0x11b996[_0xd56f('0x2e')],_0x11b996['query']);_0x1c0cc9[_0xd56f('0x32')]=_['intersection'](_0x11b996[_0xd56f('0x2e')],qs[_0xd56f('0x33')](_0x53e521[_0xd56f('0x2f')][_0xd56f('0x33')]));_0x1c0cc9[_0xd56f('0x32')]=_0x1c0cc9[_0xd56f('0x32')]['length']?_0x1c0cc9['attributes']:_0x11b996[_0xd56f('0x2e')];if(!_0x53e521['query'][_0xd56f('0x34')]('nolimit')){_0x1c0cc9['limit']=qs[_0xd56f('0x1d')](_0x53e521['query'][_0xd56f('0x1d')]);_0x1c0cc9[_0xd56f('0x1b')]=qs[_0xd56f('0x1b')](_0x53e521[_0xd56f('0x2f')]['offset']);}_0x1c0cc9['order']=qs[_0xd56f('0x35')](_0x53e521[_0xd56f('0x2f')][_0xd56f('0x35')]);_0x1c0cc9[_0xd56f('0x36')]=qs[_0xd56f('0x37')](_[_0xd56f('0x38')](_0x53e521[_0xd56f('0x2f')],_0x11b996['filters']),_0x4a2497);if(_0x53e521['query']['filter']){_0x1c0cc9[_0xd56f('0x36')]=_[_0xd56f('0x39')](_0x1c0cc9['where'],{'$or':_[_0xd56f('0x29')](_0x4a2497,function(_0xaa47aa){if(_0xaa47aa['type']!==_0xd56f('0x3a')){var _0x52a1c8={};_0x52a1c8[_0xaa47aa['name']]={'$like':'%'+_0x53e521['query'][_0xd56f('0x3b')]+'%'};return _0x52a1c8;}})});}_0x1c0cc9=_[_0xd56f('0x39')]({},_0x1c0cc9,_0x53e521['options']);var _0x23b001={'where':_0x1c0cc9[_0xd56f('0x36')]};return db['ZohoAccount'][_0xd56f('0x1e')](_0x23b001)[_0xd56f('0x23')](function(_0x12f370){_0x445e12[_0xd56f('0x1e')]=_0x12f370;if(_0x53e521['query'][_0xd56f('0x3c')]){_0x1c0cc9[_0xd56f('0x3d')]=[{'all':!![]}];}return db[_0xd56f('0x2a')][_0xd56f('0x3e')](_0x1c0cc9);})['then'](function(_0x1a816a){_0x445e12[_0xd56f('0x3f')]=_0x1a816a;return _0x445e12;})[_0xd56f('0x23')](respondWithFilteredResult(_0x4014df,_0x1c0cc9))['catch'](handleError(_0x4014df,null));};exports[_0xd56f('0x40')]=function(_0x50b8d3,_0x13d033){var _0x456b44={'raw':![],'where':{'id':_0x50b8d3['params']['id']}},_0x4f26df={};_0x4f26df[_0xd56f('0x2e')]=_[_0xd56f('0x30')](db[_0xd56f('0x2a')][_0xd56f('0x2b')]);_0x4f26df['query']=_['keys'](_0x50b8d3[_0xd56f('0x2f')]);_0x4f26df[_0xd56f('0x37')]=_[_0xd56f('0x31')](_0x4f26df['model'],_0x4f26df['query']);_0x456b44['attributes']=_['intersection'](_0x4f26df['model'],qs[_0xd56f('0x33')](_0x50b8d3[_0xd56f('0x2f')]['fields']));_0x456b44[_0xd56f('0x32')]=_0x456b44[_0xd56f('0x32')][_0xd56f('0x41')]?_0x456b44[_0xd56f('0x32')]:_0x4f26df['model'];if(_0x50b8d3[_0xd56f('0x2f')][_0xd56f('0x3c')]){_0x456b44[_0xd56f('0x3d')]=[{'all':!![]}];}_0x456b44=_[_0xd56f('0x39')]({},_0x456b44,_0x50b8d3['options']);return db['ZohoAccount'][_0xd56f('0x42')](_0x456b44)['then'](handleEntityNotFound(_0x13d033,null))['then'](respondWithResult(_0x13d033,null))['catch'](handleError(_0x13d033,null));};exports['create']=function(_0x1a2435,_0x315b7f){return db['ZohoAccount']['create'](_0x1a2435[_0xd56f('0x43')],{})[_0xd56f('0x23')](respondWithResult(_0x315b7f,0xc9))['catch'](handleError(_0x315b7f,null));};exports[_0xd56f('0x44')]=function(_0x322f18,_0x49f2ef){if(_0x322f18[_0xd56f('0x43')]['id']){delete _0x322f18['body']['id'];}return db[_0xd56f('0x2a')][_0xd56f('0x42')]({'where':{'id':_0x322f18[_0xd56f('0x45')]['id']}})[_0xd56f('0x23')](handleEntityNotFound(_0x49f2ef,null))['then'](saveUpdates(_0x322f18[_0xd56f('0x43')],null))['then'](respondWithResult(_0x49f2ef,null))[_0xd56f('0x46')](handleError(_0x49f2ef,null));};exports['destroy']=function(_0x300597,_0x4337ad){return db[_0xd56f('0x2a')][_0xd56f('0x42')]({'where':{'id':_0x300597[_0xd56f('0x45')]['id']}})[_0xd56f('0x23')](handleEntityNotFound(_0x4337ad,null))[_0xd56f('0x23')](removeEntity(_0x4337ad,null))['catch'](handleError(_0x4337ad,null));};exports[_0xd56f('0x47')]=function(_0x5768e9,_0x41da04,_0x8382de){var _0x198f29={};var _0x50df8a={};var _0x245414;var _0x32b9a3;return db[_0xd56f('0x2a')][_0xd56f('0x48')]({'where':{'id':_0x5768e9[_0xd56f('0x45')]['id']}})[_0xd56f('0x23')](handleEntityNotFound(_0x41da04,null))['then'](function(_0x33e306){if(_0x33e306){_0x245414=_0x33e306;_0x50df8a[_0xd56f('0x2e')]=_['keys'](db[_0xd56f('0x49')]['rawAttributes']);_0x50df8a[_0xd56f('0x2f')]=_['keys'](_0x5768e9[_0xd56f('0x2f')]);_0x50df8a['filters']=_[_0xd56f('0x31')](_0x50df8a[_0xd56f('0x2e')],_0x50df8a['query']);_0x198f29[_0xd56f('0x32')]=_['intersection'](_0x50df8a['model'],qs[_0xd56f('0x33')](_0x5768e9[_0xd56f('0x2f')]['fields']));_0x198f29['attributes']=_0x198f29[_0xd56f('0x32')][_0xd56f('0x41')]?_0x198f29[_0xd56f('0x32')]:_0x50df8a['model'];_0x198f29[_0xd56f('0x4a')]=qs[_0xd56f('0x35')](_0x5768e9[_0xd56f('0x2f')]['sort']);_0x198f29[_0xd56f('0x36')]=qs[_0xd56f('0x37')](_['pick'](_0x5768e9[_0xd56f('0x2f')],_0x50df8a[_0xd56f('0x37')]));if(_0x5768e9[_0xd56f('0x2f')][_0xd56f('0x3b')]){_0x198f29['where']=_['merge'](_0x198f29[_0xd56f('0x36')],{'$or':_[_0xd56f('0x29')](_0x198f29['attributes'],function(_0x2b1fe3){var _0x5592dd={};_0x5592dd[_0x2b1fe3]={'$like':'%'+_0x5768e9['query']['filter']+'%'};return _0x5592dd;})});}_0x198f29=_[_0xd56f('0x39')]({},_0x198f29,_0x5768e9['options']);return _0x245414[_0xd56f('0x47')](_0x198f29);}})[_0xd56f('0x23')](function(_0x4d634c){if(_0x4d634c){_0x32b9a3=_0x4d634c[_0xd56f('0x41')];if(!_0x5768e9[_0xd56f('0x2f')]['hasOwnProperty'](_0xd56f('0x4b'))){_0x198f29[_0xd56f('0x1d')]=qs[_0xd56f('0x1d')](_0x5768e9[_0xd56f('0x2f')]['limit']);_0x198f29[_0xd56f('0x1b')]=qs['offset'](_0x5768e9[_0xd56f('0x2f')][_0xd56f('0x1b')]);}return _0x245414[_0xd56f('0x47')](_0x198f29);}})[_0xd56f('0x23')](function(_0x5058e6){if(_0x5058e6){return _0x5058e6?{'count':_0x32b9a3,'rows':_0x5058e6}:null;}})[_0xd56f('0x23')](respondWithResult(_0x41da04,null))[_0xd56f('0x46')](handleError(_0x41da04,null));};exports[_0xd56f('0x4c')]=function(_0x28bb61,_0x4c6003,_0x5a39f5){if(_0x28bb61[_0xd56f('0x43')]['id']){delete _0x28bb61[_0xd56f('0x43')]['id'];}return db[_0xd56f('0x2a')][_0xd56f('0x48')]({'where':{'id':_0x28bb61[_0xd56f('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c6003,null))['then'](function(_0x3b9952){if(_0x3b9952){_0x28bb61[_0xd56f('0x43')]['AccountId']=_0x3b9952['id'];_0x28bb61[_0xd56f('0x43')]['Subjects']=integrations[_0xd56f('0x4d')](_0x28bb61[_0xd56f('0x43')][_0xd56f('0x4e')],_0x28bb61[_0xd56f('0x43')][_0xd56f('0x2c')]);_0x28bb61[_0xd56f('0x43')][_0xd56f('0x4f')]=integrations[_0xd56f('0x50')](_0x28bb61[_0xd56f('0x43')]['channel'],_0x28bb61[_0xd56f('0x43')][_0xd56f('0x2c')]);return db[_0xd56f('0x49')][_0xd56f('0x51')](_0x28bb61[_0xd56f('0x43')],{'include':[{'model':db[_0xd56f('0x52')],'as':_0xd56f('0x53')},{'model':db[_0xd56f('0x52')],'as':_0xd56f('0x4f')}]});}return null;})[_0xd56f('0x23')](respondWithResult(_0x4c6003,null))[_0xd56f('0x46')](handleError(_0x4c6003,null));};function getAccessToken(_0x3862ed){return new Promise(function(_0x34edbe,_0x30f486){var _0x287d6e;switch(_0x3862ed[_0xd56f('0x54')]){case'US':_0x287d6e='https://accounts.zoho.com';break;case'AU':_0x287d6e=_0xd56f('0x55');break;case'EU':_0x287d6e=_0xd56f('0x56');break;case'IN':_0x287d6e=_0xd56f('0x57');break;case'CN':_0x287d6e=_0xd56f('0x58');break;default:_0x287d6e='https://accounts.zoho.eu';break;}var _0x482f7c={'method':_0xd56f('0x59'),'uri':_0x287d6e+_0xd56f('0x5a'),'qs':{'refresh_token':_0x3862ed[_0xd56f('0x5b')],'client_id':_0x3862ed[_0xd56f('0x5c')],'client_secret':_0x3862ed[_0xd56f('0x5d')],'grant_type':_0xd56f('0x5e')},'json':!![]};return rp(_0x482f7c)[_0xd56f('0x23')](function(_0x4b9b41){if(_0x4b9b41[_0xd56f('0x5f')]){_0x34edbe(_0x4b9b41[_0xd56f('0x5f')]);}else{_0x30f486(_0xd56f('0x60'));}})['catch'](function(_0x5e7aef){_0x30f486(_0x5e7aef);});});}exports['getFields']=function(_0x112855,_0x274b69,_0x30cb7a){var _0x41a0ee,_0x370d77,_0x55a9e1,_0xb9ce2c,_0x5ecc21;return db[_0xd56f('0x2a')][_0xd56f('0x48')]({'where':{'id':_0x112855[_0xd56f('0x45')]['id']},'attributes':['id','host',_0xd56f('0x54'),'clientId',_0xd56f('0x5d'),'serverUrl',_0xd56f('0x61'),_0xd56f('0x5b')]})['then'](handleEntityNotFound(_0x274b69,null))['then'](function(_0x557dca){_0x5ecc21=_0x557dca;_0x41a0ee=_0x5ecc21['host'];_0x370d77=_0x41a0ee==='zoho.eu'?'eu':_0xd56f('0x62');_0x55a9e1=_0x5ecc21[_0xd56f('0x63')];var _0xa7fd22=_0x55a9e1[_0xd56f('0x64')](-0x1);if(_0xa7fd22==='/'||_0xa7fd22==='\x5c'||_0xa7fd22===':'){_0x55a9e1=_0x55a9e1[_0xd56f('0x65')](0x0,_0x55a9e1['lastIndexOf'](_0xa7fd22));}if(!_0x5ecc21[_0xd56f('0x5b')]){throw new Error(_0xd56f('0x66'));}return getAccessToken(_0x5ecc21);})[_0xd56f('0x23')](function(_0x1345ee){if(_0x1345ee){return rp({'method':_0xd56f('0x67'),'uri':util['format'](_0xd56f('0x68'),_0x370d77),'qs':{'module':_0xd56f('0x69')},'headers':{'Authorization':_0xd56f('0x6a')+_0x1345ee},'json':!![]});}})[_0xd56f('0x23')](function(_0x8e07b8){if(_0x8e07b8){if(_0x8e07b8[_0xd56f('0x6b')]&&_0x8e07b8[_0xd56f('0x6b')][_0xd56f('0x25')]){throw new Error(_0x8e07b8[_0xd56f('0x6b')]['error'][_0xd56f('0x6c')]);}var _0x5de714=[];var _0x1ead5e=[];var _0x45f7d6=['Owner',_0xd56f('0x6d'),_0xd56f('0x6e'),_0xd56f('0x6f'),_0xd56f('0x70'),'Call_Result',_0xd56f('0x71'),_0xd56f('0x72')];_0x1ead5e=_[_0xd56f('0x73')](_0x8e07b8[_0xd56f('0x33')],function(_0x5870fe){return _0x45f7d6['includes'](_0x5870fe[_0xd56f('0x74')]);});for(var _0xfbdd34=0x0;_0xfbdd34<_0x1ead5e['length'];_0xfbdd34++){if(_0x1ead5e[_0xfbdd34][_0xd56f('0x75')]===![]){_0x5de714['push']({'id':_0x1ead5e[_0xfbdd34]['id'],'name':_0x1ead5e[_0xfbdd34][_0xd56f('0x76')],'custom':_0x1ead5e[_0xfbdd34][_0xd56f('0x77')],'options':_0x1ead5e[_0xfbdd34][_0xd56f('0x78')]===_0xd56f('0x79')&&_0x1ead5e[_0xfbdd34][_0xd56f('0x7a')][_0xd56f('0x41')]>-0x1?_[_0xd56f('0x29')](_0x1ead5e[_0xfbdd34][_0xd56f('0x7a')],function(_0xb23b7d){return{'name':_0xb23b7d,'value':_0xb23b7d};}):[]});}}return{'count':_0x5de714[_0xd56f('0x41')],'rows':_0x5de714};}else{return{'count':0x0,'rows':[]};}})[_0xd56f('0x23')](respondWithResult(_0x274b69,null))[_0xd56f('0x46')](function(_0x1ea4ad){var _0x523e47=_0x112855[_0xd56f('0x2f')]['test']?0x1f4:_0x1ea4ad[_0xd56f('0x7b')]||0x1f4;logger[_0xd56f('0x25')](_0xd56f('0x7c'),_0xd56f('0x7d'),_0x523e47,JSON[_0xd56f('0x7e')](_0x1ea4ad));delete _0x1ea4ad[_0xd56f('0x27')];if(_0x523e47===0x191){_0x523e47=0x190;}_0x274b69['status'](_0x523e47)[_0xd56f('0x28')](_0x112855[_0xd56f('0x2f')]['test']?{'message':_0xd56f('0x7f'),'statusCode':_0x1ea4ad[_0xd56f('0x7b')]}:_0x1ea4ad);});};
\ No newline at end of file
index 4269f84..c520e2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66b5=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','zone','host','substring','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','format','catch','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','then','parse','refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x66b5,0xb6));var _0x566b=function(_0x4ce887,_0x53fe95){_0x4ce887=_0x4ce887-0x0;var _0x127cd4=_0x66b5[_0x4ce887];return _0x127cd4;};'use strict';var _=require(_0x566b('0x0'));var util=require(_0x566b('0x1'));var logger=require(_0x566b('0x2'))(_0x566b('0x3'));var moment=require(_0x566b('0x4'));var BPromise=require('bluebird');var rp=require(_0x566b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x566b('0x6'));var attributes=require(_0x566b('0x7'));var integrations=require(_0x566b('0x8'));module[_0x566b('0x9')]=function(_0x25e731,_0x214675){return _0x25e731[_0x566b('0xa')](_0x566b('0xb'),attributes,{'tableName':_0x566b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e8c3f,_0x5ed4e4,_0x3bad1){if(_0x4e8c3f[_0x566b('0xd')]('zone')||_0x4e8c3f[_0x566b('0xd')](_0x566b('0xe'))||_0x4e8c3f[_0x566b('0xd')](_0x566b('0xf'))||_0x4e8c3f[_0x566b('0xd')](_0x566b('0x10'))||_0x4e8c3f['changed'](_0x566b('0x11'))||_0x4e8c3f[_0x566b('0xd')]('host')){var _0x4a2026,_0xbde3cd;_0x4a2026=_0x4e8c3f[_0x566b('0xe')];var _0x229aba=_0x4a2026[_0x566b('0x12')](-0x1);if(_0x229aba==='/'||_0x229aba==='\x5c'||_0x229aba===':'){_0x4a2026=_0x4a2026['substring'](0x0,_0x4a2026[_0x566b('0x13')](_0x229aba));}switch(_0x4e8c3f['zone']){case'US':_0xbde3cd=_0x566b('0x14');break;case'AU':_0xbde3cd=_0x566b('0x15');break;case'IN':_0xbde3cd='https://accounts.zoho.in';break;case'CN':_0xbde3cd=_0x566b('0x16');break;default:_0xbde3cd=_0x566b('0x17');break;}var _0x331592={'method':_0x566b('0x18'),'uri':_0xbde3cd+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x4e8c3f['clientId'],'client_secret':_0x4e8c3f['clientSecret'],'redirect_uri':_0x4e8c3f['serverUrl'],'code':_0x4e8c3f[_0x566b('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x331592)[_0x566b('0x19')](function(_0x498bbd){var _0xb512f8=JSON[_0x566b('0x1a')](_0x498bbd);if(_0xb512f8['refresh_token']){_0x4e8c3f[_0x566b('0x1b')]=_0xb512f8[_0x566b('0x1c')];logger[_0x566b('0x1d')](util['format'](_0x566b('0x1e'),_0x4e8c3f[_0x566b('0x1f')],_0x4e8c3f['id']));}else{logger[_0x566b('0x20')](util['format'](_0x566b('0x21'),_0x4e8c3f[_0x566b('0x1f')],_0x4e8c3f['id']),util[_0x566b('0x22')](_0xb512f8,{'showHidden':![],'depth':null}));}return _0x3bad1(null,_0x5ed4e4);})['catch'](function(_0x5719ac){logger[_0x566b('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4e8c3f[_0x566b('0x1f')],_0x4e8c3f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3bad1(_0x5719ac);});}else{return _0x3bad1(null,_0x5ed4e4);}},'beforeUpdate':function(_0x503c9e,_0x9cf258,_0x159ea6){if(_0x503c9e['changed'](_0x566b('0x23'))||_0x503c9e['changed']('serverUrl')||_0x503c9e[_0x566b('0xd')](_0x566b('0xf'))||_0x503c9e['changed'](_0x566b('0x10'))||_0x503c9e['changed'](_0x566b('0x11'))||_0x503c9e[_0x566b('0xd')](_0x566b('0x24'))){var _0x484ca0,_0x28e050;_0x484ca0=_0x503c9e['serverUrl'];var _0x3ed298=_0x484ca0[_0x566b('0x12')](-0x1);if(_0x3ed298==='/'||_0x3ed298==='\x5c'||_0x3ed298===':'){_0x484ca0=_0x484ca0[_0x566b('0x25')](0x0,_0x484ca0[_0x566b('0x13')](_0x3ed298));}switch(_0x503c9e['zone']){case'US':_0x28e050=_0x566b('0x14');break;case'AU':_0x28e050='https://accounts.zoho.com.au';break;case'IN':_0x28e050='https://accounts.zoho.in';break;case'CN':_0x28e050='https://accounts.zoho.com.cn';break;default:_0x28e050=_0x566b('0x17');break;}var _0xf79ee0={'method':_0x566b('0x18'),'uri':_0x28e050+_0x566b('0x26'),'form':{'grant_type':_0x566b('0x27'),'client_id':_0x503c9e['clientId'],'client_secret':_0x503c9e[_0x566b('0x10')],'redirect_uri':_0x503c9e[_0x566b('0xe')],'code':_0x503c9e['code']},'headers':{'Content-Type':_0x566b('0x28')}};return rp(_0xf79ee0)['then'](function(_0x41790b){var _0x380d0d=JSON[_0x566b('0x1a')](_0x41790b);if(_0x380d0d[_0x566b('0x1c')]){_0x503c9e[_0x566b('0x1b')]=_0x380d0d[_0x566b('0x1c')];logger[_0x566b('0x1d')](util['format'](_0x566b('0x1e'),_0x503c9e[_0x566b('0x1f')],_0x503c9e['id']));}else{logger['error'](util[_0x566b('0x29')](_0x566b('0x21'),_0x503c9e[_0x566b('0x1f')],_0x503c9e['id']),util[_0x566b('0x22')](_0x380d0d,{'showHidden':![],'depth':null}));}return _0x159ea6(null,_0x9cf258);})[_0x566b('0x2a')](function(_0x128892){logger[_0x566b('0x20')](util['format'](_0x566b('0x21'),_0x503c9e[_0x566b('0x1f')],_0x503c9e['id']),util[_0x566b('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x159ea6(_0x128892);});}else{return _0x159ea6(null,_0x9cf258);}}}});};
\ No newline at end of file
+var _0xf587=['int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','catch','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount'];(function(_0x511b38,_0x3731bf){var _0x205e91=function(_0x1d56e6){while(--_0x1d56e6){_0x511b38['push'](_0x511b38['shift']());}};_0x205e91(++_0x3731bf);}(_0xf587,0x9b));var _0x7f58=function(_0x389244,_0x5cc8c9){_0x389244=_0x389244-0x0;var _0x1a5434=_0xf587[_0x389244];return _0x1a5434;};'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'));var integrations=require(_0x7f58('0x9'));module[_0x7f58('0xa')]=function(_0x16f82d,_0x3adf53){return _0x16f82d[_0x7f58('0xb')](_0x7f58('0xc'),attributes,{'tableName':_0x7f58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x208cca,_0x5308fc,_0x36c812){if(_0x208cca[_0x7f58('0xe')](_0x7f58('0xf'))||_0x208cca[_0x7f58('0xe')](_0x7f58('0x10'))||_0x208cca[_0x7f58('0xe')](_0x7f58('0x11'))||_0x208cca[_0x7f58('0xe')](_0x7f58('0x12'))||_0x208cca[_0x7f58('0xe')](_0x7f58('0x13'))||_0x208cca[_0x7f58('0xe')](_0x7f58('0x14'))){var _0x1703ef,_0x46b70c;_0x1703ef=_0x208cca[_0x7f58('0x10')];var _0x63be4a=_0x1703ef['slice'](-0x1);if(_0x63be4a==='/'||_0x63be4a==='\x5c'||_0x63be4a===':'){_0x1703ef=_0x1703ef[_0x7f58('0x15')](0x0,_0x1703ef[_0x7f58('0x16')](_0x63be4a));}switch(_0x208cca[_0x7f58('0xf')]){case'US':_0x46b70c=_0x7f58('0x17');break;case'AU':_0x46b70c=_0x7f58('0x18');break;case'IN':_0x46b70c=_0x7f58('0x19');break;case'CN':_0x46b70c=_0x7f58('0x1a');break;default:_0x46b70c=_0x7f58('0x1b');break;}var _0x5f2076={'method':_0x7f58('0x1c'),'uri':_0x46b70c+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x208cca[_0x7f58('0x11')],'client_secret':_0x208cca[_0x7f58('0x12')],'redirect_uri':_0x208cca[_0x7f58('0x10')],'code':_0x208cca[_0x7f58('0x13')]},'headers':{'Content-Type':_0x7f58('0x1d')}};return rp(_0x5f2076)[_0x7f58('0x1e')](function(_0x4ebb6b){var _0x38df83=JSON[_0x7f58('0x1f')](_0x4ebb6b);if(_0x38df83['refresh_token']){_0x208cca[_0x7f58('0x20')]=_0x38df83[_0x7f58('0x21')];logger[_0x7f58('0x22')](util[_0x7f58('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x208cca[_0x7f58('0x24')],_0x208cca['id']));}else{logger[_0x7f58('0x25')](util[_0x7f58('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x208cca[_0x7f58('0x24')],_0x208cca['id']),util[_0x7f58('0x26')](_0x38df83,{'showHidden':![],'depth':null}));}return _0x36c812(null,_0x5308fc);})['catch'](function(_0x302ce3){logger['error'](util[_0x7f58('0x23')](_0x7f58('0x27'),_0x208cca[_0x7f58('0x24')],_0x208cca['id']),util[_0x7f58('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x36c812(_0x302ce3);});}else{return _0x36c812(null,_0x5308fc);}},'beforeUpdate':function(_0x70e46f,_0x158209,_0x1ff742){if(_0x70e46f[_0x7f58('0xe')](_0x7f58('0xf'))||_0x70e46f[_0x7f58('0xe')](_0x7f58('0x10'))||_0x70e46f['changed'](_0x7f58('0x11'))||_0x70e46f[_0x7f58('0xe')](_0x7f58('0x12'))||_0x70e46f[_0x7f58('0xe')](_0x7f58('0x13'))||_0x70e46f['changed'](_0x7f58('0x14'))){var _0x29a38e,_0x56b515;_0x29a38e=_0x70e46f[_0x7f58('0x10')];var _0x22e6c7=_0x29a38e[_0x7f58('0x28')](-0x1);if(_0x22e6c7==='/'||_0x22e6c7==='\x5c'||_0x22e6c7===':'){_0x29a38e=_0x29a38e[_0x7f58('0x15')](0x0,_0x29a38e['lastIndexOf'](_0x22e6c7));}switch(_0x70e46f['zone']){case'US':_0x56b515=_0x7f58('0x17');break;case'AU':_0x56b515=_0x7f58('0x18');break;case'IN':_0x56b515=_0x7f58('0x19');break;case'CN':_0x56b515='https://accounts.zoho.com.cn';break;default:_0x56b515='https://accounts.zoho.eu';break;}var _0x38717c={'method':'POST','uri':_0x56b515+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x70e46f[_0x7f58('0x11')],'client_secret':_0x70e46f['clientSecret'],'redirect_uri':_0x70e46f[_0x7f58('0x10')],'code':_0x70e46f[_0x7f58('0x13')]},'headers':{'Content-Type':_0x7f58('0x1d')}};return rp(_0x38717c)[_0x7f58('0x1e')](function(_0x476d6b){var _0x22377f=JSON['parse'](_0x476d6b);if(_0x22377f['refresh_token']){_0x70e46f[_0x7f58('0x20')]=_0x22377f[_0x7f58('0x21')];logger[_0x7f58('0x22')](util[_0x7f58('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x70e46f['name'],_0x70e46f['id']));}else{logger[_0x7f58('0x25')](util[_0x7f58('0x23')](_0x7f58('0x27'),_0x70e46f[_0x7f58('0x24')],_0x70e46f['id']),util[_0x7f58('0x26')](_0x22377f,{'showHidden':![],'depth':null}));}return _0x1ff742(null,_0x158209);})[_0x7f58('0x29')](function(_0x427d28){logger[_0x7f58('0x25')](util[_0x7f58('0x23')](_0x7f58('0x27'),_0x70e46f[_0x7f58('0x24')],_0x70e46f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1ff742(_0x427d28);});}else{return _0x1ff742(null,_0x158209);}}}});};
\ No newline at end of file
index e03bd46..0a7e4aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaee=['options','raw','include','map','model','attributes','GetZohoAccount','ShowZohoAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ZohoAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaaee,0xa9));var _0xeaae=function(_0x5bcb78,_0x49fcbd){_0x5bcb78=_0x5bcb78-0x0;var _0x5f1483=_0xaaee[_0x5bcb78];return _0x5f1483;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var moment=require(_0xeaae('0x1'));var BPromise=require(_0xeaae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaae('0x3'));var db=require(_0xeaae('0x4'))['db'];var utils=require(_0xeaae('0x5'));var logger=require(_0xeaae('0x6'))('rpc');var config=require(_0xeaae('0x7'));var jayson=require(_0xeaae('0x8'));var client=jayson[_0xeaae('0x9')][_0xeaae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3633ec,_0x30422f,_0x58b332){return new BPromise(function(_0x275d1c,_0x1701a9){return client[_0xeaae('0xb')](_0x3633ec,_0x58b332)[_0xeaae('0xc')](function(_0x3ec6d0){logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,_0xeaae('0xf'));logger[_0xeaae('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x30422f,_0xeaae('0xf'),JSON[_0xeaae('0x11')](_0x3ec6d0));if(_0x3ec6d0[_0xeaae('0x12')]){if(_0x3ec6d0['error']['code']===0x1f4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0[_0xeaae('0x12')]['message']);return _0x1701a9(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0['error']['message']);return _0x275d1c(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}else{logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,'request\x20sent');_0x275d1c(_0x3ec6d0[_0xeaae('0x14')]['message']);}})[_0xeaae('0x15')](function(_0x1184c4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x1184c4);_0x1701a9(_0x1184c4);});});}exports['GetZohoAccount']=function(_0x538e3d){var _0x5d5aa1=this;return new Promise(function(_0x5b44f5,_0x394d9b){return db[_0xeaae('0x16')]['findAll']({'raw':_0x538e3d[_0xeaae('0x17')]?_0x538e3d['options'][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['where']||null:null,'attributes':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['attributes']||null:null,'limit':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')]['limit']||null:null,'include':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x41739e){return{'model':db[_0x41739e[_0xeaae('0x1b')]],'as':_0x41739e['as'],'attributes':_0x41739e[_0xeaae('0x1c')],'include':_0x41739e[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x41739e['include'],function(_0xa7fa13){return{'model':db[_0xa7fa13[_0xeaae('0x1b')]],'as':_0xa7fa13['as'],'attributes':_0xa7fa13[_0xeaae('0x1c')],'include':_0xa7fa13[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0xa7fa13[_0xeaae('0x19')],function(_0x145b46){return{'model':db[_0x145b46[_0xeaae('0x1b')]],'as':_0x145b46['as'],'attributes':_0x145b46['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x261ccd){logger[_0xeaae('0xd')](_0xeaae('0x1d'),_0x538e3d);logger['debug'](_0xeaae('0x1d'),_0x538e3d,JSON[_0xeaae('0x11')](_0x261ccd));_0x5b44f5(_0x261ccd);})[_0xeaae('0x15')](function(_0x14a68a){logger[_0xeaae('0x12')](_0xeaae('0x1d'),_0x14a68a[_0xeaae('0x13')],_0x538e3d);_0x394d9b(_0x5d5aa1[_0xeaae('0x12')](0x1f4,_0x14a68a[_0xeaae('0x13')]));});});};exports[_0xeaae('0x1e')]=function(_0x48aeca){var _0x43a759=this;return new Promise(function(_0x2363fa,_0x4c938f){return db['ZohoAccount'][_0xeaae('0x1f')]({'raw':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x48aeca[_0xeaae('0x17')]?_0x48aeca['options']['where']||null:null,'attributes':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')]['attributes']||null:null,'include':_0x48aeca[_0xeaae('0x17')]?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')]?_['map'](_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x1c606b){return{'model':db[_0x1c606b[_0xeaae('0x1b')]],'as':_0x1c606b['as'],'attributes':_0x1c606b[_0xeaae('0x1c')],'include':_0x1c606b['include']?_[_0xeaae('0x1a')](_0x1c606b[_0xeaae('0x19')],function(_0x387a61){return{'model':db[_0x387a61[_0xeaae('0x1b')]],'as':_0x387a61['as'],'attributes':_0x387a61[_0xeaae('0x1c')],'include':_0x387a61[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x387a61[_0xeaae('0x19')],function(_0x183b99){return{'model':db[_0x183b99[_0xeaae('0x1b')]],'as':_0x183b99['as'],'attributes':_0x183b99[_0xeaae('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da64c){logger['info']('ShowZohoAccount',_0x48aeca);logger['debug'](_0xeaae('0x1e'),_0x48aeca,JSON['stringify'](_0x5da64c));_0x2363fa(_0x5da64c);})[_0xeaae('0x15')](function(_0x49f5a0){logger[_0xeaae('0x12')]('ShowZohoAccount',_0x49f5a0['message'],_0x48aeca);_0x4c938f(_0x43a759[_0xeaae('0x12')](0x1f4,_0x49f5a0[_0xeaae('0x13')]));});});};
\ No newline at end of file
+var _0xceef=['attributes','include','map','model','ShowZohoAccount','find','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where'];(function(_0x1abf4c,_0x264199){var _0x4f271a=function(_0x15414e){while(--_0x15414e){_0x1abf4c['push'](_0x1abf4c['shift']());}};_0x4f271a(++_0x264199);}(_0xceef,0xf6));var _0xfcee=function(_0x38441d,_0x12e5f5){_0x38441d=_0x38441d-0x0;var _0x23c0a0=_0xceef[_0x38441d];return _0x23c0a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfcee('0x0'));var BPromise=require(_0xfcee('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcee('0x3'));var logger=require(_0xfcee('0x4'))('rpc');var config=require(_0xfcee('0x5'));var jayson=require(_0xfcee('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35234a,_0xfbfb75,_0xd69040){return new BPromise(function(_0x5b0d2c,_0x513a59){return client[_0xfcee('0x7')](_0x35234a,_0xd69040)[_0xfcee('0x8')](function(_0xcea858){logger[_0xfcee('0x9')](_0xfcee('0xa'),_0xfbfb75,_0xfcee('0xb'));logger[_0xfcee('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xfbfb75,_0xfcee('0xb'),JSON[_0xfcee('0xd')](_0xcea858));if(_0xcea858[_0xfcee('0xe')]){if(_0xcea858[_0xfcee('0xe')][_0xfcee('0xf')]===0x1f4){logger[_0xfcee('0xe')](_0xfcee('0xa'),_0xfbfb75,_0xcea858[_0xfcee('0xe')][_0xfcee('0x10')]);return _0x513a59(_0xcea858['error'][_0xfcee('0x10')]);}logger[_0xfcee('0xe')]('ZohoAccount,\x20%s,\x20%s',_0xfbfb75,_0xcea858['error'][_0xfcee('0x10')]);return _0x5b0d2c(_0xcea858[_0xfcee('0xe')][_0xfcee('0x10')]);}else{logger[_0xfcee('0x9')](_0xfcee('0xa'),_0xfbfb75,_0xfcee('0xb'));_0x5b0d2c(_0xcea858['result'][_0xfcee('0x10')]);}})[_0xfcee('0x11')](function(_0x38a971){logger['error'](_0xfcee('0xa'),_0xfbfb75,_0x38a971);_0x513a59(_0x38a971);});});}exports[_0xfcee('0x12')]=function(_0x45c690){var _0x47ddd8=this;return new Promise(function(_0x37fa9c,_0x13ec8b){return db[_0xfcee('0x13')][_0xfcee('0x14')]({'raw':_0x45c690['options']?_0x45c690['options'][_0xfcee('0x15')]===undefined?!![]:![]:!![],'where':_0x45c690[_0xfcee('0x16')]?_0x45c690[_0xfcee('0x16')][_0xfcee('0x17')]||null:null,'attributes':_0x45c690[_0xfcee('0x16')]?_0x45c690[_0xfcee('0x16')][_0xfcee('0x18')]||null:null,'limit':_0x45c690['options']?_0x45c690[_0xfcee('0x16')]['limit']||null:null,'include':_0x45c690['options']?_0x45c690[_0xfcee('0x16')][_0xfcee('0x19')]?_[_0xfcee('0x1a')](_0x45c690[_0xfcee('0x16')][_0xfcee('0x19')],function(_0x463df4){return{'model':db[_0x463df4[_0xfcee('0x1b')]],'as':_0x463df4['as'],'attributes':_0x463df4[_0xfcee('0x18')],'include':_0x463df4[_0xfcee('0x19')]?_[_0xfcee('0x1a')](_0x463df4[_0xfcee('0x19')],function(_0x475a48){return{'model':db[_0x475a48[_0xfcee('0x1b')]],'as':_0x475a48['as'],'attributes':_0x475a48[_0xfcee('0x18')],'include':_0x475a48[_0xfcee('0x19')]?_['map'](_0x475a48['include'],function(_0x56c9f7){return{'model':db[_0x56c9f7[_0xfcee('0x1b')]],'as':_0x56c9f7['as'],'attributes':_0x56c9f7[_0xfcee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfcee('0x8')](function(_0x2e7e74){logger[_0xfcee('0x9')](_0xfcee('0x12'),_0x45c690);logger[_0xfcee('0xc')](_0xfcee('0x12'),_0x45c690,JSON[_0xfcee('0xd')](_0x2e7e74));_0x37fa9c(_0x2e7e74);})['catch'](function(_0x2dc32){logger[_0xfcee('0xe')](_0xfcee('0x12'),_0x2dc32[_0xfcee('0x10')],_0x45c690);_0x13ec8b(_0x47ddd8[_0xfcee('0xe')](0x1f4,_0x2dc32[_0xfcee('0x10')]));});});};exports[_0xfcee('0x1c')]=function(_0x5ed336){var _0x329ff0=this;return new Promise(function(_0x27c6fc,_0x397629){return db[_0xfcee('0x13')][_0xfcee('0x1d')]({'raw':_0x5ed336[_0xfcee('0x16')]?_0x5ed336[_0xfcee('0x16')][_0xfcee('0x15')]===undefined?!![]:![]:!![],'where':_0x5ed336[_0xfcee('0x16')]?_0x5ed336[_0xfcee('0x16')]['where']||null:null,'attributes':_0x5ed336[_0xfcee('0x16')]?_0x5ed336['options'][_0xfcee('0x18')]||null:null,'include':_0x5ed336[_0xfcee('0x16')]?_0x5ed336[_0xfcee('0x16')]['include']?_['map'](_0x5ed336[_0xfcee('0x16')]['include'],function(_0x4625ff){return{'model':db[_0x4625ff[_0xfcee('0x1b')]],'as':_0x4625ff['as'],'attributes':_0x4625ff[_0xfcee('0x18')],'include':_0x4625ff[_0xfcee('0x19')]?_[_0xfcee('0x1a')](_0x4625ff[_0xfcee('0x19')],function(_0x43fe34){return{'model':db[_0x43fe34['model']],'as':_0x43fe34['as'],'attributes':_0x43fe34['attributes'],'include':_0x43fe34[_0xfcee('0x19')]?_['map'](_0x43fe34[_0xfcee('0x19')],function(_0x22ebf4){return{'model':db[_0x22ebf4[_0xfcee('0x1b')]],'as':_0x22ebf4['as'],'attributes':_0x22ebf4[_0xfcee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfcee('0x8')](function(_0x5de47d){logger['info'](_0xfcee('0x1c'),_0x5ed336);logger[_0xfcee('0xc')](_0xfcee('0x1c'),_0x5ed336,JSON[_0xfcee('0xd')](_0x5de47d));_0x27c6fc(_0x5de47d);})[_0xfcee('0x11')](function(_0x9a5c7f){logger[_0xfcee('0xe')]('ShowZohoAccount',_0x9a5c7f['message'],_0x5ed336);_0x397629(_0x329ff0[_0xfcee('0xe')](0x1f4,_0x9a5c7f[_0xfcee('0x10')]));});});};
\ No newline at end of file
index a6a7fe0..aae7e97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a52=['express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x9a52,0x123));var _0x29a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x29a5('0x0'));var path=require(_0x29a5('0x1'));var timeout=require(_0x29a5('0x2'));var express=require(_0x29a5('0x3'));var router=express[_0x29a5('0x4')]();var fs_extra=require(_0x29a5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29a5('0x6'));var controller=require(_0x29a5('0x7'));router[_0x29a5('0x8')]('/',auth[_0x29a5('0x9')](),controller[_0x29a5('0xa')]);router['get']('/:id',auth[_0x29a5('0x9')](),controller['show']);router['get'](_0x29a5('0xb'),auth[_0x29a5('0x9')](),controller[_0x29a5('0xc')]);router[_0x29a5('0x8')](_0x29a5('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x29a5('0x8')](_0x29a5('0xe'),auth[_0x29a5('0x9')](),controller[_0x29a5('0xf')]);router['post']('/',auth[_0x29a5('0x9')](),controller['create']);router[_0x29a5('0x10')](_0x29a5('0x11'),auth[_0x29a5('0x9')](),controller[_0x29a5('0x12')]);router[_0x29a5('0x13')](_0x29a5('0x11'),auth[_0x29a5('0x9')](),controller[_0x29a5('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4a90=['get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller'];(function(_0x50101d,_0x52e185){var _0x4f92ad=function(_0x5cd546){while(--_0x5cd546){_0x50101d['push'](_0x50101d['shift']());}};_0x4f92ad(++_0x52e185);}(_0x4a90,0x115));var _0x04a9=function(_0x246de8,_0x127678){_0x246de8=_0x246de8-0x0;var _0x5119bf=_0x4a90[_0x246de8];return _0x5119bf;};'use strict';var multer=require(_0x04a9('0x0'));var util=require(_0x04a9('0x1'));var path=require('path');var timeout=require(_0x04a9('0x2'));var express=require(_0x04a9('0x3'));var router=express[_0x04a9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x04a9('0x5'));var interaction=require(_0x04a9('0x6'));var config=require(_0x04a9('0x7'));var controller=require(_0x04a9('0x8'));router[_0x04a9('0x9')]('/',auth[_0x04a9('0xa')](),controller[_0x04a9('0xb')]);router[_0x04a9('0x9')](_0x04a9('0xc'),auth[_0x04a9('0xa')](),controller['show']);router[_0x04a9('0x9')](_0x04a9('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x04a9('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x04a9('0x9')](_0x04a9('0xf'),auth[_0x04a9('0xa')](),controller[_0x04a9('0x10')]);router['post']('/',auth[_0x04a9('0xa')](),controller[_0x04a9('0x11')]);router['put']('/:id',auth[_0x04a9('0xa')](),controller[_0x04a9('0x12')]);router[_0x04a9('0x13')](_0x04a9('0xc'),auth[_0x04a9('0xa')](),controller[_0x04a9('0x14')]);module[_0x04a9('0x15')]=router;
\ No newline at end of file
index 661c311..db52d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6a8=['sequelize','exports','ENUM','contact','nothing','lead','contact_lead'];(function(_0x4c007c,_0x4eba04){var _0x424dde=function(_0x6f31cb){while(--_0x6f31cb){_0x4c007c['push'](_0x4c007c['shift']());}};_0x424dde(++_0x4eba04);}(_0xe6a8,0x13b));var _0x8e6a=function(_0x4105cb,_0x12be0e){_0x4105cb=_0x4105cb-0x0;var _0x2e1eb8=_0xe6a8[_0x4105cb];return _0x2e1eb8;};'use strict';var Sequelize=require(_0x8e6a('0x0'));module[_0x8e6a('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8e6a('0x2')]('lead',_0x8e6a('0x3'),_0x8e6a('0x4')),'defaultValue':_0x8e6a('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8e6a('0x6'),_0x8e6a('0x3'),'lead'),'defaultValue':_0x8e6a('0x6')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0a52=['sequelize','exports','ENUM','lead','contact','contact_lead'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a52,0xe4));var _0x20a5=function(_0xf3b9bc,_0xfe16c8){_0xf3b9bc=_0xf3b9bc-0x0;var _0x1b324e=_0x0a52[_0xf3b9bc];return _0x1b324e;};'use strict';var Sequelize=require(_0x20a5('0x0'));module[_0x20a5('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x20a5('0x2')](_0x20a5('0x3'),_0x20a5('0x4'),'nothing'),'defaultValue':_0x20a5('0x3')},'moduleSearch':{'type':Sequelize[_0x20a5('0x2')](_0x20a5('0x5'),_0x20a5('0x4'),_0x20a5('0x3')),'defaultValue':_0x20a5('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ec3b5d0..08f5b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x350d=['type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params','find','create','body','getFields','ZohoField','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','set','json','apply','reject','save','update','then','destroy','error','name','index','map','ZohoConfiguration','rawAttributes'];(function(_0x57d7f7,_0x335c81){var _0x1a6800=function(_0x251345){while(--_0x251345){_0x57d7f7['push'](_0x57d7f7['shift']());}};_0x1a6800(++_0x335c81);}(_0x350d,0x1b4));var _0xd350=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x350d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd350('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd350('0x1'));var jsonpatch=require(_0xd350('0x2'));var rp=require('request-promise');var moment=require(_0xd350('0x3'));var BPromise=require(_0xd350('0x4'));var Mustache=require(_0xd350('0x5'));var util=require('util');var path=require(_0xd350('0x6'));var sox=require(_0xd350('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd350('0x8'));var _=require(_0xd350('0x9'));var squel=require('squel');var crypto=require(_0xd350('0xa'));var jsforce=require(_0xd350('0xb'));var deskjs=require(_0xd350('0xc'));var toCsv=require(_0xd350('0xd'));var querystring=require('querystring');var Papa=require(_0xd350('0xe'));var Redis=require(_0xd350('0xf'));var authService=require(_0xd350('0x10'));var qs=require(_0xd350('0x11'));var as=require(_0xd350('0x12'));var hardwareService=require(_0xd350('0x13'));var logger=require(_0xd350('0x14'))(_0xd350('0x15'));var utils=require(_0xd350('0x16'));var config=require(_0xd350('0x17'));var licenseUtil=require(_0xd350('0x18'));var db=require(_0xd350('0x19'))['db'];function respondWithStatusCode(_0x47ebfe,_0xb96a5f){_0xb96a5f=_0xb96a5f||0xcc;return function(_0x4d5c56){if(_0x4d5c56){return _0x47ebfe[_0xd350('0x1a')](_0xb96a5f);}return _0x47ebfe[_0xd350('0x1b')](_0xb96a5f)['end']();};}function respondWithResult(_0x5daeb7,_0x5450c7){_0x5450c7=_0x5450c7||0xc8;return function(_0x4e2595){if(_0x4e2595){return _0x5daeb7[_0xd350('0x1b')](_0x5450c7)['json'](_0x4e2595);}};}function respondWithFilteredResult(_0x132818,_0x2bb498){return function(_0x39e406){if(_0x39e406){var _0x354655=typeof _0x2bb498[_0xd350('0x1c')]===_0xd350('0x1d')&&typeof _0x2bb498['limit']===_0xd350('0x1d');var _0x4f747d=_0x39e406['count'];var _0x2bc7b4=_0x354655?0x0:_0x2bb498['offset'];var _0x314225=_0x354655?_0x39e406['count']:_0x2bb498[_0xd350('0x1c')]+_0x2bb498['limit'];var _0x3134f9;if(_0x314225>=_0x4f747d){_0x314225=_0x4f747d;_0x3134f9=0xc8;}else{_0x3134f9=0xce;}_0x132818[_0xd350('0x1b')](_0x3134f9);return _0x132818[_0xd350('0x1e')]('Content-Range',_0x2bc7b4+'-'+_0x314225+'/'+_0x4f747d)[_0xd350('0x1f')](_0x39e406);}return null;};}function patchUpdates(_0x57884c){return function(_0x13dd20){try{jsonpatch[_0xd350('0x20')](_0x13dd20,_0x57884c,!![]);}catch(_0x545992){return BPromise[_0xd350('0x21')](_0x545992);}return _0x13dd20[_0xd350('0x22')]();};}function saveUpdates(_0x3dda9e,_0x173f4f){return function(_0x383dae){if(_0x383dae){return _0x383dae[_0xd350('0x23')](_0x3dda9e)[_0xd350('0x24')](function(_0x42e193){return _0x42e193;});}return null;};}function removeEntity(_0x5c556f,_0xbdfb45){return function(_0x2f8492){if(_0x2f8492){return _0x2f8492[_0xd350('0x25')]()[_0xd350('0x24')](function(){_0x5c556f[_0xd350('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e35f7,_0x45fe52){return function(_0x482cd1){if(!_0x482cd1){_0x1e35f7['sendStatus'](0x194);}return _0x482cd1;};}function handleError(_0x5c8d55,_0x2acfb6){_0x2acfb6=_0x2acfb6||0x1f4;return function(_0x5ed8dd){logger[_0xd350('0x26')](_0x5ed8dd['stack']);if(_0x5ed8dd[_0xd350('0x27')]){delete _0x5ed8dd[_0xd350('0x27')];}_0x5c8d55[_0xd350('0x1b')](_0x2acfb6)['send'](_0x5ed8dd);};}exports[_0xd350('0x28')]=function(_0x23c2d3,_0x5c2e60){var _0x1a2211={},_0x5ed302={},_0x319119={'count':0x0,'rows':[]};var _0x4bd715=_[_0xd350('0x29')](db[_0xd350('0x2a')][_0xd350('0x2b')],function(_0x38645c){return{'name':_0x38645c['fieldName'],'type':_0x38645c[_0xd350('0x2c')][_0xd350('0x2d')]};});_0x5ed302[_0xd350('0x2e')]=_[_0xd350('0x29')](_0x4bd715,_0xd350('0x27'));_0x5ed302[_0xd350('0x2f')]=_[_0xd350('0x30')](_0x23c2d3[_0xd350('0x2f')]);_0x5ed302['filters']=_['intersection'](_0x5ed302[_0xd350('0x2e')],_0x5ed302['query']);_0x1a2211[_0xd350('0x31')]=_[_0xd350('0x32')](_0x5ed302[_0xd350('0x2e')],qs[_0xd350('0x33')](_0x23c2d3[_0xd350('0x2f')][_0xd350('0x33')]));_0x1a2211[_0xd350('0x31')]=_0x1a2211[_0xd350('0x31')][_0xd350('0x34')]?_0x1a2211['attributes']:_0x5ed302[_0xd350('0x2e')];if(!_0x23c2d3[_0xd350('0x2f')][_0xd350('0x35')](_0xd350('0x36'))){_0x1a2211[_0xd350('0x37')]=qs[_0xd350('0x37')](_0x23c2d3[_0xd350('0x2f')][_0xd350('0x37')]);_0x1a2211[_0xd350('0x1c')]=qs[_0xd350('0x1c')](_0x23c2d3[_0xd350('0x2f')]['offset']);}_0x1a2211[_0xd350('0x38')]=qs[_0xd350('0x39')](_0x23c2d3[_0xd350('0x2f')][_0xd350('0x39')]);_0x1a2211[_0xd350('0x3a')]=qs[_0xd350('0x3b')](_[_0xd350('0x3c')](_0x23c2d3[_0xd350('0x2f')],_0x5ed302[_0xd350('0x3b')]),_0x4bd715);if(_0x23c2d3[_0xd350('0x2f')][_0xd350('0x3d')]){_0x1a2211['where']=_['merge'](_0x1a2211['where'],{'$or':_['map'](_0x4bd715,function(_0x4aaf2e){if(_0x4aaf2e[_0xd350('0x2c')]!==_0xd350('0x3e')){var _0x3605b5={};_0x3605b5[_0x4aaf2e['name']]={'$like':'%'+_0x23c2d3[_0xd350('0x2f')][_0xd350('0x3d')]+'%'};return _0x3605b5;}})});}_0x1a2211=_[_0xd350('0x3f')]({},_0x1a2211,_0x23c2d3[_0xd350('0x40')]);var _0x1e4b66={'where':_0x1a2211['where']};return db[_0xd350('0x2a')][_0xd350('0x41')](_0x1e4b66)[_0xd350('0x24')](function(_0x528202){_0x319119[_0xd350('0x41')]=_0x528202;if(_0x23c2d3[_0xd350('0x2f')][_0xd350('0x42')]){_0x1a2211[_0xd350('0x43')]=[{'all':!![]}];}return db[_0xd350('0x2a')]['findAll'](_0x1a2211);})['then'](function(_0x3eba04){_0x319119[_0xd350('0x44')]=_0x3eba04;return _0x319119;})['then'](respondWithFilteredResult(_0x5c2e60,_0x1a2211))[_0xd350('0x45')](handleError(_0x5c2e60,null));};exports[_0xd350('0x46')]=function(_0x5b41df,_0x1c7c1b){var _0x5395b1={'raw':![],'where':{'id':_0x5b41df[_0xd350('0x47')]['id']}},_0x4fbfc2={};_0x4fbfc2[_0xd350('0x2e')]=_[_0xd350('0x30')](db[_0xd350('0x2a')][_0xd350('0x2b')]);_0x4fbfc2[_0xd350('0x2f')]=_[_0xd350('0x30')](_0x5b41df[_0xd350('0x2f')]);_0x4fbfc2[_0xd350('0x3b')]=_[_0xd350('0x32')](_0x4fbfc2[_0xd350('0x2e')],_0x4fbfc2[_0xd350('0x2f')]);_0x5395b1['attributes']=_[_0xd350('0x32')](_0x4fbfc2[_0xd350('0x2e')],qs[_0xd350('0x33')](_0x5b41df[_0xd350('0x2f')]['fields']));_0x5395b1[_0xd350('0x31')]=_0x5395b1[_0xd350('0x31')][_0xd350('0x34')]?_0x5395b1['attributes']:_0x4fbfc2['model'];if(_0x5b41df['query'][_0xd350('0x42')]){_0x5395b1['include']=[{'all':!![]}];}_0x5395b1=_[_0xd350('0x3f')]({},_0x5395b1,_0x5b41df[_0xd350('0x40')]);return db['ZohoConfiguration'][_0xd350('0x48')](_0x5395b1)['then'](handleEntityNotFound(_0x1c7c1b,null))[_0xd350('0x24')](respondWithResult(_0x1c7c1b,null))['catch'](handleError(_0x1c7c1b,null));};exports[_0xd350('0x49')]=function(_0x32dcab,_0x56d148){return db[_0xd350('0x2a')][_0xd350('0x49')](_0x32dcab[_0xd350('0x4a')],{})[_0xd350('0x24')](respondWithResult(_0x56d148,0xc9))[_0xd350('0x45')](handleError(_0x56d148,null));};exports[_0xd350('0x23')]=function(_0x552840,_0xf897c7){if(_0x552840[_0xd350('0x4a')]['id']){delete _0x552840[_0xd350('0x4a')]['id'];}return db[_0xd350('0x2a')][_0xd350('0x48')]({'where':{'id':_0x552840[_0xd350('0x47')]['id']}})[_0xd350('0x24')](handleEntityNotFound(_0xf897c7,null))[_0xd350('0x24')](saveUpdates(_0x552840[_0xd350('0x4a')],null))['then'](respondWithResult(_0xf897c7,null))[_0xd350('0x45')](handleError(_0xf897c7,null));};exports[_0xd350('0x25')]=function(_0x2d5bbf,_0x518d2b){return db['ZohoConfiguration'][_0xd350('0x48')]({'where':{'id':_0x2d5bbf[_0xd350('0x47')]['id']}})[_0xd350('0x24')](handleEntityNotFound(_0x518d2b,null))[_0xd350('0x24')](removeEntity(_0x518d2b,null))[_0xd350('0x45')](handleError(_0x518d2b,null));};exports[_0xd350('0x4b')]=function(_0x1dc53d,_0x3ff6aa,_0x5bdc96){var _0x55ec47={};var _0x414b08={};var _0x449829;var _0x21a0a0;return db[_0xd350('0x2a')]['findOne']({'where':{'id':_0x1dc53d[_0xd350('0x47')]['id']}})[_0xd350('0x24')](handleEntityNotFound(_0x3ff6aa,null))[_0xd350('0x24')](function(_0x3cf0a5){if(_0x3cf0a5){_0x449829=_0x3cf0a5;_0x414b08['model']=_['keys'](db[_0xd350('0x4c')][_0xd350('0x2b')]);_0x414b08[_0xd350('0x2f')]=_[_0xd350('0x30')](_0x1dc53d[_0xd350('0x2f')]);_0x414b08['filters']=_['intersection'](_0x414b08['model'],_0x414b08['query']);_0x55ec47[_0xd350('0x31')]=_[_0xd350('0x32')](_0x414b08[_0xd350('0x2e')],qs[_0xd350('0x33')](_0x1dc53d[_0xd350('0x2f')][_0xd350('0x33')]));_0x55ec47[_0xd350('0x31')]=_0x55ec47[_0xd350('0x31')]['length']?_0x55ec47[_0xd350('0x31')]:_0x414b08[_0xd350('0x2e')];_0x55ec47['order']=qs['sort'](_0x1dc53d['query']['sort']);_0x55ec47[_0xd350('0x3a')]=qs[_0xd350('0x3b')](_[_0xd350('0x3c')](_0x1dc53d[_0xd350('0x2f')],_0x414b08[_0xd350('0x3b')]));if(_0x1dc53d[_0xd350('0x2f')][_0xd350('0x3d')]){_0x55ec47['where']=_[_0xd350('0x3f')](_0x55ec47[_0xd350('0x3a')],{'$or':_['map'](_0x55ec47[_0xd350('0x31')],function(_0x3cd978){var _0x9b9683={};_0x9b9683[_0x3cd978]={'$like':'%'+_0x1dc53d[_0xd350('0x2f')][_0xd350('0x3d')]+'%'};return _0x9b9683;})});}_0x55ec47=_[_0xd350('0x3f')]({},_0x55ec47,_0x1dc53d['options']);return _0x449829[_0xd350('0x4b')](_0x55ec47);}})['then'](function(_0x18f990){if(_0x18f990){_0x21a0a0=_0x18f990[_0xd350('0x34')];if(!_0x1dc53d[_0xd350('0x2f')][_0xd350('0x35')]('nolimit')){_0x55ec47[_0xd350('0x37')]=qs['limit'](_0x1dc53d[_0xd350('0x2f')]['limit']);_0x55ec47[_0xd350('0x1c')]=qs['offset'](_0x1dc53d['query'][_0xd350('0x1c')]);}return _0x449829[_0xd350('0x4b')](_0x55ec47);}})[_0xd350('0x24')](function(_0x19a014){if(_0x19a014){return _0x19a014?{'count':_0x21a0a0,'rows':_0x19a014}:null;}})[_0xd350('0x24')](respondWithResult(_0x3ff6aa,null))['catch'](handleError(_0x3ff6aa,null));};exports['getSubjects']=function(_0x13571e,_0x15cfd6,_0x2550c2){var _0x1bf1af={};var _0x302447={};var _0x603e74;var _0x146504;return db['ZohoConfiguration'][_0xd350('0x4d')]({'where':{'id':_0x13571e['params']['id']}})[_0xd350('0x24')](handleEntityNotFound(_0x15cfd6,null))[_0xd350('0x24')](function(_0x424aa2){if(_0x424aa2){_0x603e74=_0x424aa2;_0x302447[_0xd350('0x2e')]=_['keys'](db[_0xd350('0x4c')][_0xd350('0x2b')]);_0x302447[_0xd350('0x2f')]=_['keys'](_0x13571e[_0xd350('0x2f')]);_0x302447[_0xd350('0x3b')]=_['intersection'](_0x302447[_0xd350('0x2e')],_0x302447['query']);_0x1bf1af['attributes']=_[_0xd350('0x32')](_0x302447[_0xd350('0x2e')],qs[_0xd350('0x33')](_0x13571e['query'][_0xd350('0x33')]));_0x1bf1af[_0xd350('0x31')]=_0x1bf1af[_0xd350('0x31')][_0xd350('0x34')]?_0x1bf1af[_0xd350('0x31')]:_0x302447[_0xd350('0x2e')];_0x1bf1af[_0xd350('0x38')]=qs['sort'](_0x13571e[_0xd350('0x2f')]['sort']);_0x1bf1af[_0xd350('0x3a')]=qs[_0xd350('0x3b')](_['pick'](_0x13571e[_0xd350('0x2f')],_0x302447[_0xd350('0x3b')]));if(_0x13571e[_0xd350('0x2f')]['filter']){_0x1bf1af[_0xd350('0x3a')]=_[_0xd350('0x3f')](_0x1bf1af[_0xd350('0x3a')],{'$or':_['map'](_0x1bf1af[_0xd350('0x31')],function(_0x52cc1c){var _0x36e3e2={};_0x36e3e2[_0x52cc1c]={'$like':'%'+_0x13571e['query']['filter']+'%'};return _0x36e3e2;})});}_0x1bf1af=_[_0xd350('0x3f')]({},_0x1bf1af,_0x13571e[_0xd350('0x40')]);return _0x603e74['getSubjects'](_0x1bf1af);}})[_0xd350('0x24')](function(_0xfc67ba){if(_0xfc67ba){_0x146504=_0xfc67ba[_0xd350('0x34')];if(!_0x13571e[_0xd350('0x2f')][_0xd350('0x35')](_0xd350('0x36'))){_0x1bf1af[_0xd350('0x37')]=qs[_0xd350('0x37')](_0x13571e['query'][_0xd350('0x37')]);_0x1bf1af[_0xd350('0x1c')]=qs[_0xd350('0x1c')](_0x13571e[_0xd350('0x2f')][_0xd350('0x1c')]);}return _0x603e74[_0xd350('0x4e')](_0x1bf1af);}})[_0xd350('0x24')](function(_0x159544){if(_0x159544){return _0x159544?{'count':_0x146504,'rows':_0x159544}:null;}})[_0xd350('0x24')](respondWithResult(_0x15cfd6,null))['catch'](handleError(_0x15cfd6,null));};exports[_0xd350('0x4f')]=function(_0x349ffc,_0x35b9bf,_0x5c7627){var _0x209a93={};var _0x2097a7={};var _0x32736a;var _0x1c220c;return db[_0xd350('0x2a')][_0xd350('0x4d')]({'where':{'id':_0x349ffc[_0xd350('0x47')]['id']}})[_0xd350('0x24')](handleEntityNotFound(_0x35b9bf,null))[_0xd350('0x24')](function(_0x12ee8d){if(_0x12ee8d){_0x32736a=_0x12ee8d;_0x2097a7['model']=_[_0xd350('0x30')](db[_0xd350('0x4c')]['rawAttributes']);_0x2097a7[_0xd350('0x2f')]=_['keys'](_0x349ffc[_0xd350('0x2f')]);_0x2097a7[_0xd350('0x3b')]=_['intersection'](_0x2097a7[_0xd350('0x2e')],_0x2097a7[_0xd350('0x2f')]);_0x209a93[_0xd350('0x31')]=_[_0xd350('0x32')](_0x2097a7[_0xd350('0x2e')],qs['fields'](_0x349ffc[_0xd350('0x2f')][_0xd350('0x33')]));_0x209a93[_0xd350('0x31')]=_0x209a93[_0xd350('0x31')][_0xd350('0x34')]?_0x209a93[_0xd350('0x31')]:_0x2097a7[_0xd350('0x2e')];_0x209a93[_0xd350('0x38')]=qs[_0xd350('0x39')](_0x349ffc[_0xd350('0x2f')][_0xd350('0x39')]);_0x209a93[_0xd350('0x3a')]=qs[_0xd350('0x3b')](_['pick'](_0x349ffc[_0xd350('0x2f')],_0x2097a7[_0xd350('0x3b')]));if(_0x349ffc['query'][_0xd350('0x3d')]){_0x209a93[_0xd350('0x3a')]=_[_0xd350('0x3f')](_0x209a93[_0xd350('0x3a')],{'$or':_[_0xd350('0x29')](_0x209a93[_0xd350('0x31')],function(_0xf78544){var _0x22d96b={};_0x22d96b[_0xf78544]={'$like':'%'+_0x349ffc['query'][_0xd350('0x3d')]+'%'};return _0x22d96b;})});}_0x209a93=_[_0xd350('0x3f')]({},_0x209a93,_0x349ffc[_0xd350('0x40')]);return _0x32736a[_0xd350('0x4f')](_0x209a93);}})[_0xd350('0x24')](function(_0x5d5e32){if(_0x5d5e32){_0x1c220c=_0x5d5e32[_0xd350('0x34')];if(!_0x349ffc['query'][_0xd350('0x35')](_0xd350('0x36'))){_0x209a93[_0xd350('0x37')]=qs[_0xd350('0x37')](_0x349ffc['query'][_0xd350('0x37')]);_0x209a93[_0xd350('0x1c')]=qs[_0xd350('0x1c')](_0x349ffc[_0xd350('0x2f')][_0xd350('0x1c')]);}return _0x32736a['getDescriptions'](_0x209a93);}})[_0xd350('0x24')](function(_0x625884){if(_0x625884){return _0x625884?{'count':_0x1c220c,'rows':_0x625884}:null;}})[_0xd350('0x24')](respondWithResult(_0x35b9bf,null))[_0xd350('0x45')](handleError(_0x35b9bf,null));};
\ No newline at end of file
+var _0x480d=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','map','ZohoConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','find','create','body','params','getFields','findOne','ZohoField','rawAttributes','getSubjects','getDescriptions','eml-format'];(function(_0x4ee323,_0x3addb1){var _0x4092f4=function(_0x4bb9ea){while(--_0x4bb9ea){_0x4ee323['push'](_0x4ee323['shift']());}};_0x4092f4(++_0x3addb1);}(_0x480d,0x17b));var _0xd480=function(_0x596e10,_0x12e3ea){_0x596e10=_0x596e10-0x0;var _0xc5ef9f=_0x480d[_0x596e10];return _0xc5ef9f;};'use strict';var emlformat=require(_0xd480('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd480('0x1'));var jsonpatch=require(_0xd480('0x2'));var rp=require(_0xd480('0x3'));var moment=require(_0xd480('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd480('0x5'));var util=require(_0xd480('0x6'));var path=require(_0xd480('0x7'));var sox=require(_0xd480('0x8'));var csv=require(_0xd480('0x9'));var ejs=require(_0xd480('0xa'));var fs=require('fs');var fs_extra=require(_0xd480('0xb'));var _=require(_0xd480('0xc'));var squel=require('squel');var crypto=require(_0xd480('0xd'));var jsforce=require(_0xd480('0xe'));var deskjs=require(_0xd480('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd480('0x10'));var Redis=require('ioredis');var authService=require(_0xd480('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd480('0x12'));var hardwareService=require(_0xd480('0x13'));var logger=require(_0xd480('0x14'))(_0xd480('0x15'));var utils=require('../../config/utils');var config=require(_0xd480('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd480('0x17'))['db'];function respondWithStatusCode(_0x47c6e1,_0x511803){_0x511803=_0x511803||0xcc;return function(_0x1931b4){if(_0x1931b4){return _0x47c6e1[_0xd480('0x18')](_0x511803);}return _0x47c6e1['status'](_0x511803)['end']();};}function respondWithResult(_0x2a7669,_0x9cad9a){_0x9cad9a=_0x9cad9a||0xc8;return function(_0x8959b0){if(_0x8959b0){return _0x2a7669[_0xd480('0x19')](_0x9cad9a)[_0xd480('0x1a')](_0x8959b0);}};}function respondWithFilteredResult(_0x192921,_0x3f146e){return function(_0x23d08d){if(_0x23d08d){var _0x3136e7=typeof _0x3f146e[_0xd480('0x1b')]===_0xd480('0x1c')&&typeof _0x3f146e[_0xd480('0x1d')]===_0xd480('0x1c');var _0xd814e=_0x23d08d[_0xd480('0x1e')];var _0x128b28=_0x3136e7?0x0:_0x3f146e[_0xd480('0x1b')];var _0xaa2bff=_0x3136e7?_0x23d08d[_0xd480('0x1e')]:_0x3f146e['offset']+_0x3f146e[_0xd480('0x1d')];var _0x1fe844;if(_0xaa2bff>=_0xd814e){_0xaa2bff=_0xd814e;_0x1fe844=0xc8;}else{_0x1fe844=0xce;}_0x192921[_0xd480('0x19')](_0x1fe844);return _0x192921[_0xd480('0x1f')](_0xd480('0x20'),_0x128b28+'-'+_0xaa2bff+'/'+_0xd814e)[_0xd480('0x1a')](_0x23d08d);}return null;};}function patchUpdates(_0x921bd2){return function(_0x1685f0){try{jsonpatch['apply'](_0x1685f0,_0x921bd2,!![]);}catch(_0xa03218){return BPromise['reject'](_0xa03218);}return _0x1685f0[_0xd480('0x21')]();};}function saveUpdates(_0x1f5d39,_0x143df9){return function(_0x504248){if(_0x504248){return _0x504248[_0xd480('0x22')](_0x1f5d39)[_0xd480('0x23')](function(_0x19b8a7){return _0x19b8a7;});}return null;};}function removeEntity(_0x1747f5,_0xeb89ce){return function(_0x379670){if(_0x379670){return _0x379670['destroy']()['then'](function(){_0x1747f5[_0xd480('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x273c78,_0x2f510a){return function(_0x7729c9){if(!_0x7729c9){_0x273c78[_0xd480('0x18')](0x194);}return _0x7729c9;};}function handleError(_0x263846,_0x5693ca){_0x5693ca=_0x5693ca||0x1f4;return function(_0x5ba001){logger[_0xd480('0x24')](_0x5ba001[_0xd480('0x25')]);if(_0x5ba001['name']){delete _0x5ba001[_0xd480('0x26')];}_0x263846[_0xd480('0x19')](_0x5693ca)['send'](_0x5ba001);};}exports['index']=function(_0x199c4d,_0x33e2fd){var _0x1f2e91={},_0x1153a8={},_0x5e4b21={'count':0x0,'rows':[]};var _0xd64ff9=_[_0xd480('0x27')](db[_0xd480('0x28')]['rawAttributes'],function(_0x24f8a2){return{'name':_0x24f8a2[_0xd480('0x29')],'type':_0x24f8a2[_0xd480('0x2a')][_0xd480('0x2b')]};});_0x1153a8['model']=_[_0xd480('0x27')](_0xd64ff9,_0xd480('0x26'));_0x1153a8[_0xd480('0x2c')]=_[_0xd480('0x2d')](_0x199c4d[_0xd480('0x2c')]);_0x1153a8[_0xd480('0x2e')]=_[_0xd480('0x2f')](_0x1153a8[_0xd480('0x30')],_0x1153a8[_0xd480('0x2c')]);_0x1f2e91[_0xd480('0x31')]=_[_0xd480('0x2f')](_0x1153a8[_0xd480('0x30')],qs['fields'](_0x199c4d[_0xd480('0x2c')][_0xd480('0x32')]));_0x1f2e91['attributes']=_0x1f2e91['attributes'][_0xd480('0x33')]?_0x1f2e91[_0xd480('0x31')]:_0x1153a8['model'];if(!_0x199c4d[_0xd480('0x2c')][_0xd480('0x34')](_0xd480('0x35'))){_0x1f2e91[_0xd480('0x1d')]=qs['limit'](_0x199c4d[_0xd480('0x2c')][_0xd480('0x1d')]);_0x1f2e91['offset']=qs['offset'](_0x199c4d[_0xd480('0x2c')][_0xd480('0x1b')]);}_0x1f2e91[_0xd480('0x36')]=qs[_0xd480('0x37')](_0x199c4d['query'][_0xd480('0x37')]);_0x1f2e91[_0xd480('0x38')]=qs[_0xd480('0x2e')](_[_0xd480('0x39')](_0x199c4d['query'],_0x1153a8[_0xd480('0x2e')]),_0xd64ff9);if(_0x199c4d[_0xd480('0x2c')][_0xd480('0x3a')]){_0x1f2e91[_0xd480('0x38')]=_['merge'](_0x1f2e91[_0xd480('0x38')],{'$or':_[_0xd480('0x27')](_0xd64ff9,function(_0x382fb8){if(_0x382fb8[_0xd480('0x2a')]!==_0xd480('0x3b')){var _0x317ea7={};_0x317ea7[_0x382fb8[_0xd480('0x26')]]={'$like':'%'+_0x199c4d[_0xd480('0x2c')][_0xd480('0x3a')]+'%'};return _0x317ea7;}})});}_0x1f2e91=_[_0xd480('0x3c')]({},_0x1f2e91,_0x199c4d[_0xd480('0x3d')]);var _0x75c10={'where':_0x1f2e91[_0xd480('0x38')]};return db[_0xd480('0x28')][_0xd480('0x1e')](_0x75c10)[_0xd480('0x23')](function(_0x38ffd0){_0x5e4b21[_0xd480('0x1e')]=_0x38ffd0;if(_0x199c4d[_0xd480('0x2c')][_0xd480('0x3e')]){_0x1f2e91[_0xd480('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x1f2e91);})[_0xd480('0x23')](function(_0x365cd0){_0x5e4b21[_0xd480('0x40')]=_0x365cd0;return _0x5e4b21;})[_0xd480('0x23')](respondWithFilteredResult(_0x33e2fd,_0x1f2e91))[_0xd480('0x41')](handleError(_0x33e2fd,null));};exports['show']=function(_0x3825e4,_0x396461){var _0x54fff3={'raw':![],'where':{'id':_0x3825e4['params']['id']}},_0x18f9b2={};_0x18f9b2[_0xd480('0x30')]=_[_0xd480('0x2d')](db['ZohoConfiguration']['rawAttributes']);_0x18f9b2[_0xd480('0x2c')]=_['keys'](_0x3825e4[_0xd480('0x2c')]);_0x18f9b2[_0xd480('0x2e')]=_[_0xd480('0x2f')](_0x18f9b2[_0xd480('0x30')],_0x18f9b2[_0xd480('0x2c')]);_0x54fff3['attributes']=_[_0xd480('0x2f')](_0x18f9b2['model'],qs[_0xd480('0x32')](_0x3825e4[_0xd480('0x2c')][_0xd480('0x32')]));_0x54fff3[_0xd480('0x31')]=_0x54fff3[_0xd480('0x31')][_0xd480('0x33')]?_0x54fff3[_0xd480('0x31')]:_0x18f9b2['model'];if(_0x3825e4[_0xd480('0x2c')][_0xd480('0x3e')]){_0x54fff3[_0xd480('0x3f')]=[{'all':!![]}];}_0x54fff3=_[_0xd480('0x3c')]({},_0x54fff3,_0x3825e4['options']);return db[_0xd480('0x28')][_0xd480('0x42')](_0x54fff3)[_0xd480('0x23')](handleEntityNotFound(_0x396461,null))['then'](respondWithResult(_0x396461,null))[_0xd480('0x41')](handleError(_0x396461,null));};exports[_0xd480('0x43')]=function(_0xd24626,_0x585fda){return db[_0xd480('0x28')][_0xd480('0x43')](_0xd24626[_0xd480('0x44')],{})['then'](respondWithResult(_0x585fda,0xc9))['catch'](handleError(_0x585fda,null));};exports[_0xd480('0x22')]=function(_0x3ced62,_0x50fd26){if(_0x3ced62[_0xd480('0x44')]['id']){delete _0x3ced62[_0xd480('0x44')]['id'];}return db[_0xd480('0x28')]['find']({'where':{'id':_0x3ced62[_0xd480('0x45')]['id']}})[_0xd480('0x23')](handleEntityNotFound(_0x50fd26,null))[_0xd480('0x23')](saveUpdates(_0x3ced62[_0xd480('0x44')],null))[_0xd480('0x23')](respondWithResult(_0x50fd26,null))[_0xd480('0x41')](handleError(_0x50fd26,null));};exports['destroy']=function(_0x191789,_0x5c1fb3){return db[_0xd480('0x28')][_0xd480('0x42')]({'where':{'id':_0x191789[_0xd480('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c1fb3,null))[_0xd480('0x23')](removeEntity(_0x5c1fb3,null))[_0xd480('0x41')](handleError(_0x5c1fb3,null));};exports[_0xd480('0x46')]=function(_0x17b84e,_0x20f324,_0x49ba1a){var _0xad1e5a={};var _0x6f91d0={};var _0x2816bc;var _0xf8696a;return db[_0xd480('0x28')][_0xd480('0x47')]({'where':{'id':_0x17b84e[_0xd480('0x45')]['id']}})['then'](handleEntityNotFound(_0x20f324,null))[_0xd480('0x23')](function(_0x5f1bfe){if(_0x5f1bfe){_0x2816bc=_0x5f1bfe;_0x6f91d0[_0xd480('0x30')]=_[_0xd480('0x2d')](db[_0xd480('0x48')][_0xd480('0x49')]);_0x6f91d0[_0xd480('0x2c')]=_['keys'](_0x17b84e[_0xd480('0x2c')]);_0x6f91d0[_0xd480('0x2e')]=_[_0xd480('0x2f')](_0x6f91d0[_0xd480('0x30')],_0x6f91d0['query']);_0xad1e5a[_0xd480('0x31')]=_['intersection'](_0x6f91d0['model'],qs['fields'](_0x17b84e[_0xd480('0x2c')][_0xd480('0x32')]));_0xad1e5a[_0xd480('0x31')]=_0xad1e5a[_0xd480('0x31')][_0xd480('0x33')]?_0xad1e5a['attributes']:_0x6f91d0[_0xd480('0x30')];_0xad1e5a[_0xd480('0x36')]=qs[_0xd480('0x37')](_0x17b84e[_0xd480('0x2c')][_0xd480('0x37')]);_0xad1e5a[_0xd480('0x38')]=qs[_0xd480('0x2e')](_[_0xd480('0x39')](_0x17b84e[_0xd480('0x2c')],_0x6f91d0['filters']));if(_0x17b84e[_0xd480('0x2c')][_0xd480('0x3a')]){_0xad1e5a[_0xd480('0x38')]=_[_0xd480('0x3c')](_0xad1e5a[_0xd480('0x38')],{'$or':_[_0xd480('0x27')](_0xad1e5a[_0xd480('0x31')],function(_0x3e5da0){var _0x208b1f={};_0x208b1f[_0x3e5da0]={'$like':'%'+_0x17b84e[_0xd480('0x2c')][_0xd480('0x3a')]+'%'};return _0x208b1f;})});}_0xad1e5a=_[_0xd480('0x3c')]({},_0xad1e5a,_0x17b84e['options']);return _0x2816bc[_0xd480('0x46')](_0xad1e5a);}})[_0xd480('0x23')](function(_0x3279a7){if(_0x3279a7){_0xf8696a=_0x3279a7[_0xd480('0x33')];if(!_0x17b84e['query'][_0xd480('0x34')]('nolimit')){_0xad1e5a['limit']=qs[_0xd480('0x1d')](_0x17b84e['query'][_0xd480('0x1d')]);_0xad1e5a[_0xd480('0x1b')]=qs[_0xd480('0x1b')](_0x17b84e[_0xd480('0x2c')][_0xd480('0x1b')]);}return _0x2816bc[_0xd480('0x46')](_0xad1e5a);}})[_0xd480('0x23')](function(_0x4862d1){if(_0x4862d1){return _0x4862d1?{'count':_0xf8696a,'rows':_0x4862d1}:null;}})[_0xd480('0x23')](respondWithResult(_0x20f324,null))[_0xd480('0x41')](handleError(_0x20f324,null));};exports[_0xd480('0x4a')]=function(_0x1078ff,_0xdfe082,_0x58d34a){var _0x527a16={};var _0xf7dd3={};var _0x2633ff;var _0x3d7497;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1078ff[_0xd480('0x45')]['id']}})[_0xd480('0x23')](handleEntityNotFound(_0xdfe082,null))[_0xd480('0x23')](function(_0x365652){if(_0x365652){_0x2633ff=_0x365652;_0xf7dd3[_0xd480('0x30')]=_['keys'](db[_0xd480('0x48')][_0xd480('0x49')]);_0xf7dd3[_0xd480('0x2c')]=_[_0xd480('0x2d')](_0x1078ff['query']);_0xf7dd3[_0xd480('0x2e')]=_[_0xd480('0x2f')](_0xf7dd3[_0xd480('0x30')],_0xf7dd3['query']);_0x527a16[_0xd480('0x31')]=_['intersection'](_0xf7dd3['model'],qs[_0xd480('0x32')](_0x1078ff[_0xd480('0x2c')][_0xd480('0x32')]));_0x527a16['attributes']=_0x527a16[_0xd480('0x31')][_0xd480('0x33')]?_0x527a16['attributes']:_0xf7dd3['model'];_0x527a16[_0xd480('0x36')]=qs['sort'](_0x1078ff[_0xd480('0x2c')]['sort']);_0x527a16['where']=qs[_0xd480('0x2e')](_[_0xd480('0x39')](_0x1078ff[_0xd480('0x2c')],_0xf7dd3['filters']));if(_0x1078ff['query'][_0xd480('0x3a')]){_0x527a16[_0xd480('0x38')]=_['merge'](_0x527a16[_0xd480('0x38')],{'$or':_[_0xd480('0x27')](_0x527a16[_0xd480('0x31')],function(_0x7588dd){var _0x1bf3c1={};_0x1bf3c1[_0x7588dd]={'$like':'%'+_0x1078ff[_0xd480('0x2c')]['filter']+'%'};return _0x1bf3c1;})});}_0x527a16=_['merge']({},_0x527a16,_0x1078ff[_0xd480('0x3d')]);return _0x2633ff[_0xd480('0x4a')](_0x527a16);}})[_0xd480('0x23')](function(_0x295b10){if(_0x295b10){_0x3d7497=_0x295b10[_0xd480('0x33')];if(!_0x1078ff[_0xd480('0x2c')][_0xd480('0x34')](_0xd480('0x35'))){_0x527a16[_0xd480('0x1d')]=qs[_0xd480('0x1d')](_0x1078ff[_0xd480('0x2c')]['limit']);_0x527a16['offset']=qs[_0xd480('0x1b')](_0x1078ff['query'][_0xd480('0x1b')]);}return _0x2633ff[_0xd480('0x4a')](_0x527a16);}})[_0xd480('0x23')](function(_0xd9313e){if(_0xd9313e){return _0xd9313e?{'count':_0x3d7497,'rows':_0xd9313e}:null;}})[_0xd480('0x23')](respondWithResult(_0xdfe082,null))['catch'](handleError(_0xdfe082,null));};exports[_0xd480('0x4b')]=function(_0x2055ab,_0xc1441d,_0x2fb577){var _0x64980c={};var _0x488a7e={};var _0x1f1793;var _0x3e16c3;return db[_0xd480('0x28')][_0xd480('0x47')]({'where':{'id':_0x2055ab[_0xd480('0x45')]['id']}})[_0xd480('0x23')](handleEntityNotFound(_0xc1441d,null))['then'](function(_0x15cf90){if(_0x15cf90){_0x1f1793=_0x15cf90;_0x488a7e[_0xd480('0x30')]=_[_0xd480('0x2d')](db[_0xd480('0x48')][_0xd480('0x49')]);_0x488a7e['query']=_[_0xd480('0x2d')](_0x2055ab[_0xd480('0x2c')]);_0x488a7e[_0xd480('0x2e')]=_[_0xd480('0x2f')](_0x488a7e['model'],_0x488a7e[_0xd480('0x2c')]);_0x64980c[_0xd480('0x31')]=_['intersection'](_0x488a7e['model'],qs[_0xd480('0x32')](_0x2055ab['query'][_0xd480('0x32')]));_0x64980c[_0xd480('0x31')]=_0x64980c['attributes'][_0xd480('0x33')]?_0x64980c[_0xd480('0x31')]:_0x488a7e[_0xd480('0x30')];_0x64980c[_0xd480('0x36')]=qs['sort'](_0x2055ab['query']['sort']);_0x64980c[_0xd480('0x38')]=qs[_0xd480('0x2e')](_['pick'](_0x2055ab['query'],_0x488a7e[_0xd480('0x2e')]));if(_0x2055ab[_0xd480('0x2c')][_0xd480('0x3a')]){_0x64980c[_0xd480('0x38')]=_[_0xd480('0x3c')](_0x64980c[_0xd480('0x38')],{'$or':_[_0xd480('0x27')](_0x64980c['attributes'],function(_0x357ff2){var _0x2a47ac={};_0x2a47ac[_0x357ff2]={'$like':'%'+_0x2055ab[_0xd480('0x2c')][_0xd480('0x3a')]+'%'};return _0x2a47ac;})});}_0x64980c=_[_0xd480('0x3c')]({},_0x64980c,_0x2055ab[_0xd480('0x3d')]);return _0x1f1793[_0xd480('0x4b')](_0x64980c);}})[_0xd480('0x23')](function(_0x44997c){if(_0x44997c){_0x3e16c3=_0x44997c['length'];if(!_0x2055ab[_0xd480('0x2c')][_0xd480('0x34')](_0xd480('0x35'))){_0x64980c['limit']=qs[_0xd480('0x1d')](_0x2055ab[_0xd480('0x2c')]['limit']);_0x64980c[_0xd480('0x1b')]=qs[_0xd480('0x1b')](_0x2055ab[_0xd480('0x2c')][_0xd480('0x1b')]);}return _0x1f1793[_0xd480('0x4b')](_0x64980c);}})['then'](function(_0xaa79fd){if(_0xaa79fd){return _0xaa79fd?{'count':_0x3e16c3,'rows':_0xaa79fd}:null;}})[_0xd480('0x23')](respondWithResult(_0xc1441d,null))[_0xd480('0x41')](handleError(_0xc1441d,null));};
\ No newline at end of file
index 0d25573..dd71324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91f7=['ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0xa72345,_0x1fd304){var _0xbc82fb=function(_0xb1594f){while(--_0xb1594f){_0xa72345['push'](_0xa72345['shift']());}};_0xbc82fb(++_0x1fd304);}(_0x91f7,0x120));var _0x791f=function(_0x57d942,_0x41b732){_0x57d942=_0x57d942-0x0;var _0x552fc1=_0x91f7[_0x57d942];return _0x552fc1;};'use strict';var _=require(_0x791f('0x0'));var util=require('util');var logger=require(_0x791f('0x1'))(_0x791f('0x2'));var moment=require(_0x791f('0x3'));var BPromise=require(_0x791f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791f('0x5'));var rimraf=require(_0x791f('0x6'));var config=require(_0x791f('0x7'));var attributes=require(_0x791f('0x8'));module[_0x791f('0x9')]=function(_0x482ebc,_0x362629){return _0x482ebc[_0x791f('0xa')](_0x791f('0xb'),attributes,{'tableName':_0x791f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35a4=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations'];(function(_0x5da129,_0x220b17){var _0x5b4f48=function(_0x222926){while(--_0x222926){_0x5da129['push'](_0x5da129['shift']());}};_0x5b4f48(++_0x220b17);}(_0x35a4,0xbe));var _0x435a=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x35a4[_0x2f9467];return _0x39894c;};'use strict';var _=require('lodash');var util=require(_0x435a('0x0'));var logger=require(_0x435a('0x1'))('api');var moment=require(_0x435a('0x2'));var BPromise=require(_0x435a('0x3'));var rp=require(_0x435a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x435a('0x5'));var config=require(_0x435a('0x6'));var attributes=require(_0x435a('0x7'));module['exports']=function(_0x3d6fb5,_0x1fdd5e){return _0x3d6fb5['define'](_0x435a('0x8'),attributes,{'tableName':_0x435a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16bb522..2db85be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09c7=['../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3d4e84,_0x261fd1){var _0x1dfbce=function(_0x278d7c){while(--_0x278d7c){_0x3d4e84['push'](_0x3d4e84['shift']());}};_0x1dfbce(++_0x261fd1);}(_0x09c7,0x1d4));var _0x709c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x09c7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x709c('0x0'));var util=require(_0x709c('0x1'));var moment=require(_0x709c('0x2'));var BPromise=require(_0x709c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x709c('0x4'));var db=require(_0x709c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x709c('0x6'))('rpc');var config=require(_0x709c('0x7'));var jayson=require(_0x709c('0x8'));var client=jayson[_0x709c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad0990,_0xeae1f3,_0x1ad1db){return new BPromise(function(_0x47b370,_0x1be4f8){return client[_0x709c('0xa')](_0xad0990,_0x1ad1db)[_0x709c('0xb')](function(_0x12508){logger[_0x709c('0xc')](_0x709c('0xd'),_0xeae1f3,_0x709c('0xe'));logger[_0x709c('0xf')](_0x709c('0x10'),_0xeae1f3,_0x709c('0xe'),JSON['stringify'](_0x12508));if(_0x12508[_0x709c('0x11')]){if(_0x12508['error']['code']===0x1f4){logger[_0x709c('0x11')](_0x709c('0xd'),_0xeae1f3,_0x12508[_0x709c('0x11')]['message']);return _0x1be4f8(_0x12508[_0x709c('0x11')][_0x709c('0x12')]);}logger[_0x709c('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0xeae1f3,_0x12508[_0x709c('0x11')]['message']);return _0x47b370(_0x12508[_0x709c('0x11')][_0x709c('0x12')]);}else{logger[_0x709c('0xc')](_0x709c('0xd'),_0xeae1f3,'request\x20sent');_0x47b370(_0x12508['result'][_0x709c('0x12')]);}})['catch'](function(_0x2b47e4){logger[_0x709c('0x11')](_0x709c('0xd'),_0xeae1f3,_0x2b47e4);_0x1be4f8(_0x2b47e4);});});}
\ No newline at end of file
+var _0x28d6=['result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1d4917,_0xe18f66){var _0x4365c7=function(_0x337ecc){while(--_0x337ecc){_0x1d4917['push'](_0x1d4917['shift']());}};_0x4365c7(++_0xe18f66);}(_0x28d6,0x111));var _0x628d=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x28d6[_0x879e31];return _0x3467e8;};'use strict';var _=require(_0x628d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x628d('0x1'));var rs=require(_0x628d('0x2'));var fs=require('fs');var Redis=require(_0x628d('0x3'));var db=require(_0x628d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x628d('0x5'));var jayson=require(_0x628d('0x6'));var client=jayson[_0x628d('0x7')][_0x628d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11aaae,_0x4b1156,_0x17bbe6){return new BPromise(function(_0x24487a,_0x534706){return client[_0x628d('0x9')](_0x11aaae,_0x17bbe6)['then'](function(_0x203732){logger['info'](_0x628d('0xa'),_0x4b1156,_0x628d('0xb'));logger[_0x628d('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4b1156,_0x628d('0xb'),JSON[_0x628d('0xd')](_0x203732));if(_0x203732[_0x628d('0xe')]){if(_0x203732[_0x628d('0xe')]['code']===0x1f4){logger[_0x628d('0xe')](_0x628d('0xa'),_0x4b1156,_0x203732[_0x628d('0xe')][_0x628d('0xf')]);return _0x534706(_0x203732['error'][_0x628d('0xf')]);}logger[_0x628d('0xe')](_0x628d('0xa'),_0x4b1156,_0x203732[_0x628d('0xe')][_0x628d('0xf')]);return _0x24487a(_0x203732['error'][_0x628d('0xf')]);}else{logger['info'](_0x628d('0xa'),_0x4b1156,_0x628d('0xb'));_0x24487a(_0x203732[_0x628d('0x10')]['message']);}})['catch'](function(_0x55c37d){logger[_0x628d('0xe')](_0x628d('0xa'),_0x4b1156,_0x55c37d);_0x534706(_0x55c37d);});});}
\ No newline at end of file
index ff3540f..c3cf07f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9e9=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xb9e9,0xb8));var _0x9b9e=function(_0xb366f1,_0x1b9197){_0xb366f1=_0xb366f1-0x0;var _0x879beb=_0xb9e9[_0xb366f1];return _0x879beb;};'use strict';var multer=require(_0x9b9e('0x0'));var util=require(_0x9b9e('0x1'));var path=require(_0x9b9e('0x2'));var timeout=require(_0x9b9e('0x3'));var express=require(_0x9b9e('0x4'));var router=express[_0x9b9e('0x5')]();var fs_extra=require(_0x9b9e('0x6'));var auth=require(_0x9b9e('0x7'));var interaction=require(_0x9b9e('0x8'));var config=require(_0x9b9e('0x9'));var controller=require(_0x9b9e('0xa'));router[_0x9b9e('0xb')]('/',auth[_0x9b9e('0xc')](),controller['index']);router['get'](_0x9b9e('0xd'),auth[_0x9b9e('0xc')](),controller[_0x9b9e('0xe')]);router[_0x9b9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9b9e('0x10')]('/:id',auth[_0x9b9e('0xc')](),controller[_0x9b9e('0x11')]);router[_0x9b9e('0x12')](_0x9b9e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9b9e('0x13')]=router;
\ No newline at end of file
+var _0x69ca=['index','/:id','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x819e57,_0x5250d3){var _0x1e3386=function(_0x9cc595){while(--_0x9cc595){_0x819e57['push'](_0x819e57['shift']());}};_0x1e3386(++_0x5250d3);}(_0x69ca,0x98));var _0xa69c=function(_0x50521f,_0x4375b3){_0x50521f=_0x50521f-0x0;var _0x29b4be=_0x69ca[_0x50521f];return _0x29b4be;};'use strict';var multer=require(_0xa69c('0x0'));var util=require(_0xa69c('0x1'));var path=require(_0xa69c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa69c('0x3')]();var fs_extra=require(_0xa69c('0x4'));var auth=require(_0xa69c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa69c('0x6'));var controller=require(_0xa69c('0x7'));router[_0xa69c('0x8')]('/',auth[_0xa69c('0x9')](),controller[_0xa69c('0xa')]);router[_0xa69c('0x8')](_0xa69c('0xb'),auth[_0xa69c('0x9')](),controller['show']);router[_0xa69c('0xc')]('/',auth[_0xa69c('0x9')](),controller[_0xa69c('0xd')]);router[_0xa69c('0xe')](_0xa69c('0xb'),auth['isAuthenticated'](),controller[_0xa69c('0xf')]);router[_0xa69c('0x10')]('/:id',auth[_0xa69c('0x9')](),controller['destroy']);module[_0xa69c('0x11')]=router;
\ No newline at end of file
index 6087b5a..784ac5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa731=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1acc01,_0x5cb80c){var _0x5603f1=function(_0x5e7558){while(--_0x5e7558){_0x1acc01['push'](_0x1acc01['shift']());}};_0x5603f1(++_0x5cb80c);}(_0xa731,0x80));var _0x1a73=function(_0x20b198,_0x3ef636){_0x20b198=_0x20b198-0x0;var _0x207f9e=_0xa731[_0x20b198];return _0x207f9e;};'use strict';var Sequelize=require(_0x1a73('0x0'));module[_0x1a73('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1a73('0x2'),_0x1a73('0x3'),_0x1a73('0x4'),_0x1a73('0x5'),_0x1a73('0x6')),'defaultValue':_0x1a73('0x2')},'content':{'type':Sequelize[_0x1a73('0x7')]},'key':{'type':Sequelize[_0x1a73('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x1a73('0x4'))},'keyContent':{'type':Sequelize[_0x1a73('0x7')]},'idField':{'type':Sequelize[_0x1a73('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a73('0x7')]}};
\ No newline at end of file
+var _0x636c=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x4e5d7f,_0x27405f){var _0x1eebe8=function(_0xdf853f){while(--_0xdf853f){_0x4e5d7f['push'](_0x4e5d7f['shift']());}};_0x1eebe8(++_0x27405f);}(_0x636c,0x77));var _0xc636=function(_0x44adfa,_0x2b82b5){_0x44adfa=_0x44adfa-0x0;var _0x2c025e=_0x636c[_0x44adfa];return _0x2c025e;};'use strict';var Sequelize=require(_0xc636('0x0'));module[_0xc636('0x1')]={'type':{'type':Sequelize[_0xc636('0x2')]('string',_0xc636('0x3'),_0xc636('0x4'),_0xc636('0x5'),'picklist'),'defaultValue':_0xc636('0x6')},'content':{'type':Sequelize[_0xc636('0x7')]},'key':{'type':Sequelize[_0xc636('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc636('0x6'),_0xc636('0x3'),_0xc636('0x4'))},'keyContent':{'type':Sequelize[_0xc636('0x7')]},'idField':{'type':Sequelize[_0xc636('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc636('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc636('0x7')]}};
\ No newline at end of file
index e653b47..650331d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b8=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','json','apply','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x61b8,0xcf));var _0x861b=function(_0x408976,_0x4db5f5){_0x408976=_0x408976-0x0;var _0x46ba30=_0x61b8[_0x408976];return _0x46ba30;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require(_0x861b('0x3'));var rp=require(_0x861b('0x4'));var moment=require(_0x861b('0x5'));var BPromise=require(_0x861b('0x6'));var Mustache=require(_0x861b('0x7'));var util=require(_0x861b('0x8'));var path=require('path');var sox=require(_0x861b('0x9'));var csv=require('to-csv');var ejs=require(_0x861b('0xa'));var fs=require('fs');var fs_extra=require(_0x861b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x861b('0xc'));var deskjs=require(_0x861b('0xd'));var toCsv=require(_0x861b('0xe'));var querystring=require(_0x861b('0xf'));var Papa=require('papaparse');var Redis=require(_0x861b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x861b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x861b('0x12'));var logger=require(_0x861b('0x13'))('api');var utils=require(_0x861b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x861b('0x15'));var db=require(_0x861b('0x16'))['db'];function respondWithStatusCode(_0x29c213,_0x52cb4e){_0x52cb4e=_0x52cb4e||0xcc;return function(_0x3b1192){if(_0x3b1192){return _0x29c213['sendStatus'](_0x52cb4e);}return _0x29c213[_0x861b('0x17')](_0x52cb4e)[_0x861b('0x18')]();};}function respondWithResult(_0x219f54,_0x1b1317){_0x1b1317=_0x1b1317||0xc8;return function(_0x34f7c2){if(_0x34f7c2){return _0x219f54[_0x861b('0x17')](_0x1b1317)['json'](_0x34f7c2);}};}function respondWithFilteredResult(_0x407be3,_0x588193){return function(_0x49752c){if(_0x49752c){var _0x538066=typeof _0x588193[_0x861b('0x19')]===_0x861b('0x1a')&&typeof _0x588193['limit']===_0x861b('0x1a');var _0x53fe00=_0x49752c[_0x861b('0x1b')];var _0x2de537=_0x538066?0x0:_0x588193[_0x861b('0x19')];var _0x307b95=_0x538066?_0x49752c[_0x861b('0x1b')]:_0x588193[_0x861b('0x19')]+_0x588193[_0x861b('0x1c')];var _0x23eed2;if(_0x307b95>=_0x53fe00){_0x307b95=_0x53fe00;_0x23eed2=0xc8;}else{_0x23eed2=0xce;}_0x407be3[_0x861b('0x17')](_0x23eed2);return _0x407be3['set']('Content-Range',_0x2de537+'-'+_0x307b95+'/'+_0x53fe00)[_0x861b('0x1d')](_0x49752c);}return null;};}function patchUpdates(_0x58b1a5){return function(_0x54404a){try{jsonpatch[_0x861b('0x1e')](_0x54404a,_0x58b1a5,!![]);}catch(_0x4f0b37){return BPromise['reject'](_0x4f0b37);}return _0x54404a['save']();};}function saveUpdates(_0x4fecc8,_0x368436){return function(_0x436e72){if(_0x436e72){return _0x436e72[_0x861b('0x1f')](_0x4fecc8)[_0x861b('0x20')](function(_0x493d30){return _0x493d30;});}return null;};}function removeEntity(_0x3e949b,_0x7d426){return function(_0x204dca){if(_0x204dca){return _0x204dca[_0x861b('0x21')]()[_0x861b('0x20')](function(){_0x3e949b[_0x861b('0x17')](0xcc)[_0x861b('0x18')]();});}};}function handleEntityNotFound(_0xb81bba,_0x2ffbda){return function(_0x2a0c1d){if(!_0x2a0c1d){_0xb81bba['sendStatus'](0x194);}return _0x2a0c1d;};}function handleError(_0x30b975,_0x3d6e89){_0x3d6e89=_0x3d6e89||0x1f4;return function(_0x3eb32f){logger[_0x861b('0x22')](_0x3eb32f[_0x861b('0x23')]);if(_0x3eb32f[_0x861b('0x24')]){delete _0x3eb32f[_0x861b('0x24')];}_0x30b975[_0x861b('0x17')](_0x3d6e89)[_0x861b('0x25')](_0x3eb32f);};}exports[_0x861b('0x26')]=function(_0x739bfb,_0x14cfda){var _0x32adec={},_0x7aad51={},_0x22f8b7={'count':0x0,'rows':[]};var _0x3bda6b=_[_0x861b('0x27')](db[_0x861b('0x28')][_0x861b('0x29')],function(_0x142d64){return{'name':_0x142d64[_0x861b('0x2a')],'type':_0x142d64['type'][_0x861b('0x2b')]};});_0x7aad51[_0x861b('0x2c')]=_[_0x861b('0x27')](_0x3bda6b,_0x861b('0x24'));_0x7aad51[_0x861b('0x2d')]=_['keys'](_0x739bfb['query']);_0x7aad51[_0x861b('0x2e')]=_[_0x861b('0x2f')](_0x7aad51[_0x861b('0x2c')],_0x7aad51[_0x861b('0x2d')]);_0x32adec[_0x861b('0x30')]=_[_0x861b('0x2f')](_0x7aad51[_0x861b('0x2c')],qs[_0x861b('0x31')](_0x739bfb['query']['fields']));_0x32adec['attributes']=_0x32adec['attributes'][_0x861b('0x32')]?_0x32adec[_0x861b('0x30')]:_0x7aad51[_0x861b('0x2c')];if(!_0x739bfb[_0x861b('0x2d')][_0x861b('0x33')](_0x861b('0x34'))){_0x32adec[_0x861b('0x1c')]=qs['limit'](_0x739bfb[_0x861b('0x2d')][_0x861b('0x1c')]);_0x32adec[_0x861b('0x19')]=qs['offset'](_0x739bfb[_0x861b('0x2d')]['offset']);}_0x32adec['order']=qs[_0x861b('0x35')](_0x739bfb['query'][_0x861b('0x35')]);_0x32adec[_0x861b('0x36')]=qs[_0x861b('0x2e')](_[_0x861b('0x37')](_0x739bfb[_0x861b('0x2d')],_0x7aad51[_0x861b('0x2e')]),_0x3bda6b);if(_0x739bfb[_0x861b('0x2d')][_0x861b('0x38')]){_0x32adec[_0x861b('0x36')]=_[_0x861b('0x39')](_0x32adec[_0x861b('0x36')],{'$or':_[_0x861b('0x27')](_0x3bda6b,function(_0x199ee6){if(_0x199ee6['type']!==_0x861b('0x3a')){var _0x134b4b={};_0x134b4b[_0x199ee6[_0x861b('0x24')]]={'$like':'%'+_0x739bfb[_0x861b('0x2d')]['filter']+'%'};return _0x134b4b;}})});}_0x32adec=_['merge']({},_0x32adec,_0x739bfb['options']);var _0x4aa901={'where':_0x32adec[_0x861b('0x36')]};return db[_0x861b('0x28')][_0x861b('0x1b')](_0x4aa901)['then'](function(_0x44604f){_0x22f8b7[_0x861b('0x1b')]=_0x44604f;if(_0x739bfb['query'][_0x861b('0x3b')]){_0x32adec[_0x861b('0x3c')]=[{'all':!![]}];}return db['ZohoField'][_0x861b('0x3d')](_0x32adec);})[_0x861b('0x20')](function(_0x1f120e){_0x22f8b7['rows']=_0x1f120e;return _0x22f8b7;})[_0x861b('0x20')](respondWithFilteredResult(_0x14cfda,_0x32adec))[_0x861b('0x3e')](handleError(_0x14cfda,null));};exports[_0x861b('0x3f')]=function(_0x563c79,_0x43ad5d){var _0x16b254={'raw':!![],'where':{'id':_0x563c79[_0x861b('0x40')]['id']}},_0x5622c0={};_0x5622c0[_0x861b('0x2c')]=_[_0x861b('0x41')](db[_0x861b('0x28')][_0x861b('0x29')]);_0x5622c0[_0x861b('0x2d')]=_[_0x861b('0x41')](_0x563c79['query']);_0x5622c0['filters']=_[_0x861b('0x2f')](_0x5622c0[_0x861b('0x2c')],_0x5622c0[_0x861b('0x2d')]);_0x16b254['attributes']=_['intersection'](_0x5622c0[_0x861b('0x2c')],qs['fields'](_0x563c79[_0x861b('0x2d')]['fields']));_0x16b254[_0x861b('0x30')]=_0x16b254[_0x861b('0x30')][_0x861b('0x32')]?_0x16b254['attributes']:_0x5622c0[_0x861b('0x2c')];if(_0x563c79['query']['includeAll']){_0x16b254[_0x861b('0x3c')]=[{'all':!![]}];}_0x16b254=_[_0x861b('0x39')]({},_0x16b254,_0x563c79[_0x861b('0x42')]);return db[_0x861b('0x28')][_0x861b('0x43')](_0x16b254)[_0x861b('0x20')](handleEntityNotFound(_0x43ad5d,null))['then'](respondWithResult(_0x43ad5d,null))[_0x861b('0x3e')](handleError(_0x43ad5d,null));};exports[_0x861b('0x44')]=function(_0x428eb9,_0x227628){return db[_0x861b('0x28')]['create'](_0x428eb9[_0x861b('0x45')],{})['then'](respondWithResult(_0x227628,0xc9))[_0x861b('0x3e')](handleError(_0x227628,null));};exports[_0x861b('0x1f')]=function(_0x1caffd,_0x16505c){if(_0x1caffd[_0x861b('0x45')]['id']){delete _0x1caffd[_0x861b('0x45')]['id'];}return db[_0x861b('0x28')][_0x861b('0x43')]({'where':{'id':_0x1caffd[_0x861b('0x40')]['id']}})[_0x861b('0x20')](handleEntityNotFound(_0x16505c,null))[_0x861b('0x20')](saveUpdates(_0x1caffd[_0x861b('0x45')],null))[_0x861b('0x20')](respondWithResult(_0x16505c,null))[_0x861b('0x3e')](handleError(_0x16505c,null));};exports[_0x861b('0x21')]=function(_0x57957a,_0x548cfb){return db[_0x861b('0x28')]['find']({'where':{'id':_0x57957a[_0x861b('0x40')]['id']}})[_0x861b('0x20')](handleEntityNotFound(_0x548cfb,null))['then'](removeEntity(_0x548cfb,null))[_0x861b('0x3e')](handleError(_0x548cfb,null));};
\ No newline at end of file
+var _0xd4d2=['limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','include','findAll','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined'];(function(_0x268f60,_0x24a661){var _0x172f4b=function(_0x4a8738){while(--_0x4a8738){_0x268f60['push'](_0x268f60['shift']());}};_0x172f4b(++_0x24a661);}(_0xd4d2,0x154));var _0x2d4d=function(_0x442a62,_0xd4fca4){_0x442a62=_0x442a62-0x0;var _0x34d0a9=_0xd4d2[_0x442a62];return _0x34d0a9;};'use strict';var emlformat=require(_0x2d4d('0x0'));var rimraf=require(_0x2d4d('0x1'));var zipdir=require(_0x2d4d('0x2'));var jsonpatch=require(_0x2d4d('0x3'));var rp=require('request-promise');var moment=require(_0x2d4d('0x4'));var BPromise=require(_0x2d4d('0x5'));var Mustache=require(_0x2d4d('0x6'));var util=require(_0x2d4d('0x7'));var path=require(_0x2d4d('0x8'));var sox=require(_0x2d4d('0x9'));var csv=require(_0x2d4d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d4d('0xb'));var _=require(_0x2d4d('0xc'));var squel=require(_0x2d4d('0xd'));var crypto=require(_0x2d4d('0xe'));var jsforce=require(_0x2d4d('0xf'));var deskjs=require(_0x2d4d('0x10'));var toCsv=require(_0x2d4d('0xa'));var querystring=require('querystring');var Papa=require(_0x2d4d('0x11'));var Redis=require(_0x2d4d('0x12'));var authService=require(_0x2d4d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d4d('0x14'));var logger=require(_0x2d4d('0x15'))(_0x2d4d('0x16'));var utils=require(_0x2d4d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4d('0x18'));var db=require(_0x2d4d('0x19'))['db'];function respondWithStatusCode(_0x4581e7,_0x3a2a0c){_0x3a2a0c=_0x3a2a0c||0xcc;return function(_0x30b6ae){if(_0x30b6ae){return _0x4581e7[_0x2d4d('0x1a')](_0x3a2a0c);}return _0x4581e7[_0x2d4d('0x1b')](_0x3a2a0c)[_0x2d4d('0x1c')]();};}function respondWithResult(_0x45d528,_0x5827b5){_0x5827b5=_0x5827b5||0xc8;return function(_0x1931d7){if(_0x1931d7){return _0x45d528[_0x2d4d('0x1b')](_0x5827b5)['json'](_0x1931d7);}};}function respondWithFilteredResult(_0x16fd9e,_0x4f1c7f){return function(_0xb6a85c){if(_0xb6a85c){var _0x86d271=typeof _0x4f1c7f['offset']===_0x2d4d('0x1d')&&typeof _0x4f1c7f[_0x2d4d('0x1e')]===_0x2d4d('0x1d');var _0xed6173=_0xb6a85c['count'];var _0x55643b=_0x86d271?0x0:_0x4f1c7f[_0x2d4d('0x1f')];var _0xd8506e=_0x86d271?_0xb6a85c[_0x2d4d('0x20')]:_0x4f1c7f[_0x2d4d('0x1f')]+_0x4f1c7f[_0x2d4d('0x1e')];var _0x5b784b;if(_0xd8506e>=_0xed6173){_0xd8506e=_0xed6173;_0x5b784b=0xc8;}else{_0x5b784b=0xce;}_0x16fd9e[_0x2d4d('0x1b')](_0x5b784b);return _0x16fd9e[_0x2d4d('0x21')](_0x2d4d('0x22'),_0x55643b+'-'+_0xd8506e+'/'+_0xed6173)[_0x2d4d('0x23')](_0xb6a85c);}return null;};}function patchUpdates(_0x5aea62){return function(_0x289541){try{jsonpatch[_0x2d4d('0x24')](_0x289541,_0x5aea62,!![]);}catch(_0x835131){return BPromise[_0x2d4d('0x25')](_0x835131);}return _0x289541[_0x2d4d('0x26')]();};}function saveUpdates(_0xd4030d,_0x1c2564){return function(_0x5573d3){if(_0x5573d3){return _0x5573d3[_0x2d4d('0x27')](_0xd4030d)[_0x2d4d('0x28')](function(_0x29d6e4){return _0x29d6e4;});}return null;};}function removeEntity(_0x1330f6,_0xe1fb25){return function(_0xf73a6){if(_0xf73a6){return _0xf73a6[_0x2d4d('0x29')]()[_0x2d4d('0x28')](function(){_0x1330f6['status'](0xcc)[_0x2d4d('0x1c')]();});}};}function handleEntityNotFound(_0x988294,_0x2e8654){return function(_0x350d66){if(!_0x350d66){_0x988294[_0x2d4d('0x1a')](0x194);}return _0x350d66;};}function handleError(_0x153b31,_0x31c727){_0x31c727=_0x31c727||0x1f4;return function(_0x368238){logger[_0x2d4d('0x2a')](_0x368238[_0x2d4d('0x2b')]);if(_0x368238[_0x2d4d('0x2c')]){delete _0x368238[_0x2d4d('0x2c')];}_0x153b31[_0x2d4d('0x1b')](_0x31c727)[_0x2d4d('0x2d')](_0x368238);};}exports[_0x2d4d('0x2e')]=function(_0x5cf4d3,_0xdde5e1){var _0x335f3c={},_0x541a40={},_0xe85a3f={'count':0x0,'rows':[]};var _0x3fd53c=_[_0x2d4d('0x2f')](db[_0x2d4d('0x30')]['rawAttributes'],function(_0x4d91ad){return{'name':_0x4d91ad[_0x2d4d('0x31')],'type':_0x4d91ad[_0x2d4d('0x32')]['key']};});_0x541a40[_0x2d4d('0x33')]=_[_0x2d4d('0x2f')](_0x3fd53c,_0x2d4d('0x2c'));_0x541a40[_0x2d4d('0x34')]=_[_0x2d4d('0x35')](_0x5cf4d3[_0x2d4d('0x34')]);_0x541a40[_0x2d4d('0x36')]=_[_0x2d4d('0x37')](_0x541a40[_0x2d4d('0x33')],_0x541a40[_0x2d4d('0x34')]);_0x335f3c['attributes']=_[_0x2d4d('0x37')](_0x541a40[_0x2d4d('0x33')],qs['fields'](_0x5cf4d3['query'][_0x2d4d('0x38')]));_0x335f3c[_0x2d4d('0x39')]=_0x335f3c[_0x2d4d('0x39')][_0x2d4d('0x3a')]?_0x335f3c['attributes']:_0x541a40[_0x2d4d('0x33')];if(!_0x5cf4d3[_0x2d4d('0x34')][_0x2d4d('0x3b')](_0x2d4d('0x3c'))){_0x335f3c[_0x2d4d('0x1e')]=qs[_0x2d4d('0x1e')](_0x5cf4d3[_0x2d4d('0x34')][_0x2d4d('0x1e')]);_0x335f3c[_0x2d4d('0x1f')]=qs[_0x2d4d('0x1f')](_0x5cf4d3[_0x2d4d('0x34')][_0x2d4d('0x1f')]);}_0x335f3c['order']=qs[_0x2d4d('0x3d')](_0x5cf4d3[_0x2d4d('0x34')]['sort']);_0x335f3c[_0x2d4d('0x3e')]=qs[_0x2d4d('0x36')](_[_0x2d4d('0x3f')](_0x5cf4d3[_0x2d4d('0x34')],_0x541a40[_0x2d4d('0x36')]),_0x3fd53c);if(_0x5cf4d3['query']['filter']){_0x335f3c[_0x2d4d('0x3e')]=_[_0x2d4d('0x40')](_0x335f3c['where'],{'$or':_[_0x2d4d('0x2f')](_0x3fd53c,function(_0x34b162){if(_0x34b162[_0x2d4d('0x32')]!=='VIRTUAL'){var _0x2d4fd7={};_0x2d4fd7[_0x34b162[_0x2d4d('0x2c')]]={'$like':'%'+_0x5cf4d3[_0x2d4d('0x34')]['filter']+'%'};return _0x2d4fd7;}})});}_0x335f3c=_[_0x2d4d('0x40')]({},_0x335f3c,_0x5cf4d3[_0x2d4d('0x41')]);var _0x46639f={'where':_0x335f3c['where']};return db['ZohoField'][_0x2d4d('0x20')](_0x46639f)[_0x2d4d('0x28')](function(_0x4b199e){_0xe85a3f[_0x2d4d('0x20')]=_0x4b199e;if(_0x5cf4d3[_0x2d4d('0x34')]['includeAll']){_0x335f3c[_0x2d4d('0x42')]=[{'all':!![]}];}return db[_0x2d4d('0x30')][_0x2d4d('0x43')](_0x335f3c);})['then'](function(_0x27e8fc){_0xe85a3f['rows']=_0x27e8fc;return _0xe85a3f;})[_0x2d4d('0x28')](respondWithFilteredResult(_0xdde5e1,_0x335f3c))['catch'](handleError(_0xdde5e1,null));};exports['show']=function(_0x106a78,_0x7c3afa){var _0x16245a={'raw':!![],'where':{'id':_0x106a78[_0x2d4d('0x44')]['id']}},_0x14f0e9={};_0x14f0e9[_0x2d4d('0x33')]=_[_0x2d4d('0x35')](db[_0x2d4d('0x30')][_0x2d4d('0x45')]);_0x14f0e9[_0x2d4d('0x34')]=_[_0x2d4d('0x35')](_0x106a78['query']);_0x14f0e9[_0x2d4d('0x36')]=_[_0x2d4d('0x37')](_0x14f0e9[_0x2d4d('0x33')],_0x14f0e9['query']);_0x16245a['attributes']=_[_0x2d4d('0x37')](_0x14f0e9[_0x2d4d('0x33')],qs['fields'](_0x106a78[_0x2d4d('0x34')][_0x2d4d('0x38')]));_0x16245a['attributes']=_0x16245a[_0x2d4d('0x39')][_0x2d4d('0x3a')]?_0x16245a[_0x2d4d('0x39')]:_0x14f0e9[_0x2d4d('0x33')];if(_0x106a78[_0x2d4d('0x34')]['includeAll']){_0x16245a[_0x2d4d('0x42')]=[{'all':!![]}];}_0x16245a=_['merge']({},_0x16245a,_0x106a78['options']);return db['ZohoField'][_0x2d4d('0x46')](_0x16245a)[_0x2d4d('0x28')](handleEntityNotFound(_0x7c3afa,null))[_0x2d4d('0x28')](respondWithResult(_0x7c3afa,null))[_0x2d4d('0x47')](handleError(_0x7c3afa,null));};exports['create']=function(_0x16987c,_0x5e584b){return db[_0x2d4d('0x30')][_0x2d4d('0x48')](_0x16987c[_0x2d4d('0x49')],{})[_0x2d4d('0x28')](respondWithResult(_0x5e584b,0xc9))[_0x2d4d('0x47')](handleError(_0x5e584b,null));};exports[_0x2d4d('0x27')]=function(_0x3f989b,_0x46cb77){if(_0x3f989b[_0x2d4d('0x49')]['id']){delete _0x3f989b['body']['id'];}return db[_0x2d4d('0x30')][_0x2d4d('0x46')]({'where':{'id':_0x3f989b['params']['id']}})[_0x2d4d('0x28')](handleEntityNotFound(_0x46cb77,null))[_0x2d4d('0x28')](saveUpdates(_0x3f989b['body'],null))[_0x2d4d('0x28')](respondWithResult(_0x46cb77,null))[_0x2d4d('0x47')](handleError(_0x46cb77,null));};exports[_0x2d4d('0x29')]=function(_0x52990a,_0x17204d){return db[_0x2d4d('0x30')][_0x2d4d('0x46')]({'where':{'id':_0x52990a[_0x2d4d('0x44')]['id']}})['then'](handleEntityNotFound(_0x17204d,null))[_0x2d4d('0x28')](removeEntity(_0x17204d,null))[_0x2d4d('0x47')](handleError(_0x17204d,null));};
\ No newline at end of file
index ba23c24..9a3ab40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField'];(function(_0x59fbcc,_0xf658ff){var _0x537f4c=function(_0xa0b1ab){while(--_0xa0b1ab){_0x59fbcc['push'](_0x59fbcc['shift']());}};_0x537f4c(++_0xf658ff);}(_0x1883,0xab));var _0x3188=function(_0x2366c3,_0x45e906){_0x2366c3=_0x2366c3-0x0;var _0x1ef97f=_0x1883[_0x2366c3];return _0x1ef97f;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x3188('0xf'),_0x3188('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x5a6d4f,_0x15369a){var _0xc8485f=function(_0x404e58){while(--_0x404e58){_0x5a6d4f['push'](_0x5a6d4f['shift']());}};_0xc8485f(++_0x15369a);}(_0x5464,0x15d));var _0x4546=function(_0x41b83e,_0x190e4a){_0x41b83e=_0x41b83e-0x0;var _0x1f267e=_0x5464[_0x41b83e];return _0x1f267e;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2ee72bb..5ff6603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc610=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6133cf,_0x2c8596){var _0x3e5cb5=function(_0xbc7db1){while(--_0xbc7db1){_0x6133cf['push'](_0x6133cf['shift']());}};_0x3e5cb5(++_0x2c8596);}(_0xc610,0xff));var _0x0c61=function(_0x168dab,_0x4abfce){_0x168dab=_0x168dab-0x0;var _0x166a20=_0xc610[_0x168dab];return _0x166a20;};'use strict';var _=require(_0x0c61('0x0'));var util=require(_0x0c61('0x1'));var moment=require('moment');var BPromise=require(_0x0c61('0x2'));var rs=require(_0x0c61('0x3'));var fs=require('fs');var Redis=require(_0x0c61('0x4'));var db=require(_0x0c61('0x5'))['db'];var utils=require(_0x0c61('0x6'));var logger=require(_0x0c61('0x7'))(_0x0c61('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c61('0x9')][_0x0c61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cecd1,_0x136a79,_0x5d49fe){return new BPromise(function(_0x374ca7,_0x5450d0){return client[_0x0c61('0xb')](_0x1cecd1,_0x5d49fe)[_0x0c61('0xc')](function(_0x1f7a02){logger[_0x0c61('0xd')](_0x0c61('0xe'),_0x136a79,_0x0c61('0xf'));logger[_0x0c61('0x10')](_0x0c61('0x11'),_0x136a79,_0x0c61('0xf'),JSON[_0x0c61('0x12')](_0x1f7a02));if(_0x1f7a02[_0x0c61('0x13')]){if(_0x1f7a02[_0x0c61('0x13')][_0x0c61('0x14')]===0x1f4){logger[_0x0c61('0x13')]('ZohoField,\x20%s,\x20%s',_0x136a79,_0x1f7a02['error'][_0x0c61('0x15')]);return _0x5450d0(_0x1f7a02[_0x0c61('0x13')][_0x0c61('0x15')]);}logger[_0x0c61('0x13')](_0x0c61('0xe'),_0x136a79,_0x1f7a02['error']['message']);return _0x374ca7(_0x1f7a02['error']['message']);}else{logger[_0x0c61('0xd')](_0x0c61('0xe'),_0x136a79,_0x0c61('0xf'));_0x374ca7(_0x1f7a02[_0x0c61('0x16')]['message']);}})['catch'](function(_0x5ed21a){logger[_0x0c61('0x13')](_0x0c61('0xe'),_0x136a79,_0x5ed21a);_0x5450d0(_0x5ed21a);});});}
\ No newline at end of file
+var _0x7d6c=['randomstring','../../config/utils','rpc','client','http','request','then','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x39d665,_0x2de428){var _0x545f13=function(_0x336bcd){while(--_0x336bcd){_0x39d665['push'](_0x39d665['shift']());}};_0x545f13(++_0x2de428);}(_0x7d6c,0x96));var _0xc7d6=function(_0x54d6a1,_0xd0d91e){_0x54d6a1=_0x54d6a1-0x0;var _0x5f4f37=_0x7d6c[_0x54d6a1];return _0x5f4f37;};'use strict';var _=require(_0xc7d6('0x0'));var util=require('util');var moment=require(_0xc7d6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7d6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc7d6('0x3'));var logger=require('../../config/logger')(_0xc7d6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7d6('0x5')][_0xc7d6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2149ec,_0x442850,_0xaa9fcd){return new BPromise(function(_0x46deb5,_0x1a03f0){return client[_0xc7d6('0x7')](_0x2149ec,_0xaa9fcd)[_0xc7d6('0x8')](function(_0x5480c1){logger['info'](_0xc7d6('0x9'),_0x442850,'request\x20sent');logger[_0xc7d6('0xa')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x442850,_0xc7d6('0xb'),JSON[_0xc7d6('0xc')](_0x5480c1));if(_0x5480c1[_0xc7d6('0xd')]){if(_0x5480c1[_0xc7d6('0xd')][_0xc7d6('0xe')]===0x1f4){logger[_0xc7d6('0xd')]('ZohoField,\x20%s,\x20%s',_0x442850,_0x5480c1[_0xc7d6('0xd')][_0xc7d6('0xf')]);return _0x1a03f0(_0x5480c1[_0xc7d6('0xd')][_0xc7d6('0xf')]);}logger[_0xc7d6('0xd')](_0xc7d6('0x9'),_0x442850,_0x5480c1[_0xc7d6('0xd')]['message']);return _0x46deb5(_0x5480c1[_0xc7d6('0xd')][_0xc7d6('0xf')]);}else{logger[_0xc7d6('0x10')](_0xc7d6('0x9'),_0x442850,_0xc7d6('0xb'));_0x46deb5(_0x5480c1[_0xc7d6('0x11')]['message']);}})[_0xc7d6('0x12')](function(_0x57bed1){logger[_0xc7d6('0xd')]('ZohoField,\x20%s,\x20%s',_0x442850,_0x57bed1);_0x1a03f0(_0x57bed1);});});}
\ No newline at end of file
index 4b12cbf..79249ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x44c951,_0x2186a4){var _0x3d74d4=function(_0x488e9d){while(--_0x488e9d){_0x44c951['push'](_0x44c951['shift']());}};_0x3d74d4(++_0x2186a4);}(_0x70e0,0x17b));var _0x070e=function(_0x1e86b4,_0x263dd5){_0x1e86b4=_0x1e86b4-0x0;var _0xe4e5dc=_0x70e0[_0x1e86b4];return _0xe4e5dc;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x39d38e,_0x3da1f7){var _0x18e737=function(_0x373eef){while(--_0x373eef){_0x39d38e['push'](_0x39d38e['shift']());}};_0x18e737(++_0x3da1f7);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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
index 63e5ef4..06622c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ead=['unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x3e3742,_0x4b078a){var _0x3e87b9=function(_0x4fadc1){while(--_0x4fadc1){_0x3e3742['push'](_0x3e3742['shift']());}};_0x3e87b9(++_0x4b078a);}(_0x8ead,0x108));var _0xd8ea=function(_0x227d8c,_0x30a8e7){_0x227d8c=_0x227d8c-0x0;var _0xe8fdf0=_0x8ead[_0x227d8c];return _0xe8fdf0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd8ea('0x0')},'version':{'type':Sequelize[_0xd8ea('0x1')],'allowNull':![],'unique':_0xd8ea('0x0')},'main':{'type':Sequelize[_0xd8ea('0x1')],'defaultValue':_0xd8ea('0x2')},'filename':{'type':Sequelize[_0xd8ea('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd8ea('0x1')]},'size':{'type':Sequelize[_0xd8ea('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xd8ea('0x1')]},'state':{'type':Sequelize[_0xd8ea('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xd8ea('0x1')]},'title':{'type':Sequelize[_0xd8ea('0x1')]},'remoteUri':{'type':Sequelize[_0xd8ea('0x1')]},'link':{'type':Sequelize[_0xd8ea('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xec79=['STRING','app.js','INTEGER','BOOLEAN','state','sequelize','exports','unique_name_and_version'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec79,0xdd));var _0x9ec7=function(_0x24d503,_0x515509){_0x24d503=_0x24d503-0x0;var _0x4fd82c=_0xec79[_0x24d503];return _0x4fd82c;};'use strict';var Sequelize=require(_0x9ec7('0x0'));module[_0x9ec7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ec7('0x2')},'version':{'type':Sequelize[_0x9ec7('0x3')],'allowNull':![],'unique':_0x9ec7('0x2')},'main':{'type':Sequelize[_0x9ec7('0x3')],'defaultValue':_0x9ec7('0x4')},'filename':{'type':Sequelize[_0x9ec7('0x3')]},'path':{'type':Sequelize[_0x9ec7('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9ec7('0x5')]},'active':{'type':Sequelize[_0x9ec7('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x9ec7('0x3')]},'logo':{'type':Sequelize[_0x9ec7('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x9ec7('0x7')},'description':{'type':Sequelize[_0x9ec7('0x3')]},'title':{'type':Sequelize[_0x9ec7('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x9ec7('0x3')],'defaultValue':'#'}};
\ No newline at end of file
index 82aacec..c8f227a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x524e,0x15e));var _0xe524=function(_0x2b67de,_0x3870e0){_0x2b67de=_0x2b67de-0x0;var _0x282f6f=_0x524e[_0x2b67de];return _0x282f6f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};
\ No newline at end of file
+var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x4c60,0xc1));var _0x04c6=function(_0x12fedc,_0x4103c3){_0x12fedc=_0x12fedc-0x0;var _0x248813=_0x4c60[_0x12fedc];return _0x248813;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};
\ No newline at end of file
index 160ec04..7728a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa94=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./integration.attributes','exports','integrations'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0xfa94,0x19a));var _0x4fa9=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0xfa94[_0x55af86];return _0x58df3b;};'use strict';var _=require(_0x4fa9('0x0'));var util=require(_0x4fa9('0x1'));var logger=require(_0x4fa9('0x2'))(_0x4fa9('0x3'));var moment=require('moment');var BPromise=require(_0x4fa9('0x4'));var rp=require(_0x4fa9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fa9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fa9('0x7'));module[_0x4fa9('0x8')]=function(_0x3da308,_0x48d10f){return _0x3da308['define']('Integration',attributes,{'tableName':_0x4fa9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x329b=['./integration.attributes','exports','Integration','integrations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2c2ce5,_0x40c283){var _0x5b7bee=function(_0x543522){while(--_0x543522){_0x2c2ce5['push'](_0x2c2ce5['shift']());}};_0x5b7bee(++_0x40c283);}(_0x329b,0x122));var _0xb329=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x329b[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xb329('0x0'));var util=require('util');var logger=require(_0xb329('0x1'))('api');var moment=require(_0xb329('0x2'));var BPromise=require(_0xb329('0x3'));var rp=require(_0xb329('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb329('0x5'));var config=require(_0xb329('0x6'));var attributes=require(_0xb329('0x7'));module[_0xb329('0x8')]=function(_0x45067c,_0x4ada33){return _0x45067c['define'](_0xb329('0x9'),attributes,{'tableName':_0xb329('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c450250..0ef8f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\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(_0x7c5c66,_0x161323){var _0x1a01ff=function(_0x3f9c12){while(--_0x3f9c12){_0x7c5c66['push'](_0x7c5c66['shift']());}};_0x1a01ff(++_0x161323);}(_0x2542,0x169));var _0x2254=function(_0x136dd3,_0x1225b1){_0x136dd3=_0x136dd3-0x0;var _0x3593a4=_0x2542[_0x136dd3];return _0x3593a4;};'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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xce8c73,_0x2ea89e){var _0x14d8e7=function(_0x343f24){while(--_0x343f24){_0xce8c73['push'](_0xce8c73['shift']());}};_0x14d8e7(++_0x2ea89e);}(_0x7880,0x1f4));var _0x0788=function(_0xad08b3,_0x2a3003){_0xad08b3=_0xad08b3-0x0;var _0xb6c9b6=_0x7880[_0xad08b3];return _0xb6c9b6;};'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
index 540f650..9c23f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1d1ad3,_0x42b8a0){var _0x26f380=function(_0x59bd6c){while(--_0x59bd6c){_0x1d1ad3['push'](_0x1d1ad3['shift']());}};_0x26f380(++_0x42b8a0);}(_0xef0f,0x168));var _0xfef0=function(_0x3429db,_0x582375){_0x3429db=_0x3429db-0x0;var _0x243f3b=_0xef0f[_0x3429db];return _0x243f3b;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xda2d,0x102));var _0xdda2=function(_0x42f82a,_0x5bf74c){_0x42f82a=_0x42f82a-0x0;var _0xdbf4b4=_0xda2d[_0x42f82a];return _0xdbf4b4;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 934a71e..28156ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76f2=['RECEIVED','sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x28e0d3,_0x3ef242){var _0x594965=function(_0x3e5c71){while(--_0x3e5c71){_0x28e0d3['push'](_0x28e0d3['shift']());}};_0x594965(++_0x3ef242);}(_0x76f2,0x19b));var _0x276f=function(_0x156119,_0x2d27cb){_0x156119=_0x156119-0x0;var _0x3ab53a=_0x76f2[_0x156119];return _0x3ab53a;};'use strict';var Sequelize=require(_0x276f('0x0'));module['exports']={'integration':{'type':Sequelize[_0x276f('0x1')]},'eventChannel':{'type':Sequelize[_0x276f('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x276f('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x276f('0x1')]},'uniqueid':{'type':Sequelize[_0x276f('0x1')]},'calleridnum':{'type':Sequelize[_0x276f('0x1')]},'calleridname':{'type':Sequelize[_0x276f('0x1')]},'queue':{'type':Sequelize[_0x276f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x276f('0x1')]},'agentcalledAt':{'type':Sequelize[_0x276f('0x2')]},'agentconnectAt':{'type':Sequelize[_0x276f('0x2')]},'holdtime':{'type':Sequelize[_0x276f('0x3')]},'agentcomplete':{'type':Sequelize[_0x276f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x276f('0x3')]},'agentacw':{'type':Sequelize[_0x276f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x276f('0x3')]},'reason':{'type':Sequelize[_0x276f('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x276f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x276f('0x2')]},'agentdump':{'type':Sequelize[_0x276f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x276f('0x2')]},'lastevent':{'type':Sequelize[_0x276f('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x276f('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x276f('0x1')]},'language':{'type':Sequelize[_0x276f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x276f('0x1')]},'exten':{'type':Sequelize[_0x276f('0x1')]},'priority':{'type':Sequelize[_0x276f('0x1')]},'destchannel':{'type':Sequelize[_0x276f('0x1')]},'destchannelstate':{'type':Sequelize[_0x276f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x276f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x276f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x276f('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x276f('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x276f('0x1')]},'destexten':{'type':Sequelize[_0x276f('0x1')]},'destpriority':{'type':Sequelize[_0x276f('0x1')]},'destuniqueid':{'type':Sequelize[_0x276f('0x1')]},'messageId':{'type':Sequelize[_0x276f('0x1')]},'inReplyTo':{'type':Sequelize[_0x276f('0x1')]},'subject':{'type':Sequelize[_0x276f('0x1')]},'from':{'type':Sequelize[_0x276f('0x1')]},'to':{'type':Sequelize[_0x276f('0x1')]},'cc':{'type':Sequelize[_0x276f('0x1')]},'attachment':{'type':Sequelize[_0x276f('0x5')]},'html':{'type':Sequelize[_0x276f('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x276f('0x6')](_0x276f('0x7'),_0x276f('0x8'),_0x276f('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x276f('0x1')]},'projectId':{'type':Sequelize[_0x276f('0x3')]}};
\ No newline at end of file
+var _0xbba4=['BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE'];(function(_0xd91e0d,_0x1b1d31){var _0x4fb3a5=function(_0x14fa73){while(--_0x14fa73){_0xd91e0d['push'](_0xd91e0d['shift']());}};_0x4fb3a5(++_0x1b1d31);}(_0xbba4,0x1be));var _0x4bba=function(_0x37ea22,_0x11076d){_0x37ea22=_0x37ea22-0x0;var _0x3ee4db=_0xbba4[_0x37ea22];return _0x3ee4db;};'use strict';var Sequelize=require('sequelize');module[_0x4bba('0x0')]={'integration':{'type':Sequelize[_0x4bba('0x1')]},'eventChannel':{'type':Sequelize[_0x4bba('0x1')]},'exitStatus':{'type':Sequelize[_0x4bba('0x1')]},'ticketId':{'type':Sequelize[_0x4bba('0x1')]},'integrationId':{'type':Sequelize[_0x4bba('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4bba('0x1')]},'calleridnum':{'type':Sequelize[_0x4bba('0x1')]},'calleridname':{'type':Sequelize[_0x4bba('0x1')]},'queue':{'type':Sequelize[_0x4bba('0x1')]},'interface':{'type':Sequelize[_0x4bba('0x1')]},'membername':{'type':Sequelize[_0x4bba('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4bba('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4bba('0x3')]},'holdtime':{'type':Sequelize[_0x4bba('0x2')]},'agentcomplete':{'type':Sequelize[_0x4bba('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4bba('0x3')]},'talktime':{'type':Sequelize[_0x4bba('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4bba('0x2')]},'reason':{'type':Sequelize[_0x4bba('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4bba('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4bba('0x3')]},'agentdump':{'type':Sequelize[_0x4bba('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4bba('0x3')]},'lastevent':{'type':Sequelize[_0x4bba('0x1')]},'channel':{'type':Sequelize[_0x4bba('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x4bba('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4bba('0x1')]},'language':{'type':Sequelize[_0x4bba('0x1')]},'accountcode':{'type':Sequelize[_0x4bba('0x1')]},'context':{'type':Sequelize[_0x4bba('0x1')]},'exten':{'type':Sequelize[_0x4bba('0x1')]},'priority':{'type':Sequelize[_0x4bba('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4bba('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4bba('0x1')]},'destcalleridname':{'type':Sequelize[_0x4bba('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4bba('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4bba('0x1')]},'destlanguage':{'type':Sequelize[_0x4bba('0x1')]},'destaccountcode':{'type':Sequelize[_0x4bba('0x1')]},'destcontext':{'type':Sequelize[_0x4bba('0x1')]},'destexten':{'type':Sequelize[_0x4bba('0x1')]},'destpriority':{'type':Sequelize[_0x4bba('0x1')]},'destuniqueid':{'type':Sequelize[_0x4bba('0x1')]},'messageId':{'type':Sequelize[_0x4bba('0x1')]},'inReplyTo':{'type':Sequelize[_0x4bba('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4bba('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4bba('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4bba('0x6')]('SENT',_0x4bba('0x7'),_0x4bba('0x8'),_0x4bba('0x9'))},'url':{'type':Sequelize[_0x4bba('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4bba('0x1')]},'projectId':{'type':Sequelize[_0x4bba('0x2')]}};
\ No newline at end of file
index 5d8d29c..b5c6015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dc3=['jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','IntegrationReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0x1dc3,0x81));var _0x31dc=function(_0x343a68,_0x30af9c){_0x343a68=_0x343a68-0x0;var _0x1b5c7c=_0x1dc3[_0x343a68];return _0x1b5c7c;};'use strict';var emlformat=require(_0x31dc('0x0'));var rimraf=require(_0x31dc('0x1'));var zipdir=require(_0x31dc('0x2'));var jsonpatch=require(_0x31dc('0x3'));var rp=require(_0x31dc('0x4'));var moment=require(_0x31dc('0x5'));var BPromise=require(_0x31dc('0x6'));var Mustache=require('mustache');var util=require(_0x31dc('0x7'));var path=require(_0x31dc('0x8'));var sox=require(_0x31dc('0x9'));var csv=require('to-csv');var ejs=require(_0x31dc('0xa'));var fs=require('fs');var fs_extra=require(_0x31dc('0xb'));var _=require(_0x31dc('0xc'));var squel=require(_0x31dc('0xd'));var crypto=require(_0x31dc('0xe'));var jsforce=require(_0x31dc('0xf'));var deskjs=require(_0x31dc('0x10'));var toCsv=require(_0x31dc('0x11'));var querystring=require(_0x31dc('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31dc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31dc('0x14'));var logger=require(_0x31dc('0x15'))(_0x31dc('0x16'));var utils=require(_0x31dc('0x17'));var config=require(_0x31dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x31dc('0x19'))['db'];function respondWithStatusCode(_0x26c075,_0x29cc58){_0x29cc58=_0x29cc58||0xcc;return function(_0x4f88a1){if(_0x4f88a1){return _0x26c075['sendStatus'](_0x29cc58);}return _0x26c075[_0x31dc('0x1a')](_0x29cc58)[_0x31dc('0x1b')]();};}function respondWithResult(_0x1829c4,_0x353dd1){_0x353dd1=_0x353dd1||0xc8;return function(_0x27eb19){if(_0x27eb19){return _0x1829c4[_0x31dc('0x1a')](_0x353dd1)[_0x31dc('0x1c')](_0x27eb19);}};}function respondWithFilteredResult(_0x15b82a,_0x5479d1){return function(_0xa896df){if(_0xa896df){var _0xb1c039=typeof _0x5479d1[_0x31dc('0x1d')]===_0x31dc('0x1e')&&typeof _0x5479d1['limit']===_0x31dc('0x1e');var _0x320302=_0xa896df[_0x31dc('0x1f')];var _0x1393ee=_0xb1c039?0x0:_0x5479d1['offset'];var _0x2222cf=_0xb1c039?_0xa896df[_0x31dc('0x1f')]:_0x5479d1['offset']+_0x5479d1[_0x31dc('0x20')];var _0x439a54;if(_0x2222cf>=_0x320302){_0x2222cf=_0x320302;_0x439a54=0xc8;}else{_0x439a54=0xce;}_0x15b82a[_0x31dc('0x1a')](_0x439a54);return _0x15b82a[_0x31dc('0x21')](_0x31dc('0x22'),_0x1393ee+'-'+_0x2222cf+'/'+_0x320302)[_0x31dc('0x1c')](_0xa896df);}return null;};}function patchUpdates(_0x5dedd7){return function(_0x20fb34){try{jsonpatch[_0x31dc('0x23')](_0x20fb34,_0x5dedd7,!![]);}catch(_0x28fa39){return BPromise[_0x31dc('0x24')](_0x28fa39);}return _0x20fb34[_0x31dc('0x25')]();};}function saveUpdates(_0x19d4bc,_0x140130){return function(_0x5014c4){if(_0x5014c4){return _0x5014c4[_0x31dc('0x26')](_0x19d4bc)[_0x31dc('0x27')](function(_0x2eddc6){return _0x2eddc6;});}return null;};}function removeEntity(_0x9fe931,_0x5321a2){return function(_0x3380f2){if(_0x3380f2){return _0x3380f2[_0x31dc('0x28')]()[_0x31dc('0x27')](function(){_0x9fe931['status'](0xcc)[_0x31dc('0x1b')]();});}};}function handleEntityNotFound(_0x2d938c,_0x2d4e76){return function(_0x290f05){if(!_0x290f05){_0x2d938c['sendStatus'](0x194);}return _0x290f05;};}function handleError(_0x4e1aea,_0x4144d6){_0x4144d6=_0x4144d6||0x1f4;return function(_0x246047){logger['error'](_0x246047['stack']);if(_0x246047[_0x31dc('0x29')]){delete _0x246047[_0x31dc('0x29')];}_0x4e1aea[_0x31dc('0x1a')](_0x4144d6)['send'](_0x246047);};}exports[_0x31dc('0x2a')]=function(_0x37f088,_0x32f138){var _0x37ca64={},_0x19253d={},_0x118933={'count':0x0,'rows':[]};var _0x38a943=_['map'](db[_0x31dc('0x2b')]['rawAttributes'],function(_0x272dd4){return{'name':_0x272dd4[_0x31dc('0x2c')],'type':_0x272dd4['type'][_0x31dc('0x2d')]};});_0x19253d[_0x31dc('0x2e')]=_[_0x31dc('0x2f')](_0x38a943,_0x31dc('0x29'));_0x19253d[_0x31dc('0x30')]=_[_0x31dc('0x31')](_0x37f088['query']);_0x19253d[_0x31dc('0x32')]=_[_0x31dc('0x33')](_0x19253d[_0x31dc('0x2e')],_0x19253d[_0x31dc('0x30')]);_0x37ca64[_0x31dc('0x34')]=_[_0x31dc('0x33')](_0x19253d['model'],qs[_0x31dc('0x35')](_0x37f088[_0x31dc('0x30')][_0x31dc('0x35')]));_0x37ca64[_0x31dc('0x34')]=_0x37ca64['attributes']['length']?_0x37ca64[_0x31dc('0x34')]:_0x19253d[_0x31dc('0x2e')];if(!_0x37f088[_0x31dc('0x30')][_0x31dc('0x36')]('nolimit')){_0x37ca64['limit']=qs[_0x31dc('0x20')](_0x37f088[_0x31dc('0x30')]['limit']);_0x37ca64[_0x31dc('0x1d')]=qs[_0x31dc('0x1d')](_0x37f088[_0x31dc('0x30')][_0x31dc('0x1d')]);}_0x37ca64[_0x31dc('0x37')]=qs[_0x31dc('0x38')](_0x37f088[_0x31dc('0x30')]['sort']);_0x37ca64['where']=qs[_0x31dc('0x32')](_[_0x31dc('0x39')](_0x37f088[_0x31dc('0x30')],_0x19253d[_0x31dc('0x32')]),_0x38a943);if(_0x37f088['query']['filter']){_0x37ca64['where']=_[_0x31dc('0x3a')](_0x37ca64[_0x31dc('0x3b')],{'$or':_[_0x31dc('0x2f')](_0x38a943,function(_0x2f696f){if(_0x2f696f[_0x31dc('0x3c')]!==_0x31dc('0x3d')){var _0x502862={};_0x502862[_0x2f696f[_0x31dc('0x29')]]={'$like':'%'+_0x37f088[_0x31dc('0x30')]['filter']+'%'};return _0x502862;}})});}_0x37ca64=_['merge']({},_0x37ca64,_0x37f088[_0x31dc('0x3e')]);var _0x4f4192={'where':_0x37ca64[_0x31dc('0x3b')]};return db[_0x31dc('0x2b')][_0x31dc('0x1f')](_0x4f4192)[_0x31dc('0x27')](function(_0x2a7933){_0x118933[_0x31dc('0x1f')]=_0x2a7933;if(_0x37f088[_0x31dc('0x30')][_0x31dc('0x3f')]){_0x37ca64[_0x31dc('0x40')]=[{'all':!![]}];}return db[_0x31dc('0x2b')][_0x31dc('0x41')](_0x37ca64);})[_0x31dc('0x27')](function(_0x25be4a){_0x118933['rows']=_0x25be4a;return _0x118933;})['then'](respondWithFilteredResult(_0x32f138,_0x37ca64))['catch'](handleError(_0x32f138,null));};exports['show']=function(_0xb06ab7,_0x416dc0){var _0x3a937e={'raw':![],'where':{'id':_0xb06ab7[_0x31dc('0x42')]['id']}},_0xe99426={};_0xe99426[_0x31dc('0x2e')]=_[_0x31dc('0x31')](db[_0x31dc('0x2b')]['rawAttributes']);_0xe99426[_0x31dc('0x30')]=_['keys'](_0xb06ab7['query']);_0xe99426['filters']=_['intersection'](_0xe99426['model'],_0xe99426[_0x31dc('0x30')]);_0x3a937e[_0x31dc('0x34')]=_[_0x31dc('0x33')](_0xe99426[_0x31dc('0x2e')],qs[_0x31dc('0x35')](_0xb06ab7[_0x31dc('0x30')][_0x31dc('0x35')]));_0x3a937e[_0x31dc('0x34')]=_0x3a937e['attributes']['length']?_0x3a937e[_0x31dc('0x34')]:_0xe99426[_0x31dc('0x2e')];if(_0xb06ab7[_0x31dc('0x30')][_0x31dc('0x3f')]){_0x3a937e[_0x31dc('0x40')]=[{'all':!![]}];}_0x3a937e=_[_0x31dc('0x3a')]({},_0x3a937e,_0xb06ab7[_0x31dc('0x3e')]);return db['IntegrationReport'][_0x31dc('0x43')](_0x3a937e)[_0x31dc('0x27')](handleEntityNotFound(_0x416dc0,null))[_0x31dc('0x27')](respondWithResult(_0x416dc0,null))[_0x31dc('0x44')](handleError(_0x416dc0,null));};exports['create']=function(_0x2845a0,_0x5c0205){return db[_0x31dc('0x2b')][_0x31dc('0x45')](_0x2845a0[_0x31dc('0x46')],{})['then'](respondWithResult(_0x5c0205,0xc9))['catch'](handleError(_0x5c0205,null));};exports['update']=function(_0x527719,_0x2d5653){if(_0x527719[_0x31dc('0x46')]['id']){delete _0x527719[_0x31dc('0x46')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x527719[_0x31dc('0x42')]['id']}})[_0x31dc('0x27')](handleEntityNotFound(_0x2d5653,null))[_0x31dc('0x27')](saveUpdates(_0x527719[_0x31dc('0x46')],null))['then'](respondWithResult(_0x2d5653,null))[_0x31dc('0x44')](handleError(_0x2d5653,null));};exports[_0x31dc('0x28')]=function(_0x29f00b,_0x29d1e4){return db['IntegrationReport'][_0x31dc('0x43')]({'where':{'id':_0x29f00b[_0x31dc('0x42')]['id']}})['then'](handleEntityNotFound(_0x29d1e4,null))[_0x31dc('0x27')](removeEntity(_0x29d1e4,null))[_0x31dc('0x44')](handleError(_0x29d1e4,null));};exports[_0x31dc('0x47')]=function(_0x4d2e53,_0x336a16){return db[_0x31dc('0x2b')][_0x31dc('0x47')]()[_0x31dc('0x27')](respondWithResult(_0x336a16,null))[_0x31dc('0x44')](handleError(_0x336a16,null));};
\ No newline at end of file
+var _0xb6fa=['type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','options','catch','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','IntegrationReport','rawAttributes'];(function(_0x3120b6,_0x27cd22){var _0x31a36b=function(_0x54fe05){while(--_0x54fe05){_0x3120b6['push'](_0x3120b6['shift']());}};_0x31a36b(++_0x27cd22);}(_0xb6fa,0x185));var _0xab6f=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xb6fa[_0x1602ef];return _0x5870ee;};'use strict';var emlformat=require(_0xab6f('0x0'));var rimraf=require(_0xab6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab6f('0x2'));var rp=require('request-promise');var moment=require(_0xab6f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xab6f('0x4'));var util=require(_0xab6f('0x5'));var path=require('path');var sox=require(_0xab6f('0x6'));var csv=require(_0xab6f('0x7'));var ejs=require(_0xab6f('0x8'));var fs=require('fs');var fs_extra=require(_0xab6f('0x9'));var _=require('lodash');var squel=require(_0xab6f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xab6f('0x7'));var querystring=require(_0xab6f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xab6f('0xc'));var as=require(_0xab6f('0xd'));var hardwareService=require(_0xab6f('0xe'));var logger=require(_0xab6f('0xf'))(_0xab6f('0x10'));var utils=require(_0xab6f('0x11'));var config=require(_0xab6f('0x12'));var licenseUtil=require(_0xab6f('0x13'));var db=require(_0xab6f('0x14'))['db'];function respondWithStatusCode(_0x385989,_0x34f09c){_0x34f09c=_0x34f09c||0xcc;return function(_0x5224f0){if(_0x5224f0){return _0x385989['sendStatus'](_0x34f09c);}return _0x385989[_0xab6f('0x15')](_0x34f09c)[_0xab6f('0x16')]();};}function respondWithResult(_0x28bbab,_0x428571){_0x428571=_0x428571||0xc8;return function(_0x4fa84b){if(_0x4fa84b){return _0x28bbab[_0xab6f('0x15')](_0x428571)['json'](_0x4fa84b);}};}function respondWithFilteredResult(_0x2d6ab7,_0x2588a0){return function(_0x5b89cc){if(_0x5b89cc){var _0x5c3fd0=typeof _0x2588a0[_0xab6f('0x17')]===_0xab6f('0x18')&&typeof _0x2588a0[_0xab6f('0x19')]==='undefined';var _0x4b715b=_0x5b89cc[_0xab6f('0x1a')];var _0x98fa65=_0x5c3fd0?0x0:_0x2588a0[_0xab6f('0x17')];var _0x1c0c03=_0x5c3fd0?_0x5b89cc[_0xab6f('0x1a')]:_0x2588a0[_0xab6f('0x17')]+_0x2588a0['limit'];var _0x154a8c;if(_0x1c0c03>=_0x4b715b){_0x1c0c03=_0x4b715b;_0x154a8c=0xc8;}else{_0x154a8c=0xce;}_0x2d6ab7['status'](_0x154a8c);return _0x2d6ab7[_0xab6f('0x1b')](_0xab6f('0x1c'),_0x98fa65+'-'+_0x1c0c03+'/'+_0x4b715b)[_0xab6f('0x1d')](_0x5b89cc);}return null;};}function patchUpdates(_0x49c354){return function(_0xa32b1c){try{jsonpatch[_0xab6f('0x1e')](_0xa32b1c,_0x49c354,!![]);}catch(_0x30e4ed){return BPromise['reject'](_0x30e4ed);}return _0xa32b1c[_0xab6f('0x1f')]();};}function saveUpdates(_0xeb1ac4,_0xadee20){return function(_0x1db86d){if(_0x1db86d){return _0x1db86d[_0xab6f('0x20')](_0xeb1ac4)['then'](function(_0x1a36db){return _0x1a36db;});}return null;};}function removeEntity(_0x158538,_0x102931){return function(_0xe30f0a){if(_0xe30f0a){return _0xe30f0a[_0xab6f('0x21')]()[_0xab6f('0x22')](function(){_0x158538[_0xab6f('0x15')](0xcc)[_0xab6f('0x16')]();});}};}function handleEntityNotFound(_0x127c73,_0xe26459){return function(_0x4563d8){if(!_0x4563d8){_0x127c73[_0xab6f('0x23')](0x194);}return _0x4563d8;};}function handleError(_0x50e239,_0x14b3aa){_0x14b3aa=_0x14b3aa||0x1f4;return function(_0x3c1b7c){logger[_0xab6f('0x24')](_0x3c1b7c['stack']);if(_0x3c1b7c[_0xab6f('0x25')]){delete _0x3c1b7c['name'];}_0x50e239['status'](_0x14b3aa)[_0xab6f('0x26')](_0x3c1b7c);};}exports[_0xab6f('0x27')]=function(_0x5a3238,_0x35247b){var _0x38cdf9={},_0x3e0385={},_0x3af588={'count':0x0,'rows':[]};var _0xd9a32f=_[_0xab6f('0x28')](db[_0xab6f('0x29')][_0xab6f('0x2a')],function(_0x47f9cb){return{'name':_0x47f9cb['fieldName'],'type':_0x47f9cb[_0xab6f('0x2b')][_0xab6f('0x2c')]};});_0x3e0385[_0xab6f('0x2d')]=_[_0xab6f('0x28')](_0xd9a32f,_0xab6f('0x25'));_0x3e0385['query']=_[_0xab6f('0x2e')](_0x5a3238[_0xab6f('0x2f')]);_0x3e0385['filters']=_[_0xab6f('0x30')](_0x3e0385['model'],_0x3e0385[_0xab6f('0x2f')]);_0x38cdf9['attributes']=_[_0xab6f('0x30')](_0x3e0385[_0xab6f('0x2d')],qs[_0xab6f('0x31')](_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x31')]));_0x38cdf9[_0xab6f('0x32')]=_0x38cdf9['attributes']['length']?_0x38cdf9[_0xab6f('0x32')]:_0x3e0385[_0xab6f('0x2d')];if(!_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x33')](_0xab6f('0x34'))){_0x38cdf9[_0xab6f('0x19')]=qs[_0xab6f('0x19')](_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x19')]);_0x38cdf9[_0xab6f('0x17')]=qs[_0xab6f('0x17')](_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x17')]);}_0x38cdf9[_0xab6f('0x35')]=qs[_0xab6f('0x36')](_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x36')]);_0x38cdf9[_0xab6f('0x37')]=qs[_0xab6f('0x38')](_[_0xab6f('0x39')](_0x5a3238[_0xab6f('0x2f')],_0x3e0385[_0xab6f('0x38')]),_0xd9a32f);if(_0x5a3238[_0xab6f('0x2f')]['filter']){_0x38cdf9['where']=_[_0xab6f('0x3a')](_0x38cdf9['where'],{'$or':_[_0xab6f('0x28')](_0xd9a32f,function(_0x171567){if(_0x171567[_0xab6f('0x2b')]!==_0xab6f('0x3b')){var _0xdd7778={};_0xdd7778[_0x171567[_0xab6f('0x25')]]={'$like':'%'+_0x5a3238['query'][_0xab6f('0x3c')]+'%'};return _0xdd7778;}})});}_0x38cdf9=_[_0xab6f('0x3a')]({},_0x38cdf9,_0x5a3238['options']);var _0x4321f6={'where':_0x38cdf9['where']};return db[_0xab6f('0x29')][_0xab6f('0x1a')](_0x4321f6)[_0xab6f('0x22')](function(_0x463c62){_0x3af588['count']=_0x463c62;if(_0x5a3238[_0xab6f('0x2f')][_0xab6f('0x3d')]){_0x38cdf9[_0xab6f('0x3e')]=[{'all':!![]}];}return db[_0xab6f('0x29')][_0xab6f('0x3f')](_0x38cdf9);})[_0xab6f('0x22')](function(_0x2b79c8){_0x3af588[_0xab6f('0x40')]=_0x2b79c8;return _0x3af588;})['then'](respondWithFilteredResult(_0x35247b,_0x38cdf9))['catch'](handleError(_0x35247b,null));};exports[_0xab6f('0x41')]=function(_0x5040fd,_0x30edd0){var _0x1f9828={'raw':![],'where':{'id':_0x5040fd[_0xab6f('0x42')]['id']}},_0x2b586e={};_0x2b586e['model']=_[_0xab6f('0x2e')](db['IntegrationReport'][_0xab6f('0x2a')]);_0x2b586e['query']=_[_0xab6f('0x2e')](_0x5040fd[_0xab6f('0x2f')]);_0x2b586e[_0xab6f('0x38')]=_[_0xab6f('0x30')](_0x2b586e[_0xab6f('0x2d')],_0x2b586e[_0xab6f('0x2f')]);_0x1f9828['attributes']=_[_0xab6f('0x30')](_0x2b586e[_0xab6f('0x2d')],qs['fields'](_0x5040fd[_0xab6f('0x2f')][_0xab6f('0x31')]));_0x1f9828[_0xab6f('0x32')]=_0x1f9828[_0xab6f('0x32')][_0xab6f('0x43')]?_0x1f9828[_0xab6f('0x32')]:_0x2b586e[_0xab6f('0x2d')];if(_0x5040fd[_0xab6f('0x2f')][_0xab6f('0x3d')]){_0x1f9828[_0xab6f('0x3e')]=[{'all':!![]}];}_0x1f9828=_[_0xab6f('0x3a')]({},_0x1f9828,_0x5040fd[_0xab6f('0x44')]);return db['IntegrationReport']['find'](_0x1f9828)[_0xab6f('0x22')](handleEntityNotFound(_0x30edd0,null))[_0xab6f('0x22')](respondWithResult(_0x30edd0,null))[_0xab6f('0x45')](handleError(_0x30edd0,null));};exports['create']=function(_0x2f7019,_0x3cb417){return db['IntegrationReport']['create'](_0x2f7019[_0xab6f('0x46')],{})['then'](respondWithResult(_0x3cb417,0xc9))['catch'](handleError(_0x3cb417,null));};exports[_0xab6f('0x20')]=function(_0x5554ac,_0x57ae55){if(_0x5554ac[_0xab6f('0x46')]['id']){delete _0x5554ac[_0xab6f('0x46')]['id'];}return db[_0xab6f('0x29')][_0xab6f('0x47')]({'where':{'id':_0x5554ac[_0xab6f('0x42')]['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x57ae55,null))[_0xab6f('0x22')](saveUpdates(_0x5554ac[_0xab6f('0x46')],null))[_0xab6f('0x22')](respondWithResult(_0x57ae55,null))['catch'](handleError(_0x57ae55,null));};exports[_0xab6f('0x21')]=function(_0x51481a,_0x2a179e){return db['IntegrationReport'][_0xab6f('0x47')]({'where':{'id':_0x51481a[_0xab6f('0x42')]['id']}})[_0xab6f('0x22')](handleEntityNotFound(_0x2a179e,null))[_0xab6f('0x22')](removeEntity(_0x2a179e,null))[_0xab6f('0x45')](handleError(_0x2a179e,null));};exports['describe']=function(_0x1eebc0,_0x3ee983){return db['IntegrationReport']['describe']()[_0xab6f('0x22')](respondWithResult(_0x3ee983,null))[_0xab6f('0x45')](handleError(_0x3ee983,null));};
\ No newline at end of file
index ba5c8ff..f1ec4a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e3=['rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','../../config/logger','api','bluebird','request-promise'];(function(_0x4570b5,_0x15f0a6){var _0x4ce1b5=function(_0x42d7f8){while(--_0x42d7f8){_0x4570b5['push'](_0x4570b5['shift']());}};_0x4ce1b5(++_0x15f0a6);}(_0x64e3,0xc4));var _0x364e=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x64e3[_0x5dee2a];return _0x31e98e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x364e('0x0'))(_0x364e('0x1'));var moment=require('moment');var BPromise=require(_0x364e('0x2'));var rp=require(_0x364e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x364e('0x4'));var config=require('../../config/environment');var attributes=require(_0x364e('0x5'));module[_0x364e('0x6')]=function(_0x3327c1,_0x18d4e9){return _0x3327c1[_0x364e('0x7')](_0x364e('0x8'),attributes,{'tableName':_0x364e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87f0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x87f0,0x1a2));var _0x087f=function(_0xf76dad,_0x46764c){_0xf76dad=_0xf76dad-0x0;var _0x295cd4=_0x87f0[_0xf76dad];return _0x295cd4;};'use strict';var _=require(_0x087f('0x0'));var util=require('util');var logger=require(_0x087f('0x1'))(_0x087f('0x2'));var moment=require(_0x087f('0x3'));var BPromise=require(_0x087f('0x4'));var rp=require(_0x087f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x087f('0x6'));var config=require(_0x087f('0x7'));var attributes=require(_0x087f('0x8'));module[_0x087f('0x9')]=function(_0xec6824,_0x41455f){return _0xec6824[_0x087f('0xa')](_0x087f('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a703d37..c83af8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}
\ No newline at end of file
+var _0x0295=['client','http','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e2f65,_0x3fff64){var _0x485810=function(_0x231447){while(--_0x231447){_0x2e2f65['push'](_0x2e2f65['shift']());}};_0x485810(++_0x3fff64);}(_0x0295,0x1f0));var _0x5029=function(_0x3f7e42,_0x47fafe){_0x3f7e42=_0x3f7e42-0x0;var _0x3bfbe8=_0x0295[_0x3f7e42];return _0x3bfbe8;};'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')]('IntegrationReport,\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
index 43634a6..b23f0cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf518=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xf518,0xd4));var _0x8f51=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xf518[_0x5e9a69];return _0x5979c8;};'use strict';var multer=require('multer');var util=require(_0x8f51('0x0'));var path=require('path');var timeout=require(_0x8f51('0x1'));var express=require(_0x8f51('0x2'));var router=express[_0x8f51('0x3')]();var fs_extra=require(_0x8f51('0x4'));var auth=require(_0x8f51('0x5'));var interaction=require(_0x8f51('0x6'));var config=require(_0x8f51('0x7'));var controller=require('./interval.controller');router[_0x8f51('0x8')]('/',auth[_0x8f51('0x9')](),controller[_0x8f51('0xa')]);router[_0x8f51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8f51('0xb')]);router[_0x8f51('0x8')](_0x8f51('0xc'),auth[_0x8f51('0x9')](),controller[_0x8f51('0xd')]);router[_0x8f51('0xe')]('/',auth[_0x8f51('0x9')](),controller[_0x8f51('0xf')]);router['post']('/:id/sub_intervals',auth[_0x8f51('0x9')](),controller['addInterval']);router[_0x8f51('0xe')](_0x8f51('0x10'),auth[_0x8f51('0x9')](),controller[_0x8f51('0x11')]);router[_0x8f51('0x12')](_0x8f51('0x13'),auth[_0x8f51('0x9')](),controller[_0x8f51('0x14')]);router[_0x8f51('0x15')](_0x8f51('0x13'),auth[_0x8f51('0x9')](),controller[_0x8f51('0x16')]);module[_0x8f51('0x17')]=router;
\ No newline at end of file
+var _0xa992=['addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create'];(function(_0xe5d86c,_0x790db0){var _0x1be6e4=function(_0x21f831){while(--_0x21f831){_0xe5d86c['push'](_0xe5d86c['shift']());}};_0x1be6e4(++_0x790db0);}(_0xa992,0xc4));var _0x2a99=function(_0x1ca2bc,_0x47bd88){_0x1ca2bc=_0x1ca2bc-0x0;var _0x46ea21=_0xa992[_0x1ca2bc];return _0x46ea21;};'use strict';var multer=require(_0x2a99('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2a99('0x1'));var router=express[_0x2a99('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2a99('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2a99('0x4'));var controller=require('./interval.controller');router[_0x2a99('0x5')]('/',auth['isAuthenticated'](),controller[_0x2a99('0x6')]);router[_0x2a99('0x5')](_0x2a99('0x7'),auth[_0x2a99('0x8')](),controller[_0x2a99('0x9')]);router[_0x2a99('0x5')](_0x2a99('0xa'),auth[_0x2a99('0x8')](),controller[_0x2a99('0xb')]);router[_0x2a99('0xc')]('/',auth[_0x2a99('0x8')](),controller[_0x2a99('0xd')]);router['post'](_0x2a99('0xa'),auth[_0x2a99('0x8')](),controller[_0x2a99('0xe')]);router[_0x2a99('0xc')](_0x2a99('0xf'),auth[_0x2a99('0x8')](),controller[_0x2a99('0x10')]);router['put'](_0x2a99('0x7'),auth[_0x2a99('0x8')](),controller[_0x2a99('0x11')]);router[_0x2a99('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2a99('0x13')]);module[_0x2a99('0x14')]=router;
\ No newline at end of file
index 29ac83f..c17aa2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bd=['STRING','sequelize'];(function(_0x37d4f6,_0x3285d7){var _0x2f52f3=function(_0x191815){while(--_0x191815){_0x37d4f6['push'](_0x37d4f6['shift']());}};_0x2f52f3(++_0x3285d7);}(_0x52bd,0x187));var _0xd52b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x52bd[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0xd52b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd52b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd52b('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xcb68=['STRING','sequelize'];(function(_0x7a254b,_0x58494f){var _0x3656b3=function(_0x2e2d68){while(--_0x2e2d68){_0x7a254b['push'](_0x7a254b['shift']());}};_0x3656b3(++_0x58494f);}(_0xcb68,0xb1));var _0x8cb6=function(_0x4548cb,_0x17163f){_0x4548cb=_0x4548cb-0x0;var _0x4e863b=_0xcb68[_0x4548cb];return _0x4e863b;};'use strict';var Sequelize=require(_0x8cb6('0x0'));module['exports']={'name':{'type':Sequelize[_0x8cb6('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index c34b0b9..641a4a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x627c=['update','destroy','then','get','Intervals','end','error','name','send','index','map','Interval','rawAttributes','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save'];(function(_0x2f3f3a,_0x574a87){var _0x4c0485=function(_0x57cee1){while(--_0x57cee1){_0x2f3f3a['push'](_0x2f3f3a['shift']());}};_0x4c0485(++_0x574a87);}(_0x627c,0x8e));var _0xc627=function(_0x6a58ae,_0x307312){_0x6a58ae=_0x6a58ae-0x0;var _0x4a5d2f=_0x627c[_0x6a58ae];return _0x4a5d2f;};'use strict';var emlformat=require(_0xc627('0x0'));var rimraf=require(_0xc627('0x1'));var zipdir=require(_0xc627('0x2'));var jsonpatch=require(_0xc627('0x3'));var rp=require(_0xc627('0x4'));var moment=require(_0xc627('0x5'));var BPromise=require(_0xc627('0x6'));var Mustache=require(_0xc627('0x7'));var util=require(_0xc627('0x8'));var path=require(_0xc627('0x9'));var sox=require(_0xc627('0xa'));var csv=require(_0xc627('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc627('0xc'));var _=require(_0xc627('0xd'));var squel=require(_0xc627('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc627('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc627('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc627('0x11'));var qs=require(_0xc627('0x12'));var as=require(_0xc627('0x13'));var hardwareService=require(_0xc627('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc627('0x15'));var config=require(_0xc627('0x16'));var licenseUtil=require(_0xc627('0x17'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2f1d1c,_0x54a570){_0x54a570=_0x54a570||0xcc;return function(_0x1fd46d){if(_0x1fd46d){return _0x2f1d1c[_0xc627('0x18')](_0x54a570);}return _0x2f1d1c[_0xc627('0x19')](_0x54a570)['end']();};}function respondWithResult(_0x355647,_0x329ffa){_0x329ffa=_0x329ffa||0xc8;return function(_0x15c5b4){if(_0x15c5b4){return _0x355647['status'](_0x329ffa)[_0xc627('0x1a')](_0x15c5b4);}};}function respondWithFilteredResult(_0x1bc958,_0xd502a){return function(_0x578712){if(_0x578712){var _0x4a6719=typeof _0xd502a[_0xc627('0x1b')]===_0xc627('0x1c')&&typeof _0xd502a[_0xc627('0x1d')]==='undefined';var _0xd39318=_0x578712['count'];var _0x3a5229=_0x4a6719?0x0:_0xd502a[_0xc627('0x1b')];var _0x2a1b33=_0x4a6719?_0x578712[_0xc627('0x1e')]:_0xd502a[_0xc627('0x1b')]+_0xd502a['limit'];var _0x59cafa;if(_0x2a1b33>=_0xd39318){_0x2a1b33=_0xd39318;_0x59cafa=0xc8;}else{_0x59cafa=0xce;}_0x1bc958[_0xc627('0x19')](_0x59cafa);return _0x1bc958[_0xc627('0x1f')]('Content-Range',_0x3a5229+'-'+_0x2a1b33+'/'+_0xd39318)[_0xc627('0x1a')](_0x578712);}return null;};}function patchUpdates(_0x44f902){return function(_0x3ecf9a){try{jsonpatch[_0xc627('0x20')](_0x3ecf9a,_0x44f902,!![]);}catch(_0x900834){return BPromise['reject'](_0x900834);}return _0x3ecf9a[_0xc627('0x21')]();};}function saveUpdates(_0x86125d,_0x33f8a7){return function(_0x5dc050){if(_0x5dc050){return _0x5dc050[_0xc627('0x22')](_0x86125d)['then'](function(_0x56c9f5){return _0x56c9f5;});}return null;};}function removeEntity(_0xfb9543,_0x2fb80e){return function(_0x1ba878){if(_0x1ba878){return _0x1ba878[_0xc627('0x23')]()[_0xc627('0x24')](function(){var _0x45142d=_0x1ba878[_0xc627('0x25')]({'plain':!![]});var _0x51a78b=_0xc627('0x26');return db['UserProfileResource'][_0xc627('0x23')]({'where':{'type':_0x51a78b,'resourceId':_0x45142d['id']}})[_0xc627('0x24')](function(){return _0x1ba878;});})[_0xc627('0x24')](function(){_0xfb9543[_0xc627('0x19')](0xcc)[_0xc627('0x27')]();});}};}function handleEntityNotFound(_0x2395fa,_0x58bfdc){return function(_0x18c299){if(!_0x18c299){_0x2395fa[_0xc627('0x18')](0x194);}return _0x18c299;};}function handleError(_0x188651,_0x56cf97){_0x56cf97=_0x56cf97||0x1f4;return function(_0x309596){logger[_0xc627('0x28')](_0x309596['stack']);if(_0x309596[_0xc627('0x29')]){delete _0x309596[_0xc627('0x29')];}_0x188651[_0xc627('0x19')](_0x56cf97)[_0xc627('0x2a')](_0x309596);};}exports[_0xc627('0x2b')]=function(_0x451bc1,_0x304233){var _0x5b9550={},_0x5e9952={},_0x4c1d18={'count':0x0,'rows':[]};var _0x1c414d=_[_0xc627('0x2c')](db[_0xc627('0x2d')][_0xc627('0x2e')],function(_0x1ddf6c){return{'name':_0x1ddf6c['fieldName'],'type':_0x1ddf6c['type']['key']};});_0x5e9952[_0xc627('0x2f')]=_[_0xc627('0x2c')](_0x1c414d,_0xc627('0x29'));_0x5e9952[_0xc627('0x30')]=_[_0xc627('0x31')](_0x451bc1['query']);_0x5e9952['filters']=_['intersection'](_0x5e9952[_0xc627('0x2f')],_0x5e9952[_0xc627('0x30')]);_0x5b9550[_0xc627('0x32')]=_[_0xc627('0x33')](_0x5e9952['model'],qs[_0xc627('0x34')](_0x451bc1['query']['fields']));_0x5b9550[_0xc627('0x32')]=_0x5b9550['attributes'][_0xc627('0x35')]?_0x5b9550[_0xc627('0x32')]:_0x5e9952[_0xc627('0x2f')];if(!_0x451bc1[_0xc627('0x30')]['hasOwnProperty'](_0xc627('0x36'))){_0x5b9550[_0xc627('0x1d')]=qs['limit'](_0x451bc1['query'][_0xc627('0x1d')]);_0x5b9550[_0xc627('0x1b')]=qs[_0xc627('0x1b')](_0x451bc1['query']['offset']);}_0x5b9550['order']=qs[_0xc627('0x37')](_0x451bc1[_0xc627('0x30')][_0xc627('0x37')]);_0x5b9550[_0xc627('0x38')]=qs[_0xc627('0x39')](_[_0xc627('0x3a')](_0x451bc1['query'],_0x5e9952[_0xc627('0x39')]),_0x1c414d);if(_0x451bc1[_0xc627('0x30')][_0xc627('0x3b')]){_0x5b9550[_0xc627('0x38')]=_[_0xc627('0x3c')](_0x5b9550['where'],{'$or':_['map'](_0x1c414d,function(_0x35bf71){if(_0x35bf71[_0xc627('0x3d')]!=='VIRTUAL'){var _0x187495={};_0x187495[_0x35bf71[_0xc627('0x29')]]={'$like':'%'+_0x451bc1[_0xc627('0x30')][_0xc627('0x3b')]+'%'};return _0x187495;}})});}_0x5b9550=_[_0xc627('0x3c')]({},_0x5b9550,_0x451bc1[_0xc627('0x3e')]);var _0x12d81e={'where':_0x5b9550[_0xc627('0x38')]};return db[_0xc627('0x2d')][_0xc627('0x1e')](_0x12d81e)[_0xc627('0x24')](function(_0x4366e6){_0x4c1d18[_0xc627('0x1e')]=_0x4366e6;if(_0x451bc1[_0xc627('0x30')][_0xc627('0x3f')]){_0x5b9550[_0xc627('0x40')]=[{'all':!![]}];}return db['Interval'][_0xc627('0x41')](_0x5b9550);})['then'](function(_0x28907e){_0x4c1d18[_0xc627('0x42')]=_0x28907e;return _0x4c1d18;})[_0xc627('0x24')](respondWithFilteredResult(_0x304233,_0x5b9550))['catch'](handleError(_0x304233,null));};exports['show']=function(_0x1934c3,_0x5533ee){var _0x3935b2={'raw':!![],'where':{'id':_0x1934c3[_0xc627('0x43')]['id']}},_0x1395f6={};_0x1395f6[_0xc627('0x2f')]=_[_0xc627('0x31')](db['Interval']['rawAttributes']);_0x1395f6[_0xc627('0x30')]=_['keys'](_0x1934c3[_0xc627('0x30')]);_0x1395f6['filters']=_['intersection'](_0x1395f6[_0xc627('0x2f')],_0x1395f6['query']);_0x3935b2[_0xc627('0x32')]=_[_0xc627('0x33')](_0x1395f6[_0xc627('0x2f')],qs[_0xc627('0x34')](_0x1934c3[_0xc627('0x30')][_0xc627('0x34')]));_0x3935b2['attributes']=_0x3935b2[_0xc627('0x32')][_0xc627('0x35')]?_0x3935b2[_0xc627('0x32')]:_0x1395f6[_0xc627('0x2f')];if(_0x1934c3[_0xc627('0x30')][_0xc627('0x3f')]){_0x3935b2[_0xc627('0x40')]=[{'all':!![]}];}_0x3935b2=_[_0xc627('0x3c')]({},_0x3935b2,_0x1934c3[_0xc627('0x3e')]);return db[_0xc627('0x2d')][_0xc627('0x44')](_0x3935b2)[_0xc627('0x24')](handleEntityNotFound(_0x5533ee,null))['then'](respondWithResult(_0x5533ee,null))['catch'](handleError(_0x5533ee,null));};exports[_0xc627('0x45')]=function(_0x51aab6,_0xbb40a1){return db[_0xc627('0x2d')][_0xc627('0x45')](_0x51aab6[_0xc627('0x46')],{})['then'](function(_0x2a4a3c){var _0x48ccf5=_0x51aab6[_0xc627('0x47')][_0xc627('0x25')]({'plain':!![]});if(!_0x48ccf5)throw new Error(_0xc627('0x48'));if(_0x48ccf5[_0xc627('0x49')]==='user'){var _0xc2750c=_0x2a4a3c[_0xc627('0x25')]({'plain':!![]});var _0x4b4007=_0xc627('0x26');return db[_0xc627('0x4a')][_0xc627('0x44')]({'where':{'name':_0x4b4007,'userProfileId':_0x48ccf5[_0xc627('0x4b')]},'raw':!![]})[_0xc627('0x24')](function(_0x53cb09){if(_0x53cb09&&_0x53cb09[_0xc627('0x4c')]===0x0){return db[_0xc627('0x4d')][_0xc627('0x45')]({'name':_0xc2750c[_0xc627('0x29')],'resourceId':_0xc2750c['id'],'type':_0x53cb09['name'],'sectionId':_0x53cb09['id']},{})[_0xc627('0x24')](function(){return _0x2a4a3c;});}else{return _0x2a4a3c;}})[_0xc627('0x4e')](function(_0x4d5ed8){logger[_0xc627('0x28')](_0xc627('0x4f'),_0x4d5ed8);throw _0x4d5ed8;});}return _0x2a4a3c;})[_0xc627('0x24')](respondWithResult(_0xbb40a1,0xc9))['catch'](handleError(_0xbb40a1,null));};exports[_0xc627('0x22')]=function(_0x320f0a,_0x43a3e8){if(_0x320f0a[_0xc627('0x46')]['id']){delete _0x320f0a['body']['id'];}return db[_0xc627('0x2d')][_0xc627('0x44')]({'where':{'id':_0x320f0a['params']['id']}})[_0xc627('0x24')](handleEntityNotFound(_0x43a3e8,null))[_0xc627('0x24')](saveUpdates(_0x320f0a[_0xc627('0x46')],null))[_0xc627('0x24')](respondWithResult(_0x43a3e8,null))[_0xc627('0x4e')](handleError(_0x43a3e8,null));};exports[_0xc627('0x23')]=function(_0x837765,_0xf227fb){return db['Interval'][_0xc627('0x44')]({'where':{'id':_0x837765['params']['id']}})[_0xc627('0x24')](handleEntityNotFound(_0xf227fb,null))['then'](removeEntity(_0xf227fb,null))['catch'](handleError(_0xf227fb,null));};exports[_0xc627('0x50')]=function(_0x1b2d63,_0x3d1e73,_0x144a6e){if(_0x1b2d63[_0xc627('0x46')]['id']){delete _0x1b2d63['body']['id'];}return db[_0xc627('0x2d')]['find']({'where':{'id':_0x1b2d63[_0xc627('0x43')]['id']}})[_0xc627('0x24')](handleEntityNotFound(_0x3d1e73,null))[_0xc627('0x24')](function(_0x104ffe){if(_0x104ffe){_0x1b2d63[_0xc627('0x46')][_0xc627('0x51')]=_0x104ffe['id'];return db['Interval'][_0xc627('0x45')](_0x1b2d63[_0xc627('0x46')]);}})[_0xc627('0x24')](respondWithResult(_0x3d1e73,null))[_0xc627('0x4e')](handleError(_0x3d1e73,null));};exports[_0xc627('0x52')]=function(_0x1b9769,_0x4c84e5,_0x1028ef){var _0x1a830e={};var _0x1b95ef={};var _0x358faa;var _0x356473;return db[_0xc627('0x2d')][_0xc627('0x53')]({'where':{'id':_0x1b9769[_0xc627('0x43')]['id']}})[_0xc627('0x24')](handleEntityNotFound(_0x4c84e5,null))[_0xc627('0x24')](function(_0x3f50f1){if(_0x3f50f1){_0x358faa=_0x3f50f1;_0x1b95ef[_0xc627('0x2f')]=_[_0xc627('0x31')](db[_0xc627('0x2d')]['rawAttributes']);_0x1b95ef['query']=_['keys'](_0x1b9769[_0xc627('0x30')]);_0x1b95ef[_0xc627('0x39')]=_['intersection'](_0x1b95ef['model'],_0x1b95ef[_0xc627('0x30')]);_0x1a830e[_0xc627('0x32')]=_[_0xc627('0x33')](_0x1b95ef[_0xc627('0x2f')],qs[_0xc627('0x34')](_0x1b9769['query'][_0xc627('0x34')]));_0x1a830e['attributes']=_0x1a830e[_0xc627('0x32')][_0xc627('0x35')]?_0x1a830e[_0xc627('0x32')]:_0x1b95ef[_0xc627('0x2f')];_0x1a830e['order']=qs['sort'](_0x1b9769['query'][_0xc627('0x37')]);_0x1a830e['where']=qs[_0xc627('0x39')](_['pick'](_0x1b9769['query'],_0x1b95ef[_0xc627('0x39')]));if(_0x1b9769[_0xc627('0x30')][_0xc627('0x3b')]){_0x1a830e[_0xc627('0x38')]=_[_0xc627('0x3c')](_0x1a830e[_0xc627('0x38')],{'$or':_['map'](_0x1a830e[_0xc627('0x32')],function(_0x488aed){var _0xf0b295={};_0xf0b295[_0x488aed]={'$like':'%'+_0x1b9769[_0xc627('0x30')][_0xc627('0x3b')]+'%'};return _0xf0b295;})});}_0x1a830e=_['merge']({},_0x1a830e,_0x1b9769['options']);return _0x358faa[_0xc627('0x52')](_0x1a830e);}})[_0xc627('0x24')](function(_0x3469b8){if(_0x3469b8){_0x356473=_0x3469b8['length'];if(!_0x1b9769[_0xc627('0x30')]['hasOwnProperty'](_0xc627('0x36'))){_0x1a830e[_0xc627('0x1d')]=qs['limit'](_0x1b9769[_0xc627('0x30')]['limit']);_0x1a830e[_0xc627('0x1b')]=qs[_0xc627('0x1b')](_0x1b9769[_0xc627('0x30')][_0xc627('0x1b')]);}return _0x358faa[_0xc627('0x52')](_0x1a830e);}})[_0xc627('0x24')](function(_0x484c3e){if(_0x484c3e){return _0x484c3e?{'count':_0x356473,'rows':_0x484c3e}:null;}})['then'](respondWithResult(_0x4c84e5,null))[_0xc627('0x4e')](handleError(_0x4c84e5,null));};exports[_0xc627('0x54')]=function(_0xd9cf1a,_0x3af668,_0x4efab3){return db[_0xc627('0x2d')][_0xc627('0x53')]({'where':{'id':_0xd9cf1a[_0xc627('0x43')]['id']}})['then'](handleEntityNotFound(_0x3af668,null))['then'](function(_0xc706a8){if(_0xc706a8){return db[_0xc627('0x55')][_0xc627('0x56')](function(_0x304399){return db[_0xc627('0x2d')][_0xc627('0x23')]({'where':{'IntervalId':_0xd9cf1a['params']['id']},'transaction':_0x304399})[_0xc627('0x24')](function(_0x1b064f){var _0x472d8f=_[_0xc627('0x2c')](_0xd9cf1a[_0xc627('0x46')],function(_0x471c7e){delete _0x471c7e['id'];_0x471c7e[_0xc627('0x51')]=_0xd9cf1a[_0xc627('0x43')]['id'];return _0x471c7e;});return db[_0xc627('0x2d')][_0xc627('0x57')](_0x472d8f,{'transaction':_0x304399});});})[_0xc627('0x24')](function(){return db['Interval'][_0xc627('0x41')]({'where':{'IntervalId':_0xd9cf1a[_0xc627('0x43')]['id']}});});}})[_0xc627('0x24')](respondWithResult(_0x3af668,null))[_0xc627('0x4e')](handleError(_0x3af668,null));};
\ No newline at end of file
+var _0x3c8f=['model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','include','findAll','rows','catch','show','params','includeAll','options','find','body','user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','fieldName','type'];(function(_0x1f5b4f,_0x398053){var _0x500def=function(_0x573e06){while(--_0x573e06){_0x1f5b4f['push'](_0x1f5b4f['shift']());}};_0x500def(++_0x398053);}(_0x3c8f,0x180));var _0xf3c8=function(_0x16dc5b,_0x18cf46){_0x16dc5b=_0x16dc5b-0x0;var _0x319a15=_0x3c8f[_0x16dc5b];return _0x319a15;};'use strict';var emlformat=require(_0xf3c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3c8('0x1'));var jsonpatch=require(_0xf3c8('0x2'));var rp=require('request-promise');var moment=require(_0xf3c8('0x3'));var BPromise=require(_0xf3c8('0x4'));var Mustache=require(_0xf3c8('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf3c8('0x6'));var csv=require(_0xf3c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3c8('0x8'));var _=require(_0xf3c8('0x9'));var squel=require(_0xf3c8('0xa'));var crypto=require(_0xf3c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf3c8('0xc'));var toCsv=require(_0xf3c8('0x7'));var querystring=require(_0xf3c8('0xd'));var Papa=require(_0xf3c8('0xe'));var Redis=require(_0xf3c8('0xf'));var authService=require(_0xf3c8('0x10'));var qs=require(_0xf3c8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3c8('0x12'));var logger=require(_0xf3c8('0x13'))('api');var utils=require(_0xf3c8('0x14'));var config=require(_0xf3c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3c8('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x56355b,_0x4b6739){_0x4b6739=_0x4b6739||0xcc;return function(_0x374114){if(_0x374114){return _0x56355b[_0xf3c8('0x17')](_0x4b6739);}return _0x56355b[_0xf3c8('0x18')](_0x4b6739)[_0xf3c8('0x19')]();};}function respondWithResult(_0x2c3676,_0x42e75a){_0x42e75a=_0x42e75a||0xc8;return function(_0x548f3d){if(_0x548f3d){return _0x2c3676[_0xf3c8('0x18')](_0x42e75a)[_0xf3c8('0x1a')](_0x548f3d);}};}function respondWithFilteredResult(_0x3b03eb,_0x2c316e){return function(_0xda1aa7){if(_0xda1aa7){var _0x562e8d=typeof _0x2c316e[_0xf3c8('0x1b')]===_0xf3c8('0x1c')&&typeof _0x2c316e['limit']===_0xf3c8('0x1c');var _0x32617d=_0xda1aa7[_0xf3c8('0x1d')];var _0x100b54=_0x562e8d?0x0:_0x2c316e[_0xf3c8('0x1b')];var _0x172af2=_0x562e8d?_0xda1aa7[_0xf3c8('0x1d')]:_0x2c316e[_0xf3c8('0x1b')]+_0x2c316e[_0xf3c8('0x1e')];var _0xae28d2;if(_0x172af2>=_0x32617d){_0x172af2=_0x32617d;_0xae28d2=0xc8;}else{_0xae28d2=0xce;}_0x3b03eb['status'](_0xae28d2);return _0x3b03eb[_0xf3c8('0x1f')](_0xf3c8('0x20'),_0x100b54+'-'+_0x172af2+'/'+_0x32617d)[_0xf3c8('0x1a')](_0xda1aa7);}return null;};}function patchUpdates(_0x302558){return function(_0x5eb226){try{jsonpatch[_0xf3c8('0x21')](_0x5eb226,_0x302558,!![]);}catch(_0x1f9825){return BPromise[_0xf3c8('0x22')](_0x1f9825);}return _0x5eb226[_0xf3c8('0x23')]();};}function saveUpdates(_0x44a6e4,_0x558b3d){return function(_0x3f38f7){if(_0x3f38f7){return _0x3f38f7[_0xf3c8('0x24')](_0x44a6e4)[_0xf3c8('0x25')](function(_0x509d13){return _0x509d13;});}return null;};}function removeEntity(_0x9b783c,_0x397e97){return function(_0xf392cc){if(_0xf392cc){return _0xf392cc[_0xf3c8('0x26')]()[_0xf3c8('0x25')](function(){var _0x4d0a97=_0xf392cc[_0xf3c8('0x27')]({'plain':!![]});var _0x559955=_0xf3c8('0x28');return db[_0xf3c8('0x29')][_0xf3c8('0x26')]({'where':{'type':_0x559955,'resourceId':_0x4d0a97['id']}})[_0xf3c8('0x25')](function(){return _0xf392cc;});})[_0xf3c8('0x25')](function(){_0x9b783c[_0xf3c8('0x18')](0xcc)[_0xf3c8('0x19')]();});}};}function handleEntityNotFound(_0xc4ed04,_0x3b3db0){return function(_0x5f3bb1){if(!_0x5f3bb1){_0xc4ed04[_0xf3c8('0x17')](0x194);}return _0x5f3bb1;};}function handleError(_0x1685dc,_0xfad106){_0xfad106=_0xfad106||0x1f4;return function(_0x6e72fe){logger[_0xf3c8('0x2a')](_0x6e72fe[_0xf3c8('0x2b')]);if(_0x6e72fe[_0xf3c8('0x2c')]){delete _0x6e72fe[_0xf3c8('0x2c')];}_0x1685dc['status'](_0xfad106)['send'](_0x6e72fe);};}exports[_0xf3c8('0x2d')]=function(_0x52b68f,_0x11d6ae){var _0x56a6e2={},_0x21da52={},_0x50e678={'count':0x0,'rows':[]};var _0x189afb=_[_0xf3c8('0x2e')](db[_0xf3c8('0x2f')][_0xf3c8('0x30')],function(_0xc4e930){return{'name':_0xc4e930[_0xf3c8('0x31')],'type':_0xc4e930[_0xf3c8('0x32')]['key']};});_0x21da52[_0xf3c8('0x33')]=_[_0xf3c8('0x2e')](_0x189afb,_0xf3c8('0x2c'));_0x21da52[_0xf3c8('0x34')]=_[_0xf3c8('0x35')](_0x52b68f[_0xf3c8('0x34')]);_0x21da52['filters']=_['intersection'](_0x21da52[_0xf3c8('0x33')],_0x21da52[_0xf3c8('0x34')]);_0x56a6e2[_0xf3c8('0x36')]=_[_0xf3c8('0x37')](_0x21da52[_0xf3c8('0x33')],qs[_0xf3c8('0x38')](_0x52b68f[_0xf3c8('0x34')]['fields']));_0x56a6e2[_0xf3c8('0x36')]=_0x56a6e2[_0xf3c8('0x36')][_0xf3c8('0x39')]?_0x56a6e2[_0xf3c8('0x36')]:_0x21da52[_0xf3c8('0x33')];if(!_0x52b68f['query'][_0xf3c8('0x3a')](_0xf3c8('0x3b'))){_0x56a6e2['limit']=qs[_0xf3c8('0x1e')](_0x52b68f[_0xf3c8('0x34')][_0xf3c8('0x1e')]);_0x56a6e2['offset']=qs[_0xf3c8('0x1b')](_0x52b68f[_0xf3c8('0x34')][_0xf3c8('0x1b')]);}_0x56a6e2['order']=qs['sort'](_0x52b68f['query'][_0xf3c8('0x3c')]);_0x56a6e2['where']=qs[_0xf3c8('0x3d')](_[_0xf3c8('0x3e')](_0x52b68f[_0xf3c8('0x34')],_0x21da52[_0xf3c8('0x3d')]),_0x189afb);if(_0x52b68f[_0xf3c8('0x34')][_0xf3c8('0x3f')]){_0x56a6e2['where']=_[_0xf3c8('0x40')](_0x56a6e2[_0xf3c8('0x41')],{'$or':_[_0xf3c8('0x2e')](_0x189afb,function(_0x5d332e){if(_0x5d332e['type']!=='VIRTUAL'){var _0x2fdf0b={};_0x2fdf0b[_0x5d332e['name']]={'$like':'%'+_0x52b68f[_0xf3c8('0x34')][_0xf3c8('0x3f')]+'%'};return _0x2fdf0b;}})});}_0x56a6e2=_[_0xf3c8('0x40')]({},_0x56a6e2,_0x52b68f['options']);var _0x1eee85={'where':_0x56a6e2[_0xf3c8('0x41')]};return db['Interval'][_0xf3c8('0x1d')](_0x1eee85)['then'](function(_0x195957){_0x50e678['count']=_0x195957;if(_0x52b68f[_0xf3c8('0x34')]['includeAll']){_0x56a6e2[_0xf3c8('0x42')]=[{'all':!![]}];}return db[_0xf3c8('0x2f')][_0xf3c8('0x43')](_0x56a6e2);})[_0xf3c8('0x25')](function(_0xefcbc3){_0x50e678[_0xf3c8('0x44')]=_0xefcbc3;return _0x50e678;})[_0xf3c8('0x25')](respondWithFilteredResult(_0x11d6ae,_0x56a6e2))[_0xf3c8('0x45')](handleError(_0x11d6ae,null));};exports[_0xf3c8('0x46')]=function(_0x284320,_0xbe875f){var _0x1856e3={'raw':!![],'where':{'id':_0x284320[_0xf3c8('0x47')]['id']}},_0x44c9b7={};_0x44c9b7[_0xf3c8('0x33')]=_[_0xf3c8('0x35')](db[_0xf3c8('0x2f')][_0xf3c8('0x30')]);_0x44c9b7[_0xf3c8('0x34')]=_[_0xf3c8('0x35')](_0x284320[_0xf3c8('0x34')]);_0x44c9b7[_0xf3c8('0x3d')]=_[_0xf3c8('0x37')](_0x44c9b7['model'],_0x44c9b7[_0xf3c8('0x34')]);_0x1856e3[_0xf3c8('0x36')]=_[_0xf3c8('0x37')](_0x44c9b7[_0xf3c8('0x33')],qs[_0xf3c8('0x38')](_0x284320[_0xf3c8('0x34')][_0xf3c8('0x38')]));_0x1856e3[_0xf3c8('0x36')]=_0x1856e3[_0xf3c8('0x36')][_0xf3c8('0x39')]?_0x1856e3[_0xf3c8('0x36')]:_0x44c9b7['model'];if(_0x284320['query'][_0xf3c8('0x48')]){_0x1856e3[_0xf3c8('0x42')]=[{'all':!![]}];}_0x1856e3=_['merge']({},_0x1856e3,_0x284320[_0xf3c8('0x49')]);return db[_0xf3c8('0x2f')][_0xf3c8('0x4a')](_0x1856e3)[_0xf3c8('0x25')](handleEntityNotFound(_0xbe875f,null))[_0xf3c8('0x25')](respondWithResult(_0xbe875f,null))[_0xf3c8('0x45')](handleError(_0xbe875f,null));};exports['create']=function(_0x1d86a4,_0x7ba838){return db[_0xf3c8('0x2f')]['create'](_0x1d86a4[_0xf3c8('0x4b')],{})[_0xf3c8('0x25')](function(_0x4b205c){var _0x427679=_0x1d86a4[_0xf3c8('0x4c')]['get']({'plain':!![]});if(!_0x427679)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x427679[_0xf3c8('0x4d')]===_0xf3c8('0x4c')){var _0x5a2b10=_0x4b205c[_0xf3c8('0x27')]({'plain':!![]});var _0x17eaf5=_0xf3c8('0x28');return db['UserProfileSection'][_0xf3c8('0x4a')]({'where':{'name':_0x17eaf5,'userProfileId':_0x427679['userProfileId']},'raw':!![]})['then'](function(_0x45fff7){if(_0x45fff7&&_0x45fff7[_0xf3c8('0x4e')]===0x0){return db[_0xf3c8('0x29')][_0xf3c8('0x4f')]({'name':_0x5a2b10[_0xf3c8('0x2c')],'resourceId':_0x5a2b10['id'],'type':_0x45fff7[_0xf3c8('0x2c')],'sectionId':_0x45fff7['id']},{})['then'](function(){return _0x4b205c;});}else{return _0x4b205c;}})['catch'](function(_0x4c747f){logger['error'](_0xf3c8('0x50'),_0x4c747f);throw _0x4c747f;});}return _0x4b205c;})['then'](respondWithResult(_0x7ba838,0xc9))[_0xf3c8('0x45')](handleError(_0x7ba838,null));};exports['update']=function(_0x38687e,_0x52f6be){if(_0x38687e[_0xf3c8('0x4b')]['id']){delete _0x38687e[_0xf3c8('0x4b')]['id'];}return db['Interval'][_0xf3c8('0x4a')]({'where':{'id':_0x38687e[_0xf3c8('0x47')]['id']}})[_0xf3c8('0x25')](handleEntityNotFound(_0x52f6be,null))[_0xf3c8('0x25')](saveUpdates(_0x38687e[_0xf3c8('0x4b')],null))[_0xf3c8('0x25')](respondWithResult(_0x52f6be,null))['catch'](handleError(_0x52f6be,null));};exports[_0xf3c8('0x26')]=function(_0x21c81b,_0x26582e){return db[_0xf3c8('0x2f')][_0xf3c8('0x4a')]({'where':{'id':_0x21c81b[_0xf3c8('0x47')]['id']}})[_0xf3c8('0x25')](handleEntityNotFound(_0x26582e,null))[_0xf3c8('0x25')](removeEntity(_0x26582e,null))[_0xf3c8('0x45')](handleError(_0x26582e,null));};exports[_0xf3c8('0x51')]=function(_0x46edca,_0x16439e,_0x2cf96e){if(_0x46edca['body']['id']){delete _0x46edca[_0xf3c8('0x4b')]['id'];}return db['Interval'][_0xf3c8('0x4a')]({'where':{'id':_0x46edca[_0xf3c8('0x47')]['id']}})['then'](handleEntityNotFound(_0x16439e,null))[_0xf3c8('0x25')](function(_0x37318b){if(_0x37318b){_0x46edca['body'][_0xf3c8('0x52')]=_0x37318b['id'];return db[_0xf3c8('0x2f')][_0xf3c8('0x4f')](_0x46edca['body']);}})[_0xf3c8('0x25')](respondWithResult(_0x16439e,null))[_0xf3c8('0x45')](handleError(_0x16439e,null));};exports['getIntervals']=function(_0x13a6ce,_0x3e30e5,_0x5468bd){var _0x2a7c90={};var _0x201e91={};var _0x186ae9;var _0x160e3e;return db[_0xf3c8('0x2f')][_0xf3c8('0x53')]({'where':{'id':_0x13a6ce[_0xf3c8('0x47')]['id']}})[_0xf3c8('0x25')](handleEntityNotFound(_0x3e30e5,null))['then'](function(_0xad7964){if(_0xad7964){_0x186ae9=_0xad7964;_0x201e91[_0xf3c8('0x33')]=_['keys'](db[_0xf3c8('0x2f')][_0xf3c8('0x30')]);_0x201e91[_0xf3c8('0x34')]=_[_0xf3c8('0x35')](_0x13a6ce[_0xf3c8('0x34')]);_0x201e91[_0xf3c8('0x3d')]=_[_0xf3c8('0x37')](_0x201e91['model'],_0x201e91[_0xf3c8('0x34')]);_0x2a7c90['attributes']=_[_0xf3c8('0x37')](_0x201e91[_0xf3c8('0x33')],qs[_0xf3c8('0x38')](_0x13a6ce['query'][_0xf3c8('0x38')]));_0x2a7c90[_0xf3c8('0x36')]=_0x2a7c90['attributes'][_0xf3c8('0x39')]?_0x2a7c90[_0xf3c8('0x36')]:_0x201e91[_0xf3c8('0x33')];_0x2a7c90['order']=qs[_0xf3c8('0x3c')](_0x13a6ce[_0xf3c8('0x34')][_0xf3c8('0x3c')]);_0x2a7c90[_0xf3c8('0x41')]=qs['filters'](_['pick'](_0x13a6ce[_0xf3c8('0x34')],_0x201e91['filters']));if(_0x13a6ce['query']['filter']){_0x2a7c90[_0xf3c8('0x41')]=_[_0xf3c8('0x40')](_0x2a7c90[_0xf3c8('0x41')],{'$or':_['map'](_0x2a7c90['attributes'],function(_0x271954){var _0x3d1880={};_0x3d1880[_0x271954]={'$like':'%'+_0x13a6ce[_0xf3c8('0x34')][_0xf3c8('0x3f')]+'%'};return _0x3d1880;})});}_0x2a7c90=_['merge']({},_0x2a7c90,_0x13a6ce['options']);return _0x186ae9[_0xf3c8('0x54')](_0x2a7c90);}})[_0xf3c8('0x25')](function(_0x14bf37){if(_0x14bf37){_0x160e3e=_0x14bf37[_0xf3c8('0x39')];if(!_0x13a6ce[_0xf3c8('0x34')][_0xf3c8('0x3a')](_0xf3c8('0x3b'))){_0x2a7c90[_0xf3c8('0x1e')]=qs[_0xf3c8('0x1e')](_0x13a6ce[_0xf3c8('0x34')][_0xf3c8('0x1e')]);_0x2a7c90[_0xf3c8('0x1b')]=qs[_0xf3c8('0x1b')](_0x13a6ce[_0xf3c8('0x34')][_0xf3c8('0x1b')]);}return _0x186ae9[_0xf3c8('0x54')](_0x2a7c90);}})[_0xf3c8('0x25')](function(_0x21f04f){if(_0x21f04f){return _0x21f04f?{'count':_0x160e3e,'rows':_0x21f04f}:null;}})[_0xf3c8('0x25')](respondWithResult(_0x3e30e5,null))['catch'](handleError(_0x3e30e5,null));};exports[_0xf3c8('0x55')]=function(_0x22fd98,_0x5d6c5c,_0x53aef6){return db[_0xf3c8('0x2f')][_0xf3c8('0x53')]({'where':{'id':_0x22fd98['params']['id']}})['then'](handleEntityNotFound(_0x5d6c5c,null))['then'](function(_0x139fde){if(_0x139fde){return db[_0xf3c8('0x56')]['transaction'](function(_0x5e2dbf){return db[_0xf3c8('0x2f')][_0xf3c8('0x26')]({'where':{'IntervalId':_0x22fd98[_0xf3c8('0x47')]['id']},'transaction':_0x5e2dbf})[_0xf3c8('0x25')](function(_0x55a450){var _0x42f1c0=_[_0xf3c8('0x2e')](_0x22fd98['body'],function(_0x41536b){delete _0x41536b['id'];_0x41536b['IntervalId']=_0x22fd98[_0xf3c8('0x47')]['id'];return _0x41536b;});return db[_0xf3c8('0x2f')]['bulkCreate'](_0x42f1c0,{'transaction':_0x5e2dbf});});})[_0xf3c8('0x25')](function(){return db[_0xf3c8('0x2f')][_0xf3c8('0x43')]({'where':{'IntervalId':_0x22fd98[_0xf3c8('0x47')]['id']}});});}})['then'](respondWithResult(_0x5d6c5c,null))[_0xf3c8('0x45')](handleError(_0x5d6c5c,null));};
\ No newline at end of file
index 0a2dd3d..73fc578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x101c=['then','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','Interval','tools_intervals','rewrite','interval','string','getIntervals','ifTime'];(function(_0xe98508,_0x17f727){var _0x21f63e=function(_0x193865){while(--_0x193865){_0xe98508['push'](_0xe98508['shift']());}};_0x21f63e(++_0x17f727);}(_0x101c,0xec));var _0xc101=function(_0x263204,_0x19286b){_0x263204=_0x263204-0x0;var _0xed3987=_0x101c[_0x263204];return _0xed3987;};'use strict';var attributes=require(_0xc101('0x0'));var extensions=require(_0xc101('0x1'));var iftime=require(_0xc101('0x2'))['iftime'];module[_0xc101('0x3')]=function(_0x355657){return _0x355657['define'](_0xc101('0x4'),attributes,{'tableName':_0xc101('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35afcf){extensions[_0xc101('0x6')](_0x355657,_0x35afcf);},'afterBulkCreate':function(_0x18c012,_0x5d63eb,_0x272822){_0x272822();extensions[_0xc101('0x6')](_0x355657,_0x18c012[0x0]);},'afterUpdate':function(_0x253c5e){extensions[_0xc101('0x6')](_0x355657,_0x253c5e);},'afterDestroy':function(_0x264598){extensions[_0xc101('0x6')](_0x355657,_0x264598);}},'instanceMethods':{'ifTime':function(_0x33b72b=undefined,_0x1c6734=new Date()){if(typeof this[_0xc101('0x7')]===_0xc101('0x8')){return iftime(this[_0xc101('0x7')],_0x33b72b,_0x1c6734);}else{return this[_0xc101('0x9')]()['then'](function(_0x262255){return Promise['all'](_0x262255['map'](function(_0x37a45f){return _0x37a45f[_0xc101('0xa')](_0x33b72b,_0x1c6734);}));})[_0xc101('0xb')](function(_0x110d62){return _0x110d62[_0xc101('0xc')](function(_0xc6fbb2,_0x1318cf){return _0xc6fbb2||_0x1318cf;},![]);});}}}});};
\ No newline at end of file
+var _0xe956=['all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','rewrite','string','interval','getIntervals','then'];(function(_0x18de1c,_0x5d81b9){var _0x1adf9b=function(_0x4ac6e2){while(--_0x4ac6e2){_0x18de1c['push'](_0x18de1c['shift']());}};_0x1adf9b(++_0x5d81b9);}(_0xe956,0x12c));var _0x6e95=function(_0x53ff84,_0xa5517e){_0x53ff84=_0x53ff84-0x0;var _0x251467=_0xe956[_0x53ff84];return _0x251467;};'use strict';var attributes=require(_0x6e95('0x0'));var extensions=require(_0x6e95('0x1'));var iftime=require(_0x6e95('0x2'))['iftime'];module['exports']=function(_0x44c81c){return _0x44c81c['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x24ad16){extensions['rewrite'](_0x44c81c,_0x24ad16);},'afterBulkCreate':function(_0x1f5aac,_0x40b70f,_0x32e0c5){_0x32e0c5();extensions[_0x6e95('0x3')](_0x44c81c,_0x1f5aac[0x0]);},'afterUpdate':function(_0x209f33){extensions[_0x6e95('0x3')](_0x44c81c,_0x209f33);},'afterDestroy':function(_0x48e785){extensions[_0x6e95('0x3')](_0x44c81c,_0x48e785);}},'instanceMethods':{'ifTime':function(_0x2a3bcb=undefined,_0x27086b=new Date()){if(typeof this['interval']===_0x6e95('0x4')){return iftime(this[_0x6e95('0x5')],_0x2a3bcb,_0x27086b);}else{return this[_0x6e95('0x6')]()[_0x6e95('0x7')](function(_0x8edc3b){return Promise[_0x6e95('0x8')](_0x8edc3b['map'](function(_0x12efb9){return _0x12efb9[_0x6e95('0x9')](_0x2a3bcb,_0x27086b);}));})['then'](function(_0x5f57cb){return _0x5f57cb[_0x6e95('0xa')](function(_0x356af1,_0x213014){return _0x356af1||_0x213014;},![]);});}}}});};
\ No newline at end of file
index 89799d1..921ab54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dfb=['attributes','limit','include','map','model','info','GetInterval','debug','stringify','catch','error','message','find','then','ShowInterval','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','IntervalIftime','resolve','isArray','../../mysqldb','../../utils/iftime','iftime','../../config/logger','Interval','findAll','options','raw','where'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x9dfb,0x14f));var _0xb9df=function(_0x2f3aa8,_0x451c46){_0x2f3aa8=_0x2f3aa8-0x0;var _0x4c5433=_0x9dfb[_0x2f3aa8];return _0x4c5433;};'use strict';var _=require('lodash');var util=require('util');var db=require(_0xb9df('0x0'))['db'];var iftime=require(_0xb9df('0x1'))[_0xb9df('0x2')];var logger=require(_0xb9df('0x3'))('rpc');exports['GetInterval']=function(_0x111857){var _0x4461fa=this;return new Promise(function(_0x13b8c2,_0x524581){return db[_0xb9df('0x4')][_0xb9df('0x5')]({'raw':_0x111857[_0xb9df('0x6')]?_0x111857[_0xb9df('0x6')][_0xb9df('0x7')]===undefined?!![]:![]:!![],'where':_0x111857['options']?_0x111857[_0xb9df('0x6')][_0xb9df('0x8')]||null:null,'attributes':_0x111857[_0xb9df('0x6')]?_0x111857['options'][_0xb9df('0x9')]||null:null,'limit':_0x111857[_0xb9df('0x6')]?_0x111857[_0xb9df('0x6')][_0xb9df('0xa')]||null:null,'include':_0x111857[_0xb9df('0x6')]?_0x111857['options'][_0xb9df('0xb')]?_[_0xb9df('0xc')](_0x111857[_0xb9df('0x6')]['include'],function(_0x460dea){return{'model':db[_0x460dea[_0xb9df('0xd')]],'as':_0x460dea['as'],'attributes':_0x460dea[_0xb9df('0x9')],'include':_0x460dea['include']?_[_0xb9df('0xc')](_0x460dea[_0xb9df('0xb')],function(_0x3ef530){return{'model':db[_0x3ef530[_0xb9df('0xd')]],'as':_0x3ef530['as'],'attributes':_0x3ef530['attributes'],'include':_0x3ef530[_0xb9df('0xb')]?_[_0xb9df('0xc')](_0x3ef530[_0xb9df('0xb')],function(_0x2a5f44){return{'model':db[_0x2a5f44['model']],'as':_0x2a5f44['as'],'attributes':_0x2a5f44['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14e523){logger[_0xb9df('0xe')](_0xb9df('0xf'),_0x111857);logger[_0xb9df('0x10')](_0xb9df('0xf'),_0x111857,JSON[_0xb9df('0x11')](_0x14e523));_0x13b8c2(_0x14e523);})[_0xb9df('0x12')](function(_0x3ca20c){logger[_0xb9df('0x13')]('GetInterval',_0x3ca20c[_0xb9df('0x14')],_0x111857);_0x524581(_0x4461fa[_0xb9df('0x13')](0x1f4,_0x3ca20c[_0xb9df('0x14')]));});});};exports['ShowInterval']=function(_0x2f3b14){var _0x25c087=this;return new Promise(function(_0x12c4ef,_0x18dc41){return db[_0xb9df('0x4')][_0xb9df('0x15')]({'raw':_0x2f3b14[_0xb9df('0x6')]?_0x2f3b14[_0xb9df('0x6')][_0xb9df('0x7')]===undefined?!![]:![]:!![],'where':_0x2f3b14[_0xb9df('0x6')]?_0x2f3b14['options'][_0xb9df('0x8')]||null:null,'attributes':_0x2f3b14[_0xb9df('0x6')]?_0x2f3b14[_0xb9df('0x6')][_0xb9df('0x9')]||null:null,'include':_0x2f3b14[_0xb9df('0x6')]?_0x2f3b14[_0xb9df('0x6')][_0xb9df('0xb')]?_[_0xb9df('0xc')](_0x2f3b14[_0xb9df('0x6')][_0xb9df('0xb')],function(_0x503433){return{'model':db[_0x503433[_0xb9df('0xd')]],'as':_0x503433['as'],'attributes':_0x503433['attributes'],'include':_0x503433[_0xb9df('0xb')]?_[_0xb9df('0xc')](_0x503433[_0xb9df('0xb')],function(_0x56f176){return{'model':db[_0x56f176[_0xb9df('0xd')]],'as':_0x56f176['as'],'attributes':_0x56f176[_0xb9df('0x9')],'include':_0x56f176[_0xb9df('0xb')]?_[_0xb9df('0xc')](_0x56f176[_0xb9df('0xb')],function(_0x4c5dc2){return{'model':db[_0x4c5dc2[_0xb9df('0xd')]],'as':_0x4c5dc2['as'],'attributes':_0x4c5dc2[_0xb9df('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb9df('0x16')](function(_0x2e205d){logger[_0xb9df('0xe')](_0xb9df('0x17'),_0x2f3b14);logger[_0xb9df('0x10')](_0xb9df('0x17'),_0x2f3b14,JSON[_0xb9df('0x11')](_0x2e205d));_0x12c4ef(_0x2e205d);})[_0xb9df('0x12')](function(_0x5060a1){logger['error'](_0xb9df('0x17'),_0x5060a1[_0xb9df('0x14')],_0x2f3b14);_0x18dc41(_0x25c087[_0xb9df('0x13')](0x1f4,_0x5060a1[_0xb9df('0x14')]));});});};function checkArrayOfIntervals(_0x39a455,_0xedbbfa){var _0x4f7973=[];return db[_0xb9df('0x4')][_0xb9df('0x5')]({'where':{'id':_0x39a455}})[_0xb9df('0x16')](function(_0x598248){_0x4f7973=_0x598248;return Promise[_0xb9df('0x18')](_0x4f7973[_0xb9df('0xc')](function(_0x58587b){return _0x58587b[_0xb9df('0x19')](_0xedbbfa);}));})[_0xb9df('0x16')](function(_0xd924a9){var _0x11d22b=_0xd924a9[_0xb9df('0x1a')](function(_0x3f53ac,_0x46fc8d){return _0x3f53ac||_0x46fc8d;},![]);logger[_0xb9df('0xe')](util[_0xb9df('0x1b')](_0xb9df('0x1c'),_0x4f7973[_0xb9df('0xc')](function(_0x2acb7e){return _0x2acb7e['name'];})[_0xb9df('0x1d')](',\x20'),_0x4f7973[_0xb9df('0xc')](function(_0x2d15bb){return _0x2d15bb['id'];})[_0xb9df('0x1d')](',\x20')));return _0x11d22b;});}function checkSingleInterval(_0x2a972e,_0x5da40d){return db['Interval'][_0xb9df('0x1e')](_0x2a972e)['then'](function(_0x342fb6){if(_0x342fb6){logger[_0xb9df('0xe')](util[_0xb9df('0x1b')](_0xb9df('0x1f'),_0x342fb6[_0xb9df('0x20')],_0x342fb6['id']));return _0x342fb6[_0xb9df('0x19')](_0x5da40d);}});}exports['IntervalIftime']=function(_0x42feff){var _0x533da0=_0x42feff[_0xb9df('0x21')];var _0x44d2ab=Array['isArray'](_0x42feff[_0xb9df('0x22')])?_0x42feff['intervals']:typeof _0x42feff[_0xb9df('0x22')]==='string'?[_0x42feff[_0xb9df('0x22')]]:[];var _0x587dd0=_0x42feff[_0xb9df('0x23')]||undefined;var _0x19b2cb=![];if(_0x44d2ab[_0xb9df('0x24')]){logger[_0xb9df('0xe')](util[_0xb9df('0x1b')](_0xb9df('0x25'),_0x44d2ab[_0xb9df('0x1d')](';\x20')));}if(_0x587dd0){logger['info'](util[_0xb9df('0x1b')](_0xb9df('0x26'),_0x587dd0));}logger[_0xb9df('0x10')](_0xb9df('0x27'),_0x19b2cb);logger['silly'](_0xb9df('0x28'),_0x42feff);return Promise[_0xb9df('0x29')]()['then'](function(){if(Array[_0xb9df('0x2a')](_0x533da0)){return checkArrayOfIntervals(_0x533da0,_0x587dd0);}else if(_0x533da0){return checkSingleInterval(_0x533da0,_0x587dd0);}})['then'](function(_0x26c9cb){var _0x2e7dfa=_0x44d2ab[_0xb9df('0x1a')](function(_0x42cd4f,_0x2d5652){return _0x42cd4f||iftime(_0x2d5652,_0x587dd0);},![]);_0x19b2cb=_0x26c9cb||_0x2e7dfa;return _0x19b2cb;})[_0xb9df('0x12')](function(_0x33c284){logger[_0xb9df('0x13')](_0xb9df('0x28'),_0x42feff,_0x33c284);throw this[_0xb9df('0x13')](0x1f4,_0x33c284[_0xb9df('0x14')]);});};
\ No newline at end of file
+var _0x61e3=['find','where','all','reduce','join','findById','format','ifTime','IntervalIftime','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','debug','Iftime','silly','resolve','util','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','attributes','limit','include','map','model','then','info','stringify','catch','message','error','ShowInterval'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x61e3,0x132));var _0x361e=function(_0x4b4307,_0x2b9eb2){_0x4b4307=_0x4b4307-0x0;var _0x55b96f=_0x61e3[_0x4b4307];return _0x55b96f;};'use strict';var _=require('lodash');var util=require(_0x361e('0x0'));var db=require('../../mysqldb')['db'];var iftime=require(_0x361e('0x1'))[_0x361e('0x2')];var logger=require(_0x361e('0x3'))(_0x361e('0x4'));exports[_0x361e('0x5')]=function(_0xbbefd5){var _0x4257ae=this;return new Promise(function(_0x3b20ab,_0x3f065b){return db[_0x361e('0x6')][_0x361e('0x7')]({'raw':_0xbbefd5[_0x361e('0x8')]?_0xbbefd5[_0x361e('0x8')][_0x361e('0x9')]===undefined?!![]:![]:!![],'where':_0xbbefd5[_0x361e('0x8')]?_0xbbefd5[_0x361e('0x8')]['where']||null:null,'attributes':_0xbbefd5[_0x361e('0x8')]?_0xbbefd5['options'][_0x361e('0xa')]||null:null,'limit':_0xbbefd5[_0x361e('0x8')]?_0xbbefd5[_0x361e('0x8')][_0x361e('0xb')]||null:null,'include':_0xbbefd5[_0x361e('0x8')]?_0xbbefd5['options'][_0x361e('0xc')]?_[_0x361e('0xd')](_0xbbefd5[_0x361e('0x8')][_0x361e('0xc')],function(_0x282415){return{'model':db[_0x282415[_0x361e('0xe')]],'as':_0x282415['as'],'attributes':_0x282415[_0x361e('0xa')],'include':_0x282415['include']?_[_0x361e('0xd')](_0x282415[_0x361e('0xc')],function(_0x4ed98b){return{'model':db[_0x4ed98b[_0x361e('0xe')]],'as':_0x4ed98b['as'],'attributes':_0x4ed98b[_0x361e('0xa')],'include':_0x4ed98b[_0x361e('0xc')]?_[_0x361e('0xd')](_0x4ed98b[_0x361e('0xc')],function(_0x5f9328){return{'model':db[_0x5f9328[_0x361e('0xe')]],'as':_0x5f9328['as'],'attributes':_0x5f9328['attributes']};}):[]};}):[]};}):[]:[]})[_0x361e('0xf')](function(_0x349665){logger[_0x361e('0x10')](_0x361e('0x5'),_0xbbefd5);logger['debug'](_0x361e('0x5'),_0xbbefd5,JSON[_0x361e('0x11')](_0x349665));_0x3b20ab(_0x349665);})[_0x361e('0x12')](function(_0x5af9e2){logger['error']('GetInterval',_0x5af9e2[_0x361e('0x13')],_0xbbefd5);_0x3f065b(_0x4257ae[_0x361e('0x14')](0x1f4,_0x5af9e2[_0x361e('0x13')]));});});};exports[_0x361e('0x15')]=function(_0x1cb2b1){var _0x2f9f3d=this;return new Promise(function(_0x22ff4b,_0x41e43a){return db[_0x361e('0x6')][_0x361e('0x16')]({'raw':_0x1cb2b1[_0x361e('0x8')]?_0x1cb2b1[_0x361e('0x8')][_0x361e('0x9')]===undefined?!![]:![]:!![],'where':_0x1cb2b1[_0x361e('0x8')]?_0x1cb2b1['options'][_0x361e('0x17')]||null:null,'attributes':_0x1cb2b1[_0x361e('0x8')]?_0x1cb2b1['options'][_0x361e('0xa')]||null:null,'include':_0x1cb2b1[_0x361e('0x8')]?_0x1cb2b1[_0x361e('0x8')][_0x361e('0xc')]?_['map'](_0x1cb2b1[_0x361e('0x8')]['include'],function(_0x20b161){return{'model':db[_0x20b161[_0x361e('0xe')]],'as':_0x20b161['as'],'attributes':_0x20b161[_0x361e('0xa')],'include':_0x20b161[_0x361e('0xc')]?_[_0x361e('0xd')](_0x20b161[_0x361e('0xc')],function(_0x2bbb82){return{'model':db[_0x2bbb82[_0x361e('0xe')]],'as':_0x2bbb82['as'],'attributes':_0x2bbb82[_0x361e('0xa')],'include':_0x2bbb82[_0x361e('0xc')]?_[_0x361e('0xd')](_0x2bbb82[_0x361e('0xc')],function(_0x27bbb){return{'model':db[_0x27bbb[_0x361e('0xe')]],'as':_0x27bbb['as'],'attributes':_0x27bbb[_0x361e('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x161704){logger[_0x361e('0x10')](_0x361e('0x15'),_0x1cb2b1);logger['debug'](_0x361e('0x15'),_0x1cb2b1,JSON[_0x361e('0x11')](_0x161704));_0x22ff4b(_0x161704);})[_0x361e('0x12')](function(_0x360b87){logger[_0x361e('0x14')]('ShowInterval',_0x360b87[_0x361e('0x13')],_0x1cb2b1);_0x41e43a(_0x2f9f3d[_0x361e('0x14')](0x1f4,_0x360b87[_0x361e('0x13')]));});});};function checkArrayOfIntervals(_0x490516,_0x15c54b){var _0x1c07cb=[];return db[_0x361e('0x6')][_0x361e('0x7')]({'where':{'id':_0x490516}})['then'](function(_0x3a2fc8){_0x1c07cb=_0x3a2fc8;return Promise[_0x361e('0x18')](_0x1c07cb['map'](function(_0x28e2bc){return _0x28e2bc['ifTime'](_0x15c54b);}));})['then'](function(_0x36dcbc){var _0x2dd557=_0x36dcbc[_0x361e('0x19')](function(_0x30e134,_0x264222){return _0x30e134||_0x264222;},![]);logger[_0x361e('0x10')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1c07cb[_0x361e('0xd')](function(_0x35f263){return _0x35f263['name'];})[_0x361e('0x1a')](',\x20'),_0x1c07cb[_0x361e('0xd')](function(_0x9999b){return _0x9999b['id'];})[_0x361e('0x1a')](',\x20')));return _0x2dd557;});}function checkSingleInterval(_0x546d39,_0x360353){return db['Interval'][_0x361e('0x1b')](_0x546d39)[_0x361e('0xf')](function(_0x7132ba){if(_0x7132ba){logger[_0x361e('0x10')](util[_0x361e('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x7132ba['name'],_0x7132ba['id']));return _0x7132ba[_0x361e('0x1d')](_0x360353);}});}exports[_0x361e('0x1e')]=function(_0x1fef99){var _0x318da9=_0x1fef99['intervalIds'];var _0x5430ab=Array[_0x361e('0x1f')](_0x1fef99[_0x361e('0x20')])?_0x1fef99[_0x361e('0x20')]:typeof _0x1fef99['intervals']==='string'?[_0x1fef99[_0x361e('0x20')]]:[];var _0x4f7b87=_0x1fef99[_0x361e('0x21')]||undefined;var _0x20bf45=![];if(_0x5430ab[_0x361e('0x22')]){logger[_0x361e('0x10')](util[_0x361e('0x1c')](_0x361e('0x23'),_0x5430ab[_0x361e('0x1a')](';\x20')));}if(_0x4f7b87){logger[_0x361e('0x10')](util['format'](_0x361e('0x24'),_0x4f7b87));}logger[_0x361e('0x25')](_0x361e('0x26'),_0x20bf45);logger[_0x361e('0x27')]('IntervalIftime',_0x1fef99);return Promise[_0x361e('0x28')]()[_0x361e('0xf')](function(){if(Array['isArray'](_0x318da9)){return checkArrayOfIntervals(_0x318da9,_0x4f7b87);}else if(_0x318da9){return checkSingleInterval(_0x318da9,_0x4f7b87);}})[_0x361e('0xf')](function(_0xad5348){var _0x1961f6=_0x5430ab['reduce'](function(_0x3edc2e,_0x3896b4){return _0x3edc2e||iftime(_0x3896b4,_0x4f7b87);},![]);_0x20bf45=_0xad5348||_0x1961f6;return _0x20bf45;})[_0x361e('0x12')](function(_0x5abc07){logger[_0x361e('0x14')]('IntervalIftime',_0x1fef99,_0x5abc07);throw this[_0x361e('0x14')](0x1f4,_0x5abc07[_0x361e('0x13')]);});};
\ No newline at end of file
index f644525..868855b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router;
\ No newline at end of file
+var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb10b,0x12a));var _0xbb10=function(_0x542d6b,_0x1615bd){_0x542d6b=_0x542d6b-0x0;var _0x22d616=_0xb10b[_0x542d6b];return _0x22d616;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router;
\ No newline at end of file
index cd604a9..4ae16b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86be=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11502','newToken','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','request','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','https','api','support'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x86be,0x144));var _0xe86b=function(_0xef03cf,_0x108ea1){_0xef03cf=_0xef03cf-0x0;var _0x5058d8=_0x86be[_0xef03cf];return _0x5058d8;};'use strict';var BPromise=require(_0xe86b('0x0'));var https=require(_0xe86b('0x1'));var logger=require('../../config/logger')(_0xe86b('0x2'));var USERNAME=_0xe86b('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4afc69,_0x5a5b5e){var _0xffad19={'fields':{'project':{'key':_0x4afc69[_0xe86b('0x4')]||_0xe86b('0x5')},'summary':(_0x4afc69[_0xe86b('0x6')]||_0xe86b('0x7'))+_0xe86b('0x8')+_0x4afc69['ip'],'description':_0x4afc69[_0xe86b('0x9')]||JSON[_0xe86b('0xa')](_0x4afc69),'issuetype':{'name':_0x4afc69[_0xe86b('0xb')]||_0xe86b('0xc')}}};_0xffad19[_0xe86b('0xd')]['customfield_11500']=_0x4afc69['email'];_0xffad19[_0xe86b('0xd')]['customfield_11501']=_0x4afc69['oldToken'];_0xffad19[_0xe86b('0xd')][_0xe86b('0xe')]=_0x4afc69[_0xe86b('0xf')];_0xffad19['fields']['customfield_11503']=_0x4afc69[_0xe86b('0x10')];_0xffad19[_0xe86b('0xd')]['customfield_11504']=_0x4afc69['reason'];_0xffad19[_0xe86b('0xd')][_0xe86b('0x11')]=_0x4afc69['ip'];var _0x34b92a={'host':_0xe86b('0x12'),'port':0x1bb,'path':_0xe86b('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xe86b('0x14'),'Authorization':_0xe86b('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xe86b('0x16'))}};var _0x2e50b8=JSON[_0xe86b('0xa')](_0xffad19);var _0x28f845=https[_0xe86b('0x17')](_0x34b92a,function(_0x2fb7b8){_0x2fb7b8['setEncoding'](_0xe86b('0x18'));var _0x2ebe75='';_0x2fb7b8['on'](_0xe86b('0x19'),function(_0x5aae58){_0x2ebe75+=_0x5aae58;});_0x2fb7b8['on'](_0xe86b('0x1a'),function(){if(_0x5a5b5e){return _0x5a5b5e[_0xe86b('0x1b')](_0x2fb7b8['statusCode'])[_0xe86b('0x1c')](JSON[_0xe86b('0x1d')](_0x2ebe75));}});});_0x28f845['on'](_0xe86b('0x1e'),function(_0x4051f6){if(_0x5a5b5e){return _0x5a5b5e[_0xe86b('0x1b')](0x1f4)[_0xe86b('0x1c')]({'errors':[{'message':_0xe86b('0x1f'),'type':_0xe86b('0x20')}]});}});_0x28f845[_0xe86b('0x21')](_0x2e50b8);_0x28f845[_0xe86b('0x1a')]();}exports[_0xe86b('0x22')]=openIssue;exports[_0xe86b('0x23')]=function(_0xa53f3,_0x548122){_0xa53f3[_0xe86b('0x24')]['ip']=_0xa53f3[_0xe86b('0x25')]['x-forwarded-for']||_0xa53f3[_0xe86b('0x26')][_0xe86b('0x27')]||_0xa53f3['socket'][_0xe86b('0x27')]||_0xa53f3[_0xe86b('0x26')][_0xe86b('0x28')][_0xe86b('0x27')];return openIssue(_0xa53f3['body'],_0x548122);};
\ No newline at end of file
+var _0xf4a4=['socket','remoteAddress','bluebird','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','request','setEncoding','utf8','data','end','status','statusCode','parse','error','api.jira','write','send','body','headers','x-forwarded-for','connection'];(function(_0x3b60b3,_0xf75687){var _0x428e71=function(_0x34798d){while(--_0x34798d){_0x3b60b3['push'](_0x3b60b3['shift']());}};_0x428e71(++_0xf75687);}(_0xf4a4,0x1ba));var _0x4f4a=function(_0x58badd,_0x375ced){_0x58badd=_0x58badd-0x0;var _0xeb7a82=_0xf4a4[_0x58badd];return _0xeb7a82;};'use strict';var BPromise=require(_0x4f4a('0x0'));var https=require('https');var logger=require(_0x4f4a('0x1'))(_0x4f4a('0x2'));var USERNAME=_0x4f4a('0x3');var PASSWORD=_0x4f4a('0x4');function openIssue(_0x3576ff,_0x10464f){var _0x5580bc={'fields':{'project':{'key':_0x3576ff['key']||_0x4f4a('0x5')},'summary':(_0x3576ff[_0x4f4a('0x6')]||'Report')+_0x4f4a('0x7')+_0x3576ff['ip'],'description':_0x3576ff['description']||JSON[_0x4f4a('0x8')](_0x3576ff),'issuetype':{'name':_0x3576ff['issuetype']||_0x4f4a('0x9')}}};_0x5580bc[_0x4f4a('0xa')][_0x4f4a('0xb')]=_0x3576ff[_0x4f4a('0xc')];_0x5580bc['fields'][_0x4f4a('0xd')]=_0x3576ff[_0x4f4a('0xe')];_0x5580bc['fields']['customfield_11502']=_0x3576ff[_0x4f4a('0xf')];_0x5580bc[_0x4f4a('0xa')][_0x4f4a('0x10')]=_0x3576ff[_0x4f4a('0x11')];_0x5580bc['fields'][_0x4f4a('0x12')]=_0x3576ff[_0x4f4a('0x13')];_0x5580bc[_0x4f4a('0xa')][_0x4f4a('0x14')]=_0x3576ff['ip'];var _0xc07e2e={'host':_0x4f4a('0x15'),'port':0x1bb,'path':_0x4f4a('0x16'),'method':_0x4f4a('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x4f4a('0x18'),'Authorization':_0x4f4a('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0xfa61f1=JSON[_0x4f4a('0x8')](_0x5580bc);var _0x380cfe=https[_0x4f4a('0x1a')](_0xc07e2e,function(_0x537ac0){_0x537ac0[_0x4f4a('0x1b')](_0x4f4a('0x1c'));var _0x46b9e2='';_0x537ac0['on'](_0x4f4a('0x1d'),function(_0x2a5b9b){_0x46b9e2+=_0x2a5b9b;});_0x537ac0['on'](_0x4f4a('0x1e'),function(){if(_0x10464f){return _0x10464f[_0x4f4a('0x1f')](_0x537ac0[_0x4f4a('0x20')])['json'](JSON[_0x4f4a('0x21')](_0x46b9e2));}});});_0x380cfe['on'](_0x4f4a('0x22'),function(_0xb0d75){if(_0x10464f){return _0x10464f[_0x4f4a('0x1f')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x4f4a('0x23')}]});}});_0x380cfe[_0x4f4a('0x24')](_0xfa61f1);_0x380cfe['end']();}exports['openIssue']=openIssue;exports[_0x4f4a('0x25')]=function(_0x5d487f,_0x42522b){_0x5d487f[_0x4f4a('0x26')]['ip']=_0x5d487f[_0x4f4a('0x27')][_0x4f4a('0x28')]||_0x5d487f[_0x4f4a('0x29')]['remoteAddress']||_0x5d487f[_0x4f4a('0x2a')][_0x4f4a('0x2b')]||_0x5d487f[_0x4f4a('0x29')][_0x4f4a('0x2a')][_0x4f4a('0x2b')];return openIssue(_0x5d487f[_0x4f4a('0x26')],_0x42522b);};
\ No newline at end of file
index 7bf7963..f920c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x44979e,_0x3d8156){var _0x2d60a2=function(_0x24fd0e){while(--_0x24fd0e){_0x44979e['push'](_0x44979e['shift']());}};_0x2d60a2(++_0x3d8156);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xcb91[_0x4bb145];return _0x4db596;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x34e8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x3c76ac,_0x2cfeed){var _0x4a5ec5=function(_0x407a1e){while(--_0x407a1e){_0x3c76ac['push'](_0x3c76ac['shift']());}};_0x4a5ec5(++_0x2cfeed);}(_0x34e8,0x12c));var _0x834e=function(_0x44b5ce,_0x5e4b79){_0x44b5ce=_0x44b5ce-0x0;var _0x1c63fc=_0x34e8[_0x44b5ce];return _0x1c63fc;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0x15')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x16')]=router;
\ No newline at end of file
index ffe97eb..e2f459c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x2cad0d,_0x42ff38){_0x2cad0d=_0x2cad0d-0x0;var _0x4bf82d=_0x7a54[_0x2cad0d];return _0x4bf82d;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x3888db,_0x11456b){_0x3888db=_0x3888db-0x0;var _0x3d9afe=_0x7a54[_0x3888db];return _0x3d9afe;};'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
index 08b5da3..5b358b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x36ec49,_0x56d0e9){var _0x2a8db1=function(_0x13bc5c){while(--_0x13bc5c){_0x36ec49['push'](_0x36ec49['shift']());}};_0x2a8db1(++_0x56d0e9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2f8db7,_0x5a7566){_0x2f8db7=_0x2f8db7-0x0;var _0x5c1d7e=_0x7fbe[_0x2f8db7];return _0x5c1d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['JscriptyAnswerReport'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['JscriptyAnswerReport'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));};
\ No newline at end of file
+var _0x49c4=['params','destroy','describe','eml-format','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/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body'];(function(_0x3b5e0c,_0x5a168f){var _0x36f2b8=function(_0x5b5724){while(--_0x5b5724){_0x3b5e0c['push'](_0x3b5e0c['shift']());}};_0x36f2b8(++_0x5a168f);}(_0x49c4,0x9b));var _0x449c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x49c4[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0x449c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x449c('0x1'));var jsonpatch=require(_0x449c('0x2'));var rp=require(_0x449c('0x3'));var moment=require(_0x449c('0x4'));var BPromise=require(_0x449c('0x5'));var Mustache=require(_0x449c('0x6'));var util=require(_0x449c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x449c('0x8'));var ejs=require(_0x449c('0x9'));var fs=require('fs');var fs_extra=require(_0x449c('0xa'));var _=require(_0x449c('0xb'));var squel=require(_0x449c('0xc'));var crypto=require(_0x449c('0xd'));var jsforce=require(_0x449c('0xe'));var deskjs=require(_0x449c('0xf'));var toCsv=require(_0x449c('0x8'));var querystring=require(_0x449c('0x10'));var Papa=require(_0x449c('0x11'));var Redis=require(_0x449c('0x12'));var authService=require(_0x449c('0x13'));var qs=require(_0x449c('0x14'));var as=require(_0x449c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x449c('0x16'));var utils=require(_0x449c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6303,_0x2d5610){_0x2d5610=_0x2d5610||0xcc;return function(_0x181570){if(_0x181570){return _0x3e6303[_0x449c('0x18')](_0x2d5610);}return _0x3e6303['status'](_0x2d5610)[_0x449c('0x19')]();};}function respondWithResult(_0x4fce89,_0x1818a9){_0x1818a9=_0x1818a9||0xc8;return function(_0x5b3a85){if(_0x5b3a85){return _0x4fce89[_0x449c('0x1a')](_0x1818a9)[_0x449c('0x1b')](_0x5b3a85);}};}function respondWithFilteredResult(_0x258b57,_0x39a9c4){return function(_0x3510e1){if(_0x3510e1){var _0x80bdf5=typeof _0x39a9c4[_0x449c('0x1c')]===_0x449c('0x1d')&&typeof _0x39a9c4[_0x449c('0x1e')]===_0x449c('0x1d');var _0x551b31=_0x3510e1[_0x449c('0x1f')];var _0x4474e2=_0x80bdf5?0x0:_0x39a9c4[_0x449c('0x1c')];var _0x1fd0d0=_0x80bdf5?_0x3510e1[_0x449c('0x1f')]:_0x39a9c4['offset']+_0x39a9c4[_0x449c('0x1e')];var _0x1b5b82;if(_0x1fd0d0>=_0x551b31){_0x1fd0d0=_0x551b31;_0x1b5b82=0xc8;}else{_0x1b5b82=0xce;}_0x258b57[_0x449c('0x1a')](_0x1b5b82);return _0x258b57[_0x449c('0x20')](_0x449c('0x21'),_0x4474e2+'-'+_0x1fd0d0+'/'+_0x551b31)[_0x449c('0x1b')](_0x3510e1);}return null;};}function patchUpdates(_0x57c137){return function(_0x3aee9c){try{jsonpatch[_0x449c('0x22')](_0x3aee9c,_0x57c137,!![]);}catch(_0x58bc53){return BPromise[_0x449c('0x23')](_0x58bc53);}return _0x3aee9c[_0x449c('0x24')]();};}function saveUpdates(_0xdb81ec,_0x42c25f){return function(_0x243d68){if(_0x243d68){return _0x243d68[_0x449c('0x25')](_0xdb81ec)['then'](function(_0x2024a3){return _0x2024a3;});}return null;};}function removeEntity(_0x278917,_0x4f06b3){return function(_0x4dff4c){if(_0x4dff4c){return _0x4dff4c['destroy']()[_0x449c('0x26')](function(){_0x278917['status'](0xcc)[_0x449c('0x19')]();});}};}function handleEntityNotFound(_0x43fea6,_0x2deffd){return function(_0x30512f){if(!_0x30512f){_0x43fea6[_0x449c('0x18')](0x194);}return _0x30512f;};}function handleError(_0x3d8c69,_0x30581e){_0x30581e=_0x30581e||0x1f4;return function(_0x9cfd5){logger[_0x449c('0x27')](_0x9cfd5[_0x449c('0x28')]);if(_0x9cfd5[_0x449c('0x29')]){delete _0x9cfd5[_0x449c('0x29')];}_0x3d8c69[_0x449c('0x1a')](_0x30581e)['send'](_0x9cfd5);};}exports['index']=function(_0x390ada,_0xa23b51){var _0x258479={},_0x35757b={},_0x2e9903={'count':0x0,'rows':[]};var _0x45315d=_[_0x449c('0x2a')](db[_0x449c('0x2b')][_0x449c('0x2c')],function(_0xeebeea){return{'name':_0xeebeea[_0x449c('0x2d')],'type':_0xeebeea[_0x449c('0x2e')][_0x449c('0x2f')]};});_0x35757b[_0x449c('0x30')]=_[_0x449c('0x2a')](_0x45315d,_0x449c('0x29'));_0x35757b[_0x449c('0x31')]=_[_0x449c('0x32')](_0x390ada[_0x449c('0x31')]);_0x35757b[_0x449c('0x33')]=_[_0x449c('0x34')](_0x35757b[_0x449c('0x30')],_0x35757b[_0x449c('0x31')]);_0x258479[_0x449c('0x35')]=_[_0x449c('0x34')](_0x35757b[_0x449c('0x30')],qs[_0x449c('0x36')](_0x390ada['query'][_0x449c('0x36')]));_0x258479['attributes']=_0x258479[_0x449c('0x35')]['length']?_0x258479['attributes']:_0x35757b['model'];if(!_0x390ada[_0x449c('0x31')][_0x449c('0x37')](_0x449c('0x38'))){_0x258479['limit']=qs[_0x449c('0x1e')](_0x390ada[_0x449c('0x31')][_0x449c('0x1e')]);_0x258479['offset']=qs['offset'](_0x390ada[_0x449c('0x31')]['offset']);}_0x258479['order']=qs[_0x449c('0x39')](_0x390ada[_0x449c('0x31')][_0x449c('0x39')]);_0x258479[_0x449c('0x3a')]=qs[_0x449c('0x33')](_[_0x449c('0x3b')](_0x390ada[_0x449c('0x31')],_0x35757b[_0x449c('0x33')]),_0x45315d);if(_0x390ada[_0x449c('0x31')]['filter']){_0x258479['where']=_[_0x449c('0x3c')](_0x258479[_0x449c('0x3a')],{'$or':_[_0x449c('0x2a')](_0x45315d,function(_0x2cb4b2){if(_0x2cb4b2[_0x449c('0x2e')]!==_0x449c('0x3d')){var _0x1a721c={};_0x1a721c[_0x2cb4b2['name']]={'$like':'%'+_0x390ada[_0x449c('0x31')][_0x449c('0x3e')]+'%'};return _0x1a721c;}})});}_0x258479=_[_0x449c('0x3c')]({},_0x258479,_0x390ada[_0x449c('0x3f')]);var _0x372398={'where':_0x258479[_0x449c('0x3a')]};return db['JscriptyAnswerReport']['count'](_0x372398)['then'](function(_0x189fa8){_0x2e9903[_0x449c('0x1f')]=_0x189fa8;if(_0x390ada[_0x449c('0x31')][_0x449c('0x40')]){_0x258479[_0x449c('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x258479);})[_0x449c('0x26')](function(_0x2c6c03){_0x2e9903[_0x449c('0x42')]=_0x2c6c03;return _0x2e9903;})[_0x449c('0x26')](respondWithFilteredResult(_0xa23b51,_0x258479))[_0x449c('0x43')](handleError(_0xa23b51,null));};exports[_0x449c('0x44')]=function(_0x8d3dbf,_0x280548){var _0x5669ef={'raw':!![],'where':{'id':_0x8d3dbf['params']['id']}},_0x4e1c2b={};_0x4e1c2b[_0x449c('0x30')]=_[_0x449c('0x32')](db[_0x449c('0x2b')][_0x449c('0x2c')]);_0x4e1c2b['query']=_[_0x449c('0x32')](_0x8d3dbf['query']);_0x4e1c2b[_0x449c('0x33')]=_[_0x449c('0x34')](_0x4e1c2b['model'],_0x4e1c2b[_0x449c('0x31')]);_0x5669ef['attributes']=_[_0x449c('0x34')](_0x4e1c2b[_0x449c('0x30')],qs[_0x449c('0x36')](_0x8d3dbf[_0x449c('0x31')][_0x449c('0x36')]));_0x5669ef[_0x449c('0x35')]=_0x5669ef['attributes'][_0x449c('0x45')]?_0x5669ef['attributes']:_0x4e1c2b[_0x449c('0x30')];if(_0x8d3dbf[_0x449c('0x31')][_0x449c('0x40')]){_0x5669ef[_0x449c('0x41')]=[{'all':!![]}];}_0x5669ef=_['merge']({},_0x5669ef,_0x8d3dbf[_0x449c('0x3f')]);return db[_0x449c('0x2b')][_0x449c('0x46')](_0x5669ef)['then'](handleEntityNotFound(_0x280548,null))['then'](respondWithResult(_0x280548,null))[_0x449c('0x43')](handleError(_0x280548,null));};exports[_0x449c('0x47')]=function(_0x1e00f2,_0xca783c){return db[_0x449c('0x2b')][_0x449c('0x47')](_0x1e00f2[_0x449c('0x48')],{})['then'](respondWithResult(_0xca783c,0xc9))[_0x449c('0x43')](handleError(_0xca783c,null));};exports[_0x449c('0x25')]=function(_0x3c4632,_0x155f1f){if(_0x3c4632[_0x449c('0x48')]['id']){delete _0x3c4632[_0x449c('0x48')]['id'];}return db[_0x449c('0x2b')][_0x449c('0x46')]({'where':{'id':_0x3c4632[_0x449c('0x49')]['id']}})[_0x449c('0x26')](handleEntityNotFound(_0x155f1f,null))[_0x449c('0x26')](saveUpdates(_0x3c4632[_0x449c('0x48')],null))[_0x449c('0x26')](respondWithResult(_0x155f1f,null))[_0x449c('0x43')](handleError(_0x155f1f,null));};exports[_0x449c('0x4a')]=function(_0x3346ab,_0x189acd){return db[_0x449c('0x2b')][_0x449c('0x46')]({'where':{'id':_0x3346ab['params']['id']}})[_0x449c('0x26')](handleEntityNotFound(_0x189acd,null))['then'](removeEntity(_0x189acd,null))[_0x449c('0x43')](handleError(_0x189acd,null));};exports['describe']=function(_0x3d6807,_0x2a230e){return db[_0x449c('0x2b')][_0x449c('0x4b')]()[_0x449c('0x26')](respondWithResult(_0x2a230e,null))[_0x449c('0x43')](handleError(_0x2a230e,null));};
\ No newline at end of file
index 732078e..0176dd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf1d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x23fb2a,_0x29f8f4){var _0x2b2ed7=function(_0x1f37d0){while(--_0x1f37d0){_0x23fb2a['push'](_0x23fb2a['shift']());}};_0x2b2ed7(++_0x29f8f4);}(_0xbf1d,0x79));var _0xdbf1=function(_0x208f8c,_0x31fec7){_0x208f8c=_0x208f8c-0x0;var _0x2bec3a=_0xbf1d[_0x208f8c];return _0x2bec3a;};'use strict';var _=require(_0xdbf1('0x0'));var util=require(_0xdbf1('0x1'));var logger=require(_0xdbf1('0x2'))('api');var moment=require(_0xdbf1('0x3'));var BPromise=require(_0xdbf1('0x4'));var rp=require(_0xdbf1('0x5'));var fs=require('fs');var path=require(_0xdbf1('0x6'));var rimraf=require('rimraf');var config=require(_0xdbf1('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xdbf1('0x8')]=function(_0x1537b9,_0x5105fe){return _0x1537b9[_0xdbf1('0x9')](_0xdbf1('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x182a=['exports','define','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes'];(function(_0x5e40ed,_0x2bee12){var _0x1cc45a=function(_0x8334df){while(--_0x8334df){_0x5e40ed['push'](_0x5e40ed['shift']());}};_0x1cc45a(++_0x2bee12);}(_0x182a,0x1e4));var _0xa182=function(_0x4209ea,_0x1d4883){_0x4209ea=_0x4209ea-0x0;var _0x44c492=_0x182a[_0x4209ea];return _0x44c492;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa182('0x0'))(_0xa182('0x1'));var moment=require(_0xa182('0x2'));var BPromise=require(_0xa182('0x3'));var rp=require(_0xa182('0x4'));var fs=require('fs');var path=require(_0xa182('0x5'));var rimraf=require(_0xa182('0x6'));var config=require('../../config/environment');var attributes=require(_0xa182('0x7'));module[_0xa182('0x8')]=function(_0x25daec,_0xde349f){return _0x25daec[_0xa182('0x9')](_0xa182('0xa'),attributes,{'tableName':_0xa182('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ea9340..cbbbfc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9d6=['client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xd9d6,0x19c));var _0x6d9d=function(_0x9bfc6c,_0x159ef2){_0x9bfc6c=_0x9bfc6c-0x0;var _0x1f8376=_0xd9d6[_0x9bfc6c];return _0x1f8376;};'use strict';var _=require(_0x6d9d('0x0'));var util=require(_0x6d9d('0x1'));var moment=require('moment');var BPromise=require(_0x6d9d('0x2'));var rs=require(_0x6d9d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d9d('0x4'))(_0x6d9d('0x5'));var config=require(_0x6d9d('0x6'));var jayson=require(_0x6d9d('0x7'));var client=jayson[_0x6d9d('0x8')][_0x6d9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55df15,_0x103081,_0x156adc){return new BPromise(function(_0x3c6076,_0x9f6196){return client[_0x6d9d('0xa')](_0x55df15,_0x156adc)['then'](function(_0xabe12b){logger['info'](_0x6d9d('0xb'),_0x103081,_0x6d9d('0xc'));logger[_0x6d9d('0xd')](_0x6d9d('0xe'),_0x103081,'request\x20sent',JSON[_0x6d9d('0xf')](_0xabe12b));if(_0xabe12b[_0x6d9d('0x10')]){if(_0xabe12b[_0x6d9d('0x10')]['code']===0x1f4){logger['error'](_0x6d9d('0xb'),_0x103081,_0xabe12b[_0x6d9d('0x10')]['message']);return _0x9f6196(_0xabe12b[_0x6d9d('0x10')][_0x6d9d('0x11')]);}logger['error'](_0x6d9d('0xb'),_0x103081,_0xabe12b['error'][_0x6d9d('0x11')]);return _0x3c6076(_0xabe12b[_0x6d9d('0x10')]['message']);}else{logger[_0x6d9d('0x12')](_0x6d9d('0xb'),_0x103081,_0x6d9d('0xc'));_0x3c6076(_0xabe12b[_0x6d9d('0x13')][_0x6d9d('0x11')]);}})[_0x6d9d('0x14')](function(_0x474b49){logger[_0x6d9d('0x10')](_0x6d9d('0xb'),_0x103081,_0x474b49);_0x9f6196(_0x474b49);});});}
\ No newline at end of file
+var _0x16f6=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x29b6d3,_0x340e89){var _0x5c98d5=function(_0x3f7a53){while(--_0x3f7a53){_0x29b6d3['push'](_0x29b6d3['shift']());}};_0x5c98d5(++_0x340e89);}(_0x16f6,0x1be));var _0x616f=function(_0x4c9472,_0x328a7f){_0x4c9472=_0x4c9472-0x0;var _0x511734=_0x16f6[_0x4c9472];return _0x511734;};'use strict';var _=require(_0x616f('0x0'));var util=require(_0x616f('0x1'));var moment=require(_0x616f('0x2'));var BPromise=require('bluebird');var rs=require(_0x616f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x616f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x616f('0x5'))(_0x616f('0x6'));var config=require(_0x616f('0x7'));var jayson=require(_0x616f('0x8'));var client=jayson[_0x616f('0x9')][_0x616f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5941f6,_0x1f29a5,_0x198098){return new BPromise(function(_0x5cb7f4,_0x4c0a50){return client[_0x616f('0xb')](_0x5941f6,_0x198098)[_0x616f('0xc')](function(_0x15a391){logger[_0x616f('0xd')](_0x616f('0xe'),_0x1f29a5,_0x616f('0xf'));logger[_0x616f('0x10')](_0x616f('0x11'),_0x1f29a5,_0x616f('0xf'),JSON[_0x616f('0x12')](_0x15a391));if(_0x15a391['error']){if(_0x15a391[_0x616f('0x13')]['code']===0x1f4){logger[_0x616f('0x13')](_0x616f('0xe'),_0x1f29a5,_0x15a391['error']['message']);return _0x4c0a50(_0x15a391[_0x616f('0x13')][_0x616f('0x14')]);}logger[_0x616f('0x13')](_0x616f('0xe'),_0x1f29a5,_0x15a391[_0x616f('0x13')]['message']);return _0x5cb7f4(_0x15a391[_0x616f('0x13')]['message']);}else{logger[_0x616f('0xd')](_0x616f('0xe'),_0x1f29a5,'request\x20sent');_0x5cb7f4(_0x15a391[_0x616f('0x15')]['message']);}})[_0x616f('0x16')](function(_0x2d2025){logger['error'](_0x616f('0xe'),_0x1f29a5,_0x2d2025);_0x4c0a50(_0x2d2025);});});}
\ No newline at end of file
index 0b8ce7a..6b90b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcaa=['30s','getSummary','post','create','/:id/clone','clone','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','getAnswers'];(function(_0x2a7359,_0xb7d19e){var _0x126670=function(_0x142be3){while(--_0x142be3){_0x2a7359['push'](_0x2a7359['shift']());}};_0x126670(++_0xb7d19e);}(_0xbcaa,0x132));var _0xabca=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0xbcaa[_0x23b2b4];return _0x4918ae;};'use strict';var multer=require(_0xabca('0x0'));var util=require(_0xabca('0x1'));var path=require(_0xabca('0x2'));var timeout=require(_0xabca('0x3'));var express=require(_0xabca('0x4'));var router=express[_0xabca('0x5')]();var fs_extra=require(_0xabca('0x6'));var auth=require(_0xabca('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xabca('0x8'));var controller=require(_0xabca('0x9'));router['get']('/',auth[_0xabca('0xa')](),controller[_0xabca('0xb')]);router[_0xabca('0xc')](_0xabca('0xd'),auth['isAuthenticated'](),controller[_0xabca('0xe')]);router[_0xabca('0xc')](_0xabca('0xf'),auth[_0xabca('0xa')](),controller[_0xabca('0x10')]);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0xabca('0x11')]);router[_0xabca('0xc')]('/:id/summary',auth[_0xabca('0xa')](),timeout(_0xabca('0x12')),controller[_0xabca('0x13')]);router[_0xabca('0x14')]('/',auth[_0xabca('0xa')](),controller[_0xabca('0x15')]);router[_0xabca('0x14')](_0xabca('0x16'),auth[_0xabca('0xa')](),controller[_0xabca('0x17')]);router[_0xabca('0x18')](_0xabca('0xd'),auth[_0xabca('0xa')](),controller[_0xabca('0x19')]);router[_0xabca('0x1a')]('/:id',auth[_0xabca('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2cf6=['/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x248b1f,_0x51df28){var _0x2e30dc=function(_0x166402){while(--_0x166402){_0x248b1f['push'](_0x248b1f['shift']());}};_0x2e30dc(++_0x51df28);}(_0x2cf6,0x193));var _0x62cf=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2cf6[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x62cf('0x0'));var util=require(_0x62cf('0x1'));var path=require('path');var timeout=require(_0x62cf('0x2'));var express=require('express');var router=express[_0x62cf('0x3')]();var fs_extra=require(_0x62cf('0x4'));var auth=require(_0x62cf('0x5'));var interaction=require(_0x62cf('0x6'));var config=require(_0x62cf('0x7'));var controller=require('./jscriptyProject.controller');router[_0x62cf('0x8')]('/',auth[_0x62cf('0x9')](),controller[_0x62cf('0xa')]);router[_0x62cf('0x8')](_0x62cf('0xb'),auth[_0x62cf('0x9')](),controller[_0x62cf('0xc')]);router[_0x62cf('0x8')](_0x62cf('0xd'),auth[_0x62cf('0x9')](),controller[_0x62cf('0xe')]);router['get'](_0x62cf('0xf'),auth[_0x62cf('0x9')](),controller['getAnswers']);router[_0x62cf('0x8')](_0x62cf('0x10'),auth['isAuthenticated'](),timeout(_0x62cf('0x11')),controller[_0x62cf('0x12')]);router[_0x62cf('0x13')]('/',auth[_0x62cf('0x9')](),controller['create']);router[_0x62cf('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0x62cf('0x14')]);router[_0x62cf('0x15')](_0x62cf('0xb'),auth['isAuthenticated'](),controller[_0x62cf('0x16')]);router[_0x62cf('0x17')](_0x62cf('0xb'),auth['isAuthenticated'](),controller[_0x62cf('0x18')]);module[_0x62cf('0x19')]=router;
\ No newline at end of file
index 9a44ca5..2e26b69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x730c=['long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','BOOLEAN','sequelize','util','STRING','TEXT'];(function(_0x537b8c,_0x2afdc9){var _0x4581f7=function(_0x9762e3){while(--_0x9762e3){_0x537b8c['push'](_0x537b8c['shift']());}};_0x4581f7(++_0x2afdc9);}(_0x730c,0xec));var _0xc730=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x730c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc730('0x0'));var _=require('lodash');var util=require(_0xc730('0x1'));module['exports']={'name':{'type':Sequelize[_0xc730('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xc730('0x2')]},'formData':{'type':Sequelize[_0xc730('0x3')](_0xc730('0x4')),'set':function(_0x155b40){if(_[_0xc730('0x5')](_0x155b40)){this['setDataValue'](_0xc730('0x6'),JSON[_0xc730('0x7')](_0x155b40));}else if(_[_0xc730('0x8')](_0x155b40)){this[_0xc730('0x9')](_0xc730('0x6'),_0x155b40);}else{this[_0xc730('0x9')](_0xc730('0x6'),util[_0xc730('0xa')](_0xc730('0xb'),this['getDataValue'](_0xc730('0xc'))||'',this[_0xc730('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc730('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc730('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0xca27=['isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','util','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x46030a,_0x5ba40d){var _0x2f6ae5=function(_0x33c6cf){while(--_0x33c6cf){_0x46030a['push'](_0x46030a['shift']());}};_0x2f6ae5(++_0x5ba40d);}(_0xca27,0xf3));var _0x7ca2=function(_0x377870,_0x160e39){_0x377870=_0x377870-0x0;var _0x2d78bc=_0xca27[_0x377870];return _0x2d78bc;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x7ca2('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ca2('0x1')],'unique':_0x7ca2('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7ca2('0x3')](_0x7ca2('0x4')),'set':function(_0x1cdcc2){if(_[_0x7ca2('0x5')](_0x1cdcc2)){this[_0x7ca2('0x6')](_0x7ca2('0x7'),JSON[_0x7ca2('0x8')](_0x1cdcc2));}else if(_[_0x7ca2('0x9')](_0x1cdcc2)){this[_0x7ca2('0x6')](_0x7ca2('0x7'),_0x1cdcc2);}else{this[_0x7ca2('0x6')](_0x7ca2('0x7'),util['format'](_0x7ca2('0xa'),this[_0x7ca2('0xb')](_0x7ca2('0x2'))||'',this['getDataValue'](_0x7ca2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7ca2('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7ca2('0xd')],'defaultValue':![]}};
\ No newline at end of file
index 9a60c06..d6ca5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7044=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Projects','UserProfileResource','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','autoAssociation','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x7044,0x147));var _0x4704=function(_0x3a712c,_0x4571ec){_0x3a712c=_0x3a712c-0x0;var _0x3ae099=_0x7044[_0x3a712c];return _0x3ae099;};'use strict';var emlformat=require(_0x4704('0x0'));var rimraf=require(_0x4704('0x1'));var zipdir=require(_0x4704('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4704('0x3'));var moment=require(_0x4704('0x4'));var BPromise=require(_0x4704('0x5'));var Mustache=require(_0x4704('0x6'));var util=require('util');var path=require(_0x4704('0x7'));var sox=require('sox');var csv=require(_0x4704('0x8'));var ejs=require(_0x4704('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4704('0xa'));var crypto=require(_0x4704('0xb'));var jsforce=require(_0x4704('0xc'));var deskjs=require(_0x4704('0xd'));var toCsv=require(_0x4704('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4704('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4704('0xf'));var as=require(_0x4704('0x10'));var hardwareService=require(_0x4704('0x11'));var logger=require(_0x4704('0x12'))(_0x4704('0x13'));var utils=require('../../config/utils');var config=require(_0x4704('0x14'));var licenseUtil=require(_0x4704('0x15'));var db=require(_0x4704('0x16'))['db'];function respondWithStatusCode(_0x30f8e8,_0x39ee42){_0x39ee42=_0x39ee42||0xcc;return function(_0x268453){if(_0x268453){return _0x30f8e8['sendStatus'](_0x39ee42);}return _0x30f8e8[_0x4704('0x17')](_0x39ee42)[_0x4704('0x18')]();};}function respondWithResult(_0x290e8e,_0x2ae487){_0x2ae487=_0x2ae487||0xc8;return function(_0x246765){if(_0x246765){return _0x290e8e[_0x4704('0x17')](_0x2ae487)[_0x4704('0x19')](_0x246765);}};}function respondWithFilteredResult(_0x3acce4,_0x27c4b8){return function(_0x5d5f3b){if(_0x5d5f3b){var _0x51ea30=typeof _0x27c4b8[_0x4704('0x1a')]===_0x4704('0x1b')&&typeof _0x27c4b8[_0x4704('0x1c')]===_0x4704('0x1b');var _0x185f39=_0x5d5f3b['count'];var _0x44440b=_0x51ea30?0x0:_0x27c4b8[_0x4704('0x1a')];var _0x10ff93=_0x51ea30?_0x5d5f3b[_0x4704('0x1d')]:_0x27c4b8[_0x4704('0x1a')]+_0x27c4b8['limit'];var _0x14b553;if(_0x10ff93>=_0x185f39){_0x10ff93=_0x185f39;_0x14b553=0xc8;}else{_0x14b553=0xce;}_0x3acce4['status'](_0x14b553);return _0x3acce4[_0x4704('0x1e')](_0x4704('0x1f'),_0x44440b+'-'+_0x10ff93+'/'+_0x185f39)[_0x4704('0x19')](_0x5d5f3b);}return null;};}function patchUpdates(_0x91fc0f){return function(_0x568704){try{jsonpatch[_0x4704('0x20')](_0x568704,_0x91fc0f,!![]);}catch(_0x4a7642){return BPromise[_0x4704('0x21')](_0x4a7642);}return _0x568704['save']();};}function saveUpdates(_0x3e7d5b,_0x85ac91){return function(_0x18d3d6){if(_0x18d3d6){return _0x18d3d6[_0x4704('0x22')](_0x3e7d5b)[_0x4704('0x23')](function(_0x59a444){return _0x59a444;});}return null;};}function removeEntity(_0xd41c4b,_0x26d9b1){return function(_0x48bbb1){if(_0x48bbb1){return _0x48bbb1[_0x4704('0x24')]()[_0x4704('0x23')](function(){var _0x5caeba=_0x48bbb1['get']({'plain':!![]});var _0x1c3e2d=_0x4704('0x25');return db[_0x4704('0x26')][_0x4704('0x24')]({'where':{'type':_0x1c3e2d,'resourceId':_0x5caeba['id']}})[_0x4704('0x23')](function(){return _0x48bbb1;});})['then'](function(){_0xd41c4b[_0x4704('0x17')](0xcc)[_0x4704('0x18')]();});}};}function handleEntityNotFound(_0x4aae62,_0x349366){return function(_0x14435){if(!_0x14435){_0x4aae62[_0x4704('0x27')](0x194);}return _0x14435;};}function handleError(_0x34d080,_0x125d9c){_0x125d9c=_0x125d9c||0x1f4;return function(_0x42521f){logger[_0x4704('0x28')](_0x42521f[_0x4704('0x29')]);if(_0x42521f[_0x4704('0x2a')]){delete _0x42521f[_0x4704('0x2a')];}_0x34d080['status'](_0x125d9c)[_0x4704('0x2b')](_0x42521f);};}exports[_0x4704('0x2c')]=function(_0x64e7d,_0x480128){var _0x487907={},_0x40bc39={},_0x12da39={'count':0x0,'rows':[]};var _0x298650=_[_0x4704('0x2d')](db[_0x4704('0x2e')][_0x4704('0x2f')],function(_0x33116c){return{'name':_0x33116c[_0x4704('0x30')],'type':_0x33116c['type'][_0x4704('0x31')]};});_0x40bc39['model']=_[_0x4704('0x2d')](_0x298650,_0x4704('0x2a'));_0x40bc39[_0x4704('0x32')]=_[_0x4704('0x33')](_0x64e7d['query']);_0x40bc39['filters']=_['intersection'](_0x40bc39[_0x4704('0x34')],_0x40bc39[_0x4704('0x32')]);_0x487907[_0x4704('0x35')]=_[_0x4704('0x36')](_0x40bc39[_0x4704('0x34')],qs[_0x4704('0x37')](_0x64e7d[_0x4704('0x32')][_0x4704('0x37')]));_0x487907[_0x4704('0x35')]=_0x487907[_0x4704('0x35')][_0x4704('0x38')]?_0x487907[_0x4704('0x35')]:_0x40bc39[_0x4704('0x34')];if(!_0x64e7d[_0x4704('0x32')]['hasOwnProperty'](_0x4704('0x39'))){_0x487907[_0x4704('0x1c')]=qs[_0x4704('0x1c')](_0x64e7d[_0x4704('0x32')][_0x4704('0x1c')]);_0x487907[_0x4704('0x1a')]=qs['offset'](_0x64e7d[_0x4704('0x32')][_0x4704('0x1a')]);}_0x487907[_0x4704('0x3a')]=qs[_0x4704('0x3b')](_0x64e7d[_0x4704('0x32')][_0x4704('0x3b')]);_0x487907[_0x4704('0x3c')]=qs[_0x4704('0x3d')](_[_0x4704('0x3e')](_0x64e7d[_0x4704('0x32')],_0x40bc39[_0x4704('0x3d')]),_0x298650);if(_0x64e7d[_0x4704('0x32')][_0x4704('0x3f')]){_0x487907[_0x4704('0x3c')]=_['merge'](_0x487907['where'],{'$or':_[_0x4704('0x2d')](_0x298650,function(_0x580d10){if(_0x580d10[_0x4704('0x40')]!==_0x4704('0x41')){var _0x1f3d4d={};_0x1f3d4d[_0x580d10['name']]={'$like':'%'+_0x64e7d[_0x4704('0x32')][_0x4704('0x3f')]+'%'};return _0x1f3d4d;}})});}_0x487907=_[_0x4704('0x42')]({},_0x487907,_0x64e7d[_0x4704('0x43')]);var _0x65543f={'where':_0x487907[_0x4704('0x3c')]};return db['JscriptyProject'][_0x4704('0x1d')](_0x65543f)['then'](function(_0x253fce){_0x12da39['count']=_0x253fce;if(_0x64e7d[_0x4704('0x32')][_0x4704('0x44')]){_0x487907['include']=[{'all':!![]}];}return db[_0x4704('0x2e')][_0x4704('0x45')](_0x487907);})['then'](function(_0x55f50e){_0x12da39[_0x4704('0x46')]=_0x55f50e;return _0x12da39;})[_0x4704('0x23')](respondWithFilteredResult(_0x480128,_0x487907))[_0x4704('0x47')](handleError(_0x480128,null));};exports['show']=function(_0x2c8edd,_0x3ca6b4){var _0x2219d0={'raw':![],'where':{'id':_0x2c8edd[_0x4704('0x48')]['id']}},_0x40b6b4={};_0x40b6b4[_0x4704('0x34')]=_[_0x4704('0x33')](db[_0x4704('0x2e')][_0x4704('0x2f')]);_0x40b6b4[_0x4704('0x32')]=_['keys'](_0x2c8edd[_0x4704('0x32')]);_0x40b6b4['filters']=_[_0x4704('0x36')](_0x40b6b4[_0x4704('0x34')],_0x40b6b4[_0x4704('0x32')]);_0x2219d0[_0x4704('0x35')]=_['intersection'](_0x40b6b4[_0x4704('0x34')],qs[_0x4704('0x37')](_0x2c8edd['query']['fields']));_0x2219d0[_0x4704('0x35')]=_0x2219d0[_0x4704('0x35')][_0x4704('0x38')]?_0x2219d0[_0x4704('0x35')]:_0x40b6b4[_0x4704('0x34')];if(_0x2c8edd[_0x4704('0x32')][_0x4704('0x44')]){_0x2219d0[_0x4704('0x49')]=[{'all':!![]}];}_0x2219d0=_['merge']({},_0x2219d0,_0x2c8edd[_0x4704('0x43')]);return db['JscriptyProject'][_0x4704('0x4a')](_0x2219d0)[_0x4704('0x23')](handleEntityNotFound(_0x3ca6b4,null))[_0x4704('0x23')](respondWithResult(_0x3ca6b4,null))[_0x4704('0x47')](handleError(_0x3ca6b4,null));};exports[_0x4704('0x4b')]=function(_0x113c8f,_0x30f4a4){return db[_0x4704('0x2e')][_0x4704('0x4b')](_0x113c8f[_0x4704('0x4c')],{})[_0x4704('0x23')](function(_0x42a07a){var _0x51cb60=_0x113c8f[_0x4704('0x4d')][_0x4704('0x4e')]({'plain':!![]});if(!_0x51cb60)throw new Error(_0x4704('0x4f'));if(_0x51cb60['role']===_0x4704('0x4d')){var _0x106692=_0x42a07a[_0x4704('0x4e')]({'plain':!![]});var _0x2c916a=_0x4704('0x25');return db[_0x4704('0x50')]['find']({'where':{'name':_0x2c916a,'userProfileId':_0x51cb60[_0x4704('0x51')]},'raw':!![]})['then'](function(_0xdbee2b){if(_0xdbee2b&&_0xdbee2b['autoAssociation']===0x0){return db[_0x4704('0x26')][_0x4704('0x4b')]({'name':_0x106692[_0x4704('0x2a')],'resourceId':_0x106692['id'],'type':_0xdbee2b['name'],'sectionId':_0xdbee2b['id']},{})[_0x4704('0x23')](function(){return _0x42a07a;});}else{return _0x42a07a;}})['catch'](function(_0x387ce5){logger['error'](_0x4704('0x52'),_0x387ce5);throw _0x387ce5;});}return _0x42a07a;})['then'](respondWithResult(_0x30f4a4,0xc9))[_0x4704('0x47')](handleError(_0x30f4a4,null));};exports['clone']=function(_0x31e142,_0x8910b8){var _0x3a17e2={'where':{'id':_0x31e142['params']['id']}},_0x757e9b={};_0x757e9b['model']=_[_0x4704('0x33')](db[_0x4704('0x2e')][_0x4704('0x2f')]);_0x3a17e2[_0x4704('0x35')]=_[_0x4704('0x36')](_0x757e9b['model'],qs[_0x4704('0x37')](_0x31e142[_0x4704('0x32')]['fields']));_0x3a17e2[_0x4704('0x35')]=_0x3a17e2[_0x4704('0x35')][_0x4704('0x38')]?_0x3a17e2[_0x4704('0x35')]:_0x757e9b[_0x4704('0x34')];if(_0x31e142[_0x4704('0x32')]['includeAll']){_0x3a17e2[_0x4704('0x49')]=[{'all':!![]}];}_0x3a17e2=_['merge']({},_0x3a17e2,_0x31e142['options']);return db[_0x4704('0x2e')]['find'](_0x3a17e2)['then'](handleEntityNotFound(_0x8910b8,null))['then'](function(_0x4ec8fa){if(_0x4ec8fa){var _0x3fb175=_0x4ec8fa[_0x4704('0x4e')]({'plain':!![]});_0x3fb175=qs[_0x4704('0x53')](_0x3fb175,['id',_0x4704('0x54'),'updatedAt']);_0x31e142[_0x4704('0x4c')]=_['omit'](_0x31e142[_0x4704('0x4c')],['id',_0x4704('0x54'),_0x4704('0x55')]);return db[_0x4704('0x2e')][_0x4704('0x4b')](_[_0x4704('0x42')](_0x3fb175,_0x31e142['body']),{'include':_0x31e142[_0x4704('0x32')][_0x4704('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x114e3a){var _0xdfa921=_0x31e142['user'][_0x4704('0x4e')]({'plain':!![]});if(!_0xdfa921)throw new Error(_0x4704('0x4f'));if(_0xdfa921['role']===_0x4704('0x4d')){var _0x416142=_0x114e3a[_0x4704('0x4e')]({'plain':!![]});var _0x22f7bf='Projects';return db[_0x4704('0x50')][_0x4704('0x4a')]({'where':{'name':_0x22f7bf,'userProfileId':_0xdfa921[_0x4704('0x51')]},'raw':!![]})['then'](function(_0x16b90a){if(_0x16b90a&&_0x16b90a[_0x4704('0x56')]===0x0){return db[_0x4704('0x26')][_0x4704('0x4b')]({'name':_0x416142['name'],'resourceId':_0x416142['id'],'type':_0x16b90a['name'],'sectionId':_0x16b90a['id']},{})[_0x4704('0x23')](function(){return _0x114e3a;});}else{return _0x114e3a;}})['catch'](function(_0xbdb1f7){logger[_0x4704('0x28')](_0x4704('0x52'),_0xbdb1f7);throw _0xbdb1f7;});}return _0x114e3a;});}})['then'](respondWithResult(_0x8910b8,0xc9))[_0x4704('0x47')](handleError(_0x8910b8,null));};exports['update']=function(_0x42ce91,_0x1c331e){if(_0x42ce91['body']['id']){delete _0x42ce91[_0x4704('0x4c')]['id'];}return db[_0x4704('0x2e')]['find']({'where':{'id':_0x42ce91[_0x4704('0x48')]['id']}})[_0x4704('0x23')](handleEntityNotFound(_0x1c331e,null))['then'](saveUpdates(_0x42ce91['body'],null))[_0x4704('0x23')](respondWithResult(_0x1c331e,null))[_0x4704('0x47')](handleError(_0x1c331e,null));};exports[_0x4704('0x24')]=function(_0x346232,_0x3c8b8c){return db[_0x4704('0x2e')][_0x4704('0x4a')]({'where':{'id':_0x346232[_0x4704('0x48')]['id']}})[_0x4704('0x23')](handleEntityNotFound(_0x3c8b8c,null))[_0x4704('0x23')](removeEntity(_0x3c8b8c,null))[_0x4704('0x47')](handleError(_0x3c8b8c,null));};exports['getSessions']=function(_0x2460c3,_0x13812d,_0x37d00d){var _0x590489={'raw':!![],'where':{}};var _0x423b08={};var _0xe17d67={'count':0x0,'rows':[]};return db[_0x4704('0x2e')][_0x4704('0x57')]({'where':{'id':_0x2460c3[_0x4704('0x48')]['id']}})['then'](handleEntityNotFound(_0x13812d,null))[_0x4704('0x23')](function(_0x46e768){if(_0x46e768){_0x423b08[_0x4704('0x34')]=_[_0x4704('0x33')](db[_0x4704('0x58')][_0x4704('0x2f')]);_0x423b08[_0x4704('0x32')]=_[_0x4704('0x33')](_0x2460c3[_0x4704('0x32')]);_0x423b08['filters']=_[_0x4704('0x36')](_0x423b08[_0x4704('0x34')],_0x423b08[_0x4704('0x32')]);_0x590489[_0x4704('0x35')]=_[_0x4704('0x36')](_0x423b08[_0x4704('0x34')],qs[_0x4704('0x37')](_0x2460c3['query'][_0x4704('0x37')]));_0x590489['attributes']=_0x590489[_0x4704('0x35')]['length']?_0x590489[_0x4704('0x35')]:_0x423b08[_0x4704('0x34')];if(!_0x2460c3[_0x4704('0x32')][_0x4704('0x59')]('nolimit')){_0x590489['limit']=qs[_0x4704('0x1c')](_0x2460c3['query'][_0x4704('0x1c')]);_0x590489['offset']=qs[_0x4704('0x1a')](_0x2460c3[_0x4704('0x32')][_0x4704('0x1a')]);}_0x590489[_0x4704('0x3a')]=qs[_0x4704('0x3b')](_0x2460c3[_0x4704('0x32')][_0x4704('0x3b')]);_0x590489[_0x4704('0x3c')]=qs[_0x4704('0x3d')](_['pick'](_0x2460c3[_0x4704('0x32')],_0x423b08['filters']));_0x590489[_0x4704('0x3c')][_0x4704('0x5a')]=_0x46e768['id'];if(_0x2460c3[_0x4704('0x32')][_0x4704('0x3f')]){_0x590489['where']=_[_0x4704('0x42')](_0x590489[_0x4704('0x3c')],{'$or':_[_0x4704('0x2d')](_0x590489[_0x4704('0x35')],function(_0x2d25c6){var _0x233e3e={};_0x233e3e[_0x2d25c6]={'$like':'%'+_0x2460c3[_0x4704('0x32')][_0x4704('0x3f')]+'%'};return _0x233e3e;})});}_0x590489=_[_0x4704('0x42')]({},_0x590489,_0x2460c3['options']);return db['JscriptySessionReport'][_0x4704('0x1d')]({'where':_0x590489[_0x4704('0x3c')]})[_0x4704('0x23')](function(_0x5a68be){_0xe17d67[_0x4704('0x1d')]=_0x5a68be;if(_0x2460c3['query'][_0x4704('0x44')]){_0x590489[_0x4704('0x49')]=[{'all':!![]}];}return db[_0x4704('0x58')]['findAll'](_0x590489);})[_0x4704('0x23')](function(_0x15bdb3){_0xe17d67[_0x4704('0x46')]=_0x15bdb3;return _0xe17d67;});}})[_0x4704('0x23')](respondWithFilteredResult(_0x13812d,_0x590489))[_0x4704('0x47')](handleError(_0x13812d,null));};exports[_0x4704('0x5b')]=function(_0x1a7b06,_0x12d8ed,_0xee9a52){var _0x3e564b={'raw':!![],'where':{}};var _0x56e55={};var _0x8e3b54={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4704('0x57')]({'where':{'id':_0x1a7b06[_0x4704('0x48')]['id']}})[_0x4704('0x23')](handleEntityNotFound(_0x12d8ed,null))[_0x4704('0x23')](function(_0x504dd8){if(_0x504dd8){_0x56e55[_0x4704('0x34')]=_[_0x4704('0x33')](db[_0x4704('0x5c')]['rawAttributes']);_0x56e55[_0x4704('0x32')]=_[_0x4704('0x33')](_0x1a7b06[_0x4704('0x32')]);_0x56e55[_0x4704('0x3d')]=_[_0x4704('0x36')](_0x56e55['model'],_0x56e55[_0x4704('0x32')]);_0x3e564b['attributes']=_[_0x4704('0x36')](_0x56e55[_0x4704('0x34')],qs[_0x4704('0x37')](_0x1a7b06[_0x4704('0x32')][_0x4704('0x37')]));_0x3e564b['attributes']=_0x3e564b[_0x4704('0x35')]['length']?_0x3e564b['attributes']:_0x56e55[_0x4704('0x34')];if(!_0x1a7b06[_0x4704('0x32')][_0x4704('0x59')]('nolimit')){_0x3e564b[_0x4704('0x1c')]=qs[_0x4704('0x1c')](_0x1a7b06[_0x4704('0x32')]['limit']);_0x3e564b['offset']=qs[_0x4704('0x1a')](_0x1a7b06[_0x4704('0x32')][_0x4704('0x1a')]);}_0x3e564b[_0x4704('0x3a')]=qs['sort'](_0x1a7b06[_0x4704('0x32')][_0x4704('0x3b')]);_0x3e564b['where']=qs['filters'](_[_0x4704('0x3e')](_0x1a7b06[_0x4704('0x32')],_0x56e55[_0x4704('0x3d')]));_0x3e564b[_0x4704('0x3c')][_0x4704('0x5a')]=_0x504dd8['id'];if(_0x1a7b06['query'][_0x4704('0x3f')]){_0x3e564b[_0x4704('0x3c')]=_[_0x4704('0x42')](_0x3e564b[_0x4704('0x3c')],{'$or':_[_0x4704('0x2d')](_0x3e564b[_0x4704('0x35')],function(_0x4683ee){var _0x317108={};_0x317108[_0x4683ee]={'$like':'%'+_0x1a7b06[_0x4704('0x32')]['filter']+'%'};return _0x317108;})});}_0x3e564b=_[_0x4704('0x42')]({},_0x3e564b,_0x1a7b06['options']);return db[_0x4704('0x5c')][_0x4704('0x1d')]({'where':_0x3e564b['where']})[_0x4704('0x23')](function(_0xb81d6a){_0x8e3b54[_0x4704('0x1d')]=_0xb81d6a;if(_0x1a7b06['query'][_0x4704('0x44')]){_0x3e564b[_0x4704('0x49')]=[{'all':!![]}];}return db[_0x4704('0x5c')][_0x4704('0x45')](_0x3e564b);})[_0x4704('0x23')](function(_0x104e73){_0x8e3b54['rows']=_0x104e73;return _0x8e3b54;});}})[_0x4704('0x23')](respondWithFilteredResult(_0x12d8ed,_0x3e564b))[_0x4704('0x47')](handleError(_0x12d8ed,null));};function char(_0x12a08b){return _0x4704('0x5d')===typeof _0x12a08b?String['fromCharCode'][_0x4704('0x20')](null,arguments):_0x12a08b;}function needsEncapsulation(_0x402872){return!!_0x402872&&(_0x402872[_0x4704('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x402872[_0x4704('0x5e')]()[_0x4704('0x5f')](char(0xa))>=0x0||_0x402872[_0x4704('0x5e')]()['indexOf'](char(0x2c))>=0x0||_0x402872[_0x4704('0x5e')]()[_0x4704('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x145d23){var _0x19a258=char(0x22),_0x1a8d73='\x5c'+char(0x22),_0x29bcf8=_0x145d23[_0x4704('0x5e')]()[_0x4704('0x60')](new RegExp(_0x19a258,'g'),_0x1a8d73);return _0x19a258+_0x29bcf8+_0x19a258;}exports[_0x4704('0x61')]=function(_0x1a8725,_0x3cadf0,_0x570030){var _0x5d3542,_0x52f016;var _0x9d11fc={'where':{'ProjectId':_0x1a8725[_0x4704('0x48')]['id']}};if(_0x1a8725[_0x4704('0x32')]['startTime']){_0x9d11fc['where'][_0x4704('0x62')]=JSON['parse'](_0x1a8725['query'][_0x4704('0x63')]);}return db[_0x4704('0x58')][_0x4704('0x45')](_0x9d11fc)[_0x4704('0x23')](handleEntityNotFound(_0x3cadf0,null))[_0x4704('0x23')](function(_0x471b55){if(_0x471b55){_0x5d3542=_0x471b55;return db[_0x4704('0x64')][_0x4704('0x45')]({'where':{'SessionId':{'$in':_[_0x4704('0x2d')](_0x5d3542,'id')},'ProjectId':_0x1a8725[_0x4704('0x48')]['id']},'order':_0x4704('0x65')});}})[_0x4704('0x23')](handleEntityNotFound(_0x3cadf0,null))[_0x4704('0x23')](function(_0x507721){if(_0x507721){_0x52f016=_0x507721;var _0x2afa7f={};for(var _0x4d9593=0x0,_0x542b97=_0x52f016[_0x4704('0x38')];_0x4d9593<_0x542b97;_0x4d9593++){if(!_0x2afa7f[_0x4704('0x59')](_0x52f016[_0x4d9593][_0x4704('0x66')])){_0x2afa7f[_0x52f016[_0x4d9593][_0x4704('0x66')]]=needsEncapsulation(_0x52f016[_0x4d9593][_0x4704('0x67')])?encapsulate(_0x52f016[_0x4d9593][_0x4704('0x67')]):_0x52f016[_0x4d9593][_0x4704('0x67')];}}var _0x1929a7=[],_0x30b12a={};for(var _0x124f6a=0x0,_0x2126ab=_0x5d3542[_0x4704('0x38')];_0x124f6a<_0x2126ab;_0x124f6a++){_0x30b12a={'ProjectId':_0x1a8725[_0x4704('0x48')]['id'],'SessionId':_0x5d3542[_0x124f6a]['id'],'StartTime':moment(_0x5d3542[_0x124f6a][_0x4704('0x62')])[_0x4704('0x68')](_0x4704('0x69'))};for(var _0x482045=0x0,_0x529230=_0x52f016[_0x4704('0x38')];_0x482045<_0x529230;_0x482045++){if(_0x52f016[_0x482045][_0x4704('0x6a')]==_0x5d3542[_0x124f6a]['id']&&_0x2afa7f[_0x4704('0x59')](_0x52f016[_0x482045][_0x4704('0x66')])){_0x30b12a[_0x2afa7f[_0x52f016[_0x482045]['questionId']]]=_0x52f016[_0x482045][_0x4704('0x6b')];}}for(var _0x9e8778 in _0x2afa7f){if(!_0x30b12a[_0x4704('0x59')](_0x2afa7f[_0x9e8778])){_0x30b12a[_0x2afa7f[_0x9e8778]]=null;}}_0x1929a7['push'](_0x30b12a);}return _0x1929a7;}})[_0x4704('0x23')](function(_0x5f31e2){if(!_[_0x4704('0x6c')](_0x5f31e2)){var _0xdca67=toCsv(_0x5f31e2);var _0x1f4242=Date['now']();fs[_0x4704('0x6d')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1a8725[_0x4704('0x48')]['id'],_0x1f4242),_0xdca67);_0x3cadf0[_0x4704('0x6e')](_0x4704('0x6f'),'attachment;\x20filename='+util[_0x4704('0x68')](_0x4704('0x70'),_0x1a8725[_0x4704('0x48')]['id'],_0x1f4242));_0x3cadf0[_0x4704('0x6e')](_0x4704('0x71'),'text/csv');return _0x3cadf0['download'](util[_0x4704('0x68')](_0x4704('0x72'),_0x1a8725['params']['id'],_0x1f4242));}else{return _0x3cadf0[_0x4704('0x27')](0xcc);}})[_0x4704('0x47')](handleError(_0x3cadf0,null));};
\ No newline at end of file
+var _0x94d2=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Projects','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','JscriptySessionReport','rows','getAnswers','findOne','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox'];(function(_0x1b7970,_0x442feb){var _0x4926df=function(_0x5c61d1){while(--_0x5c61d1){_0x1b7970['push'](_0x1b7970['shift']());}};_0x4926df(++_0x442feb);}(_0x94d2,0x1cd));var _0x294d=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0x94d2[_0x2fc113];return _0x5144ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){var _0x10fb2e=_0x546a59[_0x294d('0x23')]({'plain':!![]});var _0x1cf383=_0x294d('0x24');return db['UserProfileResource'][_0x294d('0x22')]({'where':{'type':_0x1cf383,'resourceId':_0x10fb2e['id']}})['then'](function(){return _0x546a59;});})[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1f2dd7,_0x160c42){return function(_0x316bb6){if(!_0x316bb6){_0x1f2dd7[_0x294d('0x15')](0x194);}return _0x316bb6;};}function handleError(_0x4ad67d,_0xc15349){_0xc15349=_0xc15349||0x1f4;return function(_0x2b2072){logger[_0x294d('0x25')](_0x2b2072[_0x294d('0x26')]);if(_0x2b2072[_0x294d('0x27')]){delete _0x2b2072[_0x294d('0x27')];}_0x4ad67d[_0x294d('0x17')](_0xc15349)[_0x294d('0x28')](_0x2b2072);};}exports['index']=function(_0x33cb73,_0x4539d6){var _0x194f02={},_0x3cf02d={},_0x594c76={'count':0x0,'rows':[]};var _0x5bb1d4=_[_0x294d('0x29')](db[_0x294d('0x2a')][_0x294d('0x2b')],function(_0x10ed0f){return{'name':_0x10ed0f[_0x294d('0x2c')],'type':_0x10ed0f[_0x294d('0x2d')][_0x294d('0x2e')]};});_0x3cf02d[_0x294d('0x2f')]=_[_0x294d('0x29')](_0x5bb1d4,'name');_0x3cf02d[_0x294d('0x30')]=_[_0x294d('0x31')](_0x33cb73[_0x294d('0x30')]);_0x3cf02d['filters']=_[_0x294d('0x32')](_0x3cf02d[_0x294d('0x2f')],_0x3cf02d['query']);_0x194f02[_0x294d('0x33')]=_[_0x294d('0x32')](_0x3cf02d['model'],qs['fields'](_0x33cb73[_0x294d('0x30')][_0x294d('0x34')]));_0x194f02[_0x294d('0x33')]=_0x194f02['attributes'][_0x294d('0x35')]?_0x194f02[_0x294d('0x33')]:_0x3cf02d[_0x294d('0x2f')];if(!_0x33cb73[_0x294d('0x30')][_0x294d('0x36')](_0x294d('0x37'))){_0x194f02[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x33cb73[_0x294d('0x30')][_0x294d('0x38')]);_0x194f02[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x33cb73['query'][_0x294d('0x1b')]);}_0x194f02[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x33cb73['query'][_0x294d('0x3a')]);_0x194f02[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x33cb73['query'],_0x3cf02d[_0x294d('0x3c')]),_0x5bb1d4);if(_0x33cb73[_0x294d('0x30')][_0x294d('0x3e')]){_0x194f02['where']=_[_0x294d('0x3f')](_0x194f02[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x5bb1d4,function(_0x54268a){if(_0x54268a[_0x294d('0x2d')]!==_0x294d('0x40')){var _0x11a1c7={};_0x11a1c7[_0x54268a[_0x294d('0x27')]]={'$like':'%'+_0x33cb73[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x11a1c7;}})});}_0x194f02=_[_0x294d('0x3f')]({},_0x194f02,_0x33cb73[_0x294d('0x41')]);var _0x2b961a={'where':_0x194f02[_0x294d('0x3b')]};return db[_0x294d('0x2a')][_0x294d('0x1a')](_0x2b961a)[_0x294d('0x21')](function(_0xbd48cd){_0x594c76[_0x294d('0x1a')]=_0xbd48cd;if(_0x33cb73[_0x294d('0x30')][_0x294d('0x42')]){_0x194f02[_0x294d('0x43')]=[{'all':!![]}];}return db['JscriptyProject'][_0x294d('0x44')](_0x194f02);})[_0x294d('0x21')](function(_0x2be6fd){_0x594c76['rows']=_0x2be6fd;return _0x594c76;})[_0x294d('0x21')](respondWithFilteredResult(_0x4539d6,_0x194f02))[_0x294d('0x45')](handleError(_0x4539d6,null));};exports['show']=function(_0x96e509,_0xad8563){var _0x82008d={'raw':![],'where':{'id':_0x96e509[_0x294d('0x46')]['id']}},_0x4b3b5b={};_0x4b3b5b[_0x294d('0x2f')]=_[_0x294d('0x31')](db[_0x294d('0x2a')][_0x294d('0x2b')]);_0x4b3b5b[_0x294d('0x30')]=_['keys'](_0x96e509['query']);_0x4b3b5b['filters']=_[_0x294d('0x32')](_0x4b3b5b[_0x294d('0x2f')],_0x4b3b5b[_0x294d('0x30')]);_0x82008d[_0x294d('0x33')]=_[_0x294d('0x32')](_0x4b3b5b['model'],qs[_0x294d('0x34')](_0x96e509['query']['fields']));_0x82008d[_0x294d('0x33')]=_0x82008d[_0x294d('0x33')][_0x294d('0x35')]?_0x82008d[_0x294d('0x33')]:_0x4b3b5b[_0x294d('0x2f')];if(_0x96e509[_0x294d('0x30')][_0x294d('0x42')]){_0x82008d['include']=[{'all':!![]}];}_0x82008d=_['merge']({},_0x82008d,_0x96e509['options']);return db['JscriptyProject'][_0x294d('0x47')](_0x82008d)[_0x294d('0x21')](handleEntityNotFound(_0xad8563,null))[_0x294d('0x21')](respondWithResult(_0xad8563,null))[_0x294d('0x45')](handleError(_0xad8563,null));};exports[_0x294d('0x48')]=function(_0x82590d,_0x160904){return db[_0x294d('0x2a')][_0x294d('0x48')](_0x82590d[_0x294d('0x49')],{})[_0x294d('0x21')](function(_0x4cb805){var _0x15249a=_0x82590d[_0x294d('0x4a')][_0x294d('0x23')]({'plain':!![]});if(!_0x15249a)throw new Error(_0x294d('0x4b'));if(_0x15249a[_0x294d('0x4c')]==='user'){var _0x91b2da=_0x4cb805[_0x294d('0x23')]({'plain':!![]});var _0x2e82fb='Projects';return db[_0x294d('0x4d')][_0x294d('0x47')]({'where':{'name':_0x2e82fb,'userProfileId':_0x15249a[_0x294d('0x4e')]},'raw':!![]})[_0x294d('0x21')](function(_0x4ed1e5){if(_0x4ed1e5&&_0x4ed1e5[_0x294d('0x4f')]===0x0){return db[_0x294d('0x50')][_0x294d('0x48')]({'name':_0x91b2da['name'],'resourceId':_0x91b2da['id'],'type':_0x4ed1e5[_0x294d('0x27')],'sectionId':_0x4ed1e5['id']},{})[_0x294d('0x21')](function(){return _0x4cb805;});}else{return _0x4cb805;}})['catch'](function(_0x4e3380){logger[_0x294d('0x25')](_0x294d('0x51'),_0x4e3380);throw _0x4e3380;});}return _0x4cb805;})[_0x294d('0x21')](respondWithResult(_0x160904,0xc9))[_0x294d('0x45')](handleError(_0x160904,null));};exports['clone']=function(_0x5d2dcc,_0xe62080){var _0x4f8a45={'where':{'id':_0x5d2dcc[_0x294d('0x46')]['id']}},_0x34b9b0={};_0x34b9b0[_0x294d('0x2f')]=_[_0x294d('0x31')](db[_0x294d('0x2a')][_0x294d('0x2b')]);_0x4f8a45[_0x294d('0x33')]=_['intersection'](_0x34b9b0[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x5d2dcc[_0x294d('0x30')][_0x294d('0x34')]));_0x4f8a45[_0x294d('0x33')]=_0x4f8a45['attributes'][_0x294d('0x35')]?_0x4f8a45['attributes']:_0x34b9b0[_0x294d('0x2f')];if(_0x5d2dcc[_0x294d('0x30')]['includeAll']){_0x4f8a45[_0x294d('0x43')]=[{'all':!![]}];}_0x4f8a45=_[_0x294d('0x3f')]({},_0x4f8a45,_0x5d2dcc[_0x294d('0x41')]);return db[_0x294d('0x2a')][_0x294d('0x47')](_0x4f8a45)['then'](handleEntityNotFound(_0xe62080,null))['then'](function(_0x32d0ae){if(_0x32d0ae){var _0x34f6b3=_0x32d0ae[_0x294d('0x23')]({'plain':!![]});_0x34f6b3=qs[_0x294d('0x52')](_0x34f6b3,['id',_0x294d('0x53'),_0x294d('0x54')]);_0x5d2dcc[_0x294d('0x49')]=_[_0x294d('0x52')](_0x5d2dcc['body'],['id',_0x294d('0x53'),_0x294d('0x54')]);return db[_0x294d('0x2a')]['create'](_[_0x294d('0x3f')](_0x34f6b3,_0x5d2dcc[_0x294d('0x49')]),{'include':_0x5d2dcc[_0x294d('0x30')][_0x294d('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x9a7275){var _0x412fce=_0x5d2dcc['user'][_0x294d('0x23')]({'plain':!![]});if(!_0x412fce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x412fce['role']===_0x294d('0x4a')){var _0x4e9785=_0x9a7275['get']({'plain':!![]});var _0x11cc4d='Projects';return db[_0x294d('0x4d')]['find']({'where':{'name':_0x11cc4d,'userProfileId':_0x412fce[_0x294d('0x4e')]},'raw':!![]})[_0x294d('0x21')](function(_0x1b4d1e){if(_0x1b4d1e&&_0x1b4d1e[_0x294d('0x4f')]===0x0){return db[_0x294d('0x50')][_0x294d('0x48')]({'name':_0x4e9785['name'],'resourceId':_0x4e9785['id'],'type':_0x1b4d1e['name'],'sectionId':_0x1b4d1e['id']},{})['then'](function(){return _0x9a7275;});}else{return _0x9a7275;}})['catch'](function(_0x5786f8){logger[_0x294d('0x25')](_0x294d('0x51'),_0x5786f8);throw _0x5786f8;});}return _0x9a7275;});}})[_0x294d('0x21')](respondWithResult(_0xe62080,0xc9))['catch'](handleError(_0xe62080,null));};exports['update']=function(_0x4b815e,_0x45fde1){if(_0x4b815e[_0x294d('0x49')]['id']){delete _0x4b815e[_0x294d('0x49')]['id'];}return db[_0x294d('0x2a')][_0x294d('0x47')]({'where':{'id':_0x4b815e[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x45fde1,null))[_0x294d('0x21')](saveUpdates(_0x4b815e[_0x294d('0x49')],null))['then'](respondWithResult(_0x45fde1,null))[_0x294d('0x45')](handleError(_0x45fde1,null));};exports[_0x294d('0x22')]=function(_0x20abb0,_0x18a2ce){return db[_0x294d('0x2a')][_0x294d('0x47')]({'where':{'id':_0x20abb0[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x18a2ce,null))[_0x294d('0x21')](removeEntity(_0x18a2ce,null))[_0x294d('0x45')](handleError(_0x18a2ce,null));};exports['getSessions']=function(_0x21cca3,_0x5bfcdc,_0x395814){var _0x1c66d4={'raw':!![],'where':{}};var _0x4f519b={};var _0x3f60f0={'count':0x0,'rows':[]};return db[_0x294d('0x2a')]['findOne']({'where':{'id':_0x21cca3['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x5bfcdc,null))['then'](function(_0x59d43d){if(_0x59d43d){_0x4f519b['model']=_[_0x294d('0x31')](db[_0x294d('0x55')][_0x294d('0x2b')]);_0x4f519b[_0x294d('0x30')]=_['keys'](_0x21cca3['query']);_0x4f519b['filters']=_[_0x294d('0x32')](_0x4f519b[_0x294d('0x2f')],_0x4f519b[_0x294d('0x30')]);_0x1c66d4[_0x294d('0x33')]=_[_0x294d('0x32')](_0x4f519b['model'],qs[_0x294d('0x34')](_0x21cca3[_0x294d('0x30')][_0x294d('0x34')]));_0x1c66d4[_0x294d('0x33')]=_0x1c66d4['attributes'][_0x294d('0x35')]?_0x1c66d4[_0x294d('0x33')]:_0x4f519b[_0x294d('0x2f')];if(!_0x21cca3[_0x294d('0x30')][_0x294d('0x36')](_0x294d('0x37'))){_0x1c66d4[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x21cca3[_0x294d('0x30')][_0x294d('0x38')]);_0x1c66d4[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x21cca3[_0x294d('0x30')]['offset']);}_0x1c66d4[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x21cca3[_0x294d('0x30')]['sort']);_0x1c66d4[_0x294d('0x3b')]=qs['filters'](_[_0x294d('0x3d')](_0x21cca3[_0x294d('0x30')],_0x4f519b[_0x294d('0x3c')]));_0x1c66d4[_0x294d('0x3b')]['ProjectId']=_0x59d43d['id'];if(_0x21cca3['query']['filter']){_0x1c66d4[_0x294d('0x3b')]=_['merge'](_0x1c66d4[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x1c66d4[_0x294d('0x33')],function(_0x5c8e5d){var _0x1a3914={};_0x1a3914[_0x5c8e5d]={'$like':'%'+_0x21cca3[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x1a3914;})});}_0x1c66d4=_[_0x294d('0x3f')]({},_0x1c66d4,_0x21cca3[_0x294d('0x41')]);return db[_0x294d('0x55')][_0x294d('0x1a')]({'where':_0x1c66d4['where']})[_0x294d('0x21')](function(_0x2b207c){_0x3f60f0[_0x294d('0x1a')]=_0x2b207c;if(_0x21cca3[_0x294d('0x30')][_0x294d('0x42')]){_0x1c66d4[_0x294d('0x43')]=[{'all':!![]}];}return db[_0x294d('0x55')][_0x294d('0x44')](_0x1c66d4);})[_0x294d('0x21')](function(_0x3eac29){_0x3f60f0[_0x294d('0x56')]=_0x3eac29;return _0x3f60f0;});}})[_0x294d('0x21')](respondWithFilteredResult(_0x5bfcdc,_0x1c66d4))[_0x294d('0x45')](handleError(_0x5bfcdc,null));};exports[_0x294d('0x57')]=function(_0x165938,_0x1e8e65,_0x1783f6){var _0x15362c={'raw':!![],'where':{}};var _0x5ec37e={};var _0x196737={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x294d('0x58')]({'where':{'id':_0x165938[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x1e8e65,null))['then'](function(_0x2e9452){if(_0x2e9452){_0x5ec37e['model']=_[_0x294d('0x31')](db['JscriptyAnswerReport'][_0x294d('0x2b')]);_0x5ec37e['query']=_[_0x294d('0x31')](_0x165938[_0x294d('0x30')]);_0x5ec37e[_0x294d('0x3c')]=_['intersection'](_0x5ec37e[_0x294d('0x2f')],_0x5ec37e[_0x294d('0x30')]);_0x15362c[_0x294d('0x33')]=_['intersection'](_0x5ec37e[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x165938[_0x294d('0x30')][_0x294d('0x34')]));_0x15362c['attributes']=_0x15362c[_0x294d('0x33')][_0x294d('0x35')]?_0x15362c[_0x294d('0x33')]:_0x5ec37e[_0x294d('0x2f')];if(!_0x165938[_0x294d('0x30')][_0x294d('0x36')]('nolimit')){_0x15362c['limit']=qs['limit'](_0x165938[_0x294d('0x30')][_0x294d('0x38')]);_0x15362c[_0x294d('0x1b')]=qs['offset'](_0x165938[_0x294d('0x30')][_0x294d('0x1b')]);}_0x15362c[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x165938['query'][_0x294d('0x3a')]);_0x15362c[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x165938[_0x294d('0x30')],_0x5ec37e['filters']));_0x15362c[_0x294d('0x3b')][_0x294d('0x59')]=_0x2e9452['id'];if(_0x165938[_0x294d('0x30')]['filter']){_0x15362c[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x15362c[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x15362c['attributes'],function(_0x56adee){var _0x17e34c={};_0x17e34c[_0x56adee]={'$like':'%'+_0x165938[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x17e34c;})});}_0x15362c=_[_0x294d('0x3f')]({},_0x15362c,_0x165938[_0x294d('0x41')]);return db[_0x294d('0x5a')][_0x294d('0x1a')]({'where':_0x15362c[_0x294d('0x3b')]})[_0x294d('0x21')](function(_0x4dbcad){_0x196737[_0x294d('0x1a')]=_0x4dbcad;if(_0x165938[_0x294d('0x30')][_0x294d('0x42')]){_0x15362c[_0x294d('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x294d('0x44')](_0x15362c);})[_0x294d('0x21')](function(_0x25b1db){_0x196737['rows']=_0x25b1db;return _0x196737;});}})['then'](respondWithFilteredResult(_0x1e8e65,_0x15362c))['catch'](handleError(_0x1e8e65,null));};function char(_0x114010){return _0x294d('0x5b')===typeof _0x114010?String[_0x294d('0x5c')][_0x294d('0x1d')](null,arguments):_0x114010;}function needsEncapsulation(_0x1caa61){return!!_0x1caa61&&(_0x1caa61[_0x294d('0x5d')]()[_0x294d('0x5e')](char(0xd))>=0x0||_0x1caa61[_0x294d('0x5d')]()[_0x294d('0x5e')](char(0xa))>=0x0||_0x1caa61[_0x294d('0x5d')]()[_0x294d('0x5e')](char(0x2c))>=0x0||_0x1caa61[_0x294d('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x420bd4){var _0x31afcf=char(0x22),_0x1c01bf='\x5c'+char(0x22),_0x28a04b=_0x420bd4['toString']()[_0x294d('0x5f')](new RegExp(_0x31afcf,'g'),_0x1c01bf);return _0x31afcf+_0x28a04b+_0x31afcf;}exports[_0x294d('0x60')]=function(_0x5887cc,_0x3e253a,_0x446151){var _0x285448,_0x8f05a1;var _0x137384={'where':{'ProjectId':_0x5887cc['params']['id']}};if(_0x5887cc[_0x294d('0x30')][_0x294d('0x61')]){_0x137384[_0x294d('0x3b')][_0x294d('0x62')]=JSON[_0x294d('0x63')](_0x5887cc[_0x294d('0x30')][_0x294d('0x61')]);}return db[_0x294d('0x55')]['findAll'](_0x137384)[_0x294d('0x21')](handleEntityNotFound(_0x3e253a,null))[_0x294d('0x21')](function(_0x13c0ed){if(_0x13c0ed){_0x285448=_0x13c0ed;return db[_0x294d('0x64')][_0x294d('0x44')]({'where':{'SessionId':{'$in':_[_0x294d('0x29')](_0x285448,'id')},'ProjectId':_0x5887cc[_0x294d('0x46')]['id']},'order':_0x294d('0x65')});}})['then'](handleEntityNotFound(_0x3e253a,null))['then'](function(_0x2ec369){if(_0x2ec369){_0x8f05a1=_0x2ec369;var _0x2dab73={};for(var _0x4f1ff2=0x0,_0x170225=_0x8f05a1[_0x294d('0x35')];_0x4f1ff2<_0x170225;_0x4f1ff2++){if(!_0x2dab73[_0x294d('0x36')](_0x8f05a1[_0x4f1ff2][_0x294d('0x66')])){_0x2dab73[_0x8f05a1[_0x4f1ff2][_0x294d('0x66')]]=needsEncapsulation(_0x8f05a1[_0x4f1ff2][_0x294d('0x67')])?encapsulate(_0x8f05a1[_0x4f1ff2][_0x294d('0x67')]):_0x8f05a1[_0x4f1ff2]['question'];}}var _0x1e39b0=[],_0x5b4272={};for(var _0x2ae56d=0x0,_0xe41037=_0x285448[_0x294d('0x35')];_0x2ae56d<_0xe41037;_0x2ae56d++){_0x5b4272={'ProjectId':_0x5887cc['params']['id'],'SessionId':_0x285448[_0x2ae56d]['id'],'StartTime':moment(_0x285448[_0x2ae56d]['starttime'])[_0x294d('0x68')](_0x294d('0x69'))};for(var _0x12ea43=0x0,_0x4a0d9d=_0x8f05a1[_0x294d('0x35')];_0x12ea43<_0x4a0d9d;_0x12ea43++){if(_0x8f05a1[_0x12ea43][_0x294d('0x6a')]==_0x285448[_0x2ae56d]['id']&&_0x2dab73[_0x294d('0x36')](_0x8f05a1[_0x12ea43][_0x294d('0x66')])){_0x5b4272[_0x2dab73[_0x8f05a1[_0x12ea43][_0x294d('0x66')]]]=_0x8f05a1[_0x12ea43]['answer'];}}for(var _0x4d328f in _0x2dab73){if(!_0x5b4272[_0x294d('0x36')](_0x2dab73[_0x4d328f])){_0x5b4272[_0x2dab73[_0x4d328f]]=null;}}_0x1e39b0[_0x294d('0x6b')](_0x5b4272);}return _0x1e39b0;}})[_0x294d('0x21')](function(_0x415165){if(!_[_0x294d('0x6c')](_0x415165)){var _0x2402a3=toCsv(_0x415165);var _0x234aff=Date['now']();fs[_0x294d('0x6d')](util[_0x294d('0x68')](_0x294d('0x6e'),_0x5887cc[_0x294d('0x46')]['id'],_0x234aff),_0x2402a3);_0x3e253a[_0x294d('0x6f')](_0x294d('0x70'),_0x294d('0x71')+util[_0x294d('0x68')](_0x294d('0x72'),_0x5887cc[_0x294d('0x46')]['id'],_0x234aff));_0x3e253a['setHeader']('Content-type',_0x294d('0x73'));return _0x3e253a[_0x294d('0x74')](util[_0x294d('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5887cc['params']['id'],_0x234aff));}else{return _0x3e253a['sendStatus'](0xcc);}})[_0x294d('0x45')](handleError(_0x3e253a,null));};
\ No newline at end of file
index 6480c49..67abf37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','util','../../config/logger','api','moment','bluebird'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x28c33a,_0x1288c0){_0x28c33a=_0x28c33a-0x0;var _0x1fe8e2=_0xe5b3[_0x28c33a];return _0x1fe8e2;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('JscriptyProject',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x864a=['exports','define','jscripty_projects','lodash','util','../../config/logger','api','path','./jscriptyProject.attributes'];(function(_0x5baba1,_0x2ce345){var _0x1de9a7=function(_0x429dd7){while(--_0x429dd7){_0x5baba1['push'](_0x5baba1['shift']());}};_0x1de9a7(++_0x2ce345);}(_0x864a,0x8a));var _0xa864=function(_0x586ad9,_0x2088b3){_0x586ad9=_0x586ad9-0x0;var _0x51f8b0=_0x864a[_0x586ad9];return _0x51f8b0;};'use strict';var _=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var logger=require(_0xa864('0x2'))(_0xa864('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa864('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa864('0x5'));module[_0xa864('0x6')]=function(_0xcdabc3,_0x37e03d){return _0xcdabc3[_0xa864('0x7')]('JscriptyProject',attributes,{'tableName':_0xa864('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54e41b0..022b9f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x115451,_0x49cc4d){var _0x5ec475=function(_0x33493e){while(--_0x33493e){_0x115451['push'](_0x115451['shift']());}};_0x5ec475(++_0x49cc4d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x46c332,_0xbdf264){_0x46c332=_0x46c332-0x0;var _0x2430e5=_0xb43b[_0x46c332];return _0x2430e5;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5333ba,_0x22e1bb){_0x5333ba=_0x5333ba-0x0;var _0x20f9dc=_0xbdb7[_0x5333ba];return _0x20f9dc;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
index 678b655..067fd32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8173=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x354d01,_0x5c733a){var _0x240035=function(_0x490bb7){while(--_0x490bb7){_0x354d01['push'](_0x354d01['shift']());}};_0x240035(++_0x5c733a);}(_0x8173,0x1be));var _0x3817=function(_0x2475bc,_0x3f9556){_0x2475bc=_0x2475bc-0x0;var _0x393cc7=_0x8173[_0x2475bc];return _0x393cc7;};'use strict';var multer=require(_0x3817('0x0'));var util=require(_0x3817('0x1'));var path=require(_0x3817('0x2'));var timeout=require('connect-timeout');var express=require(_0x3817('0x3'));var router=express[_0x3817('0x4')]();var fs_extra=require(_0x3817('0x5'));var auth=require(_0x3817('0x6'));var interaction=require(_0x3817('0x7'));var config=require(_0x3817('0x8'));var controller=require(_0x3817('0x9'));router[_0x3817('0xa')]('/',auth[_0x3817('0xb')](),controller[_0x3817('0xc')]);router[_0x3817('0xa')](_0x3817('0xd'),auth[_0x3817('0xb')](),controller[_0x3817('0xe')]);router[_0x3817('0xa')](_0x3817('0xf'),auth[_0x3817('0xb')](),controller['show']);router['post']('/',auth[_0x3817('0xb')](),controller[_0x3817('0x10')]);router[_0x3817('0x11')](_0x3817('0xf'),auth[_0x3817('0xb')](),controller[_0x3817('0x12')]);router[_0x3817('0x13')](_0x3817('0xf'),auth[_0x3817('0xb')](),controller['destroy']);module[_0x3817('0x14')]=router;
\ No newline at end of file
+var _0x97a9=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','update'];(function(_0x5ea22d,_0x369c34){var _0x333d79=function(_0x2cd722){while(--_0x2cd722){_0x5ea22d['push'](_0x5ea22d['shift']());}};_0x333d79(++_0x369c34);}(_0x97a9,0xad));var _0x997a=function(_0x557195,_0x591ca6){_0x557195=_0x557195-0x0;var _0x2302a6=_0x97a9[_0x557195];return _0x2302a6;};'use strict';var multer=require(_0x997a('0x0'));var util=require(_0x997a('0x1'));var path=require(_0x997a('0x2'));var timeout=require('connect-timeout');var express=require(_0x997a('0x3'));var router=express[_0x997a('0x4')]();var fs_extra=require(_0x997a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x997a('0x6'));var config=require(_0x997a('0x7'));var controller=require(_0x997a('0x8'));router['get']('/',auth[_0x997a('0x9')](),controller[_0x997a('0xa')]);router[_0x997a('0xb')](_0x997a('0xc'),auth[_0x997a('0x9')](),controller['describe']);router[_0x997a('0xb')](_0x997a('0xd'),auth[_0x997a('0x9')](),controller['show']);router[_0x997a('0xe')]('/',auth[_0x997a('0x9')](),controller[_0x997a('0xf')]);router['put'](_0x997a('0xd'),auth[_0x997a('0x9')](),controller[_0x997a('0x10')]);router['delete'](_0x997a('0xd'),auth[_0x997a('0x9')](),controller[_0x997a('0x11')]);module[_0x997a('0x12')]=router;
\ No newline at end of file
index fdd2e05..99bc9cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x405923,_0x2757bb){_0x405923=_0x405923-0x0;var _0x3ff114=_0x7a54[_0x405923];return _0x3ff114;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0xf19d52,_0x414162){_0xf19d52=_0xf19d52-0x0;var _0x42fdab=_0x7a54[_0xf19d52];return _0x42fdab;};'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
index 384e27a..eb2896c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c61=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x1473d5,_0x3363f9){var _0x5ee814=function(_0x3924b3){while(--_0x3924b3){_0x1473d5['push'](_0x1473d5['shift']());}};_0x5ee814(++_0x3363f9);}(_0x9c61,0x1a5));var _0x19c6=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x9c61[_0x456b57];return _0x18f49f;};'use strict';var emlformat=require(_0x19c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19c6('0x1'));var jsonpatch=require(_0x19c6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x19c6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x19c6('0x4'));var sox=require('sox');var csv=require(_0x19c6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x19c6('0x6'));var crypto=require(_0x19c6('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x19c6('0x8'));var toCsv=require(_0x19c6('0x5'));var querystring=require(_0x19c6('0x9'));var Papa=require(_0x19c6('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19c6('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19c6('0xc'));var logger=require('../../config/logger')(_0x19c6('0xd'));var utils=require(_0x19c6('0xe'));var config=require(_0x19c6('0xf'));var licenseUtil=require(_0x19c6('0x10'));var db=require(_0x19c6('0x11'))['db'];function respondWithStatusCode(_0x373205,_0x5c84e9){_0x5c84e9=_0x5c84e9||0xcc;return function(_0x2d4af9){if(_0x2d4af9){return _0x373205[_0x19c6('0x12')](_0x5c84e9);}return _0x373205['status'](_0x5c84e9)[_0x19c6('0x13')]();};}function respondWithResult(_0x1f142d,_0x213a59){_0x213a59=_0x213a59||0xc8;return function(_0x348516){if(_0x348516){return _0x1f142d[_0x19c6('0x14')](_0x213a59)[_0x19c6('0x15')](_0x348516);}};}function respondWithFilteredResult(_0x388f5e,_0x279919){return function(_0x181be0){if(_0x181be0){var _0x2e35fb=typeof _0x279919[_0x19c6('0x16')]===_0x19c6('0x17')&&typeof _0x279919[_0x19c6('0x18')]===_0x19c6('0x17');var _0x29d055=_0x181be0[_0x19c6('0x19')];var _0x574454=_0x2e35fb?0x0:_0x279919[_0x19c6('0x16')];var _0x4ad473=_0x2e35fb?_0x181be0['count']:_0x279919[_0x19c6('0x16')]+_0x279919[_0x19c6('0x18')];var _0x14eb0a;if(_0x4ad473>=_0x29d055){_0x4ad473=_0x29d055;_0x14eb0a=0xc8;}else{_0x14eb0a=0xce;}_0x388f5e[_0x19c6('0x14')](_0x14eb0a);return _0x388f5e[_0x19c6('0x1a')](_0x19c6('0x1b'),_0x574454+'-'+_0x4ad473+'/'+_0x29d055)[_0x19c6('0x15')](_0x181be0);}return null;};}function patchUpdates(_0x3ef9a1){return function(_0x1c5204){try{jsonpatch[_0x19c6('0x1c')](_0x1c5204,_0x3ef9a1,!![]);}catch(_0x548a5f){return BPromise[_0x19c6('0x1d')](_0x548a5f);}return _0x1c5204[_0x19c6('0x1e')]();};}function saveUpdates(_0x2911e7,_0x365326){return function(_0x13c2a1){if(_0x13c2a1){return _0x13c2a1[_0x19c6('0x1f')](_0x2911e7)[_0x19c6('0x20')](function(_0x5b229a){return _0x5b229a;});}return null;};}function removeEntity(_0x680d2e,_0x49274b){return function(_0x5616a5){if(_0x5616a5){return _0x5616a5['destroy']()['then'](function(){_0x680d2e[_0x19c6('0x14')](0xcc)[_0x19c6('0x13')]();});}};}function handleEntityNotFound(_0x507197,_0xad499e){return function(_0x34a604){if(!_0x34a604){_0x507197['sendStatus'](0x194);}return _0x34a604;};}function handleError(_0x301673,_0xc49794){_0xc49794=_0xc49794||0x1f4;return function(_0x5c488a){logger[_0x19c6('0x21')](_0x5c488a[_0x19c6('0x22')]);if(_0x5c488a['name']){delete _0x5c488a[_0x19c6('0x23')];}_0x301673['status'](_0xc49794)[_0x19c6('0x24')](_0x5c488a);};}exports[_0x19c6('0x25')]=function(_0x3edcf5,_0x5bd298){var _0x2fe9e2={},_0x451c27={},_0x217ac6={'count':0x0,'rows':[]};var _0x2c4c2e=_['map'](db[_0x19c6('0x26')][_0x19c6('0x27')],function(_0x52f3af){return{'name':_0x52f3af[_0x19c6('0x28')],'type':_0x52f3af[_0x19c6('0x29')][_0x19c6('0x2a')]};});_0x451c27[_0x19c6('0x2b')]=_[_0x19c6('0x2c')](_0x2c4c2e,_0x19c6('0x23'));_0x451c27[_0x19c6('0x2d')]=_[_0x19c6('0x2e')](_0x3edcf5[_0x19c6('0x2d')]);_0x451c27['filters']=_[_0x19c6('0x2f')](_0x451c27[_0x19c6('0x2b')],_0x451c27['query']);_0x2fe9e2[_0x19c6('0x30')]=_[_0x19c6('0x2f')](_0x451c27[_0x19c6('0x2b')],qs[_0x19c6('0x31')](_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x31')]));_0x2fe9e2['attributes']=_0x2fe9e2[_0x19c6('0x30')][_0x19c6('0x32')]?_0x2fe9e2['attributes']:_0x451c27['model'];if(!_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x33')](_0x19c6('0x34'))){_0x2fe9e2['limit']=qs[_0x19c6('0x18')](_0x3edcf5['query'][_0x19c6('0x18')]);_0x2fe9e2['offset']=qs['offset'](_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x16')]);}_0x2fe9e2[_0x19c6('0x35')]=qs[_0x19c6('0x36')](_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x36')]);_0x2fe9e2['where']=qs[_0x19c6('0x37')](_[_0x19c6('0x38')](_0x3edcf5[_0x19c6('0x2d')],_0x451c27[_0x19c6('0x37')]),_0x2c4c2e);if(_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x39')]){_0x2fe9e2[_0x19c6('0x3a')]=_[_0x19c6('0x3b')](_0x2fe9e2[_0x19c6('0x3a')],{'$or':_[_0x19c6('0x2c')](_0x2c4c2e,function(_0x1bcf34){if(_0x1bcf34[_0x19c6('0x29')]!==_0x19c6('0x3c')){var _0x590443={};_0x590443[_0x1bcf34[_0x19c6('0x23')]]={'$like':'%'+_0x3edcf5[_0x19c6('0x2d')][_0x19c6('0x39')]+'%'};return _0x590443;}})});}_0x2fe9e2=_[_0x19c6('0x3b')]({},_0x2fe9e2,_0x3edcf5[_0x19c6('0x3d')]);var _0x4821cc={'where':_0x2fe9e2[_0x19c6('0x3a')]};return db[_0x19c6('0x26')][_0x19c6('0x19')](_0x4821cc)[_0x19c6('0x20')](function(_0xf36142){_0x217ac6[_0x19c6('0x19')]=_0xf36142;if(_0x3edcf5[_0x19c6('0x2d')]['includeAll']){_0x2fe9e2['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x19c6('0x3e')](_0x2fe9e2);})[_0x19c6('0x20')](function(_0x34fdb1){_0x217ac6[_0x19c6('0x3f')]=_0x34fdb1;return _0x217ac6;})[_0x19c6('0x20')](respondWithFilteredResult(_0x5bd298,_0x2fe9e2))[_0x19c6('0x40')](handleError(_0x5bd298,null));};exports[_0x19c6('0x41')]=function(_0x13594d,_0x2413ab){var _0x35d511={'raw':!![],'where':{'id':_0x13594d[_0x19c6('0x42')]['id']}},_0x81ca55={};_0x81ca55[_0x19c6('0x2b')]=_[_0x19c6('0x2e')](db['JscriptyQuestionReport'][_0x19c6('0x27')]);_0x81ca55[_0x19c6('0x2d')]=_[_0x19c6('0x2e')](_0x13594d['query']);_0x81ca55[_0x19c6('0x37')]=_[_0x19c6('0x2f')](_0x81ca55[_0x19c6('0x2b')],_0x81ca55[_0x19c6('0x2d')]);_0x35d511[_0x19c6('0x30')]=_['intersection'](_0x81ca55[_0x19c6('0x2b')],qs[_0x19c6('0x31')](_0x13594d['query'][_0x19c6('0x31')]));_0x35d511[_0x19c6('0x30')]=_0x35d511[_0x19c6('0x30')][_0x19c6('0x32')]?_0x35d511[_0x19c6('0x30')]:_0x81ca55[_0x19c6('0x2b')];if(_0x13594d['query'][_0x19c6('0x43')]){_0x35d511[_0x19c6('0x44')]=[{'all':!![]}];}_0x35d511=_[_0x19c6('0x3b')]({},_0x35d511,_0x13594d['options']);return db['JscriptyQuestionReport'][_0x19c6('0x45')](_0x35d511)[_0x19c6('0x20')](handleEntityNotFound(_0x2413ab,null))['then'](respondWithResult(_0x2413ab,null))['catch'](handleError(_0x2413ab,null));};exports[_0x19c6('0x46')]=function(_0x245c1b,_0x41f375){return db['JscriptyQuestionReport']['create'](_0x245c1b['body'],{})[_0x19c6('0x20')](respondWithResult(_0x41f375,0xc9))['catch'](handleError(_0x41f375,null));};exports[_0x19c6('0x1f')]=function(_0x4cf9c5,_0x16e11a){if(_0x4cf9c5[_0x19c6('0x47')]['id']){delete _0x4cf9c5[_0x19c6('0x47')]['id'];}return db[_0x19c6('0x26')]['find']({'where':{'id':_0x4cf9c5[_0x19c6('0x42')]['id']}})[_0x19c6('0x20')](handleEntityNotFound(_0x16e11a,null))[_0x19c6('0x20')](saveUpdates(_0x4cf9c5['body'],null))[_0x19c6('0x20')](respondWithResult(_0x16e11a,null))['catch'](handleError(_0x16e11a,null));};exports[_0x19c6('0x48')]=function(_0x231dbf,_0x4cf6cd){return db[_0x19c6('0x26')][_0x19c6('0x45')]({'where':{'id':_0x231dbf['params']['id']}})[_0x19c6('0x20')](handleEntityNotFound(_0x4cf6cd,null))[_0x19c6('0x20')](removeEntity(_0x4cf6cd,null))[_0x19c6('0x40')](handleError(_0x4cf6cd,null));};exports[_0x19c6('0x49')]=function(_0x31092a,_0x3820b9){return db[_0x19c6('0x26')][_0x19c6('0x49')]()[_0x19c6('0x20')](respondWithResult(_0x3820b9,null))[_0x19c6('0x40')](handleError(_0x3820b9,null));};
\ No newline at end of file
+var _0xe699=['save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','JscriptyQuestionReport','findAll','then','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x4daebd,_0x512652){var _0x5a9caf=function(_0x35a469){while(--_0x35a469){_0x4daebd['push'](_0x4daebd['shift']());}};_0x5a9caf(++_0x512652);}(_0xe699,0x163));var _0x9e69=function(_0x48ddad,_0x133506){_0x48ddad=_0x48ddad-0x0;var _0x42a2ae=_0xe699[_0x48ddad];return _0x42a2ae;};'use strict';var emlformat=require(_0x9e69('0x0'));var rimraf=require(_0x9e69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e69('0x2'));var rp=require(_0x9e69('0x3'));var moment=require(_0x9e69('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e69('0x5'));var path=require(_0x9e69('0x6'));var sox=require(_0x9e69('0x7'));var csv=require(_0x9e69('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e69('0x9'));var _=require(_0x9e69('0xa'));var squel=require(_0x9e69('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e69('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e69('0x8'));var querystring=require(_0x9e69('0xd'));var Papa=require(_0x9e69('0xe'));var Redis=require('ioredis');var authService=require(_0x9e69('0xf'));var qs=require(_0x9e69('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e69('0x11'));var logger=require('../../config/logger')(_0x9e69('0x12'));var utils=require(_0x9e69('0x13'));var config=require(_0x9e69('0x14'));var licenseUtil=require(_0x9e69('0x15'));var db=require(_0x9e69('0x16'))['db'];function respondWithStatusCode(_0x3b9273,_0x2cb018){_0x2cb018=_0x2cb018||0xcc;return function(_0xdd8d17){if(_0xdd8d17){return _0x3b9273[_0x9e69('0x17')](_0x2cb018);}return _0x3b9273[_0x9e69('0x18')](_0x2cb018)[_0x9e69('0x19')]();};}function respondWithResult(_0x58b55a,_0x354a84){_0x354a84=_0x354a84||0xc8;return function(_0x892430){if(_0x892430){return _0x58b55a[_0x9e69('0x18')](_0x354a84)[_0x9e69('0x1a')](_0x892430);}};}function respondWithFilteredResult(_0x10723a,_0x200b0b){return function(_0x336368){if(_0x336368){var _0x5a923e=typeof _0x200b0b[_0x9e69('0x1b')]==='undefined'&&typeof _0x200b0b[_0x9e69('0x1c')]===_0x9e69('0x1d');var _0x1e2307=_0x336368[_0x9e69('0x1e')];var _0x5bf91b=_0x5a923e?0x0:_0x200b0b['offset'];var _0x246d89=_0x5a923e?_0x336368[_0x9e69('0x1e')]:_0x200b0b[_0x9e69('0x1b')]+_0x200b0b[_0x9e69('0x1c')];var _0x29be61;if(_0x246d89>=_0x1e2307){_0x246d89=_0x1e2307;_0x29be61=0xc8;}else{_0x29be61=0xce;}_0x10723a[_0x9e69('0x18')](_0x29be61);return _0x10723a[_0x9e69('0x1f')](_0x9e69('0x20'),_0x5bf91b+'-'+_0x246d89+'/'+_0x1e2307)[_0x9e69('0x1a')](_0x336368);}return null;};}function patchUpdates(_0x5ba07a){return function(_0xbd855d){try{jsonpatch[_0x9e69('0x21')](_0xbd855d,_0x5ba07a,!![]);}catch(_0xc9784c){return BPromise[_0x9e69('0x22')](_0xc9784c);}return _0xbd855d[_0x9e69('0x23')]();};}function saveUpdates(_0x17993b,_0x48a95a){return function(_0x432769){if(_0x432769){return _0x432769[_0x9e69('0x24')](_0x17993b)['then'](function(_0x481b16){return _0x481b16;});}return null;};}function removeEntity(_0x416edc,_0x43a284){return function(_0x1a2efc){if(_0x1a2efc){return _0x1a2efc[_0x9e69('0x25')]()['then'](function(){_0x416edc['status'](0xcc)[_0x9e69('0x19')]();});}};}function handleEntityNotFound(_0x2c479e,_0x24a25f){return function(_0x2e682a){if(!_0x2e682a){_0x2c479e[_0x9e69('0x17')](0x194);}return _0x2e682a;};}function handleError(_0x56a07a,_0xb3471e){_0xb3471e=_0xb3471e||0x1f4;return function(_0x434fc1){logger[_0x9e69('0x26')](_0x434fc1[_0x9e69('0x27')]);if(_0x434fc1[_0x9e69('0x28')]){delete _0x434fc1['name'];}_0x56a07a[_0x9e69('0x18')](_0xb3471e)[_0x9e69('0x29')](_0x434fc1);};}exports[_0x9e69('0x2a')]=function(_0x44010a,_0x4d5206){var _0x3c82c3={},_0x1143aa={},_0x393ffb={'count':0x0,'rows':[]};var _0x1772de=_['map'](db['JscriptyQuestionReport'][_0x9e69('0x2b')],function(_0x5694a6){return{'name':_0x5694a6[_0x9e69('0x2c')],'type':_0x5694a6[_0x9e69('0x2d')][_0x9e69('0x2e')]};});_0x1143aa[_0x9e69('0x2f')]=_['map'](_0x1772de,_0x9e69('0x28'));_0x1143aa[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x44010a['query']);_0x1143aa[_0x9e69('0x32')]=_['intersection'](_0x1143aa[_0x9e69('0x2f')],_0x1143aa[_0x9e69('0x30')]);_0x3c82c3[_0x9e69('0x33')]=_[_0x9e69('0x34')](_0x1143aa[_0x9e69('0x2f')],qs[_0x9e69('0x35')](_0x44010a[_0x9e69('0x30')][_0x9e69('0x35')]));_0x3c82c3['attributes']=_0x3c82c3[_0x9e69('0x33')][_0x9e69('0x36')]?_0x3c82c3[_0x9e69('0x33')]:_0x1143aa[_0x9e69('0x2f')];if(!_0x44010a[_0x9e69('0x30')][_0x9e69('0x37')](_0x9e69('0x38'))){_0x3c82c3['limit']=qs[_0x9e69('0x1c')](_0x44010a[_0x9e69('0x30')][_0x9e69('0x1c')]);_0x3c82c3[_0x9e69('0x1b')]=qs['offset'](_0x44010a['query'][_0x9e69('0x1b')]);}_0x3c82c3[_0x9e69('0x39')]=qs['sort'](_0x44010a[_0x9e69('0x30')][_0x9e69('0x3a')]);_0x3c82c3[_0x9e69('0x3b')]=qs[_0x9e69('0x32')](_[_0x9e69('0x3c')](_0x44010a['query'],_0x1143aa[_0x9e69('0x32')]),_0x1772de);if(_0x44010a[_0x9e69('0x30')][_0x9e69('0x3d')]){_0x3c82c3[_0x9e69('0x3b')]=_[_0x9e69('0x3e')](_0x3c82c3[_0x9e69('0x3b')],{'$or':_[_0x9e69('0x3f')](_0x1772de,function(_0x380996){if(_0x380996['type']!==_0x9e69('0x40')){var _0x304922={};_0x304922[_0x380996['name']]={'$like':'%'+_0x44010a[_0x9e69('0x30')][_0x9e69('0x3d')]+'%'};return _0x304922;}})});}_0x3c82c3=_[_0x9e69('0x3e')]({},_0x3c82c3,_0x44010a[_0x9e69('0x41')]);var _0x5d1f1b={'where':_0x3c82c3[_0x9e69('0x3b')]};return db['JscriptyQuestionReport']['count'](_0x5d1f1b)['then'](function(_0xed525e){_0x393ffb[_0x9e69('0x1e')]=_0xed525e;if(_0x44010a['query']['includeAll']){_0x3c82c3['include']=[{'all':!![]}];}return db[_0x9e69('0x42')][_0x9e69('0x43')](_0x3c82c3);})[_0x9e69('0x44')](function(_0x400cfc){_0x393ffb['rows']=_0x400cfc;return _0x393ffb;})[_0x9e69('0x44')](respondWithFilteredResult(_0x4d5206,_0x3c82c3))[_0x9e69('0x45')](handleError(_0x4d5206,null));};exports[_0x9e69('0x46')]=function(_0x252af5,_0x2bce51){var _0x9a491c={'raw':!![],'where':{'id':_0x252af5[_0x9e69('0x47')]['id']}},_0x95feaa={};_0x95feaa[_0x9e69('0x2f')]=_[_0x9e69('0x31')](db[_0x9e69('0x42')][_0x9e69('0x2b')]);_0x95feaa['query']=_[_0x9e69('0x31')](_0x252af5[_0x9e69('0x30')]);_0x95feaa[_0x9e69('0x32')]=_[_0x9e69('0x34')](_0x95feaa[_0x9e69('0x2f')],_0x95feaa[_0x9e69('0x30')]);_0x9a491c[_0x9e69('0x33')]=_[_0x9e69('0x34')](_0x95feaa[_0x9e69('0x2f')],qs['fields'](_0x252af5['query'][_0x9e69('0x35')]));_0x9a491c[_0x9e69('0x33')]=_0x9a491c['attributes']['length']?_0x9a491c[_0x9e69('0x33')]:_0x95feaa['model'];if(_0x252af5[_0x9e69('0x30')][_0x9e69('0x48')]){_0x9a491c[_0x9e69('0x49')]=[{'all':!![]}];}_0x9a491c=_[_0x9e69('0x3e')]({},_0x9a491c,_0x252af5[_0x9e69('0x41')]);return db[_0x9e69('0x42')][_0x9e69('0x4a')](_0x9a491c)[_0x9e69('0x44')](handleEntityNotFound(_0x2bce51,null))[_0x9e69('0x44')](respondWithResult(_0x2bce51,null))[_0x9e69('0x45')](handleError(_0x2bce51,null));};exports[_0x9e69('0x4b')]=function(_0x3a8337,_0x5718b2){return db[_0x9e69('0x42')][_0x9e69('0x4b')](_0x3a8337[_0x9e69('0x4c')],{})['then'](respondWithResult(_0x5718b2,0xc9))[_0x9e69('0x45')](handleError(_0x5718b2,null));};exports[_0x9e69('0x24')]=function(_0x1a329d,_0x14dcc2){if(_0x1a329d['body']['id']){delete _0x1a329d[_0x9e69('0x4c')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1a329d[_0x9e69('0x47')]['id']}})[_0x9e69('0x44')](handleEntityNotFound(_0x14dcc2,null))[_0x9e69('0x44')](saveUpdates(_0x1a329d[_0x9e69('0x4c')],null))[_0x9e69('0x44')](respondWithResult(_0x14dcc2,null))[_0x9e69('0x45')](handleError(_0x14dcc2,null));};exports[_0x9e69('0x25')]=function(_0x46cc29,_0xd5b8e9){return db[_0x9e69('0x42')][_0x9e69('0x4a')]({'where':{'id':_0x46cc29[_0x9e69('0x47')]['id']}})[_0x9e69('0x44')](handleEntityNotFound(_0xd5b8e9,null))[_0x9e69('0x44')](removeEntity(_0xd5b8e9,null))[_0x9e69('0x45')](handleError(_0xd5b8e9,null));};exports[_0x9e69('0x4d')]=function(_0x92b97d,_0x5bc70e){return db[_0x9e69('0x42')][_0x9e69('0x4d')]()[_0x9e69('0x44')](respondWithResult(_0x5bc70e,null))['catch'](handleError(_0x5bc70e,null));};
\ No newline at end of file
index 8ba5fbb..47b8715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x241c=['define','JscriptyQuestionReport','lodash','util','api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x241c,0x1ba));var _0xc241=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x241c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc241('0x0'));var util=require(_0xc241('0x1'));var logger=require('../../config/logger')(_0xc241('0x2'));var moment=require(_0xc241('0x3'));var BPromise=require('bluebird');var rp=require(_0xc241('0x4'));var fs=require('fs');var path=require(_0xc241('0x5'));var rimraf=require('rimraf');var config=require(_0xc241('0x6'));var attributes=require(_0xc241('0x7'));module[_0xc241('0x8')]=function(_0x52630b,_0x5dfb68){return _0x52630b[_0xc241('0x9')](_0xc241('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc765=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api'];(function(_0x4fce2c,_0x4f6342){var _0x19fa7e=function(_0x32f695){while(--_0x32f695){_0x4fce2c['push'](_0x4fce2c['shift']());}};_0x19fa7e(++_0x4f6342);}(_0xc765,0xa6));var _0x5c76=function(_0x310d8d,_0x3e2eb4){_0x310d8d=_0x310d8d-0x0;var _0x142f6b=_0xc765[_0x310d8d];return _0x142f6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c76('0x0'))(_0x5c76('0x1'));var moment=require(_0x5c76('0x2'));var BPromise=require(_0x5c76('0x3'));var rp=require(_0x5c76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c76('0x5'));var config=require(_0x5c76('0x6'));var attributes=require(_0x5c76('0x7'));module[_0x5c76('0x8')]=function(_0x42bf82,_0x24f8f9){return _0x42bf82[_0x5c76('0x9')](_0x5c76('0xa'),attributes,{'tableName':_0x5c76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12454c9..8619496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x916c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis'];(function(_0x110fb1,_0x503e6d){var _0x1e9c97=function(_0x433d04){while(--_0x433d04){_0x110fb1['push'](_0x110fb1['shift']());}};_0x1e9c97(++_0x503e6d);}(_0x916c,0xa5));var _0xc916=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x916c[_0xfcbcb8];return _0x1b1f97;};'use strict';var _=require(_0xc916('0x0'));var util=require('util');var moment=require(_0xc916('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc916('0x2'));var db=require(_0xc916('0x3'))['db'];var utils=require(_0xc916('0x4'));var logger=require(_0xc916('0x5'))(_0xc916('0x6'));var config=require(_0xc916('0x7'));var jayson=require(_0xc916('0x8'));var client=jayson[_0xc916('0x9')][_0xc916('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f1354,_0x265e60,_0x31ebfc){return new BPromise(function(_0x37d268,_0x2eeb54){return client['request'](_0x4f1354,_0x31ebfc)['then'](function(_0x1577da){logger[_0xc916('0xb')](_0xc916('0xc'),_0x265e60,_0xc916('0xd'));logger[_0xc916('0xe')](_0xc916('0xf'),_0x265e60,_0xc916('0xd'),JSON['stringify'](_0x1577da));if(_0x1577da[_0xc916('0x10')]){if(_0x1577da[_0xc916('0x10')][_0xc916('0x11')]===0x1f4){logger[_0xc916('0x10')](_0xc916('0xc'),_0x265e60,_0x1577da[_0xc916('0x10')][_0xc916('0x12')]);return _0x2eeb54(_0x1577da[_0xc916('0x10')][_0xc916('0x12')]);}logger[_0xc916('0x10')](_0xc916('0xc'),_0x265e60,_0x1577da[_0xc916('0x10')][_0xc916('0x12')]);return _0x37d268(_0x1577da[_0xc916('0x10')][_0xc916('0x12')]);}else{logger['info'](_0xc916('0xc'),_0x265e60,_0xc916('0xd'));_0x37d268(_0x1577da[_0xc916('0x13')][_0xc916('0x12')]);}})[_0xc916('0x14')](function(_0x2195a8){logger[_0xc916('0x10')](_0xc916('0xc'),_0x265e60,_0x2195a8);_0x2eeb54(_0x2195a8);});});}
\ No newline at end of file
+var _0x36f7=['request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x36f7,0x152));var _0x736f=function(_0x1a27fb,_0x10e066){_0x1a27fb=_0x1a27fb-0x0;var _0x10bcd3=_0x36f7[_0x1a27fb];return _0x10bcd3;};'use strict';var _=require(_0x736f('0x0'));var util=require(_0x736f('0x1'));var moment=require(_0x736f('0x2'));var BPromise=require('bluebird');var rs=require(_0x736f('0x3'));var fs=require('fs');var Redis=require(_0x736f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x736f('0x5'));var logger=require(_0x736f('0x6'))(_0x736f('0x7'));var config=require(_0x736f('0x8'));var jayson=require(_0x736f('0x9'));var client=jayson[_0x736f('0xa')][_0x736f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4edd6a,_0x954a5,_0x20756f){return new BPromise(function(_0x111ebc,_0x3b220a){return client[_0x736f('0xc')](_0x4edd6a,_0x20756f)[_0x736f('0xd')](function(_0x5b6b15){logger[_0x736f('0xe')](_0x736f('0xf'),_0x954a5,_0x736f('0x10'));logger[_0x736f('0x11')](_0x736f('0x12'),_0x954a5,_0x736f('0x10'),JSON[_0x736f('0x13')](_0x5b6b15));if(_0x5b6b15[_0x736f('0x14')]){if(_0x5b6b15[_0x736f('0x14')][_0x736f('0x15')]===0x1f4){logger[_0x736f('0x14')](_0x736f('0xf'),_0x954a5,_0x5b6b15[_0x736f('0x14')][_0x736f('0x16')]);return _0x3b220a(_0x5b6b15['error']['message']);}logger[_0x736f('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x954a5,_0x5b6b15[_0x736f('0x14')][_0x736f('0x16')]);return _0x111ebc(_0x5b6b15['error'][_0x736f('0x16')]);}else{logger[_0x736f('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x954a5,_0x736f('0x10'));_0x111ebc(_0x5b6b15[_0x736f('0x17')][_0x736f('0x16')]);}})[_0x736f('0x18')](function(_0x2cb9e1){logger[_0x736f('0x14')](_0x736f('0xf'),_0x954a5,_0x2cb9e1);_0x3b220a(_0x2cb9e1);});});}
\ No newline at end of file
index 50439aa..b98a1a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5778=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7a22fa,_0x13468f){var _0x22d289=function(_0x340e5f){while(--_0x340e5f){_0x7a22fa['push'](_0x7a22fa['shift']());}};_0x22d289(++_0x13468f);}(_0x5778,0x1f2));var _0x8577=function(_0x459308,_0x87a1bb){_0x459308=_0x459308-0x0;var _0x57cbed=_0x5778[_0x459308];return _0x57cbed;};'use strict';var multer=require(_0x8577('0x0'));var util=require(_0x8577('0x1'));var path=require(_0x8577('0x2'));var timeout=require(_0x8577('0x3'));var express=require(_0x8577('0x4'));var router=express[_0x8577('0x5')]();var fs_extra=require(_0x8577('0x6'));var auth=require(_0x8577('0x7'));var interaction=require(_0x8577('0x8'));var config=require(_0x8577('0x9'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8577('0xa')](_0x8577('0xb'),auth[_0x8577('0xc')](),controller[_0x8577('0xd')]);router[_0x8577('0xa')](_0x8577('0xe'),auth[_0x8577('0xc')](),controller[_0x8577('0xf')]);router[_0x8577('0xa')](_0x8577('0x10'),auth[_0x8577('0xc')](),controller['getQuestions']);router[_0x8577('0x11')]('/',auth[_0x8577('0xc')](),controller['create']);router[_0x8577('0x12')]('/:id',auth[_0x8577('0xc')](),controller['update']);router[_0x8577('0x13')](_0x8577('0xe'),auth['isAuthenticated'](),controller[_0x8577('0x14')]);module[_0x8577('0x15')]=router;
\ No newline at end of file
+var _0xcd33=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','delete','destroy','exports'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0xcd33,0xb0));var _0x3cd3=function(_0x18103f,_0x2f2f3e){_0x18103f=_0x18103f-0x0;var _0x4b313c=_0xcd33[_0x18103f];return _0x4b313c;};'use strict';var multer=require(_0x3cd3('0x0'));var util=require(_0x3cd3('0x1'));var path=require('path');var timeout=require(_0x3cd3('0x2'));var express=require(_0x3cd3('0x3'));var router=express[_0x3cd3('0x4')]();var fs_extra=require(_0x3cd3('0x5'));var auth=require(_0x3cd3('0x6'));var interaction=require(_0x3cd3('0x7'));var config=require(_0x3cd3('0x8'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x3cd3('0x9')](),controller['index']);router[_0x3cd3('0xa')](_0x3cd3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3cd3('0xa')](_0x3cd3('0xc'),auth[_0x3cd3('0x9')](),controller[_0x3cd3('0xd')]);router[_0x3cd3('0xa')](_0x3cd3('0xe'),auth['isAuthenticated'](),controller[_0x3cd3('0xf')]);router[_0x3cd3('0x10')]('/',auth[_0x3cd3('0x9')](),controller[_0x3cd3('0x11')]);router[_0x3cd3('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3cd3('0x13')](_0x3cd3('0xc'),auth[_0x3cd3('0x9')](),controller[_0x3cd3('0x14')]);module[_0x3cd3('0x15')]=router;
\ No newline at end of file
index 417e656..4542f83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1227=['setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x1227,0x85));var _0x7122=function(_0x52dfe3,_0x801a62){_0x52dfe3=_0x52dfe3-0x0;var _0x35d198=_0x1227[_0x52dfe3];return _0x35d198;};'use strict';var moment=require('moment');var Sequelize=require(_0x7122('0x0'));module[_0x7122('0x1')]={'starttime':{'type':Sequelize[_0x7122('0x2')],'set':function(_0x520bfa){this[_0x7122('0x3')]('starttime',_0x520bfa);this[_0x7122('0x3')](_0x7122('0x4'),moment()['format'](_0x7122('0x5')));}},'endtime':{'type':Sequelize[_0x7122('0x2')]},'membername':{'type':Sequelize[_0x7122('0x6')]},'projectname':{'type':Sequelize[_0x7122('0x6')]},'queue':{'type':Sequelize[_0x7122('0x6')]},'uniqueid':{'type':Sequelize[_0x7122('0x6')]},'calleridname':{'type':Sequelize[_0x7122('0x6')]},'calleridnum':{'type':Sequelize[_0x7122('0x6')]},'completed':{'type':Sequelize[_0x7122('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x26a6=['BOOLEAN','moment','sequelize','exports','DATE','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26a6,0xfd));var _0x626a=function(_0x4b337e,_0x87dbd6){_0x4b337e=_0x4b337e-0x0;var _0x476aec=_0x26a6[_0x4b337e];return _0x476aec;};'use strict';var moment=require(_0x626a('0x0'));var Sequelize=require(_0x626a('0x1'));module[_0x626a('0x2')]={'starttime':{'type':Sequelize[_0x626a('0x3')],'set':function(_0x25db9d){this['setDataValue']('starttime',_0x25db9d);this['setDataValue'](_0x626a('0x4'),moment()[_0x626a('0x5')](_0x626a('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x626a('0x7')]},'projectname':{'type':Sequelize[_0x626a('0x7')]},'queue':{'type':Sequelize[_0x626a('0x7')]},'uniqueid':{'type':Sequelize[_0x626a('0x7')]},'calleridname':{'type':Sequelize[_0x626a('0x7')]},'calleridnum':{'type':Sequelize[_0x626a('0x7')]},'completed':{'type':Sequelize[_0x626a('0x8')],'defaultValue':![]}};
\ No newline at end of file
index ccb7f1b..9cd2c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac0=['count','set','json','apply','reject','destroy','then','status','error','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','include','find','create','body','update','params','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined'];(function(_0x10a1a1,_0x114d7c){var _0x526ef4=function(_0x540736){while(--_0x540736){_0x10a1a1['push'](_0x10a1a1['shift']());}};_0x526ef4(++_0x114d7c);}(_0x8ac0,0x7c));var _0x08ac=function(_0x3f86e5,_0x1d7596){_0x3f86e5=_0x3f86e5-0x0;var _0x44231e=_0x8ac0[_0x3f86e5];return _0x44231e;};'use strict';var emlformat=require(_0x08ac('0x0'));var rimraf=require(_0x08ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08ac('0x2'));var rp=require('request-promise');var moment=require(_0x08ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x08ac('0x4'));var util=require('util');var path=require('path');var sox=require(_0x08ac('0x5'));var csv=require(_0x08ac('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08ac('0x7'));var _=require(_0x08ac('0x8'));var squel=require('squel');var crypto=require(_0x08ac('0x9'));var jsforce=require(_0x08ac('0xa'));var deskjs=require(_0x08ac('0xb'));var toCsv=require(_0x08ac('0x6'));var querystring=require(_0x08ac('0xc'));var Papa=require(_0x08ac('0xd'));var Redis=require('ioredis');var authService=require(_0x08ac('0xe'));var qs=require(_0x08ac('0xf'));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(_0x08ac('0x10'));var licenseUtil=require(_0x08ac('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x436cdf,_0x55d144){_0x55d144=_0x55d144||0xcc;return function(_0x364f5f){if(_0x364f5f){return _0x436cdf[_0x08ac('0x12')](_0x55d144);}return _0x436cdf['status'](_0x55d144)[_0x08ac('0x13')]();};}function respondWithResult(_0x556402,_0x443e59){_0x443e59=_0x443e59||0xc8;return function(_0x264d30){if(_0x264d30){return _0x556402['status'](_0x443e59)['json'](_0x264d30);}};}function respondWithFilteredResult(_0x3df10b,_0x373570){return function(_0xf1aca){if(_0xf1aca){var _0x183456=typeof _0x373570[_0x08ac('0x14')]==='undefined'&&typeof _0x373570['limit']===_0x08ac('0x15');var _0x26cc56=_0xf1aca['count'];var _0x29efda=_0x183456?0x0:_0x373570[_0x08ac('0x14')];var _0x573d4d=_0x183456?_0xf1aca[_0x08ac('0x16')]:_0x373570['offset']+_0x373570['limit'];var _0x4338a7;if(_0x573d4d>=_0x26cc56){_0x573d4d=_0x26cc56;_0x4338a7=0xc8;}else{_0x4338a7=0xce;}_0x3df10b['status'](_0x4338a7);return _0x3df10b[_0x08ac('0x17')]('Content-Range',_0x29efda+'-'+_0x573d4d+'/'+_0x26cc56)[_0x08ac('0x18')](_0xf1aca);}return null;};}function patchUpdates(_0x1b0558){return function(_0x8be4e8){try{jsonpatch[_0x08ac('0x19')](_0x8be4e8,_0x1b0558,!![]);}catch(_0x56a165){return BPromise[_0x08ac('0x1a')](_0x56a165);}return _0x8be4e8['save']();};}function saveUpdates(_0x2946d0,_0x3dd3a3){return function(_0x865940){if(_0x865940){return _0x865940['update'](_0x2946d0)['then'](function(_0x5258b1){return _0x5258b1;});}return null;};}function removeEntity(_0x15fd74,_0x355c9e){return function(_0x6dcf77){if(_0x6dcf77){return _0x6dcf77[_0x08ac('0x1b')]()[_0x08ac('0x1c')](function(){_0x15fd74[_0x08ac('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe273,_0x51c15c){return function(_0x5beb9e){if(!_0x5beb9e){_0x2fe273[_0x08ac('0x12')](0x194);}return _0x5beb9e;};}function handleError(_0xe9acde,_0x4f1176){_0x4f1176=_0x4f1176||0x1f4;return function(_0x432bba){logger[_0x08ac('0x1e')](_0x432bba['stack']);if(_0x432bba['name']){delete _0x432bba[_0x08ac('0x1f')];}_0xe9acde[_0x08ac('0x1d')](_0x4f1176)['send'](_0x432bba);};}exports['index']=function(_0x57e97e,_0x18201a){var _0x28a8a6={},_0xf64c8d={},_0x58bd34={'count':0x0,'rows':[]};var _0x5e2fca=_[_0x08ac('0x20')](db[_0x08ac('0x21')][_0x08ac('0x22')],function(_0x54046e){return{'name':_0x54046e[_0x08ac('0x23')],'type':_0x54046e[_0x08ac('0x24')][_0x08ac('0x25')]};});_0xf64c8d[_0x08ac('0x26')]=_[_0x08ac('0x20')](_0x5e2fca,_0x08ac('0x1f'));_0xf64c8d[_0x08ac('0x27')]=_[_0x08ac('0x28')](_0x57e97e['query']);_0xf64c8d['filters']=_['intersection'](_0xf64c8d['model'],_0xf64c8d[_0x08ac('0x27')]);_0x28a8a6[_0x08ac('0x29')]=_[_0x08ac('0x2a')](_0xf64c8d[_0x08ac('0x26')],qs[_0x08ac('0x2b')](_0x57e97e[_0x08ac('0x27')][_0x08ac('0x2b')]));_0x28a8a6[_0x08ac('0x29')]=_0x28a8a6[_0x08ac('0x29')][_0x08ac('0x2c')]?_0x28a8a6[_0x08ac('0x29')]:_0xf64c8d[_0x08ac('0x26')];if(!_0x57e97e[_0x08ac('0x27')][_0x08ac('0x2d')](_0x08ac('0x2e'))){_0x28a8a6[_0x08ac('0x2f')]=qs[_0x08ac('0x2f')](_0x57e97e[_0x08ac('0x27')][_0x08ac('0x2f')]);_0x28a8a6['offset']=qs[_0x08ac('0x14')](_0x57e97e[_0x08ac('0x27')][_0x08ac('0x14')]);}_0x28a8a6[_0x08ac('0x30')]=qs[_0x08ac('0x31')](_0x57e97e[_0x08ac('0x27')][_0x08ac('0x31')]);_0x28a8a6[_0x08ac('0x32')]=qs[_0x08ac('0x33')](_[_0x08ac('0x34')](_0x57e97e[_0x08ac('0x27')],_0xf64c8d['filters']),_0x5e2fca);if(_0x57e97e[_0x08ac('0x27')]['filter']){_0x28a8a6[_0x08ac('0x32')]=_[_0x08ac('0x35')](_0x28a8a6['where'],{'$or':_['map'](_0x5e2fca,function(_0x3e81a){if(_0x3e81a[_0x08ac('0x24')]!==_0x08ac('0x36')){var _0x36d188={};_0x36d188[_0x3e81a[_0x08ac('0x1f')]]={'$like':'%'+_0x57e97e['query'][_0x08ac('0x37')]+'%'};return _0x36d188;}})});}_0x28a8a6=_[_0x08ac('0x35')]({},_0x28a8a6,_0x57e97e[_0x08ac('0x38')]);var _0x24c235={'where':_0x28a8a6['where']};return db['JscriptySessionReport']['count'](_0x24c235)[_0x08ac('0x1c')](function(_0x54ba33){_0x58bd34['count']=_0x54ba33;if(_0x57e97e[_0x08ac('0x27')][_0x08ac('0x39')]){_0x28a8a6['include']=[{'all':!![]}];}return db[_0x08ac('0x21')]['findAll'](_0x28a8a6);})[_0x08ac('0x1c')](function(_0xd08bbb){_0x58bd34[_0x08ac('0x3a')]=_0xd08bbb;return _0x58bd34;})[_0x08ac('0x1c')](respondWithFilteredResult(_0x18201a,_0x28a8a6))[_0x08ac('0x3b')](handleError(_0x18201a,null));};exports[_0x08ac('0x3c')]=function(_0x3038de,_0x1913af){var _0x4c6ecb={'raw':!![],'where':{'id':_0x3038de['params']['id']}},_0x7da1af={};_0x7da1af['model']=_[_0x08ac('0x28')](db['JscriptySessionReport']['rawAttributes']);_0x7da1af[_0x08ac('0x27')]=_['keys'](_0x3038de[_0x08ac('0x27')]);_0x7da1af[_0x08ac('0x33')]=_[_0x08ac('0x2a')](_0x7da1af[_0x08ac('0x26')],_0x7da1af[_0x08ac('0x27')]);_0x4c6ecb['attributes']=_[_0x08ac('0x2a')](_0x7da1af[_0x08ac('0x26')],qs[_0x08ac('0x2b')](_0x3038de['query'][_0x08ac('0x2b')]));_0x4c6ecb['attributes']=_0x4c6ecb['attributes'][_0x08ac('0x2c')]?_0x4c6ecb[_0x08ac('0x29')]:_0x7da1af[_0x08ac('0x26')];if(_0x3038de['query'][_0x08ac('0x39')]){_0x4c6ecb[_0x08ac('0x3d')]=[{'all':!![]}];}_0x4c6ecb=_[_0x08ac('0x35')]({},_0x4c6ecb,_0x3038de[_0x08ac('0x38')]);return db[_0x08ac('0x21')][_0x08ac('0x3e')](_0x4c6ecb)[_0x08ac('0x1c')](handleEntityNotFound(_0x1913af,null))['then'](respondWithResult(_0x1913af,null))[_0x08ac('0x3b')](handleError(_0x1913af,null));};exports['create']=function(_0x14fd4b,_0x28eaa4){return db['JscriptySessionReport'][_0x08ac('0x3f')](_0x14fd4b[_0x08ac('0x40')],{})[_0x08ac('0x1c')](respondWithResult(_0x28eaa4,0xc9))['catch'](handleError(_0x28eaa4,null));};exports[_0x08ac('0x41')]=function(_0x5ef28f,_0x4fc15a){if(_0x5ef28f[_0x08ac('0x40')]['id']){delete _0x5ef28f[_0x08ac('0x40')]['id'];}return db[_0x08ac('0x21')][_0x08ac('0x3e')]({'where':{'id':_0x5ef28f['params']['id']}})[_0x08ac('0x1c')](handleEntityNotFound(_0x4fc15a,null))[_0x08ac('0x1c')](saveUpdates(_0x5ef28f[_0x08ac('0x40')],null))[_0x08ac('0x1c')](respondWithResult(_0x4fc15a,null))[_0x08ac('0x3b')](handleError(_0x4fc15a,null));};exports['destroy']=function(_0xd9a039,_0x224476){return db[_0x08ac('0x21')][_0x08ac('0x3e')]({'where':{'id':_0xd9a039[_0x08ac('0x42')]['id']}})[_0x08ac('0x1c')](handleEntityNotFound(_0x224476,null))[_0x08ac('0x1c')](removeEntity(_0x224476,null))['catch'](handleError(_0x224476,null));};exports['describe']=function(_0x26fbd0,_0x2af08a){return db[_0x08ac('0x21')][_0x08ac('0x43')]()[_0x08ac('0x1c')](respondWithResult(_0x2af08a,null))[_0x08ac('0x3b')](handleError(_0x2af08a,null));};exports[_0x08ac('0x44')]=function(_0x23f28c,_0x23cb83,_0x5d95c6){var _0x313a3e={'raw':!![],'where':{}};var _0x1b14bc={};var _0x24875d={'count':0x0,'rows':[]};return db[_0x08ac('0x21')][_0x08ac('0x45')]({'where':{'id':_0x23f28c['params']['id']}})[_0x08ac('0x1c')](handleEntityNotFound(_0x23cb83,null))[_0x08ac('0x1c')](function(_0x2196bb){if(_0x2196bb){_0x1b14bc[_0x08ac('0x26')]=_[_0x08ac('0x28')](db['JscriptyQuestionReport'][_0x08ac('0x22')]);_0x1b14bc[_0x08ac('0x27')]=_[_0x08ac('0x28')](_0x23f28c['query']);_0x1b14bc['filters']=_['intersection'](_0x1b14bc[_0x08ac('0x26')],_0x1b14bc[_0x08ac('0x27')]);_0x313a3e['attributes']=_[_0x08ac('0x2a')](_0x1b14bc[_0x08ac('0x26')],qs[_0x08ac('0x2b')](_0x23f28c[_0x08ac('0x27')][_0x08ac('0x2b')]));_0x313a3e[_0x08ac('0x29')]=_0x313a3e[_0x08ac('0x29')][_0x08ac('0x2c')]?_0x313a3e[_0x08ac('0x29')]:_0x1b14bc['model'];if(!_0x23f28c['query'][_0x08ac('0x2d')](_0x08ac('0x2e'))){_0x313a3e[_0x08ac('0x2f')]=qs[_0x08ac('0x2f')](_0x23f28c[_0x08ac('0x27')][_0x08ac('0x2f')]);_0x313a3e['offset']=qs[_0x08ac('0x14')](_0x23f28c[_0x08ac('0x27')][_0x08ac('0x14')]);}_0x313a3e['order']=qs[_0x08ac('0x31')](_0x23f28c[_0x08ac('0x27')][_0x08ac('0x31')]);_0x313a3e[_0x08ac('0x32')]=qs[_0x08ac('0x33')](_['pick'](_0x23f28c[_0x08ac('0x27')],_0x1b14bc[_0x08ac('0x33')]));_0x313a3e[_0x08ac('0x32')][_0x08ac('0x46')]=_0x2196bb['id'];if(_0x23f28c[_0x08ac('0x27')]['filter']){_0x313a3e[_0x08ac('0x32')]=_[_0x08ac('0x35')](_0x313a3e[_0x08ac('0x32')],{'$or':_[_0x08ac('0x20')](_0x313a3e[_0x08ac('0x29')],function(_0x3b1c41){var _0x39f8a6={};_0x39f8a6[_0x3b1c41]={'$like':'%'+_0x23f28c[_0x08ac('0x27')][_0x08ac('0x37')]+'%'};return _0x39f8a6;})});}_0x313a3e=_[_0x08ac('0x35')]({},_0x313a3e,_0x23f28c[_0x08ac('0x38')]);return db[_0x08ac('0x47')][_0x08ac('0x16')]({'where':_0x313a3e[_0x08ac('0x32')]})['then'](function(_0x96bd5d){_0x24875d[_0x08ac('0x16')]=_0x96bd5d;if(_0x23f28c[_0x08ac('0x27')][_0x08ac('0x39')]){_0x313a3e[_0x08ac('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x08ac('0x48')](_0x313a3e);})['then'](function(_0x4614a2){_0x24875d[_0x08ac('0x3a')]=_0x4614a2;return _0x24875d;});}})[_0x08ac('0x1c')](respondWithFilteredResult(_0x23cb83,_0x313a3e))[_0x08ac('0x3b')](handleError(_0x23cb83,null));};
\ No newline at end of file
+var _0xc35c=['error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','create','body','catch','find','describe','getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0xc35c,0x12a));var _0xcc35=function(_0x2fa9b0,_0x4387a9){_0x2fa9b0=_0x2fa9b0-0x0;var _0x1360b6=_0xc35c[_0x2fa9b0];return _0x1360b6;};'use strict';var emlformat=require(_0xcc35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc35('0x1'));var jsonpatch=require(_0xcc35('0x2'));var rp=require(_0xcc35('0x3'));var moment=require(_0xcc35('0x4'));var BPromise=require(_0xcc35('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc35('0x6'));var sox=require(_0xcc35('0x7'));var csv=require(_0xcc35('0x8'));var ejs=require(_0xcc35('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcc35('0xa'));var crypto=require(_0xcc35('0xb'));var jsforce=require(_0xcc35('0xc'));var deskjs=require(_0xcc35('0xd'));var toCsv=require(_0xcc35('0x8'));var querystring=require(_0xcc35('0xe'));var Papa=require(_0xcc35('0xf'));var Redis=require(_0xcc35('0x10'));var authService=require(_0xcc35('0x11'));var qs=require(_0xcc35('0x12'));var as=require(_0xcc35('0x13'));var hardwareService=require(_0xcc35('0x14'));var logger=require(_0xcc35('0x15'))(_0xcc35('0x16'));var utils=require(_0xcc35('0x17'));var config=require(_0xcc35('0x18'));var licenseUtil=require(_0xcc35('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4c15,_0x47fc7d){_0x47fc7d=_0x47fc7d||0xcc;return function(_0xbfd5cb){if(_0xbfd5cb){return _0x1a4c15['sendStatus'](_0x47fc7d);}return _0x1a4c15['status'](_0x47fc7d)[_0xcc35('0x1a')]();};}function respondWithResult(_0x23e86a,_0x1bacad){_0x1bacad=_0x1bacad||0xc8;return function(_0x2680b0){if(_0x2680b0){return _0x23e86a[_0xcc35('0x1b')](_0x1bacad)[_0xcc35('0x1c')](_0x2680b0);}};}function respondWithFilteredResult(_0x508b7d,_0x136d9c){return function(_0x1864bf){if(_0x1864bf){var _0x202b2a=typeof _0x136d9c[_0xcc35('0x1d')]===_0xcc35('0x1e')&&typeof _0x136d9c['limit']===_0xcc35('0x1e');var _0xfce83b=_0x1864bf['count'];var _0x17660d=_0x202b2a?0x0:_0x136d9c[_0xcc35('0x1d')];var _0x110798=_0x202b2a?_0x1864bf[_0xcc35('0x1f')]:_0x136d9c[_0xcc35('0x1d')]+_0x136d9c[_0xcc35('0x20')];var _0x48c1a2;if(_0x110798>=_0xfce83b){_0x110798=_0xfce83b;_0x48c1a2=0xc8;}else{_0x48c1a2=0xce;}_0x508b7d[_0xcc35('0x1b')](_0x48c1a2);return _0x508b7d[_0xcc35('0x21')](_0xcc35('0x22'),_0x17660d+'-'+_0x110798+'/'+_0xfce83b)[_0xcc35('0x1c')](_0x1864bf);}return null;};}function patchUpdates(_0x2f1641){return function(_0x27e6d3){try{jsonpatch[_0xcc35('0x23')](_0x27e6d3,_0x2f1641,!![]);}catch(_0x414494){return BPromise[_0xcc35('0x24')](_0x414494);}return _0x27e6d3[_0xcc35('0x25')]();};}function saveUpdates(_0x2e9c9a,_0x81117c){return function(_0x2ecff0){if(_0x2ecff0){return _0x2ecff0[_0xcc35('0x26')](_0x2e9c9a)[_0xcc35('0x27')](function(_0x125fb7){return _0x125fb7;});}return null;};}function removeEntity(_0x40d848,_0x188c18){return function(_0x8beac4){if(_0x8beac4){return _0x8beac4[_0xcc35('0x28')]()[_0xcc35('0x27')](function(){_0x40d848[_0xcc35('0x1b')](0xcc)[_0xcc35('0x1a')]();});}};}function handleEntityNotFound(_0x5641f3,_0x1cdcf6){return function(_0x461953){if(!_0x461953){_0x5641f3[_0xcc35('0x29')](0x194);}return _0x461953;};}function handleError(_0x532a71,_0x4309de){_0x4309de=_0x4309de||0x1f4;return function(_0x8a7daf){logger[_0xcc35('0x2a')](_0x8a7daf[_0xcc35('0x2b')]);if(_0x8a7daf['name']){delete _0x8a7daf[_0xcc35('0x2c')];}_0x532a71[_0xcc35('0x1b')](_0x4309de)[_0xcc35('0x2d')](_0x8a7daf);};}exports[_0xcc35('0x2e')]=function(_0x3013ca,_0x392a5e){var _0x46f546={},_0x3dd0e1={},_0x39b592={'count':0x0,'rows':[]};var _0x95ef4e=_[_0xcc35('0x2f')](db[_0xcc35('0x30')][_0xcc35('0x31')],function(_0x4b06fe){return{'name':_0x4b06fe[_0xcc35('0x32')],'type':_0x4b06fe[_0xcc35('0x33')][_0xcc35('0x34')]};});_0x3dd0e1['model']=_[_0xcc35('0x2f')](_0x95ef4e,'name');_0x3dd0e1['query']=_[_0xcc35('0x35')](_0x3013ca['query']);_0x3dd0e1[_0xcc35('0x36')]=_[_0xcc35('0x37')](_0x3dd0e1[_0xcc35('0x38')],_0x3dd0e1[_0xcc35('0x39')]);_0x46f546['attributes']=_[_0xcc35('0x37')](_0x3dd0e1[_0xcc35('0x38')],qs[_0xcc35('0x3a')](_0x3013ca[_0xcc35('0x39')]['fields']));_0x46f546['attributes']=_0x46f546[_0xcc35('0x3b')][_0xcc35('0x3c')]?_0x46f546['attributes']:_0x3dd0e1[_0xcc35('0x38')];if(!_0x3013ca[_0xcc35('0x39')][_0xcc35('0x3d')](_0xcc35('0x3e'))){_0x46f546[_0xcc35('0x20')]=qs[_0xcc35('0x20')](_0x3013ca[_0xcc35('0x39')][_0xcc35('0x20')]);_0x46f546[_0xcc35('0x1d')]=qs[_0xcc35('0x1d')](_0x3013ca[_0xcc35('0x39')][_0xcc35('0x1d')]);}_0x46f546['order']=qs['sort'](_0x3013ca['query'][_0xcc35('0x3f')]);_0x46f546[_0xcc35('0x40')]=qs[_0xcc35('0x36')](_['pick'](_0x3013ca[_0xcc35('0x39')],_0x3dd0e1[_0xcc35('0x36')]),_0x95ef4e);if(_0x3013ca[_0xcc35('0x39')]['filter']){_0x46f546[_0xcc35('0x40')]=_[_0xcc35('0x41')](_0x46f546[_0xcc35('0x40')],{'$or':_[_0xcc35('0x2f')](_0x95ef4e,function(_0x443015){if(_0x443015[_0xcc35('0x33')]!==_0xcc35('0x42')){var _0x2ce26c={};_0x2ce26c[_0x443015['name']]={'$like':'%'+_0x3013ca['query'][_0xcc35('0x43')]+'%'};return _0x2ce26c;}})});}_0x46f546=_['merge']({},_0x46f546,_0x3013ca[_0xcc35('0x44')]);var _0x381961={'where':_0x46f546[_0xcc35('0x40')]};return db[_0xcc35('0x30')]['count'](_0x381961)['then'](function(_0xb4a9ac){_0x39b592[_0xcc35('0x1f')]=_0xb4a9ac;if(_0x3013ca[_0xcc35('0x39')]['includeAll']){_0x46f546[_0xcc35('0x45')]=[{'all':!![]}];}return db[_0xcc35('0x30')][_0xcc35('0x46')](_0x46f546);})[_0xcc35('0x27')](function(_0x488e34){_0x39b592[_0xcc35('0x47')]=_0x488e34;return _0x39b592;})[_0xcc35('0x27')](respondWithFilteredResult(_0x392a5e,_0x46f546))['catch'](handleError(_0x392a5e,null));};exports['show']=function(_0x188c9a,_0x44c6f1){var _0x1cdefd={'raw':!![],'where':{'id':_0x188c9a[_0xcc35('0x48')]['id']}},_0x17e42f={};_0x17e42f['model']=_[_0xcc35('0x35')](db[_0xcc35('0x30')][_0xcc35('0x31')]);_0x17e42f[_0xcc35('0x39')]=_[_0xcc35('0x35')](_0x188c9a['query']);_0x17e42f[_0xcc35('0x36')]=_[_0xcc35('0x37')](_0x17e42f[_0xcc35('0x38')],_0x17e42f[_0xcc35('0x39')]);_0x1cdefd[_0xcc35('0x3b')]=_['intersection'](_0x17e42f[_0xcc35('0x38')],qs[_0xcc35('0x3a')](_0x188c9a[_0xcc35('0x39')][_0xcc35('0x3a')]));_0x1cdefd[_0xcc35('0x3b')]=_0x1cdefd[_0xcc35('0x3b')]['length']?_0x1cdefd[_0xcc35('0x3b')]:_0x17e42f[_0xcc35('0x38')];if(_0x188c9a[_0xcc35('0x39')][_0xcc35('0x49')]){_0x1cdefd[_0xcc35('0x45')]=[{'all':!![]}];}_0x1cdefd=_[_0xcc35('0x41')]({},_0x1cdefd,_0x188c9a[_0xcc35('0x44')]);return db[_0xcc35('0x30')]['find'](_0x1cdefd)[_0xcc35('0x27')](handleEntityNotFound(_0x44c6f1,null))[_0xcc35('0x27')](respondWithResult(_0x44c6f1,null))['catch'](handleError(_0x44c6f1,null));};exports[_0xcc35('0x4a')]=function(_0x92eef3,_0x2e5c44){return db[_0xcc35('0x30')][_0xcc35('0x4a')](_0x92eef3[_0xcc35('0x4b')],{})[_0xcc35('0x27')](respondWithResult(_0x2e5c44,0xc9))[_0xcc35('0x4c')](handleError(_0x2e5c44,null));};exports[_0xcc35('0x26')]=function(_0x543695,_0x3b7f10){if(_0x543695[_0xcc35('0x4b')]['id']){delete _0x543695['body']['id'];}return db[_0xcc35('0x30')][_0xcc35('0x4d')]({'where':{'id':_0x543695[_0xcc35('0x48')]['id']}})[_0xcc35('0x27')](handleEntityNotFound(_0x3b7f10,null))[_0xcc35('0x27')](saveUpdates(_0x543695['body'],null))[_0xcc35('0x27')](respondWithResult(_0x3b7f10,null))[_0xcc35('0x4c')](handleError(_0x3b7f10,null));};exports[_0xcc35('0x28')]=function(_0x177704,_0x37852d){return db[_0xcc35('0x30')][_0xcc35('0x4d')]({'where':{'id':_0x177704[_0xcc35('0x48')]['id']}})['then'](handleEntityNotFound(_0x37852d,null))[_0xcc35('0x27')](removeEntity(_0x37852d,null))[_0xcc35('0x4c')](handleError(_0x37852d,null));};exports[_0xcc35('0x4e')]=function(_0x1a8f2d,_0x296038){return db[_0xcc35('0x30')][_0xcc35('0x4e')]()[_0xcc35('0x27')](respondWithResult(_0x296038,null))[_0xcc35('0x4c')](handleError(_0x296038,null));};exports[_0xcc35('0x4f')]=function(_0x49edce,_0x1c8ec5,_0x303017){var _0x1470e9={'raw':!![],'where':{}};var _0x4f3fd7={};var _0x4856bf={'count':0x0,'rows':[]};return db[_0xcc35('0x30')][_0xcc35('0x50')]({'where':{'id':_0x49edce[_0xcc35('0x48')]['id']}})[_0xcc35('0x27')](handleEntityNotFound(_0x1c8ec5,null))[_0xcc35('0x27')](function(_0x1a4dbf){if(_0x1a4dbf){_0x4f3fd7[_0xcc35('0x38')]=_[_0xcc35('0x35')](db[_0xcc35('0x51')][_0xcc35('0x31')]);_0x4f3fd7[_0xcc35('0x39')]=_['keys'](_0x49edce[_0xcc35('0x39')]);_0x4f3fd7[_0xcc35('0x36')]=_[_0xcc35('0x37')](_0x4f3fd7[_0xcc35('0x38')],_0x4f3fd7[_0xcc35('0x39')]);_0x1470e9['attributes']=_[_0xcc35('0x37')](_0x4f3fd7[_0xcc35('0x38')],qs[_0xcc35('0x3a')](_0x49edce[_0xcc35('0x39')][_0xcc35('0x3a')]));_0x1470e9[_0xcc35('0x3b')]=_0x1470e9[_0xcc35('0x3b')][_0xcc35('0x3c')]?_0x1470e9[_0xcc35('0x3b')]:_0x4f3fd7[_0xcc35('0x38')];if(!_0x49edce[_0xcc35('0x39')][_0xcc35('0x3d')]('nolimit')){_0x1470e9[_0xcc35('0x20')]=qs[_0xcc35('0x20')](_0x49edce[_0xcc35('0x39')][_0xcc35('0x20')]);_0x1470e9[_0xcc35('0x1d')]=qs[_0xcc35('0x1d')](_0x49edce['query'][_0xcc35('0x1d')]);}_0x1470e9[_0xcc35('0x52')]=qs[_0xcc35('0x3f')](_0x49edce[_0xcc35('0x39')][_0xcc35('0x3f')]);_0x1470e9[_0xcc35('0x40')]=qs['filters'](_[_0xcc35('0x53')](_0x49edce[_0xcc35('0x39')],_0x4f3fd7['filters']));_0x1470e9[_0xcc35('0x40')][_0xcc35('0x54')]=_0x1a4dbf['id'];if(_0x49edce[_0xcc35('0x39')][_0xcc35('0x43')]){_0x1470e9[_0xcc35('0x40')]=_['merge'](_0x1470e9[_0xcc35('0x40')],{'$or':_[_0xcc35('0x2f')](_0x1470e9['attributes'],function(_0x5f3634){var _0x196cb9={};_0x196cb9[_0x5f3634]={'$like':'%'+_0x49edce[_0xcc35('0x39')][_0xcc35('0x43')]+'%'};return _0x196cb9;})});}_0x1470e9=_[_0xcc35('0x41')]({},_0x1470e9,_0x49edce[_0xcc35('0x44')]);return db[_0xcc35('0x51')][_0xcc35('0x1f')]({'where':_0x1470e9[_0xcc35('0x40')]})[_0xcc35('0x27')](function(_0x5b6ea5){_0x4856bf[_0xcc35('0x1f')]=_0x5b6ea5;if(_0x49edce[_0xcc35('0x39')][_0xcc35('0x49')]){_0x1470e9['include']=[{'all':!![]}];}return db[_0xcc35('0x51')][_0xcc35('0x46')](_0x1470e9);})[_0xcc35('0x27')](function(_0x59102c){_0x4856bf[_0xcc35('0x47')]=_0x59102c;return _0x4856bf;});}})['then'](respondWithFilteredResult(_0x1c8ec5,_0x1470e9))[_0xcc35('0x4c')](handleError(_0x1c8ec5,null));};
\ No newline at end of file
index bec1a54..def7863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0x159545,_0x4b2a93){var _0x4d43a6=function(_0x4034d9){while(--_0x4034d9){_0x159545['push'](_0x159545['shift']());}};_0x4d43a6(++_0x4b2a93);}(_0x3831,0x14c));var _0x1383=function(_0x277b55,_0x8ba28){_0x277b55=_0x277b55-0x0;var _0xff0d15=_0x3831[_0x277b55];return _0xff0d15;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions'];(function(_0x10328e,_0x39c649){var _0x3be2c0=function(_0x659a86){while(--_0x659a86){_0x10328e['push'](_0x10328e['shift']());}};_0x3be2c0(++_0x39c649);}(_0x2d72,0xa8));var _0x22d7=function(_0x3d0c4e,_0x292847){_0x3d0c4e=_0x3d0c4e-0x0;var _0x17e70d=_0x2d72[_0x3d0c4e];return _0x17e70d;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 746b9e2..3cd836f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xd117,0x182));var _0x7d11=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xd117[_0x21205e];return _0x136ebb;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});}
\ No newline at end of file
+var _0x6d11=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x12199c,_0x1ac8de){var _0x120833=function(_0x307b80){while(--_0x307b80){_0x12199c['push'](_0x12199c['shift']());}};_0x120833(++_0x1ac8de);}(_0x6d11,0xbf));var _0x16d1=function(_0x1f1e41,_0x41dfe4){_0x1f1e41=_0x1f1e41-0x0;var _0x101f3c=_0x6d11[_0x1f1e41];return _0x101f3c;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}
\ No newline at end of file
index cd84a50..e0c97c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41a0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express'];(function(_0x10edfd,_0x52a9fe){var _0x29b5a7=function(_0x97dfe7){while(--_0x97dfe7){_0x10edfd['push'](_0x10edfd['shift']());}};_0x29b5a7(++_0x52a9fe);}(_0x41a0,0x10c));var _0x041a=function(_0x826bba,_0x3aec0c){_0x826bba=_0x826bba-0x0;var _0x31a8ec=_0x41a0[_0x826bba];return _0x31a8ec;};'use strict';var multer=require(_0x041a('0x0'));var util=require(_0x041a('0x1'));var path=require('path');var timeout=require(_0x041a('0x2'));var express=require(_0x041a('0x3'));var router=express[_0x041a('0x4')]();var fs_extra=require(_0x041a('0x5'));var auth=require(_0x041a('0x6'));var interaction=require(_0x041a('0x7'));var config=require(_0x041a('0x8'));var controller=require(_0x041a('0x9'));router[_0x041a('0xa')]('/',controller[_0x041a('0xb')]);router[_0x041a('0xc')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller[_0x041a('0xf')]);router['get']('/download_log_file',auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x041a('0x10')]=router;
\ No newline at end of file
+var _0x2124=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','update','/download_log_file','isAuthenticated','downloadLogFile','multer'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x2124,0x151));var _0x4212=function(_0x33c6e3,_0x1d95d5){_0x33c6e3=_0x33c6e3-0x0;var _0x13d403=_0x2124[_0x33c6e3];return _0x13d403;};'use strict';var multer=require(_0x4212('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4212('0x1'));var express=require(_0x4212('0x2'));var router=express['Router']();var fs_extra=require(_0x4212('0x3'));var auth=require(_0x4212('0x4'));var interaction=require(_0x4212('0x5'));var config=require(_0x4212('0x6'));var controller=require(_0x4212('0x7'));router['get']('/',controller[_0x4212('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4212('0x9')]);router['get'](_0x4212('0xa'),auth[_0x4212('0xb')](),controller[_0x4212('0xc')]);module['exports']=router;
\ No newline at end of file
index fa5171e..ca22218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ae=['TEXT','STRING','INTEGER','sequelize'];(function(_0x21ebdf,_0x2c1a0f){var _0x465a61=function(_0x1c3177){while(--_0x1c3177){_0x21ebdf['push'](_0x21ebdf['shift']());}};_0x465a61(++_0x2c1a0f);}(_0xf7ae,0x1cb));var _0xef7a=function(_0x5614a3,_0x1f87e3){_0x5614a3=_0x5614a3-0x0;var _0x4f7da3=_0xf7ae[_0x5614a3];return _0x4f7da3;};'use strict';var Sequelize=require(_0xef7a('0x0'));module['exports']={'license':{'type':Sequelize[_0xef7a('0x1')]},'data1':{'type':Sequelize[_0xef7a('0x2')]},'data2':{'type':Sequelize[_0xef7a('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xef7a('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1160=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x11fc7e,_0x2fa1a2){var _0x572f83=function(_0x3e7cd5){while(--_0x3e7cd5){_0x11fc7e['push'](_0x11fc7e['shift']());}};_0x572f83(++_0x2fa1a2);}(_0x1160,0x1a3));var _0x0116=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x1160[_0x3a9815];return _0x188653;};'use strict';var Sequelize=require(_0x0116('0x0'));module[_0x0116('0x1')]={'license':{'type':Sequelize[_0x0116('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0116('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x0116('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 3a130db..1ae102a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d47=['moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','model','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','key','license-info.log','join','/var','log','setHeader','Content-disposition','Content-Type','text/plain','eml-format','zip-dir','fast-json-patch'];(function(_0x27f323,_0x2d6212){var _0x557b7b=function(_0x51f28c){while(--_0x51f28c){_0x27f323['push'](_0x27f323['shift']());}};_0x557b7b(++_0x2d6212);}(_0x2d47,0x119));var _0x72d4=function(_0x419b8d,_0x25459b){_0x419b8d=_0x419b8d-0x0;var _0x1ff2f3=_0x2d47[_0x419b8d];return _0x1ff2f3;};'use strict';var emlformat=require(_0x72d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72d4('0x1'));var jsonpatch=require(_0x72d4('0x2'));var rp=require('request-promise');var moment=require(_0x72d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x72d4('0x4'));var util=require(_0x72d4('0x5'));var path=require(_0x72d4('0x6'));var sox=require(_0x72d4('0x7'));var csv=require(_0x72d4('0x8'));var ejs=require(_0x72d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72d4('0xa'));var squel=require('squel');var crypto=require(_0x72d4('0xb'));var jsforce=require(_0x72d4('0xc'));var deskjs=require(_0x72d4('0xd'));var toCsv=require(_0x72d4('0x8'));var querystring=require('querystring');var Papa=require(_0x72d4('0xe'));var Redis=require(_0x72d4('0xf'));var authService=require(_0x72d4('0x10'));var qs=require(_0x72d4('0x11'));var as=require(_0x72d4('0x12'));var hardwareService=require(_0x72d4('0x13'));var logger=require(_0x72d4('0x14'))(_0x72d4('0x15'));var utils=require(_0x72d4('0x16'));var config=require(_0x72d4('0x17'));var licenseUtil=require(_0x72d4('0x18'));var db=require(_0x72d4('0x19'))['db'];function respondWithStatusCode(_0x1ac6a6,_0x1e78af){_0x1e78af=_0x1e78af||0xcc;return function(_0x1f8d13){if(_0x1f8d13){return _0x1ac6a6[_0x72d4('0x1a')](_0x1e78af);}return _0x1ac6a6[_0x72d4('0x1b')](_0x1e78af)['end']();};}function respondWithResult(_0x5e23b0,_0x139221){_0x139221=_0x139221||0xc8;return function(_0x292681){if(_0x292681){return _0x5e23b0[_0x72d4('0x1b')](_0x139221)[_0x72d4('0x1c')](_0x292681);}};}function respondWithFilteredResult(_0x9c9f6c,_0x2662bf){return function(_0x6b6a39){if(_0x6b6a39){var _0xef2b91=typeof _0x2662bf[_0x72d4('0x1d')]===_0x72d4('0x1e')&&typeof _0x2662bf[_0x72d4('0x1f')]===_0x72d4('0x1e');var _0x5df6c5=_0x6b6a39['count'];var _0x292b01=_0xef2b91?0x0:_0x2662bf['offset'];var _0x4b24e3=_0xef2b91?_0x6b6a39[_0x72d4('0x20')]:_0x2662bf[_0x72d4('0x1d')]+_0x2662bf[_0x72d4('0x1f')];var _0xa90fb;if(_0x4b24e3>=_0x5df6c5){_0x4b24e3=_0x5df6c5;_0xa90fb=0xc8;}else{_0xa90fb=0xce;}_0x9c9f6c[_0x72d4('0x1b')](_0xa90fb);return _0x9c9f6c[_0x72d4('0x21')](_0x72d4('0x22'),_0x292b01+'-'+_0x4b24e3+'/'+_0x5df6c5)[_0x72d4('0x1c')](_0x6b6a39);}return null;};}function patchUpdates(_0x42d754){return function(_0x1a5daf){try{jsonpatch[_0x72d4('0x23')](_0x1a5daf,_0x42d754,!![]);}catch(_0x1460d4){return BPromise['reject'](_0x1460d4);}return _0x1a5daf[_0x72d4('0x24')]();};}function saveUpdates(_0xbc8136,_0x27555e){return function(_0x577457){if(_0x577457){return _0x577457[_0x72d4('0x25')](_0xbc8136)[_0x72d4('0x26')](function(_0x4aa6a8){return _0x4aa6a8;});}return null;};}function removeEntity(_0x1c8c69,_0x5c61e5){return function(_0xbef6dc){if(_0xbef6dc){return _0xbef6dc[_0x72d4('0x27')]()[_0x72d4('0x26')](function(){_0x1c8c69[_0x72d4('0x1b')](0xcc)[_0x72d4('0x28')]();});}};}function handleEntityNotFound(_0x1ea79e,_0x86edef){return function(_0x293983){if(!_0x293983){_0x1ea79e['sendStatus'](0x194);}return _0x293983;};}function handleError(_0x461cab,_0x520737){_0x520737=_0x520737||0x1f4;return function(_0x25435e){logger[_0x72d4('0x29')](_0x25435e[_0x72d4('0x2a')]);if(_0x25435e[_0x72d4('0x2b')]){delete _0x25435e['name'];}_0x461cab['status'](_0x520737)[_0x72d4('0x2c')](_0x25435e);};}var utilLicense=require(_0x72d4('0x18'));exports[_0x72d4('0x2d')]=function(_0x1c753a,_0x32e1dc){var _0x10e132={'raw':!![],'where':{'id':0x1}},_0x157c55={};_0x157c55[_0x72d4('0x2e')]=_['keys'](db[_0x72d4('0x2f')][_0x72d4('0x30')]);_0x157c55[_0x72d4('0x31')]=_['keys'](_0x1c753a[_0x72d4('0x31')]);_0x157c55['filters']=_[_0x72d4('0x32')](_0x157c55[_0x72d4('0x2e')],_0x157c55['query']);_0x10e132[_0x72d4('0x33')]=_['intersection'](_0x157c55[_0x72d4('0x2e')],qs['fields'](_0x1c753a[_0x72d4('0x31')][_0x72d4('0x34')]));_0x10e132[_0x72d4('0x33')]=_0x10e132[_0x72d4('0x33')][_0x72d4('0x35')]?_0x10e132[_0x72d4('0x33')]:_0x157c55[_0x72d4('0x2e')];_0x10e132=_[_0x72d4('0x36')]({},_0x10e132,_0x1c753a[_0x72d4('0x37')]);return utilLicense[_0x72d4('0x38')](_0x10e132)[_0x72d4('0x26')](respondWithResult(_0x32e1dc,null))[_0x72d4('0x39')](handleError(_0x32e1dc,null));};exports[_0x72d4('0x25')]=function(_0x1d647c,_0x2e2ed7){if(_0x1d647c[_0x72d4('0x3a')]['id']){delete _0x1d647c[_0x72d4('0x3a')]['id'];}return db[_0x72d4('0x2f')][_0x72d4('0x3b')]({'where':{'id':_0x1d647c[_0x72d4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e2ed7,null))[_0x72d4('0x26')](function(_0x1ef8dc){var _0x386890=_0x1ef8dc[_0x72d4('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x386890,_0x1d647c[_0x72d4('0x3a')][_0x72d4('0x3e')]);})[_0x72d4('0x26')](function(_0xc31394){if(!_0xc31394['demo']){return saveUpdates(_0x1d647c[_0x72d4('0x3a')],null);}return _0xc31394;})[_0x72d4('0x26')](respondWithResult(_0x2e2ed7,null))[_0x72d4('0x39')](handleError(_0x2e2ed7,null));};exports['downloadLogFile']=function(_0x4003d6,_0x2d5cb3){var _0x3da6ff=_0x72d4('0x3f');var _0x5337d2=path[_0x72d4('0x40')](_0x72d4('0x41'),_0x72d4('0x42'),'xcally',_0x3da6ff);_0x2d5cb3[_0x72d4('0x43')](_0x72d4('0x44'),'attachment;\x20filename='+_0x3da6ff);_0x2d5cb3[_0x72d4('0x21')](_0x72d4('0x45'),_0x72d4('0x46'));_0x2d5cb3['download'](_0x5337d2);};
\ No newline at end of file
+var _0x0149=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','getLicense','catch','body','License','find','params','demo','downloadLogFile','license-info.log','join','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3a27bf,_0x1cd339){var _0x46a75f=function(_0x5d95a8){while(--_0x5d95a8){_0x3a27bf['push'](_0x3a27bf['shift']());}};_0x46a75f(++_0x1cd339);}(_0x0149,0x1d8));var _0x9014=function(_0x241973,_0x4e7714){_0x241973=_0x241973-0x0;var _0x2d5ab6=_0x0149[_0x241973];return _0x2d5ab6;};'use strict';var emlformat=require(_0x9014('0x0'));var rimraf=require(_0x9014('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9014('0x2'));var rp=require(_0x9014('0x3'));var moment=require(_0x9014('0x4'));var BPromise=require(_0x9014('0x5'));var Mustache=require(_0x9014('0x6'));var util=require(_0x9014('0x7'));var path=require(_0x9014('0x8'));var sox=require(_0x9014('0x9'));var csv=require(_0x9014('0xa'));var ejs=require(_0x9014('0xb'));var fs=require('fs');var fs_extra=require(_0x9014('0xc'));var _=require('lodash');var squel=require(_0x9014('0xd'));var crypto=require(_0x9014('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9014('0xa'));var querystring=require(_0x9014('0xf'));var Papa=require(_0x9014('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9014('0x11'));var as=require(_0x9014('0x12'));var hardwareService=require(_0x9014('0x13'));var logger=require(_0x9014('0x14'))(_0x9014('0x15'));var utils=require(_0x9014('0x16'));var config=require(_0x9014('0x17'));var licenseUtil=require(_0x9014('0x18'));var db=require(_0x9014('0x19'))['db'];function respondWithStatusCode(_0x41bbe7,_0x3589cc){_0x3589cc=_0x3589cc||0xcc;return function(_0x308e74){if(_0x308e74){return _0x41bbe7[_0x9014('0x1a')](_0x3589cc);}return _0x41bbe7[_0x9014('0x1b')](_0x3589cc)[_0x9014('0x1c')]();};}function respondWithResult(_0x5ceedb,_0x56d9c4){_0x56d9c4=_0x56d9c4||0xc8;return function(_0x483a54){if(_0x483a54){return _0x5ceedb[_0x9014('0x1b')](_0x56d9c4)['json'](_0x483a54);}};}function respondWithFilteredResult(_0x18d54d,_0x2cae0f){return function(_0x2f5ed4){if(_0x2f5ed4){var _0xdb7810=typeof _0x2cae0f[_0x9014('0x1d')]==='undefined'&&typeof _0x2cae0f[_0x9014('0x1e')]===_0x9014('0x1f');var _0x22f6ac=_0x2f5ed4['count'];var _0x1948d0=_0xdb7810?0x0:_0x2cae0f[_0x9014('0x1d')];var _0x3f5e81=_0xdb7810?_0x2f5ed4['count']:_0x2cae0f[_0x9014('0x1d')]+_0x2cae0f[_0x9014('0x1e')];var _0x4b050b;if(_0x3f5e81>=_0x22f6ac){_0x3f5e81=_0x22f6ac;_0x4b050b=0xc8;}else{_0x4b050b=0xce;}_0x18d54d[_0x9014('0x1b')](_0x4b050b);return _0x18d54d[_0x9014('0x20')](_0x9014('0x21'),_0x1948d0+'-'+_0x3f5e81+'/'+_0x22f6ac)[_0x9014('0x22')](_0x2f5ed4);}return null;};}function patchUpdates(_0x2f438c){return function(_0x44dce8){try{jsonpatch[_0x9014('0x23')](_0x44dce8,_0x2f438c,!![]);}catch(_0x2302ef){return BPromise[_0x9014('0x24')](_0x2302ef);}return _0x44dce8[_0x9014('0x25')]();};}function saveUpdates(_0x37d182,_0x3fd960){return function(_0x353912){if(_0x353912){return _0x353912[_0x9014('0x26')](_0x37d182)[_0x9014('0x27')](function(_0x455582){return _0x455582;});}return null;};}function removeEntity(_0x131700,_0x1288c3){return function(_0x2a46e2){if(_0x2a46e2){return _0x2a46e2[_0x9014('0x28')]()[_0x9014('0x27')](function(){_0x131700[_0x9014('0x1b')](0xcc)[_0x9014('0x1c')]();});}};}function handleEntityNotFound(_0x2c76b3,_0x31125a){return function(_0x475832){if(!_0x475832){_0x2c76b3[_0x9014('0x1a')](0x194);}return _0x475832;};}function handleError(_0x1cb502,_0x26f922){_0x26f922=_0x26f922||0x1f4;return function(_0x51e2d5){logger[_0x9014('0x29')](_0x51e2d5[_0x9014('0x2a')]);if(_0x51e2d5[_0x9014('0x2b')]){delete _0x51e2d5['name'];}_0x1cb502[_0x9014('0x1b')](_0x26f922)[_0x9014('0x2c')](_0x51e2d5);};}var utilLicense=require(_0x9014('0x18'));exports[_0x9014('0x2d')]=function(_0x1c11c7,_0x3d81bb){var _0x1c96a4={'raw':!![],'where':{'id':0x1}},_0x389ac7={};_0x389ac7['model']=_[_0x9014('0x2e')](db['License']['rawAttributes']);_0x389ac7['query']=_['keys'](_0x1c11c7[_0x9014('0x2f')]);_0x389ac7[_0x9014('0x30')]=_[_0x9014('0x31')](_0x389ac7[_0x9014('0x32')],_0x389ac7['query']);_0x1c96a4[_0x9014('0x33')]=_['intersection'](_0x389ac7['model'],qs[_0x9014('0x34')](_0x1c11c7[_0x9014('0x2f')][_0x9014('0x34')]));_0x1c96a4[_0x9014('0x33')]=_0x1c96a4[_0x9014('0x33')]['length']?_0x1c96a4[_0x9014('0x33')]:_0x389ac7['model'];_0x1c96a4=_['merge']({},_0x1c96a4,_0x1c11c7['options']);return utilLicense[_0x9014('0x35')](_0x1c96a4)[_0x9014('0x27')](respondWithResult(_0x3d81bb,null))[_0x9014('0x36')](handleError(_0x3d81bb,null));};exports[_0x9014('0x26')]=function(_0x16ce48,_0x3cf6d7){if(_0x16ce48[_0x9014('0x37')]['id']){delete _0x16ce48['body']['id'];}return db[_0x9014('0x38')][_0x9014('0x39')]({'where':{'id':_0x16ce48[_0x9014('0x3a')]['id']}})[_0x9014('0x27')](handleEntityNotFound(_0x3cf6d7,null))[_0x9014('0x27')](function(_0x208765){var _0x46a77d=_0x208765['get']({'plain':!![]});return utilLicense['checkLicense'](_0x46a77d,_0x16ce48[_0x9014('0x37')]['key']);})[_0x9014('0x27')](function(_0x58bb75){if(!_0x58bb75[_0x9014('0x3b')]){return saveUpdates(_0x16ce48[_0x9014('0x37')],null);}return _0x58bb75;})[_0x9014('0x27')](respondWithResult(_0x3cf6d7,null))[_0x9014('0x36')](handleError(_0x3cf6d7,null));};exports[_0x9014('0x3c')]=function(_0x2b9748,_0x2b0226){var _0x5be318=_0x9014('0x3d');var _0xd06131=path[_0x9014('0x3e')]('/var','log','xcally',_0x5be318);_0x2b0226['setHeader'](_0x9014('0x3f'),_0x9014('0x40')+_0x5be318);_0x2b0226[_0x9014('0x20')](_0x9014('0x41'),_0x9014('0x42'));_0x2b0226[_0x9014('0x43')](_0xd06131);};
\ No newline at end of file
index b7fa258..dfcc9a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab9=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','api','moment'];(function(_0x5b9b88,_0x1628cd){var _0x2efa9b=function(_0x55e2c5){while(--_0x55e2c5){_0x5b9b88['push'](_0x5b9b88['shift']());}};_0x2efa9b(++_0x1628cd);}(_0xeab9,0x1b6));var _0x9eab=function(_0xb275fa,_0x389d3b){_0xb275fa=_0xb275fa-0x0;var _0x1e4679=_0xeab9[_0xb275fa];return _0x1e4679;};'use strict';var _=require('lodash');var util=require(_0x9eab('0x0'));var logger=require(_0x9eab('0x1'))(_0x9eab('0x2'));var moment=require(_0x9eab('0x3'));var BPromise=require('bluebird');var rp=require(_0x9eab('0x4'));var fs=require('fs');var path=require(_0x9eab('0x5'));var rimraf=require(_0x9eab('0x6'));var config=require(_0x9eab('0x7'));var attributes=require(_0x9eab('0x8'));module[_0x9eab('0x9')]=function(_0x186ad6,_0x1f4a8e){return _0x186ad6[_0x9eab('0xa')](_0x9eab('0xb'),attributes,{'tableName':_0x9eab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2917=['rimraf','../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5f1f22,_0x43a17f){var _0x178f5b=function(_0x2b058d){while(--_0x2b058d){_0x5f1f22['push'](_0x5f1f22['shift']());}};_0x178f5b(++_0x43a17f);}(_0x2917,0xca));var _0x7291=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x2917[_0x46f1a6];return _0x38429a;};'use strict';var _=require('lodash');var util=require(_0x7291('0x0'));var logger=require(_0x7291('0x1'))(_0x7291('0x2'));var moment=require(_0x7291('0x3'));var BPromise=require('bluebird');var rp=require(_0x7291('0x4'));var fs=require('fs');var path=require(_0x7291('0x5'));var rimraf=require(_0x7291('0x6'));var config=require(_0x7291('0x7'));var attributes=require(_0x7291('0x8'));module[_0x7291('0x9')]=function(_0x221dfc,_0x5e90ad){return _0x221dfc[_0x7291('0xa')](_0x7291('0xb'),attributes,{'tableName':_0x7291('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0c2c3b9..59c8a53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc30=['code','License,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xcc30,0x138));var _0x0cc3=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0xcc30[_0x5341ff];return _0x53be58;};'use strict';var _=require(_0x0cc3('0x0'));var util=require('util');var moment=require(_0x0cc3('0x1'));var BPromise=require(_0x0cc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cc3('0x3'))['db'];var utils=require(_0x0cc3('0x4'));var logger=require(_0x0cc3('0x5'))(_0x0cc3('0x6'));var config=require(_0x0cc3('0x7'));var jayson=require(_0x0cc3('0x8'));var client=jayson[_0x0cc3('0x9')][_0x0cc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x462a16,_0x2b4445,_0x37b1a2){return new BPromise(function(_0x33799a,_0x150f25){return client[_0x0cc3('0xb')](_0x462a16,_0x37b1a2)[_0x0cc3('0xc')](function(_0x33f211){logger[_0x0cc3('0xd')]('License,\x20%s,\x20%s',_0x2b4445,_0x0cc3('0xe'));logger['debug'](_0x0cc3('0xf'),_0x2b4445,_0x0cc3('0xe'),JSON[_0x0cc3('0x10')](_0x33f211));if(_0x33f211[_0x0cc3('0x11')]){if(_0x33f211[_0x0cc3('0x11')][_0x0cc3('0x12')]===0x1f4){logger[_0x0cc3('0x11')](_0x0cc3('0x13'),_0x2b4445,_0x33f211[_0x0cc3('0x11')][_0x0cc3('0x14')]);return _0x150f25(_0x33f211[_0x0cc3('0x11')][_0x0cc3('0x14')]);}logger[_0x0cc3('0x11')]('License,\x20%s,\x20%s',_0x2b4445,_0x33f211[_0x0cc3('0x11')][_0x0cc3('0x14')]);return _0x33799a(_0x33f211['error']['message']);}else{logger[_0x0cc3('0xd')](_0x0cc3('0x13'),_0x2b4445,_0x0cc3('0xe'));_0x33799a(_0x33f211['result'][_0x0cc3('0x14')]);}})[_0x0cc3('0x15')](function(_0x5f59fd){logger['error'](_0x0cc3('0x13'),_0x2b4445,_0x5f59fd);_0x150f25(_0x5f59fd);});});}
\ No newline at end of file
+var _0x742b=['debug','stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x21bdd2,_0x254ed3){var _0x1ba3a6=function(_0x305c45){while(--_0x305c45){_0x21bdd2['push'](_0x21bdd2['shift']());}};_0x1ba3a6(++_0x254ed3);}(_0x742b,0x7d));var _0xb742=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x742b[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xb742('0x0'));var util=require(_0xb742('0x1'));var moment=require(_0xb742('0x2'));var BPromise=require('bluebird');var rs=require(_0xb742('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb742('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb742('0x5'))(_0xb742('0x6'));var config=require(_0xb742('0x7'));var jayson=require(_0xb742('0x8'));var client=jayson[_0xb742('0x9')][_0xb742('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537a9d,_0x52ff83,_0x5667bf){return new BPromise(function(_0x227313,_0x418bb9){return client[_0xb742('0xb')](_0x537a9d,_0x5667bf)['then'](function(_0x5a67e5){logger[_0xb742('0xc')](_0xb742('0xd'),_0x52ff83,_0xb742('0xe'));logger[_0xb742('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x52ff83,_0xb742('0xe'),JSON[_0xb742('0x10')](_0x5a67e5));if(_0x5a67e5[_0xb742('0x11')]){if(_0x5a67e5[_0xb742('0x11')]['code']===0x1f4){logger['error'](_0xb742('0xd'),_0x52ff83,_0x5a67e5[_0xb742('0x11')]['message']);return _0x418bb9(_0x5a67e5[_0xb742('0x11')][_0xb742('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0x52ff83,_0x5a67e5[_0xb742('0x11')][_0xb742('0x12')]);return _0x227313(_0x5a67e5['error'][_0xb742('0x12')]);}else{logger[_0xb742('0xc')](_0xb742('0xd'),_0x52ff83,_0xb742('0xe'));_0x227313(_0x5a67e5['result']['message']);}})[_0xb742('0x13')](function(_0x4aaf27){logger[_0xb742('0x11')]('License,\x20%s,\x20%s',_0x52ff83,_0x4aaf27);_0x418bb9(_0x4aaf27);});});}
\ No newline at end of file
index 9050aae..b1ded65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6bf=['/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','put','removeDispositions','delete','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','/:id/dispositions','getDispositions','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages'];(function(_0x3e9229,_0x2b06db){var _0x13dac8=function(_0x2c064d){while(--_0x2c064d){_0x3e9229['push'](_0x3e9229['shift']());}};_0x13dac8(++_0x2b06db);}(_0xd6bf,0xe0));var _0xfd6b=function(_0x48e8d5,_0x597845){_0x48e8d5=_0x48e8d5-0x0;var _0x593f58=_0xd6bf[_0x48e8d5];return _0x593f58;};'use strict';var multer=require(_0xfd6b('0x0'));var util=require(_0xfd6b('0x1'));var path=require(_0xfd6b('0x2'));var timeout=require(_0xfd6b('0x3'));var express=require(_0xfd6b('0x4'));var router=express[_0xfd6b('0x5')]();var fs_extra=require(_0xfd6b('0x6'));var auth=require(_0xfd6b('0x7'));var interaction=require(_0xfd6b('0x8'));var config=require(_0xfd6b('0x9'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xfd6b('0xa')](),controller[_0xfd6b('0xb')]);router['get'](_0xfd6b('0xc'),auth[_0xfd6b('0xa')](),controller['describe']);router[_0xfd6b('0xd')](_0xfd6b('0xe'),auth[_0xfd6b('0xa')](),controller['show']);router[_0xfd6b('0xd')](_0xfd6b('0xf'),auth['isAuthenticated'](),controller[_0xfd6b('0x10')]);router[_0xfd6b('0xd')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfd6b('0x11')]);router[_0xfd6b('0xd')]('/:id/in_servers',auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x12')]);router[_0xfd6b('0xd')](_0xfd6b('0x13'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x14')]);router[_0xfd6b('0xd')](_0xfd6b('0x15'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x16')]);router[_0xfd6b('0xd')](_0xfd6b('0x17'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x18')]);router[_0xfd6b('0xd')](_0xfd6b('0x19'),auth[_0xfd6b('0xa')](),controller['getMessages']);router['get'](_0xfd6b('0x1a'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x1b')]);router[_0xfd6b('0xd')](_0xfd6b('0x1c'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x1d')]);router[_0xfd6b('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfd6b('0x1f')]);router[_0xfd6b('0x1e')]('/:id/canned_answers',auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x20')]);router[_0xfd6b('0x1e')]('/',auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x21')]);router['post'](_0xfd6b('0x22'),auth['isAuthenticated'](),controller[_0xfd6b('0x23')]);router[_0xfd6b('0x1e')](_0xfd6b('0x13'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x24')]);router[_0xfd6b('0x1e')](_0xfd6b('0x15'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x25')]);router[_0xfd6b('0x1e')]('/:id/applications',auth[_0xfd6b('0xa')](),controller['addApplications']);router[_0xfd6b('0x1e')](_0xfd6b('0x26'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x27')]);router[_0xfd6b('0x1e')](_0xfd6b('0x1c'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x28')]);router[_0xfd6b('0x29')]('/:id',auth[_0xfd6b('0xa')](),controller['update']);router['delete'](_0xfd6b('0xf'),auth['isAuthenticated'](),controller[_0xfd6b('0x2a')]);router[_0xfd6b('0x2b')](_0xfd6b('0x2c'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x2d')]);router[_0xfd6b('0x2b')](_0xfd6b('0x22'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x2e')]);router[_0xfd6b('0x2b')](_0xfd6b('0x13'),auth['isAuthenticated'](),controller[_0xfd6b('0x2f')]);router[_0xfd6b('0x2b')](_0xfd6b('0xe'),auth[_0xfd6b('0xa')](),controller['destroy']);router[_0xfd6b('0x2b')](_0xfd6b('0x1c'),auth[_0xfd6b('0xa')](),controller[_0xfd6b('0x30')]);module[_0xfd6b('0x31')]=router;
\ No newline at end of file
+var _0x165d=['/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x5d3604,_0x4045ed){var _0x160775=function(_0x1bf2aa){while(--_0x1bf2aa){_0x5d3604['push'](_0x5d3604['shift']());}};_0x160775(++_0x4045ed);}(_0x165d,0x173));var _0xd165=function(_0x4c7b0f,_0x18ce47){_0x4c7b0f=_0x4c7b0f-0x0;var _0x3acd6e=_0x165d[_0x4c7b0f];return _0x3acd6e;};'use strict';var multer=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var path=require('path');var timeout=require(_0xd165('0x2'));var express=require(_0xd165('0x3'));var router=express[_0xd165('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd165('0x5'));var config=require(_0xd165('0x6'));var controller=require(_0xd165('0x7'));router['get']('/',auth[_0xd165('0x8')](),controller[_0xd165('0x9')]);router['get'](_0xd165('0xa'),auth[_0xd165('0x8')](),controller[_0xd165('0xb')]);router[_0xd165('0xc')](_0xd165('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd165('0xc')]('/:id/dispositions',auth[_0xd165('0x8')](),controller[_0xd165('0xe')]);router[_0xd165('0xc')](_0xd165('0xf'),auth[_0xd165('0x8')](),controller[_0xd165('0x10')]);router['get'](_0xd165('0x11'),auth[_0xd165('0x8')](),controller[_0xd165('0x12')]);router['get'](_0xd165('0x13'),auth[_0xd165('0x8')](),controller['getSmtp']);router[_0xd165('0xc')](_0xd165('0x14'),auth[_0xd165('0x8')](),controller[_0xd165('0x15')]);router[_0xd165('0xc')](_0xd165('0x16'),auth['isAuthenticated'](),controller[_0xd165('0x17')]);router[_0xd165('0xc')]('/:id/messages',auth[_0xd165('0x8')](),controller[_0xd165('0x18')]);router[_0xd165('0xc')](_0xd165('0x19'),auth[_0xd165('0x8')](),controller[_0xd165('0x1a')]);router[_0xd165('0xc')](_0xd165('0x1b'),auth['isAuthenticated'](),controller[_0xd165('0x1c')]);router[_0xd165('0x1d')](_0xd165('0x1e'),auth[_0xd165('0x8')](),controller[_0xd165('0x1f')]);router['post'](_0xd165('0xf'),auth[_0xd165('0x8')](),controller['addAnswer']);router[_0xd165('0x1d')]('/',auth['isAuthenticated'](),controller[_0xd165('0x20')]);router[_0xd165('0x1d')](_0xd165('0x11'),auth['isAuthenticated'](),controller[_0xd165('0x21')]);router[_0xd165('0x1d')](_0xd165('0x13'),auth[_0xd165('0x8')](),controller[_0xd165('0x22')]);router['post'](_0xd165('0x14'),auth[_0xd165('0x8')](),controller[_0xd165('0x23')]);router[_0xd165('0x1d')](_0xd165('0x16'),auth[_0xd165('0x8')](),controller[_0xd165('0x24')]);router[_0xd165('0x1d')](_0xd165('0x25'),auth[_0xd165('0x8')](),controller[_0xd165('0x26')]);router[_0xd165('0x1d')](_0xd165('0x1b'),auth[_0xd165('0x8')](),controller[_0xd165('0x27')]);router[_0xd165('0x28')]('/:id',auth[_0xd165('0x8')](),controller[_0xd165('0x29')]);router[_0xd165('0x2a')](_0xd165('0x1e'),auth[_0xd165('0x8')](),controller['removeDispositions']);router[_0xd165('0x2a')](_0xd165('0xf'),auth['isAuthenticated'](),controller[_0xd165('0x2b')]);router[_0xd165('0x2a')](_0xd165('0x11'),auth[_0xd165('0x8')](),controller['removeImap']);router['delete'](_0xd165('0x13'),auth[_0xd165('0x8')](),controller[_0xd165('0x2c')]);router[_0xd165('0x2a')](_0xd165('0xd'),auth[_0xd165('0x8')](),controller[_0xd165('0x2d')]);router[_0xd165('0x2a')](_0xd165('0x1b'),auth['isAuthenticated'](),controller[_0xd165('0x2e')]);module[_0xd165('0x2f')]=router;
\ No newline at end of file
index da1704a..b1d861e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30f3=['sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','provider','custom','getDataValue'];(function(_0x33d930,_0x560b76){var _0x3e1ddd=function(_0x40ca71){while(--_0x40ca71){_0x33d930['push'](_0x33d930['shift']());}};_0x3e1ddd(++_0x560b76);}(_0x30f3,0x18c));var _0x330f=function(_0x13f6c4,_0x3971c9){_0x13f6c4=_0x13f6c4-0x0;var _0x1cadbb=_0x30f3[_0x13f6c4];return _0x1cadbb;};'use strict';var Sequelize=require(_0x330f('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x330f('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x330f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x330f('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x330f('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x330f('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x330f('0x3')]},'markAsUnread':{'type':Sequelize[_0x330f('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x330f('0x1')],'allowNull':![],'defaultValue':_0x330f('0x4')},'fontSize':{'type':Sequelize[_0x330f('0x5')](0x2)[_0x330f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x330f('0x7');}},'notificationSound':{'type':Sequelize[_0x330f('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x330f('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x330f('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x330f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x330f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x330f('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x330f('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x330f('0x2')],'defaultValue':![],'comment':_0x330f('0x9'),'set':function(_0x223c9e){if(!_0x223c9e)this[_0x330f('0xa')](_0x330f('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x223c9e);}},'provider':{'type':Sequelize[_0x330f('0xc')](_0x330f('0xd'),_0x330f('0xe'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x330f('0xf')))return _0x330f('0x10');return this[_0x330f('0x11')](_0x330f('0xf'));},'set':function(_0x1a8f12){if(_0x1a8f12===_0x330f('0x10'))_0x1a8f12=null;return this[_0x330f('0xa')](_0x330f('0xf'),_0x1a8f12);}}};
\ No newline at end of file
+var _0xe0aa=['Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','ENUM','hotmail','getDataValue','custom','provider','STRING','BOOLEAN','TEXT'];(function(_0x16f15f,_0x486cf7){var _0xe4e321=function(_0x2d37e7){while(--_0x2d37e7){_0x16f15f['push'](_0x16f15f['shift']());}};_0xe4e321(++_0x486cf7);}(_0xe0aa,0x1aa));var _0xae0a=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xe0aa[_0xf48cce];return _0x2a5c38;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xae0a('0x0')]},'name':{'type':Sequelize[_0xae0a('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xae0a('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xae0a('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0xae0a('0x2')]},'markAsUnread':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xae0a('0x0')],'allowNull':![],'defaultValue':_0xae0a('0x3')},'fontSize':{'type':Sequelize[_0xae0a('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xae0a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xae0a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xae0a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xae0a('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xae0a('0x5')},'mandatoryDisposition':{'type':Sequelize[_0xae0a('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x31e85b){if(!_0x31e85b)this[_0xae0a('0x6')](_0xae0a('0x7'),null);this[_0xae0a('0x6')]('mandatoryDisposition',_0x31e85b);}},'provider':{'type':Sequelize[_0xae0a('0x8')]('gmail',_0xae0a('0x9'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0xae0a('0xa')]('provider'))return _0xae0a('0xb');return this[_0xae0a('0xa')](_0xae0a('0xc'));},'set':function(_0x239e2c){if(_0x239e2c===_0xae0a('0xb'))_0x239e2c=null;return this['setDataValue'](_0xae0a('0xc'),_0x239e2c);}}};
\ No newline at end of file
index 0e28815..8cbb6e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd829=['modernAuthentication','CloudProviderId','host','port','secure','service','username','password','authentication','Imap','Smtp','MailServerOut','Pause','mandatoryDispositionPause','map','type','key','keys','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','MailAccount','rows','show','MailServerIn','rawAttributes','options','find','catch','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','getDispositions','findOne','params','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','create','removeAnswers','ids','email','ListId','isNil','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','Contact','User','Owner','fullname','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','CmContact','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp-mail.outlook.com','user','pass'];(function(_0x12116a,_0x444613){var _0x4da5c6=function(_0x5b0402){while(--_0x5b0402){_0x12116a['push'](_0x12116a['shift']());}};_0x4da5c6(++_0x444613);}(_0xd829,0x148));var _0x9d82=function(_0x350854,_0x514a60){_0x350854=_0x350854-0x0;var _0x462cca=_0xd829[_0x350854];return _0x462cca;};'use strict';var moment=require(_0x9d82('0x0'));var BPromise=require('bluebird');var util=require(_0x9d82('0x1'));var path=require(_0x9d82('0x2'));var _=require(_0x9d82('0x3'));var juice=require('juice');var Redis=require(_0x9d82('0x4'));var qs=require(_0x9d82('0x5'));var logger=require(_0x9d82('0x6'))('api');var config=require('../../config/environment');var db=require(_0x9d82('0x7'))['db'];config['redis']=_['defaults'](config[_0x9d82('0x8')],{'host':_0x9d82('0x9'),'port':0x18eb});var socket=require(_0x9d82('0xa'))(new Redis(config[_0x9d82('0x8')]));require(_0x9d82('0xb'))[_0x9d82('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x75f796,_0x2390a7,_0x3b7559,_0x4830a1){return new BPromise(function(_0x213dcf,_0x4f6731){var _0x567f38=_0x4830a1||client;return _0x567f38[_0x9d82('0xd')](_0x75f796,_0x3b7559)['then'](function(_0x3a6e19){logger['info'](_0x9d82('0xe'),_0x2390a7,'request\x20sent');logger[_0x9d82('0xf')](_0x9d82('0x10'),_0x2390a7,_0x9d82('0x11'),JSON[_0x9d82('0x12')](_0x3a6e19));if(_0x3a6e19[_0x9d82('0x13')]){if(_0x3a6e19[_0x9d82('0x13')]['code']===0x1f4){logger['error'](_0x9d82('0xe'),_0x2390a7,_0x3a6e19[_0x9d82('0x13')]['message']);return _0x4f6731(_0x3a6e19[_0x9d82('0x13')][_0x9d82('0x14')]);}logger[_0x9d82('0x13')](_0x9d82('0xe'),_0x2390a7,_0x3a6e19[_0x9d82('0x13')][_0x9d82('0x14')]);return _0x213dcf(_0x3a6e19[_0x9d82('0x13')][_0x9d82('0x14')]);}else{logger[_0x9d82('0x15')](_0x9d82('0xe'),_0x2390a7,_0x9d82('0x11'));_0x213dcf(_0x3a6e19['result'][_0x9d82('0x14')]);}})['catch'](function(_0x41a8c6){logger[_0x9d82('0x13')](_0x9d82('0xe'),_0x2390a7,_0x41a8c6);_0x4f6731(_0x41a8c6);});});}function respondWithStatusCode(_0xbe0b33,_0x2020c3){_0x2020c3=_0x2020c3||0xcc;return function(_0x5593e4){if(_0x5593e4){return _0xbe0b33[_0x9d82('0x16')](_0x2020c3);}return _0xbe0b33[_0x9d82('0x17')](_0x2020c3)[_0x9d82('0x18')]();};}function respondWithResult(_0x220dfc,_0xddf8fd){_0xddf8fd=_0xddf8fd||0xc8;return function(_0x4bee70){if(_0x4bee70){return _0x220dfc['status'](_0xddf8fd)[_0x9d82('0x19')](_0x4bee70);}};}function respondWithFilteredResult(_0x52f737,_0x2230ac){return function(_0x5ed040){if(_0x5ed040){var _0x5cba8e=typeof _0x2230ac[_0x9d82('0x1a')]===_0x9d82('0x1b')&&typeof _0x2230ac[_0x9d82('0x1c')]==='undefined';var _0x36d502=_0x5ed040[_0x9d82('0x1d')];var _0x581fcb=_0x5cba8e?0x0:_0x2230ac[_0x9d82('0x1a')];var _0xdd6ea3=_0x5cba8e?_0x5ed040[_0x9d82('0x1d')]:_0x2230ac[_0x9d82('0x1a')]+_0x2230ac[_0x9d82('0x1c')];var _0x5c6726;if(_0xdd6ea3>=_0x36d502){_0xdd6ea3=_0x36d502;_0x5c6726=0xc8;}else{_0x5c6726=0xce;}_0x52f737['status'](_0x5c6726);return _0x52f737[_0x9d82('0x1e')](_0x9d82('0x1f'),_0x581fcb+'-'+_0xdd6ea3+'/'+_0x36d502)['json'](_0x5ed040);}return null;};}function saveUpdates(_0x389f2a){return function(_0x2267cc){if(_0x2267cc){return _0x2267cc[_0x9d82('0x20')](_0x389f2a)[_0x9d82('0x21')](function(_0x4ffeb5){return _0x4ffeb5;});}return null;};}function removeEntity(_0x5a312a){return function(_0x1c8aa3){if(_0x1c8aa3){return _0x1c8aa3[_0x9d82('0x22')]()['then'](function(){var _0x290cc4=_0x1c8aa3['get']({'plain':!![]});var _0x217312='MailAccounts';return db['UserProfileResource'][_0x9d82('0x22')]({'where':{'type':_0x217312,'resourceId':_0x290cc4['id']}})['then'](function(){return _0x1c8aa3;});})[_0x9d82('0x21')](function(){_0x5a312a[_0x9d82('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40decf){return function(_0xe3c6db){if(!_0xe3c6db){_0x40decf[_0x9d82('0x16')](0x194);}return _0xe3c6db;};}function handleError(_0x40e2d9,_0x52bfa6){_0x52bfa6=_0x52bfa6||0x1f4;return function(_0x539656){logger[_0x9d82('0x13')](_0x539656[_0x9d82('0x23')]);if(_0x539656[_0x9d82('0x24')]){delete _0x539656[_0x9d82('0x24')];}_0x40e2d9[_0x9d82('0x17')](_0x52bfa6)[_0x9d82('0x25')](_0x539656);};}function getImapHost(_0x382a44){switch(_0x382a44){case'gmail':return _0x9d82('0x26');case _0x9d82('0x27'):return _0x9d82('0x28');case _0x9d82('0x29'):return _0x9d82('0x2a');case _0x9d82('0x2b'):return _0x9d82('0x2c');}throw new Error(_0x9d82('0x2d'),_0x382a44);}function getSmtpHost(_0x385b33){switch(_0x385b33){case _0x9d82('0x2e'):return'smtp.gmail.com';case'yahoo':return'smtp.mail.yahoo.com';case'hotmail':return _0x9d82('0x2f');case _0x9d82('0x2b'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x385b33);}function getAuthenticationOptions(_0x41e33d,_0x4abb0c){var _0x3796b8={};var _0x10384f={};if(_0x41e33d){_0x3796b8['user']=_0x10384f[_0x9d82('0x30')]=_0x4abb0c['username'];_0x3796b8['password']=_0x10384f[_0x9d82('0x31')]=_0x4abb0c['password'];if(_0x4abb0c[_0x9d82('0x32')]){_0x3796b8[_0x9d82('0x32')]=_0x10384f[_0x9d82('0x32')]=!![];_0x3796b8[_0x9d82('0x33')]=_0x10384f[_0x9d82('0x33')]=_0x4abb0c['CloudProviderId'];_0x3796b8['password']=_0x10384f[_0x9d82('0x31')]=null;}else{_0x3796b8['CloudProviderId']=_0x10384f[_0x9d82('0x33')]=null;}_0x3796b8[_0x9d82('0x34')]=getImapHost(_0x41e33d);_0x3796b8['port']=0x3e1;_0x10384f[_0x9d82('0x34')]=getSmtpHost(_0x41e33d);_0x10384f[_0x9d82('0x35')]=0x24b;_0x10384f[_0x9d82('0x36')]=![];_0x3796b8[_0x9d82('0x37')]=_0x10384f[_0x9d82('0x37')]=null;}else{if(_0x4abb0c['authentication']){_0x3796b8[_0x9d82('0x30')]=_0x10384f[_0x9d82('0x30')]=_0x4abb0c[_0x9d82('0x38')];_0x3796b8['password']=_0x10384f[_0x9d82('0x31')]=_0x4abb0c[_0x9d82('0x39')];}else{_0x3796b8['authentication']=_0x10384f[_0x9d82('0x3a')]=![];_0x3796b8[_0x9d82('0x30')]=_0x10384f[_0x9d82('0x30')]=null;_0x3796b8[_0x9d82('0x39')]=_0x10384f['pass']=null;}_0x3796b8[_0x9d82('0x34')]=_0x4abb0c[_0x9d82('0x3b')][_0x9d82('0x34')];_0x3796b8[_0x9d82('0x35')]=_0x4abb0c['Imap'][_0x9d82('0x35')];_0x10384f['host']=_0x4abb0c[_0x9d82('0x3c')][_0x9d82('0x34')];_0x10384f['port']=_0x4abb0c[_0x9d82('0x3c')][_0x9d82('0x35')];}return{'Imap':_0x3796b8,'Smtp':_0x10384f};}exports['index']=function(_0x5f1e4d,_0x247360){var _0x32b4c7={'include':[{'model':db['MailServerIn'],'as':_0x9d82('0x3b')},{'model':db[_0x9d82('0x3d')],'as':_0x9d82('0x3c')},{'model':db[_0x9d82('0x3e')],'as':_0x9d82('0x3f')}]},_0x48aea6={},_0x5da2b9={'count':0x0,'rows':[]};var _0x41a5a2=_[_0x9d82('0x40')](db['MailAccount']['rawAttributes'],function(_0x12da95){return{'name':_0x12da95['fieldName'],'type':_0x12da95[_0x9d82('0x41')][_0x9d82('0x42')]};});_0x48aea6['model']=_[_0x9d82('0x40')](_0x41a5a2,'name');_0x48aea6['query']=_[_0x9d82('0x43')](_0x5f1e4d['query']);_0x48aea6['filters']=_['intersection'](_0x48aea6[_0x9d82('0x44')],_0x48aea6['query']);_0x32b4c7[_0x9d82('0x45')]=_[_0x9d82('0x46')](_0x48aea6[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x5f1e4d[_0x9d82('0x48')][_0x9d82('0x47')]));_0x32b4c7[_0x9d82('0x45')]=_0x32b4c7['attributes'][_0x9d82('0x49')]?_0x32b4c7[_0x9d82('0x45')]:_0x48aea6[_0x9d82('0x44')];if(!_0x5f1e4d[_0x9d82('0x48')][_0x9d82('0x4a')](_0x9d82('0x4b'))){_0x32b4c7[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x5f1e4d[_0x9d82('0x48')][_0x9d82('0x1c')]);_0x32b4c7[_0x9d82('0x1a')]=qs[_0x9d82('0x1a')](_0x5f1e4d[_0x9d82('0x48')]['offset']);}_0x32b4c7[_0x9d82('0x4c')]=qs[_0x9d82('0x4d')](_0x5f1e4d[_0x9d82('0x48')]['sort']);_0x32b4c7['where']=qs[_0x9d82('0x4e')](_[_0x9d82('0x4f')](_0x5f1e4d[_0x9d82('0x48')],_0x48aea6[_0x9d82('0x4e')]),_0x41a5a2);if(_0x5f1e4d[_0x9d82('0x48')]['filter']){_0x32b4c7[_0x9d82('0x50')]=_[_0x9d82('0x51')](_0x32b4c7[_0x9d82('0x50')],{'$or':_['map'](_0x41a5a2,function(_0x437f27){if(_0x437f27['type']!==_0x9d82('0x52')){var _0x179c2={};_0x179c2[_0x437f27[_0x9d82('0x24')]]={'$like':'%'+_0x5f1e4d['query'][_0x9d82('0x53')]+'%'};return _0x179c2;}})});}_0x32b4c7=_[_0x9d82('0x51')]({},_0x32b4c7,_0x5f1e4d['options']);var _0x4ccd6c={'where':_0x32b4c7[_0x9d82('0x50')]};return db['MailAccount'][_0x9d82('0x1d')](_0x4ccd6c)['then'](function(_0x3f9a2a){_0x5da2b9[_0x9d82('0x1d')]=_0x3f9a2a;if(_0x5f1e4d['query'][_0x9d82('0x54')]){_0x32b4c7[_0x9d82('0x55')]=[{'all':!![]}];}return db[_0x9d82('0x56')]['findAll'](_0x32b4c7);})[_0x9d82('0x21')](function(_0x1ebfa1){_0x5da2b9[_0x9d82('0x57')]=_0x1ebfa1;return _0x5da2b9;})['then'](respondWithFilteredResult(_0x247360,_0x32b4c7))['catch'](handleError(_0x247360,null));};exports[_0x9d82('0x58')]=function(_0x190248,_0x521007){var _0x2d39e3={'raw':![],'where':{'id':_0x190248['params']['id']},'include':[{'model':db[_0x9d82('0x59')],'as':_0x9d82('0x3b')},{'model':db[_0x9d82('0x3d')],'as':_0x9d82('0x3c')},{'model':db[_0x9d82('0x3e')],'as':_0x9d82('0x3f')}]},_0x4c8e8e={};_0x4c8e8e[_0x9d82('0x44')]=_['keys'](db[_0x9d82('0x56')][_0x9d82('0x5a')]);_0x4c8e8e[_0x9d82('0x48')]=_[_0x9d82('0x43')](_0x190248[_0x9d82('0x48')]);_0x4c8e8e[_0x9d82('0x4e')]=_[_0x9d82('0x46')](_0x4c8e8e['model'],_0x4c8e8e['query']);_0x2d39e3[_0x9d82('0x45')]=_[_0x9d82('0x46')](_0x4c8e8e['model'],qs['fields'](_0x190248[_0x9d82('0x48')][_0x9d82('0x47')]));_0x2d39e3[_0x9d82('0x45')]=_0x2d39e3[_0x9d82('0x45')]['length']?_0x2d39e3[_0x9d82('0x45')]:_0x4c8e8e['model'];if(_0x190248[_0x9d82('0x48')]['includeAll']){_0x2d39e3[_0x9d82('0x55')]=[{'all':!![]}];}_0x2d39e3=_[_0x9d82('0x51')]({},_0x2d39e3,_0x190248[_0x9d82('0x5b')]);return db[_0x9d82('0x56')][_0x9d82('0x5c')](_0x2d39e3)[_0x9d82('0x21')](handleEntityNotFound(_0x521007,null))[_0x9d82('0x21')](respondWithResult(_0x521007,null))[_0x9d82('0x5d')](handleError(_0x521007,null));};exports[_0x9d82('0x20')]=function(_0x164622,_0x458ce8){if(_0x164622[_0x9d82('0x5e')]['id']){delete _0x164622[_0x9d82('0x5e')]['id'];}var _0x454bae=_0x164622['body'][_0x9d82('0x5f')]===_0x9d82('0x60')?null:_0x164622['body'][_0x9d82('0x5f')];var _0x3b42bb=_0x164622[_0x9d82('0x5e')][_0x9d82('0x3b')]||{};var _0x2e86be=_0x164622[_0x9d82('0x5e')][_0x9d82('0x3c')]||{};if(_0x454bae){_0x3b42bb[_0x9d82('0x34')]=getImapHost(_0x454bae);_0x3b42bb['port']=0x3e1;_0x2e86be[_0x9d82('0x34')]=getSmtpHost(_0x454bae);_0x2e86be[_0x9d82('0x35')]=0x24b;_0x2e86be[_0x9d82('0x36')]=![];}if(_0x2e86be[_0x9d82('0x32')]){_0x2e86be[_0x9d82('0x36')]=![];}else{_0x2e86be[_0x9d82('0x33')]=null;}if(!_0x3b42bb[_0x9d82('0x32')])_0x3b42bb['CloudProviderId']=null;_0x164622['body']['Imap']=_0x3b42bb;_0x164622[_0x9d82('0x5e')][_0x9d82('0x3c')]=_0x2e86be;return db[_0x9d82('0x56')]['find']({'where':{'id':_0x164622['params']['id']},'include':[{'model':db[_0x9d82('0x59')],'as':_0x9d82('0x3b')},{'model':db[_0x9d82('0x3d')],'as':_0x9d82('0x3c')},{'model':db['Pause'],'as':_0x9d82('0x3f')}]})[_0x9d82('0x21')](handleEntityNotFound(_0x458ce8,null))['then'](function(_0x52b74b){if(!_0x52b74b)throw new Error(_0x9d82('0x61'));if(_0x52b74b[_0x9d82('0x37')])delete _0x164622[_0x9d82('0x5e')]['Imap'];return _0x52b74b;})['then'](saveUpdates(_0x164622[_0x9d82('0x5e')],null))[_0x9d82('0x21')](function(_0x3d3280){if(!_0x164622[_0x9d82('0x5e')][_0x9d82('0x3b')])return _0x3d3280;return db['MailServerIn']['update'](_0x164622['body']['Imap'],{'where':{'MailAccountId':_0x3d3280['id']}})['then'](function(){return _0x3d3280;});})[_0x9d82('0x21')](function(_0x304b98){if(!_0x164622[_0x9d82('0x5e')]['Smtp'])return _0x304b98;return db[_0x9d82('0x3d')][_0x9d82('0x20')](_0x164622[_0x9d82('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x304b98['id']}})['then'](function(){return _0x304b98;});})[_0x9d82('0x21')](respondWithResult(_0x458ce8,null))[_0x9d82('0x5d')](handleError(_0x458ce8,null));};exports[_0x9d82('0x62')]=function(_0x5b5a58,_0x2bb184){return db[_0x9d82('0x56')]['describe']()[_0x9d82('0x21')](respondWithResult(_0x2bb184,null))[_0x9d82('0x5d')](handleError(_0x2bb184,null));};exports[_0x9d82('0x63')]=function(_0x5674aa,_0xe735e){if(_0x5674aa[_0x9d82('0x5e')]['id']){delete _0x5674aa['body']['id'];}return db['MailAccount'][_0x9d82('0x5c')]({'where':{'id':_0x5674aa['params']['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0xe735e,null))['then'](function(_0x3014bc){if(_0x3014bc){_0x5674aa['body'][_0x9d82('0x64')]=_0x3014bc['id'];return db['Disposition']['create'](_0x5674aa[_0x9d82('0x5e')]);}})[_0x9d82('0x21')](respondWithResult(_0xe735e,null))[_0x9d82('0x5d')](handleError(_0xe735e,null));};exports[_0x9d82('0x65')]=function(_0x45a963,_0x277568){var _0x5d2c6f={'raw':![],'where':{}};var _0x5dae57={};var _0x779197={'count':0x0,'rows':[]};return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x45a963[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x277568,null))['then'](function(_0x3624fa){if(_0x3624fa){_0x5dae57['model']=_[_0x9d82('0x43')](db[_0x9d82('0x68')][_0x9d82('0x5a')]);_0x5dae57[_0x9d82('0x48')]=_[_0x9d82('0x43')](_0x45a963[_0x9d82('0x48')]);_0x5dae57['filters']=_['intersection'](_0x5dae57[_0x9d82('0x44')],_0x5dae57['query']);_0x5d2c6f[_0x9d82('0x45')]=_[_0x9d82('0x46')](_0x5dae57[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x45a963[_0x9d82('0x48')][_0x9d82('0x47')]));_0x5d2c6f[_0x9d82('0x45')]=_0x5d2c6f[_0x9d82('0x45')][_0x9d82('0x49')]?_0x5d2c6f[_0x9d82('0x45')]:_0x5dae57[_0x9d82('0x44')];if(!_0x45a963[_0x9d82('0x48')][_0x9d82('0x4a')]('nolimit')){_0x5d2c6f['limit']=qs['limit'](_0x45a963[_0x9d82('0x48')][_0x9d82('0x1c')]);_0x5d2c6f[_0x9d82('0x1a')]=qs['offset'](_0x45a963[_0x9d82('0x48')][_0x9d82('0x1a')]);}_0x5d2c6f[_0x9d82('0x4c')]=qs[_0x9d82('0x4d')](_0x45a963[_0x9d82('0x48')][_0x9d82('0x4d')]);_0x5d2c6f[_0x9d82('0x50')]=qs[_0x9d82('0x4e')](_[_0x9d82('0x4f')](_0x45a963[_0x9d82('0x48')],_0x5dae57['filters']));_0x5d2c6f[_0x9d82('0x50')][_0x9d82('0x64')]=_0x3624fa['id'];if(_0x45a963[_0x9d82('0x48')]['filter']){_0x5d2c6f[_0x9d82('0x50')]=_[_0x9d82('0x51')](_0x5d2c6f['where'],{'$or':_[_0x9d82('0x40')](_0x5d2c6f[_0x9d82('0x45')],function(_0x58f614){var _0x563e31={};_0x563e31[_0x58f614]={'$like':'%'+_0x45a963[_0x9d82('0x48')][_0x9d82('0x53')]+'%'};return _0x563e31;})});}_0x5d2c6f=_[_0x9d82('0x51')]({},_0x5d2c6f,_0x45a963[_0x9d82('0x5b')]);return db['Disposition'][_0x9d82('0x1d')]({'where':_0x5d2c6f[_0x9d82('0x50')]})[_0x9d82('0x21')](function(_0x3efb99){_0x779197[_0x9d82('0x1d')]=_0x3efb99;if(_0x45a963[_0x9d82('0x48')][_0x9d82('0x54')]){_0x5d2c6f[_0x9d82('0x55')]=[{'all':!![]}];}return db[_0x9d82('0x68')][_0x9d82('0x69')](_0x5d2c6f);})[_0x9d82('0x21')](function(_0x412fc3){_0x779197[_0x9d82('0x57')]=_0x412fc3;return _0x779197;});}})[_0x9d82('0x21')](respondWithFilteredResult(_0x277568,_0x5d2c6f))[_0x9d82('0x5d')](handleError(_0x277568,null));};exports['removeDispositions']=function(_0x2a26c5,_0x373c25){return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x2a26c5[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x373c25,null))[_0x9d82('0x21')](function(_0x53ae44){if(_0x53ae44){return _0x53ae44[_0x9d82('0x6a')](_0x2a26c5['query']['ids']);}})[_0x9d82('0x21')](respondWithStatusCode(_0x373c25,null))[_0x9d82('0x5d')](handleError(_0x373c25,null));};exports[_0x9d82('0x6b')]=function(_0x32e64d,_0x3f8a32){if(_0x32e64d[_0x9d82('0x5e')]['id']){delete _0x32e64d[_0x9d82('0x5e')]['id'];}return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x32e64d[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x3f8a32,null))[_0x9d82('0x21')](function(_0x1b6abb){if(_0x1b6abb){_0x32e64d[_0x9d82('0x5e')]['MailAccountId']=_0x1b6abb['id'];return db[_0x9d82('0x6c')][_0x9d82('0x6d')](_0x32e64d[_0x9d82('0x5e')]);}})[_0x9d82('0x21')](respondWithResult(_0x3f8a32,null))[_0x9d82('0x5d')](handleError(_0x3f8a32,null));};exports['getAnswers']=function(_0x3432e3,_0x17bd41){var _0x54079a={'raw':![],'where':{}};var _0x450b70={};var _0x139b10={'count':0x0,'rows':[]};return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x3432e3[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x17bd41,null))[_0x9d82('0x21')](function(_0x2cf09b){if(_0x2cf09b){_0x450b70['model']=_[_0x9d82('0x43')](db['CannedAnswer'][_0x9d82('0x5a')]);_0x450b70[_0x9d82('0x48')]=_[_0x9d82('0x43')](_0x3432e3[_0x9d82('0x48')]);_0x450b70[_0x9d82('0x4e')]=_[_0x9d82('0x46')](_0x450b70['model'],_0x450b70['query']);_0x54079a[_0x9d82('0x45')]=_[_0x9d82('0x46')](_0x450b70[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x3432e3['query'][_0x9d82('0x47')]));_0x54079a[_0x9d82('0x45')]=_0x54079a[_0x9d82('0x45')][_0x9d82('0x49')]?_0x54079a[_0x9d82('0x45')]:_0x450b70[_0x9d82('0x44')];if(!_0x3432e3['query'][_0x9d82('0x4a')](_0x9d82('0x4b'))){_0x54079a[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x3432e3[_0x9d82('0x48')][_0x9d82('0x1c')]);_0x54079a['offset']=qs[_0x9d82('0x1a')](_0x3432e3[_0x9d82('0x48')][_0x9d82('0x1a')]);}_0x54079a['order']=qs['sort'](_0x3432e3['query'][_0x9d82('0x4d')]);_0x54079a['where']=qs['filters'](_['pick'](_0x3432e3[_0x9d82('0x48')],_0x450b70['filters']));_0x54079a[_0x9d82('0x50')][_0x9d82('0x64')]=_0x2cf09b['id'];if(_0x3432e3[_0x9d82('0x48')][_0x9d82('0x53')]){_0x54079a[_0x9d82('0x50')]=_[_0x9d82('0x51')](_0x54079a[_0x9d82('0x50')],{'$or':_['map'](_0x54079a[_0x9d82('0x45')],function(_0x55cb2d){var _0x504b02={};_0x504b02[_0x55cb2d]={'$like':'%'+_0x3432e3[_0x9d82('0x48')]['filter']+'%'};return _0x504b02;})});}_0x54079a=_[_0x9d82('0x51')]({},_0x54079a,_0x3432e3[_0x9d82('0x5b')]);return db['CannedAnswer'][_0x9d82('0x1d')]({'where':_0x54079a['where']})[_0x9d82('0x21')](function(_0x97997c){_0x139b10[_0x9d82('0x1d')]=_0x97997c;if(_0x3432e3[_0x9d82('0x48')][_0x9d82('0x54')]){_0x54079a[_0x9d82('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x54079a);})[_0x9d82('0x21')](function(_0x39a956){_0x139b10[_0x9d82('0x57')]=_0x39a956;return _0x139b10;});}})[_0x9d82('0x21')](respondWithFilteredResult(_0x17bd41,_0x54079a))[_0x9d82('0x5d')](handleError(_0x17bd41,null));};exports['removeAnswers']=function(_0x38fd7c,_0x42cc01){return db[_0x9d82('0x56')]['find']({'where':{'id':_0x38fd7c[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x42cc01,null))[_0x9d82('0x21')](function(_0x3a4cc2){if(_0x3a4cc2){return _0x3a4cc2[_0x9d82('0x6e')](_0x38fd7c[_0x9d82('0x48')][_0x9d82('0x6f')]);}})[_0x9d82('0x21')](respondWithStatusCode(_0x42cc01,null))[_0x9d82('0x5d')](handleError(_0x42cc01,null));};exports[_0x9d82('0x6d')]=function(_0xc8651d,_0x4bed54){var _0x5eea69={'name':_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x24')],'key':_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x42')],'provider':_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x5f')]===_0x9d82('0x60')?null:_0xc8651d['body'][_0x9d82('0x5f')],'email':_0xc8651d['body'][_0x9d82('0x70')],'ListId':_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x71')],'active':!_[_0x9d82('0x72')](_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x73')])?_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x73')]:!![],'description':_0xc8651d[_0x9d82('0x5e')][_0x9d82('0x74')]||null};var _0x24c70f=getAuthenticationOptions(_0x5eea69[_0x9d82('0x5f')],_0xc8651d[_0x9d82('0x5e')]);_0x5eea69[_0x9d82('0x3b')]=_0x24c70f['Imap'];_0x5eea69[_0x9d82('0x3c')]=_0x24c70f['Smtp'];return db[_0x9d82('0x56')][_0x9d82('0x6d')](_0x5eea69,{'include':[{'model':db['MailServerOut'],'as':_0x9d82('0x3c')},{'model':db[_0x9d82('0x59')],'as':_0x9d82('0x3b')}]})[_0x9d82('0x21')](function(_0x47d4d5){var _0xf4f57=_0xc8651d[_0x9d82('0x30')][_0x9d82('0x75')]({'plain':!![]});if(!_0xf4f57)throw new Error(_0x9d82('0x76'));if(_0xf4f57[_0x9d82('0x77')]===_0x9d82('0x30')){var _0x2bc117=_0x47d4d5[_0x9d82('0x75')]({'plain':!![]});return db[_0x9d82('0x78')][_0x9d82('0x5c')]({'where':{'name':_0x9d82('0x79'),'userProfileId':_0xf4f57[_0x9d82('0x7a')]},'raw':!![]})[_0x9d82('0x21')](function(_0x2bf9b5){if(_0x2bf9b5&&_0x2bf9b5[_0x9d82('0x7b')]===0x0){return db[_0x9d82('0x7c')][_0x9d82('0x6d')]({'name':_0x2bc117['name'],'resourceId':_0x2bc117['id'],'type':_0x2bf9b5[_0x9d82('0x24')],'sectionId':_0x2bf9b5['id']},{})[_0x9d82('0x21')](function(){return _0x47d4d5;});}else{return _0x47d4d5;}})['catch'](function(_0x322895){logger[_0x9d82('0x13')](_0x9d82('0x7d'),_0x322895);throw _0x322895;});}return _0x47d4d5;})[_0x9d82('0x21')](respondWithResult(_0x4bed54,0xc9))[_0x9d82('0x5d')](handleError(_0x4bed54,null));};exports['getImap']=function(_0x387c4f,_0x3c5ce2){return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x387c4f[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x3c5ce2,null))[_0x9d82('0x21')](function(_0x1d5445){if(_0x1d5445){return _0x1d5445['getImap']();}return null;})['then'](respondWithResult(_0x3c5ce2,null))['catch'](handleError(_0x3c5ce2,null));};exports[_0x9d82('0x7e')]=function(_0x20b856,_0x535c32){if(_0x20b856[_0x9d82('0x5e')]['id']){delete _0x20b856[_0x9d82('0x5e')]['id'];}return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x20b856[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x535c32,null))['then'](function(_0x406eb9){if(_0x406eb9){_0x20b856[_0x9d82('0x5e')][_0x9d82('0x64')]=_0x406eb9['id'];return db[_0x9d82('0x59')][_0x9d82('0x6d')](_0x20b856['body']);}})[_0x9d82('0x21')](respondWithResult(_0x535c32,null))[_0x9d82('0x5d')](handleError(_0x535c32,null));};exports[_0x9d82('0x7f')]=function(_0x46fea8,_0x7beb6e){return db['MailAccount']['findOne']({'where':{'id':_0x46fea8[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x7beb6e,null))[_0x9d82('0x21')](function(_0x1c320e){if(_0x1c320e){return _0x1c320e['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x7beb6e,null))[_0x9d82('0x5d')](handleError(_0x7beb6e,null));};exports[_0x9d82('0x80')]=function(_0xbeacff,_0x4f2266){return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0xbeacff[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x4f2266,null))[_0x9d82('0x21')](function(_0x41f5bc){if(_0x41f5bc){return _0x41f5bc['getSmtp']();}return null;})[_0x9d82('0x21')](respondWithResult(_0x4f2266,null))[_0x9d82('0x5d')](handleError(_0x4f2266,null));};exports[_0x9d82('0x81')]=function(_0x59b4d2,_0x3586c3){if(_0x59b4d2[_0x9d82('0x5e')]['id']){delete _0x59b4d2['body']['id'];}return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x59b4d2[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x3586c3,null))[_0x9d82('0x21')](function(_0x277760){if(_0x277760){_0x59b4d2['body']['MailAccountId']=_0x277760['id'];return db[_0x9d82('0x3d')]['create'](_0x59b4d2[_0x9d82('0x5e')]);}})[_0x9d82('0x21')](respondWithResult(_0x3586c3,null))[_0x9d82('0x5d')](handleError(_0x3586c3,null));};exports['removeSmtp']=function(_0x17dcfc,_0x2491e3){return db['MailAccount'][_0x9d82('0x66')]({'where':{'id':_0x17dcfc[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x2491e3,null))[_0x9d82('0x21')](function(_0xcf6a20){if(_0xcf6a20){return _0xcf6a20[_0x9d82('0x82')](null);}return null;})[_0x9d82('0x21')](respondWithStatusCode(_0x2491e3,null))[_0x9d82('0x5d')](handleError(_0x2491e3,null));};exports[_0x9d82('0x83')]=function(_0x18ec5e,_0x13cfde){return db['MailInteraction']['find']({'where':{'id':_0x18ec5e[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x13cfde,null))[_0x9d82('0x21')](function(_0x1d0938){if(_0x1d0938){return _0x1d0938['addInteraction'](_0x18ec5e[_0x9d82('0x5e')][_0x9d82('0x6f')],_[_0x9d82('0x84')](_0x18ec5e[_0x9d82('0x5e')],[_0x9d82('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x13cfde,null))[_0x9d82('0x5d')](handleError(_0x13cfde,null));};exports[_0x9d82('0x85')]=function(_0x56efde,_0x319c6e){var _0x1298cb={'raw':![],'where':{}};var _0x4e535f={};var _0x315a83={'count':0x0,'rows':[]};return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x56efde[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x319c6e,null))[_0x9d82('0x21')](function(_0x348ac9){if(_0x348ac9){_0x4e535f['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x4e535f[_0x9d82('0x48')]=_[_0x9d82('0x43')](_0x56efde[_0x9d82('0x48')]);_0x4e535f[_0x9d82('0x4e')]=_['intersection'](_0x4e535f[_0x9d82('0x44')],_0x4e535f[_0x9d82('0x48')]);_0x1298cb['attributes']=_[_0x9d82('0x46')](_0x4e535f[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x56efde[_0x9d82('0x48')][_0x9d82('0x47')]));_0x1298cb[_0x9d82('0x45')]=_0x1298cb[_0x9d82('0x45')][_0x9d82('0x49')]?_0x1298cb['attributes']:_0x4e535f[_0x9d82('0x44')];if(!_0x56efde[_0x9d82('0x48')][_0x9d82('0x4a')](_0x9d82('0x4b'))){_0x1298cb[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x56efde[_0x9d82('0x48')][_0x9d82('0x1c')]);_0x1298cb[_0x9d82('0x1a')]=qs[_0x9d82('0x1a')](_0x56efde['query'][_0x9d82('0x1a')]);}_0x1298cb[_0x9d82('0x4c')]=qs[_0x9d82('0x4d')](_0x56efde[_0x9d82('0x48')][_0x9d82('0x4d')]);_0x1298cb[_0x9d82('0x50')]=qs[_0x9d82('0x4e')](_['pick'](_0x56efde[_0x9d82('0x48')],_0x4e535f[_0x9d82('0x4e')]));_0x1298cb[_0x9d82('0x50')][_0x9d82('0x64')]=_0x348ac9['id'];if(_0x56efde[_0x9d82('0x48')][_0x9d82('0x53')]){_0x1298cb[_0x9d82('0x50')]=_['merge'](_0x1298cb['where'],{'$or':_[_0x9d82('0x40')](_0x1298cb[_0x9d82('0x45')],function(_0x42c04d){var _0x4a89da={};_0x4a89da[_0x42c04d]={'$like':'%'+_0x56efde[_0x9d82('0x48')][_0x9d82('0x53')]+'%'};return _0x4a89da;})});}_0x1298cb=_[_0x9d82('0x51')]({},_0x1298cb,_0x56efde[_0x9d82('0x5b')]);return db[_0x9d82('0x86')][_0x9d82('0x1d')]({'where':_0x1298cb['where']})[_0x9d82('0x21')](function(_0x431a14){_0x315a83[_0x9d82('0x1d')]=_0x431a14;if(_0x56efde[_0x9d82('0x48')]['includeAll']){_0x1298cb[_0x9d82('0x55')]=[{'model':db['CmContact'],'as':_0x9d82('0x87'),'required':![]},{'model':db[_0x9d82('0x88')],'as':_0x9d82('0x89'),'attributes':[_0x9d82('0x24'),_0x9d82('0x8a'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9d82('0x24'),_0x9d82('0x8b')],'where':_0x56efde[_0x9d82('0x48')]['tag']?{'id':_0x56efde[_0x9d82('0x48')][_0x9d82('0x8c')]}:undefined,'required':_0x56efde[_0x9d82('0x48')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x9d82('0x69')](_0x1298cb);})[_0x9d82('0x21')](function(_0x48dc8b){_0x315a83[_0x9d82('0x57')]=_0x48dc8b;return _0x315a83;});}})[_0x9d82('0x21')](respondWithFilteredResult(_0x319c6e,_0x1298cb))[_0x9d82('0x5d')](handleError(_0x319c6e,null));};exports[_0x9d82('0x8d')]=function addApplications(_0x25055a,_0x501d6a){var _0x118e1f=_0x25055a[_0x9d82('0x67')]['id'];var _0x3df27e=_0x25055a['body'];var _0x40d669=0xc8;var _0xcd1be7=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9d82('0x8e')]['Transaction'][_0x9d82('0x8f')][_0x9d82('0x90')]},function(_0x10eb26){return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x118e1f},'transaction':_0x10eb26})[_0x9d82('0x21')](function(_0x3aed12){if(_0x3aed12){return db[_0x9d82('0x91')][_0x9d82('0x22')]({'where':{'MailAccountId':_0x118e1f},'transaction':_0x10eb26})['then'](function(){var _0x2831e3=_['map'](_0x3df27e,function(_0x53855c){_0x53855c['MailAccountId']=_0x118e1f;return _0x53855c;});return db[_0x9d82('0x91')][_0x9d82('0x92')](_0x2831e3,{'transaction':_0x10eb26});});}else{_0x40d669=0x194;_0xcd1be7=[];}});})[_0x9d82('0x21')](function(){if(_0x40d669!==0x194){return db['MailApplication'][_0x9d82('0x93')]({'where':{'MailAccountId':_0x118e1f},'order':'priority'})[_0x9d82('0x21')](function(_0x877e67){_0xcd1be7=_0x877e67;});}})[_0x9d82('0x5d')](function(_0x6ac060){_0x40d669=0x1f4;logger[_0x9d82('0x13')](_0x6ac060[_0x9d82('0x23')]);if(_0x6ac060['name']){delete _0x6ac060[_0x9d82('0x24')];}_0xcd1be7=_0x6ac060;})[_0x9d82('0x94')](function(){if(_0xcd1be7===null){_0x501d6a['sendStatus'](_0x40d669);}else{if(_0x40d669===0x1f4){_0x501d6a[_0x9d82('0x17')](_0x40d669)[_0x9d82('0x25')](_0xcd1be7);}else{_0x501d6a[_0x9d82('0x17')](_0x40d669)[_0x9d82('0x19')](_0xcd1be7);}}});};exports[_0x9d82('0x95')]=function(_0x50482b,_0xd56f9e){var _0x2a15ff={};var _0x4d0000={};var _0x5d837f;var _0x7e977;return db[_0x9d82('0x56')]['findOne']({'where':{'id':_0x50482b[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0xd56f9e,null))[_0x9d82('0x21')](function(_0x5b8875){if(_0x5b8875){_0x5d837f=_0x5b8875;_0x4d0000[_0x9d82('0x44')]=_[_0x9d82('0x43')](db['MailApplication'][_0x9d82('0x5a')]);_0x4d0000[_0x9d82('0x48')]=_['keys'](_0x50482b[_0x9d82('0x48')]);_0x4d0000[_0x9d82('0x4e')]=_[_0x9d82('0x46')](_0x4d0000[_0x9d82('0x44')],_0x4d0000[_0x9d82('0x48')]);_0x2a15ff[_0x9d82('0x45')]=_['intersection'](_0x4d0000[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x50482b[_0x9d82('0x48')][_0x9d82('0x47')]));_0x2a15ff['attributes']=_0x2a15ff['attributes']['length']?_0x2a15ff[_0x9d82('0x45')]:_0x4d0000[_0x9d82('0x44')];_0x2a15ff['order']=qs[_0x9d82('0x4d')](_0x50482b[_0x9d82('0x48')]['sort']);_0x2a15ff[_0x9d82('0x50')]=qs[_0x9d82('0x4e')](_[_0x9d82('0x4f')](_0x50482b[_0x9d82('0x48')],_0x4d0000[_0x9d82('0x4e')]));if(_0x50482b[_0x9d82('0x48')][_0x9d82('0x53')]){_0x2a15ff[_0x9d82('0x50')]=_[_0x9d82('0x51')](_0x2a15ff[_0x9d82('0x50')],{'$or':_[_0x9d82('0x40')](_0x2a15ff[_0x9d82('0x45')],function(_0x25e676){var _0x432569={};_0x432569[_0x25e676]={'$like':'%'+_0x50482b['query'][_0x9d82('0x53')]+'%'};return _0x432569;})});}_0x2a15ff=_['merge']({},_0x2a15ff,_0x50482b[_0x9d82('0x5b')]);return _0x5d837f[_0x9d82('0x95')](_0x2a15ff);}})['then'](function(_0x3f3023){if(_0x3f3023){_0x7e977=_0x3f3023['length'];if(!_0x50482b[_0x9d82('0x48')][_0x9d82('0x4a')]('nolimit')){_0x2a15ff[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x50482b['query'][_0x9d82('0x1c')]);_0x2a15ff['offset']=qs['offset'](_0x50482b['query']['offset']);}return _0x5d837f[_0x9d82('0x95')](_0x2a15ff);}})['then'](function(_0x4ff822){if(_0x4ff822){return _0x4ff822?{'count':_0x7e977,'rows':_0x4ff822}:null;}})['then'](respondWithResult(_0xd56f9e,null))['catch'](handleError(_0xd56f9e,null));};exports[_0x9d82('0x96')]=function(_0x2cde79,_0x422f4a){var _0x27dbd0={'raw':!![],'where':{}};var _0x5daec7={};var _0x10bdd0={'count':0x0,'rows':[]};return db[_0x9d82('0x56')]['findOne']({'where':{'id':_0x2cde79[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x422f4a,null))[_0x9d82('0x21')](function(_0x5af132){if(_0x5af132){_0x5daec7['model']=_['keys'](db[_0x9d82('0x97')][_0x9d82('0x5a')]);_0x5daec7[_0x9d82('0x48')]=_['keys'](_0x2cde79[_0x9d82('0x48')]);_0x5daec7[_0x9d82('0x4e')]=_['intersection'](_0x5daec7[_0x9d82('0x44')],_0x5daec7[_0x9d82('0x48')]);_0x27dbd0[_0x9d82('0x45')]=_['intersection'](_0x5daec7[_0x9d82('0x44')],qs[_0x9d82('0x47')](_0x2cde79[_0x9d82('0x48')][_0x9d82('0x47')]));_0x27dbd0[_0x9d82('0x45')]=_0x27dbd0[_0x9d82('0x45')][_0x9d82('0x49')]?_0x27dbd0['attributes']:_0x5daec7[_0x9d82('0x44')];if(!_0x2cde79[_0x9d82('0x48')][_0x9d82('0x4a')]('nolimit')){_0x27dbd0[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x2cde79['query'][_0x9d82('0x1c')]);_0x27dbd0[_0x9d82('0x1a')]=qs['offset'](_0x2cde79['query']['offset']);}_0x27dbd0[_0x9d82('0x4c')]=qs[_0x9d82('0x4d')](_0x2cde79[_0x9d82('0x48')][_0x9d82('0x4d')]);_0x27dbd0['where']=qs[_0x9d82('0x4e')](_[_0x9d82('0x4f')](_0x2cde79[_0x9d82('0x48')],_0x5daec7[_0x9d82('0x4e')]));_0x27dbd0[_0x9d82('0x50')][_0x9d82('0x64')]=_0x5af132['id'];if(_0x2cde79[_0x9d82('0x48')][_0x9d82('0x53')]){_0x27dbd0[_0x9d82('0x50')]=_[_0x9d82('0x51')](_0x27dbd0[_0x9d82('0x50')],{'$or':_[_0x9d82('0x40')](_0x27dbd0[_0x9d82('0x45')],function(_0x7486ae){var _0x2650c1={};_0x2650c1[_0x7486ae]={'$like':'%'+_0x2cde79[_0x9d82('0x48')]['filter']+'%'};return _0x2650c1;})});}if(_0x2cde79[_0x9d82('0x48')][_0x9d82('0x98')]){var _0x2702f3=_0x2cde79[_0x9d82('0x48')][_0x9d82('0x98')][_0x9d82('0x99')](',');var _0x131c93={};_0x131c93[_0x2702f3[0x0]]={'$gte':moment(_0x2702f3[0x1])[_0x9d82('0x9a')](_0x9d82('0x9b'))};_0x27dbd0['where']=_['merge'](_0x27dbd0[_0x9d82('0x50')],_0x131c93);}_0x27dbd0=_[_0x9d82('0x51')]({},_0x27dbd0,_0x2cde79[_0x9d82('0x5b')]);return db[_0x9d82('0x97')][_0x9d82('0x1d')]({'where':_0x27dbd0[_0x9d82('0x50')]})[_0x9d82('0x21')](function(_0x466684){_0x10bdd0[_0x9d82('0x1d')]=_0x466684;if(_0x2cde79[_0x9d82('0x48')]['includeAll']){_0x27dbd0[_0x9d82('0x55')]=[{'all':!![]}];}return db[_0x9d82('0x97')]['findAll'](_0x27dbd0);})[_0x9d82('0x21')](function(_0x42dec4){if(_0x2cde79['query'][_0x9d82('0x9c')]===_0x9d82('0x9d')){for(var _0x3e7a82=0x0;_0x3e7a82<_0x42dec4['length'];_0x3e7a82++){_0x42dec4[_0x3e7a82][_0x9d82('0x5e')]=juice(_0x42dec4[_0x3e7a82][_0x9d82('0x5e')]);}}_0x10bdd0[_0x9d82('0x57')]=_0x42dec4;return _0x10bdd0;});}})[_0x9d82('0x21')](respondWithFilteredResult(_0x422f4a,_0x27dbd0))[_0x9d82('0x5d')](handleError(_0x422f4a,null));};exports['send']=function(_0x3f8612,_0x2c75d1){var _0x121c2a,_0x58876c={},_0x58506d;if(_0x3f8612['body']['to']){_0x58506d=_0x3f8612[_0x9d82('0x5e')]['to']['split'](',')[0x0];}return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x3f8612[_0x9d82('0x67')]['id']},'include':[{'model':db['CmList'],'as':_0x9d82('0x9e'),'include':[{'model':db[_0x9d82('0x9f')],'as':'Contacts','where':{'email':_0x58506d},'limit':0x1,'order':[[_0x9d82('0xa0'),_0x9d82('0xa1')]]}]},{'model':db[_0x9d82('0x3d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9d82('0xa2')],'as':_0x9d82('0xa2'),'raw':!![]}]}]})[_0x9d82('0x21')](handleEntityNotFound(_0x2c75d1,null))[_0x9d82('0x21')](function(_0x373dda){if(!_0x373dda)return;_0x121c2a=_0x373dda;if(!_0x373dda[_0x9d82('0x3c')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x9d82('0x72')](_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa3')])){_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa3')]=util[_0x9d82('0x9a')](_0x9d82('0xa4'),_0x373dda[_0x9d82('0x24')],_0x373dda[_0x9d82('0x70')]||_0x373dda[_0x9d82('0x3c')][_0x9d82('0x30')]);}if(_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa5')]&&_0x3f8612['body']['attachments']['length']){for(var _0x5df457=0x0;_0x5df457<_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa5')]['length'];_0x5df457+=0x1){_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa5')][_0x5df457]={'filename':_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa5')][_0x5df457][_0x9d82('0x24')],'path':path[_0x9d82('0xa6')](config['root'],_0x9d82('0xa7'),_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa5')][_0x5df457][_0x9d82('0xa8')])};}}var _0x1eba0d=_0x373dda[_0x9d82('0xa9')]();return respondWithRpcPromise(_0x9d82('0xaa'),'sendMail',{'account':_0x1eba0d,'message':_0x3f8612['body']});})[_0x9d82('0x21')](function(_0x5164a4){if(!_0x5164a4)return;_0x58876c=_0x5164a4;if(!_0x121c2a['List'])throw new Error(_0x9d82('0xab'));if(_0x121c2a[_0x9d82('0x9e')]['Contacts'][_0x9d82('0x49')])return _0x121c2a[_0x9d82('0x9e')][_0x9d82('0xac')][0x0];return db[_0x9d82('0x9f')][_0x9d82('0x6d')](_['defaults'](_0x3f8612['body'],{'firstName':_0x3f8612[_0x9d82('0x5e')]['to'],'email':_0x3f8612[_0x9d82('0x5e')]['to'],'phone':_0x3f8612[_0x9d82('0x5e')]['to'],'ListId':_0x121c2a['ListId']}));})[_0x9d82('0x21')](function(_0x25d5fa){if(!_0x25d5fa)return;var _0x148c3c={'UserId':_0x3f8612[_0x9d82('0x30')]['id'],'ContactId':_0x25d5fa['id'],'MailAccountId':_0x121c2a['id'],'inReplyTo':_0x58876c[_0x9d82('0xad')],'to':_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xa3')],'cc':_0x3f8612[_0x9d82('0x5e')]['cc'],'subject':_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xae')],'attach':_0x3f8612['body'][_0x9d82('0xaf')],'firstMsgDirection':_0x9d82('0xb0'),'lastMsgAt':moment()[_0x9d82('0x9a')](_0x9d82('0x9b')),'lastMsgDirection':_0x9d82('0xb0'),'Messages':[_[_0x9d82('0x51')](_0x3f8612['body'],{'messageId':_0x58876c[_0x9d82('0xad')],'sentAt':moment()[_0x9d82('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x121c2a['id'],'UserId':_0x3f8612[_0x9d82('0x30')]['id'],'ContactId':_0x25d5fa['id']})]};if(_0x3f8612[_0x9d82('0x5e')][_0x9d82('0xb1')]){_0x148c3c=_['merge'](_0x148c3c,_0x3f8612['body'][_0x9d82('0xb1')]);}return db[_0x9d82('0x86')]['create'](_0x148c3c,{'include':[{'model':db[_0x9d82('0x97')],'as':'Messages'}]});})[_0x9d82('0x21')](respondWithResult(_0x2c75d1,null))[_0x9d82('0x5d')](handleError(_0x2c75d1,null));};exports['verifySmtp']=function(_0x47cef5,_0xd7dda7){return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x47cef5[_0x9d82('0x67')]['id']},'include':[{'model':db[_0x9d82('0x3d')],'as':_0x9d82('0x3c'),'raw':!![],'include':[{'model':db[_0x9d82('0xa2')],'as':'CloudProvider','raw':!![]}]}]})[_0x9d82('0x21')](handleEntityNotFound(_0xd7dda7,null))[_0x9d82('0x21')](function(_0x2add9a){if(!_0x2add9a[_0x9d82('0x3c')])return;var _0x58d8bc=_0x2add9a['getSmtpOptions']();return respondWithRpcPromise(_0x9d82('0xb2'),'verifySmtp',{'account':_0x58d8bc});})['then'](respondWithResult(_0xd7dda7,null))[_0x9d82('0x5d')](handleError(_0xd7dda7,null));};exports[_0x9d82('0x22')]=function(_0x4704db,_0x1ce4cd){return db['MailAccount']['find']({'where':{'id':_0x4704db[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x1ce4cd,null))[_0x9d82('0x21')](function(_0x9708f9){if(_0x9708f9&&_0x9708f9[_0x9d82('0x37')]){throw new db[(_0x9d82('0xb3'))][(_0x9d82('0xb4'))](_0x9d82('0xb5'));}return _0x9708f9;})[_0x9d82('0x21')](removeEntity(_0x1ce4cd,null))['catch'](handleError(_0x1ce4cd,null));};exports[_0x9d82('0xb6')]=function(_0x3c2580,_0x5cd488){return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x3c2580[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x5cd488,null))[_0x9d82('0x21')](function(_0x9086c9){if(_0x9086c9){return _0x9086c9[_0x9d82('0xb6')](_0x3c2580[_0x9d82('0x5e')][_0x9d82('0x6f')],_[_0x9d82('0x84')](_0x3c2580['body'],[_0x9d82('0x6f'),'id'])||{})[_0x9d82('0xb7')](function(_0xdb7f4f){for(var _0x24427c=0x0;_0x24427c<_0x3c2580[_0x9d82('0x5e')]['ids'][_0x9d82('0x49')];_0x24427c+=0x1){socket[_0x9d82('0xb8')](_0x9d82('0xb9'),{'UserId':Number(_0x3c2580['body'][_0x9d82('0x6f')][_0x24427c]),'MailAccountId':Number(_0x3c2580[_0x9d82('0x67')]['id'])});}return _0xdb7f4f;});}})['then'](respondWithResult(_0x5cd488,null))['catch'](handleError(_0x5cd488,null));};exports[_0x9d82('0xba')]=function(_0x569ea2,_0x2c045a){return db[_0x9d82('0x56')][_0x9d82('0x5c')]({'where':{'id':_0x569ea2[_0x9d82('0x67')]['id']}})[_0x9d82('0x21')](handleEntityNotFound(_0x2c045a,null))[_0x9d82('0x21')](function(_0x23b6c5){if(_0x23b6c5){return _0x23b6c5[_0x9d82('0xba')](_0x569ea2[_0x9d82('0x48')][_0x9d82('0x6f')])[_0x9d82('0x21')](function(){if(_['isArray'](_0x569ea2[_0x9d82('0x48')][_0x9d82('0x6f')])){for(var _0x4aebfb=0x0;_0x4aebfb<_0x569ea2[_0x9d82('0x48')][_0x9d82('0x6f')][_0x9d82('0x49')];_0x4aebfb+=0x1){socket[_0x9d82('0xb8')](_0x9d82('0xbb'),{'UserId':Number(_0x569ea2[_0x9d82('0x48')][_0x9d82('0x6f')][_0x4aebfb]),'MailAccountId':Number(_0x569ea2[_0x9d82('0x67')]['id'])});}}else{socket[_0x9d82('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x569ea2['query'][_0x9d82('0x6f')]),'MailAccountId':Number(_0x569ea2[_0x9d82('0x67')]['id'])});}});}})[_0x9d82('0x21')](respondWithStatusCode(_0x2c045a,null))[_0x9d82('0x5d')](handleError(_0x2c045a,null));};exports[_0x9d82('0xbc')]=function(_0x406f12,_0x451af7){var _0x4a1612={};var _0x42fe04={};var _0x5212b0;var _0x48e19a;return db[_0x9d82('0x56')][_0x9d82('0x66')]({'where':{'id':_0x406f12[_0x9d82('0x67')]['id']}})['then'](handleEntityNotFound(_0x451af7,null))['then'](function(_0x4ecb65){if(_0x4ecb65){_0x5212b0=_0x4ecb65;_0x42fe04[_0x9d82('0x44')]=_['keys'](db[_0x9d82('0x88')][_0x9d82('0x5a')]);_0x42fe04['query']=_[_0x9d82('0x43')](_0x406f12[_0x9d82('0x48')]);_0x42fe04[_0x9d82('0x4e')]=_['intersection'](_0x42fe04[_0x9d82('0x44')],_0x42fe04[_0x9d82('0x48')]);_0x4a1612[_0x9d82('0x45')]=_[_0x9d82('0x46')](_0x42fe04['model'],qs[_0x9d82('0x47')](_0x406f12[_0x9d82('0x48')]['fields']));_0x4a1612[_0x9d82('0x45')]=_0x4a1612['attributes'][_0x9d82('0x49')]?_0x4a1612['attributes']:_0x42fe04[_0x9d82('0x44')];_0x4a1612[_0x9d82('0x4c')]=qs[_0x9d82('0x4d')](_0x406f12[_0x9d82('0x48')][_0x9d82('0x4d')]);_0x4a1612[_0x9d82('0x50')]=qs[_0x9d82('0x4e')](_[_0x9d82('0x4f')](_0x406f12[_0x9d82('0x48')],_0x42fe04[_0x9d82('0x4e')]));if(_0x406f12['query'][_0x9d82('0x53')]){_0x4a1612[_0x9d82('0x50')]=_['merge'](_0x4a1612['where'],{'$or':_[_0x9d82('0x40')](_0x4a1612[_0x9d82('0x45')],function(_0xe9e0d3){var _0x527e27={};_0x527e27[_0xe9e0d3]={'$like':'%'+_0x406f12[_0x9d82('0x48')][_0x9d82('0x53')]+'%'};return _0x527e27;})});}_0x4a1612=_[_0x9d82('0x51')]({},_0x4a1612,_0x406f12[_0x9d82('0x5b')]);return _0x5212b0[_0x9d82('0xbc')](_0x4a1612);}})[_0x9d82('0x21')](function(_0xb1ba9b){if(_0xb1ba9b){_0x48e19a=_0xb1ba9b['length'];if(!_0x406f12[_0x9d82('0x48')][_0x9d82('0x4a')]('nolimit')){_0x4a1612[_0x9d82('0x1c')]=qs[_0x9d82('0x1c')](_0x406f12[_0x9d82('0x48')][_0x9d82('0x1c')]);_0x4a1612[_0x9d82('0x1a')]=qs['offset'](_0x406f12[_0x9d82('0x48')]['offset']);}return _0x5212b0[_0x9d82('0xbc')](_0x4a1612);}})[_0x9d82('0x21')](function(_0x57d5f2){if(_0x57d5f2){return _0x57d5f2?{'count':_0x48e19a,'rows':_0x57d5f2}:null;}})[_0x9d82('0x21')](respondWithResult(_0x451af7,null))[_0x9d82('0x5d')](handleError(_0x451af7,null));};
\ No newline at end of file
+var _0x2411=['subject','out','Interaction','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','destroy','get','MailAccounts','end','sendStatus','stack','name','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','Pause','length','include','body','provider','find','update','describe','Disposition','create','getDispositions','findOne','order','MailAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','custom','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','addImap','removeImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','updatedAt','CloudProvider','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','Contacts','messageId'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x2411,0xcd));var _0x1241=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x2411[_0x324012];return _0x435cf2;};'use strict';var moment=require('moment');var BPromise=require(_0x1241('0x0'));var util=require(_0x1241('0x1'));var path=require(_0x1241('0x2'));var _=require(_0x1241('0x3'));var juice=require(_0x1241('0x4'));var Redis=require(_0x1241('0x5'));var qs=require(_0x1241('0x6'));var logger=require('../../config/logger')(_0x1241('0x7'));var config=require(_0x1241('0x8'));var db=require('../../mysqldb')['db'];config[_0x1241('0x9')]=_[_0x1241('0xa')](config['redis'],{'host':_0x1241('0xb'),'port':0x18eb});var socket=require(_0x1241('0xc'))(new Redis(config[_0x1241('0x9')]));require(_0x1241('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1241('0xe')][_0x1241('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x339b67,_0x5829c4,_0x3681d7,_0x6b41a){return new BPromise(function(_0x56fc38,_0x302559){var _0x39fb16=_0x6b41a||client;return _0x39fb16[_0x1241('0x10')](_0x339b67,_0x3681d7)[_0x1241('0x11')](function(_0x1a1a4a){logger[_0x1241('0x12')](_0x1241('0x13'),_0x5829c4,_0x1241('0x14'));logger[_0x1241('0x15')](_0x1241('0x16'),_0x5829c4,_0x1241('0x14'),JSON[_0x1241('0x17')](_0x1a1a4a));if(_0x1a1a4a['error']){if(_0x1a1a4a['error']['code']===0x1f4){logger[_0x1241('0x18')]('MailAccount,\x20%s,\x20%s',_0x5829c4,_0x1a1a4a[_0x1241('0x18')][_0x1241('0x19')]);return _0x302559(_0x1a1a4a[_0x1241('0x18')]['message']);}logger[_0x1241('0x18')](_0x1241('0x13'),_0x5829c4,_0x1a1a4a[_0x1241('0x18')]['message']);return _0x56fc38(_0x1a1a4a['error'][_0x1241('0x19')]);}else{logger['info'](_0x1241('0x13'),_0x5829c4,_0x1241('0x14'));_0x56fc38(_0x1a1a4a[_0x1241('0x1a')][_0x1241('0x19')]);}})[_0x1241('0x1b')](function(_0x57d19f){logger[_0x1241('0x18')](_0x1241('0x13'),_0x5829c4,_0x57d19f);_0x302559(_0x57d19f);});});}function respondWithStatusCode(_0x44fecb,_0x5295c1){_0x5295c1=_0x5295c1||0xcc;return function(_0x1767d0){if(_0x1767d0){return _0x44fecb['sendStatus'](_0x5295c1);}return _0x44fecb['status'](_0x5295c1)['end']();};}function respondWithResult(_0x7c6d17,_0x14ed81){_0x14ed81=_0x14ed81||0xc8;return function(_0x3f0806){if(_0x3f0806){return _0x7c6d17[_0x1241('0x1c')](_0x14ed81)[_0x1241('0x1d')](_0x3f0806);}};}function respondWithFilteredResult(_0x30f1bb,_0x548e45){return function(_0x49215b){if(_0x49215b){var _0x28b87b=typeof _0x548e45[_0x1241('0x1e')]==='undefined'&&typeof _0x548e45[_0x1241('0x1f')]===_0x1241('0x20');var _0x408aa2=_0x49215b[_0x1241('0x21')];var _0x353e02=_0x28b87b?0x0:_0x548e45[_0x1241('0x1e')];var _0x52a2b1=_0x28b87b?_0x49215b[_0x1241('0x21')]:_0x548e45[_0x1241('0x1e')]+_0x548e45[_0x1241('0x1f')];var _0x135854;if(_0x52a2b1>=_0x408aa2){_0x52a2b1=_0x408aa2;_0x135854=0xc8;}else{_0x135854=0xce;}_0x30f1bb[_0x1241('0x1c')](_0x135854);return _0x30f1bb[_0x1241('0x22')](_0x1241('0x23'),_0x353e02+'-'+_0x52a2b1+'/'+_0x408aa2)[_0x1241('0x1d')](_0x49215b);}return null;};}function saveUpdates(_0x431967){return function(_0x52c04a){if(_0x52c04a){return _0x52c04a['update'](_0x431967)[_0x1241('0x11')](function(_0x55da80){return _0x55da80;});}return null;};}function removeEntity(_0x39b11b){return function(_0x45ddbb){if(_0x45ddbb){return _0x45ddbb[_0x1241('0x24')]()[_0x1241('0x11')](function(){var _0x156d0e=_0x45ddbb[_0x1241('0x25')]({'plain':!![]});var _0x137000=_0x1241('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x137000,'resourceId':_0x156d0e['id']}})[_0x1241('0x11')](function(){return _0x45ddbb;});})[_0x1241('0x11')](function(){_0x39b11b['status'](0xcc)[_0x1241('0x27')]();});}};}function handleEntityNotFound(_0x324349){return function(_0x2d9553){if(!_0x2d9553){_0x324349[_0x1241('0x28')](0x194);}return _0x2d9553;};}function handleError(_0x4c76dd,_0x56d114){_0x56d114=_0x56d114||0x1f4;return function(_0x3b8aa3){logger[_0x1241('0x18')](_0x3b8aa3[_0x1241('0x29')]);if(_0x3b8aa3[_0x1241('0x2a')]){delete _0x3b8aa3[_0x1241('0x2a')];}_0x4c76dd[_0x1241('0x1c')](_0x56d114)['send'](_0x3b8aa3);};}function getImapHost(_0x45315f){switch(_0x45315f){case _0x1241('0x2b'):return _0x1241('0x2c');case'yahoo':return'imap.mail.yahoo.com';case _0x1241('0x2d'):return _0x1241('0x2e');case _0x1241('0x2f'):return _0x1241('0x30');}throw new Error('Unknown\x20email\x20service\x20provider',_0x45315f);}function getSmtpHost(_0x2369fd){switch(_0x2369fd){case _0x1241('0x2b'):return _0x1241('0x31');case _0x1241('0x32'):return _0x1241('0x33');case'hotmail':return _0x1241('0x34');case _0x1241('0x2f'):return _0x1241('0x35');}throw new Error(_0x1241('0x36'),_0x2369fd);}function getAuthenticationOptions(_0xcff064,_0x436ecd){var _0x728281={};var _0x28aedc={};if(_0xcff064){_0x728281[_0x1241('0x37')]=_0x28aedc['user']=_0x436ecd[_0x1241('0x38')];_0x728281[_0x1241('0x39')]=_0x28aedc[_0x1241('0x3a')]=_0x436ecd['password'];if(_0x436ecd['modernAuthentication']){_0x728281[_0x1241('0x3b')]=_0x28aedc[_0x1241('0x3b')]=!![];_0x728281[_0x1241('0x3c')]=_0x28aedc[_0x1241('0x3c')]=_0x436ecd[_0x1241('0x3c')];_0x728281['password']=_0x28aedc[_0x1241('0x3a')]=null;}else{_0x728281[_0x1241('0x3c')]=_0x28aedc['CloudProviderId']=null;}_0x728281[_0x1241('0x3d')]=getImapHost(_0xcff064);_0x728281[_0x1241('0x3e')]=0x3e1;_0x28aedc[_0x1241('0x3d')]=getSmtpHost(_0xcff064);_0x28aedc[_0x1241('0x3e')]=0x24b;_0x28aedc[_0x1241('0x3f')]=![];_0x728281[_0x1241('0x40')]=_0x28aedc[_0x1241('0x40')]=null;}else{if(_0x436ecd[_0x1241('0x41')]){_0x728281['user']=_0x28aedc['user']=_0x436ecd['username'];_0x728281['password']=_0x28aedc[_0x1241('0x3a')]=_0x436ecd[_0x1241('0x39')];}else{_0x728281[_0x1241('0x41')]=_0x28aedc[_0x1241('0x41')]=![];_0x728281['user']=_0x28aedc['user']=null;_0x728281[_0x1241('0x39')]=_0x28aedc[_0x1241('0x3a')]=null;}_0x728281[_0x1241('0x3d')]=_0x436ecd[_0x1241('0x42')][_0x1241('0x3d')];_0x728281[_0x1241('0x3e')]=_0x436ecd[_0x1241('0x42')]['port'];_0x28aedc[_0x1241('0x3d')]=_0x436ecd[_0x1241('0x43')]['host'];_0x28aedc[_0x1241('0x3e')]=_0x436ecd['Smtp'][_0x1241('0x3e')];}return{'Imap':_0x728281,'Smtp':_0x28aedc};}exports['index']=function(_0x294143,_0x54e47c){var _0x594061={'include':[{'model':db[_0x1241('0x44')],'as':_0x1241('0x42')},{'model':db[_0x1241('0x45')],'as':_0x1241('0x43')},{'model':db['Pause'],'as':_0x1241('0x46')}]},_0x2d3d05={},_0x2c5add={'count':0x0,'rows':[]};var _0x80e823=_[_0x1241('0x47')](db[_0x1241('0x48')]['rawAttributes'],function(_0x404b77){return{'name':_0x404b77[_0x1241('0x49')],'type':_0x404b77[_0x1241('0x4a')][_0x1241('0x4b')]};});_0x2d3d05[_0x1241('0x4c')]=_['map'](_0x80e823,'name');_0x2d3d05[_0x1241('0x4d')]=_[_0x1241('0x4e')](_0x294143[_0x1241('0x4d')]);_0x2d3d05['filters']=_[_0x1241('0x4f')](_0x2d3d05[_0x1241('0x4c')],_0x2d3d05[_0x1241('0x4d')]);_0x594061[_0x1241('0x50')]=_['intersection'](_0x2d3d05[_0x1241('0x4c')],qs[_0x1241('0x51')](_0x294143[_0x1241('0x4d')]['fields']));_0x594061[_0x1241('0x50')]=_0x594061[_0x1241('0x50')]['length']?_0x594061[_0x1241('0x50')]:_0x2d3d05[_0x1241('0x4c')];if(!_0x294143['query'][_0x1241('0x52')](_0x1241('0x53'))){_0x594061[_0x1241('0x1f')]=qs['limit'](_0x294143['query'][_0x1241('0x1f')]);_0x594061[_0x1241('0x1e')]=qs[_0x1241('0x1e')](_0x294143[_0x1241('0x4d')][_0x1241('0x1e')]);}_0x594061['order']=qs[_0x1241('0x54')](_0x294143[_0x1241('0x4d')][_0x1241('0x54')]);_0x594061[_0x1241('0x55')]=qs[_0x1241('0x56')](_[_0x1241('0x57')](_0x294143['query'],_0x2d3d05[_0x1241('0x56')]),_0x80e823);if(_0x294143[_0x1241('0x4d')][_0x1241('0x58')]){_0x594061[_0x1241('0x55')]=_[_0x1241('0x59')](_0x594061[_0x1241('0x55')],{'$or':_['map'](_0x80e823,function(_0x1c4f11){if(_0x1c4f11[_0x1241('0x4a')]!==_0x1241('0x5a')){var _0x2b0b7d={};_0x2b0b7d[_0x1c4f11[_0x1241('0x2a')]]={'$like':'%'+_0x294143[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x2b0b7d;}})});}_0x594061=_[_0x1241('0x59')]({},_0x594061,_0x294143[_0x1241('0x5b')]);var _0x1fc47e={'where':_0x594061[_0x1241('0x55')]};return db['MailAccount'][_0x1241('0x21')](_0x1fc47e)['then'](function(_0x320dc3){_0x2c5add[_0x1241('0x21')]=_0x320dc3;if(_0x294143[_0x1241('0x4d')][_0x1241('0x5c')]){_0x594061['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x594061);})[_0x1241('0x11')](function(_0x261858){_0x2c5add[_0x1241('0x5d')]=_0x261858;return _0x2c5add;})[_0x1241('0x11')](respondWithFilteredResult(_0x54e47c,_0x594061))[_0x1241('0x1b')](handleError(_0x54e47c,null));};exports['show']=function(_0x1f148a,_0x33df43){var _0x405657={'raw':![],'where':{'id':_0x1f148a[_0x1241('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1241('0x42')},{'model':db[_0x1241('0x45')],'as':_0x1241('0x43')},{'model':db[_0x1241('0x5f')],'as':_0x1241('0x46')}]},_0x126835={};_0x126835[_0x1241('0x4c')]=_['keys'](db[_0x1241('0x48')]['rawAttributes']);_0x126835['query']=_[_0x1241('0x4e')](_0x1f148a[_0x1241('0x4d')]);_0x126835[_0x1241('0x56')]=_['intersection'](_0x126835['model'],_0x126835[_0x1241('0x4d')]);_0x405657[_0x1241('0x50')]=_[_0x1241('0x4f')](_0x126835[_0x1241('0x4c')],qs[_0x1241('0x51')](_0x1f148a['query'][_0x1241('0x51')]));_0x405657['attributes']=_0x405657[_0x1241('0x50')][_0x1241('0x60')]?_0x405657[_0x1241('0x50')]:_0x126835['model'];if(_0x1f148a[_0x1241('0x4d')][_0x1241('0x5c')]){_0x405657[_0x1241('0x61')]=[{'all':!![]}];}_0x405657=_['merge']({},_0x405657,_0x1f148a[_0x1241('0x5b')]);return db[_0x1241('0x48')]['find'](_0x405657)['then'](handleEntityNotFound(_0x33df43,null))[_0x1241('0x11')](respondWithResult(_0x33df43,null))[_0x1241('0x1b')](handleError(_0x33df43,null));};exports['update']=function(_0x5d3e33,_0x31deb6){if(_0x5d3e33['body']['id']){delete _0x5d3e33[_0x1241('0x62')]['id'];}var _0x209bce=_0x5d3e33[_0x1241('0x62')]['provider']==='custom'?null:_0x5d3e33['body'][_0x1241('0x63')];var _0x51031e=_0x5d3e33[_0x1241('0x62')][_0x1241('0x42')]||{};var _0x4ae27c=_0x5d3e33['body'][_0x1241('0x43')]||{};if(_0x209bce){_0x51031e[_0x1241('0x3d')]=getImapHost(_0x209bce);_0x51031e[_0x1241('0x3e')]=0x3e1;_0x4ae27c['host']=getSmtpHost(_0x209bce);_0x4ae27c['port']=0x24b;_0x4ae27c[_0x1241('0x3f')]=![];}if(_0x4ae27c[_0x1241('0x3b')]){_0x4ae27c[_0x1241('0x3f')]=![];}else{_0x4ae27c[_0x1241('0x3c')]=null;}if(!_0x51031e['modernAuthentication'])_0x51031e[_0x1241('0x3c')]=null;_0x5d3e33['body'][_0x1241('0x42')]=_0x51031e;_0x5d3e33['body'][_0x1241('0x43')]=_0x4ae27c;return db['MailAccount'][_0x1241('0x64')]({'where':{'id':_0x5d3e33[_0x1241('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1241('0x42')},{'model':db[_0x1241('0x45')],'as':_0x1241('0x43')},{'model':db['Pause'],'as':_0x1241('0x46')}]})[_0x1241('0x11')](handleEntityNotFound(_0x31deb6,null))['then'](function(_0x4dfa38){if(!_0x4dfa38)throw new Error('Mail\x20Account\x20not\x20found');if(_0x4dfa38[_0x1241('0x40')])delete _0x5d3e33[_0x1241('0x62')][_0x1241('0x42')];return _0x4dfa38;})['then'](saveUpdates(_0x5d3e33[_0x1241('0x62')],null))[_0x1241('0x11')](function(_0x2d65e2){if(!_0x5d3e33['body'][_0x1241('0x42')])return _0x2d65e2;return db[_0x1241('0x44')][_0x1241('0x65')](_0x5d3e33[_0x1241('0x62')]['Imap'],{'where':{'MailAccountId':_0x2d65e2['id']}})['then'](function(){return _0x2d65e2;});})[_0x1241('0x11')](function(_0x377c2f){if(!_0x5d3e33[_0x1241('0x62')][_0x1241('0x43')])return _0x377c2f;return db[_0x1241('0x45')][_0x1241('0x65')](_0x5d3e33[_0x1241('0x62')][_0x1241('0x43')],{'where':{'MailAccountId':_0x377c2f['id']}})['then'](function(){return _0x377c2f;});})[_0x1241('0x11')](respondWithResult(_0x31deb6,null))[_0x1241('0x1b')](handleError(_0x31deb6,null));};exports['describe']=function(_0x5d3327,_0x2e7ba3){return db[_0x1241('0x48')][_0x1241('0x66')]()[_0x1241('0x11')](respondWithResult(_0x2e7ba3,null))[_0x1241('0x1b')](handleError(_0x2e7ba3,null));};exports['addDisposition']=function(_0x3cb5f6,_0x4d9833){if(_0x3cb5f6[_0x1241('0x62')]['id']){delete _0x3cb5f6[_0x1241('0x62')]['id'];}return db[_0x1241('0x48')]['find']({'where':{'id':_0x3cb5f6['params']['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x4d9833,null))['then'](function(_0x517e74){if(_0x517e74){_0x3cb5f6[_0x1241('0x62')]['MailAccountId']=_0x517e74['id'];return db[_0x1241('0x67')][_0x1241('0x68')](_0x3cb5f6[_0x1241('0x62')]);}})[_0x1241('0x11')](respondWithResult(_0x4d9833,null))['catch'](handleError(_0x4d9833,null));};exports[_0x1241('0x69')]=function(_0x2d4fb7,_0x52f1eb){var _0x43ae72={'raw':![],'where':{}};var _0x232f65={};var _0x1245c3={'count':0x0,'rows':[]};return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x2d4fb7['params']['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x52f1eb,null))[_0x1241('0x11')](function(_0x1520f1){if(_0x1520f1){_0x232f65[_0x1241('0x4c')]=_['keys'](db['Disposition']['rawAttributes']);_0x232f65['query']=_['keys'](_0x2d4fb7['query']);_0x232f65['filters']=_[_0x1241('0x4f')](_0x232f65[_0x1241('0x4c')],_0x232f65[_0x1241('0x4d')]);_0x43ae72[_0x1241('0x50')]=_[_0x1241('0x4f')](_0x232f65[_0x1241('0x4c')],qs[_0x1241('0x51')](_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x51')]));_0x43ae72[_0x1241('0x50')]=_0x43ae72[_0x1241('0x50')][_0x1241('0x60')]?_0x43ae72[_0x1241('0x50')]:_0x232f65[_0x1241('0x4c')];if(!_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x52')](_0x1241('0x53'))){_0x43ae72[_0x1241('0x1f')]=qs['limit'](_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x1f')]);_0x43ae72[_0x1241('0x1e')]=qs[_0x1241('0x1e')](_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x1e')]);}_0x43ae72[_0x1241('0x6b')]=qs[_0x1241('0x54')](_0x2d4fb7['query']['sort']);_0x43ae72['where']=qs[_0x1241('0x56')](_[_0x1241('0x57')](_0x2d4fb7[_0x1241('0x4d')],_0x232f65[_0x1241('0x56')]));_0x43ae72['where'][_0x1241('0x6c')]=_0x1520f1['id'];if(_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x58')]){_0x43ae72['where']=_[_0x1241('0x59')](_0x43ae72[_0x1241('0x55')],{'$or':_[_0x1241('0x47')](_0x43ae72[_0x1241('0x50')],function(_0x59f6c6){var _0x25119c={};_0x25119c[_0x59f6c6]={'$like':'%'+_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x25119c;})});}_0x43ae72=_[_0x1241('0x59')]({},_0x43ae72,_0x2d4fb7[_0x1241('0x5b')]);return db[_0x1241('0x67')][_0x1241('0x21')]({'where':_0x43ae72[_0x1241('0x55')]})[_0x1241('0x11')](function(_0x2edaaf){_0x1245c3[_0x1241('0x21')]=_0x2edaaf;if(_0x2d4fb7[_0x1241('0x4d')][_0x1241('0x5c')]){_0x43ae72[_0x1241('0x61')]=[{'all':!![]}];}return db[_0x1241('0x67')][_0x1241('0x6d')](_0x43ae72);})[_0x1241('0x11')](function(_0x1d7459){_0x1245c3['rows']=_0x1d7459;return _0x1245c3;});}})['then'](respondWithFilteredResult(_0x52f1eb,_0x43ae72))['catch'](handleError(_0x52f1eb,null));};exports[_0x1241('0x6e')]=function(_0x41b05c,_0x52a1fc){return db[_0x1241('0x48')][_0x1241('0x64')]({'where':{'id':_0x41b05c['params']['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x52a1fc,null))[_0x1241('0x11')](function(_0x69d5a5){if(_0x69d5a5){return _0x69d5a5['removeDispositions'](_0x41b05c['query'][_0x1241('0x6f')]);}})[_0x1241('0x11')](respondWithStatusCode(_0x52a1fc,null))['catch'](handleError(_0x52a1fc,null));};exports[_0x1241('0x70')]=function(_0x869923,_0xfb5d66){if(_0x869923[_0x1241('0x62')]['id']){delete _0x869923['body']['id'];}return db[_0x1241('0x48')][_0x1241('0x64')]({'where':{'id':_0x869923[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0xfb5d66,null))[_0x1241('0x11')](function(_0x1876b1){if(_0x1876b1){_0x869923[_0x1241('0x62')][_0x1241('0x6c')]=_0x1876b1['id'];return db[_0x1241('0x71')]['create'](_0x869923[_0x1241('0x62')]);}})['then'](respondWithResult(_0xfb5d66,null))[_0x1241('0x1b')](handleError(_0xfb5d66,null));};exports[_0x1241('0x72')]=function(_0x37e63e,_0xe6fe44){var _0x122e4e={'raw':![],'where':{}};var _0x1e9e46={};var _0x520ee6={'count':0x0,'rows':[]};return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x37e63e[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0xe6fe44,null))[_0x1241('0x11')](function(_0x3b22b8){if(_0x3b22b8){_0x1e9e46[_0x1241('0x4c')]=_[_0x1241('0x4e')](db[_0x1241('0x71')][_0x1241('0x73')]);_0x1e9e46[_0x1241('0x4d')]=_[_0x1241('0x4e')](_0x37e63e[_0x1241('0x4d')]);_0x1e9e46[_0x1241('0x56')]=_[_0x1241('0x4f')](_0x1e9e46[_0x1241('0x4c')],_0x1e9e46[_0x1241('0x4d')]);_0x122e4e['attributes']=_[_0x1241('0x4f')](_0x1e9e46['model'],qs[_0x1241('0x51')](_0x37e63e['query'][_0x1241('0x51')]));_0x122e4e[_0x1241('0x50')]=_0x122e4e[_0x1241('0x50')][_0x1241('0x60')]?_0x122e4e['attributes']:_0x1e9e46[_0x1241('0x4c')];if(!_0x37e63e[_0x1241('0x4d')]['hasOwnProperty'](_0x1241('0x53'))){_0x122e4e[_0x1241('0x1f')]=qs[_0x1241('0x1f')](_0x37e63e['query'][_0x1241('0x1f')]);_0x122e4e[_0x1241('0x1e')]=qs['offset'](_0x37e63e['query'][_0x1241('0x1e')]);}_0x122e4e[_0x1241('0x6b')]=qs['sort'](_0x37e63e['query'][_0x1241('0x54')]);_0x122e4e[_0x1241('0x55')]=qs['filters'](_[_0x1241('0x57')](_0x37e63e['query'],_0x1e9e46['filters']));_0x122e4e[_0x1241('0x55')][_0x1241('0x6c')]=_0x3b22b8['id'];if(_0x37e63e[_0x1241('0x4d')][_0x1241('0x58')]){_0x122e4e[_0x1241('0x55')]=_['merge'](_0x122e4e[_0x1241('0x55')],{'$or':_[_0x1241('0x47')](_0x122e4e['attributes'],function(_0x433bc8){var _0x1009de={};_0x1009de[_0x433bc8]={'$like':'%'+_0x37e63e[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x1009de;})});}_0x122e4e=_[_0x1241('0x59')]({},_0x122e4e,_0x37e63e['options']);return db[_0x1241('0x71')][_0x1241('0x21')]({'where':_0x122e4e['where']})[_0x1241('0x11')](function(_0x4f041f){_0x520ee6[_0x1241('0x21')]=_0x4f041f;if(_0x37e63e[_0x1241('0x4d')][_0x1241('0x5c')]){_0x122e4e[_0x1241('0x61')]=[{'all':!![]}];}return db[_0x1241('0x71')][_0x1241('0x6d')](_0x122e4e);})['then'](function(_0x3194c9){_0x520ee6[_0x1241('0x5d')]=_0x3194c9;return _0x520ee6;});}})['then'](respondWithFilteredResult(_0xe6fe44,_0x122e4e))[_0x1241('0x1b')](handleError(_0xe6fe44,null));};exports[_0x1241('0x74')]=function(_0xf54f97,_0x2a4f17){return db[_0x1241('0x48')][_0x1241('0x64')]({'where':{'id':_0xf54f97[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x2a4f17,null))['then'](function(_0x19a818){if(_0x19a818){return _0x19a818[_0x1241('0x74')](_0xf54f97[_0x1241('0x4d')][_0x1241('0x6f')]);}})['then'](respondWithStatusCode(_0x2a4f17,null))['catch'](handleError(_0x2a4f17,null));};exports['create']=function(_0x487d8b,_0x5e05ff){var _0x155171={'name':_0x487d8b[_0x1241('0x62')][_0x1241('0x2a')],'key':_0x487d8b[_0x1241('0x62')][_0x1241('0x4b')],'provider':_0x487d8b[_0x1241('0x62')][_0x1241('0x63')]===_0x1241('0x75')?null:_0x487d8b[_0x1241('0x62')]['provider'],'email':_0x487d8b[_0x1241('0x62')][_0x1241('0x76')],'ListId':_0x487d8b[_0x1241('0x62')][_0x1241('0x77')],'active':!_[_0x1241('0x78')](_0x487d8b[_0x1241('0x62')][_0x1241('0x79')])?_0x487d8b[_0x1241('0x62')][_0x1241('0x79')]:!![],'description':_0x487d8b['body']['description']||null};var _0x38fd4e=getAuthenticationOptions(_0x155171[_0x1241('0x63')],_0x487d8b['body']);_0x155171['Imap']=_0x38fd4e[_0x1241('0x42')];_0x155171['Smtp']=_0x38fd4e['Smtp'];return db['MailAccount'][_0x1241('0x68')](_0x155171,{'include':[{'model':db[_0x1241('0x45')],'as':_0x1241('0x43')},{'model':db[_0x1241('0x44')],'as':_0x1241('0x42')}]})[_0x1241('0x11')](function(_0x2eda06){var _0x4c3471=_0x487d8b['user'][_0x1241('0x25')]({'plain':!![]});if(!_0x4c3471)throw new Error(_0x1241('0x7a'));if(_0x4c3471[_0x1241('0x7b')]===_0x1241('0x37')){var _0xd33c18=_0x2eda06[_0x1241('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x1241('0x64')]({'where':{'name':_0x1241('0x26'),'userProfileId':_0x4c3471[_0x1241('0x7c')]},'raw':!![]})[_0x1241('0x11')](function(_0x5bcd6c){if(_0x5bcd6c&&_0x5bcd6c[_0x1241('0x7d')]===0x0){return db['UserProfileResource'][_0x1241('0x68')]({'name':_0xd33c18[_0x1241('0x2a')],'resourceId':_0xd33c18['id'],'type':_0x5bcd6c['name'],'sectionId':_0x5bcd6c['id']},{})[_0x1241('0x11')](function(){return _0x2eda06;});}else{return _0x2eda06;}})['catch'](function(_0x3abe32){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3abe32);throw _0x3abe32;});}return _0x2eda06;})[_0x1241('0x11')](respondWithResult(_0x5e05ff,0xc9))[_0x1241('0x1b')](handleError(_0x5e05ff,null));};exports['getImap']=function(_0x35ef6e,_0x515351){return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x35ef6e[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x515351,null))[_0x1241('0x11')](function(_0xa502b9){if(_0xa502b9){return _0xa502b9['getImap']();}return null;})['then'](respondWithResult(_0x515351,null))[_0x1241('0x1b')](handleError(_0x515351,null));};exports[_0x1241('0x7e')]=function(_0x2cdd84,_0xd8c1c5){if(_0x2cdd84[_0x1241('0x62')]['id']){delete _0x2cdd84[_0x1241('0x62')]['id'];}return db['MailAccount'][_0x1241('0x64')]({'where':{'id':_0x2cdd84[_0x1241('0x5e')]['id']}})['then'](handleEntityNotFound(_0xd8c1c5,null))['then'](function(_0x50f294){if(_0x50f294){_0x2cdd84[_0x1241('0x62')][_0x1241('0x6c')]=_0x50f294['id'];return db['MailServerIn'][_0x1241('0x68')](_0x2cdd84[_0x1241('0x62')]);}})['then'](respondWithResult(_0xd8c1c5,null))[_0x1241('0x1b')](handleError(_0xd8c1c5,null));};exports[_0x1241('0x7f')]=function(_0x1a880c,_0x366ac6){return db[_0x1241('0x48')]['findOne']({'where':{'id':_0x1a880c['params']['id']}})['then'](handleEntityNotFound(_0x366ac6,null))[_0x1241('0x11')](function(_0x1998de){if(_0x1998de){return _0x1998de['setImap'](null);}return null;})[_0x1241('0x11')](respondWithStatusCode(_0x366ac6,null))[_0x1241('0x1b')](handleError(_0x366ac6,null));};exports[_0x1241('0x80')]=function(_0x701dbd,_0x37aef8){return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x701dbd['params']['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x37aef8,null))[_0x1241('0x11')](function(_0x28d57a){if(_0x28d57a){return _0x28d57a[_0x1241('0x80')]();}return null;})[_0x1241('0x11')](respondWithResult(_0x37aef8,null))[_0x1241('0x1b')](handleError(_0x37aef8,null));};exports[_0x1241('0x81')]=function(_0x19d716,_0x5b716b){if(_0x19d716[_0x1241('0x62')]['id']){delete _0x19d716[_0x1241('0x62')]['id'];}return db[_0x1241('0x48')]['find']({'where':{'id':_0x19d716[_0x1241('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5b716b,null))['then'](function(_0x2c5225){if(_0x2c5225){_0x19d716[_0x1241('0x62')][_0x1241('0x6c')]=_0x2c5225['id'];return db[_0x1241('0x45')][_0x1241('0x68')](_0x19d716['body']);}})[_0x1241('0x11')](respondWithResult(_0x5b716b,null))[_0x1241('0x1b')](handleError(_0x5b716b,null));};exports[_0x1241('0x82')]=function(_0x243f08,_0x2b77e6){return db[_0x1241('0x48')]['findOne']({'where':{'id':_0x243f08[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x2b77e6,null))[_0x1241('0x11')](function(_0x367126){if(_0x367126){return _0x367126['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x2b77e6,null))['catch'](handleError(_0x2b77e6,null));};exports['addInteraction']=function(_0x5cde61,_0x3d1a71){return db[_0x1241('0x83')][_0x1241('0x64')]({'where':{'id':_0x5cde61[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x3d1a71,null))[_0x1241('0x11')](function(_0x561818){if(_0x561818){return _0x561818[_0x1241('0x84')](_0x5cde61[_0x1241('0x62')]['ids'],_[_0x1241('0x85')](_0x5cde61[_0x1241('0x62')],[_0x1241('0x6f'),'id'])||{});}})[_0x1241('0x11')](respondWithResult(_0x3d1a71,null))[_0x1241('0x1b')](handleError(_0x3d1a71,null));};exports['getInteractions']=function(_0x416783,_0x9f9cd7){var _0x35df7e={'raw':![],'where':{}};var _0x3ec408={};var _0x5b9a41={'count':0x0,'rows':[]};return db[_0x1241('0x48')]['findOne']({'where':{'id':_0x416783[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x9f9cd7,null))['then'](function(_0x3ab1fb){if(_0x3ab1fb){_0x3ec408[_0x1241('0x4c')]=_[_0x1241('0x4e')](db[_0x1241('0x83')][_0x1241('0x73')]);_0x3ec408[_0x1241('0x4d')]=_[_0x1241('0x4e')](_0x416783[_0x1241('0x4d')]);_0x3ec408[_0x1241('0x56')]=_[_0x1241('0x4f')](_0x3ec408[_0x1241('0x4c')],_0x3ec408['query']);_0x35df7e[_0x1241('0x50')]=_[_0x1241('0x4f')](_0x3ec408[_0x1241('0x4c')],qs['fields'](_0x416783[_0x1241('0x4d')]['fields']));_0x35df7e[_0x1241('0x50')]=_0x35df7e[_0x1241('0x50')][_0x1241('0x60')]?_0x35df7e[_0x1241('0x50')]:_0x3ec408[_0x1241('0x4c')];if(!_0x416783[_0x1241('0x4d')][_0x1241('0x52')]('nolimit')){_0x35df7e[_0x1241('0x1f')]=qs['limit'](_0x416783['query'][_0x1241('0x1f')]);_0x35df7e[_0x1241('0x1e')]=qs['offset'](_0x416783[_0x1241('0x4d')]['offset']);}_0x35df7e[_0x1241('0x6b')]=qs[_0x1241('0x54')](_0x416783[_0x1241('0x4d')][_0x1241('0x54')]);_0x35df7e[_0x1241('0x55')]=qs[_0x1241('0x56')](_[_0x1241('0x57')](_0x416783[_0x1241('0x4d')],_0x3ec408[_0x1241('0x56')]));_0x35df7e[_0x1241('0x55')][_0x1241('0x6c')]=_0x3ab1fb['id'];if(_0x416783[_0x1241('0x4d')][_0x1241('0x58')]){_0x35df7e['where']=_[_0x1241('0x59')](_0x35df7e[_0x1241('0x55')],{'$or':_[_0x1241('0x47')](_0x35df7e[_0x1241('0x50')],function(_0x5137fd){var _0x482dd6={};_0x482dd6[_0x5137fd]={'$like':'%'+_0x416783[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x482dd6;})});}_0x35df7e=_[_0x1241('0x59')]({},_0x35df7e,_0x416783[_0x1241('0x5b')]);return db[_0x1241('0x83')][_0x1241('0x21')]({'where':_0x35df7e[_0x1241('0x55')]})['then'](function(_0x3bc1ac){_0x5b9a41[_0x1241('0x21')]=_0x3bc1ac;if(_0x416783['query'][_0x1241('0x5c')]){_0x35df7e['include']=[{'model':db[_0x1241('0x86')],'as':_0x1241('0x87'),'required':![]},{'model':db[_0x1241('0x88')],'as':_0x1241('0x89'),'attributes':[_0x1241('0x2a'),_0x1241('0x8a'),'internal'],'required':![]},{'model':db[_0x1241('0x8b')],'as':'Tags','attributes':['id',_0x1241('0x2a'),_0x1241('0x8c')],'where':_0x416783[_0x1241('0x4d')][_0x1241('0x8d')]?{'id':_0x416783[_0x1241('0x4d')][_0x1241('0x8d')]}:undefined,'required':_0x416783[_0x1241('0x4d')][_0x1241('0x8d')]?!![]:![]}];}return db[_0x1241('0x83')][_0x1241('0x6d')](_0x35df7e);})[_0x1241('0x11')](function(_0x5f1d70){_0x5b9a41[_0x1241('0x5d')]=_0x5f1d70;return _0x5b9a41;});}})[_0x1241('0x11')](respondWithFilteredResult(_0x9f9cd7,_0x35df7e))[_0x1241('0x1b')](handleError(_0x9f9cd7,null));};exports[_0x1241('0x8e')]=function addApplications(_0x18f192,_0x24cf6d){var _0x266dbd=_0x18f192[_0x1241('0x5e')]['id'];var _0x5c63ff=_0x18f192['body'];var _0x2391f2=0xc8;var _0x15d4c7=null;return db['sequelize'][_0x1241('0x8f')]({'isolationLevel':db[_0x1241('0x90')][_0x1241('0x91')][_0x1241('0x92')]['READ_COMMITTED']},function(_0x17a96e){return db['MailAccount'][_0x1241('0x6a')]({'where':{'id':_0x266dbd},'transaction':_0x17a96e})['then'](function(_0x1b1693){if(_0x1b1693){return db[_0x1241('0x93')][_0x1241('0x24')]({'where':{'MailAccountId':_0x266dbd},'transaction':_0x17a96e})[_0x1241('0x11')](function(){var _0x2a54e7=_['map'](_0x5c63ff,function(_0xa93f46){_0xa93f46[_0x1241('0x6c')]=_0x266dbd;return _0xa93f46;});return db['MailApplication'][_0x1241('0x94')](_0x2a54e7,{'transaction':_0x17a96e});});}else{_0x2391f2=0x194;_0x15d4c7=[];}});})[_0x1241('0x11')](function(){if(_0x2391f2!==0x194){return db[_0x1241('0x93')][_0x1241('0x95')]({'where':{'MailAccountId':_0x266dbd},'order':'priority'})['then'](function(_0x3387bb){_0x15d4c7=_0x3387bb;});}})[_0x1241('0x1b')](function(_0x575279){_0x2391f2=0x1f4;logger[_0x1241('0x18')](_0x575279[_0x1241('0x29')]);if(_0x575279[_0x1241('0x2a')]){delete _0x575279[_0x1241('0x2a')];}_0x15d4c7=_0x575279;})[_0x1241('0x96')](function(){if(_0x15d4c7===null){_0x24cf6d[_0x1241('0x28')](_0x2391f2);}else{if(_0x2391f2===0x1f4){_0x24cf6d[_0x1241('0x1c')](_0x2391f2)[_0x1241('0x97')](_0x15d4c7);}else{_0x24cf6d['status'](_0x2391f2)[_0x1241('0x1d')](_0x15d4c7);}}});};exports[_0x1241('0x98')]=function(_0x5c5e11,_0x5cdea7){var _0x495a3b={};var _0x4272d4={};var _0x35b3e9;var _0x22fbff;return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x5c5e11['params']['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x5cdea7,null))['then'](function(_0x4217d1){if(_0x4217d1){_0x35b3e9=_0x4217d1;_0x4272d4[_0x1241('0x4c')]=_[_0x1241('0x4e')](db[_0x1241('0x93')][_0x1241('0x73')]);_0x4272d4[_0x1241('0x4d')]=_['keys'](_0x5c5e11[_0x1241('0x4d')]);_0x4272d4[_0x1241('0x56')]=_['intersection'](_0x4272d4[_0x1241('0x4c')],_0x4272d4[_0x1241('0x4d')]);_0x495a3b[_0x1241('0x50')]=_[_0x1241('0x4f')](_0x4272d4['model'],qs[_0x1241('0x51')](_0x5c5e11['query']['fields']));_0x495a3b['attributes']=_0x495a3b[_0x1241('0x50')]['length']?_0x495a3b[_0x1241('0x50')]:_0x4272d4[_0x1241('0x4c')];_0x495a3b['order']=qs[_0x1241('0x54')](_0x5c5e11['query'][_0x1241('0x54')]);_0x495a3b[_0x1241('0x55')]=qs[_0x1241('0x56')](_[_0x1241('0x57')](_0x5c5e11[_0x1241('0x4d')],_0x4272d4[_0x1241('0x56')]));if(_0x5c5e11[_0x1241('0x4d')]['filter']){_0x495a3b[_0x1241('0x55')]=_['merge'](_0x495a3b[_0x1241('0x55')],{'$or':_['map'](_0x495a3b[_0x1241('0x50')],function(_0x857964){var _0x37a049={};_0x37a049[_0x857964]={'$like':'%'+_0x5c5e11[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x37a049;})});}_0x495a3b=_[_0x1241('0x59')]({},_0x495a3b,_0x5c5e11[_0x1241('0x5b')]);return _0x35b3e9[_0x1241('0x98')](_0x495a3b);}})[_0x1241('0x11')](function(_0x870a6d){if(_0x870a6d){_0x22fbff=_0x870a6d['length'];if(!_0x5c5e11['query'][_0x1241('0x52')](_0x1241('0x53'))){_0x495a3b['limit']=qs['limit'](_0x5c5e11['query'][_0x1241('0x1f')]);_0x495a3b[_0x1241('0x1e')]=qs[_0x1241('0x1e')](_0x5c5e11[_0x1241('0x4d')]['offset']);}return _0x35b3e9['getApplications'](_0x495a3b);}})['then'](function(_0xae3908){if(_0xae3908){return _0xae3908?{'count':_0x22fbff,'rows':_0xae3908}:null;}})[_0x1241('0x11')](respondWithResult(_0x5cdea7,null))[_0x1241('0x1b')](handleError(_0x5cdea7,null));};exports[_0x1241('0x99')]=function(_0x3d5516,_0x2319e8){var _0x47f4e3={'raw':!![],'where':{}};var _0x400522={};var _0x26101e={'count':0x0,'rows':[]};return db[_0x1241('0x48')]['findOne']({'where':{'id':_0x3d5516[_0x1241('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2319e8,null))[_0x1241('0x11')](function(_0x23aeb5){if(_0x23aeb5){_0x400522[_0x1241('0x4c')]=_['keys'](db[_0x1241('0x9a')][_0x1241('0x73')]);_0x400522['query']=_[_0x1241('0x4e')](_0x3d5516[_0x1241('0x4d')]);_0x400522[_0x1241('0x56')]=_[_0x1241('0x4f')](_0x400522[_0x1241('0x4c')],_0x400522[_0x1241('0x4d')]);_0x47f4e3[_0x1241('0x50')]=_['intersection'](_0x400522[_0x1241('0x4c')],qs[_0x1241('0x51')](_0x3d5516['query'][_0x1241('0x51')]));_0x47f4e3[_0x1241('0x50')]=_0x47f4e3[_0x1241('0x50')][_0x1241('0x60')]?_0x47f4e3[_0x1241('0x50')]:_0x400522['model'];if(!_0x3d5516['query'][_0x1241('0x52')]('nolimit')){_0x47f4e3[_0x1241('0x1f')]=qs[_0x1241('0x1f')](_0x3d5516[_0x1241('0x4d')][_0x1241('0x1f')]);_0x47f4e3[_0x1241('0x1e')]=qs['offset'](_0x3d5516[_0x1241('0x4d')]['offset']);}_0x47f4e3[_0x1241('0x6b')]=qs[_0x1241('0x54')](_0x3d5516[_0x1241('0x4d')]['sort']);_0x47f4e3[_0x1241('0x55')]=qs['filters'](_[_0x1241('0x57')](_0x3d5516[_0x1241('0x4d')],_0x400522[_0x1241('0x56')]));_0x47f4e3['where'][_0x1241('0x6c')]=_0x23aeb5['id'];if(_0x3d5516['query']['filter']){_0x47f4e3[_0x1241('0x55')]=_[_0x1241('0x59')](_0x47f4e3[_0x1241('0x55')],{'$or':_[_0x1241('0x47')](_0x47f4e3[_0x1241('0x50')],function(_0x5b2eb7){var _0x1f8498={};_0x1f8498[_0x5b2eb7]={'$like':'%'+_0x3d5516['query'][_0x1241('0x58')]+'%'};return _0x1f8498;})});}if(_0x3d5516[_0x1241('0x4d')][_0x1241('0x9b')]){var _0x120430=_0x3d5516[_0x1241('0x4d')][_0x1241('0x9b')]['split'](',');var _0x973f3a={};_0x973f3a[_0x120430[0x0]]={'$gte':moment(_0x120430[0x1])[_0x1241('0x9c')](_0x1241('0x9d'))};_0x47f4e3['where']=_[_0x1241('0x59')](_0x47f4e3[_0x1241('0x55')],_0x973f3a);}_0x47f4e3=_[_0x1241('0x59')]({},_0x47f4e3,_0x3d5516[_0x1241('0x5b')]);return db[_0x1241('0x9a')][_0x1241('0x21')]({'where':_0x47f4e3[_0x1241('0x55')]})[_0x1241('0x11')](function(_0x152037){_0x26101e[_0x1241('0x21')]=_0x152037;if(_0x3d5516['query'][_0x1241('0x5c')]){_0x47f4e3[_0x1241('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0x1241('0x6d')](_0x47f4e3);})[_0x1241('0x11')](function(_0x58e87d){if(_0x3d5516[_0x1241('0x4d')][_0x1241('0x9e')]===_0x1241('0x9f')){for(var _0x219ad5=0x0;_0x219ad5<_0x58e87d['length'];_0x219ad5++){_0x58e87d[_0x219ad5][_0x1241('0x62')]=juice(_0x58e87d[_0x219ad5][_0x1241('0x62')]);}}_0x26101e[_0x1241('0x5d')]=_0x58e87d;return _0x26101e;});}})[_0x1241('0x11')](respondWithFilteredResult(_0x2319e8,_0x47f4e3))['catch'](handleError(_0x2319e8,null));};exports[_0x1241('0x97')]=function(_0x3f07de,_0x23d9bf){var _0xa1c149,_0x405125={},_0x59a2e2;if(_0x3f07de[_0x1241('0x62')]['to']){_0x59a2e2=_0x3f07de['body']['to'][_0x1241('0xa0')](',')[0x0];}return db['MailAccount'][_0x1241('0x64')]({'where':{'id':_0x3f07de[_0x1241('0x5e')]['id']},'include':[{'model':db[_0x1241('0xa1')],'as':_0x1241('0xa2'),'include':[{'model':db[_0x1241('0x86')],'as':'Contacts','where':{'email':_0x59a2e2},'limit':0x1,'order':[[_0x1241('0xa3'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x1241('0x43'),'raw':!![],'include':[{'model':db[_0x1241('0xa4')],'as':_0x1241('0xa4'),'raw':!![]}]}]})[_0x1241('0x11')](handleEntityNotFound(_0x23d9bf,null))[_0x1241('0x11')](function(_0x2b67fc){if(!_0x2b67fc)return;_0xa1c149=_0x2b67fc;if(!_0x2b67fc[_0x1241('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x1241('0x78')](_0x3f07de['body'][_0x1241('0xa5')])){_0x3f07de[_0x1241('0x62')][_0x1241('0xa5')]=util[_0x1241('0x9c')](_0x1241('0xa6'),_0x2b67fc[_0x1241('0x2a')],_0x2b67fc['email']||_0x2b67fc[_0x1241('0x43')]['user']);}if(_0x3f07de['body'][_0x1241('0xa7')]&&_0x3f07de[_0x1241('0x62')][_0x1241('0xa7')][_0x1241('0x60')]){for(var _0x41a1ea=0x0;_0x41a1ea<_0x3f07de[_0x1241('0x62')][_0x1241('0xa7')][_0x1241('0x60')];_0x41a1ea+=0x1){_0x3f07de[_0x1241('0x62')][_0x1241('0xa7')][_0x41a1ea]={'filename':_0x3f07de[_0x1241('0x62')][_0x1241('0xa7')][_0x41a1ea][_0x1241('0x2a')],'path':path[_0x1241('0xa8')](config[_0x1241('0xa9')],_0x1241('0xaa'),_0x3f07de[_0x1241('0x62')][_0x1241('0xa7')][_0x41a1ea][_0x1241('0xab')])};}}var _0x3b84bb=_0x2b67fc['getSmtpOptions']();return respondWithRpcPromise(_0x1241('0xac'),_0x1241('0xad'),{'account':_0x3b84bb,'message':_0x3f07de[_0x1241('0x62')]});})[_0x1241('0x11')](function(_0x23aad5){if(!_0x23aad5)return;_0x405125=_0x23aad5;if(!_0xa1c149[_0x1241('0xa2')])throw new Error(_0x1241('0xae'));if(_0xa1c149[_0x1241('0xa2')][_0x1241('0xaf')]['length'])return _0xa1c149['List']['Contacts'][0x0];return db[_0x1241('0x86')][_0x1241('0x68')](_[_0x1241('0xa')](_0x3f07de[_0x1241('0x62')],{'firstName':_0x3f07de['body']['to'],'email':_0x3f07de['body']['to'],'phone':_0x3f07de[_0x1241('0x62')]['to'],'ListId':_0xa1c149['ListId']}));})[_0x1241('0x11')](function(_0x60a357){if(!_0x60a357)return;var _0xc69817={'UserId':_0x3f07de['user']['id'],'ContactId':_0x60a357['id'],'MailAccountId':_0xa1c149['id'],'inReplyTo':_0x405125[_0x1241('0xb0')],'to':_0x3f07de['body'][_0x1241('0xa5')],'cc':_0x3f07de[_0x1241('0x62')]['cc'],'subject':_0x3f07de[_0x1241('0x62')][_0x1241('0xb1')],'attach':_0x3f07de[_0x1241('0x62')]['attach'],'firstMsgDirection':_0x1241('0xb2'),'lastMsgAt':moment()[_0x1241('0x9c')](_0x1241('0x9d')),'lastMsgDirection':'out','Messages':[_[_0x1241('0x59')](_0x3f07de[_0x1241('0x62')],{'messageId':_0x405125[_0x1241('0xb0')],'sentAt':moment()[_0x1241('0x9c')](_0x1241('0x9d')),'read':!![],'MailAccountId':_0xa1c149['id'],'UserId':_0x3f07de['user']['id'],'ContactId':_0x60a357['id']})]};if(_0x3f07de[_0x1241('0x62')][_0x1241('0xb3')]){_0xc69817=_[_0x1241('0x59')](_0xc69817,_0x3f07de[_0x1241('0x62')][_0x1241('0xb3')]);}return db[_0x1241('0x83')][_0x1241('0x68')](_0xc69817,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})['then'](respondWithResult(_0x23d9bf,null))[_0x1241('0x1b')](handleError(_0x23d9bf,null));};exports[_0x1241('0xb4')]=function(_0x38119a,_0x34ef0b){return db['MailAccount'][_0x1241('0x64')]({'where':{'id':_0x38119a[_0x1241('0x5e')]['id']},'include':[{'model':db[_0x1241('0x45')],'as':_0x1241('0x43'),'raw':!![],'include':[{'model':db[_0x1241('0xa4')],'as':_0x1241('0xa4'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x34ef0b,null))[_0x1241('0x11')](function(_0x10ec93){if(!_0x10ec93[_0x1241('0x43')])return;var _0x2d5506=_0x10ec93['getSmtpOptions']();return respondWithRpcPromise(_0x1241('0xb5'),_0x1241('0xb4'),{'account':_0x2d5506});})[_0x1241('0x11')](respondWithResult(_0x34ef0b,null))[_0x1241('0x1b')](handleError(_0x34ef0b,null));};exports[_0x1241('0x24')]=function(_0x3d5460,_0x29677f){return db[_0x1241('0x48')]['find']({'where':{'id':_0x3d5460[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x29677f,null))['then'](function(_0x3739c8){if(_0x3739c8&&_0x3739c8[_0x1241('0x40')]){throw new db[(_0x1241('0xb6'))]['ValidationError'](_0x1241('0xb7'));}return _0x3739c8;})[_0x1241('0x11')](removeEntity(_0x29677f,null))['catch'](handleError(_0x29677f,null));};exports[_0x1241('0xb8')]=function(_0x494595,_0x3709f7){return db[_0x1241('0x48')][_0x1241('0x64')]({'where':{'id':_0x494595[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x3709f7,null))['then'](function(_0x5943a1){if(_0x5943a1){return _0x5943a1['addAgents'](_0x494595['body'][_0x1241('0x6f')],_[_0x1241('0x85')](_0x494595[_0x1241('0x62')],['ids','id'])||{})['spread'](function(_0x1790c5){for(var _0x24dc9b=0x0;_0x24dc9b<_0x494595[_0x1241('0x62')][_0x1241('0x6f')][_0x1241('0x60')];_0x24dc9b+=0x1){socket[_0x1241('0xb9')](_0x1241('0xba'),{'UserId':Number(_0x494595[_0x1241('0x62')][_0x1241('0x6f')][_0x24dc9b]),'MailAccountId':Number(_0x494595[_0x1241('0x5e')]['id'])});}return _0x1790c5;});}})[_0x1241('0x11')](respondWithResult(_0x3709f7,null))[_0x1241('0x1b')](handleError(_0x3709f7,null));};exports[_0x1241('0xbb')]=function(_0x239db4,_0x52905a){return db[_0x1241('0x48')][_0x1241('0x64')]({'where':{'id':_0x239db4[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x52905a,null))['then'](function(_0x20d569){if(_0x20d569){return _0x20d569[_0x1241('0xbb')](_0x239db4['query']['ids'])[_0x1241('0x11')](function(){if(_[_0x1241('0xbc')](_0x239db4[_0x1241('0x4d')][_0x1241('0x6f')])){for(var _0xd950dd=0x0;_0xd950dd<_0x239db4[_0x1241('0x4d')][_0x1241('0x6f')][_0x1241('0x60')];_0xd950dd+=0x1){socket[_0x1241('0xb9')](_0x1241('0xbd'),{'UserId':Number(_0x239db4['query'][_0x1241('0x6f')][_0xd950dd]),'MailAccountId':Number(_0x239db4[_0x1241('0x5e')]['id'])});}}else{socket[_0x1241('0xb9')](_0x1241('0xbd'),{'UserId':Number(_0x239db4['query'][_0x1241('0x6f')]),'MailAccountId':Number(_0x239db4[_0x1241('0x5e')]['id'])});}});}})[_0x1241('0x11')](respondWithStatusCode(_0x52905a,null))[_0x1241('0x1b')](handleError(_0x52905a,null));};exports[_0x1241('0xbe')]=function(_0x49f317,_0x32ed0e){var _0x1bdf9a={};var _0x23eb58={};var _0x48279f;var _0x926c1e;return db[_0x1241('0x48')][_0x1241('0x6a')]({'where':{'id':_0x49f317[_0x1241('0x5e')]['id']}})[_0x1241('0x11')](handleEntityNotFound(_0x32ed0e,null))[_0x1241('0x11')](function(_0x4eaaf1){if(_0x4eaaf1){_0x48279f=_0x4eaaf1;_0x23eb58[_0x1241('0x4c')]=_[_0x1241('0x4e')](db[_0x1241('0x88')][_0x1241('0x73')]);_0x23eb58['query']=_[_0x1241('0x4e')](_0x49f317['query']);_0x23eb58[_0x1241('0x56')]=_[_0x1241('0x4f')](_0x23eb58['model'],_0x23eb58[_0x1241('0x4d')]);_0x1bdf9a[_0x1241('0x50')]=_[_0x1241('0x4f')](_0x23eb58[_0x1241('0x4c')],qs[_0x1241('0x51')](_0x49f317['query'][_0x1241('0x51')]));_0x1bdf9a[_0x1241('0x50')]=_0x1bdf9a[_0x1241('0x50')]['length']?_0x1bdf9a['attributes']:_0x23eb58['model'];_0x1bdf9a[_0x1241('0x6b')]=qs['sort'](_0x49f317[_0x1241('0x4d')][_0x1241('0x54')]);_0x1bdf9a[_0x1241('0x55')]=qs['filters'](_[_0x1241('0x57')](_0x49f317[_0x1241('0x4d')],_0x23eb58[_0x1241('0x56')]));if(_0x49f317[_0x1241('0x4d')][_0x1241('0x58')]){_0x1bdf9a[_0x1241('0x55')]=_[_0x1241('0x59')](_0x1bdf9a[_0x1241('0x55')],{'$or':_[_0x1241('0x47')](_0x1bdf9a[_0x1241('0x50')],function(_0x19fb94){var _0x2a5985={};_0x2a5985[_0x19fb94]={'$like':'%'+_0x49f317[_0x1241('0x4d')][_0x1241('0x58')]+'%'};return _0x2a5985;})});}_0x1bdf9a=_[_0x1241('0x59')]({},_0x1bdf9a,_0x49f317['options']);return _0x48279f['getAgents'](_0x1bdf9a);}})[_0x1241('0x11')](function(_0x233753){if(_0x233753){_0x926c1e=_0x233753[_0x1241('0x60')];if(!_0x49f317[_0x1241('0x4d')][_0x1241('0x52')](_0x1241('0x53'))){_0x1bdf9a[_0x1241('0x1f')]=qs[_0x1241('0x1f')](_0x49f317[_0x1241('0x4d')]['limit']);_0x1bdf9a['offset']=qs['offset'](_0x49f317[_0x1241('0x4d')][_0x1241('0x1e')]);}return _0x48279f[_0x1241('0xbe')](_0x1bdf9a);}})[_0x1241('0x11')](function(_0x93579c){if(_0x93579c){return _0x93579c?{'count':_0x926c1e,'rows':_0x93579c}:null;}})[_0x1241('0x11')](respondWithResult(_0x32ed0e,null))['catch'](handleError(_0x32ed0e,null));};
\ No newline at end of file
index fab33ab..99272e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d4=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4cbdb7,_0x1b82f6){var _0x4ecb18=function(_0x48271f){while(--_0x48271f){_0x4cbdb7['push'](_0x4cbdb7['shift']());}};_0x4ecb18(++_0x1b82f6);}(_0xa6d4,0x1dd));var _0x4a6d=function(_0x112150,_0x5ebe77){_0x112150=_0x112150-0x0;var _0x39c69d=_0xa6d4[_0x112150];return _0x39c69d;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4a6d('0x0'))['db'][_0x4a6d('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4a6d('0x2')](0x0);var events={'afterCreate':_0x4a6d('0x3'),'afterUpdate':_0x4a6d('0x4'),'afterDestroy':_0x4a6d('0x5')};function emitEvent(_0x24877e){return function(_0x39bc96,_0xfb5d26,_0x43319b){MailAccountEvents[_0x4a6d('0x6')](_0x24877e+':'+_0x39bc96['id'],_0x39bc96);MailAccountEvents['emit'](_0x24877e,_0x39bc96);_0x43319b(null);};}for(var e in events){if(events[_0x4a6d('0x7')](e)){var event=events[e];MailAccount[_0x4a6d('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0x3e0c=['exports','events','../../mysqldb','MailAccount','save','update','remove'];(function(_0x242047,_0x527f4b){var _0x4cfd65=function(_0x4447b3){while(--_0x4447b3){_0x242047['push'](_0x242047['shift']());}};_0x4cfd65(++_0x527f4b);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x31aa4b,_0x468550){_0x31aa4b=_0x31aa4b-0x0;var _0x49f208=_0x3e0c[_0x31aa4b];return _0x49f208;};'use strict';var EventEmitter=require(_0xc3e0('0x0'));var MailAccount=require(_0xc3e0('0x1'))['db'][_0xc3e0('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e0('0x3'),'afterUpdate':_0xc3e0('0x4'),'afterDestroy':_0xc3e0('0x5')};function emitEvent(_0x2ba135){return function(_0xba1d4c,_0x49e5b7,_0x88cddb){MailAccountEvents['emit'](_0x2ba135+':'+_0xba1d4c['id'],_0xba1d4c);MailAccountEvents['emit'](_0x2ba135,_0xba1d4c);_0x88cddb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc3e0('0x6')]=MailAccountEvents;
\ No newline at end of file
index 3567570..0d3d7c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ec=['OAuth2','user','auth','pass','./mailAccount.attributes','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x91ec,0x19c));var _0xc91e=function(_0x4017d2,_0x18a662){_0x4017d2=_0x4017d2-0x0;var _0x59ccc6=_0x91ec[_0x4017d2];return _0x59ccc6;};'use strict';var attributes=require(_0xc91e('0x0'));module['exports']=function(_0x33686f){return _0x33686f['define'](_0xc91e('0x1'),attributes,{'tableName':_0xc91e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1ac51b=this;var _0x324106={'id':_0x1ac51b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1ac51b[_0xc91e('0x3')]!==_0xc91e('0x4')){_0x324106['service']=_0x1ac51b[_0xc91e('0x3')];}else{_0x324106[_0xc91e('0x5')]=_0x1ac51b[_0xc91e('0x6')][_0xc91e('0x5')];_0x324106[_0xc91e('0x7')]=_0x1ac51b[_0xc91e('0x6')][_0xc91e('0x7')];_0x324106[_0xc91e('0x8')]=_0x1ac51b[_0xc91e('0x6')]['secure'];}if(_0x1ac51b[_0xc91e('0x6')][_0xc91e('0x9')]){if(_0x1ac51b[_0xc91e('0x6')][_0xc91e('0xa')]){if(!_0x1ac51b['Smtp'][_0xc91e('0xb')])throw new Error(_0xc91e('0xc'));_0x324106['auth']={'type':_0xc91e('0xd'),'user':_0x1ac51b[_0xc91e('0x6')][_0xc91e('0xe')],'accessToken':_0x1ac51b['Smtp'][_0xc91e('0xb')]['data5']};}else{_0x324106[_0xc91e('0xf')]={'user':_0x1ac51b[_0xc91e('0x6')]['user'],'pass':_0x1ac51b[_0xc91e('0x6')][_0xc91e('0x10')]};}}return _0x324106;}}});};
\ No newline at end of file
+var _0x28c8=['provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x44d2ec,_0xcd5ebb){var _0x406e26=function(_0x14f9cb){while(--_0x14f9cb){_0x44d2ec['push'](_0x44d2ec['shift']());}};_0x406e26(++_0xcd5ebb);}(_0x28c8,0xf3));var _0x828c=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x28c8[_0x11a55c];return _0x26c390;};'use strict';var attributes=require(_0x828c('0x0'));module[_0x828c('0x1')]=function(_0x2dd199){return _0x2dd199['define'](_0x828c('0x2'),attributes,{'tableName':_0x828c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x246868=this;var _0x5eb5cc={'id':_0x246868['id'],'tls':{'rejectUnauthorized':![]}};if(_0x246868[_0x828c('0x4')]!==_0x828c('0x5')){_0x5eb5cc[_0x828c('0x6')]=_0x246868[_0x828c('0x4')];}else{_0x5eb5cc[_0x828c('0x7')]=_0x246868[_0x828c('0x8')][_0x828c('0x7')];_0x5eb5cc['port']=_0x246868[_0x828c('0x8')][_0x828c('0x9')];_0x5eb5cc[_0x828c('0xa')]=_0x246868['Smtp']['secure'];}if(_0x246868[_0x828c('0x8')][_0x828c('0xb')]){if(_0x246868[_0x828c('0x8')][_0x828c('0xc')]){if(!_0x246868[_0x828c('0x8')][_0x828c('0xd')])throw new Error(_0x828c('0xe'));_0x5eb5cc[_0x828c('0xf')]={'type':_0x828c('0x10'),'user':_0x246868[_0x828c('0x8')]['user'],'accessToken':_0x246868[_0x828c('0x8')]['CloudProvider'][_0x828c('0x11')]};}else{_0x5eb5cc['auth']={'user':_0x246868[_0x828c('0x8')]['user'],'pass':_0x246868[_0x828c('0x8')][_0x828c('0x12')]};}}return _0x5eb5cc;}}});};
\ No newline at end of file
index 7b1431f..aa000cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['MailMessage','Messages','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','UserId','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','list','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4975,0x86));var _0x5497=function(_0x551834,_0xecfee5){_0x551834=_0x551834-0x0;var _0x3f388e=_0x4975[_0x551834];return _0x3f388e;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var BPromise=require(_0x5497('0x1'));var rs=require(_0x5497('0x2'));var Redis=require(_0x5497('0x3'));var db=require(_0x5497('0x4'))['db'];var logger=require(_0x5497('0x5'))(_0x5497('0x6'));var config=require(_0x5497('0x7'));var jayson=require(_0x5497('0x8'));var client=jayson[_0x5497('0x9')][_0x5497('0xa')]({'port':0x232c});config['redis']=_[_0x5497('0xb')](config['redis'],{'host':_0x5497('0xc'),'port':0x18eb});var socket=require(_0x5497('0xd'))(new Redis(config[_0x5497('0xe')]));require('./mailAccount.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x49d94b,_0x1f63d8,_0x29c93f){return new BPromise(function(_0x2ec5a4,_0x32a8a2){return client[_0x5497('0x10')](_0x49d94b,_0x29c93f)[_0x5497('0x11')](function(_0x3e7886){logger[_0x5497('0x12')]('MailAccount,\x20%s,\x20%s',_0x1f63d8,'request\x20sent');logger['debug'](_0x5497('0x13'),_0x1f63d8,_0x5497('0x14'),JSON[_0x5497('0x15')](_0x3e7886));if(_0x3e7886[_0x5497('0x16')]){if(_0x3e7886[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x32a8a2(_0x3e7886['error'][_0x5497('0x19')]);}logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x2ec5a4(_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);}else{logger[_0x5497('0x12')](_0x5497('0x18'),_0x1f63d8,'request\x20sent');_0x2ec5a4(_0x3e7886['result'][_0x5497('0x19')]);}})[_0x5497('0x1a')](function(_0x3a47fd){logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3a47fd);_0x32a8a2(_0x3a47fd);});});}exports[_0x5497('0x1b')]=function(_0x18e8a8){var _0x43da2c=this;return new Promise(function(_0x1b1b43,_0x1f6f18){return db[_0x5497('0x1c')][_0x5497('0x1d')]({'raw':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x18e8a8['options']?_0x18e8a8[_0x5497('0x1e')]['where']||null:null,'attributes':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'limit':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x21')]||null:null,'include':_0x18e8a8['options']?_0x18e8a8['options'][_0x5497('0x22')]?_[_0x5497('0x23')](_0x18e8a8[_0x5497('0x1e')][_0x5497('0x22')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x24')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x22')]?_[_0x5497('0x23')](_0x5223b5[_0x5497('0x22')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x24')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x20')],'include':_0x34a1a5['include']?_[_0x5497('0x23')](_0x34a1a5['include'],function(_0x583d06){return{'model':db[_0x583d06['model']],'as':_0x583d06['as'],'attributes':_0x583d06[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9356){logger[_0x5497('0x12')](_0x5497('0x1b'),_0x18e8a8);logger[_0x5497('0x25')]('GetMailAccount',_0x18e8a8,JSON['stringify'](_0x5e9356));_0x1b1b43(_0x5e9356);})['catch'](function(_0x371874){logger[_0x5497('0x16')](_0x5497('0x1b'),_0x371874['message'],_0x18e8a8);_0x1f6f18(_0x43da2c['error'](0x1f4,_0x371874['message']));});});};exports[_0x5497('0x26')]=function(_0x572460){var _0x438ee4=this;return new Promise(function(_0x258c2d,_0x77c575){return db['MailAccount'][_0x5497('0x27')]({'raw':_0x572460[_0x5497('0x1e')]?_0x572460['options'][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['where']||null:null,'attributes':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'include':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['include']?_[_0x5497('0x23')](_0x572460[_0x5497('0x1e')]['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x24')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x20')],'include':_0x1ffc9b[_0x5497('0x22')]?_[_0x5497('0x23')](_0x1ffc9b[_0x5497('0x22')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x24')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes'],'include':_0x580e86[_0x5497('0x22')]?_[_0x5497('0x23')](_0x580e86[_0x5497('0x22')],function(_0x5ab18c){return{'model':db[_0x5ab18c['model']],'as':_0x5ab18c['as'],'attributes':_0x5ab18c[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5497('0x11')](function(_0x326d48){if(_0x572460[_0x5497('0x1e')][_0x5497('0x28')]===!![])_0x326d48[_0x5497('0x29')]('smtpOptions',_0x326d48[_0x5497('0x2a')]());logger[_0x5497('0x12')](_0x5497('0x26'),_0x572460);logger[_0x5497('0x25')](_0x5497('0x26'),_0x572460,JSON[_0x5497('0x15')](_0x326d48));_0x258c2d(_0x326d48);})[_0x5497('0x1a')](function(_0x179635){logger[_0x5497('0x16')]('ShowMailAccount',_0x179635[_0x5497('0x19')],_0x572460);_0x77c575(_0x438ee4[_0x5497('0x16')](0x1f4,_0x179635[_0x5497('0x19')]));});});};exports[_0x5497('0x2b')]=function(_0x15029d){var _0xa5ebe6=this;return new Promise(function(_0x4299be,_0x59ed13){var _0x3e5f7d={'body':_0x15029d[_0x5497('0x2c')],'channel':_0x5497('0x2d')};var _0x35993c=_[_0x5497('0x2e')](_[_0x5497('0x2f')](db[_0x5497('0x30')]['rawAttributes']),[_0x5497('0x31'),_0x5497('0x32'),_0x5497('0x33'),_0x5497('0x34')]);var _0x20e947=![];if(_0x15029d[_0x5497('0x2c')]['id']){delete _0x15029d[_0x5497('0x2c')]['id'];}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')][_0x5497('0x36')])){return _0x59ed13(_0xa5ebe6['error'](0x1f4,_0x5497('0x37')));}if(_['isNil'](_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')])||_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')]===''){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')]['mapKey'])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35993c));}if(!_[_0x5497('0x38')](_0x35993c,_0x15029d['body'][_0x5497('0x39')])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,_0x5497('0x3a')+_0x35993c));}var _0x3a852a={};_0x3a852a[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body']['from'];return db['MailAccount'][_0x5497('0x27')]({'where':{'id':_0x15029d[_0x5497('0x3b')]['id']},'include':[{'model':db[_0x5497('0x3c')],'as':_0x5497('0x3d'),'include':[{'model':db[_0x5497('0x30')],'as':_0x5497('0x3e'),'where':_0x3a852a,'limit':0x1,'order':[[_0x5497('0x32'),_0x5497('0x3f')]]}]},{'model':db[_0x5497('0x40')],'as':'Applications'},{'model':db[_0x5497('0x41')],'as':_0x5497('0x42'),'include':[{'model':db[_0x5497('0x43')],'as':'CloudProvider'}]}]})[_0x5497('0x11')](function(_0x530475){if(_0x530475&&_0x530475[_0x5497('0x3d')]){var _0x31f1ba=_0x530475[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d['account']=_[_0x5497('0x45')](_0x31f1ba,[_0x5497('0x46'),'List']);_0x3e5f7d[_0x5497('0x3b')]['smtpOptions']=_0x530475[_0x5497('0x2a')]();_0x3e5f7d['applications']=_0x31f1ba[_0x5497('0x46')];_0x3e5f7d[_0x5497('0x47')]=_0x31f1ba[_0x5497('0x3d')];_0x3e5f7d[_0x5497('0x48')]=_[_0x5497('0x49')](_0x3e5f7d[_0x5497('0x48')],[_0x5497('0x4a')],[_0x5497('0x4b')]);if(_0x3e5f7d['account']&&_0x3e5f7d[_0x5497('0x3b')]['autoclose']){_0x3e5f7d['applications'][_0x5497('0x4c')]({'id':0x0,'priority':_0x3e5f7d[_0x5497('0x48')]['length']+0x1,'app':_0x5497('0x4d'),'appdata':_0x5497('0x4e'),'interval':_0x5497('0x4f')});}if(_0x3e5f7d[_0x5497('0x3b')]['Applications']){delete _0x3e5f7d[_0x5497('0x3b')]['Applications'];}if(_0x3e5f7d['account'][_0x5497('0x3d')]){delete _0x3e5f7d[_0x5497('0x3b')][_0x5497('0x3d')];}if(_0x31f1ba['List']['Contacts'][_0x5497('0x50')]){return _0x31f1ba['List'][_0x5497('0x3e')][0x0];}var _0x530431=_[_0x5497('0xb')](_0x15029d['body'],{'firstName':_0x15029d[_0x5497('0x2c')][_0x5497('0x36')],'ListId':_0x31f1ba['ListId']});_0x530431[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body'][_0x5497('0x36')];return db[_0x5497('0x30')]['create'](_0x530431);}else{throw new Error(_0x5497('0x51'));}})[_0x5497('0x11')](function(_0x1dbab2){_0x3e5f7d[_0x5497('0x52')]=_0x1dbab2;if(_0x1dbab2){if(!_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId']){_0x15029d[_0x5497('0x2c')]['message']['messageId']=rs['generate']()+'\x20'+_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')];}var _0x544085={'ContactId':_0x1dbab2['id'],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'inReplyTo':_0x15029d['body']['message'][_0x5497('0x53')],'to':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['attach'],'lastMsgAt':moment()[_0x5497('0x55')](_0x5497('0x56')),'lastMsgDirection':'in'};return db[_0x5497('0x57')][_0x5497('0x27')]({'where':{'closed':![],'MailAccountId':_0x15029d['account']['id']},'include':[{'model':db[_0x5497('0x58')],'as':_0x5497('0x59'),'attributes':[_0x5497('0x53')],'where':{'messageId':_0x15029d['body'][_0x5497('0x19')]['inReplyTo']}}]})['then'](function(_0x53e050){if(_0x53e050){return[_0x53e050,![]];}return db[_0x5497('0x57')][_0x5497('0x5a')](_0x544085)[_0x5497('0x11')](function(_0x4e7d4c){return[_0x4e7d4c,!![]];});});}else{throw new Error(_0x5497('0x5b'));}})[_0x5497('0x5c')](function(_0x3cfebc,_0x35e75a){if(_0x3cfebc){_0x20e947=_0x35e75a;if(!_0x35e75a){return _0x3cfebc['update']({'inReplyTo':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x53')],'to':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x3cfebc['attach']?_0x3cfebc[_0x5497('0x5d')]:_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5497('0x56')),'lastMsgDirection':'in'});}else{return _0x3cfebc;}}})[_0x5497('0x11')](function(_0x179bbc){_0x3e5f7d['interaction']=_0x179bbc[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x5f')]=_0x20e947;return db[_0x5497('0x58')][_0x5497('0x5a')]({'body':_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'MailInteractionId':_0x179bbc['id'],'direction':'in','ContactId':_0x3e5f7d[_0x5497('0x52')]['id'],'messageId':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId'],'from':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'to':_0x15029d['body'][_0x5497('0x19')]['to'],'cc':_0x15029d['body'][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'Attachments':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x60')],'originTo':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x61')],'originCc':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x62')],'bcc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['bcc'],'ChatWebsiteId':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x63')]||null,'originChannel':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x64')]||_0x5497('0x65'),'ChatOfflineMessageId':_0x15029d[_0x5497('0x2c')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5497('0x66')],'as':_0x5497('0x67')}]});})['then'](function(_0x15ca59){_0x3e5f7d[_0x5497('0x19')]=_0x15ca59;if(_0x3e5f7d[_0x5497('0x5e')]['UserId']){return db[_0x5497('0x68')][_0x5497('0x27')]({'attributes':['id','name'],'where':{'id':_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x69')]}})[_0x5497('0x11')](function(_0x42d745){if(_0x42d745){_0x3e5f7d[_0x5497('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5497('0x6a'),'appdata':_0x42d745[_0x5497('0x6b')]+','+(_0x3e5f7d[_0x5497('0x3b')][_0x5497('0x6c')]||0xa),'interval':_0x5497('0x4f')});}return respondWithRpcPromise('Start',_0x5497('0x6d'),_0x3e5f7d);});}return respondWithRpcPromise(_0x5497('0x6e'),_0x5497('0x6d'),_0x3e5f7d);})[_0x5497('0x11')](function(_0x521d74){_0x4299be(_0x521d74);})[_0x5497('0x1a')](function(_0x21fc4e){_0x59ed13(_0xa5ebe6['error'](0x1f4,_0x21fc4e[_0x5497('0x19')]));});});};
\ No newline at end of file
+var _0xdb28=['DESC','MailApplication','Applications','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','Contacts','create','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','then','find','smtp','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','difference','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact'];(function(_0x264874,_0x2d3294){var _0x50c1c2=function(_0x5451ee){while(--_0x5451ee){_0x264874['push'](_0x264874['shift']());}};_0x50c1c2(++_0x2d3294);}(_0xdb28,0x106));var _0x8db2=function(_0x43bc0e,_0x2c9998){_0x43bc0e=_0x43bc0e-0x0;var _0x19e638=_0xdb28[_0x43bc0e];return _0x19e638;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var BPromise=require(_0x8db2('0x2'));var rs=require(_0x8db2('0x3'));var Redis=require('ioredis');var db=require(_0x8db2('0x4'))['db'];var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var jayson=require(_0x8db2('0x8'));var client=jayson['client'][_0x8db2('0x9')]({'port':0x232c});config[_0x8db2('0xa')]=_['defaults'](config['redis'],{'host':_0x8db2('0xb'),'port':0x18eb});var socket=require(_0x8db2('0xc'))(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xd'))[_0x8db2('0xe')](socket);function respondWithRpcPromise(_0x1ff362,_0x126c78,_0x4ba340){return new BPromise(function(_0x30dc90,_0x476216){return client[_0x8db2('0xf')](_0x1ff362,_0x4ba340)['then'](function(_0x1d9371){logger[_0x8db2('0x10')]('MailAccount,\x20%s,\x20%s',_0x126c78,_0x8db2('0x11'));logger[_0x8db2('0x12')](_0x8db2('0x13'),_0x126c78,_0x8db2('0x11'),JSON[_0x8db2('0x14')](_0x1d9371));if(_0x1d9371['error']){if(_0x1d9371['error'][_0x8db2('0x15')]===0x1f4){logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);return _0x476216(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')]['message']);return _0x30dc90(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}else{logger['info'](_0x8db2('0x17'),_0x126c78,_0x8db2('0x11'));_0x30dc90(_0x1d9371[_0x8db2('0x19')][_0x8db2('0x18')]);}})[_0x8db2('0x1a')](function(_0x46ce14){logger['error']('MailAccount,\x20%s,\x20%s',_0x126c78,_0x46ce14);_0x476216(_0x46ce14);});});}exports[_0x8db2('0x1b')]=function(_0x104e33){var _0x1310d3=this;return new Promise(function(_0x1b64e4,_0x58562e){return db[_0x8db2('0x1c')][_0x8db2('0x1d')]({'raw':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x1f')]===undefined?!![]:![]:!![],'where':_0x104e33['options']?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'limit':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')]['limit']||null:null,'include':_0x104e33[_0x8db2('0x1e')]?_0x104e33['options']['include']?_['map'](_0x104e33['options'][_0x8db2('0x22')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x23')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x21')],'include':_0x29b5cd[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x23')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x21')],'include':_0x3544ba[_0x8db2('0x22')]?_['map'](_0x3544ba[_0x8db2('0x22')],function(_0x11f398){return{'model':db[_0x11f398[_0x8db2('0x23')]],'as':_0x11f398['as'],'attributes':_0x11f398[_0x8db2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0x21bae5){logger[_0x8db2('0x10')](_0x8db2('0x1b'),_0x104e33);logger[_0x8db2('0x12')]('GetMailAccount',_0x104e33,JSON[_0x8db2('0x14')](_0x21bae5));_0x1b64e4(_0x21bae5);})['catch'](function(_0x59cb77){logger[_0x8db2('0x16')](_0x8db2('0x1b'),_0x59cb77[_0x8db2('0x18')],_0x104e33);_0x58562e(_0x1310d3['error'](0x1f4,_0x59cb77[_0x8db2('0x18')]));});});};exports['ShowMailAccount']=function(_0x3f7aac){var _0x2b653b=this;return new Promise(function(_0x14bd12,_0x4d9e26){return db['MailAccount'][_0x8db2('0x26')]({'raw':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'include':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3f7aac['options'][_0x8db2('0x22')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x21')],'include':_0x304a72[_0x8db2('0x22')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x21')],'include':_0x3c1983[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3c1983[_0x8db2('0x22')],function(_0x5cc419){return{'model':db[_0x5cc419[_0x8db2('0x23')]],'as':_0x5cc419['as'],'attributes':_0x5cc419['attributes']};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0xd550ae){if(_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x27')]===!![])_0xd550ae['setDataValue']('smtpOptions',_0xd550ae[_0x8db2('0x28')]());logger[_0x8db2('0x10')]('ShowMailAccount',_0x3f7aac);logger[_0x8db2('0x12')](_0x8db2('0x29'),_0x3f7aac,JSON[_0x8db2('0x14')](_0xd550ae));_0x14bd12(_0xd550ae);})['catch'](function(_0x152e15){logger[_0x8db2('0x16')](_0x8db2('0x29'),_0x152e15[_0x8db2('0x18')],_0x3f7aac);_0x4d9e26(_0x2b653b[_0x8db2('0x16')](0x1f4,_0x152e15[_0x8db2('0x18')]));});});};exports[_0x8db2('0x2a')]=function(_0x1575ea){var _0x3793a4=this;return new Promise(function(_0x63c561,_0x21cf7c){var _0x20bf0b={'body':_0x1575ea[_0x8db2('0x2b')],'channel':'mail'};var _0x3ee510=_[_0x8db2('0x2c')](_['keys'](db['CmContact'][_0x8db2('0x2d')]),['createdAt',_0x8db2('0x2e'),_0x8db2('0x2f'),_0x8db2('0x30')]);var _0x307783=![];if(_0x1575ea[_0x8db2('0x2b')]['id']){delete _0x1575ea[_0x8db2('0x2b')]['id'];}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x32')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x33')));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x2b')])||_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x2b')]===''){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x35')+_0x3ee510));}if(!_['includes'](_0x3ee510,_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4['error'](0x1f4,_0x8db2('0x36')+_0x3ee510));}var _0x467866={};_0x467866[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')];return db[_0x8db2('0x1c')][_0x8db2('0x26')]({'where':{'id':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x38')],'as':_0x8db2('0x39'),'include':[{'model':db[_0x8db2('0x3a')],'as':'Contacts','where':_0x467866,'limit':0x1,'order':[[_0x8db2('0x2e'),_0x8db2('0x3b')]]}]},{'model':db[_0x8db2('0x3c')],'as':_0x8db2('0x3d')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x8db2('0x3e')],'as':_0x8db2('0x3e')}]}]})[_0x8db2('0x25')](function(_0x4c66e5){if(_0x4c66e5&&_0x4c66e5['List']){var _0x494d6e=_0x4c66e5[_0x8db2('0x3f')]({'plain':!![]});_0x20bf0b[_0x8db2('0x37')]=_[_0x8db2('0x40')](_0x494d6e,[_0x8db2('0x3d'),_0x8db2('0x39')]);_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x41')]=_0x4c66e5['getSmtpOptions']();_0x20bf0b['applications']=_0x494d6e[_0x8db2('0x3d')];_0x20bf0b[_0x8db2('0x42')]=_0x494d6e[_0x8db2('0x39')];_0x20bf0b[_0x8db2('0x43')]=_[_0x8db2('0x44')](_0x20bf0b[_0x8db2('0x43')],[_0x8db2('0x45')],[_0x8db2('0x46')]);if(_0x20bf0b[_0x8db2('0x37')]&&_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x47')]){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x48')]({'id':0x0,'priority':_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x49')]+0x1,'app':'close','appdata':_0x8db2('0x47'),'interval':_0x8db2('0x4a')});}if(_0x20bf0b['account'][_0x8db2('0x3d')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x3d')];}if(_0x20bf0b['account'][_0x8db2('0x39')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x39')];}if(_0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')]['length']){return _0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')][0x0];}var _0x469bc2=_['defaults'](_0x1575ea[_0x8db2('0x2b')],{'firstName':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')],'ListId':_0x494d6e[_0x8db2('0x30')]});_0x469bc2[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')]['from'];return db[_0x8db2('0x3a')][_0x8db2('0x4c')](_0x469bc2);}else{throw new Error('List\x20not\x20found');}})[_0x8db2('0x25')](function(_0x1683b8){_0x20bf0b['contact']=_0x1683b8;if(_0x1683b8){if(!_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]){_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]=rs[_0x8db2('0x4e')]()+'\x20'+_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x32')];}var _0x12fd12={'ContactId':_0x1683b8['id'],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id'],'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['subject'],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4f')],'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'};return db[_0x8db2('0x52')][_0x8db2('0x26')]({'where':{'closed':![],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x53')],'as':_0x8db2('0x54'),'attributes':[_0x8db2('0x4d')],'where':{'messageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x55')]}}]})[_0x8db2('0x25')](function(_0x270fc0){if(_0x270fc0){return[_0x270fc0,![]];}return db[_0x8db2('0x52')][_0x8db2('0x4c')](_0x12fd12)['then'](function(_0x3273dd){return[_0x3273dd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8db2('0x56')](function(_0x570c53,_0x3de11e){if(_0x570c53){_0x307783=_0x3de11e;if(!_0x3de11e){return _0x570c53[_0x8db2('0x57')]({'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea['body']['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x570c53[_0x8db2('0x4f')]?_0x570c53[_0x8db2('0x4f')]:_0x1575ea['body'][_0x8db2('0x18')][_0x8db2('0x4f')],'substatus':null,'substatusAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'});}else{return _0x570c53;}}})[_0x8db2('0x25')](function(_0x20caf0){_0x20bf0b['interaction']=_0x20caf0['get']({'plain':!![]});_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x5a')]=_0x307783;return db[_0x8db2('0x53')][_0x8db2('0x4c')]({'body':_0x1575ea[_0x8db2('0x2b')]['body'],'MailAccountId':_0x1575ea['account']['id'],'MailInteractionId':_0x20caf0['id'],'direction':'in','ContactId':_0x20bf0b[_0x8db2('0x5b')]['id'],'messageId':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x4d')],'from':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['from'],'to':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['to'],'cc':_0x1575ea[_0x8db2('0x2b')]['message']['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['attach'],'Attachments':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5c')],'originTo':_0x1575ea['body']['message'][_0x8db2('0x5d')],'originCc':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x5e')],'bcc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5f')],'ChatWebsiteId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x60')]||null,'originChannel':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x61')]||_0x8db2('0x62'),'ChatOfflineMessageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x8db2('0x63')],'as':'Attachments'}]});})[_0x8db2('0x25')](function(_0x3015ab){_0x20bf0b['message']=_0x3015ab;if(_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]){return db['User'][_0x8db2('0x26')]({'attributes':['id',_0x8db2('0x65')],'where':{'id':_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]}})[_0x8db2('0x25')](function(_0x31a095){if(_0x31a095){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x66')]({'id':0x0,'priority':0x0,'app':_0x8db2('0x67'),'appdata':_0x31a095['name']+','+(_0x20bf0b['account'][_0x8db2('0x68')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8db2('0x69'),_0x8db2('0x6a'),_0x20bf0b);});}return respondWithRpcPromise(_0x8db2('0x69'),'startRouting',_0x20bf0b);})[_0x8db2('0x25')](function(_0x9675c1){_0x63c561(_0x9675c1);})[_0x8db2('0x1a')](function(_0x591c5d){_0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x591c5d[_0x8db2('0x18')]));});});};
\ No newline at end of file
index a833bbc..759c9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5525=['save','remove','update','register','length','mailAccount:','./mailAccount.events'];(function(_0x5affbf,_0xd8c62a){var _0x22e067=function(_0x496f9f){while(--_0x496f9f){_0x5affbf['push'](_0x5affbf['shift']());}};_0x22e067(++_0xd8c62a);}(_0x5525,0xd1));var _0x5552=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5525[_0x4a9fb1];return _0x348672;};'use strict';var MailAccountEvents=require(_0x5552('0x0'));var events=[_0x5552('0x1'),_0x5552('0x2'),_0x5552('0x3')];function createListener(_0x5c7c24,_0x2f91bd){return function(_0x392f41){_0x2f91bd['emit'](_0x5c7c24,_0x392f41);};}function removeListener(_0x285566,_0x1a52e2){return function(){MailAccountEvents['removeListener'](_0x285566,_0x1a52e2);};}exports[_0x5552('0x4')]=function(_0x3fe1fb){for(var _0x96ff0a=0x0,_0x1ce9f6=events[_0x5552('0x5')];_0x96ff0a<_0x1ce9f6;_0x96ff0a++){var _0x203b88=events[_0x96ff0a];var _0x164626=createListener(_0x5552('0x6')+_0x203b88,_0x3fe1fb);MailAccountEvents['on'](_0x203b88,_0x164626);}};
\ No newline at end of file
+var _0x56d3=['length','mailAccount:','./mailAccount.events','update','emit','removeListener','register'];(function(_0x56c875,_0xf16a6b){var _0xbfe558=function(_0x57626d){while(--_0x57626d){_0x56c875['push'](_0x56c875['shift']());}};_0xbfe558(++_0xf16a6b);}(_0x56d3,0x191));var _0x356d=function(_0x497621,_0x19e3df){_0x497621=_0x497621-0x0;var _0x5c5a36=_0x56d3[_0x497621];return _0x5c5a36;};'use strict';var MailAccountEvents=require(_0x356d('0x0'));var events=['save','remove',_0x356d('0x1')];function createListener(_0x15c97b,_0x5a1040){return function(_0xe31680){_0x5a1040[_0x356d('0x2')](_0x15c97b,_0xe31680);};}function removeListener(_0xe03f69,_0x24d0cf){return function(){MailAccountEvents[_0x356d('0x3')](_0xe03f69,_0x24d0cf);};}exports[_0x356d('0x4')]=function(_0x4e82e0){for(var _0x1aacf2=0x0,_0x4ecd27=events[_0x356d('0x5')];_0x1aacf2<_0x4ecd27;_0x1aacf2++){var _0x264207=events[_0x1aacf2];var _0x4585f9=createListener(_0x356d('0x6')+_0x264207,_0x4e82e0);MailAccountEvents['on'](_0x264207,_0x4585f9);}};
\ No newline at end of file
index ef351a5..40b48fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b2=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x76b2,0x187));var _0x276b=function(_0x3ce41c,_0x349cdb){_0x3ce41c=_0x3ce41c-0x0;var _0x141369=_0x76b2[_0x3ce41c];return _0x141369;};'use strict';var multer=require(_0x276b('0x0'));var util=require('util');var path=require(_0x276b('0x1'));var timeout=require(_0x276b('0x2'));var express=require(_0x276b('0x3'));var router=express[_0x276b('0x4')]();var fs_extra=require(_0x276b('0x5'));var auth=require(_0x276b('0x6'));var interaction=require(_0x276b('0x7'));var config=require(_0x276b('0x8'));var controller=require(_0x276b('0x9'));router['get'](_0x276b('0xa'),auth[_0x276b('0xb')](),controller[_0x276b('0xc')]);router[_0x276b('0xd')](_0x276b('0xa'),auth['isAuthenticated'](),controller[_0x276b('0xe')]);router['delete'](_0x276b('0xa'),auth['isAuthenticated'](),controller[_0x276b('0xf')]);module[_0x276b('0x10')]=router;
\ No newline at end of file
+var _0x6f71=['show','put','isAuthenticated','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id'];(function(_0x18a128,_0x3cb048){var _0x1dd9e2=function(_0x37884b){while(--_0x37884b){_0x18a128['push'](_0x18a128['shift']());}};_0x1dd9e2(++_0x3cb048);}(_0x6f71,0x1d2));var _0x16f7=function(_0x376147,_0x722bfa){_0x376147=_0x376147-0x0;var _0x3f8b8f=_0x6f71[_0x376147];return _0x3f8b8f;};'use strict';var multer=require(_0x16f7('0x0'));var util=require('util');var path=require(_0x16f7('0x1'));var timeout=require(_0x16f7('0x2'));var express=require(_0x16f7('0x3'));var router=express[_0x16f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x16f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16f7('0x6'));var controller=require(_0x16f7('0x7'));router[_0x16f7('0x8')](_0x16f7('0x9'),auth['isAuthenticated'](),controller[_0x16f7('0xa')]);router[_0x16f7('0xb')]('/:id',auth[_0x16f7('0xc')](),controller['update']);router[_0x16f7('0xd')](_0x16f7('0x9'),auth[_0x16f7('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 88e3360..72c3fa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b6f=['noop','TEXT','STRING','sequelize'];(function(_0x234f24,_0x58af97){var _0x300811=function(_0x5b6496){while(--_0x5b6496){_0x234f24['push'](_0x234f24['shift']());}};_0x300811(++_0x58af97);}(_0x9b6f,0x1bf));var _0xf9b6=function(_0x5f5b69,_0x591e87){_0x5f5b69=_0x5f5b69-0x0;var _0x52c0e7=_0x9b6f[_0x5f5b69];return _0x52c0e7;};'use strict';var Sequelize=require(_0xf9b6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf9b6('0x1')},'appdata':{'type':Sequelize[_0xf9b6('0x2')]()},'description':{'type':Sequelize[_0xf9b6('0x3')]},'interval':{'type':Sequelize[_0xf9b6('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x84de=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x433e0e,_0x2e293f){var _0x2a1787=function(_0x29c0f9){while(--_0x29c0f9){_0x433e0e['push'](_0x433e0e['shift']());}};_0x2a1787(++_0x2e293f);}(_0x84de,0x12e));var _0xe84d=function(_0x34882f,_0x601a99){_0x34882f=_0x34882f-0x0;var _0x455929=_0x84de[_0x34882f];return _0x455929;};'use strict';var Sequelize=require(_0xe84d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe84d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe84d('0x2')],'allowNull':![],'defaultValue':_0xe84d('0x3')},'appdata':{'type':Sequelize[_0xe84d('0x4')]()},'description':{'type':Sequelize[_0xe84d('0x2')]},'interval':{'type':Sequelize[_0xe84d('0x2')],'defaultValue':_0xe84d('0x5')}};
\ No newline at end of file
index dd3f8dc..4318ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x553c28,_0x3c868d){var _0x571e4e=function(_0x2cd0a6){while(--_0x2cd0a6){_0x553c28['push'](_0x553c28['shift']());}};_0x571e4e(++_0x3c868d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4b0298,_0x307907){_0x4b0298=_0x4b0298-0x0;var _0x260625=_0x9bde[_0x4b0298];return _0x260625;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,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(_0x2e91c2,_0x2b1ff4){var _0x17683c=function(_0xede04e){while(--_0xede04e){_0x2e91c2['push'](_0x2e91c2['shift']());}};_0x17683c(++_0x2b1ff4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xcb91[_0x3438cf];return _0x278698;};'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
index 9ee4b45..3a5e58f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873e=['moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x873e,0x102));var _0xe873=function(_0x2b0ed0,_0x364153){_0x2b0ed0=_0x2b0ed0-0x0;var _0x116e9f=_0x873e[_0x2b0ed0];return _0x116e9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe873('0x0'))(_0xe873('0x1'));var moment=require(_0xe873('0x2'));var BPromise=require('bluebird');var rp=require(_0xe873('0x3'));var fs=require('fs');var path=require(_0xe873('0x4'));var rimraf=require(_0xe873('0x5'));var config=require(_0xe873('0x6'));var attributes=require(_0xe873('0x7'));module['exports']=function(_0x13ca43,_0x5ee6a9){return _0x13ca43[_0xe873('0x8')](_0xe873('0x9'),attributes,{'tableName':_0xe873('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe873('0xb'),'collate':_0xe873('0xc')});};
\ No newline at end of file
+var _0xf260=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./mailApplication.attributes','define','MailApplication','utf8mb4'];(function(_0x288709,_0x451444){var _0x404921=function(_0x46ec39){while(--_0x46ec39){_0x288709['push'](_0x288709['shift']());}};_0x404921(++_0x451444);}(_0xf260,0x9d));var _0x0f26=function(_0x10b7de,_0x51cf9d){_0x10b7de=_0x10b7de-0x0;var _0xd51c81=_0xf260[_0x10b7de];return _0xd51c81;};'use strict';var _=require(_0x0f26('0x0'));var util=require(_0x0f26('0x1'));var logger=require(_0x0f26('0x2'))('api');var moment=require(_0x0f26('0x3'));var BPromise=require(_0x0f26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f26('0x5'));var rimraf=require(_0x0f26('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f26('0x7'));module['exports']=function(_0x48a6ee,_0x26523c){return _0x48a6ee[_0x0f26('0x8')](_0x0f26('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f26('0xa'),'collate':_0x0f26('0xb')});};
\ No newline at end of file
index fe2fada..5e49199 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5214=['stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','body','options','raw','where','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','debug','request\x20sent'];(function(_0x2bfa94,_0x5aef20){var _0x36b467=function(_0x48282d){while(--_0x48282d){_0x2bfa94['push'](_0x2bfa94['shift']());}};_0x36b467(++_0x5aef20);}(_0x5214,0xdd));var _0x4521=function(_0x5c4592,_0xa5ba32){_0x5c4592=_0x5c4592-0x0;var _0x51ab0f=_0x5214[_0x5c4592];return _0x51ab0f;};'use strict';var _=require(_0x4521('0x0'));var util=require('util');var moment=require(_0x4521('0x1'));var BPromise=require('bluebird');var rs=require(_0x4521('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4521('0x3'))['db'];var utils=require(_0x4521('0x4'));var logger=require(_0x4521('0x5'))(_0x4521('0x6'));var config=require('../../config/environment');var jayson=require(_0x4521('0x7'));var client=jayson[_0x4521('0x8')][_0x4521('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420d87,_0x521fc4,_0x16cc67){return new BPromise(function(_0x5166ca,_0x417617){return client['request'](_0x420d87,_0x16cc67)['then'](function(_0x129260){logger[_0x4521('0xa')]('MailApplication,\x20%s,\x20%s',_0x521fc4,'request\x20sent');logger[_0x4521('0xb')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x521fc4,_0x4521('0xc'),JSON[_0x4521('0xd')](_0x129260));if(_0x129260[_0x4521('0xe')]){if(_0x129260['error'][_0x4521('0xf')]===0x1f4){logger['error'](_0x4521('0x10'),_0x521fc4,_0x129260[_0x4521('0xe')][_0x4521('0x11')]);return _0x417617(_0x129260[_0x4521('0xe')]['message']);}logger[_0x4521('0xe')](_0x4521('0x10'),_0x521fc4,_0x129260[_0x4521('0xe')][_0x4521('0x11')]);return _0x5166ca(_0x129260['error'][_0x4521('0x11')]);}else{logger[_0x4521('0xa')](_0x4521('0x10'),_0x521fc4,_0x4521('0xc'));_0x5166ca(_0x129260[_0x4521('0x12')]['message']);}})[_0x4521('0x13')](function(_0x2c12a5){logger[_0x4521('0xe')]('MailApplication,\x20%s,\x20%s',_0x521fc4,_0x2c12a5);_0x417617(_0x2c12a5);});});}exports[_0x4521('0x14')]=function(_0x1969e0){var _0x4dd716=this;return new Promise(function(_0x1eb747,_0x2af5f5){return db['MailApplication']['update'](_0x1969e0[_0x4521('0x15')],{'raw':_0x1969e0[_0x4521('0x16')]?_0x1969e0[_0x4521('0x16')][_0x4521('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1969e0[_0x4521('0x16')]?_0x1969e0[_0x4521('0x16')][_0x4521('0x18')]||null:null,'attributes':_0x1969e0['options']?_0x1969e0[_0x4521('0x16')]['attributes']||null:null,'limit':_0x1969e0[_0x4521('0x16')]?_0x1969e0[_0x4521('0x16')]['limit']||null:null})[_0x4521('0x19')](function(_0x459d4f){logger[_0x4521('0xa')](_0x4521('0x14'),_0x1969e0);logger[_0x4521('0xb')]('UpdateMailApplication',_0x1969e0,JSON[_0x4521('0xd')](_0x459d4f));_0x1eb747(_0x459d4f);})['catch'](function(_0x4a7b4a){logger[_0x4521('0xe')](_0x4521('0x14'),_0x4a7b4a[_0x4521('0x11')],_0x1969e0);_0x2af5f5(_0x4dd716[_0x4521('0xe')](0x1f4,_0x4a7b4a[_0x4521('0x11')]));});});};
\ No newline at end of file
+var _0xcb33=['update','body','raw','options','where','limit','then','UpdateMailApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','info','result','catch','MailApplication'];(function(_0x55f53a,_0x540cea){var _0x354736=function(_0x5d9d01){while(--_0x5d9d01){_0x55f53a['push'](_0x55f53a['shift']());}};_0x354736(++_0x540cea);}(_0xcb33,0x1c8));var _0x3cb3=function(_0x20e161,_0x586c9a){_0x20e161=_0x20e161-0x0;var _0x50e745=_0xcb33[_0x20e161];return _0x50e745;};'use strict';var _=require(_0x3cb3('0x0'));var util=require(_0x3cb3('0x1'));var moment=require('moment');var BPromise=require(_0x3cb3('0x2'));var rs=require(_0x3cb3('0x3'));var fs=require('fs');var Redis=require(_0x3cb3('0x4'));var db=require(_0x3cb3('0x5'))['db'];var utils=require(_0x3cb3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cb3('0x7'));var jayson=require(_0x3cb3('0x8'));var client=jayson[_0x3cb3('0x9')][_0x3cb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34dfad,_0x25f53d,_0x527834){return new BPromise(function(_0x169eca,_0x24a1c2){return client[_0x3cb3('0xb')](_0x34dfad,_0x527834)['then'](function(_0x3f1bce){logger['info']('MailApplication,\x20%s,\x20%s',_0x25f53d,_0x3cb3('0xc'));logger[_0x3cb3('0xd')](_0x3cb3('0xe'),_0x25f53d,'request\x20sent',JSON[_0x3cb3('0xf')](_0x3f1bce));if(_0x3f1bce[_0x3cb3('0x10')]){if(_0x3f1bce[_0x3cb3('0x10')][_0x3cb3('0x11')]===0x1f4){logger['error'](_0x3cb3('0x12'),_0x25f53d,_0x3f1bce[_0x3cb3('0x10')]['message']);return _0x24a1c2(_0x3f1bce[_0x3cb3('0x10')]['message']);}logger[_0x3cb3('0x10')](_0x3cb3('0x12'),_0x25f53d,_0x3f1bce[_0x3cb3('0x10')][_0x3cb3('0x13')]);return _0x169eca(_0x3f1bce[_0x3cb3('0x10')]['message']);}else{logger[_0x3cb3('0x14')](_0x3cb3('0x12'),_0x25f53d,'request\x20sent');_0x169eca(_0x3f1bce[_0x3cb3('0x15')][_0x3cb3('0x13')]);}})[_0x3cb3('0x16')](function(_0x257581){logger[_0x3cb3('0x10')](_0x3cb3('0x12'),_0x25f53d,_0x257581);_0x24a1c2(_0x257581);});});}exports['UpdateMailApplication']=function(_0x462d08){var _0x2cc1d=this;return new Promise(function(_0x50f472,_0x2c0c99){return db[_0x3cb3('0x17')][_0x3cb3('0x18')](_0x462d08[_0x3cb3('0x19')],{'raw':_0x462d08['options']?_0x462d08['options'][_0x3cb3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462d08[_0x3cb3('0x1b')]?_0x462d08[_0x3cb3('0x1b')][_0x3cb3('0x1c')]||null:null,'attributes':_0x462d08[_0x3cb3('0x1b')]?_0x462d08[_0x3cb3('0x1b')]['attributes']||null:null,'limit':_0x462d08[_0x3cb3('0x1b')]?_0x462d08[_0x3cb3('0x1b')][_0x3cb3('0x1d')]||null:null})[_0x3cb3('0x1e')](function(_0x370f52){logger[_0x3cb3('0x14')](_0x3cb3('0x1f'),_0x462d08);logger[_0x3cb3('0xd')](_0x3cb3('0x1f'),_0x462d08,JSON[_0x3cb3('0xf')](_0x370f52));_0x50f472(_0x370f52);})[_0x3cb3('0x16')](function(_0x929cb7){logger['error'](_0x3cb3('0x1f'),_0x929cb7[_0x3cb3('0x13')],_0x462d08);_0x2c0c99(_0x2cc1d[_0x3cb3('0x10')](0x1f4,_0x929cb7[_0x3cb3('0x13')]));});});};
\ No newline at end of file
index 210e16a..bc1985c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfb=['index','/describe','show','/:id/messages','/:id/download','post','create','tracked','mailinteraction:addtags','/:id','mail','mailinteraction:update','update','destroy','delete','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x31f93c,_0x4419b8){var _0x4a889f=function(_0x498266){while(--_0x498266){_0x31f93c['push'](_0x31f93c['shift']());}};_0x4a889f(++_0x4419b8);}(_0x2bfb,0x1a2));var _0xb2bf=function(_0x3f5561,_0x554c8f){_0x3f5561=_0x3f5561-0x0;var _0x2b9abf=_0x2bfb[_0x3f5561];return _0x2b9abf;};'use strict';var express=require(_0xb2bf('0x0'));var router=express[_0xb2bf('0x1')]();var auth=require(_0xb2bf('0x2'));var interaction=require(_0xb2bf('0x3'));var controller=require(_0xb2bf('0x4'));router[_0xb2bf('0x5')]('/',auth[_0xb2bf('0x6')](),controller[_0xb2bf('0x7')]);router['get'](_0xb2bf('0x8'),auth[_0xb2bf('0x6')](),controller['describe']);router[_0xb2bf('0x5')]('/:id',auth[_0xb2bf('0x6')](),controller[_0xb2bf('0x9')]);router['get'](_0xb2bf('0xa'),auth[_0xb2bf('0x6')](),controller['getMessages']);router['get'](_0xb2bf('0xb'),auth[_0xb2bf('0x6')](),controller['download']);router[_0xb2bf('0xc')]('/',auth[_0xb2bf('0x6')](),controller[_0xb2bf('0xd')]);router[_0xb2bf('0xc')](_0xb2bf('0xa'),auth[_0xb2bf('0x6')](),controller['addMessage']);router[_0xb2bf('0xc')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xb2bf('0xe')]('mail',_0xb2bf('0xf')),controller['addTags']);router['put'](_0xb2bf('0x10'),auth[_0xb2bf('0x6')](),interaction['tracked'](_0xb2bf('0x11'),_0xb2bf('0x12')),controller[_0xb2bf('0x13')]);router['delete'](_0xb2bf('0x10'),auth[_0xb2bf('0x6')](),interaction[_0xb2bf('0xe')](_0xb2bf('0x11'),'mailinteraction:destroy'),controller[_0xb2bf('0x14')]);router[_0xb2bf('0x15')](_0xb2bf('0x16'),auth[_0xb2bf('0x6')](),controller[_0xb2bf('0x17')]);module[_0xb2bf('0x18')]=router;
\ No newline at end of file
+var _0x1b23=['./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','mail','addTags','put','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0x13cf61,_0x1ec766){var _0x48f7f9=function(_0x43f0d3){while(--_0x43f0d3){_0x13cf61['push'](_0x13cf61['shift']());}};_0x48f7f9(++_0x1ec766);}(_0x1b23,0x170));var _0x31b2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1b23[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x31b2('0x0'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x31b2('0x1')](_0x31b2('0x2'),auth[_0x31b2('0x3')](),controller[_0x31b2('0x4')]);router[_0x31b2('0x1')](_0x31b2('0x5'),auth['isAuthenticated'](),controller[_0x31b2('0x6')]);router[_0x31b2('0x1')](_0x31b2('0x7'),auth[_0x31b2('0x3')](),controller['getMessages']);router[_0x31b2('0x1')](_0x31b2('0x8'),auth[_0x31b2('0x3')](),controller[_0x31b2('0x9')]);router['post']('/',auth[_0x31b2('0x3')](),controller[_0x31b2('0xa')]);router[_0x31b2('0xb')](_0x31b2('0x7'),auth[_0x31b2('0x3')](),controller[_0x31b2('0xc')]);router['post']('/:id/tags',auth[_0x31b2('0x3')](),interaction[_0x31b2('0xd')](_0x31b2('0xe'),'mailinteraction:addtags'),controller[_0x31b2('0xf')]);router[_0x31b2('0x10')](_0x31b2('0x5'),auth[_0x31b2('0x3')](),interaction[_0x31b2('0xd')](_0x31b2('0xe'),'mailinteraction:update'),controller[_0x31b2('0x11')]);router[_0x31b2('0x12')](_0x31b2('0x5'),auth['isAuthenticated'](),interaction[_0x31b2('0xd')](_0x31b2('0xe'),_0x31b2('0x13')),controller[_0x31b2('0x14')]);router[_0x31b2('0x12')](_0x31b2('0x15'),auth['isAuthenticated'](),controller[_0x31b2('0x16')]);module['exports']=router;
\ No newline at end of file
index 3f3ac32..f25450c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48e0=['TEXT','DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING','long'];(function(_0xd6f6f5,_0x1b2345){var _0xe61908=function(_0x34eea7){while(--_0x34eea7){_0xd6f6f5['push'](_0xd6f6f5['shift']());}};_0xe61908(++_0x1b2345);}(_0x48e0,0xb8));var _0x048e=function(_0xbcc9e2,_0x10e91e){_0xbcc9e2=_0xbcc9e2-0x0;var _0x378805=_0x48e0[_0xbcc9e2];return _0x378805;};'use strict';var Sequelize=require(_0x048e('0x0'));var iconv=require('iconv');module[_0x048e('0x1')]={'closed':{'type':Sequelize[_0x048e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x048e('0x3')]},'secondDisposition':{'type':Sequelize[_0x048e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x048e('0x3')]},'note':{'type':Sequelize[_0x048e('0x3')]},'inReplyTo':{'type':Sequelize[_0x048e('0x3')](0x1fe)},'to':{'type':Sequelize[_0x048e('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x048e('0x4'))},'subject':{'type':Sequelize[_0x048e('0x5')]()},'attach':{'type':Sequelize[_0x048e('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x048e('0x6')]},'substatus':{'type':Sequelize[_0x048e('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x048e('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x048e('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x048e('0x7')]('in',_0x048e('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x048e('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb6a3=['TEXT','BOOLEAN','ENUM','out','sequelize','iconv','exports','DATE','STRING'];(function(_0x5d5611,_0xc0ae3a){var _0x1bf0b2=function(_0x4fc622){while(--_0x4fc622){_0x5d5611['push'](_0x5d5611['shift']());}};_0x1bf0b2(++_0xc0ae3a);}(_0xb6a3,0xa6));var _0x3b6a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb6a3[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x3b6a('0x0'));var iconv=require(_0x3b6a('0x1'));module[_0x3b6a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3b6a('0x3')]},'disposition':{'type':Sequelize[_0x3b6a('0x4')]},'secondDisposition':{'type':Sequelize[_0x3b6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3b6a('0x4')]},'note':{'type':Sequelize[_0x3b6a('0x4')]},'inReplyTo':{'type':Sequelize[_0x3b6a('0x4')](0x1fe)},'to':{'type':Sequelize[_0x3b6a('0x4')]},'cc':{'type':Sequelize[_0x3b6a('0x5')]('long')},'subject':{'type':Sequelize[_0x3b6a('0x5')]()},'attach':{'type':Sequelize[_0x3b6a('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3b6a('0x3')]},'substatus':{'type':Sequelize[_0x3b6a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x3b6a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3b6a('0x7')]('in',_0x3b6a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3b6a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3b6a('0x7')]('in',_0x3b6a('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3b6a('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 1eb0044..767544e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf264=['download','unix','toString','join','root','server','tmp','format','transcript-%d-%s.zip','attachments','Attachments','from','subject','createdAt','Messages','mkdirSync','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','push','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','rimraf','moment','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','findAll','mail','query','user','params','model','keys','MailInteraction','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','body','update','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','true','rows','setTags','spread','emit','mailInteractionTags:save','removeTags'];(function(_0xc7eddf,_0x474776){var _0x1d91a3=function(_0x375a5f){while(--_0x375a5f){_0xc7eddf['push'](_0xc7eddf['shift']());}};_0x1d91a3(++_0x474776);}(_0xf264,0x1ee));var _0x4f26=function(_0x45f841,_0x12d4ea){_0x45f841=_0x45f841-0x0;var _0x16bfab=_0xf264[_0x45f841];return _0x16bfab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f26('0x0'));var zipdir=require('zip-dir');var moment=require(_0x4f26('0x1'));var BPromise=require(_0x4f26('0x2'));var util=require('util');var path=require(_0x4f26('0x3'));var fs=require('fs');var _=require(_0x4f26('0x4'));var juice=require(_0x4f26('0x5'));var Redis=require(_0x4f26('0x6'));var interaction=require(_0x4f26('0x7'));var qs=require(_0x4f26('0x8'));var logger=require(_0x4f26('0x9'))(_0x4f26('0xa'));var config=require(_0x4f26('0xb'));var db=require(_0x4f26('0xc'))['db'];var htmlEntities=require(_0x4f26('0xd'));config['redis']=_[_0x4f26('0xe')](config[_0x4f26('0xf')],{'host':_0x4f26('0x10'),'port':0x18eb});var socket=require(_0x4f26('0x11'))(new Redis(config['redis']));require(_0x4f26('0x12'))[_0x4f26('0x13')](socket);function respondWithStatusCode(_0x271797,_0x58d10e){_0x58d10e=_0x58d10e||0xcc;return function(_0xaa3eea){if(_0xaa3eea){return _0x271797['sendStatus'](_0x58d10e);}return _0x271797['status'](_0x58d10e)['end']();};}function respondWithResult(_0x1bc406,_0x2084bb){_0x2084bb=_0x2084bb||0xc8;return function(_0x4e41c9){if(_0x4e41c9){return _0x1bc406[_0x4f26('0x14')](_0x2084bb)[_0x4f26('0x15')](_0x4e41c9);}};}function respondWithFilteredResult(_0x39123b,_0x5275ae){return function(_0x265f90){if(_0x265f90){var _0x36cdef=typeof _0x5275ae[_0x4f26('0x16')]===_0x4f26('0x17')&&typeof _0x5275ae[_0x4f26('0x18')]===_0x4f26('0x17');var _0x2bf819=_0x265f90['count'];var _0x4cdfbf=_0x36cdef?0x0:_0x5275ae[_0x4f26('0x16')];var _0x4b03ed=_0x36cdef?_0x265f90[_0x4f26('0x19')]:_0x5275ae['offset']+_0x5275ae[_0x4f26('0x18')];var _0x585aa2;if(_0x4b03ed>=_0x2bf819){_0x4b03ed=_0x2bf819;_0x585aa2=0xc8;}else{_0x585aa2=0xce;}_0x39123b[_0x4f26('0x14')](_0x585aa2);return _0x39123b[_0x4f26('0x1a')]('Content-Range',_0x4cdfbf+'-'+_0x4b03ed+'/'+_0x2bf819)[_0x4f26('0x15')](_0x265f90);}return null;};}function saveUpdates(_0x3edc9e){return function(_0x2484d9){if(_0x2484d9){return _0x2484d9['update'](_0x3edc9e)['then'](function(_0x1af38c){return _0x1af38c;});}return null;};}function removeEntity(_0x26044a){return function(_0x282403){if(_0x282403){return _0x282403[_0x4f26('0x1b')]()[_0x4f26('0x1c')](function(){_0x26044a['status'](0xcc)[_0x4f26('0x1d')]();});}};}function handleEntityNotFound(_0x68a915){return function(_0x296196){if(!_0x296196){_0x68a915['sendStatus'](0x194);}return _0x296196;};}function handleError(_0x5a74a2,_0x59f6bc){_0x59f6bc=_0x59f6bc||0x1f4;return function(_0x6d92b0){logger[_0x4f26('0x1e')](_0x6d92b0[_0x4f26('0x1f')]);if(_0x6d92b0[_0x4f26('0x20')]){delete _0x6d92b0[_0x4f26('0x20')];}_0x5a74a2[_0x4f26('0x14')](_0x59f6bc)[_0x4f26('0x21')](_0x6d92b0);};}exports[_0x4f26('0x22')]=function(_0x366d93,_0x300078){var _0x4a3522={};var _0x39da44=_[_0x4f26('0x23')](db['MailInteraction'][_0x4f26('0x24')],function(_0xf32203){return{'name':_0xf32203[_0x4f26('0x25')],'type':_0xf32203['type'][_0x4f26('0x26')]};});_0x4a3522=qs[_0x4f26('0x27')](_0x39da44,_0x366d93);return interaction[_0x4f26('0x28')](_0x4f26('0x29'),_0x366d93[_0x4f26('0x2a')],_0x366d93[_0x4f26('0x2b')],_0x4a3522,_0x39da44)[_0x4f26('0x1c')](respondWithFilteredResult(_0x300078,_0x4a3522))['catch'](handleError(_0x300078,null));};exports['show']=function(_0xa2d358,_0xb479a2){var _0x389e6b={'raw':![],'where':{'id':_0xa2d358[_0x4f26('0x2c')]['id']}},_0x5246c8={};_0x5246c8[_0x4f26('0x2d')]=_[_0x4f26('0x2e')](db[_0x4f26('0x2f')]['rawAttributes']);_0x5246c8[_0x4f26('0x2a')]=_[_0x4f26('0x2e')](_0xa2d358[_0x4f26('0x2a')]);_0x5246c8[_0x4f26('0x30')]=_['intersection'](_0x5246c8['model'],_0x5246c8['query']);_0x389e6b[_0x4f26('0x31')]=_[_0x4f26('0x32')](_0x5246c8[_0x4f26('0x2d')],qs[_0x4f26('0x33')](_0xa2d358['query'][_0x4f26('0x33')]));_0x389e6b[_0x4f26('0x31')]=_0x389e6b[_0x4f26('0x31')][_0x4f26('0x34')]?_0x389e6b[_0x4f26('0x31')]:_0x5246c8['model'];if(_0xa2d358[_0x4f26('0x2a')][_0x4f26('0x35')]){_0x389e6b['include']=[{'all':!![]}];}_0x389e6b=_[_0x4f26('0x36')]({},_0x389e6b,_0xa2d358[_0x4f26('0x37')]);return db[_0x4f26('0x2f')][_0x4f26('0x38')](_0x389e6b)[_0x4f26('0x1c')](handleEntityNotFound(_0xb479a2,null))[_0x4f26('0x1c')](respondWithResult(_0xb479a2,null))[_0x4f26('0x39')](handleError(_0xb479a2,null));};exports[_0x4f26('0x3a')]=function(_0x3df3af,_0x270c0a){return db[_0x4f26('0x2f')][_0x4f26('0x3a')](_0x3df3af[_0x4f26('0x3b')],{})[_0x4f26('0x1c')](respondWithResult(_0x270c0a,0xc9))[_0x4f26('0x39')](handleError(_0x270c0a,null));};exports[_0x4f26('0x3c')]=function(_0x6da8b8,_0xe2889){if(_0x6da8b8[_0x4f26('0x3b')]['id']){delete _0x6da8b8['body']['id'];}return db[_0x4f26('0x2f')][_0x4f26('0x38')]({'where':{'id':_0x6da8b8[_0x4f26('0x2c')]['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0xe2889,null))[_0x4f26('0x1c')](saveUpdates(_0x6da8b8['body'],null))[_0x4f26('0x1c')](respondWithResult(_0xe2889,null))[_0x4f26('0x39')](handleError(_0xe2889,null));};exports[_0x4f26('0x1b')]=function(_0x40b07f,_0x35649e){return db[_0x4f26('0x2f')][_0x4f26('0x38')]({'where':{'id':_0x40b07f[_0x4f26('0x2c')]['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0x35649e,null))[_0x4f26('0x1c')](removeEntity(_0x35649e,null))[_0x4f26('0x39')](handleError(_0x35649e,null));};exports[_0x4f26('0x3d')]=function(_0x44dd50,_0x1c0f32){return db[_0x4f26('0x2f')][_0x4f26('0x3d')]()[_0x4f26('0x1c')](respondWithResult(_0x1c0f32,null))['catch'](handleError(_0x1c0f32,null));};exports[_0x4f26('0x3e')]=function(_0x2e7bbe,_0x13e608){return db[_0x4f26('0x3f')][_0x4f26('0x38')]({'where':{'id':_0x2e7bbe['params']['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0x13e608,null))['then'](function(_0xd3eb4a){if(_0xd3eb4a){return _0xd3eb4a[_0x4f26('0x3e')](_0x2e7bbe[_0x4f26('0x3b')][_0x4f26('0x40')],_[_0x4f26('0x41')](_0x2e7bbe['body'],[_0x4f26('0x40'),'id'])||{});}})['then'](respondWithResult(_0x13e608,null))[_0x4f26('0x39')](handleError(_0x13e608,null));};exports['getMessages']=function(_0x5dbdd2,_0x2db37f){var _0x35445b={'raw':![],'where':{}};var _0xac90b0={};var _0x241b65={'count':0x0,'rows':[]};return db[_0x4f26('0x2f')][_0x4f26('0x42')]({'where':{'id':_0x5dbdd2['params']['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0x2db37f,null))['then'](function(_0x4a98f9){if(_0x4a98f9){_0xac90b0[_0x4f26('0x2d')]=_[_0x4f26('0x2e')](db[_0x4f26('0x3f')][_0x4f26('0x24')]);_0xac90b0[_0x4f26('0x2a')]=_['keys'](_0x5dbdd2[_0x4f26('0x2a')]);_0xac90b0['filters']=_['intersection'](_0xac90b0[_0x4f26('0x2d')],_0xac90b0[_0x4f26('0x2a')]);_0x35445b[_0x4f26('0x31')]=_['intersection'](_0xac90b0[_0x4f26('0x2d')],qs['fields'](_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x33')]));_0x35445b[_0x4f26('0x31')]=_0x35445b[_0x4f26('0x31')][_0x4f26('0x34')]?_0x35445b[_0x4f26('0x31')]:_0xac90b0[_0x4f26('0x2d')];if(!_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x43')](_0x4f26('0x44'))){_0x35445b[_0x4f26('0x18')]=qs['limit'](_0x5dbdd2['query']['limit']);_0x35445b[_0x4f26('0x16')]=qs[_0x4f26('0x16')](_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x16')]);}_0x35445b['order']=qs[_0x4f26('0x45')](_0x5dbdd2['query'][_0x4f26('0x45')]);_0x35445b[_0x4f26('0x46')]=qs[_0x4f26('0x30')](_[_0x4f26('0x47')](_0x5dbdd2[_0x4f26('0x2a')],_0xac90b0[_0x4f26('0x30')]));_0x35445b[_0x4f26('0x46')][_0x4f26('0x48')]=_0x4a98f9['id'];if(_0x5dbdd2['query']['filter']){_0x35445b['where']=_['merge'](_0x35445b[_0x4f26('0x46')],{'$or':_[_0x4f26('0x23')](_0x35445b[_0x4f26('0x31')],function(_0x5d9cd1){var _0x4df7e0={};_0x4df7e0[_0x5d9cd1]={'$like':'%'+_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x49')]+'%'};return _0x4df7e0;})});}if(_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x4a')]){var _0x5922f9=_0x5dbdd2['query'][_0x4f26('0x4a')][_0x4f26('0x4b')](',');var _0x519065={};_0x519065[_0x5922f9[0x0]]={'$gte':moment(_0x5922f9[0x1])['format'](_0x4f26('0x4c'))};_0x35445b[_0x4f26('0x46')]=_[_0x4f26('0x36')](_0x35445b[_0x4f26('0x46')],_0x519065);}_0x35445b=_[_0x4f26('0x36')]({},_0x35445b,_0x5dbdd2[_0x4f26('0x37')]);return db[_0x4f26('0x3f')]['count']({'where':_0x35445b['where']})['then'](function(_0x45fc3e){_0x241b65[_0x4f26('0x19')]=_0x45fc3e;if(_0x5dbdd2[_0x4f26('0x2a')]['includeAll']){_0x35445b[_0x4f26('0x4d')]=[{'all':!![]}];}return db[_0x4f26('0x3f')][_0x4f26('0x28')](_0x35445b);})['then'](function(_0x593315){if(_0x5dbdd2[_0x4f26('0x2a')][_0x4f26('0x4e')]===_0x4f26('0x4f')){for(var _0x52506a=0x0;_0x52506a<_0x593315[_0x4f26('0x34')];_0x52506a++){_0x593315[_0x52506a][_0x4f26('0x3b')]=juice(_0x593315[_0x52506a][_0x4f26('0x3b')]);}}_0x241b65[_0x4f26('0x50')]=_0x593315;return _0x241b65;});}})[_0x4f26('0x1c')](respondWithFilteredResult(_0x2db37f,_0x35445b))[_0x4f26('0x39')](handleError(_0x2db37f,null));};exports['addTags']=function(_0xe5af52,_0x2b0caa){return db['MailInteraction'][_0x4f26('0x38')]({'where':{'id':_0xe5af52[_0x4f26('0x2c')]['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0x2b0caa,null))[_0x4f26('0x1c')](function(_0x10954c){if(_0x10954c){return _0x10954c[_0x4f26('0x51')](_0xe5af52[_0x4f26('0x3b')][_0x4f26('0x40')],_['omit'](_0xe5af52[_0x4f26('0x3b')],['ids','id'])||{})[_0x4f26('0x52')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0xe5af52[_0x4f26('0x3b')]['ids']}});})[_0x4f26('0x1c')](function(_0x5c2377){socket[_0x4f26('0x53')](_0x4f26('0x54'),{'id':Number(_0xe5af52[_0x4f26('0x2c')]['id']),'tags':_0x5c2377||[]});return{'id':Number(_0xe5af52[_0x4f26('0x2c')]['id']),'tags':_0x5c2377||[]};});}})[_0x4f26('0x1c')](respondWithResult(_0x2b0caa,null))[_0x4f26('0x39')](handleError(_0x2b0caa,null));};exports[_0x4f26('0x55')]=function(_0x4e71bd,_0x1a1e3b){return db[_0x4f26('0x2f')][_0x4f26('0x38')]({'where':{'id':_0x4e71bd[_0x4f26('0x2c')]['id']}})[_0x4f26('0x1c')](handleEntityNotFound(_0x1a1e3b,null))['then'](function(_0x49bea5){if(_0x49bea5){return _0x49bea5['removeTags'](_0x4e71bd[_0x4f26('0x2a')][_0x4f26('0x40')]);}})[_0x4f26('0x1c')](respondWithStatusCode(_0x1a1e3b,null))[_0x4f26('0x39')](handleError(_0x1a1e3b,null));};exports[_0x4f26('0x56')]=function(_0x1b36bd,_0x3bebf3){var _0x124529=moment()[_0x4f26('0x57')]()[_0x4f26('0x58')]();var _0x547aae=path[_0x4f26('0x59')](config[_0x4f26('0x5a')],_0x4f26('0x5b'),'files',_0x4f26('0x5c'));var _0x1c6084=path['join'](config[_0x4f26('0x5a')],'server','files','attachments');var _0x40b6fb=path['join'](_0x547aae,_0x124529);var _0x37db05=util[_0x4f26('0x5d')](_0x4f26('0x5e'),_0x1b36bd[_0x4f26('0x2c')]['id'],_0x124529);var _0xd7b276=path[_0x4f26('0x59')](_0x547aae,_0x37db05);var _0x1afa1b=[];if(_0x1b36bd['query'][_0x4f26('0x5f')]){_0x1afa1b['push']({'model':db['Attachment'],'as':_0x4f26('0x60'),'raw':!![]});}var _0x3be066=[{'model':db[_0x4f26('0x3f')],'as':'Messages','attributes':['id',_0x4f26('0x3b'),_0x4f26('0x61'),'to','cc','bcc',_0x4f26('0x62'),_0x4f26('0x63')],'where':{'secret':![]},'order':qs[_0x4f26('0x45')]('id'),'include':_0x1afa1b}];return db[_0x4f26('0x2f')][_0x4f26('0x38')]({'where':{'id':_0x1b36bd[_0x4f26('0x2c')]['id']},'include':_0x3be066})[_0x4f26('0x1c')](handleEntityNotFound(_0x3bebf3,null))['then'](function(_0x2b08dd){if(_0x2b08dd&&_0x2b08dd[_0x4f26('0x64')]){var _0x252589=_0x2b08dd['get']({'plain':!![]});fs[_0x4f26('0x65')](_0x40b6fb);return BPromise['each'](_0x252589[_0x4f26('0x64')],function(_0x1a17bc,_0x12d75f){var _0x8a6ee6={'from':_0x1a17bc[_0x4f26('0x61')],'to':_0x1a17bc['to']||_0x4f26('0x66'),'subject':_0x1a17bc[_0x4f26('0x62')],'html':htmlEntities[_0x4f26('0x67')](_0x1a17bc[_0x4f26('0x3b')]),'headers':{'Date':moment(_0x1a17bc[_0x4f26('0x63')])[_0x4f26('0x5d')](_0x4f26('0x68'))},'attachments':[]};if(_0x1a17bc['cc']){_0x8a6ee6[_0x4f26('0x69')]['Cc']=_0x1a17bc['cc'];}if(_0x1a17bc[_0x4f26('0x6a')]){_0x8a6ee6[_0x4f26('0x69')][_0x4f26('0x6b')]=_0x1a17bc[_0x4f26('0x6a')];}return new BPromise(function(_0x118f0f,_0x58527c){if(_0x1a17bc[_0x4f26('0x60')]){for(var _0x352364=0x0;_0x352364<_0x1a17bc[_0x4f26('0x60')]['length'];_0x352364++){var _0x3e07f8=_0x1a17bc[_0x4f26('0x60')][_0x352364];var _0x2cc219=path['join'](_0x1c6084,_0x3e07f8[_0x4f26('0x6c')]);if(fs['existsSync'](_0x2cc219)){_0x8a6ee6['attachments'][_0x4f26('0x6d')]({'name':_0x3e07f8['name'],'contentType':_0x3e07f8['type'],'data':fs[_0x4f26('0x6e')](_0x2cc219)});}}}emlformat[_0x4f26('0x6f')](_0x8a6ee6,function(_0x1a35da,_0x47088e){if(_0x1a35da)return _0x58527c(_0x1a35da);fs[_0x4f26('0x70')](path[_0x4f26('0x59')](_0x40b6fb,util[_0x4f26('0x5d')](_0x4f26('0x71'),_0x12d75f)),_0x47088e);return _0x118f0f(_0x47088e);});});})[_0x4f26('0x1c')](function(){return new BPromise(function(_0xa88824,_0x4fa7e1){zipdir(_0x40b6fb,{'saveTo':_0xd7b276},function(_0x15bc1a,_0x1ac0b9){if(_0x15bc1a)return _0x4fa7e1(_0x15bc1a);return _0xa88824(_0x1ac0b9);});})[_0x4f26('0x1c')](function(){return new BPromise(function(_0x35029b,_0x13314a){rimraf(_0x40b6fb,function(_0x356026){if(_0x356026)_0x13314a(_0x356026);return _0x35029b();});});})['then'](function(){return _0x3bebf3[_0x4f26('0x56')](_0xd7b276,_0x37db05,function(_0x56cbe3){if(!_0x56cbe3)fs[_0x4f26('0x72')](_0xd7b276);});});});}else{return _0x3bebf3[_0x4f26('0x73')](0xc8);}})['catch'](handleError(_0x3bebf3,null));};
\ No newline at end of file
+var _0x5557=['show','model','keys','intersection','attributes','fields','include','merge','MailInteraction','create','body','find','params','describe','addMessage','ids','omit','MailMessage','filters','length','hasOwnProperty','nolimit','order','sort','pick','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','true','rows','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','createdAt','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','type','readFileSync','build','writeFileSync','message%d.eml','download','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','name','index','map','rawAttributes','key','getOptions','findAll','query','user','catch'];(function(_0x39b8a5,_0xc78910){var _0x3f17e7=function(_0xa01a22){while(--_0xa01a22){_0x39b8a5['push'](_0x39b8a5['shift']());}};_0x3f17e7(++_0xc78910);}(_0x5557,0x18e));var _0x7555=function(_0x5eb5d4,_0x309e64){_0x5eb5d4=_0x5eb5d4-0x0;var _0x576507=_0x5557[_0x5eb5d4];return _0x576507;};'use strict';var emlformat=require(_0x7555('0x0'));var rimraf=require(_0x7555('0x1'));var zipdir=require(_0x7555('0x2'));var moment=require(_0x7555('0x3'));var BPromise=require(_0x7555('0x4'));var util=require(_0x7555('0x5'));var path=require(_0x7555('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x7555('0x7'));var Redis=require(_0x7555('0x8'));var interaction=require(_0x7555('0x9'));var qs=require(_0x7555('0xa'));var logger=require(_0x7555('0xb'))(_0x7555('0xc'));var config=require('../../config/environment');var db=require(_0x7555('0xd'))['db'];var htmlEntities=require(_0x7555('0xe'));config[_0x7555('0xf')]=_['defaults'](config['redis'],{'host':_0x7555('0x10'),'port':0x18eb});var socket=require(_0x7555('0x11'))(new Redis(config[_0x7555('0xf')]));require(_0x7555('0x12'))['register'](socket);function respondWithStatusCode(_0x21aa55,_0x4c1379){_0x4c1379=_0x4c1379||0xcc;return function(_0xc91b58){if(_0xc91b58){return _0x21aa55[_0x7555('0x13')](_0x4c1379);}return _0x21aa55[_0x7555('0x14')](_0x4c1379)[_0x7555('0x15')]();};}function respondWithResult(_0x54864d,_0x201933){_0x201933=_0x201933||0xc8;return function(_0x1f7c1a){if(_0x1f7c1a){return _0x54864d[_0x7555('0x14')](_0x201933)['json'](_0x1f7c1a);}};}function respondWithFilteredResult(_0x5aad59,_0x372b44){return function(_0x3c85f8){if(_0x3c85f8){var _0x56079b=typeof _0x372b44[_0x7555('0x16')]===_0x7555('0x17')&&typeof _0x372b44[_0x7555('0x18')]===_0x7555('0x17');var _0x1aa758=_0x3c85f8[_0x7555('0x19')];var _0x364187=_0x56079b?0x0:_0x372b44['offset'];var _0x15ce5f=_0x56079b?_0x3c85f8['count']:_0x372b44[_0x7555('0x16')]+_0x372b44[_0x7555('0x18')];var _0x155a15;if(_0x15ce5f>=_0x1aa758){_0x15ce5f=_0x1aa758;_0x155a15=0xc8;}else{_0x155a15=0xce;}_0x5aad59['status'](_0x155a15);return _0x5aad59[_0x7555('0x1a')](_0x7555('0x1b'),_0x364187+'-'+_0x15ce5f+'/'+_0x1aa758)['json'](_0x3c85f8);}return null;};}function saveUpdates(_0x200e18){return function(_0x501f3b){if(_0x501f3b){return _0x501f3b[_0x7555('0x1c')](_0x200e18)['then'](function(_0x5cf3fe){return _0x5cf3fe;});}return null;};}function removeEntity(_0x4f1c3d){return function(_0x2aa45b){if(_0x2aa45b){return _0x2aa45b[_0x7555('0x1d')]()[_0x7555('0x1e')](function(){_0x4f1c3d[_0x7555('0x14')](0xcc)[_0x7555('0x15')]();});}};}function handleEntityNotFound(_0x1b5d22){return function(_0x3c6ddb){if(!_0x3c6ddb){_0x1b5d22[_0x7555('0x13')](0x194);}return _0x3c6ddb;};}function handleError(_0x2dc590,_0x8f22cf){_0x8f22cf=_0x8f22cf||0x1f4;return function(_0x41af02){logger[_0x7555('0x1f')](_0x41af02['stack']);if(_0x41af02['name']){delete _0x41af02[_0x7555('0x20')];}_0x2dc590[_0x7555('0x14')](_0x8f22cf)['send'](_0x41af02);};}exports[_0x7555('0x21')]=function(_0x332202,_0x51c7de){var _0x111b3d={};var _0x4123b4=_[_0x7555('0x22')](db['MailInteraction'][_0x7555('0x23')],function(_0x71439c){return{'name':_0x71439c['fieldName'],'type':_0x71439c['type'][_0x7555('0x24')]};});_0x111b3d=qs[_0x7555('0x25')](_0x4123b4,_0x332202);return interaction[_0x7555('0x26')]('mail',_0x332202[_0x7555('0x27')],_0x332202[_0x7555('0x28')],_0x111b3d,_0x4123b4)['then'](respondWithFilteredResult(_0x51c7de,_0x111b3d))[_0x7555('0x29')](handleError(_0x51c7de,null));};exports[_0x7555('0x2a')]=function(_0x3f8c3c,_0xbe8be0){var _0x381066={'raw':![],'where':{'id':_0x3f8c3c['params']['id']}},_0x3e6a43={};_0x3e6a43[_0x7555('0x2b')]=_['keys'](db['MailInteraction'][_0x7555('0x23')]);_0x3e6a43[_0x7555('0x27')]=_[_0x7555('0x2c')](_0x3f8c3c[_0x7555('0x27')]);_0x3e6a43['filters']=_[_0x7555('0x2d')](_0x3e6a43[_0x7555('0x2b')],_0x3e6a43['query']);_0x381066[_0x7555('0x2e')]=_[_0x7555('0x2d')](_0x3e6a43[_0x7555('0x2b')],qs[_0x7555('0x2f')](_0x3f8c3c[_0x7555('0x27')]['fields']));_0x381066['attributes']=_0x381066[_0x7555('0x2e')]['length']?_0x381066[_0x7555('0x2e')]:_0x3e6a43['model'];if(_0x3f8c3c[_0x7555('0x27')]['includeAll']){_0x381066[_0x7555('0x30')]=[{'all':!![]}];}_0x381066=_[_0x7555('0x31')]({},_0x381066,_0x3f8c3c['options']);return db[_0x7555('0x32')]['find'](_0x381066)[_0x7555('0x1e')](handleEntityNotFound(_0xbe8be0,null))[_0x7555('0x1e')](respondWithResult(_0xbe8be0,null))[_0x7555('0x29')](handleError(_0xbe8be0,null));};exports[_0x7555('0x33')]=function(_0x36abf9,_0x3226df){return db['MailInteraction']['create'](_0x36abf9[_0x7555('0x34')],{})[_0x7555('0x1e')](respondWithResult(_0x3226df,0xc9))[_0x7555('0x29')](handleError(_0x3226df,null));};exports['update']=function(_0x3bb22a,_0x327fa0){if(_0x3bb22a[_0x7555('0x34')]['id']){delete _0x3bb22a[_0x7555('0x34')]['id'];}return db[_0x7555('0x32')][_0x7555('0x35')]({'where':{'id':_0x3bb22a[_0x7555('0x36')]['id']}})['then'](handleEntityNotFound(_0x327fa0,null))['then'](saveUpdates(_0x3bb22a[_0x7555('0x34')],null))[_0x7555('0x1e')](respondWithResult(_0x327fa0,null))[_0x7555('0x29')](handleError(_0x327fa0,null));};exports['destroy']=function(_0x125ddc,_0x2425e2){return db[_0x7555('0x32')]['find']({'where':{'id':_0x125ddc[_0x7555('0x36')]['id']}})[_0x7555('0x1e')](handleEntityNotFound(_0x2425e2,null))['then'](removeEntity(_0x2425e2,null))[_0x7555('0x29')](handleError(_0x2425e2,null));};exports[_0x7555('0x37')]=function(_0x4fa22b,_0x284e2c){return db['MailInteraction'][_0x7555('0x37')]()[_0x7555('0x1e')](respondWithResult(_0x284e2c,null))[_0x7555('0x29')](handleError(_0x284e2c,null));};exports[_0x7555('0x38')]=function(_0x5dea82,_0x3bc6b4){return db['MailMessage'][_0x7555('0x35')]({'where':{'id':_0x5dea82[_0x7555('0x36')]['id']}})[_0x7555('0x1e')](handleEntityNotFound(_0x3bc6b4,null))[_0x7555('0x1e')](function(_0x3ef604){if(_0x3ef604){return _0x3ef604[_0x7555('0x38')](_0x5dea82['body'][_0x7555('0x39')],_[_0x7555('0x3a')](_0x5dea82[_0x7555('0x34')],[_0x7555('0x39'),'id'])||{});}})[_0x7555('0x1e')](respondWithResult(_0x3bc6b4,null))[_0x7555('0x29')](handleError(_0x3bc6b4,null));};exports['getMessages']=function(_0x1c17e3,_0x5ba3eb){var _0x560abc={'raw':![],'where':{}};var _0x55099b={};var _0x405acb={'count':0x0,'rows':[]};return db[_0x7555('0x32')]['findOne']({'where':{'id':_0x1c17e3['params']['id']}})['then'](handleEntityNotFound(_0x5ba3eb,null))['then'](function(_0x5864bf){if(_0x5864bf){_0x55099b[_0x7555('0x2b')]=_['keys'](db[_0x7555('0x3b')][_0x7555('0x23')]);_0x55099b[_0x7555('0x27')]=_['keys'](_0x1c17e3[_0x7555('0x27')]);_0x55099b[_0x7555('0x3c')]=_[_0x7555('0x2d')](_0x55099b['model'],_0x55099b['query']);_0x560abc[_0x7555('0x2e')]=_['intersection'](_0x55099b['model'],qs[_0x7555('0x2f')](_0x1c17e3['query']['fields']));_0x560abc[_0x7555('0x2e')]=_0x560abc[_0x7555('0x2e')][_0x7555('0x3d')]?_0x560abc[_0x7555('0x2e')]:_0x55099b['model'];if(!_0x1c17e3['query'][_0x7555('0x3e')](_0x7555('0x3f'))){_0x560abc[_0x7555('0x18')]=qs[_0x7555('0x18')](_0x1c17e3[_0x7555('0x27')][_0x7555('0x18')]);_0x560abc[_0x7555('0x16')]=qs[_0x7555('0x16')](_0x1c17e3['query'][_0x7555('0x16')]);}_0x560abc[_0x7555('0x40')]=qs[_0x7555('0x41')](_0x1c17e3[_0x7555('0x27')][_0x7555('0x41')]);_0x560abc['where']=qs[_0x7555('0x3c')](_[_0x7555('0x42')](_0x1c17e3[_0x7555('0x27')],_0x55099b[_0x7555('0x3c')]));_0x560abc[_0x7555('0x43')][_0x7555('0x44')]=_0x5864bf['id'];if(_0x1c17e3[_0x7555('0x27')][_0x7555('0x45')]){_0x560abc[_0x7555('0x43')]=_['merge'](_0x560abc['where'],{'$or':_[_0x7555('0x22')](_0x560abc[_0x7555('0x2e')],function(_0x4852da){var _0xca8247={};_0xca8247[_0x4852da]={'$like':'%'+_0x1c17e3[_0x7555('0x27')][_0x7555('0x45')]+'%'};return _0xca8247;})});}if(_0x1c17e3[_0x7555('0x27')][_0x7555('0x46')]){var _0x8cddd7=_0x1c17e3[_0x7555('0x27')]['$gte'][_0x7555('0x47')](',');var _0x3dcb9a={};_0x3dcb9a[_0x8cddd7[0x0]]={'$gte':moment(_0x8cddd7[0x1])[_0x7555('0x48')](_0x7555('0x49'))};_0x560abc[_0x7555('0x43')]=_[_0x7555('0x31')](_0x560abc[_0x7555('0x43')],_0x3dcb9a);}_0x560abc=_[_0x7555('0x31')]({},_0x560abc,_0x1c17e3[_0x7555('0x4a')]);return db[_0x7555('0x3b')]['count']({'where':_0x560abc[_0x7555('0x43')]})[_0x7555('0x1e')](function(_0x1ad64b){_0x405acb[_0x7555('0x19')]=_0x1ad64b;if(_0x1c17e3['query'][_0x7555('0x4b')]){_0x560abc[_0x7555('0x30')]=[{'all':!![]}];}return db[_0x7555('0x3b')]['findAll'](_0x560abc);})[_0x7555('0x1e')](function(_0x4e913a){if(_0x1c17e3[_0x7555('0x27')]['inlineCss']===_0x7555('0x4c')){for(var _0x46f939=0x0;_0x46f939<_0x4e913a[_0x7555('0x3d')];_0x46f939++){_0x4e913a[_0x46f939][_0x7555('0x34')]=juice(_0x4e913a[_0x46f939][_0x7555('0x34')]);}}_0x405acb[_0x7555('0x4d')]=_0x4e913a;return _0x405acb;});}})[_0x7555('0x1e')](respondWithFilteredResult(_0x5ba3eb,_0x560abc))[_0x7555('0x29')](handleError(_0x5ba3eb,null));};exports['addTags']=function(_0x1c45a3,_0xc187af){return db['MailInteraction'][_0x7555('0x35')]({'where':{'id':_0x1c45a3[_0x7555('0x36')]['id']}})[_0x7555('0x1e')](handleEntityNotFound(_0xc187af,null))[_0x7555('0x1e')](function(_0x1f1b21){if(_0x1f1b21){return _0x1f1b21[_0x7555('0x4e')](_0x1c45a3[_0x7555('0x34')][_0x7555('0x39')],_[_0x7555('0x3a')](_0x1c45a3[_0x7555('0x34')],[_0x7555('0x39'),'id'])||{})[_0x7555('0x4f')](function(){return db[_0x7555('0x50')][_0x7555('0x26')]({'attributes':['id',_0x7555('0x20'),_0x7555('0x51')],'where':{'id':_0x1c45a3[_0x7555('0x34')][_0x7555('0x39')]}});})[_0x7555('0x1e')](function(_0x494002){socket[_0x7555('0x52')](_0x7555('0x53'),{'id':Number(_0x1c45a3[_0x7555('0x36')]['id']),'tags':_0x494002||[]});return{'id':Number(_0x1c45a3['params']['id']),'tags':_0x494002||[]};});}})[_0x7555('0x1e')](respondWithResult(_0xc187af,null))[_0x7555('0x29')](handleError(_0xc187af,null));};exports[_0x7555('0x54')]=function(_0x2fbe2e,_0x2e132e){return db[_0x7555('0x32')][_0x7555('0x35')]({'where':{'id':_0x2fbe2e[_0x7555('0x36')]['id']}})[_0x7555('0x1e')](handleEntityNotFound(_0x2e132e,null))['then'](function(_0x50ebe3){if(_0x50ebe3){return _0x50ebe3[_0x7555('0x54')](_0x2fbe2e[_0x7555('0x27')][_0x7555('0x39')]);}})['then'](respondWithStatusCode(_0x2e132e,null))[_0x7555('0x29')](handleError(_0x2e132e,null));};exports['download']=function(_0x5c7e89,_0x3ed893){var _0x4973f4=moment()['unix']()['toString']();var _0x2752dc=path[_0x7555('0x55')](config[_0x7555('0x56')],'server',_0x7555('0x57'),_0x7555('0x58'));var _0x39dddb=path[_0x7555('0x55')](config['root'],_0x7555('0x59'),_0x7555('0x57'),_0x7555('0x5a'));var _0x3f5702=path['join'](_0x2752dc,_0x4973f4);var _0x3b5d99=util['format'](_0x7555('0x5b'),_0x5c7e89[_0x7555('0x36')]['id'],_0x4973f4);var _0x2a0bd7=path[_0x7555('0x55')](_0x2752dc,_0x3b5d99);var _0x11ed38=[];if(_0x5c7e89[_0x7555('0x27')][_0x7555('0x5a')]){_0x11ed38[_0x7555('0x5c')]({'model':db[_0x7555('0x5d')],'as':_0x7555('0x5e'),'raw':!![]});}var _0xd7bc98=[{'model':db[_0x7555('0x3b')],'as':_0x7555('0x5f'),'attributes':['id','body',_0x7555('0x60'),'to','cc','bcc','subject',_0x7555('0x61')],'where':{'secret':![]},'order':qs[_0x7555('0x41')]('id'),'include':_0x11ed38}];return db[_0x7555('0x32')][_0x7555('0x35')]({'where':{'id':_0x5c7e89[_0x7555('0x36')]['id']},'include':_0xd7bc98})['then'](handleEntityNotFound(_0x3ed893,null))[_0x7555('0x1e')](function(_0x145043){if(_0x145043&&_0x145043[_0x7555('0x5f')]){var _0x34c3a3=_0x145043['get']({'plain':!![]});fs[_0x7555('0x62')](_0x3f5702);return BPromise['each'](_0x34c3a3[_0x7555('0x5f')],function(_0x5aca97,_0x450cc3){var _0x2e0e07={'from':_0x5aca97[_0x7555('0x60')],'to':_0x5aca97['to']||'missing.recipient@your.company.com','subject':_0x5aca97['subject'],'html':htmlEntities[_0x7555('0x63')](_0x5aca97['body']),'headers':{'Date':moment(_0x5aca97[_0x7555('0x61')])['format'](_0x7555('0x64'))},'attachments':[]};if(_0x5aca97['cc']){_0x2e0e07[_0x7555('0x65')]['Cc']=_0x5aca97['cc'];}if(_0x5aca97[_0x7555('0x66')]){_0x2e0e07[_0x7555('0x65')][_0x7555('0x67')]=_0x5aca97[_0x7555('0x66')];}return new BPromise(function(_0x1ee63f,_0x2280f9){if(_0x5aca97[_0x7555('0x5e')]){for(var _0xaabcbf=0x0;_0xaabcbf<_0x5aca97[_0x7555('0x5e')]['length'];_0xaabcbf++){var _0x8e813d=_0x5aca97['Attachments'][_0xaabcbf];var _0x18976e=path[_0x7555('0x55')](_0x39dddb,_0x8e813d['basename']);if(fs['existsSync'](_0x18976e)){_0x2e0e07[_0x7555('0x5a')][_0x7555('0x5c')]({'name':_0x8e813d[_0x7555('0x20')],'contentType':_0x8e813d[_0x7555('0x68')],'data':fs[_0x7555('0x69')](_0x18976e)});}}}emlformat[_0x7555('0x6a')](_0x2e0e07,function(_0x172ab2,_0x503b00){if(_0x172ab2)return _0x2280f9(_0x172ab2);fs[_0x7555('0x6b')](path[_0x7555('0x55')](_0x3f5702,util[_0x7555('0x48')](_0x7555('0x6c'),_0x450cc3)),_0x503b00);return _0x1ee63f(_0x503b00);});});})['then'](function(){return new BPromise(function(_0x10b6ce,_0x1138e8){zipdir(_0x3f5702,{'saveTo':_0x2a0bd7},function(_0x3c9193,_0x412527){if(_0x3c9193)return _0x1138e8(_0x3c9193);return _0x10b6ce(_0x412527);});})['then'](function(){return new BPromise(function(_0x29a1a8,_0x272f33){rimraf(_0x3f5702,function(_0x50d9c6){if(_0x50d9c6)_0x272f33(_0x50d9c6);return _0x29a1a8();});});})[_0x7555('0x1e')](function(){return _0x3ed893[_0x7555('0x6d')](_0x2a0bd7,_0x3b5d99,function(_0x5da16c){if(!_0x5da16c)fs['unlinkSync'](_0x2a0bd7);});});});}else{return _0x3ed893[_0x7555('0x13')](0xc8);}})[_0x7555('0x29')](handleError(_0x3ed893,null));};
\ No newline at end of file
index 0a55865..ad1116c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab6=['MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x27897f,_0x14bcc2){var _0x3f79d6=function(_0x580e2c){while(--_0x580e2c){_0x27897f['push'](_0x27897f['shift']());}};_0x3f79d6(++_0x14bcc2);}(_0xdab6,0x10f));var _0x6dab=function(_0x104049,_0x2ef746){_0x104049=_0x104049-0x0;var _0x3375e1=_0xdab6[_0x104049];return _0x3375e1;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x6dab('0x0'))['db'][_0x6dab('0x1')];var MailMessage=require(_0x6dab('0x0'))['db'][_0x6dab('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6dab('0x3')](0x0);var events={'afterCreate':_0x6dab('0x4'),'afterUpdate':_0x6dab('0x5'),'afterDestroy':_0x6dab('0x6')};function emitEvent(_0x272226){return function(_0x43e942,_0x50806f,_0x481149){_0x43e942[_0x6dab('0x7')]({'attributes':['id'],'raw':!![]})[_0x6dab('0x8')](function(_0x432849){_0x43e942[_0x6dab('0x9')]('Users',_0x432849[_0x6dab('0xa')](function(_0x15fc48){return{'id':_0x15fc48['id']};}));return MailMessage[_0x6dab('0xb')]({'where':{'MailInteractionId':_0x43e942['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6dab('0x8')](function(_0x3774b2){_0x43e942[_0x6dab('0x9')](_0x6dab('0xc'),_0x3774b2['length']);MailInteractionEvents[_0x6dab('0xd')](_0x272226+':'+_0x43e942['id'],_0x43e942);MailInteractionEvents[_0x6dab('0xd')](_0x272226,_0x43e942);_0x481149(null);})['catch'](_0x481149(null));};}for(var e in events){if(events[_0x6dab('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x6dab('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0xacb1=['MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xacb1,0x1d2));var _0x1acb=function(_0xb90e52,_0x375c49){_0xb90e52=_0xb90e52-0x0;var _0x283df6=_0xacb1[_0xb90e52];return _0x283df6;};'use strict';var EventEmitter=require(_0x1acb('0x0'));var MailInteraction=require(_0x1acb('0x1'))['db'][_0x1acb('0x2')];var MailMessage=require(_0x1acb('0x1'))['db'][_0x1acb('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1acb('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1acb('0x5'),'afterDestroy':_0x1acb('0x6')};function emitEvent(_0x5c15f4){return function(_0x3a6e0f,_0x4baa2f,_0x3fbfa4){_0x3a6e0f[_0x1acb('0x7')]({'attributes':['id'],'raw':!![]})[_0x1acb('0x8')](function(_0x3a2a22){_0x3a6e0f['setDataValue'](_0x1acb('0x9'),_0x3a2a22[_0x1acb('0xa')](function(_0xbfa0e8){return{'id':_0xbfa0e8['id']};}));return MailMessage[_0x1acb('0xb')]({'where':{'MailInteractionId':_0x3a6e0f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1acb('0x8')](function(_0x449895){_0x3a6e0f[_0x1acb('0xc')](_0x1acb('0xd'),_0x449895[_0x1acb('0xe')]);MailInteractionEvents[_0x1acb('0xf')](_0x5c15f4+':'+_0x3a6e0f['id'],_0x3a6e0f);MailInteractionEvents[_0x1acb('0xf')](_0x5c15f4,_0x3a6e0f);_0x3fbfa4(null);})['catch'](_0x3fbfa4(null));};}for(var e in events){if(events[_0x1acb('0x10')](e)){var event=events[e];MailInteraction[_0x1acb('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index 86335cf..524feff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x238e=['FULLTEXT','substatus','closed','closedAt','changed','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','../../config/environment','MailInteraction','fti_mail_interactions'];(function(_0x1aa014,_0x4186a3){var _0xc0435c=function(_0x59eb8f){while(--_0x59eb8f){_0x1aa014['push'](_0x1aa014['shift']());}};_0xc0435c(++_0x4186a3);}(_0x238e,0x13a));var _0xe238=function(_0xf32ace,_0x3cc3eb){_0xf32ace=_0xf32ace-0x0;var _0x43b714=_0x238e[_0xf32ace];return _0x43b714;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe238('0x0'))(_0xe238('0x1'));var moment=require(_0xe238('0x2'));var BPromise=require(_0xe238('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe238('0x4'));var rimraf=require('rimraf');var config=require(_0xe238('0x5'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x16c308,_0x28bf7e){return _0x16c308['define'](_0xe238('0x6'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xe238('0x7'),'fields':['subject','to'],'type':_0xe238('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36517c,_0x39fecf,_0x556a68){if(_0x36517c[_0xe238('0x9')]){_0x36517c['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x36517c[_0xe238('0xa')]){_0x36517c[_0xe238('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x556a68(null,_0x39fecf);},'beforeUpdate':function(_0x6ce72,_0x17bd08,_0x8853b5){if(_0x6ce72[_0xe238('0xc')]('substatus')){_0x6ce72[_0xe238('0xd')]=_0x6ce72[_0xe238('0x9')]?moment()[_0xe238('0xe')](_0xe238('0xf')):null;}if(_0x6ce72[_0xe238('0xc')]('closed')){_0x6ce72['closedAt']=moment()['format'](_0xe238('0xf'));_0x6ce72[_0xe238('0x9')]=null;_0x6ce72[_0xe238('0xd')]=null;}_0x8853b5(null,_0x6ce72);},'afterUpdate':function(_0x766a19,_0x8779a4,_0x231fe6){var _0x1a9167=_0x16c308[_0xe238('0x10')];var _0x5cc53b=_0x766a19['get']({'plain':!![]});if(_0x5cc53b[_0xe238('0xa')]){return _0x1a9167[_0xe238('0x11')][_0xe238('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0x5cc53b['id']}})[_0xe238('0x13')](function(){_0x231fe6();})[_0xe238('0x14')](function(_0x5554b9){_0x231fe6(_0x5554b9);});}else{_0x231fe6();}}},'charset':_0xe238('0x15'),'collate':_0xe238('0x16')});};
\ No newline at end of file
+var _0x2aad=['../../config/environment','./mailInteraction.attributes','define','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4c7ee1,_0xdd33ba){var _0x3576fb=function(_0xc96c4b){while(--_0xc96c4b){_0x4c7ee1['push'](_0x4c7ee1['shift']());}};_0x3576fb(++_0xdd33ba);}(_0x2aad,0xaf));var _0xd2aa=function(_0x34bcbf,_0x529caf){_0x34bcbf=_0x34bcbf-0x0;var _0x4951ee=_0x2aad[_0x34bcbf];return _0x4951ee;};'use strict';var _=require('lodash');var util=require(_0xd2aa('0x0'));var logger=require(_0xd2aa('0x1'))(_0xd2aa('0x2'));var moment=require('moment');var BPromise=require(_0xd2aa('0x3'));var rp=require(_0xd2aa('0x4'));var fs=require('fs');var path=require(_0xd2aa('0x5'));var rimraf=require(_0xd2aa('0x6'));var config=require(_0xd2aa('0x7'));var attributes=require(_0xd2aa('0x8'));module['exports']=function(_0x140f40,_0x399a5b){return _0x140f40[_0xd2aa('0x9')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xd2aa('0xa'),'fields':[_0xd2aa('0xb'),'to'],'type':_0xd2aa('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x554aa9,_0x75cf85,_0x4b134c){if(_0x554aa9[_0xd2aa('0xd')]){_0x554aa9[_0xd2aa('0xe')]=moment()[_0xd2aa('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x554aa9[_0xd2aa('0x10')]){_0x554aa9[_0xd2aa('0x11')]=moment()[_0xd2aa('0xf')](_0xd2aa('0x12'));}_0x4b134c(null,_0x75cf85);},'beforeUpdate':function(_0x212c9f,_0x215aeb,_0x3d631f){if(_0x212c9f[_0xd2aa('0x13')](_0xd2aa('0xd'))){_0x212c9f['substatusAt']=_0x212c9f[_0xd2aa('0xd')]?moment()[_0xd2aa('0xf')](_0xd2aa('0x12')):null;}if(_0x212c9f[_0xd2aa('0x13')]('closed')){_0x212c9f[_0xd2aa('0x11')]=moment()[_0xd2aa('0xf')](_0xd2aa('0x12'));_0x212c9f[_0xd2aa('0xd')]=null;_0x212c9f[_0xd2aa('0xe')]=null;}_0x3d631f(null,_0x212c9f);},'afterUpdate':function(_0x4eacaa,_0xa58a3a,_0x3c255d){var _0x2512b3=_0x140f40[_0xd2aa('0x14')];var _0x29037a=_0x4eacaa[_0xd2aa('0x15')]({'plain':!![]});if(_0x29037a['closed']){return _0x2512b3['MailMessage'][_0xd2aa('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x29037a['id']}})[_0xd2aa('0x17')](function(){_0x3c255d();})[_0xd2aa('0x18')](function(_0xacada6){_0x3c255d(_0xacada6);});}else{_0x3c255d();}}},'charset':'utf8mb4','collate':_0xd2aa('0x19')});};
\ No newline at end of file
index f82a1bc..a8678fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd10b=['catch','MailInteraction','update','options','raw','where','attributes','UpdateMailInteraction','debug','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x35c7f1,_0x18578c){var _0x208281=function(_0x26d055){while(--_0x26d055){_0x35c7f1['push'](_0x35c7f1['shift']());}};_0x208281(++_0x18578c);}(_0xd10b,0x189));var _0xbd10=function(_0x43aeab,_0x4b442c){_0x43aeab=_0x43aeab-0x0;var _0x416ef4=_0xd10b[_0x43aeab];return _0x416ef4;};'use strict';var _=require(_0xbd10('0x0'));var util=require(_0xbd10('0x1'));var moment=require(_0xbd10('0x2'));var BPromise=require(_0xbd10('0x3'));var rs=require(_0xbd10('0x4'));var fs=require('fs');var Redis=require(_0xbd10('0x5'));var db=require(_0xbd10('0x6'))['db'];var utils=require(_0xbd10('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbd10('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd10('0x9')]({'port':0x232a});config[_0xbd10('0xa')]=_[_0xbd10('0xb')](config[_0xbd10('0xa')],{'host':_0xbd10('0xc'),'port':0x18eb});var socket=require(_0xbd10('0xd'))(new Redis(config[_0xbd10('0xa')]));require(_0xbd10('0xe'))[_0xbd10('0xf')](socket);function respondWithRpcPromise(_0x45bbab,_0xd97ba4,_0x1c7332){return new BPromise(function(_0x488801,_0x409387){return client[_0xbd10('0x10')](_0x45bbab,_0x1c7332)[_0xbd10('0x11')](function(_0x888a80){logger[_0xbd10('0x12')](_0xbd10('0x13'),_0xd97ba4,_0xbd10('0x14'));logger['debug'](_0xbd10('0x15'),_0xd97ba4,'request\x20sent',JSON[_0xbd10('0x16')](_0x888a80));if(_0x888a80[_0xbd10('0x17')]){if(_0x888a80[_0xbd10('0x17')][_0xbd10('0x18')]===0x1f4){logger['error'](_0xbd10('0x13'),_0xd97ba4,_0x888a80['error']['message']);return _0x409387(_0x888a80[_0xbd10('0x17')][_0xbd10('0x19')]);}logger[_0xbd10('0x17')](_0xbd10('0x13'),_0xd97ba4,_0x888a80[_0xbd10('0x17')]['message']);return _0x488801(_0x888a80[_0xbd10('0x17')][_0xbd10('0x19')]);}else{logger[_0xbd10('0x12')](_0xbd10('0x13'),_0xd97ba4,_0xbd10('0x14'));_0x488801(_0x888a80[_0xbd10('0x1a')][_0xbd10('0x19')]);}})[_0xbd10('0x1b')](function(_0x25cf8e){logger[_0xbd10('0x17')](_0xbd10('0x13'),_0xd97ba4,_0x25cf8e);_0x409387(_0x25cf8e);});});}exports['UpdateMailInteraction']=function(_0x4f67b8){var _0x4c1f10=this;return new Promise(function(_0x4fc0e0,_0x3eea42){return db[_0xbd10('0x1c')][_0xbd10('0x1d')](_0x4f67b8['body'],{'raw':_0x4f67b8['options']?_0x4f67b8[_0xbd10('0x1e')][_0xbd10('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f67b8[_0xbd10('0x1e')]?_0x4f67b8[_0xbd10('0x1e')][_0xbd10('0x20')]||null:null,'attributes':_0x4f67b8[_0xbd10('0x1e')]?_0x4f67b8[_0xbd10('0x1e')][_0xbd10('0x21')]||null:null,'limit':_0x4f67b8['options']?_0x4f67b8[_0xbd10('0x1e')]['limit']||null:null})['then'](function(_0x1814b7){logger[_0xbd10('0x12')](_0xbd10('0x22'),_0x4f67b8);logger[_0xbd10('0x23')](_0xbd10('0x22'),_0x4f67b8,JSON[_0xbd10('0x16')](_0x1814b7));_0x4fc0e0(_0x1814b7);})[_0xbd10('0x1b')](function(_0x4f8571){logger[_0xbd10('0x17')](_0xbd10('0x22'),_0x4f8571[_0xbd10('0x19')],_0x4f67b8);_0x3eea42(_0x4c1f10[_0xbd10('0x17')](0x1f4,_0x4f8571['message']));});});};exports['AddTagsToMailInteraction']=function(_0x1d062b){return new Promise(function(_0x4febcc,_0x3d80c0){return db['MailInteraction'][_0xbd10('0x24')]({'where':_0x1d062b[_0xbd10('0x1e')]?_0x1d062b[_0xbd10('0x1e')]['where']||null:null})[_0xbd10('0x11')](function(_0x5ccfd7){if(_0x5ccfd7){return _0x5ccfd7[_0xbd10('0x25')](_0x1d062b[_0xbd10('0x26')][_0xbd10('0x27')],_['omit'](_0x1d062b[_0xbd10('0x26')],['ids','id'])||{});}})[_0xbd10('0x28')](function(_0x28ca10){logger['info']('AddTags',_0x1d062b);logger[_0xbd10('0x23')]('AddTags',_0x1d062b,JSON['stringify'](_0x28ca10));_0x4febcc(_0x28ca10);})[_0xbd10('0x1b')](function(_0xb2ee81){logger['error'](_0xbd10('0x29'),_0xb2ee81[_0xbd10('0x19')],_0x1d062b);_0x3d80c0(_this[_0xbd10('0x17')](0x1f4,_0xb2ee81[_0xbd10('0x19')]));});});};
\ No newline at end of file
+var _0x9931=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9931,0x1b6));var _0x1993=function(_0x16dd68,_0x5928cb){_0x16dd68=_0x16dd68-0x0;var _0x21615f=_0x9931[_0x16dd68];return _0x21615f;};'use strict';var _=require('lodash');var util=require(_0x1993('0x0'));var moment=require('moment');var BPromise=require(_0x1993('0x1'));var rs=require(_0x1993('0x2'));var fs=require('fs');var Redis=require(_0x1993('0x3'));var db=require(_0x1993('0x4'))['db'];var utils=require(_0x1993('0x5'));var logger=require(_0x1993('0x6'))(_0x1993('0x7'));var config=require(_0x1993('0x8'));var jayson=require(_0x1993('0x9'));var client=jayson[_0x1993('0xa')][_0x1993('0xb')]({'port':0x232a});config[_0x1993('0xc')]=_[_0x1993('0xd')](config[_0x1993('0xc')],{'host':_0x1993('0xe'),'port':0x18eb});var socket=require(_0x1993('0xf'))(new Redis(config[_0x1993('0xc')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xe4ec90,_0x38468b,_0x21c2af){return new BPromise(function(_0x372c71,_0x4179f4){return client[_0x1993('0x10')](_0xe4ec90,_0x21c2af)[_0x1993('0x11')](function(_0x473d84){logger[_0x1993('0x12')](_0x1993('0x13'),_0x38468b,_0x1993('0x14'));logger[_0x1993('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x38468b,'request\x20sent',JSON[_0x1993('0x16')](_0x473d84));if(_0x473d84[_0x1993('0x17')]){if(_0x473d84[_0x1993('0x17')][_0x1993('0x18')]===0x1f4){logger['error'](_0x1993('0x13'),_0x38468b,_0x473d84[_0x1993('0x17')][_0x1993('0x19')]);return _0x4179f4(_0x473d84[_0x1993('0x17')][_0x1993('0x19')]);}logger[_0x1993('0x17')](_0x1993('0x13'),_0x38468b,_0x473d84['error'][_0x1993('0x19')]);return _0x372c71(_0x473d84['error'][_0x1993('0x19')]);}else{logger[_0x1993('0x12')]('MailInteraction,\x20%s,\x20%s',_0x38468b,_0x1993('0x14'));_0x372c71(_0x473d84[_0x1993('0x1a')][_0x1993('0x19')]);}})[_0x1993('0x1b')](function(_0x17a94f){logger[_0x1993('0x17')]('MailInteraction,\x20%s,\x20%s',_0x38468b,_0x17a94f);_0x4179f4(_0x17a94f);});});}exports[_0x1993('0x1c')]=function(_0x13e96d){var _0x404b8f=this;return new Promise(function(_0x598a4b,_0x23f2a2){return db[_0x1993('0x1d')][_0x1993('0x1e')](_0x13e96d[_0x1993('0x1f')],{'raw':_0x13e96d['options']?_0x13e96d[_0x1993('0x20')][_0x1993('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13e96d[_0x1993('0x20')]?_0x13e96d[_0x1993('0x20')][_0x1993('0x22')]||null:null,'attributes':_0x13e96d[_0x1993('0x20')]?_0x13e96d[_0x1993('0x20')][_0x1993('0x23')]||null:null,'limit':_0x13e96d[_0x1993('0x20')]?_0x13e96d[_0x1993('0x20')][_0x1993('0x24')]||null:null})['then'](function(_0x5002ce){logger[_0x1993('0x12')](_0x1993('0x1c'),_0x13e96d);logger['debug']('UpdateMailInteraction',_0x13e96d,JSON[_0x1993('0x16')](_0x5002ce));_0x598a4b(_0x5002ce);})[_0x1993('0x1b')](function(_0x31baaa){logger[_0x1993('0x17')](_0x1993('0x1c'),_0x31baaa[_0x1993('0x19')],_0x13e96d);_0x23f2a2(_0x404b8f['error'](0x1f4,_0x31baaa['message']));});});};exports[_0x1993('0x25')]=function(_0x294469){return new Promise(function(_0x13da72,_0x14537b){return db[_0x1993('0x1d')][_0x1993('0x26')]({'where':_0x294469[_0x1993('0x20')]?_0x294469[_0x1993('0x20')][_0x1993('0x22')]||null:null})[_0x1993('0x11')](function(_0x51ee82){if(_0x51ee82){return _0x51ee82[_0x1993('0x27')](_0x294469[_0x1993('0x1f')][_0x1993('0x28')],_[_0x1993('0x29')](_0x294469['body'],['ids','id'])||{});}})[_0x1993('0x2a')](function(_0x208e79){logger[_0x1993('0x12')](_0x1993('0x2b'),_0x294469);logger[_0x1993('0x15')]('AddTags',_0x294469,JSON['stringify'](_0x208e79));_0x13da72(_0x208e79);})['catch'](function(_0x2a9c6a){logger[_0x1993('0x17')]('AddTags',_0x2a9c6a[_0x1993('0x19')],_0x294469);_0x14537b(_this['error'](0x1f4,_0x2a9c6a['message']));});});};
\ No newline at end of file
index 3c3f127..942b757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0878=['remove','emit','removeListener','length','save'];(function(_0x19f8fc,_0x552fcd){var _0x26c956=function(_0xa9791c){while(--_0xa9791c){_0x19f8fc['push'](_0x19f8fc['shift']());}};_0x26c956(++_0x552fcd);}(_0x0878,0x162));var _0x8087=function(_0x4a5622,_0x3b2074){_0x4a5622=_0x4a5622-0x0;var _0x47fc79=_0x0878[_0x4a5622];return _0x47fc79;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x8087('0x0'),_0x8087('0x1'),'update'];function createListener(_0x31abd2,_0x1ec85c){return function(_0x7bfcc0){_0x1ec85c[_0x8087('0x2')](_0x31abd2,_0x7bfcc0);};}function removeListener(_0x1cd5e1,_0x5ce94c){return function(){MailInteractionEvents[_0x8087('0x3')](_0x1cd5e1,_0x5ce94c);};}exports['register']=function(_0x1ec7c2){for(var _0x2bee4f=0x0,_0x280275=events[_0x8087('0x4')];_0x2bee4f<_0x280275;_0x2bee4f++){var _0xc25117=events[_0x2bee4f];var _0x2d431a=createListener('mailInteraction:'+_0xc25117,_0x1ec7c2);MailInteractionEvents['on'](_0xc25117,_0x2d431a);}};
\ No newline at end of file
+var _0x4557=['length','mailInteraction:','save','remove','removeListener','register'];(function(_0x24948e,_0x41e02d){var _0x16cdf0=function(_0x210d38){while(--_0x210d38){_0x24948e['push'](_0x24948e['shift']());}};_0x16cdf0(++_0x41e02d);}(_0x4557,0xec));var _0x7455=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4557[_0x20a584];return _0x4b41a8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x7455('0x0'),_0x7455('0x1'),'update'];function createListener(_0x597558,_0xf883c8){return function(_0x31f897){_0xf883c8['emit'](_0x597558,_0x31f897);};}function removeListener(_0x5e9032,_0x153b21){return function(){MailInteractionEvents[_0x7455('0x2')](_0x5e9032,_0x153b21);};}exports[_0x7455('0x3')]=function(_0x1579f1){for(var _0x35dcb1=0x0,_0x41da24=events[_0x7455('0x4')];_0x35dcb1<_0x41da24;_0x35dcb1++){var _0x20a7a2=events[_0x35dcb1];var _0x253330=createListener(_0x7455('0x5')+_0x20a7a2,_0x1579f1);MailInteractionEvents['on'](_0x20a7a2,_0x253330);}};
\ No newline at end of file
index aa37809..fdb7dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ff=['/:id/reject','reject','delete','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','update'];(function(_0x46626d,_0x711f79){var _0x5b5fa3=function(_0x34676f){while(--_0x34676f){_0x46626d['push'](_0x46626d['shift']());}};_0x5b5fa3(++_0x711f79);}(_0x35ff,0xb3));var _0xf35f=function(_0x18febb,_0x445204){_0x18febb=_0x18febb-0x0;var _0x2836db=_0x35ff[_0x18febb];return _0x2836db;};'use strict';var multer=require('multer');var util=require(_0xf35f('0x0'));var path=require(_0xf35f('0x1'));var timeout=require('connect-timeout');var express=require(_0xf35f('0x2'));var router=express[_0xf35f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf35f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf35f('0x5'));var controller=require(_0xf35f('0x6'));router[_0xf35f('0x7')]('/',auth[_0xf35f('0x8')](),controller[_0xf35f('0x9')]);router[_0xf35f('0x7')]('/describe',auth[_0xf35f('0x8')](),controller[_0xf35f('0xa')]);router[_0xf35f('0x7')](_0xf35f('0xb'),auth['isAuthenticated'](),controller[_0xf35f('0xc')]);router[_0xf35f('0x7')](_0xf35f('0xd'),auth[_0xf35f('0x8')](),controller[_0xf35f('0xe')]);router[_0xf35f('0xf')]('/',auth[_0xf35f('0x8')](),interaction['tracked'](_0xf35f('0x10'),_0xf35f('0x11')),controller[_0xf35f('0x12')]);router[_0xf35f('0x13')](_0xf35f('0xb'),auth[_0xf35f('0x8')](),controller[_0xf35f('0x14')]);router[_0xf35f('0x13')]('/:id/accept',auth[_0xf35f('0x8')](),controller['accept']);router[_0xf35f('0x13')](_0xf35f('0x15'),auth['isAuthenticated'](),controller[_0xf35f('0x16')]);router[_0xf35f('0x17')](_0xf35f('0xb'),auth[_0xf35f('0x8')](),controller[_0xf35f('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x5076=['download','post','tracked','mail','mailmessage:create','create','put','accept','/:id/reject','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download'];(function(_0x49fa9c,_0x355389){var _0x20f031=function(_0x53a7a5){while(--_0x53a7a5){_0x49fa9c['push'](_0x49fa9c['shift']());}};_0x20f031(++_0x355389);}(_0x5076,0x168));var _0x6507=function(_0x3a84a9,_0x15407f){_0x3a84a9=_0x3a84a9-0x0;var _0x259beb=_0x5076[_0x3a84a9];return _0x259beb;};'use strict';var multer=require(_0x6507('0x0'));var util=require('util');var path=require(_0x6507('0x1'));var timeout=require('connect-timeout');var express=require(_0x6507('0x2'));var router=express[_0x6507('0x3')]();var fs_extra=require(_0x6507('0x4'));var auth=require(_0x6507('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6507('0x6'));var controller=require(_0x6507('0x7'));router[_0x6507('0x8')]('/',auth[_0x6507('0x9')](),controller[_0x6507('0xa')]);router[_0x6507('0x8')]('/describe',auth[_0x6507('0x9')](),controller[_0x6507('0xb')]);router[_0x6507('0x8')](_0x6507('0xc'),auth['isAuthenticated'](),controller[_0x6507('0xd')]);router[_0x6507('0x8')](_0x6507('0xe'),auth['isAuthenticated'](),controller[_0x6507('0xf')]);router[_0x6507('0x10')]('/',auth[_0x6507('0x9')](),interaction[_0x6507('0x11')](_0x6507('0x12'),_0x6507('0x13')),controller[_0x6507('0x14')]);router[_0x6507('0x15')](_0x6507('0xc'),auth[_0x6507('0x9')](),controller['update']);router[_0x6507('0x15')]('/:id/accept',auth['isAuthenticated'](),controller[_0x6507('0x16')]);router[_0x6507('0x15')](_0x6507('0x17'),auth[_0x6507('0x9')](),controller['reject']);router['delete']('/:id',auth[_0x6507('0x9')](),controller['destroy']);module[_0x6507('0x18')]=router;
\ No newline at end of file
index 9a0f56d..287ec5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc24f=['TEXT','long','BOOLEAN','out','STRING','INTEGER','Chat','Email','sequelize','exports'];(function(_0x57da8b,_0x594e24){var _0x4180ed=function(_0x83ce2d){while(--_0x83ce2d){_0x57da8b['push'](_0x57da8b['shift']());}};_0x4180ed(++_0x594e24);}(_0xc24f,0x184));var _0xfc24=function(_0x17283f,_0x1b1210){_0x17283f=_0x17283f-0x0;var _0x39c041=_0xc24f[_0x17283f];return _0x39c041;};'use strict';var Sequelize=require(_0xfc24('0x0'));var _=require('lodash');module[_0xfc24('0x1')]={'body':{'type':Sequelize[_0xfc24('0x2')](_0xfc24('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xfc24('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xfc24('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfc24('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xfc24('0x2')]('long')},'cc':{'type':Sequelize[_0xfc24('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0xfc24('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xfc24('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfc24('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xfc24('0x2')](_0xfc24('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xfc24('0x3'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0xfc24('0x8')),'defaultValue':_0xfc24('0x9'),'allowNull':![]}};
\ No newline at end of file
+var _0x4bd8=['STRING','BOOLEAN','ENUM','Email','sequelize','lodash','exports','TEXT','long','medium','out'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0x4bd8,0x93));var _0x84bd=function(_0x3370d1,_0x2d2899){_0x3370d1=_0x3370d1-0x0;var _0xa1cb3=_0x4bd8[_0x3370d1];return _0xa1cb3;};'use strict';var Sequelize=require(_0x84bd('0x0'));var _=require(_0x84bd('0x1'));module[_0x84bd('0x2')]={'body':{'type':Sequelize[_0x84bd('0x3')](_0x84bd('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x84bd('0x3')](_0x84bd('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x84bd('0x6')),'defaultValue':_0x84bd('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x84bd('0x7')](0x1fe)},'from':{'type':Sequelize[_0x84bd('0x7')]},'to':{'type':Sequelize[_0x84bd('0x3')](_0x84bd('0x4'))},'cc':{'type':Sequelize[_0x84bd('0x3')](_0x84bd('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x84bd('0x4'))},'subject':{'type':Sequelize[_0x84bd('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x84bd('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x84bd('0x3')]('long')},'originCc':{'type':Sequelize[_0x84bd('0x3')]('long')},'originChannel':{'type':Sequelize[_0x84bd('0x9')](_0x84bd('0xa'),'Chat'),'defaultValue':_0x84bd('0xa'),'allowNull':![]}};
\ No newline at end of file
index 2d97981..e5eaa2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07aa=['Contacts','ListId','List\x20not\x20found','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','fullname','email','event','fromString','unix','toString','server','tmp','message-%s.eml','from','bcc','createdAt','Attachment','decode','headers','Bcc','Attachments','basename','push','readFileSync','build','download','unlinkSync','eml-format','moment','bluebird','util','path','html-to-text','api','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','status','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailMessage','include','findAll','rows','catch','params','find','body','destroy','describe','create','out','split','CmList','List','CmContact','updatedAt','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x07aa,0xd0));var _0xa07a=function(_0x44c043,_0x1e8a5f){_0x44c043=_0x44c043-0x0;var _0x53e6f9=_0x07aa[_0x44c043];return _0x53e6f9;};'use strict';var emlformat=require(_0xa07a('0x0'));var moment=require(_0xa07a('0x1'));var BPromise=require(_0xa07a('0x2'));var util=require(_0xa07a('0x3'));var path=require(_0xa07a('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xa07a('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xa07a('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0xa07a('0x7'))['db'];config[_0xa07a('0x8')]=_[_0xa07a('0x9')](config[_0xa07a('0x8')],{'host':_0xa07a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa07a('0x8')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xa07a('0xb')](socket);var jayson=require(_0xa07a('0xc'));var client=jayson[_0xa07a('0xd')][_0xa07a('0xe')]({'port':0x232c});var client9003=jayson[_0xa07a('0xd')][_0xa07a('0xe')]({'port':0x232b});var client9002=jayson[_0xa07a('0xd')][_0xa07a('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x2167f5,_0x3e4881,_0x1c433e,_0x38e13f){return new BPromise(function(_0x2cc6af,_0x340e19){var _0x1db24b=_0x38e13f||client;return _0x1db24b[_0xa07a('0xf')](_0x2167f5,_0x1c433e)[_0xa07a('0x10')](function(_0xe1724e){logger[_0xa07a('0x11')](_0xa07a('0x12'),_0x3e4881,'request\x20sent');logger[_0xa07a('0x13')](_0xa07a('0x14'),_0x3e4881,'request\x20sent',JSON[_0xa07a('0x15')](_0xe1724e));if(_0xe1724e[_0xa07a('0x16')]){if(_0xe1724e[_0xa07a('0x16')][_0xa07a('0x17')]===0x1f4){logger[_0xa07a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3e4881,_0xe1724e['error'][_0xa07a('0x18')]);return _0x340e19(_0xe1724e[_0xa07a('0x16')]['message']);}logger['error'](_0xa07a('0x12'),_0x3e4881,_0xe1724e['error'][_0xa07a('0x18')]);return _0x2cc6af(_0xe1724e[_0xa07a('0x16')][_0xa07a('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x3e4881,_0xa07a('0x19'));_0x2cc6af(_0xe1724e['result']['message']);}})['catch'](function(_0xb4b0e5){logger[_0xa07a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3e4881,_0xb4b0e5);_0x340e19(_0xb4b0e5);});});}function respondWithResult(_0x2a5b7d,_0x4801f2){_0x4801f2=_0x4801f2||0xc8;return function(_0x160dc7){if(_0x160dc7){return _0x2a5b7d[_0xa07a('0x1a')](_0x4801f2)[_0xa07a('0x1b')](_0x160dc7);}};}function respondWithFilteredResult(_0x4eb864,_0x1de143){return function(_0x16adf9){if(_0x16adf9){var _0x2d3dd4=typeof _0x1de143[_0xa07a('0x1c')]===_0xa07a('0x1d')&&typeof _0x1de143[_0xa07a('0x1e')]===_0xa07a('0x1d');var _0x480d5d=_0x16adf9[_0xa07a('0x1f')];var _0x454fae=_0x2d3dd4?0x0:_0x1de143[_0xa07a('0x1c')];var _0x564fb0=_0x2d3dd4?_0x16adf9['count']:_0x1de143[_0xa07a('0x1c')]+_0x1de143['limit'];var _0x4b2e8b;if(_0x564fb0>=_0x480d5d){_0x564fb0=_0x480d5d;_0x4b2e8b=0xc8;}else{_0x4b2e8b=0xce;}_0x4eb864[_0xa07a('0x1a')](_0x4b2e8b);return _0x4eb864[_0xa07a('0x20')](_0xa07a('0x21'),_0x454fae+'-'+_0x564fb0+'/'+_0x480d5d)[_0xa07a('0x1b')](_0x16adf9);}return null;};}function saveUpdates(_0x6884e7){return function(_0x1a5b91){if(_0x1a5b91){return _0x1a5b91[_0xa07a('0x22')](_0x6884e7)[_0xa07a('0x10')](function(_0x179451){return _0x179451;});}return null;};}function removeEntity(_0x182247){return function(_0x165ac3){if(_0x165ac3){return _0x165ac3['destroy']()[_0xa07a('0x10')](function(){_0x182247[_0xa07a('0x1a')](0xcc)[_0xa07a('0x23')]();});}};}function handleEntityNotFound(_0x195157){return function(_0x30f7a2){if(!_0x30f7a2){_0x195157[_0xa07a('0x24')](0x194);}return _0x30f7a2;};}function handleError(_0x26f4eb,_0x572163){_0x572163=_0x572163||0x1f4;return function(_0x2fca1d){logger[_0xa07a('0x16')](_0x2fca1d[_0xa07a('0x25')]);if(_0x2fca1d[_0xa07a('0x26')]){delete _0x2fca1d[_0xa07a('0x26')];}_0x26f4eb[_0xa07a('0x1a')](_0x572163)[_0xa07a('0x27')](_0x2fca1d);};}exports[_0xa07a('0x28')]=function(_0x3fa8a4,_0x3e82f6){var _0xcde34b={},_0x4ed5aa={},_0x3f617a={'count':0x0,'rows':[]};var _0x22fa34=_[_0xa07a('0x29')](db['MailMessage'][_0xa07a('0x2a')],function(_0x1e0a72){return{'name':_0x1e0a72[_0xa07a('0x2b')],'type':_0x1e0a72[_0xa07a('0x2c')][_0xa07a('0x2d')]};});_0x4ed5aa[_0xa07a('0x2e')]=_[_0xa07a('0x29')](_0x22fa34,_0xa07a('0x26'));_0x4ed5aa[_0xa07a('0x2f')]=_[_0xa07a('0x30')](_0x3fa8a4['query']);_0x4ed5aa[_0xa07a('0x31')]=_[_0xa07a('0x32')](_0x4ed5aa[_0xa07a('0x2e')],_0x4ed5aa[_0xa07a('0x2f')]);_0xcde34b[_0xa07a('0x33')]=_[_0xa07a('0x32')](_0x4ed5aa[_0xa07a('0x2e')],qs[_0xa07a('0x34')](_0x3fa8a4[_0xa07a('0x2f')][_0xa07a('0x34')]));_0xcde34b['attributes']=_0xcde34b['attributes'][_0xa07a('0x35')]?_0xcde34b[_0xa07a('0x33')]:_0x4ed5aa[_0xa07a('0x2e')];if(!_0x3fa8a4['query']['hasOwnProperty'](_0xa07a('0x36'))){_0xcde34b['limit']=qs[_0xa07a('0x1e')](_0x3fa8a4[_0xa07a('0x2f')][_0xa07a('0x1e')]);_0xcde34b[_0xa07a('0x1c')]=qs['offset'](_0x3fa8a4[_0xa07a('0x2f')][_0xa07a('0x1c')]);}_0xcde34b[_0xa07a('0x37')]=qs[_0xa07a('0x38')](_0x3fa8a4['query'][_0xa07a('0x38')]);_0xcde34b[_0xa07a('0x39')]=qs[_0xa07a('0x31')](_[_0xa07a('0x3a')](_0x3fa8a4[_0xa07a('0x2f')],_0x4ed5aa[_0xa07a('0x31')]),_0x22fa34);if(_0x3fa8a4[_0xa07a('0x2f')][_0xa07a('0x3b')]){_0xcde34b[_0xa07a('0x39')]=_[_0xa07a('0x3c')](_0xcde34b['where'],{'$or':_[_0xa07a('0x29')](_0x22fa34,function(_0x23e91b){if(_0x23e91b[_0xa07a('0x2c')]!==_0xa07a('0x3d')){var _0x3eb1ae={};_0x3eb1ae[_0x23e91b[_0xa07a('0x26')]]={'$like':'%'+_0x3fa8a4[_0xa07a('0x2f')]['filter']+'%'};return _0x3eb1ae;}})});}_0xcde34b=_[_0xa07a('0x3c')]({},_0xcde34b,_0x3fa8a4['options']);var _0x43af00={'where':_0xcde34b[_0xa07a('0x39')]};return db[_0xa07a('0x3e')][_0xa07a('0x1f')](_0x43af00)[_0xa07a('0x10')](function(_0x294186){_0x3f617a[_0xa07a('0x1f')]=_0x294186;if(_0x3fa8a4[_0xa07a('0x2f')]['includeAll']){_0xcde34b[_0xa07a('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0xa07a('0x40')](_0xcde34b);})[_0xa07a('0x10')](function(_0x594ca2){_0x3f617a[_0xa07a('0x41')]=_0x594ca2;return _0x3f617a;})[_0xa07a('0x10')](respondWithFilteredResult(_0x3e82f6,_0xcde34b))[_0xa07a('0x42')](handleError(_0x3e82f6,null));};exports['show']=function(_0x2e6732,_0x36cb8f){var _0xec16ca={'raw':!![],'where':{'id':_0x2e6732[_0xa07a('0x43')]['id']}},_0x390c7c={};_0x390c7c[_0xa07a('0x2e')]=_[_0xa07a('0x30')](db[_0xa07a('0x3e')][_0xa07a('0x2a')]);_0x390c7c[_0xa07a('0x2f')]=_[_0xa07a('0x30')](_0x2e6732[_0xa07a('0x2f')]);_0x390c7c[_0xa07a('0x31')]=_[_0xa07a('0x32')](_0x390c7c[_0xa07a('0x2e')],_0x390c7c[_0xa07a('0x2f')]);_0xec16ca[_0xa07a('0x33')]=_[_0xa07a('0x32')](_0x390c7c['model'],qs['fields'](_0x2e6732[_0xa07a('0x2f')][_0xa07a('0x34')]));_0xec16ca[_0xa07a('0x33')]=_0xec16ca[_0xa07a('0x33')]['length']?_0xec16ca[_0xa07a('0x33')]:_0x390c7c['model'];if(_0x2e6732['query']['includeAll']){_0xec16ca[_0xa07a('0x3f')]=[{'all':!![]}];}_0xec16ca=_[_0xa07a('0x3c')]({},_0xec16ca,_0x2e6732['options']);return db[_0xa07a('0x3e')][_0xa07a('0x44')](_0xec16ca)[_0xa07a('0x10')](handleEntityNotFound(_0x36cb8f,null))[_0xa07a('0x10')](respondWithResult(_0x36cb8f,null))[_0xa07a('0x42')](handleError(_0x36cb8f,null));};exports[_0xa07a('0x22')]=function(_0x1ec622,_0x2e185e){if(_0x1ec622[_0xa07a('0x45')]['id']){delete _0x1ec622['body']['id'];}return db[_0xa07a('0x3e')][_0xa07a('0x44')]({'where':{'id':_0x1ec622[_0xa07a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e185e,null))[_0xa07a('0x10')](saveUpdates(_0x1ec622[_0xa07a('0x45')],null))['then'](respondWithResult(_0x2e185e,null))[_0xa07a('0x42')](handleError(_0x2e185e,null));};exports[_0xa07a('0x46')]=function(_0xc08f2b,_0x212b5d){return db[_0xa07a('0x3e')]['find']({'where':{'id':_0xc08f2b[_0xa07a('0x43')]['id']}})['then'](handleEntityNotFound(_0x212b5d,null))[_0xa07a('0x10')](removeEntity(_0x212b5d,null))[_0xa07a('0x42')](handleError(_0x212b5d,null));};exports[_0xa07a('0x47')]=function(_0x54a4a7,_0x2f3166){return db['MailMessage']['describe']()[_0xa07a('0x10')](respondWithResult(_0x2f3166,null))[_0xa07a('0x42')](handleError(_0x2f3166,null));};exports['create']=function(_0x54b977,_0x34d752){return db['MailMessage'][_0xa07a('0x48')](_0x54b977[_0xa07a('0x45')])[_0xa07a('0x10')](function(_0x43f100){if(_0x43f100){if(_0x43f100['direction']===_0xa07a('0x49')&&!_0x43f100['secret']){var _0x90951e,_0x31d86b,_0x2c28d9;if(_0x54b977[_0xa07a('0x45')]['to']){_0x31d86b=_0x54b977[_0xa07a('0x45')]['to'][_0xa07a('0x4a')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x43f100['MailAccountId']},'include':[{'model':db[_0xa07a('0x4b')],'as':_0xa07a('0x4c'),'include':[{'model':db[_0xa07a('0x4d')],'as':'Contacts','where':{'email':_0x31d86b},'limit':0x1,'order':[[_0xa07a('0x4e'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xa07a('0x4f'),'raw':!![],'include':[{'model':db[_0xa07a('0x50')],'as':_0xa07a('0x50'),'raw':!![]}]}]})[_0xa07a('0x10')](function(_0x2822ff){_0x90951e=_0x2822ff;if(!_0x90951e||!_0x90951e['Smtp'])return;var _0x10cfbf=_0x90951e[_0xa07a('0x51')]();if(_0x54b977['body']['attachments']&&_0x54b977[_0xa07a('0x45')][_0xa07a('0x52')][_0xa07a('0x35')]){for(var _0x50a4b8=0x0;_0x50a4b8<_0x54b977[_0xa07a('0x45')]['attachments'][_0xa07a('0x35')];_0x50a4b8+=0x1){_0x54b977[_0xa07a('0x45')][_0xa07a('0x52')][_0x50a4b8]={'filename':_0x54b977[_0xa07a('0x45')][_0xa07a('0x52')][_0x50a4b8][_0xa07a('0x26')],'path':path[_0xa07a('0x53')](config[_0xa07a('0x54')],_0xa07a('0x55'),_0x54b977[_0xa07a('0x45')]['attachments'][_0x50a4b8]['basename'])};}}_0x2c28d9={'account':_0x10cfbf,'message':_0x54b977['body']};return;})[_0xa07a('0x10')](function(){if(_0x90951e['List']){if(_0x90951e[_0xa07a('0x4c')][_0xa07a('0x56')][_0xa07a('0x35')]){return _0x90951e[_0xa07a('0x4c')][_0xa07a('0x56')][0x0];}else{return db['CmContact'][_0xa07a('0x48')](_[_0xa07a('0x9')](_0x54b977[_0xa07a('0x45')],{'firstName':_0x54b977[_0xa07a('0x45')]['to'],'email':_0x54b977[_0xa07a('0x45')]['to'],'phone':_0x54b977[_0xa07a('0x45')]['to'],'ListId':_0x90951e[_0xa07a('0x57')]}));}}else{throw new Error(_0xa07a('0x58'));}})[_0xa07a('0x10')](function(){if(_0x2c28d9){return respondWithRpcPromise('SendMail',_0xa07a('0x59'),_0x2c28d9,client9003)['then'](function(_0x1850d5){return _0x43f100[_0xa07a('0x22')]({'read':!![],'messageId':_0x1850d5['messageId'],'sentAt':moment()[_0xa07a('0x5a')](_0xa07a('0x5b'))});})['catch'](function(_0x466259){logger[_0xa07a('0x16')]('%s',JSON[_0xa07a('0x15')](_0x466259));return _0x43f100;});}return _0x43f100;});}return _0x43f100;}})['then'](respondWithResult(_0x34d752,0xc9))[_0xa07a('0x42')](handleError(_0x34d752,null));};exports[_0xa07a('0x5c')]=function(_0x2aef0f,_0x3207a9){var _0x2eaec0={'agent':{},'channel':_0xa07a('0x5d')};if(_0x2aef0f[_0xa07a('0x45')]['id']){delete _0x2aef0f[_0xa07a('0x45')]['id'];}_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x5e')]=!![];_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x5f')]=moment()[_0xa07a('0x5a')](_0xa07a('0x5b'));_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x60')]=_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x60')]||_0x2aef0f[_0xa07a('0x61')]['id'];_0x2eaec0[_0xa07a('0x62')]['id']=_0x2aef0f['body'][_0xa07a('0x60')];return db[_0xa07a('0x3e')][_0xa07a('0x44')]({'where':{'id':_0x2aef0f['params']['id'],'UserId':null}})[_0xa07a('0x10')](handleEntityNotFound(_0x3207a9,null))[_0xa07a('0x10')](saveUpdates(_0x2aef0f[_0xa07a('0x45')],null))['then'](function(_0x349a45){if(_0x349a45){_0x2eaec0[_0xa07a('0x18')]=_0x349a45[_0xa07a('0x63')]({'plain':!![]});return db['MailInteraction'][_0xa07a('0x44')]({'where':{'id':_0x349a45['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3207a9,null))[_0xa07a('0x10')](function(_0x5e8a4e){if(_0x5e8a4e){return _0x5e8a4e['update']({'UserId':_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x60')],'read1stAt':_['isNil'](_0x5e8a4e[_0xa07a('0x64')])?moment()[_0xa07a('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa07a('0x10')](function(_0x33f15e){if(_0x33f15e){_0x2eaec0[_0xa07a('0x65')]=_0x33f15e['get']({'plain':!![]});interaction_log[_0xa07a('0x11')](_0xa07a('0x66'),_0x2aef0f[_0xa07a('0x61')]['id'],_0x2aef0f[_0xa07a('0x61')][_0xa07a('0x26')],_0x2aef0f[_0xa07a('0x61')]['role'],_0x2eaec0[_0xa07a('0x65')]['id'],_0x2aef0f['body']?JSON[_0xa07a('0x15')](_0x2aef0f[_0xa07a('0x45')]):_0xa07a('0x67'));return respondWithRpcPromise('AcceptMessage',_0xa07a('0x68'),_0x2eaec0);}return null;})['then'](function(_0x59f7cb){var _0x5898ce=_0xa07a('0x69')+_0x59f7cb[_0xa07a('0x18')]['ContactId'];return db[_0xa07a('0x6a')][_0xa07a('0x2f')](_0x5898ce,{'type':db[_0xa07a('0x6b')][_0xa07a('0x6c')]['SELECT'],'raw':!![]})[_0xa07a('0x10')](function(_0x1f8727){return _0x1f8727;});})[_0xa07a('0x10')](function(_0x90fd75){if(_0x90fd75){_0x2eaec0[_0xa07a('0x18')][_0xa07a('0x6d')]=_0x90fd75[0x0];if(!_0x2aef0f[_0xa07a('0x45')][_0xa07a('0x60')])return;return db[_0xa07a('0x6e')]['find']({'where':{'id':_0x2aef0f['body'][_0xa07a('0x60')],'role':_0xa07a('0x62')},'attributes':['id',_0xa07a('0x26'),'fullname','email',_0xa07a('0x6f')],'raw':!![]});}return null;})['then'](function(_0x324915){if(!_0x324915)return null;_0x2eaec0['message'][_0xa07a('0x62')]=_0x324915;return _0x2eaec0;})[_0xa07a('0x10')](function(_0x15d0d6){if(_0x15d0d6){if(_0x2aef0f['body'][_0xa07a('0x70')]){_0x2eaec0[_0xa07a('0x18')][_0xa07a('0x71')]=util['format'](_0xa07a('0x72'),_0x2aef0f[_0xa07a('0x61')][_0xa07a('0x26')]);_0x2eaec0[_0xa07a('0x18')][_0xa07a('0x73')]=_0x2eaec0['channel'];_0x2eaec0[_0xa07a('0x18')][_0xa07a('0x74')]=_0x2eaec0[_0xa07a('0x73')];_0x2eaec0[_0xa07a('0x18')]['event']=_0xa07a('0x5c');_0x2eaec0[_0xa07a('0x18')][_0xa07a('0x45')]=htmlToText['fromString'](_0x2eaec0[_0xa07a('0x18')]['body']);return respondWithRpcPromise(_0xa07a('0x75'),_0xa07a('0x75'),{'event':'acceptmessage','message':_0x2eaec0[_0xa07a('0x18')]},client9002)[_0xa07a('0x10')](function(){return _0x2eaec0;});}return _0x2eaec0;}return null;})[_0xa07a('0x10')](respondWithResult(_0x3207a9,null))[_0xa07a('0x42')](handleError(_0x3207a9,null));};exports['reject']=function(_0xd51bc2,_0x3d2658){var _0x1c4193={'agent':{},'channel':_0xa07a('0x5d')};if(_0xd51bc2[_0xa07a('0x45')]['id']){delete _0xd51bc2[_0xa07a('0x45')]['id'];}_0xd51bc2[_0xa07a('0x45')]['UserId']=_0xd51bc2[_0xa07a('0x45')][_0xa07a('0x60')]||_0xd51bc2[_0xa07a('0x61')]['id'];_0x1c4193[_0xa07a('0x62')]['id']=_0xd51bc2[_0xa07a('0x45')][_0xa07a('0x60')];return db[_0xa07a('0x3e')][_0xa07a('0x44')]({'where':{'id':_0xd51bc2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d2658,null))[_0xa07a('0x10')](function(_0x348b5c){if(_0x348b5c){_0x1c4193['message']=_0x348b5c[_0xa07a('0x63')]({'plain':!![]});return db['MailInteraction'][_0xa07a('0x44')]({'where':{'id':_0x348b5c[_0xa07a('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x3d2658,null))['then'](function(_0x5752e6){if(_0x5752e6){_0x1c4193[_0xa07a('0x65')]=_0x5752e6[_0xa07a('0x63')]({'plain':!![]});interaction_log[_0xa07a('0x11')](_0xa07a('0x77'),_0xd51bc2[_0xa07a('0x61')]['id'],_0xd51bc2['user']['name'],_0xd51bc2['user']['role'],_0x1c4193['interaction']['id'],_0xd51bc2[_0xa07a('0x45')]?JSON[_0xa07a('0x15')](_0xd51bc2[_0xa07a('0x45')]):_0xa07a('0x67'));return respondWithRpcPromise(_0xa07a('0x78'),_0xa07a('0x79'),_0x1c4193);}return null;})['then'](function(_0x2ec28d){var _0x2c7fe2=_0xa07a('0x69')+_0x2ec28d[_0xa07a('0x18')][_0xa07a('0x7a')];return db[_0xa07a('0x6a')][_0xa07a('0x2f')](_0x2c7fe2,{'type':db['Sequelize'][_0xa07a('0x6c')][_0xa07a('0x7b')],'raw':!![]})[_0xa07a('0x10')](function(_0x4a7f55){return _0x4a7f55;});})[_0xa07a('0x10')](function(_0x404160){if(_0x404160){_0x1c4193[_0xa07a('0x18')][_0xa07a('0x6d')]=_0x404160[0x0];if(!_0xd51bc2['body'][_0xa07a('0x60')])return;return db[_0xa07a('0x6e')][_0xa07a('0x44')]({'where':{'id':_0xd51bc2[_0xa07a('0x45')][_0xa07a('0x60')],'role':_0xa07a('0x62')},'attributes':['id',_0xa07a('0x26'),_0xa07a('0x7c'),_0xa07a('0x7d'),'internal'],'raw':!![]});}return null;})[_0xa07a('0x10')](function(_0x472bd6){if(!_0x472bd6)return null;_0x1c4193[_0xa07a('0x18')][_0xa07a('0x62')]=_0x472bd6;return _0x1c4193;})[_0xa07a('0x10')](function(_0x509c6b){if(_0x509c6b){_0x509c6b[_0xa07a('0x18')][_0xa07a('0x71')]=util[_0xa07a('0x5a')]('SIP/%s',_0xd51bc2['user'][_0xa07a('0x26')]);_0x509c6b[_0xa07a('0x18')][_0xa07a('0x73')]=_0x1c4193['channel'];_0x509c6b[_0xa07a('0x18')][_0xa07a('0x74')]=_0x1c4193[_0xa07a('0x73')];_0x509c6b['message'][_0xa07a('0x7e')]='reject';_0x509c6b[_0xa07a('0x18')][_0xa07a('0x45')]=htmlToText[_0xa07a('0x7f')](_0x1c4193[_0xa07a('0x18')][_0xa07a('0x45')]);respondWithRpcPromise(_0xa07a('0x75'),_0xa07a('0x75'),{'event':'rejectmessage','message':_0x509c6b[_0xa07a('0x18')]},client9002);return _0x1c4193;}return null;})['then'](respondWithResult(_0x3d2658,null))[_0xa07a('0x42')](handleError(_0x3d2658,null));};exports['download']=function(_0x2fe3cf,_0xaa0f81){var _0x415fbf=moment()[_0xa07a('0x80')]()[_0xa07a('0x81')]();var _0xf7de9b=path[_0xa07a('0x53')](config[_0xa07a('0x54')],_0xa07a('0x82'),'files',_0xa07a('0x83'));var _0xa6b69f=path[_0xa07a('0x53')](config[_0xa07a('0x54')],_0xa07a('0x82'),'files',_0xa07a('0x52'));var _0x45e4c8=util[_0xa07a('0x5a')](_0xa07a('0x84'),_0x415fbf);return db[_0xa07a('0x3e')][_0xa07a('0x44')]({'where':{'id':_0x2fe3cf[_0xa07a('0x43')]['id']},'attributes':['id','body',_0xa07a('0x85'),'to','cc',_0xa07a('0x86'),'subject',_0xa07a('0x87')],'include':_0x2fe3cf[_0xa07a('0x2f')]['attachments']?[{'model':db[_0xa07a('0x88')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0xaa0f81,null))['then'](function(_0x4c0eb0){if(_0x4c0eb0){var _0x296ad7=_0x4c0eb0;var _0x42afba={'from':_0x296ad7[_0xa07a('0x85')],'to':_0x296ad7['to'],'subject':_0x296ad7['subject'],'html':htmlEntities[_0xa07a('0x89')](_0x296ad7[_0xa07a('0x45')]),'headers':{'Date':moment(_0x296ad7[_0xa07a('0x87')])[_0xa07a('0x5a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4c0eb0['cc']){_0x42afba[_0xa07a('0x8a')]['Cc']=_0x4c0eb0['cc'];}if(_0x4c0eb0[_0xa07a('0x86')]){_0x42afba[_0xa07a('0x8a')][_0xa07a('0x8b')]=_0x4c0eb0[_0xa07a('0x86')];}return new BPromise(function(_0x30046d,_0x588565){if(_0x4c0eb0['Attachments']){for(var _0x5edf55=0x0;_0x5edf55<_0x4c0eb0[_0xa07a('0x8c')]['length'];_0x5edf55++){var _0x2d5fb2=_0x4c0eb0[_0xa07a('0x8c')][_0x5edf55];var _0x3fe6b2=path[_0xa07a('0x53')](_0xa6b69f,_0x2d5fb2[_0xa07a('0x8d')]);if(fs['existsSync'](_0x3fe6b2)){_0x42afba[_0xa07a('0x52')][_0xa07a('0x8e')]({'name':_0x2d5fb2['name'],'contentType':_0x2d5fb2[_0xa07a('0x2c')],'data':fs[_0xa07a('0x8f')](_0x3fe6b2)});}}}emlformat[_0xa07a('0x90')](_0x42afba,function(_0x487ef6,_0x5b9478){if(_0x487ef6)return _0x588565(_0x487ef6);fs['writeFileSync'](path[_0xa07a('0x53')](_0xf7de9b,_0x45e4c8),_0x5b9478);return _0x30046d(_0x5b9478);});});}})[_0xa07a('0x10')](function(_0x4a75f7){if(_0x4a75f7){return _0xaa0f81[_0xa07a('0x91')](path[_0xa07a('0x53')](_0xf7de9b,_0x45e4c8),_0x45e4c8,function(_0x3eb4d4){if(!_0x3eb4d4)fs[_0xa07a('0x92')](path[_0xa07a('0x53')](_0xf7de9b,_0x45e4c8));});}})[_0xa07a('0x42')](handleError(_0xaa0f81,null));};
\ No newline at end of file
+var _0xb031=['messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','get','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','agent','MailInteractionId','RejectMessage','SELECT','internal','reject','fromString','unix','toString','server','files','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','download','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','sendStatus','name','index','map','MailMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','merge','find','body','describe','create','direction','out','secret','split','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','ListId','List\x20not\x20found'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xb031,0x165));var _0x1b03=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xb031[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require(_0x1b03('0x0'));var moment=require(_0x1b03('0x1'));var BPromise=require(_0x1b03('0x2'));var util=require(_0x1b03('0x3'));var path=require(_0x1b03('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1b03('0x5'));var htmlToText=require(_0x1b03('0x6'));var qs=require(_0x1b03('0x7'));var logger=require(_0x1b03('0x8'))(_0x1b03('0x9'));var interaction_log=require(_0x1b03('0x8'))(_0x1b03('0xa'));var config=require(_0x1b03('0xb'));var db=require('../../mysqldb')['db'];config[_0x1b03('0xc')]=_['defaults'](config[_0x1b03('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b03('0xd'))(new Redis(config[_0x1b03('0xc')]));var htmlEntities=require(_0x1b03('0xe'));require(_0x1b03('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1b03('0x10')][_0x1b03('0x11')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x1b03('0x10')][_0x1b03('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x3eea08,_0x57791b,_0x3140f2,_0x5c7ea0){return new BPromise(function(_0x2bd5a0,_0x3d321a){var _0x14414a=_0x5c7ea0||client;return _0x14414a[_0x1b03('0x12')](_0x3eea08,_0x3140f2)[_0x1b03('0x13')](function(_0x150bc7){logger[_0x1b03('0x14')](_0x1b03('0x15'),_0x57791b,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x57791b,_0x1b03('0x16'),JSON['stringify'](_0x150bc7));if(_0x150bc7[_0x1b03('0x17')]){if(_0x150bc7[_0x1b03('0x17')][_0x1b03('0x18')]===0x1f4){logger[_0x1b03('0x17')]('MailMessage,\x20%s,\x20%s',_0x57791b,_0x150bc7[_0x1b03('0x17')][_0x1b03('0x19')]);return _0x3d321a(_0x150bc7[_0x1b03('0x17')]['message']);}logger[_0x1b03('0x17')](_0x1b03('0x15'),_0x57791b,_0x150bc7[_0x1b03('0x17')][_0x1b03('0x19')]);return _0x2bd5a0(_0x150bc7[_0x1b03('0x17')][_0x1b03('0x19')]);}else{logger[_0x1b03('0x14')](_0x1b03('0x15'),_0x57791b,_0x1b03('0x16'));_0x2bd5a0(_0x150bc7[_0x1b03('0x1a')][_0x1b03('0x19')]);}})[_0x1b03('0x1b')](function(_0xd42599){logger[_0x1b03('0x17')](_0x1b03('0x15'),_0x57791b,_0xd42599);_0x3d321a(_0xd42599);});});}function respondWithResult(_0x19fa3d,_0x453edd){_0x453edd=_0x453edd||0xc8;return function(_0x38fac3){if(_0x38fac3){return _0x19fa3d[_0x1b03('0x1c')](_0x453edd)[_0x1b03('0x1d')](_0x38fac3);}};}function respondWithFilteredResult(_0x155601,_0x2cae77){return function(_0x494985){if(_0x494985){var _0x3a2c8b=typeof _0x2cae77['offset']==='undefined'&&typeof _0x2cae77[_0x1b03('0x1e')]===_0x1b03('0x1f');var _0x3d0d34=_0x494985[_0x1b03('0x20')];var _0x257884=_0x3a2c8b?0x0:_0x2cae77[_0x1b03('0x21')];var _0x50b74a=_0x3a2c8b?_0x494985[_0x1b03('0x20')]:_0x2cae77[_0x1b03('0x21')]+_0x2cae77[_0x1b03('0x1e')];var _0x8d7142;if(_0x50b74a>=_0x3d0d34){_0x50b74a=_0x3d0d34;_0x8d7142=0xc8;}else{_0x8d7142=0xce;}_0x155601['status'](_0x8d7142);return _0x155601[_0x1b03('0x22')](_0x1b03('0x23'),_0x257884+'-'+_0x50b74a+'/'+_0x3d0d34)[_0x1b03('0x1d')](_0x494985);}return null;};}function saveUpdates(_0x28b1e8){return function(_0x33e6ce){if(_0x33e6ce){return _0x33e6ce[_0x1b03('0x24')](_0x28b1e8)[_0x1b03('0x13')](function(_0x4c3497){return _0x4c3497;});}return null;};}function removeEntity(_0x554fd3){return function(_0x130a59){if(_0x130a59){return _0x130a59[_0x1b03('0x25')]()[_0x1b03('0x13')](function(){_0x554fd3[_0x1b03('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59cab2){return function(_0x1060e8){if(!_0x1060e8){_0x59cab2[_0x1b03('0x26')](0x194);}return _0x1060e8;};}function handleError(_0xe044e6,_0x177e28){_0x177e28=_0x177e28||0x1f4;return function(_0x12130c){logger[_0x1b03('0x17')](_0x12130c['stack']);if(_0x12130c[_0x1b03('0x27')]){delete _0x12130c[_0x1b03('0x27')];}_0xe044e6[_0x1b03('0x1c')](_0x177e28)['send'](_0x12130c);};}exports[_0x1b03('0x28')]=function(_0x1cf2f2,_0xcf774e){var _0x17b497={},_0x3cac4a={},_0x25cde6={'count':0x0,'rows':[]};var _0x3d314b=_[_0x1b03('0x29')](db[_0x1b03('0x2a')][_0x1b03('0x2b')],function(_0x5cb9ee){return{'name':_0x5cb9ee['fieldName'],'type':_0x5cb9ee[_0x1b03('0x2c')][_0x1b03('0x2d')]};});_0x3cac4a[_0x1b03('0x2e')]=_[_0x1b03('0x29')](_0x3d314b,_0x1b03('0x27'));_0x3cac4a[_0x1b03('0x2f')]=_[_0x1b03('0x30')](_0x1cf2f2[_0x1b03('0x2f')]);_0x3cac4a['filters']=_[_0x1b03('0x31')](_0x3cac4a['model'],_0x3cac4a['query']);_0x17b497['attributes']=_[_0x1b03('0x31')](_0x3cac4a[_0x1b03('0x2e')],qs[_0x1b03('0x32')](_0x1cf2f2[_0x1b03('0x2f')][_0x1b03('0x32')]));_0x17b497[_0x1b03('0x33')]=_0x17b497['attributes'][_0x1b03('0x34')]?_0x17b497[_0x1b03('0x33')]:_0x3cac4a[_0x1b03('0x2e')];if(!_0x1cf2f2['query'][_0x1b03('0x35')]('nolimit')){_0x17b497[_0x1b03('0x1e')]=qs[_0x1b03('0x1e')](_0x1cf2f2['query']['limit']);_0x17b497[_0x1b03('0x21')]=qs[_0x1b03('0x21')](_0x1cf2f2[_0x1b03('0x2f')][_0x1b03('0x21')]);}_0x17b497[_0x1b03('0x36')]=qs['sort'](_0x1cf2f2['query'][_0x1b03('0x37')]);_0x17b497['where']=qs[_0x1b03('0x38')](_[_0x1b03('0x39')](_0x1cf2f2[_0x1b03('0x2f')],_0x3cac4a[_0x1b03('0x38')]),_0x3d314b);if(_0x1cf2f2[_0x1b03('0x2f')]['filter']){_0x17b497['where']=_['merge'](_0x17b497[_0x1b03('0x3a')],{'$or':_[_0x1b03('0x29')](_0x3d314b,function(_0x59f1fe){if(_0x59f1fe[_0x1b03('0x2c')]!==_0x1b03('0x3b')){var _0x317cd2={};_0x317cd2[_0x59f1fe[_0x1b03('0x27')]]={'$like':'%'+_0x1cf2f2[_0x1b03('0x2f')][_0x1b03('0x3c')]+'%'};return _0x317cd2;}})});}_0x17b497=_['merge']({},_0x17b497,_0x1cf2f2[_0x1b03('0x3d')]);var _0x1138b3={'where':_0x17b497[_0x1b03('0x3a')]};return db['MailMessage'][_0x1b03('0x20')](_0x1138b3)[_0x1b03('0x13')](function(_0xf977){_0x25cde6[_0x1b03('0x20')]=_0xf977;if(_0x1cf2f2[_0x1b03('0x2f')][_0x1b03('0x3e')]){_0x17b497['include']=[{'all':!![]}];}return db[_0x1b03('0x2a')][_0x1b03('0x3f')](_0x17b497);})['then'](function(_0x554529){_0x25cde6[_0x1b03('0x40')]=_0x554529;return _0x25cde6;})[_0x1b03('0x13')](respondWithFilteredResult(_0xcf774e,_0x17b497))['catch'](handleError(_0xcf774e,null));};exports[_0x1b03('0x41')]=function(_0x1e0c30,_0x40ba09){var _0xd370a8={'raw':!![],'where':{'id':_0x1e0c30[_0x1b03('0x42')]['id']}},_0x2ebfe9={};_0x2ebfe9['model']=_['keys'](db['MailMessage'][_0x1b03('0x2b')]);_0x2ebfe9[_0x1b03('0x2f')]=_[_0x1b03('0x30')](_0x1e0c30[_0x1b03('0x2f')]);_0x2ebfe9[_0x1b03('0x38')]=_[_0x1b03('0x31')](_0x2ebfe9[_0x1b03('0x2e')],_0x2ebfe9[_0x1b03('0x2f')]);_0xd370a8[_0x1b03('0x33')]=_[_0x1b03('0x31')](_0x2ebfe9[_0x1b03('0x2e')],qs['fields'](_0x1e0c30[_0x1b03('0x2f')][_0x1b03('0x32')]));_0xd370a8[_0x1b03('0x33')]=_0xd370a8[_0x1b03('0x33')]['length']?_0xd370a8[_0x1b03('0x33')]:_0x2ebfe9[_0x1b03('0x2e')];if(_0x1e0c30[_0x1b03('0x2f')][_0x1b03('0x3e')]){_0xd370a8[_0x1b03('0x43')]=[{'all':!![]}];}_0xd370a8=_[_0x1b03('0x44')]({},_0xd370a8,_0x1e0c30[_0x1b03('0x3d')]);return db[_0x1b03('0x2a')][_0x1b03('0x45')](_0xd370a8)['then'](handleEntityNotFound(_0x40ba09,null))['then'](respondWithResult(_0x40ba09,null))['catch'](handleError(_0x40ba09,null));};exports[_0x1b03('0x24')]=function(_0x34fab9,_0x526c24){if(_0x34fab9['body']['id']){delete _0x34fab9[_0x1b03('0x46')]['id'];}return db['MailMessage'][_0x1b03('0x45')]({'where':{'id':_0x34fab9[_0x1b03('0x42')]['id']}})[_0x1b03('0x13')](handleEntityNotFound(_0x526c24,null))['then'](saveUpdates(_0x34fab9[_0x1b03('0x46')],null))[_0x1b03('0x13')](respondWithResult(_0x526c24,null))[_0x1b03('0x1b')](handleError(_0x526c24,null));};exports[_0x1b03('0x25')]=function(_0x1aa77f,_0x273d6a){return db[_0x1b03('0x2a')][_0x1b03('0x45')]({'where':{'id':_0x1aa77f[_0x1b03('0x42')]['id']}})['then'](handleEntityNotFound(_0x273d6a,null))[_0x1b03('0x13')](removeEntity(_0x273d6a,null))[_0x1b03('0x1b')](handleError(_0x273d6a,null));};exports[_0x1b03('0x47')]=function(_0x528465,_0x51a0bd){return db[_0x1b03('0x2a')]['describe']()[_0x1b03('0x13')](respondWithResult(_0x51a0bd,null))[_0x1b03('0x1b')](handleError(_0x51a0bd,null));};exports[_0x1b03('0x48')]=function(_0x170c29,_0x5b81cd){return db[_0x1b03('0x2a')][_0x1b03('0x48')](_0x170c29[_0x1b03('0x46')])[_0x1b03('0x13')](function(_0x4922f0){if(_0x4922f0){if(_0x4922f0[_0x1b03('0x49')]===_0x1b03('0x4a')&&!_0x4922f0[_0x1b03('0x4b')]){var _0x31b87b,_0xc9e886,_0x34fd19;if(_0x170c29[_0x1b03('0x46')]['to']){_0xc9e886=_0x170c29[_0x1b03('0x46')]['to'][_0x1b03('0x4c')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x4922f0[_0x1b03('0x4d')]},'include':[{'model':db['CmList'],'as':_0x1b03('0x4e'),'include':[{'model':db[_0x1b03('0x4f')],'as':_0x1b03('0x50'),'where':{'email':_0xc9e886},'limit':0x1,'order':[[_0x1b03('0x51'),_0x1b03('0x52')]]}]},{'model':db[_0x1b03('0x53')],'as':_0x1b03('0x54'),'raw':!![],'include':[{'model':db[_0x1b03('0x55')],'as':_0x1b03('0x55'),'raw':!![]}]}]})['then'](function(_0x5d3b9e){_0x31b87b=_0x5d3b9e;if(!_0x31b87b||!_0x31b87b[_0x1b03('0x54')])return;var _0x35ca3a=_0x31b87b[_0x1b03('0x56')]();if(_0x170c29[_0x1b03('0x46')]['attachments']&&_0x170c29['body'][_0x1b03('0x57')][_0x1b03('0x34')]){for(var _0x1a0e56=0x0;_0x1a0e56<_0x170c29['body'][_0x1b03('0x57')]['length'];_0x1a0e56+=0x1){_0x170c29[_0x1b03('0x46')][_0x1b03('0x57')][_0x1a0e56]={'filename':_0x170c29['body'][_0x1b03('0x57')][_0x1a0e56]['name'],'path':path[_0x1b03('0x58')](config[_0x1b03('0x59')],'server/files/attachments',_0x170c29[_0x1b03('0x46')]['attachments'][_0x1a0e56][_0x1b03('0x5a')])};}}_0x34fd19={'account':_0x35ca3a,'message':_0x170c29[_0x1b03('0x46')]};return;})['then'](function(){if(_0x31b87b[_0x1b03('0x4e')]){if(_0x31b87b[_0x1b03('0x4e')]['Contacts'][_0x1b03('0x34')]){return _0x31b87b[_0x1b03('0x4e')][_0x1b03('0x50')][0x0];}else{return db[_0x1b03('0x4f')][_0x1b03('0x48')](_['defaults'](_0x170c29[_0x1b03('0x46')],{'firstName':_0x170c29[_0x1b03('0x46')]['to'],'email':_0x170c29[_0x1b03('0x46')]['to'],'phone':_0x170c29[_0x1b03('0x46')]['to'],'ListId':_0x31b87b[_0x1b03('0x5b')]}));}}else{throw new Error(_0x1b03('0x5c'));}})[_0x1b03('0x13')](function(){if(_0x34fd19){return respondWithRpcPromise('SendMail','sendMail',_0x34fd19,client9003)[_0x1b03('0x13')](function(_0x117b41){return _0x4922f0['update']({'read':!![],'messageId':_0x117b41[_0x1b03('0x5d')],'sentAt':moment()[_0x1b03('0x5e')](_0x1b03('0x5f'))});})['catch'](function(_0x24e7a0){logger['error']('%s',JSON[_0x1b03('0x60')](_0x24e7a0));return _0x4922f0;});}return _0x4922f0;});}return _0x4922f0;}})[_0x1b03('0x13')](respondWithResult(_0x5b81cd,0xc9))['catch'](handleError(_0x5b81cd,null));};exports[_0x1b03('0x61')]=function(_0x487d26,_0x53e755){var _0x4cffbb={'agent':{},'channel':_0x1b03('0x62')};if(_0x487d26[_0x1b03('0x46')]['id']){delete _0x487d26[_0x1b03('0x46')]['id'];}_0x487d26[_0x1b03('0x46')][_0x1b03('0x63')]=!![];_0x487d26[_0x1b03('0x46')][_0x1b03('0x64')]=moment()['format'](_0x1b03('0x5f'));_0x487d26[_0x1b03('0x46')]['UserId']=_0x487d26[_0x1b03('0x46')][_0x1b03('0x65')]||_0x487d26[_0x1b03('0x66')]['id'];_0x4cffbb['agent']['id']=_0x487d26['body']['UserId'];return db[_0x1b03('0x2a')][_0x1b03('0x45')]({'where':{'id':_0x487d26[_0x1b03('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53e755,null))[_0x1b03('0x13')](saveUpdates(_0x487d26[_0x1b03('0x46')],null))[_0x1b03('0x13')](function(_0x4c2157){if(_0x4c2157){_0x4cffbb[_0x1b03('0x19')]=_0x4c2157[_0x1b03('0x67')]({'plain':!![]});return db['MailInteraction'][_0x1b03('0x45')]({'where':{'id':_0x4c2157['MailInteractionId']}});}return null;})[_0x1b03('0x13')](handleEntityNotFound(_0x53e755,null))['then'](function(_0x15d650){if(_0x15d650){return _0x15d650[_0x1b03('0x24')]({'UserId':_0x487d26[_0x1b03('0x46')][_0x1b03('0x65')],'read1stAt':_[_0x1b03('0x68')](_0x15d650[_0x1b03('0x69')])?moment()[_0x1b03('0x5e')](_0x1b03('0x5f')):undefined});}return null;})[_0x1b03('0x13')](function(_0x178ea0){if(_0x178ea0){_0x4cffbb[_0x1b03('0x6a')]=_0x178ea0[_0x1b03('0x67')]({'plain':!![]});interaction_log[_0x1b03('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x487d26[_0x1b03('0x66')]['id'],_0x487d26[_0x1b03('0x66')]['name'],_0x487d26['user'][_0x1b03('0x6b')],_0x4cffbb[_0x1b03('0x6a')]['id'],_0x487d26[_0x1b03('0x46')]?JSON[_0x1b03('0x60')](_0x487d26['body']):_0x1b03('0x6c'));return respondWithRpcPromise(_0x1b03('0x6d'),_0x1b03('0x6e'),_0x4cffbb);}return null;})['then'](function(_0x2d0618){var _0x139f77=_0x1b03('0x6f')+_0x2d0618['message'][_0x1b03('0x70')];return db[_0x1b03('0x71')][_0x1b03('0x2f')](_0x139f77,{'type':db[_0x1b03('0x72')][_0x1b03('0x73')]['SELECT'],'raw':!![]})[_0x1b03('0x13')](function(_0x1b203a){return _0x1b203a;});})[_0x1b03('0x13')](function(_0x2af14e){if(_0x2af14e){_0x4cffbb['message'][_0x1b03('0x74')]=_0x2af14e[0x0];if(!_0x487d26[_0x1b03('0x46')]['UserId'])return;return db[_0x1b03('0x75')][_0x1b03('0x45')]({'where':{'id':_0x487d26[_0x1b03('0x46')]['UserId'],'role':'agent'},'attributes':['id',_0x1b03('0x27'),_0x1b03('0x76'),_0x1b03('0x77'),'internal'],'raw':!![]});}return null;})[_0x1b03('0x13')](function(_0x1301d7){if(!_0x1301d7)return null;_0x4cffbb[_0x1b03('0x19')]['agent']=_0x1301d7;return _0x4cffbb;})[_0x1b03('0x13')](function(_0x569bf9){if(_0x569bf9){if(_0x487d26['body']['manual']){_0x4cffbb[_0x1b03('0x19')][_0x1b03('0x78')]=util['format'](_0x1b03('0x79'),_0x487d26['user'][_0x1b03('0x27')]);_0x4cffbb[_0x1b03('0x19')][_0x1b03('0x7a')]=_0x4cffbb[_0x1b03('0x7a')];_0x4cffbb[_0x1b03('0x19')][_0x1b03('0x7b')]=_0x4cffbb[_0x1b03('0x7a')];_0x4cffbb['message']['event']='accept';_0x4cffbb[_0x1b03('0x19')][_0x1b03('0x46')]=htmlToText['fromString'](_0x4cffbb[_0x1b03('0x19')][_0x1b03('0x46')]);return respondWithRpcPromise(_0x1b03('0x7c'),_0x1b03('0x7c'),{'event':'acceptmessage','message':_0x4cffbb['message']},client9002)['then'](function(){return _0x4cffbb;});}return _0x4cffbb;}return null;})[_0x1b03('0x13')](respondWithResult(_0x53e755,null))['catch'](handleError(_0x53e755,null));};exports['reject']=function(_0x30bd45,_0x4c5a43){var _0x2fdfb2={'agent':{},'channel':_0x1b03('0x62')};if(_0x30bd45['body']['id']){delete _0x30bd45[_0x1b03('0x46')]['id'];}_0x30bd45['body']['UserId']=_0x30bd45[_0x1b03('0x46')][_0x1b03('0x65')]||_0x30bd45[_0x1b03('0x66')]['id'];_0x2fdfb2[_0x1b03('0x7d')]['id']=_0x30bd45[_0x1b03('0x46')][_0x1b03('0x65')];return db['MailMessage'][_0x1b03('0x45')]({'where':{'id':_0x30bd45['params']['id'],'UserId':null}})[_0x1b03('0x13')](handleEntityNotFound(_0x4c5a43,null))[_0x1b03('0x13')](function(_0x28fc05){if(_0x28fc05){_0x2fdfb2['message']=_0x28fc05['get']({'plain':!![]});return db['MailInteraction'][_0x1b03('0x45')]({'where':{'id':_0x28fc05[_0x1b03('0x7e')]}});}return null;})[_0x1b03('0x13')](handleEntityNotFound(_0x4c5a43,null))[_0x1b03('0x13')](function(_0x297ca5){if(_0x297ca5){_0x2fdfb2['interaction']=_0x297ca5[_0x1b03('0x67')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30bd45[_0x1b03('0x66')]['id'],_0x30bd45[_0x1b03('0x66')][_0x1b03('0x27')],_0x30bd45[_0x1b03('0x66')][_0x1b03('0x6b')],_0x2fdfb2[_0x1b03('0x6a')]['id'],_0x30bd45['body']?JSON[_0x1b03('0x60')](_0x30bd45['body']):_0x1b03('0x6c'));return respondWithRpcPromise(_0x1b03('0x7f'),'rejectMessage',_0x2fdfb2);}return null;})['then'](function(_0x6cc036){var _0x120557=_0x1b03('0x6f')+_0x6cc036[_0x1b03('0x19')][_0x1b03('0x70')];return db[_0x1b03('0x71')][_0x1b03('0x2f')](_0x120557,{'type':db[_0x1b03('0x72')][_0x1b03('0x73')][_0x1b03('0x80')],'raw':!![]})[_0x1b03('0x13')](function(_0x4efa5d){return _0x4efa5d;});})['then'](function(_0x390a26){if(_0x390a26){_0x2fdfb2[_0x1b03('0x19')][_0x1b03('0x74')]=_0x390a26[0x0];if(!_0x30bd45[_0x1b03('0x46')][_0x1b03('0x65')])return;return db['User'][_0x1b03('0x45')]({'where':{'id':_0x30bd45['body'][_0x1b03('0x65')],'role':_0x1b03('0x7d')},'attributes':['id',_0x1b03('0x27'),_0x1b03('0x76'),_0x1b03('0x77'),_0x1b03('0x81')],'raw':!![]});}return null;})[_0x1b03('0x13')](function(_0x41f6d6){if(!_0x41f6d6)return null;_0x2fdfb2[_0x1b03('0x19')][_0x1b03('0x7d')]=_0x41f6d6;return _0x2fdfb2;})[_0x1b03('0x13')](function(_0xbc36fe){if(_0xbc36fe){_0xbc36fe['message'][_0x1b03('0x78')]=util[_0x1b03('0x5e')](_0x1b03('0x79'),_0x30bd45[_0x1b03('0x66')][_0x1b03('0x27')]);_0xbc36fe[_0x1b03('0x19')]['channel']=_0x2fdfb2[_0x1b03('0x7a')];_0xbc36fe[_0x1b03('0x19')][_0x1b03('0x7b')]=_0x2fdfb2[_0x1b03('0x7a')];_0xbc36fe['message']['event']=_0x1b03('0x82');_0xbc36fe[_0x1b03('0x19')][_0x1b03('0x46')]=htmlToText[_0x1b03('0x83')](_0x2fdfb2['message'][_0x1b03('0x46')]);respondWithRpcPromise(_0x1b03('0x7c'),_0x1b03('0x7c'),{'event':'rejectmessage','message':_0xbc36fe[_0x1b03('0x19')]},client9002);return _0x2fdfb2;}return null;})['then'](respondWithResult(_0x4c5a43,null))['catch'](handleError(_0x4c5a43,null));};exports['download']=function(_0x35cd2b,_0x20811d){var _0x48921a=moment()[_0x1b03('0x84')]()[_0x1b03('0x85')]();var _0x4f52fb=path[_0x1b03('0x58')](config['root'],_0x1b03('0x86'),'files','tmp');var _0x45831a=path[_0x1b03('0x58')](config[_0x1b03('0x59')],_0x1b03('0x86'),_0x1b03('0x87'),_0x1b03('0x57'));var _0xf36421=util[_0x1b03('0x5e')]('message-%s.eml',_0x48921a);return db[_0x1b03('0x2a')]['find']({'where':{'id':_0x35cd2b[_0x1b03('0x42')]['id']},'attributes':['id','body',_0x1b03('0x88'),'to','cc',_0x1b03('0x89'),_0x1b03('0x8a'),_0x1b03('0x8b')],'include':_0x35cd2b[_0x1b03('0x2f')][_0x1b03('0x57')]?[{'model':db[_0x1b03('0x8c')],'as':_0x1b03('0x8d')}]:undefined})['then'](handleEntityNotFound(_0x20811d,null))[_0x1b03('0x13')](function(_0x415de3){if(_0x415de3){var _0x5d0a0b=_0x415de3;var _0xdf8928={'from':_0x5d0a0b[_0x1b03('0x88')],'to':_0x5d0a0b['to'],'subject':_0x5d0a0b[_0x1b03('0x8a')],'html':htmlEntities[_0x1b03('0x8e')](_0x5d0a0b[_0x1b03('0x46')]),'headers':{'Date':moment(_0x5d0a0b[_0x1b03('0x8b')])['format'](_0x1b03('0x8f'))},'attachments':[]};if(_0x415de3['cc']){_0xdf8928[_0x1b03('0x90')]['Cc']=_0x415de3['cc'];}if(_0x415de3[_0x1b03('0x89')]){_0xdf8928[_0x1b03('0x90')]['Bcc']=_0x415de3[_0x1b03('0x89')];}return new BPromise(function(_0x2b82ba,_0x6b2602){if(_0x415de3[_0x1b03('0x8d')]){for(var _0x23c1ed=0x0;_0x23c1ed<_0x415de3['Attachments'][_0x1b03('0x34')];_0x23c1ed++){var _0x30f8e4=_0x415de3[_0x1b03('0x8d')][_0x23c1ed];var _0x419cf1=path[_0x1b03('0x58')](_0x45831a,_0x30f8e4[_0x1b03('0x5a')]);if(fs[_0x1b03('0x91')](_0x419cf1)){_0xdf8928[_0x1b03('0x57')]['push']({'name':_0x30f8e4['name'],'contentType':_0x30f8e4[_0x1b03('0x2c')],'data':fs[_0x1b03('0x92')](_0x419cf1)});}}}emlformat[_0x1b03('0x93')](_0xdf8928,function(_0xf062a5,_0x25a470){if(_0xf062a5)return _0x6b2602(_0xf062a5);fs['writeFileSync'](path[_0x1b03('0x58')](_0x4f52fb,_0xf36421),_0x25a470);return _0x2b82ba(_0x25a470);});});}})['then'](function(_0xa245e9){if(_0xa245e9){return _0x20811d[_0x1b03('0x94')](path['join'](_0x4f52fb,_0xf36421),_0xf36421,function(_0x2125ef){if(!_0x2125ef)fs[_0x1b03('0x95')](path['join'](_0x4f52fb,_0xf36421));});}})[_0x1b03('0x1b')](handleError(_0x20811d,null));};
\ No newline at end of file
index 9c4c6db..c015d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b9d=['MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x2b9d,0x1cf));var _0xd2b9=function(_0x320043,_0x14c0ff){_0x320043=_0x320043-0x0;var _0x559fee=_0x2b9d[_0x320043];return _0x559fee;};'use strict';var EventEmitter=require(_0xd2b9('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xd2b9('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd2b9('0x2')](0x0);var events={'afterCreate':_0xd2b9('0x3'),'afterUpdate':_0xd2b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x39d275){return function(_0x26ea93,_0x314baa,_0x2977f7){MailMessageEvents[_0xd2b9('0x5')](_0x39d275+':'+_0x26ea93['id'],_0x26ea93);MailMessageEvents[_0xd2b9('0x5')](_0x39d275,_0x26ea93);_0x2977f7(null);};}for(var e in events){if(events[_0xd2b9('0x6')](e)){var event=events[e];MailMessage[_0xd2b9('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x9fdc=['emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x2d0ff5,_0x3a23e7){var _0x536732=function(_0x3ff3d1){while(--_0x3ff3d1){_0x2d0ff5['push'](_0x2d0ff5['shift']());}};_0x536732(++_0x3a23e7);}(_0x9fdc,0x11b));var _0xc9fd=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x9fdc[_0x531d15];return _0x271a18;};'use strict';var EventEmitter=require(_0xc9fd('0x0'));var MailMessage=require(_0xc9fd('0x1'))['db'][_0xc9fd('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc9fd('0x3')](0x0);var events={'afterCreate':_0xc9fd('0x4'),'afterUpdate':_0xc9fd('0x5'),'afterDestroy':_0xc9fd('0x6')};function emitEvent(_0x4ef828){return function(_0x1c3b8c,_0x374610,_0x2eb58e){MailMessageEvents[_0xc9fd('0x7')](_0x4ef828+':'+_0x1c3b8c['id'],_0x1c3b8c);MailMessageEvents[_0xc9fd('0x7')](_0x4ef828,_0x1c3b8c);_0x2eb58e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xc9fd('0x8')](e,emitEvent(event));}}module[_0xc9fd('0x9')]=MailMessageEvents;
\ No newline at end of file
index b9ff581..050e876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7741=['models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body'];(function(_0x54fdd8,_0x2e81ae){var _0x4f6f8a=function(_0x2a970c){while(--_0x2a970c){_0x54fdd8['push'](_0x54fdd8['shift']());}};_0x4f6f8a(++_0x2e81ae);}(_0x7741,0x154));var _0x1774=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x7741[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require(_0x1774('0x0'));var logger=require(_0x1774('0x1'))(_0x1774('0x2'));var moment=require(_0x1774('0x3'));var BPromise=require(_0x1774('0x4'));var rp=require('request-promise');var htmlToText=require(_0x1774('0x5'));var fs=require('fs');var path=require(_0x1774('0x6'));var rimraf=require(_0x1774('0x7'));var config=require(_0x1774('0x8'));var attributes=require(_0x1774('0x9'));module[_0x1774('0xa')]=function(_0x5a9b57,_0x123a65){return _0x5a9b57[_0x1774('0xb')](_0x1774('0xc'),attributes,{'tableName':_0x1774('0xd'),'paranoid':![],'indexes':[{'name':_0x1774('0xe'),'fields':[_0x1774('0xe')]},{'name':_0x1774('0xf'),'fields':[_0x1774('0x10'),_0x1774('0x11')],'type':_0x1774('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16e622,_0x27aeac,_0x2f06e8){if(_0x16e622['body']){_0x16e622[_0x1774('0x10')]=htmlToText['fromString'](_0x16e622[_0x1774('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2f06e8(null,_0x27aeac);},'afterCreate':function(_0x25dd34,_0x2f5c5f,_0x861816){var _0x14fd44=_0x5a9b57[_0x1774('0x14')];var _0x400e3c=_0x25dd34[_0x1774('0x15')]({'plain':!![]});if(_0x400e3c[_0x1774('0x16')][_0x1774('0x17')]()==='in'||_0x400e3c[_0x1774('0x16')][_0x1774('0x17')]()===_0x1774('0x18')&&!_0x400e3c[_0x1774('0x19')]&&!_[_0x1774('0x1a')](_0x400e3c[_0x1774('0x1b')])){_0x14fd44[_0x1774('0x1c')][_0x1774('0x1d')]({'where':{'id':_0x400e3c[_0x1774('0x1e')]}})[_0x1774('0x1f')](function(_0x1dbd25){if(_0x1dbd25){_0x1dbd25[_0x1774('0x20')]({'lastMsgAt':_0x400e3c[_0x1774('0x21')],'lastMsgDirection':_0x400e3c[_0x1774('0x16')][_0x1774('0x17')]()});}})['catch'](function(_0x40741c){console[_0x1774('0x22')](_0x40741c);});}_0x861816();}},'charset':_0x1774('0x23'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8a27=['fromString','body','get','toLowerCase','out','UserId','MailInteraction','findOne','then','update','createdAt','direction','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject'];(function(_0x29f77f,_0x54d73b){var _0x5ec7f1=function(_0x544b6e){while(--_0x544b6e){_0x29f77f['push'](_0x29f77f['shift']());}};_0x5ec7f1(++_0x54d73b);}(_0x8a27,0x8b));var _0x78a2=function(_0x45061a,_0x515a4a){_0x45061a=_0x45061a-0x0;var _0x46123d=_0x8a27[_0x45061a];return _0x46123d;};'use strict';var _=require(_0x78a2('0x0'));var util=require(_0x78a2('0x1'));var logger=require(_0x78a2('0x2'))(_0x78a2('0x3'));var moment=require('moment');var BPromise=require(_0x78a2('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x78a2('0x5'));var rimraf=require(_0x78a2('0x6'));var config=require(_0x78a2('0x7'));var attributes=require(_0x78a2('0x8'));module[_0x78a2('0x9')]=function(_0x1a1282,_0x2195f2){return _0x1a1282[_0x78a2('0xa')](_0x78a2('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x78a2('0xc'),'fields':[_0x78a2('0xc')]},{'name':_0x78a2('0xd'),'fields':[_0x78a2('0xe'),_0x78a2('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x123394,_0x30eb58,_0x5df070){if(_0x123394['body']){_0x123394[_0x78a2('0xe')]=htmlToText[_0x78a2('0x10')](_0x123394[_0x78a2('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5df070(null,_0x30eb58);},'afterCreate':function(_0x12f57c,_0x1fa62a,_0x12586f){var _0xc1391e=_0x1a1282['models'];var _0x52c4d7=_0x12f57c[_0x78a2('0x12')]({'plain':!![]});if(_0x52c4d7['direction'][_0x78a2('0x13')]()==='in'||_0x52c4d7['direction'][_0x78a2('0x13')]()===_0x78a2('0x14')&&!_0x52c4d7['secret']&&!_['isNil'](_0x52c4d7[_0x78a2('0x15')])){_0xc1391e[_0x78a2('0x16')][_0x78a2('0x17')]({'where':{'id':_0x52c4d7['MailInteractionId']}})[_0x78a2('0x18')](function(_0x30b7dd){if(_0x30b7dd){_0x30b7dd[_0x78a2('0x19')]({'lastMsgAt':_0x52c4d7[_0x78a2('0x1a')],'lastMsgDirection':_0x52c4d7[_0x78a2('0x1b')][_0x78a2('0x13')]()});}})[_0x78a2('0x1c')](function(_0x1f99a9){console['error'](_0x1f99a9);});}_0x12586f();}},'charset':_0x78a2('0x1d'),'collate':_0x78a2('0x1e')});};
\ No newline at end of file
index 2e07491..216d4db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4024=['debug','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x28316b,_0x503e5d){var _0x33d9e4=function(_0x26b7e9){while(--_0x26b7e9){_0x28316b['push'](_0x28316b['shift']());}};_0x33d9e4(++_0x503e5d);}(_0x4024,0x89));var _0x4402=function(_0x5079fb,_0x5a998d){_0x5079fb=_0x5079fb-0x0;var _0x415467=_0x4024[_0x5079fb];return _0x415467;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')](_0x5cb0c5[_0x4402('0x17')],{'raw':_0x5cb0c5['options']?_0x5cb0c5[_0x4402('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6f1f72){logger[_0x4402('0x12')](_0x4402('0x14'),_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x6f1f72));_0x4e0340(_0x6f1f72);})[_0x4402('0x13')](function(_0x6b1fc5){logger[_0x4402('0xf')]('CreateMailMessage',_0x6b1fc5[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459['error'](0x1f4,_0x6b1fc5[_0x4402('0x11')]));});});};
\ No newline at end of file
+var _0xd4a2=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateMailMessage','create','body','options','raw','then','catch','lodash'];(function(_0x19c2e8,_0x35a07d){var _0x499e23=function(_0xa032c8){while(--_0xa032c8){_0x19c2e8['push'](_0x19c2e8['shift']());}};_0x499e23(++_0x35a07d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x5af748,_0x4b8ccc){_0x5af748=_0x5af748-0x0;var _0x19d36d=_0xd4a2[_0x5af748];return _0x19d36d;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});config['redis']=_[_0x2d4a('0x9')](config[_0x2d4a('0xa')],{'host':_0x2d4a('0xb'),'port':0x18eb});var socket=require(_0x2d4a('0xc'))(new Redis(config[_0x2d4a('0xa')]));require(_0x2d4a('0xd'))[_0x2d4a('0xe')](socket);function respondWithRpcPromise(_0x113839,_0x33b786,_0x4738dc){return new BPromise(function(_0x3abbbd,_0xce6af6){return client['request'](_0x113839,_0x4738dc)['then'](function(_0x4002de){logger['info'](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));logger[_0x2d4a('0x11')](_0x2d4a('0x12'),_0x33b786,_0x2d4a('0x10'),JSON[_0x2d4a('0x13')](_0x4002de));if(_0x4002de[_0x2d4a('0x14')]){if(_0x4002de[_0x2d4a('0x14')]['code']===0x1f4){logger['error'](_0x2d4a('0xf'),_0x33b786,_0x4002de['error'][_0x2d4a('0x15')]);return _0xce6af6(_0x4002de[_0x2d4a('0x14')][_0x2d4a('0x15')]);}logger[_0x2d4a('0x14')]('MailMessage,\x20%s,\x20%s',_0x33b786,_0x4002de[_0x2d4a('0x14')]['message']);return _0x3abbbd(_0x4002de[_0x2d4a('0x14')]['message']);}else{logger[_0x2d4a('0x16')](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));_0x3abbbd(_0x4002de[_0x2d4a('0x17')]['message']);}})['catch'](function(_0x5ac74b){logger[_0x2d4a('0x14')](_0x2d4a('0xf'),_0x33b786,_0x5ac74b);_0xce6af6(_0x5ac74b);});});}exports[_0x2d4a('0x18')]=function(_0x419df5){var _0x46c331=this;return new Promise(function(_0x2e4069,_0x56445a){return db['MailMessage'][_0x2d4a('0x19')](_0x419df5[_0x2d4a('0x1a')],{'raw':_0x419df5[_0x2d4a('0x1b')]?_0x419df5[_0x2d4a('0x1b')][_0x2d4a('0x1c')]===undefined?!![]:![]:!![]})[_0x2d4a('0x1d')](function(_0x22dd0b){logger[_0x2d4a('0x16')]('CreateMailMessage',_0x419df5);logger[_0x2d4a('0x11')](_0x2d4a('0x18'),_0x419df5,JSON[_0x2d4a('0x13')](_0x22dd0b));_0x2e4069(_0x22dd0b);})[_0x2d4a('0x1e')](function(_0x2c845c){logger[_0x2d4a('0x14')](_0x2d4a('0x18'),_0x2c845c[_0x2d4a('0x15')],_0x419df5);_0x56445a(_0x46c331['error'](0x1f4,_0x2c845c['message']));});});};
\ No newline at end of file
index a1529df..26fab79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b6=['save','remove','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x86b6,0x6b));var _0x686b=function(_0x193372,_0x10ecce){_0x193372=_0x193372-0x0;var _0x9c8117=_0x86b6[_0x193372];return _0x9c8117;};'use strict';var MailMessageEvents=require(_0x686b('0x0'));var events=[_0x686b('0x1'),_0x686b('0x2'),_0x686b('0x3')];function createListener(_0x56bbb6,_0x50232e){return function(_0xc283e2){_0x50232e[_0x686b('0x4')](_0x56bbb6,_0xc283e2);};}function removeListener(_0x2cdd42,_0x3d7a8f){return function(){MailMessageEvents[_0x686b('0x5')](_0x2cdd42,_0x3d7a8f);};}exports[_0x686b('0x6')]=function(_0x4c7aa7){for(var _0x599ba1=0x0,_0x2e0fb0=events[_0x686b('0x7')];_0x599ba1<_0x2e0fb0;_0x599ba1++){var _0x1a0c1a=events[_0x599ba1];var _0x474570=createListener(_0x686b('0x8')+_0x1a0c1a,_0x4c7aa7);MailMessageEvents['on'](_0x1a0c1a,_0x474570);}};
\ No newline at end of file
+var _0x9d95=['mailMessage:','./mailMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x5d78f0,_0x3784f9){var _0x4d1012=function(_0x23d0ba){while(--_0x23d0ba){_0x5d78f0['push'](_0x5d78f0['shift']());}};_0x4d1012(++_0x3784f9);}(_0x9d95,0x1b1));var _0x59d9=function(_0x151beb,_0x138bb3){_0x151beb=_0x151beb-0x0;var _0x530b0d=_0x9d95[_0x151beb];return _0x530b0d;};'use strict';var MailMessageEvents=require(_0x59d9('0x0'));var events=[_0x59d9('0x1'),_0x59d9('0x2'),'update'];function createListener(_0x8b5791,_0x353843){return function(_0xe0954d){_0x353843[_0x59d9('0x3')](_0x8b5791,_0xe0954d);};}function removeListener(_0x295e44,_0x495976){return function(){MailMessageEvents[_0x59d9('0x4')](_0x295e44,_0x495976);};}exports[_0x59d9('0x5')]=function(_0x4d76a7){for(var _0x458e36=0x0,_0x4295ac=events[_0x59d9('0x6')];_0x458e36<_0x4295ac;_0x458e36++){var _0x408d90=events[_0x458e36];var _0x2e2cf6=createListener(_0x59d9('0x7')+_0x408d90,_0x4d76a7);MailMessageEvents['on'](_0x408d90,_0x2e2cf6);}};
\ No newline at end of file
index d18d2b5..7d3235e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85a4=['isAuthenticated','describe','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','delete','removeTeams','removeAgents','exports','multer','Router','fs-extra','../../components/auth/service','get'];(function(_0x1821d3,_0x199d80){var _0x51cca8=function(_0x5be2cd){while(--_0x5be2cd){_0x1821d3['push'](_0x1821d3['shift']());}};_0x51cca8(++_0x199d80);}(_0x85a4,0xcd));var _0x485a=function(_0x1d3119,_0x47efe2){_0x1d3119=_0x1d3119-0x0;var _0x2bd838=_0x85a4[_0x1d3119];return _0x2bd838;};'use strict';var multer=require(_0x485a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x485a('0x1')]();var fs_extra=require(_0x485a('0x2'));var auth=require(_0x485a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x485a('0x4')]('/',auth[_0x485a('0x5')](),controller['index']);router[_0x485a('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x485a('0x6')]);router['get']('/:id',auth[_0x485a('0x5')](),controller['show']);router[_0x485a('0x4')]('/:id/members',auth[_0x485a('0x5')](),controller[_0x485a('0x7')]);router[_0x485a('0x4')](_0x485a('0x8'),auth[_0x485a('0x5')](),controller[_0x485a('0x9')]);router['get'](_0x485a('0xa'),auth[_0x485a('0x5')](),controller[_0x485a('0xb')]);router[_0x485a('0xc')]('/',auth[_0x485a('0x5')](),controller[_0x485a('0xd')]);router[_0x485a('0xc')](_0x485a('0x8'),auth[_0x485a('0x5')](),controller[_0x485a('0xe')]);router['post'](_0x485a('0xa'),auth[_0x485a('0x5')](),controller[_0x485a('0xf')]);router['put'](_0x485a('0x10'),auth[_0x485a('0x5')](),controller['update']);router[_0x485a('0x11')](_0x485a('0x10'),auth[_0x485a('0x5')](),controller['destroy']);router[_0x485a('0x11')](_0x485a('0x8'),auth[_0x485a('0x5')](),controller[_0x485a('0x12')]);router['delete'](_0x485a('0xa'),auth[_0x485a('0x5')](),controller[_0x485a('0x13')]);module[_0x485a('0x14')]=router;
\ No newline at end of file
+var _0xdab5=['/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xdab5,0x198));var _0x5dab=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xdab5[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x5dab('0x0'));var path=require(_0x5dab('0x1'));var timeout=require('connect-timeout');var express=require(_0x5dab('0x2'));var router=express[_0x5dab('0x3')]();var fs_extra=require(_0x5dab('0x4'));var auth=require(_0x5dab('0x5'));var interaction=require(_0x5dab('0x6'));var config=require(_0x5dab('0x7'));var controller=require(_0x5dab('0x8'));router[_0x5dab('0x9')]('/',auth[_0x5dab('0xa')](),controller[_0x5dab('0xb')]);router['get'](_0x5dab('0xc'),auth['isAuthenticated'](),controller[_0x5dab('0xd')]);router[_0x5dab('0x9')]('/:id',auth[_0x5dab('0xa')](),controller['show']);router['get'](_0x5dab('0xe'),auth['isAuthenticated'](),controller[_0x5dab('0xf')]);router[_0x5dab('0x9')](_0x5dab('0x10'),auth[_0x5dab('0xa')](),controller[_0x5dab('0x11')]);router['get'](_0x5dab('0x12'),auth[_0x5dab('0xa')](),controller[_0x5dab('0x13')]);router[_0x5dab('0x14')]('/',auth[_0x5dab('0xa')](),controller['create']);router[_0x5dab('0x14')](_0x5dab('0x10'),auth['isAuthenticated'](),controller[_0x5dab('0x15')]);router[_0x5dab('0x14')](_0x5dab('0x12'),auth['isAuthenticated'](),controller[_0x5dab('0x16')]);router[_0x5dab('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x5dab('0x18')]);router[_0x5dab('0x19')]('/:id',auth[_0x5dab('0xa')](),controller[_0x5dab('0x1a')]);router[_0x5dab('0x19')](_0x5dab('0x10'),auth[_0x5dab('0xa')](),controller[_0x5dab('0x1b')]);router[_0x5dab('0x19')](_0x5dab('0x12'),auth[_0x5dab('0xa')](),controller[_0x5dab('0x1c')]);module[_0x5dab('0x1d')]=router;
\ No newline at end of file
index 44f8006..2093990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf748=['rrmemory','beepall','sequelize','name','STRING','INTEGER','ENUM'];(function(_0x14551c,_0x99dc1){var _0x1032bc=function(_0x50d06f){while(--_0x50d06f){_0x14551c['push'](_0x14551c['shift']());}};_0x1032bc(++_0x99dc1);}(_0xf748,0x9c));var _0x8f74=function(_0x38a9cb,_0xfd8b2b){_0x38a9cb=_0x38a9cb-0x0;var _0xfa7687=_0xf748[_0x38a9cb];return _0xfa7687;};'use strict';var Sequelize=require(_0x8f74('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8f74('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f74('0x2')]},'timeout':{'type':Sequelize[_0x8f74('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f74('0x4')](_0x8f74('0x5'),_0x8f74('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x6bab=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6bab,0x1be));var _0xb6ba=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x6bab[_0x22b8a3];return _0x199a0c;};'use strict';var Sequelize=require(_0xb6ba('0x0'));module[_0xb6ba('0x1')]={'name':{'type':Sequelize[_0xb6ba('0x2')],'unique':_0xb6ba('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb6ba('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb6ba('0x4')](_0xb6ba('0x5'),_0xb6ba('0x6'),_0xb6ba('0x7'))}};
\ No newline at end of file
index 1f62227..9f36eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserMailQueue','nolimit','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction'];(function(_0x1f4f41,_0x4e0e7a){var _0x5e51c4=function(_0x5a8b27){while(--_0x5a8b27){_0x1f4f41['push'](_0x1f4f41['shift']());}};_0x5e51c4(++_0x4e0e7a);}(_0x31c2,0x98));var _0x231c=function(_0x44deb1,_0x5ffe26){_0x44deb1=_0x44deb1-0x0;var _0x1191f6=_0x31c2[_0x44deb1];return _0x1191f6;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x231c('0x1'));var rp=require(_0x231c('0x2'));var moment=require('moment');var BPromise=require(_0x231c('0x3'));var Mustache=require(_0x231c('0x4'));var util=require(_0x231c('0x5'));var path=require(_0x231c('0x6'));var sox=require(_0x231c('0x7'));var csv=require(_0x231c('0x8'));var ejs=require(_0x231c('0x9'));var fs=require('fs');var fs_extra=require(_0x231c('0xa'));var _=require('lodash');var squel=require(_0x231c('0xb'));var crypto=require('crypto');var jsforce=require(_0x231c('0xc'));var deskjs=require(_0x231c('0xd'));var toCsv=require(_0x231c('0x8'));var querystring=require(_0x231c('0xe'));var Papa=require('papaparse');var Redis=require(_0x231c('0xf'));var authService=require(_0x231c('0x10'));var qs=require(_0x231c('0x11'));var as=require(_0x231c('0x12'));var hardwareService=require(_0x231c('0x13'));var logger=require(_0x231c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x231c('0x15'));var db=require(_0x231c('0x16'))['db'];config[_0x231c('0x17')]=_[_0x231c('0x18')](config[_0x231c('0x17')],{'host':_0x231c('0x19'),'port':0x18eb});var socket=require(_0x231c('0x1a'))(new Redis(config[_0x231c('0x17')]));require(_0x231c('0x1b'))[_0x231c('0x1c')](socket);function respondWithStatusCode(_0x23dd85,_0x29e708){_0x29e708=_0x29e708||0xcc;return function(_0x279884){if(_0x279884){return _0x23dd85[_0x231c('0x1d')](_0x29e708);}return _0x23dd85['status'](_0x29e708)[_0x231c('0x1e')]();};}function respondWithResult(_0x2ff6a7,_0x174f96){_0x174f96=_0x174f96||0xc8;return function(_0x4eae58){if(_0x4eae58){return _0x2ff6a7[_0x231c('0x1f')](_0x174f96)['json'](_0x4eae58);}};}function respondWithFilteredResult(_0x337dee,_0x5c8323){return function(_0x1d48e3){if(_0x1d48e3){var _0x59282c=typeof _0x5c8323[_0x231c('0x20')]===_0x231c('0x21')&&typeof _0x5c8323[_0x231c('0x22')]===_0x231c('0x21');var _0x23c048=_0x1d48e3[_0x231c('0x23')];var _0x445187=_0x59282c?0x0:_0x5c8323[_0x231c('0x20')];var _0x555523=_0x59282c?_0x1d48e3[_0x231c('0x23')]:_0x5c8323[_0x231c('0x20')]+_0x5c8323[_0x231c('0x22')];var _0x4c52b7;if(_0x555523>=_0x23c048){_0x555523=_0x23c048;_0x4c52b7=0xc8;}else{_0x4c52b7=0xce;}_0x337dee['status'](_0x4c52b7);return _0x337dee[_0x231c('0x24')](_0x231c('0x25'),_0x445187+'-'+_0x555523+'/'+_0x23c048)[_0x231c('0x26')](_0x1d48e3);}return null;};}function patchUpdates(_0x5a117d){return function(_0xfa21a1){try{jsonpatch['apply'](_0xfa21a1,_0x5a117d,!![]);}catch(_0x2f4d59){return BPromise[_0x231c('0x27')](_0x2f4d59);}return _0xfa21a1[_0x231c('0x28')]();};}function saveUpdates(_0x5d754f,_0x4822){return function(_0x584f55){if(_0x584f55){return _0x584f55[_0x231c('0x29')](_0x5d754f)[_0x231c('0x2a')](function(_0x1260b1){return _0x1260b1;});}return null;};}function removeEntity(_0x871f45,_0x7a4b17){return function(_0x355d73){if(_0x355d73){return _0x355d73[_0x231c('0x2b')]()[_0x231c('0x2a')](function(){var _0xb7553a=_0x355d73[_0x231c('0x2c')]({'plain':!![]});var _0x3af080=_0x231c('0x2d');return db[_0x231c('0x2e')][_0x231c('0x2b')]({'where':{'type':_0x3af080,'resourceId':_0xb7553a['id']}})[_0x231c('0x2a')](function(){return _0x355d73;});})[_0x231c('0x2a')](function(){_0x871f45[_0x231c('0x1f')](0xcc)[_0x231c('0x1e')]();});}};}function handleEntityNotFound(_0x3aa15f,_0x12f049){return function(_0x1edcd7){if(!_0x1edcd7){_0x3aa15f[_0x231c('0x1d')](0x194);}return _0x1edcd7;};}function handleError(_0x4d5755,_0x2692d7){_0x2692d7=_0x2692d7||0x1f4;return function(_0x2a4d4d){logger[_0x231c('0x2f')](_0x2a4d4d[_0x231c('0x30')]);if(_0x2a4d4d[_0x231c('0x31')]){delete _0x2a4d4d[_0x231c('0x31')];}_0x4d5755[_0x231c('0x1f')](_0x2692d7)[_0x231c('0x32')](_0x2a4d4d);};}exports[_0x231c('0x33')]=function(_0x2a6eb1,_0x2fd980){var _0x263add={},_0x349df8={},_0x1237ac={'count':0x0,'rows':[]};var _0x9e02d5=_['map'](db[_0x231c('0x34')]['rawAttributes'],function(_0x344e10){return{'name':_0x344e10[_0x231c('0x35')],'type':_0x344e10[_0x231c('0x36')][_0x231c('0x37')]};});_0x349df8[_0x231c('0x38')]=_[_0x231c('0x39')](_0x9e02d5,'name');_0x349df8[_0x231c('0x3a')]=_[_0x231c('0x3b')](_0x2a6eb1[_0x231c('0x3a')]);_0x349df8[_0x231c('0x3c')]=_[_0x231c('0x3d')](_0x349df8[_0x231c('0x38')],_0x349df8[_0x231c('0x3a')]);_0x263add[_0x231c('0x3e')]=_['intersection'](_0x349df8[_0x231c('0x38')],qs['fields'](_0x2a6eb1[_0x231c('0x3a')][_0x231c('0x3f')]));_0x263add['attributes']=_0x263add[_0x231c('0x3e')][_0x231c('0x40')]?_0x263add[_0x231c('0x3e')]:_0x349df8['model'];if(!_0x2a6eb1[_0x231c('0x3a')][_0x231c('0x41')]('nolimit')){_0x263add['limit']=qs['limit'](_0x2a6eb1[_0x231c('0x3a')][_0x231c('0x22')]);_0x263add['offset']=qs[_0x231c('0x20')](_0x2a6eb1[_0x231c('0x3a')][_0x231c('0x20')]);}_0x263add[_0x231c('0x42')]=qs[_0x231c('0x43')](_0x2a6eb1[_0x231c('0x3a')]['sort']);_0x263add[_0x231c('0x44')]=qs[_0x231c('0x3c')](_['pick'](_0x2a6eb1[_0x231c('0x3a')],_0x349df8['filters']),_0x9e02d5);if(_0x2a6eb1[_0x231c('0x3a')]['filter']){_0x263add[_0x231c('0x44')]=_['merge'](_0x263add[_0x231c('0x44')],{'$or':_['map'](_0x9e02d5,function(_0x1bebb0){if(_0x1bebb0['type']!==_0x231c('0x45')){var _0x3bf672={};_0x3bf672[_0x1bebb0['name']]={'$like':'%'+_0x2a6eb1[_0x231c('0x3a')][_0x231c('0x46')]+'%'};return _0x3bf672;}})});}_0x263add=_[_0x231c('0x47')]({},_0x263add,_0x2a6eb1[_0x231c('0x48')]);var _0x371bef={'where':_0x263add[_0x231c('0x44')]};return db[_0x231c('0x34')]['count'](_0x371bef)[_0x231c('0x2a')](function(_0x246be9){_0x1237ac[_0x231c('0x23')]=_0x246be9;if(_0x2a6eb1['query'][_0x231c('0x49')]){_0x263add[_0x231c('0x4a')]=[{'all':!![]}];}return db[_0x231c('0x34')][_0x231c('0x4b')](_0x263add);})[_0x231c('0x2a')](function(_0x137d5f){_0x1237ac[_0x231c('0x4c')]=_0x137d5f;return _0x1237ac;})[_0x231c('0x2a')](respondWithFilteredResult(_0x2fd980,_0x263add))[_0x231c('0x4d')](handleError(_0x2fd980,null));};exports[_0x231c('0x4e')]=function(_0x20d1c0,_0x908dca){var _0x172fb6={'raw':!![],'where':{'id':_0x20d1c0[_0x231c('0x4f')]['id']}},_0x536344={};_0x536344[_0x231c('0x38')]=_['keys'](db['MailQueue'][_0x231c('0x50')]);_0x536344[_0x231c('0x3a')]=_[_0x231c('0x3b')](_0x20d1c0['query']);_0x536344[_0x231c('0x3c')]=_[_0x231c('0x3d')](_0x536344[_0x231c('0x38')],_0x536344[_0x231c('0x3a')]);_0x172fb6[_0x231c('0x3e')]=_[_0x231c('0x3d')](_0x536344[_0x231c('0x38')],qs[_0x231c('0x3f')](_0x20d1c0[_0x231c('0x3a')][_0x231c('0x3f')]));_0x172fb6[_0x231c('0x3e')]=_0x172fb6[_0x231c('0x3e')][_0x231c('0x40')]?_0x172fb6[_0x231c('0x3e')]:_0x536344[_0x231c('0x38')];if(_0x20d1c0[_0x231c('0x3a')]['includeAll']){_0x172fb6[_0x231c('0x4a')]=[{'all':!![]}];}_0x172fb6=_[_0x231c('0x47')]({},_0x172fb6,_0x20d1c0[_0x231c('0x48')]);return db[_0x231c('0x34')][_0x231c('0x51')](_0x172fb6)[_0x231c('0x2a')](handleEntityNotFound(_0x908dca,null))['then'](respondWithResult(_0x908dca,null))[_0x231c('0x4d')](handleError(_0x908dca,null));};exports[_0x231c('0x52')]=function(_0x4f6b3d,_0x35ae00){return db[_0x231c('0x34')]['create'](_0x4f6b3d['body'],{})[_0x231c('0x2a')](function(_0x5996bf){var _0x381bea=_0x4f6b3d[_0x231c('0x53')][_0x231c('0x2c')]({'plain':!![]});if(!_0x381bea)throw new Error(_0x231c('0x54'));if(_0x381bea[_0x231c('0x55')]===_0x231c('0x53')){var _0x2a7b17=_0x5996bf[_0x231c('0x2c')]({'plain':!![]});var _0x9a7a09=_0x231c('0x2d');return db[_0x231c('0x56')]['find']({'where':{'name':_0x9a7a09,'userProfileId':_0x381bea['userProfileId']},'raw':!![]})['then'](function(_0x4ecb5a){if(_0x4ecb5a&&_0x4ecb5a[_0x231c('0x57')]===0x0){return db[_0x231c('0x2e')][_0x231c('0x52')]({'name':_0x2a7b17['name'],'resourceId':_0x2a7b17['id'],'type':_0x4ecb5a[_0x231c('0x31')],'sectionId':_0x4ecb5a['id']},{})[_0x231c('0x2a')](function(){return _0x5996bf;});}else{return _0x5996bf;}})[_0x231c('0x4d')](function(_0x2e3857){logger['error'](_0x231c('0x58'),_0x2e3857);throw _0x2e3857;});}return _0x5996bf;})[_0x231c('0x2a')](respondWithResult(_0x35ae00,0xc9))[_0x231c('0x4d')](handleError(_0x35ae00,null));};exports[_0x231c('0x29')]=function(_0x1e5be8,_0xefc062){if(_0x1e5be8['body']['id']){delete _0x1e5be8[_0x231c('0x59')]['id'];}return db[_0x231c('0x34')][_0x231c('0x51')]({'where':{'id':_0x1e5be8['params']['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0xefc062,null))[_0x231c('0x2a')](saveUpdates(_0x1e5be8[_0x231c('0x59')],null))[_0x231c('0x2a')](respondWithResult(_0xefc062,null))[_0x231c('0x4d')](handleError(_0xefc062,null));};exports[_0x231c('0x2b')]=function(_0x59739a,_0x46327d){return db[_0x231c('0x34')][_0x231c('0x51')]({'where':{'id':_0x59739a[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0x46327d,null))[_0x231c('0x2a')](removeEntity(_0x46327d,null))[_0x231c('0x4d')](handleError(_0x46327d,null));};exports[_0x231c('0x5a')]=function(_0x1a9381,_0x3fb42e){return db['MailQueue'][_0x231c('0x5a')]()['then'](respondWithResult(_0x3fb42e,null))[_0x231c('0x4d')](handleError(_0x3fb42e,null));};exports['getMembers']=function(_0x36eb06,_0x3869a2,_0x153f3c){var _0x57a039={'raw':!![],'where':{}},_0x3b704d={},_0x115800;return db[_0x231c('0x34')]['findOne']({'where':{'id':_0x36eb06['params']['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0x3869a2,null))['then'](function(_0x4e7d00){if(_0x4e7d00){_0x115800=_0x4e7d00[_0x231c('0x2c')]({'plain':!![]});_0x3b704d[_0x231c('0x38')]=_[_0x231c('0x3b')](db[_0x231c('0x5b')][_0x231c('0x50')]);_0x3b704d[_0x231c('0x3a')]=_[_0x231c('0x3b')](_0x36eb06[_0x231c('0x3a')]);_0x3b704d[_0x231c('0x3c')]=_[_0x231c('0x3d')](_0x3b704d[_0x231c('0x38')],_0x3b704d[_0x231c('0x3a')]);_0x57a039[_0x231c('0x3e')]=_[_0x231c('0x3d')](_0x3b704d[_0x231c('0x38')],qs['fields'](_0x36eb06[_0x231c('0x3a')][_0x231c('0x3f')]));_0x57a039[_0x231c('0x3e')]=_0x57a039[_0x231c('0x3e')][_0x231c('0x40')]?_0x57a039[_0x231c('0x3e')]:_0x3b704d[_0x231c('0x38')];if(!_0x36eb06[_0x231c('0x3a')][_0x231c('0x41')](_0x231c('0x5c'))){_0x57a039[_0x231c('0x22')]=qs['limit'](_0x36eb06[_0x231c('0x3a')][_0x231c('0x22')]);_0x57a039[_0x231c('0x20')]=qs[_0x231c('0x20')](_0x36eb06[_0x231c('0x3a')][_0x231c('0x20')]);}_0x57a039[_0x231c('0x42')]=qs[_0x231c('0x43')](_0x36eb06[_0x231c('0x3a')][_0x231c('0x43')]);_0x57a039[_0x231c('0x44')]=qs[_0x231c('0x3c')](_[_0x231c('0x5d')](_0x36eb06['query'],_0x3b704d[_0x231c('0x3c')]));_0x57a039[_0x231c('0x44')][_0x231c('0x5e')]=_0x4e7d00['id'];if(_0x36eb06[_0x231c('0x3a')][_0x231c('0x46')]){_0x57a039[_0x231c('0x44')]=_[_0x231c('0x47')](_0x57a039[_0x231c('0x44')],{'$or':_['map'](_0x57a039[_0x231c('0x3e')],function(_0xda6920){var _0x50bbf9={};_0x50bbf9[_0xda6920]={'$like':'%'+_0x36eb06[_0x231c('0x3a')][_0x231c('0x46')]+'%'};return _0x50bbf9;})});}_0x57a039=_['merge']({},_0x57a039,_0x36eb06[_0x231c('0x48')]);return db['UserMailQueue'][_0x231c('0x4b')](_0x57a039);}})['then'](function(_0x5f3808){if(_0x5f3808){return db[_0x231c('0x5f')][_0x231c('0x60')]({'where':{'id':_[_0x231c('0x39')](_0x5f3808,_0x231c('0x61')),'role':_0x231c('0x62')},'attributes':['id',_0x231c('0x31'),_0x231c('0x63'),_0x231c('0x64'),_0x231c('0x65')]});}})['then'](function(_0x221f61){if(_0x221f61){return{'count':_0x221f61['count'],'rows':_[_0x231c('0x39')](_0x221f61[_0x231c('0x4c')],function(_0x5d678b){return{'membername':_0x5d678b[_0x231c('0x31')],'UserId':_0x5d678b['id'],'queue_name':_0x115800['name'],'MailQueueId':_0x115800['id'],'interface':util[_0x231c('0x66')](_0x231c('0x67'),_0x231c('0x68'),_0x5d678b[_0x231c('0x31')]),'penalty':0x0,'paused':_0x5d678b['mailPause'],'createdAt':_0x5d678b['createdAt'],'updatedAt':_0x5d678b[_0x231c('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x231c('0x2a')](respondWithFilteredResult(_0x3869a2,_0x57a039))[_0x231c('0x4d')](handleError(_0x3869a2,null));};exports[_0x231c('0x69')]=function(_0x368a80,_0x461058,_0x5b255e){var _0x179ed={};var _0x5bf56b={};var _0x506dc5;var _0x39da2c;return db[_0x231c('0x34')][_0x231c('0x6a')]({'where':{'id':_0x368a80[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0x461058,null))[_0x231c('0x2a')](function(_0x5d7ea7){if(_0x5d7ea7){_0x506dc5=_0x5d7ea7;_0x5bf56b[_0x231c('0x38')]=_[_0x231c('0x3b')](db[_0x231c('0x6b')][_0x231c('0x50')]);_0x5bf56b[_0x231c('0x3a')]=_[_0x231c('0x3b')](_0x368a80[_0x231c('0x3a')]);_0x5bf56b[_0x231c('0x3c')]=_['intersection'](_0x5bf56b['model'],_0x5bf56b['query']);_0x179ed[_0x231c('0x3e')]=_[_0x231c('0x3d')](_0x5bf56b[_0x231c('0x38')],qs['fields'](_0x368a80[_0x231c('0x3a')][_0x231c('0x3f')]));_0x179ed[_0x231c('0x3e')]=_0x179ed[_0x231c('0x3e')][_0x231c('0x40')]?_0x179ed[_0x231c('0x3e')]:_0x5bf56b['model'];_0x179ed[_0x231c('0x42')]=qs['sort'](_0x368a80[_0x231c('0x3a')][_0x231c('0x43')]);_0x179ed[_0x231c('0x44')]=qs[_0x231c('0x3c')](_[_0x231c('0x5d')](_0x368a80[_0x231c('0x3a')],_0x5bf56b[_0x231c('0x3c')]));if(_0x368a80['query'][_0x231c('0x46')]){_0x179ed[_0x231c('0x44')]=_[_0x231c('0x47')](_0x179ed['where'],{'$or':_[_0x231c('0x39')](_0x179ed['attributes'],function(_0x449e17){var _0x156343={};_0x156343[_0x449e17]={'$like':'%'+_0x368a80[_0x231c('0x3a')][_0x231c('0x46')]+'%'};return _0x156343;})});}_0x179ed=_[_0x231c('0x47')]({},_0x179ed,_0x368a80['options']);return _0x506dc5[_0x231c('0x69')](_0x179ed);}})['then'](function(_0xcd49d9){if(_0xcd49d9){_0x39da2c=_0xcd49d9[_0x231c('0x40')];if(!_0x368a80['query']['hasOwnProperty'](_0x231c('0x5c'))){_0x179ed[_0x231c('0x22')]=qs[_0x231c('0x22')](_0x368a80[_0x231c('0x3a')][_0x231c('0x22')]);_0x179ed[_0x231c('0x20')]=qs[_0x231c('0x20')](_0x368a80['query'][_0x231c('0x20')]);}return _0x506dc5[_0x231c('0x69')](_0x179ed);}})[_0x231c('0x2a')](function(_0x535644){if(_0x535644){return _0x535644?{'count':_0x39da2c,'rows':_0x535644}:null;}})[_0x231c('0x2a')](respondWithResult(_0x461058,null))[_0x231c('0x4d')](handleError(_0x461058,null));};exports[_0x231c('0x6c')]=function(_0x33c2b1,_0xda6008,_0x42b3de){var _0x1b8890=_0x33c2b1[_0x231c('0x59')][_0x231c('0x6d')];return db['Team'][_0x231c('0x4b')]({'where':{'id':_0x1b8890},'attributes':['id'],'include':[{'model':db['User'],'as':_0x231c('0x6e'),'attributes':['id',_0x231c('0x31'),_0x231c('0x6f'),_0x231c('0x70'),_0x231c('0x71')],'raw':!![]}]})[_0x231c('0x2a')](function(_0x3a1d37){if(_0x3a1d37){var _0x3fd1f7=_[_0x231c('0x72')](_0x3a1d37,function(_0xe130c1){var _0x5e2ea5=_0xe130c1[_0x231c('0x2c')]({'plain':!![]});return _0x5e2ea5[_0x231c('0x6e')];});return db[_0x231c('0x34')][_0x231c('0x51')]({'where':{'id':_0x33c2b1[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](function(_0x1d4418){return db[_0x231c('0x73')]['transaction'](function(_0x4eb52d){return _0x1d4418['addTeams'](_0x1b8890,{'transaction':_0x4eb52d})[_0x231c('0x2a')](function(){return BPromise[_0x231c('0x74')](_0x3fd1f7,function(_0x405bba){return db[_0x231c('0x5b')][_0x231c('0x75')]({'where':{'UserId':_0x405bba['id'],'MailQueueId':_0x33c2b1[_0x231c('0x4f')]['id']},'transaction':_0x4eb52d});});})['then'](function(){_0x3fd1f7[_0x231c('0x76')](function(_0x484ae9){socket[_0x231c('0x77')](_0x231c('0x78'),{'UserId':_0x484ae9['id'],'MailQueueId':_0x1d4418['id']});});});});});}})['then'](respondWithStatusCode(_0xda6008,null))[_0x231c('0x4d')](handleError(_0xda6008,null));};exports[_0x231c('0x79')]=function(_0x38208f,_0x271d8a,_0x35f821){return db['Team'][_0x231c('0x4b')]({'where':{'id':_0x38208f[_0x231c('0x3a')][_0x231c('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x231c('0x5f')],'as':_0x231c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x271d8a,null))[_0x231c('0x2a')](function(_0x34dee9){var _0x13a5dd=_[_0x231c('0x39')](_0x34dee9,'id');var _0x446975=[];var _0x14d477=[];var _0xd9c035=squel[_0x231c('0x7a')]();_0xd9c035[_0x231c('0x7b')](_0x231c('0x7c'))['from']('team_has_mail_queues','tq')[_0x231c('0x7d')](_0x231c('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x231c('0x44')](_0x231c('0x7f'),_0x38208f[_0x231c('0x4f')]['id']);for(var _0x42cb5f=0x0;_0x42cb5f<_0x34dee9[_0x231c('0x40')];_0x42cb5f+=0x1){let _0xb22e0a=_0x34dee9[_0x42cb5f];for(var _0x4cfbd1=0x0;_0x4cfbd1<_0xb22e0a[_0x231c('0x6e')][_0x231c('0x40')];_0x4cfbd1+=0x1){let _0x3cf61f=_0xb22e0a[_0x231c('0x6e')][_0x4cfbd1];var _0x9043a6=_0xd9c035[_0x231c('0x80')]();_0x9043a6[_0x231c('0x44')](_0x231c('0x81'),_0x3cf61f['id']);_0x14d477[_0x231c('0x82')](db[_0x231c('0x73')][_0x231c('0x3a')](_0x9043a6[_0x231c('0x83')](),{'type':db[_0x231c('0x73')][_0x231c('0x84')][_0x231c('0x85')]})[_0x231c('0x2a')](function(_0x31b2e7){if(_0x31b2e7[_0x231c('0x40')]===0x1){return _0x3cf61f['id'];}else{var _0x88f65d=_['every'](_['map'](_0x31b2e7,_0x231c('0x86')),function(_0x17614d){return _[_0x231c('0x87')](_0x13a5dd,_0x17614d);});if(_0x88f65d){return _0x3cf61f['id'];}}}));}}return BPromise[_0x231c('0x88')](_0x14d477)['then'](function(_0x41630b){_0x446975=_(_0x446975)[_0x231c('0x89')](_0x41630b)['compact']()[_0x231c('0x8a')]();return db[_0x231c('0x34')]['find']({'where':{'id':_0x38208f[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](function(_0x33644a){return db[_0x231c('0x73')][_0x231c('0x8b')](function(_0x7d5aa){return _0x33644a[_0x231c('0x79')](_0x38208f[_0x231c('0x3a')][_0x231c('0x6d')],{'transaction':_0x7d5aa})[_0x231c('0x2a')](function(){if(!_['isEmpty'](_0x446975)){return _0x33644a[_0x231c('0x8c')](_0x446975,{'transaction':_0x7d5aa});}})[_0x231c('0x2a')](function(){_0x446975[_0x231c('0x76')](function(_0x6161d3){socket[_0x231c('0x77')](_0x231c('0x8d'),{'UserId':_0x6161d3,'MailQueueId':_0x33644a['id']});});});});});});})['then'](respondWithStatusCode(_0x271d8a,null))[_0x231c('0x4d')](handleError(_0x271d8a,null));};exports['addAgents']=function(_0x279fad,_0x50198c,_0xf0ddb9){return db[_0x231c('0x34')]['find']({'where':{'id':_0x279fad[_0x231c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x50198c,null))[_0x231c('0x2a')](function(_0x238952){if(_0x238952){return _0x238952[_0x231c('0x8e')](_0x279fad['body'][_0x231c('0x6d')],_[_0x231c('0x8f')](_0x279fad[_0x231c('0x59')],[_0x231c('0x6d'),'id'])||{})[_0x231c('0x90')](function(_0x1fce0b){for(var _0x456de9=0x0;_0x456de9<_0x279fad[_0x231c('0x59')][_0x231c('0x6d')][_0x231c('0x40')];_0x456de9+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x279fad[_0x231c('0x59')][_0x231c('0x6d')][_0x456de9]),'MailQueueId':Number(_0x279fad[_0x231c('0x4f')]['id'])});}return _0x1fce0b;});}})[_0x231c('0x2a')](respondWithResult(_0x50198c,null))[_0x231c('0x4d')](handleError(_0x50198c,null));};exports[_0x231c('0x8c')]=function(_0x48e7be,_0x299af8,_0x3983ef){return db[_0x231c('0x34')][_0x231c('0x51')]({'where':{'id':_0x48e7be[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0x299af8,null))[_0x231c('0x2a')](function(_0x14c26f){if(_0x14c26f){return _0x14c26f[_0x231c('0x8c')](_0x48e7be[_0x231c('0x3a')][_0x231c('0x6d')])['then'](function(){if(_['isArray'](_0x48e7be[_0x231c('0x3a')][_0x231c('0x6d')])){for(var _0x3dc4e2=0x0;_0x3dc4e2<_0x48e7be[_0x231c('0x3a')][_0x231c('0x6d')][_0x231c('0x40')];_0x3dc4e2+=0x1){socket[_0x231c('0x77')](_0x231c('0x8d'),{'UserId':Number(_0x48e7be[_0x231c('0x3a')][_0x231c('0x6d')][_0x3dc4e2]),'MailQueueId':Number(_0x48e7be[_0x231c('0x4f')]['id'])});}}else{socket[_0x231c('0x77')](_0x231c('0x8d'),{'UserId':Number(_0x48e7be['query'][_0x231c('0x6d')]),'MailQueueId':Number(_0x48e7be[_0x231c('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x299af8,null))[_0x231c('0x4d')](handleError(_0x299af8,null));};exports[_0x231c('0x91')]=function(_0x5c1ab7,_0xa77563,_0xad8b47){var _0x5a9c91={};var _0x186395={};var _0x32b737;var _0x52ea84;return db[_0x231c('0x34')][_0x231c('0x6a')]({'where':{'id':_0x5c1ab7[_0x231c('0x4f')]['id']}})[_0x231c('0x2a')](handleEntityNotFound(_0xa77563,null))[_0x231c('0x2a')](function(_0x885443){if(_0x885443){_0x32b737=_0x885443;_0x186395[_0x231c('0x38')]=_[_0x231c('0x3b')](db[_0x231c('0x5f')][_0x231c('0x50')]);_0x186395['query']=_[_0x231c('0x3b')](_0x5c1ab7[_0x231c('0x3a')]);_0x186395['filters']=_['intersection'](_0x186395['model'],_0x186395['query']);_0x5a9c91['attributes']=_[_0x231c('0x3d')](_0x186395['model'],qs[_0x231c('0x3f')](_0x5c1ab7[_0x231c('0x3a')][_0x231c('0x3f')]));_0x5a9c91[_0x231c('0x3e')]=_0x5a9c91['attributes']['length']?_0x5a9c91[_0x231c('0x3e')]:_0x186395[_0x231c('0x38')];_0x5a9c91[_0x231c('0x42')]=qs[_0x231c('0x43')](_0x5c1ab7[_0x231c('0x3a')][_0x231c('0x43')]);_0x5a9c91[_0x231c('0x44')]=qs['filters'](_[_0x231c('0x5d')](_0x5c1ab7[_0x231c('0x3a')],_0x186395[_0x231c('0x3c')]));if(_0x5c1ab7[_0x231c('0x3a')][_0x231c('0x46')]){_0x5a9c91['where']=_['merge'](_0x5a9c91[_0x231c('0x44')],{'$or':_[_0x231c('0x39')](_0x5a9c91[_0x231c('0x3e')],function(_0x9f03a7){var _0x3b4d23={};_0x3b4d23[_0x9f03a7]={'$like':'%'+_0x5c1ab7[_0x231c('0x3a')][_0x231c('0x46')]+'%'};return _0x3b4d23;})});}_0x5a9c91=_[_0x231c('0x47')]({},_0x5a9c91,_0x5c1ab7['options']);return _0x32b737[_0x231c('0x91')](_0x5a9c91);}})[_0x231c('0x2a')](function(_0x4d607e){if(_0x4d607e){_0x52ea84=_0x4d607e[_0x231c('0x40')];if(!_0x5c1ab7['query'][_0x231c('0x41')](_0x231c('0x5c'))){_0x5a9c91[_0x231c('0x22')]=qs[_0x231c('0x22')](_0x5c1ab7[_0x231c('0x3a')]['limit']);_0x5a9c91['offset']=qs[_0x231c('0x20')](_0x5c1ab7[_0x231c('0x3a')][_0x231c('0x20')]);}return _0x32b737[_0x231c('0x91')](_0x5a9c91);}})[_0x231c('0x2a')](function(_0x4825e6){if(_0x4825e6){return _0x4825e6?{'count':_0x52ea84,'rows':_0x4825e6}:null;}})['then'](respondWithResult(_0xa77563,null))[_0x231c('0x4d')](handleError(_0xa77563,null));};
\ No newline at end of file
+var _0x1d2d=['then','destroy','get','MailQueues','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','include','findAll','rows','catch','length','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserMailQueue','nolimit','order','findAndCountAll','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5806cd,_0x1c26f4){var _0x47495e=function(_0x5bde43){while(--_0x5bde43){_0x5806cd['push'](_0x5806cd['shift']());}};_0x47495e(++_0x1c26f4);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4cba37,_0x488647){_0x4cba37=_0x4cba37-0x0;var _0x1fd03f=_0x1d2d[_0x4cba37];return _0x1fd03f;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];config[_0xd1d2('0x1b')]=_[_0xd1d2('0x1c')](config[_0xd1d2('0x1b')],{'host':_0xd1d2('0x1d'),'port':0x18eb});var socket=require(_0xd1d2('0x1e'))(new Redis(config[_0xd1d2('0x1b')]));require(_0xd1d2('0x1f'))['register'](socket);function respondWithStatusCode(_0x2e7fec,_0x3c0296){_0x3c0296=_0x3c0296||0xcc;return function(_0x3476f8){if(_0x3476f8){return _0x2e7fec['sendStatus'](_0x3c0296);}return _0x2e7fec[_0xd1d2('0x20')](_0x3c0296)[_0xd1d2('0x21')]();};}function respondWithResult(_0x208425,_0x2f4cf9){_0x2f4cf9=_0x2f4cf9||0xc8;return function(_0xecac1f){if(_0xecac1f){return _0x208425[_0xd1d2('0x20')](_0x2f4cf9)[_0xd1d2('0x22')](_0xecac1f);}};}function respondWithFilteredResult(_0x57f2f9,_0x539d5a){return function(_0x3be186){if(_0x3be186){var _0x55320b=typeof _0x539d5a[_0xd1d2('0x23')]===_0xd1d2('0x24')&&typeof _0x539d5a[_0xd1d2('0x25')]===_0xd1d2('0x24');var _0x4ab386=_0x3be186['count'];var _0xb43456=_0x55320b?0x0:_0x539d5a['offset'];var _0x5a6b86=_0x55320b?_0x3be186[_0xd1d2('0x26')]:_0x539d5a[_0xd1d2('0x23')]+_0x539d5a[_0xd1d2('0x25')];var _0x40170b;if(_0x5a6b86>=_0x4ab386){_0x5a6b86=_0x4ab386;_0x40170b=0xc8;}else{_0x40170b=0xce;}_0x57f2f9['status'](_0x40170b);return _0x57f2f9[_0xd1d2('0x27')](_0xd1d2('0x28'),_0xb43456+'-'+_0x5a6b86+'/'+_0x4ab386)[_0xd1d2('0x22')](_0x3be186);}return null;};}function patchUpdates(_0x4eb082){return function(_0x59e72c){try{jsonpatch[_0xd1d2('0x29')](_0x59e72c,_0x4eb082,!![]);}catch(_0x3a1078){return BPromise[_0xd1d2('0x2a')](_0x3a1078);}return _0x59e72c[_0xd1d2('0x2b')]();};}function saveUpdates(_0x3f229c,_0x33a171){return function(_0xe53fcd){if(_0xe53fcd){return _0xe53fcd['update'](_0x3f229c)[_0xd1d2('0x2c')](function(_0x42da6d){return _0x42da6d;});}return null;};}function removeEntity(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(_0x5d3ee1){return _0x5d3ee1[_0xd1d2('0x2d')]()[_0xd1d2('0x2c')](function(){var _0x34faf7=_0x5d3ee1[_0xd1d2('0x2e')]({'plain':!![]});var _0x384460=_0xd1d2('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x384460,'resourceId':_0x34faf7['id']}})[_0xd1d2('0x2c')](function(){return _0x5d3ee1;});})[_0xd1d2('0x2c')](function(){_0x41330f[_0xd1d2('0x20')](0xcc)[_0xd1d2('0x21')]();});}};}function handleEntityNotFound(_0xc815ea,_0x48ade1){return function(_0x39d694){if(!_0x39d694){_0xc815ea[_0xd1d2('0x30')](0x194);}return _0x39d694;};}function handleError(_0x383947,_0x4b4134){_0x4b4134=_0x4b4134||0x1f4;return function(_0x19db00){logger[_0xd1d2('0x31')](_0x19db00[_0xd1d2('0x32')]);if(_0x19db00['name']){delete _0x19db00[_0xd1d2('0x33')];}_0x383947[_0xd1d2('0x20')](_0x4b4134)[_0xd1d2('0x34')](_0x19db00);};}exports[_0xd1d2('0x35')]=function(_0x7f8ffa,_0x14d661){var _0x42e89d={},_0x322f50={},_0x1f3682={'count':0x0,'rows':[]};var _0x4501b6=_[_0xd1d2('0x36')](db[_0xd1d2('0x37')][_0xd1d2('0x38')],function(_0x2d9508){return{'name':_0x2d9508[_0xd1d2('0x39')],'type':_0x2d9508[_0xd1d2('0x3a')][_0xd1d2('0x3b')]};});_0x322f50[_0xd1d2('0x3c')]=_['map'](_0x4501b6,_0xd1d2('0x33'));_0x322f50[_0xd1d2('0x3d')]=_[_0xd1d2('0x3e')](_0x7f8ffa['query']);_0x322f50[_0xd1d2('0x3f')]=_['intersection'](_0x322f50['model'],_0x322f50[_0xd1d2('0x3d')]);_0x42e89d[_0xd1d2('0x40')]=_[_0xd1d2('0x41')](_0x322f50[_0xd1d2('0x3c')],qs[_0xd1d2('0x42')](_0x7f8ffa[_0xd1d2('0x3d')]['fields']));_0x42e89d[_0xd1d2('0x40')]=_0x42e89d[_0xd1d2('0x40')]['length']?_0x42e89d[_0xd1d2('0x40')]:_0x322f50[_0xd1d2('0x3c')];if(!_0x7f8ffa[_0xd1d2('0x3d')][_0xd1d2('0x43')]('nolimit')){_0x42e89d['limit']=qs[_0xd1d2('0x25')](_0x7f8ffa['query']['limit']);_0x42e89d['offset']=qs[_0xd1d2('0x23')](_0x7f8ffa['query'][_0xd1d2('0x23')]);}_0x42e89d['order']=qs['sort'](_0x7f8ffa['query'][_0xd1d2('0x44')]);_0x42e89d[_0xd1d2('0x45')]=qs[_0xd1d2('0x3f')](_[_0xd1d2('0x46')](_0x7f8ffa[_0xd1d2('0x3d')],_0x322f50[_0xd1d2('0x3f')]),_0x4501b6);if(_0x7f8ffa[_0xd1d2('0x3d')][_0xd1d2('0x47')]){_0x42e89d[_0xd1d2('0x45')]=_[_0xd1d2('0x48')](_0x42e89d[_0xd1d2('0x45')],{'$or':_[_0xd1d2('0x36')](_0x4501b6,function(_0x1c2835){if(_0x1c2835[_0xd1d2('0x3a')]!=='VIRTUAL'){var _0x4a58b4={};_0x4a58b4[_0x1c2835[_0xd1d2('0x33')]]={'$like':'%'+_0x7f8ffa[_0xd1d2('0x3d')][_0xd1d2('0x47')]+'%'};return _0x4a58b4;}})});}_0x42e89d=_['merge']({},_0x42e89d,_0x7f8ffa['options']);var _0x43c574={'where':_0x42e89d[_0xd1d2('0x45')]};return db['MailQueue'][_0xd1d2('0x26')](_0x43c574)['then'](function(_0x5a3790){_0x1f3682[_0xd1d2('0x26')]=_0x5a3790;if(_0x7f8ffa['query']['includeAll']){_0x42e89d[_0xd1d2('0x49')]=[{'all':!![]}];}return db[_0xd1d2('0x37')][_0xd1d2('0x4a')](_0x42e89d);})['then'](function(_0x2ba87b){_0x1f3682[_0xd1d2('0x4b')]=_0x2ba87b;return _0x1f3682;})[_0xd1d2('0x2c')](respondWithFilteredResult(_0x14d661,_0x42e89d))[_0xd1d2('0x4c')](handleError(_0x14d661,null));};exports['show']=function(_0x442717,_0x40c6dc){var _0x5a5096={'raw':!![],'where':{'id':_0x442717['params']['id']}},_0x43945e={};_0x43945e[_0xd1d2('0x3c')]=_[_0xd1d2('0x3e')](db[_0xd1d2('0x37')][_0xd1d2('0x38')]);_0x43945e[_0xd1d2('0x3d')]=_['keys'](_0x442717['query']);_0x43945e[_0xd1d2('0x3f')]=_[_0xd1d2('0x41')](_0x43945e['model'],_0x43945e[_0xd1d2('0x3d')]);_0x5a5096[_0xd1d2('0x40')]=_[_0xd1d2('0x41')](_0x43945e[_0xd1d2('0x3c')],qs[_0xd1d2('0x42')](_0x442717[_0xd1d2('0x3d')][_0xd1d2('0x42')]));_0x5a5096['attributes']=_0x5a5096[_0xd1d2('0x40')][_0xd1d2('0x4d')]?_0x5a5096['attributes']:_0x43945e[_0xd1d2('0x3c')];if(_0x442717[_0xd1d2('0x3d')]['includeAll']){_0x5a5096['include']=[{'all':!![]}];}_0x5a5096=_[_0xd1d2('0x48')]({},_0x5a5096,_0x442717[_0xd1d2('0x4e')]);return db['MailQueue'][_0xd1d2('0x4f')](_0x5a5096)[_0xd1d2('0x2c')](handleEntityNotFound(_0x40c6dc,null))[_0xd1d2('0x2c')](respondWithResult(_0x40c6dc,null))[_0xd1d2('0x4c')](handleError(_0x40c6dc,null));};exports[_0xd1d2('0x50')]=function(_0x4e28c5,_0x4dd22e){return db[_0xd1d2('0x37')]['create'](_0x4e28c5[_0xd1d2('0x51')],{})[_0xd1d2('0x2c')](function(_0x4f4cb9){var _0x389fcb=_0x4e28c5[_0xd1d2('0x52')]['get']({'plain':!![]});if(!_0x389fcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x389fcb[_0xd1d2('0x53')]===_0xd1d2('0x52')){var _0x187de4=_0x4f4cb9[_0xd1d2('0x2e')]({'plain':!![]});var _0xa013ce=_0xd1d2('0x2f');return db[_0xd1d2('0x54')][_0xd1d2('0x4f')]({'where':{'name':_0xa013ce,'userProfileId':_0x389fcb[_0xd1d2('0x55')]},'raw':!![]})['then'](function(_0x1958f3){if(_0x1958f3&&_0x1958f3['autoAssociation']===0x0){return db['UserProfileResource'][_0xd1d2('0x50')]({'name':_0x187de4[_0xd1d2('0x33')],'resourceId':_0x187de4['id'],'type':_0x1958f3[_0xd1d2('0x33')],'sectionId':_0x1958f3['id']},{})[_0xd1d2('0x2c')](function(){return _0x4f4cb9;});}else{return _0x4f4cb9;}})[_0xd1d2('0x4c')](function(_0x459209){logger[_0xd1d2('0x31')](_0xd1d2('0x56'),_0x459209);throw _0x459209;});}return _0x4f4cb9;})[_0xd1d2('0x2c')](respondWithResult(_0x4dd22e,0xc9))[_0xd1d2('0x4c')](handleError(_0x4dd22e,null));};exports[_0xd1d2('0x57')]=function(_0x14ba8d,_0x1c5738){if(_0x14ba8d['body']['id']){delete _0x14ba8d['body']['id'];}return db[_0xd1d2('0x37')][_0xd1d2('0x4f')]({'where':{'id':_0x14ba8d[_0xd1d2('0x58')]['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x1c5738,null))[_0xd1d2('0x2c')](saveUpdates(_0x14ba8d[_0xd1d2('0x51')],null))[_0xd1d2('0x2c')](respondWithResult(_0x1c5738,null))[_0xd1d2('0x4c')](handleError(_0x1c5738,null));};exports[_0xd1d2('0x2d')]=function(_0x3b9e2c,_0x1788cd){return db['MailQueue']['find']({'where':{'id':_0x3b9e2c[_0xd1d2('0x58')]['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x1788cd,null))[_0xd1d2('0x2c')](removeEntity(_0x1788cd,null))[_0xd1d2('0x4c')](handleError(_0x1788cd,null));};exports['describe']=function(_0x17e149,_0x27c629){return db[_0xd1d2('0x37')][_0xd1d2('0x59')]()[_0xd1d2('0x2c')](respondWithResult(_0x27c629,null))[_0xd1d2('0x4c')](handleError(_0x27c629,null));};exports[_0xd1d2('0x5a')]=function(_0x4a7375,_0x365352,_0x24d92c){var _0x1d8788={'raw':!![],'where':{}},_0x499638={},_0x5ca467;return db[_0xd1d2('0x37')][_0xd1d2('0x5b')]({'where':{'id':_0x4a7375[_0xd1d2('0x58')]['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x365352,null))['then'](function(_0xbf1e6e){if(_0xbf1e6e){_0x5ca467=_0xbf1e6e[_0xd1d2('0x2e')]({'plain':!![]});_0x499638[_0xd1d2('0x3c')]=_['keys'](db[_0xd1d2('0x5c')][_0xd1d2('0x38')]);_0x499638['query']=_[_0xd1d2('0x3e')](_0x4a7375[_0xd1d2('0x3d')]);_0x499638[_0xd1d2('0x3f')]=_[_0xd1d2('0x41')](_0x499638['model'],_0x499638[_0xd1d2('0x3d')]);_0x1d8788[_0xd1d2('0x40')]=_[_0xd1d2('0x41')](_0x499638[_0xd1d2('0x3c')],qs[_0xd1d2('0x42')](_0x4a7375['query']['fields']));_0x1d8788['attributes']=_0x1d8788['attributes']['length']?_0x1d8788[_0xd1d2('0x40')]:_0x499638[_0xd1d2('0x3c')];if(!_0x4a7375[_0xd1d2('0x3d')]['hasOwnProperty'](_0xd1d2('0x5d'))){_0x1d8788[_0xd1d2('0x25')]=qs[_0xd1d2('0x25')](_0x4a7375['query'][_0xd1d2('0x25')]);_0x1d8788[_0xd1d2('0x23')]=qs[_0xd1d2('0x23')](_0x4a7375[_0xd1d2('0x3d')][_0xd1d2('0x23')]);}_0x1d8788[_0xd1d2('0x5e')]=qs['sort'](_0x4a7375[_0xd1d2('0x3d')][_0xd1d2('0x44')]);_0x1d8788['where']=qs['filters'](_[_0xd1d2('0x46')](_0x4a7375[_0xd1d2('0x3d')],_0x499638[_0xd1d2('0x3f')]));_0x1d8788[_0xd1d2('0x45')]['MailQueueId']=_0xbf1e6e['id'];if(_0x4a7375[_0xd1d2('0x3d')][_0xd1d2('0x47')]){_0x1d8788[_0xd1d2('0x45')]=_[_0xd1d2('0x48')](_0x1d8788['where'],{'$or':_[_0xd1d2('0x36')](_0x1d8788[_0xd1d2('0x40')],function(_0x3128b2){var _0x572b55={};_0x572b55[_0x3128b2]={'$like':'%'+_0x4a7375[_0xd1d2('0x3d')][_0xd1d2('0x47')]+'%'};return _0x572b55;})});}_0x1d8788=_['merge']({},_0x1d8788,_0x4a7375[_0xd1d2('0x4e')]);return db[_0xd1d2('0x5c')][_0xd1d2('0x4a')](_0x1d8788);}})[_0xd1d2('0x2c')](function(_0x394bab){if(_0x394bab){return db['User'][_0xd1d2('0x5f')]({'where':{'id':_['map'](_0x394bab,'UserId'),'role':'agent'},'attributes':['id','name',_0xd1d2('0x60'),'updatedAt',_0xd1d2('0x61')]});}})['then'](function(_0x3451a0){if(_0x3451a0){return{'count':_0x3451a0[_0xd1d2('0x26')],'rows':_[_0xd1d2('0x36')](_0x3451a0[_0xd1d2('0x4b')],function(_0x2e0c0d){return{'membername':_0x2e0c0d[_0xd1d2('0x33')],'UserId':_0x2e0c0d['id'],'queue_name':_0x5ca467['name'],'MailQueueId':_0x5ca467['id'],'interface':util[_0xd1d2('0x62')](_0xd1d2('0x63'),_0xd1d2('0x64'),_0x2e0c0d[_0xd1d2('0x33')]),'penalty':0x0,'paused':_0x2e0c0d[_0xd1d2('0x60')],'createdAt':_0x2e0c0d[_0xd1d2('0x61')],'updatedAt':_0x2e0c0d[_0xd1d2('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd1d2('0x2c')](respondWithFilteredResult(_0x365352,_0x1d8788))[_0xd1d2('0x4c')](handleError(_0x365352,null));};exports[_0xd1d2('0x66')]=function(_0x48f5de,_0x4758d9,_0x428200){var _0x1db74b={};var _0x2eaf42={};var _0x50d373;var _0x4adcf8;return db[_0xd1d2('0x37')][_0xd1d2('0x5b')]({'where':{'id':_0x48f5de['params']['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x4758d9,null))[_0xd1d2('0x2c')](function(_0x53b36d){if(_0x53b36d){_0x50d373=_0x53b36d;_0x2eaf42['model']=_[_0xd1d2('0x3e')](db[_0xd1d2('0x67')][_0xd1d2('0x38')]);_0x2eaf42[_0xd1d2('0x3d')]=_[_0xd1d2('0x3e')](_0x48f5de[_0xd1d2('0x3d')]);_0x2eaf42[_0xd1d2('0x3f')]=_['intersection'](_0x2eaf42[_0xd1d2('0x3c')],_0x2eaf42[_0xd1d2('0x3d')]);_0x1db74b[_0xd1d2('0x40')]=_[_0xd1d2('0x41')](_0x2eaf42[_0xd1d2('0x3c')],qs[_0xd1d2('0x42')](_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x42')]));_0x1db74b[_0xd1d2('0x40')]=_0x1db74b[_0xd1d2('0x40')][_0xd1d2('0x4d')]?_0x1db74b[_0xd1d2('0x40')]:_0x2eaf42[_0xd1d2('0x3c')];_0x1db74b[_0xd1d2('0x5e')]=qs['sort'](_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x44')]);_0x1db74b[_0xd1d2('0x45')]=qs[_0xd1d2('0x3f')](_[_0xd1d2('0x46')](_0x48f5de[_0xd1d2('0x3d')],_0x2eaf42[_0xd1d2('0x3f')]));if(_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x47')]){_0x1db74b[_0xd1d2('0x45')]=_[_0xd1d2('0x48')](_0x1db74b[_0xd1d2('0x45')],{'$or':_[_0xd1d2('0x36')](_0x1db74b['attributes'],function(_0x369382){var _0x113370={};_0x113370[_0x369382]={'$like':'%'+_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x47')]+'%'};return _0x113370;})});}_0x1db74b=_[_0xd1d2('0x48')]({},_0x1db74b,_0x48f5de[_0xd1d2('0x4e')]);return _0x50d373[_0xd1d2('0x66')](_0x1db74b);}})[_0xd1d2('0x2c')](function(_0x28a351){if(_0x28a351){_0x4adcf8=_0x28a351[_0xd1d2('0x4d')];if(!_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x43')]('nolimit')){_0x1db74b[_0xd1d2('0x25')]=qs[_0xd1d2('0x25')](_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x25')]);_0x1db74b[_0xd1d2('0x23')]=qs['offset'](_0x48f5de[_0xd1d2('0x3d')][_0xd1d2('0x23')]);}return _0x50d373[_0xd1d2('0x66')](_0x1db74b);}})[_0xd1d2('0x2c')](function(_0x48f20e){if(_0x48f20e){return _0x48f20e?{'count':_0x4adcf8,'rows':_0x48f20e}:null;}})[_0xd1d2('0x2c')](respondWithResult(_0x4758d9,null))[_0xd1d2('0x4c')](handleError(_0x4758d9,null));};exports[_0xd1d2('0x68')]=function(_0x270d57,_0x39c9f1,_0x18bd6d){var _0x1aa0a5=_0x270d57['body'][_0xd1d2('0x69')];return db[_0xd1d2('0x67')][_0xd1d2('0x4a')]({'where':{'id':_0x1aa0a5},'attributes':['id'],'include':[{'model':db[_0xd1d2('0x6a')],'as':_0xd1d2('0x6b'),'attributes':['id',_0xd1d2('0x33'),_0xd1d2('0x6c'),_0xd1d2('0x6d'),_0xd1d2('0x6e')],'raw':!![]}]})[_0xd1d2('0x2c')](function(_0x1cad85){if(_0x1cad85){var _0x38f0c1=_[_0xd1d2('0x6f')](_0x1cad85,function(_0x38f8eb){var _0x4d71b0=_0x38f8eb[_0xd1d2('0x2e')]({'plain':!![]});return _0x4d71b0[_0xd1d2('0x6b')];});return db['MailQueue'][_0xd1d2('0x4f')]({'where':{'id':_0x270d57['params']['id']}})[_0xd1d2('0x2c')](function(_0x2b5f7d){return db[_0xd1d2('0x70')][_0xd1d2('0x71')](function(_0x2f586e){return _0x2b5f7d[_0xd1d2('0x68')](_0x1aa0a5,{'transaction':_0x2f586e})[_0xd1d2('0x2c')](function(){return BPromise[_0xd1d2('0x72')](_0x38f0c1,function(_0x4d9c04){return db['UserMailQueue'][_0xd1d2('0x73')]({'where':{'UserId':_0x4d9c04['id'],'MailQueueId':_0x270d57['params']['id']},'transaction':_0x2f586e});});})['then'](function(){_0x38f0c1[_0xd1d2('0x74')](function(_0x387b0b){socket['emit'](_0xd1d2('0x75'),{'UserId':_0x387b0b['id'],'MailQueueId':_0x2b5f7d['id']});});});});});}})[_0xd1d2('0x2c')](respondWithStatusCode(_0x39c9f1,null))[_0xd1d2('0x4c')](handleError(_0x39c9f1,null));};exports[_0xd1d2('0x76')]=function(_0x28c17a,_0x20ef9f,_0xb2c477){return db['Team'][_0xd1d2('0x4a')]({'where':{'id':_0x28c17a['query'][_0xd1d2('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd1d2('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xd1d2('0x2c')](handleEntityNotFound(_0x20ef9f,null))[_0xd1d2('0x2c')](function(_0x274eb7){var _0x431247=_[_0xd1d2('0x36')](_0x274eb7,'id');var _0x3bf602=[];var _0x5a9620=[];var _0xf9b866=squel[_0xd1d2('0x77')]();_0xf9b866[_0xd1d2('0x78')](_0xd1d2('0x79'))['from'](_0xd1d2('0x7a'),'tq')[_0xd1d2('0x7b')](_0xd1d2('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd1d2('0x45')](_0xd1d2('0x7d'),_0x28c17a[_0xd1d2('0x58')]['id']);for(var _0x226f98=0x0;_0x226f98<_0x274eb7[_0xd1d2('0x4d')];_0x226f98+=0x1){let _0x4c50f5=_0x274eb7[_0x226f98];for(var _0x2b1843=0x0;_0x2b1843<_0x4c50f5[_0xd1d2('0x6b')]['length'];_0x2b1843+=0x1){let _0x15d3c5=_0x4c50f5[_0xd1d2('0x6b')][_0x2b1843];var _0x3e2968=_0xf9b866[_0xd1d2('0x7e')]();_0x3e2968[_0xd1d2('0x45')]('ut.UserId\x20=\x20?',_0x15d3c5['id']);_0x5a9620[_0xd1d2('0x7f')](db[_0xd1d2('0x70')][_0xd1d2('0x3d')](_0x3e2968[_0xd1d2('0x80')](),{'type':db[_0xd1d2('0x70')][_0xd1d2('0x81')][_0xd1d2('0x82')]})['then'](function(_0x402a1d){if(_0x402a1d[_0xd1d2('0x4d')]===0x1){return _0x15d3c5['id'];}else{var _0x423498=_['every'](_[_0xd1d2('0x36')](_0x402a1d,_0xd1d2('0x83')),function(_0x41729c){return _[_0xd1d2('0x84')](_0x431247,_0x41729c);});if(_0x423498){return _0x15d3c5['id'];}}}));}}return BPromise['all'](_0x5a9620)[_0xd1d2('0x2c')](function(_0x1f03f0){_0x3bf602=_(_0x3bf602)['union'](_0x1f03f0)['compact']()[_0xd1d2('0x85')]();return db['MailQueue'][_0xd1d2('0x4f')]({'where':{'id':_0x28c17a[_0xd1d2('0x58')]['id']}})['then'](function(_0x51464a){return db[_0xd1d2('0x70')]['transaction'](function(_0x22c9b1){return _0x51464a['removeTeams'](_0x28c17a['query'][_0xd1d2('0x69')],{'transaction':_0x22c9b1})[_0xd1d2('0x2c')](function(){if(!_[_0xd1d2('0x86')](_0x3bf602)){return _0x51464a[_0xd1d2('0x87')](_0x3bf602,{'transaction':_0x22c9b1});}})[_0xd1d2('0x2c')](function(){_0x3bf602[_0xd1d2('0x74')](function(_0x548727){socket['emit'](_0xd1d2('0x88'),{'UserId':_0x548727,'MailQueueId':_0x51464a['id']});});});});});});})[_0xd1d2('0x2c')](respondWithStatusCode(_0x20ef9f,null))[_0xd1d2('0x4c')](handleError(_0x20ef9f,null));};exports[_0xd1d2('0x89')]=function(_0x39ab07,_0x269896,_0x156adf){return db['MailQueue'][_0xd1d2('0x4f')]({'where':{'id':_0x39ab07['params']['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x269896,null))[_0xd1d2('0x2c')](function(_0x53cef6){if(_0x53cef6){return _0x53cef6[_0xd1d2('0x89')](_0x39ab07[_0xd1d2('0x51')][_0xd1d2('0x69')],_[_0xd1d2('0x8a')](_0x39ab07[_0xd1d2('0x51')],[_0xd1d2('0x69'),'id'])||{})[_0xd1d2('0x8b')](function(_0x714601){for(var _0x134817=0x0;_0x134817<_0x39ab07[_0xd1d2('0x51')][_0xd1d2('0x69')][_0xd1d2('0x4d')];_0x134817+=0x1){socket['emit'](_0xd1d2('0x75'),{'UserId':Number(_0x39ab07[_0xd1d2('0x51')][_0xd1d2('0x69')][_0x134817]),'MailQueueId':Number(_0x39ab07[_0xd1d2('0x58')]['id'])});}return _0x714601;});}})[_0xd1d2('0x2c')](respondWithResult(_0x269896,null))[_0xd1d2('0x4c')](handleError(_0x269896,null));};exports[_0xd1d2('0x87')]=function(_0x3d069c,_0xc10626,_0xa22836){return db[_0xd1d2('0x37')][_0xd1d2('0x4f')]({'where':{'id':_0x3d069c[_0xd1d2('0x58')]['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0xc10626,null))[_0xd1d2('0x2c')](function(_0x93ebcd){if(_0x93ebcd){return _0x93ebcd['removeAgents'](_0x3d069c[_0xd1d2('0x3d')]['ids'])[_0xd1d2('0x2c')](function(){if(_[_0xd1d2('0x8c')](_0x3d069c[_0xd1d2('0x3d')][_0xd1d2('0x69')])){for(var _0x3e27ac=0x0;_0x3e27ac<_0x3d069c[_0xd1d2('0x3d')][_0xd1d2('0x69')][_0xd1d2('0x4d')];_0x3e27ac+=0x1){socket[_0xd1d2('0x8d')]('userMailQueue:remove',{'UserId':Number(_0x3d069c['query']['ids'][_0x3e27ac]),'MailQueueId':Number(_0x3d069c[_0xd1d2('0x58')]['id'])});}}else{socket[_0xd1d2('0x8d')](_0xd1d2('0x88'),{'UserId':Number(_0x3d069c['query']['ids']),'MailQueueId':Number(_0x3d069c[_0xd1d2('0x58')]['id'])});}});}})[_0xd1d2('0x2c')](respondWithStatusCode(_0xc10626,null))[_0xd1d2('0x4c')](handleError(_0xc10626,null));};exports['getAgents']=function(_0x2e8029,_0x5d8f7e,_0x1d8c59){var _0x4dc82d={};var _0x125a70={};var _0x1df81e;var _0x13f171;return db[_0xd1d2('0x37')][_0xd1d2('0x5b')]({'where':{'id':_0x2e8029['params']['id']}})[_0xd1d2('0x2c')](handleEntityNotFound(_0x5d8f7e,null))['then'](function(_0x59a836){if(_0x59a836){_0x1df81e=_0x59a836;_0x125a70[_0xd1d2('0x3c')]=_[_0xd1d2('0x3e')](db['User']['rawAttributes']);_0x125a70[_0xd1d2('0x3d')]=_[_0xd1d2('0x3e')](_0x2e8029[_0xd1d2('0x3d')]);_0x125a70['filters']=_['intersection'](_0x125a70[_0xd1d2('0x3c')],_0x125a70[_0xd1d2('0x3d')]);_0x4dc82d[_0xd1d2('0x40')]=_[_0xd1d2('0x41')](_0x125a70[_0xd1d2('0x3c')],qs[_0xd1d2('0x42')](_0x2e8029[_0xd1d2('0x3d')][_0xd1d2('0x42')]));_0x4dc82d['attributes']=_0x4dc82d[_0xd1d2('0x40')][_0xd1d2('0x4d')]?_0x4dc82d['attributes']:_0x125a70[_0xd1d2('0x3c')];_0x4dc82d[_0xd1d2('0x5e')]=qs[_0xd1d2('0x44')](_0x2e8029[_0xd1d2('0x3d')]['sort']);_0x4dc82d[_0xd1d2('0x45')]=qs['filters'](_[_0xd1d2('0x46')](_0x2e8029[_0xd1d2('0x3d')],_0x125a70['filters']));if(_0x2e8029[_0xd1d2('0x3d')][_0xd1d2('0x47')]){_0x4dc82d['where']=_[_0xd1d2('0x48')](_0x4dc82d['where'],{'$or':_[_0xd1d2('0x36')](_0x4dc82d[_0xd1d2('0x40')],function(_0x51bcdb){var _0x27c8ee={};_0x27c8ee[_0x51bcdb]={'$like':'%'+_0x2e8029[_0xd1d2('0x3d')][_0xd1d2('0x47')]+'%'};return _0x27c8ee;})});}_0x4dc82d=_[_0xd1d2('0x48')]({},_0x4dc82d,_0x2e8029['options']);return _0x1df81e['getAgents'](_0x4dc82d);}})['then'](function(_0x545c36){if(_0x545c36){_0x13f171=_0x545c36[_0xd1d2('0x4d')];if(!_0x2e8029[_0xd1d2('0x3d')][_0xd1d2('0x43')](_0xd1d2('0x5d'))){_0x4dc82d['limit']=qs[_0xd1d2('0x25')](_0x2e8029['query'][_0xd1d2('0x25')]);_0x4dc82d[_0xd1d2('0x23')]=qs[_0xd1d2('0x23')](_0x2e8029[_0xd1d2('0x3d')][_0xd1d2('0x23')]);}return _0x1df81e['getAgents'](_0x4dc82d);}})[_0xd1d2('0x2c')](function(_0x4bbf0d){if(_0x4bbf0d){return _0x4bbf0d?{'count':_0x13f171,'rows':_0x4bbf0d}:null;}})['then'](respondWithResult(_0x5d8f7e,null))[_0xd1d2('0x4c')](handleError(_0x5d8f7e,null));};
\ No newline at end of file
index a22595b..e9357e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f2=['setMaxListeners','remove','emit','hasOwnProperty','hook','../../mysqldb','MailQueue'];(function(_0x5afc83,_0x5a68cf){var _0x4aeb6b=function(_0x4e0b74){while(--_0x4e0b74){_0x5afc83['push'](_0x5afc83['shift']());}};_0x4aeb6b(++_0x5a68cf);}(_0xf7f2,0x1cc));var _0x2f7f=function(_0x127b15,_0x11a2a9){_0x127b15=_0x127b15-0x0;var _0x3fe772=_0xf7f2[_0x127b15];return _0x3fe772;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x2f7f('0x0'))['db'][_0x2f7f('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2f7f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2f7f('0x3')};function emitEvent(_0x1112cc){return function(_0x31551f,_0x2e55a6,_0x281d66){MailQueueEvents[_0x2f7f('0x4')](_0x1112cc+':'+_0x31551f['id'],_0x31551f);MailQueueEvents[_0x2f7f('0x4')](_0x1112cc,_0x31551f);_0x281d66(null);};}for(var e in events){if(events[_0x2f7f('0x5')](e)){var event=events[e];MailQueue[_0x2f7f('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x02d4=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3e1095,_0x5be2b4){var _0x46fd49=function(_0x386bdf){while(--_0x386bdf){_0x3e1095['push'](_0x3e1095['shift']());}};_0x46fd49(++_0x5be2b4);}(_0x02d4,0x144));var _0x402d=function(_0x30149b,_0x3bb30c){_0x30149b=_0x30149b-0x0;var _0x50b71d=_0x02d4[_0x30149b];return _0x50b71d;};'use strict';var EventEmitter=require(_0x402d('0x0'));var MailQueue=require(_0x402d('0x1'))['db'][_0x402d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x402d('0x3')](0x0);var events={'afterCreate':_0x402d('0x4'),'afterUpdate':_0x402d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15bb8b){return function(_0x34253b,_0x2b4ad1,_0x107e71){MailQueueEvents['emit'](_0x15bb8b+':'+_0x34253b['id'],_0x34253b);MailQueueEvents[_0x402d('0x6')](_0x15bb8b,_0x34253b);_0x107e71(null);};}for(var e in events){if(events[_0x402d('0x7')](e)){var event=events[e];MailQueue[_0x402d('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index 72912f6..1214d57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd559=['../../config/environment','define','MailQueue','mail_queues','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd559,0x1a2));var _0x9d55=function(_0x30fb53,_0xb7e79e){_0x30fb53=_0x30fb53-0x0;var _0x3c3aad=_0xd559[_0x30fb53];return _0x3c3aad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d55('0x0'))('api');var moment=require(_0x9d55('0x1'));var BPromise=require(_0x9d55('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d55('0x3'));var rimraf=require(_0x9d55('0x4'));var config=require(_0x9d55('0x5'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x34a316,_0x3de3c6){return _0x34a316[_0x9d55('0x6')](_0x9d55('0x7'),attributes,{'tableName':_0x9d55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9477=['moment','bluebird','path','./mailQueue.attributes','MailQueue','util','../../config/logger','api'];(function(_0x5cc36b,_0x34020c){var _0x4dfc35=function(_0x256479){while(--_0x256479){_0x5cc36b['push'](_0x5cc36b['shift']());}};_0x4dfc35(++_0x34020c);}(_0x9477,0x65));var _0x7947=function(_0x3cd142,_0x46099f){_0x3cd142=_0x3cd142-0x0;var _0x42abde=_0x9477[_0x3cd142];return _0x42abde;};'use strict';var _=require('lodash');var util=require(_0x7947('0x0'));var logger=require(_0x7947('0x1'))(_0x7947('0x2'));var moment=require(_0x7947('0x3'));var BPromise=require(_0x7947('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7947('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7947('0x6'));module['exports']=function(_0x3bfad0,_0x1bd453){return _0x3bfad0['define'](_0x7947('0x7'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b63b60c..df179bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca2b=['../../config/environment','client','redis','defaults','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','model','map','ShowMailQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1437a5,_0x4cf0f9){var _0x5c29f0=function(_0x5204a7){while(--_0x5204a7){_0x1437a5['push'](_0x1437a5['shift']());}};_0x5c29f0(++_0x4cf0f9);}(_0xca2b,0x156));var _0xbca2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xca2b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xbca2('0x0'));var util=require(_0xbca2('0x1'));var moment=require(_0xbca2('0x2'));var BPromise=require(_0xbca2('0x3'));var rs=require(_0xbca2('0x4'));var fs=require('fs');var Redis=require(_0xbca2('0x5'));var db=require(_0xbca2('0x6'))['db'];var utils=require(_0xbca2('0x7'));var logger=require('../../config/logger')(_0xbca2('0x8'));var config=require(_0xbca2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbca2('0xa')]['http']({'port':0x232a});config[_0xbca2('0xb')]=_[_0xbca2('0xc')](config[_0xbca2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbca2('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3216c6,_0x8116b2,_0x1b3903){return new BPromise(function(_0x24cec,_0x1172e8){return client[_0xbca2('0xd')](_0x3216c6,_0x1b3903)[_0xbca2('0xe')](function(_0x3b0f66){logger[_0xbca2('0xf')](_0xbca2('0x10'),_0x8116b2,_0xbca2('0x11'));logger[_0xbca2('0x12')](_0xbca2('0x13'),_0x8116b2,'request\x20sent',JSON[_0xbca2('0x14')](_0x3b0f66));if(_0x3b0f66[_0xbca2('0x15')]){if(_0x3b0f66[_0xbca2('0x15')][_0xbca2('0x16')]===0x1f4){logger[_0xbca2('0x15')](_0xbca2('0x10'),_0x8116b2,_0x3b0f66[_0xbca2('0x15')][_0xbca2('0x17')]);return _0x1172e8(_0x3b0f66[_0xbca2('0x15')]['message']);}logger['error'](_0xbca2('0x10'),_0x8116b2,_0x3b0f66[_0xbca2('0x15')]['message']);return _0x24cec(_0x3b0f66[_0xbca2('0x15')][_0xbca2('0x17')]);}else{logger[_0xbca2('0xf')]('MailQueue,\x20%s,\x20%s',_0x8116b2,_0xbca2('0x11'));_0x24cec(_0x3b0f66[_0xbca2('0x18')][_0xbca2('0x17')]);}})[_0xbca2('0x19')](function(_0x22445a){logger['error']('MailQueue,\x20%s,\x20%s',_0x8116b2,_0x22445a);_0x1172e8(_0x22445a);});});}exports[_0xbca2('0x1a')]=function(_0x1eed54){var _0x5dba8d=this;return new Promise(function(_0x2be40c,_0x109b44){return db[_0xbca2('0x1b')][_0xbca2('0x1c')]({'raw':_0x1eed54[_0xbca2('0x1d')]?_0x1eed54[_0xbca2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1eed54[_0xbca2('0x1d')]?_0x1eed54[_0xbca2('0x1d')][_0xbca2('0x1e')]||null:null,'attributes':_0x1eed54[_0xbca2('0x1d')]?_0x1eed54[_0xbca2('0x1d')][_0xbca2('0x1f')]||null:null,'limit':_0x1eed54[_0xbca2('0x1d')]?_0x1eed54[_0xbca2('0x1d')][_0xbca2('0x20')]||null:null,'include':_0x1eed54[_0xbca2('0x1d')]?_0x1eed54[_0xbca2('0x1d')][_0xbca2('0x21')]?_['map'](_0x1eed54[_0xbca2('0x1d')][_0xbca2('0x21')],function(_0x3119dd){return{'model':db[_0x3119dd[_0xbca2('0x22')]],'as':_0x3119dd['as'],'attributes':_0x3119dd[_0xbca2('0x1f')],'include':_0x3119dd[_0xbca2('0x21')]?_[_0xbca2('0x23')](_0x3119dd['include'],function(_0x2810b0){return{'model':db[_0x2810b0[_0xbca2('0x22')]],'as':_0x2810b0['as'],'attributes':_0x2810b0[_0xbca2('0x1f')],'include':_0x2810b0[_0xbca2('0x21')]?_[_0xbca2('0x23')](_0x2810b0[_0xbca2('0x21')],function(_0xc7d89f){return{'model':db[_0xc7d89f[_0xbca2('0x22')]],'as':_0xc7d89f['as'],'attributes':_0xc7d89f[_0xbca2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbca2('0xe')](function(_0x4f2578){logger[_0xbca2('0xf')]('GetMailQueue',_0x1eed54);logger[_0xbca2('0x12')]('GetMailQueue',_0x1eed54,JSON['stringify'](_0x4f2578));_0x2be40c(_0x4f2578);})[_0xbca2('0x19')](function(_0x5de820){logger[_0xbca2('0x15')](_0xbca2('0x1a'),_0x5de820['message'],_0x1eed54);_0x109b44(_0x5dba8d['error'](0x1f4,_0x5de820[_0xbca2('0x17')]));});});};exports[_0xbca2('0x24')]=function(_0x81df09){var _0x2b647b=this;return new Promise(function(_0x2200c6,_0x127ec8){return db[_0xbca2('0x1b')][_0xbca2('0x25')]({'raw':_0x81df09[_0xbca2('0x1d')]?_0x81df09[_0xbca2('0x1d')][_0xbca2('0x26')]===undefined?!![]:![]:!![],'where':_0x81df09['options']?_0x81df09[_0xbca2('0x1d')][_0xbca2('0x1e')]||null:null,'attributes':_0x81df09[_0xbca2('0x1d')]?_0x81df09['options'][_0xbca2('0x1f')]||null:null,'include':_0x81df09[_0xbca2('0x1d')]?_0x81df09[_0xbca2('0x1d')][_0xbca2('0x21')]?_[_0xbca2('0x23')](_0x81df09[_0xbca2('0x1d')][_0xbca2('0x21')],function(_0x45a237){return{'model':db[_0x45a237[_0xbca2('0x22')]],'as':_0x45a237['as'],'attributes':_0x45a237[_0xbca2('0x1f')],'include':_0x45a237[_0xbca2('0x21')]?_['map'](_0x45a237['include'],function(_0x4bb723){return{'model':db[_0x4bb723[_0xbca2('0x22')]],'as':_0x4bb723['as'],'attributes':_0x4bb723[_0xbca2('0x1f')],'include':_0x4bb723[_0xbca2('0x21')]?_[_0xbca2('0x23')](_0x4bb723['include'],function(_0x446ef6){return{'model':db[_0x446ef6[_0xbca2('0x22')]],'as':_0x446ef6['as'],'attributes':_0x446ef6[_0xbca2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbca2('0xe')](function(_0x453928){logger[_0xbca2('0xf')](_0xbca2('0x24'),_0x81df09);logger[_0xbca2('0x12')](_0xbca2('0x24'),_0x81df09,JSON[_0xbca2('0x14')](_0x453928));_0x2200c6(_0x453928);})[_0xbca2('0x19')](function(_0x447ac6){logger['error'](_0xbca2('0x24'),_0x447ac6['message'],_0x81df09);_0x127ec8(_0x2b647b[_0xbca2('0x15')](0x1f4,_0x447ac6[_0xbca2('0x17')]));});});};
\ No newline at end of file
+var _0x5a8c=['info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','include','map','model','then','GetMailQueue','ShowMailQueue','MailQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request'];(function(_0xa777d6,_0x4f8b44){var _0x3f6906=function(_0x4f41f0){while(--_0x4f41f0){_0xa777d6['push'](_0xa777d6['shift']());}};_0x3f6906(++_0x4f8b44);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x2cba1a,_0x13f55b){_0x2cba1a=_0x2cba1a-0x0;var _0x47e4ab=_0x5a8c[_0x2cba1a];return _0x47e4ab;};'use strict';var _=require(_0xc5a8('0x0'));var util=require(_0xc5a8('0x1'));var moment=require('moment');var BPromise=require(_0xc5a8('0x2'));var rs=require(_0xc5a8('0x3'));var fs=require('fs');var Redis=require(_0xc5a8('0x4'));var db=require(_0xc5a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5a8('0x6'))(_0xc5a8('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5a8('0x8'));var client=jayson[_0xc5a8('0x9')][_0xc5a8('0xa')]({'port':0x232a});config[_0xc5a8('0xb')]=_[_0xc5a8('0xc')](config[_0xc5a8('0xb')],{'host':_0xc5a8('0xd'),'port':0x18eb});var socket=require(_0xc5a8('0xe'))(new Redis(config[_0xc5a8('0xb')]));require(_0xc5a8('0xf'))[_0xc5a8('0x10')](socket);function respondWithRpcPromise(_0x4e0029,_0x42487e,_0x59c442){return new BPromise(function(_0x170c34,_0xc775a6){return client[_0xc5a8('0x11')](_0x4e0029,_0x59c442)['then'](function(_0x4b28d8){logger[_0xc5a8('0x12')](_0xc5a8('0x13'),_0x42487e,_0xc5a8('0x14'));logger[_0xc5a8('0x15')](_0xc5a8('0x16'),_0x42487e,'request\x20sent',JSON[_0xc5a8('0x17')](_0x4b28d8));if(_0x4b28d8[_0xc5a8('0x18')]){if(_0x4b28d8[_0xc5a8('0x18')][_0xc5a8('0x19')]===0x1f4){logger[_0xc5a8('0x18')](_0xc5a8('0x13'),_0x42487e,_0x4b28d8[_0xc5a8('0x18')][_0xc5a8('0x1a')]);return _0xc775a6(_0x4b28d8[_0xc5a8('0x18')][_0xc5a8('0x1a')]);}logger[_0xc5a8('0x18')](_0xc5a8('0x13'),_0x42487e,_0x4b28d8[_0xc5a8('0x18')][_0xc5a8('0x1a')]);return _0x170c34(_0x4b28d8[_0xc5a8('0x18')][_0xc5a8('0x1a')]);}else{logger[_0xc5a8('0x12')](_0xc5a8('0x13'),_0x42487e,'request\x20sent');_0x170c34(_0x4b28d8[_0xc5a8('0x1b')][_0xc5a8('0x1a')]);}})[_0xc5a8('0x1c')](function(_0x1c2967){logger['error'](_0xc5a8('0x13'),_0x42487e,_0x1c2967);_0xc775a6(_0x1c2967);});});}exports['GetMailQueue']=function(_0x36cc16){var _0x178912=this;return new Promise(function(_0x35ac5a,_0x52ca0a){return db['MailQueue']['findAll']({'raw':_0x36cc16[_0xc5a8('0x1d')]?_0x36cc16[_0xc5a8('0x1d')][_0xc5a8('0x1e')]===undefined?!![]:![]:!![],'where':_0x36cc16[_0xc5a8('0x1d')]?_0x36cc16['options'][_0xc5a8('0x1f')]||null:null,'attributes':_0x36cc16[_0xc5a8('0x1d')]?_0x36cc16[_0xc5a8('0x1d')][_0xc5a8('0x20')]||null:null,'limit':_0x36cc16['options']?_0x36cc16[_0xc5a8('0x1d')]['limit']||null:null,'include':_0x36cc16[_0xc5a8('0x1d')]?_0x36cc16[_0xc5a8('0x1d')][_0xc5a8('0x21')]?_[_0xc5a8('0x22')](_0x36cc16[_0xc5a8('0x1d')][_0xc5a8('0x21')],function(_0x459694){return{'model':db[_0x459694[_0xc5a8('0x23')]],'as':_0x459694['as'],'attributes':_0x459694[_0xc5a8('0x20')],'include':_0x459694[_0xc5a8('0x21')]?_[_0xc5a8('0x22')](_0x459694[_0xc5a8('0x21')],function(_0x165ee0){return{'model':db[_0x165ee0['model']],'as':_0x165ee0['as'],'attributes':_0x165ee0[_0xc5a8('0x20')],'include':_0x165ee0['include']?_[_0xc5a8('0x22')](_0x165ee0['include'],function(_0x19e4f4){return{'model':db[_0x19e4f4[_0xc5a8('0x23')]],'as':_0x19e4f4['as'],'attributes':_0x19e4f4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5a8('0x24')](function(_0x2aa6d6){logger[_0xc5a8('0x12')](_0xc5a8('0x25'),_0x36cc16);logger[_0xc5a8('0x15')](_0xc5a8('0x25'),_0x36cc16,JSON[_0xc5a8('0x17')](_0x2aa6d6));_0x35ac5a(_0x2aa6d6);})[_0xc5a8('0x1c')](function(_0x106a0b){logger[_0xc5a8('0x18')](_0xc5a8('0x25'),_0x106a0b[_0xc5a8('0x1a')],_0x36cc16);_0x52ca0a(_0x178912[_0xc5a8('0x18')](0x1f4,_0x106a0b[_0xc5a8('0x1a')]));});});};exports[_0xc5a8('0x26')]=function(_0x25ebbd){var _0x702dba=this;return new Promise(function(_0x11a820,_0x450e89){return db[_0xc5a8('0x27')][_0xc5a8('0x28')]({'raw':_0x25ebbd[_0xc5a8('0x1d')]?_0x25ebbd[_0xc5a8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x25ebbd['options']?_0x25ebbd[_0xc5a8('0x1d')][_0xc5a8('0x1f')]||null:null,'attributes':_0x25ebbd[_0xc5a8('0x1d')]?_0x25ebbd['options'][_0xc5a8('0x20')]||null:null,'include':_0x25ebbd[_0xc5a8('0x1d')]?_0x25ebbd[_0xc5a8('0x1d')][_0xc5a8('0x21')]?_['map'](_0x25ebbd['options']['include'],function(_0x148028){return{'model':db[_0x148028[_0xc5a8('0x23')]],'as':_0x148028['as'],'attributes':_0x148028[_0xc5a8('0x20')],'include':_0x148028[_0xc5a8('0x21')]?_[_0xc5a8('0x22')](_0x148028['include'],function(_0x1f8ded){return{'model':db[_0x1f8ded[_0xc5a8('0x23')]],'as':_0x1f8ded['as'],'attributes':_0x1f8ded['attributes'],'include':_0x1f8ded[_0xc5a8('0x21')]?_['map'](_0x1f8ded[_0xc5a8('0x21')],function(_0x44a2da){return{'model':db[_0x44a2da[_0xc5a8('0x23')]],'as':_0x44a2da['as'],'attributes':_0x44a2da[_0xc5a8('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc5a8('0x24')](function(_0x1acdff){logger['info'](_0xc5a8('0x26'),_0x25ebbd);logger[_0xc5a8('0x15')](_0xc5a8('0x26'),_0x25ebbd,JSON[_0xc5a8('0x17')](_0x1acdff));_0x11a820(_0x1acdff);})[_0xc5a8('0x1c')](function(_0x1acce3){logger[_0xc5a8('0x18')](_0xc5a8('0x26'),_0x1acce3['message'],_0x25ebbd);_0x450e89(_0x702dba[_0xc5a8('0x18')](0x1f4,_0x1acce3[_0xc5a8('0x1a')]));});});};
\ No newline at end of file
index a2c672f..2028186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe65c=['mailQueue:','./mailQueue.events','save','remove','update','register','length'];(function(_0x19ad03,_0x49e070){var _0x1a7a97=function(_0x437fb0){while(--_0x437fb0){_0x19ad03['push'](_0x19ad03['shift']());}};_0x1a7a97(++_0x49e070);}(_0xe65c,0x19e));var _0xce65=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0xe65c[_0x14e9f0];return _0xa63f7e;};'use strict';var MailQueueEvents=require(_0xce65('0x0'));var events=[_0xce65('0x1'),_0xce65('0x2'),_0xce65('0x3')];function createListener(_0x3772f2,_0x48ad8f){return function(_0x39be2a){_0x48ad8f['emit'](_0x3772f2,_0x39be2a);};}function removeListener(_0x2fb76b,_0x2b0f76){return function(){MailQueueEvents['removeListener'](_0x2fb76b,_0x2b0f76);};}exports[_0xce65('0x4')]=function(_0x330dcc){for(var _0xa52a98=0x0,_0x253f90=events[_0xce65('0x5')];_0xa52a98<_0x253f90;_0xa52a98++){var _0x4d4cb4=events[_0xa52a98];var _0x4e51db=createListener(_0xce65('0x6')+_0x4d4cb4,_0x330dcc);MailQueueEvents['on'](_0x4d4cb4,_0x4e51db);}};
\ No newline at end of file
+var _0xd876=['removeListener','register','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd876,0x11b));var _0x6d87=function(_0x135da7,_0x4bf931){_0x135da7=_0x135da7-0x0;var _0x5cee92=_0xd876[_0x135da7];return _0x5cee92;};'use strict';var MailQueueEvents=require(_0x6d87('0x0'));var events=['save',_0x6d87('0x1'),_0x6d87('0x2')];function createListener(_0x508948,_0x5a48b0){return function(_0x2263fd){_0x5a48b0[_0x6d87('0x3')](_0x508948,_0x2263fd);};}function removeListener(_0x3d239a,_0x3e4359){return function(){MailQueueEvents[_0x6d87('0x4')](_0x3d239a,_0x3e4359);};}exports[_0x6d87('0x5')]=function(_0xfafc2c){for(var _0xabcbe6=0x0,_0x444971=events['length'];_0xabcbe6<_0x444971;_0xabcbe6++){var _0x561107=events[_0xabcbe6];var _0x45c084=createListener(_0x6d87('0x6')+_0x561107,_0xfafc2c);MailQueueEvents['on'](_0x561107,_0x45c084);}};
\ No newline at end of file
index 97a7046..46834ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf25b=['./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xf25b,0x148));var _0xbf25=function(_0x4ee7e1,_0x400dbf){_0x4ee7e1=_0x4ee7e1-0x0;var _0x1ea8a2=_0xf25b[_0x4ee7e1];return _0x1ea8a2;};'use strict';var multer=require(_0xbf25('0x0'));var util=require(_0xbf25('0x1'));var path=require(_0xbf25('0x2'));var timeout=require(_0xbf25('0x3'));var express=require(_0xbf25('0x4'));var router=express[_0xbf25('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf25('0x6'));var config=require(_0xbf25('0x7'));var controller=require(_0xbf25('0x8'));router[_0xbf25('0x9')]('/',auth[_0xbf25('0xa')](),controller[_0xbf25('0xb')]);router[_0xbf25('0x9')](_0xbf25('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbf25('0xd'),auth[_0xbf25('0xa')](),controller[_0xbf25('0xe')]);router[_0xbf25('0xf')]('/',auth[_0xbf25('0xa')](),controller[_0xbf25('0x10')]);router['put'](_0xbf25('0xd'),auth[_0xbf25('0xa')](),controller[_0xbf25('0x11')]);router[_0xbf25('0x12')](_0xbf25('0xd'),auth[_0xbf25('0xa')](),controller[_0xbf25('0x13')]);module[_0xbf25('0x14')]=router;
\ No newline at end of file
+var _0x243d=['/describe','isAuthenticated','describe','/:id','create','put','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','index'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x243d,0xd3));var _0xd243=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x243d[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xd243('0x0'));var util=require(_0xd243('0x1'));var path=require('path');var timeout=require(_0xd243('0x2'));var express=require(_0xd243('0x3'));var router=express[_0xd243('0x4')]();var fs_extra=require(_0xd243('0x5'));var auth=require(_0xd243('0x6'));var interaction=require(_0xd243('0x7'));var config=require('../../config/environment');var controller=require(_0xd243('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd243('0x9')]);router['get'](_0xd243('0xa'),auth[_0xd243('0xb')](),controller[_0xd243('0xc')]);router['get'](_0xd243('0xd'),auth[_0xd243('0xb')](),controller['show']);router['post']('/',auth[_0xd243('0xb')](),controller[_0xd243('0xe')]);router[_0xd243('0xf')](_0xd243('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd243('0xd'),auth[_0xd243('0xb')](),controller[_0xd243('0x10')]);module['exports']=router;
\ No newline at end of file
index 11180f5..811869b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x291c=['sequelize','exports','STRING','DATE','moment'];(function(_0x3a05c8,_0x2d152d){var _0x3523e9=function(_0x592a05){while(--_0x592a05){_0x3a05c8['push'](_0x3a05c8['shift']());}};_0x3523e9(++_0x2d152d);}(_0x291c,0xe0));var _0xc291=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x291c[_0x1cc8fe];return _0x230054;};'use strict';var moment=require(_0xc291('0x0'));var Sequelize=require(_0xc291('0x1'));module[_0xc291('0x2')]={'uniqueid':{'type':Sequelize[_0xc291('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc291('0x4')]},'leaveAt':{'type':Sequelize[_0xc291('0x4')]},'acceptAt':{'type':Sequelize[_0xc291('0x4')]},'exitAt':{'type':Sequelize[_0xc291('0x4')]},'reason':{'type':Sequelize[_0xc291('0x3')]}};
\ No newline at end of file
+var _0x3a29=['STRING','DATE','moment'];(function(_0x35e77e,_0x1be054){var _0xa24ec=function(_0x356ceb){while(--_0x356ceb){_0x35e77e['push'](_0x35e77e['shift']());}};_0xa24ec(++_0x1be054);}(_0x3a29,0x101));var _0x93a2=function(_0x48b88f,_0x2e1e94){_0x48b88f=_0x48b88f-0x0;var _0x34d441=_0x3a29[_0x48b88f];return _0x34d441;};'use strict';var moment=require(_0x93a2('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x93a2('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x93a2('0x1')]},'joinAt':{'type':Sequelize[_0x93a2('0x2')]},'leaveAt':{'type':Sequelize[_0x93a2('0x2')]},'acceptAt':{'type':Sequelize[_0x93a2('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x93a2('0x1')]}};
\ No newline at end of file
index 7dad65d..a950ae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a55=['eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','create','body','find','describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6a55,0xdb));var _0x56a5=function(_0x8bf471,_0x2e9da0){_0x8bf471=_0x8bf471-0x0;var _0x3d93d7=_0x6a55[_0x8bf471];return _0x3d93d7;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x23')]();});}};}function handleEntityNotFound(_0xcf212,_0x2f203f){return function(_0x460bc2){if(!_0x460bc2){_0xcf212['sendStatus'](0x194);}return _0x460bc2;};}function handleError(_0x5c76a7,_0x2d8e68){_0x2d8e68=_0x2d8e68||0x1f4;return function(_0x42cd45){logger[_0x56a5('0x24')](_0x42cd45[_0x56a5('0x25')]);if(_0x42cd45['name']){delete _0x42cd45[_0x56a5('0x26')];}_0x5c76a7['status'](_0x2d8e68)[_0x56a5('0x27')](_0x42cd45);};}exports[_0x56a5('0x28')]=function(_0x1b27b5,_0x284ee5){var _0x4e7afd={},_0x3b55e6={},_0x1f7aeb={'count':0x0,'rows':[]};var _0x178f11=_['map'](db[_0x56a5('0x29')][_0x56a5('0x2a')],function(_0xeb4378){return{'name':_0xeb4378[_0x56a5('0x2b')],'type':_0xeb4378[_0x56a5('0x2c')]['key']};});_0x3b55e6[_0x56a5('0x2d')]=_[_0x56a5('0x2e')](_0x178f11,_0x56a5('0x26'));_0x3b55e6[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x1b27b5['query']);_0x3b55e6['filters']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],_0x3b55e6[_0x56a5('0x2f')]);_0x4e7afd['attributes']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],qs['fields'](_0x1b27b5['query']['fields']));_0x4e7afd['attributes']=_0x4e7afd[_0x56a5('0x32')][_0x56a5('0x33')]?_0x4e7afd[_0x56a5('0x32')]:_0x3b55e6['model'];if(!_0x1b27b5[_0x56a5('0x2f')]['hasOwnProperty'](_0x56a5('0x34'))){_0x4e7afd[_0x56a5('0x1d')]=qs['limit'](_0x1b27b5[_0x56a5('0x2f')]['limit']);_0x4e7afd[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x1b27b5[_0x56a5('0x2f')]['offset']);}_0x4e7afd[_0x56a5('0x35')]=qs[_0x56a5('0x36')](_0x1b27b5[_0x56a5('0x2f')]['sort']);_0x4e7afd[_0x56a5('0x37')]=qs[_0x56a5('0x38')](_[_0x56a5('0x39')](_0x1b27b5[_0x56a5('0x2f')],_0x3b55e6[_0x56a5('0x38')]),_0x178f11);if(_0x1b27b5['query']['filter']){_0x4e7afd[_0x56a5('0x37')]=_[_0x56a5('0x3a')](_0x4e7afd[_0x56a5('0x37')],{'$or':_[_0x56a5('0x2e')](_0x178f11,function(_0xbf2db6){if(_0xbf2db6[_0x56a5('0x2c')]!==_0x56a5('0x3b')){var _0x652028={};_0x652028[_0xbf2db6[_0x56a5('0x26')]]={'$like':'%'+_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3c')]+'%'};return _0x652028;}})});}_0x4e7afd=_[_0x56a5('0x3a')]({},_0x4e7afd,_0x1b27b5[_0x56a5('0x3d')]);var _0x389c01={'where':_0x4e7afd[_0x56a5('0x37')]};return db[_0x56a5('0x29')][_0x56a5('0x1b')](_0x389c01)[_0x56a5('0x21')](function(_0xf0f6c8){_0x1f7aeb[_0x56a5('0x1b')]=_0xf0f6c8;if(_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3e')]){_0x4e7afd['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x56a5('0x3f')](_0x4e7afd);})['then'](function(_0x7c3c3e){_0x1f7aeb[_0x56a5('0x40')]=_0x7c3c3e;return _0x1f7aeb;})[_0x56a5('0x21')](respondWithFilteredResult(_0x284ee5,_0x4e7afd))[_0x56a5('0x41')](handleError(_0x284ee5,null));};exports[_0x56a5('0x42')]=function(_0x1160da,_0x5618f9){var _0x5c565a={'raw':!![],'where':{'id':_0x1160da[_0x56a5('0x43')]['id']}},_0x29ab9b={};_0x29ab9b[_0x56a5('0x2d')]=_[_0x56a5('0x30')](db[_0x56a5('0x29')][_0x56a5('0x2a')]);_0x29ab9b['query']=_[_0x56a5('0x30')](_0x1160da[_0x56a5('0x2f')]);_0x29ab9b['filters']=_[_0x56a5('0x31')](_0x29ab9b[_0x56a5('0x2d')],_0x29ab9b[_0x56a5('0x2f')]);_0x5c565a[_0x56a5('0x32')]=_['intersection'](_0x29ab9b[_0x56a5('0x2d')],qs['fields'](_0x1160da[_0x56a5('0x2f')][_0x56a5('0x44')]));_0x5c565a['attributes']=_0x5c565a[_0x56a5('0x32')]['length']?_0x5c565a[_0x56a5('0x32')]:_0x29ab9b[_0x56a5('0x2d')];if(_0x1160da['query'][_0x56a5('0x3e')]){_0x5c565a['include']=[{'all':!![]}];}_0x5c565a=_[_0x56a5('0x3a')]({},_0x5c565a,_0x1160da['options']);return db[_0x56a5('0x29')]['find'](_0x5c565a)[_0x56a5('0x21')](handleEntityNotFound(_0x5618f9,null))[_0x56a5('0x21')](respondWithResult(_0x5618f9,null))[_0x56a5('0x41')](handleError(_0x5618f9,null));};exports[_0x56a5('0x45')]=function(_0x30d377,_0x43196d){return db[_0x56a5('0x29')]['create'](_0x30d377['body'],{})['then'](respondWithResult(_0x43196d,0xc9))[_0x56a5('0x41')](handleError(_0x43196d,null));};exports[_0x56a5('0x20')]=function(_0x1e510a,_0x55d2e2){if(_0x1e510a[_0x56a5('0x46')]['id']){delete _0x1e510a[_0x56a5('0x46')]['id'];}return db[_0x56a5('0x29')]['find']({'where':{'id':_0x1e510a[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x55d2e2,null))['then'](saveUpdates(_0x1e510a[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x55d2e2,null))[_0x56a5('0x41')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x22')]=function(_0xcb3cb9,_0x58d308){return db[_0x56a5('0x29')][_0x56a5('0x47')]({'where':{'id':_0xcb3cb9[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x58d308,null))[_0x56a5('0x21')](removeEntity(_0x58d308,null))['catch'](handleError(_0x58d308,null));};exports[_0x56a5('0x48')]=function(_0x3bda32,_0x597e52){return db[_0x56a5('0x29')][_0x56a5('0x48')]()[_0x56a5('0x21')](respondWithResult(_0x597e52,null))['catch'](handleError(_0x597e52,null));};
\ No newline at end of file
+var _0x2a07=['index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x4cd14a,_0x3c08b4){_0x4cd14a=_0x4cd14a-0x0;var _0x59ac6a=_0x2a07[_0x4cd14a];return _0x59ac6a;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['MailQueueReport'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['MailQueueReport']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));};
\ No newline at end of file
index 372d533..2f46f18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8bb=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','path'];(function(_0x1d8e48,_0x2a32c5){var _0x2715e3=function(_0x6c5a43){while(--_0x6c5a43){_0x1d8e48['push'](_0x1d8e48['shift']());}};_0x2715e3(++_0x2a32c5);}(_0xe8bb,0xfe));var _0xbe8b=function(_0xf483fb,_0x571868){_0xf483fb=_0xf483fb-0x0;var _0x1a5ba9=_0xe8bb[_0xf483fb];return _0x1a5ba9;};'use strict';var _=require(_0xbe8b('0x0'));var util=require(_0xbe8b('0x1'));var logger=require(_0xbe8b('0x2'))(_0xbe8b('0x3'));var moment=require(_0xbe8b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe8b('0x5'));var rimraf=require(_0xbe8b('0x6'));var config=require(_0xbe8b('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xbe8b('0x8')]=function(_0x1aec40,_0x583fe3){return _0x1aec40[_0xbe8b('0x9')](_0xbe8b('0xa'),attributes,{'tableName':_0xbe8b('0xb'),'paranoid':![],'indexes':[{'name':_0xbe8b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf77f=['bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x399e7b,_0x59f2c2){var _0x2b2d32=function(_0x1139f6){while(--_0x1139f6){_0x399e7b['push'](_0x399e7b['shift']());}};_0x2b2d32(++_0x59f2c2);}(_0xf77f,0x134));var _0xff77=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xf77f[_0x99868f];return _0x27a71b;};'use strict';var _=require(_0xff77('0x0'));var util=require('util');var logger=require(_0xff77('0x1'))(_0xff77('0x2'));var moment=require(_0xff77('0x3'));var BPromise=require(_0xff77('0x4'));var rp=require(_0xff77('0x5'));var fs=require('fs');var path=require(_0xff77('0x6'));var rimraf=require(_0xff77('0x7'));var config=require(_0xff77('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xff77('0x9')]=function(_0x17e374,_0x54c2e4){return _0x17e374['define'](_0xff77('0xa'),attributes,{'tableName':_0xff77('0xb'),'paranoid':![],'indexes':[{'name':_0xff77('0xc'),'fields':[_0xff77('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b46b9db..cd9b0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x17d389,_0x2f85bf){var _0x28a0c4=function(_0x16d20d){while(--_0x16d20d){_0x17d389['push'](_0x17d389['shift']());}};_0x28a0c4(++_0x2f85bf);}(_0x2ef3,0xba));var _0x32ef=function(_0x411c06,_0x1f0ba1){_0x411c06=_0x411c06-0x0;var _0x24d1df=_0x2ef3[_0x411c06];return _0x24d1df;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\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')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});};
\ No newline at end of file
+var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x5a8442,_0x2b3948){var _0x37b32f=function(_0x4a1e1b){while(--_0x4a1e1b){_0x5a8442['push'](_0x5a8442['shift']());}};_0x37b32f(++_0x2b3948);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d4bbc,_0x2a79c3){_0x5d4bbc=_0x5d4bbc-0x0;var _0x165f8c=_0x2ef3[_0x5d4bbc];return _0x165f8c;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\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')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});};
\ No newline at end of file
index 8373f0c..674370f 100644 (file)
@@ -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(_0x4a627d,_0x5be033){var _0x166d10=function(_0x48d25a){while(--_0x48d25a){_0x4a627d['push'](_0x4a627d['shift']());}};_0x166d10(++_0x5be033);}(_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(_0x44f45f,_0x2ae023){var _0x985a3c=function(_0xdde8bc){while(--_0xdde8bc){_0x44f45f['push'](_0x44f45f['shift']());}};_0x985a3c(++_0x2ae023);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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
index ce73a42..dc89e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ca=['STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb6ca,0x16c));var _0xab6c=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb6ca[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0xab6c('0x0'));module['exports']={'description':{'type':Sequelize[_0xab6c('0x1')]},'host':{'type':Sequelize[_0xab6c('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xab6c('0x2')]},'tls':{'type':Sequelize[_0xab6c('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xab6c('0x1')],'defaultValue':_0xab6c('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xab6c('0x1')]},'modernAuthentication':{'type':Sequelize[_0xab6c('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x984a=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x984a,0x96));var _0xa984=function(_0x248953,_0x202f60){_0x248953=_0x248953-0x0;var _0x2b0d94=_0x984a[_0x248953];return _0x2b0d94;};'use strict';var Sequelize=require(_0xa984('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa984('0x1')]},'authentication':{'type':Sequelize[_0xa984('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa984('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa984('0x3')]},'tls':{'type':Sequelize[_0xa984('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xa984('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xa984('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa984('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 7fc0ccd..5f2f287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6256=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x23b5ad,_0x121592){var _0x42a0eb=function(_0x30d395){while(--_0x30d395){_0x23b5ad['push'](_0x23b5ad['shift']());}};_0x42a0eb(++_0x121592);}(_0x6256,0x1e1));var _0x6625=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6256[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x6625('0x0'));var util=require(_0x6625('0x1'));var logger=require(_0x6625('0x2'))(_0x6625('0x3'));var moment=require(_0x6625('0x4'));var BPromise=require(_0x6625('0x5'));var rp=require(_0x6625('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6625('0x7'));var config=require(_0x6625('0x8'));var attributes=require(_0x6625('0x9'));module[_0x6625('0xa')]=function(_0x35dba5,_0x2b6ecf){return _0x35dba5[_0x6625('0xb')](_0x6625('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0802=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','mail_servers_in'];(function(_0x4eb2b7,_0x33412e){var _0x566e67=function(_0x1ee030){while(--_0x1ee030){_0x4eb2b7['push'](_0x4eb2b7['shift']());}};_0x566e67(++_0x33412e);}(_0x0802,0x155));var _0x2080=function(_0x3028d1,_0x1c71f4){_0x3028d1=_0x3028d1-0x0;var _0x5bc948=_0x0802[_0x3028d1];return _0x5bc948;};'use strict';var _=require(_0x2080('0x0'));var util=require(_0x2080('0x1'));var logger=require(_0x2080('0x2'))(_0x2080('0x3'));var moment=require('moment');var BPromise=require(_0x2080('0x4'));var rp=require(_0x2080('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2080('0x6'));var config=require('../../config/environment');var attributes=require(_0x2080('0x7'));module[_0x2080('0x8')]=function(_0x22662c,_0x258549){return _0x22662c[_0x2080('0x9')]('MailServerIn',attributes,{'tableName':_0x2080('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf969aa..d31eb14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba40=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailServerIn','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1860a1,_0x150490){var _0x20c713=function(_0x5eece3){while(--_0x5eece3){_0x1860a1['push'](_0x1860a1['shift']());}};_0x20c713(++_0x150490);}(_0xba40,0x7b));var _0x0ba4=function(_0x4abbc1,_0x48d127){_0x4abbc1=_0x4abbc1-0x0;var _0xdd0113=_0xba40[_0x4abbc1];return _0xdd0113;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ba4('0x0'));var BPromise=require(_0x0ba4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ba4('0x2'));var db=require(_0x0ba4('0x3'))['db'];var utils=require(_0x0ba4('0x4'));var logger=require(_0x0ba4('0x5'))(_0x0ba4('0x6'));var config=require(_0x0ba4('0x7'));var jayson=require(_0x0ba4('0x8'));var client=jayson[_0x0ba4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36ed85,_0x344dc3,_0x45e3b4){return new BPromise(function(_0x4bd8e8,_0x1d2182){return client[_0x0ba4('0xa')](_0x36ed85,_0x45e3b4)[_0x0ba4('0xb')](function(_0x569fa8){logger[_0x0ba4('0xc')](_0x0ba4('0xd'),_0x344dc3,_0x0ba4('0xe'));logger['debug'](_0x0ba4('0xf'),_0x344dc3,'request\x20sent',JSON[_0x0ba4('0x10')](_0x569fa8));if(_0x569fa8[_0x0ba4('0x11')]){if(_0x569fa8[_0x0ba4('0x11')][_0x0ba4('0x12')]===0x1f4){logger[_0x0ba4('0x11')]('MailServerIn,\x20%s,\x20%s',_0x344dc3,_0x569fa8['error'][_0x0ba4('0x13')]);return _0x1d2182(_0x569fa8[_0x0ba4('0x11')]['message']);}logger[_0x0ba4('0x11')]('MailServerIn,\x20%s,\x20%s',_0x344dc3,_0x569fa8['error'][_0x0ba4('0x13')]);return _0x4bd8e8(_0x569fa8[_0x0ba4('0x11')][_0x0ba4('0x13')]);}else{logger[_0x0ba4('0xc')](_0x0ba4('0xd'),_0x344dc3,_0x0ba4('0xe'));_0x4bd8e8(_0x569fa8[_0x0ba4('0x14')]['message']);}})[_0x0ba4('0x15')](function(_0x42cb4f){logger[_0x0ba4('0x11')](_0x0ba4('0xd'),_0x344dc3,_0x42cb4f);_0x1d2182(_0x42cb4f);});});}exports['GetMailServerIn']=function(_0x86717e){var _0x9bfec0=this;return new Promise(function(_0x253d8e,_0x1cf797){return db[_0x0ba4('0x16')]['findAll']({'raw':_0x86717e[_0x0ba4('0x17')]?_0x86717e[_0x0ba4('0x17')][_0x0ba4('0x18')]===undefined?!![]:![]:!![],'where':_0x86717e[_0x0ba4('0x17')]?_0x86717e[_0x0ba4('0x17')][_0x0ba4('0x19')]||null:null,'attributes':_0x86717e['options']?_0x86717e['options'][_0x0ba4('0x1a')]||null:null,'limit':_0x86717e[_0x0ba4('0x17')]?_0x86717e[_0x0ba4('0x17')][_0x0ba4('0x1b')]||null:null,'include':_0x86717e['options']?_0x86717e[_0x0ba4('0x17')][_0x0ba4('0x1c')]?_[_0x0ba4('0x1d')](_0x86717e[_0x0ba4('0x17')][_0x0ba4('0x1c')],function(_0x498198){return{'model':db[_0x498198[_0x0ba4('0x1e')]],'as':_0x498198['as'],'attributes':_0x498198[_0x0ba4('0x1a')],'include':_0x498198[_0x0ba4('0x1c')]?_[_0x0ba4('0x1d')](_0x498198[_0x0ba4('0x1c')],function(_0x20ce6a){return{'model':db[_0x20ce6a[_0x0ba4('0x1e')]],'as':_0x20ce6a['as'],'attributes':_0x20ce6a[_0x0ba4('0x1a')],'include':_0x20ce6a['include']?_[_0x0ba4('0x1d')](_0x20ce6a[_0x0ba4('0x1c')],function(_0x23682e){return{'model':db[_0x23682e['model']],'as':_0x23682e['as'],'attributes':_0x23682e[_0x0ba4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x368caa){logger[_0x0ba4('0xc')](_0x0ba4('0x1f'),_0x86717e);logger['debug'](_0x0ba4('0x1f'),_0x86717e,JSON[_0x0ba4('0x10')](_0x368caa));_0x253d8e(_0x368caa);})[_0x0ba4('0x15')](function(_0x3e955d){logger['error'](_0x0ba4('0x1f'),_0x3e955d[_0x0ba4('0x13')],_0x86717e);_0x1cf797(_0x9bfec0[_0x0ba4('0x11')](0x1f4,_0x3e955d[_0x0ba4('0x13')]));});});};
\ No newline at end of file
+var _0x34ad=['GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x59d6c8,_0x354b01){var _0x3d9faa=function(_0x45da90){while(--_0x45da90){_0x59d6c8['push'](_0x59d6c8['shift']());}};_0x3d9faa(++_0x354b01);}(_0x34ad,0x181));var _0xd34a=function(_0x28fe94,_0x120b9b){_0x28fe94=_0x28fe94-0x0;var _0x3560da=_0x34ad[_0x28fe94];return _0x3560da;};'use strict';var _=require(_0xd34a('0x0'));var util=require(_0xd34a('0x1'));var moment=require(_0xd34a('0x2'));var BPromise=require(_0xd34a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd34a('0x4'));var db=require(_0xd34a('0x5'))['db'];var utils=require(_0xd34a('0x6'));var logger=require('../../config/logger')(_0xd34a('0x7'));var config=require(_0xd34a('0x8'));var jayson=require(_0xd34a('0x9'));var client=jayson[_0xd34a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b8326,_0x5bf54c,_0x42557b){return new BPromise(function(_0x2d62ce,_0x5c1a24){return client[_0xd34a('0xb')](_0x4b8326,_0x42557b)[_0xd34a('0xc')](function(_0x2d5942){logger[_0xd34a('0xd')](_0xd34a('0xe'),_0x5bf54c,_0xd34a('0xf'));logger[_0xd34a('0x10')](_0xd34a('0x11'),_0x5bf54c,_0xd34a('0xf'),JSON[_0xd34a('0x12')](_0x2d5942));if(_0x2d5942[_0xd34a('0x13')]){if(_0x2d5942['error'][_0xd34a('0x14')]===0x1f4){logger[_0xd34a('0x13')]('MailServerIn,\x20%s,\x20%s',_0x5bf54c,_0x2d5942[_0xd34a('0x13')][_0xd34a('0x15')]);return _0x5c1a24(_0x2d5942[_0xd34a('0x13')][_0xd34a('0x15')]);}logger[_0xd34a('0x13')](_0xd34a('0xe'),_0x5bf54c,_0x2d5942[_0xd34a('0x13')][_0xd34a('0x15')]);return _0x2d62ce(_0x2d5942['error']['message']);}else{logger[_0xd34a('0xd')]('MailServerIn,\x20%s,\x20%s',_0x5bf54c,_0xd34a('0xf'));_0x2d62ce(_0x2d5942['result'][_0xd34a('0x15')]);}})[_0xd34a('0x16')](function(_0x20a4b3){logger['error'](_0xd34a('0xe'),_0x5bf54c,_0x20a4b3);_0x5c1a24(_0x20a4b3);});});}exports[_0xd34a('0x17')]=function(_0x42b507){var _0x191549=this;return new Promise(function(_0x207dc7,_0x5adc13){return db[_0xd34a('0x18')][_0xd34a('0x19')]({'raw':_0x42b507['options']?_0x42b507[_0xd34a('0x1a')][_0xd34a('0x1b')]===undefined?!![]:![]:!![],'where':_0x42b507[_0xd34a('0x1a')]?_0x42b507[_0xd34a('0x1a')][_0xd34a('0x1c')]||null:null,'attributes':_0x42b507['options']?_0x42b507[_0xd34a('0x1a')][_0xd34a('0x1d')]||null:null,'limit':_0x42b507['options']?_0x42b507[_0xd34a('0x1a')][_0xd34a('0x1e')]||null:null,'include':_0x42b507[_0xd34a('0x1a')]?_0x42b507['options'][_0xd34a('0x1f')]?_[_0xd34a('0x20')](_0x42b507[_0xd34a('0x1a')][_0xd34a('0x1f')],function(_0x27360f){return{'model':db[_0x27360f[_0xd34a('0x21')]],'as':_0x27360f['as'],'attributes':_0x27360f[_0xd34a('0x1d')],'include':_0x27360f[_0xd34a('0x1f')]?_[_0xd34a('0x20')](_0x27360f[_0xd34a('0x1f')],function(_0xe1c655){return{'model':db[_0xe1c655[_0xd34a('0x21')]],'as':_0xe1c655['as'],'attributes':_0xe1c655['attributes'],'include':_0xe1c655[_0xd34a('0x1f')]?_[_0xd34a('0x20')](_0xe1c655[_0xd34a('0x1f')],function(_0x464479){return{'model':db[_0x464479[_0xd34a('0x21')]],'as':_0x464479['as'],'attributes':_0x464479[_0xd34a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd34a('0xc')](function(_0x5bd616){logger[_0xd34a('0xd')](_0xd34a('0x17'),_0x42b507);logger[_0xd34a('0x10')](_0xd34a('0x17'),_0x42b507,JSON[_0xd34a('0x12')](_0x5bd616));_0x207dc7(_0x5bd616);})['catch'](function(_0x56c2d1){logger[_0xd34a('0x13')](_0xd34a('0x17'),_0x56c2d1[_0xd34a('0x15')],_0x42b507);_0x5adc13(_0x191549[_0xd34a('0x13')](0x1f4,_0x56c2d1[_0xd34a('0x15')]));});});};
\ No newline at end of file
index a8d2dd6..eafc362 100644 (file)
@@ -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(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0xf50c6d,_0x5cb7a1){_0xf50c6d=_0xf50c6d-0x0;var _0x1e8ae3=_0x7a54[_0xf50c6d];return _0x1e8ae3;};'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
index 06b4e51..f7b3b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x30ef15,_0x2b98ce){var _0x52d43e=function(_0x4e0f87){while(--_0x4e0f87){_0x30ef15['push'](_0x30ef15['shift']());}};_0x52d43e(++_0x2b98ce);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7b7e('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7b7e('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x7b7e('0x1')]},'authentication':{'type':Sequelize[_0x7b7e('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7b7e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0713=['BOOLEAN','STRING','INTEGER'];(function(_0x2a3df,_0x54cbbc){var _0x4e0150=function(_0x25c53b){while(--_0x25c53b){_0x2a3df['push'](_0x2a3df['shift']());}};_0x4e0150(++_0x54cbbc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3071('0x0')]},'host':{'type':Sequelize[_0x3071('0x0')]},'user':{'type':Sequelize[_0x3071('0x0')]},'pass':{'type':Sequelize[_0x3071('0x0')]},'port':{'type':Sequelize[_0x3071('0x1')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x3071('0x0')]},'authentication':{'type':Sequelize[_0x3071('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3071('0x2')],'defaultValue':![]}};
\ No newline at end of file
index dc1aad6..0d52339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9745=['name','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','error','stack'];(function(_0xb5b530,_0x1c89fc){var _0x58b0fb=function(_0x232d1e){while(--_0x232d1e){_0xb5b530['push'](_0xb5b530['shift']());}};_0x58b0fb(++_0x1c89fc);}(_0x9745,0x199));var _0x5974=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9745[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x5974('0x0'));var rimraf=require(_0x5974('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5974('0x2'));var rp=require(_0x5974('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5974('0x4'));var util=require(_0x5974('0x5'));var path=require(_0x5974('0x6'));var sox=require(_0x5974('0x7'));var csv=require(_0x5974('0x8'));var ejs=require(_0x5974('0x9'));var fs=require('fs');var fs_extra=require(_0x5974('0xa'));var _=require(_0x5974('0xb'));var squel=require(_0x5974('0xc'));var crypto=require('crypto');var jsforce=require(_0x5974('0xd'));var deskjs=require(_0x5974('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5974('0xf'));var Papa=require(_0x5974('0x10'));var Redis=require(_0x5974('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5974('0x12'));var as=require(_0x5974('0x13'));var hardwareService=require(_0x5974('0x14'));var logger=require(_0x5974('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5974('0x16'));var licenseUtil=require(_0x5974('0x17'));var db=require(_0x5974('0x18'))['db'];function respondWithStatusCode(_0x9f4ec5,_0x46d9a1){_0x46d9a1=_0x46d9a1||0xcc;return function(_0x310601){if(_0x310601){return _0x9f4ec5[_0x5974('0x19')](_0x46d9a1);}return _0x9f4ec5[_0x5974('0x1a')](_0x46d9a1)[_0x5974('0x1b')]();};}function respondWithResult(_0x358f85,_0x1d6e54){_0x1d6e54=_0x1d6e54||0xc8;return function(_0x25f8a5){if(_0x25f8a5){return _0x358f85[_0x5974('0x1a')](_0x1d6e54)[_0x5974('0x1c')](_0x25f8a5);}};}function respondWithFilteredResult(_0x2d2bfa,_0x2209e2){return function(_0xe34536){if(_0xe34536){var _0x51a1b9=typeof _0x2209e2[_0x5974('0x1d')]===_0x5974('0x1e')&&typeof _0x2209e2['limit']===_0x5974('0x1e');var _0x4b7fa0=_0xe34536[_0x5974('0x1f')];var _0xf4040e=_0x51a1b9?0x0:_0x2209e2[_0x5974('0x1d')];var _0x509875=_0x51a1b9?_0xe34536[_0x5974('0x1f')]:_0x2209e2['offset']+_0x2209e2[_0x5974('0x20')];var _0x386447;if(_0x509875>=_0x4b7fa0){_0x509875=_0x4b7fa0;_0x386447=0xc8;}else{_0x386447=0xce;}_0x2d2bfa[_0x5974('0x1a')](_0x386447);return _0x2d2bfa[_0x5974('0x21')](_0x5974('0x22'),_0xf4040e+'-'+_0x509875+'/'+_0x4b7fa0)['json'](_0xe34536);}return null;};}function patchUpdates(_0x31b3fa){return function(_0x56565f){try{jsonpatch['apply'](_0x56565f,_0x31b3fa,!![]);}catch(_0x176ef4){return BPromise['reject'](_0x176ef4);}return _0x56565f[_0x5974('0x23')]();};}function saveUpdates(_0x132e00,_0x238e59){return function(_0x59dd39){if(_0x59dd39){return _0x59dd39[_0x5974('0x24')](_0x132e00)['then'](function(_0x5da797){return _0x5da797;});}return null;};}function removeEntity(_0x1b3961,_0x400fad){return function(_0x14ec4f){if(_0x14ec4f){return _0x14ec4f[_0x5974('0x25')]()[_0x5974('0x26')](function(){_0x1b3961[_0x5974('0x1a')](0xcc)[_0x5974('0x1b')]();});}};}function handleEntityNotFound(_0x12b078,_0x4d78e2){return function(_0x461cf3){if(!_0x461cf3){_0x12b078[_0x5974('0x19')](0x194);}return _0x461cf3;};}function handleError(_0xb5b3ae,_0x4e7f2e){_0x4e7f2e=_0x4e7f2e||0x1f4;return function(_0xdc25f5){logger[_0x5974('0x27')](_0xdc25f5[_0x5974('0x28')]);if(_0xdc25f5[_0x5974('0x29')]){delete _0xdc25f5['name'];}_0xb5b3ae['status'](_0x4e7f2e)['send'](_0xdc25f5);};}exports[_0x5974('0x2a')]=function(_0x2c4e66,_0x5ddb5e){var _0xf8e27b={},_0x3129aa={},_0x5dc39e={'count':0x0,'rows':[]};var _0x437243=_[_0x5974('0x2b')](db[_0x5974('0x2c')]['rawAttributes'],function(_0x530bec){return{'name':_0x530bec[_0x5974('0x2d')],'type':_0x530bec[_0x5974('0x2e')][_0x5974('0x2f')]};});_0x3129aa[_0x5974('0x30')]=_[_0x5974('0x2b')](_0x437243,_0x5974('0x29'));_0x3129aa[_0x5974('0x31')]=_[_0x5974('0x32')](_0x2c4e66[_0x5974('0x31')]);_0x3129aa[_0x5974('0x33')]=_[_0x5974('0x34')](_0x3129aa[_0x5974('0x30')],_0x3129aa[_0x5974('0x31')]);_0xf8e27b[_0x5974('0x35')]=_['intersection'](_0x3129aa[_0x5974('0x30')],qs[_0x5974('0x36')](_0x2c4e66[_0x5974('0x31')][_0x5974('0x36')]));_0xf8e27b[_0x5974('0x35')]=_0xf8e27b['attributes']['length']?_0xf8e27b[_0x5974('0x35')]:_0x3129aa[_0x5974('0x30')];if(!_0x2c4e66[_0x5974('0x31')][_0x5974('0x37')](_0x5974('0x38'))){_0xf8e27b[_0x5974('0x20')]=qs[_0x5974('0x20')](_0x2c4e66[_0x5974('0x31')][_0x5974('0x20')]);_0xf8e27b[_0x5974('0x1d')]=qs[_0x5974('0x1d')](_0x2c4e66['query'][_0x5974('0x1d')]);}_0xf8e27b[_0x5974('0x39')]=qs[_0x5974('0x3a')](_0x2c4e66['query'][_0x5974('0x3a')]);_0xf8e27b['where']=qs[_0x5974('0x33')](_['pick'](_0x2c4e66['query'],_0x3129aa[_0x5974('0x33')]),_0x437243);if(_0x2c4e66[_0x5974('0x31')][_0x5974('0x3b')]){_0xf8e27b[_0x5974('0x3c')]=_[_0x5974('0x3d')](_0xf8e27b[_0x5974('0x3c')],{'$or':_['map'](_0x437243,function(_0xb30a89){if(_0xb30a89[_0x5974('0x2e')]!=='VIRTUAL'){var _0x5718ec={};_0x5718ec[_0xb30a89[_0x5974('0x29')]]={'$like':'%'+_0x2c4e66[_0x5974('0x31')][_0x5974('0x3b')]+'%'};return _0x5718ec;}})});}_0xf8e27b=_['merge']({},_0xf8e27b,_0x2c4e66[_0x5974('0x3e')]);var _0x42c048={'where':_0xf8e27b['where']};return db[_0x5974('0x2c')][_0x5974('0x1f')](_0x42c048)[_0x5974('0x26')](function(_0x485e2a){_0x5dc39e[_0x5974('0x1f')]=_0x485e2a;if(_0x2c4e66[_0x5974('0x31')][_0x5974('0x3f')]){_0xf8e27b[_0x5974('0x40')]=[{'all':!![]}];}return db[_0x5974('0x2c')][_0x5974('0x41')](_0xf8e27b);})[_0x5974('0x26')](function(_0x34fe8e){_0x5dc39e[_0x5974('0x42')]=_0x34fe8e;return _0x5dc39e;})[_0x5974('0x26')](respondWithFilteredResult(_0x5ddb5e,_0xf8e27b))[_0x5974('0x43')](handleError(_0x5ddb5e,null));};exports[_0x5974('0x44')]=function(_0x2a74c3,_0x3b9bbf){var _0x453b8d={'raw':!![],'where':{'id':_0x2a74c3['params']['id']}},_0x51c942={};_0x51c942['model']=_[_0x5974('0x32')](db['MailServerOut'][_0x5974('0x45')]);_0x51c942[_0x5974('0x31')]=_['keys'](_0x2a74c3[_0x5974('0x31')]);_0x51c942['filters']=_[_0x5974('0x34')](_0x51c942[_0x5974('0x30')],_0x51c942[_0x5974('0x31')]);_0x453b8d[_0x5974('0x35')]=_[_0x5974('0x34')](_0x51c942[_0x5974('0x30')],qs[_0x5974('0x36')](_0x2a74c3[_0x5974('0x31')]['fields']));_0x453b8d['attributes']=_0x453b8d[_0x5974('0x35')][_0x5974('0x46')]?_0x453b8d['attributes']:_0x51c942['model'];if(_0x2a74c3[_0x5974('0x31')][_0x5974('0x3f')]){_0x453b8d[_0x5974('0x40')]=[{'all':!![]}];}_0x453b8d=_[_0x5974('0x3d')]({},_0x453b8d,_0x2a74c3[_0x5974('0x3e')]);return db[_0x5974('0x2c')][_0x5974('0x47')](_0x453b8d)['then'](handleEntityNotFound(_0x3b9bbf,null))[_0x5974('0x26')](respondWithResult(_0x3b9bbf,null))[_0x5974('0x43')](handleError(_0x3b9bbf,null));};exports[_0x5974('0x48')]=function(_0x1f06af,_0x144808){return db[_0x5974('0x2c')]['create'](_0x1f06af[_0x5974('0x49')],{})[_0x5974('0x26')](respondWithResult(_0x144808,0xc9))[_0x5974('0x43')](handleError(_0x144808,null));};exports[_0x5974('0x24')]=function(_0x4ff5ad,_0xe9a97){if(_0x4ff5ad['body']['id']){delete _0x4ff5ad[_0x5974('0x49')]['id'];}return db[_0x5974('0x2c')][_0x5974('0x47')]({'where':{'id':_0x4ff5ad['params']['id']}})[_0x5974('0x26')](handleEntityNotFound(_0xe9a97,null))[_0x5974('0x26')](saveUpdates(_0x4ff5ad[_0x5974('0x49')],null))['then'](respondWithResult(_0xe9a97,null))['catch'](handleError(_0xe9a97,null));};exports[_0x5974('0x25')]=function(_0x16e919,_0x346e44){return db[_0x5974('0x2c')][_0x5974('0x47')]({'where':{'id':_0x16e919[_0x5974('0x4a')]['id']}})[_0x5974('0x26')](handleEntityNotFound(_0x346e44,null))[_0x5974('0x26')](removeEntity(_0x346e44,null))[_0x5974('0x43')](handleError(_0x346e44,null));};
\ No newline at end of file
+var _0x5e82=['offset','apply','save','then','sendStatus','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','find','catch','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x5e82,0x17d));var _0x25e8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5e82[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x25e8('0x0'));var rimraf=require(_0x25e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25e8('0x2'));var rp=require(_0x25e8('0x3'));var moment=require(_0x25e8('0x4'));var BPromise=require(_0x25e8('0x5'));var Mustache=require(_0x25e8('0x6'));var util=require('util');var path=require(_0x25e8('0x7'));var sox=require(_0x25e8('0x8'));var csv=require(_0x25e8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25e8('0xa'));var crypto=require(_0x25e8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x25e8('0xc'));var toCsv=require(_0x25e8('0x9'));var querystring=require(_0x25e8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x25e8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25e8('0xf'));var logger=require(_0x25e8('0x10'))(_0x25e8('0x11'));var utils=require(_0x25e8('0x12'));var config=require(_0x25e8('0x13'));var licenseUtil=require(_0x25e8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c0d9,_0x32d0a6){_0x32d0a6=_0x32d0a6||0xcc;return function(_0x423c7f){if(_0x423c7f){return _0x41c0d9['sendStatus'](_0x32d0a6);}return _0x41c0d9[_0x25e8('0x15')](_0x32d0a6)[_0x25e8('0x16')]();};}function respondWithResult(_0x526f76,_0x2f29bc){_0x2f29bc=_0x2f29bc||0xc8;return function(_0x2604fd){if(_0x2604fd){return _0x526f76[_0x25e8('0x15')](_0x2f29bc)[_0x25e8('0x17')](_0x2604fd);}};}function respondWithFilteredResult(_0x2db0de,_0x542b0b){return function(_0x59117c){if(_0x59117c){var _0x34af3e=typeof _0x542b0b['offset']===_0x25e8('0x18')&&typeof _0x542b0b[_0x25e8('0x19')]===_0x25e8('0x18');var _0x2b3ee6=_0x59117c[_0x25e8('0x1a')];var _0x194dd3=_0x34af3e?0x0:_0x542b0b['offset'];var _0x51de69=_0x34af3e?_0x59117c[_0x25e8('0x1a')]:_0x542b0b[_0x25e8('0x1b')]+_0x542b0b[_0x25e8('0x19')];var _0xd7d4d3;if(_0x51de69>=_0x2b3ee6){_0x51de69=_0x2b3ee6;_0xd7d4d3=0xc8;}else{_0xd7d4d3=0xce;}_0x2db0de[_0x25e8('0x15')](_0xd7d4d3);return _0x2db0de['set']('Content-Range',_0x194dd3+'-'+_0x51de69+'/'+_0x2b3ee6)[_0x25e8('0x17')](_0x59117c);}return null;};}function patchUpdates(_0x282558){return function(_0xef88a6){try{jsonpatch[_0x25e8('0x1c')](_0xef88a6,_0x282558,!![]);}catch(_0x3c4da4){return BPromise['reject'](_0x3c4da4);}return _0xef88a6[_0x25e8('0x1d')]();};}function saveUpdates(_0x1eab57,_0x112e76){return function(_0xf7aaf3){if(_0xf7aaf3){return _0xf7aaf3['update'](_0x1eab57)[_0x25e8('0x1e')](function(_0xb078e7){return _0xb078e7;});}return null;};}function removeEntity(_0x361df2,_0x173bed){return function(_0x1e321a){if(_0x1e321a){return _0x1e321a['destroy']()[_0x25e8('0x1e')](function(){_0x361df2[_0x25e8('0x15')](0xcc)[_0x25e8('0x16')]();});}};}function handleEntityNotFound(_0x47f1c4,_0x57c54a){return function(_0x4ddd5d){if(!_0x4ddd5d){_0x47f1c4[_0x25e8('0x1f')](0x194);}return _0x4ddd5d;};}function handleError(_0x79f330,_0x440d98){_0x440d98=_0x440d98||0x1f4;return function(_0x442cae){logger['error'](_0x442cae['stack']);if(_0x442cae[_0x25e8('0x20')]){delete _0x442cae[_0x25e8('0x20')];}_0x79f330['status'](_0x440d98)['send'](_0x442cae);};}exports[_0x25e8('0x21')]=function(_0x2979f4,_0x388d40){var _0x43a3d0={},_0x2616f4={},_0x498378={'count':0x0,'rows':[]};var _0x2a9469=_['map'](db[_0x25e8('0x22')][_0x25e8('0x23')],function(_0x21344a){return{'name':_0x21344a[_0x25e8('0x24')],'type':_0x21344a[_0x25e8('0x25')][_0x25e8('0x26')]};});_0x2616f4[_0x25e8('0x27')]=_[_0x25e8('0x28')](_0x2a9469,'name');_0x2616f4[_0x25e8('0x29')]=_['keys'](_0x2979f4[_0x25e8('0x29')]);_0x2616f4['filters']=_[_0x25e8('0x2a')](_0x2616f4[_0x25e8('0x27')],_0x2616f4['query']);_0x43a3d0[_0x25e8('0x2b')]=_['intersection'](_0x2616f4[_0x25e8('0x27')],qs[_0x25e8('0x2c')](_0x2979f4[_0x25e8('0x29')][_0x25e8('0x2c')]));_0x43a3d0[_0x25e8('0x2b')]=_0x43a3d0['attributes'][_0x25e8('0x2d')]?_0x43a3d0[_0x25e8('0x2b')]:_0x2616f4[_0x25e8('0x27')];if(!_0x2979f4[_0x25e8('0x29')][_0x25e8('0x2e')](_0x25e8('0x2f'))){_0x43a3d0[_0x25e8('0x19')]=qs[_0x25e8('0x19')](_0x2979f4[_0x25e8('0x29')][_0x25e8('0x19')]);_0x43a3d0[_0x25e8('0x1b')]=qs[_0x25e8('0x1b')](_0x2979f4[_0x25e8('0x29')][_0x25e8('0x1b')]);}_0x43a3d0[_0x25e8('0x30')]=qs[_0x25e8('0x31')](_0x2979f4[_0x25e8('0x29')][_0x25e8('0x31')]);_0x43a3d0[_0x25e8('0x32')]=qs[_0x25e8('0x33')](_[_0x25e8('0x34')](_0x2979f4['query'],_0x2616f4[_0x25e8('0x33')]),_0x2a9469);if(_0x2979f4[_0x25e8('0x29')][_0x25e8('0x35')]){_0x43a3d0['where']=_[_0x25e8('0x36')](_0x43a3d0['where'],{'$or':_['map'](_0x2a9469,function(_0x395937){if(_0x395937[_0x25e8('0x25')]!==_0x25e8('0x37')){var _0x3efd7f={};_0x3efd7f[_0x395937[_0x25e8('0x20')]]={'$like':'%'+_0x2979f4[_0x25e8('0x29')][_0x25e8('0x35')]+'%'};return _0x3efd7f;}})});}_0x43a3d0=_['merge']({},_0x43a3d0,_0x2979f4[_0x25e8('0x38')]);var _0xec84d1={'where':_0x43a3d0['where']};return db[_0x25e8('0x22')]['count'](_0xec84d1)['then'](function(_0x482007){_0x498378['count']=_0x482007;if(_0x2979f4[_0x25e8('0x29')][_0x25e8('0x39')]){_0x43a3d0[_0x25e8('0x3a')]=[{'all':!![]}];}return db['MailServerOut'][_0x25e8('0x3b')](_0x43a3d0);})[_0x25e8('0x1e')](function(_0x591a02){_0x498378['rows']=_0x591a02;return _0x498378;})['then'](respondWithFilteredResult(_0x388d40,_0x43a3d0))['catch'](handleError(_0x388d40,null));};exports[_0x25e8('0x3c')]=function(_0x329442,_0x575b84){var _0x1dc7bd={'raw':!![],'where':{'id':_0x329442['params']['id']}},_0x2daba1={};_0x2daba1[_0x25e8('0x27')]=_[_0x25e8('0x3d')](db[_0x25e8('0x22')][_0x25e8('0x23')]);_0x2daba1[_0x25e8('0x29')]=_['keys'](_0x329442[_0x25e8('0x29')]);_0x2daba1[_0x25e8('0x33')]=_[_0x25e8('0x2a')](_0x2daba1[_0x25e8('0x27')],_0x2daba1[_0x25e8('0x29')]);_0x1dc7bd[_0x25e8('0x2b')]=_[_0x25e8('0x2a')](_0x2daba1[_0x25e8('0x27')],qs[_0x25e8('0x2c')](_0x329442[_0x25e8('0x29')][_0x25e8('0x2c')]));_0x1dc7bd[_0x25e8('0x2b')]=_0x1dc7bd[_0x25e8('0x2b')][_0x25e8('0x2d')]?_0x1dc7bd[_0x25e8('0x2b')]:_0x2daba1[_0x25e8('0x27')];if(_0x329442[_0x25e8('0x29')]['includeAll']){_0x1dc7bd[_0x25e8('0x3a')]=[{'all':!![]}];}_0x1dc7bd=_['merge']({},_0x1dc7bd,_0x329442[_0x25e8('0x38')]);return db['MailServerOut'][_0x25e8('0x3e')](_0x1dc7bd)[_0x25e8('0x1e')](handleEntityNotFound(_0x575b84,null))[_0x25e8('0x1e')](respondWithResult(_0x575b84,null))[_0x25e8('0x3f')](handleError(_0x575b84,null));};exports[_0x25e8('0x40')]=function(_0x350ae9,_0x383b8d){return db[_0x25e8('0x22')][_0x25e8('0x40')](_0x350ae9[_0x25e8('0x41')],{})[_0x25e8('0x1e')](respondWithResult(_0x383b8d,0xc9))[_0x25e8('0x3f')](handleError(_0x383b8d,null));};exports[_0x25e8('0x42')]=function(_0x28fce4,_0x22b943){if(_0x28fce4[_0x25e8('0x41')]['id']){delete _0x28fce4[_0x25e8('0x41')]['id'];}return db[_0x25e8('0x22')][_0x25e8('0x3e')]({'where':{'id':_0x28fce4[_0x25e8('0x43')]['id']}})['then'](handleEntityNotFound(_0x22b943,null))[_0x25e8('0x1e')](saveUpdates(_0x28fce4['body'],null))[_0x25e8('0x1e')](respondWithResult(_0x22b943,null))[_0x25e8('0x3f')](handleError(_0x22b943,null));};exports['destroy']=function(_0x49fe8a,_0x258bfd){return db[_0x25e8('0x22')][_0x25e8('0x3e')]({'where':{'id':_0x49fe8a['params']['id']}})[_0x25e8('0x1e')](handleEntityNotFound(_0x258bfd,null))[_0x25e8('0x1e')](removeEntity(_0x258bfd,null))['catch'](handleError(_0x258bfd,null));};
\ No newline at end of file
index 762eddc..c2c4997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x362a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x362a,0x7d));var _0xa362=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x362a[_0x29771f];return _0x279baf;};'use strict';var _=require(_0xa362('0x0'));var util=require(_0xa362('0x1'));var logger=require('../../config/logger')(_0xa362('0x2'));var moment=require(_0xa362('0x3'));var BPromise=require(_0xa362('0x4'));var rp=require(_0xa362('0x5'));var fs=require('fs');var path=require(_0xa362('0x6'));var rimraf=require(_0xa362('0x7'));var config=require(_0xa362('0x8'));var attributes=require(_0xa362('0x9'));module[_0xa362('0xa')]=function(_0x3fbedc,_0x580ab9){return _0x3fbedc[_0xa362('0xb')](_0xa362('0xc'),attributes,{'tableName':_0xa362('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a0c=['define','mail_servers_out','lodash','util','bluebird','request-promise','../../config/environment','./mailServerOut.attributes'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x3a0c,0x162));var _0xc3a0=function(_0x30ffa5,_0x3e04fa){_0x30ffa5=_0x30ffa5-0x0;var _0x5bc887=_0x3a0c[_0x30ffa5];return _0x5bc887;};'use strict';var _=require(_0xc3a0('0x0'));var util=require(_0xc3a0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc3a0('0x2'));var rp=require(_0xc3a0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3a0('0x4'));var attributes=require(_0xc3a0('0x5'));module['exports']=function(_0x27d4fd,_0x4e5eec){return _0x27d4fd[_0xc3a0('0x6')]('MailServerOut',attributes,{'tableName':_0xc3a0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd4b60b..c36c11e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5378c8,_0x5ca439){var _0x5120b6=function(_0x501c60){while(--_0x501c60){_0x5378c8['push'](_0x5378c8['shift']());}};_0x5120b6(++_0x5ca439);}(_0xdb28,0x106));var _0x8db2=function(_0x1872f9,_0x20003a){_0x1872f9=_0x1872f9-0x0;var _0x3500a5=_0xdb28[_0x1872f9];return _0x3500a5;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x19a333,_0x3a97b2){_0x19a333=_0x19a333-0x0;var _0x1e23c2=_0x7a54[_0x19a333];return _0x1e23c2;};'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
index 05c2451..526bf6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf75a=['create','put','update','delete','destroy','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0x427d97,_0x43cc2c){var _0x2919c5=function(_0x21428c){while(--_0x21428c){_0x427d97['push'](_0x427d97['shift']());}};_0x2919c5(++_0x43cc2c);}(_0xf75a,0x85));var _0xaf75=function(_0x213065,_0x3afd09){_0x213065=_0x213065-0x0;var _0x50a790=_0xf75a[_0x213065];return _0x50a790;};'use strict';var multer=require(_0xaf75('0x0'));var util=require('util');var path=require(_0xaf75('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaf75('0x2'));var auth=require(_0xaf75('0x3'));var interaction=require(_0xaf75('0x4'));var config=require('../../config/environment');var controller=require(_0xaf75('0x5'));router[_0xaf75('0x6')]('/',auth['isAuthenticated'](),controller[_0xaf75('0x7')]);router[_0xaf75('0x6')](_0xaf75('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xaf75('0x6')](_0xaf75('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xaf75('0xa')](),controller[_0xaf75('0xb')]);router[_0xaf75('0xc')](_0xaf75('0x9'),auth[_0xaf75('0xa')](),controller[_0xaf75('0xd')]);router[_0xaf75('0xe')](_0xaf75('0x9'),auth['isAuthenticated'](),controller[_0xaf75('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0266=['/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe','describe','post','create','put'];(function(_0x12935f,_0x3c2be9){var _0x3869fc=function(_0x40978d){while(--_0x40978d){_0x12935f['push'](_0x12935f['shift']());}};_0x3869fc(++_0x3c2be9);}(_0x0266,0x10e));var _0x6026=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0266[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x6026('0x0'));var util=require(_0x6026('0x1'));var path=require('path');var timeout=require(_0x6026('0x2'));var express=require('express');var router=express[_0x6026('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6026('0x4'));var interaction=require(_0x6026('0x5'));var config=require(_0x6026('0x6'));var controller=require(_0x6026('0x7'));router['get']('/',auth[_0x6026('0x8')](),controller[_0x6026('0x9')]);router['get'](_0x6026('0xa'),auth[_0x6026('0x8')](),controller[_0x6026('0xb')]);router['get']('/:id',auth[_0x6026('0x8')](),controller['show']);router[_0x6026('0xc')]('/',auth[_0x6026('0x8')](),controller[_0x6026('0xd')]);router[_0x6026('0xe')](_0x6026('0xf'),auth[_0x6026('0x8')](),controller[_0x6026('0x10')]);router[_0x6026('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6026('0x12')]=router;
\ No newline at end of file
index e0aa55d..7249394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe944=['sequelize','name'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe944,0x174));var _0x4e94=function(_0x38fade,_0x5475d1){_0x38fade=_0x38fade-0x0;var _0x1695fb=_0xe944[_0x38fade];return _0x1695fb;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4e94('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8958=['exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x8958,0x93));var _0x8895=function(_0x38128b,_0x59232d){_0x38128b=_0x38128b-0x0;var _0x32798b=_0x8958[_0x38128b];return _0x32798b;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2bd723c..0edb634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7982=['where','pick','filter','merge','options','MailSubstatus','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7982,0xae));var _0x2798=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x7982[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0x2798('0x0'));var rimraf=require(_0x2798('0x1'));var zipdir=require(_0x2798('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2798('0x3'));var moment=require(_0x2798('0x4'));var BPromise=require(_0x2798('0x5'));var Mustache=require(_0x2798('0x6'));var util=require(_0x2798('0x7'));var path=require('path');var sox=require(_0x2798('0x8'));var csv=require(_0x2798('0x9'));var ejs=require(_0x2798('0xa'));var fs=require('fs');var fs_extra=require(_0x2798('0xb'));var _=require('lodash');var squel=require(_0x2798('0xc'));var crypto=require(_0x2798('0xd'));var jsforce=require(_0x2798('0xe'));var deskjs=require(_0x2798('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2798('0x10'));var Papa=require(_0x2798('0x11'));var Redis=require(_0x2798('0x12'));var authService=require(_0x2798('0x13'));var qs=require(_0x2798('0x14'));var as=require(_0x2798('0x15'));var hardwareService=require(_0x2798('0x16'));var logger=require(_0x2798('0x17'))(_0x2798('0x18'));var utils=require(_0x2798('0x19'));var config=require(_0x2798('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x205273,_0x380a18){_0x380a18=_0x380a18||0xcc;return function(_0x36bc66){if(_0x36bc66){return _0x205273[_0x2798('0x1b')](_0x380a18);}return _0x205273[_0x2798('0x1c')](_0x380a18)['end']();};}function respondWithResult(_0x5f18c1,_0x7de61b){_0x7de61b=_0x7de61b||0xc8;return function(_0x2f4abd){if(_0x2f4abd){return _0x5f18c1[_0x2798('0x1c')](_0x7de61b)[_0x2798('0x1d')](_0x2f4abd);}};}function respondWithFilteredResult(_0x15366f,_0x27ef85){return function(_0x5bc25a){if(_0x5bc25a){var _0x33e101=typeof _0x27ef85[_0x2798('0x1e')]===_0x2798('0x1f')&&typeof _0x27ef85[_0x2798('0x20')]==='undefined';var _0x4089db=_0x5bc25a[_0x2798('0x21')];var _0x41d046=_0x33e101?0x0:_0x27ef85[_0x2798('0x1e')];var _0xfd5f95=_0x33e101?_0x5bc25a[_0x2798('0x21')]:_0x27ef85[_0x2798('0x1e')]+_0x27ef85[_0x2798('0x20')];var _0x2122ae;if(_0xfd5f95>=_0x4089db){_0xfd5f95=_0x4089db;_0x2122ae=0xc8;}else{_0x2122ae=0xce;}_0x15366f[_0x2798('0x1c')](_0x2122ae);return _0x15366f[_0x2798('0x22')](_0x2798('0x23'),_0x41d046+'-'+_0xfd5f95+'/'+_0x4089db)[_0x2798('0x1d')](_0x5bc25a);}return null;};}function patchUpdates(_0x6086b4){return function(_0x52bee9){try{jsonpatch['apply'](_0x52bee9,_0x6086b4,!![]);}catch(_0x4578a8){return BPromise[_0x2798('0x24')](_0x4578a8);}return _0x52bee9[_0x2798('0x25')]();};}function saveUpdates(_0x278be6,_0x86633b){return function(_0x5816e9){if(_0x5816e9){return _0x5816e9[_0x2798('0x26')](_0x278be6)[_0x2798('0x27')](function(_0x3ee381){return _0x3ee381;});}return null;};}function removeEntity(_0x5e3fb3,_0x54aae8){return function(_0x447eb4){if(_0x447eb4){return _0x447eb4['destroy']()[_0x2798('0x27')](function(){_0x5e3fb3['status'](0xcc)[_0x2798('0x28')]();});}};}function handleEntityNotFound(_0x5d3028,_0x1f685e){return function(_0x2a556b){if(!_0x2a556b){_0x5d3028[_0x2798('0x1b')](0x194);}return _0x2a556b;};}function handleError(_0x205710,_0x307e02){_0x307e02=_0x307e02||0x1f4;return function(_0x33dca3){logger[_0x2798('0x29')](_0x33dca3[_0x2798('0x2a')]);if(_0x33dca3[_0x2798('0x2b')]){delete _0x33dca3[_0x2798('0x2b')];}_0x205710[_0x2798('0x1c')](_0x307e02)[_0x2798('0x2c')](_0x33dca3);};}exports['index']=function(_0x4d42af,_0x3faed6){var _0xd93727={},_0x2e42f8={},_0x5995a5={'count':0x0,'rows':[]};var _0x17f556=_[_0x2798('0x2d')](db['MailSubstatus'][_0x2798('0x2e')],function(_0xd6dd05){return{'name':_0xd6dd05[_0x2798('0x2f')],'type':_0xd6dd05[_0x2798('0x30')][_0x2798('0x31')]};});_0x2e42f8[_0x2798('0x32')]=_[_0x2798('0x2d')](_0x17f556,_0x2798('0x2b'));_0x2e42f8[_0x2798('0x33')]=_[_0x2798('0x34')](_0x4d42af[_0x2798('0x33')]);_0x2e42f8[_0x2798('0x35')]=_['intersection'](_0x2e42f8[_0x2798('0x32')],_0x2e42f8['query']);_0xd93727[_0x2798('0x36')]=_[_0x2798('0x37')](_0x2e42f8[_0x2798('0x32')],qs[_0x2798('0x38')](_0x4d42af['query'][_0x2798('0x38')]));_0xd93727['attributes']=_0xd93727['attributes'][_0x2798('0x39')]?_0xd93727['attributes']:_0x2e42f8[_0x2798('0x32')];if(!_0x4d42af[_0x2798('0x33')]['hasOwnProperty'](_0x2798('0x3a'))){_0xd93727[_0x2798('0x20')]=qs[_0x2798('0x20')](_0x4d42af['query'][_0x2798('0x20')]);_0xd93727[_0x2798('0x1e')]=qs[_0x2798('0x1e')](_0x4d42af['query']['offset']);}_0xd93727['order']=qs[_0x2798('0x3b')](_0x4d42af[_0x2798('0x33')][_0x2798('0x3b')]);_0xd93727[_0x2798('0x3c')]=qs['filters'](_[_0x2798('0x3d')](_0x4d42af['query'],_0x2e42f8[_0x2798('0x35')]),_0x17f556);if(_0x4d42af['query'][_0x2798('0x3e')]){_0xd93727[_0x2798('0x3c')]=_[_0x2798('0x3f')](_0xd93727[_0x2798('0x3c')],{'$or':_['map'](_0x17f556,function(_0x52a144){if(_0x52a144[_0x2798('0x30')]!=='VIRTUAL'){var _0x1cf83b={};_0x1cf83b[_0x52a144[_0x2798('0x2b')]]={'$like':'%'+_0x4d42af['query'][_0x2798('0x3e')]+'%'};return _0x1cf83b;}})});}_0xd93727=_[_0x2798('0x3f')]({},_0xd93727,_0x4d42af[_0x2798('0x40')]);var _0x35e21d={'where':_0xd93727[_0x2798('0x3c')]};return db[_0x2798('0x41')][_0x2798('0x21')](_0x35e21d)['then'](function(_0xfd939c){_0x5995a5[_0x2798('0x21')]=_0xfd939c;if(_0x4d42af['query']['includeAll']){_0xd93727[_0x2798('0x42')]=[{'all':!![]}];}return db[_0x2798('0x41')][_0x2798('0x43')](_0xd93727);})[_0x2798('0x27')](function(_0x31e3b9){_0x5995a5[_0x2798('0x44')]=_0x31e3b9;return _0x5995a5;})[_0x2798('0x27')](respondWithFilteredResult(_0x3faed6,_0xd93727))[_0x2798('0x45')](handleError(_0x3faed6,null));};exports[_0x2798('0x46')]=function(_0xa71699,_0x1a580a){var _0x30d8e3={'raw':!![],'where':{'id':_0xa71699[_0x2798('0x47')]['id']}},_0x527262={};_0x527262['model']=_[_0x2798('0x34')](db[_0x2798('0x41')]['rawAttributes']);_0x527262['query']=_[_0x2798('0x34')](_0xa71699[_0x2798('0x33')]);_0x527262['filters']=_[_0x2798('0x37')](_0x527262[_0x2798('0x32')],_0x527262[_0x2798('0x33')]);_0x30d8e3[_0x2798('0x36')]=_['intersection'](_0x527262[_0x2798('0x32')],qs[_0x2798('0x38')](_0xa71699[_0x2798('0x33')][_0x2798('0x38')]));_0x30d8e3['attributes']=_0x30d8e3[_0x2798('0x36')]['length']?_0x30d8e3[_0x2798('0x36')]:_0x527262[_0x2798('0x32')];if(_0xa71699[_0x2798('0x33')][_0x2798('0x48')]){_0x30d8e3[_0x2798('0x42')]=[{'all':!![]}];}_0x30d8e3=_[_0x2798('0x3f')]({},_0x30d8e3,_0xa71699[_0x2798('0x40')]);return db[_0x2798('0x41')][_0x2798('0x49')](_0x30d8e3)[_0x2798('0x27')](handleEntityNotFound(_0x1a580a,null))[_0x2798('0x27')](respondWithResult(_0x1a580a,null))[_0x2798('0x45')](handleError(_0x1a580a,null));};exports[_0x2798('0x4a')]=function(_0x53b48a,_0x438932){return db[_0x2798('0x41')][_0x2798('0x4a')](_0x53b48a['body'],{})[_0x2798('0x27')](respondWithResult(_0x438932,0xc9))[_0x2798('0x45')](handleError(_0x438932,null));};exports[_0x2798('0x26')]=function(_0x1db2cc,_0x513546){if(_0x1db2cc[_0x2798('0x4b')]['id']){delete _0x1db2cc[_0x2798('0x4b')]['id'];}return db[_0x2798('0x41')]['find']({'where':{'id':_0x1db2cc[_0x2798('0x47')]['id']}})[_0x2798('0x27')](handleEntityNotFound(_0x513546,null))['then'](saveUpdates(_0x1db2cc['body'],null))['then'](respondWithResult(_0x513546,null))['catch'](handleError(_0x513546,null));};exports[_0x2798('0x4c')]=function(_0x538dcb,_0x27c608){return db[_0x2798('0x41')][_0x2798('0x49')]({'where':{'id':_0x538dcb[_0x2798('0x47')]['id']}})[_0x2798('0x27')](handleEntityNotFound(_0x27c608,null))[_0x2798('0x27')](removeEntity(_0x27c608,null))[_0x2798('0x45')](handleError(_0x27c608,null));};exports[_0x2798('0x4d')]=function(_0x5d5485,_0x3c3cf1){return db[_0x2798('0x41')][_0x2798('0x4d')]()[_0x2798('0x27')](respondWithResult(_0x3c3cf1,null))['catch'](handleError(_0x3c3cf1,null));};
\ No newline at end of file
+var _0x0e14=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','MailSubstatus','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x0e14,0x10a));var _0x40e1=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x0e14[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0x40e1('0x0'));var rimraf=require(_0x40e1('0x1'));var zipdir=require(_0x40e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40e1('0x3'));var moment=require(_0x40e1('0x4'));var BPromise=require(_0x40e1('0x5'));var Mustache=require(_0x40e1('0x6'));var util=require('util');var path=require(_0x40e1('0x7'));var sox=require(_0x40e1('0x8'));var csv=require(_0x40e1('0x9'));var ejs=require(_0x40e1('0xa'));var fs=require('fs');var fs_extra=require(_0x40e1('0xb'));var _=require(_0x40e1('0xc'));var squel=require(_0x40e1('0xd'));var crypto=require(_0x40e1('0xe'));var jsforce=require(_0x40e1('0xf'));var deskjs=require(_0x40e1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x40e1('0x11'));var Papa=require('papaparse');var Redis=require(_0x40e1('0x12'));var authService=require(_0x40e1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x40e1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40e1('0x15'))(_0x40e1('0x16'));var utils=require(_0x40e1('0x17'));var config=require(_0x40e1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x40e1('0x19'))['db'];function respondWithStatusCode(_0x4e87c8,_0x4eefea){_0x4eefea=_0x4eefea||0xcc;return function(_0x11e2e9){if(_0x11e2e9){return _0x4e87c8['sendStatus'](_0x4eefea);}return _0x4e87c8[_0x40e1('0x1a')](_0x4eefea)['end']();};}function respondWithResult(_0x5c2f43,_0x217fb4){_0x217fb4=_0x217fb4||0xc8;return function(_0x731b0c){if(_0x731b0c){return _0x5c2f43[_0x40e1('0x1a')](_0x217fb4)['json'](_0x731b0c);}};}function respondWithFilteredResult(_0x5d0d65,_0x182ad6){return function(_0xc4827){if(_0xc4827){var _0x4e5b42=typeof _0x182ad6[_0x40e1('0x1b')]==='undefined'&&typeof _0x182ad6[_0x40e1('0x1c')]==='undefined';var _0x34bee4=_0xc4827['count'];var _0x28c07=_0x4e5b42?0x0:_0x182ad6[_0x40e1('0x1b')];var _0x331a83=_0x4e5b42?_0xc4827[_0x40e1('0x1d')]:_0x182ad6[_0x40e1('0x1b')]+_0x182ad6['limit'];var _0x1bc6cb;if(_0x331a83>=_0x34bee4){_0x331a83=_0x34bee4;_0x1bc6cb=0xc8;}else{_0x1bc6cb=0xce;}_0x5d0d65[_0x40e1('0x1a')](_0x1bc6cb);return _0x5d0d65[_0x40e1('0x1e')](_0x40e1('0x1f'),_0x28c07+'-'+_0x331a83+'/'+_0x34bee4)[_0x40e1('0x20')](_0xc4827);}return null;};}function patchUpdates(_0x2b9c79){return function(_0x29de1d){try{jsonpatch[_0x40e1('0x21')](_0x29de1d,_0x2b9c79,!![]);}catch(_0x42972b){return BPromise[_0x40e1('0x22')](_0x42972b);}return _0x29de1d[_0x40e1('0x23')]();};}function saveUpdates(_0x453b67,_0x87340f){return function(_0x3a01d1){if(_0x3a01d1){return _0x3a01d1[_0x40e1('0x24')](_0x453b67)[_0x40e1('0x25')](function(_0x2ed6ab){return _0x2ed6ab;});}return null;};}function removeEntity(_0x4ac878,_0x30914a){return function(_0x36a454){if(_0x36a454){return _0x36a454[_0x40e1('0x26')]()[_0x40e1('0x25')](function(){_0x4ac878[_0x40e1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef360,_0x48d1a7){return function(_0x359dd8){if(!_0x359dd8){_0x4ef360[_0x40e1('0x27')](0x194);}return _0x359dd8;};}function handleError(_0x4ec53a,_0xc49d09){_0xc49d09=_0xc49d09||0x1f4;return function(_0x304d4b){logger[_0x40e1('0x28')](_0x304d4b['stack']);if(_0x304d4b['name']){delete _0x304d4b[_0x40e1('0x29')];}_0x4ec53a[_0x40e1('0x1a')](_0xc49d09)['send'](_0x304d4b);};}exports[_0x40e1('0x2a')]=function(_0x1eb376,_0x411cf9){var _0x260d40={},_0x1e569f={},_0x5693a3={'count':0x0,'rows':[]};var _0x45af4e=_[_0x40e1('0x2b')](db['MailSubstatus'][_0x40e1('0x2c')],function(_0x15bb75){return{'name':_0x15bb75[_0x40e1('0x2d')],'type':_0x15bb75[_0x40e1('0x2e')][_0x40e1('0x2f')]};});_0x1e569f[_0x40e1('0x30')]=_[_0x40e1('0x2b')](_0x45af4e,'name');_0x1e569f[_0x40e1('0x31')]=_[_0x40e1('0x32')](_0x1eb376[_0x40e1('0x31')]);_0x1e569f[_0x40e1('0x33')]=_[_0x40e1('0x34')](_0x1e569f['model'],_0x1e569f[_0x40e1('0x31')]);_0x260d40[_0x40e1('0x35')]=_[_0x40e1('0x34')](_0x1e569f[_0x40e1('0x30')],qs[_0x40e1('0x36')](_0x1eb376[_0x40e1('0x31')][_0x40e1('0x36')]));_0x260d40[_0x40e1('0x35')]=_0x260d40['attributes'][_0x40e1('0x37')]?_0x260d40[_0x40e1('0x35')]:_0x1e569f[_0x40e1('0x30')];if(!_0x1eb376[_0x40e1('0x31')][_0x40e1('0x38')](_0x40e1('0x39'))){_0x260d40['limit']=qs[_0x40e1('0x1c')](_0x1eb376[_0x40e1('0x31')][_0x40e1('0x1c')]);_0x260d40[_0x40e1('0x1b')]=qs[_0x40e1('0x1b')](_0x1eb376['query'][_0x40e1('0x1b')]);}_0x260d40[_0x40e1('0x3a')]=qs['sort'](_0x1eb376[_0x40e1('0x31')][_0x40e1('0x3b')]);_0x260d40[_0x40e1('0x3c')]=qs[_0x40e1('0x33')](_[_0x40e1('0x3d')](_0x1eb376['query'],_0x1e569f[_0x40e1('0x33')]),_0x45af4e);if(_0x1eb376['query'][_0x40e1('0x3e')]){_0x260d40[_0x40e1('0x3c')]=_[_0x40e1('0x3f')](_0x260d40[_0x40e1('0x3c')],{'$or':_[_0x40e1('0x2b')](_0x45af4e,function(_0x4c42cb){if(_0x4c42cb[_0x40e1('0x2e')]!==_0x40e1('0x40')){var _0x360eb8={};_0x360eb8[_0x4c42cb['name']]={'$like':'%'+_0x1eb376[_0x40e1('0x31')]['filter']+'%'};return _0x360eb8;}})});}_0x260d40=_['merge']({},_0x260d40,_0x1eb376[_0x40e1('0x41')]);var _0x2e8497={'where':_0x260d40[_0x40e1('0x3c')]};return db['MailSubstatus'][_0x40e1('0x1d')](_0x2e8497)[_0x40e1('0x25')](function(_0xcf4514){_0x5693a3[_0x40e1('0x1d')]=_0xcf4514;if(_0x1eb376[_0x40e1('0x31')]['includeAll']){_0x260d40['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x40e1('0x42')](_0x260d40);})[_0x40e1('0x25')](function(_0xe8bf6e){_0x5693a3[_0x40e1('0x43')]=_0xe8bf6e;return _0x5693a3;})[_0x40e1('0x25')](respondWithFilteredResult(_0x411cf9,_0x260d40))[_0x40e1('0x44')](handleError(_0x411cf9,null));};exports[_0x40e1('0x45')]=function(_0x329613,_0x53029b){var _0x219548={'raw':!![],'where':{'id':_0x329613[_0x40e1('0x46')]['id']}},_0x58d39a={};_0x58d39a['model']=_[_0x40e1('0x32')](db[_0x40e1('0x47')]['rawAttributes']);_0x58d39a[_0x40e1('0x31')]=_[_0x40e1('0x32')](_0x329613[_0x40e1('0x31')]);_0x58d39a[_0x40e1('0x33')]=_['intersection'](_0x58d39a[_0x40e1('0x30')],_0x58d39a[_0x40e1('0x31')]);_0x219548['attributes']=_[_0x40e1('0x34')](_0x58d39a[_0x40e1('0x30')],qs[_0x40e1('0x36')](_0x329613['query'][_0x40e1('0x36')]));_0x219548[_0x40e1('0x35')]=_0x219548[_0x40e1('0x35')]['length']?_0x219548[_0x40e1('0x35')]:_0x58d39a[_0x40e1('0x30')];if(_0x329613['query'][_0x40e1('0x48')]){_0x219548[_0x40e1('0x49')]=[{'all':!![]}];}_0x219548=_['merge']({},_0x219548,_0x329613[_0x40e1('0x41')]);return db['MailSubstatus'][_0x40e1('0x4a')](_0x219548)['then'](handleEntityNotFound(_0x53029b,null))[_0x40e1('0x25')](respondWithResult(_0x53029b,null))[_0x40e1('0x44')](handleError(_0x53029b,null));};exports[_0x40e1('0x4b')]=function(_0x190be9,_0x2dc1e6){return db[_0x40e1('0x47')][_0x40e1('0x4b')](_0x190be9[_0x40e1('0x4c')],{})[_0x40e1('0x25')](respondWithResult(_0x2dc1e6,0xc9))[_0x40e1('0x44')](handleError(_0x2dc1e6,null));};exports['update']=function(_0x1404ba,_0x2b86f8){if(_0x1404ba[_0x40e1('0x4c')]['id']){delete _0x1404ba[_0x40e1('0x4c')]['id'];}return db['MailSubstatus'][_0x40e1('0x4a')]({'where':{'id':_0x1404ba[_0x40e1('0x46')]['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0x2b86f8,null))[_0x40e1('0x25')](saveUpdates(_0x1404ba[_0x40e1('0x4c')],null))[_0x40e1('0x25')](respondWithResult(_0x2b86f8,null))[_0x40e1('0x44')](handleError(_0x2b86f8,null));};exports[_0x40e1('0x26')]=function(_0x74fb35,_0x55d4bd){return db['MailSubstatus'][_0x40e1('0x4a')]({'where':{'id':_0x74fb35['params']['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0x55d4bd,null))[_0x40e1('0x25')](removeEntity(_0x55d4bd,null))[_0x40e1('0x44')](handleError(_0x55d4bd,null));};exports[_0x40e1('0x4d')]=function(_0x199099,_0x3c0c70){return db[_0x40e1('0x47')][_0x40e1('0x4d')]()[_0x40e1('0x25')](respondWithResult(_0x3c0c70,null))[_0x40e1('0x44')](handleError(_0x3c0c70,null));};
\ No newline at end of file
index 0831f52..fb297b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ad=['exports','events','../../mysqldb','emit','hasOwnProperty','hook'];(function(_0x4b2b37,_0x3005f7){var _0x27c887=function(_0x3013be){while(--_0x3013be){_0x4b2b37['push'](_0x4b2b37['shift']());}};_0x27c887(++_0x3005f7);}(_0xf6ad,0x73));var _0xdf6a=function(_0x2a41cc,_0x5953a6){_0x2a41cc=_0x2a41cc-0x0;var _0x543c46=_0xf6ad[_0x2a41cc];return _0x543c46;};'use strict';var EventEmitter=require(_0xdf6a('0x0'));var MailSubstatus=require(_0xdf6a('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2d72e8){return function(_0xa36164,_0x3d9a64,_0x4dbaa2){MailSubstatusEvents[_0xdf6a('0x2')](_0x2d72e8+':'+_0xa36164['id'],_0xa36164);MailSubstatusEvents[_0xdf6a('0x2')](_0x2d72e8,_0xa36164);_0x4dbaa2(null);};}for(var e in events){if(events[_0xdf6a('0x3')](e)){var event=events[e];MailSubstatus[_0xdf6a('0x4')](e,emitEvent(event));}}module[_0xdf6a('0x5')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x3cde=['hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x68822d,_0x4232cd){var _0xda797c=function(_0x316e84){while(--_0x316e84){_0x68822d['push'](_0x68822d['shift']());}};_0xda797c(++_0x4232cd);}(_0x3cde,0xc6));var _0xe3cd=function(_0x5cf34b,_0x1be153){_0x5cf34b=_0x5cf34b-0x0;var _0x4f3518=_0x3cde[_0x5cf34b];return _0x4f3518;};'use strict';var EventEmitter=require(_0xe3cd('0x0'));var MailSubstatus=require(_0xe3cd('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe3cd('0x2')](0x0);var events={'afterUpdate':_0xe3cd('0x3')};function emitEvent(_0x366c4c){return function(_0xd767f5,_0x4d7daf,_0x41f076){MailSubstatusEvents[_0xe3cd('0x4')](_0x366c4c+':'+_0xd767f5['id'],_0xd767f5);MailSubstatusEvents['emit'](_0x366c4c,_0xd767f5);_0x41f076(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xe3cd('0x5')](e,emitEvent(event));}}module[_0xe3cd('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index 18cfed8..0395e99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8320=['then','catch','./mailSubstatus.attributes','models','define','Condition','update','name','_previousDataValues'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8320,0x1d6));var _0x0832=function(_0x812b4,_0x5c732f){_0x812b4=_0x812b4-0x0;var _0x1b1950=_0x8320[_0x812b4];return _0x1b1950;};'use strict';var attributes=require(_0x0832('0x0'));module['exports']=function(_0x1c74ba){var _0x383f04=_0x1c74ba[_0x0832('0x1')];return _0x1c74ba[_0x0832('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1d7164,_0x32a9ee,_0x24f413){return _0x383f04[_0x0832('0x3')][_0x0832('0x4')]({'value':_0x1d7164[_0x0832('0x5')]},{'where':{'field':'mailSubstatus','value':_0x1d7164[_0x0832('0x6')]['name']}})[_0x0832('0x7')](function(){_0x24f413();})[_0x0832('0x8')](function(_0x25caaf){_0x24f413(_0x25caaf);});}}});};
\ No newline at end of file
+var _0x932a=['./mailSubstatus.attributes','exports','models','MailSubstatus','Condition','name','mailSubstatus','_previousDataValues','then','catch'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x932a,0x96));var _0xa932=function(_0x5c7597,_0x574d8a){_0x5c7597=_0x5c7597-0x0;var _0x5369a3=_0x932a[_0x5c7597];return _0x5369a3;};'use strict';var attributes=require(_0xa932('0x0'));module[_0xa932('0x1')]=function(_0x218cf4){var _0x53f94f=_0x218cf4[_0xa932('0x2')];return _0x218cf4['define'](_0xa932('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x32ba3c,_0x5ea854,_0xbc7d){return _0x53f94f[_0xa932('0x4')]['update']({'value':_0x32ba3c[_0xa932('0x5')]},{'where':{'field':_0xa932('0x6'),'value':_0x32ba3c[_0xa932('0x7')][_0xa932('0x5')]}})[_0xa932('0x8')](function(){_0xbc7d();})[_0xa932('0x9')](function(_0x3e17d9){_0xbc7d(_0x3e17d9);});}}});};
\ No newline at end of file
index 37a3f36..303ce62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc2=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x2b6e65,_0x46be50){var _0x19a85f=function(_0x175c18){while(--_0x175c18){_0x2b6e65['push'](_0x2b6e65['shift']());}};_0x19a85f(++_0x46be50);}(_0x7fc2,0xb0));var _0x27fc=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7fc2[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x27fc('0x0'));var util=require('util');var moment=require(_0x27fc('0x1'));var BPromise=require(_0x27fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27fc('0x3'));var db=require(_0x27fc('0x4'))['db'];var utils=require(_0x27fc('0x5'));var logger=require(_0x27fc('0x6'))(_0x27fc('0x7'));var config=require(_0x27fc('0x8'));var jayson=require(_0x27fc('0x9'));var client=jayson[_0x27fc('0xa')][_0x27fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c0e1,_0x1b283a,_0x5ee74f){return new BPromise(function(_0x4f12a8,_0x4749d0){return client[_0x27fc('0xc')](_0x55c0e1,_0x5ee74f)['then'](function(_0x36d5b2){logger[_0x27fc('0xd')](_0x27fc('0xe'),_0x1b283a,_0x27fc('0xf'));logger[_0x27fc('0x10')](_0x27fc('0x11'),_0x1b283a,_0x27fc('0xf'),JSON[_0x27fc('0x12')](_0x36d5b2));if(_0x36d5b2[_0x27fc('0x13')]){if(_0x36d5b2[_0x27fc('0x13')][_0x27fc('0x14')]===0x1f4){logger[_0x27fc('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1b283a,_0x36d5b2[_0x27fc('0x13')]['message']);return _0x4749d0(_0x36d5b2[_0x27fc('0x13')][_0x27fc('0x15')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x1b283a,_0x36d5b2[_0x27fc('0x13')][_0x27fc('0x15')]);return _0x4f12a8(_0x36d5b2[_0x27fc('0x13')][_0x27fc('0x15')]);}else{logger[_0x27fc('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x1b283a,_0x27fc('0xf'));_0x4f12a8(_0x36d5b2[_0x27fc('0x16')][_0x27fc('0x15')]);}})[_0x27fc('0x17')](function(_0x5d91d4){logger[_0x27fc('0x13')](_0x27fc('0xe'),_0x1b283a,_0x5d91d4);_0x4749d0(_0x5d91d4);});});}
\ No newline at end of file
+var _0xd311=['request\x20sent','error','code','message','MailSubstatus,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x56fcc3,_0x52d30a){var _0x6dbb6f=function(_0x5302b1){while(--_0x5302b1){_0x56fcc3['push'](_0x56fcc3['shift']());}};_0x6dbb6f(++_0x52d30a);}(_0xd311,0x1aa));var _0x1d31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd311[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d31('0x0'));var util=require(_0x1d31('0x1'));var moment=require(_0x1d31('0x2'));var BPromise=require(_0x1d31('0x3'));var rs=require(_0x1d31('0x4'));var fs=require('fs');var Redis=require(_0x1d31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d31('0x6'));var logger=require('../../config/logger')(_0x1d31('0x7'));var config=require(_0x1d31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e374,_0x2f32fc,_0x5ba49f){return new BPromise(function(_0x4ee337,_0x45c9a1){return client['request'](_0x39e374,_0x5ba49f)[_0x1d31('0xa')](function(_0x2c1ff0){logger[_0x1d31('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x2f32fc,'request\x20sent');logger[_0x1d31('0xc')](_0x1d31('0xd'),_0x2f32fc,_0x1d31('0xe'),JSON['stringify'](_0x2c1ff0));if(_0x2c1ff0[_0x1d31('0xf')]){if(_0x2c1ff0[_0x1d31('0xf')][_0x1d31('0x10')]===0x1f4){logger[_0x1d31('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x2f32fc,_0x2c1ff0[_0x1d31('0xf')][_0x1d31('0x11')]);return _0x45c9a1(_0x2c1ff0['error'][_0x1d31('0x11')]);}logger['error'](_0x1d31('0x12'),_0x2f32fc,_0x2c1ff0[_0x1d31('0xf')]['message']);return _0x4ee337(_0x2c1ff0[_0x1d31('0xf')][_0x1d31('0x11')]);}else{logger['info'](_0x1d31('0x12'),_0x2f32fc,_0x1d31('0xe'));_0x4ee337(_0x2c1ff0[_0x1d31('0x13')][_0x1d31('0x11')]);}})['catch'](function(_0x45d3af){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2f32fc,_0x45d3af);_0x45c9a1(_0x45d3af);});});}
\ No newline at end of file
index f3849ab..c905cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ca=['multer','util','path','connect-timeout','express','Router','./mailTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x557b34,_0x2ec8ed){var _0x35700f=function(_0x15061d){while(--_0x15061d){_0x557b34['push'](_0x557b34['shift']());}};_0x35700f(++_0x2ec8ed);}(_0x08ca,0xb4));var _0xa08c=function(_0x35a7a5,_0x5384a2){_0x35a7a5=_0x35a7a5-0x0;var _0x2a26e3=_0x08ca[_0x35a7a5];return _0x2a26e3;};'use strict';var multer=require(_0xa08c('0x0'));var util=require(_0xa08c('0x1'));var path=require(_0xa08c('0x2'));var timeout=require(_0xa08c('0x3'));var express=require(_0xa08c('0x4'));var router=express[_0xa08c('0x5')]();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(_0xa08c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa08c('0x7')]);router[_0xa08c('0x8')](_0xa08c('0x9'),auth[_0xa08c('0xa')](),controller[_0xa08c('0xb')]);router[_0xa08c('0x8')](_0xa08c('0xc'),auth[_0xa08c('0xa')](),controller[_0xa08c('0xd')]);router[_0xa08c('0xe')]('/',auth[_0xa08c('0xa')](),controller[_0xa08c('0xf')]);router[_0xa08c('0x10')](_0xa08c('0xc'),auth[_0xa08c('0xa')](),controller['update']);router[_0xa08c('0x11')](_0xa08c('0xc'),auth[_0xa08c('0xa')](),controller[_0xa08c('0x12')]);module[_0xa08c('0x13')]=router;
\ No newline at end of file
+var _0x3bd7=['put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create'];(function(_0x5727e2,_0xe01bcf){var _0x2d331c=function(_0x5440bc){while(--_0x5440bc){_0x5727e2['push'](_0x5727e2['shift']());}};_0x2d331c(++_0xe01bcf);}(_0x3bd7,0x1d0));var _0x73bd=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3bd7[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x73bd('0x0'));var util=require(_0x73bd('0x1'));var path=require(_0x73bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x73bd('0x3'));var router=express[_0x73bd('0x4')]();var fs_extra=require(_0x73bd('0x5'));var auth=require(_0x73bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73bd('0x7'));var controller=require(_0x73bd('0x8'));router[_0x73bd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x73bd('0x9')](_0x73bd('0xa'),auth['isAuthenticated'](),controller[_0x73bd('0xb')]);router[_0x73bd('0x9')](_0x73bd('0xc'),auth[_0x73bd('0xd')](),controller[_0x73bd('0xe')]);router['post']('/',auth[_0x73bd('0xd')](),controller[_0x73bd('0xf')]);router[_0x73bd('0x10')](_0x73bd('0xc'),auth[_0x73bd('0xd')](),controller['update']);router[_0x73bd('0x11')](_0x73bd('0xc'),auth[_0x73bd('0xd')](),controller[_0x73bd('0x12')]);module[_0x73bd('0x13')]=router;
\ No newline at end of file
index e5fac53..53175b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4f900c,_0x197cc9){var _0x337d93=function(_0x268152){while(--_0x268152){_0x4f900c['push'](_0x4f900c['shift']());}};_0x337d93(++_0x197cc9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xcb91[_0x164af1];return _0x5d81a2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3dbc87,_0x10d3f0){_0x3dbc87=_0x3dbc87-0x0;var _0x394ec2=_0x9bde[_0x3dbc87];return _0x394ec2;};'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
index dc752bc..072ba8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd8d=['stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcd8d,0x74));var _0xdcd8=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0xcd8d[_0x1795df];return _0x3f13c0;};'use strict';var emlformat=require(_0xdcd8('0x0'));var rimraf=require(_0xdcd8('0x1'));var zipdir=require(_0xdcd8('0x2'));var jsonpatch=require(_0xdcd8('0x3'));var rp=require(_0xdcd8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdcd8('0x5'));var util=require(_0xdcd8('0x6'));var path=require(_0xdcd8('0x7'));var sox=require(_0xdcd8('0x8'));var csv=require(_0xdcd8('0x9'));var ejs=require(_0xdcd8('0xa'));var fs=require('fs');var fs_extra=require(_0xdcd8('0xb'));var _=require(_0xdcd8('0xc'));var squel=require(_0xdcd8('0xd'));var crypto=require(_0xdcd8('0xe'));var jsforce=require(_0xdcd8('0xf'));var deskjs=require(_0xdcd8('0x10'));var toCsv=require(_0xdcd8('0x9'));var querystring=require(_0xdcd8('0x11'));var Papa=require('papaparse');var Redis=require(_0xdcd8('0x12'));var authService=require(_0xdcd8('0x13'));var qs=require(_0xdcd8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcd8('0x15'));var logger=require(_0xdcd8('0x16'))(_0xdcd8('0x17'));var utils=require(_0xdcd8('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdcd8('0x19'))['db'];function respondWithStatusCode(_0x57f8c7,_0x529940){_0x529940=_0x529940||0xcc;return function(_0x2bf461){if(_0x2bf461){return _0x57f8c7[_0xdcd8('0x1a')](_0x529940);}return _0x57f8c7[_0xdcd8('0x1b')](_0x529940)[_0xdcd8('0x1c')]();};}function respondWithResult(_0x335b8c,_0x32e479){_0x32e479=_0x32e479||0xc8;return function(_0x43a406){if(_0x43a406){return _0x335b8c[_0xdcd8('0x1b')](_0x32e479)[_0xdcd8('0x1d')](_0x43a406);}};}function respondWithFilteredResult(_0x4b3b8f,_0x5849d7){return function(_0x4afd8e){if(_0x4afd8e){var _0x438891=typeof _0x5849d7[_0xdcd8('0x1e')]===_0xdcd8('0x1f')&&typeof _0x5849d7['limit']==='undefined';var _0xcd8a66=_0x4afd8e['count'];var _0xfb2443=_0x438891?0x0:_0x5849d7[_0xdcd8('0x1e')];var _0x1b79aa=_0x438891?_0x4afd8e['count']:_0x5849d7['offset']+_0x5849d7[_0xdcd8('0x20')];var _0x3b2324;if(_0x1b79aa>=_0xcd8a66){_0x1b79aa=_0xcd8a66;_0x3b2324=0xc8;}else{_0x3b2324=0xce;}_0x4b3b8f[_0xdcd8('0x1b')](_0x3b2324);return _0x4b3b8f[_0xdcd8('0x21')](_0xdcd8('0x22'),_0xfb2443+'-'+_0x1b79aa+'/'+_0xcd8a66)[_0xdcd8('0x1d')](_0x4afd8e);}return null;};}function patchUpdates(_0x2c9b2f){return function(_0xe09f6e){try{jsonpatch[_0xdcd8('0x23')](_0xe09f6e,_0x2c9b2f,!![]);}catch(_0x14ebab){return BPromise[_0xdcd8('0x24')](_0x14ebab);}return _0xe09f6e[_0xdcd8('0x25')]();};}function saveUpdates(_0x5c6f6f,_0xdfe941){return function(_0x17776d){if(_0x17776d){return _0x17776d[_0xdcd8('0x26')](_0x5c6f6f)['then'](function(_0x261b28){return _0x261b28;});}return null;};}function removeEntity(_0x2d15f8,_0x90f2e8){return function(_0x19c102){if(_0x19c102){return _0x19c102[_0xdcd8('0x27')]()[_0xdcd8('0x28')](function(){_0x2d15f8[_0xdcd8('0x1b')](0xcc)[_0xdcd8('0x1c')]();});}};}function handleEntityNotFound(_0x53c2e3,_0xbb0143){return function(_0x2669f3){if(!_0x2669f3){_0x53c2e3[_0xdcd8('0x1a')](0x194);}return _0x2669f3;};}function handleError(_0x5644e2,_0x4de79b){_0x4de79b=_0x4de79b||0x1f4;return function(_0x15d729){logger[_0xdcd8('0x29')](_0x15d729[_0xdcd8('0x2a')]);if(_0x15d729[_0xdcd8('0x2b')]){delete _0x15d729[_0xdcd8('0x2b')];}_0x5644e2['status'](_0x4de79b)[_0xdcd8('0x2c')](_0x15d729);};}exports[_0xdcd8('0x2d')]=function(_0x3824bc,_0x541484){var _0x25acee={},_0x116530={},_0x16599c={'count':0x0,'rows':[]};var _0x24e6a6=_[_0xdcd8('0x2e')](db[_0xdcd8('0x2f')][_0xdcd8('0x30')],function(_0x3a18af){return{'name':_0x3a18af[_0xdcd8('0x31')],'type':_0x3a18af[_0xdcd8('0x32')][_0xdcd8('0x33')]};});_0x116530['model']=_[_0xdcd8('0x2e')](_0x24e6a6,'name');_0x116530[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0x3824bc[_0xdcd8('0x34')]);_0x116530[_0xdcd8('0x36')]=_[_0xdcd8('0x37')](_0x116530[_0xdcd8('0x38')],_0x116530[_0xdcd8('0x34')]);_0x25acee[_0xdcd8('0x39')]=_[_0xdcd8('0x37')](_0x116530[_0xdcd8('0x38')],qs[_0xdcd8('0x3a')](_0x3824bc[_0xdcd8('0x34')][_0xdcd8('0x3a')]));_0x25acee[_0xdcd8('0x39')]=_0x25acee['attributes']['length']?_0x25acee['attributes']:_0x116530[_0xdcd8('0x38')];if(!_0x3824bc[_0xdcd8('0x34')]['hasOwnProperty'](_0xdcd8('0x3b'))){_0x25acee[_0xdcd8('0x20')]=qs[_0xdcd8('0x20')](_0x3824bc[_0xdcd8('0x34')][_0xdcd8('0x20')]);_0x25acee['offset']=qs[_0xdcd8('0x1e')](_0x3824bc[_0xdcd8('0x34')][_0xdcd8('0x1e')]);}_0x25acee[_0xdcd8('0x3c')]=qs[_0xdcd8('0x3d')](_0x3824bc[_0xdcd8('0x34')][_0xdcd8('0x3d')]);_0x25acee[_0xdcd8('0x3e')]=qs[_0xdcd8('0x36')](_[_0xdcd8('0x3f')](_0x3824bc[_0xdcd8('0x34')],_0x116530[_0xdcd8('0x36')]),_0x24e6a6);if(_0x3824bc[_0xdcd8('0x34')][_0xdcd8('0x40')]){_0x25acee[_0xdcd8('0x3e')]=_[_0xdcd8('0x41')](_0x25acee['where'],{'$or':_[_0xdcd8('0x2e')](_0x24e6a6,function(_0x27793b){if(_0x27793b[_0xdcd8('0x32')]!==_0xdcd8('0x42')){var _0x504818={};_0x504818[_0x27793b['name']]={'$like':'%'+_0x3824bc['query'][_0xdcd8('0x40')]+'%'};return _0x504818;}})});}_0x25acee=_[_0xdcd8('0x41')]({},_0x25acee,_0x3824bc[_0xdcd8('0x43')]);var _0x48be16={'where':_0x25acee[_0xdcd8('0x3e')]};return db['MailTransferReport']['count'](_0x48be16)[_0xdcd8('0x28')](function(_0x17f8e2){_0x16599c[_0xdcd8('0x44')]=_0x17f8e2;if(_0x3824bc['query'][_0xdcd8('0x45')]){_0x25acee[_0xdcd8('0x46')]=[{'all':!![]}];}return db[_0xdcd8('0x2f')]['findAll'](_0x25acee);})[_0xdcd8('0x28')](function(_0x1d548b){_0x16599c[_0xdcd8('0x47')]=_0x1d548b;return _0x16599c;})[_0xdcd8('0x28')](respondWithFilteredResult(_0x541484,_0x25acee))[_0xdcd8('0x48')](handleError(_0x541484,null));};exports[_0xdcd8('0x49')]=function(_0x59734c,_0x2d3503){var _0x5f341e={'raw':!![],'where':{'id':_0x59734c['params']['id']}},_0x17f80f={};_0x17f80f[_0xdcd8('0x38')]=_[_0xdcd8('0x35')](db[_0xdcd8('0x2f')]['rawAttributes']);_0x17f80f['query']=_[_0xdcd8('0x35')](_0x59734c['query']);_0x17f80f[_0xdcd8('0x36')]=_[_0xdcd8('0x37')](_0x17f80f[_0xdcd8('0x38')],_0x17f80f[_0xdcd8('0x34')]);_0x5f341e['attributes']=_[_0xdcd8('0x37')](_0x17f80f[_0xdcd8('0x38')],qs[_0xdcd8('0x3a')](_0x59734c[_0xdcd8('0x34')]['fields']));_0x5f341e['attributes']=_0x5f341e[_0xdcd8('0x39')]['length']?_0x5f341e[_0xdcd8('0x39')]:_0x17f80f['model'];if(_0x59734c[_0xdcd8('0x34')][_0xdcd8('0x45')]){_0x5f341e['include']=[{'all':!![]}];}_0x5f341e=_[_0xdcd8('0x41')]({},_0x5f341e,_0x59734c[_0xdcd8('0x43')]);return db[_0xdcd8('0x2f')][_0xdcd8('0x4a')](_0x5f341e)[_0xdcd8('0x28')](handleEntityNotFound(_0x2d3503,null))[_0xdcd8('0x28')](respondWithResult(_0x2d3503,null))[_0xdcd8('0x48')](handleError(_0x2d3503,null));};exports[_0xdcd8('0x4b')]=function(_0x2dacae,_0x37113a){return db[_0xdcd8('0x2f')][_0xdcd8('0x4b')](_0x2dacae['body'],{})[_0xdcd8('0x28')](respondWithResult(_0x37113a,0xc9))[_0xdcd8('0x48')](handleError(_0x37113a,null));};exports['update']=function(_0x24f489,_0x5353fd){if(_0x24f489[_0xdcd8('0x4c')]['id']){delete _0x24f489[_0xdcd8('0x4c')]['id'];}return db[_0xdcd8('0x2f')][_0xdcd8('0x4a')]({'where':{'id':_0x24f489['params']['id']}})[_0xdcd8('0x28')](handleEntityNotFound(_0x5353fd,null))[_0xdcd8('0x28')](saveUpdates(_0x24f489[_0xdcd8('0x4c')],null))[_0xdcd8('0x28')](respondWithResult(_0x5353fd,null))[_0xdcd8('0x48')](handleError(_0x5353fd,null));};exports[_0xdcd8('0x27')]=function(_0x3a52c8,_0x18ee48){return db[_0xdcd8('0x2f')][_0xdcd8('0x4a')]({'where':{'id':_0x3a52c8[_0xdcd8('0x4d')]['id']}})[_0xdcd8('0x28')](handleEntityNotFound(_0x18ee48,null))[_0xdcd8('0x28')](removeEntity(_0x18ee48,null))[_0xdcd8('0x48')](handleError(_0x18ee48,null));};exports[_0xdcd8('0x4e')]=function(_0x5800d7,_0x229efe){return db[_0xdcd8('0x2f')][_0xdcd8('0x4e')]()[_0xdcd8('0x28')](respondWithResult(_0x229efe,null))[_0xdcd8('0x48')](handleError(_0x229efe,null));};
\ No newline at end of file
+var _0xa7d6=['path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','describe','eml-format','rimraf','moment','bluebird','mustache','util'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0xa7d6,0x8a));var _0x6a7d=function(_0x3a8c25,_0x5ae520){_0x3a8c25=_0x3a8c25-0x0;var _0x50d8a2=_0xa7d6[_0x3a8c25];return _0x50d8a2;};'use strict';var emlformat=require(_0x6a7d('0x0'));var rimraf=require(_0x6a7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a7d('0x2'));var BPromise=require(_0x6a7d('0x3'));var Mustache=require(_0x6a7d('0x4'));var util=require(_0x6a7d('0x5'));var path=require(_0x6a7d('0x6'));var sox=require(_0x6a7d('0x7'));var csv=require(_0x6a7d('0x8'));var ejs=require(_0x6a7d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6a7d('0xa'));var crypto=require(_0x6a7d('0xb'));var jsforce=require(_0x6a7d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a7d('0x8'));var querystring=require(_0x6a7d('0xd'));var Papa=require(_0x6a7d('0xe'));var Redis=require(_0x6a7d('0xf'));var authService=require(_0x6a7d('0x10'));var qs=require(_0x6a7d('0x11'));var as=require(_0x6a7d('0x12'));var hardwareService=require(_0x6a7d('0x13'));var logger=require(_0x6a7d('0x14'))('api');var utils=require(_0x6a7d('0x15'));var config=require(_0x6a7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7d('0x17'))['db'];function respondWithStatusCode(_0x3c69a8,_0x56df8b){_0x56df8b=_0x56df8b||0xcc;return function(_0xba98b5){if(_0xba98b5){return _0x3c69a8['sendStatus'](_0x56df8b);}return _0x3c69a8[_0x6a7d('0x18')](_0x56df8b)[_0x6a7d('0x19')]();};}function respondWithResult(_0x29d459,_0x5a4f1e){_0x5a4f1e=_0x5a4f1e||0xc8;return function(_0x30190d){if(_0x30190d){return _0x29d459[_0x6a7d('0x18')](_0x5a4f1e)[_0x6a7d('0x1a')](_0x30190d);}};}function respondWithFilteredResult(_0x5b011f,_0xf9f7de){return function(_0x10e3a2){if(_0x10e3a2){var _0x3fc07b=typeof _0xf9f7de[_0x6a7d('0x1b')]==='undefined'&&typeof _0xf9f7de[_0x6a7d('0x1c')]==='undefined';var _0x4218c6=_0x10e3a2[_0x6a7d('0x1d')];var _0x23dc07=_0x3fc07b?0x0:_0xf9f7de[_0x6a7d('0x1b')];var _0x205793=_0x3fc07b?_0x10e3a2[_0x6a7d('0x1d')]:_0xf9f7de['offset']+_0xf9f7de[_0x6a7d('0x1c')];var _0x30fe3b;if(_0x205793>=_0x4218c6){_0x205793=_0x4218c6;_0x30fe3b=0xc8;}else{_0x30fe3b=0xce;}_0x5b011f[_0x6a7d('0x18')](_0x30fe3b);return _0x5b011f[_0x6a7d('0x1e')](_0x6a7d('0x1f'),_0x23dc07+'-'+_0x205793+'/'+_0x4218c6)[_0x6a7d('0x1a')](_0x10e3a2);}return null;};}function patchUpdates(_0x26b8b4){return function(_0x809a00){try{jsonpatch['apply'](_0x809a00,_0x26b8b4,!![]);}catch(_0x53e721){return BPromise['reject'](_0x53e721);}return _0x809a00[_0x6a7d('0x20')]();};}function saveUpdates(_0x86e158,_0x201201){return function(_0x415f75){if(_0x415f75){return _0x415f75[_0x6a7d('0x21')](_0x86e158)['then'](function(_0x33f8fc){return _0x33f8fc;});}return null;};}function removeEntity(_0x1d13d9,_0x4da3ae){return function(_0x26322a){if(_0x26322a){return _0x26322a[_0x6a7d('0x22')]()['then'](function(){_0x1d13d9[_0x6a7d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482586,_0x337038){return function(_0x19e7a7){if(!_0x19e7a7){_0x482586[_0x6a7d('0x23')](0x194);}return _0x19e7a7;};}function handleError(_0x3dc6d7,_0x4b5196){_0x4b5196=_0x4b5196||0x1f4;return function(_0x6cffaa){logger[_0x6a7d('0x24')](_0x6cffaa['stack']);if(_0x6cffaa[_0x6a7d('0x25')]){delete _0x6cffaa['name'];}_0x3dc6d7[_0x6a7d('0x18')](_0x4b5196)[_0x6a7d('0x26')](_0x6cffaa);};}exports['index']=function(_0x1a6578,_0x4c6bd8){var _0x5778c1={},_0x498d66={},_0x1e38a3={'count':0x0,'rows':[]};var _0x499fcf=_[_0x6a7d('0x27')](db[_0x6a7d('0x28')][_0x6a7d('0x29')],function(_0x433376){return{'name':_0x433376[_0x6a7d('0x2a')],'type':_0x433376[_0x6a7d('0x2b')][_0x6a7d('0x2c')]};});_0x498d66[_0x6a7d('0x2d')]=_['map'](_0x499fcf,_0x6a7d('0x25'));_0x498d66[_0x6a7d('0x2e')]=_[_0x6a7d('0x2f')](_0x1a6578[_0x6a7d('0x2e')]);_0x498d66['filters']=_[_0x6a7d('0x30')](_0x498d66[_0x6a7d('0x2d')],_0x498d66['query']);_0x5778c1[_0x6a7d('0x31')]=_[_0x6a7d('0x30')](_0x498d66[_0x6a7d('0x2d')],qs['fields'](_0x1a6578['query'][_0x6a7d('0x32')]));_0x5778c1[_0x6a7d('0x31')]=_0x5778c1['attributes']['length']?_0x5778c1['attributes']:_0x498d66['model'];if(!_0x1a6578[_0x6a7d('0x2e')][_0x6a7d('0x33')]('nolimit')){_0x5778c1['limit']=qs['limit'](_0x1a6578[_0x6a7d('0x2e')][_0x6a7d('0x1c')]);_0x5778c1[_0x6a7d('0x1b')]=qs[_0x6a7d('0x1b')](_0x1a6578[_0x6a7d('0x2e')]['offset']);}_0x5778c1[_0x6a7d('0x34')]=qs['sort'](_0x1a6578[_0x6a7d('0x2e')]['sort']);_0x5778c1[_0x6a7d('0x35')]=qs[_0x6a7d('0x36')](_[_0x6a7d('0x37')](_0x1a6578['query'],_0x498d66['filters']),_0x499fcf);if(_0x1a6578[_0x6a7d('0x2e')][_0x6a7d('0x38')]){_0x5778c1[_0x6a7d('0x35')]=_[_0x6a7d('0x39')](_0x5778c1[_0x6a7d('0x35')],{'$or':_['map'](_0x499fcf,function(_0xe81787){if(_0xe81787[_0x6a7d('0x2b')]!==_0x6a7d('0x3a')){var _0x2b127c={};_0x2b127c[_0xe81787['name']]={'$like':'%'+_0x1a6578['query'][_0x6a7d('0x38')]+'%'};return _0x2b127c;}})});}_0x5778c1=_['merge']({},_0x5778c1,_0x1a6578['options']);var _0x507084={'where':_0x5778c1['where']};return db[_0x6a7d('0x28')][_0x6a7d('0x1d')](_0x507084)[_0x6a7d('0x3b')](function(_0x48ce5a){_0x1e38a3[_0x6a7d('0x1d')]=_0x48ce5a;if(_0x1a6578[_0x6a7d('0x2e')][_0x6a7d('0x3c')]){_0x5778c1[_0x6a7d('0x3d')]=[{'all':!![]}];}return db[_0x6a7d('0x28')][_0x6a7d('0x3e')](_0x5778c1);})[_0x6a7d('0x3b')](function(_0xaefd62){_0x1e38a3[_0x6a7d('0x3f')]=_0xaefd62;return _0x1e38a3;})[_0x6a7d('0x3b')](respondWithFilteredResult(_0x4c6bd8,_0x5778c1))[_0x6a7d('0x40')](handleError(_0x4c6bd8,null));};exports['show']=function(_0x56a0c2,_0x48e210){var _0x2dfbaf={'raw':!![],'where':{'id':_0x56a0c2['params']['id']}},_0x5e4e6a={};_0x5e4e6a['model']=_[_0x6a7d('0x2f')](db[_0x6a7d('0x28')]['rawAttributes']);_0x5e4e6a['query']=_[_0x6a7d('0x2f')](_0x56a0c2['query']);_0x5e4e6a['filters']=_[_0x6a7d('0x30')](_0x5e4e6a[_0x6a7d('0x2d')],_0x5e4e6a[_0x6a7d('0x2e')]);_0x2dfbaf[_0x6a7d('0x31')]=_[_0x6a7d('0x30')](_0x5e4e6a[_0x6a7d('0x2d')],qs[_0x6a7d('0x32')](_0x56a0c2[_0x6a7d('0x2e')][_0x6a7d('0x32')]));_0x2dfbaf[_0x6a7d('0x31')]=_0x2dfbaf[_0x6a7d('0x31')][_0x6a7d('0x41')]?_0x2dfbaf[_0x6a7d('0x31')]:_0x5e4e6a[_0x6a7d('0x2d')];if(_0x56a0c2[_0x6a7d('0x2e')]['includeAll']){_0x2dfbaf[_0x6a7d('0x3d')]=[{'all':!![]}];}_0x2dfbaf=_[_0x6a7d('0x39')]({},_0x2dfbaf,_0x56a0c2[_0x6a7d('0x42')]);return db[_0x6a7d('0x28')][_0x6a7d('0x43')](_0x2dfbaf)[_0x6a7d('0x3b')](handleEntityNotFound(_0x48e210,null))[_0x6a7d('0x3b')](respondWithResult(_0x48e210,null))[_0x6a7d('0x40')](handleError(_0x48e210,null));};exports[_0x6a7d('0x44')]=function(_0x319098,_0x53cf60){return db[_0x6a7d('0x28')][_0x6a7d('0x44')](_0x319098[_0x6a7d('0x45')],{})[_0x6a7d('0x3b')](respondWithResult(_0x53cf60,0xc9))[_0x6a7d('0x40')](handleError(_0x53cf60,null));};exports['update']=function(_0x5b6886,_0x47e266){if(_0x5b6886[_0x6a7d('0x45')]['id']){delete _0x5b6886[_0x6a7d('0x45')]['id'];}return db[_0x6a7d('0x28')][_0x6a7d('0x43')]({'where':{'id':_0x5b6886[_0x6a7d('0x46')]['id']}})[_0x6a7d('0x3b')](handleEntityNotFound(_0x47e266,null))[_0x6a7d('0x3b')](saveUpdates(_0x5b6886[_0x6a7d('0x45')],null))[_0x6a7d('0x3b')](respondWithResult(_0x47e266,null))['catch'](handleError(_0x47e266,null));};exports[_0x6a7d('0x22')]=function(_0x349824,_0x14a8fa){return db[_0x6a7d('0x28')][_0x6a7d('0x43')]({'where':{'id':_0x349824[_0x6a7d('0x46')]['id']}})[_0x6a7d('0x3b')](handleEntityNotFound(_0x14a8fa,null))[_0x6a7d('0x3b')](removeEntity(_0x14a8fa,null))[_0x6a7d('0x40')](handleError(_0x14a8fa,null));};exports[_0x6a7d('0x47')]=function(_0x44b8dc,_0x2ab47d){return db[_0x6a7d('0x28')]['describe']()[_0x6a7d('0x3b')](respondWithResult(_0x2ab47d,null))[_0x6a7d('0x40')](handleError(_0x2ab47d,null));};
\ No newline at end of file
index 1821935..00b8e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x782659,_0x2a5ad5){var _0x50d807=function(_0x6b9bc9){while(--_0x6b9bc9){_0x782659['push'](_0x782659['shift']());}};_0x50d807(++_0x2a5ad5);}(_0x8ce1,0x183));var _0x18ce=function(_0x6ca497,_0x289ed1){_0x6ca497=_0x6ca497-0x0;var _0xa92926=_0x8ce1[_0x6ca497];return _0xa92926;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require(_0x18ce('0x4'));var BPromise=require(_0x18ce('0x5'));var rp=require(_0x18ce('0x6'));var fs=require('fs');var path=require(_0x18ce('0x7'));var rimraf=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var attributes=require(_0x18ce('0xa'));module[_0x18ce('0xb')]=function(_0x13ff9d,_0x36f8db){return _0x13ff9d[_0x18ce('0xc')](_0x18ce('0xd'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x18ce('0xe'),'fields':[_0x18ce('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7ed=['./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x363cc4,_0x44cfca){var _0x294666=function(_0x2605b9){while(--_0x2605b9){_0x363cc4['push'](_0x363cc4['shift']());}};_0x294666(++_0x44cfca);}(_0xd7ed,0x1a8));var _0xdd7e=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xd7ed[_0x280f4a];return _0x1bb157;};'use strict';var _=require('lodash');var util=require(_0xdd7e('0x0'));var logger=require(_0xdd7e('0x1'))(_0xdd7e('0x2'));var moment=require(_0xdd7e('0x3'));var BPromise=require(_0xdd7e('0x4'));var rp=require(_0xdd7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd7e('0x6'));var config=require(_0xdd7e('0x7'));var attributes=require(_0xdd7e('0x8'));module[_0xdd7e('0x9')]=function(_0xdb138f,_0x1a3906){return _0xdb138f['define'](_0xdd7e('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xdd7e('0xb'),'fields':[_0xdd7e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f27abfc..ae473a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c3d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x477b78,_0x302499){var _0x2f3f99=function(_0x4e3fe6){while(--_0x4e3fe6){_0x477b78['push'](_0x477b78['shift']());}};_0x2f3f99(++_0x302499);}(_0x1c3d,0x182));var _0xd1c3=function(_0x2c60d1,_0x5b778f){_0x2c60d1=_0x2c60d1-0x0;var _0xdf6e43=_0x1c3d[_0x2c60d1];return _0xdf6e43;};'use strict';var _=require(_0xd1c3('0x0'));var util=require(_0xd1c3('0x1'));var moment=require(_0xd1c3('0x2'));var BPromise=require(_0xd1c3('0x3'));var rs=require(_0xd1c3('0x4'));var fs=require('fs');var Redis=require(_0xd1c3('0x5'));var db=require(_0xd1c3('0x6'))['db'];var utils=require(_0xd1c3('0x7'));var logger=require(_0xd1c3('0x8'))(_0xd1c3('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd1c3('0xa')][_0xd1c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d683d,_0x36eef7,_0xa0dc2e){return new BPromise(function(_0x51a91e,_0x3660ca){return client[_0xd1c3('0xc')](_0x3d683d,_0xa0dc2e)['then'](function(_0x13d793){logger[_0xd1c3('0xd')](_0xd1c3('0xe'),_0x36eef7,'request\x20sent');logger[_0xd1c3('0xf')](_0xd1c3('0x10'),_0x36eef7,_0xd1c3('0x11'),JSON['stringify'](_0x13d793));if(_0x13d793[_0xd1c3('0x12')]){if(_0x13d793[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x36eef7,_0x13d793[_0xd1c3('0x12')]['message']);return _0x3660ca(_0x13d793['error']['message']);}logger[_0xd1c3('0x12')](_0xd1c3('0xe'),_0x36eef7,_0x13d793[_0xd1c3('0x12')][_0xd1c3('0x14')]);return _0x51a91e(_0x13d793[_0xd1c3('0x12')][_0xd1c3('0x14')]);}else{logger[_0xd1c3('0xd')](_0xd1c3('0xe'),_0x36eef7,_0xd1c3('0x11'));_0x51a91e(_0x13d793[_0xd1c3('0x15')][_0xd1c3('0x14')]);}})[_0xd1c3('0x16')](function(_0x3a62f6){logger['error'](_0xd1c3('0xe'),_0x36eef7,_0x3a62f6);_0x3660ca(_0x3a62f6);});});}
\ No newline at end of file
+var _0x295e=['rpc','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger'];(function(_0x53ec96,_0x153922){var _0x552367=function(_0x18bb82){while(--_0x18bb82){_0x53ec96['push'](_0x53ec96['shift']());}};_0x552367(++_0x153922);}(_0x295e,0xcb));var _0xe295=function(_0x401cea,_0x414be4){_0x401cea=_0x401cea-0x0;var _0x4206d1=_0x295e[_0x401cea];return _0x4206d1;};'use strict';var _=require(_0xe295('0x0'));var util=require(_0xe295('0x1'));var moment=require(_0xe295('0x2'));var BPromise=require(_0xe295('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe295('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe295('0x5'))(_0xe295('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe295('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51d61c,_0x39b34d,_0x454ee9){return new BPromise(function(_0x7e154,_0x4ab327){return client[_0xe295('0x8')](_0x51d61c,_0x454ee9)[_0xe295('0x9')](function(_0x1505dd){logger[_0xe295('0xa')](_0xe295('0xb'),_0x39b34d,_0xe295('0xc'));logger[_0xe295('0xd')](_0xe295('0xe'),_0x39b34d,_0xe295('0xc'),JSON['stringify'](_0x1505dd));if(_0x1505dd[_0xe295('0xf')]){if(_0x1505dd[_0xe295('0xf')]['code']===0x1f4){logger[_0xe295('0xf')](_0xe295('0xb'),_0x39b34d,_0x1505dd[_0xe295('0xf')][_0xe295('0x10')]);return _0x4ab327(_0x1505dd[_0xe295('0xf')][_0xe295('0x10')]);}logger[_0xe295('0xf')](_0xe295('0xb'),_0x39b34d,_0x1505dd[_0xe295('0xf')][_0xe295('0x10')]);return _0x7e154(_0x1505dd[_0xe295('0xf')][_0xe295('0x10')]);}else{logger['info'](_0xe295('0xb'),_0x39b34d,'request\x20sent');_0x7e154(_0x1505dd[_0xe295('0x11')][_0xe295('0x10')]);}})[_0xe295('0x12')](function(_0x18e287){logger['error'](_0xe295('0xb'),_0x39b34d,_0x18e287);_0x4ab327(_0x18e287);});});}
\ No newline at end of file
index b215a6a..d2ed818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464f=['./memberReport.controller','isAuthenticated','index','get','/describe','/:id','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x464f,0x1ad));var _0xf464=function(_0x4bff21,_0x4e5b94){_0x4bff21=_0x4bff21-0x0;var _0xf1c40f=_0x464f[_0x4bff21];return _0xf1c40f;};'use strict';var multer=require(_0xf464('0x0'));var util=require('util');var path=require(_0xf464('0x1'));var timeout=require(_0xf464('0x2'));var express=require(_0xf464('0x3'));var router=express[_0xf464('0x4')]();var fs_extra=require(_0xf464('0x5'));var auth=require(_0xf464('0x6'));var interaction=require(_0xf464('0x7'));var config=require('../../config/environment');var controller=require(_0xf464('0x8'));router['get']('/',auth[_0xf464('0x9')](),controller[_0xf464('0xa')]);router[_0xf464('0xb')](_0xf464('0xc'),auth[_0xf464('0x9')](),controller['describe']);router['get'](_0xf464('0xd'),auth[_0xf464('0x9')](),controller['show']);router[_0xf464('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf464('0xd'),auth[_0xf464('0x9')](),controller[_0xf464('0xf')]);router[_0xf464('0x10')](_0xf464('0xd'),auth[_0xf464('0x9')](),controller[_0xf464('0x11')]);module[_0xf464('0x12')]=router;
\ No newline at end of file
+var _0x5ad9=['/:id','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x5ad9,0x196));var _0x95ad=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5ad9[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x95ad('0x0'));var util=require('util');var path=require(_0x95ad('0x1'));var timeout=require('connect-timeout');var express=require(_0x95ad('0x2'));var router=express[_0x95ad('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x95ad('0x4'));var interaction=require(_0x95ad('0x5'));var config=require(_0x95ad('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x95ad('0x7')](),controller[_0x95ad('0x8')]);router[_0x95ad('0x9')](_0x95ad('0xa'),auth[_0x95ad('0x7')](),controller[_0x95ad('0xb')]);router[_0x95ad('0x9')](_0x95ad('0xc'),auth[_0x95ad('0x7')](),controller['show']);router[_0x95ad('0xd')]('/',auth[_0x95ad('0x7')](),controller[_0x95ad('0xe')]);router[_0x95ad('0xf')]('/:id',auth[_0x95ad('0x7')](),controller[_0x95ad('0x10')]);router['delete'](_0x95ad('0xc'),auth[_0x95ad('0x7')](),controller[_0x95ad('0x11')]);module[_0x95ad('0x12')]=router;
\ No newline at end of file
index 514afc4..38fa786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0228=['INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]'];(function(_0x239eaf,_0x1968b4){var _0x8863f7=function(_0x1b34d7){while(--_0x1b34d7){_0x239eaf['push'](_0x239eaf['shift']());}};_0x8863f7(++_0x1968b4);}(_0x0228,0x1c3));var _0x8022=function(_0xb47e97,_0x1c9b7b){_0xb47e97=_0xb47e97-0x0;var _0x3dc310=_0x0228[_0xb47e97];return _0x3dc310;};'use strict';var Sequelize=require(_0x8022('0x0'));var moment=require(_0x8022('0x1'));module[_0x8022('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8022('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x8022('0x4'),'comment':_0x8022('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x8022('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4b8224){var _0x1102ce=moment(_0x4b8224);var _0x184594=moment(this[_0x8022('0x7')](_0x8022('0x8')));var _0x576bda=_0x1102ce[_0x8022('0x9')](_0x184594,_0x8022('0xa'));this['setDataValue'](_0x8022('0xb'),_0x4b8224);this[_0x8022('0xc')](_0x8022('0xd'),_0x576bda>=0x0?_0x576bda:null);}},'data1':{'type':Sequelize[_0x8022('0x3')],'comment':_0x8022('0xe')},'data2':{'type':Sequelize[_0x8022('0x3')],'comment':_0x8022('0xf')},'data3':{'type':Sequelize[_0x8022('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x8022('0x10')},'data5':{'type':Sequelize[_0x8022('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x8022('0x3')]},'internal':{'type':Sequelize[_0x8022('0x11')]},'uniqueid':{'type':Sequelize[_0x8022('0x3')]}};
\ No newline at end of file
+var _0x9ce0=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x3896cc,_0xfb344b){var _0x5c4449=function(_0x85309d){while(--_0x85309d){_0x3896cc['push'](_0x3896cc['shift']());}};_0x5c4449(++_0xfb344b);}(_0x9ce0,0x1d8));var _0x09ce=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9ce0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x09ce('0x0'));var moment=require(_0x09ce('0x1'));module[_0x09ce('0x2')]={'channel':{'type':Sequelize[_0x09ce('0x3')]},'membername':{'type':Sequelize[_0x09ce('0x3')]},'interface':{'type':Sequelize[_0x09ce('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x09ce('0x4'),'comment':_0x09ce('0x5')},'duration':{'type':Sequelize[_0x09ce('0x6')]},'enterAt':{'type':Sequelize[_0x09ce('0x7')]},'exitAt':{'type':Sequelize[_0x09ce('0x7')],'set':function(_0x474500){var _0x1ddb44=moment(_0x474500);var _0x3073ca=moment(this['getDataValue']('enterAt'));var _0xa9ed24=_0x1ddb44[_0x09ce('0x8')](_0x3073ca,_0x09ce('0x9'));this[_0x09ce('0xa')](_0x09ce('0xb'),_0x474500);this[_0x09ce('0xa')](_0x09ce('0xc'),_0xa9ed24>=0x0?_0xa9ed24:null);}},'data1':{'type':Sequelize[_0x09ce('0x3')],'comment':_0x09ce('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x09ce('0xe')},'data3':{'type':Sequelize[_0x09ce('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x09ce('0x3')],'comment':_0x09ce('0xf')},'data5':{'type':Sequelize[_0x09ce('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x09ce('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x09ce('0x3')]}};
\ No newline at end of file
index 85c4823..d1ba095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4d605b,_0x57f6ac){var _0x3fdc2c=function(_0x502183){while(--_0x502183){_0x4d605b['push'](_0x4d605b['shift']());}};_0x3fdc2c(++_0x57f6ac);}(_0x3e74,0x175));var _0x43e7=function(_0x4d53ad,_0x68dc96){_0x4d53ad=_0x4d53ad-0x0;var _0x14b2df=_0x3e74[_0x4d53ad];return _0x14b2df;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
+var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x129819,_0x234edc){var _0x3199ac=function(_0x53b739){while(--_0x53b739){_0x129819['push'](_0x129819['shift']());}};_0x3199ac(++_0x234edc);}(_0x3e74,0x175));var _0x43e7=function(_0x4357d2,_0x18c181){_0x4357d2=_0x4357d2-0x0;var _0x5e7983=_0x3e74[_0x4357d2];return _0x5e7983;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
index b4c8e8c..06a06f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce2f=['interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0xce2f,0x1d1));var _0xfce2=function(_0x4d039d,_0x57ce26){_0x4d039d=_0x4d039d-0x0;var _0x4142fe=_0xce2f[_0x4d039d];return _0x4142fe;};'use strict';var _=require(_0xfce2('0x0'));var util=require(_0xfce2('0x1'));var logger=require(_0xfce2('0x2'))(_0xfce2('0x3'));var moment=require(_0xfce2('0x4'));var BPromise=require(_0xfce2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfce2('0x6'));var rimraf=require('rimraf');var config=require(_0xfce2('0x7'));var attributes=require(_0xfce2('0x8'));module[_0xfce2('0x9')]=function(_0x5346c3,_0x2494ed){return _0x5346c3[_0xfce2('0xa')](_0xfce2('0xb'),attributes,{'tableName':_0xfce2('0xc'),'paranoid':![],'indexes':[{'name':_0xfce2('0xd'),'fields':[_0xfce2('0xe'),_0xfce2('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xea1c=['api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','../../config/logger'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcea1('0x0'))(_0xcea1('0x1'));var moment=require(_0xcea1('0x2'));var BPromise=require(_0xcea1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcea1('0x4'));var rimraf=require(_0xcea1('0x5'));var config=require(_0xcea1('0x6'));var attributes=require(_0xcea1('0x7'));module[_0xcea1('0x8')]=function(_0x1ff8bf,_0x29732f){return _0x1ff8bf[_0xcea1('0x9')](_0xcea1('0xa'),attributes,{'tableName':_0xcea1('0xb'),'paranoid':![],'indexes':[{'name':_0xcea1('0xc'),'fields':['membername',_0xcea1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 530cb10..54a5a36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x280b=['create','update','body','where','UpdateMemberReport','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','debug','CreateMemberReport'];(function(_0x2fffcb,_0x1f07a3){var _0x576783=function(_0x473898){while(--_0x473898){_0x2fffcb['push'](_0x2fffcb['shift']());}};_0x576783(++_0x1f07a3);}(_0x280b,0xce));var _0xb280=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x280b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var moment=require('moment');var BPromise=require(_0xb280('0x2'));var rs=require(_0xb280('0x3'));var fs=require('fs');var Redis=require(_0xb280('0x4'));var db=require(_0xb280('0x5'))['db'];var utils=require(_0xb280('0x6'));var logger=require(_0xb280('0x7'))(_0xb280('0x8'));var config=require(_0xb280('0x9'));var jayson=require(_0xb280('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43e0ee,_0x27474c,_0x5c98b9){return new BPromise(function(_0x12433f,_0xab1fa7){return client[_0xb280('0xb')](_0x43e0ee,_0x5c98b9)[_0xb280('0xc')](function(_0x2322ff){logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');logger['debug'](_0xb280('0xf'),_0x27474c,_0xb280('0x10'),JSON['stringify'](_0x2322ff));if(_0x2322ff[_0xb280('0x11')]){if(_0x2322ff[_0xb280('0x11')][_0xb280('0x12')]===0x1f4){logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0xab1fa7(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0x12433f(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}else{logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');_0x12433f(_0x2322ff[_0xb280('0x14')]['message']);}})[_0xb280('0x15')](function(_0x17be3b){logger['error'](_0xb280('0xe'),_0x27474c,_0x17be3b);_0xab1fa7(_0x17be3b);});});}exports[_0xb280('0x16')]=function(_0x110bcb){var _0x38d5d8=this;return new Promise(function(_0x2c5273,_0x43abc7){return db[_0xb280('0x17')][_0xb280('0x18')]({'raw':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1a')]===undefined?!![]:![]:!![],'where':_0x110bcb['options']?_0x110bcb[_0xb280('0x19')]['where']||null:null,'attributes':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1b')]||null:null,'limit':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1c')]||null:null,'include':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')]['include']?_[_0xb280('0x1d')](_0x110bcb[_0xb280('0x19')][_0xb280('0x1e')],function(_0x5a1e08){return{'model':db[_0x5a1e08['model']],'as':_0x5a1e08['as'],'attributes':_0x5a1e08[_0xb280('0x1b')],'include':_0x5a1e08['include']?_['map'](_0x5a1e08['include'],function(_0x1bda8e){return{'model':db[_0x1bda8e[_0xb280('0x1f')]],'as':_0x1bda8e['as'],'attributes':_0x1bda8e[_0xb280('0x1b')],'include':_0x1bda8e[_0xb280('0x1e')]?_[_0xb280('0x1d')](_0x1bda8e['include'],function(_0x3cf460){return{'model':db[_0x3cf460[_0xb280('0x1f')]],'as':_0x3cf460['as'],'attributes':_0x3cf460[_0xb280('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb280('0xc')](function(_0x54ae51){logger['info'](_0xb280('0x16'),_0x110bcb);logger[_0xb280('0x20')](_0xb280('0x16'),_0x110bcb,JSON['stringify'](_0x54ae51));_0x2c5273(_0x54ae51);})[_0xb280('0x15')](function(_0x25c8e9){logger['error'](_0xb280('0x16'),_0x25c8e9[_0xb280('0x13')],_0x110bcb);_0x43abc7(_0x38d5d8[_0xb280('0x11')](0x1f4,_0x25c8e9[_0xb280('0x13')]));});});};exports[_0xb280('0x21')]=function(_0x45b948){var _0x1c6002=this;return new Promise(function(_0x22b658,_0xc077c){return db['MemberReport'][_0xb280('0x22')](_0x45b948['body'],{'raw':_0x45b948['options']?_0x45b948['options'][_0xb280('0x1a')]===undefined?!![]:![]:!![]})[_0xb280('0xc')](function(_0x59344d){logger['info'](_0xb280('0x21'),_0x45b948);logger[_0xb280('0x20')](_0xb280('0x21'),_0x45b948,JSON['stringify'](_0x59344d));_0x22b658(_0x59344d);})['catch'](function(_0x32c14f){logger[_0xb280('0x11')](_0xb280('0x21'),_0x32c14f['message'],_0x45b948);_0xc077c(_0x1c6002[_0xb280('0x11')](0x1f4,_0x32c14f['message']));});});};exports['UpdateMemberReport']=function(_0x25fe44){var _0x553e9a=this;return new Promise(function(_0x131171,_0x28c4f3){return db[_0xb280('0x17')][_0xb280('0x23')](_0x25fe44[_0xb280('0x24')],{'raw':_0x25fe44['options']?_0x25fe44['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25fe44[_0xb280('0x19')]?_0x25fe44['options'][_0xb280('0x25')]||null:null,'attributes':_0x25fe44[_0xb280('0x19')]?_0x25fe44['options']['attributes']||null:null,'limit':_0x25fe44['options']?_0x25fe44[_0xb280('0x19')][_0xb280('0x1c')]||null:null})[_0xb280('0xc')](function(_0x4f1642){logger[_0xb280('0xd')](_0xb280('0x26'),_0x25fe44);logger[_0xb280('0x20')](_0xb280('0x26'),_0x25fe44,JSON[_0xb280('0x27')](_0x4f1642));_0x131171(_0x4f1642);})[_0xb280('0x15')](function(_0x1b6868){logger['error'](_0xb280('0x26'),_0x1b6868['message'],_0x25fe44);_0x28c4f3(_0x553e9a['error'](0x1f4,_0x1b6868['message']));});});};
\ No newline at end of file
+var _0xdc86=['limit','include','map','model','CreateMemberReport','body','UpdateMemberReport','update','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','options','raw','where','attributes'];(function(_0x1f150e,_0x6db86a){var _0x377542=function(_0x2ab69a){while(--_0x2ab69a){_0x1f150e['push'](_0x1f150e['shift']());}};_0x377542(++_0x6db86a);}(_0xdc86,0x118));var _0x6dc8=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xdc86[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require(_0x6dc8('0x0'));var moment=require('moment');var BPromise=require(_0x6dc8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dc8('0x2'));var db=require(_0x6dc8('0x3'))['db'];var utils=require(_0x6dc8('0x4'));var logger=require(_0x6dc8('0x5'))(_0x6dc8('0x6'));var config=require('../../config/environment');var jayson=require(_0x6dc8('0x7'));var client=jayson[_0x6dc8('0x8')][_0x6dc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b1bcc,_0x39a67e,_0x1f41c7){return new BPromise(function(_0x41bdf5,_0x235de4){return client['request'](_0x9b1bcc,_0x1f41c7)[_0x6dc8('0xa')](function(_0x58dfa6){logger[_0x6dc8('0xb')](_0x6dc8('0xc'),_0x39a67e,_0x6dc8('0xd'));logger[_0x6dc8('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x39a67e,_0x6dc8('0xd'),JSON[_0x6dc8('0xf')](_0x58dfa6));if(_0x58dfa6[_0x6dc8('0x10')]){if(_0x58dfa6[_0x6dc8('0x10')][_0x6dc8('0x11')]===0x1f4){logger[_0x6dc8('0x10')]('MemberReport,\x20%s,\x20%s',_0x39a67e,_0x58dfa6[_0x6dc8('0x10')]['message']);return _0x235de4(_0x58dfa6['error'][_0x6dc8('0x12')]);}logger[_0x6dc8('0x10')](_0x6dc8('0xc'),_0x39a67e,_0x58dfa6['error'][_0x6dc8('0x12')]);return _0x41bdf5(_0x58dfa6[_0x6dc8('0x10')][_0x6dc8('0x12')]);}else{logger[_0x6dc8('0xb')](_0x6dc8('0xc'),_0x39a67e,_0x6dc8('0xd'));_0x41bdf5(_0x58dfa6[_0x6dc8('0x13')][_0x6dc8('0x12')]);}})[_0x6dc8('0x14')](function(_0x4c990b){logger['error'](_0x6dc8('0xc'),_0x39a67e,_0x4c990b);_0x235de4(_0x4c990b);});});}exports[_0x6dc8('0x15')]=function(_0x209ae4){var _0x3c8a6d=this;return new Promise(function(_0x2f3b94,_0x54065b){return db['MemberReport']['findAll']({'raw':_0x209ae4[_0x6dc8('0x16')]?_0x209ae4['options'][_0x6dc8('0x17')]===undefined?!![]:![]:!![],'where':_0x209ae4['options']?_0x209ae4[_0x6dc8('0x16')][_0x6dc8('0x18')]||null:null,'attributes':_0x209ae4[_0x6dc8('0x16')]?_0x209ae4[_0x6dc8('0x16')][_0x6dc8('0x19')]||null:null,'limit':_0x209ae4[_0x6dc8('0x16')]?_0x209ae4[_0x6dc8('0x16')][_0x6dc8('0x1a')]||null:null,'include':_0x209ae4[_0x6dc8('0x16')]?_0x209ae4['options'][_0x6dc8('0x1b')]?_[_0x6dc8('0x1c')](_0x209ae4[_0x6dc8('0x16')]['include'],function(_0xf69b){return{'model':db[_0xf69b['model']],'as':_0xf69b['as'],'attributes':_0xf69b[_0x6dc8('0x19')],'include':_0xf69b[_0x6dc8('0x1b')]?_[_0x6dc8('0x1c')](_0xf69b['include'],function(_0x56895f){return{'model':db[_0x56895f[_0x6dc8('0x1d')]],'as':_0x56895f['as'],'attributes':_0x56895f[_0x6dc8('0x19')],'include':_0x56895f['include']?_[_0x6dc8('0x1c')](_0x56895f[_0x6dc8('0x1b')],function(_0x36b904){return{'model':db[_0x36b904['model']],'as':_0x36b904['as'],'attributes':_0x36b904['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dc8('0xa')](function(_0x15d815){logger['info'](_0x6dc8('0x15'),_0x209ae4);logger['debug']('GetMemberReport',_0x209ae4,JSON['stringify'](_0x15d815));_0x2f3b94(_0x15d815);})[_0x6dc8('0x14')](function(_0x283a42){logger[_0x6dc8('0x10')](_0x6dc8('0x15'),_0x283a42[_0x6dc8('0x12')],_0x209ae4);_0x54065b(_0x3c8a6d[_0x6dc8('0x10')](0x1f4,_0x283a42[_0x6dc8('0x12')]));});});};exports[_0x6dc8('0x1e')]=function(_0x38b4ff){var _0x25c6ab=this;return new Promise(function(_0x48a512,_0xf9c6c0){return db['MemberReport']['create'](_0x38b4ff[_0x6dc8('0x1f')],{'raw':_0x38b4ff[_0x6dc8('0x16')]?_0x38b4ff[_0x6dc8('0x16')][_0x6dc8('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3f1f07){logger['info'](_0x6dc8('0x1e'),_0x38b4ff);logger['debug'](_0x6dc8('0x1e'),_0x38b4ff,JSON[_0x6dc8('0xf')](_0x3f1f07));_0x48a512(_0x3f1f07);})['catch'](function(_0x2f5312){logger[_0x6dc8('0x10')]('CreateMemberReport',_0x2f5312[_0x6dc8('0x12')],_0x38b4ff);_0xf9c6c0(_0x25c6ab[_0x6dc8('0x10')](0x1f4,_0x2f5312[_0x6dc8('0x12')]));});});};exports[_0x6dc8('0x20')]=function(_0x2a6371){var _0x4a1c73=this;return new Promise(function(_0x5a4e9d,_0x10b42b){return db['MemberReport'][_0x6dc8('0x21')](_0x2a6371[_0x6dc8('0x1f')],{'raw':_0x2a6371['options']?_0x2a6371['options'][_0x6dc8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a6371['options']?_0x2a6371[_0x6dc8('0x16')][_0x6dc8('0x18')]||null:null,'attributes':_0x2a6371[_0x6dc8('0x16')]?_0x2a6371[_0x6dc8('0x16')][_0x6dc8('0x19')]||null:null,'limit':_0x2a6371[_0x6dc8('0x16')]?_0x2a6371[_0x6dc8('0x16')]['limit']||null:null})[_0x6dc8('0xa')](function(_0x2b1102){logger[_0x6dc8('0xb')](_0x6dc8('0x20'),_0x2a6371);logger[_0x6dc8('0xe')](_0x6dc8('0x20'),_0x2a6371,JSON[_0x6dc8('0xf')](_0x2b1102));_0x5a4e9d(_0x2b1102);})[_0x6dc8('0x14')](function(_0x270cf2){logger['error']('UpdateMemberReport',_0x270cf2[_0x6dc8('0x12')],_0x2a6371);_0x10b42b(_0x4a1c73[_0x6dc8('0x10')](0x1f4,_0x270cf2['message']));});});};
\ No newline at end of file
index b884a52..4aeb896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae4=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0xe9b175,_0x1f5ebb){var _0x263a78=function(_0x42bf1a){while(--_0x42bf1a){_0xe9b175['push'](_0xe9b175['shift']());}};_0x263a78(++_0x1f5ebb);}(_0xeae4,0x78));var _0x4eae=function(_0x3cc648,_0x14a1d7){_0x3cc648=_0x3cc648-0x0;var _0x1fb431=_0xeae4[_0x3cc648];return _0x1fb431;};'use strict';var multer=require(_0x4eae('0x0'));var util=require(_0x4eae('0x1'));var path=require('path');var timeout=require(_0x4eae('0x2'));var express=require(_0x4eae('0x3'));var router=express[_0x4eae('0x4')]();var fs_extra=require(_0x4eae('0x5'));var auth=require(_0x4eae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eae('0x7'));var controller=require(_0x4eae('0x8'));router[_0x4eae('0x9')]('/',controller[_0x4eae('0xa')]);module[_0x4eae('0xb')]=router;
\ No newline at end of file
+var _0x1136=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','path'];(function(_0xf3ab29,_0x555045){var _0x5732ef=function(_0x382eb6){while(--_0x382eb6){_0xf3ab29['push'](_0xf3ab29['shift']());}};_0x5732ef(++_0x555045);}(_0x1136,0x1a2));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x6113('0x0'));var util=require('util');var path=require(_0x6113('0x1'));var timeout=require('connect-timeout');var express=require(_0x6113('0x2'));var router=express[_0x6113('0x3')]();var fs_extra=require(_0x6113('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6113('0x5'));var config=require(_0x6113('0x6'));var controller=require(_0x6113('0x7'));router['get']('/',controller[_0x6113('0x8')]);module[_0x6113('0x9')]=router;
\ No newline at end of file
index a95270b..c92ddf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb76=['STRING','version','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb76,0x191));var _0x6bb7=function(_0x3dd8dd,_0x369f8e){_0x3dd8dd=_0x3dd8dd-0x0;var _0x33e300=_0xbb76[_0x3dd8dd];return _0x33e300;};'use strict';var Sequelize=require(_0x6bb7('0x0'));module['exports']={'version':{'type':Sequelize[_0x6bb7('0x1')],'unique':_0x6bb7('0x2')}};
\ No newline at end of file
+var _0x20a5=['sequelize','exports','STRING'];(function(_0x286447,_0x25a02b){var _0xadc5b5=function(_0x50b839){while(--_0x50b839){_0x286447['push'](_0x286447['shift']());}};_0xadc5b5(++_0x25a02b);}(_0x20a5,0xf9));var _0x520a=function(_0x35c76d,_0x7d0bd8){_0x35c76d=_0x35c76d-0x0;var _0x3b5919=_0x20a5[_0x35c76d];return _0x3b5919;};'use strict';var Sequelize=require(_0x520a('0x0'));module[_0x520a('0x1')]={'version':{'type':Sequelize[_0x520a('0x2')],'unique':'version'}};
\ No newline at end of file
index 7aae63b..7a7c4d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bdb=['ioredis','../../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','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','Migration','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x4bdb,0xc4));var _0xb4bd=function(_0x3f20c7,_0x455fde){_0x3f20c7=_0x3f20c7-0x0;var _0x35f12f=_0x4bdb[_0x3f20c7];return _0x35f12f;};'use strict';var emlformat=require(_0xb4bd('0x0'));var rimraf=require(_0xb4bd('0x1'));var zipdir=require(_0xb4bd('0x2'));var jsonpatch=require(_0xb4bd('0x3'));var rp=require(_0xb4bd('0x4'));var moment=require(_0xb4bd('0x5'));var BPromise=require(_0xb4bd('0x6'));var Mustache=require(_0xb4bd('0x7'));var util=require(_0xb4bd('0x8'));var path=require(_0xb4bd('0x9'));var sox=require(_0xb4bd('0xa'));var csv=require(_0xb4bd('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4bd('0xc'));var crypto=require(_0xb4bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb4bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb4bd('0xf'));var Papa=require(_0xb4bd('0x10'));var Redis=require(_0xb4bd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb4bd('0x12'));var as=require(_0xb4bd('0x13'));var hardwareService=require(_0xb4bd('0x14'));var logger=require(_0xb4bd('0x15'))(_0xb4bd('0x16'));var utils=require('../../config/utils');var config=require(_0xb4bd('0x17'));var licenseUtil=require(_0xb4bd('0x18'));var db=require(_0xb4bd('0x19'))['db'];function respondWithStatusCode(_0x17c780,_0x2a91d4){_0x2a91d4=_0x2a91d4||0xcc;return function(_0x4bdf22){if(_0x4bdf22){return _0x17c780['sendStatus'](_0x2a91d4);}return _0x17c780[_0xb4bd('0x1a')](_0x2a91d4)[_0xb4bd('0x1b')]();};}function respondWithResult(_0x19ac97,_0xf7bb60){_0xf7bb60=_0xf7bb60||0xc8;return function(_0x2d36e3){if(_0x2d36e3){return _0x19ac97[_0xb4bd('0x1a')](_0xf7bb60)[_0xb4bd('0x1c')](_0x2d36e3);}};}function respondWithFilteredResult(_0x13fb97,_0x361073){return function(_0x47caf9){if(_0x47caf9){var _0x4f13de=typeof _0x361073[_0xb4bd('0x1d')]===_0xb4bd('0x1e')&&typeof _0x361073[_0xb4bd('0x1f')]===_0xb4bd('0x1e');var _0x4d0de0=_0x47caf9[_0xb4bd('0x20')];var _0x39142f=_0x4f13de?0x0:_0x361073['offset'];var _0x183c1f=_0x4f13de?_0x47caf9[_0xb4bd('0x20')]:_0x361073[_0xb4bd('0x1d')]+_0x361073[_0xb4bd('0x1f')];var _0x2cf9eb;if(_0x183c1f>=_0x4d0de0){_0x183c1f=_0x4d0de0;_0x2cf9eb=0xc8;}else{_0x2cf9eb=0xce;}_0x13fb97[_0xb4bd('0x1a')](_0x2cf9eb);return _0x13fb97[_0xb4bd('0x21')]('Content-Range',_0x39142f+'-'+_0x183c1f+'/'+_0x4d0de0)[_0xb4bd('0x1c')](_0x47caf9);}return null;};}function patchUpdates(_0x54b4c9){return function(_0x3843b4){try{jsonpatch[_0xb4bd('0x22')](_0x3843b4,_0x54b4c9,!![]);}catch(_0x2101af){return BPromise[_0xb4bd('0x23')](_0x2101af);}return _0x3843b4[_0xb4bd('0x24')]();};}function saveUpdates(_0x273799,_0xbd5f87){return function(_0x2eb2e8){if(_0x2eb2e8){return _0x2eb2e8[_0xb4bd('0x25')](_0x273799)[_0xb4bd('0x26')](function(_0x318622){return _0x318622;});}return null;};}function removeEntity(_0x172bdd,_0x5b537b){return function(_0x595def){if(_0x595def){return _0x595def[_0xb4bd('0x27')]()['then'](function(){_0x172bdd[_0xb4bd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4a4d,_0x4ad485){return function(_0x227fac){if(!_0x227fac){_0x2d4a4d[_0xb4bd('0x28')](0x194);}return _0x227fac;};}function handleError(_0x2b6030,_0x3de903){_0x3de903=_0x3de903||0x1f4;return function(_0x457cfe){logger[_0xb4bd('0x29')](_0x457cfe[_0xb4bd('0x2a')]);if(_0x457cfe['name']){delete _0x457cfe['name'];}_0x2b6030[_0xb4bd('0x1a')](_0x3de903)[_0xb4bd('0x2b')](_0x457cfe);};}exports[_0xb4bd('0x2c')]=function(_0x55f0f,_0x31b9a8){var _0x4ce8c2={},_0x520650={},_0x54cad4={'count':0x0,'rows':[]};var _0x2785ff=_[_0xb4bd('0x2d')](db[_0xb4bd('0x2e')]['rawAttributes'],function(_0x3484f7){return{'name':_0x3484f7['fieldName'],'type':_0x3484f7[_0xb4bd('0x2f')]['key']};});_0x520650[_0xb4bd('0x30')]=_['map'](_0x2785ff,_0xb4bd('0x31'));_0x520650[_0xb4bd('0x32')]=_[_0xb4bd('0x33')](_0x55f0f['query']);_0x520650['filters']=_[_0xb4bd('0x34')](_0x520650[_0xb4bd('0x30')],_0x520650[_0xb4bd('0x32')]);_0x4ce8c2[_0xb4bd('0x35')]=_[_0xb4bd('0x34')](_0x520650[_0xb4bd('0x30')],qs['fields'](_0x55f0f[_0xb4bd('0x32')][_0xb4bd('0x36')]));_0x4ce8c2[_0xb4bd('0x35')]=_0x4ce8c2[_0xb4bd('0x35')][_0xb4bd('0x37')]?_0x4ce8c2['attributes']:_0x520650[_0xb4bd('0x30')];if(!_0x55f0f[_0xb4bd('0x32')][_0xb4bd('0x38')](_0xb4bd('0x39'))){_0x4ce8c2[_0xb4bd('0x1f')]=qs['limit'](_0x55f0f['query']['limit']);_0x4ce8c2[_0xb4bd('0x1d')]=qs[_0xb4bd('0x1d')](_0x55f0f[_0xb4bd('0x32')][_0xb4bd('0x1d')]);}_0x4ce8c2[_0xb4bd('0x3a')]=qs[_0xb4bd('0x3b')](_0x55f0f[_0xb4bd('0x32')][_0xb4bd('0x3b')]);_0x4ce8c2['where']=qs[_0xb4bd('0x3c')](_['pick'](_0x55f0f[_0xb4bd('0x32')],_0x520650[_0xb4bd('0x3c')]),_0x2785ff);if(_0x55f0f[_0xb4bd('0x32')][_0xb4bd('0x3d')]){_0x4ce8c2[_0xb4bd('0x3e')]=_[_0xb4bd('0x3f')](_0x4ce8c2[_0xb4bd('0x3e')],{'$or':_[_0xb4bd('0x2d')](_0x2785ff,function(_0x48e4c0){if(_0x48e4c0['type']!==_0xb4bd('0x40')){var _0x1cb28c={};_0x1cb28c[_0x48e4c0['name']]={'$like':'%'+_0x55f0f[_0xb4bd('0x32')]['filter']+'%'};return _0x1cb28c;}})});}_0x4ce8c2=_[_0xb4bd('0x3f')]({},_0x4ce8c2,_0x55f0f[_0xb4bd('0x41')]);var _0x39825a={'where':_0x4ce8c2[_0xb4bd('0x3e')]};return db[_0xb4bd('0x2e')][_0xb4bd('0x20')](_0x39825a)[_0xb4bd('0x26')](function(_0x294aff){_0x54cad4['count']=_0x294aff;if(_0x55f0f['query'][_0xb4bd('0x42')]){_0x4ce8c2[_0xb4bd('0x43')]=[{'all':!![]}];}return db['Migration'][_0xb4bd('0x44')](_0x4ce8c2);})[_0xb4bd('0x26')](function(_0x4a2db2){_0x54cad4[_0xb4bd('0x45')]=_0x4a2db2;return _0x54cad4;})[_0xb4bd('0x26')](respondWithFilteredResult(_0x31b9a8,_0x4ce8c2))[_0xb4bd('0x46')](handleError(_0x31b9a8,null));};
\ No newline at end of file
+var _0x89eb=['update','then','destroy','error','name','send','Migration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save'];(function(_0x23ad13,_0x2d396c){var _0xefc828=function(_0x1261eb){while(--_0x1261eb){_0x23ad13['push'](_0x23ad13['shift']());}};_0xefc828(++_0x2d396c);}(_0x89eb,0xf4));var _0xb89e=function(_0x29bafc,_0x519f84){_0x29bafc=_0x29bafc-0x0;var _0x17d8fa=_0x89eb[_0x29bafc];return _0x17d8fa;};'use strict';var emlformat=require(_0xb89e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb89e('0x1'));var rp=require(_0xb89e('0x2'));var moment=require(_0xb89e('0x3'));var BPromise=require(_0xb89e('0x4'));var Mustache=require(_0xb89e('0x5'));var util=require(_0xb89e('0x6'));var path=require(_0xb89e('0x7'));var sox=require(_0xb89e('0x8'));var csv=require(_0xb89e('0x9'));var ejs=require(_0xb89e('0xa'));var fs=require('fs');var fs_extra=require(_0xb89e('0xb'));var _=require(_0xb89e('0xc'));var squel=require(_0xb89e('0xd'));var crypto=require(_0xb89e('0xe'));var jsforce=require(_0xb89e('0xf'));var deskjs=require(_0xb89e('0x10'));var toCsv=require(_0xb89e('0x9'));var querystring=require(_0xb89e('0x11'));var Papa=require(_0xb89e('0x12'));var Redis=require(_0xb89e('0x13'));var authService=require(_0xb89e('0x14'));var qs=require(_0xb89e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb89e('0x16'));var logger=require(_0xb89e('0x17'))(_0xb89e('0x18'));var utils=require(_0xb89e('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb89e('0x1a'));var db=require(_0xb89e('0x1b'))['db'];function respondWithStatusCode(_0x5afed2,_0x2b3b7d){_0x2b3b7d=_0x2b3b7d||0xcc;return function(_0x4a58b6){if(_0x4a58b6){return _0x5afed2[_0xb89e('0x1c')](_0x2b3b7d);}return _0x5afed2[_0xb89e('0x1d')](_0x2b3b7d)[_0xb89e('0x1e')]();};}function respondWithResult(_0x5380aa,_0x2b0f90){_0x2b0f90=_0x2b0f90||0xc8;return function(_0x3850bf){if(_0x3850bf){return _0x5380aa[_0xb89e('0x1d')](_0x2b0f90)['json'](_0x3850bf);}};}function respondWithFilteredResult(_0xa0fafc,_0x2a6d05){return function(_0x2f3e6d){if(_0x2f3e6d){var _0x4ded4a=typeof _0x2a6d05[_0xb89e('0x1f')]==='undefined'&&typeof _0x2a6d05[_0xb89e('0x20')]===_0xb89e('0x21');var _0x49ec17=_0x2f3e6d[_0xb89e('0x22')];var _0x3e9dc0=_0x4ded4a?0x0:_0x2a6d05[_0xb89e('0x1f')];var _0x106524=_0x4ded4a?_0x2f3e6d[_0xb89e('0x22')]:_0x2a6d05[_0xb89e('0x1f')]+_0x2a6d05[_0xb89e('0x20')];var _0x3aba3c;if(_0x106524>=_0x49ec17){_0x106524=_0x49ec17;_0x3aba3c=0xc8;}else{_0x3aba3c=0xce;}_0xa0fafc[_0xb89e('0x1d')](_0x3aba3c);return _0xa0fafc['set'](_0xb89e('0x23'),_0x3e9dc0+'-'+_0x106524+'/'+_0x49ec17)[_0xb89e('0x24')](_0x2f3e6d);}return null;};}function patchUpdates(_0x491729){return function(_0x75a49a){try{jsonpatch[_0xb89e('0x25')](_0x75a49a,_0x491729,!![]);}catch(_0x21bbb1){return BPromise[_0xb89e('0x26')](_0x21bbb1);}return _0x75a49a[_0xb89e('0x27')]();};}function saveUpdates(_0xb24783,_0x302efb){return function(_0x52e527){if(_0x52e527){return _0x52e527[_0xb89e('0x28')](_0xb24783)[_0xb89e('0x29')](function(_0x22cb13){return _0x22cb13;});}return null;};}function removeEntity(_0x19c60c,_0x190328){return function(_0x44f79b){if(_0x44f79b){return _0x44f79b[_0xb89e('0x2a')]()[_0xb89e('0x29')](function(){_0x19c60c['status'](0xcc)[_0xb89e('0x1e')]();});}};}function handleEntityNotFound(_0x43367b,_0x278392){return function(_0xd4b901){if(!_0xd4b901){_0x43367b[_0xb89e('0x1c')](0x194);}return _0xd4b901;};}function handleError(_0x526bea,_0x2a569e){_0x2a569e=_0x2a569e||0x1f4;return function(_0x3af0d9){logger[_0xb89e('0x2b')](_0x3af0d9['stack']);if(_0x3af0d9[_0xb89e('0x2c')]){delete _0x3af0d9[_0xb89e('0x2c')];}_0x526bea[_0xb89e('0x1d')](_0x2a569e)[_0xb89e('0x2d')](_0x3af0d9);};}exports['index']=function(_0x142914,_0x35f150){var _0xa5995a={},_0x1c001c={},_0x1da338={'count':0x0,'rows':[]};var _0x227155=_['map'](db[_0xb89e('0x2e')]['rawAttributes'],function(_0x2c7b89){return{'name':_0x2c7b89[_0xb89e('0x2f')],'type':_0x2c7b89[_0xb89e('0x30')][_0xb89e('0x31')]};});_0x1c001c[_0xb89e('0x32')]=_[_0xb89e('0x33')](_0x227155,_0xb89e('0x2c'));_0x1c001c[_0xb89e('0x34')]=_[_0xb89e('0x35')](_0x142914[_0xb89e('0x34')]);_0x1c001c[_0xb89e('0x36')]=_[_0xb89e('0x37')](_0x1c001c[_0xb89e('0x32')],_0x1c001c['query']);_0xa5995a[_0xb89e('0x38')]=_[_0xb89e('0x37')](_0x1c001c['model'],qs['fields'](_0x142914['query'][_0xb89e('0x39')]));_0xa5995a[_0xb89e('0x38')]=_0xa5995a['attributes'][_0xb89e('0x3a')]?_0xa5995a['attributes']:_0x1c001c[_0xb89e('0x32')];if(!_0x142914['query']['hasOwnProperty'](_0xb89e('0x3b'))){_0xa5995a['limit']=qs['limit'](_0x142914[_0xb89e('0x34')]['limit']);_0xa5995a[_0xb89e('0x1f')]=qs[_0xb89e('0x1f')](_0x142914['query'][_0xb89e('0x1f')]);}_0xa5995a[_0xb89e('0x3c')]=qs[_0xb89e('0x3d')](_0x142914['query'][_0xb89e('0x3d')]);_0xa5995a[_0xb89e('0x3e')]=qs[_0xb89e('0x36')](_[_0xb89e('0x3f')](_0x142914[_0xb89e('0x34')],_0x1c001c[_0xb89e('0x36')]),_0x227155);if(_0x142914['query'][_0xb89e('0x40')]){_0xa5995a[_0xb89e('0x3e')]=_['merge'](_0xa5995a[_0xb89e('0x3e')],{'$or':_[_0xb89e('0x33')](_0x227155,function(_0x5282c1){if(_0x5282c1[_0xb89e('0x30')]!==_0xb89e('0x41')){var _0x1c6a28={};_0x1c6a28[_0x5282c1['name']]={'$like':'%'+_0x142914[_0xb89e('0x34')]['filter']+'%'};return _0x1c6a28;}})});}_0xa5995a=_['merge']({},_0xa5995a,_0x142914[_0xb89e('0x42')]);var _0x8e2336={'where':_0xa5995a['where']};return db[_0xb89e('0x2e')][_0xb89e('0x22')](_0x8e2336)[_0xb89e('0x29')](function(_0x323f05){_0x1da338[_0xb89e('0x22')]=_0x323f05;if(_0x142914[_0xb89e('0x34')][_0xb89e('0x43')]){_0xa5995a[_0xb89e('0x44')]=[{'all':!![]}];}return db['Migration'][_0xb89e('0x45')](_0xa5995a);})['then'](function(_0x2776fe){_0x1da338[_0xb89e('0x46')]=_0x2776fe;return _0x1da338;})[_0xb89e('0x29')](respondWithFilteredResult(_0x35f150,_0xa5995a))['catch'](handleError(_0x35f150,null));};
\ No newline at end of file
index 22487ee..71965da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbddb=['Migration','migrations','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','define'];(function(_0x298801,_0x33d454){var _0x20f460=function(_0x580328){while(--_0x580328){_0x298801['push'](_0x298801['shift']());}};_0x20f460(++_0x33d454);}(_0xbddb,0x16a));var _0xbbdd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbddb[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xbbdd('0x0'));var util=require('util');var logger=require(_0xbbdd('0x1'))(_0xbbdd('0x2'));var moment=require('moment');var BPromise=require(_0xbbdd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbdd('0x4'));var rimraf=require(_0xbbdd('0x5'));var config=require(_0xbbdd('0x6'));var attributes=require(_0xbbdd('0x7'));module[_0xbbdd('0x8')]=function(_0x1ea7c5,_0x2f20ac){return _0x1ea7c5[_0xbbdd('0x9')](_0xbbdd('0xa'),attributes,{'tableName':_0xbbdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x75e6=['request-promise','rimraf','../../config/environment','exports','define','Migration','migrations','api','bluebird'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x75e6,0x1c0));var _0x675e=function(_0x5d4b1a,_0x30243f){_0x5d4b1a=_0x5d4b1a-0x0;var _0x3444c1=_0x75e6[_0x5d4b1a];return _0x3444c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x675e('0x0'));var moment=require('moment');var BPromise=require(_0x675e('0x1'));var rp=require(_0x675e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x675e('0x3'));var config=require(_0x675e('0x4'));var attributes=require('./migration.attributes');module[_0x675e('0x5')]=function(_0x174852,_0x10de35){return _0x174852[_0x675e('0x6')](_0x675e('0x7'),attributes,{'tableName':_0x675e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 95a0639..2c9eb96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb010=['client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb010,0x8b));var _0x0b01=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb010[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x0b01('0x0'));var moment=require('moment');var BPromise=require(_0x0b01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b01('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b01('0x3'));var logger=require(_0x0b01('0x4'))(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var jayson=require(_0x0b01('0x7'));var client=jayson[_0x0b01('0x8')][_0x0b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c65ed,_0x824a23,_0x33eb05){return new BPromise(function(_0xcdfdfd,_0x15364b){return client[_0x0b01('0xa')](_0x3c65ed,_0x33eb05)['then'](function(_0x46d839){logger[_0x0b01('0xb')](_0x0b01('0xc'),_0x824a23,_0x0b01('0xd'));logger[_0x0b01('0xe')](_0x0b01('0xf'),_0x824a23,_0x0b01('0xd'),JSON[_0x0b01('0x10')](_0x46d839));if(_0x46d839[_0x0b01('0x11')]){if(_0x46d839[_0x0b01('0x11')]['code']===0x1f4){logger[_0x0b01('0x11')](_0x0b01('0xc'),_0x824a23,_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);return _0x15364b(_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);}logger[_0x0b01('0x11')]('Migration,\x20%s,\x20%s',_0x824a23,_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);return _0xcdfdfd(_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);}else{logger[_0x0b01('0xb')](_0x0b01('0xc'),_0x824a23,_0x0b01('0xd'));_0xcdfdfd(_0x46d839[_0x0b01('0x13')][_0x0b01('0x12')]);}})[_0x0b01('0x14')](function(_0x458baf){logger[_0x0b01('0x11')]('Migration,\x20%s,\x20%s',_0x824a23,_0x458baf);_0x15364b(_0x458baf);});});}
\ No newline at end of file
+var _0xb75c=['request\x20sent','error','code','message','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','Migration,\x20%s,\x20%s','debug'];(function(_0x499a19,_0x3c643d){var _0x27316a=function(_0x1c00b4){while(--_0x1c00b4){_0x499a19['push'](_0x499a19['shift']());}};_0x27316a(++_0x3c643d);}(_0xb75c,0x1ce));var _0xcb75=function(_0x1dce41,_0x3373ba){_0x1dce41=_0x1dce41-0x0;var _0x7642e1=_0xb75c[_0x1dce41];return _0x7642e1;};'use strict';var _=require(_0xcb75('0x0'));var util=require(_0xcb75('0x1'));var moment=require(_0xcb75('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb75('0x4'))['db'];var utils=require(_0xcb75('0x5'));var logger=require(_0xcb75('0x6'))('rpc');var config=require(_0xcb75('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x284ea6,_0x33dfe8,_0x498656){return new BPromise(function(_0x57ef56,_0x5b89ba){return client[_0xcb75('0x9')](_0x284ea6,_0x498656)[_0xcb75('0xa')](function(_0x20b642){logger['info'](_0xcb75('0xb'),_0x33dfe8,'request\x20sent');logger[_0xcb75('0xc')]('Migration,\x20%s,\x20%s,\x20%s',_0x33dfe8,_0xcb75('0xd'),JSON['stringify'](_0x20b642));if(_0x20b642[_0xcb75('0xe')]){if(_0x20b642[_0xcb75('0xe')][_0xcb75('0xf')]===0x1f4){logger[_0xcb75('0xe')]('Migration,\x20%s,\x20%s',_0x33dfe8,_0x20b642[_0xcb75('0xe')][_0xcb75('0x10')]);return _0x5b89ba(_0x20b642[_0xcb75('0xe')][_0xcb75('0x10')]);}logger[_0xcb75('0xe')](_0xcb75('0xb'),_0x33dfe8,_0x20b642[_0xcb75('0xe')][_0xcb75('0x10')]);return _0x57ef56(_0x20b642['error']['message']);}else{logger[_0xcb75('0x11')](_0xcb75('0xb'),_0x33dfe8,'request\x20sent');_0x57ef56(_0x20b642[_0xcb75('0x12')][_0xcb75('0x10')]);}})['catch'](function(_0x347545){logger[_0xcb75('0xe')](_0xcb75('0xb'),_0x33dfe8,_0x347545);_0x5b89ba(_0x347545);});});}
\ No newline at end of file
index 5240e10..fd2786e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e4b=['../../config/environment','./network.controller','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x39a527,_0x4b1807){var _0x2b3be2=function(_0x2f1fc6){while(--_0x2f1fc6){_0x39a527['push'](_0x39a527['shift']());}};_0x2b3be2(++_0x4b1807);}(_0x0e4b,0xdc));var _0xb0e4=function(_0xb11c23,_0x2421ea){_0xb11c23=_0xb11c23-0x0;var _0x1c82ab=_0x0e4b[_0xb11c23];return _0x1c82ab;};'use strict';var multer=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var path=require(_0xb0e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0e4('0x4'));var controller=require(_0xb0e4('0x5'));router['get']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x7')]);router[_0xb0e4('0x8')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller['show']);router['post']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xa')]);router[_0xb0e4('0xb')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xc')]);router[_0xb0e4('0xd')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xe')]);module[_0xb0e4('0xf')]=router;
\ No newline at end of file
+var _0xf4b9=['/:id','show','post','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get'];(function(_0x5c7f85,_0x586091){var _0x2e7599=function(_0x34fb76){while(--_0x34fb76){_0x5c7f85['push'](_0x5c7f85['shift']());}};_0x2e7599(++_0x586091);}(_0xf4b9,0xbc));var _0x9f4b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf4b9[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0x9f4b('0x0'));var path=require(_0x9f4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f4b('0x2'));var router=express[_0x9f4b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9f4b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9f4b('0x5'));var controller=require(_0x9f4b('0x6'));router['get']('/',auth[_0x9f4b('0x7')](),controller[_0x9f4b('0x8')]);router[_0x9f4b('0x9')](_0x9f4b('0xa'),auth[_0x9f4b('0x7')](),controller[_0x9f4b('0xb')]);router[_0x9f4b('0xc')]('/',auth[_0x9f4b('0x7')](),controller[_0x9f4b('0xd')]);router[_0x9f4b('0xe')](_0x9f4b('0xa'),auth[_0x9f4b('0x7')](),controller['update']);router[_0x9f4b('0xf')](_0x9f4b('0xa'),auth[_0x9f4b('0x7')](),controller[_0x9f4b('0x10')]);module[_0x9f4b('0x11')]=router;
\ No newline at end of file
index 50ee310..9a8a54a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481b=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x481b,0x1e7));var _0xb481=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x481b[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xb481('0x0'));module[_0xb481('0x1')]={'type':{'type':Sequelize[_0xb481('0x2')](_0xb481('0x3'),_0xb481('0x4'),_0xb481('0x5'),'turn')},'value':{'type':Sequelize[_0xb481('0x6')]},'username':{'type':Sequelize[_0xb481('0x6')]},'password':{'type':Sequelize[_0xb481('0x6')]}};
\ No newline at end of file
+var _0x32e0=['sequelize','exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x32e0,0xd0));var _0x032e=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x32e0[_0x531e48];return _0x202971;};'use strict';var Sequelize=require(_0x032e('0x0'));module[_0x032e('0x1')]={'type':{'type':Sequelize[_0x032e('0x2')](_0x032e('0x3'),_0x032e('0x4'),_0x032e('0x5'),_0x032e('0x6'))},'value':{'type':Sequelize[_0x032e('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x032e('0x7')]}};
\ No newline at end of file
index 2b59081..ac486be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf4f=['ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','undefined','count','offset','set','Content-Range','destroy','end','sendStatus','stack','name','index','map','Network','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','show','create','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','writeFileSync','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','utf8','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','params','/etc/asterisk/stun_xcally.conf','update','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','util'];(function(_0xc11842,_0x4cf191){var _0x33376a=function(_0x5ab773){while(--_0x5ab773){_0xc11842['push'](_0xc11842['shift']());}};_0x33376a(++_0x4cf191);}(_0xcf4f,0x1f1));var _0xfcf4=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xcf4f[_0x556927];return _0x5f1235;};'use strict';var util=require(_0xfcf4('0x0'));var path=require('path');var ejs=require(_0xfcf4('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0xfcf4('0x2'));var logger=require(_0xfcf4('0x3'))(_0xfcf4('0x4'));var config=require(_0xfcf4('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfcf4('0x6'));var client=jayson[_0xfcf4('0x7')][_0xfcf4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54dfd4,_0x5dee85,_0x343058,_0x4fcec4){return new Promise(function(_0x29da8b,_0x5715bc){var _0x393c56=_0x4fcec4||client;return _0x393c56[_0xfcf4('0x9')](_0x54dfd4,_0x343058)[_0xfcf4('0xa')](function(_0x32f6c8){logger['info'](_0xfcf4('0xb'),_0x5dee85,_0xfcf4('0xc'));logger['debug'](_0xfcf4('0xd'),_0x5dee85,_0xfcf4('0xc'),JSON['stringify'](_0x32f6c8));if(_0x32f6c8['error']){if(_0x32f6c8[_0xfcf4('0xe')][_0xfcf4('0xf')]===0x1f4){logger[_0xfcf4('0xe')]('Network,\x20%s,\x20%s',_0x5dee85,_0x32f6c8['error'][_0xfcf4('0x10')]);return _0x5715bc(_0x32f6c8['error']['message']);}logger[_0xfcf4('0xe')](_0xfcf4('0xb'),_0x5dee85,_0x32f6c8[_0xfcf4('0xe')][_0xfcf4('0x10')]);return _0x29da8b(_0x32f6c8['error'][_0xfcf4('0x10')]);}else{logger[_0xfcf4('0x11')](_0xfcf4('0xb'),_0x5dee85,_0xfcf4('0xc'));_0x29da8b(_0x32f6c8[_0xfcf4('0x12')][_0xfcf4('0x10')]);}})[_0xfcf4('0x13')](function(_0x1723d0){logger[_0xfcf4('0xe')]('Network,\x20%s,\x20%s',_0x5dee85,_0x1723d0);_0x5715bc(_0x1723d0);});});}function respondWithResult(_0x47f5de,_0x278771){_0x278771=_0x278771||0xc8;return function(_0x26666f){if(_0x26666f){return _0x47f5de[_0xfcf4('0x14')](_0x278771)[_0xfcf4('0x15')](_0x26666f);}};}function respondWithFilteredResult(_0xc1c0c2,_0x344b8c){return function(_0x401ef7){if(_0x401ef7){var _0x4aa23d=typeof _0x344b8c['offset']==='undefined'&&typeof _0x344b8c['limit']===_0xfcf4('0x16');var _0x3a9378=_0x401ef7[_0xfcf4('0x17')];var _0x1e2cf8=_0x4aa23d?0x0:_0x344b8c[_0xfcf4('0x18')];var _0x2b816a=_0x4aa23d?_0x401ef7['count']:_0x344b8c['offset']+_0x344b8c['limit'];var _0xe320a8;if(_0x2b816a>=_0x3a9378){_0x2b816a=_0x3a9378;_0xe320a8=0xc8;}else{_0xe320a8=0xce;}_0xc1c0c2['status'](_0xe320a8);return _0xc1c0c2[_0xfcf4('0x19')](_0xfcf4('0x1a'),_0x1e2cf8+'-'+_0x2b816a+'/'+_0x3a9378)[_0xfcf4('0x15')](_0x401ef7);}return null;};}function saveUpdates(_0x2c2610){return function(_0x58fa21){if(_0x58fa21){return _0x58fa21['update'](_0x2c2610)[_0xfcf4('0xa')](function(_0x42020d){return _0x42020d;});}return null;};}function removeEntity(_0x32e389){return function(_0x15c61b){if(_0x15c61b){return _0x15c61b[_0xfcf4('0x1b')]()[_0xfcf4('0xa')](function(){_0x32e389['status'](0xcc)[_0xfcf4('0x1c')]();});}};}function handleEntityNotFound(_0x837cb7){return function(_0x3edf35){if(!_0x3edf35){_0x837cb7[_0xfcf4('0x1d')](0x194);}return _0x3edf35;};}function handleError(_0x568b77,_0x4a360f){_0x4a360f=_0x4a360f||0x1f4;return function(_0x21dba6){logger[_0xfcf4('0xe')](_0x21dba6[_0xfcf4('0x1e')]);if(_0x21dba6[_0xfcf4('0x1f')]){delete _0x21dba6[_0xfcf4('0x1f')];}_0x568b77[_0xfcf4('0x14')](_0x4a360f)['send'](_0x21dba6);};}exports[_0xfcf4('0x20')]=function(_0x5d20d5,_0x49ab05){var _0x29af95={},_0x32fa2b={},_0x5227f6={'count':0x0,'rows':[]};var _0x2e2c7e=_[_0xfcf4('0x21')](db[_0xfcf4('0x22')][_0xfcf4('0x23')],function(_0x192acc){return{'name':_0x192acc['fieldName'],'type':_0x192acc[_0xfcf4('0x24')][_0xfcf4('0x25')]};});_0x32fa2b[_0xfcf4('0x26')]=_[_0xfcf4('0x21')](_0x2e2c7e,_0xfcf4('0x1f'));_0x32fa2b['query']=_[_0xfcf4('0x27')](_0x5d20d5[_0xfcf4('0x28')]);_0x32fa2b['filters']=_['intersection'](_0x32fa2b[_0xfcf4('0x26')],_0x32fa2b['query']);_0x29af95[_0xfcf4('0x29')]=_[_0xfcf4('0x2a')](_0x32fa2b[_0xfcf4('0x26')],qs[_0xfcf4('0x2b')](_0x5d20d5[_0xfcf4('0x28')][_0xfcf4('0x2b')]));_0x29af95['attributes']=_0x29af95['attributes']['length']?_0x29af95['attributes']:_0x32fa2b[_0xfcf4('0x26')];if(!_0x5d20d5[_0xfcf4('0x28')][_0xfcf4('0x2c')](_0xfcf4('0x2d'))){_0x29af95[_0xfcf4('0x2e')]=qs[_0xfcf4('0x2e')](_0x5d20d5[_0xfcf4('0x28')]['limit']);_0x29af95['offset']=qs['offset'](_0x5d20d5[_0xfcf4('0x28')][_0xfcf4('0x18')]);}_0x29af95[_0xfcf4('0x2f')]=qs['sort'](_0x5d20d5['query'][_0xfcf4('0x30')]);_0x29af95[_0xfcf4('0x31')]=qs['filters'](_['pick'](_0x5d20d5[_0xfcf4('0x28')],_0x32fa2b[_0xfcf4('0x32')]),_0x2e2c7e);if(_0x5d20d5[_0xfcf4('0x28')]['filter']){_0x29af95[_0xfcf4('0x31')]=_[_0xfcf4('0x33')](_0x29af95[_0xfcf4('0x31')],{'$or':_[_0xfcf4('0x21')](_0x2e2c7e,function(_0x258159){if(_0x258159[_0xfcf4('0x24')]!=='VIRTUAL'){var _0x4e7007={};_0x4e7007[_0x258159[_0xfcf4('0x1f')]]={'$like':'%'+_0x5d20d5[_0xfcf4('0x28')]['filter']+'%'};return _0x4e7007;}})});}_0x29af95=_['merge']({},_0x29af95,_0x5d20d5[_0xfcf4('0x34')]);var _0x4976ef={'where':_0x29af95[_0xfcf4('0x31')]};return db[_0xfcf4('0x22')][_0xfcf4('0x17')](_0x4976ef)['then'](function(_0xa2e738){_0x5227f6[_0xfcf4('0x17')]=_0xa2e738;if(_0x5d20d5[_0xfcf4('0x28')][_0xfcf4('0x35')]){_0x29af95[_0xfcf4('0x36')]=[{'all':!![]}];}return db[_0xfcf4('0x22')][_0xfcf4('0x37')](_0x29af95);})[_0xfcf4('0xa')](function(_0x51badb){_0x5227f6[_0xfcf4('0x38')]=_0x51badb;return _0x5227f6;})[_0xfcf4('0xa')](respondWithFilteredResult(_0x49ab05,_0x29af95))[_0xfcf4('0x13')](handleError(_0x49ab05,null));};exports[_0xfcf4('0x39')]=function(_0x22aec1,_0x393a80){var _0xf8b2dd={'raw':!![],'where':{'id':_0x22aec1['params']['id']}},_0x3ac0f8={};_0x3ac0f8['model']=_['keys'](db[_0xfcf4('0x22')][_0xfcf4('0x23')]);_0x3ac0f8[_0xfcf4('0x28')]=_['keys'](_0x22aec1[_0xfcf4('0x28')]);_0x3ac0f8[_0xfcf4('0x32')]=_[_0xfcf4('0x2a')](_0x3ac0f8['model'],_0x3ac0f8['query']);_0xf8b2dd[_0xfcf4('0x29')]=_[_0xfcf4('0x2a')](_0x3ac0f8['model'],qs[_0xfcf4('0x2b')](_0x22aec1[_0xfcf4('0x28')][_0xfcf4('0x2b')]));_0xf8b2dd[_0xfcf4('0x29')]=_0xf8b2dd['attributes']['length']?_0xf8b2dd[_0xfcf4('0x29')]:_0x3ac0f8[_0xfcf4('0x26')];if(_0x22aec1[_0xfcf4('0x28')][_0xfcf4('0x35')]){_0xf8b2dd[_0xfcf4('0x36')]=[{'all':!![]}];}_0xf8b2dd=_[_0xfcf4('0x33')]({},_0xf8b2dd,_0x22aec1['options']);return db['Network']['find'](_0xf8b2dd)[_0xfcf4('0xa')](handleEntityNotFound(_0x393a80,null))[_0xfcf4('0xa')](respondWithResult(_0x393a80,null))[_0xfcf4('0x13')](handleError(_0x393a80,null));};exports[_0xfcf4('0x3a')]=function(_0x5f55dc,_0x375c08){var _0x2473d6;return db['Network'][_0xfcf4('0x3a')](_0x5f55dc[_0xfcf4('0x3b')],{'raw':!![]})['then'](function(_0x269811){_0x2473d6=_0x269811;return db[_0xfcf4('0x22')]['findAll']({'where':{'type':_0x5f55dc[_0xfcf4('0x3b')][_0xfcf4('0x24')]},'raw':!![]});})[_0xfcf4('0xa')](function(_0x303500){if(_0x2473d6[_0xfcf4('0x24')][_0xfcf4('0x3c')]()==_0xfcf4('0x3d')){var _0x45576e=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config['root'],_0xfcf4('0x40')),'utf8');var _0x1c7fc9=ejs['render'](_0x45576e,{'networks':_0x303500||[]});fs[_0xfcf4('0x41')]('/etc/asterisk/stun_xcally.conf',_0x1c7fc9);return respondWithRpcPromise('Reload',_0xfcf4('0x3a'),{'module':_0xfcf4('0x42')});}else if(_0x2473d6[_0xfcf4('0x24')][_0xfcf4('0x3c')]()==_0xfcf4('0x43')){var _0x275526=fs['readFileSync'](path['join'](config[_0xfcf4('0x44')],_0xfcf4('0x45')),_0xfcf4('0x46'));var _0x16033d=ejs[_0xfcf4('0x47')](_0x275526,{'networks':_0x303500||[]});fs[_0xfcf4('0x41')]('/etc/asterisk/turn_xcally.conf',_0x16033d);return respondWithRpcPromise('Reload',_0xfcf4('0x3a'),{'module':_0xfcf4('0x42')});}else{var _0x1853e8=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config['root'],'server/files/templates/network.ejs'),_0xfcf4('0x46'));var _0x1a52f8=ejs[_0xfcf4('0x47')](_0x1853e8,{'networks':_0x303500||[]});fs['writeFileSync'](util[_0xfcf4('0x48')](_0xfcf4('0x49'),_0x5f55dc['body'][_0xfcf4('0x24')][_0xfcf4('0x4a')]()),_0x1a52f8);return respondWithRpcPromise(_0xfcf4('0x4b'),_0xfcf4('0x3a'),{'module':_0xfcf4('0x4c')});}})[_0xfcf4('0xa')](function(){return _0x2473d6;})[_0xfcf4('0xa')](respondWithResult(_0x375c08,0xc9))[_0xfcf4('0x13')](handleError(_0x375c08,null));};exports['update']=function(_0x2f1be4,_0x3500b1){var _0xc4cc05;return db[_0xfcf4('0x22')][_0xfcf4('0x4d')]({'where':{'id':_0x2f1be4[_0xfcf4('0x4e')]['id']}})[_0xfcf4('0xa')](handleEntityNotFound(_0x3500b1,null))[_0xfcf4('0xa')](saveUpdates(_0x2f1be4[_0xfcf4('0x3b')],null))[_0xfcf4('0xa')](function(_0x4635a7){if(_0x4635a7){_0xc4cc05=_0x4635a7;return db[_0xfcf4('0x22')][_0xfcf4('0x37')]({'where':{'type':_0xc4cc05['type']},'raw':!![]});}return null;})['then'](function(_0x5adbff){if(_0xc4cc05[_0xfcf4('0x24')][_0xfcf4('0x3c')]()=='STUN'){var _0x1fdfa9=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config['root'],_0xfcf4('0x40')),_0xfcf4('0x46'));var _0xe799e2=ejs[_0xfcf4('0x47')](_0x1fdfa9,{'networks':_0x5adbff||[]});fs[_0xfcf4('0x41')](_0xfcf4('0x4f'),_0xe799e2);return respondWithRpcPromise(_0xfcf4('0x4b'),_0xfcf4('0x50'),{'module':_0xfcf4('0x42')});}else if(_0xc4cc05[_0xfcf4('0x24')][_0xfcf4('0x3c')]()==_0xfcf4('0x43')){var _0xb84a9d=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config[_0xfcf4('0x44')],_0xfcf4('0x45')),'utf8');var _0x134f04=ejs['render'](_0xb84a9d,{'networks':_0x5adbff||[]});fs[_0xfcf4('0x41')](_0xfcf4('0x51'),_0x134f04);return respondWithRpcPromise('Reload','update',{'module':_0xfcf4('0x42')});}else{var _0x255d55=fs['readFileSync'](path[_0xfcf4('0x3f')](config[_0xfcf4('0x44')],_0xfcf4('0x52')),'utf8');var _0x278f50=ejs[_0xfcf4('0x47')](_0x255d55,{'networks':_0x5adbff||[]});fs[_0xfcf4('0x41')](util['format'](_0xfcf4('0x49'),_0x2f1be4[_0xfcf4('0x3b')][_0xfcf4('0x24')][_0xfcf4('0x4a')]()),_0x278f50);return respondWithRpcPromise(_0xfcf4('0x4b'),_0xfcf4('0x50'),{'module':'chan_sip.so'});}})['then'](function(_0x18ec5f){if(_0x18ec5f){return _0xc4cc05;}return null;})[_0xfcf4('0xa')](respondWithResult(_0x3500b1,null))['catch'](handleError(_0x3500b1,null));};exports[_0xfcf4('0x1b')]=function(_0x180e06,_0x373996){var _0x3d94cb;return db[_0xfcf4('0x22')]['find']({'where':{'id':_0x180e06[_0xfcf4('0x4e')]['id']}})['then'](function(_0x504db5){_0x3d94cb=_0x504db5;return _0x504db5;})[_0xfcf4('0xa')](handleEntityNotFound(_0x373996,null))[_0xfcf4('0xa')](removeEntity(_0x373996,null))[_0xfcf4('0xa')](function(){if(_0x3d94cb){return db[_0xfcf4('0x22')][_0xfcf4('0x37')]({'where':{'type':_0x3d94cb[_0xfcf4('0x24')]},'raw':!![]});}})['then'](function(_0x28bd4a){if(_0x3d94cb[_0xfcf4('0x24')][_0xfcf4('0x3c')]()==_0xfcf4('0x3d')){var _0x299fe5=fs[_0xfcf4('0x3e')](path['join'](config[_0xfcf4('0x44')],_0xfcf4('0x40')),_0xfcf4('0x46'));var _0x24ebc5=ejs[_0xfcf4('0x47')](_0x299fe5,{'networks':_0x28bd4a||[]});fs[_0xfcf4('0x41')](_0xfcf4('0x4f'),_0x24ebc5);return respondWithRpcPromise(_0xfcf4('0x4b'),_0xfcf4('0x1b'),{'module':_0xfcf4('0x42')});}else if(_0x3d94cb[_0xfcf4('0x24')][_0xfcf4('0x3c')]()==_0xfcf4('0x43')){var _0x2e3712=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config['root'],_0xfcf4('0x45')),_0xfcf4('0x46'));var _0x2520b=ejs['render'](_0x2e3712,{'networks':_0x28bd4a||[]});fs[_0xfcf4('0x41')](_0xfcf4('0x51'),_0x2520b);return respondWithRpcPromise(_0xfcf4('0x4b'),_0xfcf4('0x1b'),{'module':'res_stun_monitor.so'});}else{var _0x5bf714=fs[_0xfcf4('0x3e')](path[_0xfcf4('0x3f')](config[_0xfcf4('0x44')],_0xfcf4('0x52')),'utf8');var _0x2994a7=ejs['render'](_0x5bf714,{'networks':_0x28bd4a||[]});fs['writeFileSync'](util[_0xfcf4('0x48')](_0xfcf4('0x49'),_0x3d94cb[_0xfcf4('0x24')][_0xfcf4('0x4a')]()),_0x2994a7);return respondWithRpcPromise('Reload',_0xfcf4('0x1b'),{'module':_0xfcf4('0x4c')});}})['catch'](handleError(_0x373996,null));};
\ No newline at end of file
+var _0xddeb=['jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','json','undefined','count','offset','limit','set','Content-Range','update','destroy','status','stack','name','send','Network','rawAttributes','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','intersection','find','create','body','STUN','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','render','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','readFileSync','server/files/templates/network.ejs','format','path','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xddeb,0x18b));var _0xbdde=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0xddeb[_0x2e3dfc];return _0x4b1245;};'use strict';var util=require('util');var path=require(_0xbdde('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0xbdde('0x1'));var logger=require(_0xbdde('0x2'))('api');var config=require(_0xbdde('0x3'));var db=require(_0xbdde('0x4'))['db'];var jayson=require(_0xbdde('0x5'));var client=jayson[_0xbdde('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ae07,_0xc44bda,_0x3e3eb8,_0x2e0571){return new Promise(function(_0x240a63,_0x2ac36b){var _0x48b747=_0x2e0571||client;return _0x48b747[_0xbdde('0x7')](_0x41ae07,_0x3e3eb8)[_0xbdde('0x8')](function(_0x5787b1){logger[_0xbdde('0x9')](_0xbdde('0xa'),_0xc44bda,_0xbdde('0xb'));logger[_0xbdde('0xc')](_0xbdde('0xd'),_0xc44bda,_0xbdde('0xb'),JSON['stringify'](_0x5787b1));if(_0x5787b1[_0xbdde('0xe')]){if(_0x5787b1[_0xbdde('0xe')][_0xbdde('0xf')]===0x1f4){logger[_0xbdde('0xe')]('Network,\x20%s,\x20%s',_0xc44bda,_0x5787b1['error']['message']);return _0x2ac36b(_0x5787b1[_0xbdde('0xe')][_0xbdde('0x10')]);}logger[_0xbdde('0xe')](_0xbdde('0xa'),_0xc44bda,_0x5787b1[_0xbdde('0xe')][_0xbdde('0x10')]);return _0x240a63(_0x5787b1['error'][_0xbdde('0x10')]);}else{logger[_0xbdde('0x9')](_0xbdde('0xa'),_0xc44bda,'request\x20sent');_0x240a63(_0x5787b1[_0xbdde('0x11')][_0xbdde('0x10')]);}})[_0xbdde('0x12')](function(_0x418fde){logger[_0xbdde('0xe')]('Network,\x20%s,\x20%s',_0xc44bda,_0x418fde);_0x2ac36b(_0x418fde);});});}function respondWithResult(_0x5f041c,_0x46b386){_0x46b386=_0x46b386||0xc8;return function(_0x4f6515){if(_0x4f6515){return _0x5f041c['status'](_0x46b386)[_0xbdde('0x13')](_0x4f6515);}};}function respondWithFilteredResult(_0x3daff8,_0x325b4a){return function(_0x155b9e){if(_0x155b9e){var _0x1c18a2=typeof _0x325b4a['offset']===_0xbdde('0x14')&&typeof _0x325b4a['limit']===_0xbdde('0x14');var _0x572c56=_0x155b9e[_0xbdde('0x15')];var _0x8685dd=_0x1c18a2?0x0:_0x325b4a[_0xbdde('0x16')];var _0x13f8b9=_0x1c18a2?_0x155b9e[_0xbdde('0x15')]:_0x325b4a['offset']+_0x325b4a[_0xbdde('0x17')];var _0x5efced;if(_0x13f8b9>=_0x572c56){_0x13f8b9=_0x572c56;_0x5efced=0xc8;}else{_0x5efced=0xce;}_0x3daff8['status'](_0x5efced);return _0x3daff8[_0xbdde('0x18')](_0xbdde('0x19'),_0x8685dd+'-'+_0x13f8b9+'/'+_0x572c56)[_0xbdde('0x13')](_0x155b9e);}return null;};}function saveUpdates(_0x2415b9){return function(_0x559416){if(_0x559416){return _0x559416[_0xbdde('0x1a')](_0x2415b9)[_0xbdde('0x8')](function(_0xee7145){return _0xee7145;});}return null;};}function removeEntity(_0x5c7ff2){return function(_0x4034e1){if(_0x4034e1){return _0x4034e1[_0xbdde('0x1b')]()[_0xbdde('0x8')](function(){_0x5c7ff2[_0xbdde('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4df18b){return function(_0x290378){if(!_0x290378){_0x4df18b['sendStatus'](0x194);}return _0x290378;};}function handleError(_0x171f61,_0x9f90d1){_0x9f90d1=_0x9f90d1||0x1f4;return function(_0x31a95b){logger[_0xbdde('0xe')](_0x31a95b[_0xbdde('0x1d')]);if(_0x31a95b[_0xbdde('0x1e')]){delete _0x31a95b[_0xbdde('0x1e')];}_0x171f61[_0xbdde('0x1c')](_0x9f90d1)[_0xbdde('0x1f')](_0x31a95b);};}exports['index']=function(_0x1749e3,_0x4aa3c5){var _0xd740ec={},_0x2558b0={},_0x5bc8cf={'count':0x0,'rows':[]};var _0x282229=_['map'](db[_0xbdde('0x20')][_0xbdde('0x21')],function(_0x7b8f52){return{'name':_0x7b8f52['fieldName'],'type':_0x7b8f52[_0xbdde('0x22')][_0xbdde('0x23')]};});_0x2558b0[_0xbdde('0x24')]=_[_0xbdde('0x25')](_0x282229,'name');_0x2558b0['query']=_[_0xbdde('0x26')](_0x1749e3[_0xbdde('0x27')]);_0x2558b0[_0xbdde('0x28')]=_['intersection'](_0x2558b0['model'],_0x2558b0[_0xbdde('0x27')]);_0xd740ec[_0xbdde('0x29')]=_['intersection'](_0x2558b0['model'],qs['fields'](_0x1749e3[_0xbdde('0x27')][_0xbdde('0x2a')]));_0xd740ec[_0xbdde('0x29')]=_0xd740ec[_0xbdde('0x29')][_0xbdde('0x2b')]?_0xd740ec[_0xbdde('0x29')]:_0x2558b0[_0xbdde('0x24')];if(!_0x1749e3[_0xbdde('0x27')][_0xbdde('0x2c')]('nolimit')){_0xd740ec['limit']=qs[_0xbdde('0x17')](_0x1749e3[_0xbdde('0x27')][_0xbdde('0x17')]);_0xd740ec[_0xbdde('0x16')]=qs[_0xbdde('0x16')](_0x1749e3[_0xbdde('0x27')][_0xbdde('0x16')]);}_0xd740ec['order']=qs[_0xbdde('0x2d')](_0x1749e3[_0xbdde('0x27')]['sort']);_0xd740ec[_0xbdde('0x2e')]=qs['filters'](_[_0xbdde('0x2f')](_0x1749e3[_0xbdde('0x27')],_0x2558b0['filters']),_0x282229);if(_0x1749e3['query'][_0xbdde('0x30')]){_0xd740ec[_0xbdde('0x2e')]=_[_0xbdde('0x31')](_0xd740ec[_0xbdde('0x2e')],{'$or':_['map'](_0x282229,function(_0x100639){if(_0x100639['type']!=='VIRTUAL'){var _0x5440d1={};_0x5440d1[_0x100639[_0xbdde('0x1e')]]={'$like':'%'+_0x1749e3[_0xbdde('0x27')][_0xbdde('0x30')]+'%'};return _0x5440d1;}})});}_0xd740ec=_[_0xbdde('0x31')]({},_0xd740ec,_0x1749e3[_0xbdde('0x32')]);var _0x1bec5f={'where':_0xd740ec[_0xbdde('0x2e')]};return db[_0xbdde('0x20')][_0xbdde('0x15')](_0x1bec5f)[_0xbdde('0x8')](function(_0x54f181){_0x5bc8cf[_0xbdde('0x15')]=_0x54f181;if(_0x1749e3['query']['includeAll']){_0xd740ec[_0xbdde('0x33')]=[{'all':!![]}];}return db[_0xbdde('0x20')][_0xbdde('0x34')](_0xd740ec);})[_0xbdde('0x8')](function(_0x490e13){_0x5bc8cf[_0xbdde('0x35')]=_0x490e13;return _0x5bc8cf;})[_0xbdde('0x8')](respondWithFilteredResult(_0x4aa3c5,_0xd740ec))[_0xbdde('0x12')](handleError(_0x4aa3c5,null));};exports[_0xbdde('0x36')]=function(_0x4caea0,_0x521f97){var _0x58ed6e={'raw':!![],'where':{'id':_0x4caea0[_0xbdde('0x37')]['id']}},_0x1ea7dc={};_0x1ea7dc[_0xbdde('0x24')]=_[_0xbdde('0x26')](db[_0xbdde('0x20')][_0xbdde('0x21')]);_0x1ea7dc['query']=_[_0xbdde('0x26')](_0x4caea0[_0xbdde('0x27')]);_0x1ea7dc['filters']=_[_0xbdde('0x38')](_0x1ea7dc['model'],_0x1ea7dc[_0xbdde('0x27')]);_0x58ed6e[_0xbdde('0x29')]=_['intersection'](_0x1ea7dc[_0xbdde('0x24')],qs[_0xbdde('0x2a')](_0x4caea0['query'][_0xbdde('0x2a')]));_0x58ed6e[_0xbdde('0x29')]=_0x58ed6e[_0xbdde('0x29')]['length']?_0x58ed6e[_0xbdde('0x29')]:_0x1ea7dc[_0xbdde('0x24')];if(_0x4caea0[_0xbdde('0x27')]['includeAll']){_0x58ed6e[_0xbdde('0x33')]=[{'all':!![]}];}_0x58ed6e=_['merge']({},_0x58ed6e,_0x4caea0['options']);return db[_0xbdde('0x20')][_0xbdde('0x39')](_0x58ed6e)[_0xbdde('0x8')](handleEntityNotFound(_0x521f97,null))[_0xbdde('0x8')](respondWithResult(_0x521f97,null))[_0xbdde('0x12')](handleError(_0x521f97,null));};exports['create']=function(_0xeef93,_0xc3e54b){var _0x202da1;return db[_0xbdde('0x20')][_0xbdde('0x3a')](_0xeef93[_0xbdde('0x3b')],{'raw':!![]})[_0xbdde('0x8')](function(_0x4371d8){_0x202da1=_0x4371d8;return db[_0xbdde('0x20')][_0xbdde('0x34')]({'where':{'type':_0xeef93[_0xbdde('0x3b')][_0xbdde('0x22')]},'raw':!![]});})[_0xbdde('0x8')](function(_0x24ae49){if(_0x202da1[_0xbdde('0x22')]['toUpperCase']()==_0xbdde('0x3c')){var _0x4cb4d6=fs['readFileSync'](path['join'](config[_0xbdde('0x3d')],_0xbdde('0x3e')),_0xbdde('0x3f'));var _0x35bd5f=ejs['render'](_0x4cb4d6,{'networks':_0x24ae49||[]});fs[_0xbdde('0x40')](_0xbdde('0x41'),_0x35bd5f);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x3a'),{'module':'res_stun_monitor.so'});}else if(_0x202da1[_0xbdde('0x22')][_0xbdde('0x43')]()==_0xbdde('0x44')){var _0x7106ba=fs['readFileSync'](path[_0xbdde('0x45')](config['root'],_0xbdde('0x46')),_0xbdde('0x3f'));var _0x4df7a7=ejs['render'](_0x7106ba,{'networks':_0x24ae49||[]});fs[_0xbdde('0x40')](_0xbdde('0x47'),_0x4df7a7);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x3a'),{'module':_0xbdde('0x48')});}else{var _0x425e62=fs['readFileSync'](path[_0xbdde('0x45')](config['root'],'server/files/templates/network.ejs'),_0xbdde('0x3f'));var _0xe59777=ejs[_0xbdde('0x49')](_0x425e62,{'networks':_0x24ae49||[]});fs[_0xbdde('0x40')](util['format'](_0xbdde('0x4a'),_0xeef93[_0xbdde('0x3b')][_0xbdde('0x22')][_0xbdde('0x4b')]()),_0xe59777);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x3a'),{'module':_0xbdde('0x4c')});}})[_0xbdde('0x8')](function(){return _0x202da1;})[_0xbdde('0x8')](respondWithResult(_0xc3e54b,0xc9))[_0xbdde('0x12')](handleError(_0xc3e54b,null));};exports[_0xbdde('0x1a')]=function(_0x552385,_0x2d773e){var _0x2bdd1d;return db[_0xbdde('0x20')][_0xbdde('0x39')]({'where':{'id':_0x552385[_0xbdde('0x37')]['id']}})[_0xbdde('0x8')](handleEntityNotFound(_0x2d773e,null))['then'](saveUpdates(_0x552385['body'],null))[_0xbdde('0x8')](function(_0x405669){if(_0x405669){_0x2bdd1d=_0x405669;return db[_0xbdde('0x20')]['findAll']({'where':{'type':_0x2bdd1d[_0xbdde('0x22')]},'raw':!![]});}return null;})[_0xbdde('0x8')](function(_0x5ce535){if(_0x2bdd1d[_0xbdde('0x22')][_0xbdde('0x43')]()==_0xbdde('0x3c')){var _0x44518d=fs['readFileSync'](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x9b7f9f=ejs[_0xbdde('0x49')](_0x44518d,{'networks':_0x5ce535||[]});fs[_0xbdde('0x40')]('/etc/asterisk/stun_xcally.conf',_0x9b7f9f);return respondWithRpcPromise(_0xbdde('0x42'),'update',{'module':_0xbdde('0x48')});}else if(_0x2bdd1d['type'][_0xbdde('0x43')]()==_0xbdde('0x44')){var _0x56d4e6=fs[_0xbdde('0x4d')](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],_0xbdde('0x46')),'utf8');var _0x2d202f=ejs[_0xbdde('0x49')](_0x56d4e6,{'networks':_0x5ce535||[]});fs['writeFileSync'](_0xbdde('0x47'),_0x2d202f);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x1a'),{'module':_0xbdde('0x48')});}else{var _0x56c075=fs[_0xbdde('0x4d')](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],'server/files/templates/network.ejs'),_0xbdde('0x3f'));var _0x2adf3a=ejs[_0xbdde('0x49')](_0x56c075,{'networks':_0x5ce535||[]});fs[_0xbdde('0x40')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x552385[_0xbdde('0x3b')][_0xbdde('0x22')][_0xbdde('0x4b')]()),_0x2adf3a);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x1a'),{'module':_0xbdde('0x4c')});}})[_0xbdde('0x8')](function(_0x235208){if(_0x235208){return _0x2bdd1d;}return null;})['then'](respondWithResult(_0x2d773e,null))[_0xbdde('0x12')](handleError(_0x2d773e,null));};exports[_0xbdde('0x1b')]=function(_0x443b5b,_0x35a9ae){var _0x4008f2;return db['Network'][_0xbdde('0x39')]({'where':{'id':_0x443b5b[_0xbdde('0x37')]['id']}})[_0xbdde('0x8')](function(_0xbb9c72){_0x4008f2=_0xbb9c72;return _0xbb9c72;})['then'](handleEntityNotFound(_0x35a9ae,null))[_0xbdde('0x8')](removeEntity(_0x35a9ae,null))[_0xbdde('0x8')](function(){if(_0x4008f2){return db[_0xbdde('0x20')][_0xbdde('0x34')]({'where':{'type':_0x4008f2[_0xbdde('0x22')]},'raw':!![]});}})[_0xbdde('0x8')](function(_0x541bad){if(_0x4008f2['type'][_0xbdde('0x43')]()==_0xbdde('0x3c')){var _0x41116c=fs[_0xbdde('0x4d')](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],_0xbdde('0x3e')),'utf8');var _0x11354b=ejs['render'](_0x41116c,{'networks':_0x541bad||[]});fs[_0xbdde('0x40')](_0xbdde('0x41'),_0x11354b);return respondWithRpcPromise('Reload',_0xbdde('0x1b'),{'module':_0xbdde('0x48')});}else if(_0x4008f2[_0xbdde('0x22')][_0xbdde('0x43')]()==_0xbdde('0x44')){var _0x2ee0e3=fs[_0xbdde('0x4d')](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x289a36=ejs['render'](_0x2ee0e3,{'networks':_0x541bad||[]});fs[_0xbdde('0x40')](_0xbdde('0x47'),_0x289a36);return respondWithRpcPromise(_0xbdde('0x42'),_0xbdde('0x1b'),{'module':_0xbdde('0x48')});}else{var _0x5369ef=fs['readFileSync'](path[_0xbdde('0x45')](config[_0xbdde('0x3d')],_0xbdde('0x4e')),'utf8');var _0x4d14a0=ejs[_0xbdde('0x49')](_0x5369ef,{'networks':_0x541bad||[]});fs[_0xbdde('0x40')](util[_0xbdde('0x4f')](_0xbdde('0x4a'),_0x4008f2['type'][_0xbdde('0x4b')]()),_0x4d14a0);return respondWithRpcPromise(_0xbdde('0x42'),'destroy',{'module':'chan_sip.so'});}})['catch'](handleError(_0x35a9ae,null));};
\ No newline at end of file
index 15a8d33..62ff9c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe739=['Network','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x471b09,_0x4f15de){var _0x2005fa=function(_0x2781e2){while(--_0x2781e2){_0x471b09['push'](_0x471b09['shift']());}};_0x2005fa(++_0x4f15de);}(_0xe739,0x105));var _0x9e73=function(_0x12f2fc,_0x54da4c){_0x12f2fc=_0x12f2fc-0x0;var _0x310202=_0xe739[_0x12f2fc];return _0x310202;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var logger=require(_0x9e73('0x1'))(_0x9e73('0x2'));var moment=require(_0x9e73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e73('0x4'));var config=require(_0x9e73('0x5'));var attributes=require(_0x9e73('0x6'));module[_0x9e73('0x7')]=function(_0x4cb2ed,_0x3db8fa){return _0x4cb2ed[_0x9e73('0x8')](_0x9e73('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./network.attributes','define','network'];(function(_0x423ea2,_0x43800c){var _0xc9ab7f=function(_0xe7a6ed){while(--_0xe7a6ed){_0x423ea2['push'](_0x423ea2['shift']());}};_0xc9ab7f(++_0x43800c);}(_0xac4a,0x13f));var _0xaac4=function(_0x3fb421,_0x1119f5){_0x3fb421=_0x3fb421-0x0;var _0x283c33=_0xac4a[_0x3fb421];return _0x283c33;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('Network',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24f9dbd..898e9d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x19e52b,_0x300761){_0x19e52b=_0x19e52b-0x0;var _0x184866=_0x7a54[_0x19e52b];return _0x184866;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x35c29a,_0x553cb0){_0x35c29a=_0x35c29a-0x0;var _0x54c586=_0x7a54[_0x35c29a];return _0x54c586;};'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
index 5c87a80..e230d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x420a=['/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','send','/:id','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x420a,0x131));var _0xa420=function(_0x39affa,_0x49d88d){_0x39affa=_0x39affa-0x0;var _0x38c31e=_0x420a[_0x39affa];return _0x38c31e;};'use strict';var multer=require(_0xa420('0x0'));var util=require(_0xa420('0x1'));var path=require(_0xa420('0x2'));var timeout=require(_0xa420('0x3'));var express=require(_0xa420('0x4'));var router=express[_0xa420('0x5')]();var fs_extra=require(_0xa420('0x6'));var auth=require(_0xa420('0x7'));var interaction=require(_0xa420('0x8'));var config=require('../../config/environment');var controller=require(_0xa420('0x9'));router[_0xa420('0xa')]('/',auth[_0xa420('0xb')](),controller['index']);router[_0xa420('0xa')](_0xa420('0xc'),auth['isAuthenticated'](),controller[_0xa420('0xd')]);router['get']('/:id',auth[_0xa420('0xb')](),controller[_0xa420('0xe')]);router[_0xa420('0xa')](_0xa420('0xf'),auth[_0xa420('0xb')](),controller['getDispositions']);router[_0xa420('0xa')](_0xa420('0x10'),auth[_0xa420('0xb')](),controller['getAnswers']);router[_0xa420('0xa')](_0xa420('0x11'),auth[_0xa420('0xb')](),controller[_0xa420('0x12')]);router['get'](_0xa420('0x13'),auth[_0xa420('0xb')](),controller[_0xa420('0x14')]);router['get'](_0xa420('0x15'),auth[_0xa420('0xb')](),controller[_0xa420('0x16')]);router[_0xa420('0x17')]('/',auth[_0xa420('0xb')](),controller[_0xa420('0x18')]);router[_0xa420('0x17')](_0xa420('0xf'),auth[_0xa420('0xb')](),controller[_0xa420('0x19')]);router[_0xa420('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0xa420('0x17')](_0xa420('0x1a'),controller[_0xa420('0x1b')]);router['post'](_0xa420('0x11'),auth[_0xa420('0xb')](),controller[_0xa420('0x1c')]);router[_0xa420('0x17')](_0xa420('0x15'),auth[_0xa420('0xb')](),controller[_0xa420('0x1d')]);router[_0xa420('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xa420('0x1e')]);router['put'](_0xa420('0x1f'),auth['isAuthenticated'](),controller[_0xa420('0x20')]);router[_0xa420('0x21')](_0xa420('0x1f'),auth[_0xa420('0xb')](),controller['destroy']);router[_0xa420('0x21')](_0xa420('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa420('0x21')](_0xa420('0x10'),auth[_0xa420('0xb')](),controller[_0xa420('0x22')]);router['delete'](_0xa420('0x15'),auth['isAuthenticated'](),controller[_0xa420('0x23')]);module['exports']=router;
\ No newline at end of file
+var _0x2711=['index','get','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2fa6e8,_0x4a07af){var _0x2519e1=function(_0x4e0924){while(--_0x4e0924){_0x2fa6e8['push'](_0x2fa6e8['shift']());}};_0x2519e1(++_0x4a07af);}(_0x2711,0x169));var _0x1271=function(_0x2dab,_0x1ae9b2){_0x2dab=_0x2dab-0x0;var _0x3ba6f=_0x2711[_0x2dab];return _0x3ba6f;};'use strict';var multer=require(_0x1271('0x0'));var util=require(_0x1271('0x1'));var path=require(_0x1271('0x2'));var timeout=require('connect-timeout');var express=require(_0x1271('0x3'));var router=express[_0x1271('0x4')]();var fs_extra=require(_0x1271('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1271('0x6'));var config=require(_0x1271('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1271('0x8')]);router[_0x1271('0x9')](_0x1271('0xa'),auth['isAuthenticated'](),controller[_0x1271('0xb')]);router[_0x1271('0x9')](_0x1271('0xc'),auth['isAuthenticated'](),controller[_0x1271('0xd')]);router[_0x1271('0x9')](_0x1271('0xe'),auth[_0x1271('0xf')](),controller[_0x1271('0x10')]);router[_0x1271('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1271('0x11')]);router[_0x1271('0x9')](_0x1271('0x12'),auth[_0x1271('0xf')](),controller[_0x1271('0x13')]);router[_0x1271('0x9')](_0x1271('0x14'),auth[_0x1271('0xf')](),controller[_0x1271('0x15')]);router[_0x1271('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x1271('0x16')]);router[_0x1271('0x17')]('/',auth['isAuthenticated'](),controller[_0x1271('0x18')]);router[_0x1271('0x17')]('/:id/dispositions',auth[_0x1271('0xf')](),controller[_0x1271('0x19')]);router[_0x1271('0x17')](_0x1271('0x1a'),auth[_0x1271('0xf')](),controller[_0x1271('0x1b')]);router[_0x1271('0x17')](_0x1271('0x1c'),controller['notify']);router[_0x1271('0x17')](_0x1271('0x12'),auth['isAuthenticated'](),controller[_0x1271('0x1d')]);router[_0x1271('0x17')](_0x1271('0x1e'),auth[_0x1271('0xf')](),controller[_0x1271('0x1f')]);router[_0x1271('0x17')](_0x1271('0x20'),auth['isAuthenticated'](),controller[_0x1271('0x21')]);router['put'](_0x1271('0xc'),auth[_0x1271('0xf')](),controller[_0x1271('0x22')]);router[_0x1271('0x23')](_0x1271('0xc'),auth[_0x1271('0xf')](),controller[_0x1271('0x24')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1271('0x25')]);router[_0x1271('0x23')](_0x1271('0x1a'),auth[_0x1271('0xf')](),controller[_0x1271('0x26')]);router[_0x1271('0x23')]('/:id/users',auth[_0x1271('0xf')](),controller[_0x1271('0x27')]);module[_0x1271('0x28')]=router;
\ No newline at end of file
index efdac40..f4701bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe1b=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0xe557e,_0x23a10a){var _0x5b4358=function(_0x173ec0){while(--_0x173ec0){_0xe557e['push'](_0xe557e['shift']());}};_0x5b4358(++_0x23a10a);}(_0xfe1b,0x132));var _0xbfe1=function(_0x375410,_0x3c0504){_0x375410=_0x375410-0x0;var _0x1957ee=_0xfe1b[_0x375410];return _0x1957ee;};'use strict';var Sequelize=require(_0xbfe1('0x0'));var rs=require('randomstring');module[_0xbfe1('0x1')]={'name':{'type':Sequelize[_0xbfe1('0x2')],'unique':_0xbfe1('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbfe1('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xbfe1('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbfe1('0x4')],'defaultValue':function(){return _0xbfe1('0x5');}},'notificationSound':{'type':Sequelize[_0xbfe1('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfe1('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbfe1('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xbfe1('0x2')]},'queueTransfer':{'type':Sequelize[_0xbfe1('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfe1('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfe1('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbfe1('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xbfe1('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2bad1b){if(!_0x2bad1b)this[_0xbfe1('0x9')](_0xbfe1('0xa'),null);this[_0xbfe1('0x9')](_0xbfe1('0xb'),_0x2bad1b);}}};
\ No newline at end of file
+var _0x5922=['setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','generate','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2d9e03,_0x430642){var _0x3091cb=function(_0x123829){while(--_0x123829){_0x2d9e03['push'](_0x2d9e03['shift']());}};_0x3091cb(++_0x430642);}(_0x5922,0x115));var _0x2592=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5922[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2592('0x0'));module[_0x2592('0x1')]={'name':{'type':Sequelize[_0x2592('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2592('0x2')]},'token':{'type':Sequelize[_0x2592('0x2')],'defaultValue':function(){return rs[_0x2592('0x3')]();}},'replyUri':{'type':Sequelize[_0x2592('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2592('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2592('0x4');}},'notificationSound':{'type':Sequelize[_0x2592('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2592('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2592('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2592('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2592('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x2592('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2592('0x8'),'set':function(_0xea9134){if(!_0xea9134)this[_0x2592('0x9')](_0x2592('0xa'),null);this[_0x2592('0x9')]('mandatoryDisposition',_0xea9134);}}};
\ No newline at end of file
index 45d4d9f..2f8a66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc7=['emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','nolimit','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','list','orderBy','asc','Applications','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','firstName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','User','UserId','unshift','agent','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents'];(function(_0xd6f78c,_0x12149a){var _0x43072c=function(_0x40ce3c){while(--_0x40ce3c){_0xd6f78c['push'](_0xd6f78c['shift']());}};_0x43072c(++_0x12149a);}(_0xabc7,0xc7));var _0x7abc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xabc7[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7abc('0x0'));var rimraf=require(_0x7abc('0x1'));var zipdir=require(_0x7abc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7abc('0x3'));var moment=require(_0x7abc('0x4'));var BPromise=require(_0x7abc('0x5'));var Mustache=require(_0x7abc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7abc('0x7'));var csv=require(_0x7abc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7abc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7abc('0xa'));var jsforce=require(_0x7abc('0xb'));var deskjs=require(_0x7abc('0xc'));var toCsv=require(_0x7abc('0x8'));var querystring=require(_0x7abc('0xd'));var Papa=require(_0x7abc('0xe'));var Redis=require(_0x7abc('0xf'));var authService=require(_0x7abc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7abc('0x11'))(_0x7abc('0x12'));var utils=require(_0x7abc('0x13'));var config=require(_0x7abc('0x14'));var licenseUtil=require(_0x7abc('0x15'));var db=require(_0x7abc('0x16'))['db'];config[_0x7abc('0x17')]=_[_0x7abc('0x18')](config['redis'],{'host':_0x7abc('0x19'),'port':0x18eb});var socket=require(_0x7abc('0x1a'))(new Redis(config['redis']));require(_0x7abc('0x1b'))[_0x7abc('0x1c')](socket);var jayson=require(_0x7abc('0x1d'));var client=jayson[_0x7abc('0x1e')][_0x7abc('0x1f')]({'port':0x232c});var client9002=jayson[_0x7abc('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10eea8,_0x572cfc,_0x1f3d15,_0x4172b3){return new BPromise(function(_0x2e7ffa,_0x4ca219){var _0x46545a=_0x4172b3||client;return _0x46545a['request'](_0x10eea8,_0x1f3d15)['then'](function(_0x11c48d){logger[_0x7abc('0x20')](_0x7abc('0x21'),_0x572cfc,'request\x20sent');logger[_0x7abc('0x22')](_0x7abc('0x23'),_0x572cfc,_0x7abc('0x24'),JSON[_0x7abc('0x25')](_0x11c48d));if(_0x11c48d[_0x7abc('0x26')]){if(_0x11c48d[_0x7abc('0x26')]['code']===0x1f4){logger['error'](_0x7abc('0x21'),_0x572cfc,_0x11c48d[_0x7abc('0x26')][_0x7abc('0x27')]);return _0x4ca219(_0x11c48d['error']['message']);}logger['error'](_0x7abc('0x21'),_0x572cfc,_0x11c48d[_0x7abc('0x26')]['message']);return _0x2e7ffa(_0x11c48d[_0x7abc('0x26')][_0x7abc('0x27')]);}else{logger[_0x7abc('0x20')](_0x7abc('0x21'),_0x572cfc,_0x7abc('0x24'));_0x2e7ffa(_0x11c48d['result'][_0x7abc('0x27')]);}})['catch'](function(_0x4f9418){logger['error'](_0x7abc('0x21'),_0x572cfc,_0x4f9418);_0x4ca219(_0x4f9418);});});}function respondWithStatusCode(_0x466fa8,_0x31f9b6){_0x31f9b6=_0x31f9b6||0xcc;return function(_0x4429b7){if(_0x4429b7){return _0x466fa8[_0x7abc('0x28')](_0x31f9b6);}return _0x466fa8['status'](_0x31f9b6)['end']();};}function respondWithResult(_0x6c5e9d,_0x1fe637){_0x1fe637=_0x1fe637||0xc8;return function(_0x5aaa58){if(_0x5aaa58){return _0x6c5e9d[_0x7abc('0x29')](_0x1fe637)[_0x7abc('0x2a')](_0x5aaa58);}};}function respondWithFilteredResult(_0x592c25,_0x29538e){return function(_0x315e50){if(_0x315e50){var _0x50441a=typeof _0x29538e[_0x7abc('0x2b')]==='undefined'&&typeof _0x29538e[_0x7abc('0x2c')]===_0x7abc('0x2d');var _0x201d90=_0x315e50[_0x7abc('0x2e')];var _0x128a55=_0x50441a?0x0:_0x29538e['offset'];var _0x1203c4=_0x50441a?_0x315e50[_0x7abc('0x2e')]:_0x29538e[_0x7abc('0x2b')]+_0x29538e[_0x7abc('0x2c')];var _0xff5721;if(_0x1203c4>=_0x201d90){_0x1203c4=_0x201d90;_0xff5721=0xc8;}else{_0xff5721=0xce;}_0x592c25[_0x7abc('0x29')](_0xff5721);return _0x592c25[_0x7abc('0x2f')](_0x7abc('0x30'),_0x128a55+'-'+_0x1203c4+'/'+_0x201d90)['json'](_0x315e50);}return null;};}function patchUpdates(_0x18cd37){return function(_0x334a99){try{jsonpatch[_0x7abc('0x31')](_0x334a99,_0x18cd37,!![]);}catch(_0x4d9c53){return BPromise[_0x7abc('0x32')](_0x4d9c53);}return _0x334a99['save']();};}function saveUpdates(_0x1395f7,_0x191f78){return function(_0x1bb7ce){if(_0x1bb7ce){return _0x1bb7ce[_0x7abc('0x33')](_0x1395f7)[_0x7abc('0x34')](function(_0x9adfc6){return _0x9adfc6;});}return null;};}function removeEntity(_0x445544,_0x47eed1){return function(_0xca8222){if(_0xca8222){return _0xca8222[_0x7abc('0x35')]()[_0x7abc('0x34')](function(){var _0x3facb2=_0xca8222['get']({'plain':!![]});var _0x384c63=_0x7abc('0x36');return db[_0x7abc('0x37')][_0x7abc('0x35')]({'where':{'type':_0x384c63,'resourceId':_0x3facb2['id']}})[_0x7abc('0x34')](function(){return _0xca8222;});})[_0x7abc('0x34')](function(){_0x445544['status'](0xcc)[_0x7abc('0x38')]();});}};}function handleEntityNotFound(_0x4efdf8,_0x2a39f7){return function(_0x6a4128){if(!_0x6a4128){_0x4efdf8[_0x7abc('0x28')](0x194);}return _0x6a4128;};}function handleError(_0x35161c,_0x166f9e){_0x166f9e=_0x166f9e||0x1f4;return function(_0x1cd249){logger['error'](_0x1cd249[_0x7abc('0x39')]);if(_0x1cd249[_0x7abc('0x3a')]){delete _0x1cd249[_0x7abc('0x3a')];}_0x35161c[_0x7abc('0x29')](_0x166f9e)[_0x7abc('0x3b')](_0x1cd249);};}exports[_0x7abc('0x3c')]=function(_0x1073cb,_0x36d356){var _0x4edf60={'include':[{'model':db[_0x7abc('0x3d')],'as':_0x7abc('0x3e')}]},_0xa20829={},_0x59deaa={'count':0x0,'rows':[]};var _0x4515f7=_[_0x7abc('0x3f')](db[_0x7abc('0x40')][_0x7abc('0x41')],function(_0x56bd83){return{'name':_0x56bd83[_0x7abc('0x42')],'type':_0x56bd83[_0x7abc('0x43')][_0x7abc('0x44')]};});_0xa20829['model']=_[_0x7abc('0x3f')](_0x4515f7,_0x7abc('0x3a'));_0xa20829[_0x7abc('0x45')]=_[_0x7abc('0x46')](_0x1073cb[_0x7abc('0x45')]);_0xa20829[_0x7abc('0x47')]=_[_0x7abc('0x48')](_0xa20829['model'],_0xa20829[_0x7abc('0x45')]);_0x4edf60['attributes']=_['intersection'](_0xa20829[_0x7abc('0x49')],qs[_0x7abc('0x4a')](_0x1073cb[_0x7abc('0x45')][_0x7abc('0x4a')]));_0x4edf60[_0x7abc('0x4b')]=_0x4edf60['attributes'][_0x7abc('0x4c')]?_0x4edf60[_0x7abc('0x4b')]:_0xa20829[_0x7abc('0x49')];if(!_0x1073cb[_0x7abc('0x45')][_0x7abc('0x4d')]('nolimit')){_0x4edf60[_0x7abc('0x2c')]=qs[_0x7abc('0x2c')](_0x1073cb[_0x7abc('0x45')]['limit']);_0x4edf60['offset']=qs['offset'](_0x1073cb[_0x7abc('0x45')][_0x7abc('0x2b')]);}_0x4edf60['order']=qs[_0x7abc('0x4e')](_0x1073cb[_0x7abc('0x45')][_0x7abc('0x4e')]);_0x4edf60['where']=qs[_0x7abc('0x47')](_['pick'](_0x1073cb['query'],_0xa20829[_0x7abc('0x47')]),_0x4515f7);if(_0x1073cb['query'][_0x7abc('0x4f')]){_0x4edf60[_0x7abc('0x50')]=_[_0x7abc('0x51')](_0x4edf60[_0x7abc('0x50')],{'$or':_[_0x7abc('0x3f')](_0x4515f7,function(_0x3ba180){if(_0x3ba180['type']!==_0x7abc('0x52')){var _0x9fdcb3={};_0x9fdcb3[_0x3ba180[_0x7abc('0x3a')]]={'$like':'%'+_0x1073cb[_0x7abc('0x45')]['filter']+'%'};return _0x9fdcb3;}})});}_0x4edf60=_[_0x7abc('0x51')]({},_0x4edf60,_0x1073cb[_0x7abc('0x53')]);var _0x209b92={'where':_0x4edf60[_0x7abc('0x50')]};return db['OpenchannelAccount'][_0x7abc('0x2e')](_0x209b92)[_0x7abc('0x34')](function(_0x3b8716){_0x59deaa[_0x7abc('0x2e')]=_0x3b8716;if(_0x1073cb['query'][_0x7abc('0x54')]){_0x4edf60[_0x7abc('0x55')]=[{'all':!![]}];}return db[_0x7abc('0x40')][_0x7abc('0x56')](_0x4edf60);})[_0x7abc('0x34')](function(_0x1b5811){_0x59deaa[_0x7abc('0x57')]=_0x1b5811;return _0x59deaa;})['then'](respondWithFilteredResult(_0x36d356,_0x4edf60))[_0x7abc('0x58')](handleError(_0x36d356,null));};exports[_0x7abc('0x59')]=function(_0x5934c2,_0x4f0f5f){var _0x5aa0ee={'raw':![],'where':{'id':_0x5934c2[_0x7abc('0x5a')]['id']},'include':[{'model':db[_0x7abc('0x3d')],'as':_0x7abc('0x3e')}]},_0x4972de={};_0x4972de[_0x7abc('0x49')]=_[_0x7abc('0x46')](db[_0x7abc('0x40')]['rawAttributes']);_0x4972de[_0x7abc('0x45')]=_['keys'](_0x5934c2[_0x7abc('0x45')]);_0x4972de[_0x7abc('0x47')]=_[_0x7abc('0x48')](_0x4972de['model'],_0x4972de[_0x7abc('0x45')]);_0x5aa0ee[_0x7abc('0x4b')]=_[_0x7abc('0x48')](_0x4972de[_0x7abc('0x49')],qs[_0x7abc('0x4a')](_0x5934c2[_0x7abc('0x45')]['fields']));_0x5aa0ee[_0x7abc('0x4b')]=_0x5aa0ee[_0x7abc('0x4b')]['length']?_0x5aa0ee[_0x7abc('0x4b')]:_0x4972de[_0x7abc('0x49')];if(_0x5934c2[_0x7abc('0x45')][_0x7abc('0x54')]){_0x5aa0ee['include']=[{'all':!![]}];}_0x5aa0ee=_[_0x7abc('0x51')]({},_0x5aa0ee,_0x5934c2[_0x7abc('0x53')]);return db[_0x7abc('0x40')][_0x7abc('0x5b')](_0x5aa0ee)[_0x7abc('0x34')](handleEntityNotFound(_0x4f0f5f,null))['then'](respondWithResult(_0x4f0f5f,null))[_0x7abc('0x58')](handleError(_0x4f0f5f,null));};exports[_0x7abc('0x5c')]=function(_0x3c46d3,_0x2e4dda){return db[_0x7abc('0x40')]['create'](_0x3c46d3[_0x7abc('0x5d')],{})['then'](function(_0x375e42){var _0x4f640e=_0x3c46d3[_0x7abc('0x5e')][_0x7abc('0x5f')]({'plain':!![]});if(!_0x4f640e)throw new Error(_0x7abc('0x60'));if(_0x4f640e['role']===_0x7abc('0x5e')){var _0x476d35=_0x375e42[_0x7abc('0x5f')]({'plain':!![]});var _0x5f39e8=_0x7abc('0x36');return db[_0x7abc('0x61')][_0x7abc('0x5b')]({'where':{'name':_0x5f39e8,'userProfileId':_0x4f640e['userProfileId']},'raw':!![]})[_0x7abc('0x34')](function(_0x3fe613){if(_0x3fe613&&_0x3fe613[_0x7abc('0x62')]===0x0){return db['UserProfileResource'][_0x7abc('0x5c')]({'name':_0x476d35['name'],'resourceId':_0x476d35['id'],'type':_0x3fe613['name'],'sectionId':_0x3fe613['id']},{})['then'](function(){return _0x375e42;});}else{return _0x375e42;}})[_0x7abc('0x58')](function(_0x3762a1){logger[_0x7abc('0x26')](_0x7abc('0x63'),_0x3762a1);throw _0x3762a1;});}return _0x375e42;})[_0x7abc('0x34')](respondWithResult(_0x2e4dda,0xc9))[_0x7abc('0x58')](handleError(_0x2e4dda,null));};exports['update']=function(_0x1ce5ce,_0x49d538){if(_0x1ce5ce['body']['id']){delete _0x1ce5ce[_0x7abc('0x5d')]['id'];}return db[_0x7abc('0x40')]['find']({'where':{'id':_0x1ce5ce[_0x7abc('0x5a')]['id']},'include':[{'model':db[_0x7abc('0x3d')],'as':_0x7abc('0x3e')}]})[_0x7abc('0x34')](handleEntityNotFound(_0x49d538,null))['then'](saveUpdates(_0x1ce5ce[_0x7abc('0x5d')],null))[_0x7abc('0x34')](respondWithResult(_0x49d538,null))[_0x7abc('0x58')](handleError(_0x49d538,null));};exports['destroy']=function(_0x5b9f6f,_0x2e74bb){return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0x5b9f6f[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x2e74bb,null))['then'](removeEntity(_0x2e74bb,null))[_0x7abc('0x58')](handleError(_0x2e74bb,null));};exports[_0x7abc('0x64')]=function(_0x497531,_0x1606bf){return db[_0x7abc('0x40')][_0x7abc('0x64')]()['then'](respondWithResult(_0x1606bf,null))[_0x7abc('0x58')](handleError(_0x1606bf,null));};exports[_0x7abc('0x65')]=function(_0x191c83,_0x2aa6c3,_0x12481f){if(_0x191c83['body']['id']){delete _0x191c83[_0x7abc('0x5d')]['id'];}return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0x191c83[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x2aa6c3,null))[_0x7abc('0x34')](function(_0x3d00f5){if(_0x3d00f5){_0x191c83[_0x7abc('0x5d')][_0x7abc('0x66')]=_0x3d00f5['id'];return db[_0x7abc('0x67')][_0x7abc('0x5c')](_0x191c83[_0x7abc('0x5d')]);}})[_0x7abc('0x34')](respondWithResult(_0x2aa6c3,null))[_0x7abc('0x58')](handleError(_0x2aa6c3,null));};exports['getDispositions']=function(_0x515911,_0x5de558,_0x37fb03){var _0x148cbe={'raw':![],'where':{}};var _0x5c520d={};var _0x506597={'count':0x0,'rows':[]};return db[_0x7abc('0x40')][_0x7abc('0x68')]({'where':{'id':_0x515911[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x5de558,null))[_0x7abc('0x34')](function(_0x4a4240){if(_0x4a4240){_0x5c520d['model']=_[_0x7abc('0x46')](db['Disposition']['rawAttributes']);_0x5c520d[_0x7abc('0x45')]=_[_0x7abc('0x46')](_0x515911[_0x7abc('0x45')]);_0x5c520d[_0x7abc('0x47')]=_[_0x7abc('0x48')](_0x5c520d[_0x7abc('0x49')],_0x5c520d['query']);_0x148cbe[_0x7abc('0x4b')]=_['intersection'](_0x5c520d[_0x7abc('0x49')],qs[_0x7abc('0x4a')](_0x515911['query'][_0x7abc('0x4a')]));_0x148cbe[_0x7abc('0x4b')]=_0x148cbe[_0x7abc('0x4b')][_0x7abc('0x4c')]?_0x148cbe[_0x7abc('0x4b')]:_0x5c520d[_0x7abc('0x49')];if(!_0x515911[_0x7abc('0x45')][_0x7abc('0x4d')](_0x7abc('0x69'))){_0x148cbe[_0x7abc('0x2c')]=qs[_0x7abc('0x2c')](_0x515911[_0x7abc('0x45')]['limit']);_0x148cbe['offset']=qs[_0x7abc('0x2b')](_0x515911[_0x7abc('0x45')][_0x7abc('0x2b')]);}_0x148cbe['order']=qs['sort'](_0x515911[_0x7abc('0x45')][_0x7abc('0x4e')]);_0x148cbe[_0x7abc('0x50')]=qs[_0x7abc('0x47')](_[_0x7abc('0x6a')](_0x515911[_0x7abc('0x45')],_0x5c520d[_0x7abc('0x47')]));_0x148cbe[_0x7abc('0x50')][_0x7abc('0x66')]=_0x4a4240['id'];if(_0x515911[_0x7abc('0x45')]['filter']){_0x148cbe[_0x7abc('0x50')]=_[_0x7abc('0x51')](_0x148cbe[_0x7abc('0x50')],{'$or':_[_0x7abc('0x3f')](_0x148cbe['attributes'],function(_0xa4b6e7){var _0x917925={};_0x917925[_0xa4b6e7]={'$like':'%'+_0x515911[_0x7abc('0x45')][_0x7abc('0x4f')]+'%'};return _0x917925;})});}_0x148cbe=_[_0x7abc('0x51')]({},_0x148cbe,_0x515911['options']);return db[_0x7abc('0x67')][_0x7abc('0x2e')]({'where':_0x148cbe[_0x7abc('0x50')]})[_0x7abc('0x34')](function(_0x515074){_0x506597[_0x7abc('0x2e')]=_0x515074;if(_0x515911[_0x7abc('0x45')][_0x7abc('0x54')]){_0x148cbe[_0x7abc('0x55')]=[{'all':!![]}];}return db[_0x7abc('0x67')]['findAll'](_0x148cbe);})[_0x7abc('0x34')](function(_0xfff22b){_0x506597[_0x7abc('0x57')]=_0xfff22b;return _0x506597;});}})[_0x7abc('0x34')](respondWithFilteredResult(_0x5de558,_0x148cbe))[_0x7abc('0x58')](handleError(_0x5de558,null));};exports[_0x7abc('0x6b')]=function(_0xda50c9,_0x23c842,_0x422ea2){return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0xda50c9[_0x7abc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x23c842,null))[_0x7abc('0x34')](function(_0x206b1a){if(_0x206b1a){return _0x206b1a['removeDispositions'](_0xda50c9[_0x7abc('0x45')][_0x7abc('0x6c')]);}})[_0x7abc('0x34')](respondWithStatusCode(_0x23c842,null))[_0x7abc('0x58')](handleError(_0x23c842,null));};exports[_0x7abc('0x6d')]=function(_0xeb8e21,_0xc1617a,_0x3f8ab1){if(_0xeb8e21[_0x7abc('0x5d')]['id']){delete _0xeb8e21[_0x7abc('0x5d')]['id'];}return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0xeb8e21[_0x7abc('0x5a')]['id']}})['then'](handleEntityNotFound(_0xc1617a,null))[_0x7abc('0x34')](function(_0xce71ac){if(_0xce71ac){_0xeb8e21[_0x7abc('0x5d')][_0x7abc('0x66')]=_0xce71ac['id'];return db['CannedAnswer'][_0x7abc('0x5c')](_0xeb8e21[_0x7abc('0x5d')]);}})[_0x7abc('0x34')](respondWithResult(_0xc1617a,null))[_0x7abc('0x58')](handleError(_0xc1617a,null));};exports[_0x7abc('0x6e')]=function(_0x59ee9b,_0x56e49b,_0x363fe2){var _0x54a69f={'raw':![],'where':{}};var _0x43cfa6={};var _0x30a28e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7abc('0x68')]({'where':{'id':_0x59ee9b[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x56e49b,null))[_0x7abc('0x34')](function(_0x56dab4){if(_0x56dab4){_0x43cfa6['model']=_[_0x7abc('0x46')](db[_0x7abc('0x6f')][_0x7abc('0x41')]);_0x43cfa6[_0x7abc('0x45')]=_[_0x7abc('0x46')](_0x59ee9b[_0x7abc('0x45')]);_0x43cfa6['filters']=_[_0x7abc('0x48')](_0x43cfa6[_0x7abc('0x49')],_0x43cfa6['query']);_0x54a69f[_0x7abc('0x4b')]=_['intersection'](_0x43cfa6[_0x7abc('0x49')],qs['fields'](_0x59ee9b[_0x7abc('0x45')]['fields']));_0x54a69f[_0x7abc('0x4b')]=_0x54a69f['attributes']['length']?_0x54a69f[_0x7abc('0x4b')]:_0x43cfa6[_0x7abc('0x49')];if(!_0x59ee9b[_0x7abc('0x45')][_0x7abc('0x4d')](_0x7abc('0x69'))){_0x54a69f[_0x7abc('0x2c')]=qs[_0x7abc('0x2c')](_0x59ee9b[_0x7abc('0x45')][_0x7abc('0x2c')]);_0x54a69f[_0x7abc('0x2b')]=qs[_0x7abc('0x2b')](_0x59ee9b[_0x7abc('0x45')][_0x7abc('0x2b')]);}_0x54a69f[_0x7abc('0x70')]=qs['sort'](_0x59ee9b['query'][_0x7abc('0x4e')]);_0x54a69f['where']=qs[_0x7abc('0x47')](_[_0x7abc('0x6a')](_0x59ee9b[_0x7abc('0x45')],_0x43cfa6[_0x7abc('0x47')]));_0x54a69f[_0x7abc('0x50')][_0x7abc('0x66')]=_0x56dab4['id'];if(_0x59ee9b[_0x7abc('0x45')]['filter']){_0x54a69f[_0x7abc('0x50')]=_[_0x7abc('0x51')](_0x54a69f[_0x7abc('0x50')],{'$or':_[_0x7abc('0x3f')](_0x54a69f[_0x7abc('0x4b')],function(_0x10e41e){var _0x1404c2={};_0x1404c2[_0x10e41e]={'$like':'%'+_0x59ee9b[_0x7abc('0x45')][_0x7abc('0x4f')]+'%'};return _0x1404c2;})});}_0x54a69f=_[_0x7abc('0x51')]({},_0x54a69f,_0x59ee9b['options']);return db[_0x7abc('0x6f')][_0x7abc('0x2e')]({'where':_0x54a69f[_0x7abc('0x50')]})[_0x7abc('0x34')](function(_0x38a8a5){_0x30a28e[_0x7abc('0x2e')]=_0x38a8a5;if(_0x59ee9b[_0x7abc('0x45')][_0x7abc('0x54')]){_0x54a69f[_0x7abc('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7abc('0x56')](_0x54a69f);})['then'](function(_0x59c438){_0x30a28e[_0x7abc('0x57')]=_0x59c438;return _0x30a28e;});}})[_0x7abc('0x34')](respondWithFilteredResult(_0x56e49b,_0x54a69f))[_0x7abc('0x58')](handleError(_0x56e49b,null));};exports['removeAnswers']=function(_0x27949f,_0xcd11c,_0x58a9a2){return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0x27949f[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0xcd11c,null))[_0x7abc('0x34')](function(_0x54dd47){if(_0x54dd47){return _0x54dd47[_0x7abc('0x71')](_0x27949f['query'][_0x7abc('0x6c')]);}})[_0x7abc('0x34')](respondWithStatusCode(_0xcd11c,null))[_0x7abc('0x58')](handleError(_0xcd11c,null));};exports[_0x7abc('0x72')]=function(_0x56e8e9,_0x451bd9,_0x29efbe){var _0x3b38be={'body':_0x56e8e9[_0x7abc('0x5d')],'channel':_0x7abc('0x73')};var _0x454212=[];var _0x395c07=[];var _0xae54e={};var _0x4e6fee=![];return db[_0x7abc('0x74')][_0x7abc('0x64')]()['then'](function(_0x5c7b82){if(!_0x5c7b82){throw new db[(_0x7abc('0x75'))][(_0x7abc('0x76'))](_0x7abc('0x77'));}_0x454212=_['difference'](_[_0x7abc('0x46')](_0x5c7b82),['createdAt',_0x7abc('0x78')]);_0x395c07=_[_0x7abc('0x79')](_[_0x7abc('0x46')](_0x5c7b82),['createdAt',_0x7abc('0x78'),_0x7abc('0x7a'),_0x7abc('0x7b')]);if(_0x56e8e9[_0x7abc('0x5d')]['id']){delete _0x56e8e9[_0x7abc('0x5d')]['id'];}if(_['isNil'](_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x7c')])){throw new db['Sequelize']['ValidationError'](_0x7abc('0x7d'));}if(_[_0x7abc('0x7e')](_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x5d')])||_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x5d')]===''){throw new db[(_0x7abc('0x75'))][(_0x7abc('0x76'))](_0x7abc('0x7f'));}if(_[_0x7abc('0x7e')](_0x56e8e9['body'][_0x7abc('0x80')])){throw new db[(_0x7abc('0x75'))][(_0x7abc('0x76'))](_0x7abc('0x81')+_0x395c07);}if(!_[_0x7abc('0x82')](_0x395c07,_0x56e8e9[_0x7abc('0x5d')]['mapKey'])){throw new db[(_0x7abc('0x75'))][(_0x7abc('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x395c07);}_0xae54e[_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x80')]]=_0x56e8e9['body'][_0x7abc('0x7c')];})['then'](function(){return db[_0x7abc('0x40')]['find']({'where':{'id':_0x56e8e9['params']['id']},'include':[{'model':db[_0x7abc('0x83')],'as':_0x7abc('0x84'),'include':[{'model':db['CmContact'],'as':_0x7abc('0x85'),'where':_0xae54e,'limit':0x1,'order':[[_0x7abc('0x78'),_0x7abc('0x86')]]}]},{'model':db[_0x7abc('0x87')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x451bd9,null))[_0x7abc('0x34')](function(_0x375e45){if(_0x375e45&&_0x375e45[_0x7abc('0x84')]){_0x3b38be[_0x7abc('0x88')]=_0x375e45;_0x3b38be[_0x7abc('0x89')]=_0x375e45['Applications'];_0x3b38be[_0x7abc('0x8a')]=_0x375e45[_0x7abc('0x84')];_0x3b38be[_0x7abc('0x89')]=_[_0x7abc('0x8b')](_0x3b38be[_0x7abc('0x89')],['priority'],[_0x7abc('0x8c')]);if(_0x3b38be[_0x7abc('0x88')][_0x7abc('0x8d')]){delete _0x3b38be[_0x7abc('0x88')][_0x7abc('0x8d')];}if(_0x3b38be[_0x7abc('0x88')][_0x7abc('0x84')]&&_0x3b38be['account']['List']['Contacts'][_0x7abc('0x4c')]){return _0x3b38be[_0x7abc('0x88')][_0x7abc('0x84')][_0x7abc('0x85')][0x0];}var _0x5a740b=_[_0x7abc('0x18')](_0x56e8e9[_0x7abc('0x5d')],{'firstName':_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x7c')],'ListId':_0x375e45[_0x7abc('0x7b')]});_0x5a740b[_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x80')]]=_0x56e8e9['body'][_0x7abc('0x7c')];return db['CmContact'][_0x7abc('0x5c')](_0x5a740b,{'fields':_0x454212,'raw':!![]});}})[_0x7abc('0x34')](handleEntityNotFound(_0x451bd9,null))[_0x7abc('0x34')](function(_0x59dd6c){_0x3b38be['contact']=_0x59dd6c;if(_0x59dd6c){var _0x13a73d={'ContactId':_0x59dd6c['id'],'OpenchannelAccountId':_0x56e8e9[_0x7abc('0x5a')]['id'],'from':(_0x59dd6c['firstName']||'')+'\x20'+(_0x59dd6c[_0x7abc('0x8e')]||'')};var _0x14e478={'OpenchannelAccountId':_0x56e8e9[_0x7abc('0x5a')]['id'],'closed':![]};if(_0x56e8e9['body']['threadId']){_0x14e478[_0x7abc('0x8f')]=_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x8f')];return db[_0x7abc('0x90')][_0x7abc('0x5b')]({'where':_0x14e478})[_0x7abc('0x34')](function(_0x50fbb8){if(_0x50fbb8){return[_0x50fbb8,![]];}_0x13a73d['threadId']=_0x56e8e9[_0x7abc('0x5d')]['threadId'];_0x13a73d[_0x7abc('0x91')]=_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x91')];return db[_0x7abc('0x90')]['create'](_0x13a73d)[_0x7abc('0x34')](function(_0x3c8361){return[_0x3c8361,!![]];});});}else{_0x14e478[_0x7abc('0x8f')]=null;}_0x14e478[_0x7abc('0x92')]=_0x59dd6c['id'];return db[_0x7abc('0x90')][_0x7abc('0x5b')]({'where':_0x14e478})['then'](function(_0xc9b556){if(_0xc9b556){return[_0xc9b556,![]];}return db['OpenchannelInteraction'][_0x7abc('0x5c')](_0x13a73d)[_0x7abc('0x34')](function(_0x2a043d){return[_0x2a043d,!![]];});});}})[_0x7abc('0x93')](function(_0x1ded97,_0x1c2565){if(_0x1ded97){_0x4e6fee=_0x1c2565;if(!_0x1c2565){var _0x2c6f65={'from':(_0x3b38be[_0x7abc('0x94')][_0x7abc('0x95')]||'')+'\x20'+(_0x3b38be['contact'][_0x7abc('0x8e')]||'')};if(_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x8f')]&&_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x96')]&&_0x56e8e9['body']['threadId']!=_0x56e8e9['body'][_0x7abc('0x96')]){_0x2c6f65[_0x7abc('0x8f')]=_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x96')];}return _0x1ded97[_0x7abc('0x33')](_0x2c6f65);}else{return _0x1ded97;}}})[_0x7abc('0x34')](function(_0x6944c){_0x3b38be[_0x7abc('0x97')]=_0x6944c[_0x7abc('0x5f')]({'plain':!![]});_0x3b38be[_0x7abc('0x97')][_0x7abc('0x98')]=_0x4e6fee;if(_0x3b38be[_0x7abc('0x97')]['created']){if(_0x3b38be[_0x7abc('0x88')][_0x7abc('0x99')]){_0x3b38be[_0x7abc('0x89')][_0x7abc('0x9a')]({'id':0x0,'priority':_0x3b38be[_0x7abc('0x89')][_0x7abc('0x4c')]+0x1,'app':_0x7abc('0x9b'),'appdata':'unmanaged','interval':_0x7abc('0x9c')});}}return db[_0x7abc('0x9d')][_0x7abc('0x5c')]({'body':_0x56e8e9[_0x7abc('0x5d')][_0x7abc('0x5d')],'OpenchannelAccountId':_0x56e8e9[_0x7abc('0x5a')]['id'],'OpenchannelInteractionId':_0x6944c['id'],'direction':'in','ContactId':_0x3b38be['contact']['id'],'AttachmentId':_0x56e8e9[_0x7abc('0x5d')]['AttachmentId']});})[_0x7abc('0x34')](function(_0x2f7a42){_0x3b38be[_0x7abc('0x27')]=_0x2f7a42;if(_0x3b38be['interaction']['UserId']){return db[_0x7abc('0x9e')][_0x7abc('0x5b')]({'attributes':['id',_0x7abc('0x3a')],'where':{'id':_0x3b38be[_0x7abc('0x97')][_0x7abc('0x9f')]}})[_0x7abc('0x34')](function(_0x45d32d){if(_0x45d32d){_0x3b38be[_0x7abc('0x89')][_0x7abc('0xa0')]({'id':0x0,'priority':0x0,'app':_0x7abc('0xa1'),'appdata':_0x45d32d[_0x7abc('0x3a')]+','+(_0x3b38be[_0x7abc('0x88')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3b38be['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x7abc('0xa2'),_0x3b38be);});}return respondWithRpcPromise('Start',_0x7abc('0xa2'),_0x3b38be);})[_0x7abc('0x34')](function(_0x3f762d){respondWithRpcPromise(_0x7abc('0xa3'),_0x7abc('0xa3'),{'event':'notify','message':_0x3f762d},client9002);return _0x3f762d;})['then'](respondWithResult(_0x451bd9,null))[_0x7abc('0x58')](handleError(_0x451bd9,null));};exports[_0x7abc('0xa4')]=function(_0xd0cecd,_0x1b5aef){var _0x283f56=_0xd0cecd[_0x7abc('0x5a')]['id'];var _0x35c3a5=_0xd0cecd[_0x7abc('0x5d')];var _0x540c69=0xc8;var _0x484632=null;return db[_0x7abc('0xa5')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x7abc('0xa6')]['READ_COMMITTED']},function(_0x299ca5){return db['OpenchannelAccount'][_0x7abc('0x68')]({'where':{'id':_0x283f56},'transaction':_0x299ca5})[_0x7abc('0x34')](function(_0x4f9eb0){if(_0x4f9eb0){return db[_0x7abc('0x87')]['destroy']({'where':{'OpenchannelAccountId':_0x283f56},'transaction':_0x299ca5})['then'](function(){var _0x21048b=_['map'](_0x35c3a5,function(_0x586928){_0x586928[_0x7abc('0x66')]=_0x283f56;return _0x586928;});return db[_0x7abc('0x87')][_0x7abc('0xa7')](_0x21048b,{'transaction':_0x299ca5});});}else{_0x540c69=0x194;_0x484632=[];}});})[_0x7abc('0x34')](function(){if(_0x540c69!==0x194){return db[_0x7abc('0x87')][_0x7abc('0xa8')]({'where':{'OpenchannelAccountId':_0x283f56},'order':'priority'})['then'](function(_0x1aeb4b){_0x484632=_0x1aeb4b;});}})[_0x7abc('0x58')](function(_0x556cab){_0x540c69=0x1f4;logger[_0x7abc('0x26')](_0x556cab[_0x7abc('0x39')]);if(_0x556cab['name']){delete _0x556cab[_0x7abc('0x3a')];}_0x484632=_0x556cab;})[_0x7abc('0xa9')](function(){if(_0x484632===null){_0x1b5aef[_0x7abc('0x28')](_0x540c69);}else{if(_0x540c69===0x1f4){_0x1b5aef[_0x7abc('0x29')](_0x540c69)[_0x7abc('0x3b')](_0x484632);}else{_0x1b5aef[_0x7abc('0x29')](_0x540c69)[_0x7abc('0x2a')](_0x484632);}}});};exports[_0x7abc('0xaa')]=function(_0x42ff23,_0x3fdd30,_0x27f805){var _0x2ee1e2={};var _0x14def8={};var _0x4f9991;var _0x3afed2;return db[_0x7abc('0x40')][_0x7abc('0x68')]({'where':{'id':_0x42ff23[_0x7abc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3fdd30,null))[_0x7abc('0x34')](function(_0x3775a4){if(_0x3775a4){_0x4f9991=_0x3775a4;_0x14def8['model']=_[_0x7abc('0x46')](db['OpenchannelApplication'][_0x7abc('0x41')]);_0x14def8['query']=_[_0x7abc('0x46')](_0x42ff23[_0x7abc('0x45')]);_0x14def8[_0x7abc('0x47')]=_[_0x7abc('0x48')](_0x14def8['model'],_0x14def8[_0x7abc('0x45')]);_0x2ee1e2[_0x7abc('0x4b')]=_[_0x7abc('0x48')](_0x14def8[_0x7abc('0x49')],qs['fields'](_0x42ff23['query'][_0x7abc('0x4a')]));_0x2ee1e2[_0x7abc('0x4b')]=_0x2ee1e2[_0x7abc('0x4b')][_0x7abc('0x4c')]?_0x2ee1e2[_0x7abc('0x4b')]:_0x14def8['model'];_0x2ee1e2[_0x7abc('0x70')]=qs[_0x7abc('0x4e')](_0x42ff23['query'][_0x7abc('0x4e')]);_0x2ee1e2[_0x7abc('0x50')]=qs['filters'](_[_0x7abc('0x6a')](_0x42ff23[_0x7abc('0x45')],_0x14def8['filters']));if(_0x42ff23[_0x7abc('0x45')]['filter']){_0x2ee1e2[_0x7abc('0x50')]=_['merge'](_0x2ee1e2[_0x7abc('0x50')],{'$or':_['map'](_0x2ee1e2[_0x7abc('0x4b')],function(_0x3fcaab){var _0x1bb380={};_0x1bb380[_0x3fcaab]={'$like':'%'+_0x42ff23[_0x7abc('0x45')][_0x7abc('0x4f')]+'%'};return _0x1bb380;})});}_0x2ee1e2=_['merge']({},_0x2ee1e2,_0x42ff23['options']);return _0x4f9991[_0x7abc('0xaa')](_0x2ee1e2);}})[_0x7abc('0x34')](function(_0x905228){if(_0x905228){_0x3afed2=_0x905228['length'];if(!_0x42ff23['query'][_0x7abc('0x4d')](_0x7abc('0x69'))){_0x2ee1e2[_0x7abc('0x2c')]=qs[_0x7abc('0x2c')](_0x42ff23[_0x7abc('0x45')]['limit']);_0x2ee1e2[_0x7abc('0x2b')]=qs['offset'](_0x42ff23[_0x7abc('0x45')]['offset']);}return _0x4f9991[_0x7abc('0xaa')](_0x2ee1e2);}})[_0x7abc('0x34')](function(_0x15cd09){if(_0x15cd09){return _0x15cd09?{'count':_0x3afed2,'rows':_0x15cd09}:null;}})[_0x7abc('0x34')](respondWithResult(_0x3fdd30,null))['catch'](handleError(_0x3fdd30,null));};exports[_0x7abc('0xab')]=function(_0x270ac8,_0x3fffd3,_0x340a43){var _0x4fa154={'raw':![],'where':{}};var _0x464685={};var _0x15dbb8={'count':0x0,'rows':[]};return db[_0x7abc('0x40')]['findOne']({'where':{'id':_0x270ac8[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x3fffd3,null))[_0x7abc('0x34')](function(_0x247bc4){if(_0x247bc4){_0x464685[_0x7abc('0x49')]=_[_0x7abc('0x46')](db[_0x7abc('0x90')][_0x7abc('0x41')]);_0x464685[_0x7abc('0x45')]=_[_0x7abc('0x46')](_0x270ac8[_0x7abc('0x45')]);_0x464685[_0x7abc('0x47')]=_[_0x7abc('0x48')](_0x464685[_0x7abc('0x49')],_0x464685[_0x7abc('0x45')]);_0x4fa154[_0x7abc('0x4b')]=_[_0x7abc('0x48')](_0x464685[_0x7abc('0x49')],qs[_0x7abc('0x4a')](_0x270ac8['query'][_0x7abc('0x4a')]));_0x4fa154[_0x7abc('0x4b')]=_0x4fa154[_0x7abc('0x4b')][_0x7abc('0x4c')]?_0x4fa154[_0x7abc('0x4b')]:_0x464685[_0x7abc('0x49')];if(!_0x270ac8[_0x7abc('0x45')]['hasOwnProperty'](_0x7abc('0x69'))){_0x4fa154[_0x7abc('0x2c')]=qs[_0x7abc('0x2c')](_0x270ac8[_0x7abc('0x45')][_0x7abc('0x2c')]);_0x4fa154['offset']=qs['offset'](_0x270ac8[_0x7abc('0x45')]['offset']);}_0x4fa154['order']=qs[_0x7abc('0x4e')](_0x270ac8['query']['sort']);_0x4fa154['where']=qs[_0x7abc('0x47')](_[_0x7abc('0x6a')](_0x270ac8[_0x7abc('0x45')],_0x464685['filters']));_0x4fa154[_0x7abc('0x50')]['OpenchannelAccountId']=_0x247bc4['id'];if(_0x270ac8[_0x7abc('0x45')][_0x7abc('0x4f')]){_0x4fa154['where']=_[_0x7abc('0x51')](_0x4fa154[_0x7abc('0x50')],{'$or':_[_0x7abc('0x3f')](_0x4fa154[_0x7abc('0x4b')],function(_0x4a07dd){var _0xdc15b6={};_0xdc15b6[_0x4a07dd]={'$like':'%'+_0x270ac8[_0x7abc('0x45')]['filter']+'%'};return _0xdc15b6;})});}_0x4fa154=_[_0x7abc('0x51')]({},_0x4fa154,_0x270ac8['options']);return db[_0x7abc('0x90')][_0x7abc('0x2e')]({'where':_0x4fa154[_0x7abc('0x50')]})['then'](function(_0x2bf2e4){_0x15dbb8[_0x7abc('0x2e')]=_0x2bf2e4;if(_0x270ac8['query']['includeAll']){_0x4fa154[_0x7abc('0x55')]=[{'model':db[_0x7abc('0x74')],'as':_0x7abc('0xac'),'required':![]},{'model':db[_0x7abc('0x9e')],'as':_0x7abc('0xad'),'attributes':[_0x7abc('0x3a'),_0x7abc('0xae'),_0x7abc('0xaf')],'required':![]},{'model':db[_0x7abc('0xb0')],'as':_0x7abc('0xb1'),'attributes':['id',_0x7abc('0x3a'),_0x7abc('0xb2')],'where':_0x270ac8['query'][_0x7abc('0xb3')]?{'id':_0x270ac8['query']['tag']}:undefined,'required':_0x270ac8[_0x7abc('0x45')][_0x7abc('0xb3')]?!![]:![]}];}return db[_0x7abc('0x90')][_0x7abc('0x56')](_0x4fa154);})[_0x7abc('0x34')](function(_0x423809){_0x15dbb8['rows']=_0x423809;return _0x15dbb8;});}})[_0x7abc('0x34')](respondWithFilteredResult(_0x3fffd3,_0x4fa154))['catch'](handleError(_0x3fffd3,null));};exports[_0x7abc('0xb4')]=function(_0x5cbe65,_0x4b7087,_0x474450){return db[_0x7abc('0x40')][_0x7abc('0x5b')]({'where':{'id':_0x5cbe65[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x4b7087,null))['then'](function(_0x2271a0){if(_0x2271a0){return _0x2271a0[_0x7abc('0xb4')](_0x5cbe65[_0x7abc('0x5d')][_0x7abc('0x6c')],_['omit'](_0x5cbe65[_0x7abc('0x5d')],[_0x7abc('0x6c'),'id'])||{})['spread'](function(_0x71f28d){for(var _0x4f0334=0x0;_0x4f0334<_0x5cbe65[_0x7abc('0x5d')][_0x7abc('0x6c')][_0x7abc('0x4c')];_0x4f0334+=0x1){socket[_0x7abc('0xb5')](_0x7abc('0xb6'),{'UserId':Number(_0x5cbe65[_0x7abc('0x5d')]['ids'][_0x4f0334]),'OpenchannelAccountId':Number(_0x5cbe65[_0x7abc('0x5a')]['id'])});}return _0x71f28d;});}})[_0x7abc('0x34')](respondWithResult(_0x4b7087,null))[_0x7abc('0x58')](handleError(_0x4b7087,null));};exports[_0x7abc('0xb7')]=function(_0x35cd59,_0x5a71c3,_0x5c396e){return db[_0x7abc('0x40')]['find']({'where':{'id':_0x35cd59[_0x7abc('0x5a')]['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x5a71c3,null))[_0x7abc('0x34')](function(_0x568d96){if(_0x568d96){return _0x568d96[_0x7abc('0xb7')](_0x35cd59[_0x7abc('0x45')][_0x7abc('0x6c')])['then'](function(){if(_[_0x7abc('0xb8')](_0x35cd59['query'][_0x7abc('0x6c')])){for(var _0x51e7c6=0x0;_0x51e7c6<_0x35cd59['query']['ids'][_0x7abc('0x4c')];_0x51e7c6+=0x1){socket[_0x7abc('0xb5')](_0x7abc('0xb9'),{'UserId':Number(_0x35cd59[_0x7abc('0x45')][_0x7abc('0x6c')][_0x51e7c6]),'OpenchannelAccountId':Number(_0x35cd59[_0x7abc('0x5a')]['id'])});}}else{socket[_0x7abc('0xb5')](_0x7abc('0xb9'),{'UserId':Number(_0x35cd59[_0x7abc('0x45')][_0x7abc('0x6c')]),'OpenchannelAccountId':Number(_0x35cd59[_0x7abc('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a71c3,null))[_0x7abc('0x58')](handleError(_0x5a71c3,null));};exports[_0x7abc('0xba')]=function(_0x1eaca5,_0x517328,_0x452a19){var _0x1ceb19={};var _0x2edacb={};var _0x3b881a;var _0x446115;return db[_0x7abc('0x40')][_0x7abc('0x68')]({'where':{'id':_0x1eaca5['params']['id']}})[_0x7abc('0x34')](handleEntityNotFound(_0x517328,null))[_0x7abc('0x34')](function(_0x34685b){if(_0x34685b){_0x3b881a=_0x34685b;_0x2edacb[_0x7abc('0x49')]=_[_0x7abc('0x46')](db[_0x7abc('0x9e')]['rawAttributes']);_0x2edacb[_0x7abc('0x45')]=_[_0x7abc('0x46')](_0x1eaca5[_0x7abc('0x45')]);_0x2edacb[_0x7abc('0x47')]=_['intersection'](_0x2edacb['model'],_0x2edacb[_0x7abc('0x45')]);_0x1ceb19[_0x7abc('0x4b')]=_['intersection'](_0x2edacb[_0x7abc('0x49')],qs['fields'](_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x4a')]));_0x1ceb19['attributes']=_0x1ceb19[_0x7abc('0x4b')][_0x7abc('0x4c')]?_0x1ceb19[_0x7abc('0x4b')]:_0x2edacb[_0x7abc('0x49')];_0x1ceb19[_0x7abc('0x70')]=qs[_0x7abc('0x4e')](_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x4e')]);_0x1ceb19[_0x7abc('0x50')]=qs[_0x7abc('0x47')](_[_0x7abc('0x6a')](_0x1eaca5[_0x7abc('0x45')],_0x2edacb[_0x7abc('0x47')]));if(_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x4f')]){_0x1ceb19['where']=_[_0x7abc('0x51')](_0x1ceb19['where'],{'$or':_[_0x7abc('0x3f')](_0x1ceb19[_0x7abc('0x4b')],function(_0x26e49e){var _0x1081ea={};_0x1081ea[_0x26e49e]={'$like':'%'+_0x1eaca5['query']['filter']+'%'};return _0x1081ea;})});}_0x1ceb19=_[_0x7abc('0x51')]({},_0x1ceb19,_0x1eaca5[_0x7abc('0x53')]);return _0x3b881a['getAgents'](_0x1ceb19);}})[_0x7abc('0x34')](function(_0x3ab00a){if(_0x3ab00a){_0x446115=_0x3ab00a['length'];if(!_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x4d')](_0x7abc('0x69'))){_0x1ceb19[_0x7abc('0x2c')]=qs['limit'](_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x2c')]);_0x1ceb19[_0x7abc('0x2b')]=qs[_0x7abc('0x2b')](_0x1eaca5[_0x7abc('0x45')][_0x7abc('0x2b')]);}return _0x3b881a[_0x7abc('0xba')](_0x1ceb19);}})['then'](function(_0x20c1bc){if(_0x20c1bc){return _0x20c1bc?{'count':_0x446115,'rows':_0x20c1bc}:null;}})[_0x7abc('0x34')](respondWithResult(_0x517328,null))[_0x7abc('0x58')](handleError(_0x517328,null));};exports[_0x7abc('0x3b')]=function(_0x4d4d3b,_0x16ec50,_0x16aad3){var _0xadf7ca,_0x1a7e8a,_0x4a31b6;if(_['isNil'](_0x4d4d3b['body'][_0x7abc('0x5d')])||_0x4d4d3b[_0x7abc('0x5d')][_0x7abc('0x5d')]===''){throw new db[(_0x7abc('0x75'))]['ValidationError'](_0x7abc('0x7f'));}if(_[_0x7abc('0x7e')](_0x4d4d3b[_0x7abc('0x5d')]['to'])){}_0xadf7ca=_0x4d4d3b[_0x7abc('0x5d')]['to'];return db[_0x7abc('0x40')][_0x7abc('0x68')]({'where':{'id':_0x4d4d3b[_0x7abc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x16ec50,null))[_0x7abc('0x34')](function(_0x5ed557){if(_0x5ed557){return db['OpenchannelAccount'][_0x7abc('0x5b')]({'where':{'id':_0x5ed557['id']},'include':[{'model':db[_0x7abc('0x83')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x5ed557['mapKey']]:_0xadf7ca},'limit':0x1,'order':[['updatedAt',_0x7abc('0x86')]]}]}]})[_0x7abc('0x34')](handleEntityNotFound(_0x16ec50,null))['then'](function(_0x53824c){if(_0x53824c&&_0x53824c['List']){_0x1a7e8a=_0x53824c[_0x7abc('0x5f')]({'plain':!![]});if(_0x1a7e8a[_0x7abc('0x84')]&&_0x1a7e8a['List'][_0x7abc('0x85')][_0x7abc('0x4c')]){return _0x1a7e8a[_0x7abc('0x84')]['Contacts'][0x0];}return db[_0x7abc('0x74')][_0x7abc('0x5c')](_[_0x7abc('0x18')](_0x4d4d3b[_0x7abc('0x5d')],{'firstName':_0xadf7ca,[_0x53824c[_0x7abc('0x80')]]:_0xadf7ca,'phone':_0xadf7ca,'ListId':_0x1a7e8a[_0x7abc('0x7b')]}));}})[_0x7abc('0x34')](handleEntityNotFound(_0x16ec50,null))['then'](function(_0x21ece4){if(_0x21ece4){_0x4a31b6=_0x21ece4;return db[_0x7abc('0x90')][_0x7abc('0x5b')]({'where':{'ContactId':_0x4a31b6['id'],'closed':![],'OpenchannelAccountId':_0x1a7e8a['id']}})[_0x7abc('0x34')](function(_0x20d4c9){if(_0x20d4c9){return[_0x20d4c9,![]];}return db[_0x7abc('0x90')]['create']({'UserId':_0x4d4d3b['user']['id'],'ContactId':_0x4a31b6['id'],'OpenchannelAccountId':_0x1a7e8a['id'],'lastMsgDirection':_0x7abc('0xbb'),'firstMsgDirection':_0x7abc('0xbb'),'Messages':[_[_0x7abc('0x51')](_0x4d4d3b['body'],{'read':![],'body':_0x4d4d3b[_0x7abc('0x5d')][_0x7abc('0x5d')],'OpenchannelAccountId':_0x1a7e8a['id'],'UserId':_0x4d4d3b[_0x7abc('0x5e')]['id'],'ContactId':_0x4a31b6['id']})]},{'include':[{'model':db[_0x7abc('0x9d')],'as':_0x7abc('0xbc')}]})[_0x7abc('0x34')](function(_0x148c1d){return[_0x148c1d,!![]];});});}})[_0x7abc('0x93')](function(_0x4dba75,_0x321059){if(_0x321059){return _0x4dba75;}return db['OpenchannelMessage']['create'](_[_0x7abc('0x51')](_0x4d4d3b[_0x7abc('0x5d')],{'read':![],'body':_0x4d4d3b['body'][_0x7abc('0x5d')],'OpenchannelAccountId':_0x1a7e8a['id'],'OpenchannelInteractionId':_0x4dba75['id'],'UserId':_0x4d4d3b[_0x7abc('0x5e')]['id'],'ContactId':_0x4a31b6['id']}))[_0x7abc('0x34')](function(_0x3eeb42){_0x4dba75[_0x7abc('0xbd')][_0x7abc('0xbc')]=[];_0x4dba75[_0x7abc('0xbd')][_0x7abc('0xbc')]['push'](_0x3eeb42[_0x7abc('0xbd')]);return _0x4dba75;});});}})[_0x7abc('0x34')](respondWithResult(_0x16ec50,null))['catch'](handleError(_0x16ec50,null));};
\ No newline at end of file
+var _0x3df4=['isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','User','Owner','fullname','Tag','tag','rows','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','http','client','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','show','params','rawAttributes','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x3df4,0x102));var _0x43df=function(_0x878608,_0x4b3d62){_0x878608=_0x878608-0x0;var _0x394789=_0x3df4[_0x878608];return _0x394789;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x43df('0x0'));var jsonpatch=require(_0x43df('0x1'));var rp=require(_0x43df('0x2'));var moment=require(_0x43df('0x3'));var BPromise=require(_0x43df('0x4'));var Mustache=require(_0x43df('0x5'));var util=require(_0x43df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x43df('0x7'));var ejs=require(_0x43df('0x8'));var fs=require('fs');var fs_extra=require(_0x43df('0x9'));var _=require(_0x43df('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43df('0xb'));var deskjs=require(_0x43df('0xc'));var toCsv=require(_0x43df('0x7'));var querystring=require(_0x43df('0xd'));var Papa=require('papaparse');var Redis=require(_0x43df('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x43df('0xf'));var as=require(_0x43df('0x10'));var hardwareService=require(_0x43df('0x11'));var logger=require(_0x43df('0x12'))(_0x43df('0x13'));var utils=require(_0x43df('0x14'));var config=require(_0x43df('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x43df('0x16'))['db'];config[_0x43df('0x17')]=_['defaults'](config[_0x43df('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x43df('0x18'))(new Redis(config[_0x43df('0x17')]));require('./openchannelAccount.socket')[_0x43df('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x43df('0x1a')]({'port':0x232c});var client9002=jayson[_0x43df('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f026,_0x592c70,_0x3bed20,_0x54965f){return new BPromise(function(_0x14b258,_0x1fc8f6){var _0x2126fd=_0x54965f||client;return _0x2126fd[_0x43df('0x1c')](_0x24f026,_0x3bed20)['then'](function(_0x376373){logger[_0x43df('0x1d')](_0x43df('0x1e'),_0x592c70,_0x43df('0x1f'));logger['debug'](_0x43df('0x20'),_0x592c70,_0x43df('0x1f'),JSON[_0x43df('0x21')](_0x376373));if(_0x376373['error']){if(_0x376373['error'][_0x43df('0x22')]===0x1f4){logger[_0x43df('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x592c70,_0x376373[_0x43df('0x23')][_0x43df('0x24')]);return _0x1fc8f6(_0x376373[_0x43df('0x23')]['message']);}logger[_0x43df('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x592c70,_0x376373[_0x43df('0x23')]['message']);return _0x14b258(_0x376373[_0x43df('0x23')][_0x43df('0x24')]);}else{logger[_0x43df('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x592c70,_0x43df('0x1f'));_0x14b258(_0x376373['result'][_0x43df('0x24')]);}})[_0x43df('0x25')](function(_0xda44f3){logger[_0x43df('0x23')](_0x43df('0x1e'),_0x592c70,_0xda44f3);_0x1fc8f6(_0xda44f3);});});}function respondWithStatusCode(_0x188937,_0x1a09be){_0x1a09be=_0x1a09be||0xcc;return function(_0x33e1e2){if(_0x33e1e2){return _0x188937[_0x43df('0x26')](_0x1a09be);}return _0x188937[_0x43df('0x27')](_0x1a09be)[_0x43df('0x28')]();};}function respondWithResult(_0x4ade02,_0x38f9b8){_0x38f9b8=_0x38f9b8||0xc8;return function(_0x2555ad){if(_0x2555ad){return _0x4ade02[_0x43df('0x27')](_0x38f9b8)[_0x43df('0x29')](_0x2555ad);}};}function respondWithFilteredResult(_0x250fda,_0x290dae){return function(_0x461ec2){if(_0x461ec2){var _0xcc74c7=typeof _0x290dae[_0x43df('0x2a')]==='undefined'&&typeof _0x290dae['limit']===_0x43df('0x2b');var _0x5fdcab=_0x461ec2[_0x43df('0x2c')];var _0x4665c7=_0xcc74c7?0x0:_0x290dae[_0x43df('0x2a')];var _0x4b83a9=_0xcc74c7?_0x461ec2[_0x43df('0x2c')]:_0x290dae[_0x43df('0x2a')]+_0x290dae[_0x43df('0x2d')];var _0x1a480a;if(_0x4b83a9>=_0x5fdcab){_0x4b83a9=_0x5fdcab;_0x1a480a=0xc8;}else{_0x1a480a=0xce;}_0x250fda[_0x43df('0x27')](_0x1a480a);return _0x250fda[_0x43df('0x2e')](_0x43df('0x2f'),_0x4665c7+'-'+_0x4b83a9+'/'+_0x5fdcab)[_0x43df('0x29')](_0x461ec2);}return null;};}function patchUpdates(_0x1a6ece){return function(_0x135561){try{jsonpatch[_0x43df('0x30')](_0x135561,_0x1a6ece,!![]);}catch(_0x6ca4e7){return BPromise[_0x43df('0x31')](_0x6ca4e7);}return _0x135561[_0x43df('0x32')]();};}function saveUpdates(_0x4a5636,_0x530941){return function(_0x5af2e){if(_0x5af2e){return _0x5af2e['update'](_0x4a5636)[_0x43df('0x33')](function(_0x7823f7){return _0x7823f7;});}return null;};}function removeEntity(_0x1788ce,_0x1ed18f){return function(_0x4f5a51){if(_0x4f5a51){return _0x4f5a51[_0x43df('0x34')]()[_0x43df('0x33')](function(){var _0x1843dc=_0x4f5a51['get']({'plain':!![]});var _0x104839=_0x43df('0x35');return db[_0x43df('0x36')][_0x43df('0x34')]({'where':{'type':_0x104839,'resourceId':_0x1843dc['id']}})['then'](function(){return _0x4f5a51;});})[_0x43df('0x33')](function(){_0x1788ce[_0x43df('0x27')](0xcc)[_0x43df('0x28')]();});}};}function handleEntityNotFound(_0x18466b,_0x25f1f5){return function(_0x1e83ff){if(!_0x1e83ff){_0x18466b['sendStatus'](0x194);}return _0x1e83ff;};}function handleError(_0x49ca9a,_0x38e84e){_0x38e84e=_0x38e84e||0x1f4;return function(_0x599760){logger['error'](_0x599760['stack']);if(_0x599760['name']){delete _0x599760[_0x43df('0x37')];}_0x49ca9a[_0x43df('0x27')](_0x38e84e)[_0x43df('0x38')](_0x599760);};}exports[_0x43df('0x39')]=function(_0x48dd3c,_0x3d8aad){var _0x189888={'include':[{'model':db[_0x43df('0x3a')],'as':_0x43df('0x3b')}]},_0x505124={},_0x3e130a={'count':0x0,'rows':[]};var _0x347dfa=_[_0x43df('0x3c')](db[_0x43df('0x3d')]['rawAttributes'],function(_0x3b43bb){return{'name':_0x3b43bb['fieldName'],'type':_0x3b43bb['type'][_0x43df('0x3e')]};});_0x505124[_0x43df('0x3f')]=_[_0x43df('0x3c')](_0x347dfa,_0x43df('0x37'));_0x505124[_0x43df('0x40')]=_[_0x43df('0x41')](_0x48dd3c['query']);_0x505124[_0x43df('0x42')]=_[_0x43df('0x43')](_0x505124[_0x43df('0x3f')],_0x505124[_0x43df('0x40')]);_0x189888[_0x43df('0x44')]=_[_0x43df('0x43')](_0x505124['model'],qs[_0x43df('0x45')](_0x48dd3c['query'][_0x43df('0x45')]));_0x189888[_0x43df('0x44')]=_0x189888['attributes'][_0x43df('0x46')]?_0x189888[_0x43df('0x44')]:_0x505124[_0x43df('0x3f')];if(!_0x48dd3c[_0x43df('0x40')][_0x43df('0x47')](_0x43df('0x48'))){_0x189888[_0x43df('0x2d')]=qs[_0x43df('0x2d')](_0x48dd3c[_0x43df('0x40')][_0x43df('0x2d')]);_0x189888['offset']=qs[_0x43df('0x2a')](_0x48dd3c['query']['offset']);}_0x189888[_0x43df('0x49')]=qs[_0x43df('0x4a')](_0x48dd3c[_0x43df('0x40')]['sort']);_0x189888[_0x43df('0x4b')]=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x48dd3c[_0x43df('0x40')],_0x505124[_0x43df('0x42')]),_0x347dfa);if(_0x48dd3c[_0x43df('0x40')][_0x43df('0x4d')]){_0x189888[_0x43df('0x4b')]=_[_0x43df('0x4e')](_0x189888[_0x43df('0x4b')],{'$or':_[_0x43df('0x3c')](_0x347dfa,function(_0x512220){if(_0x512220[_0x43df('0x4f')]!=='VIRTUAL'){var _0x1d7c77={};_0x1d7c77[_0x512220[_0x43df('0x37')]]={'$like':'%'+_0x48dd3c['query'][_0x43df('0x4d')]+'%'};return _0x1d7c77;}})});}_0x189888=_['merge']({},_0x189888,_0x48dd3c[_0x43df('0x50')]);var _0x5f323b={'where':_0x189888[_0x43df('0x4b')]};return db[_0x43df('0x3d')][_0x43df('0x2c')](_0x5f323b)[_0x43df('0x33')](function(_0x519b5b){_0x3e130a[_0x43df('0x2c')]=_0x519b5b;if(_0x48dd3c[_0x43df('0x40')][_0x43df('0x51')]){_0x189888['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x43df('0x52')](_0x189888);})[_0x43df('0x33')](function(_0x35b1c2){_0x3e130a['rows']=_0x35b1c2;return _0x3e130a;})[_0x43df('0x33')](respondWithFilteredResult(_0x3d8aad,_0x189888))[_0x43df('0x25')](handleError(_0x3d8aad,null));};exports[_0x43df('0x53')]=function(_0x391167,_0x11e996){var _0xd81944={'raw':![],'where':{'id':_0x391167[_0x43df('0x54')]['id']},'include':[{'model':db[_0x43df('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2cf198={};_0x2cf198[_0x43df('0x3f')]=_[_0x43df('0x41')](db[_0x43df('0x3d')][_0x43df('0x55')]);_0x2cf198['query']=_[_0x43df('0x41')](_0x391167[_0x43df('0x40')]);_0x2cf198[_0x43df('0x42')]=_[_0x43df('0x43')](_0x2cf198[_0x43df('0x3f')],_0x2cf198[_0x43df('0x40')]);_0xd81944['attributes']=_[_0x43df('0x43')](_0x2cf198[_0x43df('0x3f')],qs['fields'](_0x391167['query']['fields']));_0xd81944['attributes']=_0xd81944[_0x43df('0x44')][_0x43df('0x46')]?_0xd81944['attributes']:_0x2cf198['model'];if(_0x391167['query'][_0x43df('0x51')]){_0xd81944[_0x43df('0x56')]=[{'all':!![]}];}_0xd81944=_[_0x43df('0x4e')]({},_0xd81944,_0x391167['options']);return db[_0x43df('0x3d')]['find'](_0xd81944)[_0x43df('0x33')](handleEntityNotFound(_0x11e996,null))['then'](respondWithResult(_0x11e996,null))['catch'](handleError(_0x11e996,null));};exports['create']=function(_0x1fffe5,_0x132e6e){return db['OpenchannelAccount'][_0x43df('0x57')](_0x1fffe5['body'],{})[_0x43df('0x33')](function(_0x3da222){var _0x5f32b7=_0x1fffe5[_0x43df('0x58')][_0x43df('0x59')]({'plain':!![]});if(!_0x5f32b7)throw new Error(_0x43df('0x5a'));if(_0x5f32b7[_0x43df('0x5b')]==='user'){var _0x13353f=_0x3da222[_0x43df('0x59')]({'plain':!![]});var _0x3bacf6=_0x43df('0x35');return db[_0x43df('0x5c')][_0x43df('0x5d')]({'where':{'name':_0x3bacf6,'userProfileId':_0x5f32b7[_0x43df('0x5e')]},'raw':!![]})[_0x43df('0x33')](function(_0x188bd3){if(_0x188bd3&&_0x188bd3[_0x43df('0x5f')]===0x0){return db[_0x43df('0x36')][_0x43df('0x57')]({'name':_0x13353f[_0x43df('0x37')],'resourceId':_0x13353f['id'],'type':_0x188bd3[_0x43df('0x37')],'sectionId':_0x188bd3['id']},{})['then'](function(){return _0x3da222;});}else{return _0x3da222;}})['catch'](function(_0x1f9634){logger['error'](_0x43df('0x60'),_0x1f9634);throw _0x1f9634;});}return _0x3da222;})['then'](respondWithResult(_0x132e6e,0xc9))['catch'](handleError(_0x132e6e,null));};exports[_0x43df('0x61')]=function(_0x3c9acc,_0x1829e9){if(_0x3c9acc[_0x43df('0x62')]['id']){delete _0x3c9acc[_0x43df('0x62')]['id'];}return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x3c9acc[_0x43df('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x43df('0x3b')}]})[_0x43df('0x33')](handleEntityNotFound(_0x1829e9,null))['then'](saveUpdates(_0x3c9acc[_0x43df('0x62')],null))[_0x43df('0x33')](respondWithResult(_0x1829e9,null))[_0x43df('0x25')](handleError(_0x1829e9,null));};exports[_0x43df('0x34')]=function(_0x3239f8,_0x4c3b8d){return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x3239f8[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x4c3b8d,null))[_0x43df('0x33')](removeEntity(_0x4c3b8d,null))[_0x43df('0x25')](handleError(_0x4c3b8d,null));};exports[_0x43df('0x63')]=function(_0x39bc1c,_0x3cbe86){return db[_0x43df('0x3d')][_0x43df('0x63')]()[_0x43df('0x33')](respondWithResult(_0x3cbe86,null))[_0x43df('0x25')](handleError(_0x3cbe86,null));};exports[_0x43df('0x64')]=function(_0x1ce48d,_0x37ba4d,_0x40dfbb){if(_0x1ce48d[_0x43df('0x62')]['id']){delete _0x1ce48d[_0x43df('0x62')]['id'];}return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x1ce48d['params']['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x37ba4d,null))[_0x43df('0x33')](function(_0x3ae765){if(_0x3ae765){_0x1ce48d['body'][_0x43df('0x65')]=_0x3ae765['id'];return db[_0x43df('0x66')][_0x43df('0x57')](_0x1ce48d[_0x43df('0x62')]);}})['then'](respondWithResult(_0x37ba4d,null))[_0x43df('0x25')](handleError(_0x37ba4d,null));};exports[_0x43df('0x67')]=function(_0x24b931,_0x4dfd99,_0x5876ff){var _0x3ac4a7={'raw':![],'where':{}};var _0x58a47a={};var _0x4f05c3={'count':0x0,'rows':[]};return db[_0x43df('0x3d')]['findOne']({'where':{'id':_0x24b931[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x4dfd99,null))[_0x43df('0x33')](function(_0x57bce6){if(_0x57bce6){_0x58a47a[_0x43df('0x3f')]=_[_0x43df('0x41')](db[_0x43df('0x66')][_0x43df('0x55')]);_0x58a47a[_0x43df('0x40')]=_[_0x43df('0x41')](_0x24b931[_0x43df('0x40')]);_0x58a47a[_0x43df('0x42')]=_['intersection'](_0x58a47a[_0x43df('0x3f')],_0x58a47a[_0x43df('0x40')]);_0x3ac4a7[_0x43df('0x44')]=_[_0x43df('0x43')](_0x58a47a[_0x43df('0x3f')],qs[_0x43df('0x45')](_0x24b931[_0x43df('0x40')][_0x43df('0x45')]));_0x3ac4a7[_0x43df('0x44')]=_0x3ac4a7[_0x43df('0x44')][_0x43df('0x46')]?_0x3ac4a7['attributes']:_0x58a47a['model'];if(!_0x24b931['query'][_0x43df('0x47')](_0x43df('0x48'))){_0x3ac4a7[_0x43df('0x2d')]=qs[_0x43df('0x2d')](_0x24b931['query'][_0x43df('0x2d')]);_0x3ac4a7[_0x43df('0x2a')]=qs['offset'](_0x24b931[_0x43df('0x40')]['offset']);}_0x3ac4a7['order']=qs[_0x43df('0x4a')](_0x24b931[_0x43df('0x40')][_0x43df('0x4a')]);_0x3ac4a7[_0x43df('0x4b')]=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x24b931[_0x43df('0x40')],_0x58a47a[_0x43df('0x42')]));_0x3ac4a7[_0x43df('0x4b')][_0x43df('0x65')]=_0x57bce6['id'];if(_0x24b931[_0x43df('0x40')][_0x43df('0x4d')]){_0x3ac4a7[_0x43df('0x4b')]=_[_0x43df('0x4e')](_0x3ac4a7[_0x43df('0x4b')],{'$or':_[_0x43df('0x3c')](_0x3ac4a7['attributes'],function(_0x42d01f){var _0x254a12={};_0x254a12[_0x42d01f]={'$like':'%'+_0x24b931[_0x43df('0x40')][_0x43df('0x4d')]+'%'};return _0x254a12;})});}_0x3ac4a7=_[_0x43df('0x4e')]({},_0x3ac4a7,_0x24b931[_0x43df('0x50')]);return db[_0x43df('0x66')][_0x43df('0x2c')]({'where':_0x3ac4a7[_0x43df('0x4b')]})[_0x43df('0x33')](function(_0x15a602){_0x4f05c3[_0x43df('0x2c')]=_0x15a602;if(_0x24b931[_0x43df('0x40')][_0x43df('0x51')]){_0x3ac4a7['include']=[{'all':!![]}];}return db[_0x43df('0x66')][_0x43df('0x52')](_0x3ac4a7);})[_0x43df('0x33')](function(_0x417fe5){_0x4f05c3['rows']=_0x417fe5;return _0x4f05c3;});}})[_0x43df('0x33')](respondWithFilteredResult(_0x4dfd99,_0x3ac4a7))[_0x43df('0x25')](handleError(_0x4dfd99,null));};exports[_0x43df('0x68')]=function(_0x27db1d,_0x22b04c,_0x4c36e6){return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x27db1d[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x22b04c,null))[_0x43df('0x33')](function(_0x810298){if(_0x810298){return _0x810298[_0x43df('0x68')](_0x27db1d['query'][_0x43df('0x69')]);}})['then'](respondWithStatusCode(_0x22b04c,null))[_0x43df('0x25')](handleError(_0x22b04c,null));};exports[_0x43df('0x6a')]=function(_0x26b473,_0x1cf089,_0x3e0930){if(_0x26b473[_0x43df('0x62')]['id']){delete _0x26b473['body']['id'];}return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x26b473[_0x43df('0x54')]['id']}})['then'](handleEntityNotFound(_0x1cf089,null))[_0x43df('0x33')](function(_0x393faa){if(_0x393faa){_0x26b473[_0x43df('0x62')][_0x43df('0x65')]=_0x393faa['id'];return db[_0x43df('0x6b')][_0x43df('0x57')](_0x26b473[_0x43df('0x62')]);}})['then'](respondWithResult(_0x1cf089,null))[_0x43df('0x25')](handleError(_0x1cf089,null));};exports['getAnswers']=function(_0x4feb8a,_0x38d0f4,_0x1eaeb2){var _0x5ca22f={'raw':![],'where':{}};var _0x52413c={};var _0x102408={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4feb8a[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x38d0f4,null))[_0x43df('0x33')](function(_0x237b80){if(_0x237b80){_0x52413c['model']=_['keys'](db[_0x43df('0x6b')][_0x43df('0x55')]);_0x52413c['query']=_['keys'](_0x4feb8a[_0x43df('0x40')]);_0x52413c['filters']=_['intersection'](_0x52413c[_0x43df('0x3f')],_0x52413c[_0x43df('0x40')]);_0x5ca22f[_0x43df('0x44')]=_['intersection'](_0x52413c[_0x43df('0x3f')],qs[_0x43df('0x45')](_0x4feb8a[_0x43df('0x40')][_0x43df('0x45')]));_0x5ca22f[_0x43df('0x44')]=_0x5ca22f[_0x43df('0x44')][_0x43df('0x46')]?_0x5ca22f['attributes']:_0x52413c['model'];if(!_0x4feb8a[_0x43df('0x40')][_0x43df('0x47')](_0x43df('0x48'))){_0x5ca22f[_0x43df('0x2d')]=qs[_0x43df('0x2d')](_0x4feb8a[_0x43df('0x40')][_0x43df('0x2d')]);_0x5ca22f['offset']=qs['offset'](_0x4feb8a[_0x43df('0x40')][_0x43df('0x2a')]);}_0x5ca22f[_0x43df('0x49')]=qs['sort'](_0x4feb8a[_0x43df('0x40')][_0x43df('0x4a')]);_0x5ca22f[_0x43df('0x4b')]=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x4feb8a['query'],_0x52413c[_0x43df('0x42')]));_0x5ca22f[_0x43df('0x4b')][_0x43df('0x65')]=_0x237b80['id'];if(_0x4feb8a[_0x43df('0x40')][_0x43df('0x4d')]){_0x5ca22f[_0x43df('0x4b')]=_[_0x43df('0x4e')](_0x5ca22f[_0x43df('0x4b')],{'$or':_[_0x43df('0x3c')](_0x5ca22f[_0x43df('0x44')],function(_0x3f73f1){var _0x12cfcf={};_0x12cfcf[_0x3f73f1]={'$like':'%'+_0x4feb8a[_0x43df('0x40')][_0x43df('0x4d')]+'%'};return _0x12cfcf;})});}_0x5ca22f=_[_0x43df('0x4e')]({},_0x5ca22f,_0x4feb8a[_0x43df('0x50')]);return db[_0x43df('0x6b')][_0x43df('0x2c')]({'where':_0x5ca22f[_0x43df('0x4b')]})[_0x43df('0x33')](function(_0x236b6a){_0x102408[_0x43df('0x2c')]=_0x236b6a;if(_0x4feb8a[_0x43df('0x40')][_0x43df('0x51')]){_0x5ca22f[_0x43df('0x56')]=[{'all':!![]}];}return db[_0x43df('0x6b')][_0x43df('0x52')](_0x5ca22f);})['then'](function(_0x4a1316){_0x102408['rows']=_0x4a1316;return _0x102408;});}})[_0x43df('0x33')](respondWithFilteredResult(_0x38d0f4,_0x5ca22f))[_0x43df('0x25')](handleError(_0x38d0f4,null));};exports[_0x43df('0x6c')]=function(_0x4de6df,_0x2c60cb,_0x5e8479){return db[_0x43df('0x3d')]['find']({'where':{'id':_0x4de6df[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x2c60cb,null))[_0x43df('0x33')](function(_0x253803){if(_0x253803){return _0x253803['removeAnswers'](_0x4de6df[_0x43df('0x40')][_0x43df('0x69')]);}})[_0x43df('0x33')](respondWithStatusCode(_0x2c60cb,null))['catch'](handleError(_0x2c60cb,null));};exports[_0x43df('0x6d')]=function(_0x45b4ce,_0x456046,_0x4c705f){var _0x183528={'body':_0x45b4ce[_0x43df('0x62')],'channel':'openchannel'};var _0xcabb12=[];var _0x4172da=[];var _0x109024={};var _0x5edf70=![];return db[_0x43df('0x6e')][_0x43df('0x63')]()['then'](function(_0x3a5501){if(!_0x3a5501){throw new db[(_0x43df('0x6f'))]['ValidationError'](_0x43df('0x70'));}_0xcabb12=_[_0x43df('0x71')](_['keys'](_0x3a5501),[_0x43df('0x72'),_0x43df('0x73')]);_0x4172da=_[_0x43df('0x71')](_['keys'](_0x3a5501),[_0x43df('0x72'),_0x43df('0x73'),_0x43df('0x74'),_0x43df('0x75')]);if(_0x45b4ce[_0x43df('0x62')]['id']){delete _0x45b4ce[_0x43df('0x62')]['id'];}if(_[_0x43df('0x76')](_0x45b4ce['body'][_0x43df('0x77')])){throw new db['Sequelize'][(_0x43df('0x78'))]('from\x20is\x20mandatory');}if(_[_0x43df('0x76')](_0x45b4ce[_0x43df('0x62')]['body'])||_0x45b4ce[_0x43df('0x62')]['body']===''){throw new db[(_0x43df('0x6f'))][(_0x43df('0x78'))](_0x43df('0x79'));}if(_[_0x43df('0x76')](_0x45b4ce[_0x43df('0x62')]['mapKey'])){throw new db[(_0x43df('0x6f'))][(_0x43df('0x78'))](_0x43df('0x7a')+_0x4172da);}if(!_[_0x43df('0x7b')](_0x4172da,_0x45b4ce[_0x43df('0x62')][_0x43df('0x7c')])){throw new db['Sequelize'][(_0x43df('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4172da);}_0x109024[_0x45b4ce[_0x43df('0x62')]['mapKey']]=_0x45b4ce[_0x43df('0x62')][_0x43df('0x77')];})[_0x43df('0x33')](function(){return db['OpenchannelAccount'][_0x43df('0x5d')]({'where':{'id':_0x45b4ce[_0x43df('0x54')]['id']},'include':[{'model':db[_0x43df('0x7d')],'as':_0x43df('0x7e'),'include':[{'model':db[_0x43df('0x6e')],'as':_0x43df('0x7f'),'where':_0x109024,'limit':0x1,'order':[['updatedAt',_0x43df('0x80')]]}]},{'model':db[_0x43df('0x81')],'as':_0x43df('0x82')}]});})[_0x43df('0x33')](handleEntityNotFound(_0x456046,null))[_0x43df('0x33')](function(_0x4f9cdb){if(_0x4f9cdb&&_0x4f9cdb[_0x43df('0x7e')]){_0x183528[_0x43df('0x83')]=_0x4f9cdb;_0x183528[_0x43df('0x84')]=_0x4f9cdb[_0x43df('0x82')];_0x183528[_0x43df('0x85')]=_0x4f9cdb['List'];_0x183528[_0x43df('0x84')]=_[_0x43df('0x86')](_0x183528['applications'],[_0x43df('0x87')],['asc']);if(_0x183528[_0x43df('0x83')][_0x43df('0x82')]){delete _0x183528[_0x43df('0x83')][_0x43df('0x82')];}if(_0x183528['account'][_0x43df('0x7e')]&&_0x183528[_0x43df('0x83')]['List']['Contacts']['length']){return _0x183528[_0x43df('0x83')][_0x43df('0x7e')][_0x43df('0x7f')][0x0];}var _0x1b482c=_[_0x43df('0x88')](_0x45b4ce['body'],{'firstName':_0x45b4ce['body'][_0x43df('0x77')],'ListId':_0x4f9cdb[_0x43df('0x75')]});_0x1b482c[_0x45b4ce[_0x43df('0x62')]['mapKey']]=_0x45b4ce[_0x43df('0x62')][_0x43df('0x77')];return db[_0x43df('0x6e')][_0x43df('0x57')](_0x1b482c,{'fields':_0xcabb12,'raw':!![]});}})[_0x43df('0x33')](handleEntityNotFound(_0x456046,null))[_0x43df('0x33')](function(_0x4d8445){_0x183528[_0x43df('0x89')]=_0x4d8445;if(_0x4d8445){var _0x532566={'ContactId':_0x4d8445['id'],'OpenchannelAccountId':_0x45b4ce[_0x43df('0x54')]['id'],'from':(_0x4d8445[_0x43df('0x8a')]||'')+'\x20'+(_0x4d8445[_0x43df('0x8b')]||'')};var _0x3334ad={'OpenchannelAccountId':_0x45b4ce[_0x43df('0x54')]['id'],'closed':![]};if(_0x45b4ce['body'][_0x43df('0x8c')]){_0x3334ad['threadId']=_0x45b4ce[_0x43df('0x62')]['threadId'];return db[_0x43df('0x8d')][_0x43df('0x5d')]({'where':_0x3334ad})[_0x43df('0x33')](function(_0x19072c){if(_0x19072c){return[_0x19072c,![]];}_0x532566[_0x43df('0x8c')]=_0x45b4ce['body'][_0x43df('0x8c')];_0x532566[_0x43df('0x8e')]=_0x45b4ce[_0x43df('0x62')][_0x43df('0x8e')];return db[_0x43df('0x8d')][_0x43df('0x57')](_0x532566)['then'](function(_0x580d5a){return[_0x580d5a,!![]];});});}else{_0x3334ad['threadId']=null;}_0x3334ad[_0x43df('0x8f')]=_0x4d8445['id'];return db[_0x43df('0x8d')]['find']({'where':_0x3334ad})[_0x43df('0x33')](function(_0x26041c){if(_0x26041c){return[_0x26041c,![]];}return db['OpenchannelInteraction'][_0x43df('0x57')](_0x532566)['then'](function(_0x585dcb){return[_0x585dcb,!![]];});});}})[_0x43df('0x90')](function(_0x39a0cc,_0x590874){if(_0x39a0cc){_0x5edf70=_0x590874;if(!_0x590874){var _0x4e409f={'from':(_0x183528[_0x43df('0x89')][_0x43df('0x8a')]||'')+'\x20'+(_0x183528[_0x43df('0x89')][_0x43df('0x8b')]||'')};if(_0x45b4ce[_0x43df('0x62')][_0x43df('0x8c')]&&_0x45b4ce[_0x43df('0x62')]['messageId']&&_0x45b4ce[_0x43df('0x62')][_0x43df('0x8c')]!=_0x45b4ce['body']['messageId']){_0x4e409f[_0x43df('0x8c')]=_0x45b4ce['body'][_0x43df('0x91')];}return _0x39a0cc['update'](_0x4e409f);}else{return _0x39a0cc;}}})[_0x43df('0x33')](function(_0x59679e){_0x183528['interaction']=_0x59679e['get']({'plain':!![]});_0x183528[_0x43df('0x92')][_0x43df('0x93')]=_0x5edf70;if(_0x183528[_0x43df('0x92')]['created']){if(_0x183528[_0x43df('0x83')]['autoclose']){_0x183528[_0x43df('0x84')][_0x43df('0x94')]({'id':0x0,'priority':_0x183528[_0x43df('0x84')][_0x43df('0x46')]+0x1,'app':_0x43df('0x95'),'appdata':_0x43df('0x96'),'interval':'*,*,*,*'});}}return db[_0x43df('0x97')][_0x43df('0x57')]({'body':_0x45b4ce[_0x43df('0x62')]['body'],'OpenchannelAccountId':_0x45b4ce[_0x43df('0x54')]['id'],'OpenchannelInteractionId':_0x59679e['id'],'direction':'in','ContactId':_0x183528[_0x43df('0x89')]['id'],'AttachmentId':_0x45b4ce['body'][_0x43df('0x98')]});})['then'](function(_0x339329){_0x183528[_0x43df('0x24')]=_0x339329;if(_0x183528['interaction'][_0x43df('0x99')]){return db['User'][_0x43df('0x5d')]({'attributes':['id',_0x43df('0x37')],'where':{'id':_0x183528[_0x43df('0x92')][_0x43df('0x99')]}})[_0x43df('0x33')](function(_0x2f235d){if(_0x2f235d){_0x183528[_0x43df('0x84')][_0x43df('0x9a')]({'id':0x0,'priority':0x0,'app':_0x43df('0x9b'),'appdata':_0x2f235d[_0x43df('0x37')]+','+(_0x183528[_0x43df('0x83')][_0x43df('0x9c')]||0xa),'interval':_0x43df('0x9d')});_0x183528['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x43df('0x9e'),_0x183528);});}return respondWithRpcPromise('Start','startRouting',_0x183528);})['then'](function(_0x2b59a3){respondWithRpcPromise(_0x43df('0x9f'),_0x43df('0x9f'),{'event':_0x43df('0x6d'),'message':_0x2b59a3},client9002);return _0x2b59a3;})['then'](respondWithResult(_0x456046,null))['catch'](handleError(_0x456046,null));};exports['addApplications']=function(_0x4f7c9a,_0x2130fe){var _0x2b1def=_0x4f7c9a[_0x43df('0x54')]['id'];var _0x2328ae=_0x4f7c9a['body'];var _0x322316=0xc8;var _0x252275=null;return db[_0x43df('0xa0')][_0x43df('0xa1')]({'isolationLevel':db[_0x43df('0xa0')][_0x43df('0xa2')][_0x43df('0xa3')]['READ_COMMITTED']},function(_0x1c7ffe){return db[_0x43df('0x3d')][_0x43df('0xa4')]({'where':{'id':_0x2b1def},'transaction':_0x1c7ffe})['then'](function(_0x2e4525){if(_0x2e4525){return db['OpenchannelApplication'][_0x43df('0x34')]({'where':{'OpenchannelAccountId':_0x2b1def},'transaction':_0x1c7ffe})[_0x43df('0x33')](function(){var _0x145a86=_[_0x43df('0x3c')](_0x2328ae,function(_0x3d2e61){_0x3d2e61[_0x43df('0x65')]=_0x2b1def;return _0x3d2e61;});return db[_0x43df('0x81')][_0x43df('0xa5')](_0x145a86,{'transaction':_0x1c7ffe});});}else{_0x322316=0x194;_0x252275=[];}});})[_0x43df('0x33')](function(){if(_0x322316!==0x194){return db['OpenchannelApplication'][_0x43df('0xa6')]({'where':{'OpenchannelAccountId':_0x2b1def},'order':_0x43df('0x87')})[_0x43df('0x33')](function(_0x1d23e5){_0x252275=_0x1d23e5;});}})['catch'](function(_0x51fd1a){_0x322316=0x1f4;logger[_0x43df('0x23')](_0x51fd1a[_0x43df('0xa7')]);if(_0x51fd1a[_0x43df('0x37')]){delete _0x51fd1a[_0x43df('0x37')];}_0x252275=_0x51fd1a;})[_0x43df('0xa8')](function(){if(_0x252275===null){_0x2130fe[_0x43df('0x26')](_0x322316);}else{if(_0x322316===0x1f4){_0x2130fe[_0x43df('0x27')](_0x322316)[_0x43df('0x38')](_0x252275);}else{_0x2130fe[_0x43df('0x27')](_0x322316)['json'](_0x252275);}}});};exports[_0x43df('0xa9')]=function(_0x518696,_0x2b1c08,_0x1dcc1d){var _0x304459={};var _0x9a2db1={};var _0x3b0cd6;var _0x71661a;return db[_0x43df('0x3d')]['findOne']({'where':{'id':_0x518696['params']['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x2b1c08,null))['then'](function(_0x5c97be){if(_0x5c97be){_0x3b0cd6=_0x5c97be;_0x9a2db1[_0x43df('0x3f')]=_[_0x43df('0x41')](db[_0x43df('0x81')][_0x43df('0x55')]);_0x9a2db1['query']=_['keys'](_0x518696[_0x43df('0x40')]);_0x9a2db1[_0x43df('0x42')]=_[_0x43df('0x43')](_0x9a2db1[_0x43df('0x3f')],_0x9a2db1[_0x43df('0x40')]);_0x304459[_0x43df('0x44')]=_[_0x43df('0x43')](_0x9a2db1[_0x43df('0x3f')],qs[_0x43df('0x45')](_0x518696['query'][_0x43df('0x45')]));_0x304459[_0x43df('0x44')]=_0x304459['attributes'][_0x43df('0x46')]?_0x304459['attributes']:_0x9a2db1[_0x43df('0x3f')];_0x304459[_0x43df('0x49')]=qs[_0x43df('0x4a')](_0x518696[_0x43df('0x40')][_0x43df('0x4a')]);_0x304459[_0x43df('0x4b')]=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x518696[_0x43df('0x40')],_0x9a2db1['filters']));if(_0x518696[_0x43df('0x40')][_0x43df('0x4d')]){_0x304459['where']=_[_0x43df('0x4e')](_0x304459[_0x43df('0x4b')],{'$or':_[_0x43df('0x3c')](_0x304459[_0x43df('0x44')],function(_0x3e8c06){var _0x200f6e={};_0x200f6e[_0x3e8c06]={'$like':'%'+_0x518696['query'][_0x43df('0x4d')]+'%'};return _0x200f6e;})});}_0x304459=_['merge']({},_0x304459,_0x518696['options']);return _0x3b0cd6[_0x43df('0xa9')](_0x304459);}})[_0x43df('0x33')](function(_0xb64079){if(_0xb64079){_0x71661a=_0xb64079[_0x43df('0x46')];if(!_0x518696[_0x43df('0x40')]['hasOwnProperty'](_0x43df('0x48'))){_0x304459[_0x43df('0x2d')]=qs[_0x43df('0x2d')](_0x518696[_0x43df('0x40')][_0x43df('0x2d')]);_0x304459[_0x43df('0x2a')]=qs[_0x43df('0x2a')](_0x518696[_0x43df('0x40')][_0x43df('0x2a')]);}return _0x3b0cd6[_0x43df('0xa9')](_0x304459);}})['then'](function(_0x5bb877){if(_0x5bb877){return _0x5bb877?{'count':_0x71661a,'rows':_0x5bb877}:null;}})[_0x43df('0x33')](respondWithResult(_0x2b1c08,null))[_0x43df('0x25')](handleError(_0x2b1c08,null));};exports[_0x43df('0xaa')]=function(_0x1c4628,_0x19c4a0,_0x1f708e){var _0x3f09ba={'raw':![],'where':{}};var _0x4ecacc={};var _0x4f3538={'count':0x0,'rows':[]};return db[_0x43df('0x3d')]['findOne']({'where':{'id':_0x1c4628[_0x43df('0x54')]['id']}})['then'](handleEntityNotFound(_0x19c4a0,null))[_0x43df('0x33')](function(_0x24d28){if(_0x24d28){_0x4ecacc['model']=_[_0x43df('0x41')](db[_0x43df('0x8d')][_0x43df('0x55')]);_0x4ecacc['query']=_[_0x43df('0x41')](_0x1c4628[_0x43df('0x40')]);_0x4ecacc['filters']=_['intersection'](_0x4ecacc[_0x43df('0x3f')],_0x4ecacc[_0x43df('0x40')]);_0x3f09ba[_0x43df('0x44')]=_[_0x43df('0x43')](_0x4ecacc[_0x43df('0x3f')],qs['fields'](_0x1c4628[_0x43df('0x40')][_0x43df('0x45')]));_0x3f09ba[_0x43df('0x44')]=_0x3f09ba['attributes'][_0x43df('0x46')]?_0x3f09ba['attributes']:_0x4ecacc[_0x43df('0x3f')];if(!_0x1c4628[_0x43df('0x40')]['hasOwnProperty'](_0x43df('0x48'))){_0x3f09ba[_0x43df('0x2d')]=qs[_0x43df('0x2d')](_0x1c4628[_0x43df('0x40')][_0x43df('0x2d')]);_0x3f09ba[_0x43df('0x2a')]=qs[_0x43df('0x2a')](_0x1c4628['query'][_0x43df('0x2a')]);}_0x3f09ba[_0x43df('0x49')]=qs[_0x43df('0x4a')](_0x1c4628['query'][_0x43df('0x4a')]);_0x3f09ba['where']=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x1c4628[_0x43df('0x40')],_0x4ecacc[_0x43df('0x42')]));_0x3f09ba['where'][_0x43df('0x65')]=_0x24d28['id'];if(_0x1c4628[_0x43df('0x40')]['filter']){_0x3f09ba[_0x43df('0x4b')]=_[_0x43df('0x4e')](_0x3f09ba['where'],{'$or':_[_0x43df('0x3c')](_0x3f09ba[_0x43df('0x44')],function(_0x33a863){var _0x1f960d={};_0x1f960d[_0x33a863]={'$like':'%'+_0x1c4628[_0x43df('0x40')][_0x43df('0x4d')]+'%'};return _0x1f960d;})});}_0x3f09ba=_[_0x43df('0x4e')]({},_0x3f09ba,_0x1c4628[_0x43df('0x50')]);return db[_0x43df('0x8d')][_0x43df('0x2c')]({'where':_0x3f09ba['where']})[_0x43df('0x33')](function(_0x35689a){_0x4f3538[_0x43df('0x2c')]=_0x35689a;if(_0x1c4628[_0x43df('0x40')]['includeAll']){_0x3f09ba['include']=[{'model':db[_0x43df('0x6e')],'as':'Contact','required':![]},{'model':db[_0x43df('0xab')],'as':_0x43df('0xac'),'attributes':['name',_0x43df('0xad'),'internal'],'required':![]},{'model':db[_0x43df('0xae')],'as':'Tags','attributes':['id',_0x43df('0x37'),'color'],'where':_0x1c4628[_0x43df('0x40')]['tag']?{'id':_0x1c4628['query'][_0x43df('0xaf')]}:undefined,'required':_0x1c4628[_0x43df('0x40')][_0x43df('0xaf')]?!![]:![]}];}return db[_0x43df('0x8d')][_0x43df('0x52')](_0x3f09ba);})['then'](function(_0x9389ae){_0x4f3538[_0x43df('0xb0')]=_0x9389ae;return _0x4f3538;});}})[_0x43df('0x33')](respondWithFilteredResult(_0x19c4a0,_0x3f09ba))[_0x43df('0x25')](handleError(_0x19c4a0,null));};exports[_0x43df('0xb1')]=function(_0x3883d6,_0x5f8872,_0x442c1d){return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x3883d6['params']['id']}})['then'](handleEntityNotFound(_0x5f8872,null))[_0x43df('0x33')](function(_0xaeb003){if(_0xaeb003){return _0xaeb003['addAgents'](_0x3883d6[_0x43df('0x62')][_0x43df('0x69')],_[_0x43df('0xb2')](_0x3883d6[_0x43df('0x62')],[_0x43df('0x69'),'id'])||{})[_0x43df('0x90')](function(_0x5c8201){for(var _0xdba81c=0x0;_0xdba81c<_0x3883d6[_0x43df('0x62')][_0x43df('0x69')][_0x43df('0x46')];_0xdba81c+=0x1){socket['emit'](_0x43df('0xb3'),{'UserId':Number(_0x3883d6[_0x43df('0x62')]['ids'][_0xdba81c]),'OpenchannelAccountId':Number(_0x3883d6['params']['id'])});}return _0x5c8201;});}})['then'](respondWithResult(_0x5f8872,null))[_0x43df('0x25')](handleError(_0x5f8872,null));};exports[_0x43df('0xb4')]=function(_0x183681,_0x428604,_0x47e56a){return db['OpenchannelAccount'][_0x43df('0x5d')]({'where':{'id':_0x183681[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x428604,null))[_0x43df('0x33')](function(_0x59caf6){if(_0x59caf6){return _0x59caf6[_0x43df('0xb4')](_0x183681[_0x43df('0x40')][_0x43df('0x69')])[_0x43df('0x33')](function(){if(_[_0x43df('0xb5')](_0x183681[_0x43df('0x40')]['ids'])){for(var _0x3fac64=0x0;_0x3fac64<_0x183681[_0x43df('0x40')][_0x43df('0x69')][_0x43df('0x46')];_0x3fac64+=0x1){socket[_0x43df('0xb6')](_0x43df('0xb7'),{'UserId':Number(_0x183681[_0x43df('0x40')][_0x43df('0x69')][_0x3fac64]),'OpenchannelAccountId':Number(_0x183681[_0x43df('0x54')]['id'])});}}else{socket[_0x43df('0xb6')](_0x43df('0xb7'),{'UserId':Number(_0x183681['query'][_0x43df('0x69')]),'OpenchannelAccountId':Number(_0x183681[_0x43df('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x428604,null))[_0x43df('0x25')](handleError(_0x428604,null));};exports[_0x43df('0xb8')]=function(_0x58f4b7,_0x3f2dc1,_0x5b1131){var _0x43eaa5={};var _0x303c67={};var _0x551114;var _0x3c7298;return db[_0x43df('0x3d')][_0x43df('0xa4')]({'where':{'id':_0x58f4b7[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x3f2dc1,null))['then'](function(_0xfcc1da){if(_0xfcc1da){_0x551114=_0xfcc1da;_0x303c67['model']=_[_0x43df('0x41')](db[_0x43df('0xab')][_0x43df('0x55')]);_0x303c67[_0x43df('0x40')]=_[_0x43df('0x41')](_0x58f4b7[_0x43df('0x40')]);_0x303c67[_0x43df('0x42')]=_[_0x43df('0x43')](_0x303c67[_0x43df('0x3f')],_0x303c67[_0x43df('0x40')]);_0x43eaa5[_0x43df('0x44')]=_['intersection'](_0x303c67[_0x43df('0x3f')],qs['fields'](_0x58f4b7[_0x43df('0x40')]['fields']));_0x43eaa5[_0x43df('0x44')]=_0x43eaa5[_0x43df('0x44')][_0x43df('0x46')]?_0x43eaa5['attributes']:_0x303c67['model'];_0x43eaa5[_0x43df('0x49')]=qs[_0x43df('0x4a')](_0x58f4b7[_0x43df('0x40')]['sort']);_0x43eaa5[_0x43df('0x4b')]=qs[_0x43df('0x42')](_[_0x43df('0x4c')](_0x58f4b7['query'],_0x303c67[_0x43df('0x42')]));if(_0x58f4b7[_0x43df('0x40')][_0x43df('0x4d')]){_0x43eaa5[_0x43df('0x4b')]=_[_0x43df('0x4e')](_0x43eaa5['where'],{'$or':_[_0x43df('0x3c')](_0x43eaa5['attributes'],function(_0x17bf12){var _0x66a193={};_0x66a193[_0x17bf12]={'$like':'%'+_0x58f4b7[_0x43df('0x40')][_0x43df('0x4d')]+'%'};return _0x66a193;})});}_0x43eaa5=_['merge']({},_0x43eaa5,_0x58f4b7[_0x43df('0x50')]);return _0x551114[_0x43df('0xb8')](_0x43eaa5);}})[_0x43df('0x33')](function(_0x111964){if(_0x111964){_0x3c7298=_0x111964[_0x43df('0x46')];if(!_0x58f4b7[_0x43df('0x40')][_0x43df('0x47')](_0x43df('0x48'))){_0x43eaa5['limit']=qs['limit'](_0x58f4b7[_0x43df('0x40')]['limit']);_0x43eaa5[_0x43df('0x2a')]=qs[_0x43df('0x2a')](_0x58f4b7['query']['offset']);}return _0x551114['getAgents'](_0x43eaa5);}})['then'](function(_0x4c7d6f){if(_0x4c7d6f){return _0x4c7d6f?{'count':_0x3c7298,'rows':_0x4c7d6f}:null;}})[_0x43df('0x33')](respondWithResult(_0x3f2dc1,null))[_0x43df('0x25')](handleError(_0x3f2dc1,null));};exports[_0x43df('0x38')]=function(_0x237b43,_0x13b040,_0x5df302){var _0x473779,_0x20cd9a,_0x102496;if(_['isNil'](_0x237b43[_0x43df('0x62')][_0x43df('0x62')])||_0x237b43['body'][_0x43df('0x62')]===''){throw new db['Sequelize'][(_0x43df('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x43df('0x76')](_0x237b43[_0x43df('0x62')]['to'])){}_0x473779=_0x237b43[_0x43df('0x62')]['to'];return db['OpenchannelAccount'][_0x43df('0xa4')]({'where':{'id':_0x237b43[_0x43df('0x54')]['id']}})[_0x43df('0x33')](handleEntityNotFound(_0x13b040,null))[_0x43df('0x33')](function(_0x5accd6){if(_0x5accd6){return db[_0x43df('0x3d')][_0x43df('0x5d')]({'where':{'id':_0x5accd6['id']},'include':[{'model':db[_0x43df('0x7d')],'as':_0x43df('0x7e'),'include':[{'model':db[_0x43df('0x6e')],'as':_0x43df('0x7f'),'where':{[_0x5accd6[_0x43df('0x7c')]]:_0x473779},'limit':0x1,'order':[[_0x43df('0x73'),_0x43df('0x80')]]}]}]})[_0x43df('0x33')](handleEntityNotFound(_0x13b040,null))[_0x43df('0x33')](function(_0xde68a5){if(_0xde68a5&&_0xde68a5[_0x43df('0x7e')]){_0x20cd9a=_0xde68a5[_0x43df('0x59')]({'plain':!![]});if(_0x20cd9a[_0x43df('0x7e')]&&_0x20cd9a[_0x43df('0x7e')][_0x43df('0x7f')]['length']){return _0x20cd9a[_0x43df('0x7e')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x43df('0x88')](_0x237b43[_0x43df('0x62')],{'firstName':_0x473779,[_0xde68a5[_0x43df('0x7c')]]:_0x473779,'phone':_0x473779,'ListId':_0x20cd9a['ListId']}));}})[_0x43df('0x33')](handleEntityNotFound(_0x13b040,null))[_0x43df('0x33')](function(_0x38f366){if(_0x38f366){_0x102496=_0x38f366;return db['OpenchannelInteraction'][_0x43df('0x5d')]({'where':{'ContactId':_0x102496['id'],'closed':![],'OpenchannelAccountId':_0x20cd9a['id']}})[_0x43df('0x33')](function(_0x1a206c){if(_0x1a206c){return[_0x1a206c,![]];}return db[_0x43df('0x8d')][_0x43df('0x57')]({'UserId':_0x237b43[_0x43df('0x58')]['id'],'ContactId':_0x102496['id'],'OpenchannelAccountId':_0x20cd9a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x43df('0xb9'),'Messages':[_[_0x43df('0x4e')](_0x237b43['body'],{'read':![],'body':_0x237b43[_0x43df('0x62')][_0x43df('0x62')],'OpenchannelAccountId':_0x20cd9a['id'],'UserId':_0x237b43[_0x43df('0x58')]['id'],'ContactId':_0x102496['id']})]},{'include':[{'model':db[_0x43df('0x97')],'as':_0x43df('0xba')}]})[_0x43df('0x33')](function(_0x569c3b){return[_0x569c3b,!![]];});});}})[_0x43df('0x90')](function(_0x5c9df0,_0x2178f4){if(_0x2178f4){return _0x5c9df0;}return db[_0x43df('0x97')][_0x43df('0x57')](_['merge'](_0x237b43[_0x43df('0x62')],{'read':![],'body':_0x237b43[_0x43df('0x62')]['body'],'OpenchannelAccountId':_0x20cd9a['id'],'OpenchannelInteractionId':_0x5c9df0['id'],'UserId':_0x237b43[_0x43df('0x58')]['id'],'ContactId':_0x102496['id']}))['then'](function(_0x3cea7f){_0x5c9df0[_0x43df('0xbb')][_0x43df('0xba')]=[];_0x5c9df0[_0x43df('0xbb')]['Messages']['push'](_0x3cea7f['dataValues']);return _0x5c9df0;});});}})[_0x43df('0x33')](respondWithResult(_0x13b040,null))[_0x43df('0x25')](handleError(_0x13b040,null));};
\ No newline at end of file
index e5e1dc1..f839c92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96cc,0x16c));var _0xc96c=function(_0xd066c8,_0x46b223){_0xd066c8=_0xd066c8-0x0;var _0x369df2=_0x96cc[_0xd066c8];return _0x369df2;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x3303c5,_0x494e2b){var _0x466eb1=function(_0x2e0188){while(--_0x2e0188){_0x3303c5['push'](_0x3303c5['shift']());}};_0x466eb1(++_0x494e2b);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4b6b7c,_0x3fb4da){_0x4b6b7c=_0x4b6b7c-0x0;var _0x4bdf1c=_0xb58b[_0x4b6b7c];return _0x4bdf1c;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index d2c46db..3268d10 100644 (file)
@@ -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(_0x59731a,_0x410a57){var _0x228728=function(_0x4cb398){while(--_0x4cb398){_0x59731a['push'](_0x59731a['shift']());}};_0x228728(++_0x410a57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x11ff4f,_0x5dbf27){var _0x4324ad=function(_0x16aa7a){while(--_0x16aa7a){_0x11ff4f['push'](_0x11ff4f['shift']());}};_0x4324ad(++_0x5dbf27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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
index aec5113..bdcb13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x174b=['localhost','socket.io-emitter','./openchannelAccount.socket','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x4e8a59,_0x32bc84){var _0x22ba3e=function(_0x187e2f){while(--_0x187e2f){_0x4e8a59['push'](_0x4e8a59['shift']());}};_0x22ba3e(++_0x32bc84);}(_0x174b,0x19d));var _0xb174=function(_0x31e522,_0x5f38cd){_0x31e522=_0x31e522-0x0;var _0x5693d8=_0x174b[_0x31e522];return _0x5693d8;};'use strict';var _=require(_0xb174('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb174('0x1'));var rs=require(_0xb174('0x2'));var fs=require('fs');var Redis=require(_0xb174('0x3'));var db=require(_0xb174('0x4'))['db'];var utils=require(_0xb174('0x5'));var logger=require(_0xb174('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb174('0x7'));var client=jayson[_0xb174('0x8')][_0xb174('0x9')]({'port':0x232a});config[_0xb174('0xa')]=_[_0xb174('0xb')](config[_0xb174('0xa')],{'host':_0xb174('0xc'),'port':0x18eb});var socket=require(_0xb174('0xd'))(new Redis(config[_0xb174('0xa')]));require(_0xb174('0xe'))['register'](socket);function respondWithRpcPromise(_0x84e738,_0x4b6dd6,_0x3a05e9){return new BPromise(function(_0x1a4775,_0x4dffab){return client[_0xb174('0xf')](_0x84e738,_0x3a05e9)['then'](function(_0x3fbd28){logger[_0xb174('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));logger[_0xb174('0x12')](_0xb174('0x13'),_0x4b6dd6,_0xb174('0x11'),JSON['stringify'](_0x3fbd28));if(_0x3fbd28[_0xb174('0x14')]){if(_0x3fbd28['error'][_0xb174('0x15')]===0x1f4){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')]['message']);return _0x4dffab(_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);}logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);return _0x1a4775(_0x3fbd28['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));_0x1a4775(_0x3fbd28['result'][_0xb174('0x17')]);}})[_0xb174('0x18')](function(_0x5ac337){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x5ac337);_0x4dffab(_0x5ac337);});});}
\ No newline at end of file
+var _0x9e0d=['code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x4402a5,_0x8a27a5){_0x4402a5=_0x4402a5-0x0;var _0x681298=_0x9e0d[_0x4402a5];return _0x681298;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});config[_0xd9e0('0xb')]=_[_0xd9e0('0xc')](config[_0xd9e0('0xb')],{'host':_0xd9e0('0xd'),'port':0x18eb});var socket=require(_0xd9e0('0xe'))(new Redis(config['redis']));require(_0xd9e0('0xf'))[_0xd9e0('0x10')](socket);function respondWithRpcPromise(_0x57763b,_0x5bd6ad,_0x1fc11b){return new BPromise(function(_0x912d1e,_0x28f8be){return client['request'](_0x57763b,_0x1fc11b)[_0xd9e0('0x11')](function(_0x1f8eae){logger['info'](_0xd9e0('0x12'),_0x5bd6ad,_0xd9e0('0x13'));logger[_0xd9e0('0x14')](_0xd9e0('0x15'),_0x5bd6ad,_0xd9e0('0x13'),JSON['stringify'](_0x1f8eae));if(_0x1f8eae[_0xd9e0('0x16')]){if(_0x1f8eae['error'][_0xd9e0('0x17')]===0x1f4){logger['error'](_0xd9e0('0x12'),_0x5bd6ad,_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);return _0x28f8be(_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0x1f8eae['error'][_0xd9e0('0x18')]);return _0x912d1e(_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);}else{logger[_0xd9e0('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0xd9e0('0x13'));_0x912d1e(_0x1f8eae['result']['message']);}})[_0xd9e0('0x1a')](function(_0x30a342){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0x30a342);_0x28f8be(_0x30a342);});});}
\ No newline at end of file
index 6ae6cda..4894df1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd240=['emit','length','openchannelAccount:','save'];(function(_0x1d1b15,_0x5ef518){var _0x1801d3=function(_0x50d56e){while(--_0x50d56e){_0x1d1b15['push'](_0x1d1b15['shift']());}};_0x1801d3(++_0x5ef518);}(_0xd240,0x1c7));var _0x0d24=function(_0x577dd4,_0xb74e0e){_0x577dd4=_0x577dd4-0x0;var _0x213644=_0xd240[_0x577dd4];return _0x213644;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x0d24('0x0'),'remove','update'];function createListener(_0x1c5100,_0x58d41c){return function(_0x24493f){_0x58d41c[_0x0d24('0x1')](_0x1c5100,_0x24493f);};}function removeListener(_0x359c54,_0x3dc015){return function(){OpenchannelAccountEvents['removeListener'](_0x359c54,_0x3dc015);};}exports['register']=function(_0x30fbee){for(var _0x2accfe=0x0,_0x1005ff=events[_0x0d24('0x2')];_0x2accfe<_0x1005ff;_0x2accfe++){var _0x48fb91=events[_0x2accfe];var _0xdb2d81=createListener(_0x0d24('0x3')+_0x48fb91,_0x30fbee);OpenchannelAccountEvents['on'](_0x48fb91,_0xdb2d81);}};
\ No newline at end of file
+var _0x130d=['remove','emit','removeListener','register','length','./openchannelAccount.events'];(function(_0x290e8e,_0x5dd7c7){var _0x99a19c=function(_0x577b38){while(--_0x577b38){_0x290e8e['push'](_0x290e8e['shift']());}};_0x99a19c(++_0x5dd7c7);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xd130('0x0'));var events=['save',_0xd130('0x1'),'update'];function createListener(_0x45f869,_0x389725){return function(_0x3591d2){_0x389725[_0xd130('0x2')](_0x45f869,_0x3591d2);};}function removeListener(_0x321e49,_0x2bc19d){return function(){OpenchannelAccountEvents[_0xd130('0x3')](_0x321e49,_0x2bc19d);};}exports[_0xd130('0x4')]=function(_0x287e61){for(var _0x4689a8=0x0,_0x44c215=events[_0xd130('0x5')];_0x4689a8<_0x44c215;_0x4689a8++){var _0x3f77e1=events[_0x4689a8];var _0x1b9875=createListener('openchannelAccount:'+_0x3f77e1,_0x287e61);OpenchannelAccountEvents['on'](_0x3f77e1,_0x1b9875);}};
\ No newline at end of file
index 10bad0c..431bcad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91bf=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x30a50c,_0x3fb499){var _0x4d3daf=function(_0x2f65d8){while(--_0x2f65d8){_0x30a50c['push'](_0x30a50c['shift']());}};_0x4d3daf(++_0x3fb499);}(_0x91bf,0x8c));var _0xf91b=function(_0x244f7c,_0x14f1a9){_0x244f7c=_0x244f7c-0x0;var _0x2482e6=_0x91bf[_0x244f7c];return _0x2482e6;};'use strict';var multer=require(_0xf91b('0x0'));var util=require(_0xf91b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf91b('0x2'));var router=express[_0xf91b('0x3')]();var fs_extra=require(_0xf91b('0x4'));var auth=require(_0xf91b('0x5'));var interaction=require(_0xf91b('0x6'));var config=require(_0xf91b('0x7'));var controller=require(_0xf91b('0x8'));router['get']('/',auth[_0xf91b('0x9')](),controller[_0xf91b('0xa')]);router[_0xf91b('0xb')](_0xf91b('0xc'),auth[_0xf91b('0x9')](),controller[_0xf91b('0xd')]);router['post']('/',auth[_0xf91b('0x9')](),controller[_0xf91b('0xe')]);router[_0xf91b('0xf')]('/:id',auth[_0xf91b('0x9')](),controller[_0xf91b('0x10')]);router[_0xf91b('0x11')]('/:id',auth[_0xf91b('0x9')](),controller[_0xf91b('0x12')]);module[_0xf91b('0x13')]=router;
\ No newline at end of file
+var _0x6e46=['index','get','isAuthenticated','show','post','create','put','delete','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3eb8b3,_0x3f766c){var _0xa4f672=function(_0x409622){while(--_0x409622){_0x3eb8b3['push'](_0x3eb8b3['shift']());}};_0xa4f672(++_0x3f766c);}(_0x6e46,0xb1));var _0x66e4=function(_0x4e6230,_0xfb1bcd){_0x4e6230=_0x4e6230-0x0;var _0x169b50=_0x6e46[_0x4e6230];return _0x169b50;};'use strict';var multer=require('multer');var util=require(_0x66e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x66e4('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66e4('0x2'));var interaction=require(_0x66e4('0x3'));var config=require(_0x66e4('0x4'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x66e4('0x5')]);router[_0x66e4('0x6')]('/:id',auth[_0x66e4('0x7')](),controller[_0x66e4('0x8')]);router[_0x66e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x66e4('0xa')]);router[_0x66e4('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x66e4('0xc')]('/:id',auth[_0x66e4('0x7')](),controller['destroy']);module[_0x66e4('0xd')]=router;
\ No newline at end of file
index e72ee76..1d1e782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x536d=['noop','*,*,*,*','sequelize','STRING'];(function(_0x529102,_0x3178ab){var _0x136f27=function(_0x166154){while(--_0x166154){_0x529102['push'](_0x529102['shift']());}};_0x136f27(++_0x3178ab);}(_0x536d,0x1ae));var _0xd536=function(_0x3316b9,_0x1abe51){_0x3316b9=_0x3316b9-0x0;var _0x2477ac=_0x536d[_0x3316b9];return _0x2477ac;};'use strict';var Sequelize=require(_0xd536('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd536('0x1')],'allowNull':![],'defaultValue':_0xd536('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd536('0x1')]},'interval':{'type':Sequelize[_0xd536('0x1')],'defaultValue':_0xd536('0x3')}};
\ No newline at end of file
+var _0x9916=['exports','STRING','noop','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9916,0xbc));var _0x6991=function(_0x5b4e02,_0x54946a){_0x5b4e02=_0x5b4e02-0x0;var _0x1cb267=_0x9916[_0x5b4e02];return _0x1cb267;};'use strict';var Sequelize=require('sequelize');module[_0x6991('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6991('0x1')],'allowNull':![],'defaultValue':_0x6991('0x2')},'appdata':{'type':Sequelize[_0x6991('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6991('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 17f2035..24138bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1b9=['find','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','name','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','create','body','catch','update'];(function(_0x4d36c0,_0x16c184){var _0x4bf361=function(_0x351e64){while(--_0x351e64){_0x4d36c0['push'](_0x4d36c0['shift']());}};_0x4bf361(++_0x16c184);}(_0xe1b9,0xcd));var _0x9e1b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xe1b9[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x9e1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e1b('0x1'));var jsonpatch=require(_0x9e1b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e1b('0x3'));var Mustache=require(_0x9e1b('0x4'));var util=require(_0x9e1b('0x5'));var path=require(_0x9e1b('0x6'));var sox=require(_0x9e1b('0x7'));var csv=require(_0x9e1b('0x8'));var ejs=require(_0x9e1b('0x9'));var fs=require('fs');var fs_extra=require(_0x9e1b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e1b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9e1b('0x8'));var querystring=require(_0x9e1b('0xc'));var Papa=require('papaparse');var Redis=require(_0x9e1b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9e1b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9e1b('0xf'));var utils=require(_0x9e1b('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x9e1b('0x11'));var db=require(_0x9e1b('0x12'))['db'];function respondWithStatusCode(_0x4a33d2,_0x2e546f){_0x2e546f=_0x2e546f||0xcc;return function(_0x5f25cd){if(_0x5f25cd){return _0x4a33d2[_0x9e1b('0x13')](_0x2e546f);}return _0x4a33d2['status'](_0x2e546f)[_0x9e1b('0x14')]();};}function respondWithResult(_0x3ec3f1,_0x1692a9){_0x1692a9=_0x1692a9||0xc8;return function(_0x59f411){if(_0x59f411){return _0x3ec3f1[_0x9e1b('0x15')](_0x1692a9)[_0x9e1b('0x16')](_0x59f411);}};}function respondWithFilteredResult(_0x5a6521,_0x5ff303){return function(_0x372f40){if(_0x372f40){var _0x248f26=typeof _0x5ff303[_0x9e1b('0x17')]===_0x9e1b('0x18')&&typeof _0x5ff303[_0x9e1b('0x19')]===_0x9e1b('0x18');var _0x10d18f=_0x372f40[_0x9e1b('0x1a')];var _0x52a225=_0x248f26?0x0:_0x5ff303[_0x9e1b('0x17')];var _0x4860cf=_0x248f26?_0x372f40[_0x9e1b('0x1a')]:_0x5ff303[_0x9e1b('0x17')]+_0x5ff303['limit'];var _0x33b603;if(_0x4860cf>=_0x10d18f){_0x4860cf=_0x10d18f;_0x33b603=0xc8;}else{_0x33b603=0xce;}_0x5a6521[_0x9e1b('0x15')](_0x33b603);return _0x5a6521[_0x9e1b('0x1b')](_0x9e1b('0x1c'),_0x52a225+'-'+_0x4860cf+'/'+_0x10d18f)[_0x9e1b('0x16')](_0x372f40);}return null;};}function patchUpdates(_0x1c3b38){return function(_0x1bd45f){try{jsonpatch['apply'](_0x1bd45f,_0x1c3b38,!![]);}catch(_0x18d909){return BPromise[_0x9e1b('0x1d')](_0x18d909);}return _0x1bd45f[_0x9e1b('0x1e')]();};}function saveUpdates(_0x255c33,_0x75bdb7){return function(_0x29075a){if(_0x29075a){return _0x29075a['update'](_0x255c33)[_0x9e1b('0x1f')](function(_0xa0f2cd){return _0xa0f2cd;});}return null;};}function removeEntity(_0x2e241f,_0x34213c){return function(_0x342e7d){if(_0x342e7d){return _0x342e7d[_0x9e1b('0x20')]()['then'](function(){_0x2e241f['status'](0xcc)[_0x9e1b('0x14')]();});}};}function handleEntityNotFound(_0x58e511,_0x359c8b){return function(_0x4a37dc){if(!_0x4a37dc){_0x58e511[_0x9e1b('0x13')](0x194);}return _0x4a37dc;};}function handleError(_0x4aab87,_0x48f5c8){_0x48f5c8=_0x48f5c8||0x1f4;return function(_0x11fff6){logger[_0x9e1b('0x21')](_0x11fff6[_0x9e1b('0x22')]);if(_0x11fff6['name']){delete _0x11fff6['name'];}_0x4aab87[_0x9e1b('0x15')](_0x48f5c8)[_0x9e1b('0x23')](_0x11fff6);};}exports[_0x9e1b('0x24')]=function(_0x277cb8,_0x324e85){var _0x10e423={},_0x218daf={},_0x309e50={'count':0x0,'rows':[]};var _0x10b1ab=_[_0x9e1b('0x25')](db[_0x9e1b('0x26')][_0x9e1b('0x27')],function(_0x106414){return{'name':_0x106414[_0x9e1b('0x28')],'type':_0x106414[_0x9e1b('0x29')]['key']};});_0x218daf['model']=_[_0x9e1b('0x25')](_0x10b1ab,_0x9e1b('0x2a'));_0x218daf['query']=_[_0x9e1b('0x2b')](_0x277cb8[_0x9e1b('0x2c')]);_0x218daf[_0x9e1b('0x2d')]=_[_0x9e1b('0x2e')](_0x218daf[_0x9e1b('0x2f')],_0x218daf['query']);_0x10e423['attributes']=_[_0x9e1b('0x2e')](_0x218daf['model'],qs[_0x9e1b('0x30')](_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x30')]));_0x10e423[_0x9e1b('0x31')]=_0x10e423[_0x9e1b('0x31')][_0x9e1b('0x32')]?_0x10e423[_0x9e1b('0x31')]:_0x218daf[_0x9e1b('0x2f')];if(!_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x33')]('nolimit')){_0x10e423[_0x9e1b('0x19')]=qs[_0x9e1b('0x19')](_0x277cb8['query'][_0x9e1b('0x19')]);_0x10e423[_0x9e1b('0x17')]=qs[_0x9e1b('0x17')](_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x17')]);}_0x10e423['order']=qs[_0x9e1b('0x34')](_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x34')]);_0x10e423[_0x9e1b('0x35')]=qs[_0x9e1b('0x2d')](_[_0x9e1b('0x36')](_0x277cb8[_0x9e1b('0x2c')],_0x218daf[_0x9e1b('0x2d')]),_0x10b1ab);if(_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x37')]){_0x10e423[_0x9e1b('0x35')]=_[_0x9e1b('0x38')](_0x10e423['where'],{'$or':_['map'](_0x10b1ab,function(_0x358b93){if(_0x358b93[_0x9e1b('0x29')]!==_0x9e1b('0x39')){var _0x3983fe={};_0x3983fe[_0x358b93['name']]={'$like':'%'+_0x277cb8[_0x9e1b('0x2c')][_0x9e1b('0x37')]+'%'};return _0x3983fe;}})});}_0x10e423=_[_0x9e1b('0x38')]({},_0x10e423,_0x277cb8[_0x9e1b('0x3a')]);var _0x41f9c1={'where':_0x10e423[_0x9e1b('0x35')]};return db[_0x9e1b('0x26')][_0x9e1b('0x1a')](_0x41f9c1)[_0x9e1b('0x1f')](function(_0x2a7d35){_0x309e50['count']=_0x2a7d35;if(_0x277cb8['query']['includeAll']){_0x10e423[_0x9e1b('0x3b')]=[{'all':!![]}];}return db[_0x9e1b('0x26')]['findAll'](_0x10e423);})[_0x9e1b('0x1f')](function(_0x4aa421){_0x309e50[_0x9e1b('0x3c')]=_0x4aa421;return _0x309e50;})[_0x9e1b('0x1f')](respondWithFilteredResult(_0x324e85,_0x10e423))['catch'](handleError(_0x324e85,null));};exports[_0x9e1b('0x3d')]=function(_0x57e9dd,_0x118bc4){var _0x4707c3={'raw':!![],'where':{'id':_0x57e9dd[_0x9e1b('0x3e')]['id']}},_0x17dbff={};_0x17dbff[_0x9e1b('0x2f')]=_[_0x9e1b('0x2b')](db[_0x9e1b('0x26')][_0x9e1b('0x27')]);_0x17dbff['query']=_[_0x9e1b('0x2b')](_0x57e9dd[_0x9e1b('0x2c')]);_0x17dbff[_0x9e1b('0x2d')]=_['intersection'](_0x17dbff['model'],_0x17dbff[_0x9e1b('0x2c')]);_0x4707c3[_0x9e1b('0x31')]=_[_0x9e1b('0x2e')](_0x17dbff[_0x9e1b('0x2f')],qs[_0x9e1b('0x30')](_0x57e9dd[_0x9e1b('0x2c')][_0x9e1b('0x30')]));_0x4707c3[_0x9e1b('0x31')]=_0x4707c3[_0x9e1b('0x31')][_0x9e1b('0x32')]?_0x4707c3[_0x9e1b('0x31')]:_0x17dbff[_0x9e1b('0x2f')];if(_0x57e9dd[_0x9e1b('0x2c')]['includeAll']){_0x4707c3[_0x9e1b('0x3b')]=[{'all':!![]}];}_0x4707c3=_[_0x9e1b('0x38')]({},_0x4707c3,_0x57e9dd[_0x9e1b('0x3a')]);return db[_0x9e1b('0x26')]['find'](_0x4707c3)['then'](handleEntityNotFound(_0x118bc4,null))[_0x9e1b('0x1f')](respondWithResult(_0x118bc4,null))['catch'](handleError(_0x118bc4,null));};exports['create']=function(_0x21a3e2,_0x2645d0){return db[_0x9e1b('0x26')][_0x9e1b('0x3f')](_0x21a3e2[_0x9e1b('0x40')],{})[_0x9e1b('0x1f')](respondWithResult(_0x2645d0,0xc9))[_0x9e1b('0x41')](handleError(_0x2645d0,null));};exports[_0x9e1b('0x42')]=function(_0x5cb02d,_0x1ca86e){if(_0x5cb02d[_0x9e1b('0x40')]['id']){delete _0x5cb02d[_0x9e1b('0x40')]['id'];}return db[_0x9e1b('0x26')][_0x9e1b('0x43')]({'where':{'id':_0x5cb02d[_0x9e1b('0x3e')]['id']}})[_0x9e1b('0x1f')](handleEntityNotFound(_0x1ca86e,null))[_0x9e1b('0x1f')](saveUpdates(_0x5cb02d[_0x9e1b('0x40')],null))['then'](respondWithResult(_0x1ca86e,null))['catch'](handleError(_0x1ca86e,null));};exports[_0x9e1b('0x20')]=function(_0x5664e8,_0x2d36fc){return db[_0x9e1b('0x26')]['find']({'where':{'id':_0x5664e8[_0x9e1b('0x3e')]['id']}})[_0x9e1b('0x1f')](handleEntityNotFound(_0x2d36fc,null))[_0x9e1b('0x1f')](removeEntity(_0x2d36fc,null))[_0x9e1b('0x41')](handleError(_0x2d36fc,null));};
\ No newline at end of file
+var _0x079f=['count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x5c58c4,_0x301019){var _0x922ca6=function(_0x257604){while(--_0x257604){_0x5c58c4['push'](_0x5c58c4['shift']());}};_0x922ca6(++_0x301019);}(_0x079f,0x77));var _0xf079=function(_0x412686,_0x3fde24){_0x412686=_0x412686-0x0;var _0x18619e=_0x079f[_0x412686];return _0x18619e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf079('0x0'));var jsonpatch=require(_0xf079('0x1'));var rp=require(_0xf079('0x2'));var moment=require(_0xf079('0x3'));var BPromise=require(_0xf079('0x4'));var Mustache=require('mustache');var util=require(_0xf079('0x5'));var path=require(_0xf079('0x6'));var sox=require('sox');var csv=require(_0xf079('0x7'));var ejs=require(_0xf079('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf079('0x9'));var squel=require(_0xf079('0xa'));var crypto=require(_0xf079('0xb'));var jsforce=require(_0xf079('0xc'));var deskjs=require(_0xf079('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf079('0xe'));var Redis=require(_0xf079('0xf'));var authService=require(_0xf079('0x10'));var qs=require(_0xf079('0x11'));var as=require(_0xf079('0x12'));var hardwareService=require(_0xf079('0x13'));var logger=require(_0xf079('0x14'))('api');var utils=require(_0xf079('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf079('0x16'))['db'];function respondWithStatusCode(_0x32434e,_0x40d20c){_0x40d20c=_0x40d20c||0xcc;return function(_0x1f3de5){if(_0x1f3de5){return _0x32434e[_0xf079('0x17')](_0x40d20c);}return _0x32434e[_0xf079('0x18')](_0x40d20c)[_0xf079('0x19')]();};}function respondWithResult(_0xaffec9,_0x4204d7){_0x4204d7=_0x4204d7||0xc8;return function(_0x1c8cb4){if(_0x1c8cb4){return _0xaffec9[_0xf079('0x18')](_0x4204d7)[_0xf079('0x1a')](_0x1c8cb4);}};}function respondWithFilteredResult(_0x437e7e,_0x4b2337){return function(_0x5ebc3b){if(_0x5ebc3b){var _0x1ae884=typeof _0x4b2337[_0xf079('0x1b')]===_0xf079('0x1c')&&typeof _0x4b2337['limit']==='undefined';var _0x55aafe=_0x5ebc3b[_0xf079('0x1d')];var _0x128cdd=_0x1ae884?0x0:_0x4b2337[_0xf079('0x1b')];var _0x5a990c=_0x1ae884?_0x5ebc3b[_0xf079('0x1d')]:_0x4b2337[_0xf079('0x1b')]+_0x4b2337['limit'];var _0xdd5e57;if(_0x5a990c>=_0x55aafe){_0x5a990c=_0x55aafe;_0xdd5e57=0xc8;}else{_0xdd5e57=0xce;}_0x437e7e[_0xf079('0x18')](_0xdd5e57);return _0x437e7e[_0xf079('0x1e')](_0xf079('0x1f'),_0x128cdd+'-'+_0x5a990c+'/'+_0x55aafe)['json'](_0x5ebc3b);}return null;};}function patchUpdates(_0x165d07){return function(_0x40f133){try{jsonpatch[_0xf079('0x20')](_0x40f133,_0x165d07,!![]);}catch(_0x580e7c){return BPromise[_0xf079('0x21')](_0x580e7c);}return _0x40f133[_0xf079('0x22')]();};}function saveUpdates(_0x16bbc9,_0xcb7c30){return function(_0x52ffa2){if(_0x52ffa2){return _0x52ffa2['update'](_0x16bbc9)[_0xf079('0x23')](function(_0x1c4815){return _0x1c4815;});}return null;};}function removeEntity(_0x3d2ed7,_0x136957){return function(_0x2ff780){if(_0x2ff780){return _0x2ff780[_0xf079('0x24')]()[_0xf079('0x23')](function(){_0x3d2ed7[_0xf079('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5463c5,_0xfa1267){return function(_0x2631d9){if(!_0x2631d9){_0x5463c5[_0xf079('0x17')](0x194);}return _0x2631d9;};}function handleError(_0x59505d,_0x285e87){_0x285e87=_0x285e87||0x1f4;return function(_0x48514){logger[_0xf079('0x25')](_0x48514[_0xf079('0x26')]);if(_0x48514[_0xf079('0x27')]){delete _0x48514[_0xf079('0x27')];}_0x59505d[_0xf079('0x18')](_0x285e87)['send'](_0x48514);};}exports[_0xf079('0x28')]=function(_0x263634,_0x3cf1b0){var _0x457635={},_0x4d2384={},_0x13b268={'count':0x0,'rows':[]};var _0x4acf2d=_[_0xf079('0x29')](db[_0xf079('0x2a')][_0xf079('0x2b')],function(_0x17e171){return{'name':_0x17e171[_0xf079('0x2c')],'type':_0x17e171[_0xf079('0x2d')]['key']};});_0x4d2384[_0xf079('0x2e')]=_[_0xf079('0x29')](_0x4acf2d,_0xf079('0x27'));_0x4d2384[_0xf079('0x2f')]=_[_0xf079('0x30')](_0x263634[_0xf079('0x2f')]);_0x4d2384['filters']=_[_0xf079('0x31')](_0x4d2384['model'],_0x4d2384['query']);_0x457635[_0xf079('0x32')]=_[_0xf079('0x31')](_0x4d2384['model'],qs[_0xf079('0x33')](_0x263634[_0xf079('0x2f')]['fields']));_0x457635[_0xf079('0x32')]=_0x457635[_0xf079('0x32')][_0xf079('0x34')]?_0x457635[_0xf079('0x32')]:_0x4d2384['model'];if(!_0x263634[_0xf079('0x2f')][_0xf079('0x35')](_0xf079('0x36'))){_0x457635[_0xf079('0x37')]=qs[_0xf079('0x37')](_0x263634[_0xf079('0x2f')]['limit']);_0x457635['offset']=qs[_0xf079('0x1b')](_0x263634['query']['offset']);}_0x457635[_0xf079('0x38')]=qs[_0xf079('0x39')](_0x263634['query'][_0xf079('0x39')]);_0x457635[_0xf079('0x3a')]=qs['filters'](_[_0xf079('0x3b')](_0x263634['query'],_0x4d2384[_0xf079('0x3c')]),_0x4acf2d);if(_0x263634[_0xf079('0x2f')][_0xf079('0x3d')]){_0x457635[_0xf079('0x3a')]=_[_0xf079('0x3e')](_0x457635[_0xf079('0x3a')],{'$or':_[_0xf079('0x29')](_0x4acf2d,function(_0x5894be){if(_0x5894be[_0xf079('0x2d')]!==_0xf079('0x3f')){var _0x50d2cc={};_0x50d2cc[_0x5894be[_0xf079('0x27')]]={'$like':'%'+_0x263634[_0xf079('0x2f')][_0xf079('0x3d')]+'%'};return _0x50d2cc;}})});}_0x457635=_[_0xf079('0x3e')]({},_0x457635,_0x263634[_0xf079('0x40')]);var _0x428e95={'where':_0x457635[_0xf079('0x3a')]};return db[_0xf079('0x2a')][_0xf079('0x1d')](_0x428e95)[_0xf079('0x23')](function(_0x10e950){_0x13b268[_0xf079('0x1d')]=_0x10e950;if(_0x263634[_0xf079('0x2f')][_0xf079('0x41')]){_0x457635[_0xf079('0x42')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xf079('0x43')](_0x457635);})['then'](function(_0x3d0695){_0x13b268['rows']=_0x3d0695;return _0x13b268;})[_0xf079('0x23')](respondWithFilteredResult(_0x3cf1b0,_0x457635))[_0xf079('0x44')](handleError(_0x3cf1b0,null));};exports[_0xf079('0x45')]=function(_0x2baa33,_0x2b343b){var _0x4cf583={'raw':!![],'where':{'id':_0x2baa33[_0xf079('0x46')]['id']}},_0x3a7893={};_0x3a7893['model']=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x3a7893[_0xf079('0x2f')]=_[_0xf079('0x30')](_0x2baa33[_0xf079('0x2f')]);_0x3a7893['filters']=_['intersection'](_0x3a7893[_0xf079('0x2e')],_0x3a7893[_0xf079('0x2f')]);_0x4cf583[_0xf079('0x32')]=_[_0xf079('0x31')](_0x3a7893[_0xf079('0x2e')],qs['fields'](_0x2baa33[_0xf079('0x2f')][_0xf079('0x33')]));_0x4cf583[_0xf079('0x32')]=_0x4cf583[_0xf079('0x32')]['length']?_0x4cf583['attributes']:_0x3a7893['model'];if(_0x2baa33[_0xf079('0x2f')][_0xf079('0x41')]){_0x4cf583[_0xf079('0x42')]=[{'all':!![]}];}_0x4cf583=_[_0xf079('0x3e')]({},_0x4cf583,_0x2baa33[_0xf079('0x40')]);return db[_0xf079('0x2a')][_0xf079('0x47')](_0x4cf583)[_0xf079('0x23')](handleEntityNotFound(_0x2b343b,null))[_0xf079('0x23')](respondWithResult(_0x2b343b,null))[_0xf079('0x44')](handleError(_0x2b343b,null));};exports[_0xf079('0x48')]=function(_0x55a2e3,_0x29f595){return db['OpenchannelApplication'][_0xf079('0x48')](_0x55a2e3[_0xf079('0x49')],{})[_0xf079('0x23')](respondWithResult(_0x29f595,0xc9))['catch'](handleError(_0x29f595,null));};exports['update']=function(_0xba880c,_0x2df38e){if(_0xba880c['body']['id']){delete _0xba880c[_0xf079('0x49')]['id'];}return db[_0xf079('0x2a')][_0xf079('0x47')]({'where':{'id':_0xba880c[_0xf079('0x46')]['id']}})[_0xf079('0x23')](handleEntityNotFound(_0x2df38e,null))[_0xf079('0x23')](saveUpdates(_0xba880c[_0xf079('0x49')],null))[_0xf079('0x23')](respondWithResult(_0x2df38e,null))['catch'](handleError(_0x2df38e,null));};exports[_0xf079('0x24')]=function(_0x55209f,_0x426170){return db[_0xf079('0x2a')][_0xf079('0x47')]({'where':{'id':_0x55209f[_0xf079('0x46')]['id']}})[_0xf079('0x23')](handleEntityNotFound(_0x426170,null))[_0xf079('0x23')](removeEntity(_0x426170,null))[_0xf079('0x44')](handleError(_0x426170,null));};
\ No newline at end of file
index 7afbda7..21b59ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x986d=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4918e1,_0x1a341f){var _0x39653b=function(_0x4445ec){while(--_0x4445ec){_0x4918e1['push'](_0x4918e1['shift']());}};_0x39653b(++_0x1a341f);}(_0x986d,0xe9));var _0xd986=function(_0x305eb6,_0x4f5488){_0x305eb6=_0x305eb6-0x0;var _0x294390=_0x986d[_0x305eb6];return _0x294390;};'use strict';var _=require(_0xd986('0x0'));var util=require(_0xd986('0x1'));var logger=require('../../config/logger')(_0xd986('0x2'));var moment=require('moment');var BPromise=require(_0xd986('0x3'));var rp=require(_0xd986('0x4'));var fs=require('fs');var path=require(_0xd986('0x5'));var rimraf=require(_0xd986('0x6'));var config=require(_0xd986('0x7'));var attributes=require(_0xd986('0x8'));module[_0xd986('0x9')]=function(_0x171770,_0x53942a){return _0x171770[_0xd986('0xa')](_0xd986('0xb'),attributes,{'tableName':_0xd986('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd986('0xd'),'collate':_0xd986('0xe')});};
\ No newline at end of file
+var _0x1ef5=['define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ef5,0x1a7));var _0x51ef=function(_0x4a576c,_0x715fc5){_0x4a576c=_0x4a576c-0x0;var _0x2880a5=_0x1ef5[_0x4a576c];return _0x2880a5;};'use strict';var _=require(_0x51ef('0x0'));var util=require(_0x51ef('0x1'));var logger=require(_0x51ef('0x2'))(_0x51ef('0x3'));var moment=require(_0x51ef('0x4'));var BPromise=require(_0x51ef('0x5'));var rp=require(_0x51ef('0x6'));var fs=require('fs');var path=require(_0x51ef('0x7'));var rimraf=require(_0x51ef('0x8'));var config=require(_0x51ef('0x9'));var attributes=require(_0x51ef('0xa'));module[_0x51ef('0xb')]=function(_0x25d84c,_0x6568ed){return _0x25d84c[_0x51ef('0xc')](_0x51ef('0xd'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x51ef('0xe')});};
\ No newline at end of file
index f4dfdbe..35e5d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x920b=['OpenchannelApplication','update','body','options','raw','where','UpdateOpenchannelApplication','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x571ba8,_0x208586){var _0x323f96=function(_0x2a5d81){while(--_0x2a5d81){_0x571ba8['push'](_0x571ba8['shift']());}};_0x323f96(++_0x208586);}(_0x920b,0x10a));var _0xb920=function(_0x552663,_0x558a13){_0x552663=_0x552663-0x0;var _0x5541e8=_0x920b[_0x552663];return _0x5541e8;};'use strict';var _=require(_0xb920('0x0'));var util=require(_0xb920('0x1'));var moment=require(_0xb920('0x2'));var BPromise=require(_0xb920('0x3'));var rs=require(_0xb920('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb920('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb920('0x6'))(_0xb920('0x7'));var config=require(_0xb920('0x8'));var jayson=require(_0xb920('0x9'));var client=jayson[_0xb920('0xa')][_0xb920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e86d3,_0x1a04ff,_0x96c524){return new BPromise(function(_0x340a6b,_0x2d9096){return client[_0xb920('0xc')](_0x4e86d3,_0x96c524)[_0xb920('0xd')](function(_0x52abbd){logger[_0xb920('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a04ff,_0xb920('0xf'));logger['debug'](_0xb920('0x10'),_0x1a04ff,_0xb920('0xf'),JSON['stringify'](_0x52abbd));if(_0x52abbd[_0xb920('0x11')]){if(_0x52abbd[_0xb920('0x11')][_0xb920('0x12')]===0x1f4){logger[_0xb920('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a04ff,_0x52abbd['error'][_0xb920('0x13')]);return _0x2d9096(_0x52abbd['error'][_0xb920('0x13')]);}logger[_0xb920('0x11')](_0xb920('0x14'),_0x1a04ff,_0x52abbd['error'][_0xb920('0x13')]);return _0x340a6b(_0x52abbd['error'][_0xb920('0x13')]);}else{logger[_0xb920('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a04ff,'request\x20sent');_0x340a6b(_0x52abbd[_0xb920('0x15')]['message']);}})['catch'](function(_0xd420d4){logger[_0xb920('0x11')](_0xb920('0x14'),_0x1a04ff,_0xd420d4);_0x2d9096(_0xd420d4);});});}exports['UpdateOpenchannelApplication']=function(_0x426f56){var _0x46e524=this;return new Promise(function(_0x30902e,_0x77c386){return db[_0xb920('0x16')][_0xb920('0x17')](_0x426f56[_0xb920('0x18')],{'raw':_0x426f56[_0xb920('0x19')]?_0x426f56[_0xb920('0x19')][_0xb920('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x426f56[_0xb920('0x19')]?_0x426f56[_0xb920('0x19')][_0xb920('0x1b')]||null:null,'attributes':_0x426f56['options']?_0x426f56[_0xb920('0x19')]['attributes']||null:null,'limit':_0x426f56[_0xb920('0x19')]?_0x426f56[_0xb920('0x19')]['limit']||null:null})[_0xb920('0xd')](function(_0xfa61bd){logger[_0xb920('0xe')](_0xb920('0x1c'),_0x426f56);logger[_0xb920('0x1d')](_0xb920('0x1c'),_0x426f56,JSON[_0xb920('0x1e')](_0xfa61bd));_0x30902e(_0xfa61bd);})[_0xb920('0x1f')](function(_0x485cf5){logger[_0xb920('0x11')]('UpdateOpenchannelApplication',_0x485cf5[_0xb920('0x13')],_0x426f56);_0x77c386(_0x46e524[_0xb920('0x11')](0x1f4,_0x485cf5[_0xb920('0x13')]));});});};
\ No newline at end of file
+var _0xef02=['info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x47e3f8,_0x517bcd){var _0x4742d5=function(_0x2a4f20){while(--_0x2a4f20){_0x47e3f8['push'](_0x47e3f8['shift']());}};_0x4742d5(++_0x517bcd);}(_0xef02,0x1b3));var _0x2ef0=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0xef02[_0x46ec32];return _0x338f60;};'use strict';var _=require(_0x2ef0('0x0'));var util=require(_0x2ef0('0x1'));var moment=require(_0x2ef0('0x2'));var BPromise=require(_0x2ef0('0x3'));var rs=require(_0x2ef0('0x4'));var fs=require('fs');var Redis=require(_0x2ef0('0x5'));var db=require(_0x2ef0('0x6'))['db'];var utils=require(_0x2ef0('0x7'));var logger=require(_0x2ef0('0x8'))(_0x2ef0('0x9'));var config=require('../../config/environment');var jayson=require(_0x2ef0('0xa'));var client=jayson[_0x2ef0('0xb')][_0x2ef0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a377d,_0x2eb26f,_0x3d270b){return new BPromise(function(_0x258326,_0x2d53ac){return client[_0x2ef0('0xd')](_0x4a377d,_0x3d270b)[_0x2ef0('0xe')](function(_0x49694a){logger[_0x2ef0('0xf')](_0x2ef0('0x10'),_0x2eb26f,'request\x20sent');logger[_0x2ef0('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2eb26f,_0x2ef0('0x12'),JSON[_0x2ef0('0x13')](_0x49694a));if(_0x49694a[_0x2ef0('0x14')]){if(_0x49694a[_0x2ef0('0x14')]['code']===0x1f4){logger[_0x2ef0('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x2eb26f,_0x49694a['error'][_0x2ef0('0x15')]);return _0x2d53ac(_0x49694a['error'][_0x2ef0('0x15')]);}logger['error'](_0x2ef0('0x10'),_0x2eb26f,_0x49694a[_0x2ef0('0x14')][_0x2ef0('0x15')]);return _0x258326(_0x49694a['error'][_0x2ef0('0x15')]);}else{logger['info'](_0x2ef0('0x10'),_0x2eb26f,_0x2ef0('0x12'));_0x258326(_0x49694a[_0x2ef0('0x16')]['message']);}})[_0x2ef0('0x17')](function(_0xd181d3){logger[_0x2ef0('0x14')](_0x2ef0('0x10'),_0x2eb26f,_0xd181d3);_0x2d53ac(_0xd181d3);});});}exports[_0x2ef0('0x18')]=function(_0xc14a8){var _0x4fcb5d=this;return new Promise(function(_0x20fa65,_0x1f535a){return db[_0x2ef0('0x19')][_0x2ef0('0x1a')](_0xc14a8['body'],{'raw':_0xc14a8[_0x2ef0('0x1b')]?_0xc14a8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc14a8[_0x2ef0('0x1b')]?_0xc14a8[_0x2ef0('0x1b')]['where']||null:null,'attributes':_0xc14a8[_0x2ef0('0x1b')]?_0xc14a8['options'][_0x2ef0('0x1c')]||null:null,'limit':_0xc14a8['options']?_0xc14a8[_0x2ef0('0x1b')][_0x2ef0('0x1d')]||null:null})[_0x2ef0('0xe')](function(_0x1147cd){logger[_0x2ef0('0xf')](_0x2ef0('0x18'),_0xc14a8);logger[_0x2ef0('0x11')]('UpdateOpenchannelApplication',_0xc14a8,JSON[_0x2ef0('0x13')](_0x1147cd));_0x20fa65(_0x1147cd);})[_0x2ef0('0x17')](function(_0x16503e){logger[_0x2ef0('0x14')](_0x2ef0('0x18'),_0x16503e[_0x2ef0('0x15')],_0xc14a8);_0x1f535a(_0x4fcb5d[_0x2ef0('0x14')](0x1f4,_0x16503e['message']));});});};
\ No newline at end of file
index ccd2dfb..c0424ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bbe=['show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5024c7,_0xd560bd){var _0xf2f316=function(_0x4d7748){while(--_0x4d7748){_0x5024c7['push'](_0x5024c7['shift']());}};_0xf2f316(++_0xd560bd);}(_0x5bbe,0x11a));var _0xe5bb=function(_0x462555,_0x1410c5){_0x462555=_0x462555-0x0;var _0x2bc8b8=_0x5bbe[_0x462555];return _0x2bc8b8;};'use strict';var multer=require(_0xe5bb('0x0'));var util=require(_0xe5bb('0x1'));var path=require(_0xe5bb('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5bb('0x3'));var router=express[_0xe5bb('0x4')]();var fs_extra=require(_0xe5bb('0x5'));var auth=require(_0xe5bb('0x6'));var interaction=require(_0xe5bb('0x7'));var config=require(_0xe5bb('0x8'));var controller=require(_0xe5bb('0x9'));router[_0xe5bb('0xa')]('/',auth[_0xe5bb('0xb')](),controller[_0xe5bb('0xc')]);router[_0xe5bb('0xa')](_0xe5bb('0xd'),auth[_0xe5bb('0xb')](),controller['describe']);router['get'](_0xe5bb('0xe'),auth[_0xe5bb('0xb')](),controller[_0xe5bb('0xf')]);router['get'](_0xe5bb('0x10'),auth[_0xe5bb('0xb')](),controller[_0xe5bb('0x11')]);router[_0xe5bb('0xa')](_0xe5bb('0x12'),auth[_0xe5bb('0xb')](),controller[_0xe5bb('0x13')]);router[_0xe5bb('0x14')]('/',auth[_0xe5bb('0xb')](),controller[_0xe5bb('0x15')]);router[_0xe5bb('0x14')](_0xe5bb('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe5bb('0x14')](_0xe5bb('0x16'),auth[_0xe5bb('0xb')](),interaction[_0xe5bb('0x17')](_0xe5bb('0x18'),_0xe5bb('0x19')),controller[_0xe5bb('0x1a')]);router['put'](_0xe5bb('0xe'),auth[_0xe5bb('0xb')](),interaction[_0xe5bb('0x17')]('openchannel',_0xe5bb('0x1b')),controller[_0xe5bb('0x1c')]);router[_0xe5bb('0x1d')](_0xe5bb('0xe'),auth[_0xe5bb('0xb')](),interaction[_0xe5bb('0x17')](_0xe5bb('0x18'),_0xe5bb('0x1e')),controller[_0xe5bb('0x1f')]);router[_0xe5bb('0x1d')](_0xe5bb('0x16'),auth[_0xe5bb('0xb')](),controller[_0xe5bb('0x20')]);module['exports']=router;
\ No newline at end of file
+var _0x42f9=['download','post','create','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x42f9,0x14e));var _0x942f=function(_0x29fd4c,_0x1a623d){_0x29fd4c=_0x29fd4c-0x0;var _0x4e183a=_0x42f9[_0x29fd4c];return _0x4e183a;};'use strict';var multer=require(_0x942f('0x0'));var util=require(_0x942f('0x1'));var path=require('path');var timeout=require(_0x942f('0x2'));var express=require(_0x942f('0x3'));var router=express[_0x942f('0x4')]();var fs_extra=require(_0x942f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x942f('0x6'));var config=require(_0x942f('0x7'));var controller=require(_0x942f('0x8'));router[_0x942f('0x9')]('/',auth[_0x942f('0xa')](),controller[_0x942f('0xb')]);router['get'](_0x942f('0xc'),auth[_0x942f('0xa')](),controller[_0x942f('0xd')]);router['get'](_0x942f('0xe'),auth[_0x942f('0xa')](),controller[_0x942f('0xf')]);router[_0x942f('0x9')](_0x942f('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x942f('0x9')](_0x942f('0x11'),auth[_0x942f('0xa')](),controller[_0x942f('0x12')]);router[_0x942f('0x13')]('/',auth['isAuthenticated'](),controller[_0x942f('0x14')]);router[_0x942f('0x13')](_0x942f('0x10'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x942f('0x15'),auth['isAuthenticated'](),interaction[_0x942f('0x16')](_0x942f('0x17'),'openchannelinteraction:addtags'),controller[_0x942f('0x18')]);router[_0x942f('0x19')](_0x942f('0xe'),auth[_0x942f('0xa')](),interaction[_0x942f('0x16')]('openchannel',_0x942f('0x1a')),controller[_0x942f('0x1b')]);router['delete'](_0x942f('0xe'),auth[_0x942f('0xa')](),interaction['tracked'](_0x942f('0x17'),_0x942f('0x1c')),controller[_0x942f('0x1d')]);router[_0x942f('0x1e')]('/:id/tags',auth[_0x942f('0xa')](),controller['removeTags']);module[_0x942f('0x1f')]=router;
\ No newline at end of file
index 1de56ad..97b5c17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9bb=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3530d0,_0x4dfb47){var _0x2165c6=function(_0x2ab151){while(--_0x2ab151){_0x3530d0['push'](_0x3530d0['shift']());}};_0x2165c6(++_0x4dfb47);}(_0xf9bb,0x14d));var _0xbf9b=function(_0xc1fac2,_0x725358){_0xc1fac2=_0xc1fac2-0x0;var _0x1a31f8=_0xf9bb[_0xc1fac2];return _0x1a31f8;};'use strict';var Sequelize=require(_0xbf9b('0x0'));module[_0xbf9b('0x1')]={'closed':{'type':Sequelize[_0xbf9b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbf9b('0x3')]},'secondDisposition':{'type':Sequelize[_0xbf9b('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbf9b('0x4')]},'threadId':{'type':Sequelize[_0xbf9b('0x3')]},'externalUrl':{'type':Sequelize[_0xbf9b('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbf9b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbf9b('0x5')]('in',_0xbf9b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbf9b('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe829=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xe829,0x1d8));var _0x9e82=function(_0xf022be,_0x14e78e){_0xf022be=_0xf022be-0x0;var _0x18d7d5=_0xe829[_0xf022be];return _0x18d7d5;};'use strict';var Sequelize=require(_0x9e82('0x0'));module[_0x9e82('0x1')]={'closed':{'type':Sequelize[_0x9e82('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9e82('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9e82('0x3')]},'note':{'type':Sequelize[_0x9e82('0x3')]},'read1stAt':{'type':Sequelize[_0x9e82('0x4')]},'threadId':{'type':Sequelize[_0x9e82('0x3')]},'externalUrl':{'type':Sequelize[_0x9e82('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9e82('0x5')]('in',_0x9e82('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9e82('0x5')]('in',_0x9e82('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9e82('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index fb57347..8b5a82d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2410=['existsSync','createReadStream','pipe','createWriteStream','direction','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','error','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','query','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','include','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','includeAll','rows','addTags','setTags','omit','spread','Tag','findAll','color','emit','removeTags','download','toString','join','server','files','tmp','root','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','Account','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','basename'];(function(_0x1afdaa,_0x3b9acf){var _0x3c965e=function(_0x47fd40){while(--_0x47fd40){_0x1afdaa['push'](_0x1afdaa['shift']());}};_0x3c965e(++_0x3b9acf);}(_0x2410,0x193));var _0x0241=function(_0x5577a4,_0x37cabc){_0x5577a4=_0x5577a4-0x0;var _0x40f639=_0x2410[_0x5577a4];return _0x40f639;};'use strict';var rimraf=require(_0x0241('0x0'));var zipdir=require(_0x0241('0x1'));var moment=require(_0x0241('0x2'));var util=require(_0x0241('0x3'));var path=require('path');var ejs=require(_0x0241('0x4'));var fs=require('fs');var _=require(_0x0241('0x5'));var Redis=require(_0x0241('0x6'));var interaction=require(_0x0241('0x7'));var qs=require(_0x0241('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x0241('0x9'))(_0x0241('0xa'));var config=require(_0x0241('0xb'));var db=require(_0x0241('0xc'))['db'];config[_0x0241('0xd')]=_[_0x0241('0xe')](config[_0x0241('0xd')],{'host':_0x0241('0xf'),'port':0x18eb});var socket=require(_0x0241('0x10'))(new Redis(config['redis']));require(_0x0241('0x11'))[_0x0241('0x12')](socket);function respondWithStatusCode(_0x12caad,_0x574de6){_0x574de6=_0x574de6||0xcc;return function(_0xbe1b2e){if(_0xbe1b2e){return _0x12caad[_0x0241('0x13')](_0x574de6);}return _0x12caad[_0x0241('0x14')](_0x574de6)[_0x0241('0x15')]();};}function respondWithResult(_0x19b7c6,_0x6fb03c){_0x6fb03c=_0x6fb03c||0xc8;return function(_0xa503b1){if(_0xa503b1){return _0x19b7c6[_0x0241('0x14')](_0x6fb03c)[_0x0241('0x16')](_0xa503b1);}};}function respondWithFilteredResult(_0xde8408,_0x10773f){return function(_0x3fc9b4){if(_0x3fc9b4){var _0x40fde0=typeof _0x10773f[_0x0241('0x17')]==='undefined'&&typeof _0x10773f[_0x0241('0x18')]==='undefined';var _0x50b4c7=_0x3fc9b4[_0x0241('0x19')];var _0xf6cfbe=_0x40fde0?0x0:_0x10773f[_0x0241('0x17')];var _0x5494e7=_0x40fde0?_0x3fc9b4[_0x0241('0x19')]:_0x10773f[_0x0241('0x17')]+_0x10773f[_0x0241('0x18')];var _0x3b3add;if(_0x5494e7>=_0x50b4c7){_0x5494e7=_0x50b4c7;_0x3b3add=0xc8;}else{_0x3b3add=0xce;}_0xde8408['status'](_0x3b3add);return _0xde8408[_0x0241('0x1a')](_0x0241('0x1b'),_0xf6cfbe+'-'+_0x5494e7+'/'+_0x50b4c7)[_0x0241('0x16')](_0x3fc9b4);}return null;};}function saveUpdates(_0x2a690a){return function(_0x186ab2){if(_0x186ab2){return _0x186ab2[_0x0241('0x1c')](_0x2a690a)[_0x0241('0x1d')](function(_0x35d76e){return _0x35d76e;});}return null;};}function removeEntity(_0x2d7b6c){return function(_0xb6d6c4){if(_0xb6d6c4){return _0xb6d6c4[_0x0241('0x1e')]()[_0x0241('0x1d')](function(){_0x2d7b6c[_0x0241('0x14')](0xcc)[_0x0241('0x15')]();});}};}function handleEntityNotFound(_0x11e57f){return function(_0x383c5e){if(!_0x383c5e){_0x11e57f['sendStatus'](0x194);}return _0x383c5e;};}function handleError(_0x327631,_0x142369){_0x142369=_0x142369||0x1f4;return function(_0x2d1059){logger[_0x0241('0x1f')](_0x2d1059['stack']);if(_0x2d1059[_0x0241('0x20')]){delete _0x2d1059[_0x0241('0x20')];}_0x327631[_0x0241('0x14')](_0x142369)[_0x0241('0x21')](_0x2d1059);};}exports['index']=function(_0x558fd5,_0x194cf6){var _0xd3bc7c={};var _0x14d765=_[_0x0241('0x22')](db[_0x0241('0x23')][_0x0241('0x24')],function(_0x51d81b){return{'name':_0x51d81b[_0x0241('0x25')],'type':_0x51d81b['type'][_0x0241('0x26')]};});_0xd3bc7c=qs[_0x0241('0x27')](_0x14d765,_0x558fd5);return interaction['findAll']('openchannel',_0x558fd5[_0x0241('0x28')],_0x558fd5['user'],_0xd3bc7c,_0x14d765)[_0x0241('0x1d')](respondWithFilteredResult(_0x194cf6,_0xd3bc7c))[_0x0241('0x29')](handleError(_0x194cf6,null));};exports[_0x0241('0x2a')]=function(_0xc0e00a,_0x5ae44c){var _0x31df5b={};if(_0xc0e00a[_0x0241('0x28')][_0x0241('0x2b')]&&_0xc0e00a[_0x0241('0x28')][_0x0241('0x2b')]===_0x0241('0x2c')){_0x31df5b[_0x0241('0x2c')]=_0xc0e00a[_0x0241('0x2d')]['id'];}else{_0x31df5b['id']=_0xc0e00a['params']['id'];}var _0x4bdabd={'raw':![],'where':_0x31df5b},_0x591725={};_0x591725[_0x0241('0x2e')]=_[_0x0241('0x2f')](db[_0x0241('0x23')][_0x0241('0x24')]);_0x591725[_0x0241('0x28')]=_['keys'](_0xc0e00a[_0x0241('0x28')]);_0x591725[_0x0241('0x30')]=_[_0x0241('0x31')](_0x591725['model'],_0x591725[_0x0241('0x28')]);_0x4bdabd[_0x0241('0x32')]=_['intersection'](_0x591725[_0x0241('0x2e')],qs[_0x0241('0x33')](_0xc0e00a['query']['fields']));_0x4bdabd[_0x0241('0x32')]=_0x4bdabd['attributes']['length']?_0x4bdabd['attributes']:_0x591725[_0x0241('0x2e')];if(_0xc0e00a[_0x0241('0x28')]['includeAll']){_0x4bdabd[_0x0241('0x34')]=[{'all':!![]}];}_0x4bdabd=_[_0x0241('0x35')]({},_0x4bdabd,_0xc0e00a['options']);return db[_0x0241('0x23')][_0x0241('0x36')](_0x4bdabd)[_0x0241('0x1d')](handleEntityNotFound(_0x5ae44c,null))['then'](respondWithResult(_0x5ae44c,null))[_0x0241('0x29')](handleError(_0x5ae44c,null));};exports[_0x0241('0x37')]=function(_0x412289,_0x1bd1c1){return db[_0x0241('0x23')][_0x0241('0x37')](_0x412289['body'],{})[_0x0241('0x1d')](respondWithResult(_0x1bd1c1,0xc9))[_0x0241('0x29')](handleError(_0x1bd1c1,null));};exports[_0x0241('0x1c')]=function(_0x32f79d,_0x5d5316){if(_0x32f79d[_0x0241('0x38')]['id']){delete _0x32f79d[_0x0241('0x38')]['id'];}return db[_0x0241('0x23')][_0x0241('0x36')]({'where':{'id':_0x32f79d[_0x0241('0x2d')]['id']}})[_0x0241('0x1d')](handleEntityNotFound(_0x5d5316,null))[_0x0241('0x1d')](saveUpdates(_0x32f79d[_0x0241('0x38')],null))[_0x0241('0x1d')](respondWithResult(_0x5d5316,null))[_0x0241('0x29')](handleError(_0x5d5316,null));};exports[_0x0241('0x1e')]=function(_0x31cbc1,_0x50b0f3){return db['OpenchannelInteraction'][_0x0241('0x36')]({'where':{'id':_0x31cbc1[_0x0241('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50b0f3,null))[_0x0241('0x1d')](removeEntity(_0x50b0f3,null))['catch'](handleError(_0x50b0f3,null));};exports['describe']=function(_0x54aca8,_0x51ae58){return db[_0x0241('0x23')][_0x0241('0x39')]()['then'](respondWithResult(_0x51ae58,null))[_0x0241('0x29')](handleError(_0x51ae58,null));};exports[_0x0241('0x3a')]=function(_0x559a4b,_0x1a69bb){return db[_0x0241('0x3b')]['find']({'where':{'id':_0x559a4b['params']['id']}})[_0x0241('0x1d')](handleEntityNotFound(_0x1a69bb,null))[_0x0241('0x1d')](function(_0x2be54c){if(_0x2be54c){return _0x2be54c[_0x0241('0x3a')](_0x559a4b['body'][_0x0241('0x3c')],_['omit'](_0x559a4b[_0x0241('0x38')],['ids','id'])||{});}})['then'](respondWithResult(_0x1a69bb,null))['catch'](handleError(_0x1a69bb,null));};exports['getMessages']=function(_0x50b2d9,_0x226e47){var _0x677700={'raw':![],'where':{}};var _0x3e97dd={};var _0x60ecd4={'count':0x0,'rows':[]};return db[_0x0241('0x23')][_0x0241('0x3d')]({'where':{'id':_0x50b2d9[_0x0241('0x2d')]['id']}})[_0x0241('0x1d')](handleEntityNotFound(_0x226e47,null))[_0x0241('0x1d')](function(_0x476db8){if(_0x476db8){_0x3e97dd['model']=_['keys'](db[_0x0241('0x3b')][_0x0241('0x24')]);_0x3e97dd[_0x0241('0x28')]=_[_0x0241('0x2f')](_0x50b2d9['query']);_0x3e97dd[_0x0241('0x30')]=_[_0x0241('0x31')](_0x3e97dd[_0x0241('0x2e')],_0x3e97dd['query']);_0x677700['attributes']=_[_0x0241('0x31')](_0x3e97dd[_0x0241('0x2e')],qs['fields'](_0x50b2d9[_0x0241('0x28')][_0x0241('0x33')]));_0x677700['attributes']=_0x677700['attributes']['length']?_0x677700['attributes']:_0x3e97dd['model'];if(!_0x50b2d9['query'][_0x0241('0x3e')](_0x0241('0x3f'))){_0x677700['limit']=qs[_0x0241('0x18')](_0x50b2d9[_0x0241('0x28')][_0x0241('0x18')]);_0x677700[_0x0241('0x17')]=qs[_0x0241('0x17')](_0x50b2d9[_0x0241('0x28')][_0x0241('0x17')]);}_0x677700[_0x0241('0x40')]=qs[_0x0241('0x41')](_0x50b2d9[_0x0241('0x28')][_0x0241('0x41')]);_0x677700[_0x0241('0x42')]=qs['filters'](_[_0x0241('0x43')](_0x50b2d9[_0x0241('0x28')],_0x3e97dd[_0x0241('0x30')]));_0x677700[_0x0241('0x42')]['OpenchannelInteractionId']=_0x476db8['id'];if(_0x50b2d9[_0x0241('0x28')]['filter']){_0x677700['where']=_[_0x0241('0x35')](_0x677700[_0x0241('0x42')],{'$or':_[_0x0241('0x22')](_0x677700[_0x0241('0x32')],function(_0x196d2a){var _0x243ba2={};_0x243ba2[_0x196d2a]={'$like':'%'+_0x50b2d9['query'][_0x0241('0x44')]+'%'};return _0x243ba2;})});}if(_0x50b2d9[_0x0241('0x28')]['$gte']){var _0x2e70a9=_0x50b2d9[_0x0241('0x28')][_0x0241('0x45')][_0x0241('0x46')](',');var _0xf00fad={};_0xf00fad[_0x2e70a9[0x0]]={'$gte':moment(_0x2e70a9[0x1])[_0x0241('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x677700['where']=_['merge'](_0x677700['where'],_0xf00fad);}_0x677700=_[_0x0241('0x35')]({},_0x677700,_0x50b2d9['options']);return db[_0x0241('0x3b')]['count']({'where':_0x677700[_0x0241('0x42')]})[_0x0241('0x1d')](function(_0xb2bec4){_0x60ecd4[_0x0241('0x19')]=_0xb2bec4;if(_0x50b2d9[_0x0241('0x28')][_0x0241('0x48')]){_0x677700['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x677700);})[_0x0241('0x1d')](function(_0x500f52){_0x60ecd4[_0x0241('0x49')]=_0x500f52;return _0x60ecd4;});}})[_0x0241('0x1d')](respondWithFilteredResult(_0x226e47,_0x677700))[_0x0241('0x29')](handleError(_0x226e47,null));};exports[_0x0241('0x4a')]=function(_0x4f3975,_0x41ff8e){return db[_0x0241('0x23')][_0x0241('0x36')]({'where':{'id':_0x4f3975[_0x0241('0x2d')]['id']}})[_0x0241('0x1d')](handleEntityNotFound(_0x41ff8e,null))[_0x0241('0x1d')](function(_0x135b04){if(_0x135b04){return _0x135b04[_0x0241('0x4b')](_0x4f3975[_0x0241('0x38')][_0x0241('0x3c')],_[_0x0241('0x4c')](_0x4f3975[_0x0241('0x38')],[_0x0241('0x3c'),'id'])||{})[_0x0241('0x4d')](function(){return db[_0x0241('0x4e')][_0x0241('0x4f')]({'attributes':['id',_0x0241('0x20'),_0x0241('0x50')],'where':{'id':_0x4f3975[_0x0241('0x38')]['ids']}});})[_0x0241('0x1d')](function(_0x53875e){socket[_0x0241('0x51')]('openchannelInteractionTags:save',{'id':Number(_0x4f3975[_0x0241('0x2d')]['id']),'tags':_0x53875e||[]});return{'id':Number(_0x4f3975['params']['id']),'tags':_0x53875e||[]};});}})[_0x0241('0x1d')](respondWithResult(_0x41ff8e,null))[_0x0241('0x29')](handleError(_0x41ff8e,null));};exports['removeTags']=function(_0x32e414,_0x24b9c7){return db[_0x0241('0x23')][_0x0241('0x36')]({'where':{'id':_0x32e414[_0x0241('0x2d')]['id']}})['then'](handleEntityNotFound(_0x24b9c7,null))[_0x0241('0x1d')](function(_0x391f31){if(_0x391f31){return _0x391f31[_0x0241('0x52')](_0x32e414[_0x0241('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x24b9c7,null))[_0x0241('0x29')](handleError(_0x24b9c7,null));};exports[_0x0241('0x53')]=function(_0x2b99e4,_0x470a9e){var _0x48c6ae=moment()['unix']()[_0x0241('0x54')]();var _0x3085cc=path[_0x0241('0x55')](config['root'],_0x0241('0x56'),_0x0241('0x57'),_0x0241('0x58'));var _0x317bcf=path['join'](config[_0x0241('0x59')],_0x0241('0x56'),'files',_0x0241('0x5a'));var _0x5a8900=path[_0x0241('0x55')](_0x3085cc,_0x48c6ae);var _0x286ed7=util[_0x0241('0x47')]('transcript-%d-%s.zip',_0x2b99e4[_0x0241('0x2d')]['id'],_0x48c6ae);var _0x1b9df3=path['join'](_0x3085cc,_0x286ed7);var _0x352578=[];_0x352578[_0x0241('0x5b')]({'model':db['User'],'as':_0x0241('0x5c'),'attributes':['id',_0x0241('0x5d')],'raw':!![]});_0x352578[_0x0241('0x5b')]({'model':db[_0x0241('0x5e')],'as':_0x0241('0x5f'),'attributes':['id',_0x0241('0x60'),_0x0241('0x61')],'raw':!![]});if(_0x2b99e4[_0x0241('0x28')][_0x0241('0x5a')]){_0x352578[_0x0241('0x5b')]({'model':db[_0x0241('0x62')],'as':_0x0241('0x62'),'raw':!![]});}var _0x2874ad=[{'model':db['OpenchannelMessage'],'as':_0x0241('0x63'),'attributes':['id',_0x0241('0x38'),_0x0241('0x64'),'direction',_0x0241('0x65'),_0x0241('0x66')],'include':_0x352578}];_0x2874ad[_0x0241('0x5b')]({'model':db['OpenchannelAccount'],'as':_0x0241('0x67'),'attributes':['id','name']});_0x2874ad[_0x0241('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0x0241('0x5d')]});return db[_0x0241('0x23')][_0x0241('0x36')]({'where':{'id':_0x2b99e4['params']['id']},'include':_0x2874ad})['then'](handleEntityNotFound(_0x470a9e,null))[_0x0241('0x1d')](function(_0x453ee7){if(_0x453ee7){var _0xee47f9=_0x453ee7['get']({'plain':!![]});fs['mkdirSync'](_0x5a8900);var _0x131a97={'channel':_0x0241('0x68'),'account':_0xee47f9['Account']['name'],'agent':_0xee47f9['Owner']?_0xee47f9[_0x0241('0x69')][_0x0241('0x5d')]:_0x0241('0x6a'),'createdAt':moment(_0xee47f9['createdAt'])[_0x0241('0x47')](_0x0241('0x6b'))['toString'](),'closedAt':_0xee47f9['closed']?moment(_0xee47f9['closedAt'])[_0x0241('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0241('0x54')]():'','disposition':_0xee47f9[_0x0241('0x6c')],'visibility':_0xee47f9[_0x0241('0x6d')]?_0x0241('0x6e'):_0x0241('0x6f'),'messages':_(_0xee47f9['Messages'])['filter']({'secret':![]})['map'](function(_0x55ff11){if(_0x55ff11['Attachment']){var _0x55e254=path[_0x0241('0x55')](_0x317bcf,_0x55ff11['Attachment'][_0x0241('0x70')]);if(fs[_0x0241('0x71')](_0x55e254)){fs[_0x0241('0x72')](_0x55e254)[_0x0241('0x73')](fs[_0x0241('0x74')](path[_0x0241('0x55')](_0x5a8900,_0x55ff11[_0x0241('0x62')][_0x0241('0x70')])));}}return{'date':moment(_0x55ff11['createdAt'])[_0x0241('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x55ff11[_0x0241('0x75')]===_0x0241('0x76')?_0x55ff11[_0x0241('0x5c')]?_0x55ff11['User'][_0x0241('0x5d')]:_0x0241('0x77'):_0x55ff11['Contact']['firstName']+(_0x55ff11[_0x0241('0x5f')][_0x0241('0x61')]?'\x20'+_0x55ff11[_0x0241('0x5f')][_0x0241('0x61')]:''),'body':_0x55ff11[_0x0241('0x62')]?_0x55ff11[_0x0241('0x62')]['basename']:_0x55ff11[_0x0241('0x38')],'direction':_0x55ff11[_0x0241('0x75')]===_0x0241('0x76')?'A':'C','secret':_0x55ff11[_0x0241('0x65')],'read':_0x55ff11['read'],'attachment':_0x55ff11[_0x0241('0x62')]};})[_0x0241('0x78')]()};return ejs[_0x0241('0x79')](path[_0x0241('0x55')](config[_0x0241('0x59')],_0x0241('0x56'),_0x0241('0x7a'),_0x0241('0x7b')),{'interaction':_0x131a97})[_0x0241('0x1d')](function(_0x2e7eed){var _0x3f9bf7=path['join'](_0x5a8900,_0x0241('0x7c')+_0xee47f9['id']+'-'+_0x48c6ae+_0x0241('0x7d'));var _0xb45579={'path':_0x3f9bf7,'channel':'Openchannel','interactionId':_0xee47f9['id']};return pdf[_0x0241('0x7e')](_0x2e7eed,_0xb45579);})[_0x0241('0x1d')](function(){return new Promise(function(_0x5acd36,_0x4f6493){zipdir(_0x5a8900,{'saveTo':_0x1b9df3},function(_0x1130ec,_0x3890fc){if(_0x1130ec)return _0x4f6493(_0x1130ec);return _0x5acd36(_0x3890fc);});})['then'](function(){return new Promise(function(_0xaae5ec,_0x3c7507){rimraf(_0x5a8900,function(_0x457d02){if(_0x457d02)_0x3c7507(_0x457d02);return _0xaae5ec();});});})[_0x0241('0x1d')](function(){return _0x470a9e['download'](_0x1b9df3,_0x286ed7,function(_0x2348e2){if(_0x2348e2){logger['error'](_0x0241('0x7f'),_0x2348e2);}else{fs[_0x0241('0x80')](_0x1b9df3);}});});});}else{return _0x470a9e[_0x0241('0x13')](0xc8);}})[_0x0241('0x29')](handleError(_0x470a9e,null));};
\ No newline at end of file
+var _0xe78b=['ioredis','../../components/interaction/service','../../components/export/pdf','api','redis','defaults','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','error','stack','name','send','index','fieldName','type','key','findAll','user','catch','show','query','from','params','model','keys','OpenchannelInteraction','rawAttributes','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','filters','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','createdAt','direction','secret','OpenchannelAccount','Owner','get','Openchannel','Account','N.A.','toString','closed','closedAt','threadId','Public','Messages','existsSync','createReadStream','basename','out','System','read','value','renderFile','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','util'];(function(_0x1d09fb,_0x23c973){var _0x3dca3f=function(_0x17959b){while(--_0x17959b){_0x1d09fb['push'](_0x1d09fb['shift']());}};_0x3dca3f(++_0x23c973);}(_0xe78b,0x76));var _0xbe78=function(_0x5dfde8,_0xa2f77d){_0x5dfde8=_0x5dfde8-0x0;var _0x2253fb=_0xe78b[_0x5dfde8];return _0x2253fb;};'use strict';var rimraf=require(_0xbe78('0x0'));var zipdir=require(_0xbe78('0x1'));var moment=require('moment');var util=require(_0xbe78('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xbe78('0x3'));var interaction=require(_0xbe78('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbe78('0x5'));var logger=require('../../config/logger')(_0xbe78('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xbe78('0x7')]=_[_0xbe78('0x8')](config[_0xbe78('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe78('0x7')]));require(_0xbe78('0x9'))['register'](socket);function respondWithStatusCode(_0x4ef71e,_0x382299){_0x382299=_0x382299||0xcc;return function(_0xc78914){if(_0xc78914){return _0x4ef71e[_0xbe78('0xa')](_0x382299);}return _0x4ef71e[_0xbe78('0xb')](_0x382299)[_0xbe78('0xc')]();};}function respondWithResult(_0x342d5f,_0x493784){_0x493784=_0x493784||0xc8;return function(_0x803075){if(_0x803075){return _0x342d5f[_0xbe78('0xb')](_0x493784)[_0xbe78('0xd')](_0x803075);}};}function respondWithFilteredResult(_0x39befa,_0x4e7cdf){return function(_0x18a8f5){if(_0x18a8f5){var _0x2fc69a=typeof _0x4e7cdf[_0xbe78('0xe')]===_0xbe78('0xf')&&typeof _0x4e7cdf[_0xbe78('0x10')]===_0xbe78('0xf');var _0x3fbf72=_0x18a8f5[_0xbe78('0x11')];var _0x344432=_0x2fc69a?0x0:_0x4e7cdf[_0xbe78('0xe')];var _0x29e527=_0x2fc69a?_0x18a8f5[_0xbe78('0x11')]:_0x4e7cdf[_0xbe78('0xe')]+_0x4e7cdf[_0xbe78('0x10')];var _0x3212ce;if(_0x29e527>=_0x3fbf72){_0x29e527=_0x3fbf72;_0x3212ce=0xc8;}else{_0x3212ce=0xce;}_0x39befa[_0xbe78('0xb')](_0x3212ce);return _0x39befa['set'](_0xbe78('0x12'),_0x344432+'-'+_0x29e527+'/'+_0x3fbf72)[_0xbe78('0xd')](_0x18a8f5);}return null;};}function saveUpdates(_0x40c5c7){return function(_0xb8c5a5){if(_0xb8c5a5){return _0xb8c5a5[_0xbe78('0x13')](_0x40c5c7)['then'](function(_0x3d9c89){return _0x3d9c89;});}return null;};}function removeEntity(_0x18015b){return function(_0x5431db){if(_0x5431db){return _0x5431db[_0xbe78('0x14')]()[_0xbe78('0x15')](function(){_0x18015b[_0xbe78('0xb')](0xcc)[_0xbe78('0xc')]();});}};}function handleEntityNotFound(_0x1a19b0){return function(_0x1a0f80){if(!_0x1a0f80){_0x1a19b0['sendStatus'](0x194);}return _0x1a0f80;};}function handleError(_0xa6b752,_0x49cf03){_0x49cf03=_0x49cf03||0x1f4;return function(_0x228a34){logger[_0xbe78('0x16')](_0x228a34[_0xbe78('0x17')]);if(_0x228a34[_0xbe78('0x18')]){delete _0x228a34[_0xbe78('0x18')];}_0xa6b752['status'](_0x49cf03)[_0xbe78('0x19')](_0x228a34);};}exports[_0xbe78('0x1a')]=function(_0x5c06f5,_0x4358f7){var _0x1a2e68={};var _0xe03f08=_['map'](db['OpenchannelInteraction']['rawAttributes'],function(_0x22457e){return{'name':_0x22457e[_0xbe78('0x1b')],'type':_0x22457e[_0xbe78('0x1c')][_0xbe78('0x1d')]};});_0x1a2e68=qs['getOptions'](_0xe03f08,_0x5c06f5);return interaction[_0xbe78('0x1e')]('openchannel',_0x5c06f5['query'],_0x5c06f5[_0xbe78('0x1f')],_0x1a2e68,_0xe03f08)[_0xbe78('0x15')](respondWithFilteredResult(_0x4358f7,_0x1a2e68))[_0xbe78('0x20')](handleError(_0x4358f7,null));};exports[_0xbe78('0x21')]=function(_0x2b4b2d,_0x4b09be){var _0x30a5a1={};if(_0x2b4b2d[_0xbe78('0x22')][_0xbe78('0x1c')]&&_0x2b4b2d[_0xbe78('0x22')]['type']===_0xbe78('0x23')){_0x30a5a1[_0xbe78('0x23')]=_0x2b4b2d[_0xbe78('0x24')]['id'];}else{_0x30a5a1['id']=_0x2b4b2d[_0xbe78('0x24')]['id'];}var _0x194a61={'raw':![],'where':_0x30a5a1},_0x23f512={};_0x23f512[_0xbe78('0x25')]=_[_0xbe78('0x26')](db[_0xbe78('0x27')][_0xbe78('0x28')]);_0x23f512[_0xbe78('0x22')]=_[_0xbe78('0x26')](_0x2b4b2d['query']);_0x23f512['filters']=_['intersection'](_0x23f512[_0xbe78('0x25')],_0x23f512[_0xbe78('0x22')]);_0x194a61[_0xbe78('0x29')]=_[_0xbe78('0x2a')](_0x23f512['model'],qs[_0xbe78('0x2b')](_0x2b4b2d[_0xbe78('0x22')][_0xbe78('0x2b')]));_0x194a61[_0xbe78('0x29')]=_0x194a61[_0xbe78('0x29')][_0xbe78('0x2c')]?_0x194a61[_0xbe78('0x29')]:_0x23f512[_0xbe78('0x25')];if(_0x2b4b2d[_0xbe78('0x22')][_0xbe78('0x2d')]){_0x194a61[_0xbe78('0x2e')]=[{'all':!![]}];}_0x194a61=_[_0xbe78('0x2f')]({},_0x194a61,_0x2b4b2d[_0xbe78('0x30')]);return db[_0xbe78('0x27')][_0xbe78('0x31')](_0x194a61)[_0xbe78('0x15')](handleEntityNotFound(_0x4b09be,null))[_0xbe78('0x15')](respondWithResult(_0x4b09be,null))['catch'](handleError(_0x4b09be,null));};exports['create']=function(_0xff3ed5,_0x2f4b70){return db[_0xbe78('0x27')][_0xbe78('0x32')](_0xff3ed5[_0xbe78('0x33')],{})['then'](respondWithResult(_0x2f4b70,0xc9))[_0xbe78('0x20')](handleError(_0x2f4b70,null));};exports['update']=function(_0x492abc,_0x424253){if(_0x492abc['body']['id']){delete _0x492abc[_0xbe78('0x33')]['id'];}return db[_0xbe78('0x27')]['find']({'where':{'id':_0x492abc['params']['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x424253,null))['then'](saveUpdates(_0x492abc['body'],null))[_0xbe78('0x15')](respondWithResult(_0x424253,null))[_0xbe78('0x20')](handleError(_0x424253,null));};exports[_0xbe78('0x14')]=function(_0x109afa,_0x4823ff){return db['OpenchannelInteraction'][_0xbe78('0x31')]({'where':{'id':_0x109afa['params']['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x4823ff,null))['then'](removeEntity(_0x4823ff,null))[_0xbe78('0x20')](handleError(_0x4823ff,null));};exports[_0xbe78('0x34')]=function(_0x11ae35,_0x1aed38){return db[_0xbe78('0x27')][_0xbe78('0x34')]()['then'](respondWithResult(_0x1aed38,null))['catch'](handleError(_0x1aed38,null));};exports[_0xbe78('0x35')]=function(_0x338743,_0x49b5ca){return db[_0xbe78('0x36')][_0xbe78('0x31')]({'where':{'id':_0x338743[_0xbe78('0x24')]['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x49b5ca,null))['then'](function(_0x277e6c){if(_0x277e6c){return _0x277e6c[_0xbe78('0x35')](_0x338743[_0xbe78('0x33')][_0xbe78('0x37')],_[_0xbe78('0x38')](_0x338743[_0xbe78('0x33')],[_0xbe78('0x37'),'id'])||{});}})['then'](respondWithResult(_0x49b5ca,null))[_0xbe78('0x20')](handleError(_0x49b5ca,null));};exports[_0xbe78('0x39')]=function(_0x21d6df,_0x597bf9){var _0x28dfbe={'raw':![],'where':{}};var _0x35dcbc={};var _0xa5ecdf={'count':0x0,'rows':[]};return db[_0xbe78('0x27')]['findOne']({'where':{'id':_0x21d6df[_0xbe78('0x24')]['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x597bf9,null))[_0xbe78('0x15')](function(_0x3d6cc2){if(_0x3d6cc2){_0x35dcbc[_0xbe78('0x25')]=_[_0xbe78('0x26')](db['OpenchannelMessage']['rawAttributes']);_0x35dcbc['query']=_[_0xbe78('0x26')](_0x21d6df['query']);_0x35dcbc[_0xbe78('0x3a')]=_[_0xbe78('0x2a')](_0x35dcbc[_0xbe78('0x25')],_0x35dcbc[_0xbe78('0x22')]);_0x28dfbe[_0xbe78('0x29')]=_[_0xbe78('0x2a')](_0x35dcbc['model'],qs['fields'](_0x21d6df[_0xbe78('0x22')][_0xbe78('0x2b')]));_0x28dfbe[_0xbe78('0x29')]=_0x28dfbe[_0xbe78('0x29')][_0xbe78('0x2c')]?_0x28dfbe[_0xbe78('0x29')]:_0x35dcbc[_0xbe78('0x25')];if(!_0x21d6df['query']['hasOwnProperty'](_0xbe78('0x3b'))){_0x28dfbe[_0xbe78('0x10')]=qs['limit'](_0x21d6df['query'][_0xbe78('0x10')]);_0x28dfbe[_0xbe78('0xe')]=qs[_0xbe78('0xe')](_0x21d6df['query'][_0xbe78('0xe')]);}_0x28dfbe[_0xbe78('0x3c')]=qs[_0xbe78('0x3d')](_0x21d6df[_0xbe78('0x22')][_0xbe78('0x3d')]);_0x28dfbe[_0xbe78('0x3e')]=qs[_0xbe78('0x3a')](_[_0xbe78('0x3f')](_0x21d6df['query'],_0x35dcbc[_0xbe78('0x3a')]));_0x28dfbe['where'][_0xbe78('0x40')]=_0x3d6cc2['id'];if(_0x21d6df['query'][_0xbe78('0x41')]){_0x28dfbe[_0xbe78('0x3e')]=_[_0xbe78('0x2f')](_0x28dfbe[_0xbe78('0x3e')],{'$or':_[_0xbe78('0x42')](_0x28dfbe[_0xbe78('0x29')],function(_0x4c2175){var _0x5e58eb={};_0x5e58eb[_0x4c2175]={'$like':'%'+_0x21d6df[_0xbe78('0x22')][_0xbe78('0x41')]+'%'};return _0x5e58eb;})});}if(_0x21d6df[_0xbe78('0x22')][_0xbe78('0x43')]){var _0xa36c5d=_0x21d6df[_0xbe78('0x22')]['$gte'][_0xbe78('0x44')](',');var _0x236924={};_0x236924[_0xa36c5d[0x0]]={'$gte':moment(_0xa36c5d[0x1])[_0xbe78('0x45')](_0xbe78('0x46'))};_0x28dfbe['where']=_[_0xbe78('0x2f')](_0x28dfbe[_0xbe78('0x3e')],_0x236924);}_0x28dfbe=_[_0xbe78('0x2f')]({},_0x28dfbe,_0x21d6df[_0xbe78('0x30')]);return db[_0xbe78('0x36')][_0xbe78('0x11')]({'where':_0x28dfbe[_0xbe78('0x3e')]})['then'](function(_0x114a01){_0xa5ecdf['count']=_0x114a01;if(_0x21d6df[_0xbe78('0x22')]['includeAll']){_0x28dfbe[_0xbe78('0x2e')]=[{'all':!![]}];}return db[_0xbe78('0x36')][_0xbe78('0x1e')](_0x28dfbe);})[_0xbe78('0x15')](function(_0x290ad5){_0xa5ecdf['rows']=_0x290ad5;return _0xa5ecdf;});}})[_0xbe78('0x15')](respondWithFilteredResult(_0x597bf9,_0x28dfbe))[_0xbe78('0x20')](handleError(_0x597bf9,null));};exports[_0xbe78('0x47')]=function(_0x464d4b,_0x3ca6e6){return db[_0xbe78('0x27')][_0xbe78('0x31')]({'where':{'id':_0x464d4b[_0xbe78('0x24')]['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x3ca6e6,null))[_0xbe78('0x15')](function(_0x12d6a2){if(_0x12d6a2){return _0x12d6a2[_0xbe78('0x48')](_0x464d4b[_0xbe78('0x33')][_0xbe78('0x37')],_[_0xbe78('0x38')](_0x464d4b[_0xbe78('0x33')],[_0xbe78('0x37'),'id'])||{})[_0xbe78('0x49')](function(){return db[_0xbe78('0x4a')][_0xbe78('0x1e')]({'attributes':['id',_0xbe78('0x18'),_0xbe78('0x4b')],'where':{'id':_0x464d4b['body'][_0xbe78('0x37')]}});})[_0xbe78('0x15')](function(_0x182369){socket[_0xbe78('0x4c')](_0xbe78('0x4d'),{'id':Number(_0x464d4b[_0xbe78('0x24')]['id']),'tags':_0x182369||[]});return{'id':Number(_0x464d4b[_0xbe78('0x24')]['id']),'tags':_0x182369||[]};});}})[_0xbe78('0x15')](respondWithResult(_0x3ca6e6,null))['catch'](handleError(_0x3ca6e6,null));};exports[_0xbe78('0x4e')]=function(_0x58b5d7,_0x38243a){return db[_0xbe78('0x27')][_0xbe78('0x31')]({'where':{'id':_0x58b5d7[_0xbe78('0x24')]['id']}})[_0xbe78('0x15')](handleEntityNotFound(_0x38243a,null))[_0xbe78('0x15')](function(_0x4efc66){if(_0x4efc66){return _0x4efc66['removeTags'](_0x58b5d7['query']['ids']);}})[_0xbe78('0x15')](respondWithStatusCode(_0x38243a,null))[_0xbe78('0x20')](handleError(_0x38243a,null));};exports[_0xbe78('0x4f')]=function(_0xa78df1,_0xd083f){var _0x1e05dc=moment()[_0xbe78('0x50')]()['toString']();var _0xf6372e=path[_0xbe78('0x51')](config['root'],_0xbe78('0x52'),_0xbe78('0x53'),_0xbe78('0x54'));var _0x20b731=path[_0xbe78('0x51')](config[_0xbe78('0x55')],_0xbe78('0x52'),'files','attachments');var _0x352e7f=path[_0xbe78('0x51')](_0xf6372e,_0x1e05dc);var _0x2be0e2=util[_0xbe78('0x45')](_0xbe78('0x56'),_0xa78df1[_0xbe78('0x24')]['id'],_0x1e05dc);var _0x339bf9=path[_0xbe78('0x51')](_0xf6372e,_0x2be0e2);var _0x54c3c3=[];_0x54c3c3[_0xbe78('0x57')]({'model':db[_0xbe78('0x58')],'as':_0xbe78('0x58'),'attributes':['id',_0xbe78('0x59')],'raw':!![]});_0x54c3c3[_0xbe78('0x57')]({'model':db['CmContact'],'as':_0xbe78('0x5a'),'attributes':['id',_0xbe78('0x5b'),_0xbe78('0x5c')],'raw':!![]});if(_0xa78df1[_0xbe78('0x22')]['attachments']){_0x54c3c3['push']({'model':db['Attachment'],'as':_0xbe78('0x5d'),'raw':!![]});}var _0x4fcc32=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xbe78('0x33'),_0xbe78('0x5e'),_0xbe78('0x5f'),_0xbe78('0x60'),'read'],'include':_0x54c3c3}];_0x4fcc32[_0xbe78('0x57')]({'model':db[_0xbe78('0x61')],'as':'Account','attributes':['id','name']});_0x4fcc32[_0xbe78('0x57')]({'model':db[_0xbe78('0x58')],'as':_0xbe78('0x62'),'attributes':['id',_0xbe78('0x59')]});return db[_0xbe78('0x27')]['find']({'where':{'id':_0xa78df1[_0xbe78('0x24')]['id']},'include':_0x4fcc32})[_0xbe78('0x15')](handleEntityNotFound(_0xd083f,null))[_0xbe78('0x15')](function(_0x5e242e){if(_0x5e242e){var _0x5b7c09=_0x5e242e[_0xbe78('0x63')]({'plain':!![]});fs['mkdirSync'](_0x352e7f);var _0x547985={'channel':_0xbe78('0x64'),'account':_0x5b7c09[_0xbe78('0x65')]['name'],'agent':_0x5b7c09[_0xbe78('0x62')]?_0x5b7c09['Owner'][_0xbe78('0x59')]:_0xbe78('0x66'),'createdAt':moment(_0x5b7c09[_0xbe78('0x5e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbe78('0x67')](),'closedAt':_0x5b7c09[_0xbe78('0x68')]?moment(_0x5b7c09[_0xbe78('0x69')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbe78('0x67')]():'','disposition':_0x5b7c09['disposition'],'visibility':_0x5b7c09[_0xbe78('0x6a')]?_0xbe78('0x6b'):'Private','messages':_(_0x5b7c09[_0xbe78('0x6c')])[_0xbe78('0x41')]({'secret':![]})['map'](function(_0x208a97){if(_0x208a97[_0xbe78('0x5d')]){var _0x1a00d8=path['join'](_0x20b731,_0x208a97['Attachment']['basename']);if(fs[_0xbe78('0x6d')](_0x1a00d8)){fs[_0xbe78('0x6e')](_0x1a00d8)['pipe'](fs['createWriteStream'](path[_0xbe78('0x51')](_0x352e7f,_0x208a97[_0xbe78('0x5d')][_0xbe78('0x6f')])));}}return{'date':moment(_0x208a97[_0xbe78('0x5e')])[_0xbe78('0x45')](_0xbe78('0x46'))[_0xbe78('0x67')](),'sender':_0x208a97[_0xbe78('0x5f')]===_0xbe78('0x70')?_0x208a97['User']?_0x208a97[_0xbe78('0x58')][_0xbe78('0x59')]:_0xbe78('0x71'):_0x208a97['Contact'][_0xbe78('0x5b')]+(_0x208a97[_0xbe78('0x5a')][_0xbe78('0x5c')]?'\x20'+_0x208a97[_0xbe78('0x5a')]['lastName']:''),'body':_0x208a97[_0xbe78('0x5d')]?_0x208a97[_0xbe78('0x5d')]['basename']:_0x208a97[_0xbe78('0x33')],'direction':_0x208a97[_0xbe78('0x5f')]===_0xbe78('0x70')?'A':'C','secret':_0x208a97[_0xbe78('0x60')],'read':_0x208a97[_0xbe78('0x72')],'attachment':_0x208a97[_0xbe78('0x5d')]};})[_0xbe78('0x73')]()};return ejs[_0xbe78('0x74')](path['join'](config[_0xbe78('0x55')],_0xbe78('0x52'),'views','downloadInteraction.ejs'),{'interaction':_0x547985})['then'](function(_0x5c0961){var _0x3ef14d=path[_0xbe78('0x51')](_0x352e7f,_0xbe78('0x75')+_0x5b7c09['id']+'-'+_0x1e05dc+_0xbe78('0x76'));var _0x1a8b2a={'path':_0x3ef14d,'channel':'Openchannel','interactionId':_0x5b7c09['id']};return pdf[_0xbe78('0x77')](_0x5c0961,_0x1a8b2a);})[_0xbe78('0x15')](function(){return new Promise(function(_0x2391ff,_0x2327d9){zipdir(_0x352e7f,{'saveTo':_0x339bf9},function(_0x1b9f3f,_0x30a986){if(_0x1b9f3f)return _0x2327d9(_0x1b9f3f);return _0x2391ff(_0x30a986);});})['then'](function(){return new Promise(function(_0x439c58,_0x34f6b8){rimraf(_0x352e7f,function(_0xee0170){if(_0xee0170)_0x34f6b8(_0xee0170);return _0x439c58();});});})[_0xbe78('0x15')](function(){return _0xd083f[_0xbe78('0x4f')](_0x339bf9,_0x2be0e2,function(_0x583700){if(_0x583700){logger[_0xbe78('0x16')](_0xbe78('0x78'),_0x583700);}else{fs['unlinkSync'](_0x339bf9);}});});});}else{return _0xd083f[_0xbe78('0xa')](0xc8);}})['catch'](handleError(_0xd083f,null));};
\ No newline at end of file
index 1ba214d..12f6558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeafd=['getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x5de973,_0x1e475e){var _0x1dcb54=function(_0x15e778){while(--_0x15e778){_0x5de973['push'](_0x5de973['shift']());}};_0x1dcb54(++_0x1e475e);}(_0xeafd,0x12d));var _0xdeaf=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xeafd[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xdeaf('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xdeaf('0x0'))['db'][_0xdeaf('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdeaf('0x2')](0x0);var events={'afterCreate':_0xdeaf('0x3'),'afterUpdate':_0xdeaf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c1114){return function(_0x1468a6,_0x164425,_0x37af8c){_0x1468a6[_0xdeaf('0x5')]({'attributes':['id'],'raw':!![]})[_0xdeaf('0x6')](function(_0x25a2f0){_0x1468a6['setDataValue'](_0xdeaf('0x7'),_0x25a2f0[_0xdeaf('0x8')](function(_0x3020cc){return{'id':_0x3020cc['id']};}));return OpenchannelMessage[_0xdeaf('0x9')]({'where':{'OpenchannelInteractionId':_0x1468a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdeaf('0x6')](function(_0x377c78){_0x1468a6[_0xdeaf('0xa')]('unreadMessages',_0x377c78[_0xdeaf('0xb')]);OpenchannelInteractionEvents[_0xdeaf('0xc')](_0x4c1114+':'+_0x1468a6['id'],_0x1468a6);OpenchannelInteractionEvents[_0xdeaf('0xc')](_0x4c1114,_0x1468a6);_0x37af8c(null);})[_0xdeaf('0xd')](_0x37af8c(null));};}for(var e in events){if(events[_0xdeaf('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xdeaf('0xf')](e,emitEvent(event));}}module[_0xdeaf('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xed4b=['save','update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x490913,_0x3ebb7e){var _0x51f799=function(_0x28137e){while(--_0x28137e){_0x490913['push'](_0x490913['shift']());}};_0x51f799(++_0x3ebb7e);}(_0xed4b,0xa6));var _0xbed4=function(_0x448bed,_0x2288a1){_0x448bed=_0x448bed-0x0;var _0x2d49e8=_0xed4b[_0x448bed];return _0x2d49e8;};'use strict';var EventEmitter=require(_0xbed4('0x0'));var OpenchannelInteraction=require(_0xbed4('0x1'))['db'][_0xbed4('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xbed4('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xbed4('0x4')](0x0);var events={'afterCreate':_0xbed4('0x5'),'afterUpdate':_0xbed4('0x6'),'afterDestroy':_0xbed4('0x7')};function emitEvent(_0x4e3f8c){return function(_0x533728,_0x2f2433,_0x240025){_0x533728[_0xbed4('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4b5412){_0x533728[_0xbed4('0x9')](_0xbed4('0xa'),_0x4b5412['map'](function(_0x1eafdf){return{'id':_0x1eafdf['id']};}));return OpenchannelMessage[_0xbed4('0xb')]({'where':{'OpenchannelInteractionId':_0x533728['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbed4('0xc')](function(_0x1099e9){_0x533728[_0xbed4('0x9')](_0xbed4('0xd'),_0x1099e9[_0xbed4('0xe')]);OpenchannelInteractionEvents[_0xbed4('0xf')](_0x4e3f8c+':'+_0x533728['id'],_0x533728);OpenchannelInteractionEvents[_0xbed4('0xf')](_0x4e3f8c,_0x533728);_0x240025(null);})[_0xbed4('0x10')](_0x240025(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xbed4('0x11')](e,emitEvent(event));}}module[_0xbed4('0x12')]=OpenchannelInteractionEvents;
\ No newline at end of file
index ab5c646..341c600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1415=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','format','lodash'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1415,0x1ca));var _0x5141=function(_0x5c8b8b,_0x4b98b0){_0x5c8b8b=_0x5c8b8b-0x0;var _0x4dd0b3=_0x1415[_0x5c8b8b];return _0x4dd0b3;};'use strict';var _=require(_0x5141('0x0'));var util=require(_0x5141('0x1'));var logger=require(_0x5141('0x2'))(_0x5141('0x3'));var moment=require('moment');var BPromise=require(_0x5141('0x4'));var rp=require(_0x5141('0x5'));var fs=require('fs');var path=require(_0x5141('0x6'));var rimraf=require(_0x5141('0x7'));var config=require(_0x5141('0x8'));var attributes=require(_0x5141('0x9'));module[_0x5141('0xa')]=function(_0x4ef42f,_0x29d3ca){return _0x4ef42f[_0x5141('0xb')](_0x5141('0xc'),attributes,{'tableName':_0x5141('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5141('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x483a1b,_0x213a58,_0x3aa20d){if(_0x483a1b['changed'](_0x5141('0xf'))){_0x483a1b['closedAt']=moment()[_0x5141('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3aa20d(null,_0x483a1b);}}});};
\ No newline at end of file
+var _0xfbbf=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4_unicode_ci','changed','closed','format'];(function(_0x792a03,_0x454a14){var _0x4d31ff=function(_0xb3ed1d){while(--_0xb3ed1d){_0x792a03['push'](_0x792a03['shift']());}};_0x4d31ff(++_0x454a14);}(_0xfbbf,0x78));var _0xffbb=function(_0x7bef4a,_0x32b64d){_0x7bef4a=_0x7bef4a-0x0;var _0x5c882f=_0xfbbf[_0x7bef4a];return _0x5c882f;};'use strict';var _=require(_0xffbb('0x0'));var util=require(_0xffbb('0x1'));var logger=require(_0xffbb('0x2'))(_0xffbb('0x3'));var moment=require(_0xffbb('0x4'));var BPromise=require(_0xffbb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xffbb('0x6'));var attributes=require(_0xffbb('0x7'));module[_0xffbb('0x8')]=function(_0x3f9b73,_0x5ba426){return _0x3f9b73[_0xffbb('0x9')](_0xffbb('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xffbb('0xb'),'hooks':{'beforeUpdate':function(_0x1f8fe4,_0x4445fe,_0x262369){if(_0x1f8fe4[_0xffbb('0xc')](_0xffbb('0xd'))){_0x1f8fe4['closedAt']=moment()[_0xffbb('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x262369(null,_0x1f8fe4);}}});};
\ No newline at end of file
index 30d3bc9..6708bb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x568c=['addTags','body','ids','omit','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','then','AddTagsToOpenchannelInteraction','find'];(function(_0x3a8695,_0x311d43){var _0x184da3=function(_0xb39902){while(--_0xb39902){_0x3a8695['push'](_0x3a8695['shift']());}};_0x184da3(++_0x311d43);}(_0x568c,0x191));var _0xc568=function(_0x12b530,_0xfebce5){_0x12b530=_0x12b530-0x0;var _0x469024=_0x568c[_0x12b530];return _0x469024;};'use strict';var _=require('lodash');var util=require(_0xc568('0x0'));var moment=require(_0xc568('0x1'));var BPromise=require('bluebird');var rs=require(_0xc568('0x2'));var fs=require('fs');var Redis=require(_0xc568('0x3'));var db=require(_0xc568('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc568('0x5'))(_0xc568('0x6'));var config=require(_0xc568('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc568('0x8')]['http']({'port':0x232a});config[_0xc568('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc568('0xa'))[_0xc568('0xb')](socket);function respondWithRpcPromise(_0x1d93f1,_0x295c12,_0x3e86f3){return new BPromise(function(_0x32d928,_0x5c4883){return client[_0xc568('0xc')](_0x1d93f1,_0x3e86f3)['then'](function(_0x5aaf1b){logger[_0xc568('0xd')](_0xc568('0xe'),_0x295c12,'request\x20sent');logger[_0xc568('0xf')](_0xc568('0x10'),_0x295c12,_0xc568('0x11'),JSON[_0xc568('0x12')](_0x5aaf1b));if(_0x5aaf1b['error']){if(_0x5aaf1b[_0xc568('0x13')]['code']===0x1f4){logger[_0xc568('0x13')](_0xc568('0xe'),_0x295c12,_0x5aaf1b[_0xc568('0x13')][_0xc568('0x14')]);return _0x5c4883(_0x5aaf1b['error']['message']);}logger[_0xc568('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x295c12,_0x5aaf1b[_0xc568('0x13')][_0xc568('0x14')]);return _0x32d928(_0x5aaf1b[_0xc568('0x13')][_0xc568('0x14')]);}else{logger[_0xc568('0xd')]('OpenchannelInteraction,\x20%s,\x20%s',_0x295c12,_0xc568('0x11'));_0x32d928(_0x5aaf1b[_0xc568('0x15')][_0xc568('0x14')]);}})[_0xc568('0x16')](function(_0xcd96d6){logger[_0xc568('0x13')](_0xc568('0xe'),_0x295c12,_0xcd96d6);_0x5c4883(_0xcd96d6);});});}exports[_0xc568('0x17')]=function(_0x44f72d){var _0x6694a9=this;return new Promise(function(_0x33f815,_0x456e2c){return db[_0xc568('0x18')][_0xc568('0x19')](_0x44f72d['body'],{'raw':_0x44f72d[_0xc568('0x1a')]?_0x44f72d[_0xc568('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f72d['options']?_0x44f72d[_0xc568('0x1a')][_0xc568('0x1b')]||null:null,'attributes':_0x44f72d[_0xc568('0x1a')]?_0x44f72d[_0xc568('0x1a')]['attributes']||null:null,'limit':_0x44f72d[_0xc568('0x1a')]?_0x44f72d[_0xc568('0x1a')]['limit']||null:null})[_0xc568('0x1c')](function(_0x2b9615){logger[_0xc568('0xd')](_0xc568('0x17'),_0x44f72d);logger[_0xc568('0xf')]('UpdateOpenchannelInteraction',_0x44f72d,JSON[_0xc568('0x12')](_0x2b9615));_0x33f815(_0x2b9615);})['catch'](function(_0x24cf5b){logger[_0xc568('0x13')](_0xc568('0x17'),_0x24cf5b[_0xc568('0x14')],_0x44f72d);_0x456e2c(_0x6694a9[_0xc568('0x13')](0x1f4,_0x24cf5b[_0xc568('0x14')]));});});};exports[_0xc568('0x1d')]=function(_0x2e196b){return new Promise(function(_0x1e06e7,_0x530ae6){return db['OpenchannelInteraction'][_0xc568('0x1e')]({'where':_0x2e196b[_0xc568('0x1a')]?_0x2e196b['options']['where']||null:null})['then'](function(_0x1209d0){if(_0x1209d0){return _0x1209d0[_0xc568('0x1f')](_0x2e196b[_0xc568('0x20')][_0xc568('0x21')],_[_0xc568('0x22')](_0x2e196b['body'],[_0xc568('0x21'),'id'])||{});}})['spread'](function(_0x9cfa76){logger['info'](_0xc568('0x23'),_0x2e196b);logger[_0xc568('0xf')](_0xc568('0x23'),_0x2e196b,JSON['stringify'](_0x9cfa76));_0x1e06e7(_0x9cfa76);})[_0xc568('0x16')](function(_0x385139){logger[_0xc568('0x13')](_0xc568('0x23'),_0x385139[_0xc568('0x14')],_0x2e196b);_0x530ae6(_this['error'](0x1f4,_0x385139[_0xc568('0x14')]));});});};
\ No newline at end of file
+var _0x47e6=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','where','attributes','limit','info','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','ids','omit','AddTags','lodash','util'];(function(_0x51d58b,_0x4da011){var _0x4210b9=function(_0x59abf5){while(--_0x59abf5){_0x51d58b['push'](_0x51d58b['shift']());}};_0x4210b9(++_0x4da011);}(_0x47e6,0xcb));var _0x647e=function(_0x49e271,_0x571947){_0x49e271=_0x49e271-0x0;var _0x4d8aa0=_0x47e6[_0x49e271];return _0x4d8aa0;};'use strict';var _=require(_0x647e('0x0'));var util=require(_0x647e('0x1'));var moment=require(_0x647e('0x2'));var BPromise=require(_0x647e('0x3'));var rs=require(_0x647e('0x4'));var fs=require('fs');var Redis=require(_0x647e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x647e('0x6'))(_0x647e('0x7'));var config=require('../../config/environment');var jayson=require(_0x647e('0x8'));var client=jayson[_0x647e('0x9')][_0x647e('0xa')]({'port':0x232a});config['redis']=_[_0x647e('0xb')](config[_0x647e('0xc')],{'host':_0x647e('0xd'),'port':0x18eb});var socket=require(_0x647e('0xe'))(new Redis(config[_0x647e('0xc')]));require('./openchannelInteraction.socket')[_0x647e('0xf')](socket);function respondWithRpcPromise(_0x4b131b,_0x47856e,_0x285473){return new BPromise(function(_0x5a820b,_0x1278cb){return client[_0x647e('0x10')](_0x4b131b,_0x285473)[_0x647e('0x11')](function(_0x8ceae3){logger['info'](_0x647e('0x12'),_0x47856e,_0x647e('0x13'));logger[_0x647e('0x14')](_0x647e('0x15'),_0x47856e,'request\x20sent',JSON[_0x647e('0x16')](_0x8ceae3));if(_0x8ceae3[_0x647e('0x17')]){if(_0x8ceae3['error'][_0x647e('0x18')]===0x1f4){logger[_0x647e('0x17')](_0x647e('0x12'),_0x47856e,_0x8ceae3[_0x647e('0x17')]['message']);return _0x1278cb(_0x8ceae3[_0x647e('0x17')][_0x647e('0x19')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x47856e,_0x8ceae3['error'][_0x647e('0x19')]);return _0x5a820b(_0x8ceae3['error'][_0x647e('0x19')]);}else{logger['info'](_0x647e('0x12'),_0x47856e,_0x647e('0x13'));_0x5a820b(_0x8ceae3[_0x647e('0x1a')][_0x647e('0x19')]);}})[_0x647e('0x1b')](function(_0x4c038f){logger['error'](_0x647e('0x12'),_0x47856e,_0x4c038f);_0x1278cb(_0x4c038f);});});}exports['UpdateOpenchannelInteraction']=function(_0x55f468){var _0x52d700=this;return new Promise(function(_0x452cd6,_0x60e181){return db['OpenchannelInteraction']['update'](_0x55f468[_0x647e('0x1c')],{'raw':_0x55f468[_0x647e('0x1d')]?_0x55f468['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f468[_0x647e('0x1d')]?_0x55f468[_0x647e('0x1d')][_0x647e('0x1e')]||null:null,'attributes':_0x55f468['options']?_0x55f468[_0x647e('0x1d')][_0x647e('0x1f')]||null:null,'limit':_0x55f468[_0x647e('0x1d')]?_0x55f468['options'][_0x647e('0x20')]||null:null})[_0x647e('0x11')](function(_0x2c60b5){logger[_0x647e('0x21')](_0x647e('0x22'),_0x55f468);logger['debug'](_0x647e('0x22'),_0x55f468,JSON[_0x647e('0x16')](_0x2c60b5));_0x452cd6(_0x2c60b5);})[_0x647e('0x1b')](function(_0x2444f6){logger[_0x647e('0x17')](_0x647e('0x22'),_0x2444f6[_0x647e('0x19')],_0x55f468);_0x60e181(_0x52d700[_0x647e('0x17')](0x1f4,_0x2444f6[_0x647e('0x19')]));});});};exports[_0x647e('0x23')]=function(_0xc9da5e){return new Promise(function(_0x371d3c,_0x44833c){return db[_0x647e('0x24')]['find']({'where':_0xc9da5e['options']?_0xc9da5e[_0x647e('0x1d')][_0x647e('0x1e')]||null:null})[_0x647e('0x11')](function(_0x556403){if(_0x556403){return _0x556403[_0x647e('0x25')](_0xc9da5e['body'][_0x647e('0x26')],_[_0x647e('0x27')](_0xc9da5e['body'],[_0x647e('0x26'),'id'])||{});}})['spread'](function(_0x4704af){logger[_0x647e('0x21')](_0x647e('0x28'),_0xc9da5e);logger[_0x647e('0x14')]('AddTags',_0xc9da5e,JSON[_0x647e('0x16')](_0x4704af));_0x371d3c(_0x4704af);})[_0x647e('0x1b')](function(_0x3a7edf){logger[_0x647e('0x17')](_0x647e('0x28'),_0x3a7edf[_0x647e('0x19')],_0xc9da5e);_0x44833c(_this[_0x647e('0x17')](0x1f4,_0x3a7edf[_0x647e('0x19')]));});});};
\ No newline at end of file
index e5074d7..cb39130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb56b=['openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','removeListener','length'];(function(_0x53ef2e,_0x2abcfc){var _0x3f4384=function(_0x5aeeff){while(--_0x5aeeff){_0x53ef2e['push'](_0x53ef2e['shift']());}};_0x3f4384(++_0x2abcfc);}(_0xb56b,0x158));var _0xbb56=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0xb56b[_0x303862];return _0xe6f228;};'use strict';var OpenchannelInteractionEvents=require(_0xbb56('0x0'));var events=[_0xbb56('0x1'),_0xbb56('0x2'),'update'];function createListener(_0x24703e,_0x26c25a){return function(_0x565018){_0x26c25a[_0xbb56('0x3')](_0x24703e,_0x565018);};}function removeListener(_0x9f6e42,_0x2e1cd6){return function(){OpenchannelInteractionEvents[_0xbb56('0x4')](_0x9f6e42,_0x2e1cd6);};}exports['register']=function(_0x30d685){for(var _0x35d3b2=0x0,_0x5e80c0=events[_0xbb56('0x5')];_0x35d3b2<_0x5e80c0;_0x35d3b2++){var _0x616a92=events[_0x35d3b2];var _0x389b0c=createListener(_0xbb56('0x6')+_0x616a92,_0x30d685);OpenchannelInteractionEvents['on'](_0x616a92,_0x389b0c);}};
\ No newline at end of file
+var _0x3578=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x4ac134,_0x5c8cd2){var _0x4c4c09=function(_0x4384f6){while(--_0x4384f6){_0x4ac134['push'](_0x4ac134['shift']());}};_0x4c4c09(++_0x5c8cd2);}(_0x3578,0x1cb));var _0x8357=function(_0x43b4b5,_0x3efc1b){_0x43b4b5=_0x43b4b5-0x0;var _0x2df432=_0x3578[_0x43b4b5];return _0x2df432;};'use strict';var OpenchannelInteractionEvents=require(_0x8357('0x0'));var events=[_0x8357('0x1'),_0x8357('0x2'),_0x8357('0x3')];function createListener(_0x3b62f,_0x4336c1){return function(_0x1cd593){_0x4336c1[_0x8357('0x4')](_0x3b62f,_0x1cd593);};}function removeListener(_0x24a867,_0x3dcc0a){return function(){OpenchannelInteractionEvents[_0x8357('0x5')](_0x24a867,_0x3dcc0a);};}exports[_0x8357('0x6')]=function(_0x13f826){for(var _0x17af4f=0x0,_0x739436=events[_0x8357('0x7')];_0x17af4f<_0x739436;_0x17af4f++){var _0x137812=events[_0x17af4f];var _0x5ccccf=createListener(_0x8357('0x8')+_0x137812,_0x13f826);OpenchannelInteractionEvents['on'](_0x137812,_0x5ccccf);}};
\ No newline at end of file
index 45ae64f..b371345 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x47b5f8,_0x2d2d6f){_0x47b5f8=_0x47b5f8-0x0;var _0x3aba65=_0x70e0[_0x47b5f8];return _0x3aba65;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0xa756a3,_0x51445f){var _0xfd50f=function(_0x422a69){while(--_0x422a69){_0xa756a3['push'](_0xa756a3['shift']());}};_0xfd50f(++_0x51445f);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index f9f9bd2..c0c9a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1619=['ENUM','out','STRING','TEXT','BOOLEAN'];(function(_0x7e1b6b,_0x4ad71d){var _0x2b086f=function(_0x5c24de){while(--_0x5c24de){_0x7e1b6b['push'](_0x7e1b6b['shift']());}};_0x2b086f(++_0x4ad71d);}(_0x1619,0x189));var _0x9161=function(_0x3fd875,_0x4cc07e){_0x3fd875=_0x3fd875-0x0;var _0x30f849=_0x1619[_0x3fd875];return _0x30f849;};'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 _0x235a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3653c7,_0xadb356){var _0x58a021=function(_0x20b237){while(--_0x20b237){_0x3653c7['push'](_0x3653c7['shift']());}};_0x58a021(++_0xadb356);}(_0x235a,0x1ef));var _0xa235=function(_0xf444b0,_0x56bdc7){_0xf444b0=_0xf444b0-0x0;var _0x16458d=_0x235a[_0xf444b0];return _0x16458d;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'body':{'type':Sequelize[_0xa235('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa235('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa235('0x4')]('in',_0xa235('0x5')),'defaultValue':_0xa235('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa235('0x6')]},'providerName':{'type':Sequelize[_0xa235('0x7')]},'providerResponse':{'type':Sequelize[_0xa235('0x2')]}};
\ No newline at end of file
index b28e2d1..2cecb02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d4=['intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','update','body','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','user','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','SELECT','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','./openchannelMessage.socket','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','keys','query','filters','attributes'];(function(_0x588643,_0x7c16d){var _0x3ef987=function(_0x2366d8){while(--_0x2366d8){_0x588643['push'](_0x588643['shift']());}};_0x3ef987(++_0x7c16d);}(_0x89d4,0xc1));var _0x489d=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x89d4[_0x1d558c];return _0x15767d;};'use strict';var emlformat=require(_0x489d('0x0'));var rimraf=require(_0x489d('0x1'));var zipdir=require(_0x489d('0x2'));var jsonpatch=require(_0x489d('0x3'));var rp=require(_0x489d('0x4'));var moment=require('moment');var BPromise=require(_0x489d('0x5'));var Mustache=require('mustache');var util=require(_0x489d('0x6'));var path=require(_0x489d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x489d('0x8'));var fs=require('fs');var fs_extra=require(_0x489d('0x9'));var _=require(_0x489d('0xa'));var squel=require(_0x489d('0xb'));var crypto=require('crypto');var jsforce=require(_0x489d('0xc'));var deskjs=require(_0x489d('0xd'));var toCsv=require(_0x489d('0xe'));var querystring=require(_0x489d('0xf'));var Papa=require(_0x489d('0x10'));var Redis=require('ioredis');var authService=require(_0x489d('0x11'));var qs=require(_0x489d('0x12'));var as=require(_0x489d('0x13'));var hardwareService=require(_0x489d('0x14'));var logger=require(_0x489d('0x15'))(_0x489d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x489d('0x17'));var db=require(_0x489d('0x18'))['db'];config[_0x489d('0x19')]=_[_0x489d('0x1a')](config[_0x489d('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x489d('0x19')]));require(_0x489d('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x489d('0x1c')][_0x489d('0x1d')]({'port':0x232c});var client9002=jayson[_0x489d('0x1c')][_0x489d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1791b4,_0x284e66,_0x3a8ae9,_0x3c54d0){return new BPromise(function(_0x319d11,_0x29bc86){var _0x23b0ce=_0x3c54d0||client;return _0x23b0ce[_0x489d('0x1e')](_0x1791b4,_0x3a8ae9)[_0x489d('0x1f')](function(_0x4e7f7b){logger[_0x489d('0x20')](_0x489d('0x21'),_0x284e66,_0x489d('0x22'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x284e66,_0x489d('0x22'),JSON['stringify'](_0x4e7f7b));if(_0x4e7f7b[_0x489d('0x23')]){if(_0x4e7f7b[_0x489d('0x23')][_0x489d('0x24')]===0x1f4){logger[_0x489d('0x23')](_0x489d('0x21'),_0x284e66,_0x4e7f7b[_0x489d('0x23')][_0x489d('0x25')]);return _0x29bc86(_0x4e7f7b[_0x489d('0x23')]['message']);}logger['error'](_0x489d('0x21'),_0x284e66,_0x4e7f7b[_0x489d('0x23')][_0x489d('0x25')]);return _0x319d11(_0x4e7f7b[_0x489d('0x23')][_0x489d('0x25')]);}else{logger['info'](_0x489d('0x21'),_0x284e66,_0x489d('0x22'));_0x319d11(_0x4e7f7b[_0x489d('0x26')][_0x489d('0x25')]);}})[_0x489d('0x27')](function(_0xde3b98){logger[_0x489d('0x23')](_0x489d('0x21'),_0x284e66,_0xde3b98);_0x29bc86(_0xde3b98);});});}function respondWithStatusCode(_0x54194e,_0x224796){_0x224796=_0x224796||0xcc;return function(_0x15de93){if(_0x15de93){return _0x54194e['sendStatus'](_0x224796);}return _0x54194e[_0x489d('0x28')](_0x224796)[_0x489d('0x29')]();};}function respondWithResult(_0x4bbb37,_0x45c4ad){_0x45c4ad=_0x45c4ad||0xc8;return function(_0x5693ce){if(_0x5693ce){return _0x4bbb37[_0x489d('0x28')](_0x45c4ad)[_0x489d('0x2a')](_0x5693ce);}};}function respondWithFilteredResult(_0x373002,_0x262ce6){return function(_0xd9ede9){if(_0xd9ede9){var _0xd7e446=typeof _0x262ce6[_0x489d('0x2b')]===_0x489d('0x2c')&&typeof _0x262ce6[_0x489d('0x2d')]===_0x489d('0x2c');var _0xcb0d5d=_0xd9ede9[_0x489d('0x2e')];var _0x5e65a3=_0xd7e446?0x0:_0x262ce6[_0x489d('0x2b')];var _0xc7e472=_0xd7e446?_0xd9ede9[_0x489d('0x2e')]:_0x262ce6['offset']+_0x262ce6[_0x489d('0x2d')];var _0x1f8404;if(_0xc7e472>=_0xcb0d5d){_0xc7e472=_0xcb0d5d;_0x1f8404=0xc8;}else{_0x1f8404=0xce;}_0x373002[_0x489d('0x28')](_0x1f8404);return _0x373002[_0x489d('0x2f')]('Content-Range',_0x5e65a3+'-'+_0xc7e472+'/'+_0xcb0d5d)[_0x489d('0x2a')](_0xd9ede9);}return null;};}function patchUpdates(_0x3f48f3){return function(_0x24686c){try{jsonpatch[_0x489d('0x30')](_0x24686c,_0x3f48f3,!![]);}catch(_0x11b388){return BPromise[_0x489d('0x31')](_0x11b388);}return _0x24686c[_0x489d('0x32')]();};}function saveUpdates(_0x2aafca,_0x10911e){return function(_0x293116){if(_0x293116){return _0x293116['update'](_0x2aafca)[_0x489d('0x1f')](function(_0x1ae43d){return _0x1ae43d;});}return null;};}function removeEntity(_0xcea914,_0x4a7d40){return function(_0x35459b){if(_0x35459b){return _0x35459b[_0x489d('0x33')]()[_0x489d('0x1f')](function(){_0xcea914[_0x489d('0x28')](0xcc)[_0x489d('0x29')]();});}};}function handleEntityNotFound(_0x46aed5,_0x24a4ea){return function(_0x38ae40){if(!_0x38ae40){_0x46aed5[_0x489d('0x34')](0x194);}return _0x38ae40;};}function handleError(_0x56abd6,_0x4b0f89){_0x4b0f89=_0x4b0f89||0x1f4;return function(_0x213d8a){logger[_0x489d('0x23')](_0x213d8a[_0x489d('0x35')]);if(_0x213d8a[_0x489d('0x36')]){delete _0x213d8a[_0x489d('0x36')];}_0x56abd6[_0x489d('0x28')](_0x4b0f89)[_0x489d('0x37')](_0x213d8a);};}exports[_0x489d('0x38')]=function(_0x539d87,_0xb7b453){var _0x177124={},_0x441816={},_0x28c77={'count':0x0,'rows':[]};var _0x512c0d=_[_0x489d('0x39')](db[_0x489d('0x3a')][_0x489d('0x3b')],function(_0x49faaf){return{'name':_0x49faaf[_0x489d('0x3c')],'type':_0x49faaf['type'][_0x489d('0x3d')]};});_0x441816[_0x489d('0x3e')]=_[_0x489d('0x39')](_0x512c0d,'name');_0x441816['query']=_[_0x489d('0x3f')](_0x539d87[_0x489d('0x40')]);_0x441816[_0x489d('0x41')]=_['intersection'](_0x441816[_0x489d('0x3e')],_0x441816['query']);_0x177124[_0x489d('0x42')]=_[_0x489d('0x43')](_0x441816['model'],qs[_0x489d('0x44')](_0x539d87[_0x489d('0x40')][_0x489d('0x44')]));_0x177124['attributes']=_0x177124[_0x489d('0x42')][_0x489d('0x45')]?_0x177124['attributes']:_0x441816['model'];if(!_0x539d87[_0x489d('0x40')][_0x489d('0x46')]('nolimit')){_0x177124[_0x489d('0x2d')]=qs['limit'](_0x539d87[_0x489d('0x40')][_0x489d('0x2d')]);_0x177124['offset']=qs[_0x489d('0x2b')](_0x539d87['query'][_0x489d('0x2b')]);}_0x177124[_0x489d('0x47')]=qs[_0x489d('0x48')](_0x539d87['query'][_0x489d('0x48')]);_0x177124[_0x489d('0x49')]=qs[_0x489d('0x41')](_[_0x489d('0x4a')](_0x539d87[_0x489d('0x40')],_0x441816['filters']),_0x512c0d);if(_0x539d87[_0x489d('0x40')]['filter']){_0x177124[_0x489d('0x49')]=_[_0x489d('0x4b')](_0x177124[_0x489d('0x49')],{'$or':_['map'](_0x512c0d,function(_0x284c7e){if(_0x284c7e['type']!==_0x489d('0x4c')){var _0x41e0bd={};_0x41e0bd[_0x284c7e[_0x489d('0x36')]]={'$like':'%'+_0x539d87[_0x489d('0x40')][_0x489d('0x4d')]+'%'};return _0x41e0bd;}})});}_0x177124=_[_0x489d('0x4b')]({},_0x177124,_0x539d87[_0x489d('0x4e')]);var _0xb11997={'where':_0x177124[_0x489d('0x49')]};return db[_0x489d('0x3a')]['count'](_0xb11997)['then'](function(_0x206f21){_0x28c77[_0x489d('0x2e')]=_0x206f21;if(_0x539d87[_0x489d('0x40')][_0x489d('0x4f')]){_0x177124[_0x489d('0x50')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x489d('0x51')](_0x177124);})[_0x489d('0x1f')](function(_0x40fad){_0x28c77[_0x489d('0x52')]=_0x40fad;return _0x28c77;})[_0x489d('0x1f')](respondWithFilteredResult(_0xb7b453,_0x177124))['catch'](handleError(_0xb7b453,null));};exports[_0x489d('0x53')]=function(_0x1f8905,_0x2f59d3){var _0x2ed5ec={'raw':!![],'where':{'id':_0x1f8905[_0x489d('0x54')]['id']}},_0x56bdc6={};_0x56bdc6[_0x489d('0x3e')]=_[_0x489d('0x3f')](db['OpenchannelMessage'][_0x489d('0x3b')]);_0x56bdc6[_0x489d('0x40')]=_[_0x489d('0x3f')](_0x1f8905[_0x489d('0x40')]);_0x56bdc6[_0x489d('0x41')]=_[_0x489d('0x43')](_0x56bdc6[_0x489d('0x3e')],_0x56bdc6[_0x489d('0x40')]);_0x2ed5ec['attributes']=_[_0x489d('0x43')](_0x56bdc6['model'],qs[_0x489d('0x44')](_0x1f8905[_0x489d('0x40')]['fields']));_0x2ed5ec[_0x489d('0x42')]=_0x2ed5ec[_0x489d('0x42')][_0x489d('0x45')]?_0x2ed5ec[_0x489d('0x42')]:_0x56bdc6[_0x489d('0x3e')];if(_0x1f8905[_0x489d('0x40')]['includeAll']){_0x2ed5ec[_0x489d('0x50')]=[{'all':!![]}];}_0x2ed5ec=_[_0x489d('0x4b')]({},_0x2ed5ec,_0x1f8905['options']);return db[_0x489d('0x3a')][_0x489d('0x55')](_0x2ed5ec)[_0x489d('0x1f')](handleEntityNotFound(_0x2f59d3,null))[_0x489d('0x1f')](respondWithResult(_0x2f59d3,null))[_0x489d('0x27')](handleError(_0x2f59d3,null));};exports[_0x489d('0x56')]=function(_0x1ed985,_0x217def){return db[_0x489d('0x3a')]['create'](_0x1ed985['body'],{})[_0x489d('0x1f')](respondWithResult(_0x217def,0xc9))[_0x489d('0x27')](handleError(_0x217def,null));};exports[_0x489d('0x57')]=function(_0x1b204d,_0x258da8){if(_0x1b204d['body']['id']){delete _0x1b204d[_0x489d('0x58')]['id'];}return db[_0x489d('0x3a')][_0x489d('0x55')]({'where':{'id':_0x1b204d[_0x489d('0x54')]['id']}})[_0x489d('0x1f')](handleEntityNotFound(_0x258da8,null))[_0x489d('0x1f')](saveUpdates(_0x1b204d[_0x489d('0x58')],null))['then'](respondWithResult(_0x258da8,null))['catch'](handleError(_0x258da8,null));};exports[_0x489d('0x33')]=function(_0x2cecb6,_0x2cd653){return db['OpenchannelMessage'][_0x489d('0x55')]({'where':{'id':_0x2cecb6[_0x489d('0x54')]['id']}})[_0x489d('0x1f')](handleEntityNotFound(_0x2cd653,null))[_0x489d('0x1f')](removeEntity(_0x2cd653,null))[_0x489d('0x27')](handleError(_0x2cd653,null));};exports[_0x489d('0x59')]=function(_0x2f2cbf,_0x28d12f){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x28d12f,null))[_0x489d('0x27')](handleError(_0x28d12f,null));};var interaction_log=require(_0x489d('0x15'))(_0x489d('0x5a'));exports[_0x489d('0x5b')]=function(_0x3cef55,_0x31550d,_0x3389eb){var _0x4ff7be={'agent':{},'channel':'openchannel'};if(_0x3cef55['body']['id']){delete _0x3cef55['body']['id'];}_0x3cef55['body'][_0x489d('0x5c')]=!![];_0x3cef55[_0x489d('0x58')][_0x489d('0x5d')]=moment()[_0x489d('0x5e')](_0x489d('0x5f'));_0x3cef55['body'][_0x489d('0x60')]=_0x3cef55[_0x489d('0x58')][_0x489d('0x60')]||_0x3cef55['user']['id'];_0x4ff7be[_0x489d('0x61')]['id']=_0x3cef55[_0x489d('0x58')]['UserId'];return db[_0x489d('0x3a')]['find']({'where':{'id':_0x3cef55[_0x489d('0x54')]['id'],'UserId':null}})[_0x489d('0x1f')](handleEntityNotFound(_0x31550d,null))['then'](saveUpdates(_0x3cef55['body'],null))['then'](function(_0x432516){if(_0x432516){_0x4ff7be[_0x489d('0x25')]=_0x432516[_0x489d('0x62')]({'plain':!![]});return db[_0x489d('0x63')][_0x489d('0x55')]({'where':{'id':_0x432516[_0x489d('0x64')]}});}return null;})[_0x489d('0x1f')](handleEntityNotFound(_0x31550d,null))[_0x489d('0x1f')](function(_0x1abff6){if(_0x1abff6){return _0x1abff6['update']({'UserId':_0x3cef55[_0x489d('0x58')]['UserId'],'read1stAt':_['isNil'](_0x1abff6[_0x489d('0x65')])?moment()[_0x489d('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x489d('0x1f')](function(_0x2111e3){if(_0x2111e3){_0x4ff7be[_0x489d('0x66')]=_0x2111e3['get']({'plain':!![]});interaction_log[_0x489d('0x20')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cef55['user']['id'],_0x3cef55[_0x489d('0x67')][_0x489d('0x36')],_0x3cef55['user']['role'],_0x4ff7be['interaction']['id'],_0x3cef55[_0x489d('0x58')]?JSON[_0x489d('0x68')](_0x3cef55[_0x489d('0x58')]):_0x489d('0x69'));return respondWithRpcPromise(_0x489d('0x6a'),'acceptMessage',_0x4ff7be);}return null;})['then'](function(_0x784fd9){var _0x1c5934=_0x489d('0x6b')+_0x784fd9[_0x489d('0x25')]['ContactId'];return db[_0x489d('0x6c')]['query'](_0x1c5934,{'type':db[_0x489d('0x6d')][_0x489d('0x6e')]['SELECT'],'raw':!![]})[_0x489d('0x1f')](function(_0x5b376d){return _0x5b376d;});})[_0x489d('0x1f')](function(_0x3665c0){if(_0x3665c0){_0x4ff7be['message'][_0x489d('0x6f')]=_0x3665c0[0x0];if(!_0x3cef55[_0x489d('0x58')][_0x489d('0x60')])return;return db[_0x489d('0x70')][_0x489d('0x55')]({'where':{'id':_0x3cef55['body'][_0x489d('0x60')],'role':_0x489d('0x61')},'attributes':['id',_0x489d('0x36'),_0x489d('0x71'),_0x489d('0x72'),_0x489d('0x73')],'raw':!![]});}return null;})[_0x489d('0x1f')](function(_0x24998a){if(!_0x24998a)return null;_0x4ff7be[_0x489d('0x25')][_0x489d('0x61')]=_0x24998a;return _0x4ff7be;})[_0x489d('0x1f')](function(_0x17ced2){if(_0x17ced2){if(_0x3cef55[_0x489d('0x58')][_0x489d('0x74')]){_0x4ff7be['message'][_0x489d('0x75')]=util[_0x489d('0x5e')](_0x489d('0x76'),_0x3cef55[_0x489d('0x67')][_0x489d('0x36')]);_0x4ff7be[_0x489d('0x25')][_0x489d('0x77')]=_0x4ff7be[_0x489d('0x77')];_0x4ff7be[_0x489d('0x25')][_0x489d('0x78')]=_0x4ff7be[_0x489d('0x77')];_0x4ff7be[_0x489d('0x25')][_0x489d('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x489d('0x7a'),'message':_0x4ff7be['message']},client9002)['then'](function(){return _0x4ff7be;});}return _0x4ff7be;}return null;})['then'](respondWithResult(_0x31550d,null))['catch'](handleError(_0x31550d,null));};var interaction_log=require('../../config/logger')(_0x489d('0x5a'));exports['reject']=function(_0x1c35bf,_0x36b79b,_0x2205a6){var _0x1ef03e={'agent':{},'channel':_0x489d('0x7b')};if(_0x1c35bf[_0x489d('0x58')]['id']){delete _0x1c35bf['body']['id'];}_0x1c35bf[_0x489d('0x58')]['UserId']=_0x1c35bf['body'][_0x489d('0x60')]||_0x1c35bf['user']['id'];_0x1ef03e['agent']['id']=_0x1c35bf[_0x489d('0x58')]['UserId'];return db[_0x489d('0x3a')]['find']({'where':{'id':_0x1c35bf[_0x489d('0x54')]['id'],'UserId':null}})[_0x489d('0x1f')](handleEntityNotFound(_0x36b79b,null))[_0x489d('0x1f')](function(_0x70767c){if(_0x70767c){_0x1ef03e[_0x489d('0x25')]=_0x70767c['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x70767c[_0x489d('0x64')]}});}return null;})[_0x489d('0x1f')](handleEntityNotFound(_0x36b79b,null))[_0x489d('0x1f')](function(_0x256f74){if(_0x256f74){_0x1ef03e[_0x489d('0x66')]=_0x256f74[_0x489d('0x62')]({'plain':!![]});interaction_log[_0x489d('0x20')](_0x489d('0x7c'),_0x1c35bf[_0x489d('0x67')]['id'],_0x1c35bf[_0x489d('0x67')][_0x489d('0x36')],_0x1c35bf[_0x489d('0x67')]['role'],_0x1ef03e[_0x489d('0x66')]['id'],_0x1c35bf['body']?JSON[_0x489d('0x68')](_0x1c35bf[_0x489d('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0x489d('0x7d'),_0x1ef03e);}return null;})[_0x489d('0x1f')](function(_0x514494){var _0xcf4ace=_0x489d('0x6b')+_0x514494[_0x489d('0x25')][_0x489d('0x7e')];return db[_0x489d('0x6c')][_0x489d('0x40')](_0xcf4ace,{'type':db['Sequelize'][_0x489d('0x6e')][_0x489d('0x7f')],'raw':!![]})[_0x489d('0x1f')](function(_0x2c9900){return _0x2c9900;});})['then'](function(_0x12e5e0){if(_0x12e5e0){_0x1ef03e[_0x489d('0x25')]['contact']=_0x12e5e0[0x0];if(!_0x1c35bf[_0x489d('0x58')]['UserId'])return;return db[_0x489d('0x70')][_0x489d('0x55')]({'where':{'id':_0x1c35bf[_0x489d('0x58')]['UserId'],'role':_0x489d('0x61')},'attributes':['id','name',_0x489d('0x71'),_0x489d('0x72'),_0x489d('0x73')],'raw':!![]});}return null;})[_0x489d('0x1f')](function(_0x481590){if(!_0x481590)return null;_0x1ef03e[_0x489d('0x25')]['agent']=_0x481590;return _0x1ef03e;})[_0x489d('0x1f')](function(_0x245611){if(_0x245611){_0x245611[_0x489d('0x25')]['interface']=util['format'](_0x489d('0x76'),_0x1c35bf[_0x489d('0x67')][_0x489d('0x36')]);_0x245611[_0x489d('0x25')][_0x489d('0x77')]=_0x1ef03e[_0x489d('0x77')];_0x245611[_0x489d('0x25')][_0x489d('0x78')]=_0x1ef03e[_0x489d('0x77')];_0x245611[_0x489d('0x25')][_0x489d('0x79')]=_0x489d('0x31');respondWithRpcPromise(_0x489d('0x80'),_0x489d('0x80'),{'event':_0x489d('0x81'),'message':_0x245611[_0x489d('0x25')]},client9002);return _0x1ef03e;}return null;})[_0x489d('0x1f')](respondWithResult(_0x36b79b,null))[_0x489d('0x27')](handleError(_0x36b79b,null));};
\ No newline at end of file
+var _0xc826=['find','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','contact','interface','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','stack','name','index','map','OpenchannelMessage','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','rawAttributes','length','include','options','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0xc826,0x12e));var _0x6c82=function(_0x4bd45f,_0x2a966c){_0x4bd45f=_0x4bd45f-0x0;var _0x4cc2e4=_0xc826[_0x4bd45f];return _0x4cc2e4;};'use strict';var emlformat=require(_0x6c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c82('0x1'));var jsonpatch=require(_0x6c82('0x2'));var rp=require(_0x6c82('0x3'));var moment=require(_0x6c82('0x4'));var BPromise=require(_0x6c82('0x5'));var Mustache=require(_0x6c82('0x6'));var util=require(_0x6c82('0x7'));var path=require(_0x6c82('0x8'));var sox=require(_0x6c82('0x9'));var csv=require('to-csv');var ejs=require(_0x6c82('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c82('0xb'));var squel=require(_0x6c82('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6c82('0xd'));var toCsv=require(_0x6c82('0xe'));var querystring=require(_0x6c82('0xf'));var Papa=require(_0x6c82('0x10'));var Redis=require(_0x6c82('0x11'));var authService=require(_0x6c82('0x12'));var qs=require(_0x6c82('0x13'));var as=require(_0x6c82('0x14'));var hardwareService=require(_0x6c82('0x15'));var logger=require(_0x6c82('0x16'))(_0x6c82('0x17'));var utils=require(_0x6c82('0x18'));var config=require(_0x6c82('0x19'));var licenseUtil=require(_0x6c82('0x1a'));var db=require(_0x6c82('0x1b'))['db'];config['redis']=_['defaults'](config[_0x6c82('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c82('0x1d'))(new Redis(config[_0x6c82('0x1c')]));require(_0x6c82('0x1e'))[_0x6c82('0x1f')](socket);var jayson=require(_0x6c82('0x20'));var client=jayson[_0x6c82('0x21')][_0x6c82('0x22')]({'port':0x232c});var client9002=jayson[_0x6c82('0x21')][_0x6c82('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2b3721,_0x500fe0,_0x4d2ad0,_0xa9851b){return new BPromise(function(_0x1484cd,_0x370cb5){var _0x146eec=_0xa9851b||client;return _0x146eec[_0x6c82('0x23')](_0x2b3721,_0x4d2ad0)['then'](function(_0x26b62a){logger[_0x6c82('0x24')](_0x6c82('0x25'),_0x500fe0,_0x6c82('0x26'));logger[_0x6c82('0x27')](_0x6c82('0x28'),_0x500fe0,'request\x20sent',JSON['stringify'](_0x26b62a));if(_0x26b62a[_0x6c82('0x29')]){if(_0x26b62a[_0x6c82('0x29')][_0x6c82('0x2a')]===0x1f4){logger[_0x6c82('0x29')](_0x6c82('0x25'),_0x500fe0,_0x26b62a['error'][_0x6c82('0x2b')]);return _0x370cb5(_0x26b62a[_0x6c82('0x29')][_0x6c82('0x2b')]);}logger[_0x6c82('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x500fe0,_0x26b62a[_0x6c82('0x29')][_0x6c82('0x2b')]);return _0x1484cd(_0x26b62a['error'][_0x6c82('0x2b')]);}else{logger[_0x6c82('0x24')](_0x6c82('0x25'),_0x500fe0,_0x6c82('0x26'));_0x1484cd(_0x26b62a[_0x6c82('0x2c')][_0x6c82('0x2b')]);}})[_0x6c82('0x2d')](function(_0xa2f02a){logger['error'](_0x6c82('0x25'),_0x500fe0,_0xa2f02a);_0x370cb5(_0xa2f02a);});});}function respondWithStatusCode(_0x3d671a,_0x1dac37){_0x1dac37=_0x1dac37||0xcc;return function(_0x3f9cc2){if(_0x3f9cc2){return _0x3d671a[_0x6c82('0x2e')](_0x1dac37);}return _0x3d671a[_0x6c82('0x2f')](_0x1dac37)[_0x6c82('0x30')]();};}function respondWithResult(_0x4c06b4,_0x50d660){_0x50d660=_0x50d660||0xc8;return function(_0x52b7c0){if(_0x52b7c0){return _0x4c06b4[_0x6c82('0x2f')](_0x50d660)['json'](_0x52b7c0);}};}function respondWithFilteredResult(_0x18e332,_0x4c1bf2){return function(_0x522938){if(_0x522938){var _0x43b999=typeof _0x4c1bf2[_0x6c82('0x31')]===_0x6c82('0x32')&&typeof _0x4c1bf2[_0x6c82('0x33')]==='undefined';var _0x31b9f2=_0x522938['count'];var _0x32ba07=_0x43b999?0x0:_0x4c1bf2['offset'];var _0x39eba7=_0x43b999?_0x522938[_0x6c82('0x34')]:_0x4c1bf2[_0x6c82('0x31')]+_0x4c1bf2[_0x6c82('0x33')];var _0x1b8e47;if(_0x39eba7>=_0x31b9f2){_0x39eba7=_0x31b9f2;_0x1b8e47=0xc8;}else{_0x1b8e47=0xce;}_0x18e332['status'](_0x1b8e47);return _0x18e332[_0x6c82('0x35')]('Content-Range',_0x32ba07+'-'+_0x39eba7+'/'+_0x31b9f2)[_0x6c82('0x36')](_0x522938);}return null;};}function patchUpdates(_0x4772b6){return function(_0x40d714){try{jsonpatch[_0x6c82('0x37')](_0x40d714,_0x4772b6,!![]);}catch(_0x58293b){return BPromise[_0x6c82('0x38')](_0x58293b);}return _0x40d714['save']();};}function saveUpdates(_0x574c1d,_0x127fd7){return function(_0x5c2a01){if(_0x5c2a01){return _0x5c2a01[_0x6c82('0x39')](_0x574c1d)[_0x6c82('0x3a')](function(_0x3a1a5c){return _0x3a1a5c;});}return null;};}function removeEntity(_0x506931,_0x35555a){return function(_0x8c6637){if(_0x8c6637){return _0x8c6637[_0x6c82('0x3b')]()['then'](function(){_0x506931[_0x6c82('0x2f')](0xcc)[_0x6c82('0x30')]();});}};}function handleEntityNotFound(_0x286fb0,_0x45cf93){return function(_0x535552){if(!_0x535552){_0x286fb0[_0x6c82('0x2e')](0x194);}return _0x535552;};}function handleError(_0x2d5f55,_0x4411db){_0x4411db=_0x4411db||0x1f4;return function(_0x2eb52c){logger[_0x6c82('0x29')](_0x2eb52c[_0x6c82('0x3c')]);if(_0x2eb52c[_0x6c82('0x3d')]){delete _0x2eb52c[_0x6c82('0x3d')];}_0x2d5f55[_0x6c82('0x2f')](_0x4411db)['send'](_0x2eb52c);};}exports[_0x6c82('0x3e')]=function(_0x167b98,_0x31ab7c){var _0x4fc853={},_0x2fe324={},_0x3508aa={'count':0x0,'rows':[]};var _0x40c930=_[_0x6c82('0x3f')](db[_0x6c82('0x40')]['rawAttributes'],function(_0x430e7b){return{'name':_0x430e7b[_0x6c82('0x41')],'type':_0x430e7b[_0x6c82('0x42')][_0x6c82('0x43')]};});_0x2fe324[_0x6c82('0x44')]=_[_0x6c82('0x3f')](_0x40c930,_0x6c82('0x3d'));_0x2fe324['query']=_[_0x6c82('0x45')](_0x167b98[_0x6c82('0x46')]);_0x2fe324[_0x6c82('0x47')]=_[_0x6c82('0x48')](_0x2fe324['model'],_0x2fe324[_0x6c82('0x46')]);_0x4fc853['attributes']=_[_0x6c82('0x48')](_0x2fe324[_0x6c82('0x44')],qs[_0x6c82('0x49')](_0x167b98[_0x6c82('0x46')][_0x6c82('0x49')]));_0x4fc853[_0x6c82('0x4a')]=_0x4fc853[_0x6c82('0x4a')]['length']?_0x4fc853[_0x6c82('0x4a')]:_0x2fe324['model'];if(!_0x167b98[_0x6c82('0x46')]['hasOwnProperty']('nolimit')){_0x4fc853[_0x6c82('0x33')]=qs[_0x6c82('0x33')](_0x167b98['query'][_0x6c82('0x33')]);_0x4fc853[_0x6c82('0x31')]=qs[_0x6c82('0x31')](_0x167b98[_0x6c82('0x46')][_0x6c82('0x31')]);}_0x4fc853[_0x6c82('0x4b')]=qs[_0x6c82('0x4c')](_0x167b98[_0x6c82('0x46')][_0x6c82('0x4c')]);_0x4fc853[_0x6c82('0x4d')]=qs['filters'](_[_0x6c82('0x4e')](_0x167b98['query'],_0x2fe324[_0x6c82('0x47')]),_0x40c930);if(_0x167b98[_0x6c82('0x46')][_0x6c82('0x4f')]){_0x4fc853[_0x6c82('0x4d')]=_['merge'](_0x4fc853[_0x6c82('0x4d')],{'$or':_[_0x6c82('0x3f')](_0x40c930,function(_0x49ff68){if(_0x49ff68[_0x6c82('0x42')]!==_0x6c82('0x50')){var _0xa20671={};_0xa20671[_0x49ff68[_0x6c82('0x3d')]]={'$like':'%'+_0x167b98['query'][_0x6c82('0x4f')]+'%'};return _0xa20671;}})});}_0x4fc853=_[_0x6c82('0x51')]({},_0x4fc853,_0x167b98['options']);var _0x1afcf1={'where':_0x4fc853[_0x6c82('0x4d')]};return db[_0x6c82('0x40')][_0x6c82('0x34')](_0x1afcf1)['then'](function(_0x21c865){_0x3508aa[_0x6c82('0x34')]=_0x21c865;if(_0x167b98[_0x6c82('0x46')][_0x6c82('0x52')]){_0x4fc853['include']=[{'all':!![]}];}return db[_0x6c82('0x40')][_0x6c82('0x53')](_0x4fc853);})[_0x6c82('0x3a')](function(_0xad9134){_0x3508aa[_0x6c82('0x54')]=_0xad9134;return _0x3508aa;})['then'](respondWithFilteredResult(_0x31ab7c,_0x4fc853))[_0x6c82('0x2d')](handleError(_0x31ab7c,null));};exports[_0x6c82('0x55')]=function(_0x53c5f3,_0x2ce77e){var _0x5368a2={'raw':!![],'where':{'id':_0x53c5f3[_0x6c82('0x56')]['id']}},_0x2d7b41={};_0x2d7b41[_0x6c82('0x44')]=_[_0x6c82('0x45')](db['OpenchannelMessage'][_0x6c82('0x57')]);_0x2d7b41[_0x6c82('0x46')]=_['keys'](_0x53c5f3[_0x6c82('0x46')]);_0x2d7b41[_0x6c82('0x47')]=_[_0x6c82('0x48')](_0x2d7b41[_0x6c82('0x44')],_0x2d7b41[_0x6c82('0x46')]);_0x5368a2[_0x6c82('0x4a')]=_[_0x6c82('0x48')](_0x2d7b41[_0x6c82('0x44')],qs[_0x6c82('0x49')](_0x53c5f3[_0x6c82('0x46')]['fields']));_0x5368a2['attributes']=_0x5368a2[_0x6c82('0x4a')][_0x6c82('0x58')]?_0x5368a2[_0x6c82('0x4a')]:_0x2d7b41[_0x6c82('0x44')];if(_0x53c5f3['query'][_0x6c82('0x52')]){_0x5368a2[_0x6c82('0x59')]=[{'all':!![]}];}_0x5368a2=_[_0x6c82('0x51')]({},_0x5368a2,_0x53c5f3[_0x6c82('0x5a')]);return db[_0x6c82('0x40')]['find'](_0x5368a2)['then'](handleEntityNotFound(_0x2ce77e,null))[_0x6c82('0x3a')](respondWithResult(_0x2ce77e,null))['catch'](handleError(_0x2ce77e,null));};exports[_0x6c82('0x5b')]=function(_0x5c5e42,_0x55a90b){return db[_0x6c82('0x40')][_0x6c82('0x5b')](_0x5c5e42['body'],{})[_0x6c82('0x3a')](respondWithResult(_0x55a90b,0xc9))[_0x6c82('0x2d')](handleError(_0x55a90b,null));};exports['update']=function(_0x36d36f,_0x10e8c6){if(_0x36d36f[_0x6c82('0x5c')]['id']){delete _0x36d36f[_0x6c82('0x5c')]['id'];}return db[_0x6c82('0x40')]['find']({'where':{'id':_0x36d36f[_0x6c82('0x56')]['id']}})[_0x6c82('0x3a')](handleEntityNotFound(_0x10e8c6,null))[_0x6c82('0x3a')](saveUpdates(_0x36d36f[_0x6c82('0x5c')],null))[_0x6c82('0x3a')](respondWithResult(_0x10e8c6,null))[_0x6c82('0x2d')](handleError(_0x10e8c6,null));};exports[_0x6c82('0x3b')]=function(_0x3edf23,_0x41c37b){return db[_0x6c82('0x40')]['find']({'where':{'id':_0x3edf23[_0x6c82('0x56')]['id']}})[_0x6c82('0x3a')](handleEntityNotFound(_0x41c37b,null))[_0x6c82('0x3a')](removeEntity(_0x41c37b,null))['catch'](handleError(_0x41c37b,null));};exports[_0x6c82('0x5d')]=function(_0x23907d,_0x3dd6de){return db[_0x6c82('0x40')][_0x6c82('0x5d')]()['then'](respondWithResult(_0x3dd6de,null))[_0x6c82('0x2d')](handleError(_0x3dd6de,null));};var interaction_log=require('../../config/logger')(_0x6c82('0x5e'));exports[_0x6c82('0x5f')]=function(_0x11698e,_0x437d72,_0x58ccc9){var _0x516fd5={'agent':{},'channel':_0x6c82('0x60')};if(_0x11698e[_0x6c82('0x5c')]['id']){delete _0x11698e[_0x6c82('0x5c')]['id'];}_0x11698e[_0x6c82('0x5c')][_0x6c82('0x61')]=!![];_0x11698e[_0x6c82('0x5c')][_0x6c82('0x62')]=moment()[_0x6c82('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x11698e['body'][_0x6c82('0x64')]=_0x11698e[_0x6c82('0x5c')][_0x6c82('0x64')]||_0x11698e[_0x6c82('0x65')]['id'];_0x516fd5[_0x6c82('0x66')]['id']=_0x11698e['body']['UserId'];return db['OpenchannelMessage'][_0x6c82('0x67')]({'where':{'id':_0x11698e['params']['id'],'UserId':null}})[_0x6c82('0x3a')](handleEntityNotFound(_0x437d72,null))[_0x6c82('0x3a')](saveUpdates(_0x11698e[_0x6c82('0x5c')],null))[_0x6c82('0x3a')](function(_0x131dcf){if(_0x131dcf){_0x516fd5[_0x6c82('0x2b')]=_0x131dcf[_0x6c82('0x68')]({'plain':!![]});return db[_0x6c82('0x69')]['find']({'where':{'id':_0x131dcf['OpenchannelInteractionId']}});}return null;})[_0x6c82('0x3a')](handleEntityNotFound(_0x437d72,null))['then'](function(_0xa1ff54){if(_0xa1ff54){return _0xa1ff54[_0x6c82('0x39')]({'UserId':_0x11698e[_0x6c82('0x5c')][_0x6c82('0x64')],'read1stAt':_[_0x6c82('0x6a')](_0xa1ff54[_0x6c82('0x6b')])?moment()[_0x6c82('0x63')](_0x6c82('0x6c')):undefined});}return null;})[_0x6c82('0x3a')](function(_0x302e06){if(_0x302e06){_0x516fd5[_0x6c82('0x6d')]=_0x302e06[_0x6c82('0x68')]({'plain':!![]});interaction_log[_0x6c82('0x24')](_0x6c82('0x6e'),_0x11698e[_0x6c82('0x65')]['id'],_0x11698e[_0x6c82('0x65')][_0x6c82('0x3d')],_0x11698e[_0x6c82('0x65')][_0x6c82('0x6f')],_0x516fd5['interaction']['id'],_0x11698e[_0x6c82('0x5c')]?JSON['stringify'](_0x11698e['body']):'null');return respondWithRpcPromise(_0x6c82('0x70'),_0x6c82('0x71'),_0x516fd5);}return null;})[_0x6c82('0x3a')](function(_0x14b0e9){var _0x3a07ba=_0x6c82('0x72')+_0x14b0e9['message'][_0x6c82('0x73')];return db[_0x6c82('0x74')][_0x6c82('0x46')](_0x3a07ba,{'type':db[_0x6c82('0x75')][_0x6c82('0x76')][_0x6c82('0x77')],'raw':!![]})['then'](function(_0x21b227){return _0x21b227;});})[_0x6c82('0x3a')](function(_0x38ca0b){if(_0x38ca0b){_0x516fd5[_0x6c82('0x2b')]['contact']=_0x38ca0b[0x0];if(!_0x11698e[_0x6c82('0x5c')][_0x6c82('0x64')])return;return db[_0x6c82('0x78')][_0x6c82('0x67')]({'where':{'id':_0x11698e[_0x6c82('0x5c')][_0x6c82('0x64')],'role':_0x6c82('0x66')},'attributes':['id',_0x6c82('0x3d'),_0x6c82('0x79'),_0x6c82('0x7a'),_0x6c82('0x7b')],'raw':!![]});}return null;})[_0x6c82('0x3a')](function(_0x390f98){if(!_0x390f98)return null;_0x516fd5[_0x6c82('0x2b')][_0x6c82('0x66')]=_0x390f98;return _0x516fd5;})['then'](function(_0x3fb8eb){if(_0x3fb8eb){if(_0x11698e[_0x6c82('0x5c')]['manual']){_0x516fd5[_0x6c82('0x2b')]['interface']=util['format'](_0x6c82('0x7c'),_0x11698e[_0x6c82('0x65')][_0x6c82('0x3d')]);_0x516fd5[_0x6c82('0x2b')][_0x6c82('0x7d')]=_0x516fd5[_0x6c82('0x7d')];_0x516fd5[_0x6c82('0x2b')][_0x6c82('0x7e')]=_0x516fd5[_0x6c82('0x7d')];_0x516fd5[_0x6c82('0x2b')][_0x6c82('0x7f')]=_0x6c82('0x5f');return respondWithRpcPromise(_0x6c82('0x80'),'EventManager',{'event':_0x6c82('0x81'),'message':_0x516fd5[_0x6c82('0x2b')]},client9002)[_0x6c82('0x3a')](function(){return _0x516fd5;});}return _0x516fd5;}return null;})[_0x6c82('0x3a')](respondWithResult(_0x437d72,null))[_0x6c82('0x2d')](handleError(_0x437d72,null));};var interaction_log=require(_0x6c82('0x16'))('openchannel-interactions');exports[_0x6c82('0x38')]=function(_0x1eb26c,_0x369186,_0x47a0da){var _0x9bd63a={'agent':{},'channel':_0x6c82('0x60')};if(_0x1eb26c[_0x6c82('0x5c')]['id']){delete _0x1eb26c['body']['id'];}_0x1eb26c[_0x6c82('0x5c')][_0x6c82('0x64')]=_0x1eb26c[_0x6c82('0x5c')]['UserId']||_0x1eb26c['user']['id'];_0x9bd63a['agent']['id']=_0x1eb26c[_0x6c82('0x5c')]['UserId'];return db['OpenchannelMessage'][_0x6c82('0x67')]({'where':{'id':_0x1eb26c[_0x6c82('0x56')]['id'],'UserId':null}})[_0x6c82('0x3a')](handleEntityNotFound(_0x369186,null))['then'](function(_0x4bea48){if(_0x4bea48){_0x9bd63a[_0x6c82('0x2b')]=_0x4bea48[_0x6c82('0x68')]({'plain':!![]});return db[_0x6c82('0x69')][_0x6c82('0x67')]({'where':{'id':_0x4bea48['OpenchannelInteractionId']}});}return null;})[_0x6c82('0x3a')](handleEntityNotFound(_0x369186,null))[_0x6c82('0x3a')](function(_0x3a29c3){if(_0x3a29c3){_0x9bd63a[_0x6c82('0x6d')]=_0x3a29c3[_0x6c82('0x68')]({'plain':!![]});interaction_log[_0x6c82('0x24')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1eb26c['user']['id'],_0x1eb26c[_0x6c82('0x65')][_0x6c82('0x3d')],_0x1eb26c[_0x6c82('0x65')][_0x6c82('0x6f')],_0x9bd63a[_0x6c82('0x6d')]['id'],_0x1eb26c[_0x6c82('0x5c')]?JSON['stringify'](_0x1eb26c[_0x6c82('0x5c')]):'null');return respondWithRpcPromise(_0x6c82('0x82'),_0x6c82('0x83'),_0x9bd63a);}return null;})[_0x6c82('0x3a')](function(_0x456117){var _0x67cccd=_0x6c82('0x72')+_0x456117[_0x6c82('0x2b')]['ContactId'];return db[_0x6c82('0x74')][_0x6c82('0x46')](_0x67cccd,{'type':db[_0x6c82('0x75')][_0x6c82('0x76')]['SELECT'],'raw':!![]})[_0x6c82('0x3a')](function(_0x2d8132){return _0x2d8132;});})[_0x6c82('0x3a')](function(_0x5b4aac){if(_0x5b4aac){_0x9bd63a[_0x6c82('0x2b')][_0x6c82('0x84')]=_0x5b4aac[0x0];if(!_0x1eb26c[_0x6c82('0x5c')][_0x6c82('0x64')])return;return db['User'][_0x6c82('0x67')]({'where':{'id':_0x1eb26c['body']['UserId'],'role':_0x6c82('0x66')},'attributes':['id',_0x6c82('0x3d'),_0x6c82('0x79'),'email',_0x6c82('0x7b')],'raw':!![]});}return null;})[_0x6c82('0x3a')](function(_0x1b3e1a){if(!_0x1b3e1a)return null;_0x9bd63a[_0x6c82('0x2b')]['agent']=_0x1b3e1a;return _0x9bd63a;})[_0x6c82('0x3a')](function(_0x2ac125){if(_0x2ac125){_0x2ac125[_0x6c82('0x2b')][_0x6c82('0x85')]=util[_0x6c82('0x63')](_0x6c82('0x7c'),_0x1eb26c['user'][_0x6c82('0x3d')]);_0x2ac125[_0x6c82('0x2b')][_0x6c82('0x7d')]=_0x9bd63a[_0x6c82('0x7d')];_0x2ac125[_0x6c82('0x2b')]['motionChannel']=_0x9bd63a[_0x6c82('0x7d')];_0x2ac125[_0x6c82('0x2b')][_0x6c82('0x7f')]=_0x6c82('0x38');respondWithRpcPromise(_0x6c82('0x80'),'EventManager',{'event':_0x6c82('0x86'),'message':_0x2ac125[_0x6c82('0x2b')]},client9002);return _0x9bd63a;}return null;})[_0x6c82('0x3a')](respondWithResult(_0x369186,null))[_0x6c82('0x2d')](handleError(_0x369186,null));};
\ No newline at end of file
index c91cb04..fd9cd9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9de8=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x41559f,_0x203227){var _0x29fc62=function(_0x4f52cc){while(--_0x4f52cc){_0x41559f['push'](_0x41559f['shift']());}};_0x29fc62(++_0x203227);}(_0x9de8,0x127));var _0x89de=function(_0x364023,_0x4e58b6){_0x364023=_0x364023-0x0;var _0x1a415f=_0x9de8[_0x364023];return _0x1a415f;};'use strict';var EventEmitter=require(_0x89de('0x0'));var OpenchannelMessage=require(_0x89de('0x1'))['db'][_0x89de('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x89de('0x3')](0x0);var events={'afterCreate':_0x89de('0x4'),'afterUpdate':_0x89de('0x5'),'afterDestroy':_0x89de('0x6')};function emitEvent(_0x1de9c9){return function(_0x1b02ec,_0x29a771,_0x3384f7){OpenchannelMessageEvents[_0x89de('0x7')](_0x1de9c9+':'+_0x1b02ec['id'],_0x1b02ec);OpenchannelMessageEvents[_0x89de('0x7')](_0x1de9c9,_0x1b02ec);_0x3384f7(null);};}for(var e in events){if(events[_0x89de('0x8')](e)){var event=events[e];OpenchannelMessage[_0x89de('0x9')](e,emitEvent(event));}}module[_0x89de('0xa')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x30a7=['../../mysqldb','OpenchannelMessage','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x30a7,0x177));var _0x730a=function(_0x441d2b,_0x5d76e3){_0x441d2b=_0x441d2b-0x0;var _0x2e4c50=_0x30a7[_0x441d2b];return _0x2e4c50;};'use strict';var EventEmitter=require(_0x730a('0x0'));var OpenchannelMessage=require(_0x730a('0x1'))['db'][_0x730a('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x730a('0x3'),'afterDestroy':_0x730a('0x4')};function emitEvent(_0xa8888f){return function(_0x4b5774,_0x107fa6,_0x127d75){OpenchannelMessageEvents[_0x730a('0x5')](_0xa8888f+':'+_0x4b5774['id'],_0x4b5774);OpenchannelMessageEvents['emit'](_0xa8888f,_0x4b5774);_0x127d75(null);};}for(var e in events){if(events[_0x730a('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x730a('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index 2ddab3a..633d24b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa40d=['finally','utf8mb4','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','then','info','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','Contact','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x5f9ccf,_0x5aaba4){var _0x43e3a3=function(_0x37b07e){while(--_0x37b07e){_0x5f9ccf['push'](_0x5f9ccf['shift']());}};_0x43e3a3(++_0x5aaba4);}(_0xa40d,0x1cd));var _0xda40=function(_0x5e4278,_0x53ed71){_0x5e4278=_0x5e4278-0x0;var _0x2b35fe=_0xa40d[_0x5e4278];return _0x2b35fe;};'use strict';var _=require(_0xda40('0x0'));var util=require('util');var logger=require(_0xda40('0x1'))(_0xda40('0x2'));var moment=require(_0xda40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xda40('0x4'));var config=require(_0xda40('0x5'));var attributes=require(_0xda40('0x6'));module[_0xda40('0x7')]=function(_0x54952d,_0x5b2682){return _0x54952d[_0xda40('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xda40('0x9'),'fields':[_0xda40('0xa')],'type':_0xda40('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12d539,_0x98d534,_0x153669){var _0x2f43cc=_0x54952d[_0xda40('0xc')];var _0x417888=_0x12d539[_0xda40('0xd')]({'plain':!![]});if(_0x417888['direction']['toLowerCase']()==='in'||_0x417888[_0xda40('0xe')][_0xda40('0xf')]()===_0xda40('0x10')&&!_0x417888[_0xda40('0x11')]&&!_[_0xda40('0x12')](_0x417888[_0xda40('0x13')])){_0x2f43cc[_0xda40('0x14')][_0xda40('0x15')]({'where':{'id':_0x417888['OpenchannelInteractionId']}})['then'](function(_0x160604){if(_0x160604){_0x160604[_0xda40('0x16')]({'lastMsgAt':_0x417888[_0xda40('0x17')],'lastMsgDirection':_0x417888[_0xda40('0xe')]['toLowerCase']()});}})[_0xda40('0x18')](function(_0x5a31cf){console[_0xda40('0x19')](_0x5a31cf);});}if(_0x417888[_0xda40('0xe')]===_0xda40('0x10')&&!_0x417888['secret']){var _0x361bf7;_0x2f43cc[_0xda40('0x1a')][_0xda40('0x1b')]()['then'](function(_0x37fa25){return _0x2f43cc[_0xda40('0x1c')][_0xda40('0x1d')]({'where':{'id':_0x417888[_0xda40('0x1e')]},'include':[{'model':_0x2f43cc['OpenchannelInteraction'],'as':_0xda40('0x1f'),'where':{'id':_0x417888[_0xda40('0x20')]},'limit':0x1,'include':[{'model':_0x2f43cc[_0xda40('0x1a')],'as':'Contact','attributes':_[_0xda40('0x21')](_0x37fa25)}]}]});})[_0xda40('0x22')](function(_0x592182){_0x361bf7=_0x592182[_0xda40('0xd')]({'plain':!![]});if(_0x361bf7&&_0x361bf7['replyUri']){logger[_0xda40('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xda40('0x24')](_0xda40('0x25'),_0x417888['id'],_0x361bf7[_0xda40('0x26')]));if(_0x361bf7['Interactions']&&_0x361bf7[_0xda40('0x1f')][_0xda40('0x27')]){_0x417888[_0xda40('0x28')]=_['omit'](_0x361bf7[_0xda40('0x1f')][0x0],_0xda40('0x29'));_0x417888[_0xda40('0x29')]=_0x361bf7[_0xda40('0x1f')][0x0]['Contact'];}var _0x98d534={'method':_0xda40('0x2a'),'uri':encodeURI(_0x361bf7[_0xda40('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x98d534[_0xda40('0x2b')]){case _0xda40('0x2c'):_0x98d534['qs']=_0x417888;break;case _0xda40('0x2a'):_0x98d534[_0xda40('0xa')]=_0x417888;break;}return rp(_0x98d534)['then'](function(_0x5c9dcf){logger[_0xda40('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xda40('0x2d'),util[_0xda40('0x24')](_0xda40('0x2e'),_0x417888['id'],_0x361bf7[_0xda40('0x26')]));if(_0x5c9dcf[_0xda40('0xa')][_0xda40('0x2f')]&&_0x5c9dcf['body']['threadId']!=_0x417888[_0xda40('0x28')][_0xda40('0x2f')]){return _0x2f43cc['OpenchannelInteraction'][_0xda40('0x16')]({'threadId':_0x5c9dcf[_0xda40('0xa')][_0xda40('0x2f')]},{'where':{'id':_0x417888['Interaction']['id']}});}else{return;}})[_0xda40('0x22')](function(){return _0x12d539['update']({'read':!![]});})[_0xda40('0x18')](function(_0x10bdcc){logger[_0xda40('0x19')](_0xda40('0x30'),'afterCreate',util['inspect'](_0x10bdcc,{'showHidden':![],'depth':null}));_0x153669();});}else{_0x153669();}})[_0xda40('0x31')](function(){_0x153669();});}else{_0x153669();}}},'charset':_0xda40('0x32'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x31a7=['update','createdAt','catch','error','CmContact','OpenchannelAccount','Interactions','Contact','keys','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','OpenchannelMessage,\x20%s,\x20%s','threadId','OpenchannelInteraction','inspect','finally','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then'];(function(_0x1668a3,_0x26e709){var _0x486cdb=function(_0x156a77){while(--_0x156a77){_0x1668a3['push'](_0x1668a3['shift']());}};_0x486cdb(++_0x26e709);}(_0x31a7,0x145));var _0x731a=function(_0x343574,_0x4bcf65){_0x343574=_0x343574-0x0;var _0x2b3675=_0x31a7[_0x343574];return _0x2b3675;};'use strict';var _=require('lodash');var util=require(_0x731a('0x0'));var logger=require('../../config/logger')(_0x731a('0x1'));var moment=require(_0x731a('0x2'));var BPromise=require(_0x731a('0x3'));var rp=require(_0x731a('0x4'));var fs=require('fs');var path=require(_0x731a('0x5'));var rimraf=require(_0x731a('0x6'));var config=require(_0x731a('0x7'));var attributes=require(_0x731a('0x8'));module[_0x731a('0x9')]=function(_0x3570a7,_0x2aee7d){return _0x3570a7[_0x731a('0xa')](_0x731a('0xb'),attributes,{'tableName':_0x731a('0xc'),'paranoid':![],'indexes':[{'name':_0x731a('0xd'),'fields':[_0x731a('0xe')],'type':_0x731a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eba26,_0x223f16,_0x5c8a23){var _0x24057b=_0x3570a7['models'];var _0xbaf045=_0x3eba26[_0x731a('0x10')]({'plain':!![]});if(_0xbaf045[_0x731a('0x11')][_0x731a('0x12')]()==='in'||_0xbaf045[_0x731a('0x11')]['toLowerCase']()===_0x731a('0x13')&&!_0xbaf045[_0x731a('0x14')]&&!_[_0x731a('0x15')](_0xbaf045[_0x731a('0x16')])){_0x24057b['OpenchannelInteraction'][_0x731a('0x17')]({'where':{'id':_0xbaf045['OpenchannelInteractionId']}})[_0x731a('0x18')](function(_0x4e9f5b){if(_0x4e9f5b){_0x4e9f5b[_0x731a('0x19')]({'lastMsgAt':_0xbaf045[_0x731a('0x1a')],'lastMsgDirection':_0xbaf045[_0x731a('0x11')]['toLowerCase']()});}})[_0x731a('0x1b')](function(_0x1dc1c6){console[_0x731a('0x1c')](_0x1dc1c6);});}if(_0xbaf045['direction']==='out'&&!_0xbaf045['secret']){var _0x5c07e9;_0x24057b[_0x731a('0x1d')]['describe']()['then'](function(_0x395778){return _0x24057b[_0x731a('0x1e')]['find']({'where':{'id':_0xbaf045['OpenchannelAccountId']},'include':[{'model':_0x24057b['OpenchannelInteraction'],'as':_0x731a('0x1f'),'where':{'id':_0xbaf045['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x24057b['CmContact'],'as':_0x731a('0x20'),'attributes':_[_0x731a('0x21')](_0x395778)}]}]});})[_0x731a('0x18')](function(_0x233869){_0x5c07e9=_0x233869[_0x731a('0x10')]({'plain':!![]});if(_0x5c07e9&&_0x5c07e9['replyUri']){logger[_0x731a('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x731a('0x23'),util[_0x731a('0x24')](_0x731a('0x25'),_0xbaf045['id'],_0x5c07e9[_0x731a('0x26')]));if(_0x5c07e9[_0x731a('0x1f')]&&_0x5c07e9[_0x731a('0x1f')][_0x731a('0x27')]){_0xbaf045[_0x731a('0x28')]=_[_0x731a('0x29')](_0x5c07e9[_0x731a('0x1f')][0x0],'Contact');_0xbaf045[_0x731a('0x20')]=_0x5c07e9['Interactions'][0x0][_0x731a('0x20')];}var _0x223f16={'method':_0x731a('0x2a'),'uri':encodeURI(_0x5c07e9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x223f16[_0x731a('0x2b')]){case'GET':_0x223f16['qs']=_0xbaf045;break;case _0x731a('0x2a'):_0x223f16[_0x731a('0xe')]=_0xbaf045;break;}return rp(_0x223f16)[_0x731a('0x18')](function(_0x45702d){logger[_0x731a('0x22')](_0x731a('0x2c'),_0x731a('0x23'),util[_0x731a('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0xbaf045['id'],_0x5c07e9[_0x731a('0x26')]));if(_0x45702d[_0x731a('0xe')]['threadId']&&_0x45702d[_0x731a('0xe')][_0x731a('0x2d')]!=_0xbaf045['Interaction']['threadId']){return _0x24057b[_0x731a('0x2e')][_0x731a('0x19')]({'threadId':_0x45702d[_0x731a('0xe')][_0x731a('0x2d')]},{'where':{'id':_0xbaf045[_0x731a('0x28')]['id']}});}else{return;}})[_0x731a('0x18')](function(){return _0x3eba26[_0x731a('0x19')]({'read':!![]});})[_0x731a('0x1b')](function(_0x56438f){logger[_0x731a('0x1c')](_0x731a('0x2c'),'afterCreate',util[_0x731a('0x2f')](_0x56438f,{'showHidden':![],'depth':null}));_0x5c8a23();});}else{_0x5c8a23();}})[_0x731a('0x30')](function(){_0x5c8a23();});}else{_0x5c8a23();}}},'charset':'utf8mb4','collate':_0x731a('0x31')});};
\ No newline at end of file
index ba21e02..b37abe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0xb8e3a0,_0x4a02d4){var _0x1bbc7b=function(_0x8c521e){while(--_0x8c521e){_0xb8e3a0['push'](_0xb8e3a0['shift']());}};_0x1bbc7b(++_0x4a02d4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2d7924,_0x4c4676){_0x2d7924=_0x2d7924-0x0;var _0x31cad2=_0x5f2f[_0x2d7924];return _0x31cad2;};'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
+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(_0x58dee6,_0x4e820d){var _0x581a3f=function(_0x549a67){while(--_0x549a67){_0x58dee6['push'](_0x58dee6['shift']());}};_0x581a3f(++_0x4e820d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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
index 317d47c..1eef002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe604=['length','openchannelMessage:','./openchannelMessage.events','emit','register'];(function(_0x8ef130,_0x4ce8c1){var _0x76adb5=function(_0x4cdf3a){while(--_0x4cdf3a){_0x8ef130['push'](_0x8ef130['shift']());}};_0x76adb5(++_0x4ce8c1);}(_0xe604,0x101));var _0x4e60=function(_0x4bbfeb,_0x1ea911){_0x4bbfeb=_0x4bbfeb-0x0;var _0xe18a24=_0xe604[_0x4bbfeb];return _0xe18a24;};'use strict';var OpenchannelMessageEvents=require(_0x4e60('0x0'));var events=['save','remove','update'];function createListener(_0x4932ec,_0x18dc66){return function(_0x292759){_0x18dc66[_0x4e60('0x1')](_0x4932ec,_0x292759);};}function removeListener(_0x4288c0,_0x511ab9){return function(){OpenchannelMessageEvents['removeListener'](_0x4288c0,_0x511ab9);};}exports[_0x4e60('0x2')]=function(_0x1409f2){for(var _0x37e2d9=0x0,_0x559eff=events[_0x4e60('0x3')];_0x37e2d9<_0x559eff;_0x37e2d9++){var _0xbff2ee=events[_0x37e2d9];var _0x280bab=createListener(_0x4e60('0x4')+_0xbff2ee,_0x1409f2);OpenchannelMessageEvents['on'](_0xbff2ee,_0x280bab);}};
\ No newline at end of file
+var _0xf742=['removeListener','register','length','openchannelMessage:','save','remove','update','emit'];(function(_0x4c3ffe,_0x457374){var _0x28d3eb=function(_0x3ae2a3){while(--_0x3ae2a3){_0x4c3ffe['push'](_0x4c3ffe['shift']());}};_0x28d3eb(++_0x457374);}(_0xf742,0x8c));var _0x2f74=function(_0x55808c,_0x467272){_0x55808c=_0x55808c-0x0;var _0x13b4df=_0xf742[_0x55808c];return _0x13b4df;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x2f74('0x0'),_0x2f74('0x1'),_0x2f74('0x2')];function createListener(_0x447294,_0x1c4a7d){return function(_0x2977f9){_0x1c4a7d[_0x2f74('0x3')](_0x447294,_0x2977f9);};}function removeListener(_0x5d3082,_0x1d86fd){return function(){OpenchannelMessageEvents[_0x2f74('0x4')](_0x5d3082,_0x1d86fd);};}exports[_0x2f74('0x5')]=function(_0x576197){for(var _0x56a03a=0x0,_0x479872=events[_0x2f74('0x6')];_0x56a03a<_0x479872;_0x56a03a++){var _0x35fa3f=events[_0x56a03a];var _0x5e4cb5=createListener(_0x2f74('0x7')+_0x35fa3f,_0x576197);OpenchannelMessageEvents['on'](_0x35fa3f,_0x5e4cb5);}};
\ No newline at end of file
index 4b75aa1..d2d4395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','update','destroy','delete','removeTeams'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x929c,0x1e0));var _0xc929=function(_0x47ec06,_0x2cd6da){_0x47ec06=_0x47ec06-0x0;var _0x3b7716=_0x929c[_0x47ec06];return _0x3b7716;};'use strict';var multer=require(_0xc929('0x0'));var util=require(_0xc929('0x1'));var path=require(_0xc929('0x2'));var timeout=require(_0xc929('0x3'));var express=require(_0xc929('0x4'));var router=express[_0xc929('0x5')]();var fs_extra=require(_0xc929('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc929('0x7'));var config=require(_0xc929('0x8'));var controller=require(_0xc929('0x9'));router['get']('/',auth[_0xc929('0xa')](),controller[_0xc929('0xb')]);router[_0xc929('0xc')](_0xc929('0xd'),auth[_0xc929('0xa')](),controller[_0xc929('0xe')]);router['get'](_0xc929('0xf'),auth[_0xc929('0xa')](),controller[_0xc929('0x10')]);router[_0xc929('0xc')](_0xc929('0x11'),auth[_0xc929('0xa')](),controller['getMembers']);router['get'](_0xc929('0x12'),auth['isAuthenticated'](),controller[_0xc929('0x13')]);router[_0xc929('0xc')]('/:id/users',auth[_0xc929('0xa')](),controller[_0xc929('0x14')]);router['post']('/',auth[_0xc929('0xa')](),controller[_0xc929('0x15')]);router[_0xc929('0x16')](_0xc929('0x12'),auth[_0xc929('0xa')](),controller[_0xc929('0x17')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xc929('0x18')]);router[_0xc929('0x19')](_0xc929('0xf'),auth[_0xc929('0xa')](),controller[_0xc929('0x1a')]);router['delete'](_0xc929('0xf'),auth['isAuthenticated'](),controller[_0xc929('0x1b')]);router[_0xc929('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc929('0x1d')]);router[_0xc929('0x1c')]('/:id/users',auth[_0xc929('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x5562=['create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x43e0cd,_0x58b9fc){var _0x1cf0a0=function(_0x5cd95a){while(--_0x5cd95a){_0x43e0cd['push'](_0x43e0cd['shift']());}};_0x1cf0a0(++_0x58b9fc);}(_0x5562,0xd4));var _0x2556=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x5562[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x2556('0x0'));var util=require(_0x2556('0x1'));var path=require(_0x2556('0x2'));var timeout=require(_0x2556('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2556('0x4'));var auth=require(_0x2556('0x5'));var interaction=require(_0x2556('0x6'));var config=require(_0x2556('0x7'));var controller=require('./openchannelQueue.controller');router[_0x2556('0x8')]('/',auth[_0x2556('0x9')](),controller['index']);router[_0x2556('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2556('0xa')]);router['get'](_0x2556('0xb'),auth[_0x2556('0x9')](),controller[_0x2556('0xc')]);router['get'](_0x2556('0xd'),auth[_0x2556('0x9')](),controller[_0x2556('0xe')]);router[_0x2556('0x8')](_0x2556('0xf'),auth[_0x2556('0x9')](),controller[_0x2556('0x10')]);router['get'](_0x2556('0x11'),auth['isAuthenticated'](),controller[_0x2556('0x12')]);router[_0x2556('0x13')]('/',auth[_0x2556('0x9')](),controller[_0x2556('0x14')]);router[_0x2556('0x13')](_0x2556('0xf'),auth['isAuthenticated'](),controller[_0x2556('0x15')]);router[_0x2556('0x13')](_0x2556('0x11'),auth['isAuthenticated'](),controller[_0x2556('0x16')]);router[_0x2556('0x17')](_0x2556('0xb'),auth[_0x2556('0x9')](),controller[_0x2556('0x18')]);router['delete'](_0x2556('0xb'),auth['isAuthenticated'](),controller[_0x2556('0x19')]);router['delete']('/:id/teams',auth[_0x2556('0x9')](),controller['removeTeams']);router[_0x2556('0x1a')](_0x2556('0x11'),auth['isAuthenticated'](),controller[_0x2556('0x1b')]);module[_0x2556('0x1c')]=router;
\ No newline at end of file
index 172e8d4..b6bff99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x090c=['STRING','INTEGER','beepall','roundrobin','exports','name'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0x090c,0xe8));var _0xc090=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x090c[_0x4164f2];return _0x2575c7;};'use strict';var Sequelize=require('sequelize');module[_0xc090('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc090('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc090('0x2')]},'timeout':{'type':Sequelize[_0xc090('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xc090('0x4'),_0xc090('0x5'))}};
\ No newline at end of file
+var _0xd71b=['name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x584bcd,_0x59c4b7){var _0x146bc7=function(_0x20b30d){while(--_0x20b30d){_0x584bcd['push'](_0x584bcd['shift']());}};_0x146bc7(++_0x59c4b7);}(_0xd71b,0x126));var _0xbd71=function(_0xc0945e,_0x2ccce9){_0xc0945e=_0xc0945e-0x0;var _0x4d3716=_0xd71b[_0xc0945e];return _0x4d3716;};'use strict';var Sequelize=require(_0xbd71('0x0'));module[_0xbd71('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbd71('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbd71('0x3')]},'timeout':{'type':Sequelize[_0xbd71('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbd71('0x5')](_0xbd71('0x6'),_0xbd71('0x7'),'roundrobin')}};
\ No newline at end of file
index 5b3dc5c..21e3c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc3=['offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','get','OpenchannelQueues','error','stack','name','send','index','map','OpenchannelQueue','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','hasOwnProperty','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','compact','value','isEmpty','forEach','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7cc3,0x6a));var _0x37cc=function(_0x48da68,_0x132675){_0x48da68=_0x48da68-0x0;var _0x512f87=_0x7cc3[_0x48da68];return _0x512f87;};'use strict';var emlformat=require(_0x37cc('0x0'));var rimraf=require(_0x37cc('0x1'));var zipdir=require(_0x37cc('0x2'));var jsonpatch=require(_0x37cc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x37cc('0x4'));var Mustache=require(_0x37cc('0x5'));var util=require('util');var path=require(_0x37cc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x37cc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37cc('0x8'));var squel=require(_0x37cc('0x9'));var crypto=require('crypto');var jsforce=require(_0x37cc('0xa'));var deskjs=require(_0x37cc('0xb'));var toCsv=require(_0x37cc('0xc'));var querystring=require('querystring');var Papa=require(_0x37cc('0xd'));var Redis=require(_0x37cc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x37cc('0xf'));var as=require(_0x37cc('0x10'));var hardwareService=require(_0x37cc('0x11'));var logger=require(_0x37cc('0x12'))(_0x37cc('0x13'));var utils=require(_0x37cc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x37cc('0x15'))['db'];config[_0x37cc('0x16')]=_[_0x37cc('0x17')](config['redis'],{'host':_0x37cc('0x18'),'port':0x18eb});var socket=require(_0x37cc('0x19'))(new Redis(config['redis']));require(_0x37cc('0x1a'))['register'](socket);function respondWithStatusCode(_0x7f07a5,_0x1c88ee){_0x1c88ee=_0x1c88ee||0xcc;return function(_0x30dd66){if(_0x30dd66){return _0x7f07a5[_0x37cc('0x1b')](_0x1c88ee);}return _0x7f07a5[_0x37cc('0x1c')](_0x1c88ee)[_0x37cc('0x1d')]();};}function respondWithResult(_0xfad3ef,_0x575fbf){_0x575fbf=_0x575fbf||0xc8;return function(_0x475680){if(_0x475680){return _0xfad3ef[_0x37cc('0x1c')](_0x575fbf)['json'](_0x475680);}};}function respondWithFilteredResult(_0x295de2,_0x41d0e9){return function(_0x299de1){if(_0x299de1){var _0x4ed98f=typeof _0x41d0e9[_0x37cc('0x1e')]===_0x37cc('0x1f')&&typeof _0x41d0e9[_0x37cc('0x20')]===_0x37cc('0x1f');var _0x51190b=_0x299de1[_0x37cc('0x21')];var _0xa2c856=_0x4ed98f?0x0:_0x41d0e9[_0x37cc('0x1e')];var _0x5582d8=_0x4ed98f?_0x299de1[_0x37cc('0x21')]:_0x41d0e9[_0x37cc('0x1e')]+_0x41d0e9[_0x37cc('0x20')];var _0x511b02;if(_0x5582d8>=_0x51190b){_0x5582d8=_0x51190b;_0x511b02=0xc8;}else{_0x511b02=0xce;}_0x295de2[_0x37cc('0x1c')](_0x511b02);return _0x295de2[_0x37cc('0x22')]('Content-Range',_0xa2c856+'-'+_0x5582d8+'/'+_0x51190b)[_0x37cc('0x23')](_0x299de1);}return null;};}function patchUpdates(_0x4fbe7c){return function(_0x40c358){try{jsonpatch[_0x37cc('0x24')](_0x40c358,_0x4fbe7c,!![]);}catch(_0x20b8c1){return BPromise[_0x37cc('0x25')](_0x20b8c1);}return _0x40c358[_0x37cc('0x26')]();};}function saveUpdates(_0x5e56a3,_0x4216c0){return function(_0xd8eb47){if(_0xd8eb47){return _0xd8eb47[_0x37cc('0x27')](_0x5e56a3)['then'](function(_0x49ce9e){return _0x49ce9e;});}return null;};}function removeEntity(_0x3a5e14,_0x53060c){return function(_0x5c1f2f){if(_0x5c1f2f){return _0x5c1f2f[_0x37cc('0x28')]()[_0x37cc('0x29')](function(){var _0x269980=_0x5c1f2f[_0x37cc('0x2a')]({'plain':!![]});var _0x4bd89b=_0x37cc('0x2b');return db['UserProfileResource'][_0x37cc('0x28')]({'where':{'type':_0x4bd89b,'resourceId':_0x269980['id']}})[_0x37cc('0x29')](function(){return _0x5c1f2f;});})[_0x37cc('0x29')](function(){_0x3a5e14[_0x37cc('0x1c')](0xcc)[_0x37cc('0x1d')]();});}};}function handleEntityNotFound(_0x31ad79,_0x56ce45){return function(_0x377588){if(!_0x377588){_0x31ad79[_0x37cc('0x1b')](0x194);}return _0x377588;};}function handleError(_0x25eb34,_0x2886bb){_0x2886bb=_0x2886bb||0x1f4;return function(_0x11014b){logger[_0x37cc('0x2c')](_0x11014b[_0x37cc('0x2d')]);if(_0x11014b[_0x37cc('0x2e')]){delete _0x11014b['name'];}_0x25eb34[_0x37cc('0x1c')](_0x2886bb)[_0x37cc('0x2f')](_0x11014b);};}exports[_0x37cc('0x30')]=function(_0x6658f1,_0x23d08b){var _0x382597={},_0x1627cc={},_0x3db1d0={'count':0x0,'rows':[]};var _0x238901=_[_0x37cc('0x31')](db[_0x37cc('0x32')]['rawAttributes'],function(_0x57fe75){return{'name':_0x57fe75[_0x37cc('0x33')],'type':_0x57fe75[_0x37cc('0x34')]['key']};});_0x1627cc[_0x37cc('0x35')]=_[_0x37cc('0x31')](_0x238901,_0x37cc('0x2e'));_0x1627cc[_0x37cc('0x36')]=_[_0x37cc('0x37')](_0x6658f1[_0x37cc('0x36')]);_0x1627cc[_0x37cc('0x38')]=_['intersection'](_0x1627cc[_0x37cc('0x35')],_0x1627cc['query']);_0x382597['attributes']=_[_0x37cc('0x39')](_0x1627cc[_0x37cc('0x35')],qs[_0x37cc('0x3a')](_0x6658f1[_0x37cc('0x36')]['fields']));_0x382597[_0x37cc('0x3b')]=_0x382597['attributes']['length']?_0x382597['attributes']:_0x1627cc['model'];if(!_0x6658f1[_0x37cc('0x36')]['hasOwnProperty'](_0x37cc('0x3c'))){_0x382597['limit']=qs[_0x37cc('0x20')](_0x6658f1[_0x37cc('0x36')]['limit']);_0x382597[_0x37cc('0x1e')]=qs[_0x37cc('0x1e')](_0x6658f1[_0x37cc('0x36')][_0x37cc('0x1e')]);}_0x382597[_0x37cc('0x3d')]=qs[_0x37cc('0x3e')](_0x6658f1[_0x37cc('0x36')][_0x37cc('0x3e')]);_0x382597[_0x37cc('0x3f')]=qs[_0x37cc('0x38')](_[_0x37cc('0x40')](_0x6658f1[_0x37cc('0x36')],_0x1627cc[_0x37cc('0x38')]),_0x238901);if(_0x6658f1[_0x37cc('0x36')][_0x37cc('0x41')]){_0x382597[_0x37cc('0x3f')]=_['merge'](_0x382597[_0x37cc('0x3f')],{'$or':_['map'](_0x238901,function(_0x3eaa54){if(_0x3eaa54[_0x37cc('0x34')]!==_0x37cc('0x42')){var _0x3365a3={};_0x3365a3[_0x3eaa54[_0x37cc('0x2e')]]={'$like':'%'+_0x6658f1[_0x37cc('0x36')][_0x37cc('0x41')]+'%'};return _0x3365a3;}})});}_0x382597=_[_0x37cc('0x43')]({},_0x382597,_0x6658f1[_0x37cc('0x44')]);var _0x1d0fa6={'where':_0x382597[_0x37cc('0x3f')]};return db['OpenchannelQueue'][_0x37cc('0x21')](_0x1d0fa6)[_0x37cc('0x29')](function(_0x30e29c){_0x3db1d0[_0x37cc('0x21')]=_0x30e29c;if(_0x6658f1[_0x37cc('0x36')][_0x37cc('0x45')]){_0x382597[_0x37cc('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x37cc('0x47')](_0x382597);})['then'](function(_0xb6941f){_0x3db1d0[_0x37cc('0x48')]=_0xb6941f;return _0x3db1d0;})[_0x37cc('0x29')](respondWithFilteredResult(_0x23d08b,_0x382597))['catch'](handleError(_0x23d08b,null));};exports[_0x37cc('0x49')]=function(_0x1056ec,_0x20ae34){var _0x5e30e7={'raw':!![],'where':{'id':_0x1056ec[_0x37cc('0x4a')]['id']}},_0x23853={};_0x23853[_0x37cc('0x35')]=_[_0x37cc('0x37')](db[_0x37cc('0x32')][_0x37cc('0x4b')]);_0x23853[_0x37cc('0x36')]=_[_0x37cc('0x37')](_0x1056ec[_0x37cc('0x36')]);_0x23853['filters']=_['intersection'](_0x23853[_0x37cc('0x35')],_0x23853[_0x37cc('0x36')]);_0x5e30e7[_0x37cc('0x3b')]=_[_0x37cc('0x39')](_0x23853[_0x37cc('0x35')],qs[_0x37cc('0x3a')](_0x1056ec[_0x37cc('0x36')][_0x37cc('0x3a')]));_0x5e30e7[_0x37cc('0x3b')]=_0x5e30e7[_0x37cc('0x3b')][_0x37cc('0x4c')]?_0x5e30e7[_0x37cc('0x3b')]:_0x23853['model'];if(_0x1056ec['query'][_0x37cc('0x45')]){_0x5e30e7['include']=[{'all':!![]}];}_0x5e30e7=_[_0x37cc('0x43')]({},_0x5e30e7,_0x1056ec[_0x37cc('0x44')]);return db['OpenchannelQueue'][_0x37cc('0x4d')](_0x5e30e7)['then'](handleEntityNotFound(_0x20ae34,null))[_0x37cc('0x29')](respondWithResult(_0x20ae34,null))[_0x37cc('0x4e')](handleError(_0x20ae34,null));};exports['create']=function(_0x393979,_0x558b30){return db[_0x37cc('0x32')][_0x37cc('0x4f')](_0x393979[_0x37cc('0x50')],{})[_0x37cc('0x29')](function(_0x50f4ba){var _0x3ba522=_0x393979['user'][_0x37cc('0x2a')]({'plain':!![]});if(!_0x3ba522)throw new Error(_0x37cc('0x51'));if(_0x3ba522[_0x37cc('0x52')]===_0x37cc('0x53')){var _0x1e2072=_0x50f4ba['get']({'plain':!![]});var _0x49f977=_0x37cc('0x2b');return db['UserProfileSection'][_0x37cc('0x4d')]({'where':{'name':_0x49f977,'userProfileId':_0x3ba522['userProfileId']},'raw':!![]})[_0x37cc('0x29')](function(_0x14a78e){if(_0x14a78e&&_0x14a78e['autoAssociation']===0x0){return db['UserProfileResource'][_0x37cc('0x4f')]({'name':_0x1e2072[_0x37cc('0x2e')],'resourceId':_0x1e2072['id'],'type':_0x14a78e[_0x37cc('0x2e')],'sectionId':_0x14a78e['id']},{})[_0x37cc('0x29')](function(){return _0x50f4ba;});}else{return _0x50f4ba;}})[_0x37cc('0x4e')](function(_0x411837){logger['error'](_0x37cc('0x54'),_0x411837);throw _0x411837;});}return _0x50f4ba;})['then'](respondWithResult(_0x558b30,0xc9))[_0x37cc('0x4e')](handleError(_0x558b30,null));};exports[_0x37cc('0x27')]=function(_0x1ec6d2,_0x56d502){if(_0x1ec6d2[_0x37cc('0x50')]['id']){delete _0x1ec6d2[_0x37cc('0x50')]['id'];}return db[_0x37cc('0x32')][_0x37cc('0x4d')]({'where':{'id':_0x1ec6d2['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x56d502,null))[_0x37cc('0x29')](saveUpdates(_0x1ec6d2['body'],null))[_0x37cc('0x29')](respondWithResult(_0x56d502,null))[_0x37cc('0x4e')](handleError(_0x56d502,null));};exports[_0x37cc('0x28')]=function(_0x51c662,_0x3d0811){return db[_0x37cc('0x32')]['find']({'where':{'id':_0x51c662['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x3d0811,null))[_0x37cc('0x29')](removeEntity(_0x3d0811,null))['catch'](handleError(_0x3d0811,null));};exports[_0x37cc('0x55')]=function(_0x43238c,_0x3235dd){return db[_0x37cc('0x32')]['describe']()[_0x37cc('0x29')](respondWithResult(_0x3235dd,null))[_0x37cc('0x4e')](handleError(_0x3235dd,null));};exports[_0x37cc('0x56')]=function(_0x27adce,_0xc50c2f,_0x427030){var _0x2e6b91={'raw':!![],'where':{}},_0x4cd1d5={},_0x21a0a2;return db['OpenchannelQueue'][_0x37cc('0x57')]({'where':{'id':_0x27adce['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0xc50c2f,null))[_0x37cc('0x29')](function(_0x55ff4a){if(_0x55ff4a){_0x21a0a2=_0x55ff4a[_0x37cc('0x2a')]({'plain':!![]});_0x4cd1d5[_0x37cc('0x35')]=_['keys'](db[_0x37cc('0x58')][_0x37cc('0x4b')]);_0x4cd1d5['query']=_[_0x37cc('0x37')](_0x27adce[_0x37cc('0x36')]);_0x4cd1d5[_0x37cc('0x38')]=_[_0x37cc('0x39')](_0x4cd1d5[_0x37cc('0x35')],_0x4cd1d5[_0x37cc('0x36')]);_0x2e6b91[_0x37cc('0x3b')]=_[_0x37cc('0x39')](_0x4cd1d5[_0x37cc('0x35')],qs['fields'](_0x27adce['query'][_0x37cc('0x3a')]));_0x2e6b91[_0x37cc('0x3b')]=_0x2e6b91[_0x37cc('0x3b')][_0x37cc('0x4c')]?_0x2e6b91['attributes']:_0x4cd1d5[_0x37cc('0x35')];if(!_0x27adce[_0x37cc('0x36')]['hasOwnProperty'](_0x37cc('0x3c'))){_0x2e6b91[_0x37cc('0x20')]=qs[_0x37cc('0x20')](_0x27adce['query'][_0x37cc('0x20')]);_0x2e6b91[_0x37cc('0x1e')]=qs[_0x37cc('0x1e')](_0x27adce[_0x37cc('0x36')][_0x37cc('0x1e')]);}_0x2e6b91['order']=qs[_0x37cc('0x3e')](_0x27adce[_0x37cc('0x36')]['sort']);_0x2e6b91[_0x37cc('0x3f')]=qs[_0x37cc('0x38')](_[_0x37cc('0x40')](_0x27adce['query'],_0x4cd1d5['filters']));_0x2e6b91['where']['OpenchannelQueueId']=_0x55ff4a['id'];if(_0x27adce[_0x37cc('0x36')][_0x37cc('0x41')]){_0x2e6b91[_0x37cc('0x3f')]=_[_0x37cc('0x43')](_0x2e6b91[_0x37cc('0x3f')],{'$or':_['map'](_0x2e6b91[_0x37cc('0x3b')],function(_0x1f6222){var _0x38eb0b={};_0x38eb0b[_0x1f6222]={'$like':'%'+_0x27adce[_0x37cc('0x36')][_0x37cc('0x41')]+'%'};return _0x38eb0b;})});}_0x2e6b91=_[_0x37cc('0x43')]({},_0x2e6b91,_0x27adce['options']);return db['UserOpenchannelQueue'][_0x37cc('0x47')](_0x2e6b91);}})['then'](function(_0x28d05f){if(_0x28d05f){return db[_0x37cc('0x59')][_0x37cc('0x5a')]({'where':{'id':_[_0x37cc('0x31')](_0x28d05f,_0x37cc('0x5b')),'role':_0x37cc('0x5c')},'attributes':['id','name',_0x37cc('0x5d'),'updatedAt',_0x37cc('0x5e')]});}})[_0x37cc('0x29')](function(_0x291a1e){if(_0x291a1e){return{'count':_0x291a1e[_0x37cc('0x21')],'rows':_[_0x37cc('0x31')](_0x291a1e[_0x37cc('0x48')],function(_0x5ef05e){return{'membername':_0x5ef05e['name'],'UserId':_0x5ef05e['id'],'queue_name':_0x21a0a2[_0x37cc('0x2e')],'OpenchannelQueueId':_0x21a0a2['id'],'interface':util['format'](_0x37cc('0x5f'),_0x37cc('0x60'),_0x5ef05e[_0x37cc('0x2e')]),'penalty':0x0,'paused':_0x5ef05e[_0x37cc('0x5d')],'createdAt':_0x5ef05e['createdAt'],'updatedAt':_0x5ef05e[_0x37cc('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x37cc('0x29')](respondWithFilteredResult(_0xc50c2f,_0x2e6b91))[_0x37cc('0x4e')](handleError(_0xc50c2f,null));};exports['getTeams']=function(_0x419478,_0x1e875a,_0x1bcdc2){var _0x16dcb9={};var _0x57269a={};var _0xc37cd1;var _0x491de4;return db[_0x37cc('0x32')]['findOne']({'where':{'id':_0x419478[_0x37cc('0x4a')]['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x1e875a,null))[_0x37cc('0x29')](function(_0x38c1a0){if(_0x38c1a0){_0xc37cd1=_0x38c1a0;_0x57269a['model']=_['keys'](db['Team']['rawAttributes']);_0x57269a['query']=_['keys'](_0x419478[_0x37cc('0x36')]);_0x57269a[_0x37cc('0x38')]=_[_0x37cc('0x39')](_0x57269a[_0x37cc('0x35')],_0x57269a[_0x37cc('0x36')]);_0x16dcb9[_0x37cc('0x3b')]=_[_0x37cc('0x39')](_0x57269a[_0x37cc('0x35')],qs['fields'](_0x419478[_0x37cc('0x36')][_0x37cc('0x3a')]));_0x16dcb9['attributes']=_0x16dcb9[_0x37cc('0x3b')]['length']?_0x16dcb9[_0x37cc('0x3b')]:_0x57269a[_0x37cc('0x35')];_0x16dcb9['order']=qs[_0x37cc('0x3e')](_0x419478[_0x37cc('0x36')][_0x37cc('0x3e')]);_0x16dcb9[_0x37cc('0x3f')]=qs[_0x37cc('0x38')](_[_0x37cc('0x40')](_0x419478[_0x37cc('0x36')],_0x57269a[_0x37cc('0x38')]));if(_0x419478[_0x37cc('0x36')][_0x37cc('0x41')]){_0x16dcb9['where']=_[_0x37cc('0x43')](_0x16dcb9['where'],{'$or':_[_0x37cc('0x31')](_0x16dcb9[_0x37cc('0x3b')],function(_0x153db3){var _0x54b10c={};_0x54b10c[_0x153db3]={'$like':'%'+_0x419478[_0x37cc('0x36')][_0x37cc('0x41')]+'%'};return _0x54b10c;})});}_0x16dcb9=_['merge']({},_0x16dcb9,_0x419478[_0x37cc('0x44')]);return _0xc37cd1[_0x37cc('0x62')](_0x16dcb9);}})[_0x37cc('0x29')](function(_0x450eda){if(_0x450eda){_0x491de4=_0x450eda[_0x37cc('0x4c')];if(!_0x419478[_0x37cc('0x36')][_0x37cc('0x63')]('nolimit')){_0x16dcb9['limit']=qs['limit'](_0x419478[_0x37cc('0x36')][_0x37cc('0x20')]);_0x16dcb9['offset']=qs[_0x37cc('0x1e')](_0x419478[_0x37cc('0x36')]['offset']);}return _0xc37cd1['getTeams'](_0x16dcb9);}})[_0x37cc('0x29')](function(_0x17a2e0){if(_0x17a2e0){return _0x17a2e0?{'count':_0x491de4,'rows':_0x17a2e0}:null;}})[_0x37cc('0x29')](respondWithResult(_0x1e875a,null))['catch'](handleError(_0x1e875a,null));};exports[_0x37cc('0x64')]=function(_0x20d857,_0x413f00,_0x4814dc){var _0x2d3b7f=_0x20d857[_0x37cc('0x50')][_0x37cc('0x65')];return db['Team']['findAll']({'where':{'id':_0x2d3b7f},'attributes':['id'],'include':[{'model':db[_0x37cc('0x59')],'as':'Agents','attributes':['id',_0x37cc('0x2e'),'online',_0x37cc('0x66'),_0x37cc('0x67')],'raw':!![]}]})['then'](function(_0x40d91c){if(_0x40d91c){var _0x4c1bb6=_[_0x37cc('0x68')](_0x40d91c,function(_0x57fe7b){var _0x1897eb=_0x57fe7b[_0x37cc('0x2a')]({'plain':!![]});return _0x1897eb[_0x37cc('0x69')];});return db[_0x37cc('0x32')][_0x37cc('0x4d')]({'where':{'id':_0x20d857[_0x37cc('0x4a')]['id']}})[_0x37cc('0x29')](function(_0x383781){return db[_0x37cc('0x6a')][_0x37cc('0x6b')](function(_0x2fffa8){return _0x383781[_0x37cc('0x64')](_0x2d3b7f,{'transaction':_0x2fffa8})[_0x37cc('0x29')](function(){return BPromise['each'](_0x4c1bb6,function(_0x539cdc){return db['UserOpenchannelQueue'][_0x37cc('0x6c')]({'where':{'UserId':_0x539cdc['id'],'OpenchannelQueueId':_0x20d857[_0x37cc('0x4a')]['id']},'transaction':_0x2fffa8});});})[_0x37cc('0x29')](function(){_0x4c1bb6['forEach'](function(_0x451ee2){socket[_0x37cc('0x6d')](_0x37cc('0x6e'),{'UserId':_0x451ee2['id'],'OpenchannelQueueId':_0x383781['id']});});});});});}})[_0x37cc('0x29')](respondWithStatusCode(_0x413f00,null))[_0x37cc('0x4e')](handleError(_0x413f00,null));};exports[_0x37cc('0x6f')]=function(_0x4e3c06,_0x3b082a,_0x745fa9){return db[_0x37cc('0x70')][_0x37cc('0x47')]({'where':{'id':_0x4e3c06['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x37cc('0x59')],'as':_0x37cc('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3b082a,null))[_0x37cc('0x29')](function(_0x4206b8){var _0x3291ac=_[_0x37cc('0x31')](_0x4206b8,'id');var _0x12c0d5=[];var _0x12d207=[];var _0x1ecdae=squel['select']();_0x1ecdae[_0x37cc('0x71')](_0x37cc('0x72'))[_0x37cc('0x73')](_0x37cc('0x74'),'tq')[_0x37cc('0x75')](_0x37cc('0x76'),'ut',_0x37cc('0x77'))[_0x37cc('0x3f')](_0x37cc('0x78'),_0x4e3c06[_0x37cc('0x4a')]['id']);for(var _0x2bc2b9=0x0;_0x2bc2b9<_0x4206b8[_0x37cc('0x4c')];_0x2bc2b9+=0x1){let _0x49f2b0=_0x4206b8[_0x2bc2b9];for(var _0x28cf09=0x0;_0x28cf09<_0x49f2b0['Agents'][_0x37cc('0x4c')];_0x28cf09+=0x1){let _0x473ef5=_0x49f2b0[_0x37cc('0x69')][_0x28cf09];var _0x448bb3=_0x1ecdae[_0x37cc('0x79')]();_0x448bb3[_0x37cc('0x3f')](_0x37cc('0x7a'),_0x473ef5['id']);_0x12d207['push'](db[_0x37cc('0x6a')][_0x37cc('0x36')](_0x448bb3[_0x37cc('0x7b')](),{'type':db[_0x37cc('0x6a')][_0x37cc('0x7c')][_0x37cc('0x7d')]})['then'](function(_0x3b596b){if(_0x3b596b[_0x37cc('0x4c')]===0x1){return _0x473ef5['id'];}else{var _0x4eb38c=_['every'](_[_0x37cc('0x31')](_0x3b596b,'TeamId'),function(_0x375314){return _['includes'](_0x3291ac,_0x375314);});if(_0x4eb38c){return _0x473ef5['id'];}}}));}}return BPromise[_0x37cc('0x7e')](_0x12d207)['then'](function(_0x45f575){_0x12c0d5=_(_0x12c0d5)['union'](_0x45f575)[_0x37cc('0x7f')]()[_0x37cc('0x80')]();return db[_0x37cc('0x32')][_0x37cc('0x4d')]({'where':{'id':_0x4e3c06[_0x37cc('0x4a')]['id']}})[_0x37cc('0x29')](function(_0x55d35b){return db[_0x37cc('0x6a')][_0x37cc('0x6b')](function(_0x5b07b7){return _0x55d35b[_0x37cc('0x6f')](_0x4e3c06[_0x37cc('0x36')]['ids'],{'transaction':_0x5b07b7})[_0x37cc('0x29')](function(){if(!_[_0x37cc('0x81')](_0x12c0d5)){return _0x55d35b['removeAgents'](_0x12c0d5,{'transaction':_0x5b07b7});}})[_0x37cc('0x29')](function(){_0x12c0d5[_0x37cc('0x82')](function(_0xf1fa6f){socket[_0x37cc('0x6d')]('userOpenchannelQueue:remove',{'UserId':_0xf1fa6f,'OpenchannelQueueId':_0x55d35b['id']});});});});});});})[_0x37cc('0x29')](respondWithStatusCode(_0x3b082a,null))[_0x37cc('0x4e')](handleError(_0x3b082a,null));};exports[_0x37cc('0x83')]=function(_0x1b5c8c,_0x5338db,_0xbe772b){return db[_0x37cc('0x32')][_0x37cc('0x4d')]({'where':{'id':_0x1b5c8c['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x5338db,null))[_0x37cc('0x29')](function(_0x240831){if(_0x240831){return _0x240831['addAgents'](_0x1b5c8c[_0x37cc('0x50')][_0x37cc('0x65')],_['omit'](_0x1b5c8c['body'],[_0x37cc('0x65'),'id'])||{})[_0x37cc('0x84')](function(_0x1f4c92){for(var _0x251903=0x0;_0x251903<_0x1b5c8c[_0x37cc('0x50')][_0x37cc('0x65')][_0x37cc('0x4c')];_0x251903+=0x1){socket[_0x37cc('0x6d')](_0x37cc('0x6e'),{'UserId':Number(_0x1b5c8c[_0x37cc('0x50')][_0x37cc('0x65')][_0x251903]),'OpenchannelQueueId':Number(_0x1b5c8c[_0x37cc('0x4a')]['id'])});}return _0x1f4c92;});}})[_0x37cc('0x29')](respondWithResult(_0x5338db,null))[_0x37cc('0x4e')](handleError(_0x5338db,null));};exports['removeAgents']=function(_0x2c503f,_0xa44090,_0x33185e){return db[_0x37cc('0x32')][_0x37cc('0x4d')]({'where':{'id':_0x2c503f[_0x37cc('0x4a')]['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0xa44090,null))[_0x37cc('0x29')](function(_0x2802ec){if(_0x2802ec){return _0x2802ec['removeAgents'](_0x2c503f['query']['ids'])[_0x37cc('0x29')](function(){if(_[_0x37cc('0x85')](_0x2c503f['query']['ids'])){for(var _0x3bbf9f=0x0;_0x3bbf9f<_0x2c503f[_0x37cc('0x36')][_0x37cc('0x65')][_0x37cc('0x4c')];_0x3bbf9f+=0x1){socket[_0x37cc('0x6d')](_0x37cc('0x86'),{'UserId':Number(_0x2c503f[_0x37cc('0x36')][_0x37cc('0x65')][_0x3bbf9f]),'OpenchannelQueueId':Number(_0x2c503f[_0x37cc('0x4a')]['id'])});}}else{socket[_0x37cc('0x6d')](_0x37cc('0x86'),{'UserId':Number(_0x2c503f['query']['ids']),'OpenchannelQueueId':Number(_0x2c503f[_0x37cc('0x4a')]['id'])});}});}})[_0x37cc('0x29')](respondWithStatusCode(_0xa44090,null))['catch'](handleError(_0xa44090,null));};exports[_0x37cc('0x87')]=function(_0x5691e7,_0x12d60c,_0x438eeb){var _0x33ae44={};var _0x3a0cc8={};var _0x3a6697;var _0x511d53;return db['OpenchannelQueue'][_0x37cc('0x57')]({'where':{'id':_0x5691e7['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x12d60c,null))['then'](function(_0x562b39){if(_0x562b39){_0x3a6697=_0x562b39;_0x3a0cc8[_0x37cc('0x35')]=_['keys'](db[_0x37cc('0x59')][_0x37cc('0x4b')]);_0x3a0cc8[_0x37cc('0x36')]=_[_0x37cc('0x37')](_0x5691e7['query']);_0x3a0cc8[_0x37cc('0x38')]=_[_0x37cc('0x39')](_0x3a0cc8[_0x37cc('0x35')],_0x3a0cc8[_0x37cc('0x36')]);_0x33ae44[_0x37cc('0x3b')]=_[_0x37cc('0x39')](_0x3a0cc8[_0x37cc('0x35')],qs['fields'](_0x5691e7[_0x37cc('0x36')][_0x37cc('0x3a')]));_0x33ae44[_0x37cc('0x3b')]=_0x33ae44['attributes']['length']?_0x33ae44[_0x37cc('0x3b')]:_0x3a0cc8[_0x37cc('0x35')];_0x33ae44['order']=qs[_0x37cc('0x3e')](_0x5691e7[_0x37cc('0x36')][_0x37cc('0x3e')]);_0x33ae44[_0x37cc('0x3f')]=qs['filters'](_['pick'](_0x5691e7[_0x37cc('0x36')],_0x3a0cc8[_0x37cc('0x38')]));if(_0x5691e7[_0x37cc('0x36')][_0x37cc('0x41')]){_0x33ae44[_0x37cc('0x3f')]=_[_0x37cc('0x43')](_0x33ae44[_0x37cc('0x3f')],{'$or':_[_0x37cc('0x31')](_0x33ae44[_0x37cc('0x3b')],function(_0x4048f4){var _0x36a957={};_0x36a957[_0x4048f4]={'$like':'%'+_0x5691e7[_0x37cc('0x36')][_0x37cc('0x41')]+'%'};return _0x36a957;})});}_0x33ae44=_[_0x37cc('0x43')]({},_0x33ae44,_0x5691e7[_0x37cc('0x44')]);return _0x3a6697[_0x37cc('0x87')](_0x33ae44);}})[_0x37cc('0x29')](function(_0xde3a3){if(_0xde3a3){_0x511d53=_0xde3a3[_0x37cc('0x4c')];if(!_0x5691e7[_0x37cc('0x36')][_0x37cc('0x63')](_0x37cc('0x3c'))){_0x33ae44[_0x37cc('0x20')]=qs[_0x37cc('0x20')](_0x5691e7[_0x37cc('0x36')][_0x37cc('0x20')]);_0x33ae44[_0x37cc('0x1e')]=qs[_0x37cc('0x1e')](_0x5691e7[_0x37cc('0x36')][_0x37cc('0x1e')]);}return _0x3a6697['getAgents'](_0x33ae44);}})[_0x37cc('0x29')](function(_0x45b214){if(_0x45b214){return _0x45b214?{'count':_0x511d53,'rows':_0x45b214}:null;}})[_0x37cc('0x29')](respondWithResult(_0x12d60c,null))[_0x37cc('0x4e')](handleError(_0x12d60c,null));};
\ No newline at end of file
+var _0xc06b=['destroy','get','OpenchannelQueues','end','stack','name','send','index','map','OpenchannelQueue','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','apply','reject','then'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xc06b,0x69));var _0xbc06=function(_0x4a94d0,_0x374e5d){_0x4a94d0=_0x4a94d0-0x0;var _0x50128a=_0xc06b[_0x4a94d0];return _0x50128a;};'use strict';var emlformat=require(_0xbc06('0x0'));var rimraf=require(_0xbc06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc06('0x2'));var rp=require(_0xbc06('0x3'));var moment=require(_0xbc06('0x4'));var BPromise=require(_0xbc06('0x5'));var Mustache=require(_0xbc06('0x6'));var util=require(_0xbc06('0x7'));var path=require('path');var sox=require(_0xbc06('0x8'));var csv=require(_0xbc06('0x9'));var ejs=require(_0xbc06('0xa'));var fs=require('fs');var fs_extra=require(_0xbc06('0xb'));var _=require(_0xbc06('0xc'));var squel=require(_0xbc06('0xd'));var crypto=require(_0xbc06('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbc06('0xf'));var toCsv=require(_0xbc06('0x9'));var querystring=require(_0xbc06('0x10'));var Papa=require(_0xbc06('0x11'));var Redis=require(_0xbc06('0x12'));var authService=require(_0xbc06('0x13'));var qs=require(_0xbc06('0x14'));var as=require(_0xbc06('0x15'));var hardwareService=require(_0xbc06('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xbc06('0x17'));var config=require(_0xbc06('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc06('0x19'))['db'];config[_0xbc06('0x1a')]=_[_0xbc06('0x1b')](config[_0xbc06('0x1a')],{'host':_0xbc06('0x1c'),'port':0x18eb});var socket=require(_0xbc06('0x1d'))(new Redis(config[_0xbc06('0x1a')]));require(_0xbc06('0x1e'))[_0xbc06('0x1f')](socket);function respondWithStatusCode(_0x2a7629,_0xaaea9b){_0xaaea9b=_0xaaea9b||0xcc;return function(_0x312e29){if(_0x312e29){return _0x2a7629[_0xbc06('0x20')](_0xaaea9b);}return _0x2a7629[_0xbc06('0x21')](_0xaaea9b)['end']();};}function respondWithResult(_0xe4ef47,_0x1abbc5){_0x1abbc5=_0x1abbc5||0xc8;return function(_0x3a2e12){if(_0x3a2e12){return _0xe4ef47[_0xbc06('0x21')](_0x1abbc5)[_0xbc06('0x22')](_0x3a2e12);}};}function respondWithFilteredResult(_0x48e8bc,_0x2305c9){return function(_0x4a4d87){if(_0x4a4d87){var _0x5f5922=typeof _0x2305c9[_0xbc06('0x23')]===_0xbc06('0x24')&&typeof _0x2305c9['limit']==='undefined';var _0x2d1b00=_0x4a4d87[_0xbc06('0x25')];var _0x1fd3da=_0x5f5922?0x0:_0x2305c9[_0xbc06('0x23')];var _0x3f3797=_0x5f5922?_0x4a4d87[_0xbc06('0x25')]:_0x2305c9['offset']+_0x2305c9[_0xbc06('0x26')];var _0x3f048b;if(_0x3f3797>=_0x2d1b00){_0x3f3797=_0x2d1b00;_0x3f048b=0xc8;}else{_0x3f048b=0xce;}_0x48e8bc[_0xbc06('0x21')](_0x3f048b);return _0x48e8bc['set']('Content-Range',_0x1fd3da+'-'+_0x3f3797+'/'+_0x2d1b00)[_0xbc06('0x22')](_0x4a4d87);}return null;};}function patchUpdates(_0x339fce){return function(_0x3c69e1){try{jsonpatch[_0xbc06('0x27')](_0x3c69e1,_0x339fce,!![]);}catch(_0x29ee2e){return BPromise[_0xbc06('0x28')](_0x29ee2e);}return _0x3c69e1['save']();};}function saveUpdates(_0x174892,_0x1646fc){return function(_0x2bb9b3){if(_0x2bb9b3){return _0x2bb9b3['update'](_0x174892)[_0xbc06('0x29')](function(_0x44fb2f){return _0x44fb2f;});}return null;};}function removeEntity(_0xb2602f,_0x423b21){return function(_0x27c425){if(_0x27c425){return _0x27c425[_0xbc06('0x2a')]()[_0xbc06('0x29')](function(){var _0x316517=_0x27c425[_0xbc06('0x2b')]({'plain':!![]});var _0x3ca0e6=_0xbc06('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ca0e6,'resourceId':_0x316517['id']}})[_0xbc06('0x29')](function(){return _0x27c425;});})[_0xbc06('0x29')](function(){_0xb2602f[_0xbc06('0x21')](0xcc)[_0xbc06('0x2d')]();});}};}function handleEntityNotFound(_0x293b74,_0x4fb3fc){return function(_0x12873c){if(!_0x12873c){_0x293b74['sendStatus'](0x194);}return _0x12873c;};}function handleError(_0x20b8af,_0x3139c3){_0x3139c3=_0x3139c3||0x1f4;return function(_0x4c3d38){logger['error'](_0x4c3d38[_0xbc06('0x2e')]);if(_0x4c3d38['name']){delete _0x4c3d38[_0xbc06('0x2f')];}_0x20b8af[_0xbc06('0x21')](_0x3139c3)[_0xbc06('0x30')](_0x4c3d38);};}exports[_0xbc06('0x31')]=function(_0x1792d6,_0x1eac57){var _0x520d74={},_0x3b7646={},_0x588e14={'count':0x0,'rows':[]};var _0x32a22c=_[_0xbc06('0x32')](db[_0xbc06('0x33')][_0xbc06('0x34')],function(_0xf56a25){return{'name':_0xf56a25['fieldName'],'type':_0xf56a25['type'][_0xbc06('0x35')]};});_0x3b7646['model']=_[_0xbc06('0x32')](_0x32a22c,_0xbc06('0x2f'));_0x3b7646[_0xbc06('0x36')]=_[_0xbc06('0x37')](_0x1792d6['query']);_0x3b7646[_0xbc06('0x38')]=_['intersection'](_0x3b7646[_0xbc06('0x39')],_0x3b7646[_0xbc06('0x36')]);_0x520d74[_0xbc06('0x3a')]=_[_0xbc06('0x3b')](_0x3b7646['model'],qs[_0xbc06('0x3c')](_0x1792d6['query'][_0xbc06('0x3c')]));_0x520d74[_0xbc06('0x3a')]=_0x520d74[_0xbc06('0x3a')][_0xbc06('0x3d')]?_0x520d74[_0xbc06('0x3a')]:_0x3b7646[_0xbc06('0x39')];if(!_0x1792d6[_0xbc06('0x36')][_0xbc06('0x3e')](_0xbc06('0x3f'))){_0x520d74[_0xbc06('0x26')]=qs['limit'](_0x1792d6[_0xbc06('0x36')][_0xbc06('0x26')]);_0x520d74[_0xbc06('0x23')]=qs[_0xbc06('0x23')](_0x1792d6[_0xbc06('0x36')][_0xbc06('0x23')]);}_0x520d74[_0xbc06('0x40')]=qs['sort'](_0x1792d6[_0xbc06('0x36')][_0xbc06('0x41')]);_0x520d74[_0xbc06('0x42')]=qs[_0xbc06('0x38')](_[_0xbc06('0x43')](_0x1792d6['query'],_0x3b7646[_0xbc06('0x38')]),_0x32a22c);if(_0x1792d6[_0xbc06('0x36')][_0xbc06('0x44')]){_0x520d74[_0xbc06('0x42')]=_[_0xbc06('0x45')](_0x520d74['where'],{'$or':_[_0xbc06('0x32')](_0x32a22c,function(_0x2432dd){if(_0x2432dd[_0xbc06('0x46')]!==_0xbc06('0x47')){var _0x58d2a3={};_0x58d2a3[_0x2432dd[_0xbc06('0x2f')]]={'$like':'%'+_0x1792d6[_0xbc06('0x36')]['filter']+'%'};return _0x58d2a3;}})});}_0x520d74=_['merge']({},_0x520d74,_0x1792d6[_0xbc06('0x48')]);var _0x43a312={'where':_0x520d74[_0xbc06('0x42')]};return db[_0xbc06('0x33')][_0xbc06('0x25')](_0x43a312)[_0xbc06('0x29')](function(_0x2a3c8e){_0x588e14[_0xbc06('0x25')]=_0x2a3c8e;if(_0x1792d6[_0xbc06('0x36')][_0xbc06('0x49')]){_0x520d74[_0xbc06('0x4a')]=[{'all':!![]}];}return db[_0xbc06('0x33')][_0xbc06('0x4b')](_0x520d74);})[_0xbc06('0x29')](function(_0x31d2cd){_0x588e14[_0xbc06('0x4c')]=_0x31d2cd;return _0x588e14;})[_0xbc06('0x29')](respondWithFilteredResult(_0x1eac57,_0x520d74))[_0xbc06('0x4d')](handleError(_0x1eac57,null));};exports[_0xbc06('0x4e')]=function(_0x3a4cab,_0x78422f){var _0x476893={'raw':!![],'where':{'id':_0x3a4cab[_0xbc06('0x4f')]['id']}},_0x4c22ea={};_0x4c22ea[_0xbc06('0x39')]=_[_0xbc06('0x37')](db[_0xbc06('0x33')][_0xbc06('0x34')]);_0x4c22ea['query']=_[_0xbc06('0x37')](_0x3a4cab[_0xbc06('0x36')]);_0x4c22ea[_0xbc06('0x38')]=_[_0xbc06('0x3b')](_0x4c22ea[_0xbc06('0x39')],_0x4c22ea[_0xbc06('0x36')]);_0x476893[_0xbc06('0x3a')]=_[_0xbc06('0x3b')](_0x4c22ea[_0xbc06('0x39')],qs[_0xbc06('0x3c')](_0x3a4cab[_0xbc06('0x36')][_0xbc06('0x3c')]));_0x476893[_0xbc06('0x3a')]=_0x476893[_0xbc06('0x3a')][_0xbc06('0x3d')]?_0x476893[_0xbc06('0x3a')]:_0x4c22ea['model'];if(_0x3a4cab[_0xbc06('0x36')][_0xbc06('0x49')]){_0x476893[_0xbc06('0x4a')]=[{'all':!![]}];}_0x476893=_[_0xbc06('0x45')]({},_0x476893,_0x3a4cab[_0xbc06('0x48')]);return db['OpenchannelQueue'][_0xbc06('0x50')](_0x476893)[_0xbc06('0x29')](handleEntityNotFound(_0x78422f,null))['then'](respondWithResult(_0x78422f,null))['catch'](handleError(_0x78422f,null));};exports[_0xbc06('0x51')]=function(_0x19b76f,_0x19296b){return db['OpenchannelQueue'][_0xbc06('0x51')](_0x19b76f[_0xbc06('0x52')],{})[_0xbc06('0x29')](function(_0x2038f7){var _0x328c1d=_0x19b76f[_0xbc06('0x53')][_0xbc06('0x2b')]({'plain':!![]});if(!_0x328c1d)throw new Error(_0xbc06('0x54'));if(_0x328c1d[_0xbc06('0x55')]==='user'){var _0x52cc62=_0x2038f7[_0xbc06('0x2b')]({'plain':!![]});var _0x4a418f=_0xbc06('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x4a418f,'userProfileId':_0x328c1d[_0xbc06('0x56')]},'raw':!![]})['then'](function(_0x5a7e55){if(_0x5a7e55&&_0x5a7e55[_0xbc06('0x57')]===0x0){return db['UserProfileResource'][_0xbc06('0x51')]({'name':_0x52cc62['name'],'resourceId':_0x52cc62['id'],'type':_0x5a7e55[_0xbc06('0x2f')],'sectionId':_0x5a7e55['id']},{})[_0xbc06('0x29')](function(){return _0x2038f7;});}else{return _0x2038f7;}})[_0xbc06('0x4d')](function(_0xbfc0d2){logger[_0xbc06('0x58')](_0xbc06('0x59'),_0xbfc0d2);throw _0xbfc0d2;});}return _0x2038f7;})[_0xbc06('0x29')](respondWithResult(_0x19296b,0xc9))[_0xbc06('0x4d')](handleError(_0x19296b,null));};exports[_0xbc06('0x5a')]=function(_0x4de161,_0x53f341){if(_0x4de161[_0xbc06('0x52')]['id']){delete _0x4de161[_0xbc06('0x52')]['id'];}return db[_0xbc06('0x33')]['find']({'where':{'id':_0x4de161['params']['id']}})['then'](handleEntityNotFound(_0x53f341,null))[_0xbc06('0x29')](saveUpdates(_0x4de161[_0xbc06('0x52')],null))['then'](respondWithResult(_0x53f341,null))[_0xbc06('0x4d')](handleError(_0x53f341,null));};exports['destroy']=function(_0xdae620,_0x1ad766){return db[_0xbc06('0x33')]['find']({'where':{'id':_0xdae620[_0xbc06('0x4f')]['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x1ad766,null))[_0xbc06('0x29')](removeEntity(_0x1ad766,null))[_0xbc06('0x4d')](handleError(_0x1ad766,null));};exports[_0xbc06('0x5b')]=function(_0x50a6e4,_0x680fa){return db[_0xbc06('0x33')]['describe']()['then'](respondWithResult(_0x680fa,null))['catch'](handleError(_0x680fa,null));};exports[_0xbc06('0x5c')]=function(_0x4a13a7,_0x1846c8,_0xed9ef5){var _0x222e29={'raw':!![],'where':{}},_0x121cd4={},_0x1c2cf5;return db[_0xbc06('0x33')][_0xbc06('0x5d')]({'where':{'id':_0x4a13a7[_0xbc06('0x4f')]['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x1846c8,null))[_0xbc06('0x29')](function(_0x4baf15){if(_0x4baf15){_0x1c2cf5=_0x4baf15[_0xbc06('0x2b')]({'plain':!![]});_0x121cd4[_0xbc06('0x39')]=_['keys'](db[_0xbc06('0x5e')][_0xbc06('0x34')]);_0x121cd4[_0xbc06('0x36')]=_[_0xbc06('0x37')](_0x4a13a7[_0xbc06('0x36')]);_0x121cd4[_0xbc06('0x38')]=_['intersection'](_0x121cd4[_0xbc06('0x39')],_0x121cd4[_0xbc06('0x36')]);_0x222e29[_0xbc06('0x3a')]=_[_0xbc06('0x3b')](_0x121cd4['model'],qs[_0xbc06('0x3c')](_0x4a13a7[_0xbc06('0x36')]['fields']));_0x222e29['attributes']=_0x222e29[_0xbc06('0x3a')]['length']?_0x222e29['attributes']:_0x121cd4[_0xbc06('0x39')];if(!_0x4a13a7[_0xbc06('0x36')][_0xbc06('0x3e')](_0xbc06('0x3f'))){_0x222e29['limit']=qs[_0xbc06('0x26')](_0x4a13a7[_0xbc06('0x36')][_0xbc06('0x26')]);_0x222e29[_0xbc06('0x23')]=qs[_0xbc06('0x23')](_0x4a13a7[_0xbc06('0x36')][_0xbc06('0x23')]);}_0x222e29[_0xbc06('0x40')]=qs[_0xbc06('0x41')](_0x4a13a7['query'][_0xbc06('0x41')]);_0x222e29[_0xbc06('0x42')]=qs[_0xbc06('0x38')](_[_0xbc06('0x43')](_0x4a13a7[_0xbc06('0x36')],_0x121cd4['filters']));_0x222e29['where'][_0xbc06('0x5f')]=_0x4baf15['id'];if(_0x4a13a7[_0xbc06('0x36')][_0xbc06('0x44')]){_0x222e29['where']=_[_0xbc06('0x45')](_0x222e29[_0xbc06('0x42')],{'$or':_[_0xbc06('0x32')](_0x222e29[_0xbc06('0x3a')],function(_0x144ca5){var _0x2a01a5={};_0x2a01a5[_0x144ca5]={'$like':'%'+_0x4a13a7[_0xbc06('0x36')][_0xbc06('0x44')]+'%'};return _0x2a01a5;})});}_0x222e29=_[_0xbc06('0x45')]({},_0x222e29,_0x4a13a7[_0xbc06('0x48')]);return db[_0xbc06('0x5e')][_0xbc06('0x4b')](_0x222e29);}})[_0xbc06('0x29')](function(_0x13c495){if(_0x13c495){return db[_0xbc06('0x60')][_0xbc06('0x61')]({'where':{'id':_['map'](_0x13c495,_0xbc06('0x62')),'role':_0xbc06('0x63')},'attributes':['id',_0xbc06('0x2f'),_0xbc06('0x64'),_0xbc06('0x65'),_0xbc06('0x66')]});}})[_0xbc06('0x29')](function(_0x17a266){if(_0x17a266){return{'count':_0x17a266[_0xbc06('0x25')],'rows':_[_0xbc06('0x32')](_0x17a266['rows'],function(_0x486955){return{'membername':_0x486955[_0xbc06('0x2f')],'UserId':_0x486955['id'],'queue_name':_0x1c2cf5['name'],'OpenchannelQueueId':_0x1c2cf5['id'],'interface':util[_0xbc06('0x67')](_0xbc06('0x68'),_0xbc06('0x69'),_0x486955[_0xbc06('0x2f')]),'penalty':0x0,'paused':_0x486955[_0xbc06('0x64')],'createdAt':_0x486955['createdAt'],'updatedAt':_0x486955[_0xbc06('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc06('0x29')](respondWithFilteredResult(_0x1846c8,_0x222e29))[_0xbc06('0x4d')](handleError(_0x1846c8,null));};exports['getTeams']=function(_0x486ec6,_0x18b661,_0x37bf1d){var _0x1483a7={};var _0x467a4b={};var _0x5664ba;var _0x4eb129;return db[_0xbc06('0x33')][_0xbc06('0x5d')]({'where':{'id':_0x486ec6['params']['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x18b661,null))['then'](function(_0xfba7a){if(_0xfba7a){_0x5664ba=_0xfba7a;_0x467a4b[_0xbc06('0x39')]=_[_0xbc06('0x37')](db[_0xbc06('0x6a')][_0xbc06('0x34')]);_0x467a4b[_0xbc06('0x36')]=_['keys'](_0x486ec6[_0xbc06('0x36')]);_0x467a4b['filters']=_[_0xbc06('0x3b')](_0x467a4b[_0xbc06('0x39')],_0x467a4b[_0xbc06('0x36')]);_0x1483a7[_0xbc06('0x3a')]=_[_0xbc06('0x3b')](_0x467a4b['model'],qs[_0xbc06('0x3c')](_0x486ec6[_0xbc06('0x36')][_0xbc06('0x3c')]));_0x1483a7['attributes']=_0x1483a7['attributes'][_0xbc06('0x3d')]?_0x1483a7[_0xbc06('0x3a')]:_0x467a4b[_0xbc06('0x39')];_0x1483a7[_0xbc06('0x40')]=qs[_0xbc06('0x41')](_0x486ec6['query'][_0xbc06('0x41')]);_0x1483a7[_0xbc06('0x42')]=qs[_0xbc06('0x38')](_[_0xbc06('0x43')](_0x486ec6['query'],_0x467a4b['filters']));if(_0x486ec6[_0xbc06('0x36')][_0xbc06('0x44')]){_0x1483a7['where']=_[_0xbc06('0x45')](_0x1483a7[_0xbc06('0x42')],{'$or':_[_0xbc06('0x32')](_0x1483a7[_0xbc06('0x3a')],function(_0x377825){var _0x2db049={};_0x2db049[_0x377825]={'$like':'%'+_0x486ec6[_0xbc06('0x36')]['filter']+'%'};return _0x2db049;})});}_0x1483a7=_['merge']({},_0x1483a7,_0x486ec6[_0xbc06('0x48')]);return _0x5664ba['getTeams'](_0x1483a7);}})[_0xbc06('0x29')](function(_0x199ee0){if(_0x199ee0){_0x4eb129=_0x199ee0[_0xbc06('0x3d')];if(!_0x486ec6[_0xbc06('0x36')]['hasOwnProperty'](_0xbc06('0x3f'))){_0x1483a7[_0xbc06('0x26')]=qs[_0xbc06('0x26')](_0x486ec6[_0xbc06('0x36')][_0xbc06('0x26')]);_0x1483a7['offset']=qs[_0xbc06('0x23')](_0x486ec6[_0xbc06('0x36')][_0xbc06('0x23')]);}return _0x5664ba['getTeams'](_0x1483a7);}})['then'](function(_0x258376){if(_0x258376){return _0x258376?{'count':_0x4eb129,'rows':_0x258376}:null;}})[_0xbc06('0x29')](respondWithResult(_0x18b661,null))['catch'](handleError(_0x18b661,null));};exports[_0xbc06('0x6b')]=function(_0x25c48a,_0x33173b,_0x1dd1eb){var _0x38d83e=_0x25c48a[_0xbc06('0x52')][_0xbc06('0x6c')];return db['Team'][_0xbc06('0x4b')]({'where':{'id':_0x38d83e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbc06('0x6d'),'attributes':['id',_0xbc06('0x2f'),_0xbc06('0x6e'),_0xbc06('0x6f'),'interface'],'raw':!![]}]})[_0xbc06('0x29')](function(_0x20721d){if(_0x20721d){var _0x38e3f7=_[_0xbc06('0x70')](_0x20721d,function(_0x454f36){var _0x31f869=_0x454f36['get']({'plain':!![]});return _0x31f869[_0xbc06('0x6d')];});return db[_0xbc06('0x33')]['find']({'where':{'id':_0x25c48a[_0xbc06('0x4f')]['id']}})[_0xbc06('0x29')](function(_0x2f7fb3){return db[_0xbc06('0x71')]['transaction'](function(_0x218377){return _0x2f7fb3[_0xbc06('0x6b')](_0x38d83e,{'transaction':_0x218377})[_0xbc06('0x29')](function(){return BPromise['each'](_0x38e3f7,function(_0x354f00){return db[_0xbc06('0x5e')][_0xbc06('0x72')]({'where':{'UserId':_0x354f00['id'],'OpenchannelQueueId':_0x25c48a[_0xbc06('0x4f')]['id']},'transaction':_0x218377});});})['then'](function(){_0x38e3f7[_0xbc06('0x73')](function(_0x9e2578){socket[_0xbc06('0x74')](_0xbc06('0x75'),{'UserId':_0x9e2578['id'],'OpenchannelQueueId':_0x2f7fb3['id']});});});});});}})['then'](respondWithStatusCode(_0x33173b,null))['catch'](handleError(_0x33173b,null));};exports[_0xbc06('0x76')]=function(_0x2d38b3,_0x5d5f99,_0x2b8ebb){return db[_0xbc06('0x6a')][_0xbc06('0x4b')]({'where':{'id':_0x2d38b3[_0xbc06('0x36')][_0xbc06('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xbc06('0x60')],'as':_0xbc06('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xbc06('0x29')](handleEntityNotFound(_0x5d5f99,null))['then'](function(_0x26b7df){var _0x1f81d3=_['map'](_0x26b7df,'id');var _0xd2df36=[];var _0x442f09=[];var _0x369d68=squel[_0xbc06('0x77')]();_0x369d68['field'](_0xbc06('0x78'))[_0xbc06('0x79')](_0xbc06('0x7a'),'tq')['join'](_0xbc06('0x7b'),'ut',_0xbc06('0x7c'))[_0xbc06('0x42')](_0xbc06('0x7d'),_0x2d38b3['params']['id']);for(var _0x243991=0x0;_0x243991<_0x26b7df[_0xbc06('0x3d')];_0x243991+=0x1){let _0x192948=_0x26b7df[_0x243991];for(var _0xee565f=0x0;_0xee565f<_0x192948[_0xbc06('0x6d')]['length'];_0xee565f+=0x1){let _0x449410=_0x192948[_0xbc06('0x6d')][_0xee565f];var _0x136911=_0x369d68['clone']();_0x136911[_0xbc06('0x42')](_0xbc06('0x7e'),_0x449410['id']);_0x442f09[_0xbc06('0x7f')](db[_0xbc06('0x71')][_0xbc06('0x36')](_0x136911[_0xbc06('0x80')](),{'type':db[_0xbc06('0x71')][_0xbc06('0x81')][_0xbc06('0x82')]})[_0xbc06('0x29')](function(_0xc1971b){if(_0xc1971b[_0xbc06('0x3d')]===0x1){return _0x449410['id'];}else{var _0x52b815=_[_0xbc06('0x83')](_['map'](_0xc1971b,_0xbc06('0x84')),function(_0x1f3eae){return _[_0xbc06('0x85')](_0x1f81d3,_0x1f3eae);});if(_0x52b815){return _0x449410['id'];}}}));}}return BPromise[_0xbc06('0x86')](_0x442f09)[_0xbc06('0x29')](function(_0x1951fd){_0xd2df36=_(_0xd2df36)[_0xbc06('0x87')](_0x1951fd)[_0xbc06('0x88')]()[_0xbc06('0x89')]();return db['OpenchannelQueue'][_0xbc06('0x50')]({'where':{'id':_0x2d38b3['params']['id']}})['then'](function(_0x11ab33){return db[_0xbc06('0x71')][_0xbc06('0x8a')](function(_0x3b7ec2){return _0x11ab33['removeTeams'](_0x2d38b3[_0xbc06('0x36')][_0xbc06('0x6c')],{'transaction':_0x3b7ec2})[_0xbc06('0x29')](function(){if(!_[_0xbc06('0x8b')](_0xd2df36)){return _0x11ab33[_0xbc06('0x8c')](_0xd2df36,{'transaction':_0x3b7ec2});}})['then'](function(){_0xd2df36[_0xbc06('0x73')](function(_0x22890b){socket[_0xbc06('0x74')](_0xbc06('0x8d'),{'UserId':_0x22890b,'OpenchannelQueueId':_0x11ab33['id']});});});});});});})['then'](respondWithStatusCode(_0x5d5f99,null))[_0xbc06('0x4d')](handleError(_0x5d5f99,null));};exports[_0xbc06('0x8e')]=function(_0x30b4eb,_0x53cecd,_0xe02d4b){return db[_0xbc06('0x33')][_0xbc06('0x50')]({'where':{'id':_0x30b4eb['params']['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x53cecd,null))['then'](function(_0x37476a){if(_0x37476a){return _0x37476a[_0xbc06('0x8e')](_0x30b4eb[_0xbc06('0x52')][_0xbc06('0x6c')],_[_0xbc06('0x8f')](_0x30b4eb['body'],[_0xbc06('0x6c'),'id'])||{})[_0xbc06('0x90')](function(_0x543366){for(var _0x2f38bf=0x0;_0x2f38bf<_0x30b4eb[_0xbc06('0x52')][_0xbc06('0x6c')][_0xbc06('0x3d')];_0x2f38bf+=0x1){socket['emit'](_0xbc06('0x75'),{'UserId':Number(_0x30b4eb['body'][_0xbc06('0x6c')][_0x2f38bf]),'OpenchannelQueueId':Number(_0x30b4eb[_0xbc06('0x4f')]['id'])});}return _0x543366;});}})[_0xbc06('0x29')](respondWithResult(_0x53cecd,null))[_0xbc06('0x4d')](handleError(_0x53cecd,null));};exports[_0xbc06('0x8c')]=function(_0x2d4ae1,_0x5e5d0d,_0x1f0bde){return db[_0xbc06('0x33')][_0xbc06('0x50')]({'where':{'id':_0x2d4ae1['params']['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x5e5d0d,null))[_0xbc06('0x29')](function(_0x37a848){if(_0x37a848){return _0x37a848['removeAgents'](_0x2d4ae1[_0xbc06('0x36')][_0xbc06('0x6c')])[_0xbc06('0x29')](function(){if(_[_0xbc06('0x91')](_0x2d4ae1[_0xbc06('0x36')][_0xbc06('0x6c')])){for(var _0x561984=0x0;_0x561984<_0x2d4ae1[_0xbc06('0x36')][_0xbc06('0x6c')][_0xbc06('0x3d')];_0x561984+=0x1){socket[_0xbc06('0x74')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2d4ae1[_0xbc06('0x36')][_0xbc06('0x6c')][_0x561984]),'OpenchannelQueueId':Number(_0x2d4ae1[_0xbc06('0x4f')]['id'])});}}else{socket[_0xbc06('0x74')](_0xbc06('0x8d'),{'UserId':Number(_0x2d4ae1[_0xbc06('0x36')]['ids']),'OpenchannelQueueId':Number(_0x2d4ae1[_0xbc06('0x4f')]['id'])});}});}})[_0xbc06('0x29')](respondWithStatusCode(_0x5e5d0d,null))[_0xbc06('0x4d')](handleError(_0x5e5d0d,null));};exports['getAgents']=function(_0x4adeca,_0x5d6f4d,_0x51fb6b){var _0x4fac45={};var _0x2ad283={};var _0x325091;var _0x615948;return db[_0xbc06('0x33')][_0xbc06('0x5d')]({'where':{'id':_0x4adeca[_0xbc06('0x4f')]['id']}})[_0xbc06('0x29')](handleEntityNotFound(_0x5d6f4d,null))[_0xbc06('0x29')](function(_0x7472ba){if(_0x7472ba){_0x325091=_0x7472ba;_0x2ad283['model']=_[_0xbc06('0x37')](db['User'][_0xbc06('0x34')]);_0x2ad283['query']=_[_0xbc06('0x37')](_0x4adeca[_0xbc06('0x36')]);_0x2ad283[_0xbc06('0x38')]=_[_0xbc06('0x3b')](_0x2ad283[_0xbc06('0x39')],_0x2ad283[_0xbc06('0x36')]);_0x4fac45[_0xbc06('0x3a')]=_['intersection'](_0x2ad283[_0xbc06('0x39')],qs['fields'](_0x4adeca['query'][_0xbc06('0x3c')]));_0x4fac45[_0xbc06('0x3a')]=_0x4fac45['attributes'][_0xbc06('0x3d')]?_0x4fac45[_0xbc06('0x3a')]:_0x2ad283[_0xbc06('0x39')];_0x4fac45[_0xbc06('0x40')]=qs[_0xbc06('0x41')](_0x4adeca[_0xbc06('0x36')][_0xbc06('0x41')]);_0x4fac45['where']=qs[_0xbc06('0x38')](_[_0xbc06('0x43')](_0x4adeca['query'],_0x2ad283[_0xbc06('0x38')]));if(_0x4adeca['query'][_0xbc06('0x44')]){_0x4fac45[_0xbc06('0x42')]=_['merge'](_0x4fac45[_0xbc06('0x42')],{'$or':_['map'](_0x4fac45[_0xbc06('0x3a')],function(_0x365270){var _0x30737a={};_0x30737a[_0x365270]={'$like':'%'+_0x4adeca['query']['filter']+'%'};return _0x30737a;})});}_0x4fac45=_[_0xbc06('0x45')]({},_0x4fac45,_0x4adeca[_0xbc06('0x48')]);return _0x325091[_0xbc06('0x92')](_0x4fac45);}})[_0xbc06('0x29')](function(_0x267228){if(_0x267228){_0x615948=_0x267228[_0xbc06('0x3d')];if(!_0x4adeca['query']['hasOwnProperty'](_0xbc06('0x3f'))){_0x4fac45['limit']=qs[_0xbc06('0x26')](_0x4adeca[_0xbc06('0x36')]['limit']);_0x4fac45[_0xbc06('0x23')]=qs['offset'](_0x4adeca[_0xbc06('0x36')][_0xbc06('0x23')]);}return _0x325091['getAgents'](_0x4fac45);}})[_0xbc06('0x29')](function(_0x38811d){if(_0x38811d){return _0x38811d?{'count':_0x615948,'rows':_0x38811d}:null;}})[_0xbc06('0x29')](respondWithResult(_0x5d6f4d,null))[_0xbc06('0x4d')](handleError(_0x5d6f4d,null));};
\ No newline at end of file
index 16b3c78..3352085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7d4=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x244b6f,_0xdf7d4a){var _0x502dbb=function(_0x32ff72){while(--_0x32ff72){_0x244b6f['push'](_0x244b6f['shift']());}};_0x502dbb(++_0xdf7d4a);}(_0xb7d4,0x1cc));var _0x4b7d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7d4[_0xbd08b4];return _0x314f1e;};'use strict';var EventEmitter=require(_0x4b7d('0x0'));var OpenchannelQueue=require(_0x4b7d('0x1'))['db'][_0x4b7d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4b7d('0x3')](0x0);var events={'afterCreate':_0x4b7d('0x4'),'afterUpdate':_0x4b7d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x20ac02){return function(_0x48b262,_0x3b603a,_0x24887b){OpenchannelQueueEvents[_0x4b7d('0x6')](_0x20ac02+':'+_0x48b262['id'],_0x48b262);OpenchannelQueueEvents[_0x4b7d('0x6')](_0x20ac02,_0x48b262);_0x24887b(null);};}for(var e in events){if(events[_0x4b7d('0x7')](e)){var event=events[e];OpenchannelQueue[_0x4b7d('0x8')](e,emitEvent(event));}}module[_0x4b7d('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xf234=['OpenchannelQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','../../mysqldb'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0xf234,0xdf));var _0x4f23=function(_0xc70e7d,_0x24eefa){_0xc70e7d=_0xc70e7d-0x0;var _0x16052a=_0xf234[_0xc70e7d];return _0x16052a;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x4f23('0x0'))['db'][_0x4f23('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4f23('0x2')](0x0);var events={'afterCreate':_0x4f23('0x3'),'afterUpdate':_0x4f23('0x4'),'afterDestroy':_0x4f23('0x5')};function emitEvent(_0x258cf9){return function(_0x2a56d8,_0x4d6a68,_0x288abc){OpenchannelQueueEvents['emit'](_0x258cf9+':'+_0x2a56d8['id'],_0x2a56d8);OpenchannelQueueEvents['emit'](_0x258cf9,_0x2a56d8);_0x288abc(null);};}for(var e in events){if(events[_0x4f23('0x6')](e)){var event=events[e];OpenchannelQueue[_0x4f23('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index fcec328..c6613a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ac=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash'];(function(_0x5606f4,_0xf2a2c){var _0x20d7d0=function(_0x4d386f){while(--_0x4d386f){_0x5606f4['push'](_0x5606f4['shift']());}};_0x20d7d0(++_0xf2a2c);}(_0xb0ac,0x1c7));var _0xcb0a=function(_0x32c123,_0xcd59ed){_0x32c123=_0x32c123-0x0;var _0x476145=_0xb0ac[_0x32c123];return _0x476145;};'use strict';var _=require(_0xcb0a('0x0'));var util=require('util');var logger=require(_0xcb0a('0x1'))(_0xcb0a('0x2'));var moment=require(_0xcb0a('0x3'));var BPromise=require(_0xcb0a('0x4'));var rp=require(_0xcb0a('0x5'));var fs=require('fs');var path=require(_0xcb0a('0x6'));var rimraf=require(_0xcb0a('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb0a('0x8'));module[_0xcb0a('0x9')]=function(_0xdf070,_0x23cb42){return _0xdf070[_0xcb0a('0xa')](_0xcb0a('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13ce=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','moment'];(function(_0x1f53c3,_0x4e8a17){var _0x454280=function(_0x29e71e){while(--_0x29e71e){_0x1f53c3['push'](_0x1f53c3['shift']());}};_0x454280(++_0x4e8a17);}(_0x13ce,0x1d1));var _0xe13c=function(_0x75e032,_0x1a4027){_0x75e032=_0x75e032-0x0;var _0x5e9100=_0x13ce[_0x75e032];return _0x5e9100;};'use strict';var _=require(_0xe13c('0x0'));var util=require(_0xe13c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe13c('0x2'));var BPromise=require(_0xe13c('0x3'));var rp=require(_0xe13c('0x4'));var fs=require('fs');var path=require(_0xe13c('0x5'));var rimraf=require(_0xe13c('0x6'));var config=require(_0xe13c('0x7'));var attributes=require(_0xe13c('0x8'));module[_0xe13c('0x9')]=function(_0x1adf67,_0x15a1d0){return _0x1adf67[_0xe13c('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xe13c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cee049c..dafbb45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6349=['findAll','options','where','attributes','model','include','map','then','find','raw','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue'];(function(_0x5d2c3c,_0x2a9f0c){var _0x2917f4=function(_0x193ec5){while(--_0x193ec5){_0x5d2c3c['push'](_0x5d2c3c['shift']());}};_0x2917f4(++_0x2a9f0c);}(_0x6349,0x1b8));var _0x9634=function(_0x40a237,_0x440a13){_0x40a237=_0x40a237-0x0;var _0x57a2bb=_0x6349[_0x40a237];return _0x57a2bb;};'use strict';var _=require(_0x9634('0x0'));var util=require(_0x9634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9634('0x2'));var fs=require('fs');var Redis=require(_0x9634('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9634('0x4'));var logger=require(_0x9634('0x5'))(_0x9634('0x6'));var config=require(_0x9634('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9634('0x8')]({'port':0x232a});config[_0x9634('0x9')]=_[_0x9634('0xa')](config[_0x9634('0x9')],{'host':_0x9634('0xb'),'port':0x18eb});var socket=require(_0x9634('0xc'))(new Redis(config[_0x9634('0x9')]));require(_0x9634('0xd'))[_0x9634('0xe')](socket);function respondWithRpcPromise(_0x3785cd,_0x97fc95,_0xdcd4a){return new BPromise(function(_0x7f7fa6,_0x125aca){return client[_0x9634('0xf')](_0x3785cd,_0xdcd4a)['then'](function(_0x382d2b){logger[_0x9634('0x10')](_0x9634('0x11'),_0x97fc95,_0x9634('0x12'));logger[_0x9634('0x13')](_0x9634('0x14'),_0x97fc95,_0x9634('0x12'),JSON[_0x9634('0x15')](_0x382d2b));if(_0x382d2b[_0x9634('0x16')]){if(_0x382d2b[_0x9634('0x16')][_0x9634('0x17')]===0x1f4){logger[_0x9634('0x16')](_0x9634('0x11'),_0x97fc95,_0x382d2b[_0x9634('0x16')][_0x9634('0x18')]);return _0x125aca(_0x382d2b[_0x9634('0x16')]['message']);}logger[_0x9634('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x97fc95,_0x382d2b['error'][_0x9634('0x18')]);return _0x7f7fa6(_0x382d2b[_0x9634('0x16')]['message']);}else{logger['info'](_0x9634('0x11'),_0x97fc95,_0x9634('0x12'));_0x7f7fa6(_0x382d2b[_0x9634('0x19')][_0x9634('0x18')]);}})[_0x9634('0x1a')](function(_0xd0fc0b){logger[_0x9634('0x16')](_0x9634('0x11'),_0x97fc95,_0xd0fc0b);_0x125aca(_0xd0fc0b);});});}exports[_0x9634('0x1b')]=function(_0x3b2ad4){var _0xe2a1ae=this;return new Promise(function(_0x2188dc,_0x3bd84a){return db['OpenchannelQueue'][_0x9634('0x1c')]({'raw':_0x3b2ad4[_0x9634('0x1d')]?_0x3b2ad4['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b2ad4[_0x9634('0x1d')]?_0x3b2ad4[_0x9634('0x1d')][_0x9634('0x1e')]||null:null,'attributes':_0x3b2ad4[_0x9634('0x1d')]?_0x3b2ad4[_0x9634('0x1d')][_0x9634('0x1f')]||null:null,'limit':_0x3b2ad4[_0x9634('0x1d')]?_0x3b2ad4[_0x9634('0x1d')]['limit']||null:null,'include':_0x3b2ad4[_0x9634('0x1d')]?_0x3b2ad4[_0x9634('0x1d')]['include']?_['map'](_0x3b2ad4[_0x9634('0x1d')]['include'],function(_0x51e228){return{'model':db[_0x51e228[_0x9634('0x20')]],'as':_0x51e228['as'],'attributes':_0x51e228['attributes'],'include':_0x51e228[_0x9634('0x21')]?_[_0x9634('0x22')](_0x51e228[_0x9634('0x21')],function(_0x3ef4b6){return{'model':db[_0x3ef4b6[_0x9634('0x20')]],'as':_0x3ef4b6['as'],'attributes':_0x3ef4b6['attributes'],'include':_0x3ef4b6[_0x9634('0x21')]?_[_0x9634('0x22')](_0x3ef4b6[_0x9634('0x21')],function(_0x5d78dd){return{'model':db[_0x5d78dd[_0x9634('0x20')]],'as':_0x5d78dd['as'],'attributes':_0x5d78dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9634('0x23')](function(_0x2df452){logger[_0x9634('0x10')](_0x9634('0x1b'),_0x3b2ad4);logger[_0x9634('0x13')](_0x9634('0x1b'),_0x3b2ad4,JSON[_0x9634('0x15')](_0x2df452));_0x2188dc(_0x2df452);})[_0x9634('0x1a')](function(_0x56a0fd){logger['error']('GetOpenchannelQueue',_0x56a0fd[_0x9634('0x18')],_0x3b2ad4);_0x3bd84a(_0xe2a1ae['error'](0x1f4,_0x56a0fd[_0x9634('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x102ecd){var _0x269c79=this;return new Promise(function(_0x1e5ac5,_0xa63e32){return db['OpenchannelQueue'][_0x9634('0x24')]({'raw':_0x102ecd[_0x9634('0x1d')]?_0x102ecd[_0x9634('0x1d')][_0x9634('0x25')]===undefined?!![]:![]:!![],'where':_0x102ecd[_0x9634('0x1d')]?_0x102ecd[_0x9634('0x1d')]['where']||null:null,'attributes':_0x102ecd[_0x9634('0x1d')]?_0x102ecd['options'][_0x9634('0x1f')]||null:null,'include':_0x102ecd['options']?_0x102ecd[_0x9634('0x1d')][_0x9634('0x21')]?_['map'](_0x102ecd[_0x9634('0x1d')][_0x9634('0x21')],function(_0x33d84d){return{'model':db[_0x33d84d[_0x9634('0x20')]],'as':_0x33d84d['as'],'attributes':_0x33d84d[_0x9634('0x1f')],'include':_0x33d84d[_0x9634('0x21')]?_['map'](_0x33d84d[_0x9634('0x21')],function(_0x1aab7c){return{'model':db[_0x1aab7c[_0x9634('0x20')]],'as':_0x1aab7c['as'],'attributes':_0x1aab7c[_0x9634('0x1f')],'include':_0x1aab7c[_0x9634('0x21')]?_[_0x9634('0x22')](_0x1aab7c[_0x9634('0x21')],function(_0x5a5ae7){return{'model':db[_0x5a5ae7[_0x9634('0x20')]],'as':_0x5a5ae7['as'],'attributes':_0x5a5ae7[_0x9634('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9634('0x23')](function(_0x35434b){logger['info'](_0x9634('0x26'),_0x102ecd);logger[_0x9634('0x13')](_0x9634('0x26'),_0x102ecd,JSON[_0x9634('0x15')](_0x35434b));_0x1e5ac5(_0x35434b);})[_0x9634('0x1a')](function(_0x5b133a){logger[_0x9634('0x16')](_0x9634('0x26'),_0x5b133a[_0x9634('0x18')],_0x102ecd);_0xa63e32(_0x269c79[_0x9634('0x16')](0x1f4,_0x5b133a[_0x9634('0x18')]));});});};
\ No newline at end of file
+var _0x120c=['include','map','model','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit'];(function(_0x3edc8b,_0x1996cb){var _0xbf74e5=function(_0x2fcc27){while(--_0x2fcc27){_0x3edc8b['push'](_0x3edc8b['shift']());}};_0xbf74e5(++_0x1996cb);}(_0x120c,0xfb));var _0xc120=function(_0x1f2df3,_0x2e5430){_0x1f2df3=_0x1f2df3-0x0;var _0x395aaf=_0x120c[_0x1f2df3];return _0x395aaf;};'use strict';var _=require(_0xc120('0x0'));var util=require(_0xc120('0x1'));var moment=require('moment');var BPromise=require(_0xc120('0x2'));var rs=require(_0xc120('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc120('0x4'))['db'];var utils=require(_0xc120('0x5'));var logger=require(_0xc120('0x6'))(_0xc120('0x7'));var config=require(_0xc120('0x8'));var jayson=require(_0xc120('0x9'));var client=jayson[_0xc120('0xa')][_0xc120('0xb')]({'port':0x232a});config[_0xc120('0xc')]=_[_0xc120('0xd')](config[_0xc120('0xc')],{'host':_0xc120('0xe'),'port':0x18eb});var socket=require(_0xc120('0xf'))(new Redis(config[_0xc120('0xc')]));require('./openchannelQueue.socket')[_0xc120('0x10')](socket);function respondWithRpcPromise(_0xf68577,_0x4e9e1b,_0xb6272c){return new BPromise(function(_0x228f07,_0x1261fe){return client[_0xc120('0x11')](_0xf68577,_0xb6272c)[_0xc120('0x12')](function(_0x5f5163){logger['info'](_0xc120('0x13'),_0x4e9e1b,_0xc120('0x14'));logger[_0xc120('0x15')](_0xc120('0x16'),_0x4e9e1b,_0xc120('0x14'),JSON[_0xc120('0x17')](_0x5f5163));if(_0x5f5163['error']){if(_0x5f5163[_0xc120('0x18')][_0xc120('0x19')]===0x1f4){logger['error'](_0xc120('0x13'),_0x4e9e1b,_0x5f5163[_0xc120('0x18')]['message']);return _0x1261fe(_0x5f5163[_0xc120('0x18')][_0xc120('0x1a')]);}logger['error'](_0xc120('0x13'),_0x4e9e1b,_0x5f5163['error'][_0xc120('0x1a')]);return _0x228f07(_0x5f5163[_0xc120('0x18')][_0xc120('0x1a')]);}else{logger[_0xc120('0x1b')](_0xc120('0x13'),_0x4e9e1b,'request\x20sent');_0x228f07(_0x5f5163['result'][_0xc120('0x1a')]);}})[_0xc120('0x1c')](function(_0x3bc45d){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4e9e1b,_0x3bc45d);_0x1261fe(_0x3bc45d);});});}exports[_0xc120('0x1d')]=function(_0x190589){var _0x19d560=this;return new Promise(function(_0xde117a,_0x21704d){return db[_0xc120('0x1e')][_0xc120('0x1f')]({'raw':_0x190589['options']?_0x190589[_0xc120('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x190589[_0xc120('0x20')]?_0x190589[_0xc120('0x20')][_0xc120('0x21')]||null:null,'attributes':_0x190589['options']?_0x190589[_0xc120('0x20')][_0xc120('0x22')]||null:null,'limit':_0x190589[_0xc120('0x20')]?_0x190589[_0xc120('0x20')][_0xc120('0x23')]||null:null,'include':_0x190589[_0xc120('0x20')]?_0x190589[_0xc120('0x20')][_0xc120('0x24')]?_[_0xc120('0x25')](_0x190589[_0xc120('0x20')][_0xc120('0x24')],function(_0x4e8f02){return{'model':db[_0x4e8f02[_0xc120('0x26')]],'as':_0x4e8f02['as'],'attributes':_0x4e8f02[_0xc120('0x22')],'include':_0x4e8f02[_0xc120('0x24')]?_[_0xc120('0x25')](_0x4e8f02[_0xc120('0x24')],function(_0x32f37a){return{'model':db[_0x32f37a[_0xc120('0x26')]],'as':_0x32f37a['as'],'attributes':_0x32f37a[_0xc120('0x22')],'include':_0x32f37a[_0xc120('0x24')]?_[_0xc120('0x25')](_0x32f37a[_0xc120('0x24')],function(_0x3d9154){return{'model':db[_0x3d9154['model']],'as':_0x3d9154['as'],'attributes':_0x3d9154[_0xc120('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c66f1){logger[_0xc120('0x1b')](_0xc120('0x1d'),_0x190589);logger['debug']('GetOpenchannelQueue',_0x190589,JSON['stringify'](_0x4c66f1));_0xde117a(_0x4c66f1);})[_0xc120('0x1c')](function(_0x3ce12a){logger[_0xc120('0x18')](_0xc120('0x1d'),_0x3ce12a[_0xc120('0x1a')],_0x190589);_0x21704d(_0x19d560[_0xc120('0x18')](0x1f4,_0x3ce12a['message']));});});};exports[_0xc120('0x27')]=function(_0xa11efc){var _0xeaa7b8=this;return new Promise(function(_0xc346c3,_0x5e0b81){return db[_0xc120('0x1e')][_0xc120('0x28')]({'raw':_0xa11efc[_0xc120('0x20')]?_0xa11efc[_0xc120('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xa11efc[_0xc120('0x20')]?_0xa11efc[_0xc120('0x20')][_0xc120('0x21')]||null:null,'attributes':_0xa11efc[_0xc120('0x20')]?_0xa11efc['options'][_0xc120('0x22')]||null:null,'include':_0xa11efc[_0xc120('0x20')]?_0xa11efc[_0xc120('0x20')][_0xc120('0x24')]?_[_0xc120('0x25')](_0xa11efc['options'][_0xc120('0x24')],function(_0x66f3b0){return{'model':db[_0x66f3b0[_0xc120('0x26')]],'as':_0x66f3b0['as'],'attributes':_0x66f3b0[_0xc120('0x22')],'include':_0x66f3b0[_0xc120('0x24')]?_[_0xc120('0x25')](_0x66f3b0[_0xc120('0x24')],function(_0x3a9f97){return{'model':db[_0x3a9f97[_0xc120('0x26')]],'as':_0x3a9f97['as'],'attributes':_0x3a9f97[_0xc120('0x22')],'include':_0x3a9f97['include']?_[_0xc120('0x25')](_0x3a9f97[_0xc120('0x24')],function(_0x4ebc82){return{'model':db[_0x4ebc82[_0xc120('0x26')]],'as':_0x4ebc82['as'],'attributes':_0x4ebc82[_0xc120('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc120('0x12')](function(_0x1a3e1d){logger[_0xc120('0x1b')](_0xc120('0x27'),_0xa11efc);logger['debug'](_0xc120('0x27'),_0xa11efc,JSON[_0xc120('0x17')](_0x1a3e1d));_0xc346c3(_0x1a3e1d);})[_0xc120('0x1c')](function(_0x43afff){logger[_0xc120('0x18')](_0xc120('0x27'),_0x43afff[_0xc120('0x1a')],_0xa11efc);_0x5e0b81(_0xeaa7b8[_0xc120('0x18')](0x1f4,_0x43afff[_0xc120('0x1a')]));});});};
\ No newline at end of file
index 324692e..07e95bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44b0=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x446d2e,_0x4bc597){var _0x1739de=function(_0x1c137c){while(--_0x1c137c){_0x446d2e['push'](_0x446d2e['shift']());}};_0x1739de(++_0x4bc597);}(_0x44b0,0x167));var _0x044b=function(_0x53260d,_0x36c730){_0x53260d=_0x53260d-0x0;var _0x31229e=_0x44b0[_0x53260d];return _0x31229e;};'use strict';var OpenchannelQueueEvents=require(_0x044b('0x0'));var events=[_0x044b('0x1'),_0x044b('0x2'),_0x044b('0x3')];function createListener(_0x1688fc,_0xbe116e){return function(_0x2d676a){_0xbe116e[_0x044b('0x4')](_0x1688fc,_0x2d676a);};}function removeListener(_0x42f662,_0xf63cce){return function(){OpenchannelQueueEvents[_0x044b('0x5')](_0x42f662,_0xf63cce);};}exports[_0x044b('0x6')]=function(_0x4b995a){for(var _0x123e52=0x0,_0xe9747b=events[_0x044b('0x7')];_0x123e52<_0xe9747b;_0x123e52++){var _0xae1043=events[_0x123e52];var _0x6e100=createListener(_0x044b('0x8')+_0xae1043,_0x4b995a);OpenchannelQueueEvents['on'](_0xae1043,_0x6e100);}};
\ No newline at end of file
+var _0x6487=['openchannelQueue:','./openchannelQueue.events','emit','removeListener','register','length'];(function(_0x30b56a,_0x586d86){var _0x4eca63=function(_0x11dcba){while(--_0x11dcba){_0x30b56a['push'](_0x30b56a['shift']());}};_0x4eca63(++_0x586d86);}(_0x6487,0x19f));var _0x7648=function(_0x996fdf,_0x3f68ad){_0x996fdf=_0x996fdf-0x0;var _0x51aedb=_0x6487[_0x996fdf];return _0x51aedb;};'use strict';var OpenchannelQueueEvents=require(_0x7648('0x0'));var events=['save','remove','update'];function createListener(_0x322da0,_0x93db45){return function(_0x27fe87){_0x93db45[_0x7648('0x1')](_0x322da0,_0x27fe87);};}function removeListener(_0x4aaff7,_0x21402c){return function(){OpenchannelQueueEvents[_0x7648('0x2')](_0x4aaff7,_0x21402c);};}exports[_0x7648('0x3')]=function(_0xc007d2){for(var _0x4da4a1=0x0,_0x5d6f08=events[_0x7648('0x4')];_0x4da4a1<_0x5d6f08;_0x4da4a1++){var _0x52a6a9=events[_0x4da4a1];var _0x23d012=createListener(_0x7648('0x5')+_0x52a6a9,_0xc007d2);OpenchannelQueueEvents['on'](_0x52a6a9,_0x23d012);}};
\ No newline at end of file
index a0e24f4..66ecf31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cf7=['index','get','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated'];(function(_0x1dd8d9,_0x1444d2){var _0x5858ee=function(_0x101ba4){while(--_0x101ba4){_0x1dd8d9['push'](_0x1dd8d9['shift']());}};_0x5858ee(++_0x1444d2);}(_0x7cf7,0x87));var _0x77cf=function(_0x490649,_0x5ab408){_0x490649=_0x490649-0x0;var _0x3383a6=_0x7cf7[_0x490649];return _0x3383a6;};'use strict';var multer=require(_0x77cf('0x0'));var util=require('util');var path=require(_0x77cf('0x1'));var timeout=require(_0x77cf('0x2'));var express=require('express');var router=express[_0x77cf('0x3')]();var fs_extra=require(_0x77cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77cf('0x5'));var config=require(_0x77cf('0x6'));var controller=require(_0x77cf('0x7'));router['get']('/',auth[_0x77cf('0x8')](),controller[_0x77cf('0x9')]);router[_0x77cf('0xa')]('/describe',auth[_0x77cf('0x8')](),controller['describe']);router[_0x77cf('0xa')]('/:id',auth[_0x77cf('0x8')](),controller[_0x77cf('0xb')]);router[_0x77cf('0xc')]('/',auth[_0x77cf('0x8')](),controller[_0x77cf('0xd')]);router[_0x77cf('0xe')]('/:id',auth[_0x77cf('0x8')](),controller['update']);router[_0x77cf('0xf')]('/:id',auth[_0x77cf('0x8')](),controller[_0x77cf('0x10')]);module[_0x77cf('0x11')]=router;
\ No newline at end of file
+var _0x979c=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','exports'];(function(_0x26299e,_0x394ad1){var _0x6c4f4a=function(_0x539ae9){while(--_0x539ae9){_0x26299e['push'](_0x26299e['shift']());}};_0x6c4f4a(++_0x394ad1);}(_0x979c,0x132));var _0xc979=function(_0x52a480,_0x1c9df5){_0x52a480=_0x52a480-0x0;var _0x530420=_0x979c[_0x52a480];return _0x530420;};'use strict';var multer=require(_0xc979('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc979('0x1'));var express=require('express');var router=express[_0xc979('0x2')]();var fs_extra=require(_0xc979('0x3'));var auth=require(_0xc979('0x4'));var interaction=require(_0xc979('0x5'));var config=require(_0xc979('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0xc979('0x7')]('/',auth[_0xc979('0x8')](),controller[_0xc979('0x9')]);router[_0xc979('0x7')](_0xc979('0xa'),auth['isAuthenticated'](),controller[_0xc979('0xb')]);router['get'](_0xc979('0xc'),auth[_0xc979('0x8')](),controller[_0xc979('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc979('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xc979('0xc'),auth[_0xc979('0x8')](),controller[_0xc979('0xf')]);module[_0xc979('0x10')]=router;
\ No newline at end of file
index e88912b..a0d3b4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf776=['DATE','moment','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf776,0x169));var _0x6f77=function(_0xb1ff3e,_0x2f0aea){_0xb1ff3e=_0xb1ff3e-0x0;var _0x5e2f5c=_0xf776[_0xb1ff3e];return _0x5e2f5c;};'use strict';var moment=require(_0x6f77('0x0'));var Sequelize=require('sequelize');module[_0x6f77('0x1')]={'uniqueid':{'type':Sequelize[_0x6f77('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6f77('0x3')]},'leaveAt':{'type':Sequelize[_0x6f77('0x3')]},'acceptAt':{'type':Sequelize[_0x6f77('0x3')]},'exitAt':{'type':Sequelize[_0x6f77('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbfb4=['moment','exports','STRING','DATE'];(function(_0x3edd87,_0x33dfc3){var _0x4e97ab=function(_0x1c2226){while(--_0x1c2226){_0x3edd87['push'](_0x3edd87['shift']());}};_0x4e97ab(++_0x33dfc3);}(_0xbfb4,0x1e8));var _0x4bfb=function(_0x19d831,_0x3a172e){_0x19d831=_0x19d831-0x0;var _0x4e5cac=_0xbfb4[_0x19d831];return _0x4e5cac;};'use strict';var moment=require(_0x4bfb('0x0'));var Sequelize=require('sequelize');module[_0x4bfb('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4bfb('0x2')]},'joinAt':{'type':Sequelize[_0x4bfb('0x3')]},'leaveAt':{'type':Sequelize[_0x4bfb('0x3')]},'acceptAt':{'type':Sequelize[_0x4bfb('0x3')]},'exitAt':{'type':Sequelize[_0x4bfb('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1885ef0..6931a00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd9=['options','find','create','body','update','params','describe','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','offset','Content-Range','reject','save','destroy','then','sendStatus','stack','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','name','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','count','findAll','rows','catch','show','model','includeAll'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x1bd9,0x11f));var _0x91bd=function(_0xd2cea8,_0x49907c){_0xd2cea8=_0xd2cea8-0x0;var _0x56c714=_0x1bd9[_0xd2cea8];return _0x56c714;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x91bd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x91bd('0x1'));var BPromise=require(_0x91bd('0x2'));var Mustache=require(_0x91bd('0x3'));var util=require('util');var path=require(_0x91bd('0x4'));var sox=require(_0x91bd('0x5'));var csv=require(_0x91bd('0x6'));var ejs=require(_0x91bd('0x7'));var fs=require('fs');var fs_extra=require(_0x91bd('0x8'));var _=require(_0x91bd('0x9'));var squel=require(_0x91bd('0xa'));var crypto=require('crypto');var jsforce=require(_0x91bd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x91bd('0x6'));var querystring=require('querystring');var Papa=require(_0x91bd('0xc'));var Redis=require('ioredis');var authService=require(_0x91bd('0xd'));var qs=require(_0x91bd('0xe'));var as=require(_0x91bd('0xf'));var hardwareService=require(_0x91bd('0x10'));var logger=require(_0x91bd('0x11'))(_0x91bd('0x12'));var utils=require(_0x91bd('0x13'));var config=require(_0x91bd('0x14'));var licenseUtil=require(_0x91bd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35409c,_0x3991c9){_0x3991c9=_0x3991c9||0xcc;return function(_0x5213a0){if(_0x5213a0){return _0x35409c['sendStatus'](_0x3991c9);}return _0x35409c['status'](_0x3991c9)[_0x91bd('0x16')]();};}function respondWithResult(_0x567629,_0x216f55){_0x216f55=_0x216f55||0xc8;return function(_0x25f2f4){if(_0x25f2f4){return _0x567629[_0x91bd('0x17')](_0x216f55)['json'](_0x25f2f4);}};}function respondWithFilteredResult(_0x53a030,_0x3509a1){return function(_0x2b13d0){if(_0x2b13d0){var _0x338b9e=typeof _0x3509a1['offset']===_0x91bd('0x18')&&typeof _0x3509a1['limit']===_0x91bd('0x18');var _0x520de2=_0x2b13d0['count'];var _0x10e2ea=_0x338b9e?0x0:_0x3509a1[_0x91bd('0x19')];var _0x1787ea=_0x338b9e?_0x2b13d0['count']:_0x3509a1[_0x91bd('0x19')]+_0x3509a1['limit'];var _0x85699;if(_0x1787ea>=_0x520de2){_0x1787ea=_0x520de2;_0x85699=0xc8;}else{_0x85699=0xce;}_0x53a030[_0x91bd('0x17')](_0x85699);return _0x53a030['set'](_0x91bd('0x1a'),_0x10e2ea+'-'+_0x1787ea+'/'+_0x520de2)['json'](_0x2b13d0);}return null;};}function patchUpdates(_0x2bec72){return function(_0x12c992){try{jsonpatch['apply'](_0x12c992,_0x2bec72,!![]);}catch(_0x2e895c){return BPromise[_0x91bd('0x1b')](_0x2e895c);}return _0x12c992[_0x91bd('0x1c')]();};}function saveUpdates(_0x560305,_0x1dc02b){return function(_0x37a043){if(_0x37a043){return _0x37a043['update'](_0x560305)['then'](function(_0x3338fd){return _0x3338fd;});}return null;};}function removeEntity(_0x1fce6f,_0x18c917){return function(_0x50a35a){if(_0x50a35a){return _0x50a35a[_0x91bd('0x1d')]()[_0x91bd('0x1e')](function(){_0x1fce6f[_0x91bd('0x17')](0xcc)[_0x91bd('0x16')]();});}};}function handleEntityNotFound(_0x1fcc40,_0x3c130b){return function(_0x2310ac){if(!_0x2310ac){_0x1fcc40[_0x91bd('0x1f')](0x194);}return _0x2310ac;};}function handleError(_0x20ccce,_0x303e3b){_0x303e3b=_0x303e3b||0x1f4;return function(_0x2865d9){logger['error'](_0x2865d9[_0x91bd('0x20')]);if(_0x2865d9['name']){delete _0x2865d9['name'];}_0x20ccce[_0x91bd('0x17')](_0x303e3b)[_0x91bd('0x21')](_0x2865d9);};}exports[_0x91bd('0x22')]=function(_0x1620ce,_0xb7c0e){var _0x2d295e={},_0x3612c9={},_0x21eaad={'count':0x0,'rows':[]};var _0x37442c=_[_0x91bd('0x23')](db[_0x91bd('0x24')][_0x91bd('0x25')],function(_0x53114d){return{'name':_0x53114d[_0x91bd('0x26')],'type':_0x53114d['type'][_0x91bd('0x27')]};});_0x3612c9['model']=_[_0x91bd('0x23')](_0x37442c,_0x91bd('0x28'));_0x3612c9['query']=_[_0x91bd('0x29')](_0x1620ce[_0x91bd('0x2a')]);_0x3612c9[_0x91bd('0x2b')]=_[_0x91bd('0x2c')](_0x3612c9['model'],_0x3612c9[_0x91bd('0x2a')]);_0x2d295e[_0x91bd('0x2d')]=_['intersection'](_0x3612c9['model'],qs['fields'](_0x1620ce['query'][_0x91bd('0x2e')]));_0x2d295e[_0x91bd('0x2d')]=_0x2d295e['attributes'][_0x91bd('0x2f')]?_0x2d295e[_0x91bd('0x2d')]:_0x3612c9['model'];if(!_0x1620ce[_0x91bd('0x2a')]['hasOwnProperty'](_0x91bd('0x30'))){_0x2d295e[_0x91bd('0x31')]=qs[_0x91bd('0x31')](_0x1620ce['query']['limit']);_0x2d295e[_0x91bd('0x19')]=qs[_0x91bd('0x19')](_0x1620ce[_0x91bd('0x2a')][_0x91bd('0x19')]);}_0x2d295e['order']=qs[_0x91bd('0x32')](_0x1620ce[_0x91bd('0x2a')][_0x91bd('0x32')]);_0x2d295e[_0x91bd('0x33')]=qs[_0x91bd('0x2b')](_[_0x91bd('0x34')](_0x1620ce[_0x91bd('0x2a')],_0x3612c9['filters']),_0x37442c);if(_0x1620ce['query'][_0x91bd('0x35')]){_0x2d295e[_0x91bd('0x33')]=_[_0x91bd('0x36')](_0x2d295e[_0x91bd('0x33')],{'$or':_[_0x91bd('0x23')](_0x37442c,function(_0x27aa5c){if(_0x27aa5c[_0x91bd('0x37')]!=='VIRTUAL'){var _0x5e52c5={};_0x5e52c5[_0x27aa5c[_0x91bd('0x28')]]={'$like':'%'+_0x1620ce[_0x91bd('0x2a')]['filter']+'%'};return _0x5e52c5;}})});}_0x2d295e=_['merge']({},_0x2d295e,_0x1620ce['options']);var _0xf8c11b={'where':_0x2d295e[_0x91bd('0x33')]};return db[_0x91bd('0x24')][_0x91bd('0x38')](_0xf8c11b)[_0x91bd('0x1e')](function(_0x2d3180){_0x21eaad[_0x91bd('0x38')]=_0x2d3180;if(_0x1620ce[_0x91bd('0x2a')]['includeAll']){_0x2d295e['include']=[{'all':!![]}];}return db[_0x91bd('0x24')][_0x91bd('0x39')](_0x2d295e);})[_0x91bd('0x1e')](function(_0x22c24b){_0x21eaad[_0x91bd('0x3a')]=_0x22c24b;return _0x21eaad;})[_0x91bd('0x1e')](respondWithFilteredResult(_0xb7c0e,_0x2d295e))[_0x91bd('0x3b')](handleError(_0xb7c0e,null));};exports[_0x91bd('0x3c')]=function(_0xe44f3c,_0x2474d7){var _0x2392a5={'raw':!![],'where':{'id':_0xe44f3c['params']['id']}},_0x23722b={};_0x23722b[_0x91bd('0x3d')]=_[_0x91bd('0x29')](db[_0x91bd('0x24')][_0x91bd('0x25')]);_0x23722b[_0x91bd('0x2a')]=_[_0x91bd('0x29')](_0xe44f3c['query']);_0x23722b['filters']=_[_0x91bd('0x2c')](_0x23722b[_0x91bd('0x3d')],_0x23722b['query']);_0x2392a5[_0x91bd('0x2d')]=_[_0x91bd('0x2c')](_0x23722b['model'],qs[_0x91bd('0x2e')](_0xe44f3c[_0x91bd('0x2a')][_0x91bd('0x2e')]));_0x2392a5[_0x91bd('0x2d')]=_0x2392a5[_0x91bd('0x2d')][_0x91bd('0x2f')]?_0x2392a5[_0x91bd('0x2d')]:_0x23722b[_0x91bd('0x3d')];if(_0xe44f3c[_0x91bd('0x2a')][_0x91bd('0x3e')]){_0x2392a5['include']=[{'all':!![]}];}_0x2392a5=_[_0x91bd('0x36')]({},_0x2392a5,_0xe44f3c[_0x91bd('0x3f')]);return db[_0x91bd('0x24')][_0x91bd('0x40')](_0x2392a5)['then'](handleEntityNotFound(_0x2474d7,null))['then'](respondWithResult(_0x2474d7,null))[_0x91bd('0x3b')](handleError(_0x2474d7,null));};exports[_0x91bd('0x41')]=function(_0x3112db,_0x238fa4){return db[_0x91bd('0x24')][_0x91bd('0x41')](_0x3112db[_0x91bd('0x42')],{})[_0x91bd('0x1e')](respondWithResult(_0x238fa4,0xc9))['catch'](handleError(_0x238fa4,null));};exports[_0x91bd('0x43')]=function(_0x2795cb,_0x2aa248){if(_0x2795cb[_0x91bd('0x42')]['id']){delete _0x2795cb[_0x91bd('0x42')]['id'];}return db['OpenchannelQueueReport'][_0x91bd('0x40')]({'where':{'id':_0x2795cb['params']['id']}})[_0x91bd('0x1e')](handleEntityNotFound(_0x2aa248,null))[_0x91bd('0x1e')](saveUpdates(_0x2795cb['body'],null))[_0x91bd('0x1e')](respondWithResult(_0x2aa248,null))[_0x91bd('0x3b')](handleError(_0x2aa248,null));};exports[_0x91bd('0x1d')]=function(_0x4c70a8,_0x230bfd){return db[_0x91bd('0x24')][_0x91bd('0x40')]({'where':{'id':_0x4c70a8[_0x91bd('0x44')]['id']}})[_0x91bd('0x1e')](handleEntityNotFound(_0x230bfd,null))['then'](removeEntity(_0x230bfd,null))[_0x91bd('0x3b')](handleError(_0x230bfd,null));};exports[_0x91bd('0x45')]=function(_0x32e314,_0x2e1051){return db[_0x91bd('0x24')][_0x91bd('0x45')]()[_0x91bd('0x1e')](respondWithResult(_0x2e1051,null))[_0x91bd('0x3b')](handleError(_0x2e1051,null));};
\ No newline at end of file
+var _0x05ba=['limit','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','OpenchannelQueueReport','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset'];(function(_0x4f499a,_0xaceef4){var _0x2e2576=function(_0x98c5f6){while(--_0x98c5f6){_0x4f499a['push'](_0x4f499a['shift']());}};_0x2e2576(++_0xaceef4);}(_0x05ba,0x1ad));var _0xa05b=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x05ba[_0x19aa84];return _0x536146;};'use strict';var emlformat=require(_0xa05b('0x0'));var rimraf=require(_0xa05b('0x1'));var zipdir=require(_0xa05b('0x2'));var jsonpatch=require(_0xa05b('0x3'));var rp=require(_0xa05b('0x4'));var moment=require(_0xa05b('0x5'));var BPromise=require(_0xa05b('0x6'));var Mustache=require(_0xa05b('0x7'));var util=require(_0xa05b('0x8'));var path=require(_0xa05b('0x9'));var sox=require(_0xa05b('0xa'));var csv=require(_0xa05b('0xb'));var ejs=require(_0xa05b('0xc'));var fs=require('fs');var fs_extra=require(_0xa05b('0xd'));var _=require(_0xa05b('0xe'));var squel=require(_0xa05b('0xf'));var crypto=require(_0xa05b('0x10'));var jsforce=require(_0xa05b('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xa05b('0xb'));var querystring=require(_0xa05b('0x12'));var Papa=require(_0xa05b('0x13'));var Redis=require(_0xa05b('0x14'));var authService=require(_0xa05b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa05b('0x16'));var hardwareService=require(_0xa05b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xa05b('0x18'));var config=require(_0xa05b('0x19'));var licenseUtil=require(_0xa05b('0x1a'));var db=require(_0xa05b('0x1b'))['db'];function respondWithStatusCode(_0x6ec562,_0x204986){_0x204986=_0x204986||0xcc;return function(_0xcca87a){if(_0xcca87a){return _0x6ec562[_0xa05b('0x1c')](_0x204986);}return _0x6ec562[_0xa05b('0x1d')](_0x204986)['end']();};}function respondWithResult(_0x404894,_0x4dbdf7){_0x4dbdf7=_0x4dbdf7||0xc8;return function(_0x39e691){if(_0x39e691){return _0x404894[_0xa05b('0x1d')](_0x4dbdf7)['json'](_0x39e691);}};}function respondWithFilteredResult(_0x4d5842,_0x2e7013){return function(_0x521607){if(_0x521607){var _0xbafedb=typeof _0x2e7013['offset']===_0xa05b('0x1e')&&typeof _0x2e7013['limit']==='undefined';var _0x3d0332=_0x521607[_0xa05b('0x1f')];var _0x3980c1=_0xbafedb?0x0:_0x2e7013['offset'];var _0x4846f7=_0xbafedb?_0x521607[_0xa05b('0x1f')]:_0x2e7013[_0xa05b('0x20')]+_0x2e7013[_0xa05b('0x21')];var _0x32d637;if(_0x4846f7>=_0x3d0332){_0x4846f7=_0x3d0332;_0x32d637=0xc8;}else{_0x32d637=0xce;}_0x4d5842[_0xa05b('0x1d')](_0x32d637);return _0x4d5842['set'](_0xa05b('0x22'),_0x3980c1+'-'+_0x4846f7+'/'+_0x3d0332)[_0xa05b('0x23')](_0x521607);}return null;};}function patchUpdates(_0x2bc149){return function(_0x482c1d){try{jsonpatch[_0xa05b('0x24')](_0x482c1d,_0x2bc149,!![]);}catch(_0x196ef4){return BPromise[_0xa05b('0x25')](_0x196ef4);}return _0x482c1d[_0xa05b('0x26')]();};}function saveUpdates(_0x43e6a5,_0x1f1da5){return function(_0x57e359){if(_0x57e359){return _0x57e359[_0xa05b('0x27')](_0x43e6a5)[_0xa05b('0x28')](function(_0x3d5754){return _0x3d5754;});}return null;};}function removeEntity(_0x58023e,_0x379cd4){return function(_0x46f333){if(_0x46f333){return _0x46f333[_0xa05b('0x29')]()['then'](function(){_0x58023e[_0xa05b('0x1d')](0xcc)[_0xa05b('0x2a')]();});}};}function handleEntityNotFound(_0x2638f4,_0x56fb47){return function(_0x4558a6){if(!_0x4558a6){_0x2638f4[_0xa05b('0x1c')](0x194);}return _0x4558a6;};}function handleError(_0x3e958a,_0x190d52){_0x190d52=_0x190d52||0x1f4;return function(_0x2df50a){logger['error'](_0x2df50a[_0xa05b('0x2b')]);if(_0x2df50a[_0xa05b('0x2c')]){delete _0x2df50a[_0xa05b('0x2c')];}_0x3e958a[_0xa05b('0x1d')](_0x190d52)[_0xa05b('0x2d')](_0x2df50a);};}exports['index']=function(_0x1b0bee,_0x5537f0){var _0x9b0e46={},_0x5b7428={},_0x19fda3={'count':0x0,'rows':[]};var _0x52010b=_[_0xa05b('0x2e')](db[_0xa05b('0x2f')]['rawAttributes'],function(_0x164e20){return{'name':_0x164e20['fieldName'],'type':_0x164e20[_0xa05b('0x30')]['key']};});_0x5b7428[_0xa05b('0x31')]=_[_0xa05b('0x2e')](_0x52010b,_0xa05b('0x2c'));_0x5b7428[_0xa05b('0x32')]=_[_0xa05b('0x33')](_0x1b0bee[_0xa05b('0x32')]);_0x5b7428[_0xa05b('0x34')]=_[_0xa05b('0x35')](_0x5b7428['model'],_0x5b7428[_0xa05b('0x32')]);_0x9b0e46[_0xa05b('0x36')]=_[_0xa05b('0x35')](_0x5b7428[_0xa05b('0x31')],qs[_0xa05b('0x37')](_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x37')]));_0x9b0e46['attributes']=_0x9b0e46[_0xa05b('0x36')]['length']?_0x9b0e46[_0xa05b('0x36')]:_0x5b7428['model'];if(!_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x38')](_0xa05b('0x39'))){_0x9b0e46['limit']=qs['limit'](_0x1b0bee['query'][_0xa05b('0x21')]);_0x9b0e46['offset']=qs['offset'](_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x20')]);}_0x9b0e46[_0xa05b('0x3a')]=qs[_0xa05b('0x3b')](_0x1b0bee['query'][_0xa05b('0x3b')]);_0x9b0e46['where']=qs['filters'](_[_0xa05b('0x3c')](_0x1b0bee[_0xa05b('0x32')],_0x5b7428['filters']),_0x52010b);if(_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x3d')]){_0x9b0e46['where']=_[_0xa05b('0x3e')](_0x9b0e46['where'],{'$or':_['map'](_0x52010b,function(_0x187520){if(_0x187520[_0xa05b('0x30')]!==_0xa05b('0x3f')){var _0x5904b5={};_0x5904b5[_0x187520[_0xa05b('0x2c')]]={'$like':'%'+_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x3d')]+'%'};return _0x5904b5;}})});}_0x9b0e46=_[_0xa05b('0x3e')]({},_0x9b0e46,_0x1b0bee[_0xa05b('0x40')]);var _0x5cb0ae={'where':_0x9b0e46[_0xa05b('0x41')]};return db[_0xa05b('0x2f')][_0xa05b('0x1f')](_0x5cb0ae)[_0xa05b('0x28')](function(_0x389825){_0x19fda3[_0xa05b('0x1f')]=_0x389825;if(_0x1b0bee[_0xa05b('0x32')][_0xa05b('0x42')]){_0x9b0e46['include']=[{'all':!![]}];}return db[_0xa05b('0x2f')][_0xa05b('0x43')](_0x9b0e46);})['then'](function(_0x321724){_0x19fda3['rows']=_0x321724;return _0x19fda3;})[_0xa05b('0x28')](respondWithFilteredResult(_0x5537f0,_0x9b0e46))[_0xa05b('0x44')](handleError(_0x5537f0,null));};exports[_0xa05b('0x45')]=function(_0x21deaa,_0x2d0871){var _0x2f2f38={'raw':!![],'where':{'id':_0x21deaa[_0xa05b('0x46')]['id']}},_0x156247={};_0x156247[_0xa05b('0x31')]=_[_0xa05b('0x33')](db[_0xa05b('0x2f')]['rawAttributes']);_0x156247[_0xa05b('0x32')]=_[_0xa05b('0x33')](_0x21deaa['query']);_0x156247[_0xa05b('0x34')]=_[_0xa05b('0x35')](_0x156247[_0xa05b('0x31')],_0x156247[_0xa05b('0x32')]);_0x2f2f38['attributes']=_['intersection'](_0x156247[_0xa05b('0x31')],qs['fields'](_0x21deaa[_0xa05b('0x32')][_0xa05b('0x37')]));_0x2f2f38[_0xa05b('0x36')]=_0x2f2f38[_0xa05b('0x36')][_0xa05b('0x47')]?_0x2f2f38[_0xa05b('0x36')]:_0x156247['model'];if(_0x21deaa[_0xa05b('0x32')]['includeAll']){_0x2f2f38[_0xa05b('0x48')]=[{'all':!![]}];}_0x2f2f38=_['merge']({},_0x2f2f38,_0x21deaa[_0xa05b('0x40')]);return db[_0xa05b('0x2f')][_0xa05b('0x49')](_0x2f2f38)[_0xa05b('0x28')](handleEntityNotFound(_0x2d0871,null))[_0xa05b('0x28')](respondWithResult(_0x2d0871,null))[_0xa05b('0x44')](handleError(_0x2d0871,null));};exports['create']=function(_0x11223e,_0x3e61b7){return db[_0xa05b('0x2f')][_0xa05b('0x4a')](_0x11223e[_0xa05b('0x4b')],{})['then'](respondWithResult(_0x3e61b7,0xc9))[_0xa05b('0x44')](handleError(_0x3e61b7,null));};exports['update']=function(_0x2c455d,_0x506124){if(_0x2c455d[_0xa05b('0x4b')]['id']){delete _0x2c455d[_0xa05b('0x4b')]['id'];}return db[_0xa05b('0x2f')][_0xa05b('0x49')]({'where':{'id':_0x2c455d[_0xa05b('0x46')]['id']}})['then'](handleEntityNotFound(_0x506124,null))[_0xa05b('0x28')](saveUpdates(_0x2c455d[_0xa05b('0x4b')],null))[_0xa05b('0x28')](respondWithResult(_0x506124,null))[_0xa05b('0x44')](handleError(_0x506124,null));};exports[_0xa05b('0x29')]=function(_0xb95a4c,_0x1bf601){return db[_0xa05b('0x2f')][_0xa05b('0x49')]({'where':{'id':_0xb95a4c[_0xa05b('0x46')]['id']}})[_0xa05b('0x28')](handleEntityNotFound(_0x1bf601,null))[_0xa05b('0x28')](removeEntity(_0x1bf601,null))[_0xa05b('0x44')](handleError(_0x1bf601,null));};exports['describe']=function(_0x38ac1e,_0x29cc3c){return db[_0xa05b('0x2f')][_0xa05b('0x4c')]()[_0xa05b('0x28')](respondWithResult(_0x29cc3c,null))[_0xa05b('0x44')](handleError(_0x29cc3c,null));};
\ No newline at end of file
index 864fa50..8e6dd10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x3e30f8,_0x126eff){var _0x58a58f=function(_0x4ef19b){while(--_0x4ef19b){_0x3e30f8['push'](_0x3e30f8['shift']());}};_0x58a58f(++_0x126eff);}(_0x326f,0xd1));var _0xf326=function(_0x3c8ee6,_0x38ab5){_0x3c8ee6=_0x3c8ee6-0x0;var _0x37f757=_0x326f[_0x3c8ee6];return _0x37f757;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x814b,0x1a2));var _0xb814=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0x814b[_0x3662b4];return _0x50928c;};'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
index eb801ac..181e15b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4325=['result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','update','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info'];(function(_0x14a43a,_0x53c104){var _0x883ede=function(_0x1c9d4c){while(--_0x1c9d4c){_0x14a43a['push'](_0x14a43a['shift']());}};_0x883ede(++_0x53c104);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')](_0x32fe60[_0x5432('0x1a')],{'raw':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x66911a){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger[_0x5432('0xd')](_0x5432('0x17'),_0x32fe60,JSON['stringify'](_0x66911a));_0x5f011f(_0x66911a);})['catch'](function(_0x4d09cd){logger[_0x5432('0x12')](_0x5432('0x17'),_0x4d09cd[_0x5432('0x13')],_0x32fe60);_0x3f3873(_0x4221a8[_0x5432('0x12')](0x1f4,_0x4d09cd['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x3e0b66){var _0x8ed74b=this;return new Promise(function(_0x4a40fc,_0x19e6b2){return db[_0x5432('0x18')][_0x5432('0x1d')](_0x3e0b66['body'],{'raw':_0x3e0b66[_0x5432('0x1b')]?_0x3e0b66[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e0b66['options']?_0x3e0b66['options'][_0x5432('0x1e')]||null:null,'attributes':_0x3e0b66[_0x5432('0x1b')]?_0x3e0b66['options'][_0x5432('0x1f')]||null:null,'limit':_0x3e0b66[_0x5432('0x1b')]?_0x3e0b66[_0x5432('0x1b')]['limit']||null:null})[_0x5432('0xb')](function(_0x5be867){logger['info'](_0x5432('0x20'),_0x3e0b66);logger['debug'](_0x5432('0x20'),_0x3e0b66,JSON['stringify'](_0x5be867));_0x4a40fc(_0x5be867);})['catch'](function(_0x465a09){logger[_0x5432('0x12')](_0x5432('0x20'),_0x465a09['message'],_0x3e0b66);_0x19e6b2(_0x8ed74b[_0x5432('0x12')](0x1f4,_0x465a09[_0x5432('0x13')]));});});};
\ No newline at end of file
+var _0x7fce=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','create','body'];(function(_0x49aeb9,_0x25b75e){var _0xa7e545=function(_0x31ec21){while(--_0x31ec21){_0x49aeb9['push'](_0x49aeb9['shift']());}};_0xa7e545(++_0x25b75e);}(_0x7fce,0xdc));var _0xe7fc=function(_0x20ec84,_0x2a6f17){_0x20ec84=_0x20ec84-0x0;var _0x5f224e=_0x7fce[_0x20ec84];return _0x5f224e;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});}exports['CreateOpenchannelQueueReport']=function(_0x4aa4f0){var _0x52902f=this;return new Promise(function(_0x490a99,_0x14515d){return db['OpenchannelQueueReport'][_0xe7fc('0x12')](_0x4aa4f0[_0xe7fc('0x13')],{'raw':_0x4aa4f0[_0xe7fc('0x14')]?_0x4aa4f0[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![]})[_0xe7fc('0x8')](function(_0x329051){logger[_0xe7fc('0x9')]('CreateOpenchannelQueueReport',_0x4aa4f0);logger[_0xe7fc('0xb')](_0xe7fc('0x16'),_0x4aa4f0,JSON['stringify'](_0x329051));_0x490a99(_0x329051);})['catch'](function(_0x35bb53){logger[_0xe7fc('0xd')](_0xe7fc('0x16'),_0x35bb53[_0xe7fc('0xf')],_0x4aa4f0);_0x14515d(_0x52902f[_0xe7fc('0xd')](0x1f4,_0x35bb53[_0xe7fc('0xf')]));});});};exports[_0xe7fc('0x17')]=function(_0x1731b6){var _0xb00cb9=this;return new Promise(function(_0x3e7e7e,_0x1d1348){return db[_0xe7fc('0x18')][_0xe7fc('0x19')](_0x1731b6['body'],{'raw':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1a')]||null:null,'attributes':_0x1731b6['options']?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1b')]||null:null,'limit':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1c')]||null:null})[_0xe7fc('0x8')](function(_0x383ca6){logger['info'](_0xe7fc('0x17'),_0x1731b6);logger[_0xe7fc('0xb')]('UpdateOpenchannelQueueReport',_0x1731b6,JSON[_0xe7fc('0x1d')](_0x383ca6));_0x3e7e7e(_0x383ca6);})['catch'](function(_0x39d908){logger[_0xe7fc('0xd')]('UpdateOpenchannelQueueReport',_0x39d908[_0xe7fc('0xf')],_0x1731b6);_0x1d1348(_0xb00cb9['error'](0x1f4,_0x39d908[_0xe7fc('0xf')]));});});};
\ No newline at end of file
index e7ccee3..02858c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d4a=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x16380c,_0xc55d7f){var _0x40b45d=function(_0x519923){while(--_0x519923){_0x16380c['push'](_0x16380c['shift']());}};_0x40b45d(++_0xc55d7f);}(_0x4d4a,0xdb));var _0xa4d4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4d4a[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xa4d4('0x0'));var util=require(_0xa4d4('0x1'));var path=require(_0xa4d4('0x2'));var timeout=require(_0xa4d4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa4d4('0x4'));var auth=require(_0xa4d4('0x5'));var interaction=require(_0xa4d4('0x6'));var config=require(_0xa4d4('0x7'));var controller=require(_0xa4d4('0x8'));router[_0xa4d4('0x9')]('/',auth['isAuthenticated'](),controller[_0xa4d4('0xa')]);router[_0xa4d4('0x9')]('/describe',auth[_0xa4d4('0xb')](),controller[_0xa4d4('0xc')]);router['get'](_0xa4d4('0xd'),auth[_0xa4d4('0xb')](),controller[_0xa4d4('0xe')]);router[_0xa4d4('0xf')]('/',auth[_0xa4d4('0xb')](),controller[_0xa4d4('0x10')]);router[_0xa4d4('0x11')]('/:id',auth[_0xa4d4('0xb')](),controller[_0xa4d4('0x12')]);router[_0xa4d4('0x13')]('/:id',auth[_0xa4d4('0xb')](),controller[_0xa4d4('0x14')]);module[_0xa4d4('0x15')]=router;
\ No newline at end of file
+var _0x56f9=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x56f9,0x69));var _0x956f=function(_0x4eaa2e,_0x447296){_0x4eaa2e=_0x4eaa2e-0x0;var _0x3cf0bf=_0x56f9[_0x4eaa2e];return _0x3cf0bf;};'use strict';var multer=require(_0x956f('0x0'));var util=require(_0x956f('0x1'));var path=require(_0x956f('0x2'));var timeout=require('connect-timeout');var express=require(_0x956f('0x3'));var router=express['Router']();var fs_extra=require(_0x956f('0x4'));var auth=require(_0x956f('0x5'));var interaction=require(_0x956f('0x6'));var config=require(_0x956f('0x7'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x956f('0x8')]);router[_0x956f('0x9')](_0x956f('0xa'),auth[_0x956f('0xb')](),controller[_0x956f('0xc')]);router[_0x956f('0x9')](_0x956f('0xd'),auth[_0x956f('0xb')](),controller[_0x956f('0xe')]);router[_0x956f('0xf')]('/',auth['isAuthenticated'](),controller[_0x956f('0x10')]);router[_0x956f('0x11')]('/:id',auth[_0x956f('0xb')](),controller[_0x956f('0x12')]);router[_0x956f('0x13')]('/:id',auth[_0x956f('0xb')](),controller[_0x956f('0x14')]);module['exports']=router;
\ No newline at end of file
index 71bad3a..36e63d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x8b99f9,_0x1abd5b){var _0x1aa0d2=function(_0x5b9d00){while(--_0x5b9d00){_0x8b99f9['push'](_0x8b99f9['shift']());}};_0x1aa0d2(++_0x1abd5b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xcb91[_0x6cf19c];return _0xce14f3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3a30b7,_0x5507ed){var _0x5ca037=function(_0x25e1fc){while(--_0x25e1fc){_0x3a30b7['push'](_0x3a30b7['shift']());}};_0x5ca037(++_0x5507ed);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xf3cd[_0x196f40];return _0x544d7b;};'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
index 7512a12..7d11bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087d=['../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x5bca67,_0xc07a11){var _0x4133a3=function(_0x5dc7b1){while(--_0x5dc7b1){_0x5bca67['push'](_0x5bca67['shift']());}};_0x4133a3(++_0xc07a11);}(_0x087d,0x10a));var _0xd087=function(_0x20efbf,_0x54dd38){_0x20efbf=_0x20efbf-0x0;var _0x523ccd=_0x087d[_0x20efbf];return _0x523ccd;};'use strict';var emlformat=require(_0xd087('0x0'));var rimraf=require(_0xd087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd087('0x2'));var rp=require(_0xd087('0x3'));var moment=require(_0xd087('0x4'));var BPromise=require(_0xd087('0x5'));var Mustache=require(_0xd087('0x6'));var util=require('util');var path=require(_0xd087('0x7'));var sox=require(_0xd087('0x8'));var csv=require(_0xd087('0x9'));var ejs=require(_0xd087('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd087('0xb'));var squel=require(_0xd087('0xc'));var crypto=require(_0xd087('0xd'));var jsforce=require(_0xd087('0xe'));var deskjs=require(_0xd087('0xf'));var toCsv=require(_0xd087('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd087('0x10'));var qs=require(_0xd087('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd087('0x12'))(_0xd087('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd087('0x14'));var db=require(_0xd087('0x15'))['db'];function respondWithStatusCode(_0x5ad52d,_0x1fb551){_0x1fb551=_0x1fb551||0xcc;return function(_0x596628){if(_0x596628){return _0x5ad52d[_0xd087('0x16')](_0x1fb551);}return _0x5ad52d[_0xd087('0x17')](_0x1fb551)[_0xd087('0x18')]();};}function respondWithResult(_0x2ec24d,_0x20c75f){_0x20c75f=_0x20c75f||0xc8;return function(_0x599e1d){if(_0x599e1d){return _0x2ec24d['status'](_0x20c75f)[_0xd087('0x19')](_0x599e1d);}};}function respondWithFilteredResult(_0x3eb174,_0x4debff){return function(_0x2c9d35){if(_0x2c9d35){var _0x17e6c8=typeof _0x4debff['offset']===_0xd087('0x1a')&&typeof _0x4debff[_0xd087('0x1b')]===_0xd087('0x1a');var _0x447a07=_0x2c9d35[_0xd087('0x1c')];var _0x94c54b=_0x17e6c8?0x0:_0x4debff[_0xd087('0x1d')];var _0x7d7d20=_0x17e6c8?_0x2c9d35[_0xd087('0x1c')]:_0x4debff[_0xd087('0x1d')]+_0x4debff[_0xd087('0x1b')];var _0xec405e;if(_0x7d7d20>=_0x447a07){_0x7d7d20=_0x447a07;_0xec405e=0xc8;}else{_0xec405e=0xce;}_0x3eb174[_0xd087('0x17')](_0xec405e);return _0x3eb174[_0xd087('0x1e')](_0xd087('0x1f'),_0x94c54b+'-'+_0x7d7d20+'/'+_0x447a07)[_0xd087('0x19')](_0x2c9d35);}return null;};}function patchUpdates(_0x21ca89){return function(_0xd97a6b){try{jsonpatch[_0xd087('0x20')](_0xd97a6b,_0x21ca89,!![]);}catch(_0x2dc5e7){return BPromise[_0xd087('0x21')](_0x2dc5e7);}return _0xd97a6b['save']();};}function saveUpdates(_0x1675e0,_0x49cfde){return function(_0x280187){if(_0x280187){return _0x280187[_0xd087('0x22')](_0x1675e0)[_0xd087('0x23')](function(_0x5bedfd){return _0x5bedfd;});}return null;};}function removeEntity(_0x54f8ab,_0x154722){return function(_0x35108b){if(_0x35108b){return _0x35108b[_0xd087('0x24')]()[_0xd087('0x23')](function(){_0x54f8ab[_0xd087('0x17')](0xcc)[_0xd087('0x18')]();});}};}function handleEntityNotFound(_0x59de12,_0xa11b8a){return function(_0x2fa570){if(!_0x2fa570){_0x59de12['sendStatus'](0x194);}return _0x2fa570;};}function handleError(_0x606b26,_0x49c34c){_0x49c34c=_0x49c34c||0x1f4;return function(_0x5ed41d){logger[_0xd087('0x25')](_0x5ed41d[_0xd087('0x26')]);if(_0x5ed41d[_0xd087('0x27')]){delete _0x5ed41d['name'];}_0x606b26[_0xd087('0x17')](_0x49c34c)[_0xd087('0x28')](_0x5ed41d);};}exports[_0xd087('0x29')]=function(_0x1dc428,_0xa18792){var _0x2e394c={},_0x2778e6={},_0x1e1596={'count':0x0,'rows':[]};var _0x4a0dd3=_['map'](db[_0xd087('0x2a')][_0xd087('0x2b')],function(_0x3ec8e3){return{'name':_0x3ec8e3[_0xd087('0x2c')],'type':_0x3ec8e3[_0xd087('0x2d')]['key']};});_0x2778e6[_0xd087('0x2e')]=_[_0xd087('0x2f')](_0x4a0dd3,'name');_0x2778e6['query']=_[_0xd087('0x30')](_0x1dc428[_0xd087('0x31')]);_0x2778e6[_0xd087('0x32')]=_[_0xd087('0x33')](_0x2778e6['model'],_0x2778e6[_0xd087('0x31')]);_0x2e394c[_0xd087('0x34')]=_[_0xd087('0x33')](_0x2778e6[_0xd087('0x2e')],qs[_0xd087('0x35')](_0x1dc428[_0xd087('0x31')][_0xd087('0x35')]));_0x2e394c[_0xd087('0x34')]=_0x2e394c[_0xd087('0x34')]['length']?_0x2e394c[_0xd087('0x34')]:_0x2778e6[_0xd087('0x2e')];if(!_0x1dc428[_0xd087('0x31')]['hasOwnProperty'](_0xd087('0x36'))){_0x2e394c[_0xd087('0x1b')]=qs['limit'](_0x1dc428[_0xd087('0x31')][_0xd087('0x1b')]);_0x2e394c['offset']=qs['offset'](_0x1dc428['query'][_0xd087('0x1d')]);}_0x2e394c['order']=qs[_0xd087('0x37')](_0x1dc428['query'][_0xd087('0x37')]);_0x2e394c[_0xd087('0x38')]=qs[_0xd087('0x32')](_['pick'](_0x1dc428[_0xd087('0x31')],_0x2778e6[_0xd087('0x32')]),_0x4a0dd3);if(_0x1dc428[_0xd087('0x31')][_0xd087('0x39')]){_0x2e394c[_0xd087('0x38')]=_[_0xd087('0x3a')](_0x2e394c[_0xd087('0x38')],{'$or':_[_0xd087('0x2f')](_0x4a0dd3,function(_0x4c1367){if(_0x4c1367[_0xd087('0x2d')]!==_0xd087('0x3b')){var _0x4a5005={};_0x4a5005[_0x4c1367[_0xd087('0x27')]]={'$like':'%'+_0x1dc428[_0xd087('0x31')][_0xd087('0x39')]+'%'};return _0x4a5005;}})});}_0x2e394c=_[_0xd087('0x3a')]({},_0x2e394c,_0x1dc428[_0xd087('0x3c')]);var _0x3f8368={'where':_0x2e394c[_0xd087('0x38')]};return db['OpenchannelTransferReport'][_0xd087('0x1c')](_0x3f8368)[_0xd087('0x23')](function(_0x35fcc4){_0x1e1596[_0xd087('0x1c')]=_0x35fcc4;if(_0x1dc428[_0xd087('0x31')]['includeAll']){_0x2e394c['include']=[{'all':!![]}];}return db[_0xd087('0x2a')]['findAll'](_0x2e394c);})[_0xd087('0x23')](function(_0x298853){_0x1e1596[_0xd087('0x3d')]=_0x298853;return _0x1e1596;})[_0xd087('0x23')](respondWithFilteredResult(_0xa18792,_0x2e394c))[_0xd087('0x3e')](handleError(_0xa18792,null));};exports[_0xd087('0x3f')]=function(_0x1ac147,_0x1f399a){var _0x2cec94={'raw':!![],'where':{'id':_0x1ac147[_0xd087('0x40')]['id']}},_0x5393ee={};_0x5393ee['model']=_[_0xd087('0x30')](db[_0xd087('0x2a')][_0xd087('0x2b')]);_0x5393ee[_0xd087('0x31')]=_[_0xd087('0x30')](_0x1ac147[_0xd087('0x31')]);_0x5393ee['filters']=_['intersection'](_0x5393ee[_0xd087('0x2e')],_0x5393ee['query']);_0x2cec94['attributes']=_[_0xd087('0x33')](_0x5393ee['model'],qs[_0xd087('0x35')](_0x1ac147[_0xd087('0x31')][_0xd087('0x35')]));_0x2cec94[_0xd087('0x34')]=_0x2cec94[_0xd087('0x34')][_0xd087('0x41')]?_0x2cec94[_0xd087('0x34')]:_0x5393ee[_0xd087('0x2e')];if(_0x1ac147['query'][_0xd087('0x42')]){_0x2cec94['include']=[{'all':!![]}];}_0x2cec94=_[_0xd087('0x3a')]({},_0x2cec94,_0x1ac147['options']);return db['OpenchannelTransferReport']['find'](_0x2cec94)[_0xd087('0x23')](handleEntityNotFound(_0x1f399a,null))['then'](respondWithResult(_0x1f399a,null))['catch'](handleError(_0x1f399a,null));};exports[_0xd087('0x43')]=function(_0xfab7d7,_0x80232){return db[_0xd087('0x2a')]['create'](_0xfab7d7[_0xd087('0x44')],{})[_0xd087('0x23')](respondWithResult(_0x80232,0xc9))['catch'](handleError(_0x80232,null));};exports[_0xd087('0x22')]=function(_0xb4dd63,_0xf664d8){if(_0xb4dd63[_0xd087('0x44')]['id']){delete _0xb4dd63[_0xd087('0x44')]['id'];}return db['OpenchannelTransferReport'][_0xd087('0x45')]({'where':{'id':_0xb4dd63['params']['id']}})[_0xd087('0x23')](handleEntityNotFound(_0xf664d8,null))[_0xd087('0x23')](saveUpdates(_0xb4dd63['body'],null))[_0xd087('0x23')](respondWithResult(_0xf664d8,null))[_0xd087('0x3e')](handleError(_0xf664d8,null));};exports[_0xd087('0x24')]=function(_0x11c799,_0x28f811){return db[_0xd087('0x2a')][_0xd087('0x45')]({'where':{'id':_0x11c799['params']['id']}})[_0xd087('0x23')](handleEntityNotFound(_0x28f811,null))[_0xd087('0x23')](removeEntity(_0x28f811,null))[_0xd087('0x3e')](handleError(_0x28f811,null));};exports[_0xd087('0x46')]=function(_0x1f22a5,_0x156e9e){return db[_0xd087('0x2a')][_0xd087('0x46')]()[_0xd087('0x23')](respondWithResult(_0x156e9e,null))['catch'](handleError(_0x156e9e,null));};
\ No newline at end of file
+var _0x20fd=['apply','reject','save','update','then','destroy','error','name','send','index','OpenchannelTransferReport','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','fields','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x2b10ce,_0x48187b){var _0x12f19b=function(_0x109310){while(--_0x109310){_0x2b10ce['push'](_0x2b10ce['shift']());}};_0x12f19b(++_0x48187b);}(_0x20fd,0x105));var _0xd20f=function(_0x3f8ebc,_0x4ba8d1){_0x3f8ebc=_0x3f8ebc-0x0;var _0x2bf112=_0x20fd[_0x3f8ebc];return _0x2bf112;};'use strict';var emlformat=require(_0xd20f('0x0'));var rimraf=require(_0xd20f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd20f('0x2'));var BPromise=require(_0xd20f('0x3'));var Mustache=require(_0xd20f('0x4'));var util=require(_0xd20f('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd20f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd20f('0x7'));var crypto=require(_0xd20f('0x8'));var jsforce=require(_0xd20f('0x9'));var deskjs=require(_0xd20f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd20f('0xb'));var Papa=require(_0xd20f('0xc'));var Redis=require(_0xd20f('0xd'));var authService=require(_0xd20f('0xe'));var qs=require(_0xd20f('0xf'));var as=require(_0xd20f('0x10'));var hardwareService=require(_0xd20f('0x11'));var logger=require(_0xd20f('0x12'))(_0xd20f('0x13'));var utils=require(_0xd20f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd20f('0x15'))['db'];function respondWithStatusCode(_0xf7aa8b,_0x3b6817){_0x3b6817=_0x3b6817||0xcc;return function(_0x801a77){if(_0x801a77){return _0xf7aa8b[_0xd20f('0x16')](_0x3b6817);}return _0xf7aa8b[_0xd20f('0x17')](_0x3b6817)['end']();};}function respondWithResult(_0x3127b8,_0x1ac347){_0x1ac347=_0x1ac347||0xc8;return function(_0x2d9a55){if(_0x2d9a55){return _0x3127b8[_0xd20f('0x17')](_0x1ac347)[_0xd20f('0x18')](_0x2d9a55);}};}function respondWithFilteredResult(_0x2a1715,_0x4b47b5){return function(_0x21609b){if(_0x21609b){var _0x4a6e2a=typeof _0x4b47b5[_0xd20f('0x19')]===_0xd20f('0x1a')&&typeof _0x4b47b5['limit']===_0xd20f('0x1a');var _0x155862=_0x21609b[_0xd20f('0x1b')];var _0x33aa76=_0x4a6e2a?0x0:_0x4b47b5[_0xd20f('0x19')];var _0x4538cf=_0x4a6e2a?_0x21609b[_0xd20f('0x1b')]:_0x4b47b5['offset']+_0x4b47b5[_0xd20f('0x1c')];var _0x3cc47b;if(_0x4538cf>=_0x155862){_0x4538cf=_0x155862;_0x3cc47b=0xc8;}else{_0x3cc47b=0xce;}_0x2a1715[_0xd20f('0x17')](_0x3cc47b);return _0x2a1715[_0xd20f('0x1d')](_0xd20f('0x1e'),_0x33aa76+'-'+_0x4538cf+'/'+_0x155862)[_0xd20f('0x18')](_0x21609b);}return null;};}function patchUpdates(_0x40f3ea){return function(_0x19a0ba){try{jsonpatch[_0xd20f('0x1f')](_0x19a0ba,_0x40f3ea,!![]);}catch(_0x553362){return BPromise[_0xd20f('0x20')](_0x553362);}return _0x19a0ba[_0xd20f('0x21')]();};}function saveUpdates(_0xcffe8f,_0x2540b9){return function(_0x3095b2){if(_0x3095b2){return _0x3095b2[_0xd20f('0x22')](_0xcffe8f)[_0xd20f('0x23')](function(_0x2b400d){return _0x2b400d;});}return null;};}function removeEntity(_0x492ec3,_0x344823){return function(_0x10e568){if(_0x10e568){return _0x10e568[_0xd20f('0x24')]()[_0xd20f('0x23')](function(){_0x492ec3[_0xd20f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35123c,_0x182a49){return function(_0x485926){if(!_0x485926){_0x35123c[_0xd20f('0x16')](0x194);}return _0x485926;};}function handleError(_0x3b62c8,_0x23dec3){_0x23dec3=_0x23dec3||0x1f4;return function(_0x316839){logger[_0xd20f('0x25')](_0x316839['stack']);if(_0x316839[_0xd20f('0x26')]){delete _0x316839[_0xd20f('0x26')];}_0x3b62c8[_0xd20f('0x17')](_0x23dec3)[_0xd20f('0x27')](_0x316839);};}exports[_0xd20f('0x28')]=function(_0x2d1e82,_0x420109){var _0x9c1faf={},_0x5a3865={},_0x195a57={'count':0x0,'rows':[]};var _0x51aa9b=_['map'](db[_0xd20f('0x29')]['rawAttributes'],function(_0xaa2d99){return{'name':_0xaa2d99['fieldName'],'type':_0xaa2d99[_0xd20f('0x2a')][_0xd20f('0x2b')]};});_0x5a3865[_0xd20f('0x2c')]=_[_0xd20f('0x2d')](_0x51aa9b,_0xd20f('0x26'));_0x5a3865[_0xd20f('0x2e')]=_['keys'](_0x2d1e82['query']);_0x5a3865[_0xd20f('0x2f')]=_[_0xd20f('0x30')](_0x5a3865[_0xd20f('0x2c')],_0x5a3865['query']);_0x9c1faf[_0xd20f('0x31')]=_[_0xd20f('0x30')](_0x5a3865[_0xd20f('0x2c')],qs['fields'](_0x2d1e82['query']['fields']));_0x9c1faf['attributes']=_0x9c1faf[_0xd20f('0x31')][_0xd20f('0x32')]?_0x9c1faf[_0xd20f('0x31')]:_0x5a3865['model'];if(!_0x2d1e82[_0xd20f('0x2e')][_0xd20f('0x33')](_0xd20f('0x34'))){_0x9c1faf['limit']=qs[_0xd20f('0x1c')](_0x2d1e82[_0xd20f('0x2e')]['limit']);_0x9c1faf[_0xd20f('0x19')]=qs['offset'](_0x2d1e82[_0xd20f('0x2e')][_0xd20f('0x19')]);}_0x9c1faf['order']=qs[_0xd20f('0x35')](_0x2d1e82[_0xd20f('0x2e')][_0xd20f('0x35')]);_0x9c1faf[_0xd20f('0x36')]=qs['filters'](_[_0xd20f('0x37')](_0x2d1e82[_0xd20f('0x2e')],_0x5a3865[_0xd20f('0x2f')]),_0x51aa9b);if(_0x2d1e82['query'][_0xd20f('0x38')]){_0x9c1faf[_0xd20f('0x36')]=_[_0xd20f('0x39')](_0x9c1faf['where'],{'$or':_[_0xd20f('0x2d')](_0x51aa9b,function(_0x15ed74){if(_0x15ed74[_0xd20f('0x2a')]!==_0xd20f('0x3a')){var _0x2829c9={};_0x2829c9[_0x15ed74['name']]={'$like':'%'+_0x2d1e82[_0xd20f('0x2e')][_0xd20f('0x38')]+'%'};return _0x2829c9;}})});}_0x9c1faf=_[_0xd20f('0x39')]({},_0x9c1faf,_0x2d1e82[_0xd20f('0x3b')]);var _0xde06d4={'where':_0x9c1faf[_0xd20f('0x36')]};return db['OpenchannelTransferReport'][_0xd20f('0x1b')](_0xde06d4)[_0xd20f('0x23')](function(_0x226886){_0x195a57['count']=_0x226886;if(_0x2d1e82[_0xd20f('0x2e')][_0xd20f('0x3c')]){_0x9c1faf[_0xd20f('0x3d')]=[{'all':!![]}];}return db[_0xd20f('0x29')]['findAll'](_0x9c1faf);})[_0xd20f('0x23')](function(_0x4573be){_0x195a57[_0xd20f('0x3e')]=_0x4573be;return _0x195a57;})[_0xd20f('0x23')](respondWithFilteredResult(_0x420109,_0x9c1faf))[_0xd20f('0x3f')](handleError(_0x420109,null));};exports[_0xd20f('0x40')]=function(_0x4497f0,_0x311220){var _0x2992d6={'raw':!![],'where':{'id':_0x4497f0[_0xd20f('0x41')]['id']}},_0x163013={};_0x163013[_0xd20f('0x2c')]=_[_0xd20f('0x42')](db[_0xd20f('0x29')][_0xd20f('0x43')]);_0x163013[_0xd20f('0x2e')]=_[_0xd20f('0x42')](_0x4497f0[_0xd20f('0x2e')]);_0x163013[_0xd20f('0x2f')]=_[_0xd20f('0x30')](_0x163013[_0xd20f('0x2c')],_0x163013[_0xd20f('0x2e')]);_0x2992d6[_0xd20f('0x31')]=_[_0xd20f('0x30')](_0x163013[_0xd20f('0x2c')],qs[_0xd20f('0x44')](_0x4497f0['query'][_0xd20f('0x44')]));_0x2992d6[_0xd20f('0x31')]=_0x2992d6['attributes'][_0xd20f('0x32')]?_0x2992d6['attributes']:_0x163013['model'];if(_0x4497f0[_0xd20f('0x2e')][_0xd20f('0x3c')]){_0x2992d6['include']=[{'all':!![]}];}_0x2992d6=_['merge']({},_0x2992d6,_0x4497f0['options']);return db[_0xd20f('0x29')][_0xd20f('0x45')](_0x2992d6)[_0xd20f('0x23')](handleEntityNotFound(_0x311220,null))[_0xd20f('0x23')](respondWithResult(_0x311220,null))['catch'](handleError(_0x311220,null));};exports[_0xd20f('0x46')]=function(_0x436770,_0xb14c45){return db[_0xd20f('0x29')][_0xd20f('0x46')](_0x436770[_0xd20f('0x47')],{})[_0xd20f('0x23')](respondWithResult(_0xb14c45,0xc9))['catch'](handleError(_0xb14c45,null));};exports[_0xd20f('0x22')]=function(_0x4ca61f,_0x4986b0){if(_0x4ca61f[_0xd20f('0x47')]['id']){delete _0x4ca61f[_0xd20f('0x47')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x4ca61f[_0xd20f('0x41')]['id']}})['then'](handleEntityNotFound(_0x4986b0,null))[_0xd20f('0x23')](saveUpdates(_0x4ca61f['body'],null))[_0xd20f('0x23')](respondWithResult(_0x4986b0,null))[_0xd20f('0x3f')](handleError(_0x4986b0,null));};exports[_0xd20f('0x24')]=function(_0x1ca03b,_0x3f526d){return db[_0xd20f('0x29')]['find']({'where':{'id':_0x1ca03b['params']['id']}})[_0xd20f('0x23')](handleEntityNotFound(_0x3f526d,null))[_0xd20f('0x23')](removeEntity(_0x3f526d,null))[_0xd20f('0x3f')](handleError(_0x3f526d,null));};exports[_0xd20f('0x48')]=function(_0x1bc0b1,_0x3e67dd){return db[_0xd20f('0x29')][_0xd20f('0x48')]()[_0xd20f('0x23')](respondWithResult(_0x3e67dd,null))[_0xd20f('0x3f')](handleError(_0x3e67dd,null));};
\ No newline at end of file
index 5335f53..7e85bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c8c=['report_openchannel_transfer','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','define'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8c8c,0x1ec));var _0xc8c8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8c8c[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xc8c8('0x0'));var logger=require(_0xc8c8('0x1'))('api');var moment=require(_0xc8c8('0x2'));var BPromise=require('bluebird');var rp=require(_0xc8c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8c8('0x4'));var config=require(_0xc8c8('0x5'));var attributes=require(_0xc8c8('0x6'));module['exports']=function(_0x1fc369,_0x50d9ee){return _0x1fc369[_0xc8c8('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0xc8c8('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc8c8('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x41b7=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x37b6db,_0x46cfcc){var _0x4ddd03=function(_0x5ae530){while(--_0x5ae530){_0x37b6db['push'](_0x37b6db['shift']());}};_0x4ddd03(++_0x46cfcc);}(_0x41b7,0xd3));var _0x741b=function(_0x53ff8e,_0x142c4a){_0x53ff8e=_0x53ff8e-0x0;var _0x57058b=_0x41b7[_0x53ff8e];return _0x57058b;};'use strict';var _=require(_0x741b('0x0'));var util=require('util');var logger=require(_0x741b('0x1'))(_0x741b('0x2'));var moment=require(_0x741b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x741b('0x4'));var rimraf=require(_0x741b('0x5'));var config=require(_0x741b('0x6'));var attributes=require(_0x741b('0x7'));module[_0x741b('0x8')]=function(_0x41ad9d,_0x40a59f){return _0x41ad9d[_0x741b('0x9')](_0x741b('0xa'),attributes,{'tableName':_0x741b('0xb'),'paranoid':![],'indexes':[{'name':_0x741b('0xc'),'fields':[_0x741b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 445b8c2..6c45b62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a7=['../../config/environment','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x5176fc,_0x4530e4){_0x5176fc=_0x5176fc-0x0;var _0x584160=_0xd8a7[_0x5176fc];return _0x584160;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d8a('0x1'));var fs=require('fs');var Redis=require(_0x7d8a('0x2'));var db=require(_0x7d8a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d8a('0x4'))('rpc');var config=require(_0x7d8a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d8a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf673,_0x28ea08,_0x240123){return new BPromise(function(_0x58ead1,_0x3207cc){return client[_0x7d8a('0x7')](_0x1cf673,_0x240123)[_0x7d8a('0x8')](function(_0x328503){logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,_0x7d8a('0xb'));logger[_0x7d8a('0xc')](_0x7d8a('0xd'),_0x28ea08,_0x7d8a('0xb'),JSON[_0x7d8a('0xe')](_0x328503));if(_0x328503[_0x7d8a('0xf')]){if(_0x328503[_0x7d8a('0xf')]['code']===0x1f4){logger[_0x7d8a('0xf')](_0x7d8a('0xa'),_0x28ea08,_0x328503[_0x7d8a('0xf')][_0x7d8a('0x10')]);return _0x3207cc(_0x328503[_0x7d8a('0xf')]['message']);}logger[_0x7d8a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x28ea08,_0x328503[_0x7d8a('0xf')]['message']);return _0x58ead1(_0x328503[_0x7d8a('0xf')]['message']);}else{logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,'request\x20sent');_0x58ead1(_0x328503[_0x7d8a('0x11')][_0x7d8a('0x10')]);}})[_0x7d8a('0x12')](function(_0xe9563c){logger['error'](_0x7d8a('0xa'),_0x28ea08,_0xe9563c);_0x3207cc(_0xe9563c);});});}
\ No newline at end of file
+var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0xcc3eaf,_0x4da4bc){var _0x495bc4=function(_0x213f8d){while(--_0x213f8d){_0xcc3eaf['push'](_0xcc3eaf['shift']());}};_0x495bc4(++_0x4da4bc);}(_0x2675,0x75));var _0x5267=function(_0x4f3ee6,_0x261c25){_0x4f3ee6=_0x4f3ee6-0x0;var _0x2d6f40=_0x2675[_0x4f3ee6];return _0x2d6f40;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});}
\ No newline at end of file
index 349c5be..82582f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbed9=['fs-extra','../../components/auth/service','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xbed9,0x7a));var _0x9bed=function(_0xd4f97a,_0x38f31c){_0xd4f97a=_0xd4f97a-0x0;var _0x1cea9a=_0xbed9[_0xd4f97a];return _0x1cea9a;};'use strict';var multer=require(_0x9bed('0x0'));var util=require(_0x9bed('0x1'));var path=require('path');var timeout=require(_0x9bed('0x2'));var express=require(_0x9bed('0x3'));var router=express['Router']();var fs_extra=require(_0x9bed('0x4'));var auth=require(_0x9bed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9bed('0x6'));router[_0x9bed('0x7')]('/',auth[_0x9bed('0x8')](),controller['index']);router['get'](_0x9bed('0x9'),auth[_0x9bed('0x8')](),controller[_0x9bed('0xa')]);router[_0x9bed('0xb')]('/',auth['isAuthenticated'](),controller[_0x9bed('0xc')]);router[_0x9bed('0xd')](_0x9bed('0x9'),auth[_0x9bed('0x8')](),controller[_0x9bed('0xe')]);router[_0x9bed('0xf')]('/:id',auth[_0x9bed('0x8')](),controller[_0x9bed('0x10')]);module[_0x9bed('0x11')]=router;
\ No newline at end of file
+var _0x5e5b=['post','create','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show'];(function(_0x515f78,_0x3b69be){var _0x506f6c=function(_0x14da41){while(--_0x14da41){_0x515f78['push'](_0x515f78['shift']());}};_0x506f6c(++_0x3b69be);}(_0x5e5b,0x113));var _0xb5e5=function(_0xd24771,_0x37e728){_0xd24771=_0xd24771-0x0;var _0x366033=_0x5e5b[_0xd24771];return _0x366033;};'use strict';var multer=require(_0xb5e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb5e5('0x1'));var express=require(_0xb5e5('0x2'));var router=express[_0xb5e5('0x3')]();var fs_extra=require(_0xb5e5('0x4'));var auth=require(_0xb5e5('0x5'));var interaction=require(_0xb5e5('0x6'));var config=require(_0xb5e5('0x7'));var controller=require(_0xb5e5('0x8'));router[_0xb5e5('0x9')]('/',auth[_0xb5e5('0xa')](),controller[_0xb5e5('0xb')]);router[_0xb5e5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb5e5('0xc')]);router[_0xb5e5('0xd')]('/',auth[_0xb5e5('0xa')](),controller[_0xb5e5('0xe')]);router['put'](_0xb5e5('0xf'),auth[_0xb5e5('0xa')](),controller['update']);router['delete'](_0xb5e5('0xf'),auth[_0xb5e5('0xa')](),controller[_0xb5e5('0x10')]);module[_0xb5e5('0x11')]=router;
\ No newline at end of file
index 00865d6..1b29d50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x379a=['name','STRING','sequelize','exports'];(function(_0x1a4c39,_0x13aade){var _0x55b641=function(_0x222d9f){while(--_0x222d9f){_0x1a4c39['push'](_0x1a4c39['shift']());}};_0x55b641(++_0x13aade);}(_0x379a,0x172));var _0xa379=function(_0x1508e9,_0x5dfaec){_0x1508e9=_0x1508e9-0x0;var _0x5a0bf5=_0x379a[_0x1508e9];return _0x5a0bf5;};'use strict';var Sequelize=require(_0xa379('0x0'));module[_0xa379('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa379('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa379('0x3')]}};
\ No newline at end of file
+var _0xb014=['exports','STRING','sequelize'];(function(_0x519e26,_0x2e04f8){var _0x1a8bbe=function(_0x18be9c){while(--_0x18be9c){_0x519e26['push'](_0x519e26['shift']());}};_0x1a8bbe(++_0x2e04f8);}(_0xb014,0x1b5));var _0x4b01=function(_0x55a89d,_0x584ea7){_0x55a89d=_0x55a89d-0x0;var _0x1b0e5a=_0xb014[_0x55a89d];return _0x1b0e5a;};'use strict';var Sequelize=require(_0x4b01('0x0'));module[_0x4b01('0x1')]={'name':{'type':Sequelize[_0x4b01('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9f9251b..2824a7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc186=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','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','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','get','Pauses','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create'];(function(_0x57f6f9,_0x47acd3){var _0x3bec73=function(_0x11c49b){while(--_0x11c49b){_0x57f6f9['push'](_0x57f6f9['shift']());}};_0x3bec73(++_0x47acd3);}(_0xc186,0xbc));var _0x6c18=function(_0x535e02,_0x4efc92){_0x535e02=_0x535e02-0x0;var _0x4c2396=_0xc186[_0x535e02];return _0x4c2396;};'use strict';var emlformat=require(_0x6c18('0x0'));var rimraf=require(_0x6c18('0x1'));var zipdir=require(_0x6c18('0x2'));var jsonpatch=require(_0x6c18('0x3'));var rp=require(_0x6c18('0x4'));var moment=require(_0x6c18('0x5'));var BPromise=require(_0x6c18('0x6'));var Mustache=require(_0x6c18('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6c18('0x8'));var csv=require('to-csv');var ejs=require(_0x6c18('0x9'));var fs=require('fs');var fs_extra=require(_0x6c18('0xa'));var _=require(_0x6c18('0xb'));var squel=require(_0x6c18('0xc'));var crypto=require(_0x6c18('0xd'));var jsforce=require(_0x6c18('0xe'));var deskjs=require(_0x6c18('0xf'));var toCsv=require(_0x6c18('0x10'));var querystring=require(_0x6c18('0x11'));var Papa=require(_0x6c18('0x12'));var Redis=require(_0x6c18('0x13'));var authService=require(_0x6c18('0x14'));var qs=require(_0x6c18('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c18('0x16'));var logger=require('../../config/logger')(_0x6c18('0x17'));var utils=require(_0x6c18('0x18'));var config=require(_0x6c18('0x19'));var licenseUtil=require(_0x6c18('0x1a'));var db=require(_0x6c18('0x1b'))['db'];function respondWithStatusCode(_0x1abdd7,_0x42bea2){_0x42bea2=_0x42bea2||0xcc;return function(_0x1bfad9){if(_0x1bfad9){return _0x1abdd7['sendStatus'](_0x42bea2);}return _0x1abdd7[_0x6c18('0x1c')](_0x42bea2)[_0x6c18('0x1d')]();};}function respondWithResult(_0x30cbe4,_0x1bd6d8){_0x1bd6d8=_0x1bd6d8||0xc8;return function(_0x24a3aa){if(_0x24a3aa){return _0x30cbe4[_0x6c18('0x1c')](_0x1bd6d8)[_0x6c18('0x1e')](_0x24a3aa);}};}function respondWithFilteredResult(_0x298bbc,_0x31ce64){return function(_0x260358){if(_0x260358){var _0xf208a5=typeof _0x31ce64[_0x6c18('0x1f')]===_0x6c18('0x20')&&typeof _0x31ce64[_0x6c18('0x21')]===_0x6c18('0x20');var _0x207c06=_0x260358['count'];var _0x47d668=_0xf208a5?0x0:_0x31ce64[_0x6c18('0x1f')];var _0x5beab9=_0xf208a5?_0x260358[_0x6c18('0x22')]:_0x31ce64[_0x6c18('0x1f')]+_0x31ce64[_0x6c18('0x21')];var _0xf95b99;if(_0x5beab9>=_0x207c06){_0x5beab9=_0x207c06;_0xf95b99=0xc8;}else{_0xf95b99=0xce;}_0x298bbc[_0x6c18('0x1c')](_0xf95b99);return _0x298bbc['set'](_0x6c18('0x23'),_0x47d668+'-'+_0x5beab9+'/'+_0x207c06)[_0x6c18('0x1e')](_0x260358);}return null;};}function patchUpdates(_0x3087b8){return function(_0x5049b7){try{jsonpatch[_0x6c18('0x24')](_0x5049b7,_0x3087b8,!![]);}catch(_0x4080e6){return BPromise[_0x6c18('0x25')](_0x4080e6);}return _0x5049b7['save']();};}function saveUpdates(_0x34b60d,_0x1ebdcf){return function(_0x4bc0f0){if(_0x4bc0f0){return _0x4bc0f0['update'](_0x34b60d)[_0x6c18('0x26')](function(_0x298a3e){return _0x298a3e;});}return null;};}function removeEntity(_0x6bca79,_0x2998e8){return function(_0x5ed273){if(_0x5ed273){return _0x5ed273['destroy']()[_0x6c18('0x26')](function(){var _0x11ff4=_0x5ed273[_0x6c18('0x27')]({'plain':!![]});var _0x5b6cce=_0x6c18('0x28');return db[_0x6c18('0x29')][_0x6c18('0x2a')]({'where':{'type':_0x5b6cce,'resourceId':_0x11ff4['id']}})['then'](function(){return _0x5ed273;});})[_0x6c18('0x26')](function(){_0x6bca79[_0x6c18('0x1c')](0xcc)[_0x6c18('0x1d')]();});}};}function handleEntityNotFound(_0x429235,_0x2d7df7){return function(_0x295239){if(!_0x295239){_0x429235[_0x6c18('0x2b')](0x194);}return _0x295239;};}function handleError(_0x25aff6,_0xd8cd42){_0xd8cd42=_0xd8cd42||0x1f4;return function(_0x2fc689){logger['error'](_0x2fc689[_0x6c18('0x2c')]);if(_0x2fc689[_0x6c18('0x2d')]){delete _0x2fc689[_0x6c18('0x2d')];}_0x25aff6[_0x6c18('0x1c')](_0xd8cd42)[_0x6c18('0x2e')](_0x2fc689);};}exports[_0x6c18('0x2f')]=function(_0x50e8b3,_0x568c2e){var _0x214d79={},_0x32150a={},_0x9b5f73={'count':0x0,'rows':[]};var _0x58a271=_[_0x6c18('0x30')](db[_0x6c18('0x31')][_0x6c18('0x32')],function(_0x3f4546){return{'name':_0x3f4546[_0x6c18('0x33')],'type':_0x3f4546['type'][_0x6c18('0x34')]};});_0x32150a['model']=_[_0x6c18('0x30')](_0x58a271,_0x6c18('0x2d'));_0x32150a[_0x6c18('0x35')]=_[_0x6c18('0x36')](_0x50e8b3['query']);_0x32150a[_0x6c18('0x37')]=_['intersection'](_0x32150a[_0x6c18('0x38')],_0x32150a[_0x6c18('0x35')]);_0x214d79[_0x6c18('0x39')]=_[_0x6c18('0x3a')](_0x32150a[_0x6c18('0x38')],qs['fields'](_0x50e8b3[_0x6c18('0x35')]['fields']));_0x214d79[_0x6c18('0x39')]=_0x214d79[_0x6c18('0x39')][_0x6c18('0x3b')]?_0x214d79[_0x6c18('0x39')]:_0x32150a[_0x6c18('0x38')];if(!_0x50e8b3[_0x6c18('0x35')][_0x6c18('0x3c')]('nolimit')){_0x214d79[_0x6c18('0x21')]=qs[_0x6c18('0x21')](_0x50e8b3[_0x6c18('0x35')][_0x6c18('0x21')]);_0x214d79['offset']=qs[_0x6c18('0x1f')](_0x50e8b3[_0x6c18('0x35')][_0x6c18('0x1f')]);}_0x214d79[_0x6c18('0x3d')]=qs[_0x6c18('0x3e')](_0x50e8b3[_0x6c18('0x35')]['sort']);_0x214d79['where']=qs[_0x6c18('0x37')](_[_0x6c18('0x3f')](_0x50e8b3[_0x6c18('0x35')],_0x32150a['filters']),_0x58a271);if(_0x50e8b3[_0x6c18('0x35')][_0x6c18('0x40')]){_0x214d79[_0x6c18('0x41')]=_[_0x6c18('0x42')](_0x214d79[_0x6c18('0x41')],{'$or':_[_0x6c18('0x30')](_0x58a271,function(_0x2c979f){if(_0x2c979f[_0x6c18('0x43')]!==_0x6c18('0x44')){var _0x564934={};_0x564934[_0x2c979f['name']]={'$like':'%'+_0x50e8b3[_0x6c18('0x35')][_0x6c18('0x40')]+'%'};return _0x564934;}})});}_0x214d79=_[_0x6c18('0x42')]({},_0x214d79,_0x50e8b3[_0x6c18('0x45')]);var _0x482167={'where':_0x214d79[_0x6c18('0x41')]};return db[_0x6c18('0x31')][_0x6c18('0x22')](_0x482167)[_0x6c18('0x26')](function(_0x667258){_0x9b5f73['count']=_0x667258;if(_0x50e8b3['query'][_0x6c18('0x46')]){_0x214d79[_0x6c18('0x47')]=[{'all':!![]}];}return db[_0x6c18('0x31')][_0x6c18('0x48')](_0x214d79);})['then'](function(_0x296e0a){_0x9b5f73[_0x6c18('0x49')]=_0x296e0a;return _0x9b5f73;})[_0x6c18('0x26')](respondWithFilteredResult(_0x568c2e,_0x214d79))[_0x6c18('0x4a')](handleError(_0x568c2e,null));};exports['show']=function(_0x3fc03b,_0x38918a){var _0x58ef90={'raw':!![],'where':{'id':_0x3fc03b[_0x6c18('0x4b')]['id']}},_0x641f97={};_0x641f97[_0x6c18('0x38')]=_[_0x6c18('0x36')](db[_0x6c18('0x31')][_0x6c18('0x32')]);_0x641f97['query']=_['keys'](_0x3fc03b[_0x6c18('0x35')]);_0x641f97['filters']=_[_0x6c18('0x3a')](_0x641f97['model'],_0x641f97[_0x6c18('0x35')]);_0x58ef90[_0x6c18('0x39')]=_['intersection'](_0x641f97[_0x6c18('0x38')],qs['fields'](_0x3fc03b['query'][_0x6c18('0x4c')]));_0x58ef90[_0x6c18('0x39')]=_0x58ef90[_0x6c18('0x39')]['length']?_0x58ef90['attributes']:_0x641f97[_0x6c18('0x38')];if(_0x3fc03b[_0x6c18('0x35')][_0x6c18('0x46')]){_0x58ef90[_0x6c18('0x47')]=[{'all':!![]}];}_0x58ef90=_[_0x6c18('0x42')]({},_0x58ef90,_0x3fc03b[_0x6c18('0x45')]);return db['Pause'][_0x6c18('0x4d')](_0x58ef90)['then'](handleEntityNotFound(_0x38918a,null))[_0x6c18('0x26')](respondWithResult(_0x38918a,null))[_0x6c18('0x4a')](handleError(_0x38918a,null));};exports[_0x6c18('0x4e')]=function(_0x70ccba,_0x253bdc){return db[_0x6c18('0x31')][_0x6c18('0x4e')](_0x70ccba[_0x6c18('0x4f')],{})['then'](function(_0x380a74){var _0x2ce2f6=_0x70ccba[_0x6c18('0x50')][_0x6c18('0x27')]({'plain':!![]});if(!_0x2ce2f6)throw new Error(_0x6c18('0x51'));if(_0x2ce2f6[_0x6c18('0x52')]===_0x6c18('0x50')){var _0x3e3692=_0x380a74[_0x6c18('0x27')]({'plain':!![]});var _0xe8296f=_0x6c18('0x28');return db[_0x6c18('0x53')]['find']({'where':{'name':_0xe8296f,'userProfileId':_0x2ce2f6[_0x6c18('0x54')]},'raw':!![]})['then'](function(_0xbc398c){if(_0xbc398c&&_0xbc398c[_0x6c18('0x55')]===0x0){return db[_0x6c18('0x29')][_0x6c18('0x4e')]({'name':_0x3e3692[_0x6c18('0x2d')],'resourceId':_0x3e3692['id'],'type':_0xbc398c[_0x6c18('0x2d')],'sectionId':_0xbc398c['id']},{})[_0x6c18('0x26')](function(){return _0x380a74;});}else{return _0x380a74;}})[_0x6c18('0x4a')](function(_0x5ed87e){logger[_0x6c18('0x56')](_0x6c18('0x57'),_0x5ed87e);throw _0x5ed87e;});}return _0x380a74;})[_0x6c18('0x26')](respondWithResult(_0x253bdc,0xc9))[_0x6c18('0x4a')](handleError(_0x253bdc,null));};exports[_0x6c18('0x58')]=function(_0x1ba844,_0x3b7572){if(_0x1ba844[_0x6c18('0x4f')]['id']){delete _0x1ba844[_0x6c18('0x4f')]['id'];}return db['Pause'][_0x6c18('0x4d')]({'where':{'id':_0x1ba844['params']['id']}})[_0x6c18('0x26')](handleEntityNotFound(_0x3b7572,null))[_0x6c18('0x26')](saveUpdates(_0x1ba844['body'],null))[_0x6c18('0x26')](respondWithResult(_0x3b7572,null))['catch'](handleError(_0x3b7572,null));};exports[_0x6c18('0x2a')]=function(_0x4a3b83,_0x3b3daa){return db['Pause'][_0x6c18('0x4d')]({'where':{'id':_0x4a3b83[_0x6c18('0x4b')]['id']}})[_0x6c18('0x26')](handleEntityNotFound(_0x3b3daa,null))['then'](removeEntity(_0x3b3daa,null))[_0x6c18('0x4a')](handleError(_0x3b3daa,null));};
\ No newline at end of file
+var _0x9d6d=['filters','attributes','model','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','Pause','findAll','rows','params','intersection','length','includeAll','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','Pauses','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d6d,0x114));var _0xd9d6=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x9d6d[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0xd9d6('0x0'));var rimraf=require(_0xd9d6('0x1'));var zipdir=require(_0xd9d6('0x2'));var jsonpatch=require(_0xd9d6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd9d6('0x4'));var util=require('util');var path=require(_0xd9d6('0x5'));var sox=require(_0xd9d6('0x6'));var csv=require(_0xd9d6('0x7'));var ejs=require(_0xd9d6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9d6('0x9'));var squel=require(_0xd9d6('0xa'));var crypto=require('crypto');var jsforce=require(_0xd9d6('0xb'));var deskjs=require(_0xd9d6('0xc'));var toCsv=require(_0xd9d6('0x7'));var querystring=require(_0xd9d6('0xd'));var Papa=require('papaparse');var Redis=require(_0xd9d6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd9d6('0xf'));var as=require(_0xd9d6('0x10'));var hardwareService=require(_0xd9d6('0x11'));var logger=require(_0xd9d6('0x12'))(_0xd9d6('0x13'));var utils=require(_0xd9d6('0x14'));var config=require(_0xd9d6('0x15'));var licenseUtil=require(_0xd9d6('0x16'));var db=require(_0xd9d6('0x17'))['db'];function respondWithStatusCode(_0x459a60,_0x418659){_0x418659=_0x418659||0xcc;return function(_0x29b45f){if(_0x29b45f){return _0x459a60[_0xd9d6('0x18')](_0x418659);}return _0x459a60[_0xd9d6('0x19')](_0x418659)[_0xd9d6('0x1a')]();};}function respondWithResult(_0x1c0b49,_0x431f99){_0x431f99=_0x431f99||0xc8;return function(_0x407787){if(_0x407787){return _0x1c0b49[_0xd9d6('0x19')](_0x431f99)[_0xd9d6('0x1b')](_0x407787);}};}function respondWithFilteredResult(_0x2c4885,_0x234682){return function(_0x12c035){if(_0x12c035){var _0x549687=typeof _0x234682['offset']===_0xd9d6('0x1c')&&typeof _0x234682[_0xd9d6('0x1d')]===_0xd9d6('0x1c');var _0x182741=_0x12c035['count'];var _0x29826e=_0x549687?0x0:_0x234682['offset'];var _0x2e0e5a=_0x549687?_0x12c035[_0xd9d6('0x1e')]:_0x234682[_0xd9d6('0x1f')]+_0x234682[_0xd9d6('0x1d')];var _0x5f4b34;if(_0x2e0e5a>=_0x182741){_0x2e0e5a=_0x182741;_0x5f4b34=0xc8;}else{_0x5f4b34=0xce;}_0x2c4885[_0xd9d6('0x19')](_0x5f4b34);return _0x2c4885['set'](_0xd9d6('0x20'),_0x29826e+'-'+_0x2e0e5a+'/'+_0x182741)['json'](_0x12c035);}return null;};}function patchUpdates(_0x9fc96e){return function(_0x13d83b){try{jsonpatch[_0xd9d6('0x21')](_0x13d83b,_0x9fc96e,!![]);}catch(_0x103216){return BPromise[_0xd9d6('0x22')](_0x103216);}return _0x13d83b['save']();};}function saveUpdates(_0xa03ee0,_0x1843f6){return function(_0x3fc717){if(_0x3fc717){return _0x3fc717[_0xd9d6('0x23')](_0xa03ee0)[_0xd9d6('0x24')](function(_0x29e7a1){return _0x29e7a1;});}return null;};}function removeEntity(_0x1b1527,_0x2ca03c){return function(_0x5cda5d){if(_0x5cda5d){return _0x5cda5d[_0xd9d6('0x25')]()[_0xd9d6('0x24')](function(){var _0x4b2c3c=_0x5cda5d[_0xd9d6('0x26')]({'plain':!![]});var _0x418e0b=_0xd9d6('0x27');return db['UserProfileResource'][_0xd9d6('0x25')]({'where':{'type':_0x418e0b,'resourceId':_0x4b2c3c['id']}})[_0xd9d6('0x24')](function(){return _0x5cda5d;});})[_0xd9d6('0x24')](function(){_0x1b1527[_0xd9d6('0x19')](0xcc)[_0xd9d6('0x1a')]();});}};}function handleEntityNotFound(_0x7ff6e,_0xb389df){return function(_0x5987a2){if(!_0x5987a2){_0x7ff6e[_0xd9d6('0x18')](0x194);}return _0x5987a2;};}function handleError(_0x104a26,_0x37b6f2){_0x37b6f2=_0x37b6f2||0x1f4;return function(_0x4a9461){logger[_0xd9d6('0x28')](_0x4a9461[_0xd9d6('0x29')]);if(_0x4a9461[_0xd9d6('0x2a')]){delete _0x4a9461[_0xd9d6('0x2a')];}_0x104a26[_0xd9d6('0x19')](_0x37b6f2)[_0xd9d6('0x2b')](_0x4a9461);};}exports[_0xd9d6('0x2c')]=function(_0x491442,_0xddb918){var _0x3b0573={},_0x47c805={},_0x4f8775={'count':0x0,'rows':[]};var _0x17aa91=_[_0xd9d6('0x2d')](db['Pause'][_0xd9d6('0x2e')],function(_0x2e17fd){return{'name':_0x2e17fd[_0xd9d6('0x2f')],'type':_0x2e17fd[_0xd9d6('0x30')][_0xd9d6('0x31')]};});_0x47c805['model']=_[_0xd9d6('0x2d')](_0x17aa91,'name');_0x47c805[_0xd9d6('0x32')]=_[_0xd9d6('0x33')](_0x491442[_0xd9d6('0x32')]);_0x47c805[_0xd9d6('0x34')]=_['intersection'](_0x47c805['model'],_0x47c805[_0xd9d6('0x32')]);_0x3b0573[_0xd9d6('0x35')]=_['intersection'](_0x47c805[_0xd9d6('0x36')],qs[_0xd9d6('0x37')](_0x491442[_0xd9d6('0x32')][_0xd9d6('0x37')]));_0x3b0573[_0xd9d6('0x35')]=_0x3b0573[_0xd9d6('0x35')]['length']?_0x3b0573[_0xd9d6('0x35')]:_0x47c805[_0xd9d6('0x36')];if(!_0x491442[_0xd9d6('0x32')]['hasOwnProperty']('nolimit')){_0x3b0573[_0xd9d6('0x1d')]=qs[_0xd9d6('0x1d')](_0x491442[_0xd9d6('0x32')]['limit']);_0x3b0573[_0xd9d6('0x1f')]=qs[_0xd9d6('0x1f')](_0x491442[_0xd9d6('0x32')][_0xd9d6('0x1f')]);}_0x3b0573[_0xd9d6('0x38')]=qs[_0xd9d6('0x39')](_0x491442[_0xd9d6('0x32')][_0xd9d6('0x39')]);_0x3b0573['where']=qs[_0xd9d6('0x34')](_[_0xd9d6('0x3a')](_0x491442[_0xd9d6('0x32')],_0x47c805[_0xd9d6('0x34')]),_0x17aa91);if(_0x491442['query'][_0xd9d6('0x3b')]){_0x3b0573[_0xd9d6('0x3c')]=_[_0xd9d6('0x3d')](_0x3b0573[_0xd9d6('0x3c')],{'$or':_[_0xd9d6('0x2d')](_0x17aa91,function(_0x4cbea5){if(_0x4cbea5['type']!==_0xd9d6('0x3e')){var _0x5d5a9a={};_0x5d5a9a[_0x4cbea5[_0xd9d6('0x2a')]]={'$like':'%'+_0x491442[_0xd9d6('0x32')][_0xd9d6('0x3b')]+'%'};return _0x5d5a9a;}})});}_0x3b0573=_[_0xd9d6('0x3d')]({},_0x3b0573,_0x491442[_0xd9d6('0x3f')]);var _0x50a2ec={'where':_0x3b0573[_0xd9d6('0x3c')]};return db[_0xd9d6('0x40')]['count'](_0x50a2ec)['then'](function(_0x501fec){_0x4f8775['count']=_0x501fec;if(_0x491442[_0xd9d6('0x32')]['includeAll']){_0x3b0573['include']=[{'all':!![]}];}return db['Pause'][_0xd9d6('0x41')](_0x3b0573);})[_0xd9d6('0x24')](function(_0x5080b5){_0x4f8775[_0xd9d6('0x42')]=_0x5080b5;return _0x4f8775;})[_0xd9d6('0x24')](respondWithFilteredResult(_0xddb918,_0x3b0573))['catch'](handleError(_0xddb918,null));};exports['show']=function(_0x252a4f,_0x2ee2f5){var _0x1d855={'raw':!![],'where':{'id':_0x252a4f[_0xd9d6('0x43')]['id']}},_0x38b9d6={};_0x38b9d6[_0xd9d6('0x36')]=_[_0xd9d6('0x33')](db[_0xd9d6('0x40')][_0xd9d6('0x2e')]);_0x38b9d6[_0xd9d6('0x32')]=_[_0xd9d6('0x33')](_0x252a4f[_0xd9d6('0x32')]);_0x38b9d6[_0xd9d6('0x34')]=_[_0xd9d6('0x44')](_0x38b9d6[_0xd9d6('0x36')],_0x38b9d6[_0xd9d6('0x32')]);_0x1d855[_0xd9d6('0x35')]=_[_0xd9d6('0x44')](_0x38b9d6[_0xd9d6('0x36')],qs[_0xd9d6('0x37')](_0x252a4f[_0xd9d6('0x32')][_0xd9d6('0x37')]));_0x1d855[_0xd9d6('0x35')]=_0x1d855[_0xd9d6('0x35')][_0xd9d6('0x45')]?_0x1d855['attributes']:_0x38b9d6[_0xd9d6('0x36')];if(_0x252a4f['query'][_0xd9d6('0x46')]){_0x1d855['include']=[{'all':!![]}];}_0x1d855=_[_0xd9d6('0x3d')]({},_0x1d855,_0x252a4f[_0xd9d6('0x3f')]);return db[_0xd9d6('0x40')][_0xd9d6('0x47')](_0x1d855)[_0xd9d6('0x24')](handleEntityNotFound(_0x2ee2f5,null))['then'](respondWithResult(_0x2ee2f5,null))['catch'](handleError(_0x2ee2f5,null));};exports[_0xd9d6('0x48')]=function(_0x24d58d,_0x465624){return db[_0xd9d6('0x40')][_0xd9d6('0x48')](_0x24d58d['body'],{})['then'](function(_0x5daf18){var _0x5564dc=_0x24d58d['user'][_0xd9d6('0x26')]({'plain':!![]});if(!_0x5564dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5564dc[_0xd9d6('0x49')]===_0xd9d6('0x4a')){var _0x3472bc=_0x5daf18[_0xd9d6('0x26')]({'plain':!![]});var _0x10a082='Pauses';return db[_0xd9d6('0x4b')]['find']({'where':{'name':_0x10a082,'userProfileId':_0x5564dc[_0xd9d6('0x4c')]},'raw':!![]})[_0xd9d6('0x24')](function(_0x1c1287){if(_0x1c1287&&_0x1c1287[_0xd9d6('0x4d')]===0x0){return db[_0xd9d6('0x4e')][_0xd9d6('0x48')]({'name':_0x3472bc[_0xd9d6('0x2a')],'resourceId':_0x3472bc['id'],'type':_0x1c1287[_0xd9d6('0x2a')],'sectionId':_0x1c1287['id']},{})[_0xd9d6('0x24')](function(){return _0x5daf18;});}else{return _0x5daf18;}})[_0xd9d6('0x4f')](function(_0x11e9d0){logger[_0xd9d6('0x28')](_0xd9d6('0x50'),_0x11e9d0);throw _0x11e9d0;});}return _0x5daf18;})[_0xd9d6('0x24')](respondWithResult(_0x465624,0xc9))['catch'](handleError(_0x465624,null));};exports['update']=function(_0x573b7e,_0x528877){if(_0x573b7e[_0xd9d6('0x51')]['id']){delete _0x573b7e[_0xd9d6('0x51')]['id'];}return db[_0xd9d6('0x40')][_0xd9d6('0x47')]({'where':{'id':_0x573b7e[_0xd9d6('0x43')]['id']}})[_0xd9d6('0x24')](handleEntityNotFound(_0x528877,null))[_0xd9d6('0x24')](saveUpdates(_0x573b7e['body'],null))[_0xd9d6('0x24')](respondWithResult(_0x528877,null))[_0xd9d6('0x4f')](handleError(_0x528877,null));};exports[_0xd9d6('0x25')]=function(_0x2325e2,_0x216adb){return db[_0xd9d6('0x40')][_0xd9d6('0x47')]({'where':{'id':_0x2325e2[_0xd9d6('0x43')]['id']}})[_0xd9d6('0x24')](handleEntityNotFound(_0x216adb,null))[_0xd9d6('0x24')](removeEntity(_0x216adb,null))[_0xd9d6('0x4f')](handleError(_0x216adb,null));};
\ No newline at end of file
index e70eef7..84e80e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x50a48d,_0x1cdf54){var _0x484d6c=function(_0x41b326){while(--_0x41b326){_0x50a48d['push'](_0x50a48d['shift']());}};_0x484d6c(++_0x1cdf54);}(_0x5fab,0x177));var _0xb5fa=function(_0x25d542,_0x462ad9){_0x25d542=_0x25d542-0x0;var _0x377a7e=_0x5fab[_0x25d542];return _0x377a7e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03194aa..8c80d89 100644 (file)
@@ -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(_0x1611c0,_0x1a3328){var _0x576470=function(_0x2e3d6b){while(--_0x2e3d6b){_0x1611c0['push'](_0x1611c0['shift']());}};_0x576470(++_0x1a3328);}(_0xb10b,0x12a));var _0xbb10=function(_0x3db2e8,_0x49c09b){_0x3db2e8=_0x3db2e8-0x0;var _0xf05958=_0xb10b[_0x3db2e8];return _0xf05958;};'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(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0x7a54,0x106));var _0x47a5=function(_0x53647b,_0x3fcb9e){_0x53647b=_0x53647b-0x0;var _0x34cf45=_0x7a54[_0x53647b];return _0x34cf45;};'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
index 4cf9746..23d5235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13a=['./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','extname','now','single','upload','post','/webhook','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44ff29,_0x2af0f4){var _0x2cb0bf=function(_0x55853a){while(--_0x55853a){_0x44ff29['push'](_0x44ff29['shift']());}};_0x2cb0bf(++_0x2af0f4);}(_0xe13a,0x178));var _0xae13=function(_0x49bf6a,_0x374c74){_0x49bf6a=_0x49bf6a-0x0;var _0x5dc1db=_0xe13a[_0x49bf6a];return _0x5dc1db;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/webhook',controller[_0xae13('0xc')]);router[_0xae13('0x9')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0x9')](_0xae13('0xf'),auth[_0xae13('0xa')](),controller[_0xae13('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x404b0e,_0x83de98,_0x3d6a85){_0x3d6a85(null,path[_0xae13('0x11')](config[_0xae13('0x12')],_0xae13('0x13')));},'filename':function(_0x1505c5,_0x4dd599,_0x42d869){_0x4dd599[_0xae13('0x14')]=_0x4dd599['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42d869(null,util['format']('%s-%s%s',path['basename'](_0x4dd599[_0xae13('0x14')],path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])),Date[_0xae13('0x16')](),path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])));}})});router['post']('/',upload[_0xae13('0x17')]('file'),controller[_0xae13('0x18')]);router[_0xae13('0x19')](_0xae13('0x1a'),controller[_0xae13('0x1b')]);router[_0xae13('0x1c')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0x1d')]);router[_0xae13('0x1e')]('/:id',auth[_0xae13('0xa')](),controller['delete']);module[_0xae13('0x1f')]=router;
\ No newline at end of file
+var _0xe13a=['./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','extname','now','single','upload','post','/webhook','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30fbe9,_0x24bf9e){var _0x352f6d=function(_0x491767){while(--_0x491767){_0x30fbe9['push'](_0x30fbe9['shift']());}};_0x352f6d(++_0x24bf9e);}(_0xe13a,0x178));var _0xae13=function(_0x282a4a,_0xe3a64f){_0x282a4a=_0x282a4a-0x0;var _0x566033=_0xe13a[_0x282a4a];return _0x566033;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/webhook',controller[_0xae13('0xc')]);router[_0xae13('0x9')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0x9')](_0xae13('0xf'),auth[_0xae13('0xa')](),controller[_0xae13('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x404b0e,_0x83de98,_0x3d6a85){_0x3d6a85(null,path[_0xae13('0x11')](config[_0xae13('0x12')],_0xae13('0x13')));},'filename':function(_0x1505c5,_0x4dd599,_0x42d869){_0x4dd599[_0xae13('0x14')]=_0x4dd599['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42d869(null,util['format']('%s-%s%s',path['basename'](_0x4dd599[_0xae13('0x14')],path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])),Date[_0xae13('0x16')](),path[_0xae13('0x15')](_0x4dd599[_0xae13('0x14')])));}})});router['post']('/',upload[_0xae13('0x17')]('file'),controller[_0xae13('0x18')]);router[_0xae13('0x19')](_0xae13('0x1a'),controller[_0xae13('0x1b')]);router[_0xae13('0x1c')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0x1d')]);router[_0xae13('0x1e')]('/:id',auth[_0xae13('0xa')](),controller['delete']);module[_0xae13('0x1f')]=router;
\ No newline at end of file
index c4fe0e7..1f16bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x309f=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','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','never','always'];(function(_0x1f7723,_0x3f02a6){var _0x181e20=function(_0x212029){while(--_0x212029){_0x1f7723['push'](_0x1f7723['shift']());}};_0x181e20(++_0x3f02a6);}(_0x309f,0x1c8));var _0xf309=function(_0x339f18,_0x526b44){_0x339f18=_0x339f18-0x0;var _0x549dc0=_0x309f[_0x339f18];return _0x549dc0;};'use strict';var Sequelize=require(_0xf309('0x0'));module[_0xf309('0x1')]={'name':{'type':Sequelize[_0xf309('0x2')]},'type':{'type':Sequelize[_0xf309('0x3')]('html',_0xf309('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xf309('0x5')]},'path':{'type':Sequelize[_0xf309('0x2')],'comment':_0xf309('0x6')},'active':{'type':Sequelize[_0xf309('0x7')],'defaultValue':0x0,'comment':_0xf309('0x8')},'sidebar':{'type':Sequelize[_0xf309('0x3')]('adminOnly',_0xf309('0x9'),'always',_0xf309('0xa')),'defaultValue':_0xf309('0xb'),'comment':_0xf309('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xf309('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf309('0x2')]}};
\ No newline at end of file
+var _0x5141=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0xc0bde9,_0x355373){var _0x3483f9=function(_0x5820a2){while(--_0x5820a2){_0xc0bde9['push'](_0xc0bde9['shift']());}};_0x3483f9(++_0x355373);}(_0x5141,0x156));var _0x1514=function(_0x2bf301,_0x31511e){_0x2bf301=_0x2bf301-0x0;var _0x5ab1b6=_0x5141[_0x2bf301];return _0x5ab1b6;};'use strict';var Sequelize=require('sequelize');module[_0x1514('0x0')]={'name':{'type':Sequelize[_0x1514('0x1')]},'type':{'type':Sequelize[_0x1514('0x2')](_0x1514('0x3'),_0x1514('0x4'))},'description':{'type':Sequelize[_0x1514('0x5')]},'version':{'type':Sequelize[_0x1514('0x5')]},'path':{'type':Sequelize[_0x1514('0x1')],'comment':_0x1514('0x6')},'active':{'type':Sequelize[_0x1514('0x7')],'defaultValue':0x0,'comment':_0x1514('0x8')},'sidebar':{'type':Sequelize[_0x1514('0x2')](_0x1514('0x9'),_0x1514('0xa'),'always',_0x1514('0xb')),'defaultValue':_0x1514('0xc'),'comment':_0x1514('0xd')},'icon':{'type':Sequelize[_0x1514('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x1514('0x1')]}};
\ No newline at end of file
index d7e4b48..bcb4d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7521=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','show','params','download','find','path','join','root','format','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','unlinkSync','info','upload','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','port','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','hostname','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','fs-extra','squel','crypto','jsforce','desk.js','to-csv','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x7521,0x1c5));var _0x1752=function(_0x500a1e,_0xe1d666){_0x500a1e=_0x500a1e-0x0;var _0x228555=_0x7521[_0x500a1e];return _0x228555;};'use strict';var emlformat=require(_0x1752('0x0'));var rimraf=require(_0x1752('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1752('0x2'));var moment=require(_0x1752('0x3'));var BPromise=require(_0x1752('0x4'));var Mustache=require(_0x1752('0x5'));var util=require(_0x1752('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1752('0x7'));var _=require('lodash');var squel=require(_0x1752('0x8'));var crypto=require(_0x1752('0x9'));var jsforce=require(_0x1752('0xa'));var deskjs=require(_0x1752('0xb'));var toCsv=require(_0x1752('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0x1752('0x1'));var archiver=require(_0x1752('0xd'));var Redis=require(_0x1752('0xe'));var authService=require(_0x1752('0xf'));var qs=require(_0x1752('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1752('0x11'));var config=require(_0x1752('0x12'));var licenseUtil=require(_0x1752('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1752('0x14')](config[_0x1752('0x15')],{'host':_0x1752('0x16'),'port':0x18eb});var socket=require(_0x1752('0x17'))(new Redis(config[_0x1752('0x15')]));require(_0x1752('0x18'))[_0x1752('0x19')](socket);function respondWithStatusCode(_0x4e1ede,_0x596aa6){_0x596aa6=_0x596aa6||0xcc;return function(_0x2cbbff){if(_0x2cbbff){return _0x4e1ede[_0x1752('0x1a')](_0x596aa6);}return _0x4e1ede[_0x1752('0x1b')](_0x596aa6)[_0x1752('0x1c')]();};}function respondWithResult(_0xe1545,_0x302fe6){_0x302fe6=_0x302fe6||0xc8;return function(_0x1e5980){if(_0x1e5980){return _0xe1545['status'](_0x302fe6)['json'](_0x1e5980);}};}function respondWithFilteredResult(_0x1e8769,_0x1de5a8){return function(_0x104f94){if(_0x104f94){var _0x3e3984=typeof _0x1de5a8[_0x1752('0x1d')]===_0x1752('0x1e')&&typeof _0x1de5a8[_0x1752('0x1f')]===_0x1752('0x1e');var _0xa3cb89=_0x104f94[_0x1752('0x20')];var _0x56ffc0=_0x3e3984?0x0:_0x1de5a8[_0x1752('0x1d')];var _0x4ec789=_0x3e3984?_0x104f94[_0x1752('0x20')]:_0x1de5a8['offset']+_0x1de5a8[_0x1752('0x1f')];var _0x2ab055;if(_0x4ec789>=_0xa3cb89){_0x4ec789=_0xa3cb89;_0x2ab055=0xc8;}else{_0x2ab055=0xce;}_0x1e8769[_0x1752('0x1b')](_0x2ab055);return _0x1e8769[_0x1752('0x21')](_0x1752('0x22'),_0x56ffc0+'-'+_0x4ec789+'/'+_0xa3cb89)['json'](_0x104f94);}return null;};}function patchUpdates(_0x432add){return function(_0x276b78){try{jsonpatch[_0x1752('0x23')](_0x276b78,_0x432add,!![]);}catch(_0x1316cd){return BPromise[_0x1752('0x24')](_0x1316cd);}return _0x276b78[_0x1752('0x25')]();};}function saveUpdates(_0x42d86b,_0x11bdfd){return function(_0x3dc7a9){if(_0x3dc7a9){return _0x3dc7a9[_0x1752('0x26')](_0x42d86b)[_0x1752('0x27')](function(_0x4f13c1){return _0x4f13c1;});}return null;};}function removeEntity(_0x467017,_0x52c923){return function(_0x4f6fda){if(_0x4f6fda){return _0x4f6fda[_0x1752('0x28')]()[_0x1752('0x27')](function(){var _0x8f81fc=_0x4f6fda['get']({'plain':!![]});var _0x3be44b=_0x1752('0x29');return db[_0x1752('0x2a')][_0x1752('0x28')]({'where':{'type':_0x3be44b,'resourceId':_0x8f81fc['id']}})[_0x1752('0x27')](function(){return _0x4f6fda;});})[_0x1752('0x27')](function(){_0x467017[_0x1752('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0ae7,_0xa9ad35){return function(_0x3390f1){if(!_0x3390f1){_0x1d0ae7[_0x1752('0x1a')](0x194);}return _0x3390f1;};}function handleError(_0xfec92d,_0x3d4f7b){_0x3d4f7b=_0x3d4f7b||0x1f4;return function(_0x5af490){logger[_0x1752('0x2b')](_0x5af490[_0x1752('0x2c')]);if(_0x5af490['name']){delete _0x5af490['name'];}_0xfec92d[_0x1752('0x1b')](_0x3d4f7b)[_0x1752('0x2d')](_0x5af490);};}exports['index']=function(_0x2b675b,_0x493547){var _0x43033a={},_0x2fe6cc={},_0x2b18cd={'count':0x0,'rows':[]};var _0x750aa9=_[_0x1752('0x2e')](db['Plugin'][_0x1752('0x2f')],function(_0x415292){return{'name':_0x415292[_0x1752('0x30')],'type':_0x415292[_0x1752('0x31')][_0x1752('0x32')]};});_0x2fe6cc[_0x1752('0x33')]=_[_0x1752('0x2e')](_0x750aa9,_0x1752('0x34'));_0x2fe6cc[_0x1752('0x35')]=_[_0x1752('0x36')](_0x2b675b[_0x1752('0x35')]);_0x2fe6cc[_0x1752('0x37')]=_[_0x1752('0x38')](_0x2fe6cc[_0x1752('0x33')],_0x2fe6cc[_0x1752('0x35')]);_0x43033a[_0x1752('0x39')]=_[_0x1752('0x38')](_0x2fe6cc[_0x1752('0x33')],qs[_0x1752('0x3a')](_0x2b675b['query'][_0x1752('0x3a')]));_0x43033a[_0x1752('0x39')]=_0x43033a[_0x1752('0x39')][_0x1752('0x3b')]?_0x43033a[_0x1752('0x39')]:_0x2fe6cc['model'];if(!_0x2b675b['query'][_0x1752('0x3c')](_0x1752('0x3d'))){_0x43033a[_0x1752('0x1f')]=qs['limit'](_0x2b675b[_0x1752('0x35')][_0x1752('0x1f')]);_0x43033a[_0x1752('0x1d')]=qs['offset'](_0x2b675b[_0x1752('0x35')][_0x1752('0x1d')]);}_0x43033a[_0x1752('0x3e')]=qs['sort'](_0x2b675b[_0x1752('0x35')]['sort']);_0x43033a[_0x1752('0x3f')]=qs[_0x1752('0x37')](_['pick'](_0x2b675b[_0x1752('0x35')],_0x2fe6cc[_0x1752('0x37')]),_0x750aa9);if(_0x2b675b[_0x1752('0x35')][_0x1752('0x40')]){_0x43033a['where']=_[_0x1752('0x41')](_0x43033a[_0x1752('0x3f')],{'$or':_[_0x1752('0x2e')](_0x750aa9,function(_0x2ce3d8){if(_0x2ce3d8['type']!==_0x1752('0x42')){var _0x4602fc={};_0x4602fc[_0x2ce3d8[_0x1752('0x34')]]={'$like':'%'+_0x2b675b['query'][_0x1752('0x40')]+'%'};return _0x4602fc;}})});}_0x43033a=_[_0x1752('0x41')]({},_0x43033a,_0x2b675b[_0x1752('0x43')]);var _0x2e3395={'where':_0x43033a[_0x1752('0x3f')]};return db[_0x1752('0x44')]['count'](_0x2e3395)['then'](function(_0x4f750a){_0x2b18cd['count']=_0x4f750a;if(_0x2b675b['query'][_0x1752('0x45')]){_0x43033a[_0x1752('0x46')]=[{'all':!![]}];}return db['Plugin'][_0x1752('0x47')](_0x43033a);})['then'](function(_0x5c94d7){_0x2b18cd[_0x1752('0x48')]=_0x5c94d7;return _0x2b18cd;})[_0x1752('0x27')](respondWithFilteredResult(_0x493547,_0x43033a))[_0x1752('0x49')](handleError(_0x493547,null));};exports[_0x1752('0x4a')]=function(_0xc276a7,_0x463d9f){var _0x28b584={'raw':!![],'where':{'id':_0xc276a7[_0x1752('0x4b')]['id']}},_0x2ebe1e={};_0x2ebe1e[_0x1752('0x33')]=_[_0x1752('0x36')](db[_0x1752('0x44')][_0x1752('0x2f')]);_0x2ebe1e[_0x1752('0x35')]=_['keys'](_0xc276a7['query']);_0x2ebe1e['filters']=_[_0x1752('0x38')](_0x2ebe1e[_0x1752('0x33')],_0x2ebe1e[_0x1752('0x35')]);_0x28b584[_0x1752('0x39')]=_[_0x1752('0x38')](_0x2ebe1e['model'],qs[_0x1752('0x3a')](_0xc276a7[_0x1752('0x35')][_0x1752('0x3a')]));_0x28b584[_0x1752('0x39')]=_0x28b584[_0x1752('0x39')][_0x1752('0x3b')]?_0x28b584['attributes']:_0x2ebe1e[_0x1752('0x33')];if(_0xc276a7[_0x1752('0x35')][_0x1752('0x45')]){_0x28b584[_0x1752('0x46')]=[{'all':!![]}];}_0x28b584=_[_0x1752('0x41')]({},_0x28b584,_0xc276a7[_0x1752('0x43')]);return db[_0x1752('0x44')]['find'](_0x28b584)[_0x1752('0x27')](handleEntityNotFound(_0x463d9f,null))[_0x1752('0x27')](respondWithResult(_0x463d9f,null))[_0x1752('0x49')](handleError(_0x463d9f,null));};exports[_0x1752('0x4c')]=function(_0x4814c0,_0x14903f,_0x194639){return db[_0x1752('0x44')][_0x1752('0x4d')]({'where':{'id':_0x4814c0[_0x1752('0x4b')]['id']},'attributes':[_0x1752('0x34'),_0x1752('0x4e')],'raw':!![]})[_0x1752('0x27')](handleEntityNotFound(_0x14903f,null))[_0x1752('0x27')](function(_0x3df3b8){if(_0x3df3b8){var _0x291ac5=path[_0x1752('0x4f')](config[_0x1752('0x50')],'server/files/plugins',util[_0x1752('0x51')]('%s.zip',path[_0x1752('0x52')](_0x3df3b8['path'])));var _0x10e963=fs['createWriteStream'](_0x291ac5);var _0x37fb6e=archiver(_0x1752('0x53'),{'zlib':{'level':0x9}});_0x37fb6e['on'](_0x1752('0x54'),function(_0x59ca15){if(_0x59ca15['code']===_0x1752('0x55')){logger[_0x1752('0x2b')](_0x59ca15);}else{throw new db[(_0x1752('0x56'))][(_0x1752('0x57'))](_0x1752('0x58'));}});_0x37fb6e['on'](_0x1752('0x2b'),function(_0x1c1994){throw new db[(_0x1752('0x56'))][(_0x1752('0x57'))](_0x1752('0x58'));});_0x37fb6e[_0x1752('0x59')](_0x10e963);_0x37fb6e[_0x1752('0x5a')](_0x1752('0x5b'),{'cwd':path['join'](config[_0x1752('0x50')],'server/files/plugins',path['dirname'](_0x3df3b8['path'])),'ignore':[path[_0x1752('0x4f')](path[_0x1752('0x52')](_0x3df3b8[_0x1752('0x4e')]),_0x1752('0x5c')),path[_0x1752('0x4f')](path[_0x1752('0x52')](_0x3df3b8[_0x1752('0x4e')]),'attachments/**/*')],'nodir':!![]})[_0x1752('0x5d')]();_0x10e963['on']('close',function(){if(!fs[_0x1752('0x5e')](_0x291ac5)){throw new db[(_0x1752('0x56'))][(_0x1752('0x57'))](_0x1752('0x5f'));}return _0x14903f['download'](_0x291ac5,util[_0x1752('0x51')]('%s.zip',path[_0x1752('0x52')](_0x3df3b8[_0x1752('0x4e')])),function(_0x302408){if(_0x302408){throw new db[(_0x1752('0x56'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x1752('0x60')](_0x291ac5);logger[_0x1752('0x61')]('Download\x20completed');logger[_0x1752('0x61')]('Temporary\x20file\x20removed');});});}return null;})[_0x1752('0x49')](handleError(_0x14903f,null));};exports[_0x1752('0x62')]=function(_0x3c5ce8,_0x44c20c,_0x1f0901){var _0x32a492=path[_0x1752('0x52')](_0x3c5ce8[_0x1752('0x63')][_0x1752('0x64')],path[_0x1752('0x65')](_0x3c5ce8[_0x1752('0x63')][_0x1752('0x64')]));var _0x3cf035=path['join'](config[_0x1752('0x50')],_0x1752('0x66'),_0x3c5ce8[_0x1752('0x63')][_0x1752('0x64')]);var _0x5d4f43=path[_0x1752('0x4f')](config[_0x1752('0x50')],_0x1752('0x66'),_0x32a492);logger[_0x1752('0x61')](_0x1752('0x67'),_0x3cf035);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x5d4f43);try{fs[_0x1752('0x68')](_0x3cf035,parseInt(_0x1752('0x69'),0x8));extract(_0x3cf035,{'dir':_0x5d4f43},function(_0x3c8a64){if(_0x3c8a64){logger[_0x1752('0x2b')](_0x3c8a64);handleError(_0x3c8a64,!![]);};var _0x763b93=fs[_0x1752('0x6a')](_0x5d4f43);if(_0x763b93[_0x1752('0x3b')]>0x1){removeReferences(_0x3cf035,_0x5d4f43);logger[_0x1752('0x2b')]('Invalid\x20plugin\x20structure');return _0x1f0901(new Error('Invalid\x20plugin\x20structure'));}var _0x29dc16=fs[_0x1752('0x6b')](path[_0x1752('0x4f')](_0x5d4f43,_0x763b93[0x0]));if(_0x29dc16[_0x1752('0x6c')]()){removeReferences(_0x3cf035,_0x5d4f43);logger[_0x1752('0x2b')](_0x1752('0x6d'));return _0x1f0901(new Error('Invalid\x20plugin\x20structure'));}if(_0x29dc16[_0x1752('0x6e')]()){var _0x3d9caa=fs['readdirSync'](path[_0x1752('0x4f')](_0x5d4f43,_0x763b93[0x0]));if(_0x3d9caa['length']===0x0){removeReferences(_0x3cf035,_0x5d4f43);logger[_0x1752('0x2b')]('Invalid\x20plugin\x20structure');return _0x1f0901(new Error(_0x1752('0x6d')));}var _0x22d5be=_0x3d9caa[_0x1752('0x6f')](function(_0x20e149){return _0x20e149===_0x1752('0x70');});if(!_0x22d5be){return _0x1f0901(new Error(_0x1752('0x71')));}var _0x2a17f3=fs[_0x1752('0x72')](path['join'](_0x5d4f43,_0x763b93[0x0],_0x1752('0x70')));var _0x5145ab=JSON['parse'](_0x2a17f3);if(_0x1752('0x1e')==typeof _0x5145ab[_0x1752('0x34')]){return _0x1f0901(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x1752('0x1e')==typeof _0x5145ab[_0x1752('0x31')]){return _0x1f0901(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x1752('0x1e')==typeof _0x5145ab['version']){return _0x1f0901(new Error(_0x1752('0x73')));}if(_0x1752('0x1e')==typeof _0x5145ab['parameters']){return _0x1f0901(new Error(_0x1752('0x74')));}if(_0x5145ab[_0x1752('0x31')]===_0x1752('0x75')){if(_0x1752('0x1e')==typeof _0x5145ab[_0x1752('0x76')]['views']){return _0x1f0901(new Error(_0x1752('0x77')));}if(_0x1752('0x1e')==typeof _0x5145ab[_0x1752('0x76')][_0x1752('0x78')][_0x1752('0x79')]&&'undefined'==typeof _0x5145ab['parameters'][_0x1752('0x78')]['agent']){return _0x1f0901(new Error(_0x1752('0x7a')));}}else if(_0x5145ab['type']===_0x1752('0x7b')){if(_0x1752('0x1e')==typeof _0x5145ab['parameters'][_0x1752('0x7c')]){return _0x1f0901(new Error(_0x1752('0x7d')));}if(_0x1752('0x1e')==typeof _0x5145ab[_0x1752('0x76')]['scriptPath']){return _0x1f0901(new Error(_0x1752('0x7e')));}}else{return _0x1f0901(new Error(_0x1752('0x7f')));}var _0x25db48=_0x5145ab[_0x1752('0x34')];var _0x5c87dd=_0x5145ab[_0x1752('0x80')];var _0x260e66=_0x5145ab[_0x1752('0x31')];var _0x570dbd=_0x5145ab[_0x1752('0x81')]?_0x5145ab[_0x1752('0x81')]:_0x1752('0x82');var _0x454715=_0x5145ab[_0x1752('0x83')]?_0x5145ab[_0x1752('0x83')]:_0x1752('0x84');var _0x6cf433='';var _0x3124b8='';var _0x4bfd02='';var _0x19e028='';var _0x33f6b9=_0x5145ab[_0x1752('0x85')];if(_0x260e66==='html'){if(_0x1752('0x1e')!=typeof _0x5145ab[_0x1752('0x76')][_0x1752('0x78')][_0x1752('0x79')]){var _0x185c38=_0x5145ab[_0x1752('0x76')]['views'][_0x1752('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x1752('0x86')](_0x185c38)){_0x6cf433=path[_0x1752('0x4f')](_0x1752('0x87'),_0x32a492,_0x763b93[0x0],_0x185c38);}else{_0x6cf433=_0x185c38;}}else{logger[_0x1752('0x61')](_0x1752('0x88'));}if(_0x1752('0x1e')!=typeof _0x5145ab[_0x1752('0x76')][_0x1752('0x78')][_0x1752('0x89')]){var _0x569553=_0x5145ab[_0x1752('0x76')][_0x1752('0x78')][_0x1752('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x1752('0x86')](_0x569553)){_0x3124b8=path[_0x1752('0x4f')](_0x1752('0x87'),_0x32a492,_0x763b93[0x0],_0x569553);}else{_0x3124b8=_0x569553;}}else{logger['info'](_0x1752('0x8a'));}}else if(_0x260e66===_0x1752('0x7b')){_0x4bfd02=_0x5145ab['parameters'][_0x1752('0x7c')];_0x19e028=_0x5145ab[_0x1752('0x76')][_0x1752('0x8b')];if(_0x1752('0x1e')!=typeof _0x5145ab['parameters'][_0x1752('0x78')]){if(_0x1752('0x1e')!=typeof _0x5145ab[_0x1752('0x76')][_0x1752('0x78')]['admin']){var _0x185c38=_0x5145ab[_0x1752('0x76')][_0x1752('0x78')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x185c38)){_0x6cf433=path[_0x1752('0x4f')](_0x1752('0x87'),_0x32a492,_0x763b93[0x0],_0x185c38);}else{_0x6cf433=_0x185c38;}}if(_0x1752('0x1e')!=typeof _0x5145ab[_0x1752('0x76')][_0x1752('0x78')][_0x1752('0x89')]){var _0x569553=_0x5145ab['parameters'][_0x1752('0x78')][_0x1752('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x569553)){_0x3124b8=path[_0x1752('0x4f')](_0x1752('0x87'),_0x32a492,_0x763b93[0x0],_0x569553);}else{_0x3124b8=_0x569553;}}}}var _0x60102={'name':_0x25db48,'description':_0x5c87dd,'path':path[_0x1752('0x4f')](_0x32a492,_0x763b93[0x0]),'type':_0x260e66,'sidebar':_0x570dbd,'icon':_0x454715,'adminUrl':_0x6cf433,'agentUrl':_0x3124b8,'scriptName':_0x4bfd02,'scriptPath':_0x19e028,'version':_0x33f6b9};removeReferences(_0x3cf035,null);return db[_0x1752('0x44')][_0x1752('0x8c')](_0x60102)[_0x1752('0x27')](function(_0x119654){var _0x162c61={'role':_0x3c5ce8[_0x1752('0x8d')][_0x1752('0x8e')],'userProfileId':_0x3c5ce8[_0x1752('0x8d')]['userProfileId']};if(!_0x162c61)throw new Error(_0x1752('0x8f'));if(_0x162c61[_0x1752('0x8e')]==='user'){var _0x43e1e1=_0x119654[_0x1752('0x90')]({'plain':!![]});return db[_0x1752('0x91')][_0x1752('0x4d')]({'where':{'name':_0x1752('0x29'),'userProfileId':_0x162c61[_0x1752('0x92')]},'raw':!![]})[_0x1752('0x27')](function(_0x31c092){if(_0x31c092&&_0x31c092[_0x1752('0x93')]===0x0){return db[_0x1752('0x2a')][_0x1752('0x8c')]({'name':_0x43e1e1[_0x1752('0x34')],'resourceId':_0x43e1e1['id'],'type':_0x31c092[_0x1752('0x34')],'sectionId':_0x31c092['id']},{})[_0x1752('0x27')](function(){return _0x119654;});}else{return _0x119654;}})['catch'](function(_0x2334c2){logger[_0x1752('0x2b')](_0x1752('0x94'),_0x2334c2);throw _0x2334c2;});}return _0x119654;})[_0x1752('0x27')](respondWithResult(_0x44c20c,null))['catch'](handleError(_0x44c20c,null));}});}catch(_0x5ce1ea){_0x44c20c[_0x1752('0x1b')](0x1f4)[_0x1752('0x2d')](_0x5ce1ea);}};function removeReferences(_0xc97c70,_0x4986b6){try{if(_0xc97c70){fs['unlinkSync'](_0xc97c70);logger[_0x1752('0x61')](_0x1752('0x95'));}if(_0x4986b6){rimraf(_0x4986b6,function(){});logger[_0x1752('0x61')](_0x1752('0x96'));}}catch(_0x402b4c){logger[_0x1752('0x2b')](_0x402b4c);}}exports[_0x1752('0x26')]=function(_0x237e4b,_0x4d8233,_0x1ef3de){return db['Plugin'][_0x1752('0x4d')]({'where':{'id':_0x237e4b[_0x1752('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4d8233,null))['then'](saveUpdates(_0x237e4b['body'],null))[_0x1752('0x27')](respondWithResult(_0x4d8233,null))[_0x1752('0x49')](handleError(_0x4d8233,null));};exports[_0x1752('0x97')]=function(_0x3bafc1,_0x4ffb8d,_0x57038e){return db['Plugin'][_0x1752('0x4d')]({'where':{'id':_0x3bafc1[_0x1752('0x4b')]['id']}})[_0x1752('0x27')](function(_0x513e2a){if(_0x513e2a){return _0x513e2a['destroy']();}})[_0x1752('0x27')](function(_0xf3cbd2){rimraf(path['join'](config[_0x1752('0x50')],_0x1752('0x66'),path[_0x1752('0x98')](_0xf3cbd2['path'])),function(){});return _0xf3cbd2;})[_0x1752('0x27')](handleEntityNotFound(_0x4ffb8d,null))[_0x1752('0x27')](respondWithStatusCode(_0x4ffb8d,null))[_0x1752('0x49')](handleError(_0x4ffb8d,null));};exports[_0x1752('0x99')]=function(_0x56114d,_0x21db41,_0x60a26c){return BPromise[_0x1752('0x9a')]()[_0x1752('0x27')](function(){if(!_0x56114d[_0x1752('0x35')][_0x1752('0x4e')]){throw new Error(_0x1752('0x9b'));}if(!_0x56114d[_0x1752('0x35')]['port']){throw new Error(_0x1752('0x9c'));}var _0x433433=_0x56114d[_0x1752('0x35')]['hostname']?_0x56114d['query']['hostname']+':'+_0x56114d[_0x1752('0x35')][_0x1752('0x9d')]:'http://localhost:'+_0x56114d[_0x1752('0x35')][_0x1752('0x9d')];var _0x4dbcb8=_0x56114d[_0x1752('0x35')]['json']?_0x56114d[_0x1752('0x35')][_0x1752('0x9e')]:!![];var _0x1da5b7=_0x56114d['query']['encoding']?_0x56114d[_0x1752('0x35')][_0x1752('0x9f')]:null;var _0x471842={'method':_0x56114d[_0x1752('0xa0')],'uri':util['format'](_0x1752('0xa1'),_0x433433,_0x56114d[_0x1752('0x35')][_0x1752('0x4e')]),'json':_0x4dbcb8,'resolveWithFullResponse':!![],'encoding':_0x1da5b7,'qs':_0x56114d[_0x1752('0x35')]};if(_0x56114d[_0x1752('0xa2')]){_0x471842['headers']=_0x56114d[_0x1752('0xa2')];if(_0x471842[_0x1752('0xa2')][_0x1752('0xa3')]){delete _0x471842[_0x1752('0xa2')][_0x1752('0xa3')];}}if(_0x471842[_0x1752('0xa2')][_0x1752('0xa4')]){delete _0x471842[_0x1752('0xa2')][_0x1752('0xa4')];}return rp(_0x471842);})[_0x1752('0x27')](function(_0x5e84d8){if(_0x5e84d8){_0x21db41[_0x1752('0x21')](_0x5e84d8[_0x1752('0xa2')]);logger['info'](_0x5e84d8[_0x1752('0x8d')]);if(_[_0x1752('0xa5')](_0x56114d[_0x1752('0x35')][_0x1752('0x4e')],_0x1752('0x4c'))&&_0x5e84d8[_0x1752('0xa6')]==0x1f4){return _0x21db41[_0x1752('0x1a')](_0x5e84d8[_0x1752('0xa6')]);}else{return _0x21db41[_0x1752('0x1b')](_0x5e84d8['statusCode'])[_0x1752('0x2d')](_0x5e84d8[_0x1752('0x8d')]);}}else{return _0x21db41['sendStatus'](0xc8);}})[_0x1752('0x49')](handleError(_0x21db41,null));};exports[_0x1752('0xa7')]=function(_0x1c688c,_0x345c88,_0x4c44d5){return BPromise[_0x1752('0x9a')]()[_0x1752('0x27')](function(){if(!_0x1c688c['query']['path']){throw new Error(_0x1752('0x9b'));}if(!_0x1c688c[_0x1752('0x35')][_0x1752('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1aba8c=_0x1c688c[_0x1752('0x35')]['hostname']?_0x1c688c[_0x1752('0x35')][_0x1752('0xa8')]+':'+_0x1c688c['query'][_0x1752('0x9d')]:'http://localhost:'+_0x1c688c[_0x1752('0x35')][_0x1752('0x9d')];var _0x4376b4=_0x1c688c[_0x1752('0x35')][_0x1752('0x9e')]?_0x1c688c['query'][_0x1752('0x9e')]:!![];var _0x5c8b34=_0x1c688c['query'][_0x1752('0x9f')]?_0x1c688c[_0x1752('0x35')][_0x1752('0x9f')]:null;var _0x350e25={'method':_0x1c688c['method'],'uri':util['format']('%s%s',_0x1aba8c,_0x1c688c[_0x1752('0x35')][_0x1752('0x4e')]),'json':_0x4376b4,'resolveWithFullResponse':!![],'encoding':_0x5c8b34,'body':_0x1c688c[_0x1752('0x8d')]};if(_0x1c688c[_0x1752('0xa2')]){_0x350e25[_0x1752('0xa2')]=_0x1c688c[_0x1752('0xa2')];if(_0x350e25['headers']['content-length']){delete _0x350e25[_0x1752('0xa2')][_0x1752('0xa3')];}}if(_0x350e25['headers']['content-type']){delete _0x350e25[_0x1752('0xa2')][_0x1752('0xa4')];}return rp(_0x350e25);})['then'](function(_0x9ac9b3){if(_0x9ac9b3){_0x345c88[_0x1752('0x21')](_0x9ac9b3['headers']);logger[_0x1752('0x61')](_0x9ac9b3[_0x1752('0x8d')]);return _0x345c88[_0x1752('0x1b')](_0x9ac9b3['statusCode'])[_0x1752('0x2d')](_0x9ac9b3[_0x1752('0x8d')]);}else{return _0x345c88['sendStatus'](0xc8);}})[_0x1752('0x49')](handleError(_0x345c88,null));};
\ No newline at end of file
+var _0x2a96=['Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','dirname','node_modules/**/*','attachments/**/*','close','existsSync','download','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error'];(function(_0x3de754,_0x2c55ad){var _0x2df82d=function(_0x40562d){while(--_0x40562d){_0x3de754['push'](_0x3de754['shift']());}};_0x2df82d(++_0x2c55ad);}(_0x2a96,0xef));var _0x62a9=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x2a96[_0x10b48a];return _0x2c4533;};'use strict';var emlformat=require(_0x62a9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62a9('0x1'));var rp=require(_0x62a9('0x2'));var moment=require(_0x62a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x62a9('0x4'));var util=require(_0x62a9('0x5'));var path=require(_0x62a9('0x6'));var sox=require(_0x62a9('0x7'));var csv=require(_0x62a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62a9('0x9'));var _=require('lodash');var squel=require(_0x62a9('0xa'));var crypto=require(_0x62a9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62a9('0x8'));var querystring=require(_0x62a9('0xc'));var Papa=require(_0x62a9('0xd'));var extract=require(_0x62a9('0xe'));var rimraf=require(_0x62a9('0xf'));var archiver=require('archiver');var Redis=require(_0x62a9('0x10'));var authService=require(_0x62a9('0x11'));var qs=require(_0x62a9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62a9('0x13'));var logger=require(_0x62a9('0x14'))(_0x62a9('0x15'));var utils=require('../../config/utils');var config=require(_0x62a9('0x16'));var licenseUtil=require(_0x62a9('0x17'));var db=require('../../mysqldb')['db'];config[_0x62a9('0x18')]=_[_0x62a9('0x19')](config[_0x62a9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x62a9('0x1a'))(new Redis(config[_0x62a9('0x18')]));require(_0x62a9('0x1b'))[_0x62a9('0x1c')](socket);function respondWithStatusCode(_0x3c7f08,_0xa6453d){_0xa6453d=_0xa6453d||0xcc;return function(_0x5e4a42){if(_0x5e4a42){return _0x3c7f08[_0x62a9('0x1d')](_0xa6453d);}return _0x3c7f08[_0x62a9('0x1e')](_0xa6453d)['end']();};}function respondWithResult(_0x300c6f,_0x58b7b6){_0x58b7b6=_0x58b7b6||0xc8;return function(_0x32cdef){if(_0x32cdef){return _0x300c6f['status'](_0x58b7b6)['json'](_0x32cdef);}};}function respondWithFilteredResult(_0x3b6e71,_0x2ab714){return function(_0x56c27d){if(_0x56c27d){var _0x50e142=typeof _0x2ab714[_0x62a9('0x1f')]===_0x62a9('0x20')&&typeof _0x2ab714[_0x62a9('0x21')]===_0x62a9('0x20');var _0xac9c6c=_0x56c27d[_0x62a9('0x22')];var _0x336033=_0x50e142?0x0:_0x2ab714[_0x62a9('0x1f')];var _0x48170d=_0x50e142?_0x56c27d[_0x62a9('0x22')]:_0x2ab714[_0x62a9('0x1f')]+_0x2ab714[_0x62a9('0x21')];var _0x23ffcc;if(_0x48170d>=_0xac9c6c){_0x48170d=_0xac9c6c;_0x23ffcc=0xc8;}else{_0x23ffcc=0xce;}_0x3b6e71[_0x62a9('0x1e')](_0x23ffcc);return _0x3b6e71[_0x62a9('0x23')](_0x62a9('0x24'),_0x336033+'-'+_0x48170d+'/'+_0xac9c6c)[_0x62a9('0x25')](_0x56c27d);}return null;};}function patchUpdates(_0x319039){return function(_0x75c2d2){try{jsonpatch['apply'](_0x75c2d2,_0x319039,!![]);}catch(_0x3c8aa6){return BPromise[_0x62a9('0x26')](_0x3c8aa6);}return _0x75c2d2['save']();};}function saveUpdates(_0x3c0c62,_0x251e17){return function(_0x540290){if(_0x540290){return _0x540290['update'](_0x3c0c62)[_0x62a9('0x27')](function(_0x3ec322){return _0x3ec322;});}return null;};}function removeEntity(_0x2a52e6,_0x5562ab){return function(_0x4dd650){if(_0x4dd650){return _0x4dd650[_0x62a9('0x28')]()[_0x62a9('0x27')](function(){var _0x27efef=_0x4dd650[_0x62a9('0x29')]({'plain':!![]});var _0x30f891=_0x62a9('0x2a');return db[_0x62a9('0x2b')]['destroy']({'where':{'type':_0x30f891,'resourceId':_0x27efef['id']}})[_0x62a9('0x27')](function(){return _0x4dd650;});})['then'](function(){_0x2a52e6['status'](0xcc)[_0x62a9('0x2c')]();});}};}function handleEntityNotFound(_0x11e14a,_0x5a3e14){return function(_0x5425a0){if(!_0x5425a0){_0x11e14a[_0x62a9('0x1d')](0x194);}return _0x5425a0;};}function handleError(_0x1cfb53,_0x121912){_0x121912=_0x121912||0x1f4;return function(_0x459740){logger[_0x62a9('0x2d')](_0x459740[_0x62a9('0x2e')]);if(_0x459740[_0x62a9('0x2f')]){delete _0x459740[_0x62a9('0x2f')];}_0x1cfb53[_0x62a9('0x1e')](_0x121912)[_0x62a9('0x30')](_0x459740);};}exports['index']=function(_0x52f6b3,_0x501d95){var _0x2390f7={},_0x2a5659={},_0x51e9c4={'count':0x0,'rows':[]};var _0x37446a=_[_0x62a9('0x31')](db[_0x62a9('0x32')][_0x62a9('0x33')],function(_0x3f8c82){return{'name':_0x3f8c82[_0x62a9('0x34')],'type':_0x3f8c82[_0x62a9('0x35')]['key']};});_0x2a5659[_0x62a9('0x36')]=_['map'](_0x37446a,_0x62a9('0x2f'));_0x2a5659[_0x62a9('0x37')]=_['keys'](_0x52f6b3['query']);_0x2a5659[_0x62a9('0x38')]=_[_0x62a9('0x39')](_0x2a5659[_0x62a9('0x36')],_0x2a5659[_0x62a9('0x37')]);_0x2390f7[_0x62a9('0x3a')]=_[_0x62a9('0x39')](_0x2a5659[_0x62a9('0x36')],qs[_0x62a9('0x3b')](_0x52f6b3[_0x62a9('0x37')][_0x62a9('0x3b')]));_0x2390f7[_0x62a9('0x3a')]=_0x2390f7['attributes'][_0x62a9('0x3c')]?_0x2390f7[_0x62a9('0x3a')]:_0x2a5659[_0x62a9('0x36')];if(!_0x52f6b3[_0x62a9('0x37')][_0x62a9('0x3d')](_0x62a9('0x3e'))){_0x2390f7['limit']=qs['limit'](_0x52f6b3['query'][_0x62a9('0x21')]);_0x2390f7[_0x62a9('0x1f')]=qs[_0x62a9('0x1f')](_0x52f6b3[_0x62a9('0x37')][_0x62a9('0x1f')]);}_0x2390f7['order']=qs[_0x62a9('0x3f')](_0x52f6b3['query']['sort']);_0x2390f7[_0x62a9('0x40')]=qs['filters'](_['pick'](_0x52f6b3['query'],_0x2a5659[_0x62a9('0x38')]),_0x37446a);if(_0x52f6b3[_0x62a9('0x37')][_0x62a9('0x41')]){_0x2390f7[_0x62a9('0x40')]=_['merge'](_0x2390f7[_0x62a9('0x40')],{'$or':_[_0x62a9('0x31')](_0x37446a,function(_0x3fc439){if(_0x3fc439[_0x62a9('0x35')]!==_0x62a9('0x42')){var _0x3c5670={};_0x3c5670[_0x3fc439[_0x62a9('0x2f')]]={'$like':'%'+_0x52f6b3[_0x62a9('0x37')]['filter']+'%'};return _0x3c5670;}})});}_0x2390f7=_[_0x62a9('0x43')]({},_0x2390f7,_0x52f6b3[_0x62a9('0x44')]);var _0x2bb712={'where':_0x2390f7['where']};return db[_0x62a9('0x32')][_0x62a9('0x22')](_0x2bb712)[_0x62a9('0x27')](function(_0x3fb6ef){_0x51e9c4['count']=_0x3fb6ef;if(_0x52f6b3['query'][_0x62a9('0x45')]){_0x2390f7[_0x62a9('0x46')]=[{'all':!![]}];}return db[_0x62a9('0x32')][_0x62a9('0x47')](_0x2390f7);})[_0x62a9('0x27')](function(_0x1f2f0f){_0x51e9c4[_0x62a9('0x48')]=_0x1f2f0f;return _0x51e9c4;})[_0x62a9('0x27')](respondWithFilteredResult(_0x501d95,_0x2390f7))['catch'](handleError(_0x501d95,null));};exports[_0x62a9('0x49')]=function(_0x5c97e0,_0x1497a4){var _0x4f13e9={'raw':!![],'where':{'id':_0x5c97e0[_0x62a9('0x4a')]['id']}},_0x4dda1d={};_0x4dda1d[_0x62a9('0x36')]=_['keys'](db[_0x62a9('0x32')][_0x62a9('0x33')]);_0x4dda1d[_0x62a9('0x37')]=_[_0x62a9('0x4b')](_0x5c97e0[_0x62a9('0x37')]);_0x4dda1d[_0x62a9('0x38')]=_[_0x62a9('0x39')](_0x4dda1d[_0x62a9('0x36')],_0x4dda1d[_0x62a9('0x37')]);_0x4f13e9[_0x62a9('0x3a')]=_[_0x62a9('0x39')](_0x4dda1d[_0x62a9('0x36')],qs[_0x62a9('0x3b')](_0x5c97e0[_0x62a9('0x37')][_0x62a9('0x3b')]));_0x4f13e9[_0x62a9('0x3a')]=_0x4f13e9['attributes']['length']?_0x4f13e9[_0x62a9('0x3a')]:_0x4dda1d[_0x62a9('0x36')];if(_0x5c97e0[_0x62a9('0x37')][_0x62a9('0x45')]){_0x4f13e9[_0x62a9('0x46')]=[{'all':!![]}];}_0x4f13e9=_[_0x62a9('0x43')]({},_0x4f13e9,_0x5c97e0['options']);return db[_0x62a9('0x32')][_0x62a9('0x4c')](_0x4f13e9)[_0x62a9('0x27')](handleEntityNotFound(_0x1497a4,null))[_0x62a9('0x27')](respondWithResult(_0x1497a4,null))[_0x62a9('0x4d')](handleError(_0x1497a4,null));};exports['download']=function(_0x4a0b46,_0x28fed2,_0xfaf305){return db[_0x62a9('0x32')]['find']({'where':{'id':_0x4a0b46['params']['id']},'attributes':[_0x62a9('0x2f'),'path'],'raw':!![]})[_0x62a9('0x27')](handleEntityNotFound(_0x28fed2,null))['then'](function(_0x1dbb96){if(_0x1dbb96){var _0x17c865=path['join'](config[_0x62a9('0x4e')],'server/files/plugins',util[_0x62a9('0x4f')](_0x62a9('0x50'),path[_0x62a9('0x51')](_0x1dbb96[_0x62a9('0x6')])));var _0xddbc38=fs[_0x62a9('0x52')](_0x17c865);var _0x4349a=archiver(_0x62a9('0x53'),{'zlib':{'level':0x9}});_0x4349a['on'](_0x62a9('0x54'),function(_0x3dc5fb){if(_0x3dc5fb[_0x62a9('0x55')]===_0x62a9('0x56')){logger[_0x62a9('0x2d')](_0x3dc5fb);}else{throw new db[(_0x62a9('0x57'))][(_0x62a9('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4349a['on'](_0x62a9('0x2d'),function(_0x41b132){throw new db[(_0x62a9('0x57'))][(_0x62a9('0x58'))](_0x62a9('0x59'));});_0x4349a[_0x62a9('0x5a')](_0xddbc38);_0x4349a['glob'](_0x62a9('0x5b'),{'cwd':path[_0x62a9('0x5c')](config['root'],'server/files/plugins',path[_0x62a9('0x5d')](_0x1dbb96[_0x62a9('0x6')])),'ignore':[path[_0x62a9('0x5c')](path['basename'](_0x1dbb96[_0x62a9('0x6')]),_0x62a9('0x5e')),path[_0x62a9('0x5c')](path[_0x62a9('0x51')](_0x1dbb96['path']),_0x62a9('0x5f'))],'nodir':!![]})['finalize']();_0xddbc38['on'](_0x62a9('0x60'),function(){if(!fs[_0x62a9('0x61')](_0x17c865)){throw new db[(_0x62a9('0x57'))][(_0x62a9('0x58'))]('Plugin\x20not\x20found');}return _0x28fed2[_0x62a9('0x62')](_0x17c865,util[_0x62a9('0x4f')](_0x62a9('0x50'),path[_0x62a9('0x51')](_0x1dbb96[_0x62a9('0x6')])),function(_0xcfb462){if(_0xcfb462){throw new db[(_0x62a9('0x57'))][(_0x62a9('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x62a9('0x63')](_0x17c865);logger[_0x62a9('0x64')](_0x62a9('0x65'));logger[_0x62a9('0x64')](_0x62a9('0x66'));});});}return null;})['catch'](handleError(_0x28fed2,null));};exports['upload']=function(_0x48b462,_0x2f6016,_0xc6939e){var _0x44cde5=path[_0x62a9('0x51')](_0x48b462[_0x62a9('0x67')][_0x62a9('0x68')],path[_0x62a9('0x69')](_0x48b462[_0x62a9('0x67')]['filename']));var _0x56f9e1=path[_0x62a9('0x5c')](config['root'],_0x62a9('0x6a'),_0x48b462['file']['filename']);var _0x4861db=path['join'](config[_0x62a9('0x4e')],_0x62a9('0x6a'),_0x44cde5);logger['info'](_0x62a9('0x6b'),_0x56f9e1);logger['info'](_0x62a9('0x6c'),_0x4861db);try{fs['chmodSync'](_0x56f9e1,parseInt(_0x62a9('0x6d'),0x8));extract(_0x56f9e1,{'dir':_0x4861db},function(_0x16652){if(_0x16652){logger[_0x62a9('0x2d')](_0x16652);handleError(_0x16652,!![]);};var _0x554bcf=fs['readdirSync'](_0x4861db);if(_0x554bcf[_0x62a9('0x3c')]>0x1){removeReferences(_0x56f9e1,_0x4861db);logger[_0x62a9('0x2d')](_0x62a9('0x6e'));return _0xc6939e(new Error('Invalid\x20plugin\x20structure'));}var _0x312acb=fs[_0x62a9('0x6f')](path['join'](_0x4861db,_0x554bcf[0x0]));if(_0x312acb[_0x62a9('0x70')]()){removeReferences(_0x56f9e1,_0x4861db);logger[_0x62a9('0x2d')](_0x62a9('0x6e'));return _0xc6939e(new Error(_0x62a9('0x6e')));}if(_0x312acb['isDirectory']()){var _0x3037ad=fs[_0x62a9('0x71')](path[_0x62a9('0x5c')](_0x4861db,_0x554bcf[0x0]));if(_0x3037ad['length']===0x0){removeReferences(_0x56f9e1,_0x4861db);logger['error']('Invalid\x20plugin\x20structure');return _0xc6939e(new Error(_0x62a9('0x6e')));}var _0xb22c29=_0x3037ad[_0x62a9('0x72')](function(_0x2ed2ce){return _0x2ed2ce===_0x62a9('0x73');});if(!_0xb22c29){return _0xc6939e(new Error(_0x62a9('0x74')));}var _0x42b920=fs['readFileSync'](path[_0x62a9('0x5c')](_0x4861db,_0x554bcf[0x0],_0x62a9('0x73')));var _0x53c55f=JSON[_0x62a9('0x75')](_0x42b920);if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x2f')]){return _0xc6939e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x35')]){return _0xc6939e(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x76')]){return _0xc6939e(new Error(_0x62a9('0x77')));}if('undefined'==typeof _0x53c55f[_0x62a9('0x78')]){return _0xc6939e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x53c55f[_0x62a9('0x35')]===_0x62a9('0x79')){if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x78')][_0x62a9('0x7a')]){return _0xc6939e(new Error(_0x62a9('0x7b')));}if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x78')][_0x62a9('0x7a')][_0x62a9('0x7c')]&&_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x78')][_0x62a9('0x7a')]['agent']){return _0xc6939e(new Error(_0x62a9('0x7d')));}}else if(_0x53c55f[_0x62a9('0x35')]===_0x62a9('0x7e')){if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x78')]['scriptName']){return _0xc6939e(new Error(_0x62a9('0x7f')));}if(_0x62a9('0x20')==typeof _0x53c55f[_0x62a9('0x78')][_0x62a9('0x80')]){return _0xc6939e(new Error(_0x62a9('0x81')));}}else{return _0xc6939e(new Error(_0x62a9('0x82')));}var _0x156c30=_0x53c55f[_0x62a9('0x2f')];var _0x2c3f3e=_0x53c55f[_0x62a9('0x83')];var _0x2d0d40=_0x53c55f['type'];var _0x47c353=_0x53c55f[_0x62a9('0x84')]?_0x53c55f['sidebar']:'always';var _0x11e306=_0x53c55f[_0x62a9('0x85')]?_0x53c55f['icon']:'icon-apps';var _0x44f035='';var _0x56d95c='';var _0x2b2d2a='';var _0x17c5d9='';var _0x305102=_0x53c55f[_0x62a9('0x76')];if(_0x2d0d40===_0x62a9('0x79')){if(_0x62a9('0x20')!=typeof _0x53c55f['parameters']['views'][_0x62a9('0x7c')]){var _0x26f14d=_0x53c55f['parameters'][_0x62a9('0x7a')][_0x62a9('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x62a9('0x86')](_0x26f14d)){_0x44f035=path['join'](_0x62a9('0x87'),_0x44cde5,_0x554bcf[0x0],_0x26f14d);}else{_0x44f035=_0x26f14d;}}else{logger[_0x62a9('0x64')](_0x62a9('0x88'));}if(_0x62a9('0x20')!=typeof _0x53c55f['parameters'][_0x62a9('0x7a')][_0x62a9('0x89')]){var _0x382b71=_0x53c55f['parameters'][_0x62a9('0x7a')][_0x62a9('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x62a9('0x86')](_0x382b71)){_0x56d95c=path[_0x62a9('0x5c')]('plugins',_0x44cde5,_0x554bcf[0x0],_0x382b71);}else{_0x56d95c=_0x382b71;}}else{logger['info'](_0x62a9('0x8a'));}}else if(_0x2d0d40==='script'){_0x2b2d2a=_0x53c55f['parameters'][_0x62a9('0x8b')];_0x17c5d9=_0x53c55f[_0x62a9('0x78')]['scriptPath'];if(_0x62a9('0x20')!=typeof _0x53c55f['parameters'][_0x62a9('0x7a')]){if(_0x62a9('0x20')!=typeof _0x53c55f[_0x62a9('0x78')][_0x62a9('0x7a')][_0x62a9('0x7c')]){var _0x26f14d=_0x53c55f[_0x62a9('0x78')][_0x62a9('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x62a9('0x86')](_0x26f14d)){_0x44f035=path['join'](_0x62a9('0x87'),_0x44cde5,_0x554bcf[0x0],_0x26f14d);}else{_0x44f035=_0x26f14d;}}if(_0x62a9('0x20')!=typeof _0x53c55f[_0x62a9('0x78')]['views'][_0x62a9('0x89')]){var _0x382b71=_0x53c55f[_0x62a9('0x78')]['views'][_0x62a9('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x62a9('0x86')](_0x382b71)){_0x56d95c=path[_0x62a9('0x5c')]('plugins',_0x44cde5,_0x554bcf[0x0],_0x382b71);}else{_0x56d95c=_0x382b71;}}}}var _0x29fad4={'name':_0x156c30,'description':_0x2c3f3e,'path':path[_0x62a9('0x5c')](_0x44cde5,_0x554bcf[0x0]),'type':_0x2d0d40,'sidebar':_0x47c353,'icon':_0x11e306,'adminUrl':_0x44f035,'agentUrl':_0x56d95c,'scriptName':_0x2b2d2a,'scriptPath':_0x17c5d9,'version':_0x305102};removeReferences(_0x56f9e1,null);return db[_0x62a9('0x32')][_0x62a9('0x8c')](_0x29fad4)[_0x62a9('0x27')](function(_0x3bc624){var _0x39d717={'role':_0x48b462[_0x62a9('0x8d')][_0x62a9('0x8e')],'userProfileId':_0x48b462[_0x62a9('0x8d')][_0x62a9('0x8f')]};if(!_0x39d717)throw new Error(_0x62a9('0x90'));if(_0x39d717['role']===_0x62a9('0x91')){var _0x4a2446=_0x3bc624[_0x62a9('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x62a9('0x2a'),'userProfileId':_0x39d717[_0x62a9('0x8f')]},'raw':!![]})[_0x62a9('0x27')](function(_0x1e90ac){if(_0x1e90ac&&_0x1e90ac[_0x62a9('0x92')]===0x0){return db[_0x62a9('0x2b')][_0x62a9('0x8c')]({'name':_0x4a2446[_0x62a9('0x2f')],'resourceId':_0x4a2446['id'],'type':_0x1e90ac[_0x62a9('0x2f')],'sectionId':_0x1e90ac['id']},{})[_0x62a9('0x27')](function(){return _0x3bc624;});}else{return _0x3bc624;}})[_0x62a9('0x4d')](function(_0x2a74da){logger[_0x62a9('0x2d')](_0x62a9('0x93'),_0x2a74da);throw _0x2a74da;});}return _0x3bc624;})[_0x62a9('0x27')](respondWithResult(_0x2f6016,null))[_0x62a9('0x4d')](handleError(_0x2f6016,null));}});}catch(_0x4c6502){_0x2f6016[_0x62a9('0x1e')](0x1f4)[_0x62a9('0x30')](_0x4c6502);}};function removeReferences(_0x27dbe4,_0x21281d){try{if(_0x27dbe4){fs[_0x62a9('0x63')](_0x27dbe4);logger[_0x62a9('0x64')](_0x62a9('0x94'));}if(_0x21281d){rimraf(_0x21281d,function(){});logger[_0x62a9('0x64')](_0x62a9('0x95'));}}catch(_0x44b5b3){logger['error'](_0x44b5b3);}}exports[_0x62a9('0x96')]=function(_0x56ce23,_0x276eb3,_0x14e2b2){return db[_0x62a9('0x32')][_0x62a9('0x4c')]({'where':{'id':_0x56ce23['params']['id']}})[_0x62a9('0x27')](handleEntityNotFound(_0x276eb3,null))[_0x62a9('0x27')](saveUpdates(_0x56ce23[_0x62a9('0x8d')],null))[_0x62a9('0x27')](respondWithResult(_0x276eb3,null))['catch'](handleError(_0x276eb3,null));};exports['delete']=function(_0x4ab6a3,_0x117a82,_0x14ef98){return db[_0x62a9('0x32')][_0x62a9('0x4c')]({'where':{'id':_0x4ab6a3[_0x62a9('0x4a')]['id']}})[_0x62a9('0x27')](function(_0xb732e1){if(_0xb732e1){return _0xb732e1['destroy']();}})['then'](function(_0x468dec){rimraf(path['join'](config[_0x62a9('0x4e')],_0x62a9('0x6a'),path['dirname'](_0x468dec[_0x62a9('0x6')])),function(){});return _0x468dec;})['then'](handleEntityNotFound(_0x117a82,null))[_0x62a9('0x27')](respondWithStatusCode(_0x117a82,null))[_0x62a9('0x4d')](handleError(_0x117a82,null));};exports['webhookGet']=function(_0xae332d,_0x331e98,_0x52fdce){return BPromise[_0x62a9('0x97')]()[_0x62a9('0x27')](function(){if(!_0xae332d[_0x62a9('0x37')][_0x62a9('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xae332d[_0x62a9('0x37')][_0x62a9('0x98')]){throw new Error(_0x62a9('0x99'));}var _0x34b481=_0xae332d[_0x62a9('0x37')]['hostname']?_0xae332d['query'][_0x62a9('0x9a')]+':'+_0xae332d[_0x62a9('0x37')][_0x62a9('0x98')]:_0x62a9('0x9b')+_0xae332d[_0x62a9('0x37')][_0x62a9('0x98')];var _0x3cc702=_0xae332d['query']['json']?_0xae332d[_0x62a9('0x37')][_0x62a9('0x25')]:!![];var _0x54e1df=_0xae332d['query'][_0x62a9('0x9c')]?_0xae332d[_0x62a9('0x37')][_0x62a9('0x9c')]:null;var _0x47e95e={'method':_0xae332d[_0x62a9('0x9d')],'uri':util[_0x62a9('0x4f')](_0x62a9('0x9e'),_0x34b481,_0xae332d[_0x62a9('0x37')][_0x62a9('0x6')]),'json':_0x3cc702,'resolveWithFullResponse':!![],'encoding':_0x54e1df,'qs':_0xae332d[_0x62a9('0x37')]};if(_0xae332d[_0x62a9('0x9f')]){_0x47e95e[_0x62a9('0x9f')]=_0xae332d['headers'];if(_0x47e95e[_0x62a9('0x9f')][_0x62a9('0xa0')]){delete _0x47e95e[_0x62a9('0x9f')][_0x62a9('0xa0')];}}if(_0x47e95e[_0x62a9('0x9f')][_0x62a9('0xa1')]){delete _0x47e95e['headers'][_0x62a9('0xa1')];}return rp(_0x47e95e);})[_0x62a9('0x27')](function(_0x56acd6){if(_0x56acd6){_0x331e98[_0x62a9('0x23')](_0x56acd6['headers']);logger['info'](_0x56acd6[_0x62a9('0x8d')]);if(_[_0x62a9('0xa2')](_0xae332d[_0x62a9('0x37')][_0x62a9('0x6')],_0x62a9('0x62'))&&_0x56acd6[_0x62a9('0xa3')]==0x1f4){return _0x331e98['sendStatus'](_0x56acd6[_0x62a9('0xa3')]);}else{return _0x331e98[_0x62a9('0x1e')](_0x56acd6[_0x62a9('0xa3')])['send'](_0x56acd6[_0x62a9('0x8d')]);}}else{return _0x331e98['sendStatus'](0xc8);}})[_0x62a9('0x4d')](handleError(_0x331e98,null));};exports['webhookPost']=function(_0x1d4d6a,_0x247281,_0x1b4dbc){return BPromise['resolve']()[_0x62a9('0x27')](function(){if(!_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x98')]){throw new Error(_0x62a9('0x99'));}var _0x2cf72b=_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x9a')]?_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x9a')]+':'+_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x98')]:'http://localhost:'+_0x1d4d6a['query']['port'];var _0x5c4bdf=_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x25')]?_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x25')]:!![];var _0x2f0f4c=_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x9c')]?_0x1d4d6a['query'][_0x62a9('0x9c')]:null;var _0x62a289={'method':_0x1d4d6a[_0x62a9('0x9d')],'uri':util['format'](_0x62a9('0x9e'),_0x2cf72b,_0x1d4d6a[_0x62a9('0x37')][_0x62a9('0x6')]),'json':_0x5c4bdf,'resolveWithFullResponse':!![],'encoding':_0x2f0f4c,'body':_0x1d4d6a['body']};if(_0x1d4d6a[_0x62a9('0x9f')]){_0x62a289[_0x62a9('0x9f')]=_0x1d4d6a[_0x62a9('0x9f')];if(_0x62a289[_0x62a9('0x9f')][_0x62a9('0xa0')]){delete _0x62a289[_0x62a9('0x9f')][_0x62a9('0xa0')];}}if(_0x62a289['headers'][_0x62a9('0xa1')]){delete _0x62a289[_0x62a9('0x9f')][_0x62a9('0xa1')];}return rp(_0x62a289);})[_0x62a9('0x27')](function(_0x3bacf2){if(_0x3bacf2){_0x247281[_0x62a9('0x23')](_0x3bacf2[_0x62a9('0x9f')]);logger[_0x62a9('0x64')](_0x3bacf2['body']);return _0x247281[_0x62a9('0x1e')](_0x3bacf2[_0x62a9('0xa3')])[_0x62a9('0x30')](_0x3bacf2[_0x62a9('0x8d')]);}else{return _0x247281[_0x62a9('0x1d')](0xc8);}})['catch'](handleError(_0x247281,null));};
\ No newline at end of file
index de96a44..ddf4469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['hasOwnProperty','exports','events','../../mysqldb','Plugin','save','emit'];(function(_0x431cf2,_0x1d4456){var _0x10c9a7=function(_0x574efe){while(--_0x574efe){_0x431cf2['push'](_0x431cf2['shift']());}};_0x10c9a7(++_0x1d4456);}(_0x873a,0x1c2));var _0xa873=function(_0x2ae222,_0x4878ea){_0x2ae222=_0x2ae222-0x0;var _0x5873d5=_0x873a[_0x2ae222];return _0x5873d5;};'use strict';var EventEmitter=require(_0xa873('0x0'));var Plugin=require(_0xa873('0x1'))['db'][_0xa873('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa873('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x423a1a){return function(_0x46971d,_0x5a0d23,_0x3dc07e){PluginEvents[_0xa873('0x4')](_0x423a1a+':'+_0x46971d['id'],_0x46971d);PluginEvents['emit'](_0x423a1a,_0x46971d);_0x3dc07e(null);};}for(var e in events){if(events[_0xa873('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xa873('0x6')]=PluginEvents;
\ No newline at end of file
+var _0x6075=['hasOwnProperty','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6075,0x191));var _0x5607=function(_0x7acba9,_0x5e96d2){_0x7acba9=_0x7acba9-0x0;var _0x2b97bc=_0x6075[_0x7acba9];return _0x2b97bc;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5607('0x0'))['db'][_0x5607('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5607('0x2')](0x0);var events={'afterCreate':_0x5607('0x3'),'afterUpdate':_0x5607('0x4'),'afterDestroy':_0x5607('0x5')};function emitEvent(_0xf96316){return function(_0x100852,_0x2a1c03,_0x4d333d){PluginEvents[_0x5607('0x6')](_0xf96316+':'+_0x100852['id'],_0x100852);PluginEvents[_0x5607('0x6')](_0xf96316,_0x100852);_0x4d333d(null);};}for(var e in events){if(events[_0x5607('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 0a54ea4..dcb85e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x616a=['./plugin.attributes','define','Plugin','plugins','lodash','bluebird','request-promise','path','../../config/environment'];(function(_0xf529ba,_0x47f543){var _0xe7e86e=function(_0x14c828){while(--_0x14c828){_0xf529ba['push'](_0xf529ba['shift']());}};_0xe7e86e(++_0x47f543);}(_0x616a,0x175));var _0xa616=function(_0x2a7734,_0x5605b5){_0x2a7734=_0x2a7734-0x0;var _0x3002ab=_0x616a[_0x2a7734];return _0x3002ab;};'use strict';var _=require(_0xa616('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa616('0x1'));var rp=require(_0xa616('0x2'));var fs=require('fs');var path=require(_0xa616('0x3'));var rimraf=require('rimraf');var config=require(_0xa616('0x4'));var attributes=require(_0xa616('0x5'));module['exports']=function(_0x212ba5,_0x1be9bf){return _0x212ba5[_0xa616('0x6')](_0xa616('0x7'),attributes,{'tableName':_0xa616('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1b6=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x162dd8,_0x2b2b68){var _0x423a0e=function(_0x3c5dea){while(--_0x3c5dea){_0x162dd8['push'](_0x162dd8['shift']());}};_0x423a0e(++_0x2b2b68);}(_0xb1b6,0x9a));var _0x6b1b=function(_0x42444f,_0x221ed6){_0x42444f=_0x42444f-0x0;var _0x34bee3=_0xb1b6[_0x42444f];return _0x34bee3;};'use strict';var _=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var logger=require(_0x6b1b('0x2'))(_0x6b1b('0x3'));var moment=require(_0x6b1b('0x4'));var BPromise=require(_0x6b1b('0x5'));var rp=require(_0x6b1b('0x6'));var fs=require('fs');var path=require(_0x6b1b('0x7'));var rimraf=require(_0x6b1b('0x8'));var config=require(_0x6b1b('0x9'));var attributes=require(_0x6b1b('0xa'));module[_0x6b1b('0xb')]=function(_0x21a86f,_0xeaa103){return _0x21a86f[_0x6b1b('0xc')](_0x6b1b('0xd'),attributes,{'tableName':_0x6b1b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c882c57..5bc087f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x134d=['stringify','error','code','message','info','result','catch','create','body','options','raw','CreatePlugin','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x1e0534,_0x121382){var _0x1c4ff1=function(_0x18697b){while(--_0x18697b){_0x1e0534['push'](_0x1e0534['shift']());}};_0x1c4ff1(++_0x121382);}(_0x134d,0x16c));var _0xd134=function(_0x2b627a,_0x120446){_0x2b627a=_0x2b627a-0x0;var _0x14cd84=_0x134d[_0x2b627a];return _0x14cd84;};'use strict';var _=require(_0xd134('0x0'));var util=require(_0xd134('0x1'));var moment=require('moment');var BPromise=require(_0xd134('0x2'));var rs=require(_0xd134('0x3'));var fs=require('fs');var Redis=require(_0xd134('0x4'));var db=require(_0xd134('0x5'))['db'];var utils=require(_0xd134('0x6'));var logger=require(_0xd134('0x7'))('rpc');var config=require(_0xd134('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd134('0x9')]({'port':0x232a});config[_0xd134('0xa')]=_['defaults'](config[_0xd134('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd134('0xb'))(new Redis(config[_0xd134('0xa')]));require(_0xd134('0xc'))[_0xd134('0xd')](socket);function respondWithRpcPromise(_0x6b94b0,_0x593eb7,_0x4965fc){return new BPromise(function(_0x14196c,_0x20d7d3){return client[_0xd134('0xe')](_0x6b94b0,_0x4965fc)[_0xd134('0xf')](function(_0x3e8500){logger['info'](_0xd134('0x10'),_0x593eb7,_0xd134('0x11'));logger[_0xd134('0x12')](_0xd134('0x13'),_0x593eb7,_0xd134('0x11'),JSON[_0xd134('0x14')](_0x3e8500));if(_0x3e8500['error']){if(_0x3e8500[_0xd134('0x15')][_0xd134('0x16')]===0x1f4){logger['error'](_0xd134('0x10'),_0x593eb7,_0x3e8500[_0xd134('0x15')][_0xd134('0x17')]);return _0x20d7d3(_0x3e8500[_0xd134('0x15')][_0xd134('0x17')]);}logger[_0xd134('0x15')](_0xd134('0x10'),_0x593eb7,_0x3e8500[_0xd134('0x15')][_0xd134('0x17')]);return _0x14196c(_0x3e8500[_0xd134('0x15')][_0xd134('0x17')]);}else{logger[_0xd134('0x18')]('Plugin,\x20%s,\x20%s',_0x593eb7,_0xd134('0x11'));_0x14196c(_0x3e8500[_0xd134('0x19')][_0xd134('0x17')]);}})[_0xd134('0x1a')](function(_0x1befca){logger['error']('Plugin,\x20%s,\x20%s',_0x593eb7,_0x1befca);_0x20d7d3(_0x1befca);});});}exports['CreatePlugin']=function(_0x5cf659){var _0x4f3357=this;return new Promise(function(_0x22a3c7,_0x52e5e8){return db['Plugin'][_0xd134('0x1b')](_0x5cf659[_0xd134('0x1c')],{'raw':_0x5cf659[_0xd134('0x1d')]?_0x5cf659['options'][_0xd134('0x1e')]===undefined?!![]:![]:!![]})[_0xd134('0xf')](function(_0x54fee4){logger[_0xd134('0x18')](_0xd134('0x1f'),_0x5cf659);logger[_0xd134('0x12')](_0xd134('0x1f'),_0x5cf659,JSON[_0xd134('0x14')](_0x54fee4));_0x22a3c7(_0x54fee4);})[_0xd134('0x1a')](function(_0x346491){logger[_0xd134('0x15')](_0xd134('0x1f'),_0x346491[_0xd134('0x17')],_0x5cf659);_0x52e5e8(_0x4f3357[_0xd134('0x15')](0x1f4,_0x346491[_0xd134('0x17')]));});});};
\ No newline at end of file
+var _0xb870=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','Plugin','options','raw','then','CreatePlugin','debug','lodash','moment','bluebird','randomstring'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xb870,0x13c));var _0x0b87=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xb870[_0x35d3a8];return _0x182378;};'use strict';var _=require(_0x0b87('0x0'));var util=require('util');var moment=require(_0x0b87('0x1'));var BPromise=require(_0x0b87('0x2'));var rs=require(_0x0b87('0x3'));var fs=require('fs');var Redis=require(_0x0b87('0x4'));var db=require(_0x0b87('0x5'))['db'];var utils=require(_0x0b87('0x6'));var logger=require(_0x0b87('0x7'))(_0x0b87('0x8'));var config=require(_0x0b87('0x9'));var jayson=require(_0x0b87('0xa'));var client=jayson[_0x0b87('0xb')][_0x0b87('0xc')]({'port':0x232a});config[_0x0b87('0xd')]=_[_0x0b87('0xe')](config[_0x0b87('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b87('0xf'))(new Redis(config['redis']));require(_0x0b87('0x10'))['register'](socket);function respondWithRpcPromise(_0x368d1d,_0x4f4e0e,_0x4b0e4b){return new BPromise(function(_0x4e3760,_0x2f5311){return client[_0x0b87('0x11')](_0x368d1d,_0x4b0e4b)['then'](function(_0x4f8f98){logger[_0x0b87('0x12')](_0x0b87('0x13'),_0x4f4e0e,_0x0b87('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x4f4e0e,_0x0b87('0x14'),JSON[_0x0b87('0x15')](_0x4f8f98));if(_0x4f8f98[_0x0b87('0x16')]){if(_0x4f8f98[_0x0b87('0x16')]['code']===0x1f4){logger[_0x0b87('0x16')](_0x0b87('0x13'),_0x4f4e0e,_0x4f8f98[_0x0b87('0x16')][_0x0b87('0x17')]);return _0x2f5311(_0x4f8f98[_0x0b87('0x16')][_0x0b87('0x17')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x4f4e0e,_0x4f8f98['error'][_0x0b87('0x17')]);return _0x4e3760(_0x4f8f98['error'][_0x0b87('0x17')]);}else{logger[_0x0b87('0x12')](_0x0b87('0x13'),_0x4f4e0e,_0x0b87('0x14'));_0x4e3760(_0x4f8f98[_0x0b87('0x18')][_0x0b87('0x17')]);}})[_0x0b87('0x19')](function(_0x462f00){logger['error'](_0x0b87('0x13'),_0x4f4e0e,_0x462f00);_0x2f5311(_0x462f00);});});}exports['CreatePlugin']=function(_0x2b41d4){var _0x581f53=this;return new Promise(function(_0x10c520,_0x45bb9f){return db[_0x0b87('0x1a')]['create'](_0x2b41d4['body'],{'raw':_0x2b41d4[_0x0b87('0x1b')]?_0x2b41d4['options'][_0x0b87('0x1c')]===undefined?!![]:![]:!![]})[_0x0b87('0x1d')](function(_0x4613de){logger[_0x0b87('0x12')](_0x0b87('0x1e'),_0x2b41d4);logger[_0x0b87('0x1f')]('CreatePlugin',_0x2b41d4,JSON[_0x0b87('0x15')](_0x4613de));_0x10c520(_0x4613de);})[_0x0b87('0x19')](function(_0x3f8e9e){logger[_0x0b87('0x16')](_0x0b87('0x1e'),_0x3f8e9e[_0x0b87('0x17')],_0x2b41d4);_0x45bb9f(_0x581f53[_0x0b87('0x16')](0x1f4,_0x3f8e9e[_0x0b87('0x17')]));});});};
\ No newline at end of file
index fd528bc..00e6cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe439=['register','length','plugin:','./plugin.events','save','remove','emit','removeListener'];(function(_0x1dd6ce,_0x1fe3ae){var _0x5295f9=function(_0x4d8999){while(--_0x4d8999){_0x1dd6ce['push'](_0x1dd6ce['shift']());}};_0x5295f9(++_0x1fe3ae);}(_0xe439,0x1bb));var _0x9e43=function(_0x1c2cae,_0x27a031){_0x1c2cae=_0x1c2cae-0x0;var _0x1d8c8d=_0xe439[_0x1c2cae];return _0x1d8c8d;};'use strict';var PluginEvents=require(_0x9e43('0x0'));var events=[_0x9e43('0x1'),_0x9e43('0x2'),'update'];function createListener(_0x4c023b,_0x35c1e9){return function(_0x273bf8){_0x35c1e9[_0x9e43('0x3')](_0x4c023b,_0x273bf8);};}function removeListener(_0x213c8a,_0x351523){return function(){PluginEvents[_0x9e43('0x4')](_0x213c8a,_0x351523);};}exports[_0x9e43('0x5')]=function(_0x13ea17){for(var _0x24a4b=0x0,_0x1ad2cc=events[_0x9e43('0x6')];_0x24a4b<_0x1ad2cc;_0x24a4b++){var _0xfcaa25=events[_0x24a4b];var _0x2e7099=createListener(_0x9e43('0x7')+_0xfcaa25,_0x13ea17);PluginEvents['on'](_0xfcaa25,_0x2e7099);}};
\ No newline at end of file
+var _0xaa98=['remove','removeListener','register','plugin:','./plugin.events','save'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0xaa98,0x1a8));var _0x8aa9=function(_0x136efa,_0x5ba8e3){_0x136efa=_0x136efa-0x0;var _0x3c77dd=_0xaa98[_0x136efa];return _0x3c77dd;};'use strict';var PluginEvents=require(_0x8aa9('0x0'));var events=[_0x8aa9('0x1'),_0x8aa9('0x2'),'update'];function createListener(_0x450525,_0x19c8d6){return function(_0x224d2d){_0x19c8d6['emit'](_0x450525,_0x224d2d);};}function removeListener(_0xc420d,_0xf7ce1f){return function(){PluginEvents[_0x8aa9('0x3')](_0xc420d,_0xf7ce1f);};}exports[_0x8aa9('0x4')]=function(_0x58a9f8){for(var _0xac322f=0x0,_0x5d6a82=events['length'];_0xac322f<_0x5d6a82;_0xac322f++){var _0x3808b4=events[_0xac322f];var _0x1f4352=createListener(_0x8aa9('0x5')+_0x3808b4,_0x58a9f8);PluginEvents['on'](_0x3808b4,_0x1f4352);}};
\ No newline at end of file
index cf1cf8e..41288f7 100644 (file)
@@ -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(_0x567b64,_0x32ff3b){var _0x35c391=function(_0x3908c0){while(--_0x3908c0){_0x567b64['push'](_0x567b64['shift']());}};_0x35c391(++_0x32ff3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x2560fc,_0xbf695c){var _0x5c00cf=function(_0x5bd9d5){while(--_0x5bd9d5){_0x2560fc['push'](_0x2560fc['shift']());}};_0x5c00cf(++_0xbf695c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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
index fd71915..fc475b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['params','then','create','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','../../config/pm2','../../config/logger','child_process','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','reject','express','length','catch','show'];(function(_0x2a1205,_0x3b0898){var _0x3bce8c=function(_0xdab8ac){while(--_0xdab8ac){_0x2a1205['push'](_0x2a1205['shift']());}};_0x3bce8c(++_0x3b0898);}(_0xb821,0xa7));var _0x1b82=function(_0x1a30dd,_0x59a4a3){_0x1a30dd=_0x1a30dd-0x0;var _0x279db4=_0xb821[_0x1a30dd];return _0x279db4;};'use strict';var _=require('lodash');var pm2=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var path=require('path');var exec=require(_0x1b82('0x2'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x3b1d14,_0x1403ab){return function(_0x3fadf0){if(!_0x3fadf0){_0x3b1d14[_0x1b82('0x3')](0x194);;}return _0x3fadf0;};}function respondWithResult(_0x597ca7,_0x3e27c4){_0x3e27c4=_0x3e27c4||0xc8;return function(_0x192434){if(_0x192434){return _0x597ca7[_0x1b82('0x4')](_0x3e27c4)[_0x1b82('0x5')](_0x192434);}return null;};}function handleError(_0x18f45f,_0x7b87e8){_0x7b87e8=_0x7b87e8||0x1f4;return function(_0x161155){logger[_0x1b82('0x6')](_0x161155[_0x1b82('0x7')]);if(_0x161155['name']){delete _0x161155[_0x1b82('0x8')];}_0x18f45f[_0x1b82('0x4')](_0x7b87e8)[_0x1b82('0x9')](_0x161155);};}function execChildProcess(){return new BPromise(function(_0x14c57a,_0xcffb87){exec(_0x1b82('0xa'),function(_0x739f99,_0x1ce719,_0x5f521f){logger[_0x1b82('0xb')](_0x1ce719);logger[_0x1b82('0xb')](_0x5f521f);if(_0x739f99){logger[_0x1b82('0x6')](_0x739f99);return _0xcffb87(_0x739f99);}return _0x14c57a(_0x1ce719);});});}exports[_0x1b82('0xc')]=function(_0x50aed7,_0x1a6285){return pm2['list']()['then'](function(_0x1e553a){if(_0x1e553a){var _0x4bf75b=_[_0x1b82('0xd')](_0x1e553a,function(_0xe1d608){return _0xe1d608['name']===_0x1b82('0xe')||_0xe1d608['name']==='motion2';});return{'rows':_0x4bf75b,'count':_0x4bf75b[_0x1b82('0xf')]};}return null;})['then'](respondWithResult(_0x1a6285,null))[_0x1b82('0x10')](handleError(_0x1a6285,null));};exports[_0x1b82('0x11')]=function(_0xf42818,_0x4a09a2){return pm2['describe'](_0xf42818[_0x1b82('0x12')]['id'])['then'](respondWithResult(_0x4a09a2,null))[_0x1b82('0x13')](handleEntityNotFound(_0x4a09a2,null))[_0x1b82('0x10')](handleError(_0x4a09a2,null));};exports[_0x1b82('0x14')]=function(_0x594a63,_0x352426){if(_0x594a63[_0x1b82('0x15')][_0x1b82('0x8')]&&_0x594a63[_0x1b82('0x15')][_0x1b82('0x16')]){var _0x47e99b=path[_0x1b82('0x17')](__dirname,_0x1b82('0x18'),_0x594a63[_0x1b82('0x15')][_0x1b82('0x16')]);var _0x26e481=process[_0x1b82('0x19')]();process[_0x1b82('0x1a')](path['dirname'](_0x47e99b));return execChildProcess()[_0x1b82('0x13')](function(_0x233740){process['chdir'](_0x26e481);return pm2[_0x1b82('0x1b')]({'name':_0x594a63[_0x1b82('0x15')][_0x1b82('0x8')],'script':_0x47e99b});})['then'](function(_0x3a1226){pm2['dump']();return _0x3a1226[0x0];})['then'](respondWithResult(_0x352426,0xc9))['catch'](handleError(_0x352426,null));}else{return _0x352426[_0x1b82('0x4')](0x1f4)[_0x1b82('0x9')]({'message':_0x1b82('0x1c')});}};exports[_0x1b82('0x1d')]=function(_0x548a3b,_0x222483){if(_0x548a3b[_0x1b82('0x15')]['id']){delete _0x548a3b[_0x1b82('0x15')]['id'];}var _0x7455e8={'online':_0x1b82('0x1e'),'stopped':_0x1b82('0x1f')};if(_0x7455e8[_0x1b82('0x20')](_0x548a3b[_0x1b82('0x15')][_0x1b82('0x4')])){return pm2[_0x7455e8[_0x548a3b[_0x1b82('0x15')][_0x1b82('0x4')]]](_0x548a3b[_0x1b82('0x12')]['id'])[_0x1b82('0x13')](respondWithResult(_0x222483,0xc8))['catch'](handleError(_0x222483,null));}else{return _0x222483[_0x1b82('0x4')](0x1f4)[_0x1b82('0x9')]({'message':_0x1b82('0x21')});}};exports[_0x1b82('0x22')]=function(_0x18e4ff,_0x115ce7){if(_0x18e4ff[_0x1b82('0x15')]['id']){delete _0x18e4ff[_0x1b82('0x15')]['id'];}if(_0x18e4ff[_0x1b82('0x12')]['id']){return pm2[_0x1b82('0x23')](_0x18e4ff['params']['id'])[_0x1b82('0x13')](function(_0x29a31e){pm2[_0x1b82('0x24')]();return _0x29a31e[0x0];})[_0x1b82('0x13')](respondWithResult(_0x115ce7,null))['catch'](handleError(_0x115ce7,null));}else{return _0x115ce7[_0x1b82('0x4')](0x1f4)[_0x1b82('0x9')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0xe706=['dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','express','motion2','then','catch','params','create','body','script','join','../../files/plugins','cwd'];(function(_0xe3d2aa,_0x259646){var _0x25b038=function(_0x54bcc4){while(--_0x54bcc4){_0xe3d2aa['push'](_0xe3d2aa['shift']());}};_0x25b038(++_0x259646);}(_0xe706,0xa3));var _0x6e70=function(_0x4bf264,_0x3be730){_0x4bf264=_0x4bf264-0x0;var _0x3c855f=_0xe706[_0x4bf264];return _0x3c855f;};'use strict';var _=require(_0x6e70('0x0'));var pm2=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var path=require(_0x6e70('0x3'));var exec=require(_0x6e70('0x4'))[_0x6e70('0x5')];var BPromise=require(_0x6e70('0x6'));function handleEntityNotFound(_0x142c27,_0x2164a4){return function(_0x376a8d){if(!_0x376a8d){_0x142c27[_0x6e70('0x7')](0x194);;}return _0x376a8d;};}function respondWithResult(_0x1b0389,_0x4381d1){_0x4381d1=_0x4381d1||0xc8;return function(_0x36357b){if(_0x36357b){return _0x1b0389[_0x6e70('0x8')](_0x4381d1)[_0x6e70('0x9')](_0x36357b);}return null;};}function handleError(_0x188ed3,_0x3c4843){_0x3c4843=_0x3c4843||0x1f4;return function(_0x449b48){logger[_0x6e70('0xa')](_0x449b48[_0x6e70('0xb')]);if(_0x449b48[_0x6e70('0xc')]){delete _0x449b48[_0x6e70('0xc')];}_0x188ed3[_0x6e70('0x8')](_0x3c4843)[_0x6e70('0xd')](_0x449b48);};}function execChildProcess(){return new BPromise(function(_0x37b3e0,_0x4600f9){exec('npm\x20install',function(_0x47f6b2,_0x3594c1,_0x15a1a5){logger[_0x6e70('0xe')](_0x3594c1);logger[_0x6e70('0xe')](_0x15a1a5);if(_0x47f6b2){logger[_0x6e70('0xa')](_0x47f6b2);return _0x4600f9(_0x47f6b2);}return _0x37b3e0(_0x3594c1);});});}exports[_0x6e70('0xf')]=function(_0xa1eb74,_0x181005){return pm2['list']()['then'](function(_0x48bc72){if(_0x48bc72){var _0x257e81=_['reject'](_0x48bc72,function(_0x53aed0){return _0x53aed0[_0x6e70('0xc')]===_0x6e70('0x10')||_0x53aed0['name']===_0x6e70('0x11');});return{'rows':_0x257e81,'count':_0x257e81['length']};}return null;})[_0x6e70('0x12')](respondWithResult(_0x181005,null))[_0x6e70('0x13')](handleError(_0x181005,null));};exports['show']=function(_0x49029f,_0x3bd572){return pm2['describe'](_0x49029f[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x3bd572,null))['then'](handleEntityNotFound(_0x3bd572,null))['catch'](handleError(_0x3bd572,null));};exports[_0x6e70('0x15')]=function(_0x208e21,_0x2368eb){if(_0x208e21[_0x6e70('0x16')][_0x6e70('0xc')]&&_0x208e21[_0x6e70('0x16')][_0x6e70('0x17')]){var _0x44a49f=path[_0x6e70('0x18')](__dirname,_0x6e70('0x19'),_0x208e21['body'][_0x6e70('0x17')]);var _0x344b65=process[_0x6e70('0x1a')]();process['chdir'](path[_0x6e70('0x1b')](_0x44a49f));return execChildProcess()[_0x6e70('0x12')](function(_0x3337a6){process['chdir'](_0x344b65);return pm2[_0x6e70('0x1c')]({'name':_0x208e21['body']['name'],'script':_0x44a49f});})['then'](function(_0x41e352){pm2[_0x6e70('0x1d')]();return _0x41e352[0x0];})['then'](respondWithResult(_0x2368eb,0xc9))[_0x6e70('0x13')](handleError(_0x2368eb,null));}else{return _0x2368eb[_0x6e70('0x8')](0x1f4)['send']({'message':_0x6e70('0x1e')});}};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){if(_0x2bb231['body']['id']){delete _0x2bb231[_0x6e70('0x16')]['id'];}var _0x3af17f={'online':_0x6e70('0x20'),'stopped':_0x6e70('0x21')};if(_0x3af17f[_0x6e70('0x22')](_0x2bb231['body'][_0x6e70('0x8')])){return pm2[_0x3af17f[_0x2bb231[_0x6e70('0x16')][_0x6e70('0x8')]]](_0x2bb231[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x4a67ac,0xc8))[_0x6e70('0x13')](handleError(_0x4a67ac,null));}else{return _0x4a67ac[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':_0x6e70('0x23')});}};exports[_0x6e70('0x24')]=function(_0x4b1229,_0x1b27d8){if(_0x4b1229['body']['id']){delete _0x4b1229[_0x6e70('0x16')]['id'];}if(_0x4b1229['params']['id']){return pm2[_0x6e70('0x25')](_0x4b1229[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](function(_0x56f6f7){pm2[_0x6e70('0x1d')]();return _0x56f6f7[0x0];})[_0x6e70('0x12')](respondWithResult(_0x1b27d8,null))['catch'](handleError(_0x1b27d8,null));}else{return _0x1b27d8[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 6885c0a..505b694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3ac=['Router','../../components/auth/service','get','isAuthenticated','getAgents','/queues','getQueues','exports'];(function(_0x2bea63,_0x51329b){var _0x5ce033=function(_0x247c63){while(--_0x247c63){_0x2bea63['push'](_0x2bea63['shift']());}};_0x5ce033(++_0x51329b);}(_0xb3ac,0x1d8));var _0xcb3a=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xb3ac[_0x1147ab];return _0x55cb5a;};'use strict';var express=require('express');var router=express[_0xcb3a('0x0')]();var auth=require(_0xcb3a('0x1'));var controller=require('./realtime.controller');router[_0xcb3a('0x2')]('/agents',auth[_0xcb3a('0x3')](),controller[_0xcb3a('0x4')]);router['get'](_0xcb3a('0x5'),auth[_0xcb3a('0x3')](),controller[_0xcb3a('0x6')]);module[_0xcb3a('0x7')]=router;
\ No newline at end of file
+var _0x2beb=['isAuthenticated','get','/queues','getQueues','exports','Router','../../components/auth/service','/agents'];(function(_0x47105f,_0x4ccbcb){var _0x29a329=function(_0x4d3e48){while(--_0x4d3e48){_0x47105f['push'](_0x47105f['shift']());}};_0x29a329(++_0x4ccbcb);}(_0x2beb,0x1a5));var _0xb2be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2beb[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xb2be('0x0')]();var auth=require(_0xb2be('0x1'));var controller=require('./realtime.controller');router['get'](_0xb2be('0x2'),auth[_0xb2be('0x3')](),controller['getAgents']);router[_0xb2be('0x4')](_0xb2be('0x5'),auth[_0xb2be('0x3')](),controller[_0xb2be('0x6')]);module[_0xb2be('0x7')]=router;
\ No newline at end of file
index a0edff6..4b117d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde8b=['findAndCountAll','rows','getRealtimeQueues','catch','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','set','Content-Range','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','User','rawAttributes','fieldName','key','role','agent','online','raw','push','sequelize','literal','order','forEach','Pause','where','merge','user','userProfileId','Agents','getResources','map','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','fields','getQueues','format','startCase','Queue','name','voice','type','dialActive','dialMethod','getOptions','outbound','filter'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0xde8b,0x138));var _0xbde8=function(_0xb0726a,_0x151a13){_0xb0726a=_0xb0726a-0x0;var _0xd6ab02=_0xde8b[_0xb0726a];return _0xd6ab02;};'use strict';var _=require(_0xbde8('0x0'));var util=require(_0xbde8('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xbde8('0x2'));var qs=require(_0xbde8('0x3'));var utils=require(_0xbde8('0x4'));var db=require(_0xbde8('0x5'))['db'];var APIBadRequestError=require(_0xbde8('0x6'))[_0xbde8('0x7')];var APIHandleError=require(_0xbde8('0x6'))[_0xbde8('0x8')];function respondWithFilteredResult(_0x50cc7e,_0x50cff9){return function(_0x5170e0){if(_0x5170e0){var _0x302f6a=typeof _0x50cff9[_0xbde8('0x9')]===_0xbde8('0xa')&&typeof _0x50cff9[_0xbde8('0xb')]==='undefined';var _0x24051a=_0x5170e0[_0xbde8('0xc')];var _0x3df896=_0x302f6a?0x0:_0x50cff9[_0xbde8('0x9')];var _0x5912be=_0x302f6a?_0x5170e0[_0xbde8('0xc')]:_0x50cff9['offset']+_0x50cff9[_0xbde8('0xb')];var _0x36325e;if(_0x5912be>=_0x24051a){_0x5912be=_0x24051a;_0x36325e=0xc8;}else{_0x36325e=0xce;}_0x50cc7e['status'](_0x36325e);return _0x50cc7e[_0xbde8('0xd')](_0xbde8('0xe'),_0x3df896+'-'+_0x5912be+'/'+_0x24051a)['json'](_0x5170e0);}return null;};}exports[_0xbde8('0xf')]=function(_0x46b800,_0x916c91){var _0x57b574={'count':0x0,'rows':[]};var _0x417e92={};var _0xea4b75;var _0x34dd59=utils['getChannels']();var _0x10bb6e;var _0x38e677;var _0x5c914f=_0x46b800[_0xbde8('0x10')]['globalQueueFilter'];var _0x8891c5=_0x46b800['query'][_0xbde8('0x11')];var _0x2431b9=_0x46b800['query'][_0xbde8('0x12')];var _0x884154=_0x8891c5===_0xbde8('0x13')||_0x8891c5===_0xbde8('0x14')?!![]:![];var _0x25a6c7=[];var _0x2fa74f;var _0x9f1744;Promise[_0xbde8('0x15')]()[_0xbde8('0x16')](function(){if(_0x46b800[_0xbde8('0x10')][_0xbde8('0x17')]){if(!utils[_0xbde8('0x18')](_0x46b800[_0xbde8('0x10')][_0xbde8('0x17')])){throw new APIBadRequestError(util['format'](_0xbde8('0x19'),_0x46b800[_0xbde8('0x10')][_0xbde8('0x17')]));}_0xea4b75=_0x46b800[_0xbde8('0x10')][_0xbde8('0x17')][_0xbde8('0x1a')]();}if(!_0x46b800[_0xbde8('0x10')][_0xbde8('0x1b')]||!_0x46b800[_0xbde8('0x10')][_0xbde8('0x1b')][_0xbde8('0x1c')](_0xbde8('0x1d'))){_0x46b800[_0xbde8('0x10')]['sort']=rta[_0xbde8('0x1e')](_0x46b800[_0xbde8('0x10')][_0xbde8('0x1b')]);return;}var _0xbd3354=rta[_0xbde8('0x1f')](_0x46b800[_0xbde8('0x10')][_0xbde8('0x1b')]);_0x46b800[_0xbde8('0x10')][_0xbde8('0x1b')]=_0xbd3354['fields']['join'](',');_0x2fa74f=_0xbd3354['order'];})[_0xbde8('0x16')](function(){if(!_0x5c914f){return[];}return rta[_0xbde8('0x20')](_0x5c914f,_0xea4b75);})[_0xbde8('0x16')](function(_0x1caaaf){_0x25a6c7=_0x1caaaf;return rta[_0xbde8('0x21')]();})[_0xbde8('0x16')](function(_0xaa845){_0x38e677=_0xaa845['rows'];if((!_0x8891c5||_0x884154)&&!_0x2fa74f){return _0x25a6c7;}if(_0x2fa74f&&!_0x8891c5){return rta[_0xbde8('0x22')](_0x38e677,_0x25a6c7,_0x2fa74f);}else{return rta['getAgentIdsByStatus'](_0x38e677,_0x25a6c7,_0x8891c5);}})[_0xbde8('0x16')](function(_0x226813){_0x25a6c7=_0x226813;var _0x1f8616=![];if(_0x25a6c7['length']===0x0){if(_0x5c914f||_0x8891c5){_0x1f8616=!![];}if(_0x884154){_0x1f8616=![];}}if(_0x1f8616){return _0x57b574;}var _0xdcc4a7=_['map'](db[_0xbde8('0x23')][_0xbde8('0x24')],function(_0x3495cc){return{'name':_0x3495cc[_0xbde8('0x25')],'type':_0x3495cc['type'][_0xbde8('0x26')]};});_0x46b800[_0xbde8('0x10')][_0xbde8('0x27')]=_0xbde8('0x28');_0x46b800[_0xbde8('0x10')][_0xbde8('0x29')]=!![];_0x417e92=qs['getOptions'](_0xdcc4a7,_0x46b800);_0x417e92[_0xbde8('0x2a')]=!![];var _0x3090ed=[];if(_0x25a6c7['length']>0x0){_0x3090ed[_0xbde8('0x2b')]({'id':{'$in':_0x25a6c7}});if(_0x2fa74f&&!_0x8891c5){_0x9f1744=[db[_0xbde8('0x2c')][_0xbde8('0x2d')]('FIELD(id,'+_0x25a6c7+')')];_0x417e92[_0xbde8('0x2e')]=_0x9f1744;}}if(_0x884154){_0x34dd59[_0xbde8('0x2f')](function(_0x45791a){var _0x39a365=!![];if(_0x8891c5==='*pause'&&_0xea4b75!==_0x45791a){_0x39a365=![];}_0x3090ed[_0xbde8('0x2b')]({[_0x45791a+_0xbde8('0x30')]:_0x39a365});});if(_0x2431b9){_0x3090ed['push']({'pauseType':_0x2431b9});}}else if(_0x8891c5){_0x34dd59[_0xbde8('0x2f')](function(_0x4146c4){_0x3090ed['push']({[_0x4146c4+_0xbde8('0x30')]:![]});});}_0x417e92[_0xbde8('0x31')]=_[_0xbde8('0x32')](_0x417e92[_0xbde8('0x31')],{'$and':_0x3090ed});if(_0x46b800[_0xbde8('0x33')][_0xbde8('0x27')]==='user'){var _0x225f74={'params':{'id':_0x46b800[_0xbde8('0x33')][_0xbde8('0x34')]},'query':{'section':_0xbde8('0x35'),'role':_0xbde8('0x28'),'online':!![],'raw':!![],'ids':_0x25a6c7,'customSorting':_0x9f1744}};if(_0x884154){_0x225f74[_0xbde8('0x10')]['extraQueryConditions']=_0x3090ed;}_0x225f74[_0xbde8('0x10')]=Object['assign'](_0x225f74[_0xbde8('0x10')],_0x46b800[_0xbde8('0x10')]);delete _0x225f74[_0xbde8('0x10')]['id'];return db['UserProfile'][_0xbde8('0x36')](_0x225f74);}return db[_0xbde8('0x23')]['findAndCountAll'](_0x417e92);})[_0xbde8('0x16')](function(_0x37a25a){_0x57b574[_0xbde8('0xc')]=_0x37a25a[_0xbde8('0xc')];_0x10bb6e=_0x37a25a['rows'];return _0x10bb6e[_0xbde8('0x37')](function(_0x15f9cc){var _0x39730a=_['find'](_0x38e677,['id',_0x15f9cc['id']]);if(_0x39730a){var _0x36411e=rta[_0xbde8('0x38')](_0x39730a);_[_0xbde8('0x32')](_0x15f9cc,_0x36411e);}_0x15f9cc[_0xbde8('0x1d')]=rta[_0xbde8('0x39')](_0x15f9cc);if(_0x15f9cc[_0xbde8('0x1d')][_0xbde8('0x1c')]('pause')){_0x34dd59['forEach'](function(_0xe3837c){if(_0x15f9cc[_0xe3837c+_0xbde8('0x30')]){_0x15f9cc[_0xe3837c+_0xbde8('0x3a')]=_0xbde8('0x13');}});}return _0x15f9cc;});})['then'](function(_0xe8d611){if(!_0x2fa74f||_0x9f1744){return _0xe8d611;}return rta[_0xbde8('0x3b')](_0xe8d611,_0x2fa74f);})[_0xbde8('0x16')](function(_0x3439fd){var _0xdb9de=null;if(_0x46b800[_0xbde8('0x10')][_0xbde8('0x3c')]){var _0x107e95=_0x46b800[_0xbde8('0x10')][_0xbde8('0x3c')]['split'](',');_0xdb9de=_0x3439fd[_0xbde8('0x37')](function(_0x1df1ad){return _['pick'](_0x1df1ad,_0x107e95);});}_0x57b574['rows']=_0xdb9de||_0x3439fd;return _0x57b574;})[_0xbde8('0x16')](respondWithFilteredResult(_0x916c91,_0x417e92))['catch'](APIHandleError(_0x916c91));};exports[_0xbde8('0x3d')]=function(_0x1d6d6a,_0x3d54f4){var _0x2111d6={'count':0x0,'rows':[]};var _0x5e8dcd={};var _0x2cefc1;var _0x5a869a;var _0x1582be;Promise[_0xbde8('0x15')]()[_0xbde8('0x16')](function(){if(_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x17')]){if(!utils[_0xbde8('0x18')](_0x1d6d6a[_0xbde8('0x10')]['channel'])){throw new APIBadRequestError(util[_0xbde8('0x3e')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x17')]));}_0x2cefc1=_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x17')]['toLowerCase']();}var _0xc107ac=_[_0xbde8('0x3f')](_0x2cefc1)+_0xbde8('0x40');var _0x39ecc8=_[_0xbde8('0x37')](db[_0xc107ac][_0xbde8('0x24')],function(_0xca0006){return{'name':_0xca0006['fieldName'],'type':_0xca0006['type'][_0xbde8('0x26')]};});if(!_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x3c')]){var _0x4dd5c7=['id',_0xbde8('0x41')];if(_0x2cefc1===_0xbde8('0x42')){_0x4dd5c7[_0xbde8('0x2b')]('type');if(_0x1d6d6a['query'][_0xbde8('0x43')]==='outbound'){_0x4dd5c7[_0xbde8('0x2b')]([_0xbde8('0x44'),_0xbde8('0x45')]);}}_0x1d6d6a['query'][_0xbde8('0x3c')]=_0x4dd5c7['join'](',');}_0x5e8dcd=qs[_0xbde8('0x46')](_0x39ecc8,_0x1d6d6a);if(_0x1d6d6a['user'][_0xbde8('0x27')]==='user'){var _0x38fe79={'params':{'id':_0x1d6d6a['user'][_0xbde8('0x34')]},'query':{'section':_0x2cefc1===_0xbde8('0x42')&&_0x1d6d6a[_0xbde8('0x10')]['type']===_0xbde8('0x47')?'QueueCampaigns':_[_0xbde8('0x3f')](_0x2cefc1)+'Queues','type':_0x1d6d6a[_0xbde8('0x10')]['type'],'nolimit':!![],'sort':_0xbde8('0x41'),'filter':_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x48')]}};return db['UserProfile'][_0xbde8('0x36')](_0x38fe79);}return db[_0xc107ac][_0xbde8('0x49')](_0x5e8dcd);})[_0xbde8('0x16')](function(_0x27d7aa){_0x2111d6[_0xbde8('0xc')]=_0x27d7aa[_0xbde8('0xc')];_0x5a869a=_0x27d7aa[_0xbde8('0x4a')];return rtq[_0xbde8('0x4b')](_0x1d6d6a,_0x2cefc1);})[_0xbde8('0x16')](function(_0x241d3e){_0x1582be=_0x241d3e[_0xbde8('0x4a')];return rtq['initializeQueues'](_0x5a869a,_0x1582be,_0x2cefc1,_0x1d6d6a[_0xbde8('0x10')][_0xbde8('0x43')]);})['then'](function(_0x2a4c91){_0x2111d6[_0xbde8('0x4a')]=_0x2a4c91;return _0x2111d6;})[_0xbde8('0x16')](respondWithFilteredResult(_0x3d54f4,_0x5e8dcd))[_0xbde8('0x4c')](APIHandleError(_0x3d54f4));};
\ No newline at end of file
+var _0xbe22=['agent','online','getOptions','raw','sequelize','FIELD(id,','forEach','push','Pause','user','userProfileId','assign','UserProfile','getResources','User','findAndCountAll','find','merge','globalStatus','getAgentStatus','sortAgentsByStatus','fields','split','pick','catch','getQueues','toLowerCase','startCase','fieldName','name','voice','outbound','dialActive','dialMethod','join','QueueCampaigns','filter','lodash','util','../../components/realtime/queues','../../mysqldb','../../errors/api','offset','undefined','count','limit','status','json','getChannels','query','pauseTypeFilter','pause','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','validateSortParameter','getUpdatedSortOptions','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','type','key','role'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xbe22,0x1e7));var _0x2be2=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0xbe22[_0x20a137];return _0x3dc414;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x2be2('0x2'));var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0x2be2('0x3'))['db'];var APIBadRequestError=require(_0x2be2('0x4'))['APIBadRequestError'];var APIHandleError=require(_0x2be2('0x4'))['handleError'];function respondWithFilteredResult(_0x2419f5,_0x8f7a65){return function(_0xc16a1a){if(_0xc16a1a){var _0x44aaec=typeof _0x8f7a65[_0x2be2('0x5')]===_0x2be2('0x6')&&typeof _0x8f7a65['limit']==='undefined';var _0x2fc425=_0xc16a1a['count'];var _0x599fe4=_0x44aaec?0x0:_0x8f7a65[_0x2be2('0x5')];var _0x553a21=_0x44aaec?_0xc16a1a[_0x2be2('0x7')]:_0x8f7a65['offset']+_0x8f7a65[_0x2be2('0x8')];var _0x526f9f;if(_0x553a21>=_0x2fc425){_0x553a21=_0x2fc425;_0x526f9f=0xc8;}else{_0x526f9f=0xce;}_0x2419f5[_0x2be2('0x9')](_0x526f9f);return _0x2419f5['set']('Content-Range',_0x599fe4+'-'+_0x553a21+'/'+_0x2fc425)[_0x2be2('0xa')](_0xc16a1a);}return null;};}exports['getAgents']=function(_0x3769ad,_0x320587){var _0x2354fa={'count':0x0,'rows':[]};var _0x172190={};var _0x3891e2;var _0x1beea1=utils[_0x2be2('0xb')]();var _0x32e2f1;var _0x30204c;var _0x211be2=_0x3769ad[_0x2be2('0xc')]['globalQueueFilter'];var _0xdeaf6f=_0x3769ad[_0x2be2('0xc')]['globalStatusFilter'];var _0x495790=_0x3769ad[_0x2be2('0xc')][_0x2be2('0xd')];var _0x39720f=_0xdeaf6f===_0x2be2('0xe')||_0xdeaf6f===_0x2be2('0xf')?!![]:![];var _0x2b0885=[];var _0x28b940;var _0x40e045;Promise[_0x2be2('0x10')]()['then'](function(){if(_0x3769ad[_0x2be2('0xc')][_0x2be2('0x11')]){if(!utils[_0x2be2('0x12')](_0x3769ad[_0x2be2('0xc')][_0x2be2('0x11')])){throw new APIBadRequestError(util[_0x2be2('0x13')](_0x2be2('0x14'),_0x3769ad[_0x2be2('0xc')]['channel']));}_0x3891e2=_0x3769ad['query'][_0x2be2('0x11')]['toLowerCase']();}if(!_0x3769ad['query'][_0x2be2('0x15')]||!_0x3769ad[_0x2be2('0xc')][_0x2be2('0x15')][_0x2be2('0x16')]('globalStatus')){_0x3769ad[_0x2be2('0xc')][_0x2be2('0x15')]=rta[_0x2be2('0x17')](_0x3769ad[_0x2be2('0xc')][_0x2be2('0x15')]);return;}var _0x300ea7=rta[_0x2be2('0x18')](_0x3769ad[_0x2be2('0xc')][_0x2be2('0x15')]);_0x3769ad[_0x2be2('0xc')][_0x2be2('0x15')]=_0x300ea7['fields']['join'](',');_0x28b940=_0x300ea7[_0x2be2('0x19')];})[_0x2be2('0x1a')](function(){if(!_0x211be2){return[];}return rta[_0x2be2('0x1b')](_0x211be2,_0x3891e2);})[_0x2be2('0x1a')](function(_0x39f282){_0x2b0885=_0x39f282;return rta[_0x2be2('0x1c')]();})[_0x2be2('0x1a')](function(_0x42749f){_0x30204c=_0x42749f[_0x2be2('0x1d')];if((!_0xdeaf6f||_0x39720f)&&!_0x28b940){return _0x2b0885;}if(_0x28b940&&!_0xdeaf6f){return rta[_0x2be2('0x1e')](_0x30204c,_0x2b0885,_0x28b940);}else{return rta[_0x2be2('0x1f')](_0x30204c,_0x2b0885,_0xdeaf6f);}})['then'](function(_0x255747){_0x2b0885=_0x255747;var _0x4ae407=![];if(_0x2b0885[_0x2be2('0x20')]===0x0){if(_0x211be2||_0xdeaf6f){_0x4ae407=!![];}if(_0x39720f){_0x4ae407=![];}}if(_0x4ae407){return _0x2354fa;}var _0x3c9c70=_[_0x2be2('0x21')](db['User'][_0x2be2('0x22')],function(_0x410ea3){return{'name':_0x410ea3['fieldName'],'type':_0x410ea3[_0x2be2('0x23')][_0x2be2('0x24')]};});_0x3769ad[_0x2be2('0xc')][_0x2be2('0x25')]=_0x2be2('0x26');_0x3769ad[_0x2be2('0xc')][_0x2be2('0x27')]=!![];_0x172190=qs[_0x2be2('0x28')](_0x3c9c70,_0x3769ad);_0x172190[_0x2be2('0x29')]=!![];var _0x392be4=[];if(_0x2b0885[_0x2be2('0x20')]>0x0){_0x392be4['push']({'id':{'$in':_0x2b0885}});if(_0x28b940&&!_0xdeaf6f){_0x40e045=[db[_0x2be2('0x2a')]['literal'](_0x2be2('0x2b')+_0x2b0885+')')];_0x172190[_0x2be2('0x19')]=_0x40e045;}}if(_0x39720f){_0x1beea1[_0x2be2('0x2c')](function(_0x4a9265){var _0x2a27db=!![];if(_0xdeaf6f==='*pause'&&_0x3891e2!==_0x4a9265){_0x2a27db=![];}_0x392be4[_0x2be2('0x2d')]({[_0x4a9265+_0x2be2('0x2e')]:_0x2a27db});});if(_0x495790){_0x392be4[_0x2be2('0x2d')]({'pauseType':_0x495790});}}else if(_0xdeaf6f){_0x1beea1[_0x2be2('0x2c')](function(_0x485df4){_0x392be4[_0x2be2('0x2d')]({[_0x485df4+_0x2be2('0x2e')]:![]});});}_0x172190['where']=_['merge'](_0x172190['where'],{'$and':_0x392be4});if(_0x3769ad[_0x2be2('0x2f')][_0x2be2('0x25')]===_0x2be2('0x2f')){var _0x38a43f={'params':{'id':_0x3769ad[_0x2be2('0x2f')][_0x2be2('0x30')]},'query':{'section':'Agents','role':_0x2be2('0x26'),'online':!![],'raw':!![],'ids':_0x2b0885,'customSorting':_0x40e045}};if(_0x39720f){_0x38a43f[_0x2be2('0xc')]['extraQueryConditions']=_0x392be4;}_0x38a43f[_0x2be2('0xc')]=Object[_0x2be2('0x31')](_0x38a43f[_0x2be2('0xc')],_0x3769ad[_0x2be2('0xc')]);delete _0x38a43f[_0x2be2('0xc')]['id'];return db[_0x2be2('0x32')][_0x2be2('0x33')](_0x38a43f);}return db[_0x2be2('0x34')][_0x2be2('0x35')](_0x172190);})['then'](function(_0x577931){_0x2354fa[_0x2be2('0x7')]=_0x577931[_0x2be2('0x7')];_0x32e2f1=_0x577931['rows'];return _0x32e2f1[_0x2be2('0x21')](function(_0x2ac551){var _0x4c0ed7=_[_0x2be2('0x36')](_0x30204c,['id',_0x2ac551['id']]);if(_0x4c0ed7){var _0x18b946=rta['filterAgentAttributes'](_0x4c0ed7);_[_0x2be2('0x37')](_0x2ac551,_0x18b946);}_0x2ac551[_0x2be2('0x38')]=rta[_0x2be2('0x39')](_0x2ac551);if(_0x2ac551['globalStatus']['includes'](_0x2be2('0xe'))){_0x1beea1[_0x2be2('0x2c')](function(_0x16303a){if(_0x2ac551[_0x16303a+_0x2be2('0x2e')]){_0x2ac551[_0x16303a+'Status']=_0x2be2('0xe');}});}return _0x2ac551;});})[_0x2be2('0x1a')](function(_0x142183){if(!_0x28b940||_0x40e045){return _0x142183;}return rta[_0x2be2('0x3a')](_0x142183,_0x28b940);})['then'](function(_0x16347e){var _0x15bd3a=null;if(_0x3769ad[_0x2be2('0xc')]['fields']){var _0x3d4d10=_0x3769ad[_0x2be2('0xc')][_0x2be2('0x3b')][_0x2be2('0x3c')](',');_0x15bd3a=_0x16347e[_0x2be2('0x21')](function(_0x54f519){return _[_0x2be2('0x3d')](_0x54f519,_0x3d4d10);});}_0x2354fa[_0x2be2('0x1d')]=_0x15bd3a||_0x16347e;return _0x2354fa;})['then'](respondWithFilteredResult(_0x320587,_0x172190))[_0x2be2('0x3e')](APIHandleError(_0x320587));};exports[_0x2be2('0x3f')]=function(_0x5c0ca2,_0x3778a6){var _0x58ba76={'count':0x0,'rows':[]};var _0x51c317={};var _0x8491e3;var _0x5c731b;var _0x1e587f;Promise['resolve']()[_0x2be2('0x1a')](function(){if(_0x5c0ca2['query'][_0x2be2('0x11')]){if(!utils[_0x2be2('0x12')](_0x5c0ca2['query'][_0x2be2('0x11')])){throw new APIBadRequestError(util['format'](_0x2be2('0x14'),_0x5c0ca2[_0x2be2('0xc')][_0x2be2('0x11')]));}_0x8491e3=_0x5c0ca2['query'][_0x2be2('0x11')][_0x2be2('0x40')]();}var _0x2012a3=_[_0x2be2('0x41')](_0x8491e3)+'Queue';var _0x5aeabd=_[_0x2be2('0x21')](db[_0x2012a3]['rawAttributes'],function(_0x48acf9){return{'name':_0x48acf9[_0x2be2('0x42')],'type':_0x48acf9[_0x2be2('0x23')][_0x2be2('0x24')]};});if(!_0x5c0ca2[_0x2be2('0xc')][_0x2be2('0x3b')]){var _0x113449=['id',_0x2be2('0x43')];if(_0x8491e3===_0x2be2('0x44')){_0x113449[_0x2be2('0x2d')]('type');if(_0x5c0ca2[_0x2be2('0xc')][_0x2be2('0x23')]===_0x2be2('0x45')){_0x113449[_0x2be2('0x2d')]([_0x2be2('0x46'),_0x2be2('0x47')]);}}_0x5c0ca2[_0x2be2('0xc')]['fields']=_0x113449[_0x2be2('0x48')](',');}_0x51c317=qs[_0x2be2('0x28')](_0x5aeabd,_0x5c0ca2);if(_0x5c0ca2[_0x2be2('0x2f')][_0x2be2('0x25')]===_0x2be2('0x2f')){var _0x335825={'params':{'id':_0x5c0ca2[_0x2be2('0x2f')][_0x2be2('0x30')]},'query':{'section':_0x8491e3===_0x2be2('0x44')&&_0x5c0ca2['query'][_0x2be2('0x23')]===_0x2be2('0x45')?_0x2be2('0x49'):_[_0x2be2('0x41')](_0x8491e3)+'Queues','type':_0x5c0ca2[_0x2be2('0xc')][_0x2be2('0x23')],'nolimit':!![],'sort':_0x2be2('0x43'),'filter':_0x5c0ca2[_0x2be2('0xc')][_0x2be2('0x4a')]}};return db[_0x2be2('0x32')][_0x2be2('0x33')](_0x335825);}return db[_0x2012a3][_0x2be2('0x35')](_0x51c317);})[_0x2be2('0x1a')](function(_0x1b9c46){_0x58ba76[_0x2be2('0x7')]=_0x1b9c46[_0x2be2('0x7')];_0x5c731b=_0x1b9c46[_0x2be2('0x1d')];return rtq['getRealtimeQueues'](_0x5c0ca2,_0x8491e3);})['then'](function(_0x512a36){_0x1e587f=_0x512a36['rows'];return rtq['initializeQueues'](_0x5c731b,_0x1e587f,_0x8491e3,_0x5c0ca2['query'][_0x2be2('0x23')]);})[_0x2be2('0x1a')](function(_0xdcbe18){_0x58ba76[_0x2be2('0x1d')]=_0xdcbe18;return _0x58ba76;})[_0x2be2('0x1a')](respondWithFilteredResult(_0x3778a6,_0x51c317))['catch'](APIHandleError(_0x3778a6));};
\ No newline at end of file
index 00e9ee5..5e17adf 100644 (file)
@@ -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(_0x20e48d,_0xae597){var _0x2c6b6e=function(_0x5cd0ee){while(--_0x5cd0ee){_0x20e48d['push'](_0x20e48d['shift']());}};_0x2c6b6e(++_0xae597);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xcb91[_0x4067ac];return _0x53d74d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x30133d,_0x4321bc){var _0x319f3b=function(_0x372416){while(--_0x372416){_0x30133d['push'](_0x30133d['shift']());}};_0x319f3b(++_0x4321bc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0xcb91[_0x219d87];return _0x22823d;};'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
index a5d224a..ba295c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x287e=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x4192bd,_0x15d8b8){var _0x53159e=function(_0x27c7ff){while(--_0x27c7ff){_0x4192bd['push'](_0x4192bd['shift']());}};_0x53159e(++_0x15d8b8);}(_0x287e,0x1e3));var _0xe287=function(_0x2f7c5a,_0x568cde){_0x2f7c5a=_0x2f7c5a-0x0;var _0x3cad89=_0x287e[_0x2f7c5a];return _0x3cad89;};'use strict';var Sequelize=require(_0xe287('0x0'));module[_0xe287('0x1')]={'state':{'type':Sequelize[_0xe287('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe287('0x3')]},'scheduledat':{'type':Sequelize[_0xe287('0x4')]},'uniqueid':{'type':Sequelize[_0xe287('0x3')]},'starttime':{'type':Sequelize[_0xe287('0x4')]},'responsetime':{'type':Sequelize[_0xe287('0x4')]},'ringtime':{'type':Sequelize[_0xe287('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe287('0x3')]},'membername':{'type':Sequelize[_0xe287('0x3')]}};
\ No newline at end of file
+var _0xc492=['exports','INTEGER','STRING','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc492,0xd7));var _0x2c49=function(_0x17a072,_0x135a7d){_0x17a072=_0x17a072-0x0;var _0x542496=_0xc492[_0x17a072];return _0x542496;};'use strict';var Sequelize=require(_0x2c49('0x0'));module[_0x2c49('0x1')]={'state':{'type':Sequelize[_0x2c49('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x2c49('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2c49('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x2c49('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2c49('0x3')]}};
\ No newline at end of file
index dd9c8e0..1196f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eaa=['rimraf','../../config/environment','exports','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4e945c,_0x17e6f2){var _0x22959f=function(_0xcebec3){while(--_0xcebec3){_0x4e945c['push'](_0x4e945c['shift']());}};_0x22959f(++_0x17e6f2);}(_0x8eaa,0x165));var _0xa8ea=function(_0x1d4670,_0x545409){_0x1d4670=_0x1d4670-0x0;var _0xf9005c=_0x8eaa[_0x1d4670];return _0xf9005c;};'use strict';var _=require(_0xa8ea('0x0'));var util=require(_0xa8ea('0x1'));var logger=require('../../config/logger')(_0xa8ea('0x2'));var moment=require(_0xa8ea('0x3'));var BPromise=require(_0xa8ea('0x4'));var rp=require(_0xa8ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8ea('0x6'));var config=require(_0xa8ea('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xa8ea('0x8')]=function(_0x8acf89,_0x185689){return _0x8acf89['define'](_0xa8ea('0x9'),attributes,{'tableName':_0xa8ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0479=['report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x0479,0x146));var _0x9047=function(_0x13489b,_0x12094f){_0x13489b=_0x13489b-0x0;var _0x49bc2e=_0x0479[_0x13489b];return _0x49bc2e;};'use strict';var _=require(_0x9047('0x0'));var util=require(_0x9047('0x1'));var logger=require(_0x9047('0x2'))(_0x9047('0x3'));var moment=require(_0x9047('0x4'));var BPromise=require('bluebird');var rp=require(_0x9047('0x5'));var fs=require('fs');var path=require(_0x9047('0x6'));var rimraf=require(_0x9047('0x7'));var config=require(_0x9047('0x8'));var attributes=require(_0x9047('0x9'));module[_0x9047('0xa')]=function(_0x1b563c,_0xf046e2){return _0x1b563c['define'](_0x9047('0xb'),attributes,{'tableName':_0x9047('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c2e0d37..727f3a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a91=['error','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x576b31,_0x4d074d){var _0x6e5a1c=function(_0x26995e){while(--_0x26995e){_0x576b31['push'](_0x576b31['shift']());}};_0x6e5a1c(++_0x4d074d);}(_0x0a91,0x140));var _0x10a9=function(_0x4edd73,_0x31c9f4){_0x4edd73=_0x4edd73-0x0;var _0x60a855=_0x0a91[_0x4edd73];return _0x60a855;};'use strict';var _=require(_0x10a9('0x0'));var util=require(_0x10a9('0x1'));var moment=require('moment');var BPromise=require(_0x10a9('0x2'));var rs=require(_0x10a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a9('0x4'))['db'];var utils=require(_0x10a9('0x5'));var logger=require(_0x10a9('0x6'))('rpc');var config=require(_0x10a9('0x7'));var jayson=require(_0x10a9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10c9c5,_0x2b0886,_0x53b04c){return new BPromise(function(_0x11eb8b,_0x42e641){return client['request'](_0x10c9c5,_0x53b04c)[_0x10a9('0x9')](function(_0x3d6902){logger[_0x10a9('0xa')](_0x10a9('0xb'),_0x2b0886,'request\x20sent');logger[_0x10a9('0xc')](_0x10a9('0xd'),_0x2b0886,_0x10a9('0xe'),JSON[_0x10a9('0xf')](_0x3d6902));if(_0x3d6902[_0x10a9('0x10')]){if(_0x3d6902[_0x10a9('0x10')]['code']===0x1f4){logger[_0x10a9('0x10')](_0x10a9('0xb'),_0x2b0886,_0x3d6902[_0x10a9('0x10')]['message']);return _0x42e641(_0x3d6902[_0x10a9('0x10')]['message']);}logger['error'](_0x10a9('0xb'),_0x2b0886,_0x3d6902[_0x10a9('0x10')][_0x10a9('0x11')]);return _0x11eb8b(_0x3d6902[_0x10a9('0x10')][_0x10a9('0x11')]);}else{logger['info'](_0x10a9('0xb'),_0x2b0886,_0x10a9('0xe'));_0x11eb8b(_0x3d6902['result']['message']);}})[_0x10a9('0x12')](function(_0x474379){logger[_0x10a9('0x10')](_0x10a9('0xb'),_0x2b0886,_0x474379);_0x42e641(_0x474379);});});}exports[_0x10a9('0x13')]=function(_0x14cd10){var _0x2aede8=this;return new Promise(function(_0x7f2eca,_0x5e4333){return db[_0x10a9('0x14')][_0x10a9('0x15')](_0x14cd10['body'],{'raw':_0x14cd10[_0x10a9('0x16')]?_0x14cd10[_0x10a9('0x16')][_0x10a9('0x17')]===undefined?!![]:![]:!![]})[_0x10a9('0x9')](function(_0xf10408){logger['info']('CreateReportAgentPreview',_0x14cd10);logger[_0x10a9('0xc')]('CreateReportAgentPreview',_0x14cd10,JSON[_0x10a9('0xf')](_0xf10408));_0x7f2eca(_0xf10408);})[_0x10a9('0x12')](function(_0x37c0de){logger[_0x10a9('0x10')](_0x10a9('0x13'),_0x37c0de[_0x10a9('0x11')],_0x14cd10);_0x5e4333(_0x2aede8[_0x10a9('0x10')](0x1f4,_0x37c0de['message']));});});};
\ No newline at end of file
+var _0x2fa3=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch'];(function(_0x3f5244,_0x559a04){var _0x58f221=function(_0x5e9f2d){while(--_0x5e9f2d){_0x3f5244['push'](_0x3f5244['shift']());}};_0x58f221(++_0x559a04);}(_0x2fa3,0x7f));var _0x32fa=function(_0x4eee7e,_0x5c9be4){_0x4eee7e=_0x4eee7e-0x0;var _0x21367e=_0x2fa3[_0x4eee7e];return _0x21367e;};'use strict';var _=require(_0x32fa('0x0'));var util=require(_0x32fa('0x1'));var moment=require(_0x32fa('0x2'));var BPromise=require(_0x32fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32fa('0x4'));var db=require(_0x32fa('0x5'))['db'];var utils=require(_0x32fa('0x6'));var logger=require(_0x32fa('0x7'))('rpc');var config=require(_0x32fa('0x8'));var jayson=require(_0x32fa('0x9'));var client=jayson['client'][_0x32fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2605f4,_0x5106b2,_0x346e84){return new BPromise(function(_0x26c94f,_0x27bf73){return client[_0x32fa('0xb')](_0x2605f4,_0x346e84)[_0x32fa('0xc')](function(_0x1e2ccc){logger[_0x32fa('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5106b2,_0x32fa('0xe'));logger[_0x32fa('0xf')](_0x32fa('0x10'),_0x5106b2,_0x32fa('0xe'),JSON['stringify'](_0x1e2ccc));if(_0x1e2ccc[_0x32fa('0x11')]){if(_0x1e2ccc['error'][_0x32fa('0x12')]===0x1f4){logger[_0x32fa('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x5106b2,_0x1e2ccc['error']['message']);return _0x27bf73(_0x1e2ccc['error']['message']);}logger[_0x32fa('0x11')](_0x32fa('0x13'),_0x5106b2,_0x1e2ccc[_0x32fa('0x11')][_0x32fa('0x14')]);return _0x26c94f(_0x1e2ccc[_0x32fa('0x11')]['message']);}else{logger[_0x32fa('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5106b2,_0x32fa('0xe'));_0x26c94f(_0x1e2ccc[_0x32fa('0x15')]['message']);}})[_0x32fa('0x16')](function(_0x483426){logger[_0x32fa('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x5106b2,_0x483426);_0x27bf73(_0x483426);});});}exports[_0x32fa('0x17')]=function(_0x303ff5){var _0x49cb24=this;return new Promise(function(_0xfd9738,_0x461a13){return db[_0x32fa('0x18')][_0x32fa('0x19')](_0x303ff5[_0x32fa('0x1a')],{'raw':_0x303ff5[_0x32fa('0x1b')]?_0x303ff5['options'][_0x32fa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x545c30){logger[_0x32fa('0xd')]('CreateReportAgentPreview',_0x303ff5);logger[_0x32fa('0xf')](_0x32fa('0x17'),_0x303ff5,JSON[_0x32fa('0x1d')](_0x545c30));_0xfd9738(_0x545c30);})['catch'](function(_0x32508d){logger[_0x32fa('0x11')](_0x32fa('0x17'),_0x32508d['message'],_0x303ff5);_0x461a13(_0x49cb24[_0x32fa('0x11')](0x1f4,_0x32508d['message']));});});};
\ No newline at end of file
index 949ee3d..8a3c1e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fd=['chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','queueNotify'];(function(_0x3cb2f1,_0x314ce2){var _0x199d63=function(_0x33bc63){while(--_0x33bc63){_0x3cb2f1['push'](_0x3cb2f1['shift']());}};_0x199d63(++_0x314ce2);}(_0xa4fd,0x142));var _0xda4f=function(_0x342839,_0x401f80){_0x342839=_0x342839-0x0;var _0x550466=_0xa4fd[_0x342839];return _0x550466;};'use strict';var multer=require(_0xda4f('0x0'));var util=require('util');var path=require('path');var express=require(_0xda4f('0x1'));var router=express[_0xda4f('0x2')]();var auth=require(_0xda4f('0x3'));var controller=require(_0xda4f('0x4'));router[_0xda4f('0x5')](_0xda4f('0x6'),auth[_0xda4f('0x7')](),controller['voiceChannels']);router[_0xda4f('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xda4f('0x7')](),controller['voiceChannelMixMonitor']);router[_0xda4f('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xda4f('0x7')](),controller[_0xda4f('0x8')]);router[_0xda4f('0x5')](_0xda4f('0x9'),auth[_0xda4f('0x7')](),controller[_0xda4f('0xa')]);router[_0xda4f('0x5')](_0xda4f('0xb'),auth[_0xda4f('0x7')](),controller[_0xda4f('0xc')]);router[_0xda4f('0x5')]('/mail/queues',auth[_0xda4f('0x7')](),controller[_0xda4f('0xd')]);router[_0xda4f('0x5')](_0xda4f('0xe'),auth[_0xda4f('0x7')](),controller[_0xda4f('0xf')]);router[_0xda4f('0x5')]('/openchannel/queues',auth[_0xda4f('0x7')](),controller['openchannelQueues']);router[_0xda4f('0x5')](_0xda4f('0x10'),auth[_0xda4f('0x7')](),controller['smsQueues']);router['get'](_0xda4f('0x11'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x12')]);router[_0xda4f('0x5')](_0xda4f('0x13'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x14')]);router[_0xda4f('0x5')](_0xda4f('0x15'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x16')]);router[_0xda4f('0x5')](_0xda4f('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xda4f('0x5')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xda4f('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router['get'](_0xda4f('0x18'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x19')]);router[_0xda4f('0x5')](_0xda4f('0x1a'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x1b')]);router['put'](_0xda4f('0x1a'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x1c')]);router[_0xda4f('0x5')](_0xda4f('0x1d'),auth[_0xda4f('0x7')](),controller['outbound']);router[_0xda4f('0x5')](_0xda4f('0x1e'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0xda4f('0x1f'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x20')]);router['put'](_0xda4f('0x21'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x22')]);router[_0xda4f('0x5')](_0xda4f('0x23'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x24')]);router[_0xda4f('0x5')](_0xda4f('0x25'),auth['isAuthenticated'](),controller['trunks']);router[_0xda4f('0x5')](_0xda4f('0x26'),auth[_0xda4f('0x7')](),controller['campaigns']);router[_0xda4f('0x5')](_0xda4f('0x27'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x28')]);router[_0xda4f('0x5')](_0xda4f('0x29'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x2a')]);router[_0xda4f('0x5')](_0xda4f('0x2b'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x2c')]);router[_0xda4f('0x5')](_0xda4f('0x2d'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xda4f('0x5')](_0xda4f('0x2e'),auth[_0xda4f('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xda4f('0x5')]('/sms/queues/waitinginteractions',auth[_0xda4f('0x7')](),controller[_0xda4f('0x2f')]);router[_0xda4f('0x5')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xda4f('0x30')]);router['get'](_0xda4f('0x31'),auth['isAuthenticated'](),controller[_0xda4f('0x32')]);router['post'](_0xda4f('0x33'),auth[_0xda4f('0x7')](),controller['queueNotify'](_0xda4f('0x34')));router[_0xda4f('0x5')](_0xda4f('0x35'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x36')]);router[_0xda4f('0x37')](_0xda4f('0x38'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x39')](_0xda4f('0x3a')));router[_0xda4f('0x5')](_0xda4f('0x3b'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x3c')]);router[_0xda4f('0x37')](_0xda4f('0x3d'),auth['isAuthenticated'](),controller[_0xda4f('0x39')](_0xda4f('0x3e')));router[_0xda4f('0x5')](_0xda4f('0x3f'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x40')]);router[_0xda4f('0x37')](_0xda4f('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0xda4f('0x42')));router[_0xda4f('0x5')](_0xda4f('0x43'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x44')]);router[_0xda4f('0x37')]('/sms/queues/:id/notify',auth[_0xda4f('0x7')](),controller[_0xda4f('0x39')]('sms'));router[_0xda4f('0x37')](_0xda4f('0x45'),auth[_0xda4f('0x7')](),controller['queueNotify']('whatsapp'));router[_0xda4f('0x5')](_0xda4f('0x46'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x47')]);router[_0xda4f('0x5')]('/whatsapp/queues/:id',auth[_0xda4f('0x7')](),controller[_0xda4f('0x48')]);router[_0xda4f('0x37')](_0xda4f('0x49'),auth[_0xda4f('0x7')](),controller[_0xda4f('0x4a')]);module[_0xda4f('0x4b')]=router;
\ No newline at end of file
+var _0xc445=['post','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/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','agentNotify','exports','multer','util','path','Router','../../components/auth/service','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues'];(function(_0xa74e4c,_0x152094){var _0x5aceaa=function(_0x1ae205){while(--_0x1ae205){_0xa74e4c['push'](_0xa74e4c['shift']());}};_0x5aceaa(++_0x152094);}(_0xc445,0x120));var _0x5c44=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xc445[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x5c44('0x0'));var util=require(_0x5c44('0x1'));var path=require(_0x5c44('0x2'));var express=require('express');var router=express[_0x5c44('0x3')]();var auth=require(_0x5c44('0x4'));var controller=require('./rpc.controller');router[_0x5c44('0x5')](_0x5c44('0x6'),auth['isAuthenticated'](),controller[_0x5c44('0x7')]);router[_0x5c44('0x5')](_0x5c44('0x8'),auth[_0x5c44('0x9')](),controller[_0x5c44('0xa')]);router[_0x5c44('0x5')](_0x5c44('0xb'),auth[_0x5c44('0x9')](),controller[_0x5c44('0xc')]);router[_0x5c44('0x5')](_0x5c44('0xd'),auth['isAuthenticated'](),controller[_0x5c44('0xe')]);router['get'](_0x5c44('0xf'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x10')]);router['get'](_0x5c44('0x11'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x12')]);router[_0x5c44('0x5')](_0x5c44('0x13'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x14')]);router[_0x5c44('0x5')](_0x5c44('0x15'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x16')]);router[_0x5c44('0x5')](_0x5c44('0x17'),auth['isAuthenticated'](),controller[_0x5c44('0x18')]);router['get'](_0x5c44('0x19'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x1a')]);router[_0x5c44('0x5')](_0x5c44('0x1b'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x1c')]);router['get'](_0x5c44('0x1d'),auth[_0x5c44('0x9')](),controller['voiceQueuesPreview']);router[_0x5c44('0x5')](_0x5c44('0x1e'),auth['isAuthenticated'](),controller[_0x5c44('0x1f')]);router[_0x5c44('0x5')](_0x5c44('0x20'),auth['isAuthenticated'](),controller[_0x5c44('0x21')]);router['get'](_0x5c44('0x22'),auth[_0x5c44('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x5c44('0x5')](_0x5c44('0x23'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x24')]);router[_0x5c44('0x5')](_0x5c44('0x25'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x26')]);router[_0x5c44('0x27')](_0x5c44('0x25'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x28')]);router[_0x5c44('0x5')]('/outbound',auth['isAuthenticated'](),controller[_0x5c44('0x29')]);router['get'](_0x5c44('0x2a'),auth['isAuthenticated'](),controller[_0x5c44('0x2b')]);router[_0x5c44('0x5')]('/agents',auth['isAuthenticated'](),controller[_0x5c44('0x2c')]);router[_0x5c44('0x27')](_0x5c44('0x2d'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x2e')]);router[_0x5c44('0x5')](_0x5c44('0x2f'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x30')]);router[_0x5c44('0x5')]('/trunks',auth[_0x5c44('0x9')](),controller[_0x5c44('0x31')]);router['get'](_0x5c44('0x32'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x33')]);router[_0x5c44('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x5c44('0x5')](_0x5c44('0x34'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x35')]);router[_0x5c44('0x5')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5c44('0x36')]);router[_0x5c44('0x5')](_0x5c44('0x37'),auth['isAuthenticated'](),controller[_0x5c44('0x38')]);router['get'](_0x5c44('0x39'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x3a')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5c44('0x3b')]);router[_0x5c44('0x5')](_0x5c44('0x3c'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x3d')]);router[_0x5c44('0x5')](_0x5c44('0x3e'),auth['isAuthenticated'](),controller[_0x5c44('0x3f')]);router['post'](_0x5c44('0x40'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x41')](_0x5c44('0x42')));router[_0x5c44('0x5')](_0x5c44('0x43'),auth['isAuthenticated'](),controller['showMailQueues']);router['post'](_0x5c44('0x44'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x41')](_0x5c44('0x45')));router[_0x5c44('0x5')](_0x5c44('0x46'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x47')]);router[_0x5c44('0x48')](_0x5c44('0x49'),auth['isAuthenticated'](),controller[_0x5c44('0x41')]('fax'));router[_0x5c44('0x5')](_0x5c44('0x4a'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x4b')]);router['post'](_0x5c44('0x4c'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x41')]('openchannel'));router[_0x5c44('0x5')](_0x5c44('0x4d'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x4e')]);router['post'](_0x5c44('0x4f'),auth['isAuthenticated'](),controller[_0x5c44('0x41')](_0x5c44('0x50')));router[_0x5c44('0x48')](_0x5c44('0x51'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x41')](_0x5c44('0x52')));router[_0x5c44('0x5')](_0x5c44('0x53'),auth['isAuthenticated'](),controller[_0x5c44('0x54')]);router[_0x5c44('0x5')](_0x5c44('0x55'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x56')]);router['post'](_0x5c44('0x57'),auth[_0x5c44('0x9')](),controller[_0x5c44('0x58')]);module[_0x5c44('0x59')]=router;
\ No newline at end of file
index 12c60e5..182fd8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xed1f,0x6a));var _0xfed1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xed1f[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));};
\ No newline at end of file
+var _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x33c5,0xe6));var _0x533c=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x33c5[_0x25bea7];return _0x175952;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));};
\ No newline at end of file
index 7d2939d..4d94897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','/:id/run','run','post','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x336d54,_0x4cb876){var _0x571a8d=function(_0x3746f6){while(--_0x3746f6){_0x336d54['push'](_0x336d54['shift']());}};_0x571a8d(++_0x4cb876);}(_0x58e8,0xb2));var _0x858e=function(_0x468b15,_0x3a11c1){_0x468b15=_0x468b15-0x0;var _0x31f5ad=_0x58e8[_0x468b15];return _0x31f5ad;};'use strict';var multer=require('multer');var util=require(_0x858e('0x0'));var path=require('path');var timeout=require(_0x858e('0x1'));var express=require('express');var router=express[_0x858e('0x2')]();var fs_extra=require(_0x858e('0x3'));var auth=require(_0x858e('0x4'));var interaction=require(_0x858e('0x5'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0x858e('0x6')](),controller['index']);router[_0x858e('0x7')](_0x858e('0x8'),auth[_0x858e('0x6')](),controller['show']);router[_0x858e('0x7')](_0x858e('0x9'),auth['isAuthenticated'](),controller[_0x858e('0xa')]);router[_0x858e('0xb')]('/',auth[_0x858e('0x6')](),controller[_0x858e('0xc')]);router[_0x858e('0xd')]('/:id',auth[_0x858e('0x6')](),controller[_0x858e('0xe')]);router[_0x858e('0xf')](_0x858e('0x8'),auth[_0x858e('0x6')](),controller[_0x858e('0x10')]);module[_0x858e('0x11')]=router;
\ No newline at end of file
+var _0x84a5=['../../components/interaction/service','./schedule.controller','get','isAuthenticated','show','/:id/run','run','post','create','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4f40a1,_0x31c662){var _0x4f88d3=function(_0x53e32d){while(--_0x53e32d){_0x4f40a1['push'](_0x4f40a1['shift']());}};_0x4f88d3(++_0x31c662);}(_0x84a5,0x1af));var _0x584a=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x84a5[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0x584a('0x0'));var path=require(_0x584a('0x1'));var timeout=require(_0x584a('0x2'));var express=require(_0x584a('0x3'));var router=express[_0x584a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x584a('0x5'));var interaction=require(_0x584a('0x6'));var config=require('../../config/environment');var controller=require(_0x584a('0x7'));router[_0x584a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x584a('0x8')]('/:id',auth[_0x584a('0x9')](),controller[_0x584a('0xa')]);router['get'](_0x584a('0xb'),auth[_0x584a('0x9')](),controller[_0x584a('0xc')]);router[_0x584a('0xd')]('/',auth[_0x584a('0x9')](),controller[_0x584a('0xe')]);router['put'](_0x584a('0xf'),auth['isAuthenticated'](),controller[_0x584a('0x10')]);router[_0x584a('0x11')](_0x584a('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x584a('0x12')]=router;
\ No newline at end of file
index d183ef8..2436ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x692f=['weeks','days','hours','minutes','ENUM','xlsx','default','custom','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months'];(function(_0x3e22ad,_0x5c0170){var _0x3eb236=function(_0x2f430c){while(--_0x2f430c){_0x3e22ad['push'](_0x3e22ad['shift']());}};_0x3eb236(++_0x5c0170);}(_0x692f,0x74));var _0xf692=function(_0x28111f,_0x254934){_0x28111f=_0x28111f-0x0;var _0x5203e6=_0x692f[_0x28111f];return _0x5203e6;};'use strict';var Sequelize=require(_0xf692('0x0'));module[_0xf692('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf692('0x2')]},'active':{'type':Sequelize[_0xf692('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf692('0x2')],'allowNull':![],'defaultValue':_0xf692('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xf692('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf692('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xf692('0x7'),_0xf692('0x8'),_0xf692('0x9'),_0xf692('0xa'),_0xf692('0xb'),_0xf692('0xc'),_0xf692('0xd')),'allowNull':![],'defaultValue':_0xf692('0xb')},'output':{'type':Sequelize[_0xf692('0xe')]('csv','pdf',_0xf692('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xf692('0xe')]('custom',_0xf692('0x10')),'allowNull':![],'defaultValue':_0xf692('0x11')},'sendMail':{'type':Sequelize[_0xf692('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xf692('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x01e7=['TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','months','weeks','days','hours','minutes','pdf','csv','custom'];(function(_0x2fcaa3,_0x2ba904){var _0x8f4089=function(_0x581a3b){while(--_0x581a3b){_0x2fcaa3['push'](_0x2fcaa3['shift']());}};_0x8f4089(++_0x2ba904);}(_0x01e7,0xf1));var _0x701e=function(_0x174653,_0x393bd0){_0x174653=_0x174653-0x0;var _0x51fe76=_0x01e7[_0x174653];return _0x51fe76;};'use strict';var Sequelize=require('sequelize');module[_0x701e('0x0')]={'name':{'type':Sequelize[_0x701e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x701e('0x1')]},'active':{'type':Sequelize[_0x701e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x701e('0x1')],'allowNull':![],'defaultValue':_0x701e('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x701e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x701e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x701e('0x6')]('years','quarters',_0x701e('0x7'),_0x701e('0x8'),_0x701e('0x9'),_0x701e('0xa'),_0x701e('0xb')),'allowNull':![],'defaultValue':_0x701e('0x9')},'output':{'type':Sequelize[_0x701e('0x6')]('csv',_0x701e('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x701e('0xd')},'type':{'type':Sequelize[_0x701e('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x701e('0xe')},'sendMail':{'type':Sequelize[_0x701e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x701e('0x1')]},'cc':{'type':Sequelize[_0x701e('0xf')]},'bcc':{'type':Sequelize[_0x701e('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x701e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 7c80a3e..3dd6b75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2de=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x41c896,_0x50cf64){var _0x289ddd=function(_0x58e881){while(--_0x58e881){_0x41c896['push'](_0x41c896['shift']());}};_0x289ddd(++_0x50cf64);}(_0xf2de,0xf3));var _0xef2d=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xf2de[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0xef2d('0x0'));var rimraf=require(_0xef2d('0x1'));var zipdir=require(_0xef2d('0x2'));var jsonpatch=require(_0xef2d('0x3'));var rp=require(_0xef2d('0x4'));var moment=require(_0xef2d('0x5'));var BPromise=require(_0xef2d('0x6'));var Mustache=require(_0xef2d('0x7'));var util=require(_0xef2d('0x8'));var path=require(_0xef2d('0x9'));var sox=require(_0xef2d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef2d('0xb'));var _=require(_0xef2d('0xc'));var squel=require(_0xef2d('0xd'));var crypto=require('crypto');var jsforce=require(_0xef2d('0xe'));var deskjs=require(_0xef2d('0xf'));var toCsv=require(_0xef2d('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xef2d('0x11'));var authService=require(_0xef2d('0x12'));var qs=require(_0xef2d('0x13'));var as=require(_0xef2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef2d('0x15'))(_0xef2d('0x16'));var utils=require('../../config/utils');var config=require(_0xef2d('0x17'));var licenseUtil=require(_0xef2d('0x18'));var db=require(_0xef2d('0x19'))['db'];function respondWithStatusCode(_0x36346a,_0x6944d5){_0x6944d5=_0x6944d5||0xcc;return function(_0x5a8964){if(_0x5a8964){return _0x36346a[_0xef2d('0x1a')](_0x6944d5);}return _0x36346a[_0xef2d('0x1b')](_0x6944d5)[_0xef2d('0x1c')]();};}function respondWithResult(_0x49a9d7,_0x123068){_0x123068=_0x123068||0xc8;return function(_0x9a6d8a){if(_0x9a6d8a){return _0x49a9d7[_0xef2d('0x1b')](_0x123068)['json'](_0x9a6d8a);}};}function respondWithFilteredResult(_0x1534b4,_0x1e40d1){return function(_0x1427f9){if(_0x1427f9){var _0x162356=typeof _0x1e40d1[_0xef2d('0x1d')]===_0xef2d('0x1e')&&typeof _0x1e40d1['limit']===_0xef2d('0x1e');var _0x43da85=_0x1427f9[_0xef2d('0x1f')];var _0x103f3e=_0x162356?0x0:_0x1e40d1[_0xef2d('0x1d')];var _0x4527ab=_0x162356?_0x1427f9[_0xef2d('0x1f')]:_0x1e40d1[_0xef2d('0x1d')]+_0x1e40d1[_0xef2d('0x20')];var _0x3d7188;if(_0x4527ab>=_0x43da85){_0x4527ab=_0x43da85;_0x3d7188=0xc8;}else{_0x3d7188=0xce;}_0x1534b4['status'](_0x3d7188);return _0x1534b4[_0xef2d('0x21')](_0xef2d('0x22'),_0x103f3e+'-'+_0x4527ab+'/'+_0x43da85)[_0xef2d('0x23')](_0x1427f9);}return null;};}function patchUpdates(_0x43c349){return function(_0x36b6a1){try{jsonpatch[_0xef2d('0x24')](_0x36b6a1,_0x43c349,!![]);}catch(_0x117973){return BPromise['reject'](_0x117973);}return _0x36b6a1['save']();};}function saveUpdates(_0x327d5e,_0xad1f8d){return function(_0x1a50ae){if(_0x1a50ae){return _0x1a50ae[_0xef2d('0x25')](_0x327d5e)[_0xef2d('0x26')](function(_0x5ed543){return _0x5ed543;});}return null;};}function removeEntity(_0x184267,_0x457d3d){return function(_0x4dbfb0){if(_0x4dbfb0){return _0x4dbfb0[_0xef2d('0x27')]()[_0xef2d('0x26')](function(){var _0x5c818e=_0x4dbfb0[_0xef2d('0x28')]({'plain':!![]});var _0x51e2a9=_0xef2d('0x29');return db[_0xef2d('0x2a')][_0xef2d('0x27')]({'where':{'type':_0x51e2a9,'resourceId':_0x5c818e['id']}})[_0xef2d('0x26')](function(){return _0x4dbfb0;});})[_0xef2d('0x26')](function(){_0x184267[_0xef2d('0x1b')](0xcc)[_0xef2d('0x1c')]();});}};}function handleEntityNotFound(_0xb719f2,_0x2a0e49){return function(_0x37b25e){if(!_0x37b25e){_0xb719f2[_0xef2d('0x1a')](0x194);}return _0x37b25e;};}function handleError(_0x2f96ff,_0x3cb9bd){_0x3cb9bd=_0x3cb9bd||0x1f4;return function(_0x59e6fb){logger[_0xef2d('0x2b')](_0x59e6fb[_0xef2d('0x2c')]);if(_0x59e6fb[_0xef2d('0x2d')]){delete _0x59e6fb[_0xef2d('0x2d')];}_0x2f96ff['status'](_0x3cb9bd)[_0xef2d('0x2e')](_0x59e6fb);};}exports[_0xef2d('0x2f')]=function(_0x3bf341,_0x22da67){var _0x95b78c={},_0x35ed3e={},_0x3940cb={'count':0x0,'rows':[]};var _0x3210c0=_[_0xef2d('0x30')](db[_0xef2d('0x31')][_0xef2d('0x32')],function(_0x47f295){return{'name':_0x47f295[_0xef2d('0x33')],'type':_0x47f295[_0xef2d('0x34')][_0xef2d('0x35')]};});_0x35ed3e[_0xef2d('0x36')]=_[_0xef2d('0x30')](_0x3210c0,_0xef2d('0x2d'));_0x35ed3e[_0xef2d('0x37')]=_[_0xef2d('0x38')](_0x3bf341['query']);_0x35ed3e[_0xef2d('0x39')]=_[_0xef2d('0x3a')](_0x35ed3e['model'],_0x35ed3e[_0xef2d('0x37')]);_0x95b78c[_0xef2d('0x3b')]=_[_0xef2d('0x3a')](_0x35ed3e[_0xef2d('0x36')],qs['fields'](_0x3bf341[_0xef2d('0x37')][_0xef2d('0x3c')]));_0x95b78c[_0xef2d('0x3b')]=_0x95b78c[_0xef2d('0x3b')][_0xef2d('0x3d')]?_0x95b78c['attributes']:_0x35ed3e['model'];if(!_0x3bf341[_0xef2d('0x37')][_0xef2d('0x3e')](_0xef2d('0x3f'))){_0x95b78c[_0xef2d('0x20')]=qs[_0xef2d('0x20')](_0x3bf341[_0xef2d('0x37')][_0xef2d('0x20')]);_0x95b78c[_0xef2d('0x1d')]=qs['offset'](_0x3bf341['query'][_0xef2d('0x1d')]);}_0x95b78c[_0xef2d('0x40')]=qs[_0xef2d('0x41')](_0x3bf341[_0xef2d('0x37')][_0xef2d('0x41')]);_0x95b78c['where']=qs[_0xef2d('0x39')](_[_0xef2d('0x42')](_0x3bf341[_0xef2d('0x37')],_0x35ed3e[_0xef2d('0x39')]),_0x3210c0);if(_0x3bf341[_0xef2d('0x37')][_0xef2d('0x43')]){_0x95b78c['where']=_[_0xef2d('0x44')](_0x95b78c[_0xef2d('0x45')],{'$or':_['map'](_0x3210c0,function(_0x17ad01){if(_0x17ad01[_0xef2d('0x34')]!=='VIRTUAL'){var _0x15f106={};_0x15f106[_0x17ad01[_0xef2d('0x2d')]]={'$like':'%'+_0x3bf341[_0xef2d('0x37')][_0xef2d('0x43')]+'%'};return _0x15f106;}})});}_0x95b78c=_[_0xef2d('0x44')]({},_0x95b78c,_0x3bf341[_0xef2d('0x46')]);var _0x467968={'where':_0x95b78c[_0xef2d('0x45')]};return db[_0xef2d('0x31')]['count'](_0x467968)['then'](function(_0x745238){_0x3940cb[_0xef2d('0x1f')]=_0x745238;if(_0x3bf341[_0xef2d('0x37')][_0xef2d('0x47')]){_0x95b78c[_0xef2d('0x48')]=[{'all':!![]}];}return db[_0xef2d('0x31')][_0xef2d('0x49')](_0x95b78c);})['then'](function(_0x105c0d){_0x3940cb[_0xef2d('0x4a')]=_0x105c0d;return _0x3940cb;})[_0xef2d('0x26')](respondWithFilteredResult(_0x22da67,_0x95b78c))[_0xef2d('0x4b')](handleError(_0x22da67,null));};exports[_0xef2d('0x4c')]=function(_0xea1183,_0x16e2ac){var _0x377280={'raw':![],'where':{'id':_0xea1183[_0xef2d('0x4d')]['id']}},_0xea99b={};_0xea99b[_0xef2d('0x36')]=_['keys'](db['Schedule'][_0xef2d('0x32')]);_0xea99b[_0xef2d('0x37')]=_[_0xef2d('0x38')](_0xea1183[_0xef2d('0x37')]);_0xea99b[_0xef2d('0x39')]=_[_0xef2d('0x3a')](_0xea99b[_0xef2d('0x36')],_0xea99b[_0xef2d('0x37')]);_0x377280[_0xef2d('0x3b')]=_[_0xef2d('0x3a')](_0xea99b[_0xef2d('0x36')],qs[_0xef2d('0x3c')](_0xea1183[_0xef2d('0x37')][_0xef2d('0x3c')]));_0x377280['attributes']=_0x377280['attributes']['length']?_0x377280[_0xef2d('0x3b')]:_0xea99b[_0xef2d('0x36')];if(_0xea1183['query']['includeAll']){_0x377280['include']=[{'all':!![]}];}_0x377280=_[_0xef2d('0x44')]({},_0x377280,_0xea1183[_0xef2d('0x46')]);return db[_0xef2d('0x31')][_0xef2d('0x4e')](_0x377280)[_0xef2d('0x26')](handleEntityNotFound(_0x16e2ac,null))[_0xef2d('0x26')](respondWithResult(_0x16e2ac,null))[_0xef2d('0x4b')](handleError(_0x16e2ac,null));};exports[_0xef2d('0x4f')]=function(_0x329b9d,_0x52c537){return db[_0xef2d('0x31')][_0xef2d('0x4f')](_0x329b9d[_0xef2d('0x50')],{})[_0xef2d('0x26')](function(_0x27baf1){var _0x1e79c3=_0x329b9d[_0xef2d('0x51')][_0xef2d('0x28')]({'plain':!![]});if(!_0x1e79c3)throw new Error(_0xef2d('0x52'));if(_0x1e79c3[_0xef2d('0x53')]===_0xef2d('0x51')){var _0x3deb99=_0x27baf1[_0xef2d('0x28')]({'plain':!![]});var _0x3fda30='Scheduler';return db[_0xef2d('0x54')][_0xef2d('0x4e')]({'where':{'name':_0x3fda30,'userProfileId':_0x1e79c3[_0xef2d('0x55')]},'raw':!![]})['then'](function(_0x4f7af4){if(_0x4f7af4&&_0x4f7af4['autoAssociation']===0x0){return db[_0xef2d('0x2a')][_0xef2d('0x4f')]({'name':_0x3deb99[_0xef2d('0x2d')],'resourceId':_0x3deb99['id'],'type':_0x4f7af4['name'],'sectionId':_0x4f7af4['id']},{})[_0xef2d('0x26')](function(){return _0x27baf1;});}else{return _0x27baf1;}})[_0xef2d('0x4b')](function(_0x57af30){logger[_0xef2d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57af30);throw _0x57af30;});}return _0x27baf1;})[_0xef2d('0x26')](respondWithResult(_0x52c537,0xc9))[_0xef2d('0x4b')](handleError(_0x52c537,null));};exports[_0xef2d('0x25')]=function(_0x1e572b,_0x4c3d14){if(_0x1e572b[_0xef2d('0x50')]['id']){delete _0x1e572b[_0xef2d('0x50')]['id'];}return db['Schedule']['find']({'where':{'id':_0x1e572b[_0xef2d('0x4d')]['id']}})[_0xef2d('0x26')](handleEntityNotFound(_0x4c3d14,null))[_0xef2d('0x26')](saveUpdates(_0x1e572b[_0xef2d('0x50')],null))[_0xef2d('0x26')](respondWithResult(_0x4c3d14,null))[_0xef2d('0x4b')](handleError(_0x4c3d14,null));};exports[_0xef2d('0x27')]=function(_0x41fdbf,_0xe92379){return db[_0xef2d('0x31')][_0xef2d('0x4e')]({'where':{'id':_0x41fdbf['params']['id']}})[_0xef2d('0x26')](handleEntityNotFound(_0xe92379,null))[_0xef2d('0x26')](removeEntity(_0xe92379,null))[_0xef2d('0x4b')](handleError(_0xe92379,null));};exports[_0xef2d('0x56')]=function(_0x43cb92,_0x284ef4,_0x4a8ab1){var _0x4c84c8=require(_0xef2d('0x57'));return db[_0xef2d('0x31')]['find']({'where':{'id':_0x43cb92[_0xef2d('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x284ef4,null))['then'](function(){_0x4c84c8[_0xef2d('0x56')](_0x43cb92[_0xef2d('0x4d')]['id']);})[_0xef2d('0x26')](respondWithStatusCode(_0x284ef4,null))[_0xef2d('0x4b')](handleError(_0x284ef4,null));};
\ No newline at end of file
+var _0x01ce=['../../config/logger','api','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Scheduler','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','filter','merge','where','VIRTUAL','options','Schedule','includeAll','include','rows','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','fast-json-patch','moment','bluebird','util','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'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0x01ce,0x93));var _0xe01c=function(_0x49b6ef,_0x28c145){_0x49b6ef=_0x49b6ef-0x0;var _0x6b1e7e=_0x01ce[_0x49b6ef];return _0x6b1e7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe01c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe01c('0x1'));var rp=require('request-promise');var moment=require(_0xe01c('0x2'));var BPromise=require(_0xe01c('0x3'));var Mustache=require('mustache');var util=require(_0xe01c('0x4'));var path=require(_0xe01c('0x5'));var sox=require(_0xe01c('0x6'));var csv=require(_0xe01c('0x7'));var ejs=require(_0xe01c('0x8'));var fs=require('fs');var fs_extra=require(_0xe01c('0x9'));var _=require(_0xe01c('0xa'));var squel=require(_0xe01c('0xb'));var crypto=require(_0xe01c('0xc'));var jsforce=require(_0xe01c('0xd'));var deskjs=require(_0xe01c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe01c('0xf'));var Papa=require('papaparse');var Redis=require(_0xe01c('0x10'));var authService=require(_0xe01c('0x11'));var qs=require(_0xe01c('0x12'));var as=require(_0xe01c('0x13'));var hardwareService=require(_0xe01c('0x14'));var logger=require(_0xe01c('0x15'))(_0xe01c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe01c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc4145,_0x2d38da){_0x2d38da=_0x2d38da||0xcc;return function(_0x5ea007){if(_0x5ea007){return _0xcc4145[_0xe01c('0x18')](_0x2d38da);}return _0xcc4145[_0xe01c('0x19')](_0x2d38da)[_0xe01c('0x1a')]();};}function respondWithResult(_0x41afde,_0x430cef){_0x430cef=_0x430cef||0xc8;return function(_0x5858ce){if(_0x5858ce){return _0x41afde['status'](_0x430cef)[_0xe01c('0x1b')](_0x5858ce);}};}function respondWithFilteredResult(_0x27add5,_0x4026d5){return function(_0x2f11f9){if(_0x2f11f9){var _0x1bc7db=typeof _0x4026d5['offset']==='undefined'&&typeof _0x4026d5[_0xe01c('0x1c')]===_0xe01c('0x1d');var _0x55adc6=_0x2f11f9['count'];var _0xe285c2=_0x1bc7db?0x0:_0x4026d5['offset'];var _0x429888=_0x1bc7db?_0x2f11f9[_0xe01c('0x1e')]:_0x4026d5[_0xe01c('0x1f')]+_0x4026d5[_0xe01c('0x1c')];var _0x8bbc9e;if(_0x429888>=_0x55adc6){_0x429888=_0x55adc6;_0x8bbc9e=0xc8;}else{_0x8bbc9e=0xce;}_0x27add5[_0xe01c('0x19')](_0x8bbc9e);return _0x27add5[_0xe01c('0x20')](_0xe01c('0x21'),_0xe285c2+'-'+_0x429888+'/'+_0x55adc6)[_0xe01c('0x1b')](_0x2f11f9);}return null;};}function patchUpdates(_0x58551e){return function(_0x814343){try{jsonpatch[_0xe01c('0x22')](_0x814343,_0x58551e,!![]);}catch(_0x30a6c2){return BPromise[_0xe01c('0x23')](_0x30a6c2);}return _0x814343[_0xe01c('0x24')]();};}function saveUpdates(_0x3a662a,_0x892d1){return function(_0x323b5f){if(_0x323b5f){return _0x323b5f[_0xe01c('0x25')](_0x3a662a)['then'](function(_0x2a2471){return _0x2a2471;});}return null;};}function removeEntity(_0x27f7b5,_0x4944ee){return function(_0x3c77ee){if(_0x3c77ee){return _0x3c77ee[_0xe01c('0x26')]()[_0xe01c('0x27')](function(){var _0x4b51f5=_0x3c77ee['get']({'plain':!![]});var _0x191446=_0xe01c('0x28');return db[_0xe01c('0x29')][_0xe01c('0x26')]({'where':{'type':_0x191446,'resourceId':_0x4b51f5['id']}})[_0xe01c('0x27')](function(){return _0x3c77ee;});})[_0xe01c('0x27')](function(){_0x27f7b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fc5dd,_0x56b7fb){return function(_0x4e97e7){if(!_0x4e97e7){_0x1fc5dd[_0xe01c('0x18')](0x194);}return _0x4e97e7;};}function handleError(_0x1d0a75,_0x16f9b7){_0x16f9b7=_0x16f9b7||0x1f4;return function(_0x3e1873){logger[_0xe01c('0x2a')](_0x3e1873[_0xe01c('0x2b')]);if(_0x3e1873[_0xe01c('0x2c')]){delete _0x3e1873[_0xe01c('0x2c')];}_0x1d0a75[_0xe01c('0x19')](_0x16f9b7)[_0xe01c('0x2d')](_0x3e1873);};}exports[_0xe01c('0x2e')]=function(_0x27d4f5,_0x498a10){var _0x3cb0ca={},_0x361be4={},_0x4af572={'count':0x0,'rows':[]};var _0x5e0b06=_[_0xe01c('0x2f')](db['Schedule']['rawAttributes'],function(_0x1c8c0c){return{'name':_0x1c8c0c[_0xe01c('0x30')],'type':_0x1c8c0c[_0xe01c('0x31')][_0xe01c('0x32')]};});_0x361be4['model']=_[_0xe01c('0x2f')](_0x5e0b06,_0xe01c('0x2c'));_0x361be4[_0xe01c('0x33')]=_[_0xe01c('0x34')](_0x27d4f5[_0xe01c('0x33')]);_0x361be4['filters']=_['intersection'](_0x361be4[_0xe01c('0x35')],_0x361be4['query']);_0x3cb0ca[_0xe01c('0x36')]=_[_0xe01c('0x37')](_0x361be4[_0xe01c('0x35')],qs['fields'](_0x27d4f5['query'][_0xe01c('0x38')]));_0x3cb0ca[_0xe01c('0x36')]=_0x3cb0ca[_0xe01c('0x36')][_0xe01c('0x39')]?_0x3cb0ca[_0xe01c('0x36')]:_0x361be4['model'];if(!_0x27d4f5[_0xe01c('0x33')][_0xe01c('0x3a')](_0xe01c('0x3b'))){_0x3cb0ca[_0xe01c('0x1c')]=qs[_0xe01c('0x1c')](_0x27d4f5[_0xe01c('0x33')][_0xe01c('0x1c')]);_0x3cb0ca[_0xe01c('0x1f')]=qs['offset'](_0x27d4f5[_0xe01c('0x33')][_0xe01c('0x1f')]);}_0x3cb0ca[_0xe01c('0x3c')]=qs['sort'](_0x27d4f5[_0xe01c('0x33')]['sort']);_0x3cb0ca['where']=qs[_0xe01c('0x3d')](_['pick'](_0x27d4f5['query'],_0x361be4[_0xe01c('0x3d')]),_0x5e0b06);if(_0x27d4f5['query'][_0xe01c('0x3e')]){_0x3cb0ca['where']=_[_0xe01c('0x3f')](_0x3cb0ca[_0xe01c('0x40')],{'$or':_['map'](_0x5e0b06,function(_0x4a3fa9){if(_0x4a3fa9['type']!==_0xe01c('0x41')){var _0x456db4={};_0x456db4[_0x4a3fa9[_0xe01c('0x2c')]]={'$like':'%'+_0x27d4f5[_0xe01c('0x33')][_0xe01c('0x3e')]+'%'};return _0x456db4;}})});}_0x3cb0ca=_[_0xe01c('0x3f')]({},_0x3cb0ca,_0x27d4f5[_0xe01c('0x42')]);var _0x442151={'where':_0x3cb0ca['where']};return db[_0xe01c('0x43')][_0xe01c('0x1e')](_0x442151)[_0xe01c('0x27')](function(_0x1e28f1){_0x4af572[_0xe01c('0x1e')]=_0x1e28f1;if(_0x27d4f5[_0xe01c('0x33')][_0xe01c('0x44')]){_0x3cb0ca[_0xe01c('0x45')]=[{'all':!![]}];}return db[_0xe01c('0x43')]['findAll'](_0x3cb0ca);})[_0xe01c('0x27')](function(_0x263fad){_0x4af572[_0xe01c('0x46')]=_0x263fad;return _0x4af572;})[_0xe01c('0x27')](respondWithFilteredResult(_0x498a10,_0x3cb0ca))['catch'](handleError(_0x498a10,null));};exports[_0xe01c('0x47')]=function(_0x54172c,_0x57e3d7){var _0x54a07c={'raw':![],'where':{'id':_0x54172c['params']['id']}},_0x23a23e={};_0x23a23e['model']=_['keys'](db['Schedule']['rawAttributes']);_0x23a23e[_0xe01c('0x33')]=_[_0xe01c('0x34')](_0x54172c[_0xe01c('0x33')]);_0x23a23e['filters']=_[_0xe01c('0x37')](_0x23a23e[_0xe01c('0x35')],_0x23a23e[_0xe01c('0x33')]);_0x54a07c[_0xe01c('0x36')]=_[_0xe01c('0x37')](_0x23a23e['model'],qs['fields'](_0x54172c[_0xe01c('0x33')][_0xe01c('0x38')]));_0x54a07c[_0xe01c('0x36')]=_0x54a07c[_0xe01c('0x36')][_0xe01c('0x39')]?_0x54a07c[_0xe01c('0x36')]:_0x23a23e[_0xe01c('0x35')];if(_0x54172c[_0xe01c('0x33')]['includeAll']){_0x54a07c[_0xe01c('0x45')]=[{'all':!![]}];}_0x54a07c=_[_0xe01c('0x3f')]({},_0x54a07c,_0x54172c[_0xe01c('0x42')]);return db[_0xe01c('0x43')]['find'](_0x54a07c)[_0xe01c('0x27')](handleEntityNotFound(_0x57e3d7,null))[_0xe01c('0x27')](respondWithResult(_0x57e3d7,null))[_0xe01c('0x48')](handleError(_0x57e3d7,null));};exports['create']=function(_0x3bfb94,_0x132b81){return db[_0xe01c('0x43')][_0xe01c('0x49')](_0x3bfb94[_0xe01c('0x4a')],{})[_0xe01c('0x27')](function(_0x19c82f){var _0x5511c1=_0x3bfb94[_0xe01c('0x4b')][_0xe01c('0x4c')]({'plain':!![]});if(!_0x5511c1)throw new Error(_0xe01c('0x4d'));if(_0x5511c1['role']==='user'){var _0x4956cf=_0x19c82f[_0xe01c('0x4c')]({'plain':!![]});var _0x2a90b6='Scheduler';return db['UserProfileSection'][_0xe01c('0x4e')]({'where':{'name':_0x2a90b6,'userProfileId':_0x5511c1['userProfileId']},'raw':!![]})[_0xe01c('0x27')](function(_0x397141){if(_0x397141&&_0x397141[_0xe01c('0x4f')]===0x0){return db[_0xe01c('0x29')]['create']({'name':_0x4956cf['name'],'resourceId':_0x4956cf['id'],'type':_0x397141[_0xe01c('0x2c')],'sectionId':_0x397141['id']},{})['then'](function(){return _0x19c82f;});}else{return _0x19c82f;}})[_0xe01c('0x48')](function(_0x36345c){logger[_0xe01c('0x2a')](_0xe01c('0x50'),_0x36345c);throw _0x36345c;});}return _0x19c82f;})[_0xe01c('0x27')](respondWithResult(_0x132b81,0xc9))[_0xe01c('0x48')](handleError(_0x132b81,null));};exports[_0xe01c('0x25')]=function(_0x8a370e,_0x915f7){if(_0x8a370e[_0xe01c('0x4a')]['id']){delete _0x8a370e[_0xe01c('0x4a')]['id'];}return db['Schedule'][_0xe01c('0x4e')]({'where':{'id':_0x8a370e[_0xe01c('0x51')]['id']}})[_0xe01c('0x27')](handleEntityNotFound(_0x915f7,null))[_0xe01c('0x27')](saveUpdates(_0x8a370e['body'],null))[_0xe01c('0x27')](respondWithResult(_0x915f7,null))['catch'](handleError(_0x915f7,null));};exports['destroy']=function(_0x292451,_0x542e76){return db[_0xe01c('0x43')][_0xe01c('0x4e')]({'where':{'id':_0x292451[_0xe01c('0x51')]['id']}})['then'](handleEntityNotFound(_0x542e76,null))[_0xe01c('0x27')](removeEntity(_0x542e76,null))['catch'](handleError(_0x542e76,null));};exports[_0xe01c('0x52')]=function(_0x2001c7,_0x35fd6e,_0x3dba53){var _0x48fd69=require(_0xe01c('0x53'));return db[_0xe01c('0x43')][_0xe01c('0x4e')]({'where':{'id':_0x2001c7[_0xe01c('0x51')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35fd6e,null))[_0xe01c('0x27')](function(){_0x48fd69[_0xe01c('0x52')](_0x2001c7['params']['id']);})['then'](respondWithStatusCode(_0x35fd6e,null))['catch'](handleError(_0x35fd6e,null));};
\ No newline at end of file
index 22ef4af..eb29ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe661=['define','Schedule','tools_schedules','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x1468e5,_0xf3a3ca){var _0x7b7cb8=function(_0x30d6fa){while(--_0x30d6fa){_0x1468e5['push'](_0x1468e5['shift']());}};_0x7b7cb8(++_0xf3a3ca);}(_0xe661,0xed));var _0x1e66=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe661[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x1e66('0x0'));var logger=require(_0x1e66('0x1'))(_0x1e66('0x2'));var moment=require('moment');var BPromise=require(_0x1e66('0x3'));var rp=require(_0x1e66('0x4'));var fs=require('fs');var path=require(_0x1e66('0x5'));var rimraf=require(_0x1e66('0x6'));var config=require(_0x1e66('0x7'));var attributes=require(_0x1e66('0x8'));module[_0x1e66('0x9')]=function(_0x24f057,_0xb3b627){return _0x24f057[_0x1e66('0xa')](_0x1e66('0xb'),attributes,{'tableName':_0x1e66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a79=['./schedule.attributes','exports','tools_schedules','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4ed83b,_0x1d281b){var _0x2ab964=function(_0x27921b){while(--_0x27921b){_0x4ed83b['push'](_0x4ed83b['shift']());}};_0x2ab964(++_0x1d281b);}(_0x2a79,0x1bc));var _0x92a7=function(_0xc24160,_0x22c8c){_0xc24160=_0xc24160-0x0;var _0x5f1844=_0x2a79[_0xc24160];return _0x5f1844;};'use strict';var _=require(_0x92a7('0x0'));var util=require(_0x92a7('0x1'));var logger=require(_0x92a7('0x2'))(_0x92a7('0x3'));var moment=require(_0x92a7('0x4'));var BPromise=require('bluebird');var rp=require(_0x92a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x92a7('0x6'));module[_0x92a7('0x7')]=function(_0x38b45a,_0x1fc2ca){return _0x38b45a['define']('Schedule',attributes,{'tableName':_0x92a7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8daf305..092329b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b2a=['request','then','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x65afe6,_0x448d51){var _0x4112fc=function(_0x113c6a){while(--_0x113c6a){_0x65afe6['push'](_0x65afe6['shift']());}};_0x4112fc(++_0x448d51);}(_0x7b2a,0x130));var _0xa7b2=function(_0x1a27d1,_0x5a023d){_0x1a27d1=_0x1a27d1-0x0;var _0xe02f67=_0x7b2a[_0x1a27d1];return _0xe02f67;};'use strict';var _=require('lodash');var util=require(_0xa7b2('0x0'));var moment=require(_0xa7b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7b2('0x2'));var fs=require('fs');var Redis=require(_0xa7b2('0x3'));var db=require(_0xa7b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7b2('0x5'))(_0xa7b2('0x6'));var config=require(_0xa7b2('0x7'));var jayson=require(_0xa7b2('0x8'));var client=jayson[_0xa7b2('0x9')][_0xa7b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5131ae,_0x448d29,_0x4ed90e){return new BPromise(function(_0x43d841,_0x42cd56){return client[_0xa7b2('0xb')](_0x5131ae,_0x4ed90e)[_0xa7b2('0xc')](function(_0x2736c9){logger['info'](_0xa7b2('0xd'),_0x448d29,'request\x20sent');logger['debug'](_0xa7b2('0xe'),_0x448d29,_0xa7b2('0xf'),JSON['stringify'](_0x2736c9));if(_0x2736c9[_0xa7b2('0x10')]){if(_0x2736c9[_0xa7b2('0x10')][_0xa7b2('0x11')]===0x1f4){logger[_0xa7b2('0x10')]('Schedule,\x20%s,\x20%s',_0x448d29,_0x2736c9[_0xa7b2('0x10')][_0xa7b2('0x12')]);return _0x42cd56(_0x2736c9[_0xa7b2('0x10')][_0xa7b2('0x12')]);}logger[_0xa7b2('0x10')]('Schedule,\x20%s,\x20%s',_0x448d29,_0x2736c9['error'][_0xa7b2('0x12')]);return _0x43d841(_0x2736c9[_0xa7b2('0x10')][_0xa7b2('0x12')]);}else{logger[_0xa7b2('0x13')]('Schedule,\x20%s,\x20%s',_0x448d29,_0xa7b2('0xf'));_0x43d841(_0x2736c9['result'][_0xa7b2('0x12')]);}})[_0xa7b2('0x14')](function(_0x152f6b){logger[_0xa7b2('0x10')](_0xa7b2('0xd'),_0x448d29,_0x152f6b);_0x42cd56(_0x152f6b);});});}
\ No newline at end of file
+var _0x22b4=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x22b4,0x1bc));var _0x422b=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x22b4[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x422b('0x0'));var BPromise=require('bluebird');var rs=require(_0x422b('0x1'));var fs=require('fs');var Redis=require(_0x422b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x422b('0x3'));var logger=require(_0x422b('0x4'))('rpc');var config=require(_0x422b('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x422b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26421c,_0xd29d16,_0x409862){return new BPromise(function(_0x27dcc9,_0x185810){return client[_0x422b('0x7')](_0x26421c,_0x409862)['then'](function(_0x78dceb){logger[_0x422b('0x8')](_0x422b('0x9'),_0xd29d16,_0x422b('0xa'));logger[_0x422b('0xb')](_0x422b('0xc'),_0xd29d16,_0x422b('0xa'),JSON[_0x422b('0xd')](_0x78dceb));if(_0x78dceb[_0x422b('0xe')]){if(_0x78dceb[_0x422b('0xe')][_0x422b('0xf')]===0x1f4){logger[_0x422b('0xe')](_0x422b('0x9'),_0xd29d16,_0x78dceb[_0x422b('0xe')][_0x422b('0x10')]);return _0x185810(_0x78dceb[_0x422b('0xe')][_0x422b('0x10')]);}logger['error'](_0x422b('0x9'),_0xd29d16,_0x78dceb['error'][_0x422b('0x10')]);return _0x27dcc9(_0x78dceb['error'][_0x422b('0x10')]);}else{logger[_0x422b('0x8')](_0x422b('0x9'),_0xd29d16,'request\x20sent');_0x27dcc9(_0x78dceb[_0x422b('0x11')]['message']);}})[_0x422b('0x12')](function(_0x1e9178){logger[_0x422b('0xe')](_0x422b('0x9'),_0xd29d16,_0x1e9178);_0x185810(_0x1e9178);});});}
\ No newline at end of file
index 9ab507d..4758c15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c8=['/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x4e96ea,_0x3980f0){var _0x4848ca=function(_0x30a159){while(--_0x30a159){_0x4e96ea['push'](_0x4e96ea['shift']());}};_0x4848ca(++_0x3980f0);}(_0x55c8,0xe4));var _0x855c=function(_0x5a0702,_0x3a273f){_0x5a0702=_0x5a0702-0x0;var _0x5839a4=_0x55c8[_0x5a0702];return _0x5839a4;};'use strict';var multer=require(_0x855c('0x0'));var util=require('util');var path=require(_0x855c('0x1'));var timeout=require(_0x855c('0x2'));var express=require(_0x855c('0x3'));var router=express[_0x855c('0x4')]();var fs_extra=require(_0x855c('0x5'));var auth=require(_0x855c('0x6'));var interaction=require(_0x855c('0x7'));var config=require(_0x855c('0x8'));var controller=require('./screenRecording.controller');router[_0x855c('0x9')]('/',auth[_0x855c('0xa')](),controller[_0x855c('0xb')]);router[_0x855c('0x9')](_0x855c('0xc'),auth[_0x855c('0xa')](),controller[_0x855c('0xd')]);router[_0x855c('0x9')](_0x855c('0xe'),auth[_0x855c('0xa')](),controller[_0x855c('0xf')]);router[_0x855c('0x9')]('/:id/download',auth[_0x855c('0xa')](),controller['download']);router[_0x855c('0x10')]('/',auth[_0x855c('0xa')](),controller[_0x855c('0x11')]);router[_0x855c('0x12')](_0x855c('0xe'),auth[_0x855c('0xa')](),controller['update']);router[_0x855c('0x13')]('/:id',auth[_0x855c('0xa')](),controller[_0x855c('0x14')]);module[_0x855c('0x15')]=router;
\ No newline at end of file
+var _0x5648=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5648,0x114));var _0x8564=function(_0x3015fb,_0x28604){_0x3015fb=_0x3015fb-0x0;var _0x4a82ef=_0x5648[_0x3015fb];return _0x4a82ef;};'use strict';var multer=require(_0x8564('0x0'));var util=require(_0x8564('0x1'));var path=require(_0x8564('0x2'));var timeout=require(_0x8564('0x3'));var express=require(_0x8564('0x4'));var router=express[_0x8564('0x5')]();var fs_extra=require(_0x8564('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8564('0x7'));var config=require(_0x8564('0x8'));var controller=require(_0x8564('0x9'));router[_0x8564('0xa')]('/',auth['isAuthenticated'](),controller[_0x8564('0xb')]);router['get'](_0x8564('0xc'),auth['isAuthenticated'](),controller[_0x8564('0xd')]);router[_0x8564('0xa')](_0x8564('0xe'),auth[_0x8564('0xf')](),controller['show']);router[_0x8564('0xa')](_0x8564('0x10'),auth[_0x8564('0xf')](),controller['download']);router[_0x8564('0x11')]('/',auth[_0x8564('0xf')](),controller[_0x8564('0x12')]);router[_0x8564('0x13')]('/:id',auth[_0x8564('0xf')](),controller[_0x8564('0x14')]);router[_0x8564('0x15')](_0x8564('0xe'),auth[_0x8564('0xf')](),controller['destroy']);module[_0x8564('0x16')]=router;
\ No newline at end of file
index c872461..67cc8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78e=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL'];(function(_0x147656,_0x205a15){var _0x37e1e9=function(_0xea78b){while(--_0xea78b){_0x147656['push'](_0x147656['shift']());}};_0x37e1e9(++_0x205a15);}(_0xb78e,0x1c9));var _0xeb78=function(_0x1fd56a,_0xca4b64){_0x1fd56a=_0x1fd56a-0x0;var _0x2a31d0=_0xb78e[_0x1fd56a];return _0x2a31d0;};'use strict';var Sequelize=require(_0xeb78('0x0'));var moment=require(_0xeb78('0x1'));var path=require('path');var config=require(_0xeb78('0x2'));module[_0xeb78('0x3')]={'format':{'type':Sequelize[_0xeb78('0x4')],'get':function(){return this[_0xeb78('0x5')](_0xeb78('0x6'))?path[_0xeb78('0x7')](this[_0xeb78('0x5')](_0xeb78('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xeb78('0x8')]},'value':{'type':Sequelize[_0xeb78('0x8')],'set':function(_0x1ccc2f){var _0x30c884=_0x1ccc2f[_0xeb78('0x9')](/\\/g,'/');this[_0xeb78('0xa')](_0xeb78('0x6'),_0x30c884);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xeb78('0xb')],'set':function(_0x1c941d){this[_0xeb78('0xa')](_0xeb78('0xc'),moment()[_0xeb78('0xd')](_0x1c941d,'ms'));this[_0xeb78('0xa')](_0xeb78('0xe'),moment());this[_0xeb78('0xa')](_0xeb78('0xf'),_0x1c941d);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0xc')))[_0xeb78('0x10')](_0xeb78('0x11'))[_0xeb78('0x12')]();}},'closedAt':{'type':Sequelize[_0xeb78('0x13')],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0xe')))[_0xeb78('0x10')](_0xeb78('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0xeb78('0x13')],'get':function(){return moment(this[_0xeb78('0x5')]('createdAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xeb78('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0x14')))['format'](_0xeb78('0x11'))['toString']();}}};
\ No newline at end of file
+var _0x9e69=['getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','../../config/environment','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9e69,0x150));var _0x99e6=function(_0x5f934d,_0x23f418){_0x5f934d=_0x5f934d-0x0;var _0x29b283=_0x9e69[_0x5f934d];return _0x29b283;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x99e6('0x0'));var path=require(_0x99e6('0x1'));var config=require(_0x99e6('0x2'));module[_0x99e6('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x99e6('0x4')](_0x99e6('0x5'))?path['extname'](this[_0x99e6('0x4')](_0x99e6('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x99e6('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x99e6('0x6')],'set':function(_0x3cf241){var _0x41635b=_0x3cf241['replace'](/\\/g,'/');this[_0x99e6('0x7')](_0x99e6('0x5'),_0x41635b);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x99e6('0x8')],'set':function(_0x133169){this['setDataValue'](_0x99e6('0x9'),moment()[_0x99e6('0xa')](_0x133169,'ms'));this['setDataValue']('closedAt',moment());this[_0x99e6('0x7')](_0x99e6('0xb'),_0x133169);}},'startedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x9')))[_0x99e6('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x99e6('0xe')]();}},'closedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')]('closedAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x10')))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}}};
\ No newline at end of file
index 3a359b4..9fc94f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x4b5db2,_0x29b59b){var _0x2f3727=function(_0x3b9ed8){while(--_0x3b9ed8){_0x4b5db2['push'](_0x4b5db2['shift']());}};_0x2f3727(++_0x29b59b);}(_0x032e,0x124));var _0xe032=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x032e[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));};
\ No newline at end of file
+var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x4aa7b8,_0xc69b67){var _0x310986=function(_0x1d18e7){while(--_0x1d18e7){_0x4aa7b8['push'](_0x4aa7b8['shift']());}};_0x310986(++_0xc69b67);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));};
\ No newline at end of file
index 7c3c144..782b4d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x907c=['../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1b3818,_0x4c98a8){var _0xc7cba9=function(_0x1659d2){while(--_0x1659d2){_0x1b3818['push'](_0x1b3818['shift']());}};_0xc7cba9(++_0x4c98a8);}(_0x907c,0xbc));var _0xc907=function(_0x126624,_0x568a96){_0x126624=_0x126624-0x0;var _0x109367=_0x907c[_0x126624];return _0x109367;};'use strict';var _=require(_0xc907('0x0'));var util=require(_0xc907('0x1'));var logger=require('../../config/logger')(_0xc907('0x2'));var moment=require(_0xc907('0x3'));var BPromise=require(_0xc907('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc907('0x5'));var rimraf=require(_0xc907('0x6'));var config=require(_0xc907('0x7'));var attributes=require(_0xc907('0x8'));module[_0xc907('0x9')]=function(_0x4f3704,_0x17b135){return _0x4f3704[_0xc907('0xa')]('ScreenRecording',attributes,{'tableName':_0xc907('0xb'),'paranoid':![],'indexes':[{'name':_0xc907('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa37=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ScreenRecording','interactionid'];(function(_0x55bde5,_0x463592){var _0x2d6e61=function(_0x541257){while(--_0x541257){_0x55bde5['push'](_0x55bde5['shift']());}};_0x2d6e61(++_0x463592);}(_0xaa37,0x1d9));var _0x7aa3=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xaa37[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x7aa3('0x0'));var logger=require(_0x7aa3('0x1'))(_0x7aa3('0x2'));var moment=require(_0x7aa3('0x3'));var BPromise=require(_0x7aa3('0x4'));var rp=require(_0x7aa3('0x5'));var fs=require('fs');var path=require(_0x7aa3('0x6'));var rimraf=require('rimraf');var config=require(_0x7aa3('0x7'));var attributes=require('./screenRecording.attributes');module[_0x7aa3('0x8')]=function(_0x5a2801,_0x1e9fda){return _0x5a2801['define'](_0x7aa3('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x7aa3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 4950e5b..f24f554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ea=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x78ea,0x183));var _0xa78e=function(_0x3e8dac,_0x1b1c37){_0x3e8dac=_0x3e8dac-0x0;var _0x9ca12=_0x78ea[_0x3e8dac];return _0x9ca12;};'use strict';var _=require(_0xa78e('0x0'));var util=require('util');var moment=require(_0xa78e('0x1'));var BPromise=require(_0xa78e('0x2'));var rs=require(_0xa78e('0x3'));var fs=require('fs');var Redis=require(_0xa78e('0x4'));var db=require(_0xa78e('0x5'))['db'];var utils=require(_0xa78e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa78e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa78e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fb57,_0x387d93,_0x1229d3){return new BPromise(function(_0x34059c,_0x53d242){return client[_0xa78e('0x9')](_0x31fb57,_0x1229d3)['then'](function(_0x3b393a){logger['info'](_0xa78e('0xa'),_0x387d93,_0xa78e('0xb'));logger[_0xa78e('0xc')](_0xa78e('0xd'),_0x387d93,_0xa78e('0xb'),JSON[_0xa78e('0xe')](_0x3b393a));if(_0x3b393a[_0xa78e('0xf')]){if(_0x3b393a[_0xa78e('0xf')][_0xa78e('0x10')]===0x1f4){logger[_0xa78e('0xf')](_0xa78e('0xa'),_0x387d93,_0x3b393a[_0xa78e('0xf')][_0xa78e('0x11')]);return _0x53d242(_0x3b393a['error']['message']);}logger[_0xa78e('0xf')](_0xa78e('0xa'),_0x387d93,_0x3b393a[_0xa78e('0xf')][_0xa78e('0x11')]);return _0x34059c(_0x3b393a['error']['message']);}else{logger[_0xa78e('0x12')](_0xa78e('0xa'),_0x387d93,_0xa78e('0xb'));_0x34059c(_0x3b393a[_0xa78e('0x13')][_0xa78e('0x11')]);}})[_0xa78e('0x14')](function(_0x45e305){logger[_0xa78e('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x387d93,_0x45e305);_0x53d242(_0x45e305);});});}
\ No newline at end of file
+var _0xd04a=['catch','lodash','util','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','result','message'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0xd04a,0xfd));var _0xad04=function(_0x28d2d7,_0x55081c){_0x28d2d7=_0x28d2d7-0x0;var _0x15c942=_0xd04a[_0x28d2d7];return _0x15c942;};'use strict';var _=require(_0xad04('0x0'));var util=require(_0xad04('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad04('0x2'));var logger=require('../../config/logger')(_0xad04('0x3'));var config=require(_0xad04('0x4'));var jayson=require(_0xad04('0x5'));var client=jayson[_0xad04('0x6')][_0xad04('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6b9159,_0x23e2ef,_0xa4c776){return new BPromise(function(_0x605aec,_0x271f37){return client['request'](_0x6b9159,_0xa4c776)[_0xad04('0x8')](function(_0x1fadfc){logger[_0xad04('0x9')](_0xad04('0xa'),_0x23e2ef,_0xad04('0xb'));logger[_0xad04('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x23e2ef,_0xad04('0xb'),JSON[_0xad04('0xd')](_0x1fadfc));if(_0x1fadfc[_0xad04('0xe')]){if(_0x1fadfc['error']['code']===0x1f4){logger[_0xad04('0xe')](_0xad04('0xa'),_0x23e2ef,_0x1fadfc[_0xad04('0xe')]['message']);return _0x271f37(_0x1fadfc[_0xad04('0xe')]['message']);}logger['error'](_0xad04('0xa'),_0x23e2ef,_0x1fadfc[_0xad04('0xe')]['message']);return _0x605aec(_0x1fadfc[_0xad04('0xe')]['message']);}else{logger[_0xad04('0x9')](_0xad04('0xa'),_0x23e2ef,'request\x20sent');_0x605aec(_0x1fadfc[_0xad04('0xf')][_0xad04('0x10')]);}})[_0xad04('0x11')](function(_0x25d49c){logger[_0xad04('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x23e2ef,_0x25d49c);_0x271f37(_0x25d49c);});});}
\ No newline at end of file
index 642b127..fec5025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f9=['/:id','update','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','root','server/files/images/logos/','format','%s%s','extname','originalname','post','/:id/logo','file','addLogo','join','single','addPreferred','favicon','/:id/favicon','put'];(function(_0x4e8113,_0x4fe555){var _0x3c0897=function(_0x2c06a6){while(--_0x2c06a6){_0x4e8113['push'](_0x4e8113['shift']());}};_0x3c0897(++_0x4fe555);}(_0x54f9,0xe0));var _0x954f=function(_0x34faa2,_0x5b7ddd){_0x34faa2=_0x34faa2-0x0;var _0x48db95=_0x54f9[_0x34faa2];return _0x48db95;};'use strict';var multer=require('multer');var util=require(_0x954f('0x0'));var path=require('path');var timeout=require(_0x954f('0x1'));var express=require(_0x954f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x954f('0x3'));var interaction=require(_0x954f('0x4'));var config=require('../../config/environment');var controller=require(_0x954f('0x5'));router[_0x954f('0x6')]('/',auth[_0x954f('0x7')](),controller[_0x954f('0x8')]);router[_0x954f('0x6')](_0x954f('0x9'),controller[_0x954f('0xa')]);router[_0x954f('0x6')]('/:id',controller[_0x954f('0xb')]);router[_0x954f('0x6')]('/:id/logo',controller[_0x954f('0xc')]);router[_0x954f('0x6')](_0x954f('0xd'),controller[_0x954f('0xe')]);router[_0x954f('0x6')](_0x954f('0xf'),controller['gdpr']);router[_0x954f('0x6')](_0x954f('0x10'),controller[_0x954f('0x11')]);router[_0x954f('0x6')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x954f('0x12')]({'destination':function(_0x21900c,_0x554787,_0x1058a1){_0x1058a1(null,path['join'](config[_0x954f('0x13')],_0x954f('0x14')));},'filename':function(_0xdf2895,_0x46efc2,_0x5d1e00){_0x5d1e00(null,util[_0x954f('0x15')](_0x954f('0x16'),'logo',path[_0x954f('0x17')](_0x46efc2[_0x954f('0x18')])));}})});router[_0x954f('0x19')](_0x954f('0x1a'),upload['single'](_0x954f('0x1b')),controller[_0x954f('0x1c')]);var upload=multer({'storage':multer[_0x954f('0x12')]({'destination':function(_0xd864c7,_0x4f518e,_0x4fc86a){_0x4fc86a(null,path[_0x954f('0x1d')](config['root'],_0x954f('0x14')));},'filename':function(_0x36b04e,_0x247ee7,_0x2e04c8){_0x2e04c8(null,util[_0x954f('0x15')](_0x954f('0x16'),'logologin',path[_0x954f('0x17')](_0x247ee7[_0x954f('0x18')])));}})});router[_0x954f('0x19')](_0x954f('0xd'),upload[_0x954f('0x1e')](_0x954f('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x954f('0x12')]({'destination':function(_0x3c5259,_0x59d4e9,_0x408cc6){_0x408cc6(null,path[_0x954f('0x1d')](config['root'],_0x954f('0x14')));},'filename':function(_0x22b26d,_0x4354c9,_0x3f51a9){_0x3f51a9(null,util[_0x954f('0x15')](_0x954f('0x16'),'preferred',path[_0x954f('0x17')](_0x4354c9[_0x954f('0x18')])));}})});router[_0x954f('0x19')](_0x954f('0x10'),upload[_0x954f('0x1e')](_0x954f('0x1b')),controller[_0x954f('0x1f')]);var upload=multer({'storage':multer[_0x954f('0x12')]({'destination':function(_0x2abf69,_0x277d4d,_0x4b6d2a){_0x4b6d2a(null,path[_0x954f('0x1d')](config[_0x954f('0x13')],_0x954f('0x14')));},'filename':function(_0x30c079,_0x2da3ea,_0x1c125e){_0x1c125e(null,util[_0x954f('0x15')](_0x954f('0x16'),_0x954f('0x20'),path['extname'](_0x2da3ea[_0x954f('0x18')])));}})});router['post'](_0x954f('0x21'),upload[_0x954f('0x1e')](_0x954f('0x1b')),controller['addFavicon']);router[_0x954f('0x22')](_0x954f('0x23'),auth[_0x954f('0x7')](),controller[_0x954f('0x24')]);module['exports']=router;
\ No newline at end of file
+var _0x96b2=['getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo','logologin','originalname','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x96b2,0xf9));var _0x296b=function(_0x57b42b,_0x54f00a){_0x57b42b=_0x57b42b-0x0;var _0x33d9ea=_0x96b2[_0x57b42b];return _0x33d9ea;};'use strict';var multer=require(_0x296b('0x0'));var util=require(_0x296b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x296b('0x2')]();var fs_extra=require(_0x296b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x296b('0x4'));var config=require(_0x296b('0x5'));var controller=require(_0x296b('0x6'));router['get']('/',auth[_0x296b('0x7')](),controller['index']);router[_0x296b('0x8')](_0x296b('0x9'),controller[_0x296b('0xa')]);router[_0x296b('0x8')](_0x296b('0xb'),controller[_0x296b('0xc')]);router[_0x296b('0x8')](_0x296b('0xd'),controller[_0x296b('0xe')]);router[_0x296b('0x8')](_0x296b('0xf'),controller[_0x296b('0x10')]);router[_0x296b('0x8')](_0x296b('0x11'),controller[_0x296b('0x12')]);router[_0x296b('0x8')](_0x296b('0x13'),controller[_0x296b('0x14')]);router['get']('/:id/favicon',controller[_0x296b('0x15')]);var upload=multer({'storage':multer[_0x296b('0x16')]({'destination':function(_0x8df6d9,_0x44c668,_0x10626e){_0x10626e(null,path[_0x296b('0x17')](config[_0x296b('0x18')],_0x296b('0x19')));},'filename':function(_0x326f2e,_0x50f756,_0x5b5dcd){_0x5b5dcd(null,util[_0x296b('0x1a')](_0x296b('0x1b'),_0x296b('0x1c'),path[_0x296b('0x1d')](_0x50f756['originalname'])));}})});router[_0x296b('0x1e')](_0x296b('0xd'),upload[_0x296b('0x1f')](_0x296b('0x20')),controller[_0x296b('0x21')]);var upload=multer({'storage':multer[_0x296b('0x16')]({'destination':function(_0x53585a,_0xf06c56,_0x5b4550){_0x5b4550(null,path[_0x296b('0x17')](config['root'],_0x296b('0x19')));},'filename':function(_0x56c2df,_0x4f13a0,_0x5a1eea){_0x5a1eea(null,util[_0x296b('0x1a')](_0x296b('0x1b'),_0x296b('0x22'),path[_0x296b('0x1d')](_0x4f13a0[_0x296b('0x23')])));}})});router[_0x296b('0x1e')](_0x296b('0xf'),upload[_0x296b('0x1f')](_0x296b('0x20')),controller[_0x296b('0x24')]);var upload=multer({'storage':multer[_0x296b('0x16')]({'destination':function(_0x399e95,_0x3cdd07,_0x4b2b06){_0x4b2b06(null,path[_0x296b('0x17')](config[_0x296b('0x18')],'server/files/images/logos/'));},'filename':function(_0x3d97f1,_0x410704,_0x53c85e){_0x53c85e(null,util[_0x296b('0x1a')]('%s%s',_0x296b('0x25'),path[_0x296b('0x1d')](_0x410704[_0x296b('0x23')])));}})});router[_0x296b('0x1e')](_0x296b('0x13'),upload['single'](_0x296b('0x20')),controller[_0x296b('0x26')]);var upload=multer({'storage':multer[_0x296b('0x16')]({'destination':function(_0x392d6a,_0x117c0b,_0x5d1830){_0x5d1830(null,path[_0x296b('0x17')](config['root'],_0x296b('0x19')));},'filename':function(_0x49f339,_0x4d6b86,_0x49e49b){_0x49e49b(null,util['format']('%s%s',_0x296b('0x27'),path[_0x296b('0x1d')](_0x4d6b86['originalname'])));}})});router[_0x296b('0x1e')](_0x296b('0x28'),upload[_0x296b('0x1f')]('file'),controller[_0x296b('0x29')]);router[_0x296b('0x2a')](_0x296b('0xb'),auth[_0x296b('0x7')](),controller[_0x296b('0x2b')]);module[_0x296b('0x2c')]=router;
\ No newline at end of file
index 3862a4d..53d65fd 100644 (file)
@@ -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(_0x2cdae4,_0x10a0dd){var _0x4c9c67=function(_0x28320e){while(--_0x28320e){_0x2cdae4['push'](_0x2cdae4['shift']());}};_0x4c9c67(++_0x10a0dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0xaf6e05,_0x1adcc3){var _0x29c037=function(_0x51438f){while(--_0x51438f){_0xaf6e05['push'](_0xaf6e05['shift']());}};_0x29c037(++_0x1adcc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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
index 614c1cb..135b283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e6c=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','Setting','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','findAll','rows','show','rawAttributes','length','find','update','params','body','addLogo','file','filename','logo','loginLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','download','getLogoLogin','server/files/images/logos','defaultLogo','default_loginLogo.svg','\x20not\x20found','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x274394,_0x6fd912){var _0x2a2773=function(_0x2ab84c){while(--_0x2ab84c){_0x274394['push'](_0x274394['shift']());}};_0x2a2773(++_0x6fd912);}(_0x9e6c,0x1d5));var _0xc9e6=function(_0x479c88,_0x47e8c0){_0x479c88=_0x479c88-0x0;var _0x34b308=_0x9e6c[_0x479c88];return _0x34b308;};'use strict';var emlformat=require(_0xc9e6('0x0'));var rimraf=require(_0xc9e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9e6('0x2'));var rp=require('request-promise');var moment=require(_0xc9e6('0x3'));var BPromise=require(_0xc9e6('0x4'));var Mustache=require(_0xc9e6('0x5'));var util=require('util');var path=require(_0xc9e6('0x6'));var sox=require(_0xc9e6('0x7'));var csv=require('to-csv');var ejs=require(_0xc9e6('0x8'));var fs=require('fs');var fs_extra=require(_0xc9e6('0x9'));var _=require(_0xc9e6('0xa'));var squel=require(_0xc9e6('0xb'));var crypto=require(_0xc9e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc9e6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc9e6('0xe'));var Redis=require(_0xc9e6('0xf'));var authService=require(_0xc9e6('0x10'));var qs=require(_0xc9e6('0x11'));var as=require(_0xc9e6('0x12'));var hardwareService=require(_0xc9e6('0x13'));var logger=require(_0xc9e6('0x14'))('api');var utils=require(_0xc9e6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc9e6('0x16'));var db=require(_0xc9e6('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc9e6('0x18')][_0xc9e6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xac5ff7,_0x567317,_0x12a002,_0x499d6a){return new BPromise(function(_0x407fa4,_0x29c999){var _0x58fcaf=_0x499d6a||client;return _0x58fcaf[_0xc9e6('0x1a')](_0xac5ff7,_0x12a002)['then'](function(_0x83c9a7){logger[_0xc9e6('0x1b')](_0xc9e6('0x1c'),_0x567317,_0xc9e6('0x1d'));logger[_0xc9e6('0x1e')](_0xc9e6('0x1f'),_0x567317,'request\x20sent',JSON[_0xc9e6('0x20')](_0x83c9a7));if(_0x83c9a7['error']){if(_0x83c9a7[_0xc9e6('0x21')][_0xc9e6('0x22')]===0x1f4){logger['error'](_0xc9e6('0x1c'),_0x567317,_0x83c9a7[_0xc9e6('0x21')][_0xc9e6('0x23')]);return _0x29c999(_0x83c9a7['error'][_0xc9e6('0x23')]);}logger[_0xc9e6('0x21')](_0xc9e6('0x1c'),_0x567317,_0x83c9a7['error'][_0xc9e6('0x23')]);return _0x407fa4(_0x83c9a7['error'][_0xc9e6('0x23')]);}else{logger[_0xc9e6('0x1b')]('Setting,\x20%s,\x20%s',_0x567317,_0xc9e6('0x1d'));_0x407fa4(_0x83c9a7[_0xc9e6('0x24')][_0xc9e6('0x23')]);}})[_0xc9e6('0x25')](function(_0x254a16){logger[_0xc9e6('0x21')](_0xc9e6('0x1c'),_0x567317,_0x254a16);_0x29c999(_0x254a16);});});}function respondWithStatusCode(_0x34117b,_0x4b501e){_0x4b501e=_0x4b501e||0xcc;return function(_0x3ddd22){if(_0x3ddd22){return _0x34117b['sendStatus'](_0x4b501e);}return _0x34117b['status'](_0x4b501e)['end']();};}function respondWithResult(_0x1b7bba,_0x150dfe){_0x150dfe=_0x150dfe||0xc8;return function(_0x1896f8){if(_0x1896f8){return _0x1b7bba['status'](_0x150dfe)[_0xc9e6('0x26')](_0x1896f8);}};}function respondWithFilteredResult(_0x20526f,_0x366334){return function(_0x4399d4){if(_0x4399d4){var _0x4cffab=typeof _0x366334[_0xc9e6('0x27')]===_0xc9e6('0x28')&&typeof _0x366334[_0xc9e6('0x29')]===_0xc9e6('0x28');var _0x80a326=_0x4399d4[_0xc9e6('0x2a')];var _0x5037e0=_0x4cffab?0x0:_0x366334[_0xc9e6('0x27')];var _0x3513f3=_0x4cffab?_0x4399d4[_0xc9e6('0x2a')]:_0x366334[_0xc9e6('0x27')]+_0x366334['limit'];var _0x3fde6f;if(_0x3513f3>=_0x80a326){_0x3513f3=_0x80a326;_0x3fde6f=0xc8;}else{_0x3fde6f=0xce;}_0x20526f[_0xc9e6('0x2b')](_0x3fde6f);return _0x20526f[_0xc9e6('0x2c')](_0xc9e6('0x2d'),_0x5037e0+'-'+_0x3513f3+'/'+_0x80a326)[_0xc9e6('0x26')](_0x4399d4);}return null;};}function patchUpdates(_0x1323a1){return function(_0x238341){try{jsonpatch['apply'](_0x238341,_0x1323a1,!![]);}catch(_0x4ba2ea){return BPromise[_0xc9e6('0x2e')](_0x4ba2ea);}return _0x238341[_0xc9e6('0x2f')]();};}function saveUpdates(_0x1f8b4f,_0x2718b0){return function(_0x152099){if(_0x152099){return _0x152099['update'](_0x1f8b4f)[_0xc9e6('0x30')](function(_0x66ec91){return _0x66ec91;});}return null;};}function removeEntity(_0x37770c,_0x554c3e){return function(_0xf33204){if(_0xf33204){return _0xf33204[_0xc9e6('0x31')]()[_0xc9e6('0x30')](function(){_0x37770c[_0xc9e6('0x2b')](0xcc)[_0xc9e6('0x32')]();});}};}function handleEntityNotFound(_0x49bb3b,_0x5da85c){return function(_0x428255){if(!_0x428255){_0x49bb3b[_0xc9e6('0x33')](0x194);}return _0x428255;};}function handleError(_0x394910,_0xabf4fd){_0xabf4fd=_0xabf4fd||0x1f4;return function(_0x5c9b71){logger[_0xc9e6('0x21')](_0x5c9b71[_0xc9e6('0x34')]);if(_0x5c9b71[_0xc9e6('0x35')]){delete _0x5c9b71['name'];}_0x394910['status'](_0xabf4fd)[_0xc9e6('0x36')](_0x5c9b71);};}exports[_0xc9e6('0x37')]=function(_0x29fb1b,_0xc08a62){var _0x35c4e3={},_0xe14191={},_0xe5b522={'count':0x0,'rows':[]};var _0x3aa7b4=_[_0xc9e6('0x38')](db[_0xc9e6('0x39')]['rawAttributes'],function(_0x48e8fd){return{'name':_0x48e8fd[_0xc9e6('0x3a')],'type':_0x48e8fd['type'][_0xc9e6('0x3b')]};});_0xe14191['model']=_[_0xc9e6('0x38')](_0x3aa7b4,'name');_0xe14191[_0xc9e6('0x3c')]=_[_0xc9e6('0x3d')](_0x29fb1b[_0xc9e6('0x3c')]);_0xe14191[_0xc9e6('0x3e')]=_[_0xc9e6('0x3f')](_0xe14191[_0xc9e6('0x40')],_0xe14191[_0xc9e6('0x3c')]);_0x35c4e3['attributes']=_['intersection'](_0xe14191[_0xc9e6('0x40')],qs[_0xc9e6('0x41')](_0x29fb1b[_0xc9e6('0x3c')][_0xc9e6('0x41')]));_0x35c4e3[_0xc9e6('0x42')]=_0x35c4e3['attributes']['length']?_0x35c4e3[_0xc9e6('0x42')]:_0xe14191[_0xc9e6('0x40')];if(!_0x29fb1b[_0xc9e6('0x3c')][_0xc9e6('0x43')]('nolimit')){_0x35c4e3[_0xc9e6('0x29')]=qs[_0xc9e6('0x29')](_0x29fb1b['query']['limit']);_0x35c4e3[_0xc9e6('0x27')]=qs[_0xc9e6('0x27')](_0x29fb1b[_0xc9e6('0x3c')]['offset']);}_0x35c4e3[_0xc9e6('0x44')]=qs[_0xc9e6('0x45')](_0x29fb1b['query'][_0xc9e6('0x45')]);_0x35c4e3['where']=qs[_0xc9e6('0x3e')](_[_0xc9e6('0x46')](_0x29fb1b[_0xc9e6('0x3c')],_0xe14191[_0xc9e6('0x3e')]),_0x3aa7b4);if(_0x29fb1b[_0xc9e6('0x3c')][_0xc9e6('0x47')]){_0x35c4e3[_0xc9e6('0x48')]=_[_0xc9e6('0x49')](_0x35c4e3[_0xc9e6('0x48')],{'$or':_[_0xc9e6('0x38')](_0x3aa7b4,function(_0x362ef9){if(_0x362ef9['type']!=='VIRTUAL'){var _0x18ed22={};_0x18ed22[_0x362ef9[_0xc9e6('0x35')]]={'$like':'%'+_0x29fb1b[_0xc9e6('0x3c')][_0xc9e6('0x47')]+'%'};return _0x18ed22;}})});}_0x35c4e3=_[_0xc9e6('0x49')]({},_0x35c4e3,_0x29fb1b['options']);var _0x19f205={'where':_0x35c4e3[_0xc9e6('0x48')]};return db['Setting'][_0xc9e6('0x2a')](_0x19f205)[_0xc9e6('0x30')](function(_0x1ceb43){_0xe5b522[_0xc9e6('0x2a')]=_0x1ceb43;if(_0x29fb1b['query'][_0xc9e6('0x4a')]){_0x35c4e3['include']=[{'all':!![]}];}return db[_0xc9e6('0x39')][_0xc9e6('0x4b')](_0x35c4e3);})['then'](function(_0x425b48){_0xe5b522[_0xc9e6('0x4c')]=_0x425b48;return _0xe5b522;})[_0xc9e6('0x30')](respondWithFilteredResult(_0xc08a62,_0x35c4e3))[_0xc9e6('0x25')](handleError(_0xc08a62,null));};exports[_0xc9e6('0x4d')]=function(_0x5a5b76,_0xb4535a){var _0x3b1be7={'raw':![],'where':{'id':_0x5a5b76['params']['id']}},_0x2584dc={};_0x2584dc[_0xc9e6('0x40')]=_[_0xc9e6('0x3d')](db[_0xc9e6('0x39')][_0xc9e6('0x4e')]);_0x2584dc['query']=_['keys'](_0x5a5b76[_0xc9e6('0x3c')]);_0x2584dc[_0xc9e6('0x3e')]=_[_0xc9e6('0x3f')](_0x2584dc[_0xc9e6('0x40')],_0x2584dc[_0xc9e6('0x3c')]);_0x3b1be7[_0xc9e6('0x42')]=_[_0xc9e6('0x3f')](_0x2584dc[_0xc9e6('0x40')],qs['fields'](_0x5a5b76[_0xc9e6('0x3c')]['fields']));_0x3b1be7[_0xc9e6('0x42')]=_0x3b1be7[_0xc9e6('0x42')][_0xc9e6('0x4f')]?_0x3b1be7[_0xc9e6('0x42')]:_0x2584dc[_0xc9e6('0x40')];if(_0x5a5b76[_0xc9e6('0x3c')][_0xc9e6('0x4a')]){_0x3b1be7['include']=[{'all':!![]}];}_0x3b1be7=_[_0xc9e6('0x49')]({},_0x3b1be7,_0x5a5b76['options']);return db[_0xc9e6('0x39')][_0xc9e6('0x50')](_0x3b1be7)['then'](handleEntityNotFound(_0xb4535a,null))[_0xc9e6('0x30')](respondWithResult(_0xb4535a,null))['catch'](handleError(_0xb4535a,null));};exports[_0xc9e6('0x51')]=function(_0x4cf5f1,_0x3fa237){if(_0x4cf5f1['body']['id']){delete _0x4cf5f1['body']['id'];}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x4cf5f1[_0xc9e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x3fa237,null))[_0xc9e6('0x30')](saveUpdates(_0x4cf5f1[_0xc9e6('0x53')],null))[_0xc9e6('0x30')](respondWithResult(_0x3fa237,null))['catch'](handleError(_0x3fa237,null));};exports[_0xc9e6('0x54')]=function(_0x2ec56a,_0x3839d5,_0x1b77ce){if(_0x2ec56a[_0xc9e6('0x55')]&&_0x2ec56a['file'][_0xc9e6('0x56')]){_0x2ec56a[_0xc9e6('0x53')][_0xc9e6('0x57')]=_0x2ec56a[_0xc9e6('0x55')][_0xc9e6('0x56')];}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x2ec56a[_0xc9e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x3839d5,null))[_0xc9e6('0x30')](saveUpdates(_0x2ec56a[_0xc9e6('0x53')],null))[_0xc9e6('0x30')](respondWithResult(_0x3839d5,null))[_0xc9e6('0x25')](handleError(_0x3839d5,null));};exports['addLogoLogin']=function(_0x268e05,_0x524de5,_0x55a17b){if(_0x268e05[_0xc9e6('0x55')]&&_0x268e05['file']['filename']){_0x268e05[_0xc9e6('0x53')][_0xc9e6('0x58')]=_0x268e05[_0xc9e6('0x55')][_0xc9e6('0x56')];}return db[_0xc9e6('0x39')]['find']({'where':{'id':_0x268e05[_0xc9e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x524de5,null))['then'](saveUpdates(_0x268e05[_0xc9e6('0x53')],null))[_0xc9e6('0x30')](respondWithResult(_0x524de5,null))[_0xc9e6('0x25')](handleError(_0x524de5,null));};var utilLicense=require(_0xc9e6('0x16'));exports['getLogo']=function(_0x367fa2,_0x5773db,_0x31b0bd){var _0x11de0a='server/files/images/logos';var _0x53fdfd={'custom':![]};return utilLicense[_0xc9e6('0x59')]()['then'](function(_0x11435d){if(_0x11435d){_0x53fdfd=_0x11435d;}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x367fa2[_0xc9e6('0x52')]['id']},'attributes':[_0xc9e6('0x57'),_0xc9e6('0x58'),_0xc9e6('0x5a'),_0xc9e6('0x5b'),'defaultLogo',_0xc9e6('0x5c'),_0xc9e6('0x5d'),_0xc9e6('0x5e')],'raw':!![]});})[_0xc9e6('0x30')](handleEntityNotFound(_0x5773db,null))[_0xc9e6('0x30')](function(_0x15e156){if(_0x15e156){var _0x331005=_0x15e156[_0xc9e6('0x57')]&&fs[_0xc9e6('0x5f')](path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x11de0a,_[_0xc9e6('0x62')](_0x15e156[_0xc9e6('0x57')])))?path[_0xc9e6('0x60')](config['root'],_0x11de0a,_[_0xc9e6('0x62')](_0x15e156['logo'])):path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x11de0a,_[_0xc9e6('0x62')](_0xc9e6('0x63')));var _0x515def=_0xc9e6('0x64')+_['upperFirst'](_0xc9e6('0x57'));if(_0x15e156[_0x515def]||!_0x53fdfd[_0xc9e6('0x65')]){_0x331005=path[_0xc9e6('0x60')](config['root'],_0x11de0a,_[_0xc9e6('0x62')](_0xc9e6('0x63')));}if(!fs[_0xc9e6('0x5f')](_0x331005)){throw new db[(_0xc9e6('0x66'))][(_0xc9e6('0x67'))](_[_0xc9e6('0x68')]('logo')+'\x20not\x20found');}return _0x5773db[_0xc9e6('0x69')](_0x331005);}})[_0xc9e6('0x25')](handleError(_0x5773db,null));};var utilLicense=require(_0xc9e6('0x16'));exports[_0xc9e6('0x6a')]=function(_0x56ed7d,_0x48439b,_0x1bc923){var _0x19042b=_0xc9e6('0x6b');var _0x36d90b={'custom':![]};return utilLicense[_0xc9e6('0x59')]()[_0xc9e6('0x30')](function(_0x108268){if(_0x108268){_0x36d90b=_0x108268;}return db[_0xc9e6('0x39')]['find']({'where':{'id':_0x56ed7d[_0xc9e6('0x52')]['id']},'attributes':[_0xc9e6('0x57'),_0xc9e6('0x58'),_0xc9e6('0x5a'),'favicon',_0xc9e6('0x6c'),_0xc9e6('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc9e6('0x30')](handleEntityNotFound(_0x48439b,null))[_0xc9e6('0x30')](function(_0x46ca36){if(_0x46ca36){var _0x4c7145=_0x46ca36['loginLogo']&&fs[_0xc9e6('0x5f')](path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x19042b,_['toLower'](_0x46ca36[_0xc9e6('0x58')])))?path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x19042b,_[_0xc9e6('0x62')](_0x46ca36[_0xc9e6('0x58')])):path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x19042b,_['toLower'](_0xc9e6('0x6d')));var _0x58123e='default'+_[_0xc9e6('0x68')](_0xc9e6('0x58'));if(_0x46ca36[_0x58123e]||!_0x36d90b[_0xc9e6('0x65')]){_0x4c7145=path[_0xc9e6('0x60')](config['root'],_0x19042b,_[_0xc9e6('0x62')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x4c7145)){throw new db[(_0xc9e6('0x66'))][(_0xc9e6('0x67'))](_[_0xc9e6('0x68')]('loginLogo')+_0xc9e6('0x6e'));}return _0x48439b[_0xc9e6('0x69')](_0x4c7145);}})[_0xc9e6('0x25')](handleError(_0x48439b,null));};exports['gdpr']=function(_0x4d58ac,_0x39a959){return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x4d58ac[_0xc9e6('0x52')]['id']},'attributes':[_0xc9e6('0x6f')]})[_0xc9e6('0x30')](respondWithResult(_0x39a959,null))[_0xc9e6('0x25')](handleError(_0x39a959,null));};exports[_0xc9e6('0x70')]=function(_0x4ee3ae,_0x3b8cc5,_0x40884b){if(_0x4ee3ae[_0xc9e6('0x55')]&&_0x4ee3ae[_0xc9e6('0x55')][_0xc9e6('0x56')]){_0x4ee3ae[_0xc9e6('0x53')]['preferred']=_0x4ee3ae[_0xc9e6('0x55')][_0xc9e6('0x56')];}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x4ee3ae[_0xc9e6('0x52')]['id']}})[_0xc9e6('0x30')](handleEntityNotFound(_0x3b8cc5,null))[_0xc9e6('0x30')](saveUpdates(_0x4ee3ae['body'],null))[_0xc9e6('0x30')](respondWithResult(_0x3b8cc5,null))[_0xc9e6('0x25')](handleError(_0x3b8cc5,null));};var utilLicense=require(_0xc9e6('0x16'));exports[_0xc9e6('0x71')]=function(_0x4b1a03,_0x4737e3,_0x26073f){var _0x2fc967='server/files/images/logos';var _0x57df7a={'custom':![]};return utilLicense[_0xc9e6('0x59')]()[_0xc9e6('0x30')](function(_0x195080){if(_0x195080){_0x57df7a=_0x195080;}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x4b1a03[_0xc9e6('0x52')]['id']},'attributes':[_0xc9e6('0x57'),_0xc9e6('0x58'),_0xc9e6('0x5a'),'favicon',_0xc9e6('0x6c'),_0xc9e6('0x5c'),_0xc9e6('0x5d'),_0xc9e6('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x4737e3,null))['then'](function(_0x2e0347){if(_0x2e0347){var _0x1e933c=_0x2e0347[_0xc9e6('0x5a')]&&fs[_0xc9e6('0x5f')](path[_0xc9e6('0x60')](config['root'],_0x2fc967,_[_0xc9e6('0x62')](_0x2e0347[_0xc9e6('0x5a')])))?path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x2fc967,_['toLower'](_0x2e0347['preferred'])):path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x2fc967,_[_0xc9e6('0x62')]('default_preferred.png'));var _0x2013ea=_0xc9e6('0x64')+_[_0xc9e6('0x68')](_0xc9e6('0x5a'));if(_0x2e0347[_0x2013ea]||!_0x57df7a[_0xc9e6('0x65')]||!_0x57df7a[_0xc9e6('0x5a')]){_0x1e933c=path[_0xc9e6('0x60')](config['root'],_0x2fc967,_[_0xc9e6('0x62')](_0xc9e6('0x72')));}if(!fs[_0xc9e6('0x5f')](_0x1e933c)){throw new db[(_0xc9e6('0x66'))]['ValidationError'](_[_0xc9e6('0x68')](_0xc9e6('0x5a'))+'\x20not\x20found');}return _0x4737e3['download'](_0x1e933c);}})[_0xc9e6('0x25')](handleError(_0x4737e3,null));};exports[_0xc9e6('0x73')]=function(_0x4bd09f,_0x4ebc09,_0x404314){if(_0x4bd09f[_0xc9e6('0x55')]&&_0x4bd09f[_0xc9e6('0x55')]['filename']){_0x4bd09f[_0xc9e6('0x53')][_0xc9e6('0x5b')]=_0x4bd09f[_0xc9e6('0x55')][_0xc9e6('0x56')];}return db['Setting'][_0xc9e6('0x50')]({'where':{'id':_0x4bd09f[_0xc9e6('0x52')]['id']}})[_0xc9e6('0x30')](handleEntityNotFound(_0x4ebc09,null))[_0xc9e6('0x30')](saveUpdates(_0x4bd09f[_0xc9e6('0x53')],null))[_0xc9e6('0x30')](respondWithResult(_0x4ebc09,null))[_0xc9e6('0x25')](handleError(_0x4ebc09,null));};var utilLicense=require(_0xc9e6('0x16'));exports[_0xc9e6('0x74')]=function(_0x3cfca1,_0x1d9770,_0x23d28d){var _0x6aa4b7='server/files/images/logos';var _0x862f62={'custom':![]};return utilLicense[_0xc9e6('0x59')]()[_0xc9e6('0x30')](function(_0xca1ea6){if(_0xca1ea6){_0x862f62=_0xca1ea6;}return db[_0xc9e6('0x39')][_0xc9e6('0x50')]({'where':{'id':_0x3cfca1['params']['id']},'attributes':[_0xc9e6('0x57'),_0xc9e6('0x58'),_0xc9e6('0x5a'),'favicon',_0xc9e6('0x6c'),'defaultLoginLogo',_0xc9e6('0x5d'),_0xc9e6('0x5e')],'raw':!![]});})[_0xc9e6('0x30')](handleEntityNotFound(_0x1d9770,null))['then'](function(_0x30f775){if(_0x30f775){var _0x3ad212=_0x30f775['favicon']&&fs['existsSync'](path['join'](config[_0xc9e6('0x61')],_0x6aa4b7,_['toLower'](_0x30f775[_0xc9e6('0x5b')])))?path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x6aa4b7,_[_0xc9e6('0x62')](_0x30f775[_0xc9e6('0x5b')])):path[_0xc9e6('0x60')](config[_0xc9e6('0x61')],_0x6aa4b7,_['toLower']('default_favicon.ico'));var _0x1d9562='default'+_[_0xc9e6('0x68')](_0xc9e6('0x5b'));if(_0x30f775[_0x1d9562]||!_0x862f62[_0xc9e6('0x65')]){_0x3ad212=path['join'](config[_0xc9e6('0x61')],_0x6aa4b7,_[_0xc9e6('0x62')](_0xc9e6('0x75')));}if(!fs['existsSync'](_0x3ad212)){throw new db['Sequelize'][(_0xc9e6('0x67'))](_['upperFirst'](_0xc9e6('0x5b'))+_0xc9e6('0x6e'));}return _0x1d9770['download'](_0x3ad212);}})[_0xc9e6('0x25')](handleError(_0x1d9770,null));};exports[_0xc9e6('0x76')]=function(_0x569908,_0x10174a){var _0x176c5e={'offset':moment()[_0xc9e6('0x77')]()};_0x176c5e['now']=moment()[_0xc9e6('0x77')](_0x176c5e[_0xc9e6('0x27')])[_0xc9e6('0x78')](_0xc9e6('0x79'));return _0x10174a[_0xc9e6('0x2b')](0xc8)['send'](_0x176c5e);};
\ No newline at end of file
+var _0xa22a=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','set','apply','reject','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','count','includeAll','findAll','show','include','options','find','body','addLogo','file','filename','logo','params','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','\x20not\x20found','gdpr','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x479131,_0x2828f4){var _0x28e996=function(_0xc3890d){while(--_0xc3890d){_0x479131['push'](_0x479131['shift']());}};_0x28e996(++_0x2828f4);}(_0xa22a,0x153));var _0xaa22=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa22a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xaa22('0x0'));var rimraf=require(_0xaa22('0x1'));var zipdir=require(_0xaa22('0x2'));var jsonpatch=require(_0xaa22('0x3'));var rp=require(_0xaa22('0x4'));var moment=require('moment');var BPromise=require(_0xaa22('0x5'));var Mustache=require(_0xaa22('0x6'));var util=require(_0xaa22('0x7'));var path=require(_0xaa22('0x8'));var sox=require(_0xaa22('0x9'));var csv=require(_0xaa22('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa22('0xb'));var _=require('lodash');var squel=require(_0xaa22('0xc'));var crypto=require(_0xaa22('0xd'));var jsforce=require(_0xaa22('0xe'));var deskjs=require(_0xaa22('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaa22('0x10'));var Papa=require('papaparse');var Redis=require(_0xaa22('0x11'));var authService=require(_0xaa22('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaa22('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa22('0x14'));var utils=require('../../config/utils');var config=require(_0xaa22('0x15'));var licenseUtil=require(_0xaa22('0x16'));var db=require(_0xaa22('0x17'))['db'];var jayson=require(_0xaa22('0x18'));var client=jayson[_0xaa22('0x19')][_0xaa22('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x82ec35,_0x2e2c54,_0x336004,_0x2c5e93){return new BPromise(function(_0x503777,_0x27416a){var _0x29498e=_0x2c5e93||client;return _0x29498e[_0xaa22('0x1b')](_0x82ec35,_0x336004)[_0xaa22('0x1c')](function(_0x1c56d3){logger[_0xaa22('0x1d')]('Setting,\x20%s,\x20%s',_0x2e2c54,'request\x20sent');logger[_0xaa22('0x1e')](_0xaa22('0x1f'),_0x2e2c54,_0xaa22('0x20'),JSON[_0xaa22('0x21')](_0x1c56d3));if(_0x1c56d3[_0xaa22('0x22')]){if(_0x1c56d3[_0xaa22('0x22')]['code']===0x1f4){logger['error'](_0xaa22('0x23'),_0x2e2c54,_0x1c56d3[_0xaa22('0x22')][_0xaa22('0x24')]);return _0x27416a(_0x1c56d3[_0xaa22('0x22')][_0xaa22('0x24')]);}logger[_0xaa22('0x22')](_0xaa22('0x23'),_0x2e2c54,_0x1c56d3[_0xaa22('0x22')][_0xaa22('0x24')]);return _0x503777(_0x1c56d3[_0xaa22('0x22')][_0xaa22('0x24')]);}else{logger[_0xaa22('0x1d')](_0xaa22('0x23'),_0x2e2c54,_0xaa22('0x20'));_0x503777(_0x1c56d3[_0xaa22('0x25')]['message']);}})[_0xaa22('0x26')](function(_0x21fe77){logger[_0xaa22('0x22')](_0xaa22('0x23'),_0x2e2c54,_0x21fe77);_0x27416a(_0x21fe77);});});}function respondWithStatusCode(_0x343f81,_0x15f08e){_0x15f08e=_0x15f08e||0xcc;return function(_0x839391){if(_0x839391){return _0x343f81[_0xaa22('0x27')](_0x15f08e);}return _0x343f81[_0xaa22('0x28')](_0x15f08e)[_0xaa22('0x29')]();};}function respondWithResult(_0x8cf435,_0x14944f){_0x14944f=_0x14944f||0xc8;return function(_0x2b88b8){if(_0x2b88b8){return _0x8cf435[_0xaa22('0x28')](_0x14944f)['json'](_0x2b88b8);}};}function respondWithFilteredResult(_0x3e8608,_0x4375ac){return function(_0x50a35e){if(_0x50a35e){var _0x50dabd=typeof _0x4375ac[_0xaa22('0x2a')]==='undefined'&&typeof _0x4375ac[_0xaa22('0x2b')]===_0xaa22('0x2c');var _0x5e4681=_0x50a35e['count'];var _0x97edb4=_0x50dabd?0x0:_0x4375ac['offset'];var _0x1ed9c6=_0x50dabd?_0x50a35e['count']:_0x4375ac['offset']+_0x4375ac[_0xaa22('0x2b')];var _0x5d5c59;if(_0x1ed9c6>=_0x5e4681){_0x1ed9c6=_0x5e4681;_0x5d5c59=0xc8;}else{_0x5d5c59=0xce;}_0x3e8608['status'](_0x5d5c59);return _0x3e8608[_0xaa22('0x2d')]('Content-Range',_0x97edb4+'-'+_0x1ed9c6+'/'+_0x5e4681)['json'](_0x50a35e);}return null;};}function patchUpdates(_0x47eee2){return function(_0x2bf7e2){try{jsonpatch[_0xaa22('0x2e')](_0x2bf7e2,_0x47eee2,!![]);}catch(_0x58b829){return BPromise[_0xaa22('0x2f')](_0x58b829);}return _0x2bf7e2['save']();};}function saveUpdates(_0x5bf0dc,_0x3d7812){return function(_0x39e50){if(_0x39e50){return _0x39e50[_0xaa22('0x30')](_0x5bf0dc)[_0xaa22('0x1c')](function(_0x14794f){return _0x14794f;});}return null;};}function removeEntity(_0x3fc075,_0x487ad2){return function(_0x338ae){if(_0x338ae){return _0x338ae[_0xaa22('0x31')]()[_0xaa22('0x1c')](function(){_0x3fc075[_0xaa22('0x28')](0xcc)[_0xaa22('0x29')]();});}};}function handleEntityNotFound(_0x3100d8,_0x2407bd){return function(_0x402650){if(!_0x402650){_0x3100d8['sendStatus'](0x194);}return _0x402650;};}function handleError(_0x5ad05a,_0x11e59a){_0x11e59a=_0x11e59a||0x1f4;return function(_0x560c0a){logger[_0xaa22('0x22')](_0x560c0a[_0xaa22('0x32')]);if(_0x560c0a[_0xaa22('0x33')]){delete _0x560c0a[_0xaa22('0x33')];}_0x5ad05a[_0xaa22('0x28')](_0x11e59a)[_0xaa22('0x34')](_0x560c0a);};}exports[_0xaa22('0x35')]=function(_0x111fc1,_0x45dc6f){var _0xe581a={},_0xbaf6c1={},_0x4e69de={'count':0x0,'rows':[]};var _0x3094a0=_[_0xaa22('0x36')](db[_0xaa22('0x37')][_0xaa22('0x38')],function(_0x414cdb){return{'name':_0x414cdb[_0xaa22('0x39')],'type':_0x414cdb[_0xaa22('0x3a')][_0xaa22('0x3b')]};});_0xbaf6c1[_0xaa22('0x3c')]=_['map'](_0x3094a0,_0xaa22('0x33'));_0xbaf6c1['query']=_[_0xaa22('0x3d')](_0x111fc1[_0xaa22('0x3e')]);_0xbaf6c1['filters']=_['intersection'](_0xbaf6c1[_0xaa22('0x3c')],_0xbaf6c1[_0xaa22('0x3e')]);_0xe581a[_0xaa22('0x3f')]=_[_0xaa22('0x40')](_0xbaf6c1[_0xaa22('0x3c')],qs[_0xaa22('0x41')](_0x111fc1['query']['fields']));_0xe581a[_0xaa22('0x3f')]=_0xe581a['attributes'][_0xaa22('0x42')]?_0xe581a[_0xaa22('0x3f')]:_0xbaf6c1[_0xaa22('0x3c')];if(!_0x111fc1['query']['hasOwnProperty'](_0xaa22('0x43'))){_0xe581a[_0xaa22('0x2b')]=qs[_0xaa22('0x2b')](_0x111fc1[_0xaa22('0x3e')][_0xaa22('0x2b')]);_0xe581a[_0xaa22('0x2a')]=qs[_0xaa22('0x2a')](_0x111fc1['query'][_0xaa22('0x2a')]);}_0xe581a['order']=qs[_0xaa22('0x44')](_0x111fc1['query'][_0xaa22('0x44')]);_0xe581a[_0xaa22('0x45')]=qs[_0xaa22('0x46')](_['pick'](_0x111fc1[_0xaa22('0x3e')],_0xbaf6c1['filters']),_0x3094a0);if(_0x111fc1[_0xaa22('0x3e')][_0xaa22('0x47')]){_0xe581a[_0xaa22('0x45')]=_[_0xaa22('0x48')](_0xe581a['where'],{'$or':_[_0xaa22('0x36')](_0x3094a0,function(_0x4565ea){if(_0x4565ea[_0xaa22('0x3a')]!=='VIRTUAL'){var _0x370bb6={};_0x370bb6[_0x4565ea[_0xaa22('0x33')]]={'$like':'%'+_0x111fc1[_0xaa22('0x3e')][_0xaa22('0x47')]+'%'};return _0x370bb6;}})});}_0xe581a=_[_0xaa22('0x48')]({},_0xe581a,_0x111fc1['options']);var _0x41c196={'where':_0xe581a['where']};return db['Setting'][_0xaa22('0x49')](_0x41c196)[_0xaa22('0x1c')](function(_0x52ab54){_0x4e69de[_0xaa22('0x49')]=_0x52ab54;if(_0x111fc1[_0xaa22('0x3e')][_0xaa22('0x4a')]){_0xe581a['include']=[{'all':!![]}];}return db[_0xaa22('0x37')][_0xaa22('0x4b')](_0xe581a);})[_0xaa22('0x1c')](function(_0x2e8390){_0x4e69de['rows']=_0x2e8390;return _0x4e69de;})['then'](respondWithFilteredResult(_0x45dc6f,_0xe581a))[_0xaa22('0x26')](handleError(_0x45dc6f,null));};exports[_0xaa22('0x4c')]=function(_0x265976,_0x5483a9){var _0x226c5d={'raw':![],'where':{'id':_0x265976['params']['id']}},_0x2dd976={};_0x2dd976[_0xaa22('0x3c')]=_[_0xaa22('0x3d')](db[_0xaa22('0x37')][_0xaa22('0x38')]);_0x2dd976[_0xaa22('0x3e')]=_['keys'](_0x265976[_0xaa22('0x3e')]);_0x2dd976['filters']=_[_0xaa22('0x40')](_0x2dd976[_0xaa22('0x3c')],_0x2dd976[_0xaa22('0x3e')]);_0x226c5d[_0xaa22('0x3f')]=_['intersection'](_0x2dd976[_0xaa22('0x3c')],qs[_0xaa22('0x41')](_0x265976[_0xaa22('0x3e')][_0xaa22('0x41')]));_0x226c5d[_0xaa22('0x3f')]=_0x226c5d[_0xaa22('0x3f')]['length']?_0x226c5d[_0xaa22('0x3f')]:_0x2dd976['model'];if(_0x265976[_0xaa22('0x3e')][_0xaa22('0x4a')]){_0x226c5d[_0xaa22('0x4d')]=[{'all':!![]}];}_0x226c5d=_['merge']({},_0x226c5d,_0x265976[_0xaa22('0x4e')]);return db[_0xaa22('0x37')][_0xaa22('0x4f')](_0x226c5d)['then'](handleEntityNotFound(_0x5483a9,null))[_0xaa22('0x1c')](respondWithResult(_0x5483a9,null))[_0xaa22('0x26')](handleError(_0x5483a9,null));};exports['update']=function(_0xac53eb,_0xa06582){if(_0xac53eb[_0xaa22('0x50')]['id']){delete _0xac53eb[_0xaa22('0x50')]['id'];}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0xac53eb['params']['id']}})[_0xaa22('0x1c')](handleEntityNotFound(_0xa06582,null))[_0xaa22('0x1c')](saveUpdates(_0xac53eb['body'],null))[_0xaa22('0x1c')](respondWithResult(_0xa06582,null))['catch'](handleError(_0xa06582,null));};exports[_0xaa22('0x51')]=function(_0x2263f6,_0xbe3e4f,_0x347a98){if(_0x2263f6[_0xaa22('0x52')]&&_0x2263f6[_0xaa22('0x52')][_0xaa22('0x53')]){_0x2263f6['body'][_0xaa22('0x54')]=_0x2263f6['file'][_0xaa22('0x53')];}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x2263f6[_0xaa22('0x55')]['id']}})[_0xaa22('0x1c')](handleEntityNotFound(_0xbe3e4f,null))[_0xaa22('0x1c')](saveUpdates(_0x2263f6['body'],null))[_0xaa22('0x1c')](respondWithResult(_0xbe3e4f,null))['catch'](handleError(_0xbe3e4f,null));};exports[_0xaa22('0x56')]=function(_0x4a19bc,_0x1ba79e,_0x409d14){if(_0x4a19bc[_0xaa22('0x52')]&&_0x4a19bc[_0xaa22('0x52')][_0xaa22('0x53')]){_0x4a19bc[_0xaa22('0x50')][_0xaa22('0x57')]=_0x4a19bc[_0xaa22('0x52')][_0xaa22('0x53')];}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x4a19bc[_0xaa22('0x55')]['id']}})[_0xaa22('0x1c')](handleEntityNotFound(_0x1ba79e,null))['then'](saveUpdates(_0x4a19bc[_0xaa22('0x50')],null))[_0xaa22('0x1c')](respondWithResult(_0x1ba79e,null))[_0xaa22('0x26')](handleError(_0x1ba79e,null));};var utilLicense=require(_0xaa22('0x16'));exports['getLogo']=function(_0x5049b2,_0x214209,_0x682de1){var _0x23d20c=_0xaa22('0x58');var _0x40d23f={'custom':![]};return utilLicense[_0xaa22('0x59')]()[_0xaa22('0x1c')](function(_0x3c6aac){if(_0x3c6aac){_0x40d23f=_0x3c6aac;}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x5049b2[_0xaa22('0x55')]['id']},'attributes':['logo',_0xaa22('0x57'),_0xaa22('0x5a'),_0xaa22('0x5b'),_0xaa22('0x5c'),_0xaa22('0x5d'),'defaultPreferred',_0xaa22('0x5e')],'raw':!![]});})[_0xaa22('0x1c')](handleEntityNotFound(_0x214209,null))['then'](function(_0x5b704b){if(_0x5b704b){var _0x480f37=_0x5b704b[_0xaa22('0x54')]&&fs[_0xaa22('0x5f')](path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x23d20c,_['toLower'](_0x5b704b[_0xaa22('0x54')])))?path['join'](config[_0xaa22('0x61')],_0x23d20c,_['toLower'](_0x5b704b[_0xaa22('0x54')])):path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x23d20c,_[_0xaa22('0x62')](_0xaa22('0x63')));var _0x4c0f92=_0xaa22('0x64')+_[_0xaa22('0x65')](_0xaa22('0x54'));if(_0x5b704b[_0x4c0f92]||!_0x40d23f[_0xaa22('0x66')]){_0x480f37=path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x23d20c,_[_0xaa22('0x62')](_0xaa22('0x63')));}if(!fs['existsSync'](_0x480f37)){throw new db[(_0xaa22('0x67'))][(_0xaa22('0x68'))](_[_0xaa22('0x65')](_0xaa22('0x54'))+'\x20not\x20found');}return _0x214209[_0xaa22('0x69')](_0x480f37);}})[_0xaa22('0x26')](handleError(_0x214209,null));};var utilLicense=require('../../config/license/util');exports[_0xaa22('0x6a')]=function(_0x3ad2a9,_0x438742,_0x5085d9){var _0x2e7bdb='server/files/images/logos';var _0x55b381={'custom':![]};return utilLicense[_0xaa22('0x59')]()[_0xaa22('0x1c')](function(_0x556f8f){if(_0x556f8f){_0x55b381=_0x556f8f;}return db['Setting']['find']({'where':{'id':_0x3ad2a9[_0xaa22('0x55')]['id']},'attributes':[_0xaa22('0x54'),_0xaa22('0x57'),'preferred',_0xaa22('0x5b'),_0xaa22('0x5c'),_0xaa22('0x5d'),'defaultPreferred',_0xaa22('0x5e')],'raw':!![]});})[_0xaa22('0x1c')](handleEntityNotFound(_0x438742,null))[_0xaa22('0x1c')](function(_0x333f0e){if(_0x333f0e){var _0x5ddd6a=_0x333f0e[_0xaa22('0x57')]&&fs[_0xaa22('0x5f')](path[_0xaa22('0x60')](config['root'],_0x2e7bdb,_[_0xaa22('0x62')](_0x333f0e['loginLogo'])))?path[_0xaa22('0x60')](config['root'],_0x2e7bdb,_[_0xaa22('0x62')](_0x333f0e[_0xaa22('0x57')])):path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x2e7bdb,_['toLower']('default_loginLogo.svg'));var _0x49d06c=_0xaa22('0x64')+_[_0xaa22('0x65')](_0xaa22('0x57'));if(_0x333f0e[_0x49d06c]||!_0x55b381[_0xaa22('0x66')]){_0x5ddd6a=path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x2e7bdb,_[_0xaa22('0x62')]('default_loginLogo.svg'));}if(!fs[_0xaa22('0x5f')](_0x5ddd6a)){throw new db['Sequelize'][(_0xaa22('0x68'))](_[_0xaa22('0x65')](_0xaa22('0x57'))+_0xaa22('0x6b'));}return _0x438742['download'](_0x5ddd6a);}})[_0xaa22('0x26')](handleError(_0x438742,null));};exports[_0xaa22('0x6c')]=function(_0x5eb0a3,_0x247cc7){return db['Setting'][_0xaa22('0x4f')]({'where':{'id':_0x5eb0a3[_0xaa22('0x55')]['id']},'attributes':['securePassword']})[_0xaa22('0x1c')](respondWithResult(_0x247cc7,null))['catch'](handleError(_0x247cc7,null));};exports[_0xaa22('0x6d')]=function(_0x1f9194,_0x2451ff,_0x4a6f0d){if(_0x1f9194['file']&&_0x1f9194[_0xaa22('0x52')][_0xaa22('0x53')]){_0x1f9194[_0xaa22('0x50')][_0xaa22('0x5a')]=_0x1f9194[_0xaa22('0x52')][_0xaa22('0x53')];}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x1f9194[_0xaa22('0x55')]['id']}})['then'](handleEntityNotFound(_0x2451ff,null))['then'](saveUpdates(_0x1f9194[_0xaa22('0x50')],null))[_0xaa22('0x1c')](respondWithResult(_0x2451ff,null))[_0xaa22('0x26')](handleError(_0x2451ff,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x5b7825,_0x3d4246,_0x24764c){var _0x150f59='server/files/images/logos';var _0xe49425={'custom':![]};return utilLicense[_0xaa22('0x59')]()['then'](function(_0x110bcb){if(_0x110bcb){_0xe49425=_0x110bcb;}return db[_0xaa22('0x37')]['find']({'where':{'id':_0x5b7825[_0xaa22('0x55')]['id']},'attributes':[_0xaa22('0x54'),'loginLogo',_0xaa22('0x5a'),_0xaa22('0x5b'),_0xaa22('0x5c'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3d4246,null))[_0xaa22('0x1c')](function(_0x2ad7ec){if(_0x2ad7ec){var _0x4921e4=_0x2ad7ec[_0xaa22('0x5a')]&&fs[_0xaa22('0x5f')](path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x150f59,_[_0xaa22('0x62')](_0x2ad7ec[_0xaa22('0x5a')])))?path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x150f59,_[_0xaa22('0x62')](_0x2ad7ec[_0xaa22('0x5a')])):path[_0xaa22('0x60')](config['root'],_0x150f59,_[_0xaa22('0x62')](_0xaa22('0x6e')));var _0x196a4f=_0xaa22('0x64')+_[_0xaa22('0x65')](_0xaa22('0x5a'));if(_0x2ad7ec[_0x196a4f]||!_0xe49425[_0xaa22('0x66')]||!_0xe49425['preferred']){_0x4921e4=path['join'](config[_0xaa22('0x61')],_0x150f59,_[_0xaa22('0x62')](_0xaa22('0x6e')));}if(!fs['existsSync'](_0x4921e4)){throw new db[(_0xaa22('0x67'))][(_0xaa22('0x68'))](_[_0xaa22('0x65')](_0xaa22('0x5a'))+_0xaa22('0x6b'));}return _0x3d4246[_0xaa22('0x69')](_0x4921e4);}})[_0xaa22('0x26')](handleError(_0x3d4246,null));};exports[_0xaa22('0x6f')]=function(_0x39bfc8,_0x48f710,_0x5329d2){if(_0x39bfc8[_0xaa22('0x52')]&&_0x39bfc8[_0xaa22('0x52')][_0xaa22('0x53')]){_0x39bfc8[_0xaa22('0x50')][_0xaa22('0x5b')]=_0x39bfc8[_0xaa22('0x52')][_0xaa22('0x53')];}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x39bfc8[_0xaa22('0x55')]['id']}})[_0xaa22('0x1c')](handleEntityNotFound(_0x48f710,null))[_0xaa22('0x1c')](saveUpdates(_0x39bfc8[_0xaa22('0x50')],null))[_0xaa22('0x1c')](respondWithResult(_0x48f710,null))[_0xaa22('0x26')](handleError(_0x48f710,null));};var utilLicense=require(_0xaa22('0x16'));exports[_0xaa22('0x70')]=function(_0x3215d6,_0x510828,_0x291a41){var _0x250938=_0xaa22('0x58');var _0xa76917={'custom':![]};return utilLicense[_0xaa22('0x59')]()['then'](function(_0xd381a0){if(_0xd381a0){_0xa76917=_0xd381a0;}return db[_0xaa22('0x37')][_0xaa22('0x4f')]({'where':{'id':_0x3215d6[_0xaa22('0x55')]['id']},'attributes':[_0xaa22('0x54'),_0xaa22('0x57'),_0xaa22('0x5a'),_0xaa22('0x5b'),_0xaa22('0x5c'),'defaultLoginLogo','defaultPreferred',_0xaa22('0x5e')],'raw':!![]});})[_0xaa22('0x1c')](handleEntityNotFound(_0x510828,null))[_0xaa22('0x1c')](function(_0x4efe2e){if(_0x4efe2e){var _0x423d38=_0x4efe2e['favicon']&&fs[_0xaa22('0x5f')](path[_0xaa22('0x60')](config['root'],_0x250938,_['toLower'](_0x4efe2e['favicon'])))?path[_0xaa22('0x60')](config['root'],_0x250938,_[_0xaa22('0x62')](_0x4efe2e[_0xaa22('0x5b')])):path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x250938,_['toLower'](_0xaa22('0x71')));var _0x17068c=_0xaa22('0x64')+_[_0xaa22('0x65')](_0xaa22('0x5b'));if(_0x4efe2e[_0x17068c]||!_0xa76917['custom']){_0x423d38=path[_0xaa22('0x60')](config[_0xaa22('0x61')],_0x250938,_['toLower'](_0xaa22('0x71')));}if(!fs['existsSync'](_0x423d38)){throw new db['Sequelize'][(_0xaa22('0x68'))](_[_0xaa22('0x65')](_0xaa22('0x5b'))+_0xaa22('0x6b'));}return _0x510828[_0xaa22('0x69')](_0x423d38);}})[_0xaa22('0x26')](handleError(_0x510828,null));};exports['getDate']=function(_0x43a797,_0x4cc753){var _0x52f995={'offset':moment()['utcOffset']()};_0x52f995['now']=moment()[_0xaa22('0x72')](_0x52f995['offset'])[_0xaa22('0x73')](_0xaa22('0x74'));return _0x4cc753['status'](0xc8)['send'](_0x52f995);};
\ No newline at end of file
index 9c0b461..5151057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x3e74,0x175));var _0x43e7=function(_0x132968,_0x54776d){_0x132968=_0x132968-0x0;var _0xb0417f=_0x3e74[_0x132968];return _0xb0417f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0x7217,0x19e));var _0x7721=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7217[_0x3054be];return _0x3df150;};'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
index 7f4a094..a22acc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca1f=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSetting','Setting','find','options','where','attributes','map','include','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xca1f,0x16a));var _0xfca1=function(_0x17bfc2,_0x4a2506){_0x17bfc2=_0x17bfc2-0x0;var _0x1d479a=_0xca1f[_0x17bfc2];return _0x1d479a;};'use strict';var _=require(_0xfca1('0x0'));var util=require(_0xfca1('0x1'));var moment=require(_0xfca1('0x2'));var BPromise=require(_0xfca1('0x3'));var rs=require(_0xfca1('0x4'));var fs=require('fs');var Redis=require(_0xfca1('0x5'));var db=require(_0xfca1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfca1('0x7'))(_0xfca1('0x8'));var config=require(_0xfca1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfca1('0xa')][_0xfca1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x151587,_0x39f603,_0x1252f6){return new BPromise(function(_0x36a621,_0x4fcbeb){return client[_0xfca1('0xc')](_0x151587,_0x1252f6)[_0xfca1('0xd')](function(_0x9f6904){logger[_0xfca1('0xe')](_0xfca1('0xf'),_0x39f603,_0xfca1('0x10'));logger[_0xfca1('0x11')](_0xfca1('0x12'),_0x39f603,_0xfca1('0x10'),JSON[_0xfca1('0x13')](_0x9f6904));if(_0x9f6904[_0xfca1('0x14')]){if(_0x9f6904[_0xfca1('0x14')][_0xfca1('0x15')]===0x1f4){logger[_0xfca1('0x14')]('Setting,\x20%s,\x20%s',_0x39f603,_0x9f6904[_0xfca1('0x14')][_0xfca1('0x16')]);return _0x4fcbeb(_0x9f6904[_0xfca1('0x14')][_0xfca1('0x16')]);}logger[_0xfca1('0x14')]('Setting,\x20%s,\x20%s',_0x39f603,_0x9f6904[_0xfca1('0x14')][_0xfca1('0x16')]);return _0x36a621(_0x9f6904[_0xfca1('0x14')][_0xfca1('0x16')]);}else{logger['info'](_0xfca1('0xf'),_0x39f603,_0xfca1('0x10'));_0x36a621(_0x9f6904[_0xfca1('0x17')][_0xfca1('0x16')]);}})['catch'](function(_0x12db23){logger['error'](_0xfca1('0xf'),_0x39f603,_0x12db23);_0x4fcbeb(_0x12db23);});});}exports[_0xfca1('0x18')]=function(_0x5dfd30){var _0x1ab562=this;return new Promise(function(_0x1b2acf,_0x23f4c0){return db[_0xfca1('0x19')][_0xfca1('0x1a')]({'raw':_0x5dfd30['options']?_0x5dfd30[_0xfca1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5dfd30['options']?_0x5dfd30['options'][_0xfca1('0x1c')]||null:null,'attributes':_0x5dfd30[_0xfca1('0x1b')]?_0x5dfd30[_0xfca1('0x1b')][_0xfca1('0x1d')]||null:null,'include':_0x5dfd30[_0xfca1('0x1b')]?_0x5dfd30[_0xfca1('0x1b')]['include']?_[_0xfca1('0x1e')](_0x5dfd30['options'][_0xfca1('0x1f')],function(_0xd0ae65){return{'model':db[_0xd0ae65[_0xfca1('0x20')]],'as':_0xd0ae65['as'],'attributes':_0xd0ae65[_0xfca1('0x1d')],'include':_0xd0ae65[_0xfca1('0x1f')]?_[_0xfca1('0x1e')](_0xd0ae65['include'],function(_0x339278){return{'model':db[_0x339278[_0xfca1('0x20')]],'as':_0x339278['as'],'attributes':_0x339278[_0xfca1('0x1d')],'include':_0x339278[_0xfca1('0x1f')]?_[_0xfca1('0x1e')](_0x339278[_0xfca1('0x1f')],function(_0x4947cb){return{'model':db[_0x4947cb[_0xfca1('0x20')]],'as':_0x4947cb['as'],'attributes':_0x4947cb[_0xfca1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfca1('0xd')](function(_0x31cf8f){logger[_0xfca1('0xe')](_0xfca1('0x18'),_0x5dfd30);logger[_0xfca1('0x11')]('ShowSetting',_0x5dfd30,JSON[_0xfca1('0x13')](_0x31cf8f));_0x1b2acf(_0x31cf8f);})[_0xfca1('0x21')](function(_0x568a2d){logger[_0xfca1('0x14')]('ShowSetting',_0x568a2d[_0xfca1('0x16')],_0x5dfd30);_0x23f4c0(_0x1ab562['error'](0x1f4,_0x568a2d[_0xfca1('0x16')]));});});};
\ No newline at end of file
+var _0xfa14=['map','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSetting','Setting','find','options','raw','where','include'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xfa14,0x1a4));var _0x4fa1=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0xfa14[_0x13fcaf];return _0x4fa631;};'use strict';var _=require(_0x4fa1('0x0'));var util=require(_0x4fa1('0x1'));var moment=require(_0x4fa1('0x2'));var BPromise=require(_0x4fa1('0x3'));var rs=require(_0x4fa1('0x4'));var fs=require('fs');var Redis=require(_0x4fa1('0x5'));var db=require(_0x4fa1('0x6'))['db'];var utils=require(_0x4fa1('0x7'));var logger=require(_0x4fa1('0x8'))(_0x4fa1('0x9'));var config=require(_0x4fa1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4fa1('0xb')][_0x4fa1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44cc73,_0x2ccd63,_0x2a390f){return new BPromise(function(_0x501478,_0x46a307){return client['request'](_0x44cc73,_0x2a390f)['then'](function(_0x2cc5ba){logger[_0x4fa1('0xd')](_0x4fa1('0xe'),_0x2ccd63,_0x4fa1('0xf'));logger['debug'](_0x4fa1('0x10'),_0x2ccd63,_0x4fa1('0xf'),JSON[_0x4fa1('0x11')](_0x2cc5ba));if(_0x2cc5ba[_0x4fa1('0x12')]){if(_0x2cc5ba[_0x4fa1('0x12')]['code']===0x1f4){logger[_0x4fa1('0x12')](_0x4fa1('0xe'),_0x2ccd63,_0x2cc5ba[_0x4fa1('0x12')][_0x4fa1('0x13')]);return _0x46a307(_0x2cc5ba['error']['message']);}logger[_0x4fa1('0x12')](_0x4fa1('0xe'),_0x2ccd63,_0x2cc5ba[_0x4fa1('0x12')]['message']);return _0x501478(_0x2cc5ba[_0x4fa1('0x12')][_0x4fa1('0x13')]);}else{logger[_0x4fa1('0xd')]('Setting,\x20%s,\x20%s',_0x2ccd63,_0x4fa1('0xf'));_0x501478(_0x2cc5ba['result']['message']);}})[_0x4fa1('0x14')](function(_0x294c3c){logger[_0x4fa1('0x12')](_0x4fa1('0xe'),_0x2ccd63,_0x294c3c);_0x46a307(_0x294c3c);});});}exports[_0x4fa1('0x15')]=function(_0x45c930){var _0x2b04c3=this;return new Promise(function(_0x421e7c,_0x5dee5e){return db[_0x4fa1('0x16')][_0x4fa1('0x17')]({'raw':_0x45c930['options']?_0x45c930[_0x4fa1('0x18')][_0x4fa1('0x19')]===undefined?!![]:![]:!![],'where':_0x45c930[_0x4fa1('0x18')]?_0x45c930[_0x4fa1('0x18')][_0x4fa1('0x1a')]||null:null,'attributes':_0x45c930[_0x4fa1('0x18')]?_0x45c930[_0x4fa1('0x18')]['attributes']||null:null,'include':_0x45c930['options']?_0x45c930[_0x4fa1('0x18')][_0x4fa1('0x1b')]?_[_0x4fa1('0x1c')](_0x45c930['options']['include'],function(_0x36e790){return{'model':db[_0x36e790['model']],'as':_0x36e790['as'],'attributes':_0x36e790['attributes'],'include':_0x36e790['include']?_[_0x4fa1('0x1c')](_0x36e790[_0x4fa1('0x1b')],function(_0x28af8e){return{'model':db[_0x28af8e[_0x4fa1('0x1d')]],'as':_0x28af8e['as'],'attributes':_0x28af8e[_0x4fa1('0x1e')],'include':_0x28af8e['include']?_[_0x4fa1('0x1c')](_0x28af8e[_0x4fa1('0x1b')],function(_0x5763b6){return{'model':db[_0x5763b6['model']],'as':_0x5763b6['as'],'attributes':_0x5763b6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56a25c){logger[_0x4fa1('0xd')]('ShowSetting',_0x45c930);logger[_0x4fa1('0x1f')](_0x4fa1('0x15'),_0x45c930,JSON[_0x4fa1('0x11')](_0x56a25c));_0x421e7c(_0x56a25c);})['catch'](function(_0x2fbc52){logger['error'](_0x4fa1('0x15'),_0x2fbc52['message'],_0x45c930);_0x5dee5e(_0x2b04c3['error'](0x1f4,_0x2fbc52[_0x4fa1('0x13')]));});});};
\ No newline at end of file
index 604ac0d..32a66bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x376b66,_0x6ee4e1){_0x376b66=_0x376b66-0x0;var _0x32b389=_0x1cb9[_0x376b66];return _0x32b389;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router;
\ No newline at end of file
+var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x3ed787,_0x4c03ac){var _0x48563e=function(_0x72cd0f){while(--_0x72cd0f){_0x3ed787['push'](_0x3ed787['shift']());}};_0x48563e(++_0x4c03ac);}(_0x6aa7,0x178));var _0x76aa=function(_0x3ce44b,_0x5cd6fa){_0x3ce44b=_0x3ce44b-0x0;var _0x4472e0=_0x6aa7[_0x3ce44b];return _0x4472e0;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router;
\ No newline at end of file
index cbca0ec..23205bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda26=['bandwidth','infobip','intelepeer','ENUM','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','clicksend','clickatell'];(function(_0x1c10a4,_0x1016d4){var _0x3fa94d=function(_0x263653){while(--_0x263653){_0x1c10a4['push'](_0x1c10a4['shift']());}};_0x3fa94d(++_0x1016d4);}(_0xda26,0x129));var _0x6da2=function(_0x3cd6fe,_0x468eb2){_0x3cd6fe=_0x3cd6fe-0x0;var _0x3af6b9=_0xda26[_0x3cd6fe];return _0x3af6b9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6da2('0x0'));module[_0x6da2('0x1')]={'name':{'type':Sequelize[_0x6da2('0x2')],'unique':_0x6da2('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x6da2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x6da2('0x2')],'defaultValue':function(){return rs[_0x6da2('0x4')]();}},'phone':{'type':Sequelize[_0x6da2('0x2')]},'type':{'type':Sequelize['ENUM']('twilio','skebby','connectel',_0x6da2('0x5'),'plivo',_0x6da2('0x6'),_0x6da2('0x7'),'csc',_0x6da2('0x8'),_0x6da2('0x9'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x6da2('0x2')]},'authToken':{'type':Sequelize[_0x6da2('0x2')]},'smsMethod':{'type':Sequelize[_0x6da2('0xa')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6da2('0x2')]},'password':{'type':Sequelize[_0x6da2('0x2')]},'apiKey':{'type':Sequelize[_0x6da2('0x2')]},'applicationId':{'type':Sequelize[_0x6da2('0x2')]},'accountId':{'type':Sequelize[_0x6da2('0x2')]},'senderString':{'type':Sequelize[_0x6da2('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x6da2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6da2('0xb');}},'notificationSound':{'type':Sequelize[_0x6da2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6da2('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6da2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6da2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6da2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6da2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6da2('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6da2('0xf'),'set':function(_0x514226){if(!_0x514226)this[_0x6da2('0x10')](_0x6da2('0x11'),null);this[_0x6da2('0x10')](_0x6da2('0x12'),_0x514226);}}};
\ No newline at end of file
+var _0xcaea=['plivo','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','connectel','clicksend'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xcaea,0x16e));var _0xacae=function(_0x5553fa,_0x179271){_0x5553fa=_0x5553fa-0x0;var _0xe506af=_0xcaea[_0x5553fa];return _0xe506af;};'use strict';var Sequelize=require(_0xacae('0x0'));var rs=require(_0xacae('0x1'));module[_0xacae('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xacae('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xacae('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xacae('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xacae('0x4')],'defaultValue':function(){return rs[_0xacae('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio','skebby',_0xacae('0x6'),_0xacae('0x7'),_0xacae('0x8'),'clickatell',_0xacae('0x9'),_0xacae('0xa'),_0xacae('0xb'),_0xacae('0xc'))},'accountSid':{'type':Sequelize[_0xacae('0x4')]},'authId':{'type':Sequelize[_0xacae('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xacae('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0xacae('0x4')]},'password':{'type':Sequelize[_0xacae('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xacae('0x4')]},'accountId':{'type':Sequelize[_0xacae('0x4')]},'senderString':{'type':Sequelize[_0xacae('0x4')]},'deliveryReport':{'type':Sequelize[_0xacae('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xacae('0x4')]},'notificationTemplate':{'type':Sequelize[_0xacae('0xf')],'defaultValue':function(){return _0xacae('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xacae('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xacae('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xacae('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xacae('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xacae('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xacae('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xacae('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xacae('0xe')],'defaultValue':![],'comment':_0xacae('0x12'),'set':function(_0x540b6e){if(!_0x540b6e)this[_0xacae('0x13')](_0xacae('0x14'),null);this['setDataValue'](_0xacae('0x15'),_0x540b6e);}}};
\ No newline at end of file
index 0a6fdf9..dc97160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a49=['entity\x20found','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','update','inspect','error_code','message-delivered','DELIVRD','statusGet','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','SmsAccounts','destroy','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','SmsAccount','rows','show','params','Pause','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','getDispositions','Disposition','nolimit','order','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','From','Body','skebby','sender','text','connectel','messageId','message_id','plivo','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','ValidationError','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s'];(function(_0xbe7c82,_0xd29ad5){var _0x1ef1f6=function(_0x5ecf21){while(--_0x5ecf21){_0xbe7c82['push'](_0xbe7c82['shift']());}};_0x1ef1f6(++_0xd29ad5);}(_0x9a49,0x11b));var _0x99a4=function(_0x2694db,_0x3f9acd){_0x2694db=_0x2694db-0x0;var _0x3cf599=_0x9a49[_0x2694db];return _0x3cf599;};'use strict';var emlformat=require(_0x99a4('0x0'));var rimraf=require(_0x99a4('0x1'));var zipdir=require(_0x99a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a4('0x3'));var moment=require(_0x99a4('0x4'));var BPromise=require(_0x99a4('0x5'));var Mustache=require(_0x99a4('0x6'));var util=require(_0x99a4('0x7'));var path=require('path');var sox=require(_0x99a4('0x8'));var csv=require(_0x99a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99a4('0xa'));var _=require('lodash');var squel=require(_0x99a4('0xb'));var crypto=require(_0x99a4('0xc'));var jsforce=require(_0x99a4('0xd'));var deskjs=require(_0x99a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x99a4('0xf'));var Papa=require(_0x99a4('0x10'));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(_0x99a4('0x11'));var logger=require(_0x99a4('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x99a4('0x13'));var db=require(_0x99a4('0x14'))['db'];config[_0x99a4('0x15')]=_[_0x99a4('0x16')](config['redis'],{'host':_0x99a4('0x17'),'port':0x18eb});var socket=require(_0x99a4('0x18'))(new Redis(config[_0x99a4('0x15')]));require(_0x99a4('0x19'))[_0x99a4('0x1a')](socket);var jayson=require(_0x99a4('0x1b'));var client=jayson[_0x99a4('0x1c')][_0x99a4('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x2bf13c,_0x1361e5,_0x243875,_0x523c47){return new BPromise(function(_0x5ecade,_0x40b0db){var _0x183380=_0x523c47||client;return _0x183380['request'](_0x2bf13c,_0x243875)[_0x99a4('0x1e')](function(_0x1f93f5){logger[_0x99a4('0x1f')](_0x99a4('0x20'),_0x1361e5,_0x99a4('0x21'));logger[_0x99a4('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1361e5,'request\x20sent',JSON[_0x99a4('0x23')](_0x1f93f5));if(_0x1f93f5[_0x99a4('0x24')]){if(_0x1f93f5['error'][_0x99a4('0x25')]===0x1f4){logger['error'](_0x99a4('0x20'),_0x1361e5,_0x1f93f5[_0x99a4('0x24')]['message']);return _0x40b0db(_0x1f93f5['error'][_0x99a4('0x26')]);}logger[_0x99a4('0x24')](_0x99a4('0x20'),_0x1361e5,_0x1f93f5[_0x99a4('0x24')][_0x99a4('0x26')]);return _0x5ecade(_0x1f93f5[_0x99a4('0x24')][_0x99a4('0x26')]);}else{logger[_0x99a4('0x1f')](_0x99a4('0x20'),_0x1361e5,_0x99a4('0x21'));_0x5ecade(_0x1f93f5[_0x99a4('0x27')][_0x99a4('0x26')]);}})[_0x99a4('0x28')](function(_0x3c239e){logger[_0x99a4('0x24')](_0x99a4('0x20'),_0x1361e5,_0x3c239e);_0x40b0db(_0x3c239e);});});}function respondWithStatusCode(_0x16cc97,_0x491572){_0x491572=_0x491572||0xcc;return function(_0x1280ad){if(_0x1280ad){return _0x16cc97[_0x99a4('0x29')](_0x491572);}return _0x16cc97['status'](_0x491572)[_0x99a4('0x2a')]();};}function respondWithResult(_0xcc279d,_0x36126c){_0x36126c=_0x36126c||0xc8;return function(_0x185ef3){if(_0x185ef3){return _0xcc279d[_0x99a4('0x2b')](_0x36126c)[_0x99a4('0x2c')](_0x185ef3);}};}function respondWithFilteredResult(_0x1969f2,_0x36613e){return function(_0x5e61ac){if(_0x5e61ac){var _0x2a5650=typeof _0x36613e[_0x99a4('0x2d')]===_0x99a4('0x2e')&&typeof _0x36613e['limit']==='undefined';var _0x1ca9b9=_0x5e61ac['count'];var _0x3151a7=_0x2a5650?0x0:_0x36613e['offset'];var _0x1fc905=_0x2a5650?_0x5e61ac[_0x99a4('0x2f')]:_0x36613e['offset']+_0x36613e[_0x99a4('0x30')];var _0x399028;if(_0x1fc905>=_0x1ca9b9){_0x1fc905=_0x1ca9b9;_0x399028=0xc8;}else{_0x399028=0xce;}_0x1969f2['status'](_0x399028);return _0x1969f2['set'](_0x99a4('0x31'),_0x3151a7+'-'+_0x1fc905+'/'+_0x1ca9b9)['json'](_0x5e61ac);}return null;};}function patchUpdates(_0x1ffcd6){return function(_0x4eafa6){try{jsonpatch['apply'](_0x4eafa6,_0x1ffcd6,!![]);}catch(_0x48b4a2){return BPromise[_0x99a4('0x32')](_0x48b4a2);}return _0x4eafa6[_0x99a4('0x33')]();};}function saveUpdates(_0x27977b,_0x3c70ca){return function(_0x3bd97e){if(_0x3bd97e){return _0x3bd97e['update'](_0x27977b)[_0x99a4('0x1e')](function(_0x4068f4){return _0x4068f4;});}return null;};}function removeEntity(_0x5135d5,_0x3db7a1){return function(_0x589c89){if(_0x589c89){return _0x589c89['destroy']()[_0x99a4('0x1e')](function(){var _0x376449=_0x589c89['get']({'plain':!![]});var _0x4994cd=_0x99a4('0x34');return db['UserProfileResource'][_0x99a4('0x35')]({'where':{'type':_0x4994cd,'resourceId':_0x376449['id']}})['then'](function(){return _0x589c89;});})[_0x99a4('0x1e')](function(){_0x5135d5[_0x99a4('0x2b')](0xcc)[_0x99a4('0x2a')]();});}};}function handleEntityNotFound(_0x441cda,_0x3d7b76){return function(_0x5acbbf){if(!_0x5acbbf){_0x441cda['sendStatus'](0x194);}return _0x5acbbf;};}function handleError(_0x5de9fb,_0x4eeaa1){_0x4eeaa1=_0x4eeaa1||0x1f4;return function(_0x3b7d1a){logger[_0x99a4('0x24')](_0x3b7d1a[_0x99a4('0x36')]);if(_0x3b7d1a['name']){delete _0x3b7d1a[_0x99a4('0x37')];}_0x5de9fb[_0x99a4('0x2b')](_0x4eeaa1)[_0x99a4('0x38')](_0x3b7d1a);};}exports[_0x99a4('0x39')]=function(_0x1c09a1,_0x4c4a01){var _0x12733a={'include':[{'model':db['Pause'],'as':_0x99a4('0x3a')}]},_0x11445b={},_0x26b180={'count':0x0,'rows':[]};var _0x87a99f=_[_0x99a4('0x3b')](db['SmsAccount'][_0x99a4('0x3c')],function(_0x1bb9f1){return{'name':_0x1bb9f1[_0x99a4('0x3d')],'type':_0x1bb9f1[_0x99a4('0x3e')][_0x99a4('0x3f')]};});_0x11445b[_0x99a4('0x40')]=_[_0x99a4('0x3b')](_0x87a99f,_0x99a4('0x37'));_0x11445b['query']=_[_0x99a4('0x41')](_0x1c09a1[_0x99a4('0x42')]);_0x11445b[_0x99a4('0x43')]=_[_0x99a4('0x44')](_0x11445b[_0x99a4('0x40')],_0x11445b['query']);_0x12733a[_0x99a4('0x45')]=_['intersection'](_0x11445b[_0x99a4('0x40')],qs[_0x99a4('0x46')](_0x1c09a1['query'][_0x99a4('0x46')]));_0x12733a[_0x99a4('0x45')]=_0x12733a[_0x99a4('0x45')][_0x99a4('0x47')]?_0x12733a[_0x99a4('0x45')]:_0x11445b[_0x99a4('0x40')];if(!_0x1c09a1['query'][_0x99a4('0x48')]('nolimit')){_0x12733a[_0x99a4('0x30')]=qs[_0x99a4('0x30')](_0x1c09a1['query']['limit']);_0x12733a[_0x99a4('0x2d')]=qs[_0x99a4('0x2d')](_0x1c09a1[_0x99a4('0x42')][_0x99a4('0x2d')]);}_0x12733a['order']=qs['sort'](_0x1c09a1[_0x99a4('0x42')][_0x99a4('0x49')]);_0x12733a['where']=qs[_0x99a4('0x43')](_[_0x99a4('0x4a')](_0x1c09a1[_0x99a4('0x42')],_0x11445b['filters']),_0x87a99f);if(_0x1c09a1[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x12733a['where']=_[_0x99a4('0x4c')](_0x12733a[_0x99a4('0x4d')],{'$or':_[_0x99a4('0x3b')](_0x87a99f,function(_0x380713){if(_0x380713[_0x99a4('0x3e')]!==_0x99a4('0x4e')){var _0x5c643a={};_0x5c643a[_0x380713[_0x99a4('0x37')]]={'$like':'%'+_0x1c09a1[_0x99a4('0x42')][_0x99a4('0x4b')]+'%'};return _0x5c643a;}})});}_0x12733a=_[_0x99a4('0x4c')]({},_0x12733a,_0x1c09a1['options']);var _0x525247={'where':_0x12733a[_0x99a4('0x4d')]};return db['SmsAccount'][_0x99a4('0x2f')](_0x525247)[_0x99a4('0x1e')](function(_0x35a9f8){_0x26b180[_0x99a4('0x2f')]=_0x35a9f8;if(_0x1c09a1['query']['includeAll']){_0x12733a['include']=[{'all':!![]}];}return db[_0x99a4('0x4f')]['findAll'](_0x12733a);})[_0x99a4('0x1e')](function(_0xf00734){_0x26b180[_0x99a4('0x50')]=_0xf00734;return _0x26b180;})['then'](respondWithFilteredResult(_0x4c4a01,_0x12733a))[_0x99a4('0x28')](handleError(_0x4c4a01,null));};exports[_0x99a4('0x51')]=function(_0x29da85,_0x5eca95){var _0x159feb={'raw':![],'where':{'id':_0x29da85[_0x99a4('0x52')]['id']},'include':[{'model':db[_0x99a4('0x53')],'as':_0x99a4('0x3a')}]},_0x1af8bd={};_0x1af8bd[_0x99a4('0x40')]=_[_0x99a4('0x41')](db[_0x99a4('0x4f')]['rawAttributes']);_0x1af8bd[_0x99a4('0x42')]=_['keys'](_0x29da85['query']);_0x1af8bd[_0x99a4('0x43')]=_['intersection'](_0x1af8bd[_0x99a4('0x40')],_0x1af8bd[_0x99a4('0x42')]);_0x159feb[_0x99a4('0x45')]=_['intersection'](_0x1af8bd[_0x99a4('0x40')],qs['fields'](_0x29da85['query'][_0x99a4('0x46')]));_0x159feb['attributes']=_0x159feb['attributes']['length']?_0x159feb[_0x99a4('0x45')]:_0x1af8bd[_0x99a4('0x40')];if(_0x29da85[_0x99a4('0x42')][_0x99a4('0x54')]){_0x159feb[_0x99a4('0x55')]=[{'all':!![]}];}_0x159feb=_[_0x99a4('0x4c')]({},_0x159feb,_0x29da85[_0x99a4('0x56')]);return db[_0x99a4('0x4f')][_0x99a4('0x57')](_0x159feb)['then'](handleEntityNotFound(_0x5eca95,null))[_0x99a4('0x1e')](respondWithResult(_0x5eca95,null))[_0x99a4('0x28')](handleError(_0x5eca95,null));};exports[_0x99a4('0x58')]=function(_0x3a7aab,_0x10aa34){return db[_0x99a4('0x4f')]['create'](_0x3a7aab[_0x99a4('0x59')],{})['then'](function(_0x4a6e1a){var _0x8dddcf=_0x3a7aab[_0x99a4('0x5a')][_0x99a4('0x5b')]({'plain':!![]});if(!_0x8dddcf)throw new Error(_0x99a4('0x5c'));if(_0x8dddcf[_0x99a4('0x5d')]==='user'){var _0x5056ba=_0x4a6e1a['get']({'plain':!![]});var _0x27f47f=_0x99a4('0x34');return db['UserProfileSection'][_0x99a4('0x57')]({'where':{'name':_0x27f47f,'userProfileId':_0x8dddcf['userProfileId']},'raw':!![]})['then'](function(_0x465637){if(_0x465637&&_0x465637[_0x99a4('0x5e')]===0x0){return db[_0x99a4('0x5f')]['create']({'name':_0x5056ba[_0x99a4('0x37')],'resourceId':_0x5056ba['id'],'type':_0x465637[_0x99a4('0x37')],'sectionId':_0x465637['id']},{})[_0x99a4('0x1e')](function(){return _0x4a6e1a;});}else{return _0x4a6e1a;}})['catch'](function(_0x37e8b7){logger[_0x99a4('0x24')](_0x99a4('0x60'),_0x37e8b7);throw _0x37e8b7;});}return _0x4a6e1a;})['then'](respondWithResult(_0x10aa34,0xc9))[_0x99a4('0x28')](handleError(_0x10aa34,null));};exports['update']=function(_0x43724b,_0x9bd53d){if(_0x43724b[_0x99a4('0x59')]['id']){delete _0x43724b['body']['id'];}return db[_0x99a4('0x4f')]['find']({'where':{'id':_0x43724b[_0x99a4('0x52')]['id']},'include':[{'model':db[_0x99a4('0x53')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x9bd53d,null))[_0x99a4('0x1e')](saveUpdates(_0x43724b[_0x99a4('0x59')],null))['then'](respondWithResult(_0x9bd53d,null))[_0x99a4('0x28')](handleError(_0x9bd53d,null));};exports[_0x99a4('0x35')]=function(_0x5209aa,_0x58a8f0){return db[_0x99a4('0x4f')]['find']({'where':{'id':_0x5209aa[_0x99a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x58a8f0,null))[_0x99a4('0x1e')](removeEntity(_0x58a8f0,null))['catch'](handleError(_0x58a8f0,null));};exports['describe']=function(_0x50986b,_0x47229a){return db[_0x99a4('0x4f')][_0x99a4('0x61')]()[_0x99a4('0x1e')](respondWithResult(_0x47229a,null))['catch'](handleError(_0x47229a,null));};exports['addDisposition']=function(_0x326195,_0x4d8ddc,_0x253407){if(_0x326195['body']['id']){delete _0x326195[_0x99a4('0x59')]['id'];}return db[_0x99a4('0x4f')]['find']({'where':{'id':_0x326195[_0x99a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d8ddc,null))[_0x99a4('0x1e')](function(_0x58710e){if(_0x58710e){_0x326195[_0x99a4('0x59')][_0x99a4('0x62')]=_0x58710e['id'];return db['Disposition'][_0x99a4('0x58')](_0x326195['body']);}})[_0x99a4('0x1e')](respondWithResult(_0x4d8ddc,null))[_0x99a4('0x28')](handleError(_0x4d8ddc,null));};exports[_0x99a4('0x63')]=function(_0x40d235,_0x5c215e,_0x57630a){var _0x472044={'raw':![],'where':{}};var _0x2ebe5b={};var _0x2b699c={'count':0x0,'rows':[]};return db[_0x99a4('0x4f')]['findOne']({'where':{'id':_0x40d235[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x5c215e,null))[_0x99a4('0x1e')](function(_0x4fa92e){if(_0x4fa92e){_0x2ebe5b[_0x99a4('0x40')]=_[_0x99a4('0x41')](db[_0x99a4('0x64')][_0x99a4('0x3c')]);_0x2ebe5b[_0x99a4('0x42')]=_[_0x99a4('0x41')](_0x40d235[_0x99a4('0x42')]);_0x2ebe5b['filters']=_[_0x99a4('0x44')](_0x2ebe5b['model'],_0x2ebe5b[_0x99a4('0x42')]);_0x472044[_0x99a4('0x45')]=_[_0x99a4('0x44')](_0x2ebe5b[_0x99a4('0x40')],qs['fields'](_0x40d235[_0x99a4('0x42')][_0x99a4('0x46')]));_0x472044['attributes']=_0x472044[_0x99a4('0x45')]['length']?_0x472044[_0x99a4('0x45')]:_0x2ebe5b[_0x99a4('0x40')];if(!_0x40d235[_0x99a4('0x42')][_0x99a4('0x48')](_0x99a4('0x65'))){_0x472044[_0x99a4('0x30')]=qs[_0x99a4('0x30')](_0x40d235[_0x99a4('0x42')]['limit']);_0x472044[_0x99a4('0x2d')]=qs[_0x99a4('0x2d')](_0x40d235['query']['offset']);}_0x472044[_0x99a4('0x66')]=qs[_0x99a4('0x49')](_0x40d235['query'][_0x99a4('0x49')]);_0x472044[_0x99a4('0x4d')]=qs[_0x99a4('0x43')](_[_0x99a4('0x4a')](_0x40d235[_0x99a4('0x42')],_0x2ebe5b[_0x99a4('0x43')]));_0x472044['where'][_0x99a4('0x62')]=_0x4fa92e['id'];if(_0x40d235[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x472044[_0x99a4('0x4d')]=_['merge'](_0x472044[_0x99a4('0x4d')],{'$or':_[_0x99a4('0x3b')](_0x472044[_0x99a4('0x45')],function(_0x5d91bf){var _0x5718bf={};_0x5718bf[_0x5d91bf]={'$like':'%'+_0x40d235[_0x99a4('0x42')]['filter']+'%'};return _0x5718bf;})});}_0x472044=_[_0x99a4('0x4c')]({},_0x472044,_0x40d235[_0x99a4('0x56')]);return db[_0x99a4('0x64')][_0x99a4('0x2f')]({'where':_0x472044[_0x99a4('0x4d')]})[_0x99a4('0x1e')](function(_0x265c1d){_0x2b699c[_0x99a4('0x2f')]=_0x265c1d;if(_0x40d235['query'][_0x99a4('0x54')]){_0x472044[_0x99a4('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x99a4('0x67')](_0x472044);})[_0x99a4('0x1e')](function(_0x32fac2){_0x2b699c[_0x99a4('0x50')]=_0x32fac2;return _0x2b699c;});}})[_0x99a4('0x1e')](respondWithFilteredResult(_0x5c215e,_0x472044))[_0x99a4('0x28')](handleError(_0x5c215e,null));};exports[_0x99a4('0x68')]=function(_0x4d7f00,_0x1ac2b7,_0x2cdadd){return db[_0x99a4('0x4f')]['find']({'where':{'id':_0x4d7f00['params']['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x1ac2b7,null))[_0x99a4('0x1e')](function(_0x9a7ba3){if(_0x9a7ba3){return _0x9a7ba3[_0x99a4('0x68')](_0x4d7f00[_0x99a4('0x42')][_0x99a4('0x69')]);}})[_0x99a4('0x1e')](respondWithStatusCode(_0x1ac2b7,null))['catch'](handleError(_0x1ac2b7,null));};exports[_0x99a4('0x6a')]=function(_0x258221,_0x3bc5f3,_0x3c9b58){if(_0x258221[_0x99a4('0x59')]['id']){delete _0x258221[_0x99a4('0x59')]['id'];}return db[_0x99a4('0x4f')][_0x99a4('0x57')]({'where':{'id':_0x258221[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x3bc5f3,null))[_0x99a4('0x1e')](function(_0x59e538){if(_0x59e538){_0x258221[_0x99a4('0x59')][_0x99a4('0x62')]=_0x59e538['id'];return db['CannedAnswer'][_0x99a4('0x58')](_0x258221[_0x99a4('0x59')]);}})['then'](respondWithResult(_0x3bc5f3,null))[_0x99a4('0x28')](handleError(_0x3bc5f3,null));};exports[_0x99a4('0x6b')]=function(_0x19e9e0,_0x46b4a6,_0x4b69fa){var _0x3aefd4={'raw':![],'where':{}};var _0x3efdfe={};var _0x3f8b1e={'count':0x0,'rows':[]};return db[_0x99a4('0x4f')][_0x99a4('0x6c')]({'where':{'id':_0x19e9e0[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x46b4a6,null))[_0x99a4('0x1e')](function(_0x1a26d4){if(_0x1a26d4){_0x3efdfe[_0x99a4('0x40')]=_[_0x99a4('0x41')](db[_0x99a4('0x6d')][_0x99a4('0x3c')]);_0x3efdfe[_0x99a4('0x42')]=_['keys'](_0x19e9e0[_0x99a4('0x42')]);_0x3efdfe[_0x99a4('0x43')]=_['intersection'](_0x3efdfe[_0x99a4('0x40')],_0x3efdfe[_0x99a4('0x42')]);_0x3aefd4[_0x99a4('0x45')]=_[_0x99a4('0x44')](_0x3efdfe['model'],qs[_0x99a4('0x46')](_0x19e9e0['query'][_0x99a4('0x46')]));_0x3aefd4[_0x99a4('0x45')]=_0x3aefd4['attributes'][_0x99a4('0x47')]?_0x3aefd4[_0x99a4('0x45')]:_0x3efdfe[_0x99a4('0x40')];if(!_0x19e9e0[_0x99a4('0x42')][_0x99a4('0x48')]('nolimit')){_0x3aefd4[_0x99a4('0x30')]=qs['limit'](_0x19e9e0[_0x99a4('0x42')]['limit']);_0x3aefd4[_0x99a4('0x2d')]=qs[_0x99a4('0x2d')](_0x19e9e0['query'][_0x99a4('0x2d')]);}_0x3aefd4[_0x99a4('0x66')]=qs[_0x99a4('0x49')](_0x19e9e0[_0x99a4('0x42')][_0x99a4('0x49')]);_0x3aefd4[_0x99a4('0x4d')]=qs[_0x99a4('0x43')](_[_0x99a4('0x4a')](_0x19e9e0['query'],_0x3efdfe['filters']));_0x3aefd4[_0x99a4('0x4d')][_0x99a4('0x62')]=_0x1a26d4['id'];if(_0x19e9e0[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x3aefd4['where']=_[_0x99a4('0x4c')](_0x3aefd4[_0x99a4('0x4d')],{'$or':_['map'](_0x3aefd4[_0x99a4('0x45')],function(_0x278e7c){var _0x433cc4={};_0x433cc4[_0x278e7c]={'$like':'%'+_0x19e9e0[_0x99a4('0x42')]['filter']+'%'};return _0x433cc4;})});}_0x3aefd4=_[_0x99a4('0x4c')]({},_0x3aefd4,_0x19e9e0['options']);return db[_0x99a4('0x6d')][_0x99a4('0x2f')]({'where':_0x3aefd4[_0x99a4('0x4d')]})[_0x99a4('0x1e')](function(_0x2756b6){_0x3f8b1e[_0x99a4('0x2f')]=_0x2756b6;if(_0x19e9e0['query'][_0x99a4('0x54')]){_0x3aefd4[_0x99a4('0x55')]=[{'all':!![]}];}return db[_0x99a4('0x6d')][_0x99a4('0x67')](_0x3aefd4);})[_0x99a4('0x1e')](function(_0x5dcb97){_0x3f8b1e[_0x99a4('0x50')]=_0x5dcb97;return _0x3f8b1e;});}})['then'](respondWithFilteredResult(_0x46b4a6,_0x3aefd4))[_0x99a4('0x28')](handleError(_0x46b4a6,null));};exports[_0x99a4('0x6e')]=function(_0x4183d6,_0x5e6b42,_0x1975f7){return db['SmsAccount']['find']({'where':{'id':_0x4183d6[_0x99a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x5e6b42,null))[_0x99a4('0x1e')](function(_0x7d14be){if(_0x7d14be){return _0x7d14be[_0x99a4('0x6e')](_0x4183d6[_0x99a4('0x42')][_0x99a4('0x69')]);}})['then'](respondWithStatusCode(_0x5e6b42,null))[_0x99a4('0x28')](handleError(_0x5e6b42,null));};exports[_0x99a4('0x6f')]=function(_0x55f4b8,_0x35e0cc,_0x50edd6){var _0xde900a={'channel':_0x99a4('0x70')};var _0x5850c0=[];var _0x7c5615=[];var _0x1cd2f4={};return db[_0x99a4('0x4f')][_0x99a4('0x57')]({'where':{'id':_0x55f4b8[_0x99a4('0x52')]['id']},'include':[{'model':db[_0x99a4('0x71')],'as':_0x99a4('0x72')}]})['then'](handleEntityNotFound(_0x35e0cc,null))[_0x99a4('0x1e')](function(_0x13a12d){_0xde900a[_0x99a4('0x73')]=_0x13a12d;_0xde900a[_0x99a4('0x74')]=_[_0x99a4('0x75')](_0x13a12d['Applications'],[_0x99a4('0x76')],[_0x99a4('0x77')]);if(_0xde900a[_0x99a4('0x73')][_0x99a4('0x72')]){delete _0xde900a[_0x99a4('0x73')][_0x99a4('0x72')];}return db[_0x99a4('0x78')][_0x99a4('0x61')]();})['then'](function(_0x300866){if(!_0x300866){throw new db[(_0x99a4('0x79'))]['ValidationError'](_0x99a4('0x7a'));}_0x5850c0=_['difference'](_[_0x99a4('0x41')](_0x300866),[_0x99a4('0x7b'),_0x99a4('0x7c')]);_0x7c5615=_[_0x99a4('0x7d')](_['keys'](_0x300866),['createdAt',_0x99a4('0x7c'),_0x99a4('0x7e'),_0x99a4('0x7f')]);_0xde900a[_0x99a4('0x59')]={'mapKey':_0x99a4('0x80')};if(_0xde900a[_0x99a4('0x73')]['type']){switch(_0xde900a['account']['type']){case'twilio':_0xde900a['body'][_0x99a4('0x81')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x82')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x83')];_0xde900a['body']['messageId']=_0x55f4b8['body']['MessageSid'];break;case _0x99a4('0x84'):_0xde900a[_0x99a4('0x59')]['from']='+'+_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x85')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x86')];break;case _0x99a4('0x87'):_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')]=_0x55f4b8[_0x99a4('0x59')]['from'];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x26')];break;case'clicksend':_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')]=_0x55f4b8['body'][_0x99a4('0x81')];_0xde900a['body'][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x59')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x88')]=_0x55f4b8['body'][_0x99a4('0x89')];break;case _0x99a4('0x8a'):_0xde900a[_0x99a4('0x59')]['from']=_0x55f4b8['body'][_0x99a4('0x82')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8['body']['Text'];_0xde900a[_0x99a4('0x59')][_0x99a4('0x88')]=_0x55f4b8['body']['MessageUUID'];break;case _0x99a4('0x8b'):_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')]='+'+_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x8c')][0x0][_0x99a4('0x81')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x8c')][0x0][_0x99a4('0x86')];_0xde900a[_0x99a4('0x59')]['messageId']=_0x55f4b8['body'][_0x99a4('0x8c')][0x0]['messageId'];break;case _0x99a4('0x8d'):_0xde900a[_0x99a4('0x59')]['from']=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x8e')];_0xde900a['body'][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x8f')][_0x99a4('0x26')];break;case _0x99a4('0x90'):_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x91')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x86')];_0xde900a['body'][_0x99a4('0x88')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x92')];break;case _0x99a4('0x93'):_0xde900a[_0x99a4('0x59')][_0x99a4('0x88')]=_0x55f4b8[_0x99a4('0x59')][0x0][_0x99a4('0x26')]['id'];_0xde900a['body'][_0x99a4('0x81')]=_0x55f4b8['body'][0x0][_0x99a4('0x26')][_0x99a4('0x81')];_0xde900a['body'][_0x99a4('0x59')]=_0x55f4b8[_0x99a4('0x59')][0x0]['message'][_0x99a4('0x86')];break;case _0x99a4('0x94'):_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')]=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x81')];_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')]=_0x55f4b8['body']['message'];_0xde900a[_0x99a4('0x59')]['messageId']=_0x55f4b8[_0x99a4('0x59')][_0x99a4('0x95')];break;}}if(_0xde900a[_0x99a4('0x59')]['id']){delete _0xde900a[_0x99a4('0x59')]['id'];}if(_[_0x99a4('0x96')](_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')])){throw new db['Sequelize']['ValidationError'](_0x99a4('0x97'));}if(_['isNil'](_0xde900a[_0x99a4('0x59')][_0x99a4('0x59')])||_0xde900a[_0x99a4('0x59')]['body']===''){throw new db[(_0x99a4('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xde900a[_0x99a4('0x59')][_0x99a4('0x98')])){throw new db['Sequelize'][(_0x99a4('0x99'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7c5615);}if(!_[_0x99a4('0x9a')](_0x7c5615,_0xde900a[_0x99a4('0x59')][_0x99a4('0x98')])){throw new db['Sequelize']['ValidationError'](_0x99a4('0x9b')+_0x7c5615);}_0x1cd2f4[_0xde900a[_0x99a4('0x59')][_0x99a4('0x98')]]=_0xde900a['body'][_0x99a4('0x81')];return db[_0x99a4('0x9c')][_0x99a4('0x57')]({'where':{'id':_0xde900a['account'][_0x99a4('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x99a4('0x9d'),'where':_0x1cd2f4,'limit':0x1,'order':[[_0x99a4('0x7c'),_0x99a4('0x9e')]]}]});})[_0x99a4('0x1e')](handleEntityNotFound(_0x35e0cc,null))['then'](function(_0x17df77){if(_0x17df77){_0xde900a[_0x99a4('0x9f')]=_[_0x99a4('0xa0')](_0x17df77,['Contacts']);if(_0x17df77[_0x99a4('0x9d')]['length']){return _0x17df77[_0x99a4('0x9d')][0x0];}var _0x5b7406=_[_0x99a4('0x16')](_0xde900a[_0x99a4('0x59')],{'firstName':_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')],'ListId':_0x17df77['id']});_0x5b7406[_0xde900a['body']['mapKey']]=_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')];return db['CmContact']['create'](_0x5b7406,{'fields':_0x5850c0,'raw':!![]});}})[_0x99a4('0x1e')](handleEntityNotFound(_0x35e0cc,null))[_0x99a4('0x1e')](function(_0x4836b1){if(_0x4836b1){_0xde900a[_0x99a4('0xa1')]=_0x4836b1;var _0x11e17d={'ContactId':_0x4836b1['id'],'phone':_0xde900a[_0x99a4('0x59')][_0x99a4('0x81')],'SmsAccountId':_0x55f4b8['params']['id']};var _0x38b1f7={'ContactId':_0x4836b1['id'],'SmsAccountId':_0x55f4b8[_0x99a4('0x52')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x38b1f7})[_0x99a4('0x1e')](function(_0x3b4672){if(_0x3b4672){return[_0x3b4672,![]];}return db[_0x99a4('0xa2')][_0x99a4('0x58')](_0x11e17d)[_0x99a4('0x1e')](function(_0x38aaed){return[_0x38aaed,!![]];});});}})[_0x99a4('0xa3')](function(_0x897b41,_0xdeb243){_0xde900a[_0x99a4('0xa4')]=_0x897b41[_0x99a4('0x5b')]({'plain':!![]});_0xde900a[_0x99a4('0xa4')]['created']=![];if(_0xdeb243){if(_0xde900a[_0x99a4('0x73')][_0x99a4('0xa5')]){_0xde900a[_0x99a4('0x74')][_0x99a4('0xa6')]({'id':0x0,'priority':_0xde900a[_0x99a4('0x74')][_0x99a4('0x47')]+0x1,'app':'close','appdata':_0x99a4('0xa7'),'interval':'*,*,*,*'});}_0xde900a[_0x99a4('0xa4')]['created']=!![];}return db[_0x99a4('0xa8')]['create']({'phone':_0xde900a[_0x99a4('0x59')]['from'],'messageId':_0xde900a['body']['messageId'],'body':_0xde900a['body'][_0x99a4('0x59')],'SmsAccountId':_0x55f4b8['params']['id'],'SmsInteractionId':_0x897b41['id'],'direction':'in','ContactId':_0x897b41[_0x99a4('0xa9')],'AttachmentId':_0xde900a[_0x99a4('0x59')][_0x99a4('0xaa')]});})[_0x99a4('0x1e')](function(_0x478eef){_0xde900a[_0x99a4('0x26')]=_0x478eef;if(_0xde900a['interaction'][_0x99a4('0xab')]){return db['User'][_0x99a4('0x57')]({'attributes':['id','name'],'where':{'id':_0xde900a[_0x99a4('0xa4')][_0x99a4('0xab')]}})[_0x99a4('0x1e')](function(_0x5d2a5f){if(_0x5d2a5f){_0xde900a[_0x99a4('0x74')][_0x99a4('0xac')]({'id':0x0,'priority':0x0,'app':_0x99a4('0xad'),'appdata':_0x5d2a5f[_0x99a4('0x37')]+','+(_0xde900a[_0x99a4('0x73')][_0x99a4('0xae')]||0xa),'interval':_0x99a4('0xaf')});}return respondWithRpcPromise(_0x99a4('0xb0'),_0x99a4('0xb1'),_0xde900a);});}return respondWithRpcPromise('Start',_0x99a4('0xb1'),_0xde900a);})[_0x99a4('0x1e')](function(_0x2266aa){if(_0x2266aa){var _0x4b6c8d=0xc8;var _0xe35c88=_0x99a4('0xb2');logger[_0x99a4('0x1f')](_0x99a4('0xb3'),_0xe35c88,_0x4b6c8d,'entity\x20found');logger[_0x99a4('0x22')](_0x99a4('0xb4'),_0xe35c88,_0x4b6c8d,_0x99a4('0xb5'),JSON['stringify'](_0x2266aa));if(_0xde900a['account'][_0x99a4('0x3e')]===_0x99a4('0xb6')){return _0x35e0cc[_0x99a4('0x2b')](_0x4b6c8d)['set'](_0x99a4('0xb7'),_0x99a4('0xb8'))[_0x99a4('0x38')](_0x99a4('0xb9'));}else{return _0x35e0cc['status'](_0x4b6c8d)[_0x99a4('0x2c')](_0x2266aa);}}})[_0x99a4('0x28')](handleError(_0x35e0cc,null));};exports['addApplications']=function(_0x598144,_0xcf907e){var _0x4c40a2=_0x598144[_0x99a4('0x52')]['id'];var _0x451294=_0x598144[_0x99a4('0x59')];var _0x1620d2=0xc8;var _0x30dcb2=null;return db[_0x99a4('0xba')][_0x99a4('0xbb')]({'isolationLevel':db[_0x99a4('0xba')][_0x99a4('0xbc')][_0x99a4('0xbd')][_0x99a4('0xbe')]},function(_0x20c345){return db['SmsAccount']['findOne']({'where':{'id':_0x4c40a2},'transaction':_0x20c345})[_0x99a4('0x1e')](function(_0x4c342d){if(_0x4c342d){return db[_0x99a4('0x71')][_0x99a4('0x35')]({'where':{'SmsAccountId':_0x4c40a2},'transaction':_0x20c345})[_0x99a4('0x1e')](function(){var _0x256ad1=_[_0x99a4('0x3b')](_0x451294,function(_0x5d8e6c){_0x5d8e6c['SmsAccountId']=_0x4c40a2;return _0x5d8e6c;});return db[_0x99a4('0x71')][_0x99a4('0xbf')](_0x256ad1,{'transaction':_0x20c345});});}else{_0x1620d2=0x194;_0x30dcb2=[];}});})['then'](function(){if(_0x1620d2!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x4c40a2},'order':_0x99a4('0x76')})[_0x99a4('0x1e')](function(_0x4b2ee8){_0x30dcb2=_0x4b2ee8;});}})[_0x99a4('0x28')](function(_0xf55705){_0x1620d2=0x1f4;logger[_0x99a4('0x24')](_0xf55705[_0x99a4('0x36')]);if(_0xf55705[_0x99a4('0x37')]){delete _0xf55705[_0x99a4('0x37')];}_0x30dcb2=_0xf55705;})[_0x99a4('0xc0')](function(){if(_0x30dcb2===null){_0xcf907e['sendStatus'](_0x1620d2);}else{if(_0x1620d2===0x1f4){_0xcf907e[_0x99a4('0x2b')](_0x1620d2)[_0x99a4('0x38')](_0x30dcb2);}else{_0xcf907e[_0x99a4('0x2b')](_0x1620d2)[_0x99a4('0x2c')](_0x30dcb2);}}});};exports['getApplications']=function(_0xe01255,_0xbcc73a,_0xcb3bc2){var _0x517c35={};var _0x11a162={};var _0x313e27;var _0x118469;return db[_0x99a4('0x4f')][_0x99a4('0x6c')]({'where':{'id':_0xe01255[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0xbcc73a,null))['then'](function(_0x5703ce){if(_0x5703ce){_0x313e27=_0x5703ce;_0x11a162[_0x99a4('0x40')]=_[_0x99a4('0x41')](db[_0x99a4('0x71')]['rawAttributes']);_0x11a162[_0x99a4('0x42')]=_[_0x99a4('0x41')](_0xe01255['query']);_0x11a162[_0x99a4('0x43')]=_[_0x99a4('0x44')](_0x11a162[_0x99a4('0x40')],_0x11a162[_0x99a4('0x42')]);_0x517c35[_0x99a4('0x45')]=_[_0x99a4('0x44')](_0x11a162[_0x99a4('0x40')],qs[_0x99a4('0x46')](_0xe01255[_0x99a4('0x42')][_0x99a4('0x46')]));_0x517c35[_0x99a4('0x45')]=_0x517c35[_0x99a4('0x45')][_0x99a4('0x47')]?_0x517c35[_0x99a4('0x45')]:_0x11a162['model'];_0x517c35[_0x99a4('0x66')]=qs[_0x99a4('0x49')](_0xe01255[_0x99a4('0x42')]['sort']);_0x517c35[_0x99a4('0x4d')]=qs['filters'](_[_0x99a4('0x4a')](_0xe01255['query'],_0x11a162[_0x99a4('0x43')]));if(_0xe01255[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x517c35[_0x99a4('0x4d')]=_[_0x99a4('0x4c')](_0x517c35[_0x99a4('0x4d')],{'$or':_[_0x99a4('0x3b')](_0x517c35['attributes'],function(_0x5e6fa4){var _0x510960={};_0x510960[_0x5e6fa4]={'$like':'%'+_0xe01255['query'][_0x99a4('0x4b')]+'%'};return _0x510960;})});}_0x517c35=_[_0x99a4('0x4c')]({},_0x517c35,_0xe01255[_0x99a4('0x56')]);return _0x313e27[_0x99a4('0xc1')](_0x517c35);}})[_0x99a4('0x1e')](function(_0x45716b){if(_0x45716b){_0x118469=_0x45716b[_0x99a4('0x47')];if(!_0xe01255[_0x99a4('0x42')][_0x99a4('0x48')]('nolimit')){_0x517c35[_0x99a4('0x30')]=qs[_0x99a4('0x30')](_0xe01255[_0x99a4('0x42')][_0x99a4('0x30')]);_0x517c35[_0x99a4('0x2d')]=qs[_0x99a4('0x2d')](_0xe01255[_0x99a4('0x42')][_0x99a4('0x2d')]);}return _0x313e27[_0x99a4('0xc1')](_0x517c35);}})['then'](function(_0x2979fb){if(_0x2979fb){return _0x2979fb?{'count':_0x118469,'rows':_0x2979fb}:null;}})['then'](respondWithResult(_0xbcc73a,null))[_0x99a4('0x28')](handleError(_0xbcc73a,null));};exports[_0x99a4('0xc2')]=function(_0x2ed46e,_0x4daf24,_0x1d1f4f){var _0x1cc0a3={'raw':![],'where':{}};var _0x297699={};var _0x7aa4cf={'count':0x0,'rows':[]};return db[_0x99a4('0x4f')][_0x99a4('0x6c')]({'where':{'id':_0x2ed46e[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x4daf24,null))[_0x99a4('0x1e')](function(_0x43d435){if(_0x43d435){_0x297699[_0x99a4('0x40')]=_[_0x99a4('0x41')](db['SmsInteraction'][_0x99a4('0x3c')]);_0x297699['query']=_[_0x99a4('0x41')](_0x2ed46e[_0x99a4('0x42')]);_0x297699[_0x99a4('0x43')]=_['intersection'](_0x297699[_0x99a4('0x40')],_0x297699[_0x99a4('0x42')]);_0x1cc0a3[_0x99a4('0x45')]=_[_0x99a4('0x44')](_0x297699[_0x99a4('0x40')],qs[_0x99a4('0x46')](_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x46')]));_0x1cc0a3[_0x99a4('0x45')]=_0x1cc0a3[_0x99a4('0x45')][_0x99a4('0x47')]?_0x1cc0a3[_0x99a4('0x45')]:_0x297699['model'];if(!_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x48')](_0x99a4('0x65'))){_0x1cc0a3[_0x99a4('0x30')]=qs[_0x99a4('0x30')](_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x30')]);_0x1cc0a3['offset']=qs['offset'](_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x2d')]);}_0x1cc0a3[_0x99a4('0x66')]=qs['sort'](_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x49')]);_0x1cc0a3['where']=qs[_0x99a4('0x43')](_[_0x99a4('0x4a')](_0x2ed46e[_0x99a4('0x42')],_0x297699[_0x99a4('0x43')]));_0x1cc0a3['where'][_0x99a4('0x62')]=_0x43d435['id'];if(_0x2ed46e[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x1cc0a3[_0x99a4('0x4d')]=_[_0x99a4('0x4c')](_0x1cc0a3['where'],{'$or':_[_0x99a4('0x3b')](_0x1cc0a3[_0x99a4('0x45')],function(_0x21bb0d){var _0x2a17f6={};_0x2a17f6[_0x21bb0d]={'$like':'%'+_0x2ed46e[_0x99a4('0x42')]['filter']+'%'};return _0x2a17f6;})});}_0x1cc0a3=_['merge']({},_0x1cc0a3,_0x2ed46e['options']);return db[_0x99a4('0xa2')][_0x99a4('0x2f')]({'where':_0x1cc0a3['where']})[_0x99a4('0x1e')](function(_0x42c977){_0x7aa4cf[_0x99a4('0x2f')]=_0x42c977;if(_0x2ed46e['query'][_0x99a4('0x54')]){_0x1cc0a3[_0x99a4('0x55')]=[{'model':db[_0x99a4('0x78')],'as':_0x99a4('0xc3'),'required':![]},{'model':db[_0x99a4('0xc4')],'as':_0x99a4('0xc5'),'attributes':[_0x99a4('0x37'),_0x99a4('0xc6'),_0x99a4('0xc7')],'required':![]},{'model':db[_0x99a4('0xc8')],'as':_0x99a4('0xc9'),'attributes':['id',_0x99a4('0x37'),'color'],'where':_0x2ed46e['query']['tag']?{'id':_0x2ed46e['query'][_0x99a4('0xca')]}:undefined,'required':_0x2ed46e['query'][_0x99a4('0xca')]?!![]:![]}];}return db['SmsInteraction'][_0x99a4('0x67')](_0x1cc0a3);})[_0x99a4('0x1e')](function(_0x3cc2e6){_0x7aa4cf[_0x99a4('0x50')]=_0x3cc2e6;return _0x7aa4cf;});}})[_0x99a4('0x1e')](respondWithFilteredResult(_0x4daf24,_0x1cc0a3))[_0x99a4('0x28')](handleError(_0x4daf24,null));};exports[_0x99a4('0x38')]=function(_0xbb2ffe,_0x42b685,_0x46e6fa){var _0x2eab9a,_0xc05385,_0x4d402d;if(_['isNil'](_0xbb2ffe[_0x99a4('0x59')]['body'])||_0xbb2ffe[_0x99a4('0x59')][_0x99a4('0x59')]===''){throw new db[(_0x99a4('0x79'))][(_0x99a4('0x99'))](_0x99a4('0xcb'));}if(_[_0x99a4('0x96')](_0xbb2ffe[_0x99a4('0x59')]['to'])){throw new db[(_0x99a4('0x79'))][(_0x99a4('0x99'))](_0x99a4('0xcc'));}_0x2eab9a=_0xbb2ffe[_0x99a4('0x59')]['to'];return db[_0x99a4('0x4f')][_0x99a4('0x57')]({'where':{'id':_0xbb2ffe[_0x99a4('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x99a4('0xcd'),'include':[{'model':db[_0x99a4('0x78')],'as':'Contacts','where':{'mobile':_0x2eab9a},'limit':0x1,'order':[[_0x99a4('0x7c'),_0x99a4('0x9e')]]}]}]})[_0x99a4('0x1e')](handleEntityNotFound(_0x42b685,null))[_0x99a4('0x1e')](function(_0x4cbfa6){if(_0x4cbfa6&&_0x4cbfa6['List']){_0xc05385=_0x4cbfa6[_0x99a4('0x5b')]({'plain':!![]});if(_0xc05385[_0x99a4('0xcd')]&&_0xc05385[_0x99a4('0xcd')][_0x99a4('0x9d')]['length']){return _0xc05385[_0x99a4('0xcd')][_0x99a4('0x9d')][0x0];}return db['CmContact'][_0x99a4('0x58')](_[_0x99a4('0x16')](_0xbb2ffe['body'],{'firstName':_0x2eab9a,'mobile':_0x2eab9a,'phone':_0x2eab9a,'ListId':_0xc05385[_0x99a4('0x7f')]}));}})[_0x99a4('0x1e')](handleEntityNotFound(_0x42b685,null))['then'](function(_0x1a3c59){if(_0x1a3c59){_0x4d402d=_0x1a3c59;return db[_0x99a4('0xa2')]['find']({'where':{'ContactId':_0x4d402d['id'],'closed':![],'SmsAccountId':_0xc05385['id']}})[_0x99a4('0x1e')](function(_0x3e1fc5){if(_0x3e1fc5){return[_0x3e1fc5,![]];}return db[_0x99a4('0xa2')][_0x99a4('0x58')]({'UserId':_0xbb2ffe['user']['id'],'ContactId':_0x4d402d['id'],'SmsAccountId':_0xc05385['id'],'phone':_0x2eab9a,'firstMsgDirection':_0x99a4('0xce'),'Messages':[_[_0x99a4('0x4c')](_0xbb2ffe[_0x99a4('0x59')],{'read':![],'body':_0xbb2ffe[_0x99a4('0x59')]['body'],'phone':_0x2eab9a,'SmsAccountId':_0xc05385['id'],'UserId':_0xbb2ffe[_0x99a4('0x5a')]['id'],'ContactId':_0x4d402d['id']})]},{'include':[{'model':db[_0x99a4('0xa8')],'as':_0x99a4('0xcf')}]})[_0x99a4('0x1e')](function(_0x4046d7){return[_0x4046d7,!![]];});});}})[_0x99a4('0xa3')](function(_0x50bf39,_0x4b1104){if(_0x4b1104){return _0x50bf39;}return db[_0x99a4('0xa8')]['create'](_['merge'](_0xbb2ffe['body'],{'read':![],'body':_0xbb2ffe['body']['body'],'phone':_0x2eab9a,'SmsAccountId':_0xc05385['id'],'SmsInteractionId':_0x50bf39['id'],'UserId':_0xbb2ffe[_0x99a4('0x5a')]['id'],'ContactId':_0x4d402d['id']}))['then'](function(_0x11ffeb){_0x50bf39[_0x99a4('0xd0')][_0x99a4('0xcf')]=[];_0x50bf39['dataValues'][_0x99a4('0xcf')][_0x99a4('0xa6')](_0x11ffeb[_0x99a4('0xd0')]);return _0x50bf39;});})['then'](respondWithResult(_0x42b685,null))['catch'](handleError(_0x42b685,null));};exports[_0x99a4('0x2b')]=function(_0x449570,_0x3a226d,_0x19bdb0){if(_0x449570[_0x99a4('0x59')]['id']){delete _0x449570[_0x99a4('0x59')]['id'];}var _0x411edb,_0x1561f6,_0x39935d;return db[_0x99a4('0x4f')]['find']({'where':{'id':_0x449570[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x3a226d,null))[_0x99a4('0x1e')](function(_0x29ad4a){if(_0x29ad4a){_0x39935d=_0x29ad4a;logger[_0x99a4('0x22')](_0x99a4('0xb3'),'status',_0x99a4('0xd1'),_0x29ad4a[_0x99a4('0x3e')],util['inspect'](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));switch(_0x29ad4a[_0x99a4('0x3e')]){case _0x99a4('0x84'):if(_0x449570[_0x99a4('0x59')][_0x99a4('0xd2')]&&_0x449570[_0x99a4('0x59')]['status']){_0x1561f6=_0x449570[_0x99a4('0x59')][_0x99a4('0x2b')];return db['SmsMessage'][_0x99a4('0x57')]({'where':{'messageId':_0x449570[_0x99a4('0x59')][_0x99a4('0xd2')]}});}break;case _0x99a4('0x87'):if(_0x449570['body'][_0x99a4('0xd3')]&&_0x449570[_0x99a4('0x59')][_0x99a4('0xd4')]){_0x1561f6=_0x449570[_0x99a4('0x59')][_0x99a4('0xd4')];return db[_0x99a4('0xa8')][_0x99a4('0x57')]({'where':{'messageId':_0x449570[_0x99a4('0x59')][_0x99a4('0xd3')]}});}break;case _0x99a4('0xd5'):if(_0x449570[_0x99a4('0x59')]['message_id']&&_0x449570[_0x99a4('0x59')][_0x99a4('0xd6')]){_0x1561f6=_0x449570['body']['status_code'];return db[_0x99a4('0xa8')]['find']({'where':{'messageId':_0x449570[_0x99a4('0x59')]['message_id']}});}break;case _0x99a4('0x8b'):var _0x3e4c77=_0x449570[_0x99a4('0x59')][_0x99a4('0x8c')][0x0];if(_0x3e4c77[_0x99a4('0x88')]&&_0x3e4c77[_0x99a4('0x2b')][_0x99a4('0xd7')]===_0x99a4('0xd8')){_0x1561f6=_0x3e4c77['status']['groupName'];return db['SmsMessage'][_0x99a4('0x57')]({'where':{'messageId':_0x3e4c77[_0x99a4('0x88')]}});}break;case'clickatell':if(_0x449570[_0x99a4('0x59')][_0x99a4('0x88')]&&_0x449570[_0x99a4('0x59')][_0x99a4('0x2b')]){_0x1561f6=_0x449570[_0x99a4('0x59')][_0x99a4('0x2b')];return db[_0x99a4('0xa8')]['find']({'where':{'messageId':_0x449570[_0x99a4('0x59')]['messageId']}});}break;case _0x99a4('0x93'):if(_0x449570[_0x99a4('0x59')][0x0][_0x99a4('0x26')]['id']){_0x1561f6=_0x449570[_0x99a4('0x59')][0x0][_0x99a4('0x3e')];return db[_0x99a4('0xa8')][_0x99a4('0x57')]({'where':{'messageId':_0x449570[_0x99a4('0x59')][0x0][_0x99a4('0x26')]['id']}});}break;case'intelepeer':if(_0x449570[_0x99a4('0x59')][_0x99a4('0xd9')]&&_0x449570[_0x99a4('0x59')][_0x99a4('0x2b')]){_0x1561f6=_0x449570[_0x99a4('0x59')][_0x99a4('0x2b')];return db[_0x99a4('0xa8')]['find']({'where':{'messageId':_0x449570[_0x99a4('0x59')][_0x99a4('0xd9')]}});}break;}}})[_0x99a4('0x1e')](handleEntityNotFound(_0x3a226d,null))[_0x99a4('0x1e')](function(_0x5ece82){if(_0x5ece82){_0x411edb=_0x5ece82;switch(_0x39935d[_0x99a4('0x3e')]){case _0x99a4('0x84'):if(_0x1561f6===_0x99a4('0xd8')){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger[_0x99a4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99a4('0x2b'),_0x99a4('0x84'),util[_0x99a4('0xdb')](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1561f6==='1'){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger[_0x99a4('0x24')](_0x99a4('0xb3'),_0x99a4('0x2b'),'skebby',util[_0x99a4('0xdb')](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case _0x99a4('0xd5'):if(!_0x449570['body'][_0x99a4('0xdc')]&&_0x1561f6>=0xc8&&_0x1561f6<=0xce){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger['error'](_0x99a4('0xb3'),_0x99a4('0x2b'),_0x99a4('0xd5'),util[_0x99a4('0xdb')](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case _0x99a4('0x8b'):var _0x14a87=_0x449570['body'][_0x99a4('0x8c')][0x0];if(_0x14a87[_0x99a4('0x2b')][_0x99a4('0xd7')]===_0x99a4('0xd8')){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99a4('0x2b'),_0x99a4('0x8b'),util['inspect'](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case _0x99a4('0x90'):if(_0x1561f6=='DELIVERED_TO_GATEWAY'||_0x1561f6=='RECEIVED_BY_RECIPIENT'){return _0x411edb['update']({'read':!![]});}else{logger['error'](_0x99a4('0xb3'),_0x99a4('0x2b'),_0x99a4('0x90'),util['inspect'](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1561f6==_0x99a4('0xdd')){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger[_0x99a4('0x24')](_0x99a4('0xb3'),_0x99a4('0x2b'),'bandwidth',util['inspect'](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;case _0x99a4('0x94'):if(_0x1561f6===_0x99a4('0xde')||_0x1561f6==='ACCEPTD'){return _0x411edb[_0x99a4('0xda')]({'read':!![]});}else{logger[_0x99a4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99a4('0x2b'),_0x99a4('0x94'),util[_0x99a4('0xdb')](_0x449570[_0x99a4('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x411edb;}})[_0x99a4('0x1e')](respondWithResult(_0x3a226d,null))['catch'](handleError(_0x3a226d,null));};exports[_0x99a4('0xdf')]=function(_0x3dea89,_0x1d63e3,_0x13ae39){var _0x25f80e,_0x97b4a2,_0xee5394;return db['SmsAccount']['find']({'where':{'id':_0x3dea89[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x1d63e3,null))[_0x99a4('0x1e')](function(_0xe0496d){if(_0xe0496d){_0xee5394=_0xe0496d;logger['debug'](_0x99a4('0xb3'),_0x99a4('0x2b'),_0x99a4('0xd1'),_0xe0496d[_0x99a4('0x3e')],util[_0x99a4('0xdb')](_0x3dea89[_0x99a4('0x42')],{'showHidden':![],'depth':null}));switch(_0xe0496d[_0x99a4('0x3e')]){case _0x99a4('0x8d'):if(_0x3dea89[_0x99a4('0x42')]['message-id']&&_0x3dea89['query'][_0x99a4('0xe0')]){_0x97b4a2=_0x3dea89[_0x99a4('0x42')][_0x99a4('0xe0')];return db[_0x99a4('0xa8')]['find']({'where':{'messageId':_0x3dea89[_0x99a4('0x42')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x1d63e3,null))[_0x99a4('0x1e')](function(_0x12bac0){if(_0x12bac0){_0x25f80e=_0x12bac0;switch(_0xee5394[_0x99a4('0x3e')]){case'csc':if(_0x97b4a2==='2'||_0x97b4a2==='6'){return _0x25f80e[_0x99a4('0xda')]({'read':!![]});}else{logger[_0x99a4('0x24')](_0x99a4('0xb3'),_0x99a4('0x2b'),'csc',util[_0x99a4('0xdb')](_0x3dea89[_0x99a4('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x25f80e;}})['then'](respondWithResult(_0x1d63e3,null))['catch'](handleError(_0x1d63e3,null));};exports['addAgents']=function(_0x3f4131,_0x4a7354,_0x4f133b){return db[_0x99a4('0x4f')][_0x99a4('0x57')]({'where':{'id':_0x3f4131[_0x99a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a7354,null))[_0x99a4('0x1e')](function(_0x49afd2){if(_0x49afd2){return _0x49afd2[_0x99a4('0xe1')](_0x3f4131[_0x99a4('0x59')][_0x99a4('0x69')],_[_0x99a4('0xa0')](_0x3f4131[_0x99a4('0x59')],[_0x99a4('0x69'),'id'])||{})['spread'](function(_0x361bee){for(var _0x2b071f=0x0;_0x2b071f<_0x3f4131['body'][_0x99a4('0x69')][_0x99a4('0x47')];_0x2b071f+=0x1){socket[_0x99a4('0xe2')](_0x99a4('0xe3'),{'UserId':Number(_0x3f4131[_0x99a4('0x59')][_0x99a4('0x69')][_0x2b071f]),'SmsAccountId':Number(_0x3f4131[_0x99a4('0x52')]['id'])});}return _0x361bee;});}})['then'](respondWithResult(_0x4a7354,null))['catch'](handleError(_0x4a7354,null));};exports['removeAgents']=function(_0x117fba,_0x21f9e6,_0x2d39de){return db[_0x99a4('0x4f')][_0x99a4('0x57')]({'where':{'id':_0x117fba[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x21f9e6,null))[_0x99a4('0x1e')](function(_0x3e9ff0){if(_0x3e9ff0){return _0x3e9ff0[_0x99a4('0xe4')](_0x117fba[_0x99a4('0x42')][_0x99a4('0x69')])[_0x99a4('0x1e')](function(){if(_[_0x99a4('0xe5')](_0x117fba[_0x99a4('0x42')]['ids'])){for(var _0x56b508=0x0;_0x56b508<_0x117fba[_0x99a4('0x42')][_0x99a4('0x69')][_0x99a4('0x47')];_0x56b508+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x117fba['query'][_0x99a4('0x69')][_0x56b508]),'SmsAccountId':Number(_0x117fba['params']['id'])});}}else{socket['emit'](_0x99a4('0xe6'),{'UserId':Number(_0x117fba[_0x99a4('0x42')]['ids']),'SmsAccountId':Number(_0x117fba['params']['id'])});}});}})[_0x99a4('0x1e')](respondWithStatusCode(_0x21f9e6,null))[_0x99a4('0x28')](handleError(_0x21f9e6,null));};exports[_0x99a4('0xe7')]=function(_0x4f591f,_0x1977de,_0xcc8455){var _0x508241={};var _0x123510={};var _0xc6bde7;var _0x3d74fd;return db['SmsAccount'][_0x99a4('0x6c')]({'where':{'id':_0x4f591f[_0x99a4('0x52')]['id']}})[_0x99a4('0x1e')](handleEntityNotFound(_0x1977de,null))[_0x99a4('0x1e')](function(_0x448973){if(_0x448973){_0xc6bde7=_0x448973;_0x123510[_0x99a4('0x40')]=_['keys'](db[_0x99a4('0xc4')]['rawAttributes']);_0x123510[_0x99a4('0x42')]=_['keys'](_0x4f591f[_0x99a4('0x42')]);_0x123510[_0x99a4('0x43')]=_[_0x99a4('0x44')](_0x123510[_0x99a4('0x40')],_0x123510[_0x99a4('0x42')]);_0x508241['attributes']=_[_0x99a4('0x44')](_0x123510[_0x99a4('0x40')],qs['fields'](_0x4f591f[_0x99a4('0x42')]['fields']));_0x508241[_0x99a4('0x45')]=_0x508241[_0x99a4('0x45')]['length']?_0x508241[_0x99a4('0x45')]:_0x123510[_0x99a4('0x40')];_0x508241[_0x99a4('0x66')]=qs[_0x99a4('0x49')](_0x4f591f['query'][_0x99a4('0x49')]);_0x508241[_0x99a4('0x4d')]=qs[_0x99a4('0x43')](_['pick'](_0x4f591f[_0x99a4('0x42')],_0x123510[_0x99a4('0x43')]));if(_0x4f591f[_0x99a4('0x42')][_0x99a4('0x4b')]){_0x508241[_0x99a4('0x4d')]=_[_0x99a4('0x4c')](_0x508241[_0x99a4('0x4d')],{'$or':_[_0x99a4('0x3b')](_0x508241[_0x99a4('0x45')],function(_0x3db492){var _0x33264f={};_0x33264f[_0x3db492]={'$like':'%'+_0x4f591f[_0x99a4('0x42')][_0x99a4('0x4b')]+'%'};return _0x33264f;})});}_0x508241=_[_0x99a4('0x4c')]({},_0x508241,_0x4f591f['options']);return _0xc6bde7[_0x99a4('0xe7')](_0x508241);}})['then'](function(_0x32b094){if(_0x32b094){_0x3d74fd=_0x32b094[_0x99a4('0x47')];if(!_0x4f591f[_0x99a4('0x42')][_0x99a4('0x48')](_0x99a4('0x65'))){_0x508241[_0x99a4('0x30')]=qs[_0x99a4('0x30')](_0x4f591f[_0x99a4('0x42')]['limit']);_0x508241[_0x99a4('0x2d')]=qs[_0x99a4('0x2d')](_0x4f591f[_0x99a4('0x42')][_0x99a4('0x2d')]);}return _0xc6bde7[_0x99a4('0xe7')](_0x508241);}})['then'](function(_0x6f6b1f){if(_0x6f6b1f){return _0x6f6b1f?{'count':_0x3d74fd,'rows':_0x6f6b1f}:null;}})[_0x99a4('0x1e')](respondWithResult(_0x1977de,null))[_0x99a4('0x28')](handleError(_0x1977de,null));};
\ No newline at end of file
+var _0xeeb6=['squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','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','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','params','intersection','find','create','user','role','UserProfileSection','userProfileId','update','body','describe','addDisposition','getDispositions','findOne','Disposition','SmsAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','ids','notify','sms','Applications','account','orderBy','priority','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','ListId','mobile','twilio','messageId','MessageSid','from','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','spread','interaction','created','autoclose','push','applications','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','getApplications','getInteractions','SmsInteraction','User','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','clickatell','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra'];(function(_0x7288be,_0x298a78){var _0x4a6eab=function(_0x12e23e){while(--_0x12e23e){_0x7288be['push'](_0x7288be['shift']());}};_0x4a6eab(++_0x298a78);}(_0xeeb6,0x1ac));var _0x6eeb=function(_0x5b095b,_0x1fc227){_0x5b095b=_0x5b095b-0x0;var _0x47c975=_0xeeb6[_0x5b095b];return _0x47c975;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6eeb('0x0'));var zipdir=require(_0x6eeb('0x1'));var jsonpatch=require(_0x6eeb('0x2'));var rp=require(_0x6eeb('0x3'));var moment=require(_0x6eeb('0x4'));var BPromise=require(_0x6eeb('0x5'));var Mustache=require(_0x6eeb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6eeb('0x7'));var csv=require('to-csv');var ejs=require(_0x6eeb('0x8'));var fs=require('fs');var fs_extra=require(_0x6eeb('0x9'));var _=require('lodash');var squel=require(_0x6eeb('0xa'));var crypto=require('crypto');var jsforce=require(_0x6eeb('0xb'));var deskjs=require(_0x6eeb('0xc'));var toCsv=require(_0x6eeb('0xd'));var querystring=require(_0x6eeb('0xe'));var Papa=require('papaparse');var Redis=require(_0x6eeb('0xf'));var authService=require(_0x6eeb('0x10'));var qs=require(_0x6eeb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eeb('0x12'));var logger=require(_0x6eeb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6eeb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6eeb('0x15'))['db'];config[_0x6eeb('0x16')]=_['defaults'](config[_0x6eeb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x6eeb('0x17'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x6eeb('0x18')](socket);var jayson=require(_0x6eeb('0x19'));var client=jayson['client'][_0x6eeb('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x5a1350,_0x4cdef0,_0x1fca80,_0x43d065){return new BPromise(function(_0x464045,_0xf3f400){var _0x84f79e=_0x43d065||client;return _0x84f79e[_0x6eeb('0x1b')](_0x5a1350,_0x1fca80)[_0x6eeb('0x1c')](function(_0x485738){logger[_0x6eeb('0x1d')](_0x6eeb('0x1e'),_0x4cdef0,_0x6eeb('0x1f'));logger[_0x6eeb('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cdef0,_0x6eeb('0x1f'),JSON[_0x6eeb('0x21')](_0x485738));if(_0x485738[_0x6eeb('0x22')]){if(_0x485738['error'][_0x6eeb('0x23')]===0x1f4){logger['error'](_0x6eeb('0x1e'),_0x4cdef0,_0x485738[_0x6eeb('0x22')][_0x6eeb('0x24')]);return _0xf3f400(_0x485738['error']['message']);}logger[_0x6eeb('0x22')](_0x6eeb('0x1e'),_0x4cdef0,_0x485738[_0x6eeb('0x22')][_0x6eeb('0x24')]);return _0x464045(_0x485738[_0x6eeb('0x22')][_0x6eeb('0x24')]);}else{logger[_0x6eeb('0x1d')](_0x6eeb('0x1e'),_0x4cdef0,_0x6eeb('0x1f'));_0x464045(_0x485738[_0x6eeb('0x25')][_0x6eeb('0x24')]);}})[_0x6eeb('0x26')](function(_0x3a71c4){logger[_0x6eeb('0x22')](_0x6eeb('0x1e'),_0x4cdef0,_0x3a71c4);_0xf3f400(_0x3a71c4);});});}function respondWithStatusCode(_0x5ee368,_0x1dc660){_0x1dc660=_0x1dc660||0xcc;return function(_0x2cc7e6){if(_0x2cc7e6){return _0x5ee368[_0x6eeb('0x27')](_0x1dc660);}return _0x5ee368[_0x6eeb('0x28')](_0x1dc660)[_0x6eeb('0x29')]();};}function respondWithResult(_0x470e96,_0x24df08){_0x24df08=_0x24df08||0xc8;return function(_0x4cecab){if(_0x4cecab){return _0x470e96[_0x6eeb('0x28')](_0x24df08)[_0x6eeb('0x2a')](_0x4cecab);}};}function respondWithFilteredResult(_0x14af3a,_0x4b9d6a){return function(_0x21aacf){if(_0x21aacf){var _0xc7df02=typeof _0x4b9d6a[_0x6eeb('0x2b')]==='undefined'&&typeof _0x4b9d6a['limit']===_0x6eeb('0x2c');var _0x2c3c63=_0x21aacf['count'];var _0x447945=_0xc7df02?0x0:_0x4b9d6a[_0x6eeb('0x2b')];var _0x4f049b=_0xc7df02?_0x21aacf[_0x6eeb('0x2d')]:_0x4b9d6a[_0x6eeb('0x2b')]+_0x4b9d6a[_0x6eeb('0x2e')];var _0x2e798e;if(_0x4f049b>=_0x2c3c63){_0x4f049b=_0x2c3c63;_0x2e798e=0xc8;}else{_0x2e798e=0xce;}_0x14af3a[_0x6eeb('0x28')](_0x2e798e);return _0x14af3a[_0x6eeb('0x2f')](_0x6eeb('0x30'),_0x447945+'-'+_0x4f049b+'/'+_0x2c3c63)['json'](_0x21aacf);}return null;};}function patchUpdates(_0x48883d){return function(_0x457763){try{jsonpatch[_0x6eeb('0x31')](_0x457763,_0x48883d,!![]);}catch(_0x1edef9){return BPromise[_0x6eeb('0x32')](_0x1edef9);}return _0x457763['save']();};}function saveUpdates(_0xb57cf7,_0x243d4a){return function(_0x5dc168){if(_0x5dc168){return _0x5dc168['update'](_0xb57cf7)['then'](function(_0x35ae1b){return _0x35ae1b;});}return null;};}function removeEntity(_0x108b45,_0x220b5e){return function(_0x70569c){if(_0x70569c){return _0x70569c[_0x6eeb('0x33')]()[_0x6eeb('0x1c')](function(){var _0x53f1fd=_0x70569c[_0x6eeb('0x34')]({'plain':!![]});var _0xad7f4d='SmsAccounts';return db[_0x6eeb('0x35')][_0x6eeb('0x33')]({'where':{'type':_0xad7f4d,'resourceId':_0x53f1fd['id']}})[_0x6eeb('0x1c')](function(){return _0x70569c;});})[_0x6eeb('0x1c')](function(){_0x108b45[_0x6eeb('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0290,_0xee6578){return function(_0xd8b923){if(!_0xd8b923){_0x5f0290[_0x6eeb('0x27')](0x194);}return _0xd8b923;};}function handleError(_0x56a02c,_0x29af77){_0x29af77=_0x29af77||0x1f4;return function(_0x26e361){logger[_0x6eeb('0x22')](_0x26e361[_0x6eeb('0x36')]);if(_0x26e361[_0x6eeb('0x37')]){delete _0x26e361[_0x6eeb('0x37')];}_0x56a02c[_0x6eeb('0x28')](_0x29af77)[_0x6eeb('0x38')](_0x26e361);};}exports[_0x6eeb('0x39')]=function(_0x4233f1,_0x382e79){var _0x587c1f={'include':[{'model':db['Pause'],'as':_0x6eeb('0x3a')}]},_0x212944={},_0x32c6c9={'count':0x0,'rows':[]};var _0x30bf71=_['map'](db[_0x6eeb('0x3b')][_0x6eeb('0x3c')],function(_0xa0f0ac){return{'name':_0xa0f0ac[_0x6eeb('0x3d')],'type':_0xa0f0ac[_0x6eeb('0x3e')]['key']};});_0x212944[_0x6eeb('0x3f')]=_[_0x6eeb('0x40')](_0x30bf71,_0x6eeb('0x37'));_0x212944[_0x6eeb('0x41')]=_[_0x6eeb('0x42')](_0x4233f1[_0x6eeb('0x41')]);_0x212944[_0x6eeb('0x43')]=_['intersection'](_0x212944[_0x6eeb('0x3f')],_0x212944[_0x6eeb('0x41')]);_0x587c1f[_0x6eeb('0x44')]=_['intersection'](_0x212944['model'],qs['fields'](_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x587c1f[_0x6eeb('0x44')]=_0x587c1f[_0x6eeb('0x44')][_0x6eeb('0x46')]?_0x587c1f[_0x6eeb('0x44')]:_0x212944['model'];if(!_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x47')](_0x6eeb('0x48'))){_0x587c1f['limit']=qs['limit'](_0x4233f1['query'][_0x6eeb('0x2e')]);_0x587c1f['offset']=qs[_0x6eeb('0x2b')](_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x2b')]);}_0x587c1f['order']=qs[_0x6eeb('0x49')](_0x4233f1[_0x6eeb('0x41')]['sort']);_0x587c1f['where']=qs['filters'](_[_0x6eeb('0x4a')](_0x4233f1[_0x6eeb('0x41')],_0x212944[_0x6eeb('0x43')]),_0x30bf71);if(_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x4b')]){_0x587c1f[_0x6eeb('0x4c')]=_[_0x6eeb('0x4d')](_0x587c1f['where'],{'$or':_[_0x6eeb('0x40')](_0x30bf71,function(_0x14c7d0){if(_0x14c7d0['type']!=='VIRTUAL'){var _0x2bdb9f={};_0x2bdb9f[_0x14c7d0[_0x6eeb('0x37')]]={'$like':'%'+_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x4b')]+'%'};return _0x2bdb9f;}})});}_0x587c1f=_[_0x6eeb('0x4d')]({},_0x587c1f,_0x4233f1[_0x6eeb('0x4e')]);var _0x25c02a={'where':_0x587c1f[_0x6eeb('0x4c')]};return db[_0x6eeb('0x3b')][_0x6eeb('0x2d')](_0x25c02a)[_0x6eeb('0x1c')](function(_0x3054e7){_0x32c6c9[_0x6eeb('0x2d')]=_0x3054e7;if(_0x4233f1[_0x6eeb('0x41')][_0x6eeb('0x4f')]){_0x587c1f[_0x6eeb('0x50')]=[{'all':!![]}];}return db[_0x6eeb('0x3b')][_0x6eeb('0x51')](_0x587c1f);})[_0x6eeb('0x1c')](function(_0x25905b){_0x32c6c9[_0x6eeb('0x52')]=_0x25905b;return _0x32c6c9;})[_0x6eeb('0x1c')](respondWithFilteredResult(_0x382e79,_0x587c1f))[_0x6eeb('0x26')](handleError(_0x382e79,null));};exports['show']=function(_0xa15ee1,_0x59500c){var _0x504a5e={'raw':![],'where':{'id':_0xa15ee1[_0x6eeb('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x6eeb('0x3a')}]},_0xd0477b={};_0xd0477b[_0x6eeb('0x3f')]=_[_0x6eeb('0x42')](db[_0x6eeb('0x3b')][_0x6eeb('0x3c')]);_0xd0477b[_0x6eeb('0x41')]=_['keys'](_0xa15ee1['query']);_0xd0477b['filters']=_[_0x6eeb('0x54')](_0xd0477b['model'],_0xd0477b[_0x6eeb('0x41')]);_0x504a5e[_0x6eeb('0x44')]=_['intersection'](_0xd0477b['model'],qs[_0x6eeb('0x45')](_0xa15ee1[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x504a5e['attributes']=_0x504a5e['attributes']['length']?_0x504a5e[_0x6eeb('0x44')]:_0xd0477b['model'];if(_0xa15ee1[_0x6eeb('0x41')][_0x6eeb('0x4f')]){_0x504a5e[_0x6eeb('0x50')]=[{'all':!![]}];}_0x504a5e=_[_0x6eeb('0x4d')]({},_0x504a5e,_0xa15ee1[_0x6eeb('0x4e')]);return db[_0x6eeb('0x3b')][_0x6eeb('0x55')](_0x504a5e)[_0x6eeb('0x1c')](handleEntityNotFound(_0x59500c,null))[_0x6eeb('0x1c')](respondWithResult(_0x59500c,null))[_0x6eeb('0x26')](handleError(_0x59500c,null));};exports[_0x6eeb('0x56')]=function(_0x2c7f35,_0x48ea10){return db[_0x6eeb('0x3b')]['create'](_0x2c7f35['body'],{})[_0x6eeb('0x1c')](function(_0x380c2c){var _0x13bac2=_0x2c7f35[_0x6eeb('0x57')][_0x6eeb('0x34')]({'plain':!![]});if(!_0x13bac2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13bac2[_0x6eeb('0x58')]===_0x6eeb('0x57')){var _0x5d0376=_0x380c2c[_0x6eeb('0x34')]({'plain':!![]});var _0x31cffe='SmsAccounts';return db[_0x6eeb('0x59')]['find']({'where':{'name':_0x31cffe,'userProfileId':_0x13bac2[_0x6eeb('0x5a')]},'raw':!![]})[_0x6eeb('0x1c')](function(_0x518483){if(_0x518483&&_0x518483['autoAssociation']===0x0){return db[_0x6eeb('0x35')][_0x6eeb('0x56')]({'name':_0x5d0376[_0x6eeb('0x37')],'resourceId':_0x5d0376['id'],'type':_0x518483['name'],'sectionId':_0x518483['id']},{})[_0x6eeb('0x1c')](function(){return _0x380c2c;});}else{return _0x380c2c;}})[_0x6eeb('0x26')](function(_0x4cd977){logger[_0x6eeb('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cd977);throw _0x4cd977;});}return _0x380c2c;})[_0x6eeb('0x1c')](respondWithResult(_0x48ea10,0xc9))[_0x6eeb('0x26')](handleError(_0x48ea10,null));};exports[_0x6eeb('0x5b')]=function(_0x10fceb,_0x19233a){if(_0x10fceb[_0x6eeb('0x5c')]['id']){delete _0x10fceb['body']['id'];}return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x10fceb[_0x6eeb('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x6eeb('0x3a')}]})['then'](handleEntityNotFound(_0x19233a,null))[_0x6eeb('0x1c')](saveUpdates(_0x10fceb[_0x6eeb('0x5c')],null))['then'](respondWithResult(_0x19233a,null))[_0x6eeb('0x26')](handleError(_0x19233a,null));};exports['destroy']=function(_0x4b7792,_0x1ffa3c){return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x4b7792['params']['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x1ffa3c,null))[_0x6eeb('0x1c')](removeEntity(_0x1ffa3c,null))[_0x6eeb('0x26')](handleError(_0x1ffa3c,null));};exports[_0x6eeb('0x5d')]=function(_0x385db3,_0x36add4){return db[_0x6eeb('0x3b')][_0x6eeb('0x5d')]()[_0x6eeb('0x1c')](respondWithResult(_0x36add4,null))[_0x6eeb('0x26')](handleError(_0x36add4,null));};exports[_0x6eeb('0x5e')]=function(_0x81a368,_0x2ffdf3,_0x2e29f7){if(_0x81a368[_0x6eeb('0x5c')]['id']){delete _0x81a368[_0x6eeb('0x5c')]['id'];}return db[_0x6eeb('0x3b')]['find']({'where':{'id':_0x81a368[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x2ffdf3,null))['then'](function(_0x23baec){if(_0x23baec){_0x81a368['body']['SmsAccountId']=_0x23baec['id'];return db['Disposition'][_0x6eeb('0x56')](_0x81a368['body']);}})['then'](respondWithResult(_0x2ffdf3,null))[_0x6eeb('0x26')](handleError(_0x2ffdf3,null));};exports[_0x6eeb('0x5f')]=function(_0xd02e75,_0x29db92,_0x36d7b0){var _0x50f60f={'raw':![],'where':{}};var _0x368726={};var _0x22e342={'count':0x0,'rows':[]};return db[_0x6eeb('0x3b')][_0x6eeb('0x60')]({'where':{'id':_0xd02e75[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x29db92,null))[_0x6eeb('0x1c')](function(_0x3bd60d){if(_0x3bd60d){_0x368726[_0x6eeb('0x3f')]=_[_0x6eeb('0x42')](db[_0x6eeb('0x61')][_0x6eeb('0x3c')]);_0x368726[_0x6eeb('0x41')]=_['keys'](_0xd02e75[_0x6eeb('0x41')]);_0x368726[_0x6eeb('0x43')]=_[_0x6eeb('0x54')](_0x368726['model'],_0x368726[_0x6eeb('0x41')]);_0x50f60f[_0x6eeb('0x44')]=_[_0x6eeb('0x54')](_0x368726['model'],qs[_0x6eeb('0x45')](_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x50f60f[_0x6eeb('0x44')]=_0x50f60f[_0x6eeb('0x44')][_0x6eeb('0x46')]?_0x50f60f[_0x6eeb('0x44')]:_0x368726[_0x6eeb('0x3f')];if(!_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x47')]('nolimit')){_0x50f60f[_0x6eeb('0x2e')]=qs[_0x6eeb('0x2e')](_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x2e')]);_0x50f60f[_0x6eeb('0x2b')]=qs['offset'](_0xd02e75['query']['offset']);}_0x50f60f['order']=qs[_0x6eeb('0x49')](_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x49')]);_0x50f60f[_0x6eeb('0x4c')]=qs['filters'](_[_0x6eeb('0x4a')](_0xd02e75[_0x6eeb('0x41')],_0x368726[_0x6eeb('0x43')]));_0x50f60f[_0x6eeb('0x4c')][_0x6eeb('0x62')]=_0x3bd60d['id'];if(_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x4b')]){_0x50f60f['where']=_[_0x6eeb('0x4d')](_0x50f60f[_0x6eeb('0x4c')],{'$or':_[_0x6eeb('0x40')](_0x50f60f[_0x6eeb('0x44')],function(_0x264aef){var _0xbed70c={};_0xbed70c[_0x264aef]={'$like':'%'+_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x4b')]+'%'};return _0xbed70c;})});}_0x50f60f=_[_0x6eeb('0x4d')]({},_0x50f60f,_0xd02e75[_0x6eeb('0x4e')]);return db[_0x6eeb('0x61')]['count']({'where':_0x50f60f[_0x6eeb('0x4c')]})['then'](function(_0x4e9117){_0x22e342['count']=_0x4e9117;if(_0xd02e75[_0x6eeb('0x41')][_0x6eeb('0x4f')]){_0x50f60f[_0x6eeb('0x50')]=[{'all':!![]}];}return db[_0x6eeb('0x61')][_0x6eeb('0x51')](_0x50f60f);})[_0x6eeb('0x1c')](function(_0x3ebaa5){_0x22e342[_0x6eeb('0x52')]=_0x3ebaa5;return _0x22e342;});}})[_0x6eeb('0x1c')](respondWithFilteredResult(_0x29db92,_0x50f60f))[_0x6eeb('0x26')](handleError(_0x29db92,null));};exports['removeDispositions']=function(_0x5e9c4e,_0x22e96f,_0xd6a396){return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x5e9c4e[_0x6eeb('0x53')]['id']}})['then'](handleEntityNotFound(_0x22e96f,null))[_0x6eeb('0x1c')](function(_0x316684){if(_0x316684){return _0x316684[_0x6eeb('0x63')](_0x5e9c4e[_0x6eeb('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x22e96f,null))['catch'](handleError(_0x22e96f,null));};exports[_0x6eeb('0x64')]=function(_0x471fed,_0x5ee38e,_0x546e63){if(_0x471fed[_0x6eeb('0x5c')]['id']){delete _0x471fed['body']['id'];}return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x471fed['params']['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x5ee38e,null))['then'](function(_0xfb62d){if(_0xfb62d){_0x471fed[_0x6eeb('0x5c')][_0x6eeb('0x62')]=_0xfb62d['id'];return db[_0x6eeb('0x65')][_0x6eeb('0x56')](_0x471fed[_0x6eeb('0x5c')]);}})[_0x6eeb('0x1c')](respondWithResult(_0x5ee38e,null))[_0x6eeb('0x26')](handleError(_0x5ee38e,null));};exports[_0x6eeb('0x66')]=function(_0x55bb95,_0x513f75,_0x53f83e){var _0x2d697a={'raw':![],'where':{}};var _0x34e497={};var _0x3299f3={'count':0x0,'rows':[]};return db[_0x6eeb('0x3b')]['findOne']({'where':{'id':_0x55bb95[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x513f75,null))[_0x6eeb('0x1c')](function(_0x3cf258){if(_0x3cf258){_0x34e497['model']=_[_0x6eeb('0x42')](db[_0x6eeb('0x65')][_0x6eeb('0x3c')]);_0x34e497[_0x6eeb('0x41')]=_[_0x6eeb('0x42')](_0x55bb95[_0x6eeb('0x41')]);_0x34e497[_0x6eeb('0x43')]=_[_0x6eeb('0x54')](_0x34e497['model'],_0x34e497[_0x6eeb('0x41')]);_0x2d697a[_0x6eeb('0x44')]=_[_0x6eeb('0x54')](_0x34e497[_0x6eeb('0x3f')],qs['fields'](_0x55bb95[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x2d697a[_0x6eeb('0x44')]=_0x2d697a[_0x6eeb('0x44')][_0x6eeb('0x46')]?_0x2d697a[_0x6eeb('0x44')]:_0x34e497[_0x6eeb('0x3f')];if(!_0x55bb95[_0x6eeb('0x41')]['hasOwnProperty'](_0x6eeb('0x48'))){_0x2d697a[_0x6eeb('0x2e')]=qs[_0x6eeb('0x2e')](_0x55bb95['query']['limit']);_0x2d697a[_0x6eeb('0x2b')]=qs[_0x6eeb('0x2b')](_0x55bb95['query']['offset']);}_0x2d697a[_0x6eeb('0x67')]=qs['sort'](_0x55bb95[_0x6eeb('0x41')][_0x6eeb('0x49')]);_0x2d697a[_0x6eeb('0x4c')]=qs[_0x6eeb('0x43')](_['pick'](_0x55bb95[_0x6eeb('0x41')],_0x34e497[_0x6eeb('0x43')]));_0x2d697a[_0x6eeb('0x4c')][_0x6eeb('0x62')]=_0x3cf258['id'];if(_0x55bb95[_0x6eeb('0x41')][_0x6eeb('0x4b')]){_0x2d697a[_0x6eeb('0x4c')]=_[_0x6eeb('0x4d')](_0x2d697a[_0x6eeb('0x4c')],{'$or':_['map'](_0x2d697a[_0x6eeb('0x44')],function(_0x28c0d3){var _0x34b42c={};_0x34b42c[_0x28c0d3]={'$like':'%'+_0x55bb95[_0x6eeb('0x41')][_0x6eeb('0x4b')]+'%'};return _0x34b42c;})});}_0x2d697a=_[_0x6eeb('0x4d')]({},_0x2d697a,_0x55bb95['options']);return db[_0x6eeb('0x65')]['count']({'where':_0x2d697a['where']})[_0x6eeb('0x1c')](function(_0x300d44){_0x3299f3[_0x6eeb('0x2d')]=_0x300d44;if(_0x55bb95[_0x6eeb('0x41')][_0x6eeb('0x4f')]){_0x2d697a[_0x6eeb('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6eeb('0x51')](_0x2d697a);})['then'](function(_0x3aed31){_0x3299f3['rows']=_0x3aed31;return _0x3299f3;});}})[_0x6eeb('0x1c')](respondWithFilteredResult(_0x513f75,_0x2d697a))[_0x6eeb('0x26')](handleError(_0x513f75,null));};exports['removeAnswers']=function(_0x3c1f57,_0x3ec00d,_0x2b3d7d){return db[_0x6eeb('0x3b')]['find']({'where':{'id':_0x3c1f57[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x3ec00d,null))['then'](function(_0x1b3d21){if(_0x1b3d21){return _0x1b3d21[_0x6eeb('0x68')](_0x3c1f57[_0x6eeb('0x41')][_0x6eeb('0x69')]);}})['then'](respondWithStatusCode(_0x3ec00d,null))['catch'](handleError(_0x3ec00d,null));};exports[_0x6eeb('0x6a')]=function(_0x1cdd09,_0x1a9aa1,_0x2280c4){var _0x3a753c={'channel':_0x6eeb('0x6b')};var _0x34d787=[];var _0x2289a0=[];var _0x9a1671={};return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x1cdd09[_0x6eeb('0x53')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x6eeb('0x6c')}]})[_0x6eeb('0x1c')](handleEntityNotFound(_0x1a9aa1,null))[_0x6eeb('0x1c')](function(_0x2e6e75){_0x3a753c[_0x6eeb('0x6d')]=_0x2e6e75;_0x3a753c['applications']=_[_0x6eeb('0x6e')](_0x2e6e75[_0x6eeb('0x6c')],[_0x6eeb('0x6f')],['asc']);if(_0x3a753c['account'][_0x6eeb('0x6c')]){delete _0x3a753c[_0x6eeb('0x6d')][_0x6eeb('0x6c')];}return db[_0x6eeb('0x70')][_0x6eeb('0x5d')]();})[_0x6eeb('0x1c')](function(_0x110cf3){if(!_0x110cf3){throw new db['Sequelize'][(_0x6eeb('0x71'))](_0x6eeb('0x72'));}_0x34d787=_['difference'](_['keys'](_0x110cf3),[_0x6eeb('0x73'),_0x6eeb('0x74')]);_0x2289a0=_['difference'](_[_0x6eeb('0x42')](_0x110cf3),['createdAt',_0x6eeb('0x74'),'CompanyId',_0x6eeb('0x75')]);_0x3a753c[_0x6eeb('0x5c')]={'mapKey':_0x6eeb('0x76')};if(_0x3a753c[_0x6eeb('0x6d')]['type']){switch(_0x3a753c['account'][_0x6eeb('0x3e')]){case _0x6eeb('0x77'):_0x3a753c[_0x6eeb('0x5c')]['from']=_0x1cdd09[_0x6eeb('0x5c')]['From'];_0x3a753c[_0x6eeb('0x5c')]['body']=_0x1cdd09['body']['Body'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x79')];break;case'skebby':_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')]='+'+_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x7b')];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09['body'][_0x6eeb('0x7c')];break;case _0x6eeb('0x7d'):_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')]=_0x1cdd09[_0x6eeb('0x5c')]['from'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')]['message'];break;case _0x6eeb('0x7e'):_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x7a')];_0x3a753c['body'][_0x6eeb('0x5c')]=_0x1cdd09['body'][_0x6eeb('0x5c')];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x78')]=_0x1cdd09['body'][_0x6eeb('0x7f')];break;case _0x6eeb('0x80'):_0x3a753c[_0x6eeb('0x5c')]['from']=_0x1cdd09['body']['From'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')]['Text'];_0x3a753c['body'][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x81')];break;case _0x6eeb('0x82'):_0x3a753c['body'][_0x6eeb('0x7a')]='+'+_0x1cdd09['body'][_0x6eeb('0x83')][0x0]['from'];_0x3a753c['body'][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x83')][0x0][_0x6eeb('0x7c')];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x83')][0x0][_0x6eeb('0x78')];break;case _0x6eeb('0x84'):_0x3a753c['body'][_0x6eeb('0x7a')]=_0x1cdd09['body'][_0x6eeb('0x85')];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x86')][_0x6eeb('0x24')];break;case'clickatell':_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')]=_0x1cdd09['body'][_0x6eeb('0x87')];_0x3a753c[_0x6eeb('0x5c')]['body']=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x7c')];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x88')];break;case _0x6eeb('0x89'):_0x3a753c['body'][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][0x0]['message']['id'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')]=_0x1cdd09[_0x6eeb('0x5c')][0x0]['message']['from'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')][0x0][_0x6eeb('0x24')][_0x6eeb('0x7c')];break;case _0x6eeb('0x8a'):_0x3a753c['body'][_0x6eeb('0x7a')]=_0x1cdd09[_0x6eeb('0x5c')]['from'];_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x24')];_0x3a753c['body'][_0x6eeb('0x78')]=_0x1cdd09[_0x6eeb('0x5c')][_0x6eeb('0x8b')];break;}}if(_0x3a753c[_0x6eeb('0x5c')]['id']){delete _0x3a753c[_0x6eeb('0x5c')]['id'];}if(_[_0x6eeb('0x8c')](_0x3a753c[_0x6eeb('0x5c')]['from'])){throw new db['Sequelize'][(_0x6eeb('0x71'))]('from\x20is\x20mandatory');}if(_[_0x6eeb('0x8c')](_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')])||_0x3a753c['body'][_0x6eeb('0x5c')]===''){throw new db[(_0x6eeb('0x8d'))][(_0x6eeb('0x71'))](_0x6eeb('0x8e'));}if(_[_0x6eeb('0x8c')](_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x8f')])){throw new db[(_0x6eeb('0x8d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2289a0);}if(!_['includes'](_0x2289a0,_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x8f')])){throw new db[(_0x6eeb('0x8d'))][(_0x6eeb('0x71'))](_0x6eeb('0x90')+_0x2289a0);}_0x9a1671[_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x8f')]]=_0x3a753c['body'][_0x6eeb('0x7a')];return db[_0x6eeb('0x91')]['find']({'where':{'id':_0x3a753c[_0x6eeb('0x6d')][_0x6eeb('0x75')]},'include':[{'model':db[_0x6eeb('0x70')],'as':_0x6eeb('0x92'),'where':_0x9a1671,'limit':0x1,'order':[['updatedAt',_0x6eeb('0x93')]]}]});})[_0x6eeb('0x1c')](handleEntityNotFound(_0x1a9aa1,null))['then'](function(_0x521d95){if(_0x521d95){_0x3a753c[_0x6eeb('0x94')]=_[_0x6eeb('0x95')](_0x521d95,['Contacts']);if(_0x521d95['Contacts'][_0x6eeb('0x46')]){return _0x521d95[_0x6eeb('0x92')][0x0];}var _0x4608b5=_[_0x6eeb('0x96')](_0x3a753c['body'],{'firstName':_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x7a')],'ListId':_0x521d95['id']});_0x4608b5[_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x8f')]]=_0x3a753c[_0x6eeb('0x5c')]['from'];return db[_0x6eeb('0x70')][_0x6eeb('0x56')](_0x4608b5,{'fields':_0x34d787,'raw':!![]});}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x1a9aa1,null))[_0x6eeb('0x1c')](function(_0x1a8654){if(_0x1a8654){_0x3a753c['contact']=_0x1a8654;var _0x53ca03={'ContactId':_0x1a8654['id'],'phone':_0x3a753c[_0x6eeb('0x5c')]['from'],'SmsAccountId':_0x1cdd09[_0x6eeb('0x53')]['id']};var _0x245845={'ContactId':_0x1a8654['id'],'SmsAccountId':_0x1cdd09[_0x6eeb('0x53')]['id'],'closed':![]};return db['SmsInteraction'][_0x6eeb('0x55')]({'where':_0x245845})['then'](function(_0x22762d){if(_0x22762d){return[_0x22762d,![]];}return db['SmsInteraction'][_0x6eeb('0x56')](_0x53ca03)[_0x6eeb('0x1c')](function(_0x1139ec){return[_0x1139ec,!![]];});});}})[_0x6eeb('0x97')](function(_0x246079,_0x499e80){_0x3a753c[_0x6eeb('0x98')]=_0x246079[_0x6eeb('0x34')]({'plain':!![]});_0x3a753c[_0x6eeb('0x98')][_0x6eeb('0x99')]=![];if(_0x499e80){if(_0x3a753c['account'][_0x6eeb('0x9a')]){_0x3a753c['applications'][_0x6eeb('0x9b')]({'id':0x0,'priority':_0x3a753c[_0x6eeb('0x9c')][_0x6eeb('0x46')]+0x1,'app':_0x6eeb('0x9d'),'appdata':'unmanaged','interval':_0x6eeb('0x9e')});}_0x3a753c[_0x6eeb('0x98')][_0x6eeb('0x99')]=!![];}return db[_0x6eeb('0x9f')]['create']({'phone':_0x3a753c['body'][_0x6eeb('0x7a')],'messageId':_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x78')],'body':_0x3a753c[_0x6eeb('0x5c')][_0x6eeb('0x5c')],'SmsAccountId':_0x1cdd09['params']['id'],'SmsInteractionId':_0x246079['id'],'direction':'in','ContactId':_0x246079[_0x6eeb('0xa0')],'AttachmentId':_0x3a753c['body'][_0x6eeb('0xa1')]});})[_0x6eeb('0x1c')](function(_0x3c65c0){_0x3a753c[_0x6eeb('0x24')]=_0x3c65c0;if(_0x3a753c['interaction'][_0x6eeb('0xa2')]){return db['User'][_0x6eeb('0x55')]({'attributes':['id','name'],'where':{'id':_0x3a753c['interaction'][_0x6eeb('0xa2')]}})[_0x6eeb('0x1c')](function(_0x43ceba){if(_0x43ceba){_0x3a753c[_0x6eeb('0x9c')][_0x6eeb('0xa3')]({'id':0x0,'priority':0x0,'app':_0x6eeb('0xa4'),'appdata':_0x43ceba[_0x6eeb('0x37')]+','+(_0x3a753c[_0x6eeb('0x6d')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6eeb('0xa5'),_0x6eeb('0xa6'),_0x3a753c);});}return respondWithRpcPromise('Start',_0x6eeb('0xa6'),_0x3a753c);})[_0x6eeb('0x1c')](function(_0x84e32d){if(_0x84e32d){var _0x58d6b9=0xc8;var _0x758c24=_0x6eeb('0xa7');logger[_0x6eeb('0x1d')](_0x6eeb('0xa8'),_0x758c24,_0x58d6b9,_0x6eeb('0xa9'));logger['debug'](_0x6eeb('0xaa'),_0x758c24,_0x58d6b9,_0x6eeb('0xa9'),JSON[_0x6eeb('0x21')](_0x84e32d));if(_0x3a753c['account'][_0x6eeb('0x3e')]==='twilio'){return _0x1a9aa1[_0x6eeb('0x28')](_0x58d6b9)[_0x6eeb('0x2f')]('Content-Type',_0x6eeb('0xab'))['send'](_0x6eeb('0xac'));}else{return _0x1a9aa1[_0x6eeb('0x28')](_0x58d6b9)[_0x6eeb('0x2a')](_0x84e32d);}}})[_0x6eeb('0x26')](handleError(_0x1a9aa1,null));};exports[_0x6eeb('0xad')]=function(_0x109d71,_0x8b1e80){var _0x367370=_0x109d71[_0x6eeb('0x53')]['id'];var _0x41edf4=_0x109d71[_0x6eeb('0x5c')];var _0x51401e=0xc8;var _0x515864=null;return db[_0x6eeb('0xae')][_0x6eeb('0xaf')]({'isolationLevel':db['sequelize'][_0x6eeb('0xb0')][_0x6eeb('0xb1')][_0x6eeb('0xb2')]},function(_0x189ab4){return db[_0x6eeb('0x3b')][_0x6eeb('0x60')]({'where':{'id':_0x367370},'transaction':_0x189ab4})[_0x6eeb('0x1c')](function(_0xf06380){if(_0xf06380){return db[_0x6eeb('0xb3')]['destroy']({'where':{'SmsAccountId':_0x367370},'transaction':_0x189ab4})['then'](function(){var _0xc1a824=_[_0x6eeb('0x40')](_0x41edf4,function(_0x5719e4){_0x5719e4['SmsAccountId']=_0x367370;return _0x5719e4;});return db[_0x6eeb('0xb3')][_0x6eeb('0xb4')](_0xc1a824,{'transaction':_0x189ab4});});}else{_0x51401e=0x194;_0x515864=[];}});})['then'](function(){if(_0x51401e!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x367370},'order':'priority'})[_0x6eeb('0x1c')](function(_0x4b71b7){_0x515864=_0x4b71b7;});}})[_0x6eeb('0x26')](function(_0x439329){_0x51401e=0x1f4;logger[_0x6eeb('0x22')](_0x439329['stack']);if(_0x439329[_0x6eeb('0x37')]){delete _0x439329['name'];}_0x515864=_0x439329;})['finally'](function(){if(_0x515864===null){_0x8b1e80[_0x6eeb('0x27')](_0x51401e);}else{if(_0x51401e===0x1f4){_0x8b1e80[_0x6eeb('0x28')](_0x51401e)['send'](_0x515864);}else{_0x8b1e80[_0x6eeb('0x28')](_0x51401e)[_0x6eeb('0x2a')](_0x515864);}}});};exports['getApplications']=function(_0x4f4208,_0x3eb57b,_0x216e96){var _0x36093d={};var _0x17ae17={};var _0x32c365;var _0x165901;return db['SmsAccount'][_0x6eeb('0x60')]({'where':{'id':_0x4f4208[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x3eb57b,null))['then'](function(_0x5ab9b7){if(_0x5ab9b7){_0x32c365=_0x5ab9b7;_0x17ae17['model']=_[_0x6eeb('0x42')](db[_0x6eeb('0xb3')]['rawAttributes']);_0x17ae17[_0x6eeb('0x41')]=_[_0x6eeb('0x42')](_0x4f4208[_0x6eeb('0x41')]);_0x17ae17['filters']=_[_0x6eeb('0x54')](_0x17ae17[_0x6eeb('0x3f')],_0x17ae17[_0x6eeb('0x41')]);_0x36093d[_0x6eeb('0x44')]=_[_0x6eeb('0x54')](_0x17ae17['model'],qs[_0x6eeb('0x45')](_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x36093d[_0x6eeb('0x44')]=_0x36093d[_0x6eeb('0x44')][_0x6eeb('0x46')]?_0x36093d[_0x6eeb('0x44')]:_0x17ae17[_0x6eeb('0x3f')];_0x36093d['order']=qs[_0x6eeb('0x49')](_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x49')]);_0x36093d['where']=qs[_0x6eeb('0x43')](_[_0x6eeb('0x4a')](_0x4f4208[_0x6eeb('0x41')],_0x17ae17[_0x6eeb('0x43')]));if(_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x4b')]){_0x36093d['where']=_[_0x6eeb('0x4d')](_0x36093d[_0x6eeb('0x4c')],{'$or':_[_0x6eeb('0x40')](_0x36093d['attributes'],function(_0x3c4eda){var _0x3d6a15={};_0x3d6a15[_0x3c4eda]={'$like':'%'+_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x4b')]+'%'};return _0x3d6a15;})});}_0x36093d=_[_0x6eeb('0x4d')]({},_0x36093d,_0x4f4208[_0x6eeb('0x4e')]);return _0x32c365[_0x6eeb('0xb5')](_0x36093d);}})[_0x6eeb('0x1c')](function(_0x4d6e72){if(_0x4d6e72){_0x165901=_0x4d6e72['length'];if(!_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x47')](_0x6eeb('0x48'))){_0x36093d[_0x6eeb('0x2e')]=qs['limit'](_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x2e')]);_0x36093d[_0x6eeb('0x2b')]=qs[_0x6eeb('0x2b')](_0x4f4208[_0x6eeb('0x41')][_0x6eeb('0x2b')]);}return _0x32c365[_0x6eeb('0xb5')](_0x36093d);}})[_0x6eeb('0x1c')](function(_0x35c80b){if(_0x35c80b){return _0x35c80b?{'count':_0x165901,'rows':_0x35c80b}:null;}})[_0x6eeb('0x1c')](respondWithResult(_0x3eb57b,null))[_0x6eeb('0x26')](handleError(_0x3eb57b,null));};exports[_0x6eeb('0xb6')]=function(_0x2d4dd1,_0x28762b,_0x4e8481){var _0x403c62={'raw':![],'where':{}};var _0x3a25cc={};var _0x349200={'count':0x0,'rows':[]};return db[_0x6eeb('0x3b')][_0x6eeb('0x60')]({'where':{'id':_0x2d4dd1[_0x6eeb('0x53')]['id']}})['then'](handleEntityNotFound(_0x28762b,null))[_0x6eeb('0x1c')](function(_0xea11fe){if(_0xea11fe){_0x3a25cc[_0x6eeb('0x3f')]=_[_0x6eeb('0x42')](db[_0x6eeb('0xb7')]['rawAttributes']);_0x3a25cc[_0x6eeb('0x41')]=_['keys'](_0x2d4dd1[_0x6eeb('0x41')]);_0x3a25cc[_0x6eeb('0x43')]=_[_0x6eeb('0x54')](_0x3a25cc[_0x6eeb('0x3f')],_0x3a25cc['query']);_0x403c62[_0x6eeb('0x44')]=_[_0x6eeb('0x54')](_0x3a25cc[_0x6eeb('0x3f')],qs['fields'](_0x2d4dd1[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x403c62[_0x6eeb('0x44')]=_0x403c62[_0x6eeb('0x44')][_0x6eeb('0x46')]?_0x403c62[_0x6eeb('0x44')]:_0x3a25cc['model'];if(!_0x2d4dd1['query'][_0x6eeb('0x47')](_0x6eeb('0x48'))){_0x403c62[_0x6eeb('0x2e')]=qs[_0x6eeb('0x2e')](_0x2d4dd1[_0x6eeb('0x41')]['limit']);_0x403c62[_0x6eeb('0x2b')]=qs['offset'](_0x2d4dd1[_0x6eeb('0x41')][_0x6eeb('0x2b')]);}_0x403c62[_0x6eeb('0x67')]=qs['sort'](_0x2d4dd1[_0x6eeb('0x41')]['sort']);_0x403c62[_0x6eeb('0x4c')]=qs['filters'](_['pick'](_0x2d4dd1[_0x6eeb('0x41')],_0x3a25cc[_0x6eeb('0x43')]));_0x403c62[_0x6eeb('0x4c')][_0x6eeb('0x62')]=_0xea11fe['id'];if(_0x2d4dd1['query'][_0x6eeb('0x4b')]){_0x403c62[_0x6eeb('0x4c')]=_[_0x6eeb('0x4d')](_0x403c62[_0x6eeb('0x4c')],{'$or':_['map'](_0x403c62[_0x6eeb('0x44')],function(_0x270041){var _0xa0ad22={};_0xa0ad22[_0x270041]={'$like':'%'+_0x2d4dd1['query'][_0x6eeb('0x4b')]+'%'};return _0xa0ad22;})});}_0x403c62=_[_0x6eeb('0x4d')]({},_0x403c62,_0x2d4dd1[_0x6eeb('0x4e')]);return db[_0x6eeb('0xb7')][_0x6eeb('0x2d')]({'where':_0x403c62[_0x6eeb('0x4c')]})[_0x6eeb('0x1c')](function(_0x12e065){_0x349200[_0x6eeb('0x2d')]=_0x12e065;if(_0x2d4dd1[_0x6eeb('0x41')]['includeAll']){_0x403c62['include']=[{'model':db[_0x6eeb('0x70')],'as':'Contact','required':![]},{'model':db[_0x6eeb('0xb8')],'as':'Owner','attributes':['name','fullname',_0x6eeb('0xb9')],'required':![]},{'model':db[_0x6eeb('0xba')],'as':_0x6eeb('0xbb'),'attributes':['id',_0x6eeb('0x37'),'color'],'where':_0x2d4dd1['query'][_0x6eeb('0xbc')]?{'id':_0x2d4dd1[_0x6eeb('0x41')][_0x6eeb('0xbc')]}:undefined,'required':_0x2d4dd1[_0x6eeb('0x41')][_0x6eeb('0xbc')]?!![]:![]}];}return db[_0x6eeb('0xb7')][_0x6eeb('0x51')](_0x403c62);})['then'](function(_0x1c3dc5){_0x349200[_0x6eeb('0x52')]=_0x1c3dc5;return _0x349200;});}})[_0x6eeb('0x1c')](respondWithFilteredResult(_0x28762b,_0x403c62))['catch'](handleError(_0x28762b,null));};exports[_0x6eeb('0x38')]=function(_0x2f89da,_0x1e24ce,_0x1371e2){var _0x6bcfe2,_0x2b194b,_0x50d39c;if(_[_0x6eeb('0x8c')](_0x2f89da['body'][_0x6eeb('0x5c')])||_0x2f89da['body']['body']===''){throw new db['Sequelize'][(_0x6eeb('0x71'))](_0x6eeb('0x8e'));}if(_[_0x6eeb('0x8c')](_0x2f89da[_0x6eeb('0x5c')]['to'])){throw new db[(_0x6eeb('0x8d'))][(_0x6eeb('0x71'))](_0x6eeb('0xbd'));}_0x6bcfe2=_0x2f89da[_0x6eeb('0x5c')]['to'];return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x2f89da[_0x6eeb('0x53')]['id']},'include':[{'model':db[_0x6eeb('0x91')],'as':_0x6eeb('0xbe'),'include':[{'model':db[_0x6eeb('0x70')],'as':_0x6eeb('0x92'),'where':{'mobile':_0x6bcfe2},'limit':0x1,'order':[[_0x6eeb('0x74'),_0x6eeb('0x93')]]}]}]})['then'](handleEntityNotFound(_0x1e24ce,null))[_0x6eeb('0x1c')](function(_0x814dfa){if(_0x814dfa&&_0x814dfa['List']){_0x2b194b=_0x814dfa[_0x6eeb('0x34')]({'plain':!![]});if(_0x2b194b[_0x6eeb('0xbe')]&&_0x2b194b[_0x6eeb('0xbe')][_0x6eeb('0x92')][_0x6eeb('0x46')]){return _0x2b194b['List'][_0x6eeb('0x92')][0x0];}return db[_0x6eeb('0x70')]['create'](_[_0x6eeb('0x96')](_0x2f89da['body'],{'firstName':_0x6bcfe2,'mobile':_0x6bcfe2,'phone':_0x6bcfe2,'ListId':_0x2b194b[_0x6eeb('0x75')]}));}})['then'](handleEntityNotFound(_0x1e24ce,null))['then'](function(_0x347fe5){if(_0x347fe5){_0x50d39c=_0x347fe5;return db[_0x6eeb('0xb7')]['find']({'where':{'ContactId':_0x50d39c['id'],'closed':![],'SmsAccountId':_0x2b194b['id']}})[_0x6eeb('0x1c')](function(_0x21a557){if(_0x21a557){return[_0x21a557,![]];}return db[_0x6eeb('0xb7')]['create']({'UserId':_0x2f89da[_0x6eeb('0x57')]['id'],'ContactId':_0x50d39c['id'],'SmsAccountId':_0x2b194b['id'],'phone':_0x6bcfe2,'firstMsgDirection':'out','Messages':[_[_0x6eeb('0x4d')](_0x2f89da['body'],{'read':![],'body':_0x2f89da['body']['body'],'phone':_0x6bcfe2,'SmsAccountId':_0x2b194b['id'],'UserId':_0x2f89da[_0x6eeb('0x57')]['id'],'ContactId':_0x50d39c['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x6eeb('0x1c')](function(_0x3f03a5){return[_0x3f03a5,!![]];});});}})[_0x6eeb('0x97')](function(_0x191932,_0x4707b8){if(_0x4707b8){return _0x191932;}return db[_0x6eeb('0x9f')]['create'](_[_0x6eeb('0x4d')](_0x2f89da[_0x6eeb('0x5c')],{'read':![],'body':_0x2f89da[_0x6eeb('0x5c')]['body'],'phone':_0x6bcfe2,'SmsAccountId':_0x2b194b['id'],'SmsInteractionId':_0x191932['id'],'UserId':_0x2f89da[_0x6eeb('0x57')]['id'],'ContactId':_0x50d39c['id']}))[_0x6eeb('0x1c')](function(_0xc2d82){_0x191932['dataValues'][_0x6eeb('0xbf')]=[];_0x191932[_0x6eeb('0xc0')]['Messages']['push'](_0xc2d82['dataValues']);return _0x191932;});})[_0x6eeb('0x1c')](respondWithResult(_0x1e24ce,null))[_0x6eeb('0x26')](handleError(_0x1e24ce,null));};exports['status']=function(_0x373cd5,_0x2c1cc2,_0x5666bf){if(_0x373cd5[_0x6eeb('0x5c')]['id']){delete _0x373cd5[_0x6eeb('0x5c')]['id'];}var _0x15eed0,_0x3c6c2f,_0x2c4d38;return db[_0x6eeb('0x3b')][_0x6eeb('0x55')]({'where':{'id':_0x373cd5[_0x6eeb('0x53')]['id']}})['then'](handleEntityNotFound(_0x2c1cc2,null))[_0x6eeb('0x1c')](function(_0x44df3a){if(_0x44df3a){_0x2c4d38=_0x44df3a;logger[_0x6eeb('0x20')](_0x6eeb('0xa8'),'status',_0x6eeb('0xc1'),_0x44df3a['type'],util['inspect'](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));switch(_0x44df3a[_0x6eeb('0x3e')]){case _0x6eeb('0xc2'):if(_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc3')]&&_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x28')]){_0x3c6c2f=_0x373cd5[_0x6eeb('0x5c')]['status'];return db[_0x6eeb('0x9f')][_0x6eeb('0x55')]({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc3')]}});}break;case _0x6eeb('0x7d'):if(_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc4')]&&_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc5')]){_0x3c6c2f=_0x373cd5['body'][_0x6eeb('0xc5')];return db[_0x6eeb('0x9f')][_0x6eeb('0x55')]({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')]['requestid']}});}break;case'clicksend':if(_0x373cd5['body'][_0x6eeb('0x7f')]&&_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc6')]){_0x3c6c2f=_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc6')];return db[_0x6eeb('0x9f')][_0x6eeb('0x55')]({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x7f')]}});}break;case _0x6eeb('0x82'):var _0x5d7604=_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x83')][0x0];if(_0x5d7604['messageId']&&_0x5d7604[_0x6eeb('0x28')][_0x6eeb('0xc7')]===_0x6eeb('0xc8')){_0x3c6c2f=_0x5d7604[_0x6eeb('0x28')]['groupName'];return db[_0x6eeb('0x9f')][_0x6eeb('0x55')]({'where':{'messageId':_0x5d7604[_0x6eeb('0x78')]}});}break;case'clickatell':if(_0x373cd5['body'][_0x6eeb('0x78')]&&_0x373cd5[_0x6eeb('0x5c')]['status']){_0x3c6c2f=_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x28')];return db[_0x6eeb('0x9f')]['find']({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x78')]}});}break;case _0x6eeb('0x89'):if(_0x373cd5[_0x6eeb('0x5c')][0x0][_0x6eeb('0x24')]['id']){_0x3c6c2f=_0x373cd5[_0x6eeb('0x5c')][0x0][_0x6eeb('0x3e')];return db[_0x6eeb('0x9f')]['find']({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')][0x0][_0x6eeb('0x24')]['id']}});}break;case _0x6eeb('0x8a'):if(_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc9')]&&_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x28')]){_0x3c6c2f=_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0x28')];return db[_0x6eeb('0x9f')][_0x6eeb('0x55')]({'where':{'messageId':_0x373cd5[_0x6eeb('0x5c')][_0x6eeb('0xc9')]}});}break;}}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x2c1cc2,null))[_0x6eeb('0x1c')](function(_0x5a964d){if(_0x5a964d){_0x15eed0=_0x5a964d;switch(_0x2c4d38['type']){case _0x6eeb('0xc2'):if(_0x3c6c2f===_0x6eeb('0xc8')){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger[_0x6eeb('0x22')](_0x6eeb('0xa8'),'status',_0x6eeb('0xc2'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6eeb('0x7d'):if(_0x3c6c2f==='1'){return _0x15eed0['update']({'read':!![]});}else{logger[_0x6eeb('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6eeb('0x28'),_0x6eeb('0xc2'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x373cd5[_0x6eeb('0x5c')]['error_code']&&_0x3c6c2f>=0xc8&&_0x3c6c2f<=0xce){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger['error'](_0x6eeb('0xa8'),_0x6eeb('0x28'),'clicksend',util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6eeb('0x82'):var _0x367cbf=_0x373cd5[_0x6eeb('0x5c')]['results'][0x0];if(_0x367cbf['status'][_0x6eeb('0xc7')]===_0x6eeb('0xc8')){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger[_0x6eeb('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6eeb('0x28'),_0x6eeb('0x82'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3c6c2f==_0x6eeb('0xcb')||_0x3c6c2f==_0x6eeb('0xcc')){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger[_0x6eeb('0x22')](_0x6eeb('0xa8'),_0x6eeb('0x28'),_0x6eeb('0xcd'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3c6c2f==_0x6eeb('0xce')){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger[_0x6eeb('0x22')](_0x6eeb('0xa8'),_0x6eeb('0x28'),_0x6eeb('0x89'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3c6c2f===_0x6eeb('0xcf')||_0x3c6c2f===_0x6eeb('0xd0')){return _0x15eed0[_0x6eeb('0x5b')]({'read':!![]});}else{logger[_0x6eeb('0x22')](_0x6eeb('0xa8'),_0x6eeb('0x28'),_0x6eeb('0x8a'),util[_0x6eeb('0xca')](_0x373cd5[_0x6eeb('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x15eed0;}})[_0x6eeb('0x1c')](respondWithResult(_0x2c1cc2,null))[_0x6eeb('0x26')](handleError(_0x2c1cc2,null));};exports[_0x6eeb('0xd1')]=function(_0x5a07a3,_0x32990c,_0x35c5d8){var _0xded48c,_0x16b433,_0x419572;return db[_0x6eeb('0x3b')]['find']({'where':{'id':_0x5a07a3[_0x6eeb('0x53')]['id']}})['then'](handleEntityNotFound(_0x32990c,null))[_0x6eeb('0x1c')](function(_0x1da9eb){if(_0x1da9eb){_0x419572=_0x1da9eb;logger[_0x6eeb('0x20')](_0x6eeb('0xa8'),_0x6eeb('0x28'),'received\x20delivery\x20report\x20from',_0x1da9eb[_0x6eeb('0x3e')],util[_0x6eeb('0xca')](_0x5a07a3['query'],{'showHidden':![],'depth':null}));switch(_0x1da9eb['type']){case _0x6eeb('0x84'):if(_0x5a07a3['query'][_0x6eeb('0xd2')]&&_0x5a07a3[_0x6eeb('0x41')][_0x6eeb('0xd3')]){_0x16b433=_0x5a07a3[_0x6eeb('0x41')]['state'];return db['SmsMessage']['find']({'where':{'messageId':_0x5a07a3['query'][_0x6eeb('0xd2')]}});}break;}}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x32990c,null))[_0x6eeb('0x1c')](function(_0x28d136){if(_0x28d136){_0xded48c=_0x28d136;switch(_0x419572[_0x6eeb('0x3e')]){case'csc':if(_0x16b433==='2'||_0x16b433==='6'){return _0xded48c['update']({'read':!![]});}else{logger[_0x6eeb('0x22')](_0x6eeb('0xa8'),_0x6eeb('0x28'),_0x6eeb('0x84'),util[_0x6eeb('0xca')](_0x5a07a3[_0x6eeb('0x41')],{'showHidden':![],'depth':null}));};break;}return _0xded48c;}})[_0x6eeb('0x1c')](respondWithResult(_0x32990c,null))[_0x6eeb('0x26')](handleError(_0x32990c,null));};exports[_0x6eeb('0xd4')]=function(_0x572912,_0x49b25f,_0x1f3e74){return db['SmsAccount'][_0x6eeb('0x55')]({'where':{'id':_0x572912['params']['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x49b25f,null))[_0x6eeb('0x1c')](function(_0x5cc89a){if(_0x5cc89a){return _0x5cc89a[_0x6eeb('0xd4')](_0x572912[_0x6eeb('0x5c')]['ids'],_[_0x6eeb('0x95')](_0x572912['body'],[_0x6eeb('0x69'),'id'])||{})['spread'](function(_0x581b44){for(var _0x503fca=0x0;_0x503fca<_0x572912['body'][_0x6eeb('0x69')][_0x6eeb('0x46')];_0x503fca+=0x1){socket['emit'](_0x6eeb('0xd5'),{'UserId':Number(_0x572912[_0x6eeb('0x5c')]['ids'][_0x503fca]),'SmsAccountId':Number(_0x572912[_0x6eeb('0x53')]['id'])});}return _0x581b44;});}})['then'](respondWithResult(_0x49b25f,null))[_0x6eeb('0x26')](handleError(_0x49b25f,null));};exports[_0x6eeb('0xd6')]=function(_0x1e6bee,_0x3b3487,_0x2b5283){return db['SmsAccount']['find']({'where':{'id':_0x1e6bee[_0x6eeb('0x53')]['id']}})[_0x6eeb('0x1c')](handleEntityNotFound(_0x3b3487,null))['then'](function(_0x4c8146){if(_0x4c8146){return _0x4c8146[_0x6eeb('0xd6')](_0x1e6bee[_0x6eeb('0x41')]['ids'])[_0x6eeb('0x1c')](function(){if(_[_0x6eeb('0xd7')](_0x1e6bee[_0x6eeb('0x41')][_0x6eeb('0x69')])){for(var _0x26a8b1=0x0;_0x26a8b1<_0x1e6bee[_0x6eeb('0x41')][_0x6eeb('0x69')][_0x6eeb('0x46')];_0x26a8b1+=0x1){socket[_0x6eeb('0xd8')](_0x6eeb('0xd9'),{'UserId':Number(_0x1e6bee[_0x6eeb('0x41')][_0x6eeb('0x69')][_0x26a8b1]),'SmsAccountId':Number(_0x1e6bee[_0x6eeb('0x53')]['id'])});}}else{socket[_0x6eeb('0xd8')]('userSmsAccount:remove',{'UserId':Number(_0x1e6bee['query'][_0x6eeb('0x69')]),'SmsAccountId':Number(_0x1e6bee['params']['id'])});}});}})[_0x6eeb('0x1c')](respondWithStatusCode(_0x3b3487,null))[_0x6eeb('0x26')](handleError(_0x3b3487,null));};exports['getAgents']=function(_0x220a52,_0x3de0d7,_0x2f4a31){var _0x40e144={};var _0x47b0f1={};var _0x23d17f;var _0x57616c;return db[_0x6eeb('0x3b')][_0x6eeb('0x60')]({'where':{'id':_0x220a52['params']['id']}})['then'](handleEntityNotFound(_0x3de0d7,null))[_0x6eeb('0x1c')](function(_0x11bbd0){if(_0x11bbd0){_0x23d17f=_0x11bbd0;_0x47b0f1[_0x6eeb('0x3f')]=_[_0x6eeb('0x42')](db[_0x6eeb('0xb8')][_0x6eeb('0x3c')]);_0x47b0f1['query']=_[_0x6eeb('0x42')](_0x220a52[_0x6eeb('0x41')]);_0x47b0f1[_0x6eeb('0x43')]=_['intersection'](_0x47b0f1['model'],_0x47b0f1[_0x6eeb('0x41')]);_0x40e144['attributes']=_['intersection'](_0x47b0f1[_0x6eeb('0x3f')],qs[_0x6eeb('0x45')](_0x220a52[_0x6eeb('0x41')][_0x6eeb('0x45')]));_0x40e144[_0x6eeb('0x44')]=_0x40e144['attributes'][_0x6eeb('0x46')]?_0x40e144[_0x6eeb('0x44')]:_0x47b0f1['model'];_0x40e144['order']=qs['sort'](_0x220a52[_0x6eeb('0x41')][_0x6eeb('0x49')]);_0x40e144['where']=qs[_0x6eeb('0x43')](_['pick'](_0x220a52[_0x6eeb('0x41')],_0x47b0f1['filters']));if(_0x220a52[_0x6eeb('0x41')]['filter']){_0x40e144[_0x6eeb('0x4c')]=_[_0x6eeb('0x4d')](_0x40e144[_0x6eeb('0x4c')],{'$or':_[_0x6eeb('0x40')](_0x40e144[_0x6eeb('0x44')],function(_0x90c821){var _0x525210={};_0x525210[_0x90c821]={'$like':'%'+_0x220a52['query'][_0x6eeb('0x4b')]+'%'};return _0x525210;})});}_0x40e144=_['merge']({},_0x40e144,_0x220a52[_0x6eeb('0x4e')]);return _0x23d17f[_0x6eeb('0xda')](_0x40e144);}})[_0x6eeb('0x1c')](function(_0xf9aa93){if(_0xf9aa93){_0x57616c=_0xf9aa93[_0x6eeb('0x46')];if(!_0x220a52[_0x6eeb('0x41')][_0x6eeb('0x47')](_0x6eeb('0x48'))){_0x40e144[_0x6eeb('0x2e')]=qs[_0x6eeb('0x2e')](_0x220a52['query'][_0x6eeb('0x2e')]);_0x40e144['offset']=qs['offset'](_0x220a52['query'][_0x6eeb('0x2b')]);}return _0x23d17f['getAgents'](_0x40e144);}})[_0x6eeb('0x1c')](function(_0x460c9c){if(_0x460c9c){return _0x460c9c?{'count':_0x57616c,'rows':_0x460c9c}:null;}})[_0x6eeb('0x1c')](respondWithResult(_0x3de0d7,null))[_0x6eeb('0x26')](handleError(_0x3de0d7,null));};
\ No newline at end of file
index be515a5..cab9c16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x885d=['save','update','remove','emit','hasOwnProperty','../../mysqldb','SmsAccount'];(function(_0x142bb1,_0x2e861a){var _0x5cff18=function(_0x494215){while(--_0x494215){_0x142bb1['push'](_0x142bb1['shift']());}};_0x5cff18(++_0x2e861a);}(_0x885d,0x186));var _0xd885=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x885d[_0x4fc80b];return _0x119dba;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xd885('0x0'))['db'][_0xd885('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd885('0x2'),'afterUpdate':_0xd885('0x3'),'afterDestroy':_0xd885('0x4')};function emitEvent(_0x357bdb){return function(_0x318fa4,_0x3f9ad2,_0xeb2d){SmsAccountEvents[_0xd885('0x5')](_0x357bdb+':'+_0x318fa4['id'],_0x318fa4);SmsAccountEvents[_0xd885('0x5')](_0x357bdb,_0x318fa4);_0xeb2d(null);};}for(var e in events){if(events[_0xd885('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0xb574=['hasOwnProperty','exports','events','setMaxListeners','save','emit'];(function(_0x4c4101,_0x45a4ab){var _0x37a7f9=function(_0x35299d){while(--_0x35299d){_0x4c4101['push'](_0x4c4101['shift']());}};_0x37a7f9(++_0x45a4ab);}(_0xb574,0xf2));var _0x4b57=function(_0x49636d,_0xc4c1a6){_0x49636d=_0x49636d-0x0;var _0x25c3c2=_0xb574[_0x49636d];return _0x25c3c2;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4b57('0x1')](0x0);var events={'afterCreate':_0x4b57('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d0ee1){return function(_0xd17ed8,_0x1b9220,_0x34b22f){SmsAccountEvents[_0x4b57('0x3')](_0x3d0ee1+':'+_0xd17ed8['id'],_0xd17ed8);SmsAccountEvents['emit'](_0x3d0ee1,_0xd17ed8);_0x34b22f(null);};}for(var e in events){if(events[_0x4b57('0x4')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x4b57('0x5')]=SmsAccountEvents;
\ No newline at end of file
index 954225e..7ddbadf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e5=['define','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x58e5,0x177));var _0x558e=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x58e5[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x558e('0x0'));var util=require('util');var logger=require(_0x558e('0x1'))(_0x558e('0x2'));var moment=require(_0x558e('0x3'));var BPromise=require(_0x558e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x558e('0x5'));var rimraf=require(_0x558e('0x6'));var config=require(_0x558e('0x7'));var attributes=require(_0x558e('0x8'));module[_0x558e('0x9')]=function(_0x167349,_0x46e277){return _0x167349[_0x558e('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x382a=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./smsAccount.attributes','define'];(function(_0x515905,_0x166513){var _0xcb3fc5=function(_0x505ccf){while(--_0x505ccf){_0x515905['push'](_0x515905['shift']());}};_0xcb3fc5(++_0x166513);}(_0x382a,0x10a));var _0xa382=function(_0x40eadc,_0x37af8d){_0x40eadc=_0x40eadc-0x0;var _0x6963b4=_0x382a[_0x40eadc];return _0x6963b4;};'use strict';var _=require(_0xa382('0x0'));var util=require(_0xa382('0x1'));var logger=require(_0xa382('0x2'))(_0xa382('0x3'));var moment=require('moment');var BPromise=require(_0xa382('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa382('0x5'));var rimraf=require('rimraf');var config=require(_0xa382('0x6'));var attributes=require(_0xa382('0x7'));module['exports']=function(_0x2b8367,_0x371210){return _0x2b8367[_0xa382('0x8')](_0xa382('0x9'),attributes,{'tableName':_0xa382('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 04e7c12..006e1ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsAccount','options','where','include','map','attributes','model','ShowSmsAccount','lodash'];(function(_0x10d465,_0x377bf8){var _0x335017=function(_0x3c969f){while(--_0x3c969f){_0x10d465['push'](_0x10d465['shift']());}};_0x335017(++_0x377bf8);}(_0x1ae9,0xdd));var _0x91ae=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x1ae9[_0x1aba25];return _0x47d997;};'use strict';var _=require(_0x91ae('0x0'));var util=require(_0x91ae('0x1'));var moment=require(_0x91ae('0x2'));var BPromise=require(_0x91ae('0x3'));var rs=require(_0x91ae('0x4'));var fs=require('fs');var Redis=require(_0x91ae('0x5'));var db=require(_0x91ae('0x6'))['db'];var utils=require(_0x91ae('0x7'));var logger=require(_0x91ae('0x8'))(_0x91ae('0x9'));var config=require('../../config/environment');var jayson=require(_0x91ae('0xa'));var client=jayson[_0x91ae('0xb')][_0x91ae('0xc')]({'port':0x232a});config[_0x91ae('0xd')]=_['defaults'](config[_0x91ae('0xd')],{'host':_0x91ae('0xe'),'port':0x18eb});var socket=require(_0x91ae('0xf'))(new Redis(config['redis']));require(_0x91ae('0x10'))['register'](socket);function respondWithRpcPromise(_0x2afb7d,_0x11bca4,_0x1f39f8){return new BPromise(function(_0xa50f1c,_0x5351e){return client[_0x91ae('0x11')](_0x2afb7d,_0x1f39f8)[_0x91ae('0x12')](function(_0x5650a9){logger[_0x91ae('0x13')](_0x91ae('0x14'),_0x11bca4,_0x91ae('0x15'));logger[_0x91ae('0x16')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x11bca4,_0x91ae('0x15'),JSON[_0x91ae('0x17')](_0x5650a9));if(_0x5650a9[_0x91ae('0x18')]){if(_0x5650a9[_0x91ae('0x18')][_0x91ae('0x19')]===0x1f4){logger['error'](_0x91ae('0x14'),_0x11bca4,_0x5650a9[_0x91ae('0x18')]['message']);return _0x5351e(_0x5650a9[_0x91ae('0x18')][_0x91ae('0x1a')]);}logger[_0x91ae('0x18')](_0x91ae('0x14'),_0x11bca4,_0x5650a9[_0x91ae('0x18')][_0x91ae('0x1a')]);return _0xa50f1c(_0x5650a9[_0x91ae('0x18')][_0x91ae('0x1a')]);}else{logger[_0x91ae('0x13')](_0x91ae('0x14'),_0x11bca4,_0x91ae('0x15'));_0xa50f1c(_0x5650a9[_0x91ae('0x1b')]['message']);}})[_0x91ae('0x1c')](function(_0x18b6aa){logger[_0x91ae('0x18')]('SmsAccount,\x20%s,\x20%s',_0x11bca4,_0x18b6aa);_0x5351e(_0x18b6aa);});});}exports['ShowSmsAccount']=function(_0x138b01){var _0x3273cd=this;return new Promise(function(_0x5ec0a9,_0x3413d2){return db[_0x91ae('0x1d')]['find']({'raw':_0x138b01[_0x91ae('0x1e')]?_0x138b01[_0x91ae('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x138b01['options']?_0x138b01['options'][_0x91ae('0x1f')]||null:null,'attributes':_0x138b01['options']?_0x138b01[_0x91ae('0x1e')]['attributes']||null:null,'include':_0x138b01[_0x91ae('0x1e')]?_0x138b01[_0x91ae('0x1e')][_0x91ae('0x20')]?_[_0x91ae('0x21')](_0x138b01[_0x91ae('0x1e')][_0x91ae('0x20')],function(_0x13d477){return{'model':db[_0x13d477['model']],'as':_0x13d477['as'],'attributes':_0x13d477['attributes'],'include':_0x13d477[_0x91ae('0x20')]?_[_0x91ae('0x21')](_0x13d477['include'],function(_0x3b86dc){return{'model':db[_0x3b86dc['model']],'as':_0x3b86dc['as'],'attributes':_0x3b86dc[_0x91ae('0x22')],'include':_0x3b86dc[_0x91ae('0x20')]?_['map'](_0x3b86dc[_0x91ae('0x20')],function(_0xc0dc2d){return{'model':db[_0xc0dc2d[_0x91ae('0x23')]],'as':_0xc0dc2d['as'],'attributes':_0xc0dc2d['attributes']};}):[]};}):[]};}):[]:[]})[_0x91ae('0x12')](function(_0x7a0b14){logger[_0x91ae('0x13')](_0x91ae('0x24'),_0x138b01);logger['debug'](_0x91ae('0x24'),_0x138b01,JSON['stringify'](_0x7a0b14));_0x5ec0a9(_0x7a0b14);})['catch'](function(_0xb9684a){logger[_0x91ae('0x18')]('ShowSmsAccount',_0xb9684a[_0x91ae('0x1a')],_0x138b01);_0x3413d2(_0x3273cd[_0x91ae('0x18')](0x1f4,_0xb9684a[_0x91ae('0x1a')]));});});};
\ No newline at end of file
+var _0xd188=['util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x2f187d,_0x323eb5){var _0x14169d=function(_0x2a64e0){while(--_0x2a64e0){_0x2f187d['push'](_0x2f187d['shift']());}};_0x14169d(++_0x323eb5);}(_0xd188,0x14a));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8d18('0x0'));var moment=require(_0x8d18('0x1'));var BPromise=require(_0x8d18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d18('0x3'));var logger=require(_0x8d18('0x4'))('rpc');var config=require(_0x8d18('0x5'));var jayson=require(_0x8d18('0x6'));var client=jayson[_0x8d18('0x7')][_0x8d18('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8d18('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d18('0xa'))(new Redis(config['redis']));require(_0x8d18('0xb'))[_0x8d18('0xc')](socket);function respondWithRpcPromise(_0x4cb204,_0x58a9d6,_0x521f60){return new BPromise(function(_0x529174,_0x3d41aa){return client[_0x8d18('0xd')](_0x4cb204,_0x521f60)['then'](function(_0x3a35c2){logger[_0x8d18('0xe')](_0x8d18('0xf'),_0x58a9d6,_0x8d18('0x10'));logger[_0x8d18('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x58a9d6,_0x8d18('0x10'),JSON[_0x8d18('0x12')](_0x3a35c2));if(_0x3a35c2['error']){if(_0x3a35c2[_0x8d18('0x13')]['code']===0x1f4){logger[_0x8d18('0x13')](_0x8d18('0xf'),_0x58a9d6,_0x3a35c2[_0x8d18('0x13')][_0x8d18('0x14')]);return _0x3d41aa(_0x3a35c2[_0x8d18('0x13')][_0x8d18('0x14')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x58a9d6,_0x3a35c2[_0x8d18('0x13')][_0x8d18('0x14')]);return _0x529174(_0x3a35c2[_0x8d18('0x13')][_0x8d18('0x14')]);}else{logger[_0x8d18('0xe')](_0x8d18('0xf'),_0x58a9d6,_0x8d18('0x10'));_0x529174(_0x3a35c2[_0x8d18('0x15')][_0x8d18('0x14')]);}})[_0x8d18('0x16')](function(_0x2efffa){logger['error']('SmsAccount,\x20%s,\x20%s',_0x58a9d6,_0x2efffa);_0x3d41aa(_0x2efffa);});});}exports[_0x8d18('0x17')]=function(_0x94f0ce){var _0x4f3f74=this;return new Promise(function(_0x569d90,_0x2e5d37){return db[_0x8d18('0x18')][_0x8d18('0x19')]({'raw':_0x94f0ce[_0x8d18('0x1a')]?_0x94f0ce['options'][_0x8d18('0x1b')]===undefined?!![]:![]:!![],'where':_0x94f0ce[_0x8d18('0x1a')]?_0x94f0ce[_0x8d18('0x1a')][_0x8d18('0x1c')]||null:null,'attributes':_0x94f0ce[_0x8d18('0x1a')]?_0x94f0ce[_0x8d18('0x1a')][_0x8d18('0x1d')]||null:null,'include':_0x94f0ce['options']?_0x94f0ce[_0x8d18('0x1a')][_0x8d18('0x1e')]?_[_0x8d18('0x1f')](_0x94f0ce[_0x8d18('0x1a')][_0x8d18('0x1e')],function(_0x1bc0e2){return{'model':db[_0x1bc0e2[_0x8d18('0x20')]],'as':_0x1bc0e2['as'],'attributes':_0x1bc0e2[_0x8d18('0x1d')],'include':_0x1bc0e2[_0x8d18('0x1e')]?_['map'](_0x1bc0e2[_0x8d18('0x1e')],function(_0x1da50f){return{'model':db[_0x1da50f[_0x8d18('0x20')]],'as':_0x1da50f['as'],'attributes':_0x1da50f['attributes'],'include':_0x1da50f['include']?_[_0x8d18('0x1f')](_0x1da50f[_0x8d18('0x1e')],function(_0x22a79c){return{'model':db[_0x22a79c[_0x8d18('0x20')]],'as':_0x22a79c['as'],'attributes':_0x22a79c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x178949){logger[_0x8d18('0xe')](_0x8d18('0x17'),_0x94f0ce);logger[_0x8d18('0x11')](_0x8d18('0x17'),_0x94f0ce,JSON['stringify'](_0x178949));_0x569d90(_0x178949);})[_0x8d18('0x16')](function(_0x277685){logger[_0x8d18('0x13')](_0x8d18('0x17'),_0x277685['message'],_0x94f0ce);_0x2e5d37(_0x4f3f74[_0x8d18('0x13')](0x1f4,_0x277685[_0x8d18('0x14')]));});});};
\ No newline at end of file
index 36b9c77..f78e237 100644 (file)
@@ -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(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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
index 30fa883..73b42c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f9b22,_0x3be141){var _0x5a6686=function(_0x23c2e0){while(--_0x23c2e0){_0x1f9b22['push'](_0x1f9b22['shift']());}};_0x5a6686(++_0x3be141);}(_0x34e8,0x12c));var _0x834e=function(_0x29b6f3,_0x28fad6){_0x29b6f3=_0x29b6f3-0x0;var _0x56e22d=_0x34e8[_0x29b6f3];return _0x56e22d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
+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(_0x49d78d,_0x1720d5){var _0x364dbb=function(_0x3f1f8b){while(--_0x3f1f8b){_0x49d78d['push'](_0x49d78d['shift']());}};_0x364dbb(++_0x1720d5);}(_0x008c,0x188));var _0xc008=function(_0x12c289,_0x3376b8){_0x12c289=_0x12c289-0x0;var _0x9e28d5=_0x008c[_0x12c289];return _0x9e28d5;};'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
index ad9ecd0..58ced66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x172d=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x21a0cb,_0x5a4cc5){var _0x2e9bb4=function(_0x3b47cf){while(--_0x3b47cf){_0x21a0cb['push'](_0x21a0cb['shift']());}};_0x2e9bb4(++_0x5a4cc5);}(_0x172d,0x70));var _0xd172=function(_0x80fac1,_0x3a0990){_0x80fac1=_0x80fac1-0x0;var _0x432b8a=_0x172d[_0x80fac1];return _0x432b8a;};'use strict';var Sequelize=require(_0xd172('0x0'));module[_0xd172('0x1')]={'priority':{'type':Sequelize[_0xd172('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd172('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd172('0x4')]},'interval':{'type':Sequelize[_0xd172('0x4')],'defaultValue':_0xd172('0x5')}};
\ No newline at end of file
+var _0xb1d9=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb1d9,0x9c));var _0x9b1d=function(_0x192184,_0x5eba05){_0x192184=_0x192184-0x0;var _0x1a0dbb=_0xb1d9[_0x192184];return _0x1a0dbb;};'use strict';var Sequelize=require(_0x9b1d('0x0'));module[_0x9b1d('0x1')]={'priority':{'type':Sequelize[_0x9b1d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9b1d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9b1d('0x4')]()},'description':{'type':Sequelize[_0x9b1d('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 498968c..f1e7dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0db=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','undefined','limit','count','offset','set','apply','reject','then','destroy','sendStatus','error','stack','send','map','SmsApplication','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','update','body'];(function(_0x492071,_0x25fe79){var _0x1462d1=function(_0x489b50){while(--_0x489b50){_0x492071['push'](_0x492071['shift']());}};_0x1462d1(++_0x25fe79);}(_0xa0db,0xe1));var _0xba0d=function(_0x2dcdf8,_0x48f886){_0x2dcdf8=_0x2dcdf8-0x0;var _0x3a421e=_0xa0db[_0x2dcdf8];return _0x3a421e;};'use strict';var emlformat=require(_0xba0d('0x0'));var rimraf=require(_0xba0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba0d('0x2'));var rp=require(_0xba0d('0x3'));var moment=require(_0xba0d('0x4'));var BPromise=require(_0xba0d('0x5'));var Mustache=require(_0xba0d('0x6'));var util=require(_0xba0d('0x7'));var path=require('path');var sox=require(_0xba0d('0x8'));var csv=require(_0xba0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba0d('0xa'));var _=require(_0xba0d('0xb'));var squel=require(_0xba0d('0xc'));var crypto=require(_0xba0d('0xd'));var jsforce=require(_0xba0d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba0d('0x9'));var querystring=require(_0xba0d('0xf'));var Papa=require(_0xba0d('0x10'));var Redis=require(_0xba0d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xba0d('0x12'));var as=require(_0xba0d('0x13'));var hardwareService=require(_0xba0d('0x14'));var logger=require(_0xba0d('0x15'))(_0xba0d('0x16'));var utils=require(_0xba0d('0x17'));var config=require(_0xba0d('0x18'));var licenseUtil=require(_0xba0d('0x19'));var db=require(_0xba0d('0x1a'))['db'];function respondWithStatusCode(_0x15dd59,_0x50ac5d){_0x50ac5d=_0x50ac5d||0xcc;return function(_0x28f7b7){if(_0x28f7b7){return _0x15dd59['sendStatus'](_0x50ac5d);}return _0x15dd59[_0xba0d('0x1b')](_0x50ac5d)[_0xba0d('0x1c')]();};}function respondWithResult(_0x4a4b0a,_0x30c54c){_0x30c54c=_0x30c54c||0xc8;return function(_0xb45aca){if(_0xb45aca){return _0x4a4b0a[_0xba0d('0x1b')](_0x30c54c)[_0xba0d('0x1d')](_0xb45aca);}};}function respondWithFilteredResult(_0x472133,_0x118be3){return function(_0x50eaae){if(_0x50eaae){var _0x3df54f=typeof _0x118be3['offset']===_0xba0d('0x1e')&&typeof _0x118be3[_0xba0d('0x1f')]===_0xba0d('0x1e');var _0x11bb7d=_0x50eaae[_0xba0d('0x20')];var _0x1ba85e=_0x3df54f?0x0:_0x118be3[_0xba0d('0x21')];var _0x3c5bad=_0x3df54f?_0x50eaae[_0xba0d('0x20')]:_0x118be3['offset']+_0x118be3['limit'];var _0x53af46;if(_0x3c5bad>=_0x11bb7d){_0x3c5bad=_0x11bb7d;_0x53af46=0xc8;}else{_0x53af46=0xce;}_0x472133[_0xba0d('0x1b')](_0x53af46);return _0x472133[_0xba0d('0x22')]('Content-Range',_0x1ba85e+'-'+_0x3c5bad+'/'+_0x11bb7d)[_0xba0d('0x1d')](_0x50eaae);}return null;};}function patchUpdates(_0x1c7fd5){return function(_0x15d0f2){try{jsonpatch[_0xba0d('0x23')](_0x15d0f2,_0x1c7fd5,!![]);}catch(_0x284af2){return BPromise[_0xba0d('0x24')](_0x284af2);}return _0x15d0f2['save']();};}function saveUpdates(_0x289461,_0x3a2ab9){return function(_0x1a4bb3){if(_0x1a4bb3){return _0x1a4bb3['update'](_0x289461)[_0xba0d('0x25')](function(_0x395b1e){return _0x395b1e;});}return null;};}function removeEntity(_0x1703b0,_0x2a2c9f){return function(_0x585f25){if(_0x585f25){return _0x585f25[_0xba0d('0x26')]()[_0xba0d('0x25')](function(){_0x1703b0['status'](0xcc)[_0xba0d('0x1c')]();});}};}function handleEntityNotFound(_0x5d2fc9,_0xe5e18e){return function(_0xc5d5f4){if(!_0xc5d5f4){_0x5d2fc9[_0xba0d('0x27')](0x194);}return _0xc5d5f4;};}function handleError(_0x1c853d,_0x442087){_0x442087=_0x442087||0x1f4;return function(_0x26b180){logger[_0xba0d('0x28')](_0x26b180[_0xba0d('0x29')]);if(_0x26b180['name']){delete _0x26b180['name'];}_0x1c853d[_0xba0d('0x1b')](_0x442087)[_0xba0d('0x2a')](_0x26b180);};}exports['index']=function(_0x2bf5df,_0x1ec36e){var _0x55ceb4={},_0x339cde={},_0x3efabb={'count':0x0,'rows':[]};var _0x512d4c=_[_0xba0d('0x2b')](db[_0xba0d('0x2c')]['rawAttributes'],function(_0x439cd5){return{'name':_0x439cd5['fieldName'],'type':_0x439cd5['type'][_0xba0d('0x2d')]};});_0x339cde[_0xba0d('0x2e')]=_['map'](_0x512d4c,'name');_0x339cde['query']=_[_0xba0d('0x2f')](_0x2bf5df[_0xba0d('0x30')]);_0x339cde[_0xba0d('0x31')]=_[_0xba0d('0x32')](_0x339cde['model'],_0x339cde[_0xba0d('0x30')]);_0x55ceb4['attributes']=_[_0xba0d('0x32')](_0x339cde[_0xba0d('0x2e')],qs[_0xba0d('0x33')](_0x2bf5df['query'][_0xba0d('0x33')]));_0x55ceb4[_0xba0d('0x34')]=_0x55ceb4['attributes']['length']?_0x55ceb4[_0xba0d('0x34')]:_0x339cde[_0xba0d('0x2e')];if(!_0x2bf5df['query'][_0xba0d('0x35')](_0xba0d('0x36'))){_0x55ceb4[_0xba0d('0x1f')]=qs[_0xba0d('0x1f')](_0x2bf5df[_0xba0d('0x30')]['limit']);_0x55ceb4['offset']=qs[_0xba0d('0x21')](_0x2bf5df[_0xba0d('0x30')][_0xba0d('0x21')]);}_0x55ceb4[_0xba0d('0x37')]=qs[_0xba0d('0x38')](_0x2bf5df['query'][_0xba0d('0x38')]);_0x55ceb4[_0xba0d('0x39')]=qs[_0xba0d('0x31')](_[_0xba0d('0x3a')](_0x2bf5df[_0xba0d('0x30')],_0x339cde[_0xba0d('0x31')]),_0x512d4c);if(_0x2bf5df[_0xba0d('0x30')][_0xba0d('0x3b')]){_0x55ceb4['where']=_[_0xba0d('0x3c')](_0x55ceb4['where'],{'$or':_[_0xba0d('0x2b')](_0x512d4c,function(_0x1d7c9a){if(_0x1d7c9a['type']!=='VIRTUAL'){var _0x4c7de5={};_0x4c7de5[_0x1d7c9a[_0xba0d('0x3d')]]={'$like':'%'+_0x2bf5df['query']['filter']+'%'};return _0x4c7de5;}})});}_0x55ceb4=_[_0xba0d('0x3c')]({},_0x55ceb4,_0x2bf5df[_0xba0d('0x3e')]);var _0x588f64={'where':_0x55ceb4['where']};return db[_0xba0d('0x2c')][_0xba0d('0x20')](_0x588f64)[_0xba0d('0x25')](function(_0x2a1bf6){_0x3efabb['count']=_0x2a1bf6;if(_0x2bf5df[_0xba0d('0x30')][_0xba0d('0x3f')]){_0x55ceb4[_0xba0d('0x40')]=[{'all':!![]}];}return db[_0xba0d('0x2c')][_0xba0d('0x41')](_0x55ceb4);})[_0xba0d('0x25')](function(_0x562659){_0x3efabb[_0xba0d('0x42')]=_0x562659;return _0x3efabb;})['then'](respondWithFilteredResult(_0x1ec36e,_0x55ceb4))['catch'](handleError(_0x1ec36e,null));};exports[_0xba0d('0x43')]=function(_0x4fc323,_0x5d06c1){var _0x583115={'raw':!![],'where':{'id':_0x4fc323[_0xba0d('0x44')]['id']}},_0x19bf31={};_0x19bf31[_0xba0d('0x2e')]=_['keys'](db[_0xba0d('0x2c')][_0xba0d('0x45')]);_0x19bf31[_0xba0d('0x30')]=_[_0xba0d('0x2f')](_0x4fc323[_0xba0d('0x30')]);_0x19bf31[_0xba0d('0x31')]=_[_0xba0d('0x32')](_0x19bf31[_0xba0d('0x2e')],_0x19bf31[_0xba0d('0x30')]);_0x583115[_0xba0d('0x34')]=_['intersection'](_0x19bf31[_0xba0d('0x2e')],qs['fields'](_0x4fc323['query'][_0xba0d('0x33')]));_0x583115['attributes']=_0x583115[_0xba0d('0x34')]['length']?_0x583115['attributes']:_0x19bf31[_0xba0d('0x2e')];if(_0x4fc323[_0xba0d('0x30')][_0xba0d('0x3f')]){_0x583115[_0xba0d('0x40')]=[{'all':!![]}];}_0x583115=_[_0xba0d('0x3c')]({},_0x583115,_0x4fc323['options']);return db[_0xba0d('0x2c')][_0xba0d('0x46')](_0x583115)[_0xba0d('0x25')](handleEntityNotFound(_0x5d06c1,null))[_0xba0d('0x25')](respondWithResult(_0x5d06c1,null))[_0xba0d('0x47')](handleError(_0x5d06c1,null));};exports[_0xba0d('0x48')]=function(_0x406e2d,_0x3c242){return db[_0xba0d('0x2c')][_0xba0d('0x48')](_0x406e2d['body'],{})[_0xba0d('0x25')](respondWithResult(_0x3c242,0xc9))[_0xba0d('0x47')](handleError(_0x3c242,null));};exports[_0xba0d('0x49')]=function(_0x541279,_0x42baec){if(_0x541279[_0xba0d('0x4a')]['id']){delete _0x541279[_0xba0d('0x4a')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x541279[_0xba0d('0x44')]['id']}})['then'](handleEntityNotFound(_0x42baec,null))['then'](saveUpdates(_0x541279[_0xba0d('0x4a')],null))[_0xba0d('0x25')](respondWithResult(_0x42baec,null))[_0xba0d('0x47')](handleError(_0x42baec,null));};exports[_0xba0d('0x26')]=function(_0x382c54,_0x124fc5){return db[_0xba0d('0x2c')][_0xba0d('0x46')]({'where':{'id':_0x382c54['params']['id']}})[_0xba0d('0x25')](handleEntityNotFound(_0x124fc5,null))[_0xba0d('0x25')](removeEntity(_0x124fc5,null))['catch'](handleError(_0x124fc5,null));};
\ No newline at end of file
+var _0x2211=['rows','params','rawAttributes','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','offset','count','Content-Range','json','reject','save','update','then','error','name','send','index','map','SmsApplication','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2211,0x12c));var _0x1221=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x2211[_0x5d6270];return _0x168f26;};'use strict';var emlformat=require(_0x1221('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1221('0x1'));var jsonpatch=require(_0x1221('0x2'));var rp=require(_0x1221('0x3'));var moment=require(_0x1221('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1221('0x5'));var util=require(_0x1221('0x6'));var path=require(_0x1221('0x7'));var sox=require(_0x1221('0x8'));var csv=require('to-csv');var ejs=require(_0x1221('0x9'));var fs=require('fs');var fs_extra=require(_0x1221('0xa'));var _=require(_0x1221('0xb'));var squel=require(_0x1221('0xc'));var crypto=require(_0x1221('0xd'));var jsforce=require(_0x1221('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1221('0xf'));var querystring=require(_0x1221('0x10'));var Papa=require(_0x1221('0x11'));var Redis=require('ioredis');var authService=require(_0x1221('0x12'));var qs=require(_0x1221('0x13'));var as=require(_0x1221('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1221('0x15'))('api');var utils=require(_0x1221('0x16'));var config=require(_0x1221('0x17'));var licenseUtil=require(_0x1221('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x834a09,_0x5d96ca){_0x5d96ca=_0x5d96ca||0xcc;return function(_0x3a037f){if(_0x3a037f){return _0x834a09[_0x1221('0x19')](_0x5d96ca);}return _0x834a09[_0x1221('0x1a')](_0x5d96ca)[_0x1221('0x1b')]();};}function respondWithResult(_0x10472d,_0x4491a8){_0x4491a8=_0x4491a8||0xc8;return function(_0x3682ca){if(_0x3682ca){return _0x10472d[_0x1221('0x1a')](_0x4491a8)['json'](_0x3682ca);}};}function respondWithFilteredResult(_0x2aeeb5,_0x5bfd44){return function(_0x1c3e6c){if(_0x1c3e6c){var _0x2e944a=typeof _0x5bfd44['offset']==='undefined'&&typeof _0x5bfd44[_0x1221('0x1c')]==='undefined';var _0x1107ab=_0x1c3e6c['count'];var _0x4f19cd=_0x2e944a?0x0:_0x5bfd44[_0x1221('0x1d')];var _0x433357=_0x2e944a?_0x1c3e6c[_0x1221('0x1e')]:_0x5bfd44['offset']+_0x5bfd44[_0x1221('0x1c')];var _0x4e53cb;if(_0x433357>=_0x1107ab){_0x433357=_0x1107ab;_0x4e53cb=0xc8;}else{_0x4e53cb=0xce;}_0x2aeeb5['status'](_0x4e53cb);return _0x2aeeb5['set'](_0x1221('0x1f'),_0x4f19cd+'-'+_0x433357+'/'+_0x1107ab)[_0x1221('0x20')](_0x1c3e6c);}return null;};}function patchUpdates(_0x2500bf){return function(_0x1fec77){try{jsonpatch['apply'](_0x1fec77,_0x2500bf,!![]);}catch(_0x5f433){return BPromise[_0x1221('0x21')](_0x5f433);}return _0x1fec77[_0x1221('0x22')]();};}function saveUpdates(_0x3a8846,_0x29adc6){return function(_0x1af011){if(_0x1af011){return _0x1af011[_0x1221('0x23')](_0x3a8846)[_0x1221('0x24')](function(_0x17defe){return _0x17defe;});}return null;};}function removeEntity(_0x4ef35f,_0x254ea9){return function(_0x42ca57){if(_0x42ca57){return _0x42ca57['destroy']()[_0x1221('0x24')](function(){_0x4ef35f[_0x1221('0x1a')](0xcc)[_0x1221('0x1b')]();});}};}function handleEntityNotFound(_0x348620,_0x1337f7){return function(_0x489e5c){if(!_0x489e5c){_0x348620[_0x1221('0x19')](0x194);}return _0x489e5c;};}function handleError(_0xf3f063,_0x34b01a){_0x34b01a=_0x34b01a||0x1f4;return function(_0x576689){logger[_0x1221('0x25')](_0x576689['stack']);if(_0x576689[_0x1221('0x26')]){delete _0x576689[_0x1221('0x26')];}_0xf3f063['status'](_0x34b01a)[_0x1221('0x27')](_0x576689);};}exports[_0x1221('0x28')]=function(_0x23e5fe,_0x522151){var _0x2a4347={},_0x2f90eb={},_0x2945b3={'count':0x0,'rows':[]};var _0x196d2e=_[_0x1221('0x29')](db[_0x1221('0x2a')]['rawAttributes'],function(_0x1950b2){return{'name':_0x1950b2[_0x1221('0x2b')],'type':_0x1950b2[_0x1221('0x2c')][_0x1221('0x2d')]};});_0x2f90eb[_0x1221('0x2e')]=_[_0x1221('0x29')](_0x196d2e,_0x1221('0x26'));_0x2f90eb[_0x1221('0x2f')]=_[_0x1221('0x30')](_0x23e5fe[_0x1221('0x2f')]);_0x2f90eb['filters']=_[_0x1221('0x31')](_0x2f90eb[_0x1221('0x2e')],_0x2f90eb['query']);_0x2a4347['attributes']=_['intersection'](_0x2f90eb[_0x1221('0x2e')],qs[_0x1221('0x32')](_0x23e5fe[_0x1221('0x2f')][_0x1221('0x32')]));_0x2a4347[_0x1221('0x33')]=_0x2a4347[_0x1221('0x33')][_0x1221('0x34')]?_0x2a4347['attributes']:_0x2f90eb[_0x1221('0x2e')];if(!_0x23e5fe[_0x1221('0x2f')][_0x1221('0x35')](_0x1221('0x36'))){_0x2a4347['limit']=qs[_0x1221('0x1c')](_0x23e5fe['query'][_0x1221('0x1c')]);_0x2a4347[_0x1221('0x1d')]=qs[_0x1221('0x1d')](_0x23e5fe[_0x1221('0x2f')][_0x1221('0x1d')]);}_0x2a4347[_0x1221('0x37')]=qs[_0x1221('0x38')](_0x23e5fe['query'][_0x1221('0x38')]);_0x2a4347[_0x1221('0x39')]=qs[_0x1221('0x3a')](_[_0x1221('0x3b')](_0x23e5fe[_0x1221('0x2f')],_0x2f90eb['filters']),_0x196d2e);if(_0x23e5fe[_0x1221('0x2f')][_0x1221('0x3c')]){_0x2a4347[_0x1221('0x39')]=_['merge'](_0x2a4347[_0x1221('0x39')],{'$or':_[_0x1221('0x29')](_0x196d2e,function(_0x2a32ed){if(_0x2a32ed['type']!==_0x1221('0x3d')){var _0x326571={};_0x326571[_0x2a32ed[_0x1221('0x26')]]={'$like':'%'+_0x23e5fe[_0x1221('0x2f')]['filter']+'%'};return _0x326571;}})});}_0x2a4347=_[_0x1221('0x3e')]({},_0x2a4347,_0x23e5fe['options']);var _0x23f788={'where':_0x2a4347[_0x1221('0x39')]};return db[_0x1221('0x2a')][_0x1221('0x1e')](_0x23f788)[_0x1221('0x24')](function(_0x3b707b){_0x2945b3['count']=_0x3b707b;if(_0x23e5fe[_0x1221('0x2f')][_0x1221('0x3f')]){_0x2a4347[_0x1221('0x40')]=[{'all':!![]}];}return db[_0x1221('0x2a')]['findAll'](_0x2a4347);})[_0x1221('0x24')](function(_0x2591f8){_0x2945b3[_0x1221('0x41')]=_0x2591f8;return _0x2945b3;})[_0x1221('0x24')](respondWithFilteredResult(_0x522151,_0x2a4347))['catch'](handleError(_0x522151,null));};exports['show']=function(_0x3a370a,_0x4b67bb){var _0x1390f0={'raw':!![],'where':{'id':_0x3a370a[_0x1221('0x42')]['id']}},_0x183984={};_0x183984[_0x1221('0x2e')]=_[_0x1221('0x30')](db[_0x1221('0x2a')][_0x1221('0x43')]);_0x183984[_0x1221('0x2f')]=_['keys'](_0x3a370a[_0x1221('0x2f')]);_0x183984[_0x1221('0x3a')]=_[_0x1221('0x31')](_0x183984[_0x1221('0x2e')],_0x183984[_0x1221('0x2f')]);_0x1390f0[_0x1221('0x33')]=_[_0x1221('0x31')](_0x183984['model'],qs['fields'](_0x3a370a['query'][_0x1221('0x32')]));_0x1390f0[_0x1221('0x33')]=_0x1390f0[_0x1221('0x33')][_0x1221('0x34')]?_0x1390f0[_0x1221('0x33')]:_0x183984[_0x1221('0x2e')];if(_0x3a370a[_0x1221('0x2f')][_0x1221('0x3f')]){_0x1390f0[_0x1221('0x40')]=[{'all':!![]}];}_0x1390f0=_['merge']({},_0x1390f0,_0x3a370a['options']);return db[_0x1221('0x2a')][_0x1221('0x44')](_0x1390f0)['then'](handleEntityNotFound(_0x4b67bb,null))['then'](respondWithResult(_0x4b67bb,null))[_0x1221('0x45')](handleError(_0x4b67bb,null));};exports[_0x1221('0x46')]=function(_0x4135b4,_0x405ff3){return db[_0x1221('0x2a')][_0x1221('0x46')](_0x4135b4[_0x1221('0x47')],{})[_0x1221('0x24')](respondWithResult(_0x405ff3,0xc9))[_0x1221('0x45')](handleError(_0x405ff3,null));};exports[_0x1221('0x23')]=function(_0x1679e5,_0x4876e9){if(_0x1679e5[_0x1221('0x47')]['id']){delete _0x1679e5[_0x1221('0x47')]['id'];}return db[_0x1221('0x2a')]['find']({'where':{'id':_0x1679e5['params']['id']}})['then'](handleEntityNotFound(_0x4876e9,null))[_0x1221('0x24')](saveUpdates(_0x1679e5['body'],null))[_0x1221('0x24')](respondWithResult(_0x4876e9,null))['catch'](handleError(_0x4876e9,null));};exports[_0x1221('0x48')]=function(_0x1b3c22,_0x37125b){return db[_0x1221('0x2a')][_0x1221('0x44')]({'where':{'id':_0x1b3c22[_0x1221('0x42')]['id']}})['then'](handleEntityNotFound(_0x37125b,null))[_0x1221('0x24')](removeEntity(_0x37125b,null))[_0x1221('0x45')](handleError(_0x37125b,null));};
\ No newline at end of file
index 46287a9..7e1ea25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2b1=['request-promise','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x200207,_0x1e8205){var _0x356be1=function(_0xf3bdfa){while(--_0xf3bdfa){_0x200207['push'](_0x200207['shift']());}};_0x356be1(++_0x1e8205);}(_0xc2b1,0x1a1));var _0x1c2b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc2b1[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c2b('0x0'))('api');var moment=require(_0x1c2b('0x1'));var BPromise=require(_0x1c2b('0x2'));var rp=require(_0x1c2b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c2b('0x4'));var config=require(_0x1c2b('0x5'));var attributes=require('./smsApplication.attributes');module[_0x1c2b('0x6')]=function(_0xa1e2cd,_0x3ad7da){return _0xa1e2cd[_0x1c2b('0x7')](_0x1c2b('0x8'),attributes,{'tableName':_0x1c2b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c2b('0xa'),'collate':_0x1c2b('0xb')});};
\ No newline at end of file
+var _0xb504=['../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1482aa,_0x3f6076){var _0x2da989=function(_0x16c198){while(--_0x16c198){_0x1482aa['push'](_0x1482aa['shift']());}};_0x2da989(++_0x3f6076);}(_0xb504,0x1b4));var _0x4b50=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb504[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b50('0x0'))('api');var moment=require('moment');var BPromise=require(_0x4b50('0x1'));var rp=require(_0x4b50('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b50('0x3'));var config=require(_0x4b50('0x4'));var attributes=require(_0x4b50('0x5'));module[_0x4b50('0x6')]=function(_0x3a5a15,_0x113e72){return _0x3a5a15['define'](_0x4b50('0x7'),attributes,{'tableName':_0x4b50('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b50('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 530b7a5..c5292c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ad=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x34ddda,_0x198e94){var _0x4791d3=function(_0x11eeb2){while(--_0x11eeb2){_0x34ddda['push'](_0x34ddda['shift']());}};_0x4791d3(++_0x198e94);}(_0xd4ad,0x158));var _0xdd4a=function(_0xf02bc4,_0x5a5a9a){_0xf02bc4=_0xf02bc4-0x0;var _0x57bbd8=_0xd4ad[_0xf02bc4];return _0x57bbd8;};'use strict';var _=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var moment=require(_0xdd4a('0x2'));var BPromise=require(_0xdd4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd4a('0x4'));var db=require(_0xdd4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd4a('0x6'));var config=require(_0xdd4a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd4a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd243eb,_0xb14ae6,_0x5586dd){return new BPromise(function(_0x2dc5e1,_0x59d142){return client[_0xdd4a('0x9')](_0xd243eb,_0x5586dd)[_0xdd4a('0xa')](function(_0x42fa33){logger[_0xdd4a('0xb')](_0xdd4a('0xc'),_0xb14ae6,_0xdd4a('0xd'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0xb14ae6,_0xdd4a('0xd'),JSON['stringify'](_0x42fa33));if(_0x42fa33[_0xdd4a('0xe')]){if(_0x42fa33[_0xdd4a('0xe')]['code']===0x1f4){logger[_0xdd4a('0xe')](_0xdd4a('0xc'),_0xb14ae6,_0x42fa33['error'][_0xdd4a('0xf')]);return _0x59d142(_0x42fa33['error'][_0xdd4a('0xf')]);}logger['error'](_0xdd4a('0xc'),_0xb14ae6,_0x42fa33['error']['message']);return _0x2dc5e1(_0x42fa33[_0xdd4a('0xe')]['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0xb14ae6,_0xdd4a('0xd'));_0x2dc5e1(_0x42fa33[_0xdd4a('0x10')][_0xdd4a('0xf')]);}})[_0xdd4a('0x11')](function(_0x37d755){logger[_0xdd4a('0xe')](_0xdd4a('0xc'),_0xb14ae6,_0x37d755);_0x59d142(_0x37d755);});});}
\ No newline at end of file
+var _0x6e1c=['rpc','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23f6de,_0xdde74c){var _0x2d2af8=function(_0x15fdd1){while(--_0x15fdd1){_0x23f6de['push'](_0x23f6de['shift']());}};_0x2d2af8(++_0xdde74c);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('SmsApplication,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});}
\ No newline at end of file
index 4131604..5677cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x492bfc,_0x57e49a){var _0x44af9b=function(_0xc27587){while(--_0xc27587){_0x492bfc['push'](_0x492bfc['shift']());}};_0x44af9b(++_0x57e49a);}(_0x7708,0x188));var _0x8770=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x7708[_0x39fd11];return _0x302799;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router;
\ No newline at end of file
+var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x435ee9,_0x1465a9){_0x435ee9=_0x435ee9-0x0;var _0x418d87=_0xd7d1[_0x435ee9];return _0x418d87;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router;
\ No newline at end of file
index 82db698..3cccf45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3595=['moment','exports','DATE','STRING','out','ENUM','BOOLEAN','sequelize'];(function(_0x299eca,_0x4ed66b){var _0x2848c6=function(_0x536ae2){while(--_0x536ae2){_0x299eca['push'](_0x299eca['shift']());}};_0x2848c6(++_0x4ed66b);}(_0x3595,0x147));var _0x5359=function(_0x535c1a,_0x36cbd6){_0x535c1a=_0x535c1a-0x0;var _0x4997c8=_0x3595[_0x535c1a];return _0x4997c8;};'use strict';var Sequelize=require(_0x5359('0x0'));var moment=require(_0x5359('0x1'));module[_0x5359('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5359('0x3')]},'disposition':{'type':Sequelize[_0x5359('0x4')]},'secondDisposition':{'type':Sequelize[_0x5359('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5359('0x4')]},'note':{'type':Sequelize[_0x5359('0x4')]},'phone':{'type':Sequelize[_0x5359('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5359('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5359('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5359('0x6')]('in',_0x5359('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5359('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8784=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3b3acc,_0x410997){var _0xc71080=function(_0x317843){while(--_0x317843){_0x3b3acc['push'](_0x3b3acc['shift']());}};_0xc71080(++_0x410997);}(_0x8784,0x172));var _0x4878=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x8784[_0x448f8];return _0xa73126;};'use strict';var Sequelize=require(_0x4878('0x0'));var moment=require(_0x4878('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4878('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4878('0x3')]},'disposition':{'type':Sequelize[_0x4878('0x4')]},'secondDisposition':{'type':Sequelize[_0x4878('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4878('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4878('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4878('0x5')]('in',_0x4878('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4878('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4878('0x5')]('in',_0x4878('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4878('0x2')],'defaultValue':![]}};
\ No newline at end of file
index c329dfe..b39d7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4af5=['addTags','ids','spread','Tag','findAll','color','emit','smsInteractionTags:save','download','server','files','tmp','join','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Sms','N.A.','toString','closed','closedAt','disposition','filter','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','SmsInteraction','fieldName','type','key','getOptions','sms','query','user','catch','show','params','model','rawAttributes','keys','filters','intersection','fields','attributes','length','include','merge','options','find','create','body','describe','addMessage','SmsMessage','omit','findOne','hasOwnProperty','sort','where','SmsInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3fe7a8,_0x57de40){var _0x418d94=function(_0x2cd20b){while(--_0x2cd20b){_0x3fe7a8['push'](_0x3fe7a8['shift']());}};_0x418d94(++_0x57de40);}(_0x4af5,0x117));var _0x54af=function(_0x3c9ccb,_0x4eea93){_0x3c9ccb=_0x3c9ccb-0x0;var _0x466595=_0x4af5[_0x3c9ccb];return _0x466595;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x54af('0x0'));var util=require(_0x54af('0x1'));var path=require(_0x54af('0x2'));var ejs=require(_0x54af('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x54af('0x4'));var interaction=require(_0x54af('0x5'));var qs=require(_0x54af('0x6'));var pdf=require(_0x54af('0x7'));var logger=require(_0x54af('0x8'))(_0x54af('0x9'));var config=require(_0x54af('0xa'));var db=require(_0x54af('0xb'))['db'];config[_0x54af('0xc')]=_[_0x54af('0xd')](config['redis'],{'host':_0x54af('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x54af('0xf'))[_0x54af('0x10')](socket);function respondWithStatusCode(_0x3b05e1,_0x140911){_0x140911=_0x140911||0xcc;return function(_0x3e3544){if(_0x3e3544){return _0x3b05e1[_0x54af('0x11')](_0x140911);}return _0x3b05e1[_0x54af('0x12')](_0x140911)[_0x54af('0x13')]();};}function respondWithResult(_0x306ee9,_0x1f777f){_0x1f777f=_0x1f777f||0xc8;return function(_0x479de0){if(_0x479de0){return _0x306ee9[_0x54af('0x12')](_0x1f777f)['json'](_0x479de0);}};}function respondWithFilteredResult(_0x25bb6a,_0x115aa3){return function(_0x4009ad){if(_0x4009ad){var _0x49b73e=typeof _0x115aa3[_0x54af('0x14')]===_0x54af('0x15')&&typeof _0x115aa3[_0x54af('0x16')]===_0x54af('0x15');var _0x1fdfbe=_0x4009ad[_0x54af('0x17')];var _0x544710=_0x49b73e?0x0:_0x115aa3[_0x54af('0x14')];var _0x552e89=_0x49b73e?_0x4009ad[_0x54af('0x17')]:_0x115aa3[_0x54af('0x14')]+_0x115aa3[_0x54af('0x16')];var _0x57951b;if(_0x552e89>=_0x1fdfbe){_0x552e89=_0x1fdfbe;_0x57951b=0xc8;}else{_0x57951b=0xce;}_0x25bb6a[_0x54af('0x12')](_0x57951b);return _0x25bb6a[_0x54af('0x18')](_0x54af('0x19'),_0x544710+'-'+_0x552e89+'/'+_0x1fdfbe)['json'](_0x4009ad);}return null;};}function saveUpdates(_0x39165e){return function(_0x5c83b8){if(_0x5c83b8){return _0x5c83b8[_0x54af('0x1a')](_0x39165e)[_0x54af('0x1b')](function(_0x1be2fd){return _0x1be2fd;});}return null;};}function removeEntity(_0x49cf2c){return function(_0x4524a5){if(_0x4524a5){return _0x4524a5[_0x54af('0x1c')]()['then'](function(){_0x49cf2c[_0x54af('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19c950){return function(_0x44e744){if(!_0x44e744){_0x19c950[_0x54af('0x11')](0x194);}return _0x44e744;};}function handleError(_0x30c5f2,_0x3c74ce){_0x3c74ce=_0x3c74ce||0x1f4;return function(_0x144490){logger[_0x54af('0x1d')](_0x144490[_0x54af('0x1e')]);if(_0x144490[_0x54af('0x1f')]){delete _0x144490[_0x54af('0x1f')];}_0x30c5f2[_0x54af('0x12')](_0x3c74ce)[_0x54af('0x20')](_0x144490);};}exports['index']=function(_0x33a9b8,_0x546f93){var _0x5be30a={};var _0x1b2516=_[_0x54af('0x21')](db[_0x54af('0x22')]['rawAttributes'],function(_0x407fc0){return{'name':_0x407fc0[_0x54af('0x23')],'type':_0x407fc0[_0x54af('0x24')][_0x54af('0x25')]};});_0x5be30a=qs[_0x54af('0x26')](_0x1b2516,_0x33a9b8);return interaction['findAll'](_0x54af('0x27'),_0x33a9b8[_0x54af('0x28')],_0x33a9b8[_0x54af('0x29')],_0x5be30a,_0x1b2516)[_0x54af('0x1b')](respondWithFilteredResult(_0x546f93,_0x5be30a))[_0x54af('0x2a')](handleError(_0x546f93,null));};exports[_0x54af('0x2b')]=function(_0x3b0255,_0x56f8a5){var _0x59c5ac={'raw':![],'where':{'id':_0x3b0255[_0x54af('0x2c')]['id']}},_0x3a6e9b={};_0x3a6e9b[_0x54af('0x2d')]=_['keys'](db[_0x54af('0x22')][_0x54af('0x2e')]);_0x3a6e9b['query']=_[_0x54af('0x2f')](_0x3b0255[_0x54af('0x28')]);_0x3a6e9b[_0x54af('0x30')]=_[_0x54af('0x31')](_0x3a6e9b['model'],_0x3a6e9b[_0x54af('0x28')]);_0x59c5ac['attributes']=_[_0x54af('0x31')](_0x3a6e9b[_0x54af('0x2d')],qs[_0x54af('0x32')](_0x3b0255['query'][_0x54af('0x32')]));_0x59c5ac['attributes']=_0x59c5ac[_0x54af('0x33')][_0x54af('0x34')]?_0x59c5ac[_0x54af('0x33')]:_0x3a6e9b[_0x54af('0x2d')];if(_0x3b0255[_0x54af('0x28')]['includeAll']){_0x59c5ac[_0x54af('0x35')]=[{'all':!![]}];}_0x59c5ac=_[_0x54af('0x36')]({},_0x59c5ac,_0x3b0255[_0x54af('0x37')]);return db['SmsInteraction'][_0x54af('0x38')](_0x59c5ac)[_0x54af('0x1b')](handleEntityNotFound(_0x56f8a5,null))['then'](respondWithResult(_0x56f8a5,null))[_0x54af('0x2a')](handleError(_0x56f8a5,null));};exports[_0x54af('0x39')]=function(_0x40d8fa,_0x1854d0){return db[_0x54af('0x22')]['create'](_0x40d8fa[_0x54af('0x3a')],{})[_0x54af('0x1b')](respondWithResult(_0x1854d0,0xc9))[_0x54af('0x2a')](handleError(_0x1854d0,null));};exports[_0x54af('0x1a')]=function(_0x404aea,_0x5bbb64){if(_0x404aea[_0x54af('0x3a')]['id']){delete _0x404aea[_0x54af('0x3a')]['id'];}return db[_0x54af('0x22')][_0x54af('0x38')]({'where':{'id':_0x404aea[_0x54af('0x2c')]['id']}})[_0x54af('0x1b')](handleEntityNotFound(_0x5bbb64,null))['then'](saveUpdates(_0x404aea['body'],null))[_0x54af('0x1b')](respondWithResult(_0x5bbb64,null))[_0x54af('0x2a')](handleError(_0x5bbb64,null));};exports['destroy']=function(_0x2e87b7,_0x29fd02){return db[_0x54af('0x22')][_0x54af('0x38')]({'where':{'id':_0x2e87b7['params']['id']}})['then'](handleEntityNotFound(_0x29fd02,null))[_0x54af('0x1b')](removeEntity(_0x29fd02,null))['catch'](handleError(_0x29fd02,null));};exports[_0x54af('0x3b')]=function(_0x3b7461,_0x2c6455){return db[_0x54af('0x22')][_0x54af('0x3b')]()['then'](respondWithResult(_0x2c6455,null))[_0x54af('0x2a')](handleError(_0x2c6455,null));};exports[_0x54af('0x3c')]=function(_0x108100,_0x41b34d){return db[_0x54af('0x3d')][_0x54af('0x38')]({'where':{'id':_0x108100[_0x54af('0x2c')]['id']}})[_0x54af('0x1b')](handleEntityNotFound(_0x41b34d,null))['then'](function(_0x3c7612){if(_0x3c7612){return _0x3c7612[_0x54af('0x3c')](_0x108100[_0x54af('0x3a')]['ids'],_[_0x54af('0x3e')](_0x108100['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x41b34d,null))[_0x54af('0x2a')](handleError(_0x41b34d,null));};exports['getMessages']=function(_0xbda945,_0x299257){var _0x4d920b={'raw':![],'where':{}};var _0x2d4ddf={};var _0x23d78d={'count':0x0,'rows':[]};return db[_0x54af('0x22')][_0x54af('0x3f')]({'where':{'id':_0xbda945[_0x54af('0x2c')]['id']}})['then'](handleEntityNotFound(_0x299257,null))[_0x54af('0x1b')](function(_0x53f182){if(_0x53f182){_0x2d4ddf[_0x54af('0x2d')]=_[_0x54af('0x2f')](db['SmsMessage'][_0x54af('0x2e')]);_0x2d4ddf[_0x54af('0x28')]=_[_0x54af('0x2f')](_0xbda945['query']);_0x2d4ddf[_0x54af('0x30')]=_[_0x54af('0x31')](_0x2d4ddf[_0x54af('0x2d')],_0x2d4ddf[_0x54af('0x28')]);_0x4d920b[_0x54af('0x33')]=_['intersection'](_0x2d4ddf[_0x54af('0x2d')],qs[_0x54af('0x32')](_0xbda945['query']['fields']));_0x4d920b[_0x54af('0x33')]=_0x4d920b[_0x54af('0x33')][_0x54af('0x34')]?_0x4d920b[_0x54af('0x33')]:_0x2d4ddf['model'];if(!_0xbda945[_0x54af('0x28')][_0x54af('0x40')]('nolimit')){_0x4d920b[_0x54af('0x16')]=qs[_0x54af('0x16')](_0xbda945['query'][_0x54af('0x16')]);_0x4d920b[_0x54af('0x14')]=qs[_0x54af('0x14')](_0xbda945[_0x54af('0x28')][_0x54af('0x14')]);}_0x4d920b['order']=qs[_0x54af('0x41')](_0xbda945[_0x54af('0x28')]['sort']);_0x4d920b[_0x54af('0x42')]=qs[_0x54af('0x30')](_['pick'](_0xbda945['query'],_0x2d4ddf['filters']));_0x4d920b[_0x54af('0x42')][_0x54af('0x43')]=_0x53f182['id'];if(_0xbda945[_0x54af('0x28')]['filter']){_0x4d920b[_0x54af('0x42')]=_[_0x54af('0x36')](_0x4d920b['where'],{'$or':_[_0x54af('0x21')](_0x4d920b[_0x54af('0x33')],function(_0x5c4971){var _0x1e6cb1={};_0x1e6cb1[_0x5c4971]={'$like':'%'+_0xbda945[_0x54af('0x28')]['filter']+'%'};return _0x1e6cb1;})});}if(_0xbda945[_0x54af('0x28')]['$gte']){var _0x45de06=_0xbda945['query'][_0x54af('0x44')][_0x54af('0x45')](',');var _0x3e1d3a={};_0x3e1d3a[_0x45de06[0x0]]={'$gte':moment(_0x45de06[0x1])[_0x54af('0x46')](_0x54af('0x47'))};_0x4d920b[_0x54af('0x42')]=_['merge'](_0x4d920b[_0x54af('0x42')],_0x3e1d3a);}_0x4d920b=_[_0x54af('0x36')]({},_0x4d920b,_0xbda945[_0x54af('0x37')]);return db[_0x54af('0x3d')][_0x54af('0x17')]({'where':_0x4d920b[_0x54af('0x42')]})[_0x54af('0x1b')](function(_0x2f750c){_0x23d78d[_0x54af('0x17')]=_0x2f750c;if(_0xbda945[_0x54af('0x28')]['includeAll']){_0x4d920b['include']=[{'all':!![]}];}return db[_0x54af('0x3d')]['findAll'](_0x4d920b);})[_0x54af('0x1b')](function(_0x1552cd){_0x23d78d['rows']=_0x1552cd;return _0x23d78d;});}})[_0x54af('0x1b')](respondWithFilteredResult(_0x299257,_0x4d920b))[_0x54af('0x2a')](handleError(_0x299257,null));};exports[_0x54af('0x48')]=function(_0x4aa45e,_0x39fc31){return db[_0x54af('0x22')][_0x54af('0x38')]({'where':{'id':_0x4aa45e['params']['id']}})[_0x54af('0x1b')](handleEntityNotFound(_0x39fc31,null))[_0x54af('0x1b')](function(_0x2e9548){if(_0x2e9548){return _0x2e9548['setTags'](_0x4aa45e[_0x54af('0x3a')][_0x54af('0x49')],_['omit'](_0x4aa45e[_0x54af('0x3a')],[_0x54af('0x49'),'id'])||{})[_0x54af('0x4a')](function(){return db[_0x54af('0x4b')][_0x54af('0x4c')]({'attributes':['id',_0x54af('0x1f'),_0x54af('0x4d')],'where':{'id':_0x4aa45e['body']['ids']}});})['then'](function(_0x5837c3){socket[_0x54af('0x4e')](_0x54af('0x4f'),{'id':Number(_0x4aa45e[_0x54af('0x2c')]['id']),'tags':_0x5837c3||[]});return{'id':Number(_0x4aa45e['params']['id']),'tags':_0x5837c3||[]};});}})[_0x54af('0x1b')](respondWithResult(_0x39fc31,null))[_0x54af('0x2a')](handleError(_0x39fc31,null));};exports['removeTags']=function(_0x228dc5,_0x5e00a1){return db['SmsInteraction'][_0x54af('0x38')]({'where':{'id':_0x228dc5[_0x54af('0x2c')]['id']}})[_0x54af('0x1b')](handleEntityNotFound(_0x5e00a1,null))[_0x54af('0x1b')](function(_0x426846){if(_0x426846){return _0x426846['removeTags'](_0x228dc5[_0x54af('0x28')][_0x54af('0x49')]);}})[_0x54af('0x1b')](respondWithStatusCode(_0x5e00a1,null))[_0x54af('0x2a')](handleError(_0x5e00a1,null));};exports[_0x54af('0x50')]=function(_0x796353,_0x31ca54){var _0x27d1b3=moment()['unix']()['toString']();var _0x573cb8=path['join'](config['root'],_0x54af('0x51'),_0x54af('0x52'),_0x54af('0x53'));var _0x13a351=path[_0x54af('0x54')](_0x573cb8,_0x27d1b3);var _0x556723=util['format'](_0x54af('0x55'),_0x796353[_0x54af('0x2c')]['id'],_0x27d1b3);var _0x32fe8f=path[_0x54af('0x54')](_0x573cb8,_0x556723);var _0x1d851c=[];_0x1d851c['push']({'model':db[_0x54af('0x56')],'as':_0x54af('0x56'),'attributes':['id',_0x54af('0x57')],'raw':!![]});_0x1d851c[_0x54af('0x58')]({'model':db[_0x54af('0x59')],'as':_0x54af('0x5a'),'attributes':['id',_0x54af('0x5b'),_0x54af('0x5c')],'raw':!![]});var _0x5f15e2=[{'model':db[_0x54af('0x3d')],'as':_0x54af('0x5d'),'attributes':['id',_0x54af('0x3a'),_0x54af('0x5e'),_0x54af('0x5f'),_0x54af('0x60'),_0x54af('0x61')],'include':_0x1d851c}];_0x5f15e2[_0x54af('0x58')]({'model':db['SmsAccount'],'as':_0x54af('0x62'),'attributes':['id','name']});_0x5f15e2[_0x54af('0x58')]({'model':db[_0x54af('0x56')],'as':_0x54af('0x63'),'attributes':['id',_0x54af('0x57')]});return db[_0x54af('0x22')][_0x54af('0x38')]({'where':{'id':_0x796353['params']['id']},'include':_0x5f15e2})[_0x54af('0x1b')](handleEntityNotFound(_0x31ca54,null))[_0x54af('0x1b')](function(_0x43438b){if(_0x43438b){var _0x3c290e=_0x43438b[_0x54af('0x64')]({'plain':!![]});fs[_0x54af('0x65')](_0x13a351);var _0x4e977a={'channel':_0x54af('0x66'),'account':_0x3c290e[_0x54af('0x62')][_0x54af('0x1f')],'agent':_0x3c290e[_0x54af('0x63')]?_0x3c290e[_0x54af('0x63')]['fullname']:_0x54af('0x67'),'createdAt':moment(_0x3c290e[_0x54af('0x5e')])[_0x54af('0x46')](_0x54af('0x47'))[_0x54af('0x68')](),'closedAt':_0x3c290e[_0x54af('0x69')]?moment(_0x3c290e[_0x54af('0x6a')])[_0x54af('0x46')](_0x54af('0x47'))[_0x54af('0x68')]():'','disposition':_0x3c290e[_0x54af('0x6b')],'messages':_(_0x3c290e[_0x54af('0x5d')])[_0x54af('0x6c')]({'secret':![]})[_0x54af('0x21')](function(_0x2d5432){return{'date':moment(_0x2d5432[_0x54af('0x5e')])[_0x54af('0x46')](_0x54af('0x47'))[_0x54af('0x68')](),'sender':_0x2d5432['direction']==='out'?_0x2d5432[_0x54af('0x56')]?_0x2d5432[_0x54af('0x56')][_0x54af('0x57')]:'System':_0x2d5432['Contact'][_0x54af('0x5b')]+(_0x2d5432[_0x54af('0x5a')][_0x54af('0x5c')]?'\x20'+_0x2d5432[_0x54af('0x5a')][_0x54af('0x5c')]:''),'body':_0x2d5432['body'],'direction':_0x2d5432[_0x54af('0x5f')]===_0x54af('0x6d')?'A':'C','secret':_0x2d5432[_0x54af('0x60')],'read':_0x2d5432[_0x54af('0x61')]};})[_0x54af('0x6e')]()};return ejs[_0x54af('0x6f')](path[_0x54af('0x54')](config['root'],_0x54af('0x51'),_0x54af('0x70'),_0x54af('0x71')),{'interaction':_0x4e977a})[_0x54af('0x1b')](function(_0x7c5160){var _0x1095f0=path[_0x54af('0x54')](_0x13a351,_0x54af('0x72')+_0x3c290e['id']+'-'+_0x27d1b3+_0x54af('0x73'));var _0xe5e9aa={'path':_0x1095f0,'channel':_0x54af('0x66'),'interactionId':_0x3c290e['id']};return pdf['createPdfFromHTML'](_0x7c5160,_0xe5e9aa);})[_0x54af('0x1b')](function(){return new BPromise(function(_0x59bf72,_0x5e6c65){zipdir(_0x13a351,{'saveTo':_0x32fe8f},function(_0x255b86,_0x38a721){if(_0x255b86)return _0x5e6c65(_0x255b86);return _0x59bf72(_0x38a721);});})[_0x54af('0x1b')](function(){return new BPromise(function(_0x3ea025,_0x1ac6e8){rimraf(_0x13a351,function(_0x2f789f){if(_0x2f789f)_0x1ac6e8(_0x2f789f);return _0x3ea025();});});})[_0x54af('0x1b')](function(){return _0x31ca54[_0x54af('0x50')](_0x32fe8f,_0x556723,function(_0x4c0c2d){if(_0x4c0c2d){console['log'](_0x54af('0x74'),_0x4c0c2d);}else{fs['unlinkSync'](_0x32fe8f);}});});});}else{return _0x31ca54[_0x54af('0x11')](0xc8);}})[_0x54af('0x2a')](handleError(_0x31ca54,null));};
\ No newline at end of file
+var _0xdf18=['removeTags','unix','toString','root','server','files','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','createdAt','direction','secret','read','SmsAccount','Account','name','Owner','get','mkdirSync','Sms','N.A.','closed','disposition','Messages','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','rimraf','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','update','destroy','then','error','stack','send','rawAttributes','fieldName','type','key','findAll','sms','query','catch','model','keys','SmsInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','SmsMessage','omit','ids','getMessages','nolimit','order','sort','where','pick','SmsInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','color','emit','smsInteractionTags:save'];(function(_0x17dd2c,_0x5b9392){var _0x316593=function(_0x1e47a6){while(--_0x1e47a6){_0x17dd2c['push'](_0x17dd2c['shift']());}};_0x316593(++_0x5b9392);}(_0xdf18,0x10e));var _0x8df1=function(_0xb00537,_0x4d25b9){_0xb00537=_0xb00537-0x0;var _0x55d401=_0xdf18[_0xb00537];return _0x55d401;};'use strict';var rimraf=require(_0x8df1('0x0'));var zipdir=require(_0x8df1('0x1'));var moment=require(_0x8df1('0x2'));var BPromise=require(_0x8df1('0x3'));var util=require('util');var path=require(_0x8df1('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8df1('0x5'));var Redis=require('ioredis');var interaction=require(_0x8df1('0x6'));var qs=require(_0x8df1('0x7'));var pdf=require(_0x8df1('0x8'));var logger=require(_0x8df1('0x9'))(_0x8df1('0xa'));var config=require(_0x8df1('0xb'));var db=require(_0x8df1('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8df1('0xd'),'port':0x18eb});var socket=require(_0x8df1('0xe'))(new Redis(config[_0x8df1('0xf')]));require(_0x8df1('0x10'))[_0x8df1('0x11')](socket);function respondWithStatusCode(_0x312f1b,_0x449ddc){_0x449ddc=_0x449ddc||0xcc;return function(_0x1eded3){if(_0x1eded3){return _0x312f1b[_0x8df1('0x12')](_0x449ddc);}return _0x312f1b[_0x8df1('0x13')](_0x449ddc)['end']();};}function respondWithResult(_0x2435a0,_0xe2e7d5){_0xe2e7d5=_0xe2e7d5||0xc8;return function(_0x3a4114){if(_0x3a4114){return _0x2435a0['status'](_0xe2e7d5)['json'](_0x3a4114);}};}function respondWithFilteredResult(_0x2654c1,_0x2edd52){return function(_0x4a5de4){if(_0x4a5de4){var _0x2b68ea=typeof _0x2edd52['offset']===_0x8df1('0x14')&&typeof _0x2edd52[_0x8df1('0x15')]==='undefined';var _0x6b3416=_0x4a5de4[_0x8df1('0x16')];var _0x2d498b=_0x2b68ea?0x0:_0x2edd52[_0x8df1('0x17')];var _0x32a27b=_0x2b68ea?_0x4a5de4[_0x8df1('0x16')]:_0x2edd52['offset']+_0x2edd52[_0x8df1('0x15')];var _0x99a233;if(_0x32a27b>=_0x6b3416){_0x32a27b=_0x6b3416;_0x99a233=0xc8;}else{_0x99a233=0xce;}_0x2654c1['status'](_0x99a233);return _0x2654c1['set'](_0x8df1('0x18'),_0x2d498b+'-'+_0x32a27b+'/'+_0x6b3416)[_0x8df1('0x19')](_0x4a5de4);}return null;};}function saveUpdates(_0x33b5df){return function(_0x1c649c){if(_0x1c649c){return _0x1c649c[_0x8df1('0x1a')](_0x33b5df)['then'](function(_0xc82af7){return _0xc82af7;});}return null;};}function removeEntity(_0x562a85){return function(_0x67b269){if(_0x67b269){return _0x67b269[_0x8df1('0x1b')]()[_0x8df1('0x1c')](function(){_0x562a85[_0x8df1('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x290c42){return function(_0x3ebea5){if(!_0x3ebea5){_0x290c42[_0x8df1('0x12')](0x194);}return _0x3ebea5;};}function handleError(_0x5e8bfa,_0x2ce973){_0x2ce973=_0x2ce973||0x1f4;return function(_0x569790){logger[_0x8df1('0x1d')](_0x569790[_0x8df1('0x1e')]);if(_0x569790['name']){delete _0x569790['name'];}_0x5e8bfa[_0x8df1('0x13')](_0x2ce973)[_0x8df1('0x1f')](_0x569790);};}exports['index']=function(_0x4bef16,_0x46e477){var _0x5adc0b={};var _0x56bb6c=_['map'](db['SmsInteraction'][_0x8df1('0x20')],function(_0x4dc9b3){return{'name':_0x4dc9b3[_0x8df1('0x21')],'type':_0x4dc9b3[_0x8df1('0x22')][_0x8df1('0x23')]};});_0x5adc0b=qs['getOptions'](_0x56bb6c,_0x4bef16);return interaction[_0x8df1('0x24')](_0x8df1('0x25'),_0x4bef16[_0x8df1('0x26')],_0x4bef16['user'],_0x5adc0b,_0x56bb6c)['then'](respondWithFilteredResult(_0x46e477,_0x5adc0b))[_0x8df1('0x27')](handleError(_0x46e477,null));};exports['show']=function(_0x1d88b,_0x389fb2){var _0x21ac4c={'raw':![],'where':{'id':_0x1d88b['params']['id']}},_0x38e7e5={};_0x38e7e5[_0x8df1('0x28')]=_[_0x8df1('0x29')](db[_0x8df1('0x2a')][_0x8df1('0x20')]);_0x38e7e5[_0x8df1('0x26')]=_[_0x8df1('0x29')](_0x1d88b[_0x8df1('0x26')]);_0x38e7e5[_0x8df1('0x2b')]=_[_0x8df1('0x2c')](_0x38e7e5[_0x8df1('0x28')],_0x38e7e5[_0x8df1('0x26')]);_0x21ac4c[_0x8df1('0x2d')]=_[_0x8df1('0x2c')](_0x38e7e5[_0x8df1('0x28')],qs['fields'](_0x1d88b[_0x8df1('0x26')][_0x8df1('0x2e')]));_0x21ac4c[_0x8df1('0x2d')]=_0x21ac4c['attributes'][_0x8df1('0x2f')]?_0x21ac4c[_0x8df1('0x2d')]:_0x38e7e5[_0x8df1('0x28')];if(_0x1d88b[_0x8df1('0x26')][_0x8df1('0x30')]){_0x21ac4c[_0x8df1('0x31')]=[{'all':!![]}];}_0x21ac4c=_[_0x8df1('0x32')]({},_0x21ac4c,_0x1d88b[_0x8df1('0x33')]);return db['SmsInteraction'][_0x8df1('0x34')](_0x21ac4c)[_0x8df1('0x1c')](handleEntityNotFound(_0x389fb2,null))[_0x8df1('0x1c')](respondWithResult(_0x389fb2,null))[_0x8df1('0x27')](handleError(_0x389fb2,null));};exports[_0x8df1('0x35')]=function(_0x1dde20,_0x1d123b){return db[_0x8df1('0x2a')][_0x8df1('0x35')](_0x1dde20[_0x8df1('0x36')],{})[_0x8df1('0x1c')](respondWithResult(_0x1d123b,0xc9))[_0x8df1('0x27')](handleError(_0x1d123b,null));};exports[_0x8df1('0x1a')]=function(_0xb1fe53,_0xf1009e){if(_0xb1fe53[_0x8df1('0x36')]['id']){delete _0xb1fe53[_0x8df1('0x36')]['id'];}return db[_0x8df1('0x2a')]['find']({'where':{'id':_0xb1fe53['params']['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0xf1009e,null))[_0x8df1('0x1c')](saveUpdates(_0xb1fe53['body'],null))[_0x8df1('0x1c')](respondWithResult(_0xf1009e,null))[_0x8df1('0x27')](handleError(_0xf1009e,null));};exports[_0x8df1('0x1b')]=function(_0x458759,_0x265aac){return db[_0x8df1('0x2a')][_0x8df1('0x34')]({'where':{'id':_0x458759[_0x8df1('0x37')]['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0x265aac,null))[_0x8df1('0x1c')](removeEntity(_0x265aac,null))['catch'](handleError(_0x265aac,null));};exports[_0x8df1('0x38')]=function(_0x4608e0,_0xb47358){return db[_0x8df1('0x2a')][_0x8df1('0x38')]()[_0x8df1('0x1c')](respondWithResult(_0xb47358,null))['catch'](handleError(_0xb47358,null));};exports['addMessage']=function(_0x2fe874,_0x2fddb4){return db[_0x8df1('0x39')]['find']({'where':{'id':_0x2fe874[_0x8df1('0x37')]['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0x2fddb4,null))['then'](function(_0x1cad8e){if(_0x1cad8e){return _0x1cad8e['addMessage'](_0x2fe874[_0x8df1('0x36')]['ids'],_[_0x8df1('0x3a')](_0x2fe874[_0x8df1('0x36')],[_0x8df1('0x3b'),'id'])||{});}})[_0x8df1('0x1c')](respondWithResult(_0x2fddb4,null))[_0x8df1('0x27')](handleError(_0x2fddb4,null));};exports[_0x8df1('0x3c')]=function(_0x5643a,_0x5c79fe){var _0x2ade9e={'raw':![],'where':{}};var _0x493270={};var _0x28a280={'count':0x0,'rows':[]};return db[_0x8df1('0x2a')]['findOne']({'where':{'id':_0x5643a[_0x8df1('0x37')]['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0x5c79fe,null))[_0x8df1('0x1c')](function(_0x433e12){if(_0x433e12){_0x493270['model']=_[_0x8df1('0x29')](db[_0x8df1('0x39')][_0x8df1('0x20')]);_0x493270[_0x8df1('0x26')]=_['keys'](_0x5643a[_0x8df1('0x26')]);_0x493270['filters']=_[_0x8df1('0x2c')](_0x493270[_0x8df1('0x28')],_0x493270[_0x8df1('0x26')]);_0x2ade9e[_0x8df1('0x2d')]=_[_0x8df1('0x2c')](_0x493270['model'],qs['fields'](_0x5643a[_0x8df1('0x26')][_0x8df1('0x2e')]));_0x2ade9e[_0x8df1('0x2d')]=_0x2ade9e[_0x8df1('0x2d')]['length']?_0x2ade9e[_0x8df1('0x2d')]:_0x493270['model'];if(!_0x5643a[_0x8df1('0x26')]['hasOwnProperty'](_0x8df1('0x3d'))){_0x2ade9e[_0x8df1('0x15')]=qs[_0x8df1('0x15')](_0x5643a[_0x8df1('0x26')][_0x8df1('0x15')]);_0x2ade9e['offset']=qs[_0x8df1('0x17')](_0x5643a[_0x8df1('0x26')][_0x8df1('0x17')]);}_0x2ade9e[_0x8df1('0x3e')]=qs[_0x8df1('0x3f')](_0x5643a[_0x8df1('0x26')]['sort']);_0x2ade9e[_0x8df1('0x40')]=qs[_0x8df1('0x2b')](_[_0x8df1('0x41')](_0x5643a[_0x8df1('0x26')],_0x493270[_0x8df1('0x2b')]));_0x2ade9e['where'][_0x8df1('0x42')]=_0x433e12['id'];if(_0x5643a[_0x8df1('0x26')][_0x8df1('0x43')]){_0x2ade9e[_0x8df1('0x40')]=_[_0x8df1('0x32')](_0x2ade9e['where'],{'$or':_[_0x8df1('0x44')](_0x2ade9e['attributes'],function(_0x59b212){var _0x40d0d2={};_0x40d0d2[_0x59b212]={'$like':'%'+_0x5643a[_0x8df1('0x26')]['filter']+'%'};return _0x40d0d2;})});}if(_0x5643a['query'][_0x8df1('0x45')]){var _0x3a1910=_0x5643a[_0x8df1('0x26')][_0x8df1('0x45')]['split'](',');var _0x2e45a3={};_0x2e45a3[_0x3a1910[0x0]]={'$gte':moment(_0x3a1910[0x1])[_0x8df1('0x46')](_0x8df1('0x47'))};_0x2ade9e[_0x8df1('0x40')]=_[_0x8df1('0x32')](_0x2ade9e[_0x8df1('0x40')],_0x2e45a3);}_0x2ade9e=_[_0x8df1('0x32')]({},_0x2ade9e,_0x5643a[_0x8df1('0x33')]);return db['SmsMessage']['count']({'where':_0x2ade9e[_0x8df1('0x40')]})[_0x8df1('0x1c')](function(_0x4de30d){_0x28a280[_0x8df1('0x16')]=_0x4de30d;if(_0x5643a[_0x8df1('0x26')][_0x8df1('0x30')]){_0x2ade9e[_0x8df1('0x31')]=[{'all':!![]}];}return db[_0x8df1('0x39')]['findAll'](_0x2ade9e);})[_0x8df1('0x1c')](function(_0x2296d5){_0x28a280[_0x8df1('0x48')]=_0x2296d5;return _0x28a280;});}})['then'](respondWithFilteredResult(_0x5c79fe,_0x2ade9e))[_0x8df1('0x27')](handleError(_0x5c79fe,null));};exports['addTags']=function(_0x53d3a1,_0x2eda27){return db[_0x8df1('0x2a')][_0x8df1('0x34')]({'where':{'id':_0x53d3a1[_0x8df1('0x37')]['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0x2eda27,null))[_0x8df1('0x1c')](function(_0x349cc3){if(_0x349cc3){return _0x349cc3[_0x8df1('0x49')](_0x53d3a1[_0x8df1('0x36')][_0x8df1('0x3b')],_[_0x8df1('0x3a')](_0x53d3a1['body'],[_0x8df1('0x3b'),'id'])||{})['spread'](function(){return db[_0x8df1('0x4a')][_0x8df1('0x24')]({'attributes':['id','name',_0x8df1('0x4b')],'where':{'id':_0x53d3a1[_0x8df1('0x36')][_0x8df1('0x3b')]}});})['then'](function(_0x14dae5){socket[_0x8df1('0x4c')](_0x8df1('0x4d'),{'id':Number(_0x53d3a1[_0x8df1('0x37')]['id']),'tags':_0x14dae5||[]});return{'id':Number(_0x53d3a1[_0x8df1('0x37')]['id']),'tags':_0x14dae5||[]};});}})[_0x8df1('0x1c')](respondWithResult(_0x2eda27,null))[_0x8df1('0x27')](handleError(_0x2eda27,null));};exports[_0x8df1('0x4e')]=function(_0x4eab7e,_0x559ce9){return db['SmsInteraction'][_0x8df1('0x34')]({'where':{'id':_0x4eab7e[_0x8df1('0x37')]['id']}})[_0x8df1('0x1c')](handleEntityNotFound(_0x559ce9,null))[_0x8df1('0x1c')](function(_0x3b6f9b){if(_0x3b6f9b){return _0x3b6f9b[_0x8df1('0x4e')](_0x4eab7e[_0x8df1('0x26')][_0x8df1('0x3b')]);}})['then'](respondWithStatusCode(_0x559ce9,null))['catch'](handleError(_0x559ce9,null));};exports['download']=function(_0x3d0d1c,_0x4ac95a){var _0x259633=moment()[_0x8df1('0x4f')]()[_0x8df1('0x50')]();var _0x18926b=path['join'](config[_0x8df1('0x51')],_0x8df1('0x52'),_0x8df1('0x53'),'tmp');var _0x4e6171=path['join'](_0x18926b,_0x259633);var _0x5bb8e6=util[_0x8df1('0x46')](_0x8df1('0x54'),_0x3d0d1c[_0x8df1('0x37')]['id'],_0x259633);var _0x5ebae3=path['join'](_0x18926b,_0x5bb8e6);var _0x399be3=[];_0x399be3[_0x8df1('0x55')]({'model':db[_0x8df1('0x56')],'as':_0x8df1('0x56'),'attributes':['id',_0x8df1('0x57')],'raw':!![]});_0x399be3[_0x8df1('0x55')]({'model':db['CmContact'],'as':_0x8df1('0x58'),'attributes':['id',_0x8df1('0x59'),'lastName'],'raw':!![]});var _0x54b362=[{'model':db[_0x8df1('0x39')],'as':'Messages','attributes':['id','body',_0x8df1('0x5a'),_0x8df1('0x5b'),_0x8df1('0x5c'),_0x8df1('0x5d')],'include':_0x399be3}];_0x54b362['push']({'model':db[_0x8df1('0x5e')],'as':_0x8df1('0x5f'),'attributes':['id',_0x8df1('0x60')]});_0x54b362[_0x8df1('0x55')]({'model':db[_0x8df1('0x56')],'as':_0x8df1('0x61'),'attributes':['id',_0x8df1('0x57')]});return db[_0x8df1('0x2a')][_0x8df1('0x34')]({'where':{'id':_0x3d0d1c[_0x8df1('0x37')]['id']},'include':_0x54b362})[_0x8df1('0x1c')](handleEntityNotFound(_0x4ac95a,null))['then'](function(_0x5e5f93){if(_0x5e5f93){var _0x4b88c5=_0x5e5f93[_0x8df1('0x62')]({'plain':!![]});fs[_0x8df1('0x63')](_0x4e6171);var _0x3ea16c={'channel':_0x8df1('0x64'),'account':_0x4b88c5[_0x8df1('0x5f')][_0x8df1('0x60')],'agent':_0x4b88c5[_0x8df1('0x61')]?_0x4b88c5[_0x8df1('0x61')]['fullname']:_0x8df1('0x65'),'createdAt':moment(_0x4b88c5[_0x8df1('0x5a')])[_0x8df1('0x46')](_0x8df1('0x47'))[_0x8df1('0x50')](),'closedAt':_0x4b88c5[_0x8df1('0x66')]?moment(_0x4b88c5['closedAt'])[_0x8df1('0x46')](_0x8df1('0x47'))['toString']():'','disposition':_0x4b88c5[_0x8df1('0x67')],'messages':_(_0x4b88c5[_0x8df1('0x68')])[_0x8df1('0x43')]({'secret':![]})['map'](function(_0x1b4784){return{'date':moment(_0x1b4784[_0x8df1('0x5a')])[_0x8df1('0x46')](_0x8df1('0x47'))[_0x8df1('0x50')](),'sender':_0x1b4784[_0x8df1('0x5b')]===_0x8df1('0x69')?_0x1b4784[_0x8df1('0x56')]?_0x1b4784['User'][_0x8df1('0x57')]:_0x8df1('0x6a'):_0x1b4784[_0x8df1('0x58')][_0x8df1('0x59')]+(_0x1b4784[_0x8df1('0x58')][_0x8df1('0x6b')]?'\x20'+_0x1b4784[_0x8df1('0x58')][_0x8df1('0x6b')]:''),'body':_0x1b4784[_0x8df1('0x36')],'direction':_0x1b4784[_0x8df1('0x5b')]===_0x8df1('0x69')?'A':'C','secret':_0x1b4784[_0x8df1('0x5c')],'read':_0x1b4784['read']};})[_0x8df1('0x6c')]()};return ejs[_0x8df1('0x6d')](path['join'](config['root'],_0x8df1('0x52'),_0x8df1('0x6e'),_0x8df1('0x6f')),{'interaction':_0x3ea16c})[_0x8df1('0x1c')](function(_0x1a1cc2){var _0x483be9=path['join'](_0x4e6171,_0x8df1('0x70')+_0x4b88c5['id']+'-'+_0x259633+_0x8df1('0x71'));var _0x2efb9a={'path':_0x483be9,'channel':_0x8df1('0x64'),'interactionId':_0x4b88c5['id']};return pdf['createPdfFromHTML'](_0x1a1cc2,_0x2efb9a);})[_0x8df1('0x1c')](function(){return new BPromise(function(_0x9845f1,_0x37001d){zipdir(_0x4e6171,{'saveTo':_0x5ebae3},function(_0x370c73,_0x5cdf5b){if(_0x370c73)return _0x37001d(_0x370c73);return _0x9845f1(_0x5cdf5b);});})['then'](function(){return new BPromise(function(_0x4360af,_0x287328){rimraf(_0x4e6171,function(_0x59ede5){if(_0x59ede5)_0x287328(_0x59ede5);return _0x4360af();});});})[_0x8df1('0x1c')](function(){return _0x4ac95a[_0x8df1('0x72')](_0x5ebae3,_0x5bb8e6,function(_0x56bcee){if(_0x56bcee){console[_0x8df1('0x73')]('err',_0x56bcee);}else{fs['unlinkSync'](_0x5ebae3);}});});});}else{return _0x4ac95a['sendStatus'](0xc8);}})[_0x8df1('0x27')](handleError(_0x4ac95a,null));};
\ No newline at end of file
index baf0538..a2e4136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xf8e3('0x0'));var SmsInteraction=require(_0xf8e3('0x1'))['db'][_0xf8e3('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xf8e3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf8e3('0x4')](0x0);var events={'afterCreate':_0xf8e3('0x5'),'afterUpdate':'update','afterDestroy':_0xf8e3('0x6')};function emitEvent(_0x41bc05){return function(_0x4dab56,_0x35e88f,_0xb21f8d){_0x4dab56[_0xf8e3('0x7')]({'attributes':['id'],'raw':!![]})[_0xf8e3('0x8')](function(_0x4e9e57){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xa'),_0x4e9e57[_0xf8e3('0xb')](function(_0x95ad03){return{'id':_0x95ad03['id']};}));return SmsMessage[_0xf8e3('0xc')]({'where':{'SmsInteractionId':_0x4dab56['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8e3('0x8')](function(_0x299a7e){_0x4dab56[_0xf8e3('0x9')](_0xf8e3('0xd'),_0x299a7e[_0xf8e3('0xe')]);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05+':'+_0x4dab56['id'],_0x4dab56);SmsInteractionEvents[_0xf8e3('0xf')](_0x41bc05,_0x4dab56);_0xb21f8d(null);})['catch'](_0xb21f8d(null));};}for(var e in events){if(events[_0xf8e3('0x10')](e)){var event=events[e];SmsInteraction[_0xf8e3('0x11')](e,emitEvent(event));}}module[_0xf8e3('0x12')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x7880=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','unreadMessages','length'];(function(_0xc56e9f,_0x449577){var _0x6f9d65=function(_0x5f2ab9){while(--_0x5f2ab9){_0xc56e9f['push'](_0xc56e9f['shift']());}};_0x6f9d65(++_0x449577);}(_0x7880,0x1f4));var _0x0788=function(_0x3a9d05,_0x367e7c){_0x3a9d05=_0x3a9d05-0x0;var _0x3b9c5e=_0x7880[_0x3a9d05];return _0x3b9c5e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x0788('0x0'))['db'][_0x0788('0x1')];var SmsMessage=require(_0x0788('0x0'))['db'][_0x0788('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0788('0x3')](0x0);var events={'afterCreate':_0x0788('0x4'),'afterUpdate':'update','afterDestroy':_0x0788('0x5')};function emitEvent(_0x1e0814){return function(_0x317885,_0xd53e7d,_0x262f5c){_0x317885[_0x0788('0x6')]({'attributes':['id'],'raw':!![]})[_0x0788('0x7')](function(_0x44bbb5){_0x317885[_0x0788('0x8')](_0x0788('0x9'),_0x44bbb5['map'](function(_0x1497dd){return{'id':_0x1497dd['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x317885['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0788('0x7')](function(_0x53b2f2){_0x317885[_0x0788('0x8')](_0x0788('0xa'),_0x53b2f2[_0x0788('0xb')]);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814+':'+_0x317885['id'],_0x317885);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814,_0x317885);_0x262f5c(null);})['catch'](_0x262f5c(null));};}for(var e in events){if(events[_0x0788('0xd')](e)){var event=events[e];SmsInteraction[_0x0788('0xe')](e,emitEvent(event));}}module[_0x0788('0xf')]=SmsInteractionEvents;
\ No newline at end of file
index b2219ac..46e7387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ecc=['SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ecc,0x115));var _0xc7ec=function(_0x29edd8,_0x380bb7){_0x29edd8=_0x29edd8-0x0;var _0x3041ee=_0x7ecc[_0x29edd8];return _0x3041ee;};'use strict';var _=require(_0xc7ec('0x0'));var util=require('util');var logger=require(_0xc7ec('0x1'))(_0xc7ec('0x2'));var moment=require(_0xc7ec('0x3'));var BPromise=require(_0xc7ec('0x4'));var rp=require(_0xc7ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7ec('0x6'));var config=require(_0xc7ec('0x7'));var attributes=require(_0xc7ec('0x8'));module[_0xc7ec('0x9')]=function(_0x46973b,_0xfb5e9b){return _0x46973b[_0xc7ec('0xa')](_0xc7ec('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4db57d,_0x1485c6,_0x478880){if(_0x4db57d[_0xc7ec('0xc')]('closed')){_0x4db57d[_0xc7ec('0xd')]=moment()[_0xc7ec('0xe')](_0xc7ec('0xf'));}_0x478880(null,_0x4db57d);}}});};
\ No newline at end of file
+var _0xd50e=['define','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xd50e,0xb6));var _0xed50=function(_0x5f501a,_0x18d9da){_0x5f501a=_0x5f501a-0x0;var _0x40b79f=_0xd50e[_0x5f501a];return _0x40b79f;};'use strict';var _=require(_0xed50('0x0'));var util=require(_0xed50('0x1'));var logger=require(_0xed50('0x2'))(_0xed50('0x3'));var moment=require(_0xed50('0x4'));var BPromise=require(_0xed50('0x5'));var rp=require(_0xed50('0x6'));var fs=require('fs');var path=require(_0xed50('0x7'));var rimraf=require(_0xed50('0x8'));var config=require('../../config/environment');var attributes=require(_0xed50('0x9'));module['exports']=function(_0x468195,_0x5d2e21){return _0x468195[_0xed50('0xa')](_0xed50('0xb'),attributes,{'tableName':_0xed50('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd6df92,_0x11e9c4,_0x57a36b){if(_0xd6df92[_0xed50('0xd')](_0xed50('0xe'))){_0xd6df92[_0xed50('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x57a36b(null,_0xd6df92);}}});};
\ No newline at end of file
index 7876295..f2d2296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf620=['ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','raw','options','attributes','limit','AddTagsToSmsInteraction','find','where','addTags','body'];(function(_0x4de370,_0x5718bd){var _0x3e272c=function(_0x2b45c8){while(--_0x2b45c8){_0x4de370['push'](_0x4de370['shift']());}};_0x3e272c(++_0x5718bd);}(_0xf620,0x1d8));var _0x0f62=function(_0x26dbfc,_0x1c051c){_0x26dbfc=_0x26dbfc-0x0;var _0x35881d=_0xf620[_0x26dbfc];return _0x35881d;};'use strict';var _=require(_0x0f62('0x0'));var util=require('util');var moment=require(_0x0f62('0x1'));var BPromise=require(_0x0f62('0x2'));var rs=require(_0x0f62('0x3'));var fs=require('fs');var Redis=require(_0x0f62('0x4'));var db=require(_0x0f62('0x5'))['db'];var utils=require(_0x0f62('0x6'));var logger=require(_0x0f62('0x7'))('rpc');var config=require(_0x0f62('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f62('0x9')]({'port':0x232a});config[_0x0f62('0xa')]=_['defaults'](config[_0x0f62('0xa')],{'host':_0x0f62('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f62('0xa')]));require('./smsInteraction.socket')[_0x0f62('0xc')](socket);function respondWithRpcPromise(_0x10cac5,_0x328f11,_0x2d55f6){return new BPromise(function(_0x9569ea,_0x405d4f){return client['request'](_0x10cac5,_0x2d55f6)[_0x0f62('0xd')](function(_0x237a98){logger[_0x0f62('0xe')](_0x0f62('0xf'),_0x328f11,_0x0f62('0x10'));logger[_0x0f62('0x11')](_0x0f62('0x12'),_0x328f11,_0x0f62('0x10'),JSON[_0x0f62('0x13')](_0x237a98));if(_0x237a98['error']){if(_0x237a98[_0x0f62('0x14')]['code']===0x1f4){logger[_0x0f62('0x14')](_0x0f62('0xf'),_0x328f11,_0x237a98[_0x0f62('0x14')][_0x0f62('0x15')]);return _0x405d4f(_0x237a98[_0x0f62('0x14')]['message']);}logger[_0x0f62('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x328f11,_0x237a98[_0x0f62('0x14')][_0x0f62('0x15')]);return _0x9569ea(_0x237a98['error'][_0x0f62('0x15')]);}else{logger[_0x0f62('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x328f11,_0x0f62('0x10'));_0x9569ea(_0x237a98['result'][_0x0f62('0x15')]);}})[_0x0f62('0x16')](function(_0x59d729){logger[_0x0f62('0x14')](_0x0f62('0xf'),_0x328f11,_0x59d729);_0x405d4f(_0x59d729);});});}exports[_0x0f62('0x17')]=function(_0x5ac693){var _0x1284d4=this;return new Promise(function(_0x2d3451,_0x265ff4){return db[_0x0f62('0x18')][_0x0f62('0x19')](_0x5ac693['body'],{'raw':_0x5ac693['options']?_0x5ac693['options'][_0x0f62('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac693[_0x0f62('0x1b')]?_0x5ac693['options']['where']||null:null,'attributes':_0x5ac693[_0x0f62('0x1b')]?_0x5ac693[_0x0f62('0x1b')][_0x0f62('0x1c')]||null:null,'limit':_0x5ac693[_0x0f62('0x1b')]?_0x5ac693[_0x0f62('0x1b')][_0x0f62('0x1d')]||null:null})[_0x0f62('0xd')](function(_0x206d00){logger[_0x0f62('0xe')]('UpdateSmsInteraction',_0x5ac693);logger[_0x0f62('0x11')](_0x0f62('0x17'),_0x5ac693,JSON[_0x0f62('0x13')](_0x206d00));_0x2d3451(_0x206d00);})[_0x0f62('0x16')](function(_0x505a76){logger[_0x0f62('0x14')]('UpdateSmsInteraction',_0x505a76[_0x0f62('0x15')],_0x5ac693);_0x265ff4(_0x1284d4['error'](0x1f4,_0x505a76[_0x0f62('0x15')]));});});};exports[_0x0f62('0x1e')]=function(_0x28c8a6){return new Promise(function(_0x4db585,_0x5ec1f4){return db[_0x0f62('0x18')][_0x0f62('0x1f')]({'where':_0x28c8a6[_0x0f62('0x1b')]?_0x28c8a6['options'][_0x0f62('0x20')]||null:null})[_0x0f62('0xd')](function(_0x5a6765){if(_0x5a6765){return _0x5a6765[_0x0f62('0x21')](_0x28c8a6[_0x0f62('0x22')][_0x0f62('0x23')],_[_0x0f62('0x24')](_0x28c8a6[_0x0f62('0x22')],[_0x0f62('0x23'),'id'])||{});}})[_0x0f62('0x25')](function(_0x38bb85){logger[_0x0f62('0xe')]('AddTags',_0x28c8a6);logger[_0x0f62('0x11')]('AddTags',_0x28c8a6,JSON[_0x0f62('0x13')](_0x38bb85));_0x4db585(_0x38bb85);})[_0x0f62('0x16')](function(_0x2f31d2){logger[_0x0f62('0x14')](_0x0f62('0x26'),_0x2f31d2[_0x0f62('0x15')],_0x28c8a6);_0x5ec1f4(_this[_0x0f62('0x14')](0x1f4,_0x2f31d2[_0x0f62('0x15')]));});});};
\ No newline at end of file
+var _0xe03b=['util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','SmsInteraction','body','options','raw','where','attributes','limit','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x48d259,_0x4b1395){var _0x1e97c9=function(_0x439d54){while(--_0x439d54){_0x48d259['push'](_0x48d259['shift']());}};_0x1e97c9(++_0x4b1395);}(_0xe03b,0x1d4));var _0xbe03=function(_0x48fbc5,_0x23d140){_0x48fbc5=_0x48fbc5-0x0;var _0x1c2687=_0xe03b[_0x48fbc5];return _0x1c2687;};'use strict';var _=require('lodash');var util=require(_0xbe03('0x0'));var moment=require(_0xbe03('0x1'));var BPromise=require(_0xbe03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe03('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe03('0x4'))(_0xbe03('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe03('0x6'));var client=jayson[_0xbe03('0x7')][_0xbe03('0x8')]({'port':0x232a});config[_0xbe03('0x9')]=_[_0xbe03('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbe03('0xb'))(new Redis(config[_0xbe03('0x9')]));require('./smsInteraction.socket')[_0xbe03('0xc')](socket);function respondWithRpcPromise(_0x326599,_0x359f2d,_0x34428d){return new BPromise(function(_0x5cb649,_0x405cc1){return client['request'](_0x326599,_0x34428d)['then'](function(_0x5c9917){logger[_0xbe03('0xd')](_0xbe03('0xe'),_0x359f2d,_0xbe03('0xf'));logger[_0xbe03('0x10')](_0xbe03('0x11'),_0x359f2d,_0xbe03('0xf'),JSON[_0xbe03('0x12')](_0x5c9917));if(_0x5c9917['error']){if(_0x5c9917['error'][_0xbe03('0x13')]===0x1f4){logger[_0xbe03('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x359f2d,_0x5c9917[_0xbe03('0x14')][_0xbe03('0x15')]);return _0x405cc1(_0x5c9917[_0xbe03('0x14')][_0xbe03('0x15')]);}logger[_0xbe03('0x14')](_0xbe03('0xe'),_0x359f2d,_0x5c9917[_0xbe03('0x14')][_0xbe03('0x15')]);return _0x5cb649(_0x5c9917[_0xbe03('0x14')][_0xbe03('0x15')]);}else{logger['info'](_0xbe03('0xe'),_0x359f2d,'request\x20sent');_0x5cb649(_0x5c9917[_0xbe03('0x16')][_0xbe03('0x15')]);}})['catch'](function(_0x7f746c){logger[_0xbe03('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x359f2d,_0x7f746c);_0x405cc1(_0x7f746c);});});}exports['UpdateSmsInteraction']=function(_0x2d170f){var _0x1f2fe8=this;return new Promise(function(_0x54c161,_0x467026){return db[_0xbe03('0x17')]['update'](_0x2d170f[_0xbe03('0x18')],{'raw':_0x2d170f['options']?_0x2d170f[_0xbe03('0x19')][_0xbe03('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d170f[_0xbe03('0x19')]?_0x2d170f[_0xbe03('0x19')][_0xbe03('0x1b')]||null:null,'attributes':_0x2d170f['options']?_0x2d170f['options'][_0xbe03('0x1c')]||null:null,'limit':_0x2d170f['options']?_0x2d170f[_0xbe03('0x19')][_0xbe03('0x1d')]||null:null})['then'](function(_0x5e8b8f){logger[_0xbe03('0xd')]('UpdateSmsInteraction',_0x2d170f);logger['debug'](_0xbe03('0x1e'),_0x2d170f,JSON['stringify'](_0x5e8b8f));_0x54c161(_0x5e8b8f);})[_0xbe03('0x1f')](function(_0x2cad69){logger['error']('UpdateSmsInteraction',_0x2cad69['message'],_0x2d170f);_0x467026(_0x1f2fe8[_0xbe03('0x14')](0x1f4,_0x2cad69['message']));});});};exports[_0xbe03('0x20')]=function(_0x5d97c0){return new Promise(function(_0x899143,_0x5766f2){return db[_0xbe03('0x17')][_0xbe03('0x21')]({'where':_0x5d97c0[_0xbe03('0x19')]?_0x5d97c0['options'][_0xbe03('0x1b')]||null:null})['then'](function(_0x1c6a92){if(_0x1c6a92){return _0x1c6a92[_0xbe03('0x22')](_0x5d97c0[_0xbe03('0x18')][_0xbe03('0x23')],_[_0xbe03('0x24')](_0x5d97c0[_0xbe03('0x18')],[_0xbe03('0x23'),'id'])||{});}})[_0xbe03('0x25')](function(_0x16cb38){logger[_0xbe03('0xd')]('AddTags',_0x5d97c0);logger[_0xbe03('0x10')](_0xbe03('0x26'),_0x5d97c0,JSON[_0xbe03('0x12')](_0x16cb38));_0x899143(_0x16cb38);})[_0xbe03('0x1f')](function(_0xa8c53){logger[_0xbe03('0x14')](_0xbe03('0x26'),_0xa8c53[_0xbe03('0x15')],_0x5d97c0);_0x5766f2(_this['error'](0x1f4,_0xa8c53[_0xbe03('0x15')]));});});};
\ No newline at end of file
index a011e0c..5e768d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5640=['register','length','./smsInteraction.events','remove','update','emit','removeListener'];(function(_0x417a6d,_0x486312){var _0x1e6faf=function(_0x51c21d){while(--_0x51c21d){_0x417a6d['push'](_0x417a6d['shift']());}};_0x1e6faf(++_0x486312);}(_0x5640,0x16e));var _0x0564=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5640[_0x17d9e3];return _0x14192d;};'use strict';var SmsInteractionEvents=require(_0x0564('0x0'));var events=['save',_0x0564('0x1'),_0x0564('0x2')];function createListener(_0x21b19b,_0x4fb114){return function(_0x46fb51){_0x4fb114[_0x0564('0x3')](_0x21b19b,_0x46fb51);};}function removeListener(_0x4d6f91,_0x88e531){return function(){SmsInteractionEvents[_0x0564('0x4')](_0x4d6f91,_0x88e531);};}exports[_0x0564('0x5')]=function(_0x2d2d9b){for(var _0x54b9ad=0x0,_0x18950d=events[_0x0564('0x6')];_0x54b9ad<_0x18950d;_0x54b9ad++){var _0x42a78a=events[_0x54b9ad];var _0x2de1b4=createListener('smsInteraction:'+_0x42a78a,_0x2d2d9b);SmsInteractionEvents['on'](_0x42a78a,_0x2de1b4);}};
\ No newline at end of file
+var _0xf2a0=['remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf2a0,0x1e3));var _0x0f2a=function(_0x17fed0,_0x281f6f){_0x17fed0=_0x17fed0-0x0;var _0x49fb26=_0xf2a0[_0x17fed0];return _0x49fb26;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0x0f2a('0x0'),_0x0f2a('0x1')];function createListener(_0x41a669,_0x5e2678){return function(_0x36bf79){_0x5e2678[_0x0f2a('0x2')](_0x41a669,_0x36bf79);};}function removeListener(_0x46831b,_0x33c9de){return function(){SmsInteractionEvents[_0x0f2a('0x3')](_0x46831b,_0x33c9de);};}exports[_0x0f2a('0x4')]=function(_0xaef85a){for(var _0x2ba599=0x0,_0x58e44d=events[_0x0f2a('0x5')];_0x2ba599<_0x58e44d;_0x2ba599++){var _0x4110a8=events[_0x2ba599];var _0x410e1d=createListener(_0x0f2a('0x6')+_0x4110a8,_0xaef85a);SmsInteractionEvents['on'](_0x4110a8,_0x410e1d);}};
\ No newline at end of file
index d1fb0d1..943487e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a7c=['status','update','put','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','show','post','tracked','smsmessage:create','create','/:id/status'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x6a7c,0x166));var _0xc6a7=function(_0x1206dd,_0x28cc95){_0x1206dd=_0x1206dd-0x0;var _0x583f70=_0x6a7c[_0x1206dd];return _0x583f70;};'use strict';var multer=require(_0xc6a7('0x0'));var util=require(_0xc6a7('0x1'));var path=require(_0xc6a7('0x2'));var timeout=require(_0xc6a7('0x3'));var express=require(_0xc6a7('0x4'));var router=express['Router']();var fs_extra=require(_0xc6a7('0x5'));var auth=require(_0xc6a7('0x6'));var interaction=require(_0xc6a7('0x7'));var config=require(_0xc6a7('0x8'));var controller=require(_0xc6a7('0x9'));router[_0xc6a7('0xa')]('/',auth[_0xc6a7('0xb')](),controller['index']);router[_0xc6a7('0xa')](_0xc6a7('0xc'),auth[_0xc6a7('0xb')](),controller['describe']);router[_0xc6a7('0xa')]('/:id',auth[_0xc6a7('0xb')](),controller[_0xc6a7('0xd')]);router[_0xc6a7('0xe')]('/',auth[_0xc6a7('0xb')](),interaction[_0xc6a7('0xf')]('sms',_0xc6a7('0x10')),controller[_0xc6a7('0x11')]);router[_0xc6a7('0xe')](_0xc6a7('0x12'),controller[_0xc6a7('0x13')]);router['put']('/:id',auth[_0xc6a7('0xb')](),controller[_0xc6a7('0x14')]);router[_0xc6a7('0x15')]('/:id/accept',auth[_0xc6a7('0xb')](),controller[_0xc6a7('0x16')]);router[_0xc6a7('0x15')](_0xc6a7('0x17'),auth[_0xc6a7('0xb')](),controller[_0xc6a7('0x18')]);router[_0xc6a7('0x19')](_0xc6a7('0x1a'),auth['isAuthenticated'](),controller[_0xc6a7('0x1b')]);module[_0xc6a7('0x1c')]=router;
\ No newline at end of file
+var _0xbeb5=['smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','./smsMessage.controller','get','isAuthenticated','/describe','/:id','post','sms'];(function(_0xf409ae,_0x48de49){var _0x2bb672=function(_0x81c8bc){while(--_0x81c8bc){_0xf409ae['push'](_0xf409ae['shift']());}};_0x2bb672(++_0x48de49);}(_0xbeb5,0x14c));var _0x5beb=function(_0x1bfbc8,_0x55e183){_0x1bfbc8=_0x1bfbc8-0x0;var _0x5d9728=_0xbeb5[_0x1bfbc8];return _0x5d9728;};'use strict';var multer=require('multer');var util=require(_0x5beb('0x0'));var path=require(_0x5beb('0x1'));var timeout=require(_0x5beb('0x2'));var express=require(_0x5beb('0x3'));var router=express[_0x5beb('0x4')]();var fs_extra=require(_0x5beb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5beb('0x6'));router[_0x5beb('0x7')]('/',auth[_0x5beb('0x8')](),controller['index']);router[_0x5beb('0x7')](_0x5beb('0x9'),auth[_0x5beb('0x8')](),controller['describe']);router[_0x5beb('0x7')](_0x5beb('0xa'),auth[_0x5beb('0x8')](),controller['show']);router[_0x5beb('0xb')]('/',auth[_0x5beb('0x8')](),interaction['tracked'](_0x5beb('0xc'),_0x5beb('0xd')),controller[_0x5beb('0xe')]);router[_0x5beb('0xb')]('/:id/status',controller[_0x5beb('0xf')]);router[_0x5beb('0x10')](_0x5beb('0xa'),auth[_0x5beb('0x8')](),controller[_0x5beb('0x11')]);router[_0x5beb('0x10')](_0x5beb('0x12'),auth[_0x5beb('0x8')](),controller[_0x5beb('0x13')]);router['put'](_0x5beb('0x14'),auth[_0x5beb('0x8')](),controller['reject']);router[_0x5beb('0x15')](_0x5beb('0xa'),auth[_0x5beb('0x8')](),controller['destroy']);module[_0x5beb('0x16')]=router;
\ No newline at end of file
index a7073c3..c57add3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0185=['out','STRING','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5129c5,_0x1c89ec){var _0x2af125=function(_0x28186d){while(--_0x28186d){_0x5129c5['push'](_0x5129c5['shift']());}};_0x2af125(++_0x1c89ec);}(_0x0185,0x1ac));var _0x5018=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x0185[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5018('0x0')](_0x5018('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5018('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5018('0x3')]('in','out'),'defaultValue':_0x5018('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x5018('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5018('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7521=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0xc8810b,_0x5af925){var _0x4e8ad2=function(_0x4c5f48){while(--_0x4c5f48){_0xc8810b['push'](_0xc8810b['shift']());}};_0x4e8ad2(++_0x5af925);}(_0x7521,0x8c));var _0x1752=function(_0x1636b5,_0x402637){_0x1636b5=_0x1636b5-0x0;var _0x2f23ef=_0x7521[_0x1636b5];return _0x2f23ef;};'use strict';var Sequelize=require(_0x1752('0x0'));module[_0x1752('0x1')]={'body':{'type':Sequelize[_0x1752('0x2')](_0x1752('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1752('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1752('0x5')]('in',_0x1752('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1752('0x7')](0xbe)},'phone':{'type':Sequelize[_0x1752('0x7')]},'readAt':{'type':Sequelize[_0x1752('0x8')]},'secret':{'type':Sequelize[_0x1752('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1752('0x2')]}};
\ No newline at end of file
index a5ec062..879544d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd5=['./smsMessage.socket','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','accept','sms','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','motionChannel','event','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','plivo','MessageUUID','indexOf','Status','plivio','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0x1107ac,_0x45de13){var _0xe10cd=function(_0x5844a8){while(--_0x5844a8){_0x1107ac['push'](_0x1107ac['shift']());}};_0xe10cd(++_0x45de13);}(_0xdcd5,0x110));var _0x5dcd=function(_0x3f8743,_0x33973f){_0x3f8743=_0x3f8743-0x0;var _0x1f844c=_0xdcd5[_0x3f8743];return _0x1f844c;};'use strict';var emlformat=require(_0x5dcd('0x0'));var rimraf=require(_0x5dcd('0x1'));var zipdir=require(_0x5dcd('0x2'));var jsonpatch=require(_0x5dcd('0x3'));var rp=require(_0x5dcd('0x4'));var moment=require(_0x5dcd('0x5'));var BPromise=require(_0x5dcd('0x6'));var Mustache=require('mustache');var util=require(_0x5dcd('0x7'));var path=require(_0x5dcd('0x8'));var sox=require(_0x5dcd('0x9'));var csv=require(_0x5dcd('0xa'));var ejs=require(_0x5dcd('0xb'));var fs=require('fs');var fs_extra=require(_0x5dcd('0xc'));var _=require(_0x5dcd('0xd'));var squel=require(_0x5dcd('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5dcd('0xf'));var toCsv=require(_0x5dcd('0xa'));var querystring=require(_0x5dcd('0x10'));var Papa=require('papaparse');var Redis=require(_0x5dcd('0x11'));var authService=require(_0x5dcd('0x12'));var qs=require(_0x5dcd('0x13'));var as=require(_0x5dcd('0x14'));var hardwareService=require(_0x5dcd('0x15'));var logger=require(_0x5dcd('0x16'))(_0x5dcd('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dcd('0x18'));var db=require(_0x5dcd('0x19'))['db'];config['redis']=_[_0x5dcd('0x1a')](config[_0x5dcd('0x1b')],{'host':_0x5dcd('0x1c'),'port':0x18eb});var socket=require(_0x5dcd('0x1d'))(new Redis(config[_0x5dcd('0x1b')]));require(_0x5dcd('0x1e'))[_0x5dcd('0x1f')](socket);var jayson=require(_0x5dcd('0x20'));var client=jayson['client'][_0x5dcd('0x21')]({'port':0x232c});var client9002=jayson[_0x5dcd('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43b71f,_0x537aed,_0x3a9ab9,_0x67a19e){return new BPromise(function(_0x1fd337,_0x4849de){var _0x1a4643=_0x67a19e||client;return _0x1a4643[_0x5dcd('0x23')](_0x43b71f,_0x3a9ab9)[_0x5dcd('0x24')](function(_0x5074b2){logger[_0x5dcd('0x25')](_0x5dcd('0x26'),_0x537aed,_0x5dcd('0x27'));logger['debug'](_0x5dcd('0x28'),_0x537aed,_0x5dcd('0x27'),JSON[_0x5dcd('0x29')](_0x5074b2));if(_0x5074b2[_0x5dcd('0x2a')]){if(_0x5074b2['error'][_0x5dcd('0x2b')]===0x1f4){logger[_0x5dcd('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x537aed,_0x5074b2['error'][_0x5dcd('0x2c')]);return _0x4849de(_0x5074b2[_0x5dcd('0x2a')][_0x5dcd('0x2c')]);}logger[_0x5dcd('0x2a')](_0x5dcd('0x26'),_0x537aed,_0x5074b2[_0x5dcd('0x2a')][_0x5dcd('0x2c')]);return _0x1fd337(_0x5074b2[_0x5dcd('0x2a')][_0x5dcd('0x2c')]);}else{logger[_0x5dcd('0x25')]('SmsMessage,\x20%s,\x20%s',_0x537aed,_0x5dcd('0x27'));_0x1fd337(_0x5074b2[_0x5dcd('0x2d')][_0x5dcd('0x2c')]);}})['catch'](function(_0x30fe1f){logger[_0x5dcd('0x2a')](_0x5dcd('0x26'),_0x537aed,_0x30fe1f);_0x4849de(_0x30fe1f);});});}function respondWithStatusCode(_0x11daa8,_0x3b2b2b){_0x3b2b2b=_0x3b2b2b||0xcc;return function(_0x5337a3){if(_0x5337a3){return _0x11daa8[_0x5dcd('0x2e')](_0x3b2b2b);}return _0x11daa8[_0x5dcd('0x2f')](_0x3b2b2b)[_0x5dcd('0x30')]();};}function respondWithResult(_0x147edf,_0x379f3c){_0x379f3c=_0x379f3c||0xc8;return function(_0x5df986){if(_0x5df986){return _0x147edf[_0x5dcd('0x2f')](_0x379f3c)[_0x5dcd('0x31')](_0x5df986);}};}function respondWithFilteredResult(_0x440e47,_0x28e53f){return function(_0x1a87a5){if(_0x1a87a5){var _0x1ba4cf=typeof _0x28e53f[_0x5dcd('0x32')]===_0x5dcd('0x33')&&typeof _0x28e53f[_0x5dcd('0x34')]===_0x5dcd('0x33');var _0x4df421=_0x1a87a5[_0x5dcd('0x35')];var _0x510e49=_0x1ba4cf?0x0:_0x28e53f['offset'];var _0x376ec6=_0x1ba4cf?_0x1a87a5[_0x5dcd('0x35')]:_0x28e53f['offset']+_0x28e53f[_0x5dcd('0x34')];var _0x402db5;if(_0x376ec6>=_0x4df421){_0x376ec6=_0x4df421;_0x402db5=0xc8;}else{_0x402db5=0xce;}_0x440e47['status'](_0x402db5);return _0x440e47[_0x5dcd('0x36')](_0x5dcd('0x37'),_0x510e49+'-'+_0x376ec6+'/'+_0x4df421)[_0x5dcd('0x31')](_0x1a87a5);}return null;};}function patchUpdates(_0x1e9738){return function(_0x5688db){try{jsonpatch['apply'](_0x5688db,_0x1e9738,!![]);}catch(_0x1d848a){return BPromise[_0x5dcd('0x38')](_0x1d848a);}return _0x5688db['save']();};}function saveUpdates(_0x4b3cd1,_0x16cedf){return function(_0x4d299e){if(_0x4d299e){return _0x4d299e[_0x5dcd('0x39')](_0x4b3cd1)['then'](function(_0x593594){return _0x593594;});}return null;};}function removeEntity(_0x389f43,_0x3a9dd4){return function(_0x25fc0f){if(_0x25fc0f){return _0x25fc0f[_0x5dcd('0x3a')]()[_0x5dcd('0x24')](function(){_0x389f43[_0x5dcd('0x2f')](0xcc)[_0x5dcd('0x30')]();});}};}function handleEntityNotFound(_0x164067,_0x207fe4){return function(_0x46c543){if(!_0x46c543){_0x164067[_0x5dcd('0x2e')](0x194);}return _0x46c543;};}function handleError(_0x167274,_0x95575c){_0x95575c=_0x95575c||0x1f4;return function(_0x2d11fb){logger[_0x5dcd('0x2a')](_0x2d11fb[_0x5dcd('0x3b')]);if(_0x2d11fb[_0x5dcd('0x3c')]){delete _0x2d11fb[_0x5dcd('0x3c')];}_0x167274[_0x5dcd('0x2f')](_0x95575c)['send'](_0x2d11fb);};}exports[_0x5dcd('0x3d')]=function(_0x154a83,_0x483aeb){var _0x99d57f={},_0x205a33={},_0x22df16={'count':0x0,'rows':[]};var _0x3987fa=_[_0x5dcd('0x3e')](db[_0x5dcd('0x3f')][_0x5dcd('0x40')],function(_0x53df30){return{'name':_0x53df30[_0x5dcd('0x41')],'type':_0x53df30[_0x5dcd('0x42')][_0x5dcd('0x43')]};});_0x205a33[_0x5dcd('0x44')]=_[_0x5dcd('0x3e')](_0x3987fa,_0x5dcd('0x3c'));_0x205a33['query']=_['keys'](_0x154a83['query']);_0x205a33[_0x5dcd('0x45')]=_['intersection'](_0x205a33['model'],_0x205a33['query']);_0x99d57f['attributes']=_[_0x5dcd('0x46')](_0x205a33[_0x5dcd('0x44')],qs[_0x5dcd('0x47')](_0x154a83['query'][_0x5dcd('0x47')]));_0x99d57f[_0x5dcd('0x48')]=_0x99d57f[_0x5dcd('0x48')][_0x5dcd('0x49')]?_0x99d57f[_0x5dcd('0x48')]:_0x205a33[_0x5dcd('0x44')];if(!_0x154a83[_0x5dcd('0x4a')][_0x5dcd('0x4b')](_0x5dcd('0x4c'))){_0x99d57f[_0x5dcd('0x34')]=qs[_0x5dcd('0x34')](_0x154a83[_0x5dcd('0x4a')][_0x5dcd('0x34')]);_0x99d57f[_0x5dcd('0x32')]=qs['offset'](_0x154a83['query'][_0x5dcd('0x32')]);}_0x99d57f[_0x5dcd('0x4d')]=qs[_0x5dcd('0x4e')](_0x154a83[_0x5dcd('0x4a')][_0x5dcd('0x4e')]);_0x99d57f[_0x5dcd('0x4f')]=qs[_0x5dcd('0x45')](_['pick'](_0x154a83[_0x5dcd('0x4a')],_0x205a33[_0x5dcd('0x45')]),_0x3987fa);if(_0x154a83[_0x5dcd('0x4a')][_0x5dcd('0x50')]){_0x99d57f[_0x5dcd('0x4f')]=_[_0x5dcd('0x51')](_0x99d57f[_0x5dcd('0x4f')],{'$or':_[_0x5dcd('0x3e')](_0x3987fa,function(_0xafe56a){if(_0xafe56a[_0x5dcd('0x42')]!==_0x5dcd('0x52')){var _0x2251ac={};_0x2251ac[_0xafe56a[_0x5dcd('0x3c')]]={'$like':'%'+_0x154a83[_0x5dcd('0x4a')]['filter']+'%'};return _0x2251ac;}})});}_0x99d57f=_[_0x5dcd('0x51')]({},_0x99d57f,_0x154a83[_0x5dcd('0x53')]);var _0x537079={'where':_0x99d57f[_0x5dcd('0x4f')]};return db[_0x5dcd('0x3f')]['count'](_0x537079)['then'](function(_0x2b58b7){_0x22df16[_0x5dcd('0x35')]=_0x2b58b7;if(_0x154a83[_0x5dcd('0x4a')][_0x5dcd('0x54')]){_0x99d57f[_0x5dcd('0x55')]=[{'all':!![]}];}return db[_0x5dcd('0x3f')][_0x5dcd('0x56')](_0x99d57f);})['then'](function(_0x27d540){_0x22df16[_0x5dcd('0x57')]=_0x27d540;return _0x22df16;})[_0x5dcd('0x24')](respondWithFilteredResult(_0x483aeb,_0x99d57f))[_0x5dcd('0x58')](handleError(_0x483aeb,null));};exports[_0x5dcd('0x59')]=function(_0x2b1ebd,_0x2f1cf1){var _0x5122ac={'raw':!![],'where':{'id':_0x2b1ebd[_0x5dcd('0x5a')]['id']}},_0x23544f={};_0x23544f[_0x5dcd('0x44')]=_[_0x5dcd('0x5b')](db['SmsMessage'][_0x5dcd('0x40')]);_0x23544f[_0x5dcd('0x4a')]=_[_0x5dcd('0x5b')](_0x2b1ebd[_0x5dcd('0x4a')]);_0x23544f['filters']=_[_0x5dcd('0x46')](_0x23544f[_0x5dcd('0x44')],_0x23544f[_0x5dcd('0x4a')]);_0x5122ac[_0x5dcd('0x48')]=_[_0x5dcd('0x46')](_0x23544f[_0x5dcd('0x44')],qs[_0x5dcd('0x47')](_0x2b1ebd[_0x5dcd('0x4a')][_0x5dcd('0x47')]));_0x5122ac['attributes']=_0x5122ac[_0x5dcd('0x48')][_0x5dcd('0x49')]?_0x5122ac[_0x5dcd('0x48')]:_0x23544f['model'];if(_0x2b1ebd['query']['includeAll']){_0x5122ac['include']=[{'all':!![]}];}_0x5122ac=_['merge']({},_0x5122ac,_0x2b1ebd[_0x5dcd('0x53')]);return db[_0x5dcd('0x3f')]['find'](_0x5122ac)['then'](handleEntityNotFound(_0x2f1cf1,null))[_0x5dcd('0x24')](respondWithResult(_0x2f1cf1,null))[_0x5dcd('0x58')](handleError(_0x2f1cf1,null));};exports[_0x5dcd('0x5c')]=function(_0x462382,_0x481bab){return db[_0x5dcd('0x3f')][_0x5dcd('0x5c')](_0x462382['body'],{})['then'](respondWithResult(_0x481bab,0xc9))[_0x5dcd('0x58')](handleError(_0x481bab,null));};exports[_0x5dcd('0x39')]=function(_0x51f494,_0x1bb2e9){if(_0x51f494[_0x5dcd('0x5d')]['id']){delete _0x51f494[_0x5dcd('0x5d')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x51f494[_0x5dcd('0x5a')]['id']}})[_0x5dcd('0x24')](handleEntityNotFound(_0x1bb2e9,null))[_0x5dcd('0x24')](saveUpdates(_0x51f494[_0x5dcd('0x5d')],null))[_0x5dcd('0x24')](respondWithResult(_0x1bb2e9,null))[_0x5dcd('0x58')](handleError(_0x1bb2e9,null));};exports[_0x5dcd('0x3a')]=function(_0xfe7aca,_0x8fd050){return db[_0x5dcd('0x3f')][_0x5dcd('0x5e')]({'where':{'id':_0xfe7aca[_0x5dcd('0x5a')]['id']}})[_0x5dcd('0x24')](handleEntityNotFound(_0x8fd050,null))['then'](removeEntity(_0x8fd050,null))[_0x5dcd('0x58')](handleError(_0x8fd050,null));};exports['describe']=function(_0x1be605,_0x574a6c){return db['SmsMessage'][_0x5dcd('0x5f')]()['then'](respondWithResult(_0x574a6c,null))[_0x5dcd('0x58')](handleError(_0x574a6c,null));};var interaction_log=require(_0x5dcd('0x16'))('sms-interactions');exports[_0x5dcd('0x60')]=function(_0x26e499,_0x5f4d29,_0x4db5dd){var _0x2ffebe={'agent':{},'channel':_0x5dcd('0x61')};if(_0x26e499['body']['id']){delete _0x26e499[_0x5dcd('0x5d')]['id'];}_0x26e499[_0x5dcd('0x5d')]['read']=!![];_0x26e499[_0x5dcd('0x5d')]['readAt']=moment()[_0x5dcd('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x26e499['body'][_0x5dcd('0x63')]=_0x26e499['body'][_0x5dcd('0x63')]||_0x26e499[_0x5dcd('0x64')]['id'];_0x2ffebe[_0x5dcd('0x65')]['id']=_0x26e499[_0x5dcd('0x5d')]['UserId'];return db[_0x5dcd('0x3f')][_0x5dcd('0x5e')]({'where':{'id':_0x26e499['params']['id'],'UserId':null}})[_0x5dcd('0x24')](handleEntityNotFound(_0x5f4d29,null))[_0x5dcd('0x24')](saveUpdates(_0x26e499['body'],null))[_0x5dcd('0x24')](function(_0x29b0f9){if(_0x29b0f9){_0x2ffebe[_0x5dcd('0x2c')]=_0x29b0f9[_0x5dcd('0x66')]({'plain':!![]});return db[_0x5dcd('0x67')][_0x5dcd('0x5e')]({'where':{'id':_0x29b0f9[_0x5dcd('0x68')]}});}return null;})[_0x5dcd('0x24')](handleEntityNotFound(_0x5f4d29,null))[_0x5dcd('0x24')](function(_0x5e01de){if(_0x5e01de){return _0x5e01de[_0x5dcd('0x39')]({'UserId':_0x26e499[_0x5dcd('0x5d')][_0x5dcd('0x63')],'read1stAt':_['isNil'](_0x5e01de[_0x5dcd('0x69')])?moment()[_0x5dcd('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5dcd('0x24')](function(_0x22cb9b){if(_0x22cb9b){_0x2ffebe[_0x5dcd('0x6a')]=_0x22cb9b['get']({'plain':!![]});interaction_log[_0x5dcd('0x25')](_0x5dcd('0x6b'),_0x26e499[_0x5dcd('0x64')]['id'],_0x26e499[_0x5dcd('0x64')][_0x5dcd('0x3c')],_0x26e499[_0x5dcd('0x64')][_0x5dcd('0x6c')],_0x2ffebe[_0x5dcd('0x6a')]['id'],_0x26e499[_0x5dcd('0x5d')]?JSON[_0x5dcd('0x29')](_0x26e499[_0x5dcd('0x5d')]):_0x5dcd('0x6d'));return respondWithRpcPromise(_0x5dcd('0x6e'),_0x5dcd('0x6f'),_0x2ffebe);}return null;})[_0x5dcd('0x24')](function(_0x25b994){var _0x28c6ac=_0x5dcd('0x70')+_0x25b994[_0x5dcd('0x2c')][_0x5dcd('0x71')];return db[_0x5dcd('0x72')]['query'](_0x28c6ac,{'type':db[_0x5dcd('0x73')][_0x5dcd('0x74')][_0x5dcd('0x75')],'raw':!![]})[_0x5dcd('0x24')](function(_0x386d76){return _0x386d76;});})[_0x5dcd('0x24')](function(_0x13a097){if(_0x13a097){_0x2ffebe[_0x5dcd('0x2c')][_0x5dcd('0x76')]=_0x13a097[0x0];if(!_0x26e499[_0x5dcd('0x5d')][_0x5dcd('0x63')])return;return db[_0x5dcd('0x77')][_0x5dcd('0x5e')]({'where':{'id':_0x26e499[_0x5dcd('0x5d')][_0x5dcd('0x63')],'role':_0x5dcd('0x65')},'attributes':['id',_0x5dcd('0x3c'),_0x5dcd('0x78'),_0x5dcd('0x79'),_0x5dcd('0x7a')],'raw':!![]});}return null;})[_0x5dcd('0x24')](function(_0x346b98){if(!_0x346b98)return null;_0x2ffebe['message'][_0x5dcd('0x65')]=_0x346b98;return _0x2ffebe;})[_0x5dcd('0x24')](function(_0x2cdecf){if(_0x2cdecf){if(_0x26e499[_0x5dcd('0x5d')][_0x5dcd('0x7b')]){_0x2ffebe[_0x5dcd('0x2c')][_0x5dcd('0x7c')]=util[_0x5dcd('0x62')]('SIP/%s',_0x26e499['user']['name']);_0x2ffebe['message'][_0x5dcd('0x7d')]=_0x2ffebe[_0x5dcd('0x7d')];_0x2ffebe[_0x5dcd('0x2c')]['motionChannel']=_0x2ffebe[_0x5dcd('0x7d')];_0x2ffebe['message']['event']=_0x5dcd('0x60');return respondWithRpcPromise(_0x5dcd('0x7e'),'EventManager',{'event':'acceptmessage','message':_0x2ffebe[_0x5dcd('0x2c')]},client9002)[_0x5dcd('0x24')](function(){return _0x2ffebe;});}return _0x2ffebe;}return null;})['then'](respondWithResult(_0x5f4d29,null))[_0x5dcd('0x58')](handleError(_0x5f4d29,null));};var interaction_log=require(_0x5dcd('0x16'))(_0x5dcd('0x7f'));exports[_0x5dcd('0x38')]=function(_0x16f14a,_0x3d9c74,_0x1690e3){var _0x38f445={'agent':{},'channel':'sms'};if(_0x16f14a[_0x5dcd('0x5d')]['id']){delete _0x16f14a[_0x5dcd('0x5d')]['id'];}_0x16f14a['body']['UserId']=_0x16f14a['body'][_0x5dcd('0x63')]||_0x16f14a[_0x5dcd('0x64')]['id'];_0x38f445[_0x5dcd('0x65')]['id']=_0x16f14a['body'][_0x5dcd('0x63')];return db[_0x5dcd('0x3f')][_0x5dcd('0x5e')]({'where':{'id':_0x16f14a[_0x5dcd('0x5a')]['id'],'UserId':null}})[_0x5dcd('0x24')](handleEntityNotFound(_0x3d9c74,null))[_0x5dcd('0x24')](function(_0x27561b){if(_0x27561b){_0x38f445[_0x5dcd('0x2c')]=_0x27561b[_0x5dcd('0x66')]({'plain':!![]});return db[_0x5dcd('0x67')][_0x5dcd('0x5e')]({'where':{'id':_0x27561b[_0x5dcd('0x68')]}});}return null;})[_0x5dcd('0x24')](handleEntityNotFound(_0x3d9c74,null))[_0x5dcd('0x24')](function(_0x51529f){if(_0x51529f){_0x38f445[_0x5dcd('0x6a')]=_0x51529f[_0x5dcd('0x66')]({'plain':!![]});interaction_log[_0x5dcd('0x25')](_0x5dcd('0x80'),_0x16f14a['user']['id'],_0x16f14a[_0x5dcd('0x64')][_0x5dcd('0x3c')],_0x16f14a[_0x5dcd('0x64')][_0x5dcd('0x6c')],_0x38f445[_0x5dcd('0x6a')]['id'],_0x16f14a[_0x5dcd('0x5d')]?JSON[_0x5dcd('0x29')](_0x16f14a['body']):'null');return respondWithRpcPromise(_0x5dcd('0x81'),_0x5dcd('0x82'),_0x38f445);}return null;})[_0x5dcd('0x24')](function(_0x3f3cc6){var _0x53c64b=_0x5dcd('0x70')+_0x3f3cc6[_0x5dcd('0x2c')]['ContactId'];return db[_0x5dcd('0x72')][_0x5dcd('0x4a')](_0x53c64b,{'type':db[_0x5dcd('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5dcd('0x24')](function(_0xe027c4){return _0xe027c4;});})[_0x5dcd('0x24')](function(_0x47b239){if(_0x47b239){_0x38f445[_0x5dcd('0x2c')][_0x5dcd('0x76')]=_0x47b239[0x0];if(!_0x16f14a[_0x5dcd('0x5d')][_0x5dcd('0x63')])return;return db['User'][_0x5dcd('0x5e')]({'where':{'id':_0x16f14a[_0x5dcd('0x5d')][_0x5dcd('0x63')],'role':'agent'},'attributes':['id',_0x5dcd('0x3c'),_0x5dcd('0x78'),_0x5dcd('0x79'),_0x5dcd('0x7a')],'raw':!![]});}return null;})[_0x5dcd('0x24')](function(_0x15a82b){if(!_0x15a82b)return null;_0x38f445[_0x5dcd('0x2c')]['agent']=_0x15a82b;return _0x38f445;})[_0x5dcd('0x24')](function(_0x108873){if(_0x108873){_0x108873[_0x5dcd('0x2c')][_0x5dcd('0x7c')]=util[_0x5dcd('0x62')](_0x5dcd('0x83'),_0x16f14a[_0x5dcd('0x64')][_0x5dcd('0x3c')]);_0x108873[_0x5dcd('0x2c')][_0x5dcd('0x7d')]=_0x38f445[_0x5dcd('0x7d')];_0x108873['message'][_0x5dcd('0x84')]=_0x38f445['channel'];_0x108873[_0x5dcd('0x2c')][_0x5dcd('0x85')]=_0x5dcd('0x38');respondWithRpcPromise(_0x5dcd('0x7e'),_0x5dcd('0x7e'),{'event':_0x5dcd('0x86'),'message':_0x108873[_0x5dcd('0x2c')]},client9002);return _0x38f445;}return null;})[_0x5dcd('0x24')](respondWithResult(_0x3d9c74,null))['catch'](handleError(_0x3d9c74,null));};exports[_0x5dcd('0x2f')]=function(_0x4b41b3,_0x40f6ae,_0x2e3eae){if(_0x4b41b3[_0x5dcd('0x5d')]['id']){delete _0x4b41b3[_0x5dcd('0x5d')]['id'];}var _0x173706;return db['SmsMessage'][_0x5dcd('0x5e')]({'where':{'id':_0x4b41b3[_0x5dcd('0x5a')]['id']}})[_0x5dcd('0x24')](handleEntityNotFound(_0x40f6ae,null))['then'](function(_0x383d62){if(_0x383d62){_0x173706=_0x383d62;return db[_0x5dcd('0x87')]['find']({'where':{'id':_0x383d62[_0x5dcd('0x88')]}});}})[_0x5dcd('0x24')](handleEntityNotFound(_0x40f6ae,null))[_0x5dcd('0x24')](function(_0x50afbe){if(_0x50afbe){logger[_0x5dcd('0x89')](_0x5dcd('0x28'),_0x5dcd('0x2f'),_0x5dcd('0x8a'),_0x50afbe[_0x5dcd('0x42')],util['inspect'](_0x4b41b3['body'],{'showHidden':![],'depth':null}));switch(_0x50afbe[_0x5dcd('0x42')]){case'twilio':if(_0x4b41b3[_0x5dcd('0x5d')][_0x5dcd('0x8b')]&&_0x4b41b3[_0x5dcd('0x5d')][_0x5dcd('0x8b')]===_0x173706[_0x5dcd('0x8c')]){return _0x173706[_0x5dcd('0x39')]({'read':!![]});}else{logger['error'](_0x5dcd('0x8d'),_0x5dcd('0x2f'),_0x5dcd('0x8e'),util[_0x5dcd('0x8f')](_0x4b41b3[_0x5dcd('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5dcd('0x90'):if(_0x4b41b3[_0x5dcd('0x5d')][_0x5dcd('0x91')]&&_0x4b41b3[_0x5dcd('0x5d')]['MessageUUID']===_0x173706[_0x5dcd('0x8c')]&&_[_0x5dcd('0x92')](['sent','delivered'],_0x4b41b3[_0x5dcd('0x5d')][_0x5dcd('0x93')])>=0x0){return _0x173706[_0x5dcd('0x39')]({'read':!![]});}else{logger[_0x5dcd('0x2a')](_0x5dcd('0x8d'),'status',_0x5dcd('0x94'),util['inspect'](_0x4b41b3[_0x5dcd('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x73d514=_0x4b41b3[_0x5dcd('0x5d')]['results'][0x0];if(_0x73d514['status'][_0x5dcd('0x95')]===_0x5dcd('0x96')){return _0x173706['update']({'read':!![]});}else{logger[_0x5dcd('0x2a')](_0x5dcd('0x8d'),_0x5dcd('0x2f'),'infobip',util['inspect'](_0x4b41b3[_0x5dcd('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x173706;}})[_0x5dcd('0x24')](respondWithResult(_0x40f6ae,null))['catch'](handleError(_0x40f6ae,null));};
\ No newline at end of file
+var _0x6a58=['mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','name','send','index','SmsMessage','rawAttributes','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','create','body','find','describe','sms-interactions','accept','sms','readAt','UserId','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','channel','event','EventManager','acceptmessage','../../config/logger','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','motionChannel','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','moment'];(function(_0x3b9bef,_0x4c96eb){var _0x58f5ac=function(_0x4ae64e){while(--_0x4ae64e){_0x3b9bef['push'](_0x3b9bef['shift']());}};_0x58f5ac(++_0x4c96eb);}(_0x6a58,0x120));var _0x86a5=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x6a58[_0x54b062];return _0x255e41;};'use strict';var emlformat=require(_0x86a5('0x0'));var rimraf=require(_0x86a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86a5('0x2'));var rp=require('request-promise');var moment=require(_0x86a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86a5('0x4'));var util=require(_0x86a5('0x5'));var path=require(_0x86a5('0x6'));var sox=require(_0x86a5('0x7'));var csv=require(_0x86a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86a5('0x9'));var _=require(_0x86a5('0xa'));var squel=require('squel');var crypto=require(_0x86a5('0xb'));var jsforce=require(_0x86a5('0xc'));var deskjs=require(_0x86a5('0xd'));var toCsv=require(_0x86a5('0x8'));var querystring=require(_0x86a5('0xe'));var Papa=require(_0x86a5('0xf'));var Redis=require(_0x86a5('0x10'));var authService=require(_0x86a5('0x11'));var qs=require(_0x86a5('0x12'));var as=require(_0x86a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x86a5('0x14'));var utils=require('../../config/utils');var config=require(_0x86a5('0x15'));var licenseUtil=require(_0x86a5('0x16'));var db=require('../../mysqldb')['db'];config[_0x86a5('0x17')]=_[_0x86a5('0x18')](config['redis'],{'host':_0x86a5('0x19'),'port':0x18eb});var socket=require(_0x86a5('0x1a'))(new Redis(config['redis']));require(_0x86a5('0x1b'))[_0x86a5('0x1c')](socket);var jayson=require(_0x86a5('0x1d'));var client=jayson[_0x86a5('0x1e')][_0x86a5('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12999d,_0x5c3c99,_0x61d809,_0x2a9b90){return new BPromise(function(_0x69a6ec,_0x53b051){var _0x497fce=_0x2a9b90||client;return _0x497fce[_0x86a5('0x20')](_0x12999d,_0x61d809)[_0x86a5('0x21')](function(_0x146327){logger[_0x86a5('0x22')](_0x86a5('0x23'),_0x5c3c99,'request\x20sent');logger[_0x86a5('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5c3c99,_0x86a5('0x25'),JSON[_0x86a5('0x26')](_0x146327));if(_0x146327[_0x86a5('0x27')]){if(_0x146327[_0x86a5('0x27')][_0x86a5('0x28')]===0x1f4){logger[_0x86a5('0x27')](_0x86a5('0x23'),_0x5c3c99,_0x146327[_0x86a5('0x27')]['message']);return _0x53b051(_0x146327['error'][_0x86a5('0x29')]);}logger[_0x86a5('0x27')]('SmsMessage,\x20%s,\x20%s',_0x5c3c99,_0x146327['error']['message']);return _0x69a6ec(_0x146327[_0x86a5('0x27')][_0x86a5('0x29')]);}else{logger[_0x86a5('0x22')]('SmsMessage,\x20%s,\x20%s',_0x5c3c99,'request\x20sent');_0x69a6ec(_0x146327[_0x86a5('0x2a')][_0x86a5('0x29')]);}})[_0x86a5('0x2b')](function(_0x56fd69){logger[_0x86a5('0x27')]('SmsMessage,\x20%s,\x20%s',_0x5c3c99,_0x56fd69);_0x53b051(_0x56fd69);});});}function respondWithStatusCode(_0xfac7fd,_0x573f65){_0x573f65=_0x573f65||0xcc;return function(_0x3d36a6){if(_0x3d36a6){return _0xfac7fd[_0x86a5('0x2c')](_0x573f65);}return _0xfac7fd[_0x86a5('0x2d')](_0x573f65)[_0x86a5('0x2e')]();};}function respondWithResult(_0x3af4a5,_0x887e58){_0x887e58=_0x887e58||0xc8;return function(_0x56ffff){if(_0x56ffff){return _0x3af4a5['status'](_0x887e58)[_0x86a5('0x2f')](_0x56ffff);}};}function respondWithFilteredResult(_0x9589d3,_0x1568b7){return function(_0xcbf54e){if(_0xcbf54e){var _0x14a4d2=typeof _0x1568b7[_0x86a5('0x30')]===_0x86a5('0x31')&&typeof _0x1568b7['limit']===_0x86a5('0x31');var _0x58f2af=_0xcbf54e['count'];var _0x66ed6f=_0x14a4d2?0x0:_0x1568b7['offset'];var _0x3a06a3=_0x14a4d2?_0xcbf54e[_0x86a5('0x32')]:_0x1568b7[_0x86a5('0x30')]+_0x1568b7[_0x86a5('0x33')];var _0x1c472e;if(_0x3a06a3>=_0x58f2af){_0x3a06a3=_0x58f2af;_0x1c472e=0xc8;}else{_0x1c472e=0xce;}_0x9589d3[_0x86a5('0x2d')](_0x1c472e);return _0x9589d3[_0x86a5('0x34')](_0x86a5('0x35'),_0x66ed6f+'-'+_0x3a06a3+'/'+_0x58f2af)[_0x86a5('0x2f')](_0xcbf54e);}return null;};}function patchUpdates(_0x37305b){return function(_0x4390a3){try{jsonpatch[_0x86a5('0x36')](_0x4390a3,_0x37305b,!![]);}catch(_0x461862){return BPromise[_0x86a5('0x37')](_0x461862);}return _0x4390a3['save']();};}function saveUpdates(_0xbbb30a,_0xa672df){return function(_0x3d66ba){if(_0x3d66ba){return _0x3d66ba[_0x86a5('0x38')](_0xbbb30a)[_0x86a5('0x21')](function(_0x1ea78b){return _0x1ea78b;});}return null;};}function removeEntity(_0x2b6a77,_0x530502){return function(_0x48a687){if(_0x48a687){return _0x48a687[_0x86a5('0x39')]()[_0x86a5('0x21')](function(){_0x2b6a77[_0x86a5('0x2d')](0xcc)[_0x86a5('0x2e')]();});}};}function handleEntityNotFound(_0x7f645e,_0x11ef52){return function(_0x5cfaa1){if(!_0x5cfaa1){_0x7f645e[_0x86a5('0x2c')](0x194);}return _0x5cfaa1;};}function handleError(_0x41fbe3,_0x53136d){_0x53136d=_0x53136d||0x1f4;return function(_0x19bbd6){logger[_0x86a5('0x27')](_0x19bbd6['stack']);if(_0x19bbd6['name']){delete _0x19bbd6[_0x86a5('0x3a')];}_0x41fbe3[_0x86a5('0x2d')](_0x53136d)[_0x86a5('0x3b')](_0x19bbd6);};}exports[_0x86a5('0x3c')]=function(_0x5d5ac9,_0x39afe5){var _0x21452b={},_0xdcba4={},_0x463b99={'count':0x0,'rows':[]};var _0x1b84ff=_['map'](db[_0x86a5('0x3d')][_0x86a5('0x3e')],function(_0x46fb24){return{'name':_0x46fb24['fieldName'],'type':_0x46fb24[_0x86a5('0x3f')]['key']};});_0xdcba4['model']=_['map'](_0x1b84ff,_0x86a5('0x3a'));_0xdcba4[_0x86a5('0x40')]=_['keys'](_0x5d5ac9[_0x86a5('0x40')]);_0xdcba4[_0x86a5('0x41')]=_['intersection'](_0xdcba4[_0x86a5('0x42')],_0xdcba4[_0x86a5('0x40')]);_0x21452b[_0x86a5('0x43')]=_[_0x86a5('0x44')](_0xdcba4[_0x86a5('0x42')],qs[_0x86a5('0x45')](_0x5d5ac9[_0x86a5('0x40')][_0x86a5('0x45')]));_0x21452b[_0x86a5('0x43')]=_0x21452b[_0x86a5('0x43')][_0x86a5('0x46')]?_0x21452b[_0x86a5('0x43')]:_0xdcba4[_0x86a5('0x42')];if(!_0x5d5ac9['query'][_0x86a5('0x47')]('nolimit')){_0x21452b[_0x86a5('0x33')]=qs[_0x86a5('0x33')](_0x5d5ac9[_0x86a5('0x40')][_0x86a5('0x33')]);_0x21452b[_0x86a5('0x30')]=qs['offset'](_0x5d5ac9[_0x86a5('0x40')][_0x86a5('0x30')]);}_0x21452b['order']=qs[_0x86a5('0x48')](_0x5d5ac9[_0x86a5('0x40')][_0x86a5('0x48')]);_0x21452b[_0x86a5('0x49')]=qs[_0x86a5('0x41')](_[_0x86a5('0x4a')](_0x5d5ac9[_0x86a5('0x40')],_0xdcba4[_0x86a5('0x41')]),_0x1b84ff);if(_0x5d5ac9[_0x86a5('0x40')][_0x86a5('0x4b')]){_0x21452b[_0x86a5('0x49')]=_['merge'](_0x21452b['where'],{'$or':_['map'](_0x1b84ff,function(_0x31e041){if(_0x31e041[_0x86a5('0x3f')]!==_0x86a5('0x4c')){var _0x111869={};_0x111869[_0x31e041[_0x86a5('0x3a')]]={'$like':'%'+_0x5d5ac9[_0x86a5('0x40')]['filter']+'%'};return _0x111869;}})});}_0x21452b=_[_0x86a5('0x4d')]({},_0x21452b,_0x5d5ac9[_0x86a5('0x4e')]);var _0x518cc9={'where':_0x21452b[_0x86a5('0x49')]};return db[_0x86a5('0x3d')][_0x86a5('0x32')](_0x518cc9)[_0x86a5('0x21')](function(_0x32ff10){_0x463b99[_0x86a5('0x32')]=_0x32ff10;if(_0x5d5ac9['query'][_0x86a5('0x4f')]){_0x21452b[_0x86a5('0x50')]=[{'all':!![]}];}return db[_0x86a5('0x3d')][_0x86a5('0x51')](_0x21452b);})[_0x86a5('0x21')](function(_0x24d250){_0x463b99[_0x86a5('0x52')]=_0x24d250;return _0x463b99;})['then'](respondWithFilteredResult(_0x39afe5,_0x21452b))['catch'](handleError(_0x39afe5,null));};exports[_0x86a5('0x53')]=function(_0x52f049,_0x4f4516){var _0x332ccb={'raw':!![],'where':{'id':_0x52f049[_0x86a5('0x54')]['id']}},_0x145fa5={};_0x145fa5[_0x86a5('0x42')]=_[_0x86a5('0x55')](db['SmsMessage']['rawAttributes']);_0x145fa5[_0x86a5('0x40')]=_[_0x86a5('0x55')](_0x52f049[_0x86a5('0x40')]);_0x145fa5[_0x86a5('0x41')]=_['intersection'](_0x145fa5[_0x86a5('0x42')],_0x145fa5[_0x86a5('0x40')]);_0x332ccb[_0x86a5('0x43')]=_[_0x86a5('0x44')](_0x145fa5[_0x86a5('0x42')],qs[_0x86a5('0x45')](_0x52f049[_0x86a5('0x40')][_0x86a5('0x45')]));_0x332ccb['attributes']=_0x332ccb[_0x86a5('0x43')][_0x86a5('0x46')]?_0x332ccb[_0x86a5('0x43')]:_0x145fa5[_0x86a5('0x42')];if(_0x52f049[_0x86a5('0x40')][_0x86a5('0x4f')]){_0x332ccb[_0x86a5('0x50')]=[{'all':!![]}];}_0x332ccb=_[_0x86a5('0x4d')]({},_0x332ccb,_0x52f049[_0x86a5('0x4e')]);return db['SmsMessage']['find'](_0x332ccb)[_0x86a5('0x21')](handleEntityNotFound(_0x4f4516,null))[_0x86a5('0x21')](respondWithResult(_0x4f4516,null))[_0x86a5('0x2b')](handleError(_0x4f4516,null));};exports[_0x86a5('0x56')]=function(_0x1d420d,_0x359f64){return db[_0x86a5('0x3d')][_0x86a5('0x56')](_0x1d420d[_0x86a5('0x57')],{})[_0x86a5('0x21')](respondWithResult(_0x359f64,0xc9))['catch'](handleError(_0x359f64,null));};exports[_0x86a5('0x38')]=function(_0x514654,_0x1c32ba){if(_0x514654[_0x86a5('0x57')]['id']){delete _0x514654[_0x86a5('0x57')]['id'];}return db['SmsMessage'][_0x86a5('0x58')]({'where':{'id':_0x514654['params']['id']}})[_0x86a5('0x21')](handleEntityNotFound(_0x1c32ba,null))[_0x86a5('0x21')](saveUpdates(_0x514654[_0x86a5('0x57')],null))[_0x86a5('0x21')](respondWithResult(_0x1c32ba,null))['catch'](handleError(_0x1c32ba,null));};exports[_0x86a5('0x39')]=function(_0x568e0d,_0x402c3a){return db[_0x86a5('0x3d')][_0x86a5('0x58')]({'where':{'id':_0x568e0d['params']['id']}})['then'](handleEntityNotFound(_0x402c3a,null))[_0x86a5('0x21')](removeEntity(_0x402c3a,null))['catch'](handleError(_0x402c3a,null));};exports[_0x86a5('0x59')]=function(_0x1b1cdc,_0x117172){return db[_0x86a5('0x3d')]['describe']()[_0x86a5('0x21')](respondWithResult(_0x117172,null))[_0x86a5('0x2b')](handleError(_0x117172,null));};var interaction_log=require('../../config/logger')(_0x86a5('0x5a'));exports[_0x86a5('0x5b')]=function(_0x3b5065,_0xa66ab7,_0x50a5c1){var _0x5be008={'agent':{},'channel':_0x86a5('0x5c')};if(_0x3b5065['body']['id']){delete _0x3b5065[_0x86a5('0x57')]['id'];}_0x3b5065['body']['read']=!![];_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')]=_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')]||_0x3b5065['user']['id'];_0x5be008['agent']['id']=_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')];return db[_0x86a5('0x3d')][_0x86a5('0x58')]({'where':{'id':_0x3b5065[_0x86a5('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa66ab7,null))[_0x86a5('0x21')](saveUpdates(_0x3b5065['body'],null))['then'](function(_0x57a04){if(_0x57a04){_0x5be008[_0x86a5('0x29')]=_0x57a04['get']({'plain':!![]});return db['SmsInteraction'][_0x86a5('0x58')]({'where':{'id':_0x57a04[_0x86a5('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xa66ab7,null))[_0x86a5('0x21')](function(_0x411460){if(_0x411460){return _0x411460['update']({'UserId':_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')],'read1stAt':_[_0x86a5('0x60')](_0x411460[_0x86a5('0x61')])?moment()[_0x86a5('0x62')](_0x86a5('0x63')):undefined});}return null;})[_0x86a5('0x21')](function(_0xdbafe5){if(_0xdbafe5){_0x5be008[_0x86a5('0x64')]=_0xdbafe5[_0x86a5('0x65')]({'plain':!![]});interaction_log[_0x86a5('0x22')](_0x86a5('0x66'),_0x3b5065['user']['id'],_0x3b5065[_0x86a5('0x67')][_0x86a5('0x3a')],_0x3b5065[_0x86a5('0x67')]['role'],_0x5be008[_0x86a5('0x64')]['id'],_0x3b5065['body']?JSON[_0x86a5('0x26')](_0x3b5065['body']):_0x86a5('0x68'));return respondWithRpcPromise(_0x86a5('0x69'),_0x86a5('0x6a'),_0x5be008);}return null;})['then'](function(_0x399c5b){var _0x47a248='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x399c5b['message'][_0x86a5('0x6b')];return db[_0x86a5('0x6c')][_0x86a5('0x40')](_0x47a248,{'type':db[_0x86a5('0x6d')][_0x86a5('0x6e')][_0x86a5('0x6f')],'raw':!![]})['then'](function(_0x5ceb85){return _0x5ceb85;});})[_0x86a5('0x21')](function(_0x560de3){if(_0x560de3){_0x5be008[_0x86a5('0x29')][_0x86a5('0x70')]=_0x560de3[0x0];if(!_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')])return;return db[_0x86a5('0x71')]['find']({'where':{'id':_0x3b5065[_0x86a5('0x57')][_0x86a5('0x5e')],'role':_0x86a5('0x72')},'attributes':['id',_0x86a5('0x3a'),_0x86a5('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x86a5('0x21')](function(_0x1d2880){if(!_0x1d2880)return null;_0x5be008[_0x86a5('0x29')]['agent']=_0x1d2880;return _0x5be008;})[_0x86a5('0x21')](function(_0x4740fa){if(_0x4740fa){if(_0x3b5065[_0x86a5('0x57')][_0x86a5('0x74')]){_0x5be008[_0x86a5('0x29')][_0x86a5('0x75')]=util['format']('SIP/%s',_0x3b5065[_0x86a5('0x67')][_0x86a5('0x3a')]);_0x5be008[_0x86a5('0x29')][_0x86a5('0x76')]=_0x5be008[_0x86a5('0x76')];_0x5be008[_0x86a5('0x29')]['motionChannel']=_0x5be008[_0x86a5('0x76')];_0x5be008[_0x86a5('0x29')][_0x86a5('0x77')]='accept';return respondWithRpcPromise(_0x86a5('0x78'),_0x86a5('0x78'),{'event':_0x86a5('0x79'),'message':_0x5be008[_0x86a5('0x29')]},client9002)['then'](function(){return _0x5be008;});}return _0x5be008;}return null;})['then'](respondWithResult(_0xa66ab7,null))[_0x86a5('0x2b')](handleError(_0xa66ab7,null));};var interaction_log=require(_0x86a5('0x7a'))(_0x86a5('0x5a'));exports[_0x86a5('0x37')]=function(_0x471b81,_0x30e2bf,_0x353a58){var _0x2e710c={'agent':{},'channel':'sms'};if(_0x471b81[_0x86a5('0x57')]['id']){delete _0x471b81['body']['id'];}_0x471b81[_0x86a5('0x57')][_0x86a5('0x5e')]=_0x471b81[_0x86a5('0x57')][_0x86a5('0x5e')]||_0x471b81[_0x86a5('0x67')]['id'];_0x2e710c[_0x86a5('0x72')]['id']=_0x471b81[_0x86a5('0x57')]['UserId'];return db[_0x86a5('0x3d')][_0x86a5('0x58')]({'where':{'id':_0x471b81[_0x86a5('0x54')]['id'],'UserId':null}})[_0x86a5('0x21')](handleEntityNotFound(_0x30e2bf,null))[_0x86a5('0x21')](function(_0x3691f1){if(_0x3691f1){_0x2e710c[_0x86a5('0x29')]=_0x3691f1[_0x86a5('0x65')]({'plain':!![]});return db[_0x86a5('0x7b')][_0x86a5('0x58')]({'where':{'id':_0x3691f1['SmsInteractionId']}});}return null;})[_0x86a5('0x21')](handleEntityNotFound(_0x30e2bf,null))[_0x86a5('0x21')](function(_0x3d2deb){if(_0x3d2deb){_0x2e710c[_0x86a5('0x64')]=_0x3d2deb[_0x86a5('0x65')]({'plain':!![]});interaction_log['info'](_0x86a5('0x7c'),_0x471b81[_0x86a5('0x67')]['id'],_0x471b81['user'][_0x86a5('0x3a')],_0x471b81[_0x86a5('0x67')]['role'],_0x2e710c[_0x86a5('0x64')]['id'],_0x471b81[_0x86a5('0x57')]?JSON['stringify'](_0x471b81[_0x86a5('0x57')]):_0x86a5('0x68'));return respondWithRpcPromise(_0x86a5('0x7d'),'rejectMessage',_0x2e710c);}return null;})[_0x86a5('0x21')](function(_0x3687d7){var _0x2e22db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3687d7[_0x86a5('0x29')]['ContactId'];return db[_0x86a5('0x6c')][_0x86a5('0x40')](_0x2e22db,{'type':db[_0x86a5('0x6d')][_0x86a5('0x6e')]['SELECT'],'raw':!![]})[_0x86a5('0x21')](function(_0x5a8279){return _0x5a8279;});})[_0x86a5('0x21')](function(_0x117946){if(_0x117946){_0x2e710c[_0x86a5('0x29')]['contact']=_0x117946[0x0];if(!_0x471b81[_0x86a5('0x57')]['UserId'])return;return db['User'][_0x86a5('0x58')]({'where':{'id':_0x471b81[_0x86a5('0x57')][_0x86a5('0x5e')],'role':'agent'},'attributes':['id',_0x86a5('0x3a'),_0x86a5('0x73'),'email',_0x86a5('0x7e')],'raw':!![]});}return null;})[_0x86a5('0x21')](function(_0x48068d){if(!_0x48068d)return null;_0x2e710c[_0x86a5('0x29')][_0x86a5('0x72')]=_0x48068d;return _0x2e710c;})[_0x86a5('0x21')](function(_0x518ab9){if(_0x518ab9){_0x518ab9[_0x86a5('0x29')][_0x86a5('0x75')]=util['format']('SIP/%s',_0x471b81['user'][_0x86a5('0x3a')]);_0x518ab9[_0x86a5('0x29')][_0x86a5('0x76')]=_0x2e710c[_0x86a5('0x76')];_0x518ab9[_0x86a5('0x29')][_0x86a5('0x7f')]=_0x2e710c[_0x86a5('0x76')];_0x518ab9[_0x86a5('0x29')][_0x86a5('0x77')]='reject';respondWithRpcPromise(_0x86a5('0x78'),_0x86a5('0x78'),{'event':_0x86a5('0x80'),'message':_0x518ab9[_0x86a5('0x29')]},client9002);return _0x2e710c;}return null;})[_0x86a5('0x21')](respondWithResult(_0x30e2bf,null))[_0x86a5('0x2b')](handleError(_0x30e2bf,null));};exports[_0x86a5('0x2d')]=function(_0x68585e,_0x48fa63,_0xe31e1c){if(_0x68585e[_0x86a5('0x57')]['id']){delete _0x68585e['body']['id'];}var _0x54ceee;return db[_0x86a5('0x3d')][_0x86a5('0x58')]({'where':{'id':_0x68585e[_0x86a5('0x54')]['id']}})[_0x86a5('0x21')](handleEntityNotFound(_0x48fa63,null))[_0x86a5('0x21')](function(_0x4c83b){if(_0x4c83b){_0x54ceee=_0x4c83b;return db[_0x86a5('0x81')][_0x86a5('0x58')]({'where':{'id':_0x4c83b[_0x86a5('0x82')]}});}})[_0x86a5('0x21')](handleEntityNotFound(_0x48fa63,null))[_0x86a5('0x21')](function(_0x97282c){if(_0x97282c){logger[_0x86a5('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x97282c[_0x86a5('0x3f')],util['inspect'](_0x68585e[_0x86a5('0x57')],{'showHidden':![],'depth':null}));switch(_0x97282c[_0x86a5('0x3f')]){case _0x86a5('0x83'):if(_0x68585e[_0x86a5('0x57')]['MessageSid']&&_0x68585e[_0x86a5('0x57')][_0x86a5('0x84')]===_0x54ceee[_0x86a5('0x85')]){return _0x54ceee[_0x86a5('0x38')]({'read':!![]});}else{logger[_0x86a5('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x86a5('0x2d'),'twilio',util[_0x86a5('0x86')](_0x68585e[_0x86a5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x86a5('0x87'):if(_0x68585e[_0x86a5('0x57')][_0x86a5('0x88')]&&_0x68585e[_0x86a5('0x57')][_0x86a5('0x88')]===_0x54ceee[_0x86a5('0x85')]&&_[_0x86a5('0x89')](['sent',_0x86a5('0x8a')],_0x68585e[_0x86a5('0x57')][_0x86a5('0x8b')])>=0x0){return _0x54ceee[_0x86a5('0x38')]({'read':!![]});}else{logger[_0x86a5('0x27')](_0x86a5('0x8c'),_0x86a5('0x2d'),_0x86a5('0x8d'),util[_0x86a5('0x86')](_0x68585e[_0x86a5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x86a5('0x8e'):var _0x136412=_0x68585e['body'][_0x86a5('0x8f')][0x0];if(_0x136412[_0x86a5('0x2d')][_0x86a5('0x90')]===_0x86a5('0x91')){return _0x54ceee[_0x86a5('0x38')]({'read':!![]});}else{logger[_0x86a5('0x27')](_0x86a5('0x8c'),_0x86a5('0x2d'),_0x86a5('0x8e'),util[_0x86a5('0x86')](_0x68585e['body'],{'showHidden':![],'depth':null}));}break;}return _0x54ceee;}})['then'](respondWithResult(_0x48fa63,null))[_0x86a5('0x2b')](handleError(_0x48fa63,null));};
\ No newline at end of file
index 6816228..0cf55ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb94b=['save','update','remove','emit','exports','events','SmsMessage','setMaxListeners'];(function(_0x3cef22,_0x1eb5e0){var _0x13ded7=function(_0x5aac75){while(--_0x5aac75){_0x3cef22['push'](_0x3cef22['shift']());}};_0x13ded7(++_0x1eb5e0);}(_0xb94b,0xa5));var _0xbb94=function(_0x176df9,_0x386eae){_0x176df9=_0x176df9-0x0;var _0x40635b=_0xb94b[_0x176df9];return _0x40635b;};'use strict';var EventEmitter=require(_0xbb94('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xbb94('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbb94('0x2')](0x0);var events={'afterCreate':_0xbb94('0x3'),'afterUpdate':_0xbb94('0x4'),'afterDestroy':_0xbb94('0x5')};function emitEvent(_0x1933a0){return function(_0x4ad44e,_0x5e9706,_0x5a6df4){SmsMessageEvents[_0xbb94('0x6')](_0x1933a0+':'+_0x4ad44e['id'],_0x4ad44e);SmsMessageEvents[_0xbb94('0x6')](_0x1933a0,_0x4ad44e);_0x5a6df4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xbb94('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x756f=['save','remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x3bc958,_0x45d34a){var _0x3d136e=function(_0x3602f8){while(--_0x3602f8){_0x3bc958['push'](_0x3bc958['shift']());}};_0x3d136e(++_0x45d34a);}(_0x756f,0xdd));var _0xf756=function(_0x42370d,_0x3fc660){_0x42370d=_0x42370d-0x0;var _0x116c9d=_0x756f[_0x42370d];return _0x116c9d;};'use strict';var EventEmitter=require(_0xf756('0x0'));var SmsMessage=require(_0xf756('0x1'))['db'][_0xf756('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf756('0x3')](0x0);var events={'afterCreate':_0xf756('0x4'),'afterUpdate':'update','afterDestroy':_0xf756('0x5')};function emitEvent(_0x16372a){return function(_0x16ede7,_0x3e6783,_0x22ed14){SmsMessageEvents[_0xf756('0x6')](_0x16372a+':'+_0x16ede7['id'],_0x16ede7);SmsMessageEvents[_0xf756('0x6')](_0x16372a,_0x16ede7);_0x22ed14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xf756('0x7')](e,emitEvent(event));}}module[_0xf756('0x8')]=SmsMessageEvents;
\ No newline at end of file
index cb196b6..f603a30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f07=['plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','text','timestamp','keys','sort','length','apiKey','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','application/json','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','exports','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','password','GET','split','POST','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','username','https://rest.clicksend.com/v3/sms/send','base64','http_code','queued_count','head','data','message_id','clickSend'];(function(_0x23d28a,_0x39bc98){var _0x3afe66=function(_0x105ea0){while(--_0x105ea0){_0x23d28a['push'](_0x23d28a['shift']());}};_0x3afe66(++_0x39bc98);}(_0x2f07,0xa1));var _0x72f0=function(_0x46bfea,_0x4d38ca){_0x46bfea=_0x46bfea-0x0;var _0x42d90b=_0x2f07[_0x46bfea];return _0x42d90b;};'use strict';var _=require(_0x72f0('0x0'));var util=require(_0x72f0('0x1'));var logger=require('../../config/logger')(_0x72f0('0x2'));var moment=require(_0x72f0('0x3'));var BPromise=require(_0x72f0('0x4'));var rp=require(_0x72f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x72f0('0x6')]=function(_0x2844ae,_0xcee579){return _0x2844ae['define']('SmsMessage',attributes,{'tableName':_0x72f0('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x72f0('0x8')]},{'name':_0x72f0('0x9'),'fields':[_0x72f0('0xa')],'type':_0x72f0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc0dafd,_0x5ac868,_0xe43d8e){var _0x3052a1=_0x2844ae[_0x72f0('0xc')];var _0x46efd5=_0xc0dafd[_0x72f0('0xd')]({'plain':!![]});if(_0x46efd5['direction']['toLowerCase']()==='in'||_0x46efd5[_0x72f0('0xe')][_0x72f0('0xf')]()===_0x72f0('0x10')&&!_0x46efd5[_0x72f0('0x11')]&&!_[_0x72f0('0x12')](_0x46efd5['UserId'])&&!_[_0x72f0('0x12')](_0x46efd5[_0x72f0('0x13')])){_0x3052a1[_0x72f0('0x14')]['findOne']({'where':{'id':_0x46efd5[_0x72f0('0x13')]}})[_0x72f0('0x15')](function(_0x2fa9b6){if(_0x2fa9b6){_0x2fa9b6[_0x72f0('0x16')]({'lastMsgAt':_0x46efd5[_0x72f0('0x17')],'lastMsgDirection':_0x46efd5['direction']['toLowerCase']()});}})[_0x72f0('0x18')](function(_0x151c8e){console[_0x72f0('0x19')](_0x151c8e);});}if(_0x46efd5[_0x72f0('0xe')]===_0x72f0('0x10')&&!_0x46efd5[_0x72f0('0x11')]){var _0x3cc8ce;_0x3052a1[_0x72f0('0x1a')]['find']({'where':{'id':_0x46efd5[_0x72f0('0x1b')]},'raw':!![]})[_0x72f0('0x15')](function(_0x52d181){_0x3cc8ce=_0x52d181;if(_0x3cc8ce&&_0x3cc8ce['type']){switch(_0x3cc8ce[_0x72f0('0x1c')]){case _0x72f0('0x1d'):var _0x20bd59=require(_0x72f0('0x1d'));if(_0x3cc8ce[_0x72f0('0x1e')]&&_0x3cc8ce[_0x72f0('0x1f')]&&_0x3cc8ce[_0x72f0('0x20')]){var _0x179a5c=new _0x20bd59(_0x3cc8ce[_0x72f0('0x1e')],_0x3cc8ce[_0x72f0('0x1f')]);_0x179a5c[_0x72f0('0x21')][_0x72f0('0x22')]({'body':_0x46efd5['body'],'to':_0x46efd5[_0x72f0('0x20')],'from':_0x3cc8ce[_0x72f0('0x20')],'statusCallback':_0x3cc8ce['remote']+_0x72f0('0x23')+_0x46efd5['id']+_0x72f0('0x24')+_0x3cc8ce[_0x72f0('0x25')]})['then'](function(_0xc8beb5){if(_0xc8beb5[_0x72f0('0x26')]){return _0xc0dafd[_0x72f0('0x16')]({'messageId':_0xc8beb5['sid']});}})['catch'](function(_0x2ea561){logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),'twilio',util['inspect'](_0x2ea561,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),'afterCreate',_0x72f0('0x1d'),_0x72f0('0x29'));}break;case _0x72f0('0x2a'):var _0x52f92e=_0x72f0('0x2b');if(_0x3cc8ce['username']&&_0x3cc8ce['password']){var _0x48d530={'recipient':[_0x46efd5['phone']],'message':_0x46efd5[_0x72f0('0xa')],'message_type':_0x3cc8ce[_0x72f0('0x2c')]};if(_0x3cc8ce[_0x72f0('0x2c')]&&_0x3cc8ce[_0x72f0('0x2c')]!=='SI'){_0x48d530[_0x72f0('0x2d')]=_0x3cc8ce[_0x72f0('0x20')];}var _0x1f6367={'url':_0x52f92e+'login?username='+_0x3cc8ce['username']+'&password='+_0x3cc8ce[_0x72f0('0x2e')],'method':_0x72f0('0x2f')};rp(_0x1f6367)[_0x72f0('0x15')](function(_0x4e9a12){var _0x293ced=_0x4e9a12[_0x72f0('0x30')](';');var _0x22b681={'user_key':_0x293ced[0x0],'session_key':_0x293ced[0x1]};_0x1f6367={'url':_0x52f92e+'sms','method':_0x72f0('0x31'),'headers':{'user_key':_0x22b681['user_key'],'Session_key':_0x22b681['session_key']},'json':!![],'body':_0x48d530};return rp(_0x1f6367);})['then'](function(_0x32347a){if(_0x32347a['total_sent']>=0x1){var _0x347075={'messageId':_0x32347a[_0x72f0('0x32')]};if(_0x3cc8ce[_0x72f0('0x2c')]!=='GP'||!_0x3cc8ce[_0x72f0('0x33')]){_0x347075[_0x72f0('0x34')]=!![];}return _0xc0dafd[_0x72f0('0x16')](_0x347075);}else{return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),'skebby',util['inspect'](_0x32347a,{'showHidden':![],'depth':null}));}})['catch'](function(_0xc5a8bf){return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),'skebby',util[_0x72f0('0x35')](_0xc5a8bf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x72f0('0x28'),'afterCreate','skebby',_0x72f0('0x36'));}break;case _0x72f0('0x37'):if(_0x3cc8ce[_0x72f0('0x1f')]){var _0x2bca47={'recipient':_0x46efd5[_0x72f0('0x20')],'message':_0x46efd5[_0x72f0('0xa')],'sender':_0x3cc8ce[_0x72f0('0x38')]||_0x3cc8ce[_0x72f0('0x20')],'authorization':_0x3cc8ce[_0x72f0('0x1f')]};var _0x5ac868={'method':_0x72f0('0x31'),'uri':_0x72f0('0x39'),'body':_0x2bca47,'json':!![]};rp(_0x5ac868)[_0x72f0('0x15')](function(_0x4342f9){var _0x166972={'messageId':_0x4342f9[_0x72f0('0x3a')]};if(!_0x3cc8ce['deliveryReport']){_0x166972[_0x72f0('0x34')]=!![];}return _0xc0dafd['update'](_0x166972);})[_0x72f0('0x18')](function(_0x555c3b){logger['error'](_0x72f0('0x28'),'afterCreate',_0x72f0('0x37'),util[_0x72f0('0x35')](_0x555c3b,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),'afterCreate',_0x72f0('0x37'),_0x72f0('0x3b'));}break;case _0x72f0('0x3c'):if(_0x3cc8ce['username']&&_0x3cc8ce[_0x72f0('0x2e')]){var _0x2bca47={'messages':[{'source':'xCALLY\x20Motion','to':_0x46efd5[_0x72f0('0x20')],'body':_0x46efd5[_0x72f0('0xa')],'from':_0x3cc8ce[_0x72f0('0x38')]||_0x3cc8ce[_0x72f0('0x20')]}]};var _0x4e87ac=util[_0x72f0('0x3d')]('%s:%s',_0x3cc8ce[_0x72f0('0x3e')],_0x3cc8ce[_0x72f0('0x2e')]);var _0x5ac868={'method':_0x72f0('0x31'),'uri':_0x72f0('0x3f'),'body':_0x2bca47,'headers':{'Authorization':util[_0x72f0('0x3d')]('Basic\x20%s',new Buffer(_0x4e87ac)['toString'](_0x72f0('0x40')))},'json':!![]};rp(_0x5ac868)[_0x72f0('0x15')](function(_0x11411b){if(_0x11411b['http_code']>=0xc8&&_0x11411b[_0x72f0('0x41')]<=0xce){if(_0x11411b['data']&&_0x11411b['data'][_0x72f0('0x42')]>0x0){var _0x59f989=_[_0x72f0('0x43')](_0x11411b[_0x72f0('0x44')]['messages']);var _0x193b61={'messageId':_0x59f989[_0x72f0('0x45')]};if(!_0x3cc8ce[_0x72f0('0x33')]){_0x193b61[_0x72f0('0x34')]=!![];}return _0xc0dafd[_0x72f0('0x16')](_0x193b61);}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x46'),util[_0x72f0('0x35')](_0x11411b,{'showHidden':![],'depth':null}));}}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x46'),util[_0x72f0('0x35')](_0x11411b,{'showHidden':![],'depth':null}));}})[_0x72f0('0x18')](function(_0x45a25d){logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x46'),util[_0x72f0('0x35')](_0x45a25d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),_0x72f0('0x46'),_0x72f0('0x36'));}break;case _0x72f0('0x47'):if(_0x3cc8ce[_0x72f0('0x48')]&&_0x3cc8ce[_0x72f0('0x1f')]){var _0x2bca47={'dst':_0x46efd5[_0x72f0('0x20')],'text':_0x46efd5['body'],'src':_0x3cc8ce[_0x72f0('0x38')]||_0x3cc8ce['phone'],'url':_0x3cc8ce['remote']+_0x72f0('0x23')+_0x46efd5['id']+_0x72f0('0x24')+_0x3cc8ce[_0x72f0('0x25')]};var _0x4e87ac=util[_0x72f0('0x3d')](_0x72f0('0x49'),_0x3cc8ce[_0x72f0('0x48')],_0x3cc8ce['authToken']);var _0x5ac868={'method':_0x72f0('0x31'),'uri':util[_0x72f0('0x3d')](_0x72f0('0x4a'),_0x3cc8ce[_0x72f0('0x48')]),'body':_0x2bca47,'headers':{'Authorization':util[_0x72f0('0x3d')](_0x72f0('0x4b'),new Buffer(_0x4e87ac)[_0x72f0('0x4c')](_0x72f0('0x40')))},'json':!![]};rp(_0x5ac868)[_0x72f0('0x15')](function(_0x14f895){var _0x46422f={'messageId':_0x14f895['message_uuid'][0x0]};return _0xc0dafd[_0x72f0('0x16')](_0x46422f);})[_0x72f0('0x18')](function(_0x138aa4){logger['error'](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x47'),util['inspect'](_0x138aa4,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x72f0('0x47'),_0x72f0('0x4d'));}break;case'infobip':if(_0x3cc8ce[_0x72f0('0x3e')]&&_0x3cc8ce[_0x72f0('0x2e')]){if(_0x3cc8ce[_0x72f0('0x4e')]){var _0xb8b1c2={'method':_0x72f0('0x31'),'uri':_0x3cc8ce[_0x72f0('0x4e')]+_0x72f0('0x4f'),'body':{'username':_0x3cc8ce[_0x72f0('0x3e')],'password':_0x3cc8ce[_0x72f0('0x2e')]},'json':!![]};return rp(_0xb8b1c2)[_0x72f0('0x15')](function(_0x24b865){var _0x2ea4a6={'method':_0x72f0('0x31'),'uri':_0x3cc8ce[_0x72f0('0x4e')]+_0x72f0('0x50'),'body':{'messages':[{'from':_0x3cc8ce[_0x72f0('0x20')],'destinations':[{'to':_0x46efd5[_0x72f0('0x20')]}],'text':_0x46efd5['body'],'notifyUrl':_0x3cc8ce[_0x72f0('0x51')]+'/api/sms/messages/'+_0x46efd5['id']+_0x72f0('0x24')+_0x3cc8ce[_0x72f0('0x25')],'notifyContentType':'application/json','callbackData':_0x3cc8ce[_0x72f0('0x20')]+';'+_0x46efd5[_0x72f0('0xa')]}]},'headers':{'Authorization':_0x72f0('0x52')+_0x24b865['token']},'json':!![]};return rp(_0x2ea4a6)[_0x72f0('0x15')](function(_0x106c20){if(_0x106c20[_0x72f0('0x21')]){var _0x8c5a2a={'messageId':_0x106c20[_0x72f0('0x21')][0x0][_0x72f0('0x8')]};if(!_0x3cc8ce['deliveryReport']){_0x8c5a2a['read']=!![];}return _0xc0dafd[_0x72f0('0x16')](_0x8c5a2a);}else{return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x53'),util['inspect'](_0x106c20,{'showHidden':![],'depth':null}));}});})[_0x72f0('0x18')](function(_0x323f19){return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x53'),util[_0x72f0('0x35')](_0x323f19,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),_0x72f0('0x53'),_0x72f0('0x54'));}}else{logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),_0x72f0('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x72f0('0x55'):var _0x6c57e7=require(_0x72f0('0x56'));if(_0x3cc8ce['apiKey']){var _0x17bf7b={};_0x17bf7b['login']=_0x3cc8ce[_0x72f0('0x3e')];_0x17bf7b[_0x72f0('0x20')]=_0x46efd5[_0x72f0('0x20')];_0x17bf7b['sender']=_0x3cc8ce[_0x72f0('0x20')];_0x17bf7b[_0x72f0('0x57')]=_0x46efd5[_0x72f0('0xa')];_0x17bf7b[_0x72f0('0x58')]=+new Date();var _0x5587fe='';var _0x51f155='';var _0x13db50=Object[_0x72f0('0x59')](_0x17bf7b);_0x13db50[_0x72f0('0x5a')]();for(var _0x19c916=0x0;_0x19c916<_0x13db50[_0x72f0('0x5b')];_0x19c916++){if(_0x5587fe!=''){_0x5587fe+='&';}_0x5587fe+=_0x13db50[_0x19c916]+'='+encodeURIComponent(_0x17bf7b[_0x13db50[_0x19c916]]);_0x51f155+=_0x17bf7b[_0x13db50[_0x19c916]];}_0x51f155+=_0x3cc8ce[_0x72f0('0x5c')];_0x51f155=_0x6c57e7['createHash']('md5')['update'](_0x51f155)['digest'](_0x72f0('0x5d'));if(_0x5587fe!==''){_0x5587fe+='&';}_0x5587fe+=_0x72f0('0x5e')+_0x51f155;var _0x1f6367={'method':'GET','uri':_0x3cc8ce[_0x72f0('0x4e')]+_0x72f0('0x5f')+_0x5587fe,'json':!![]};return rp(_0x1f6367)[_0x72f0('0x15')](function(_0x1e471b){var _0x37d17a=Object[_0x72f0('0x59')](_0x1e471b);if(_0x1e471b[_0x37d17a[0x0]][_0x72f0('0x19')]&&parseInt(_0x1e471b[_0x37d17a[0x0]][_0x72f0('0x19')])===0x0){var _0x31e0aa={'messageId':_0x1e471b[_0x37d17a[0x0]][_0x72f0('0x60')]};if(!_0x3cc8ce[_0x72f0('0x33')]){_0x31e0aa['read']=!![];}return _0xc0dafd[_0x72f0('0x16')](_0x31e0aa);}else{return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x55'),util[_0x72f0('0x35')](_0x1e471b[_0x72f0('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4d05ef){return logger[_0x72f0('0x19')](_0x72f0('0x28'),'afterCreate',_0x72f0('0x55'),util['inspect'](_0x4d05ef,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),_0x72f0('0x55'),_0x72f0('0x61'));}break;case _0x72f0('0x62'):if(_0x3cc8ce[_0x72f0('0x5c')]){var _0x5f31b5={'method':_0x72f0('0x31'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3cc8ce[_0x72f0('0x5c')]},'body':{'content':_0x46efd5['body'],'to':[_0x46efd5[_0x72f0('0x20')]],'from':_0x3cc8ce[_0x72f0('0x20')],'binary':![],'clientMessageId':_0x72f0('0x63'),'charset':'UTF-8'},'json':!![]};rp(_0x5f31b5)['then'](function(_0x456784){if(!_0x456784[_0x72f0('0x19')]){var _0x57dac4={'messageId':_0x456784[_0x72f0('0x21')][0x0]['apiMessageId']};if(!_0x3cc8ce['deliveryReport']){_0x57dac4[_0x72f0('0x34')]=!![];}return _0xc0dafd[_0x72f0('0x16')](_0x57dac4);}else{return logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x72f0('0x62'),util['inspect'](_0x456784[_0x72f0('0x19')],{'showHidden':![],'depth':null}));}})[_0x72f0('0x18')](function(_0x582a61){return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x62'),util[_0x72f0('0x35')](_0x582a61,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x62'),_0x72f0('0x61'));}break;case'bandwidth':if(_0x3cc8ce[_0x72f0('0x3e')]&&_0x3cc8ce[_0x72f0('0x2e')]){var _0x4e87ac=util[_0x72f0('0x3d')]('%s:%s',_0x3cc8ce[_0x72f0('0x3e')],_0x3cc8ce[_0x72f0('0x2e')]);var _0x5ac868={'method':_0x72f0('0x31'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3cc8ce['accountId']+_0x72f0('0x64'),'body':{'to':[_0x46efd5[_0x72f0('0x20')]],'text':_0x46efd5[_0x72f0('0xa')],'from':_0x3cc8ce[_0x72f0('0x20')],'applicationId':_0x3cc8ce[_0x72f0('0x65')]},'headers':{'Authorization':util[_0x72f0('0x3d')]('Basic\x20%s',new Buffer(_0x4e87ac)[_0x72f0('0x4c')]('base64'))},'json':!![]};rp(_0x5ac868)['then'](function(_0x5a0ae1){if(_0x5a0ae1['id']){var _0x19890b={'messageId':_0x5a0ae1['id']};return _0xc0dafd[_0x72f0('0x16')](_0x19890b);}else{logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x66'),util['inspect'](_0x5a0ae1,{'showHidden':![],'depth':null}));}})[_0x72f0('0x18')](function(_0x33b56b){logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x66'),util[_0x72f0('0x35')](_0x33b56b,{'showHidden':![],'depth':null}));});}else{logger[_0x72f0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x72f0('0x27'),_0x72f0('0x66'),_0x72f0('0x36'));}break;case _0x72f0('0x67'):if(_0x3cc8ce[_0x72f0('0x5c')]){var _0x51e263={};var _0x1f6367={'method':_0x72f0('0x31'),'uri':_0x72f0('0x68'),'headers':{'Authorization':'Bearer\x20'+_0x3cc8ce[_0x72f0('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x3cc8ce[_0x72f0('0x20')],'to':_0x46efd5[_0x72f0('0x20')],'text':_0x46efd5['body']},'json':!![]};return rp(_0x1f6367)[_0x72f0('0x15')](function(_0x20a342){if(_0x20a342[_0x72f0('0x69')]==0xca){_0x51e263[_0x72f0('0x6a')]=_0x20a342;var _0x49a6d6={'method':_0x72f0('0x31'),'uri':_0x72f0('0x6b'),'headers':{'Authorization':_0x72f0('0x6c')+_0x3cc8ce[_0x72f0('0x5c')],'Content-Type':_0x72f0('0x6d')},'body':{'refid':_0x51e263['message'][_0x72f0('0x6e')]},'json':!![]};return rp(_0x49a6d6)[_0x72f0('0x15')](function(_0x7d13c2){_0x51e263[_0x72f0('0x6f')]=_0x7d13c2;var _0x236df3={'messageId':_0x51e263['message']['refid'],'read':!![]};return _0xc0dafd[_0x72f0('0x16')](_0x236df3);});}else{return logger['error'](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x67'),util[_0x72f0('0x35')](_0x20a342,{'showHidden':![],'depth':null}));}})[_0x72f0('0x18')](function(_0x447058){return logger['error'](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x67'),util[_0x72f0('0x35')](_0x447058,{'showHidden':![],'depth':null}));});}else{return logger[_0x72f0('0x19')](_0x72f0('0x28'),_0x72f0('0x27'),_0x72f0('0x67'),_0x72f0('0x70'));}break;}}})[_0x72f0('0x71')](function(){_0xe43d8e();});}else{_0xe43d8e();}}},'charset':_0x72f0('0x72'),'collate':_0x72f0('0x73')});};
\ No newline at end of file
+var _0xa31a=['login?username=','&password=','split','POST','total_sent','internal_order_id','read','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','sort','length','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','type','twilio','accountSid','authToken','phone','messages','body','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/','password','smsMethod','sender'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa31a,0x131));var _0xaa31=function(_0x5737ee,_0x27c4e1){_0x5737ee=_0x5737ee-0x0;var _0x40feb4=_0xa31a[_0x5737ee];return _0x40feb4;};'use strict';var _=require(_0xaa31('0x0'));var util=require(_0xaa31('0x1'));var logger=require(_0xaa31('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaa31('0x3'));var rp=require(_0xaa31('0x4'));var fs=require('fs');var path=require(_0xaa31('0x5'));var rimraf=require(_0xaa31('0x6'));var config=require(_0xaa31('0x7'));var attributes=require(_0xaa31('0x8'));module[_0xaa31('0x9')]=function(_0x34174e,_0x3deea1){return _0x34174e[_0xaa31('0xa')](_0xaa31('0xb'),attributes,{'tableName':_0xaa31('0xc'),'paranoid':![],'indexes':[{'name':_0xaa31('0xd'),'fields':[_0xaa31('0xd')]},{'name':_0xaa31('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fed08,_0x367d97,_0x5021ac){var _0x270214=_0x34174e['models'];var _0x1d01d3=_0x4fed08[_0xaa31('0xf')]({'plain':!![]});if(_0x1d01d3[_0xaa31('0x10')][_0xaa31('0x11')]()==='in'||_0x1d01d3[_0xaa31('0x10')]['toLowerCase']()===_0xaa31('0x12')&&!_0x1d01d3[_0xaa31('0x13')]&&!_[_0xaa31('0x14')](_0x1d01d3[_0xaa31('0x15')])&&!_[_0xaa31('0x14')](_0x1d01d3[_0xaa31('0x16')])){_0x270214[_0xaa31('0x17')][_0xaa31('0x18')]({'where':{'id':_0x1d01d3[_0xaa31('0x16')]}})[_0xaa31('0x19')](function(_0xe8bfc6){if(_0xe8bfc6){_0xe8bfc6[_0xaa31('0x1a')]({'lastMsgAt':_0x1d01d3[_0xaa31('0x1b')],'lastMsgDirection':_0x1d01d3[_0xaa31('0x10')][_0xaa31('0x11')]()});}})[_0xaa31('0x1c')](function(_0x1878f3){console[_0xaa31('0x1d')](_0x1878f3);});}if(_0x1d01d3[_0xaa31('0x10')]===_0xaa31('0x12')&&!_0x1d01d3[_0xaa31('0x13')]){var _0x4cdb0a;_0x270214[_0xaa31('0x1e')]['find']({'where':{'id':_0x1d01d3['SmsAccountId']},'raw':!![]})[_0xaa31('0x19')](function(_0x31ba8e){_0x4cdb0a=_0x31ba8e;if(_0x4cdb0a&&_0x4cdb0a[_0xaa31('0x1f')]){switch(_0x4cdb0a[_0xaa31('0x1f')]){case _0xaa31('0x20'):var _0xd5b97d=require('twilio');if(_0x4cdb0a[_0xaa31('0x21')]&&_0x4cdb0a[_0xaa31('0x22')]&&_0x4cdb0a[_0xaa31('0x23')]){var _0x2d85b8=new _0xd5b97d(_0x4cdb0a[_0xaa31('0x21')],_0x4cdb0a[_0xaa31('0x22')]);_0x2d85b8[_0xaa31('0x24')]['create']({'body':_0x1d01d3[_0xaa31('0x25')],'to':_0x1d01d3[_0xaa31('0x23')],'from':_0x4cdb0a['phone'],'statusCallback':_0x4cdb0a[_0xaa31('0x26')]+_0xaa31('0x27')+_0x1d01d3['id']+_0xaa31('0x28')+_0x4cdb0a[_0xaa31('0x29')]})['then'](function(_0x5dd0f1){if(_0x5dd0f1['sid']){return _0x4fed08['update']({'messageId':_0x5dd0f1[_0xaa31('0x2a')]});}})['catch'](function(_0x3e997a){logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),'twilio',util[_0xaa31('0x2d')](_0x3e997a,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x20'),_0xaa31('0x2e'));}break;case _0xaa31('0x2f'):var _0x29b174=_0xaa31('0x30');if(_0x4cdb0a['username']&&_0x4cdb0a[_0xaa31('0x31')]){var _0x2aee5a={'recipient':[_0x1d01d3['phone']],'message':_0x1d01d3[_0xaa31('0x25')],'message_type':_0x4cdb0a[_0xaa31('0x32')]};if(_0x4cdb0a[_0xaa31('0x32')]&&_0x4cdb0a[_0xaa31('0x32')]!=='SI'){_0x2aee5a[_0xaa31('0x33')]=_0x4cdb0a[_0xaa31('0x23')];}var _0x58222a={'url':_0x29b174+_0xaa31('0x34')+_0x4cdb0a['username']+_0xaa31('0x35')+_0x4cdb0a[_0xaa31('0x31')],'method':'GET'};rp(_0x58222a)[_0xaa31('0x19')](function(_0x56e31e){var _0x476948=_0x56e31e[_0xaa31('0x36')](';');var _0x17711={'user_key':_0x476948[0x0],'session_key':_0x476948[0x1]};_0x58222a={'url':_0x29b174+'sms','method':_0xaa31('0x37'),'headers':{'user_key':_0x17711['user_key'],'Session_key':_0x17711['session_key']},'json':!![],'body':_0x2aee5a};return rp(_0x58222a);})['then'](function(_0x10b53c){if(_0x10b53c[_0xaa31('0x38')]>=0x1){var _0x109156={'messageId':_0x10b53c[_0xaa31('0x39')]};if(_0x4cdb0a[_0xaa31('0x32')]!=='GP'||!_0x4cdb0a['deliveryReport']){_0x109156[_0xaa31('0x3a')]=!![];}return _0x4fed08[_0xaa31('0x1a')](_0x109156);}else{return logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x2f'),util[_0xaa31('0x2d')](_0x10b53c,{'showHidden':![],'depth':null}));}})[_0xaa31('0x1c')](function(_0x1fccde){return logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x2f'),util['inspect'](_0x1fccde,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x4cdb0a[_0xaa31('0x22')]){var _0x11f80a={'recipient':_0x1d01d3[_0xaa31('0x23')],'message':_0x1d01d3['body'],'sender':_0x4cdb0a[_0xaa31('0x3b')]||_0x4cdb0a[_0xaa31('0x23')],'authorization':_0x4cdb0a[_0xaa31('0x22')]};var _0x367d97={'method':_0xaa31('0x37'),'uri':_0xaa31('0x3c'),'body':_0x11f80a,'json':!![]};rp(_0x367d97)[_0xaa31('0x19')](function(_0x17edbe){var _0x41e3db={'messageId':_0x17edbe[_0xaa31('0x3d')]};if(!_0x4cdb0a[_0xaa31('0x3e')]){_0x41e3db[_0xaa31('0x3a')]=!![];}return _0x4fed08[_0xaa31('0x1a')](_0x41e3db);})[_0xaa31('0x1c')](function(_0x142d77){logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaa31('0x3f'),util[_0xaa31('0x2d')](_0x142d77,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x3f'),_0xaa31('0x40'));}break;case _0xaa31('0x41'):if(_0x4cdb0a[_0xaa31('0x42')]&&_0x4cdb0a[_0xaa31('0x31')]){var _0x11f80a={'messages':[{'source':_0xaa31('0x43'),'to':_0x1d01d3[_0xaa31('0x23')],'body':_0x1d01d3[_0xaa31('0x25')],'from':_0x4cdb0a[_0xaa31('0x3b')]||_0x4cdb0a[_0xaa31('0x23')]}]};var _0xc6ff4f=util[_0xaa31('0x44')](_0xaa31('0x45'),_0x4cdb0a[_0xaa31('0x42')],_0x4cdb0a['password']);var _0x367d97={'method':_0xaa31('0x37'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x11f80a,'headers':{'Authorization':util[_0xaa31('0x44')](_0xaa31('0x46'),new Buffer(_0xc6ff4f)[_0xaa31('0x47')](_0xaa31('0x48')))},'json':!![]};rp(_0x367d97)['then'](function(_0x4ca831){if(_0x4ca831[_0xaa31('0x49')]>=0xc8&&_0x4ca831['http_code']<=0xce){if(_0x4ca831['data']&&_0x4ca831[_0xaa31('0x4a')][_0xaa31('0x4b')]>0x0){var _0x2a0e57=_[_0xaa31('0x4c')](_0x4ca831[_0xaa31('0x4a')][_0xaa31('0x24')]);var _0x44f28c={'messageId':_0x2a0e57[_0xaa31('0x4d')]};if(!_0x4cdb0a[_0xaa31('0x3e')]){_0x44f28c['read']=!![];}return _0x4fed08['update'](_0x44f28c);}else{logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),'clickSend',util[_0xaa31('0x2d')](_0x4ca831,{'showHidden':![],'depth':null}));}}else{logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),'clickSend',util[_0xaa31('0x2d')](_0x4ca831,{'showHidden':![],'depth':null}));}})['catch'](function(_0x56d1d5){logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x4e'),util[_0xaa31('0x2d')](_0x56d1d5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x4e'),_0xaa31('0x4f'));}break;case _0xaa31('0x50'):if(_0x4cdb0a[_0xaa31('0x51')]&&_0x4cdb0a[_0xaa31('0x22')]){var _0x11f80a={'dst':_0x1d01d3[_0xaa31('0x23')],'text':_0x1d01d3['body'],'src':_0x4cdb0a[_0xaa31('0x3b')]||_0x4cdb0a['phone'],'url':_0x4cdb0a[_0xaa31('0x26')]+_0xaa31('0x27')+_0x1d01d3['id']+'/status?token='+_0x4cdb0a['token']};var _0xc6ff4f=util[_0xaa31('0x44')](_0xaa31('0x45'),_0x4cdb0a[_0xaa31('0x51')],_0x4cdb0a[_0xaa31('0x22')]);var _0x367d97={'method':_0xaa31('0x37'),'uri':util[_0xaa31('0x44')](_0xaa31('0x52'),_0x4cdb0a[_0xaa31('0x51')]),'body':_0x11f80a,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xc6ff4f)['toString'](_0xaa31('0x48')))},'json':!![]};rp(_0x367d97)[_0xaa31('0x19')](function(_0x482842){var _0x30e045={'messageId':_0x482842[_0xaa31('0x53')][0x0]};return _0x4fed08[_0xaa31('0x1a')](_0x30e045);})[_0xaa31('0x1c')](function(_0x269499){logger['error'](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x50'),util[_0xaa31('0x2d')](_0x269499,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x50'),_0xaa31('0x54'));}break;case _0xaa31('0x55'):if(_0x4cdb0a['username']&&_0x4cdb0a[_0xaa31('0x31')]){if(_0x4cdb0a[_0xaa31('0x56')]){var _0x46c2b6={'method':_0xaa31('0x37'),'uri':_0x4cdb0a[_0xaa31('0x56')]+_0xaa31('0x57'),'body':{'username':_0x4cdb0a[_0xaa31('0x42')],'password':_0x4cdb0a[_0xaa31('0x31')]},'json':!![]};return rp(_0x46c2b6)[_0xaa31('0x19')](function(_0x26b8fb){var _0x26abf8={'method':_0xaa31('0x37'),'uri':_0x4cdb0a[_0xaa31('0x56')]+_0xaa31('0x58'),'body':{'messages':[{'from':_0x4cdb0a[_0xaa31('0x23')],'destinations':[{'to':_0x1d01d3['phone']}],'text':_0x1d01d3['body'],'notifyUrl':_0x4cdb0a[_0xaa31('0x26')]+_0xaa31('0x27')+_0x1d01d3['id']+_0xaa31('0x28')+_0x4cdb0a[_0xaa31('0x29')],'notifyContentType':_0xaa31('0x59'),'callbackData':_0x4cdb0a[_0xaa31('0x23')]+';'+_0x1d01d3[_0xaa31('0x25')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x26b8fb[_0xaa31('0x29')]},'json':!![]};return rp(_0x26abf8)[_0xaa31('0x19')](function(_0x2cd5cd){if(_0x2cd5cd[_0xaa31('0x24')]){var _0x5e4362={'messageId':_0x2cd5cd['messages'][0x0][_0xaa31('0xd')]};if(!_0x4cdb0a['deliveryReport']){_0x5e4362[_0xaa31('0x3a')]=!![];}return _0x4fed08[_0xaa31('0x1a')](_0x5e4362);}else{return logger['error'](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x55'),util[_0xaa31('0x2d')](_0x2cd5cd,{'showHidden':![],'depth':null}));}});})[_0xaa31('0x1c')](function(_0x23f116){return logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x55'),util[_0xaa31('0x2d')](_0x23f116,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x55'),_0xaa31('0x5a'));}}else{logger[_0xaa31('0x1d')](_0xaa31('0x2b'),'afterCreate',_0xaa31('0x55'),_0xaa31('0x4f'));}break;case _0xaa31('0x5b'):var _0x2f8f7d=require('crypto');if(_0x4cdb0a[_0xaa31('0x5c')]){var _0xdb552b={};_0xdb552b['login']=_0x4cdb0a['username'];_0xdb552b[_0xaa31('0x23')]=_0x1d01d3[_0xaa31('0x23')];_0xdb552b[_0xaa31('0x33')]=_0x4cdb0a[_0xaa31('0x23')];_0xdb552b[_0xaa31('0x5d')]=_0x1d01d3[_0xaa31('0x25')];_0xdb552b[_0xaa31('0x5e')]=+new Date();var _0x13bef9='';var _0x3cc376='';var _0x57593e=Object[_0xaa31('0x5f')](_0xdb552b);_0x57593e[_0xaa31('0x60')]();for(var _0x19b0e3=0x0;_0x19b0e3<_0x57593e[_0xaa31('0x61')];_0x19b0e3++){if(_0x13bef9!=''){_0x13bef9+='&';}_0x13bef9+=_0x57593e[_0x19b0e3]+'='+encodeURIComponent(_0xdb552b[_0x57593e[_0x19b0e3]]);_0x3cc376+=_0xdb552b[_0x57593e[_0x19b0e3]];}_0x3cc376+=_0x4cdb0a[_0xaa31('0x5c')];_0x3cc376=_0x2f8f7d['createHash']('md5')[_0xaa31('0x1a')](_0x3cc376)[_0xaa31('0x62')](_0xaa31('0x63'));if(_0x13bef9!==''){_0x13bef9+='&';}_0x13bef9+=_0xaa31('0x64')+_0x3cc376;var _0x58222a={'method':'GET','uri':_0x4cdb0a[_0xaa31('0x56')]+'/external/get/send.php?'+_0x13bef9,'json':!![]};return rp(_0x58222a)[_0xaa31('0x19')](function(_0x1aeefa){var _0x59f3c3=Object[_0xaa31('0x5f')](_0x1aeefa);if(_0x1aeefa[_0x59f3c3[0x0]][_0xaa31('0x1d')]&&parseInt(_0x1aeefa[_0x59f3c3[0x0]]['error'])===0x0){var _0x405e1f={'messageId':_0x1aeefa[_0x59f3c3[0x0]][_0xaa31('0x65')]};if(!_0x4cdb0a['deliveryReport']){_0x405e1f['read']=!![];}return _0x4fed08[_0xaa31('0x1a')](_0x405e1f);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x5b'),util[_0xaa31('0x2d')](_0x1aeefa['error'],{'showHidden':![],'depth':null}));}})[_0xaa31('0x1c')](function(_0xcf85de){return logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x5b'),util[_0xaa31('0x2d')](_0xcf85de,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),_0xaa31('0x5b'),_0xaa31('0x66'));}break;case'clickatell':if(_0x4cdb0a[_0xaa31('0x5c')]){var _0x347a9b={'method':_0xaa31('0x37'),'uri':_0xaa31('0x67'),'headers':{'Authorization':_0x4cdb0a[_0xaa31('0x5c')]},'body':{'content':_0x1d01d3[_0xaa31('0x25')],'to':[_0x1d01d3[_0xaa31('0x23')]],'from':_0x4cdb0a[_0xaa31('0x23')],'binary':![],'clientMessageId':_0xaa31('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x347a9b)['then'](function(_0x169f36){if(!_0x169f36['error']){var _0x3534ab={'messageId':_0x169f36['messages'][0x0][_0xaa31('0x69')]};if(!_0x4cdb0a[_0xaa31('0x3e')]){_0x3534ab['read']=!![];}return _0x4fed08[_0xaa31('0x1a')](_0x3534ab);}else{return logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa31('0x2c'),'clickatell',util[_0xaa31('0x2d')](_0x169f36['error'],{'showHidden':![],'depth':null}));}})[_0xaa31('0x1c')](function(_0x502cf8){return logger[_0xaa31('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaa31('0x6a'),util[_0xaa31('0x2d')](_0x502cf8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaa31('0x6a'),_0xaa31('0x66'));}break;case _0xaa31('0x6b'):if(_0x4cdb0a[_0xaa31('0x42')]&&_0x4cdb0a[_0xaa31('0x31')]){var _0xc6ff4f=util[_0xaa31('0x44')](_0xaa31('0x45'),_0x4cdb0a[_0xaa31('0x42')],_0x4cdb0a['password']);var _0x367d97={'method':_0xaa31('0x37'),'uri':_0xaa31('0x6c')+_0x4cdb0a['accountId']+_0xaa31('0x6d'),'body':{'to':[_0x1d01d3['phone']],'text':_0x1d01d3['body'],'from':_0x4cdb0a['phone'],'applicationId':_0x4cdb0a[_0xaa31('0x6e')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xc6ff4f)[_0xaa31('0x47')](_0xaa31('0x48')))},'json':!![]};rp(_0x367d97)[_0xaa31('0x19')](function(_0x25bcfd){if(_0x25bcfd['id']){var _0x45a7bb={'messageId':_0x25bcfd['id']};return _0x4fed08[_0xaa31('0x1a')](_0x45a7bb);}else{logger['error'](_0xaa31('0x2b'),_0xaa31('0x2c'),'bandwidth',util[_0xaa31('0x2d')](_0x25bcfd,{'showHidden':![],'depth':null}));}})[_0xaa31('0x1c')](function(_0x4a32a1){logger[_0xaa31('0x1d')](_0xaa31('0x2b'),'afterCreate',_0xaa31('0x6b'),util[_0xaa31('0x2d')](_0x4a32a1,{'showHidden':![],'depth':null}));});}else{logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xaa31('0x6f'):if(_0x4cdb0a['apiKey']){var _0x567d1b={};var _0x58222a={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xaa31('0x70')+_0x4cdb0a[_0xaa31('0x5c')],'Content-Type':_0xaa31('0x59')},'body':{'from':_0x4cdb0a[_0xaa31('0x23')],'to':_0x1d01d3[_0xaa31('0x23')],'text':_0x1d01d3['body']},'json':!![]};return rp(_0x58222a)[_0xaa31('0x19')](function(_0x2e8f17){if(_0x2e8f17['code']==0xca){_0x567d1b[_0xaa31('0x71')]=_0x2e8f17;var _0x27f747={'method':_0xaa31('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xaa31('0x70')+_0x4cdb0a[_0xaa31('0x5c')],'Content-Type':_0xaa31('0x59')},'body':{'refid':_0x567d1b[_0xaa31('0x71')][_0xaa31('0x72')]},'json':!![]};return rp(_0x27f747)[_0xaa31('0x19')](function(_0x5761ab){_0x567d1b['status']=_0x5761ab;var _0x1484c8={'messageId':_0x567d1b[_0xaa31('0x71')][_0xaa31('0x72')],'read':!![]};return _0x4fed08[_0xaa31('0x1a')](_0x1484c8);});}else{return logger[_0xaa31('0x1d')](_0xaa31('0x2b'),'afterCreate',_0xaa31('0x6f'),util[_0xaa31('0x2d')](_0x2e8f17,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1bf310){return logger['error'](_0xaa31('0x2b'),'afterCreate',_0xaa31('0x6f'),util[_0xaa31('0x2d')](_0x1bf310,{'showHidden':![],'depth':null}));});}else{return logger[_0xaa31('0x1d')](_0xaa31('0x2b'),_0xaa31('0x2c'),_0xaa31('0x6f'),_0xaa31('0x73'));}break;}}})[_0xaa31('0x74')](function(){_0x5021ac();});}else{_0x5021ac();}}},'charset':_0xaa31('0x75'),'collate':_0xaa31('0x76')});};
\ No newline at end of file
index ca4bcd5..5569243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c2=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x28cab7,_0x30dad1){var _0xc4ab0d=function(_0x390f0b){while(--_0x390f0b){_0x28cab7['push'](_0x28cab7['shift']());}};_0xc4ab0d(++_0x30dad1);}(_0x49c2,0x1b9));var _0x249c=function(_0x254856,_0x3328f5){_0x254856=_0x254856-0x0;var _0x230310=_0x49c2[_0x254856];return _0x230310;};'use strict';var _=require(_0x249c('0x0'));var util=require(_0x249c('0x1'));var moment=require(_0x249c('0x2'));var BPromise=require(_0x249c('0x3'));var rs=require(_0x249c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x249c('0x5'))['db'];var utils=require(_0x249c('0x6'));var logger=require(_0x249c('0x7'))('rpc');var config=require(_0x249c('0x8'));var jayson=require(_0x249c('0x9'));var client=jayson['client'][_0x249c('0xa')]({'port':0x232a});config[_0x249c('0xb')]=_[_0x249c('0xc')](config[_0x249c('0xb')],{'host':_0x249c('0xd'),'port':0x18eb});var socket=require(_0x249c('0xe'))(new Redis(config[_0x249c('0xb')]));require('./smsMessage.socket')[_0x249c('0xf')](socket);function respondWithRpcPromise(_0x12963b,_0xbe7aa0,_0x5ef47e){return new BPromise(function(_0x3254ba,_0x5e920f){return client['request'](_0x12963b,_0x5ef47e)[_0x249c('0x10')](function(_0x560400){logger[_0x249c('0x11')]('SmsMessage,\x20%s,\x20%s',_0xbe7aa0,_0x249c('0x12'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbe7aa0,'request\x20sent',JSON[_0x249c('0x13')](_0x560400));if(_0x560400[_0x249c('0x14')]){if(_0x560400[_0x249c('0x14')][_0x249c('0x15')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xbe7aa0,_0x560400[_0x249c('0x14')][_0x249c('0x16')]);return _0x5e920f(_0x560400[_0x249c('0x14')][_0x249c('0x16')]);}logger[_0x249c('0x14')]('SmsMessage,\x20%s,\x20%s',_0xbe7aa0,_0x560400[_0x249c('0x14')][_0x249c('0x16')]);return _0x3254ba(_0x560400[_0x249c('0x14')]['message']);}else{logger[_0x249c('0x11')]('SmsMessage,\x20%s,\x20%s',_0xbe7aa0,_0x249c('0x12'));_0x3254ba(_0x560400[_0x249c('0x17')]['message']);}})[_0x249c('0x18')](function(_0x2aaaf8){logger[_0x249c('0x14')]('SmsMessage,\x20%s,\x20%s',_0xbe7aa0,_0x2aaaf8);_0x5e920f(_0x2aaaf8);});});}exports[_0x249c('0x19')]=function(_0x298766){var _0x376c57=this;return new Promise(function(_0x12304f,_0x2884b4){return db[_0x249c('0x1a')][_0x249c('0x1b')](_0x298766[_0x249c('0x1c')],{'raw':_0x298766[_0x249c('0x1d')]?_0x298766['options'][_0x249c('0x1e')]===undefined?!![]:![]:!![]})[_0x249c('0x10')](function(_0x2b79fe){logger[_0x249c('0x11')](_0x249c('0x19'),_0x298766);logger[_0x249c('0x1f')](_0x249c('0x19'),_0x298766,JSON[_0x249c('0x13')](_0x2b79fe));_0x12304f(_0x2b79fe);})[_0x249c('0x18')](function(_0x548472){logger[_0x249c('0x14')](_0x249c('0x19'),_0x548472[_0x249c('0x16')],_0x298766);_0x2884b4(_0x376c57[_0x249c('0x14')](0x1f4,_0x548472[_0x249c('0x16')]));});});};
\ No newline at end of file
+var _0x0fa7=['result','catch','body','options','raw','CreateSmsMessage','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x247d6d,_0x54a523){var _0x18a02d=function(_0x202a64){while(--_0x202a64){_0x247d6d['push'](_0x247d6d['shift']());}};_0x18a02d(++_0x54a523);}(_0x0fa7,0x128));var _0x70fa=function(_0xc54580,_0x42850c){_0xc54580=_0xc54580-0x0;var _0x3f1dbc=_0x0fa7[_0xc54580];return _0x3f1dbc;};'use strict';var _=require('lodash');var util=require(_0x70fa('0x0'));var moment=require(_0x70fa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70fa('0x2'));var db=require(_0x70fa('0x3'))['db'];var utils=require(_0x70fa('0x4'));var logger=require(_0x70fa('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x70fa('0x6')][_0x70fa('0x7')]({'port':0x232a});config[_0x70fa('0x8')]=_[_0x70fa('0x9')](config[_0x70fa('0x8')],{'host':_0x70fa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70fa('0x8')]));require(_0x70fa('0xb'))[_0x70fa('0xc')](socket);function respondWithRpcPromise(_0xf9ff2f,_0xbf2d0d,_0x477d46){return new BPromise(function(_0x5499d8,_0x1fe726){return client[_0x70fa('0xd')](_0xf9ff2f,_0x477d46)['then'](function(_0x52a88e){logger[_0x70fa('0xe')](_0x70fa('0xf'),_0xbf2d0d,_0x70fa('0x10'));logger[_0x70fa('0x11')](_0x70fa('0x12'),_0xbf2d0d,_0x70fa('0x10'),JSON[_0x70fa('0x13')](_0x52a88e));if(_0x52a88e[_0x70fa('0x14')]){if(_0x52a88e[_0x70fa('0x14')][_0x70fa('0x15')]===0x1f4){logger[_0x70fa('0x14')](_0x70fa('0xf'),_0xbf2d0d,_0x52a88e['error'][_0x70fa('0x16')]);return _0x1fe726(_0x52a88e['error'][_0x70fa('0x16')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0xbf2d0d,_0x52a88e[_0x70fa('0x14')][_0x70fa('0x16')]);return _0x5499d8(_0x52a88e[_0x70fa('0x14')][_0x70fa('0x16')]);}else{logger[_0x70fa('0xe')](_0x70fa('0xf'),_0xbf2d0d,_0x70fa('0x10'));_0x5499d8(_0x52a88e[_0x70fa('0x17')][_0x70fa('0x16')]);}})[_0x70fa('0x18')](function(_0x2ca539){logger[_0x70fa('0x14')](_0x70fa('0xf'),_0xbf2d0d,_0x2ca539);_0x1fe726(_0x2ca539);});});}exports['CreateSmsMessage']=function(_0x3914bf){var _0x56c7c5=this;return new Promise(function(_0x38a123,_0x155d19){return db['SmsMessage']['create'](_0x3914bf[_0x70fa('0x19')],{'raw':_0x3914bf[_0x70fa('0x1a')]?_0x3914bf[_0x70fa('0x1a')][_0x70fa('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2d37b6){logger['info'](_0x70fa('0x1c'),_0x3914bf);logger[_0x70fa('0x11')](_0x70fa('0x1c'),_0x3914bf,JSON[_0x70fa('0x13')](_0x2d37b6));_0x38a123(_0x2d37b6);})[_0x70fa('0x18')](function(_0x5d61f3){logger[_0x70fa('0x14')](_0x70fa('0x1c'),_0x5d61f3[_0x70fa('0x16')],_0x3914bf);_0x155d19(_0x56c7c5[_0x70fa('0x14')](0x1f4,_0x5d61f3['message']));});});};
\ No newline at end of file
index 1782c22..e9e1d21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d9=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x123935,_0x1670ba){var _0x1a8ebf=function(_0xa6933e){while(--_0xa6933e){_0x123935['push'](_0x123935['shift']());}};_0x1a8ebf(++_0x1670ba);}(_0x50d9,0xb7));var _0x950d=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x50d9[_0x187ee1];return _0x388160;};'use strict';var SmsMessageEvents=require(_0x950d('0x0'));var events=[_0x950d('0x1'),_0x950d('0x2'),_0x950d('0x3')];function createListener(_0x1a42e1,_0x4e4415){return function(_0x8cd31b){_0x4e4415[_0x950d('0x4')](_0x1a42e1,_0x8cd31b);};}function removeListener(_0x531875,_0x98f9d3){return function(){SmsMessageEvents[_0x950d('0x5')](_0x531875,_0x98f9d3);};}exports[_0x950d('0x6')]=function(_0x3880ce){for(var _0x2cb516=0x0,_0x4b9990=events[_0x950d('0x7')];_0x2cb516<_0x4b9990;_0x2cb516++){var _0x30a469=events[_0x2cb516];var _0x1b074d=createListener(_0x950d('0x8')+_0x30a469,_0x3880ce);SmsMessageEvents['on'](_0x30a469,_0x1b074d);}};
\ No newline at end of file
+var _0x15ad=['smsMessage:','./smsMessage.events','remove','update','emit','removeListener'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x15ad,0x187));var _0xd15a=function(_0x38dcd7,_0x4e0e92){_0x38dcd7=_0x38dcd7-0x0;var _0x3def7d=_0x15ad[_0x38dcd7];return _0x3def7d;};'use strict';var SmsMessageEvents=require(_0xd15a('0x0'));var events=['save',_0xd15a('0x1'),_0xd15a('0x2')];function createListener(_0x5f0929,_0x243f93){return function(_0x1f5832){_0x243f93[_0xd15a('0x3')](_0x5f0929,_0x1f5832);};}function removeListener(_0x5ca839,_0x692fbe){return function(){SmsMessageEvents[_0xd15a('0x4')](_0x5ca839,_0x692fbe);};}exports['register']=function(_0x6e2039){for(var _0x1e4bbc=0x0,_0x38d95d=events['length'];_0x1e4bbc<_0x38d95d;_0x1e4bbc++){var _0x13388e=events[_0x1e4bbc];var _0x22ec87=createListener(_0xd15a('0x5')+_0x13388e,_0x6e2039);SmsMessageEvents['on'](_0x13388e,_0x22ec87);}};
\ No newline at end of file
index 458c86f..b6ee50c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534b=['removeAgents','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x534b,0x161));var _0xb534=function(_0x20b1eb,_0x20924d){_0x20b1eb=_0x20b1eb-0x0;var _0x21becb=_0x534b[_0x20b1eb];return _0x21becb;};'use strict';var multer=require('multer');var util=require(_0xb534('0x0'));var path=require('path');var timeout=require(_0xb534('0x1'));var express=require(_0xb534('0x2'));var router=express['Router']();var fs_extra=require(_0xb534('0x3'));var auth=require(_0xb534('0x4'));var interaction=require(_0xb534('0x5'));var config=require('../../config/environment');var controller=require(_0xb534('0x6'));router[_0xb534('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb534('0x7')](_0xb534('0x8'),auth['isAuthenticated'](),controller[_0xb534('0x9')]);router['get'](_0xb534('0xa'),auth[_0xb534('0xb')](),controller[_0xb534('0xc')]);router[_0xb534('0x7')](_0xb534('0xd'),auth['isAuthenticated'](),controller[_0xb534('0xe')]);router[_0xb534('0x7')](_0xb534('0xf'),auth[_0xb534('0xb')](),controller['getTeams']);router[_0xb534('0x7')](_0xb534('0x10'),auth[_0xb534('0xb')](),controller[_0xb534('0x11')]);router[_0xb534('0x12')]('/',auth[_0xb534('0xb')](),controller[_0xb534('0x13')]);router['post']('/:id/teams',auth[_0xb534('0xb')](),controller['addTeams']);router['post']('/:id/users',auth[_0xb534('0xb')](),controller[_0xb534('0x14')]);router[_0xb534('0x15')](_0xb534('0xa'),auth['isAuthenticated'](),controller[_0xb534('0x16')]);router['delete']('/:id',auth[_0xb534('0xb')](),controller[_0xb534('0x17')]);router[_0xb534('0x18')](_0xb534('0xf'),auth[_0xb534('0xb')](),controller['removeTeams']);router[_0xb534('0x18')](_0xb534('0x10'),auth[_0xb534('0xb')](),controller[_0xb534('0x19')]);module[_0xb534('0x1a')]=router;
\ No newline at end of file
+var _0xb704=['util','connect-timeout','express','../../components/interaction/service','./smsQueue.controller','index','get','describe','isAuthenticated','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','delete','/:id','destroy','/:id/teams','removeTeams','removeAgents'];(function(_0x578c66,_0x3e090f){var _0x586aa2=function(_0x33291a){while(--_0x33291a){_0x578c66['push'](_0x578c66['shift']());}};_0x586aa2(++_0x3e090f);}(_0xb704,0xd0));var _0x4b70=function(_0x2d385e,_0x5e5b55){_0x2d385e=_0x2d385e-0x0;var _0x536b24=_0xb704[_0x2d385e];return _0x536b24;};'use strict';var multer=require('multer');var util=require(_0x4b70('0x0'));var path=require('path');var timeout=require(_0x4b70('0x1'));var express=require(_0x4b70('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b70('0x3'));var config=require('../../config/environment');var controller=require(_0x4b70('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x4b70('0x5')]);router[_0x4b70('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4b70('0x7')]);router['get']('/:id',auth[_0x4b70('0x8')](),controller[_0x4b70('0x9')]);router[_0x4b70('0x6')](_0x4b70('0xa'),auth[_0x4b70('0x8')](),controller[_0x4b70('0xb')]);router[_0x4b70('0x6')]('/:id/teams',auth[_0x4b70('0x8')](),controller[_0x4b70('0xc')]);router[_0x4b70('0x6')]('/:id/users',auth[_0x4b70('0x8')](),controller[_0x4b70('0xd')]);router[_0x4b70('0xe')]('/',auth[_0x4b70('0x8')](),controller[_0x4b70('0xf')]);router['post']('/:id/teams',auth[_0x4b70('0x8')](),controller[_0x4b70('0x10')]);router[_0x4b70('0xe')](_0x4b70('0x11'),auth[_0x4b70('0x8')](),controller['addAgents']);router[_0x4b70('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4b70('0x13')]);router[_0x4b70('0x14')](_0x4b70('0x15'),auth[_0x4b70('0x8')](),controller[_0x4b70('0x16')]);router[_0x4b70('0x14')](_0x4b70('0x17'),auth[_0x4b70('0x8')](),controller[_0x4b70('0x18')]);router[_0x4b70('0x14')]('/:id/users',auth[_0x4b70('0x8')](),controller[_0x4b70('0x19')]);module['exports']=router;
\ No newline at end of file
index 5b69f1a..24ffc9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd51a=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd51a,0x156));var _0xad51=function(_0x4c77fa,_0x280854){_0x4c77fa=_0x4c77fa-0x0;var _0x3277fe=_0xd51a[_0x4c77fa];return _0x3277fe;};'use strict';var Sequelize=require(_0xad51('0x0'));module[_0xad51('0x1')]={'name':{'type':Sequelize[_0xad51('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xad51('0x2')]},'timeout':{'type':Sequelize[_0xad51('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xad51('0x4')](_0xad51('0x5'),'beepall',_0xad51('0x6'))}};
\ No newline at end of file
+var _0x063b=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1d2dc6,_0x47f0f8){var _0x4129f2=function(_0x232f21){while(--_0x232f21){_0x1d2dc6['push'](_0x1d2dc6['shift']());}};_0x4129f2(++_0x47f0f8);}(_0x063b,0x138));var _0xb063=function(_0x438449,_0x566baf){_0x438449=_0x438449-0x0;var _0x291dc9=_0x063b[_0x438449];return _0x291dc9;};'use strict';var Sequelize=require(_0xb063('0x0'));module[_0xb063('0x1')]={'name':{'type':Sequelize[_0xb063('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb063('0x2')]},'timeout':{'type':Sequelize[_0xb063('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb063('0x4')](_0xb063('0x5'),_0xb063('0x6'),_0xb063('0x7'))}};
\ No newline at end of file
index 24d8a7c..43069a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eeb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','stack','name','send','index','SmsQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserSmsQueue','hasOwnProperty','order','SmsQueueId','findAndCountAll','UserId','agent','smsPause','createdAt','updatedAt','findOne','Team','rawAttributes','getTeams','addTeams','ids','voicePause','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','User','Agents','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','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse'];(function(_0x4b6c91,_0x462859){var _0x386d0a=function(_0x5b0366){while(--_0x5b0366){_0x4b6c91['push'](_0x4b6c91['shift']());}};_0x386d0a(++_0x462859);}(_0x2eeb,0x80));var _0xb2ee=function(_0x3a4d28,_0x3c5eda){_0x3a4d28=_0x3a4d28-0x0;var _0x32c5bd=_0x2eeb[_0x3a4d28];return _0x32c5bd;};'use strict';var emlformat=require(_0xb2ee('0x0'));var rimraf=require(_0xb2ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2ee('0x2'));var rp=require(_0xb2ee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb2ee('0x4'));var util=require(_0xb2ee('0x5'));var path=require(_0xb2ee('0x6'));var sox=require(_0xb2ee('0x7'));var csv=require(_0xb2ee('0x8'));var ejs=require(_0xb2ee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb2ee('0xa'));var crypto=require(_0xb2ee('0xb'));var jsforce=require(_0xb2ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2ee('0xd'));var Papa=require(_0xb2ee('0xe'));var Redis=require(_0xb2ee('0xf'));var authService=require(_0xb2ee('0x10'));var qs=require(_0xb2ee('0x11'));var as=require(_0xb2ee('0x12'));var hardwareService=require(_0xb2ee('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb2ee('0x14'));var config=require(_0xb2ee('0x15'));var licenseUtil=require(_0xb2ee('0x16'));var db=require(_0xb2ee('0x17'))['db'];config[_0xb2ee('0x18')]=_[_0xb2ee('0x19')](config[_0xb2ee('0x18')],{'host':_0xb2ee('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb2ee('0x18')]));require(_0xb2ee('0x1b'))[_0xb2ee('0x1c')](socket);function respondWithStatusCode(_0x4e34a8,_0x1d36c7){_0x1d36c7=_0x1d36c7||0xcc;return function(_0x53b1c0){if(_0x53b1c0){return _0x4e34a8[_0xb2ee('0x1d')](_0x1d36c7);}return _0x4e34a8[_0xb2ee('0x1e')](_0x1d36c7)[_0xb2ee('0x1f')]();};}function respondWithResult(_0x126102,_0x282ef6){_0x282ef6=_0x282ef6||0xc8;return function(_0x16dfef){if(_0x16dfef){return _0x126102[_0xb2ee('0x1e')](_0x282ef6)[_0xb2ee('0x20')](_0x16dfef);}};}function respondWithFilteredResult(_0x559500,_0xbd21a8){return function(_0x5f4634){if(_0x5f4634){var _0x4c1581=typeof _0xbd21a8[_0xb2ee('0x21')]==='undefined'&&typeof _0xbd21a8[_0xb2ee('0x22')]===_0xb2ee('0x23');var _0x511762=_0x5f4634[_0xb2ee('0x24')];var _0x46621c=_0x4c1581?0x0:_0xbd21a8[_0xb2ee('0x21')];var _0x3073a8=_0x4c1581?_0x5f4634[_0xb2ee('0x24')]:_0xbd21a8[_0xb2ee('0x21')]+_0xbd21a8['limit'];var _0x23a7eb;if(_0x3073a8>=_0x511762){_0x3073a8=_0x511762;_0x23a7eb=0xc8;}else{_0x23a7eb=0xce;}_0x559500[_0xb2ee('0x1e')](_0x23a7eb);return _0x559500[_0xb2ee('0x25')](_0xb2ee('0x26'),_0x46621c+'-'+_0x3073a8+'/'+_0x511762)[_0xb2ee('0x20')](_0x5f4634);}return null;};}function patchUpdates(_0x1fc03a){return function(_0x42e808){try{jsonpatch[_0xb2ee('0x27')](_0x42e808,_0x1fc03a,!![]);}catch(_0x3e067e){return BPromise[_0xb2ee('0x28')](_0x3e067e);}return _0x42e808[_0xb2ee('0x29')]();};}function saveUpdates(_0x4a9da6,_0x2002a3){return function(_0x41a315){if(_0x41a315){return _0x41a315[_0xb2ee('0x2a')](_0x4a9da6)[_0xb2ee('0x2b')](function(_0x1522af){return _0x1522af;});}return null;};}function removeEntity(_0x11b8e7,_0x352367){return function(_0x5c7f38){if(_0x5c7f38){return _0x5c7f38[_0xb2ee('0x2c')]()[_0xb2ee('0x2b')](function(){var _0x1ba5ef=_0x5c7f38[_0xb2ee('0x2d')]({'plain':!![]});var _0x127708=_0xb2ee('0x2e');return db['UserProfileResource'][_0xb2ee('0x2c')]({'where':{'type':_0x127708,'resourceId':_0x1ba5ef['id']}})[_0xb2ee('0x2b')](function(){return _0x5c7f38;});})['then'](function(){_0x11b8e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4771ee,_0x53b30f){return function(_0x45919a){if(!_0x45919a){_0x4771ee[_0xb2ee('0x1d')](0x194);}return _0x45919a;};}function handleError(_0x4d56ec,_0x4a4329){_0x4a4329=_0x4a4329||0x1f4;return function(_0x2c524f){logger['error'](_0x2c524f[_0xb2ee('0x2f')]);if(_0x2c524f[_0xb2ee('0x30')]){delete _0x2c524f[_0xb2ee('0x30')];}_0x4d56ec[_0xb2ee('0x1e')](_0x4a4329)[_0xb2ee('0x31')](_0x2c524f);};}exports[_0xb2ee('0x32')]=function(_0x2121a8,_0xef88e6){var _0x5a1db3={},_0x25e75d={},_0x2b2fdd={'count':0x0,'rows':[]};var _0xcd5cd=_['map'](db[_0xb2ee('0x33')]['rawAttributes'],function(_0x4420e4){return{'name':_0x4420e4[_0xb2ee('0x34')],'type':_0x4420e4[_0xb2ee('0x35')][_0xb2ee('0x36')]};});_0x25e75d[_0xb2ee('0x37')]=_['map'](_0xcd5cd,_0xb2ee('0x30'));_0x25e75d[_0xb2ee('0x38')]=_[_0xb2ee('0x39')](_0x2121a8[_0xb2ee('0x38')]);_0x25e75d[_0xb2ee('0x3a')]=_[_0xb2ee('0x3b')](_0x25e75d[_0xb2ee('0x37')],_0x25e75d[_0xb2ee('0x38')]);_0x5a1db3[_0xb2ee('0x3c')]=_[_0xb2ee('0x3b')](_0x25e75d['model'],qs['fields'](_0x2121a8[_0xb2ee('0x38')][_0xb2ee('0x3d')]));_0x5a1db3[_0xb2ee('0x3c')]=_0x5a1db3['attributes'][_0xb2ee('0x3e')]?_0x5a1db3[_0xb2ee('0x3c')]:_0x25e75d[_0xb2ee('0x37')];if(!_0x2121a8[_0xb2ee('0x38')]['hasOwnProperty'](_0xb2ee('0x3f'))){_0x5a1db3['limit']=qs[_0xb2ee('0x22')](_0x2121a8['query'][_0xb2ee('0x22')]);_0x5a1db3[_0xb2ee('0x21')]=qs['offset'](_0x2121a8['query'][_0xb2ee('0x21')]);}_0x5a1db3['order']=qs[_0xb2ee('0x40')](_0x2121a8[_0xb2ee('0x38')][_0xb2ee('0x40')]);_0x5a1db3[_0xb2ee('0x41')]=qs[_0xb2ee('0x3a')](_[_0xb2ee('0x42')](_0x2121a8[_0xb2ee('0x38')],_0x25e75d['filters']),_0xcd5cd);if(_0x2121a8['query'][_0xb2ee('0x43')]){_0x5a1db3[_0xb2ee('0x41')]=_[_0xb2ee('0x44')](_0x5a1db3[_0xb2ee('0x41')],{'$or':_[_0xb2ee('0x45')](_0xcd5cd,function(_0x44201b){if(_0x44201b['type']!=='VIRTUAL'){var _0x194917={};_0x194917[_0x44201b['name']]={'$like':'%'+_0x2121a8['query'][_0xb2ee('0x43')]+'%'};return _0x194917;}})});}_0x5a1db3=_[_0xb2ee('0x44')]({},_0x5a1db3,_0x2121a8[_0xb2ee('0x46')]);var _0x35cf69={'where':_0x5a1db3['where']};return db[_0xb2ee('0x33')][_0xb2ee('0x24')](_0x35cf69)[_0xb2ee('0x2b')](function(_0x43bcdf){_0x2b2fdd[_0xb2ee('0x24')]=_0x43bcdf;if(_0x2121a8[_0xb2ee('0x38')][_0xb2ee('0x47')]){_0x5a1db3[_0xb2ee('0x48')]=[{'all':!![]}];}return db[_0xb2ee('0x33')][_0xb2ee('0x49')](_0x5a1db3);})[_0xb2ee('0x2b')](function(_0x3be7c3){_0x2b2fdd[_0xb2ee('0x4a')]=_0x3be7c3;return _0x2b2fdd;})['then'](respondWithFilteredResult(_0xef88e6,_0x5a1db3))[_0xb2ee('0x4b')](handleError(_0xef88e6,null));};exports[_0xb2ee('0x4c')]=function(_0x2ed992,_0x396279){var _0xa1fbfb={'raw':!![],'where':{'id':_0x2ed992['params']['id']}},_0x5a48aa={};_0x5a48aa['model']=_[_0xb2ee('0x39')](db['SmsQueue']['rawAttributes']);_0x5a48aa['query']=_['keys'](_0x2ed992[_0xb2ee('0x38')]);_0x5a48aa[_0xb2ee('0x3a')]=_[_0xb2ee('0x3b')](_0x5a48aa[_0xb2ee('0x37')],_0x5a48aa[_0xb2ee('0x38')]);_0xa1fbfb[_0xb2ee('0x3c')]=_['intersection'](_0x5a48aa['model'],qs[_0xb2ee('0x3d')](_0x2ed992['query']['fields']));_0xa1fbfb[_0xb2ee('0x3c')]=_0xa1fbfb[_0xb2ee('0x3c')]['length']?_0xa1fbfb['attributes']:_0x5a48aa[_0xb2ee('0x37')];if(_0x2ed992[_0xb2ee('0x38')][_0xb2ee('0x47')]){_0xa1fbfb[_0xb2ee('0x48')]=[{'all':!![]}];}_0xa1fbfb=_[_0xb2ee('0x44')]({},_0xa1fbfb,_0x2ed992[_0xb2ee('0x46')]);return db[_0xb2ee('0x33')][_0xb2ee('0x4d')](_0xa1fbfb)[_0xb2ee('0x2b')](handleEntityNotFound(_0x396279,null))[_0xb2ee('0x2b')](respondWithResult(_0x396279,null))[_0xb2ee('0x4b')](handleError(_0x396279,null));};exports[_0xb2ee('0x4e')]=function(_0x234d4d,_0x2ec2c1){return db[_0xb2ee('0x33')][_0xb2ee('0x4e')](_0x234d4d['body'],{})[_0xb2ee('0x2b')](function(_0x3578de){var _0xeee35=_0x234d4d[_0xb2ee('0x4f')][_0xb2ee('0x2d')]({'plain':!![]});if(!_0xeee35)throw new Error(_0xb2ee('0x50'));if(_0xeee35['role']==='user'){var _0x633f31=_0x3578de[_0xb2ee('0x2d')]({'plain':!![]});var _0x3d8d0f=_0xb2ee('0x2e');return db['UserProfileSection'][_0xb2ee('0x4d')]({'where':{'name':_0x3d8d0f,'userProfileId':_0xeee35[_0xb2ee('0x51')]},'raw':!![]})[_0xb2ee('0x2b')](function(_0x3d27dc){if(_0x3d27dc&&_0x3d27dc['autoAssociation']===0x0){return db[_0xb2ee('0x52')][_0xb2ee('0x4e')]({'name':_0x633f31[_0xb2ee('0x30')],'resourceId':_0x633f31['id'],'type':_0x3d27dc[_0xb2ee('0x30')],'sectionId':_0x3d27dc['id']},{})['then'](function(){return _0x3578de;});}else{return _0x3578de;}})[_0xb2ee('0x4b')](function(_0x2f5cd0){logger['error'](_0xb2ee('0x53'),_0x2f5cd0);throw _0x2f5cd0;});}return _0x3578de;})[_0xb2ee('0x2b')](respondWithResult(_0x2ec2c1,0xc9))['catch'](handleError(_0x2ec2c1,null));};exports['update']=function(_0x430782,_0x460e10){if(_0x430782[_0xb2ee('0x54')]['id']){delete _0x430782[_0xb2ee('0x54')]['id'];}return db[_0xb2ee('0x33')][_0xb2ee('0x4d')]({'where':{'id':_0x430782[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x460e10,null))['then'](saveUpdates(_0x430782[_0xb2ee('0x54')],null))['then'](respondWithResult(_0x460e10,null))[_0xb2ee('0x4b')](handleError(_0x460e10,null));};exports[_0xb2ee('0x2c')]=function(_0x332085,_0x4ac09e){return db[_0xb2ee('0x33')][_0xb2ee('0x4d')]({'where':{'id':_0x332085['params']['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x4ac09e,null))[_0xb2ee('0x2b')](removeEntity(_0x4ac09e,null))[_0xb2ee('0x4b')](handleError(_0x4ac09e,null));};exports[_0xb2ee('0x56')]=function(_0x3225b7,_0x4f9a5e){return db[_0xb2ee('0x33')][_0xb2ee('0x56')]()['then'](respondWithResult(_0x4f9a5e,null))[_0xb2ee('0x4b')](handleError(_0x4f9a5e,null));};exports[_0xb2ee('0x57')]=function(_0x2a7725,_0x541f77,_0x506329){var _0x418eec={'raw':!![],'where':{}},_0x1675d8={},_0x176fec;return db['SmsQueue']['findOne']({'where':{'id':_0x2a7725[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x541f77,null))[_0xb2ee('0x2b')](function(_0x34ce43){if(_0x34ce43){_0x176fec=_0x34ce43[_0xb2ee('0x2d')]({'plain':!![]});_0x1675d8[_0xb2ee('0x37')]=_['keys'](db[_0xb2ee('0x58')]['rawAttributes']);_0x1675d8[_0xb2ee('0x38')]=_[_0xb2ee('0x39')](_0x2a7725[_0xb2ee('0x38')]);_0x1675d8[_0xb2ee('0x3a')]=_[_0xb2ee('0x3b')](_0x1675d8[_0xb2ee('0x37')],_0x1675d8[_0xb2ee('0x38')]);_0x418eec['attributes']=_['intersection'](_0x1675d8['model'],qs[_0xb2ee('0x3d')](_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x3d')]));_0x418eec[_0xb2ee('0x3c')]=_0x418eec['attributes'][_0xb2ee('0x3e')]?_0x418eec[_0xb2ee('0x3c')]:_0x1675d8[_0xb2ee('0x37')];if(!_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x59')](_0xb2ee('0x3f'))){_0x418eec[_0xb2ee('0x22')]=qs[_0xb2ee('0x22')](_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x22')]);_0x418eec[_0xb2ee('0x21')]=qs['offset'](_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x21')]);}_0x418eec[_0xb2ee('0x5a')]=qs[_0xb2ee('0x40')](_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x40')]);_0x418eec[_0xb2ee('0x41')]=qs[_0xb2ee('0x3a')](_[_0xb2ee('0x42')](_0x2a7725[_0xb2ee('0x38')],_0x1675d8[_0xb2ee('0x3a')]));_0x418eec[_0xb2ee('0x41')][_0xb2ee('0x5b')]=_0x34ce43['id'];if(_0x2a7725[_0xb2ee('0x38')][_0xb2ee('0x43')]){_0x418eec[_0xb2ee('0x41')]=_[_0xb2ee('0x44')](_0x418eec[_0xb2ee('0x41')],{'$or':_['map'](_0x418eec[_0xb2ee('0x3c')],function(_0x1e448e){var _0x64d97f={};_0x64d97f[_0x1e448e]={'$like':'%'+_0x2a7725['query'][_0xb2ee('0x43')]+'%'};return _0x64d97f;})});}_0x418eec=_[_0xb2ee('0x44')]({},_0x418eec,_0x2a7725[_0xb2ee('0x46')]);return db[_0xb2ee('0x58')][_0xb2ee('0x49')](_0x418eec);}})[_0xb2ee('0x2b')](function(_0x2c31da){if(_0x2c31da){return db['User'][_0xb2ee('0x5c')]({'where':{'id':_[_0xb2ee('0x45')](_0x2c31da,_0xb2ee('0x5d')),'role':_0xb2ee('0x5e')},'attributes':['id',_0xb2ee('0x30'),_0xb2ee('0x5f'),'updatedAt',_0xb2ee('0x60')]});}})[_0xb2ee('0x2b')](function(_0x3dd6e4){if(_0x3dd6e4){return{'count':_0x3dd6e4[_0xb2ee('0x24')],'rows':_['map'](_0x3dd6e4[_0xb2ee('0x4a')],function(_0x40e514){return{'membername':_0x40e514[_0xb2ee('0x30')],'UserId':_0x40e514['id'],'queue_name':_0x176fec[_0xb2ee('0x30')],'SmsQueueId':_0x176fec['id'],'interface':util['format']('%s/%s','SIP',_0x40e514[_0xb2ee('0x30')]),'penalty':0x0,'paused':_0x40e514[_0xb2ee('0x5f')],'createdAt':_0x40e514[_0xb2ee('0x60')],'updatedAt':_0x40e514[_0xb2ee('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x541f77,_0x418eec))['catch'](handleError(_0x541f77,null));};exports['getTeams']=function(_0x3b2c5a,_0x197fa6,_0x3b3428){var _0x6aff12={};var _0x561c90={};var _0x342a91;var _0x4f3b1b;return db[_0xb2ee('0x33')][_0xb2ee('0x62')]({'where':{'id':_0x3b2c5a['params']['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x197fa6,null))[_0xb2ee('0x2b')](function(_0x341fa2){if(_0x341fa2){_0x342a91=_0x341fa2;_0x561c90[_0xb2ee('0x37')]=_[_0xb2ee('0x39')](db[_0xb2ee('0x63')][_0xb2ee('0x64')]);_0x561c90[_0xb2ee('0x38')]=_[_0xb2ee('0x39')](_0x3b2c5a['query']);_0x561c90[_0xb2ee('0x3a')]=_[_0xb2ee('0x3b')](_0x561c90[_0xb2ee('0x37')],_0x561c90[_0xb2ee('0x38')]);_0x6aff12[_0xb2ee('0x3c')]=_[_0xb2ee('0x3b')](_0x561c90[_0xb2ee('0x37')],qs[_0xb2ee('0x3d')](_0x3b2c5a[_0xb2ee('0x38')][_0xb2ee('0x3d')]));_0x6aff12[_0xb2ee('0x3c')]=_0x6aff12[_0xb2ee('0x3c')][_0xb2ee('0x3e')]?_0x6aff12['attributes']:_0x561c90[_0xb2ee('0x37')];_0x6aff12['order']=qs['sort'](_0x3b2c5a[_0xb2ee('0x38')][_0xb2ee('0x40')]);_0x6aff12['where']=qs[_0xb2ee('0x3a')](_[_0xb2ee('0x42')](_0x3b2c5a['query'],_0x561c90['filters']));if(_0x3b2c5a[_0xb2ee('0x38')]['filter']){_0x6aff12[_0xb2ee('0x41')]=_['merge'](_0x6aff12['where'],{'$or':_[_0xb2ee('0x45')](_0x6aff12[_0xb2ee('0x3c')],function(_0x2b36f8){var _0x25ee77={};_0x25ee77[_0x2b36f8]={'$like':'%'+_0x3b2c5a[_0xb2ee('0x38')][_0xb2ee('0x43')]+'%'};return _0x25ee77;})});}_0x6aff12=_[_0xb2ee('0x44')]({},_0x6aff12,_0x3b2c5a[_0xb2ee('0x46')]);return _0x342a91[_0xb2ee('0x65')](_0x6aff12);}})['then'](function(_0xa8cc13){if(_0xa8cc13){_0x4f3b1b=_0xa8cc13[_0xb2ee('0x3e')];if(!_0x3b2c5a[_0xb2ee('0x38')][_0xb2ee('0x59')](_0xb2ee('0x3f'))){_0x6aff12['limit']=qs[_0xb2ee('0x22')](_0x3b2c5a[_0xb2ee('0x38')]['limit']);_0x6aff12[_0xb2ee('0x21')]=qs[_0xb2ee('0x21')](_0x3b2c5a[_0xb2ee('0x38')]['offset']);}return _0x342a91[_0xb2ee('0x65')](_0x6aff12);}})[_0xb2ee('0x2b')](function(_0xda1c26){if(_0xda1c26){return _0xda1c26?{'count':_0x4f3b1b,'rows':_0xda1c26}:null;}})[_0xb2ee('0x2b')](respondWithResult(_0x197fa6,null))[_0xb2ee('0x4b')](handleError(_0x197fa6,null));};exports[_0xb2ee('0x66')]=function(_0x258a64,_0x2259ec,_0x384099){var _0x39a34b=_0x258a64['body'][_0xb2ee('0x67')];return db[_0xb2ee('0x63')][_0xb2ee('0x49')]({'where':{'id':_0x39a34b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb2ee('0x30'),'online',_0xb2ee('0x68'),'interface'],'raw':!![]}]})[_0xb2ee('0x2b')](function(_0x2443c8){if(_0x2443c8){var _0x15fe8e=_['flatMap'](_0x2443c8,function(_0x555900){var _0x2a0887=_0x555900['get']({'plain':!![]});return _0x2a0887['Agents'];});return db[_0xb2ee('0x33')][_0xb2ee('0x4d')]({'where':{'id':_0x258a64[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](function(_0x5d6f5c){return db[_0xb2ee('0x69')][_0xb2ee('0x6a')](function(_0x1ff760){return _0x5d6f5c[_0xb2ee('0x66')](_0x39a34b,{'transaction':_0x1ff760})[_0xb2ee('0x2b')](function(){return BPromise['each'](_0x15fe8e,function(_0x3cdf65){return db['UserSmsQueue'][_0xb2ee('0x6b')]({'where':{'UserId':_0x3cdf65['id'],'SmsQueueId':_0x258a64[_0xb2ee('0x55')]['id']},'transaction':_0x1ff760});});})[_0xb2ee('0x2b')](function(){_0x15fe8e[_0xb2ee('0x6c')](function(_0x58a299){socket[_0xb2ee('0x6d')](_0xb2ee('0x6e'),{'UserId':_0x58a299['id'],'SmsQueueId':_0x5d6f5c['id']});});});});});}})['then'](respondWithStatusCode(_0x2259ec,null))['catch'](handleError(_0x2259ec,null));};exports[_0xb2ee('0x6f')]=function(_0x17b2f8,_0x29a39f,_0x41e2bb){return db['Team'][_0xb2ee('0x49')]({'where':{'id':_0x17b2f8['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xb2ee('0x70')],'as':_0xb2ee('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x29a39f,null))['then'](function(_0x3612c4){var _0x7d2ebc=_[_0xb2ee('0x45')](_0x3612c4,'id');var _0x3aaad0=[];var _0x410369=[];var _0x30399d=squel['select']();_0x30399d[_0xb2ee('0x72')](_0xb2ee('0x73'))[_0xb2ee('0x74')](_0xb2ee('0x75'),'tq')[_0xb2ee('0x76')](_0xb2ee('0x77'),'ut',_0xb2ee('0x78'))[_0xb2ee('0x41')](_0xb2ee('0x79'),_0x17b2f8[_0xb2ee('0x55')]['id']);for(var _0x5790b3=0x0;_0x5790b3<_0x3612c4[_0xb2ee('0x3e')];_0x5790b3+=0x1){let _0x40347d=_0x3612c4[_0x5790b3];for(var _0xe3aa08=0x0;_0xe3aa08<_0x40347d['Agents'][_0xb2ee('0x3e')];_0xe3aa08+=0x1){let _0xe7256e=_0x40347d['Agents'][_0xe3aa08];var _0x4ad1e2=_0x30399d[_0xb2ee('0x7a')]();_0x4ad1e2[_0xb2ee('0x41')](_0xb2ee('0x7b'),_0xe7256e['id']);_0x410369[_0xb2ee('0x7c')](db[_0xb2ee('0x69')][_0xb2ee('0x38')](_0x4ad1e2[_0xb2ee('0x7d')](),{'type':db['sequelize'][_0xb2ee('0x7e')][_0xb2ee('0x7f')]})[_0xb2ee('0x2b')](function(_0x37c50f){if(_0x37c50f[_0xb2ee('0x3e')]===0x1){return _0xe7256e['id'];}else{var _0x5e9f29=_[_0xb2ee('0x80')](_[_0xb2ee('0x45')](_0x37c50f,_0xb2ee('0x81')),function(_0x50860e){return _[_0xb2ee('0x82')](_0x7d2ebc,_0x50860e);});if(_0x5e9f29){return _0xe7256e['id'];}}}));}}return BPromise[_0xb2ee('0x83')](_0x410369)[_0xb2ee('0x2b')](function(_0x14f4ca){_0x3aaad0=_(_0x3aaad0)[_0xb2ee('0x84')](_0x14f4ca)[_0xb2ee('0x85')]()[_0xb2ee('0x86')]();return db[_0xb2ee('0x33')][_0xb2ee('0x4d')]({'where':{'id':_0x17b2f8[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](function(_0x27a2bc){return db[_0xb2ee('0x69')][_0xb2ee('0x6a')](function(_0x32e191){return _0x27a2bc[_0xb2ee('0x6f')](_0x17b2f8[_0xb2ee('0x38')]['ids'],{'transaction':_0x32e191})[_0xb2ee('0x2b')](function(){if(!_[_0xb2ee('0x87')](_0x3aaad0)){return _0x27a2bc[_0xb2ee('0x88')](_0x3aaad0,{'transaction':_0x32e191});}})[_0xb2ee('0x2b')](function(){_0x3aaad0['forEach'](function(_0x73f490){socket[_0xb2ee('0x6d')](_0xb2ee('0x89'),{'UserId':_0x73f490,'SmsQueueId':_0x27a2bc['id']});});});});});});})[_0xb2ee('0x2b')](respondWithStatusCode(_0x29a39f,null))[_0xb2ee('0x4b')](handleError(_0x29a39f,null));};exports[_0xb2ee('0x8a')]=function(_0x326a4a,_0x6529a6,_0x450fb3){return db['SmsQueue']['find']({'where':{'id':_0x326a4a[_0xb2ee('0x55')]['id']}})['then'](handleEntityNotFound(_0x6529a6,null))['then'](function(_0x36124a){if(_0x36124a){return _0x36124a[_0xb2ee('0x8a')](_0x326a4a[_0xb2ee('0x54')]['ids'],_[_0xb2ee('0x8b')](_0x326a4a['body'],['ids','id'])||{})[_0xb2ee('0x8c')](function(_0x4e418a){for(var _0x16f561=0x0;_0x16f561<_0x326a4a['body']['ids'][_0xb2ee('0x3e')];_0x16f561+=0x1){socket[_0xb2ee('0x6d')]('userSmsQueue:save',{'UserId':Number(_0x326a4a[_0xb2ee('0x54')]['ids'][_0x16f561]),'SmsQueueId':Number(_0x326a4a[_0xb2ee('0x55')]['id'])});}return _0x4e418a;});}})[_0xb2ee('0x2b')](respondWithResult(_0x6529a6,null))[_0xb2ee('0x4b')](handleError(_0x6529a6,null));};exports['removeAgents']=function(_0x78422b,_0x5de337,_0x4d83cf){return db[_0xb2ee('0x33')][_0xb2ee('0x4d')]({'where':{'id':_0x78422b[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x5de337,null))['then'](function(_0x32ec2c){if(_0x32ec2c){return _0x32ec2c[_0xb2ee('0x88')](_0x78422b[_0xb2ee('0x38')][_0xb2ee('0x67')])[_0xb2ee('0x2b')](function(){if(_[_0xb2ee('0x8d')](_0x78422b['query'][_0xb2ee('0x67')])){for(var _0x3eedd4=0x0;_0x3eedd4<_0x78422b[_0xb2ee('0x38')][_0xb2ee('0x67')][_0xb2ee('0x3e')];_0x3eedd4+=0x1){socket[_0xb2ee('0x6d')](_0xb2ee('0x89'),{'UserId':Number(_0x78422b['query'][_0xb2ee('0x67')][_0x3eedd4]),'SmsQueueId':Number(_0x78422b[_0xb2ee('0x55')]['id'])});}}else{socket[_0xb2ee('0x6d')](_0xb2ee('0x89'),{'UserId':Number(_0x78422b[_0xb2ee('0x38')][_0xb2ee('0x67')]),'SmsQueueId':Number(_0x78422b[_0xb2ee('0x55')]['id'])});}});}})[_0xb2ee('0x2b')](respondWithStatusCode(_0x5de337,null))[_0xb2ee('0x4b')](handleError(_0x5de337,null));};exports[_0xb2ee('0x8e')]=function(_0x4712c3,_0x18e35b,_0x297d09){var _0x3f1859={};var _0x59f95d={};var _0x79af33;var _0x55ecc2;return db[_0xb2ee('0x33')][_0xb2ee('0x62')]({'where':{'id':_0x4712c3[_0xb2ee('0x55')]['id']}})[_0xb2ee('0x2b')](handleEntityNotFound(_0x18e35b,null))['then'](function(_0x818545){if(_0x818545){_0x79af33=_0x818545;_0x59f95d[_0xb2ee('0x37')]=_[_0xb2ee('0x39')](db[_0xb2ee('0x70')][_0xb2ee('0x64')]);_0x59f95d[_0xb2ee('0x38')]=_[_0xb2ee('0x39')](_0x4712c3[_0xb2ee('0x38')]);_0x59f95d['filters']=_[_0xb2ee('0x3b')](_0x59f95d[_0xb2ee('0x37')],_0x59f95d[_0xb2ee('0x38')]);_0x3f1859[_0xb2ee('0x3c')]=_['intersection'](_0x59f95d['model'],qs[_0xb2ee('0x3d')](_0x4712c3[_0xb2ee('0x38')][_0xb2ee('0x3d')]));_0x3f1859['attributes']=_0x3f1859['attributes']['length']?_0x3f1859[_0xb2ee('0x3c')]:_0x59f95d[_0xb2ee('0x37')];_0x3f1859[_0xb2ee('0x5a')]=qs[_0xb2ee('0x40')](_0x4712c3[_0xb2ee('0x38')]['sort']);_0x3f1859['where']=qs[_0xb2ee('0x3a')](_[_0xb2ee('0x42')](_0x4712c3['query'],_0x59f95d['filters']));if(_0x4712c3['query'][_0xb2ee('0x43')]){_0x3f1859[_0xb2ee('0x41')]=_[_0xb2ee('0x44')](_0x3f1859[_0xb2ee('0x41')],{'$or':_[_0xb2ee('0x45')](_0x3f1859[_0xb2ee('0x3c')],function(_0x1f52f0){var _0x19a550={};_0x19a550[_0x1f52f0]={'$like':'%'+_0x4712c3['query'][_0xb2ee('0x43')]+'%'};return _0x19a550;})});}_0x3f1859=_['merge']({},_0x3f1859,_0x4712c3[_0xb2ee('0x46')]);return _0x79af33[_0xb2ee('0x8e')](_0x3f1859);}})[_0xb2ee('0x2b')](function(_0x1c1470){if(_0x1c1470){_0x55ecc2=_0x1c1470[_0xb2ee('0x3e')];if(!_0x4712c3[_0xb2ee('0x38')]['hasOwnProperty']('nolimit')){_0x3f1859[_0xb2ee('0x22')]=qs[_0xb2ee('0x22')](_0x4712c3[_0xb2ee('0x38')]['limit']);_0x3f1859[_0xb2ee('0x21')]=qs[_0xb2ee('0x21')](_0x4712c3[_0xb2ee('0x38')][_0xb2ee('0x21')]);}return _0x79af33[_0xb2ee('0x8e')](_0x3f1859);}})[_0xb2ee('0x2b')](function(_0x2e4b2b){if(_0x2e4b2b){return _0x2e4b2b?{'count':_0x55ecc2,'rows':_0x2e4b2b}:null;}})['then'](respondWithResult(_0x18e35b,null))[_0xb2ee('0x4b')](handleError(_0x18e35b,null));};
\ No newline at end of file
+var _0x9527=['Team','User','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','ids','Agents','select','field','from','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','SmsQueue','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','UserSmsQueue','SmsQueueId','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','length','addTeams'];(function(_0x1b5805,_0x1d1f54){var _0x4b0de6=function(_0x40de7b){while(--_0x40de7b){_0x1b5805['push'](_0x1b5805['shift']());}};_0x4b0de6(++_0x1d1f54);}(_0x9527,0x135));var _0x7952=function(_0x5931ae,_0x3fe493){_0x5931ae=_0x5931ae-0x0;var _0x41a5b0=_0x9527[_0x5931ae];return _0x41a5b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7952('0x0'));var zipdir=require(_0x7952('0x1'));var jsonpatch=require(_0x7952('0x2'));var rp=require('request-promise');var moment=require(_0x7952('0x3'));var BPromise=require(_0x7952('0x4'));var Mustache=require(_0x7952('0x5'));var util=require(_0x7952('0x6'));var path=require(_0x7952('0x7'));var sox=require('sox');var csv=require(_0x7952('0x8'));var ejs=require(_0x7952('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7952('0xa'));var jsforce=require(_0x7952('0xb'));var deskjs=require(_0x7952('0xc'));var toCsv=require(_0x7952('0x8'));var querystring=require(_0x7952('0xd'));var Papa=require(_0x7952('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7952('0xf'));var hardwareService=require(_0x7952('0x10'));var logger=require(_0x7952('0x11'))(_0x7952('0x12'));var utils=require(_0x7952('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7952('0x14'));var db=require(_0x7952('0x15'))['db'];config['redis']=_[_0x7952('0x16')](config[_0x7952('0x17')],{'host':_0x7952('0x18'),'port':0x18eb});var socket=require(_0x7952('0x19'))(new Redis(config['redis']));require(_0x7952('0x1a'))['register'](socket);function respondWithStatusCode(_0x24a704,_0x3cc368){_0x3cc368=_0x3cc368||0xcc;return function(_0x4e000e){if(_0x4e000e){return _0x24a704[_0x7952('0x1b')](_0x3cc368);}return _0x24a704[_0x7952('0x1c')](_0x3cc368)[_0x7952('0x1d')]();};}function respondWithResult(_0x19b2d8,_0x2e69c2){_0x2e69c2=_0x2e69c2||0xc8;return function(_0x28e647){if(_0x28e647){return _0x19b2d8[_0x7952('0x1c')](_0x2e69c2)[_0x7952('0x1e')](_0x28e647);}};}function respondWithFilteredResult(_0xa377dd,_0x1a443e){return function(_0x3ecb77){if(_0x3ecb77){var _0x33f9aa=typeof _0x1a443e[_0x7952('0x1f')]===_0x7952('0x20')&&typeof _0x1a443e[_0x7952('0x21')]===_0x7952('0x20');var _0x3b1cbc=_0x3ecb77[_0x7952('0x22')];var _0x4b2fde=_0x33f9aa?0x0:_0x1a443e[_0x7952('0x1f')];var _0x1bd76f=_0x33f9aa?_0x3ecb77[_0x7952('0x22')]:_0x1a443e[_0x7952('0x1f')]+_0x1a443e[_0x7952('0x21')];var _0x439320;if(_0x1bd76f>=_0x3b1cbc){_0x1bd76f=_0x3b1cbc;_0x439320=0xc8;}else{_0x439320=0xce;}_0xa377dd[_0x7952('0x1c')](_0x439320);return _0xa377dd[_0x7952('0x23')]('Content-Range',_0x4b2fde+'-'+_0x1bd76f+'/'+_0x3b1cbc)[_0x7952('0x1e')](_0x3ecb77);}return null;};}function patchUpdates(_0x18c11e){return function(_0x131188){try{jsonpatch['apply'](_0x131188,_0x18c11e,!![]);}catch(_0x29852a){return BPromise['reject'](_0x29852a);}return _0x131188[_0x7952('0x24')]();};}function saveUpdates(_0x336c8f,_0x4de84e){return function(_0x52bbb8){if(_0x52bbb8){return _0x52bbb8['update'](_0x336c8f)[_0x7952('0x25')](function(_0x5df551){return _0x5df551;});}return null;};}function removeEntity(_0x1ccf3e,_0x5a329a){return function(_0x18741f){if(_0x18741f){return _0x18741f[_0x7952('0x26')]()[_0x7952('0x25')](function(){var _0xed467b=_0x18741f['get']({'plain':!![]});var _0xb565ae=_0x7952('0x27');return db[_0x7952('0x28')][_0x7952('0x26')]({'where':{'type':_0xb565ae,'resourceId':_0xed467b['id']}})['then'](function(){return _0x18741f;});})[_0x7952('0x25')](function(){_0x1ccf3e[_0x7952('0x1c')](0xcc)[_0x7952('0x1d')]();});}};}function handleEntityNotFound(_0x473893,_0x1fc40b){return function(_0x2b2c04){if(!_0x2b2c04){_0x473893[_0x7952('0x1b')](0x194);}return _0x2b2c04;};}function handleError(_0x1db617,_0x5356aa){_0x5356aa=_0x5356aa||0x1f4;return function(_0x48913b){logger[_0x7952('0x29')](_0x48913b[_0x7952('0x2a')]);if(_0x48913b[_0x7952('0x2b')]){delete _0x48913b['name'];}_0x1db617[_0x7952('0x1c')](_0x5356aa)[_0x7952('0x2c')](_0x48913b);};}exports['index']=function(_0x25f5c3,_0x17fc80){var _0x43a295={},_0x101df9={},_0x3cf257={'count':0x0,'rows':[]};var _0x237683=_['map'](db[_0x7952('0x2d')]['rawAttributes'],function(_0x4c282f){return{'name':_0x4c282f['fieldName'],'type':_0x4c282f[_0x7952('0x2e')][_0x7952('0x2f')]};});_0x101df9['model']=_[_0x7952('0x30')](_0x237683,'name');_0x101df9[_0x7952('0x31')]=_[_0x7952('0x32')](_0x25f5c3['query']);_0x101df9[_0x7952('0x33')]=_['intersection'](_0x101df9[_0x7952('0x34')],_0x101df9[_0x7952('0x31')]);_0x43a295[_0x7952('0x35')]=_[_0x7952('0x36')](_0x101df9[_0x7952('0x34')],qs[_0x7952('0x37')](_0x25f5c3[_0x7952('0x31')]['fields']));_0x43a295[_0x7952('0x35')]=_0x43a295[_0x7952('0x35')]['length']?_0x43a295['attributes']:_0x101df9[_0x7952('0x34')];if(!_0x25f5c3[_0x7952('0x31')][_0x7952('0x38')](_0x7952('0x39'))){_0x43a295['limit']=qs[_0x7952('0x21')](_0x25f5c3[_0x7952('0x31')]['limit']);_0x43a295[_0x7952('0x1f')]=qs[_0x7952('0x1f')](_0x25f5c3[_0x7952('0x31')]['offset']);}_0x43a295[_0x7952('0x3a')]=qs[_0x7952('0x3b')](_0x25f5c3['query'][_0x7952('0x3b')]);_0x43a295[_0x7952('0x3c')]=qs[_0x7952('0x33')](_[_0x7952('0x3d')](_0x25f5c3['query'],_0x101df9['filters']),_0x237683);if(_0x25f5c3[_0x7952('0x31')][_0x7952('0x3e')]){_0x43a295[_0x7952('0x3c')]=_[_0x7952('0x3f')](_0x43a295[_0x7952('0x3c')],{'$or':_['map'](_0x237683,function(_0x10e61a){if(_0x10e61a['type']!==_0x7952('0x40')){var _0x1565b2={};_0x1565b2[_0x10e61a['name']]={'$like':'%'+_0x25f5c3[_0x7952('0x31')][_0x7952('0x3e')]+'%'};return _0x1565b2;}})});}_0x43a295=_[_0x7952('0x3f')]({},_0x43a295,_0x25f5c3[_0x7952('0x41')]);var _0x18508e={'where':_0x43a295[_0x7952('0x3c')]};return db[_0x7952('0x2d')][_0x7952('0x22')](_0x18508e)[_0x7952('0x25')](function(_0x454481){_0x3cf257[_0x7952('0x22')]=_0x454481;if(_0x25f5c3[_0x7952('0x31')][_0x7952('0x42')]){_0x43a295['include']=[{'all':!![]}];}return db[_0x7952('0x2d')][_0x7952('0x43')](_0x43a295);})[_0x7952('0x25')](function(_0xdc578f){_0x3cf257[_0x7952('0x44')]=_0xdc578f;return _0x3cf257;})[_0x7952('0x25')](respondWithFilteredResult(_0x17fc80,_0x43a295))[_0x7952('0x45')](handleError(_0x17fc80,null));};exports['show']=function(_0x432877,_0x47cd4f){var _0x263399={'raw':!![],'where':{'id':_0x432877[_0x7952('0x46')]['id']}},_0xaee721={};_0xaee721[_0x7952('0x34')]=_[_0x7952('0x32')](db[_0x7952('0x2d')][_0x7952('0x47')]);_0xaee721['query']=_[_0x7952('0x32')](_0x432877[_0x7952('0x31')]);_0xaee721[_0x7952('0x33')]=_[_0x7952('0x36')](_0xaee721[_0x7952('0x34')],_0xaee721[_0x7952('0x31')]);_0x263399[_0x7952('0x35')]=_[_0x7952('0x36')](_0xaee721[_0x7952('0x34')],qs[_0x7952('0x37')](_0x432877[_0x7952('0x31')][_0x7952('0x37')]));_0x263399['attributes']=_0x263399[_0x7952('0x35')]['length']?_0x263399[_0x7952('0x35')]:_0xaee721['model'];if(_0x432877[_0x7952('0x31')][_0x7952('0x42')]){_0x263399[_0x7952('0x48')]=[{'all':!![]}];}_0x263399=_[_0x7952('0x3f')]({},_0x263399,_0x432877['options']);return db[_0x7952('0x2d')]['find'](_0x263399)[_0x7952('0x25')](handleEntityNotFound(_0x47cd4f,null))[_0x7952('0x25')](respondWithResult(_0x47cd4f,null))[_0x7952('0x45')](handleError(_0x47cd4f,null));};exports[_0x7952('0x49')]=function(_0x41baa9,_0x11fdbf){return db[_0x7952('0x2d')][_0x7952('0x49')](_0x41baa9[_0x7952('0x4a')],{})[_0x7952('0x25')](function(_0x58dcc5){var _0x29cc00=_0x41baa9[_0x7952('0x4b')][_0x7952('0x4c')]({'plain':!![]});if(!_0x29cc00)throw new Error(_0x7952('0x4d'));if(_0x29cc00[_0x7952('0x4e')]===_0x7952('0x4b')){var _0x343226=_0x58dcc5[_0x7952('0x4c')]({'plain':!![]});var _0x1b63af=_0x7952('0x27');return db[_0x7952('0x4f')][_0x7952('0x50')]({'where':{'name':_0x1b63af,'userProfileId':_0x29cc00[_0x7952('0x51')]},'raw':!![]})[_0x7952('0x25')](function(_0x3a4010){if(_0x3a4010&&_0x3a4010[_0x7952('0x52')]===0x0){return db[_0x7952('0x28')][_0x7952('0x49')]({'name':_0x343226[_0x7952('0x2b')],'resourceId':_0x343226['id'],'type':_0x3a4010['name'],'sectionId':_0x3a4010['id']},{})[_0x7952('0x25')](function(){return _0x58dcc5;});}else{return _0x58dcc5;}})[_0x7952('0x45')](function(_0x35b566){logger[_0x7952('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35b566);throw _0x35b566;});}return _0x58dcc5;})[_0x7952('0x25')](respondWithResult(_0x11fdbf,0xc9))[_0x7952('0x45')](handleError(_0x11fdbf,null));};exports['update']=function(_0x7fca71,_0x272e67){if(_0x7fca71['body']['id']){delete _0x7fca71['body']['id'];}return db['SmsQueue'][_0x7952('0x50')]({'where':{'id':_0x7fca71['params']['id']}})[_0x7952('0x25')](handleEntityNotFound(_0x272e67,null))['then'](saveUpdates(_0x7fca71[_0x7952('0x4a')],null))[_0x7952('0x25')](respondWithResult(_0x272e67,null))[_0x7952('0x45')](handleError(_0x272e67,null));};exports[_0x7952('0x26')]=function(_0x264c75,_0x50c470){return db[_0x7952('0x2d')]['find']({'where':{'id':_0x264c75[_0x7952('0x46')]['id']}})['then'](handleEntityNotFound(_0x50c470,null))['then'](removeEntity(_0x50c470,null))[_0x7952('0x45')](handleError(_0x50c470,null));};exports[_0x7952('0x53')]=function(_0x348d35,_0x278001){return db[_0x7952('0x2d')][_0x7952('0x53')]()[_0x7952('0x25')](respondWithResult(_0x278001,null))['catch'](handleError(_0x278001,null));};exports[_0x7952('0x54')]=function(_0x4eb488,_0x39cd2e,_0x454e5f){var _0x33b675={'raw':!![],'where':{}},_0x41472c={},_0x2feb17;return db['SmsQueue']['findOne']({'where':{'id':_0x4eb488['params']['id']}})[_0x7952('0x25')](handleEntityNotFound(_0x39cd2e,null))['then'](function(_0x5bac58){if(_0x5bac58){_0x2feb17=_0x5bac58[_0x7952('0x4c')]({'plain':!![]});_0x41472c[_0x7952('0x34')]=_[_0x7952('0x32')](db[_0x7952('0x55')]['rawAttributes']);_0x41472c[_0x7952('0x31')]=_[_0x7952('0x32')](_0x4eb488[_0x7952('0x31')]);_0x41472c[_0x7952('0x33')]=_['intersection'](_0x41472c['model'],_0x41472c[_0x7952('0x31')]);_0x33b675[_0x7952('0x35')]=_['intersection'](_0x41472c[_0x7952('0x34')],qs[_0x7952('0x37')](_0x4eb488[_0x7952('0x31')][_0x7952('0x37')]));_0x33b675[_0x7952('0x35')]=_0x33b675[_0x7952('0x35')]['length']?_0x33b675[_0x7952('0x35')]:_0x41472c['model'];if(!_0x4eb488['query']['hasOwnProperty'](_0x7952('0x39'))){_0x33b675[_0x7952('0x21')]=qs[_0x7952('0x21')](_0x4eb488['query'][_0x7952('0x21')]);_0x33b675[_0x7952('0x1f')]=qs[_0x7952('0x1f')](_0x4eb488[_0x7952('0x31')][_0x7952('0x1f')]);}_0x33b675['order']=qs[_0x7952('0x3b')](_0x4eb488[_0x7952('0x31')]['sort']);_0x33b675[_0x7952('0x3c')]=qs[_0x7952('0x33')](_[_0x7952('0x3d')](_0x4eb488[_0x7952('0x31')],_0x41472c[_0x7952('0x33')]));_0x33b675[_0x7952('0x3c')][_0x7952('0x56')]=_0x5bac58['id'];if(_0x4eb488[_0x7952('0x31')]['filter']){_0x33b675[_0x7952('0x3c')]=_['merge'](_0x33b675[_0x7952('0x3c')],{'$or':_[_0x7952('0x30')](_0x33b675[_0x7952('0x35')],function(_0x39e42b){var _0x2c924d={};_0x2c924d[_0x39e42b]={'$like':'%'+_0x4eb488[_0x7952('0x31')][_0x7952('0x3e')]+'%'};return _0x2c924d;})});}_0x33b675=_[_0x7952('0x3f')]({},_0x33b675,_0x4eb488[_0x7952('0x41')]);return db[_0x7952('0x55')]['findAll'](_0x33b675);}})[_0x7952('0x25')](function(_0x5ae29f){if(_0x5ae29f){return db['User']['findAndCountAll']({'where':{'id':_[_0x7952('0x30')](_0x5ae29f,_0x7952('0x57')),'role':_0x7952('0x58')},'attributes':['id',_0x7952('0x2b'),_0x7952('0x59'),_0x7952('0x5a'),_0x7952('0x5b')]});}})[_0x7952('0x25')](function(_0x2a96ce){if(_0x2a96ce){return{'count':_0x2a96ce[_0x7952('0x22')],'rows':_[_0x7952('0x30')](_0x2a96ce[_0x7952('0x44')],function(_0x2d4a49){return{'membername':_0x2d4a49[_0x7952('0x2b')],'UserId':_0x2d4a49['id'],'queue_name':_0x2feb17[_0x7952('0x2b')],'SmsQueueId':_0x2feb17['id'],'interface':util[_0x7952('0x5c')](_0x7952('0x5d'),_0x7952('0x5e'),_0x2d4a49[_0x7952('0x2b')]),'penalty':0x0,'paused':_0x2d4a49['smsPause'],'createdAt':_0x2d4a49[_0x7952('0x5b')],'updatedAt':_0x2d4a49[_0x7952('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7952('0x25')](respondWithFilteredResult(_0x39cd2e,_0x33b675))[_0x7952('0x45')](handleError(_0x39cd2e,null));};exports[_0x7952('0x5f')]=function(_0x156d86,_0x14151e,_0x24a3ac){var _0xabcbfa={};var _0x1cb337={};var _0x170789;var _0x29e873;return db[_0x7952('0x2d')][_0x7952('0x60')]({'where':{'id':_0x156d86[_0x7952('0x46')]['id']}})[_0x7952('0x25')](handleEntityNotFound(_0x14151e,null))[_0x7952('0x25')](function(_0x265929){if(_0x265929){_0x170789=_0x265929;_0x1cb337[_0x7952('0x34')]=_['keys'](db['Team'][_0x7952('0x47')]);_0x1cb337[_0x7952('0x31')]=_[_0x7952('0x32')](_0x156d86['query']);_0x1cb337[_0x7952('0x33')]=_['intersection'](_0x1cb337[_0x7952('0x34')],_0x1cb337[_0x7952('0x31')]);_0xabcbfa[_0x7952('0x35')]=_['intersection'](_0x1cb337['model'],qs[_0x7952('0x37')](_0x156d86[_0x7952('0x31')]['fields']));_0xabcbfa['attributes']=_0xabcbfa[_0x7952('0x35')][_0x7952('0x61')]?_0xabcbfa[_0x7952('0x35')]:_0x1cb337[_0x7952('0x34')];_0xabcbfa['order']=qs[_0x7952('0x3b')](_0x156d86[_0x7952('0x31')][_0x7952('0x3b')]);_0xabcbfa[_0x7952('0x3c')]=qs[_0x7952('0x33')](_[_0x7952('0x3d')](_0x156d86[_0x7952('0x31')],_0x1cb337[_0x7952('0x33')]));if(_0x156d86['query'][_0x7952('0x3e')]){_0xabcbfa['where']=_[_0x7952('0x3f')](_0xabcbfa['where'],{'$or':_[_0x7952('0x30')](_0xabcbfa[_0x7952('0x35')],function(_0x36b65c){var _0x48bb1d={};_0x48bb1d[_0x36b65c]={'$like':'%'+_0x156d86[_0x7952('0x31')]['filter']+'%'};return _0x48bb1d;})});}_0xabcbfa=_[_0x7952('0x3f')]({},_0xabcbfa,_0x156d86['options']);return _0x170789[_0x7952('0x5f')](_0xabcbfa);}})[_0x7952('0x25')](function(_0xce8089){if(_0xce8089){_0x29e873=_0xce8089[_0x7952('0x61')];if(!_0x156d86[_0x7952('0x31')][_0x7952('0x38')](_0x7952('0x39'))){_0xabcbfa[_0x7952('0x21')]=qs[_0x7952('0x21')](_0x156d86[_0x7952('0x31')][_0x7952('0x21')]);_0xabcbfa[_0x7952('0x1f')]=qs[_0x7952('0x1f')](_0x156d86[_0x7952('0x31')][_0x7952('0x1f')]);}return _0x170789[_0x7952('0x5f')](_0xabcbfa);}})[_0x7952('0x25')](function(_0x4019f6){if(_0x4019f6){return _0x4019f6?{'count':_0x29e873,'rows':_0x4019f6}:null;}})['then'](respondWithResult(_0x14151e,null))[_0x7952('0x45')](handleError(_0x14151e,null));};exports[_0x7952('0x62')]=function(_0x4305e5,_0x2e44a9,_0x319647){var _0x417802=_0x4305e5[_0x7952('0x4a')]['ids'];return db[_0x7952('0x63')][_0x7952('0x43')]({'where':{'id':_0x417802},'attributes':['id'],'include':[{'model':db[_0x7952('0x64')],'as':'Agents','attributes':['id',_0x7952('0x2b'),_0x7952('0x65'),_0x7952('0x66'),_0x7952('0x67')],'raw':!![]}]})[_0x7952('0x25')](function(_0xeca4f9){if(_0xeca4f9){var _0x31f144=_[_0x7952('0x68')](_0xeca4f9,function(_0x3c05a8){var _0x2f0190=_0x3c05a8[_0x7952('0x4c')]({'plain':!![]});return _0x2f0190['Agents'];});return db[_0x7952('0x2d')][_0x7952('0x50')]({'where':{'id':_0x4305e5['params']['id']}})[_0x7952('0x25')](function(_0x2a8580){return db[_0x7952('0x69')][_0x7952('0x6a')](function(_0x566d6e){return _0x2a8580['addTeams'](_0x417802,{'transaction':_0x566d6e})['then'](function(){return BPromise[_0x7952('0x6b')](_0x31f144,function(_0x1b9abd){return db[_0x7952('0x55')]['findOrCreate']({'where':{'UserId':_0x1b9abd['id'],'SmsQueueId':_0x4305e5[_0x7952('0x46')]['id']},'transaction':_0x566d6e});});})[_0x7952('0x25')](function(){_0x31f144[_0x7952('0x6c')](function(_0x2f0b52){socket[_0x7952('0x6d')](_0x7952('0x6e'),{'UserId':_0x2f0b52['id'],'SmsQueueId':_0x2a8580['id']});});});});});}})[_0x7952('0x25')](respondWithStatusCode(_0x2e44a9,null))[_0x7952('0x45')](handleError(_0x2e44a9,null));};exports[_0x7952('0x6f')]=function(_0x137056,_0x133fd5,_0x42c9de){return db[_0x7952('0x63')][_0x7952('0x43')]({'where':{'id':_0x137056[_0x7952('0x31')][_0x7952('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7952('0x64')],'as':_0x7952('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7952('0x25')](handleEntityNotFound(_0x133fd5,null))[_0x7952('0x25')](function(_0x588333){var _0x23ff9e=_[_0x7952('0x30')](_0x588333,'id');var _0x4730fe=[];var _0x1c1629=[];var _0x224e0b=squel[_0x7952('0x72')]();_0x224e0b[_0x7952('0x73')]('tq.TeamId')[_0x7952('0x74')]('team_has_sms_queues','tq')[_0x7952('0x75')](_0x7952('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7952('0x3c')](_0x7952('0x77'),_0x137056['params']['id']);for(var _0x5cb103=0x0;_0x5cb103<_0x588333[_0x7952('0x61')];_0x5cb103+=0x1){let _0x13ada9=_0x588333[_0x5cb103];for(var _0x207d9a=0x0;_0x207d9a<_0x13ada9[_0x7952('0x71')][_0x7952('0x61')];_0x207d9a+=0x1){let _0x18a453=_0x13ada9[_0x7952('0x71')][_0x207d9a];var _0x3f318b=_0x224e0b[_0x7952('0x78')]();_0x3f318b['where'](_0x7952('0x79'),_0x18a453['id']);_0x1c1629[_0x7952('0x7a')](db[_0x7952('0x69')]['query'](_0x3f318b[_0x7952('0x7b')](),{'type':db[_0x7952('0x69')]['QueryTypes'][_0x7952('0x7c')]})[_0x7952('0x25')](function(_0x4a5574){if(_0x4a5574['length']===0x1){return _0x18a453['id'];}else{var _0x55ad01=_[_0x7952('0x7d')](_['map'](_0x4a5574,_0x7952('0x7e')),function(_0x205e54){return _[_0x7952('0x7f')](_0x23ff9e,_0x205e54);});if(_0x55ad01){return _0x18a453['id'];}}}));}}return BPromise[_0x7952('0x80')](_0x1c1629)[_0x7952('0x25')](function(_0x4efca2){_0x4730fe=_(_0x4730fe)[_0x7952('0x81')](_0x4efca2)['compact']()['value']();return db['SmsQueue'][_0x7952('0x50')]({'where':{'id':_0x137056[_0x7952('0x46')]['id']}})[_0x7952('0x25')](function(_0x1868b1){return db[_0x7952('0x69')][_0x7952('0x6a')](function(_0x712444){return _0x1868b1[_0x7952('0x6f')](_0x137056['query']['ids'],{'transaction':_0x712444})['then'](function(){if(!_[_0x7952('0x82')](_0x4730fe)){return _0x1868b1[_0x7952('0x83')](_0x4730fe,{'transaction':_0x712444});}})['then'](function(){_0x4730fe[_0x7952('0x6c')](function(_0x5567f3){socket[_0x7952('0x6d')](_0x7952('0x84'),{'UserId':_0x5567f3,'SmsQueueId':_0x1868b1['id']});});});});});});})[_0x7952('0x25')](respondWithStatusCode(_0x133fd5,null))[_0x7952('0x45')](handleError(_0x133fd5,null));};exports['addAgents']=function(_0xdf1ad2,_0x5051cd,_0x30993b){return db['SmsQueue']['find']({'where':{'id':_0xdf1ad2[_0x7952('0x46')]['id']}})['then'](handleEntityNotFound(_0x5051cd,null))[_0x7952('0x25')](function(_0x312374){if(_0x312374){return _0x312374[_0x7952('0x85')](_0xdf1ad2[_0x7952('0x4a')][_0x7952('0x70')],_['omit'](_0xdf1ad2['body'],[_0x7952('0x70'),'id'])||{})['spread'](function(_0x45476e){for(var _0x171cc9=0x0;_0x171cc9<_0xdf1ad2[_0x7952('0x4a')]['ids'][_0x7952('0x61')];_0x171cc9+=0x1){socket[_0x7952('0x6d')](_0x7952('0x6e'),{'UserId':Number(_0xdf1ad2[_0x7952('0x4a')][_0x7952('0x70')][_0x171cc9]),'SmsQueueId':Number(_0xdf1ad2[_0x7952('0x46')]['id'])});}return _0x45476e;});}})[_0x7952('0x25')](respondWithResult(_0x5051cd,null))['catch'](handleError(_0x5051cd,null));};exports[_0x7952('0x83')]=function(_0x464b39,_0x1843f5,_0x4dea31){return db[_0x7952('0x2d')][_0x7952('0x50')]({'where':{'id':_0x464b39[_0x7952('0x46')]['id']}})[_0x7952('0x25')](handleEntityNotFound(_0x1843f5,null))[_0x7952('0x25')](function(_0x14ef30){if(_0x14ef30){return _0x14ef30[_0x7952('0x83')](_0x464b39['query'][_0x7952('0x70')])['then'](function(){if(_[_0x7952('0x86')](_0x464b39[_0x7952('0x31')][_0x7952('0x70')])){for(var _0x28957c=0x0;_0x28957c<_0x464b39['query'][_0x7952('0x70')][_0x7952('0x61')];_0x28957c+=0x1){socket['emit'](_0x7952('0x84'),{'UserId':Number(_0x464b39[_0x7952('0x31')][_0x7952('0x70')][_0x28957c]),'SmsQueueId':Number(_0x464b39['params']['id'])});}}else{socket['emit'](_0x7952('0x84'),{'UserId':Number(_0x464b39[_0x7952('0x31')][_0x7952('0x70')]),'SmsQueueId':Number(_0x464b39[_0x7952('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x1843f5,null))[_0x7952('0x45')](handleError(_0x1843f5,null));};exports[_0x7952('0x87')]=function(_0x18ba2c,_0x5e171e,_0x519bf3){var _0x29e926={};var _0x16f173={};var _0x3bf32a;var _0x7c36db;return db[_0x7952('0x2d')][_0x7952('0x60')]({'where':{'id':_0x18ba2c['params']['id']}})['then'](handleEntityNotFound(_0x5e171e,null))[_0x7952('0x25')](function(_0x3d6c68){if(_0x3d6c68){_0x3bf32a=_0x3d6c68;_0x16f173[_0x7952('0x34')]=_[_0x7952('0x32')](db[_0x7952('0x64')][_0x7952('0x47')]);_0x16f173[_0x7952('0x31')]=_[_0x7952('0x32')](_0x18ba2c[_0x7952('0x31')]);_0x16f173[_0x7952('0x33')]=_[_0x7952('0x36')](_0x16f173[_0x7952('0x34')],_0x16f173[_0x7952('0x31')]);_0x29e926[_0x7952('0x35')]=_['intersection'](_0x16f173[_0x7952('0x34')],qs[_0x7952('0x37')](_0x18ba2c['query'][_0x7952('0x37')]));_0x29e926['attributes']=_0x29e926[_0x7952('0x35')][_0x7952('0x61')]?_0x29e926[_0x7952('0x35')]:_0x16f173['model'];_0x29e926[_0x7952('0x3a')]=qs[_0x7952('0x3b')](_0x18ba2c[_0x7952('0x31')]['sort']);_0x29e926[_0x7952('0x3c')]=qs['filters'](_[_0x7952('0x3d')](_0x18ba2c[_0x7952('0x31')],_0x16f173[_0x7952('0x33')]));if(_0x18ba2c[_0x7952('0x31')][_0x7952('0x3e')]){_0x29e926[_0x7952('0x3c')]=_[_0x7952('0x3f')](_0x29e926[_0x7952('0x3c')],{'$or':_['map'](_0x29e926[_0x7952('0x35')],function(_0xb8dfa9){var _0x3a0617={};_0x3a0617[_0xb8dfa9]={'$like':'%'+_0x18ba2c[_0x7952('0x31')]['filter']+'%'};return _0x3a0617;})});}_0x29e926=_[_0x7952('0x3f')]({},_0x29e926,_0x18ba2c['options']);return _0x3bf32a[_0x7952('0x87')](_0x29e926);}})[_0x7952('0x25')](function(_0x16a9e9){if(_0x16a9e9){_0x7c36db=_0x16a9e9['length'];if(!_0x18ba2c[_0x7952('0x31')][_0x7952('0x38')]('nolimit')){_0x29e926[_0x7952('0x21')]=qs[_0x7952('0x21')](_0x18ba2c[_0x7952('0x31')][_0x7952('0x21')]);_0x29e926['offset']=qs['offset'](_0x18ba2c[_0x7952('0x31')]['offset']);}return _0x3bf32a[_0x7952('0x87')](_0x29e926);}})[_0x7952('0x25')](function(_0x88eb5e){if(_0x88eb5e){return _0x88eb5e?{'count':_0x7c36db,'rows':_0x88eb5e}:null;}})[_0x7952('0x25')](respondWithResult(_0x5e171e,null))[_0x7952('0x45')](handleError(_0x5e171e,null));};
\ No newline at end of file
index 08fd233..ceaf517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e2=['SmsQueue','setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x351bea,_0x5dcb11){var _0xc7cea5=function(_0x45a230){while(--_0x45a230){_0x351bea['push'](_0x351bea['shift']());}};_0xc7cea5(++_0x5dcb11);}(_0x28e2,0x1a5));var _0x228e=function(_0x227af4,_0x311449){_0x227af4=_0x227af4-0x0;var _0x23d428=_0x28e2[_0x227af4];return _0x23d428;};'use strict';var EventEmitter=require(_0x228e('0x0'));var SmsQueue=require(_0x228e('0x1'))['db'][_0x228e('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x228e('0x3')](0x0);var events={'afterCreate':_0x228e('0x4'),'afterUpdate':_0x228e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b370e){return function(_0x4a1126,_0x18c591,_0x43d0ee){SmsQueueEvents[_0x228e('0x6')](_0x4b370e+':'+_0x4a1126['id'],_0x4a1126);SmsQueueEvents[_0x228e('0x6')](_0x4b370e,_0x4a1126);_0x43d0ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x228e('0x7')](e,emitEvent(event));}}module[_0x228e('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x1b49=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x129c78,_0x45609f){var _0x1f212b=function(_0x34748d){while(--_0x34748d){_0x129c78['push'](_0x129c78['shift']());}};_0x1f212b(++_0x45609f);}(_0x1b49,0x1d6));var _0x91b4=function(_0x3b7fb0,_0x553e21){_0x3b7fb0=_0x3b7fb0-0x0;var _0x3b7fc5=_0x1b49[_0x3b7fb0];return _0x3b7fc5;};'use strict';var EventEmitter=require(_0x91b4('0x0'));var SmsQueue=require(_0x91b4('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x91b4('0x2')](0x0);var events={'afterCreate':_0x91b4('0x3'),'afterUpdate':_0x91b4('0x4'),'afterDestroy':_0x91b4('0x5')};function emitEvent(_0x183f5d){return function(_0x3e6f42,_0x115568,_0x98a2f6){SmsQueueEvents[_0x91b4('0x6')](_0x183f5d+':'+_0x3e6f42['id'],_0x3e6f42);SmsQueueEvents[_0x91b4('0x6')](_0x183f5d,_0x3e6f42);_0x98a2f6(null);};}for(var e in events){if(events[_0x91b4('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x91b4('0x8')]=SmsQueueEvents;
\ No newline at end of file
index d04ad44..3ebd781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa833=['api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','define','sms_queues','lodash','util','../../config/logger'];(function(_0x10e10a,_0x5d1eb2){var _0x2f1fda=function(_0x59bc16){while(--_0x59bc16){_0x10e10a['push'](_0x10e10a['shift']());}};_0x2f1fda(++_0x5d1eb2);}(_0xa833,0x147));var _0x3a83=function(_0x169714,_0x5f1cf8){_0x169714=_0x169714-0x0;var _0x4f410f=_0xa833[_0x169714];return _0x4f410f;};'use strict';var _=require(_0x3a83('0x0'));var util=require(_0x3a83('0x1'));var logger=require(_0x3a83('0x2'))(_0x3a83('0x3'));var moment=require('moment');var BPromise=require(_0x3a83('0x4'));var rp=require(_0x3a83('0x5'));var fs=require('fs');var path=require(_0x3a83('0x6'));var rimraf=require(_0x3a83('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a83('0x8'));module['exports']=function(_0x50fae9,_0x5b9815){return _0x50fae9[_0x3a83('0x9')]('SmsQueue',attributes,{'tableName':_0x3a83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4969=['rimraf','./smsQueue.attributes','SmsQueue','sms_queues','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4969,0xfe));var _0x9496=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x4969[_0x319cb9];return _0x1735fc;};'use strict';var _=require('lodash');var util=require(_0x9496('0x0'));var logger=require(_0x9496('0x1'))(_0x9496('0x2'));var moment=require(_0x9496('0x3'));var BPromise=require('bluebird');var rp=require(_0x9496('0x4'));var fs=require('fs');var path=require(_0x9496('0x5'));var rimraf=require(_0x9496('0x6'));var config=require('../../config/environment');var attributes=require(_0x9496('0x7'));module['exports']=function(_0x47da5b,_0x505ccd){return _0x47da5b['define'](_0x9496('0x8'),attributes,{'tableName':_0x9496('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98d8646..e63b74d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2187=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x6190a0,_0x360f8f){var _0xb65d36=function(_0xdbb169){while(--_0xdbb169){_0x6190a0['push'](_0x6190a0['shift']());}};_0xb65d36(++_0x360f8f);}(_0x2187,0x180));var _0x7218=function(_0x38d656,_0x396580){_0x38d656=_0x38d656-0x0;var _0x543450=_0x2187[_0x38d656];return _0x543450;};'use strict';var _=require(_0x7218('0x0'));var util=require(_0x7218('0x1'));var moment=require(_0x7218('0x2'));var BPromise=require('bluebird');var rs=require(_0x7218('0x3'));var fs=require('fs');var Redis=require(_0x7218('0x4'));var db=require(_0x7218('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7218('0x6'))('rpc');var config=require(_0x7218('0x7'));var jayson=require(_0x7218('0x8'));var client=jayson[_0x7218('0x9')][_0x7218('0xa')]({'port':0x232a});config[_0x7218('0xb')]=_[_0x7218('0xc')](config[_0x7218('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7218('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x7218('0xe')](socket);function respondWithRpcPromise(_0x232f8,_0x493f1d,_0xd5008){return new BPromise(function(_0x207bb7,_0x4f86f8){return client['request'](_0x232f8,_0xd5008)[_0x7218('0xf')](function(_0x395725){logger['info'](_0x7218('0x10'),_0x493f1d,_0x7218('0x11'));logger[_0x7218('0x12')](_0x7218('0x13'),_0x493f1d,_0x7218('0x11'),JSON[_0x7218('0x14')](_0x395725));if(_0x395725[_0x7218('0x15')]){if(_0x395725['error'][_0x7218('0x16')]===0x1f4){logger[_0x7218('0x15')](_0x7218('0x10'),_0x493f1d,_0x395725[_0x7218('0x15')]['message']);return _0x4f86f8(_0x395725[_0x7218('0x15')][_0x7218('0x17')]);}logger[_0x7218('0x15')](_0x7218('0x10'),_0x493f1d,_0x395725[_0x7218('0x15')]['message']);return _0x207bb7(_0x395725[_0x7218('0x15')][_0x7218('0x17')]);}else{logger[_0x7218('0x18')](_0x7218('0x10'),_0x493f1d,_0x7218('0x11'));_0x207bb7(_0x395725[_0x7218('0x19')][_0x7218('0x17')]);}})[_0x7218('0x1a')](function(_0x335302){logger['error'](_0x7218('0x10'),_0x493f1d,_0x335302);_0x4f86f8(_0x335302);});});}exports[_0x7218('0x1b')]=function(_0x3b0d1d){var _0x2f81ca=this;return new Promise(function(_0x25292a,_0x1fd276){return db[_0x7218('0x1c')]['findAll']({'raw':_0x3b0d1d[_0x7218('0x1d')]?_0x3b0d1d[_0x7218('0x1d')][_0x7218('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b0d1d['options']?_0x3b0d1d[_0x7218('0x1d')][_0x7218('0x1f')]||null:null,'attributes':_0x3b0d1d['options']?_0x3b0d1d['options'][_0x7218('0x20')]||null:null,'limit':_0x3b0d1d[_0x7218('0x1d')]?_0x3b0d1d[_0x7218('0x1d')][_0x7218('0x21')]||null:null,'include':_0x3b0d1d[_0x7218('0x1d')]?_0x3b0d1d[_0x7218('0x1d')][_0x7218('0x22')]?_[_0x7218('0x23')](_0x3b0d1d[_0x7218('0x1d')][_0x7218('0x22')],function(_0x286b3d){return{'model':db[_0x286b3d['model']],'as':_0x286b3d['as'],'attributes':_0x286b3d[_0x7218('0x20')],'include':_0x286b3d[_0x7218('0x22')]?_[_0x7218('0x23')](_0x286b3d['include'],function(_0x2c6363){return{'model':db[_0x2c6363[_0x7218('0x24')]],'as':_0x2c6363['as'],'attributes':_0x2c6363['attributes'],'include':_0x2c6363['include']?_['map'](_0x2c6363['include'],function(_0x41666f){return{'model':db[_0x41666f[_0x7218('0x24')]],'as':_0x41666f['as'],'attributes':_0x41666f[_0x7218('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7218('0xf')](function(_0xab794d){logger[_0x7218('0x18')](_0x7218('0x1b'),_0x3b0d1d);logger['debug'](_0x7218('0x1b'),_0x3b0d1d,JSON[_0x7218('0x14')](_0xab794d));_0x25292a(_0xab794d);})[_0x7218('0x1a')](function(_0xf571f9){logger[_0x7218('0x15')]('GetSmsQueue',_0xf571f9[_0x7218('0x17')],_0x3b0d1d);_0x1fd276(_0x2f81ca[_0x7218('0x15')](0x1f4,_0xf571f9[_0x7218('0x17')]));});});};exports[_0x7218('0x25')]=function(_0x3fbebe){var _0x33cdb4=this;return new Promise(function(_0x4e9cef,_0x462477){return db['SmsQueue'][_0x7218('0x26')]({'raw':_0x3fbebe[_0x7218('0x1d')]?_0x3fbebe[_0x7218('0x1d')][_0x7218('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fbebe[_0x7218('0x1d')]?_0x3fbebe[_0x7218('0x1d')][_0x7218('0x1f')]||null:null,'attributes':_0x3fbebe[_0x7218('0x1d')]?_0x3fbebe[_0x7218('0x1d')][_0x7218('0x20')]||null:null,'include':_0x3fbebe[_0x7218('0x1d')]?_0x3fbebe[_0x7218('0x1d')][_0x7218('0x22')]?_[_0x7218('0x23')](_0x3fbebe[_0x7218('0x1d')][_0x7218('0x22')],function(_0x5e497c){return{'model':db[_0x5e497c[_0x7218('0x24')]],'as':_0x5e497c['as'],'attributes':_0x5e497c['attributes'],'include':_0x5e497c['include']?_[_0x7218('0x23')](_0x5e497c[_0x7218('0x22')],function(_0x39ac03){return{'model':db[_0x39ac03['model']],'as':_0x39ac03['as'],'attributes':_0x39ac03[_0x7218('0x20')],'include':_0x39ac03['include']?_['map'](_0x39ac03[_0x7218('0x22')],function(_0x5e7d02){return{'model':db[_0x5e7d02[_0x7218('0x24')]],'as':_0x5e7d02['as'],'attributes':_0x5e7d02['attributes']};}):[]};}):[]};}):[]:[]})[_0x7218('0xf')](function(_0x14859b){logger['info'](_0x7218('0x25'),_0x3fbebe);logger['debug']('ShowSmsQueue',_0x3fbebe,JSON[_0x7218('0x14')](_0x14859b));_0x4e9cef(_0x14859b);})[_0x7218('0x1a')](function(_0x31eee9){logger[_0x7218('0x15')]('ShowSmsQueue',_0x31eee9[_0x7218('0x17')],_0x3fbebe);_0x462477(_0x33cdb4[_0x7218('0x15')](0x1f4,_0x31eee9[_0x7218('0x17')]));});});};
\ No newline at end of file
+var _0x34fc=['debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include','map','model','stringify','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x57fd0d,_0x2630ea){var _0x4b57f6=function(_0x5d314c){while(--_0x5d314c){_0x57fd0d['push'](_0x57fd0d['shift']());}};_0x4b57f6(++_0x2630ea);}(_0x34fc,0x124));var _0xc34f=function(_0x285c84,_0x56b3a1){_0x285c84=_0x285c84-0x0;var _0x14b537=_0x34fc[_0x285c84];return _0x14b537;};'use strict';var _=require(_0xc34f('0x0'));var util=require('util');var moment=require(_0xc34f('0x1'));var BPromise=require(_0xc34f('0x2'));var rs=require(_0xc34f('0x3'));var fs=require('fs');var Redis=require(_0xc34f('0x4'));var db=require(_0xc34f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc34f('0x6'))('rpc');var config=require(_0xc34f('0x7'));var jayson=require(_0xc34f('0x8'));var client=jayson[_0xc34f('0x9')]['http']({'port':0x232a});config[_0xc34f('0xa')]=_[_0xc34f('0xb')](config[_0xc34f('0xa')],{'host':_0xc34f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc34f('0xa')]));require(_0xc34f('0xd'))[_0xc34f('0xe')](socket);function respondWithRpcPromise(_0x38cd04,_0x376356,_0x35b792){return new BPromise(function(_0x7762a3,_0x57fd94){return client[_0xc34f('0xf')](_0x38cd04,_0x35b792)[_0xc34f('0x10')](function(_0x182cf0){logger[_0xc34f('0x11')](_0xc34f('0x12'),_0x376356,_0xc34f('0x13'));logger[_0xc34f('0x14')](_0xc34f('0x15'),_0x376356,_0xc34f('0x13'),JSON['stringify'](_0x182cf0));if(_0x182cf0['error']){if(_0x182cf0[_0xc34f('0x16')][_0xc34f('0x17')]===0x1f4){logger[_0xc34f('0x16')](_0xc34f('0x12'),_0x376356,_0x182cf0['error'][_0xc34f('0x18')]);return _0x57fd94(_0x182cf0['error']['message']);}logger['error'](_0xc34f('0x12'),_0x376356,_0x182cf0[_0xc34f('0x16')]['message']);return _0x7762a3(_0x182cf0[_0xc34f('0x16')]['message']);}else{logger['info'](_0xc34f('0x12'),_0x376356,_0xc34f('0x13'));_0x7762a3(_0x182cf0[_0xc34f('0x19')][_0xc34f('0x18')]);}})[_0xc34f('0x1a')](function(_0x566177){logger[_0xc34f('0x16')](_0xc34f('0x12'),_0x376356,_0x566177);_0x57fd94(_0x566177);});});}exports[_0xc34f('0x1b')]=function(_0x42cebe){var _0x55f4a5=this;return new Promise(function(_0x552d7d,_0x107981){return db[_0xc34f('0x1c')][_0xc34f('0x1d')]({'raw':_0x42cebe[_0xc34f('0x1e')]?_0x42cebe[_0xc34f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x42cebe[_0xc34f('0x1e')]?_0x42cebe[_0xc34f('0x1e')][_0xc34f('0x1f')]||null:null,'attributes':_0x42cebe['options']?_0x42cebe[_0xc34f('0x1e')][_0xc34f('0x20')]||null:null,'limit':_0x42cebe['options']?_0x42cebe[_0xc34f('0x1e')]['limit']||null:null,'include':_0x42cebe[_0xc34f('0x1e')]?_0x42cebe[_0xc34f('0x1e')][_0xc34f('0x21')]?_[_0xc34f('0x22')](_0x42cebe[_0xc34f('0x1e')][_0xc34f('0x21')],function(_0x2f3298){return{'model':db[_0x2f3298[_0xc34f('0x23')]],'as':_0x2f3298['as'],'attributes':_0x2f3298[_0xc34f('0x20')],'include':_0x2f3298['include']?_['map'](_0x2f3298[_0xc34f('0x21')],function(_0xb195ee){return{'model':db[_0xb195ee[_0xc34f('0x23')]],'as':_0xb195ee['as'],'attributes':_0xb195ee[_0xc34f('0x20')],'include':_0xb195ee[_0xc34f('0x21')]?_['map'](_0xb195ee[_0xc34f('0x21')],function(_0x5552d3){return{'model':db[_0x5552d3[_0xc34f('0x23')]],'as':_0x5552d3['as'],'attributes':_0x5552d3[_0xc34f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x227702){logger[_0xc34f('0x11')](_0xc34f('0x1b'),_0x42cebe);logger[_0xc34f('0x14')](_0xc34f('0x1b'),_0x42cebe,JSON[_0xc34f('0x24')](_0x227702));_0x552d7d(_0x227702);})[_0xc34f('0x1a')](function(_0x55e950){logger[_0xc34f('0x16')](_0xc34f('0x1b'),_0x55e950['message'],_0x42cebe);_0x107981(_0x55f4a5['error'](0x1f4,_0x55e950[_0xc34f('0x18')]));});});};exports[_0xc34f('0x25')]=function(_0x4ccaec){var _0x4d6e49=this;return new Promise(function(_0x9d7c2e,_0x34f9ee){return db[_0xc34f('0x1c')][_0xc34f('0x26')]({'raw':_0x4ccaec[_0xc34f('0x1e')]?_0x4ccaec['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ccaec[_0xc34f('0x1e')]?_0x4ccaec[_0xc34f('0x1e')][_0xc34f('0x1f')]||null:null,'attributes':_0x4ccaec[_0xc34f('0x1e')]?_0x4ccaec[_0xc34f('0x1e')]['attributes']||null:null,'include':_0x4ccaec[_0xc34f('0x1e')]?_0x4ccaec[_0xc34f('0x1e')][_0xc34f('0x21')]?_[_0xc34f('0x22')](_0x4ccaec['options']['include'],function(_0x4b85fb){return{'model':db[_0x4b85fb[_0xc34f('0x23')]],'as':_0x4b85fb['as'],'attributes':_0x4b85fb['attributes'],'include':_0x4b85fb['include']?_[_0xc34f('0x22')](_0x4b85fb[_0xc34f('0x21')],function(_0x2ee633){return{'model':db[_0x2ee633[_0xc34f('0x23')]],'as':_0x2ee633['as'],'attributes':_0x2ee633[_0xc34f('0x20')],'include':_0x2ee633[_0xc34f('0x21')]?_[_0xc34f('0x22')](_0x2ee633[_0xc34f('0x21')],function(_0x415b0f){return{'model':db[_0x415b0f[_0xc34f('0x23')]],'as':_0x415b0f['as'],'attributes':_0x415b0f[_0xc34f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc34f('0x10')](function(_0x229e78){logger[_0xc34f('0x11')](_0xc34f('0x25'),_0x4ccaec);logger[_0xc34f('0x14')](_0xc34f('0x25'),_0x4ccaec,JSON[_0xc34f('0x24')](_0x229e78));_0x9d7c2e(_0x229e78);})[_0xc34f('0x1a')](function(_0x5531e3){logger[_0xc34f('0x16')](_0xc34f('0x25'),_0x5531e3[_0xc34f('0x18')],_0x4ccaec);_0x34f9ee(_0x4d6e49[_0xc34f('0x16')](0x1f4,_0x5531e3['message']));});});};
\ No newline at end of file
index 2e7cfc2..dafa8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f65=['smsQueue:','./smsQueue.events','save','update','emit','removeListener','register','length'];(function(_0x1b69c1,_0x3bcd29){var _0x2f6b4a=function(_0x9718f2){while(--_0x9718f2){_0x1b69c1['push'](_0x1b69c1['shift']());}};_0x2f6b4a(++_0x3bcd29);}(_0x7f65,0xb9));var _0x57f6=function(_0xd04129,_0x65dac9){_0xd04129=_0xd04129-0x0;var _0x36b59e=_0x7f65[_0xd04129];return _0x36b59e;};'use strict';var SmsQueueEvents=require(_0x57f6('0x0'));var events=[_0x57f6('0x1'),'remove',_0x57f6('0x2')];function createListener(_0x3eeef1,_0x1d63e2){return function(_0x104afd){_0x1d63e2[_0x57f6('0x3')](_0x3eeef1,_0x104afd);};}function removeListener(_0x44abb5,_0x13c256){return function(){SmsQueueEvents[_0x57f6('0x4')](_0x44abb5,_0x13c256);};}exports[_0x57f6('0x5')]=function(_0x22327f){for(var _0x22c0ef=0x0,_0x108d11=events[_0x57f6('0x6')];_0x22c0ef<_0x108d11;_0x22c0ef++){var _0x31577f=events[_0x22c0ef];var _0x3bbe00=createListener(_0x57f6('0x7')+_0x31577f,_0x22327f);SmsQueueEvents['on'](_0x31577f,_0x3bbe00);}};
\ No newline at end of file
+var _0xda0a=['emit','removeListener','smsQueue:','./smsQueue.events','remove','update'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xda0a,0x195));var _0xada0=function(_0x3b3833,_0xdd2d22){_0x3b3833=_0x3b3833-0x0;var _0x1469f7=_0xda0a[_0x3b3833];return _0x1469f7;};'use strict';var SmsQueueEvents=require(_0xada0('0x0'));var events=['save',_0xada0('0x1'),_0xada0('0x2')];function createListener(_0x99a830,_0x34b7fe){return function(_0x34b47b){_0x34b7fe[_0xada0('0x3')](_0x99a830,_0x34b47b);};}function removeListener(_0x17b434,_0x47d836){return function(){SmsQueueEvents[_0xada0('0x4')](_0x17b434,_0x47d836);};}exports['register']=function(_0x3cb63a){for(var _0x58ac45=0x0,_0x5907d1=events['length'];_0x58ac45<_0x5907d1;_0x58ac45++){var _0x552a50=events[_0x58ac45];var _0x3f02f4=createListener(_0xada0('0x5')+_0x552a50,_0x3cb63a);SmsQueueEvents['on'](_0x552a50,_0x3f02f4);}};
\ No newline at end of file
index 20d6aeb..e195b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f76=['show','post','create','update','/:id','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5f5167,_0xc6e6db){var _0x47bb61=function(_0x4427d2){while(--_0x4427d2){_0x5f5167['push'](_0x5f5167['shift']());}};_0x47bb61(++_0xc6e6db);}(_0x6f76,0x14a));var _0x66f7=function(_0x505ad1,_0x5c9928){_0x505ad1=_0x505ad1-0x0;var _0x34ac4a=_0x6f76[_0x505ad1];return _0x34ac4a;};'use strict';var multer=require(_0x66f7('0x0'));var util=require('util');var path=require(_0x66f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x66f7('0x2'));var router=express[_0x66f7('0x3')]();var fs_extra=require(_0x66f7('0x4'));var auth=require(_0x66f7('0x5'));var interaction=require(_0x66f7('0x6'));var config=require('../../config/environment');var controller=require(_0x66f7('0x7'));router[_0x66f7('0x8')]('/',auth[_0x66f7('0x9')](),controller[_0x66f7('0xa')]);router[_0x66f7('0x8')](_0x66f7('0xb'),auth[_0x66f7('0x9')](),controller['describe']);router['get']('/:id',auth[_0x66f7('0x9')](),controller[_0x66f7('0xc')]);router[_0x66f7('0xd')]('/',auth[_0x66f7('0x9')](),controller[_0x66f7('0xe')]);router['put']('/:id',auth[_0x66f7('0x9')](),controller[_0x66f7('0xf')]);router['delete'](_0x66f7('0x10'),auth[_0x66f7('0x9')](),controller[_0x66f7('0x11')]);module[_0x66f7('0x12')]=router;
\ No newline at end of file
+var _0x234f=['isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./smsQueueReport.controller','get'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0x234f,0xb6));var _0xf234=function(_0xa3d63,_0x328177){_0xa3d63=_0xa3d63-0x0;var _0x2ee6de=_0x234f[_0xa3d63];return _0x2ee6de;};'use strict';var multer=require(_0xf234('0x0'));var util=require(_0xf234('0x1'));var path=require(_0xf234('0x2'));var timeout=require(_0xf234('0x3'));var express=require(_0xf234('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(_0xf234('0x5'));var controller=require(_0xf234('0x6'));router[_0xf234('0x7')]('/',auth[_0xf234('0x8')](),controller[_0xf234('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf234('0xa')]);router[_0xf234('0x7')](_0xf234('0xb'),auth[_0xf234('0x8')](),controller[_0xf234('0xc')]);router[_0xf234('0xd')]('/',auth[_0xf234('0x8')](),controller[_0xf234('0xe')]);router[_0xf234('0xf')](_0xf234('0xb'),auth[_0xf234('0x8')](),controller[_0xf234('0x10')]);router['delete'](_0xf234('0xb'),auth[_0xf234('0x8')](),controller[_0xf234('0x11')]);module[_0xf234('0x12')]=router;
\ No newline at end of file
index c3fb01d..26560d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6355=['sequelize','exports','STRING','DATE','moment'];(function(_0x241e9d,_0x1f5cdc){var _0x118c5c=function(_0x38d03c){while(--_0x38d03c){_0x241e9d['push'](_0x241e9d['shift']());}};_0x118c5c(++_0x1f5cdc);}(_0x6355,0x16c));var _0x5635=function(_0x5ca441,_0x12224b){_0x5ca441=_0x5ca441-0x0;var _0x1d43d1=_0x6355[_0x5ca441];return _0x1d43d1;};'use strict';var moment=require(_0x5635('0x0'));var Sequelize=require(_0x5635('0x1'));module[_0x5635('0x2')]={'uniqueid':{'type':Sequelize[_0x5635('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5635('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5635('0x4')]},'exitAt':{'type':Sequelize[_0x5635('0x4')]},'reason':{'type':Sequelize[_0x5635('0x3')]}};
\ No newline at end of file
+var _0x21a5=['exports','STRING','DATE','sequelize'];(function(_0xdda3e9,_0x87260b){var _0x3dcc20=function(_0x87b2af){while(--_0x87b2af){_0xdda3e9['push'](_0xdda3e9['shift']());}};_0x3dcc20(++_0x87260b);}(_0x21a5,0x12b));var _0x521a=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x21a5[_0x5a27e8];return _0x4e38f7;};'use strict';var moment=require('moment');var Sequelize=require(_0x521a('0x0'));module[_0x521a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x521a('0x2')]},'joinAt':{'type':Sequelize[_0x521a('0x3')]},'leaveAt':{'type':Sequelize[_0x521a('0x3')]},'acceptAt':{'type':Sequelize[_0x521a('0x3')]},'exitAt':{'type':Sequelize[_0x521a('0x3')]},'reason':{'type':Sequelize[_0x521a('0x2')]}};
\ No newline at end of file
index 9f0c877..a1f12c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8615=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','reject','destroy','then','end','error','stack','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','name','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','filters','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x36406e,_0x48fcef){var _0x117bd4=function(_0x2b2ec4){while(--_0x2b2ec4){_0x36406e['push'](_0x36406e['shift']());}};_0x117bd4(++_0x48fcef);}(_0x8615,0x19d));var _0x5861=function(_0xa05fd3,_0x4c6517){_0xa05fd3=_0xa05fd3-0x0;var _0x581738=_0x8615[_0xa05fd3];return _0x581738;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5861('0x0'));var zipdir=require(_0x5861('0x1'));var jsonpatch=require(_0x5861('0x2'));var rp=require(_0x5861('0x3'));var moment=require(_0x5861('0x4'));var BPromise=require(_0x5861('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5861('0x6'));var squel=require(_0x5861('0x7'));var crypto=require(_0x5861('0x8'));var jsforce=require(_0x5861('0x9'));var deskjs=require(_0x5861('0xa'));var toCsv=require(_0x5861('0xb'));var querystring=require(_0x5861('0xc'));var Papa=require(_0x5861('0xd'));var Redis=require(_0x5861('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5861('0xf'));var as=require(_0x5861('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5861('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5861('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5861('0x13'))['db'];function respondWithStatusCode(_0x4c1613,_0x3ee718){_0x3ee718=_0x3ee718||0xcc;return function(_0x598f76){if(_0x598f76){return _0x4c1613[_0x5861('0x14')](_0x3ee718);}return _0x4c1613[_0x5861('0x15')](_0x3ee718)['end']();};}function respondWithResult(_0x4af8f4,_0x43cc68){_0x43cc68=_0x43cc68||0xc8;return function(_0x4858c2){if(_0x4858c2){return _0x4af8f4['status'](_0x43cc68)[_0x5861('0x16')](_0x4858c2);}};}function respondWithFilteredResult(_0x1d9fdc,_0x56eef9){return function(_0x23b8df){if(_0x23b8df){var _0x4dd115=typeof _0x56eef9['offset']==='undefined'&&typeof _0x56eef9['limit']===_0x5861('0x17');var _0xefa39=_0x23b8df['count'];var _0x33c14d=_0x4dd115?0x0:_0x56eef9[_0x5861('0x18')];var _0x5e905f=_0x4dd115?_0x23b8df[_0x5861('0x19')]:_0x56eef9[_0x5861('0x18')]+_0x56eef9[_0x5861('0x1a')];var _0x3b21da;if(_0x5e905f>=_0xefa39){_0x5e905f=_0xefa39;_0x3b21da=0xc8;}else{_0x3b21da=0xce;}_0x1d9fdc[_0x5861('0x15')](_0x3b21da);return _0x1d9fdc[_0x5861('0x1b')](_0x5861('0x1c'),_0x33c14d+'-'+_0x5e905f+'/'+_0xefa39)[_0x5861('0x16')](_0x23b8df);}return null;};}function patchUpdates(_0x544d8d){return function(_0x72c11f){try{jsonpatch['apply'](_0x72c11f,_0x544d8d,!![]);}catch(_0xa36f30){return BPromise[_0x5861('0x1d')](_0xa36f30);}return _0x72c11f['save']();};}function saveUpdates(_0x8aa1e2,_0x128c00){return function(_0x8dd4a1){if(_0x8dd4a1){return _0x8dd4a1['update'](_0x8aa1e2)['then'](function(_0x2636c8){return _0x2636c8;});}return null;};}function removeEntity(_0x11e25c,_0x337bbc){return function(_0x236e80){if(_0x236e80){return _0x236e80[_0x5861('0x1e')]()[_0x5861('0x1f')](function(){_0x11e25c['status'](0xcc)[_0x5861('0x20')]();});}};}function handleEntityNotFound(_0x5741ad,_0x3e70d0){return function(_0x2bed64){if(!_0x2bed64){_0x5741ad[_0x5861('0x14')](0x194);}return _0x2bed64;};}function handleError(_0x2da036,_0x48efa9){_0x48efa9=_0x48efa9||0x1f4;return function(_0x29aaba){logger[_0x5861('0x21')](_0x29aaba[_0x5861('0x22')]);if(_0x29aaba['name']){delete _0x29aaba['name'];}_0x2da036[_0x5861('0x15')](_0x48efa9)[_0x5861('0x23')](_0x29aaba);};}exports[_0x5861('0x24')]=function(_0x4bb3c3,_0x311733){var _0x2bb085={},_0x111e3e={},_0x4c1966={'count':0x0,'rows':[]};var _0x2cf507=_[_0x5861('0x25')](db[_0x5861('0x26')][_0x5861('0x27')],function(_0xde9c6a){return{'name':_0xde9c6a[_0x5861('0x28')],'type':_0xde9c6a[_0x5861('0x29')][_0x5861('0x2a')]};});_0x111e3e['model']=_['map'](_0x2cf507,_0x5861('0x2b'));_0x111e3e[_0x5861('0x2c')]=_['keys'](_0x4bb3c3[_0x5861('0x2c')]);_0x111e3e['filters']=_['intersection'](_0x111e3e[_0x5861('0x2d')],_0x111e3e[_0x5861('0x2c')]);_0x2bb085['attributes']=_[_0x5861('0x2e')](_0x111e3e[_0x5861('0x2d')],qs[_0x5861('0x2f')](_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x2f')]));_0x2bb085[_0x5861('0x30')]=_0x2bb085[_0x5861('0x30')][_0x5861('0x31')]?_0x2bb085['attributes']:_0x111e3e[_0x5861('0x2d')];if(!_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x32')](_0x5861('0x33'))){_0x2bb085[_0x5861('0x1a')]=qs['limit'](_0x4bb3c3['query'][_0x5861('0x1a')]);_0x2bb085[_0x5861('0x18')]=qs[_0x5861('0x18')](_0x4bb3c3['query']['offset']);}_0x2bb085['order']=qs[_0x5861('0x34')](_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x34')]);_0x2bb085[_0x5861('0x35')]=qs['filters'](_[_0x5861('0x36')](_0x4bb3c3[_0x5861('0x2c')],_0x111e3e['filters']),_0x2cf507);if(_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x37')]){_0x2bb085[_0x5861('0x35')]=_[_0x5861('0x38')](_0x2bb085[_0x5861('0x35')],{'$or':_[_0x5861('0x25')](_0x2cf507,function(_0x4f8e4f){if(_0x4f8e4f[_0x5861('0x29')]!=='VIRTUAL'){var _0x48ca66={};_0x48ca66[_0x4f8e4f[_0x5861('0x2b')]]={'$like':'%'+_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x37')]+'%'};return _0x48ca66;}})});}_0x2bb085=_[_0x5861('0x38')]({},_0x2bb085,_0x4bb3c3[_0x5861('0x39')]);var _0x3ccc1f={'where':_0x2bb085[_0x5861('0x35')]};return db['SmsQueueReport'][_0x5861('0x19')](_0x3ccc1f)[_0x5861('0x1f')](function(_0x4fa1b5){_0x4c1966[_0x5861('0x19')]=_0x4fa1b5;if(_0x4bb3c3[_0x5861('0x2c')][_0x5861('0x3a')]){_0x2bb085[_0x5861('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x5861('0x3c')](_0x2bb085);})[_0x5861('0x1f')](function(_0x1fed0f){_0x4c1966['rows']=_0x1fed0f;return _0x4c1966;})[_0x5861('0x1f')](respondWithFilteredResult(_0x311733,_0x2bb085))[_0x5861('0x3d')](handleError(_0x311733,null));};exports[_0x5861('0x3e')]=function(_0x2f2b99,_0x160639){var _0x12b067={'raw':!![],'where':{'id':_0x2f2b99[_0x5861('0x3f')]['id']}},_0xc04f2={};_0xc04f2[_0x5861('0x2d')]=_[_0x5861('0x40')](db[_0x5861('0x26')][_0x5861('0x27')]);_0xc04f2['query']=_[_0x5861('0x40')](_0x2f2b99['query']);_0xc04f2[_0x5861('0x41')]=_['intersection'](_0xc04f2['model'],_0xc04f2['query']);_0x12b067[_0x5861('0x30')]=_[_0x5861('0x2e')](_0xc04f2[_0x5861('0x2d')],qs['fields'](_0x2f2b99['query'][_0x5861('0x2f')]));_0x12b067[_0x5861('0x30')]=_0x12b067['attributes'][_0x5861('0x31')]?_0x12b067[_0x5861('0x30')]:_0xc04f2[_0x5861('0x2d')];if(_0x2f2b99[_0x5861('0x2c')][_0x5861('0x3a')]){_0x12b067[_0x5861('0x3b')]=[{'all':!![]}];}_0x12b067=_[_0x5861('0x38')]({},_0x12b067,_0x2f2b99[_0x5861('0x39')]);return db[_0x5861('0x26')][_0x5861('0x42')](_0x12b067)[_0x5861('0x1f')](handleEntityNotFound(_0x160639,null))[_0x5861('0x1f')](respondWithResult(_0x160639,null))['catch'](handleError(_0x160639,null));};exports['create']=function(_0x44ce92,_0xef9655){return db[_0x5861('0x26')][_0x5861('0x43')](_0x44ce92[_0x5861('0x44')],{})[_0x5861('0x1f')](respondWithResult(_0xef9655,0xc9))[_0x5861('0x3d')](handleError(_0xef9655,null));};exports[_0x5861('0x45')]=function(_0x20727a,_0x43a9a8){if(_0x20727a[_0x5861('0x44')]['id']){delete _0x20727a[_0x5861('0x44')]['id'];}return db['SmsQueueReport'][_0x5861('0x42')]({'where':{'id':_0x20727a['params']['id']}})[_0x5861('0x1f')](handleEntityNotFound(_0x43a9a8,null))[_0x5861('0x1f')](saveUpdates(_0x20727a[_0x5861('0x44')],null))['then'](respondWithResult(_0x43a9a8,null))[_0x5861('0x3d')](handleError(_0x43a9a8,null));};exports['destroy']=function(_0x5ebfdd,_0x149e2f){return db[_0x5861('0x26')]['find']({'where':{'id':_0x5ebfdd[_0x5861('0x3f')]['id']}})[_0x5861('0x1f')](handleEntityNotFound(_0x149e2f,null))[_0x5861('0x1f')](removeEntity(_0x149e2f,null))['catch'](handleError(_0x149e2f,null));};exports[_0x5861('0x46')]=function(_0x20245b,_0x271d8e){return db[_0x5861('0x26')][_0x5861('0x46')]()[_0x5861('0x1f')](respondWithResult(_0x271d8e,null))[_0x5861('0x3d')](handleError(_0x271d8e,null));};
\ No newline at end of file
+var _0xc81b=['count','offset','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','catch','keys','length','includeAll','include','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','sendStatus','status','end','undefined','limit'];(function(_0x4801eb,_0x3d8265){var _0x2c92c3=function(_0x2251c9){while(--_0x2251c9){_0x4801eb['push'](_0x4801eb['shift']());}};_0x2c92c3(++_0x3d8265);}(_0xc81b,0x1aa));var _0xbc81=function(_0x37b72c,_0x5cdded){_0x37b72c=_0x37b72c-0x0;var _0x23978a=_0xc81b[_0x37b72c];return _0x23978a;};'use strict';var emlformat=require(_0xbc81('0x0'));var rimraf=require(_0xbc81('0x1'));var zipdir=require(_0xbc81('0x2'));var jsonpatch=require(_0xbc81('0x3'));var rp=require(_0xbc81('0x4'));var moment=require('moment');var BPromise=require(_0xbc81('0x5'));var Mustache=require(_0xbc81('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbc81('0x7'));var csv=require(_0xbc81('0x8'));var ejs=require(_0xbc81('0x9'));var fs=require('fs');var fs_extra=require(_0xbc81('0xa'));var _=require(_0xbc81('0xb'));var squel=require('squel');var crypto=require(_0xbc81('0xc'));var jsforce=require(_0xbc81('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbc81('0x8'));var querystring=require(_0xbc81('0xe'));var Papa=require(_0xbc81('0xf'));var Redis=require(_0xbc81('0x10'));var authService=require(_0xbc81('0x11'));var qs=require(_0xbc81('0x12'));var as=require(_0xbc81('0x13'));var hardwareService=require(_0xbc81('0x14'));var logger=require(_0xbc81('0x15'))(_0xbc81('0x16'));var utils=require(_0xbc81('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbc81('0x18'))['db'];function respondWithStatusCode(_0x4b8ddb,_0x70d458){_0x70d458=_0x70d458||0xcc;return function(_0x5be4f0){if(_0x5be4f0){return _0x4b8ddb[_0xbc81('0x19')](_0x70d458);}return _0x4b8ddb[_0xbc81('0x1a')](_0x70d458)[_0xbc81('0x1b')]();};}function respondWithResult(_0x512141,_0x4c718f){_0x4c718f=_0x4c718f||0xc8;return function(_0x3029f2){if(_0x3029f2){return _0x512141['status'](_0x4c718f)['json'](_0x3029f2);}};}function respondWithFilteredResult(_0x30e58e,_0x3a4e1a){return function(_0x26b3e9){if(_0x26b3e9){var _0x2f8bc0=typeof _0x3a4e1a['offset']===_0xbc81('0x1c')&&typeof _0x3a4e1a[_0xbc81('0x1d')]===_0xbc81('0x1c');var _0x946fc7=_0x26b3e9[_0xbc81('0x1e')];var _0x2b29f9=_0x2f8bc0?0x0:_0x3a4e1a['offset'];var _0x42af8a=_0x2f8bc0?_0x26b3e9['count']:_0x3a4e1a[_0xbc81('0x1f')]+_0x3a4e1a[_0xbc81('0x1d')];var _0x1a4b32;if(_0x42af8a>=_0x946fc7){_0x42af8a=_0x946fc7;_0x1a4b32=0xc8;}else{_0x1a4b32=0xce;}_0x30e58e['status'](_0x1a4b32);return _0x30e58e['set'](_0xbc81('0x20'),_0x2b29f9+'-'+_0x42af8a+'/'+_0x946fc7)[_0xbc81('0x21')](_0x26b3e9);}return null;};}function patchUpdates(_0x182f93){return function(_0x5a3db4){try{jsonpatch[_0xbc81('0x22')](_0x5a3db4,_0x182f93,!![]);}catch(_0x1c0ad1){return BPromise[_0xbc81('0x23')](_0x1c0ad1);}return _0x5a3db4[_0xbc81('0x24')]();};}function saveUpdates(_0x1b0134,_0x3c98b2){return function(_0x5aba2a){if(_0x5aba2a){return _0x5aba2a['update'](_0x1b0134)[_0xbc81('0x25')](function(_0x5719cc){return _0x5719cc;});}return null;};}function removeEntity(_0x45d1af,_0x108c81){return function(_0x4ad132){if(_0x4ad132){return _0x4ad132[_0xbc81('0x26')]()[_0xbc81('0x25')](function(){_0x45d1af['status'](0xcc)[_0xbc81('0x1b')]();});}};}function handleEntityNotFound(_0x2beebb,_0x36c973){return function(_0x320af3){if(!_0x320af3){_0x2beebb[_0xbc81('0x19')](0x194);}return _0x320af3;};}function handleError(_0x38c8b7,_0x270bfd){_0x270bfd=_0x270bfd||0x1f4;return function(_0x17d16){logger[_0xbc81('0x27')](_0x17d16[_0xbc81('0x28')]);if(_0x17d16[_0xbc81('0x29')]){delete _0x17d16[_0xbc81('0x29')];}_0x38c8b7[_0xbc81('0x1a')](_0x270bfd)[_0xbc81('0x2a')](_0x17d16);};}exports[_0xbc81('0x2b')]=function(_0x3bc9d8,_0x15e9d8){var _0x654566={},_0x37573a={},_0x5a15be={'count':0x0,'rows':[]};var _0x11a98d=_[_0xbc81('0x2c')](db[_0xbc81('0x2d')][_0xbc81('0x2e')],function(_0x529721){return{'name':_0x529721['fieldName'],'type':_0x529721[_0xbc81('0x2f')][_0xbc81('0x30')]};});_0x37573a['model']=_[_0xbc81('0x2c')](_0x11a98d,_0xbc81('0x29'));_0x37573a[_0xbc81('0x31')]=_['keys'](_0x3bc9d8[_0xbc81('0x31')]);_0x37573a[_0xbc81('0x32')]=_[_0xbc81('0x33')](_0x37573a[_0xbc81('0x34')],_0x37573a['query']);_0x654566[_0xbc81('0x35')]=_[_0xbc81('0x33')](_0x37573a[_0xbc81('0x34')],qs[_0xbc81('0x36')](_0x3bc9d8[_0xbc81('0x31')][_0xbc81('0x36')]));_0x654566[_0xbc81('0x35')]=_0x654566[_0xbc81('0x35')]['length']?_0x654566[_0xbc81('0x35')]:_0x37573a[_0xbc81('0x34')];if(!_0x3bc9d8['query'][_0xbc81('0x37')](_0xbc81('0x38'))){_0x654566[_0xbc81('0x1d')]=qs[_0xbc81('0x1d')](_0x3bc9d8['query'][_0xbc81('0x1d')]);_0x654566[_0xbc81('0x1f')]=qs[_0xbc81('0x1f')](_0x3bc9d8['query']['offset']);}_0x654566[_0xbc81('0x39')]=qs[_0xbc81('0x3a')](_0x3bc9d8['query'][_0xbc81('0x3a')]);_0x654566['where']=qs[_0xbc81('0x32')](_['pick'](_0x3bc9d8[_0xbc81('0x31')],_0x37573a[_0xbc81('0x32')]),_0x11a98d);if(_0x3bc9d8[_0xbc81('0x31')][_0xbc81('0x3b')]){_0x654566[_0xbc81('0x3c')]=_[_0xbc81('0x3d')](_0x654566['where'],{'$or':_[_0xbc81('0x2c')](_0x11a98d,function(_0x1a878c){if(_0x1a878c[_0xbc81('0x2f')]!==_0xbc81('0x3e')){var _0x47c645={};_0x47c645[_0x1a878c['name']]={'$like':'%'+_0x3bc9d8[_0xbc81('0x31')][_0xbc81('0x3b')]+'%'};return _0x47c645;}})});}_0x654566=_['merge']({},_0x654566,_0x3bc9d8[_0xbc81('0x3f')]);var _0x4525c5={'where':_0x654566[_0xbc81('0x3c')]};return db[_0xbc81('0x2d')]['count'](_0x4525c5)['then'](function(_0x4ec062){_0x5a15be[_0xbc81('0x1e')]=_0x4ec062;if(_0x3bc9d8[_0xbc81('0x31')]['includeAll']){_0x654566['include']=[{'all':!![]}];}return db[_0xbc81('0x2d')][_0xbc81('0x40')](_0x654566);})[_0xbc81('0x25')](function(_0x33eecf){_0x5a15be['rows']=_0x33eecf;return _0x5a15be;})[_0xbc81('0x25')](respondWithFilteredResult(_0x15e9d8,_0x654566))[_0xbc81('0x41')](handleError(_0x15e9d8,null));};exports['show']=function(_0x47b1d0,_0x224724){var _0xae1af3={'raw':!![],'where':{'id':_0x47b1d0['params']['id']}},_0x24fc39={};_0x24fc39[_0xbc81('0x34')]=_[_0xbc81('0x42')](db['SmsQueueReport'][_0xbc81('0x2e')]);_0x24fc39[_0xbc81('0x31')]=_['keys'](_0x47b1d0[_0xbc81('0x31')]);_0x24fc39[_0xbc81('0x32')]=_[_0xbc81('0x33')](_0x24fc39[_0xbc81('0x34')],_0x24fc39[_0xbc81('0x31')]);_0xae1af3['attributes']=_[_0xbc81('0x33')](_0x24fc39[_0xbc81('0x34')],qs[_0xbc81('0x36')](_0x47b1d0[_0xbc81('0x31')][_0xbc81('0x36')]));_0xae1af3[_0xbc81('0x35')]=_0xae1af3[_0xbc81('0x35')][_0xbc81('0x43')]?_0xae1af3[_0xbc81('0x35')]:_0x24fc39['model'];if(_0x47b1d0[_0xbc81('0x31')][_0xbc81('0x44')]){_0xae1af3[_0xbc81('0x45')]=[{'all':!![]}];}_0xae1af3=_[_0xbc81('0x3d')]({},_0xae1af3,_0x47b1d0[_0xbc81('0x3f')]);return db[_0xbc81('0x2d')][_0xbc81('0x46')](_0xae1af3)[_0xbc81('0x25')](handleEntityNotFound(_0x224724,null))[_0xbc81('0x25')](respondWithResult(_0x224724,null))[_0xbc81('0x41')](handleError(_0x224724,null));};exports['create']=function(_0xd46bc8,_0x29b84f){return db[_0xbc81('0x2d')][_0xbc81('0x47')](_0xd46bc8[_0xbc81('0x48')],{})[_0xbc81('0x25')](respondWithResult(_0x29b84f,0xc9))[_0xbc81('0x41')](handleError(_0x29b84f,null));};exports[_0xbc81('0x49')]=function(_0x5a5fe2,_0x54ba0a){if(_0x5a5fe2['body']['id']){delete _0x5a5fe2[_0xbc81('0x48')]['id'];}return db[_0xbc81('0x2d')]['find']({'where':{'id':_0x5a5fe2['params']['id']}})['then'](handleEntityNotFound(_0x54ba0a,null))['then'](saveUpdates(_0x5a5fe2[_0xbc81('0x48')],null))[_0xbc81('0x25')](respondWithResult(_0x54ba0a,null))[_0xbc81('0x41')](handleError(_0x54ba0a,null));};exports[_0xbc81('0x26')]=function(_0xd96cff,_0x271d98){return db[_0xbc81('0x2d')][_0xbc81('0x46')]({'where':{'id':_0xd96cff[_0xbc81('0x4a')]['id']}})[_0xbc81('0x25')](handleEntityNotFound(_0x271d98,null))[_0xbc81('0x25')](removeEntity(_0x271d98,null))[_0xbc81('0x41')](handleError(_0x271d98,null));};exports[_0xbc81('0x4b')]=function(_0xee14bf,_0x56a8db){return db[_0xbc81('0x2d')]['describe']()[_0xbc81('0x25')](respondWithResult(_0x56a8db,null))[_0xbc81('0x41')](handleError(_0x56a8db,null));};
\ No newline at end of file
index 6173877..bdf5533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x473c50,_0x21bb83){var _0xf376fe=function(_0x52dac1){while(--_0x52dac1){_0x473c50['push'](_0x473c50['shift']());}};_0xf376fe(++_0x21bb83);}(_0x70e0,0x17b));var _0x070e=function(_0x369015,_0x200c9e){_0x369015=_0x369015-0x0;var _0x53ba4b=_0x70e0[_0x369015];return _0x53ba4b;};'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
+var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 6b07805..f7767c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf762=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','body','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf762,0x1ec));var _0x2f76=function(_0x2ee383,_0x5e2725){_0x2ee383=_0x2ee383-0x0;var _0x230184=_0xf762[_0x2ee383];return _0x230184;};'use strict';var _=require('lodash');var util=require(_0x2f76('0x0'));var moment=require(_0x2f76('0x1'));var BPromise=require(_0x2f76('0x2'));var rs=require(_0x2f76('0x3'));var fs=require('fs');var Redis=require(_0x2f76('0x4'));var db=require(_0x2f76('0x5'))['db'];var utils=require(_0x2f76('0x6'));var logger=require(_0x2f76('0x7'))(_0x2f76('0x8'));var config=require(_0x2f76('0x9'));var jayson=require(_0x2f76('0xa'));var client=jayson[_0x2f76('0xb')][_0x2f76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49bdae,_0x2914ce,_0x531871){return new BPromise(function(_0xd29d27,_0x3e84e4){return client[_0x2f76('0xd')](_0x49bdae,_0x531871)[_0x2f76('0xe')](function(_0x7eaf15){logger[_0x2f76('0xf')](_0x2f76('0x10'),_0x2914ce,_0x2f76('0x11'));logger[_0x2f76('0x12')](_0x2f76('0x13'),_0x2914ce,_0x2f76('0x11'),JSON[_0x2f76('0x14')](_0x7eaf15));if(_0x7eaf15[_0x2f76('0x15')]){if(_0x7eaf15[_0x2f76('0x15')][_0x2f76('0x16')]===0x1f4){logger[_0x2f76('0x15')](_0x2f76('0x10'),_0x2914ce,_0x7eaf15[_0x2f76('0x15')][_0x2f76('0x17')]);return _0x3e84e4(_0x7eaf15[_0x2f76('0x15')]['message']);}logger[_0x2f76('0x15')](_0x2f76('0x10'),_0x2914ce,_0x7eaf15[_0x2f76('0x15')][_0x2f76('0x17')]);return _0xd29d27(_0x7eaf15[_0x2f76('0x15')][_0x2f76('0x17')]);}else{logger[_0x2f76('0xf')](_0x2f76('0x10'),_0x2914ce,_0x2f76('0x11'));_0xd29d27(_0x7eaf15[_0x2f76('0x18')][_0x2f76('0x17')]);}})[_0x2f76('0x19')](function(_0x48bca9){logger[_0x2f76('0x15')](_0x2f76('0x10'),_0x2914ce,_0x48bca9);_0x3e84e4(_0x48bca9);});});}exports[_0x2f76('0x1a')]=function(_0x4a6715){var _0x23e3b0=this;return new Promise(function(_0x50e5d2,_0x2dafe4){return db[_0x2f76('0x1b')][_0x2f76('0x1c')](_0x4a6715['body'],{'raw':_0x4a6715[_0x2f76('0x1d')]?_0x4a6715['options'][_0x2f76('0x1e')]===undefined?!![]:![]:!![]})[_0x2f76('0xe')](function(_0x53d51a){logger[_0x2f76('0xf')](_0x2f76('0x1a'),_0x4a6715);logger[_0x2f76('0x12')](_0x2f76('0x1a'),_0x4a6715,JSON[_0x2f76('0x14')](_0x53d51a));_0x50e5d2(_0x53d51a);})[_0x2f76('0x19')](function(_0x23818f){logger[_0x2f76('0x15')](_0x2f76('0x1a'),_0x23818f['message'],_0x4a6715);_0x2dafe4(_0x23e3b0[_0x2f76('0x15')](0x1f4,_0x23818f[_0x2f76('0x17')]));});});};exports[_0x2f76('0x1f')]=function(_0x133c4d){var _0x1cf472=this;return new Promise(function(_0x1242b6,_0x5b632a){return db[_0x2f76('0x1b')][_0x2f76('0x20')](_0x133c4d[_0x2f76('0x21')],{'raw':_0x133c4d['options']?_0x133c4d[_0x2f76('0x1d')][_0x2f76('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x133c4d['options']?_0x133c4d[_0x2f76('0x1d')]['where']||null:null,'attributes':_0x133c4d[_0x2f76('0x1d')]?_0x133c4d[_0x2f76('0x1d')][_0x2f76('0x22')]||null:null,'limit':_0x133c4d[_0x2f76('0x1d')]?_0x133c4d['options'][_0x2f76('0x23')]||null:null})[_0x2f76('0xe')](function(_0x544c74){logger['info']('UpdateSmsQueueReport',_0x133c4d);logger[_0x2f76('0x12')]('UpdateSmsQueueReport',_0x133c4d,JSON[_0x2f76('0x14')](_0x544c74));_0x1242b6(_0x544c74);})[_0x2f76('0x19')](function(_0x29a753){logger['error'](_0x2f76('0x1f'),_0x29a753['message'],_0x133c4d);_0x5b632a(_0x1cf472['error'](0x1f4,_0x29a753[_0x2f76('0x17')]));});});};
\ No newline at end of file
+var _0xa947=['../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','attributes','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2c1b1b,_0x545293){var _0x1169db=function(_0xd95861){while(--_0xd95861){_0x2c1b1b['push'](_0x2c1b1b['shift']());}};_0x1169db(++_0x545293);}(_0xa947,0x1b9));var _0x7a94=function(_0x58165e,_0xb8dd3b){_0x58165e=_0x58165e-0x0;var _0x4036ea=_0xa947[_0x58165e];return _0x4036ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7a94('0x0'));var BPromise=require(_0x7a94('0x1'));var rs=require(_0x7a94('0x2'));var fs=require('fs');var Redis=require(_0x7a94('0x3'));var db=require(_0x7a94('0x4'))['db'];var utils=require(_0x7a94('0x5'));var logger=require('../../config/logger')(_0x7a94('0x6'));var config=require(_0x7a94('0x7'));var jayson=require(_0x7a94('0x8'));var client=jayson[_0x7a94('0x9')][_0x7a94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7bf0,_0x1a8740,_0x2a4552){return new BPromise(function(_0x1dce2c,_0x88a464){return client[_0x7a94('0xb')](_0x2b7bf0,_0x2a4552)['then'](function(_0x5c0aff){logger[_0x7a94('0xc')](_0x7a94('0xd'),_0x1a8740,'request\x20sent');logger[_0x7a94('0xe')](_0x7a94('0xf'),_0x1a8740,_0x7a94('0x10'),JSON[_0x7a94('0x11')](_0x5c0aff));if(_0x5c0aff[_0x7a94('0x12')]){if(_0x5c0aff[_0x7a94('0x12')][_0x7a94('0x13')]===0x1f4){logger[_0x7a94('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x1a8740,_0x5c0aff['error'][_0x7a94('0x14')]);return _0x88a464(_0x5c0aff[_0x7a94('0x12')][_0x7a94('0x14')]);}logger[_0x7a94('0x12')](_0x7a94('0xd'),_0x1a8740,_0x5c0aff['error'][_0x7a94('0x14')]);return _0x1dce2c(_0x5c0aff['error'][_0x7a94('0x14')]);}else{logger[_0x7a94('0xc')](_0x7a94('0xd'),_0x1a8740,_0x7a94('0x10'));_0x1dce2c(_0x5c0aff['result'][_0x7a94('0x14')]);}})['catch'](function(_0x1232a4){logger['error'](_0x7a94('0xd'),_0x1a8740,_0x1232a4);_0x88a464(_0x1232a4);});});}exports[_0x7a94('0x15')]=function(_0x3985db){var _0x515e49=this;return new Promise(function(_0x38ca2c,_0x19e7f0){return db[_0x7a94('0x16')][_0x7a94('0x17')](_0x3985db[_0x7a94('0x18')],{'raw':_0x3985db['options']?_0x3985db[_0x7a94('0x19')][_0x7a94('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3b8a6b){logger[_0x7a94('0xc')](_0x7a94('0x15'),_0x3985db);logger[_0x7a94('0xe')](_0x7a94('0x15'),_0x3985db,JSON[_0x7a94('0x11')](_0x3b8a6b));_0x38ca2c(_0x3b8a6b);})[_0x7a94('0x1b')](function(_0x52bd57){logger[_0x7a94('0x12')](_0x7a94('0x15'),_0x52bd57[_0x7a94('0x14')],_0x3985db);_0x19e7f0(_0x515e49['error'](0x1f4,_0x52bd57[_0x7a94('0x14')]));});});};exports[_0x7a94('0x1c')]=function(_0x515f8c){var _0x411068=this;return new Promise(function(_0x301dc6,_0x2831f6){return db['SmsQueueReport'][_0x7a94('0x1d')](_0x515f8c['body'],{'raw':_0x515f8c[_0x7a94('0x19')]?_0x515f8c[_0x7a94('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x515f8c[_0x7a94('0x19')]?_0x515f8c['options']['where']||null:null,'attributes':_0x515f8c[_0x7a94('0x19')]?_0x515f8c['options'][_0x7a94('0x1e')]||null:null,'limit':_0x515f8c[_0x7a94('0x19')]?_0x515f8c[_0x7a94('0x19')]['limit']||null:null})[_0x7a94('0x1f')](function(_0x5cd94a){logger[_0x7a94('0xc')](_0x7a94('0x1c'),_0x515f8c);logger[_0x7a94('0xe')](_0x7a94('0x1c'),_0x515f8c,JSON[_0x7a94('0x11')](_0x5cd94a));_0x301dc6(_0x5cd94a);})['catch'](function(_0xfecc1a){logger[_0x7a94('0x12')](_0x7a94('0x1c'),_0xfecc1a['message'],_0x515f8c);_0x2831f6(_0x411068[_0x7a94('0x12')](0x1f4,_0xfecc1a[_0x7a94('0x14')]));});});};
\ No newline at end of file
index 0ebbbf4..ed012ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3435=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','exports','multer','util'];(function(_0x14876e,_0x16a5b9){var _0x4870af=function(_0x3e8660){while(--_0x3e8660){_0x14876e['push'](_0x14876e['shift']());}};_0x4870af(++_0x16a5b9);}(_0x3435,0xfa));var _0x5343=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x3435[_0x454018];return _0x24697d;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5343('0x6'));var interaction=require(_0x5343('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x5343('0x8')]('/',auth[_0x5343('0x9')](),controller['index']);router['get'](_0x5343('0xa'),auth[_0x5343('0x9')](),controller[_0x5343('0xb')]);router[_0x5343('0x8')](_0x5343('0xc'),auth['isAuthenticated'](),controller[_0x5343('0xd')]);router['post']('/',auth[_0x5343('0x9')](),controller[_0x5343('0xe')]);router[_0x5343('0xf')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['update']);router[_0x5343('0x10')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['destroy']);module[_0x5343('0x11')]=router;
\ No newline at end of file
+var _0x6c7b=['./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x74c392,_0x29cc28){_0x74c392=_0x74c392-0x0;var _0x306791=_0x6c7b[_0x74c392];return _0x306791;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var fs_extra=require(_0xb6c7('0x2'));var auth=require(_0xb6c7('0x3'));var interaction=require(_0xb6c7('0x4'));var config=require('../../config/environment');var controller=require(_0xb6c7('0x5'));router[_0xb6c7('0x6')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x8')]);router[_0xb6c7('0x6')]('/describe',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x6')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0xc')]('/',auth[_0xb6c7('0x7')](),controller['create']);router['put'](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xd')]);router[_0xb6c7('0xe')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xf')]);module['exports']=router;
\ No newline at end of file
index 1e75497..7a9cecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3c01f1,_0x5ac436){var _0x834bdf=function(_0x3dd865){while(--_0x3dd865){_0x3c01f1['push'](_0x3c01f1['shift']());}};_0x834bdf(++_0x5ac436);}(_0xaa88,0x137));var _0x8aa8=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0xaa88[_0x28b7ab];return _0x56791b;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x301583,_0x32f323){var _0x500eec=function(_0x49f306){while(--_0x49f306){_0x301583['push'](_0x301583['shift']());}};_0x500eec(++_0x32f323);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e6dfb,_0x286c6c){_0x3e6dfb=_0x3e6dfb-0x0;var _0x72cbb9=_0xedd9[_0x3e6dfb];return _0x72cbb9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index 5092083..3debdca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3b=['map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','SmsTransferReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send'];(function(_0x2d0531,_0x10dbb3){var _0x245d40=function(_0x10f1a0){while(--_0x10f1a0){_0x2d0531['push'](_0x2d0531['shift']());}};_0x245d40(++_0x10dbb3);}(_0x7d3b,0x188));var _0xb7d3=function(_0x4116b2,_0xd24b48){_0x4116b2=_0x4116b2-0x0;var _0x5eca64=_0x7d3b[_0x4116b2];return _0x5eca64;};'use strict';var emlformat=require(_0xb7d3('0x0'));var rimraf=require(_0xb7d3('0x1'));var zipdir=require(_0xb7d3('0x2'));var jsonpatch=require(_0xb7d3('0x3'));var rp=require('request-promise');var moment=require(_0xb7d3('0x4'));var BPromise=require(_0xb7d3('0x5'));var Mustache=require(_0xb7d3('0x6'));var util=require(_0xb7d3('0x7'));var path=require(_0xb7d3('0x8'));var sox=require('sox');var csv=require(_0xb7d3('0x9'));var ejs=require(_0xb7d3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7d3('0xb'));var squel=require(_0xb7d3('0xc'));var crypto=require(_0xb7d3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb7d3('0xe'));var toCsv=require(_0xb7d3('0x9'));var querystring=require('querystring');var Papa=require(_0xb7d3('0xf'));var Redis=require(_0xb7d3('0x10'));var authService=require(_0xb7d3('0x11'));var qs=require(_0xb7d3('0x12'));var as=require(_0xb7d3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb7d3('0x14'));var config=require(_0xb7d3('0x15'));var licenseUtil=require(_0xb7d3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x322231,_0x222df3){_0x222df3=_0x222df3||0xcc;return function(_0x18547b){if(_0x18547b){return _0x322231[_0xb7d3('0x17')](_0x222df3);}return _0x322231['status'](_0x222df3)[_0xb7d3('0x18')]();};}function respondWithResult(_0x5ab8e6,_0x15f54d){_0x15f54d=_0x15f54d||0xc8;return function(_0x6a880a){if(_0x6a880a){return _0x5ab8e6[_0xb7d3('0x19')](_0x15f54d)['json'](_0x6a880a);}};}function respondWithFilteredResult(_0xf38f48,_0x46cd52){return function(_0x488e99){if(_0x488e99){var _0x3a8355=typeof _0x46cd52[_0xb7d3('0x1a')]===_0xb7d3('0x1b')&&typeof _0x46cd52[_0xb7d3('0x1c')]===_0xb7d3('0x1b');var _0x255ea7=_0x488e99['count'];var _0x5061e1=_0x3a8355?0x0:_0x46cd52[_0xb7d3('0x1a')];var _0x4703fb=_0x3a8355?_0x488e99[_0xb7d3('0x1d')]:_0x46cd52[_0xb7d3('0x1a')]+_0x46cd52['limit'];var _0x35f40f;if(_0x4703fb>=_0x255ea7){_0x4703fb=_0x255ea7;_0x35f40f=0xc8;}else{_0x35f40f=0xce;}_0xf38f48[_0xb7d3('0x19')](_0x35f40f);return _0xf38f48[_0xb7d3('0x1e')]('Content-Range',_0x5061e1+'-'+_0x4703fb+'/'+_0x255ea7)['json'](_0x488e99);}return null;};}function patchUpdates(_0x153ef8){return function(_0x47e5d9){try{jsonpatch[_0xb7d3('0x1f')](_0x47e5d9,_0x153ef8,!![]);}catch(_0x56b82e){return BPromise[_0xb7d3('0x20')](_0x56b82e);}return _0x47e5d9[_0xb7d3('0x21')]();};}function saveUpdates(_0x3436fc,_0x42db8f){return function(_0x26cf36){if(_0x26cf36){return _0x26cf36[_0xb7d3('0x22')](_0x3436fc)[_0xb7d3('0x23')](function(_0x21fa3b){return _0x21fa3b;});}return null;};}function removeEntity(_0x5cc00a,_0x49be47){return function(_0x16e2bf){if(_0x16e2bf){return _0x16e2bf[_0xb7d3('0x24')]()[_0xb7d3('0x23')](function(){_0x5cc00a[_0xb7d3('0x19')](0xcc)[_0xb7d3('0x18')]();});}};}function handleEntityNotFound(_0x499c81,_0x2a72fb){return function(_0x430ba4){if(!_0x430ba4){_0x499c81[_0xb7d3('0x17')](0x194);}return _0x430ba4;};}function handleError(_0x25ab35,_0x2695db){_0x2695db=_0x2695db||0x1f4;return function(_0x84e59e){logger['error'](_0x84e59e[_0xb7d3('0x25')]);if(_0x84e59e['name']){delete _0x84e59e[_0xb7d3('0x26')];}_0x25ab35[_0xb7d3('0x19')](_0x2695db)[_0xb7d3('0x27')](_0x84e59e);};}exports['index']=function(_0x5d7e4a,_0x20f315){var _0x47f5c2={},_0x34ae7d={},_0x4442f0={'count':0x0,'rows':[]};var _0x28860a=_[_0xb7d3('0x28')](db['SmsTransferReport'][_0xb7d3('0x29')],function(_0x53bc09){return{'name':_0x53bc09[_0xb7d3('0x2a')],'type':_0x53bc09[_0xb7d3('0x2b')][_0xb7d3('0x2c')]};});_0x34ae7d[_0xb7d3('0x2d')]=_[_0xb7d3('0x28')](_0x28860a,_0xb7d3('0x26'));_0x34ae7d[_0xb7d3('0x2e')]=_['keys'](_0x5d7e4a[_0xb7d3('0x2e')]);_0x34ae7d[_0xb7d3('0x2f')]=_['intersection'](_0x34ae7d[_0xb7d3('0x2d')],_0x34ae7d['query']);_0x47f5c2[_0xb7d3('0x30')]=_[_0xb7d3('0x31')](_0x34ae7d[_0xb7d3('0x2d')],qs[_0xb7d3('0x32')](_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x32')]));_0x47f5c2['attributes']=_0x47f5c2[_0xb7d3('0x30')][_0xb7d3('0x33')]?_0x47f5c2[_0xb7d3('0x30')]:_0x34ae7d[_0xb7d3('0x2d')];if(!_0x5d7e4a['query'][_0xb7d3('0x34')]('nolimit')){_0x47f5c2[_0xb7d3('0x1c')]=qs[_0xb7d3('0x1c')](_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x1c')]);_0x47f5c2[_0xb7d3('0x1a')]=qs[_0xb7d3('0x1a')](_0x5d7e4a['query'][_0xb7d3('0x1a')]);}_0x47f5c2['order']=qs[_0xb7d3('0x35')](_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x35')]);_0x47f5c2[_0xb7d3('0x36')]=qs[_0xb7d3('0x2f')](_[_0xb7d3('0x37')](_0x5d7e4a[_0xb7d3('0x2e')],_0x34ae7d[_0xb7d3('0x2f')]),_0x28860a);if(_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x38')]){_0x47f5c2['where']=_[_0xb7d3('0x39')](_0x47f5c2[_0xb7d3('0x36')],{'$or':_[_0xb7d3('0x28')](_0x28860a,function(_0x1d1ec3){if(_0x1d1ec3['type']!=='VIRTUAL'){var _0x145aae={};_0x145aae[_0x1d1ec3[_0xb7d3('0x26')]]={'$like':'%'+_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x38')]+'%'};return _0x145aae;}})});}_0x47f5c2=_[_0xb7d3('0x39')]({},_0x47f5c2,_0x5d7e4a['options']);var _0x4c3be7={'where':_0x47f5c2['where']};return db[_0xb7d3('0x3a')][_0xb7d3('0x1d')](_0x4c3be7)['then'](function(_0x5e8be2){_0x4442f0[_0xb7d3('0x1d')]=_0x5e8be2;if(_0x5d7e4a[_0xb7d3('0x2e')][_0xb7d3('0x3b')]){_0x47f5c2[_0xb7d3('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xb7d3('0x3d')](_0x47f5c2);})[_0xb7d3('0x23')](function(_0x46d1e0){_0x4442f0[_0xb7d3('0x3e')]=_0x46d1e0;return _0x4442f0;})['then'](respondWithFilteredResult(_0x20f315,_0x47f5c2))[_0xb7d3('0x3f')](handleError(_0x20f315,null));};exports[_0xb7d3('0x40')]=function(_0x15c615,_0x7fa7b3){var _0x85ca21={'raw':!![],'where':{'id':_0x15c615['params']['id']}},_0x3fed48={};_0x3fed48[_0xb7d3('0x2d')]=_[_0xb7d3('0x41')](db['SmsTransferReport'][_0xb7d3('0x29')]);_0x3fed48['query']=_[_0xb7d3('0x41')](_0x15c615[_0xb7d3('0x2e')]);_0x3fed48[_0xb7d3('0x2f')]=_[_0xb7d3('0x31')](_0x3fed48[_0xb7d3('0x2d')],_0x3fed48[_0xb7d3('0x2e')]);_0x85ca21[_0xb7d3('0x30')]=_[_0xb7d3('0x31')](_0x3fed48[_0xb7d3('0x2d')],qs['fields'](_0x15c615[_0xb7d3('0x2e')][_0xb7d3('0x32')]));_0x85ca21['attributes']=_0x85ca21[_0xb7d3('0x30')][_0xb7d3('0x33')]?_0x85ca21[_0xb7d3('0x30')]:_0x3fed48[_0xb7d3('0x2d')];if(_0x15c615[_0xb7d3('0x2e')][_0xb7d3('0x3b')]){_0x85ca21['include']=[{'all':!![]}];}_0x85ca21=_[_0xb7d3('0x39')]({},_0x85ca21,_0x15c615[_0xb7d3('0x42')]);return db['SmsTransferReport'][_0xb7d3('0x43')](_0x85ca21)[_0xb7d3('0x23')](handleEntityNotFound(_0x7fa7b3,null))[_0xb7d3('0x23')](respondWithResult(_0x7fa7b3,null))[_0xb7d3('0x3f')](handleError(_0x7fa7b3,null));};exports['create']=function(_0x4ed7b5,_0x39203c){return db[_0xb7d3('0x3a')][_0xb7d3('0x44')](_0x4ed7b5[_0xb7d3('0x45')],{})[_0xb7d3('0x23')](respondWithResult(_0x39203c,0xc9))[_0xb7d3('0x3f')](handleError(_0x39203c,null));};exports[_0xb7d3('0x22')]=function(_0x30ae5a,_0x493f64){if(_0x30ae5a[_0xb7d3('0x45')]['id']){delete _0x30ae5a['body']['id'];}return db[_0xb7d3('0x3a')][_0xb7d3('0x43')]({'where':{'id':_0x30ae5a['params']['id']}})['then'](handleEntityNotFound(_0x493f64,null))[_0xb7d3('0x23')](saveUpdates(_0x30ae5a['body'],null))[_0xb7d3('0x23')](respondWithResult(_0x493f64,null))[_0xb7d3('0x3f')](handleError(_0x493f64,null));};exports[_0xb7d3('0x24')]=function(_0x3cbd47,_0x24f71f){return db['SmsTransferReport'][_0xb7d3('0x43')]({'where':{'id':_0x3cbd47[_0xb7d3('0x46')]['id']}})[_0xb7d3('0x23')](handleEntityNotFound(_0x24f71f,null))[_0xb7d3('0x23')](removeEntity(_0x24f71f,null))[_0xb7d3('0x3f')](handleError(_0x24f71f,null));};exports['describe']=function(_0x44a8f6,_0x5b816b){return db[_0xb7d3('0x3a')][_0xb7d3('0x47')]()[_0xb7d3('0x23')](respondWithResult(_0x5b816b,null))[_0xb7d3('0x3f')](handleError(_0x5b816b,null));};
\ No newline at end of file
+var _0xb8ad=['reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','include','SmsTransferReport','findAll','rows','params','fields','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply'];(function(_0x2e0e3e,_0x592731){var _0x2ca5ea=function(_0x271ca6){while(--_0x271ca6){_0x2e0e3e['push'](_0x2e0e3e['shift']());}};_0x2ca5ea(++_0x592731);}(_0xb8ad,0x72));var _0xdb8a=function(_0x550833,_0x30a226){_0x550833=_0x550833-0x0;var _0x5e9053=_0xb8ad[_0x550833];return _0x5e9053;};'use strict';var emlformat=require(_0xdb8a('0x0'));var rimraf=require(_0xdb8a('0x1'));var zipdir=require(_0xdb8a('0x2'));var jsonpatch=require(_0xdb8a('0x3'));var rp=require(_0xdb8a('0x4'));var moment=require('moment');var BPromise=require(_0xdb8a('0x5'));var Mustache=require(_0xdb8a('0x6'));var util=require(_0xdb8a('0x7'));var path=require('path');var sox=require(_0xdb8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb8a('0x9'));var _=require(_0xdb8a('0xa'));var squel=require(_0xdb8a('0xb'));var crypto=require(_0xdb8a('0xc'));var jsforce=require(_0xdb8a('0xd'));var deskjs=require(_0xdb8a('0xe'));var toCsv=require(_0xdb8a('0xf'));var querystring=require(_0xdb8a('0x10'));var Papa=require(_0xdb8a('0x11'));var Redis=require(_0xdb8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdb8a('0x13'));var as=require(_0xdb8a('0x14'));var hardwareService=require(_0xdb8a('0x15'));var logger=require(_0xdb8a('0x16'))(_0xdb8a('0x17'));var utils=require('../../config/utils');var config=require(_0xdb8a('0x18'));var licenseUtil=require(_0xdb8a('0x19'));var db=require(_0xdb8a('0x1a'))['db'];function respondWithStatusCode(_0x6c4f43,_0x1aa48d){_0x1aa48d=_0x1aa48d||0xcc;return function(_0x3a9f1e){if(_0x3a9f1e){return _0x6c4f43[_0xdb8a('0x1b')](_0x1aa48d);}return _0x6c4f43[_0xdb8a('0x1c')](_0x1aa48d)[_0xdb8a('0x1d')]();};}function respondWithResult(_0x3e03b8,_0x3ffa82){_0x3ffa82=_0x3ffa82||0xc8;return function(_0x275713){if(_0x275713){return _0x3e03b8[_0xdb8a('0x1c')](_0x3ffa82)['json'](_0x275713);}};}function respondWithFilteredResult(_0x3cae5c,_0x47c014){return function(_0xd84022){if(_0xd84022){var _0x49fb88=typeof _0x47c014[_0xdb8a('0x1e')]===_0xdb8a('0x1f')&&typeof _0x47c014[_0xdb8a('0x20')]===_0xdb8a('0x1f');var _0x2d4e44=_0xd84022[_0xdb8a('0x21')];var _0x58e06c=_0x49fb88?0x0:_0x47c014[_0xdb8a('0x1e')];var _0x46a85e=_0x49fb88?_0xd84022['count']:_0x47c014['offset']+_0x47c014[_0xdb8a('0x20')];var _0x2db35d;if(_0x46a85e>=_0x2d4e44){_0x46a85e=_0x2d4e44;_0x2db35d=0xc8;}else{_0x2db35d=0xce;}_0x3cae5c[_0xdb8a('0x1c')](_0x2db35d);return _0x3cae5c['set'](_0xdb8a('0x22'),_0x58e06c+'-'+_0x46a85e+'/'+_0x2d4e44)['json'](_0xd84022);}return null;};}function patchUpdates(_0xd7369){return function(_0x24a0f4){try{jsonpatch[_0xdb8a('0x23')](_0x24a0f4,_0xd7369,!![]);}catch(_0x394ff1){return BPromise[_0xdb8a('0x24')](_0x394ff1);}return _0x24a0f4[_0xdb8a('0x25')]();};}function saveUpdates(_0x13165c,_0xb89741){return function(_0x109bb8){if(_0x109bb8){return _0x109bb8[_0xdb8a('0x26')](_0x13165c)[_0xdb8a('0x27')](function(_0x2e79af){return _0x2e79af;});}return null;};}function removeEntity(_0x2ae8b2,_0x27b4e0){return function(_0x18eb9e){if(_0x18eb9e){return _0x18eb9e[_0xdb8a('0x28')]()[_0xdb8a('0x27')](function(){_0x2ae8b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x60886d,_0x54dbe1){return function(_0x1c7ac7){if(!_0x1c7ac7){_0x60886d['sendStatus'](0x194);}return _0x1c7ac7;};}function handleError(_0x3e9e7f,_0x1fbf72){_0x1fbf72=_0x1fbf72||0x1f4;return function(_0x17fa37){logger[_0xdb8a('0x29')](_0x17fa37['stack']);if(_0x17fa37[_0xdb8a('0x2a')]){delete _0x17fa37[_0xdb8a('0x2a')];}_0x3e9e7f[_0xdb8a('0x1c')](_0x1fbf72)['send'](_0x17fa37);};}exports[_0xdb8a('0x2b')]=function(_0x2688b4,_0x2ed3d2){var _0x4a3231={},_0x367204={},_0x83aed0={'count':0x0,'rows':[]};var _0x57956a=_['map'](db['SmsTransferReport'][_0xdb8a('0x2c')],function(_0x24e619){return{'name':_0x24e619[_0xdb8a('0x2d')],'type':_0x24e619[_0xdb8a('0x2e')][_0xdb8a('0x2f')]};});_0x367204[_0xdb8a('0x30')]=_[_0xdb8a('0x31')](_0x57956a,_0xdb8a('0x2a'));_0x367204['query']=_[_0xdb8a('0x32')](_0x2688b4[_0xdb8a('0x33')]);_0x367204[_0xdb8a('0x34')]=_[_0xdb8a('0x35')](_0x367204[_0xdb8a('0x30')],_0x367204[_0xdb8a('0x33')]);_0x4a3231[_0xdb8a('0x36')]=_['intersection'](_0x367204['model'],qs['fields'](_0x2688b4[_0xdb8a('0x33')]['fields']));_0x4a3231['attributes']=_0x4a3231[_0xdb8a('0x36')][_0xdb8a('0x37')]?_0x4a3231[_0xdb8a('0x36')]:_0x367204['model'];if(!_0x2688b4[_0xdb8a('0x33')][_0xdb8a('0x38')]('nolimit')){_0x4a3231['limit']=qs['limit'](_0x2688b4[_0xdb8a('0x33')][_0xdb8a('0x20')]);_0x4a3231[_0xdb8a('0x1e')]=qs[_0xdb8a('0x1e')](_0x2688b4['query'][_0xdb8a('0x1e')]);}_0x4a3231[_0xdb8a('0x39')]=qs[_0xdb8a('0x3a')](_0x2688b4[_0xdb8a('0x33')][_0xdb8a('0x3a')]);_0x4a3231[_0xdb8a('0x3b')]=qs[_0xdb8a('0x34')](_['pick'](_0x2688b4[_0xdb8a('0x33')],_0x367204[_0xdb8a('0x34')]),_0x57956a);if(_0x2688b4[_0xdb8a('0x33')]['filter']){_0x4a3231['where']=_['merge'](_0x4a3231[_0xdb8a('0x3b')],{'$or':_['map'](_0x57956a,function(_0x79c5a3){if(_0x79c5a3['type']!==_0xdb8a('0x3c')){var _0x3a5394={};_0x3a5394[_0x79c5a3[_0xdb8a('0x2a')]]={'$like':'%'+_0x2688b4[_0xdb8a('0x33')]['filter']+'%'};return _0x3a5394;}})});}_0x4a3231=_[_0xdb8a('0x3d')]({},_0x4a3231,_0x2688b4[_0xdb8a('0x3e')]);var _0x55f132={'where':_0x4a3231['where']};return db['SmsTransferReport']['count'](_0x55f132)[_0xdb8a('0x27')](function(_0x49ca0c){_0x83aed0[_0xdb8a('0x21')]=_0x49ca0c;if(_0x2688b4[_0xdb8a('0x33')]['includeAll']){_0x4a3231[_0xdb8a('0x3f')]=[{'all':!![]}];}return db[_0xdb8a('0x40')][_0xdb8a('0x41')](_0x4a3231);})[_0xdb8a('0x27')](function(_0x3e7111){_0x83aed0[_0xdb8a('0x42')]=_0x3e7111;return _0x83aed0;})[_0xdb8a('0x27')](respondWithFilteredResult(_0x2ed3d2,_0x4a3231))['catch'](handleError(_0x2ed3d2,null));};exports['show']=function(_0x76e66a,_0x1c4944){var _0x397c21={'raw':!![],'where':{'id':_0x76e66a[_0xdb8a('0x43')]['id']}},_0x356d7a={};_0x356d7a[_0xdb8a('0x30')]=_[_0xdb8a('0x32')](db['SmsTransferReport'][_0xdb8a('0x2c')]);_0x356d7a[_0xdb8a('0x33')]=_[_0xdb8a('0x32')](_0x76e66a['query']);_0x356d7a[_0xdb8a('0x34')]=_[_0xdb8a('0x35')](_0x356d7a[_0xdb8a('0x30')],_0x356d7a[_0xdb8a('0x33')]);_0x397c21[_0xdb8a('0x36')]=_[_0xdb8a('0x35')](_0x356d7a['model'],qs[_0xdb8a('0x44')](_0x76e66a['query'][_0xdb8a('0x44')]));_0x397c21[_0xdb8a('0x36')]=_0x397c21[_0xdb8a('0x36')][_0xdb8a('0x37')]?_0x397c21[_0xdb8a('0x36')]:_0x356d7a[_0xdb8a('0x30')];if(_0x76e66a[_0xdb8a('0x33')][_0xdb8a('0x45')]){_0x397c21[_0xdb8a('0x3f')]=[{'all':!![]}];}_0x397c21=_[_0xdb8a('0x3d')]({},_0x397c21,_0x76e66a[_0xdb8a('0x3e')]);return db['SmsTransferReport']['find'](_0x397c21)[_0xdb8a('0x27')](handleEntityNotFound(_0x1c4944,null))[_0xdb8a('0x27')](respondWithResult(_0x1c4944,null))[_0xdb8a('0x46')](handleError(_0x1c4944,null));};exports[_0xdb8a('0x47')]=function(_0x1217fb,_0x4b593d){return db[_0xdb8a('0x40')][_0xdb8a('0x47')](_0x1217fb[_0xdb8a('0x48')],{})[_0xdb8a('0x27')](respondWithResult(_0x4b593d,0xc9))[_0xdb8a('0x46')](handleError(_0x4b593d,null));};exports[_0xdb8a('0x26')]=function(_0xc5a680,_0x282cba){if(_0xc5a680[_0xdb8a('0x48')]['id']){delete _0xc5a680['body']['id'];}return db[_0xdb8a('0x40')][_0xdb8a('0x49')]({'where':{'id':_0xc5a680[_0xdb8a('0x43')]['id']}})['then'](handleEntityNotFound(_0x282cba,null))[_0xdb8a('0x27')](saveUpdates(_0xc5a680['body'],null))[_0xdb8a('0x27')](respondWithResult(_0x282cba,null))['catch'](handleError(_0x282cba,null));};exports['destroy']=function(_0x374a5d,_0x4b2b71){return db[_0xdb8a('0x40')][_0xdb8a('0x49')]({'where':{'id':_0x374a5d[_0xdb8a('0x43')]['id']}})[_0xdb8a('0x27')](handleEntityNotFound(_0x4b2b71,null))['then'](removeEntity(_0x4b2b71,null))[_0xdb8a('0x46')](handleError(_0x4b2b71,null));};exports[_0xdb8a('0x4a')]=function(_0x13dc50,_0x22338d){return db['SmsTransferReport'][_0xdb8a('0x4a')]()[_0xdb8a('0x27')](respondWithResult(_0x22338d,null))[_0xdb8a('0x46')](handleError(_0x22338d,null));};
\ No newline at end of file
index d045ce0..ec9165e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9364=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','SmsTransferReport'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9364,0x141));var _0x4936=function(_0x126c8d,_0x49e0eb){_0x126c8d=_0x126c8d-0x0;var _0xaed2dc=_0x9364[_0x126c8d];return _0xaed2dc;};'use strict';var _=require(_0x4936('0x0'));var util=require(_0x4936('0x1'));var logger=require(_0x4936('0x2'))(_0x4936('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4936('0x4'));var rimraf=require(_0x4936('0x5'));var config=require(_0x4936('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x4936('0x7')]=function(_0x22d4c0,_0x16642c){return _0x22d4c0['define'](_0x4936('0x8'),attributes,{'tableName':_0x4936('0x9'),'paranoid':![],'indexes':[{'name':_0x4936('0xa'),'fields':[_0x4936('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ff4=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','api'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9ff4,0x196));var _0x49ff=function(_0x4f061d,_0x47776f){_0x4f061d=_0x4f061d-0x0;var _0x51a96a=_0x9ff4[_0x4f061d];return _0x51a96a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x49ff('0x0'));var moment=require(_0x49ff('0x1'));var BPromise=require(_0x49ff('0x2'));var rp=require(_0x49ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49ff('0x4'));var config=require(_0x49ff('0x5'));var attributes=require(_0x49ff('0x6'));module[_0x49ff('0x7')]=function(_0x153755,_0x22febd){return _0x153755[_0x49ff('0x8')](_0x49ff('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x49ff('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index e13cf8a..849d506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2a=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0x9b2a,0x127));var _0xa9b2=function(_0x2f57bb,_0x304118){_0x2f57bb=_0x2f57bb-0x0;var _0x31cf68=_0x9b2a[_0x2f57bb];return _0x31cf68;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var moment=require(_0xa9b2('0x1'));var BPromise=require(_0xa9b2('0x2'));var rs=require(_0xa9b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9b2('0x4'))['db'];var utils=require(_0xa9b2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa9b2('0x6'));var jayson=require(_0xa9b2('0x7'));var client=jayson[_0xa9b2('0x8')][_0xa9b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x558267,_0x29afe0,_0xce1b20){return new BPromise(function(_0x2d2560,_0x597c97){return client[_0xa9b2('0xa')](_0x558267,_0xce1b20)[_0xa9b2('0xb')](function(_0x146ebd){logger[_0xa9b2('0xc')](_0xa9b2('0xd'),_0x29afe0,_0xa9b2('0xe'));logger['debug'](_0xa9b2('0xf'),_0x29afe0,'request\x20sent',JSON['stringify'](_0x146ebd));if(_0x146ebd['error']){if(_0x146ebd[_0xa9b2('0x10')][_0xa9b2('0x11')]===0x1f4){logger[_0xa9b2('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x597c97(_0x146ebd['error'][_0xa9b2('0x12')]);}logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x2d2560(_0x146ebd['error']['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x29afe0,_0xa9b2('0xe'));_0x2d2560(_0x146ebd[_0xa9b2('0x13')]['message']);}})[_0xa9b2('0x14')](function(_0x57c82c){logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x57c82c);_0x597c97(_0x57c82c);});});}
\ No newline at end of file
+var _0x52ad=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x23c46a,_0x295ca9){var _0x19bf1a=function(_0x20832b){while(--_0x20832b){_0x23c46a['push'](_0x23c46a['shift']());}};_0x19bf1a(++_0x295ca9);}(_0x52ad,0x1d8));var _0xd52a=function(_0x17028b,_0x1641cc){_0x17028b=_0x17028b-0x0;var _0x1cf46d=_0x52ad[_0x17028b];return _0x1cf46d;};'use strict';var _=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var moment=require(_0xd52a('0x2'));var BPromise=require(_0xd52a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd52a('0x4'));var db=require(_0xd52a('0x5'))['db'];var utils=require(_0xd52a('0x6'));var logger=require(_0xd52a('0x7'))(_0xd52a('0x8'));var config=require(_0xd52a('0x9'));var jayson=require(_0xd52a('0xa'));var client=jayson[_0xd52a('0xb')][_0xd52a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e80f5,_0x123bb1,_0x16a73d){return new BPromise(function(_0x20b817,_0x3df9d4){return client['request'](_0x5e80f5,_0x16a73d)[_0xd52a('0xd')](function(_0x671681){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x123bb1,_0xd52a('0xe'));logger[_0xd52a('0xf')](_0xd52a('0x10'),_0x123bb1,_0xd52a('0xe'),JSON[_0xd52a('0x11')](_0x671681));if(_0x671681[_0xd52a('0x12')]){if(_0x671681['error'][_0xd52a('0x13')]===0x1f4){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x3df9d4(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x20b817(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}else{logger[_0xd52a('0x16')](_0xd52a('0x14'),_0x123bb1,_0xd52a('0xe'));_0x20b817(_0x671681[_0xd52a('0x17')][_0xd52a('0x15')]);}})[_0xd52a('0x18')](function(_0x1aa59f){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x1aa59f);_0x3df9d4(_0x1aa59f);});});}
\ No newline at end of file
index 5ddf5b0..784a5e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9068=['server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9068,0x65));var _0x8906=function(_0x5d9006,_0x4e789f){_0x5d9006=_0x5d9006-0x0;var _0x56aa52=_0x9068[_0x5d9006];return _0x56aa52;};'use strict';var multer=require(_0x8906('0x0'));var util=require(_0x8906('0x1'));var path=require(_0x8906('0x2'));var timeout=require('connect-timeout');var express=require(_0x8906('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8906('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8906('0x5'));var controller=require(_0x8906('0x6'));router[_0x8906('0x7')]('/',auth[_0x8906('0x8')](),controller[_0x8906('0x9')]);router[_0x8906('0x7')](_0x8906('0xa'),auth[_0x8906('0x8')](),controller[_0x8906('0xb')]);router[_0x8906('0x7')](_0x8906('0xc'),auth[_0x8906('0x8')](),controller[_0x8906('0xd')]);var upload=multer({'storage':multer[_0x8906('0xe')]({'destination':function(_0x1dee3f,_0x577e99,_0x2b6d7c){_0x2b6d7c(null,path['join'](config['root'],_0x8906('0xf')));},'filename':function(_0x6e6e83,_0x42acac,_0x4439c3){_0x42acac[_0x8906('0x10')]=_0x42acac[_0x8906('0x10')][_0x8906('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4439c3(null,util[_0x8906('0x12')](_0x8906('0x13'),path[_0x8906('0x14')](_0x42acac[_0x8906('0x10')],path[_0x8906('0x15')](_0x42acac['originalname'])),Date['now'](),path[_0x8906('0x15')](_0x42acac[_0x8906('0x10')])));}})});router[_0x8906('0x16')]('/',upload[_0x8906('0x17')](_0x8906('0x18')),controller['create']);router[_0x8906('0x19')]('/:id',auth[_0x8906('0x8')](),controller[_0x8906('0x1a')]);router[_0x8906('0x1b')](_0x8906('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x8906('0x1c')]=router;
\ No newline at end of file
+var _0xdc5b=['join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','single','file','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage'];(function(_0x29311d,_0x3f9e23){var _0xa29b8f=function(_0x2bb490){while(--_0x2bb490){_0x29311d['push'](_0x29311d['shift']());}};_0xa29b8f(++_0x3f9e23);}(_0xdc5b,0x107));var _0xbdc5=function(_0x19ea47,_0x4ea98d){_0x19ea47=_0x19ea47-0x0;var _0x63a6c9=_0xdc5b[_0x19ea47];return _0x63a6c9;};'use strict';var multer=require(_0xbdc5('0x0'));var util=require('util');var path=require(_0xbdc5('0x1'));var timeout=require(_0xbdc5('0x2'));var express=require(_0xbdc5('0x3'));var router=express['Router']();var fs_extra=require(_0xbdc5('0x4'));var auth=require(_0xbdc5('0x5'));var interaction=require(_0xbdc5('0x6'));var config=require(_0xbdc5('0x7'));var controller=require(_0xbdc5('0x8'));router[_0xbdc5('0x9')]('/',auth[_0xbdc5('0xa')](),controller['index']);router[_0xbdc5('0x9')](_0xbdc5('0xb'),auth[_0xbdc5('0xa')](),controller[_0xbdc5('0xc')]);router[_0xbdc5('0x9')](_0xbdc5('0xd'),auth[_0xbdc5('0xa')](),controller[_0xbdc5('0xe')]);var upload=multer({'storage':multer[_0xbdc5('0xf')]({'destination':function(_0x4a6199,_0x31c008,_0x54b996){_0x54b996(null,path[_0xbdc5('0x10')](config[_0xbdc5('0x11')],_0xbdc5('0x12')));},'filename':function(_0x398e8b,_0x5f9e89,_0x21eafb){_0x5f9e89[_0xbdc5('0x13')]=_0x5f9e89[_0xbdc5('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x21eafb(null,util[_0xbdc5('0x14')](_0xbdc5('0x15'),path['basename'](_0x5f9e89[_0xbdc5('0x13')],path[_0xbdc5('0x16')](_0x5f9e89[_0xbdc5('0x13')])),Date[_0xbdc5('0x17')](),path['extname'](_0x5f9e89[_0xbdc5('0x13')])));}})});router['post']('/',upload[_0xbdc5('0x18')](_0xbdc5('0x19')),controller[_0xbdc5('0x1a')]);router[_0xbdc5('0x1b')](_0xbdc5('0xb'),auth[_0xbdc5('0xa')](),controller[_0xbdc5('0x1c')]);router['delete']('/:id',auth[_0xbdc5('0xa')](),controller[_0xbdc5('0x1d')]);module[_0xbdc5('0x1e')]=router;
\ No newline at end of file
index 643783a..101bc33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d6=['name','FLOAT','INTEGER','BIGINT','sequelize','STRING'];(function(_0x29d5d6,_0xa2cba6){var _0x28fe28=function(_0x53767a){while(--_0x53767a){_0x29d5d6['push'](_0x29d5d6['shift']());}};_0x28fe28(++_0xa2cba6);}(_0xd1d6,0x1ae));var _0x6d1d=function(_0x547de7,_0x273587){_0x547de7=_0x547de7-0x0;var _0xdfb966=_0xd1d6[_0x547de7];return _0xdfb966;};'use strict';var Sequelize=require(_0x6d1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d1d('0x1')],'unique':_0x6d1d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6d1d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x6d1d('0x1')]},'original_format':{'type':Sequelize[_0x6d1d('0x1')]},'original_duration':{'type':Sequelize[_0x6d1d('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x6d1d('0x4')]},'original_bitRate':{'type':Sequelize[_0x6d1d('0x5')]},'original_sampleRate':{'type':Sequelize[_0x6d1d('0x4')]},'converted_format':{'type':Sequelize[_0x6d1d('0x1')]},'converted_duration':{'type':Sequelize[_0x6d1d('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x6d1d('0x5')]},'converted_channelCount':{'type':Sequelize[_0x6d1d('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x6d1d('0x4')]}};
\ No newline at end of file
+var _0x8900=['STRING','name','BIGINT','INTEGER','FLOAT','exports'];(function(_0x621bee,_0x58f8c0){var _0x3076c8=function(_0x228229){while(--_0x228229){_0x621bee['push'](_0x621bee['shift']());}};_0x3076c8(++_0x58f8c0);}(_0x8900,0x137));var _0x0890=function(_0x42ad7c,_0x56d95f){_0x42ad7c=_0x42ad7c-0x0;var _0x37cdb3=_0x8900[_0x42ad7c];return _0x37cdb3;};'use strict';var Sequelize=require('sequelize');module[_0x0890('0x0')]={'name':{'type':Sequelize[_0x0890('0x1')],'unique':_0x0890('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0890('0x1')]},'display_name':{'type':Sequelize[_0x0890('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x0890('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x0890('0x3')]},'original_sampleRate':{'type':Sequelize[_0x0890('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x0890('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x0890('0x4')]},'converted_bitRate':{'type':Sequelize[_0x0890('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x0890('0x4')]}};
\ No newline at end of file
index f55c967..97c5f22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d7=['json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','Sounds','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','count','includeAll','findAll','rows','catch','show','include','Sound','find','download','params','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','save_name','format','%s.%s','basename','extname','file','filename','originalname','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','wav','unlinkSync','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','chmodSync','0777','create','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x41d7,0x68));var _0x741d=function(_0x14b749,_0x639464){_0x14b749=_0x14b749-0x0;var _0x2389bc=_0x41d7[_0x14b749];return _0x2389bc;};'use strict';var emlformat=require(_0x741d('0x0'));var rimraf=require(_0x741d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x741d('0x2'));var moment=require(_0x741d('0x3'));var BPromise=require(_0x741d('0x4'));var Mustache=require(_0x741d('0x5'));var util=require(_0x741d('0x6'));var path=require(_0x741d('0x7'));var sox=require(_0x741d('0x8'));var csv=require('to-csv');var ejs=require(_0x741d('0x9'));var fs=require('fs');var fs_extra=require(_0x741d('0xa'));var _=require(_0x741d('0xb'));var squel=require(_0x741d('0xc'));var crypto=require(_0x741d('0xd'));var jsforce=require(_0x741d('0xe'));var deskjs=require(_0x741d('0xf'));var toCsv=require(_0x741d('0x10'));var querystring=require(_0x741d('0x11'));var Papa=require('papaparse');var Redis=require(_0x741d('0x12'));var authService=require(_0x741d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x741d('0x14'));var hardwareService=require(_0x741d('0x15'));var logger=require(_0x741d('0x16'))(_0x741d('0x17'));var utils=require(_0x741d('0x18'));var config=require(_0x741d('0x19'));var licenseUtil=require(_0x741d('0x1a'));var db=require(_0x741d('0x1b'))['db'];function respondWithStatusCode(_0x2614b9,_0x33bd5b){_0x33bd5b=_0x33bd5b||0xcc;return function(_0x2493ea){if(_0x2493ea){return _0x2614b9[_0x741d('0x1c')](_0x33bd5b);}return _0x2614b9['status'](_0x33bd5b)[_0x741d('0x1d')]();};}function respondWithResult(_0x40dd16,_0x2c2f5d){_0x2c2f5d=_0x2c2f5d||0xc8;return function(_0x5d5ee8){if(_0x5d5ee8){return _0x40dd16[_0x741d('0x1e')](_0x2c2f5d)[_0x741d('0x1f')](_0x5d5ee8);}};}function respondWithFilteredResult(_0x181203,_0x5e00b1){return function(_0x445d58){if(_0x445d58){var _0x5bd6d5=typeof _0x5e00b1[_0x741d('0x20')]===_0x741d('0x21')&&typeof _0x5e00b1['limit']==='undefined';var _0x360146=_0x445d58['count'];var _0x655efd=_0x5bd6d5?0x0:_0x5e00b1[_0x741d('0x20')];var _0x16ba35=_0x5bd6d5?_0x445d58['count']:_0x5e00b1[_0x741d('0x20')]+_0x5e00b1[_0x741d('0x22')];var _0x2be9ea;if(_0x16ba35>=_0x360146){_0x16ba35=_0x360146;_0x2be9ea=0xc8;}else{_0x2be9ea=0xce;}_0x181203[_0x741d('0x1e')](_0x2be9ea);return _0x181203[_0x741d('0x23')](_0x741d('0x24'),_0x655efd+'-'+_0x16ba35+'/'+_0x360146)['json'](_0x445d58);}return null;};}function patchUpdates(_0x264154){return function(_0x4bfd53){try{jsonpatch[_0x741d('0x25')](_0x4bfd53,_0x264154,!![]);}catch(_0x5d2b65){return BPromise[_0x741d('0x26')](_0x5d2b65);}return _0x4bfd53[_0x741d('0x27')]();};}function saveUpdates(_0x426ec5,_0x3cc021){return function(_0x1f47c4){if(_0x1f47c4){return _0x1f47c4[_0x741d('0x28')](_0x426ec5)[_0x741d('0x29')](function(_0x2904fe){return _0x2904fe;});}return null;};}function removeEntity(_0x30ed88,_0x178bf8){return function(_0x1d9902){if(_0x1d9902){return _0x1d9902[_0x741d('0x2a')]()[_0x741d('0x29')](function(){var _0x332b45=_0x1d9902['get']({'plain':!![]});var _0x1e253b=_0x741d('0x2b');return db['UserProfileResource'][_0x741d('0x2a')]({'where':{'type':_0x1e253b,'resourceId':_0x332b45['id']}})[_0x741d('0x29')](function(){return _0x1d9902;});})['then'](function(){_0x30ed88[_0x741d('0x1e')](0xcc)[_0x741d('0x1d')]();});}};}function handleEntityNotFound(_0x5cdba5,_0x1db256){return function(_0x8e0e3){if(!_0x8e0e3){_0x5cdba5[_0x741d('0x1c')](0x194);}return _0x8e0e3;};}function handleError(_0x3cf65f,_0x46f2c7){_0x46f2c7=_0x46f2c7||0x1f4;return function(_0x162131){logger[_0x741d('0x2c')](_0x162131[_0x741d('0x2d')]);if(_0x162131['name']){delete _0x162131[_0x741d('0x2e')];}_0x3cf65f[_0x741d('0x1e')](_0x46f2c7)['send'](_0x162131);};}exports[_0x741d('0x2f')]=function(_0x2220ab,_0x1f8da8){var _0x192cd4={},_0x5e1280={},_0x8ca46={'count':0x0,'rows':[]};var _0x2cd7a4=_[_0x741d('0x30')](db['Sound'][_0x741d('0x31')],function(_0x42b37c){return{'name':_0x42b37c[_0x741d('0x32')],'type':_0x42b37c['type'][_0x741d('0x33')]};});_0x5e1280[_0x741d('0x34')]=_[_0x741d('0x30')](_0x2cd7a4,_0x741d('0x2e'));_0x5e1280[_0x741d('0x35')]=_[_0x741d('0x36')](_0x2220ab['query']);_0x5e1280[_0x741d('0x37')]=_[_0x741d('0x38')](_0x5e1280[_0x741d('0x34')],_0x5e1280['query']);_0x192cd4[_0x741d('0x39')]=_[_0x741d('0x38')](_0x5e1280[_0x741d('0x34')],qs[_0x741d('0x3a')](_0x2220ab['query'][_0x741d('0x3a')]));_0x192cd4[_0x741d('0x39')]=_0x192cd4['attributes'][_0x741d('0x3b')]?_0x192cd4[_0x741d('0x39')]:_0x5e1280[_0x741d('0x34')];if(!_0x2220ab[_0x741d('0x35')][_0x741d('0x3c')](_0x741d('0x3d'))){_0x192cd4[_0x741d('0x22')]=qs[_0x741d('0x22')](_0x2220ab[_0x741d('0x35')]['limit']);_0x192cd4[_0x741d('0x20')]=qs[_0x741d('0x20')](_0x2220ab[_0x741d('0x35')][_0x741d('0x20')]);}_0x192cd4['order']=qs[_0x741d('0x3e')](_0x2220ab['query'][_0x741d('0x3e')]);_0x192cd4[_0x741d('0x3f')]=qs['filters'](_[_0x741d('0x40')](_0x2220ab[_0x741d('0x35')],_0x5e1280[_0x741d('0x37')]),_0x2cd7a4);if(_0x2220ab['query'][_0x741d('0x41')]){_0x192cd4[_0x741d('0x3f')]=_[_0x741d('0x42')](_0x192cd4[_0x741d('0x3f')],{'$or':_[_0x741d('0x30')](_0x2cd7a4,function(_0x44a1e7){if(_0x44a1e7[_0x741d('0x43')]!=='VIRTUAL'){var _0x9e1f44={};_0x9e1f44[_0x44a1e7[_0x741d('0x2e')]]={'$like':'%'+_0x2220ab[_0x741d('0x35')][_0x741d('0x41')]+'%'};return _0x9e1f44;}})});}_0x192cd4=_[_0x741d('0x42')]({},_0x192cd4,_0x2220ab[_0x741d('0x44')]);var _0xb9244b={'where':_0x192cd4[_0x741d('0x3f')]};return db['Sound'][_0x741d('0x45')](_0xb9244b)['then'](function(_0x1f876d){_0x8ca46[_0x741d('0x45')]=_0x1f876d;if(_0x2220ab[_0x741d('0x35')][_0x741d('0x46')]){_0x192cd4['include']=[{'all':!![]}];}return db['Sound'][_0x741d('0x47')](_0x192cd4);})[_0x741d('0x29')](function(_0x346a9f){_0x8ca46[_0x741d('0x48')]=_0x346a9f;return _0x8ca46;})[_0x741d('0x29')](respondWithFilteredResult(_0x1f8da8,_0x192cd4))[_0x741d('0x49')](handleError(_0x1f8da8,null));};exports[_0x741d('0x4a')]=function(_0x10488c,_0x22d353){var _0xb7ccba={'raw':!![],'where':{'id':_0x10488c['params']['id']}},_0x6f6c2f={};_0x6f6c2f[_0x741d('0x34')]=_[_0x741d('0x36')](db['Sound'][_0x741d('0x31')]);_0x6f6c2f['query']=_[_0x741d('0x36')](_0x10488c[_0x741d('0x35')]);_0x6f6c2f['filters']=_[_0x741d('0x38')](_0x6f6c2f['model'],_0x6f6c2f['query']);_0xb7ccba['attributes']=_[_0x741d('0x38')](_0x6f6c2f[_0x741d('0x34')],qs[_0x741d('0x3a')](_0x10488c[_0x741d('0x35')][_0x741d('0x3a')]));_0xb7ccba[_0x741d('0x39')]=_0xb7ccba[_0x741d('0x39')][_0x741d('0x3b')]?_0xb7ccba[_0x741d('0x39')]:_0x6f6c2f[_0x741d('0x34')];if(_0x10488c[_0x741d('0x35')]['includeAll']){_0xb7ccba[_0x741d('0x4b')]=[{'all':!![]}];}_0xb7ccba=_['merge']({},_0xb7ccba,_0x10488c[_0x741d('0x44')]);return db[_0x741d('0x4c')][_0x741d('0x4d')](_0xb7ccba)[_0x741d('0x29')](handleEntityNotFound(_0x22d353,null))[_0x741d('0x29')](respondWithResult(_0x22d353,null))[_0x741d('0x49')](handleError(_0x22d353,null));};exports[_0x741d('0x4e')]=function(_0x526464,_0x81b14d,_0x25a0ba){return db[_0x741d('0x4c')][_0x741d('0x4d')]({'where':{'id':_0x526464[_0x741d('0x4f')]['id']},'attributes':['name','save_name',_0x741d('0x50')],'raw':!![]})[_0x741d('0x29')](handleEntityNotFound(_0x81b14d,null))[_0x741d('0x29')](function(_0x2b89bb){if(_0x2b89bb){if(!fs[_0x741d('0x51')](path[_0x741d('0x52')](config['root'],_0x741d('0x53'),_0x2b89bb['save_name']+'.'+_0x2b89bb[_0x741d('0x50')]))){throw new db[(_0x741d('0x54'))][(_0x741d('0x55'))](_0x741d('0x56'));}return _0x81b14d[_0x741d('0x4e')](path['join'](config[_0x741d('0x57')],_0x741d('0x53'),util['format']('%s.%s',_0x2b89bb[_0x741d('0x58')],_0x2b89bb['converted_format'])),util[_0x741d('0x59')](_0x741d('0x5a'),_0x2b89bb[_0x741d('0x2e')],_0x2b89bb[_0x741d('0x50')]));}return null;})['catch'](handleError(_0x81b14d,null));};exports['create']=function(_0x39db75,_0x38efb7,_0x2d020f){var _0x22a23e={'name':path[_0x741d('0x5b')](_0x39db75['file']['originalname'],path[_0x741d('0x5c')](_0x39db75['file']['originalname'])),'save_name':path['basename'](_0x39db75[_0x741d('0x5d')][_0x741d('0x5e')],path[_0x741d('0x5c')](_0x39db75[_0x741d('0x5d')][_0x741d('0x5e')])),'original_format':path[_0x741d('0x5c')](_0x39db75['file'][_0x741d('0x5f')])[_0x741d('0x60')](0x1),'converted_format':'wav'};var _0x496190=path['join'](config[_0x741d('0x57')],'server/files/sounds/original',_0x39db75['file'][_0x741d('0x5e')]);var _0x56fa8d=path[_0x741d('0x52')](config[_0x741d('0x57')],_0x741d('0x53'),util[_0x741d('0x59')]('%s.%s',path[_0x741d('0x5b')](_0x39db75[_0x741d('0x5d')][_0x741d('0x5e')],path['extname'](_0x39db75['file'][_0x741d('0x5e')])),_0x22a23e[_0x741d('0x50')]));logger[_0x741d('0x61')](_0x741d('0x62'),_0x496190);logger[_0x741d('0x61')](_0x741d('0x63'),_0x56fa8d);try{fs['chmodSync'](_0x496190,parseInt('0777',0x8));var _0x533380=sox[_0x741d('0x64')](_0x496190,_0x56fa8d,{'sampleRate':0x1f40,'format':_0x741d('0x65'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x533380['on'](_0x741d('0x2c'),function(_0x2a4f81){fs[_0x741d('0x66')](_0x496190);_0x38efb7[_0x741d('0x1e')](0x1f4)[_0x741d('0x67')](_0x2a4f81);});_0x533380['on'](_0x741d('0x68'),function(_0x3758b9){_0x22a23e['original_duration']=isNaN(_0x3758b9['duration'])?null:_0x3758b9[_0x741d('0x69')]*0x3e8;_0x22a23e[_0x741d('0x6a')]=isNaN(_0x3758b9[_0x741d('0x6b')])?null:_0x3758b9[_0x741d('0x6b')];_0x22a23e[_0x741d('0x6c')]=isNaN(_0x3758b9[_0x741d('0x6d')])?null:_0x3758b9['channelCount'];_0x22a23e[_0x741d('0x6e')]=isNaN(_0x3758b9[_0x741d('0x6f')])?null:_0x3758b9[_0x741d('0x6f')];_0x22a23e[_0x741d('0x70')]=isNaN(_0x3758b9[_0x741d('0x71')])?null:_0x3758b9[_0x741d('0x71')];});_0x533380['on'](_0x741d('0x72'),function(_0x173535){_0x22a23e[_0x741d('0x73')]=isNaN(_0x173535['duration'])?null:_0x173535[_0x741d('0x69')]*0x3e8;_0x22a23e[_0x741d('0x74')]=isNaN(_0x173535['sampleCount'])?null:_0x173535[_0x741d('0x6b')];_0x22a23e[_0x741d('0x75')]=isNaN(_0x173535[_0x741d('0x6d')])?null:_0x173535[_0x741d('0x6d')];_0x22a23e['converted_bitRate']=isNaN(_0x173535[_0x741d('0x6f')])?null:_0x173535[_0x741d('0x6f')];_0x22a23e['converted_sampleRate']=isNaN(_0x173535[_0x741d('0x71')])?null:_0x173535[_0x741d('0x71')];});_0x533380['on'](_0x741d('0x1d'),function(){fs[_0x741d('0x76')](_0x56fa8d,parseInt(_0x741d('0x77'),0x8));return db[_0x741d('0x4c')][_0x741d('0x78')](_0x22a23e)[_0x741d('0x29')](function(_0x18b256){var _0x29753f={'role':_0x39db75[_0x741d('0x79')][_0x741d('0x7a')],'userProfileId':_0x39db75[_0x741d('0x79')][_0x741d('0x7b')]};if(!_0x29753f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29753f[_0x741d('0x7a')]===_0x741d('0x7c')){var _0x200447=_0x18b256[_0x741d('0x7d')]({'plain':!![]});return db[_0x741d('0x7e')]['find']({'where':{'name':_0x741d('0x2b'),'userProfileId':_0x29753f[_0x741d('0x7b')]},'raw':!![]})[_0x741d('0x29')](function(_0x14885e){if(_0x14885e&&_0x14885e[_0x741d('0x7f')]===0x0){return db[_0x741d('0x80')][_0x741d('0x78')]({'name':_0x200447[_0x741d('0x2e')],'resourceId':_0x200447['id'],'type':_0x14885e[_0x741d('0x2e')],'sectionId':_0x14885e['id']},{})[_0x741d('0x29')](function(){return _0x18b256;});}else{return _0x18b256;}})['catch'](function(_0xdaa909){logger[_0x741d('0x2c')](_0x741d('0x81'),_0xdaa909);throw _0xdaa909;});}return _0x18b256;})[_0x741d('0x29')](respondWithResult(_0x38efb7,null))[_0x741d('0x49')](handleError(_0x38efb7,null));});_0x533380[_0x741d('0x82')]();}catch(_0x559c77){_0x38efb7[_0x741d('0x1e')](0x1f4)[_0x741d('0x67')](_0x559c77);}};exports[_0x741d('0x28')]=function(_0x149e1c,_0x4979e1,_0xe43b35){return db['Sound'][_0x741d('0x4d')]({'where':{'id':_0x149e1c['params']['id']}})[_0x741d('0x29')](handleEntityNotFound(_0x4979e1,null))[_0x741d('0x29')](saveUpdates(_[_0x741d('0x40')](_0x149e1c[_0x741d('0x79')],[_0x741d('0x2e'),_0x741d('0x83')]),null))[_0x741d('0x29')](respondWithResult(_0x4979e1,null))[_0x741d('0x49')](handleError(_0x4979e1,null));};exports[_0x741d('0x84')]=function(_0xd608a2,_0x2401ad,_0x40b2c6){return db[_0x741d('0x4c')][_0x741d('0x4d')]({'where':{'id':_0xd608a2[_0x741d('0x4f')]['id']}})[_0x741d('0x29')](function(_0x5e7708){if(_0x5e7708){return _0x5e7708[_0x741d('0x2a')]();}})['then'](function(_0x164e7f){var _0x2899a8=path['join'](config['root'],_0x741d('0x85'),util[_0x741d('0x59')]('%s.%s',_0x164e7f[_0x741d('0x58')],_0x164e7f[_0x741d('0x86')]));var _0x291e9f=path['join'](config[_0x741d('0x57')],'server/files/sounds/converted',util[_0x741d('0x59')](_0x741d('0x5a'),_0x164e7f[_0x741d('0x58')],_0x164e7f[_0x741d('0x50')]));fs[_0x741d('0x66')](_0x2899a8);fs['unlinkSync'](_0x291e9f);return _0x164e7f;})['then'](function(_0x1d12b0){if(_0x1d12b0){return _0x2401ad[_0x741d('0x1e')](0xcc)['end']();}})[_0x741d('0x29')](handleEntityNotFound(_0x2401ad,null))[_0x741d('0x49')](handleError(_0x2401ad,null));};
\ No newline at end of file
+var _0x7a84=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','download','save_name','join','root','converted_format','Sequelize','server/files/sounds/converted','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','start','delete','destroy','server/files/sounds/original','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x7a84,0x6b));var _0x47a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a84[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x47a8('0x0'));var rimraf=require(_0x47a8('0x1'));var zipdir=require(_0x47a8('0x2'));var jsonpatch=require(_0x47a8('0x3'));var rp=require(_0x47a8('0x4'));var moment=require(_0x47a8('0x5'));var BPromise=require(_0x47a8('0x6'));var Mustache=require(_0x47a8('0x7'));var util=require(_0x47a8('0x8'));var path=require('path');var sox=require(_0x47a8('0x9'));var csv=require(_0x47a8('0xa'));var ejs=require(_0x47a8('0xb'));var fs=require('fs');var fs_extra=require(_0x47a8('0xc'));var _=require(_0x47a8('0xd'));var squel=require(_0x47a8('0xe'));var crypto=require(_0x47a8('0xf'));var jsforce=require(_0x47a8('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x47a8('0xa'));var querystring=require(_0x47a8('0x11'));var Papa=require(_0x47a8('0x12'));var Redis=require(_0x47a8('0x13'));var authService=require(_0x47a8('0x14'));var qs=require(_0x47a8('0x15'));var as=require(_0x47a8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x47a8('0x17'))(_0x47a8('0x18'));var utils=require(_0x47a8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x47a8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54fe04,_0x206a93){_0x206a93=_0x206a93||0xcc;return function(_0x1f243d){if(_0x1f243d){return _0x54fe04[_0x47a8('0x1b')](_0x206a93);}return _0x54fe04[_0x47a8('0x1c')](_0x206a93)[_0x47a8('0x1d')]();};}function respondWithResult(_0x53e001,_0x250329){_0x250329=_0x250329||0xc8;return function(_0x16e752){if(_0x16e752){return _0x53e001[_0x47a8('0x1c')](_0x250329)[_0x47a8('0x1e')](_0x16e752);}};}function respondWithFilteredResult(_0x9c542e,_0x10a00d){return function(_0x3c94b2){if(_0x3c94b2){var _0x4aa222=typeof _0x10a00d[_0x47a8('0x1f')]===_0x47a8('0x20')&&typeof _0x10a00d['limit']===_0x47a8('0x20');var _0x12f834=_0x3c94b2[_0x47a8('0x21')];var _0x3756a0=_0x4aa222?0x0:_0x10a00d[_0x47a8('0x1f')];var _0x32e1de=_0x4aa222?_0x3c94b2[_0x47a8('0x21')]:_0x10a00d[_0x47a8('0x1f')]+_0x10a00d[_0x47a8('0x22')];var _0x25f424;if(_0x32e1de>=_0x12f834){_0x32e1de=_0x12f834;_0x25f424=0xc8;}else{_0x25f424=0xce;}_0x9c542e[_0x47a8('0x1c')](_0x25f424);return _0x9c542e[_0x47a8('0x23')](_0x47a8('0x24'),_0x3756a0+'-'+_0x32e1de+'/'+_0x12f834)['json'](_0x3c94b2);}return null;};}function patchUpdates(_0x39beda){return function(_0x50b458){try{jsonpatch['apply'](_0x50b458,_0x39beda,!![]);}catch(_0x4b937d){return BPromise[_0x47a8('0x25')](_0x4b937d);}return _0x50b458[_0x47a8('0x26')]();};}function saveUpdates(_0x490717,_0x3ea9dd){return function(_0xe698d3){if(_0xe698d3){return _0xe698d3[_0x47a8('0x27')](_0x490717)[_0x47a8('0x28')](function(_0x40137d){return _0x40137d;});}return null;};}function removeEntity(_0x457a1a,_0xa21139){return function(_0x2ef2de){if(_0x2ef2de){return _0x2ef2de['destroy']()[_0x47a8('0x28')](function(){var _0x2cd76d=_0x2ef2de['get']({'plain':!![]});var _0x4b6daf=_0x47a8('0x29');return db[_0x47a8('0x2a')]['destroy']({'where':{'type':_0x4b6daf,'resourceId':_0x2cd76d['id']}})['then'](function(){return _0x2ef2de;});})['then'](function(){_0x457a1a[_0x47a8('0x1c')](0xcc)[_0x47a8('0x1d')]();});}};}function handleEntityNotFound(_0x29ee83,_0x5c28e5){return function(_0x16bea2){if(!_0x16bea2){_0x29ee83['sendStatus'](0x194);}return _0x16bea2;};}function handleError(_0x4d175d,_0x379725){_0x379725=_0x379725||0x1f4;return function(_0x3e4c5a){logger['error'](_0x3e4c5a[_0x47a8('0x2b')]);if(_0x3e4c5a[_0x47a8('0x2c')]){delete _0x3e4c5a[_0x47a8('0x2c')];}_0x4d175d[_0x47a8('0x1c')](_0x379725)[_0x47a8('0x2d')](_0x3e4c5a);};}exports[_0x47a8('0x2e')]=function(_0x326c70,_0x3fdd01){var _0x2d7934={},_0x3c9ef2={},_0x187d4e={'count':0x0,'rows':[]};var _0x122bdb=_[_0x47a8('0x2f')](db[_0x47a8('0x30')][_0x47a8('0x31')],function(_0x4486e7){return{'name':_0x4486e7[_0x47a8('0x32')],'type':_0x4486e7[_0x47a8('0x33')][_0x47a8('0x34')]};});_0x3c9ef2[_0x47a8('0x35')]=_['map'](_0x122bdb,_0x47a8('0x2c'));_0x3c9ef2['query']=_[_0x47a8('0x36')](_0x326c70[_0x47a8('0x37')]);_0x3c9ef2[_0x47a8('0x38')]=_[_0x47a8('0x39')](_0x3c9ef2[_0x47a8('0x35')],_0x3c9ef2[_0x47a8('0x37')]);_0x2d7934['attributes']=_[_0x47a8('0x39')](_0x3c9ef2['model'],qs['fields'](_0x326c70[_0x47a8('0x37')][_0x47a8('0x3a')]));_0x2d7934[_0x47a8('0x3b')]=_0x2d7934[_0x47a8('0x3b')][_0x47a8('0x3c')]?_0x2d7934[_0x47a8('0x3b')]:_0x3c9ef2[_0x47a8('0x35')];if(!_0x326c70[_0x47a8('0x37')][_0x47a8('0x3d')]('nolimit')){_0x2d7934[_0x47a8('0x22')]=qs[_0x47a8('0x22')](_0x326c70[_0x47a8('0x37')][_0x47a8('0x22')]);_0x2d7934[_0x47a8('0x1f')]=qs[_0x47a8('0x1f')](_0x326c70[_0x47a8('0x37')]['offset']);}_0x2d7934[_0x47a8('0x3e')]=qs[_0x47a8('0x3f')](_0x326c70[_0x47a8('0x37')][_0x47a8('0x3f')]);_0x2d7934[_0x47a8('0x40')]=qs[_0x47a8('0x38')](_[_0x47a8('0x41')](_0x326c70[_0x47a8('0x37')],_0x3c9ef2['filters']),_0x122bdb);if(_0x326c70[_0x47a8('0x37')]['filter']){_0x2d7934[_0x47a8('0x40')]=_[_0x47a8('0x42')](_0x2d7934['where'],{'$or':_[_0x47a8('0x2f')](_0x122bdb,function(_0x2c4641){if(_0x2c4641[_0x47a8('0x33')]!==_0x47a8('0x43')){var _0x26a7e2={};_0x26a7e2[_0x2c4641[_0x47a8('0x2c')]]={'$like':'%'+_0x326c70['query'][_0x47a8('0x44')]+'%'};return _0x26a7e2;}})});}_0x2d7934=_[_0x47a8('0x42')]({},_0x2d7934,_0x326c70[_0x47a8('0x45')]);var _0x674c80={'where':_0x2d7934['where']};return db[_0x47a8('0x30')][_0x47a8('0x21')](_0x674c80)[_0x47a8('0x28')](function(_0x3aafdf){_0x187d4e['count']=_0x3aafdf;if(_0x326c70['query'][_0x47a8('0x46')]){_0x2d7934[_0x47a8('0x47')]=[{'all':!![]}];}return db[_0x47a8('0x30')][_0x47a8('0x48')](_0x2d7934);})[_0x47a8('0x28')](function(_0x450be8){_0x187d4e['rows']=_0x450be8;return _0x187d4e;})[_0x47a8('0x28')](respondWithFilteredResult(_0x3fdd01,_0x2d7934))[_0x47a8('0x49')](handleError(_0x3fdd01,null));};exports[_0x47a8('0x4a')]=function(_0x3e7ff7,_0x3d3593){var _0x562efc={'raw':!![],'where':{'id':_0x3e7ff7[_0x47a8('0x4b')]['id']}},_0x39c765={};_0x39c765[_0x47a8('0x35')]=_['keys'](db[_0x47a8('0x30')][_0x47a8('0x31')]);_0x39c765[_0x47a8('0x37')]=_[_0x47a8('0x36')](_0x3e7ff7['query']);_0x39c765[_0x47a8('0x38')]=_[_0x47a8('0x39')](_0x39c765[_0x47a8('0x35')],_0x39c765[_0x47a8('0x37')]);_0x562efc[_0x47a8('0x3b')]=_[_0x47a8('0x39')](_0x39c765['model'],qs[_0x47a8('0x3a')](_0x3e7ff7[_0x47a8('0x37')][_0x47a8('0x3a')]));_0x562efc[_0x47a8('0x3b')]=_0x562efc[_0x47a8('0x3b')][_0x47a8('0x3c')]?_0x562efc[_0x47a8('0x3b')]:_0x39c765[_0x47a8('0x35')];if(_0x3e7ff7[_0x47a8('0x37')][_0x47a8('0x46')]){_0x562efc[_0x47a8('0x47')]=[{'all':!![]}];}_0x562efc=_['merge']({},_0x562efc,_0x3e7ff7[_0x47a8('0x45')]);return db[_0x47a8('0x30')][_0x47a8('0x4c')](_0x562efc)['then'](handleEntityNotFound(_0x3d3593,null))[_0x47a8('0x28')](respondWithResult(_0x3d3593,null))[_0x47a8('0x49')](handleError(_0x3d3593,null));};exports[_0x47a8('0x4d')]=function(_0xc8e30c,_0x3c88f7,_0x2421a5){return db['Sound'][_0x47a8('0x4c')]({'where':{'id':_0xc8e30c[_0x47a8('0x4b')]['id']},'attributes':[_0x47a8('0x2c'),_0x47a8('0x4e'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x3c88f7,null))[_0x47a8('0x28')](function(_0x20c4e2){if(_0x20c4e2){if(!fs['existsSync'](path[_0x47a8('0x4f')](config[_0x47a8('0x50')],'server/files/sounds/converted',_0x20c4e2[_0x47a8('0x4e')]+'.'+_0x20c4e2[_0x47a8('0x51')]))){throw new db[(_0x47a8('0x52'))]['ValidationError']('Sound\x20not\x20found');}return _0x3c88f7[_0x47a8('0x4d')](path[_0x47a8('0x4f')](config['root'],_0x47a8('0x53'),util[_0x47a8('0x54')](_0x47a8('0x55'),_0x20c4e2[_0x47a8('0x4e')],_0x20c4e2['converted_format'])),util[_0x47a8('0x54')](_0x47a8('0x55'),_0x20c4e2[_0x47a8('0x2c')],_0x20c4e2['converted_format']));}return null;})[_0x47a8('0x49')](handleError(_0x3c88f7,null));};exports['create']=function(_0x11b63c,_0x193ade,_0x350ea9){var _0x299e3c={'name':path[_0x47a8('0x56')](_0x11b63c[_0x47a8('0x57')][_0x47a8('0x58')],path[_0x47a8('0x59')](_0x11b63c[_0x47a8('0x57')]['originalname'])),'save_name':path[_0x47a8('0x56')](_0x11b63c[_0x47a8('0x57')]['filename'],path[_0x47a8('0x59')](_0x11b63c[_0x47a8('0x57')][_0x47a8('0x5a')])),'original_format':path[_0x47a8('0x59')](_0x11b63c[_0x47a8('0x57')][_0x47a8('0x58')])[_0x47a8('0x5b')](0x1),'converted_format':_0x47a8('0x5c')};var _0x268c6b=path[_0x47a8('0x4f')](config[_0x47a8('0x50')],'server/files/sounds/original',_0x11b63c[_0x47a8('0x57')][_0x47a8('0x5a')]);var _0x2bae5c=path[_0x47a8('0x4f')](config[_0x47a8('0x50')],_0x47a8('0x53'),util[_0x47a8('0x54')](_0x47a8('0x55'),path[_0x47a8('0x56')](_0x11b63c[_0x47a8('0x57')]['filename'],path[_0x47a8('0x59')](_0x11b63c['file'][_0x47a8('0x5a')])),_0x299e3c[_0x47a8('0x51')]));logger[_0x47a8('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x268c6b);logger[_0x47a8('0x5d')](_0x47a8('0x5e'),_0x2bae5c);try{fs[_0x47a8('0x5f')](_0x268c6b,parseInt(_0x47a8('0x60'),0x8));var _0x5e7dfc=sox[_0x47a8('0x61')](_0x268c6b,_0x2bae5c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5e7dfc['on'](_0x47a8('0x62'),function(_0x1584f4){fs[_0x47a8('0x63')](_0x268c6b);_0x193ade['status'](0x1f4)['send'](_0x1584f4);});_0x5e7dfc['on'](_0x47a8('0x64'),function(_0xf4b56d){_0x299e3c[_0x47a8('0x65')]=isNaN(_0xf4b56d[_0x47a8('0x66')])?null:_0xf4b56d[_0x47a8('0x66')]*0x3e8;_0x299e3c[_0x47a8('0x67')]=isNaN(_0xf4b56d[_0x47a8('0x68')])?null:_0xf4b56d[_0x47a8('0x68')];_0x299e3c[_0x47a8('0x69')]=isNaN(_0xf4b56d[_0x47a8('0x6a')])?null:_0xf4b56d[_0x47a8('0x6a')];_0x299e3c['original_bitRate']=isNaN(_0xf4b56d[_0x47a8('0x6b')])?null:_0xf4b56d[_0x47a8('0x6b')];_0x299e3c[_0x47a8('0x6c')]=isNaN(_0xf4b56d['sampleRate'])?null:_0xf4b56d[_0x47a8('0x6d')];});_0x5e7dfc['on'](_0x47a8('0x6e'),function(_0x5a2561){_0x299e3c[_0x47a8('0x6f')]=isNaN(_0x5a2561['duration'])?null:_0x5a2561['duration']*0x3e8;_0x299e3c['converted_sampleCount']=isNaN(_0x5a2561['sampleCount'])?null:_0x5a2561['sampleCount'];_0x299e3c[_0x47a8('0x70')]=isNaN(_0x5a2561[_0x47a8('0x6a')])?null:_0x5a2561[_0x47a8('0x6a')];_0x299e3c[_0x47a8('0x71')]=isNaN(_0x5a2561['bitRate'])?null:_0x5a2561[_0x47a8('0x6b')];_0x299e3c[_0x47a8('0x72')]=isNaN(_0x5a2561[_0x47a8('0x6d')])?null:_0x5a2561[_0x47a8('0x6d')];});_0x5e7dfc['on'](_0x47a8('0x1d'),function(){fs[_0x47a8('0x5f')](_0x2bae5c,parseInt('0777',0x8));return db[_0x47a8('0x30')][_0x47a8('0x73')](_0x299e3c)[_0x47a8('0x28')](function(_0x4c1a0c){var _0xcc338={'role':_0x11b63c[_0x47a8('0x74')][_0x47a8('0x75')],'userProfileId':_0x11b63c['body'][_0x47a8('0x76')]};if(!_0xcc338)throw new Error(_0x47a8('0x77'));if(_0xcc338[_0x47a8('0x75')]==='user'){var _0x74117b=_0x4c1a0c[_0x47a8('0x78')]({'plain':!![]});return db[_0x47a8('0x79')][_0x47a8('0x4c')]({'where':{'name':_0x47a8('0x29'),'userProfileId':_0xcc338[_0x47a8('0x76')]},'raw':!![]})['then'](function(_0x124274){if(_0x124274&&_0x124274[_0x47a8('0x7a')]===0x0){return db['UserProfileResource']['create']({'name':_0x74117b[_0x47a8('0x2c')],'resourceId':_0x74117b['id'],'type':_0x124274[_0x47a8('0x2c')],'sectionId':_0x124274['id']},{})[_0x47a8('0x28')](function(){return _0x4c1a0c;});}else{return _0x4c1a0c;}})[_0x47a8('0x49')](function(_0x5a0a08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a0a08);throw _0x5a0a08;});}return _0x4c1a0c;})[_0x47a8('0x28')](respondWithResult(_0x193ade,null))[_0x47a8('0x49')](handleError(_0x193ade,null));});_0x5e7dfc[_0x47a8('0x7b')]();}catch(_0x5ba98f){_0x193ade[_0x47a8('0x1c')](0x1f4)[_0x47a8('0x2d')](_0x5ba98f);}};exports[_0x47a8('0x27')]=function(_0x4bc0a0,_0x58c0b0,_0x320124){return db[_0x47a8('0x30')][_0x47a8('0x4c')]({'where':{'id':_0x4bc0a0[_0x47a8('0x4b')]['id']}})[_0x47a8('0x28')](handleEntityNotFound(_0x58c0b0,null))[_0x47a8('0x28')](saveUpdates(_[_0x47a8('0x41')](_0x4bc0a0[_0x47a8('0x74')],[_0x47a8('0x2c'),'description']),null))[_0x47a8('0x28')](respondWithResult(_0x58c0b0,null))[_0x47a8('0x49')](handleError(_0x58c0b0,null));};exports[_0x47a8('0x7c')]=function(_0x4bd381,_0x2d719d,_0x4942c9){return db['Sound'][_0x47a8('0x4c')]({'where':{'id':_0x4bd381['params']['id']}})[_0x47a8('0x28')](function(_0x5448ac){if(_0x5448ac){return _0x5448ac[_0x47a8('0x7d')]();}})['then'](function(_0x4401b9){var _0xd077a3=path[_0x47a8('0x4f')](config[_0x47a8('0x50')],_0x47a8('0x7e'),util[_0x47a8('0x54')](_0x47a8('0x55'),_0x4401b9['save_name'],_0x4401b9['original_format']));var _0x25b7c8=path[_0x47a8('0x4f')](config[_0x47a8('0x50')],_0x47a8('0x53'),util[_0x47a8('0x54')]('%s.%s',_0x4401b9['save_name'],_0x4401b9['converted_format']));fs[_0x47a8('0x63')](_0xd077a3);fs[_0x47a8('0x63')](_0x25b7c8);return _0x4401b9;})['then'](function(_0x1aaff4){if(_0x1aaff4){return _0x2d719d[_0x47a8('0x1c')](0xcc)[_0x47a8('0x1d')]();}})[_0x47a8('0x28')](handleEntityNotFound(_0x2d719d,null))[_0x47a8('0x49')](handleError(_0x2d719d,null));};
\ No newline at end of file
index 1b49a0b..98f182e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5305=['rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','../../config/logger','api','request-promise'];(function(_0x19ce23,_0x527b42){var _0x32600e=function(_0x40e21e){while(--_0x40e21e){_0x19ce23['push'](_0x19ce23['shift']());}};_0x32600e(++_0x527b42);}(_0x5305,0x96));var _0x5530=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5305[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5530('0x0'))(_0x5530('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5530('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5530('0x3'));var config=require(_0x5530('0x4'));var attributes=require(_0x5530('0x5'));module['exports']=function(_0x2d95e8,_0x715a5a){return _0x2d95e8[_0x5530('0x6')](_0x5530('0x7'),attributes,{'tableName':_0x5530('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cb5=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x2edd4e,_0x96baea){var _0x4a4157=function(_0x42f97b){while(--_0x42f97b){_0x2edd4e['push'](_0x2edd4e['shift']());}};_0x4a4157(++_0x96baea);}(_0x4cb5,0xfc));var _0x54cb=function(_0x37c653,_0x29bf35){_0x37c653=_0x37c653-0x0;var _0x53acbb=_0x4cb5[_0x37c653];return _0x53acbb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x54cb('0x0'))(_0x54cb('0x1'));var moment=require('moment');var BPromise=require(_0x54cb('0x2'));var rp=require(_0x54cb('0x3'));var fs=require('fs');var path=require(_0x54cb('0x4'));var rimraf=require(_0x54cb('0x5'));var config=require(_0x54cb('0x6'));var attributes=require(_0x54cb('0x7'));module[_0x54cb('0x8')]=function(_0x4e6500,_0x241055){return _0x4e6500[_0x54cb('0x9')](_0x54cb('0xa'),attributes,{'tableName':_0x54cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54bd83b..b1a6ec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb98=['ShowSound','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','options','raw','where','attributes','include','map','model'];(function(_0x52b594,_0x5cf7b0){var _0x11b1f3=function(_0x472cc3){while(--_0x472cc3){_0x52b594['push'](_0x52b594['shift']());}};_0x11b1f3(++_0x5cf7b0);}(_0xdb98,0x13d));var _0x8db9=function(_0xa6294e,_0x194434){_0xa6294e=_0xa6294e-0x0;var _0x5d23a7=_0xdb98[_0xa6294e];return _0x5d23a7;};'use strict';var _=require('lodash');var util=require(_0x8db9('0x0'));var moment=require(_0x8db9('0x1'));var BPromise=require(_0x8db9('0x2'));var rs=require(_0x8db9('0x3'));var fs=require('fs');var Redis=require(_0x8db9('0x4'));var db=require(_0x8db9('0x5'))['db'];var utils=require(_0x8db9('0x6'));var logger=require(_0x8db9('0x7'))(_0x8db9('0x8'));var config=require(_0x8db9('0x9'));var jayson=require(_0x8db9('0xa'));var client=jayson[_0x8db9('0xb')][_0x8db9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4289a8,_0x1e1e19,_0x1b1893){return new BPromise(function(_0x974b6a,_0x265ec4){return client[_0x8db9('0xd')](_0x4289a8,_0x1b1893)[_0x8db9('0xe')](function(_0x1297e7){logger[_0x8db9('0xf')](_0x8db9('0x10'),_0x1e1e19,_0x8db9('0x11'));logger['debug'](_0x8db9('0x12'),_0x1e1e19,'request\x20sent',JSON[_0x8db9('0x13')](_0x1297e7));if(_0x1297e7['error']){if(_0x1297e7[_0x8db9('0x14')][_0x8db9('0x15')]===0x1f4){logger[_0x8db9('0x14')](_0x8db9('0x10'),_0x1e1e19,_0x1297e7['error'][_0x8db9('0x16')]);return _0x265ec4(_0x1297e7[_0x8db9('0x14')]['message']);}logger[_0x8db9('0x14')](_0x8db9('0x10'),_0x1e1e19,_0x1297e7[_0x8db9('0x14')][_0x8db9('0x16')]);return _0x974b6a(_0x1297e7['error'][_0x8db9('0x16')]);}else{logger[_0x8db9('0xf')](_0x8db9('0x10'),_0x1e1e19,_0x8db9('0x11'));_0x974b6a(_0x1297e7[_0x8db9('0x17')]['message']);}})[_0x8db9('0x18')](function(_0x37f2d5){logger[_0x8db9('0x14')]('Sound,\x20%s,\x20%s',_0x1e1e19,_0x37f2d5);_0x265ec4(_0x37f2d5);});});}exports['ShowSound']=function(_0xb27bc8){var _0x537dd5=this;return new Promise(function(_0x522fc0,_0x3c68dd){return db[_0x8db9('0x19')]['find']({'raw':_0xb27bc8[_0x8db9('0x1a')]?_0xb27bc8[_0x8db9('0x1a')][_0x8db9('0x1b')]===undefined?!![]:![]:!![],'where':_0xb27bc8[_0x8db9('0x1a')]?_0xb27bc8[_0x8db9('0x1a')][_0x8db9('0x1c')]||null:null,'attributes':_0xb27bc8[_0x8db9('0x1a')]?_0xb27bc8[_0x8db9('0x1a')][_0x8db9('0x1d')]||null:null,'include':_0xb27bc8['options']?_0xb27bc8['options'][_0x8db9('0x1e')]?_[_0x8db9('0x1f')](_0xb27bc8[_0x8db9('0x1a')]['include'],function(_0x443b3d){return{'model':db[_0x443b3d['model']],'as':_0x443b3d['as'],'attributes':_0x443b3d[_0x8db9('0x1d')],'include':_0x443b3d[_0x8db9('0x1e')]?_[_0x8db9('0x1f')](_0x443b3d['include'],function(_0x5ce8aa){return{'model':db[_0x5ce8aa[_0x8db9('0x20')]],'as':_0x5ce8aa['as'],'attributes':_0x5ce8aa['attributes'],'include':_0x5ce8aa[_0x8db9('0x1e')]?_[_0x8db9('0x1f')](_0x5ce8aa[_0x8db9('0x1e')],function(_0x26c53a){return{'model':db[_0x26c53a[_0x8db9('0x20')]],'as':_0x26c53a['as'],'attributes':_0x26c53a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8db9('0xe')](function(_0x410124){logger['info'](_0x8db9('0x21'),_0xb27bc8);logger[_0x8db9('0x22')](_0x8db9('0x21'),_0xb27bc8,JSON[_0x8db9('0x13')](_0x410124));_0x522fc0(_0x410124);})[_0x8db9('0x18')](function(_0x55802c){logger['error']('ShowSound',_0x55802c['message'],_0xb27bc8);_0x3c68dd(_0x537dd5[_0x8db9('0x14')](0x1f4,_0x55802c[_0x8db9('0x16')]));});});};
\ No newline at end of file
+var _0x3f42=['then','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x21c903,_0x1c3cec){var _0x36e6ab=function(_0x1ff048){while(--_0x1ff048){_0x21c903['push'](_0x21c903['shift']());}};_0x36e6ab(++_0x1c3cec);}(_0x3f42,0x11d));var _0x23f4=function(_0x7ae2c,_0x471ba8){_0x7ae2c=_0x7ae2c-0x0;var _0x4eb11d=_0x3f42[_0x7ae2c];return _0x4eb11d;};'use strict';var _=require('lodash');var util=require(_0x23f4('0x0'));var moment=require(_0x23f4('0x1'));var BPromise=require(_0x23f4('0x2'));var rs=require(_0x23f4('0x3'));var fs=require('fs');var Redis=require(_0x23f4('0x4'));var db=require(_0x23f4('0x5'))['db'];var utils=require(_0x23f4('0x6'));var logger=require(_0x23f4('0x7'))('rpc');var config=require(_0x23f4('0x8'));var jayson=require(_0x23f4('0x9'));var client=jayson[_0x23f4('0xa')][_0x23f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3466ea,_0x16361c,_0x2c1700){return new BPromise(function(_0x4b9c3c,_0x47c7cd){return client['request'](_0x3466ea,_0x2c1700)[_0x23f4('0xc')](function(_0x52bd23){logger['info'](_0x23f4('0xd'),_0x16361c,_0x23f4('0xe'));logger[_0x23f4('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x16361c,_0x23f4('0xe'),JSON[_0x23f4('0x10')](_0x52bd23));if(_0x52bd23[_0x23f4('0x11')]){if(_0x52bd23[_0x23f4('0x11')][_0x23f4('0x12')]===0x1f4){logger[_0x23f4('0x11')]('Sound,\x20%s,\x20%s',_0x16361c,_0x52bd23[_0x23f4('0x11')][_0x23f4('0x13')]);return _0x47c7cd(_0x52bd23['error'][_0x23f4('0x13')]);}logger[_0x23f4('0x11')]('Sound,\x20%s,\x20%s',_0x16361c,_0x52bd23[_0x23f4('0x11')][_0x23f4('0x13')]);return _0x4b9c3c(_0x52bd23[_0x23f4('0x11')][_0x23f4('0x13')]);}else{logger[_0x23f4('0x14')](_0x23f4('0xd'),_0x16361c,'request\x20sent');_0x4b9c3c(_0x52bd23[_0x23f4('0x15')][_0x23f4('0x13')]);}})[_0x23f4('0x16')](function(_0x5a8eae){logger[_0x23f4('0x11')]('Sound,\x20%s,\x20%s',_0x16361c,_0x5a8eae);_0x47c7cd(_0x5a8eae);});});}exports[_0x23f4('0x17')]=function(_0xc28a0f){var _0x642926=this;return new Promise(function(_0x3da8b2,_0x28976a){return db[_0x23f4('0x18')][_0x23f4('0x19')]({'raw':_0xc28a0f[_0x23f4('0x1a')]?_0xc28a0f['options'][_0x23f4('0x1b')]===undefined?!![]:![]:!![],'where':_0xc28a0f['options']?_0xc28a0f[_0x23f4('0x1a')][_0x23f4('0x1c')]||null:null,'attributes':_0xc28a0f['options']?_0xc28a0f[_0x23f4('0x1a')]['attributes']||null:null,'include':_0xc28a0f[_0x23f4('0x1a')]?_0xc28a0f[_0x23f4('0x1a')][_0x23f4('0x1d')]?_[_0x23f4('0x1e')](_0xc28a0f[_0x23f4('0x1a')][_0x23f4('0x1d')],function(_0x35370c){return{'model':db[_0x35370c[_0x23f4('0x1f')]],'as':_0x35370c['as'],'attributes':_0x35370c[_0x23f4('0x20')],'include':_0x35370c[_0x23f4('0x1d')]?_[_0x23f4('0x1e')](_0x35370c[_0x23f4('0x1d')],function(_0x4cd52a){return{'model':db[_0x4cd52a[_0x23f4('0x1f')]],'as':_0x4cd52a['as'],'attributes':_0x4cd52a[_0x23f4('0x20')],'include':_0x4cd52a[_0x23f4('0x1d')]?_[_0x23f4('0x1e')](_0x4cd52a[_0x23f4('0x1d')],function(_0x14c5ff){return{'model':db[_0x14c5ff[_0x23f4('0x1f')]],'as':_0x14c5ff['as'],'attributes':_0x14c5ff[_0x23f4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x23f4('0xc')](function(_0x4e4b7e){logger['info'](_0x23f4('0x17'),_0xc28a0f);logger[_0x23f4('0xf')](_0x23f4('0x17'),_0xc28a0f,JSON[_0x23f4('0x10')](_0x4e4b7e));_0x3da8b2(_0x4e4b7e);})[_0x23f4('0x16')](function(_0x50811c){logger['error']('ShowSound',_0x50811c[_0x23f4('0x13')],_0xc28a0f);_0x28976a(_0x642926['error'](0x1f4,_0x50811c[_0x23f4('0x13')]));});});};
\ No newline at end of file
index 19b5bf6..3ce4c29 100644 (file)
@@ -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(_0x50fffc,_0x131334){var _0x4c1995=function(_0x2e605a){while(--_0x2e605a){_0x50fffc['push'](_0x50fffc['shift']());}};_0x4c1995(++_0x131334);}(_0x5eb8,0xb0));var _0x85eb=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x5eb8[_0x13c70c];return _0x50f0f2;};'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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x5e6e15,_0x1cdfcf){var _0x2e8e41=function(_0x3ed20e){while(--_0x3ed20e){_0x5e6e15['push'](_0x5e6e15['shift']());}};_0x2e8e41(++_0x1cdfcf);}(_0x2032,0xd9));var _0x2203=function(_0x4403b5,_0x398a96){_0x4403b5=_0x4403b5-0x0;var _0x4beabd=_0x2032[_0x4403b5];return _0x4beabd;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router;
\ No newline at end of file
index d1f0ab6..f9046ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d16=['medium','out','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d16,0x17e));var _0x61d1=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1d16[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require('sequelize');module[_0x61d1('0x0')]={'uniqueid':{'type':Sequelize[_0x61d1('0x1')]},'body':{'type':Sequelize[_0x61d1('0x2')](_0x61d1('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x61d1('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3cb5=['STRING','TEXT','out','sequelize','exports'];(function(_0x472362,_0x5bf95d){var _0x5ae4d6=function(_0x3368f9){while(--_0x3368f9){_0x472362['push'](_0x472362['shift']());}};_0x5ae4d6(++_0x5bf95d);}(_0x3cb5,0x1a2));var _0x53cb=function(_0x383972,_0x4481d2){_0x383972=_0x383972-0x0;var _0x1e0bd1=_0x3cb5[_0x383972];return _0x1e0bd1;};'use strict';var Sequelize=require(_0x53cb('0x0'));module[_0x53cb('0x1')]={'uniqueid':{'type':Sequelize[_0x53cb('0x2')]},'body':{'type':Sequelize[_0x53cb('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x53cb('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x53cb('0x2')]},'providerResponse':{'type':Sequelize[_0x53cb('0x3')]}};
\ No newline at end of file
index dc00c6a..a617b15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e6=['where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','end','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x42df3f,_0x4fdea7){var _0x334f56=function(_0x41aece){while(--_0x41aece){_0x42df3f['push'](_0x42df3f['shift']());}};_0x334f56(++_0x4fdea7);}(_0x74e6,0xed));var _0x674e=function(_0x3e0554,_0x4046e7){_0x3e0554=_0x3e0554-0x0;var _0x2c7bcc=_0x74e6[_0x3e0554];return _0x2c7bcc;};'use strict';var emlformat=require(_0x674e('0x0'));var rimraf=require(_0x674e('0x1'));var zipdir=require(_0x674e('0x2'));var jsonpatch=require(_0x674e('0x3'));var rp=require('request-promise');var moment=require(_0x674e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x674e('0x5'));var util=require(_0x674e('0x6'));var path=require(_0x674e('0x7'));var sox=require(_0x674e('0x8'));var csv=require('to-csv');var ejs=require(_0x674e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x674e('0xa'));var squel=require(_0x674e('0xb'));var crypto=require(_0x674e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x674e('0xd'));var querystring=require('querystring');var Papa=require(_0x674e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x674e('0xf'));var as=require(_0x674e('0x10'));var hardwareService=require(_0x674e('0x11'));var logger=require(_0x674e('0x12'))(_0x674e('0x13'));var utils=require(_0x674e('0x14'));var config=require(_0x674e('0x15'));var licenseUtil=require(_0x674e('0x16'));var db=require(_0x674e('0x17'))['db'];function respondWithStatusCode(_0x5458dd,_0x259ae3){_0x259ae3=_0x259ae3||0xcc;return function(_0x24a8c0){if(_0x24a8c0){return _0x5458dd[_0x674e('0x18')](_0x259ae3);}return _0x5458dd['status'](_0x259ae3)['end']();};}function respondWithResult(_0xc863b3,_0x10037d){_0x10037d=_0x10037d||0xc8;return function(_0x4c559e){if(_0x4c559e){return _0xc863b3['status'](_0x10037d)[_0x674e('0x19')](_0x4c559e);}};}function respondWithFilteredResult(_0xb063c,_0x649460){return function(_0x50beb4){if(_0x50beb4){var _0x4c00d0=typeof _0x649460[_0x674e('0x1a')]===_0x674e('0x1b')&&typeof _0x649460[_0x674e('0x1c')]==='undefined';var _0x52eaa8=_0x50beb4['count'];var _0x397cb0=_0x4c00d0?0x0:_0x649460[_0x674e('0x1a')];var _0x32b08=_0x4c00d0?_0x50beb4[_0x674e('0x1d')]:_0x649460[_0x674e('0x1a')]+_0x649460[_0x674e('0x1c')];var _0x13fe1b;if(_0x32b08>=_0x52eaa8){_0x32b08=_0x52eaa8;_0x13fe1b=0xc8;}else{_0x13fe1b=0xce;}_0xb063c[_0x674e('0x1e')](_0x13fe1b);return _0xb063c[_0x674e('0x1f')]('Content-Range',_0x397cb0+'-'+_0x32b08+'/'+_0x52eaa8)['json'](_0x50beb4);}return null;};}function patchUpdates(_0x59c426){return function(_0x36f49b){try{jsonpatch[_0x674e('0x20')](_0x36f49b,_0x59c426,!![]);}catch(_0x1fc50f){return BPromise[_0x674e('0x21')](_0x1fc50f);}return _0x36f49b[_0x674e('0x22')]();};}function saveUpdates(_0x473309,_0x513662){return function(_0x588929){if(_0x588929){return _0x588929[_0x674e('0x23')](_0x473309)[_0x674e('0x24')](function(_0x2c596a){return _0x2c596a;});}return null;};}function removeEntity(_0x3e816e,_0x5dfbf7){return function(_0x496edd){if(_0x496edd){return _0x496edd['destroy']()['then'](function(){_0x3e816e[_0x674e('0x1e')](0xcc)[_0x674e('0x25')]();});}};}function handleEntityNotFound(_0x4674d2,_0x2f37a0){return function(_0x55aaf1){if(!_0x55aaf1){_0x4674d2[_0x674e('0x18')](0x194);}return _0x55aaf1;};}function handleError(_0x4d7fde,_0x243b2f){_0x243b2f=_0x243b2f||0x1f4;return function(_0x8de59e){logger[_0x674e('0x26')](_0x8de59e[_0x674e('0x27')]);if(_0x8de59e['name']){delete _0x8de59e[_0x674e('0x28')];}_0x4d7fde[_0x674e('0x1e')](_0x243b2f)['send'](_0x8de59e);};}exports[_0x674e('0x29')]=function(_0x5d1f5b,_0x27ee32){var _0x483d13={},_0x45f960={},_0x349d91={'count':0x0,'rows':[]};var _0x54ccaa=_['map'](db[_0x674e('0x2a')][_0x674e('0x2b')],function(_0x57031d){return{'name':_0x57031d[_0x674e('0x2c')],'type':_0x57031d[_0x674e('0x2d')][_0x674e('0x2e')]};});_0x45f960[_0x674e('0x2f')]=_[_0x674e('0x30')](_0x54ccaa,_0x674e('0x28'));_0x45f960[_0x674e('0x31')]=_[_0x674e('0x32')](_0x5d1f5b[_0x674e('0x31')]);_0x45f960[_0x674e('0x33')]=_[_0x674e('0x34')](_0x45f960['model'],_0x45f960[_0x674e('0x31')]);_0x483d13[_0x674e('0x35')]=_[_0x674e('0x34')](_0x45f960[_0x674e('0x2f')],qs['fields'](_0x5d1f5b[_0x674e('0x31')][_0x674e('0x36')]));_0x483d13[_0x674e('0x35')]=_0x483d13[_0x674e('0x35')][_0x674e('0x37')]?_0x483d13[_0x674e('0x35')]:_0x45f960[_0x674e('0x2f')];if(!_0x5d1f5b[_0x674e('0x31')][_0x674e('0x38')]('nolimit')){_0x483d13['limit']=qs[_0x674e('0x1c')](_0x5d1f5b['query'][_0x674e('0x1c')]);_0x483d13[_0x674e('0x1a')]=qs[_0x674e('0x1a')](_0x5d1f5b[_0x674e('0x31')][_0x674e('0x1a')]);}_0x483d13[_0x674e('0x39')]=qs[_0x674e('0x3a')](_0x5d1f5b[_0x674e('0x31')]['sort']);_0x483d13[_0x674e('0x3b')]=qs['filters'](_[_0x674e('0x3c')](_0x5d1f5b[_0x674e('0x31')],_0x45f960[_0x674e('0x33')]),_0x54ccaa);if(_0x5d1f5b[_0x674e('0x31')][_0x674e('0x3d')]){_0x483d13[_0x674e('0x3b')]=_[_0x674e('0x3e')](_0x483d13['where'],{'$or':_[_0x674e('0x30')](_0x54ccaa,function(_0x4fd117){if(_0x4fd117['type']!==_0x674e('0x3f')){var _0x564a0e={};_0x564a0e[_0x4fd117[_0x674e('0x28')]]={'$like':'%'+_0x5d1f5b[_0x674e('0x31')][_0x674e('0x3d')]+'%'};return _0x564a0e;}})});}_0x483d13=_['merge']({},_0x483d13,_0x5d1f5b[_0x674e('0x40')]);var _0x5385e6={'where':_0x483d13[_0x674e('0x3b')]};return db['SquareMessage'][_0x674e('0x1d')](_0x5385e6)[_0x674e('0x24')](function(_0x5e5d2b){_0x349d91[_0x674e('0x1d')]=_0x5e5d2b;if(_0x5d1f5b[_0x674e('0x31')][_0x674e('0x41')]){_0x483d13['include']=[{'all':!![]}];}return db[_0x674e('0x2a')]['findAll'](_0x483d13);})[_0x674e('0x24')](function(_0x57fe71){_0x349d91[_0x674e('0x42')]=_0x57fe71;return _0x349d91;})[_0x674e('0x24')](respondWithFilteredResult(_0x27ee32,_0x483d13))[_0x674e('0x43')](handleError(_0x27ee32,null));};exports[_0x674e('0x44')]=function(_0x4ae225,_0x3b8282){var _0x598a82={'raw':!![],'where':{'id':_0x4ae225['params']['id']}},_0x2a3d36={};_0x2a3d36['model']=_['keys'](db[_0x674e('0x2a')]['rawAttributes']);_0x2a3d36[_0x674e('0x31')]=_[_0x674e('0x32')](_0x4ae225['query']);_0x2a3d36[_0x674e('0x33')]=_[_0x674e('0x34')](_0x2a3d36[_0x674e('0x2f')],_0x2a3d36[_0x674e('0x31')]);_0x598a82['attributes']=_[_0x674e('0x34')](_0x2a3d36[_0x674e('0x2f')],qs[_0x674e('0x36')](_0x4ae225['query']['fields']));_0x598a82[_0x674e('0x35')]=_0x598a82[_0x674e('0x35')]['length']?_0x598a82[_0x674e('0x35')]:_0x2a3d36[_0x674e('0x2f')];if(_0x4ae225[_0x674e('0x31')][_0x674e('0x41')]){_0x598a82['include']=[{'all':!![]}];}_0x598a82=_[_0x674e('0x3e')]({},_0x598a82,_0x4ae225[_0x674e('0x40')]);return db['SquareMessage'][_0x674e('0x45')](_0x598a82)[_0x674e('0x24')](handleEntityNotFound(_0x3b8282,null))[_0x674e('0x24')](respondWithResult(_0x3b8282,null))['catch'](handleError(_0x3b8282,null));};exports[_0x674e('0x46')]=function(_0x2f1f71,_0x121657){return db['SquareMessage']['create'](_0x2f1f71[_0x674e('0x47')],{})[_0x674e('0x24')](respondWithResult(_0x121657,0xc9))[_0x674e('0x43')](handleError(_0x121657,null));};exports[_0x674e('0x23')]=function(_0x1c359d,_0xf832ed){if(_0x1c359d[_0x674e('0x47')]['id']){delete _0x1c359d['body']['id'];}return db[_0x674e('0x2a')][_0x674e('0x45')]({'where':{'id':_0x1c359d['params']['id']}})['then'](handleEntityNotFound(_0xf832ed,null))[_0x674e('0x24')](saveUpdates(_0x1c359d['body'],null))[_0x674e('0x24')](respondWithResult(_0xf832ed,null))[_0x674e('0x43')](handleError(_0xf832ed,null));};exports[_0x674e('0x48')]=function(_0x47f786,_0x19e956){return db[_0x674e('0x2a')][_0x674e('0x45')]({'where':{'id':_0x47f786[_0x674e('0x49')]['id']}})[_0x674e('0x24')](handleEntityNotFound(_0x19e956,null))[_0x674e('0x24')](removeEntity(_0x19e956,null))[_0x674e('0x43')](handleError(_0x19e956,null));};
\ No newline at end of file
+var _0x63d6=['map','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','keys','includeAll','include','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','SquareMessage','rawAttributes','fieldName','type','key','model'];(function(_0x114efe,_0x29836c){var _0x1d46ed=function(_0x2e6d03){while(--_0x2e6d03){_0x114efe['push'](_0x114efe['shift']());}};_0x1d46ed(++_0x29836c);}(_0x63d6,0xae));var _0x663d=function(_0x259708,_0x524f85){_0x259708=_0x259708-0x0;var _0x3e6b43=_0x63d6[_0x259708];return _0x3e6b43;};'use strict';var emlformat=require(_0x663d('0x0'));var rimraf=require(_0x663d('0x1'));var zipdir=require(_0x663d('0x2'));var jsonpatch=require(_0x663d('0x3'));var rp=require(_0x663d('0x4'));var moment=require('moment');var BPromise=require(_0x663d('0x5'));var Mustache=require(_0x663d('0x6'));var util=require('util');var path=require(_0x663d('0x7'));var sox=require(_0x663d('0x8'));var csv=require(_0x663d('0x9'));var ejs=require(_0x663d('0xa'));var fs=require('fs');var fs_extra=require(_0x663d('0xb'));var _=require(_0x663d('0xc'));var squel=require(_0x663d('0xd'));var crypto=require('crypto');var jsforce=require(_0x663d('0xe'));var deskjs=require(_0x663d('0xf'));var toCsv=require(_0x663d('0x9'));var querystring=require(_0x663d('0x10'));var Papa=require(_0x663d('0x11'));var Redis=require(_0x663d('0x12'));var authService=require(_0x663d('0x13'));var qs=require(_0x663d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x663d('0x15'))('api');var utils=require(_0x663d('0x16'));var config=require(_0x663d('0x17'));var licenseUtil=require(_0x663d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51633b,_0x3176c0){_0x3176c0=_0x3176c0||0xcc;return function(_0xdd1d9b){if(_0xdd1d9b){return _0x51633b[_0x663d('0x19')](_0x3176c0);}return _0x51633b[_0x663d('0x1a')](_0x3176c0)[_0x663d('0x1b')]();};}function respondWithResult(_0x558835,_0x2687f7){_0x2687f7=_0x2687f7||0xc8;return function(_0x307a21){if(_0x307a21){return _0x558835[_0x663d('0x1a')](_0x2687f7)[_0x663d('0x1c')](_0x307a21);}};}function respondWithFilteredResult(_0x147926,_0x4263a3){return function(_0x4d2826){if(_0x4d2826){var _0x2535ec=typeof _0x4263a3[_0x663d('0x1d')]===_0x663d('0x1e')&&typeof _0x4263a3[_0x663d('0x1f')]===_0x663d('0x1e');var _0x9c9cc8=_0x4d2826[_0x663d('0x20')];var _0x4e5d87=_0x2535ec?0x0:_0x4263a3[_0x663d('0x1d')];var _0x3c971f=_0x2535ec?_0x4d2826[_0x663d('0x20')]:_0x4263a3[_0x663d('0x1d')]+_0x4263a3['limit'];var _0x2de59d;if(_0x3c971f>=_0x9c9cc8){_0x3c971f=_0x9c9cc8;_0x2de59d=0xc8;}else{_0x2de59d=0xce;}_0x147926[_0x663d('0x1a')](_0x2de59d);return _0x147926[_0x663d('0x21')](_0x663d('0x22'),_0x4e5d87+'-'+_0x3c971f+'/'+_0x9c9cc8)[_0x663d('0x1c')](_0x4d2826);}return null;};}function patchUpdates(_0x4f806f){return function(_0x5c4e0e){try{jsonpatch['apply'](_0x5c4e0e,_0x4f806f,!![]);}catch(_0x3add50){return BPromise[_0x663d('0x23')](_0x3add50);}return _0x5c4e0e['save']();};}function saveUpdates(_0x3b41bb,_0x5a0d9f){return function(_0x1222b4){if(_0x1222b4){return _0x1222b4[_0x663d('0x24')](_0x3b41bb)[_0x663d('0x25')](function(_0x5a2d78){return _0x5a2d78;});}return null;};}function removeEntity(_0x300eae,_0x50ba77){return function(_0x42c345){if(_0x42c345){return _0x42c345['destroy']()['then'](function(){_0x300eae[_0x663d('0x1a')](0xcc)[_0x663d('0x1b')]();});}};}function handleEntityNotFound(_0xb03719,_0x28b929){return function(_0x1c7f9d){if(!_0x1c7f9d){_0xb03719[_0x663d('0x19')](0x194);}return _0x1c7f9d;};}function handleError(_0x3e0a17,_0x35f002){_0x35f002=_0x35f002||0x1f4;return function(_0x2a47cf){logger[_0x663d('0x26')](_0x2a47cf[_0x663d('0x27')]);if(_0x2a47cf['name']){delete _0x2a47cf[_0x663d('0x28')];}_0x3e0a17[_0x663d('0x1a')](_0x35f002)[_0x663d('0x29')](_0x2a47cf);};}exports['index']=function(_0x155af7,_0x25fb71){var _0x364266={},_0x85e61f={},_0x13e85b={'count':0x0,'rows':[]};var _0x431c95=_['map'](db[_0x663d('0x2a')][_0x663d('0x2b')],function(_0x5cd0ad){return{'name':_0x5cd0ad[_0x663d('0x2c')],'type':_0x5cd0ad[_0x663d('0x2d')][_0x663d('0x2e')]};});_0x85e61f[_0x663d('0x2f')]=_[_0x663d('0x30')](_0x431c95,_0x663d('0x28'));_0x85e61f[_0x663d('0x31')]=_['keys'](_0x155af7[_0x663d('0x31')]);_0x85e61f['filters']=_[_0x663d('0x32')](_0x85e61f[_0x663d('0x2f')],_0x85e61f[_0x663d('0x31')]);_0x364266['attributes']=_['intersection'](_0x85e61f[_0x663d('0x2f')],qs[_0x663d('0x33')](_0x155af7[_0x663d('0x31')]['fields']));_0x364266[_0x663d('0x34')]=_0x364266[_0x663d('0x34')]['length']?_0x364266['attributes']:_0x85e61f[_0x663d('0x2f')];if(!_0x155af7[_0x663d('0x31')][_0x663d('0x35')](_0x663d('0x36'))){_0x364266[_0x663d('0x1f')]=qs[_0x663d('0x1f')](_0x155af7[_0x663d('0x31')][_0x663d('0x1f')]);_0x364266[_0x663d('0x1d')]=qs[_0x663d('0x1d')](_0x155af7[_0x663d('0x31')][_0x663d('0x1d')]);}_0x364266['order']=qs[_0x663d('0x37')](_0x155af7[_0x663d('0x31')][_0x663d('0x37')]);_0x364266[_0x663d('0x38')]=qs[_0x663d('0x39')](_[_0x663d('0x3a')](_0x155af7[_0x663d('0x31')],_0x85e61f[_0x663d('0x39')]),_0x431c95);if(_0x155af7[_0x663d('0x31')][_0x663d('0x3b')]){_0x364266[_0x663d('0x38')]=_[_0x663d('0x3c')](_0x364266[_0x663d('0x38')],{'$or':_[_0x663d('0x30')](_0x431c95,function(_0x5d4f1e){if(_0x5d4f1e[_0x663d('0x2d')]!==_0x663d('0x3d')){var _0x39511c={};_0x39511c[_0x5d4f1e[_0x663d('0x28')]]={'$like':'%'+_0x155af7[_0x663d('0x31')][_0x663d('0x3b')]+'%'};return _0x39511c;}})});}_0x364266=_[_0x663d('0x3c')]({},_0x364266,_0x155af7[_0x663d('0x3e')]);var _0x42aea1={'where':_0x364266[_0x663d('0x38')]};return db[_0x663d('0x2a')][_0x663d('0x20')](_0x42aea1)[_0x663d('0x25')](function(_0x59f141){_0x13e85b[_0x663d('0x20')]=_0x59f141;if(_0x155af7[_0x663d('0x31')]['includeAll']){_0x364266['include']=[{'all':!![]}];}return db[_0x663d('0x2a')]['findAll'](_0x364266);})[_0x663d('0x25')](function(_0x31a112){_0x13e85b[_0x663d('0x3f')]=_0x31a112;return _0x13e85b;})[_0x663d('0x25')](respondWithFilteredResult(_0x25fb71,_0x364266))[_0x663d('0x40')](handleError(_0x25fb71,null));};exports[_0x663d('0x41')]=function(_0xe1d3d9,_0x48d24c){var _0x40c2ef={'raw':!![],'where':{'id':_0xe1d3d9[_0x663d('0x42')]['id']}},_0xc9bb7c={};_0xc9bb7c[_0x663d('0x2f')]=_[_0x663d('0x43')](db['SquareMessage'][_0x663d('0x2b')]);_0xc9bb7c[_0x663d('0x31')]=_[_0x663d('0x43')](_0xe1d3d9[_0x663d('0x31')]);_0xc9bb7c['filters']=_['intersection'](_0xc9bb7c['model'],_0xc9bb7c['query']);_0x40c2ef[_0x663d('0x34')]=_[_0x663d('0x32')](_0xc9bb7c[_0x663d('0x2f')],qs[_0x663d('0x33')](_0xe1d3d9[_0x663d('0x31')]['fields']));_0x40c2ef[_0x663d('0x34')]=_0x40c2ef[_0x663d('0x34')]['length']?_0x40c2ef['attributes']:_0xc9bb7c['model'];if(_0xe1d3d9['query'][_0x663d('0x44')]){_0x40c2ef[_0x663d('0x45')]=[{'all':!![]}];}_0x40c2ef=_['merge']({},_0x40c2ef,_0xe1d3d9['options']);return db[_0x663d('0x2a')]['find'](_0x40c2ef)[_0x663d('0x25')](handleEntityNotFound(_0x48d24c,null))[_0x663d('0x25')](respondWithResult(_0x48d24c,null))['catch'](handleError(_0x48d24c,null));};exports['create']=function(_0x2b7fcc,_0xc249fe){return db['SquareMessage'][_0x663d('0x46')](_0x2b7fcc[_0x663d('0x47')],{})['then'](respondWithResult(_0xc249fe,0xc9))[_0x663d('0x40')](handleError(_0xc249fe,null));};exports[_0x663d('0x24')]=function(_0x5a2320,_0x4cf243){if(_0x5a2320[_0x663d('0x47')]['id']){delete _0x5a2320[_0x663d('0x47')]['id'];}return db['SquareMessage'][_0x663d('0x48')]({'where':{'id':_0x5a2320[_0x663d('0x42')]['id']}})[_0x663d('0x25')](handleEntityNotFound(_0x4cf243,null))[_0x663d('0x25')](saveUpdates(_0x5a2320[_0x663d('0x47')],null))['then'](respondWithResult(_0x4cf243,null))['catch'](handleError(_0x4cf243,null));};exports[_0x663d('0x49')]=function(_0x30228d,_0x4e4111){return db[_0x663d('0x2a')]['find']({'where':{'id':_0x30228d['params']['id']}})[_0x663d('0x25')](handleEntityNotFound(_0x4e4111,null))[_0x663d('0x25')](removeEntity(_0x4e4111,null))[_0x663d('0x40')](handleError(_0x4e4111,null));};
\ No newline at end of file
index 67e72b4..132d7e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x615f=['./squareMessage.attributes','exports','define','SquareMessage','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x571833,_0x5383e8){var _0x38bc03=function(_0x494048){while(--_0x494048){_0x571833['push'](_0x571833['shift']());}};_0x38bc03(++_0x5383e8);}(_0x615f,0x7c));var _0xf615=function(_0x1cf890,_0x37e8aa){_0x1cf890=_0x1cf890-0x0;var _0x2fab7c=_0x615f[_0x1cf890];return _0x2fab7c;};'use strict';var _=require(_0xf615('0x0'));var util=require('util');var logger=require(_0xf615('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf615('0x2'));var rp=require(_0xf615('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf615('0x4'));var config=require(_0xf615('0x5'));var attributes=require(_0xf615('0x6'));module[_0xf615('0x7')]=function(_0x76764b,_0x2c29b6){return _0x76764b[_0xf615('0x8')](_0xf615('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2f3=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xa2f3,0x101));var _0x3a2f=function(_0x5d2979,_0xc79fbf){_0x5d2979=_0x5d2979-0x0;var _0x5d3ebf=_0xa2f3[_0x5d2979];return _0x5d3ebf;};'use strict';var _=require(_0x3a2f('0x0'));var util=require('util');var logger=require(_0x3a2f('0x1'))('api');var moment=require(_0x3a2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a2f('0x3'));var fs=require('fs');var path=require(_0x3a2f('0x4'));var rimraf=require(_0x3a2f('0x5'));var config=require(_0x3a2f('0x6'));var attributes=require(_0x3a2f('0x7'));module[_0x3a2f('0x8')]=function(_0x2988a2,_0x270854){return _0x2988a2[_0x3a2f('0x9')](_0x3a2f('0xa'),attributes,{'tableName':_0x3a2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index babf676..f89ed35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x795d=['raw','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','catch','CreateSquareMessage','SquareMessage','create','body','options'];(function(_0x26acf8,_0x55d2c8){var _0x14b716=function(_0x2ee054){while(--_0x2ee054){_0x26acf8['push'](_0x26acf8['shift']());}};_0x14b716(++_0x55d2c8);}(_0x795d,0x8f));var _0xd795=function(_0x13ff4f,_0x4defc2){_0x13ff4f=_0x13ff4f-0x0;var _0xd04dee=_0x795d[_0x13ff4f];return _0xd04dee;};'use strict';var _=require('lodash');var util=require(_0xd795('0x0'));var moment=require(_0xd795('0x1'));var BPromise=require(_0xd795('0x2'));var rs=require(_0xd795('0x3'));var fs=require('fs');var Redis=require(_0xd795('0x4'));var db=require(_0xd795('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd795('0x6'))(_0xd795('0x7'));var config=require(_0xd795('0x8'));var jayson=require(_0xd795('0x9'));var client=jayson[_0xd795('0xa')][_0xd795('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22185d,_0x40ed49,_0x1a8a11){return new BPromise(function(_0x2459c6,_0x42202a){return client['request'](_0x22185d,_0x1a8a11)[_0xd795('0xc')](function(_0x562886){logger[_0xd795('0xd')](_0xd795('0xe'),_0x40ed49,_0xd795('0xf'));logger['debug'](_0xd795('0x10'),_0x40ed49,_0xd795('0xf'),JSON['stringify'](_0x562886));if(_0x562886['error']){if(_0x562886['error']['code']===0x1f4){logger[_0xd795('0x11')]('SquareMessage,\x20%s,\x20%s',_0x40ed49,_0x562886[_0xd795('0x11')][_0xd795('0x12')]);return _0x42202a(_0x562886[_0xd795('0x11')]['message']);}logger['error'](_0xd795('0xe'),_0x40ed49,_0x562886[_0xd795('0x11')]['message']);return _0x2459c6(_0x562886[_0xd795('0x11')][_0xd795('0x12')]);}else{logger[_0xd795('0xd')](_0xd795('0xe'),_0x40ed49,_0xd795('0xf'));_0x2459c6(_0x562886['result']['message']);}})[_0xd795('0x13')](function(_0x938d1){logger[_0xd795('0x11')](_0xd795('0xe'),_0x40ed49,_0x938d1);_0x42202a(_0x938d1);});});}exports[_0xd795('0x14')]=function(_0x43839c){var _0x156167=this;return new Promise(function(_0x44bd69,_0x565e46){return db[_0xd795('0x15')][_0xd795('0x16')](_0x43839c[_0xd795('0x17')],{'raw':_0x43839c[_0xd795('0x18')]?_0x43839c[_0xd795('0x18')][_0xd795('0x19')]===undefined?!![]:![]:!![]})[_0xd795('0xc')](function(_0x358bd2){logger['info'](_0xd795('0x14'),_0x43839c);logger[_0xd795('0x1a')](_0xd795('0x14'),_0x43839c,JSON[_0xd795('0x1b')](_0x358bd2));_0x44bd69(_0x358bd2);})[_0xd795('0x13')](function(_0x472b2e){logger[_0xd795('0x11')](_0xd795('0x14'),_0x472b2e[_0xd795('0x12')],_0x43839c);_0x565e46(_0x156167[_0xd795('0x11')](0x1f4,_0x472b2e[_0xd795('0x12')]));});});};
\ No newline at end of file
+var _0x3e9c=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x34438c,_0x3c50b5){var _0x5ae533=function(_0x25f67a){while(--_0x25f67a){_0x34438c['push'](_0x34438c['shift']());}};_0x5ae533(++_0x3c50b5);}(_0x3e9c,0x114));var _0xc3e9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3e9c[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc3e9('0x0'));var rs=require(_0xc3e9('0x1'));var fs=require('fs');var Redis=require(_0xc3e9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3e9('0x3'));var logger=require('../../config/logger')(_0xc3e9('0x4'));var config=require('../../config/environment');var jayson=require(_0xc3e9('0x5'));var client=jayson[_0xc3e9('0x6')][_0xc3e9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf973f2,_0xf3e256,_0x318960){return new BPromise(function(_0x5b7e71,_0x185498){return client[_0xc3e9('0x8')](_0xf973f2,_0x318960)[_0xc3e9('0x9')](function(_0x43393a){logger[_0xc3e9('0xa')](_0xc3e9('0xb'),_0xf3e256,_0xc3e9('0xc'));logger[_0xc3e9('0xd')](_0xc3e9('0xe'),_0xf3e256,_0xc3e9('0xc'),JSON[_0xc3e9('0xf')](_0x43393a));if(_0x43393a['error']){if(_0x43393a['error']['code']===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0xf3e256,_0x43393a[_0xc3e9('0x10')][_0xc3e9('0x11')]);return _0x185498(_0x43393a['error'][_0xc3e9('0x11')]);}logger[_0xc3e9('0x10')](_0xc3e9('0xb'),_0xf3e256,_0x43393a['error'][_0xc3e9('0x11')]);return _0x5b7e71(_0x43393a[_0xc3e9('0x10')][_0xc3e9('0x11')]);}else{logger[_0xc3e9('0xa')](_0xc3e9('0xb'),_0xf3e256,_0xc3e9('0xc'));_0x5b7e71(_0x43393a[_0xc3e9('0x12')][_0xc3e9('0x11')]);}})[_0xc3e9('0x13')](function(_0x44e8f4){logger[_0xc3e9('0x10')](_0xc3e9('0xb'),_0xf3e256,_0x44e8f4);_0x185498(_0x44e8f4);});});}exports['CreateSquareMessage']=function(_0x3aac9f){var _0x461e04=this;return new Promise(function(_0x4ce6f8,_0x531d94){return db[_0xc3e9('0x14')][_0xc3e9('0x15')](_0x3aac9f[_0xc3e9('0x16')],{'raw':_0x3aac9f[_0xc3e9('0x17')]?_0x3aac9f['options'][_0xc3e9('0x18')]===undefined?!![]:![]:!![]})[_0xc3e9('0x9')](function(_0x37e187){logger[_0xc3e9('0xa')](_0xc3e9('0x19'),_0x3aac9f);logger[_0xc3e9('0xd')]('CreateSquareMessage',_0x3aac9f,JSON['stringify'](_0x37e187));_0x4ce6f8(_0x37e187);})[_0xc3e9('0x13')](function(_0x1820c5){logger[_0xc3e9('0x10')](_0xc3e9('0x19'),_0x1820c5[_0xc3e9('0x11')],_0x3aac9f);_0x531d94(_0x461e04[_0xc3e9('0x10')](0x1f4,_0x1820c5[_0xc3e9('0x11')]));});});};
\ No newline at end of file
index 9788296..001b179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x226a=['put','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','create'];(function(_0x1e7d56,_0x47a635){var _0xe6478=function(_0x147b4e){while(--_0x147b4e){_0x1e7d56['push'](_0x1e7d56['shift']());}};_0xe6478(++_0x47a635);}(_0x226a,0x1ab));var _0xa226=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x226a[_0x4bcfa6];return _0x1c0165;};'use strict';var multer=require(_0xa226('0x0'));var util=require(_0xa226('0x1'));var path=require(_0xa226('0x2'));var timeout=require(_0xa226('0x3'));var express=require(_0xa226('0x4'));var router=express[_0xa226('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa226('0x6'));var config=require('../../config/environment');var controller=require(_0xa226('0x7'));router[_0xa226('0x8')]('/',auth[_0xa226('0x9')](),controller[_0xa226('0xa')]);router[_0xa226('0x8')](_0xa226('0xb'),auth[_0xa226('0x9')](),controller[_0xa226('0xc')]);router[_0xa226('0x8')](_0xa226('0xd'),auth[_0xa226('0x9')](),timeout('15s'),controller['test']);router['post']('/',auth[_0xa226('0x9')](),controller[_0xa226('0xe')]);router[_0xa226('0xf')](_0xa226('0xb'),auth[_0xa226('0x9')](),controller['update']);router[_0xa226('0x10')](_0xa226('0xb'),auth[_0xa226('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6484=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','get','/:id','/:id/test','15s','post','put','update','destroy','exports','multer'];(function(_0x1765c4,_0x151565){var _0x56645f=function(_0x12dfbe){while(--_0x12dfbe){_0x1765c4['push'](_0x1765c4['shift']());}};_0x56645f(++_0x151565);}(_0x6484,0x11c));var _0x4648=function(_0x511c5b,_0x57eba5){_0x511c5b=_0x511c5b-0x0;var _0x34f244=_0x6484[_0x511c5b];return _0x34f244;};'use strict';var multer=require(_0x4648('0x0'));var util=require(_0x4648('0x1'));var path=require(_0x4648('0x2'));var timeout=require(_0x4648('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4648('0x4'));var auth=require(_0x4648('0x5'));var interaction=require(_0x4648('0x6'));var config=require(_0x4648('0x7'));var controller=require(_0x4648('0x8'));router['get']('/',auth[_0x4648('0x9')](),controller['index']);router[_0x4648('0xa')](_0x4648('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4648('0xa')](_0x4648('0xc'),auth['isAuthenticated'](),timeout(_0x4648('0xd')),controller['test']);router[_0x4648('0xe')]('/',auth[_0x4648('0x9')](),controller['create']);router[_0x4648('0xf')](_0x4648('0xb'),auth[_0x4648('0x9')](),controller[_0x4648('0x10')]);router['delete']('/:id',auth[_0x4648('0x9')](),controller[_0x4648('0x11')]);module[_0x4648('0x12')]=router;
\ No newline at end of file
index 84e7ed3..ea38f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33f3=['STRING','sequelize','exports'];(function(_0x4d247c,_0x3dff9e){var _0x42c60c=function(_0x399acd){while(--_0x399acd){_0x4d247c['push'](_0x4d247c['shift']());}};_0x42c60c(++_0x3dff9e);}(_0x33f3,0x7f));var _0x333f=function(_0x46a86a,_0x716219){_0x46a86a=_0x46a86a-0x0;var _0x4013bd=_0x33f3[_0x46a86a];return _0x4013bd;};'use strict';var Sequelize=require(_0x333f('0x0'));module[_0x333f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x333f('0x2')]}};
\ No newline at end of file
+var _0xdf19=['exports','STRING','sequelize'];(function(_0x2d3f33,_0x1b3c00){var _0x419bd8=function(_0x5d26e9){while(--_0x5d26e9){_0x2d3f33['push'](_0x2d3f33['shift']());}};_0x419bd8(++_0x1b3c00);}(_0xdf19,0x104));var _0x9df1=function(_0x1a8b58,_0x2c6665){_0x1a8b58=_0x1a8b58-0x0;var _0x3fa938=_0xdf19[_0x1a8b58];return _0x3fa938;};'use strict';var Sequelize=require(_0x9df1('0x0'));module[_0x9df1('0x1')]={'name':{'type':Sequelize[_0x9df1('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9df1('0x2')]}};
\ No newline at end of file
index f32c6d9..12f387c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b5=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','where','pick','filter','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs'];(function(_0x2c3a9e,_0x3498c7){var _0x79a4ec=function(_0x54be08){while(--_0x54be08){_0x2c3a9e['push'](_0x2c3a9e['shift']());}};_0x79a4ec(++_0x3498c7);}(_0x92b5,0x151));var _0x592b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x92b5[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x592b('0x0'));var rimraf=require(_0x592b('0x1'));var zipdir=require(_0x592b('0x2'));var jsonpatch=require(_0x592b('0x3'));var rp=require(_0x592b('0x4'));var moment=require('moment');var BPromise=require(_0x592b('0x5'));var Mustache=require('mustache');var util=require(_0x592b('0x6'));var path=require(_0x592b('0x7'));var sox=require(_0x592b('0x8'));var csv=require(_0x592b('0x9'));var ejs=require(_0x592b('0xa'));var fs=require('fs');var fs_extra=require(_0x592b('0xb'));var _=require(_0x592b('0xc'));var squel=require(_0x592b('0xd'));var crypto=require(_0x592b('0xe'));var jsforce=require(_0x592b('0xf'));var deskjs=require(_0x592b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x592b('0x11'));var Papa=require(_0x592b('0x12'));var Redis=require(_0x592b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x592b('0x14'));var as=require(_0x592b('0x15'));var hardwareService=require(_0x592b('0x16'));var logger=require(_0x592b('0x17'))('api');var utils=require(_0x592b('0x18'));var config=require(_0x592b('0x19'));var licenseUtil=require(_0x592b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcb892e,_0x53a6e4){_0x53a6e4=_0x53a6e4||0xcc;return function(_0x224878){if(_0x224878){return _0xcb892e['sendStatus'](_0x53a6e4);}return _0xcb892e[_0x592b('0x1b')](_0x53a6e4)[_0x592b('0x1c')]();};}function respondWithResult(_0x2504a2,_0x3e4fe8){_0x3e4fe8=_0x3e4fe8||0xc8;return function(_0x56604a){if(_0x56604a){return _0x2504a2['status'](_0x3e4fe8)['json'](_0x56604a);}};}function respondWithFilteredResult(_0x26cd8b,_0x468db9){return function(_0x2ba031){if(_0x2ba031){var _0x150b5b=typeof _0x468db9[_0x592b('0x1d')]===_0x592b('0x1e')&&typeof _0x468db9[_0x592b('0x1f')]===_0x592b('0x1e');var _0x592bf8=_0x2ba031[_0x592b('0x20')];var _0x242f3c=_0x150b5b?0x0:_0x468db9['offset'];var _0x260656=_0x150b5b?_0x2ba031[_0x592b('0x20')]:_0x468db9['offset']+_0x468db9[_0x592b('0x1f')];var _0x1bc5d2;if(_0x260656>=_0x592bf8){_0x260656=_0x592bf8;_0x1bc5d2=0xc8;}else{_0x1bc5d2=0xce;}_0x26cd8b[_0x592b('0x1b')](_0x1bc5d2);return _0x26cd8b[_0x592b('0x21')](_0x592b('0x22'),_0x242f3c+'-'+_0x260656+'/'+_0x592bf8)[_0x592b('0x23')](_0x2ba031);}return null;};}function patchUpdates(_0x1a4723){return function(_0x71ab76){try{jsonpatch[_0x592b('0x24')](_0x71ab76,_0x1a4723,!![]);}catch(_0x3f9823){return BPromise[_0x592b('0x25')](_0x3f9823);}return _0x71ab76['save']();};}function saveUpdates(_0x3e657f,_0x3c5072){return function(_0x5d7638){if(_0x5d7638){return _0x5d7638[_0x592b('0x26')](_0x3e657f)[_0x592b('0x27')](function(_0x436add){return _0x436add;});}return null;};}function removeEntity(_0x26ead0,_0x243be3){return function(_0x16fc19){if(_0x16fc19){return _0x16fc19[_0x592b('0x28')]()['then'](function(){var _0x320ea7=_0x16fc19[_0x592b('0x29')]({'plain':!![]});var _0x193de4='ODBC';return db[_0x592b('0x2a')][_0x592b('0x28')]({'where':{'type':_0x193de4,'resourceId':_0x320ea7['id']}})[_0x592b('0x27')](function(){return _0x16fc19;});})[_0x592b('0x27')](function(){_0x26ead0[_0x592b('0x1b')](0xcc)[_0x592b('0x1c')]();});}};}function handleEntityNotFound(_0x38d07c,_0x160b42){return function(_0x11d2cc){if(!_0x11d2cc){_0x38d07c[_0x592b('0x2b')](0x194);}return _0x11d2cc;};}function handleError(_0x3178d8,_0x20156f){_0x20156f=_0x20156f||0x1f4;return function(_0x3195aa){logger[_0x592b('0x2c')](_0x3195aa[_0x592b('0x2d')]);if(_0x3195aa[_0x592b('0x2e')]){delete _0x3195aa[_0x592b('0x2e')];}_0x3178d8[_0x592b('0x1b')](_0x20156f)[_0x592b('0x2f')](_0x3195aa);};}exports[_0x592b('0x30')]=function(_0x214696,_0x3be6e8){var _0x573c8f={},_0x483fa9={},_0x51be84={'count':0x0,'rows':[]};var _0x3bf58e=_[_0x592b('0x31')](db[_0x592b('0x32')][_0x592b('0x33')],function(_0x5ac9ca){return{'name':_0x5ac9ca[_0x592b('0x34')],'type':_0x5ac9ca[_0x592b('0x35')][_0x592b('0x36')]};});_0x483fa9[_0x592b('0x37')]=_[_0x592b('0x31')](_0x3bf58e,'name');_0x483fa9[_0x592b('0x38')]=_[_0x592b('0x39')](_0x214696[_0x592b('0x38')]);_0x483fa9[_0x592b('0x3a')]=_['intersection'](_0x483fa9['model'],_0x483fa9[_0x592b('0x38')]);_0x573c8f[_0x592b('0x3b')]=_[_0x592b('0x3c')](_0x483fa9[_0x592b('0x37')],qs[_0x592b('0x3d')](_0x214696['query'][_0x592b('0x3d')]));_0x573c8f[_0x592b('0x3b')]=_0x573c8f['attributes'][_0x592b('0x3e')]?_0x573c8f[_0x592b('0x3b')]:_0x483fa9[_0x592b('0x37')];if(!_0x214696[_0x592b('0x38')]['hasOwnProperty']('nolimit')){_0x573c8f['limit']=qs['limit'](_0x214696[_0x592b('0x38')][_0x592b('0x1f')]);_0x573c8f['offset']=qs[_0x592b('0x1d')](_0x214696[_0x592b('0x38')][_0x592b('0x1d')]);}_0x573c8f['order']=qs['sort'](_0x214696[_0x592b('0x38')]['sort']);_0x573c8f[_0x592b('0x3f')]=qs[_0x592b('0x3a')](_[_0x592b('0x40')](_0x214696[_0x592b('0x38')],_0x483fa9[_0x592b('0x3a')]),_0x3bf58e);if(_0x214696['query'][_0x592b('0x41')]){_0x573c8f[_0x592b('0x3f')]=_[_0x592b('0x42')](_0x573c8f[_0x592b('0x3f')],{'$or':_[_0x592b('0x31')](_0x3bf58e,function(_0x58cf53){if(_0x58cf53['type']!=='VIRTUAL'){var _0x181ba0={};_0x181ba0[_0x58cf53[_0x592b('0x2e')]]={'$like':'%'+_0x214696[_0x592b('0x38')][_0x592b('0x41')]+'%'};return _0x181ba0;}})});}_0x573c8f=_[_0x592b('0x42')]({},_0x573c8f,_0x214696[_0x592b('0x43')]);var _0x43bfc2={'where':_0x573c8f[_0x592b('0x3f')]};return db[_0x592b('0x32')][_0x592b('0x20')](_0x43bfc2)[_0x592b('0x27')](function(_0x3f1d45){_0x51be84[_0x592b('0x20')]=_0x3f1d45;if(_0x214696[_0x592b('0x38')]['includeAll']){_0x573c8f['include']=[{'all':!![]}];}return db[_0x592b('0x32')][_0x592b('0x44')](_0x573c8f);})[_0x592b('0x27')](function(_0x51d25c){_0x51be84[_0x592b('0x45')]=_0x51d25c;return _0x51be84;})['then'](respondWithFilteredResult(_0x3be6e8,_0x573c8f))['catch'](handleError(_0x3be6e8,null));};exports[_0x592b('0x46')]=function(_0x3b16f4,_0x2286e7){var _0x11c522={'raw':!![],'where':{'id':_0x3b16f4[_0x592b('0x47')]['id']}},_0x193620={};_0x193620[_0x592b('0x37')]=_[_0x592b('0x39')](db[_0x592b('0x32')][_0x592b('0x33')]);_0x193620[_0x592b('0x38')]=_[_0x592b('0x39')](_0x3b16f4['query']);_0x193620[_0x592b('0x3a')]=_[_0x592b('0x3c')](_0x193620['model'],_0x193620[_0x592b('0x38')]);_0x11c522[_0x592b('0x3b')]=_['intersection'](_0x193620[_0x592b('0x37')],qs[_0x592b('0x3d')](_0x3b16f4[_0x592b('0x38')]['fields']));_0x11c522[_0x592b('0x3b')]=_0x11c522[_0x592b('0x3b')][_0x592b('0x3e')]?_0x11c522[_0x592b('0x3b')]:_0x193620[_0x592b('0x37')];if(_0x3b16f4[_0x592b('0x38')][_0x592b('0x48')]){_0x11c522[_0x592b('0x49')]=[{'all':!![]}];}_0x11c522=_[_0x592b('0x42')]({},_0x11c522,_0x3b16f4[_0x592b('0x43')]);return db[_0x592b('0x32')][_0x592b('0x4a')](_0x11c522)[_0x592b('0x27')](handleEntityNotFound(_0x2286e7,null))[_0x592b('0x27')](respondWithResult(_0x2286e7,null))[_0x592b('0x4b')](handleError(_0x2286e7,null));};exports[_0x592b('0x4c')]=function(_0x3df839,_0x37d7d5){return db[_0x592b('0x32')][_0x592b('0x4c')](_0x3df839['body'],{})[_0x592b('0x27')](function(_0x1d5cc1){var _0x4a8e7c=_0x3df839[_0x592b('0x4d')][_0x592b('0x29')]({'plain':!![]});if(!_0x4a8e7c)throw new Error(_0x592b('0x4e'));if(_0x4a8e7c['role']===_0x592b('0x4d')){var _0x54bd61=_0x1d5cc1[_0x592b('0x29')]({'plain':!![]});var _0x4f49df=_0x592b('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x4f49df,'userProfileId':_0x4a8e7c[_0x592b('0x50')]},'raw':!![]})[_0x592b('0x27')](function(_0x297b94){if(_0x297b94&&_0x297b94['autoAssociation']===0x0){return db[_0x592b('0x2a')]['create']({'name':_0x54bd61[_0x592b('0x2e')],'resourceId':_0x54bd61['id'],'type':_0x297b94['name'],'sectionId':_0x297b94['id']},{})[_0x592b('0x27')](function(){return _0x1d5cc1;});}else{return _0x1d5cc1;}})['catch'](function(_0x306101){logger[_0x592b('0x2c')](_0x592b('0x51'),_0x306101);throw _0x306101;});}return _0x1d5cc1;})[_0x592b('0x27')](respondWithResult(_0x37d7d5,0xc9))['catch'](handleError(_0x37d7d5,null));};exports[_0x592b('0x26')]=function(_0x2af444,_0x4cc673){if(_0x2af444[_0x592b('0x52')]['id']){delete _0x2af444[_0x592b('0x52')]['id'];}return db[_0x592b('0x32')]['find']({'where':{'id':_0x2af444['params']['id']}})['then'](handleEntityNotFound(_0x4cc673,null))[_0x592b('0x27')](saveUpdates(_0x2af444[_0x592b('0x52')],null))[_0x592b('0x27')](respondWithResult(_0x4cc673,null))[_0x592b('0x4b')](handleError(_0x4cc673,null));};exports['destroy']=function(_0x1f8407,_0x5eff86){return db['SquareOdbc'][_0x592b('0x4a')]({'where':{'id':_0x1f8407[_0x592b('0x47')]['id']}})[_0x592b('0x27')](handleEntityNotFound(_0x5eff86,null))[_0x592b('0x27')](removeEntity(_0x5eff86,null))['catch'](handleError(_0x5eff86,null));};exports[_0x592b('0x53')]=function(_0x1f9e25,_0x5cf56b,_0x2772b0){var _0xb48db8;return db[_0x592b('0x32')][_0x592b('0x4a')]({'where':{'id':_0x1f9e25[_0x592b('0x47')]['id']},'attributes':['id',_0x592b('0x54')]})['then'](handleEntityNotFound(_0x5cf56b,null))[_0x592b('0x27')](function(_0x1ed2f0){if(_0x1ed2f0){var _0x34d9d4=require(_0x592b('0x55'))();_0x34d9d4['openSync'](_0x1ed2f0[_0x592b('0x54')]);_0x34d9d4[_0x592b('0x56')]();return _0x1ed2f0;}})[_0x592b('0x27')](respondWithResult(_0x5cf56b,null))[_0x592b('0x4b')](handleError(_0x5cf56b,null));};
\ No newline at end of file
+var _0x69dc=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','limit','undefined','offset','status','set','Content-Range','json','apply','reject','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','index','map','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareOdbc','count','include','catch','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra'];(function(_0x185063,_0x3f0bb7){var _0x16d9d3=function(_0x1b3fe3){while(--_0x1b3fe3){_0x185063['push'](_0x185063['shift']());}};_0x16d9d3(++_0x3f0bb7);}(_0x69dc,0xa1));var _0xc69d=function(_0x425a66,_0x541264){_0x425a66=_0x425a66-0x0;var _0x4cf80c=_0x69dc[_0x425a66];return _0x4cf80c;};'use strict';var emlformat=require(_0xc69d('0x0'));var rimraf=require(_0xc69d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc69d('0x2'));var rp=require(_0xc69d('0x3'));var moment=require(_0xc69d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc69d('0x5'));var csv=require(_0xc69d('0x6'));var ejs=require(_0xc69d('0x7'));var fs=require('fs');var fs_extra=require(_0xc69d('0x8'));var _=require(_0xc69d('0x9'));var squel=require(_0xc69d('0xa'));var crypto=require(_0xc69d('0xb'));var jsforce=require(_0xc69d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc69d('0x6'));var querystring=require(_0xc69d('0xd'));var Papa=require(_0xc69d('0xe'));var Redis=require(_0xc69d('0xf'));var authService=require(_0xc69d('0x10'));var qs=require(_0xc69d('0x11'));var as=require(_0xc69d('0x12'));var hardwareService=require(_0xc69d('0x13'));var logger=require(_0xc69d('0x14'))('api');var utils=require(_0xc69d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc69d('0x16'));var db=require(_0xc69d('0x17'))['db'];function respondWithStatusCode(_0xcbd10e,_0x5fd71e){_0x5fd71e=_0x5fd71e||0xcc;return function(_0xdb96a3){if(_0xdb96a3){return _0xcbd10e['sendStatus'](_0x5fd71e);}return _0xcbd10e['status'](_0x5fd71e)[_0xc69d('0x18')]();};}function respondWithResult(_0x2d5f99,_0x5173fc){_0x5173fc=_0x5173fc||0xc8;return function(_0x54a610){if(_0x54a610){return _0x2d5f99['status'](_0x5173fc)['json'](_0x54a610);}};}function respondWithFilteredResult(_0xe0a58b,_0x5d8955){return function(_0x2efac4){if(_0x2efac4){var _0x933c7c=typeof _0x5d8955['offset']==='undefined'&&typeof _0x5d8955[_0xc69d('0x19')]===_0xc69d('0x1a');var _0x56732f=_0x2efac4['count'];var _0x9a8847=_0x933c7c?0x0:_0x5d8955[_0xc69d('0x1b')];var _0x39733b=_0x933c7c?_0x2efac4['count']:_0x5d8955[_0xc69d('0x1b')]+_0x5d8955[_0xc69d('0x19')];var _0x5c8355;if(_0x39733b>=_0x56732f){_0x39733b=_0x56732f;_0x5c8355=0xc8;}else{_0x5c8355=0xce;}_0xe0a58b[_0xc69d('0x1c')](_0x5c8355);return _0xe0a58b[_0xc69d('0x1d')](_0xc69d('0x1e'),_0x9a8847+'-'+_0x39733b+'/'+_0x56732f)[_0xc69d('0x1f')](_0x2efac4);}return null;};}function patchUpdates(_0xcc630c){return function(_0x4db545){try{jsonpatch[_0xc69d('0x20')](_0x4db545,_0xcc630c,!![]);}catch(_0x43693f){return BPromise[_0xc69d('0x21')](_0x43693f);}return _0x4db545['save']();};}function saveUpdates(_0x243f9d,_0x396823){return function(_0x3553e1){if(_0x3553e1){return _0x3553e1['update'](_0x243f9d)[_0xc69d('0x22')](function(_0x3cea98){return _0x3cea98;});}return null;};}function removeEntity(_0x2061f6,_0x57092f){return function(_0x17eb33){if(_0x17eb33){return _0x17eb33[_0xc69d('0x23')]()[_0xc69d('0x22')](function(){var _0xb8d804=_0x17eb33[_0xc69d('0x24')]({'plain':!![]});var _0x27ee4a=_0xc69d('0x25');return db[_0xc69d('0x26')][_0xc69d('0x23')]({'where':{'type':_0x27ee4a,'resourceId':_0xb8d804['id']}})[_0xc69d('0x22')](function(){return _0x17eb33;});})[_0xc69d('0x22')](function(){_0x2061f6[_0xc69d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x821ed1,_0x45c1b4){return function(_0xba2e85){if(!_0xba2e85){_0x821ed1[_0xc69d('0x27')](0x194);}return _0xba2e85;};}function handleError(_0x456ea1,_0x3e5e63){_0x3e5e63=_0x3e5e63||0x1f4;return function(_0x16ad83){logger[_0xc69d('0x28')](_0x16ad83[_0xc69d('0x29')]);if(_0x16ad83[_0xc69d('0x2a')]){delete _0x16ad83[_0xc69d('0x2a')];}_0x456ea1['status'](_0x3e5e63)['send'](_0x16ad83);};}exports[_0xc69d('0x2b')]=function(_0x2c8fa3,_0x484270){var _0x2728a0={},_0x18e7ff={},_0x3eb5be={'count':0x0,'rows':[]};var _0x16be4f=_[_0xc69d('0x2c')](db['SquareOdbc']['rawAttributes'],function(_0x323c12){return{'name':_0x323c12['fieldName'],'type':_0x323c12[_0xc69d('0x2d')][_0xc69d('0x2e')]};});_0x18e7ff[_0xc69d('0x2f')]=_['map'](_0x16be4f,_0xc69d('0x2a'));_0x18e7ff[_0xc69d('0x30')]=_[_0xc69d('0x31')](_0x2c8fa3[_0xc69d('0x30')]);_0x18e7ff['filters']=_['intersection'](_0x18e7ff['model'],_0x18e7ff[_0xc69d('0x30')]);_0x2728a0['attributes']=_[_0xc69d('0x32')](_0x18e7ff[_0xc69d('0x2f')],qs[_0xc69d('0x33')](_0x2c8fa3[_0xc69d('0x30')]['fields']));_0x2728a0[_0xc69d('0x34')]=_0x2728a0[_0xc69d('0x34')]['length']?_0x2728a0['attributes']:_0x18e7ff['model'];if(!_0x2c8fa3['query'][_0xc69d('0x35')](_0xc69d('0x36'))){_0x2728a0[_0xc69d('0x19')]=qs['limit'](_0x2c8fa3[_0xc69d('0x30')]['limit']);_0x2728a0['offset']=qs['offset'](_0x2c8fa3['query'][_0xc69d('0x1b')]);}_0x2728a0['order']=qs[_0xc69d('0x37')](_0x2c8fa3['query']['sort']);_0x2728a0[_0xc69d('0x38')]=qs[_0xc69d('0x39')](_[_0xc69d('0x3a')](_0x2c8fa3[_0xc69d('0x30')],_0x18e7ff[_0xc69d('0x39')]),_0x16be4f);if(_0x2c8fa3['query'][_0xc69d('0x3b')]){_0x2728a0[_0xc69d('0x38')]=_[_0xc69d('0x3c')](_0x2728a0[_0xc69d('0x38')],{'$or':_[_0xc69d('0x2c')](_0x16be4f,function(_0x35b7ce){if(_0x35b7ce[_0xc69d('0x2d')]!==_0xc69d('0x3d')){var _0x3a57dd={};_0x3a57dd[_0x35b7ce[_0xc69d('0x2a')]]={'$like':'%'+_0x2c8fa3['query'][_0xc69d('0x3b')]+'%'};return _0x3a57dd;}})});}_0x2728a0=_['merge']({},_0x2728a0,_0x2c8fa3[_0xc69d('0x3e')]);var _0x4ff2c1={'where':_0x2728a0[_0xc69d('0x38')]};return db[_0xc69d('0x3f')][_0xc69d('0x40')](_0x4ff2c1)['then'](function(_0x4ff307){_0x3eb5be[_0xc69d('0x40')]=_0x4ff307;if(_0x2c8fa3['query']['includeAll']){_0x2728a0[_0xc69d('0x41')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x2728a0);})['then'](function(_0x5c0f1f){_0x3eb5be['rows']=_0x5c0f1f;return _0x3eb5be;})['then'](respondWithFilteredResult(_0x484270,_0x2728a0))[_0xc69d('0x42')](handleError(_0x484270,null));};exports['show']=function(_0x28f36c,_0x31ad3a){var _0x229652={'raw':!![],'where':{'id':_0x28f36c[_0xc69d('0x43')]['id']}},_0x2f0db2={};_0x2f0db2[_0xc69d('0x2f')]=_['keys'](db['SquareOdbc'][_0xc69d('0x44')]);_0x2f0db2[_0xc69d('0x30')]=_[_0xc69d('0x31')](_0x28f36c[_0xc69d('0x30')]);_0x2f0db2[_0xc69d('0x39')]=_[_0xc69d('0x32')](_0x2f0db2[_0xc69d('0x2f')],_0x2f0db2['query']);_0x229652[_0xc69d('0x34')]=_[_0xc69d('0x32')](_0x2f0db2[_0xc69d('0x2f')],qs[_0xc69d('0x33')](_0x28f36c[_0xc69d('0x30')][_0xc69d('0x33')]));_0x229652[_0xc69d('0x34')]=_0x229652[_0xc69d('0x34')][_0xc69d('0x45')]?_0x229652[_0xc69d('0x34')]:_0x2f0db2['model'];if(_0x28f36c[_0xc69d('0x30')]['includeAll']){_0x229652[_0xc69d('0x41')]=[{'all':!![]}];}_0x229652=_[_0xc69d('0x3c')]({},_0x229652,_0x28f36c[_0xc69d('0x3e')]);return db['SquareOdbc']['find'](_0x229652)[_0xc69d('0x22')](handleEntityNotFound(_0x31ad3a,null))['then'](respondWithResult(_0x31ad3a,null))['catch'](handleError(_0x31ad3a,null));};exports[_0xc69d('0x46')]=function(_0x5bea69,_0x4926a1){return db[_0xc69d('0x3f')][_0xc69d('0x46')](_0x5bea69[_0xc69d('0x47')],{})[_0xc69d('0x22')](function(_0x3f0453){var _0x418f0d=_0x5bea69[_0xc69d('0x48')][_0xc69d('0x24')]({'plain':!![]});if(!_0x418f0d)throw new Error(_0xc69d('0x49'));if(_0x418f0d[_0xc69d('0x4a')]===_0xc69d('0x48')){var _0x86d46d=_0x3f0453['get']({'plain':!![]});var _0x35305f=_0xc69d('0x25');return db[_0xc69d('0x4b')][_0xc69d('0x4c')]({'where':{'name':_0x35305f,'userProfileId':_0x418f0d[_0xc69d('0x4d')]},'raw':!![]})['then'](function(_0x50b9c4){if(_0x50b9c4&&_0x50b9c4[_0xc69d('0x4e')]===0x0){return db[_0xc69d('0x26')][_0xc69d('0x46')]({'name':_0x86d46d[_0xc69d('0x2a')],'resourceId':_0x86d46d['id'],'type':_0x50b9c4[_0xc69d('0x2a')],'sectionId':_0x50b9c4['id']},{})[_0xc69d('0x22')](function(){return _0x3f0453;});}else{return _0x3f0453;}})['catch'](function(_0x465685){logger[_0xc69d('0x28')](_0xc69d('0x4f'),_0x465685);throw _0x465685;});}return _0x3f0453;})[_0xc69d('0x22')](respondWithResult(_0x4926a1,0xc9))[_0xc69d('0x42')](handleError(_0x4926a1,null));};exports[_0xc69d('0x50')]=function(_0x373c75,_0x40687a){if(_0x373c75[_0xc69d('0x47')]['id']){delete _0x373c75[_0xc69d('0x47')]['id'];}return db[_0xc69d('0x3f')][_0xc69d('0x4c')]({'where':{'id':_0x373c75[_0xc69d('0x43')]['id']}})[_0xc69d('0x22')](handleEntityNotFound(_0x40687a,null))[_0xc69d('0x22')](saveUpdates(_0x373c75[_0xc69d('0x47')],null))[_0xc69d('0x22')](respondWithResult(_0x40687a,null))['catch'](handleError(_0x40687a,null));};exports[_0xc69d('0x23')]=function(_0x5aa00a,_0x4ba42c){return db['SquareOdbc'][_0xc69d('0x4c')]({'where':{'id':_0x5aa00a[_0xc69d('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ba42c,null))['then'](removeEntity(_0x4ba42c,null))['catch'](handleError(_0x4ba42c,null));};exports[_0xc69d('0x51')]=function(_0x5530ca,_0x22a2e8,_0x7c3326){var _0x49ca1a;return db[_0xc69d('0x3f')]['find']({'where':{'id':_0x5530ca[_0xc69d('0x43')]['id']},'attributes':['id',_0xc69d('0x52')]})[_0xc69d('0x22')](handleEntityNotFound(_0x22a2e8,null))['then'](function(_0x206d59){if(_0x206d59){var _0x2cdb19=require(_0xc69d('0x53'))();_0x2cdb19['openSync'](_0x206d59[_0xc69d('0x52')]);_0x2cdb19[_0xc69d('0x54')]();return _0x206d59;}})[_0xc69d('0x22')](respondWithResult(_0x22a2e8,null))[_0xc69d('0x42')](handleError(_0x22a2e8,null));};
\ No newline at end of file
index 30fae3e..128c026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b9=['../../config/logger','api','moment','request-promise','path','rimraf','exports','lodash'];(function(_0x1edf2a,_0x55c423){var _0x5698f0=function(_0x237e51){while(--_0x237e51){_0x1edf2a['push'](_0x1edf2a['shift']());}};_0x5698f0(++_0x55c423);}(_0x01b9,0x1ef));var _0x901b=function(_0x1767f9,_0x207317){_0x1767f9=_0x1767f9-0x0;var _0x468590=_0x01b9[_0x1767f9];return _0x468590;};'use strict';var _=require(_0x901b('0x0'));var util=require('util');var logger=require(_0x901b('0x1'))(_0x901b('0x2'));var moment=require(_0x901b('0x3'));var BPromise=require('bluebird');var rp=require(_0x901b('0x4'));var fs=require('fs');var path=require(_0x901b('0x5'));var rimraf=require(_0x901b('0x6'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x901b('0x7')]=function(_0x12613c,_0x297a5b){return _0x12613c['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd6b=['bluebird','path','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','util','api','moment'];(function(_0x57313e,_0x132272){var _0x37a711=function(_0xf715ac){while(--_0xf715ac){_0x57313e['push'](_0x57313e['shift']());}};_0x37a711(++_0x132272);}(_0xbd6b,0x17c));var _0xbbd6=function(_0x53b1d6,_0x2db662){_0x53b1d6=_0x53b1d6-0x0;var _0xadca3=_0xbd6b[_0x53b1d6];return _0xadca3;};'use strict';var _=require(_0xbbd6('0x0'));var util=require(_0xbbd6('0x1'));var logger=require('../../config/logger')(_0xbbd6('0x2'));var moment=require(_0xbbd6('0x3'));var BPromise=require(_0xbbd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbd6('0x5'));var rimraf=require(_0xbbd6('0x6'));var config=require(_0xbbd6('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xbbd6('0x8')]=function(_0x3cc5ad,_0x36a963){return _0x3cc5ad[_0xbbd6('0x9')](_0xbbd6('0xa'),attributes,{'tableName':_0xbbd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f3e82a..f5a7a99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc31a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util'];(function(_0x7b5e1,_0x2fad4a){var _0x13f5e4=function(_0x2de5d4){while(--_0x2de5d4){_0x7b5e1['push'](_0x7b5e1['shift']());}};_0x13f5e4(++_0x2fad4a);}(_0xc31a,0xc4));var _0xac31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc31a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xac31('0x0'));var util=require(_0xac31('0x1'));var moment=require(_0xac31('0x2'));var BPromise=require(_0xac31('0x3'));var rs=require(_0xac31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac31('0x5'))['db'];var utils=require(_0xac31('0x6'));var logger=require(_0xac31('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xac31('0x8'));var client=jayson['client'][_0xac31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23b31c,_0x5a4558,_0xdf674a){return new BPromise(function(_0x21d3c4,_0x14697d){return client[_0xac31('0xa')](_0x23b31c,_0xdf674a)[_0xac31('0xb')](function(_0x161168){logger[_0xac31('0xc')](_0xac31('0xd'),_0x5a4558,_0xac31('0xe'));logger[_0xac31('0xf')](_0xac31('0x10'),_0x5a4558,'request\x20sent',JSON[_0xac31('0x11')](_0x161168));if(_0x161168['error']){if(_0x161168[_0xac31('0x12')][_0xac31('0x13')]===0x1f4){logger[_0xac31('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5a4558,_0x161168[_0xac31('0x12')][_0xac31('0x14')]);return _0x14697d(_0x161168[_0xac31('0x12')]['message']);}logger[_0xac31('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5a4558,_0x161168[_0xac31('0x12')]['message']);return _0x21d3c4(_0x161168[_0xac31('0x12')]['message']);}else{logger[_0xac31('0xc')](_0xac31('0xd'),_0x5a4558,_0xac31('0xe'));_0x21d3c4(_0x161168[_0xac31('0x15')][_0xac31('0x14')]);}})[_0xac31('0x16')](function(_0x3b2c02){logger[_0xac31('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5a4558,_0x3b2c02);_0x14697d(_0x3b2c02);});});}exports[_0xac31('0x17')]=function(_0xe2bf77){var _0xaa0c40=this;return new Promise(function(_0x5cbba6,_0x8f2a9b){return db[_0xac31('0x18')][_0xac31('0x19')]({'raw':_0xe2bf77[_0xac31('0x1a')]?_0xe2bf77[_0xac31('0x1a')][_0xac31('0x1b')]===undefined?!![]:![]:!![],'where':_0xe2bf77[_0xac31('0x1a')]?_0xe2bf77[_0xac31('0x1a')][_0xac31('0x1c')]||null:null,'attributes':_0xe2bf77['options']?_0xe2bf77[_0xac31('0x1a')][_0xac31('0x1d')]||null:null,'include':_0xe2bf77[_0xac31('0x1a')]?_0xe2bf77['options'][_0xac31('0x1e')]?_[_0xac31('0x1f')](_0xe2bf77[_0xac31('0x1a')][_0xac31('0x1e')],function(_0x3bdabf){return{'model':db[_0x3bdabf[_0xac31('0x20')]],'as':_0x3bdabf['as'],'attributes':_0x3bdabf[_0xac31('0x1d')],'include':_0x3bdabf[_0xac31('0x1e')]?_['map'](_0x3bdabf[_0xac31('0x1e')],function(_0x3b962a){return{'model':db[_0x3b962a['model']],'as':_0x3b962a['as'],'attributes':_0x3b962a['attributes'],'include':_0x3b962a[_0xac31('0x1e')]?_['map'](_0x3b962a[_0xac31('0x1e')],function(_0x132d5b){return{'model':db[_0x132d5b[_0xac31('0x20')]],'as':_0x132d5b['as'],'attributes':_0x132d5b[_0xac31('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x218733){logger[_0xac31('0xc')](_0xac31('0x17'),_0xe2bf77);logger[_0xac31('0xf')](_0xac31('0x17'),_0xe2bf77,JSON[_0xac31('0x11')](_0x218733));_0x5cbba6(_0x218733);})['catch'](function(_0x4af4fd){logger[_0xac31('0x12')](_0xac31('0x17'),_0x4af4fd[_0xac31('0x14')],_0xe2bf77);_0x8f2a9b(_0xaa0c40[_0xac31('0x12')](0x1f4,_0x4af4fd[_0xac31('0x14')]));});});};
\ No newline at end of file
+var _0x7ecf=['http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x12cfa8,_0x2deabd){var _0x58390c=function(_0x24d971){while(--_0x24d971){_0x12cfa8['push'](_0x12cfa8['shift']());}};_0x58390c(++_0x2deabd);}(_0x7ecf,0x118));var _0xf7ec=function(_0x3708ea,_0x24382a){_0x3708ea=_0x3708ea-0x0;var _0x118886=_0x7ecf[_0x3708ea];return _0x118886;};'use strict';var _=require(_0xf7ec('0x0'));var util=require(_0xf7ec('0x1'));var moment=require('moment');var BPromise=require(_0xf7ec('0x2'));var rs=require(_0xf7ec('0x3'));var fs=require('fs');var Redis=require(_0xf7ec('0x4'));var db=require(_0xf7ec('0x5'))['db'];var utils=require(_0xf7ec('0x6'));var logger=require(_0xf7ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf7ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fe220,_0x538274,_0x518b0f){return new BPromise(function(_0xd8f7d8,_0x37c679){return client[_0xf7ec('0x9')](_0x4fe220,_0x518b0f)[_0xf7ec('0xa')](function(_0x5e1908){logger[_0xf7ec('0xb')](_0xf7ec('0xc'),_0x538274,_0xf7ec('0xd'));logger[_0xf7ec('0xe')](_0xf7ec('0xf'),_0x538274,_0xf7ec('0xd'),JSON[_0xf7ec('0x10')](_0x5e1908));if(_0x5e1908['error']){if(_0x5e1908['error'][_0xf7ec('0x11')]===0x1f4){logger['error'](_0xf7ec('0xc'),_0x538274,_0x5e1908[_0xf7ec('0x12')][_0xf7ec('0x13')]);return _0x37c679(_0x5e1908[_0xf7ec('0x12')]['message']);}logger[_0xf7ec('0x12')](_0xf7ec('0xc'),_0x538274,_0x5e1908['error'][_0xf7ec('0x13')]);return _0xd8f7d8(_0x5e1908[_0xf7ec('0x12')][_0xf7ec('0x13')]);}else{logger[_0xf7ec('0xb')](_0xf7ec('0xc'),_0x538274,_0xf7ec('0xd'));_0xd8f7d8(_0x5e1908[_0xf7ec('0x14')][_0xf7ec('0x13')]);}})[_0xf7ec('0x15')](function(_0x1f02a7){logger['error'](_0xf7ec('0xc'),_0x538274,_0x1f02a7);_0x37c679(_0x1f02a7);});});}exports[_0xf7ec('0x16')]=function(_0x4e5f50){var _0x143677=this;return new Promise(function(_0x4c2578,_0x3b516e){return db[_0xf7ec('0x17')][_0xf7ec('0x18')]({'raw':_0x4e5f50[_0xf7ec('0x19')]?_0x4e5f50[_0xf7ec('0x19')][_0xf7ec('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e5f50['options']?_0x4e5f50[_0xf7ec('0x19')][_0xf7ec('0x1b')]||null:null,'attributes':_0x4e5f50[_0xf7ec('0x19')]?_0x4e5f50[_0xf7ec('0x19')][_0xf7ec('0x1c')]||null:null,'include':_0x4e5f50[_0xf7ec('0x19')]?_0x4e5f50[_0xf7ec('0x19')][_0xf7ec('0x1d')]?_[_0xf7ec('0x1e')](_0x4e5f50[_0xf7ec('0x19')][_0xf7ec('0x1d')],function(_0x393d2c){return{'model':db[_0x393d2c[_0xf7ec('0x1f')]],'as':_0x393d2c['as'],'attributes':_0x393d2c['attributes'],'include':_0x393d2c['include']?_[_0xf7ec('0x1e')](_0x393d2c[_0xf7ec('0x1d')],function(_0x138889){return{'model':db[_0x138889[_0xf7ec('0x1f')]],'as':_0x138889['as'],'attributes':_0x138889[_0xf7ec('0x1c')],'include':_0x138889[_0xf7ec('0x1d')]?_[_0xf7ec('0x1e')](_0x138889[_0xf7ec('0x1d')],function(_0x411b29){return{'model':db[_0x411b29[_0xf7ec('0x1f')]],'as':_0x411b29['as'],'attributes':_0x411b29[_0xf7ec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf7ec('0xa')](function(_0x19eacc){logger[_0xf7ec('0xb')]('ShowSquareOdbc',_0x4e5f50);logger[_0xf7ec('0xe')](_0xf7ec('0x16'),_0x4e5f50,JSON[_0xf7ec('0x10')](_0x19eacc));_0x4c2578(_0x19eacc);})[_0xf7ec('0x15')](function(_0x2bf870){logger['error'](_0xf7ec('0x16'),_0x2bf870[_0xf7ec('0x13')],_0x4e5f50);_0x3b516e(_0x143677[_0xf7ec('0x12')](0x1f4,_0x2bf870[_0xf7ec('0x13')]));});});};
\ No newline at end of file
index 22b5163..17a1748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc853=['isAuthenticated','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x514244,_0x589887){var _0x1d3083=function(_0x5ec931){while(--_0x5ec931){_0x514244['push'](_0x514244['shift']());}};_0x1d3083(++_0x589887);}(_0xc853,0x10e));var _0x3c85=function(_0xd7a5ac,_0x29d5cd){_0xd7a5ac=_0xd7a5ac-0x0;var _0x39123c=_0xc853[_0xd7a5ac];return _0x39123c;};'use strict';var multer=require(_0x3c85('0x0'));var util=require(_0x3c85('0x1'));var path=require(_0x3c85('0x2'));var timeout=require(_0x3c85('0x3'));var express=require(_0x3c85('0x4'));var router=express[_0x3c85('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3c85('0x6'));var interaction=require(_0x3c85('0x7'));var config=require(_0x3c85('0x8'));var controller=require(_0x3c85('0x9'));router['get']('/',auth[_0x3c85('0xa')](),controller['index']);router[_0x3c85('0xb')](_0x3c85('0xc'),auth[_0x3c85('0xa')](),controller[_0x3c85('0xd')]);router[_0x3c85('0xe')]('/',auth[_0x3c85('0xa')](),controller[_0x3c85('0xf')]);router[_0x3c85('0x10')](_0x3c85('0xc'),auth['isAuthenticated'](),controller[_0x3c85('0x11')]);router['delete'](_0x3c85('0xc'),auth['isAuthenticated'](),controller[_0x3c85('0x12')]);module[_0x3c85('0x13')]=router;
\ No newline at end of file
+var _0x73ff=['../../config/environment','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x481c54,_0xea4493){var _0xb989f6=function(_0x477fe3){while(--_0x477fe3){_0x481c54['push'](_0x481c54['shift']());}};_0xb989f6(++_0xea4493);}(_0x73ff,0x9b));var _0xf73f=function(_0x5b34d2,_0x6b29cf){_0x5b34d2=_0x5b34d2-0x0;var _0x2a04bb=_0x73ff[_0x5b34d2];return _0x2a04bb;};'use strict';var multer=require(_0xf73f('0x0'));var util=require('util');var path=require(_0xf73f('0x1'));var timeout=require(_0xf73f('0x2'));var express=require(_0xf73f('0x3'));var router=express['Router']();var fs_extra=require(_0xf73f('0x4'));var auth=require(_0xf73f('0x5'));var interaction=require(_0xf73f('0x6'));var config=require(_0xf73f('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth[_0xf73f('0x8')](),controller[_0xf73f('0x9')]);router['get'](_0xf73f('0xa'),auth[_0xf73f('0x8')](),controller[_0xf73f('0xb')]);router[_0xf73f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf73f('0xd')](_0xf73f('0xa'),auth[_0xf73f('0x8')](),controller[_0xf73f('0xe')]);router[_0xf73f('0xf')](_0xf73f('0xa'),auth['isAuthenticated'](),controller[_0xf73f('0x10')]);module[_0xf73f('0x11')]=router;
\ No newline at end of file
index bc11a68..e57ce42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36c3=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long'];(function(_0x493150,_0x107958){var _0x3fe8da=function(_0xce7a75){while(--_0xce7a75){_0x493150['push'](_0x493150['shift']());}};_0x3fe8da(++_0x107958);}(_0x36c3,0x1a6));var _0x336c=function(_0x5ecbe8,_0x42522f){_0x5ecbe8=_0x5ecbe8-0x0;var _0x1c6e21=_0x36c3[_0x5ecbe8];return _0x1c6e21;};'use strict';var Sequelize=require(_0x336c('0x0'));module[_0x336c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x336c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x336c('0x3')]},'notes':{'type':Sequelize[_0x336c('0x4')]},'preproduction':{'type':Sequelize[_0x336c('0x5')](_0x336c('0x6')),'get':function(){if(this[_0x336c('0x7')](_0x336c('0x8'))){return this['getDataValue'](_0x336c('0x8'))[_0x336c('0x9')](_0x336c('0xa'));}}},'production':{'type':Sequelize[_0x336c('0x5')](_0x336c('0x6')),'get':function(){if(this['getDataValue'](_0x336c('0xb'))){return this[_0x336c('0x7')](_0x336c('0xb'))[_0x336c('0x9')](_0x336c('0xa'));}}},'savedAt':{'type':Sequelize[_0x336c('0xc')]},'publishedAt':{'type':Sequelize[_0x336c('0xc')]}};
\ No newline at end of file
+var _0x7aa6=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','STRING','BLOB','long'];(function(_0x2aba17,_0x128a30){var _0x5a9599=function(_0x1bc43c){while(--_0x1bc43c){_0x2aba17['push'](_0x2aba17['shift']());}};_0x5a9599(++_0x128a30);}(_0x7aa6,0x74));var _0x67aa=function(_0x325c99,_0x431d99){_0x325c99=_0x325c99-0x0;var _0x912230=_0x7aa6[_0x325c99];return _0x912230;};'use strict';var Sequelize=require(_0x67aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x67aa('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x67aa('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x67aa('0x2')](_0x67aa('0x3')),'get':function(){if(this[_0x67aa('0x4')](_0x67aa('0x5'))){return this['getDataValue'](_0x67aa('0x5'))[_0x67aa('0x6')](_0x67aa('0x7'));}}},'production':{'type':Sequelize[_0x67aa('0x2')](_0x67aa('0x3')),'get':function(){if(this[_0x67aa('0x4')](_0x67aa('0x8'))){return this[_0x67aa('0x4')](_0x67aa('0x8'))['toString'](_0x67aa('0x7'));}}},'savedAt':{'type':Sequelize[_0x67aa('0x9')]},'publishedAt':{'type':Sequelize[_0x67aa('0x9')]}};
\ No newline at end of file
index 9d89fc0..e1c67d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa8=['pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','SquareProjects','UserProfileResource','publish','stringify','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x1fa8,0x17c));var _0x81fa=function(_0x1a50cc,_0xbbab5b){_0x1a50cc=_0x1a50cc-0x0;var _0x243407=_0x1fa8[_0x1a50cc];return _0x243407;};'use strict';var _=require(_0x81fa('0x0'));var Redis=require(_0x81fa('0x1'));var qs=require(_0x81fa('0x2'));var logger=require('../../config/logger')(_0x81fa('0x3'));var config=require(_0x81fa('0x4'));var db=require(_0x81fa('0x5'))['db'];config['redis']=_['defaults'](config[_0x81fa('0x6')],{'host':_0x81fa('0x7'),'port':0x18eb});var socket=require(_0x81fa('0x8'))(new Redis(config['redis']));require('./squareProject.socket')[_0x81fa('0x9')](socket);function respondWithResult(_0xd3c615,_0x33cc3f){_0x33cc3f=_0x33cc3f||0xc8;return function(_0x7c9de){if(_0x7c9de){return _0xd3c615[_0x81fa('0xa')](_0x33cc3f)[_0x81fa('0xb')](_0x7c9de);}};}function respondWithFilteredResult(_0x24153a,_0x5d4d8e){return function(_0x215f59){if(_0x215f59){var _0x310022=typeof _0x5d4d8e[_0x81fa('0xc')]===_0x81fa('0xd')&&typeof _0x5d4d8e[_0x81fa('0xe')]===_0x81fa('0xd');var _0x519b21=_0x215f59[_0x81fa('0xf')];var _0x343007=_0x310022?0x0:_0x5d4d8e[_0x81fa('0xc')];var _0x53fff9=_0x310022?_0x215f59[_0x81fa('0xf')]:_0x5d4d8e[_0x81fa('0xc')]+_0x5d4d8e[_0x81fa('0xe')];var _0x245b23;if(_0x53fff9>=_0x519b21){_0x53fff9=_0x519b21;_0x245b23=0xc8;}else{_0x245b23=0xce;}_0x24153a[_0x81fa('0xa')](_0x245b23);return _0x24153a[_0x81fa('0x10')](_0x81fa('0x11'),_0x343007+'-'+_0x53fff9+'/'+_0x519b21)[_0x81fa('0xb')](_0x215f59);}return null;};}function saveUpdates(_0x495b91){return function(_0x2ea85f){if(_0x2ea85f){return _0x2ea85f['update'](_0x495b91)[_0x81fa('0x12')](function(_0x3e2023){return _0x3e2023;});}return null;};}function removeEntity(_0x413727){return function(_0x53cb9a){if(_0x53cb9a){return _0x53cb9a[_0x81fa('0x13')]()[_0x81fa('0x12')](function(){var _0x59ee62=_0x53cb9a['get']({'plain':!![]});var _0x431423=_0x81fa('0x14');return db[_0x81fa('0x15')]['destroy']({'where':{'type':_0x431423,'resourceId':_0x59ee62['id']}})['then'](function(){return _0x53cb9a;});})[_0x81fa('0x12')](function(){var _0x552978=new Redis(config[_0x81fa('0x6')]);_0x552978[_0x81fa('0x16')]('agi',JSON[_0x81fa('0x17')]({'id':_0x53cb9a['id'],'deleted':!![]}));})[_0x81fa('0x12')](function(){_0x413727[_0x81fa('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b46b){return function(_0x23d4ac){if(!_0x23d4ac){_0x56b46b[_0x81fa('0x18')](0x194);}return _0x23d4ac;};}function handleError(_0x17a714,_0x24864a){_0x24864a=_0x24864a||0x1f4;return function(_0xbeb250){logger[_0x81fa('0x19')](_0xbeb250[_0x81fa('0x1a')]);if(_0xbeb250[_0x81fa('0x1b')]){delete _0xbeb250['name'];}_0x17a714[_0x81fa('0xa')](_0x24864a)[_0x81fa('0x1c')](_0xbeb250);};}exports[_0x81fa('0x1d')]=function(_0x537ec7,_0x4577e9){var _0x12f9a2={},_0x431b6c={},_0x4fd11d={'count':0x0,'rows':[]};var _0xdd7bc6=_['map'](db[_0x81fa('0x1e')][_0x81fa('0x1f')],function(_0xab4bce){return{'name':_0xab4bce[_0x81fa('0x20')],'type':_0xab4bce[_0x81fa('0x21')]['key']};});_0x431b6c[_0x81fa('0x22')]=_['map'](_0xdd7bc6,_0x81fa('0x1b'));_0x431b6c[_0x81fa('0x23')]=_[_0x81fa('0x24')](_0x537ec7[_0x81fa('0x23')]);_0x431b6c[_0x81fa('0x25')]=_[_0x81fa('0x26')](_0x431b6c[_0x81fa('0x22')],_0x431b6c[_0x81fa('0x23')]);_0x12f9a2['attributes']=_[_0x81fa('0x26')](_0x431b6c['model'],qs[_0x81fa('0x27')](_0x537ec7[_0x81fa('0x23')][_0x81fa('0x27')]));_0x12f9a2[_0x81fa('0x28')]=_0x12f9a2['attributes'][_0x81fa('0x29')]?_0x12f9a2['attributes']:_0x431b6c[_0x81fa('0x22')];if(!_0x537ec7['query'][_0x81fa('0x2a')]('nolimit')){_0x12f9a2['limit']=qs[_0x81fa('0xe')](_0x537ec7['query'][_0x81fa('0xe')]);_0x12f9a2['offset']=qs[_0x81fa('0xc')](_0x537ec7[_0x81fa('0x23')][_0x81fa('0xc')]);}_0x12f9a2[_0x81fa('0x2b')]=qs[_0x81fa('0x2c')](_0x537ec7[_0x81fa('0x23')][_0x81fa('0x2c')]);_0x12f9a2[_0x81fa('0x2d')]=qs[_0x81fa('0x25')](_[_0x81fa('0x2e')](_0x537ec7[_0x81fa('0x23')],_0x431b6c[_0x81fa('0x25')]),_0xdd7bc6);if(_0x537ec7[_0x81fa('0x23')][_0x81fa('0x2f')]){_0x12f9a2['where']=_['merge'](_0x12f9a2[_0x81fa('0x2d')],{'$or':_[_0x81fa('0x30')](_0xdd7bc6,function(_0x5959ef){if(_0x5959ef[_0x81fa('0x21')]!==_0x81fa('0x31')){var _0x353791={};_0x353791[_0x5959ef[_0x81fa('0x1b')]]={'$like':'%'+_0x537ec7[_0x81fa('0x23')][_0x81fa('0x2f')]+'%'};return _0x353791;}})});}_0x12f9a2=_[_0x81fa('0x32')]({},_0x12f9a2,_0x537ec7[_0x81fa('0x33')]);var _0x212b26={'where':_0x12f9a2['where']};return db[_0x81fa('0x1e')][_0x81fa('0xf')](_0x212b26)[_0x81fa('0x12')](function(_0x140022){_0x4fd11d[_0x81fa('0xf')]=_0x140022;if(_0x537ec7[_0x81fa('0x23')][_0x81fa('0x34')]){_0x12f9a2['include']=[{'all':!![]}];}return db['SquareProject'][_0x81fa('0x35')](_0x12f9a2);})[_0x81fa('0x12')](function(_0x31e734){_0x4fd11d[_0x81fa('0x36')]=_0x31e734;return _0x4fd11d;})[_0x81fa('0x12')](respondWithFilteredResult(_0x4577e9,_0x12f9a2))[_0x81fa('0x37')](handleError(_0x4577e9,null));};exports[_0x81fa('0x38')]=function(_0x4e20ec,_0x58e243){var _0x30c8cc={'raw':![],'where':{'id':_0x4e20ec[_0x81fa('0x39')]['id']}},_0x263dda={};_0x263dda[_0x81fa('0x22')]=_['keys'](db[_0x81fa('0x1e')][_0x81fa('0x1f')]);_0x263dda[_0x81fa('0x23')]=_[_0x81fa('0x24')](_0x4e20ec[_0x81fa('0x23')]);_0x263dda[_0x81fa('0x25')]=_[_0x81fa('0x26')](_0x263dda['model'],_0x263dda[_0x81fa('0x23')]);_0x30c8cc[_0x81fa('0x28')]=_[_0x81fa('0x26')](_0x263dda['model'],qs['fields'](_0x4e20ec[_0x81fa('0x23')][_0x81fa('0x27')]));_0x30c8cc['attributes']=_0x30c8cc[_0x81fa('0x28')]['length']?_0x30c8cc['attributes']:_0x263dda[_0x81fa('0x22')];if(_0x4e20ec[_0x81fa('0x23')][_0x81fa('0x34')]){_0x30c8cc[_0x81fa('0x3a')]=[{'all':!![]}];}_0x30c8cc=_[_0x81fa('0x32')]({},_0x30c8cc,_0x4e20ec[_0x81fa('0x33')]);return db[_0x81fa('0x1e')][_0x81fa('0x3b')](_0x30c8cc)[_0x81fa('0x12')](handleEntityNotFound(_0x58e243,null))['then'](respondWithResult(_0x58e243,null))[_0x81fa('0x37')](handleError(_0x58e243,null));};exports[_0x81fa('0x3c')]=function(_0x255d23,_0x16871d){return db[_0x81fa('0x1e')][_0x81fa('0x3c')](_0x255d23[_0x81fa('0x3d')],{})['then'](function(_0x337d6c){var _0x414a13=_0x255d23[_0x81fa('0x3e')]['get']({'plain':!![]});if(!_0x414a13)throw new Error(_0x81fa('0x3f'));if(_0x414a13[_0x81fa('0x40')]===_0x81fa('0x3e')){var _0x5b16d2=_0x337d6c[_0x81fa('0x41')]({'plain':!![]});var _0x430963=_0x81fa('0x14');return db['UserProfileSection']['find']({'where':{'name':_0x430963,'userProfileId':_0x414a13[_0x81fa('0x42')]},'raw':!![]})['then'](function(_0x400c0c){if(_0x400c0c&&_0x400c0c[_0x81fa('0x43')]===0x0){return db[_0x81fa('0x15')]['create']({'name':_0x5b16d2['name'],'resourceId':_0x5b16d2['id'],'type':_0x400c0c[_0x81fa('0x1b')],'sectionId':_0x400c0c['id']},{})[_0x81fa('0x12')](function(){return _0x337d6c;});}else{return _0x337d6c;}})[_0x81fa('0x37')](function(_0x3c0e8f){logger[_0x81fa('0x19')](_0x81fa('0x44'),_0x3c0e8f);throw _0x3c0e8f;});}return _0x337d6c;})[_0x81fa('0x12')](respondWithResult(_0x16871d,0xc9))[_0x81fa('0x37')](handleError(_0x16871d,null));};exports[_0x81fa('0x45')]=function(_0x3ecbd4,_0x2fc237){if(_0x3ecbd4[_0x81fa('0x3d')]['id']){delete _0x3ecbd4['body']['id'];}return db[_0x81fa('0x1e')][_0x81fa('0x3b')]({'where':{'id':_0x3ecbd4['params']['id']}})[_0x81fa('0x12')](handleEntityNotFound(_0x2fc237,null))[_0x81fa('0x12')](saveUpdates(_0x3ecbd4[_0x81fa('0x3d')],null))[_0x81fa('0x12')](function(_0x4fcc3f){if(!_0x4fcc3f)return;var _0x4a0f6e=_0x4fcc3f['get']({'plain':!![]});return _0x4a0f6e;})[_0x81fa('0x12')](function(_0x19b858){var _0x3e6d7f=new Redis(config[_0x81fa('0x6')]);_0x3e6d7f[_0x81fa('0x16')]('agi',JSON['stringify'](_[_0x81fa('0x2e')](_0x19b858,['id',_0x81fa('0x1b'),_0x81fa('0x46')])));return _0x19b858;})['then'](respondWithResult(_0x2fc237,null))[_0x81fa('0x37')](handleError(_0x2fc237,null));};exports['destroy']=function(_0x111e66,_0xcbba30){return db[_0x81fa('0x1e')][_0x81fa('0x3b')]({'where':{'id':_0x111e66[_0x81fa('0x39')]['id']}})[_0x81fa('0x12')](handleEntityNotFound(_0xcbba30,null))[_0x81fa('0x12')](removeEntity(_0xcbba30,null))[_0x81fa('0x37')](handleError(_0xcbba30,null));};
\ No newline at end of file
+var _0x6a3d=['find','params','publish','production','ioredis','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','redis','./squareProject.socket','status','undefined','count','offset','limit','set','update','then','get','SquareProjects','UserProfileResource','destroy','agi','stringify','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x2b5b9c,_0x48c1fe){var _0x359604=function(_0x14af5c){while(--_0x14af5c){_0x2b5b9c['push'](_0x2b5b9c['shift']());}};_0x359604(++_0x48c1fe);}(_0x6a3d,0x114));var _0xd6a3=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x6a3d[_0x460fd7];return _0x44d1c2;};'use strict';var _=require('lodash');var Redis=require(_0xd6a3('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xd6a3('0x1'))(_0xd6a3('0x2'));var config=require(_0xd6a3('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd6a3('0x4'),'port':0x18eb});var socket=require(_0xd6a3('0x5'))(new Redis(config[_0xd6a3('0x6')]));require(_0xd6a3('0x7'))['register'](socket);function respondWithResult(_0x1f1850,_0x5ccf95){_0x5ccf95=_0x5ccf95||0xc8;return function(_0x22ab4f){if(_0x22ab4f){return _0x1f1850[_0xd6a3('0x8')](_0x5ccf95)['json'](_0x22ab4f);}};}function respondWithFilteredResult(_0x2edbba,_0x5f4a53){return function(_0x41a049){if(_0x41a049){var _0x23f03d=typeof _0x5f4a53['offset']===_0xd6a3('0x9')&&typeof _0x5f4a53['limit']==='undefined';var _0x30621c=_0x41a049[_0xd6a3('0xa')];var _0x302bb4=_0x23f03d?0x0:_0x5f4a53[_0xd6a3('0xb')];var _0x126e5c=_0x23f03d?_0x41a049[_0xd6a3('0xa')]:_0x5f4a53[_0xd6a3('0xb')]+_0x5f4a53[_0xd6a3('0xc')];var _0x594e3a;if(_0x126e5c>=_0x30621c){_0x126e5c=_0x30621c;_0x594e3a=0xc8;}else{_0x594e3a=0xce;}_0x2edbba[_0xd6a3('0x8')](_0x594e3a);return _0x2edbba[_0xd6a3('0xd')]('Content-Range',_0x302bb4+'-'+_0x126e5c+'/'+_0x30621c)['json'](_0x41a049);}return null;};}function saveUpdates(_0x40dea3){return function(_0x5f12a3){if(_0x5f12a3){return _0x5f12a3[_0xd6a3('0xe')](_0x40dea3)[_0xd6a3('0xf')](function(_0x43e4d7){return _0x43e4d7;});}return null;};}function removeEntity(_0x53b590){return function(_0x410d82){if(_0x410d82){return _0x410d82['destroy']()[_0xd6a3('0xf')](function(){var _0x241853=_0x410d82[_0xd6a3('0x10')]({'plain':!![]});var _0x5842ff=_0xd6a3('0x11');return db[_0xd6a3('0x12')][_0xd6a3('0x13')]({'where':{'type':_0x5842ff,'resourceId':_0x241853['id']}})[_0xd6a3('0xf')](function(){return _0x410d82;});})[_0xd6a3('0xf')](function(){var _0x389b79=new Redis(config[_0xd6a3('0x6')]);_0x389b79['publish'](_0xd6a3('0x14'),JSON[_0xd6a3('0x15')]({'id':_0x410d82['id'],'deleted':!![]}));})[_0xd6a3('0xf')](function(){_0x53b590[_0xd6a3('0x8')](0xcc)[_0xd6a3('0x16')]();});}};}function handleEntityNotFound(_0x3c4135){return function(_0x470f0d){if(!_0x470f0d){_0x3c4135[_0xd6a3('0x17')](0x194);}return _0x470f0d;};}function handleError(_0x29771e,_0x181843){_0x181843=_0x181843||0x1f4;return function(_0x4be7b7){logger[_0xd6a3('0x18')](_0x4be7b7[_0xd6a3('0x19')]);if(_0x4be7b7[_0xd6a3('0x1a')]){delete _0x4be7b7['name'];}_0x29771e['status'](_0x181843)[_0xd6a3('0x1b')](_0x4be7b7);};}exports['index']=function(_0x497fb8,_0x1a7716){var _0x5a67c5={},_0x48d31e={},_0x2d8734={'count':0x0,'rows':[]};var _0xd54a2d=_[_0xd6a3('0x1c')](db[_0xd6a3('0x1d')][_0xd6a3('0x1e')],function(_0x141ffa){return{'name':_0x141ffa[_0xd6a3('0x1f')],'type':_0x141ffa[_0xd6a3('0x20')][_0xd6a3('0x21')]};});_0x48d31e[_0xd6a3('0x22')]=_[_0xd6a3('0x1c')](_0xd54a2d,_0xd6a3('0x1a'));_0x48d31e['query']=_['keys'](_0x497fb8['query']);_0x48d31e[_0xd6a3('0x23')]=_['intersection'](_0x48d31e[_0xd6a3('0x22')],_0x48d31e[_0xd6a3('0x24')]);_0x5a67c5[_0xd6a3('0x25')]=_[_0xd6a3('0x26')](_0x48d31e[_0xd6a3('0x22')],qs[_0xd6a3('0x27')](_0x497fb8['query'][_0xd6a3('0x27')]));_0x5a67c5[_0xd6a3('0x25')]=_0x5a67c5[_0xd6a3('0x25')][_0xd6a3('0x28')]?_0x5a67c5['attributes']:_0x48d31e[_0xd6a3('0x22')];if(!_0x497fb8[_0xd6a3('0x24')][_0xd6a3('0x29')](_0xd6a3('0x2a'))){_0x5a67c5[_0xd6a3('0xc')]=qs[_0xd6a3('0xc')](_0x497fb8[_0xd6a3('0x24')][_0xd6a3('0xc')]);_0x5a67c5[_0xd6a3('0xb')]=qs[_0xd6a3('0xb')](_0x497fb8[_0xd6a3('0x24')][_0xd6a3('0xb')]);}_0x5a67c5['order']=qs[_0xd6a3('0x2b')](_0x497fb8['query'][_0xd6a3('0x2b')]);_0x5a67c5['where']=qs['filters'](_[_0xd6a3('0x2c')](_0x497fb8[_0xd6a3('0x24')],_0x48d31e[_0xd6a3('0x23')]),_0xd54a2d);if(_0x497fb8['query']['filter']){_0x5a67c5[_0xd6a3('0x2d')]=_[_0xd6a3('0x2e')](_0x5a67c5[_0xd6a3('0x2d')],{'$or':_['map'](_0xd54a2d,function(_0xd00b66){if(_0xd00b66[_0xd6a3('0x20')]!==_0xd6a3('0x2f')){var _0x377607={};_0x377607[_0xd00b66['name']]={'$like':'%'+_0x497fb8[_0xd6a3('0x24')][_0xd6a3('0x30')]+'%'};return _0x377607;}})});}_0x5a67c5=_[_0xd6a3('0x2e')]({},_0x5a67c5,_0x497fb8['options']);var _0x1dd70d={'where':_0x5a67c5[_0xd6a3('0x2d')]};return db[_0xd6a3('0x1d')]['count'](_0x1dd70d)['then'](function(_0x9676ab){_0x2d8734['count']=_0x9676ab;if(_0x497fb8[_0xd6a3('0x24')][_0xd6a3('0x31')]){_0x5a67c5[_0xd6a3('0x32')]=[{'all':!![]}];}return db[_0xd6a3('0x1d')][_0xd6a3('0x33')](_0x5a67c5);})['then'](function(_0x132dd7){_0x2d8734[_0xd6a3('0x34')]=_0x132dd7;return _0x2d8734;})[_0xd6a3('0xf')](respondWithFilteredResult(_0x1a7716,_0x5a67c5))[_0xd6a3('0x35')](handleError(_0x1a7716,null));};exports[_0xd6a3('0x36')]=function(_0xce9e9d,_0xae3e70){var _0x454b3e={'raw':![],'where':{'id':_0xce9e9d['params']['id']}},_0x339f2d={};_0x339f2d[_0xd6a3('0x22')]=_[_0xd6a3('0x37')](db['SquareProject'][_0xd6a3('0x1e')]);_0x339f2d[_0xd6a3('0x24')]=_['keys'](_0xce9e9d[_0xd6a3('0x24')]);_0x339f2d[_0xd6a3('0x23')]=_[_0xd6a3('0x26')](_0x339f2d[_0xd6a3('0x22')],_0x339f2d[_0xd6a3('0x24')]);_0x454b3e[_0xd6a3('0x25')]=_['intersection'](_0x339f2d[_0xd6a3('0x22')],qs[_0xd6a3('0x27')](_0xce9e9d[_0xd6a3('0x24')][_0xd6a3('0x27')]));_0x454b3e[_0xd6a3('0x25')]=_0x454b3e[_0xd6a3('0x25')][_0xd6a3('0x28')]?_0x454b3e[_0xd6a3('0x25')]:_0x339f2d[_0xd6a3('0x22')];if(_0xce9e9d['query']['includeAll']){_0x454b3e[_0xd6a3('0x32')]=[{'all':!![]}];}_0x454b3e=_[_0xd6a3('0x2e')]({},_0x454b3e,_0xce9e9d[_0xd6a3('0x38')]);return db[_0xd6a3('0x1d')]['find'](_0x454b3e)[_0xd6a3('0xf')](handleEntityNotFound(_0xae3e70,null))[_0xd6a3('0xf')](respondWithResult(_0xae3e70,null))[_0xd6a3('0x35')](handleError(_0xae3e70,null));};exports['create']=function(_0x4036be,_0x36ee08){return db[_0xd6a3('0x1d')][_0xd6a3('0x39')](_0x4036be[_0xd6a3('0x3a')],{})[_0xd6a3('0xf')](function(_0x49997b){var _0xf28fe4=_0x4036be[_0xd6a3('0x3b')][_0xd6a3('0x10')]({'plain':!![]});if(!_0xf28fe4)throw new Error(_0xd6a3('0x3c'));if(_0xf28fe4[_0xd6a3('0x3d')]==='user'){var _0x159967=_0x49997b[_0xd6a3('0x10')]({'plain':!![]});var _0x144c8c=_0xd6a3('0x11');return db[_0xd6a3('0x3e')]['find']({'where':{'name':_0x144c8c,'userProfileId':_0xf28fe4[_0xd6a3('0x3f')]},'raw':!![]})['then'](function(_0x4a70fc){if(_0x4a70fc&&_0x4a70fc['autoAssociation']===0x0){return db[_0xd6a3('0x12')][_0xd6a3('0x39')]({'name':_0x159967['name'],'resourceId':_0x159967['id'],'type':_0x4a70fc[_0xd6a3('0x1a')],'sectionId':_0x4a70fc['id']},{})['then'](function(){return _0x49997b;});}else{return _0x49997b;}})[_0xd6a3('0x35')](function(_0x3a8869){logger[_0xd6a3('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a8869);throw _0x3a8869;});}return _0x49997b;})['then'](respondWithResult(_0x36ee08,0xc9))['catch'](handleError(_0x36ee08,null));};exports['update']=function(_0x1a4b21,_0x337825){if(_0x1a4b21[_0xd6a3('0x3a')]['id']){delete _0x1a4b21['body']['id'];}return db[_0xd6a3('0x1d')][_0xd6a3('0x40')]({'where':{'id':_0x1a4b21[_0xd6a3('0x41')]['id']}})[_0xd6a3('0xf')](handleEntityNotFound(_0x337825,null))['then'](saveUpdates(_0x1a4b21[_0xd6a3('0x3a')],null))[_0xd6a3('0xf')](function(_0xc66a19){if(!_0xc66a19)return;var _0x5b86f0=_0xc66a19[_0xd6a3('0x10')]({'plain':!![]});return _0x5b86f0;})[_0xd6a3('0xf')](function(_0xcfb495){var _0x1bd79e=new Redis(config[_0xd6a3('0x6')]);_0x1bd79e[_0xd6a3('0x42')](_0xd6a3('0x14'),JSON[_0xd6a3('0x15')](_[_0xd6a3('0x2c')](_0xcfb495,['id',_0xd6a3('0x1a'),_0xd6a3('0x43')])));return _0xcfb495;})[_0xd6a3('0xf')](respondWithResult(_0x337825,null))['catch'](handleError(_0x337825,null));};exports['destroy']=function(_0x4af8e4,_0x253cee){return db[_0xd6a3('0x1d')]['find']({'where':{'id':_0x4af8e4[_0xd6a3('0x41')]['id']}})[_0xd6a3('0xf')](handleEntityNotFound(_0x253cee,null))['then'](removeEntity(_0x253cee,null))[_0xd6a3('0x35')](handleError(_0x253cee,null));};
\ No newline at end of file
index 0494545..16da11f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc20=['exports','events','../../mysqldb','SquareProject','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcc20,0x133));var _0x0cc2=function(_0x2ad000,_0x2af481){_0x2ad000=_0x2ad000-0x0;var _0x730757=_0xcc20[_0x2ad000];return _0x730757;};'use strict';var EventEmitter=require(_0x0cc2('0x0'));var SquareProject=require(_0x0cc2('0x1'))['db'][_0x0cc2('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0cc2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0cc2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3dd02b){return function(_0x1b8981,_0x68910b,_0x5296d0){SquareProjectEvents[_0x0cc2('0x5')](_0x3dd02b+':'+_0x1b8981['id'],_0x1b8981);SquareProjectEvents[_0x0cc2('0x5')](_0x3dd02b,_0x1b8981);_0x5296d0(null);};}for(var e in events){if(events[_0x0cc2('0x6')](e)){var event=events[e];SquareProject[_0x0cc2('0x7')](e,emitEvent(event));}}module[_0x0cc2('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x78a8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SquareProject'];(function(_0x4f61a1,_0x35820b){var _0xae8b64=function(_0x4f784c){while(--_0x4f784c){_0x4f61a1['push'](_0x4f61a1['shift']());}};_0xae8b64(++_0x35820b);}(_0x78a8,0x85));var _0x878a=function(_0xe04c7b,_0x24cb88){_0xe04c7b=_0xe04c7b-0x0;var _0x4350b4=_0x78a8[_0xe04c7b];return _0x4350b4;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x878a('0x0'))['db'][_0x878a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x878a('0x2')](0x0);var events={'afterCreate':_0x878a('0x3'),'afterUpdate':_0x878a('0x4'),'afterDestroy':_0x878a('0x5')};function emitEvent(_0x402004){return function(_0x371f28,_0x1bd167,_0x597944){SquareProjectEvents[_0x878a('0x6')](_0x402004+':'+_0x371f28['id'],_0x371f28);SquareProjectEvents[_0x878a('0x6')](_0x402004,_0x371f28);_0x597944(null);};}for(var e in events){if(events[_0x878a('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x878a('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 522a3c5..b85bf62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe17a=['production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','rimraf','./squareProject.attributes','exports','define','square_projects','changed','preproduction','format'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe17a,0x113));var _0xae17=function(_0x32e718,_0x45d44f){_0x32e718=_0x32e718-0x0;var _0x3fa248=_0xe17a[_0x32e718];return _0x3fa248;};'use strict';var _=require(_0xae17('0x0'));var util=require(_0xae17('0x1'));var logger=require('../../config/logger')(_0xae17('0x2'));var moment=require(_0xae17('0x3'));var BPromise=require(_0xae17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae17('0x5'));var rimraf=require(_0xae17('0x6'));var config=require('../../config/environment');var attributes=require(_0xae17('0x7'));module[_0xae17('0x8')]=function(_0x4ff43b,_0x536c6b){return _0x4ff43b[_0xae17('0x9')]('SquareProject',attributes,{'tableName':_0xae17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e8fc3,_0x185c4e,_0x25ca7a){if(_0x4e8fc3[_0xae17('0xb')](_0xae17('0xc'))){_0x4e8fc3['savedAt']=moment()[_0xae17('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4e8fc3[_0xae17('0xb')](_0xae17('0xe'))){_0x4e8fc3[_0xae17('0xf')]=moment()[_0xae17('0xd')](_0xae17('0x10'));}_0x25ca7a(null,_0x4e8fc3);}}});};
\ No newline at end of file
+var _0xe391=['rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','../../config/logger','api','request-promise','path'];(function(_0x254e49,_0x488810){var _0x4caad9=function(_0x4f60ff){while(--_0x4f60ff){_0x254e49['push'](_0x254e49['shift']());}};_0x4caad9(++_0x488810);}(_0xe391,0x17b));var _0x1e39=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xe391[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x1e39('0x0'));var util=require('util');var logger=require(_0x1e39('0x1'))(_0x1e39('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e39('0x3'));var fs=require('fs');var path=require(_0x1e39('0x4'));var rimraf=require(_0x1e39('0x5'));var config=require(_0x1e39('0x6'));var attributes=require(_0x1e39('0x7'));module[_0x1e39('0x8')]=function(_0x508224,_0x575b12){return _0x508224['define'](_0x1e39('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ac64a,_0x1f9fcf,_0x268c35){if(_0x2ac64a['changed']('preproduction')){_0x2ac64a[_0x1e39('0xa')]=moment()[_0x1e39('0xb')](_0x1e39('0xc'));}if(_0x2ac64a[_0x1e39('0xd')](_0x1e39('0xe'))){_0x2ac64a[_0x1e39('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x268c35(null,_0x2ac64a);}}});};
\ No newline at end of file
index 9b39b44..a672c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b8=['rpc','../../config/environment','redis','defaults','localhost','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetSquareProjects','catch','error','message','find','ShowSquareProject','debug','stringify','ioredis','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd8b8,0xa0));var _0x8d8b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd8b8[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var Redis=require(_0x8d8b('0x0'));var db=require(_0x8d8b('0x1'))['db'];var logger=require('../../config/logger')(_0x8d8b('0x2'));var config=require(_0x8d8b('0x3'));config[_0x8d8b('0x4')]=_[_0x8d8b('0x5')](config[_0x8d8b('0x4')],{'host':_0x8d8b('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d8b('0x4')]));require('./squareProject.socket')['register'](socket);exports['GetSquareProjects']=function(_0x550de1){var _0x3ecaf4=this;return new Promise(function(_0x375b0f,_0x45816a){return db[_0x8d8b('0x7')][_0x8d8b('0x8')]({'raw':_0x550de1[_0x8d8b('0x9')]?_0x550de1[_0x8d8b('0x9')][_0x8d8b('0xa')]===undefined?!![]:![]:!![],'where':_0x550de1[_0x8d8b('0x9')]?_0x550de1[_0x8d8b('0x9')][_0x8d8b('0xb')]||null:null,'attributes':_0x550de1['options']?_0x550de1['options'][_0x8d8b('0xc')]||null:null,'limit':_0x550de1[_0x8d8b('0x9')]?_0x550de1['options'][_0x8d8b('0xd')]||null:null,'include':_0x550de1[_0x8d8b('0x9')]?_0x550de1['options'][_0x8d8b('0xe')]?_[_0x8d8b('0xf')](_0x550de1[_0x8d8b('0x9')][_0x8d8b('0xe')],function(_0x291121){return{'model':db[_0x291121[_0x8d8b('0x10')]],'as':_0x291121['as'],'attributes':_0x291121['attributes'],'include':_0x291121[_0x8d8b('0xe')]?_[_0x8d8b('0xf')](_0x291121[_0x8d8b('0xe')],function(_0x59a50b){return{'model':db[_0x59a50b[_0x8d8b('0x10')]],'as':_0x59a50b['as'],'attributes':_0x59a50b[_0x8d8b('0xc')],'include':_0x59a50b[_0x8d8b('0xe')]?_[_0x8d8b('0xf')](_0x59a50b[_0x8d8b('0xe')],function(_0x5819d3){return{'model':db[_0x5819d3[_0x8d8b('0x10')]],'as':_0x5819d3['as'],'attributes':_0x5819d3[_0x8d8b('0xc')]};}):[]};}):[]};}):[]:[]})[_0x8d8b('0x11')](function(_0x25ce05){logger[_0x8d8b('0x12')]('GetSquareProjects',_0x550de1);logger['debug'](_0x8d8b('0x13'),_0x550de1,JSON['stringify'](_0x25ce05));_0x375b0f(_0x25ce05);})[_0x8d8b('0x14')](function(_0x267f0b){logger[_0x8d8b('0x15')](_0x8d8b('0x13'),_0x267f0b[_0x8d8b('0x16')],_0x550de1);_0x45816a(_0x3ecaf4[_0x8d8b('0x15')](0x1f4,_0x267f0b[_0x8d8b('0x16')]));});});};exports['ShowSquareProject']=function(_0x16e966){var _0xfeb870=this;return new Promise(function(_0x259b4e,_0x13f16a){return db[_0x8d8b('0x7')][_0x8d8b('0x17')]({'raw':_0x16e966['options']?_0x16e966['options'][_0x8d8b('0xa')]===undefined?!![]:![]:!![],'where':_0x16e966[_0x8d8b('0x9')]?_0x16e966[_0x8d8b('0x9')][_0x8d8b('0xb')]||null:null,'attributes':_0x16e966[_0x8d8b('0x9')]?_0x16e966[_0x8d8b('0x9')][_0x8d8b('0xc')]||null:null,'include':_0x16e966[_0x8d8b('0x9')]?_0x16e966['options']['include']?_[_0x8d8b('0xf')](_0x16e966[_0x8d8b('0x9')][_0x8d8b('0xe')],function(_0x5821e4){return{'model':db[_0x5821e4[_0x8d8b('0x10')]],'as':_0x5821e4['as'],'attributes':_0x5821e4['attributes'],'include':_0x5821e4[_0x8d8b('0xe')]?_[_0x8d8b('0xf')](_0x5821e4[_0x8d8b('0xe')],function(_0x3d2910){return{'model':db[_0x3d2910[_0x8d8b('0x10')]],'as':_0x3d2910['as'],'attributes':_0x3d2910['attributes'],'include':_0x3d2910['include']?_[_0x8d8b('0xf')](_0x3d2910[_0x8d8b('0xe')],function(_0x3d0c62){return{'model':db[_0x3d0c62['model']],'as':_0x3d0c62['as'],'attributes':_0x3d0c62['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d8b('0x11')](function(_0x2132e0){logger[_0x8d8b('0x12')](_0x8d8b('0x18'),_0x16e966);logger[_0x8d8b('0x19')]('ShowSquareProject',_0x16e966,JSON[_0x8d8b('0x1a')](_0x2132e0));_0x259b4e(_0x2132e0);})[_0x8d8b('0x14')](function(_0x24621a){logger['error'](_0x8d8b('0x18'),_0x24621a[_0x8d8b('0x16')],_0x16e966);_0x13f16a(_0xfeb870[_0x8d8b('0x15')](0x1f4,_0x24621a[_0x8d8b('0x16')]));});});};
\ No newline at end of file
+var _0xcf27=['defaults','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','include','map','model','then','info','debug','catch','error','message','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5982a5,_0x3dc07b){var _0x159c80=function(_0x274c92){while(--_0x274c92){_0x5982a5['push'](_0x5982a5['shift']());}};_0x159c80(++_0x3dc07b);}(_0xcf27,0x166));var _0x7cf2=function(_0x4321ab,_0x1dffeb){_0x4321ab=_0x4321ab-0x0;var _0x208ecd=_0xcf27[_0x4321ab];return _0x208ecd;};'use strict';var _=require(_0x7cf2('0x0'));var Redis=require(_0x7cf2('0x1'));var db=require(_0x7cf2('0x2'))['db'];var logger=require(_0x7cf2('0x3'))(_0x7cf2('0x4'));var config=require(_0x7cf2('0x5'));config['redis']=_[_0x7cf2('0x6')](config[_0x7cf2('0x7')],{'host':_0x7cf2('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7cf2('0x7')]));require(_0x7cf2('0x9'))[_0x7cf2('0xa')](socket);exports[_0x7cf2('0xb')]=function(_0xe129c7){var _0x3ec965=this;return new Promise(function(_0x164df3,_0x2ccd2d){return db[_0x7cf2('0xc')]['findAll']({'raw':_0xe129c7[_0x7cf2('0xd')]?_0xe129c7['options'][_0x7cf2('0xe')]===undefined?!![]:![]:!![],'where':_0xe129c7[_0x7cf2('0xd')]?_0xe129c7[_0x7cf2('0xd')][_0x7cf2('0xf')]||null:null,'attributes':_0xe129c7['options']?_0xe129c7['options'][_0x7cf2('0x10')]||null:null,'limit':_0xe129c7[_0x7cf2('0xd')]?_0xe129c7[_0x7cf2('0xd')]['limit']||null:null,'include':_0xe129c7['options']?_0xe129c7[_0x7cf2('0xd')][_0x7cf2('0x11')]?_[_0x7cf2('0x12')](_0xe129c7[_0x7cf2('0xd')][_0x7cf2('0x11')],function(_0x2a8bfa){return{'model':db[_0x2a8bfa[_0x7cf2('0x13')]],'as':_0x2a8bfa['as'],'attributes':_0x2a8bfa[_0x7cf2('0x10')],'include':_0x2a8bfa[_0x7cf2('0x11')]?_[_0x7cf2('0x12')](_0x2a8bfa[_0x7cf2('0x11')],function(_0x39dfec){return{'model':db[_0x39dfec[_0x7cf2('0x13')]],'as':_0x39dfec['as'],'attributes':_0x39dfec[_0x7cf2('0x10')],'include':_0x39dfec[_0x7cf2('0x11')]?_[_0x7cf2('0x12')](_0x39dfec[_0x7cf2('0x11')],function(_0x4162b0){return{'model':db[_0x4162b0[_0x7cf2('0x13')]],'as':_0x4162b0['as'],'attributes':_0x4162b0[_0x7cf2('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7cf2('0x14')](function(_0xed0110){logger[_0x7cf2('0x15')](_0x7cf2('0xb'),_0xe129c7);logger[_0x7cf2('0x16')](_0x7cf2('0xb'),_0xe129c7,JSON['stringify'](_0xed0110));_0x164df3(_0xed0110);})[_0x7cf2('0x17')](function(_0x4c4551){logger[_0x7cf2('0x18')]('GetSquareProjects',_0x4c4551[_0x7cf2('0x19')],_0xe129c7);_0x2ccd2d(_0x3ec965[_0x7cf2('0x18')](0x1f4,_0x4c4551[_0x7cf2('0x19')]));});});};exports[_0x7cf2('0x1a')]=function(_0x32a4c8){var _0x9281a1=this;return new Promise(function(_0x2fbe31,_0x56f6ec){return db[_0x7cf2('0xc')][_0x7cf2('0x1b')]({'raw':_0x32a4c8['options']?_0x32a4c8[_0x7cf2('0xd')][_0x7cf2('0xe')]===undefined?!![]:![]:!![],'where':_0x32a4c8[_0x7cf2('0xd')]?_0x32a4c8[_0x7cf2('0xd')]['where']||null:null,'attributes':_0x32a4c8['options']?_0x32a4c8[_0x7cf2('0xd')][_0x7cf2('0x10')]||null:null,'include':_0x32a4c8[_0x7cf2('0xd')]?_0x32a4c8[_0x7cf2('0xd')][_0x7cf2('0x11')]?_[_0x7cf2('0x12')](_0x32a4c8['options']['include'],function(_0x3a9b05){return{'model':db[_0x3a9b05[_0x7cf2('0x13')]],'as':_0x3a9b05['as'],'attributes':_0x3a9b05['attributes'],'include':_0x3a9b05[_0x7cf2('0x11')]?_[_0x7cf2('0x12')](_0x3a9b05[_0x7cf2('0x11')],function(_0x4625b4){return{'model':db[_0x4625b4[_0x7cf2('0x13')]],'as':_0x4625b4['as'],'attributes':_0x4625b4[_0x7cf2('0x10')],'include':_0x4625b4[_0x7cf2('0x11')]?_['map'](_0x4625b4[_0x7cf2('0x11')],function(_0xca36f){return{'model':db[_0xca36f['model']],'as':_0xca36f['as'],'attributes':_0xca36f[_0x7cf2('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26a876){logger[_0x7cf2('0x15')](_0x7cf2('0x1a'),_0x32a4c8);logger[_0x7cf2('0x16')](_0x7cf2('0x1a'),_0x32a4c8,JSON['stringify'](_0x26a876));_0x2fbe31(_0x26a876);})[_0x7cf2('0x17')](function(_0x600dd2){logger[_0x7cf2('0x18')](_0x7cf2('0x1a'),_0x600dd2[_0x7cf2('0x19')],_0x32a4c8);_0x56f6ec(_0x9281a1['error'](0x1f4,_0x600dd2[_0x7cf2('0x19')]));});});};
\ No newline at end of file
index 788e770..304f34f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d5=['remove','update','emit','removeListener','register','length','squareProject:','save'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xa8d5,0x15f));var _0x5a8d=function(_0x450606,_0x361539){_0x450606=_0x450606-0x0;var _0x1fecec=_0xa8d5[_0x450606];return _0x1fecec;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x5a8d('0x0'),_0x5a8d('0x1'),_0x5a8d('0x2')];function createListener(_0x3bd90f,_0x1b3912){return function(_0x38b44f){_0x1b3912[_0x5a8d('0x3')](_0x3bd90f,_0x38b44f);};}function removeListener(_0x44b217,_0x36b0c6){return function(){SquareProjectEvents[_0x5a8d('0x4')](_0x44b217,_0x36b0c6);};}exports[_0x5a8d('0x5')]=function(_0x127fb4){for(var _0x3bc310=0x0,_0x2167c0=events[_0x5a8d('0x6')];_0x3bc310<_0x2167c0;_0x3bc310++){var _0xbbf4ee=events[_0x3bc310];var _0x497edf=createListener(_0x5a8d('0x7')+_0xbbf4ee,_0x127fb4);SquareProjectEvents['on'](_0xbbf4ee,_0x497edf);}};
\ No newline at end of file
+var _0x2dcb=['save','remove','update','emit','register','length','squareProject:','./squareProject.events'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2dcb,0x16f));var _0xb2dc=function(_0x2730f1,_0x2943f5){_0x2730f1=_0x2730f1-0x0;var _0x43ac10=_0x2dcb[_0x2730f1];return _0x43ac10;};'use strict';var SquareProjectEvents=require(_0xb2dc('0x0'));var events=[_0xb2dc('0x1'),_0xb2dc('0x2'),_0xb2dc('0x3')];function createListener(_0x5221f6,_0x197299){return function(_0x45bedd){_0x197299[_0xb2dc('0x4')](_0x5221f6,_0x45bedd);};}function removeListener(_0x5bf2ab,_0x40e735){return function(){SquareProjectEvents['removeListener'](_0x5bf2ab,_0x40e735);};}exports[_0xb2dc('0x5')]=function(_0x239470){for(var _0x4dbad7=0x0,_0x4feec7=events[_0xb2dc('0x6')];_0x4dbad7<_0x4feec7;_0x4dbad7++){var _0x7b2524=events[_0x4dbad7];var _0x5ce60c=createListener(_0xb2dc('0x7')+_0x7b2524,_0x239470);SquareProjectEvents['on'](_0x7b2524,_0x5ce60c);}};
\ No newline at end of file
index 3c54ee2..20b1fb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x4a080c,_0x392b89){var _0x6077b5=function(_0x1992c8){while(--_0x1992c8){_0x4a080c['push'](_0x4a080c['shift']());}};_0x6077b5(++_0x392b89);}(_0xe14b,0x93));var _0xbe14=function(_0x1f4f75,_0x37bc56){_0x1f4f75=_0x1f4f75-0x0;var _0x45b015=_0xe14b[_0x1f4f75];return _0x45b015;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router;
\ No newline at end of file
+var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x135eb7,_0x2588fd){var _0xe74caf=function(_0x587050){while(--_0x587050){_0x135eb7['push'](_0x135eb7['shift']());}};_0xe74caf(++_0x2588fd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x5fc3[_0x1fb4e1];return _0x22d1b0;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9c99c43..99ca77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['sequelize','STRING','VIRTUAL','savePath','substring','lastIndexOf'];(function(_0x56c4fc,_0x39d907){var _0x154899=function(_0x16c762){while(--_0x16c762){_0x56c4fc['push'](_0x56c4fc['shift']());}};_0x154899(++_0x39d907);}(_0x24ca,0x1bc));var _0xa24c=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x24ca[_0x13c70c];return _0x50f0f2;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'callerid':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'dnid':{'type':Sequelize[_0xa24c('0x1')]},'projectName':{'type':Sequelize[_0xa24c('0x1')]},'saveName':{'type':Sequelize[_0xa24c('0x1')]},'filename':{'type':Sequelize[_0xa24c('0x1')]},'savePath':{'type':Sequelize[_0xa24c('0x1')]},'format':{'type':Sequelize[_0xa24c('0x2')],'get':function(){var _0x257264='';var _0x9a5013=this['getDataValue'](_0xa24c('0x3'));if(_0x9a5013){_0x257264=_0x9a5013[_0xa24c('0x4')](_0x9a5013[_0xa24c('0x5')]('.'));}return _0x257264;}}};
\ No newline at end of file
+var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x59dde7,_0x4ae31e){_0x59dde7=_0x59dde7-0x0;var _0x418de5=_0x2d17[_0x59dde7];return _0x418de5;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}};
\ No newline at end of file
index c89cd4d..4b452a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x600b=['info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','name','filter','options','SquareRecording','include','findAll','rows','catch','show','includeAll','create','body','params','download','../../components/encryptor','uniqueid','find','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','isNil'];(function(_0x1d4c0b,_0x205553){var _0x5e05ff=function(_0x5b145e){while(--_0x5b145e){_0x1d4c0b['push'](_0x1d4c0b['shift']());}};_0x5e05ff(++_0x205553);}(_0x600b,0x18d));var _0xb600=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0x600b[_0x4f83ca];return _0x1fbac3;};'use strict';var emlformat=require(_0xb600('0x0'));var rimraf=require(_0xb600('0x1'));var zipdir=require(_0xb600('0x2'));var jsonpatch=require(_0xb600('0x3'));var rp=require(_0xb600('0x4'));var moment=require(_0xb600('0x5'));var BPromise=require(_0xb600('0x6'));var Mustache=require(_0xb600('0x7'));var util=require(_0xb600('0x8'));var path=require(_0xb600('0x9'));var sox=require(_0xb600('0xa'));var csv=require(_0xb600('0xb'));var ejs=require(_0xb600('0xc'));var fs=require('fs');var fs_extra=require(_0xb600('0xd'));var _=require(_0xb600('0xe'));var squel=require(_0xb600('0xf'));var crypto=require(_0xb600('0x10'));var jsforce=require(_0xb600('0x11'));var deskjs=require(_0xb600('0x12'));var toCsv=require('to-csv');var querystring=require(_0xb600('0x13'));var Papa=require('papaparse');var Redis=require(_0xb600('0x14'));var authService=require(_0xb600('0x15'));var qs=require(_0xb600('0x16'));var as=require(_0xb600('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb600('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb600('0x19'));var db=require(_0xb600('0x1a'))['db'];function respondWithStatusCode(_0x2826e4,_0x58b238){_0x58b238=_0x58b238||0xcc;return function(_0x2f120f){if(_0x2f120f){return _0x2826e4['sendStatus'](_0x58b238);}return _0x2826e4[_0xb600('0x1b')](_0x58b238)[_0xb600('0x1c')]();};}function respondWithResult(_0x1800c8,_0x29d174){_0x29d174=_0x29d174||0xc8;return function(_0x2580e2){if(_0x2580e2){return _0x1800c8[_0xb600('0x1b')](_0x29d174)[_0xb600('0x1d')](_0x2580e2);}};}function respondWithFilteredResult(_0x378658,_0x2fc1a6){return function(_0x4c57fd){if(_0x4c57fd){var _0x4d3952=typeof _0x2fc1a6[_0xb600('0x1e')]===_0xb600('0x1f')&&typeof _0x2fc1a6[_0xb600('0x20')]==='undefined';var _0xe3b377=_0x4c57fd[_0xb600('0x21')];var _0x23e6a9=_0x4d3952?0x0:_0x2fc1a6['offset'];var _0x9814c6=_0x4d3952?_0x4c57fd[_0xb600('0x21')]:_0x2fc1a6['offset']+_0x2fc1a6[_0xb600('0x20')];var _0x52ace0;if(_0x9814c6>=_0xe3b377){_0x9814c6=_0xe3b377;_0x52ace0=0xc8;}else{_0x52ace0=0xce;}_0x378658[_0xb600('0x1b')](_0x52ace0);return _0x378658[_0xb600('0x22')](_0xb600('0x23'),_0x23e6a9+'-'+_0x9814c6+'/'+_0xe3b377)[_0xb600('0x1d')](_0x4c57fd);}return null;};}function patchUpdates(_0x7915f8){return function(_0x5b5a35){try{jsonpatch[_0xb600('0x24')](_0x5b5a35,_0x7915f8,!![]);}catch(_0x517b72){return BPromise['reject'](_0x517b72);}return _0x5b5a35[_0xb600('0x25')]();};}function saveUpdates(_0x30d7df,_0x423bd2){return function(_0x1e484d){if(_0x1e484d){return _0x1e484d['update'](_0x30d7df)[_0xb600('0x26')](function(_0x390998){return _0x390998;});}return null;};}function removeEntity(_0xcc426c,_0x16f417){return function(_0x534bab){if(_0x534bab){return _0x534bab[_0xb600('0x27')]()[_0xb600('0x26')](function(){_0xcc426c[_0xb600('0x1b')](0xcc)[_0xb600('0x1c')]();});}};}function handleEntityNotFound(_0x1da219,_0x33c24d){return function(_0x2e7322){if(!_0x2e7322){_0x1da219[_0xb600('0x28')](0x194);}return _0x2e7322;};}function handleError(_0x369738,_0x3aba7b){_0x3aba7b=_0x3aba7b||0x1f4;return function(_0x57c054){logger[_0xb600('0x29')](_0x57c054[_0xb600('0x2a')]);if(_0x57c054['name']){delete _0x57c054['name'];}_0x369738['status'](_0x3aba7b)[_0xb600('0x2b')](_0x57c054);};}exports[_0xb600('0x2c')]=function(_0x1e0d12,_0x43af56){var _0x37d982={},_0x28bd0c={},_0x59a485={'count':0x0,'rows':[]};var _0x1a9065=_[_0xb600('0x2d')](db['SquareRecording'][_0xb600('0x2e')],function(_0x5925d2){return{'name':_0x5925d2[_0xb600('0x2f')],'type':_0x5925d2[_0xb600('0x30')][_0xb600('0x31')]};});_0x28bd0c[_0xb600('0x32')]=_[_0xb600('0x2d')](_0x1a9065,'name');_0x28bd0c['query']=_[_0xb600('0x33')](_0x1e0d12[_0xb600('0x34')]);_0x28bd0c[_0xb600('0x35')]=_[_0xb600('0x36')](_0x28bd0c[_0xb600('0x32')],_0x28bd0c['query']);_0x37d982[_0xb600('0x37')]=_[_0xb600('0x36')](_0x28bd0c[_0xb600('0x32')],qs['fields'](_0x1e0d12[_0xb600('0x34')][_0xb600('0x38')]));_0x37d982[_0xb600('0x37')]=_0x37d982['attributes'][_0xb600('0x39')]?_0x37d982[_0xb600('0x37')]:_0x28bd0c[_0xb600('0x32')];if(!_0x1e0d12[_0xb600('0x34')][_0xb600('0x3a')](_0xb600('0x3b'))){_0x37d982['limit']=qs['limit'](_0x1e0d12['query'][_0xb600('0x20')]);_0x37d982[_0xb600('0x1e')]=qs[_0xb600('0x1e')](_0x1e0d12['query'][_0xb600('0x1e')]);}_0x37d982['order']=qs[_0xb600('0x3c')](_0x1e0d12[_0xb600('0x34')][_0xb600('0x3c')]);_0x37d982[_0xb600('0x3d')]=qs[_0xb600('0x35')](_['pick'](_0x1e0d12['query'],_0x28bd0c[_0xb600('0x35')]),_0x1a9065);if(_0x1e0d12[_0xb600('0x34')]['filter']){_0x37d982[_0xb600('0x3d')]=_[_0xb600('0x3e')](_0x37d982[_0xb600('0x3d')],{'$or':_[_0xb600('0x2d')](_0x1a9065,function(_0xe29cfe){if(_0xe29cfe[_0xb600('0x30')]!=='VIRTUAL'){var _0x36d543={};_0x36d543[_0xe29cfe[_0xb600('0x3f')]]={'$like':'%'+_0x1e0d12[_0xb600('0x34')][_0xb600('0x40')]+'%'};return _0x36d543;}})});}_0x37d982=_[_0xb600('0x3e')]({},_0x37d982,_0x1e0d12[_0xb600('0x41')]);var _0x34576c={'where':_0x37d982[_0xb600('0x3d')]};return db[_0xb600('0x42')]['count'](_0x34576c)[_0xb600('0x26')](function(_0x8eb72e){_0x59a485['count']=_0x8eb72e;if(_0x1e0d12[_0xb600('0x34')]['includeAll']){_0x37d982[_0xb600('0x43')]=[{'all':!![]}];}return db[_0xb600('0x42')][_0xb600('0x44')](_0x37d982);})['then'](function(_0x51969d){_0x59a485[_0xb600('0x45')]=_0x51969d;return _0x59a485;})[_0xb600('0x26')](respondWithFilteredResult(_0x43af56,_0x37d982))[_0xb600('0x46')](handleError(_0x43af56,null));};exports[_0xb600('0x47')]=function(_0x19ec15,_0x1bea83){var _0x32bdda={'raw':!![],'where':{'id':_0x19ec15['params']['id']}},_0x2353fa={};_0x2353fa[_0xb600('0x32')]=_[_0xb600('0x33')](db['SquareRecording'][_0xb600('0x2e')]);_0x2353fa['query']=_[_0xb600('0x33')](_0x19ec15[_0xb600('0x34')]);_0x2353fa[_0xb600('0x35')]=_[_0xb600('0x36')](_0x2353fa['model'],_0x2353fa[_0xb600('0x34')]);_0x32bdda['attributes']=_['intersection'](_0x2353fa[_0xb600('0x32')],qs['fields'](_0x19ec15[_0xb600('0x34')][_0xb600('0x38')]));_0x32bdda[_0xb600('0x37')]=_0x32bdda['attributes']['length']?_0x32bdda[_0xb600('0x37')]:_0x2353fa[_0xb600('0x32')];if(_0x19ec15[_0xb600('0x34')][_0xb600('0x48')]){_0x32bdda[_0xb600('0x43')]=[{'all':!![]}];}_0x32bdda=_[_0xb600('0x3e')]({},_0x32bdda,_0x19ec15['options']);return db[_0xb600('0x42')]['find'](_0x32bdda)[_0xb600('0x26')](handleEntityNotFound(_0x1bea83,null))[_0xb600('0x26')](respondWithResult(_0x1bea83,null))[_0xb600('0x46')](handleError(_0x1bea83,null));};exports[_0xb600('0x49')]=function(_0x4985d5,_0x481d88){return db[_0xb600('0x42')][_0xb600('0x49')](_0x4985d5[_0xb600('0x4a')],{})[_0xb600('0x26')](respondWithResult(_0x481d88,0xc9))[_0xb600('0x46')](handleError(_0x481d88,null));};exports['update']=function(_0x25bb8f,_0x4ae4b9){if(_0x25bb8f[_0xb600('0x4a')]['id']){delete _0x25bb8f['body']['id'];}return db[_0xb600('0x42')]['find']({'where':{'id':_0x25bb8f[_0xb600('0x4b')]['id']}})[_0xb600('0x26')](handleEntityNotFound(_0x4ae4b9,null))[_0xb600('0x26')](saveUpdates(_0x25bb8f[_0xb600('0x4a')],null))[_0xb600('0x26')](respondWithResult(_0x4ae4b9,null))[_0xb600('0x46')](handleError(_0x4ae4b9,null));};exports[_0xb600('0x4c')]=function(_0x348b21,_0x36aa03,_0x112d11){var _0x1acd71=require(_0xb600('0x4d'));var _0x500030=![];var _0x8ce7a6={};if(_0x348b21[_0xb600('0x34')][_0xb600('0x30')]&&_0x348b21['query'][_0xb600('0x30')]===_0xb600('0x4e')){_0x8ce7a6[_0xb600('0x4e')]=_0x348b21[_0xb600('0x4b')]['id'];}else{_0x8ce7a6['id']=_0x348b21[_0xb600('0x4b')]['id'];}return db[_0xb600('0x42')][_0xb600('0x4f')]({'where':_0x8ce7a6,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x36aa03,null))[_0xb600('0x26')](function(_0xd5219){if(_0xd5219){var _0x59501d=_0xd5219[_0xb600('0x50')];var _0x1349ab=util['format'](_0xb600('0x51'),_0x59501d);if(fs[_0xb600('0x52')](_0x1349ab)){_0x500030=!![];return _0x1acd71[_0xb600('0x53')](_0x1349ab,_0x59501d,config[_0xb600('0x54')][_0xb600('0x55')])[_0xb600('0x26')](function(){return _0xd5219;});}return _0xd5219;}})[_0xb600('0x26')](function(_0x54133b){if(_0x54133b){var _0x3e7d7f=_0x54133b[_0xb600('0x50')];if(!fs['existsSync'](_0x3e7d7f)){throw new db[(_0xb600('0x56'))][(_0xb600('0x57'))](_0xb600('0x58'));}if(_0x54133b[_0xb600('0x59')]){return _0x36aa03[_0xb600('0x4c')](_0x3e7d7f,_0x54133b[_0xb600('0x59')]+path[_0xb600('0x5a')](_0x3e7d7f),function(){if(_0x500030){fs[_0xb600('0x5b')](_0x3e7d7f);}});}else{return _0x36aa03['download'](_0x3e7d7f,function(_0x52b1a1){if(_0x500030){fs[_0xb600('0x5b')](_0x3e7d7f);}});}}})[_0xb600('0x46')](function(_0x1a12d5){if(_0x1a12d5['message']==='SquareRecording\x20not\x20found'){_0x36aa03[_0xb600('0x1b')](0x194)[_0xb600('0x2b')]('Not\x20found');}else{return handleError(_0x36aa03,null);}});};exports['destroy']=function(_0x3d306a,_0x4cd014){return db['SquareRecording']['find']({'where':{'id':_0x3d306a[_0xb600('0x4b')]['id']}})[_0xb600('0x26')](function(_0x513ac4){if(_[_0xb600('0x5c')](_0x513ac4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x513ac4;})[_0xb600('0x26')](function(_0x413714){var _0xcd9537=_0x413714[_0xb600('0x50')];logger[_0xb600('0x5d')](_0xb600('0x5e'),_0xcd9537);if(!_[_0xb600('0x5c')](_0x413714[_0xb600('0x50')])&&fs[_0xb600('0x52')](_0xcd9537)){logger[_0xb600('0x5d')](_0xb600('0x5f')+_0xcd9537+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb600('0x60')](_0xcd9537);}_0xcd9537=_0xcd9537+'.cypher';if(!_[_0xb600('0x5c')](_0x413714[_0xb600('0x50')])&&fs[_0xb600('0x52')](_0xcd9537)){logger[_0xb600('0x5d')](_0xb600('0x5f')+_0xcd9537+_0xb600('0x61'));fs[_0xb600('0x60')](_0xcd9537);}return _0x413714;})[_0xb600('0x26')](function(_0xf14dee){if(!_0xf14dee)throw new InternalError();return _0xf14dee['destroy']();})[_0xb600('0x26')](function(){_0x4cd014['status'](0xcc)[_0xb600('0x1c')]();})[_0xb600('0x46')](handleError(_0x4cd014,null));};
\ No newline at end of file
+var _0x1f24=['Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','map','SquareRecording','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','keys','intersection','includeAll','create','body','find','params','download','../../components/encryptor','uniqueid','savePath','filename','existsSync','decryptFile','secrets','Sequelize','ValidationError','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil'];(function(_0x36b723,_0x551ed0){var _0x4bf92e=function(_0x475842){while(--_0x475842){_0x36b723['push'](_0x36b723['shift']());}};_0x4bf92e(++_0x551ed0);}(_0x1f24,0x12d));var _0x41f2=function(_0x4dcac7,_0x1027cb){_0x4dcac7=_0x4dcac7-0x0;var _0x29409d=_0x1f24[_0x4dcac7];return _0x29409d;};'use strict';var emlformat=require(_0x41f2('0x0'));var rimraf=require(_0x41f2('0x1'));var zipdir=require(_0x41f2('0x2'));var jsonpatch=require(_0x41f2('0x3'));var rp=require(_0x41f2('0x4'));var moment=require(_0x41f2('0x5'));var BPromise=require(_0x41f2('0x6'));var Mustache=require('mustache');var util=require(_0x41f2('0x7'));var path=require('path');var sox=require(_0x41f2('0x8'));var csv=require(_0x41f2('0x9'));var ejs=require(_0x41f2('0xa'));var fs=require('fs');var fs_extra=require(_0x41f2('0xb'));var _=require(_0x41f2('0xc'));var squel=require(_0x41f2('0xd'));var crypto=require(_0x41f2('0xe'));var jsforce=require(_0x41f2('0xf'));var deskjs=require(_0x41f2('0x10'));var toCsv=require(_0x41f2('0x9'));var querystring=require(_0x41f2('0x11'));var Papa=require(_0x41f2('0x12'));var Redis=require(_0x41f2('0x13'));var authService=require(_0x41f2('0x14'));var qs=require(_0x41f2('0x15'));var as=require(_0x41f2('0x16'));var hardwareService=require(_0x41f2('0x17'));var logger=require(_0x41f2('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x41f2('0x19'));var licenseUtil=require(_0x41f2('0x1a'));var db=require(_0x41f2('0x1b'))['db'];function respondWithStatusCode(_0x4f9c6c,_0x198230){_0x198230=_0x198230||0xcc;return function(_0x5ae09d){if(_0x5ae09d){return _0x4f9c6c['sendStatus'](_0x198230);}return _0x4f9c6c['status'](_0x198230)[_0x41f2('0x1c')]();};}function respondWithResult(_0x530714,_0xc666ea){_0xc666ea=_0xc666ea||0xc8;return function(_0x12e6f6){if(_0x12e6f6){return _0x530714['status'](_0xc666ea)[_0x41f2('0x1d')](_0x12e6f6);}};}function respondWithFilteredResult(_0x37cc83,_0x137432){return function(_0x32df26){if(_0x32df26){var _0x36d333=typeof _0x137432[_0x41f2('0x1e')]===_0x41f2('0x1f')&&typeof _0x137432[_0x41f2('0x20')]===_0x41f2('0x1f');var _0x4aa754=_0x32df26[_0x41f2('0x21')];var _0x677c7d=_0x36d333?0x0:_0x137432['offset'];var _0x1ca77c=_0x36d333?_0x32df26['count']:_0x137432['offset']+_0x137432[_0x41f2('0x20')];var _0x120d25;if(_0x1ca77c>=_0x4aa754){_0x1ca77c=_0x4aa754;_0x120d25=0xc8;}else{_0x120d25=0xce;}_0x37cc83[_0x41f2('0x22')](_0x120d25);return _0x37cc83[_0x41f2('0x23')]('Content-Range',_0x677c7d+'-'+_0x1ca77c+'/'+_0x4aa754)[_0x41f2('0x1d')](_0x32df26);}return null;};}function patchUpdates(_0xfa52ed){return function(_0x36a20f){try{jsonpatch[_0x41f2('0x24')](_0x36a20f,_0xfa52ed,!![]);}catch(_0x3ad6d5){return BPromise[_0x41f2('0x25')](_0x3ad6d5);}return _0x36a20f[_0x41f2('0x26')]();};}function saveUpdates(_0x1df3c6,_0x216bca){return function(_0x51c7ef){if(_0x51c7ef){return _0x51c7ef[_0x41f2('0x27')](_0x1df3c6)[_0x41f2('0x28')](function(_0x4b2717){return _0x4b2717;});}return null;};}function removeEntity(_0x246752,_0x29d010){return function(_0x41fc99){if(_0x41fc99){return _0x41fc99[_0x41f2('0x29')]()['then'](function(){_0x246752['status'](0xcc)[_0x41f2('0x1c')]();});}};}function handleEntityNotFound(_0xc4d4dd,_0x5c350a){return function(_0x45c97a){if(!_0x45c97a){_0xc4d4dd['sendStatus'](0x194);}return _0x45c97a;};}function handleError(_0x6dbcb9,_0x5bb45c){_0x5bb45c=_0x5bb45c||0x1f4;return function(_0x417c05){logger['error'](_0x417c05[_0x41f2('0x2a')]);if(_0x417c05[_0x41f2('0x2b')]){delete _0x417c05['name'];}_0x6dbcb9[_0x41f2('0x22')](_0x5bb45c)[_0x41f2('0x2c')](_0x417c05);};}exports['index']=function(_0x488f1b,_0x59eacd){var _0x5ea83d={},_0x2690d9={},_0x2e4689={'count':0x0,'rows':[]};var _0x4deb06=_[_0x41f2('0x2d')](db[_0x41f2('0x2e')][_0x41f2('0x2f')],function(_0x18539e){return{'name':_0x18539e['fieldName'],'type':_0x18539e[_0x41f2('0x30')][_0x41f2('0x31')]};});_0x2690d9[_0x41f2('0x32')]=_[_0x41f2('0x2d')](_0x4deb06,'name');_0x2690d9[_0x41f2('0x33')]=_['keys'](_0x488f1b[_0x41f2('0x33')]);_0x2690d9[_0x41f2('0x34')]=_['intersection'](_0x2690d9[_0x41f2('0x32')],_0x2690d9[_0x41f2('0x33')]);_0x5ea83d[_0x41f2('0x35')]=_['intersection'](_0x2690d9[_0x41f2('0x32')],qs[_0x41f2('0x36')](_0x488f1b[_0x41f2('0x33')][_0x41f2('0x36')]));_0x5ea83d[_0x41f2('0x35')]=_0x5ea83d[_0x41f2('0x35')][_0x41f2('0x37')]?_0x5ea83d['attributes']:_0x2690d9[_0x41f2('0x32')];if(!_0x488f1b['query'][_0x41f2('0x38')](_0x41f2('0x39'))){_0x5ea83d[_0x41f2('0x20')]=qs[_0x41f2('0x20')](_0x488f1b[_0x41f2('0x33')][_0x41f2('0x20')]);_0x5ea83d[_0x41f2('0x1e')]=qs[_0x41f2('0x1e')](_0x488f1b['query'][_0x41f2('0x1e')]);}_0x5ea83d[_0x41f2('0x3a')]=qs[_0x41f2('0x3b')](_0x488f1b[_0x41f2('0x33')][_0x41f2('0x3b')]);_0x5ea83d[_0x41f2('0x3c')]=qs[_0x41f2('0x34')](_[_0x41f2('0x3d')](_0x488f1b[_0x41f2('0x33')],_0x2690d9[_0x41f2('0x34')]),_0x4deb06);if(_0x488f1b['query'][_0x41f2('0x3e')]){_0x5ea83d[_0x41f2('0x3c')]=_[_0x41f2('0x3f')](_0x5ea83d[_0x41f2('0x3c')],{'$or':_[_0x41f2('0x2d')](_0x4deb06,function(_0x5452be){if(_0x5452be[_0x41f2('0x30')]!=='VIRTUAL'){var _0x337aa5={};_0x337aa5[_0x5452be[_0x41f2('0x2b')]]={'$like':'%'+_0x488f1b['query'][_0x41f2('0x3e')]+'%'};return _0x337aa5;}})});}_0x5ea83d=_[_0x41f2('0x3f')]({},_0x5ea83d,_0x488f1b[_0x41f2('0x40')]);var _0x2bebf3={'where':_0x5ea83d[_0x41f2('0x3c')]};return db['SquareRecording'][_0x41f2('0x21')](_0x2bebf3)[_0x41f2('0x28')](function(_0x120117){_0x2e4689['count']=_0x120117;if(_0x488f1b[_0x41f2('0x33')]['includeAll']){_0x5ea83d[_0x41f2('0x41')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x5ea83d);})[_0x41f2('0x28')](function(_0x3caae7){_0x2e4689[_0x41f2('0x42')]=_0x3caae7;return _0x2e4689;})[_0x41f2('0x28')](respondWithFilteredResult(_0x59eacd,_0x5ea83d))[_0x41f2('0x43')](handleError(_0x59eacd,null));};exports[_0x41f2('0x44')]=function(_0x1f9468,_0x2357b3){var _0x577562={'raw':!![],'where':{'id':_0x1f9468['params']['id']}},_0x40ff11={};_0x40ff11['model']=_[_0x41f2('0x45')](db['SquareRecording'][_0x41f2('0x2f')]);_0x40ff11[_0x41f2('0x33')]=_[_0x41f2('0x45')](_0x1f9468['query']);_0x40ff11[_0x41f2('0x34')]=_[_0x41f2('0x46')](_0x40ff11['model'],_0x40ff11['query']);_0x577562[_0x41f2('0x35')]=_[_0x41f2('0x46')](_0x40ff11[_0x41f2('0x32')],qs['fields'](_0x1f9468[_0x41f2('0x33')][_0x41f2('0x36')]));_0x577562[_0x41f2('0x35')]=_0x577562['attributes'][_0x41f2('0x37')]?_0x577562[_0x41f2('0x35')]:_0x40ff11[_0x41f2('0x32')];if(_0x1f9468[_0x41f2('0x33')][_0x41f2('0x47')]){_0x577562[_0x41f2('0x41')]=[{'all':!![]}];}_0x577562=_[_0x41f2('0x3f')]({},_0x577562,_0x1f9468[_0x41f2('0x40')]);return db['SquareRecording']['find'](_0x577562)[_0x41f2('0x28')](handleEntityNotFound(_0x2357b3,null))['then'](respondWithResult(_0x2357b3,null))['catch'](handleError(_0x2357b3,null));};exports[_0x41f2('0x48')]=function(_0x31f28d,_0x1d013){return db[_0x41f2('0x2e')][_0x41f2('0x48')](_0x31f28d[_0x41f2('0x49')],{})[_0x41f2('0x28')](respondWithResult(_0x1d013,0xc9))[_0x41f2('0x43')](handleError(_0x1d013,null));};exports[_0x41f2('0x27')]=function(_0x1389b7,_0x4f6306){if(_0x1389b7['body']['id']){delete _0x1389b7['body']['id'];}return db[_0x41f2('0x2e')][_0x41f2('0x4a')]({'where':{'id':_0x1389b7[_0x41f2('0x4b')]['id']}})[_0x41f2('0x28')](handleEntityNotFound(_0x4f6306,null))[_0x41f2('0x28')](saveUpdates(_0x1389b7['body'],null))[_0x41f2('0x28')](respondWithResult(_0x4f6306,null))[_0x41f2('0x43')](handleError(_0x4f6306,null));};exports[_0x41f2('0x4c')]=function(_0x548228,_0x1bd7e3,_0x3dbd3f){var _0x5e1681=require(_0x41f2('0x4d'));var _0x25da0a=![];var _0x58eb77={};if(_0x548228['query'][_0x41f2('0x30')]&&_0x548228['query'][_0x41f2('0x30')]===_0x41f2('0x4e')){_0x58eb77[_0x41f2('0x4e')]=_0x548228[_0x41f2('0x4b')]['id'];}else{_0x58eb77['id']=_0x548228[_0x41f2('0x4b')]['id'];}return db[_0x41f2('0x2e')][_0x41f2('0x4a')]({'where':_0x58eb77,'attributes':['id',_0x41f2('0x4f'),_0x41f2('0x50')],'raw':!![]})[_0x41f2('0x28')](handleEntityNotFound(_0x1bd7e3,null))[_0x41f2('0x28')](function(_0x37ba80){if(_0x37ba80){var _0x304cf1=_0x37ba80['savePath'];var _0x56740a=util['format']('%s.cypher',_0x304cf1);if(fs[_0x41f2('0x51')](_0x56740a)){_0x25da0a=!![];return _0x5e1681[_0x41f2('0x52')](_0x56740a,_0x304cf1,config[_0x41f2('0x53')]['recording'])[_0x41f2('0x28')](function(){return _0x37ba80;});}return _0x37ba80;}})[_0x41f2('0x28')](function(_0x34c565){if(_0x34c565){var _0xe39652=_0x34c565[_0x41f2('0x4f')];if(!fs[_0x41f2('0x51')](_0xe39652)){throw new db[(_0x41f2('0x54'))][(_0x41f2('0x55'))]('SquareRecording\x20not\x20found');}if(_0x34c565[_0x41f2('0x50')]){return _0x1bd7e3[_0x41f2('0x4c')](_0xe39652,_0x34c565[_0x41f2('0x50')]+path['extname'](_0xe39652),function(){if(_0x25da0a){fs[_0x41f2('0x56')](_0xe39652);}});}else{return _0x1bd7e3[_0x41f2('0x4c')](_0xe39652,function(_0x382e23){if(_0x25da0a){fs[_0x41f2('0x56')](_0xe39652);}});}}})[_0x41f2('0x43')](function(_0x119293){if(_0x119293[_0x41f2('0x57')]===_0x41f2('0x58')){_0x1bd7e3[_0x41f2('0x22')](0x194)[_0x41f2('0x2c')](_0x41f2('0x59'));}else{return handleError(_0x1bd7e3,null);}});};exports['destroy']=function(_0x4f5cf3,_0x455ab7){return db[_0x41f2('0x2e')]['find']({'where':{'id':_0x4f5cf3['params']['id']}})[_0x41f2('0x28')](function(_0x5ba8a0){if(_[_0x41f2('0x5a')](_0x5ba8a0)){throw new ReferenceError(_0x41f2('0x5b'));}return _0x5ba8a0;})[_0x41f2('0x28')](function(_0x5686e2){var _0x55c362=_0x5686e2[_0x41f2('0x4f')];logger['info'](_0x41f2('0x5c'),_0x55c362);if(!_[_0x41f2('0x5a')](_0x5686e2[_0x41f2('0x4f')])&&fs[_0x41f2('0x51')](_0x55c362)){logger[_0x41f2('0x5d')]('File:\x20\x22'+_0x55c362+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x41f2('0x5e')](_0x55c362);}_0x55c362=_0x55c362+_0x41f2('0x5f');if(!_['isNil'](_0x5686e2[_0x41f2('0x4f')])&&fs[_0x41f2('0x51')](_0x55c362)){logger['info'](_0x41f2('0x60')+_0x55c362+_0x41f2('0x61'));fs[_0x41f2('0x5e')](_0x55c362);}return _0x5686e2;})['then'](function(_0x157958){if(!_0x157958)throw new InternalError();return _0x157958['destroy']();})[_0x41f2('0x28')](function(){_0x455ab7[_0x41f2('0x22')](0xcc)['end']();})[_0x41f2('0x43')](handleError(_0x455ab7,null));};
\ No newline at end of file
index 4a3dcd1..89887e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab00=['SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','exports','define'];(function(_0x43954c,_0x1964f){var _0x3a11de=function(_0x9529d1){while(--_0x9529d1){_0x43954c['push'](_0x43954c['shift']());}};_0x3a11de(++_0x1964f);}(_0xab00,0x1b9));var _0x0ab0=function(_0x3d6c0a,_0x4584b1){_0x3d6c0a=_0x3d6c0a-0x0;var _0x5e831e=_0xab00[_0x3d6c0a];return _0x5e831e;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var logger=require(_0x0ab0('0x2'))('api');var moment=require(_0x0ab0('0x3'));var BPromise=require(_0x0ab0('0x4'));var rp=require(_0x0ab0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ab0('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ab0('0x7'));module[_0x0ab0('0x8')]=function(_0x2a99f4,_0x2ed2f8){return _0x2a99f4[_0x0ab0('0x9')](_0x0ab0('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7de=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports'];(function(_0x283b82,_0x46d401){var _0x34fbeb=function(_0x43d376){while(--_0x43d376){_0x283b82['push'](_0x283b82['shift']());}};_0x34fbeb(++_0x46d401);}(_0xb7de,0xc7));var _0xeb7d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xb7de[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))('api');var moment=require(_0xeb7d('0x3'));var BPromise=require(_0xeb7d('0x4'));var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0xadf4,_0x433c32){return _0xadf4[_0xeb7d('0xa')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ff9bc5a..738f20d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20cc=['jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','CreateSquareRecording','SquareRecording','create','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a307e,_0x216fe7){var _0x548395=function(_0x28aca8){while(--_0x28aca8){_0x3a307e['push'](_0x3a307e['shift']());}};_0x548395(++_0x216fe7);}(_0x20cc,0x19b));var _0xc20c=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x20cc[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var moment=require(_0xc20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc20c('0x3'));var fs=require('fs');var Redis=require(_0xc20c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc20c('0x5'));var logger=require(_0xc20c('0x6'))(_0xc20c('0x7'));var config=require(_0xc20c('0x8'));var jayson=require(_0xc20c('0x9'));var client=jayson[_0xc20c('0xa')][_0xc20c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8ae4,_0x475183,_0x370d78){return new BPromise(function(_0x553ad7,_0x362be9){return client[_0xc20c('0xc')](_0x4c8ae4,_0x370d78)[_0xc20c('0xd')](function(_0x4c792c){logger['info'](_0xc20c('0xe'),_0x475183,'request\x20sent');logger[_0xc20c('0xf')](_0xc20c('0x10'),_0x475183,_0xc20c('0x11'),JSON[_0xc20c('0x12')](_0x4c792c));if(_0x4c792c['error']){if(_0x4c792c['error'][_0xc20c('0x13')]===0x1f4){logger[_0xc20c('0x14')]('SquareRecording,\x20%s,\x20%s',_0x475183,_0x4c792c[_0xc20c('0x14')][_0xc20c('0x15')]);return _0x362be9(_0x4c792c[_0xc20c('0x14')][_0xc20c('0x15')]);}logger[_0xc20c('0x14')](_0xc20c('0xe'),_0x475183,_0x4c792c[_0xc20c('0x14')][_0xc20c('0x15')]);return _0x553ad7(_0x4c792c['error'][_0xc20c('0x15')]);}else{logger[_0xc20c('0x16')](_0xc20c('0xe'),_0x475183,_0xc20c('0x11'));_0x553ad7(_0x4c792c[_0xc20c('0x17')][_0xc20c('0x15')]);}})[_0xc20c('0x18')](function(_0x3f813b){logger['error'](_0xc20c('0xe'),_0x475183,_0x3f813b);_0x362be9(_0x3f813b);});});}exports[_0xc20c('0x19')]=function(_0x330ee8){var _0x39ab6c=this;return new Promise(function(_0x263ced,_0x42afa3){return db[_0xc20c('0x1a')][_0xc20c('0x1b')](_0x330ee8['body'],{'raw':_0x330ee8['options']?_0x330ee8['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x188e22){logger['info'](_0xc20c('0x19'),_0x330ee8);logger['debug']('CreateSquareRecording',_0x330ee8,JSON['stringify'](_0x188e22));_0x263ced(_0x188e22);})[_0xc20c('0x18')](function(_0x3399f7){logger[_0xc20c('0x14')]('CreateSquareRecording',_0x3399f7[_0xc20c('0x15')],_0x330ee8);_0x42afa3(_0x39ab6c[_0xc20c('0x14')](0x1f4,_0x3399f7[_0xc20c('0x15')]));});});};
\ No newline at end of file
+var _0xbbf3=['catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','create','body','options','raw','then','CreateSquareRecording'];(function(_0x15cb27,_0x33316d){var _0x5ba020=function(_0x10458e){while(--_0x10458e){_0x15cb27['push'](_0x15cb27['shift']());}};_0x5ba020(++_0x33316d);}(_0xbbf3,0xeb));var _0x3bbf=function(_0x583c2a,_0x3ac24e){_0x583c2a=_0x583c2a-0x0;var _0x13eba6=_0xbbf3[_0x583c2a];return _0x13eba6;};'use strict';var _=require(_0x3bbf('0x0'));var util=require('util');var moment=require(_0x3bbf('0x1'));var BPromise=require('bluebird');var rs=require(_0x3bbf('0x2'));var fs=require('fs');var Redis=require(_0x3bbf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bbf('0x4'));var logger=require(_0x3bbf('0x5'))(_0x3bbf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3bbf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27beec,_0xa38516,_0x17454f){return new BPromise(function(_0x3785fa,_0x690ed8){return client[_0x3bbf('0x8')](_0x27beec,_0x17454f)['then'](function(_0x141b95){logger[_0x3bbf('0x9')](_0x3bbf('0xa'),_0xa38516,'request\x20sent');logger[_0x3bbf('0xb')](_0x3bbf('0xc'),_0xa38516,_0x3bbf('0xd'),JSON[_0x3bbf('0xe')](_0x141b95));if(_0x141b95[_0x3bbf('0xf')]){if(_0x141b95[_0x3bbf('0xf')][_0x3bbf('0x10')]===0x1f4){logger[_0x3bbf('0xf')](_0x3bbf('0xa'),_0xa38516,_0x141b95[_0x3bbf('0xf')][_0x3bbf('0x11')]);return _0x690ed8(_0x141b95[_0x3bbf('0xf')]['message']);}logger['error'](_0x3bbf('0xa'),_0xa38516,_0x141b95[_0x3bbf('0xf')][_0x3bbf('0x11')]);return _0x3785fa(_0x141b95[_0x3bbf('0xf')]['message']);}else{logger[_0x3bbf('0x9')](_0x3bbf('0xa'),_0xa38516,_0x3bbf('0xd'));_0x3785fa(_0x141b95[_0x3bbf('0x12')]['message']);}})['catch'](function(_0x1809e8){logger['error'](_0x3bbf('0xa'),_0xa38516,_0x1809e8);_0x690ed8(_0x1809e8);});});}exports['CreateSquareRecording']=function(_0x50330f){var _0x48e638=this;return new Promise(function(_0x4ca215,_0x25b67e){return db['SquareRecording'][_0x3bbf('0x13')](_0x50330f[_0x3bbf('0x14')],{'raw':_0x50330f[_0x3bbf('0x15')]?_0x50330f['options'][_0x3bbf('0x16')]===undefined?!![]:![]:!![]})[_0x3bbf('0x17')](function(_0xb0e9cd){logger['info']('CreateSquareRecording',_0x50330f);logger[_0x3bbf('0xb')](_0x3bbf('0x18'),_0x50330f,JSON[_0x3bbf('0xe')](_0xb0e9cd));_0x4ca215(_0xb0e9cd);})[_0x3bbf('0x19')](function(_0x4dbe58){logger[_0x3bbf('0xf')](_0x3bbf('0x18'),_0x4dbe58[_0x3bbf('0x11')],_0x50330f);_0x25b67e(_0x48e638[_0x3bbf('0xf')](0x1f4,_0x4dbe58[_0x3bbf('0x11')]));});});};
\ No newline at end of file
index c364758..4c0c9cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x55336a,_0x240d59){var _0x28ceb3=function(_0x399d5c){while(--_0x399d5c){_0x55336a['push'](_0x55336a['shift']());}};_0x28ceb3(++_0x240d59);}(_0xe706,0xa3));var _0x6e70=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe706[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+var _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(_0x5ed024,_0x20fcac){var _0x529b32=function(_0x373b27){while(--_0x373b27){_0x5ed024['push'](_0x5ed024['shift']());}};_0x529b32(++_0x20fcac);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 8664b17..614150c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc794=['STRING','DATE','exports'];(function(_0x4497c9,_0x2a34b1){var _0x30a917=function(_0x5b0558){while(--_0x5b0558){_0x4497c9['push'](_0x4497c9['shift']());}};_0x30a917(++_0x2a34b1);}(_0xc794,0x95));var _0x4c79=function(_0x262ea8,_0x2e2235){_0x262ea8=_0x262ea8-0x0;var _0x23fa04=_0xc794[_0x262ea8];return _0x23fa04;};'use strict';var Sequelize=require('sequelize');module[_0x4c79('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4c79('0x1')]},'channel':{'type':Sequelize[_0x4c79('0x1')]},'language':{'type':Sequelize[_0x4c79('0x1')]},'type':{'type':Sequelize[_0x4c79('0x1')]},'uniqueid':{'type':Sequelize[_0x4c79('0x1')]},'version':{'type':Sequelize[_0x4c79('0x1')]},'callerid':{'type':Sequelize[_0x4c79('0x1')]},'calleridname':{'type':Sequelize[_0x4c79('0x1')]},'callingpres':{'type':Sequelize[_0x4c79('0x1')]},'callingani2':{'type':Sequelize[_0x4c79('0x1')]},'callington':{'type':Sequelize[_0x4c79('0x1')]},'callingtns':{'type':Sequelize[_0x4c79('0x1')]},'dnid':{'type':Sequelize[_0x4c79('0x1')]},'rdnis':{'type':Sequelize[_0x4c79('0x1')]},'context':{'type':Sequelize[_0x4c79('0x1')]},'extension':{'type':Sequelize[_0x4c79('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x4c79('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x4c79('0x1')]},'project_name':{'type':Sequelize[_0x4c79('0x1')]},'joinAt':{'type':Sequelize[_0x4c79('0x2')]},'leaveAt':{'type':Sequelize[_0x4c79('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6a47=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x37d9b2,_0x21e0a9){var _0x1bc4d1=function(_0x27bcf4){while(--_0x27bcf4){_0x37d9b2['push'](_0x37d9b2['shift']());}};_0x1bc4d1(++_0x21e0a9);}(_0x6a47,0x112));var _0x76a4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6a47[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x76a4('0x0'));module[_0x76a4('0x1')]={'network':{'type':Sequelize[_0x76a4('0x2')]},'network_script':{'type':Sequelize[_0x76a4('0x2')]},'request':{'type':Sequelize[_0x76a4('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x76a4('0x2')]},'type':{'type':Sequelize[_0x76a4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x76a4('0x2')]},'callerid':{'type':Sequelize[_0x76a4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x76a4('0x2')]},'callingani2':{'type':Sequelize[_0x76a4('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x76a4('0x2')]},'dnid':{'type':Sequelize[_0x76a4('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76a4('0x2')]},'extension':{'type':Sequelize[_0x76a4('0x2')]},'priority':{'type':Sequelize[_0x76a4('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76a4('0x2')]},'threadid':{'type':Sequelize[_0x76a4('0x2')]},'project_name':{'type':Sequelize[_0x76a4('0x2')]},'joinAt':{'type':Sequelize[_0x76a4('0x3')]},'leaveAt':{'type':Sequelize[_0x76a4('0x3')]},'bot':{'type':Sequelize[_0x76a4('0x4')],'defaultValue':![]}};
\ No newline at end of file
index fbf9a4b..87eecb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b4=['findAll','rows','rawAttributes','merge','find','catch','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','name','send','index','SquareReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd7b4,0x1c6));var _0x4d7b=function(_0x1eced4,_0xc5070f){_0x1eced4=_0x1eced4-0x0;var _0x1a91e5=_0xd7b4[_0x1eced4];return _0x1a91e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d7b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d7b('0x1'));var rp=require(_0x4d7b('0x2'));var moment=require(_0x4d7b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4d7b('0x4'));var util=require(_0x4d7b('0x5'));var path=require(_0x4d7b('0x6'));var sox=require('sox');var csv=require(_0x4d7b('0x7'));var ejs=require(_0x4d7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4d7b('0x9'));var _=require(_0x4d7b('0xa'));var squel=require(_0x4d7b('0xb'));var crypto=require(_0x4d7b('0xc'));var jsforce=require(_0x4d7b('0xd'));var deskjs=require(_0x4d7b('0xe'));var toCsv=require(_0x4d7b('0x7'));var querystring=require(_0x4d7b('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d7b('0x10'));var authService=require(_0x4d7b('0x11'));var qs=require(_0x4d7b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d7b('0x13'))(_0x4d7b('0x14'));var utils=require(_0x4d7b('0x15'));var config=require(_0x4d7b('0x16'));var licenseUtil=require(_0x4d7b('0x17'));var db=require(_0x4d7b('0x18'))['db'];function respondWithStatusCode(_0x3014c5,_0x4e5a95){_0x4e5a95=_0x4e5a95||0xcc;return function(_0x5a924f){if(_0x5a924f){return _0x3014c5[_0x4d7b('0x19')](_0x4e5a95);}return _0x3014c5[_0x4d7b('0x1a')](_0x4e5a95)[_0x4d7b('0x1b')]();};}function respondWithResult(_0x360b87,_0x5ed89f){_0x5ed89f=_0x5ed89f||0xc8;return function(_0x4558ab){if(_0x4558ab){return _0x360b87[_0x4d7b('0x1a')](_0x5ed89f)[_0x4d7b('0x1c')](_0x4558ab);}};}function respondWithFilteredResult(_0x1639a8,_0x493b07){return function(_0x5633fc){if(_0x5633fc){var _0x34b82d=typeof _0x493b07[_0x4d7b('0x1d')]==='undefined'&&typeof _0x493b07['limit']===_0x4d7b('0x1e');var _0x324740=_0x5633fc[_0x4d7b('0x1f')];var _0x259c5b=_0x34b82d?0x0:_0x493b07[_0x4d7b('0x1d')];var _0x13895e=_0x34b82d?_0x5633fc[_0x4d7b('0x1f')]:_0x493b07[_0x4d7b('0x1d')]+_0x493b07[_0x4d7b('0x20')];var _0x34fced;if(_0x13895e>=_0x324740){_0x13895e=_0x324740;_0x34fced=0xc8;}else{_0x34fced=0xce;}_0x1639a8[_0x4d7b('0x1a')](_0x34fced);return _0x1639a8[_0x4d7b('0x21')]('Content-Range',_0x259c5b+'-'+_0x13895e+'/'+_0x324740)[_0x4d7b('0x1c')](_0x5633fc);}return null;};}function patchUpdates(_0x3ab195){return function(_0x72a1ed){try{jsonpatch[_0x4d7b('0x22')](_0x72a1ed,_0x3ab195,!![]);}catch(_0x5d178b){return BPromise[_0x4d7b('0x23')](_0x5d178b);}return _0x72a1ed[_0x4d7b('0x24')]();};}function saveUpdates(_0x5b20af,_0xb48cf2){return function(_0x1019dc){if(_0x1019dc){return _0x1019dc[_0x4d7b('0x25')](_0x5b20af)[_0x4d7b('0x26')](function(_0x311f7d){return _0x311f7d;});}return null;};}function removeEntity(_0x1a27cc,_0xdd2d29){return function(_0x1692a7){if(_0x1692a7){return _0x1692a7['destroy']()[_0x4d7b('0x26')](function(){_0x1a27cc['status'](0xcc)[_0x4d7b('0x1b')]();});}};}function handleEntityNotFound(_0xbebeee,_0x5deea5){return function(_0x56f2a4){if(!_0x56f2a4){_0xbebeee[_0x4d7b('0x19')](0x194);}return _0x56f2a4;};}function handleError(_0x48542a,_0x2594d7){_0x2594d7=_0x2594d7||0x1f4;return function(_0x3672c7){logger['error'](_0x3672c7['stack']);if(_0x3672c7[_0x4d7b('0x27')]){delete _0x3672c7[_0x4d7b('0x27')];}_0x48542a[_0x4d7b('0x1a')](_0x2594d7)[_0x4d7b('0x28')](_0x3672c7);};}exports[_0x4d7b('0x29')]=function(_0x5b3dcd,_0xbec2c){var _0x1f13fe={},_0x5958ba={},_0xea06f5={'count':0x0,'rows':[]};var _0x465828=_['map'](db[_0x4d7b('0x2a')]['rawAttributes'],function(_0x2a8f87){return{'name':_0x2a8f87[_0x4d7b('0x2b')],'type':_0x2a8f87[_0x4d7b('0x2c')]['key']};});_0x5958ba[_0x4d7b('0x2d')]=_[_0x4d7b('0x2e')](_0x465828,_0x4d7b('0x27'));_0x5958ba[_0x4d7b('0x2f')]=_[_0x4d7b('0x30')](_0x5b3dcd[_0x4d7b('0x2f')]);_0x5958ba[_0x4d7b('0x31')]=_[_0x4d7b('0x32')](_0x5958ba[_0x4d7b('0x2d')],_0x5958ba['query']);_0x1f13fe[_0x4d7b('0x33')]=_['intersection'](_0x5958ba[_0x4d7b('0x2d')],qs[_0x4d7b('0x34')](_0x5b3dcd[_0x4d7b('0x2f')][_0x4d7b('0x34')]));_0x1f13fe[_0x4d7b('0x33')]=_0x1f13fe[_0x4d7b('0x33')][_0x4d7b('0x35')]?_0x1f13fe[_0x4d7b('0x33')]:_0x5958ba[_0x4d7b('0x2d')];if(!_0x5b3dcd['query']['hasOwnProperty'](_0x4d7b('0x36'))){_0x1f13fe['limit']=qs[_0x4d7b('0x20')](_0x5b3dcd[_0x4d7b('0x2f')][_0x4d7b('0x20')]);_0x1f13fe['offset']=qs['offset'](_0x5b3dcd['query'][_0x4d7b('0x1d')]);}_0x1f13fe[_0x4d7b('0x37')]=qs[_0x4d7b('0x38')](_0x5b3dcd[_0x4d7b('0x2f')]['sort']);_0x1f13fe[_0x4d7b('0x39')]=qs['filters'](_[_0x4d7b('0x3a')](_0x5b3dcd['query'],_0x5958ba['filters']),_0x465828);if(_0x5b3dcd['query'][_0x4d7b('0x3b')]){_0x1f13fe[_0x4d7b('0x39')]=_['merge'](_0x1f13fe['where'],{'$or':_[_0x4d7b('0x2e')](_0x465828,function(_0x3244fd){if(_0x3244fd[_0x4d7b('0x2c')]!==_0x4d7b('0x3c')){var _0x196642={};_0x196642[_0x3244fd[_0x4d7b('0x27')]]={'$like':'%'+_0x5b3dcd[_0x4d7b('0x2f')][_0x4d7b('0x3b')]+'%'};return _0x196642;}})});}_0x1f13fe=_['merge']({},_0x1f13fe,_0x5b3dcd[_0x4d7b('0x3d')]);var _0x23d043={'where':_0x1f13fe[_0x4d7b('0x39')]};return db[_0x4d7b('0x2a')]['count'](_0x23d043)[_0x4d7b('0x26')](function(_0x311275){_0xea06f5[_0x4d7b('0x1f')]=_0x311275;if(_0x5b3dcd[_0x4d7b('0x2f')][_0x4d7b('0x3e')]){_0x1f13fe[_0x4d7b('0x3f')]=[{'all':!![]}];}return db[_0x4d7b('0x2a')][_0x4d7b('0x40')](_0x1f13fe);})[_0x4d7b('0x26')](function(_0x18a016){_0xea06f5[_0x4d7b('0x41')]=_0x18a016;return _0xea06f5;})[_0x4d7b('0x26')](respondWithFilteredResult(_0xbec2c,_0x1f13fe))['catch'](handleError(_0xbec2c,null));};exports['show']=function(_0x5539a2,_0x2c3711){var _0x2d4b7a={'raw':!![],'where':{'id':_0x5539a2['params']['id']}},_0x3a8320={};_0x3a8320[_0x4d7b('0x2d')]=_[_0x4d7b('0x30')](db[_0x4d7b('0x2a')][_0x4d7b('0x42')]);_0x3a8320[_0x4d7b('0x2f')]=_[_0x4d7b('0x30')](_0x5539a2['query']);_0x3a8320[_0x4d7b('0x31')]=_[_0x4d7b('0x32')](_0x3a8320[_0x4d7b('0x2d')],_0x3a8320['query']);_0x2d4b7a[_0x4d7b('0x33')]=_['intersection'](_0x3a8320[_0x4d7b('0x2d')],qs[_0x4d7b('0x34')](_0x5539a2['query'][_0x4d7b('0x34')]));_0x2d4b7a[_0x4d7b('0x33')]=_0x2d4b7a['attributes'][_0x4d7b('0x35')]?_0x2d4b7a[_0x4d7b('0x33')]:_0x3a8320['model'];if(_0x5539a2[_0x4d7b('0x2f')]['includeAll']){_0x2d4b7a['include']=[{'all':!![]}];}_0x2d4b7a=_[_0x4d7b('0x43')]({},_0x2d4b7a,_0x5539a2[_0x4d7b('0x3d')]);return db['SquareReport'][_0x4d7b('0x44')](_0x2d4b7a)['then'](handleEntityNotFound(_0x2c3711,null))['then'](respondWithResult(_0x2c3711,null))[_0x4d7b('0x45')](handleError(_0x2c3711,null));};exports[_0x4d7b('0x46')]=function(_0x3fe10a,_0x5b0507){return db[_0x4d7b('0x2a')][_0x4d7b('0x46')](_0x3fe10a[_0x4d7b('0x47')],{})[_0x4d7b('0x26')](respondWithResult(_0x5b0507,0xc9))['catch'](handleError(_0x5b0507,null));};exports[_0x4d7b('0x25')]=function(_0x1958f0,_0x524d8c){if(_0x1958f0[_0x4d7b('0x47')]['id']){delete _0x1958f0[_0x4d7b('0x47')]['id'];}return db[_0x4d7b('0x2a')]['find']({'where':{'id':_0x1958f0['params']['id']}})['then'](handleEntityNotFound(_0x524d8c,null))[_0x4d7b('0x26')](saveUpdates(_0x1958f0[_0x4d7b('0x47')],null))[_0x4d7b('0x26')](respondWithResult(_0x524d8c,null))[_0x4d7b('0x45')](handleError(_0x524d8c,null));};exports[_0x4d7b('0x48')]=function(_0x27210c,_0x33ce0e){return db[_0x4d7b('0x2a')][_0x4d7b('0x44')]({'where':{'id':_0x27210c['params']['id']}})['then'](handleEntityNotFound(_0x33ce0e,null))['then'](removeEntity(_0x33ce0e,null))[_0x4d7b('0x45')](handleError(_0x33ce0e,null));};exports['describe']=function(_0x3e8c82,_0x268fee){return db[_0x4d7b('0x2a')][_0x4d7b('0x49')]()[_0x4d7b('0x26')](respondWithResult(_0x268fee,null))['catch'](handleError(_0x268fee,null));};
\ No newline at end of file
+var _0x06c0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x57df66,_0x2ee003){var _0x156d3c=function(_0x575776){while(--_0x575776){_0x57df66['push'](_0x57df66['shift']());}};_0x156d3c(++_0x2ee003);}(_0x06c0,0xcd));var _0x006c=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x06c0[_0x521929];return _0x632436;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x006c('0x0'));var zipdir=require(_0x006c('0x1'));var jsonpatch=require(_0x006c('0x2'));var rp=require(_0x006c('0x3'));var moment=require(_0x006c('0x4'));var BPromise=require(_0x006c('0x5'));var Mustache=require(_0x006c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x006c('0x7'));var csv=require(_0x006c('0x8'));var ejs=require(_0x006c('0x9'));var fs=require('fs');var fs_extra=require(_0x006c('0xa'));var _=require('lodash');var squel=require(_0x006c('0xb'));var crypto=require(_0x006c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x006c('0xd'));var toCsv=require(_0x006c('0x8'));var querystring=require('querystring');var Papa=require(_0x006c('0xe'));var Redis=require(_0x006c('0xf'));var authService=require(_0x006c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x006c('0x11'));var hardwareService=require(_0x006c('0x12'));var logger=require('../../config/logger')(_0x006c('0x13'));var utils=require(_0x006c('0x14'));var config=require(_0x006c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x427219,_0x438258){_0x438258=_0x438258||0xcc;return function(_0x59e235){if(_0x59e235){return _0x427219[_0x006c('0x16')](_0x438258);}return _0x427219[_0x006c('0x17')](_0x438258)[_0x006c('0x18')]();};}function respondWithResult(_0x19ef87,_0x481d49){_0x481d49=_0x481d49||0xc8;return function(_0x4ce27f){if(_0x4ce27f){return _0x19ef87[_0x006c('0x17')](_0x481d49)[_0x006c('0x19')](_0x4ce27f);}};}function respondWithFilteredResult(_0x1ab0ed,_0xcaf074){return function(_0x564c6f){if(_0x564c6f){var _0x21f035=typeof _0xcaf074[_0x006c('0x1a')]===_0x006c('0x1b')&&typeof _0xcaf074['limit']==='undefined';var _0x4964d9=_0x564c6f[_0x006c('0x1c')];var _0x2a05ed=_0x21f035?0x0:_0xcaf074[_0x006c('0x1a')];var _0x440176=_0x21f035?_0x564c6f[_0x006c('0x1c')]:_0xcaf074[_0x006c('0x1a')]+_0xcaf074[_0x006c('0x1d')];var _0x19930e;if(_0x440176>=_0x4964d9){_0x440176=_0x4964d9;_0x19930e=0xc8;}else{_0x19930e=0xce;}_0x1ab0ed[_0x006c('0x17')](_0x19930e);return _0x1ab0ed[_0x006c('0x1e')](_0x006c('0x1f'),_0x2a05ed+'-'+_0x440176+'/'+_0x4964d9)[_0x006c('0x19')](_0x564c6f);}return null;};}function patchUpdates(_0x187cb3){return function(_0x411419){try{jsonpatch[_0x006c('0x20')](_0x411419,_0x187cb3,!![]);}catch(_0x610221){return BPromise[_0x006c('0x21')](_0x610221);}return _0x411419[_0x006c('0x22')]();};}function saveUpdates(_0x1e56c9,_0x75fbca){return function(_0x1ee6b7){if(_0x1ee6b7){return _0x1ee6b7[_0x006c('0x23')](_0x1e56c9)[_0x006c('0x24')](function(_0x338e93){return _0x338e93;});}return null;};}function removeEntity(_0x2d29ff,_0x277310){return function(_0x4e9a05){if(_0x4e9a05){return _0x4e9a05[_0x006c('0x25')]()[_0x006c('0x24')](function(){_0x2d29ff[_0x006c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321577,_0x38f01e){return function(_0x353ba0){if(!_0x353ba0){_0x321577['sendStatus'](0x194);}return _0x353ba0;};}function handleError(_0x55b34d,_0x39039b){_0x39039b=_0x39039b||0x1f4;return function(_0x59ab45){logger['error'](_0x59ab45['stack']);if(_0x59ab45[_0x006c('0x26')]){delete _0x59ab45['name'];}_0x55b34d[_0x006c('0x17')](_0x39039b)[_0x006c('0x27')](_0x59ab45);};}exports[_0x006c('0x28')]=function(_0x1a8d24,_0x4dca70){var _0x1133f0={},_0x1e81db={},_0x45aca7={'count':0x0,'rows':[]};var _0x40fc96=_['map'](db[_0x006c('0x29')][_0x006c('0x2a')],function(_0x5d75dc){return{'name':_0x5d75dc[_0x006c('0x2b')],'type':_0x5d75dc[_0x006c('0x2c')][_0x006c('0x2d')]};});_0x1e81db[_0x006c('0x2e')]=_[_0x006c('0x2f')](_0x40fc96,_0x006c('0x26'));_0x1e81db['query']=_[_0x006c('0x30')](_0x1a8d24['query']);_0x1e81db[_0x006c('0x31')]=_[_0x006c('0x32')](_0x1e81db[_0x006c('0x2e')],_0x1e81db[_0x006c('0x33')]);_0x1133f0[_0x006c('0x34')]=_[_0x006c('0x32')](_0x1e81db['model'],qs['fields'](_0x1a8d24['query'][_0x006c('0x35')]));_0x1133f0[_0x006c('0x34')]=_0x1133f0[_0x006c('0x34')][_0x006c('0x36')]?_0x1133f0[_0x006c('0x34')]:_0x1e81db[_0x006c('0x2e')];if(!_0x1a8d24[_0x006c('0x33')]['hasOwnProperty'](_0x006c('0x37'))){_0x1133f0[_0x006c('0x1d')]=qs[_0x006c('0x1d')](_0x1a8d24[_0x006c('0x33')][_0x006c('0x1d')]);_0x1133f0[_0x006c('0x1a')]=qs[_0x006c('0x1a')](_0x1a8d24['query'][_0x006c('0x1a')]);}_0x1133f0[_0x006c('0x38')]=qs[_0x006c('0x39')](_0x1a8d24[_0x006c('0x33')][_0x006c('0x39')]);_0x1133f0['where']=qs['filters'](_[_0x006c('0x3a')](_0x1a8d24[_0x006c('0x33')],_0x1e81db[_0x006c('0x31')]),_0x40fc96);if(_0x1a8d24[_0x006c('0x33')]['filter']){_0x1133f0[_0x006c('0x3b')]=_[_0x006c('0x3c')](_0x1133f0[_0x006c('0x3b')],{'$or':_['map'](_0x40fc96,function(_0x12ca67){if(_0x12ca67['type']!==_0x006c('0x3d')){var _0x4a828a={};_0x4a828a[_0x12ca67['name']]={'$like':'%'+_0x1a8d24[_0x006c('0x33')][_0x006c('0x3e')]+'%'};return _0x4a828a;}})});}_0x1133f0=_[_0x006c('0x3c')]({},_0x1133f0,_0x1a8d24[_0x006c('0x3f')]);var _0x159da0={'where':_0x1133f0[_0x006c('0x3b')]};return db[_0x006c('0x29')][_0x006c('0x1c')](_0x159da0)['then'](function(_0x4e3837){_0x45aca7[_0x006c('0x1c')]=_0x4e3837;if(_0x1a8d24[_0x006c('0x33')][_0x006c('0x40')]){_0x1133f0[_0x006c('0x41')]=[{'all':!![]}];}return db[_0x006c('0x29')]['findAll'](_0x1133f0);})['then'](function(_0x5a601d){_0x45aca7['rows']=_0x5a601d;return _0x45aca7;})[_0x006c('0x24')](respondWithFilteredResult(_0x4dca70,_0x1133f0))[_0x006c('0x42')](handleError(_0x4dca70,null));};exports[_0x006c('0x43')]=function(_0xd9307f,_0x5c46d5){var _0x185cce={'raw':!![],'where':{'id':_0xd9307f['params']['id']}},_0x429ca5={};_0x429ca5[_0x006c('0x2e')]=_['keys'](db[_0x006c('0x29')]['rawAttributes']);_0x429ca5[_0x006c('0x33')]=_[_0x006c('0x30')](_0xd9307f[_0x006c('0x33')]);_0x429ca5[_0x006c('0x31')]=_[_0x006c('0x32')](_0x429ca5[_0x006c('0x2e')],_0x429ca5[_0x006c('0x33')]);_0x185cce[_0x006c('0x34')]=_[_0x006c('0x32')](_0x429ca5[_0x006c('0x2e')],qs[_0x006c('0x35')](_0xd9307f[_0x006c('0x33')][_0x006c('0x35')]));_0x185cce[_0x006c('0x34')]=_0x185cce['attributes']['length']?_0x185cce[_0x006c('0x34')]:_0x429ca5[_0x006c('0x2e')];if(_0xd9307f['query'][_0x006c('0x40')]){_0x185cce[_0x006c('0x41')]=[{'all':!![]}];}_0x185cce=_['merge']({},_0x185cce,_0xd9307f[_0x006c('0x3f')]);return db[_0x006c('0x29')][_0x006c('0x44')](_0x185cce)[_0x006c('0x24')](handleEntityNotFound(_0x5c46d5,null))['then'](respondWithResult(_0x5c46d5,null))[_0x006c('0x42')](handleError(_0x5c46d5,null));};exports[_0x006c('0x45')]=function(_0x455c18,_0x3683f3){return db[_0x006c('0x29')][_0x006c('0x45')](_0x455c18[_0x006c('0x46')],{})['then'](respondWithResult(_0x3683f3,0xc9))['catch'](handleError(_0x3683f3,null));};exports[_0x006c('0x23')]=function(_0x1e7e77,_0x3e7a8a){if(_0x1e7e77[_0x006c('0x46')]['id']){delete _0x1e7e77['body']['id'];}return db['SquareReport'][_0x006c('0x44')]({'where':{'id':_0x1e7e77[_0x006c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e7a8a,null))[_0x006c('0x24')](saveUpdates(_0x1e7e77[_0x006c('0x46')],null))['then'](respondWithResult(_0x3e7a8a,null))[_0x006c('0x42')](handleError(_0x3e7a8a,null));};exports[_0x006c('0x25')]=function(_0x547a92,_0x3bc734){return db[_0x006c('0x29')]['find']({'where':{'id':_0x547a92[_0x006c('0x47')]['id']}})[_0x006c('0x24')](handleEntityNotFound(_0x3bc734,null))[_0x006c('0x24')](removeEntity(_0x3bc734,null))[_0x006c('0x42')](handleError(_0x3bc734,null));};exports[_0x006c('0x48')]=function(_0x273099,_0x39eb66){return db[_0x006c('0x29')]['describe']()['then'](respondWithResult(_0x39eb66,null))['catch'](handleError(_0x39eb66,null));};
\ No newline at end of file
index 37e9575..51ebe95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb28b=['path','../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','../../config/logger','bluebird','request-promise'];(function(_0x2051c5,_0x3d235c){var _0x146f60=function(_0x550a46){while(--_0x550a46){_0x2051c5['push'](_0x2051c5['shift']());}};_0x146f60(++_0x3d235c);}(_0xb28b,0x1c4));var _0xbb28=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb28b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbb28('0x0'))('api');var moment=require('moment');var BPromise=require(_0xbb28('0x1'));var rp=require(_0xbb28('0x2'));var fs=require('fs');var path=require(_0xbb28('0x3'));var rimraf=require('rimraf');var config=require(_0xbb28('0x4'));var attributes=require(_0xbb28('0x5'));module[_0xbb28('0x6')]=function(_0x56825b,_0x175e3a){return _0x56825b[_0xbb28('0x7')]('SquareReport',attributes,{'tableName':_0xbb28('0x8'),'paranoid':![],'indexes':[{'name':_0xbb28('0x9'),'fields':[_0xbb28('0xa'),_0xbb28('0xb')]},{'name':'leaveAt','fields':[_0xbb28('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6433=['project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uniqueid'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6433,0xf2));var _0x3643=function(_0x192c4b,_0x13a67f){_0x192c4b=_0x192c4b-0x0;var _0x5c1376=_0x6433[_0x192c4b];return _0x5c1376;};'use strict';var _=require(_0x3643('0x0'));var util=require('util');var logger=require(_0x3643('0x1'))(_0x3643('0x2'));var moment=require(_0x3643('0x3'));var BPromise=require(_0x3643('0x4'));var rp=require(_0x3643('0x5'));var fs=require('fs');var path=require(_0x3643('0x6'));var rimraf=require(_0x3643('0x7'));var config=require(_0x3643('0x8'));var attributes=require(_0x3643('0x9'));module['exports']=function(_0x2ccb95,_0x484cee){return _0x2ccb95[_0x3643('0xa')](_0x3643('0xb'),attributes,{'tableName':_0x3643('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x3643('0xd'),_0x3643('0xe')]},{'name':_0x3643('0xf'),'fields':[_0x3643('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index bc38547..32814ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f32=['raw','stringify','UpdateSquareReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','body','options'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x3f32,0x87));var _0x23f3=function(_0x34db7f,_0x3e22f8){_0x34db7f=_0x34db7f-0x0;var _0x509554=_0x3f32[_0x34db7f];return _0x509554;};'use strict';var _=require(_0x23f3('0x0'));var util=require(_0x23f3('0x1'));var moment=require('moment');var BPromise=require(_0x23f3('0x2'));var rs=require(_0x23f3('0x3'));var fs=require('fs');var Redis=require(_0x23f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x23f3('0x5'));var jayson=require(_0x23f3('0x6'));var client=jayson[_0x23f3('0x7')][_0x23f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa684db,_0x405957,_0x30e1be){return new BPromise(function(_0x50151b,_0x128b65){return client[_0x23f3('0x9')](_0xa684db,_0x30e1be)[_0x23f3('0xa')](function(_0x711a5d){logger[_0x23f3('0xb')]('SquareReport,\x20%s,\x20%s',_0x405957,_0x23f3('0xc'));logger[_0x23f3('0xd')](_0x23f3('0xe'),_0x405957,_0x23f3('0xc'),JSON['stringify'](_0x711a5d));if(_0x711a5d[_0x23f3('0xf')]){if(_0x711a5d[_0x23f3('0xf')][_0x23f3('0x10')]===0x1f4){logger[_0x23f3('0xf')](_0x23f3('0x11'),_0x405957,_0x711a5d['error']['message']);return _0x128b65(_0x711a5d['error'][_0x23f3('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x405957,_0x711a5d[_0x23f3('0xf')][_0x23f3('0x12')]);return _0x50151b(_0x711a5d[_0x23f3('0xf')]['message']);}else{logger[_0x23f3('0xb')]('SquareReport,\x20%s,\x20%s',_0x405957,_0x23f3('0xc'));_0x50151b(_0x711a5d[_0x23f3('0x13')][_0x23f3('0x12')]);}})[_0x23f3('0x14')](function(_0x418ff4){logger[_0x23f3('0xf')](_0x23f3('0x11'),_0x405957,_0x418ff4);_0x128b65(_0x418ff4);});});}exports[_0x23f3('0x15')]=function(_0x544f90){var _0x4d4e7a=this;return new Promise(function(_0x11639a,_0x114546){return db[_0x23f3('0x16')]['create'](_0x544f90[_0x23f3('0x17')],{'raw':_0x544f90[_0x23f3('0x18')]?_0x544f90[_0x23f3('0x18')][_0x23f3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5e7485){logger[_0x23f3('0xb')](_0x23f3('0x15'),_0x544f90);logger['debug'](_0x23f3('0x15'),_0x544f90,JSON[_0x23f3('0x1a')](_0x5e7485));_0x11639a(_0x5e7485);})[_0x23f3('0x14')](function(_0x51dd82){logger[_0x23f3('0xf')](_0x23f3('0x15'),_0x51dd82[_0x23f3('0x12')],_0x544f90);_0x114546(_0x4d4e7a['error'](0x1f4,_0x51dd82[_0x23f3('0x12')]));});});};exports[_0x23f3('0x1b')]=function(_0x25cb04){var _0x381193=this;return new Promise(function(_0x3d60e6,_0x103948){return db[_0x23f3('0x16')][_0x23f3('0x1c')](_0x25cb04['body'],{'raw':_0x25cb04['options']?_0x25cb04[_0x23f3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25cb04[_0x23f3('0x18')]?_0x25cb04[_0x23f3('0x18')][_0x23f3('0x1d')]||null:null,'attributes':_0x25cb04[_0x23f3('0x18')]?_0x25cb04['options'][_0x23f3('0x1e')]||null:null,'limit':_0x25cb04[_0x23f3('0x18')]?_0x25cb04['options'][_0x23f3('0x1f')]||null:null})[_0x23f3('0xa')](function(_0x345b76){logger['info'](_0x23f3('0x1b'),_0x25cb04);logger[_0x23f3('0xd')](_0x23f3('0x1b'),_0x25cb04,JSON[_0x23f3('0x1a')](_0x345b76));_0x3d60e6(_0x345b76);})['catch'](function(_0x3d8a84){logger[_0x23f3('0xf')]('UpdateSquareReport',_0x3d8a84[_0x23f3('0x12')],_0x25cb04);_0x103948(_0x381193[_0x23f3('0xf')](0x1f4,_0x3d8a84[_0x23f3('0x12')]));});});};
\ No newline at end of file
+var _0x1f1b=['CreateSquareReport','SquareReport','create','body','options','raw','then','debug','stringify','UpdateSquareReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x388e30,_0x236cd3){var _0x291ac2=function(_0x41b100){while(--_0x41b100){_0x388e30['push'](_0x388e30['shift']());}};_0x291ac2(++_0x236cd3);}(_0x1f1b,0xf3));var _0xb1f1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1f1b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb1f1('0x0'));var util=require(_0xb1f1('0x1'));var moment=require(_0xb1f1('0x2'));var BPromise=require(_0xb1f1('0x3'));var rs=require(_0xb1f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1f1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1f1('0x6'))(_0xb1f1('0x7'));var config=require(_0xb1f1('0x8'));var jayson=require(_0xb1f1('0x9'));var client=jayson[_0xb1f1('0xa')][_0xb1f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x627bc9,_0x183809,_0x24950c){return new BPromise(function(_0x4b2e49,_0x26ee9b){return client[_0xb1f1('0xc')](_0x627bc9,_0x24950c)['then'](function(_0x20e6c3){logger[_0xb1f1('0xd')](_0xb1f1('0xe'),_0x183809,_0xb1f1('0xf'));logger['debug'](_0xb1f1('0x10'),_0x183809,_0xb1f1('0xf'),JSON['stringify'](_0x20e6c3));if(_0x20e6c3[_0xb1f1('0x11')]){if(_0x20e6c3['error'][_0xb1f1('0x12')]===0x1f4){logger[_0xb1f1('0x11')](_0xb1f1('0xe'),_0x183809,_0x20e6c3[_0xb1f1('0x11')][_0xb1f1('0x13')]);return _0x26ee9b(_0x20e6c3['error'][_0xb1f1('0x13')]);}logger[_0xb1f1('0x11')](_0xb1f1('0xe'),_0x183809,_0x20e6c3['error'][_0xb1f1('0x13')]);return _0x4b2e49(_0x20e6c3[_0xb1f1('0x11')][_0xb1f1('0x13')]);}else{logger[_0xb1f1('0xd')](_0xb1f1('0xe'),_0x183809,_0xb1f1('0xf'));_0x4b2e49(_0x20e6c3['result'][_0xb1f1('0x13')]);}})[_0xb1f1('0x14')](function(_0x120744){logger[_0xb1f1('0x11')](_0xb1f1('0xe'),_0x183809,_0x120744);_0x26ee9b(_0x120744);});});}exports[_0xb1f1('0x15')]=function(_0x35b21e){var _0x4b0b12=this;return new Promise(function(_0x238dbf,_0x196243){return db[_0xb1f1('0x16')][_0xb1f1('0x17')](_0x35b21e[_0xb1f1('0x18')],{'raw':_0x35b21e[_0xb1f1('0x19')]?_0x35b21e[_0xb1f1('0x19')][_0xb1f1('0x1a')]===undefined?!![]:![]:!![]})[_0xb1f1('0x1b')](function(_0x51411f){logger[_0xb1f1('0xd')](_0xb1f1('0x15'),_0x35b21e);logger[_0xb1f1('0x1c')](_0xb1f1('0x15'),_0x35b21e,JSON[_0xb1f1('0x1d')](_0x51411f));_0x238dbf(_0x51411f);})[_0xb1f1('0x14')](function(_0x1e6aa7){logger[_0xb1f1('0x11')](_0xb1f1('0x15'),_0x1e6aa7[_0xb1f1('0x13')],_0x35b21e);_0x196243(_0x4b0b12[_0xb1f1('0x11')](0x1f4,_0x1e6aa7[_0xb1f1('0x13')]));});});};exports[_0xb1f1('0x1e')]=function(_0x16c23d){var _0x5db2f6=this;return new Promise(function(_0x3653a7,_0xea4da3){return db['SquareReport'][_0xb1f1('0x1f')](_0x16c23d[_0xb1f1('0x18')],{'raw':_0x16c23d['options']?_0x16c23d['options'][_0xb1f1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c23d[_0xb1f1('0x19')]?_0x16c23d['options'][_0xb1f1('0x20')]||null:null,'attributes':_0x16c23d[_0xb1f1('0x19')]?_0x16c23d['options']['attributes']||null:null,'limit':_0x16c23d['options']?_0x16c23d[_0xb1f1('0x19')]['limit']||null:null})[_0xb1f1('0x1b')](function(_0x5a1c30){logger[_0xb1f1('0xd')](_0xb1f1('0x1e'),_0x16c23d);logger[_0xb1f1('0x1c')]('UpdateSquareReport',_0x16c23d,JSON['stringify'](_0x5a1c30));_0x3653a7(_0x5a1c30);})[_0xb1f1('0x14')](function(_0x114525){logger['error'](_0xb1f1('0x1e'),_0x114525[_0xb1f1('0x13')],_0x16c23d);_0xea4da3(_0x5db2f6[_0xb1f1('0x11')](0x1f4,_0x114525['message']));});});};
\ No newline at end of file
index 302c206..a271e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5006=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x543e75,_0x5dd62a){var _0x4f9151=function(_0x47ddaa){while(--_0x47ddaa){_0x543e75['push'](_0x543e75['shift']());}};_0x4f9151(++_0x5dd62a);}(_0x5006,0xec));var _0x6500=function(_0x4659c7,_0x4fd66a){_0x4659c7=_0x4659c7-0x0;var _0x5c4d31=_0x5006[_0x4659c7];return _0x5c4d31;};'use strict';var multer=require(_0x6500('0x0'));var util=require(_0x6500('0x1'));var path=require(_0x6500('0x2'));var timeout=require(_0x6500('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6500('0x4'));var auth=require(_0x6500('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6500('0x6'));var controller=require(_0x6500('0x7'));router[_0x6500('0x8')]('/',auth[_0x6500('0x9')](),controller[_0x6500('0xa')]);router[_0x6500('0x8')](_0x6500('0xb'),auth[_0x6500('0x9')](),controller[_0x6500('0xc')]);router[_0x6500('0x8')](_0x6500('0xd'),auth[_0x6500('0x9')](),controller[_0x6500('0xe')]);router[_0x6500('0xf')]('/',auth[_0x6500('0x9')](),controller[_0x6500('0x10')]);router[_0x6500('0x11')](_0x6500('0xd'),auth['isAuthenticated'](),controller[_0x6500('0x12')]);router[_0x6500('0x13')]('/:id',auth[_0x6500('0x9')](),controller[_0x6500('0x14')]);module[_0x6500('0x15')]=router;
\ No newline at end of file
+var _0xf7dd=['/describe','isAuthenticated','show','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x274160,_0x1088c5){var _0x2721d6=function(_0x38b4e6){while(--_0x38b4e6){_0x274160['push'](_0x274160['shift']());}};_0x2721d6(++_0x1088c5);}(_0xf7dd,0x79));var _0xdf7d=function(_0x1a9ed0,_0x1085fc){_0x1a9ed0=_0x1a9ed0-0x0;var _0x47bbd6=_0xf7dd[_0x1a9ed0];return _0x47bbd6;};'use strict';var multer=require(_0xdf7d('0x0'));var util=require(_0xdf7d('0x1'));var path=require(_0xdf7d('0x2'));var timeout=require(_0xdf7d('0x3'));var express=require(_0xdf7d('0x4'));var router=express[_0xdf7d('0x5')]();var fs_extra=require(_0xdf7d('0x6'));var auth=require(_0xdf7d('0x7'));var interaction=require(_0xdf7d('0x8'));var config=require(_0xdf7d('0x9'));var controller=require(_0xdf7d('0xa'));router[_0xdf7d('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf7d('0xb')](_0xdf7d('0xc'),auth[_0xdf7d('0xd')](),controller['describe']);router['get']('/:id',auth[_0xdf7d('0xd')](),controller[_0xdf7d('0xe')]);router['post']('/',auth[_0xdf7d('0xd')](),controller['create']);router[_0xdf7d('0xf')](_0xdf7d('0x10'),auth[_0xdf7d('0xd')](),controller['update']);router[_0xdf7d('0x11')](_0xdf7d('0x10'),auth[_0xdf7d('0xd')](),controller['destroy']);module[_0xdf7d('0x12')]=router;
\ No newline at end of file
index 52dbbee..d98f744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd14e=['STRING','TEXT','sequelize','exports'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xd14e,0x17e));var _0xed14=function(_0x495879,_0x3ff260){_0x495879=_0x495879-0x0;var _0x150aed=_0xd14e[_0x495879];return _0x150aed;};'use strict';var Sequelize=require(_0xed14('0x0'));module[_0xed14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xed14('0x2')]},'application':{'type':Sequelize[_0xed14('0x2')]},'data':{'type':Sequelize[_0xed14('0x3')]},'project_name':{'type':Sequelize[_0xed14('0x2')]},'callerid':{'type':Sequelize[_0xed14('0x2')]}};
\ No newline at end of file
+var _0x8e47=['exports','STRING','sequelize'];(function(_0x180df8,_0x4d8966){var _0x5e6e07=function(_0x168a9f){while(--_0x168a9f){_0x180df8['push'](_0x180df8['shift']());}};_0x5e6e07(++_0x4d8966);}(_0x8e47,0x77));var _0x78e4=function(_0x345ab0,_0x422865){_0x345ab0=_0x345ab0-0x0;var _0x42b950=_0x8e47[_0x345ab0];return _0x42b950;};'use strict';var Sequelize=require(_0x78e4('0x0'));module[_0x78e4('0x1')]={'uniqueid':{'type':Sequelize[_0x78e4('0x2')]},'node':{'type':Sequelize[_0x78e4('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x78e4('0x2')]}};
\ No newline at end of file
index 8112240..883240c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7186=['reject','save','update','then','error','name','send','index','map','SquareDetailsReport','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','rawAttributes','intersection','include','options','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x15707c,_0x3fcbcf){var _0xc97af4=function(_0x3eb8e5){while(--_0x3eb8e5){_0x15707c['push'](_0x15707c['shift']());}};_0xc97af4(++_0x3fcbcf);}(_0x7186,0x1f1));var _0x6718=function(_0x3bcb15,_0x1aaf5e){_0x3bcb15=_0x3bcb15-0x0;var _0x36959b=_0x7186[_0x3bcb15];return _0x36959b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6718('0x0'));var zipdir=require(_0x6718('0x1'));var jsonpatch=require(_0x6718('0x2'));var rp=require('request-promise');var moment=require(_0x6718('0x3'));var BPromise=require(_0x6718('0x4'));var Mustache=require(_0x6718('0x5'));var util=require('util');var path=require(_0x6718('0x6'));var sox=require(_0x6718('0x7'));var csv=require('to-csv');var ejs=require(_0x6718('0x8'));var fs=require('fs');var fs_extra=require(_0x6718('0x9'));var _=require(_0x6718('0xa'));var squel=require(_0x6718('0xb'));var crypto=require(_0x6718('0xc'));var jsforce=require(_0x6718('0xd'));var deskjs=require(_0x6718('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6718('0xf'));var authService=require(_0x6718('0x10'));var qs=require(_0x6718('0x11'));var as=require(_0x6718('0x12'));var hardwareService=require(_0x6718('0x13'));var logger=require('../../config/logger')(_0x6718('0x14'));var utils=require(_0x6718('0x15'));var config=require(_0x6718('0x16'));var licenseUtil=require(_0x6718('0x17'));var db=require(_0x6718('0x18'))['db'];function respondWithStatusCode(_0x38256b,_0x2a0015){_0x2a0015=_0x2a0015||0xcc;return function(_0x32b01e){if(_0x32b01e){return _0x38256b[_0x6718('0x19')](_0x2a0015);}return _0x38256b[_0x6718('0x1a')](_0x2a0015)[_0x6718('0x1b')]();};}function respondWithResult(_0x2e946d,_0x592bb0){_0x592bb0=_0x592bb0||0xc8;return function(_0x203871){if(_0x203871){return _0x2e946d[_0x6718('0x1a')](_0x592bb0)[_0x6718('0x1c')](_0x203871);}};}function respondWithFilteredResult(_0x45b4ed,_0x54058c){return function(_0x36c9d5){if(_0x36c9d5){var _0x43120f=typeof _0x54058c[_0x6718('0x1d')]==='undefined'&&typeof _0x54058c[_0x6718('0x1e')]==='undefined';var _0x28d017=_0x36c9d5[_0x6718('0x1f')];var _0x5ef544=_0x43120f?0x0:_0x54058c[_0x6718('0x1d')];var _0x328fdb=_0x43120f?_0x36c9d5[_0x6718('0x1f')]:_0x54058c[_0x6718('0x1d')]+_0x54058c[_0x6718('0x1e')];var _0x4a4ad;if(_0x328fdb>=_0x28d017){_0x328fdb=_0x28d017;_0x4a4ad=0xc8;}else{_0x4a4ad=0xce;}_0x45b4ed['status'](_0x4a4ad);return _0x45b4ed[_0x6718('0x20')](_0x6718('0x21'),_0x5ef544+'-'+_0x328fdb+'/'+_0x28d017)[_0x6718('0x1c')](_0x36c9d5);}return null;};}function patchUpdates(_0x13751a){return function(_0xfdfad1){try{jsonpatch[_0x6718('0x22')](_0xfdfad1,_0x13751a,!![]);}catch(_0x5b517b){return BPromise[_0x6718('0x23')](_0x5b517b);}return _0xfdfad1[_0x6718('0x24')]();};}function saveUpdates(_0x54cf2d,_0x180e9c){return function(_0x5edabc){if(_0x5edabc){return _0x5edabc[_0x6718('0x25')](_0x54cf2d)['then'](function(_0x3b70c4){return _0x3b70c4;});}return null;};}function removeEntity(_0x489a9a,_0x138f00){return function(_0x450610){if(_0x450610){return _0x450610['destroy']()[_0x6718('0x26')](function(){_0x489a9a[_0x6718('0x1a')](0xcc)[_0x6718('0x1b')]();});}};}function handleEntityNotFound(_0x4e8d17,_0x4aa48d){return function(_0x14c6ca){if(!_0x14c6ca){_0x4e8d17[_0x6718('0x19')](0x194);}return _0x14c6ca;};}function handleError(_0x441ffb,_0x41ed23){_0x41ed23=_0x41ed23||0x1f4;return function(_0x4596d3){logger[_0x6718('0x27')](_0x4596d3['stack']);if(_0x4596d3[_0x6718('0x28')]){delete _0x4596d3[_0x6718('0x28')];}_0x441ffb['status'](_0x41ed23)[_0x6718('0x29')](_0x4596d3);};}exports[_0x6718('0x2a')]=function(_0x895f9b,_0x4ef596){var _0x8a45be={},_0x10a326={},_0x2efbdb={'count':0x0,'rows':[]};var _0x242b6e=_[_0x6718('0x2b')](db[_0x6718('0x2c')]['rawAttributes'],function(_0x48065e){return{'name':_0x48065e[_0x6718('0x2d')],'type':_0x48065e[_0x6718('0x2e')][_0x6718('0x2f')]};});_0x10a326['model']=_[_0x6718('0x2b')](_0x242b6e,_0x6718('0x28'));_0x10a326[_0x6718('0x30')]=_[_0x6718('0x31')](_0x895f9b[_0x6718('0x30')]);_0x10a326[_0x6718('0x32')]=_['intersection'](_0x10a326[_0x6718('0x33')],_0x10a326['query']);_0x8a45be['attributes']=_['intersection'](_0x10a326[_0x6718('0x33')],qs[_0x6718('0x34')](_0x895f9b[_0x6718('0x30')][_0x6718('0x34')]));_0x8a45be[_0x6718('0x35')]=_0x8a45be[_0x6718('0x35')][_0x6718('0x36')]?_0x8a45be['attributes']:_0x10a326[_0x6718('0x33')];if(!_0x895f9b[_0x6718('0x30')][_0x6718('0x37')](_0x6718('0x38'))){_0x8a45be[_0x6718('0x1e')]=qs[_0x6718('0x1e')](_0x895f9b['query']['limit']);_0x8a45be[_0x6718('0x1d')]=qs[_0x6718('0x1d')](_0x895f9b[_0x6718('0x30')][_0x6718('0x1d')]);}_0x8a45be['order']=qs[_0x6718('0x39')](_0x895f9b['query'][_0x6718('0x39')]);_0x8a45be[_0x6718('0x3a')]=qs[_0x6718('0x32')](_['pick'](_0x895f9b[_0x6718('0x30')],_0x10a326[_0x6718('0x32')]),_0x242b6e);if(_0x895f9b[_0x6718('0x30')][_0x6718('0x3b')]){_0x8a45be[_0x6718('0x3a')]=_[_0x6718('0x3c')](_0x8a45be['where'],{'$or':_['map'](_0x242b6e,function(_0x3500b){if(_0x3500b[_0x6718('0x2e')]!==_0x6718('0x3d')){var _0x46b522={};_0x46b522[_0x3500b['name']]={'$like':'%'+_0x895f9b[_0x6718('0x30')][_0x6718('0x3b')]+'%'};return _0x46b522;}})});}_0x8a45be=_[_0x6718('0x3c')]({},_0x8a45be,_0x895f9b['options']);var _0xcddb18={'where':_0x8a45be[_0x6718('0x3a')]};return db[_0x6718('0x2c')]['count'](_0xcddb18)['then'](function(_0x1e0294){_0x2efbdb['count']=_0x1e0294;if(_0x895f9b[_0x6718('0x30')][_0x6718('0x3e')]){_0x8a45be['include']=[{'all':!![]}];}return db[_0x6718('0x2c')][_0x6718('0x3f')](_0x8a45be);})[_0x6718('0x26')](function(_0x28fa2d){_0x2efbdb[_0x6718('0x40')]=_0x28fa2d;return _0x2efbdb;})[_0x6718('0x26')](respondWithFilteredResult(_0x4ef596,_0x8a45be))[_0x6718('0x41')](handleError(_0x4ef596,null));};exports[_0x6718('0x42')]=function(_0x2678e5,_0x5aecc4){var _0x4b0f00={'raw':!![],'where':{'id':_0x2678e5['params']['id']}},_0x19f72f={};_0x19f72f[_0x6718('0x33')]=_[_0x6718('0x31')](db[_0x6718('0x2c')][_0x6718('0x43')]);_0x19f72f[_0x6718('0x30')]=_[_0x6718('0x31')](_0x2678e5['query']);_0x19f72f['filters']=_[_0x6718('0x44')](_0x19f72f['model'],_0x19f72f['query']);_0x4b0f00[_0x6718('0x35')]=_[_0x6718('0x44')](_0x19f72f['model'],qs['fields'](_0x2678e5[_0x6718('0x30')][_0x6718('0x34')]));_0x4b0f00['attributes']=_0x4b0f00[_0x6718('0x35')][_0x6718('0x36')]?_0x4b0f00[_0x6718('0x35')]:_0x19f72f[_0x6718('0x33')];if(_0x2678e5['query'][_0x6718('0x3e')]){_0x4b0f00[_0x6718('0x45')]=[{'all':!![]}];}_0x4b0f00=_['merge']({},_0x4b0f00,_0x2678e5[_0x6718('0x46')]);return db[_0x6718('0x2c')]['find'](_0x4b0f00)[_0x6718('0x26')](handleEntityNotFound(_0x5aecc4,null))[_0x6718('0x26')](respondWithResult(_0x5aecc4,null))['catch'](handleError(_0x5aecc4,null));};exports[_0x6718('0x47')]=function(_0x1e40ad,_0x208f55){return db[_0x6718('0x2c')]['create'](_0x1e40ad[_0x6718('0x48')],{})[_0x6718('0x26')](respondWithResult(_0x208f55,0xc9))[_0x6718('0x41')](handleError(_0x208f55,null));};exports[_0x6718('0x25')]=function(_0x7f2276,_0x40af2e){if(_0x7f2276[_0x6718('0x48')]['id']){delete _0x7f2276['body']['id'];}return db[_0x6718('0x2c')][_0x6718('0x49')]({'where':{'id':_0x7f2276['params']['id']}})['then'](handleEntityNotFound(_0x40af2e,null))['then'](saveUpdates(_0x7f2276[_0x6718('0x48')],null))[_0x6718('0x26')](respondWithResult(_0x40af2e,null))[_0x6718('0x41')](handleError(_0x40af2e,null));};exports['destroy']=function(_0x493186,_0x141c93){return db[_0x6718('0x2c')][_0x6718('0x49')]({'where':{'id':_0x493186[_0x6718('0x4a')]['id']}})['then'](handleEntityNotFound(_0x141c93,null))[_0x6718('0x26')](removeEntity(_0x141c93,null))[_0x6718('0x41')](handleError(_0x141c93,null));};exports['describe']=function(_0x3b83df,_0x5d1c03){return db['SquareDetailsReport'][_0x6718('0x4b')]()[_0x6718('0x26')](respondWithResult(_0x5d1c03,null))[_0x6718('0x41')](handleError(_0x5d1c03,null));};
\ No newline at end of file
+var _0xfc4c=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4eab4d,_0x1fbd49){var _0x3bffce=function(_0x1e4c66){while(--_0x1e4c66){_0x4eab4d['push'](_0x4eab4d['shift']());}};_0x3bffce(++_0x1fbd49);}(_0xfc4c,0x1d2));var _0xcfc4=function(_0x4f4f5a,_0x31261c){_0x4f4f5a=_0x4f4f5a-0x0;var _0x4451f3=_0xfc4c[_0x4f4f5a];return _0x4451f3;};'use strict';var emlformat=require(_0xcfc4('0x0'));var rimraf=require(_0xcfc4('0x1'));var zipdir=require(_0xcfc4('0x2'));var jsonpatch=require(_0xcfc4('0x3'));var rp=require(_0xcfc4('0x4'));var moment=require('moment');var BPromise=require(_0xcfc4('0x5'));var Mustache=require(_0xcfc4('0x6'));var util=require(_0xcfc4('0x7'));var path=require('path');var sox=require(_0xcfc4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfc4('0x9'));var _=require(_0xcfc4('0xa'));var squel=require(_0xcfc4('0xb'));var crypto=require(_0xcfc4('0xc'));var jsforce=require(_0xcfc4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcfc4('0xe'));var querystring=require(_0xcfc4('0xf'));var Papa=require(_0xcfc4('0x10'));var Redis=require(_0xcfc4('0x11'));var authService=require(_0xcfc4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcfc4('0x13'));var hardwareService=require(_0xcfc4('0x14'));var logger=require(_0xcfc4('0x15'))(_0xcfc4('0x16'));var utils=require(_0xcfc4('0x17'));var config=require(_0xcfc4('0x18'));var licenseUtil=require(_0xcfc4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdeff,_0x445557){_0x445557=_0x445557||0xcc;return function(_0x2dd167){if(_0x2dd167){return _0x3fdeff[_0xcfc4('0x1a')](_0x445557);}return _0x3fdeff[_0xcfc4('0x1b')](_0x445557)['end']();};}function respondWithResult(_0x2852c3,_0x3f1248){_0x3f1248=_0x3f1248||0xc8;return function(_0x592fe2){if(_0x592fe2){return _0x2852c3[_0xcfc4('0x1b')](_0x3f1248)[_0xcfc4('0x1c')](_0x592fe2);}};}function respondWithFilteredResult(_0x4a973c,_0x5c0bd5){return function(_0x213a7a){if(_0x213a7a){var _0x144a29=typeof _0x5c0bd5['offset']===_0xcfc4('0x1d')&&typeof _0x5c0bd5[_0xcfc4('0x1e')]===_0xcfc4('0x1d');var _0x18ff50=_0x213a7a[_0xcfc4('0x1f')];var _0x537c75=_0x144a29?0x0:_0x5c0bd5['offset'];var _0x992257=_0x144a29?_0x213a7a[_0xcfc4('0x1f')]:_0x5c0bd5[_0xcfc4('0x20')]+_0x5c0bd5[_0xcfc4('0x1e')];var _0x39aa9f;if(_0x992257>=_0x18ff50){_0x992257=_0x18ff50;_0x39aa9f=0xc8;}else{_0x39aa9f=0xce;}_0x4a973c[_0xcfc4('0x1b')](_0x39aa9f);return _0x4a973c[_0xcfc4('0x21')](_0xcfc4('0x22'),_0x537c75+'-'+_0x992257+'/'+_0x18ff50)[_0xcfc4('0x1c')](_0x213a7a);}return null;};}function patchUpdates(_0x36aedd){return function(_0x2738aa){try{jsonpatch[_0xcfc4('0x23')](_0x2738aa,_0x36aedd,!![]);}catch(_0x110b1a){return BPromise[_0xcfc4('0x24')](_0x110b1a);}return _0x2738aa[_0xcfc4('0x25')]();};}function saveUpdates(_0x13a132,_0x215bb4){return function(_0xf84467){if(_0xf84467){return _0xf84467[_0xcfc4('0x26')](_0x13a132)[_0xcfc4('0x27')](function(_0x25667b){return _0x25667b;});}return null;};}function removeEntity(_0x4e3f81,_0x11ed3c){return function(_0x2feaf3){if(_0x2feaf3){return _0x2feaf3[_0xcfc4('0x28')]()['then'](function(){_0x4e3f81[_0xcfc4('0x1b')](0xcc)[_0xcfc4('0x29')]();});}};}function handleEntityNotFound(_0x2c3836,_0xb6365e){return function(_0x34730f){if(!_0x34730f){_0x2c3836[_0xcfc4('0x1a')](0x194);}return _0x34730f;};}function handleError(_0x487fa2,_0xf27f55){_0xf27f55=_0xf27f55||0x1f4;return function(_0x32003b){logger[_0xcfc4('0x2a')](_0x32003b[_0xcfc4('0x2b')]);if(_0x32003b['name']){delete _0x32003b[_0xcfc4('0x2c')];}_0x487fa2['status'](_0xf27f55)['send'](_0x32003b);};}exports[_0xcfc4('0x2d')]=function(_0x2031a7,_0x4496e5){var _0x11a602={},_0x3f63e7={},_0x277f25={'count':0x0,'rows':[]};var _0x35904c=_[_0xcfc4('0x2e')](db[_0xcfc4('0x2f')][_0xcfc4('0x30')],function(_0x5c5a6a){return{'name':_0x5c5a6a[_0xcfc4('0x31')],'type':_0x5c5a6a[_0xcfc4('0x32')][_0xcfc4('0x33')]};});_0x3f63e7[_0xcfc4('0x34')]=_[_0xcfc4('0x2e')](_0x35904c,_0xcfc4('0x2c'));_0x3f63e7[_0xcfc4('0x35')]=_['keys'](_0x2031a7[_0xcfc4('0x35')]);_0x3f63e7[_0xcfc4('0x36')]=_[_0xcfc4('0x37')](_0x3f63e7[_0xcfc4('0x34')],_0x3f63e7[_0xcfc4('0x35')]);_0x11a602[_0xcfc4('0x38')]=_[_0xcfc4('0x37')](_0x3f63e7['model'],qs[_0xcfc4('0x39')](_0x2031a7[_0xcfc4('0x35')][_0xcfc4('0x39')]));_0x11a602[_0xcfc4('0x38')]=_0x11a602[_0xcfc4('0x38')][_0xcfc4('0x3a')]?_0x11a602[_0xcfc4('0x38')]:_0x3f63e7[_0xcfc4('0x34')];if(!_0x2031a7[_0xcfc4('0x35')][_0xcfc4('0x3b')](_0xcfc4('0x3c'))){_0x11a602[_0xcfc4('0x1e')]=qs[_0xcfc4('0x1e')](_0x2031a7[_0xcfc4('0x35')]['limit']);_0x11a602[_0xcfc4('0x20')]=qs[_0xcfc4('0x20')](_0x2031a7['query']['offset']);}_0x11a602[_0xcfc4('0x3d')]=qs[_0xcfc4('0x3e')](_0x2031a7[_0xcfc4('0x35')]['sort']);_0x11a602['where']=qs[_0xcfc4('0x36')](_[_0xcfc4('0x3f')](_0x2031a7[_0xcfc4('0x35')],_0x3f63e7[_0xcfc4('0x36')]),_0x35904c);if(_0x2031a7['query'][_0xcfc4('0x40')]){_0x11a602[_0xcfc4('0x41')]=_[_0xcfc4('0x42')](_0x11a602[_0xcfc4('0x41')],{'$or':_['map'](_0x35904c,function(_0x5390c5){if(_0x5390c5[_0xcfc4('0x32')]!==_0xcfc4('0x43')){var _0x183fc5={};_0x183fc5[_0x5390c5['name']]={'$like':'%'+_0x2031a7[_0xcfc4('0x35')]['filter']+'%'};return _0x183fc5;}})});}_0x11a602=_[_0xcfc4('0x42')]({},_0x11a602,_0x2031a7[_0xcfc4('0x44')]);var _0x2e8159={'where':_0x11a602[_0xcfc4('0x41')]};return db[_0xcfc4('0x2f')][_0xcfc4('0x1f')](_0x2e8159)['then'](function(_0x469cf1){_0x277f25[_0xcfc4('0x1f')]=_0x469cf1;if(_0x2031a7[_0xcfc4('0x35')][_0xcfc4('0x45')]){_0x11a602[_0xcfc4('0x46')]=[{'all':!![]}];}return db[_0xcfc4('0x2f')]['findAll'](_0x11a602);})[_0xcfc4('0x27')](function(_0x4902b6){_0x277f25[_0xcfc4('0x47')]=_0x4902b6;return _0x277f25;})[_0xcfc4('0x27')](respondWithFilteredResult(_0x4496e5,_0x11a602))[_0xcfc4('0x48')](handleError(_0x4496e5,null));};exports[_0xcfc4('0x49')]=function(_0x1e2acd,_0xc72341){var _0x29d1e6={'raw':!![],'where':{'id':_0x1e2acd[_0xcfc4('0x4a')]['id']}},_0x2954d8={};_0x2954d8['model']=_[_0xcfc4('0x4b')](db['SquareDetailsReport'][_0xcfc4('0x30')]);_0x2954d8[_0xcfc4('0x35')]=_[_0xcfc4('0x4b')](_0x1e2acd[_0xcfc4('0x35')]);_0x2954d8[_0xcfc4('0x36')]=_['intersection'](_0x2954d8[_0xcfc4('0x34')],_0x2954d8[_0xcfc4('0x35')]);_0x29d1e6[_0xcfc4('0x38')]=_[_0xcfc4('0x37')](_0x2954d8[_0xcfc4('0x34')],qs[_0xcfc4('0x39')](_0x1e2acd[_0xcfc4('0x35')][_0xcfc4('0x39')]));_0x29d1e6['attributes']=_0x29d1e6['attributes'][_0xcfc4('0x3a')]?_0x29d1e6[_0xcfc4('0x38')]:_0x2954d8[_0xcfc4('0x34')];if(_0x1e2acd[_0xcfc4('0x35')][_0xcfc4('0x45')]){_0x29d1e6[_0xcfc4('0x46')]=[{'all':!![]}];}_0x29d1e6=_[_0xcfc4('0x42')]({},_0x29d1e6,_0x1e2acd[_0xcfc4('0x44')]);return db['SquareDetailsReport'][_0xcfc4('0x4c')](_0x29d1e6)[_0xcfc4('0x27')](handleEntityNotFound(_0xc72341,null))[_0xcfc4('0x27')](respondWithResult(_0xc72341,null))[_0xcfc4('0x48')](handleError(_0xc72341,null));};exports['create']=function(_0x33e7e4,_0x386d52){return db[_0xcfc4('0x2f')][_0xcfc4('0x4d')](_0x33e7e4[_0xcfc4('0x4e')],{})[_0xcfc4('0x27')](respondWithResult(_0x386d52,0xc9))[_0xcfc4('0x48')](handleError(_0x386d52,null));};exports[_0xcfc4('0x26')]=function(_0xb78e82,_0x56ac0d){if(_0xb78e82[_0xcfc4('0x4e')]['id']){delete _0xb78e82[_0xcfc4('0x4e')]['id'];}return db['SquareDetailsReport'][_0xcfc4('0x4c')]({'where':{'id':_0xb78e82['params']['id']}})[_0xcfc4('0x27')](handleEntityNotFound(_0x56ac0d,null))['then'](saveUpdates(_0xb78e82['body'],null))[_0xcfc4('0x27')](respondWithResult(_0x56ac0d,null))[_0xcfc4('0x48')](handleError(_0x56ac0d,null));};exports[_0xcfc4('0x28')]=function(_0x56828b,_0x326e2b){return db[_0xcfc4('0x2f')]['find']({'where':{'id':_0x56828b[_0xcfc4('0x4a')]['id']}})[_0xcfc4('0x27')](handleEntityNotFound(_0x326e2b,null))['then'](removeEntity(_0x326e2b,null))[_0xcfc4('0x48')](handleError(_0x326e2b,null));};exports['describe']=function(_0x26661b,_0x1075a9){return db['SquareDetailsReport'][_0xcfc4('0x4f')]()[_0xcfc4('0x27')](respondWithResult(_0x1075a9,null))[_0xcfc4('0x48')](handleError(_0x1075a9,null));};
\ No newline at end of file
index ae43aed..660b20a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3e6=['api','moment','bluebird','request-promise','rimraf','./squareReportDetail.attributes','exports','define','report_square_details','util','../../config/logger'];(function(_0x382876,_0x1da266){var _0x21ad6e=function(_0x4194f1){while(--_0x4194f1){_0x382876['push'](_0x382876['shift']());}};_0x21ad6e(++_0x1da266);}(_0xd3e6,0x6c));var _0x6d3e=function(_0x323200,_0x5cd22b){_0x323200=_0x323200-0x0;var _0x5bb821=_0xd3e6[_0x323200];return _0x5bb821;};'use strict';var _=require('lodash');var util=require(_0x6d3e('0x0'));var logger=require(_0x6d3e('0x1'))(_0x6d3e('0x2'));var moment=require(_0x6d3e('0x3'));var BPromise=require(_0x6d3e('0x4'));var rp=require(_0x6d3e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d3e('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d3e('0x7'));module[_0x6d3e('0x8')]=function(_0x43648a,_0xf41239){return _0x43648a[_0x6d3e('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x6d3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc566=['exports','define','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x5e437d,_0x54613f){var _0x4673d8=function(_0x1fdbb8){while(--_0x1fdbb8){_0x5e437d['push'](_0x5e437d['shift']());}};_0x4673d8(++_0x54613f);}(_0xc566,0xd4));var _0x6c56=function(_0x100e04,_0x2070aa){_0x100e04=_0x100e04-0x0;var _0xeee5e7=_0xc566[_0x100e04];return _0xeee5e7;};'use strict';var _=require(_0x6c56('0x0'));var util=require(_0x6c56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6c56('0x2'));var BPromise=require(_0x6c56('0x3'));var rp=require(_0x6c56('0x4'));var fs=require('fs');var path=require(_0x6c56('0x5'));var rimraf=require(_0x6c56('0x6'));var config=require(_0x6c56('0x7'));var attributes=require(_0x6c56('0x8'));module[_0x6c56('0x9')]=function(_0xc46d8f,_0x3e2196){return _0xc46d8f[_0x6c56('0xa')](_0x6c56('0xb'),attributes,{'tableName':_0x6c56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b1cf983..fa760d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x611c25,_0xc25495){var _0x16975e=function(_0x58ce5c){while(--_0x58ce5c){_0x611c25['push'](_0x611c25['shift']());}};_0x16975e(++_0xc25495);}(_0xefda,0x96));var _0xaefd=function(_0x59336b,_0x15b9db){_0x59336b=_0x59336b-0x0;var _0x3873fd=_0xefda[_0x59336b];return _0x3873fd;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['SquareDetailsReport'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});};
\ No newline at end of file
+var _0xb688=['body','options','raw','CreateSquareDetailsReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareDetailsReport','create'];(function(_0x1e24da,_0x3fa04a){var _0x3f20c5=function(_0x1f9e11){while(--_0x1f9e11){_0x1e24da['push'](_0x1e24da['shift']());}};_0x3f20c5(++_0x3fa04a);}(_0xb688,0xcf));var _0x8b68=function(_0x185526,_0x17cefe){_0x185526=_0x185526-0x0;var _0x353f4a=_0xb688[_0x185526];return _0x353f4a;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['CreateSquareDetailsReport']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')](_0xd17693[_0x8b68('0x19')],{'raw':_0xd17693[_0x8b68('0x1a')]?_0xd17693['options'][_0x8b68('0x1b')]===undefined?!![]:![]:!![]})[_0x8b68('0xc')](function(_0x59e9b1){logger[_0x8b68('0xd')](_0x8b68('0x1c'),_0xd17693);logger[_0x8b68('0x10')]('CreateSquareDetailsReport',_0xd17693,JSON['stringify'](_0x59e9b1));_0x4a68c7(_0x59e9b1);})[_0x8b68('0x16')](function(_0x59cb26){logger[_0x8b68('0x12')](_0x8b68('0x1c'),_0x59cb26[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x59cb26[_0x8b68('0x14')]));});});};
\ No newline at end of file
index 27b0ffb..ab8e410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe42=['isAuthenticated','/process/:pid/kill','killProcess','exports','express','./system.controller'];(function(_0x49b12a,_0x86805c){var _0x18bd18=function(_0x5c1d92){while(--_0x5c1d92){_0x49b12a['push'](_0x49b12a['shift']());}};_0x18bd18(++_0x86805c);}(_0xfe42,0x136));var _0x2fe4=function(_0x37172d,_0x446801){_0x37172d=_0x37172d-0x0;var _0x388ad3=_0xfe42[_0x37172d];return _0x388ad3;};'use strict';var express=require(_0x2fe4('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x2fe4('0x1'));router['get']('/',auth[_0x2fe4('0x2')](),controller['index']);router['get'](_0x2fe4('0x3'),auth['isAuthenticated'](),controller[_0x2fe4('0x4')]);module[_0x2fe4('0x5')]=router;
\ No newline at end of file
+var _0xd174=['index','killProcess','exports','express','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x293468,_0x5f1751){var _0x52928a=function(_0x838378){while(--_0x838378){_0x293468['push'](_0x293468['shift']());}};_0x52928a(++_0x5f1751);}(_0xd174,0x1cb));var _0x4d17=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd174[_0x2641f9];return _0x585741;};'use strict';var express=require(_0x4d17('0x0'));var router=express['Router']();var auth=require(_0x4d17('0x1'));var controller=require(_0x4d17('0x2'));router[_0x4d17('0x3')]('/',auth[_0x4d17('0x4')](),controller[_0x4d17('0x5')]);router[_0x4d17('0x3')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x4d17('0x6')]);module[_0x4d17('0x7')]=router;
\ No newline at end of file
index 4ed9528..372c724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f60=['child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','catch','systeminformation'];(function(_0x1c4c56,_0x2bf0bc){var _0x3d96b7=function(_0x2a1f36){while(--_0x2a1f36){_0x1c4c56['push'](_0x1c4c56['shift']());}};_0x3d96b7(++_0x2bf0bc);}(_0x6f60,0x13e));var _0x06f6=function(_0x58cfee,_0x548472){_0x58cfee=_0x58cfee-0x0;var _0x44f451=_0x6f60[_0x58cfee];return _0x44f451;};'use strict';var info=require(_0x06f6('0x0'));var exec=require(_0x06f6('0x1'))[_0x06f6('0x2')];var logger=require(_0x06f6('0x3'))(_0x06f6('0x4'));var util=require(_0x06f6('0x5'));var BPromise=require(_0x06f6('0x6'));var _=require(_0x06f6('0x7'));function handleError(_0x48b1c3,_0x390438,_0xa8311c){_0x390438=_0x390438||0x1f4;return function(_0x5a3f69){logger['error'](_0x06f6('0x8'),_0xa8311c,_0x390438,util[_0x06f6('0x9')](_0x5a3f69,{'showHidden':![],'depth':null}));delete _0x5a3f69[_0x06f6('0xa')];_0x48b1c3[_0x06f6('0xb')](_0x390438)[_0x06f6('0xc')](_0x5a3f69);};}exports[_0x06f6('0xd')]=function(_0x4fcc40,_0x58901d){return info[_0x06f6('0xe')]()[_0x06f6('0xf')](function(_0x468e98){return _0x58901d['status'](0xc8)['json'](_0x468e98);})['catch'](function(_0x18784c){return _0x58901d[_0x06f6('0xb')](0x1f4)[_0x06f6('0x10')](_0x18784c);});};exports[_0x06f6('0x11')]=function(_0x253a14,_0x516d67){var _0x2b6b14=[_0x06f6('0x12')];return new BPromise(function(_0x132214,_0x5d4c43){return exec(util['format'](_0x06f6('0x13'),_0x253a14[_0x06f6('0x14')][_0x06f6('0x15')]),function(_0x53a476,_0x3fca86,_0x6ecc9b){if(_0x53a476){return _0x5d4c43(_0x53a476);}return _0x132214(_0x3fca86);});})['then'](function(_0x4bcef8){var _0x1c37ad=![];var _0x18a5a2=_0x4bcef8['split'](/\n/);for(var _0x533d40=0x0,_0xb1947f=_0x2b6b14[_0x06f6('0x16')];_0x533d40<_0xb1947f,_0x1c37ad===![];_0x533d40+=0x1){if(_0x4bcef8[_0x06f6('0x17')](_0x2b6b14[_0x533d40])>=0x0){_0x1c37ad=!![];}}if(!_0x1c37ad){throw new Error(util['format'](_0x06f6('0x18'),_0x253a14[_0x06f6('0x14')]['pid']));}process[_0x06f6('0x19')](_0x253a14[_0x06f6('0x14')][_0x06f6('0x15')],_0x06f6('0x1a'));return _0x516d67[_0x06f6('0xb')](0xc8)['json']({'message':util[_0x06f6('0x1b')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x253a14['params']['pid'])});})[_0x06f6('0x1c')](handleError(_0x516d67,null,_0x06f6('0x11')));};
\ No newline at end of file
+var _0x8194=['json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','child_process','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData'];(function(_0x4c93ce,_0x12eddd){var _0x4b8955=function(_0x102e93){while(--_0x102e93){_0x4c93ce['push'](_0x4c93ce['shift']());}};_0x4b8955(++_0x12eddd);}(_0x8194,0x18a));var _0x4819=function(_0x2bdd9c,_0x31871a){_0x2bdd9c=_0x2bdd9c-0x0;var _0x2ded3b=_0x8194[_0x2bdd9c];return _0x2ded3b;};'use strict';var info=require('systeminformation');var exec=require(_0x4819('0x0'))['exec'];var logger=require(_0x4819('0x1'))('api');var util=require(_0x4819('0x2'));var BPromise=require(_0x4819('0x3'));var _=require('lodash');function handleError(_0xdb3e72,_0x54a5de,_0x2b2c70){_0x54a5de=_0x54a5de||0x1f4;return function(_0x2fe10b){logger[_0x4819('0x4')](_0x4819('0x5'),_0x2b2c70,_0x54a5de,util[_0x4819('0x6')](_0x2fe10b,{'showHidden':![],'depth':null}));delete _0x2fe10b[_0x4819('0x7')];_0xdb3e72[_0x4819('0x8')](_0x54a5de)[_0x4819('0x9')](_0x2fe10b);};}exports['index']=function(_0x1435c2,_0x3e574d){return info[_0x4819('0xa')]()['then'](function(_0x3b1967){return _0x3e574d[_0x4819('0x8')](0xc8)[_0x4819('0xb')](_0x3b1967);})['catch'](function(_0x523e0f){return _0x3e574d[_0x4819('0x8')](0x1f4)[_0x4819('0xb')](_0x523e0f);});};exports['killProcess']=function(_0x2188bc,_0xd59772){var _0x527f06=[_0x4819('0xc')];return new BPromise(function(_0x542bd0,_0x1c2b6f){return exec(util[_0x4819('0xd')](_0x4819('0xe'),_0x2188bc[_0x4819('0xf')]['pid']),function(_0x3f830b,_0x1e9c72,_0x435025){if(_0x3f830b){return _0x1c2b6f(_0x3f830b);}return _0x542bd0(_0x1e9c72);});})[_0x4819('0x10')](function(_0x211194){var _0x9aaeb7=![];var _0x174310=_0x211194[_0x4819('0x11')](/\n/);for(var _0x47faf2=0x0,_0x4b954c=_0x527f06[_0x4819('0x12')];_0x47faf2<_0x4b954c,_0x9aaeb7===![];_0x47faf2+=0x1){if(_0x211194[_0x4819('0x13')](_0x527f06[_0x47faf2])>=0x0){_0x9aaeb7=!![];}}if(!_0x9aaeb7){throw new Error(util[_0x4819('0xd')](_0x4819('0x14'),_0x2188bc[_0x4819('0xf')][_0x4819('0x15')]));}process[_0x4819('0x16')](_0x2188bc[_0x4819('0xf')][_0x4819('0x15')],_0x4819('0x17'));return _0xd59772[_0x4819('0x8')](0xc8)[_0x4819('0xb')]({'message':util[_0x4819('0xd')](_0x4819('0x18'),_0x2188bc[_0x4819('0xf')][_0x4819('0x15')])});})[_0x4819('0x19')](handleError(_0xd59772,null,_0x4819('0x1a')));};
\ No newline at end of file
index 6b3dc0a..4cfd281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6014=['connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','path'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x6014,0x6d));var _0x4601=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x6014[_0x3a9635];return _0x10d08c;};'use strict';var multer=require(_0x4601('0x0'));var util=require(_0x4601('0x1'));var path=require(_0x4601('0x2'));var timeout=require(_0x4601('0x3'));var express=require('express');var router=express[_0x4601('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4601('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4601('0x6'));var controller=require('./tag.controller');router[_0x4601('0x7')]('/',auth[_0x4601('0x8')](),controller[_0x4601('0x9')]);router[_0x4601('0x7')](_0x4601('0xa'),auth[_0x4601('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4601('0xb')]);router['put'](_0x4601('0xa'),auth[_0x4601('0x8')](),controller[_0x4601('0xc')]);router[_0x4601('0xd')](_0x4601('0xa'),auth[_0x4601('0x8')](),controller[_0x4601('0xe')]);module[_0x4601('0xf')]=router;
\ No newline at end of file
+var _0xfc4e=['index','/:id','show','post','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x43529c,_0x335015){var _0x647056=function(_0x3c79cd){while(--_0x3c79cd){_0x43529c['push'](_0x43529c['shift']());}};_0x647056(++_0x335015);}(_0xfc4e,0xd6));var _0xefc4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xfc4e[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xefc4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xefc4('0x1'));var express=require(_0xefc4('0x2'));var router=express[_0xefc4('0x3')]();var fs_extra=require(_0xefc4('0x4'));var auth=require(_0xefc4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefc4('0x6'));var controller=require(_0xefc4('0x7'));router[_0xefc4('0x8')]('/',auth[_0xefc4('0x9')](),controller[_0xefc4('0xa')]);router[_0xefc4('0x8')](_0xefc4('0xb'),auth[_0xefc4('0x9')](),controller[_0xefc4('0xc')]);router[_0xefc4('0xd')]('/',auth[_0xefc4('0x9')](),controller['create']);router['put'](_0xefc4('0xb'),auth[_0xefc4('0x9')](),controller[_0xefc4('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xefc4('0xf')]=router;
\ No newline at end of file
index b42f812..789d346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc961=['STRING','name','#0091EA','sequelize','exports'];(function(_0x3f1452,_0x524477){var _0x47972a=function(_0x52a2bd){while(--_0x52a2bd){_0x3f1452['push'](_0x3f1452['shift']());}};_0x47972a(++_0x524477);}(_0xc961,0x17a));var _0x1c96=function(_0x528622,_0xcb18f0){_0x528622=_0x528622-0x0;var _0x1b12a0=_0xc961[_0x528622];return _0x1b12a0;};'use strict';var Sequelize=require(_0x1c96('0x0'));module[_0x1c96('0x1')]={'name':{'type':Sequelize[_0x1c96('0x2')],'unique':_0x1c96('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1c96('0x2')],'defaultValue':_0x1c96('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x486e=['name','STRING','#0091EA','sequelize','exports'];(function(_0xe3bbf3,_0x1e5d36){var _0x1ee802=function(_0x513d09){while(--_0x513d09){_0xe3bbf3['push'](_0xe3bbf3['shift']());}};_0x1ee802(++_0x1e5d36);}(_0x486e,0xb2));var _0xe486=function(_0x3b433a,_0x557a55){_0x3b433a=_0x3b433a-0x0;var _0x4a7c21=_0x486e[_0x3b433a];return _0x4a7c21;};'use strict';var Sequelize=require(_0xe486('0x0'));module[_0xe486('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe486('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe486('0x3')],'defaultValue':_0xe486('0x4')},'description':{'type':Sequelize[_0xe486('0x3')]}};
\ No newline at end of file
index 86a187c..1be58b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['save','update','destroy','then','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf109,0xce));var _0x9f10=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xf109[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){var _0x44b99d=_0x4d21c5['get']({'plain':!![]});var _0x2ec07d=_0x9f10('0x26');return db[_0x9f10('0x27')][_0x9f10('0x24')]({'where':{'type':_0x2ec07d,'resourceId':_0x44b99d['id']}})['then'](function(){return _0x4d21c5;});})['then'](function(){_0x3dde2e['status'](0xcc)[_0x9f10('0x19')]();});}};}function handleEntityNotFound(_0x4a0407,_0x314794){return function(_0x1de75a){if(!_0x1de75a){_0x4a0407[_0x9f10('0x28')](0x194);}return _0x1de75a;};}function handleError(_0x2ed95b,_0x2e11b1){_0x2e11b1=_0x2e11b1||0x1f4;return function(_0x4f6b0c){logger[_0x9f10('0x29')](_0x4f6b0c[_0x9f10('0x2a')]);if(_0x4f6b0c[_0x9f10('0x2b')]){delete _0x4f6b0c[_0x9f10('0x2b')];}_0x2ed95b[_0x9f10('0x18')](_0x2e11b1)[_0x9f10('0x2c')](_0x4f6b0c);};}exports['index']=function(_0x358d3f,_0x501ee){var _0x44207f={},_0x1b03ee={},_0x49b3f4={'count':0x0,'rows':[]};var _0x44f0a0=_[_0x9f10('0x2d')](db[_0x9f10('0x2e')]['rawAttributes'],function(_0x434128){return{'name':_0x434128['fieldName'],'type':_0x434128[_0x9f10('0x2f')][_0x9f10('0x30')]};});_0x1b03ee[_0x9f10('0x31')]=_['map'](_0x44f0a0,_0x9f10('0x2b'));_0x1b03ee[_0x9f10('0x32')]=_[_0x9f10('0x33')](_0x358d3f[_0x9f10('0x32')]);_0x1b03ee[_0x9f10('0x34')]=_['intersection'](_0x1b03ee[_0x9f10('0x31')],_0x1b03ee['query']);_0x44207f[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x1b03ee[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44207f['attributes']=_0x44207f[_0x9f10('0x35')][_0x9f10('0x38')]?_0x44207f[_0x9f10('0x35')]:_0x1b03ee['model'];if(!_0x358d3f[_0x9f10('0x32')][_0x9f10('0x39')]('nolimit')){_0x44207f[_0x9f10('0x1b')]=qs['limit'](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1b')]);_0x44207f[_0x9f10('0x1d')]=qs[_0x9f10('0x1d')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1d')]);}_0x44207f[_0x9f10('0x3a')]=qs[_0x9f10('0x3b')](_0x358d3f['query'][_0x9f10('0x3b')]);_0x44207f[_0x9f10('0x3c')]=qs[_0x9f10('0x34')](_['pick'](_0x358d3f[_0x9f10('0x32')],_0x1b03ee[_0x9f10('0x34')]),_0x44f0a0);if(_0x358d3f['query'][_0x9f10('0x3d')]){_0x44207f[_0x9f10('0x3c')]=_[_0x9f10('0x3e')](_0x44207f['where'],{'$or':_['map'](_0x44f0a0,function(_0x2e4e2d){if(_0x2e4e2d[_0x9f10('0x2f')]!==_0x9f10('0x3f')){var _0x433e70={};_0x433e70[_0x2e4e2d[_0x9f10('0x2b')]]={'$like':'%'+_0x358d3f[_0x9f10('0x32')][_0x9f10('0x3d')]+'%'};return _0x433e70;}})});}_0x44207f=_[_0x9f10('0x3e')]({},_0x44207f,_0x358d3f[_0x9f10('0x40')]);var _0x149f8f={'where':_0x44207f[_0x9f10('0x3c')]};return db[_0x9f10('0x2e')]['count'](_0x149f8f)['then'](function(_0x4bb805){_0x49b3f4[_0x9f10('0x1c')]=_0x4bb805;if(_0x358d3f['query'][_0x9f10('0x41')]){_0x44207f[_0x9f10('0x42')]=[{'all':!![]}];}return db[_0x9f10('0x2e')]['findAll'](_0x44207f);})[_0x9f10('0x25')](function(_0xf1164){_0x49b3f4[_0x9f10('0x43')]=_0xf1164;return _0x49b3f4;})[_0x9f10('0x25')](respondWithFilteredResult(_0x501ee,_0x44207f))[_0x9f10('0x44')](handleError(_0x501ee,null));};exports['show']=function(_0x578368,_0x542a22){var _0x44bb34={'raw':!![],'where':{'id':_0x578368[_0x9f10('0x45')]['id']}},_0x5d08fb={};_0x5d08fb['model']=_[_0x9f10('0x33')](db[_0x9f10('0x2e')][_0x9f10('0x46')]);_0x5d08fb[_0x9f10('0x32')]=_['keys'](_0x578368[_0x9f10('0x32')]);_0x5d08fb[_0x9f10('0x34')]=_['intersection'](_0x5d08fb[_0x9f10('0x31')],_0x5d08fb[_0x9f10('0x32')]);_0x44bb34[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x5d08fb[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x578368[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44bb34[_0x9f10('0x35')]=_0x44bb34[_0x9f10('0x35')]['length']?_0x44bb34[_0x9f10('0x35')]:_0x5d08fb[_0x9f10('0x31')];if(_0x578368['query'][_0x9f10('0x41')]){_0x44bb34[_0x9f10('0x42')]=[{'all':!![]}];}_0x44bb34=_[_0x9f10('0x3e')]({},_0x44bb34,_0x578368[_0x9f10('0x40')]);return db['Tag'][_0x9f10('0x47')](_0x44bb34)[_0x9f10('0x25')](handleEntityNotFound(_0x542a22,null))[_0x9f10('0x25')](respondWithResult(_0x542a22,null))[_0x9f10('0x44')](handleError(_0x542a22,null));};exports[_0x9f10('0x48')]=function(_0x43cb31,_0x479b46){return db[_0x9f10('0x2e')][_0x9f10('0x48')](_0x43cb31[_0x9f10('0x49')],{})[_0x9f10('0x25')](function(_0x5c8d13){var _0x1d5436=_0x43cb31['user'][_0x9f10('0x4a')]({'plain':!![]});if(!_0x1d5436)throw new Error(_0x9f10('0x4b'));if(_0x1d5436[_0x9f10('0x4c')]===_0x9f10('0x4d')){var _0x39dae3=_0x5c8d13[_0x9f10('0x4a')]({'plain':!![]});var _0x2b6fe7=_0x9f10('0x26');return db['UserProfileSection'][_0x9f10('0x47')]({'where':{'name':_0x2b6fe7,'userProfileId':_0x1d5436['userProfileId']},'raw':!![]})[_0x9f10('0x25')](function(_0x532808){if(_0x532808&&_0x532808[_0x9f10('0x4e')]===0x0){return db[_0x9f10('0x27')][_0x9f10('0x48')]({'name':_0x39dae3[_0x9f10('0x2b')],'resourceId':_0x39dae3['id'],'type':_0x532808[_0x9f10('0x2b')],'sectionId':_0x532808['id']},{})['then'](function(){return _0x5c8d13;});}else{return _0x5c8d13;}})[_0x9f10('0x44')](function(_0x63abfb){logger[_0x9f10('0x29')](_0x9f10('0x4f'),_0x63abfb);throw _0x63abfb;});}return _0x5c8d13;})['then'](respondWithResult(_0x479b46,0xc9))['catch'](handleError(_0x479b46,null));};exports[_0x9f10('0x23')]=function(_0x22e236,_0x4bd874){if(_0x22e236['body']['id']){delete _0x22e236[_0x9f10('0x49')]['id'];}return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0x22e236['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x4bd874,null))[_0x9f10('0x25')](saveUpdates(_0x22e236[_0x9f10('0x49')],null))['then'](respondWithResult(_0x4bd874,null))[_0x9f10('0x44')](handleError(_0x4bd874,null));};exports[_0x9f10('0x24')]=function(_0xe18852,_0x48a76e){return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0xe18852['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x48a76e,null))[_0x9f10('0x25')](removeEntity(_0x48a76e,null))[_0x9f10('0x44')](handleError(_0x48a76e,null));};
\ No newline at end of file
+var _0xd382=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','create','body','user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Tags','UserProfileResource','destroy','name','send','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x9be3f0,_0x628568){var _0x96930b=function(_0x58855e){while(--_0x58855e){_0x9be3f0['push'](_0x9be3f0['shift']());}};_0x96930b(++_0x628568);}(_0xd382,0x1b6));var _0x2d38=function(_0x91dd02,_0x33b062){_0x91dd02=_0x91dd02-0x0;var _0x3a5899=_0xd382[_0x91dd02];return _0x3a5899;};'use strict';var emlformat=require(_0x2d38('0x0'));var rimraf=require(_0x2d38('0x1'));var zipdir=require(_0x2d38('0x2'));var jsonpatch=require(_0x2d38('0x3'));var rp=require(_0x2d38('0x4'));var moment=require(_0x2d38('0x5'));var BPromise=require(_0x2d38('0x6'));var Mustache=require(_0x2d38('0x7'));var util=require(_0x2d38('0x8'));var path=require(_0x2d38('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d38('0xa'));var _=require(_0x2d38('0xb'));var squel=require('squel');var crypto=require(_0x2d38('0xc'));var jsforce=require(_0x2d38('0xd'));var deskjs=require(_0x2d38('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d38('0xf'));var Redis=require(_0x2d38('0x10'));var authService=require(_0x2d38('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d38('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d38('0x13'))(_0x2d38('0x14'));var utils=require(_0x2d38('0x15'));var config=require(_0x2d38('0x16'));var licenseUtil=require(_0x2d38('0x17'));var db=require(_0x2d38('0x18'))['db'];function respondWithStatusCode(_0x3c068b,_0x4ed69b){_0x4ed69b=_0x4ed69b||0xcc;return function(_0x3dd2c1){if(_0x3dd2c1){return _0x3c068b[_0x2d38('0x19')](_0x4ed69b);}return _0x3c068b[_0x2d38('0x1a')](_0x4ed69b)[_0x2d38('0x1b')]();};}function respondWithResult(_0x149ac2,_0x5cc0a4){_0x5cc0a4=_0x5cc0a4||0xc8;return function(_0x1c7c1d){if(_0x1c7c1d){return _0x149ac2[_0x2d38('0x1a')](_0x5cc0a4)[_0x2d38('0x1c')](_0x1c7c1d);}};}function respondWithFilteredResult(_0x1a2e74,_0x408141){return function(_0xf346b2){if(_0xf346b2){var _0xc6de5a=typeof _0x408141[_0x2d38('0x1d')]===_0x2d38('0x1e')&&typeof _0x408141[_0x2d38('0x1f')]===_0x2d38('0x1e');var _0x13b3fd=_0xf346b2[_0x2d38('0x20')];var _0x1e3028=_0xc6de5a?0x0:_0x408141[_0x2d38('0x1d')];var _0x9904e0=_0xc6de5a?_0xf346b2['count']:_0x408141[_0x2d38('0x1d')]+_0x408141[_0x2d38('0x1f')];var _0x508b8b;if(_0x9904e0>=_0x13b3fd){_0x9904e0=_0x13b3fd;_0x508b8b=0xc8;}else{_0x508b8b=0xce;}_0x1a2e74[_0x2d38('0x1a')](_0x508b8b);return _0x1a2e74[_0x2d38('0x21')](_0x2d38('0x22'),_0x1e3028+'-'+_0x9904e0+'/'+_0x13b3fd)['json'](_0xf346b2);}return null;};}function patchUpdates(_0x46f8be){return function(_0x5ed42e){try{jsonpatch['apply'](_0x5ed42e,_0x46f8be,!![]);}catch(_0xed190){return BPromise[_0x2d38('0x23')](_0xed190);}return _0x5ed42e[_0x2d38('0x24')]();};}function saveUpdates(_0x3892a5,_0x19e658){return function(_0x3138bc){if(_0x3138bc){return _0x3138bc[_0x2d38('0x25')](_0x3892a5)[_0x2d38('0x26')](function(_0x24e2cb){return _0x24e2cb;});}return null;};}function removeEntity(_0x383a0e,_0x584e1f){return function(_0x3283b4){if(_0x3283b4){return _0x3283b4['destroy']()[_0x2d38('0x26')](function(){var _0x530fd9=_0x3283b4[_0x2d38('0x27')]({'plain':!![]});var _0xfa9bd=_0x2d38('0x28');return db[_0x2d38('0x29')][_0x2d38('0x2a')]({'where':{'type':_0xfa9bd,'resourceId':_0x530fd9['id']}})[_0x2d38('0x26')](function(){return _0x3283b4;});})[_0x2d38('0x26')](function(){_0x383a0e['status'](0xcc)[_0x2d38('0x1b')]();});}};}function handleEntityNotFound(_0x3f0f7a,_0x34599a){return function(_0x3d18cd){if(!_0x3d18cd){_0x3f0f7a[_0x2d38('0x19')](0x194);}return _0x3d18cd;};}function handleError(_0xe73710,_0x81299c){_0x81299c=_0x81299c||0x1f4;return function(_0x3a6437){logger['error'](_0x3a6437['stack']);if(_0x3a6437['name']){delete _0x3a6437[_0x2d38('0x2b')];}_0xe73710[_0x2d38('0x1a')](_0x81299c)[_0x2d38('0x2c')](_0x3a6437);};}exports['index']=function(_0x29a38c,_0x4b5891){var _0x2b84cc={},_0x210283={},_0x11e27b={'count':0x0,'rows':[]};var _0x4e8674=_[_0x2d38('0x2d')](db[_0x2d38('0x2e')][_0x2d38('0x2f')],function(_0x52a3ce){return{'name':_0x52a3ce[_0x2d38('0x30')],'type':_0x52a3ce[_0x2d38('0x31')][_0x2d38('0x32')]};});_0x210283[_0x2d38('0x33')]=_[_0x2d38('0x2d')](_0x4e8674,_0x2d38('0x2b'));_0x210283['query']=_[_0x2d38('0x34')](_0x29a38c[_0x2d38('0x35')]);_0x210283[_0x2d38('0x36')]=_[_0x2d38('0x37')](_0x210283['model'],_0x210283[_0x2d38('0x35')]);_0x2b84cc[_0x2d38('0x38')]=_[_0x2d38('0x37')](_0x210283[_0x2d38('0x33')],qs[_0x2d38('0x39')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x39')]));_0x2b84cc[_0x2d38('0x38')]=_0x2b84cc[_0x2d38('0x38')][_0x2d38('0x3a')]?_0x2b84cc['attributes']:_0x210283['model'];if(!_0x29a38c[_0x2d38('0x35')][_0x2d38('0x3b')](_0x2d38('0x3c'))){_0x2b84cc[_0x2d38('0x1f')]=qs[_0x2d38('0x1f')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x1f')]);_0x2b84cc[_0x2d38('0x1d')]=qs[_0x2d38('0x1d')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x1d')]);}_0x2b84cc[_0x2d38('0x3d')]=qs[_0x2d38('0x3e')](_0x29a38c['query'][_0x2d38('0x3e')]);_0x2b84cc[_0x2d38('0x3f')]=qs[_0x2d38('0x36')](_[_0x2d38('0x40')](_0x29a38c['query'],_0x210283[_0x2d38('0x36')]),_0x4e8674);if(_0x29a38c[_0x2d38('0x35')][_0x2d38('0x41')]){_0x2b84cc[_0x2d38('0x3f')]=_[_0x2d38('0x42')](_0x2b84cc[_0x2d38('0x3f')],{'$or':_[_0x2d38('0x2d')](_0x4e8674,function(_0x1084a5){if(_0x1084a5[_0x2d38('0x31')]!==_0x2d38('0x43')){var _0x3cd072={};_0x3cd072[_0x1084a5[_0x2d38('0x2b')]]={'$like':'%'+_0x29a38c[_0x2d38('0x35')][_0x2d38('0x41')]+'%'};return _0x3cd072;}})});}_0x2b84cc=_['merge']({},_0x2b84cc,_0x29a38c[_0x2d38('0x44')]);var _0x1db297={'where':_0x2b84cc['where']};return db['Tag'][_0x2d38('0x20')](_0x1db297)[_0x2d38('0x26')](function(_0x28110c){_0x11e27b['count']=_0x28110c;if(_0x29a38c[_0x2d38('0x35')][_0x2d38('0x45')]){_0x2b84cc[_0x2d38('0x46')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2b84cc);})[_0x2d38('0x26')](function(_0x59de7d){_0x11e27b[_0x2d38('0x47')]=_0x59de7d;return _0x11e27b;})[_0x2d38('0x26')](respondWithFilteredResult(_0x4b5891,_0x2b84cc))[_0x2d38('0x48')](handleError(_0x4b5891,null));};exports['show']=function(_0x50cb25,_0x166af1){var _0x907c4f={'raw':!![],'where':{'id':_0x50cb25['params']['id']}},_0x306d6d={};_0x306d6d[_0x2d38('0x33')]=_[_0x2d38('0x34')](db[_0x2d38('0x2e')]['rawAttributes']);_0x306d6d[_0x2d38('0x35')]=_[_0x2d38('0x34')](_0x50cb25[_0x2d38('0x35')]);_0x306d6d['filters']=_['intersection'](_0x306d6d[_0x2d38('0x33')],_0x306d6d[_0x2d38('0x35')]);_0x907c4f[_0x2d38('0x38')]=_[_0x2d38('0x37')](_0x306d6d['model'],qs[_0x2d38('0x39')](_0x50cb25[_0x2d38('0x35')][_0x2d38('0x39')]));_0x907c4f['attributes']=_0x907c4f[_0x2d38('0x38')]['length']?_0x907c4f['attributes']:_0x306d6d[_0x2d38('0x33')];if(_0x50cb25[_0x2d38('0x35')][_0x2d38('0x45')]){_0x907c4f[_0x2d38('0x46')]=[{'all':!![]}];}_0x907c4f=_['merge']({},_0x907c4f,_0x50cb25['options']);return db[_0x2d38('0x2e')]['find'](_0x907c4f)[_0x2d38('0x26')](handleEntityNotFound(_0x166af1,null))[_0x2d38('0x26')](respondWithResult(_0x166af1,null))[_0x2d38('0x48')](handleError(_0x166af1,null));};exports[_0x2d38('0x49')]=function(_0x35a2ae,_0x1b94de){return db[_0x2d38('0x2e')][_0x2d38('0x49')](_0x35a2ae[_0x2d38('0x4a')],{})['then'](function(_0x218c61){var _0x481320=_0x35a2ae[_0x2d38('0x4b')][_0x2d38('0x27')]({'plain':!![]});if(!_0x481320)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481320[_0x2d38('0x4c')]===_0x2d38('0x4b')){var _0x187ba3=_0x218c61[_0x2d38('0x27')]({'plain':!![]});var _0x275078=_0x2d38('0x28');return db[_0x2d38('0x4d')][_0x2d38('0x4e')]({'where':{'name':_0x275078,'userProfileId':_0x481320['userProfileId']},'raw':!![]})[_0x2d38('0x26')](function(_0x8d781e){if(_0x8d781e&&_0x8d781e[_0x2d38('0x4f')]===0x0){return db[_0x2d38('0x29')][_0x2d38('0x49')]({'name':_0x187ba3[_0x2d38('0x2b')],'resourceId':_0x187ba3['id'],'type':_0x8d781e[_0x2d38('0x2b')],'sectionId':_0x8d781e['id']},{})[_0x2d38('0x26')](function(){return _0x218c61;});}else{return _0x218c61;}})[_0x2d38('0x48')](function(_0x5c7dd5){logger[_0x2d38('0x50')](_0x2d38('0x51'),_0x5c7dd5);throw _0x5c7dd5;});}return _0x218c61;})['then'](respondWithResult(_0x1b94de,0xc9))['catch'](handleError(_0x1b94de,null));};exports[_0x2d38('0x25')]=function(_0x5ba127,_0x208ae0){if(_0x5ba127[_0x2d38('0x4a')]['id']){delete _0x5ba127['body']['id'];}return db['Tag'][_0x2d38('0x4e')]({'where':{'id':_0x5ba127[_0x2d38('0x52')]['id']}})[_0x2d38('0x26')](handleEntityNotFound(_0x208ae0,null))[_0x2d38('0x26')](saveUpdates(_0x5ba127[_0x2d38('0x4a')],null))[_0x2d38('0x26')](respondWithResult(_0x208ae0,null))[_0x2d38('0x48')](handleError(_0x208ae0,null));};exports[_0x2d38('0x2a')]=function(_0x1348f8,_0x24c107){return db[_0x2d38('0x2e')]['find']({'where':{'id':_0x1348f8[_0x2d38('0x52')]['id']}})['then'](handleEntityNotFound(_0x24c107,null))['then'](removeEntity(_0x24c107,null))[_0x2d38('0x48')](handleError(_0x24c107,null));};
\ No newline at end of file
index 0c59595..d43ec58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd70=['Tag','tools_tags','lodash','util','api','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0xdd70,0x7a));var _0x0dd7=function(_0x115f4a,_0x2698bf){_0x115f4a=_0x115f4a-0x0;var _0x291355=_0xdd70[_0x115f4a];return _0x291355;};'use strict';var _=require(_0x0dd7('0x0'));var util=require(_0x0dd7('0x1'));var logger=require('../../config/logger')(_0x0dd7('0x2'));var moment=require('moment');var BPromise=require(_0x0dd7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dd7('0x4'));var rimraf=require(_0x0dd7('0x5'));var config=require(_0x0dd7('0x6'));var attributes=require(_0x0dd7('0x7'));module[_0x0dd7('0x8')]=function(_0xb18522,_0x14e232){return _0xb18522[_0x0dd7('0x9')](_0x0dd7('0xa'),attributes,{'tableName':_0x0dd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc85=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x4e7dd9,_0x180a24){var _0x10a485=function(_0x1b6332){while(--_0x1b6332){_0x4e7dd9['push'](_0x4e7dd9['shift']());}};_0x10a485(++_0x180a24);}(_0xdc85,0x1b1));var _0x5dc8=function(_0x3ab39f,_0x4df11b){_0x3ab39f=_0x3ab39f-0x0;var _0x2dc502=_0xdc85[_0x3ab39f];return _0x2dc502;};'use strict';var _=require(_0x5dc8('0x0'));var util=require(_0x5dc8('0x1'));var logger=require(_0x5dc8('0x2'))(_0x5dc8('0x3'));var moment=require(_0x5dc8('0x4'));var BPromise=require(_0x5dc8('0x5'));var rp=require(_0x5dc8('0x6'));var fs=require('fs');var path=require(_0x5dc8('0x7'));var rimraf=require(_0x5dc8('0x8'));var config=require(_0x5dc8('0x9'));var attributes=require(_0x5dc8('0xa'));module[_0x5dc8('0xb')]=function(_0x35fa78,_0x4287f5){return _0x35fa78[_0x5dc8('0xc')](_0x5dc8('0xd'),attributes,{'tableName':_0x5dc8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7de236f..6248fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['Tag,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','debug'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xb458,0x103));var _0x8b45=function(_0xc04f88,_0x100d4b){_0xc04f88=_0xc04f88-0x0;var _0x1aa36d=_0xb458[_0xc04f88];return _0x1aa36d;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});}
\ No newline at end of file
+var _0x60c2=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f6e3c,_0x4d40c0){var _0x43cd25=function(_0x30e5df){while(--_0x30e5df){_0x1f6e3c['push'](_0x1f6e3c['shift']());}};_0x43cd25(++_0x4d40c0);}(_0x60c2,0x8f));var _0x260c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x60c2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var moment=require(_0x260c('0x1'));var BPromise=require(_0x260c('0x2'));var rs=require(_0x260c('0x3'));var fs=require('fs');var Redis=require(_0x260c('0x4'));var db=require(_0x260c('0x5'))['db'];var utils=require(_0x260c('0x6'));var logger=require(_0x260c('0x7'))(_0x260c('0x8'));var config=require(_0x260c('0x9'));var jayson=require(_0x260c('0xa'));var client=jayson[_0x260c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14fab2,_0x2c2cd8,_0x3b432d){return new BPromise(function(_0xf22c37,_0x4b2992){return client[_0x260c('0xc')](_0x14fab2,_0x3b432d)[_0x260c('0xd')](function(_0x8378bb){logger[_0x260c('0xe')](_0x260c('0xf'),_0x2c2cd8,_0x260c('0x10'));logger[_0x260c('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x2c2cd8,_0x260c('0x10'),JSON[_0x260c('0x12')](_0x8378bb));if(_0x8378bb[_0x260c('0x13')]){if(_0x8378bb['error'][_0x260c('0x14')]===0x1f4){logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x8378bb['error'][_0x260c('0x15')]);return _0x4b2992(_0x8378bb[_0x260c('0x13')][_0x260c('0x15')]);}logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x8378bb['error'][_0x260c('0x15')]);return _0xf22c37(_0x8378bb['error'][_0x260c('0x15')]);}else{logger[_0x260c('0xe')]('Tag,\x20%s,\x20%s',_0x2c2cd8,_0x260c('0x10'));_0xf22c37(_0x8378bb['result'][_0x260c('0x15')]);}})[_0x260c('0x16')](function(_0x411970){logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x411970);_0x4b2992(_0x411970);});});}
\ No newline at end of file
index 90c1442..a0e434a 100644 (file)
@@ -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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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
index 117f38d..1c768e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x2084c3,_0x1ef5af){var _0x49d897=function(_0x3b84ff){while(--_0x3b84ff){_0x2084c3['push'](_0x2084c3['shift']());}};_0x49d897(++_0x1ef5af);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0xb10b[_0x2c93e2];return _0x57264e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xb10b=['name','sequelize','STRING'];(function(_0x57a01e,_0x758520){var _0x5c67bc=function(_0x5b3b6e){while(--_0x5b3b6e){_0x57a01e['push'](_0x57a01e['shift']());}};_0x5c67bc(++_0x758520);}(_0xb10b,0x12a));var _0xbb10=function(_0x1bfd25,_0x349005){_0x1bfd25=_0x1bfd25-0x0;var _0x11804d=_0xb10b[_0x1bfd25];return _0x11804d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index 5bc375a..9628b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe950=['interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','isArray','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./team.socket','status','end','json','offset','count','limit','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','Team','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','keys','find','create','user','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','Teams','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save'];(function(_0x2d9005,_0x371d26){var _0x1d1d58=function(_0x491d22){while(--_0x491d22){_0x2d9005['push'](_0x2d9005['shift']());}};_0x1d1d58(++_0x371d26);}(_0xe950,0x1d5));var _0x0e95=function(_0x199b38,_0x66def6){_0x199b38=_0x199b38-0x0;var _0x123b80=_0xe950[_0x199b38];return _0x123b80;};'use strict';var emlformat=require(_0x0e95('0x0'));var rimraf=require(_0x0e95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e95('0x2'));var rp=require(_0x0e95('0x3'));var moment=require(_0x0e95('0x4'));var BPromise=require(_0x0e95('0x5'));var Mustache=require(_0x0e95('0x6'));var util=require(_0x0e95('0x7'));var path=require('path');var sox=require(_0x0e95('0x8'));var csv=require('to-csv');var ejs=require(_0x0e95('0x9'));var fs=require('fs');var fs_extra=require(_0x0e95('0xa'));var _=require(_0x0e95('0xb'));var squel=require(_0x0e95('0xc'));var crypto=require(_0x0e95('0xd'));var jsforce=require(_0x0e95('0xe'));var deskjs=require(_0x0e95('0xf'));var toCsv=require(_0x0e95('0x10'));var querystring=require(_0x0e95('0x11'));var Papa=require(_0x0e95('0x12'));var Redis=require(_0x0e95('0x13'));var authService=require(_0x0e95('0x14'));var qs=require(_0x0e95('0x15'));var as=require(_0x0e95('0x16'));var hardwareService=require(_0x0e95('0x17'));var logger=require(_0x0e95('0x18'))(_0x0e95('0x19'));var utils=require(_0x0e95('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x0e95('0x1b'));var db=require(_0x0e95('0x1c'))['db'];config['redis']=_[_0x0e95('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e95('0x1e'))(new Redis(config[_0x0e95('0x1f')]));require(_0x0e95('0x20'))['register'](socket);function respondWithStatusCode(_0x18d8a4,_0xc9ebc2){_0xc9ebc2=_0xc9ebc2||0xcc;return function(_0x31fdaf){if(_0x31fdaf){return _0x18d8a4['sendStatus'](_0xc9ebc2);}return _0x18d8a4[_0x0e95('0x21')](_0xc9ebc2)[_0x0e95('0x22')]();};}function respondWithResult(_0x5e54d5,_0x501ae6){_0x501ae6=_0x501ae6||0xc8;return function(_0x2b6a3f){if(_0x2b6a3f){return _0x5e54d5[_0x0e95('0x21')](_0x501ae6)[_0x0e95('0x23')](_0x2b6a3f);}};}function respondWithFilteredResult(_0x12434b,_0x692faa){return function(_0x47ce58){if(_0x47ce58){var _0x539442=typeof _0x692faa[_0x0e95('0x24')]==='undefined'&&typeof _0x692faa['limit']==='undefined';var _0x28c36c=_0x47ce58[_0x0e95('0x25')];var _0x53b140=_0x539442?0x0:_0x692faa[_0x0e95('0x24')];var _0x33ff5d=_0x539442?_0x47ce58['count']:_0x692faa[_0x0e95('0x24')]+_0x692faa[_0x0e95('0x26')];var _0x549bf3;if(_0x33ff5d>=_0x28c36c){_0x33ff5d=_0x28c36c;_0x549bf3=0xc8;}else{_0x549bf3=0xce;}_0x12434b['status'](_0x549bf3);return _0x12434b['set'](_0x0e95('0x27'),_0x53b140+'-'+_0x33ff5d+'/'+_0x28c36c)[_0x0e95('0x23')](_0x47ce58);}return null;};}function patchUpdates(_0x724d04){return function(_0x1e1174){try{jsonpatch[_0x0e95('0x28')](_0x1e1174,_0x724d04,!![]);}catch(_0x40b5d3){return BPromise[_0x0e95('0x29')](_0x40b5d3);}return _0x1e1174[_0x0e95('0x2a')]();};}function saveUpdates(_0x12a01c,_0x221924){return function(_0xf3eea1){if(_0xf3eea1){return _0xf3eea1['update'](_0x12a01c)[_0x0e95('0x2b')](function(_0x59a0e8){return _0x59a0e8;});}return null;};}function handleEntityNotFound(_0x410769,_0x4b04c9){return function(_0x27ea7b){if(!_0x27ea7b){_0x410769[_0x0e95('0x2c')](0x194);}return _0x27ea7b;};}function handleError(_0x357ebc,_0x37348e){_0x37348e=_0x37348e||0x1f4;return function(_0x5a1e6d){logger[_0x0e95('0x2d')](_0x5a1e6d[_0x0e95('0x2e')]);if(_0x5a1e6d[_0x0e95('0x2f')]){delete _0x5a1e6d[_0x0e95('0x2f')];}_0x357ebc[_0x0e95('0x21')](_0x37348e)[_0x0e95('0x30')](_0x5a1e6d);};}exports['index']=function(_0x1ba4a8,_0x4fb0fe){var _0x21b49c={},_0x2f0583={},_0x4ceca4={'count':0x0,'rows':[]};var _0x11f53=_['map'](db[_0x0e95('0x31')][_0x0e95('0x32')],function(_0x2aa3ba){return{'name':_0x2aa3ba[_0x0e95('0x33')],'type':_0x2aa3ba[_0x0e95('0x34')]['key']};});_0x2f0583[_0x0e95('0x35')]=_['map'](_0x11f53,_0x0e95('0x2f'));_0x2f0583[_0x0e95('0x36')]=_['keys'](_0x1ba4a8[_0x0e95('0x36')]);_0x2f0583[_0x0e95('0x37')]=_['intersection'](_0x2f0583[_0x0e95('0x35')],_0x2f0583['query']);_0x21b49c[_0x0e95('0x38')]=_[_0x0e95('0x39')](_0x2f0583[_0x0e95('0x35')],qs[_0x0e95('0x3a')](_0x1ba4a8[_0x0e95('0x36')]['fields']));_0x21b49c[_0x0e95('0x38')]=_0x21b49c['attributes'][_0x0e95('0x3b')]?_0x21b49c['attributes']:_0x2f0583['model'];if(!_0x1ba4a8[_0x0e95('0x36')]['hasOwnProperty'](_0x0e95('0x3c'))){_0x21b49c['limit']=qs['limit'](_0x1ba4a8['query'][_0x0e95('0x26')]);_0x21b49c[_0x0e95('0x24')]=qs['offset'](_0x1ba4a8[_0x0e95('0x36')][_0x0e95('0x24')]);}_0x21b49c[_0x0e95('0x3d')]=qs[_0x0e95('0x3e')](_0x1ba4a8[_0x0e95('0x36')][_0x0e95('0x3e')]);_0x21b49c[_0x0e95('0x3f')]=qs[_0x0e95('0x37')](_[_0x0e95('0x40')](_0x1ba4a8['query'],_0x2f0583[_0x0e95('0x37')]),_0x11f53);if(_0x1ba4a8['query'][_0x0e95('0x41')]){_0x21b49c['where']=_[_0x0e95('0x42')](_0x21b49c[_0x0e95('0x3f')],{'$or':_[_0x0e95('0x43')](_0x11f53,function(_0x379d35){if(_0x379d35[_0x0e95('0x34')]!=='VIRTUAL'){var _0x240d27={};_0x240d27[_0x379d35[_0x0e95('0x2f')]]={'$like':'%'+_0x1ba4a8[_0x0e95('0x36')][_0x0e95('0x41')]+'%'};return _0x240d27;}})});}_0x21b49c=_[_0x0e95('0x42')]({},_0x21b49c,_0x1ba4a8[_0x0e95('0x44')]);var _0x16b9d8={'where':_0x21b49c[_0x0e95('0x3f')]};return db[_0x0e95('0x31')][_0x0e95('0x25')](_0x16b9d8)[_0x0e95('0x2b')](function(_0x4fb940){_0x4ceca4['count']=_0x4fb940;if(_0x1ba4a8[_0x0e95('0x36')][_0x0e95('0x45')]){_0x21b49c[_0x0e95('0x46')]=[{'all':!![]}];}return db[_0x0e95('0x31')][_0x0e95('0x47')](_0x21b49c);})[_0x0e95('0x2b')](function(_0x15b29a){_0x4ceca4[_0x0e95('0x48')]=_0x15b29a;return _0x4ceca4;})[_0x0e95('0x2b')](respondWithFilteredResult(_0x4fb0fe,_0x21b49c))[_0x0e95('0x49')](handleError(_0x4fb0fe,null));};exports[_0x0e95('0x4a')]=function(_0x264830,_0x5746eb){var _0x1b09c0={'raw':![],'where':{'id':_0x264830['params']['id']}},_0x28aca5={};_0x28aca5['model']=_[_0x0e95('0x4b')](db[_0x0e95('0x31')][_0x0e95('0x32')]);_0x28aca5[_0x0e95('0x36')]=_[_0x0e95('0x4b')](_0x264830[_0x0e95('0x36')]);_0x28aca5[_0x0e95('0x37')]=_[_0x0e95('0x39')](_0x28aca5[_0x0e95('0x35')],_0x28aca5[_0x0e95('0x36')]);_0x1b09c0[_0x0e95('0x38')]=_[_0x0e95('0x39')](_0x28aca5[_0x0e95('0x35')],qs[_0x0e95('0x3a')](_0x264830['query'][_0x0e95('0x3a')]));_0x1b09c0[_0x0e95('0x38')]=_0x1b09c0[_0x0e95('0x38')][_0x0e95('0x3b')]?_0x1b09c0[_0x0e95('0x38')]:_0x28aca5['model'];if(_0x264830['query'][_0x0e95('0x45')]){_0x1b09c0[_0x0e95('0x46')]=[{'all':!![]}];}_0x1b09c0=_['merge']({},_0x1b09c0,_0x264830['options']);return db['Team'][_0x0e95('0x4c')](_0x1b09c0)['then'](handleEntityNotFound(_0x5746eb,null))['then'](respondWithResult(_0x5746eb,null))[_0x0e95('0x49')](handleError(_0x5746eb,null));};exports[_0x0e95('0x4d')]=function(_0x2004eb,_0xf79ed9){return db['Team'][_0x0e95('0x4d')](_0x2004eb['body'],{})['then'](function(_0x43d1e2){var _0x374d2d=_0x2004eb[_0x0e95('0x4e')][_0x0e95('0x4f')]({'plain':!![]});if(!_0x374d2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x374d2d['role']===_0x0e95('0x4e')){var _0x183e23=_0x43d1e2[_0x0e95('0x4f')]({'plain':!![]});var _0x20f29f='Teams';return db[_0x0e95('0x50')]['find']({'where':{'name':_0x20f29f,'userProfileId':_0x374d2d['userProfileId']},'raw':!![]})[_0x0e95('0x2b')](function(_0x3af5b2){if(_0x3af5b2&&_0x3af5b2['autoAssociation']===0x0){return db[_0x0e95('0x51')][_0x0e95('0x4d')]({'name':_0x183e23[_0x0e95('0x2f')],'resourceId':_0x183e23['id'],'type':_0x3af5b2[_0x0e95('0x2f')],'sectionId':_0x3af5b2['id']},{})[_0x0e95('0x2b')](function(){return _0x43d1e2;});}else{return _0x43d1e2;}})[_0x0e95('0x49')](function(_0x3cb99e){logger[_0x0e95('0x2d')](_0x0e95('0x52'),_0x3cb99e);throw _0x3cb99e;});}return _0x43d1e2;})[_0x0e95('0x2b')](respondWithResult(_0xf79ed9,0xc9))['catch'](handleError(_0xf79ed9,null));};exports[_0x0e95('0x53')]=function(_0x5e77c8,_0x31c219){if(_0x5e77c8[_0x0e95('0x54')]['id']){delete _0x5e77c8[_0x0e95('0x54')]['id'];}return db[_0x0e95('0x31')][_0x0e95('0x4c')]({'where':{'id':_0x5e77c8[_0x0e95('0x55')]['id']}})['then'](handleEntityNotFound(_0x31c219,null))['then'](saveUpdates(_0x5e77c8[_0x0e95('0x54')],null))[_0x0e95('0x2b')](respondWithResult(_0x31c219,null))[_0x0e95('0x49')](handleError(_0x31c219,null));};exports['destroy']=function(_0x1a9ff5,_0x57cc58){var _0x3eb017=_0x1a9ff5[_0x0e95('0x55')]['id'];var _0x3f2de7=[];return db['sequelize'][_0x0e95('0x56')](function(_0x143743){var _0x2767d1=_0x0e95('0x57')+_0x3eb017;return db['sequelize']['query'](_0x2767d1,{'type':db[_0x0e95('0x58')][_0x0e95('0x59')][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743})[_0x0e95('0x2b')](function(_0x3bb792){_0x3f2de7=_['map'](_0x3bb792,function(_0x54fb09){return Number(_0x54fb09[_0x0e95('0x5b')]);});})[_0x0e95('0x2b')](function(){var _0x5084ad=_0x0e95('0x5c')+_0x3eb017;return db['sequelize']['query'](_0x5084ad,{'type':db[_0x0e95('0x58')][_0x0e95('0x59')][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x1ef014){var _0x7509b9=_[_0x0e95('0x43')](_0x1ef014,function(_0x5637d4){return Number(_0x5637d4[_0x0e95('0x5d')]);});return db[_0x0e95('0x5e')][_0x0e95('0x5f')]({'where':{'UserId':{'$in':_0x3f2de7},'VoiceQueueId':{'$in':_0x7509b9}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){var _0x50f741=_0x0e95('0x60')+_0x3eb017;return db[_0x0e95('0x61')][_0x0e95('0x36')](_0x50f741,{'type':db[_0x0e95('0x58')][_0x0e95('0x59')][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x2664ff){var _0x1e6b3f=_[_0x0e95('0x43')](_0x2664ff,function(_0x500110){return Number(_0x500110[_0x0e95('0x62')]);});return db[_0x0e95('0x63')][_0x0e95('0x5f')]({'where':{'UserId':{'$in':_0x3f2de7},'MailQueueId':{'$in':_0x1e6b3f}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){var _0x48e1b3=_0x0e95('0x64')+_0x3eb017;return db[_0x0e95('0x61')][_0x0e95('0x36')](_0x48e1b3,{'type':db[_0x0e95('0x58')]['QueryTypes'][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})['then'](function(_0x23003f){var _0x29c582=_[_0x0e95('0x43')](_0x23003f,function(_0x53afca){return Number(_0x53afca[_0x0e95('0x65')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x3f2de7},'SmsQueueId':{'$in':_0x29c582}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){var _0x49e8c0=_0x0e95('0x66')+_0x3eb017;return db[_0x0e95('0x61')][_0x0e95('0x36')](_0x49e8c0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x46642f){var _0x1523bc=_[_0x0e95('0x43')](_0x46642f,function(_0x4fd91b){return Number(_0x4fd91b[_0x0e95('0x67')]);});return db[_0x0e95('0x68')][_0x0e95('0x5f')]({'where':{'UserId':{'$in':_0x3f2de7},'ChatQueueId':{'$in':_0x1523bc}},'transaction':_0x143743});})['then'](function(){var _0x1d3324=_0x0e95('0x69')+_0x3eb017;return db[_0x0e95('0x61')][_0x0e95('0x36')](_0x1d3324,{'type':db[_0x0e95('0x58')][_0x0e95('0x59')][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x561390){var _0x2b0481=_['map'](_0x561390,function(_0x44c484){return Number(_0x44c484['FaxQueueId']);});return db[_0x0e95('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x3f2de7},'FaxQueueId':{'$in':_0x2b0481}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){var _0x48aa42='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3eb017;return db[_0x0e95('0x61')]['query'](_0x48aa42,{'type':db[_0x0e95('0x58')]['QueryTypes'][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x5c514e){var _0x313c5c=_['map'](_0x5c514e,function(_0x5d1431){return Number(_0x5d1431[_0x0e95('0x6b')]);});return db[_0x0e95('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x3f2de7},'OpenchannelQueueId':{'$in':_0x313c5c}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){var _0x5654a4='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3eb017;return db[_0x0e95('0x61')]['query'](_0x5654a4,{'type':db[_0x0e95('0x58')]['QueryTypes'][_0x0e95('0x5a')],'raw':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x5857e1){var _0x45bf03=_[_0x0e95('0x43')](_0x5857e1,function(_0x3942c3){return Number(_0x3942c3[_0x0e95('0x6d')]);});return db['UserWhatsappQueue'][_0x0e95('0x5f')]({'where':{'UserId':{'$in':_0x3f2de7},'WhatsappQueueId':{'$in':_0x45bf03}},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){return db[_0x0e95('0x6e')][_0x0e95('0x4c')]({'where':{'TeamId':_0x3eb017}});})[_0x0e95('0x2b')](function(_0x3bb5ba){if(_0x3bb5ba===null){return;}return db[_0x0e95('0x6f')][_0x0e95('0x5f')]({'where':{'UserId':{'$in':_0x3f2de7},'VoicePrefixId':_0x3bb5ba['VoicePrefixId']},'transaction':_0x143743});})[_0x0e95('0x2b')](function(){return db[_0x0e95('0x31')]['destroy']({'where':{'id':_0x3eb017},'cascade':!![],'transaction':_0x143743});})[_0x0e95('0x2b')](function(_0x20b152){if(_0x20b152===0x0){_0x57cc58[_0x0e95('0x2c')](0x194);}else{return db[_0x0e95('0x51')][_0x0e95('0x5f')]({'where':{'type':_0x0e95('0x70'),'resourceId':_0x3eb017},'cascade':!![],'transaction':_0x143743})[_0x0e95('0x2b')](function(){_0x57cc58[_0x0e95('0x21')](0xcc)['end']();});}})[_0x0e95('0x49')](function(_0x21c616){_0x57cc58[_0x0e95('0x21')](0x1f4)[_0x0e95('0x30')](_0x21c616);});});};exports['getQueues']=function(_0x6f4c80,_0x1b2df3,_0x421a51){return db['Team'][_0x0e95('0x71')]({'where':{'id':_0x6f4c80[_0x0e95('0x55')]['id']}})[_0x0e95('0x2b')](handleEntityNotFound(_0x1b2df3,null))[_0x0e95('0x2b')](function(_0x19866b){if(!_0x6f4c80[_0x0e95('0x36')][_0x0e95('0x72')]||!utils['isValidChannel'](_0x6f4c80[_0x0e95('0x36')][_0x0e95('0x72')])){throw new db['Sequelize'][(_0x0e95('0x73'))](_0x0e95('0x74'));}var _0x59ec57={};var _0xfdb92={};_0xfdb92[_0x0e95('0x35')]=_[_0x0e95('0x4b')](db[_[_0x0e95('0x75')](_0x6f4c80[_0x0e95('0x36')][_0x0e95('0x72')][_0x0e95('0x76')]())+_0x0e95('0x77')][_0x0e95('0x32')]);_0xfdb92[_0x0e95('0x36')]=_[_0x0e95('0x4b')](_0x6f4c80[_0x0e95('0x36')]);_0xfdb92[_0x0e95('0x37')]=_[_0x0e95('0x39')](_0xfdb92[_0x0e95('0x35')],_0xfdb92[_0x0e95('0x36')]);_0x59ec57[_0x0e95('0x38')]=_['intersection'](_0xfdb92[_0x0e95('0x35')],qs[_0x0e95('0x3a')](_0x6f4c80[_0x0e95('0x36')][_0x0e95('0x3a')]));_0x59ec57[_0x0e95('0x38')]=_0x59ec57[_0x0e95('0x38')][_0x0e95('0x3b')]?_0x59ec57[_0x0e95('0x38')]:_0xfdb92[_0x0e95('0x35')];_0x59ec57[_0x0e95('0x26')]=qs[_0x0e95('0x26')](_0x6f4c80[_0x0e95('0x36')][_0x0e95('0x26')]);_0x59ec57['offset']=qs[_0x0e95('0x24')](_0x6f4c80['query']['offset']);_0x59ec57[_0x0e95('0x3d')]=qs[_0x0e95('0x3e')](_0x6f4c80[_0x0e95('0x36')]['sort']);_0x59ec57[_0x0e95('0x3f')]=qs['filters'](_[_0x0e95('0x40')](_0x6f4c80[_0x0e95('0x36')],_0xfdb92['filters']));_0x59ec57=_[_0x0e95('0x42')]({},_0x59ec57,_0x6f4c80['options']);return _0x19866b['get'+_[_0x0e95('0x75')](_0x6f4c80[_0x0e95('0x36')]['channel']['toLowerCase']())+_0x0e95('0x78')](_0x59ec57);})[_0x0e95('0x2b')](respondWithResult(_0x1b2df3,null))[_0x0e95('0x49')](handleError(_0x1b2df3,null));};exports[_0x0e95('0x79')]=function(_0x2f52e3,_0x298961,_0x2d2ecd){return db['Team'][_0x0e95('0x71')]({'where':{'id':_0x2f52e3['params']['id']}})[_0x0e95('0x2b')](function(_0x3784ca){if(_0x3784ca){if(!_0x2f52e3['body'][_0x0e95('0x72')]||!utils[_0x0e95('0x7a')](_0x2f52e3[_0x0e95('0x54')][_0x0e95('0x72')])){throw new db[(_0x0e95('0x58'))][(_0x0e95('0x73'))](_0x0e95('0x74'));}return _0x3784ca['add'+_['capitalize'](_0x2f52e3[_0x0e95('0x54')][_0x0e95('0x72')][_0x0e95('0x76')]())+_0x0e95('0x78')](_0x2f52e3[_0x0e95('0x54')][_0x0e95('0x7b')]);}return null;})[_0x0e95('0x2b')](handleEntityNotFound(_0x298961,null))[_0x0e95('0x2b')](respondWithStatusCode(_0x298961,null))['catch'](handleError(_0x298961,null));};exports[_0x0e95('0x7c')]=function(_0x25abb6,_0x59acf7,_0x49e629){return db[_0x0e95('0x31')]['findOne']({'where':{'id':_0x25abb6['params']['id']}})[_0x0e95('0x2b')](function(_0x3b46e4){if(_0x3b46e4){if(!_0x25abb6[_0x0e95('0x36')][_0x0e95('0x72')]||!utils[_0x0e95('0x7a')](_0x25abb6[_0x0e95('0x36')][_0x0e95('0x72')])){throw new db['Sequelize']['ValidationError'](_0x0e95('0x74'));}return _0x3b46e4[_0x0e95('0x7d')+_[_0x0e95('0x75')](_0x25abb6[_0x0e95('0x36')][_0x0e95('0x72')][_0x0e95('0x76')]())+_0x0e95('0x78')](_0x25abb6[_0x0e95('0x36')][_0x0e95('0x7b')]);}return null;})[_0x0e95('0x2b')](handleEntityNotFound(_0x59acf7,null))[_0x0e95('0x2b')](respondWithStatusCode(_0x59acf7,null))['catch'](handleError(_0x59acf7,null));};exports[_0x0e95('0x7e')]=function(_0x55a856,_0x5830a5){var _0x2c02db=_['isArray'](_0x55a856['body'][_0x0e95('0x7b')])?_0x55a856[_0x0e95('0x54')]['ids']:[_0x55a856[_0x0e95('0x54')]['ids']];var _0x496f6f=_0x55a856[_0x0e95('0x55')]['id'];return db[_0x0e95('0x31')][_0x0e95('0x4c')]({'where':{'id':_0x496f6f}})[_0x0e95('0x2b')](handleEntityNotFound(_0x5830a5,null))[_0x0e95('0x2b')](function(_0x358c01){if(_0x358c01){var _0x3c6716=[_0x0e95('0x7f'),_0x0e95('0x80'),_0x0e95('0x81'),_0x0e95('0x82'),'Fax',_0x0e95('0x83'),_0x0e95('0x84')];return db[_0x0e95('0x61')][_0x0e95('0x56')](function(_0x23328e){var _0x27b1f5=_['map'](_0x3c6716,function(_0x2fa0a2){var _0x1246d3={'attributes':['id',_0x0e95('0x2f')]};if(_0x2fa0a2===_0x0e95('0x7f')){_0x1246d3['through']={'attributes':[_0x0e95('0x85')]};}return _0x358c01[_0x0e95('0x4f')+_0x2fa0a2+_0x0e95('0x78')](_0x1246d3)[_0x0e95('0x2b')](function(_0x216cb6){var _0x4448a5=_[_0x0e95('0x43')](_0x216cb6,function(_0x2737a4){var _0x32e3db=_['map'](_0x2c02db,function(_0x10fd4c){var _0x4ce40b={'where':{'UserId':_0x10fd4c,[_0x2fa0a2+_0x0e95('0x86')]:_0x2737a4['id']},'transaction':_0x23328e};if(_0x2fa0a2===_0x0e95('0x7f')){_0x4ce40b[_0x0e95('0x1d')]={'penalty':_0x2737a4[_0x0e95('0x87')]['penalty']};}return db[_0x0e95('0x88')+_0x2fa0a2+_0x0e95('0x77')]['findOrCreate'](_0x4ce40b)[_0x0e95('0x2b')](function(){socket[_0x0e95('0x89')]('user'+_0x2fa0a2+_0x0e95('0x8a'),{'UserId':_0x10fd4c,[_0x2fa0a2+_0x0e95('0x86')]:_0x2737a4['id']});if(_0x2fa0a2!==_0x0e95('0x7f')){return;}return db[_0x0e95('0x88')][_0x0e95('0x47')]({'where':{'id':_0x2c02db,'online':0x1},'attributes':['id','name','online','voicePause',_0x0e95('0x8b')],'raw':!![]})[_0x0e95('0x2b')](function(_0x41f33c){var _0x5d812d=_[_0x0e95('0x43')](_0x41f33c,function(_0x25d6c0){return db[_0x0e95('0x8c')][_0x0e95('0x8d')]({'membername':_0x25d6c0['name'],'UserId':_0x25d6c0['id'],'queue_name':_0x2737a4[_0x0e95('0x2f')],'VoiceQueueId':_0x2737a4['id'],'interface':_[_0x0e95('0x8e')](_0x25d6c0[_0x0e95('0x8b')])?util[_0x0e95('0x8f')](_0x0e95('0x90'),_0x25d6c0[_0x0e95('0x2f')]):_0x25d6c0[_0x0e95('0x8b')],'paused':_0x25d6c0['voicePause']||![],'penalty':_0x2737a4['TeamVoiceQueue'][_0x0e95('0x85')]},{'transaction':_0x23328e});});return Promise[_0x0e95('0x91')](_0x5d812d);});});});return Promise[_0x0e95('0x91')](_0x32e3db);});return Promise[_0x0e95('0x91')](_0x4448a5);})['then'](function(){return db['TeamVoicePrefix'][_0x0e95('0x71')]({'where':{'teamId':_0x496f6f}})[_0x0e95('0x2b')](function(_0x98a1e2){if(_0x98a1e2){var _0x5b2a2a=_[_0x0e95('0x43')](_0x2c02db,function(_0x2675f6){db[_0x0e95('0x6f')][_0x0e95('0x8d')]({'UserId':_0x2675f6,'VoicePrefixId':_0x98a1e2[_0x0e95('0x92')]});});return Promise[_0x0e95('0x91')](_0x5b2a2a);}});});});return Promise[_0x0e95('0x91')](_0x27b1f5)[_0x0e95('0x2b')](function(){return _0x358c01[_0x0e95('0x7e')](_0x2c02db,{'transaction':_0x23328e})[_0x0e95('0x93')](function(_0x45291b){return _0x45291b;});});});}})[_0x0e95('0x2b')](respondWithResult(_0x5830a5,null))[_0x0e95('0x49')](handleError(_0x5830a5,null));};exports[_0x0e95('0x94')]=function(_0x1fe5e1,_0x3b781a){var _0x2a29f0=_[_0x0e95('0x95')](_0x1fe5e1['query'][_0x0e95('0x7b')])?_0x1fe5e1[_0x0e95('0x36')][_0x0e95('0x7b')]:[_0x1fe5e1[_0x0e95('0x36')][_0x0e95('0x7b')]];var _0x90ad8d=_0x1fe5e1[_0x0e95('0x55')]['id'];return db['Team'][_0x0e95('0x4c')]({'where':{'id':_0x90ad8d}})[_0x0e95('0x2b')](handleEntityNotFound(_0x3b781a,null))[_0x0e95('0x2b')](function(_0x1e7d35){if(_0x1e7d35){var _0x455cac=['Voice',_0x0e95('0x80'),_0x0e95('0x81'),'Sms','Fax',_0x0e95('0x83'),_0x0e95('0x84')];return db[_0x0e95('0x61')][_0x0e95('0x56')](function(_0x1ac058){var _0x57977a=_[_0x0e95('0x43')](_0x455cac,function(_0x991834){var _0x2b747c={'attributes':['id',_0x0e95('0x2f')]};return _0x1e7d35[_0x0e95('0x4f')+_0x991834+'Queues'](_0x2b747c)['then'](function(_0x396eab){var _0x44cd1d=_[_0x0e95('0x43')](_0x396eab,function(_0x33faa5){return _0x33faa5[_0x0e95('0x94')](_0x2a29f0,{'transaction':_0x1ac058})[_0x0e95('0x2b')](function(){var _0x25fdb4=_[_0x0e95('0x43')](_0x2a29f0,function(_0xbd45fd){socket[_0x0e95('0x89')](_0x0e95('0x4e')+_0x991834+'Queue:remove',{'UserId':Number(_0xbd45fd),[_0x991834+_0x0e95('0x86')]:_0x33faa5['id']});if(_0x991834!==_0x0e95('0x7f')){return;}return db[_0x0e95('0x8c')][_0x0e95('0x5f')]({'where':{'VoiceQueueId':_0x33faa5['id'],'UserId':_0xbd45fd},'transaction':_0x1ac058});});return Promise[_0x0e95('0x91')](_0x25fdb4);});});return Promise[_0x0e95('0x91')](_0x44cd1d);});});return Promise[_0x0e95('0x91')](_0x57977a)['then'](function(){return _0x1e7d35[_0x0e95('0x94')](_0x2a29f0,{'transaction':_0x1ac058});})[_0x0e95('0x2b')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x90ad8d}})[_0x0e95('0x2b')](function(_0x33c196){if(_0x33c196){var _0x242665=_['map'](_0x2a29f0,function(_0x266259){db[_0x0e95('0x6f')][_0x0e95('0x5f')]({'where':{'UserId':_0x266259,'VoicePrefixId':_0x33c196[_0x0e95('0x92')]}});});return Promise[_0x0e95('0x91')](_0x242665);}});});});}})[_0x0e95('0x2b')](respondWithStatusCode(_0x3b781a,null))['catch'](handleError(_0x3b781a,null));};exports['getAgents']=function(_0x10028b,_0x2d39c7,_0x4d145d){var _0x143ed4={};var _0x253d8b={};var _0x1f30fe;var _0x1c2ea0;return db[_0x0e95('0x31')][_0x0e95('0x71')]({'where':{'id':_0x10028b[_0x0e95('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d39c7,null))[_0x0e95('0x2b')](function(_0x54bba9){if(_0x54bba9){_0x1f30fe=_0x54bba9;_0x253d8b['model']=_[_0x0e95('0x4b')](db[_0x0e95('0x88')]['rawAttributes']);_0x253d8b['query']=_[_0x0e95('0x4b')](_0x10028b[_0x0e95('0x36')]);_0x253d8b[_0x0e95('0x37')]=_[_0x0e95('0x39')](_0x253d8b[_0x0e95('0x35')],_0x253d8b[_0x0e95('0x36')]);_0x143ed4[_0x0e95('0x38')]=_[_0x0e95('0x39')](_0x253d8b[_0x0e95('0x35')],qs[_0x0e95('0x3a')](_0x10028b[_0x0e95('0x36')]['fields']));_0x143ed4[_0x0e95('0x38')]=_0x143ed4[_0x0e95('0x38')]['length']?_0x143ed4[_0x0e95('0x38')]:_0x253d8b[_0x0e95('0x35')];_0x143ed4[_0x0e95('0x3d')]=qs[_0x0e95('0x3e')](_0x10028b[_0x0e95('0x36')][_0x0e95('0x3e')]);_0x143ed4[_0x0e95('0x3f')]=qs[_0x0e95('0x37')](_[_0x0e95('0x40')](_0x10028b[_0x0e95('0x36')],_0x253d8b[_0x0e95('0x37')]));if(_0x10028b[_0x0e95('0x36')]['filter']){_0x143ed4[_0x0e95('0x3f')]=_[_0x0e95('0x42')](_0x143ed4[_0x0e95('0x3f')],{'$or':_['map'](_0x143ed4[_0x0e95('0x38')],function(_0x422e23){var _0x3cf013={};_0x3cf013[_0x422e23]={'$like':'%'+_0x10028b[_0x0e95('0x36')][_0x0e95('0x41')]+'%'};return _0x3cf013;})});}_0x143ed4=_[_0x0e95('0x42')]({},_0x143ed4,_0x10028b['options']);return _0x1f30fe[_0x0e95('0x96')](_0x143ed4);}})[_0x0e95('0x2b')](function(_0x28c374){if(_0x28c374){_0x1c2ea0=_0x28c374[_0x0e95('0x3b')];if(!_0x10028b[_0x0e95('0x36')][_0x0e95('0x97')]('nolimit')){_0x143ed4[_0x0e95('0x26')]=qs[_0x0e95('0x26')](_0x10028b[_0x0e95('0x36')][_0x0e95('0x26')]);_0x143ed4[_0x0e95('0x24')]=qs[_0x0e95('0x24')](_0x10028b[_0x0e95('0x36')][_0x0e95('0x24')]);}return _0x1f30fe[_0x0e95('0x96')](_0x143ed4);}})[_0x0e95('0x2b')](function(_0x322cb1){if(_0x322cb1){return _0x322cb1?{'count':_0x1c2ea0,'rows':_0x322cb1}:null;}})[_0x0e95('0x2b')](respondWithResult(_0x2d39c7,null))[_0x0e95('0x49')](handleError(_0x2d39c7,null));};
\ No newline at end of file
+var _0x463e=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./team.socket','register','sendStatus','end','status','offset','limit','undefined','count','json','apply','reject','save','update','then','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','UserChatQueue','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','VoicePrefixId','Teams','send','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','TeamVoicePrefix','findOne','UserVoicePrefix','isArray','Whatsapp','removeAgents','getAgents','eml-format','rimraf'];(function(_0x560d8e,_0x189189){var _0x474d42=function(_0x8a09bc){while(--_0x8a09bc){_0x560d8e['push'](_0x560d8e['shift']());}};_0x474d42(++_0x189189);}(_0x463e,0x1c6));var _0xe463=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x463e[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xe463('0x0'));var rimraf=require(_0xe463('0x1'));var zipdir=require(_0xe463('0x2'));var jsonpatch=require(_0xe463('0x3'));var rp=require('request-promise');var moment=require(_0xe463('0x4'));var BPromise=require(_0xe463('0x5'));var Mustache=require(_0xe463('0x6'));var util=require(_0xe463('0x7'));var path=require(_0xe463('0x8'));var sox=require('sox');var csv=require(_0xe463('0x9'));var ejs=require(_0xe463('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe463('0xb'));var crypto=require('crypto');var jsforce=require(_0xe463('0xc'));var deskjs=require(_0xe463('0xd'));var toCsv=require(_0xe463('0x9'));var querystring=require(_0xe463('0xe'));var Papa=require(_0xe463('0xf'));var Redis=require(_0xe463('0x10'));var authService=require(_0xe463('0x11'));var qs=require(_0xe463('0x12'));var as=require(_0xe463('0x13'));var hardwareService=require(_0xe463('0x14'));var logger=require(_0xe463('0x15'))(_0xe463('0x16'));var utils=require('../../config/utils');var config=require(_0xe463('0x17'));var licenseUtil=require(_0xe463('0x18'));var db=require('../../mysqldb')['db'];config[_0xe463('0x19')]=_[_0xe463('0x1a')](config[_0xe463('0x19')],{'host':_0xe463('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe463('0x19')]));require(_0xe463('0x1c'))[_0xe463('0x1d')](socket);function respondWithStatusCode(_0x4bf481,_0x45ba4b){_0x45ba4b=_0x45ba4b||0xcc;return function(_0x7a5ead){if(_0x7a5ead){return _0x4bf481[_0xe463('0x1e')](_0x45ba4b);}return _0x4bf481['status'](_0x45ba4b)[_0xe463('0x1f')]();};}function respondWithResult(_0xee2222,_0x48277b){_0x48277b=_0x48277b||0xc8;return function(_0x15e8af){if(_0x15e8af){return _0xee2222[_0xe463('0x20')](_0x48277b)['json'](_0x15e8af);}};}function respondWithFilteredResult(_0x1dcbee,_0x4aca62){return function(_0x348e64){if(_0x348e64){var _0x570754=typeof _0x4aca62[_0xe463('0x21')]==='undefined'&&typeof _0x4aca62[_0xe463('0x22')]===_0xe463('0x23');var _0x4858dd=_0x348e64[_0xe463('0x24')];var _0x1b0771=_0x570754?0x0:_0x4aca62[_0xe463('0x21')];var _0x33c0d5=_0x570754?_0x348e64[_0xe463('0x24')]:_0x4aca62['offset']+_0x4aca62[_0xe463('0x22')];var _0x1e63b6;if(_0x33c0d5>=_0x4858dd){_0x33c0d5=_0x4858dd;_0x1e63b6=0xc8;}else{_0x1e63b6=0xce;}_0x1dcbee[_0xe463('0x20')](_0x1e63b6);return _0x1dcbee['set']('Content-Range',_0x1b0771+'-'+_0x33c0d5+'/'+_0x4858dd)[_0xe463('0x25')](_0x348e64);}return null;};}function patchUpdates(_0x3be96a){return function(_0x54ea7f){try{jsonpatch[_0xe463('0x26')](_0x54ea7f,_0x3be96a,!![]);}catch(_0x103b2c){return BPromise[_0xe463('0x27')](_0x103b2c);}return _0x54ea7f[_0xe463('0x28')]();};}function saveUpdates(_0x5eb766,_0x5d9bc1){return function(_0x3bdff3){if(_0x3bdff3){return _0x3bdff3[_0xe463('0x29')](_0x5eb766)[_0xe463('0x2a')](function(_0x29effd){return _0x29effd;});}return null;};}function handleEntityNotFound(_0x2253a8,_0x4ad6e5){return function(_0x4d7fbd){if(!_0x4d7fbd){_0x2253a8['sendStatus'](0x194);}return _0x4d7fbd;};}function handleError(_0x31a379,_0xd76788){_0xd76788=_0xd76788||0x1f4;return function(_0x43a940){logger['error'](_0x43a940[_0xe463('0x2b')]);if(_0x43a940[_0xe463('0x2c')]){delete _0x43a940[_0xe463('0x2c')];}_0x31a379[_0xe463('0x20')](_0xd76788)['send'](_0x43a940);};}exports[_0xe463('0x2d')]=function(_0x444e91,_0xffe180){var _0x31d320={},_0x18571d={},_0xbe5638={'count':0x0,'rows':[]};var _0x4835e3=_[_0xe463('0x2e')](db['Team']['rawAttributes'],function(_0x2d211e){return{'name':_0x2d211e[_0xe463('0x2f')],'type':_0x2d211e[_0xe463('0x30')][_0xe463('0x31')]};});_0x18571d[_0xe463('0x32')]=_[_0xe463('0x2e')](_0x4835e3,_0xe463('0x2c'));_0x18571d[_0xe463('0x33')]=_['keys'](_0x444e91[_0xe463('0x33')]);_0x18571d[_0xe463('0x34')]=_['intersection'](_0x18571d[_0xe463('0x32')],_0x18571d[_0xe463('0x33')]);_0x31d320['attributes']=_[_0xe463('0x35')](_0x18571d[_0xe463('0x32')],qs['fields'](_0x444e91[_0xe463('0x33')]['fields']));_0x31d320[_0xe463('0x36')]=_0x31d320['attributes'][_0xe463('0x37')]?_0x31d320[_0xe463('0x36')]:_0x18571d['model'];if(!_0x444e91[_0xe463('0x33')]['hasOwnProperty'](_0xe463('0x38'))){_0x31d320[_0xe463('0x22')]=qs['limit'](_0x444e91[_0xe463('0x33')]['limit']);_0x31d320['offset']=qs[_0xe463('0x21')](_0x444e91[_0xe463('0x33')][_0xe463('0x21')]);}_0x31d320[_0xe463('0x39')]=qs['sort'](_0x444e91[_0xe463('0x33')][_0xe463('0x3a')]);_0x31d320[_0xe463('0x3b')]=qs[_0xe463('0x34')](_[_0xe463('0x3c')](_0x444e91[_0xe463('0x33')],_0x18571d[_0xe463('0x34')]),_0x4835e3);if(_0x444e91[_0xe463('0x33')][_0xe463('0x3d')]){_0x31d320['where']=_[_0xe463('0x3e')](_0x31d320[_0xe463('0x3b')],{'$or':_[_0xe463('0x2e')](_0x4835e3,function(_0x11a086){if(_0x11a086[_0xe463('0x30')]!==_0xe463('0x3f')){var _0x45e94e={};_0x45e94e[_0x11a086[_0xe463('0x2c')]]={'$like':'%'+_0x444e91[_0xe463('0x33')][_0xe463('0x3d')]+'%'};return _0x45e94e;}})});}_0x31d320=_[_0xe463('0x3e')]({},_0x31d320,_0x444e91[_0xe463('0x40')]);var _0x11d83c={'where':_0x31d320[_0xe463('0x3b')]};return db[_0xe463('0x41')][_0xe463('0x24')](_0x11d83c)[_0xe463('0x2a')](function(_0x4c6925){_0xbe5638[_0xe463('0x24')]=_0x4c6925;if(_0x444e91[_0xe463('0x33')][_0xe463('0x42')]){_0x31d320[_0xe463('0x43')]=[{'all':!![]}];}return db[_0xe463('0x41')][_0xe463('0x44')](_0x31d320);})['then'](function(_0x1c09c0){_0xbe5638['rows']=_0x1c09c0;return _0xbe5638;})[_0xe463('0x2a')](respondWithFilteredResult(_0xffe180,_0x31d320))[_0xe463('0x45')](handleError(_0xffe180,null));};exports[_0xe463('0x46')]=function(_0x6f96f4,_0x3bd96b){var _0x10d3a2={'raw':![],'where':{'id':_0x6f96f4[_0xe463('0x47')]['id']}},_0x300aa5={};_0x300aa5[_0xe463('0x32')]=_[_0xe463('0x48')](db['Team'][_0xe463('0x49')]);_0x300aa5[_0xe463('0x33')]=_['keys'](_0x6f96f4[_0xe463('0x33')]);_0x300aa5[_0xe463('0x34')]=_[_0xe463('0x35')](_0x300aa5[_0xe463('0x32')],_0x300aa5[_0xe463('0x33')]);_0x10d3a2[_0xe463('0x36')]=_[_0xe463('0x35')](_0x300aa5['model'],qs[_0xe463('0x4a')](_0x6f96f4[_0xe463('0x33')]['fields']));_0x10d3a2[_0xe463('0x36')]=_0x10d3a2['attributes'][_0xe463('0x37')]?_0x10d3a2[_0xe463('0x36')]:_0x300aa5[_0xe463('0x32')];if(_0x6f96f4[_0xe463('0x33')]['includeAll']){_0x10d3a2[_0xe463('0x43')]=[{'all':!![]}];}_0x10d3a2=_[_0xe463('0x3e')]({},_0x10d3a2,_0x6f96f4[_0xe463('0x40')]);return db[_0xe463('0x41')][_0xe463('0x4b')](_0x10d3a2)[_0xe463('0x2a')](handleEntityNotFound(_0x3bd96b,null))[_0xe463('0x2a')](respondWithResult(_0x3bd96b,null))[_0xe463('0x45')](handleError(_0x3bd96b,null));};exports[_0xe463('0x4c')]=function(_0x1f0584,_0x1e84c2){return db[_0xe463('0x41')][_0xe463('0x4c')](_0x1f0584[_0xe463('0x4d')],{})[_0xe463('0x2a')](function(_0x26968a){var _0x3808d9=_0x1f0584[_0xe463('0x4e')]['get']({'plain':!![]});if(!_0x3808d9)throw new Error(_0xe463('0x4f'));if(_0x3808d9[_0xe463('0x50')]==='user'){var _0xfe492f=_0x26968a[_0xe463('0x51')]({'plain':!![]});var _0x469321='Teams';return db['UserProfileSection']['find']({'where':{'name':_0x469321,'userProfileId':_0x3808d9[_0xe463('0x52')]},'raw':!![]})[_0xe463('0x2a')](function(_0x333436){if(_0x333436&&_0x333436[_0xe463('0x53')]===0x0){return db[_0xe463('0x54')][_0xe463('0x4c')]({'name':_0xfe492f[_0xe463('0x2c')],'resourceId':_0xfe492f['id'],'type':_0x333436[_0xe463('0x2c')],'sectionId':_0x333436['id']},{})[_0xe463('0x2a')](function(){return _0x26968a;});}else{return _0x26968a;}})[_0xe463('0x45')](function(_0x2f9daa){logger[_0xe463('0x55')](_0xe463('0x56'),_0x2f9daa);throw _0x2f9daa;});}return _0x26968a;})[_0xe463('0x2a')](respondWithResult(_0x1e84c2,0xc9))[_0xe463('0x45')](handleError(_0x1e84c2,null));};exports[_0xe463('0x29')]=function(_0x5460c5,_0x56aa8d){if(_0x5460c5['body']['id']){delete _0x5460c5['body']['id'];}return db[_0xe463('0x41')][_0xe463('0x4b')]({'where':{'id':_0x5460c5['params']['id']}})[_0xe463('0x2a')](handleEntityNotFound(_0x56aa8d,null))['then'](saveUpdates(_0x5460c5['body'],null))[_0xe463('0x2a')](respondWithResult(_0x56aa8d,null))[_0xe463('0x45')](handleError(_0x56aa8d,null));};exports[_0xe463('0x57')]=function(_0x1d9624,_0x2b291e){var _0x26a28f=_0x1d9624['params']['id'];var _0x3972f3=[];return db[_0xe463('0x58')][_0xe463('0x59')](function(_0x5a0095){var _0x4a9a21=_0xe463('0x5a')+_0x26a28f;return db[_0xe463('0x58')]['query'](_0x4a9a21,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095})[_0xe463('0x2a')](function(_0x355649){_0x3972f3=_[_0xe463('0x2e')](_0x355649,function(_0x2a9149){return Number(_0x2a9149[_0xe463('0x5e')]);});})[_0xe463('0x2a')](function(){var _0x19e484=_0xe463('0x5f')+_0x26a28f;return db[_0xe463('0x58')]['query'](_0x19e484,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')]['SELECT'],'raw':!![],'transaction':_0x5a0095});})[_0xe463('0x2a')](function(_0xdbd8ea){var _0x5ee220=_[_0xe463('0x2e')](_0xdbd8ea,function(_0x1bd761){return Number(_0x1bd761[_0xe463('0x60')]);});return db[_0xe463('0x61')]['destroy']({'where':{'UserId':{'$in':_0x3972f3},'VoiceQueueId':{'$in':_0x5ee220}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x1a748a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x26a28f;return db[_0xe463('0x58')][_0xe463('0x33')](_0x1a748a,{'type':db['Sequelize'][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095});})['then'](function(_0x5f59d2){var _0x1e1248=_['map'](_0x5f59d2,function(_0x2da155){return Number(_0x2da155['MailQueueId']);});return db[_0xe463('0x62')][_0xe463('0x57')]({'where':{'UserId':{'$in':_0x3972f3},'MailQueueId':{'$in':_0x1e1248}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x4f66e8=_0xe463('0x63')+_0x26a28f;return db['sequelize'][_0xe463('0x33')](_0x4f66e8,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095});})[_0xe463('0x2a')](function(_0x943c2f){var _0x57e5eb=_['map'](_0x943c2f,function(_0x3c04ab){return Number(_0x3c04ab[_0xe463('0x64')]);});return db[_0xe463('0x65')]['destroy']({'where':{'UserId':{'$in':_0x3972f3},'SmsQueueId':{'$in':_0x57e5eb}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x573c72='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x26a28f;return db[_0xe463('0x58')][_0xe463('0x33')](_0x573c72,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095});})['then'](function(_0x547b83){var _0x3a89d2=_[_0xe463('0x2e')](_0x547b83,function(_0x3b80a1){return Number(_0x3b80a1['ChatQueueId']);});return db[_0xe463('0x66')][_0xe463('0x57')]({'where':{'UserId':{'$in':_0x3972f3},'ChatQueueId':{'$in':_0x3a89d2}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x3aa8b4='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x26a28f;return db[_0xe463('0x58')][_0xe463('0x33')](_0x3aa8b4,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')]['SELECT'],'raw':!![],'transaction':_0x5a0095});})[_0xe463('0x2a')](function(_0x2566b0){var _0x30b4d7=_['map'](_0x2566b0,function(_0xcf77cc){return Number(_0xcf77cc['FaxQueueId']);});return db[_0xe463('0x67')][_0xe463('0x57')]({'where':{'UserId':{'$in':_0x3972f3},'FaxQueueId':{'$in':_0x30b4d7}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x153123=_0xe463('0x68')+_0x26a28f;return db[_0xe463('0x58')][_0xe463('0x33')](_0x153123,{'type':db[_0xe463('0x5b')][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095});})['then'](function(_0x385f7f){var _0x3957ab=_['map'](_0x385f7f,function(_0x437bef){return Number(_0x437bef[_0xe463('0x69')]);});return db[_0xe463('0x6a')][_0xe463('0x57')]({'where':{'UserId':{'$in':_0x3972f3},'OpenchannelQueueId':{'$in':_0x3957ab}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){var _0x28caa9=_0xe463('0x6b')+_0x26a28f;return db['sequelize'][_0xe463('0x33')](_0x28caa9,{'type':db['Sequelize'][_0xe463('0x5c')][_0xe463('0x5d')],'raw':!![],'transaction':_0x5a0095});})[_0xe463('0x2a')](function(_0x3e9e34){var _0x4e6734=_[_0xe463('0x2e')](_0x3e9e34,function(_0x35e3e6){return Number(_0x35e3e6['WhatsappQueueId']);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x3972f3},'WhatsappQueueId':{'$in':_0x4e6734}},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){return db['TeamVoicePrefix'][_0xe463('0x4b')]({'where':{'TeamId':_0x26a28f}});})[_0xe463('0x2a')](function(_0x3d2aef){if(_0x3d2aef===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x3972f3},'VoicePrefixId':_0x3d2aef[_0xe463('0x6c')]},'transaction':_0x5a0095});})[_0xe463('0x2a')](function(){return db[_0xe463('0x41')][_0xe463('0x57')]({'where':{'id':_0x26a28f},'cascade':!![],'transaction':_0x5a0095});})[_0xe463('0x2a')](function(_0x5ee2f8){if(_0x5ee2f8===0x0){_0x2b291e[_0xe463('0x1e')](0x194);}else{return db[_0xe463('0x54')][_0xe463('0x57')]({'where':{'type':_0xe463('0x6d'),'resourceId':_0x26a28f},'cascade':!![],'transaction':_0x5a0095})[_0xe463('0x2a')](function(){_0x2b291e['status'](0xcc)['end']();});}})['catch'](function(_0x3c8c3f){_0x2b291e[_0xe463('0x20')](0x1f4)[_0xe463('0x6e')](_0x3c8c3f);});});};exports[_0xe463('0x6f')]=function(_0x1ca1be,_0x3f20f1,_0x1d2adf){return db[_0xe463('0x41')]['findOne']({'where':{'id':_0x1ca1be[_0xe463('0x47')]['id']}})[_0xe463('0x2a')](handleEntityNotFound(_0x3f20f1,null))[_0xe463('0x2a')](function(_0x392320){if(!_0x1ca1be[_0xe463('0x33')][_0xe463('0x70')]||!utils[_0xe463('0x71')](_0x1ca1be[_0xe463('0x33')]['channel'])){throw new db[(_0xe463('0x5b'))][(_0xe463('0x72'))](_0xe463('0x73'));}var _0x4b7738={};var _0x461849={};_0x461849['model']=_[_0xe463('0x48')](db[_[_0xe463('0x74')](_0x1ca1be[_0xe463('0x33')]['channel']['toLowerCase']())+_0xe463('0x75')][_0xe463('0x49')]);_0x461849['query']=_[_0xe463('0x48')](_0x1ca1be['query']);_0x461849['filters']=_['intersection'](_0x461849[_0xe463('0x32')],_0x461849[_0xe463('0x33')]);_0x4b7738[_0xe463('0x36')]=_[_0xe463('0x35')](_0x461849[_0xe463('0x32')],qs[_0xe463('0x4a')](_0x1ca1be[_0xe463('0x33')]['fields']));_0x4b7738[_0xe463('0x36')]=_0x4b7738[_0xe463('0x36')][_0xe463('0x37')]?_0x4b7738['attributes']:_0x461849['model'];_0x4b7738[_0xe463('0x22')]=qs['limit'](_0x1ca1be[_0xe463('0x33')][_0xe463('0x22')]);_0x4b7738[_0xe463('0x21')]=qs[_0xe463('0x21')](_0x1ca1be[_0xe463('0x33')]['offset']);_0x4b7738[_0xe463('0x39')]=qs[_0xe463('0x3a')](_0x1ca1be[_0xe463('0x33')][_0xe463('0x3a')]);_0x4b7738[_0xe463('0x3b')]=qs[_0xe463('0x34')](_[_0xe463('0x3c')](_0x1ca1be[_0xe463('0x33')],_0x461849[_0xe463('0x34')]));_0x4b7738=_[_0xe463('0x3e')]({},_0x4b7738,_0x1ca1be[_0xe463('0x40')]);return _0x392320['get'+_[_0xe463('0x74')](_0x1ca1be[_0xe463('0x33')][_0xe463('0x70')][_0xe463('0x76')]())+_0xe463('0x77')](_0x4b7738);})['then'](respondWithResult(_0x3f20f1,null))[_0xe463('0x45')](handleError(_0x3f20f1,null));};exports[_0xe463('0x78')]=function(_0x2fd128,_0x247f93,_0x13a99e){return db[_0xe463('0x41')]['findOne']({'where':{'id':_0x2fd128[_0xe463('0x47')]['id']}})[_0xe463('0x2a')](function(_0x3592cb){if(_0x3592cb){if(!_0x2fd128[_0xe463('0x4d')]['channel']||!utils[_0xe463('0x71')](_0x2fd128[_0xe463('0x4d')]['channel'])){throw new db[(_0xe463('0x5b'))][(_0xe463('0x72'))]('Unknown\x20channel');}return _0x3592cb[_0xe463('0x79')+_[_0xe463('0x74')](_0x2fd128[_0xe463('0x4d')][_0xe463('0x70')]['toLowerCase']())+_0xe463('0x77')](_0x2fd128[_0xe463('0x4d')][_0xe463('0x7a')]);}return null;})[_0xe463('0x2a')](handleEntityNotFound(_0x247f93,null))[_0xe463('0x2a')](respondWithStatusCode(_0x247f93,null))[_0xe463('0x45')](handleError(_0x247f93,null));};exports[_0xe463('0x7b')]=function(_0x277c7a,_0x33f333,_0xb70454){return db[_0xe463('0x41')]['findOne']({'where':{'id':_0x277c7a['params']['id']}})[_0xe463('0x2a')](function(_0x28488e){if(_0x28488e){if(!_0x277c7a[_0xe463('0x33')][_0xe463('0x70')]||!utils[_0xe463('0x71')](_0x277c7a[_0xe463('0x33')][_0xe463('0x70')])){throw new db[(_0xe463('0x5b'))][(_0xe463('0x72'))](_0xe463('0x73'));}return _0x28488e[_0xe463('0x7c')+_[_0xe463('0x74')](_0x277c7a[_0xe463('0x33')]['channel']['toLowerCase']())+_0xe463('0x77')](_0x277c7a[_0xe463('0x33')]['ids']);}return null;})['then'](handleEntityNotFound(_0x33f333,null))[_0xe463('0x2a')](respondWithStatusCode(_0x33f333,null))['catch'](handleError(_0x33f333,null));};exports[_0xe463('0x7d')]=function(_0x3da856,_0x3e1121){var _0x2def8e=_['isArray'](_0x3da856['body'][_0xe463('0x7a')])?_0x3da856[_0xe463('0x4d')][_0xe463('0x7a')]:[_0x3da856[_0xe463('0x4d')][_0xe463('0x7a')]];var _0x208186=_0x3da856[_0xe463('0x47')]['id'];return db[_0xe463('0x41')][_0xe463('0x4b')]({'where':{'id':_0x208186}})[_0xe463('0x2a')](handleEntityNotFound(_0x3e1121,null))[_0xe463('0x2a')](function(_0xa384ba){if(_0xa384ba){var _0x53130f=[_0xe463('0x7e'),_0xe463('0x7f'),_0xe463('0x80'),_0xe463('0x81'),'Fax',_0xe463('0x82'),'Whatsapp'];return db['sequelize'][_0xe463('0x59')](function(_0x1e2700){var _0x43e2d6=_[_0xe463('0x2e')](_0x53130f,function(_0xa688c4){var _0x28bd67={'attributes':['id','name']};if(_0xa688c4==='Voice'){_0x28bd67['through']={'attributes':['penalty']};}return _0xa384ba[_0xe463('0x51')+_0xa688c4+_0xe463('0x77')](_0x28bd67)[_0xe463('0x2a')](function(_0x1305dd){var _0xe12202=_[_0xe463('0x2e')](_0x1305dd,function(_0x577508){var _0x2676e0=_[_0xe463('0x2e')](_0x2def8e,function(_0x1424e8){var _0x1630c7={'where':{'UserId':_0x1424e8,[_0xa688c4+_0xe463('0x83')]:_0x577508['id']},'transaction':_0x1e2700};if(_0xa688c4==='Voice'){_0x1630c7[_0xe463('0x1a')]={'penalty':_0x577508[_0xe463('0x84')][_0xe463('0x85')]};}return db[_0xe463('0x86')+_0xa688c4+_0xe463('0x75')][_0xe463('0x87')](_0x1630c7)[_0xe463('0x2a')](function(){socket[_0xe463('0x88')]('user'+_0xa688c4+_0xe463('0x89'),{'UserId':_0x1424e8,[_0xa688c4+_0xe463('0x83')]:_0x577508['id']});if(_0xa688c4!==_0xe463('0x7e')){return;}return db[_0xe463('0x86')][_0xe463('0x44')]({'where':{'id':_0x2def8e,'online':0x1},'attributes':['id',_0xe463('0x2c'),'online','voicePause',_0xe463('0x8a')],'raw':!![]})[_0xe463('0x2a')](function(_0x3a75b7){var _0x4e218e=_['map'](_0x3a75b7,function(_0x3c8a6d){return db[_0xe463('0x8b')][_0xe463('0x8c')]({'membername':_0x3c8a6d[_0xe463('0x2c')],'UserId':_0x3c8a6d['id'],'queue_name':_0x577508[_0xe463('0x2c')],'VoiceQueueId':_0x577508['id'],'interface':_[_0xe463('0x8d')](_0x3c8a6d[_0xe463('0x8a')])?util['format'](_0xe463('0x8e'),_0x3c8a6d[_0xe463('0x2c')]):_0x3c8a6d[_0xe463('0x8a')],'paused':_0x3c8a6d[_0xe463('0x8f')]||![],'penalty':_0x577508['TeamVoiceQueue'][_0xe463('0x85')]},{'transaction':_0x1e2700});});return Promise[_0xe463('0x90')](_0x4e218e);});});});return Promise['all'](_0x2676e0);});return Promise[_0xe463('0x90')](_0xe12202);})[_0xe463('0x2a')](function(){return db[_0xe463('0x91')][_0xe463('0x92')]({'where':{'teamId':_0x208186}})['then'](function(_0x5225a8){if(_0x5225a8){var _0x25042d=_[_0xe463('0x2e')](_0x2def8e,function(_0x132390){db[_0xe463('0x93')][_0xe463('0x8c')]({'UserId':_0x132390,'VoicePrefixId':_0x5225a8[_0xe463('0x6c')]});});return Promise['all'](_0x25042d);}});});});return Promise['all'](_0x43e2d6)['then'](function(){return _0xa384ba[_0xe463('0x7d')](_0x2def8e,{'transaction':_0x1e2700})['spread'](function(_0x31e88f){return _0x31e88f;});});});}})['then'](respondWithResult(_0x3e1121,null))[_0xe463('0x45')](handleError(_0x3e1121,null));};exports['removeAgents']=function(_0x2a9826,_0x4282d7){var _0x39d7dd=_[_0xe463('0x94')](_0x2a9826[_0xe463('0x33')]['ids'])?_0x2a9826[_0xe463('0x33')][_0xe463('0x7a')]:[_0x2a9826[_0xe463('0x33')][_0xe463('0x7a')]];var _0x128c64=_0x2a9826[_0xe463('0x47')]['id'];return db[_0xe463('0x41')][_0xe463('0x4b')]({'where':{'id':_0x128c64}})['then'](handleEntityNotFound(_0x4282d7,null))[_0xe463('0x2a')](function(_0x410c93){if(_0x410c93){var _0x4b2a2b=[_0xe463('0x7e'),'Chat',_0xe463('0x80'),'Sms','Fax',_0xe463('0x82'),_0xe463('0x95')];return db[_0xe463('0x58')][_0xe463('0x59')](function(_0x419a04){var _0x3c1188=_[_0xe463('0x2e')](_0x4b2a2b,function(_0x5a0f36){var _0x186c26={'attributes':['id',_0xe463('0x2c')]};return _0x410c93[_0xe463('0x51')+_0x5a0f36+'Queues'](_0x186c26)[_0xe463('0x2a')](function(_0x2abcb1){var _0x5d2b58=_[_0xe463('0x2e')](_0x2abcb1,function(_0x38ab3c){return _0x38ab3c[_0xe463('0x96')](_0x39d7dd,{'transaction':_0x419a04})[_0xe463('0x2a')](function(){var _0x27247c=_[_0xe463('0x2e')](_0x39d7dd,function(_0x6d79f7){socket[_0xe463('0x88')]('user'+_0x5a0f36+'Queue:remove',{'UserId':Number(_0x6d79f7),[_0x5a0f36+_0xe463('0x83')]:_0x38ab3c['id']});if(_0x5a0f36!==_0xe463('0x7e')){return;}return db[_0xe463('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x38ab3c['id'],'UserId':_0x6d79f7},'transaction':_0x419a04});});return Promise[_0xe463('0x90')](_0x27247c);});});return Promise['all'](_0x5d2b58);});});return Promise[_0xe463('0x90')](_0x3c1188)[_0xe463('0x2a')](function(){return _0x410c93[_0xe463('0x96')](_0x39d7dd,{'transaction':_0x419a04});})[_0xe463('0x2a')](function(){return db[_0xe463('0x91')]['findOne']({'where':{'teamId':_0x128c64}})[_0xe463('0x2a')](function(_0x237563){if(_0x237563){var _0xefedaf=_[_0xe463('0x2e')](_0x39d7dd,function(_0x1d25b0){db[_0xe463('0x93')][_0xe463('0x57')]({'where':{'UserId':_0x1d25b0,'VoicePrefixId':_0x237563[_0xe463('0x6c')]}});});return Promise[_0xe463('0x90')](_0xefedaf);}});});});}})[_0xe463('0x2a')](respondWithStatusCode(_0x4282d7,null))[_0xe463('0x45')](handleError(_0x4282d7,null));};exports[_0xe463('0x97')]=function(_0x15ae10,_0x44aed0,_0x54deb4){var _0x250ea0={};var _0x31467f={};var _0x1cf008;var _0x5836f4;return db[_0xe463('0x41')]['findOne']({'where':{'id':_0x15ae10[_0xe463('0x47')]['id']}})[_0xe463('0x2a')](handleEntityNotFound(_0x44aed0,null))[_0xe463('0x2a')](function(_0x34e0f2){if(_0x34e0f2){_0x1cf008=_0x34e0f2;_0x31467f['model']=_[_0xe463('0x48')](db[_0xe463('0x86')][_0xe463('0x49')]);_0x31467f[_0xe463('0x33')]=_[_0xe463('0x48')](_0x15ae10[_0xe463('0x33')]);_0x31467f[_0xe463('0x34')]=_['intersection'](_0x31467f[_0xe463('0x32')],_0x31467f[_0xe463('0x33')]);_0x250ea0[_0xe463('0x36')]=_['intersection'](_0x31467f[_0xe463('0x32')],qs[_0xe463('0x4a')](_0x15ae10[_0xe463('0x33')][_0xe463('0x4a')]));_0x250ea0['attributes']=_0x250ea0[_0xe463('0x36')]['length']?_0x250ea0['attributes']:_0x31467f[_0xe463('0x32')];_0x250ea0[_0xe463('0x39')]=qs[_0xe463('0x3a')](_0x15ae10['query'][_0xe463('0x3a')]);_0x250ea0[_0xe463('0x3b')]=qs[_0xe463('0x34')](_[_0xe463('0x3c')](_0x15ae10[_0xe463('0x33')],_0x31467f['filters']));if(_0x15ae10['query'][_0xe463('0x3d')]){_0x250ea0[_0xe463('0x3b')]=_['merge'](_0x250ea0[_0xe463('0x3b')],{'$or':_['map'](_0x250ea0[_0xe463('0x36')],function(_0x2569d0){var _0x3a8a5d={};_0x3a8a5d[_0x2569d0]={'$like':'%'+_0x15ae10[_0xe463('0x33')]['filter']+'%'};return _0x3a8a5d;})});}_0x250ea0=_[_0xe463('0x3e')]({},_0x250ea0,_0x15ae10[_0xe463('0x40')]);return _0x1cf008[_0xe463('0x97')](_0x250ea0);}})[_0xe463('0x2a')](function(_0x33a3db){if(_0x33a3db){_0x5836f4=_0x33a3db[_0xe463('0x37')];if(!_0x15ae10[_0xe463('0x33')]['hasOwnProperty'](_0xe463('0x38'))){_0x250ea0[_0xe463('0x22')]=qs[_0xe463('0x22')](_0x15ae10['query'][_0xe463('0x22')]);_0x250ea0[_0xe463('0x21')]=qs['offset'](_0x15ae10[_0xe463('0x33')][_0xe463('0x21')]);}return _0x1cf008[_0xe463('0x97')](_0x250ea0);}})['then'](function(_0x228b26){if(_0x228b26){return _0x228b26?{'count':_0x5836f4,'rows':_0x228b26}:null;}})['then'](respondWithResult(_0x44aed0,null))[_0xe463('0x45')](handleError(_0x44aed0,null));};
\ No newline at end of file
index 3f51068..441fa0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e97=['events','../../mysqldb','Team','save','update','emit','hook','exports'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5e97,0x98));var _0x75e9=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5e97[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x75e9('0x0'));var Team=require(_0x75e9('0x1'))['db'][_0x75e9('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x75e9('0x3'),'afterUpdate':_0x75e9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x531eb0){return function(_0x2d14a5,_0x39a646,_0x226d81){TeamEvents[_0x75e9('0x5')](_0x531eb0+':'+_0x2d14a5['id'],_0x2d14a5);TeamEvents[_0x75e9('0x5')](_0x531eb0,_0x2d14a5);_0x226d81(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x75e9('0x6')](e,emitEvent(event));}}module[_0x75e9('0x7')]=TeamEvents;
\ No newline at end of file
+var _0x6a6c=['Team','setMaxListeners','save','update','emit','exports','../../mysqldb'];(function(_0x13ee78,_0x42fbc3){var _0x5b8f27=function(_0x1dad41){while(--_0x1dad41){_0x13ee78['push'](_0x13ee78['shift']());}};_0x5b8f27(++_0x42fbc3);}(_0x6a6c,0x11e));var _0xc6a6=function(_0x4f2446,_0x1fb7c5){_0x4f2446=_0x4f2446-0x0;var _0x4e2a37=_0x6a6c[_0x4f2446];return _0x4e2a37;};'use strict';var EventEmitter=require('events');var Team=require(_0xc6a6('0x0'))['db'][_0xc6a6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc6a6('0x2')](0x0);var events={'afterCreate':_0xc6a6('0x3'),'afterUpdate':_0xc6a6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7c2477){return function(_0x41968a,_0x46b7d8,_0x3f67b6){TeamEvents[_0xc6a6('0x5')](_0x7c2477+':'+_0x41968a['id'],_0x41968a);TeamEvents[_0xc6a6('0x5')](_0x7c2477,_0x41968a);_0x3f67b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc6a6('0x6')]=TeamEvents;
\ No newline at end of file
index 971ac79..5db3e15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0664=['channel','catch','define','Team','teams','Chat','Openchannel','Sms','Voice','resolve','map','all','lodash','get','Queues','then'];(function(_0x432016,_0x38f49c){var _0x512755=function(_0x21bdad){while(--_0x21bdad){_0x432016['push'](_0x432016['shift']());}};_0x512755(++_0x38f49c);}(_0x0664,0x1dc));var _0x4066=function(_0x48c7c7,_0x15e25e){_0x48c7c7=_0x48c7c7-0x0;var _0x3a0c26=_0x0664[_0x48c7c7];return _0x3a0c26;};'use strict';var _=require(_0x4066('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x2ebe27,_0x5c855a){var _0x409c83=_0x4066('0x1')+_0x5c855a+_0x4066('0x2');return _0x2ebe27[_0x409c83]()[_0x4066('0x3')](function(_0x4988d9){return _['map'](_0x4988d9,function(_0x5afa9a){_0x5afa9a['setDataValue'](_0x4066('0x4'),_0x5c855a);return _0x5afa9a;});})[_0x4066('0x5')](function(_0x2d6249){throw _0x2d6249;});}module['exports']=function(_0x32d12a){return _0x32d12a[_0x4066('0x6')](_0x4066('0x7'),attributes,{'tableName':_0x4066('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3cdf06=this;var _0x5a9773=[_0x4066('0x9'),'Fax','Mail',_0x4066('0xa'),_0x4066('0xb'),_0x4066('0xc'),'Whatsapp'];return Promise[_0x4066('0xd')]()[_0x4066('0x3')](function(){var _0x46c104=_[_0x4066('0xe')](_0x5a9773,function(_0x3ebb66){return getQueuesByChannel(_0x3cdf06,_0x3ebb66);});return Promise[_0x4066('0xf')](_0x46c104);})[_0x4066('0x5')](function(_0x458012){throw _0x458012;});}}});};
\ No newline at end of file
+var _0xb762=['teams','Fax','Mail','Openchannel','Voice','Whatsapp','all','lodash','./team.attributes','Queues','then','map','setDataValue','channel','catch','define','Team'];(function(_0x3af955,_0x21431c){var _0x167de5=function(_0x78879c){while(--_0x78879c){_0x3af955['push'](_0x3af955['shift']());}};_0x167de5(++_0x21431c);}(_0xb762,0xc2));var _0x2b76=function(_0x2bd14e,_0x5f5285){_0x2bd14e=_0x2bd14e-0x0;var _0x3dcb89=_0xb762[_0x2bd14e];return _0x3dcb89;};'use strict';var _=require(_0x2b76('0x0'));var attributes=require(_0x2b76('0x1'));function getQueuesByChannel(_0x537031,_0x2ea7d7){var _0x1aa844='get'+_0x2ea7d7+_0x2b76('0x2');return _0x537031[_0x1aa844]()[_0x2b76('0x3')](function(_0x3f55d0){return _[_0x2b76('0x4')](_0x3f55d0,function(_0x46a78c){_0x46a78c[_0x2b76('0x5')](_0x2b76('0x6'),_0x2ea7d7);return _0x46a78c;});})[_0x2b76('0x7')](function(_0x58adde){throw _0x58adde;});}module['exports']=function(_0x498ea5){return _0x498ea5[_0x2b76('0x8')](_0x2b76('0x9'),attributes,{'tableName':_0x2b76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x444484=this;var _0x4c7ab9=['Chat',_0x2b76('0xb'),_0x2b76('0xc'),_0x2b76('0xd'),'Sms',_0x2b76('0xe'),_0x2b76('0xf')];return Promise['resolve']()[_0x2b76('0x3')](function(){var _0xb91056=_[_0x2b76('0x4')](_0x4c7ab9,function(_0x5c0871){return getQueuesByChannel(_0x444484,_0x5c0871);});return Promise[_0x2b76('0x10')](_0xb91056);})[_0x2b76('0x7')](function(_0x1a6691){throw _0x1a6691;});}}});};
\ No newline at end of file
index 0d994e6..88d8e0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e50=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x2d92b1,_0x4a9cd6){var _0x3b0873=function(_0x22f595){while(--_0x22f595){_0x2d92b1['push'](_0x2d92b1['shift']());}};_0x3b0873(++_0x4a9cd6);}(_0x1e50,0x159));var _0x01e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e50[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x01e5('0x0'));var util=require(_0x01e5('0x1'));var moment=require(_0x01e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x01e5('0x3'));var fs=require('fs');var Redis=require(_0x01e5('0x4'));var db=require(_0x01e5('0x5'))['db'];var utils=require(_0x01e5('0x6'));var logger=require(_0x01e5('0x7'))(_0x01e5('0x8'));var config=require(_0x01e5('0x9'));var jayson=require(_0x01e5('0xa'));var client=jayson['client'][_0x01e5('0xb')]({'port':0x232a});config[_0x01e5('0xc')]=_[_0x01e5('0xd')](config[_0x01e5('0xc')],{'host':_0x01e5('0xe'),'port':0x18eb});var socket=require(_0x01e5('0xf'))(new Redis(config[_0x01e5('0xc')]));require(_0x01e5('0x10'))['register'](socket);function respondWithRpcPromise(_0x2a30cc,_0x294e4c,_0x1db583){return new BPromise(function(_0x5d3eec,_0x4ac954){return client[_0x01e5('0x11')](_0x2a30cc,_0x1db583)['then'](function(_0x1cd5ec){logger['info'](_0x01e5('0x12'),_0x294e4c,_0x01e5('0x13'));logger[_0x01e5('0x14')](_0x01e5('0x15'),_0x294e4c,_0x01e5('0x13'),JSON[_0x01e5('0x16')](_0x1cd5ec));if(_0x1cd5ec['error']){if(_0x1cd5ec[_0x01e5('0x17')][_0x01e5('0x18')]===0x1f4){logger[_0x01e5('0x17')](_0x01e5('0x12'),_0x294e4c,_0x1cd5ec[_0x01e5('0x17')]['message']);return _0x4ac954(_0x1cd5ec[_0x01e5('0x17')]['message']);}logger[_0x01e5('0x17')](_0x01e5('0x12'),_0x294e4c,_0x1cd5ec[_0x01e5('0x17')]['message']);return _0x5d3eec(_0x1cd5ec['error'][_0x01e5('0x19')]);}else{logger[_0x01e5('0x1a')](_0x01e5('0x12'),_0x294e4c,_0x01e5('0x13'));_0x5d3eec(_0x1cd5ec[_0x01e5('0x1b')]['message']);}})[_0x01e5('0x1c')](function(_0x5bde83){logger[_0x01e5('0x17')](_0x01e5('0x12'),_0x294e4c,_0x5bde83);_0x4ac954(_0x5bde83);});});}
\ No newline at end of file
+var _0x4ed0=['./team.socket','register','request','then','request\x20sent','debug','stringify','error','code','message','Team,\x20%s,\x20%s','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ed0,0x79));var _0x04ed=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4ed0[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x04ed('0x0'));var util=require('util');var moment=require(_0x04ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x04ed('0x2'));var fs=require('fs');var Redis=require(_0x04ed('0x3'));var db=require(_0x04ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04ed('0x5'))(_0x04ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ed('0x7'));var client=jayson[_0x04ed('0x8')][_0x04ed('0x9')]({'port':0x232a});config[_0x04ed('0xa')]=_[_0x04ed('0xb')](config[_0x04ed('0xa')],{'host':_0x04ed('0xc'),'port':0x18eb});var socket=require(_0x04ed('0xd'))(new Redis(config[_0x04ed('0xa')]));require(_0x04ed('0xe'))[_0x04ed('0xf')](socket);function respondWithRpcPromise(_0x4351ab,_0xc00c5c,_0x74f626){return new BPromise(function(_0x54d8e6,_0xdc4ea1){return client[_0x04ed('0x10')](_0x4351ab,_0x74f626)[_0x04ed('0x11')](function(_0x5e0c16){logger['info']('Team,\x20%s,\x20%s',_0xc00c5c,_0x04ed('0x12'));logger[_0x04ed('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0xc00c5c,_0x04ed('0x12'),JSON[_0x04ed('0x14')](_0x5e0c16));if(_0x5e0c16[_0x04ed('0x15')]){if(_0x5e0c16['error'][_0x04ed('0x16')]===0x1f4){logger[_0x04ed('0x15')]('Team,\x20%s,\x20%s',_0xc00c5c,_0x5e0c16[_0x04ed('0x15')]['message']);return _0xdc4ea1(_0x5e0c16[_0x04ed('0x15')][_0x04ed('0x17')]);}logger[_0x04ed('0x15')](_0x04ed('0x18'),_0xc00c5c,_0x5e0c16[_0x04ed('0x15')][_0x04ed('0x17')]);return _0x54d8e6(_0x5e0c16['error']['message']);}else{logger[_0x04ed('0x19')](_0x04ed('0x18'),_0xc00c5c,_0x04ed('0x12'));_0x54d8e6(_0x5e0c16['result']['message']);}})[_0x04ed('0x1a')](function(_0x270ccc){logger[_0x04ed('0x15')](_0x04ed('0x18'),_0xc00c5c,_0x270ccc);_0xdc4ea1(_0x270ccc);});});}
\ No newline at end of file
index b8fb49a..d160420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95aa=['team:','./team.events','remove','update','emit','removeListener','register','length'];(function(_0x187dbd,_0x2ecf58){var _0x45d1e9=function(_0x2364c0){while(--_0x2364c0){_0x187dbd['push'](_0x187dbd['shift']());}};_0x45d1e9(++_0x2ecf58);}(_0x95aa,0x91));var _0xa95a=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x95aa[_0x3e8cae];return _0x45c4d6;};'use strict';var TeamEvents=require(_0xa95a('0x0'));var events=['save',_0xa95a('0x1'),_0xa95a('0x2')];function createListener(_0x5f0916,_0x8bac44){return function(_0x62f4bf){_0x8bac44[_0xa95a('0x3')](_0x5f0916,_0x62f4bf);};}function removeListener(_0x2f58ce,_0x419177){return function(){TeamEvents[_0xa95a('0x4')](_0x2f58ce,_0x419177);};}exports[_0xa95a('0x5')]=function(_0x156b9c){for(var _0x10c69c=0x0,_0x5ae8e0=events[_0xa95a('0x6')];_0x10c69c<_0x5ae8e0;_0x10c69c++){var _0x4e550d=events[_0x10c69c];var _0x183558=createListener(_0xa95a('0x7')+_0x4e550d,_0x156b9c);TeamEvents['on'](_0x4e550d,_0x183558);}};
\ No newline at end of file
+var _0xa3c3=['team:','./team.events','remove','emit','removeListener','register','length'];(function(_0x284538,_0x54e438){var _0x5becaf=function(_0x40803e){while(--_0x40803e){_0x284538['push'](_0x284538['shift']());}};_0x5becaf(++_0x54e438);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x5b7076,_0x15985d){_0x5b7076=_0x5b7076-0x0;var _0x5a0692=_0xa3c3[_0x5b7076];return _0x5a0692;};'use strict';var TeamEvents=require(_0x3a3c('0x0'));var events=['save',_0x3a3c('0x1'),'update'];function createListener(_0x265303,_0x50df75){return function(_0x13e0cd){_0x50df75[_0x3a3c('0x2')](_0x265303,_0x13e0cd);};}function removeListener(_0x4f143e,_0x44527e){return function(){TeamEvents[_0x3a3c('0x3')](_0x4f143e,_0x44527e);};}exports[_0x3a3c('0x4')]=function(_0x1b4fc1){for(var _0x5600b3=0x0,_0x5557ec=events[_0x3a3c('0x5')];_0x5600b3<_0x5557ec;_0x5600b3++){var _0x41a760=events[_0x5600b3];var _0x32f0f3=createListener(_0x3a3c('0x6')+_0x41a760,_0x1b4fc1);TeamEvents['on'](_0x41a760,_0x32f0f3);}};
\ No newline at end of file
index 2e03ff7..e524eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d08=['INTEGER','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d08,0x118));var _0x88d0=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0x8d08[_0x3a19d4];return _0x5b858b;};'use strict';var Sequelize=require(_0x88d0('0x0'));module[_0x88d0('0x1')]={'TeamId':{'type':Sequelize[_0x88d0('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x88d0('0x2')]}};
\ No newline at end of file
+var _0xdf0c=['INTEGER','sequelize'];(function(_0x3f2d7a,_0x539136){var _0x5ad277=function(_0x39810a){while(--_0x39810a){_0x3f2d7a['push'](_0x3f2d7a['shift']());}};_0x5ad277(++_0x539136);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0xe27180,_0x56e592){_0xe27180=_0xe27180-0x0;var _0x1624c9=_0xdf0c[_0xe27180];return _0x1624c9;};'use strict';var Sequelize=require(_0xcdf0('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xcdf0('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xcdf0('0x1')]}};
\ No newline at end of file
index 298b01a..58e1acb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8cc=['team_has_voice_prefixes','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xd8cc[_0x1034bb];return _0x453fdb;};'use strict';var _=require(_0xcd8c('0x0'));var util=require(_0xcd8c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcd8c('0x2'));var BPromise=require(_0xcd8c('0x3'));var rp=require(_0xcd8c('0x4'));var fs=require('fs');var path=require(_0xcd8c('0x5'));var rimraf=require('rimraf');var config=require(_0xcd8c('0x6'));var attributes=require(_0xcd8c('0x7'));module['exports']=function(_0x5776fc,_0x233d52){return _0x5776fc['define'](_0xcd8c('0x8'),attributes,{'tableName':_0xcd8c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x122a=['moment','path','../../config/environment','./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x286fc9,_0x15397f){var _0x12cc1f=function(_0x243f7f){while(--_0x243f7f){_0x286fc9['push'](_0x286fc9['shift']());}};_0x12cc1f(++_0x15397f);}(_0x122a,0xba));var _0xa122=function(_0x1d8e11,_0x381a83){_0x1d8e11=_0x1d8e11-0x0;var _0x27e18d=_0x122a[_0x1d8e11];return _0x27e18d;};'use strict';var _=require(_0xa122('0x0'));var util=require(_0xa122('0x1'));var logger=require(_0xa122('0x2'))(_0xa122('0x3'));var moment=require(_0xa122('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa122('0x5'));var rimraf=require('rimraf');var config=require(_0xa122('0x6'));var attributes=require(_0xa122('0x7'));module[_0xa122('0x8')]=function(_0x3c8130,_0x526272){return _0x3c8130['define']('TeamVoicePrefix',attributes,{'tableName':_0xa122('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 61f619a..e0d6bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x8d2853,_0x34ce05){var _0x3a6fa8=function(_0x1102e9){while(--_0x1102e9){_0x8d2853['push'](_0x8d2853['shift']());}};_0x3a6fa8(++_0x34ce05);}(_0x70e0,0x17b));var _0x070e=function(_0x4259cd,_0xc1ae1c){_0x4259cd=_0x4259cd-0x0;var _0x13bf1a=_0x70e0[_0x4259cd];return _0x13bf1a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3ed1df,_0x18d47a){var _0x313d39=function(_0x31b135){while(--_0x31b135){_0x3ed1df['push'](_0x3ed1df['shift']());}};_0x313d39(++_0x18d47a);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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
index 27016db..59e5905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1af=['sequelize','exports'];(function(_0x426c5c,_0x99a4f8){var _0x4a7905=function(_0x5585f5){while(--_0x5585f5){_0x426c5c['push'](_0x426c5c['shift']());}};_0x4a7905(++_0x99a4f8);}(_0xc1af,0x1b8));var _0xfc1a=function(_0xb854d8,_0x206a78){_0xb854d8=_0xb854d8-0x0;var _0x2ea47b=_0xc1af[_0xb854d8];return _0x2ea47b;};'use strict';var Sequelize=require(_0xfc1a('0x0'));module[_0xfc1a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9298=['exports','INTEGER','sequelize'];(function(_0x4ac060,_0x2c7eb7){var _0x5e98a8=function(_0x329dd9){while(--_0x329dd9){_0x4ac060['push'](_0x4ac060['shift']());}};_0x5e98a8(++_0x2c7eb7);}(_0x9298,0x1ca));var _0x8929=function(_0xe6a4e5,_0x1950b3){_0xe6a4e5=_0xe6a4e5-0x0;var _0x45fe8a=_0x9298[_0xe6a4e5];return _0x45fe8a;};'use strict';var Sequelize=require(_0x8929('0x0'));module[_0x8929('0x1')]={'penalty':{'type':Sequelize[_0x8929('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 12ef32a..44f6324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x615a=['path','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x53995f,_0x1b135c){var _0x1649a9=function(_0x4da99b){while(--_0x4da99b){_0x53995f['push'](_0x53995f['shift']());}};_0x1649a9(++_0x1b135c);}(_0x615a,0x119));var _0xa615=function(_0xeee8f2,_0x351024){_0xeee8f2=_0xeee8f2-0x0;var _0x16102b=_0x615a[_0xeee8f2];return _0x16102b;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bde=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','api','bluebird'];(function(_0x373e4a,_0x2fede7){var _0x13cb00=function(_0x505965){while(--_0x505965){_0x373e4a['push'](_0x373e4a['shift']());}};_0x13cb00(++_0x2fede7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x54c32f,_0x58ca2a){_0x54c32f=_0x54c32f-0x0;var _0x3c24c3=_0x9bde[_0x54c32f];return _0x3c24c3;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 66b4fd1..3c8fd93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7940=['http','then','info','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1d7111,_0x5ba4a4){var _0x2f4397=function(_0x4ec3a9){while(--_0x4ec3a9){_0x1d7111['push'](_0x1d7111['shift']());}};_0x2f4397(++_0x5ba4a4);}(_0x7940,0x1ee));var _0x0794=function(_0xf2d036,_0x43e681){_0xf2d036=_0xf2d036-0x0;var _0x5606fe=_0x7940[_0xf2d036];return _0x5606fe;};'use strict';var _=require(_0x0794('0x0'));var util=require('util');var moment=require(_0x0794('0x1'));var BPromise=require(_0x0794('0x2'));var rs=require(_0x0794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0794('0x4'))['db'];var utils=require(_0x0794('0x5'));var logger=require(_0x0794('0x6'))(_0x0794('0x7'));var config=require('../../config/environment');var jayson=require(_0x0794('0x8'));var client=jayson[_0x0794('0x9')][_0x0794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc61194,_0x10b4e9,_0x46f141){return new BPromise(function(_0xbdc4ac,_0x597be5){return client['request'](_0xc61194,_0x46f141)[_0x0794('0xb')](function(_0x46c26a){logger[_0x0794('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x10b4e9,_0x0794('0xd'));logger['debug'](_0x0794('0xe'),_0x10b4e9,_0x0794('0xd'),JSON[_0x0794('0xf')](_0x46c26a));if(_0x46c26a[_0x0794('0x10')]){if(_0x46c26a[_0x0794('0x10')][_0x0794('0x11')]===0x1f4){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0x597be5(_0x46c26a[_0x0794('0x10')]['message']);}logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0xbdc4ac(_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);}else{logger['info'](_0x0794('0x12'),_0x10b4e9,'request\x20sent');_0xbdc4ac(_0x46c26a[_0x0794('0x14')][_0x0794('0x13')]);}})['catch'](function(_0x66d7dd){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x66d7dd);_0x597be5(_0x66d7dd);});});}
\ No newline at end of file
+var _0xd98a=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','lodash','util','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd98a,0x156));var _0xad98=function(_0x3eb19a,_0x560bcf){_0x3eb19a=_0x3eb19a-0x0;var _0x164f94=_0xd98a[_0x3eb19a];return _0x164f94;};'use strict';var _=require(_0xad98('0x0'));var util=require(_0xad98('0x1'));var moment=require(_0xad98('0x2'));var BPromise=require(_0xad98('0x3'));var rs=require(_0xad98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad98('0x5'))['db'];var utils=require(_0xad98('0x6'));var logger=require('../../config/logger')(_0xad98('0x7'));var config=require(_0xad98('0x8'));var jayson=require(_0xad98('0x9'));var client=jayson[_0xad98('0xa')][_0xad98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4638d8,_0x159789,_0xba347){return new BPromise(function(_0x4d1b10,_0x1154a6){return client[_0xad98('0xc')](_0x4638d8,_0xba347)[_0xad98('0xd')](function(_0x1d4ecb){logger['info'](_0xad98('0xe'),_0x159789,'request\x20sent');logger[_0xad98('0xf')](_0xad98('0x10'),_0x159789,'request\x20sent',JSON['stringify'](_0x1d4ecb));if(_0x1d4ecb[_0xad98('0x11')]){if(_0x1d4ecb[_0xad98('0x11')]['code']===0x1f4){logger[_0xad98('0x11')](_0xad98('0xe'),_0x159789,_0x1d4ecb[_0xad98('0x11')][_0xad98('0x12')]);return _0x1154a6(_0x1d4ecb['error'][_0xad98('0x12')]);}logger[_0xad98('0x11')](_0xad98('0xe'),_0x159789,_0x1d4ecb[_0xad98('0x11')][_0xad98('0x12')]);return _0x4d1b10(_0x1d4ecb[_0xad98('0x11')][_0xad98('0x12')]);}else{logger[_0xad98('0x13')](_0xad98('0xe'),_0x159789,_0xad98('0x14'));_0x4d1b10(_0x1d4ecb[_0xad98('0x15')][_0xad98('0x12')]);}})[_0xad98('0x16')](function(_0x231a53){logger[_0xad98('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x159789,_0x231a53);_0x1154a6(_0x231a53);});});}
\ No newline at end of file
index 977d188..47ca1d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1d3=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./template.controller','get','index','/:id','isAuthenticated'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xc1d3,0x147));var _0x3c1d=function(_0xabb48f,_0x2e4bc0){_0xabb48f=_0xabb48f-0x0;var _0xeec13c=_0xc1d3[_0xabb48f];return _0xeec13c;};'use strict';var multer=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var path=require(_0x3c1d('0x2'));var timeout=require(_0x3c1d('0x3'));var express=require(_0x3c1d('0x4'));var router=express[_0x3c1d('0x5')]();var fs_extra=require(_0x3c1d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c1d('0x7'));var controller=require(_0x3c1d('0x8'));router[_0x3c1d('0x9')]('/',auth['isAuthenticated'](),controller[_0x3c1d('0xa')]);router[_0x3c1d('0x9')](_0x3c1d('0xb'),auth[_0x3c1d('0xc')](),controller[_0x3c1d('0xd')]);router['post']('/',auth[_0x3c1d('0xc')](),controller[_0x3c1d('0xe')]);router[_0x3c1d('0xf')](_0x3c1d('0xb'),auth[_0x3c1d('0xc')](),controller[_0x3c1d('0x10')]);router[_0x3c1d('0x11')](_0x3c1d('0xb'),auth['isAuthenticated'](),controller[_0x3c1d('0x12')]);module[_0x3c1d('0x13')]=router;
\ No newline at end of file
+var _0x72a1=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','util','connect-timeout'];(function(_0x4157cf,_0x3ff907){var _0x3dacbe=function(_0x503dc3){while(--_0x503dc3){_0x4157cf['push'](_0x4157cf['shift']());}};_0x3dacbe(++_0x3ff907);}(_0x72a1,0x1ce));var _0x172a=function(_0x1223bd,_0xcecb3a){_0x1223bd=_0x1223bd-0x0;var _0x8c7308=_0x72a1[_0x1223bd];return _0x8c7308;};'use strict';var multer=require('multer');var util=require(_0x172a('0x0'));var path=require('path');var timeout=require(_0x172a('0x1'));var express=require('express');var router=express[_0x172a('0x2')]();var fs_extra=require(_0x172a('0x3'));var auth=require(_0x172a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x172a('0x5'));var controller=require('./template.controller');router[_0x172a('0x6')]('/',auth['isAuthenticated'](),controller[_0x172a('0x7')]);router['get'](_0x172a('0x8'),auth[_0x172a('0x9')](),controller[_0x172a('0xa')]);router[_0x172a('0xb')]('/',auth['isAuthenticated'](),controller[_0x172a('0xc')]);router['put'](_0x172a('0x8'),auth[_0x172a('0x9')](),controller[_0x172a('0xd')]);router['delete'](_0x172a('0x8'),auth[_0x172a('0x9')](),controller[_0x172a('0xe')]);module[_0x172a('0xf')]=router;
\ No newline at end of file
index 13867da..cf66a8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9c6=['sequelize','exports','TEXT'];(function(_0x1d6e56,_0x1959b9){var _0xef8e84=function(_0x175e4e){while(--_0x175e4e){_0x1d6e56['push'](_0x1d6e56['shift']());}};_0xef8e84(++_0x1959b9);}(_0xe9c6,0x1c5));var _0x6e9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9c6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6e9c('0x0'));module[_0x6e9c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6e9c('0x2')]}};
\ No newline at end of file
+var _0xccf9=['exports','TEXT'];(function(_0x1ee6f3,_0x4079b5){var _0x51b17e=function(_0x3425e9){while(--_0x3425e9){_0x1ee6f3['push'](_0x1ee6f3['shift']());}};_0x51b17e(++_0x4079b5);}(_0xccf9,0xa2));var _0x9ccf=function(_0x57ebfb,_0xbaca42){_0x57ebfb=_0x57ebfb-0x0;var _0x56bc11=_0xccf9[_0x57ebfb];return _0x56bc11;};'use strict';var Sequelize=require('sequelize');module[_0x9ccf('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x9ccf('0x1')]}};
\ No newline at end of file
index ede673f..9b408b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd093=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','update','then','Templates','UserProfileResource','destroy','error','stack','name','index','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd093,0xbc));var _0x3d09=function(_0x4a057f,_0x596afb){_0x4a057f=_0x4a057f-0x0;var _0x27f434=_0xd093[_0x4a057f];return _0x27f434;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d09('0x0'));var zipdir=require(_0x3d09('0x1'));var jsonpatch=require(_0x3d09('0x2'));var rp=require('request-promise');var moment=require(_0x3d09('0x3'));var BPromise=require(_0x3d09('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d09('0x5'));var sox=require(_0x3d09('0x6'));var csv=require(_0x3d09('0x7'));var ejs=require(_0x3d09('0x8'));var fs=require('fs');var fs_extra=require(_0x3d09('0x9'));var _=require('lodash');var squel=require(_0x3d09('0xa'));var crypto=require('crypto');var jsforce=require(_0x3d09('0xb'));var deskjs=require(_0x3d09('0xc'));var toCsv=require(_0x3d09('0x7'));var querystring=require('querystring');var Papa=require(_0x3d09('0xd'));var Redis=require('ioredis');var authService=require(_0x3d09('0xe'));var qs=require(_0x3d09('0xf'));var as=require(_0x3d09('0x10'));var hardwareService=require(_0x3d09('0x11'));var logger=require(_0x3d09('0x12'))(_0x3d09('0x13'));var utils=require(_0x3d09('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d09('0x15'))['db'];function respondWithStatusCode(_0x15765b,_0x134522){_0x134522=_0x134522||0xcc;return function(_0x364bf4){if(_0x364bf4){return _0x15765b[_0x3d09('0x16')](_0x134522);}return _0x15765b['status'](_0x134522)['end']();};}function respondWithResult(_0x2a73ea,_0x19fc7c){_0x19fc7c=_0x19fc7c||0xc8;return function(_0x521d3f){if(_0x521d3f){return _0x2a73ea[_0x3d09('0x17')](_0x19fc7c)['json'](_0x521d3f);}};}function respondWithFilteredResult(_0x31ec79,_0x46526b){return function(_0x5c19e2){if(_0x5c19e2){var _0xb93168=typeof _0x46526b[_0x3d09('0x18')]==='undefined'&&typeof _0x46526b['limit']===_0x3d09('0x19');var _0x50dde0=_0x5c19e2['count'];var _0x2830f7=_0xb93168?0x0:_0x46526b[_0x3d09('0x18')];var _0x2fd760=_0xb93168?_0x5c19e2['count']:_0x46526b[_0x3d09('0x18')]+_0x46526b[_0x3d09('0x1a')];var _0x2d41e4;if(_0x2fd760>=_0x50dde0){_0x2fd760=_0x50dde0;_0x2d41e4=0xc8;}else{_0x2d41e4=0xce;}_0x31ec79[_0x3d09('0x17')](_0x2d41e4);return _0x31ec79[_0x3d09('0x1b')](_0x3d09('0x1c'),_0x2830f7+'-'+_0x2fd760+'/'+_0x50dde0)['json'](_0x5c19e2);}return null;};}function patchUpdates(_0x447524){return function(_0x36df70){try{jsonpatch[_0x3d09('0x1d')](_0x36df70,_0x447524,!![]);}catch(_0x3ea536){return BPromise['reject'](_0x3ea536);}return _0x36df70['save']();};}function saveUpdates(_0x574d2e,_0x2a0e99){return function(_0x8a5e54){if(_0x8a5e54){return _0x8a5e54[_0x3d09('0x1e')](_0x574d2e)[_0x3d09('0x1f')](function(_0x5957ad){return _0x5957ad;});}return null;};}function removeEntity(_0x387afe,_0x1fd685){return function(_0x4d533e){if(_0x4d533e){return _0x4d533e['destroy']()['then'](function(){var _0x2fb9b6=_0x4d533e['get']({'plain':!![]});var _0x5868f7=_0x3d09('0x20');return db[_0x3d09('0x21')][_0x3d09('0x22')]({'where':{'type':_0x5868f7,'resourceId':_0x2fb9b6['id']}})[_0x3d09('0x1f')](function(){return _0x4d533e;});})[_0x3d09('0x1f')](function(){_0x387afe[_0x3d09('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548e4f,_0x3f3d13){return function(_0x54e8f0){if(!_0x54e8f0){_0x548e4f[_0x3d09('0x16')](0x194);}return _0x54e8f0;};}function handleError(_0x4e3165,_0x14ff21){_0x14ff21=_0x14ff21||0x1f4;return function(_0x5cf768){logger[_0x3d09('0x23')](_0x5cf768[_0x3d09('0x24')]);if(_0x5cf768[_0x3d09('0x25')]){delete _0x5cf768[_0x3d09('0x25')];}_0x4e3165['status'](_0x14ff21)['send'](_0x5cf768);};}exports[_0x3d09('0x26')]=function(_0x4341d3,_0x5455db){var _0x30e1c3={},_0x44d316={},_0x11b89d={'count':0x0,'rows':[]};var _0x3c0261=_[_0x3d09('0x27')](db[_0x3d09('0x28')][_0x3d09('0x29')],function(_0x521800){return{'name':_0x521800[_0x3d09('0x2a')],'type':_0x521800['type'][_0x3d09('0x2b')]};});_0x44d316[_0x3d09('0x2c')]=_[_0x3d09('0x27')](_0x3c0261,_0x3d09('0x25'));_0x44d316[_0x3d09('0x2d')]=_[_0x3d09('0x2e')](_0x4341d3['query']);_0x44d316[_0x3d09('0x2f')]=_[_0x3d09('0x30')](_0x44d316[_0x3d09('0x2c')],_0x44d316['query']);_0x30e1c3[_0x3d09('0x31')]=_[_0x3d09('0x30')](_0x44d316[_0x3d09('0x2c')],qs[_0x3d09('0x32')](_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x32')]));_0x30e1c3[_0x3d09('0x31')]=_0x30e1c3[_0x3d09('0x31')][_0x3d09('0x33')]?_0x30e1c3['attributes']:_0x44d316[_0x3d09('0x2c')];if(!_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x34')](_0x3d09('0x35'))){_0x30e1c3[_0x3d09('0x1a')]=qs[_0x3d09('0x1a')](_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x1a')]);_0x30e1c3['offset']=qs[_0x3d09('0x18')](_0x4341d3['query'][_0x3d09('0x18')]);}_0x30e1c3['order']=qs[_0x3d09('0x36')](_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x36')]);_0x30e1c3[_0x3d09('0x37')]=qs['filters'](_[_0x3d09('0x38')](_0x4341d3[_0x3d09('0x2d')],_0x44d316[_0x3d09('0x2f')]),_0x3c0261);if(_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x39')]){_0x30e1c3[_0x3d09('0x37')]=_[_0x3d09('0x3a')](_0x30e1c3[_0x3d09('0x37')],{'$or':_['map'](_0x3c0261,function(_0xc3ca26){if(_0xc3ca26['type']!==_0x3d09('0x3b')){var _0x36564d={};_0x36564d[_0xc3ca26['name']]={'$like':'%'+_0x4341d3[_0x3d09('0x2d')][_0x3d09('0x39')]+'%'};return _0x36564d;}})});}_0x30e1c3=_[_0x3d09('0x3a')]({},_0x30e1c3,_0x4341d3[_0x3d09('0x3c')]);var _0x46a57c={'where':_0x30e1c3[_0x3d09('0x37')]};return db[_0x3d09('0x28')][_0x3d09('0x3d')](_0x46a57c)[_0x3d09('0x1f')](function(_0x3a78ca){_0x11b89d[_0x3d09('0x3d')]=_0x3a78ca;if(_0x4341d3[_0x3d09('0x2d')]['includeAll']){_0x30e1c3[_0x3d09('0x3e')]=[{'all':!![]}];}return db[_0x3d09('0x28')][_0x3d09('0x3f')](_0x30e1c3);})[_0x3d09('0x1f')](function(_0x3eebc5){_0x11b89d[_0x3d09('0x40')]=_0x3eebc5;return _0x11b89d;})[_0x3d09('0x1f')](respondWithFilteredResult(_0x5455db,_0x30e1c3))[_0x3d09('0x41')](handleError(_0x5455db,null));};exports[_0x3d09('0x42')]=function(_0x39b3aa,_0x21bca3){var _0xcb1733={'raw':!![],'where':{'id':_0x39b3aa[_0x3d09('0x43')]['id']}},_0x1a70e6={};_0x1a70e6[_0x3d09('0x2c')]=_[_0x3d09('0x2e')](db[_0x3d09('0x28')]['rawAttributes']);_0x1a70e6['query']=_[_0x3d09('0x2e')](_0x39b3aa['query']);_0x1a70e6['filters']=_['intersection'](_0x1a70e6[_0x3d09('0x2c')],_0x1a70e6['query']);_0xcb1733[_0x3d09('0x31')]=_['intersection'](_0x1a70e6['model'],qs['fields'](_0x39b3aa[_0x3d09('0x2d')][_0x3d09('0x32')]));_0xcb1733[_0x3d09('0x31')]=_0xcb1733[_0x3d09('0x31')]['length']?_0xcb1733[_0x3d09('0x31')]:_0x1a70e6[_0x3d09('0x2c')];if(_0x39b3aa[_0x3d09('0x2d')][_0x3d09('0x44')]){_0xcb1733[_0x3d09('0x3e')]=[{'all':!![]}];}_0xcb1733=_[_0x3d09('0x3a')]({},_0xcb1733,_0x39b3aa['options']);return db[_0x3d09('0x28')][_0x3d09('0x45')](_0xcb1733)[_0x3d09('0x1f')](handleEntityNotFound(_0x21bca3,null))[_0x3d09('0x1f')](respondWithResult(_0x21bca3,null))[_0x3d09('0x41')](handleError(_0x21bca3,null));};exports['create']=function(_0x3eaec4,_0x3e0e27){return db[_0x3d09('0x28')][_0x3d09('0x46')](_0x3eaec4['body'],{})['then'](function(_0x54391a){var _0xd00132=_0x3eaec4[_0x3d09('0x47')]['get']({'plain':!![]});if(!_0xd00132)throw new Error(_0x3d09('0x48'));if(_0xd00132[_0x3d09('0x49')]===_0x3d09('0x47')){var _0x172145=_0x54391a[_0x3d09('0x4a')]({'plain':!![]});var _0x4cfca5=_0x3d09('0x20');return db[_0x3d09('0x4b')][_0x3d09('0x45')]({'where':{'name':_0x4cfca5,'userProfileId':_0xd00132[_0x3d09('0x4c')]},'raw':!![]})[_0x3d09('0x1f')](function(_0x5b2230){if(_0x5b2230&&_0x5b2230[_0x3d09('0x4d')]===0x0){return db[_0x3d09('0x21')][_0x3d09('0x46')]({'name':_0x172145[_0x3d09('0x25')],'resourceId':_0x172145['id'],'type':_0x5b2230[_0x3d09('0x25')],'sectionId':_0x5b2230['id']},{})['then'](function(){return _0x54391a;});}else{return _0x54391a;}})[_0x3d09('0x41')](function(_0x1fbc42){logger[_0x3d09('0x23')](_0x3d09('0x4e'),_0x1fbc42);throw _0x1fbc42;});}return _0x54391a;})[_0x3d09('0x1f')](respondWithResult(_0x3e0e27,0xc9))[_0x3d09('0x41')](handleError(_0x3e0e27,null));};exports[_0x3d09('0x1e')]=function(_0x567706,_0x40980f){if(_0x567706[_0x3d09('0x4f')]['id']){delete _0x567706[_0x3d09('0x4f')]['id'];}return db[_0x3d09('0x28')][_0x3d09('0x45')]({'where':{'id':_0x567706[_0x3d09('0x43')]['id']}})[_0x3d09('0x1f')](handleEntityNotFound(_0x40980f,null))['then'](saveUpdates(_0x567706[_0x3d09('0x4f')],null))[_0x3d09('0x1f')](respondWithResult(_0x40980f,null))[_0x3d09('0x41')](handleError(_0x40980f,null));};exports[_0x3d09('0x22')]=function(_0x591de5,_0x46d4e7){return db[_0x3d09('0x28')]['find']({'where':{'id':_0x591de5[_0x3d09('0x43')]['id']}})['then'](handleEntityNotFound(_0x46d4e7,null))[_0x3d09('0x1f')](removeEntity(_0x46d4e7,null))[_0x3d09('0x41')](handleError(_0x46d4e7,null));};
\ No newline at end of file
+var _0xb72b=['include','options','find','catch','create','body','user','get','Templates','UserProfileSection','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0xb72b,0x1bb));var _0xbb72=function(_0x1f885e,_0x83ce8){_0x1f885e=_0x1f885e-0x0;var _0xb76bca=_0xb72b[_0x1f885e];return _0xb76bca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb72('0x0'));var zipdir=require(_0xbb72('0x1'));var jsonpatch=require(_0xbb72('0x2'));var rp=require(_0xbb72('0x3'));var moment=require(_0xbb72('0x4'));var BPromise=require(_0xbb72('0x5'));var Mustache=require(_0xbb72('0x6'));var util=require(_0xbb72('0x7'));var path=require(_0xbb72('0x8'));var sox=require(_0xbb72('0x9'));var csv=require('to-csv');var ejs=require(_0xbb72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb72('0xb'));var squel=require(_0xbb72('0xc'));var crypto=require(_0xbb72('0xd'));var jsforce=require(_0xbb72('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb72('0xf'));var querystring=require(_0xbb72('0x10'));var Papa=require(_0xbb72('0x11'));var Redis=require(_0xbb72('0x12'));var authService=require(_0xbb72('0x13'));var qs=require(_0xbb72('0x14'));var as=require(_0xbb72('0x15'));var hardwareService=require(_0xbb72('0x16'));var logger=require(_0xbb72('0x17'))('api');var utils=require(_0xbb72('0x18'));var config=require(_0xbb72('0x19'));var licenseUtil=require(_0xbb72('0x1a'));var db=require(_0xbb72('0x1b'))['db'];function respondWithStatusCode(_0xc79537,_0x369bbc){_0x369bbc=_0x369bbc||0xcc;return function(_0xaa4c4){if(_0xaa4c4){return _0xc79537[_0xbb72('0x1c')](_0x369bbc);}return _0xc79537[_0xbb72('0x1d')](_0x369bbc)[_0xbb72('0x1e')]();};}function respondWithResult(_0x304b81,_0x1a2c43){_0x1a2c43=_0x1a2c43||0xc8;return function(_0x464e4c){if(_0x464e4c){return _0x304b81[_0xbb72('0x1d')](_0x1a2c43)[_0xbb72('0x1f')](_0x464e4c);}};}function respondWithFilteredResult(_0x4f1f07,_0xfb167c){return function(_0x171cfb){if(_0x171cfb){var _0x33716f=typeof _0xfb167c[_0xbb72('0x20')]===_0xbb72('0x21')&&typeof _0xfb167c[_0xbb72('0x22')]===_0xbb72('0x21');var _0x248f10=_0x171cfb[_0xbb72('0x23')];var _0x1cb1b0=_0x33716f?0x0:_0xfb167c['offset'];var _0x3ac1b1=_0x33716f?_0x171cfb[_0xbb72('0x23')]:_0xfb167c[_0xbb72('0x20')]+_0xfb167c[_0xbb72('0x22')];var _0x457e59;if(_0x3ac1b1>=_0x248f10){_0x3ac1b1=_0x248f10;_0x457e59=0xc8;}else{_0x457e59=0xce;}_0x4f1f07['status'](_0x457e59);return _0x4f1f07[_0xbb72('0x24')](_0xbb72('0x25'),_0x1cb1b0+'-'+_0x3ac1b1+'/'+_0x248f10)['json'](_0x171cfb);}return null;};}function patchUpdates(_0xa33ac1){return function(_0x228409){try{jsonpatch[_0xbb72('0x26')](_0x228409,_0xa33ac1,!![]);}catch(_0x2d89b1){return BPromise[_0xbb72('0x27')](_0x2d89b1);}return _0x228409['save']();};}function saveUpdates(_0x1cef87,_0x16702f){return function(_0x14a7cc){if(_0x14a7cc){return _0x14a7cc[_0xbb72('0x28')](_0x1cef87)['then'](function(_0x301202){return _0x301202;});}return null;};}function removeEntity(_0x1983a9,_0xd0f9ce){return function(_0x2e4df1){if(_0x2e4df1){return _0x2e4df1[_0xbb72('0x29')]()[_0xbb72('0x2a')](function(){var _0x2a28f2=_0x2e4df1['get']({'plain':!![]});var _0x37f6e7='Templates';return db[_0xbb72('0x2b')]['destroy']({'where':{'type':_0x37f6e7,'resourceId':_0x2a28f2['id']}})[_0xbb72('0x2a')](function(){return _0x2e4df1;});})[_0xbb72('0x2a')](function(){_0x1983a9[_0xbb72('0x1d')](0xcc)[_0xbb72('0x1e')]();});}};}function handleEntityNotFound(_0x1b9104,_0x25a26c){return function(_0x18a526){if(!_0x18a526){_0x1b9104[_0xbb72('0x1c')](0x194);}return _0x18a526;};}function handleError(_0x2e8950,_0x11aecf){_0x11aecf=_0x11aecf||0x1f4;return function(_0x388ec0){logger[_0xbb72('0x2c')](_0x388ec0[_0xbb72('0x2d')]);if(_0x388ec0[_0xbb72('0x2e')]){delete _0x388ec0['name'];}_0x2e8950[_0xbb72('0x1d')](_0x11aecf)[_0xbb72('0x2f')](_0x388ec0);};}exports[_0xbb72('0x30')]=function(_0xd256ee,_0x4caa88){var _0x5d6ff1={},_0x873ab1={},_0x549e90={'count':0x0,'rows':[]};var _0x560586=_[_0xbb72('0x31')](db[_0xbb72('0x32')][_0xbb72('0x33')],function(_0x3de132){return{'name':_0x3de132['fieldName'],'type':_0x3de132[_0xbb72('0x34')][_0xbb72('0x35')]};});_0x873ab1[_0xbb72('0x36')]=_[_0xbb72('0x31')](_0x560586,_0xbb72('0x2e'));_0x873ab1[_0xbb72('0x37')]=_[_0xbb72('0x38')](_0xd256ee[_0xbb72('0x37')]);_0x873ab1[_0xbb72('0x39')]=_[_0xbb72('0x3a')](_0x873ab1[_0xbb72('0x36')],_0x873ab1[_0xbb72('0x37')]);_0x5d6ff1[_0xbb72('0x3b')]=_[_0xbb72('0x3a')](_0x873ab1[_0xbb72('0x36')],qs[_0xbb72('0x3c')](_0xd256ee[_0xbb72('0x37')][_0xbb72('0x3c')]));_0x5d6ff1[_0xbb72('0x3b')]=_0x5d6ff1[_0xbb72('0x3b')][_0xbb72('0x3d')]?_0x5d6ff1[_0xbb72('0x3b')]:_0x873ab1[_0xbb72('0x36')];if(!_0xd256ee[_0xbb72('0x37')][_0xbb72('0x3e')](_0xbb72('0x3f'))){_0x5d6ff1[_0xbb72('0x22')]=qs[_0xbb72('0x22')](_0xd256ee[_0xbb72('0x37')][_0xbb72('0x22')]);_0x5d6ff1['offset']=qs[_0xbb72('0x20')](_0xd256ee[_0xbb72('0x37')][_0xbb72('0x20')]);}_0x5d6ff1['order']=qs['sort'](_0xd256ee['query'][_0xbb72('0x40')]);_0x5d6ff1[_0xbb72('0x41')]=qs[_0xbb72('0x39')](_['pick'](_0xd256ee[_0xbb72('0x37')],_0x873ab1[_0xbb72('0x39')]),_0x560586);if(_0xd256ee['query'][_0xbb72('0x42')]){_0x5d6ff1[_0xbb72('0x41')]=_[_0xbb72('0x43')](_0x5d6ff1[_0xbb72('0x41')],{'$or':_[_0xbb72('0x31')](_0x560586,function(_0x1a0ab6){if(_0x1a0ab6['type']!==_0xbb72('0x44')){var _0x3dffd8={};_0x3dffd8[_0x1a0ab6[_0xbb72('0x2e')]]={'$like':'%'+_0xd256ee[_0xbb72('0x37')][_0xbb72('0x42')]+'%'};return _0x3dffd8;}})});}_0x5d6ff1=_['merge']({},_0x5d6ff1,_0xd256ee['options']);var _0x530e53={'where':_0x5d6ff1[_0xbb72('0x41')]};return db[_0xbb72('0x32')][_0xbb72('0x23')](_0x530e53)['then'](function(_0x10f436){_0x549e90['count']=_0x10f436;if(_0xd256ee['query'][_0xbb72('0x45')]){_0x5d6ff1['include']=[{'all':!![]}];}return db['Template'][_0xbb72('0x46')](_0x5d6ff1);})[_0xbb72('0x2a')](function(_0x4b2856){_0x549e90[_0xbb72('0x47')]=_0x4b2856;return _0x549e90;})['then'](respondWithFilteredResult(_0x4caa88,_0x5d6ff1))['catch'](handleError(_0x4caa88,null));};exports[_0xbb72('0x48')]=function(_0x3da9ef,_0x5a71e4){var _0x56c5bc={'raw':!![],'where':{'id':_0x3da9ef['params']['id']}},_0x3841cc={};_0x3841cc[_0xbb72('0x36')]=_[_0xbb72('0x38')](db['Template'][_0xbb72('0x33')]);_0x3841cc['query']=_[_0xbb72('0x38')](_0x3da9ef[_0xbb72('0x37')]);_0x3841cc[_0xbb72('0x39')]=_[_0xbb72('0x3a')](_0x3841cc[_0xbb72('0x36')],_0x3841cc[_0xbb72('0x37')]);_0x56c5bc['attributes']=_['intersection'](_0x3841cc[_0xbb72('0x36')],qs['fields'](_0x3da9ef[_0xbb72('0x37')][_0xbb72('0x3c')]));_0x56c5bc[_0xbb72('0x3b')]=_0x56c5bc[_0xbb72('0x3b')][_0xbb72('0x3d')]?_0x56c5bc['attributes']:_0x3841cc['model'];if(_0x3da9ef[_0xbb72('0x37')][_0xbb72('0x45')]){_0x56c5bc[_0xbb72('0x49')]=[{'all':!![]}];}_0x56c5bc=_[_0xbb72('0x43')]({},_0x56c5bc,_0x3da9ef[_0xbb72('0x4a')]);return db['Template'][_0xbb72('0x4b')](_0x56c5bc)[_0xbb72('0x2a')](handleEntityNotFound(_0x5a71e4,null))[_0xbb72('0x2a')](respondWithResult(_0x5a71e4,null))[_0xbb72('0x4c')](handleError(_0x5a71e4,null));};exports[_0xbb72('0x4d')]=function(_0x257b6a,_0x5b2efa){return db['Template']['create'](_0x257b6a[_0xbb72('0x4e')],{})[_0xbb72('0x2a')](function(_0x49987e){var _0x39f471=_0x257b6a[_0xbb72('0x4f')][_0xbb72('0x50')]({'plain':!![]});if(!_0x39f471)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39f471['role']===_0xbb72('0x4f')){var _0x4d9dd5=_0x49987e[_0xbb72('0x50')]({'plain':!![]});var _0x1da6a1=_0xbb72('0x51');return db[_0xbb72('0x52')]['find']({'where':{'name':_0x1da6a1,'userProfileId':_0x39f471[_0xbb72('0x53')]},'raw':!![]})[_0xbb72('0x2a')](function(_0x5c4bc3){if(_0x5c4bc3&&_0x5c4bc3[_0xbb72('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d9dd5[_0xbb72('0x2e')],'resourceId':_0x4d9dd5['id'],'type':_0x5c4bc3[_0xbb72('0x2e')],'sectionId':_0x5c4bc3['id']},{})[_0xbb72('0x2a')](function(){return _0x49987e;});}else{return _0x49987e;}})[_0xbb72('0x4c')](function(_0xdbabb8){logger[_0xbb72('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdbabb8);throw _0xdbabb8;});}return _0x49987e;})[_0xbb72('0x2a')](respondWithResult(_0x5b2efa,0xc9))[_0xbb72('0x4c')](handleError(_0x5b2efa,null));};exports[_0xbb72('0x28')]=function(_0x43e47c,_0x200b27){if(_0x43e47c[_0xbb72('0x4e')]['id']){delete _0x43e47c[_0xbb72('0x4e')]['id'];}return db[_0xbb72('0x32')][_0xbb72('0x4b')]({'where':{'id':_0x43e47c[_0xbb72('0x55')]['id']}})[_0xbb72('0x2a')](handleEntityNotFound(_0x200b27,null))[_0xbb72('0x2a')](saveUpdates(_0x43e47c['body'],null))['then'](respondWithResult(_0x200b27,null))['catch'](handleError(_0x200b27,null));};exports[_0xbb72('0x29')]=function(_0x457ab9,_0xcec922){return db[_0xbb72('0x32')][_0xbb72('0x4b')]({'where':{'id':_0x457ab9[_0xbb72('0x55')]['id']}})[_0xbb72('0x2a')](handleEntityNotFound(_0xcec922,null))[_0xbb72('0x2a')](removeEntity(_0xcec922,null))[_0xbb72('0x4c')](handleError(_0xcec922,null));};
\ No newline at end of file
index f50b63c..60acbc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b6e=['rimraf','../../config/environment','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','request-promise'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x3b6e,0x1b3));var _0xe3b6=function(_0x1966b0,_0x512e22){_0x1966b0=_0x1966b0-0x0;var _0x505260=_0x3b6e[_0x1966b0];return _0x505260;};'use strict';var _=require(_0xe3b6('0x0'));var util=require(_0xe3b6('0x1'));var logger=require(_0xe3b6('0x2'))(_0xe3b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe3b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3b6('0x5'));var config=require(_0xe3b6('0x6'));var attributes=require('./template.attributes');module[_0xe3b6('0x7')]=function(_0x4798ef,_0x5a0092){return _0x4798ef[_0xe3b6('0x8')](_0xe3b6('0x9'),attributes,{'tableName':_0xe3b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e16=['exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0x0e16,0x92));var _0x60e1=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0e16[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x60e1('0x0'));var util=require('util');var logger=require(_0x60e1('0x1'))(_0x60e1('0x2'));var moment=require(_0x60e1('0x3'));var BPromise=require(_0x60e1('0x4'));var rp=require(_0x60e1('0x5'));var fs=require('fs');var path=require(_0x60e1('0x6'));var rimraf=require(_0x60e1('0x7'));var config=require(_0x60e1('0x8'));var attributes=require(_0x60e1('0x9'));module[_0x60e1('0xa')]=function(_0xbda852,_0x3a955b){return _0xbda852[_0x60e1('0xb')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07c6d4c..b9c65cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bb9=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','lodash'];(function(_0x244c9e,_0x36210e){var _0x4d294a=function(_0x488c7c){while(--_0x488c7c){_0x244c9e['push'](_0x244c9e['shift']());}};_0x4d294a(++_0x36210e);}(_0x1bb9,0x17f));var _0x91bb=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x1bb9[_0x324012];return _0x435cf2;};'use strict';var _=require(_0x91bb('0x0'));var util=require(_0x91bb('0x1'));var moment=require(_0x91bb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x91bb('0x4'));var logger=require(_0x91bb('0x5'))(_0x91bb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x91bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11aa8b,_0x1b9647,_0x33edd7){return new BPromise(function(_0x365d3a,_0x26f2a5){return client[_0x91bb('0x8')](_0x11aa8b,_0x33edd7)['then'](function(_0x57f8fa){logger[_0x91bb('0x9')](_0x91bb('0xa'),_0x1b9647,_0x91bb('0xb'));logger['debug'](_0x91bb('0xc'),_0x1b9647,_0x91bb('0xb'),JSON[_0x91bb('0xd')](_0x57f8fa));if(_0x57f8fa['error']){if(_0x57f8fa['error'][_0x91bb('0xe')]===0x1f4){logger[_0x91bb('0xf')](_0x91bb('0xa'),_0x1b9647,_0x57f8fa[_0x91bb('0xf')][_0x91bb('0x10')]);return _0x26f2a5(_0x57f8fa[_0x91bb('0xf')][_0x91bb('0x10')]);}logger[_0x91bb('0xf')](_0x91bb('0xa'),_0x1b9647,_0x57f8fa[_0x91bb('0xf')][_0x91bb('0x10')]);return _0x365d3a(_0x57f8fa[_0x91bb('0xf')][_0x91bb('0x10')]);}else{logger[_0x91bb('0x9')](_0x91bb('0xa'),_0x1b9647,_0x91bb('0xb'));_0x365d3a(_0x57f8fa[_0x91bb('0x11')][_0x91bb('0x10')]);}})['catch'](function(_0x5d15f1){logger[_0x91bb('0xf')](_0x91bb('0xa'),_0x1b9647,_0x5d15f1);_0x26f2a5(_0x5d15f1);});});}exports[_0x91bb('0x12')]=function(_0x4c2a7e){var _0x3aed1b=this;return new Promise(function(_0x5f0be2,_0x57ebb1){return db[_0x91bb('0x13')][_0x91bb('0x14')]({'raw':_0x4c2a7e['options']?_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x16')]===undefined?!![]:![]:!![],'where':_0x4c2a7e[_0x91bb('0x15')]?_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x17')]||null:null,'attributes':_0x4c2a7e[_0x91bb('0x15')]?_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x18')]||null:null,'limit':_0x4c2a7e['options']?_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x19')]||null:null,'include':_0x4c2a7e[_0x91bb('0x15')]?_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x1a')]?_[_0x91bb('0x1b')](_0x4c2a7e[_0x91bb('0x15')][_0x91bb('0x1a')],function(_0xd95a35){return{'model':db[_0xd95a35[_0x91bb('0x1c')]],'as':_0xd95a35['as'],'attributes':_0xd95a35[_0x91bb('0x18')],'include':_0xd95a35[_0x91bb('0x1a')]?_[_0x91bb('0x1b')](_0xd95a35[_0x91bb('0x1a')],function(_0x1d0730){return{'model':db[_0x1d0730[_0x91bb('0x1c')]],'as':_0x1d0730['as'],'attributes':_0x1d0730[_0x91bb('0x18')],'include':_0x1d0730[_0x91bb('0x1a')]?_[_0x91bb('0x1b')](_0x1d0730[_0x91bb('0x1a')],function(_0x1b7a2b){return{'model':db[_0x1b7a2b['model']],'as':_0x1b7a2b['as'],'attributes':_0x1b7a2b[_0x91bb('0x18')]};}):[]};}):[]};}):[]:[]})[_0x91bb('0x1d')](function(_0x1894db){logger[_0x91bb('0x9')](_0x91bb('0x12'),_0x4c2a7e);logger[_0x91bb('0x1e')](_0x91bb('0x12'),_0x4c2a7e,JSON[_0x91bb('0xd')](_0x1894db));_0x5f0be2(_0x1894db);})[_0x91bb('0x1f')](function(_0x55c4c7){logger[_0x91bb('0xf')](_0x91bb('0x12'),_0x55c4c7['message'],_0x4c2a7e);_0x57ebb1(_0x3aed1b['error'](0x1f4,_0x55c4c7['message']));});});};
\ No newline at end of file
+var _0x8b62=['options','where','limit','include','model','map','attributes','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x8b62,0xa7));var _0x28b6=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x8b62[_0x384231];return _0x2480bf;};'use strict';var _=require('lodash');var util=require(_0x28b6('0x0'));var moment=require(_0x28b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x28b6('0x2'));var fs=require('fs');var Redis=require(_0x28b6('0x3'));var db=require(_0x28b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28b6('0x5'));var config=require(_0x28b6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x28b6('0x7')][_0x28b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfa7719,_0x3d3df7,_0x13f409){return new BPromise(function(_0x2923fc,_0x26e7ed){return client[_0x28b6('0x9')](_0xfa7719,_0x13f409)[_0x28b6('0xa')](function(_0x5d9b4){logger[_0x28b6('0xb')]('Template,\x20%s,\x20%s',_0x3d3df7,_0x28b6('0xc'));logger[_0x28b6('0xd')](_0x28b6('0xe'),_0x3d3df7,_0x28b6('0xc'),JSON[_0x28b6('0xf')](_0x5d9b4));if(_0x5d9b4[_0x28b6('0x10')]){if(_0x5d9b4[_0x28b6('0x10')][_0x28b6('0x11')]===0x1f4){logger[_0x28b6('0x10')](_0x28b6('0x12'),_0x3d3df7,_0x5d9b4[_0x28b6('0x10')][_0x28b6('0x13')]);return _0x26e7ed(_0x5d9b4[_0x28b6('0x10')][_0x28b6('0x13')]);}logger[_0x28b6('0x10')](_0x28b6('0x12'),_0x3d3df7,_0x5d9b4[_0x28b6('0x10')]['message']);return _0x2923fc(_0x5d9b4[_0x28b6('0x10')][_0x28b6('0x13')]);}else{logger[_0x28b6('0xb')]('Template,\x20%s,\x20%s',_0x3d3df7,_0x28b6('0xc'));_0x2923fc(_0x5d9b4[_0x28b6('0x14')][_0x28b6('0x13')]);}})[_0x28b6('0x15')](function(_0x4d7aa8){logger[_0x28b6('0x10')](_0x28b6('0x12'),_0x3d3df7,_0x4d7aa8);_0x26e7ed(_0x4d7aa8);});});}exports[_0x28b6('0x16')]=function(_0x53b143){var _0x208c02=this;return new Promise(function(_0x9eadc6,_0x19a592){return db[_0x28b6('0x17')][_0x28b6('0x18')]({'raw':_0x53b143[_0x28b6('0x19')]?_0x53b143[_0x28b6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x53b143[_0x28b6('0x19')]?_0x53b143[_0x28b6('0x19')][_0x28b6('0x1a')]||null:null,'attributes':_0x53b143[_0x28b6('0x19')]?_0x53b143[_0x28b6('0x19')]['attributes']||null:null,'limit':_0x53b143[_0x28b6('0x19')]?_0x53b143[_0x28b6('0x19')][_0x28b6('0x1b')]||null:null,'include':_0x53b143[_0x28b6('0x19')]?_0x53b143[_0x28b6('0x19')][_0x28b6('0x1c')]?_['map'](_0x53b143[_0x28b6('0x19')][_0x28b6('0x1c')],function(_0x2d6b60){return{'model':db[_0x2d6b60[_0x28b6('0x1d')]],'as':_0x2d6b60['as'],'attributes':_0x2d6b60['attributes'],'include':_0x2d6b60[_0x28b6('0x1c')]?_[_0x28b6('0x1e')](_0x2d6b60[_0x28b6('0x1c')],function(_0x196590){return{'model':db[_0x196590['model']],'as':_0x196590['as'],'attributes':_0x196590[_0x28b6('0x1f')],'include':_0x196590[_0x28b6('0x1c')]?_[_0x28b6('0x1e')](_0x196590[_0x28b6('0x1c')],function(_0x4fd22d){return{'model':db[_0x4fd22d['model']],'as':_0x4fd22d['as'],'attributes':_0x4fd22d[_0x28b6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x28b6('0xa')](function(_0x5be42a){logger[_0x28b6('0xb')]('GetTemplate',_0x53b143);logger[_0x28b6('0xd')](_0x28b6('0x16'),_0x53b143,JSON['stringify'](_0x5be42a));_0x9eadc6(_0x5be42a);})[_0x28b6('0x15')](function(_0x3550fe){logger[_0x28b6('0x10')](_0x28b6('0x16'),_0x3550fe[_0x28b6('0x13')],_0x53b143);_0x19a592(_0x208c02[_0x28b6('0x10')](0x1f4,_0x3550fe[_0x28b6('0x13')]));});});};
\ No newline at end of file
index 804c747..b34aec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e63=['getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAnyCondition','addAction','update','/:id','destroy','util','express','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','show','getAllConditions','/:id/any_conditions'];(function(_0x4e4853,_0x369e85){var _0x2c3b12=function(_0xd8833b){while(--_0xd8833b){_0x4e4853['push'](_0x4e4853['shift']());}};_0x2c3b12(++_0x369e85);}(_0x4e63,0x1ad));var _0x34e6=function(_0x3054b2,_0x2d369a){_0x3054b2=_0x3054b2-0x0;var _0x24e43a=_0x4e63[_0x3054b2];return _0x24e43a;};'use strict';var multer=require('multer');var util=require(_0x34e6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34e6('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34e6('0x2'));var interaction=require(_0x34e6('0x3'));var config=require('../../config/environment');var controller=require(_0x34e6('0x4'));router[_0x34e6('0x5')]('/',auth[_0x34e6('0x6')](),controller[_0x34e6('0x7')]);router[_0x34e6('0x5')]('/:id',auth[_0x34e6('0x6')](),controller[_0x34e6('0x8')]);router[_0x34e6('0x5')]('/:id/all_conditions',auth[_0x34e6('0x6')](),controller[_0x34e6('0x9')]);router['get'](_0x34e6('0xa'),auth['isAuthenticated'](),controller[_0x34e6('0xb')]);router[_0x34e6('0x5')](_0x34e6('0xc'),auth[_0x34e6('0x6')](),controller[_0x34e6('0xd')]);router[_0x34e6('0xe')]('/',auth[_0x34e6('0x6')](),controller[_0x34e6('0xf')]);router[_0x34e6('0xe')](_0x34e6('0x10'),auth[_0x34e6('0x6')](),controller['addAllCondition']);router[_0x34e6('0xe')](_0x34e6('0xa'),auth[_0x34e6('0x6')](),controller[_0x34e6('0x11')]);router[_0x34e6('0xe')](_0x34e6('0xc'),auth[_0x34e6('0x6')](),controller[_0x34e6('0x12')]);router['put']('/:id',auth[_0x34e6('0x6')](),controller[_0x34e6('0x13')]);router['delete'](_0x34e6('0x14'),auth[_0x34e6('0x6')](),controller[_0x34e6('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x2055=['../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','post','/:id/all_conditions','addAnyCondition','/:id/actions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1aaa36,_0x303ca3){var _0x52cbaa=function(_0x43a6ea){while(--_0x43a6ea){_0x1aaa36['push'](_0x1aaa36['shift']());}};_0x52cbaa(++_0x303ca3);}(_0x2055,0x157));var _0x5205=function(_0x28dd1a,_0x48ecb3){_0x28dd1a=_0x28dd1a-0x0;var _0x18d911=_0x2055[_0x28dd1a];return _0x18d911;};'use strict';var multer=require(_0x5205('0x0'));var util=require(_0x5205('0x1'));var path=require(_0x5205('0x2'));var timeout=require(_0x5205('0x3'));var express=require(_0x5205('0x4'));var router=express[_0x5205('0x5')]();var fs_extra=require(_0x5205('0x6'));var auth=require(_0x5205('0x7'));var interaction=require(_0x5205('0x8'));var config=require(_0x5205('0x9'));var controller=require(_0x5205('0xa'));router[_0x5205('0xb')]('/',auth[_0x5205('0xc')](),controller[_0x5205('0xd')]);router[_0x5205('0xb')](_0x5205('0xe'),auth['isAuthenticated'](),controller[_0x5205('0xf')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x5205('0x10')]);router[_0x5205('0xb')](_0x5205('0x11'),auth[_0x5205('0xc')](),controller[_0x5205('0x12')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x5205('0x13')]('/',auth[_0x5205('0xc')](),controller['create']);router[_0x5205('0x13')](_0x5205('0x14'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x5205('0x13')]('/:id/any_conditions',auth[_0x5205('0xc')](),controller[_0x5205('0x15')]);router[_0x5205('0x13')](_0x5205('0x16'),auth[_0x5205('0xc')](),controller['addAction']);router[_0x5205('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x5205('0x18')]);router['delete'](_0x5205('0xe'),auth[_0x5205('0xc')](),controller[_0x5205('0x19')]);module[_0x5205('0x1a')]=router;
\ No newline at end of file
index 8682e08..ba42859 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5a3=['sequelize','STRING','BOOLEAN'];(function(_0x340003,_0x1b1e53){var _0x3bb5a1=function(_0x1cbcb8){while(--_0x1cbcb8){_0x340003['push'](_0x340003['shift']());}};_0x3bb5a1(++_0x1b1e53);}(_0xb5a3,0x93));var _0x3b5a=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xb5a3[_0x2fbcf6];return _0x3e7265;};'use strict';var Sequelize=require(_0x3b5a('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b5a('0x1')]},'channel':{'type':Sequelize[_0x3b5a('0x1')]},'description':{'type':Sequelize[_0x3b5a('0x1')]},'status':{'type':Sequelize[_0x3b5a('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x439a=['STRING'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0x439a,0x175));var _0xa439=function(_0x9b243f,_0x3f5ece){_0x9b243f=_0x9b243f-0x0;var _0x2a3d3b=_0x439a[_0x9b243f];return _0x2a3d3b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa439('0x0')]},'channel':{'type':Sequelize[_0xa439('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 7fafca6..5e8a887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74d3=['jsforce','to-csv','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5e887e,_0x497575){var _0x50e156=function(_0x52b366){while(--_0x52b366){_0x5e887e['push'](_0x5e887e['shift']());}};_0x50e156(++_0x497575);}(_0x74d3,0x1c9));var _0x374d=function(_0x6ba53a,_0x29277a){_0x6ba53a=_0x6ba53a-0x0;var _0x2842ca=_0x74d3[_0x6ba53a];return _0x2842ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x374d('0x0'));var zipdir=require(_0x374d('0x1'));var jsonpatch=require(_0x374d('0x2'));var rp=require(_0x374d('0x3'));var moment=require(_0x374d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x374d('0x5'));var util=require('util');var path=require(_0x374d('0x6'));var sox=require(_0x374d('0x7'));var csv=require('to-csv');var ejs=require(_0x374d('0x8'));var fs=require('fs');var fs_extra=require(_0x374d('0x9'));var _=require(_0x374d('0xa'));var squel=require(_0x374d('0xb'));var crypto=require(_0x374d('0xc'));var jsforce=require(_0x374d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x374d('0xe'));var querystring=require(_0x374d('0xf'));var Papa=require('papaparse');var Redis=require(_0x374d('0x10'));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(_0x374d('0x11'))(_0x374d('0x12'));var utils=require(_0x374d('0x13'));var config=require(_0x374d('0x14'));var licenseUtil=require(_0x374d('0x15'));var db=require(_0x374d('0x16'))['db'];function respondWithStatusCode(_0x28f39c,_0x5dce7a){_0x5dce7a=_0x5dce7a||0xcc;return function(_0x6ddb53){if(_0x6ddb53){return _0x28f39c[_0x374d('0x17')](_0x5dce7a);}return _0x28f39c[_0x374d('0x18')](_0x5dce7a)[_0x374d('0x19')]();};}function respondWithResult(_0x1ba184,_0x5c24ca){_0x5c24ca=_0x5c24ca||0xc8;return function(_0x5cb647){if(_0x5cb647){return _0x1ba184[_0x374d('0x18')](_0x5c24ca)[_0x374d('0x1a')](_0x5cb647);}};}function respondWithFilteredResult(_0x4f34be,_0x3c6cb2){return function(_0x13c914){if(_0x13c914){var _0x169a18=typeof _0x3c6cb2[_0x374d('0x1b')]===_0x374d('0x1c')&&typeof _0x3c6cb2['limit']===_0x374d('0x1c');var _0x5ebc6c=_0x13c914[_0x374d('0x1d')];var _0x941fd6=_0x169a18?0x0:_0x3c6cb2[_0x374d('0x1b')];var _0x5073b2=_0x169a18?_0x13c914[_0x374d('0x1d')]:_0x3c6cb2['offset']+_0x3c6cb2[_0x374d('0x1e')];var _0x3a1c6f;if(_0x5073b2>=_0x5ebc6c){_0x5073b2=_0x5ebc6c;_0x3a1c6f=0xc8;}else{_0x3a1c6f=0xce;}_0x4f34be['status'](_0x3a1c6f);return _0x4f34be[_0x374d('0x1f')](_0x374d('0x20'),_0x941fd6+'-'+_0x5073b2+'/'+_0x5ebc6c)[_0x374d('0x1a')](_0x13c914);}return null;};}function patchUpdates(_0x1ac3e7){return function(_0x5b4ef0){try{jsonpatch[_0x374d('0x21')](_0x5b4ef0,_0x1ac3e7,!![]);}catch(_0x379f48){return BPromise[_0x374d('0x22')](_0x379f48);}return _0x5b4ef0[_0x374d('0x23')]();};}function saveUpdates(_0x4726a5,_0x328eaf){return function(_0x2aa68d){if(_0x2aa68d){return _0x2aa68d['update'](_0x4726a5)['then'](function(_0x416d68){return _0x416d68;});}return null;};}function removeEntity(_0x46c274,_0x4a3c14){return function(_0x142dbc){if(_0x142dbc){return _0x142dbc[_0x374d('0x24')]()['then'](function(){var _0x57cf8b=_0x142dbc[_0x374d('0x25')]({'plain':!![]});var _0x33ebd2=_0x374d('0x26');return db[_0x374d('0x27')][_0x374d('0x24')]({'where':{'type':_0x33ebd2,'resourceId':_0x57cf8b['id']}})['then'](function(){return _0x142dbc;});})['then'](function(){_0x46c274[_0x374d('0x18')](0xcc)[_0x374d('0x19')]();});}};}function handleEntityNotFound(_0x21d71e,_0x38564e){return function(_0x3de6d5){if(!_0x3de6d5){_0x21d71e[_0x374d('0x17')](0x194);}return _0x3de6d5;};}function handleError(_0x43ab1f,_0x5e6e4f){_0x5e6e4f=_0x5e6e4f||0x1f4;return function(_0x4c1207){logger['error'](_0x4c1207[_0x374d('0x28')]);if(_0x4c1207[_0x374d('0x29')]){delete _0x4c1207[_0x374d('0x29')];}_0x43ab1f[_0x374d('0x18')](_0x5e6e4f)[_0x374d('0x2a')](_0x4c1207);};}exports[_0x374d('0x2b')]=function(_0x2df441,_0x246378){var _0x29e2ea={},_0x340328={},_0x919afd={'count':0x0,'rows':[]};var _0x4c89da=_[_0x374d('0x2c')](db[_0x374d('0x2d')][_0x374d('0x2e')],function(_0x9cb4ee){return{'name':_0x9cb4ee['fieldName'],'type':_0x9cb4ee[_0x374d('0x2f')][_0x374d('0x30')]};});_0x340328[_0x374d('0x31')]=_[_0x374d('0x2c')](_0x4c89da,_0x374d('0x29'));_0x340328[_0x374d('0x32')]=_['keys'](_0x2df441[_0x374d('0x32')]);_0x340328[_0x374d('0x33')]=_[_0x374d('0x34')](_0x340328[_0x374d('0x31')],_0x340328[_0x374d('0x32')]);_0x29e2ea[_0x374d('0x35')]=_[_0x374d('0x34')](_0x340328[_0x374d('0x31')],qs[_0x374d('0x36')](_0x2df441[_0x374d('0x32')]['fields']));_0x29e2ea[_0x374d('0x35')]=_0x29e2ea[_0x374d('0x35')][_0x374d('0x37')]?_0x29e2ea[_0x374d('0x35')]:_0x340328['model'];if(!_0x2df441[_0x374d('0x32')][_0x374d('0x38')](_0x374d('0x39'))){_0x29e2ea[_0x374d('0x1e')]=qs[_0x374d('0x1e')](_0x2df441[_0x374d('0x32')]['limit']);_0x29e2ea[_0x374d('0x1b')]=qs['offset'](_0x2df441[_0x374d('0x32')]['offset']);}_0x29e2ea['order']=qs[_0x374d('0x3a')](_0x2df441[_0x374d('0x32')]['sort']);_0x29e2ea['where']=qs[_0x374d('0x33')](_[_0x374d('0x3b')](_0x2df441['query'],_0x340328['filters']),_0x4c89da);if(_0x2df441['query']['filter']){_0x29e2ea['where']=_[_0x374d('0x3c')](_0x29e2ea[_0x374d('0x3d')],{'$or':_[_0x374d('0x2c')](_0x4c89da,function(_0x2aa5a1){if(_0x2aa5a1['type']!==_0x374d('0x3e')){var _0x677a45={};_0x677a45[_0x2aa5a1[_0x374d('0x29')]]={'$like':'%'+_0x2df441[_0x374d('0x32')][_0x374d('0x3f')]+'%'};return _0x677a45;}})});}_0x29e2ea=_[_0x374d('0x3c')]({},_0x29e2ea,_0x2df441[_0x374d('0x40')]);var _0xdd4620={'where':_0x29e2ea[_0x374d('0x3d')]};return db['Trigger'][_0x374d('0x1d')](_0xdd4620)[_0x374d('0x41')](function(_0x1ca9ca){_0x919afd[_0x374d('0x1d')]=_0x1ca9ca;if(_0x2df441[_0x374d('0x32')][_0x374d('0x42')]){_0x29e2ea[_0x374d('0x43')]=[{'all':!![]}];}return db[_0x374d('0x2d')]['findAll'](_0x29e2ea);})[_0x374d('0x41')](function(_0x2f85fe){_0x919afd[_0x374d('0x44')]=_0x2f85fe;return _0x919afd;})[_0x374d('0x41')](respondWithFilteredResult(_0x246378,_0x29e2ea))[_0x374d('0x45')](handleError(_0x246378,null));};exports[_0x374d('0x46')]=function(_0x46190f,_0x390767){var _0x11e9da={'raw':![],'where':{'id':_0x46190f[_0x374d('0x47')]['id']}},_0x3c6851={};_0x3c6851[_0x374d('0x31')]=_[_0x374d('0x48')](db[_0x374d('0x2d')][_0x374d('0x2e')]);_0x3c6851[_0x374d('0x32')]=_[_0x374d('0x48')](_0x46190f[_0x374d('0x32')]);_0x3c6851[_0x374d('0x33')]=_[_0x374d('0x34')](_0x3c6851[_0x374d('0x31')],_0x3c6851[_0x374d('0x32')]);_0x11e9da[_0x374d('0x35')]=_[_0x374d('0x34')](_0x3c6851[_0x374d('0x31')],qs[_0x374d('0x36')](_0x46190f[_0x374d('0x32')][_0x374d('0x36')]));_0x11e9da[_0x374d('0x35')]=_0x11e9da[_0x374d('0x35')][_0x374d('0x37')]?_0x11e9da['attributes']:_0x3c6851['model'];if(_0x46190f[_0x374d('0x32')][_0x374d('0x42')]){_0x11e9da[_0x374d('0x43')]=[{'all':!![]}];}_0x11e9da=_[_0x374d('0x3c')]({},_0x11e9da,_0x46190f['options']);return db[_0x374d('0x2d')][_0x374d('0x49')](_0x11e9da)[_0x374d('0x41')](handleEntityNotFound(_0x390767,null))[_0x374d('0x41')](respondWithResult(_0x390767,null))['catch'](handleError(_0x390767,null));};exports[_0x374d('0x4a')]=function(_0x2c72e5,_0x350313){return db['Trigger'][_0x374d('0x4a')](_0x2c72e5[_0x374d('0x4b')],{})[_0x374d('0x41')](function(_0x1bd187){var _0x1d5113=_0x2c72e5[_0x374d('0x4c')]['get']({'plain':!![]});if(!_0x1d5113)throw new Error(_0x374d('0x4d'));if(_0x1d5113[_0x374d('0x4e')]===_0x374d('0x4c')){var _0x659941=_0x1bd187[_0x374d('0x25')]({'plain':!![]});var _0x5a5bcc=_0x374d('0x26');return db[_0x374d('0x4f')]['find']({'where':{'name':_0x5a5bcc,'userProfileId':_0x1d5113['userProfileId']},'raw':!![]})[_0x374d('0x41')](function(_0x52cd84){if(_0x52cd84&&_0x52cd84[_0x374d('0x50')]===0x0){return db['UserProfileResource'][_0x374d('0x4a')]({'name':_0x659941[_0x374d('0x29')],'resourceId':_0x659941['id'],'type':_0x52cd84[_0x374d('0x29')],'sectionId':_0x52cd84['id']},{})['then'](function(){return _0x1bd187;});}else{return _0x1bd187;}})[_0x374d('0x45')](function(_0x3769a9){logger[_0x374d('0x51')](_0x374d('0x52'),_0x3769a9);throw _0x3769a9;});}return _0x1bd187;})['then'](respondWithResult(_0x350313,0xc9))[_0x374d('0x45')](handleError(_0x350313,null));};exports['update']=function(_0x40a714,_0x497b49){if(_0x40a714[_0x374d('0x4b')]['id']){delete _0x40a714[_0x374d('0x4b')]['id'];}return db[_0x374d('0x2d')][_0x374d('0x49')]({'where':{'id':_0x40a714[_0x374d('0x47')]['id']}})[_0x374d('0x41')](handleEntityNotFound(_0x497b49,null))[_0x374d('0x41')](saveUpdates(_0x40a714[_0x374d('0x4b')],null))['then'](respondWithResult(_0x497b49,null))[_0x374d('0x45')](handleError(_0x497b49,null));};exports[_0x374d('0x24')]=function(_0x2b5c5c,_0x52e543){return db[_0x374d('0x2d')][_0x374d('0x49')]({'where':{'id':_0x2b5c5c[_0x374d('0x47')]['id']}})['then'](handleEntityNotFound(_0x52e543,null))['then'](removeEntity(_0x52e543,null))[_0x374d('0x45')](handleError(_0x52e543,null));};exports[_0x374d('0x53')]=function(_0x324c8a,_0x4e3dfe,_0x1234c6){if(_0x324c8a[_0x374d('0x4b')]['id']){delete _0x324c8a['body']['id'];}return db[_0x374d('0x2d')]['find']({'where':{'id':_0x324c8a[_0x374d('0x47')]['id']}})[_0x374d('0x41')](handleEntityNotFound(_0x4e3dfe,null))[_0x374d('0x41')](function(_0x395b3d){if(_0x395b3d){_0x324c8a[_0x374d('0x4b')][_0x374d('0x54')]=_0x395b3d['id'];return db[_0x374d('0x55')][_0x374d('0x4a')](_0x324c8a[_0x374d('0x4b')]);}})[_0x374d('0x41')](respondWithResult(_0x4e3dfe,null))[_0x374d('0x45')](handleError(_0x4e3dfe,null));};exports[_0x374d('0x56')]=function(_0xa84f31,_0xc30b42,_0x179033){if(_0xa84f31[_0x374d('0x4b')]['id']){delete _0xa84f31['body']['id'];}return db[_0x374d('0x2d')][_0x374d('0x49')]({'where':{'id':_0xa84f31['params']['id']}})[_0x374d('0x41')](handleEntityNotFound(_0xc30b42,null))[_0x374d('0x41')](function(_0x59306e){if(_0x59306e){_0xa84f31[_0x374d('0x4b')]['TriggerAnyId']=_0x59306e['id'];return db[_0x374d('0x55')]['create'](_0xa84f31[_0x374d('0x4b')]);}})['then'](respondWithResult(_0xc30b42,null))[_0x374d('0x45')](handleError(_0xc30b42,null));};exports[_0x374d('0x57')]=function(_0x33fcfc,_0x3a5e6d,_0x4f28fd){var _0x2bf177={};var _0x2e911c={};var _0x5efc79;var _0x2ea9db;return db[_0x374d('0x2d')]['findOne']({'where':{'id':_0x33fcfc['params']['id']}})[_0x374d('0x41')](handleEntityNotFound(_0x3a5e6d,null))[_0x374d('0x41')](function(_0x56db9a){if(_0x56db9a){_0x5efc79=_0x56db9a;_0x2e911c[_0x374d('0x31')]=_['keys'](db[_0x374d('0x55')][_0x374d('0x2e')]);_0x2e911c['query']=_['keys'](_0x33fcfc[_0x374d('0x32')]);_0x2e911c['filters']=_['intersection'](_0x2e911c['model'],_0x2e911c[_0x374d('0x32')]);_0x2bf177[_0x374d('0x35')]=_[_0x374d('0x34')](_0x2e911c['model'],qs[_0x374d('0x36')](_0x33fcfc[_0x374d('0x32')][_0x374d('0x36')]));_0x2bf177[_0x374d('0x35')]=_0x2bf177[_0x374d('0x35')]['length']?_0x2bf177[_0x374d('0x35')]:_0x2e911c[_0x374d('0x31')];_0x2bf177['order']=qs[_0x374d('0x3a')](_0x33fcfc[_0x374d('0x32')][_0x374d('0x3a')]);_0x2bf177['where']=qs[_0x374d('0x33')](_[_0x374d('0x3b')](_0x33fcfc[_0x374d('0x32')],_0x2e911c[_0x374d('0x33')]));if(_0x33fcfc['query'][_0x374d('0x3f')]){_0x2bf177['where']=_[_0x374d('0x3c')](_0x2bf177[_0x374d('0x3d')],{'$or':_['map'](_0x2bf177['attributes'],function(_0x83f3b1){var _0x2bccbc={};_0x2bccbc[_0x83f3b1]={'$like':'%'+_0x33fcfc[_0x374d('0x32')]['filter']+'%'};return _0x2bccbc;})});}_0x2bf177=_[_0x374d('0x3c')]({},_0x2bf177,_0x33fcfc[_0x374d('0x40')]);return _0x5efc79['getAllConditions'](_0x2bf177);}})[_0x374d('0x41')](function(_0x407245){if(_0x407245){_0x2ea9db=_0x407245[_0x374d('0x37')];if(!_0x33fcfc[_0x374d('0x32')][_0x374d('0x38')](_0x374d('0x39'))){_0x2bf177[_0x374d('0x1e')]=qs['limit'](_0x33fcfc[_0x374d('0x32')][_0x374d('0x1e')]);_0x2bf177[_0x374d('0x1b')]=qs[_0x374d('0x1b')](_0x33fcfc[_0x374d('0x32')][_0x374d('0x1b')]);}return _0x5efc79[_0x374d('0x57')](_0x2bf177);}})[_0x374d('0x41')](function(_0x21fc50){if(_0x21fc50){return _0x21fc50?{'count':_0x2ea9db,'rows':_0x21fc50}:null;}})[_0x374d('0x41')](respondWithResult(_0x3a5e6d,null))[_0x374d('0x45')](handleError(_0x3a5e6d,null));};exports['getAnyConditions']=function(_0x4311c3,_0x5699aa,_0x5b84f0){var _0x4838e2={};var _0x93b13b={};var _0x33027d;var _0x5f5915;return db[_0x374d('0x2d')][_0x374d('0x58')]({'where':{'id':_0x4311c3[_0x374d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5699aa,null))[_0x374d('0x41')](function(_0x407b3a){if(_0x407b3a){_0x33027d=_0x407b3a;_0x93b13b[_0x374d('0x31')]=_['keys'](db[_0x374d('0x55')]['rawAttributes']);_0x93b13b[_0x374d('0x32')]=_[_0x374d('0x48')](_0x4311c3[_0x374d('0x32')]);_0x93b13b['filters']=_['intersection'](_0x93b13b[_0x374d('0x31')],_0x93b13b['query']);_0x4838e2[_0x374d('0x35')]=_[_0x374d('0x34')](_0x93b13b[_0x374d('0x31')],qs[_0x374d('0x36')](_0x4311c3['query'][_0x374d('0x36')]));_0x4838e2[_0x374d('0x35')]=_0x4838e2[_0x374d('0x35')][_0x374d('0x37')]?_0x4838e2[_0x374d('0x35')]:_0x93b13b[_0x374d('0x31')];_0x4838e2['order']=qs[_0x374d('0x3a')](_0x4311c3['query']['sort']);_0x4838e2[_0x374d('0x3d')]=qs[_0x374d('0x33')](_[_0x374d('0x3b')](_0x4311c3[_0x374d('0x32')],_0x93b13b[_0x374d('0x33')]));if(_0x4311c3[_0x374d('0x32')][_0x374d('0x3f')]){_0x4838e2[_0x374d('0x3d')]=_[_0x374d('0x3c')](_0x4838e2[_0x374d('0x3d')],{'$or':_[_0x374d('0x2c')](_0x4838e2[_0x374d('0x35')],function(_0x31f7d4){var _0x368306={};_0x368306[_0x31f7d4]={'$like':'%'+_0x4311c3[_0x374d('0x32')][_0x374d('0x3f')]+'%'};return _0x368306;})});}_0x4838e2=_['merge']({},_0x4838e2,_0x4311c3[_0x374d('0x40')]);return _0x33027d[_0x374d('0x59')](_0x4838e2);}})[_0x374d('0x41')](function(_0x208401){if(_0x208401){_0x5f5915=_0x208401['length'];if(!_0x4311c3[_0x374d('0x32')][_0x374d('0x38')]('nolimit')){_0x4838e2[_0x374d('0x1e')]=qs['limit'](_0x4311c3[_0x374d('0x32')]['limit']);_0x4838e2['offset']=qs['offset'](_0x4311c3[_0x374d('0x32')][_0x374d('0x1b')]);}return _0x33027d['getAnyConditions'](_0x4838e2);}})[_0x374d('0x41')](function(_0x224356){if(_0x224356){return _0x224356?{'count':_0x5f5915,'rows':_0x224356}:null;}})['then'](respondWithResult(_0x5699aa,null))[_0x374d('0x45')](handleError(_0x5699aa,null));};exports[_0x374d('0x5a')]=function(_0x3c366e,_0x3d80e0,_0x4e6c43){if(_0x3c366e[_0x374d('0x4b')]['id']){delete _0x3c366e[_0x374d('0x4b')]['id'];}return db[_0x374d('0x2d')][_0x374d('0x49')]({'where':{'id':_0x3c366e[_0x374d('0x47')]['id']}})[_0x374d('0x41')](handleEntityNotFound(_0x3d80e0,null))[_0x374d('0x41')](function(_0x8ad08e){if(_0x8ad08e){_0x3c366e[_0x374d('0x4b')][_0x374d('0x5b')]=_0x8ad08e['id'];return db[_0x374d('0x5c')][_0x374d('0x4a')](_0x3c366e[_0x374d('0x4b')]);}})['then'](respondWithResult(_0x3d80e0,null))[_0x374d('0x45')](handleError(_0x3d80e0,null));};exports['getActions']=function(_0x3928f1,_0x421e45,_0x5be9b9){var _0x41c583={};var _0x23dbb7={};var _0x1f11a8;var _0x41a5ca;return db[_0x374d('0x2d')]['findOne']({'where':{'id':_0x3928f1['params']['id']}})[_0x374d('0x41')](handleEntityNotFound(_0x421e45,null))[_0x374d('0x41')](function(_0x4dbef0){if(_0x4dbef0){_0x1f11a8=_0x4dbef0;_0x23dbb7[_0x374d('0x31')]=_[_0x374d('0x48')](db[_0x374d('0x5c')]['rawAttributes']);_0x23dbb7[_0x374d('0x32')]=_['keys'](_0x3928f1[_0x374d('0x32')]);_0x23dbb7[_0x374d('0x33')]=_[_0x374d('0x34')](_0x23dbb7[_0x374d('0x31')],_0x23dbb7[_0x374d('0x32')]);_0x41c583[_0x374d('0x35')]=_[_0x374d('0x34')](_0x23dbb7[_0x374d('0x31')],qs[_0x374d('0x36')](_0x3928f1[_0x374d('0x32')][_0x374d('0x36')]));_0x41c583['attributes']=_0x41c583[_0x374d('0x35')][_0x374d('0x37')]?_0x41c583[_0x374d('0x35')]:_0x23dbb7[_0x374d('0x31')];_0x41c583['order']=qs['sort'](_0x3928f1[_0x374d('0x32')][_0x374d('0x3a')]);_0x41c583[_0x374d('0x3d')]=qs[_0x374d('0x33')](_[_0x374d('0x3b')](_0x3928f1['query'],_0x23dbb7['filters']));if(_0x3928f1[_0x374d('0x32')][_0x374d('0x3f')]){_0x41c583[_0x374d('0x3d')]=_[_0x374d('0x3c')](_0x41c583[_0x374d('0x3d')],{'$or':_[_0x374d('0x2c')](_0x41c583[_0x374d('0x35')],function(_0x41dab2){var _0x2530bf={};_0x2530bf[_0x41dab2]={'$like':'%'+_0x3928f1[_0x374d('0x32')][_0x374d('0x3f')]+'%'};return _0x2530bf;})});}_0x41c583=_[_0x374d('0x3c')]({},_0x41c583,_0x3928f1[_0x374d('0x40')]);return _0x1f11a8[_0x374d('0x5d')](_0x41c583);}})[_0x374d('0x41')](function(_0x303ba1){if(_0x303ba1){_0x41a5ca=_0x303ba1[_0x374d('0x37')];if(!_0x3928f1['query'][_0x374d('0x38')](_0x374d('0x39'))){_0x41c583[_0x374d('0x1e')]=qs[_0x374d('0x1e')](_0x3928f1[_0x374d('0x32')][_0x374d('0x1e')]);_0x41c583[_0x374d('0x1b')]=qs[_0x374d('0x1b')](_0x3928f1[_0x374d('0x32')]['offset']);}return _0x1f11a8[_0x374d('0x5d')](_0x41c583);}})[_0x374d('0x41')](function(_0x243c62){if(_0x243c62){return _0x243c62?{'count':_0x41a5ca,'rows':_0x243c62}:null;}})[_0x374d('0x41')](respondWithResult(_0x421e45,null))[_0x374d('0x45')](handleError(_0x421e45,null));};
\ No newline at end of file
+var _0x56d5=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','map','Trigger','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','findOne','hasOwnProperty','getAllConditions','order','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format'];(function(_0x5cca93,_0x4d83a7){var _0x81fc31=function(_0x3284be){while(--_0x3284be){_0x5cca93['push'](_0x5cca93['shift']());}};_0x81fc31(++_0x4d83a7);}(_0x56d5,0x1d0));var _0x556d=function(_0x2928d6,_0x468246){_0x2928d6=_0x2928d6-0x0;var _0x45c26d=_0x56d5[_0x2928d6];return _0x45c26d;};'use strict';var emlformat=require(_0x556d('0x0'));var rimraf=require(_0x556d('0x1'));var zipdir=require(_0x556d('0x2'));var jsonpatch=require(_0x556d('0x3'));var rp=require(_0x556d('0x4'));var moment=require(_0x556d('0x5'));var BPromise=require(_0x556d('0x6'));var Mustache=require('mustache');var util=require(_0x556d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x556d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x556d('0x9'));var _=require('lodash');var squel=require(_0x556d('0xa'));var crypto=require(_0x556d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x556d('0x8'));var querystring=require(_0x556d('0xc'));var Papa=require(_0x556d('0xd'));var Redis=require(_0x556d('0xe'));var authService=require(_0x556d('0xf'));var qs=require(_0x556d('0x10'));var as=require(_0x556d('0x11'));var hardwareService=require(_0x556d('0x12'));var logger=require(_0x556d('0x13'))('api');var utils=require(_0x556d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x556d('0x15'));var db=require(_0x556d('0x16'))['db'];function respondWithStatusCode(_0x1ec2e7,_0x3d13ef){_0x3d13ef=_0x3d13ef||0xcc;return function(_0x2f593f){if(_0x2f593f){return _0x1ec2e7['sendStatus'](_0x3d13ef);}return _0x1ec2e7[_0x556d('0x17')](_0x3d13ef)[_0x556d('0x18')]();};}function respondWithResult(_0x3a4688,_0x183d17){_0x183d17=_0x183d17||0xc8;return function(_0x1be38d){if(_0x1be38d){return _0x3a4688[_0x556d('0x17')](_0x183d17)['json'](_0x1be38d);}};}function respondWithFilteredResult(_0x879fc9,_0x3e5f18){return function(_0x15b83e){if(_0x15b83e){var _0x5365fb=typeof _0x3e5f18['offset']===_0x556d('0x19')&&typeof _0x3e5f18['limit']===_0x556d('0x19');var _0x2ed24=_0x15b83e[_0x556d('0x1a')];var _0x14eafc=_0x5365fb?0x0:_0x3e5f18[_0x556d('0x1b')];var _0x1e5df4=_0x5365fb?_0x15b83e['count']:_0x3e5f18[_0x556d('0x1b')]+_0x3e5f18[_0x556d('0x1c')];var _0x3c2ac2;if(_0x1e5df4>=_0x2ed24){_0x1e5df4=_0x2ed24;_0x3c2ac2=0xc8;}else{_0x3c2ac2=0xce;}_0x879fc9[_0x556d('0x17')](_0x3c2ac2);return _0x879fc9[_0x556d('0x1d')](_0x556d('0x1e'),_0x14eafc+'-'+_0x1e5df4+'/'+_0x2ed24)[_0x556d('0x1f')](_0x15b83e);}return null;};}function patchUpdates(_0x4f69f5){return function(_0x3a3c0a){try{jsonpatch[_0x556d('0x20')](_0x3a3c0a,_0x4f69f5,!![]);}catch(_0x4590fb){return BPromise[_0x556d('0x21')](_0x4590fb);}return _0x3a3c0a[_0x556d('0x22')]();};}function saveUpdates(_0x4d51e7,_0x2c93d1){return function(_0x53d7d5){if(_0x53d7d5){return _0x53d7d5[_0x556d('0x23')](_0x4d51e7)[_0x556d('0x24')](function(_0x2605c8){return _0x2605c8;});}return null;};}function removeEntity(_0x348b80,_0x11a490){return function(_0x4f3a1b){if(_0x4f3a1b){return _0x4f3a1b[_0x556d('0x25')]()[_0x556d('0x24')](function(){var _0x26c674=_0x4f3a1b[_0x556d('0x26')]({'plain':!![]});var _0x3e866b='Triggers';return db[_0x556d('0x27')][_0x556d('0x25')]({'where':{'type':_0x3e866b,'resourceId':_0x26c674['id']}})[_0x556d('0x24')](function(){return _0x4f3a1b;});})[_0x556d('0x24')](function(){_0x348b80[_0x556d('0x17')](0xcc)[_0x556d('0x18')]();});}};}function handleEntityNotFound(_0x42332f,_0x540f3f){return function(_0x14ddc5){if(!_0x14ddc5){_0x42332f[_0x556d('0x28')](0x194);}return _0x14ddc5;};}function handleError(_0x94f85a,_0x532d06){_0x532d06=_0x532d06||0x1f4;return function(_0x39bdaa){logger[_0x556d('0x29')](_0x39bdaa['stack']);if(_0x39bdaa[_0x556d('0x2a')]){delete _0x39bdaa[_0x556d('0x2a')];}_0x94f85a[_0x556d('0x17')](_0x532d06)['send'](_0x39bdaa);};}exports[_0x556d('0x2b')]=function(_0x2c9475,_0x57580a){var _0xa83fb0={},_0x33681c={},_0x4160f6={'count':0x0,'rows':[]};var _0x27ee06=_[_0x556d('0x2c')](db[_0x556d('0x2d')]['rawAttributes'],function(_0x225607){return{'name':_0x225607[_0x556d('0x2e')],'type':_0x225607[_0x556d('0x2f')][_0x556d('0x30')]};});_0x33681c[_0x556d('0x31')]=_['map'](_0x27ee06,'name');_0x33681c[_0x556d('0x32')]=_['keys'](_0x2c9475[_0x556d('0x32')]);_0x33681c[_0x556d('0x33')]=_[_0x556d('0x34')](_0x33681c['model'],_0x33681c[_0x556d('0x32')]);_0xa83fb0[_0x556d('0x35')]=_[_0x556d('0x34')](_0x33681c['model'],qs[_0x556d('0x36')](_0x2c9475[_0x556d('0x32')][_0x556d('0x36')]));_0xa83fb0[_0x556d('0x35')]=_0xa83fb0['attributes']['length']?_0xa83fb0[_0x556d('0x35')]:_0x33681c[_0x556d('0x31')];if(!_0x2c9475['query']['hasOwnProperty'](_0x556d('0x37'))){_0xa83fb0[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x2c9475[_0x556d('0x32')][_0x556d('0x1c')]);_0xa83fb0[_0x556d('0x1b')]=qs[_0x556d('0x1b')](_0x2c9475[_0x556d('0x32')][_0x556d('0x1b')]);}_0xa83fb0['order']=qs[_0x556d('0x38')](_0x2c9475[_0x556d('0x32')][_0x556d('0x38')]);_0xa83fb0[_0x556d('0x39')]=qs[_0x556d('0x33')](_[_0x556d('0x3a')](_0x2c9475[_0x556d('0x32')],_0x33681c[_0x556d('0x33')]),_0x27ee06);if(_0x2c9475[_0x556d('0x32')][_0x556d('0x3b')]){_0xa83fb0[_0x556d('0x39')]=_[_0x556d('0x3c')](_0xa83fb0['where'],{'$or':_[_0x556d('0x2c')](_0x27ee06,function(_0x296665){if(_0x296665[_0x556d('0x2f')]!==_0x556d('0x3d')){var _0x4392de={};_0x4392de[_0x296665[_0x556d('0x2a')]]={'$like':'%'+_0x2c9475['query'][_0x556d('0x3b')]+'%'};return _0x4392de;}})});}_0xa83fb0=_['merge']({},_0xa83fb0,_0x2c9475[_0x556d('0x3e')]);var _0x201db9={'where':_0xa83fb0[_0x556d('0x39')]};return db[_0x556d('0x2d')][_0x556d('0x1a')](_0x201db9)[_0x556d('0x24')](function(_0x832c8a){_0x4160f6['count']=_0x832c8a;if(_0x2c9475[_0x556d('0x32')][_0x556d('0x3f')]){_0xa83fb0[_0x556d('0x40')]=[{'all':!![]}];}return db['Trigger'][_0x556d('0x41')](_0xa83fb0);})[_0x556d('0x24')](function(_0x2c40d9){_0x4160f6[_0x556d('0x42')]=_0x2c40d9;return _0x4160f6;})[_0x556d('0x24')](respondWithFilteredResult(_0x57580a,_0xa83fb0))[_0x556d('0x43')](handleError(_0x57580a,null));};exports['show']=function(_0x1337a8,_0x3de2be){var _0x23c4bb={'raw':![],'where':{'id':_0x1337a8[_0x556d('0x44')]['id']}},_0x92076a={};_0x92076a['model']=_[_0x556d('0x45')](db[_0x556d('0x2d')][_0x556d('0x46')]);_0x92076a[_0x556d('0x32')]=_['keys'](_0x1337a8[_0x556d('0x32')]);_0x92076a['filters']=_[_0x556d('0x34')](_0x92076a[_0x556d('0x31')],_0x92076a[_0x556d('0x32')]);_0x23c4bb['attributes']=_['intersection'](_0x92076a[_0x556d('0x31')],qs['fields'](_0x1337a8['query']['fields']));_0x23c4bb[_0x556d('0x35')]=_0x23c4bb['attributes'][_0x556d('0x47')]?_0x23c4bb[_0x556d('0x35')]:_0x92076a['model'];if(_0x1337a8[_0x556d('0x32')]['includeAll']){_0x23c4bb['include']=[{'all':!![]}];}_0x23c4bb=_['merge']({},_0x23c4bb,_0x1337a8['options']);return db['Trigger'][_0x556d('0x48')](_0x23c4bb)[_0x556d('0x24')](handleEntityNotFound(_0x3de2be,null))[_0x556d('0x24')](respondWithResult(_0x3de2be,null))[_0x556d('0x43')](handleError(_0x3de2be,null));};exports[_0x556d('0x49')]=function(_0x21af28,_0x47b060){return db[_0x556d('0x2d')][_0x556d('0x49')](_0x21af28[_0x556d('0x4a')],{})['then'](function(_0x22d161){var _0x47141d=_0x21af28[_0x556d('0x4b')][_0x556d('0x26')]({'plain':!![]});if(!_0x47141d)throw new Error(_0x556d('0x4c'));if(_0x47141d[_0x556d('0x4d')]===_0x556d('0x4b')){var _0x1209eb=_0x22d161[_0x556d('0x26')]({'plain':!![]});var _0x56157f='Triggers';return db[_0x556d('0x4e')][_0x556d('0x48')]({'where':{'name':_0x56157f,'userProfileId':_0x47141d[_0x556d('0x4f')]},'raw':!![]})[_0x556d('0x24')](function(_0x2115ff){if(_0x2115ff&&_0x2115ff[_0x556d('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1209eb[_0x556d('0x2a')],'resourceId':_0x1209eb['id'],'type':_0x2115ff[_0x556d('0x2a')],'sectionId':_0x2115ff['id']},{})[_0x556d('0x24')](function(){return _0x22d161;});}else{return _0x22d161;}})['catch'](function(_0xe103cf){logger[_0x556d('0x29')](_0x556d('0x51'),_0xe103cf);throw _0xe103cf;});}return _0x22d161;})[_0x556d('0x24')](respondWithResult(_0x47b060,0xc9))['catch'](handleError(_0x47b060,null));};exports['update']=function(_0x383a0c,_0x1a20ea){if(_0x383a0c['body']['id']){delete _0x383a0c[_0x556d('0x4a')]['id'];}return db[_0x556d('0x2d')]['find']({'where':{'id':_0x383a0c[_0x556d('0x44')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x1a20ea,null))[_0x556d('0x24')](saveUpdates(_0x383a0c[_0x556d('0x4a')],null))[_0x556d('0x24')](respondWithResult(_0x1a20ea,null))[_0x556d('0x43')](handleError(_0x1a20ea,null));};exports[_0x556d('0x25')]=function(_0x2c01ef,_0x1ac56c){return db[_0x556d('0x2d')][_0x556d('0x48')]({'where':{'id':_0x2c01ef[_0x556d('0x44')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x1ac56c,null))[_0x556d('0x24')](removeEntity(_0x1ac56c,null))['catch'](handleError(_0x1ac56c,null));};exports[_0x556d('0x52')]=function(_0x3a35db,_0x168564,_0x333196){if(_0x3a35db[_0x556d('0x4a')]['id']){delete _0x3a35db['body']['id'];}return db[_0x556d('0x2d')][_0x556d('0x48')]({'where':{'id':_0x3a35db[_0x556d('0x44')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x168564,null))['then'](function(_0x29e028){if(_0x29e028){_0x3a35db[_0x556d('0x4a')]['TriggerAllId']=_0x29e028['id'];return db[_0x556d('0x53')][_0x556d('0x49')](_0x3a35db[_0x556d('0x4a')]);}})[_0x556d('0x24')](respondWithResult(_0x168564,null))[_0x556d('0x43')](handleError(_0x168564,null));};exports['addAnyCondition']=function(_0x51ac03,_0x1feccb,_0x38ef8e){if(_0x51ac03['body']['id']){delete _0x51ac03[_0x556d('0x4a')]['id'];}return db[_0x556d('0x2d')][_0x556d('0x48')]({'where':{'id':_0x51ac03[_0x556d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1feccb,null))[_0x556d('0x24')](function(_0x3dc90a){if(_0x3dc90a){_0x51ac03['body']['TriggerAnyId']=_0x3dc90a['id'];return db[_0x556d('0x53')][_0x556d('0x49')](_0x51ac03[_0x556d('0x4a')]);}})['then'](respondWithResult(_0x1feccb,null))[_0x556d('0x43')](handleError(_0x1feccb,null));};exports['getAllConditions']=function(_0x4b0a5d,_0x34d386,_0x123141){var _0x27b72e={};var _0x40f111={};var _0x3b178c;var _0x243225;return db['Trigger'][_0x556d('0x54')]({'where':{'id':_0x4b0a5d['params']['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x34d386,null))['then'](function(_0xa81672){if(_0xa81672){_0x3b178c=_0xa81672;_0x40f111[_0x556d('0x31')]=_[_0x556d('0x45')](db[_0x556d('0x53')][_0x556d('0x46')]);_0x40f111[_0x556d('0x32')]=_['keys'](_0x4b0a5d[_0x556d('0x32')]);_0x40f111[_0x556d('0x33')]=_[_0x556d('0x34')](_0x40f111[_0x556d('0x31')],_0x40f111[_0x556d('0x32')]);_0x27b72e['attributes']=_[_0x556d('0x34')](_0x40f111[_0x556d('0x31')],qs[_0x556d('0x36')](_0x4b0a5d['query'][_0x556d('0x36')]));_0x27b72e[_0x556d('0x35')]=_0x27b72e[_0x556d('0x35')]['length']?_0x27b72e['attributes']:_0x40f111[_0x556d('0x31')];_0x27b72e['order']=qs['sort'](_0x4b0a5d[_0x556d('0x32')][_0x556d('0x38')]);_0x27b72e[_0x556d('0x39')]=qs[_0x556d('0x33')](_[_0x556d('0x3a')](_0x4b0a5d[_0x556d('0x32')],_0x40f111['filters']));if(_0x4b0a5d['query']['filter']){_0x27b72e[_0x556d('0x39')]=_[_0x556d('0x3c')](_0x27b72e['where'],{'$or':_['map'](_0x27b72e['attributes'],function(_0x4c1e9b){var _0x4811c6={};_0x4811c6[_0x4c1e9b]={'$like':'%'+_0x4b0a5d['query'][_0x556d('0x3b')]+'%'};return _0x4811c6;})});}_0x27b72e=_[_0x556d('0x3c')]({},_0x27b72e,_0x4b0a5d[_0x556d('0x3e')]);return _0x3b178c['getAllConditions'](_0x27b72e);}})[_0x556d('0x24')](function(_0x42514e){if(_0x42514e){_0x243225=_0x42514e[_0x556d('0x47')];if(!_0x4b0a5d['query'][_0x556d('0x55')](_0x556d('0x37'))){_0x27b72e[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x4b0a5d[_0x556d('0x32')][_0x556d('0x1c')]);_0x27b72e['offset']=qs['offset'](_0x4b0a5d[_0x556d('0x32')][_0x556d('0x1b')]);}return _0x3b178c[_0x556d('0x56')](_0x27b72e);}})['then'](function(_0x1d071d){if(_0x1d071d){return _0x1d071d?{'count':_0x243225,'rows':_0x1d071d}:null;}})[_0x556d('0x24')](respondWithResult(_0x34d386,null))[_0x556d('0x43')](handleError(_0x34d386,null));};exports['getAnyConditions']=function(_0x580593,_0x349222,_0x5cf877){var _0x5f3ea0={};var _0x24cd1d={};var _0x29a89a;var _0x5db5be;return db[_0x556d('0x2d')][_0x556d('0x54')]({'where':{'id':_0x580593['params']['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x349222,null))[_0x556d('0x24')](function(_0x34278d){if(_0x34278d){_0x29a89a=_0x34278d;_0x24cd1d['model']=_[_0x556d('0x45')](db[_0x556d('0x53')][_0x556d('0x46')]);_0x24cd1d[_0x556d('0x32')]=_[_0x556d('0x45')](_0x580593[_0x556d('0x32')]);_0x24cd1d['filters']=_[_0x556d('0x34')](_0x24cd1d[_0x556d('0x31')],_0x24cd1d[_0x556d('0x32')]);_0x5f3ea0[_0x556d('0x35')]=_[_0x556d('0x34')](_0x24cd1d[_0x556d('0x31')],qs[_0x556d('0x36')](_0x580593[_0x556d('0x32')][_0x556d('0x36')]));_0x5f3ea0['attributes']=_0x5f3ea0[_0x556d('0x35')][_0x556d('0x47')]?_0x5f3ea0['attributes']:_0x24cd1d[_0x556d('0x31')];_0x5f3ea0[_0x556d('0x57')]=qs[_0x556d('0x38')](_0x580593[_0x556d('0x32')][_0x556d('0x38')]);_0x5f3ea0[_0x556d('0x39')]=qs['filters'](_[_0x556d('0x3a')](_0x580593[_0x556d('0x32')],_0x24cd1d[_0x556d('0x33')]));if(_0x580593['query']['filter']){_0x5f3ea0[_0x556d('0x39')]=_['merge'](_0x5f3ea0[_0x556d('0x39')],{'$or':_[_0x556d('0x2c')](_0x5f3ea0['attributes'],function(_0x231316){var _0x3ff55b={};_0x3ff55b[_0x231316]={'$like':'%'+_0x580593[_0x556d('0x32')][_0x556d('0x3b')]+'%'};return _0x3ff55b;})});}_0x5f3ea0=_[_0x556d('0x3c')]({},_0x5f3ea0,_0x580593[_0x556d('0x3e')]);return _0x29a89a[_0x556d('0x58')](_0x5f3ea0);}})[_0x556d('0x24')](function(_0xd41f40){if(_0xd41f40){_0x5db5be=_0xd41f40[_0x556d('0x47')];if(!_0x580593[_0x556d('0x32')]['hasOwnProperty'](_0x556d('0x37'))){_0x5f3ea0[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x580593[_0x556d('0x32')][_0x556d('0x1c')]);_0x5f3ea0[_0x556d('0x1b')]=qs[_0x556d('0x1b')](_0x580593[_0x556d('0x32')][_0x556d('0x1b')]);}return _0x29a89a[_0x556d('0x58')](_0x5f3ea0);}})['then'](function(_0x31f39b){if(_0x31f39b){return _0x31f39b?{'count':_0x5db5be,'rows':_0x31f39b}:null;}})[_0x556d('0x24')](respondWithResult(_0x349222,null))[_0x556d('0x43')](handleError(_0x349222,null));};exports[_0x556d('0x59')]=function(_0x5a2ed7,_0x38a1da,_0x3e83bb){if(_0x5a2ed7[_0x556d('0x4a')]['id']){delete _0x5a2ed7[_0x556d('0x4a')]['id'];}return db[_0x556d('0x2d')]['find']({'where':{'id':_0x5a2ed7[_0x556d('0x44')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x38a1da,null))['then'](function(_0x515fbe){if(_0x515fbe){_0x5a2ed7[_0x556d('0x4a')][_0x556d('0x5a')]=_0x515fbe['id'];return db[_0x556d('0x5b')][_0x556d('0x49')](_0x5a2ed7[_0x556d('0x4a')]);}})['then'](respondWithResult(_0x38a1da,null))['catch'](handleError(_0x38a1da,null));};exports[_0x556d('0x5c')]=function(_0x3deb90,_0x17e5c5,_0x3e8ed8){var _0x2afeea={};var _0xcf5076={};var _0x790b9c;var _0x85bf30;return db[_0x556d('0x2d')][_0x556d('0x54')]({'where':{'id':_0x3deb90[_0x556d('0x44')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x17e5c5,null))[_0x556d('0x24')](function(_0x67e172){if(_0x67e172){_0x790b9c=_0x67e172;_0xcf5076[_0x556d('0x31')]=_[_0x556d('0x45')](db['Action'][_0x556d('0x46')]);_0xcf5076[_0x556d('0x32')]=_[_0x556d('0x45')](_0x3deb90['query']);_0xcf5076[_0x556d('0x33')]=_[_0x556d('0x34')](_0xcf5076[_0x556d('0x31')],_0xcf5076['query']);_0x2afeea['attributes']=_[_0x556d('0x34')](_0xcf5076[_0x556d('0x31')],qs[_0x556d('0x36')](_0x3deb90[_0x556d('0x32')][_0x556d('0x36')]));_0x2afeea[_0x556d('0x35')]=_0x2afeea[_0x556d('0x35')][_0x556d('0x47')]?_0x2afeea[_0x556d('0x35')]:_0xcf5076[_0x556d('0x31')];_0x2afeea[_0x556d('0x57')]=qs[_0x556d('0x38')](_0x3deb90[_0x556d('0x32')][_0x556d('0x38')]);_0x2afeea['where']=qs[_0x556d('0x33')](_[_0x556d('0x3a')](_0x3deb90[_0x556d('0x32')],_0xcf5076[_0x556d('0x33')]));if(_0x3deb90[_0x556d('0x32')]['filter']){_0x2afeea[_0x556d('0x39')]=_[_0x556d('0x3c')](_0x2afeea[_0x556d('0x39')],{'$or':_[_0x556d('0x2c')](_0x2afeea[_0x556d('0x35')],function(_0x1aa503){var _0x525003={};_0x525003[_0x1aa503]={'$like':'%'+_0x3deb90[_0x556d('0x32')]['filter']+'%'};return _0x525003;})});}_0x2afeea=_[_0x556d('0x3c')]({},_0x2afeea,_0x3deb90[_0x556d('0x3e')]);return _0x790b9c[_0x556d('0x5c')](_0x2afeea);}})[_0x556d('0x24')](function(_0xddb1c4){if(_0xddb1c4){_0x85bf30=_0xddb1c4[_0x556d('0x47')];if(!_0x3deb90[_0x556d('0x32')][_0x556d('0x55')](_0x556d('0x37'))){_0x2afeea[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x3deb90[_0x556d('0x32')][_0x556d('0x1c')]);_0x2afeea[_0x556d('0x1b')]=qs[_0x556d('0x1b')](_0x3deb90[_0x556d('0x32')]['offset']);}return _0x790b9c[_0x556d('0x5c')](_0x2afeea);}})[_0x556d('0x24')](function(_0x3aa952){if(_0x3aa952){return _0x3aa952?{'count':_0x85bf30,'rows':_0x3aa952}:null;}})[_0x556d('0x24')](respondWithResult(_0x17e5c5,null))[_0x556d('0x43')](handleError(_0x17e5c5,null));};
\ No newline at end of file
index 17d99d2..216fad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe105=['bluebird','request-promise','path','rimraf','./trigger.attributes','exports','tools_triggers','lodash'];(function(_0x393696,_0x4a7b5f){var _0xb6bb31=function(_0x44d6df){while(--_0x44d6df){_0x393696['push'](_0x393696['shift']());}};_0xb6bb31(++_0x4a7b5f);}(_0xe105,0xef));var _0x5e10=function(_0x55875e,_0x1c4911){_0x55875e=_0x55875e-0x0;var _0x3da814=_0xe105[_0x55875e];return _0x3da814;};'use strict';var _=require(_0x5e10('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5e10('0x1'));var rp=require(_0x5e10('0x2'));var fs=require('fs');var path=require(_0x5e10('0x3'));var rimraf=require(_0x5e10('0x4'));var config=require('../../config/environment');var attributes=require(_0x5e10('0x5'));module[_0x5e10('0x6')]=function(_0x4b8ff2,_0x1f3fc6){return _0x4b8ff2['define']('Trigger',attributes,{'tableName':_0x5e10('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00b3=['tools_triggers','lodash','api','moment','path','rimraf','../../config/environment','exports','define','Trigger'];(function(_0x5af812,_0x43d252){var _0x1489f2=function(_0x1c7fa9){while(--_0x1c7fa9){_0x5af812['push'](_0x5af812['shift']());}};_0x1489f2(++_0x43d252);}(_0x00b3,0x97));var _0x300b=function(_0x1d3a58,_0x105ed1){_0x1d3a58=_0x1d3a58-0x0;var _0x4c391d=_0x00b3[_0x1d3a58];return _0x4c391d;};'use strict';var _=require(_0x300b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x300b('0x1'));var moment=require(_0x300b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x300b('0x3'));var rimraf=require(_0x300b('0x4'));var config=require(_0x300b('0x5'));var attributes=require('./trigger.attributes');module[_0x300b('0x6')]=function(_0xbceeb8,_0x34a5cd){return _0xbceeb8[_0x300b('0x7')](_0x300b('0x8'),attributes,{'tableName':_0x300b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2bed097..1617bb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d71=['error','code','message','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrigger','ShowTrigger','find','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3852fa,_0x2ea782){var _0x3e177b=function(_0x22eab7){while(--_0x22eab7){_0x3852fa['push'](_0x3852fa['shift']());}};_0x3e177b(++_0x2ea782);}(_0x5d71,0xdf));var _0x15d7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5d71[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x15d7('0x0'));var util=require(_0x15d7('0x1'));var moment=require(_0x15d7('0x2'));var BPromise=require(_0x15d7('0x3'));var rs=require(_0x15d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15d7('0x6'))(_0x15d7('0x7'));var config=require(_0x15d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb7a824,_0x4e26e7,_0x39d7ab){return new BPromise(function(_0x2bc22,_0x12e59a){return client[_0x15d7('0xa')](_0xb7a824,_0x39d7ab)['then'](function(_0x185b07){logger[_0x15d7('0xb')](_0x15d7('0xc'),_0x4e26e7,_0x15d7('0xd'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4e26e7,_0x15d7('0xd'),JSON[_0x15d7('0xe')](_0x185b07));if(_0x185b07['error']){if(_0x185b07[_0x15d7('0xf')][_0x15d7('0x10')]===0x1f4){logger[_0x15d7('0xf')](_0x15d7('0xc'),_0x4e26e7,_0x185b07[_0x15d7('0xf')][_0x15d7('0x11')]);return _0x12e59a(_0x185b07[_0x15d7('0xf')][_0x15d7('0x11')]);}logger['error'](_0x15d7('0xc'),_0x4e26e7,_0x185b07[_0x15d7('0xf')][_0x15d7('0x11')]);return _0x2bc22(_0x185b07[_0x15d7('0xf')][_0x15d7('0x11')]);}else{logger[_0x15d7('0xb')](_0x15d7('0xc'),_0x4e26e7,'request\x20sent');_0x2bc22(_0x185b07['result']['message']);}})[_0x15d7('0x12')](function(_0xafb629){logger['error'](_0x15d7('0xc'),_0x4e26e7,_0xafb629);_0x12e59a(_0xafb629);});});}exports['GetTrigger']=function(_0x81da8d){var _0x3be1a2=this;return new Promise(function(_0x59ce61,_0x5ea40d){return db[_0x15d7('0x13')][_0x15d7('0x14')]({'raw':_0x81da8d[_0x15d7('0x15')]?_0x81da8d[_0x15d7('0x15')][_0x15d7('0x16')]===undefined?!![]:![]:!![],'where':_0x81da8d[_0x15d7('0x15')]?_0x81da8d['options'][_0x15d7('0x17')]||null:null,'attributes':_0x81da8d[_0x15d7('0x15')]?_0x81da8d[_0x15d7('0x15')][_0x15d7('0x18')]||null:null,'limit':_0x81da8d[_0x15d7('0x15')]?_0x81da8d[_0x15d7('0x15')][_0x15d7('0x19')]||null:null,'include':_0x81da8d[_0x15d7('0x15')]?_0x81da8d[_0x15d7('0x15')][_0x15d7('0x1a')]?_[_0x15d7('0x1b')](_0x81da8d[_0x15d7('0x15')][_0x15d7('0x1a')],function(_0x2b4bf6){return{'model':db[_0x2b4bf6['model']],'as':_0x2b4bf6['as'],'attributes':_0x2b4bf6[_0x15d7('0x18')],'include':_0x2b4bf6[_0x15d7('0x1a')]?_['map'](_0x2b4bf6[_0x15d7('0x1a')],function(_0x4d2e81){return{'model':db[_0x4d2e81[_0x15d7('0x1c')]],'as':_0x4d2e81['as'],'attributes':_0x4d2e81['attributes'],'include':_0x4d2e81[_0x15d7('0x1a')]?_['map'](_0x4d2e81[_0x15d7('0x1a')],function(_0x1b91af){return{'model':db[_0x1b91af[_0x15d7('0x1c')]],'as':_0x1b91af['as'],'attributes':_0x1b91af[_0x15d7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x15d7('0x1d')](function(_0x13c5fd){logger[_0x15d7('0xb')](_0x15d7('0x1e'),_0x81da8d);logger['debug'](_0x15d7('0x1e'),_0x81da8d,JSON[_0x15d7('0xe')](_0x13c5fd));_0x59ce61(_0x13c5fd);})[_0x15d7('0x12')](function(_0x1dcf4a){logger[_0x15d7('0xf')]('GetTrigger',_0x1dcf4a['message'],_0x81da8d);_0x5ea40d(_0x3be1a2[_0x15d7('0xf')](0x1f4,_0x1dcf4a['message']));});});};exports[_0x15d7('0x1f')]=function(_0x1851ea){var _0x4b0677=this;return new Promise(function(_0x1ad74b,_0x3da79a){return db[_0x15d7('0x13')][_0x15d7('0x20')]({'raw':_0x1851ea[_0x15d7('0x15')]?_0x1851ea['options'][_0x15d7('0x16')]===undefined?!![]:![]:!![],'where':_0x1851ea[_0x15d7('0x15')]?_0x1851ea[_0x15d7('0x15')]['where']||null:null,'attributes':_0x1851ea[_0x15d7('0x15')]?_0x1851ea[_0x15d7('0x15')][_0x15d7('0x18')]||null:null,'include':_0x1851ea[_0x15d7('0x15')]?_0x1851ea['options'][_0x15d7('0x1a')]?_[_0x15d7('0x1b')](_0x1851ea['options'][_0x15d7('0x1a')],function(_0x165274){return{'model':db[_0x165274[_0x15d7('0x1c')]],'as':_0x165274['as'],'attributes':_0x165274[_0x15d7('0x18')],'include':_0x165274[_0x15d7('0x1a')]?_['map'](_0x165274[_0x15d7('0x1a')],function(_0x11c093){return{'model':db[_0x11c093[_0x15d7('0x1c')]],'as':_0x11c093['as'],'attributes':_0x11c093[_0x15d7('0x18')],'include':_0x11c093[_0x15d7('0x1a')]?_[_0x15d7('0x1b')](_0x11c093[_0x15d7('0x1a')],function(_0x4fcbb1){return{'model':db[_0x4fcbb1[_0x15d7('0x1c')]],'as':_0x4fcbb1['as'],'attributes':_0x4fcbb1[_0x15d7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x15d7('0x1d')](function(_0x29cd37){logger[_0x15d7('0xb')](_0x15d7('0x1f'),_0x1851ea);logger[_0x15d7('0x21')](_0x15d7('0x1f'),_0x1851ea,JSON[_0x15d7('0xe')](_0x29cd37));_0x1ad74b(_0x29cd37);})[_0x15d7('0x12')](function(_0x5b79ed){logger[_0x15d7('0xf')](_0x15d7('0x1f'),_0x5b79ed['message'],_0x1851ea);_0x3da79a(_0x4b0677['error'](0x1f4,_0x5b79ed[_0x15d7('0x11')]));});});};
\ No newline at end of file
+var _0x87df=['include','map','model','info','ShowTrigger','find','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrigger','Trigger','findAll','options','where','attributes','limit'];(function(_0x52ef50,_0x343159){var _0x4b7f92=function(_0x3d3c7d){while(--_0x3d3c7d){_0x52ef50['push'](_0x52ef50['shift']());}};_0x4b7f92(++_0x343159);}(_0x87df,0x1e9));var _0xf87d=function(_0x5d8084,_0x1947e9){_0x5d8084=_0x5d8084-0x0;var _0x4c0147=_0x87df[_0x5d8084];return _0x4c0147;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var moment=require(_0xf87d('0x2'));var BPromise=require(_0xf87d('0x3'));var rs=require(_0xf87d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf87d('0x5'))['db'];var utils=require(_0xf87d('0x6'));var logger=require(_0xf87d('0x7'))('rpc');var config=require(_0xf87d('0x8'));var jayson=require(_0xf87d('0x9'));var client=jayson['client'][_0xf87d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34366c,_0x454dc7,_0x41ae29){return new BPromise(function(_0x298f29,_0x488e55){return client[_0xf87d('0xb')](_0x34366c,_0x41ae29)[_0xf87d('0xc')](function(_0x3a3120){logger['info'](_0xf87d('0xd'),_0x454dc7,_0xf87d('0xe'));logger[_0xf87d('0xf')](_0xf87d('0x10'),_0x454dc7,'request\x20sent',JSON[_0xf87d('0x11')](_0x3a3120));if(_0x3a3120['error']){if(_0x3a3120[_0xf87d('0x12')][_0xf87d('0x13')]===0x1f4){logger[_0xf87d('0x12')]('Trigger,\x20%s,\x20%s',_0x454dc7,_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);return _0x488e55(_0x3a3120[_0xf87d('0x12')]['message']);}logger[_0xf87d('0x12')](_0xf87d('0xd'),_0x454dc7,_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);return _0x298f29(_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);}else{logger['info'](_0xf87d('0xd'),_0x454dc7,_0xf87d('0xe'));_0x298f29(_0x3a3120[_0xf87d('0x15')][_0xf87d('0x14')]);}})['catch'](function(_0x2eda90){logger[_0xf87d('0x12')](_0xf87d('0xd'),_0x454dc7,_0x2eda90);_0x488e55(_0x2eda90);});});}exports[_0xf87d('0x16')]=function(_0x4198bf){var _0x186d36=this;return new Promise(function(_0x4015dc,_0xbe3820){return db[_0xf87d('0x17')][_0xf87d('0x18')]({'raw':_0x4198bf[_0xf87d('0x19')]?_0x4198bf[_0xf87d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4198bf[_0xf87d('0x19')]?_0x4198bf[_0xf87d('0x19')][_0xf87d('0x1a')]||null:null,'attributes':_0x4198bf[_0xf87d('0x19')]?_0x4198bf['options'][_0xf87d('0x1b')]||null:null,'limit':_0x4198bf[_0xf87d('0x19')]?_0x4198bf[_0xf87d('0x19')][_0xf87d('0x1c')]||null:null,'include':_0x4198bf[_0xf87d('0x19')]?_0x4198bf[_0xf87d('0x19')][_0xf87d('0x1d')]?_[_0xf87d('0x1e')](_0x4198bf[_0xf87d('0x19')]['include'],function(_0x14ae48){return{'model':db[_0x14ae48[_0xf87d('0x1f')]],'as':_0x14ae48['as'],'attributes':_0x14ae48[_0xf87d('0x1b')],'include':_0x14ae48[_0xf87d('0x1d')]?_[_0xf87d('0x1e')](_0x14ae48['include'],function(_0x46f612){return{'model':db[_0x46f612['model']],'as':_0x46f612['as'],'attributes':_0x46f612['attributes'],'include':_0x46f612[_0xf87d('0x1d')]?_[_0xf87d('0x1e')](_0x46f612[_0xf87d('0x1d')],function(_0xcb9071){return{'model':db[_0xcb9071[_0xf87d('0x1f')]],'as':_0xcb9071['as'],'attributes':_0xcb9071['attributes']};}):[]};}):[]};}):[]:[]})[_0xf87d('0xc')](function(_0x5b13b5){logger[_0xf87d('0x20')](_0xf87d('0x16'),_0x4198bf);logger[_0xf87d('0xf')](_0xf87d('0x16'),_0x4198bf,JSON[_0xf87d('0x11')](_0x5b13b5));_0x4015dc(_0x5b13b5);})['catch'](function(_0xb16004){logger[_0xf87d('0x12')](_0xf87d('0x16'),_0xb16004['message'],_0x4198bf);_0xbe3820(_0x186d36[_0xf87d('0x12')](0x1f4,_0xb16004['message']));});});};exports[_0xf87d('0x21')]=function(_0x5b4781){var _0x63dda8=this;return new Promise(function(_0x22e33f,_0x38a336){return db['Trigger'][_0xf87d('0x22')]({'raw':_0x5b4781[_0xf87d('0x19')]?_0x5b4781[_0xf87d('0x19')][_0xf87d('0x23')]===undefined?!![]:![]:!![],'where':_0x5b4781[_0xf87d('0x19')]?_0x5b4781[_0xf87d('0x19')]['where']||null:null,'attributes':_0x5b4781[_0xf87d('0x19')]?_0x5b4781[_0xf87d('0x19')][_0xf87d('0x1b')]||null:null,'include':_0x5b4781[_0xf87d('0x19')]?_0x5b4781[_0xf87d('0x19')][_0xf87d('0x1d')]?_['map'](_0x5b4781[_0xf87d('0x19')][_0xf87d('0x1d')],function(_0x5852e7){return{'model':db[_0x5852e7['model']],'as':_0x5852e7['as'],'attributes':_0x5852e7[_0xf87d('0x1b')],'include':_0x5852e7['include']?_['map'](_0x5852e7['include'],function(_0x59b87d){return{'model':db[_0x59b87d['model']],'as':_0x59b87d['as'],'attributes':_0x59b87d[_0xf87d('0x1b')],'include':_0x59b87d[_0xf87d('0x1d')]?_[_0xf87d('0x1e')](_0x59b87d['include'],function(_0x2c32b3){return{'model':db[_0x2c32b3['model']],'as':_0x2c32b3['as'],'attributes':_0x2c32b3[_0xf87d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf87d('0xc')](function(_0xd3cbef){logger[_0xf87d('0x20')](_0xf87d('0x21'),_0x5b4781);logger[_0xf87d('0xf')](_0xf87d('0x21'),_0x5b4781,JSON[_0xf87d('0x11')](_0xd3cbef));_0x22e33f(_0xd3cbef);})[_0xf87d('0x24')](function(_0x3bee8f){logger[_0xf87d('0x12')](_0xf87d('0x21'),_0x3bee8f[_0xf87d('0x14')],_0x5b4781);_0x38a336(_0x63dda8[_0xf87d('0x12')](0x1f4,_0x3bee8f[_0xf87d('0x14')]));});});};
\ No newline at end of file
index a38988a..db79dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc83=['get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','index'];(function(_0x3c5acc,_0x47cc83){var _0x28f37e=function(_0x4f99a2){while(--_0x4f99a2){_0x3c5acc['push'](_0x3c5acc['shift']());}};_0x28f37e(++_0x47cc83);}(_0xdc83,0x160));var _0x3dc8=function(_0x4a2360,_0x326032){_0x4a2360=_0x4a2360-0x0;var _0x5e1493=_0xdc83[_0x4a2360];return _0x5e1493;};'use strict';var multer=require(_0x3dc8('0x0'));var util=require(_0x3dc8('0x1'));var path=require('path');var timeout=require(_0x3dc8('0x2'));var express=require('express');var router=express[_0x3dc8('0x3')]();var fs_extra=require(_0x3dc8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3dc8('0x5'));var config=require(_0x3dc8('0x6'));var controller=require(_0x3dc8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3dc8('0x8')]);router[_0x3dc8('0x9')](_0x3dc8('0xa'),auth['isAuthenticated'](),controller[_0x3dc8('0xb')]);router[_0x3dc8('0xc')]('/:id/clone',auth[_0x3dc8('0xd')](),controller['clone']);router[_0x3dc8('0xc')]('/',auth[_0x3dc8('0xd')](),controller[_0x3dc8('0xe')]);router[_0x3dc8('0xf')](_0x3dc8('0xa'),auth[_0x3dc8('0xd')](),controller[_0x3dc8('0x10')]);router[_0x3dc8('0x11')](_0x3dc8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3dc8('0x12')]=router;
\ No newline at end of file
+var _0xd262=['create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone'];(function(_0x3c34ba,_0x107cef){var _0x98a980=function(_0x4ac926){while(--_0x4ac926){_0x3c34ba['push'](_0x3c34ba['shift']());}};_0x98a980(++_0x107cef);}(_0xd262,0x6a));var _0x2d26=function(_0x317253,_0x23b79b){_0x317253=_0x317253-0x0;var _0x3b7e48=_0xd262[_0x317253];return _0x3b7e48;};'use strict';var multer=require(_0x2d26('0x0'));var util=require('util');var path=require(_0x2d26('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d26('0x2'));var router=express[_0x2d26('0x3')]();var fs_extra=require(_0x2d26('0x4'));var auth=require(_0x2d26('0x5'));var interaction=require(_0x2d26('0x6'));var config=require(_0x2d26('0x7'));var controller=require(_0x2d26('0x8'));router[_0x2d26('0x9')]('/',auth[_0x2d26('0xa')](),controller[_0x2d26('0xb')]);router[_0x2d26('0x9')](_0x2d26('0xc'),auth[_0x2d26('0xa')](),controller['show']);router['post'](_0x2d26('0xd'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x2d26('0xa')](),controller[_0x2d26('0xe')]);router[_0x2d26('0xf')]('/:id',auth[_0x2d26('0xa')](),controller[_0x2d26('0x10')]);router[_0x2d26('0x11')](_0x2d26('0xc'),auth[_0x2d26('0xa')](),controller[_0x2d26('0x12')]);module[_0x2d26('0x13')]=router;
\ No newline at end of file
index c616840..249502f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda72=['shortinfo','inband','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','passive','actpass','update,nonat','BOOLEAN','sequelize','STRING','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x4d010b,_0x28ec82){var _0x41776d=function(_0x5868e7){while(--_0x5868e7){_0x4d010b['push'](_0x4d010b['shift']());}};_0x41776d(++_0x28ec82);}(_0xda72,0x1c5));var _0x2da7=function(_0x3b3c9f,_0x168591){_0x3b3c9f=_0x3b3c9f-0x0;var _0x3f9a97=_0xda72[_0x3b3c9f];return _0x3f9a97;};'use strict';var Sequelize=require(_0x2da7('0x0'));module['exports']={'name':{'type':Sequelize[_0x2da7('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x3'),_0x2da7('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2da7('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x5'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x2da7('0x6'),_0x2da7('0x7'),'PROHIB_PASSED_SCREEN',_0x2da7('0x8'),'PROHIB')},'deny':{'type':Sequelize[_0x2da7('0x1')]},'permit':{'type':Sequelize[_0x2da7('0x1')]},'secret':{'type':Sequelize[_0x2da7('0x1')]},'md5secret':{'type':Sequelize[_0x2da7('0x1')]},'remotesecret':{'type':Sequelize[_0x2da7('0x1')]},'transport':{'type':Sequelize[_0x2da7('0x1')],'defaultValue':_0x2da7('0x9'),'set':function(_0x27ebed){this[_0x2da7('0xa')](_0x2da7('0xb'),_0x27ebed?_0x27ebed['join'](','):null);},'get':function(){return this[_0x2da7('0xc')](_0x2da7('0xb'))?this[_0x2da7('0xc')](_0x2da7('0xb'))[_0x2da7('0xd')](','):null;},'comment':_0x2da7('0xe')},'dtmfmode':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0xf'),_0x2da7('0x10'),_0x2da7('0x11'),_0x2da7('0x12'),_0x2da7('0x13')),'defaultValue':_0x2da7('0xf')},'directmedia':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no',_0x2da7('0x15'),_0x2da7('0x16'),_0x2da7('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2da7('0x1')]},'directmediadeny':{'type':Sequelize[_0x2da7('0x1')]},'nat':{'type':Sequelize[_0x2da7('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x419f73){this[_0x2da7('0xa')](_0x2da7('0x18'),_0x419f73?_0x419f73['join'](','):null);},'get':function(){return this[_0x2da7('0xc')](_0x2da7('0x18'))?this[_0x2da7('0xc')](_0x2da7('0x18'))[_0x2da7('0xd')](','):null;},'comment':_0x2da7('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2da7('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x2da7('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2da7('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x2da7('0x1a')},'allow':{'type':Sequelize[_0x2da7('0x1')],'allowNull':![],'defaultValue':_0x2da7('0x1b'),'set':function(_0x381713){this[_0x2da7('0xa')](_0x2da7('0x1c'),_0x381713?_0x381713[_0x2da7('0x1d')](';'):_0x2da7('0x1b'));},'get':function(){return this[_0x2da7('0xc')](_0x2da7('0x1c'))?this[_0x2da7('0xc')](_0x2da7('0x1c'))['split'](';'):null;},'comment':_0x2da7('0x1e')},'autoframing':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x2da7('0x1f'),'set':function(_0x20893c){this['setDataValue'](_0x2da7('0x20'),_0x20893c?_0x20893c[_0x2da7('0x1d')](','):null);},'get':function(){return this[_0x2da7('0xc')](_0x2da7('0x20'))?this['getDataValue']('insecure')[_0x2da7('0xd')](','):null;},'comment':_0x2da7('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x2da7('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no',_0x2da7('0x22'))},'promiscredir':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'useclientcode':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'accountcode':{'type':Sequelize[_0x2da7('0x23')](0xb)},'setvar':{'type':Sequelize[_0x2da7('0x1')]},'callerid':{'type':Sequelize[_0x2da7('0x1')],'defaultValue':_0x2da7('0x24')},'amaflags':{'type':Sequelize[_0x2da7('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0x2da7('0x14'),'no'),'defaultValue':_0x2da7('0x14')},'busylevel':{'type':Sequelize[_0x2da7('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2da7('0x14'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2da7('0x14'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2da7('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x2da7('0x1')]},'template':{'type':Sequelize[_0x2da7('0x1')]},'videosupport':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2da7('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'mailbox':{'type':Sequelize[_0x2da7('0x1')]},'session_timers':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x25'),_0x2da7('0x26'),_0x2da7('0x27'))},'session_expires':{'type':Sequelize[_0x2da7('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x28'),'uas'),'defaultValue':_0x2da7('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x2da7('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x2da7('0x1')]},'fromuser':{'type':Sequelize[_0x2da7('0x1')]},'port':{'type':Sequelize[_0x2da7('0x23')](0x5)},'qualify':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2da7('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2da7('0x1')]},'defaultuser':{'type':Sequelize[_0x2da7('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x2da7('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x2da7('0x2')]('yes','no',_0x2da7('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2da7('0x1')]},'callbackextension':{'type':Sequelize[_0x2da7('0x1')]},'timert1':{'type':Sequelize[_0x2da7('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2da7('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x2da7('0x1')]},'contactdeny':{'type':Sequelize[_0x2da7('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x2da7('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x2da7('0x23')](0xb)},'encryption':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x2da7('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x2da7('0x1')]},'dtlscafile':{'type':Sequelize[_0x2da7('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x2da7('0x2')]('active',_0x2da7('0x2b'),_0x2da7('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2da7('0x1')]},'usereqphone':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2da7('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x2da7('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no')},'vmexten':{'type':Sequelize[_0x2da7('0x1')]},'mohinterpret':{'type':Sequelize[_0x2da7('0x1')]},'mohsuggest':{'type':Sequelize[_0x2da7('0x1')]},'parkinglot':{'type':Sequelize[_0x2da7('0x1')]},'description':{'type':Sequelize[_0x2da7('0x1')]},'host':{'type':Sequelize[_0x2da7('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x2da7('0x2')](_0x2da7('0x14'),'no',_0x2da7('0x15'),_0x2da7('0x16'),_0x2da7('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2da7('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2da7('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0xa1ab=['exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','uac','uas','pai','fingerprint','certificate','actpass','update','update,nonat','BOOLEAN','sequelize'];(function(_0x291a91,_0x2f382c){var _0x1f9de2=function(_0x5ac378){while(--_0x5ac378){_0x291a91['push'](_0x291a91['shift']());}};_0x1f9de2(++_0x2f382c);}(_0xa1ab,0x92));var _0xba1a=function(_0x1ba7cc,_0x5bfb6b){_0x1ba7cc=_0x1ba7cc-0x0;var _0x1302bb=_0xa1ab[_0x1ba7cc];return _0x1302bb;};'use strict';var Sequelize=require(_0xba1a('0x0'));module[_0xba1a('0x1')]={'name':{'type':Sequelize[_0xba1a('0x2')],'allowNull':![],'unique':_0xba1a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x5'),_0xba1a('0x6'),_0xba1a('0x7')),'allowNull':![],'defaultValue':_0xba1a('0x5')},'context':{'type':Sequelize[_0xba1a('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xba1a('0x8'),_0xba1a('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xba1a('0xa'),_0xba1a('0xb'),'PROHIB_FAILED_SCREEN',_0xba1a('0xc'))},'deny':{'type':Sequelize[_0xba1a('0x2')]},'permit':{'type':Sequelize[_0xba1a('0x2')]},'secret':{'type':Sequelize[_0xba1a('0x2')]},'md5secret':{'type':Sequelize[_0xba1a('0x2')]},'remotesecret':{'type':Sequelize[_0xba1a('0x2')]},'transport':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':_0xba1a('0xd'),'set':function(_0x3c8a26){this[_0xba1a('0xe')](_0xba1a('0xf'),_0x3c8a26?_0x3c8a26[_0xba1a('0x10')](','):null);},'get':function(){return this[_0xba1a('0x11')](_0xba1a('0xf'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0xba1a('0x12')},'dtmfmode':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x13'),_0xba1a('0x14'),_0xba1a('0x15'),_0xba1a('0x16'),'auto'),'defaultValue':_0xba1a('0x13')},'directmedia':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no',_0xba1a('0x18'),'update',_0xba1a('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xba1a('0x2')]},'nat':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x395a82){this[_0xba1a('0xe')]('nat',_0x395a82?_0x395a82[_0xba1a('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xba1a('0x1a'))?this[_0xba1a('0x11')](_0xba1a('0x1a'))['split'](','):null;},'comment':_0xba1a('0x1b')},'callgroup':{'type':Sequelize[_0xba1a('0x2')]},'namedcallgroup':{'type':Sequelize[_0xba1a('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xba1a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xba1a('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3db883){this[_0xba1a('0xe')](_0xba1a('0x1c'),_0x3db883?_0x3db883[_0xba1a('0x10')](';'):_0xba1a('0x1d'));},'get':function(){return this[_0xba1a('0x11')](_0xba1a('0x1c'))?this[_0xba1a('0x11')]('allow')[_0xba1a('0x1e')](';'):null;},'comment':_0xba1a('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0xba1a('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xba1a('0x20'),'set':function(_0x5e74af){this[_0xba1a('0xe')](_0xba1a('0x21'),_0x5e74af?_0x5e74af['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xba1a('0x11')](_0xba1a('0x21'))['split'](','):null;},'comment':_0xba1a('0x22')},'trustrpid':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no',_0xba1a('0x23'))},'promiscredir':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0xba1a('0x24')](0xb)},'setvar':{'type':Sequelize[_0xba1a('0x2')]},'callerid':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':_0xba1a('0x25')},'amaflags':{'type':Sequelize[_0xba1a('0x2')]},'callcounter':{'type':Sequelize[_0xba1a('0x4')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xba1a('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xba1a('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xba1a('0x2')]},'videosupport':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no',_0xba1a('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xba1a('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0xba1a('0x2')]},'session_timers':{'type':Sequelize[_0xba1a('0x4')]('accept',_0xba1a('0x27'),'originate')},'session_expires':{'type':Sequelize[_0xba1a('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xba1a('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x28'),_0xba1a('0x29')),'defaultValue':_0xba1a('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xba1a('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xba1a('0x24')](0x5)},'qualify':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no'),'defaultValue':_0xba1a('0x17')},'keepalive':{'type':Sequelize[_0xba1a('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xba1a('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xba1a('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xba1a('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no',_0xba1a('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xba1a('0x2')]},'callbackextension':{'type':Sequelize[_0xba1a('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xba1a('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xba1a('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xba1a('0x2')]},'contactdeny':{'type':Sequelize[_0xba1a('0x2')]},'contactacl':{'type':Sequelize[_0xba1a('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xba1a('0x2')]},'maxforwards':{'type':Sequelize[_0xba1a('0x24')](0xb)},'encryption':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no')},'icesupport':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xba1a('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no',_0xba1a('0x2b'),_0xba1a('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xba1a('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xba1a('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xba1a('0x2')]},'dtlscapath':{'type':Sequelize[_0xba1a('0x2')]},'dtlssetup':{'type':Sequelize[_0xba1a('0x4')]('active','passive',_0xba1a('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xba1a('0x2')]},'usereqphone':{'type':Sequelize[_0xba1a('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xba1a('0x2')]},'recordofffeature':{'type':Sequelize[_0xba1a('0x2')]},'call_limit':{'type':Sequelize[_0xba1a('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xba1a('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0xba1a('0x2')]},'mohinterpret':{'type':Sequelize[_0xba1a('0x2')]},'mohsuggest':{'type':Sequelize[_0xba1a('0x2')]},'parkinglot':{'type':Sequelize[_0xba1a('0x2')]},'description':{'type':Sequelize[_0xba1a('0x2')]},'host':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xba1a('0x4')](_0xba1a('0x17'),'no','nonat',_0xba1a('0x2e'),_0xba1a('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xba1a('0x2')]},'otherFields':{'type':Sequelize[_0xba1a('0x2')]},'active':{'type':Sequelize[_0xba1a('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xba1a('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index 22c37ff..9b2d111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x3005c7,_0x39d5a5){var _0x17d49c=function(_0x485108){while(--_0x485108){_0x3005c7['push'](_0x3005c7['shift']());}};_0x17d49c(++_0x39d5a5);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x183865,_0x372721){_0x183865=_0x183865-0x0;var _0x14b3d6=_0x8d0e[_0x183865];return _0x14b3d6;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
+var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x197f3d,_0x57cde0){var _0x535fb1=function(_0x1fe148){while(--_0x1fe148){_0x197f3d['push'](_0x197f3d['shift']());}};_0x535fb1(++_0x57cde0);}(_0xedd9,0xfc));var _0x9edd=function(_0xc427e5,_0x59926e){_0xc427e5=_0xc427e5-0x0;var _0x2549fc=_0xedd9[_0xc427e5];return _0x2549fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));};
\ No newline at end of file
index 18f139b..e5306fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7512=['request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2d6e0e,_0xf37e2d){var _0x4977c6=function(_0x35994e){while(--_0x35994e){_0x2d6e0e['push'](_0x2d6e0e['shift']());}};_0x4977c6(++_0xf37e2d);}(_0x7512,0x182));var _0x2751=function(_0x1e0a4a,_0x55752e){_0x1e0a4a=_0x1e0a4a-0x0;var _0x352afd=_0x7512[_0x1e0a4a];return _0x352afd;};'use strict';var _=require(_0x2751('0x0'));var util=require(_0x2751('0x1'));var logger=require(_0x2751('0x2'))(_0x2751('0x3'));var moment=require(_0x2751('0x4'));var BPromise=require(_0x2751('0x5'));var rp=require(_0x2751('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2751('0x7'));var config=require(_0x2751('0x8'));var attributes=require(_0x2751('0x9'));module[_0x2751('0xa')]=function(_0x393f34,_0x53e74f){return _0x393f34[_0x2751('0xb')](_0x2751('0xc'),attributes,{'tableName':_0x2751('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d61=['rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x260e29,_0x1d8d60){var _0x263384=function(_0x4b34ca){while(--_0x4b34ca){_0x260e29['push'](_0x260e29['shift']());}};_0x263384(++_0x1d8d60);}(_0x1d61,0xae));var _0x11d6=function(_0x3fa143,_0xca226d){_0x3fa143=_0x3fa143-0x0;var _0x4814dc=_0x1d61[_0x3fa143];return _0x4814dc;};'use strict';var _=require(_0x11d6('0x0'));var util=require('util');var logger=require(_0x11d6('0x1'))(_0x11d6('0x2'));var moment=require(_0x11d6('0x3'));var BPromise=require(_0x11d6('0x4'));var rp=require(_0x11d6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11d6('0x6'));var config=require(_0x11d6('0x7'));var attributes=require(_0x11d6('0x8'));module[_0x11d6('0x9')]=function(_0x4b4ff2,_0x13fc6e){return _0x4b4ff2[_0x11d6('0xa')]('Trunk',attributes,{'tableName':_0x11d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e1c49fc..02838ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e87=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','include','model','map','stringify','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x8f270,_0x2f435f){var _0x5446cb=function(_0x6b3be8){while(--_0x6b3be8){_0x8f270['push'](_0x8f270['shift']());}};_0x5446cb(++_0x2f435f);}(_0x9e87,0x1ba));var _0x79e8=function(_0x3c7577,_0x46dcf5){_0x3c7577=_0x3c7577-0x0;var _0x35dde6=_0x9e87[_0x3c7577];return _0x35dde6;};'use strict';var _=require('lodash');var util=require(_0x79e8('0x0'));var moment=require(_0x79e8('0x1'));var BPromise=require(_0x79e8('0x2'));var rs=require(_0x79e8('0x3'));var fs=require('fs');var Redis=require(_0x79e8('0x4'));var db=require(_0x79e8('0x5'))['db'];var utils=require(_0x79e8('0x6'));var logger=require(_0x79e8('0x7'))(_0x79e8('0x8'));var config=require(_0x79e8('0x9'));var jayson=require(_0x79e8('0xa'));var client=jayson[_0x79e8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2caa74,_0x1a31c3,_0x3a25db){return new BPromise(function(_0x4419bd,_0xcd5f0f){return client['request'](_0x2caa74,_0x3a25db)[_0x79e8('0xc')](function(_0x3814bd){logger[_0x79e8('0xd')](_0x79e8('0xe'),_0x1a31c3,_0x79e8('0xf'));logger[_0x79e8('0x10')](_0x79e8('0x11'),_0x1a31c3,_0x79e8('0xf'),JSON['stringify'](_0x3814bd));if(_0x3814bd[_0x79e8('0x12')]){if(_0x3814bd['error'][_0x79e8('0x13')]===0x1f4){logger[_0x79e8('0x12')]('Trunk,\x20%s,\x20%s',_0x1a31c3,_0x3814bd[_0x79e8('0x12')][_0x79e8('0x14')]);return _0xcd5f0f(_0x3814bd[_0x79e8('0x12')][_0x79e8('0x14')]);}logger[_0x79e8('0x12')](_0x79e8('0xe'),_0x1a31c3,_0x3814bd[_0x79e8('0x12')]['message']);return _0x4419bd(_0x3814bd['error'][_0x79e8('0x14')]);}else{logger['info'](_0x79e8('0xe'),_0x1a31c3,'request\x20sent');_0x4419bd(_0x3814bd[_0x79e8('0x15')][_0x79e8('0x14')]);}})[_0x79e8('0x16')](function(_0xda46c){logger[_0x79e8('0x12')]('Trunk,\x20%s,\x20%s',_0x1a31c3,_0xda46c);_0xcd5f0f(_0xda46c);});});}exports[_0x79e8('0x17')]=function(_0x1e3059){var _0x3d7069=this;return new Promise(function(_0x5f03d1,_0x4f0032){return db[_0x79e8('0x18')]['findAll']({'raw':_0x1e3059[_0x79e8('0x19')]?_0x1e3059[_0x79e8('0x19')][_0x79e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e3059[_0x79e8('0x19')]?_0x1e3059['options'][_0x79e8('0x1b')]||null:null,'attributes':_0x1e3059['options']?_0x1e3059[_0x79e8('0x19')][_0x79e8('0x1c')]||null:null,'limit':_0x1e3059[_0x79e8('0x19')]?_0x1e3059['options']['limit']||null:null,'include':_0x1e3059[_0x79e8('0x19')]?_0x1e3059[_0x79e8('0x19')][_0x79e8('0x1d')]?_['map'](_0x1e3059[_0x79e8('0x19')][_0x79e8('0x1d')],function(_0x3bcafb){return{'model':db[_0x3bcafb[_0x79e8('0x1e')]],'as':_0x3bcafb['as'],'attributes':_0x3bcafb[_0x79e8('0x1c')],'include':_0x3bcafb[_0x79e8('0x1d')]?_[_0x79e8('0x1f')](_0x3bcafb[_0x79e8('0x1d')],function(_0x603791){return{'model':db[_0x603791[_0x79e8('0x1e')]],'as':_0x603791['as'],'attributes':_0x603791['attributes'],'include':_0x603791[_0x79e8('0x1d')]?_[_0x79e8('0x1f')](_0x603791[_0x79e8('0x1d')],function(_0x22a46a){return{'model':db[_0x22a46a[_0x79e8('0x1e')]],'as':_0x22a46a['as'],'attributes':_0x22a46a['attributes']};}):[]};}):[]};}):[]:[]})[_0x79e8('0xc')](function(_0x341f){logger[_0x79e8('0xd')]('GetTrunk',_0x1e3059);logger[_0x79e8('0x10')](_0x79e8('0x17'),_0x1e3059,JSON[_0x79e8('0x20')](_0x341f));_0x5f03d1(_0x341f);})[_0x79e8('0x16')](function(_0x2922f7){logger[_0x79e8('0x12')](_0x79e8('0x17'),_0x2922f7[_0x79e8('0x14')],_0x1e3059);_0x4f0032(_0x3d7069['error'](0x1f4,_0x2922f7[_0x79e8('0x14')]));});});};exports[_0x79e8('0x21')]=function(_0x3bca6a){var _0x58b670=this;return new Promise(function(_0x1335c4,_0x5b0dde){return db[_0x79e8('0x18')][_0x79e8('0x22')]({'raw':_0x3bca6a[_0x79e8('0x19')]?_0x3bca6a[_0x79e8('0x19')][_0x79e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bca6a[_0x79e8('0x19')]?_0x3bca6a[_0x79e8('0x19')][_0x79e8('0x1b')]||null:null,'attributes':_0x3bca6a[_0x79e8('0x19')]?_0x3bca6a[_0x79e8('0x19')]['attributes']||null:null,'include':_0x3bca6a['options']?_0x3bca6a[_0x79e8('0x19')]['include']?_[_0x79e8('0x1f')](_0x3bca6a['options']['include'],function(_0x330d9f){return{'model':db[_0x330d9f[_0x79e8('0x1e')]],'as':_0x330d9f['as'],'attributes':_0x330d9f[_0x79e8('0x1c')],'include':_0x330d9f[_0x79e8('0x1d')]?_['map'](_0x330d9f[_0x79e8('0x1d')],function(_0x1e102f){return{'model':db[_0x1e102f['model']],'as':_0x1e102f['as'],'attributes':_0x1e102f[_0x79e8('0x1c')],'include':_0x1e102f[_0x79e8('0x1d')]?_[_0x79e8('0x1f')](_0x1e102f['include'],function(_0x11cda4){return{'model':db[_0x11cda4[_0x79e8('0x1e')]],'as':_0x11cda4['as'],'attributes':_0x11cda4[_0x79e8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x79e8('0xc')](function(_0x252132){logger['info'](_0x79e8('0x21'),_0x3bca6a);logger[_0x79e8('0x10')](_0x79e8('0x21'),_0x3bca6a,JSON['stringify'](_0x252132));_0x1335c4(_0x252132);})['catch'](function(_0x1689a1){logger['error']('ShowTrunk',_0x1689a1[_0x79e8('0x14')],_0x3bca6a);_0x5b0dde(_0x58b670[_0x79e8('0x12')](0x1f4,_0x1689a1['message']));});});};
\ No newline at end of file
+var _0x7f19=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model','then','where','ShowTrunk','lodash'];(function(_0x59ab65,_0x410a52){var _0x57db9b=function(_0x19dc31){while(--_0x19dc31){_0x59ab65['push'](_0x59ab65['shift']());}};_0x57db9b(++_0x410a52);}(_0x7f19,0x131));var _0x97f1=function(_0xf9bd42,_0x3faf94){_0xf9bd42=_0xf9bd42-0x0;var _0xe4df7c=_0x7f19[_0xf9bd42];return _0xe4df7c;};'use strict';var _=require(_0x97f1('0x0'));var util=require(_0x97f1('0x1'));var moment=require('moment');var BPromise=require(_0x97f1('0x2'));var rs=require(_0x97f1('0x3'));var fs=require('fs');var Redis=require(_0x97f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97f1('0x5'));var logger=require(_0x97f1('0x6'))(_0x97f1('0x7'));var config=require(_0x97f1('0x8'));var jayson=require(_0x97f1('0x9'));var client=jayson[_0x97f1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7f49,_0x472a4f,_0x2445e6){return new BPromise(function(_0x4a0849,_0x6e2731){return client['request'](_0x4e7f49,_0x2445e6)['then'](function(_0xacf6c8){logger[_0x97f1('0xb')]('Trunk,\x20%s,\x20%s',_0x472a4f,'request\x20sent');logger['debug'](_0x97f1('0xc'),_0x472a4f,_0x97f1('0xd'),JSON[_0x97f1('0xe')](_0xacf6c8));if(_0xacf6c8[_0x97f1('0xf')]){if(_0xacf6c8['error'][_0x97f1('0x10')]===0x1f4){logger['error'](_0x97f1('0x11'),_0x472a4f,_0xacf6c8[_0x97f1('0xf')][_0x97f1('0x12')]);return _0x6e2731(_0xacf6c8[_0x97f1('0xf')]['message']);}logger[_0x97f1('0xf')](_0x97f1('0x11'),_0x472a4f,_0xacf6c8[_0x97f1('0xf')][_0x97f1('0x12')]);return _0x4a0849(_0xacf6c8[_0x97f1('0xf')][_0x97f1('0x12')]);}else{logger[_0x97f1('0xb')](_0x97f1('0x11'),_0x472a4f,_0x97f1('0xd'));_0x4a0849(_0xacf6c8[_0x97f1('0x13')][_0x97f1('0x12')]);}})[_0x97f1('0x14')](function(_0x3d19b8){logger[_0x97f1('0xf')](_0x97f1('0x11'),_0x472a4f,_0x3d19b8);_0x6e2731(_0x3d19b8);});});}exports[_0x97f1('0x15')]=function(_0x4ec64f){var _0x32c149=this;return new Promise(function(_0x225e09,_0x57ed90){return db[_0x97f1('0x16')][_0x97f1('0x17')]({'raw':_0x4ec64f[_0x97f1('0x18')]?_0x4ec64f[_0x97f1('0x18')][_0x97f1('0x19')]===undefined?!![]:![]:!![],'where':_0x4ec64f[_0x97f1('0x18')]?_0x4ec64f[_0x97f1('0x18')]['where']||null:null,'attributes':_0x4ec64f[_0x97f1('0x18')]?_0x4ec64f['options'][_0x97f1('0x1a')]||null:null,'limit':_0x4ec64f[_0x97f1('0x18')]?_0x4ec64f[_0x97f1('0x18')][_0x97f1('0x1b')]||null:null,'include':_0x4ec64f['options']?_0x4ec64f[_0x97f1('0x18')][_0x97f1('0x1c')]?_[_0x97f1('0x1d')](_0x4ec64f['options']['include'],function(_0x545de8){return{'model':db[_0x545de8[_0x97f1('0x1e')]],'as':_0x545de8['as'],'attributes':_0x545de8[_0x97f1('0x1a')],'include':_0x545de8[_0x97f1('0x1c')]?_['map'](_0x545de8[_0x97f1('0x1c')],function(_0x2b3561){return{'model':db[_0x2b3561[_0x97f1('0x1e')]],'as':_0x2b3561['as'],'attributes':_0x2b3561[_0x97f1('0x1a')],'include':_0x2b3561[_0x97f1('0x1c')]?_[_0x97f1('0x1d')](_0x2b3561[_0x97f1('0x1c')],function(_0x3912e2){return{'model':db[_0x3912e2['model']],'as':_0x3912e2['as'],'attributes':_0x3912e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x97f1('0x1f')](function(_0x11d9a1){logger[_0x97f1('0xb')](_0x97f1('0x15'),_0x4ec64f);logger['debug']('GetTrunk',_0x4ec64f,JSON[_0x97f1('0xe')](_0x11d9a1));_0x225e09(_0x11d9a1);})[_0x97f1('0x14')](function(_0x1b167a){logger[_0x97f1('0xf')](_0x97f1('0x15'),_0x1b167a[_0x97f1('0x12')],_0x4ec64f);_0x57ed90(_0x32c149[_0x97f1('0xf')](0x1f4,_0x1b167a[_0x97f1('0x12')]));});});};exports['ShowTrunk']=function(_0x842d0e){var _0x1842b8=this;return new Promise(function(_0x3ad880,_0x2e0e2){return db[_0x97f1('0x16')]['find']({'raw':_0x842d0e[_0x97f1('0x18')]?_0x842d0e[_0x97f1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x842d0e[_0x97f1('0x18')]?_0x842d0e[_0x97f1('0x18')][_0x97f1('0x20')]||null:null,'attributes':_0x842d0e[_0x97f1('0x18')]?_0x842d0e[_0x97f1('0x18')]['attributes']||null:null,'include':_0x842d0e['options']?_0x842d0e[_0x97f1('0x18')][_0x97f1('0x1c')]?_[_0x97f1('0x1d')](_0x842d0e[_0x97f1('0x18')]['include'],function(_0x102799){return{'model':db[_0x102799[_0x97f1('0x1e')]],'as':_0x102799['as'],'attributes':_0x102799[_0x97f1('0x1a')],'include':_0x102799[_0x97f1('0x1c')]?_['map'](_0x102799['include'],function(_0x98a609){return{'model':db[_0x98a609[_0x97f1('0x1e')]],'as':_0x98a609['as'],'attributes':_0x98a609[_0x97f1('0x1a')],'include':_0x98a609[_0x97f1('0x1c')]?_['map'](_0x98a609[_0x97f1('0x1c')],function(_0x86dd64){return{'model':db[_0x86dd64[_0x97f1('0x1e')]],'as':_0x86dd64['as'],'attributes':_0x86dd64['attributes']};}):[]};}):[]};}):[]:[]})[_0x97f1('0x1f')](function(_0x2077b3){logger[_0x97f1('0xb')](_0x97f1('0x21'),_0x842d0e);logger['debug']('ShowTrunk',_0x842d0e,JSON[_0x97f1('0xe')](_0x2077b3));_0x3ad880(_0x2077b3);})[_0x97f1('0x14')](function(_0xe2448e){logger[_0x97f1('0xf')]('ShowTrunk',_0xe2448e[_0x97f1('0x12')],_0x842d0e);_0x2e0e2(_0x1842b8[_0x97f1('0xf')](0x1f4,_0xe2448e[_0x97f1('0x12')]));});});};
\ No newline at end of file
index 7969456..d7c2862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78c0=['put','isAuthenticated','update','exports','Router','../../components/auth/service','./user-setting.controller'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x78c0,0xba));var _0x078c=function(_0x562eed,_0x48bc7b){_0x562eed=_0x562eed-0x0;var _0x40628b=_0x78c0[_0x562eed];return _0x40628b;};'use strict';var express=require('express');var router=express[_0x078c('0x0')]();var auth=require(_0x078c('0x1'));var controller=require(_0x078c('0x2'));router[_0x078c('0x3')]('/:id',auth[_0x078c('0x4')](),controller[_0x078c('0x5')]);module[_0x078c('0x6')]=router;
\ No newline at end of file
+var _0x4508=['./user-setting.controller','/:id','isAuthenticated','update','exports','Router','../../components/auth/service'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4508,0x1ef));var _0x8450=function(_0x6fd387,_0x4b9668){_0x6fd387=_0x6fd387-0x0;var _0x380148=_0x4508[_0x6fd387];return _0x380148;};'use strict';var express=require('express');var router=express[_0x8450('0x0')]();var auth=require(_0x8450('0x1'));var controller=require(_0x8450('0x2'));router['put'](_0x8450('0x3'),auth[_0x8450('0x4')](),controller[_0x8450('0x5')]);module[_0x8450('0x6')]=router;
\ No newline at end of file
index 5ce8145..0a7cea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a2=['TEXT','UserId','error','warning','info','debug','exports','BOOLEAN'];(function(_0x1f48b2,_0x113edd){var _0x4015b9=function(_0x30995d){while(--_0x30995d){_0x1f48b2['push'](_0x1f48b2['shift']());}};_0x4015b9(++_0x113edd);}(_0xe4a2,0x122));var _0x2e4a=function(_0x416c74,_0x9fba9c){_0x416c74=_0x416c74-0x0;var _0x21e970=_0xe4a2[_0x416c74];return _0x21e970;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x2e4a('0x0'),_0x2e4a('0x1'),_0x2e4a('0x2'),_0x2e4a('0x3')];module[_0x2e4a('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2e4a('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2e4a('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x2e4a('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x2e4a('0x7')}};
\ No newline at end of file
+var _0x9b05=['BOOLEAN','TEXT','DATE','INTEGER','UserId','error','warning','info','debug','exports','ENUM'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x9b05,0x9f));var _0x59b0=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x9b05[_0x447ef1];return _0x3d72ec;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x59b0('0x0'),_0x59b0('0x1'),_0x59b0('0x2'),_0x59b0('0x3')];module[_0x59b0('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x59b0('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x59b0('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x59b0('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x59b0('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x59b0('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x59b0('0x9')],'unique':_0x59b0('0xa')}};
\ No newline at end of file
index a468401..53ad1f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6c=['body','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','localhost','json','update','sendStatus','error','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then'];(function(_0x3d2f68,_0x48f637){var _0x1e6690=function(_0x14b36){while(--_0x14b36){_0x3d2f68['push'](_0x3d2f68['shift']());}};_0x1e6690(++_0x48f637);}(_0xde6c,0x119));var _0xcde6=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0xde6c[_0x2984d0];return _0x2885f2;};'use strict';var _=require(_0xcde6('0x0'));var Redis=require(_0xcde6('0x1'));var logger=require('../../config/logger')(_0xcde6('0x2'));var config=require(_0xcde6('0x3'));var db=require(_0xcde6('0x4'))['db'];var socket=require(_0xcde6('0x5'))(new Redis(config['redis']));require(_0xcde6('0x6'))[_0xcde6('0x7')](socket);config[_0xcde6('0x8')]=_['defaults'](config[_0xcde6('0x8')],{'host':_0xcde6('0x9'),'port':0x18eb});function respondWithResult(_0x5543d9,_0x4c37b1){_0x4c37b1=_0x4c37b1||0xc8;return function(_0x2f7de6){if(_0x2f7de6){return _0x5543d9['status'](_0x4c37b1)[_0xcde6('0xa')](_0x2f7de6);}};}function saveUpdates(_0x27521c){return function(_0x1bf122){if(_0x1bf122){return _0x1bf122[_0xcde6('0xb')](_0x27521c)['then'](function(_0x34eadd){return _0x34eadd;});}return null;};}function handleEntityNotFound(_0x1afddc){return function(_0x55c8d9){if(!_0x55c8d9){_0x1afddc[_0xcde6('0xc')](0x194);}return _0x55c8d9;};}function handleError(_0x38e9ee,_0x35705c){_0x35705c=_0x35705c||0x1f4;return function(_0x15abf2){logger[_0xcde6('0xd')](_0x15abf2[_0xcde6('0xe')]);if(_0x15abf2[_0xcde6('0xf')]){delete _0x15abf2[_0xcde6('0xf')];}_0x38e9ee[_0xcde6('0x10')](_0x35705c)[_0xcde6('0x11')](_0x15abf2);};}exports['update']=function(_0x186345,_0xd6aaac){if(_0x186345[_0xcde6('0x12')][_0xcde6('0x13')]!==_0xcde6('0x14'))throw new Error(_0xcde6('0x15'));if(isNaN(Number(_0x186345[_0xcde6('0x16')]['id'])))throw new Error(_0xcde6('0x17'));return db[_0xcde6('0x18')][_0xcde6('0x19')]({'where':{'id':_0x186345['params']['id']}})[_0xcde6('0x1a')](handleEntityNotFound(_0xd6aaac,null))[_0xcde6('0x1a')](saveUpdates(_0x186345[_0xcde6('0x1b')],null))['then'](respondWithResult(_0xd6aaac,null))['catch'](handleError(_0xd6aaac,null));};
\ No newline at end of file
+var _0xb31a=['status','json','update','then','error','stack','name','send','user','role','admin','Unauthorized','params','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xb31a,0xd4));var _0xab31=function(_0x40db8f,_0x28b717){_0x40db8f=_0x40db8f-0x0;var _0x30ab26=_0xb31a[_0x40db8f];return _0x30ab26;};'use strict';var _=require(_0xab31('0x0'));var Redis=require(_0xab31('0x1'));var logger=require(_0xab31('0x2'))(_0xab31('0x3'));var config=require(_0xab31('0x4'));var db=require(_0xab31('0x5'))['db'];var socket=require(_0xab31('0x6'))(new Redis(config[_0xab31('0x7')]));require(_0xab31('0x8'))[_0xab31('0x9')](socket);config[_0xab31('0x7')]=_[_0xab31('0xa')](config[_0xab31('0x7')],{'host':_0xab31('0xb'),'port':0x18eb});function respondWithResult(_0x2b8f95,_0x53ee8e){_0x53ee8e=_0x53ee8e||0xc8;return function(_0x45b0ef){if(_0x45b0ef){return _0x2b8f95[_0xab31('0xc')](_0x53ee8e)[_0xab31('0xd')](_0x45b0ef);}};}function saveUpdates(_0x336833){return function(_0x1c1b94){if(_0x1c1b94){return _0x1c1b94[_0xab31('0xe')](_0x336833)[_0xab31('0xf')](function(_0x19cb38){return _0x19cb38;});}return null;};}function handleEntityNotFound(_0x101a46){return function(_0x5e63d6){if(!_0x5e63d6){_0x101a46['sendStatus'](0x194);}return _0x5e63d6;};}function handleError(_0x410969,_0x2b22b6){_0x2b22b6=_0x2b22b6||0x1f4;return function(_0x582b5d){logger[_0xab31('0x10')](_0x582b5d[_0xab31('0x11')]);if(_0x582b5d[_0xab31('0x12')]){delete _0x582b5d['name'];}_0x410969['status'](_0x2b22b6)[_0xab31('0x13')](_0x582b5d);};}exports[_0xab31('0xe')]=function(_0xd83637,_0x463725){if(_0xd83637[_0xab31('0x14')][_0xab31('0x15')]!==_0xab31('0x16'))throw new Error(_0xab31('0x17'));if(isNaN(Number(_0xd83637[_0xab31('0x18')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0xab31('0x19')]({'where':{'id':_0xd83637['params']['id']}})[_0xab31('0xf')](handleEntityNotFound(_0x463725,null))[_0xab31('0xf')](saveUpdates(_0xd83637[_0xab31('0x1a')],null))[_0xab31('0xf')](respondWithResult(_0x463725,null))[_0xab31('0x1b')](handleError(_0x463725,null));};
\ No newline at end of file
index bbfa14a..76302ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x695c=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x497272,_0x4fcc33){var _0x5c878a=function(_0x967ca9){while(--_0x967ca9){_0x497272['push'](_0x497272['shift']());}};_0x5c878a(++_0x4fcc33);}(_0x695c,0x6a));var _0xc695=function(_0xd880fe,_0xab56a8){_0xd880fe=_0xd880fe-0x0;var _0x566191=_0x695c[_0xd880fe];return _0x566191;};'use strict';var EventEmitter=require(_0xc695('0x0'));var UserSetting=require(_0xc695('0x1'))['db'][_0xc695('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc695('0x3')](0x0);var events={'afterCreate':_0xc695('0x4'),'afterUpdate':_0xc695('0x5'),'afterDestroy':_0xc695('0x6')};function emitEvent(_0x278095){return function(_0x1c975b,_0x4ea2ea,_0x285c15){UserSettingEvents[_0xc695('0x7')](_0x278095+':'+_0x1c975b['id'],_0x1c975b);UserSettingEvents[_0xc695('0x7')](_0x278095,_0x1c975b);_0x285c15(null);};}for(var e in events){if(events[_0xc695('0x8')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xc695('0x9')]=UserSettingEvents;
\ No newline at end of file
+var _0x25ff=['hasOwnProperty','hook','exports','../../mysqldb','UserSetting','setMaxListeners','update','remove','emit'];(function(_0x58fa09,_0x1ccf29){var _0x178767=function(_0x3ef93e){while(--_0x3ef93e){_0x58fa09['push'](_0x58fa09['shift']());}};_0x178767(++_0x1ccf29);}(_0x25ff,0xa5));var _0xf25f=function(_0x33da2c,_0x2225f7){_0x33da2c=_0x33da2c-0x0;var _0x4b0cb6=_0x25ff[_0x33da2c];return _0x4b0cb6;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xf25f('0x0'))['db'][_0xf25f('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf25f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf25f('0x3'),'afterDestroy':_0xf25f('0x4')};function emitEvent(_0x1f9d23){return function(_0x388f56,_0x490eab,_0x360b21){UserSettingEvents[_0xf25f('0x5')](_0x1f9d23+':'+_0x388f56['id'],_0x388f56);UserSettingEvents['emit'](_0x1f9d23,_0x388f56);_0x360b21(null);};}for(var e in events){if(events[_0xf25f('0x6')](e)){var event=events[e];UserSetting[_0xf25f('0x7')](e,emitEvent(event));}}module[_0xf25f('0x8')]=UserSettingEvents;
\ No newline at end of file
index 56b6d20..c6aff65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7a0=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x43be21,_0x1a1140){var _0x535370=function(_0x5a8d39){while(--_0x5a8d39){_0x43be21['push'](_0x43be21['shift']());}};_0x535370(++_0x1a1140);}(_0xd7a0,0x163));var _0x0d7a=function(_0x9575f2,_0xcb26c5){_0x9575f2=_0x9575f2-0x0;var _0x167433=_0xd7a0[_0x9575f2];return _0x167433;};'use strict';var attributes=require(_0x0d7a('0x0'));module[_0x0d7a('0x1')]=function(_0x58d49a){return _0x58d49a[_0x0d7a('0x2')]('UserSetting',attributes,{'tableName':_0x0d7a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29e96a){if(!_0x29e96a[_0x0d7a('0x4')])_0x29e96a[_0x0d7a('0x5')]=null;else if(_0x29e96a[_0x0d7a('0x5')]===null)_0x29e96a['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0x0c1a=['./user-setting.attributes','exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x3d41ab,_0x51add8){var _0x59c0ba=function(_0x4675c5){while(--_0x4675c5){_0x3d41ab['push'](_0x3d41ab['shift']());}};_0x59c0ba(++_0x51add8);}(_0x0c1a,0x127));var _0xa0c1=function(_0x1827c5,_0x50a0f2){_0x1827c5=_0x1827c5-0x0;var _0xf0583a=_0x0c1a[_0x1827c5];return _0xf0583a;};'use strict';var attributes=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]=function(_0x403058){return _0x403058['define']('UserSetting',attributes,{'tableName':_0xa0c1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d4cdc){if(!_0x4d4cdc[_0xa0c1('0x3')])_0x4d4cdc[_0xa0c1('0x4')]=null;else if(_0x4d4cdc[_0xa0c1('0x4')]===null)_0x4d4cdc[_0xa0c1('0x4')]=new Date();}}});};
\ No newline at end of file
index ed7f7e3..f0a97cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d92=['length','user-setting:','./user-setting.events','save','remove','emit','user-setting:update:user-','UserId','register'];(function(_0x167655,_0x4db0ab){var _0x1210c0=function(_0x6e144f){while(--_0x6e144f){_0x167655['push'](_0x167655['shift']());}};_0x1210c0(++_0x4db0ab);}(_0x3d92,0x107));var _0x23d9=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x3d92[_0x35d8af];return _0x1d08b0;};'use strict';var UserSettingEvents=require(_0x23d9('0x0'));var events=[_0x23d9('0x1'),_0x23d9('0x2'),'update'];function createListener(_0x2119e4,_0x416353){return function(_0x519ee1){_0x416353[_0x23d9('0x3')](_0x2119e4,_0x519ee1);if(_0x2119e4==='user-setting:update'){_0x416353['emit'](_0x23d9('0x4')+_0x519ee1[_0x23d9('0x5')],_0x519ee1);}};}exports[_0x23d9('0x6')]=function(_0x128fed){for(var _0x39b8f2=0x0,_0x264457=events[_0x23d9('0x7')];_0x39b8f2<_0x264457;_0x39b8f2++){var _0x1c2966=events[_0x39b8f2];var _0x4c1998=createListener(_0x23d9('0x8')+_0x1c2966,_0x128fed);UserSettingEvents['on'](_0x1c2966,_0x4c1998);}};
\ No newline at end of file
+var _0x6e7c=['length','user-setting:','save','update','emit','user-setting:update:user-','register'];(function(_0x3bfe35,_0x244208){var _0x2121a7=function(_0xc0c309){while(--_0xc0c309){_0x3bfe35['push'](_0x3bfe35['shift']());}};_0x2121a7(++_0x244208);}(_0x6e7c,0x8e));var _0xc6e7=function(_0x3270f7,_0x4a28b7){_0x3270f7=_0x3270f7-0x0;var _0x189aa1=_0x6e7c[_0x3270f7];return _0x189aa1;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xc6e7('0x0'),'remove',_0xc6e7('0x1')];function createListener(_0x569751,_0x390114){return function(_0x417dd4){_0x390114[_0xc6e7('0x2')](_0x569751,_0x417dd4);if(_0x569751==='user-setting:update'){_0x390114[_0xc6e7('0x2')](_0xc6e7('0x3')+_0x417dd4['UserId'],_0x417dd4);}};}exports[_0xc6e7('0x4')]=function(_0x18b4a7){for(var _0x1a63bf=0x0,_0x21fb4e=events[_0xc6e7('0x5')];_0x1a63bf<_0x21fb4e;_0x1a63bf++){var _0x451e43=events[_0x1a63bf];var _0x3b5f77=createListener(_0xc6e7('0x6')+_0x451e43,_0x18b4a7);UserSettingEvents['on'](_0x451e43,_0x3b5f77);}};
\ No newline at end of file
index 97f43e5..01a89d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8829=['/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','/create_many','bulkCreate','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','/presence','getPresence','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions'];(function(_0xbe49b7,_0x5ae597){var _0x1c9ab3=function(_0x1ecd9c){while(--_0x1ecd9c){_0xbe49b7['push'](_0xbe49b7['shift']());}};_0x1c9ab3(++_0x5ae597);}(_0x8829,0x195));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9882('0x0'));var util=require('util');var path=require(_0x9882('0x1'));var timeout=require(_0x9882('0x2'));var express=require('express');var router=express[_0x9882('0x3')]();var fs_extra=require(_0x9882('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9882('0x5'));var config=require(_0x9882('0x6'));var controller=require(_0x9882('0x7'));router['get']('/',auth[_0x9882('0x8')](),controller[_0x9882('0x9')]);router[_0x9882('0xa')](_0x9882('0xb'),auth[_0x9882('0x8')](),controller[_0x9882('0xc')]);router['get'](_0x9882('0xd'),auth[_0x9882('0x8')](),controller['whoami']);router[_0x9882('0xa')](_0x9882('0xe'),auth['isAuthenticated'](),controller[_0x9882('0xf')]);router[_0x9882('0xa')]('/:id',auth[_0x9882('0x8')](),controller['show']);router[_0x9882('0xa')](_0x9882('0x10'),controller[_0x9882('0x11')]);router['get'](_0x9882('0x12'),auth[_0x9882('0x8')](),controller[_0x9882('0x13')]);router['get']('/:id/contacts',auth[_0x9882('0x8')](),controller['getContacts']);router[_0x9882('0xa')](_0x9882('0x14'),auth['isAuthenticated'](),controller[_0x9882('0x15')]);router[_0x9882('0xa')](_0x9882('0x16'),auth[_0x9882('0x8')](),controller['getVoiceQueuesRt']);router['get'](_0x9882('0x17'),auth[_0x9882('0x8')](),controller[_0x9882('0x18')]);router['get']('/:id/recordings',auth[_0x9882('0x8')](),controller[_0x9882('0x19')]);router[_0x9882('0xa')](_0x9882('0x1a'),auth[_0x9882('0x8')](),controller[_0x9882('0x1b')]);router[_0x9882('0xa')](_0x9882('0x1c'),auth[_0x9882('0x8')](),controller[_0x9882('0x1d')]);router['get']('/:id/openchannel/interactions',auth[_0x9882('0x8')](),controller[_0x9882('0x1e')]);router[_0x9882('0xa')](_0x9882('0x1f'),auth[_0x9882('0x8')](),controller['getMailInteractions']);router[_0x9882('0xa')](_0x9882('0x20'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x9882('0xa')](_0x9882('0x21'),auth[_0x9882('0x8')](),controller[_0x9882('0x22')]);router['get'](_0x9882('0x23'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x9882('0xa')](_0x9882('0x24'),auth[_0x9882('0x8')](),controller[_0x9882('0x25')]);router[_0x9882('0xa')](_0x9882('0x26'),auth[_0x9882('0x8')](),controller[_0x9882('0x27')]);router[_0x9882('0xa')]('/:id/agents',auth['isAuthenticated'](),controller[_0x9882('0x28')]);router[_0x9882('0xa')]('/:id/prefixes',auth[_0x9882('0x8')](),controller[_0x9882('0x29')]);router['get'](_0x9882('0x2a'),auth[_0x9882('0x8')](),controller[_0x9882('0x2b')]);router['get'](_0x9882('0x2c'),auth[_0x9882('0x8')](),controller[_0x9882('0x2d')]);router[_0x9882('0xa')](_0x9882('0x2e'),auth[_0x9882('0x8')](),controller[_0x9882('0x2f')]);router[_0x9882('0xa')](_0x9882('0x30'),auth['isAuthenticated'](),controller[_0x9882('0x31')]);router['get'](_0x9882('0x32'),auth['isAuthenticated'](),controller[_0x9882('0x33')]);router[_0x9882('0xa')](_0x9882('0x34'),auth[_0x9882('0x8')](),controller[_0x9882('0x35')]);router[_0x9882('0xa')](_0x9882('0x36'),auth[_0x9882('0x8')](),controller[_0x9882('0x37')]);router[_0x9882('0xa')](_0x9882('0x38'),auth[_0x9882('0x8')](),controller['getApiKey']);router[_0x9882('0x39')](_0x9882('0x3a'),auth['isAuthenticated'](),controller[_0x9882('0x3b')]);router[_0x9882('0x39')]('/',auth[_0x9882('0x8')](),controller['create']);router['post'](_0x9882('0x3c'),auth[_0x9882('0x8')](),controller[_0x9882('0x3d')]);router[_0x9882('0x39')](_0x9882('0x14'),auth[_0x9882('0x8')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56a688,_0x1eb78e,_0x579731){_0x579731(null,path['join'](config['root'],_0x9882('0x3e')));},'filename':function(_0x2fbd41,_0x3f6dfc,_0x192ce5){_0x192ce5(null,util[_0x9882('0x3f')](_0x9882('0x40'),Date['now'](),_0x3f6dfc[_0x9882('0x41')]));}})});router[_0x9882('0x39')]('/:id/avatar',upload[_0x9882('0x42')]('file'),controller[_0x9882('0x43')]);router[_0x9882('0x39')](_0x9882('0x44'),auth[_0x9882('0x8')](),controller[_0x9882('0x45')]);router[_0x9882('0x39')](_0x9882('0x46'),auth[_0x9882('0x8')](),controller[_0x9882('0x47')]);router['post'](_0x9882('0x48'),auth[_0x9882('0x8')](),controller['pause']);router[_0x9882('0x39')](_0x9882('0x49'),auth[_0x9882('0x8')](),controller['unpause']);router[_0x9882('0x39')](_0x9882('0x24'),auth[_0x9882('0x8')](),controller[_0x9882('0x4a')]);router['post']('/:id/chat_interactions',auth[_0x9882('0x8')](),controller['addChatInteractions']);router[_0x9882('0x39')](_0x9882('0x4b'),auth[_0x9882('0x8')](),controller[_0x9882('0x4c')]);router['post'](_0x9882('0x4d'),auth[_0x9882('0x8')](),controller[_0x9882('0x4e')]);router['post'](_0x9882('0x4f'),auth[_0x9882('0x8')](),controller[_0x9882('0x50')]);router[_0x9882('0x39')](_0x9882('0x51'),auth[_0x9882('0x8')](),controller['addOpenchannelInteractions']);router[_0x9882('0x39')](_0x9882('0x52'),auth[_0x9882('0x8')](),controller[_0x9882('0x53')]);router['post'](_0x9882('0x2a'),auth[_0x9882('0x8')](),controller[_0x9882('0x54')]);router[_0x9882('0x39')](_0x9882('0x2c'),auth['isAuthenticated'](),controller[_0x9882('0x55')]);router[_0x9882('0x39')](_0x9882('0x2e'),auth[_0x9882('0x8')](),controller[_0x9882('0x56')]);router[_0x9882('0x39')]('/:id/sms_accounts',auth[_0x9882('0x8')](),controller[_0x9882('0x57')]);router[_0x9882('0x39')](_0x9882('0x32'),auth['isAuthenticated'](),controller[_0x9882('0x58')]);router[_0x9882('0x39')](_0x9882('0x34'),auth['isAuthenticated'](),controller[_0x9882('0x59')]);router['post'](_0x9882('0x38'),auth[_0x9882('0x8')](),controller[_0x9882('0x5a')]);router[_0x9882('0x5b')](_0x9882('0x5c'),auth[_0x9882('0x8')](),controller['update']);router[_0x9882('0x5b')](_0x9882('0x5d'),auth[_0x9882('0x8')](),controller['changePassword']);router[_0x9882('0x5e')](_0x9882('0x14'),auth['isAuthenticated'](),controller[_0x9882('0x5f')]);router[_0x9882('0x5e')](_0x9882('0x24'),auth[_0x9882('0x8')](),controller[_0x9882('0x60')]);router[_0x9882('0x5e')](_0x9882('0x5c'),auth[_0x9882('0x8')](),controller[_0x9882('0x61')]);router['delete']('/:id/chat_interactions',auth[_0x9882('0x8')](),controller[_0x9882('0x62')]);router[_0x9882('0x5e')]('/:id/mail_interactions',auth[_0x9882('0x8')](),controller[_0x9882('0x63')]);router[_0x9882('0x5e')](_0x9882('0x4d'),auth[_0x9882('0x8')](),controller['removeFaxInteractions']);router[_0x9882('0x5e')](_0x9882('0x4f'),auth['isAuthenticated'](),controller[_0x9882('0x64')]);router[_0x9882('0x5e')](_0x9882('0x51'),auth[_0x9882('0x8')](),controller[_0x9882('0x65')]);router['delete'](_0x9882('0x52'),auth['isAuthenticated'](),controller[_0x9882('0x66')]);router[_0x9882('0x5e')](_0x9882('0x2a'),auth[_0x9882('0x8')](),controller[_0x9882('0x67')]);router[_0x9882('0x5e')](_0x9882('0x2c'),auth['isAuthenticated'](),controller[_0x9882('0x68')]);router['delete'](_0x9882('0x2e'),auth[_0x9882('0x8')](),controller[_0x9882('0x69')]);router[_0x9882('0x5e')]('/:id/sms_accounts',auth[_0x9882('0x8')](),controller[_0x9882('0x6a')]);router[_0x9882('0x5e')](_0x9882('0x32'),auth[_0x9882('0x8')](),controller[_0x9882('0x6b')]);router[_0x9882('0x5e')](_0x9882('0x34'),auth[_0x9882('0x8')](),controller['removeWhatsappAccounts']);router[_0x9882('0x5e')](_0x9882('0x38'),auth[_0x9882('0x8')](),controller['removeApiKey']);module[_0x9882('0x6c')]=router;
\ No newline at end of file
+var _0x6d8f=['addChatWebsites','/:id/api_key','createApiKey','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./user.controller','isAuthenticated','index','get','/describe','whoami','getPresence','/:id','show','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','post','addContacts','create','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6d8f,0xdf));var _0xf6d8=function(_0x1b65c6,_0x295b12){_0x1b65c6=_0x1b65c6-0x0;var _0x4ce2ae=_0x6d8f[_0x1b65c6];return _0x4ce2ae;};'use strict';var multer=require(_0xf6d8('0x0'));var util=require(_0xf6d8('0x1'));var path=require(_0xf6d8('0x2'));var timeout=require(_0xf6d8('0x3'));var express=require(_0xf6d8('0x4'));var router=express[_0xf6d8('0x5')]();var fs_extra=require(_0xf6d8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf6d8('0x7'));var config=require('../../config/environment');var controller=require(_0xf6d8('0x8'));router['get']('/',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0xa')]);router[_0xf6d8('0xb')](_0xf6d8('0xc'),auth[_0xf6d8('0x9')](),controller['describe']);router['get']('/whoami',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0xd')]);router[_0xf6d8('0xb')]('/presence',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0xe')]);router['get'](_0xf6d8('0xf'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x10')]);router[_0xf6d8('0xb')]('/:id/avatar',controller['getAvatar']);router['get']('/:id/open_tabs',auth[_0xf6d8('0x9')](),controller['getOpenTabs']);router[_0xf6d8('0xb')](_0xf6d8('0x11'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x12')]);router['get'](_0xf6d8('0x13'),auth['isAuthenticated'](),controller['getQueues']);router[_0xf6d8('0xb')]('/:id/queues_rt',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x14')]);router[_0xf6d8('0xb')](_0xf6d8('0x15'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x16')]);router[_0xf6d8('0xb')](_0xf6d8('0x17'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x18')]);router['get'](_0xf6d8('0x19'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x1a')]);router[_0xf6d8('0xb')]('/:id/chat/interactions',auth['isAuthenticated'](),controller['getChatInteractions']);router[_0xf6d8('0xb')](_0xf6d8('0x1b'),auth['isAuthenticated'](),controller[_0xf6d8('0x1c')]);router[_0xf6d8('0xb')]('/:id/mail/interactions',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x1d')]);router[_0xf6d8('0xb')](_0xf6d8('0x1e'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x1f')]);router['get'](_0xf6d8('0x20'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0xf6d8('0xb')]('/:id/whatsapp/interactions',auth[_0xf6d8('0x9')](),controller['getWhatsappInteractions']);router[_0xf6d8('0xb')](_0xf6d8('0x21'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x22')]);router[_0xf6d8('0xb')](_0xf6d8('0x23'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x24')]);router[_0xf6d8('0xb')](_0xf6d8('0x25'),auth[_0xf6d8('0x9')](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x26')]);router[_0xf6d8('0xb')](_0xf6d8('0x27'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x28')]);router[_0xf6d8('0xb')](_0xf6d8('0x29'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x2a')]);router[_0xf6d8('0xb')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xf6d8('0x2b')]);router[_0xf6d8('0xb')]('/:id/sms_accounts',auth[_0xf6d8('0x9')](),controller['getSmsAccounts']);router[_0xf6d8('0xb')](_0xf6d8('0x2c'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x2d')]);router['get'](_0xf6d8('0x2e'),auth['isAuthenticated'](),controller[_0xf6d8('0x2f')]);router[_0xf6d8('0xb')](_0xf6d8('0x30'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xf6d8('0xb')]('/:id/api_key',auth[_0xf6d8('0x9')](),controller['getApiKey']);router[_0xf6d8('0x31')]('/:id/contacts',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x32')]);router[_0xf6d8('0x31')]('/',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x33')]);router[_0xf6d8('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0xf6d8('0x34')]);router[_0xf6d8('0x31')](_0xf6d8('0x13'),auth[_0xf6d8('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xf6d8('0x35')]({'destination':function(_0xf758e2,_0x2f851a,_0x4ba339){_0x4ba339(null,path[_0xf6d8('0x36')](config[_0xf6d8('0x37')],_0xf6d8('0x38')));},'filename':function(_0x319b81,_0x7f259c,_0x49d03c){_0x49d03c(null,util[_0xf6d8('0x39')](_0xf6d8('0x3a'),Date['now'](),_0x7f259c[_0xf6d8('0x3b')]));}})});router[_0xf6d8('0x31')](_0xf6d8('0x3c'),upload['single'](_0xf6d8('0x3d')),controller[_0xf6d8('0x3e')]);router['post'](_0xf6d8('0x3f'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x40')]);router[_0xf6d8('0x31')](_0xf6d8('0x41'),auth[_0xf6d8('0x9')](),controller['logout']);router[_0xf6d8('0x31')](_0xf6d8('0x42'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x43')]);router['post'](_0xf6d8('0x44'),auth[_0xf6d8('0x9')](),controller['unpause']);router[_0xf6d8('0x31')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf6d8('0x45')]);router[_0xf6d8('0x31')](_0xf6d8('0x46'),auth['isAuthenticated'](),controller[_0xf6d8('0x47')]);router[_0xf6d8('0x31')](_0xf6d8('0x48'),auth['isAuthenticated'](),controller[_0xf6d8('0x49')]);router[_0xf6d8('0x31')](_0xf6d8('0x4a'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x4b')]);router[_0xf6d8('0x31')](_0xf6d8('0x4c'),auth[_0xf6d8('0x9')](),controller['addSmsInteractions']);router[_0xf6d8('0x31')](_0xf6d8('0x4d'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x4e')]);router['post'](_0xf6d8('0x4f'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xf6d8('0x31')](_0xf6d8('0x27'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x50')]);router[_0xf6d8('0x31')]('/:id/mail_accounts',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x51')]);router[_0xf6d8('0x31')](_0xf6d8('0x52'),auth['isAuthenticated'](),controller[_0xf6d8('0x53')]);router[_0xf6d8('0x31')](_0xf6d8('0x54'),auth['isAuthenticated'](),controller[_0xf6d8('0x55')]);router['post'](_0xf6d8('0x2c'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x56')]);router[_0xf6d8('0x31')](_0xf6d8('0x2e'),auth[_0xf6d8('0x9')](),controller['addWhatsappAccounts']);router[_0xf6d8('0x31')](_0xf6d8('0x57'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x58')]);router['put']('/:id',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x59')]);router['put'](_0xf6d8('0x5a'),auth[_0xf6d8('0x9')](),controller['changePassword']);router[_0xf6d8('0x5b')]('/:id/queues',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x5c')]);router[_0xf6d8('0x5b')]('/:id/teams',auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x5d')]);router[_0xf6d8('0x5b')](_0xf6d8('0xf'),auth['isAuthenticated'](),controller[_0xf6d8('0x5e')]);router[_0xf6d8('0x5b')](_0xf6d8('0x46'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0xf6d8('0x5b')](_0xf6d8('0x48'),auth['isAuthenticated'](),controller[_0xf6d8('0x5f')]);router[_0xf6d8('0x5b')](_0xf6d8('0x4a'),auth[_0xf6d8('0x9')](),controller['removeFaxInteractions']);router[_0xf6d8('0x5b')](_0xf6d8('0x4c'),auth['isAuthenticated'](),controller[_0xf6d8('0x60')]);router[_0xf6d8('0x5b')]('/:id/openchannel_interactions',auth[_0xf6d8('0x9')](),controller['removeOpenchannelInteractions']);router[_0xf6d8('0x5b')](_0xf6d8('0x4f'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete'](_0xf6d8('0x27'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x61')]);router[_0xf6d8('0x5b')](_0xf6d8('0x29'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x62')]);router[_0xf6d8('0x5b')](_0xf6d8('0x52'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x63')]);router[_0xf6d8('0x5b')](_0xf6d8('0x54'),auth[_0xf6d8('0x9')](),controller['removeSmsAccounts']);router['delete'](_0xf6d8('0x2c'),auth['isAuthenticated'](),controller[_0xf6d8('0x64')]);router[_0xf6d8('0x5b')](_0xf6d8('0x2e'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x65')]);router['delete'](_0xf6d8('0x57'),auth[_0xf6d8('0x9')](),controller[_0xf6d8('0x66')]);module['exports']=router;
\ No newline at end of file
index 1821c73..73a341d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x40e469,_0x54db28){var _0x10f0ff=function(_0x13d485){while(--_0x13d485){_0x40e469['push'](_0x40e469['shift']());}};_0x10f0ff(++_0x54db28);}(_0x70e0,0x17b));var _0x070e=function(_0x2b359d,_0x319dde){_0x2b359d=_0x2b359d-0x0;var _0x159328=_0x70e0[_0x2b359d];return _0x159328;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x27b419,_0x2ef16d){var _0x4a4ec3=function(_0x4efd54){while(--_0x4efd54){_0x27b419['push'](_0x27b419['shift']());}};_0x4a4ec3(++_0x2ef16d);}(_0x34e8,0x12c));var _0x834e=function(_0xab2645,_0x52b939){_0xab2645=_0xab2645-0x0;var _0x551249=_0x34e8[_0xab2645];return _0x551249;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}};
\ No newline at end of file
index 5ed12f6..88b50f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09b7=['$contained','$any','firstName','lastName','Contact','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','getUserSetting','teams','queues','flatten','lower','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','pause','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','select','ui.','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','moment','util','path','lodash','jayson/promise','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../errors/api','handleError','socket.io-emitter','redis','./user.socket','register','defaults','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','update','role','agent','emit','userNotification:recalc:','destroy','admin','Users','user','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','end','send','index','User','fieldName','type','password','getOptions','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','openchannel','all','show','params','model','keys','salt','filters','intersection','fields','options','fax','mail','body','describe','addContacts','ids','internal','Setting','securePassword','validatePasswordPattern','max','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','106','107','100','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Agents','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','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','removeQueues','isValidChannel','isArray','Queue:remove','voice','addAvatar','userpic','getAvatar','join','download','existsSync','server/files/images/','root','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getQueues','Queue','merge','Unknown\x20role','nolimit','get','rawAttributes','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','bulkCreate','isMiddleware','resolve','logout','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','sequelize','transaction','getAssociatedQueues','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','getLists','getAgents','values','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','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','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','getWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$gte','$lt','$lte','$ne','$not','$between','$in','$notIn','$like','$iLike','$overlap','$contains'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x09b7,0x1bd));var _0x709b=function(_0x40124e,_0x47920b){_0x40124e=_0x40124e-0x0;var _0x2e8dc2=_0x09b7[_0x40124e];return _0x2e8dc2;};'use strict';var moment=require(_0x709b('0x0'));var util=require(_0x709b('0x1'));var path=require(_0x709b('0x2'));var fs=require('fs');var _=require(_0x709b('0x3'));var squel=require('squel');var jayson=require(_0x709b('0x4'));var Redis=require('ioredis');var authService=require(_0x709b('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x709b('0x6'))('api');var utils=require('../../config/utils');var config=require(_0x709b('0x7'));var licenseUtil=require(_0x709b('0x8'));var APIBadRequestError=require(_0x709b('0x9'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x709b('0x9'))[_0x709b('0xa')];var db=require('../../mysqldb')['db'];var socket=require(_0x709b('0xb'))(new Redis(config[_0x709b('0xc')]));require(_0x709b('0xd'))[_0x709b('0xe')](socket);config[_0x709b('0xc')]=_[_0x709b('0xf')](config[_0x709b('0xc')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x709b('0x10')][_0x709b('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x20d2f5,_0x175bed,_0x12aa09,_0x388ac6){return new Promise(function(_0xd91d8c,_0x40252e){var _0x3cca29=_0x388ac6||amiClient;return _0x3cca29[_0x709b('0x12')](_0x20d2f5,_0x12aa09)[_0x709b('0x13')](function(_0x203ad2){logger[_0x709b('0x14')](_0x709b('0x15'),_0x175bed,_0x709b('0x16'));logger[_0x709b('0x17')](_0x709b('0x18'),_0x175bed,_0x709b('0x16'),JSON[_0x709b('0x19')](_0x203ad2));if(_0x203ad2[_0x709b('0x1a')]){if(_0x203ad2[_0x709b('0x1a')]['code']===0x1f4){logger[_0x709b('0x1a')](_0x709b('0x15'),_0x175bed,_0x203ad2['error'][_0x709b('0x1b')]);return _0x40252e(_0x203ad2[_0x709b('0x1a')][_0x709b('0x1b')]);}logger['error'](_0x709b('0x15'),_0x175bed,_0x203ad2[_0x709b('0x1a')][_0x709b('0x1b')]);return _0xd91d8c(_0x203ad2[_0x709b('0x1a')]['message']);}else{logger[_0x709b('0x14')](_0x709b('0x15'),_0x175bed,_0x709b('0x16'));_0xd91d8c(_0x203ad2[_0x709b('0x1c')][_0x709b('0x1b')]);}})[_0x709b('0x1d')](function(_0x3ac30b){logger[_0x709b('0x1a')](_0x709b('0x15'),_0x175bed,_0x3ac30b);_0x40252e(_0x3ac30b);});});}function respondWithStatusCode(_0x3acc49,_0x605663){_0x605663=_0x605663||0xcc;return function(_0x297947){if(_0x297947){return _0x3acc49[_0x709b('0x1e')](_0x605663);}return _0x3acc49[_0x709b('0x1f')](_0x605663)['end']();};}function respondWithResult(_0x14af51,_0x48418a){_0x48418a=_0x48418a||0xc8;return function(_0x54f644){if(_0x54f644){return _0x14af51[_0x709b('0x1f')](_0x48418a)[_0x709b('0x20')](_0x54f644);}};}function respondWithFilteredResult(_0x252289,_0x22b199){return function(_0x342962){if(_0x342962){var _0xfde951=typeof _0x22b199['offset']===_0x709b('0x21')&&typeof _0x22b199[_0x709b('0x22')]==='undefined';var _0x378d28=_0x342962[_0x709b('0x23')];var _0x36aa87=_0xfde951?0x0:_0x22b199[_0x709b('0x24')];var _0x4fb019=_0xfde951?_0x342962[_0x709b('0x23')]:_0x22b199[_0x709b('0x24')]+_0x22b199['limit'];var _0x9c0d23;if(_0x4fb019>=_0x378d28){_0x4fb019=_0x378d28;_0x9c0d23=0xc8;}else{_0x9c0d23=0xce;}_0x252289[_0x709b('0x1f')](_0x9c0d23);return _0x252289[_0x709b('0x25')]('Content-Range',_0x36aa87+'-'+_0x4fb019+'/'+_0x378d28)[_0x709b('0x20')](_0x342962);}return null;};}function saveUpdates(_0x224a15){return function(_0x2928ba){if(_0x2928ba){return _0x2928ba[_0x709b('0x26')](_0x224a15)[_0x709b('0x13')](function(_0x3abd6b){if(_0x3abd6b[_0x709b('0x27')]===_0x709b('0x28')){socket[_0x709b('0x29')](_0x709b('0x2a')+_0x3abd6b['id'],_0x3abd6b);}return _0x3abd6b;});}return null;};}function removeEntity(_0x3b9a7a){return function(_0x305950){if(_0x305950){return _0x305950[_0x709b('0x2b')]()[_0x709b('0x13')](function(){var _0x2e0ae5=_0x305950['get']({'plain':!![]});if(_0x2e0ae5['role']===_0x709b('0x2c'))return;var _0x38b9e6=[{'name':_0x709b('0x2d'),'value':_0x709b('0x2e'),'ignore':!![]},{'name':'Agents','value':_0x709b('0x28'),'ignore':![]},{'name':_0x709b('0x2f'),'value':_0x709b('0x30'),'ignore':![]}];var _0x4d949b=_(_0x38b9e6)[_0x709b('0x31')](_0x709b('0x32'))[_0x709b('0x33')](_0x709b('0x34'))[_0x709b('0x34')]();if(_[_0x709b('0x35')](_0x4d949b,_0x2e0ae5[_0x709b('0x27')])){return;}var _0x120f3d=_[_0x709b('0x36')](_0x38b9e6,[_0x709b('0x34'),_0x2e0ae5['role']])[_0x709b('0x37')];return db[_0x709b('0x38')][_0x709b('0x2b')]({'where':{'type':_0x120f3d,'resourceId':_0x2e0ae5['id']}})['then'](function(){return _0x305950;});})[_0x709b('0x13')](function(){_0x3b9a7a['status'](0xcc)[_0x709b('0x39')]();});}};}function handleEntityNotFound(_0x5c6b43){return function(_0x189c02){if(!_0x189c02){_0x5c6b43['sendStatus'](0x194);}return _0x189c02;};}function handleError(_0x467232,_0x4356eb){_0x4356eb=_0x4356eb||0x1f4;return function(_0x3d66e4){logger[_0x709b('0x1a')](_0x3d66e4['stack']);if(_0x3d66e4[_0x709b('0x37')]){delete _0x3d66e4[_0x709b('0x37')];}_0x467232[_0x709b('0x1f')](_0x4356eb)[_0x709b('0x3a')](_0x3d66e4);};}exports[_0x709b('0x3b')]=function(_0x1a442b,_0x6794bc){var _0x26e03f={},_0x4f60cb={'count':0x0,'rows':[]};var _0x55f96d=_(db[_0x709b('0x3c')]['rawAttributes'])['map'](function(_0x3f0614){return{'name':_0x3f0614[_0x709b('0x3d')],'type':_0x3f0614[_0x709b('0x3e')]['key']};})[_0x709b('0x31')](function(_0xec380e){return!_[_0x709b('0x35')]([_0x709b('0x3f'),'salt'],_0xec380e['name']);})[_0x709b('0x34')]();_0x26e03f=qs[_0x709b('0x40')](_0x55f96d,_0x1a442b);var _0x511e52={'where':_0x26e03f[_0x709b('0x41')]};return db[_0x709b('0x3c')][_0x709b('0x23')](_0x511e52)[_0x709b('0x13')](function(_0x1c7f07){_0x4f60cb[_0x709b('0x23')]=_0x1c7f07;if(_0x1a442b[_0x709b('0x42')][_0x709b('0x43')]){_0x26e03f[_0x709b('0x44')]=[{'all':!![]}];}if(_0x1a442b[_0x709b('0x42')][_0x709b('0x45')]===_0x709b('0x46')){_0x26e03f[_0x709b('0x44')]=[{'model':db[_0x709b('0x47')],'as':'userSetting'}];}if(!_[_0x709b('0x35')](_0x26e03f[_0x709b('0x48')],'id')){_0x26e03f[_0x709b('0x48')][_0x709b('0x49')]('id');}return db['User'][_0x709b('0x4a')](_0x26e03f);})[_0x709b('0x13')](function(_0x1477d1){_0x4f60cb[_0x709b('0x4b')]=_0x1477d1;if(_0x1a442b[_0x709b('0x42')][_0x709b('0x4c')]==='true'){var _0x199d20=[];for(var _0x472053=0x0;_0x472053<_0x4f60cb[_0x709b('0x4b')][_0x709b('0x4d')];_0x472053++){_0x199d20[_0x709b('0x49')](get_open_tabs(_0x709b('0x4e'),_0x4f60cb[_0x709b('0x4b')][_0x472053][_0x709b('0x4f')]));_0x199d20[_0x709b('0x49')](get_open_tabs(_0x709b('0x50'),_0x4f60cb[_0x709b('0x4b')][_0x472053][_0x709b('0x4f')]));_0x199d20['push'](get_open_tabs('fax',_0x4f60cb[_0x709b('0x4b')][_0x472053][_0x709b('0x4f')]));_0x199d20[_0x709b('0x49')](get_open_tabs('mail',_0x4f60cb[_0x709b('0x4b')][_0x472053][_0x709b('0x4f')]));_0x199d20[_0x709b('0x49')](get_open_tabs(_0x709b('0x51'),_0x4f60cb[_0x709b('0x4b')][_0x472053][_0x709b('0x4f')]));_0x199d20[_0x709b('0x49')](get_open_tabs('whatsapp',_0x4f60cb['rows'][_0x472053][_0x709b('0x4f')]));}return Promise[_0x709b('0x52')](_0x199d20)['then'](function(){return _0x4f60cb;});}else{return _0x4f60cb;}})[_0x709b('0x13')](respondWithFilteredResult(_0x6794bc,_0x26e03f))[_0x709b('0x1d')](handleError(_0x6794bc,null));};exports[_0x709b('0x53')]=function(_0x51879b,_0xb2df19){var _0xdd541d={'raw':![],'where':{'id':_0x51879b[_0x709b('0x54')]['id']}},_0x100a20={};_0x100a20[_0x709b('0x55')]=_['differenceBy'](_[_0x709b('0x56')](db[_0x709b('0x3c')]['rawAttributes']),['password',_0x709b('0x57')]);_0x100a20[_0x709b('0x42')]=_[_0x709b('0x56')](_0x51879b[_0x709b('0x42')]);_0x100a20[_0x709b('0x58')]=_[_0x709b('0x59')](_0x100a20[_0x709b('0x55')],_0x100a20[_0x709b('0x42')]);_0xdd541d[_0x709b('0x48')]=_[_0x709b('0x59')](_0x100a20[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x51879b[_0x709b('0x42')]['fields']));_0xdd541d[_0x709b('0x48')]=_0xdd541d[_0x709b('0x48')]['length']?_0xdd541d[_0x709b('0x48')]:_0x100a20[_0x709b('0x55')];if(_0x51879b[_0x709b('0x42')][_0x709b('0x43')]){_0xdd541d['include']=[{'all':!![]}];}if(_0x51879b[_0x709b('0x42')][_0x709b('0x45')]==='true'){_0xdd541d[_0x709b('0x44')]=[{'model':db[_0x709b('0x47')],'as':_0x709b('0x45')}];}_0xdd541d=_['merge']({},_0xdd541d,_0x51879b[_0x709b('0x5b')]);if(!_['includes'](_0xdd541d[_0x709b('0x48')],'id')){_0xdd541d[_0x709b('0x48')][_0x709b('0x49')]('id');}return db[_0x709b('0x3c')]['find'](_0xdd541d)[_0x709b('0x13')](handleEntityNotFound(_0xb2df19,null))['then'](function(_0x5a4fbb){var _0x56be21=[];values=_0x5a4fbb;if(_0x51879b[_0x709b('0x42')]['openTabs']===_0x709b('0x46')){_0x56be21[_0x709b('0x49')](get_open_tabs('chat',_0x5a4fbb['dataValues']));_0x56be21['push'](get_open_tabs(_0x709b('0x50'),_0x5a4fbb[_0x709b('0x4f')]));_0x56be21['push'](get_open_tabs(_0x709b('0x51'),_0x5a4fbb[_0x709b('0x4f')]));_0x56be21[_0x709b('0x49')](get_open_tabs('whatsapp',_0x5a4fbb[_0x709b('0x4f')]));_0x56be21[_0x709b('0x49')](get_open_tabs(_0x709b('0x5c'),_0x5a4fbb[_0x709b('0x4f')]));_0x56be21[_0x709b('0x49')](get_open_tabs(_0x709b('0x5d'),_0x5a4fbb[_0x709b('0x4f')]));return Promise[_0x709b('0x52')](_0x56be21);}else{return values;}})['then'](function(){return values;})[_0x709b('0x13')](respondWithResult(_0xb2df19,null))[_0x709b('0x1d')](handleError(_0xb2df19,null));};exports[_0x709b('0x26')]=function(_0x48664e,_0x15b347){if(_0x48664e[_0x709b('0x5e')]['id']){delete _0x48664e[_0x709b('0x5e')]['id'];}delete _0x48664e[_0x709b('0x5e')]['role'];return db[_0x709b('0x3c')]['find']({'where':{'id':_0x48664e['params']['id']}})['then'](handleEntityNotFound(_0x15b347,null))[_0x709b('0x13')](saveUpdates(_0x48664e[_0x709b('0x5e')],null))[_0x709b('0x13')](respondWithResult(_0x15b347,null))[_0x709b('0x1d')](handleError(_0x15b347,null));};exports[_0x709b('0x5f')]=function(_0x2c7693,_0x2de3c7){return db[_0x709b('0x3c')][_0x709b('0x5f')]()[_0x709b('0x13')](respondWithResult(_0x2de3c7,null))['catch'](handleError(_0x2de3c7,null));};exports[_0x709b('0x60')]=function(_0x4cce60,_0xb70c33){return db[_0x709b('0x3c')]['find']({'where':{'id':_0x4cce60[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xb70c33,null))[_0x709b('0x13')](function(_0x4a18f2){if(_0x4a18f2){return _0x4a18f2[_0x709b('0x60')](_0x4cce60[_0x709b('0x5e')][_0x709b('0x61')],_['omit'](_0x4cce60['body'],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0xb70c33,null))[_0x709b('0x1d')](handleError(_0xb70c33,null));};function validateUser(_0x2266c0){return new Promise(function(_0x163fd3,_0x3bd27e){if(_0x2266c0[_0x709b('0x62')])return _0x163fd3(_0x2266c0);return db[_0x709b('0x63')]['findById'](0x1)[_0x709b('0x13')](function(_0x4e3215){if(_0x4e3215[_0x709b('0x64')])authService[_0x709b('0x65')](_0x2266c0['password']);db[_0x709b('0x3c')][_0x709b('0x66')](_0x709b('0x62'))[_0x709b('0x13')](function(_0x409dda){if(_[_0x709b('0x67')](_0x409dda)){_0x2266c0[_0x709b('0x62')]=_0x4e3215['min_internal']||0x1;return;}if(_[_0x709b('0x67')](_0x4e3215[_0x709b('0x68')])||_0x4e3215['min_internal']===_0x409dda){_0x2266c0[_0x709b('0x62')]=_0x409dda+0x1;return;}if(_0x4e3215[_0x709b('0x68')]>_0x409dda){_0x2266c0[_0x709b('0x62')]=_0x4e3215[_0x709b('0x68')];return;}return db['sequelize'][_0x709b('0x42')](_0x709b('0x69'),{'type':db['sequelize'][_0x709b('0x6a')][_0x709b('0x6b')]})[_0x709b('0x13')](function(_0x2087e6){if(_0x2087e6&&_0x2087e6[_0x709b('0x4d')]){for(var _0x902831=0x0,_0x56cdf5=_0x2087e6[_0x709b('0x4d')];_0x902831<_0x56cdf5&&_[_0x709b('0x67')](_0x2266c0[_0x709b('0x62')]);_0x902831++){if(_0x4e3215['min_internal']<=_0x2087e6[_0x902831]['from']){_0x2266c0[_0x709b('0x62')]=_0x2087e6[_0x902831]['from'];}else if(_0x4e3215['min_internal']>_0x2087e6[_0x902831][_0x709b('0x6c')]&&_0x4e3215[_0x709b('0x68')]<=_0x2087e6[_0x902831]['to']){_0x2266c0[_0x709b('0x62')]=_0x4e3215['min_internal'];}}}if(_[_0x709b('0x67')](_0x2266c0[_0x709b('0x62')])){_0x2266c0['internal']=_0x409dda+0x1;}return _0x163fd3(_0x2266c0);});});})[_0x709b('0x1d')](function(_0x3f76f6){_0x3bd27e(_0x3f76f6);});});}function updateUser(_0xcb907a){return new Promise(function(_0xbec48,_0x1b9e9c){try{if(_0xcb907a[_0x709b('0x6d')]){_0xcb907a[_0x709b('0x6e')]=_0xcb907a[_0x709b('0x62')];_0xcb907a[_0x709b('0x6f')]={'mailbox':_0xcb907a[_0x709b('0x62')],'password':_0xcb907a[_0x709b('0x3f')],'fullname':_0xcb907a[_0x709b('0x70')],'email':_0xcb907a[_0x709b('0x71')]};}if(_0xcb907a[_0x709b('0x27')]===_0x709b('0x28')){if(!_0xcb907a[_0x709b('0x72')])_0xcb907a[_0x709b('0x72')]=[_0x709b('0x73'),_0x709b('0x74'),_0x709b('0x75'),_0x709b('0x76'),_0x709b('0x77'),_0x709b('0x78'),_0x709b('0x79'),_0x709b('0x7a'),_0x709b('0x7b'),'108','109',_0x709b('0x7c'),_0x709b('0x7d'),_0x709b('0x7e'),_0x709b('0x7f')];}_0xbec48(_0xcb907a);}catch(_0xc31ee9){_0x1b9e9c(_0xc31ee9);}});}exports['create']=function(_0x218dfc,_0x3f38fa){if(_0x218dfc[_0x709b('0x2e')][_0x709b('0x27')]===_0x709b('0x28'))throw new Error(_0x709b('0x80'));if(_0x218dfc[_0x709b('0x5e')][_0x709b('0x27')]===_0x709b('0x2e')&&_0x218dfc[_0x709b('0x2e')]['role']!==_0x709b('0x2c')){throw new Error(_0x709b('0x81'));}if(_0x218dfc[_0x709b('0x5e')][_0x709b('0x27')]===_0x709b('0x2c')&&_0x218dfc[_0x709b('0x2e')][_0x709b('0x27')]!==_0x709b('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x709b('0x82')]([_0x218dfc[_0x709b('0x5e')]])['then'](function(){return validateUser(_0x218dfc['body']);})[_0x709b('0x13')](function(_0x125c26){return updateUser(_0x125c26)['then'](function(_0x175afc){if(_0x175afc[_0x709b('0x27')]==='admin'){_0x175afc['settingsEnabled']=_0x218dfc[_0x709b('0x2e')][_0x709b('0x83')];delete _0x175afc[_0x709b('0x84')];}return _0x175afc;});})[_0x709b('0x13')](function(_0x1c4500){return db['User'][_0x709b('0x85')](_0x1c4500,{'include':[{'model':db[_0x709b('0x6f')],'as':_0x709b('0x6f')}]});})[_0x709b('0x13')](function(_0x2edfca){if(_0x218dfc[_0x709b('0x5e')][_0x709b('0x27')]===_0x709b('0x2e'))return _0x2edfca;if(_0x218dfc[_0x709b('0x2e')][_0x709b('0x27')]!=='user')return _0x2edfca;return db[_0x709b('0x86')]['find']({'where':{'name':_0x2edfca[_0x709b('0x27')]===_0x709b('0x28')?_0x709b('0x87'):_0x709b('0x2f'),'userProfileId':_0x218dfc[_0x709b('0x2e')][_0x709b('0x84')]},'raw':!![]})['then'](function(_0x49b2f9){if(!_0x49b2f9||_0x49b2f9[_0x709b('0x88')]!=0x0)return _0x2edfca;return db[_0x709b('0x38')][_0x709b('0x85')]({'name':_0x2edfca[_0x709b('0x37')],'resourceId':_0x2edfca['id'],'type':_0x49b2f9['name'],'sectionId':_0x49b2f9['id']},{})[_0x709b('0x13')](function(){return _0x2edfca;});})[_0x709b('0x1d')](function(_0x2e0d10){logger['error'](_0x709b('0x89'),_0x2e0d10);throw _0x2e0d10;});})[_0x709b('0x13')](respondWithResult(_0x3f38fa,0xc9))['catch'](handleError(_0x3f38fa,null));};exports['bulkCreate']=function(_0xc7402d,_0x5e684a){var _0x55543d=_0xc7402d[_0x709b('0x5e')];var _0x4a8fac=[];if(_0xc7402d[_0x709b('0x2e')][_0x709b('0x27')]==='agent')throw new Error(_0x709b('0x80'));if(_[_0x709b('0x8a')](_0x55543d,[_0x709b('0x27'),_0x709b('0x2e')])&&_0xc7402d[_0x709b('0x2e')]['role']!==_0x709b('0x2c')){throw new Error(_0x709b('0x81'));}if(_[_0x709b('0x8a')](_0x55543d,[_0x709b('0x27'),'admin'])&&_0xc7402d[_0x709b('0x2e')][_0x709b('0x27')]!=='admin'){throw new Error(_0x709b('0x8b'));}return licenseUtil[_0x709b('0x82')](_0x55543d)[_0x709b('0x13')](function(){return validateUser(_0x55543d[0x0]);})[_0x709b('0x13')](function(){for(var _0x361e1a=0x1;_0x361e1a<_0x55543d[_0x709b('0x4d')];_0x361e1a++){var _0x4108f0=_0x55543d[_0x361e1a-0x1][_0x709b('0x62')];if(!_0x55543d[_0x361e1a][_0x709b('0x62')])_0x55543d[_0x361e1a][_0x709b('0x62')]=_0x4108f0+0x1;_0x4a8fac[_0x709b('0x49')](validateUser(_0x55543d[_0x361e1a]));}return Promise[_0x709b('0x52')](_0x4a8fac);})[_0x709b('0x13')](function(){_0x4a8fac=[];for(var _0x212013=0x0;_0x212013<_0x55543d['length'];_0x212013++){_0x4a8fac['push'](updateUser(_0x55543d[_0x212013]));}return Promise[_0x709b('0x52')](_0x4a8fac);})['then'](function(){_0x4a8fac=_0x55543d[_0x709b('0x33')](function(_0x5879eb){return db[_0x709b('0x3c')]['create'](_0x5879eb,{'include':[{'model':db[_0x709b('0x6f')],'as':_0x709b('0x6f')}]})['then'](function(_0xfae1e1){_0x5879eb['id']=_0xfae1e1['id'];return _0x5879eb;});});return Promise[_0x709b('0x52')](_0x4a8fac);})[_0x709b('0x13')](function(_0x17c9dc){if(_0xc7402d[_0x709b('0x5e')][_0x709b('0x27')]===_0x709b('0x2e'))return _0x17c9dc;if(_0xc7402d[_0x709b('0x2e')]['role']!=='user')return _0x17c9dc;var _0x437f7f=_['some'](_0x17c9dc,function(_0x1bdbcb){return _0x1bdbcb[_0x709b('0x27')]==='agent'||_0x1bdbcb[_0x709b('0x27')]===_0x709b('0x30');});if(!_0x437f7f)return _0x17c9dc;return db[_0x709b('0x86')][_0x709b('0x4a')]({'where':{'name':{'$or':[_0x709b('0x87'),_0x709b('0x2f')]},'userProfileId':_0xc7402d[_0x709b('0x2e')][_0x709b('0x84')]},'raw':!![]})[_0x709b('0x13')](function(_0x2ac7ea){if(_[_0x709b('0x8c')](_0x2ac7ea)||!_[_0x709b('0x8a')](_0x2ac7ea,['autoAssociation',0x0]))return _0x17c9dc;_0x4a8fac=[];var _0x57cbfb=_(_0x2ac7ea)[_0x709b('0x33')](function(_0x5778be){if(_0x5778be[_0x709b('0x88')]===0x1)return;return _0x5778be['name']==='Agents'?_0x709b('0x28'):_0x709b('0x30');})[_0x709b('0x8d')]()[_0x709b('0x34')]();for(var _0x3df219=0x0;_0x3df219<_0x17c9dc[_0x709b('0x4d')];_0x3df219++){if(!_[_0x709b('0x35')](_0x57cbfb,_0x17c9dc[_0x3df219][_0x709b('0x27')]))return;var _0xa8bf20=_0x17c9dc[_0x3df219][_0x709b('0x27')]==='agent'?_0x709b('0x87'):_0x709b('0x2f');_0x4a8fac[_0x709b('0x49')](db[_0x709b('0x38')][_0x709b('0x85')]({'name':_0x17c9dc[_0x3df219][_0x709b('0x37')],'resourceId':_0x17c9dc[_0x3df219]['id'],'type':_0xa8bf20,'sectionId':_[_0x709b('0x36')](_0x2ac7ea,[_0x709b('0x37'),_0xa8bf20])['id']},{}));}return Promise[_0x709b('0x52')](_0x4a8fac);});})[_0x709b('0x13')](respondWithResult(_0x5e684a,0xc9))[_0x709b('0x1d')](handleError(_0x5e684a,null));};exports[_0x709b('0x8e')]=function(_0x270b23,_0xce1e9b){if(_0x270b23['body']['id']){delete _0x270b23[_0x709b('0x5e')]['id'];}return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x270b23[_0x709b('0x54')]['id']}})[_0x709b('0x13')](function(_0x48bb99){if(!_0x48bb99)return null;if(_0x48bb99['id']===_0x270b23[_0x709b('0x2e')]['id']){if(!_0x270b23['body'][_0x709b('0x8f')]||!_0x270b23[_0x709b('0x5e')][_0x709b('0x90')]){throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0x93'));}if(!_0x48bb99[_0x709b('0x94')](_0x270b23[_0x709b('0x5e')][_0x709b('0x8f')])){throw new db['Sequelize'][(_0x709b('0x92'))](_0x709b('0x95'));}if(_0x270b23[_0x709b('0x5e')][_0x709b('0x8f')]===_0x270b23[_0x709b('0x5e')]['newPassword']){throw new db['Sequelize'][(_0x709b('0x92'))](_0x709b('0x96'));}}else if(_0x270b23[_0x709b('0x2e')][_0x709b('0x27')]===_0x709b('0x2c')){if(!_0x270b23[_0x709b('0x5e')][_0x709b('0x90')]){throw new db[(_0x709b('0x91'))]['ValidationError'](_0x709b('0x97'));}}else if(_0x270b23[_0x709b('0x2e')][_0x709b('0x27')]===_0x709b('0x2e')){if(!_0x270b23['body'][_0x709b('0x90')]){throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0x97'));}if(_0x48bb99[_0x709b('0x27')]!=='agent'){throw new db[(_0x709b('0x91'))]['ValidationError'](_0x709b('0x80'));}}else{throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0x80'));}return _0x48bb99;})['then'](handleEntityNotFound(_0xce1e9b,null))[_0x709b('0x13')](function(_0x2e75e0){return db[_0x709b('0x63')][_0x709b('0x98')]({'attributes':['id',_0x709b('0x64'),_0x709b('0x99'),_0x709b('0x9a')]})['then'](function(_0x3fe83e){if(_0x3fe83e['securePassword'])authService[_0x709b('0x65')](_0x270b23[_0x709b('0x5e')][_0x709b('0x90')]);if(!_0x3fe83e[_0x709b('0x99')]||!_0x2e75e0[_0x709b('0x9b')])return _0x2e75e0;authService['validatePasswordHistory'](_0x270b23[_0x709b('0x5e')][_0x709b('0x90')],_0x2e75e0[_0x709b('0x9b')],_0x3fe83e[_0x709b('0x9a')]);return _0x2e75e0;})['then'](saveUpdates({'password':_0x270b23[_0x709b('0x5e')][_0x709b('0x90')],'passwordResetAt':_0x270b23['user']['id']==_0x270b23[_0x709b('0x54')]['id']?moment():null,'previousPasswords':authService[_0x709b('0x9c')](_0x270b23[_0x709b('0x5e')][_0x709b('0x90')],_0x2e75e0[_0x709b('0x9b')])},null));})[_0x709b('0x13')](respondWithResult(_0xce1e9b,null))['catch'](handleError(_0xce1e9b,null));};exports['addQueues']=function(_0x158241,_0x43934c){var _0xf0aeac=_0x158241[_0x709b('0x5e')][_0x709b('0x9d')];return db['User'][_0x709b('0x36')]({'where':{'id':_0x158241[_0x709b('0x54')]['id']},'attributes':['id',_0x709b('0x37'),_0x709b('0x27'),_0x709b('0x9e'),_0x709b('0x9f'),_0x709b('0xa0'),_0x709b('0xa1')]})[_0x709b('0x13')](handleEntityNotFound(_0x43934c,null))[_0x709b('0x13')](function(_0x124b96){if(_0x124b96){if(!utils['isValidChannel'](_0xf0aeac)){throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0xa2'));}return _0x124b96[_0x709b('0xa3')+_[_0x709b('0xa4')](_0xf0aeac[_0x709b('0xa5')]())+_0x709b('0xa6')](_0x158241['body'][_0x709b('0x61')],{'penalty':_0x158241[_0x709b('0x5e')][_0x709b('0xa7')]||0x0})[_0x709b('0xa8')](function(_0x4db6fb){for(var _0x5259ed=0x0;_0x5259ed<_0x158241[_0x709b('0x5e')]['ids'][_0x709b('0x4d')];_0x5259ed+=0x1){var _0x3d528f={'UserId':Number(_0x158241[_0x709b('0x54')]['id'])};_0x3d528f[_[_0x709b('0xa4')](_0xf0aeac[_0x709b('0xa5')]())+_0x709b('0xa9')]=Number(_0x158241[_0x709b('0x5e')][_0x709b('0x61')][_0x5259ed]);socket['emit'](_0x709b('0x2e')+_['capitalize'](_0xf0aeac[_0x709b('0xa5')]())+_0x709b('0xaa'),_0x3d528f);}return _0x4db6fb;})[_0x709b('0x13')](function(){if(_0xf0aeac==='voice'){return db[_0x709b('0xab')]['findAll']({'where':{'id':_0x158241[_0x709b('0x5e')][_0x709b('0x61')]||[]},'raw':!![],'attributes':['id',_0x709b('0x37')]});}})[_0x709b('0x13')](function(_0x259853){var _0x412a16=_0x124b96['get']({'plain':!![]});var _0x4fd91f=[];if(_0xf0aeac==='voice'&&_0x412a16[_0x709b('0x27')]==='agent'&&_0x412a16[_0x709b('0x9e')]){for(let _0x332260=0x0;_0x332260<_0x259853['length'];_0x332260+=0x1){_0x4fd91f[_0x709b('0x49')]({'membername':_0x412a16['name'],'UserId':_0x412a16['id'],'queue_name':_0x259853[_0x332260][_0x709b('0x37')],'VoiceQueueId':_0x259853[_0x332260]['id'],'interface':_[_0x709b('0x67')](_0x412a16[_0x709b('0xa1')])?util[_0x709b('0xac')](_0x709b('0xad'),_0x412a16['name']):_0x412a16['interface'],'paused':_0x412a16[_0x709b('0xa0')]||![],'penalty':_0x158241[_0x709b('0x5e')][_0x709b('0xa7')]||0x0});}return Promise[_0x709b('0x52')](_0x4fd91f[_0x709b('0x33')](function(_0x5d23e7){return db[_0x709b('0xae')]['upsert'](_0x5d23e7);}));}return _0x124b96;});}})[_0x709b('0x13')](respondWithStatusCode(_0x43934c,null))['catch'](handleError(_0x43934c,null));};exports[_0x709b('0xaf')]=function(_0x18bf27,_0x592d91){var _0x356750,_0x5359c1;return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x18bf27[_0x709b('0x54')]['id']},'attributes':['id',_0x709b('0x37'),_0x709b('0x27')]})[_0x709b('0x13')](handleEntityNotFound(_0x592d91,null))[_0x709b('0x13')](function(_0x1e6e11){if(_0x1e6e11){_0x356750=_0x1e6e11;if(!_0x18bf27['query'][_0x709b('0x9d')]||!utils[_0x709b('0xb0')](_0x18bf27[_0x709b('0x42')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x709b('0xa2'));}return _0x1e6e11['remove'+_[_0x709b('0xa4')](_0x18bf27[_0x709b('0x42')][_0x709b('0x9d')][_0x709b('0xa5')]())+_0x709b('0xa6')](_0x18bf27[_0x709b('0x42')][_0x709b('0x61')]);}})[_0x709b('0x13')](function(_0x25d590){if(_[_0x709b('0xb1')](_0x18bf27[_0x709b('0x42')][_0x709b('0x61')])){for(var _0x17358a=0x0;_0x17358a<_0x18bf27[_0x709b('0x42')][_0x709b('0x61')][_0x709b('0x4d')];_0x17358a+=0x1){_0x5359c1={'UserId':Number(_0x18bf27[_0x709b('0x54')]['id'])};_0x5359c1[_[_0x709b('0xa4')](_0x18bf27[_0x709b('0x42')][_0x709b('0x9d')][_0x709b('0xa5')]())+_0x709b('0xa9')]=Number(_0x18bf27[_0x709b('0x42')][_0x709b('0x61')][_0x17358a]);socket['emit'](_0x709b('0x2e')+_['capitalize'](_0x18bf27[_0x709b('0x42')]['channel'][_0x709b('0xa5')]())+_0x709b('0xb2'),_0x5359c1);}}else{_0x5359c1={'UserId':Number(_0x18bf27['params']['id'])};_0x5359c1[_[_0x709b('0xa4')](_0x18bf27[_0x709b('0x42')]['channel'][_0x709b('0xa5')]())+'QueueId']=Number(_0x18bf27['query'][_0x709b('0x61')]);socket['emit'](_0x709b('0x2e')+_[_0x709b('0xa4')](_0x18bf27[_0x709b('0x42')][_0x709b('0x9d')][_0x709b('0xa5')]())+'Queue:remove',_0x5359c1);}return _0x25d590;})[_0x709b('0x13')](function(){if(_0x18bf27[_0x709b('0x42')][_0x709b('0x9d')]===_0x709b('0xb3')){return db[_0x709b('0xae')]['destroy']({'where':{'UserId':_0x18bf27[_0x709b('0x54')]['id'],'VoiceQueueId':_0x18bf27[_0x709b('0x42')][_0x709b('0x61')]},'individualHooks':!![]})[_0x709b('0x13')](function(){return _0x356750;});}return _0x356750;})[_0x709b('0x13')](respondWithStatusCode(_0x592d91,null))[_0x709b('0x1d')](handleError(_0x592d91,null));};exports[_0x709b('0xb4')]=function(_0x520bef,_0x32d0ae){_0x520bef[_0x709b('0x5e')][_0x709b('0xb5')]=_0x520bef['file']['filename'];return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x520bef[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x32d0ae,null))[_0x709b('0x13')](saveUpdates(_0x520bef['body'],null))[_0x709b('0x13')](respondWithResult(_0x32d0ae,null))[_0x709b('0x1d')](handleError(_0x32d0ae,null));};exports[_0x709b('0xb6')]=function(_0x288db5,_0x519454){var _0x188fa5=path[_0x709b('0xb7')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x288db5['params']['id']},'attributes':['id',_0x709b('0xb5')],'raw':!![]})[_0x709b('0x13')](handleEntityNotFound(_0x519454,null))[_0x709b('0x13')](function(_0x39edcb){if(_0x39edcb){if(_[_0x709b('0x67')](_0x39edcb[_0x709b('0xb5')])){return _0x519454[_0x709b('0xb8')](_0x188fa5);}else{if(!fs[_0x709b('0xb9')](path[_0x709b('0xb7')](config['root'],_0x709b('0xba'),_0x39edcb[_0x709b('0xb5')]))){return _0x519454['download'](_0x188fa5);}return _0x519454[_0x709b('0xb8')](path['join'](config[_0x709b('0xbb')],_0x709b('0xba'),_0x39edcb[_0x709b('0xb5')]));}}})[_0x709b('0x1d')](handleError(_0x519454,null));};exports[_0x709b('0xbc')]=function(_0x7795f6,_0x486dcc){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x7795f6[_0x709b('0x54')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x486dcc,null))[_0x709b('0x13')](function(_0x38e1d1){var _0x4cd2dd=[];values=_0x38e1d1[_0x709b('0x4f')];_0x4cd2dd['push'](get_open_tabs(_0x709b('0x4e'),_0x38e1d1[_0x709b('0x4f')]));_0x4cd2dd[_0x709b('0x49')](get_open_tabs(_0x709b('0x50'),_0x38e1d1[_0x709b('0x4f')]));_0x4cd2dd[_0x709b('0x49')](get_open_tabs(_0x709b('0x51'),_0x38e1d1['dataValues']));_0x4cd2dd[_0x709b('0x49')](get_open_tabs('whatsapp',_0x38e1d1['dataValues']));_0x4cd2dd[_0x709b('0x49')](get_open_tabs(_0x709b('0x5c'),_0x38e1d1[_0x709b('0x4f')]));_0x4cd2dd[_0x709b('0x49')](get_open_tabs(_0x709b('0x5d'),_0x38e1d1[_0x709b('0x4f')]));return Promise[_0x709b('0x52')](_0x4cd2dd);})[_0x709b('0x13')](function(_0x12f60c){if(_0x12f60c){var _0x92eee=_[_0x709b('0x33')](values[_0x709b('0xbd')],function(_0x18038b){return{'channel':_0x709b('0xbe'),'id':_0x18038b['id'],'createdAt':_0x18038b[_0x709b('0xbf')]};});var _0x1faf4e=_['map'](values['FaxOpenTabs'],function(_0x4d8363){return{'channel':_0x709b('0xc0'),'id':_0x4d8363['id'],'createdAt':_0x4d8363['createdAt']};});var _0x20a6b2=_[_0x709b('0x33')](values[_0x709b('0xc1')],function(_0x1624cf){return{'channel':_0x709b('0xc2'),'id':_0x1624cf['id'],'createdAt':_0x1624cf[_0x709b('0xbf')]};});var _0x3652f6=_[_0x709b('0x33')](values[_0x709b('0xc3')],function(_0x213bf4){return{'channel':_0x709b('0xc4'),'id':_0x213bf4['id'],'createdAt':_0x213bf4[_0x709b('0xbf')]};});var _0x18aee0=_[_0x709b('0x33')](values['SmsOpenTabs'],function(_0x38e8f9){return{'channel':_0x709b('0xc5'),'id':_0x38e8f9['id'],'createdAt':_0x38e8f9[_0x709b('0xbf')]};});var _0x2285c7=_[_0x709b('0x33')](values['WhatsappOpenTabs'],function(_0x10259a){return{'channel':_0x709b('0xc6'),'id':_0x10259a['id'],'createdAt':_0x10259a[_0x709b('0xbf')]};});var _0x4d0f9a=_[_0x709b('0xc7')](_0x92eee,_0x1faf4e,_0x20a6b2,_0x3652f6,_0x18aee0,_0x2285c7);var _0x3e1dd9={'count':_0x4d0f9a['length'],'rows':_0x4d0f9a};return _0x3e1dd9;}else return null;})[_0x709b('0x13')](respondWithResult(_0x486dcc,null))[_0x709b('0x1d')](handleError(_0x486dcc,null));};exports[_0x709b('0xc8')]=function(_0x5cc1c3,_0x5aa3bc){var _0x289140={};var _0x3807c4={};var _0x34b4d8;var _0x46176e;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x5cc1c3['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x5aa3bc,null))[_0x709b('0x13')](function(_0xac6545){if(_0xac6545){_0x34b4d8=_0xac6545;_0x3807c4[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xc9')]['rawAttributes']);_0x3807c4['query']=_[_0x709b('0x56')](_0x5cc1c3[_0x709b('0x42')]);_0x3807c4[_0x709b('0x58')]=_['intersection'](_0x3807c4['model'],_0x3807c4['query']);_0x289140['attributes']=_[_0x709b('0x59')](_0x3807c4[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x5cc1c3[_0x709b('0x42')][_0x709b('0x5a')]));_0x289140[_0x709b('0x48')]=_0x289140[_0x709b('0x48')][_0x709b('0x4d')]?_0x289140[_0x709b('0x48')]:_0x3807c4[_0x709b('0x55')];_0x289140[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x5cc1c3[_0x709b('0x42')][_0x709b('0xcb')]);_0x289140['where']=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x5cc1c3['query'],_0x3807c4[_0x709b('0x58')]));if(_0x5cc1c3[_0x709b('0x42')][_0x709b('0x31')]){_0x289140[_0x709b('0x41')]=_['merge'](_0x289140[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x289140[_0x709b('0x48')],function(_0x464650){var _0x59aec3={};_0x59aec3[_0x464650]={'$like':'%'+_0x5cc1c3['query'][_0x709b('0x31')]+'%'};return _0x59aec3;})});}_0x289140=_['merge']({},_0x289140,_0x5cc1c3[_0x709b('0x5b')]);return _0x34b4d8[_0x709b('0xc8')](_0x289140);}})[_0x709b('0x13')](function(_0x118d61){if(_0x118d61){_0x46176e=_0x118d61[_0x709b('0x4d')];if(_0x5cc1c3[_0x709b('0x42')][_0x709b('0xcd')]('includeAll')){_0x289140['include']=[{'model':db[_0x709b('0xce')],'as':_0x709b('0xcf'),'required':![]},{'model':db[_0x709b('0xd0')],'as':_0x709b('0xd1'),'attributes':['id',_0x709b('0x37'),_0x709b('0xd2')],'where':_0x5cc1c3[_0x709b('0x42')][_0x709b('0xd3')]?{'id':_0x5cc1c3[_0x709b('0x42')][_0x709b('0xd3')]}:undefined,'required':_0x5cc1c3[_0x709b('0x42')][_0x709b('0xd3')]?!![]:![]}];}if(!_0x5cc1c3[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0x289140[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x5cc1c3[_0x709b('0x42')]['limit']);_0x289140['offset']=qs[_0x709b('0x24')](_0x5cc1c3[_0x709b('0x42')][_0x709b('0x24')]);}return _0x34b4d8[_0x709b('0xc8')](_0x289140);}})['then'](function(_0x4038c6){if(_0x4038c6){return _0x4038c6?{'count':_0x46176e,'rows':_0x4038c6}:null;}})[_0x709b('0x13')](respondWithResult(_0x5aa3bc,null))['catch'](handleError(_0x5aa3bc,null));};exports[_0x709b('0xd4')]=function(_0x47b1e4,_0x4fa173){var _0x330eb6;var _0x10a84d={};var _0x3fd3c7;return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x47b1e4['params']['id']},'attributes':['id',_0x709b('0x37'),_0x709b('0x27')]})['then'](handleEntityNotFound(_0x4fa173,null))[_0x709b('0x13')](function(_0x14f456){if(!utils[_0x709b('0xb0')](_0x47b1e4['query'][_0x709b('0x9d')])){throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0xa2'));}_0x330eb6=_0x14f456;var _0x44bccf={};_0x44bccf[_0x709b('0x55')]=_['keys'](db[_[_0x709b('0xa4')](_0x47b1e4[_0x709b('0x42')][_0x709b('0x9d')])+_0x709b('0xd5')]['rawAttributes']);_0x44bccf[_0x709b('0x42')]=_[_0x709b('0x56')](_0x47b1e4[_0x709b('0x42')]);_0x44bccf[_0x709b('0x58')]=_[_0x709b('0x59')](_0x44bccf[_0x709b('0x55')],_0x44bccf[_0x709b('0x42')]);_0x10a84d[_0x709b('0x48')]=_[_0x709b('0x59')](_0x44bccf[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x47b1e4[_0x709b('0x42')][_0x709b('0x5a')]));_0x10a84d[_0x709b('0x48')]=_0x10a84d[_0x709b('0x48')][_0x709b('0x4d')]?_0x10a84d[_0x709b('0x48')]:_0x44bccf['model'];_0x10a84d['order']=qs[_0x709b('0xcb')](_0x47b1e4['query'][_0x709b('0xcb')]);_0x10a84d[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x47b1e4[_0x709b('0x42')],_0x44bccf[_0x709b('0x58')]));if(_0x47b1e4['query'][_0x709b('0x31')]){_0x10a84d[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x10a84d[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x10a84d[_0x709b('0x48')],function(_0x1ec380){var _0x4d592d={};_0x4d592d[_0x1ec380]={'$like':'%'+_0x47b1e4['query']['filter']+'%'};return _0x4d592d;})});}_0x10a84d=_['merge']({},_0x10a84d,_0x47b1e4['options']);switch(_0x330eb6[_0x709b('0x27')]){case _0x709b('0x2c'):return db[_['capitalize'](_0x47b1e4[_0x709b('0x42')][_0x709b('0x9d')])+'Queue']['findAll'](_0x10a84d);case _0x709b('0x2e'):case _0x709b('0x28'):return _0x330eb6['get'+_[_0x709b('0xa4')](_0x47b1e4['query'][_0x709b('0x9d')])+'Queues'](_0x10a84d);default:throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0xd7'));}})[_0x709b('0x13')](function(_0x5e224f){_0x3fd3c7=_0x5e224f[_0x709b('0x4d')];if(!_0x47b1e4[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x10a84d['limit']=qs[_0x709b('0x22')](_0x47b1e4['query'][_0x709b('0x22')]);_0x10a84d[_0x709b('0x24')]=qs['offset'](_0x47b1e4['query'][_0x709b('0x24')]);}switch(_0x330eb6[_0x709b('0x27')]){case _0x709b('0x2c'):return db[_[_0x709b('0xa4')](_0x47b1e4[_0x709b('0x42')][_0x709b('0x9d')])+'Queue']['findAll'](_0x10a84d);case _0x709b('0x2e'):case'agent':return _0x330eb6[_0x709b('0xd9')+_[_0x709b('0xa4')](_0x47b1e4[_0x709b('0x42')][_0x709b('0x9d')])+_0x709b('0xa6')](_0x10a84d);}})[_0x709b('0x13')](function(_0x4809af){return{'count':_0x3fd3c7,'rows':_0x4809af};})['then'](respondWithResult(_0x4fa173,null))[_0x709b('0x1d')](handleError(_0x4fa173,null));};exports['getVoiceQueuesRt']=function(_0x20c2ba,_0x21cbb1){var _0x9f7920={};var _0x105dc5={};var _0x3b124f;var _0x18d8bd;return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x20c2ba[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x21cbb1,null))[_0x709b('0x13')](function(_0x5558f5){if(_0x5558f5){_0x3b124f=_0x5558f5;_0x105dc5[_0x709b('0x55')]=_[_0x709b('0x56')](db['UserVoiceQueueRt'][_0x709b('0xda')]);_0x105dc5[_0x709b('0x42')]=_[_0x709b('0x56')](_0x20c2ba['query']);_0x105dc5[_0x709b('0x58')]=_['intersection'](_0x105dc5[_0x709b('0x55')],_0x105dc5[_0x709b('0x42')]);_0x9f7920[_0x709b('0x48')]=_[_0x709b('0x59')](_0x105dc5[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x20c2ba[_0x709b('0x42')]['fields']));_0x9f7920[_0x709b('0x48')]=_0x9f7920[_0x709b('0x48')]['length']?_0x9f7920[_0x709b('0x48')]:_0x105dc5[_0x709b('0x55')];_0x9f7920[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x20c2ba['query'][_0x709b('0xcb')]);_0x9f7920[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x20c2ba[_0x709b('0x42')],_0x105dc5[_0x709b('0x58')]));if(_0x20c2ba[_0x709b('0x42')][_0x709b('0x31')]){_0x9f7920[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x9f7920[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x9f7920['attributes'],function(_0x3a0204){var _0x5e2c8a={};_0x5e2c8a[_0x3a0204]={'$like':'%'+_0x20c2ba[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x5e2c8a;})});}_0x9f7920=_['merge']({},_0x9f7920,_0x20c2ba[_0x709b('0x5b')]);return _0x3b124f[_0x709b('0xdb')](_0x9f7920);}})[_0x709b('0x13')](function(_0xc02a8c){if(_0xc02a8c){_0x18d8bd=_0xc02a8c[_0x709b('0x4d')];if(!_0x20c2ba[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x9f7920['limit']=qs[_0x709b('0x22')](_0x20c2ba[_0x709b('0x42')][_0x709b('0x22')]);_0x9f7920[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x20c2ba[_0x709b('0x42')]['offset']);}return _0x3b124f[_0x709b('0xdb')](_0x9f7920);}})[_0x709b('0x13')](function(_0x1edd53){if(_0x1edd53){return _0x1edd53?{'count':_0x18d8bd,'rows':_0x1edd53}:null;}})[_0x709b('0x13')](respondWithResult(_0x21cbb1,null))[_0x709b('0x1d')](handleError(_0x21cbb1,null));};exports[_0x709b('0xdc')]=function(_0x1419e0,_0x3bc249){var _0xea2d3e={};var _0x2772b5={};var _0x21e20f;var _0x2f1582;return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x1419e0['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x3bc249,null))[_0x709b('0x13')](function(_0x2cf7d7){if(_0x2cf7d7){_0x21e20f=_0x2cf7d7;_0x2772b5['model']=_[_0x709b('0x56')](db['ChatGroup']['rawAttributes']);_0x2772b5[_0x709b('0x42')]=_['keys'](_0x1419e0[_0x709b('0x42')]);_0x2772b5[_0x709b('0x58')]=_['intersection'](_0x2772b5[_0x709b('0x55')],_0x2772b5[_0x709b('0x42')]);_0xea2d3e[_0x709b('0x48')]=_[_0x709b('0x59')](_0x2772b5['model'],qs[_0x709b('0x5a')](_0x1419e0[_0x709b('0x42')][_0x709b('0x5a')]));_0xea2d3e[_0x709b('0x48')]=_0xea2d3e[_0x709b('0x48')][_0x709b('0x4d')]?_0xea2d3e['attributes']:_0x2772b5[_0x709b('0x55')];_0xea2d3e['order']=qs['sort'](_0x1419e0[_0x709b('0x42')][_0x709b('0xcb')]);_0xea2d3e['where']=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x1419e0[_0x709b('0x42')],_0x2772b5[_0x709b('0x58')]));if(_0x1419e0['query']['filter']){_0xea2d3e[_0x709b('0x41')]=_['merge'](_0xea2d3e[_0x709b('0x41')],{'$or':_['map'](_0xea2d3e[_0x709b('0x48')],function(_0x10c3c2){var _0x5c9315={};_0x5c9315[_0x10c3c2]={'$like':'%'+_0x1419e0[_0x709b('0x42')]['filter']+'%'};return _0x5c9315;})});}_0xea2d3e=_['merge']({},_0xea2d3e,_0x1419e0[_0x709b('0x5b')]);return _0x21e20f[_0x709b('0xdc')](_0xea2d3e);}})['then'](function(_0x571321){if(_0x571321){_0x2f1582=_0x571321['length'];if(!_0x1419e0[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0xea2d3e[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x1419e0[_0x709b('0x42')][_0x709b('0x22')]);_0xea2d3e[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x1419e0[_0x709b('0x42')][_0x709b('0x24')]);}return _0x21e20f[_0x709b('0xdc')](_0xea2d3e);}})[_0x709b('0x13')](function(_0x251f3b){if(_0x251f3b){return _0x251f3b?{'count':_0x2f1582,'rows':_0x251f3b}:null;}})[_0x709b('0x13')](respondWithResult(_0x3bc249,null))[_0x709b('0x1d')](handleError(_0x3bc249,null));};exports[_0x709b('0xdd')]=function(_0x2891d0,_0x3406d3){var _0x478f5b={'raw':!![],'where':{}};var _0x347db1={};var _0x161992={'count':0x0,'rows':[]};return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x2891d0[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x3406d3,null))[_0x709b('0x13')](function(_0x547279){if(_0x547279){_0x347db1['model']=_['keys'](db[_0x709b('0xde')][_0x709b('0xda')]);_0x347db1[_0x709b('0x42')]=_[_0x709b('0x56')](_0x2891d0[_0x709b('0x42')]);_0x347db1[_0x709b('0x58')]=_[_0x709b('0x59')](_0x347db1['model'],_0x347db1['query']);_0x478f5b[_0x709b('0x48')]=_['intersection'](_0x347db1[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x2891d0[_0x709b('0x42')][_0x709b('0x5a')]));_0x478f5b['attributes']=_0x478f5b[_0x709b('0x48')]['length']?_0x478f5b[_0x709b('0x48')]:_0x347db1[_0x709b('0x55')];if(!_0x2891d0['query'][_0x709b('0xcd')](_0x709b('0xd8'))){_0x478f5b[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x2891d0[_0x709b('0x42')][_0x709b('0x22')]);_0x478f5b['offset']=qs[_0x709b('0x24')](_0x2891d0['query']['offset']);}_0x478f5b[_0x709b('0xca')]=qs['sort'](_0x2891d0[_0x709b('0x42')][_0x709b('0xcb')]);_0x478f5b[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x2891d0[_0x709b('0x42')],_0x347db1[_0x709b('0x58')]));_0x478f5b[_0x709b('0x41')]['UserId']=_0x547279['id'];if(_0x2891d0['query'][_0x709b('0x31')]){_0x478f5b[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x478f5b[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x478f5b[_0x709b('0x48')],function(_0x10992c){var _0x38bdcb={};_0x38bdcb[_0x10992c]={'$like':'%'+_0x2891d0[_0x709b('0x42')]['filter']+'%'};return _0x38bdcb;})});}_0x478f5b=_[_0x709b('0xd6')]({},_0x478f5b,_0x2891d0['options']);return db[_0x709b('0xde')][_0x709b('0x23')]({'where':_0x478f5b[_0x709b('0x41')]})[_0x709b('0x13')](function(_0x47d800){_0x161992['count']=_0x47d800;if(_0x2891d0[_0x709b('0x42')][_0x709b('0x43')]){_0x478f5b['include']=[{'all':!![]}];}return db[_0x709b('0xde')]['findAll'](_0x478f5b);})[_0x709b('0x13')](function(_0x24b6f9){_0x161992[_0x709b('0x4b')]=_0x24b6f9;return _0x161992;});}})['then'](respondWithFilteredResult(_0x3406d3,_0x478f5b))[_0x709b('0x1d')](handleError(_0x3406d3,null));};exports[_0x709b('0xdf')]=function(_0x490d76,_0x266a09){var _0x1c432c={'raw':!![],'where':{}};var _0x2a9be5={};var _0xb7f249={'count':0x0,'rows':[]};return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x490d76[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x266a09,null))[_0x709b('0x13')](function(_0x980a4e){if(_0x980a4e){_0x2a9be5['model']=_[_0x709b('0x56')](db['ScreenRecording'][_0x709b('0xda')]);_0x2a9be5['query']=_['keys'](_0x490d76[_0x709b('0x42')]);_0x2a9be5[_0x709b('0x58')]=_[_0x709b('0x59')](_0x2a9be5[_0x709b('0x55')],_0x2a9be5[_0x709b('0x42')]);_0x1c432c[_0x709b('0x48')]=_[_0x709b('0x59')](_0x2a9be5[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x490d76[_0x709b('0x42')]['fields']));_0x1c432c[_0x709b('0x48')]=_0x1c432c[_0x709b('0x48')][_0x709b('0x4d')]?_0x1c432c[_0x709b('0x48')]:_0x2a9be5[_0x709b('0x55')];if(!_0x490d76[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x1c432c[_0x709b('0x22')]=qs['limit'](_0x490d76[_0x709b('0x42')][_0x709b('0x22')]);_0x1c432c[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x490d76['query']['offset']);}_0x1c432c[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x490d76['query'][_0x709b('0xcb')]);_0x1c432c[_0x709b('0x41')]=qs[_0x709b('0x58')](_['pick'](_0x490d76[_0x709b('0x42')],_0x2a9be5[_0x709b('0x58')]));_0x1c432c['where'][_0x709b('0xe0')]=_0x980a4e['id'];if(_0x490d76[_0x709b('0x42')][_0x709b('0x31')]){_0x1c432c['where']=_['merge'](_0x1c432c[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x1c432c[_0x709b('0x48')],function(_0x47326c){var _0x5f2a39={};_0x5f2a39[_0x47326c]={'$like':'%'+_0x490d76[_0x709b('0x42')]['filter']+'%'};return _0x5f2a39;})});}_0x1c432c=_['merge']({},_0x1c432c,_0x490d76[_0x709b('0x5b')]);return db[_0x709b('0xe1')][_0x709b('0x23')]({'where':_0x1c432c[_0x709b('0x41')]})[_0x709b('0x13')](function(_0x170bd6){_0xb7f249[_0x709b('0x23')]=_0x170bd6;if(_0x490d76[_0x709b('0x42')][_0x709b('0x43')]){_0x1c432c[_0x709b('0x44')]=[{'all':!![]}];}return db[_0x709b('0xe1')][_0x709b('0x4a')](_0x1c432c);})['then'](function(_0x492a95){_0xb7f249['rows']=_0x492a95;return _0xb7f249;});}})[_0x709b('0x13')](respondWithFilteredResult(_0x266a09,_0x1c432c))[_0x709b('0x1d')](handleError(_0x266a09,null));};exports[_0x709b('0xe2')]=function(_0x3917de,_0xb53c49){var _0x225794={};var _0x1cabd5={};var _0x5cfe12;var _0x590b18;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x3917de['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xb53c49,null))[_0x709b('0x13')](function(_0x2cc254){if(_0x2cc254){_0x5cfe12=_0x2cc254;_0x1cabd5[_0x709b('0x55')]=_[_0x709b('0x56')](db['ChatInteraction'][_0x709b('0xda')]);_0x1cabd5[_0x709b('0x42')]=_[_0x709b('0x56')](_0x3917de['query']);_0x1cabd5['filters']=_[_0x709b('0x59')](_0x1cabd5[_0x709b('0x55')],_0x1cabd5[_0x709b('0x42')]);_0x225794[_0x709b('0x48')]=_[_0x709b('0x59')](_0x1cabd5[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x3917de[_0x709b('0x42')][_0x709b('0x5a')]));_0x225794[_0x709b('0x48')]=_0x225794[_0x709b('0x48')]['length']?_0x225794[_0x709b('0x48')]:_0x1cabd5['model'];_0x225794['order']=qs['sort'](_0x3917de[_0x709b('0x42')][_0x709b('0xcb')]);_0x225794['where']=qs['filters'](_[_0x709b('0xcc')](_0x3917de['query'],_0x1cabd5[_0x709b('0x58')]));if(_0x3917de['query'][_0x709b('0x31')]){_0x225794[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x225794[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x225794['attributes'],function(_0x318ddf){var _0x314150={};_0x314150[_0x318ddf]={'$like':'%'+_0x3917de[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x314150;})});}_0x225794=_['merge']({},_0x225794,_0x3917de[_0x709b('0x5b')]);return _0x5cfe12['getChatInteractions'](_0x225794);}})[_0x709b('0x13')](function(_0x190fe3){if(_0x190fe3){_0x590b18=_0x190fe3[_0x709b('0x4d')];if(!_0x3917de[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0x225794[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x3917de[_0x709b('0x42')][_0x709b('0x22')]);_0x225794[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x3917de[_0x709b('0x42')][_0x709b('0x24')]);}return _0x5cfe12[_0x709b('0xe2')](_0x225794);}})['then'](function(_0x3a5bed){if(_0x3a5bed){return _0x3a5bed?{'count':_0x590b18,'rows':_0x3a5bed}:null;}})['then'](respondWithResult(_0xb53c49,null))[_0x709b('0x1d')](handleError(_0xb53c49,null));};exports[_0x709b('0xe3')]=function(_0x1057b7,_0x418e6e){var _0x19f450={};var _0x3ea170={};var _0x14fd4f;var _0x433eb1;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x1057b7[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x418e6e,null))[_0x709b('0x13')](function(_0x83269a){if(_0x83269a){_0x14fd4f=_0x83269a;_0x3ea170[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xe4')]['rawAttributes']);_0x3ea170['query']=_[_0x709b('0x56')](_0x1057b7[_0x709b('0x42')]);_0x3ea170['filters']=_[_0x709b('0x59')](_0x3ea170[_0x709b('0x55')],_0x3ea170[_0x709b('0x42')]);_0x19f450[_0x709b('0x48')]=_[_0x709b('0x59')](_0x3ea170[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x1057b7['query'][_0x709b('0x5a')]));_0x19f450[_0x709b('0x48')]=_0x19f450['attributes'][_0x709b('0x4d')]?_0x19f450['attributes']:_0x3ea170[_0x709b('0x55')];_0x19f450[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x1057b7[_0x709b('0x42')][_0x709b('0xcb')]);_0x19f450[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x1057b7['query'],_0x3ea170[_0x709b('0x58')]));if(_0x1057b7[_0x709b('0x42')][_0x709b('0x31')]){_0x19f450['where']=_[_0x709b('0xd6')](_0x19f450['where'],{'$or':_[_0x709b('0x33')](_0x19f450[_0x709b('0x48')],function(_0x2750c9){var _0xeb7a6d={};_0xeb7a6d[_0x2750c9]={'$like':'%'+_0x1057b7[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0xeb7a6d;})});}_0x19f450=_[_0x709b('0xd6')]({},_0x19f450,_0x1057b7[_0x709b('0x5b')]);return _0x14fd4f[_0x709b('0xe3')](_0x19f450);}})['then'](function(_0x4736e6){if(_0x4736e6){_0x433eb1=_0x4736e6[_0x709b('0x4d')];if(!_0x1057b7[_0x709b('0x42')]['hasOwnProperty'](_0x709b('0xd8'))){_0x19f450['limit']=qs['limit'](_0x1057b7[_0x709b('0x42')][_0x709b('0x22')]);_0x19f450[_0x709b('0x24')]=qs['offset'](_0x1057b7[_0x709b('0x42')]['offset']);}return _0x14fd4f['getOpenchannelInteractions'](_0x19f450);}})[_0x709b('0x13')](function(_0x54075e){if(_0x54075e){return _0x54075e?{'count':_0x433eb1,'rows':_0x54075e}:null;}})['then'](respondWithResult(_0x418e6e,null))[_0x709b('0x1d')](handleError(_0x418e6e,null));};exports[_0x709b('0xe5')]=function(_0x486dc9,_0x2d6a42){var _0xc5e372={'raw':!![],'where':{}};var _0x3643cf={};var _0x1ddab4={'count':0x0,'rows':[]};return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x486dc9['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x2d6a42,null))[_0x709b('0x13')](function(_0x2d5d96){if(_0x2d5d96){_0x3643cf[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xe6')]['rawAttributes']);_0x3643cf[_0x709b('0x42')]=_['keys'](_0x486dc9['query']);_0x3643cf[_0x709b('0x58')]=_['intersection'](_0x3643cf[_0x709b('0x55')],_0x3643cf[_0x709b('0x42')]);_0xc5e372[_0x709b('0x48')]=_['intersection'](_0x3643cf[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x486dc9['query']['fields']));_0xc5e372[_0x709b('0x48')]=_0xc5e372[_0x709b('0x48')][_0x709b('0x4d')]?_0xc5e372[_0x709b('0x48')]:_0x3643cf[_0x709b('0x55')];if(!_0x486dc9[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0xc5e372[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x486dc9[_0x709b('0x42')][_0x709b('0x22')]);_0xc5e372[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x486dc9['query'][_0x709b('0x24')]);}_0xc5e372[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x486dc9['query']['sort']);_0xc5e372[_0x709b('0x41')]=qs['filters'](_[_0x709b('0xcc')](_0x486dc9[_0x709b('0x42')],_0x3643cf[_0x709b('0x58')]));_0xc5e372[_0x709b('0x41')]['UserId']=_0x2d5d96['id'];if(_0x486dc9['query']['filter']){_0xc5e372['where']=_[_0x709b('0xd6')](_0xc5e372[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0xc5e372[_0x709b('0x48')],function(_0x21dcf1){var _0x4cd8a2={};_0x4cd8a2[_0x21dcf1]={'$like':'%'+_0x486dc9['query']['filter']+'%'};return _0x4cd8a2;})});}_0xc5e372=_[_0x709b('0xd6')]({},_0xc5e372,_0x486dc9['options']);return db[_0x709b('0xe6')][_0x709b('0x23')]({'where':_0xc5e372[_0x709b('0x41')]})[_0x709b('0x13')](function(_0x599168){_0x1ddab4[_0x709b('0x23')]=_0x599168;if(_0x486dc9[_0x709b('0x42')][_0x709b('0x43')]){_0xc5e372['include']=[{'all':!![]}];}return db[_0x709b('0xe6')][_0x709b('0x4a')](_0xc5e372);})[_0x709b('0x13')](function(_0x5d9c69){_0x1ddab4[_0x709b('0x4b')]=_0x5d9c69;return _0x1ddab4;});}})[_0x709b('0x13')](respondWithFilteredResult(_0x2d6a42,_0xc5e372))[_0x709b('0x1d')](handleError(_0x2d6a42,null));};exports[_0x709b('0xe7')]=function(_0x1a8bd1,_0x28b2b3){var _0x5df6a8={};var _0x157da1={};var _0x5e9ecc;var _0x4502cb;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x1a8bd1[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x28b2b3,null))[_0x709b('0x13')](function(_0x42cca3){if(_0x42cca3){_0x5e9ecc=_0x42cca3;_0x157da1[_0x709b('0x55')]=_[_0x709b('0x56')](db['SmsInteraction'][_0x709b('0xda')]);_0x157da1[_0x709b('0x42')]=_[_0x709b('0x56')](_0x1a8bd1['query']);_0x157da1['filters']=_[_0x709b('0x59')](_0x157da1[_0x709b('0x55')],_0x157da1[_0x709b('0x42')]);_0x5df6a8[_0x709b('0x48')]=_[_0x709b('0x59')](_0x157da1[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x1a8bd1[_0x709b('0x42')][_0x709b('0x5a')]));_0x5df6a8[_0x709b('0x48')]=_0x5df6a8[_0x709b('0x48')][_0x709b('0x4d')]?_0x5df6a8[_0x709b('0x48')]:_0x157da1[_0x709b('0x55')];_0x5df6a8['order']=qs[_0x709b('0xcb')](_0x1a8bd1[_0x709b('0x42')][_0x709b('0xcb')]);_0x5df6a8[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x1a8bd1[_0x709b('0x42')],_0x157da1['filters']));if(_0x1a8bd1[_0x709b('0x42')][_0x709b('0x31')]){_0x5df6a8[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x5df6a8[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x5df6a8['attributes'],function(_0x501e2b){var _0x2ea54d={};_0x2ea54d[_0x501e2b]={'$like':'%'+_0x1a8bd1['query'][_0x709b('0x31')]+'%'};return _0x2ea54d;})});}_0x5df6a8=_['merge']({},_0x5df6a8,_0x1a8bd1['options']);return _0x5e9ecc['getSmsInteractions'](_0x5df6a8);}})[_0x709b('0x13')](function(_0x352bd5){if(_0x352bd5){_0x4502cb=_0x352bd5['length'];if(!_0x1a8bd1[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x5df6a8[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x1a8bd1[_0x709b('0x42')]['limit']);_0x5df6a8[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x1a8bd1['query'][_0x709b('0x24')]);}return _0x5e9ecc[_0x709b('0xe7')](_0x5df6a8);}})[_0x709b('0x13')](function(_0x4da8ab){if(_0x4da8ab){return _0x4da8ab?{'count':_0x4502cb,'rows':_0x4da8ab}:null;}})[_0x709b('0x13')](respondWithResult(_0x28b2b3,null))[_0x709b('0x1d')](handleError(_0x28b2b3,null));};exports[_0x709b('0xe8')]=function(_0x27aaad,_0x523751){var _0x50f184={};var _0x5acd17={};var _0x371041;var _0x283274;return db['User'][_0x709b('0x98')]({'where':{'id':_0x27aaad['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x523751,null))[_0x709b('0x13')](function(_0x3e89f7){if(_0x3e89f7){_0x371041=_0x3e89f7;_0x5acd17[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xe9')][_0x709b('0xda')]);_0x5acd17[_0x709b('0x42')]=_[_0x709b('0x56')](_0x27aaad['query']);_0x5acd17[_0x709b('0x58')]=_[_0x709b('0x59')](_0x5acd17[_0x709b('0x55')],_0x5acd17['query']);_0x50f184[_0x709b('0x48')]=_[_0x709b('0x59')](_0x5acd17['model'],qs['fields'](_0x27aaad[_0x709b('0x42')][_0x709b('0x5a')]));_0x50f184[_0x709b('0x48')]=_0x50f184[_0x709b('0x48')]['length']?_0x50f184[_0x709b('0x48')]:_0x5acd17[_0x709b('0x55')];_0x50f184[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x27aaad[_0x709b('0x42')][_0x709b('0xcb')]);_0x50f184['where']=qs[_0x709b('0x58')](_['pick'](_0x27aaad['query'],_0x5acd17['filters']));if(_0x27aaad['query'][_0x709b('0x31')]){_0x50f184[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x50f184[_0x709b('0x41')],{'$or':_['map'](_0x50f184[_0x709b('0x48')],function(_0x545850){var _0x364980={};_0x364980[_0x545850]={'$like':'%'+_0x27aaad['query'][_0x709b('0x31')]+'%'};return _0x364980;})});}_0x50f184=_[_0x709b('0xd6')]({},_0x50f184,_0x27aaad[_0x709b('0x5b')]);return _0x371041[_0x709b('0xe8')](_0x50f184);}})['then'](function(_0x3d57cd){if(_0x3d57cd){_0x283274=_0x3d57cd[_0x709b('0x4d')];if(!_0x27aaad[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x50f184['limit']=qs[_0x709b('0x22')](_0x27aaad[_0x709b('0x42')][_0x709b('0x22')]);_0x50f184[_0x709b('0x24')]=qs['offset'](_0x27aaad[_0x709b('0x42')][_0x709b('0x24')]);}return _0x371041[_0x709b('0xe8')](_0x50f184);}})[_0x709b('0x13')](function(_0x333646){if(_0x333646){return _0x333646?{'count':_0x283274,'rows':_0x333646}:null;}})[_0x709b('0x13')](respondWithResult(_0x523751,null))[_0x709b('0x1d')](handleError(_0x523751,null));};exports[_0x709b('0xea')]=function(_0xc00fbc,_0x1d3449){var _0x5180ca={};var _0x31c81a={};var _0x445221;var _0x52b567;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0xc00fbc['params']['id']}})['then'](handleEntityNotFound(_0x1d3449,null))['then'](function(_0x501921){if(_0x501921){_0x445221=_0x501921;_0x31c81a[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xeb')][_0x709b('0xda')]);_0x31c81a[_0x709b('0x42')]=_[_0x709b('0x56')](_0xc00fbc[_0x709b('0x42')]);_0x31c81a[_0x709b('0x58')]=_[_0x709b('0x59')](_0x31c81a[_0x709b('0x55')],_0x31c81a[_0x709b('0x42')]);_0x5180ca[_0x709b('0x48')]=_[_0x709b('0x59')](_0x31c81a[_0x709b('0x55')],qs[_0x709b('0x5a')](_0xc00fbc['query'][_0x709b('0x5a')]));_0x5180ca[_0x709b('0x48')]=_0x5180ca[_0x709b('0x48')][_0x709b('0x4d')]?_0x5180ca['attributes']:_0x31c81a['model'];_0x5180ca['order']=qs[_0x709b('0xcb')](_0xc00fbc[_0x709b('0x42')]['sort']);_0x5180ca[_0x709b('0x41')]=qs[_0x709b('0x58')](_['pick'](_0xc00fbc[_0x709b('0x42')],_0x31c81a[_0x709b('0x58')]));if(_0xc00fbc[_0x709b('0x42')]['filter']){_0x5180ca[_0x709b('0x41')]=_['merge'](_0x5180ca[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x5180ca[_0x709b('0x48')],function(_0x3282ac){var _0x562da1={};_0x562da1[_0x3282ac]={'$like':'%'+_0xc00fbc['query'][_0x709b('0x31')]+'%'};return _0x562da1;})});}_0x5180ca=_['merge']({},_0x5180ca,_0xc00fbc[_0x709b('0x5b')]);return _0x445221['getWhatsappInteractions'](_0x5180ca);}})['then'](function(_0x3ba41d){if(_0x3ba41d){_0x52b567=_0x3ba41d[_0x709b('0x4d')];if(!_0xc00fbc[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x5180ca[_0x709b('0x22')]=qs[_0x709b('0x22')](_0xc00fbc[_0x709b('0x42')][_0x709b('0x22')]);_0x5180ca[_0x709b('0x24')]=qs[_0x709b('0x24')](_0xc00fbc[_0x709b('0x42')][_0x709b('0x24')]);}return _0x445221[_0x709b('0xea')](_0x5180ca);}})['then'](function(_0x5cbef8){if(_0x5cbef8){return _0x5cbef8?{'count':_0x52b567,'rows':_0x5cbef8}:null;}})[_0x709b('0x13')](respondWithResult(_0x1d3449,null))[_0x709b('0x1d')](handleError(_0x1d3449,null));};exports[_0x709b('0xec')]=function(_0x99df99,_0x3d25ca,_0x157ad8){var _0xbab2fa;var _0x3940fd;var _0x57cb54;var _0x5331e0=!_[_0x709b('0x67')](_0x99df99[_0x709b('0x54')]['id'])?_0x99df99[_0x709b('0x54')]['id']:!_[_0x709b('0x67')](_0x99df99[_0x709b('0x2e')]['id'])?_0x99df99[_0x709b('0x2e')]['id']:null;return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x5331e0,'role':{'$or':[_0x709b('0x2c'),'user',_0x709b('0x28')]}},'attributes':['id',_0x709b('0x37'),_0x709b('0xed'),_0x709b('0xee'),_0x709b('0x27'),_0x709b('0x62'),_0x709b('0x9f')]})[_0x709b('0x13')](function(_0x5de6e1){if(_0x5de6e1){if(_0x5de6e1['role']===_0x709b('0x28')){_0xbab2fa=_0x5de6e1;if(_0x99df99[_0x709b('0x5e')][_0x709b('0xa1')]){_0x57cb54=util[_0x709b('0xac')](_0x709b('0xef'),_0xbab2fa[_0x99df99[_0x709b('0x5e')][_0x709b('0xa1')]]);}else if(_0x99df99[_0x709b('0x5e')][_0x709b('0xf0')]){_0x57cb54=util[_0x709b('0xac')](_0x709b('0xad'),_0x99df99[_0x709b('0x5e')][_0x709b('0xf0')]);}else{_0x57cb54=util[_0x709b('0xac')]('SIP/%s',_0xbab2fa['name']);}socket['to'](util[_0x709b('0xac')](_0x709b('0xf1'),_0xbab2fa['name']))['emit'](_0x709b('0xf2'),{'user':{'id':_0xbab2fa['id'],'name':_0xbab2fa[_0x709b('0x37')]},'ip':_0x99df99[_0x709b('0xf3')][_0x709b('0xf4')]||_0x99df99['connection']['remoteAddress']||_0x99df99[_0x709b('0xf5')][_0x709b('0xf6')]||_0x99df99[_0x709b('0xf7')][_0x709b('0xf5')][_0x709b('0xf6')]});return db[_0x709b('0xae')][_0x709b('0x2b')]({'where':{'membername':_0xbab2fa['name']},'individualHooks':!![]});}}else{throw new db[(_0x709b('0x91'))][(_0x709b('0x92'))](_0x709b('0xf8'));}})[_0x709b('0x13')](function(){if(_0xbab2fa){return _0xbab2fa[_0x709b('0xf9')]({'raw':!![]});}})[_0x709b('0x13')](function(_0x3e830d){if(_0xbab2fa){if(_0x3e830d){_0x3940fd=_0x3e830d;if(_0x3940fd[_0x709b('0x4d')]){var _0x2dd945=_0x3940fd[_0x709b('0x33')](function(_0xee0579){var _0x33654c={'membername':_0xbab2fa[_0x709b('0x37')],'UserId':_0xbab2fa['id'],'queue_name':_0xee0579[_0x709b('0x37')],'VoiceQueueId':_0xee0579['id'],'interface':_0x57cb54,'paused':_0xbab2fa[_0x709b('0x9f')]||![],'penalty':_0xee0579['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt']['upsert'](_0x33654c);});return Promise['all'](_0x2dd945);}}}})['then'](function(){if(_0xbab2fa){return db[_0x709b('0xfa')][_0x709b('0x4a')]({'where':{'membername':_0xbab2fa['name'],'exitAt':null}});}})[_0x709b('0x13')](function(_0x4d544c){if(_0xbab2fa){var _0x3efce0=[];_0x4d544c[_0x709b('0xfb')](function(_0x3ba894){_0x3efce0[_0x709b('0x49')](_0x3ba894[_0x709b('0x26')]({'exitAt':moment()[_0x709b('0xac')](_0x709b('0xfc'))}));});return Promise[_0x709b('0x52')](_0x3efce0);}})[_0x709b('0x13')](function(){if(_0xbab2fa){var _0x17ed10=[];var _0x1c08c5=[];var _0x8499c5=utils['getChannels']();var _0x6423ea={'membername':_0xbab2fa[_0x709b('0x37')],'interface':_0x57cb54,'enterAt':moment()['format'](_0x709b('0xfc')),'role':_0xbab2fa['role'],'internal':_0xbab2fa[_0x709b('0x62')]};_0x8499c5[_0x709b('0xfb')](function(_0x13f5bf){_0x17ed10['push'](_[_0x709b('0xd6')]({'channel':_0x13f5bf,'type':_0x709b('0xfd'),'data1':_0x99df99['body'][_0x709b('0xfe')],'data2':_0x57cb54},_0x6423ea));if(_0xbab2fa['loginInPause']){_0x1c08c5['push'](_[_0x709b('0xd6')]({'channel':_0x13f5bf,'type':_0x709b('0xff'),'data1':'LOGININPAUSE'},_0x6423ea));}});return db[_0x709b('0xfa')][_0x709b('0x100')](_0x17ed10[_0x709b('0xc7')](_0x1c08c5),{'individualHooks':!![]});}})['then'](function(){if(_0xbab2fa){return _0xbab2fa[_0x709b('0x26')]({'online':!![],'lastLoginAt':moment()[_0x709b('0xac')](_0x709b('0xfc')),'voicePause':_0xbab2fa[_0x709b('0x9f')]||![],'mailPause':_0xbab2fa[_0x709b('0x9f')]||![],'chatPause':_0xbab2fa[_0x709b('0x9f')]||![],'faxPause':_0xbab2fa['loginInPause']||![],'smsPause':_0xbab2fa[_0x709b('0x9f')]||![],'openchannelPause':_0xbab2fa['loginInPause']||![],'whatsappPause':_0xbab2fa[_0x709b('0x9f')]||![],'pauseType':_0xbab2fa[_0x709b('0x9f')]?'LOGININPAUSE':null,'interface':_0x57cb54,'lastPauseAt':moment()[_0x709b('0xac')](_0x709b('0xfc'))});}})[_0x709b('0x13')](function(_0x5ec008){if(_0x99df99[_0x709b('0x101')]){return _0x157ad8();}else{return Promise[_0x709b('0x102')](_0x5ec008)[_0x709b('0x13')](respondWithResult(_0x3d25ca,null));}})[_0x709b('0x1d')](handleError(_0x3d25ca,null));};exports[_0x709b('0x103')]=function(_0x33b4dd,_0x3a4847){var _0x2ba66e;return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x33b4dd[_0x709b('0x54')]['id'],'role':_0x709b('0x28')},'attributes':['id',_0x709b('0x37'),'role']})[_0x709b('0x13')](handleEntityNotFound(_0x3a4847,null))[_0x709b('0x13')](function(_0x2279ff){if(_0x2279ff){_0x2ba66e=_0x2279ff;return db[_0x709b('0xae')][_0x709b('0x2b')]({'where':{'membername':_0x2ba66e[_0x709b('0x37')]},'individualHooks':!![]});}})[_0x709b('0x13')](function(){return db[_0x709b('0xfa')][_0x709b('0x4a')]({'where':{'membername':_0x2ba66e[_0x709b('0x37')],'exitAt':null}});})[_0x709b('0x13')](function(_0x4b7de8){var _0x4c40a4=[];_0x4b7de8[_0x709b('0xfb')](function(_0x2aceab){_0x4c40a4[_0x709b('0x49')](_0x2aceab[_0x709b('0x26')]({'exitAt':moment()['format'](_0x709b('0xfc'))}));});return Promise[_0x709b('0x52')](_0x4c40a4);})[_0x709b('0x13')](function(){return _0x2ba66e[_0x709b('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x709b('0x13')](respondWithResult(_0x3a4847,null))['catch'](handleError(_0x3a4847,null));};exports['pause']=function(_0x3be52c,_0x3c3d21){var _0x316e07;return db['UserVoiceQueueRt'][_0x709b('0x26')]({'paused':0x1},{'where':{'UserId':_0x3be52c[_0x709b('0x54')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x709b('0x36')]({'where':{'id':_0x3be52c[_0x709b('0x54')]['id'],'role':_0x709b('0x28')},'attributes':['id',_0x709b('0x37'),_0x709b('0x27'),_0x709b('0x62'),_0x709b('0xa1'),'online']});})[_0x709b('0x13')](handleEntityNotFound(_0x3c3d21,null))[_0x709b('0x13')](function(_0x3a96a6){if(_0x3a96a6){_0x316e07=_0x3a96a6;return respondWithRpcPromise(_0x709b('0x104'),'pause',{'id':_0x316e07['id'],'name':_0x316e07[_0x709b('0x37')],'pause':!![]});}})[_0x709b('0x13')](function(){if(_0x316e07){return db[_0x709b('0xfa')]['findAll']({'where':{'membername':_0x316e07[_0x709b('0x37')],'type':_0x709b('0xff'),'exitAt':null}});}})[_0x709b('0x13')](function(_0x2bbe73){if(_0x2bbe73[_0x709b('0x4d')]){var _0x2db46c=moment()[_0x709b('0xac')](_0x709b('0xfc'));for(var _0x50a81f=0x0,_0x15b9bd=_0x2bbe73['length'];_0x50a81f<_0x15b9bd;_0x50a81f++){_0x2bbe73[_0x50a81f][_0x709b('0x105')]({'exitAt':_0x2db46c});}}})[_0x709b('0x13')](function(){var _0x4acd83=[];var _0x3d0312=utils[_0x709b('0x106')]();_0x3d0312['forEach'](function(_0x521687){_0x4acd83['push']({'channel':_0x521687,'membername':_0x316e07[_0x709b('0x37')],'interface':_[_0x709b('0x67')](_0x316e07[_0x709b('0xa1')])?util[_0x709b('0xac')]('SIP/%s',_0x316e07[_0x709b('0x37')]):_0x316e07[_0x709b('0xa1')],'type':_0x709b('0xff'),'enterAt':moment()[_0x709b('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3be52c[_0x709b('0x5e')][_0x709b('0x3e')]||_0x709b('0x107'),'role':_0x316e07['role'],'internal':_0x316e07[_0x709b('0x62')]});});return db[_0x709b('0xfa')][_0x709b('0x100')](_0x4acd83,{'individualHooks':!![]});})[_0x709b('0x13')](function(){return _0x316e07[_0x709b('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3be52c[_0x709b('0x5e')][_0x709b('0x3e')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x709b('0xac')](_0x709b('0xfc'))});})[_0x709b('0x13')](respondWithResult(_0x3c3d21,null))['catch'](handleError(_0x3c3d21,null));};exports[_0x709b('0x108')]=function(_0x407028,_0x1d9674){if(_0x407028[_0x709b('0x5e')][_0x709b('0x9d')]&&!utils[_0x709b('0xb0')](_0x407028[_0x709b('0x5e')][_0x709b('0x9d')])){throw new APIBadRequestError(util[_0x709b('0xac')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x407028[_0x709b('0x5e')][_0x709b('0x9d')]));}return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x407028[_0x709b('0x54')]['id']},'attributes':['id',_0x709b('0x37'),_0x709b('0x27'),'internal',_0x709b('0xa1'),_0x709b('0x9e'),_0x709b('0xa0'),_0x709b('0x109'),'chatPause','faxPause',_0x709b('0x10a'),_0x709b('0x10b'),_0x709b('0x10c'),_0x709b('0x10d'),_0x709b('0x10e')]})[_0x709b('0x13')](function(_0x15ab60){if(!_0x15ab60){throw new APINotFoundError(util[_0x709b('0xac')](_0x709b('0x10f'),_0x407028[_0x709b('0x54')]['id']));}return _0x15ab60[_0x709b('0x108')](_0x407028['body']['channel']);})[_0x709b('0x13')](respondWithResult(_0x1d9674,null))[_0x709b('0x1d')](APIHandleError(_0x1d9674));};exports[_0x709b('0x110')]=function(_0x391aa6,_0x17da5f){var _0x3f40b6={};var _0x3e01e5={};var _0x5b9562;var _0x66d930;return db['User'][_0x709b('0x98')]({'where':{'id':_0x391aa6[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x17da5f,null))[_0x709b('0x13')](function(_0x496217){if(_0x496217){_0x5b9562=_0x496217;_0x3e01e5[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0x111')][_0x709b('0xda')]);_0x3e01e5[_0x709b('0x42')]=_['keys'](_0x391aa6[_0x709b('0x42')]);_0x3e01e5[_0x709b('0x58')]=_[_0x709b('0x59')](_0x3e01e5['model'],_0x3e01e5[_0x709b('0x42')]);_0x3f40b6[_0x709b('0x48')]=_[_0x709b('0x59')](_0x3e01e5[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x391aa6['query']['fields']));_0x3f40b6['attributes']=_0x3f40b6[_0x709b('0x48')][_0x709b('0x4d')]?_0x3f40b6[_0x709b('0x48')]:_0x3e01e5[_0x709b('0x55')];_0x3f40b6[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x391aa6[_0x709b('0x42')][_0x709b('0xcb')]);_0x3f40b6['where']=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x391aa6['query'],_0x3e01e5[_0x709b('0x58')]));if(_0x391aa6[_0x709b('0x42')][_0x709b('0x31')]){_0x3f40b6['where']=_[_0x709b('0xd6')](_0x3f40b6[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x3f40b6['attributes'],function(_0xc798eb){var _0x3c6e5e={};_0x3c6e5e[_0xc798eb]={'$like':'%'+_0x391aa6[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x3c6e5e;})});}_0x3f40b6=_['merge']({},_0x3f40b6,_0x391aa6['options']);return _0x5b9562[_0x709b('0x110')](_0x3f40b6);}})[_0x709b('0x13')](function(_0x23cba7){if(_0x23cba7){_0x66d930=_0x23cba7[_0x709b('0x4d')];if(!_0x391aa6[_0x709b('0x42')]['hasOwnProperty'](_0x709b('0xd8'))){_0x3f40b6[_0x709b('0x22')]=qs['limit'](_0x391aa6[_0x709b('0x42')][_0x709b('0x22')]);_0x3f40b6[_0x709b('0x24')]=qs['offset'](_0x391aa6[_0x709b('0x42')]['offset']);}return _0x5b9562['getTeams'](_0x3f40b6);}})[_0x709b('0x13')](function(_0x1aebb0){if(_0x1aebb0){return _0x1aebb0?{'count':_0x66d930,'rows':_0x1aebb0}:null;}})['then'](respondWithResult(_0x17da5f,null))[_0x709b('0x1d')](handleError(_0x17da5f,null));};exports[_0x709b('0x112')]=function(_0x4f561e,_0x5c7b38){var _0x483aef=_0x4f561e[_0x709b('0x54')]['id'];var _0x8bd74d=_0x4f561e[_0x709b('0x5e')]?_0x4f561e[_0x709b('0x5e')][_0x709b('0x61')]:null;var _0x14fb10=[];return Promise[_0x709b('0x102')]()['then'](function(){if(!_0x8bd74d)throw new APIBadRequestError(_0x709b('0x113'));})[_0x709b('0x13')](function(){return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x483aef}});})[_0x709b('0x13')](function(_0x528832){if(!_0x528832)throw new APINotFoundError(util[_0x709b('0xac')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4f561e[_0x709b('0x54')]['id']));return db[_0x709b('0x114')][_0x709b('0x115')](function(_0x44793c){return _0x528832[_0x709b('0x112')](_0x8bd74d,{'transaction':_0x44793c})[_0x709b('0x13')](function(){return db[_0x709b('0x111')][_0x709b('0x4a')]({'where':{'id':{'$in':_0x8bd74d}}});})[_0x709b('0x13')](function(_0x2edfbf){var _0x564e0a=_['map'](_0x2edfbf,function(_0x31e95d){return _0x31e95d[_0x709b('0x116')]();});return Promise[_0x709b('0x52')](_0x564e0a);})[_0x709b('0x13')](function(_0x213c88){_0x14fb10=_['flattenDeep'](_0x213c88);var _0x371b9a=_[_0x709b('0x33')](_0x14fb10,function(_0x42dc6e){return _0x42dc6e[_0x709b('0x117')](_0x528832['id'],{'transaction':_0x44793c});});return Promise['all'](_0x371b9a);})[_0x709b('0x13')](function(){if(!_0x528832[_0x709b('0x9e')])return;var _0x43d7b3=_[_0x709b('0x31')](_0x14fb10,function(_0x3a8da5){return _0x3a8da5['getDataValue'](_0x709b('0x9d'))===_0x709b('0x118');});var _0x51c03c=_[_0x709b('0x33')](_0x43d7b3,function(_0x42d159){return db[_0x709b('0xae')]['upsert']({'membername':_0x528832[_0x709b('0x37')],'UserId':_0x528832['id'],'queue_name':_0x42d159[_0x709b('0x37')],'VoiceQueueId':_0x42d159['id'],'interface':_[_0x709b('0x67')](_0x528832[_0x709b('0xa1')])?util[_0x709b('0xac')](_0x709b('0xad'),_0x528832[_0x709b('0x37')]):_0x528832[_0x709b('0xa1')],'paused':_0x528832[_0x709b('0xa0')]||![],'penalty':_0x528832['penalty']},{'transaction':_0x44793c});});return Promise[_0x709b('0x52')](_0x51c03c);})[_0x709b('0x13')](function(){return db[_0x709b('0x119')][_0x709b('0x4a')]({'where':{'teamId':{'$in':_0x8bd74d}}});})['then'](function(_0x160699){var _0x5c86ad=_[_0x709b('0x33')](_0x160699,function(_0x1b5298){return db[_0x709b('0x11a')][_0x709b('0x85')]({'UserId':_0x528832['id'],'VoicePrefixId':_0x1b5298[_0x709b('0x11b')]},{'transaction':_0x44793c});});return Promise[_0x709b('0x52')](_0x5c86ad);});});})[_0x709b('0x13')](function(){for(var _0x243c4a=0x0;_0x243c4a<_0x14fb10[_0x709b('0x4d')];_0x243c4a++){var _0x2eec7d=_0x14fb10[_0x243c4a][_0x709b('0x11c')](_0x709b('0x9d'));var _0x5627a8=_0x2eec7d+_0x709b('0xa9');socket[_0x709b('0x29')](_0x709b('0x2e')+_0x2eec7d+_0x709b('0xaa'),{'UserId':_0x483aef,['queueField']:_0x14fb10[_0x243c4a]['id']});}})['then'](respondWithStatusCode(_0x5c7b38,null))[_0x709b('0x1d')](APIHandleError(_0x5c7b38));};exports[_0x709b('0x11d')]=function(_0x15e8c3,_0x1c6cc3){var _0x219558=_0x15e8c3[_0x709b('0x54')]['id'];var _0x509b40=null;if(_0x15e8c3[_0x709b('0x42')][_0x709b('0x61')]){_0x509b40=_[_0x709b('0xb1')](_0x15e8c3['query'][_0x709b('0x61')])?_0x15e8c3[_0x709b('0x42')][_0x709b('0x61')]:[_0x15e8c3['query'][_0x709b('0x61')]];}var _0x19bfb9=[];return Promise[_0x709b('0x102')]()[_0x709b('0x13')](function(){if(!_0x509b40)throw new APIBadRequestError(_0x709b('0x11e'));})[_0x709b('0x13')](function(){return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x219558}});})[_0x709b('0x13')](function(_0x34c36b){if(!_0x34c36b)throw new APINotFoundError(util['format'](_0x709b('0x10f'),_0x15e8c3[_0x709b('0x54')]['id']));return db[_0x709b('0x114')][_0x709b('0x115')](function(_0x5290dd){return _0x34c36b[_0x709b('0x11d')](_0x509b40,{'transaction':_0x5290dd})['then'](function(){return db[_0x709b('0x111')][_0x709b('0x4a')]({'where':{'id':{'$in':_0x509b40}}});})['then'](function(_0x5477a3){var _0x298493=_[_0x709b('0x33')](_0x5477a3,function(_0x328feb){return _0x328feb[_0x709b('0x116')]();});return Promise[_0x709b('0x52')](_0x298493);})[_0x709b('0x13')](function(_0x29878b){_0x19bfb9=_[_0x709b('0x11f')](_0x29878b);var _0x3551d7=_[_0x709b('0x33')](_0x19bfb9,function(_0x1715b7){return _0x1715b7['removeAgent'](_0x34c36b['id'],{'transaction':_0x5290dd});});return Promise[_0x709b('0x52')](_0x3551d7);})[_0x709b('0x13')](function(){if(!_0x34c36b['online'])return;var _0x46d9e7=_[_0x709b('0x31')](_0x19bfb9,function(_0x4038c1){return _0x4038c1[_0x709b('0x11c')](_0x709b('0x9d'))==='Voice';});var _0x46d565=_['map'](_0x46d9e7,function(_0x5f4cf3){return db['UserVoiceQueueRt'][_0x709b('0x2b')]({'where':{'VoiceQueueId':_0x5f4cf3['id'],'UserId':_0x34c36b['id']},'transaction':_0x5290dd});});return Promise[_0x709b('0x52')](_0x46d565);})[_0x709b('0x13')](function(){return db[_0x709b('0x119')][_0x709b('0x4a')]({'where':{'teamId':{'$in':_0x509b40}}});})['then'](function(_0x4ee227){var _0x4811d6=_[_0x709b('0x33')](_0x4ee227,function(_0x22ff15){return db[_0x709b('0x11a')]['destroy']({'where':{'UserId':_0x34c36b['id'],'VoicePrefixId':_0x22ff15[_0x709b('0x11b')]}},{'transaction':_0x5290dd});});return Promise['all'](_0x4811d6);});});})[_0x709b('0x13')](function(){for(var _0x500b28=0x0;_0x500b28<_0x19bfb9[_0x709b('0x4d')];_0x500b28++){var _0x410fd1=_0x19bfb9[_0x500b28][_0x709b('0x11c')](_0x709b('0x9d'));var _0x11a6d0=_0x410fd1+'QueueId';socket[_0x709b('0x29')](_0x709b('0x2e')+_0x410fd1+_0x709b('0xb2'),{'UserId':_0x219558,['queueField']:_0x19bfb9[_0x500b28]['id']});}})[_0x709b('0x13')](respondWithStatusCode(_0x1c6cc3,null))[_0x709b('0x1d')](APIHandleError(_0x1c6cc3));};exports[_0x709b('0x120')]=function(_0x149add,_0x348d3e){var _0x4f318c={};var _0x3309d4={};var _0x190730;var _0xcec0ee;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x149add[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x348d3e,null))[_0x709b('0x13')](function(_0x7f5592){if(_0x7f5592){_0x190730=_0x7f5592;_0x3309d4[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0xce')]['rawAttributes']);_0x3309d4[_0x709b('0x42')]=_['keys'](_0x149add[_0x709b('0x42')]);_0x3309d4[_0x709b('0x58')]=_[_0x709b('0x59')](_0x3309d4[_0x709b('0x55')],_0x3309d4[_0x709b('0x42')]);_0x4f318c['attributes']=_['intersection'](_0x3309d4['model'],qs['fields'](_0x149add['query'][_0x709b('0x5a')]));_0x4f318c[_0x709b('0x48')]=_0x4f318c[_0x709b('0x48')][_0x709b('0x4d')]?_0x4f318c['attributes']:_0x3309d4['model'];_0x4f318c['order']=qs[_0x709b('0xcb')](_0x149add[_0x709b('0x42')][_0x709b('0xcb')]);_0x4f318c[_0x709b('0x41')]=qs[_0x709b('0x58')](_['pick'](_0x149add[_0x709b('0x42')],_0x3309d4[_0x709b('0x58')]));if(_0x149add[_0x709b('0x42')]['filter']){_0x4f318c[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x4f318c[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x4f318c[_0x709b('0x48')],function(_0xad83d9){var _0x332a4d={};_0x332a4d[_0xad83d9]={'$like':'%'+_0x149add[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x332a4d;})});}_0x4f318c=_[_0x709b('0xd6')]({},_0x4f318c,_0x149add['options']);return _0x190730[_0x709b('0x120')](_0x4f318c);}})['then'](function(_0x4f0ddb){if(_0x4f0ddb){_0xcec0ee=_0x4f0ddb['length'];if(!_0x149add[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0x4f318c['limit']=qs[_0x709b('0x22')](_0x149add[_0x709b('0x42')][_0x709b('0x22')]);_0x4f318c['offset']=qs['offset'](_0x149add[_0x709b('0x42')]['offset']);}return _0x190730[_0x709b('0x120')](_0x4f318c);}})[_0x709b('0x13')](function(_0x5b356e){if(_0x5b356e){return _0x5b356e?{'count':_0xcec0ee,'rows':_0x5b356e}:null;}})[_0x709b('0x13')](respondWithResult(_0x348d3e,null))['catch'](handleError(_0x348d3e,null));};exports[_0x709b('0x121')]=function(_0x57f8c5,_0x4d38e0){var _0x296823={};var _0x33e6a0={};var _0x1fc27a;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x57f8c5[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d38e0,null))['then'](function(_0x16b809){if(_0x16b809){_0x1fc27a=_0x16b809;_0x33e6a0[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0x3c')][_0x709b('0xda')]);_0x33e6a0[_0x709b('0x42')]=_[_0x709b('0x56')](_0x57f8c5['query']);_0x33e6a0[_0x709b('0x58')]=_[_0x709b('0x59')](_0x33e6a0[_0x709b('0x55')],_0x33e6a0[_0x709b('0x42')]);_0x296823[_0x709b('0x48')]=_[_0x709b('0x59')](_0x33e6a0['model'],qs['fields'](_0x57f8c5[_0x709b('0x42')][_0x709b('0x5a')]));_0x296823[_0x709b('0x48')]=_0x296823[_0x709b('0x48')][_0x709b('0x4d')]?_0x296823[_0x709b('0x48')]:_0x33e6a0['model'];_0x296823[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x57f8c5[_0x709b('0x42')]['sort']);_0x296823['where']=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x57f8c5['query'],_0x33e6a0[_0x709b('0x58')]));if(_0x57f8c5[_0x709b('0x42')][_0x709b('0x31')]){_0x296823[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x296823[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x296823[_0x709b('0x48')],function(_0x35d8b6){var _0x2e69bd={};_0x2e69bd[_0x35d8b6]={'$like':'%'+_0x57f8c5['query'][_0x709b('0x31')]+'%'};return _0x2e69bd;})});}_0x296823[_0x709b('0x55')]=db[_0x709b('0x3c')];_0x296823['as']=_0x709b('0x87');_0x296823=_[_0x709b('0xd6')]({},_0x296823,_0x57f8c5['options']);return _0x1fc27a[_0x709b('0xf9')]({'include':[_0x296823]});}})[_0x709b('0x13')](function(_0x5d5b4e){if(_0x5d5b4e){var _0x30adc3={},_0x5bd4a2=[];for(var _0x392de9=0x0;_0x392de9<_0x5d5b4e[_0x709b('0x4d')];_0x392de9+=0x1){for(var _0x2afe94=0x0,_0x4fadd9;_0x2afe94<_0x5d5b4e[_0x392de9]['Agents'][_0x709b('0x4d')];_0x2afe94+=0x1){_0x4fadd9=_0x5d5b4e[_0x392de9][_0x709b('0x87')][_0x2afe94][_0x709b('0xd9')]({'plain':!![]});_0x30adc3[_0x4fadd9['id']]=_0x4fadd9;}}_0x30adc3=_[_0x709b('0x122')](_0x30adc3);for(var _0x20649b=qs[_0x709b('0x24')](_0x57f8c5['query'][_0x709b('0x24')]);_0x20649b<_0x30adc3[_0x709b('0x4d')]&&_0x5bd4a2[_0x709b('0x4d')]<qs[_0x709b('0x22')](_0x57f8c5[_0x709b('0x42')][_0x709b('0x22')]);_0x20649b+=0x1){if(_0x30adc3[_0x20649b]){_0x5bd4a2[_0x709b('0x49')](_0x30adc3[_0x20649b]);}}return{'count':_0x30adc3[_0x709b('0x4d')],'rows':_0x5bd4a2};}})[_0x709b('0x13')](respondWithResult(_0x4d38e0,null))[_0x709b('0x1d')](handleError(_0x4d38e0,null));};exports[_0x709b('0x2b')]=function(_0x1cec17,_0x1897cf){if(_0x1cec17['user']['id']==_0x1cec17[_0x709b('0x54')]['id']){return _0x1897cf[_0x709b('0x1f')](0x1f4)[_0x709b('0x3a')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x1cec17['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x1897cf,null))[_0x709b('0x13')](removeEntity(_0x1897cf,null))[_0x709b('0x1d')](handleError(_0x1897cf,null));};exports[_0x709b('0x123')]=function(_0x41fa1e,_0x4c64c0){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x41fa1e['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x4c64c0,null))[_0x709b('0x13')](function(_0x346c43){if(_0x346c43){return _0x346c43['addChatInteractions'](_0x41fa1e[_0x709b('0x5e')][_0x709b('0x61')],_[_0x709b('0x124')](_0x41fa1e[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})[_0x709b('0xa8')](function(){for(var _0xe1769b=0x0;_0xe1769b<_0x41fa1e[_0x709b('0x5e')]['ids'][_0x709b('0x4d')];_0xe1769b+=0x1){socket[_0x709b('0x29')](_0x709b('0x125'),{'ChatInteractionId':Number(_0x41fa1e[_0x709b('0x5e')][_0x709b('0x61')][_0xe1769b]),'UserId':Number(_0x41fa1e[_0x709b('0x54')]['id'])});}return _0x41fa1e[_0x709b('0x5e')][_0x709b('0x61')];});}})[_0x709b('0x13')](respondWithResult(_0x4c64c0,null))[_0x709b('0x1d')](handleError(_0x4c64c0,null));};exports['removeChatInteractions']=function(_0x26163a,_0x166ad6){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x26163a[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x166ad6,null))[_0x709b('0x13')](function(_0x2aef4c){if(_0x2aef4c){return _0x2aef4c[_0x709b('0x126')](_0x26163a[_0x709b('0x42')][_0x709b('0x61')])[_0x709b('0x13')](function(){if(_[_0x709b('0xb1')](_0x26163a[_0x709b('0x42')]['ids'])){for(var _0x284d2d=0x0;_0x284d2d<_0x26163a['query']['ids'][_0x709b('0x4d')];_0x284d2d+=0x1){socket[_0x709b('0x29')](_0x709b('0x127'),{'ChatInteractionId':Number(_0x26163a[_0x709b('0x42')][_0x709b('0x61')][_0x284d2d]),'UserId':Number(_0x26163a['params']['id'])});}}else{socket['emit'](_0x709b('0x127'),{'ChatInteractionId':Number(_0x26163a[_0x709b('0x42')]['ids']),'UserId':Number(_0x26163a[_0x709b('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x166ad6,null))['catch'](handleError(_0x166ad6,null));};exports['addMailInteractions']=function(_0x306644,_0x7270f7){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x306644['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x7270f7,null))[_0x709b('0x13')](function(_0x5bbb41){if(_0x5bbb41){return _0x5bbb41[_0x709b('0x128')](_0x306644['body']['ids'],_[_0x709b('0x124')](_0x306644[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})['spread'](function(){for(var _0x31878e=0x0;_0x31878e<_0x306644[_0x709b('0x5e')][_0x709b('0x61')][_0x709b('0x4d')];_0x31878e+=0x1){socket['emit'](_0x709b('0x129'),{'MailInteractionId':Number(_0x306644['body'][_0x709b('0x61')][_0x31878e]),'UserId':Number(_0x306644[_0x709b('0x54')]['id'])});}return _0x306644[_0x709b('0x5e')][_0x709b('0x61')];});}})[_0x709b('0x13')](respondWithResult(_0x7270f7,null))[_0x709b('0x1d')](handleError(_0x7270f7,null));};exports[_0x709b('0x12a')]=function(_0x5e3443,_0x3bac74){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x5e3443[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x3bac74,null))['then'](function(_0x45e07e){if(_0x45e07e){return _0x45e07e[_0x709b('0x12a')](_0x5e3443[_0x709b('0x42')][_0x709b('0x61')])['then'](function(){if(_['isArray'](_0x5e3443['query'][_0x709b('0x61')])){for(var _0x22e3aa=0x0;_0x22e3aa<_0x5e3443[_0x709b('0x42')][_0x709b('0x61')][_0x709b('0x4d')];_0x22e3aa+=0x1){socket[_0x709b('0x29')](_0x709b('0x12b'),{'MailInteractionId':Number(_0x5e3443[_0x709b('0x42')][_0x709b('0x61')][_0x22e3aa]),'UserId':Number(_0x5e3443[_0x709b('0x54')]['id'])});}}else{socket[_0x709b('0x29')](_0x709b('0x12b'),{'MailInteractionId':Number(_0x5e3443[_0x709b('0x42')][_0x709b('0x61')]),'UserId':Number(_0x5e3443[_0x709b('0x54')]['id'])});}});}})[_0x709b('0x13')](respondWithStatusCode(_0x3bac74,null))['catch'](handleError(_0x3bac74,null));};exports[_0x709b('0x12c')]=function(_0x5ba59f,_0x52ba40){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x5ba59f['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x52ba40,null))[_0x709b('0x13')](function(_0x3c39fe){if(_0x3c39fe){return _0x3c39fe[_0x709b('0x12c')](_0x5ba59f[_0x709b('0x5e')][_0x709b('0x61')],_[_0x709b('0x124')](_0x5ba59f[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})[_0x709b('0xa8')](function(){for(var _0x420fe4=0x0;_0x420fe4<_0x5ba59f[_0x709b('0x5e')][_0x709b('0x61')][_0x709b('0x4d')];_0x420fe4+=0x1){socket[_0x709b('0x29')](_0x709b('0x12d'),{'FaxInteractionId':Number(_0x5ba59f[_0x709b('0x5e')][_0x709b('0x61')][_0x420fe4]),'UserId':Number(_0x5ba59f[_0x709b('0x54')]['id'])});}return _0x5ba59f[_0x709b('0x5e')][_0x709b('0x61')];});}})[_0x709b('0x13')](respondWithResult(_0x52ba40,null))[_0x709b('0x1d')](handleError(_0x52ba40,null));};exports['removeFaxInteractions']=function(_0x2b7e7e,_0x2ec79a){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x2b7e7e['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x2ec79a,null))['then'](function(_0x1e0eaa){if(_0x1e0eaa){return _0x1e0eaa[_0x709b('0x12e')](_0x2b7e7e[_0x709b('0x42')][_0x709b('0x61')])[_0x709b('0x13')](function(){if(_[_0x709b('0xb1')](_0x2b7e7e[_0x709b('0x42')][_0x709b('0x61')])){for(var _0x2624f2=0x0;_0x2624f2<_0x2b7e7e[_0x709b('0x42')]['ids'][_0x709b('0x4d')];_0x2624f2+=0x1){socket['emit'](_0x709b('0x12f'),{'FaxInteractionId':Number(_0x2b7e7e[_0x709b('0x42')][_0x709b('0x61')][_0x2624f2]),'UserId':Number(_0x2b7e7e[_0x709b('0x54')]['id'])});}}else{socket[_0x709b('0x29')](_0x709b('0x12f'),{'FaxInteractionId':Number(_0x2b7e7e[_0x709b('0x42')][_0x709b('0x61')]),'UserId':Number(_0x2b7e7e[_0x709b('0x54')]['id'])});}});}})[_0x709b('0x13')](respondWithStatusCode(_0x2ec79a,null))['catch'](handleError(_0x2ec79a,null));};exports[_0x709b('0x130')]=function(_0x2def71,_0x1ce96b){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x2def71[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ce96b,null))[_0x709b('0x13')](function(_0x1d7efe){if(_0x1d7efe){return _0x1d7efe[_0x709b('0x130')](_0x2def71[_0x709b('0x5e')][_0x709b('0x61')],_['omit'](_0x2def71[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})[_0x709b('0xa8')](function(){for(var _0x23fa04=0x0;_0x23fa04<_0x2def71['body']['ids']['length'];_0x23fa04+=0x1){socket['emit'](_0x709b('0x131'),{'SmsInteractionId':Number(_0x2def71[_0x709b('0x5e')][_0x709b('0x61')][_0x23fa04]),'UserId':Number(_0x2def71[_0x709b('0x54')]['id'])});}return _0x2def71[_0x709b('0x5e')][_0x709b('0x61')];});}})[_0x709b('0x13')](respondWithResult(_0x1ce96b,null))[_0x709b('0x1d')](handleError(_0x1ce96b,null));};exports['removeSmsInteractions']=function(_0x58484f,_0x450cf1){return db[_0x709b('0x3c')]['find']({'where':{'id':_0x58484f[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x450cf1,null))[_0x709b('0x13')](function(_0x16bb65){if(_0x16bb65){return _0x16bb65[_0x709b('0x132')](_0x58484f[_0x709b('0x42')]['ids'])['then'](function(){if(_[_0x709b('0xb1')](_0x58484f['query'][_0x709b('0x61')])){for(var _0x5ec187=0x0;_0x5ec187<_0x58484f[_0x709b('0x42')]['ids'][_0x709b('0x4d')];_0x5ec187+=0x1){socket[_0x709b('0x29')](_0x709b('0x133'),{'SmsInteractionId':Number(_0x58484f[_0x709b('0x42')][_0x709b('0x61')][_0x5ec187]),'UserId':Number(_0x58484f[_0x709b('0x54')]['id'])});}}else{socket['emit'](_0x709b('0x133'),{'SmsInteractionId':Number(_0x58484f[_0x709b('0x42')]['ids']),'UserId':Number(_0x58484f[_0x709b('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x450cf1,null))['catch'](handleError(_0x450cf1,null));};exports[_0x709b('0x134')]=function(_0x16f886,_0x5e4ba5){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x16f886[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x5e4ba5,null))[_0x709b('0x13')](function(_0x3d1c20){if(_0x3d1c20){return _0x3d1c20['addOpenchannelInteractions'](_0x16f886['body'][_0x709b('0x61')],_[_0x709b('0x124')](_0x16f886[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})[_0x709b('0xa8')](function(){for(var _0x34c7eb=0x0;_0x34c7eb<_0x16f886['body'][_0x709b('0x61')][_0x709b('0x4d')];_0x34c7eb+=0x1){socket[_0x709b('0x29')](_0x709b('0x135'),{'OpenchannelInteractionId':Number(_0x16f886['body']['ids'][_0x34c7eb]),'UserId':Number(_0x16f886[_0x709b('0x54')]['id'])});}return _0x16f886[_0x709b('0x5e')][_0x709b('0x61')];});}})['then'](respondWithResult(_0x5e4ba5,null))[_0x709b('0x1d')](handleError(_0x5e4ba5,null));};exports[_0x709b('0x136')]=function(_0x126b4d,_0x40e7f2){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x126b4d[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x40e7f2,null))[_0x709b('0x13')](function(_0x2c42ac){if(_0x2c42ac){return _0x2c42ac[_0x709b('0x136')](_0x126b4d[_0x709b('0x42')][_0x709b('0x61')])[_0x709b('0x13')](function(){if(_[_0x709b('0xb1')](_0x126b4d[_0x709b('0x42')][_0x709b('0x61')])){for(var _0x3ca1a5=0x0;_0x3ca1a5<_0x126b4d[_0x709b('0x42')][_0x709b('0x61')][_0x709b('0x4d')];_0x3ca1a5+=0x1){socket['emit'](_0x709b('0x137'),{'OpenchannelInteractionId':Number(_0x126b4d['query']['ids'][_0x3ca1a5]),'UserId':Number(_0x126b4d['params']['id'])});}}else{socket[_0x709b('0x29')](_0x709b('0x137'),{'OpenchannelInteractionId':Number(_0x126b4d['query'][_0x709b('0x61')]),'UserId':Number(_0x126b4d['params']['id'])});}});}})[_0x709b('0x13')](respondWithStatusCode(_0x40e7f2,null))[_0x709b('0x1d')](handleError(_0x40e7f2,null));};exports[_0x709b('0x138')]=function(_0x3a66dd,_0x125415){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x3a66dd[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x125415,null))[_0x709b('0x13')](function(_0xa0945){if(_0xa0945){return _0xa0945[_0x709b('0x138')](_0x3a66dd['body'][_0x709b('0x61')],_['omit'](_0x3a66dd[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{})[_0x709b('0xa8')](function(){for(var _0x1ae6ef=0x0;_0x1ae6ef<_0x3a66dd[_0x709b('0x5e')]['ids'][_0x709b('0x4d')];_0x1ae6ef+=0x1){socket['emit'](_0x709b('0x139'),{'WhatsappInteractionId':Number(_0x3a66dd[_0x709b('0x5e')][_0x709b('0x61')][_0x1ae6ef]),'UserId':Number(_0x3a66dd[_0x709b('0x54')]['id'])});}return _0x3a66dd[_0x709b('0x5e')][_0x709b('0x61')];});}})['then'](respondWithResult(_0x125415,null))['catch'](handleError(_0x125415,null));};exports[_0x709b('0x13a')]=function(_0x59eb33,_0x451719){return db[_0x709b('0x3c')]['find']({'where':{'id':_0x59eb33['params']['id']}})['then'](handleEntityNotFound(_0x451719,null))['then'](function(_0x1c9e47){if(_0x1c9e47){return _0x1c9e47[_0x709b('0x13a')](_0x59eb33['query'][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0x451719,null))[_0x709b('0x1d')](handleError(_0x451719,null));};exports[_0x709b('0x13b')]=function(_0x43dd47,_0x4dfa07){var _0x2d036b={};var _0x1e3b94={};var _0x1c6b99;var _0xb8ebe8;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x43dd47[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4dfa07,null))['then'](function(_0x479b99){if(_0x479b99){_0x1c6b99=_0x479b99;_0x1e3b94[_0x709b('0x55')]=_['keys'](db[_0x709b('0x13c')][_0x709b('0xda')]);_0x1e3b94[_0x709b('0x42')]=_[_0x709b('0x56')](_0x43dd47['query']);_0x1e3b94[_0x709b('0x58')]=_[_0x709b('0x59')](_0x1e3b94[_0x709b('0x55')],_0x1e3b94['query']);_0x2d036b[_0x709b('0x48')]=_[_0x709b('0x59')](_0x1e3b94[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x43dd47[_0x709b('0x42')][_0x709b('0x5a')]));_0x2d036b[_0x709b('0x48')]=_0x2d036b['attributes'][_0x709b('0x4d')]?_0x2d036b['attributes']:_0x1e3b94['model'];_0x2d036b['order']=qs['sort'](_0x43dd47[_0x709b('0x42')]['sort']);_0x2d036b[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x43dd47['query'],_0x1e3b94[_0x709b('0x58')]));if(_0x43dd47['query']['filter']){_0x2d036b[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x2d036b['where'],{'$or':_[_0x709b('0x33')](_0x2d036b[_0x709b('0x48')],function(_0x19e022){var _0x58f89c={};_0x58f89c[_0x19e022]={'$like':'%'+_0x43dd47[_0x709b('0x42')]['filter']+'%'};return _0x58f89c;})});}_0x2d036b=_[_0x709b('0xd6')]({},_0x2d036b,_0x43dd47[_0x709b('0x5b')]);return _0x1c6b99['getVoicePrefixes'](_0x2d036b);}})[_0x709b('0x13')](function(_0x4aa639){if(_0x4aa639){_0xb8ebe8=_0x4aa639['length'];if(!_0x43dd47[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x2d036b[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x43dd47[_0x709b('0x42')][_0x709b('0x22')]);_0x2d036b[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x43dd47[_0x709b('0x42')][_0x709b('0x24')]);}return _0x1c6b99[_0x709b('0x13b')](_0x2d036b);}})['then'](function(_0x4bccaf){if(_0x4bccaf){return _0x4bccaf?{'count':_0xb8ebe8,'rows':_0x4bccaf}:null;}})[_0x709b('0x13')](respondWithResult(_0x4dfa07,null))[_0x709b('0x1d')](handleError(_0x4dfa07,null));};exports['getFaxAccounts']=function(_0x1d9ff1,_0x48c4b2){var _0x8f6fd8={};var _0x2ae513={};var _0x552fa1;var _0x2e02b8;return db['User']['findOne']({'where':{'id':_0x1d9ff1['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x48c4b2,null))[_0x709b('0x13')](function(_0xb519d4){if(_0xb519d4){_0x552fa1=_0xb519d4;_0x2ae513[_0x709b('0x55')]=_['keys'](db[_0x709b('0x13d')]['rawAttributes']);_0x2ae513[_0x709b('0x42')]=_['keys'](_0x1d9ff1['query']);_0x2ae513[_0x709b('0x58')]=_[_0x709b('0x59')](_0x2ae513[_0x709b('0x55')],_0x2ae513['query']);_0x8f6fd8['attributes']=_[_0x709b('0x59')](_0x2ae513[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x1d9ff1[_0x709b('0x42')][_0x709b('0x5a')]));_0x8f6fd8[_0x709b('0x48')]=_0x8f6fd8[_0x709b('0x48')]['length']?_0x8f6fd8[_0x709b('0x48')]:_0x2ae513[_0x709b('0x55')];_0x8f6fd8[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x1d9ff1['query']['sort']);_0x8f6fd8[_0x709b('0x41')]=qs[_0x709b('0x58')](_['pick'](_0x1d9ff1[_0x709b('0x42')],_0x2ae513[_0x709b('0x58')]));if(_0x1d9ff1[_0x709b('0x42')][_0x709b('0x31')]){_0x8f6fd8['where']=_[_0x709b('0xd6')](_0x8f6fd8[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x8f6fd8[_0x709b('0x48')],function(_0x1307a3){var _0x5e67b2={};_0x5e67b2[_0x1307a3]={'$like':'%'+_0x1d9ff1[_0x709b('0x42')]['filter']+'%'};return _0x5e67b2;})});}_0x8f6fd8=_[_0x709b('0xd6')]({},_0x8f6fd8,_0x1d9ff1[_0x709b('0x5b')]);return _0x552fa1[_0x709b('0x13e')](_0x8f6fd8);}})['then'](function(_0x4067ce){if(_0x4067ce){_0x2e02b8=_0x4067ce[_0x709b('0x4d')];if(!_0x1d9ff1['query'][_0x709b('0xcd')](_0x709b('0xd8'))){_0x8f6fd8[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x1d9ff1[_0x709b('0x42')][_0x709b('0x22')]);_0x8f6fd8[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x1d9ff1[_0x709b('0x42')][_0x709b('0x24')]);}return _0x552fa1[_0x709b('0x13e')](_0x8f6fd8);}})['then'](function(_0x175c65){if(_0x175c65){return _0x175c65?{'count':_0x2e02b8,'rows':_0x175c65}:null;}})['then'](respondWithResult(_0x48c4b2,null))[_0x709b('0x1d')](handleError(_0x48c4b2,null));};exports[_0x709b('0x13f')]=function(_0x474ee9,_0xdcc19c){return db['User'][_0x709b('0x36')]({'where':{'id':_0x474ee9[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xdcc19c,null))[_0x709b('0x13')](function(_0x1e490e){if(_0x1e490e){return _0x1e490e[_0x709b('0x13f')](_0x474ee9[_0x709b('0x5e')][_0x709b('0x61')],_[_0x709b('0x124')](_0x474ee9[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0xdcc19c,null))['catch'](handleError(_0xdcc19c,null));};exports[_0x709b('0x140')]=function(_0x36a35f,_0x586e57){return db['User'][_0x709b('0x36')]({'where':{'id':_0x36a35f[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x586e57,null))[_0x709b('0x13')](function(_0x1497d0){if(_0x1497d0){return _0x1497d0['removeFaxAccounts'](_0x36a35f[_0x709b('0x42')][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0x586e57,null))[_0x709b('0x1d')](handleError(_0x586e57,null));};exports[_0x709b('0x141')]=function(_0x3356e6,_0xbf5797){var _0x3ce51d={};var _0xfffbc5={};var _0x101f22;var _0x23d7c4;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x3356e6[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0xbf5797,null))['then'](function(_0x1eef60){if(_0x1eef60){_0x101f22=_0x1eef60;_0xfffbc5[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0x142')][_0x709b('0xda')]);_0xfffbc5[_0x709b('0x42')]=_[_0x709b('0x56')](_0x3356e6[_0x709b('0x42')]);_0xfffbc5['filters']=_[_0x709b('0x59')](_0xfffbc5[_0x709b('0x55')],_0xfffbc5[_0x709b('0x42')]);_0x3ce51d[_0x709b('0x48')]=_[_0x709b('0x59')](_0xfffbc5[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x3356e6[_0x709b('0x42')][_0x709b('0x5a')]));_0x3ce51d['attributes']=_0x3ce51d[_0x709b('0x48')][_0x709b('0x4d')]?_0x3ce51d['attributes']:_0xfffbc5['model'];_0x3ce51d[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x3356e6[_0x709b('0x42')][_0x709b('0xcb')]);_0x3ce51d[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x3356e6[_0x709b('0x42')],_0xfffbc5[_0x709b('0x58')]));if(_0x3356e6['query'][_0x709b('0x31')]){_0x3ce51d[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x3ce51d[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x3ce51d['attributes'],function(_0x26176d){var _0x4943a8={};_0x4943a8[_0x26176d]={'$like':'%'+_0x3356e6[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x4943a8;})});}_0x3ce51d=_['merge']({},_0x3ce51d,_0x3356e6[_0x709b('0x5b')]);return _0x101f22[_0x709b('0x141')](_0x3ce51d);}})[_0x709b('0x13')](function(_0x463c98){if(_0x463c98){_0x23d7c4=_0x463c98[_0x709b('0x4d')];if(!_0x3356e6[_0x709b('0x42')][_0x709b('0xcd')](_0x709b('0xd8'))){_0x3ce51d[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x3356e6['query']['limit']);_0x3ce51d[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x3356e6[_0x709b('0x42')][_0x709b('0x24')]);}return _0x101f22[_0x709b('0x141')](_0x3ce51d);}})[_0x709b('0x13')](function(_0x4cfe3e){if(_0x4cfe3e){return _0x4cfe3e?{'count':_0x23d7c4,'rows':_0x4cfe3e}:null;}})[_0x709b('0x13')](respondWithResult(_0xbf5797,null))[_0x709b('0x1d')](handleError(_0xbf5797,null));};exports[_0x709b('0x143')]=function(_0x3d3aae,_0x28d3ea){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x3d3aae['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x28d3ea,null))[_0x709b('0x13')](function(_0x25a938){if(_0x25a938){return _0x25a938[_0x709b('0x143')](_0x3d3aae[_0x709b('0x5e')][_0x709b('0x61')],_['omit'](_0x3d3aae[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0x28d3ea,null))[_0x709b('0x1d')](handleError(_0x28d3ea,null));};exports[_0x709b('0x144')]=function(_0x58d9f3,_0xa53de6){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x58d9f3['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xa53de6,null))[_0x709b('0x13')](function(_0x4f9a76){if(_0x4f9a76){return _0x4f9a76[_0x709b('0x144')](_0x58d9f3[_0x709b('0x42')][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0xa53de6,null))[_0x709b('0x1d')](handleError(_0xa53de6,null));};exports[_0x709b('0x145')]=function(_0x14e1bf,_0x1a317e){var _0x5ea0d2={};var _0x390876={};var _0xee0614;var _0x3d8bd7;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x14e1bf['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x1a317e,null))[_0x709b('0x13')](function(_0x2d8035){if(_0x2d8035){_0xee0614=_0x2d8035;_0x390876['model']=_['keys'](db[_0x709b('0x146')][_0x709b('0xda')]);_0x390876['query']=_[_0x709b('0x56')](_0x14e1bf[_0x709b('0x42')]);_0x390876[_0x709b('0x58')]=_['intersection'](_0x390876['model'],_0x390876[_0x709b('0x42')]);_0x5ea0d2[_0x709b('0x48')]=_[_0x709b('0x59')](_0x390876[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x14e1bf['query'][_0x709b('0x5a')]));_0x5ea0d2[_0x709b('0x48')]=_0x5ea0d2['attributes'][_0x709b('0x4d')]?_0x5ea0d2[_0x709b('0x48')]:_0x390876[_0x709b('0x55')];_0x5ea0d2[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x14e1bf[_0x709b('0x42')]['sort']);_0x5ea0d2[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x14e1bf[_0x709b('0x42')],_0x390876['filters']));if(_0x14e1bf[_0x709b('0x42')]['filter']){_0x5ea0d2['where']=_[_0x709b('0xd6')](_0x5ea0d2[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x5ea0d2['attributes'],function(_0x3fd12e){var _0x512dfd={};_0x512dfd[_0x3fd12e]={'$like':'%'+_0x14e1bf[_0x709b('0x42')][_0x709b('0x31')]+'%'};return _0x512dfd;})});}_0x5ea0d2=_[_0x709b('0xd6')]({},_0x5ea0d2,_0x14e1bf[_0x709b('0x5b')]);return _0xee0614['getOpenchannelAccounts'](_0x5ea0d2);}})['then'](function(_0x1e6efb){if(_0x1e6efb){_0x3d8bd7=_0x1e6efb['length'];if(!_0x14e1bf['query'][_0x709b('0xcd')](_0x709b('0xd8'))){_0x5ea0d2[_0x709b('0x22')]=qs['limit'](_0x14e1bf[_0x709b('0x42')][_0x709b('0x22')]);_0x5ea0d2[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x14e1bf[_0x709b('0x42')]['offset']);}return _0xee0614['getOpenchannelAccounts'](_0x5ea0d2);}})['then'](function(_0x2e85ee){if(_0x2e85ee){return _0x2e85ee?{'count':_0x3d8bd7,'rows':_0x2e85ee}:null;}})[_0x709b('0x13')](respondWithResult(_0x1a317e,null))[_0x709b('0x1d')](handleError(_0x1a317e,null));};exports[_0x709b('0x147')]=function(_0x17f365,_0x5f549a){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x17f365[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x5f549a,null))['then'](function(_0x20b8b3){if(_0x20b8b3){return _0x20b8b3[_0x709b('0x147')](_0x17f365['body'][_0x709b('0x61')],_['omit'](_0x17f365['body'],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0x5f549a,null))[_0x709b('0x1d')](handleError(_0x5f549a,null));};exports[_0x709b('0x148')]=function(_0x554d11,_0x319b93){return db[_0x709b('0x3c')]['find']({'where':{'id':_0x554d11[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x319b93,null))[_0x709b('0x13')](function(_0x3fdab9){if(_0x3fdab9){return _0x3fdab9[_0x709b('0x148')](_0x554d11[_0x709b('0x42')][_0x709b('0x61')]);}})['then'](respondWithStatusCode(_0x319b93,null))[_0x709b('0x1d')](handleError(_0x319b93,null));};exports[_0x709b('0x149')]=function(_0x20e8b7,_0x3843b2){var _0x166a1b={};var _0x2dc6fb={};var _0x25e540;var _0x5f410c;return db[_0x709b('0x3c')]['findOne']({'where':{'id':_0x20e8b7['params']['id']}})['then'](handleEntityNotFound(_0x3843b2,null))['then'](function(_0x301d20){if(_0x301d20){_0x25e540=_0x301d20;_0x2dc6fb[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0x14a')][_0x709b('0xda')]);_0x2dc6fb[_0x709b('0x42')]=_[_0x709b('0x56')](_0x20e8b7['query']);_0x2dc6fb[_0x709b('0x58')]=_[_0x709b('0x59')](_0x2dc6fb['model'],_0x2dc6fb['query']);_0x166a1b[_0x709b('0x48')]=_['intersection'](_0x2dc6fb[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x20e8b7[_0x709b('0x42')][_0x709b('0x5a')]));_0x166a1b[_0x709b('0x48')]=_0x166a1b[_0x709b('0x48')][_0x709b('0x4d')]?_0x166a1b['attributes']:_0x2dc6fb[_0x709b('0x55')];_0x166a1b['order']=qs[_0x709b('0xcb')](_0x20e8b7[_0x709b('0x42')][_0x709b('0xcb')]);_0x166a1b[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x20e8b7[_0x709b('0x42')],_0x2dc6fb['filters']));if(_0x20e8b7[_0x709b('0x42')][_0x709b('0x31')]){_0x166a1b[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x166a1b['where'],{'$or':_[_0x709b('0x33')](_0x166a1b[_0x709b('0x48')],function(_0x50aa1d){var _0x49c3e9={};_0x49c3e9[_0x50aa1d]={'$like':'%'+_0x20e8b7['query'][_0x709b('0x31')]+'%'};return _0x49c3e9;})});}_0x166a1b=_['merge']({},_0x166a1b,_0x20e8b7['options']);return _0x25e540['getSmsAccounts'](_0x166a1b);}})[_0x709b('0x13')](function(_0xe133d1){if(_0xe133d1){_0x5f410c=_0xe133d1['length'];if(!_0x20e8b7[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0x166a1b[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x20e8b7[_0x709b('0x42')]['limit']);_0x166a1b[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x20e8b7['query'][_0x709b('0x24')]);}return _0x25e540[_0x709b('0x149')](_0x166a1b);}})[_0x709b('0x13')](function(_0x4f4551){if(_0x4f4551){return _0x4f4551?{'count':_0x5f410c,'rows':_0x4f4551}:null;}})[_0x709b('0x13')](respondWithResult(_0x3843b2,null))[_0x709b('0x1d')](handleError(_0x3843b2,null));};exports[_0x709b('0x14b')]=function(_0x41db59,_0x3be13d){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x41db59[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x3be13d,null))[_0x709b('0x13')](function(_0x53ee5e){if(_0x53ee5e){return _0x53ee5e[_0x709b('0x14b')](_0x41db59[_0x709b('0x5e')][_0x709b('0x61')],_[_0x709b('0x124')](_0x41db59[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0x3be13d,null))[_0x709b('0x1d')](handleError(_0x3be13d,null));};exports['removeSmsAccounts']=function(_0x1c90a9,_0xc9c250){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x1c90a9['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xc9c250,null))[_0x709b('0x13')](function(_0x2029c5){if(_0x2029c5){return _0x2029c5[_0x709b('0x14c')](_0x1c90a9[_0x709b('0x42')][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0xc9c250,null))[_0x709b('0x1d')](handleError(_0xc9c250,null));};exports[_0x709b('0x14d')]=function(_0x1b66e5,_0x70e01b){var _0x507df1={};var _0x3f45cd={};var _0x267a47;var _0x358e22;return db['User'][_0x709b('0x98')]({'where':{'id':_0x1b66e5[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x70e01b,null))[_0x709b('0x13')](function(_0x1b6e00){if(_0x1b6e00){_0x267a47=_0x1b6e00;_0x3f45cd[_0x709b('0x55')]=_[_0x709b('0x56')](db[_0x709b('0x14e')][_0x709b('0xda')]);_0x3f45cd[_0x709b('0x42')]=_[_0x709b('0x56')](_0x1b66e5[_0x709b('0x42')]);_0x3f45cd[_0x709b('0x58')]=_[_0x709b('0x59')](_0x3f45cd[_0x709b('0x55')],_0x3f45cd[_0x709b('0x42')]);_0x507df1[_0x709b('0x48')]=_['intersection'](_0x3f45cd[_0x709b('0x55')],qs[_0x709b('0x5a')](_0x1b66e5['query'][_0x709b('0x5a')]));_0x507df1[_0x709b('0x48')]=_0x507df1[_0x709b('0x48')][_0x709b('0x4d')]?_0x507df1[_0x709b('0x48')]:_0x3f45cd['model'];_0x507df1[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x1b66e5[_0x709b('0x42')]['sort']);_0x507df1[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x1b66e5['query'],_0x3f45cd['filters']));if(_0x1b66e5[_0x709b('0x42')][_0x709b('0x31')]){_0x507df1['where']=_[_0x709b('0xd6')](_0x507df1[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x507df1['attributes'],function(_0x254751){var _0x4f484e={};_0x4f484e[_0x254751]={'$like':'%'+_0x1b66e5[_0x709b('0x42')]['filter']+'%'};return _0x4f484e;})});}_0x507df1=_[_0x709b('0xd6')]({},_0x507df1,_0x1b66e5[_0x709b('0x5b')]);return _0x267a47[_0x709b('0x14d')](_0x507df1);}})['then'](function(_0x15452c){if(_0x15452c){_0x358e22=_0x15452c[_0x709b('0x4d')];if(!_0x1b66e5['query'][_0x709b('0xcd')](_0x709b('0xd8'))){_0x507df1[_0x709b('0x22')]=qs['limit'](_0x1b66e5[_0x709b('0x42')][_0x709b('0x22')]);_0x507df1['offset']=qs[_0x709b('0x24')](_0x1b66e5[_0x709b('0x42')][_0x709b('0x24')]);}return _0x267a47[_0x709b('0x14d')](_0x507df1);}})[_0x709b('0x13')](function(_0x5958d2){if(_0x5958d2){return _0x5958d2?{'count':_0x358e22,'rows':_0x5958d2}:null;}})['then'](respondWithResult(_0x70e01b,null))[_0x709b('0x1d')](handleError(_0x70e01b,null));};exports['addChatWebsites']=function(_0x566531,_0x347f47){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x566531[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x347f47,null))[_0x709b('0x13')](function(_0x15f2b3){if(_0x15f2b3){return _0x15f2b3['addChatWebsites'](_0x566531['body'][_0x709b('0x61')],_['omit'](_0x566531[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0x347f47,null))[_0x709b('0x1d')](handleError(_0x347f47,null));};exports['removeChatWebsites']=function(_0x1c2ef8,_0x1f44fc){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x1c2ef8[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x1f44fc,null))[_0x709b('0x13')](function(_0x56865f){if(_0x56865f){return _0x56865f[_0x709b('0x14f')](_0x1c2ef8['query'][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0x1f44fc,null))[_0x709b('0x1d')](handleError(_0x1f44fc,null));};exports['getWhatsappAccounts']=function(_0x5393c5,_0x2efc19){var _0x3ded24={};var _0x4c1b42={};var _0x908796;var _0x4ae005;return db[_0x709b('0x3c')][_0x709b('0x98')]({'where':{'id':_0x5393c5[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2efc19,null))[_0x709b('0x13')](function(_0x5c4425){if(_0x5c4425){_0x908796=_0x5c4425;_0x4c1b42[_0x709b('0x55')]=_[_0x709b('0x56')](db['WhatsappAccount'][_0x709b('0xda')]);_0x4c1b42['query']=_['keys'](_0x5393c5[_0x709b('0x42')]);_0x4c1b42['filters']=_[_0x709b('0x59')](_0x4c1b42[_0x709b('0x55')],_0x4c1b42[_0x709b('0x42')]);_0x3ded24[_0x709b('0x48')]=_[_0x709b('0x59')](_0x4c1b42['model'],qs[_0x709b('0x5a')](_0x5393c5['query']['fields']));_0x3ded24[_0x709b('0x48')]=_0x3ded24[_0x709b('0x48')][_0x709b('0x4d')]?_0x3ded24[_0x709b('0x48')]:_0x4c1b42['model'];_0x3ded24[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0x5393c5[_0x709b('0x42')][_0x709b('0xcb')]);_0x3ded24[_0x709b('0x41')]=qs[_0x709b('0x58')](_[_0x709b('0xcc')](_0x5393c5[_0x709b('0x42')],_0x4c1b42[_0x709b('0x58')]));if(_0x5393c5[_0x709b('0x42')]['filter']){_0x3ded24[_0x709b('0x41')]=_['merge'](_0x3ded24['where'],{'$or':_[_0x709b('0x33')](_0x3ded24[_0x709b('0x48')],function(_0x1c9147){var _0x2d8a41={};_0x2d8a41[_0x1c9147]={'$like':'%'+_0x5393c5[_0x709b('0x42')]['filter']+'%'};return _0x2d8a41;})});}_0x3ded24=_[_0x709b('0xd6')]({},_0x3ded24,_0x5393c5[_0x709b('0x5b')]);return _0x908796[_0x709b('0x150')](_0x3ded24);}})[_0x709b('0x13')](function(_0x29e045){if(_0x29e045){_0x4ae005=_0x29e045[_0x709b('0x4d')];if(!_0x5393c5[_0x709b('0x42')]['hasOwnProperty'](_0x709b('0xd8'))){_0x3ded24[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x5393c5[_0x709b('0x42')][_0x709b('0x22')]);_0x3ded24[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x5393c5['query'][_0x709b('0x24')]);}return _0x908796[_0x709b('0x150')](_0x3ded24);}})['then'](function(_0x2b397d){if(_0x2b397d){return _0x2b397d?{'count':_0x4ae005,'rows':_0x2b397d}:null;}})[_0x709b('0x13')](respondWithResult(_0x2efc19,null))[_0x709b('0x1d')](handleError(_0x2efc19,null));};exports['addWhatsappAccounts']=function(_0x577c7a,_0x19d945){return db['User']['find']({'where':{'id':_0x577c7a[_0x709b('0x54')]['id']}})[_0x709b('0x13')](handleEntityNotFound(_0x19d945,null))[_0x709b('0x13')](function(_0x578af2){if(_0x578af2){return _0x578af2['addWhatsappAccounts'](_0x577c7a[_0x709b('0x5e')]['ids'],_[_0x709b('0x124')](_0x577c7a[_0x709b('0x5e')],[_0x709b('0x61'),'id'])||{});}})[_0x709b('0x13')](respondWithResult(_0x19d945,null))[_0x709b('0x1d')](handleError(_0x19d945,null));};exports[_0x709b('0x151')]=function(_0x31106c,_0x515334){return db['User'][_0x709b('0x36')]({'where':{'id':_0x31106c[_0x709b('0x54')]['id']}})['then'](handleEntityNotFound(_0x515334,null))[_0x709b('0x13')](function(_0x37db5c){if(_0x37db5c){return _0x37db5c[_0x709b('0x151')](_0x31106c[_0x709b('0x42')][_0x709b('0x61')]);}})[_0x709b('0x13')](respondWithStatusCode(_0x515334,null))['catch'](handleError(_0x515334,null));};exports[_0x709b('0x152')]=function(_0xb6ddff,_0x3a1e11){var _0x2f050f={},_0x4fea1d={},_0x5528af={'count':0x0,'rows':[]};var _0x2c3609=db[_0x709b('0x153')][_0x709b('0xda')];_0x4fea1d[_0x709b('0x55')]=_['keys'](_0x2c3609);_0x4fea1d[_0x709b('0x42')]=_[_0x709b('0x56')](_0xb6ddff[_0x709b('0x42')]);_0x4fea1d[_0x709b('0x58')]=_[_0x709b('0x59')](_0x4fea1d[_0x709b('0x55')],_0x4fea1d['query']);_0x4fea1d[_0x709b('0x58')]=_[_0x709b('0xc7')](_0x4fea1d[_0x709b('0x58')],['$and',_0x709b('0x154'),'$gt',_0x709b('0x155'),_0x709b('0x156'),_0x709b('0x157'),_0x709b('0x158'),'$eq',_0x709b('0x159'),_0x709b('0x15a'),'$notBetween',_0x709b('0x15b'),_0x709b('0x15c'),_0x709b('0x15d'),'$notLike',_0x709b('0x15e'),'$notILike',_0x709b('0x15d'),_0x709b('0x15f'),_0x709b('0x160'),_0x709b('0x161'),_0x709b('0x162')]);_0x2f050f[_0x709b('0x48')]=_[_0x709b('0x59')](_0x4fea1d[_0x709b('0x55')],qs[_0x709b('0x5a')](_0xb6ddff[_0x709b('0x42')]['fields']));_0x2f050f['attributes']=_0x2f050f[_0x709b('0x48')][_0x709b('0x4d')]?_0x2f050f[_0x709b('0x48')]:_0x4fea1d['model'];if(!_0xb6ddff[_0x709b('0x42')]['hasOwnProperty']('nolimit')){_0x2f050f[_0x709b('0x22')]=qs[_0x709b('0x22')](_0xb6ddff['query']['limit']);_0x2f050f['offset']=qs[_0x709b('0x24')](_0xb6ddff[_0x709b('0x42')][_0x709b('0x24')]);}_0x2f050f[_0x709b('0xca')]=qs[_0x709b('0xcb')](_0xb6ddff[_0x709b('0x42')][_0x709b('0xcb')]);_0x2f050f[_0x709b('0x41')]=qs['filters'](_[_0x709b('0xcc')](_0xb6ddff[_0x709b('0x42')],_0x4fea1d[_0x709b('0x58')]));if(_0xb6ddff[_0x709b('0x42')][_0x709b('0x31')]){_0x2f050f[_0x709b('0x41')]=_[_0x709b('0xd6')](_0x2f050f[_0x709b('0x41')],{'$or':_[_0x709b('0x33')](_0x2f050f[_0x709b('0x48')],function(_0x3133fc){var _0x919a89={};_0x919a89[_0x3133fc]={'$like':'%'+_0xb6ddff['query'][_0x709b('0x31')]+'%'};return _0x919a89;})});}_0x2f050f[_0x709b('0x41')]={'$and':[_0x2f050f['where'],{'$or':[{'UserId':_0xb6ddff['params']['id']},{'OwnerId':_0xb6ddff[_0x709b('0x54')]['id']}]}]};_0x2f050f=_[_0x709b('0xd6')]({},_0x2f050f,_0xb6ddff[_0x709b('0x5b')]);var _0x3c82f6={'where':_0x2f050f[_0x709b('0x41')]};return db[_0x709b('0x153')][_0x709b('0x23')](_0x3c82f6)[_0x709b('0x13')](function(_0x4850cf){_0x5528af['count']=_0x4850cf;if(_0xb6ddff[_0x709b('0x42')]['includeAll']){_0x2f050f[_0x709b('0x44')]=[{'attributes':['id',_0x709b('0x163'),_0x709b('0x164'),_0x709b('0xed')],'model':db[_0x709b('0xc9')],'as':_0x709b('0x165')},{'attributes':['id',_0x709b('0x37'),'dialActive'],'model':db[_0x709b('0xab')],'as':'Queue'}];}return db[_0x709b('0x153')][_0x709b('0x4a')](_0x2f050f);})['then'](function(_0x131918){_0x5528af[_0x709b('0x4b')]=_0x131918;return _0x5528af;})[_0x709b('0x13')](respondWithFilteredResult(_0x3a1e11,_0x2f050f))[_0x709b('0x1d')](handleError(_0x3a1e11,null));};exports[_0x709b('0x166')]=function(_0x136c7d,_0x5e0cd8){if(!_['isNil'](_0x136c7d['user']['id'])&&(_0x136c7d['user']['role']==_0x709b('0x2c')||_0x136c7d[_0x709b('0x2e')][_0x709b('0x27')]==_0x709b('0x2e'))){return db['User'][_0x709b('0x98')]({'where':{'id':_0x136c7d['params']['id']},'raw':!![]})[_0x709b('0x13')](function(_0x899cb4){return authService['retrieveApiKey'](_0x899cb4);})[_0x709b('0x13')](function(_0x440731){if(_0x440731){return _0x5e0cd8[_0x709b('0x1f')](0xc8)[_0x709b('0x20')]({'api_key':_0x440731[_0x709b('0x167')]});}else{return _0x5e0cd8[_0x709b('0x1f')](0xcc)[_0x709b('0x20')]({'message':_0x709b('0x168')});}})[_0x709b('0x1d')](handleError(_0x5e0cd8,0x193));}else{return _0x5e0cd8[_0x709b('0x1f')](0x191)[_0x709b('0x20')]({'message':_0x709b('0x169')});}};exports['createApiKey']=function(_0x28d45f,_0x3cc7b2){if(!_[_0x709b('0x67')](_0x28d45f[_0x709b('0x2e')]['id'])&&(_0x28d45f[_0x709b('0x2e')][_0x709b('0x27')]==_0x709b('0x2c')||_0x28d45f[_0x709b('0x2e')]['role']==_0x709b('0x2e'))){return db[_0x709b('0x3c')][_0x709b('0x36')]({'where':{'id':_0x28d45f[_0x709b('0x54')]['id']}})[_0x709b('0x13')](function(_0xde1771){return authService[_0x709b('0x16a')](_0xde1771);})[_0x709b('0x13')](function(_0x5c6dd4){return db[_0x709b('0x3c')][_0x709b('0x26')]({'apiKeyIat':_0x5c6dd4['iat'],'apiKeyNonce':_0x5c6dd4[_0x709b('0x16b')]},{'where':{'id':_0x28d45f['params']['id']}})[_0x709b('0x13')](function(){return _0x3cc7b2[_0x709b('0x1f')](0xc8)[_0x709b('0x20')]({'api_key':_0x5c6dd4[_0x709b('0x167')]});});})[_0x709b('0x1d')](handleError(_0x3cc7b2,0x193));}else{return _0x3cc7b2['status'](0x191)[_0x709b('0x20')]({'message':_0x709b('0x169')});}};exports[_0x709b('0x16c')]=function(_0x2f881c,_0xa4c7bb){if(!_[_0x709b('0x67')](_0x2f881c[_0x709b('0x2e')]['id'])&&(_0x2f881c[_0x709b('0x2e')][_0x709b('0x27')]==_0x709b('0x2c')||_0x2f881c[_0x709b('0x2e')][_0x709b('0x27')]=='user')){return db[_0x709b('0x3c')]['find']({'where':{'id':_0x2f881c['params']['id']}})[_0x709b('0x13')](handleEntityNotFound(_0xa4c7bb,null))[_0x709b('0x13')](function(_0x41a132){if(_0x41a132&&_0x41a132[_0x709b('0x16d')]&&_0x41a132[_0x709b('0x16e')])return _0x41a132;else throw{'message':'API\x20key\x20not\x20available'};})[_0x709b('0x13')](function(){return db[_0x709b('0x3c')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x2f881c[_0x709b('0x54')]['id']}});})[_0x709b('0x13')](respondWithStatusCode(_0xa4c7bb,0xc8))[_0x709b('0x1d')](handleError(_0xa4c7bb,0x193));}else{return _0xa4c7bb[_0x709b('0x1f')](0x191)[_0x709b('0x20')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x709b('0x16f')]=function(_0x11ef3e,_0x323736){var _0x1f7447=_0x11ef3e[_0x709b('0x2e')][_0x709b('0xd9')]({'plain':!![]});if(!_0x1f7447){return _0x323736[_0x709b('0x1f')](0x191)[_0x709b('0x3a')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise[_0x709b('0x102')]()['then'](function(){if(_0x11ef3e['query']['userSetting']!=='true')return;return _0x11ef3e[_0x709b('0x2e')][_0x709b('0x170')]();})['then'](function(_0x599bfd){if(!_0x599bfd)return;return _0x599bfd[_0x709b('0xd9')]({'plain':!![]});})[_0x709b('0x13')](function(_0x1d7cb4){_0x1f7447[_0x709b('0x45')]=_0x1d7cb4;return _0x323736['status'](0xc8)[_0x709b('0x20')](_0x1f7447);});}};exports['getPresence']=function(_0x274f17,_0x42fedd){var _0x8fdf00={'offset':0x0},_0x7fdc36={'count':0x0,'rows':[]};Promise[_0x709b('0x102')]()[_0x709b('0x13')](function(){if(!_0x274f17[_0x709b('0x42')][_0x709b('0x31')]&&!_0x274f17[_0x709b('0x42')][_0x709b('0x171')]&&!_0x274f17[_0x709b('0x42')]['queues'])return[];return Promise[_0x709b('0x102')]()[_0x709b('0x13')](function(){var _0x4a3f24=[];if(!_[_0x709b('0x8c')](_0x274f17[_0x709b('0x42')][_0x709b('0x171')])){_0x4a3f24[_0x709b('0x49')](db[_0x709b('0x111')][_0x709b('0x4a')]({'attributes':['id',_0x709b('0x37')],'where':{'id':_0x274f17['query']['teams']}}));}if(!_['isEmpty'](_0x274f17['query'][_0x709b('0x172')])){_0x4a3f24[_0x709b('0x49')](db[_0x709b('0xab')]['findAll']({'attributes':['id','name'],'type':'inbound','where':{'id':_0x274f17['query']['queues']}}));}return Promise[_0x709b('0x52')](_0x4a3f24);})[_0x709b('0x13')](function(_0xca6a0b){var _0x2bd6ca=_[_0x709b('0x173')](_0xca6a0b)['map'](function(_0x312584){return _0x312584[_0x709b('0x121')]({'attributes':['id',_0x709b('0x37'),_0x709b('0x62'),'online'],'raw':!![]});});return Promise[_0x709b('0x52')](_0x2bd6ca);})[_0x709b('0x13')](function(_0x2bec14){var _0x1b376b=_[_0x709b('0x173')](_0x2bec14);if(!_0x274f17[_0x709b('0x42')][_0x709b('0x31')])return _0x1b376b;if(_[_0x709b('0x8c')](_0x1b376b)){return db['User'][_0x709b('0x4a')]({'attributes':['id','name','internal',_0x709b('0x9e')],'where':{'role':_0x709b('0x28'),'$or':[db[_0x709b('0x114')]['where'](db[_0x709b('0x114')]['fn'](_0x709b('0x174'),db[_0x709b('0x114')]['col'](_0x709b('0x37'))),{'$like':'%'+_0x274f17[_0x709b('0x42')][_0x709b('0x31')][_0x709b('0xa5')]()+'%'}),{'internal':{'$like':'%'+_0x274f17[_0x709b('0x42')][_0x709b('0x31')]+'%'}}]},'raw':!![]});}else{return _(_0x1b376b)[_0x709b('0x173')]()[_0x709b('0x31')](function(_0x54c817){return _0x54c817[_0x709b('0x37')][_0x709b('0xa5')]()[_0x709b('0x35')](_0x274f17[_0x709b('0x42')][_0x709b('0x31')][_0x709b('0xa5')]())||_0x54c817[_0x709b('0x62')]['toString']()[_0x709b('0x35')](_0x274f17[_0x709b('0x42')][_0x709b('0x31')]);})[_0x709b('0x34')]();}})[_0x709b('0x13')](function(_0x280940){var _0x3a3b48=_0x709b('0x37');var _0x480a9e=_0x709b('0x175');if(_0x274f17[_0x709b('0x42')]['sort']){_0x480a9e=_0x274f17[_0x709b('0x42')][_0x709b('0xcb')][0x0]==='-'?_0x709b('0x176'):_0x709b('0x175');_0x3a3b48=_0x480a9e==='asc'?_0x274f17[_0x709b('0x42')][_0x709b('0xcb')]:_0x274f17[_0x709b('0x42')]['sort'][_0x709b('0x177')](0x1);}return _(_0x280940)[_0x709b('0x178')]('id')[_0x709b('0x179')]([function(_0x585cf8){return _0x3a3b48===_0x709b('0x37')?_0x585cf8[_0x3a3b48][_0x709b('0xa5')]():_0x585cf8[_0x3a3b48];}],[_0x480a9e])['map'](function(_0x3ef19b){return _[_0x709b('0xcc')](_0x3ef19b,['id',_0x709b('0x37'),_0x709b('0x62'),'online']);})['value']();})['then'](function(_0xf9f787){return amiClient[_0x709b('0x12')](_0x709b('0x87'),_0x274f17)[_0x709b('0x13')](function(_0x53fa16){if(_0x53fa16[_0x709b('0x1a')])throw new Error(_0x709b('0x17a'));var _0x232db2=_0x53fa16[_0x709b('0x1c')];var _0x4c398c=jayson['client'][_0x709b('0x11')]({'port':0x232c});return _0x4c398c[_0x709b('0x12')]('Agents',_0x274f17)[_0x709b('0x13')](function(_0x1afaa8){if(_0x1afaa8[_0x709b('0x1a')])throw new Error(_0x709b('0x17b'));var _0x54e90a=_0x1afaa8[_0x709b('0x1c')];return _[_0x709b('0xd6')]({},_0x54e90a,_0x232db2);});})['then'](function(_0x302740){return _[_0x709b('0x33')](_0xf9f787,function(_0x2dad69){var _0x26a1c8=_[_0x709b('0x36')](_0x302740[_0x709b('0x4b')],['id',_0x2dad69['id']]);if(!_0x26a1c8||!_0x2dad69[_0x709b('0x9e')]){_0x2dad69[_0x709b('0x1f')]=_0x709b('0x17c');}else if(_0x26a1c8[_0x709b('0xa0')]){_0x2dad69[_0x709b('0x1f')]=_0x709b('0x17d');}else{_0x2dad69['status']=_[_0x709b('0x35')]([_0x709b('0x17e'),_0x709b('0x17f'),_0x709b('0x180'),'ringing',null,undefined],_0x26a1c8[_0x709b('0x181')])?_0x709b('0x9e'):_0x709b('0x182');}return _0x2dad69;});});});})['then'](function(_0xd4e16e){if(!_0x274f17[_0x709b('0x42')][_0x709b('0xcd')]('nolimit')){_0x8fdf00[_0x709b('0x22')]=qs[_0x709b('0x22')](_0x274f17[_0x709b('0x42')][_0x709b('0x22')]||0xa);_0x8fdf00[_0x709b('0x24')]=qs[_0x709b('0x24')](_0x274f17['query']['offset']);}_0x7fdc36['count']=_0xd4e16e[_0x709b('0x4d')];_0x7fdc36[_0x709b('0x4b')]=_0x8fdf00[_0x709b('0x22')]?_0xd4e16e[_0x709b('0x183')](_0x8fdf00[_0x709b('0x24')],_0x8fdf00[_0x709b('0x24')]+_0x8fdf00['limit']):_0xd4e16e;return _0x7fdc36;})[_0x709b('0x13')](respondWithFilteredResult(_0x42fedd,_0x8fdf00))['catch'](handleError(_0x42fedd,null));};function get_open_tabs(_0x3534c6,_0x228a58){var _0x4ac860=_0x3534c6[_0x709b('0x184')](0x0)[_0x709b('0x185')]()+_0x3534c6['slice'](0x1);var _0x4406f3={'type':db[_0x709b('0x91')][_0x709b('0x6a')][_0x709b('0x6b')],'raw':!![]};return new Promise(function(_0x41242c,_0x2a0d51){var _0x4bc732=squel[_0x709b('0x186')]()['field'](_0x709b('0x187')+_0x4ac860+_0x709b('0x188'),'id')[_0x709b('0x189')](_0x709b('0x18a'))[_0x709b('0x6c')](_0x709b('0x18b')+_0x3534c6+_0x709b('0x18c'),'ui')['where'](_0x709b('0x18d'),_0x228a58['id']);return db[_0x709b('0x114')][_0x709b('0x42')](_0x4bc732[_0x709b('0x18e')](),_0x4406f3)[_0x709b('0x13')](function(_0x8b3134){_0x228a58[_0x4ac860+'OpenTabs']=_0x8b3134;_0x41242c(_0x8b3134);})['catch'](function(_0x1c697e){_0x2a0d51(_0x1c697e);});});}
\ No newline at end of file
+var _0x3efa=['then','role','agent','emit','userNotification:recalc:','destroy','admin','Users','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','stack','index','User','rawAttributes','fieldName','key','password','salt','getOptions','where','query','includeAll','include','userSetting','UserSetting','push','rows','openTabs','length','chat','sms','dataValues','mail','openchannel','whatsapp','show','model','differenceBy','keys','filters','intersection','fields','attributes','true','merge','options','fax','all','catch','body','params','describe','addContacts','ids','omit','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','email','permissions','101','103','113','110','104','105','106','108','109','111','114','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','isEmpty','autoAssociation','compact','changePassword','oldPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','penalty','spread','toLowerCase','Queue:save','VoiceQueue','findAll','get','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queues','isArray','Queue:remove','QueueId','voice','addAvatar','userpic','file','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','order','sort','pick','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getGroups','ChatGroup','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','online','QueuePause','updateAttributes','type','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','Team','getTeams','addTeams','getAssociatedQueues','flattenDeep','addAgent','Voice','UserVoicePrefix','VoicePrefixId','getDataValue','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','TeamVoicePrefix','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','lastName','CmContact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','getUserSetting','queues','teams','getAgents','lower','col','flatten','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.createdAt','user_has_','_interactions','util','squel','jayson/promise','../../components/auth/service','api','../../config/utils','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','handleError','register','redis','localhost','client','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update'];(function(_0x2a0b33,_0xd86f59){var _0x13dc62=function(_0x1a14ce){while(--_0x1a14ce){_0x2a0b33['push'](_0x2a0b33['shift']());}};_0x13dc62(++_0xd86f59);}(_0x3efa,0x169));var _0xa3ef=function(_0x1925c6,_0x154d01){_0x1925c6=_0x1925c6-0x0;var _0x236a1a=_0x3efa[_0x1925c6];return _0x236a1a;};'use strict';var moment=require('moment');var util=require(_0xa3ef('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xa3ef('0x1'));var jayson=require(_0xa3ef('0x2'));var Redis=require('ioredis');var authService=require(_0xa3ef('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xa3ef('0x4'));var utils=require(_0xa3ef('0x5'));var config=require(_0xa3ef('0x6'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require('../../errors/api')[_0xa3ef('0x7')];var APINotFoundError=require(_0xa3ef('0x8'))[_0xa3ef('0x9')];var APIHandleError=require('../../errors/api')[_0xa3ef('0xa')];var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0xa3ef('0xb')](socket);config[_0xa3ef('0xc')]=_['defaults'](config[_0xa3ef('0xc')],{'host':_0xa3ef('0xd'),'port':0x18eb});var amiClient=jayson[_0xa3ef('0xe')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x2c664f,_0x4c848a,_0x1fcb07,_0x281243){return new Promise(function(_0x4c4c7e,_0x29f2da){var _0x4129f3=_0x281243||amiClient;return _0x4129f3['request'](_0x2c664f,_0x1fcb07)['then'](function(_0x451a59){logger[_0xa3ef('0xf')](_0xa3ef('0x10'),_0x4c848a,_0xa3ef('0x11'));logger[_0xa3ef('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x4c848a,'request\x20sent',JSON[_0xa3ef('0x13')](_0x451a59));if(_0x451a59['error']){if(_0x451a59['error'][_0xa3ef('0x14')]===0x1f4){logger[_0xa3ef('0x15')]('User,\x20%s,\x20%s',_0x4c848a,_0x451a59[_0xa3ef('0x15')][_0xa3ef('0x16')]);return _0x29f2da(_0x451a59[_0xa3ef('0x15')][_0xa3ef('0x16')]);}logger[_0xa3ef('0x15')](_0xa3ef('0x10'),_0x4c848a,_0x451a59[_0xa3ef('0x15')]['message']);return _0x4c4c7e(_0x451a59[_0xa3ef('0x15')][_0xa3ef('0x16')]);}else{logger[_0xa3ef('0xf')]('User,\x20%s,\x20%s',_0x4c848a,_0xa3ef('0x11'));_0x4c4c7e(_0x451a59[_0xa3ef('0x17')][_0xa3ef('0x16')]);}})['catch'](function(_0x5ae463){logger[_0xa3ef('0x15')](_0xa3ef('0x10'),_0x4c848a,_0x5ae463);_0x29f2da(_0x5ae463);});});}function respondWithStatusCode(_0x10ca10,_0x5e87c3){_0x5e87c3=_0x5e87c3||0xcc;return function(_0x15152b){if(_0x15152b){return _0x10ca10[_0xa3ef('0x18')](_0x5e87c3);}return _0x10ca10['status'](_0x5e87c3)[_0xa3ef('0x19')]();};}function respondWithResult(_0x2aece2,_0x38ed40){_0x38ed40=_0x38ed40||0xc8;return function(_0x5e8a0a){if(_0x5e8a0a){return _0x2aece2[_0xa3ef('0x1a')](_0x38ed40)[_0xa3ef('0x1b')](_0x5e8a0a);}};}function respondWithFilteredResult(_0x12451c,_0x9a165f){return function(_0xfba86b){if(_0xfba86b){var _0xddca67=typeof _0x9a165f[_0xa3ef('0x1c')]==='undefined'&&typeof _0x9a165f[_0xa3ef('0x1d')]===_0xa3ef('0x1e');var _0x1bbe6b=_0xfba86b['count'];var _0x3e88cb=_0xddca67?0x0:_0x9a165f['offset'];var _0x536958=_0xddca67?_0xfba86b[_0xa3ef('0x1f')]:_0x9a165f[_0xa3ef('0x1c')]+_0x9a165f[_0xa3ef('0x1d')];var _0x3f65a0;if(_0x536958>=_0x1bbe6b){_0x536958=_0x1bbe6b;_0x3f65a0=0xc8;}else{_0x3f65a0=0xce;}_0x12451c['status'](_0x3f65a0);return _0x12451c[_0xa3ef('0x20')](_0xa3ef('0x21'),_0x3e88cb+'-'+_0x536958+'/'+_0x1bbe6b)[_0xa3ef('0x1b')](_0xfba86b);}return null;};}function saveUpdates(_0x193cf3){return function(_0x585529){if(_0x585529){return _0x585529[_0xa3ef('0x22')](_0x193cf3)[_0xa3ef('0x23')](function(_0x4c5b8a){if(_0x4c5b8a[_0xa3ef('0x24')]===_0xa3ef('0x25')){socket[_0xa3ef('0x26')](_0xa3ef('0x27')+_0x4c5b8a['id'],_0x4c5b8a);}return _0x4c5b8a;});}return null;};}function removeEntity(_0x3cd182){return function(_0x5e8dce){if(_0x5e8dce){return _0x5e8dce[_0xa3ef('0x28')]()['then'](function(){var _0x1b632b=_0x5e8dce['get']({'plain':!![]});if(_0x1b632b[_0xa3ef('0x24')]===_0xa3ef('0x29'))return;var _0x55f4e4=[{'name':_0xa3ef('0x2a'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xa3ef('0x25'),'ignore':![]},{'name':_0xa3ef('0x2b'),'value':_0xa3ef('0x2c'),'ignore':![]}];var _0x200575=_(_0x55f4e4)[_0xa3ef('0x2d')]('ignore')[_0xa3ef('0x2e')](_0xa3ef('0x2f'))[_0xa3ef('0x2f')]();if(_[_0xa3ef('0x30')](_0x200575,_0x1b632b[_0xa3ef('0x24')])){return;}var _0xb19c2b=_[_0xa3ef('0x31')](_0x55f4e4,[_0xa3ef('0x2f'),_0x1b632b['role']])[_0xa3ef('0x32')];return db[_0xa3ef('0x33')]['destroy']({'where':{'type':_0xb19c2b,'resourceId':_0x1b632b['id']}})['then'](function(){return _0x5e8dce;});})[_0xa3ef('0x23')](function(){_0x3cd182[_0xa3ef('0x1a')](0xcc)[_0xa3ef('0x19')]();});}};}function handleEntityNotFound(_0x263c77){return function(_0x4142c6){if(!_0x4142c6){_0x263c77[_0xa3ef('0x18')](0x194);}return _0x4142c6;};}function handleError(_0x1605e8,_0x192d45){_0x192d45=_0x192d45||0x1f4;return function(_0x2c77ed){logger[_0xa3ef('0x15')](_0x2c77ed[_0xa3ef('0x34')]);if(_0x2c77ed['name']){delete _0x2c77ed['name'];}_0x1605e8[_0xa3ef('0x1a')](_0x192d45)['send'](_0x2c77ed);};}exports[_0xa3ef('0x35')]=function(_0x58c541,_0x152f3e){var _0x2ed84b={},_0x8749d2={'count':0x0,'rows':[]};var _0x4ca5c6=_(db[_0xa3ef('0x36')][_0xa3ef('0x37')])['map'](function(_0x2bf4cf){return{'name':_0x2bf4cf[_0xa3ef('0x38')],'type':_0x2bf4cf['type'][_0xa3ef('0x39')]};})[_0xa3ef('0x2d')](function(_0x4784f4){return!_[_0xa3ef('0x30')]([_0xa3ef('0x3a'),_0xa3ef('0x3b')],_0x4784f4[_0xa3ef('0x32')]);})['value']();_0x2ed84b=qs[_0xa3ef('0x3c')](_0x4ca5c6,_0x58c541);var _0x241ecb={'where':_0x2ed84b[_0xa3ef('0x3d')]};return db[_0xa3ef('0x36')][_0xa3ef('0x1f')](_0x241ecb)[_0xa3ef('0x23')](function(_0x1d97f7){_0x8749d2[_0xa3ef('0x1f')]=_0x1d97f7;if(_0x58c541[_0xa3ef('0x3e')][_0xa3ef('0x3f')]){_0x2ed84b[_0xa3ef('0x40')]=[{'all':!![]}];}if(_0x58c541['query'][_0xa3ef('0x41')]==='true'){_0x2ed84b['include']=[{'model':db[_0xa3ef('0x42')],'as':'userSetting'}];}if(!_[_0xa3ef('0x30')](_0x2ed84b['attributes'],'id')){_0x2ed84b['attributes'][_0xa3ef('0x43')]('id');}return db['User']['findAll'](_0x2ed84b);})[_0xa3ef('0x23')](function(_0x4534ad){_0x8749d2[_0xa3ef('0x44')]=_0x4534ad;if(_0x58c541['query'][_0xa3ef('0x45')]==='true'){var _0x2813c1=[];for(var _0x21d608=0x0;_0x21d608<_0x8749d2[_0xa3ef('0x44')][_0xa3ef('0x46')];_0x21d608++){_0x2813c1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x47'),_0x8749d2[_0xa3ef('0x44')][_0x21d608]['dataValues']));_0x2813c1['push'](get_open_tabs(_0xa3ef('0x48'),_0x8749d2[_0xa3ef('0x44')][_0x21d608][_0xa3ef('0x49')]));_0x2813c1['push'](get_open_tabs('fax',_0x8749d2['rows'][_0x21d608][_0xa3ef('0x49')]));_0x2813c1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x4a'),_0x8749d2['rows'][_0x21d608][_0xa3ef('0x49')]));_0x2813c1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x4b'),_0x8749d2['rows'][_0x21d608][_0xa3ef('0x49')]));_0x2813c1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x4c'),_0x8749d2[_0xa3ef('0x44')][_0x21d608][_0xa3ef('0x49')]));}return Promise['all'](_0x2813c1)[_0xa3ef('0x23')](function(){return _0x8749d2;});}else{return _0x8749d2;}})[_0xa3ef('0x23')](respondWithFilteredResult(_0x152f3e,_0x2ed84b))['catch'](handleError(_0x152f3e,null));};exports[_0xa3ef('0x4d')]=function(_0x478034,_0x4de1b1){var _0x5d7c6e={'raw':![],'where':{'id':_0x478034['params']['id']}},_0x5a0db8={};_0x5a0db8[_0xa3ef('0x4e')]=_[_0xa3ef('0x4f')](_['keys'](db[_0xa3ef('0x36')]['rawAttributes']),[_0xa3ef('0x3a'),_0xa3ef('0x3b')]);_0x5a0db8[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x478034[_0xa3ef('0x3e')]);_0x5a0db8[_0xa3ef('0x51')]=_['intersection'](_0x5a0db8[_0xa3ef('0x4e')],_0x5a0db8[_0xa3ef('0x3e')]);_0x5d7c6e['attributes']=_[_0xa3ef('0x52')](_0x5a0db8['model'],qs[_0xa3ef('0x53')](_0x478034[_0xa3ef('0x3e')]['fields']));_0x5d7c6e[_0xa3ef('0x54')]=_0x5d7c6e[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x5d7c6e[_0xa3ef('0x54')]:_0x5a0db8[_0xa3ef('0x4e')];if(_0x478034['query'][_0xa3ef('0x3f')]){_0x5d7c6e['include']=[{'all':!![]}];}if(_0x478034[_0xa3ef('0x3e')][_0xa3ef('0x41')]===_0xa3ef('0x55')){_0x5d7c6e['include']=[{'model':db['UserSetting'],'as':_0xa3ef('0x41')}];}_0x5d7c6e=_[_0xa3ef('0x56')]({},_0x5d7c6e,_0x478034[_0xa3ef('0x57')]);if(!_[_0xa3ef('0x30')](_0x5d7c6e[_0xa3ef('0x54')],'id')){_0x5d7c6e[_0xa3ef('0x54')][_0xa3ef('0x43')]('id');}return db[_0xa3ef('0x36')][_0xa3ef('0x31')](_0x5d7c6e)[_0xa3ef('0x23')](handleEntityNotFound(_0x4de1b1,null))[_0xa3ef('0x23')](function(_0x4cdf08){var _0x7a29c8=[];values=_0x4cdf08;if(_0x478034[_0xa3ef('0x3e')][_0xa3ef('0x45')]===_0xa3ef('0x55')){_0x7a29c8[_0xa3ef('0x43')](get_open_tabs('chat',_0x4cdf08[_0xa3ef('0x49')]));_0x7a29c8['push'](get_open_tabs(_0xa3ef('0x48'),_0x4cdf08[_0xa3ef('0x49')]));_0x7a29c8[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x4b'),_0x4cdf08[_0xa3ef('0x49')]));_0x7a29c8[_0xa3ef('0x43')](get_open_tabs('whatsapp',_0x4cdf08[_0xa3ef('0x49')]));_0x7a29c8[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x58'),_0x4cdf08['dataValues']));_0x7a29c8[_0xa3ef('0x43')](get_open_tabs('mail',_0x4cdf08[_0xa3ef('0x49')]));return Promise[_0xa3ef('0x59')](_0x7a29c8);}else{return values;}})[_0xa3ef('0x23')](function(){return values;})[_0xa3ef('0x23')](respondWithResult(_0x4de1b1,null))[_0xa3ef('0x5a')](handleError(_0x4de1b1,null));};exports[_0xa3ef('0x22')]=function(_0x437586,_0x431848){if(_0x437586[_0xa3ef('0x5b')]['id']){delete _0x437586['body']['id'];}delete _0x437586[_0xa3ef('0x5b')]['role'];return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x437586[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x431848,null))[_0xa3ef('0x23')](saveUpdates(_0x437586[_0xa3ef('0x5b')],null))[_0xa3ef('0x23')](respondWithResult(_0x431848,null))[_0xa3ef('0x5a')](handleError(_0x431848,null));};exports[_0xa3ef('0x5d')]=function(_0x5f3232,_0x1a7d45){return db['User']['describe']()[_0xa3ef('0x23')](respondWithResult(_0x1a7d45,null))[_0xa3ef('0x5a')](handleError(_0x1a7d45,null));};exports[_0xa3ef('0x5e')]=function(_0x55caa8,_0x5ebcbe){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x55caa8['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x5ebcbe,null))[_0xa3ef('0x23')](function(_0x53ce26){if(_0x53ce26){return _0x53ce26['addContacts'](_0x55caa8[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x55caa8[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{});}})[_0xa3ef('0x23')](respondWithResult(_0x5ebcbe,null))[_0xa3ef('0x5a')](handleError(_0x5ebcbe,null));};function validateUser(_0x374626){return new Promise(function(_0x85f236,_0x47a266){if(_0x374626['internal'])return _0x85f236(_0x374626);return db['Setting'][_0xa3ef('0x61')](0x1)[_0xa3ef('0x23')](function(_0x1c829f){if(_0x1c829f[_0xa3ef('0x62')])authService[_0xa3ef('0x63')](_0x374626[_0xa3ef('0x3a')]);db[_0xa3ef('0x36')][_0xa3ef('0x64')](_0xa3ef('0x65'))[_0xa3ef('0x23')](function(_0x10deed){if(_[_0xa3ef('0x66')](_0x10deed)){_0x374626[_0xa3ef('0x65')]=_0x1c829f[_0xa3ef('0x67')]||0x1;return;}if(_[_0xa3ef('0x66')](_0x1c829f[_0xa3ef('0x67')])||_0x1c829f[_0xa3ef('0x67')]===_0x10deed){_0x374626[_0xa3ef('0x65')]=_0x10deed+0x1;return;}if(_0x1c829f['min_internal']>_0x10deed){_0x374626[_0xa3ef('0x65')]=_0x1c829f[_0xa3ef('0x67')];return;}return db[_0xa3ef('0x68')][_0xa3ef('0x3e')](_0xa3ef('0x69'),{'type':db[_0xa3ef('0x68')]['QueryTypes'][_0xa3ef('0x6a')]})[_0xa3ef('0x23')](function(_0xf09926){if(_0xf09926&&_0xf09926[_0xa3ef('0x46')]){for(var _0x47945b=0x0,_0x2b9de9=_0xf09926[_0xa3ef('0x46')];_0x47945b<_0x2b9de9&&_['isNil'](_0x374626['internal']);_0x47945b++){if(_0x1c829f['min_internal']<=_0xf09926[_0x47945b][_0xa3ef('0x6b')]){_0x374626['internal']=_0xf09926[_0x47945b]['from'];}else if(_0x1c829f['min_internal']>_0xf09926[_0x47945b][_0xa3ef('0x6b')]&&_0x1c829f[_0xa3ef('0x67')]<=_0xf09926[_0x47945b]['to']){_0x374626['internal']=_0x1c829f['min_internal'];}}}if(_[_0xa3ef('0x66')](_0x374626[_0xa3ef('0x65')])){_0x374626['internal']=_0x10deed+0x1;}return _0x85f236(_0x374626);});});})[_0xa3ef('0x5a')](function(_0x329aab){_0x47a266(_0x329aab);});});}function updateUser(_0x225fe8){return new Promise(function(_0x14a73a,_0x3bf8e5){try{if(_0x225fe8[_0xa3ef('0x6c')]){_0x225fe8[_0xa3ef('0x6d')]=_0x225fe8[_0xa3ef('0x65')];_0x225fe8[_0xa3ef('0x6e')]={'mailbox':_0x225fe8['internal'],'password':_0x225fe8[_0xa3ef('0x3a')],'fullname':_0x225fe8['fullname'],'email':_0x225fe8[_0xa3ef('0x6f')]};}if(_0x225fe8[_0xa3ef('0x24')]===_0xa3ef('0x25')){if(!_0x225fe8[_0xa3ef('0x70')])_0x225fe8[_0xa3ef('0x70')]=[_0xa3ef('0x71'),'102',_0xa3ef('0x72'),_0xa3ef('0x73'),_0xa3ef('0x74'),_0xa3ef('0x75'),_0xa3ef('0x76'),_0xa3ef('0x77'),'107',_0xa3ef('0x78'),_0xa3ef('0x79'),'100',_0xa3ef('0x7a'),_0xa3ef('0x7b'),_0xa3ef('0x7c')];}_0x14a73a(_0x225fe8);}catch(_0x22704c){_0x3bf8e5(_0x22704c);}});}exports[_0xa3ef('0x7d')]=function(_0x2a0c25,_0x1c5888){if(_0x2a0c25[_0xa3ef('0x7e')][_0xa3ef('0x24')]===_0xa3ef('0x25'))throw new Error(_0xa3ef('0x7f'));if(_0x2a0c25[_0xa3ef('0x5b')][_0xa3ef('0x24')]===_0xa3ef('0x7e')&&_0x2a0c25[_0xa3ef('0x7e')]['role']!=='admin'){throw new Error(_0xa3ef('0x80'));}if(_0x2a0c25[_0xa3ef('0x5b')][_0xa3ef('0x24')]===_0xa3ef('0x29')&&_0x2a0c25['user'][_0xa3ef('0x24')]!=='admin'){throw new Error(_0xa3ef('0x81'));}return licenseUtil[_0xa3ef('0x82')]([_0x2a0c25[_0xa3ef('0x5b')]])['then'](function(){return validateUser(_0x2a0c25[_0xa3ef('0x5b')]);})[_0xa3ef('0x23')](function(_0x4ec45f){return updateUser(_0x4ec45f)[_0xa3ef('0x23')](function(_0x55e8f2){if(_0x55e8f2['role']===_0xa3ef('0x29')){_0x55e8f2[_0xa3ef('0x83')]=_0x2a0c25[_0xa3ef('0x7e')][_0xa3ef('0x83')];delete _0x55e8f2[_0xa3ef('0x84')];}return _0x55e8f2;});})[_0xa3ef('0x23')](function(_0x2f9453){return db[_0xa3ef('0x36')][_0xa3ef('0x7d')](_0x2f9453,{'include':[{'model':db[_0xa3ef('0x6e')],'as':_0xa3ef('0x6e')}]});})[_0xa3ef('0x23')](function(_0x507b63){if(_0x2a0c25[_0xa3ef('0x5b')][_0xa3ef('0x24')]==='user')return _0x507b63;if(_0x2a0c25[_0xa3ef('0x7e')][_0xa3ef('0x24')]!==_0xa3ef('0x7e'))return _0x507b63;return db[_0xa3ef('0x85')]['find']({'where':{'name':_0x507b63[_0xa3ef('0x24')]==='agent'?_0xa3ef('0x86'):'Telephones','userProfileId':_0x2a0c25[_0xa3ef('0x7e')]['userProfileId']},'raw':!![]})[_0xa3ef('0x23')](function(_0x323573){if(!_0x323573||_0x323573['autoAssociation']!=0x0)return _0x507b63;return db[_0xa3ef('0x33')][_0xa3ef('0x7d')]({'name':_0x507b63[_0xa3ef('0x32')],'resourceId':_0x507b63['id'],'type':_0x323573[_0xa3ef('0x32')],'sectionId':_0x323573['id']},{})['then'](function(){return _0x507b63;});})['catch'](function(_0x39f19a){logger[_0xa3ef('0x15')](_0xa3ef('0x87'),_0x39f19a);throw _0x39f19a;});})[_0xa3ef('0x23')](respondWithResult(_0x1c5888,0xc9))[_0xa3ef('0x5a')](handleError(_0x1c5888,null));};exports[_0xa3ef('0x88')]=function(_0x31ca94,_0x489107){var _0x51d725=_0x31ca94[_0xa3ef('0x5b')];var _0xa008ee=[];if(_0x31ca94[_0xa3ef('0x7e')][_0xa3ef('0x24')]===_0xa3ef('0x25'))throw new Error(_0xa3ef('0x7f'));if(_[_0xa3ef('0x89')](_0x51d725,[_0xa3ef('0x24'),_0xa3ef('0x7e')])&&_0x31ca94['user']['role']!==_0xa3ef('0x29')){throw new Error(_0xa3ef('0x80'));}if(_[_0xa3ef('0x89')](_0x51d725,[_0xa3ef('0x24'),'admin'])&&_0x31ca94[_0xa3ef('0x7e')]['role']!==_0xa3ef('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xa3ef('0x82')](_0x51d725)[_0xa3ef('0x23')](function(){return validateUser(_0x51d725[0x0]);})[_0xa3ef('0x23')](function(){for(var _0x3d40a5=0x1;_0x3d40a5<_0x51d725[_0xa3ef('0x46')];_0x3d40a5++){var _0x512e41=_0x51d725[_0x3d40a5-0x1][_0xa3ef('0x65')];if(!_0x51d725[_0x3d40a5][_0xa3ef('0x65')])_0x51d725[_0x3d40a5][_0xa3ef('0x65')]=_0x512e41+0x1;_0xa008ee[_0xa3ef('0x43')](validateUser(_0x51d725[_0x3d40a5]));}return Promise[_0xa3ef('0x59')](_0xa008ee);})['then'](function(){_0xa008ee=[];for(var _0x4b73a8=0x0;_0x4b73a8<_0x51d725['length'];_0x4b73a8++){_0xa008ee[_0xa3ef('0x43')](updateUser(_0x51d725[_0x4b73a8]));}return Promise[_0xa3ef('0x59')](_0xa008ee);})[_0xa3ef('0x23')](function(){_0xa008ee=_0x51d725[_0xa3ef('0x2e')](function(_0x6a056d){return db[_0xa3ef('0x36')][_0xa3ef('0x7d')](_0x6a056d,{'include':[{'model':db[_0xa3ef('0x6e')],'as':_0xa3ef('0x6e')}]})[_0xa3ef('0x23')](function(_0x329c9b){_0x6a056d['id']=_0x329c9b['id'];return _0x6a056d;});});return Promise[_0xa3ef('0x59')](_0xa008ee);})[_0xa3ef('0x23')](function(_0x590b24){if(_0x31ca94[_0xa3ef('0x5b')][_0xa3ef('0x24')]===_0xa3ef('0x7e'))return _0x590b24;if(_0x31ca94[_0xa3ef('0x7e')][_0xa3ef('0x24')]!==_0xa3ef('0x7e'))return _0x590b24;var _0x12641d=_[_0xa3ef('0x89')](_0x590b24,function(_0x56bb6a){return _0x56bb6a[_0xa3ef('0x24')]==='agent'||_0x56bb6a[_0xa3ef('0x24')]===_0xa3ef('0x2c');});if(!_0x12641d)return _0x590b24;return db[_0xa3ef('0x85')]['findAll']({'where':{'name':{'$or':[_0xa3ef('0x86'),_0xa3ef('0x2b')]},'userProfileId':_0x31ca94[_0xa3ef('0x7e')][_0xa3ef('0x84')]},'raw':!![]})[_0xa3ef('0x23')](function(_0x3e53e3){if(_[_0xa3ef('0x8a')](_0x3e53e3)||!_[_0xa3ef('0x89')](_0x3e53e3,[_0xa3ef('0x8b'),0x0]))return _0x590b24;_0xa008ee=[];var _0x10621d=_(_0x3e53e3)[_0xa3ef('0x2e')](function(_0x182746){if(_0x182746[_0xa3ef('0x8b')]===0x1)return;return _0x182746[_0xa3ef('0x32')]==='Agents'?'agent':_0xa3ef('0x2c');})[_0xa3ef('0x8c')]()[_0xa3ef('0x2f')]();for(var _0x2eeb90=0x0;_0x2eeb90<_0x590b24[_0xa3ef('0x46')];_0x2eeb90++){if(!_[_0xa3ef('0x30')](_0x10621d,_0x590b24[_0x2eeb90][_0xa3ef('0x24')]))return;var _0x479ef5=_0x590b24[_0x2eeb90]['role']==='agent'?'Agents':_0xa3ef('0x2b');_0xa008ee[_0xa3ef('0x43')](db[_0xa3ef('0x33')]['create']({'name':_0x590b24[_0x2eeb90][_0xa3ef('0x32')],'resourceId':_0x590b24[_0x2eeb90]['id'],'type':_0x479ef5,'sectionId':_[_0xa3ef('0x31')](_0x3e53e3,[_0xa3ef('0x32'),_0x479ef5])['id']},{}));}return Promise[_0xa3ef('0x59')](_0xa008ee);});})[_0xa3ef('0x23')](respondWithResult(_0x489107,0xc9))[_0xa3ef('0x5a')](handleError(_0x489107,null));};exports[_0xa3ef('0x8d')]=function(_0x7aab14,_0x3f66ee){if(_0x7aab14[_0xa3ef('0x5b')]['id']){delete _0x7aab14['body']['id'];}return db[_0xa3ef('0x36')]['find']({'where':{'id':_0x7aab14[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](function(_0x128252){if(!_0x128252)return null;if(_0x128252['id']===_0x7aab14['user']['id']){if(!_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x8e')]||!_0x7aab14[_0xa3ef('0x5b')]['newPassword']){throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x128252[_0xa3ef('0x91')](_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x8e')])){throw new db['Sequelize'][(_0xa3ef('0x90'))](_0xa3ef('0x92'));}if(_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x8e')]===_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x93')]){throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))](_0xa3ef('0x94'));}}else if(_0x7aab14[_0xa3ef('0x7e')][_0xa3ef('0x24')]===_0xa3ef('0x29')){if(!_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x93')]){throw new db['Sequelize']['ValidationError'](_0xa3ef('0x95'));}}else if(_0x7aab14[_0xa3ef('0x7e')][_0xa3ef('0x24')]===_0xa3ef('0x7e')){if(!_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x93')]){throw new db[(_0xa3ef('0x8f'))]['ValidationError'](_0xa3ef('0x95'));}if(_0x128252[_0xa3ef('0x24')]!==_0xa3ef('0x25')){throw new db['Sequelize'][(_0xa3ef('0x90'))](_0xa3ef('0x7f'));}}else{throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))](_0xa3ef('0x7f'));}return _0x128252;})[_0xa3ef('0x23')](handleEntityNotFound(_0x3f66ee,null))[_0xa3ef('0x23')](function(_0x1ab175){return db[_0xa3ef('0x96')][_0xa3ef('0x97')]({'attributes':['id',_0xa3ef('0x62'),_0xa3ef('0x98'),_0xa3ef('0x99')]})['then'](function(_0x564b28){if(_0x564b28[_0xa3ef('0x62')])authService[_0xa3ef('0x63')](_0x7aab14['body'][_0xa3ef('0x93')]);if(!_0x564b28[_0xa3ef('0x98')]||!_0x1ab175[_0xa3ef('0x9a')])return _0x1ab175;authService[_0xa3ef('0x9b')](_0x7aab14[_0xa3ef('0x5b')]['newPassword'],_0x1ab175[_0xa3ef('0x9a')],_0x564b28[_0xa3ef('0x99')]);return _0x1ab175;})[_0xa3ef('0x23')](saveUpdates({'password':_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x93')],'passwordResetAt':_0x7aab14[_0xa3ef('0x7e')]['id']==_0x7aab14[_0xa3ef('0x5c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x7aab14[_0xa3ef('0x5b')][_0xa3ef('0x93')],_0x1ab175[_0xa3ef('0x9a')])},null));})[_0xa3ef('0x23')](respondWithResult(_0x3f66ee,null))[_0xa3ef('0x5a')](handleError(_0x3f66ee,null));};exports[_0xa3ef('0x9c')]=function(_0x5d4c1b,_0x2aed99){var _0x4596bd=_0x5d4c1b['body']['channel'];return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x5d4c1b['params']['id']},'attributes':['id','name',_0xa3ef('0x24'),'online',_0xa3ef('0x9d'),_0xa3ef('0x9e'),_0xa3ef('0x9f')]})['then'](handleEntityNotFound(_0x2aed99,null))['then'](function(_0xdcfbce){if(_0xdcfbce){if(!utils[_0xa3ef('0xa0')](_0x4596bd)){throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))](_0xa3ef('0xa1'));}return _0xdcfbce[_0xa3ef('0xa2')+_[_0xa3ef('0xa3')](_0x4596bd['toLowerCase']())+'Queues'](_0x5d4c1b[_0xa3ef('0x5b')][_0xa3ef('0x5f')],{'penalty':_0x5d4c1b[_0xa3ef('0x5b')][_0xa3ef('0xa4')]||0x0})[_0xa3ef('0xa5')](function(_0x20c9af){for(var _0x7f0257=0x0;_0x7f0257<_0x5d4c1b[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x7f0257+=0x1){var _0x397c19={'UserId':Number(_0x5d4c1b[_0xa3ef('0x5c')]['id'])};_0x397c19[_[_0xa3ef('0xa3')](_0x4596bd[_0xa3ef('0xa6')]())+'QueueId']=Number(_0x5d4c1b['body'][_0xa3ef('0x5f')][_0x7f0257]);socket[_0xa3ef('0x26')]('user'+_[_0xa3ef('0xa3')](_0x4596bd[_0xa3ef('0xa6')]())+_0xa3ef('0xa7'),_0x397c19);}return _0x20c9af;})[_0xa3ef('0x23')](function(){if(_0x4596bd==='voice'){return db[_0xa3ef('0xa8')][_0xa3ef('0xa9')]({'where':{'id':_0x5d4c1b[_0xa3ef('0x5b')][_0xa3ef('0x5f')]||[]},'raw':!![],'attributes':['id',_0xa3ef('0x32')]});}})[_0xa3ef('0x23')](function(_0x2d235a){var _0x348f57=_0xdcfbce[_0xa3ef('0xaa')]({'plain':!![]});var _0x142d7a=[];if(_0x4596bd==='voice'&&_0x348f57[_0xa3ef('0x24')]===_0xa3ef('0x25')&&_0x348f57['online']){for(let _0x3e230b=0x0;_0x3e230b<_0x2d235a['length'];_0x3e230b+=0x1){_0x142d7a[_0xa3ef('0x43')]({'membername':_0x348f57[_0xa3ef('0x32')],'UserId':_0x348f57['id'],'queue_name':_0x2d235a[_0x3e230b]['name'],'VoiceQueueId':_0x2d235a[_0x3e230b]['id'],'interface':_[_0xa3ef('0x66')](_0x348f57[_0xa3ef('0x9f')])?util[_0xa3ef('0xab')](_0xa3ef('0xac'),_0x348f57[_0xa3ef('0x32')]):_0x348f57[_0xa3ef('0x9f')],'paused':_0x348f57[_0xa3ef('0x9e')]||![],'penalty':_0x5d4c1b[_0xa3ef('0x5b')]['penalty']||0x0});}return Promise['all'](_0x142d7a[_0xa3ef('0x2e')](function(_0x174a54){return db[_0xa3ef('0xad')][_0xa3ef('0xae')](_0x174a54);}));}return _0xdcfbce;});}})[_0xa3ef('0x23')](respondWithStatusCode(_0x2aed99,null))[_0xa3ef('0x5a')](handleError(_0x2aed99,null));};exports[_0xa3ef('0xaf')]=function(_0x5a13cb,_0x4bddca){var _0x5eba89,_0x378801;return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x5a13cb['params']['id']},'attributes':['id','name',_0xa3ef('0x24')]})[_0xa3ef('0x23')](handleEntityNotFound(_0x4bddca,null))[_0xa3ef('0x23')](function(_0x127408){if(_0x127408){_0x5eba89=_0x127408;if(!_0x5a13cb['query'][_0xa3ef('0xb0')]||!utils[_0xa3ef('0xa0')](_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0xb0')])){throw new db[(_0xa3ef('0x8f'))]['ValidationError'](_0xa3ef('0xa1'));}return _0x127408[_0xa3ef('0xb1')+_[_0xa3ef('0xa3')](_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0xb0')]['toLowerCase']())+_0xa3ef('0xb2')](_0x5a13cb[_0xa3ef('0x3e')]['ids']);}})[_0xa3ef('0x23')](function(_0x59b118){if(_[_0xa3ef('0xb3')](_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0x5f')])){for(var _0x26ac22=0x0;_0x26ac22<_0x5a13cb['query']['ids'][_0xa3ef('0x46')];_0x26ac22+=0x1){_0x378801={'UserId':Number(_0x5a13cb['params']['id'])};_0x378801[_['capitalize'](_0x5a13cb['query'][_0xa3ef('0xb0')]['toLowerCase']())+'QueueId']=Number(_0x5a13cb['query'][_0xa3ef('0x5f')][_0x26ac22]);socket[_0xa3ef('0x26')](_0xa3ef('0x7e')+_[_0xa3ef('0xa3')](_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0xb0')][_0xa3ef('0xa6')]())+_0xa3ef('0xb4'),_0x378801);}}else{_0x378801={'UserId':Number(_0x5a13cb[_0xa3ef('0x5c')]['id'])};_0x378801[_[_0xa3ef('0xa3')](_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0xb0')]['toLowerCase']())+_0xa3ef('0xb5')]=Number(_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);socket['emit']('user'+_[_0xa3ef('0xa3')](_0x5a13cb['query']['channel'][_0xa3ef('0xa6')]())+_0xa3ef('0xb4'),_0x378801);}return _0x59b118;})[_0xa3ef('0x23')](function(){if(_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0xb0')]===_0xa3ef('0xb6')){return db['UserVoiceQueueRt'][_0xa3ef('0x28')]({'where':{'UserId':_0x5a13cb['params']['id'],'VoiceQueueId':_0x5a13cb[_0xa3ef('0x3e')][_0xa3ef('0x5f')]},'individualHooks':!![]})[_0xa3ef('0x23')](function(){return _0x5eba89;});}return _0x5eba89;})[_0xa3ef('0x23')](respondWithStatusCode(_0x4bddca,null))[_0xa3ef('0x5a')](handleError(_0x4bddca,null));};exports[_0xa3ef('0xb7')]=function(_0x17f5c3,_0x411516){_0x17f5c3[_0xa3ef('0x5b')][_0xa3ef('0xb8')]=_0x17f5c3[_0xa3ef('0xb9')]['filename'];return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x17f5c3[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x411516,null))['then'](saveUpdates(_0x17f5c3[_0xa3ef('0x5b')],null))['then'](respondWithResult(_0x411516,null))['catch'](handleError(_0x411516,null));};exports['getAvatar']=function(_0x2c0cb3,_0x2fe1a6){var _0x42b0c3=path[_0xa3ef('0xba')](config[_0xa3ef('0xbb')],_0xa3ef('0xbc'));return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x2c0cb3['params']['id']},'attributes':['id',_0xa3ef('0xb8')],'raw':!![]})[_0xa3ef('0x23')](handleEntityNotFound(_0x2fe1a6,null))['then'](function(_0x14a767){if(_0x14a767){if(_[_0xa3ef('0x66')](_0x14a767[_0xa3ef('0xb8')])){return _0x2fe1a6['download'](_0x42b0c3);}else{if(!fs[_0xa3ef('0xbd')](path[_0xa3ef('0xba')](config[_0xa3ef('0xbb')],_0xa3ef('0xbe'),_0x14a767[_0xa3ef('0xb8')]))){return _0x2fe1a6[_0xa3ef('0xbf')](_0x42b0c3);}return _0x2fe1a6[_0xa3ef('0xbf')](path[_0xa3ef('0xba')](config[_0xa3ef('0xbb')],_0xa3ef('0xbe'),_0x14a767['userpic']));}}})[_0xa3ef('0x5a')](handleError(_0x2fe1a6,null));};exports[_0xa3ef('0xc0')]=function(_0x70e8ec,_0x4f8f0f){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x70e8ec[_0xa3ef('0x5c')]['id']},'attributes':['id']})[_0xa3ef('0x23')](handleEntityNotFound(_0x4f8f0f,null))[_0xa3ef('0x23')](function(_0x4eb06c){var _0x1b78d1=[];values=_0x4eb06c[_0xa3ef('0x49')];_0x1b78d1['push'](get_open_tabs(_0xa3ef('0x47'),_0x4eb06c['dataValues']));_0x1b78d1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x48'),_0x4eb06c[_0xa3ef('0x49')]));_0x1b78d1[_0xa3ef('0x43')](get_open_tabs('openchannel',_0x4eb06c[_0xa3ef('0x49')]));_0x1b78d1[_0xa3ef('0x43')](get_open_tabs(_0xa3ef('0x4c'),_0x4eb06c[_0xa3ef('0x49')]));_0x1b78d1['push'](get_open_tabs(_0xa3ef('0x58'),_0x4eb06c[_0xa3ef('0x49')]));_0x1b78d1[_0xa3ef('0x43')](get_open_tabs('mail',_0x4eb06c[_0xa3ef('0x49')]));return Promise[_0xa3ef('0x59')](_0x1b78d1);})[_0xa3ef('0x23')](function(_0x17d51d){if(_0x17d51d){var _0x5219b6=_[_0xa3ef('0x2e')](values[_0xa3ef('0xc1')],function(_0x4d38a1){return{'channel':_0xa3ef('0xc2'),'id':_0x4d38a1['id'],'createdAt':_0x4d38a1[_0xa3ef('0xc3')]};});var _0x4d1f74=_[_0xa3ef('0x2e')](values[_0xa3ef('0xc4')],function(_0x570853){return{'channel':'FAX','id':_0x570853['id'],'createdAt':_0x570853['createdAt']};});var _0x39c16a=_[_0xa3ef('0x2e')](values[_0xa3ef('0xc5')],function(_0x4eb374){return{'channel':'OPENCHANNEL','id':_0x4eb374['id'],'createdAt':_0x4eb374['createdAt']};});var _0x269525=_['map'](values[_0xa3ef('0xc6')],function(_0x1d1f36){return{'channel':_0xa3ef('0xc7'),'id':_0x1d1f36['id'],'createdAt':_0x1d1f36[_0xa3ef('0xc3')]};});var _0x25d67b=_[_0xa3ef('0x2e')](values['SmsOpenTabs'],function(_0x2915ad){return{'channel':_0xa3ef('0xc8'),'id':_0x2915ad['id'],'createdAt':_0x2915ad[_0xa3ef('0xc3')]};});var _0x263492=_[_0xa3ef('0x2e')](values[_0xa3ef('0xc9')],function(_0x4c8f8a){return{'channel':_0xa3ef('0xca'),'id':_0x4c8f8a['id'],'createdAt':_0x4c8f8a[_0xa3ef('0xc3')]};});var _0x5da1f7=_[_0xa3ef('0xcb')](_0x5219b6,_0x4d1f74,_0x39c16a,_0x269525,_0x25d67b,_0x263492);var _0x44ad58={'count':_0x5da1f7[_0xa3ef('0x46')],'rows':_0x5da1f7};return _0x44ad58;}else return null;})[_0xa3ef('0x23')](respondWithResult(_0x4f8f0f,null))[_0xa3ef('0x5a')](handleError(_0x4f8f0f,null));};exports[_0xa3ef('0xcc')]=function(_0x33b6d7,_0x57bc3c){var _0x22ccdd={};var _0x2b45b4={};var _0x7529b7;var _0x1097bb;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x33b6d7['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x57bc3c,null))[_0xa3ef('0x23')](function(_0x1e1c6d){if(_0x1e1c6d){_0x7529b7=_0x1e1c6d;_0x2b45b4[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db['CmContact'][_0xa3ef('0x37')]);_0x2b45b4[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x33b6d7['query']);_0x2b45b4[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x2b45b4[_0xa3ef('0x4e')],_0x2b45b4[_0xa3ef('0x3e')]);_0x22ccdd[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x2b45b4[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x33b6d7[_0xa3ef('0x3e')]['fields']));_0x22ccdd[_0xa3ef('0x54')]=_0x22ccdd[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x22ccdd[_0xa3ef('0x54')]:_0x2b45b4[_0xa3ef('0x4e')];_0x22ccdd[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x33b6d7[_0xa3ef('0x3e')]['sort']);_0x22ccdd[_0xa3ef('0x3d')]=qs['filters'](_[_0xa3ef('0xcf')](_0x33b6d7[_0xa3ef('0x3e')],_0x2b45b4[_0xa3ef('0x51')]));if(_0x33b6d7['query'][_0xa3ef('0x2d')]){_0x22ccdd['where']=_[_0xa3ef('0x56')](_0x22ccdd[_0xa3ef('0x3d')],{'$or':_['map'](_0x22ccdd[_0xa3ef('0x54')],function(_0x46ffe2){var _0x44c9d1={};_0x44c9d1[_0x46ffe2]={'$like':'%'+_0x33b6d7[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x44c9d1;})});}_0x22ccdd=_['merge']({},_0x22ccdd,_0x33b6d7[_0xa3ef('0x57')]);return _0x7529b7['getContacts'](_0x22ccdd);}})[_0xa3ef('0x23')](function(_0x5f294b){if(_0x5f294b){_0x1097bb=_0x5f294b[_0xa3ef('0x46')];if(_0x33b6d7[_0xa3ef('0x3e')][_0xa3ef('0xd0')]('includeAll')){_0x22ccdd[_0xa3ef('0x40')]=[{'model':db['CmList'],'as':_0xa3ef('0xd1'),'required':![]},{'model':db[_0xa3ef('0xd2')],'as':_0xa3ef('0xd3'),'attributes':['id','name',_0xa3ef('0xd4')],'where':_0x33b6d7['query'][_0xa3ef('0xd5')]?{'id':_0x33b6d7[_0xa3ef('0x3e')][_0xa3ef('0xd5')]}:undefined,'required':_0x33b6d7[_0xa3ef('0x3e')][_0xa3ef('0xd5')]?!![]:![]}];}if(!_0x33b6d7[_0xa3ef('0x3e')]['hasOwnProperty'](_0xa3ef('0xd6'))){_0x22ccdd[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x33b6d7[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x22ccdd[_0xa3ef('0x1c')]=qs['offset'](_0x33b6d7['query'][_0xa3ef('0x1c')]);}return _0x7529b7[_0xa3ef('0xcc')](_0x22ccdd);}})['then'](function(_0x109551){if(_0x109551){return _0x109551?{'count':_0x1097bb,'rows':_0x109551}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x57bc3c,null))[_0xa3ef('0x5a')](handleError(_0x57bc3c,null));};exports[_0xa3ef('0xd7')]=function(_0x4a125e,_0x454c4f){var _0x4581ba;var _0x1f4aba={};var _0x2da36a;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x4a125e['params']['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x454c4f,null))[_0xa3ef('0x23')](function(_0x23bdaf){if(!utils[_0xa3ef('0xa0')](_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0xb0')])){throw new db[(_0xa3ef('0x8f'))]['ValidationError'](_0xa3ef('0xa1'));}_0x4581ba=_0x23bdaf;var _0x58b837={};_0x58b837['model']=_[_0xa3ef('0x50')](db[_[_0xa3ef('0xa3')](_0x4a125e[_0xa3ef('0x3e')]['channel'])+_0xa3ef('0xd8')][_0xa3ef('0x37')]);_0x58b837[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x4a125e[_0xa3ef('0x3e')]);_0x58b837[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x58b837[_0xa3ef('0x4e')],_0x58b837['query']);_0x1f4aba[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x58b837[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x4a125e['query']['fields']));_0x1f4aba[_0xa3ef('0x54')]=_0x1f4aba['attributes']['length']?_0x1f4aba[_0xa3ef('0x54')]:_0x58b837['model'];_0x1f4aba[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x4a125e[_0xa3ef('0x3e')]['sort']);_0x1f4aba[_0xa3ef('0x3d')]=qs['filters'](_[_0xa3ef('0xcf')](_0x4a125e[_0xa3ef('0x3e')],_0x58b837[_0xa3ef('0x51')]));if(_0x4a125e[_0xa3ef('0x3e')]['filter']){_0x1f4aba[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x1f4aba['where'],{'$or':_[_0xa3ef('0x2e')](_0x1f4aba[_0xa3ef('0x54')],function(_0x32ec53){var _0x542a6f={};_0x542a6f[_0x32ec53]={'$like':'%'+_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x542a6f;})});}_0x1f4aba=_['merge']({},_0x1f4aba,_0x4a125e['options']);switch(_0x4581ba[_0xa3ef('0x24')]){case'admin':return db[_[_0xa3ef('0xa3')](_0x4a125e['query'][_0xa3ef('0xb0')])+'Queue']['findAll'](_0x1f4aba);case _0xa3ef('0x7e'):case _0xa3ef('0x25'):return _0x4581ba['get'+_[_0xa3ef('0xa3')](_0x4a125e[_0xa3ef('0x3e')]['channel'])+'Queues'](_0x1f4aba);default:throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))](_0xa3ef('0xd9'));}})[_0xa3ef('0x23')](function(_0x25f991){_0x2da36a=_0x25f991['length'];if(!_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x1f4aba[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x1f4aba[_0xa3ef('0x1c')]=qs['offset'](_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}switch(_0x4581ba[_0xa3ef('0x24')]){case _0xa3ef('0x29'):return db[_[_0xa3ef('0xa3')](_0x4a125e['query'][_0xa3ef('0xb0')])+_0xa3ef('0xd8')]['findAll'](_0x1f4aba);case'user':case _0xa3ef('0x25'):return _0x4581ba[_0xa3ef('0xaa')+_[_0xa3ef('0xa3')](_0x4a125e[_0xa3ef('0x3e')][_0xa3ef('0xb0')])+_0xa3ef('0xb2')](_0x1f4aba);}})[_0xa3ef('0x23')](function(_0x3d6867){return{'count':_0x2da36a,'rows':_0x3d6867};})[_0xa3ef('0x23')](respondWithResult(_0x454c4f,null))[_0xa3ef('0x5a')](handleError(_0x454c4f,null));};exports['getVoiceQueuesRt']=function(_0x3ab9c9,_0x1a9537){var _0x15e840={};var _0x2c7025={};var _0x57e07a;var _0x35843a;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x3ab9c9['params']['id']}})['then'](handleEntityNotFound(_0x1a9537,null))[_0xa3ef('0x23')](function(_0x357639){if(_0x357639){_0x57e07a=_0x357639;_0x2c7025['model']=_[_0xa3ef('0x50')](db[_0xa3ef('0xad')][_0xa3ef('0x37')]);_0x2c7025['query']=_[_0xa3ef('0x50')](_0x3ab9c9[_0xa3ef('0x3e')]);_0x2c7025[_0xa3ef('0x51')]=_['intersection'](_0x2c7025[_0xa3ef('0x4e')],_0x2c7025[_0xa3ef('0x3e')]);_0x15e840[_0xa3ef('0x54')]=_['intersection'](_0x2c7025[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x3ab9c9[_0xa3ef('0x3e')]['fields']));_0x15e840['attributes']=_0x15e840[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x15e840['attributes']:_0x2c7025[_0xa3ef('0x4e')];_0x15e840[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x3ab9c9[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x15e840[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_['pick'](_0x3ab9c9[_0xa3ef('0x3e')],_0x2c7025['filters']));if(_0x3ab9c9['query']['filter']){_0x15e840[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x15e840[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x15e840['attributes'],function(_0x430b55){var _0x129363={};_0x129363[_0x430b55]={'$like':'%'+_0x3ab9c9[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x129363;})});}_0x15e840=_[_0xa3ef('0x56')]({},_0x15e840,_0x3ab9c9['options']);return _0x57e07a['getVoiceQueuesRt'](_0x15e840);}})[_0xa3ef('0x23')](function(_0x45f42f){if(_0x45f42f){_0x35843a=_0x45f42f[_0xa3ef('0x46')];if(!_0x3ab9c9['query'][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x15e840[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x3ab9c9[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x15e840[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x3ab9c9[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x57e07a['getVoiceQueuesRt'](_0x15e840);}})['then'](function(_0x20d3e5){if(_0x20d3e5){return _0x20d3e5?{'count':_0x35843a,'rows':_0x20d3e5}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x1a9537,null))[_0xa3ef('0x5a')](handleError(_0x1a9537,null));};exports[_0xa3ef('0xda')]=function(_0x1bb117,_0x1997f9){var _0x336c05={};var _0x30a78b={};var _0x2ccfa4;var _0x20597b;return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x1bb117[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x1997f9,null))[_0xa3ef('0x23')](function(_0x354e9b){if(_0x354e9b){_0x2ccfa4=_0x354e9b;_0x30a78b[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0xdb')][_0xa3ef('0x37')]);_0x30a78b[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x1bb117[_0xa3ef('0x3e')]);_0x30a78b[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x30a78b[_0xa3ef('0x4e')],_0x30a78b[_0xa3ef('0x3e')]);_0x336c05[_0xa3ef('0x54')]=_['intersection'](_0x30a78b['model'],qs[_0xa3ef('0x53')](_0x1bb117[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x336c05[_0xa3ef('0x54')]=_0x336c05[_0xa3ef('0x54')]['length']?_0x336c05[_0xa3ef('0x54')]:_0x30a78b['model'];_0x336c05[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x1bb117[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x336c05[_0xa3ef('0x3d')]=qs['filters'](_[_0xa3ef('0xcf')](_0x1bb117[_0xa3ef('0x3e')],_0x30a78b[_0xa3ef('0x51')]));if(_0x1bb117[_0xa3ef('0x3e')]['filter']){_0x336c05['where']=_['merge'](_0x336c05[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x336c05['attributes'],function(_0x2871d7){var _0x573bab={};_0x573bab[_0x2871d7]={'$like':'%'+_0x1bb117['query']['filter']+'%'};return _0x573bab;})});}_0x336c05=_[_0xa3ef('0x56')]({},_0x336c05,_0x1bb117[_0xa3ef('0x57')]);return _0x2ccfa4[_0xa3ef('0xda')](_0x336c05);}})[_0xa3ef('0x23')](function(_0x428f13){if(_0x428f13){_0x20597b=_0x428f13[_0xa3ef('0x46')];if(!_0x1bb117[_0xa3ef('0x3e')][_0xa3ef('0xd0')]('nolimit')){_0x336c05[_0xa3ef('0x1d')]=qs['limit'](_0x1bb117['query']['limit']);_0x336c05[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x1bb117[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x2ccfa4['getGroups'](_0x336c05);}})[_0xa3ef('0x23')](function(_0x4e1c9e){if(_0x4e1c9e){return _0x4e1c9e?{'count':_0x20597b,'rows':_0x4e1c9e}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x1997f9,null))['catch'](handleError(_0x1997f9,null));};exports['getRecordings']=function(_0x15dea3,_0x473be3){var _0x5639f9={'raw':!![],'where':{}};var _0x5e2eda={};var _0x241a4e={'count':0x0,'rows':[]};return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x15dea3[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x473be3,null))['then'](function(_0x313427){if(_0x313427){_0x5e2eda[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0xdc')][_0xa3ef('0x37')]);_0x5e2eda[_0xa3ef('0x3e')]=_['keys'](_0x15dea3[_0xa3ef('0x3e')]);_0x5e2eda['filters']=_[_0xa3ef('0x52')](_0x5e2eda[_0xa3ef('0x4e')],_0x5e2eda['query']);_0x5639f9['attributes']=_[_0xa3ef('0x52')](_0x5e2eda[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x15dea3['query'][_0xa3ef('0x53')]));_0x5639f9[_0xa3ef('0x54')]=_0x5639f9[_0xa3ef('0x54')]['length']?_0x5639f9['attributes']:_0x5e2eda[_0xa3ef('0x4e')];if(!_0x15dea3[_0xa3ef('0x3e')][_0xa3ef('0xd0')]('nolimit')){_0x5639f9[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x15dea3[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x5639f9[_0xa3ef('0x1c')]=qs['offset'](_0x15dea3[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}_0x5639f9[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x15dea3['query'][_0xa3ef('0xce')]);_0x5639f9[_0xa3ef('0x3d')]=qs['filters'](_['pick'](_0x15dea3['query'],_0x5e2eda[_0xa3ef('0x51')]));_0x5639f9[_0xa3ef('0x3d')][_0xa3ef('0xdd')]=_0x313427['id'];if(_0x15dea3[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x5639f9['where']=_[_0xa3ef('0x56')](_0x5639f9[_0xa3ef('0x3d')],{'$or':_['map'](_0x5639f9[_0xa3ef('0x54')],function(_0x236298){var _0x359cda={};_0x359cda[_0x236298]={'$like':'%'+_0x15dea3['query'][_0xa3ef('0x2d')]+'%'};return _0x359cda;})});}_0x5639f9=_[_0xa3ef('0x56')]({},_0x5639f9,_0x15dea3['options']);return db['VoiceRecording'][_0xa3ef('0x1f')]({'where':_0x5639f9[_0xa3ef('0x3d')]})[_0xa3ef('0x23')](function(_0xe2b5eb){_0x241a4e[_0xa3ef('0x1f')]=_0xe2b5eb;if(_0x15dea3[_0xa3ef('0x3e')]['includeAll']){_0x5639f9[_0xa3ef('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa3ef('0xa9')](_0x5639f9);})[_0xa3ef('0x23')](function(_0x41f076){_0x241a4e[_0xa3ef('0x44')]=_0x41f076;return _0x241a4e;});}})[_0xa3ef('0x23')](respondWithFilteredResult(_0x473be3,_0x5639f9))[_0xa3ef('0x5a')](handleError(_0x473be3,null));};exports['getScreenRecordings']=function(_0x51e55f,_0x37d84c){var _0x3eaa40={'raw':!![],'where':{}};var _0x185452={};var _0x59c2fc={'count':0x0,'rows':[]};return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x51e55f['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x37d84c,null))[_0xa3ef('0x23')](function(_0x29cd6a){if(_0x29cd6a){_0x185452[_0xa3ef('0x4e')]=_['keys'](db[_0xa3ef('0xde')][_0xa3ef('0x37')]);_0x185452[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x51e55f[_0xa3ef('0x3e')]);_0x185452['filters']=_[_0xa3ef('0x52')](_0x185452[_0xa3ef('0x4e')],_0x185452['query']);_0x3eaa40['attributes']=_['intersection'](_0x185452[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x51e55f['query'][_0xa3ef('0x53')]));_0x3eaa40['attributes']=_0x3eaa40['attributes'][_0xa3ef('0x46')]?_0x3eaa40[_0xa3ef('0x54')]:_0x185452[_0xa3ef('0x4e')];if(!_0x51e55f[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x3eaa40[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x51e55f[_0xa3ef('0x3e')]['limit']);_0x3eaa40[_0xa3ef('0x1c')]=qs['offset'](_0x51e55f['query']['offset']);}_0x3eaa40[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x51e55f['query'][_0xa3ef('0xce')]);_0x3eaa40[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_['pick'](_0x51e55f['query'],_0x185452[_0xa3ef('0x51')]));_0x3eaa40['where'][_0xa3ef('0xdd')]=_0x29cd6a['id'];if(_0x51e55f[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x3eaa40[_0xa3ef('0x3d')]=_['merge'](_0x3eaa40[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x3eaa40[_0xa3ef('0x54')],function(_0xf8969){var _0x467538={};_0x467538[_0xf8969]={'$like':'%'+_0x51e55f[_0xa3ef('0x3e')]['filter']+'%'};return _0x467538;})});}_0x3eaa40=_['merge']({},_0x3eaa40,_0x51e55f['options']);return db[_0xa3ef('0xde')]['count']({'where':_0x3eaa40['where']})[_0xa3ef('0x23')](function(_0x1664b9){_0x59c2fc[_0xa3ef('0x1f')]=_0x1664b9;if(_0x51e55f[_0xa3ef('0x3e')][_0xa3ef('0x3f')]){_0x3eaa40[_0xa3ef('0x40')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3eaa40);})[_0xa3ef('0x23')](function(_0x32ccf3){_0x59c2fc['rows']=_0x32ccf3;return _0x59c2fc;});}})[_0xa3ef('0x23')](respondWithFilteredResult(_0x37d84c,_0x3eaa40))[_0xa3ef('0x5a')](handleError(_0x37d84c,null));};exports[_0xa3ef('0xdf')]=function(_0x188917,_0x50df53){var _0x40b7eb={};var _0xa3ac00={};var _0x26396b;var _0x45f038;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x188917[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x50df53,null))[_0xa3ef('0x23')](function(_0x5953e9){if(_0x5953e9){_0x26396b=_0x5953e9;_0xa3ac00[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0xe0')][_0xa3ef('0x37')]);_0xa3ac00[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x188917['query']);_0xa3ac00[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0xa3ac00['model'],_0xa3ac00[_0xa3ef('0x3e')]);_0x40b7eb[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0xa3ac00[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x188917[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x40b7eb[_0xa3ef('0x54')]=_0x40b7eb[_0xa3ef('0x54')]['length']?_0x40b7eb['attributes']:_0xa3ac00[_0xa3ef('0x4e')];_0x40b7eb[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x188917[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x40b7eb[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x188917['query'],_0xa3ac00[_0xa3ef('0x51')]));if(_0x188917[_0xa3ef('0x3e')]['filter']){_0x40b7eb['where']=_[_0xa3ef('0x56')](_0x40b7eb[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x40b7eb[_0xa3ef('0x54')],function(_0x3a9d3b){var _0xc55f78={};_0xc55f78[_0x3a9d3b]={'$like':'%'+_0x188917[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0xc55f78;})});}_0x40b7eb=_['merge']({},_0x40b7eb,_0x188917[_0xa3ef('0x57')]);return _0x26396b[_0xa3ef('0xdf')](_0x40b7eb);}})['then'](function(_0x4d0bc2){if(_0x4d0bc2){_0x45f038=_0x4d0bc2[_0xa3ef('0x46')];if(!_0x188917[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x40b7eb[_0xa3ef('0x1d')]=qs['limit'](_0x188917[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x40b7eb['offset']=qs[_0xa3ef('0x1c')](_0x188917['query']['offset']);}return _0x26396b['getChatInteractions'](_0x40b7eb);}})[_0xa3ef('0x23')](function(_0x16996e){if(_0x16996e){return _0x16996e?{'count':_0x45f038,'rows':_0x16996e}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x50df53,null))[_0xa3ef('0x5a')](handleError(_0x50df53,null));};exports['getOpenchannelInteractions']=function(_0x5afb53,_0x2d9f78){var _0x41cacc={};var _0x501623={};var _0x334194;var _0x1cdb4d;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x5afb53[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x2d9f78,null))[_0xa3ef('0x23')](function(_0x10c4a8){if(_0x10c4a8){_0x334194=_0x10c4a8;_0x501623['model']=_[_0xa3ef('0x50')](db[_0xa3ef('0xe1')][_0xa3ef('0x37')]);_0x501623[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x5afb53[_0xa3ef('0x3e')]);_0x501623[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x501623[_0xa3ef('0x4e')],_0x501623[_0xa3ef('0x3e')]);_0x41cacc[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x501623['model'],qs[_0xa3ef('0x53')](_0x5afb53[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x41cacc[_0xa3ef('0x54')]=_0x41cacc[_0xa3ef('0x54')]['length']?_0x41cacc['attributes']:_0x501623[_0xa3ef('0x4e')];_0x41cacc[_0xa3ef('0xcd')]=qs['sort'](_0x5afb53[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x41cacc[_0xa3ef('0x3d')]=qs['filters'](_['pick'](_0x5afb53[_0xa3ef('0x3e')],_0x501623[_0xa3ef('0x51')]));if(_0x5afb53[_0xa3ef('0x3e')]['filter']){_0x41cacc[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x41cacc[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x41cacc[_0xa3ef('0x54')],function(_0x5d5241){var _0x40b925={};_0x40b925[_0x5d5241]={'$like':'%'+_0x5afb53['query'][_0xa3ef('0x2d')]+'%'};return _0x40b925;})});}_0x41cacc=_[_0xa3ef('0x56')]({},_0x41cacc,_0x5afb53[_0xa3ef('0x57')]);return _0x334194[_0xa3ef('0xe2')](_0x41cacc);}})['then'](function(_0x1a4248){if(_0x1a4248){_0x1cdb4d=_0x1a4248['length'];if(!_0x5afb53[_0xa3ef('0x3e')]['hasOwnProperty'](_0xa3ef('0xd6'))){_0x41cacc[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x5afb53[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x41cacc['offset']=qs['offset'](_0x5afb53[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x334194[_0xa3ef('0xe2')](_0x41cacc);}})[_0xa3ef('0x23')](function(_0x962d4f){if(_0x962d4f){return _0x962d4f?{'count':_0x1cdb4d,'rows':_0x962d4f}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x2d9f78,null))[_0xa3ef('0x5a')](handleError(_0x2d9f78,null));};exports[_0xa3ef('0xe3')]=function(_0x2c115f,_0x2dbbf1){var _0x1453e1={'raw':!![],'where':{}};var _0x5db77e={};var _0x1b3f70={'count':0x0,'rows':[]};return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x2c115f[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x2dbbf1,null))[_0xa3ef('0x23')](function(_0x731fe8){if(_0x731fe8){_0x5db77e[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0xe4')][_0xa3ef('0x37')]);_0x5db77e[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x2c115f[_0xa3ef('0x3e')]);_0x5db77e['filters']=_[_0xa3ef('0x52')](_0x5db77e['model'],_0x5db77e[_0xa3ef('0x3e')]);_0x1453e1[_0xa3ef('0x54')]=_['intersection'](_0x5db77e[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x2c115f[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x1453e1[_0xa3ef('0x54')]=_0x1453e1[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x1453e1['attributes']:_0x5db77e[_0xa3ef('0x4e')];if(!_0x2c115f['query'][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x1453e1[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x2c115f['query'][_0xa3ef('0x1d')]);_0x1453e1[_0xa3ef('0x1c')]=qs['offset'](_0x2c115f[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}_0x1453e1[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x2c115f[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x1453e1['where']=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x2c115f[_0xa3ef('0x3e')],_0x5db77e[_0xa3ef('0x51')]));_0x1453e1[_0xa3ef('0x3d')]['UserId']=_0x731fe8['id'];if(_0x2c115f[_0xa3ef('0x3e')]['filter']){_0x1453e1['where']=_[_0xa3ef('0x56')](_0x1453e1[_0xa3ef('0x3d')],{'$or':_['map'](_0x1453e1['attributes'],function(_0x562d73){var _0xfe3172={};_0xfe3172[_0x562d73]={'$like':'%'+_0x2c115f['query'][_0xa3ef('0x2d')]+'%'};return _0xfe3172;})});}_0x1453e1=_[_0xa3ef('0x56')]({},_0x1453e1,_0x2c115f[_0xa3ef('0x57')]);return db[_0xa3ef('0xe4')][_0xa3ef('0x1f')]({'where':_0x1453e1['where']})[_0xa3ef('0x23')](function(_0x30db89){_0x1b3f70[_0xa3ef('0x1f')]=_0x30db89;if(_0x2c115f[_0xa3ef('0x3e')][_0xa3ef('0x3f')]){_0x1453e1[_0xa3ef('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0xa3ef('0xa9')](_0x1453e1);})['then'](function(_0x49ebc3){_0x1b3f70['rows']=_0x49ebc3;return _0x1b3f70;});}})[_0xa3ef('0x23')](respondWithFilteredResult(_0x2dbbf1,_0x1453e1))[_0xa3ef('0x5a')](handleError(_0x2dbbf1,null));};exports[_0xa3ef('0xe5')]=function(_0x5e935b,_0xe61eb9){var _0x107b5e={};var _0x57a6f5={};var _0x43c434;var _0x587103;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x5e935b[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0xe61eb9,null))[_0xa3ef('0x23')](function(_0x1b6c32){if(_0x1b6c32){_0x43c434=_0x1b6c32;_0x57a6f5[_0xa3ef('0x4e')]=_['keys'](db[_0xa3ef('0xe6')]['rawAttributes']);_0x57a6f5[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x5e935b[_0xa3ef('0x3e')]);_0x57a6f5[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x57a6f5['model'],_0x57a6f5[_0xa3ef('0x3e')]);_0x107b5e[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x57a6f5[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x5e935b[_0xa3ef('0x3e')]['fields']));_0x107b5e['attributes']=_0x107b5e[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x107b5e['attributes']:_0x57a6f5[_0xa3ef('0x4e')];_0x107b5e[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x5e935b[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x107b5e[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x5e935b[_0xa3ef('0x3e')],_0x57a6f5[_0xa3ef('0x51')]));if(_0x5e935b[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x107b5e[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x107b5e[_0xa3ef('0x3d')],{'$or':_['map'](_0x107b5e[_0xa3ef('0x54')],function(_0x3090bc){var _0x1501b0={};_0x1501b0[_0x3090bc]={'$like':'%'+_0x5e935b[_0xa3ef('0x3e')]['filter']+'%'};return _0x1501b0;})});}_0x107b5e=_[_0xa3ef('0x56')]({},_0x107b5e,_0x5e935b[_0xa3ef('0x57')]);return _0x43c434['getSmsInteractions'](_0x107b5e);}})[_0xa3ef('0x23')](function(_0x24afe2){if(_0x24afe2){_0x587103=_0x24afe2['length'];if(!_0x5e935b[_0xa3ef('0x3e')]['hasOwnProperty'](_0xa3ef('0xd6'))){_0x107b5e[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x5e935b[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x107b5e['offset']=qs['offset'](_0x5e935b['query'][_0xa3ef('0x1c')]);}return _0x43c434[_0xa3ef('0xe5')](_0x107b5e);}})[_0xa3ef('0x23')](function(_0x13bc17){if(_0x13bc17){return _0x13bc17?{'count':_0x587103,'rows':_0x13bc17}:null;}})[_0xa3ef('0x23')](respondWithResult(_0xe61eb9,null))[_0xa3ef('0x5a')](handleError(_0xe61eb9,null));};exports[_0xa3ef('0xe7')]=function(_0x5c310e,_0xda875f){var _0x46e9c3={};var _0x4fa70e={};var _0x237923;var _0x1a57fd;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x5c310e[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0xda875f,null))['then'](function(_0x9e554d){if(_0x9e554d){_0x237923=_0x9e554d;_0x4fa70e[_0xa3ef('0x4e')]=_['keys'](db[_0xa3ef('0xe8')][_0xa3ef('0x37')]);_0x4fa70e['query']=_[_0xa3ef('0x50')](_0x5c310e[_0xa3ef('0x3e')]);_0x4fa70e['filters']=_[_0xa3ef('0x52')](_0x4fa70e[_0xa3ef('0x4e')],_0x4fa70e[_0xa3ef('0x3e')]);_0x46e9c3[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x4fa70e[_0xa3ef('0x4e')],qs['fields'](_0x5c310e[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x46e9c3[_0xa3ef('0x54')]=_0x46e9c3['attributes']['length']?_0x46e9c3['attributes']:_0x4fa70e[_0xa3ef('0x4e')];_0x46e9c3['order']=qs['sort'](_0x5c310e['query'][_0xa3ef('0xce')]);_0x46e9c3[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x5c310e['query'],_0x4fa70e[_0xa3ef('0x51')]));if(_0x5c310e[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x46e9c3[_0xa3ef('0x3d')]=_['merge'](_0x46e9c3[_0xa3ef('0x3d')],{'$or':_['map'](_0x46e9c3[_0xa3ef('0x54')],function(_0x26fccd){var _0x11d739={};_0x11d739[_0x26fccd]={'$like':'%'+_0x5c310e[_0xa3ef('0x3e')]['filter']+'%'};return _0x11d739;})});}_0x46e9c3=_[_0xa3ef('0x56')]({},_0x46e9c3,_0x5c310e[_0xa3ef('0x57')]);return _0x237923['getFaxInteractions'](_0x46e9c3);}})[_0xa3ef('0x23')](function(_0x46d955){if(_0x46d955){_0x1a57fd=_0x46d955[_0xa3ef('0x46')];if(!_0x5c310e[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x46e9c3['limit']=qs[_0xa3ef('0x1d')](_0x5c310e[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x46e9c3[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x5c310e[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x237923[_0xa3ef('0xe7')](_0x46e9c3);}})[_0xa3ef('0x23')](function(_0x7b15f8){if(_0x7b15f8){return _0x7b15f8?{'count':_0x1a57fd,'rows':_0x7b15f8}:null;}})[_0xa3ef('0x23')](respondWithResult(_0xda875f,null))[_0xa3ef('0x5a')](handleError(_0xda875f,null));};exports[_0xa3ef('0xe9')]=function(_0xdc82bb,_0x15d846){var _0xef37b8={};var _0xd5c793={};var _0x11eb9e;var _0x1cbe67;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0xdc82bb[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x15d846,null))['then'](function(_0x3753f1){if(_0x3753f1){_0x11eb9e=_0x3753f1;_0xd5c793[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0xea')]['rawAttributes']);_0xd5c793['query']=_[_0xa3ef('0x50')](_0xdc82bb['query']);_0xd5c793[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0xd5c793[_0xa3ef('0x4e')],_0xd5c793['query']);_0xef37b8[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0xd5c793[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0xdc82bb[_0xa3ef('0x3e')]['fields']));_0xef37b8['attributes']=_0xef37b8[_0xa3ef('0x54')]['length']?_0xef37b8['attributes']:_0xd5c793[_0xa3ef('0x4e')];_0xef37b8['order']=qs[_0xa3ef('0xce')](_0xdc82bb[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0xef37b8[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_['pick'](_0xdc82bb[_0xa3ef('0x3e')],_0xd5c793['filters']));if(_0xdc82bb[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0xef37b8['where']=_['merge'](_0xef37b8[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0xef37b8['attributes'],function(_0x5c3b5f){var _0x17f67a={};_0x17f67a[_0x5c3b5f]={'$like':'%'+_0xdc82bb[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x17f67a;})});}_0xef37b8=_[_0xa3ef('0x56')]({},_0xef37b8,_0xdc82bb['options']);return _0x11eb9e[_0xa3ef('0xe9')](_0xef37b8);}})[_0xa3ef('0x23')](function(_0x4198d8){if(_0x4198d8){_0x1cbe67=_0x4198d8[_0xa3ef('0x46')];if(!_0xdc82bb[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0xef37b8[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0xdc82bb[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0xef37b8['offset']=qs['offset'](_0xdc82bb['query'][_0xa3ef('0x1c')]);}return _0x11eb9e[_0xa3ef('0xe9')](_0xef37b8);}})[_0xa3ef('0x23')](function(_0x2e1c82){if(_0x2e1c82){return _0x2e1c82?{'count':_0x1cbe67,'rows':_0x2e1c82}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x15d846,null))[_0xa3ef('0x5a')](handleError(_0x15d846,null));};exports[_0xa3ef('0xeb')]=function(_0xb8cc50,_0x18f165,_0x3f7559){var _0x1d3686;var _0x7bef77;var _0x5d0689;var _0x17a42a=!_[_0xa3ef('0x66')](_0xb8cc50[_0xa3ef('0x5c')]['id'])?_0xb8cc50[_0xa3ef('0x5c')]['id']:!_[_0xa3ef('0x66')](_0xb8cc50[_0xa3ef('0x7e')]['id'])?_0xb8cc50[_0xa3ef('0x7e')]['id']:null;return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x17a42a,'role':{'$or':[_0xa3ef('0x29'),_0xa3ef('0x7e'),_0xa3ef('0x25')]}},'attributes':['id',_0xa3ef('0x32'),_0xa3ef('0xec'),_0xa3ef('0xed'),'role','internal','loginInPause']})['then'](function(_0x4c52a8){if(_0x4c52a8){if(_0x4c52a8[_0xa3ef('0x24')]==='agent'){_0x1d3686=_0x4c52a8;if(_0xb8cc50['body'][_0xa3ef('0x9f')]){_0x5d0689=util[_0xa3ef('0xab')](_0xa3ef('0xee'),_0x1d3686[_0xb8cc50[_0xa3ef('0x5b')][_0xa3ef('0x9f')]]);}else if(_0xb8cc50[_0xa3ef('0x5b')][_0xa3ef('0xef')]){_0x5d0689=util[_0xa3ef('0xab')](_0xa3ef('0xac'),_0xb8cc50[_0xa3ef('0x5b')][_0xa3ef('0xef')]);}else{_0x5d0689=util[_0xa3ef('0xab')](_0xa3ef('0xac'),_0x1d3686[_0xa3ef('0x32')]);}socket['to'](util[_0xa3ef('0xab')](_0xa3ef('0xf0'),_0x1d3686[_0xa3ef('0x32')]))[_0xa3ef('0x26')](_0xa3ef('0xf1'),{'user':{'id':_0x1d3686['id'],'name':_0x1d3686[_0xa3ef('0x32')]},'ip':_0xb8cc50[_0xa3ef('0xf2')]['x-forwarded-for']||_0xb8cc50[_0xa3ef('0xf3')][_0xa3ef('0xf4')]||_0xb8cc50['socket']['remoteAddress']||_0xb8cc50['connection'][_0xa3ef('0xf5')]['remoteAddress']});return db[_0xa3ef('0xad')][_0xa3ef('0x28')]({'where':{'membername':_0x1d3686[_0xa3ef('0x32')]},'individualHooks':!![]});}}else{throw new db[(_0xa3ef('0x8f'))][(_0xa3ef('0x90'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xa3ef('0x23')](function(){if(_0x1d3686){return _0x1d3686[_0xa3ef('0xf6')]({'raw':!![]});}})[_0xa3ef('0x23')](function(_0x3fd6f6){if(_0x1d3686){if(_0x3fd6f6){_0x7bef77=_0x3fd6f6;if(_0x7bef77['length']){var _0x4386a6=_0x7bef77[_0xa3ef('0x2e')](function(_0xdd17ce){var _0xe66d1d={'membername':_0x1d3686[_0xa3ef('0x32')],'UserId':_0x1d3686['id'],'queue_name':_0xdd17ce[_0xa3ef('0x32')],'VoiceQueueId':_0xdd17ce['id'],'interface':_0x5d0689,'paused':_0x1d3686[_0xa3ef('0x9d')]||![],'penalty':_0xdd17ce[_0xa3ef('0xf7')]||0x0};return db[_0xa3ef('0xad')][_0xa3ef('0xae')](_0xe66d1d);});return Promise[_0xa3ef('0x59')](_0x4386a6);}}}})[_0xa3ef('0x23')](function(){if(_0x1d3686){return db[_0xa3ef('0xf8')][_0xa3ef('0xa9')]({'where':{'membername':_0x1d3686[_0xa3ef('0x32')],'exitAt':null}});}})[_0xa3ef('0x23')](function(_0x3f9ae9){if(_0x1d3686){var _0x908ec5=[];_0x3f9ae9[_0xa3ef('0xf9')](function(_0x30e4cb){_0x908ec5[_0xa3ef('0x43')](_0x30e4cb[_0xa3ef('0x22')]({'exitAt':moment()[_0xa3ef('0xab')](_0xa3ef('0xfa'))}));});return Promise[_0xa3ef('0x59')](_0x908ec5);}})[_0xa3ef('0x23')](function(){if(_0x1d3686){var _0x30b40e=[];var _0x4cec18=[];var _0x307999=utils[_0xa3ef('0xfb')]();var _0x2dcb1c={'membername':_0x1d3686[_0xa3ef('0x32')],'interface':_0x5d0689,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1d3686[_0xa3ef('0x24')],'internal':_0x1d3686[_0xa3ef('0x65')]};_0x307999[_0xa3ef('0xf9')](function(_0x18ca3f){_0x30b40e['push'](_['merge']({'channel':_0x18ca3f,'type':_0xa3ef('0xfc'),'data1':_0xb8cc50[_0xa3ef('0x5b')]['device'],'data2':_0x5d0689},_0x2dcb1c));if(_0x1d3686[_0xa3ef('0x9d')]){_0x4cec18[_0xa3ef('0x43')](_['merge']({'channel':_0x18ca3f,'type':_0xa3ef('0xfd'),'data1':_0xa3ef('0xfe')},_0x2dcb1c));}});return db[_0xa3ef('0xf8')][_0xa3ef('0x88')](_0x30b40e[_0xa3ef('0xcb')](_0x4cec18),{'individualHooks':!![]});}})[_0xa3ef('0x23')](function(){if(_0x1d3686){return _0x1d3686['update']({'online':!![],'lastLoginAt':moment()['format'](_0xa3ef('0xfa')),'voicePause':_0x1d3686[_0xa3ef('0x9d')]||![],'mailPause':_0x1d3686[_0xa3ef('0x9d')]||![],'chatPause':_0x1d3686[_0xa3ef('0x9d')]||![],'faxPause':_0x1d3686[_0xa3ef('0x9d')]||![],'smsPause':_0x1d3686[_0xa3ef('0x9d')]||![],'openchannelPause':_0x1d3686[_0xa3ef('0x9d')]||![],'whatsappPause':_0x1d3686[_0xa3ef('0x9d')]||![],'pauseType':_0x1d3686['loginInPause']?_0xa3ef('0xfe'):null,'interface':_0x5d0689,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xa3ef('0x23')](function(_0x56d6d3){if(_0xb8cc50[_0xa3ef('0xff')]){return _0x3f7559();}else{return Promise['resolve'](_0x56d6d3)[_0xa3ef('0x23')](respondWithResult(_0x18f165,null));}})['catch'](handleError(_0x18f165,null));};exports[_0xa3ef('0x100')]=function(_0x12c3cd,_0x24263d){var _0x125da3;return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x12c3cd[_0xa3ef('0x5c')]['id'],'role':_0xa3ef('0x25')},'attributes':['id','name',_0xa3ef('0x24')]})[_0xa3ef('0x23')](handleEntityNotFound(_0x24263d,null))[_0xa3ef('0x23')](function(_0x148346){if(_0x148346){_0x125da3=_0x148346;return db[_0xa3ef('0xad')][_0xa3ef('0x28')]({'where':{'membername':_0x125da3[_0xa3ef('0x32')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0xa3ef('0xa9')]({'where':{'membername':_0x125da3[_0xa3ef('0x32')],'exitAt':null}});})['then'](function(_0x23bf12){var _0x418053=[];_0x23bf12[_0xa3ef('0xf9')](function(_0x4769d0){_0x418053[_0xa3ef('0x43')](_0x4769d0[_0xa3ef('0x22')]({'exitAt':moment()[_0xa3ef('0xab')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xa3ef('0x59')](_0x418053);})['then'](function(){return _0x125da3['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa3ef('0x23')](respondWithResult(_0x24263d,null))['catch'](handleError(_0x24263d,null));};exports[_0xa3ef('0x101')]=function(_0x9919cc,_0x5eecde){var _0x5778f7;return db[_0xa3ef('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0x9919cc[_0xa3ef('0x5c')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x9919cc[_0xa3ef('0x5c')]['id'],'role':'agent'},'attributes':['id',_0xa3ef('0x32'),_0xa3ef('0x24'),_0xa3ef('0x65'),_0xa3ef('0x9f'),_0xa3ef('0x102')]});})['then'](handleEntityNotFound(_0x5eecde,null))[_0xa3ef('0x23')](function(_0x29cbf2){if(_0x29cbf2){_0x5778f7=_0x29cbf2;return respondWithRpcPromise(_0xa3ef('0x103'),'pause',{'id':_0x5778f7['id'],'name':_0x5778f7[_0xa3ef('0x32')],'pause':!![]});}})[_0xa3ef('0x23')](function(){if(_0x5778f7){return db[_0xa3ef('0xf8')]['findAll']({'where':{'membername':_0x5778f7[_0xa3ef('0x32')],'type':_0xa3ef('0xfd'),'exitAt':null}});}})[_0xa3ef('0x23')](function(_0x5b3bfe){if(_0x5b3bfe[_0xa3ef('0x46')]){var _0x57e9c2=moment()[_0xa3ef('0xab')](_0xa3ef('0xfa'));for(var _0x42efc9=0x0,_0x29dc8a=_0x5b3bfe[_0xa3ef('0x46')];_0x42efc9<_0x29dc8a;_0x42efc9++){_0x5b3bfe[_0x42efc9][_0xa3ef('0x104')]({'exitAt':_0x57e9c2});}}})[_0xa3ef('0x23')](function(){var _0x3749c2=[];var _0x5ae84f=utils[_0xa3ef('0xfb')]();_0x5ae84f['forEach'](function(_0x5a89b6){_0x3749c2[_0xa3ef('0x43')]({'channel':_0x5a89b6,'membername':_0x5778f7[_0xa3ef('0x32')],'interface':_[_0xa3ef('0x66')](_0x5778f7[_0xa3ef('0x9f')])?util[_0xa3ef('0xab')]('SIP/%s',_0x5778f7['name']):_0x5778f7['interface'],'type':'PAUSE','enterAt':moment()['format'](_0xa3ef('0xfa')),'data1':_0x9919cc[_0xa3ef('0x5b')][_0xa3ef('0x105')]||'DEFAULT\x20PAUSE','role':_0x5778f7[_0xa3ef('0x24')],'internal':_0x5778f7[_0xa3ef('0x65')]});});return db[_0xa3ef('0xf8')][_0xa3ef('0x88')](_0x3749c2,{'individualHooks':!![]});})[_0xa3ef('0x23')](function(){return _0x5778f7['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x9919cc[_0xa3ef('0x5b')][_0xa3ef('0x105')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa3ef('0xab')](_0xa3ef('0xfa'))});})[_0xa3ef('0x23')](respondWithResult(_0x5eecde,null))[_0xa3ef('0x5a')](handleError(_0x5eecde,null));};exports[_0xa3ef('0x106')]=function(_0x3503ab,_0x2980ec){if(_0x3503ab[_0xa3ef('0x5b')]['channel']&&!utils[_0xa3ef('0xa0')](_0x3503ab[_0xa3ef('0x5b')][_0xa3ef('0xb0')])){throw new APIBadRequestError(util[_0xa3ef('0xab')](_0xa3ef('0x107'),_0x3503ab[_0xa3ef('0x5b')][_0xa3ef('0xb0')]));}return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x3503ab['params']['id']},'attributes':['id',_0xa3ef('0x32'),'role',_0xa3ef('0x65'),'interface','online','voicePause',_0xa3ef('0x108'),_0xa3ef('0x109'),_0xa3ef('0x10a'),_0xa3ef('0x10b'),_0xa3ef('0x10c'),'whatsappPause',_0xa3ef('0x10d'),_0xa3ef('0x10e')]})[_0xa3ef('0x23')](function(_0x374397){if(!_0x374397){throw new APINotFoundError(util['format'](_0xa3ef('0x10f'),_0x3503ab[_0xa3ef('0x5c')]['id']));}return _0x374397[_0xa3ef('0x106')](_0x3503ab[_0xa3ef('0x5b')][_0xa3ef('0xb0')]);})[_0xa3ef('0x23')](respondWithResult(_0x2980ec,null))['catch'](APIHandleError(_0x2980ec));};exports['getTeams']=function(_0x482cdd,_0xcd0aa7){var _0xa57675={};var _0x1c0df7={};var _0xfa109d;var _0x4c0862;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x482cdd[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0xcd0aa7,null))[_0xa3ef('0x23')](function(_0x1c9521){if(_0x1c9521){_0xfa109d=_0x1c9521;_0x1c0df7[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0x110')]['rawAttributes']);_0x1c0df7[_0xa3ef('0x3e')]=_['keys'](_0x482cdd[_0xa3ef('0x3e')]);_0x1c0df7[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x1c0df7[_0xa3ef('0x4e')],_0x1c0df7[_0xa3ef('0x3e')]);_0xa57675['attributes']=_['intersection'](_0x1c0df7[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x482cdd['query'][_0xa3ef('0x53')]));_0xa57675[_0xa3ef('0x54')]=_0xa57675['attributes'][_0xa3ef('0x46')]?_0xa57675[_0xa3ef('0x54')]:_0x1c0df7[_0xa3ef('0x4e')];_0xa57675[_0xa3ef('0xcd')]=qs['sort'](_0x482cdd[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0xa57675[_0xa3ef('0x3d')]=qs['filters'](_[_0xa3ef('0xcf')](_0x482cdd[_0xa3ef('0x3e')],_0x1c0df7['filters']));if(_0x482cdd[_0xa3ef('0x3e')]['filter']){_0xa57675[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0xa57675[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0xa57675['attributes'],function(_0x5ba115){var _0x54ff32={};_0x54ff32[_0x5ba115]={'$like':'%'+_0x482cdd[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x54ff32;})});}_0xa57675=_['merge']({},_0xa57675,_0x482cdd[_0xa3ef('0x57')]);return _0xfa109d[_0xa3ef('0x111')](_0xa57675);}})[_0xa3ef('0x23')](function(_0x2f51d7){if(_0x2f51d7){_0x4c0862=_0x2f51d7['length'];if(!_0x482cdd[_0xa3ef('0x3e')]['hasOwnProperty']('nolimit')){_0xa57675[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x482cdd[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0xa57675[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x482cdd[_0xa3ef('0x3e')]['offset']);}return _0xfa109d[_0xa3ef('0x111')](_0xa57675);}})[_0xa3ef('0x23')](function(_0x4db95f){if(_0x4db95f){return _0x4db95f?{'count':_0x4c0862,'rows':_0x4db95f}:null;}})['then'](respondWithResult(_0xcd0aa7,null))[_0xa3ef('0x5a')](handleError(_0xcd0aa7,null));};exports['addTeams']=function(_0x5b6eb9,_0x37b2ff){var _0x22220f=_0x5b6eb9[_0xa3ef('0x5c')]['id'];var _0x1692c3=_0x5b6eb9[_0xa3ef('0x5b')]?_0x5b6eb9[_0xa3ef('0x5b')][_0xa3ef('0x5f')]:null;var _0x57c350=[];return Promise['resolve']()[_0xa3ef('0x23')](function(){if(!_0x1692c3)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x22220f}});})[_0xa3ef('0x23')](function(_0x401abf){if(!_0x401abf)throw new APINotFoundError(util[_0xa3ef('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5b6eb9[_0xa3ef('0x5c')]['id']));return db[_0xa3ef('0x68')]['transaction'](function(_0x42b004){return _0x401abf[_0xa3ef('0x112')](_0x1692c3,{'transaction':_0x42b004})['then'](function(){return db[_0xa3ef('0x110')][_0xa3ef('0xa9')]({'where':{'id':{'$in':_0x1692c3}}});})[_0xa3ef('0x23')](function(_0xc709fb){var _0x31eecc=_['map'](_0xc709fb,function(_0x38836d){return _0x38836d[_0xa3ef('0x113')]();});return Promise['all'](_0x31eecc);})[_0xa3ef('0x23')](function(_0x549072){_0x57c350=_[_0xa3ef('0x114')](_0x549072);var _0x1cf11f=_[_0xa3ef('0x2e')](_0x57c350,function(_0x47dd15){return _0x47dd15[_0xa3ef('0x115')](_0x401abf['id'],{'transaction':_0x42b004});});return Promise['all'](_0x1cf11f);})['then'](function(){if(!_0x401abf[_0xa3ef('0x102')])return;var _0x37af26=_['filter'](_0x57c350,function(_0x5753da){return _0x5753da['getDataValue']('channel')===_0xa3ef('0x116');});var _0x3ad0ef=_[_0xa3ef('0x2e')](_0x37af26,function(_0x27a42b){return db[_0xa3ef('0xad')][_0xa3ef('0xae')]({'membername':_0x401abf['name'],'UserId':_0x401abf['id'],'queue_name':_0x27a42b['name'],'VoiceQueueId':_0x27a42b['id'],'interface':_[_0xa3ef('0x66')](_0x401abf[_0xa3ef('0x9f')])?util[_0xa3ef('0xab')](_0xa3ef('0xac'),_0x401abf[_0xa3ef('0x32')]):_0x401abf['interface'],'paused':_0x401abf[_0xa3ef('0x9e')]||![],'penalty':_0x401abf[_0xa3ef('0xa4')]},{'transaction':_0x42b004});});return Promise[_0xa3ef('0x59')](_0x3ad0ef);})[_0xa3ef('0x23')](function(){return db['TeamVoicePrefix'][_0xa3ef('0xa9')]({'where':{'teamId':{'$in':_0x1692c3}}});})['then'](function(_0x1ddb31){var _0x47d8cd=_['map'](_0x1ddb31,function(_0x255c2d){return db[_0xa3ef('0x117')][_0xa3ef('0x7d')]({'UserId':_0x401abf['id'],'VoicePrefixId':_0x255c2d[_0xa3ef('0x118')]},{'transaction':_0x42b004});});return Promise[_0xa3ef('0x59')](_0x47d8cd);});});})[_0xa3ef('0x23')](function(){for(var _0x36dedb=0x0;_0x36dedb<_0x57c350[_0xa3ef('0x46')];_0x36dedb++){var _0x4c44a8=_0x57c350[_0x36dedb][_0xa3ef('0x119')](_0xa3ef('0xb0'));var _0x113179=_0x4c44a8+_0xa3ef('0xb5');socket[_0xa3ef('0x26')]('user'+_0x4c44a8+'Queue:save',{'UserId':_0x22220f,['queueField']:_0x57c350[_0x36dedb]['id']});}})['then'](respondWithStatusCode(_0x37b2ff,null))[_0xa3ef('0x5a')](APIHandleError(_0x37b2ff));};exports['removeTeams']=function(_0x18f297,_0x2914f2){var _0x1eaebd=_0x18f297[_0xa3ef('0x5c')]['id'];var _0x2157dd=null;if(_0x18f297[_0xa3ef('0x3e')]['ids']){_0x2157dd=_[_0xa3ef('0xb3')](_0x18f297['query'][_0xa3ef('0x5f')])?_0x18f297[_0xa3ef('0x3e')]['ids']:[_0x18f297[_0xa3ef('0x3e')][_0xa3ef('0x5f')]];}var _0x293814=[];return Promise['resolve']()[_0xa3ef('0x23')](function(){if(!_0x2157dd)throw new APIBadRequestError(_0xa3ef('0x11a'));})['then'](function(){return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x1eaebd}});})[_0xa3ef('0x23')](function(_0x28ddd2){if(!_0x28ddd2)throw new APINotFoundError(util[_0xa3ef('0xab')](_0xa3ef('0x10f'),_0x18f297['params']['id']));return db[_0xa3ef('0x68')]['transaction'](function(_0x139bfe){return _0x28ddd2[_0xa3ef('0x11b')](_0x2157dd,{'transaction':_0x139bfe})['then'](function(){return db[_0xa3ef('0x110')]['findAll']({'where':{'id':{'$in':_0x2157dd}}});})[_0xa3ef('0x23')](function(_0xcdba87){var _0x5a02fb=_[_0xa3ef('0x2e')](_0xcdba87,function(_0x9872d8){return _0x9872d8['getAssociatedQueues']();});return Promise['all'](_0x5a02fb);})['then'](function(_0x3afe70){_0x293814=_['flattenDeep'](_0x3afe70);var _0x186885=_[_0xa3ef('0x2e')](_0x293814,function(_0x556f08){return _0x556f08[_0xa3ef('0x11c')](_0x28ddd2['id'],{'transaction':_0x139bfe});});return Promise[_0xa3ef('0x59')](_0x186885);})[_0xa3ef('0x23')](function(){if(!_0x28ddd2['online'])return;var _0x357342=_[_0xa3ef('0x2d')](_0x293814,function(_0x14bf84){return _0x14bf84[_0xa3ef('0x119')](_0xa3ef('0xb0'))===_0xa3ef('0x116');});var _0x1ba369=_[_0xa3ef('0x2e')](_0x357342,function(_0x3ba4c1){return db[_0xa3ef('0xad')][_0xa3ef('0x28')]({'where':{'VoiceQueueId':_0x3ba4c1['id'],'UserId':_0x28ddd2['id']},'transaction':_0x139bfe});});return Promise['all'](_0x1ba369);})[_0xa3ef('0x23')](function(){return db[_0xa3ef('0x11d')]['findAll']({'where':{'teamId':{'$in':_0x2157dd}}});})['then'](function(_0x978a55){var _0x34f93a=_[_0xa3ef('0x2e')](_0x978a55,function(_0x324a54){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x28ddd2['id'],'VoicePrefixId':_0x324a54['VoicePrefixId']}},{'transaction':_0x139bfe});});return Promise[_0xa3ef('0x59')](_0x34f93a);});});})[_0xa3ef('0x23')](function(){for(var _0x529abd=0x0;_0x529abd<_0x293814[_0xa3ef('0x46')];_0x529abd++){var _0x5dbc1f=_0x293814[_0x529abd]['getDataValue'](_0xa3ef('0xb0'));var _0x1945f7=_0x5dbc1f+_0xa3ef('0xb5');socket['emit']('user'+_0x5dbc1f+_0xa3ef('0xb4'),{'UserId':_0x1eaebd,['queueField']:_0x293814[_0x529abd]['id']});}})[_0xa3ef('0x23')](respondWithStatusCode(_0x2914f2,null))[_0xa3ef('0x5a')](APIHandleError(_0x2914f2));};exports[_0xa3ef('0x11e')]=function(_0x30c313,_0x4e89a0){var _0x1965d7={};var _0x263395={};var _0x6da67a;var _0x5f27e5;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x30c313[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e89a0,null))[_0xa3ef('0x23')](function(_0x4eb073){if(_0x4eb073){_0x6da67a=_0x4eb073;_0x263395[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db['CmList'][_0xa3ef('0x37')]);_0x263395[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x30c313[_0xa3ef('0x3e')]);_0x263395['filters']=_[_0xa3ef('0x52')](_0x263395[_0xa3ef('0x4e')],_0x263395[_0xa3ef('0x3e')]);_0x1965d7[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x263395[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x30c313[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x1965d7['attributes']=_0x1965d7['attributes'][_0xa3ef('0x46')]?_0x1965d7[_0xa3ef('0x54')]:_0x263395['model'];_0x1965d7[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x30c313[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x1965d7['where']=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x30c313[_0xa3ef('0x3e')],_0x263395[_0xa3ef('0x51')]));if(_0x30c313[_0xa3ef('0x3e')]['filter']){_0x1965d7[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x1965d7[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x1965d7[_0xa3ef('0x54')],function(_0x4857d2){var _0x5ed555={};_0x5ed555[_0x4857d2]={'$like':'%'+_0x30c313['query'][_0xa3ef('0x2d')]+'%'};return _0x5ed555;})});}_0x1965d7=_[_0xa3ef('0x56')]({},_0x1965d7,_0x30c313[_0xa3ef('0x57')]);return _0x6da67a[_0xa3ef('0x11e')](_0x1965d7);}})[_0xa3ef('0x23')](function(_0x57c22f){if(_0x57c22f){_0x5f27e5=_0x57c22f[_0xa3ef('0x46')];if(!_0x30c313[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x1965d7[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x30c313[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x1965d7[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x30c313[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x6da67a[_0xa3ef('0x11e')](_0x1965d7);}})['then'](function(_0x430920){if(_0x430920){return _0x430920?{'count':_0x5f27e5,'rows':_0x430920}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x4e89a0,null))[_0xa3ef('0x5a')](handleError(_0x4e89a0,null));};exports['getAgents']=function(_0x397d9d,_0x5bad72){var _0x5f0ce4={};var _0x884816={};var _0x3535ea;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x397d9d['params']['id']}})['then'](handleEntityNotFound(_0x5bad72,null))['then'](function(_0x1c486e){if(_0x1c486e){_0x3535ea=_0x1c486e;_0x884816[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0x36')][_0xa3ef('0x37')]);_0x884816['query']=_[_0xa3ef('0x50')](_0x397d9d[_0xa3ef('0x3e')]);_0x884816[_0xa3ef('0x51')]=_['intersection'](_0x884816[_0xa3ef('0x4e')],_0x884816[_0xa3ef('0x3e')]);_0x5f0ce4[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x884816[_0xa3ef('0x4e')],qs['fields'](_0x397d9d[_0xa3ef('0x3e')]['fields']));_0x5f0ce4[_0xa3ef('0x54')]=_0x5f0ce4[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x5f0ce4['attributes']:_0x884816[_0xa3ef('0x4e')];_0x5f0ce4['order']=qs['sort'](_0x397d9d['query']['sort']);_0x5f0ce4['where']=qs['filters'](_[_0xa3ef('0xcf')](_0x397d9d[_0xa3ef('0x3e')],_0x884816['filters']));if(_0x397d9d[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x5f0ce4[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x5f0ce4[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x5f0ce4['attributes'],function(_0x3efce8){var _0xec0730={};_0xec0730[_0x3efce8]={'$like':'%'+_0x397d9d[_0xa3ef('0x3e')]['filter']+'%'};return _0xec0730;})});}_0x5f0ce4[_0xa3ef('0x4e')]=db[_0xa3ef('0x36')];_0x5f0ce4['as']=_0xa3ef('0x86');_0x5f0ce4=_[_0xa3ef('0x56')]({},_0x5f0ce4,_0x397d9d['options']);return _0x3535ea[_0xa3ef('0xf6')]({'include':[_0x5f0ce4]});}})['then'](function(_0x11dbbe){if(_0x11dbbe){var _0x2bd8c2={},_0x260239=[];for(var _0x5e6e9d=0x0;_0x5e6e9d<_0x11dbbe[_0xa3ef('0x46')];_0x5e6e9d+=0x1){for(var _0x2e8c9b=0x0,_0x56767f;_0x2e8c9b<_0x11dbbe[_0x5e6e9d]['Agents'][_0xa3ef('0x46')];_0x2e8c9b+=0x1){_0x56767f=_0x11dbbe[_0x5e6e9d][_0xa3ef('0x86')][_0x2e8c9b]['get']({'plain':!![]});_0x2bd8c2[_0x56767f['id']]=_0x56767f;}}_0x2bd8c2=_[_0xa3ef('0x11f')](_0x2bd8c2);for(var _0xa960cf=qs[_0xa3ef('0x1c')](_0x397d9d['query']['offset']);_0xa960cf<_0x2bd8c2[_0xa3ef('0x46')]&&_0x260239['length']<qs[_0xa3ef('0x1d')](_0x397d9d[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0xa960cf+=0x1){if(_0x2bd8c2[_0xa960cf]){_0x260239[_0xa3ef('0x43')](_0x2bd8c2[_0xa960cf]);}}return{'count':_0x2bd8c2[_0xa3ef('0x46')],'rows':_0x260239};}})[_0xa3ef('0x23')](respondWithResult(_0x5bad72,null))[_0xa3ef('0x5a')](handleError(_0x5bad72,null));};exports[_0xa3ef('0x28')]=function(_0x56f036,_0x460772){if(_0x56f036[_0xa3ef('0x7e')]['id']==_0x56f036['params']['id']){return _0x460772[_0xa3ef('0x1a')](0x1f4)[_0xa3ef('0x120')]({'message':_0xa3ef('0x121')});}return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x56f036[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x460772,null))[_0xa3ef('0x23')](removeEntity(_0x460772,null))[_0xa3ef('0x5a')](handleError(_0x460772,null));};exports[_0xa3ef('0x122')]=function(_0x46b329,_0x4e5377){return db['User']['find']({'where':{'id':_0x46b329[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x4e5377,null))[_0xa3ef('0x23')](function(_0x22f106){if(_0x22f106){return _0x22f106[_0xa3ef('0x122')](_0x46b329[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_['omit'](_0x46b329['body'],[_0xa3ef('0x5f'),'id'])||{})[_0xa3ef('0xa5')](function(){for(var _0x2c2239=0x0;_0x2c2239<_0x46b329[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x2c2239+=0x1){socket['emit'](_0xa3ef('0x123'),{'ChatInteractionId':Number(_0x46b329['body'][_0xa3ef('0x5f')][_0x2c2239]),'UserId':Number(_0x46b329[_0xa3ef('0x5c')]['id'])});}return _0x46b329[_0xa3ef('0x5b')][_0xa3ef('0x5f')];});}})[_0xa3ef('0x23')](respondWithResult(_0x4e5377,null))[_0xa3ef('0x5a')](handleError(_0x4e5377,null));};exports['removeChatInteractions']=function(_0x41bf46,_0x3d38ec){return db[_0xa3ef('0x36')]['find']({'where':{'id':_0x41bf46[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x3d38ec,null))['then'](function(_0x2f6d3f){if(_0x2f6d3f){return _0x2f6d3f[_0xa3ef('0x124')](_0x41bf46[_0xa3ef('0x3e')][_0xa3ef('0x5f')])[_0xa3ef('0x23')](function(){if(_[_0xa3ef('0xb3')](_0x41bf46[_0xa3ef('0x3e')]['ids'])){for(var _0x3b3bcb=0x0;_0x3b3bcb<_0x41bf46[_0xa3ef('0x3e')][_0xa3ef('0x5f')]['length'];_0x3b3bcb+=0x1){socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x41bf46[_0xa3ef('0x3e')][_0xa3ef('0x5f')][_0x3b3bcb]),'UserId':Number(_0x41bf46[_0xa3ef('0x5c')]['id'])});}}else{socket[_0xa3ef('0x26')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x41bf46[_0xa3ef('0x3e')][_0xa3ef('0x5f')]),'UserId':Number(_0x41bf46[_0xa3ef('0x5c')]['id'])});}});}})[_0xa3ef('0x23')](respondWithStatusCode(_0x3d38ec,null))['catch'](handleError(_0x3d38ec,null));};exports['addMailInteractions']=function(_0x592a5a,_0x4a67bd){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x592a5a[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x4a67bd,null))[_0xa3ef('0x23')](function(_0xbaba3){if(_0xbaba3){return _0xbaba3[_0xa3ef('0x125')](_0x592a5a[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x592a5a[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{})[_0xa3ef('0xa5')](function(){for(var _0x300664=0x0;_0x300664<_0x592a5a['body'][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x300664+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x126'),{'MailInteractionId':Number(_0x592a5a[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0x300664]),'UserId':Number(_0x592a5a[_0xa3ef('0x5c')]['id'])});}return _0x592a5a[_0xa3ef('0x5b')]['ids'];});}})[_0xa3ef('0x23')](respondWithResult(_0x4a67bd,null))[_0xa3ef('0x5a')](handleError(_0x4a67bd,null));};exports[_0xa3ef('0x127')]=function(_0x43657c,_0x2dd912){return db[_0xa3ef('0x36')]['find']({'where':{'id':_0x43657c['params']['id']}})['then'](handleEntityNotFound(_0x2dd912,null))[_0xa3ef('0x23')](function(_0x59580c){if(_0x59580c){return _0x59580c[_0xa3ef('0x127')](_0x43657c[_0xa3ef('0x3e')]['ids'])[_0xa3ef('0x23')](function(){if(_[_0xa3ef('0xb3')](_0x43657c[_0xa3ef('0x3e')][_0xa3ef('0x5f')])){for(var _0x5833ea=0x0;_0x5833ea<_0x43657c[_0xa3ef('0x3e')][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x5833ea+=0x1){socket[_0xa3ef('0x26')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x43657c[_0xa3ef('0x3e')][_0xa3ef('0x5f')][_0x5833ea]),'UserId':Number(_0x43657c[_0xa3ef('0x5c')]['id'])});}}else{socket[_0xa3ef('0x26')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x43657c[_0xa3ef('0x3e')]['ids']),'UserId':Number(_0x43657c[_0xa3ef('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2dd912,null))['catch'](handleError(_0x2dd912,null));};exports[_0xa3ef('0x128')]=function(_0x15ea79,_0x197a5a){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x15ea79[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x197a5a,null))[_0xa3ef('0x23')](function(_0x135e66){if(_0x135e66){return _0x135e66[_0xa3ef('0x128')](_0x15ea79['body'][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x15ea79[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{})[_0xa3ef('0xa5')](function(){for(var _0x40f33a=0x0;_0x40f33a<_0x15ea79[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x40f33a+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x129'),{'FaxInteractionId':Number(_0x15ea79[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0x40f33a]),'UserId':Number(_0x15ea79[_0xa3ef('0x5c')]['id'])});}return _0x15ea79[_0xa3ef('0x5b')][_0xa3ef('0x5f')];});}})[_0xa3ef('0x23')](respondWithResult(_0x197a5a,null))[_0xa3ef('0x5a')](handleError(_0x197a5a,null));};exports[_0xa3ef('0x12a')]=function(_0x24f103,_0x5a1827){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x24f103[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x5a1827,null))[_0xa3ef('0x23')](function(_0x4d52bb){if(_0x4d52bb){return _0x4d52bb[_0xa3ef('0x12a')](_0x24f103['query'][_0xa3ef('0x5f')])['then'](function(){if(_['isArray'](_0x24f103[_0xa3ef('0x3e')][_0xa3ef('0x5f')])){for(var _0x2f4c0a=0x0;_0x2f4c0a<_0x24f103[_0xa3ef('0x3e')]['ids'][_0xa3ef('0x46')];_0x2f4c0a+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x12b'),{'FaxInteractionId':Number(_0x24f103[_0xa3ef('0x3e')][_0xa3ef('0x5f')][_0x2f4c0a]),'UserId':Number(_0x24f103[_0xa3ef('0x5c')]['id'])});}}else{socket[_0xa3ef('0x26')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x24f103[_0xa3ef('0x3e')]['ids']),'UserId':Number(_0x24f103[_0xa3ef('0x5c')]['id'])});}});}})[_0xa3ef('0x23')](respondWithStatusCode(_0x5a1827,null))[_0xa3ef('0x5a')](handleError(_0x5a1827,null));};exports[_0xa3ef('0x12c')]=function(_0xf19e4d,_0x26ece1){return db[_0xa3ef('0x36')]['find']({'where':{'id':_0xf19e4d[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x26ece1,null))[_0xa3ef('0x23')](function(_0x171dbe){if(_0x171dbe){return _0x171dbe[_0xa3ef('0x12c')](_0xf19e4d[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0xf19e4d[_0xa3ef('0x5b')],['ids','id'])||{})[_0xa3ef('0xa5')](function(){for(var _0x4e7137=0x0;_0x4e7137<_0xf19e4d[_0xa3ef('0x5b')][_0xa3ef('0x5f')]['length'];_0x4e7137+=0x1){socket[_0xa3ef('0x26')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0xf19e4d['body'][_0xa3ef('0x5f')][_0x4e7137]),'UserId':Number(_0xf19e4d[_0xa3ef('0x5c')]['id'])});}return _0xf19e4d[_0xa3ef('0x5b')][_0xa3ef('0x5f')];});}})['then'](respondWithResult(_0x26ece1,null))['catch'](handleError(_0x26ece1,null));};exports[_0xa3ef('0x12d')]=function(_0x7608ab,_0x5f23ec){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x7608ab[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5f23ec,null))[_0xa3ef('0x23')](function(_0x29eb0b){if(_0x29eb0b){return _0x29eb0b['removeSmsInteractions'](_0x7608ab['query']['ids'])[_0xa3ef('0x23')](function(){if(_[_0xa3ef('0xb3')](_0x7608ab[_0xa3ef('0x3e')][_0xa3ef('0x5f')])){for(var _0x3a3d6b=0x0;_0x3a3d6b<_0x7608ab[_0xa3ef('0x3e')][_0xa3ef('0x5f')]['length'];_0x3a3d6b+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x12e'),{'SmsInteractionId':Number(_0x7608ab[_0xa3ef('0x3e')][_0xa3ef('0x5f')][_0x3a3d6b]),'UserId':Number(_0x7608ab[_0xa3ef('0x5c')]['id'])});}}else{socket[_0xa3ef('0x26')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x7608ab['query'][_0xa3ef('0x5f')]),'UserId':Number(_0x7608ab[_0xa3ef('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5f23ec,null))[_0xa3ef('0x5a')](handleError(_0x5f23ec,null));};exports[_0xa3ef('0x12f')]=function(_0x3f43a7,_0x35deb9){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x3f43a7[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35deb9,null))['then'](function(_0x1788bb){if(_0x1788bb){return _0x1788bb['addOpenchannelInteractions'](_0x3f43a7[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_['omit'](_0x3f43a7[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{})[_0xa3ef('0xa5')](function(){for(var _0x4ff0b0=0x0;_0x4ff0b0<_0x3f43a7['body']['ids'][_0xa3ef('0x46')];_0x4ff0b0+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x130'),{'OpenchannelInteractionId':Number(_0x3f43a7[_0xa3ef('0x5b')]['ids'][_0x4ff0b0]),'UserId':Number(_0x3f43a7[_0xa3ef('0x5c')]['id'])});}return _0x3f43a7[_0xa3ef('0x5b')][_0xa3ef('0x5f')];});}})['then'](respondWithResult(_0x35deb9,null))[_0xa3ef('0x5a')](handleError(_0x35deb9,null));};exports[_0xa3ef('0x131')]=function(_0x34b650,_0x8384c0){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x34b650['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x8384c0,null))[_0xa3ef('0x23')](function(_0x586683){if(_0x586683){return _0x586683[_0xa3ef('0x131')](_0x34b650['query']['ids'])[_0xa3ef('0x23')](function(){if(_[_0xa3ef('0xb3')](_0x34b650['query'][_0xa3ef('0x5f')])){for(var _0x12a025=0x0;_0x12a025<_0x34b650['query'][_0xa3ef('0x5f')]['length'];_0x12a025+=0x1){socket['emit'](_0xa3ef('0x132'),{'OpenchannelInteractionId':Number(_0x34b650[_0xa3ef('0x3e')]['ids'][_0x12a025]),'UserId':Number(_0x34b650[_0xa3ef('0x5c')]['id'])});}}else{socket[_0xa3ef('0x26')](_0xa3ef('0x132'),{'OpenchannelInteractionId':Number(_0x34b650['query'][_0xa3ef('0x5f')]),'UserId':Number(_0x34b650[_0xa3ef('0x5c')]['id'])});}});}})[_0xa3ef('0x23')](respondWithStatusCode(_0x8384c0,null))[_0xa3ef('0x5a')](handleError(_0x8384c0,null));};exports[_0xa3ef('0x133')]=function(_0x227e0c,_0x456eb3){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x227e0c[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x456eb3,null))[_0xa3ef('0x23')](function(_0x1c8f6f){if(_0x1c8f6f){return _0x1c8f6f[_0xa3ef('0x133')](_0x227e0c['body'][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x227e0c[_0xa3ef('0x5b')],['ids','id'])||{})['spread'](function(){for(var _0x5dd3c1=0x0;_0x5dd3c1<_0x227e0c[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0xa3ef('0x46')];_0x5dd3c1+=0x1){socket[_0xa3ef('0x26')](_0xa3ef('0x134'),{'WhatsappInteractionId':Number(_0x227e0c[_0xa3ef('0x5b')][_0xa3ef('0x5f')][_0x5dd3c1]),'UserId':Number(_0x227e0c[_0xa3ef('0x5c')]['id'])});}return _0x227e0c[_0xa3ef('0x5b')]['ids'];});}})['then'](respondWithResult(_0x456eb3,null))[_0xa3ef('0x5a')](handleError(_0x456eb3,null));};exports['removeWhatsappInteractions']=function(_0x5b2945,_0x380ea9){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x5b2945[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x380ea9,null))[_0xa3ef('0x23')](function(_0x4e4b53){if(_0x4e4b53){return _0x4e4b53['removeWhatsappInteractions'](_0x5b2945[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x380ea9,null))[_0xa3ef('0x5a')](handleError(_0x380ea9,null));};exports[_0xa3ef('0x135')]=function(_0x4f8c84,_0x1b2f83){var _0x5f2643={};var _0x4bf8c3={};var _0x36ac00;var _0x1eba60;return db['User']['findOne']({'where':{'id':_0x4f8c84[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x1b2f83,null))[_0xa3ef('0x23')](function(_0x2b878f){if(_0x2b878f){_0x36ac00=_0x2b878f;_0x4bf8c3['model']=_[_0xa3ef('0x50')](db[_0xa3ef('0x136')][_0xa3ef('0x37')]);_0x4bf8c3[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x4f8c84[_0xa3ef('0x3e')]);_0x4bf8c3[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x4bf8c3['model'],_0x4bf8c3['query']);_0x5f2643['attributes']=_[_0xa3ef('0x52')](_0x4bf8c3[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x4f8c84[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x5f2643[_0xa3ef('0x54')]=_0x5f2643['attributes'][_0xa3ef('0x46')]?_0x5f2643[_0xa3ef('0x54')]:_0x4bf8c3[_0xa3ef('0x4e')];_0x5f2643[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x4f8c84[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x5f2643['where']=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x4f8c84[_0xa3ef('0x3e')],_0x4bf8c3[_0xa3ef('0x51')]));if(_0x4f8c84['query'][_0xa3ef('0x2d')]){_0x5f2643[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x5f2643[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x5f2643[_0xa3ef('0x54')],function(_0x437a72){var _0x1c52c5={};_0x1c52c5[_0x437a72]={'$like':'%'+_0x4f8c84[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x1c52c5;})});}_0x5f2643=_['merge']({},_0x5f2643,_0x4f8c84[_0xa3ef('0x57')]);return _0x36ac00[_0xa3ef('0x135')](_0x5f2643);}})['then'](function(_0x38998b){if(_0x38998b){_0x1eba60=_0x38998b[_0xa3ef('0x46')];if(!_0x4f8c84[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x5f2643[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x4f8c84[_0xa3ef('0x3e')]['limit']);_0x5f2643[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x4f8c84[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x36ac00[_0xa3ef('0x135')](_0x5f2643);}})[_0xa3ef('0x23')](function(_0x49bfd7){if(_0x49bfd7){return _0x49bfd7?{'count':_0x1eba60,'rows':_0x49bfd7}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x1b2f83,null))[_0xa3ef('0x5a')](handleError(_0x1b2f83,null));};exports[_0xa3ef('0x137')]=function(_0x1c55d9,_0x5b488b){var _0x401c2e={};var _0x3b9aac={};var _0xffd57f;var _0x52a02b;return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x1c55d9[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5b488b,null))[_0xa3ef('0x23')](function(_0x2d9806){if(_0x2d9806){_0xffd57f=_0x2d9806;_0x3b9aac['model']=_[_0xa3ef('0x50')](db[_0xa3ef('0x138')][_0xa3ef('0x37')]);_0x3b9aac[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x1c55d9[_0xa3ef('0x3e')]);_0x3b9aac['filters']=_[_0xa3ef('0x52')](_0x3b9aac[_0xa3ef('0x4e')],_0x3b9aac[_0xa3ef('0x3e')]);_0x401c2e['attributes']=_[_0xa3ef('0x52')](_0x3b9aac[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x1c55d9['query'][_0xa3ef('0x53')]));_0x401c2e['attributes']=_0x401c2e['attributes'][_0xa3ef('0x46')]?_0x401c2e[_0xa3ef('0x54')]:_0x3b9aac[_0xa3ef('0x4e')];_0x401c2e[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x1c55d9['query'][_0xa3ef('0xce')]);_0x401c2e[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_['pick'](_0x1c55d9['query'],_0x3b9aac[_0xa3ef('0x51')]));if(_0x1c55d9[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x401c2e['where']=_[_0xa3ef('0x56')](_0x401c2e[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x401c2e['attributes'],function(_0x59017d){var _0x11a9e7={};_0x11a9e7[_0x59017d]={'$like':'%'+_0x1c55d9[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x11a9e7;})});}_0x401c2e=_[_0xa3ef('0x56')]({},_0x401c2e,_0x1c55d9[_0xa3ef('0x57')]);return _0xffd57f[_0xa3ef('0x137')](_0x401c2e);}})[_0xa3ef('0x23')](function(_0x460ddb){if(_0x460ddb){_0x52a02b=_0x460ddb[_0xa3ef('0x46')];if(!_0x1c55d9[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x401c2e['limit']=qs[_0xa3ef('0x1d')](_0x1c55d9[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x401c2e[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x1c55d9[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0xffd57f[_0xa3ef('0x137')](_0x401c2e);}})[_0xa3ef('0x23')](function(_0x51e06){if(_0x51e06){return _0x51e06?{'count':_0x52a02b,'rows':_0x51e06}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x5b488b,null))[_0xa3ef('0x5a')](handleError(_0x5b488b,null));};exports[_0xa3ef('0x139')]=function(_0xb8b3bf,_0x19d0b3){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0xb8b3bf['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x19d0b3,null))[_0xa3ef('0x23')](function(_0x446fb7){if(_0x446fb7){return _0x446fb7[_0xa3ef('0x139')](_0xb8b3bf[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0xb8b3bf[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{});}})[_0xa3ef('0x23')](respondWithResult(_0x19d0b3,null))[_0xa3ef('0x5a')](handleError(_0x19d0b3,null));};exports['removeFaxAccounts']=function(_0x5cee83,_0x1e48f8){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x5cee83[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x1e48f8,null))[_0xa3ef('0x23')](function(_0x330684){if(_0x330684){return _0x330684[_0xa3ef('0x13a')](_0x5cee83['query']['ids']);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x1e48f8,null))[_0xa3ef('0x5a')](handleError(_0x1e48f8,null));};exports[_0xa3ef('0x13b')]=function(_0x29c804,_0x47bd78){var _0x26b5b8={};var _0x5e7fef={};var _0x1e225b;var _0x566527;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x29c804[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x47bd78,null))[_0xa3ef('0x23')](function(_0x49ef0c){if(_0x49ef0c){_0x1e225b=_0x49ef0c;_0x5e7fef[_0xa3ef('0x4e')]=_['keys'](db[_0xa3ef('0x13c')]['rawAttributes']);_0x5e7fef[_0xa3ef('0x3e')]=_['keys'](_0x29c804['query']);_0x5e7fef['filters']=_[_0xa3ef('0x52')](_0x5e7fef[_0xa3ef('0x4e')],_0x5e7fef[_0xa3ef('0x3e')]);_0x26b5b8[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x5e7fef[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x26b5b8[_0xa3ef('0x54')]=_0x26b5b8[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x26b5b8[_0xa3ef('0x54')]:_0x5e7fef[_0xa3ef('0x4e')];_0x26b5b8[_0xa3ef('0xcd')]=qs['sort'](_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x26b5b8[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x29c804[_0xa3ef('0x3e')],_0x5e7fef['filters']));if(_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x26b5b8['where']=_[_0xa3ef('0x56')](_0x26b5b8[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x26b5b8[_0xa3ef('0x54')],function(_0x417a6a){var _0x2da299={};_0x2da299[_0x417a6a]={'$like':'%'+_0x29c804['query'][_0xa3ef('0x2d')]+'%'};return _0x2da299;})});}_0x26b5b8=_[_0xa3ef('0x56')]({},_0x26b5b8,_0x29c804['options']);return _0x1e225b[_0xa3ef('0x13b')](_0x26b5b8);}})['then'](function(_0x188c0e){if(_0x188c0e){_0x566527=_0x188c0e[_0xa3ef('0x46')];if(!_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x26b5b8[_0xa3ef('0x1d')]=qs['limit'](_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x26b5b8[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x29c804[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x1e225b[_0xa3ef('0x13b')](_0x26b5b8);}})[_0xa3ef('0x23')](function(_0x3f9bc8){if(_0x3f9bc8){return _0x3f9bc8?{'count':_0x566527,'rows':_0x3f9bc8}:null;}})['then'](respondWithResult(_0x47bd78,null))[_0xa3ef('0x5a')](handleError(_0x47bd78,null));};exports[_0xa3ef('0x13d')]=function(_0x41b58d,_0x5ab686){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x41b58d['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x5ab686,null))[_0xa3ef('0x23')](function(_0x2af285){if(_0x2af285){return _0x2af285['addMailAccounts'](_0x41b58d['body']['ids'],_['omit'](_0x41b58d['body'],['ids','id'])||{});}})[_0xa3ef('0x23')](respondWithResult(_0x5ab686,null))[_0xa3ef('0x5a')](handleError(_0x5ab686,null));};exports['removeMailAccounts']=function(_0x37c924,_0x441308){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x37c924['params']['id']}})['then'](handleEntityNotFound(_0x441308,null))[_0xa3ef('0x23')](function(_0x114bee){if(_0x114bee){return _0x114bee[_0xa3ef('0x13e')](_0x37c924[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x441308,null))['catch'](handleError(_0x441308,null));};exports[_0xa3ef('0x13f')]=function(_0x21e84c,_0x22f632){var _0x1d9095={};var _0x47cdf3={};var _0x2141c8;var _0x5e8153;return db[_0xa3ef('0x36')][_0xa3ef('0x97')]({'where':{'id':_0x21e84c['params']['id']}})['then'](handleEntityNotFound(_0x22f632,null))['then'](function(_0x40cd5f){if(_0x40cd5f){_0x2141c8=_0x40cd5f;_0x47cdf3[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db['OpenchannelAccount']['rawAttributes']);_0x47cdf3[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x21e84c[_0xa3ef('0x3e')]);_0x47cdf3[_0xa3ef('0x51')]=_['intersection'](_0x47cdf3['model'],_0x47cdf3[_0xa3ef('0x3e')]);_0x1d9095[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x47cdf3[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x21e84c[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x1d9095[_0xa3ef('0x54')]=_0x1d9095[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x1d9095['attributes']:_0x47cdf3[_0xa3ef('0x4e')];_0x1d9095[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x21e84c[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x1d9095['where']=qs['filters'](_[_0xa3ef('0xcf')](_0x21e84c['query'],_0x47cdf3[_0xa3ef('0x51')]));if(_0x21e84c['query']['filter']){_0x1d9095[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x1d9095[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x1d9095[_0xa3ef('0x54')],function(_0x5bf858){var _0x195fd3={};_0x195fd3[_0x5bf858]={'$like':'%'+_0x21e84c['query'][_0xa3ef('0x2d')]+'%'};return _0x195fd3;})});}_0x1d9095=_['merge']({},_0x1d9095,_0x21e84c[_0xa3ef('0x57')]);return _0x2141c8['getOpenchannelAccounts'](_0x1d9095);}})[_0xa3ef('0x23')](function(_0xb0b220){if(_0xb0b220){_0x5e8153=_0xb0b220['length'];if(!_0x21e84c[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x1d9095[_0xa3ef('0x1d')]=qs['limit'](_0x21e84c['query']['limit']);_0x1d9095[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x21e84c[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x2141c8[_0xa3ef('0x13f')](_0x1d9095);}})[_0xa3ef('0x23')](function(_0x3c045e){if(_0x3c045e){return _0x3c045e?{'count':_0x5e8153,'rows':_0x3c045e}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x22f632,null))[_0xa3ef('0x5a')](handleError(_0x22f632,null));};exports[_0xa3ef('0x140')]=function(_0x4fca19,_0x4205f8){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x4fca19[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x4205f8,null))[_0xa3ef('0x23')](function(_0x3d1ccc){if(_0x3d1ccc){return _0x3d1ccc[_0xa3ef('0x140')](_0x4fca19[_0xa3ef('0x5b')]['ids'],_[_0xa3ef('0x60')](_0x4fca19[_0xa3ef('0x5b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4205f8,null))['catch'](handleError(_0x4205f8,null));};exports[_0xa3ef('0x141')]=function(_0x55f491,_0x260a02){return db['User'][_0xa3ef('0x31')]({'where':{'id':_0x55f491[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x260a02,null))[_0xa3ef('0x23')](function(_0x738e99){if(_0x738e99){return _0x738e99[_0xa3ef('0x141')](_0x55f491[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x260a02,null))[_0xa3ef('0x5a')](handleError(_0x260a02,null));};exports[_0xa3ef('0x142')]=function(_0x317c3a,_0x3b509b){var _0xf07e10={};var _0x3b7894={};var _0x41a06d;var _0x3195ff;return db['User'][_0xa3ef('0x97')]({'where':{'id':_0x317c3a[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3b509b,null))[_0xa3ef('0x23')](function(_0x1c1980){if(_0x1c1980){_0x41a06d=_0x1c1980;_0x3b7894[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0x143')][_0xa3ef('0x37')]);_0x3b7894[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x317c3a['query']);_0x3b7894[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x3b7894['model'],_0x3b7894[_0xa3ef('0x3e')]);_0xf07e10['attributes']=_[_0xa3ef('0x52')](_0x3b7894[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x317c3a[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0xf07e10[_0xa3ef('0x54')]=_0xf07e10[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0xf07e10['attributes']:_0x3b7894[_0xa3ef('0x4e')];_0xf07e10[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x317c3a[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0xf07e10['where']=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x317c3a[_0xa3ef('0x3e')],_0x3b7894['filters']));if(_0x317c3a[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0xf07e10[_0xa3ef('0x3d')]=_['merge'](_0xf07e10[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0xf07e10[_0xa3ef('0x54')],function(_0x13ba00){var _0x2d2221={};_0x2d2221[_0x13ba00]={'$like':'%'+_0x317c3a[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'};return _0x2d2221;})});}_0xf07e10=_['merge']({},_0xf07e10,_0x317c3a[_0xa3ef('0x57')]);return _0x41a06d[_0xa3ef('0x142')](_0xf07e10);}})[_0xa3ef('0x23')](function(_0x31b707){if(_0x31b707){_0x3195ff=_0x31b707[_0xa3ef('0x46')];if(!_0x317c3a['query']['hasOwnProperty']('nolimit')){_0xf07e10[_0xa3ef('0x1d')]=qs['limit'](_0x317c3a[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0xf07e10[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x317c3a['query']['offset']);}return _0x41a06d[_0xa3ef('0x142')](_0xf07e10);}})[_0xa3ef('0x23')](function(_0x29c92e){if(_0x29c92e){return _0x29c92e?{'count':_0x3195ff,'rows':_0x29c92e}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x3b509b,null))['catch'](handleError(_0x3b509b,null));};exports[_0xa3ef('0x144')]=function(_0x26aca4,_0xbf68bc){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x26aca4[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0xbf68bc,null))[_0xa3ef('0x23')](function(_0xf059f6){if(_0xf059f6){return _0xf059f6[_0xa3ef('0x144')](_0x26aca4[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x26aca4[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{});}})['then'](respondWithResult(_0xbf68bc,null))[_0xa3ef('0x5a')](handleError(_0xbf68bc,null));};exports['removeSmsAccounts']=function(_0x26dc4e,_0x45010b){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x26dc4e[_0xa3ef('0x5c')]['id']}})['then'](handleEntityNotFound(_0x45010b,null))['then'](function(_0x967db0){if(_0x967db0){return _0x967db0['removeSmsAccounts'](_0x26dc4e[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x45010b,null))[_0xa3ef('0x5a')](handleError(_0x45010b,null));};exports[_0xa3ef('0x145')]=function(_0x39ae80,_0x24c759){var _0x5a179b={};var _0x533947={};var _0x2b73a5;var _0x4304df;return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x39ae80['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x24c759,null))[_0xa3ef('0x23')](function(_0x375a57){if(_0x375a57){_0x2b73a5=_0x375a57;_0x533947[_0xa3ef('0x4e')]=_['keys'](db[_0xa3ef('0x146')][_0xa3ef('0x37')]);_0x533947[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0x39ae80[_0xa3ef('0x3e')]);_0x533947[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x533947[_0xa3ef('0x4e')],_0x533947['query']);_0x5a179b['attributes']=_[_0xa3ef('0x52')](_0x533947[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0x39ae80[_0xa3ef('0x3e')]['fields']));_0x5a179b['attributes']=_0x5a179b['attributes'][_0xa3ef('0x46')]?_0x5a179b['attributes']:_0x533947[_0xa3ef('0x4e')];_0x5a179b[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x39ae80['query'][_0xa3ef('0xce')]);_0x5a179b[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_[_0xa3ef('0xcf')](_0x39ae80['query'],_0x533947[_0xa3ef('0x51')]));if(_0x39ae80[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x5a179b['where']=_[_0xa3ef('0x56')](_0x5a179b[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x5a179b[_0xa3ef('0x54')],function(_0x3225c7){var _0x3af711={};_0x3af711[_0x3225c7]={'$like':'%'+_0x39ae80['query'][_0xa3ef('0x2d')]+'%'};return _0x3af711;})});}_0x5a179b=_[_0xa3ef('0x56')]({},_0x5a179b,_0x39ae80[_0xa3ef('0x57')]);return _0x2b73a5[_0xa3ef('0x145')](_0x5a179b);}})[_0xa3ef('0x23')](function(_0x3f112a){if(_0x3f112a){_0x4304df=_0x3f112a[_0xa3ef('0x46')];if(!_0x39ae80[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x5a179b[_0xa3ef('0x1d')]=qs['limit'](_0x39ae80[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x5a179b[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x39ae80['query'][_0xa3ef('0x1c')]);}return _0x2b73a5[_0xa3ef('0x145')](_0x5a179b);}})['then'](function(_0x2a0a6a){if(_0x2a0a6a){return _0x2a0a6a?{'count':_0x4304df,'rows':_0x2a0a6a}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x24c759,null))['catch'](handleError(_0x24c759,null));};exports['addChatWebsites']=function(_0x36159b,_0x3683ce){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x36159b[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x3683ce,null))['then'](function(_0x22bb25){if(_0x22bb25){return _0x22bb25['addChatWebsites'](_0x36159b[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_['omit'](_0x36159b[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{});}})[_0xa3ef('0x23')](respondWithResult(_0x3683ce,null))['catch'](handleError(_0x3683ce,null));};exports[_0xa3ef('0x147')]=function(_0x1258ba,_0x32be13){return db['User']['find']({'where':{'id':_0x1258ba[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x32be13,null))[_0xa3ef('0x23')](function(_0x506d9a){if(_0x506d9a){return _0x506d9a['removeChatWebsites'](_0x1258ba[_0xa3ef('0x3e')][_0xa3ef('0x5f')]);}})['then'](respondWithStatusCode(_0x32be13,null))[_0xa3ef('0x5a')](handleError(_0x32be13,null));};exports[_0xa3ef('0x148')]=function(_0x54afc0,_0x156005){var _0x411209={};var _0x10a13e={};var _0x25e8ad;var _0x70c7a6;return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x54afc0['params']['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x156005,null))[_0xa3ef('0x23')](function(_0xc0146c){if(_0xc0146c){_0x25e8ad=_0xc0146c;_0x10a13e[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](db[_0xa3ef('0x149')][_0xa3ef('0x37')]);_0x10a13e[_0xa3ef('0x3e')]=_['keys'](_0x54afc0[_0xa3ef('0x3e')]);_0x10a13e[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x10a13e[_0xa3ef('0x4e')],_0x10a13e[_0xa3ef('0x3e')]);_0x411209[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x10a13e['model'],qs[_0xa3ef('0x53')](_0x54afc0[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x411209[_0xa3ef('0x54')]=_0x411209[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x411209[_0xa3ef('0x54')]:_0x10a13e[_0xa3ef('0x4e')];_0x411209[_0xa3ef('0xcd')]=qs[_0xa3ef('0xce')](_0x54afc0['query'][_0xa3ef('0xce')]);_0x411209[_0xa3ef('0x3d')]=qs['filters'](_[_0xa3ef('0xcf')](_0x54afc0[_0xa3ef('0x3e')],_0x10a13e[_0xa3ef('0x51')]));if(_0x54afc0[_0xa3ef('0x3e')][_0xa3ef('0x2d')]){_0x411209[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x411209[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x411209[_0xa3ef('0x54')],function(_0x4b7377){var _0x416596={};_0x416596[_0x4b7377]={'$like':'%'+_0x54afc0['query'][_0xa3ef('0x2d')]+'%'};return _0x416596;})});}_0x411209=_[_0xa3ef('0x56')]({},_0x411209,_0x54afc0[_0xa3ef('0x57')]);return _0x25e8ad['getWhatsappAccounts'](_0x411209);}})['then'](function(_0x157069){if(_0x157069){_0x70c7a6=_0x157069[_0xa3ef('0x46')];if(!_0x54afc0['query'][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x411209['limit']=qs[_0xa3ef('0x1d')](_0x54afc0[_0xa3ef('0x3e')][_0xa3ef('0x1d')]);_0x411209[_0xa3ef('0x1c')]=qs[_0xa3ef('0x1c')](_0x54afc0[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}return _0x25e8ad['getWhatsappAccounts'](_0x411209);}})[_0xa3ef('0x23')](function(_0x54545f){if(_0x54545f){return _0x54545f?{'count':_0x70c7a6,'rows':_0x54545f}:null;}})[_0xa3ef('0x23')](respondWithResult(_0x156005,null))['catch'](handleError(_0x156005,null));};exports[_0xa3ef('0x14a')]=function(_0x1f9059,_0x58568e){return db['User']['find']({'where':{'id':_0x1f9059[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x58568e,null))[_0xa3ef('0x23')](function(_0x4c0112){if(_0x4c0112){return _0x4c0112[_0xa3ef('0x14a')](_0x1f9059[_0xa3ef('0x5b')][_0xa3ef('0x5f')],_[_0xa3ef('0x60')](_0x1f9059[_0xa3ef('0x5b')],[_0xa3ef('0x5f'),'id'])||{});}})[_0xa3ef('0x23')](respondWithResult(_0x58568e,null))[_0xa3ef('0x5a')](handleError(_0x58568e,null));};exports[_0xa3ef('0x14b')]=function(_0x27d21b,_0x2052df){return db['User'][_0xa3ef('0x31')]({'where':{'id':_0x27d21b['params']['id']}})['then'](handleEntityNotFound(_0x2052df,null))[_0xa3ef('0x23')](function(_0x38fd20){if(_0x38fd20){return _0x38fd20[_0xa3ef('0x14b')](_0x27d21b['query']['ids']);}})[_0xa3ef('0x23')](respondWithStatusCode(_0x2052df,null))[_0xa3ef('0x5a')](handleError(_0x2052df,null));};exports['getScheduledCalls']=function(_0xfb8dc4,_0x3db52b){var _0x29845a={},_0x1ccd2d={},_0x4e2a72={'count':0x0,'rows':[]};var _0x5a112e=db['CmHopper'][_0xa3ef('0x37')];_0x1ccd2d[_0xa3ef('0x4e')]=_[_0xa3ef('0x50')](_0x5a112e);_0x1ccd2d[_0xa3ef('0x3e')]=_[_0xa3ef('0x50')](_0xfb8dc4[_0xa3ef('0x3e')]);_0x1ccd2d[_0xa3ef('0x51')]=_[_0xa3ef('0x52')](_0x1ccd2d[_0xa3ef('0x4e')],_0x1ccd2d[_0xa3ef('0x3e')]);_0x1ccd2d[_0xa3ef('0x51')]=_['concat'](_0x1ccd2d[_0xa3ef('0x51')],['$and',_0xa3ef('0x14c'),_0xa3ef('0x14d'),_0xa3ef('0x14e'),_0xa3ef('0x14f'),_0xa3ef('0x150'),_0xa3ef('0x151'),_0xa3ef('0x152'),_0xa3ef('0x153'),_0xa3ef('0x154'),_0xa3ef('0x155'),'$in',_0xa3ef('0x156'),_0xa3ef('0x157'),'$notLike',_0xa3ef('0x158'),_0xa3ef('0x159'),_0xa3ef('0x157'),_0xa3ef('0x15a'),_0xa3ef('0x15b'),_0xa3ef('0x15c'),_0xa3ef('0x15d')]);_0x29845a[_0xa3ef('0x54')]=_[_0xa3ef('0x52')](_0x1ccd2d[_0xa3ef('0x4e')],qs[_0xa3ef('0x53')](_0xfb8dc4[_0xa3ef('0x3e')][_0xa3ef('0x53')]));_0x29845a['attributes']=_0x29845a[_0xa3ef('0x54')][_0xa3ef('0x46')]?_0x29845a[_0xa3ef('0x54')]:_0x1ccd2d[_0xa3ef('0x4e')];if(!_0xfb8dc4[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x29845a[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0xfb8dc4['query'][_0xa3ef('0x1d')]);_0x29845a['offset']=qs[_0xa3ef('0x1c')](_0xfb8dc4[_0xa3ef('0x3e')][_0xa3ef('0x1c')]);}_0x29845a['order']=qs[_0xa3ef('0xce')](_0xfb8dc4[_0xa3ef('0x3e')][_0xa3ef('0xce')]);_0x29845a[_0xa3ef('0x3d')]=qs[_0xa3ef('0x51')](_['pick'](_0xfb8dc4[_0xa3ef('0x3e')],_0x1ccd2d[_0xa3ef('0x51')]));if(_0xfb8dc4['query'][_0xa3ef('0x2d')]){_0x29845a[_0xa3ef('0x3d')]=_[_0xa3ef('0x56')](_0x29845a[_0xa3ef('0x3d')],{'$or':_[_0xa3ef('0x2e')](_0x29845a[_0xa3ef('0x54')],function(_0x4e9291){var _0x50977c={};_0x50977c[_0x4e9291]={'$like':'%'+_0xfb8dc4['query']['filter']+'%'};return _0x50977c;})});}_0x29845a['where']={'$and':[_0x29845a[_0xa3ef('0x3d')],{'$or':[{'UserId':_0xfb8dc4[_0xa3ef('0x5c')]['id']},{'OwnerId':_0xfb8dc4[_0xa3ef('0x5c')]['id']}]}]};_0x29845a=_[_0xa3ef('0x56')]({},_0x29845a,_0xfb8dc4['options']);var _0x5997c7={'where':_0x29845a[_0xa3ef('0x3d')]};return db[_0xa3ef('0x15e')][_0xa3ef('0x1f')](_0x5997c7)[_0xa3ef('0x23')](function(_0x1436cf){_0x4e2a72[_0xa3ef('0x1f')]=_0x1436cf;if(_0xfb8dc4['query']['includeAll']){_0x29845a['include']=[{'attributes':['id','firstName',_0xa3ef('0x15f'),_0xa3ef('0xec')],'model':db[_0xa3ef('0x160')],'as':'Contact'},{'attributes':['id',_0xa3ef('0x32'),_0xa3ef('0x161')],'model':db[_0xa3ef('0xa8')],'as':_0xa3ef('0xd8')}];}return db[_0xa3ef('0x15e')][_0xa3ef('0xa9')](_0x29845a);})['then'](function(_0x344895){_0x4e2a72[_0xa3ef('0x44')]=_0x344895;return _0x4e2a72;})[_0xa3ef('0x23')](respondWithFilteredResult(_0x3db52b,_0x29845a))[_0xa3ef('0x5a')](handleError(_0x3db52b,null));};exports[_0xa3ef('0x162')]=function(_0x46b6c2,_0x5aa662){if(!_[_0xa3ef('0x66')](_0x46b6c2[_0xa3ef('0x7e')]['id'])&&(_0x46b6c2[_0xa3ef('0x7e')][_0xa3ef('0x24')]==_0xa3ef('0x29')||_0x46b6c2['user'][_0xa3ef('0x24')]==_0xa3ef('0x7e'))){return db[_0xa3ef('0x36')]['findOne']({'where':{'id':_0x46b6c2[_0xa3ef('0x5c')]['id']},'raw':!![]})[_0xa3ef('0x23')](function(_0x4754e8){return authService[_0xa3ef('0x163')](_0x4754e8);})['then'](function(_0x22a080){if(_0x22a080){return _0x5aa662[_0xa3ef('0x1a')](0xc8)[_0xa3ef('0x1b')]({'api_key':_0x22a080[_0xa3ef('0x164')]});}else{return _0x5aa662[_0xa3ef('0x1a')](0xcc)[_0xa3ef('0x1b')]({'message':_0xa3ef('0x165')});}})[_0xa3ef('0x5a')](handleError(_0x5aa662,0x193));}else{return _0x5aa662['status'](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xa3ef('0x166')]=function(_0x16f3bd,_0x350bb6){if(!_[_0xa3ef('0x66')](_0x16f3bd['user']['id'])&&(_0x16f3bd[_0xa3ef('0x7e')]['role']==_0xa3ef('0x29')||_0x16f3bd[_0xa3ef('0x7e')][_0xa3ef('0x24')]=='user')){return db[_0xa3ef('0x36')][_0xa3ef('0x31')]({'where':{'id':_0x16f3bd[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](function(_0x391646){return authService[_0xa3ef('0x167')](_0x391646);})[_0xa3ef('0x23')](function(_0x1955e3){return db[_0xa3ef('0x36')]['update']({'apiKeyIat':_0x1955e3[_0xa3ef('0x168')],'apiKeyNonce':_0x1955e3[_0xa3ef('0x169')]},{'where':{'id':_0x16f3bd[_0xa3ef('0x5c')]['id']}})['then'](function(){return _0x350bb6[_0xa3ef('0x1a')](0xc8)[_0xa3ef('0x1b')]({'api_key':_0x1955e3[_0xa3ef('0x164')]});});})['catch'](handleError(_0x350bb6,0x193));}else{return _0x350bb6[_0xa3ef('0x1a')](0x191)[_0xa3ef('0x1b')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xa3ef('0x16a')]=function(_0x13cdf1,_0x3b7095){if(!_[_0xa3ef('0x66')](_0x13cdf1[_0xa3ef('0x7e')]['id'])&&(_0x13cdf1['user']['role']==_0xa3ef('0x29')||_0x13cdf1['user']['role']=='user')){return db['User'][_0xa3ef('0x31')]({'where':{'id':_0x13cdf1[_0xa3ef('0x5c')]['id']}})[_0xa3ef('0x23')](handleEntityNotFound(_0x3b7095,null))[_0xa3ef('0x23')](function(_0x2f891a){if(_0x2f891a&&_0x2f891a['apiKeyNonce']&&_0x2f891a[_0xa3ef('0x16b')])return _0x2f891a;else throw{'message':_0xa3ef('0x16c')};})[_0xa3ef('0x23')](function(){return db[_0xa3ef('0x36')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x13cdf1[_0xa3ef('0x5c')]['id']}});})['then'](respondWithStatusCode(_0x3b7095,0xc8))[_0xa3ef('0x5a')](handleError(_0x3b7095,0x193));}else{return _0x3b7095[_0xa3ef('0x1a')](0x191)[_0xa3ef('0x1b')]({'message':_0xa3ef('0x16d')});}};exports[_0xa3ef('0x16e')]=function(_0x337201,_0x5233e1){var _0x498588=_0x337201[_0xa3ef('0x7e')][_0xa3ef('0xaa')]({'plain':!![]});if(!_0x498588){return _0x5233e1[_0xa3ef('0x1a')](0x191)[_0xa3ef('0x120')](_0xa3ef('0x16f'));}else{Promise[_0xa3ef('0x170')]()['then'](function(){if(_0x337201[_0xa3ef('0x3e')][_0xa3ef('0x41')]!=='true')return;return _0x337201[_0xa3ef('0x7e')][_0xa3ef('0x171')]();})['then'](function(_0x5b85b5){if(!_0x5b85b5)return;return _0x5b85b5[_0xa3ef('0xaa')]({'plain':!![]});})[_0xa3ef('0x23')](function(_0x1215d5){_0x498588[_0xa3ef('0x41')]=_0x1215d5;return _0x5233e1[_0xa3ef('0x1a')](0xc8)[_0xa3ef('0x1b')](_0x498588);});}};exports['getPresence']=function(_0x2944ed,_0x5011dc){var _0x433d06={'offset':0x0},_0xf8d0d2={'count':0x0,'rows':[]};Promise[_0xa3ef('0x170')]()[_0xa3ef('0x23')](function(){if(!_0x2944ed[_0xa3ef('0x3e')]['filter']&&!_0x2944ed[_0xa3ef('0x3e')]['teams']&&!_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x172')])return[];return Promise[_0xa3ef('0x170')]()['then'](function(){var _0x4a652c=[];if(!_[_0xa3ef('0x8a')](_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x173')])){_0x4a652c[_0xa3ef('0x43')](db['Team']['findAll']({'attributes':['id',_0xa3ef('0x32')],'where':{'id':_0x2944ed[_0xa3ef('0x3e')]['teams']}}));}if(!_['isEmpty'](_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x172')])){_0x4a652c[_0xa3ef('0x43')](db[_0xa3ef('0xa8')][_0xa3ef('0xa9')]({'attributes':['id',_0xa3ef('0x32')],'type':'inbound','where':{'id':_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x172')]}}));}return Promise[_0xa3ef('0x59')](_0x4a652c);})[_0xa3ef('0x23')](function(_0x48ab66){var _0x39e01d=_['flatten'](_0x48ab66)['map'](function(_0x25639b){return _0x25639b[_0xa3ef('0x174')]({'attributes':['id',_0xa3ef('0x32'),'internal','online'],'raw':!![]});});return Promise[_0xa3ef('0x59')](_0x39e01d);})[_0xa3ef('0x23')](function(_0x2511b4){var _0x83209b=_['flatten'](_0x2511b4);if(!_0x2944ed[_0xa3ef('0x3e')]['filter'])return _0x83209b;if(_[_0xa3ef('0x8a')](_0x83209b)){return db[_0xa3ef('0x36')][_0xa3ef('0xa9')]({'attributes':['id',_0xa3ef('0x32'),_0xa3ef('0x65'),_0xa3ef('0x102')],'where':{'role':_0xa3ef('0x25'),'$or':[db['sequelize'][_0xa3ef('0x3d')](db[_0xa3ef('0x68')]['fn'](_0xa3ef('0x175'),db[_0xa3ef('0x68')][_0xa3ef('0x176')](_0xa3ef('0x32'))),{'$like':'%'+_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x2d')][_0xa3ef('0xa6')]()+'%'}),{'internal':{'$like':'%'+_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x2d')]+'%'}}]},'raw':!![]});}else{return _(_0x83209b)[_0xa3ef('0x177')]()[_0xa3ef('0x2d')](function(_0x29d670){return _0x29d670[_0xa3ef('0x32')][_0xa3ef('0xa6')]()[_0xa3ef('0x30')](_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x2d')]['toLowerCase']())||_0x29d670['internal'][_0xa3ef('0x178')]()['includes'](_0x2944ed['query'][_0xa3ef('0x2d')]);})['value']();}})[_0xa3ef('0x23')](function(_0x47abb8){var _0x259c3a=_0xa3ef('0x32');var _0x324908=_0xa3ef('0x179');if(_0x2944ed[_0xa3ef('0x3e')]['sort']){_0x324908=_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0xce')][0x0]==='-'?_0xa3ef('0x17a'):_0xa3ef('0x179');_0x259c3a=_0x324908===_0xa3ef('0x179')?_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0xce')]:_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0xce')][_0xa3ef('0x17b')](0x1);}return _(_0x47abb8)[_0xa3ef('0x17c')]('id')[_0xa3ef('0x17d')]([function(_0x37d201){return _0x259c3a===_0xa3ef('0x32')?_0x37d201[_0x259c3a][_0xa3ef('0xa6')]():_0x37d201[_0x259c3a];}],[_0x324908])[_0xa3ef('0x2e')](function(_0x23a629){return _['pick'](_0x23a629,['id',_0xa3ef('0x32'),'internal',_0xa3ef('0x102')]);})['value']();})[_0xa3ef('0x23')](function(_0x54101f){return amiClient[_0xa3ef('0x17e')](_0xa3ef('0x86'),_0x2944ed)[_0xa3ef('0x23')](function(_0x35f580){if(_0x35f580[_0xa3ef('0x15')])throw new Error(_0xa3ef('0x17f'));var _0x306ae4=_0x35f580[_0xa3ef('0x17')];var _0x4d7711=jayson[_0xa3ef('0xe')]['http']({'port':0x232c});return _0x4d7711[_0xa3ef('0x17e')]('Agents',_0x2944ed)[_0xa3ef('0x23')](function(_0x4c9c19){if(_0x4c9c19[_0xa3ef('0x15')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x2a5d1d=_0x4c9c19[_0xa3ef('0x17')];return _['merge']({},_0x2a5d1d,_0x306ae4);});})[_0xa3ef('0x23')](function(_0xeb9868){return _[_0xa3ef('0x2e')](_0x54101f,function(_0x4abef5){var _0x419a8b=_['find'](_0xeb9868[_0xa3ef('0x44')],['id',_0x4abef5['id']]);if(!_0x419a8b||!_0x4abef5[_0xa3ef('0x102')]){_0x4abef5[_0xa3ef('0x1a')]='offline';}else if(_0x419a8b['voicePause']){_0x4abef5[_0xa3ef('0x1a')]='pause';}else{_0x4abef5[_0xa3ef('0x1a')]=_[_0xa3ef('0x30')]([_0xa3ef('0x180'),_0xa3ef('0x181'),_0xa3ef('0x182'),'ringing',null,undefined],_0x419a8b[_0xa3ef('0x183')])?_0xa3ef('0x102'):_0xa3ef('0x184');}return _0x4abef5;});});});})[_0xa3ef('0x23')](function(_0x2f8ea3){if(!_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0xd0')](_0xa3ef('0xd6'))){_0x433d06[_0xa3ef('0x1d')]=qs[_0xa3ef('0x1d')](_0x2944ed[_0xa3ef('0x3e')][_0xa3ef('0x1d')]||0xa);_0x433d06['offset']=qs[_0xa3ef('0x1c')](_0x2944ed['query'][_0xa3ef('0x1c')]);}_0xf8d0d2['count']=_0x2f8ea3[_0xa3ef('0x46')];_0xf8d0d2[_0xa3ef('0x44')]=_0x433d06['limit']?_0x2f8ea3[_0xa3ef('0x185')](_0x433d06[_0xa3ef('0x1c')],_0x433d06['offset']+_0x433d06['limit']):_0x2f8ea3;return _0xf8d0d2;})[_0xa3ef('0x23')](respondWithFilteredResult(_0x5011dc,_0x433d06))[_0xa3ef('0x5a')](handleError(_0x5011dc,null));};function get_open_tabs(_0xa1a0f3,_0x553eaa){var _0x2b889f=_0xa1a0f3[_0xa3ef('0x186')](0x0)[_0xa3ef('0x187')]()+_0xa1a0f3['slice'](0x1);var _0x2d65fc={'type':db[_0xa3ef('0x8f')]['QueryTypes'][_0xa3ef('0x6a')],'raw':!![]};return new Promise(function(_0x4d9310,_0xe4e88b){var _0x10f9ee=squel['select']()[_0xa3ef('0x188')]('ui.'+_0x2b889f+'InteractionId','id')[_0xa3ef('0x188')](_0xa3ef('0x189'))[_0xa3ef('0x6b')](_0xa3ef('0x18a')+_0xa1a0f3+_0xa3ef('0x18b'),'ui')['where']('ui.UserId\x20=\x20?',_0x553eaa['id']);return db[_0xa3ef('0x68')][_0xa3ef('0x3e')](_0x10f9ee[_0xa3ef('0x178')](),_0x2d65fc)['then'](function(_0x5e681e){_0x553eaa[_0x2b889f+'OpenTabs']=_0x5e681e;_0x4d9310(_0x5e681e);})[_0xa3ef('0x5a')](function(_0x238f80){_0xe4e88b(_0x238f80);});});}
\ No newline at end of file
index 622a0e7..db5297d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b06=['../../mysqldb','User','setMaxListeners','update','emit','hook','events'];(function(_0x39f0bc,_0x2cab46){var _0x5d48ce=function(_0x3e6c72){while(--_0x3e6c72){_0x39f0bc['push'](_0x39f0bc['shift']());}};_0x5d48ce(++_0x2cab46);}(_0x9b06,0x141));var _0x69b0=function(_0x3e3ed1,_0x48a637){_0x3e3ed1=_0x3e3ed1-0x0;var _0x2db310=_0x9b06[_0x3e3ed1];return _0x2db310;};'use strict';var EventEmitter=require(_0x69b0('0x0'));var User=require(_0x69b0('0x1'))['db'][_0x69b0('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x69b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x69b0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a97c9){return function(_0x3d218f,_0x5a0396,_0x709538){UserEvents[_0x69b0('0x5')](_0x2a97c9+':'+_0x3d218f['id'],_0x3d218f);UserEvents[_0x69b0('0x5')](_0x2a97c9,_0x3d218f);_0x709538(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x69b0('0x6')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
+var _0xf743=['../../mysqldb','User','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x239d36,_0xf56ab2){var _0x97d06c=function(_0x47af15){while(--_0x47af15){_0x239d36['push'](_0x239d36['shift']());}};_0x97d06c(++_0xf56ab2);}(_0xf743,0x154));var _0x3f74=function(_0x2b1861,_0x53cf87){_0x2b1861=_0x2b1861-0x0;var _0x221a91=_0xf743[_0x2b1861];return _0x221a91;};'use strict';var EventEmitter=require('events');var User=require(_0x3f74('0x0'))['db'][_0x3f74('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x3f74('0x2')](0x0);var events={'afterCreate':_0x3f74('0x3'),'afterUpdate':_0x3f74('0x4'),'afterDestroy':_0x3f74('0x5')};function emitEvent(_0x40b6df){return function(_0x482b25,_0x3fb947,_0xce13f){UserEvents[_0x3f74('0x6')](_0x40b6df+':'+_0x482b25['id'],_0x482b25);UserEvents['emit'](_0x40b6df,_0x482b25);_0xce13f(null);};}for(var e in events){if(events[_0x3f74('0x7')](e)){var event=events[e];User[_0x3f74('0x8')](e,emitEvent(event));}}module[_0x3f74('0x9')]=UserEvents;
\ No newline at end of file
index 514459e..f4262fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c7b=['password','encryptPassword','function','toString','base64','salt','from','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','client','http','request','error','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','manual','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','voice','UserVoiceQueueRt','update','findOne','PAUSE','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','voicePause','chatPause','smsPause','whatsappPause','openchannelPause','Pause','getRealtimeData','../../config/utils','getChannels','forEach','Status','setDataValue','bluebird','moment','jayson/promise','./user.attributes','google','length','from-sip','system','format','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','gsm','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','defaults','findAll','then','internal','concat','catch','exports','models','define','User','users','userProfileId','undefined','UserProfile','find','privacyEnabled','updateMd5Password','updatePassword','changed','resolve','userSetting','createUserSetting','VoiceExtension','bulkCreate','destroy','context'];(function(_0x47427a,_0x4653ef){var _0x2b9d8b=function(_0x26cace){while(--_0x26cace){_0x47427a['push'](_0x47427a['shift']());}};_0x2b9d8b(++_0x4653ef);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x13de19,_0x4e3007){_0x13de19=_0x13de19-0x0;var _0x59d967=_0x6c7b[_0x13de19];return _0x59d967;};'use strict';var BPromise=require(_0xb6c7('0x0'));var crypto=require('crypto');var util=require('util');var md5=require('md5');var moment=require(_0xb6c7('0x1'));var _=require('lodash');var jayson=require(_0xb6c7('0x2'));var attributes=require(_0xb6c7('0x3'));var authTypes=[_0xb6c7('0x4')];var validatePresenceOf=function(_0x5857e0){return _0x5857e0&&_0x5857e0[_0xb6c7('0x5')];};var getChanSpyApplications=function(_0x290c39,_0xfe3eb9,_0x219abc){var _0xb889c3={'context':_0x290c39['context']||_0xb6c7('0x6'),'type':_0xb6c7('0x7'),'isApp':![],'UserId':_0x290c39['id']};var _0xe2ce08=[];for(var _0x9c88ae=0x0,_0x577c54=0x1;_0x9c88ae<_0x219abc[_0xb6c7('0x5')];_0x9c88ae++,_0x577c54=0x1){var _0x245016={'exten':util[_0xb6c7('0x8')]('%s%s',_0x219abc[_0x9c88ae]['prefix'],_0xfe3eb9),'ChanSpyId':_0x219abc[_0x9c88ae]['id']};_0xe2ce08[_0xb6c7('0x9')](_[_0xb6c7('0xa')]({'app':_0xb6c7('0xb'),'appdata':util[_0xb6c7('0x8')](_0xb6c7('0xc'),_0xb6c7('0xd')),'priority':_0x577c54++},_0xb889c3,_0x245016));if(_0x219abc[_0x9c88ae][_0xb6c7('0xe')]){_0xe2ce08['push'](_[_0xb6c7('0xa')]({'app':_0xb6c7('0xf'),'appdata':util[_0xb6c7('0x8')](_0xb6c7('0x10'),_0x219abc[_0x9c88ae][_0xb6c7('0x11')]),'priority':_0x577c54++},_0xb889c3,_0x245016));}if(_0x219abc[_0x9c88ae][_0xb6c7('0x12')]){_0xe2ce08[_0xb6c7('0x9')](_['merge']({'app':_0xb6c7('0x13'),'appdata':_0x219abc[_0x9c88ae]['password'],'priority':_0x577c54++},_0xb889c3,_0x245016));}_0xe2ce08['push'](_['merge']({'app':_0xb6c7('0x14'),'appdata':util['format'](_0xb6c7('0x15'),_0x290c39[_0xb6c7('0x16')],_0x219abc[_0x9c88ae][_0xb6c7('0x17')]?_0x219abc[_0x9c88ae][_0xb6c7('0x17')][_0xb6c7('0x18')](''):''),'priority':_0x577c54++},_0xb889c3,_0x245016));if(_0x219abc[_0x9c88ae][_0xb6c7('0xe')]){_0xe2ce08[_0xb6c7('0x9')](_[_0xb6c7('0xa')]({'app':_0xb6c7('0x19'),'priority':_0x577c54++},_0xb889c3,_0x245016));}}return _0xe2ce08;};var getUserApplications=function(_0xd0434e,_0xef5eb1){var _0x3f133f=[_0xb6c7('0x1a'),'WAV',_0xb6c7('0x1b')];var _0x1cbcc8={'context':_0xd0434e['context']||_0xb6c7('0x6'),'exten':_0xef5eb1,'type':'system','isApp':![],'UserId':_0xd0434e['id']};var _0x37f7cb=[{'app':'Set','appdata':_0xb6c7('0x1c')}];if(_0xd0434e['extensionMonitor']&&_[_0xb6c7('0x1d')](_0x3f133f,_0xd0434e[_0xb6c7('0x1e')])){_0x37f7cb['push']({'app':_0xb6c7('0xb'),'appdata':_0xb6c7('0x1f')});_0x37f7cb[_0xb6c7('0x9')]({'app':_0xb6c7('0xb'),'appdata':util[_0xb6c7('0x8')](_0xb6c7('0x20'),_0xd0434e['extensionMonitor'])});_0x37f7cb[_0xb6c7('0x9')]({'app':_0xb6c7('0x21'),'appdata':util[_0xb6c7('0x8')](_0xb6c7('0x22'),_0xd0434e['name'])});}else{_0x37f7cb[_0xb6c7('0x9')]({'app':_0xb6c7('0x21'),'appdata':util['format'](_0xb6c7('0x23'),_0xd0434e[_0xb6c7('0x16')])});}_0x37f7cb[_0xb6c7('0x9')]({'app':_0xb6c7('0x24')});for(var _0x4fb79f=0x0;_0x4fb79f<_0x37f7cb[_0xb6c7('0x5')];_0x4fb79f++){_0x37f7cb[_0x4fb79f]['priority']=_0x4fb79f+0x1;_0x37f7cb[_0x4fb79f]=_[_0xb6c7('0x25')](_0x37f7cb[_0x4fb79f],_0x1cbcc8);}return _0x37f7cb;};var getChanSpyPromise=function(_0x1ee244,_0x232f7f){return new BPromise(function(_0x5f3be2,_0x47acab){return _0x1ee244['VoiceChanSpy'][_0xb6c7('0x26')]()[_0xb6c7('0x27')](function(_0x210c2a){if(_0x210c2a){var _0x457df0=getChanSpyApplications(_0x232f7f,_0x232f7f[_0xb6c7('0x28')],_0x210c2a);if(_0x232f7f[_0xb6c7('0x28')]!=_0x232f7f[_0xb6c7('0x16')]){_0x457df0=_0x457df0[_0xb6c7('0x29')](getChanSpyApplications(_0x232f7f,_0x232f7f[_0xb6c7('0x16')],_0x210c2a));}return _0x5f3be2(_0x457df0);}return _0x5f3be2([]);})[_0xb6c7('0x2a')](function(_0x5dabdd){_0x47acab(_0x5dabdd);});});};module[_0xb6c7('0x2b')]=function(_0x4f16d5){var _0x216ee7=_0x4f16d5[_0xb6c7('0x2c')];return _0x4f16d5[_0xb6c7('0x2d')](_0xb6c7('0x2e'),attributes,{'tableName':_0xb6c7('0x2f'),'charset':'utf8','collate':'utf8_bin','hooks':{'beforeCreate':function(_0x536e4d,_0xde1ca2,_0x2afb91){var _0x597650=typeof _0x536e4d[_0xb6c7('0x30')]===_0xb6c7('0x31')?BPromise['resolve'](null):_0x216ee7[_0xb6c7('0x32')][_0xb6c7('0x33')]({'where':{'id':_0x536e4d[_0xb6c7('0x30')]}});_0x597650[_0xb6c7('0x27')](function(_0x317a58){if(_0x317a58){_0x536e4d[_0xb6c7('0x34')]=_0x317a58['privacyEnabled'];}})[_0xb6c7('0x27')](function(){_0x536e4d[_0xb6c7('0x35')]();_0x536e4d[_0xb6c7('0x36')](_0x2afb91);})[_0xb6c7('0x2a')](function(_0x2b0093){_0x2afb91(_0x2b0093);});},'beforeUpdate':function(_0x158bf7,_0x439a2b,_0x55a871){Promise['resolve']()[_0xb6c7('0x27')](function(){if(_0x158bf7[_0xb6c7('0x37')](_0xb6c7('0x30'))===![])return;return _0x216ee7[_0xb6c7('0x32')][_0xb6c7('0x33')]({'where':{'id':_0x158bf7[_0xb6c7('0x30')]}})[_0xb6c7('0x27')](function(_0x157b86){if(_0x157b86)_0x158bf7[_0xb6c7('0x34')]=_0x157b86[_0xb6c7('0x34')];return;});})['then'](function(){if(_0x158bf7[_0xb6c7('0x37')]('password')){_0x158bf7['updateMd5Password']();return _0x158bf7[_0xb6c7('0x36')](_0x55a871);}_0x55a871();})['catch'](function(_0x3af5be){_0x55a871(_0x3af5be);});},'afterCreate':function(_0x2479c,_0x53f831,_0xe634e2){var _0x22f5b2=getUserApplications(_0x2479c,_0x2479c[_0xb6c7('0x28')]);if(_0x2479c[_0xb6c7('0x28')]!=_0x2479c[_0xb6c7('0x16')]){_0x22f5b2=_0x22f5b2['concat'](getUserApplications(_0x2479c,_0x2479c['name']));}return Promise[_0xb6c7('0x38')]()[_0xb6c7('0x27')](function(){if(!_0x2479c[_0xb6c7('0x39')]){return _0x2479c[_0xb6c7('0x3a')]({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})['then'](function(){return _0x216ee7[_0xb6c7('0x3b')][_0xb6c7('0x3c')](_0x22f5b2);})[_0xb6c7('0x27')](function(){if(_0x2479c[_0xb6c7('0xd')]){return getChanSpyPromise(_0x216ee7,_0x2479c);}})[_0xb6c7('0x27')](function(_0x4eb2c7){if(_0x4eb2c7&&_0x4eb2c7['length']){return _0x216ee7['VoiceExtension'][_0xb6c7('0x3c')](_0x4eb2c7);}})[_0xb6c7('0x27')](function(){_0xe634e2();})[_0xb6c7('0x2a')](function(_0x5050c9){_0xe634e2(_0x5050c9);});},'afterUpdate':function(_0x1c2983,_0x2ec964,_0x51ede4){return BPromise[_0xb6c7('0x38')]()[_0xb6c7('0x27')](function(){if(_0x1c2983[_0xb6c7('0x37')](_0xb6c7('0xd'))||_0x1c2983[_0xb6c7('0x37')]('context')){return _0x216ee7[_0xb6c7('0x3b')][_0xb6c7('0x3d')]({'where':{'UserId':_0x1c2983['id'],'type':_0xb6c7('0x7'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x1c2983['chanspy']){return getChanSpyPromise(_0x216ee7,_0x1c2983)[_0xb6c7('0x27')](function(_0x37b131){if(_0x37b131&&_0x37b131[_0xb6c7('0x5')]){return _0x216ee7['VoiceExtension']['bulkCreate'](_0x37b131);}});}});}})['then'](function(){if(_0x1c2983[_0xb6c7('0x37')](_0xb6c7('0x1e'))||_0x1c2983[_0xb6c7('0x37')](_0xb6c7('0x3e'))){return _0x216ee7[_0xb6c7('0x3b')][_0xb6c7('0x3d')]({'where':{'UserId':_0x1c2983['id'],'type':_0xb6c7('0x7'),'ChanSpyId':null}})['then'](function(){var _0x22b21b=getUserApplications(_0x1c2983,_0x1c2983[_0xb6c7('0x28')]);if(_0x1c2983[_0xb6c7('0x28')]!=_0x1c2983[_0xb6c7('0x16')]){_0x22b21b=_0x22b21b[_0xb6c7('0x29')](getUserApplications(_0x1c2983,_0x1c2983['name']));}return _0x216ee7[_0xb6c7('0x3b')][_0xb6c7('0x3c')](_0x22b21b);});}})[_0xb6c7('0x27')](function(){_0x51ede4();})[_0xb6c7('0x2a')](function(_0x2fadd){_0x51ede4(_0x2fadd);});},'afterDestroy':function(_0x1d858f){return _0x216ee7['VoiceExtension'][_0xb6c7('0x3d')]({'where':{'UserId':_0x1d858f['id'],'type':_0xb6c7('0x7')}});}},'instanceMethods':{'authenticate':function(_0x2116cb,_0x27ce47){if(!_0x27ce47){return this[_0xb6c7('0x3f')]===this[_0xb6c7('0x40')](_0x2116cb);}var _0x298a7c=this;this['encryptPassword'](_0x2116cb,function(_0x5218af,_0x4fd77d){if(_0x5218af){_0x27ce47(_0x5218af);}if(_0x298a7c[_0xb6c7('0x3f')]===_0x4fd77d){_0x27ce47(null,!![]);}else{_0x27ce47(null,![]);}});},'makeSalt':function(_0x22e7a1,_0x4244f8){var _0x394c01=0x10;if(typeof arguments[0x0]===_0xb6c7('0x41')){_0x4244f8=arguments[0x0];_0x22e7a1=_0x394c01;}else if(typeof arguments[0x1]===_0xb6c7('0x41')){_0x4244f8=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x22e7a1){_0x22e7a1=_0x394c01;}return crypto['randomBytes'](_0x22e7a1,function(_0x395626,_0x517bc1){if(_0x395626){_0x4244f8(_0x395626);}return _0x4244f8(null,_0x517bc1[_0xb6c7('0x42')](_0xb6c7('0x43')));});},'encryptPassword':function(_0x398c59,_0x210d50){if(!_0x398c59||!this[_0xb6c7('0x44')]){return _0x210d50?_0x210d50(null):null;}var _0x4971dc=0x2710;var _0x222c72=0x40;var _0x5700dc=Buffer[_0xb6c7('0x45')](this[_0xb6c7('0x44')],_0xb6c7('0x43'));if(!_0x210d50){return crypto[_0xb6c7('0x46')](_0x398c59,_0x5700dc,_0x4971dc,_0x222c72,_0xb6c7('0x47'))['toString'](_0xb6c7('0x43'));}return crypto[_0xb6c7('0x48')](_0x398c59,_0x5700dc,_0x4971dc,_0x222c72,_0xb6c7('0x47'),function(_0x400c8d,_0x416083){if(_0x400c8d){_0x210d50(_0x400c8d);}return _0x210d50(null,_0x416083[_0xb6c7('0x42')](_0xb6c7('0x43')));});},'updatePassword':function(_0x35b30a){if(!this['password']){return _0x35b30a(null);}if(!validatePresenceOf(this[_0xb6c7('0x3f')])&&authTypes[_0xb6c7('0x49')](this[_0xb6c7('0x4a')])===-0x1){_0x35b30a(new Error(_0xb6c7('0x4b')));}var _0x449d79=this;this[_0xb6c7('0x4c')](function(_0x5e7e11,_0x355b1b){if(_0x5e7e11){return _0x35b30a(_0x5e7e11);}_0x449d79[_0xb6c7('0x44')]=_0x355b1b;_0x449d79[_0xb6c7('0x40')](_0x449d79[_0xb6c7('0x3f')],function(_0x547d10,_0x36ec5c){if(_0x547d10){_0x35b30a(_0x547d10);}_0x449d79[_0xb6c7('0x3f')]=_0x36ec5c;_0x35b30a(null);});});},'updateMd5Password':function(){this[_0xb6c7('0x4d')]=md5(this[_0xb6c7('0x16')]+_0xb6c7('0x4e')+this[_0xb6c7('0x3f')]);return this[_0xb6c7('0x4d')];},'getRealtimeData':function(){var _0x5cb286={'id':this['id']};var _0x2d2242=jayson[_0xb6c7('0x4f')][_0xb6c7('0x50')]({'port':0x232a});var _0x550376=jayson[_0xb6c7('0x4f')][_0xb6c7('0x50')]({'port':0x232c});var _0x40fba7={};var _0x2e5982={};return _0x2d2242[_0xb6c7('0x51')]('Agents',_0x5cb286)[_0xb6c7('0x27')](function(_0x227b64){if(_0x227b64[_0xb6c7('0x52')]){throw new Error(_0xb6c7('0x53'));}_0x40fba7=_0x227b64[_0xb6c7('0x54')];return _0x550376[_0xb6c7('0x51')]('Agents',_0x5cb286);})[_0xb6c7('0x27')](function(_0x27ddfa){if(_0x27ddfa['error']){throw new Error(_0xb6c7('0x55'));}_0x2e5982=_0x27ddfa[_0xb6c7('0x54')];var _0x4ff673=_[_0xb6c7('0xa')]({},_0x40fba7,_0x2e5982);return _0x4ff673;})[_0xb6c7('0x2a')](function(_0x32374e){throw _0x32374e;});},'unpause':function(_0x414ddb,_0x2ba8b2=_0xb6c7('0x56')){var _0xe03c1f=this;var _0x554d7d={};return Promise['resolve']()[_0xb6c7('0x27')](function(){if(!_0x414ddb||_0x414ddb==='voice'&&_0x2ba8b2===_0xb6c7('0x56')){var _0x54bf0b=jayson['client']['http']({'port':0x232a});return _0x54bf0b[_0xb6c7('0x51')]('QueuePause',{'id':_0xe03c1f['id'],'name':_0xe03c1f[_0xb6c7('0x16')],'pause':![]})['then'](function(_0x35bbf5){if(_0x35bbf5['error']){throw new Error(util[_0xb6c7('0x8')](_0xb6c7('0x57'),_0xe03c1f['id'],_0xe03c1f['name']));}return _0x35bbf5['result'][_0xb6c7('0x58')];});}})[_0xb6c7('0x27')](function(){if(!_0x414ddb||_0x414ddb===_0xb6c7('0x59')){return _0x216ee7[_0xb6c7('0x5a')][_0xb6c7('0x5b')]({'paused':0x0},{'where':{'UserId':_0xe03c1f['id']},'individualHooks':!![]});}})[_0xb6c7('0x27')](function(){var _0x19229b=!_0x414ddb?_0xb6c7('0x26'):_0xb6c7('0x5c');var _0x57fcee={'membername':_0xe03c1f[_0xb6c7('0x16')],'type':_0xb6c7('0x5d'),'exitAt':null};if(_0x414ddb){_0x57fcee['channel']=_0x414ddb;}return _0x216ee7[_0xb6c7('0x5e')][_0x19229b]({'where':_0x57fcee});})['then'](function(_0x58e6f6){if(_0x58e6f6){var _0x3be11a=Array[_0xb6c7('0x5f')](_0x58e6f6)?_0x58e6f6:[_0x58e6f6];var _0x4cbac2=_0x3be11a[_0xb6c7('0x60')](function(_0x7e7bfa){return _0x7e7bfa['update']({'exitAt':moment()[_0xb6c7('0x8')](_0xb6c7('0x61')),'data2':_0x2ba8b2});});return Promise['all'](_0x4cbac2);}})[_0xb6c7('0x27')](function(){if(!_0x414ddb){_0x554d7d[_0xb6c7('0x62')]=![];_0x554d7d['mailPause']=![];_0x554d7d[_0xb6c7('0x63')]=![];_0x554d7d['faxPause']=![];_0x554d7d[_0xb6c7('0x64')]=![];_0x554d7d[_0xb6c7('0x65')]=![];_0x554d7d[_0xb6c7('0x66')]=![];}else{_0x554d7d[_0x414ddb+_0xb6c7('0x67')]=![];}return _0xe03c1f[_0xb6c7('0x68')]();})[_0xb6c7('0x27')](function(_0x2ac7bf){var _0x22b9d8=require(_0xb6c7('0x69'));var _0x18bf30=_0x22b9d8[_0xb6c7('0x6a')]();_0x18bf30[_0xb6c7('0x6b')](function(_0x2e5a0e){var _0x34bd58=_0x2e5a0e+_0xb6c7('0x6c');_0xe03c1f[_0xb6c7('0x6d')]([_0x34bd58],_0x2ac7bf[_0x34bd58]);});return _0xe03c1f[_0xb6c7('0x5b')](_0x554d7d);})[_0xb6c7('0x2a')](function(_0x5e9079){throw _0x5e9079;});}}});};
\ No newline at end of file
+var _0x7b83=['resolve','UserProfile','find','privacyEnabled','updateMd5Password','changed','catch','userSetting','error','VoiceExtension','bulkCreate','chanspy','destroy','encryptPassword','function','Missing\x20Callback','from','base64','pbkdf2Sync','sha1','pbkdf2','toString','indexOf','provider','makeSalt','salt','md5secret',':asterisk:','client','http','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','manual','voice','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','UserVoiceQueueRt','findOne','PAUSE','channel','map','update','all','mailPause','chatPause','faxPause','whatsappPause','openchannelPause','Pause','../../config/utils','getChannels','Status','setDataValue','bluebird','crypto','util','lodash','jayson/promise','./user.attributes','length','from-sip','system','%s%s','prefix','push','merge','Set','CDR(type)=%s','record','MixMonitor','format','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','wav','gsm','context','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','VoiceChanSpy','findAll','then','internal','concat','models','User','utf8','utf8_bin','userProfileId'];(function(_0xfb38d5,_0x45404a){var _0x14925b=function(_0x1c66be){while(--_0x1c66be){_0xfb38d5['push'](_0xfb38d5['shift']());}};_0x14925b(++_0x45404a);}(_0x7b83,0xa1));var _0x37b8=function(_0x3f4dcb,_0x44e0e7){_0x3f4dcb=_0x3f4dcb-0x0;var _0x24310d=_0x7b83[_0x3f4dcb];return _0x24310d;};'use strict';var BPromise=require(_0x37b8('0x0'));var crypto=require(_0x37b8('0x1'));var util=require(_0x37b8('0x2'));var md5=require('md5');var moment=require('moment');var _=require(_0x37b8('0x3'));var jayson=require(_0x37b8('0x4'));var attributes=require(_0x37b8('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x420271){return _0x420271&&_0x420271[_0x37b8('0x6')];};var getChanSpyApplications=function(_0x6cc848,_0x2a5439,_0x4102eb){var _0x220cd2={'context':_0x6cc848['context']||_0x37b8('0x7'),'type':_0x37b8('0x8'),'isApp':![],'UserId':_0x6cc848['id']};var _0x50f729=[];for(var _0x17f4c5=0x0,_0x4df684=0x1;_0x17f4c5<_0x4102eb['length'];_0x17f4c5++,_0x4df684=0x1){var _0x5b4f12={'exten':util['format'](_0x37b8('0x9'),_0x4102eb[_0x17f4c5][_0x37b8('0xa')],_0x2a5439),'ChanSpyId':_0x4102eb[_0x17f4c5]['id']};_0x50f729[_0x37b8('0xb')](_[_0x37b8('0xc')]({'app':_0x37b8('0xd'),'appdata':util['format'](_0x37b8('0xe'),'chanspy'),'priority':_0x4df684++},_0x220cd2,_0x5b4f12));if(_0x4102eb[_0x17f4c5][_0x37b8('0xf')]){_0x50f729['push'](_[_0x37b8('0xc')]({'app':_0x37b8('0x10'),'appdata':util[_0x37b8('0x11')](_0x37b8('0x12'),_0x4102eb[_0x17f4c5][_0x37b8('0x13')]),'priority':_0x4df684++},_0x220cd2,_0x5b4f12));}if(_0x4102eb[_0x17f4c5]['auth']){_0x50f729['push'](_[_0x37b8('0xc')]({'app':_0x37b8('0x14'),'appdata':_0x4102eb[_0x17f4c5][_0x37b8('0x15')],'priority':_0x4df684++},_0x220cd2,_0x5b4f12));}_0x50f729['push'](_['merge']({'app':_0x37b8('0x16'),'appdata':util[_0x37b8('0x11')](_0x37b8('0x17'),_0x6cc848[_0x37b8('0x18')],_0x4102eb[_0x17f4c5][_0x37b8('0x19')]?_0x4102eb[_0x17f4c5][_0x37b8('0x19')][_0x37b8('0x1a')](''):''),'priority':_0x4df684++},_0x220cd2,_0x5b4f12));if(_0x4102eb[_0x17f4c5]['record']){_0x50f729[_0x37b8('0xb')](_['merge']({'app':'StopMixMonitor','priority':_0x4df684++},_0x220cd2,_0x5b4f12));}}return _0x50f729;};var getUserApplications=function(_0xc5e1ab,_0x36367a){var _0x39a1c8=[_0x37b8('0x1b'),'WAV',_0x37b8('0x1c')];var _0x344e98={'context':_0xc5e1ab[_0x37b8('0x1d')]||_0x37b8('0x7'),'exten':_0x36367a,'type':'system','isApp':![],'UserId':_0xc5e1ab['id']};var _0x1ec2f4=[{'app':_0x37b8('0xd'),'appdata':_0x37b8('0x1e')}];if(_0xc5e1ab[_0x37b8('0x1f')]&&_['includes'](_0x39a1c8,_0xc5e1ab[_0x37b8('0x1f')])){_0x1ec2f4[_0x37b8('0xb')]({'app':_0x37b8('0xd'),'appdata':_0x37b8('0x20')});_0x1ec2f4[_0x37b8('0xb')]({'app':_0x37b8('0xd'),'appdata':util[_0x37b8('0x11')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0xc5e1ab[_0x37b8('0x1f')])});_0x1ec2f4[_0x37b8('0xb')]({'app':_0x37b8('0x21'),'appdata':util[_0x37b8('0x11')](_0x37b8('0x22'),_0xc5e1ab['name'])});}else{_0x1ec2f4['push']({'app':_0x37b8('0x21'),'appdata':util[_0x37b8('0x11')]('SIP/%s,,tTxX',_0xc5e1ab[_0x37b8('0x18')])});}_0x1ec2f4['push']({'app':_0x37b8('0x23')});for(var _0x141d3a=0x0;_0x141d3a<_0x1ec2f4[_0x37b8('0x6')];_0x141d3a++){_0x1ec2f4[_0x141d3a][_0x37b8('0x24')]=_0x141d3a+0x1;_0x1ec2f4[_0x141d3a]=_['defaults'](_0x1ec2f4[_0x141d3a],_0x344e98);}return _0x1ec2f4;};var getChanSpyPromise=function(_0x176fa6,_0x2a45c1){return new BPromise(function(_0x1d1e77,_0x33eea4){return _0x176fa6[_0x37b8('0x25')][_0x37b8('0x26')]()[_0x37b8('0x27')](function(_0x411431){if(_0x411431){var _0x556983=getChanSpyApplications(_0x2a45c1,_0x2a45c1[_0x37b8('0x28')],_0x411431);if(_0x2a45c1['internal']!=_0x2a45c1[_0x37b8('0x18')]){_0x556983=_0x556983[_0x37b8('0x29')](getChanSpyApplications(_0x2a45c1,_0x2a45c1[_0x37b8('0x18')],_0x411431));}return _0x1d1e77(_0x556983);}return _0x1d1e77([]);})['catch'](function(_0x55e27a){_0x33eea4(_0x55e27a);});});};module['exports']=function(_0x4d47c8){var _0x5c434b=_0x4d47c8[_0x37b8('0x2a')];return _0x4d47c8['define'](_0x37b8('0x2b'),attributes,{'tableName':'users','charset':_0x37b8('0x2c'),'collate':_0x37b8('0x2d'),'hooks':{'beforeCreate':function(_0x50912b,_0x379aa1,_0x5ac244){var _0x410c9b=typeof _0x50912b[_0x37b8('0x2e')]==='undefined'?BPromise[_0x37b8('0x2f')](null):_0x5c434b[_0x37b8('0x30')][_0x37b8('0x31')]({'where':{'id':_0x50912b[_0x37b8('0x2e')]}});_0x410c9b['then'](function(_0x2ddf0d){if(_0x2ddf0d){_0x50912b[_0x37b8('0x32')]=_0x2ddf0d['privacyEnabled'];}})[_0x37b8('0x27')](function(){_0x50912b[_0x37b8('0x33')]();_0x50912b['updatePassword'](_0x5ac244);})['catch'](function(_0x3c91a8){_0x5ac244(_0x3c91a8);});},'beforeUpdate':function(_0x3ca903,_0x5e9430,_0x11abf4){Promise['resolve']()[_0x37b8('0x27')](function(){if(_0x3ca903['changed']('userProfileId')===![])return;return _0x5c434b['UserProfile'][_0x37b8('0x31')]({'where':{'id':_0x3ca903[_0x37b8('0x2e')]}})[_0x37b8('0x27')](function(_0x470d95){if(_0x470d95)_0x3ca903[_0x37b8('0x32')]=_0x470d95[_0x37b8('0x32')];return;});})[_0x37b8('0x27')](function(){if(_0x3ca903[_0x37b8('0x34')](_0x37b8('0x15'))){_0x3ca903['updateMd5Password']();return _0x3ca903['updatePassword'](_0x11abf4);}_0x11abf4();})[_0x37b8('0x35')](function(_0x5cc055){_0x11abf4(_0x5cc055);});},'afterCreate':function(_0x5d85d7,_0x3d97be,_0x50a37c){var _0x6feb1b=getUserApplications(_0x5d85d7,_0x5d85d7[_0x37b8('0x28')]);if(_0x5d85d7[_0x37b8('0x28')]!=_0x5d85d7[_0x37b8('0x18')]){_0x6feb1b=_0x6feb1b[_0x37b8('0x29')](getUserApplications(_0x5d85d7,_0x5d85d7['name']));}return Promise[_0x37b8('0x2f')]()['then'](function(){if(!_0x5d85d7[_0x37b8('0x36')]){return _0x5d85d7['createUserSetting']({'clientSideLoggingLevel':_0x37b8('0x37'),'clientSideLoggingEnabled':![]});}})[_0x37b8('0x27')](function(){return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x39')](_0x6feb1b);})['then'](function(){if(_0x5d85d7[_0x37b8('0x3a')]){return getChanSpyPromise(_0x5c434b,_0x5d85d7);}})[_0x37b8('0x27')](function(_0x328442){if(_0x328442&&_0x328442[_0x37b8('0x6')]){return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x39')](_0x328442);}})['then'](function(){_0x50a37c();})[_0x37b8('0x35')](function(_0x48bc6f){_0x50a37c(_0x48bc6f);});},'afterUpdate':function(_0x1df155,_0x574931,_0x5c003c){return BPromise[_0x37b8('0x2f')]()['then'](function(){if(_0x1df155['changed'](_0x37b8('0x3a'))||_0x1df155[_0x37b8('0x34')](_0x37b8('0x1d'))){return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x3b')]({'where':{'UserId':_0x1df155['id'],'type':'system','ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x1df155[_0x37b8('0x3a')]){return getChanSpyPromise(_0x5c434b,_0x1df155)[_0x37b8('0x27')](function(_0x3635a0){if(_0x3635a0&&_0x3635a0[_0x37b8('0x6')]){return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x39')](_0x3635a0);}});}});}})[_0x37b8('0x27')](function(){if(_0x1df155[_0x37b8('0x34')]('extensionMonitor')||_0x1df155[_0x37b8('0x34')](_0x37b8('0x1d'))){return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x3b')]({'where':{'UserId':_0x1df155['id'],'type':'system','ChanSpyId':null}})[_0x37b8('0x27')](function(){var _0x11edde=getUserApplications(_0x1df155,_0x1df155[_0x37b8('0x28')]);if(_0x1df155[_0x37b8('0x28')]!=_0x1df155[_0x37b8('0x18')]){_0x11edde=_0x11edde['concat'](getUserApplications(_0x1df155,_0x1df155[_0x37b8('0x18')]));}return _0x5c434b[_0x37b8('0x38')][_0x37b8('0x39')](_0x11edde);});}})['then'](function(){_0x5c003c();})['catch'](function(_0x4bc2cf){_0x5c003c(_0x4bc2cf);});},'afterDestroy':function(_0x5be670){return _0x5c434b['VoiceExtension']['destroy']({'where':{'UserId':_0x5be670['id'],'type':_0x37b8('0x8')}});}},'instanceMethods':{'authenticate':function(_0x484261,_0x5463c3){if(!_0x5463c3){return this['password']===this['encryptPassword'](_0x484261);}var _0x118c49=this;this[_0x37b8('0x3c')](_0x484261,function(_0x296bfb,_0x497485){if(_0x296bfb){_0x5463c3(_0x296bfb);}if(_0x118c49[_0x37b8('0x15')]===_0x497485){_0x5463c3(null,!![]);}else{_0x5463c3(null,![]);}});},'makeSalt':function(_0x24f807,_0x5b9f58){var _0x5186db=0x10;if(typeof arguments[0x0]===_0x37b8('0x3d')){_0x5b9f58=arguments[0x0];_0x24f807=_0x5186db;}else if(typeof arguments[0x1]===_0x37b8('0x3d')){_0x5b9f58=arguments[0x1];}else{throw new Error(_0x37b8('0x3e'));}if(!_0x24f807){_0x24f807=_0x5186db;}return crypto['randomBytes'](_0x24f807,function(_0x694340,_0x4da95b){if(_0x694340){_0x5b9f58(_0x694340);}return _0x5b9f58(null,_0x4da95b['toString']('base64'));});},'encryptPassword':function(_0x4b4239,_0x301054){if(!_0x4b4239||!this['salt']){return _0x301054?_0x301054(null):null;}var _0x1d3148=0x2710;var _0x4ee18d=0x40;var _0x16edec=Buffer[_0x37b8('0x3f')](this['salt'],_0x37b8('0x40'));if(!_0x301054){return crypto[_0x37b8('0x41')](_0x4b4239,_0x16edec,_0x1d3148,_0x4ee18d,_0x37b8('0x42'))['toString'](_0x37b8('0x40'));}return crypto[_0x37b8('0x43')](_0x4b4239,_0x16edec,_0x1d3148,_0x4ee18d,'sha1',function(_0x5ed898,_0x4cd993){if(_0x5ed898){_0x301054(_0x5ed898);}return _0x301054(null,_0x4cd993[_0x37b8('0x44')](_0x37b8('0x40')));});},'updatePassword':function(_0x162921){if(!this[_0x37b8('0x15')]){return _0x162921(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x37b8('0x45')](this[_0x37b8('0x46')])===-0x1){_0x162921(new Error('Invalid\x20password'));}var _0x324146=this;this[_0x37b8('0x47')](function(_0x568ddc,_0x5e4d3e){if(_0x568ddc){return _0x162921(_0x568ddc);}_0x324146[_0x37b8('0x48')]=_0x5e4d3e;_0x324146[_0x37b8('0x3c')](_0x324146['password'],function(_0x2ebc3b,_0x130219){if(_0x2ebc3b){_0x162921(_0x2ebc3b);}_0x324146['password']=_0x130219;_0x162921(null);});});},'updateMd5Password':function(){this[_0x37b8('0x49')]=md5(this['name']+_0x37b8('0x4a')+this[_0x37b8('0x15')]);return this[_0x37b8('0x49')];},'getRealtimeData':function(){var _0x54c559={'id':this['id']};var _0x1b6e6a=jayson[_0x37b8('0x4b')][_0x37b8('0x4c')]({'port':0x232a});var _0x570b26=jayson[_0x37b8('0x4b')][_0x37b8('0x4c')]({'port':0x232c});var _0x2dfc9b={};var _0x59ca90={};return _0x1b6e6a['request'](_0x37b8('0x4d'),_0x54c559)[_0x37b8('0x27')](function(_0x262cb0){if(_0x262cb0[_0x37b8('0x37')]){throw new Error(_0x37b8('0x4e'));}_0x2dfc9b=_0x262cb0[_0x37b8('0x4f')];return _0x570b26[_0x37b8('0x50')](_0x37b8('0x4d'),_0x54c559);})[_0x37b8('0x27')](function(_0x1b66fa){if(_0x1b66fa[_0x37b8('0x37')]){throw new Error(_0x37b8('0x51'));}_0x59ca90=_0x1b66fa['result'];var _0x414a0e=_[_0x37b8('0xc')]({},_0x2dfc9b,_0x59ca90);return _0x414a0e;})[_0x37b8('0x35')](function(_0x41e6a1){throw _0x41e6a1;});},'unpause':function(_0xfe3803,_0x592a43=_0x37b8('0x52')){var _0x55fa91=this;var _0x396b67={};return Promise[_0x37b8('0x2f')]()['then'](function(){if(!_0xfe3803||_0xfe3803===_0x37b8('0x53')&&_0x592a43==='manual'){var _0x413e3c=jayson[_0x37b8('0x4b')]['http']({'port':0x232a});return _0x413e3c['request'](_0x37b8('0x54'),{'id':_0x55fa91['id'],'name':_0x55fa91[_0x37b8('0x18')],'pause':![]})[_0x37b8('0x27')](function(_0x51c2ce){if(_0x51c2ce[_0x37b8('0x37')]){throw new Error(util[_0x37b8('0x11')](_0x37b8('0x55'),_0x55fa91['id'],_0x55fa91[_0x37b8('0x18')]));}return _0x51c2ce[_0x37b8('0x4f')][_0x37b8('0x56')];});}})[_0x37b8('0x27')](function(){if(!_0xfe3803||_0xfe3803===_0x37b8('0x53')){return _0x5c434b[_0x37b8('0x57')]['update']({'paused':0x0},{'where':{'UserId':_0x55fa91['id']},'individualHooks':!![]});}})['then'](function(){var _0x4928fc=!_0xfe3803?_0x37b8('0x26'):_0x37b8('0x58');var _0x491ef4={'membername':_0x55fa91[_0x37b8('0x18')],'type':_0x37b8('0x59'),'exitAt':null};if(_0xfe3803){_0x491ef4[_0x37b8('0x5a')]=_0xfe3803;}return _0x5c434b['MemberReport'][_0x4928fc]({'where':_0x491ef4});})[_0x37b8('0x27')](function(_0x4a9ee0){if(_0x4a9ee0){var _0x550234=Array['isArray'](_0x4a9ee0)?_0x4a9ee0:[_0x4a9ee0];var _0x416d2e=_0x550234[_0x37b8('0x5b')](function(_0x3741cf){return _0x3741cf[_0x37b8('0x5c')]({'exitAt':moment()[_0x37b8('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x592a43});});return Promise[_0x37b8('0x5d')](_0x416d2e);}})[_0x37b8('0x27')](function(){if(!_0xfe3803){_0x396b67['voicePause']=![];_0x396b67[_0x37b8('0x5e')]=![];_0x396b67[_0x37b8('0x5f')]=![];_0x396b67[_0x37b8('0x60')]=![];_0x396b67['smsPause']=![];_0x396b67[_0x37b8('0x61')]=![];_0x396b67[_0x37b8('0x62')]=![];}else{_0x396b67[_0xfe3803+_0x37b8('0x63')]=![];}return _0x55fa91['getRealtimeData']();})[_0x37b8('0x27')](function(_0x4e0075){var _0x245608=require(_0x37b8('0x64'));var _0x2be458=_0x245608[_0x37b8('0x65')]();_0x2be458['forEach'](function(_0x425d60){var _0x16f9ae=_0x425d60+_0x37b8('0x66');_0x55fa91[_0x37b8('0x67')]([_0x16f9ae],_0x4e0075[_0x16f9ae]);});return _0x55fa91['update'](_0x396b67);})[_0x37b8('0x35')](function(_0x4feefe){throw _0x4feefe;});}}});};
\ No newline at end of file
index 2db8c7e..fe23cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cff=['concat','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','defaults','redis','localhost','./user.socket','register','User','findAll','options','limit','include','map','model','attributes','then','info','GetUser','stringify','catch','error','message','find','raw','where','ShowUser','debug','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s','body','type','uniqueid','bulkCreate','update','DEFAULT\x20PAUSE','channel','findOne','online','voicePause','mailPause','chatPause','faxPause','whatsappPause','pauseType','lastPauseAt','system','destroy','all','mobile','loginInPause','agent','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE'];(function(_0x5dc5a8,_0x2af384){var _0x1ddbc7=function(_0x42705f){while(--_0x42705f){_0x5dc5a8['push'](_0x5dc5a8['shift']());}};_0x1ddbc7(++_0x2af384);}(_0x8cff,0xfa));var _0xf8cf=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8cff[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf8cf('0x0'));var util=require('util');var moment=require(_0xf8cf('0x1'));var BPromise=require(_0xf8cf('0x2'));var Redis=require(_0xf8cf('0x3'));var db=require(_0xf8cf('0x4'))['db'];var utils=require(_0xf8cf('0x5'));var logger=require('../../config/logger')(_0xf8cf('0x6'));var config=require(_0xf8cf('0x7'));config['redis']=_[_0xf8cf('0x8')](config[_0xf8cf('0x9')],{'host':_0xf8cf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8cf('0x9')]));require(_0xf8cf('0xb'))[_0xf8cf('0xc')](socket);exports['GetUser']=function(_0x1e4994){var _0x9fc13=this;return new Promise(function(_0x230a6f,_0x39487c){return db[_0xf8cf('0xd')][_0xf8cf('0xe')]({'raw':_0x1e4994[_0xf8cf('0xf')]?_0x1e4994[_0xf8cf('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x1e4994[_0xf8cf('0xf')]?_0x1e4994[_0xf8cf('0xf')]['where']||null:null,'attributes':_0x1e4994[_0xf8cf('0xf')]?_0x1e4994[_0xf8cf('0xf')]['attributes']||null:null,'limit':_0x1e4994[_0xf8cf('0xf')]?_0x1e4994['options'][_0xf8cf('0x10')]||null:null,'include':_0x1e4994[_0xf8cf('0xf')]?_0x1e4994['options'][_0xf8cf('0x11')]?_[_0xf8cf('0x12')](_0x1e4994['options'][_0xf8cf('0x11')],function(_0x29976c){return{'model':db[_0x29976c[_0xf8cf('0x13')]],'as':_0x29976c['as'],'attributes':_0x29976c[_0xf8cf('0x14')],'include':_0x29976c['include']?_[_0xf8cf('0x12')](_0x29976c[_0xf8cf('0x11')],function(_0x2e52a4){return{'model':db[_0x2e52a4['model']],'as':_0x2e52a4['as'],'attributes':_0x2e52a4[_0xf8cf('0x14')],'include':_0x2e52a4[_0xf8cf('0x11')]?_[_0xf8cf('0x12')](_0x2e52a4[_0xf8cf('0x11')],function(_0x3dfbca){return{'model':db[_0x3dfbca['model']],'as':_0x3dfbca['as'],'attributes':_0x3dfbca[_0xf8cf('0x14')]};}):[]};}):[]};}):[]:[]})[_0xf8cf('0x15')](function(_0x24a8b4){logger[_0xf8cf('0x16')](_0xf8cf('0x17'),_0x1e4994);logger['debug'](_0xf8cf('0x17'),_0x1e4994,JSON[_0xf8cf('0x18')](_0x24a8b4));_0x230a6f(_0x24a8b4);})[_0xf8cf('0x19')](function(_0x50d294){logger[_0xf8cf('0x1a')](_0xf8cf('0x17'),_0x50d294[_0xf8cf('0x1b')],_0x1e4994);_0x39487c(_0x9fc13[_0xf8cf('0x1a')](0x1f4,_0x50d294['message']));});});};exports['ShowUser']=function(_0x53bc7e){var _0x5f3b0b=this;return new Promise(function(_0x3fb746,_0x2929c2){return db[_0xf8cf('0xd')][_0xf8cf('0x1c')]({'raw':_0x53bc7e[_0xf8cf('0xf')]?_0x53bc7e[_0xf8cf('0xf')][_0xf8cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x53bc7e[_0xf8cf('0xf')]?_0x53bc7e['options'][_0xf8cf('0x1e')]||null:null,'attributes':_0x53bc7e[_0xf8cf('0xf')]?_0x53bc7e[_0xf8cf('0xf')][_0xf8cf('0x14')]||null:null,'include':_0x53bc7e['options']?_0x53bc7e[_0xf8cf('0xf')][_0xf8cf('0x11')]?_[_0xf8cf('0x12')](_0x53bc7e[_0xf8cf('0xf')][_0xf8cf('0x11')],function(_0x5949b2){return{'model':db[_0x5949b2[_0xf8cf('0x13')]],'as':_0x5949b2['as'],'attributes':_0x5949b2['attributes'],'include':_0x5949b2[_0xf8cf('0x11')]?_['map'](_0x5949b2[_0xf8cf('0x11')],function(_0x4f2512){return{'model':db[_0x4f2512['model']],'as':_0x4f2512['as'],'attributes':_0x4f2512[_0xf8cf('0x14')],'include':_0x4f2512[_0xf8cf('0x11')]?_['map'](_0x4f2512[_0xf8cf('0x11')],function(_0x557c75){return{'model':db[_0x557c75['model']],'as':_0x557c75['as'],'attributes':_0x557c75[_0xf8cf('0x14')]};}):[]};}):[]};}):[]:[]})[_0xf8cf('0x15')](function(_0x4d3c9c){logger['info'](_0xf8cf('0x1f'),_0x53bc7e);logger[_0xf8cf('0x20')]('ShowUser',_0x53bc7e,JSON['stringify'](_0x4d3c9c));_0x3fb746(_0x4d3c9c);})[_0xf8cf('0x19')](function(_0x47e9c2){logger['error'](_0xf8cf('0x1f'),_0x47e9c2[_0xf8cf('0x1b')],_0x53bc7e);_0x2929c2(_0x5f3b0b[_0xf8cf('0x1a')](0x1f4,_0x47e9c2[_0xf8cf('0x1b')]));});});};exports[_0xf8cf('0x21')]=function(_0x4ace70){var _0x4819d0;return db[_0xf8cf('0xd')]['find']({'where':_0x4ace70['options'][_0xf8cf('0x1e')]||{},'attributes':['id',_0xf8cf('0x22'),_0xf8cf('0x23'),_0xf8cf('0x24'),_0xf8cf('0x25')]})[_0xf8cf('0x15')](function(_0x2e2e75){if(!_0x2e2e75){throw new Error(util[_0xf8cf('0x26')](_0xf8cf('0x27'),_0x4ace70[_0xf8cf('0x28')]['id']));}_0x4819d0=_0x2e2e75;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x4819d0['id']},'individualHooks':!![]});})['then'](function(){return db[_0xf8cf('0x29')][_0xf8cf('0xe')]({'where':{'membername':_0x4819d0[_0xf8cf('0x22')],'type':_0xf8cf('0x2a'),'exitAt':null}});})[_0xf8cf('0x15')](function(_0x33b18e){if(_0x33b18e&&_0x33b18e[_0xf8cf('0x2b')]){var _0x3bf1fa=moment()[_0xf8cf('0x26')](_0xf8cf('0x2c'));for(var _0x4fb61a=0x0,_0x452799=_0x33b18e[_0xf8cf('0x2b')];_0x4fb61a<_0x452799;_0x4fb61a++){_0x33b18e[_0x4fb61a][_0xf8cf('0x2d')]({'exitAt':_0x3bf1fa});}}})[_0xf8cf('0x15')](function(){var _0x352cdc=[];var _0x4138aa=utils[_0xf8cf('0x2e')]();_0x4138aa[_0xf8cf('0x2f')](function(_0x19868f){_0x352cdc[_0xf8cf('0x30')]({'channel':_0x19868f,'membername':_0x4819d0[_0xf8cf('0x22')],'interface':_['isNil'](_0x4819d0[_0xf8cf('0x25')])?util['format'](_0xf8cf('0x31'),_0x4819d0[_0xf8cf('0x22')]):_0x4819d0[_0xf8cf('0x25')],'type':'PAUSE','enterAt':moment()[_0xf8cf('0x26')](_0xf8cf('0x2c')),'data1':_0x4ace70[_0xf8cf('0x32')][_0xf8cf('0x33')]||'DEFAULT\x20PAUSE','role':_0x4819d0[_0xf8cf('0x23')],'internal':_0x4819d0[_0xf8cf('0x24')],'uniqueid':_0x4ace70['body'][_0xf8cf('0x34')]||null});});return db[_0xf8cf('0x29')][_0xf8cf('0x35')](_0x352cdc,{'individualHooks':!![]});})[_0xf8cf('0x15')](function(){return _0x4819d0[_0xf8cf('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4ace70[_0xf8cf('0x32')][_0xf8cf('0x33')]||_0xf8cf('0x37'),'lastPauseAt':moment()[_0xf8cf('0x26')](_0xf8cf('0x2c'))});})['catch'](function(_0x1e41c9){throw _0x1e41c9;});};exports['UnpauseUser']=function(_0x102dfb){return Promise['resolve']()[_0xf8cf('0x15')](function(){if(_0x102dfb[_0xf8cf('0x32')][_0xf8cf('0x38')]&&!utils['isValidChannel'](_0x102dfb[_0xf8cf('0x32')][_0xf8cf('0x38')])){throw new Error(util[_0xf8cf('0x26')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x102dfb['body']['channel']));}return db[_0xf8cf('0xd')][_0xf8cf('0x39')]({'where':_0x102dfb[_0xf8cf('0xf')][_0xf8cf('0x1e')]||{},'attributes':['id',_0xf8cf('0x22'),_0xf8cf('0x23'),_0xf8cf('0x24'),_0xf8cf('0x25'),_0xf8cf('0x3a'),_0xf8cf('0x3b'),_0xf8cf('0x3c'),_0xf8cf('0x3d'),_0xf8cf('0x3e'),'openchannelPause','smsPause',_0xf8cf('0x3f'),_0xf8cf('0x40'),_0xf8cf('0x41')]});})[_0xf8cf('0x15')](function(_0x2bfd20){if(!_0x2bfd20){throw new Error(util[_0xf8cf('0x26')](_0xf8cf('0x27'),_0x102dfb[_0xf8cf('0x28')]['id']));}return _0x2bfd20['unpause'](_0x102dfb['body']['channel'],_0xf8cf('0x42'));})[_0xf8cf('0x19')](function(_0x1a6ef3){throw _0x1a6ef3;});};exports['LogoutUser']=function(_0x8238e6){var _0x19c45a=this;return new Promise(function(_0x33cd3f,_0xa6374a){var _0x1609f8;return db[_0xf8cf('0xd')][_0xf8cf('0x39')]({'where':_0x8238e6['options'][_0xf8cf('0x1e')]||{},'attributes':['id',_0xf8cf('0x22')]})[_0xf8cf('0x15')](function(_0x16bdaf){if(_0x16bdaf){_0x1609f8=_0x16bdaf;return db['UserVoiceQueueRt'][_0xf8cf('0x43')]({'where':{'membername':_0x1609f8[_0xf8cf('0x22')]},'individualHooks':!![]});}})[_0xf8cf('0x15')](function(){if(_0x1609f8){return db[_0xf8cf('0x29')][_0xf8cf('0xe')]({'where':{'membername':_0x1609f8[_0xf8cf('0x22')],'exitAt':null}});}})[_0xf8cf('0x15')](function(_0xe4833c){if(_0x1609f8){if(_0xe4833c&&_0xe4833c[_0xf8cf('0x2b')]){var _0x21bd91=[];_0xe4833c['forEach'](function(_0x1fec95){_0x21bd91[_0xf8cf('0x30')](_0x1fec95[_0xf8cf('0x36')]({'exitAt':moment()['format'](_0xf8cf('0x2c'))}));});return BPromise[_0xf8cf('0x44')](_0x21bd91);}}})[_0xf8cf('0x15')](function(){if(_0x1609f8){return _0x1609f8[_0xf8cf('0x36')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf8cf('0x15')](function(_0x186098){_0x33cd3f(_0x186098);})['catch'](function(_0x39caf4){_0xa6374a(_0x19c45a['error'](0x1f4,_0x39caf4[_0xf8cf('0x1b')]));});});};exports['LoginUser']=function(_0x1fdcde){var _0x14a61f=this;return new Promise(function(_0x289a61,_0x155d7e){var _0x589926;var _0x4e2316;var _0x3e3b09;var _0x6b68f0;return db[_0xf8cf('0xd')]['findOne']({'where':_0x1fdcde['options'][_0xf8cf('0x1e')]||{},'attributes':['id',_0xf8cf('0x22'),_0xf8cf('0x23'),_0xf8cf('0x45'),'phone',_0xf8cf('0x24'),_0xf8cf('0x46'),_0xf8cf('0x25')]})['then'](function(_0x421e6d){if(_0x421e6d){_0x589926=_0x421e6d;_0x6b68f0=_0x1fdcde[_0xf8cf('0x32')][_0xf8cf('0x25')]?_0x1fdcde[_0xf8cf('0x32')][_0xf8cf('0x25')]:util['format'](_0xf8cf('0x31'),_0x589926[_0xf8cf('0x22')]);return db[_0xf8cf('0xd')]['count']({'where':{'role':_0xf8cf('0x47'),'online':!![],'id':{'$ne':_0x589926['id']}}});}})[_0xf8cf('0x15')](function(_0x530cde){if(_0x530cde){_0x3e3b09=_0x530cde;return require(_0xf8cf('0x48'))[_0xf8cf('0x49')]();}})[_0xf8cf('0x15')](function(_0x210169){if(_0x210169&&_0x210169['agents']&&_0x3e3b09>=_0x210169['agents']){throw new Error(_0xf8cf('0x4a'));}})['then'](function(){if(_0x589926){return db['UserVoiceQueueRt'][_0xf8cf('0x43')]({'where':{'membername':_0x589926[_0xf8cf('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x589926){return _0x589926[_0xf8cf('0x4b')]({'raw':!![]});}})['then'](function(_0x2b4fe1){if(_0x589926){if(_0x2b4fe1){var _0x100a3a=[];_0x4e2316=_0x2b4fe1;if(_0x4e2316['length']){for(var _0x5a90c9=0x0;_0x5a90c9<_0x4e2316[_0xf8cf('0x2b')];_0x5a90c9++){_0x100a3a['push'](db['UserVoiceQueueRt'][_0xf8cf('0x4c')]({'membername':_0x589926[_0xf8cf('0x22')],'UserId':_0x589926['id'],'queue_name':_0x4e2316[_0x5a90c9][_0xf8cf('0x22')],'VoiceQueueId':_0x4e2316[_0x5a90c9]['id'],'interface':_0x6b68f0,'paused':_0x589926[_0xf8cf('0x46')]||![],'penalty':_0x4e2316[_0x5a90c9][_0xf8cf('0x4d')]||0x0}));}return BPromise['all'](_0x100a3a);}}}})[_0xf8cf('0x15')](function(){if(_0x589926){return db[_0xf8cf('0x29')][_0xf8cf('0xe')]({'where':{'membername':_0x589926[_0xf8cf('0x22')],'exitAt':null}});}})[_0xf8cf('0x15')](function(_0x2255ec){if(_0x589926){if(_0x2255ec&&_0x2255ec[_0xf8cf('0x2b')]){var _0x2d1d5c=[];_0x2255ec[_0xf8cf('0x2f')](function(_0x158e98){_0x2d1d5c[_0xf8cf('0x30')](_0x158e98['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf8cf('0x44')](_0x2d1d5c);}}})['then'](function(){if(_0x589926){var _0x311666=[];var _0x741ab4=[];var _0x221f32=utils['getChannels']();var _0x49b766={'membername':_0x589926[_0xf8cf('0x22')],'interface':_0x6b68f0,'enterAt':moment()[_0xf8cf('0x26')](_0xf8cf('0x2c')),'role':_0x589926[_0xf8cf('0x23')],'internal':_0x589926[_0xf8cf('0x24')]};_0x221f32[_0xf8cf('0x2f')](function(_0xbf6cc6){_0x311666['push'](_[_0xf8cf('0x4e')]({'channel':_0xbf6cc6,'type':_0xf8cf('0x4f'),'data1':_0xf8cf('0x50'),'data2':_0x6b68f0},_0x49b766));if(_0x589926[_0xf8cf('0x46')]){_0x741ab4[_0xf8cf('0x30')](_[_0xf8cf('0x4e')]({'channel':_0xbf6cc6,'type':_0xf8cf('0x2a'),'data1':_0xf8cf('0x51')},_0x49b766));}});return db[_0xf8cf('0x29')][_0xf8cf('0x35')](_0x311666[_0xf8cf('0x52')](_0x741ab4),{'individualHooks':!![]});}})['then'](function(){if(_0x589926){return _0x589926[_0xf8cf('0x36')]({'online':!![],'lastLoginAt':moment()[_0xf8cf('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x589926['loginInPause']||![],'mailPause':_0x589926[_0xf8cf('0x46')]||![],'chatPause':_0x589926[_0xf8cf('0x46')]||![],'faxPause':_0x589926['loginInPause']||![],'smsPause':_0x589926[_0xf8cf('0x46')]||![],'openchannelPause':_0x589926['loginInPause']||![],'pauseType':_0x589926[_0xf8cf('0x46')]?_0xf8cf('0x51'):null,'lastPauseAt':moment()[_0xf8cf('0x26')](_0xf8cf('0x2c')),'interface':_0x6b68f0});}})[_0xf8cf('0x15')](function(_0x3e030a){_0x289a61(_0x3e030a);})['catch'](function(_0xefb67f){_0x155d7e(_0x14a61f[_0xf8cf('0x1a')](0x1f4,_0xefb67f[_0xf8cf('0x1b')]));});});};
\ No newline at end of file
+var _0xdf35=['message','User','find','ShowUser','stringify','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','length','updateAttributes','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','type','DEFAULT\x20PAUSE','body','uniqueid','resolve','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','params','unpause','system','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','callysquare','LOGININPAUSE','bulkCreate','concat','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','./user.socket','GetUser','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','catch','error'];(function(_0x20e5b6,_0x267cba){var _0x587159=function(_0x4b1198){while(--_0x4b1198){_0x20e5b6['push'](_0x20e5b6['shift']());}};_0x587159(++_0x267cba);}(_0xdf35,0xf7));var _0x5df3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdf35[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x5df3('0x0'));var moment=require(_0x5df3('0x1'));var BPromise=require('bluebird');var Redis=require('ioredis');var db=require(_0x5df3('0x2'))['db'];var utils=require(_0x5df3('0x3'));var logger=require(_0x5df3('0x4'))(_0x5df3('0x5'));var config=require(_0x5df3('0x6'));config['redis']=_[_0x5df3('0x7')](config[_0x5df3('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5df3('0x9'))(new Redis(config[_0x5df3('0x8')]));require(_0x5df3('0xa'))['register'](socket);exports[_0x5df3('0xb')]=function(_0x472d71){var _0x2c8f46=this;return new Promise(function(_0x13ada9,_0x3b4ebc){return db['User'][_0x5df3('0xc')]({'raw':_0x472d71[_0x5df3('0xd')]?_0x472d71[_0x5df3('0xd')][_0x5df3('0xe')]===undefined?!![]:![]:!![],'where':_0x472d71['options']?_0x472d71['options'][_0x5df3('0xf')]||null:null,'attributes':_0x472d71[_0x5df3('0xd')]?_0x472d71[_0x5df3('0xd')]['attributes']||null:null,'limit':_0x472d71['options']?_0x472d71[_0x5df3('0xd')][_0x5df3('0x10')]||null:null,'include':_0x472d71[_0x5df3('0xd')]?_0x472d71[_0x5df3('0xd')][_0x5df3('0x11')]?_[_0x5df3('0x12')](_0x472d71[_0x5df3('0xd')][_0x5df3('0x11')],function(_0x542982){return{'model':db[_0x542982[_0x5df3('0x13')]],'as':_0x542982['as'],'attributes':_0x542982[_0x5df3('0x14')],'include':_0x542982[_0x5df3('0x11')]?_[_0x5df3('0x12')](_0x542982['include'],function(_0x11ed1a){return{'model':db[_0x11ed1a[_0x5df3('0x13')]],'as':_0x11ed1a['as'],'attributes':_0x11ed1a['attributes'],'include':_0x11ed1a[_0x5df3('0x11')]?_[_0x5df3('0x12')](_0x11ed1a[_0x5df3('0x11')],function(_0x1286ab){return{'model':db[_0x1286ab[_0x5df3('0x13')]],'as':_0x1286ab['as'],'attributes':_0x1286ab[_0x5df3('0x14')]};}):[]};}):[]};}):[]:[]})[_0x5df3('0x15')](function(_0x4a3238){logger[_0x5df3('0x16')](_0x5df3('0xb'),_0x472d71);logger[_0x5df3('0x17')](_0x5df3('0xb'),_0x472d71,JSON['stringify'](_0x4a3238));_0x13ada9(_0x4a3238);})[_0x5df3('0x18')](function(_0x2af07b){logger[_0x5df3('0x19')](_0x5df3('0xb'),_0x2af07b[_0x5df3('0x1a')],_0x472d71);_0x3b4ebc(_0x2c8f46[_0x5df3('0x19')](0x1f4,_0x2af07b[_0x5df3('0x1a')]));});});};exports['ShowUser']=function(_0x282942){var _0x3d2149=this;return new Promise(function(_0x1a7376,_0x53605f){return db[_0x5df3('0x1b')][_0x5df3('0x1c')]({'raw':_0x282942[_0x5df3('0xd')]?_0x282942['options']['raw']===undefined?!![]:![]:!![],'where':_0x282942[_0x5df3('0xd')]?_0x282942['options'][_0x5df3('0xf')]||null:null,'attributes':_0x282942[_0x5df3('0xd')]?_0x282942[_0x5df3('0xd')]['attributes']||null:null,'include':_0x282942[_0x5df3('0xd')]?_0x282942[_0x5df3('0xd')][_0x5df3('0x11')]?_[_0x5df3('0x12')](_0x282942[_0x5df3('0xd')][_0x5df3('0x11')],function(_0x3a54c3){return{'model':db[_0x3a54c3[_0x5df3('0x13')]],'as':_0x3a54c3['as'],'attributes':_0x3a54c3[_0x5df3('0x14')],'include':_0x3a54c3[_0x5df3('0x11')]?_[_0x5df3('0x12')](_0x3a54c3[_0x5df3('0x11')],function(_0x1f63d0){return{'model':db[_0x1f63d0[_0x5df3('0x13')]],'as':_0x1f63d0['as'],'attributes':_0x1f63d0[_0x5df3('0x14')],'include':_0x1f63d0['include']?_[_0x5df3('0x12')](_0x1f63d0[_0x5df3('0x11')],function(_0x52e00c){return{'model':db[_0x52e00c[_0x5df3('0x13')]],'as':_0x52e00c['as'],'attributes':_0x52e00c[_0x5df3('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3061e7){logger[_0x5df3('0x16')](_0x5df3('0x1d'),_0x282942);logger['debug'](_0x5df3('0x1d'),_0x282942,JSON[_0x5df3('0x1e')](_0x3061e7));_0x1a7376(_0x3061e7);})[_0x5df3('0x18')](function(_0x3e73a2){logger[_0x5df3('0x19')](_0x5df3('0x1d'),_0x3e73a2['message'],_0x282942);_0x53605f(_0x3d2149[_0x5df3('0x19')](0x1f4,_0x3e73a2[_0x5df3('0x1a')]));});});};exports[_0x5df3('0x1f')]=function(_0x3cc0a3){var _0x1f6122;return db[_0x5df3('0x1b')][_0x5df3('0x1c')]({'where':_0x3cc0a3[_0x5df3('0xd')][_0x5df3('0xf')]||{},'attributes':['id',_0x5df3('0x20'),_0x5df3('0x21'),_0x5df3('0x22'),_0x5df3('0x23')]})['then'](function(_0x43f5e5){if(!_0x43f5e5){throw new Error(util[_0x5df3('0x24')](_0x5df3('0x25'),_0x3cc0a3['params']['id']));}_0x1f6122=_0x43f5e5;return db[_0x5df3('0x26')][_0x5df3('0x27')]({'paused':0x1},{'where':{'UserId':_0x1f6122['id']},'individualHooks':!![]});})['then'](function(){return db[_0x5df3('0x28')][_0x5df3('0xc')]({'where':{'membername':_0x1f6122[_0x5df3('0x20')],'type':'PAUSE','exitAt':null}});})[_0x5df3('0x15')](function(_0x47e348){if(_0x47e348&&_0x47e348['length']){var _0x4e42d5=moment()[_0x5df3('0x24')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x787252=0x0,_0x51b67b=_0x47e348[_0x5df3('0x29')];_0x787252<_0x51b67b;_0x787252++){_0x47e348[_0x787252][_0x5df3('0x2a')]({'exitAt':_0x4e42d5});}}})[_0x5df3('0x15')](function(){var _0x2ed11a=[];var _0x19c429=utils['getChannels']();_0x19c429[_0x5df3('0x2b')](function(_0xb981a4){_0x2ed11a[_0x5df3('0x2c')]({'channel':_0xb981a4,'membername':_0x1f6122[_0x5df3('0x20')],'interface':_[_0x5df3('0x2d')](_0x1f6122[_0x5df3('0x23')])?util[_0x5df3('0x24')](_0x5df3('0x2e'),_0x1f6122['name']):_0x1f6122[_0x5df3('0x23')],'type':_0x5df3('0x2f'),'enterAt':moment()[_0x5df3('0x24')](_0x5df3('0x30')),'data1':_0x3cc0a3['body'][_0x5df3('0x31')]||_0x5df3('0x32'),'role':_0x1f6122[_0x5df3('0x21')],'internal':_0x1f6122[_0x5df3('0x22')],'uniqueid':_0x3cc0a3[_0x5df3('0x33')][_0x5df3('0x34')]||null});});return db['MemberReport']['bulkCreate'](_0x2ed11a,{'individualHooks':!![]});})[_0x5df3('0x15')](function(){return _0x1f6122[_0x5df3('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3cc0a3[_0x5df3('0x33')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x5df3('0x30'))});})[_0x5df3('0x18')](function(_0x1a84a3){throw _0x1a84a3;});};exports['UnpauseUser']=function(_0x15a776){return Promise[_0x5df3('0x35')]()[_0x5df3('0x15')](function(){if(_0x15a776[_0x5df3('0x33')]['channel']&&!utils[_0x5df3('0x36')](_0x15a776[_0x5df3('0x33')][_0x5df3('0x37')])){throw new Error(util[_0x5df3('0x24')](_0x5df3('0x38'),_0x15a776[_0x5df3('0x33')][_0x5df3('0x37')]));}return db['User'][_0x5df3('0x39')]({'where':_0x15a776[_0x5df3('0xd')][_0x5df3('0xf')]||{},'attributes':['id','name',_0x5df3('0x21'),_0x5df3('0x22'),_0x5df3('0x23'),_0x5df3('0x3a'),_0x5df3('0x3b'),_0x5df3('0x3c'),_0x5df3('0x3d'),_0x5df3('0x3e'),_0x5df3('0x3f'),_0x5df3('0x40'),_0x5df3('0x41'),_0x5df3('0x42'),'lastPauseAt']});})[_0x5df3('0x15')](function(_0x355150){if(!_0x355150){throw new Error(util['format'](_0x5df3('0x25'),_0x15a776[_0x5df3('0x43')]['id']));}return _0x355150[_0x5df3('0x44')](_0x15a776['body'][_0x5df3('0x37')],_0x5df3('0x45'));})[_0x5df3('0x18')](function(_0x4f72ee){throw _0x4f72ee;});};exports[_0x5df3('0x46')]=function(_0x4c4e2f){var _0x2672a4=this;return new Promise(function(_0x4cb64e,_0x56acab){var _0x16da6c;return db[_0x5df3('0x1b')][_0x5df3('0x39')]({'where':_0x4c4e2f['options'][_0x5df3('0xf')]||{},'attributes':['id','name']})[_0x5df3('0x15')](function(_0x3e137e){if(_0x3e137e){_0x16da6c=_0x3e137e;return db['UserVoiceQueueRt'][_0x5df3('0x47')]({'where':{'membername':_0x16da6c[_0x5df3('0x20')]},'individualHooks':!![]});}})['then'](function(){if(_0x16da6c){return db[_0x5df3('0x28')][_0x5df3('0xc')]({'where':{'membername':_0x16da6c[_0x5df3('0x20')],'exitAt':null}});}})[_0x5df3('0x15')](function(_0x585e03){if(_0x16da6c){if(_0x585e03&&_0x585e03[_0x5df3('0x29')]){var _0x32d7ce=[];_0x585e03[_0x5df3('0x2b')](function(_0x3e3641){_0x32d7ce[_0x5df3('0x2c')](_0x3e3641[_0x5df3('0x27')]({'exitAt':moment()[_0x5df3('0x24')](_0x5df3('0x30'))}));});return BPromise[_0x5df3('0x48')](_0x32d7ce);}}})[_0x5df3('0x15')](function(){if(_0x16da6c){return _0x16da6c[_0x5df3('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x5df3('0x15')](function(_0x442e0f){_0x4cb64e(_0x442e0f);})[_0x5df3('0x18')](function(_0x17cde4){_0x56acab(_0x2672a4[_0x5df3('0x19')](0x1f4,_0x17cde4['message']));});});};exports[_0x5df3('0x49')]=function(_0x2ab964){var _0x466e9d=this;return new Promise(function(_0xf3697c,_0x4cf87e){var _0x277989;var _0x3228ee;var _0x40618e;var _0x432269;return db[_0x5df3('0x1b')][_0x5df3('0x39')]({'where':_0x2ab964[_0x5df3('0xd')][_0x5df3('0xf')]||{},'attributes':['id',_0x5df3('0x20'),_0x5df3('0x21'),_0x5df3('0x4a'),_0x5df3('0x4b'),_0x5df3('0x22'),_0x5df3('0x4c'),_0x5df3('0x23')]})[_0x5df3('0x15')](function(_0x26fb1f){if(_0x26fb1f){_0x277989=_0x26fb1f;_0x432269=_0x2ab964[_0x5df3('0x33')][_0x5df3('0x23')]?_0x2ab964[_0x5df3('0x33')][_0x5df3('0x23')]:util[_0x5df3('0x24')](_0x5df3('0x2e'),_0x277989[_0x5df3('0x20')]);return db[_0x5df3('0x1b')][_0x5df3('0x4d')]({'where':{'role':_0x5df3('0x4e'),'online':!![],'id':{'$ne':_0x277989['id']}}});}})[_0x5df3('0x15')](function(_0x3aa4d2){if(_0x3aa4d2){_0x40618e=_0x3aa4d2;return require(_0x5df3('0x4f'))['getLicense']();}})['then'](function(_0x3b25a8){if(_0x3b25a8&&_0x3b25a8[_0x5df3('0x50')]&&_0x40618e>=_0x3b25a8[_0x5df3('0x50')]){throw new Error(_0x5df3('0x51'));}})[_0x5df3('0x15')](function(){if(_0x277989){return db[_0x5df3('0x26')][_0x5df3('0x47')]({'where':{'membername':_0x277989[_0x5df3('0x20')]},'individualHooks':!![]});}})[_0x5df3('0x15')](function(){if(_0x277989){return _0x277989[_0x5df3('0x52')]({'raw':!![]});}})[_0x5df3('0x15')](function(_0x465458){if(_0x277989){if(_0x465458){var _0x4e9e16=[];_0x3228ee=_0x465458;if(_0x3228ee[_0x5df3('0x29')]){for(var _0x7792b3=0x0;_0x7792b3<_0x3228ee['length'];_0x7792b3++){_0x4e9e16[_0x5df3('0x2c')](db[_0x5df3('0x26')][_0x5df3('0x53')]({'membername':_0x277989[_0x5df3('0x20')],'UserId':_0x277989['id'],'queue_name':_0x3228ee[_0x7792b3][_0x5df3('0x20')],'VoiceQueueId':_0x3228ee[_0x7792b3]['id'],'interface':_0x432269,'paused':_0x277989[_0x5df3('0x4c')]||![],'penalty':_0x3228ee[_0x7792b3][_0x5df3('0x54')]||0x0}));}return BPromise[_0x5df3('0x48')](_0x4e9e16);}}}})[_0x5df3('0x15')](function(){if(_0x277989){return db['MemberReport'][_0x5df3('0xc')]({'where':{'membername':_0x277989['name'],'exitAt':null}});}})[_0x5df3('0x15')](function(_0x4843dd){if(_0x277989){if(_0x4843dd&&_0x4843dd[_0x5df3('0x29')]){var _0x3b01f7=[];_0x4843dd['forEach'](function(_0x10b8a4){_0x3b01f7[_0x5df3('0x2c')](_0x10b8a4['update']({'exitAt':moment()[_0x5df3('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x5df3('0x48')](_0x3b01f7);}}})[_0x5df3('0x15')](function(){if(_0x277989){var _0x1a3b27=[];var _0x2e54de=[];var _0x20df3a=utils[_0x5df3('0x55')]();var _0x398821={'membername':_0x277989[_0x5df3('0x20')],'interface':_0x432269,'enterAt':moment()[_0x5df3('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x277989['role'],'internal':_0x277989['internal']};_0x20df3a[_0x5df3('0x2b')](function(_0x428803){_0x1a3b27['push'](_[_0x5df3('0x56')]({'channel':_0x428803,'type':'LOGIN','data1':_0x5df3('0x57'),'data2':_0x432269},_0x398821));if(_0x277989[_0x5df3('0x4c')]){_0x2e54de[_0x5df3('0x2c')](_[_0x5df3('0x56')]({'channel':_0x428803,'type':_0x5df3('0x2f'),'data1':_0x5df3('0x58')},_0x398821));}});return db[_0x5df3('0x28')][_0x5df3('0x59')](_0x1a3b27[_0x5df3('0x5a')](_0x2e54de),{'individualHooks':!![]});}})['then'](function(){if(_0x277989){return _0x277989[_0x5df3('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0x5df3('0x30')),'voicePause':_0x277989['loginInPause']||![],'mailPause':_0x277989['loginInPause']||![],'chatPause':_0x277989['loginInPause']||![],'faxPause':_0x277989['loginInPause']||![],'smsPause':_0x277989['loginInPause']||![],'openchannelPause':_0x277989['loginInPause']||![],'pauseType':_0x277989[_0x5df3('0x4c')]?_0x5df3('0x58'):null,'lastPauseAt':moment()[_0x5df3('0x24')](_0x5df3('0x30')),'interface':_0x432269});}})[_0x5df3('0x15')](function(_0x219a81){_0xf3697c(_0x219a81);})[_0x5df3('0x18')](function(_0x3b3de7){_0x4cf87e(_0x466e9d[_0x5df3('0x19')](0x1f4,_0x3b3de7[_0x5df3('0x1a')]));});});};
\ No newline at end of file
index 07528d0..c4e977e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ee=['user:','./user.events','save','remove','emit','removeListener','register','length'];(function(_0x293ba9,_0x521de0){var _0x172cbc=function(_0x3084bb){while(--_0x3084bb){_0x293ba9['push'](_0x293ba9['shift']());}};_0x172cbc(++_0x521de0);}(_0x69ee,0x1b9));var _0xe69e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x69ee[_0x2d7f0e];return _0x110b07;};'use strict';var UserEvents=require(_0xe69e('0x0'));var events=[_0xe69e('0x1'),_0xe69e('0x2'),'update'];function createListener(_0x210de2,_0x5949df){return function(_0x4e385b){_0x5949df[_0xe69e('0x3')](_0x210de2,_0x4e385b);};}function removeListener(_0x4c37f7,_0x34a144){return function(){UserEvents[_0xe69e('0x4')](_0x4c37f7,_0x34a144);};}exports[_0xe69e('0x5')]=function(_0x559b67){for(var _0x29242e=0x0,_0x59c269=events[_0xe69e('0x6')];_0x29242e<_0x59c269;_0x29242e++){var _0x5abda8=events[_0x29242e];var _0x24a2a3=createListener(_0xe69e('0x7')+_0x5abda8,_0x559b67);UserEvents['on'](_0x5abda8,_0x24a2a3);}};
\ No newline at end of file
+var _0xab21=['emit','register','length','./user.events','save','remove'];(function(_0x4229eb,_0x112031){var _0x2f333a=function(_0x40f4f2){while(--_0x40f4f2){_0x4229eb['push'](_0x4229eb['shift']());}};_0x2f333a(++_0x112031);}(_0xab21,0x105));var _0x1ab2=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xab21[_0x1992f1];return _0x413dfe;};'use strict';var UserEvents=require(_0x1ab2('0x0'));var events=[_0x1ab2('0x1'),_0x1ab2('0x2'),'update'];function createListener(_0x3b4f5a,_0x281c49){return function(_0x14b51a){_0x281c49[_0x1ab2('0x3')](_0x3b4f5a,_0x14b51a);};}function removeListener(_0x531b4b,_0x5047d6){return function(){UserEvents['removeListener'](_0x531b4b,_0x5047d6);};}exports[_0x1ab2('0x4')]=function(_0x1cc604){for(var _0x293e15=0x0,_0x11415f=events[_0x1ab2('0x5')];_0x293e15<_0x11415f;_0x293e15++){var _0x41c7b7=events[_0x293e15];var _0x343bc1=createListener('user:'+_0x41c7b7,_0x1cc604);UserEvents['on'](_0x41c7b7,_0x343bc1);}};
\ No newline at end of file
index 3071fad..9819335 100644 (file)
@@ -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(_0x586d2e,_0xda2707){var _0x262d55=function(_0x22777f){while(--_0x22777f){_0x586d2e['push'](_0x586d2e['shift']());}};_0x262d55(++_0xda2707);}(_0xe706,0xa3));var _0x6e70=function(_0x33539a,_0xab9aa5){_0x33539a=_0x33539a-0x0;var _0x1a99a7=_0xe706[_0x33539a];return _0x1a99a7;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3a0a26,_0x4c61fb){var _0x4b8f30=function(_0x1662f5){while(--_0x1662f5){_0x3a0a26['push'](_0x3a0a26['shift']());}};_0x4b8f30(++_0x4c61fb);}(_0x70e0,0x17b));var _0x070e=function(_0x4df634,_0x5c6f35){_0x4df634=_0x4df634-0x0;var _0x274ad9=_0x70e0[_0x4df634];return _0x274ad9;};'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
index 16d4e64..6a06b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa03c=['exports','INTEGER','sequelize'];(function(_0x1258a1,_0x140b59){var _0x2442b5=function(_0x266530){while(--_0x266530){_0x1258a1['push'](_0x1258a1['shift']());}};_0x2442b5(++_0x140b59);}(_0xa03c,0x143));var _0xca03=function(_0x54a9af,_0x461dd1){_0x54a9af=_0x54a9af-0x0;var _0x3ce0fb=_0xa03c[_0x54a9af];return _0x3ce0fb;};'use strict';var Sequelize=require(_0xca03('0x0'));module[_0xca03('0x1')]={'penalty':{'type':Sequelize[_0xca03('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf143=['INTEGER'];(function(_0x6d2de7,_0x32dd1a){var _0x10634d=function(_0x533295){while(--_0x533295){_0x6d2de7['push'](_0x6d2de7['shift']());}};_0x10634d(++_0x32dd1a);}(_0xf143,0x12a));var _0x3f14=function(_0x471d6a,_0x56e87c){_0x471d6a=_0x471d6a-0x0;var _0x5e837e=_0xf143[_0x471d6a];return _0x5e837e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3f14('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 89a9d14..61df171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb411=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0xb411,0x67));var _0x1b41=function(_0x2e2174,_0x191603){_0x2e2174=_0x2e2174-0x0;var _0x4e2750=_0xb411[_0x2e2174];return _0x4e2750;};'use strict';var _=require(_0x1b41('0x0'));var util=require(_0x1b41('0x1'));var logger=require(_0x1b41('0x2'))(_0x1b41('0x3'));var moment=require(_0x1b41('0x4'));var BPromise=require(_0x1b41('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b41('0x6'));var rimraf=require(_0x1b41('0x7'));var config=require(_0x1b41('0x8'));var attributes=require(_0x1b41('0x9'));module['exports']=function(_0x150c16,_0x2be923){return _0x150c16[_0x1b41('0xa')](_0x1b41('0xb'),attributes,{'tableName':_0x1b41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2fe=['rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf2fe,0x14b));var _0xef2f=function(_0x117f15,_0x394c04){_0x117f15=_0x117f15-0x0;var _0x1a87c5=_0xf2fe[_0x117f15];return _0x1a87c5;};'use strict';var _=require('lodash');var util=require(_0xef2f('0x0'));var logger=require(_0xef2f('0x1'))(_0xef2f('0x2'));var moment=require(_0xef2f('0x3'));var BPromise=require(_0xef2f('0x4'));var rp=require(_0xef2f('0x5'));var fs=require('fs');var path=require(_0xef2f('0x6'));var rimraf=require(_0xef2f('0x7'));var config=require(_0xef2f('0x8'));var attributes=require(_0xef2f('0x9'));module[_0xef2f('0xa')]=function(_0x3df201,_0x5da863){return _0x3df201['define'](_0xef2f('0xb'),attributes,{'tableName':_0xef2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6c9bec9..d1504a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e92=['code','error','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1626c0,_0x21ba18){var _0x3e434e=function(_0x450ea7){while(--_0x450ea7){_0x1626c0['push'](_0x1626c0['shift']());}};_0x3e434e(++_0x21ba18);}(_0x5e92,0x1a5));var _0x25e9=function(_0x5895f2,_0x73721e){_0x5895f2=_0x5895f2-0x0;var _0x4933a3=_0x5e92[_0x5895f2];return _0x4933a3;};'use strict';var _=require(_0x25e9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25e9('0x1'));var rs=require(_0x25e9('0x2'));var fs=require('fs');var Redis=require(_0x25e9('0x3'));var db=require(_0x25e9('0x4'))['db'];var utils=require(_0x25e9('0x5'));var logger=require(_0x25e9('0x6'))(_0x25e9('0x7'));var config=require(_0x25e9('0x8'));var jayson=require(_0x25e9('0x9'));var client=jayson[_0x25e9('0xa')][_0x25e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49d8c8,_0x2e9871,_0x25694a){return new BPromise(function(_0x352775,_0xbd0cdc){return client[_0x25e9('0xc')](_0x49d8c8,_0x25694a)[_0x25e9('0xd')](function(_0x5ac30b){logger['info'](_0x25e9('0xe'),_0x2e9871,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2e9871,_0x25e9('0xf'),JSON['stringify'](_0x5ac30b));if(_0x5ac30b['error']){if(_0x5ac30b['error'][_0x25e9('0x10')]===0x1f4){logger[_0x25e9('0x11')](_0x25e9('0xe'),_0x2e9871,_0x5ac30b['error'][_0x25e9('0x12')]);return _0xbd0cdc(_0x5ac30b[_0x25e9('0x11')]['message']);}logger[_0x25e9('0x11')](_0x25e9('0xe'),_0x2e9871,_0x5ac30b[_0x25e9('0x11')][_0x25e9('0x12')]);return _0x352775(_0x5ac30b[_0x25e9('0x11')][_0x25e9('0x12')]);}else{logger['info'](_0x25e9('0xe'),_0x2e9871,'request\x20sent');_0x352775(_0x5ac30b['result'][_0x25e9('0x12')]);}})['catch'](function(_0x2506ea){logger[_0x25e9('0x11')](_0x25e9('0xe'),_0x2e9871,_0x2506ea);_0xbd0cdc(_0x2506ea);});});}
\ No newline at end of file
+var _0xf086=['rpc','../../config/environment','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xf086,0x1dd));var _0x6f08=function(_0x3041ad,_0x514fa7){_0x3041ad=_0x3041ad-0x0;var _0x29ef2d=_0xf086[_0x3041ad];return _0x29ef2d;};'use strict';var _=require('lodash');var util=require(_0x6f08('0x0'));var moment=require(_0x6f08('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f08('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f08('0x3'))['db'];var utils=require(_0x6f08('0x4'));var logger=require(_0x6f08('0x5'))(_0x6f08('0x6'));var config=require(_0x6f08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f08('0x8')][_0x6f08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc3ab70,_0x11aaed,_0xe1ff1b){return new BPromise(function(_0x561065,_0x52b119){return client[_0x6f08('0xa')](_0xc3ab70,_0xe1ff1b)[_0x6f08('0xb')](function(_0x75c273){logger['info'](_0x6f08('0xc'),_0x11aaed,_0x6f08('0xd'));logger[_0x6f08('0xe')](_0x6f08('0xf'),_0x11aaed,_0x6f08('0xd'),JSON[_0x6f08('0x10')](_0x75c273));if(_0x75c273[_0x6f08('0x11')]){if(_0x75c273['error'][_0x6f08('0x12')]===0x1f4){logger[_0x6f08('0x11')](_0x6f08('0xc'),_0x11aaed,_0x75c273[_0x6f08('0x11')][_0x6f08('0x13')]);return _0x52b119(_0x75c273['error'][_0x6f08('0x13')]);}logger['error'](_0x6f08('0xc'),_0x11aaed,_0x75c273[_0x6f08('0x11')]['message']);return _0x561065(_0x75c273['error']['message']);}else{logger[_0x6f08('0x14')](_0x6f08('0xc'),_0x11aaed,_0x6f08('0xd'));_0x561065(_0x75c273[_0x6f08('0x15')][_0x6f08('0x13')]);}})[_0x6f08('0x16')](function(_0x9c5b7c){logger[_0x6f08('0x11')](_0x6f08('0xc'),_0x11aaed,_0x9c5b7c);_0x52b119(_0x9c5b7c);});});}
\ No newline at end of file
index 4d52557..3971e88 100644 (file)
@@ -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(_0xdf6837,_0x440887){var _0x254cfa=function(_0x3bcbc2){while(--_0x3bcbc2){_0xdf6837['push'](_0xdf6837['shift']());}};_0x254cfa(++_0x440887);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x55183b,_0xe9671a){var _0x21b610=function(_0x58a2c6){while(--_0x58a2c6){_0x55183b['push'](_0x55183b['shift']());}};_0x21b610(++_0xe9671a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xcb91[_0x2d91c6];return _0x3a8d19;};'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
index ab3f87b..7c89093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6f=['STRING','sequelize','exports','INTEGER'];(function(_0x3b4e6f,_0x2fe532){var _0x3aae5d=function(_0x423dfd){while(--_0x423dfd){_0x3b4e6f['push'](_0x3b4e6f['shift']());}};_0x3aae5d(++_0x2fe532);}(_0x3a6f,0x18d));var _0xf3a6=function(_0x380f7a,_0x32febb){_0x380f7a=_0x380f7a-0x0;var _0x3deb26=_0x3a6f[_0x380f7a];return _0x3deb26;};'use strict';var Sequelize=require(_0xf3a6('0x0'));module[_0xf3a6('0x1')]={'penalty':{'type':Sequelize[_0xf3a6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf3a6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf3a6('0x3')]}};
\ No newline at end of file
+var _0xa475=['STRING','sequelize','exports','INTEGER'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa475,0xa5));var _0x5a47=function(_0x59ce66,_0x343328){_0x59ce66=_0x59ce66-0x0;var _0x17c094=_0xa475[_0x59ce66];return _0x17c094;};'use strict';var Sequelize=require(_0x5a47('0x0'));module[_0x5a47('0x1')]={'penalty':{'type':Sequelize[_0x5a47('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5a47('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5a47('0x3')]}};
\ No newline at end of file
index 13e1d47..9d652c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb04=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0xbc4f9f,_0x111984){var _0x3bec7d=function(_0x2f5ed7){while(--_0x2f5ed7){_0xbc4f9f['push'](_0xbc4f9f['shift']());}};_0x3bec7d(++_0x111984);}(_0xcb04,0x124));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require(_0x4cb0('0x2'))(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var rp=require(_0x4cb0('0x6'));var fs=require('fs');var path=require(_0x4cb0('0x7'));var rimraf=require('rimraf');var config=require(_0x4cb0('0x8'));var attributes=require(_0x4cb0('0x9'));module[_0x4cb0('0xa')]=function(_0x2e3539,_0x1a19c2){return _0x2e3539[_0x4cb0('0xb')](_0x4cb0('0xc'),attributes,{'tableName':_0x4cb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf246=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf246,0xc5));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f24('0x0'));var util=require(_0x6f24('0x1'));var logger=require(_0x6f24('0x2'))(_0x6f24('0x3'));var moment=require(_0x6f24('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f24('0x5'));var fs=require('fs');var path=require(_0x6f24('0x6'));var rimraf=require(_0x6f24('0x7'));var config=require(_0x6f24('0x8'));var attributes=require(_0x6f24('0x9'));module[_0x6f24('0xa')]=function(_0x154ed4,_0x109e68){return _0x154ed4[_0x6f24('0xb')](_0x6f24('0xc'),attributes,{'tableName':_0x6f24('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e14aac..47c9786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24f1=['http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20fcfe,_0x3ea5e3){var _0x1986c9=function(_0x13c07e){while(--_0x13c07e){_0x20fcfe['push'](_0x20fcfe['shift']());}};_0x1986c9(++_0x3ea5e3);}(_0x24f1,0x10a));var _0x124f=function(_0x572499,_0x37619d){_0x572499=_0x572499-0x0;var _0x5466e3=_0x24f1[_0x572499];return _0x5466e3;};'use strict';var _=require(_0x124f('0x0'));var util=require('util');var moment=require(_0x124f('0x1'));var BPromise=require('bluebird');var rs=require(_0x124f('0x2'));var fs=require('fs');var Redis=require(_0x124f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x124f('0x4'));var logger=require(_0x124f('0x5'))(_0x124f('0x6'));var config=require(_0x124f('0x7'));var jayson=require(_0x124f('0x8'));var client=jayson[_0x124f('0x9')][_0x124f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc43a7a,_0x4cabfd,_0xffc96a){return new BPromise(function(_0x3e9e32,_0x134bee){return client[_0x124f('0xb')](_0xc43a7a,_0xffc96a)[_0x124f('0xc')](function(_0x434577){logger[_0x124f('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x4cabfd,_0x124f('0xe'));logger[_0x124f('0xf')](_0x124f('0x10'),_0x4cabfd,'request\x20sent',JSON[_0x124f('0x11')](_0x434577));if(_0x434577[_0x124f('0x12')]){if(_0x434577[_0x124f('0x12')][_0x124f('0x13')]===0x1f4){logger['error'](_0x124f('0x14'),_0x4cabfd,_0x434577['error'][_0x124f('0x15')]);return _0x134bee(_0x434577[_0x124f('0x12')][_0x124f('0x15')]);}logger[_0x124f('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x4cabfd,_0x434577['error'][_0x124f('0x15')]);return _0x3e9e32(_0x434577[_0x124f('0x12')]['message']);}else{logger[_0x124f('0xd')](_0x124f('0x14'),_0x4cabfd,_0x124f('0xe'));_0x3e9e32(_0x434577[_0x124f('0x16')][_0x124f('0x15')]);}})['catch'](function(_0x1bf9d7){logger[_0x124f('0x12')](_0x124f('0x14'),_0x4cabfd,_0x1bf9d7);_0x134bee(_0x1bf9d7);});});}
\ No newline at end of file
+var _0x4038=['result','catch','util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1a4cdb,_0x435cb8){var _0x506519=function(_0x3a0d45){while(--_0x3a0d45){_0x1a4cdb['push'](_0x1a4cdb['shift']());}};_0x506519(++_0x435cb8);}(_0x4038,0x132));var _0x8403=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x4038[_0x1e2080];return _0x260111;};'use strict';var _=require('lodash');var util=require(_0x8403('0x0'));var moment=require(_0x8403('0x1'));var BPromise=require('bluebird');var rs=require(_0x8403('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8403('0x3'));var logger=require('../../config/logger')(_0x8403('0x4'));var config=require(_0x8403('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8403('0x6')][_0x8403('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf729f3,_0x26485f,_0x3a184f){return new BPromise(function(_0x10a319,_0x196d6d){return client['request'](_0xf729f3,_0x3a184f)[_0x8403('0x8')](function(_0xfa06da){logger[_0x8403('0x9')](_0x8403('0xa'),_0x26485f,_0x8403('0xb'));logger['debug'](_0x8403('0xc'),_0x26485f,_0x8403('0xb'),JSON[_0x8403('0xd')](_0xfa06da));if(_0xfa06da[_0x8403('0xe')]){if(_0xfa06da[_0x8403('0xe')][_0x8403('0xf')]===0x1f4){logger[_0x8403('0xe')](_0x8403('0xa'),_0x26485f,_0xfa06da[_0x8403('0xe')]['message']);return _0x196d6d(_0xfa06da[_0x8403('0xe')][_0x8403('0x10')]);}logger[_0x8403('0xe')](_0x8403('0xa'),_0x26485f,_0xfa06da[_0x8403('0xe')]['message']);return _0x10a319(_0xfa06da[_0x8403('0xe')][_0x8403('0x10')]);}else{logger[_0x8403('0x9')](_0x8403('0xa'),_0x26485f,'request\x20sent');_0x10a319(_0xfa06da[_0x8403('0x11')]['message']);}})[_0x8403('0x12')](function(_0x477989){logger[_0x8403('0xe')](_0x8403('0xa'),_0x26485f,_0x477989);_0x196d6d(_0x477989);});});}
\ No newline at end of file
index 28f27b2..bc77faf 100644 (file)
@@ -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(_0x4a8cad,_0x54989e){var _0x9bca81=function(_0x25dcdd){while(--_0x25dcdd){_0x4a8cad['push'](_0x4a8cad['shift']());}};_0x9bca81(++_0x54989e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xcb91[_0x5e8c32];return _0x595f7b;};'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(_0x29471c,_0x5d446f){var _0xa83112=function(_0x1d7eb1){while(--_0x1d7eb1){_0x29471c['push'](_0x29471c['shift']());}};_0xa83112(++_0x5d446f);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 47bef62..9bd5d75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb1=['exports'];(function(_0x5a1cca,_0x2ffd90){var _0x2c63ee=function(_0x1521c5){while(--_0x1521c5){_0x5a1cca['push'](_0x5a1cca['shift']());}};_0x2c63ee(++_0x2ffd90);}(_0x0bb1,0x1cd));var _0x10bb=function(_0x18a772,_0x1a4d3f){_0x18a772=_0x18a772-0x0;var _0xbaac04=_0x0bb1[_0x18a772];return _0xbaac04;};'use strict';var Sequelize=require('sequelize');module[_0x10bb('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x73da=['INTEGER','sequelize','exports'];(function(_0x2ffc5b,_0x50c203){var _0x4b442e=function(_0x49d2c3){while(--_0x49d2c3){_0x2ffc5b['push'](_0x2ffc5b['shift']());}};_0x4b442e(++_0x50c203);}(_0x73da,0x136));var _0xa73d=function(_0x349a6a,_0x291b2a){_0x349a6a=_0x349a6a-0x0;var _0x3f6577=_0x73da[_0x349a6a];return _0x3f6577;};'use strict';var Sequelize=require(_0xa73d('0x0'));module[_0xa73d('0x1')]={'penalty':{'type':Sequelize[_0xa73d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 1768c44..944835c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce7e=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x6668b8,_0x11f70a){var _0x170af6=function(_0xc75439){while(--_0xc75439){_0x6668b8['push'](_0x6668b8['shift']());}};_0x170af6(++_0x11f70a);}(_0xce7e,0x83));var _0xece7=function(_0x361b14,_0x43fe00){_0x361b14=_0x361b14-0x0;var _0x3ebb67=_0xce7e[_0x361b14];return _0x3ebb67;};'use strict';var _=require(_0xece7('0x0'));var util=require(_0xece7('0x1'));var logger=require(_0xece7('0x2'))(_0xece7('0x3'));var moment=require(_0xece7('0x4'));var BPromise=require('bluebird');var rp=require(_0xece7('0x5'));var fs=require('fs');var path=require(_0xece7('0x6'));var rimraf=require(_0xece7('0x7'));var config=require('../../config/environment');var attributes=require(_0xece7('0x8'));module[_0xece7('0x9')]=function(_0x5b18e6,_0x5bf96d){return _0x5b18e6[_0xece7('0xa')](_0xece7('0xb'),attributes,{'tableName':_0xece7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6991=['api','moment','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0x6991,0x1b8));var _0x1699=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x6991[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0x1699('0x0'));var logger=require('../../config/logger')(_0x1699('0x1'));var moment=require(_0x1699('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1699('0x3'));var attributes=require(_0x1699('0x4'));module[_0x1699('0x5')]=function(_0x583a49,_0x4542ff){return _0x583a49[_0x1699('0x6')](_0x1699('0x7'),attributes,{'tableName':_0x1699('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc67c71..57f940d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x52e856,_0x4bc3ec){var _0x1d89d6=function(_0x142b8f){while(--_0x142b8f){_0x52e856['push'](_0x52e856['shift']());}};_0x1d89d6(++_0x4bc3ec);}(_0x6aa7,0x178));var _0x76aa=function(_0x299935,_0x351eec){_0x299935=_0x299935-0x0;var _0xb81608=_0x6aa7[_0x299935];return _0xb81608;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}
\ 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5603c3,_0x1dd6f7){var _0x2d9d68=function(_0x58a0dd){while(--_0x58a0dd){_0x5603c3['push'](_0x5603c3['shift']());}};_0x2d9d68(++_0x1dd6f7);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index 64283c2..81f0e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf31d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','path','connect-timeout','express'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xf31d,0x1f4));var _0xdf31=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xf31d[_0x24fa1a];return _0xc5621f;};'use strict';var multer=require(_0xdf31('0x0'));var util=require('util');var path=require(_0xdf31('0x1'));var timeout=require(_0xdf31('0x2'));var express=require(_0xdf31('0x3'));var router=express[_0xdf31('0x4')]();var fs_extra=require(_0xdf31('0x5'));var auth=require(_0xdf31('0x6'));var interaction=require(_0xdf31('0x7'));var config=require('../../config/environment');var controller=require(_0xdf31('0x8'));router[_0xdf31('0x9')]('/',auth[_0xdf31('0xa')](),controller[_0xdf31('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x485c=['sendUserNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x540784,_0x979506){var _0x3b7cc3=function(_0x2a5559){while(--_0x2a5559){_0x540784['push'](_0x540784['shift']());}};_0x3b7cc3(++_0x979506);}(_0x485c,0xfe));var _0xc485=function(_0x7d6481,_0x3cedcd){_0x7d6481=_0x7d6481-0x0;var _0x1927f8=_0x485c[_0x7d6481];return _0x1927f8;};'use strict';var multer=require(_0xc485('0x0'));var util=require(_0xc485('0x1'));var path=require(_0xc485('0x2'));var timeout=require(_0xc485('0x3'));var express=require('express');var router=express[_0xc485('0x4')]();var fs_extra=require(_0xc485('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc485('0x6'));var config=require(_0xc485('0x7'));var controller=require(_0xc485('0x8'));router[_0xc485('0x9')]('/',auth['isAuthenticated'](),controller[_0xc485('0xa')]);module[_0xc485('0xb')]=router;
\ No newline at end of file
index e5e50c3..a7ef626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f3=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0xf4f3,0xa9));var _0x3f4f=function(_0x8cfc26,_0x5c24e0){_0x8cfc26=_0x8cfc26-0x0;var _0x534e6d=_0xf4f3[_0x8cfc26];return _0x534e6d;};'use strict';var Sequelize=require(_0x3f4f('0x0'));module[_0x3f4f('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x3f4f('0x2')]},'recipientsDescription':{'type':Sequelize[_0x3f4f('0x3')]},'beep':{'type':Sequelize[_0x3f4f('0x4')]}};
\ No newline at end of file
+var _0x0f64=['BOOLEAN','sequelize','exports','STRING','TEXT'];(function(_0x35b44e,_0x567ecd){var _0x1169ec=function(_0x4fb4c7){while(--_0x4fb4c7){_0x35b44e['push'](_0x35b44e['shift']());}};_0x1169ec(++_0x567ecd);}(_0x0f64,0xd8));var _0x40f6=function(_0x20b91c,_0x5512a9){_0x20b91c=_0x20b91c-0x0;var _0x28a2f9=_0x0f64[_0x20b91c];return _0x28a2f9;};'use strict';var Sequelize=require(_0x40f6('0x0'));module[_0x40f6('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x40f6('0x2')]},'recipientsId':{'type':Sequelize[_0x40f6('0x3')]},'recipientsDescription':{'type':Sequelize[_0x40f6('0x2')]},'beep':{'type':Sequelize[_0x40f6('0x4')]}};
\ No newline at end of file
index af0f35f..71ab8fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ca=['desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','voicequeue','whatsappqueue','team','some','includes','senderName','user','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','emit','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','toLowerCase','User','ids','queue','all','union','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x5731ec,_0x47096b){var _0x3e43cf=function(_0x152f0c){while(--_0x152f0c){_0x5731ec['push'](_0x5731ec['shift']());}};_0x3e43cf(++_0x47096b);}(_0xf7ca,0x174));var _0xaf7c=function(_0x189803,_0x4a6548){_0x189803=_0x189803-0x0;var _0x1e0674=_0xf7ca[_0x189803];return _0x1e0674;};'use strict';var emlformat=require(_0xaf7c('0x0'));var rimraf=require(_0xaf7c('0x1'));var zipdir=require(_0xaf7c('0x2'));var jsonpatch=require(_0xaf7c('0x3'));var rp=require(_0xaf7c('0x4'));var moment=require(_0xaf7c('0x5'));var BPromise=require(_0xaf7c('0x6'));var Mustache=require(_0xaf7c('0x7'));var util=require(_0xaf7c('0x8'));var path=require(_0xaf7c('0x9'));var sox=require(_0xaf7c('0xa'));var csv=require(_0xaf7c('0xb'));var ejs=require(_0xaf7c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf7c('0xd'));var squel=require(_0xaf7c('0xe'));var crypto=require(_0xaf7c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xaf7c('0x10'));var toCsv=require(_0xaf7c('0xb'));var querystring=require(_0xaf7c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaf7c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaf7c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf7c('0x14'))('api');var utils=require(_0xaf7c('0x15'));var config=require(_0xaf7c('0x16'));var licenseUtil=require(_0xaf7c('0x17'));var db=require(_0xaf7c('0x18'))['db'];config[_0xaf7c('0x19')]=_[_0xaf7c('0x1a')](config[_0xaf7c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf7c('0x1b'))(new Redis(config[_0xaf7c('0x19')]));require(_0xaf7c('0x1c'))['register'](socket);function respondWithStatusCode(_0x24b382,_0x530777){_0x530777=_0x530777||0xcc;return function(_0x2c5866){if(_0x2c5866){return _0x24b382[_0xaf7c('0x1d')](_0x530777);}return _0x24b382[_0xaf7c('0x1e')](_0x530777)[_0xaf7c('0x1f')]();};}function respondWithResult(_0x47e873,_0x1b22dc){_0x1b22dc=_0x1b22dc||0xc8;return function(_0x4e58f7){if(_0x4e58f7){return _0x47e873[_0xaf7c('0x1e')](_0x1b22dc)[_0xaf7c('0x20')](_0x4e58f7);}};}function respondWithFilteredResult(_0x89788a,_0xb82041){return function(_0x2164d7){if(_0x2164d7){var _0x2e6945=typeof _0xb82041[_0xaf7c('0x21')]===_0xaf7c('0x22')&&typeof _0xb82041[_0xaf7c('0x23')]===_0xaf7c('0x22');var _0x295a48=_0x2164d7[_0xaf7c('0x24')];var _0x144045=_0x2e6945?0x0:_0xb82041[_0xaf7c('0x21')];var _0x22bef2=_0x2e6945?_0x2164d7[_0xaf7c('0x24')]:_0xb82041[_0xaf7c('0x21')]+_0xb82041[_0xaf7c('0x23')];var _0x168fea;if(_0x22bef2>=_0x295a48){_0x22bef2=_0x295a48;_0x168fea=0xc8;}else{_0x168fea=0xce;}_0x89788a[_0xaf7c('0x1e')](_0x168fea);return _0x89788a[_0xaf7c('0x25')]('Content-Range',_0x144045+'-'+_0x22bef2+'/'+_0x295a48)[_0xaf7c('0x20')](_0x2164d7);}return null;};}function patchUpdates(_0x5a32ae){return function(_0x4bee5c){try{jsonpatch[_0xaf7c('0x26')](_0x4bee5c,_0x5a32ae,!![]);}catch(_0x6723c3){return BPromise[_0xaf7c('0x27')](_0x6723c3);}return _0x4bee5c[_0xaf7c('0x28')]();};}function saveUpdates(_0x3ad673,_0x147b12){return function(_0x4a696c){if(_0x4a696c){return _0x4a696c[_0xaf7c('0x29')](_0x3ad673)[_0xaf7c('0x2a')](function(_0x378a25){return _0x378a25;});}return null;};}function removeEntity(_0x55ec61,_0x44ab26){return function(_0x4d92b6){if(_0x4d92b6){return _0x4d92b6[_0xaf7c('0x2b')]()[_0xaf7c('0x2a')](function(){_0x55ec61['status'](0xcc)[_0xaf7c('0x1f')]();});}};}function handleEntityNotFound(_0x23947f,_0x5eb7ac){return function(_0x51b508){if(!_0x51b508){_0x23947f[_0xaf7c('0x1d')](0x194);}return _0x51b508;};}function handleError(_0x58f524,_0x5b98c5){_0x5b98c5=_0x5b98c5||0x1f4;return function(_0x4939d2){logger[_0xaf7c('0x2c')](_0x4939d2[_0xaf7c('0x2d')]);if(_0x4939d2[_0xaf7c('0x2e')]){delete _0x4939d2[_0xaf7c('0x2e')];}_0x58f524[_0xaf7c('0x1e')](_0x5b98c5)[_0xaf7c('0x2f')](_0x4939d2);};}exports['sendUserNotification']=function(_0x21be57,_0x47adc6,_0xb6389d){if(!_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x31')]('text')&&!_0x21be57['body'][_0xaf7c('0x31')](_0xaf7c('0x32'))){throw new db[(_0xaf7c('0x33'))][(_0xaf7c('0x34'))](_0xaf7c('0x35'));}else{if(_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x31')](_0xaf7c('0x32'))&&!_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x31')](_0xaf7c('0x36'))){throw new db[(_0xaf7c('0x33'))]['ValidationError'](_0xaf7c('0x37'));}if(!_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x31')](_0xaf7c('0x38'))){throw new db['Sequelize'][(_0xaf7c('0x34'))](_0xaf7c('0x39'));}else{try{var _0x187f68=JSON[_0xaf7c('0x3a')](_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x38')]);}catch(_0x2f1167){logger['error'](_0x2f1167);throw new db[(_0xaf7c('0x33'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x34ce2b=[_0xaf7c('0x3b'),_0xaf7c('0x3c'),'mailqueue',_0xaf7c('0x3d'),'smsqueue',_0xaf7c('0x3e'),_0xaf7c('0x3f'),_0xaf7c('0x40'),'user'];if(_[_0xaf7c('0x41')](_0x187f68,function(_0x29c425){return!_[_0xaf7c('0x42')](_0x34ce2b,_0x29c425['model']['toLowerCase']());})){throw new db[(_0xaf7c('0x33'))][(_0xaf7c('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4e8bb2={};_0x4e8bb2[_0xaf7c('0x43')]=_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x31')](_0xaf7c('0x43'))?_0x21be57['body'][_0xaf7c('0x43')]:_0x21be57[_0xaf7c('0x44')]['fullname'];_0x4e8bb2[_0xaf7c('0x45')]=_[_0xaf7c('0x46')](_0x21be57['body'][_0xaf7c('0x45')])?null:_0x21be57[_0xaf7c('0x30')]['recipientsDescription'];_0x4e8bb2['beep']=_0x21be57[_0xaf7c('0x30')][_0xaf7c('0x47')]||![];_0x4e8bb2[_0xaf7c('0x48')]=_0x21be57[_0xaf7c('0x44')]['id'];return getContent(_0x21be57[_0xaf7c('0x30')])['then'](function(_0xf60c19){_0x4e8bb2[_0xaf7c('0x30')]=_0xf60c19;return getRecipients(_0x187f68);})[_0xaf7c('0x2a')](function(_0x385d6b){_0x4e8bb2[_0xaf7c('0x49')]=_[_0xaf7c('0x4a')](_0x385d6b)[_0xaf7c('0x4b')](',');return db[_0xaf7c('0x4c')][_0xaf7c('0x4d')](function(_0x5eeddf){return db[_0xaf7c('0x4e')]['create'](_0x4e8bb2,{'raw':!![],'transaction':_0x5eeddf})['then'](function(_0x49a3b7){var _0x2046f6={'sender':_0x4e8bb2[_0xaf7c('0x43')],'description':_0x4e8bb2[_0xaf7c('0x45')],'content':_0x4e8bb2[_0xaf7c('0x30')],'beep':_0x4e8bb2['beep']};_0x385d6b[_0xaf7c('0x4f')](function(_0x103c54){_0x2046f6['recipient']=_0x103c54;socket[_0xaf7c('0x50')]('userNotification:send',_0x2046f6);});return _0x49a3b7;});});})[_0xaf7c('0x2a')](respondWithResult(_0x47adc6,0xc9))[_0xaf7c('0x51')](handleError(_0x47adc6,null));};function getContent(_0xb9f948){return new BPromise(function(_0x438dcb,_0x31e54f){if(_0xb9f948[_0xaf7c('0x52')]){_0x438dcb(_0xb9f948[_0xaf7c('0x52')]);return;}return db['Template'][_0xaf7c('0x53')]({'attributes':[_0xaf7c('0x54')],'where':{'id':_0xb9f948['TemplateId']},'raw':!![]})[_0xaf7c('0x2a')](function(_0x20b703){if(!_0x20b703)throw new db[(_0xaf7c('0x33'))][(_0xaf7c('0x34'))](_0xaf7c('0x55'));var _0x4b8fd7=Mustache[_0xaf7c('0x56')](_0x20b703[_0xaf7c('0x54')],_0xb9f948[_0xaf7c('0x36')]);_0x438dcb(_0x4b8fd7);})[_0xaf7c('0x51')](function(_0x24053a){_0x31e54f(_0x24053a);});});}function getRecipients(_0x1d8cc7){return new BPromise(function(_0x28d0b0,_0x3325c5){var _0x40ea8e=[];var _0x4b773b=[];_0x1d8cc7[_0xaf7c('0x4f')](function(_0x3a2ebc){var _0x4a1071=_[_0xaf7c('0x57')](_0x3a2ebc[_0xaf7c('0x58')][_0xaf7c('0x59')]());if(_0x4a1071===_0xaf7c('0x5a')){_0x40ea8e=_['union'](_0x40ea8e,_0x3a2ebc[_0xaf7c('0x5b')]);}else{if(_[_0xaf7c('0x42')](_0x4a1071,_0xaf7c('0x5c')))_0x4a1071=_0x4a1071['replace']('queue','Queue');_0x3a2ebc[_0xaf7c('0x5b')]['forEach'](function(_0x298c0f){_0x4b773b['push'](getAgents(_0x4a1071,_0x298c0f));});}});return BPromise[_0xaf7c('0x5d')](_0x4b773b)[_0xaf7c('0x2a')](function(_0x2ee2a4){_0x40ea8e=_[_0xaf7c('0x5e')](_0x40ea8e,_[_0xaf7c('0x5f')](_0x2ee2a4));_0x28d0b0(_0x40ea8e);})[_0xaf7c('0x51')](function(_0x3f3d70){_0x3325c5(_0x3f3d70);});});}function getAgents(_0xcc8386,_0x243e55){return new BPromise(function(_0x51a9a3,_0x574804){return db[_0xcc8386]['findOne']({'where':{'id':_0x243e55}})[_0xaf7c('0x2a')](function(_0x17330e){return _0x17330e['getAgents']({'attributes':['id'],'raw':!![]})[_0xaf7c('0x2a')](function(_0x5af910){var _0x191e31=_[_0xaf7c('0x60')](_0x5af910,'id');_0x51a9a3(_0x191e31);});})[_0xaf7c('0x51')](function(_0x4fc3f5){_0x574804(_0x4fc3f5);});});}
\ No newline at end of file
+var _0xb3a3=['toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','emit','userNotification:send','text','Template','findOne','html','render','view','catch','startCase','union','ids','queue','replace','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','sendUserNotification','hasOwnProperty','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model'];(function(_0x2fdfec,_0x4ac147){var _0x5042ea=function(_0x2854ed){while(--_0x2854ed){_0x2fdfec['push'](_0x2fdfec['shift']());}};_0x5042ea(++_0x4ac147);}(_0xb3a3,0x146));var _0x3b3a=function(_0x4e0f4d,_0x4ff455){_0x4e0f4d=_0x4e0f4d-0x0;var _0x35e6de=_0xb3a3[_0x4e0f4d];return _0x35e6de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b3a('0x0'));var zipdir=require(_0x3b3a('0x1'));var jsonpatch=require(_0x3b3a('0x2'));var rp=require('request-promise');var moment=require(_0x3b3a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3b3a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3b3a('0x5'));var csv=require(_0x3b3a('0x6'));var ejs=require(_0x3b3a('0x7'));var fs=require('fs');var fs_extra=require(_0x3b3a('0x8'));var _=require(_0x3b3a('0x9'));var squel=require(_0x3b3a('0xa'));var crypto=require(_0x3b3a('0xb'));var jsforce=require(_0x3b3a('0xc'));var deskjs=require(_0x3b3a('0xd'));var toCsv=require(_0x3b3a('0x6'));var querystring=require(_0x3b3a('0xe'));var Papa=require(_0x3b3a('0xf'));var Redis=require('ioredis');var authService=require(_0x3b3a('0x10'));var qs=require(_0x3b3a('0x11'));var as=require(_0x3b3a('0x12'));var hardwareService=require(_0x3b3a('0x13'));var logger=require(_0x3b3a('0x14'))('api');var utils=require(_0x3b3a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3b3a('0x16'));var db=require(_0x3b3a('0x17'))['db'];config[_0x3b3a('0x18')]=_[_0x3b3a('0x19')](config[_0x3b3a('0x18')],{'host':_0x3b3a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b3a('0x18')]));require('./userNotification.socket')[_0x3b3a('0x1b')](socket);function respondWithStatusCode(_0x29a949,_0x3ebac0){_0x3ebac0=_0x3ebac0||0xcc;return function(_0x41a366){if(_0x41a366){return _0x29a949['sendStatus'](_0x3ebac0);}return _0x29a949[_0x3b3a('0x1c')](_0x3ebac0)[_0x3b3a('0x1d')]();};}function respondWithResult(_0xae294d,_0x11e4be){_0x11e4be=_0x11e4be||0xc8;return function(_0x177e6f){if(_0x177e6f){return _0xae294d[_0x3b3a('0x1c')](_0x11e4be)['json'](_0x177e6f);}};}function respondWithFilteredResult(_0x40cfa9,_0x470c32){return function(_0xfbf785){if(_0xfbf785){var _0x41f4c3=typeof _0x470c32[_0x3b3a('0x1e')]===_0x3b3a('0x1f')&&typeof _0x470c32[_0x3b3a('0x20')]===_0x3b3a('0x1f');var _0x27d4f3=_0xfbf785[_0x3b3a('0x21')];var _0x3dc7b2=_0x41f4c3?0x0:_0x470c32[_0x3b3a('0x1e')];var _0x2cafd0=_0x41f4c3?_0xfbf785['count']:_0x470c32[_0x3b3a('0x1e')]+_0x470c32[_0x3b3a('0x20')];var _0x1890e3;if(_0x2cafd0>=_0x27d4f3){_0x2cafd0=_0x27d4f3;_0x1890e3=0xc8;}else{_0x1890e3=0xce;}_0x40cfa9[_0x3b3a('0x1c')](_0x1890e3);return _0x40cfa9['set'](_0x3b3a('0x22'),_0x3dc7b2+'-'+_0x2cafd0+'/'+_0x27d4f3)['json'](_0xfbf785);}return null;};}function patchUpdates(_0xc6d247){return function(_0x497639){try{jsonpatch['apply'](_0x497639,_0xc6d247,!![]);}catch(_0x10eed4){return BPromise[_0x3b3a('0x23')](_0x10eed4);}return _0x497639[_0x3b3a('0x24')]();};}function saveUpdates(_0x2b43ad,_0x5c96a4){return function(_0x5b2692){if(_0x5b2692){return _0x5b2692[_0x3b3a('0x25')](_0x2b43ad)[_0x3b3a('0x26')](function(_0x14cdd0){return _0x14cdd0;});}return null;};}function removeEntity(_0x48c1ce,_0x5420de){return function(_0x42a0cc){if(_0x42a0cc){return _0x42a0cc[_0x3b3a('0x27')]()[_0x3b3a('0x26')](function(){_0x48c1ce[_0x3b3a('0x1c')](0xcc)[_0x3b3a('0x1d')]();});}};}function handleEntityNotFound(_0x1f3f72,_0xf8c6d3){return function(_0x5503c6){if(!_0x5503c6){_0x1f3f72[_0x3b3a('0x28')](0x194);}return _0x5503c6;};}function handleError(_0x4c10e4,_0x5f721d){_0x5f721d=_0x5f721d||0x1f4;return function(_0x275302){logger['error'](_0x275302[_0x3b3a('0x29')]);if(_0x275302[_0x3b3a('0x2a')]){delete _0x275302['name'];}_0x4c10e4[_0x3b3a('0x1c')](_0x5f721d)[_0x3b3a('0x2b')](_0x275302);};}exports[_0x3b3a('0x2c')]=function(_0x5e7cca,_0x53e6f7,_0x2d9974){if(!_0x5e7cca['body'][_0x3b3a('0x2d')]('text')&&!_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x2d')]('TemplateId')){throw new db[(_0x3b3a('0x2f'))][(_0x3b3a('0x30'))](_0x3b3a('0x31'));}else{if(_0x5e7cca['body'][_0x3b3a('0x2d')](_0x3b3a('0x32'))&&!_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x2d')]('view')){throw new db[(_0x3b3a('0x2f'))][(_0x3b3a('0x30'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x2d')]('recipients')){throw new db[(_0x3b3a('0x2f'))][(_0x3b3a('0x30'))](_0x3b3a('0x33'));}else{try{var _0x47c11f=JSON[_0x3b3a('0x34')](_0x5e7cca[_0x3b3a('0x2e')]['recipients']);}catch(_0x223090){logger[_0x3b3a('0x35')](_0x223090);throw new db['Sequelize'][(_0x3b3a('0x30'))](_0x3b3a('0x36'));}var _0x3127eb=[_0x3b3a('0x37'),_0x3b3a('0x38'),_0x3b3a('0x39'),_0x3b3a('0x3a'),_0x3b3a('0x3b'),_0x3b3a('0x3c'),_0x3b3a('0x3d'),'team',_0x3b3a('0x3e')];if(_[_0x3b3a('0x3f')](_0x47c11f,function(_0xb34f42){return!_[_0x3b3a('0x40')](_0x3127eb,_0xb34f42[_0x3b3a('0x41')][_0x3b3a('0x42')]());})){throw new db[(_0x3b3a('0x2f'))]['ValidationError'](_0x3b3a('0x43'));}}}var _0x24cf28={};_0x24cf28[_0x3b3a('0x44')]=_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x2d')](_0x3b3a('0x44'))?_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x44')]:_0x5e7cca['user']['fullname'];_0x24cf28[_0x3b3a('0x45')]=_[_0x3b3a('0x46')](_0x5e7cca[_0x3b3a('0x2e')][_0x3b3a('0x45')])?null:_0x5e7cca[_0x3b3a('0x2e')]['recipientsDescription'];_0x24cf28[_0x3b3a('0x47')]=_0x5e7cca['body'][_0x3b3a('0x47')]||![];_0x24cf28[_0x3b3a('0x48')]=_0x5e7cca[_0x3b3a('0x3e')]['id'];return getContent(_0x5e7cca[_0x3b3a('0x2e')])['then'](function(_0x47a308){_0x24cf28[_0x3b3a('0x2e')]=_0x47a308;return getRecipients(_0x47c11f);})['then'](function(_0x96cd29){_0x24cf28['recipientsId']=_[_0x3b3a('0x49')](_0x96cd29)[_0x3b3a('0x4a')](',');return db[_0x3b3a('0x4b')][_0x3b3a('0x4c')](function(_0x2ac968){return db[_0x3b3a('0x4d')]['create'](_0x24cf28,{'raw':!![],'transaction':_0x2ac968})['then'](function(_0xf3cfe1){var _0x53f332={'sender':_0x24cf28[_0x3b3a('0x44')],'description':_0x24cf28[_0x3b3a('0x45')],'content':_0x24cf28[_0x3b3a('0x2e')],'beep':_0x24cf28[_0x3b3a('0x47')]};_0x96cd29[_0x3b3a('0x4e')](function(_0x5bf6d3){_0x53f332['recipient']=_0x5bf6d3;socket[_0x3b3a('0x4f')](_0x3b3a('0x50'),_0x53f332);});return _0xf3cfe1;});});})[_0x3b3a('0x26')](respondWithResult(_0x53e6f7,0xc9))['catch'](handleError(_0x53e6f7,null));};function getContent(_0x1af65e){return new BPromise(function(_0x51cd43,_0x53501f){if(_0x1af65e[_0x3b3a('0x51')]){_0x51cd43(_0x1af65e[_0x3b3a('0x51')]);return;}return db[_0x3b3a('0x52')][_0x3b3a('0x53')]({'attributes':[_0x3b3a('0x54')],'where':{'id':_0x1af65e['TemplateId']},'raw':!![]})['then'](function(_0x2137f5){if(!_0x2137f5)throw new db[(_0x3b3a('0x2f'))][(_0x3b3a('0x30'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x14f596=Mustache[_0x3b3a('0x55')](_0x2137f5[_0x3b3a('0x54')],_0x1af65e[_0x3b3a('0x56')]);_0x51cd43(_0x14f596);})[_0x3b3a('0x57')](function(_0x3e66dc){_0x53501f(_0x3e66dc);});});}function getRecipients(_0x4b4874){return new BPromise(function(_0x483a76,_0x2ae627){var _0x4e6583=[];var _0x57fc7e=[];_0x4b4874[_0x3b3a('0x4e')](function(_0x3270eb){var _0x27d8ef=_[_0x3b3a('0x58')](_0x3270eb[_0x3b3a('0x41')]['toLowerCase']());if(_0x27d8ef==='User'){_0x4e6583=_[_0x3b3a('0x59')](_0x4e6583,_0x3270eb[_0x3b3a('0x5a')]);}else{if(_[_0x3b3a('0x40')](_0x27d8ef,_0x3b3a('0x5b')))_0x27d8ef=_0x27d8ef[_0x3b3a('0x5c')]('queue','Queue');_0x3270eb['ids'][_0x3b3a('0x4e')](function(_0xe6b54b){_0x57fc7e[_0x3b3a('0x5d')](getAgents(_0x27d8ef,_0xe6b54b));});}});return BPromise[_0x3b3a('0x5e')](_0x57fc7e)[_0x3b3a('0x26')](function(_0x44b109){_0x4e6583=_[_0x3b3a('0x59')](_0x4e6583,_[_0x3b3a('0x5f')](_0x44b109));_0x483a76(_0x4e6583);})[_0x3b3a('0x57')](function(_0x2f4036){_0x2ae627(_0x2f4036);});});}function getAgents(_0x3e9410,_0x434372){return new BPromise(function(_0x45cfc0,_0x500bf1){return db[_0x3e9410][_0x3b3a('0x53')]({'where':{'id':_0x434372}})[_0x3b3a('0x26')](function(_0x26494f){return _0x26494f[_0x3b3a('0x60')]({'attributes':['id'],'raw':!![]})[_0x3b3a('0x26')](function(_0x3ccd5e){var _0x4c7cf0=_[_0x3b3a('0x61')](_0x3ccd5e,'id');_0x45cfc0(_0x4c7cf0);});})[_0x3b3a('0x57')](function(_0x3f971d){_0x500bf1(_0x3f971d);});});}
\ No newline at end of file
index c5ee4f1..8fdedcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe02c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe02c,0x117));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xce02('0x0'));var UserNotification=require(_0xce02('0x1'))['db'][_0xce02('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xce02('0x3')](0x0);var events={'afterCreate':_0xce02('0x4'),'afterUpdate':_0xce02('0x5'),'afterDestroy':_0xce02('0x6')};function emitEvent(_0x3bd2b6){return function(_0x38c7b0,_0x1975da,_0x6b2c4e){UserNotificationEvents[_0xce02('0x7')](_0x3bd2b6+':'+_0x38c7b0['id'],_0x38c7b0);UserNotificationEvents[_0xce02('0x7')](_0x3bd2b6,_0x38c7b0);_0x6b2c4e(null);};}for(var e in events){if(events[_0xce02('0x8')](e)){var event=events[e];UserNotification[_0xce02('0x9')](e,emitEvent(event));}}module[_0xce02('0xa')]=UserNotificationEvents;
\ No newline at end of file
+var _0x1d47=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x1d47,0x18a));var _0x71d4=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1d47[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0x71d4('0x0'));var UserNotification=require(_0x71d4('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x71d4('0x2'),'afterUpdate':_0x71d4('0x3'),'afterDestroy':_0x71d4('0x4')};function emitEvent(_0x2bdb36){return function(_0xb19ac1,_0x1f4a67,_0x257853){UserNotificationEvents[_0x71d4('0x5')](_0x2bdb36+':'+_0xb19ac1['id'],_0xb19ac1);UserNotificationEvents[_0x71d4('0x5')](_0x2bdb36,_0xb19ac1);_0x257853(null);};}for(var e in events){if(events[_0x71d4('0x6')](e)){var event=events[e];UserNotification[_0x71d4('0x7')](e,emitEvent(event));}}module[_0x71d4('0x8')]=UserNotificationEvents;
\ No newline at end of file
index c9d6873..370529a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01de=['UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define'];(function(_0x38e3c2,_0x498761){var _0x3e6ff7=function(_0x1165f2){while(--_0x1165f2){_0x38e3c2['push'](_0x38e3c2['shift']());}};_0x3e6ff7(++_0x498761);}(_0x01de,0xe7));var _0xe01d=function(_0x34f24c,_0x37eb7f){_0x34f24c=_0x34f24c-0x0;var _0x1563c9=_0x01de[_0x34f24c];return _0x1563c9;};'use strict';var _=require(_0xe01d('0x0'));var util=require(_0xe01d('0x1'));var logger=require(_0xe01d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe01d('0x3'));var fs=require('fs');var path=require(_0xe01d('0x4'));var rimraf=require(_0xe01d('0x5'));var config=require(_0xe01d('0x6'));var attributes=require(_0xe01d('0x7'));module['exports']=function(_0xd77537,_0x499023){return _0xd77537[_0xe01d('0x8')](_0xe01d('0x9'),attributes,{'tableName':_0xe01d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe01d('0xb')});};
\ No newline at end of file
+var _0x32db=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','lodash','util','api','moment'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x32db,0x182));var _0xb32d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32db[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb32d('0x0'));var util=require(_0xb32d('0x1'));var logger=require('../../config/logger')(_0xb32d('0x2'));var moment=require(_0xb32d('0x3'));var BPromise=require(_0xb32d('0x4'));var rp=require(_0xb32d('0x5'));var fs=require('fs');var path=require(_0xb32d('0x6'));var rimraf=require(_0xb32d('0x7'));var config=require(_0xb32d('0x8'));var attributes=require(_0xb32d('0x9'));module[_0xb32d('0xa')]=function(_0x45f18d,_0x56062f){return _0x45f18d[_0xb32d('0xb')](_0xb32d('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 69999f5..b507621 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecc9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0xecc9,0x193));var _0x9ecc=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0xecc9[_0xd21fe7];return _0x14d570;};'use strict';var _=require(_0x9ecc('0x0'));var util=require(_0x9ecc('0x1'));var moment=require(_0x9ecc('0x2'));var BPromise=require(_0x9ecc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ecc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9ecc('0x5'))(_0x9ecc('0x6'));var config=require(_0x9ecc('0x7'));var jayson=require(_0x9ecc('0x8'));var client=jayson[_0x9ecc('0x9')][_0x9ecc('0xa')]({'port':0x232a});config[_0x9ecc('0xb')]=_[_0x9ecc('0xc')](config['redis'],{'host':_0x9ecc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0x9ecc('0xe')](socket);function respondWithRpcPromise(_0x126da9,_0x58202f,_0x212b32){return new BPromise(function(_0x25f0ed,_0x14ddd1){return client[_0x9ecc('0xf')](_0x126da9,_0x212b32)['then'](function(_0x19d165){logger['info'](_0x9ecc('0x10'),_0x58202f,_0x9ecc('0x11'));logger['debug'](_0x9ecc('0x12'),_0x58202f,_0x9ecc('0x11'),JSON['stringify'](_0x19d165));if(_0x19d165[_0x9ecc('0x13')]){if(_0x19d165[_0x9ecc('0x13')][_0x9ecc('0x14')]===0x1f4){logger[_0x9ecc('0x13')](_0x9ecc('0x10'),_0x58202f,_0x19d165[_0x9ecc('0x13')][_0x9ecc('0x15')]);return _0x14ddd1(_0x19d165['error'][_0x9ecc('0x15')]);}logger[_0x9ecc('0x13')](_0x9ecc('0x10'),_0x58202f,_0x19d165[_0x9ecc('0x13')]['message']);return _0x25f0ed(_0x19d165['error'][_0x9ecc('0x15')]);}else{logger['info'](_0x9ecc('0x10'),_0x58202f,'request\x20sent');_0x25f0ed(_0x19d165[_0x9ecc('0x16')][_0x9ecc('0x15')]);}})[_0x9ecc('0x17')](function(_0x6dad9f){logger[_0x9ecc('0x13')]('UserNotification,\x20%s,\x20%s',_0x58202f,_0x6dad9f);_0x14ddd1(_0x6dad9f);});});}
\ No newline at end of file
+var _0x670d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x670d,0xa0));var _0xd670=function(_0x4e15e0,_0x32df04){_0x4e15e0=_0x4e15e0-0x0;var _0x93a82d=_0x670d[_0x4e15e0];return _0x93a82d;};'use strict';var _=require(_0xd670('0x0'));var util=require(_0xd670('0x1'));var moment=require(_0xd670('0x2'));var BPromise=require('bluebird');var rs=require(_0xd670('0x3'));var fs=require('fs');var Redis=require(_0xd670('0x4'));var db=require(_0xd670('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd670('0x6'))(_0xd670('0x7'));var config=require(_0xd670('0x8'));var jayson=require(_0xd670('0x9'));var client=jayson[_0xd670('0xa')][_0xd670('0xb')]({'port':0x232a});config[_0xd670('0xc')]=_[_0xd670('0xd')](config[_0xd670('0xc')],{'host':_0xd670('0xe'),'port':0x18eb});var socket=require(_0xd670('0xf'))(new Redis(config['redis']));require(_0xd670('0x10'))[_0xd670('0x11')](socket);function respondWithRpcPromise(_0x5c969b,_0x551005,_0x71e9be){return new BPromise(function(_0x20dc18,_0x54d98c){return client[_0xd670('0x12')](_0x5c969b,_0x71e9be)[_0xd670('0x13')](function(_0x594201){logger[_0xd670('0x14')](_0xd670('0x15'),_0x551005,_0xd670('0x16'));logger[_0xd670('0x17')](_0xd670('0x18'),_0x551005,'request\x20sent',JSON['stringify'](_0x594201));if(_0x594201['error']){if(_0x594201[_0xd670('0x19')][_0xd670('0x1a')]===0x1f4){logger[_0xd670('0x19')](_0xd670('0x15'),_0x551005,_0x594201[_0xd670('0x19')][_0xd670('0x1b')]);return _0x54d98c(_0x594201[_0xd670('0x19')]['message']);}logger[_0xd670('0x19')](_0xd670('0x15'),_0x551005,_0x594201[_0xd670('0x19')][_0xd670('0x1b')]);return _0x20dc18(_0x594201['error'][_0xd670('0x1b')]);}else{logger['info'](_0xd670('0x15'),_0x551005,_0xd670('0x16'));_0x20dc18(_0x594201['result'][_0xd670('0x1b')]);}})['catch'](function(_0x45917f){logger[_0xd670('0x19')](_0xd670('0x15'),_0x551005,_0x45917f);_0x54d98c(_0x45917f);});});}
\ No newline at end of file
index 7321ec4..21d10c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88ae=['emit','removeListener','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x88ae,0x1dc));var _0xe88a=function(_0x3373a2,_0x6abc09){_0x3373a2=_0x3373a2-0x0;var _0x3fed4f=_0x88ae[_0x3373a2];return _0x3fed4f;};'use strict';var UserNotificationEvents=require(_0xe88a('0x0'));var events=[_0xe88a('0x1'),_0xe88a('0x2'),_0xe88a('0x3')];function createListener(_0x4a24c3,_0x33ebe7){return function(_0x517955){_0x33ebe7[_0xe88a('0x4')](_0x4a24c3,_0x517955);};}function removeListener(_0x3dc193,_0x5a9527){return function(){UserNotificationEvents[_0xe88a('0x5')](_0x3dc193,_0x5a9527);};}exports['register']=function(_0x1bed25){for(var _0x1e13de=0x0,_0x27b08f=events[_0xe88a('0x6')];_0x1e13de<_0x27b08f;_0x1e13de++){var _0x356a6d=events[_0x1e13de];var _0xe77116=createListener(_0xe88a('0x7')+_0x356a6d,_0x1bed25);UserNotificationEvents['on'](_0x356a6d,_0xe77116);}};
\ No newline at end of file
+var _0x2931=['userNotification:','./userNotification.events','remove','update','emit','removeListener','register'];(function(_0x4d02ae,_0x539d25){var _0x510a93=function(_0x6c0966){while(--_0x6c0966){_0x4d02ae['push'](_0x4d02ae['shift']());}};_0x510a93(++_0x539d25);}(_0x2931,0x135));var _0x1293=function(_0x1cfded,_0x3fcb25){_0x1cfded=_0x1cfded-0x0;var _0x2ed141=_0x2931[_0x1cfded];return _0x2ed141;};'use strict';var UserNotificationEvents=require(_0x1293('0x0'));var events=['save',_0x1293('0x1'),_0x1293('0x2')];function createListener(_0x2dd175,_0x1c9659){return function(_0x2c27e2){_0x1c9659[_0x1293('0x3')](_0x2dd175,_0x2c27e2);};}function removeListener(_0x1cd904,_0x286a94){return function(){UserNotificationEvents[_0x1293('0x4')](_0x1cd904,_0x286a94);};}exports[_0x1293('0x5')]=function(_0x414258){for(var _0x57a669=0x0,_0x424ae6=events['length'];_0x57a669<_0x424ae6;_0x57a669++){var _0x48a49d=events[_0x57a669];var _0x1b55db=createListener(_0x1293('0x6')+_0x48a49d,_0x414258);UserNotificationEvents['on'](_0x48a49d,_0x1b55db);}};
\ No newline at end of file
index 386ad18..1ab9c5a 100644 (file)
@@ -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(_0x309e52,_0x26c91b){var _0x2797c6=function(_0x1f333f){while(--_0x1f333f){_0x309e52['push'](_0x309e52['shift']());}};_0x2797c6(++_0x26c91b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x336030,_0x4086ea){var _0x2b203b=function(_0x10b0ad){while(--_0x10b0ad){_0x336030['push'](_0x336030['shift']());}};_0x2b203b(++_0x4086ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 270d26c..cea8f93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a8e=['sequelize','exports','INTEGER'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x2a8e,0x156));var _0xe2a8=function(_0x2b7e9c,_0x236531){_0x2b7e9c=_0x2b7e9c-0x0;var _0x39ac82=_0x2a8e[_0x2b7e9c];return _0x39ac82;};'use strict';var Sequelize=require(_0xe2a8('0x0'));module[_0xe2a8('0x1')]={'penalty':{'type':Sequelize[_0xe2a8('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0ef2=['INTEGER','sequelize','exports'];(function(_0x1c36b1,_0x251ea5){var _0x1aefd6=function(_0x1ea5e1){while(--_0x1ea5e1){_0x1c36b1['push'](_0x1c36b1['shift']());}};_0x1aefd6(++_0x251ea5);}(_0x0ef2,0x169));var _0x20ef=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x0ef2[_0x11155f];return _0xd07e48;};'use strict';var Sequelize=require(_0x20ef('0x0'));module[_0x20ef('0x1')]={'penalty':{'type':Sequelize[_0x20ef('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 8c92b06..f2ca3f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb655=['path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x1dda13,_0x7fd35b){var _0x4ecd06=function(_0x2aa386){while(--_0x2aa386){_0x1dda13['push'](_0x1dda13['shift']());}};_0x4ecd06(++_0x7fd35b);}(_0xb655,0x73));var _0x5b65=function(_0x5dc430,_0x506fb5){_0x5dc430=_0x5dc430-0x0;var _0x5b4205=_0xb655[_0x5dc430];return _0x5b4205;};'use strict';var _=require('lodash');var util=require(_0x5b65('0x0'));var logger=require(_0x5b65('0x1'))(_0x5b65('0x2'));var moment=require(_0x5b65('0x3'));var BPromise=require(_0x5b65('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b65('0x5'));var rimraf=require('rimraf');var config=require(_0x5b65('0x6'));var attributes=require(_0x5b65('0x7'));module[_0x5b65('0x8')]=function(_0x3429b1,_0x56f299){return _0x3429b1[_0x5b65('0x9')](_0x5b65('0xa'),attributes,{'tableName':_0x5b65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x601a=['api','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x601a,0x1c9));var _0xa601=function(_0xad523b,_0x387a76){_0xad523b=_0xad523b-0x0;var _0x443c7d=_0x601a[_0xad523b];return _0x443c7d;};'use strict';var _=require('lodash');var util=require(_0xa601('0x0'));var logger=require(_0xa601('0x1'))(_0xa601('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa601('0x3'));var fs=require('fs');var path=require(_0xa601('0x4'));var rimraf=require('rimraf');var config=require(_0xa601('0x5'));var attributes=require(_0xa601('0x6'));module['exports']=function(_0x38b2a8,_0x1b1bd8){return _0x38b2a8['define'](_0xa601('0x7'),attributes,{'tableName':_0xa601('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 479a53d..f2ee52f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce39=['code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x113927,_0x2ae043){var _0x4e633d=function(_0x49e24f){while(--_0x49e24f){_0x113927['push'](_0x113927['shift']());}};_0x4e633d(++_0x2ae043);}(_0xce39,0xd5));var _0x9ce3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xce39[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9ce3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9ce3('0x1'));var rs=require(_0x9ce3('0x2'));var fs=require('fs');var Redis=require(_0x9ce3('0x3'));var db=require(_0x9ce3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ce3('0x5'))(_0x9ce3('0x6'));var config=require(_0x9ce3('0x7'));var jayson=require(_0x9ce3('0x8'));var client=jayson[_0x9ce3('0x9')][_0x9ce3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x127390,_0x5646e4,_0xffabfb){return new BPromise(function(_0x182b19,_0x21c168){return client[_0x9ce3('0xb')](_0x127390,_0xffabfb)[_0x9ce3('0xc')](function(_0x3acfb8){logger[_0x9ce3('0xd')](_0x9ce3('0xe'),_0x5646e4,_0x9ce3('0xf'));logger['debug'](_0x9ce3('0x10'),_0x5646e4,_0x9ce3('0xf'),JSON['stringify'](_0x3acfb8));if(_0x3acfb8[_0x9ce3('0x11')]){if(_0x3acfb8[_0x9ce3('0x11')][_0x9ce3('0x12')]===0x1f4){logger['error'](_0x9ce3('0xe'),_0x5646e4,_0x3acfb8['error'][_0x9ce3('0x13')]);return _0x21c168(_0x3acfb8[_0x9ce3('0x11')][_0x9ce3('0x13')]);}logger[_0x9ce3('0x11')](_0x9ce3('0xe'),_0x5646e4,_0x3acfb8[_0x9ce3('0x11')]['message']);return _0x182b19(_0x3acfb8[_0x9ce3('0x11')][_0x9ce3('0x13')]);}else{logger['info'](_0x9ce3('0xe'),_0x5646e4,'request\x20sent');_0x182b19(_0x3acfb8['result'][_0x9ce3('0x13')]);}})[_0x9ce3('0x14')](function(_0x28f0e0){logger[_0x9ce3('0x11')](_0x9ce3('0xe'),_0x5646e4,_0x28f0e0);_0x21c168(_0x28f0e0);});});}
\ No newline at end of file
+var _0x5dd8=['../../config/logger','../../config/environment','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x5dd8,0x185));var _0x85dd=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x5dd8[_0xd67723];return _0x53b62b;};'use strict';var _=require(_0x85dd('0x0'));var util=require(_0x85dd('0x1'));var moment=require(_0x85dd('0x2'));var BPromise=require(_0x85dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85dd('0x4'));var db=require(_0x85dd('0x5'))['db'];var utils=require(_0x85dd('0x6'));var logger=require(_0x85dd('0x7'))('rpc');var config=require(_0x85dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x85dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea79d,_0x4041b2,_0xb1d65f){return new BPromise(function(_0x40628a,_0x361c80){return client[_0x85dd('0xa')](_0x4ea79d,_0xb1d65f)[_0x85dd('0xb')](function(_0x4747c7){logger[_0x85dd('0xc')](_0x85dd('0xd'),_0x4041b2,_0x85dd('0xe'));logger[_0x85dd('0xf')](_0x85dd('0x10'),_0x4041b2,_0x85dd('0xe'),JSON['stringify'](_0x4747c7));if(_0x4747c7[_0x85dd('0x11')]){if(_0x4747c7[_0x85dd('0x11')][_0x85dd('0x12')]===0x1f4){logger['error'](_0x85dd('0xd'),_0x4041b2,_0x4747c7[_0x85dd('0x11')]['message']);return _0x361c80(_0x4747c7[_0x85dd('0x11')][_0x85dd('0x13')]);}logger[_0x85dd('0x11')](_0x85dd('0xd'),_0x4041b2,_0x4747c7[_0x85dd('0x11')][_0x85dd('0x13')]);return _0x40628a(_0x4747c7['error'][_0x85dd('0x13')]);}else{logger[_0x85dd('0xc')](_0x85dd('0xd'),_0x4041b2,'request\x20sent');_0x40628a(_0x4747c7[_0x85dd('0x14')][_0x85dd('0x13')]);}})[_0x85dd('0x15')](function(_0x44fd07){logger[_0x85dd('0x11')](_0x85dd('0xd'),_0x4041b2,_0x44fd07);_0x361c80(_0x44fd07);});});}
\ No newline at end of file
index 8c92f57..a6beed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebe5=['getSections','/:id/resources','post','/:id/clone','clone','addSections','put','update','delete','destroy','removeSections','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/sections'];(function(_0x4186c3,_0x1c0521){var _0x23ff6c=function(_0x459a01){while(--_0x459a01){_0x4186c3['push'](_0x4186c3['shift']());}};_0x23ff6c(++_0x1c0521);}(_0xebe5,0xc9));var _0x5ebe=function(_0x4c8da0,_0x1da4e4){_0x4c8da0=_0x4c8da0-0x0;var _0x4eb216=_0xebe5[_0x4c8da0];return _0x4eb216;};'use strict';var multer=require('multer');var util=require(_0x5ebe('0x0'));var path=require(_0x5ebe('0x1'));var timeout=require(_0x5ebe('0x2'));var express=require(_0x5ebe('0x3'));var router=express[_0x5ebe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ebe('0x5'));var interaction=require(_0x5ebe('0x6'));var config=require('../../config/environment');var controller=require(_0x5ebe('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5ebe('0x8')](_0x5ebe('0x9'),auth['isAuthenticated'](),controller[_0x5ebe('0xa')]);router['get'](_0x5ebe('0xb'),auth[_0x5ebe('0xc')](),controller[_0x5ebe('0xd')]);router[_0x5ebe('0x8')](_0x5ebe('0xe'),auth[_0x5ebe('0xc')](),controller[_0x5ebe('0xf')]);router[_0x5ebe('0x8')](_0x5ebe('0x10'),auth[_0x5ebe('0xc')](),controller['getResources']);router['post']('/',auth[_0x5ebe('0xc')](),controller['create']);router[_0x5ebe('0x11')](_0x5ebe('0x12'),auth[_0x5ebe('0xc')](),controller[_0x5ebe('0x13')]);router['post'](_0x5ebe('0xe'),auth['isAuthenticated'](),controller[_0x5ebe('0x14')]);router['post'](_0x5ebe('0x10'),auth['isAuthenticated'](),controller['addResources']);router[_0x5ebe('0x15')](_0x5ebe('0xb'),auth[_0x5ebe('0xc')](),controller[_0x5ebe('0x16')]);router[_0x5ebe('0x17')](_0x5ebe('0xb'),auth[_0x5ebe('0xc')](),controller[_0x5ebe('0x18')]);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0x5ebe('0x19')]);router[_0x5ebe('0x17')]('/:id/resources',auth[_0x5ebe('0xc')](),controller['removeResources']);module[_0x5ebe('0x1a')]=router;
\ No newline at end of file
+var _0xfcd2=['post','/:id/clone','/:id/sections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','show','getSections','/:id/resources','getResources','create'];(function(_0x487c9f,_0x518413){var _0x4c821e=function(_0x4ac36e){while(--_0x4ac36e){_0x487c9f['push'](_0x487c9f['shift']());}};_0x4c821e(++_0x518413);}(_0xfcd2,0x191));var _0x2fcd=function(_0x280e50,_0x5a2bf1){_0x280e50=_0x280e50-0x0;var _0x2843c4=_0xfcd2[_0x280e50];return _0x2843c4;};'use strict';var multer=require(_0x2fcd('0x0'));var util=require(_0x2fcd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2fcd('0x2'));var router=express[_0x2fcd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2fcd('0x4'));var interaction=require(_0x2fcd('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x2fcd('0x6')]('/',auth['isAuthenticated'](),controller[_0x2fcd('0x7')]);router['get']('/describe',auth[_0x2fcd('0x8')](),controller['describe']);router[_0x2fcd('0x6')](_0x2fcd('0x9'),auth[_0x2fcd('0x8')](),controller[_0x2fcd('0xa')]);router['get']('/:id/sections',auth[_0x2fcd('0x8')](),controller[_0x2fcd('0xb')]);router['get'](_0x2fcd('0xc'),auth['isAuthenticated'](),controller[_0x2fcd('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2fcd('0xe')]);router[_0x2fcd('0xf')](_0x2fcd('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0x2fcd('0xf')](_0x2fcd('0x11'),auth[_0x2fcd('0x8')](),controller['addSections']);router[_0x2fcd('0xf')](_0x2fcd('0xc'),auth[_0x2fcd('0x8')](),controller[_0x2fcd('0x12')]);router[_0x2fcd('0x13')](_0x2fcd('0x9'),auth[_0x2fcd('0x8')](),controller[_0x2fcd('0x14')]);router[_0x2fcd('0x15')](_0x2fcd('0x9'),auth[_0x2fcd('0x8')](),controller[_0x2fcd('0x16')]);router[_0x2fcd('0x15')](_0x2fcd('0x11'),auth[_0x2fcd('0x8')](),controller[_0x2fcd('0x17')]);router[_0x2fcd('0x15')]('/:id/resources',auth[_0x2fcd('0x8')](),controller[_0x2fcd('0x18')]);module[_0x2fcd('0x19')]=router;
\ No newline at end of file
index a8ca516..301b364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9486=['exports','name','setDataValue','join','getDataValue','crudPermissions','split','STRING','BOOLEAN'];(function(_0x1eaa7a,_0x1fe86d){var _0x5a318e=function(_0x58b46f){while(--_0x58b46f){_0x1eaa7a['push'](_0x1eaa7a['shift']());}};_0x5a318e(++_0x1fe86d);}(_0x9486,0x132));var _0x6948=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9486[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x6948('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6948('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x21c328){this[_0x6948('0x2')]('crudPermissions',_0x21c328?_0x21c328[_0x6948('0x3')](''):[]);},'get':function(){return this[_0x6948('0x4')](_0x6948('0x5'))?this[_0x6948('0x4')]('crudPermissions')[_0x6948('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6948('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6948('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6948('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe24c=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','crudPermissions'];(function(_0x3848c4,_0x18b347){var _0x4e4476=function(_0x376d0b){while(--_0x376d0b){_0x3848c4['push'](_0x3848c4['shift']());}};_0x4e4476(++_0x18b347);}(_0xe24c,0x6c));var _0xce24=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe24c[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xce24('0x0'));module[_0xce24('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xce24('0x2')],'set':function(_0x174a15){this['setDataValue'](_0xce24('0x3'),_0x174a15?_0x174a15['join'](''):[]);},'get':function(){return this[_0xce24('0x4')](_0xce24('0x3'))?this[_0xce24('0x4')](_0xce24('0x3'))[_0xce24('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xce24('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xce24('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xce24('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xce24('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xce24('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xce24('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 1ffc4e9..d24ec30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x104a=['set','Content-Range','apply','save','update','then','stack','name','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','catch','show','params','UserProfile','includeAll','find','create','clone','get','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','each','autoAssociation','omit','userProfileId','Resources','UserProfileResource','destroy','describe','transaction','push','ids','enabled','sectionId','isEmpty','subsections','includes','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x104a,0x128));var _0xa104=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x104a[_0x179e11];return _0x549f04;};'use strict';var emlformat=require(_0xa104('0x0'));var rimraf=require(_0xa104('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa104('0x2'));var rp=require(_0xa104('0x3'));var moment=require('moment');var BPromise=require(_0xa104('0x4'));var Mustache=require(_0xa104('0x5'));var util=require(_0xa104('0x6'));var path=require(_0xa104('0x7'));var sox=require('sox');var csv=require(_0xa104('0x8'));var ejs=require(_0xa104('0x9'));var fs=require('fs');var fs_extra=require(_0xa104('0xa'));var _=require(_0xa104('0xb'));var squel=require(_0xa104('0xc'));var crypto=require(_0xa104('0xd'));var jsforce=require(_0xa104('0xe'));var deskjs=require(_0xa104('0xf'));var toCsv=require(_0xa104('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa104('0x10'));var authService=require(_0xa104('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa104('0x12'));var logger=require(_0xa104('0x13'))('api');var utils=require(_0xa104('0x14'));var config=require(_0xa104('0x15'));var licenseUtil=require(_0xa104('0x16'));var db=require(_0xa104('0x17'))['db'];config[_0xa104('0x18')]=_[_0xa104('0x19')](config[_0xa104('0x18')],{'host':_0xa104('0x1a'),'port':0x18eb});var socket=require(_0xa104('0x1b'))(new Redis(config[_0xa104('0x18')]));require(_0xa104('0x1c'))['register'](socket);function respondWithStatusCode(_0x5a8a7a,_0x331e23){_0x331e23=_0x331e23||0xcc;return function(_0x575e1e){if(_0x575e1e){return _0x5a8a7a[_0xa104('0x1d')](_0x331e23);}return _0x5a8a7a[_0xa104('0x1e')](_0x331e23)[_0xa104('0x1f')]();};}function respondWithResult(_0x18c0e5,_0x35cf88){_0x35cf88=_0x35cf88||0xc8;return function(_0x21ddbb){if(_0x21ddbb){return _0x18c0e5[_0xa104('0x1e')](_0x35cf88)[_0xa104('0x20')](_0x21ddbb);}};}function respondWithFilteredResult(_0x3b64d1,_0x566e05){return function(_0x13438e){if(_0x13438e){var _0x1649a7=typeof _0x566e05[_0xa104('0x21')]==='undefined'&&typeof _0x566e05[_0xa104('0x22')]===_0xa104('0x23');var _0x70f984=_0x13438e['count'];var _0x441375=_0x1649a7?0x0:_0x566e05[_0xa104('0x21')];var _0x5a1f46=_0x1649a7?_0x13438e[_0xa104('0x24')]:_0x566e05[_0xa104('0x21')]+_0x566e05[_0xa104('0x22')];var _0x25779a;if(_0x5a1f46>=_0x70f984){_0x5a1f46=_0x70f984;_0x25779a=0xc8;}else{_0x25779a=0xce;}_0x3b64d1[_0xa104('0x1e')](_0x25779a);return _0x3b64d1[_0xa104('0x25')](_0xa104('0x26'),_0x441375+'-'+_0x5a1f46+'/'+_0x70f984)[_0xa104('0x20')](_0x13438e);}return null;};}function patchUpdates(_0x3db07a){return function(_0x43f295){try{jsonpatch[_0xa104('0x27')](_0x43f295,_0x3db07a,!![]);}catch(_0x5176c9){return BPromise['reject'](_0x5176c9);}return _0x43f295[_0xa104('0x28')]();};}function saveUpdates(_0x10b4ae,_0x153bdb){return function(_0x5945b8){if(_0x5945b8){return _0x5945b8[_0xa104('0x29')](_0x10b4ae)[_0xa104('0x2a')](function(_0x2ba322){return _0x2ba322;});}return null;};}function removeEntity(_0x3c2843,_0x4c610c){return function(_0x3b3900){if(_0x3b3900){return _0x3b3900['destroy']()['then'](function(){_0x3c2843[_0xa104('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe02797,_0x50c26d){return function(_0x3653a6){if(!_0x3653a6){_0xe02797[_0xa104('0x1d')](0x194);}return _0x3653a6;};}function handleError(_0x5841f3,_0x493bd7){_0x493bd7=_0x493bd7||0x1f4;return function(_0x18f61f){logger['error'](_0x18f61f[_0xa104('0x2b')]);if(_0x18f61f[_0xa104('0x2c')]){delete _0x18f61f[_0xa104('0x2c')];}_0x5841f3['status'](_0x493bd7)['send'](_0x18f61f);};}exports['index']=function(_0xd9c546,_0x46935b){var _0x2e71b4={},_0x47aa33={},_0x554cf7={'count':0x0,'rows':[]};var _0x5cc821=_[_0xa104('0x2d')](db['UserProfile'][_0xa104('0x2e')],function(_0x3a0765){return{'name':_0x3a0765['fieldName'],'type':_0x3a0765[_0xa104('0x2f')][_0xa104('0x30')]};});_0x47aa33['model']=_[_0xa104('0x2d')](_0x5cc821,_0xa104('0x2c'));_0x47aa33[_0xa104('0x31')]=_[_0xa104('0x32')](_0xd9c546[_0xa104('0x31')]);_0x47aa33[_0xa104('0x33')]=_[_0xa104('0x34')](_0x47aa33[_0xa104('0x35')],_0x47aa33[_0xa104('0x31')]);_0x2e71b4[_0xa104('0x36')]=_[_0xa104('0x34')](_0x47aa33[_0xa104('0x35')],qs[_0xa104('0x37')](_0xd9c546[_0xa104('0x31')]['fields']));_0x2e71b4['attributes']=_0x2e71b4['attributes'][_0xa104('0x38')]?_0x2e71b4[_0xa104('0x36')]:_0x47aa33[_0xa104('0x35')];if(!_0xd9c546[_0xa104('0x31')][_0xa104('0x39')](_0xa104('0x3a'))){_0x2e71b4[_0xa104('0x22')]=qs['limit'](_0xd9c546[_0xa104('0x31')][_0xa104('0x22')]);_0x2e71b4[_0xa104('0x21')]=qs[_0xa104('0x21')](_0xd9c546[_0xa104('0x31')][_0xa104('0x21')]);}_0x2e71b4[_0xa104('0x3b')]=qs[_0xa104('0x3c')](_0xd9c546[_0xa104('0x31')][_0xa104('0x3c')]);_0x2e71b4['where']=qs[_0xa104('0x33')](_['pick'](_0xd9c546['query'],_0x47aa33['filters']),_0x5cc821);if(_0xd9c546[_0xa104('0x31')][_0xa104('0x3d')]){_0x2e71b4[_0xa104('0x3e')]=_[_0xa104('0x3f')](_0x2e71b4[_0xa104('0x3e')],{'$or':_[_0xa104('0x2d')](_0x5cc821,function(_0x861553){if(_0x861553['type']!=='VIRTUAL'){var _0x738964={};_0x738964[_0x861553['name']]={'$like':'%'+_0xd9c546[_0xa104('0x31')][_0xa104('0x3d')]+'%'};return _0x738964;}})});}_0x2e71b4=_[_0xa104('0x3f')]({},_0x2e71b4,_0xd9c546[_0xa104('0x40')]);var _0x1e0061={'where':_0x2e71b4[_0xa104('0x3e')]};return db['UserProfile']['count'](_0x1e0061)[_0xa104('0x2a')](function(_0x3e3a7a){_0x554cf7[_0xa104('0x24')]=_0x3e3a7a;if(_0xd9c546[_0xa104('0x31')]['includeAll']){_0x2e71b4[_0xa104('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0xa104('0x42')](_0x2e71b4);})[_0xa104('0x2a')](function(_0x4bba24){_0x554cf7[_0xa104('0x43')]=_0x4bba24;return _0x554cf7;})[_0xa104('0x2a')](respondWithFilteredResult(_0x46935b,_0x2e71b4))[_0xa104('0x44')](handleError(_0x46935b,null));};exports[_0xa104('0x45')]=function(_0x192c19,_0x28b434){var _0x34ae49={'raw':![],'where':{'id':_0x192c19[_0xa104('0x46')]['id']}},_0x4a7190={};_0x4a7190['model']=_[_0xa104('0x32')](db[_0xa104('0x47')]['rawAttributes']);_0x4a7190[_0xa104('0x31')]=_[_0xa104('0x32')](_0x192c19[_0xa104('0x31')]);_0x4a7190[_0xa104('0x33')]=_[_0xa104('0x34')](_0x4a7190[_0xa104('0x35')],_0x4a7190[_0xa104('0x31')]);_0x34ae49['attributes']=_[_0xa104('0x34')](_0x4a7190['model'],qs['fields'](_0x192c19[_0xa104('0x31')][_0xa104('0x37')]));_0x34ae49[_0xa104('0x36')]=_0x34ae49[_0xa104('0x36')][_0xa104('0x38')]?_0x34ae49[_0xa104('0x36')]:_0x4a7190[_0xa104('0x35')];if(_0x192c19[_0xa104('0x31')][_0xa104('0x48')]){_0x34ae49[_0xa104('0x41')]=[{'all':!![]}];}_0x34ae49=_[_0xa104('0x3f')]({},_0x34ae49,_0x192c19[_0xa104('0x40')]);return db['UserProfile'][_0xa104('0x49')](_0x34ae49)['then'](handleEntityNotFound(_0x28b434,null))[_0xa104('0x2a')](respondWithResult(_0x28b434,null))[_0xa104('0x44')](handleError(_0x28b434,null));};exports[_0xa104('0x4a')]=function(_0xede58b,_0x10c1c1){return db[_0xa104('0x47')][_0xa104('0x4a')](_0xede58b['body'],{})['then'](respondWithResult(_0x10c1c1,0xc9))[_0xa104('0x44')](handleError(_0x10c1c1,null));};exports[_0xa104('0x4b')]=function(_0x2dabd8,_0x5c9c29){var _0x2624d1={'where':{'id':_0x2dabd8[_0xa104('0x46')]['id']}},_0x27506d={};_0x27506d['model']=_[_0xa104('0x32')](db[_0xa104('0x47')][_0xa104('0x2e')]);_0x2624d1['attributes']=_['intersection'](_0x27506d[_0xa104('0x35')],qs[_0xa104('0x37')](_0x2dabd8[_0xa104('0x31')]['fields']));_0x2624d1[_0xa104('0x36')]=_0x2624d1['attributes'][_0xa104('0x38')]?_0x2624d1['attributes']:_0x27506d[_0xa104('0x35')];if(_0x2dabd8[_0xa104('0x31')][_0xa104('0x48')]){_0x2624d1[_0xa104('0x41')]=[{'all':!![]}];}_0x2624d1=_['merge']({},_0x2624d1,_0x2dabd8[_0xa104('0x40')]);return db[_0xa104('0x47')][_0xa104('0x49')](_0x2624d1)['then'](handleEntityNotFound(_0x5c9c29,null))['then'](function(_0x3a85bf){if(_0x3a85bf){var _0x4efa83=_0x3a85bf[_0xa104('0x4c')]({'plain':!![]});_0x4efa83=qs['omit'](_0x4efa83,['id',_0xa104('0x4d'),_0xa104('0x4e'),_0xa104('0x4f')]);_0x2dabd8[_0xa104('0x50')]=_['omit'](_0x2dabd8[_0xa104('0x50')],['id',_0xa104('0x4d'),'updatedAt']);return db[_0xa104('0x51')]['transaction'](function(_0x218e91){return db[_0xa104('0x47')][_0xa104('0x4a')](_[_0xa104('0x3f')](_0x4efa83,_0x2dabd8['body']),{'include':_0x2dabd8['query'][_0xa104('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x218e91})[_0xa104('0x2a')](function(_0x109af1){var _0x5b0f81=_0x109af1[_0xa104('0x4c')]({'plain':!![]});return db[_0xa104('0x52')][_0xa104('0x42')]({'where':{'userProfileId':_0x2dabd8['params']['id']},'raw':!![]})[_0xa104('0x2a')](function(_0x2f2405){if(_0x2f2405){return BPromise[_0xa104('0x53')](_0x2f2405,function(_0x38dafe){return new BPromise(function(_0x1ec07c,_0x4d4962){if(_0x38dafe[_0xa104('0x54')]===null||_0x38dafe[_0xa104('0x54')]===0x1)_0x1ec07c(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x38dafe['id']},'raw':!![]})[_0xa104('0x2a')](function(_0x82e263){var _0x2d2292=_[_0xa104('0x2d')](_0x82e263,function(_0x384f5e){return qs[_0xa104('0x55')](_0x384f5e,['id',_0xa104('0x4d'),_0xa104('0x4e'),'sectionId']);});_0x1ec07c(_0x2d2292);})['catch'](function(_0x52cea2){_0x4d4962(_0x52cea2);});})[_0xa104('0x2a')](function(_0x56241d){var _0x30a350=qs[_0xa104('0x55')](_0x38dafe,['id','createdAt',_0xa104('0x4e')]);_0x30a350[_0xa104('0x56')]=_0x5b0f81['id'];if(_0x56241d)_0x30a350[_0xa104('0x57')]=_0x56241d;return _0x30a350;})['then'](function(_0x4e3038){return db[_0xa104('0x52')][_0xa104('0x4a')](_0x4e3038,{'include':[{'model':db[_0xa104('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x218e91});});})[_0xa104('0x2a')](function(){return _0x5b0f81;});}});});});}})[_0xa104('0x2a')](respondWithResult(_0x5c9c29,0xc9))[_0xa104('0x44')](handleError(_0x5c9c29,null));};exports[_0xa104('0x29')]=function(_0x2027d0,_0x23e09f){if(_0x2027d0['body']['id']){delete _0x2027d0[_0xa104('0x50')]['id'];}return db[_0xa104('0x47')][_0xa104('0x49')]({'where':{'id':_0x2027d0[_0xa104('0x46')]['id']}})[_0xa104('0x2a')](handleEntityNotFound(_0x23e09f,null))[_0xa104('0x2a')](saveUpdates(_0x2027d0[_0xa104('0x50')],null))[_0xa104('0x2a')](respondWithResult(_0x23e09f,null))['catch'](handleError(_0x23e09f,null));};exports[_0xa104('0x59')]=function(_0x1f825b,_0x49f13d){return db[_0xa104('0x47')]['find']({'where':{'id':_0x1f825b['params']['id']}})[_0xa104('0x2a')](handleEntityNotFound(_0x49f13d,null))['then'](removeEntity(_0x49f13d,null))[_0xa104('0x44')](handleError(_0x49f13d,null));};exports[_0xa104('0x5a')]=function(_0x2876b8,_0x3e7d6e){return db[_0xa104('0x47')]['describe']()[_0xa104('0x2a')](respondWithResult(_0x3e7d6e,null))[_0xa104('0x44')](handleError(_0x3e7d6e,null));};exports['addSections']=function(_0x46d303,_0x14838c){var _0x12bf09=_0x46d303['body'];return db[_0xa104('0x47')][_0xa104('0x49')]({'where':{'id':_0x46d303[_0xa104('0x46')]['id']}})[_0xa104('0x2a')](handleEntityNotFound(_0x14838c,null))[_0xa104('0x2a')](function(_0x2257d6){if(_0x2257d6){return db[_0xa104('0x51')][_0xa104('0x5b')](function(_0x4495c5){return db[_0xa104('0x52')][_0xa104('0x59')]({'where':{'userProfileId':_0x46d303[_0xa104('0x46')]['id'],'sectionId':_[_0xa104('0x2d')](_0x12bf09,function(_0x36428f){return _0x36428f['sectionId'];})},'transaction':_0x4495c5})[_0xa104('0x2a')](function(){var _0x55c5e8=_['map'](_0x12bf09,function(_0x36d632){_0x36d632[_0xa104('0x56')]=_0x46d303[_0xa104('0x46')]['id'];return _0x36d632;});var _0x38ee95=[];return BPromise[_0xa104('0x53')](_0x55c5e8,function(_0x13cd58){return db[_0xa104('0x52')]['create'](_0x13cd58,{'include':[{'model':db[_0xa104('0x58')],'as':_0xa104('0x57')}],'raw':!![],'transaction':_0x4495c5})[_0xa104('0x2a')](function(_0x382563){_0x38ee95[_0xa104('0x5c')](_0x382563[_0xa104('0x4c')]({'plain':!![]}));});})[_0xa104('0x2a')](function(){return _0x38ee95;});});});}})[_0xa104('0x2a')](function(_0x3248be){return _0x3248be;})[_0xa104('0x2a')](respondWithResult(_0x14838c,null))[_0xa104('0x44')](handleError(_0x14838c,null));};exports['removeSections']=function(_0x2e334b,_0x1812e4){var _0x159aa1;return db[_0xa104('0x47')]['find']({'where':{'id':_0x2e334b[_0xa104('0x46')]['id']},'attributes':['id',_0xa104('0x2c')]})[_0xa104('0x2a')](handleEntityNotFound(_0x1812e4,null))[_0xa104('0x2a')](function(_0x3e22e2){if(_0x3e22e2){_0x159aa1=_0x3e22e2;return db['UserProfileSection'][_0xa104('0x59')]({'where':{'userProfileId':_0x2e334b[_0xa104('0x46')]['id'],'sectionId':_0x2e334b[_0xa104('0x31')][_0xa104('0x5d')]}});}})[_0xa104('0x2a')](function(){return _0x159aa1;})['then'](respondWithStatusCode(_0x1812e4,null))['catch'](handleError(_0x1812e4,null));};exports['getSections']=function(_0x272356,_0x48955b){var _0x310cac=[];var _0x154d5e=[];return db['UserProfileSection'][_0xa104('0x42')]({'where':{'userProfileId':_0x272356[_0xa104('0x46')]['id']},'raw':!![]})['then'](function(_0xced864){_0x310cac=_[_0xa104('0x3d')](_0xced864,function(_0xf77250){return _0xf77250[_0xa104('0x5e')]===0x1||_['includes']([0x3eb,0x709],_0xf77250[_0xa104('0x5f')]);});if(!_[_0xa104('0x60')](_0x310cac)){return _[_0xa104('0x2d')](_0x310cac,function(_0x58677f){return _0x58677f[_0xa104('0x5f')];});}else{return;}})[_0xa104('0x2a')](function(_0x3a9417){if(_0x3a9417)_0x154d5e=_0x3a9417;if(_['includes'](_0x154d5e,0x64)){var _0x251df3=_[_0xa104('0x49')](_0x310cac,{'sectionId':0x64});return hasDefaultDashboard(_0x251df3)[_0xa104('0x2a')](function(_0x1c65bd){return _['map'](_0x310cac,function(_0x4bf3cf){if(_0x4bf3cf[_0xa104('0x5f')]===0x64){_0x4bf3cf[_0xa104('0x61')]=_0x1c65bd;}return _0x4bf3cf;});});}else{return;}})['then'](function(_0x20a478){if(_0x20a478)_0x310cac=_0x20a478;if(_[_0xa104('0x62')](_0x154d5e,0x3eb)){var _0x307231=_[_0xa104('0x49')](_0x310cac,{'sectionId':0x3eb});return getCustomDashboards(_0x307231)['then'](function(_0x328426){return _['map'](_0x310cac,function(_0x1be525){if(_0x307231[_0xa104('0x5e')]){if(_0x1be525[_0xa104('0x5f')]===0x3eb){_0x1be525['subsections']=_0x328426;}}else{if(_0x1be525[_0xa104('0x5f')]===0x64){if(!_0x1be525['subsections']){_0x1be525[_0xa104('0x61')]=[];}_0x1be525[_0xa104('0x61')]=_0x1be525[_0xa104('0x61')][_0xa104('0x63')](_0x328426);}}return _0x1be525;});});}else{return;}})['then'](function(_0x4a971e){if(_0x4a971e)_0x310cac=_0x4a971e;if(_[_0xa104('0x62')](_0x154d5e,0x709)){var _0xacee9=_[_0xa104('0x49')](_0x310cac,{'sectionId':0x709});return getPlugins(_0xacee9)[_0xa104('0x2a')](function(_0xb20ec7){if(_0xacee9['enabled']){return _['map'](_0x310cac,function(_0x111de2){if(_0x111de2[_0xa104('0x5f')]===0x709){_0x111de2[_0xa104('0x61')]=_0xb20ec7;}return _0x111de2;});}else{var _0x2fee59={'sectionId':0x76c,'enabled':0x1,'subsections':_0xb20ec7};var _0x2d3982=_[_0xa104('0x2d')](_0x310cac);_0x2d3982[_0xa104('0x5c')](_0x2fee59);return _0x2d3982;}});}else{return;}})[_0xa104('0x2a')](function(_0x2cef17){if(_0x2cef17)_0x310cac=_0x2cef17;return _['filter'](_0x310cac,['enabled',0x1]);})[_0xa104('0x2a')](respondWithResult(_0x48955b,null))[_0xa104('0x44')](handleError(_0x48955b,null));};function hasDefaultDashboard(_0x57d625){var _0x1d895f=[0x65];return new BPromise(function(_0xa22bde,_0x4e01dc){try{if(_0x57d625['autoAssociation']){_0xa22bde(_0x1d895f);}else{return db[_0xa104('0x58')][_0xa104('0x64')]({'where':{'sectionId':_0x57d625['id']},'raw':!![]})[_0xa104('0x2a')](function(_0x3f96a4){_0x3f96a4?_0xa22bde(_0x1d895f):_0xa22bde();});}}catch(_0x3f44ad){_0x4e01dc(_0x3f44ad);}});}function getCustomDashboards(_0x5e050a){var _0x5a2af4=[];return new BPromise(function(_0x33b946,_0x59c599){try{if(_0x5e050a[_0xa104('0x54')]){return db['Dashboard'][_0xa104('0x42')]({'raw':!![]})[_0xa104('0x2a')](function(_0x5609df){_0x5609df[_0xa104('0x65')](function(_0x3144e0){_0x5a2af4[_0xa104('0x5c')](_0x3144e0['id']+0x1869f);});_0x33b946(_0x5a2af4);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5e050a['id']},'raw':!![]})['then'](function(_0x1b2d8d){_0x1b2d8d[_0xa104('0x65')](function(_0x117aa8){_0x5a2af4[_0xa104('0x5c')](_0x117aa8[_0xa104('0x66')]+0x1869f);});_0x33b946(_0x5a2af4);});}}catch(_0x267dae){_0x59c599(_0x267dae);}});}function getPlugins(_0x1ac96f){var _0x3e655d=[];return new BPromise(function(_0x3d0e89,_0x119d3c){try{if(_0x1ac96f[_0xa104('0x54')]){return db[_0xa104('0x67')][_0xa104('0x42')]({'raw':!![]})['then'](function(_0x1bf1ad){_0x1bf1ad[_0xa104('0x65')](function(_0x1a92cd){_0x3e655d[_0xa104('0x5c')](_0x1a92cd['id']+0x15b38);});_0x3d0e89(_0x3e655d);});}else{return db[_0xa104('0x58')]['findAll']({'where':{'sectionId':_0x1ac96f['id']},'raw':!![]})[_0xa104('0x2a')](function(_0x109c8c){_0x109c8c[_0xa104('0x65')](function(_0x17aa29){_0x3e655d['push'](_0x17aa29[_0xa104('0x66')]+0x15b38);});_0x3d0e89(_0x3e655d);});}}catch(_0x5336bb){_0x119d3c(_0x5336bb);}});}exports[_0xa104('0x68')]=function(_0x2e0ee2,_0x592d21){return db[_0xa104('0x47')][_0xa104('0x49')]({'where':{'id':_0x2e0ee2[_0xa104('0x46')]['id']}})['then'](handleEntityNotFound(_0x592d21,null))['then'](function(_0x1de31b){if(_0x1de31b){return db['sequelize']['transaction'](function(_0x4064a2){return db[_0xa104('0x52')][_0xa104('0x42')]({'where':{'userProfileId':_0x2e0ee2[_0xa104('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0xa104('0x2a')](function(_0x26866a){if(_0x26866a){return db[_0xa104('0x52')][_0xa104('0x59')]({'where':{'userProfileId':_0x2e0ee2[_0xa104('0x46')]['id'],'id':_[_0xa104('0x2d')](_0x26866a,function(_0xc36282){return _0xc36282['id'];})},'transaction':_0x4064a2});}})['then'](function(_0x104574){var _0x4a39cd=_[_0xa104('0x2d')](_0x2e0ee2['body'],function(_0x53999e){_0x53999e[_0xa104('0x56')]=_0x2e0ee2[_0xa104('0x46')]['id'];return _0x53999e;});return db[_0xa104('0x52')][_0xa104('0x69')](_0x4a39cd,{'raw':!![],'transaction':_0x4064a2});})[_0xa104('0x2a')](function(_0x531b11){var _0x1f67c8=_['filter'](_[_0xa104('0x2d')](_0x531b11,function(_0x50e9ca){return _0x50e9ca[_0xa104('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x1f67c8){return db[_0xa104('0x52')][_0xa104('0x42')]({'where':{'userProfileId':_0x2e0ee2[_0xa104('0x46')]['id'],'sectionId':_[_0xa104('0x2d')](_0x1f67c8,function(_0x3f543a){return _0x3f543a[_0xa104('0x5f')];})},'attributes':['id',_0xa104('0x5f')],'raw':!![]})['then'](function(_0x5399d4){var _0x287b26=_['map'](_0x2e0ee2[_0xa104('0x50')],function(_0x3117cf){_0x3117cf[_0xa104('0x56')]=_0x2e0ee2['params']['id'];return _0x3117cf;});return db[_0xa104('0x58')][_0xa104('0x69')](_0x287b26,{'raw':!![],'transaction':_0x4064a2});});}})[_0xa104('0x44')](handleError(_0x592d21,null));});}})[_0xa104('0x2a')](function(_0x18210e){var _0x6eb988=_[_0xa104('0x2d')](_0x18210e,function(_0xd51dfa){return _0xd51dfa[_0xa104('0x4c')]({'plain':!![]});});})['then'](respondWithResult(_0x592d21,null))['catch'](handleError(_0x592d21,null));};exports[_0xa104('0x6a')]=function(_0x5a9305,_0x41bda6,_0x6a30d){return db[_0xa104('0x47')]['find']({'where':{'id':_0x5a9305[_0xa104('0x46')]['id']}})[_0xa104('0x2a')](handleEntityNotFound(_0x41bda6,null))[_0xa104('0x2a')](function(_0x58c060){if(_0x58c060){return _0x58c060[_0xa104('0x6a')](_0x5a9305['query']['ids']);}})[_0xa104('0x2a')](respondWithStatusCode(_0x41bda6,null))['catch'](handleError(_0x41bda6,null));};exports[_0xa104('0x6b')]=function(_0x2a0493,_0xd04ce4){var _0x57d174={};if(!_0x2a0493['query'][_0xa104('0x6c')])throw new Error(_0xa104('0x6d'));if(!_0x2a0493[_0xa104('0x31')][_0xa104('0x39')](_0xa104('0x3a'))){_0x57d174[_0xa104('0x22')]=qs[_0xa104('0x22')](_0x2a0493[_0xa104('0x31')][_0xa104('0x22')]);_0x57d174[_0xa104('0x21')]=qs['offset'](_0x2a0493[_0xa104('0x31')][_0xa104('0x21')]);}return db[_0xa104('0x47')][_0xa104('0x49')]({'where':{'id':_0x2a0493[_0xa104('0x46')]['id']}})[_0xa104('0x2a')](function(_0x547c15){if(!_0x547c15)throw new Error(_0xa104('0x6e')+_0x2a0493[_0xa104('0x46')]['id']);return db[_0xa104('0x47')]['getResources'](_0x2a0493);})['then'](respondWithFilteredResult(_0xd04ce4,_0x57d174))[_0xa104('0x44')](handleError(_0xd04ce4,null));};
\ No newline at end of file
+var _0xf4e9=['sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','get','omit','updatedAt','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sectionId','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','getResources','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x512b33,_0x106445){var _0x20bc41=function(_0x16c861){while(--_0x16c861){_0x512b33['push'](_0x512b33['shift']());}};_0x20bc41(++_0x106445);}(_0xf4e9,0xc8));var _0x9f4e=function(_0x2910c7,_0x4adc50){_0x2910c7=_0x2910c7-0x0;var _0xa2c848=_0xf4e9[_0x2910c7];return _0xa2c848;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f4e('0x0'));var zipdir=require(_0x9f4e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4e('0x2'));var moment=require(_0x9f4e('0x3'));var BPromise=require(_0x9f4e('0x4'));var Mustache=require(_0x9f4e('0x5'));var util=require(_0x9f4e('0x6'));var path=require(_0x9f4e('0x7'));var sox=require(_0x9f4e('0x8'));var csv=require(_0x9f4e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f4e('0xa'));var _=require(_0x9f4e('0xb'));var squel=require(_0x9f4e('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f4e('0xd'));var deskjs=require(_0x9f4e('0xe'));var toCsv=require(_0x9f4e('0x9'));var querystring=require(_0x9f4e('0xf'));var Papa=require(_0x9f4e('0x10'));var Redis=require(_0x9f4e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f4e('0x12'));var as=require(_0x9f4e('0x13'));var hardwareService=require(_0x9f4e('0x14'));var logger=require('../../config/logger')(_0x9f4e('0x15'));var utils=require(_0x9f4e('0x16'));var config=require(_0x9f4e('0x17'));var licenseUtil=require(_0x9f4e('0x18'));var db=require(_0x9f4e('0x19'))['db'];config[_0x9f4e('0x1a')]=_['defaults'](config[_0x9f4e('0x1a')],{'host':_0x9f4e('0x1b'),'port':0x18eb});var socket=require(_0x9f4e('0x1c'))(new Redis(config[_0x9f4e('0x1a')]));require('./userProfile.socket')[_0x9f4e('0x1d')](socket);function respondWithStatusCode(_0x2aeff0,_0x4262cd){_0x4262cd=_0x4262cd||0xcc;return function(_0xa8cd6d){if(_0xa8cd6d){return _0x2aeff0[_0x9f4e('0x1e')](_0x4262cd);}return _0x2aeff0[_0x9f4e('0x1f')](_0x4262cd)['end']();};}function respondWithResult(_0x19be97,_0x1a367a){_0x1a367a=_0x1a367a||0xc8;return function(_0x13c9d8){if(_0x13c9d8){return _0x19be97[_0x9f4e('0x1f')](_0x1a367a)[_0x9f4e('0x20')](_0x13c9d8);}};}function respondWithFilteredResult(_0x24172f,_0x108f15){return function(_0xa896f2){if(_0xa896f2){var _0x4f8d4e=typeof _0x108f15[_0x9f4e('0x21')]===_0x9f4e('0x22')&&typeof _0x108f15['limit']==='undefined';var _0x5b514a=_0xa896f2[_0x9f4e('0x23')];var _0x58f0e4=_0x4f8d4e?0x0:_0x108f15[_0x9f4e('0x21')];var _0x37c9a0=_0x4f8d4e?_0xa896f2[_0x9f4e('0x23')]:_0x108f15['offset']+_0x108f15[_0x9f4e('0x24')];var _0x21c56e;if(_0x37c9a0>=_0x5b514a){_0x37c9a0=_0x5b514a;_0x21c56e=0xc8;}else{_0x21c56e=0xce;}_0x24172f[_0x9f4e('0x1f')](_0x21c56e);return _0x24172f['set'](_0x9f4e('0x25'),_0x58f0e4+'-'+_0x37c9a0+'/'+_0x5b514a)[_0x9f4e('0x20')](_0xa896f2);}return null;};}function patchUpdates(_0xb31900){return function(_0x56a501){try{jsonpatch[_0x9f4e('0x26')](_0x56a501,_0xb31900,!![]);}catch(_0x2ea7fb){return BPromise['reject'](_0x2ea7fb);}return _0x56a501[_0x9f4e('0x27')]();};}function saveUpdates(_0x26a4a9,_0xa4714a){return function(_0x432986){if(_0x432986){return _0x432986[_0x9f4e('0x28')](_0x26a4a9)[_0x9f4e('0x29')](function(_0x5eb234){return _0x5eb234;});}return null;};}function removeEntity(_0xf0a1c5,_0xfbccab){return function(_0x481a88){if(_0x481a88){return _0x481a88[_0x9f4e('0x2a')]()[_0x9f4e('0x29')](function(){_0xf0a1c5['status'](0xcc)[_0x9f4e('0x2b')]();});}};}function handleEntityNotFound(_0x5f26f4,_0x16c162){return function(_0x7b1584){if(!_0x7b1584){_0x5f26f4[_0x9f4e('0x1e')](0x194);}return _0x7b1584;};}function handleError(_0x4199a8,_0x51f63c){_0x51f63c=_0x51f63c||0x1f4;return function(_0x399831){logger[_0x9f4e('0x2c')](_0x399831[_0x9f4e('0x2d')]);if(_0x399831[_0x9f4e('0x2e')]){delete _0x399831[_0x9f4e('0x2e')];}_0x4199a8[_0x9f4e('0x1f')](_0x51f63c)[_0x9f4e('0x2f')](_0x399831);};}exports['index']=function(_0x58a55c,_0x1260cf){var _0x341a90={},_0x42775b={},_0x46a18f={'count':0x0,'rows':[]};var _0x771ac0=_[_0x9f4e('0x30')](db[_0x9f4e('0x31')][_0x9f4e('0x32')],function(_0x49c365){return{'name':_0x49c365[_0x9f4e('0x33')],'type':_0x49c365['type'][_0x9f4e('0x34')]};});_0x42775b[_0x9f4e('0x35')]=_['map'](_0x771ac0,_0x9f4e('0x2e'));_0x42775b[_0x9f4e('0x36')]=_['keys'](_0x58a55c[_0x9f4e('0x36')]);_0x42775b[_0x9f4e('0x37')]=_[_0x9f4e('0x38')](_0x42775b[_0x9f4e('0x35')],_0x42775b[_0x9f4e('0x36')]);_0x341a90['attributes']=_[_0x9f4e('0x38')](_0x42775b[_0x9f4e('0x35')],qs[_0x9f4e('0x39')](_0x58a55c[_0x9f4e('0x36')][_0x9f4e('0x39')]));_0x341a90[_0x9f4e('0x3a')]=_0x341a90['attributes'][_0x9f4e('0x3b')]?_0x341a90[_0x9f4e('0x3a')]:_0x42775b[_0x9f4e('0x35')];if(!_0x58a55c[_0x9f4e('0x36')]['hasOwnProperty'](_0x9f4e('0x3c'))){_0x341a90[_0x9f4e('0x24')]=qs[_0x9f4e('0x24')](_0x58a55c[_0x9f4e('0x36')][_0x9f4e('0x24')]);_0x341a90[_0x9f4e('0x21')]=qs[_0x9f4e('0x21')](_0x58a55c['query'][_0x9f4e('0x21')]);}_0x341a90[_0x9f4e('0x3d')]=qs[_0x9f4e('0x3e')](_0x58a55c['query'][_0x9f4e('0x3e')]);_0x341a90[_0x9f4e('0x3f')]=qs[_0x9f4e('0x37')](_[_0x9f4e('0x40')](_0x58a55c[_0x9f4e('0x36')],_0x42775b[_0x9f4e('0x37')]),_0x771ac0);if(_0x58a55c[_0x9f4e('0x36')][_0x9f4e('0x41')]){_0x341a90[_0x9f4e('0x3f')]=_[_0x9f4e('0x42')](_0x341a90[_0x9f4e('0x3f')],{'$or':_[_0x9f4e('0x30')](_0x771ac0,function(_0x51dd64){if(_0x51dd64[_0x9f4e('0x43')]!==_0x9f4e('0x44')){var _0x1f3167={};_0x1f3167[_0x51dd64[_0x9f4e('0x2e')]]={'$like':'%'+_0x58a55c[_0x9f4e('0x36')][_0x9f4e('0x41')]+'%'};return _0x1f3167;}})});}_0x341a90=_['merge']({},_0x341a90,_0x58a55c[_0x9f4e('0x45')]);var _0xd788cb={'where':_0x341a90[_0x9f4e('0x3f')]};return db[_0x9f4e('0x31')][_0x9f4e('0x23')](_0xd788cb)['then'](function(_0x3c3ca0){_0x46a18f[_0x9f4e('0x23')]=_0x3c3ca0;if(_0x58a55c[_0x9f4e('0x36')]['includeAll']){_0x341a90['include']=[{'all':!![]}];}return db['UserProfile'][_0x9f4e('0x46')](_0x341a90);})[_0x9f4e('0x29')](function(_0x1d653f){_0x46a18f[_0x9f4e('0x47')]=_0x1d653f;return _0x46a18f;})['then'](respondWithFilteredResult(_0x1260cf,_0x341a90))[_0x9f4e('0x48')](handleError(_0x1260cf,null));};exports[_0x9f4e('0x49')]=function(_0x2b49b2,_0x490788){var _0x30f764={'raw':![],'where':{'id':_0x2b49b2['params']['id']}},_0x1471c0={};_0x1471c0[_0x9f4e('0x35')]=_[_0x9f4e('0x4a')](db['UserProfile'][_0x9f4e('0x32')]);_0x1471c0[_0x9f4e('0x36')]=_[_0x9f4e('0x4a')](_0x2b49b2['query']);_0x1471c0[_0x9f4e('0x37')]=_[_0x9f4e('0x38')](_0x1471c0[_0x9f4e('0x35')],_0x1471c0[_0x9f4e('0x36')]);_0x30f764[_0x9f4e('0x3a')]=_['intersection'](_0x1471c0['model'],qs[_0x9f4e('0x39')](_0x2b49b2[_0x9f4e('0x36')][_0x9f4e('0x39')]));_0x30f764['attributes']=_0x30f764[_0x9f4e('0x3a')][_0x9f4e('0x3b')]?_0x30f764[_0x9f4e('0x3a')]:_0x1471c0[_0x9f4e('0x35')];if(_0x2b49b2[_0x9f4e('0x36')][_0x9f4e('0x4b')]){_0x30f764[_0x9f4e('0x4c')]=[{'all':!![]}];}_0x30f764=_[_0x9f4e('0x42')]({},_0x30f764,_0x2b49b2[_0x9f4e('0x45')]);return db[_0x9f4e('0x31')][_0x9f4e('0x4d')](_0x30f764)[_0x9f4e('0x29')](handleEntityNotFound(_0x490788,null))[_0x9f4e('0x29')](respondWithResult(_0x490788,null))[_0x9f4e('0x48')](handleError(_0x490788,null));};exports[_0x9f4e('0x4e')]=function(_0xc0d1eb,_0x5c6f9d){return db[_0x9f4e('0x31')][_0x9f4e('0x4e')](_0xc0d1eb[_0x9f4e('0x4f')],{})[_0x9f4e('0x29')](respondWithResult(_0x5c6f9d,0xc9))['catch'](handleError(_0x5c6f9d,null));};exports['clone']=function(_0xbdd4b1,_0x2a4835){var _0x3e0324={'where':{'id':_0xbdd4b1[_0x9f4e('0x50')]['id']}},_0x57092b={};_0x57092b['model']=_['keys'](db['UserProfile'][_0x9f4e('0x32')]);_0x3e0324[_0x9f4e('0x3a')]=_[_0x9f4e('0x38')](_0x57092b[_0x9f4e('0x35')],qs[_0x9f4e('0x39')](_0xbdd4b1[_0x9f4e('0x36')][_0x9f4e('0x39')]));_0x3e0324[_0x9f4e('0x3a')]=_0x3e0324['attributes'][_0x9f4e('0x3b')]?_0x3e0324['attributes']:_0x57092b['model'];if(_0xbdd4b1[_0x9f4e('0x36')][_0x9f4e('0x4b')]){_0x3e0324[_0x9f4e('0x4c')]=[{'all':!![]}];}_0x3e0324=_[_0x9f4e('0x42')]({},_0x3e0324,_0xbdd4b1[_0x9f4e('0x45')]);return db['UserProfile'][_0x9f4e('0x4d')](_0x3e0324)[_0x9f4e('0x29')](handleEntityNotFound(_0x2a4835,null))[_0x9f4e('0x29')](function(_0x1b3ed7){if(_0x1b3ed7){var _0x51a4c8=_0x1b3ed7[_0x9f4e('0x51')]({'plain':!![]});_0x51a4c8=qs[_0x9f4e('0x52')](_0x51a4c8,['id','createdAt',_0x9f4e('0x53'),'crudPermissions']);_0xbdd4b1[_0x9f4e('0x4f')]=_[_0x9f4e('0x52')](_0xbdd4b1[_0x9f4e('0x4f')],['id',_0x9f4e('0x54'),'updatedAt']);return db[_0x9f4e('0x55')][_0x9f4e('0x56')](function(_0x3a35be){return db[_0x9f4e('0x31')]['create'](_['merge'](_0x51a4c8,_0xbdd4b1['body']),{'include':_0xbdd4b1[_0x9f4e('0x36')][_0x9f4e('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x3a35be})['then'](function(_0x25eb84){var _0x22fb38=_0x25eb84[_0x9f4e('0x51')]({'plain':!![]});return db[_0x9f4e('0x57')][_0x9f4e('0x46')]({'where':{'userProfileId':_0xbdd4b1[_0x9f4e('0x50')]['id']},'raw':!![]})[_0x9f4e('0x29')](function(_0x1899d4){if(_0x1899d4){return BPromise['each'](_0x1899d4,function(_0x39a429){return new BPromise(function(_0x44bda5,_0x39d7d5){if(_0x39a429[_0x9f4e('0x58')]===null||_0x39a429['autoAssociation']===0x1)_0x44bda5(null);return db[_0x9f4e('0x59')]['findAll']({'where':{'sectionId':_0x39a429['id']},'raw':!![]})[_0x9f4e('0x29')](function(_0x3fc4e7){var _0x13d8b5=_[_0x9f4e('0x30')](_0x3fc4e7,function(_0x54e3f5){return qs['omit'](_0x54e3f5,['id',_0x9f4e('0x54'),_0x9f4e('0x53'),'sectionId']);});_0x44bda5(_0x13d8b5);})[_0x9f4e('0x48')](function(_0x3cf8c7){_0x39d7d5(_0x3cf8c7);});})[_0x9f4e('0x29')](function(_0x1d6643){var _0x251fe0=qs[_0x9f4e('0x52')](_0x39a429,['id',_0x9f4e('0x54'),'updatedAt']);_0x251fe0[_0x9f4e('0x5a')]=_0x22fb38['id'];if(_0x1d6643)_0x251fe0[_0x9f4e('0x5b')]=_0x1d6643;return _0x251fe0;})[_0x9f4e('0x29')](function(_0x1e5018){return db[_0x9f4e('0x57')][_0x9f4e('0x4e')](_0x1e5018,{'include':[{'model':db['UserProfileResource'],'as':_0x9f4e('0x5b')}],'raw':!![],'transaction':_0x3a35be});});})[_0x9f4e('0x29')](function(){return _0x22fb38;});}});});});}})['then'](respondWithResult(_0x2a4835,0xc9))['catch'](handleError(_0x2a4835,null));};exports[_0x9f4e('0x28')]=function(_0x4ba5bc,_0x22cad9){if(_0x4ba5bc[_0x9f4e('0x4f')]['id']){delete _0x4ba5bc[_0x9f4e('0x4f')]['id'];}return db[_0x9f4e('0x31')][_0x9f4e('0x4d')]({'where':{'id':_0x4ba5bc[_0x9f4e('0x50')]['id']}})[_0x9f4e('0x29')](handleEntityNotFound(_0x22cad9,null))[_0x9f4e('0x29')](saveUpdates(_0x4ba5bc[_0x9f4e('0x4f')],null))[_0x9f4e('0x29')](respondWithResult(_0x22cad9,null))[_0x9f4e('0x48')](handleError(_0x22cad9,null));};exports['destroy']=function(_0x26c398,_0x4540e1){return db[_0x9f4e('0x31')][_0x9f4e('0x4d')]({'where':{'id':_0x26c398[_0x9f4e('0x50')]['id']}})[_0x9f4e('0x29')](handleEntityNotFound(_0x4540e1,null))['then'](removeEntity(_0x4540e1,null))[_0x9f4e('0x48')](handleError(_0x4540e1,null));};exports[_0x9f4e('0x5c')]=function(_0x429a7c,_0x5176bd){return db[_0x9f4e('0x31')][_0x9f4e('0x5c')]()['then'](respondWithResult(_0x5176bd,null))[_0x9f4e('0x48')](handleError(_0x5176bd,null));};exports[_0x9f4e('0x5d')]=function(_0x1457e2,_0x1b71c5){var _0x5802bd=_0x1457e2[_0x9f4e('0x4f')];return db[_0x9f4e('0x31')][_0x9f4e('0x4d')]({'where':{'id':_0x1457e2['params']['id']}})[_0x9f4e('0x29')](handleEntityNotFound(_0x1b71c5,null))['then'](function(_0x2e6c1f){if(_0x2e6c1f){return db[_0x9f4e('0x55')]['transaction'](function(_0xf9e3e4){return db[_0x9f4e('0x57')]['destroy']({'where':{'userProfileId':_0x1457e2[_0x9f4e('0x50')]['id'],'sectionId':_[_0x9f4e('0x30')](_0x5802bd,function(_0x10279a){return _0x10279a[_0x9f4e('0x5e')];})},'transaction':_0xf9e3e4})[_0x9f4e('0x29')](function(){var _0xa3f9f4=_[_0x9f4e('0x30')](_0x5802bd,function(_0x2c870e){_0x2c870e[_0x9f4e('0x5a')]=_0x1457e2[_0x9f4e('0x50')]['id'];return _0x2c870e;});var _0x20bbaf=[];return BPromise[_0x9f4e('0x5f')](_0xa3f9f4,function(_0x4d125e){return db[_0x9f4e('0x57')]['create'](_0x4d125e,{'include':[{'model':db[_0x9f4e('0x59')],'as':_0x9f4e('0x5b')}],'raw':!![],'transaction':_0xf9e3e4})[_0x9f4e('0x29')](function(_0x369841){_0x20bbaf[_0x9f4e('0x60')](_0x369841['get']({'plain':!![]}));});})[_0x9f4e('0x29')](function(){return _0x20bbaf;});});});}})['then'](function(_0xf63916){return _0xf63916;})[_0x9f4e('0x29')](respondWithResult(_0x1b71c5,null))['catch'](handleError(_0x1b71c5,null));};exports[_0x9f4e('0x61')]=function(_0x448dbc,_0xc138c2){var _0x367f4a;return db[_0x9f4e('0x31')][_0x9f4e('0x4d')]({'where':{'id':_0x448dbc[_0x9f4e('0x50')]['id']},'attributes':['id',_0x9f4e('0x2e')]})['then'](handleEntityNotFound(_0xc138c2,null))[_0x9f4e('0x29')](function(_0x5648f2){if(_0x5648f2){_0x367f4a=_0x5648f2;return db[_0x9f4e('0x57')]['destroy']({'where':{'userProfileId':_0x448dbc['params']['id'],'sectionId':_0x448dbc[_0x9f4e('0x36')][_0x9f4e('0x62')]}});}})[_0x9f4e('0x29')](function(){return _0x367f4a;})['then'](respondWithStatusCode(_0xc138c2,null))[_0x9f4e('0x48')](handleError(_0xc138c2,null));};exports[_0x9f4e('0x63')]=function(_0x387a72,_0x15a59e){var _0x196aca=[];var _0x520ae4=[];return db[_0x9f4e('0x57')][_0x9f4e('0x46')]({'where':{'userProfileId':_0x387a72[_0x9f4e('0x50')]['id']},'raw':!![]})['then'](function(_0x3db6f5){_0x196aca=_[_0x9f4e('0x41')](_0x3db6f5,function(_0x254e8e){return _0x254e8e[_0x9f4e('0x64')]===0x1||_[_0x9f4e('0x65')]([0x3eb,0x709],_0x254e8e['sectionId']);});if(!_[_0x9f4e('0x66')](_0x196aca)){return _['map'](_0x196aca,function(_0x1e4eec){return _0x1e4eec[_0x9f4e('0x5e')];});}else{return;}})[_0x9f4e('0x29')](function(_0x1863e0){if(_0x1863e0)_0x520ae4=_0x1863e0;if(_[_0x9f4e('0x65')](_0x520ae4,0x64)){var _0x3e25d8=_[_0x9f4e('0x4d')](_0x196aca,{'sectionId':0x64});return hasDefaultDashboard(_0x3e25d8)[_0x9f4e('0x29')](function(_0x402c8e){return _['map'](_0x196aca,function(_0x88f21d){if(_0x88f21d[_0x9f4e('0x5e')]===0x64){_0x88f21d[_0x9f4e('0x67')]=_0x402c8e;}return _0x88f21d;});});}else{return;}})[_0x9f4e('0x29')](function(_0x151900){if(_0x151900)_0x196aca=_0x151900;if(_[_0x9f4e('0x65')](_0x520ae4,0x3eb)){var _0x5d4d28=_[_0x9f4e('0x4d')](_0x196aca,{'sectionId':0x3eb});return getCustomDashboards(_0x5d4d28)[_0x9f4e('0x29')](function(_0x513dba){return _[_0x9f4e('0x30')](_0x196aca,function(_0x59b502){if(_0x5d4d28['enabled']){if(_0x59b502[_0x9f4e('0x5e')]===0x3eb){_0x59b502[_0x9f4e('0x67')]=_0x513dba;}}else{if(_0x59b502[_0x9f4e('0x5e')]===0x64){if(!_0x59b502[_0x9f4e('0x67')]){_0x59b502[_0x9f4e('0x67')]=[];}_0x59b502[_0x9f4e('0x67')]=_0x59b502['subsections'][_0x9f4e('0x68')](_0x513dba);}}return _0x59b502;});});}else{return;}})[_0x9f4e('0x29')](function(_0xebe72f){if(_0xebe72f)_0x196aca=_0xebe72f;if(_['includes'](_0x520ae4,0x709)){var _0x454841=_['find'](_0x196aca,{'sectionId':0x709});return getPlugins(_0x454841)[_0x9f4e('0x29')](function(_0xd47364){if(_0x454841['enabled']){return _[_0x9f4e('0x30')](_0x196aca,function(_0x29ea01){if(_0x29ea01[_0x9f4e('0x5e')]===0x709){_0x29ea01[_0x9f4e('0x67')]=_0xd47364;}return _0x29ea01;});}else{var _0x58ae48={'sectionId':0x76c,'enabled':0x1,'subsections':_0xd47364};var _0xae2d3a=_['map'](_0x196aca);_0xae2d3a[_0x9f4e('0x60')](_0x58ae48);return _0xae2d3a;}});}else{return;}})[_0x9f4e('0x29')](function(_0x51e219){if(_0x51e219)_0x196aca=_0x51e219;return _[_0x9f4e('0x41')](_0x196aca,[_0x9f4e('0x64'),0x1]);})[_0x9f4e('0x29')](respondWithResult(_0x15a59e,null))[_0x9f4e('0x48')](handleError(_0x15a59e,null));};function hasDefaultDashboard(_0x33d0a5){var _0x5251e0=[0x65];return new BPromise(function(_0x3a2c34,_0x40915f){try{if(_0x33d0a5[_0x9f4e('0x58')]){_0x3a2c34(_0x5251e0);}else{return db[_0x9f4e('0x59')]['findOne']({'where':{'sectionId':_0x33d0a5['id']},'raw':!![]})[_0x9f4e('0x29')](function(_0x1d7808){_0x1d7808?_0x3a2c34(_0x5251e0):_0x3a2c34();});}}catch(_0x5966ca){_0x40915f(_0x5966ca);}});}function getCustomDashboards(_0x169d86){var _0x12c47e=[];return new BPromise(function(_0x3cb91b,_0x6d6d0a){try{if(_0x169d86[_0x9f4e('0x58')]){return db[_0x9f4e('0x69')]['findAll']({'raw':!![]})['then'](function(_0x371fad){_0x371fad[_0x9f4e('0x6a')](function(_0x32f7ae){_0x12c47e[_0x9f4e('0x60')](_0x32f7ae['id']+0x1869f);});_0x3cb91b(_0x12c47e);});}else{return db[_0x9f4e('0x59')]['findAll']({'where':{'sectionId':_0x169d86['id']},'raw':!![]})[_0x9f4e('0x29')](function(_0x5d2ece){_0x5d2ece[_0x9f4e('0x6a')](function(_0x29e321){_0x12c47e[_0x9f4e('0x60')](_0x29e321[_0x9f4e('0x6b')]+0x1869f);});_0x3cb91b(_0x12c47e);});}}catch(_0x29dcbb){_0x6d6d0a(_0x29dcbb);}});}function getPlugins(_0x46f7ce){var _0x572af9=[];return new BPromise(function(_0x479650,_0xfda296){try{if(_0x46f7ce['autoAssociation']){return db[_0x9f4e('0x6c')][_0x9f4e('0x46')]({'raw':!![]})['then'](function(_0xfde660){_0xfde660['forEach'](function(_0x5f4cc2){_0x572af9[_0x9f4e('0x60')](_0x5f4cc2['id']+0x15b38);});_0x479650(_0x572af9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x46f7ce['id']},'raw':!![]})[_0x9f4e('0x29')](function(_0x2f968e){_0x2f968e[_0x9f4e('0x6a')](function(_0x591bf6){_0x572af9[_0x9f4e('0x60')](_0x591bf6[_0x9f4e('0x6b')]+0x15b38);});_0x479650(_0x572af9);});}}catch(_0x5b9cf3){_0xfda296(_0x5b9cf3);}});}exports['addResources']=function(_0x276aed,_0x10ae03){return db[_0x9f4e('0x31')]['find']({'where':{'id':_0x276aed[_0x9f4e('0x50')]['id']}})[_0x9f4e('0x29')](handleEntityNotFound(_0x10ae03,null))[_0x9f4e('0x29')](function(_0x50787d){if(_0x50787d){return db[_0x9f4e('0x55')][_0x9f4e('0x56')](function(_0x9f98ec){return db[_0x9f4e('0x57')][_0x9f4e('0x46')]({'where':{'userProfileId':_0x276aed[_0x9f4e('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0x9f4e('0x29')](function(_0x4e33fe){if(_0x4e33fe){return db[_0x9f4e('0x57')][_0x9f4e('0x2a')]({'where':{'userProfileId':_0x276aed[_0x9f4e('0x50')]['id'],'id':_[_0x9f4e('0x30')](_0x4e33fe,function(_0x2c27fa){return _0x2c27fa['id'];})},'transaction':_0x9f98ec});}})[_0x9f4e('0x29')](function(_0x40f063){var _0x48c7ef=_[_0x9f4e('0x30')](_0x276aed[_0x9f4e('0x4f')],function(_0x2ef02a){_0x2ef02a[_0x9f4e('0x5a')]=_0x276aed[_0x9f4e('0x50')]['id'];return _0x2ef02a;});return db[_0x9f4e('0x57')][_0x9f4e('0x6d')](_0x48c7ef,{'raw':!![],'transaction':_0x9f98ec});})[_0x9f4e('0x29')](function(_0x110acf){var _0x53387e=_[_0x9f4e('0x41')](_[_0x9f4e('0x30')](_0x110acf,function(_0x3b3684){return _0x3b3684[_0x9f4e('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x53387e){return db[_0x9f4e('0x57')][_0x9f4e('0x46')]({'where':{'userProfileId':_0x276aed[_0x9f4e('0x50')]['id'],'sectionId':_[_0x9f4e('0x30')](_0x53387e,function(_0x3a837a){return _0x3a837a[_0x9f4e('0x5e')];})},'attributes':['id',_0x9f4e('0x5e')],'raw':!![]})[_0x9f4e('0x29')](function(_0x1141ac){var _0x3b52c6=_[_0x9f4e('0x30')](_0x276aed[_0x9f4e('0x4f')],function(_0x14aa49){_0x14aa49[_0x9f4e('0x5a')]=_0x276aed[_0x9f4e('0x50')]['id'];return _0x14aa49;});return db[_0x9f4e('0x59')][_0x9f4e('0x6d')](_0x3b52c6,{'raw':!![],'transaction':_0x9f98ec});});}})[_0x9f4e('0x48')](handleError(_0x10ae03,null));});}})[_0x9f4e('0x29')](function(_0x517cdf){var _0x5d27e6=_['map'](_0x517cdf,function(_0x56c3e2){return _0x56c3e2[_0x9f4e('0x51')]({'plain':!![]});});})[_0x9f4e('0x29')](respondWithResult(_0x10ae03,null))['catch'](handleError(_0x10ae03,null));};exports[_0x9f4e('0x6e')]=function(_0x33afdb,_0x2e1d8b,_0x4d49d5){return db[_0x9f4e('0x31')][_0x9f4e('0x4d')]({'where':{'id':_0x33afdb[_0x9f4e('0x50')]['id']}})[_0x9f4e('0x29')](handleEntityNotFound(_0x2e1d8b,null))[_0x9f4e('0x29')](function(_0x41858e){if(_0x41858e){return _0x41858e['removeResources'](_0x33afdb[_0x9f4e('0x36')][_0x9f4e('0x62')]);}})[_0x9f4e('0x29')](respondWithStatusCode(_0x2e1d8b,null))[_0x9f4e('0x48')](handleError(_0x2e1d8b,null));};exports['getResources']=function(_0x5675b9,_0x45e464){var _0x125f76={};if(!_0x5675b9[_0x9f4e('0x36')][_0x9f4e('0x6f')])throw new Error(_0x9f4e('0x70'));if(!_0x5675b9['query'][_0x9f4e('0x71')](_0x9f4e('0x3c'))){_0x125f76[_0x9f4e('0x24')]=qs[_0x9f4e('0x24')](_0x5675b9[_0x9f4e('0x36')]['limit']);_0x125f76[_0x9f4e('0x21')]=qs[_0x9f4e('0x21')](_0x5675b9[_0x9f4e('0x36')]['offset']);}return db['UserProfile'][_0x9f4e('0x4d')]({'where':{'id':_0x5675b9[_0x9f4e('0x50')]['id']}})[_0x9f4e('0x29')](function(_0x1b443a){if(!_0x1b443a)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5675b9[_0x9f4e('0x50')]['id']);return db[_0x9f4e('0x31')][_0x9f4e('0x72')](_0x5675b9);})[_0x9f4e('0x29')](respondWithFilteredResult(_0x45e464,_0x125f76))[_0x9f4e('0x48')](handleError(_0x45e464,null));};
\ No newline at end of file
index f906ef0..e056b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8921=['exports','events','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x6af7a8,_0x1ea519){var _0xcff005=function(_0x5f1b96){while(--_0x5f1b96){_0x6af7a8['push'](_0x6af7a8['shift']());}};_0xcff005(++_0x1ea519);}(_0x8921,0x9a));var _0x1892=function(_0x16dfb1,_0x4b3a12){_0x16dfb1=_0x16dfb1-0x0;var _0x2a98c7=_0x8921[_0x16dfb1];return _0x2a98c7;};'use strict';var EventEmitter=require(_0x1892('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x1892('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1892('0x2')](0x0);var events={'afterCreate':_0x1892('0x3'),'afterUpdate':_0x1892('0x4'),'afterDestroy':_0x1892('0x5')};function emitEvent(_0x110b75){return function(_0x28a89b,_0x15aa1b,_0x2790a1){UserProfileEvents[_0x1892('0x6')](_0x110b75+':'+_0x28a89b['id'],_0x28a89b);UserProfileEvents[_0x1892('0x6')](_0x110b75,_0x28a89b);_0x2790a1(null);};}for(var e in events){if(events[_0x1892('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x1892('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x7c1a=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x9b2b7c,_0x315ba0){var _0x576f1e=function(_0x1fc743){while(--_0x1fc743){_0x9b2b7c['push'](_0x9b2b7c['shift']());}};_0x576f1e(++_0x315ba0);}(_0x7c1a,0x159));var _0xa7c1=function(_0x329e40,_0x3eb56b){_0x329e40=_0x329e40-0x0;var _0x374e15=_0x7c1a[_0x329e40];return _0x374e15;};'use strict';var EventEmitter=require(_0xa7c1('0x0'));var UserProfile=require(_0xa7c1('0x1'))['db'][_0xa7c1('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa7c1('0x3')](0x0);var events={'afterCreate':_0xa7c1('0x4'),'afterUpdate':_0xa7c1('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd434f){return function(_0x132b08,_0x506858,_0x135ae7){UserProfileEvents['emit'](_0xd434f+':'+_0x132b08['id'],_0x132b08);UserProfileEvents[_0xa7c1('0x6')](_0xd434f,_0x132b08);_0x135ae7(null);};}for(var e in events){if(events[_0xa7c1('0x7')](e)){var event=events[e];UserProfile[_0xa7c1('0x8')](e,emitEvent(event));}}module[_0xa7c1('0x9')]=UserProfileEvents;
\ No newline at end of file
index f1acab2..b3d6eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cbf=['intersection','fields','attributes','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','dataValues','mail','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','SquareProject','childModel','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','parentSections','Lists','ListId','CmList','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','FaxQueue','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','role','agent','User','telephone','VoiceQueues','queue','inbound','QueueCampaigns','outbound','musiconholds','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','queuecampaigns','users','telephones','Users','user','Agents','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','query','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','autoAssociation','rawAttributes','keys'];(function(_0x169f1e,_0x535f8b){var _0x587552=function(_0x54a55a){while(--_0x54a55a){_0x169f1e['push'](_0x169f1e['shift']());}};_0x587552(++_0x535f8b);}(_0x9cbf,0x193));var _0xf9cb=function(_0x196b90,_0x43ab13){_0x196b90=_0x196b90-0x0;var _0x43a9fd=_0x9cbf[_0x196b90];return _0x43a9fd;};'use strict';var _=require(_0xf9cb('0x0'));var attributes=require(_0xf9cb('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xf9cb('0x2'));module[_0xf9cb('0x3')]=function(_0x1f0598){var _0xabd7e2=_0x1f0598[_0xf9cb('0x4')];function _0x19c9ea(_0xd2512d,_0x16c062){return new Promise(function(_0x41a2b6,_0x27e9ed){if(!_0x16c062)return _0x41a2b6(null);var _0x59d433=_0x16c062['filter']?{[_0x16c062[_0xf9cb('0x5')][_0xf9cb('0x6')]]:_0x16c062['filter'][_0xf9cb('0x7')]}:undefined;return _0xabd7e2[_0xd2512d][_0xf9cb('0x8')]({'where':_0x59d433,'raw':!![]})[_0xf9cb('0x9')](function(_0x173d6c){_0x16c062[_0xf9cb('0xa')]=_[_0xf9cb('0xb')](_0x173d6c,'id');_0x41a2b6(_0x16c062);})[_0xf9cb('0xc')](function(_0x749852){_0x27e9ed(_0x749852);});});}function _0x1d5ae5(_0x51946b,_0x58609f){return new Promise(function(_0x127883,_0x3f9f92){var _0x828512=_0x51946b[_0xf9cb('0x5')]?{[_0x51946b[_0xf9cb('0x5')][_0xf9cb('0x6')]]:_0x51946b['filter'][_0xf9cb('0x7')]}:undefined;return _0xabd7e2[_0x51946b[_0xf9cb('0xd')]][_0xf9cb('0x8')]({'where':_0x828512,'raw':!![]})[_0xf9cb('0x9')](function(_0x5076fa){_0x58609f['associatedResources']=_[_0xf9cb('0xb')](_0x5076fa,function(_0x349697){return _0x349697[_0xf9cb('0xe')];});_0x127883(_0x58609f);})[_0xf9cb('0xc')](function(_0x33a06e){_0x3f9f92(_0x33a06e);});});}function _0x3c0a91(_0xb86733,_0x3062b1,_0x550e21){if(!_0x3062b1)return Promise[_0xf9cb('0xf')](null);return new Promise(function(_0x4c1327,_0x32eb68){return _0xabd7e2[_0xf9cb('0x10')][_0xf9cb('0x8')]({'where':{'sectionId':_0x3062b1['id']},'raw':!![]})[_0xf9cb('0x9')](function(_0x13e3d4){if(_0xb86733[_0xf9cb('0x6')]&&_0xb86733['field']!=='id'){_0x3062b1['associatedResources']=_[_0xf9cb('0xb')](_0x13e3d4,function(_0x1a5990){return _0x1a5990[_0xb86733['field']];});}else{if(_0x550e21===_0xf9cb('0x11')){_0x3062b1['associatedResources']=_[_0xf9cb('0xb')](_0x13e3d4,function(_0x4e0ea8){return{'id':_0x4e0ea8[_0xf9cb('0x12')],'type':_0x4e0ea8[_0xf9cb('0x13')]};});}else{_0x3062b1[_0xf9cb('0xa')]=_[_0xf9cb('0xb')](_0x13e3d4,function(_0x53d01f){return _0x53d01f['resourceId'];});}}_0x4c1327(_0x3062b1);})[_0xf9cb('0xc')](function(_0xea9bde){_0x32eb68(_0xea9bde);});});}function _0x503787(_0x33cd99,_0x36ee56){var _0x2722dd={'parentSections':[]};switch(_0x33cd99['toLowerCase']()){case'squareprojects':_0x2722dd['childModel']=_0xf9cb('0x14');break;case'odbc':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x16');break;case _0xf9cb('0x17'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x18');_0x2722dd['parentSections']=[{'name':_0xf9cb('0x19'),'field':_0xf9cb('0xe'),'foreignKey':_0xf9cb('0x1a')}];break;case _0xf9cb('0x1b'):_0x2722dd['childModel']='JscriptyProject';break;case'contacts':_0x2722dd[_0xf9cb('0x15')]='CmContact';_0x2722dd[_0xf9cb('0x1c')]=[{'name':_0xf9cb('0x1d'),'field':'id','foreignKey':_0xf9cb('0x1e')}];break;case'lists':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x1f');break;case _0xf9cb('0x20'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x21');break;case'globalcustomfields':_0x2722dd['childModel']='CmCustomField';break;case _0xf9cb('0x22'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x23');break;case _0xf9cb('0x24'):_0x2722dd[_0xf9cb('0x15')]='ChatWebsite';break;case'faxqueues':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x25');break;case'faxaccounts':_0x2722dd[_0xf9cb('0x15')]='FaxAccount';break;case'inboundroutes':case _0xf9cb('0x26'):case _0xf9cb('0x27'):_0x2722dd['childModel']='VoiceExtension';break;case _0xf9cb('0x28'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x29');break;case _0xf9cb('0x2a'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x2b');break;case _0xf9cb('0x2c'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x2d');_0x2722dd['parentSections']=[{'name':'Agents','field':_0xf9cb('0xe'),'foreignKey':_0xf9cb('0x2e'),'model':'User','filter':{'field':_0xf9cb('0x2f'),'value':[_0xf9cb('0x30')]}},{'name':'Telephones','field':'name','foreignKey':_0xf9cb('0x2e'),'model':_0xf9cb('0x31'),'filter':{'field':_0xf9cb('0x2f'),'value':[_0xf9cb('0x32')]}},{'name':_0xf9cb('0x33'),'field':'name','foreignKey':_0xf9cb('0x34'),'model':'VoiceQueue','filter':{'field':_0xf9cb('0x13'),'value':[_0xf9cb('0x35')]}},{'name':_0xf9cb('0x36'),'field':'name','foreignKey':_0xf9cb('0x34'),'model':'VoiceQueue','filter':{'field':_0xf9cb('0x13'),'value':[_0xf9cb('0x37')]}}];break;case _0xf9cb('0x38'):_0x2722dd[_0xf9cb('0x15')]='VoiceMusicOnHold';break;case'chanspies':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x39');break;case _0xf9cb('0x3a'):_0x2722dd[_0xf9cb('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x3b');break;case _0xf9cb('0x3c'):_0x2722dd[_0xf9cb('0x15')]='MailQueue';break;case'mailaccounts':_0x2722dd[_0xf9cb('0x15')]='MailAccount';break;case _0xf9cb('0x3d'):_0x2722dd['childModel']=_0xf9cb('0x3e');break;case _0xf9cb('0x3f'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x40');break;case'openchannelaccounts':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x41');break;case _0xf9cb('0x42'):_0x2722dd['childModel']=_0xf9cb('0x43');break;case _0xf9cb('0x44'):_0x2722dd[_0xf9cb('0x15')]='SmsAccount';break;case _0xf9cb('0x45'):_0x2722dd['childModel']=_0xf9cb('0x46');break;case _0xf9cb('0x47'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x48');break;case'teams':_0x2722dd[_0xf9cb('0x15')]='Team';break;case'voicequeues':case _0xf9cb('0x49'):_0x2722dd[_0xf9cb('0x15')]='VoiceQueue';if(_0x36ee56){_0x2722dd[_0xf9cb('0x1c')]=[{'name':_0xf9cb('0x33')},{'name':_0xf9cb('0x36')}];}break;case _0xf9cb('0x4a'):case'agents':case _0xf9cb('0x4b'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x31');if(_0x36ee56){_0x2722dd[_0xf9cb('0x1c')]=[{'name':_0xf9cb('0x4c'),'filter':{'field':_0xf9cb('0x2f'),'value':['admin',_0xf9cb('0x4d')]},'ignore':!![]},{'name':_0xf9cb('0x4e')},{'name':_0xf9cb('0x4f')}];}break;case _0xf9cb('0x50'):_0x2722dd['childModel']=_0xf9cb('0x51');break;case _0xf9cb('0x52'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x53');break;case'freshdeskaccounts':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x54');break;case _0xf9cb('0x55'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x56');break;case _0xf9cb('0x57'):_0x2722dd[_0xf9cb('0x15')]='DeskAccount';break;case _0xf9cb('0x58'):_0x2722dd['childModel']=_0xf9cb('0x59');break;case'vtigeraccounts':_0x2722dd['childModel']=_0xf9cb('0x31');break;case'cannedanswers':_0x2722dd[_0xf9cb('0x15')]='CannedAnswer';break;case _0xf9cb('0x5a'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x5b');break;case'customdashboards':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x5c');break;case _0xf9cb('0x5d'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x5e');break;case _0xf9cb('0x5f'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x60');break;case'scheduler':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x61');break;case _0xf9cb('0x62'):_0x2722dd[_0xf9cb('0x15')]='Sound';break;case'tags':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x63');break;case _0xf9cb('0x64'):_0x2722dd['childModel']=_0xf9cb('0x65');break;case'triggers':_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x66');break;case _0xf9cb('0x67'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x68');break;case _0xf9cb('0x69'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x6a');break;case _0xf9cb('0x6b'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x6c');break;case _0xf9cb('0x6d'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x11');_0x2722dd[_0xf9cb('0x1c')]=[{'name':_0xf9cb('0x6e'),'field':'id','foreignKey':_0xf9cb('0x6f')}];break;case _0xf9cb('0x70'):_0x2722dd[_0xf9cb('0x15')]=_0xf9cb('0x71');break;}return _0x2722dd;}function _0x51fdbf(_0x3cdc7c,_0x1b0ae5){var _0x56af37=_0x3cdc7c[_0xf9cb('0x72')](0x0)[_0xf9cb('0x73')]()+_0x3cdc7c[_0xf9cb('0x74')](0x1);var _0x29b83c={'type':_0xabd7e2['Sequelize'][_0xf9cb('0x75')]['SELECT'],'raw':!![]};return new Promise(function(_0x1ba723,_0xa3bfa){var _0x4d28cb=squel[_0xf9cb('0x76')]()['field'](_0xf9cb('0x77')+_0x56af37+_0xf9cb('0x78'),'id')[_0xf9cb('0x6')]('ui.createdAt')[_0xf9cb('0x79')](_0xf9cb('0x7a')+_0x3cdc7c+'_interactions','ui')[_0xf9cb('0x7b')](_0xf9cb('0x7c'),_0x1b0ae5['id']);return _0xabd7e2[_0xf9cb('0x7d')]['query'](_0x4d28cb[_0xf9cb('0x7e')](),_0x29b83c)[_0xf9cb('0x9')](function(_0x188c86){_0x1b0ae5[_0x56af37+_0xf9cb('0x7f')]=_0x188c86;_0x1ba723(_0x188c86);})[_0xf9cb('0xc')](function(_0xb9a073){_0xa3bfa(_0xb9a073);});});}return _0x1f0598[_0xf9cb('0x80')](_0xf9cb('0x81'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x58cfac){var _0x5b63dd={'raw':_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0x83')],'where':{}};var _0x17dc75={};var _0x2cef88={'count':0x0,'rows':[]};var _0x3f345f=_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0x84')];var _0x11306a=_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0x85')]||![];var _0x1b2016=_0x503787(_0x3f345f,_0x11306a);if(!_0x1b2016['childModel'])throw new Error(_0xf9cb('0x86')+_0x3f345f+'\x27');var _0x4b343d=[{'name':_0x3f345f}];if(!_['isEmpty'](_0x1b2016[_0xf9cb('0x1c')]))_0x4b343d=_0x1b2016['parentSections'];var _0x4ca8f4=[];for(var _0x5097b8=0x0;_0x5097b8<_0x4b343d[_0xf9cb('0x87')];_0x5097b8++){_0x4ca8f4[_0xf9cb('0x88')](_0xabd7e2[_0xf9cb('0x89')][_0xf9cb('0x8a')]({'where':{'userProfileId':_0x58cfac[_0xf9cb('0x8b')]['id'],'name':_0x4b343d[_0x5097b8][_0xf9cb('0xe')]},'raw':!![]}));}return Promise[_0xf9cb('0x8c')](_0x4ca8f4)[_0xf9cb('0x9')](function(_0x43e549){var _0x17aa1e=_[_0xf9cb('0x5')](_0x43e549,function(_0x458d25){return _0x458d25?_0x458d25:undefined;});var _0x751e82=_[_0xf9cb('0x5')](_0x4b343d,[_0xf9cb('0x8d'),!![]]);var _0x48e769=_[_0xf9cb('0x8e')](_0x17aa1e)&&_['isEmpty'](_0x751e82)?null:_['union'](_0x751e82,_0x17aa1e);if(!_0x48e769)return null;var _0x3fdedb=[];for(var _0x34e0d4=0x0;_0x34e0d4<_0x48e769[_0xf9cb('0x87')];_0x34e0d4++){var _0x245f3e=_[_0xf9cb('0x8a')](_0x4b343d,function(_0x19d1e5){return _0x48e769[_0x34e0d4]?_0x19d1e5[_0xf9cb('0xe')]===_0x48e769[_0x34e0d4]['name']:null;});if(_0x245f3e){if(_0x48e769[_0x34e0d4][_0xf9cb('0x8d')]){_0x3fdedb[_0xf9cb('0x88')](_0x19c9ea(_0x1b2016[_0xf9cb('0x15')],_0x48e769[_0x34e0d4]));}else{if(!_0x48e769[_0x34e0d4][_0xf9cb('0x8f')]){_0x3fdedb['push'](_0x3c0a91(_0x245f3e,_0x48e769[_0x34e0d4],_0x1b2016[_0xf9cb('0x15')]));}else{if(_0x245f3e['model']){_0x3fdedb[_0xf9cb('0x88')](_0x1d5ae5(_0x245f3e,_0x48e769[_0x34e0d4]));}}}}}return Promise[_0xf9cb('0x8c')](_0x3fdedb);})['then'](function(_0x1dbd98){var _0x4b9c53=_0x1dbd98;var _0x58a889=null;if(_0x4b9c53){_0x58a889=_0x4b9c53['length']===0x1?_0x4b9c53[0x0]:null;}if(!_0x58a889&&!_0x4b9c53)return _0x2cef88;var _0x20631c=_0xabd7e2[_0x1b2016[_0xf9cb('0x15')]][_0xf9cb('0x90')];_0x17dc75[_0xf9cb('0xd')]=_[_0xf9cb('0x91')](_0x20631c);_0x17dc75[_0xf9cb('0x82')]=_[_0xf9cb('0x91')](_0x58cfac[_0xf9cb('0x82')]);_0x17dc75['filters']=_[_0xf9cb('0x92')](_0x17dc75[_0xf9cb('0xd')],_0x17dc75[_0xf9cb('0x82')]);_0x5b63dd['attributes']=_['intersection'](_0x17dc75['model'],qs[_0xf9cb('0x93')](_0x58cfac['query'][_0xf9cb('0x93')]));_0x5b63dd[_0xf9cb('0x94')]=_0x5b63dd['attributes'][_0xf9cb('0x87')]?_0x5b63dd[_0xf9cb('0x94')]:_0x17dc75[_0xf9cb('0xd')];if(!_0x58cfac[_0xf9cb('0x82')]['hasOwnProperty']('nolimit')){_0x5b63dd[_0xf9cb('0x95')]=qs[_0xf9cb('0x95')](_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0x95')]);_0x5b63dd[_0xf9cb('0x96')]=qs['offset'](_0x58cfac['query']['offset']);}_0x5b63dd[_0xf9cb('0x97')]=qs[_0xf9cb('0x98')](_0x58cfac[_0xf9cb('0x82')]['sort']);_0x5b63dd[_0xf9cb('0x7b')]=qs[_0xf9cb('0x99')](_[_0xf9cb('0x9a')](_0x58cfac[_0xf9cb('0x82')],_0x17dc75[_0xf9cb('0x99')]));if(_0x58cfac['query']['filter']){_0x5b63dd[_0xf9cb('0x7b')]=_[_0xf9cb('0x9b')](_0x5b63dd[_0xf9cb('0x7b')],{'$or':_[_0xf9cb('0xb')](_0x20631c,function(_0x13dabd){if(_0x13dabd[_0xf9cb('0x13')][_0xf9cb('0x9c')]!==_0xf9cb('0x9d')){var _0x1b4826={};_0x1b4826[_0x13dabd[_0xf9cb('0x6')]]={'$like':'%'+_0x58cfac[_0xf9cb('0x82')]['filter']+'%'};return _0x1b4826;}})});}var _0x1eef58=[];var _0x57d4b7=null;var _0x467cef={};if(_0x58a889){_0x57d4b7=_[_0xf9cb('0x8a')](_0x4b343d,[_0xf9cb('0xe'),_0x58a889[_0xf9cb('0xe')]]);if(_0x57d4b7[_0xf9cb('0x6')]){_0x467cef={};if(_0x1b2016[_0xf9cb('0x15')]===_0xf9cb('0x11')){_0x467cef[_0x57d4b7[_0xf9cb('0x9e')]]=_[_0xf9cb('0xb')](_0x58a889['associatedResources'],'id');}else{_0x467cef[_0x57d4b7[_0xf9cb('0x9e')]]=_0x58a889[_0xf9cb('0xa')];}_0x1eef58['push'](_0x467cef);}else{_0x5b63dd[_0xf9cb('0x7b')]['id']=_0x58a889['associatedResources'];}}else{for(var _0x658f=0x0;_0x658f<_0x4b9c53[_0xf9cb('0x87')];_0x658f++){_0x57d4b7=_[_0xf9cb('0x8a')](_0x4b343d,[_0xf9cb('0xe'),_0x4b9c53[_0x658f]['name']]);if(_0x57d4b7[_0xf9cb('0x6')]){_0x467cef={};_0x467cef[_0x57d4b7[_0xf9cb('0x9e')]]=_0x4b9c53[_0x658f][_0xf9cb('0xa')];_0x1eef58[_0xf9cb('0x88')](_0x467cef);}else{if(!_0x5b63dd[_0xf9cb('0x7b')]['id'])_0x5b63dd['where']['id']=[];_0x4b9c53[_0x658f][_0xf9cb('0xa')][_0xf9cb('0x9f')](function(_0x1c6b04){_0x5b63dd[_0xf9cb('0x7b')]['id'][_0xf9cb('0x88')](_0x1c6b04);});}}}if(!_['isEmpty'](_0x1eef58)){_0x5b63dd[_0xf9cb('0x7b')]=_['merge'](_0x5b63dd[_0xf9cb('0x7b')],{'$and':{'$or':_0x1eef58}});}_0x5b63dd=_[_0xf9cb('0x9b')]({},_0x5b63dd,_0x58cfac[_0xf9cb('0xa0')]);if(_0x58a889&&!_0x58a889[_0xf9cb('0x8f')]&&_0x1b2016[_0xf9cb('0x15')]===_0xf9cb('0x11')){if(_0x58cfac['query'][_0xf9cb('0xa1')]){_0x5b63dd[_0xf9cb('0xa2')]=[{'all':!![]}];}return _0xabd7e2[_0x1b2016[_0xf9cb('0x15')]][_0xf9cb('0x8')](_0x5b63dd)[_0xf9cb('0x9')](function(_0x4c9d5a){var _0x45c648=[];_0x4c9d5a[_0xf9cb('0x9f')](function(_0x31cab3){var _0x444c40;switch(_0x31cab3[_0xf9cb('0xa3')]){case _0xf9cb('0xa4'):_0x444c40=_['find'](_0x58a889[_0xf9cb('0xa')],function(_0x181bf2){return _0x181bf2['id']===_0x31cab3['reportId']&&_0x181bf2[_0xf9cb('0x13')]===_0xf9cb('0xa5');});break;case'custom':_0x444c40=_[_0xf9cb('0x8a')](_0x58a889[_0xf9cb('0xa')],function(_0x4440dd){return _0x4440dd['id']===_0x31cab3['reportId']&&_0x4440dd[_0xf9cb('0x13')]===_0xf9cb('0xa6');});break;}if(_0x444c40)_0x45c648[_0xf9cb('0x88')](_0x31cab3);});_0x2cef88[_0xf9cb('0xa7')]=_0x45c648['length'];_0x2cef88[_0xf9cb('0xa8')]=_0x45c648;return _0x2cef88;});}else{if(!_[_0xf9cb('0x8e')](_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xa9')])){_0x5b63dd[_0xf9cb('0x7b')]['id']=_0x5b63dd[_0xf9cb('0x7b')]['id']?_[_0xf9cb('0x92')](_0x5b63dd['where']['id'],_0x58cfac['query'][_0xf9cb('0xa9')]):_0x58cfac['query'][_0xf9cb('0xa9')];if(_0x58cfac[_0xf9cb('0x82')]['customSorting']){_0x5b63dd[_0xf9cb('0x97')]=_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xaa')];}}if(_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xab')]){_0x5b63dd[_0xf9cb('0x7b')]=_[_0xf9cb('0x9b')](_0x5b63dd[_0xf9cb('0x7b')],{'$and':_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xab')]});}return _0xabd7e2[_0x1b2016['childModel']][_0xf9cb('0xa7')]({'where':_0x5b63dd[_0xf9cb('0x7b')]})[_0xf9cb('0x9')](function(_0x40c33c){_0x2cef88[_0xf9cb('0xa7')]=_0x40c33c;if(_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xa1')]){if(_0x1b2016['childModel']===_0xf9cb('0xac')){_0x5b63dd[_0xf9cb('0xa2')]=[{'model':_0xabd7e2['Tag'],'as':_0xf9cb('0xad'),'attributes':['id',_0xf9cb('0xe'),_0xf9cb('0xae')],'required':_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xaf')]?!![]:![]},{'model':_0xabd7e2[_0xf9cb('0x63')],'as':_0xf9cb('0xb0'),'attributes':['id',_0xf9cb('0xe'),_0xf9cb('0xae')],'through':_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xaf')]?{'attributes':[],'where':{'TagId':_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xaf')]||undefined}}:{},'required':_0x58cfac['query'][_0xf9cb('0xaf')]?!![]:![]}];}else{_0x5b63dd[_0xf9cb('0xa2')]=[{'all':!![]}];}}return _0xabd7e2[_0x1b2016[_0xf9cb('0x15')]][_0xf9cb('0x8')](_0x5b63dd);})[_0xf9cb('0x9')](function(_0x1760af){_0x2cef88['rows']=_0x1760af;if(_0x3f345f===_0xf9cb('0x4e')&&_0x58cfac[_0xf9cb('0x82')][_0xf9cb('0xb1')]===_0xf9cb('0xb2')){var _0x267e9e=[];for(var _0x38d214=0x0;_0x38d214<_0x2cef88[_0xf9cb('0xa8')][_0xf9cb('0x87')];_0x38d214++){_0x267e9e['push'](_0x51fdbf(_0xf9cb('0xb3'),_0x2cef88[_0xf9cb('0xa8')][_0x38d214]['dataValues']));_0x267e9e['push'](_0x51fdbf(_0xf9cb('0xb4'),_0x2cef88[_0xf9cb('0xa8')][_0x38d214][_0xf9cb('0xb5')]));_0x267e9e[_0xf9cb('0x88')](_0x51fdbf('fax',_0x2cef88[_0xf9cb('0xa8')][_0x38d214][_0xf9cb('0xb5')]));_0x267e9e['push'](_0x51fdbf(_0xf9cb('0xb6'),_0x2cef88[_0xf9cb('0xa8')][_0x38d214][_0xf9cb('0xb5')]));_0x267e9e[_0xf9cb('0x88')](_0x51fdbf('openchannel',_0x2cef88[_0xf9cb('0xa8')][_0x38d214][_0xf9cb('0xb5')]));_0x267e9e['push'](_0x51fdbf('whatsapp',_0x2cef88[_0xf9cb('0xa8')][_0x38d214][_0xf9cb('0xb5')]));}return Promise[_0xf9cb('0x8c')](_0x267e9e)[_0xf9cb('0x9')](function(){return _0x2cef88;});}return _0x2cef88;});}});}}});};
\ No newline at end of file
+var _0xedf5=['exports','models','filter','field','value','findAll','then','associatedResources','model','map','catch','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','users','agents','Users','role','zendeskaccounts','SalesforceAccount','FreshdeskAccount','DeskAccount','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','Pause','scheduler','Schedule','tags','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','where','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','query','raw','mergeResources','isEmpty','length','push','UserProfileSection','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','VIRTUAL','foreignKey','forEach','merge','options','includeAll','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','include','Tag','Tags','tag','ThroughTags','color','openTabs','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs'];(function(_0x39e740,_0x3a3084){var _0x49d5fc=function(_0x344959){while(--_0x344959){_0x39e740['push'](_0x39e740['shift']());}};_0x49d5fc(++_0x3a3084);}(_0xedf5,0xba));var _0x5edf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xedf5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5edf('0x0'));var attributes=require(_0x5edf('0x1'));var qs=require(_0x5edf('0x2'));var squel=require('squel');module[_0x5edf('0x3')]=function(_0x10d2ec){var _0x2ea9aa=_0x10d2ec[_0x5edf('0x4')];function _0x49d5c1(_0x3fe0a0,_0x3db4e3){return new Promise(function(_0x7b6fe1,_0x290d86){if(!_0x3db4e3)return _0x7b6fe1(null);var _0x4feace=_0x3db4e3[_0x5edf('0x5')]?{[_0x3db4e3[_0x5edf('0x5')][_0x5edf('0x6')]]:_0x3db4e3['filter'][_0x5edf('0x7')]}:undefined;return _0x2ea9aa[_0x3fe0a0][_0x5edf('0x8')]({'where':_0x4feace,'raw':!![]})[_0x5edf('0x9')](function(_0x2ce04d){_0x3db4e3[_0x5edf('0xa')]=_['map'](_0x2ce04d,'id');_0x7b6fe1(_0x3db4e3);})['catch'](function(_0x2b24ec){_0x290d86(_0x2b24ec);});});}function _0x55625d(_0x289364,_0x2a4b6a){return new Promise(function(_0x16998e,_0x3c4bf3){var _0x7f6893=_0x289364[_0x5edf('0x5')]?{[_0x289364[_0x5edf('0x5')][_0x5edf('0x6')]]:_0x289364[_0x5edf('0x5')][_0x5edf('0x7')]}:undefined;return _0x2ea9aa[_0x289364[_0x5edf('0xb')]][_0x5edf('0x8')]({'where':_0x7f6893,'raw':!![]})[_0x5edf('0x9')](function(_0x42ec88){_0x2a4b6a['associatedResources']=_[_0x5edf('0xc')](_0x42ec88,function(_0x172e85){return _0x172e85['name'];});_0x16998e(_0x2a4b6a);})[_0x5edf('0xd')](function(_0x1c8d14){_0x3c4bf3(_0x1c8d14);});});}function _0x423df5(_0x58d971,_0x9aaef4,_0x34c13b){if(!_0x9aaef4)return Promise['resolve'](null);return new Promise(function(_0x50824e,_0x156f56){return _0x2ea9aa[_0x5edf('0xe')]['findAll']({'where':{'sectionId':_0x9aaef4['id']},'raw':!![]})['then'](function(_0x3ea501){if(_0x58d971[_0x5edf('0x6')]&&_0x58d971[_0x5edf('0x6')]!=='id'){_0x9aaef4['associatedResources']=_['map'](_0x3ea501,function(_0x3ed9aa){return _0x3ed9aa[_0x58d971[_0x5edf('0x6')]];});}else{if(_0x34c13b==='AnalyticExtractedReport'){_0x9aaef4[_0x5edf('0xa')]=_['map'](_0x3ea501,function(_0x1f43fe){return{'id':_0x1f43fe[_0x5edf('0xf')],'type':_0x1f43fe[_0x5edf('0x10')]};});}else{_0x9aaef4['associatedResources']=_[_0x5edf('0xc')](_0x3ea501,function(_0x391f5c){return _0x391f5c[_0x5edf('0xf')];});}}_0x50824e(_0x9aaef4);})[_0x5edf('0xd')](function(_0x17444c){_0x156f56(_0x17444c);});});}function _0x3cd3dd(_0x14af57,_0x5efe97){var _0x369b99={'parentSections':[]};switch(_0x14af57[_0x5edf('0x11')]()){case _0x5edf('0x12'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x14');break;case _0x5edf('0x15'):_0x369b99['childModel']=_0x5edf('0x16');break;case'squarerecordings':_0x369b99[_0x5edf('0x13')]='SquareRecording';_0x369b99[_0x5edf('0x17')]=[{'name':_0x5edf('0x18'),'field':_0x5edf('0x19'),'foreignKey':_0x5edf('0x1a')}];break;case _0x5edf('0x1b'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x1c');break;case _0x5edf('0x1d'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x1e');_0x369b99[_0x5edf('0x17')]=[{'name':_0x5edf('0x1f'),'field':'id','foreignKey':_0x5edf('0x20')}];break;case _0x5edf('0x21'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x22');break;case _0x5edf('0x23'):_0x369b99['childModel']='CmCompany';break;case _0x5edf('0x24'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x25');break;case _0x5edf('0x26'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x27');break;case _0x5edf('0x28'):_0x369b99[_0x5edf('0x13')]='ChatWebsite';break;case _0x5edf('0x29'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x2a');break;case _0x5edf('0x2b'):_0x369b99['childModel']=_0x5edf('0x2c');break;case _0x5edf('0x2d'):case _0x5edf('0x2e'):case _0x5edf('0x2f'):_0x369b99['childModel']=_0x5edf('0x30');break;case _0x5edf('0x31'):_0x369b99['childModel']=_0x5edf('0x32');break;case _0x5edf('0x33'):_0x369b99[_0x5edf('0x13')]='VoiceMail';break;case _0x5edf('0x34'):_0x369b99['childModel']=_0x5edf('0x35');_0x369b99[_0x5edf('0x17')]=[{'name':_0x5edf('0x36'),'field':_0x5edf('0x19'),'foreignKey':'membername','model':_0x5edf('0x37'),'filter':{'field':'role','value':[_0x5edf('0x38')]}},{'name':_0x5edf('0x39'),'field':_0x5edf('0x19'),'foreignKey':_0x5edf('0x3a'),'model':_0x5edf('0x37'),'filter':{'field':'role','value':[_0x5edf('0x3b')]}},{'name':_0x5edf('0x3c'),'field':_0x5edf('0x19'),'foreignKey':_0x5edf('0x3d'),'model':_0x5edf('0x3e'),'filter':{'field':_0x5edf('0x10'),'value':['inbound']}},{'name':_0x5edf('0x3f'),'field':'name','foreignKey':_0x5edf('0x3d'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x5edf('0x40')]}}];break;case _0x5edf('0x41'):_0x369b99['childModel']=_0x5edf('0x42');break;case _0x5edf('0x43'):_0x369b99['childModel']=_0x5edf('0x44');break;case'voiceprefixes':_0x369b99['childModel']=_0x5edf('0x45');break;case _0x5edf('0x46'):_0x369b99['childModel']=_0x5edf('0x47');break;case _0x5edf('0x48'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x49');break;case'mailaccounts':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x4a');break;case'mailsubstatuses':_0x369b99[_0x5edf('0x13')]='MailSubstatus';break;case _0x5edf('0x4b'):_0x369b99[_0x5edf('0x13')]='OpenchannelQueue';break;case _0x5edf('0x4c'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x4d');break;case'smsqueues':_0x369b99[_0x5edf('0x13')]='SmsQueue';break;case _0x5edf('0x4e'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x4f');break;case _0x5edf('0x50'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x51');break;case _0x5edf('0x52'):_0x369b99['childModel']=_0x5edf('0x53');break;case _0x5edf('0x54'):_0x369b99[_0x5edf('0x13')]='Team';break;case _0x5edf('0x55'):case'queuecampaigns':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x3e');if(_0x5efe97){_0x369b99[_0x5edf('0x17')]=[{'name':_0x5edf('0x3c')},{'name':'QueueCampaigns'}];}break;case _0x5edf('0x56'):case _0x5edf('0x57'):case'telephones':_0x369b99[_0x5edf('0x13')]='User';if(_0x5efe97){_0x369b99[_0x5edf('0x17')]=[{'name':_0x5edf('0x58'),'filter':{'field':_0x5edf('0x59'),'value':['admin','user']},'ignore':!![]},{'name':_0x5edf('0x36')},{'name':_0x5edf('0x39')}];}break;case _0x5edf('0x5a'):_0x369b99[_0x5edf('0x13')]='ZendeskAccount';break;case'salesforceaccounts':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x5b');break;case'freshdeskaccounts':_0x369b99['childModel']=_0x5edf('0x5c');break;case'sugarcrmaccounts':_0x369b99[_0x5edf('0x13')]='SugarcrmAccount';break;case'deskaccounts':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x5d');break;case'zohoaccounts':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x5e');break;case'vtigeraccounts':_0x369b99[_0x5edf('0x13')]='User';break;case'cannedanswers':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x5f');break;case _0x5edf('0x60'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x61');break;case _0x5edf('0x62'):_0x369b99['childModel']=_0x5edf('0x63');break;case'intervals':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x64');break;case'pauses':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x65');break;case _0x5edf('0x66'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x67');break;case'sounds':_0x369b99[_0x5edf('0x13')]='Sound';break;case _0x5edf('0x68'):_0x369b99['childModel']='Tag';break;case _0x5edf('0x69'):_0x369b99['childModel']=_0x5edf('0x6a');break;case _0x5edf('0x6b'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x6c');break;case'trunks':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x6d');break;case _0x5edf('0x6e'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x6f');break;case'plugins':_0x369b99[_0x5edf('0x13')]=_0x5edf('0x70');break;case _0x5edf('0x71'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x72');_0x369b99['parentSections']=[{'name':_0x5edf('0x73'),'field':'id','foreignKey':_0x5edf('0x74')}];break;case _0x5edf('0x75'):_0x369b99[_0x5edf('0x13')]=_0x5edf('0x76');break;}return _0x369b99;}function _0x249db0(_0x218529,_0x1de885){var _0x30d022=_0x218529[_0x5edf('0x77')](0x0)[_0x5edf('0x78')]()+_0x218529[_0x5edf('0x79')](0x1);var _0x41de33={'type':_0x2ea9aa[_0x5edf('0x7a')][_0x5edf('0x7b')][_0x5edf('0x7c')],'raw':!![]};return new Promise(function(_0x2f4ffe,_0x27ffa0){var _0x241bf1=squel[_0x5edf('0x7d')]()[_0x5edf('0x6')]('ui.'+_0x30d022+_0x5edf('0x7e'),'id')[_0x5edf('0x6')](_0x5edf('0x7f'))[_0x5edf('0x80')](_0x5edf('0x81')+_0x218529+'_interactions','ui')[_0x5edf('0x82')]('ui.UserId\x20=\x20?',_0x1de885['id']);return _0x2ea9aa[_0x5edf('0x83')]['query'](_0x241bf1[_0x5edf('0x84')](),_0x41de33)['then'](function(_0x2d112b){_0x1de885[_0x30d022+_0x5edf('0x85')]=_0x2d112b;_0x2f4ffe(_0x2d112b);})[_0x5edf('0xd')](function(_0x585700){_0x27ffa0(_0x585700);});});}return _0x10d2ec[_0x5edf('0x86')](_0x5edf('0x87'),attributes,{'tableName':_0x5edf('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2040e0){var _0x3c22fb={'raw':_0x2040e0[_0x5edf('0x89')][_0x5edf('0x8a')],'where':{}};var _0x538923={};var _0x40b67f={'count':0x0,'rows':[]};var _0x2508db=_0x2040e0['query']['section'];var _0x8c05ea=_0x2040e0['query'][_0x5edf('0x8b')]||![];var _0x4f446b=_0x3cd3dd(_0x2508db,_0x8c05ea);if(!_0x4f446b[_0x5edf('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x2508db+'\x27');var _0x4a7dd3=[{'name':_0x2508db}];if(!_[_0x5edf('0x8c')](_0x4f446b[_0x5edf('0x17')]))_0x4a7dd3=_0x4f446b[_0x5edf('0x17')];var _0x2656a0=[];for(var _0x3b0543=0x0;_0x3b0543<_0x4a7dd3[_0x5edf('0x8d')];_0x3b0543++){_0x2656a0[_0x5edf('0x8e')](_0x2ea9aa[_0x5edf('0x8f')]['find']({'where':{'userProfileId':_0x2040e0['params']['id'],'name':_0x4a7dd3[_0x3b0543][_0x5edf('0x19')]},'raw':!![]}));}return Promise[_0x5edf('0x90')](_0x2656a0)[_0x5edf('0x9')](function(_0x5b300d){var _0x52bf87=_['filter'](_0x5b300d,function(_0x4c89bb){return _0x4c89bb?_0x4c89bb:undefined;});var _0x5901e4=_[_0x5edf('0x5')](_0x4a7dd3,[_0x5edf('0x91'),!![]]);var _0x27cd60=_['isEmpty'](_0x52bf87)&&_['isEmpty'](_0x5901e4)?null:_[_0x5edf('0x92')](_0x5901e4,_0x52bf87);if(!_0x27cd60)return null;var _0x480fe4=[];for(var _0x53347b=0x0;_0x53347b<_0x27cd60[_0x5edf('0x8d')];_0x53347b++){var _0x23ad91=_[_0x5edf('0x93')](_0x4a7dd3,function(_0x7a1715){return _0x27cd60[_0x53347b]?_0x7a1715[_0x5edf('0x19')]===_0x27cd60[_0x53347b][_0x5edf('0x19')]:null;});if(_0x23ad91){if(_0x27cd60[_0x53347b]['ignore']){_0x480fe4[_0x5edf('0x8e')](_0x49d5c1(_0x4f446b['childModel'],_0x27cd60[_0x53347b]));}else{if(!_0x27cd60[_0x53347b][_0x5edf('0x94')]){_0x480fe4['push'](_0x423df5(_0x23ad91,_0x27cd60[_0x53347b],_0x4f446b[_0x5edf('0x13')]));}else{if(_0x23ad91[_0x5edf('0xb')]){_0x480fe4[_0x5edf('0x8e')](_0x55625d(_0x23ad91,_0x27cd60[_0x53347b]));}}}}}return Promise[_0x5edf('0x90')](_0x480fe4);})[_0x5edf('0x9')](function(_0x140bd5){var _0x477382=_0x140bd5;var _0x4461a9=null;if(_0x477382){_0x4461a9=_0x477382[_0x5edf('0x8d')]===0x1?_0x477382[0x0]:null;}if(!_0x4461a9&&!_0x477382)return _0x40b67f;var _0x3c652d=_0x2ea9aa[_0x4f446b[_0x5edf('0x13')]][_0x5edf('0x95')];_0x538923[_0x5edf('0xb')]=_[_0x5edf('0x96')](_0x3c652d);_0x538923[_0x5edf('0x89')]=_[_0x5edf('0x96')](_0x2040e0['query']);_0x538923[_0x5edf('0x97')]=_['intersection'](_0x538923[_0x5edf('0xb')],_0x538923[_0x5edf('0x89')]);_0x3c22fb['attributes']=_[_0x5edf('0x98')](_0x538923['model'],qs[_0x5edf('0x99')](_0x2040e0[_0x5edf('0x89')][_0x5edf('0x99')]));_0x3c22fb[_0x5edf('0x9a')]=_0x3c22fb['attributes'][_0x5edf('0x8d')]?_0x3c22fb['attributes']:_0x538923[_0x5edf('0xb')];if(!_0x2040e0[_0x5edf('0x89')][_0x5edf('0x9b')](_0x5edf('0x9c'))){_0x3c22fb[_0x5edf('0x9d')]=qs[_0x5edf('0x9d')](_0x2040e0['query'][_0x5edf('0x9d')]);_0x3c22fb[_0x5edf('0x9e')]=qs[_0x5edf('0x9e')](_0x2040e0[_0x5edf('0x89')]['offset']);}_0x3c22fb[_0x5edf('0x9f')]=qs[_0x5edf('0xa0')](_0x2040e0[_0x5edf('0x89')][_0x5edf('0xa0')]);_0x3c22fb[_0x5edf('0x82')]=qs[_0x5edf('0x97')](_['pick'](_0x2040e0[_0x5edf('0x89')],_0x538923[_0x5edf('0x97')]));if(_0x2040e0[_0x5edf('0x89')][_0x5edf('0x5')]){_0x3c22fb['where']=_['merge'](_0x3c22fb['where'],{'$or':_[_0x5edf('0xc')](_0x3c652d,function(_0x18bf50){if(_0x18bf50[_0x5edf('0x10')]['key']!==_0x5edf('0xa1')){var _0x1b3e2e={};_0x1b3e2e[_0x18bf50[_0x5edf('0x6')]]={'$like':'%'+_0x2040e0['query'][_0x5edf('0x5')]+'%'};return _0x1b3e2e;}})});}var _0x5b57d3=[];var _0x2e6dfd=null;var _0x52a85a={};if(_0x4461a9){_0x2e6dfd=_['find'](_0x4a7dd3,[_0x5edf('0x19'),_0x4461a9[_0x5edf('0x19')]]);if(_0x2e6dfd[_0x5edf('0x6')]){_0x52a85a={};if(_0x4f446b['childModel']===_0x5edf('0x72')){_0x52a85a[_0x2e6dfd[_0x5edf('0xa2')]]=_[_0x5edf('0xc')](_0x4461a9[_0x5edf('0xa')],'id');}else{_0x52a85a[_0x2e6dfd['foreignKey']]=_0x4461a9[_0x5edf('0xa')];}_0x5b57d3[_0x5edf('0x8e')](_0x52a85a);}else{_0x3c22fb[_0x5edf('0x82')]['id']=_0x4461a9['associatedResources'];}}else{for(var _0x40030c=0x0;_0x40030c<_0x477382['length'];_0x40030c++){_0x2e6dfd=_[_0x5edf('0x93')](_0x4a7dd3,[_0x5edf('0x19'),_0x477382[_0x40030c]['name']]);if(_0x2e6dfd[_0x5edf('0x6')]){_0x52a85a={};_0x52a85a[_0x2e6dfd[_0x5edf('0xa2')]]=_0x477382[_0x40030c][_0x5edf('0xa')];_0x5b57d3[_0x5edf('0x8e')](_0x52a85a);}else{if(!_0x3c22fb['where']['id'])_0x3c22fb[_0x5edf('0x82')]['id']=[];_0x477382[_0x40030c][_0x5edf('0xa')][_0x5edf('0xa3')](function(_0x161f0c){_0x3c22fb[_0x5edf('0x82')]['id'][_0x5edf('0x8e')](_0x161f0c);});}}}if(!_[_0x5edf('0x8c')](_0x5b57d3)){_0x3c22fb[_0x5edf('0x82')]=_[_0x5edf('0xa4')](_0x3c22fb[_0x5edf('0x82')],{'$and':{'$or':_0x5b57d3}});}_0x3c22fb=_[_0x5edf('0xa4')]({},_0x3c22fb,_0x2040e0[_0x5edf('0xa5')]);if(_0x4461a9&&!_0x4461a9[_0x5edf('0x94')]&&_0x4f446b[_0x5edf('0x13')]===_0x5edf('0x72')){if(_0x2040e0[_0x5edf('0x89')][_0x5edf('0xa6')]){_0x3c22fb['include']=[{'all':!![]}];}return _0x2ea9aa[_0x4f446b[_0x5edf('0x13')]][_0x5edf('0x8')](_0x3c22fb)[_0x5edf('0x9')](function(_0x4f97eb){var _0x22aece=[];_0x4f97eb['forEach'](function(_0x1e65f1){var _0x1fa68d;switch(_0x1e65f1[_0x5edf('0xa7')]){case _0x5edf('0xa8'):_0x1fa68d=_[_0x5edf('0x93')](_0x4461a9[_0x5edf('0xa')],function(_0x5bd0d6){return _0x5bd0d6['id']===_0x1e65f1['reportId']&&_0x5bd0d6['type']===_0x5edf('0xa9');});break;case _0x5edf('0xaa'):_0x1fa68d=_['find'](_0x4461a9[_0x5edf('0xa')],function(_0x1b8838){return _0x1b8838['id']===_0x1e65f1[_0x5edf('0x74')]&&_0x1b8838[_0x5edf('0x10')]==='CustomReports';});break;}if(_0x1fa68d)_0x22aece['push'](_0x1e65f1);});_0x40b67f[_0x5edf('0xab')]=_0x22aece[_0x5edf('0x8d')];_0x40b67f[_0x5edf('0xac')]=_0x22aece;return _0x40b67f;});}else{if(!_[_0x5edf('0x8c')](_0x2040e0['query'][_0x5edf('0xad')])){_0x3c22fb['where']['id']=_0x3c22fb[_0x5edf('0x82')]['id']?_[_0x5edf('0x98')](_0x3c22fb[_0x5edf('0x82')]['id'],_0x2040e0[_0x5edf('0x89')][_0x5edf('0xad')]):_0x2040e0[_0x5edf('0x89')][_0x5edf('0xad')];if(_0x2040e0[_0x5edf('0x89')]['customSorting']){_0x3c22fb[_0x5edf('0x9f')]=_0x2040e0[_0x5edf('0x89')][_0x5edf('0xae')];}}if(_0x2040e0[_0x5edf('0x89')]['extraQueryConditions']){_0x3c22fb[_0x5edf('0x82')]=_['merge'](_0x3c22fb['where'],{'$and':_0x2040e0[_0x5edf('0x89')][_0x5edf('0xaf')]});}return _0x2ea9aa[_0x4f446b[_0x5edf('0x13')]][_0x5edf('0xab')]({'where':_0x3c22fb[_0x5edf('0x82')]})[_0x5edf('0x9')](function(_0x40bba1){_0x40b67f[_0x5edf('0xab')]=_0x40bba1;if(_0x2040e0[_0x5edf('0x89')][_0x5edf('0xa6')]){if(_0x4f446b['childModel']===_0x5edf('0x1e')){_0x3c22fb[_0x5edf('0xb0')]=[{'model':_0x2ea9aa[_0x5edf('0xb1')],'as':_0x5edf('0xb2'),'attributes':['id',_0x5edf('0x19'),'color'],'required':_0x2040e0[_0x5edf('0x89')][_0x5edf('0xb3')]?!![]:![]},{'model':_0x2ea9aa[_0x5edf('0xb1')],'as':_0x5edf('0xb4'),'attributes':['id',_0x5edf('0x19'),_0x5edf('0xb5')],'through':_0x2040e0[_0x5edf('0x89')]['tag']?{'attributes':[],'where':{'TagId':_0x2040e0[_0x5edf('0x89')][_0x5edf('0xb3')]||undefined}}:{},'required':_0x2040e0[_0x5edf('0x89')][_0x5edf('0xb3')]?!![]:![]}];}else{_0x3c22fb[_0x5edf('0xb0')]=[{'all':!![]}];}}return _0x2ea9aa[_0x4f446b[_0x5edf('0x13')]]['findAll'](_0x3c22fb);})['then'](function(_0xffb605){_0x40b67f[_0x5edf('0xac')]=_0xffb605;if(_0x2508db==='Agents'&&_0x2040e0['query'][_0x5edf('0xb6')]==='true'){var _0xaee903=[];for(var _0x30825d=0x0;_0x30825d<_0x40b67f[_0x5edf('0xac')][_0x5edf('0x8d')];_0x30825d++){_0xaee903[_0x5edf('0x8e')](_0x249db0('chat',_0x40b67f[_0x5edf('0xac')][_0x30825d][_0x5edf('0xb7')]));_0xaee903[_0x5edf('0x8e')](_0x249db0(_0x5edf('0xb8'),_0x40b67f['rows'][_0x30825d][_0x5edf('0xb7')]));_0xaee903[_0x5edf('0x8e')](_0x249db0(_0x5edf('0xb9'),_0x40b67f[_0x5edf('0xac')][_0x30825d][_0x5edf('0xb7')]));_0xaee903['push'](_0x249db0(_0x5edf('0xba'),_0x40b67f[_0x5edf('0xac')][_0x30825d]['dataValues']));_0xaee903[_0x5edf('0x8e')](_0x249db0(_0x5edf('0xbb'),_0x40b67f[_0x5edf('0xac')][_0x30825d][_0x5edf('0xb7')]));_0xaee903[_0x5edf('0x8e')](_0x249db0(_0x5edf('0xbc'),_0x40b67f[_0x5edf('0xac')][_0x30825d][_0x5edf('0xb7')]));}return Promise[_0x5edf('0x90')](_0xaee903)[_0x5edf('0x9')](function(){return _0x40b67f;});}return _0x40b67f;});}});}}});};
\ No newline at end of file
index e8e440a..485db7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd481=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x6a00bd,_0x4cc29c){var _0x18531e=function(_0x458bf9){while(--_0x458bf9){_0x6a00bd['push'](_0x6a00bd['shift']());}};_0x18531e(++_0x4cc29c);}(_0xd481,0x1e4));var _0x1d48=function(_0x273fed,_0x56bc89){_0x273fed=_0x273fed-0x0;var _0x526fb2=_0xd481[_0x273fed];return _0x526fb2;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var moment=require(_0x1d48('0x1'));var BPromise=require(_0x1d48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require(_0x1d48('0x4'))['db'];var utils=require(_0x1d48('0x5'));var logger=require('../../config/logger')(_0x1d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d48('0x7'));var client=jayson[_0x1d48('0x8')]['http']({'port':0x232a});config[_0x1d48('0x9')]=_[_0x1d48('0xa')](config[_0x1d48('0x9')],{'host':_0x1d48('0xb'),'port':0x18eb});var socket=require(_0x1d48('0xc'))(new Redis(config[_0x1d48('0x9')]));require(_0x1d48('0xd'))[_0x1d48('0xe')](socket);function respondWithRpcPromise(_0x2bf9c6,_0x21a801,_0x37ff69){return new BPromise(function(_0x2f2f6c,_0x4dd9d3){return client[_0x1d48('0xf')](_0x2bf9c6,_0x37ff69)[_0x1d48('0x10')](function(_0xf54674){logger[_0x1d48('0x11')](_0x1d48('0x12'),_0x21a801,_0x1d48('0x13'));logger[_0x1d48('0x14')](_0x1d48('0x15'),_0x21a801,_0x1d48('0x13'),JSON[_0x1d48('0x16')](_0xf54674));if(_0xf54674['error']){if(_0xf54674[_0x1d48('0x17')]['code']===0x1f4){logger[_0x1d48('0x17')](_0x1d48('0x12'),_0x21a801,_0xf54674[_0x1d48('0x17')][_0x1d48('0x18')]);return _0x4dd9d3(_0xf54674['error'][_0x1d48('0x18')]);}logger[_0x1d48('0x17')](_0x1d48('0x12'),_0x21a801,_0xf54674['error'][_0x1d48('0x18')]);return _0x2f2f6c(_0xf54674[_0x1d48('0x17')][_0x1d48('0x18')]);}else{logger[_0x1d48('0x11')](_0x1d48('0x12'),_0x21a801,_0x1d48('0x13'));_0x2f2f6c(_0xf54674[_0x1d48('0x19')][_0x1d48('0x18')]);}})[_0x1d48('0x1a')](function(_0x544426){logger['error'](_0x1d48('0x12'),_0x21a801,_0x544426);_0x4dd9d3(_0x544426);});});}
\ No newline at end of file
+var _0x964b=['result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3fc383,_0x41e8bc){var _0x212e84=function(_0x19b84f){while(--_0x19b84f){_0x3fc383['push'](_0x3fc383['shift']());}};_0x212e84(++_0x41e8bc);}(_0x964b,0x112));var _0xb964=function(_0x5add7f,_0x3d26e0){_0x5add7f=_0x5add7f-0x0;var _0xa9a6d6=_0x964b[_0x5add7f];return _0xa9a6d6;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});config[_0xb964('0xa')]=_[_0xb964('0xb')](config[_0xb964('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb964('0xa')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x295392,_0x4df011,_0x4433a5){return new BPromise(function(_0x38247c,_0x38bae5){return client[_0xb964('0xc')](_0x295392,_0x4433a5)['then'](function(_0x442595){logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));logger['debug'](_0xb964('0x10'),_0x4df011,'request\x20sent',JSON['stringify'](_0x442595));if(_0x442595[_0xb964('0x11')]){if(_0x442595[_0xb964('0x11')][_0xb964('0x12')]===0x1f4){logger[_0xb964('0x11')](_0xb964('0xe'),_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38bae5(_0x442595['error'][_0xb964('0x13')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38247c(_0x442595[_0xb964('0x11')][_0xb964('0x13')]);}else{logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));_0x38247c(_0x442595[_0xb964('0x14')][_0xb964('0x13')]);}})['catch'](function(_0x54da04){logger['error'](_0xb964('0xe'),_0x4df011,_0x54da04);_0x38bae5(_0x54da04);});});}
\ No newline at end of file
index 8b953b8..58a5b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdffa=['userProfile:','./userProfile.events','emit','removeListener','register'];(function(_0x25d3bc,_0xda8366){var _0x306ad2=function(_0x49cb28){while(--_0x49cb28){_0x25d3bc['push'](_0x25d3bc['shift']());}};_0x306ad2(++_0xda8366);}(_0xdffa,0x132));var _0xadff=function(_0x33f008,_0x542239){_0x33f008=_0x33f008-0x0;var _0x5e5787=_0xdffa[_0x33f008];return _0x5e5787;};'use strict';var UserProfileEvents=require(_0xadff('0x0'));var events=['save','remove','update'];function createListener(_0x5a553a,_0x490551){return function(_0x5ab1a2){_0x490551[_0xadff('0x1')](_0x5a553a,_0x5ab1a2);};}function removeListener(_0x23afb7,_0x3fddf0){return function(){UserProfileEvents[_0xadff('0x2')](_0x23afb7,_0x3fddf0);};}exports[_0xadff('0x3')]=function(_0x3d3b4e){for(var _0x2851c7=0x0,_0x7632c2=events['length'];_0x2851c7<_0x7632c2;_0x2851c7++){var _0x264077=events[_0x2851c7];var _0x1e4392=createListener(_0xadff('0x4')+_0x264077,_0x3d3b4e);UserProfileEvents['on'](_0x264077,_0x1e4392);}};
\ No newline at end of file
+var _0xdfe9=['removeListener','register','length','./userProfile.events','remove','update','emit'];(function(_0x56e172,_0x59bedb){var _0xc92dd7=function(_0x4ae9ca){while(--_0x4ae9ca){_0x56e172['push'](_0x56e172['shift']());}};_0xc92dd7(++_0x59bedb);}(_0xdfe9,0xe3));var _0x9dfe=function(_0x48f783,_0x1ad5ed){_0x48f783=_0x48f783-0x0;var _0x5f5100=_0xdfe9[_0x48f783];return _0x5f5100;};'use strict';var UserProfileEvents=require(_0x9dfe('0x0'));var events=['save',_0x9dfe('0x1'),_0x9dfe('0x2')];function createListener(_0x290c3e,_0x1d9ca3){return function(_0x38b9e0){_0x1d9ca3[_0x9dfe('0x3')](_0x290c3e,_0x38b9e0);};}function removeListener(_0x2decaf,_0xdb4c1d){return function(){UserProfileEvents[_0x9dfe('0x4')](_0x2decaf,_0xdb4c1d);};}exports[_0x9dfe('0x5')]=function(_0x245224){for(var _0x577279=0x0,_0x603fa7=events[_0x9dfe('0x6')];_0x577279<_0x603fa7;_0x577279++){var _0x3f0faf=events[_0x577279];var _0x2761cd=createListener('userProfile:'+_0x3f0faf,_0x245224);UserProfileEvents['on'](_0x3f0faf,_0x2761cd);}};
\ No newline at end of file
index 7bf1226..3227d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7294=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','post','put','update','delete','destroy','multer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7294,0x1db));var _0x4729=function(_0x5e5546,_0x582fd4){_0x5e5546=_0x5e5546-0x0;var _0x3d262f=_0x7294[_0x5e5546];return _0x3d262f;};'use strict';var multer=require(_0x4729('0x0'));var util=require(_0x4729('0x1'));var path=require(_0x4729('0x2'));var timeout=require('connect-timeout');var express=require(_0x4729('0x3'));var router=express['Router']();var fs_extra=require(_0x4729('0x4'));var auth=require(_0x4729('0x5'));var interaction=require(_0x4729('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x4729('0x7')](),controller['index']);router['get'](_0x4729('0x8'),auth[_0x4729('0x7')](),controller[_0x4729('0x9')]);router[_0x4729('0xa')](_0x4729('0xb'),auth[_0x4729('0x7')](),controller['show']);router[_0x4729('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4729('0xd')](_0x4729('0xb'),auth['isAuthenticated'](),controller[_0x4729('0xe')]);router[_0x4729('0xf')](_0x4729('0xb'),auth[_0x4729('0x7')](),controller[_0x4729('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x531f=['isAuthenticated','index','get','describe','show','post','/:id','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x531f,0x160));var _0xf531=function(_0x4222b5,_0x37422c){_0x4222b5=_0x4222b5-0x0;var _0x425d4c=_0x531f[_0x4222b5];return _0x425d4c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf531('0x0'));var timeout=require(_0xf531('0x1'));var express=require(_0xf531('0x2'));var router=express['Router']();var fs_extra=require(_0xf531('0x3'));var auth=require(_0xf531('0x4'));var interaction=require(_0xf531('0x5'));var config=require(_0xf531('0x6'));var controller=require(_0xf531('0x7'));router['get']('/',auth[_0xf531('0x8')](),controller[_0xf531('0x9')]);router[_0xf531('0xa')]('/describe',auth[_0xf531('0x8')](),controller[_0xf531('0xb')]);router[_0xf531('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf531('0xc')]);router[_0xf531('0xd')]('/',auth[_0xf531('0x8')](),controller['create']);router['put'](_0xf531('0xe'),auth[_0xf531('0x8')](),controller[_0xf531('0xf')]);router[_0xf531('0x10')]('/:id',auth[_0xf531('0x8')](),controller['destroy']);module[_0xf531('0x11')]=router;
\ No newline at end of file
index d21b0c5..3460147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77fb=['INTEGER','sequelize','exports','STRING'];(function(_0x4fc57d,_0x3b3aa2){var _0x2d58d6=function(_0x4e96ca){while(--_0x4e96ca){_0x4fc57d['push'](_0x4fc57d['shift']());}};_0x2d58d6(++_0x3b3aa2);}(_0x77fb,0xcd));var _0xb77f=function(_0x3d4954,_0x20165f){_0x3d4954=_0x3d4954-0x0;var _0x2943af=_0x77fb[_0x3d4954];return _0x2943af;};'use strict';var Sequelize=require(_0xb77f('0x0'));module[_0xb77f('0x1')]={'name':{'type':Sequelize[_0xb77f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb77f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb77f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x88d0=['STRING','INTEGER','sequelize','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x88d0,0x12a));var _0x088d=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x88d0[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0x088d('0x0'));module[_0x088d('0x1')]={'name':{'type':Sequelize[_0x088d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x088d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x088d('0x2')],'allowNull':![]}};
\ No newline at end of file
index 137ab64..41a78c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'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')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));};
\ No newline at end of file
+var _0x4991=['hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','UserProfileResource','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x17b9e2,_0x3921fa){var _0x4335d2=function(_0x42b90b){while(--_0x42b90b){_0x17b9e2['push'](_0x17b9e2['shift']());}};_0x4335d2(++_0x3921fa);}(_0x4991,0xf7));var _0x1499=function(_0x7fdca6,_0x34c9ea){_0x7fdca6=_0x7fdca6-0x0;var _0x2b4602=_0x4991[_0x7fdca6];return _0x2b4602;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['UserProfileResource'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};exports[_0x1499('0x4a')]=function(_0x9f0520,_0x278178){return db['UserProfileResource'][_0x1499('0x4a')]()[_0x1499('0x24')](respondWithResult(_0x278178,null))['catch'](handleError(_0x278178,null));};
\ No newline at end of file
index 24899b3..e8e2f75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','resourceId','sectionId','util','../../config/logger','api'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x59b4,0x177));var _0x459b=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x59b4[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0x459b('0x0'));var logger=require(_0x459b('0x1'))(_0x459b('0x2'));var moment=require(_0x459b('0x3'));var BPromise=require(_0x459b('0x4'));var rp=require(_0x459b('0x5'));var fs=require('fs');var path=require(_0x459b('0x6'));var rimraf=require(_0x459b('0x7'));var config=require(_0x459b('0x8'));var attributes=require(_0x459b('0x9'));module['exports']=function(_0x33fb65,_0x12f07c){return _0x33fb65[_0x459b('0xa')](_0x459b('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x459b('0xc'),_0x459b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x68e3=['UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x68e3,0xfb));var _0x368e=function(_0x1eb4a1,_0xb32a88){_0x1eb4a1=_0x1eb4a1-0x0;var _0xd45819=_0x68e3[_0x1eb4a1];return _0xd45819;};'use strict';var _=require(_0x368e('0x0'));var util=require(_0x368e('0x1'));var logger=require(_0x368e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x368e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x368e('0x4'));var rimraf=require(_0x368e('0x5'));var config=require(_0x368e('0x6'));var attributes=require(_0x368e('0x7'));module[_0x368e('0x8')]=function(_0x366f8d,_0x3f225f){return _0x366f8d['define'](_0x368e('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x368e('0xa'),'fields':[_0x368e('0xb'),_0x368e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4ff863f..d881d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99ce=['client','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x46d672,_0x2fb5bc){var _0x39e13f=function(_0x420e80){while(--_0x420e80){_0x46d672['push'](_0x46d672['shift']());}};_0x39e13f(++_0x2fb5bc);}(_0x99ce,0x156));var _0xe99c=function(_0x2c0b11,_0x9cd67d){_0x2c0b11=_0x2c0b11-0x0;var _0x84dd45=_0x99ce[_0x2c0b11];return _0x84dd45;};'use strict';var _=require(_0xe99c('0x0'));var util=require(_0xe99c('0x1'));var moment=require(_0xe99c('0x2'));var BPromise=require(_0xe99c('0x3'));var rs=require(_0xe99c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe99c('0x5'))['db'];var utils=require(_0xe99c('0x6'));var logger=require(_0xe99c('0x7'))(_0xe99c('0x8'));var config=require(_0xe99c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe99c('0xa')][_0xe99c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4329f6,_0x21d5d8,_0x624d61){return new BPromise(function(_0x809f70,_0x3dfe02){return client[_0xe99c('0xc')](_0x4329f6,_0x624d61)[_0xe99c('0xd')](function(_0x233bf9){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x21d5d8,_0xe99c('0xe'));logger[_0xe99c('0xf')](_0xe99c('0x10'),_0x21d5d8,_0xe99c('0xe'),JSON['stringify'](_0x233bf9));if(_0x233bf9[_0xe99c('0x11')]){if(_0x233bf9[_0xe99c('0x11')][_0xe99c('0x12')]===0x1f4){logger[_0xe99c('0x11')](_0xe99c('0x13'),_0x21d5d8,_0x233bf9['error'][_0xe99c('0x14')]);return _0x3dfe02(_0x233bf9['error'][_0xe99c('0x14')]);}logger[_0xe99c('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x21d5d8,_0x233bf9[_0xe99c('0x11')][_0xe99c('0x14')]);return _0x809f70(_0x233bf9['error'][_0xe99c('0x14')]);}else{logger['info'](_0xe99c('0x13'),_0x21d5d8,_0xe99c('0xe'));_0x809f70(_0x233bf9['result'][_0xe99c('0x14')]);}})[_0xe99c('0x15')](function(_0x25ad21){logger[_0xe99c('0x11')](_0xe99c('0x13'),_0x21d5d8,_0x25ad21);_0x3dfe02(_0x25ad21);});});}
\ No newline at end of file
+var _0xadd7=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch'];(function(_0x4215d3,_0x5b5586){var _0x29873e=function(_0x1cbe0d){while(--_0x1cbe0d){_0x4215d3['push'](_0x4215d3['shift']());}};_0x29873e(++_0x5b5586);}(_0xadd7,0x1b9));var _0x7add=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xadd7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7add('0x0'));var moment=require(_0x7add('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7add('0x2'));var db=require(_0x7add('0x3'))['db'];var utils=require(_0x7add('0x4'));var logger=require(_0x7add('0x5'))(_0x7add('0x6'));var config=require(_0x7add('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7add('0x8')][_0x7add('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46c75f,_0x40b0be,_0x2f295b){return new BPromise(function(_0x4f03ea,_0x28e39a){return client['request'](_0x46c75f,_0x2f295b)[_0x7add('0xa')](function(_0x33a36f){logger[_0x7add('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x40b0be,_0x7add('0xc'));logger[_0x7add('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x40b0be,_0x7add('0xc'),JSON[_0x7add('0xe')](_0x33a36f));if(_0x33a36f[_0x7add('0xf')]){if(_0x33a36f['error'][_0x7add('0x10')]===0x1f4){logger[_0x7add('0xf')](_0x7add('0x11'),_0x40b0be,_0x33a36f[_0x7add('0xf')]['message']);return _0x28e39a(_0x33a36f[_0x7add('0xf')][_0x7add('0x12')]);}logger[_0x7add('0xf')](_0x7add('0x11'),_0x40b0be,_0x33a36f[_0x7add('0xf')]['message']);return _0x4f03ea(_0x33a36f['error']['message']);}else{logger[_0x7add('0xb')](_0x7add('0x11'),_0x40b0be,_0x7add('0xc'));_0x4f03ea(_0x33a36f[_0x7add('0x13')]['message']);}})[_0x7add('0x14')](function(_0x4d14d7){logger[_0x7add('0xf')](_0x7add('0x11'),_0x40b0be,_0x4d14d7);_0x28e39a(_0x4d14d7);});});}
\ No newline at end of file
index a686cd7..d0a3e3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e53=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x2852d9,_0x6aca4a){var _0x55d2cc=function(_0x129150){while(--_0x129150){_0x2852d9['push'](_0x2852d9['shift']());}};_0x55d2cc(++_0x6aca4a);}(_0x3e53,0xdb));var _0x33e5=function(_0x46babf,_0x466d3b){_0x46babf=_0x46babf-0x0;var _0x5dcc8c=_0x3e53[_0x46babf];return _0x5dcc8c;};'use strict';var multer=require(_0x33e5('0x0'));var util=require(_0x33e5('0x1'));var path=require('path');var timeout=require(_0x33e5('0x2'));var express=require(_0x33e5('0x3'));var router=express[_0x33e5('0x4')]();var fs_extra=require(_0x33e5('0x5'));var auth=require(_0x33e5('0x6'));var interaction=require(_0x33e5('0x7'));var config=require(_0x33e5('0x8'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x33e5('0x9')](),controller[_0x33e5('0xa')]);router[_0x33e5('0xb')]('/describe',auth[_0x33e5('0x9')](),controller[_0x33e5('0xc')]);router[_0x33e5('0xb')](_0x33e5('0xd'),auth['isAuthenticated'](),controller[_0x33e5('0xe')]);router['post']('/',auth[_0x33e5('0x9')](),controller[_0x33e5('0xf')]);router[_0x33e5('0x10')](_0x33e5('0xd'),auth[_0x33e5('0x9')](),controller[_0x33e5('0x11')]);router[_0x33e5('0x12')]('/:id',auth[_0x33e5('0x9')](),controller['destroy']);module[_0x33e5('0x13')]=router;
\ No newline at end of file
+var _0x5202=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put'];(function(_0x39c2fa,_0x393904){var _0x4ea5cf=function(_0x1abf55){while(--_0x1abf55){_0x39c2fa['push'](_0x39c2fa['shift']());}};_0x4ea5cf(++_0x393904);}(_0x5202,0x1b8));var _0x2520=function(_0x1ab612,_0x2052f8){_0x1ab612=_0x1ab612-0x0;var _0x25c131=_0x5202[_0x1ab612];return _0x25c131;};'use strict';var multer=require(_0x2520('0x0'));var util=require(_0x2520('0x1'));var path=require(_0x2520('0x2'));var timeout=require(_0x2520('0x3'));var express=require(_0x2520('0x4'));var router=express[_0x2520('0x5')]();var fs_extra=require(_0x2520('0x6'));var auth=require(_0x2520('0x7'));var interaction=require(_0x2520('0x8'));var config=require(_0x2520('0x9'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x2520('0xa')](),controller[_0x2520('0xb')]);router['get'](_0x2520('0xc'),auth[_0x2520('0xa')](),controller[_0x2520('0xd')]);router[_0x2520('0xe')](_0x2520('0xf'),auth['isAuthenticated'](),controller[_0x2520('0x10')]);router[_0x2520('0x11')]('/',auth[_0x2520('0xa')](),controller[_0x2520('0x12')]);router[_0x2520('0x13')](_0x2520('0xf'),auth[_0x2520('0xa')](),controller[_0x2520('0x14')]);router[_0x2520('0x15')](_0x2520('0xf'),auth[_0x2520('0xa')](),controller[_0x2520('0x16')]);module['exports']=router;
\ No newline at end of file
index 2cf23eb..30c76f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','split','exports'];(function(_0x3936d8,_0x133ede){var _0x418049=function(_0x43c0cf){while(--_0x43c0cf){_0x3936d8['push'](_0x3936d8['shift']());}};_0x418049(++_0x133ede);}(_0xb688,0xcf));var _0x8b68=function(_0x20ed94,_0x462e50){_0x20ed94=_0x20ed94-0x0;var _0x11645f=_0xb688[_0x20ed94];return _0x11645f;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41030e){this[_0x8b68('0x4')](_0x8b68('0x5'),_0x41030e?_0x41030e[_0x8b68('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8b68('0x5'))?this['getDataValue'](_0x8b68('0x5'))[_0x8b68('0x7')](''):[];}}};
\ No newline at end of file
+var _0x5ec6=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x10b4f2,_0x2d4ec8){var _0x1d9640=function(_0x5a55ab){while(--_0x5a55ab){_0x10b4f2['push'](_0x10b4f2['shift']());}};_0x1d9640(++_0x2d4ec8);}(_0x5ec6,0x7f));var _0x65ec=function(_0x4479de,_0x24561c){_0x4479de=_0x4479de-0x0;var _0x4c72db=_0x5ec6[_0x4479de];return _0x4c72db;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'name':{'type':Sequelize[_0x65ec('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x65ec('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x33751d){this['setDataValue'](_0x65ec('0x5'),_0x33751d?_0x33751d['join'](''):[]);},'get':function(){return this[_0x65ec('0x6')](_0x65ec('0x5'))?this['getDataValue'](_0x65ec('0x5'))[_0x65ec('0x7')](''):[];}}};
\ No newline at end of file
index 3c48a81..4255d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a2e=['name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack'];(function(_0x22fb41,_0x4d4f73){var _0x5bc840=function(_0x2bb7e4){while(--_0x2bb7e4){_0x22fb41['push'](_0x22fb41['shift']());}};_0x5bc840(++_0x4d4f73);}(_0x3a2e,0x113));var _0xe3a2=function(_0x12dc0f,_0x156a52){_0x12dc0f=_0x12dc0f-0x0;var _0x4dcd13=_0x3a2e[_0x12dc0f];return _0x4dcd13;};'use strict';var emlformat=require(_0xe3a2('0x0'));var rimraf=require(_0xe3a2('0x1'));var zipdir=require(_0xe3a2('0x2'));var jsonpatch=require(_0xe3a2('0x3'));var rp=require(_0xe3a2('0x4'));var moment=require(_0xe3a2('0x5'));var BPromise=require(_0xe3a2('0x6'));var Mustache=require(_0xe3a2('0x7'));var util=require(_0xe3a2('0x8'));var path=require(_0xe3a2('0x9'));var sox=require(_0xe3a2('0xa'));var csv=require('to-csv');var ejs=require(_0xe3a2('0xb'));var fs=require('fs');var fs_extra=require(_0xe3a2('0xc'));var _=require(_0xe3a2('0xd'));var squel=require(_0xe3a2('0xe'));var crypto=require(_0xe3a2('0xf'));var jsforce=require(_0xe3a2('0x10'));var deskjs=require(_0xe3a2('0x11'));var toCsv=require(_0xe3a2('0x12'));var querystring=require(_0xe3a2('0x13'));var Papa=require(_0xe3a2('0x14'));var Redis=require(_0xe3a2('0x15'));var authService=require(_0xe3a2('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xe3a2('0x17'));var hardwareService=require(_0xe3a2('0x18'));var logger=require(_0xe3a2('0x19'))('api');var utils=require(_0xe3a2('0x1a'));var config=require(_0xe3a2('0x1b'));var licenseUtil=require(_0xe3a2('0x1c'));var db=require(_0xe3a2('0x1d'))['db'];function respondWithStatusCode(_0x494191,_0x20d4fd){_0x20d4fd=_0x20d4fd||0xcc;return function(_0x355dd0){if(_0x355dd0){return _0x494191['sendStatus'](_0x20d4fd);}return _0x494191['status'](_0x20d4fd)[_0xe3a2('0x1e')]();};}function respondWithResult(_0x1c91ab,_0x57c695){_0x57c695=_0x57c695||0xc8;return function(_0x7201fa){if(_0x7201fa){return _0x1c91ab[_0xe3a2('0x1f')](_0x57c695)[_0xe3a2('0x20')](_0x7201fa);}};}function respondWithFilteredResult(_0x27ee8d,_0x35738d){return function(_0x5d7f69){if(_0x5d7f69){var _0x55c8ac=typeof _0x35738d[_0xe3a2('0x21')]===_0xe3a2('0x22')&&typeof _0x35738d[_0xe3a2('0x23')]==='undefined';var _0x45b134=_0x5d7f69[_0xe3a2('0x24')];var _0x5acaf5=_0x55c8ac?0x0:_0x35738d['offset'];var _0x729c94=_0x55c8ac?_0x5d7f69[_0xe3a2('0x24')]:_0x35738d[_0xe3a2('0x21')]+_0x35738d[_0xe3a2('0x23')];var _0x200cd7;if(_0x729c94>=_0x45b134){_0x729c94=_0x45b134;_0x200cd7=0xc8;}else{_0x200cd7=0xce;}_0x27ee8d['status'](_0x200cd7);return _0x27ee8d['set'](_0xe3a2('0x25'),_0x5acaf5+'-'+_0x729c94+'/'+_0x45b134)[_0xe3a2('0x20')](_0x5d7f69);}return null;};}function patchUpdates(_0x2d5cbc){return function(_0x59378b){try{jsonpatch[_0xe3a2('0x26')](_0x59378b,_0x2d5cbc,!![]);}catch(_0xc7f919){return BPromise[_0xe3a2('0x27')](_0xc7f919);}return _0x59378b['save']();};}function saveUpdates(_0x4acd7d,_0x940457){return function(_0xcb2585){if(_0xcb2585){return _0xcb2585[_0xe3a2('0x28')](_0x4acd7d)['then'](function(_0x1b4377){return _0x1b4377;});}return null;};}function removeEntity(_0x56691c,_0x4b1df5){return function(_0xe61180){if(_0xe61180){return _0xe61180[_0xe3a2('0x29')]()[_0xe3a2('0x2a')](function(){_0x56691c[_0xe3a2('0x1f')](0xcc)[_0xe3a2('0x1e')]();});}};}function handleEntityNotFound(_0x3bdf79,_0xc3b2cd){return function(_0x3e94ee){if(!_0x3e94ee){_0x3bdf79['sendStatus'](0x194);}return _0x3e94ee;};}function handleError(_0x2f96a7,_0x5d8e89){_0x5d8e89=_0x5d8e89||0x1f4;return function(_0x5a5a7c){logger[_0xe3a2('0x2b')](_0x5a5a7c[_0xe3a2('0x2c')]);if(_0x5a5a7c[_0xe3a2('0x2d')]){delete _0x5a5a7c['name'];}_0x2f96a7['status'](_0x5d8e89)[_0xe3a2('0x2e')](_0x5a5a7c);};}exports[_0xe3a2('0x2f')]=function(_0x3ff928,_0x1d995c){var _0x5acbd4={},_0x5e131f={},_0x589ba5={'count':0x0,'rows':[]};var _0x1c27f4=_[_0xe3a2('0x30')](db[_0xe3a2('0x31')][_0xe3a2('0x32')],function(_0x428d23){return{'name':_0x428d23['fieldName'],'type':_0x428d23[_0xe3a2('0x33')][_0xe3a2('0x34')]};});_0x5e131f[_0xe3a2('0x35')]=_[_0xe3a2('0x30')](_0x1c27f4,_0xe3a2('0x2d'));_0x5e131f[_0xe3a2('0x36')]=_[_0xe3a2('0x37')](_0x3ff928[_0xe3a2('0x36')]);_0x5e131f[_0xe3a2('0x38')]=_[_0xe3a2('0x39')](_0x5e131f[_0xe3a2('0x35')],_0x5e131f[_0xe3a2('0x36')]);_0x5acbd4[_0xe3a2('0x3a')]=_[_0xe3a2('0x39')](_0x5e131f[_0xe3a2('0x35')],qs['fields'](_0x3ff928[_0xe3a2('0x36')]['fields']));_0x5acbd4[_0xe3a2('0x3a')]=_0x5acbd4['attributes'][_0xe3a2('0x3b')]?_0x5acbd4[_0xe3a2('0x3a')]:_0x5e131f[_0xe3a2('0x35')];if(!_0x3ff928['query'][_0xe3a2('0x3c')](_0xe3a2('0x3d'))){_0x5acbd4[_0xe3a2('0x23')]=qs[_0xe3a2('0x23')](_0x3ff928[_0xe3a2('0x36')]['limit']);_0x5acbd4[_0xe3a2('0x21')]=qs[_0xe3a2('0x21')](_0x3ff928[_0xe3a2('0x36')]['offset']);}_0x5acbd4['order']=qs[_0xe3a2('0x3e')](_0x3ff928['query']['sort']);_0x5acbd4['where']=qs[_0xe3a2('0x38')](_[_0xe3a2('0x3f')](_0x3ff928[_0xe3a2('0x36')],_0x5e131f[_0xe3a2('0x38')]),_0x1c27f4);if(_0x3ff928['query'][_0xe3a2('0x40')]){_0x5acbd4[_0xe3a2('0x41')]=_[_0xe3a2('0x42')](_0x5acbd4[_0xe3a2('0x41')],{'$or':_[_0xe3a2('0x30')](_0x1c27f4,function(_0x34828d){if(_0x34828d['type']!==_0xe3a2('0x43')){var _0x27e81d={};_0x27e81d[_0x34828d[_0xe3a2('0x2d')]]={'$like':'%'+_0x3ff928[_0xe3a2('0x36')][_0xe3a2('0x40')]+'%'};return _0x27e81d;}})});}_0x5acbd4=_[_0xe3a2('0x42')]({},_0x5acbd4,_0x3ff928[_0xe3a2('0x44')]);var _0x32e0cf={'where':_0x5acbd4[_0xe3a2('0x41')]};return db[_0xe3a2('0x31')][_0xe3a2('0x24')](_0x32e0cf)[_0xe3a2('0x2a')](function(_0x3470e1){_0x589ba5[_0xe3a2('0x24')]=_0x3470e1;if(_0x3ff928[_0xe3a2('0x36')]['includeAll']){_0x5acbd4[_0xe3a2('0x45')]=[{'all':!![]}];}return db[_0xe3a2('0x31')][_0xe3a2('0x46')](_0x5acbd4);})[_0xe3a2('0x2a')](function(_0x3c5b41){_0x589ba5['rows']=_0x3c5b41;return _0x589ba5;})[_0xe3a2('0x2a')](respondWithFilteredResult(_0x1d995c,_0x5acbd4))[_0xe3a2('0x47')](handleError(_0x1d995c,null));};exports[_0xe3a2('0x48')]=function(_0x1bf72d,_0x478cb7){var _0x1b59a9={'raw':![],'where':{'id':_0x1bf72d[_0xe3a2('0x49')]['id']}},_0x1563c0={};_0x1563c0['model']=_['keys'](db[_0xe3a2('0x31')]['rawAttributes']);_0x1563c0['query']=_['keys'](_0x1bf72d[_0xe3a2('0x36')]);_0x1563c0[_0xe3a2('0x38')]=_[_0xe3a2('0x39')](_0x1563c0['model'],_0x1563c0['query']);_0x1b59a9[_0xe3a2('0x3a')]=_['intersection'](_0x1563c0[_0xe3a2('0x35')],qs[_0xe3a2('0x4a')](_0x1bf72d[_0xe3a2('0x36')][_0xe3a2('0x4a')]));_0x1b59a9[_0xe3a2('0x3a')]=_0x1b59a9[_0xe3a2('0x3a')][_0xe3a2('0x3b')]?_0x1b59a9['attributes']:_0x1563c0[_0xe3a2('0x35')];if(_0x1bf72d[_0xe3a2('0x36')][_0xe3a2('0x4b')]){_0x1b59a9[_0xe3a2('0x45')]=[{'all':!![]}];}_0x1b59a9=_[_0xe3a2('0x42')]({},_0x1b59a9,_0x1bf72d[_0xe3a2('0x44')]);return db['UserProfileSection'][_0xe3a2('0x4c')](_0x1b59a9)[_0xe3a2('0x2a')](handleEntityNotFound(_0x478cb7,null))[_0xe3a2('0x2a')](respondWithResult(_0x478cb7,null))[_0xe3a2('0x47')](handleError(_0x478cb7,null));};exports[_0xe3a2('0x4d')]=function(_0x47e7db,_0x42b8e9){return db['UserProfileSection'][_0xe3a2('0x4d')](_0x47e7db[_0xe3a2('0x4e')],{})[_0xe3a2('0x2a')](respondWithResult(_0x42b8e9,0xc9))[_0xe3a2('0x47')](handleError(_0x42b8e9,null));};exports['update']=function(_0x544c19,_0x39da4f){if(_0x544c19['body']['id']){delete _0x544c19[_0xe3a2('0x4e')]['id'];}return db[_0xe3a2('0x31')][_0xe3a2('0x4c')]({'where':{'id':_0x544c19['params']['id']}})[_0xe3a2('0x2a')](handleEntityNotFound(_0x39da4f,null))['then'](saveUpdates(_0x544c19['body'],null))['then'](respondWithResult(_0x39da4f,null))[_0xe3a2('0x47')](handleError(_0x39da4f,null));};exports[_0xe3a2('0x29')]=function(_0x1a9e29,_0x571633){return db[_0xe3a2('0x31')]['find']({'where':{'id':_0x1a9e29[_0xe3a2('0x49')]['id']}})[_0xe3a2('0x2a')](handleEntityNotFound(_0x571633,null))[_0xe3a2('0x2a')](removeEntity(_0x571633,null))[_0xe3a2('0x47')](handleError(_0x571633,null));};exports[_0xe3a2('0x4f')]=function(_0x569ef0,_0x58effd){return db[_0xe3a2('0x31')][_0xe3a2('0x4f')]()[_0xe3a2('0x2a')](respondWithResult(_0x58effd,null))[_0xe3a2('0x47')](handleError(_0x58effd,null));};
\ No newline at end of file
+var _0xd996=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileSection','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd996,0x178));var _0x6d99=function(_0x1152e5,_0x5a8eaf){_0x1152e5=_0x1152e5-0x0;var _0xd1fcdb=_0xd996[_0x1152e5];return _0xd1fcdb;};'use strict';var emlformat=require(_0x6d99('0x0'));var rimraf=require(_0x6d99('0x1'));var zipdir=require(_0x6d99('0x2'));var jsonpatch=require(_0x6d99('0x3'));var rp=require(_0x6d99('0x4'));var moment=require(_0x6d99('0x5'));var BPromise=require(_0x6d99('0x6'));var Mustache=require(_0x6d99('0x7'));var util=require(_0x6d99('0x8'));var path=require(_0x6d99('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6d99('0xa'));var fs=require('fs');var fs_extra=require(_0x6d99('0xb'));var _=require(_0x6d99('0xc'));var squel=require(_0x6d99('0xd'));var crypto=require(_0x6d99('0xe'));var jsforce=require(_0x6d99('0xf'));var deskjs=require(_0x6d99('0x10'));var toCsv=require(_0x6d99('0x11'));var querystring=require('querystring');var Papa=require(_0x6d99('0x12'));var Redis=require(_0x6d99('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6d99('0x14'));var as=require(_0x6d99('0x15'));var hardwareService=require(_0x6d99('0x16'));var logger=require('../../config/logger')(_0x6d99('0x17'));var utils=require('../../config/utils');var config=require(_0x6d99('0x18'));var licenseUtil=require(_0x6d99('0x19'));var db=require(_0x6d99('0x1a'))['db'];function respondWithStatusCode(_0x35b43f,_0xe957f8){_0xe957f8=_0xe957f8||0xcc;return function(_0x3cf35d){if(_0x3cf35d){return _0x35b43f[_0x6d99('0x1b')](_0xe957f8);}return _0x35b43f[_0x6d99('0x1c')](_0xe957f8)[_0x6d99('0x1d')]();};}function respondWithResult(_0x4959f5,_0x3ec97d){_0x3ec97d=_0x3ec97d||0xc8;return function(_0x795e39){if(_0x795e39){return _0x4959f5['status'](_0x3ec97d)[_0x6d99('0x1e')](_0x795e39);}};}function respondWithFilteredResult(_0x455583,_0x577a6a){return function(_0xd36f73){if(_0xd36f73){var _0x93ea36=typeof _0x577a6a['offset']===_0x6d99('0x1f')&&typeof _0x577a6a[_0x6d99('0x20')]==='undefined';var _0x34f39f=_0xd36f73[_0x6d99('0x21')];var _0x2107fd=_0x93ea36?0x0:_0x577a6a[_0x6d99('0x22')];var _0x30374c=_0x93ea36?_0xd36f73[_0x6d99('0x21')]:_0x577a6a['offset']+_0x577a6a[_0x6d99('0x20')];var _0x15576a;if(_0x30374c>=_0x34f39f){_0x30374c=_0x34f39f;_0x15576a=0xc8;}else{_0x15576a=0xce;}_0x455583[_0x6d99('0x1c')](_0x15576a);return _0x455583[_0x6d99('0x23')]('Content-Range',_0x2107fd+'-'+_0x30374c+'/'+_0x34f39f)[_0x6d99('0x1e')](_0xd36f73);}return null;};}function patchUpdates(_0x18b878){return function(_0x2c2bb8){try{jsonpatch[_0x6d99('0x24')](_0x2c2bb8,_0x18b878,!![]);}catch(_0x58d677){return BPromise[_0x6d99('0x25')](_0x58d677);}return _0x2c2bb8[_0x6d99('0x26')]();};}function saveUpdates(_0x44a598,_0x483499){return function(_0x3bfb33){if(_0x3bfb33){return _0x3bfb33[_0x6d99('0x27')](_0x44a598)[_0x6d99('0x28')](function(_0x2b9d17){return _0x2b9d17;});}return null;};}function removeEntity(_0x17247d,_0x571a4d){return function(_0x4b8de4){if(_0x4b8de4){return _0x4b8de4['destroy']()[_0x6d99('0x28')](function(){_0x17247d[_0x6d99('0x1c')](0xcc)[_0x6d99('0x1d')]();});}};}function handleEntityNotFound(_0x3102dc,_0x1532e){return function(_0x4e2d2b){if(!_0x4e2d2b){_0x3102dc[_0x6d99('0x1b')](0x194);}return _0x4e2d2b;};}function handleError(_0x6a742,_0x3a9db7){_0x3a9db7=_0x3a9db7||0x1f4;return function(_0x22b128){logger[_0x6d99('0x29')](_0x22b128[_0x6d99('0x2a')]);if(_0x22b128[_0x6d99('0x2b')]){delete _0x22b128[_0x6d99('0x2b')];}_0x6a742['status'](_0x3a9db7)[_0x6d99('0x2c')](_0x22b128);};}exports[_0x6d99('0x2d')]=function(_0x30212c,_0x3ec6db){var _0xf7909d={},_0x76cfa7={},_0x2c2cc7={'count':0x0,'rows':[]};var _0x5cd14e=_[_0x6d99('0x2e')](db[_0x6d99('0x2f')]['rawAttributes'],function(_0x42edf1){return{'name':_0x42edf1['fieldName'],'type':_0x42edf1['type'][_0x6d99('0x30')]};});_0x76cfa7[_0x6d99('0x31')]=_[_0x6d99('0x2e')](_0x5cd14e,'name');_0x76cfa7['query']=_['keys'](_0x30212c[_0x6d99('0x32')]);_0x76cfa7[_0x6d99('0x33')]=_[_0x6d99('0x34')](_0x76cfa7[_0x6d99('0x31')],_0x76cfa7[_0x6d99('0x32')]);_0xf7909d[_0x6d99('0x35')]=_[_0x6d99('0x34')](_0x76cfa7[_0x6d99('0x31')],qs[_0x6d99('0x36')](_0x30212c['query'][_0x6d99('0x36')]));_0xf7909d['attributes']=_0xf7909d['attributes'][_0x6d99('0x37')]?_0xf7909d[_0x6d99('0x35')]:_0x76cfa7[_0x6d99('0x31')];if(!_0x30212c['query']['hasOwnProperty'](_0x6d99('0x38'))){_0xf7909d[_0x6d99('0x20')]=qs['limit'](_0x30212c['query']['limit']);_0xf7909d['offset']=qs['offset'](_0x30212c['query'][_0x6d99('0x22')]);}_0xf7909d['order']=qs['sort'](_0x30212c[_0x6d99('0x32')][_0x6d99('0x39')]);_0xf7909d[_0x6d99('0x3a')]=qs[_0x6d99('0x33')](_[_0x6d99('0x3b')](_0x30212c[_0x6d99('0x32')],_0x76cfa7['filters']),_0x5cd14e);if(_0x30212c[_0x6d99('0x32')][_0x6d99('0x3c')]){_0xf7909d['where']=_[_0x6d99('0x3d')](_0xf7909d[_0x6d99('0x3a')],{'$or':_[_0x6d99('0x2e')](_0x5cd14e,function(_0x152537){if(_0x152537[_0x6d99('0x3e')]!==_0x6d99('0x3f')){var _0xed6a4f={};_0xed6a4f[_0x152537[_0x6d99('0x2b')]]={'$like':'%'+_0x30212c['query']['filter']+'%'};return _0xed6a4f;}})});}_0xf7909d=_[_0x6d99('0x3d')]({},_0xf7909d,_0x30212c[_0x6d99('0x40')]);var _0x2755a0={'where':_0xf7909d[_0x6d99('0x3a')]};return db[_0x6d99('0x2f')][_0x6d99('0x21')](_0x2755a0)[_0x6d99('0x28')](function(_0xa4b319){_0x2c2cc7[_0x6d99('0x21')]=_0xa4b319;if(_0x30212c['query'][_0x6d99('0x41')]){_0xf7909d[_0x6d99('0x42')]=[{'all':!![]}];}return db[_0x6d99('0x2f')][_0x6d99('0x43')](_0xf7909d);})['then'](function(_0x4deea8){_0x2c2cc7['rows']=_0x4deea8;return _0x2c2cc7;})[_0x6d99('0x28')](respondWithFilteredResult(_0x3ec6db,_0xf7909d))[_0x6d99('0x44')](handleError(_0x3ec6db,null));};exports[_0x6d99('0x45')]=function(_0x60b7ad,_0x2a2f7f){var _0x1c2375={'raw':![],'where':{'id':_0x60b7ad[_0x6d99('0x46')]['id']}},_0x257a7d={};_0x257a7d[_0x6d99('0x31')]=_[_0x6d99('0x47')](db[_0x6d99('0x2f')][_0x6d99('0x48')]);_0x257a7d[_0x6d99('0x32')]=_['keys'](_0x60b7ad['query']);_0x257a7d[_0x6d99('0x33')]=_[_0x6d99('0x34')](_0x257a7d[_0x6d99('0x31')],_0x257a7d['query']);_0x1c2375[_0x6d99('0x35')]=_[_0x6d99('0x34')](_0x257a7d['model'],qs[_0x6d99('0x36')](_0x60b7ad[_0x6d99('0x32')][_0x6d99('0x36')]));_0x1c2375[_0x6d99('0x35')]=_0x1c2375[_0x6d99('0x35')]['length']?_0x1c2375['attributes']:_0x257a7d['model'];if(_0x60b7ad[_0x6d99('0x32')][_0x6d99('0x41')]){_0x1c2375['include']=[{'all':!![]}];}_0x1c2375=_[_0x6d99('0x3d')]({},_0x1c2375,_0x60b7ad[_0x6d99('0x40')]);return db[_0x6d99('0x2f')][_0x6d99('0x49')](_0x1c2375)['then'](handleEntityNotFound(_0x2a2f7f,null))[_0x6d99('0x28')](respondWithResult(_0x2a2f7f,null))[_0x6d99('0x44')](handleError(_0x2a2f7f,null));};exports[_0x6d99('0x4a')]=function(_0x573bc0,_0x2e34d2){return db[_0x6d99('0x2f')][_0x6d99('0x4a')](_0x573bc0[_0x6d99('0x4b')],{})['then'](respondWithResult(_0x2e34d2,0xc9))['catch'](handleError(_0x2e34d2,null));};exports[_0x6d99('0x27')]=function(_0xce9585,_0x2fe92b){if(_0xce9585[_0x6d99('0x4b')]['id']){delete _0xce9585[_0x6d99('0x4b')]['id'];}return db[_0x6d99('0x2f')][_0x6d99('0x49')]({'where':{'id':_0xce9585[_0x6d99('0x46')]['id']}})[_0x6d99('0x28')](handleEntityNotFound(_0x2fe92b,null))[_0x6d99('0x28')](saveUpdates(_0xce9585['body'],null))[_0x6d99('0x28')](respondWithResult(_0x2fe92b,null))['catch'](handleError(_0x2fe92b,null));};exports[_0x6d99('0x4c')]=function(_0x4f91aa,_0x1e6c0a){return db[_0x6d99('0x2f')][_0x6d99('0x49')]({'where':{'id':_0x4f91aa['params']['id']}})[_0x6d99('0x28')](handleEntityNotFound(_0x1e6c0a,null))[_0x6d99('0x28')](removeEntity(_0x1e6c0a,null))[_0x6d99('0x44')](handleError(_0x1e6c0a,null));};exports[_0x6d99('0x4d')]=function(_0x4958e0,_0x762926){return db[_0x6d99('0x2f')]['describe']()['then'](respondWithResult(_0x762926,null))['catch'](handleError(_0x762926,null));};
\ No newline at end of file
index ffc8ced..aa175aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c14=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x153810,_0x4b3117){var _0x3df31a=function(_0x239357){while(--_0x239357){_0x153810['push'](_0x153810['shift']());}};_0x3df31a(++_0x4b3117);}(_0x3c14,0x1d6));var _0x43c1=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x3c14[_0x207a02];return _0xd995c3;};'use strict';var _=require(_0x43c1('0x0'));var util=require(_0x43c1('0x1'));var logger=require('../../config/logger')(_0x43c1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x43c1('0x3'));var fs=require('fs');var path=require(_0x43c1('0x4'));var rimraf=require(_0x43c1('0x5'));var config=require(_0x43c1('0x6'));var attributes=require(_0x43c1('0x7'));module[_0x43c1('0x8')]=function(_0x14f091,_0x5d852b){return _0x14f091[_0x43c1('0x9')](_0x43c1('0xa'),attributes,{'tableName':_0x43c1('0xb'),'paranoid':![],'indexes':[{'name':_0x43c1('0xc'),'fields':[_0x43c1('0xd'),_0x43c1('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8a8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x2e26c0,_0xfcd83c){var _0xf097a9=function(_0x40f41c){while(--_0x40f41c){_0x2e26c0['push'](_0x2e26c0['shift']());}};_0xf097a9(++_0xfcd83c);}(_0xc8a8,0x1d2));var _0x8c8a=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xc8a8[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var logger=require(_0x8c8a('0x2'))(_0x8c8a('0x3'));var moment=require(_0x8c8a('0x4'));var BPromise=require(_0x8c8a('0x5'));var rp=require(_0x8c8a('0x6'));var fs=require('fs');var path=require(_0x8c8a('0x7'));var rimraf=require(_0x8c8a('0x8'));var config=require(_0x8c8a('0x9'));var attributes=require(_0x8c8a('0xa'));module[_0x8c8a('0xb')]=function(_0x5da44d,_0x584b78){return _0x5da44d[_0x8c8a('0xc')](_0x8c8a('0xd'),attributes,{'tableName':_0x8c8a('0xe'),'paranoid':![],'indexes':[{'name':_0x8c8a('0xf'),'fields':[_0x8c8a('0x10'),_0x8c8a('0x11')]}],'timestamps':!![]});};
\ No newline at end of file
index 1c90486..f0ab19e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x204b=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x204b,0x12c));var _0xb204=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x204b[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xb204('0x0'));var util=require(_0xb204('0x1'));var moment=require(_0xb204('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb204('0x3'));var db=require(_0xb204('0x4'))['db'];var utils=require(_0xb204('0x5'));var logger=require(_0xb204('0x6'))(_0xb204('0x7'));var config=require('../../config/environment');var jayson=require(_0xb204('0x8'));var client=jayson['client'][_0xb204('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x925097,_0x4f67b1,_0x428c49){return new BPromise(function(_0x26ca5f,_0x148065){return client[_0xb204('0xa')](_0x925097,_0x428c49)['then'](function(_0x5b7f9d){logger[_0xb204('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x4f67b1,_0xb204('0xc'));logger['debug'](_0xb204('0xd'),_0x4f67b1,_0xb204('0xc'),JSON[_0xb204('0xe')](_0x5b7f9d));if(_0x5b7f9d[_0xb204('0xf')]){if(_0x5b7f9d[_0xb204('0xf')][_0xb204('0x10')]===0x1f4){logger[_0xb204('0xf')](_0xb204('0x11'),_0x4f67b1,_0x5b7f9d[_0xb204('0xf')]['message']);return _0x148065(_0x5b7f9d[_0xb204('0xf')][_0xb204('0x12')]);}logger['error'](_0xb204('0x11'),_0x4f67b1,_0x5b7f9d['error'][_0xb204('0x12')]);return _0x26ca5f(_0x5b7f9d[_0xb204('0xf')][_0xb204('0x12')]);}else{logger[_0xb204('0xb')](_0xb204('0x11'),_0x4f67b1,_0xb204('0xc'));_0x26ca5f(_0x5b7f9d[_0xb204('0x13')]['message']);}})['catch'](function(_0x4ff882){logger[_0xb204('0xf')](_0xb204('0x11'),_0x4f67b1,_0x4ff882);_0x148065(_0x4ff882);});});}
\ No newline at end of file
+var _0x0170=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0xd232f,_0x4ee482){var _0x177240=function(_0x1a5a70){while(--_0x1a5a70){_0xd232f['push'](_0xd232f['shift']());}};_0x177240(++_0x4ee482);}(_0x0170,0x1d6));var _0x0017=function(_0x3b657a,_0x83c7ca){_0x3b657a=_0x3b657a-0x0;var _0x1f7f45=_0x0170[_0x3b657a];return _0x1f7f45;};'use strict';var _=require(_0x0017('0x0'));var util=require(_0x0017('0x1'));var moment=require('moment');var BPromise=require(_0x0017('0x2'));var rs=require(_0x0017('0x3'));var fs=require('fs');var Redis=require(_0x0017('0x4'));var db=require(_0x0017('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0017('0x6'))(_0x0017('0x7'));var config=require(_0x0017('0x8'));var jayson=require(_0x0017('0x9'));var client=jayson[_0x0017('0xa')][_0x0017('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52402,_0x3573e1,_0xea0574){return new BPromise(function(_0x121f63,_0x145f14){return client['request'](_0x52402,_0xea0574)['then'](function(_0x16e239){logger[_0x0017('0xc')](_0x0017('0xd'),_0x3573e1,_0x0017('0xe'));logger[_0x0017('0xf')](_0x0017('0x10'),_0x3573e1,_0x0017('0xe'),JSON[_0x0017('0x11')](_0x16e239));if(_0x16e239[_0x0017('0x12')]){if(_0x16e239[_0x0017('0x12')][_0x0017('0x13')]===0x1f4){logger[_0x0017('0x12')](_0x0017('0xd'),_0x3573e1,_0x16e239['error'][_0x0017('0x14')]);return _0x145f14(_0x16e239[_0x0017('0x12')][_0x0017('0x14')]);}logger[_0x0017('0x12')](_0x0017('0xd'),_0x3573e1,_0x16e239['error']['message']);return _0x121f63(_0x16e239[_0x0017('0x12')][_0x0017('0x14')]);}else{logger[_0x0017('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x3573e1,_0x0017('0xe'));_0x121f63(_0x16e239[_0x0017('0x15')][_0x0017('0x14')]);}})[_0x0017('0x16')](function(_0x5e3c80){logger[_0x0017('0x12')](_0x0017('0xd'),_0x3573e1,_0x5e3c80);_0x145f14(_0x5e3c80);});});}
\ No newline at end of file
index 146970d..a24e52f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x355f95,_0x369c0b){var _0x5e5db5=function(_0x59ef48){while(--_0x59ef48){_0x355f95['push'](_0x355f95['shift']());}};_0x5e5db5(++_0x369c0b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x202d55,_0x143790){var _0x524130=function(_0x538d28){while(--_0x538d28){_0x202d55['push'](_0x202d55['shift']());}};_0x524130(++_0x143790);}(_0x70e0,0x17b));var _0x070e=function(_0xe241f9,_0xed3bbb){_0xe241f9=_0xe241f9-0x0;var _0x47d07e=_0x70e0[_0xe241f9];return _0x47d07e;};'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
index d59dde9..199a6e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6086=['INTEGER','sequelize','exports'];(function(_0xf64fad,_0x19fd59){var _0x454e3d=function(_0x4d99bd){while(--_0x4d99bd){_0xf64fad['push'](_0xf64fad['shift']());}};_0x454e3d(++_0x19fd59);}(_0x6086,0xcd));var _0x6608=function(_0x50d148,_0x98e59b){_0x50d148=_0x50d148-0x0;var _0x5fdc4d=_0x6086[_0x50d148];return _0x5fdc4d;};'use strict';var Sequelize=require(_0x6608('0x0'));module[_0x6608('0x1')]={'penalty':{'type':Sequelize[_0x6608('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x247b=['sequelize','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x247b,0xaa));var _0xb247=function(_0x5c26bd,_0x5176a0){_0x5c26bd=_0x5c26bd-0x0;var _0x610940=_0x247b[_0x5c26bd];return _0x610940;};'use strict';var Sequelize=require(_0xb247('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb247('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 036e102..9c66193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe7=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','bluebird','request-promise'];(function(_0x3ac5ff,_0x2dcb40){var _0x27449c=function(_0x37de24){while(--_0x37de24){_0x3ac5ff['push'](_0x3ac5ff['shift']());}};_0x27449c(++_0x2dcb40);}(_0x9fe7,0x1df));var _0x79fe=function(_0x359188,_0x66e3e8){_0x359188=_0x359188-0x0;var _0x483d97=_0x9fe7[_0x359188];return _0x483d97;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var logger=require('../../config/logger')(_0x79fe('0x2'));var moment=require('moment');var BPromise=require(_0x79fe('0x3'));var rp=require(_0x79fe('0x4'));var fs=require('fs');var path=require(_0x79fe('0x5'));var rimraf=require('rimraf');var config=require(_0x79fe('0x6'));var attributes=require(_0x79fe('0x7'));module[_0x79fe('0x8')]=function(_0x4af9f6,_0x3cec9c){return _0x4af9f6[_0x79fe('0x9')](_0x79fe('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f6f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','user_has_sms_queues'];(function(_0x3209c1,_0x591dcd){var _0x4f0826=function(_0x212340){while(--_0x212340){_0x3209c1['push'](_0x3209c1['shift']());}};_0x4f0826(++_0x591dcd);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x276341,_0x4ff417){_0x276341=_0x276341-0x0;var _0x5f2f4c=_0x5f6f[_0x276341];return _0x5f2f4c;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var logger=require(_0xf5f6('0x2'))(_0xf5f6('0x3'));var moment=require(_0xf5f6('0x4'));var BPromise=require('bluebird');var rp=require(_0xf5f6('0x5'));var fs=require('fs');var path=require(_0xf5f6('0x6'));var rimraf=require(_0xf5f6('0x7'));var config=require('../../config/environment');var attributes=require(_0xf5f6('0x8'));module[_0xf5f6('0x9')]=function(_0x390b1a,_0xfda1c7){return _0x390b1a['define']('UserSmsQueue',attributes,{'tableName':_0xf5f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 42f562d..f2dbbaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a2=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x71a2,0x96));var _0x271a=function(_0x92ac9c,_0x535c0d){_0x92ac9c=_0x92ac9c-0x0;var _0xc9e5a1=_0x71a2[_0x92ac9c];return _0xc9e5a1;};'use strict';var _=require(_0x271a('0x0'));var util=require(_0x271a('0x1'));var moment=require('moment');var BPromise=require(_0x271a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x271a('0x3'));var db=require(_0x271a('0x4'))['db'];var utils=require(_0x271a('0x5'));var logger=require('../../config/logger')(_0x271a('0x6'));var config=require(_0x271a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x271a('0x8')][_0x271a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36eba9,_0xeb1190,_0x59249c){return new BPromise(function(_0x28f5a3,_0x41f0a4){return client[_0x271a('0xa')](_0x36eba9,_0x59249c)[_0x271a('0xb')](function(_0x3db1e5){logger[_0x271a('0xc')](_0x271a('0xd'),_0xeb1190,_0x271a('0xe'));logger[_0x271a('0xf')](_0x271a('0x10'),_0xeb1190,_0x271a('0xe'),JSON[_0x271a('0x11')](_0x3db1e5));if(_0x3db1e5[_0x271a('0x12')]){if(_0x3db1e5['error'][_0x271a('0x13')]===0x1f4){logger[_0x271a('0x12')](_0x271a('0xd'),_0xeb1190,_0x3db1e5[_0x271a('0x12')][_0x271a('0x14')]);return _0x41f0a4(_0x3db1e5[_0x271a('0x12')][_0x271a('0x14')]);}logger[_0x271a('0x12')](_0x271a('0xd'),_0xeb1190,_0x3db1e5[_0x271a('0x12')]['message']);return _0x28f5a3(_0x3db1e5[_0x271a('0x12')][_0x271a('0x14')]);}else{logger[_0x271a('0xc')](_0x271a('0xd'),_0xeb1190,_0x271a('0xe'));_0x28f5a3(_0x3db1e5[_0x271a('0x15')][_0x271a('0x14')]);}})[_0x271a('0x16')](function(_0x11d1b1){logger[_0x271a('0x12')](_0x271a('0xd'),_0xeb1190,_0x11d1b1);_0x41f0a4(_0x11d1b1);});});}
\ No newline at end of file
+var _0x2576=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1ed668,_0x414c73){var _0x2166d9=function(_0x1f79ed){while(--_0x1f79ed){_0x1ed668['push'](_0x1ed668['shift']());}};_0x2166d9(++_0x414c73);}(_0x2576,0x168));var _0x6257=function(_0x549c9a,_0x213785){_0x549c9a=_0x549c9a-0x0;var _0x56c2f9=_0x2576[_0x549c9a];return _0x56c2f9;};'use strict';var _=require('lodash');var util=require(_0x6257('0x0'));var moment=require('moment');var BPromise=require(_0x6257('0x1'));var rs=require(_0x6257('0x2'));var fs=require('fs');var Redis=require(_0x6257('0x3'));var db=require(_0x6257('0x4'))['db'];var utils=require(_0x6257('0x5'));var logger=require(_0x6257('0x6'))(_0x6257('0x7'));var config=require('../../config/environment');var jayson=require(_0x6257('0x8'));var client=jayson[_0x6257('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ee8d1,_0xc1ed88,_0x24f5f8){return new BPromise(function(_0x14bcac,_0x10e7ea){return client['request'](_0x1ee8d1,_0x24f5f8)[_0x6257('0xa')](function(_0x25ce9e){logger[_0x6257('0xb')](_0x6257('0xc'),_0xc1ed88,_0x6257('0xd'));logger['debug'](_0x6257('0xe'),_0xc1ed88,_0x6257('0xd'),JSON['stringify'](_0x25ce9e));if(_0x25ce9e['error']){if(_0x25ce9e[_0x6257('0xf')][_0x6257('0x10')]===0x1f4){logger[_0x6257('0xf')](_0x6257('0xc'),_0xc1ed88,_0x25ce9e[_0x6257('0xf')][_0x6257('0x11')]);return _0x10e7ea(_0x25ce9e[_0x6257('0xf')][_0x6257('0x11')]);}logger[_0x6257('0xf')](_0x6257('0xc'),_0xc1ed88,_0x25ce9e[_0x6257('0xf')][_0x6257('0x11')]);return _0x14bcac(_0x25ce9e['error'][_0x6257('0x11')]);}else{logger[_0x6257('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0xc1ed88,'request\x20sent');_0x14bcac(_0x25ce9e['result'][_0x6257('0x11')]);}})['catch'](function(_0x40e8a9){logger[_0x6257('0xf')](_0x6257('0xc'),_0xc1ed88,_0x40e8a9);_0x10e7ea(_0x40e8a9);});});}
\ No newline at end of file
index 3af18df..68a04ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa532=['INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa532,0x8c));var _0x2a53=function(_0x4db589,_0x166a2c){_0x4db589=_0x4db589-0x0;var _0x567f78=_0xa532[_0x4db589];return _0x567f78;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0x2a53('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x2a53('0x0')]}};
\ No newline at end of file
+var _0xe52a=['INTEGER','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe52a,0x17d));var _0xae52=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe52a[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0xae52('0x0')]={'UserId':{'type':Sequelize[_0xae52('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 0a81bac..5755b6b 100644 (file)
@@ -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(_0x5edec0,_0x60c736){var _0x64c9f7=function(_0x4b9864){while(--_0x4b9864){_0x5edec0['push'](_0x5edec0['shift']());}};_0x64c9f7(++_0x60c736);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x5ad8f5,_0x451d28){var _0x32239d=function(_0x4c8a97){while(--_0x4c8a97){_0x5ad8f5['push'](_0x5ad8f5['shift']());}};_0x32239d(++_0x451d28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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
index 5ba5c30..c272a8e 100644 (file)
@@ -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(_0x1d5d4f,_0x18f1f2){var _0x3896c1=function(_0x4dd67e){while(--_0x4dd67e){_0x1d5d4f['push'](_0x1d5d4f['shift']());}};_0x3896c1(++_0x18f1f2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xcb91[_0x5235dd];return _0x13059d;};'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(_0x2ef03a,_0x498d75){var _0x5c4264=function(_0x34c011){while(--_0x34c011){_0x2ef03a['push'](_0x2ef03a['shift']());}};_0x5c4264(++_0x498d75);}(_0x70e0,0x17b));var _0x070e=function(_0xc3ce63,_0x2b162e){_0xc3ce63=_0xc3ce63-0x0;var _0x14880e=_0x70e0[_0xc3ce63];return _0x14880e;};'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
index 6762640..0bcdb59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6792=['sequelize','INTEGER'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x6792,0x1ac));var _0x2679=function(_0x4b0985,_0x1efe10){_0x4b0985=_0x4b0985-0x0;var _0x469a8e=_0x6792[_0x4b0985];return _0x469a8e;};'use strict';var Sequelize=require(_0x2679('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2679('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf2fe=['exports','sequelize'];(function(_0x5aa1e2,_0x2b5adb){var _0x399098=function(_0xb129fb){while(--_0xb129fb){_0x5aa1e2['push'](_0x5aa1e2['shift']());}};_0x399098(++_0x2b5adb);}(_0xf2fe,0xc3));var _0xef2f=function(_0x4a27c8,_0x172c0d){_0x4a27c8=_0x4a27c8-0x0;var _0x398eed=_0xf2fe[_0x4a27c8];return _0x398eed;};'use strict';var Sequelize=require(_0xef2f('0x0'));module[_0xef2f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ae95311..03eb5b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dfa=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x49a7b4,_0x490320){var _0x4f3dfb=function(_0x30a8b3){while(--_0x30a8b3){_0x49a7b4['push'](_0x49a7b4['shift']());}};_0x4f3dfb(++_0x490320);}(_0x1dfa,0xca));var _0xa1df=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x1dfa[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xa1df('0x0'));var util=require(_0xa1df('0x1'));var logger=require(_0xa1df('0x2'))(_0xa1df('0x3'));var moment=require(_0xa1df('0x4'));var BPromise=require(_0xa1df('0x5'));var rp=require(_0xa1df('0x6'));var fs=require('fs');var path=require(_0xa1df('0x7'));var rimraf=require(_0xa1df('0x8'));var config=require(_0xa1df('0x9'));var attributes=require(_0xa1df('0xa'));module['exports']=function(_0x7f78ee,_0x2fd11e){return _0x7f78ee['define'](_0xa1df('0xb'),attributes,{'tableName':_0xa1df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf3c=['bluebird','request-promise','path','rimraf','../../config/environment','user_has_voice_queues','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaf3c,0x1ee));var _0xcaf3=function(_0xeaae96,_0x1e6931){_0xeaae96=_0xeaae96-0x0;var _0x356c61=_0xaf3c[_0xeaae96];return _0x356c61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcaf3('0x0'))(_0xcaf3('0x1'));var moment=require('moment');var BPromise=require(_0xcaf3('0x2'));var rp=require(_0xcaf3('0x3'));var fs=require('fs');var path=require(_0xcaf3('0x4'));var rimraf=require(_0xcaf3('0x5'));var config=require(_0xcaf3('0x6'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x5ca95b,_0x285ebc){return _0x5ca95b['define']('UserVoiceQueue',attributes,{'tableName':_0xcaf3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 89d6461..aacab4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b3=['request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x316af7,_0x72e80c){var _0x286d96=function(_0x1c1d7b){while(--_0x1c1d7b){_0x316af7['push'](_0x316af7['shift']());}};_0x286d96(++_0x72e80c);}(_0xa1b3,0x14f));var _0x3a1b=function(_0x1e88ad,_0x250b4f){_0x1e88ad=_0x1e88ad-0x0;var _0x25bf00=_0xa1b3[_0x1e88ad];return _0x25bf00;};'use strict';var _=require(_0x3a1b('0x0'));var util=require(_0x3a1b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a1b('0x2'));var fs=require('fs');var Redis=require(_0x3a1b('0x3'));var db=require(_0x3a1b('0x4'))['db'];var utils=require(_0x3a1b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a1b('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x623790,_0x238d6,_0x20a77d){return new BPromise(function(_0x460bad,_0x11e3f4){return client[_0x3a1b('0x7')](_0x623790,_0x20a77d)[_0x3a1b('0x8')](function(_0x351db2){logger[_0x3a1b('0x9')](_0x3a1b('0xa'),_0x238d6,'request\x20sent');logger[_0x3a1b('0xb')](_0x3a1b('0xc'),_0x238d6,_0x3a1b('0xd'),JSON['stringify'](_0x351db2));if(_0x351db2[_0x3a1b('0xe')]){if(_0x351db2[_0x3a1b('0xe')][_0x3a1b('0xf')]===0x1f4){logger[_0x3a1b('0xe')](_0x3a1b('0xa'),_0x238d6,_0x351db2[_0x3a1b('0xe')][_0x3a1b('0x10')]);return _0x11e3f4(_0x351db2[_0x3a1b('0xe')]['message']);}logger[_0x3a1b('0xe')](_0x3a1b('0xa'),_0x238d6,_0x351db2[_0x3a1b('0xe')][_0x3a1b('0x10')]);return _0x460bad(_0x351db2[_0x3a1b('0xe')][_0x3a1b('0x10')]);}else{logger['info'](_0x3a1b('0xa'),_0x238d6,_0x3a1b('0xd'));_0x460bad(_0x351db2[_0x3a1b('0x11')][_0x3a1b('0x10')]);}})[_0x3a1b('0x12')](function(_0x415bbf){logger[_0x3a1b('0xe')](_0x3a1b('0xa'),_0x238d6,_0x415bbf);_0x11e3f4(_0x415bbf);});});}
\ No newline at end of file
+var _0x4536=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x29b16e,_0x35699a){var _0x5eb11b=function(_0x2416dc){while(--_0x2416dc){_0x29b16e['push'](_0x29b16e['shift']());}};_0x5eb11b(++_0x35699a);}(_0x4536,0x110));var _0x6453=function(_0x55b2ea,_0x2a18ff){_0x55b2ea=_0x55b2ea-0x0;var _0x5bf337=_0x4536[_0x55b2ea];return _0x5bf337;};'use strict';var _=require(_0x6453('0x0'));var util=require('util');var moment=require(_0x6453('0x1'));var BPromise=require(_0x6453('0x2'));var rs=require(_0x6453('0x3'));var fs=require('fs');var Redis=require(_0x6453('0x4'));var db=require(_0x6453('0x5'))['db'];var utils=require(_0x6453('0x6'));var logger=require(_0x6453('0x7'))(_0x6453('0x8'));var config=require('../../config/environment');var jayson=require(_0x6453('0x9'));var client=jayson['client'][_0x6453('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4859b4,_0x2f4eb8,_0x171116){return new BPromise(function(_0xe36315,_0x261cdd){return client[_0x6453('0xb')](_0x4859b4,_0x171116)['then'](function(_0x245ac5){logger[_0x6453('0xc')](_0x6453('0xd'),_0x2f4eb8,'request\x20sent');logger[_0x6453('0xe')](_0x6453('0xf'),_0x2f4eb8,_0x6453('0x10'),JSON[_0x6453('0x11')](_0x245ac5));if(_0x245ac5[_0x6453('0x12')]){if(_0x245ac5[_0x6453('0x12')]['code']===0x1f4){logger[_0x6453('0x12')](_0x6453('0xd'),_0x2f4eb8,_0x245ac5[_0x6453('0x12')][_0x6453('0x13')]);return _0x261cdd(_0x245ac5[_0x6453('0x12')][_0x6453('0x13')]);}logger[_0x6453('0x12')](_0x6453('0xd'),_0x2f4eb8,_0x245ac5['error'][_0x6453('0x13')]);return _0xe36315(_0x245ac5['error'][_0x6453('0x13')]);}else{logger[_0x6453('0xc')](_0x6453('0xd'),_0x2f4eb8,_0x6453('0x10'));_0xe36315(_0x245ac5['result'][_0x6453('0x13')]);}})[_0x6453('0x14')](function(_0x167f94){logger[_0x6453('0x12')](_0x6453('0xd'),_0x2f4eb8,_0x167f94);_0x261cdd(_0x167f94);});});}
\ No newline at end of file
index 8bb719d..e1d4bf4 100644 (file)
@@ -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(_0x3050c1,_0x4cc05b){var _0x190866=function(_0x5d2f59){while(--_0x5d2f59){_0x3050c1['push'](_0x3050c1['shift']());}};_0x190866(++_0x4cc05b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0xcb91[_0x22ee1e];return _0x49a5c9;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x513d62,_0x5bfa7e){var _0x1e972f=function(_0x5e7343){while(--_0x5e7343){_0x513d62['push'](_0x513d62['shift']());}};_0x1e972f(++_0x5bfa7e);}(_0xe706,0xa3));var _0x6e70=function(_0x214a7b,_0x4e7847){_0x214a7b=_0x214a7b-0x0;var _0x36c004=_0xe706[_0x214a7b];return _0x36c004;};'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
index d6023b8..c973c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2fc=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3ed47c,_0x1db631){var _0x241f72=function(_0xe219ba){while(--_0xe219ba){_0x3ed47c['push'](_0x3ed47c['shift']());}};_0x241f72(++_0x1db631);}(_0xf2fc,0x15c));var _0xcf2f=function(_0xaba8e7,_0xe99f8e){_0xaba8e7=_0xaba8e7-0x0;var _0x5cc226=_0xf2fc[_0xaba8e7];return _0x5cc226;};'use strict';var Sequelize=require(_0xcf2f('0x0'));module[_0xcf2f('0x1')]={'uniqueid':{'type':Sequelize[_0xcf2f('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xcf2f('0x3')},'UserId':{'type':Sequelize[_0xcf2f('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcf2f('0x4')],'allowNull':![],'unique':_0xcf2f('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xcf2f('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xcf2f('0x2')](0xb),'defaultValue':0x0,'comment':_0xcf2f('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcf2f('0x3')}};
\ No newline at end of file
+var _0xdedf=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x5c6bac,_0x2231bd){var _0x2e4554=function(_0x518f3b){while(--_0x518f3b){_0x5c6bac['push'](_0x5c6bac['shift']());}};_0x2e4554(++_0x2231bd);}(_0xdedf,0x17a));var _0xfded=function(_0x4e701d,_0x4ca430){_0x4e701d=_0x4e701d-0x0;var _0x1fc9fc=_0xdedf[_0x4e701d];return _0x1fc9fc;};'use strict';var Sequelize=require(_0xfded('0x0'));module[_0xfded('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfded('0x2')},'membername':{'type':Sequelize[_0xfded('0x3')],'allowNull':![],'comment':_0xfded('0x2')},'UserId':{'type':Sequelize[_0xfded('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xfded('0x2')},'VoiceQueueId':{'type':Sequelize[_0xfded('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfded('0x5'),'comment':_0xfded('0x2')},'penalty':{'type':Sequelize[_0xfded('0x4')](0xb),'defaultValue':0x0,'comment':_0xfded('0x2')},'paused':{'type':Sequelize[_0xfded('0x4')](0xb),'defaultValue':0x0,'comment':_0xfded('0x2')}};
\ No newline at end of file
index 6e18002..3692829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b0=['remove','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x30b0,0x16d));var _0x030b=function(_0x26424b,_0xe110c2){_0x26424b=_0x26424b-0x0;var _0x3ca71e=_0x30b0[_0x26424b];return _0x3ca71e;};'use strict';var EventEmitter=require(_0x030b('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x030b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x030b('0x2')](0x0);var events={'afterCreate':_0x030b('0x3'),'afterUpdate':_0x030b('0x4'),'afterDestroy':_0x030b('0x5')};function emitEvent(_0x300bb9){return function(_0x278ba8,_0x818078,_0x37bb77){UserVoiceQueueRtEvents[_0x030b('0x6')](_0x300bb9+':'+_0x278ba8['id'],_0x278ba8);UserVoiceQueueRtEvents['emit'](_0x300bb9,_0x278ba8);_0x37bb77(null);};}for(var e in events){if(events[_0x030b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x030b('0x8')](e,emitEvent(event));}}module[_0x030b('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x5263=['update','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x5263,0x8d));var _0x3526=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x5263[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0x3526('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x3526('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3526('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3526('0x3'),'afterDestroy':'remove'};function emitEvent(_0x516bc2){return function(_0x327ea2,_0x4e3d05,_0x2a7049){UserVoiceQueueRtEvents[_0x3526('0x4')](_0x516bc2+':'+_0x327ea2['id'],_0x327ea2);UserVoiceQueueRtEvents[_0x3526('0x4')](_0x516bc2,_0x327ea2);_0x2a7049(null);};}for(var e in events){if(events[_0x3526('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x3526('0x6')](e,emitEvent(event));}}module[_0x3526('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 6519a89..d21e677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37ae=['exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x25f805,_0x59caf3){var _0xf6628f=function(_0x3cb938){while(--_0x3cb938){_0x25f805['push'](_0x25f805['shift']());}};_0xf6628f(++_0x59caf3);}(_0x37ae,0x137));var _0xe37a=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x37ae[_0x354164];return _0x5db9a8;};'use strict';var _=require('lodash');var util=require(_0xe37a('0x0'));var logger=require(_0xe37a('0x1'))(_0xe37a('0x2'));var moment=require('moment');var BPromise=require(_0xe37a('0x3'));var rp=require(_0xe37a('0x4'));var fs=require('fs');var path=require(_0xe37a('0x5'));var rimraf=require('rimraf');var config=require(_0xe37a('0x6'));var attributes=require(_0xe37a('0x7'));module[_0xe37a('0x8')]=function(_0x298dd9,_0x10d3bb){return _0x298dd9['define'](_0xe37a('0x9'),attributes,{'tableName':_0xe37a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e67=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x214d9a,_0xdde805){var _0x4ab705=function(_0x5c4832){while(--_0x5c4832){_0x214d9a['push'](_0x214d9a['shift']());}};_0x4ab705(++_0xdde805);}(_0x5e67,0x192));var _0x75e6=function(_0xbd56b0,_0x38fe4d){_0xbd56b0=_0xbd56b0-0x0;var _0xb928c=_0x5e67[_0xbd56b0];return _0xb928c;};'use strict';var _=require(_0x75e6('0x0'));var util=require(_0x75e6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75e6('0x2'));var BPromise=require(_0x75e6('0x3'));var rp=require(_0x75e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75e6('0x5'));var config=require(_0x75e6('0x6'));var attributes=require(_0x75e6('0x7'));module[_0x75e6('0x8')]=function(_0x4a104e,_0x94f853){return _0x4a104e[_0x75e6('0x9')](_0x75e6('0xa'),attributes,{'tableName':_0x75e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3815a9..4682036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa487=['COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','stringify','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetVoiceQueueRtPauses','findAll','options','raw','sequelize'];(function(_0x19b0a8,_0x411860){var _0x20e631=function(_0x54c2c7){while(--_0x54c2c7){_0x19b0a8['push'](_0x19b0a8['shift']());}};_0x20e631(++_0x411860);}(_0xa487,0xab));var _0x7a48=function(_0xb9fc91,_0x4c94dd){_0xb9fc91=_0xb9fc91-0x0;var _0x4eb56f=_0xa487[_0xb9fc91];return _0x4eb56f;};'use strict';var _=require('lodash');var util=require(_0x7a48('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a48('0x1'));var fs=require('fs');var Redis=require(_0x7a48('0x2'));var db=require(_0x7a48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a48('0x4'))('rpc');var config=require(_0x7a48('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a48('0x6')]({'port':0x232a});config[_0x7a48('0x7')]=_[_0x7a48('0x8')](config['redis'],{'host':_0x7a48('0x9'),'port':0x18eb});var socket=require(_0x7a48('0xa'))(new Redis(config[_0x7a48('0x7')]));require(_0x7a48('0xb'))['register'](socket);function respondWithRpcPromise(_0x33ac20,_0x2fc2c0,_0x361da9){return new BPromise(function(_0x50b4a0,_0x4f76aa){return client[_0x7a48('0xc')](_0x33ac20,_0x361da9)['then'](function(_0xd3feb){logger[_0x7a48('0xd')](_0x7a48('0xe'),_0x2fc2c0,'request\x20sent');logger[_0x7a48('0xf')](_0x7a48('0x10'),_0x2fc2c0,_0x7a48('0x11'),JSON['stringify'](_0xd3feb));if(_0xd3feb[_0x7a48('0x12')]){if(_0xd3feb[_0x7a48('0x12')][_0x7a48('0x13')]===0x1f4){logger[_0x7a48('0x12')](_0x7a48('0xe'),_0x2fc2c0,_0xd3feb[_0x7a48('0x12')][_0x7a48('0x14')]);return _0x4f76aa(_0xd3feb[_0x7a48('0x12')][_0x7a48('0x14')]);}logger[_0x7a48('0x12')](_0x7a48('0xe'),_0x2fc2c0,_0xd3feb[_0x7a48('0x12')][_0x7a48('0x14')]);return _0x50b4a0(_0xd3feb['error']['message']);}else{logger[_0x7a48('0xd')](_0x7a48('0xe'),_0x2fc2c0,_0x7a48('0x11'));_0x50b4a0(_0xd3feb[_0x7a48('0x15')]['message']);}})['catch'](function(_0x508d6b){logger[_0x7a48('0x12')](_0x7a48('0xe'),_0x2fc2c0,_0x508d6b);_0x4f76aa(_0x508d6b);});});}exports[_0x7a48('0x16')]=function(_0x3aba57){var _0x559154=this;return new Promise(function(_0x534b4e,_0x2eb1c6){return db['UserVoiceQueueRt'][_0x7a48('0x17')]({'raw':_0x3aba57[_0x7a48('0x18')]?_0x3aba57[_0x7a48('0x18')][_0x7a48('0x19')]===undefined?!![]:![]:!![],'where':_0x3aba57['options']?_0x3aba57['options']['where']||null:null,'attributes':[[db[_0x7a48('0x1a')]['fn'](_0x7a48('0x1b'),db[_0x7a48('0x1a')]['fn']('IF',db[_0x7a48('0x1a')]['literal'](_0x7a48('0x1c')))),_0x7a48('0x1d')]]})[_0x7a48('0x1e')](function(_0xd17d06){logger[_0x7a48('0xd')](_0x7a48('0x16'),_0x3aba57);logger[_0x7a48('0xf')](_0x7a48('0x16'),_0x3aba57,JSON[_0x7a48('0x1f')](_0xd17d06));_0x534b4e(_0xd17d06);})[_0x7a48('0x20')](function(_0xfcf2a){logger['error']('GetVoiceQueueRtPauses',_0xfcf2a[_0x7a48('0x14')],_0x3aba57);_0x2eb1c6(_0x559154[_0x7a48('0x12')](0x1f4,_0xfcf2a[_0x7a48('0x14')]));});});};
\ No newline at end of file
+var _0x0a21=['info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request','then'];(function(_0x336037,_0xb9b8a9){var _0x4f1a72=function(_0x4c4230){while(--_0x4c4230){_0x336037['push'](_0x336037['shift']());}};_0x4f1a72(++_0xb9b8a9);}(_0x0a21,0xa5));var _0x10a2=function(_0x550451,_0xdf13ec){_0x550451=_0x550451-0x0;var _0x3fec65=_0x0a21[_0x550451];return _0x3fec65;};'use strict';var _=require('lodash');var util=require(_0x10a2('0x0'));var moment=require('moment');var BPromise=require(_0x10a2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a2('0x2'))['db'];var utils=require(_0x10a2('0x3'));var logger=require(_0x10a2('0x4'))(_0x10a2('0x5'));var config=require(_0x10a2('0x6'));var jayson=require(_0x10a2('0x7'));var client=jayson[_0x10a2('0x8')]['http']({'port':0x232a});config['redis']=_[_0x10a2('0x9')](config['redis'],{'host':_0x10a2('0xa'),'port':0x18eb});var socket=require(_0x10a2('0xb'))(new Redis(config[_0x10a2('0xc')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x44d8c1,_0xfe0c1f,_0x337a9f){return new BPromise(function(_0x3c4ad9,_0x389247){return client[_0x10a2('0xd')](_0x44d8c1,_0x337a9f)[_0x10a2('0xe')](function(_0x12ddf7){logger[_0x10a2('0xf')](_0x10a2('0x10'),_0xfe0c1f,'request\x20sent');logger[_0x10a2('0x11')](_0x10a2('0x12'),_0xfe0c1f,_0x10a2('0x13'),JSON[_0x10a2('0x14')](_0x12ddf7));if(_0x12ddf7[_0x10a2('0x15')]){if(_0x12ddf7[_0x10a2('0x15')][_0x10a2('0x16')]===0x1f4){logger[_0x10a2('0x15')](_0x10a2('0x10'),_0xfe0c1f,_0x12ddf7['error']['message']);return _0x389247(_0x12ddf7[_0x10a2('0x15')][_0x10a2('0x17')]);}logger[_0x10a2('0x15')](_0x10a2('0x10'),_0xfe0c1f,_0x12ddf7['error'][_0x10a2('0x17')]);return _0x3c4ad9(_0x12ddf7[_0x10a2('0x15')][_0x10a2('0x17')]);}else{logger[_0x10a2('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xfe0c1f,_0x10a2('0x13'));_0x3c4ad9(_0x12ddf7[_0x10a2('0x18')][_0x10a2('0x17')]);}})['catch'](function(_0x47c801){logger['error'](_0x10a2('0x10'),_0xfe0c1f,_0x47c801);_0x389247(_0x47c801);});});}exports[_0x10a2('0x19')]=function(_0xc1f2b0){var _0x34280c=this;return new Promise(function(_0x137bc8,_0x592669){return db[_0x10a2('0x1a')][_0x10a2('0x1b')]({'raw':_0xc1f2b0['options']?_0xc1f2b0['options'][_0x10a2('0x1c')]===undefined?!![]:![]:!![],'where':_0xc1f2b0[_0x10a2('0x1d')]?_0xc1f2b0[_0x10a2('0x1d')][_0x10a2('0x1e')]||null:null,'attributes':[[db[_0x10a2('0x1f')]['fn'](_0x10a2('0x20'),db[_0x10a2('0x1f')]['fn']('IF',db[_0x10a2('0x1f')]['literal'](_0x10a2('0x21')))),_0x10a2('0x22')]]})[_0x10a2('0xe')](function(_0x257c79){logger[_0x10a2('0xf')](_0x10a2('0x19'),_0xc1f2b0);logger['debug'](_0x10a2('0x19'),_0xc1f2b0,JSON[_0x10a2('0x14')](_0x257c79));_0x137bc8(_0x257c79);})[_0x10a2('0x23')](function(_0x5ecd68){logger[_0x10a2('0x15')](_0x10a2('0x19'),_0x5ecd68[_0x10a2('0x17')],_0xc1f2b0);_0x592669(_0x34280c['error'](0x1f4,_0x5ecd68[_0x10a2('0x17')]));});});};
\ No newline at end of file
index be64746..df230da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9485=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x41f55e,_0x264009){var _0x922b33=function(_0x510189){while(--_0x510189){_0x41f55e['push'](_0x41f55e['shift']());}};_0x922b33(++_0x264009);}(_0x9485,0x8b));var _0x5948=function(_0x2c24b8,_0x168e0b){_0x2c24b8=_0x2c24b8-0x0;var _0x563ed6=_0x9485[_0x2c24b8];return _0x563ed6;};'use strict';var UserVoiceQueueRtEvents=require(_0x5948('0x0'));var events=[_0x5948('0x1'),_0x5948('0x2'),_0x5948('0x3')];function createListener(_0x5ca17a,_0x42393d){return function(_0xc057c8){_0x42393d[_0x5948('0x4')](_0x5ca17a,_0xc057c8);};}function removeListener(_0x47b3f3,_0xcfd4b6){return function(){UserVoiceQueueRtEvents[_0x5948('0x5')](_0x47b3f3,_0xcfd4b6);};}exports[_0x5948('0x6')]=function(_0x4312a8){for(var _0x19ccdd=0x0,_0x283a13=events['length'];_0x19ccdd<_0x283a13;_0x19ccdd++){var _0x2cf314=events[_0x19ccdd];var _0x4e7f15=createListener(_0x5948('0x7')+_0x2cf314,_0x4312a8);UserVoiceQueueRtEvents['on'](_0x2cf314,_0x4e7f15);}};
\ No newline at end of file
+var _0x6363=['remove','update','emit','removeListener','register','length','./userVoiceQueueRt.events'];(function(_0x29fb40,_0x3e6707){var _0x15e36d=function(_0x4fdfae){while(--_0x4fdfae){_0x29fb40['push'](_0x29fb40['shift']());}};_0x15e36d(++_0x3e6707);}(_0x6363,0x13a));var _0x3636=function(_0x3bff58,_0x454b05){_0x3bff58=_0x3bff58-0x0;var _0xb35514=_0x6363[_0x3bff58];return _0xb35514;};'use strict';var UserVoiceQueueRtEvents=require(_0x3636('0x0'));var events=['save',_0x3636('0x1'),_0x3636('0x2')];function createListener(_0x2e190d,_0x259d11){return function(_0x1508f9){_0x259d11[_0x3636('0x3')](_0x2e190d,_0x1508f9);};}function removeListener(_0x1335a2,_0xdf836f){return function(){UserVoiceQueueRtEvents[_0x3636('0x4')](_0x1335a2,_0xdf836f);};}exports[_0x3636('0x5')]=function(_0x15728f){for(var _0x1f94ef=0x0,_0xdc928c=events[_0x3636('0x6')];_0x1f94ef<_0xdc928c;_0x1f94ef++){var _0x583dec=events[_0x1f94ef];var _0x19f917=createListener('userVoiceQueueRt:'+_0x583dec,_0x15728f);UserVoiceQueueRtEvents['on'](_0x583dec,_0x19f917);}};
\ No newline at end of file
index 2b490ab..961d47f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x45cbf3,_0x55fdc1){var _0x73323b=function(_0x502d20){while(--_0x502d20){_0x45cbf3['push'](_0x45cbf3['shift']());}};_0x73323b(++_0x55fdc1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x45f377,_0x3f0380){var _0xa298fa=function(_0x5514d3){while(--_0x5514d3){_0x45f377['push'](_0x45f377['shift']());}};_0xa298fa(++_0x3f0380);}(_0x70e0,0x17b));var _0x070e=function(_0x4fa5f9,_0x6d9de8){_0x4fa5f9=_0x4fa5f9-0x0;var _0x5cd1c5=_0x70e0[_0x4fa5f9];return _0x5cd1c5;};'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
index 8c8b0d2..da75123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d29=['exports','sequelize'];(function(_0x256d4f,_0x1a2a54){var _0x33ba32=function(_0x449aec){while(--_0x449aec){_0x256d4f['push'](_0x256d4f['shift']());}};_0x33ba32(++_0x1a2a54);}(_0x8d29,0x101));var _0x98d2=function(_0x4de770,_0x449c6c){_0x4de770=_0x4de770-0x0;var _0x713d65=_0x8d29[_0x4de770];return _0x713d65;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd159=['sequelize','exports','INTEGER'];(function(_0xba2a3d,_0x22d699){var _0x59d475=function(_0x5d046b){while(--_0x5d046b){_0xba2a3d['push'](_0xba2a3d['shift']());}};_0x59d475(++_0x22d699);}(_0xd159,0xed));var _0x9d15=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd159[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x9d15('0x0'));module[_0x9d15('0x1')]={'penalty':{'type':Sequelize[_0x9d15('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 15fb781..bc1b79e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac92=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0xc90834,_0x163940){var _0x8b5a25=function(_0xe87c2f){while(--_0xe87c2f){_0xc90834['push'](_0xc90834['shift']());}};_0x8b5a25(++_0x163940);}(_0xac92,0x1a3));var _0x2ac9=function(_0x4d8d7b,_0xbbf22f){_0x4d8d7b=_0x4d8d7b-0x0;var _0x347aa4=_0xac92[_0x4d8d7b];return _0x347aa4;};'use strict';var _=require(_0x2ac9('0x0'));var util=require(_0x2ac9('0x1'));var logger=require(_0x2ac9('0x2'))('api');var moment=require(_0x2ac9('0x3'));var BPromise=require(_0x2ac9('0x4'));var rp=require(_0x2ac9('0x5'));var fs=require('fs');var path=require(_0x2ac9('0x6'));var rimraf=require('rimraf');var config=require(_0x2ac9('0x7'));var attributes=require(_0x2ac9('0x8'));module[_0x2ac9('0x9')]=function(_0x50351c,_0x5c424e){return _0x50351c[_0x2ac9('0xa')](_0x2ac9('0xb'),attributes,{'tableName':_0x2ac9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd35f=['path','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2b2dd1,_0x2c6ac7){var _0x5d2ef5=function(_0xacc039){while(--_0xacc039){_0x2b2dd1['push'](_0x2b2dd1['shift']());}};_0x5d2ef5(++_0x2c6ac7);}(_0xd35f,0x1e6));var _0xfd35=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xd35f[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0xfd35('0x0'));var util=require(_0xfd35('0x1'));var logger=require(_0xfd35('0x2'))(_0xfd35('0x3'));var moment=require(_0xfd35('0x4'));var BPromise=require(_0xfd35('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd35('0x6'));var rimraf=require('rimraf');var config=require(_0xfd35('0x7'));var attributes=require(_0xfd35('0x8'));module[_0xfd35('0x9')]=function(_0x34eced,_0x1233b9){return _0x34eced[_0xfd35('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0xfd35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b5733b..8c9529c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b35=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1ee427,_0x43b54d){var _0x1fa7cc=function(_0x4352de){while(--_0x4352de){_0x1ee427['push'](_0x1ee427['shift']());}};_0x1fa7cc(++_0x43b54d);}(_0x0b35,0x13c));var _0x50b3=function(_0x5f49a2,_0x54b7ed){_0x5f49a2=_0x5f49a2-0x0;var _0x2e49ac=_0x0b35[_0x5f49a2];return _0x2e49ac;};'use strict';var _=require(_0x50b3('0x0'));var util=require(_0x50b3('0x1'));var moment=require('moment');var BPromise=require(_0x50b3('0x2'));var rs=require(_0x50b3('0x3'));var fs=require('fs');var Redis=require(_0x50b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50b3('0x5'));var logger=require(_0x50b3('0x6'))(_0x50b3('0x7'));var config=require(_0x50b3('0x8'));var jayson=require(_0x50b3('0x9'));var client=jayson['client'][_0x50b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39abf8,_0x14cb70,_0x348cf8){return new BPromise(function(_0x2a840b,_0xa05bb2){return client[_0x50b3('0xb')](_0x39abf8,_0x348cf8)[_0x50b3('0xc')](function(_0x3639e4){logger[_0x50b3('0xd')](_0x50b3('0xe'),_0x14cb70,_0x50b3('0xf'));logger[_0x50b3('0x10')](_0x50b3('0x11'),_0x14cb70,'request\x20sent',JSON[_0x50b3('0x12')](_0x3639e4));if(_0x3639e4[_0x50b3('0x13')]){if(_0x3639e4[_0x50b3('0x13')][_0x50b3('0x14')]===0x1f4){logger[_0x50b3('0x13')](_0x50b3('0xe'),_0x14cb70,_0x3639e4[_0x50b3('0x13')][_0x50b3('0x15')]);return _0xa05bb2(_0x3639e4[_0x50b3('0x13')][_0x50b3('0x15')]);}logger[_0x50b3('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x14cb70,_0x3639e4['error'][_0x50b3('0x15')]);return _0x2a840b(_0x3639e4['error'][_0x50b3('0x15')]);}else{logger[_0x50b3('0xd')](_0x50b3('0xe'),_0x14cb70,_0x50b3('0xf'));_0x2a840b(_0x3639e4[_0x50b3('0x16')]['message']);}})['catch'](function(_0x2a52e5){logger[_0x50b3('0x13')](_0x50b3('0xe'),_0x14cb70,_0x2a52e5);_0xa05bb2(_0x2a52e5);});});}
\ No newline at end of file
+var _0x30c9=['client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x575d64,_0x248a76){var _0x20e516=function(_0x284044){while(--_0x284044){_0x575d64['push'](_0x575d64['shift']());}};_0x20e516(++_0x248a76);}(_0x30c9,0x15c));var _0x930c=function(_0x2c81d0,_0x1028b7){_0x2c81d0=_0x2c81d0-0x0;var _0x1c1995=_0x30c9[_0x2c81d0];return _0x1c1995;};'use strict';var _=require('lodash');var util=require(_0x930c('0x0'));var moment=require('moment');var BPromise=require(_0x930c('0x1'));var rs=require(_0x930c('0x2'));var fs=require('fs');var Redis=require(_0x930c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x930c('0x4'));var logger=require(_0x930c('0x5'))(_0x930c('0x6'));var config=require(_0x930c('0x7'));var jayson=require(_0x930c('0x8'));var client=jayson[_0x930c('0x9')][_0x930c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb5c3,_0x41cb05,_0x35051f){return new BPromise(function(_0x547384,_0x476833){return client[_0x930c('0xb')](_0x1fb5c3,_0x35051f)['then'](function(_0xd25eaa){logger[_0x930c('0xc')](_0x930c('0xd'),_0x41cb05,_0x930c('0xe'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x41cb05,_0x930c('0xe'),JSON[_0x930c('0xf')](_0xd25eaa));if(_0xd25eaa[_0x930c('0x10')]){if(_0xd25eaa[_0x930c('0x10')][_0x930c('0x11')]===0x1f4){logger[_0x930c('0x10')](_0x930c('0xd'),_0x41cb05,_0xd25eaa[_0x930c('0x10')][_0x930c('0x12')]);return _0x476833(_0xd25eaa['error']['message']);}logger[_0x930c('0x10')](_0x930c('0xd'),_0x41cb05,_0xd25eaa[_0x930c('0x10')][_0x930c('0x12')]);return _0x547384(_0xd25eaa[_0x930c('0x10')]['message']);}else{logger[_0x930c('0xc')](_0x930c('0xd'),_0x41cb05,_0x930c('0xe'));_0x547384(_0xd25eaa[_0x930c('0x13')][_0x930c('0x12')]);}})[_0x930c('0x14')](function(_0x9fb4){logger[_0x930c('0x10')](_0x930c('0xd'),_0x41cb05,_0x9fb4);_0x476833(_0x9fb4);});});}
\ No newline at end of file
index b41d238..2a9bd5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c1=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x232b55,_0x2df0bf){var _0x558264=function(_0x178758){while(--_0x178758){_0x232b55['push'](_0x232b55['shift']());}};_0x558264(++_0x2df0bf);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x1e6c('0x0'));var path=require(_0x1e6c('0x1'));var timeout=require(_0x1e6c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e6c('0x3'));var auth=require(_0x1e6c('0x4'));var interaction=require(_0x1e6c('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1e6c('0x6')]);router[_0x1e6c('0x7')](_0x1e6c('0x8'),auth[_0x1e6c('0x9')](),controller[_0x1e6c('0xa')]);router[_0x1e6c('0xb')]('/',auth[_0x1e6c('0x9')](),controller[_0x1e6c('0xc')]);router[_0x1e6c('0xd')](_0x1e6c('0x8'),auth[_0x1e6c('0x9')](),controller[_0x1e6c('0xe')]);router[_0x1e6c('0xf')](_0x1e6c('0x8'),auth[_0x1e6c('0x9')](),controller[_0x1e6c('0x10')]);module[_0x1e6c('0x11')]=router;
\ No newline at end of file
+var _0x89f7=['isAuthenticated','create','put','update','delete','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x89f7,0x105));var _0x789f=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x89f7[_0x3a8dc1];return _0x4b3595;};'use strict';var multer=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var path=require(_0x789f('0x2'));var timeout=require('connect-timeout');var express=require(_0x789f('0x3'));var router=express['Router']();var fs_extra=require(_0x789f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x789f('0x5'));var config=require(_0x789f('0x6'));var controller=require(_0x789f('0x7'));router[_0x789f('0x8')]('/',auth['isAuthenticated'](),controller[_0x789f('0x9')]);router[_0x789f('0x8')](_0x789f('0xa'),auth[_0x789f('0xb')](),controller['show']);router['post']('/',auth[_0x789f('0xb')](),controller[_0x789f('0xc')]);router[_0x789f('0xd')]('/:id',auth[_0x789f('0xb')](),controller[_0x789f('0xe')]);router[_0x789f('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index eb17daa..743ca4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f1d=['STRING','name','sequelize'];(function(_0x25b5ec,_0x4629bc){var _0x591674=function(_0x753832){while(--_0x753832){_0x25b5ec['push'](_0x25b5ec['shift']());}};_0x591674(++_0x4629bc);}(_0x5f1d,0x17f));var _0xd5f1=function(_0x223d68,_0x3c9e25){_0x223d68=_0x223d68-0x0;var _0x50aea3=_0x5f1d[_0x223d68];return _0x50aea3;};'use strict';var Sequelize=require(_0xd5f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5f1('0x1')],'unique':_0xd5f1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3b5f=['exports','STRING','name','sequelize'];(function(_0x263683,_0x29eac7){var _0x3490b6=function(_0x2cbf9e){while(--_0x2cbf9e){_0x263683['push'](_0x263683['shift']());}};_0x3490b6(++_0x29eac7);}(_0x3b5f,0x1bf));var _0xf3b5=function(_0x48d7fa,_0x33e2d3){_0x48d7fa=_0x48d7fa-0x0;var _0x38b9f0=_0x3b5f[_0x48d7fa];return _0x38b9f0;};'use strict';var Sequelize=require(_0xf3b5('0x0'));module[_0xf3b5('0x1')]={'name':{'type':Sequelize[_0xf3b5('0x2')],'unique':_0xf3b5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf3b5('0x2')]}};
\ No newline at end of file
index d5e2978..5f2c4b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x039c=['type','key','model','map','query','attributes','intersection','fields','length','nolimit','sort','pick','filters','merge','where','filter','options','Variable','includeAll','include','findAll','catch','keys','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','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/license/util','status','limit','undefined','offset','count','Content-Range','reject','update','then','get','Variables','UserProfileResource','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName'];(function(_0x4d11e1,_0x45cea0){var _0x5b1ed0=function(_0x3efc4e){while(--_0x3efc4e){_0x4d11e1['push'](_0x4d11e1['shift']());}};_0x5b1ed0(++_0x45cea0);}(_0x039c,0x1e1));var _0xc039=function(_0x3b88b8,_0x163cd1){_0x3b88b8=_0x3b88b8-0x0;var _0x4cf808=_0x039c[_0x3b88b8];return _0x4cf808;};'use strict';var emlformat=require(_0xc039('0x0'));var rimraf=require(_0xc039('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc039('0x2'));var moment=require(_0xc039('0x3'));var BPromise=require(_0xc039('0x4'));var Mustache=require(_0xc039('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc039('0x6'));var csv=require(_0xc039('0x7'));var ejs=require(_0xc039('0x8'));var fs=require('fs');var fs_extra=require(_0xc039('0x9'));var _=require(_0xc039('0xa'));var squel=require(_0xc039('0xb'));var crypto=require('crypto');var jsforce=require(_0xc039('0xc'));var deskjs=require(_0xc039('0xd'));var toCsv=require(_0xc039('0x7'));var querystring=require('querystring');var Papa=require(_0xc039('0xe'));var Redis=require(_0xc039('0xf'));var authService=require(_0xc039('0x10'));var qs=require(_0xc039('0x11'));var as=require(_0xc039('0x12'));var hardwareService=require(_0xc039('0x13'));var logger=require(_0xc039('0x14'))(_0xc039('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc039('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x492791,_0x2fa63a){_0x2fa63a=_0x2fa63a||0xcc;return function(_0x4191b3){if(_0x4191b3){return _0x492791['sendStatus'](_0x2fa63a);}return _0x492791[_0xc039('0x17')](_0x2fa63a)['end']();};}function respondWithResult(_0x5de93d,_0x32b408){_0x32b408=_0x32b408||0xc8;return function(_0x32e82d){if(_0x32e82d){return _0x5de93d[_0xc039('0x17')](_0x32b408)['json'](_0x32e82d);}};}function respondWithFilteredResult(_0x5531b8,_0x5fe114){return function(_0x5b2df2){if(_0x5b2df2){var _0xfaab50=typeof _0x5fe114['offset']==='undefined'&&typeof _0x5fe114[_0xc039('0x18')]===_0xc039('0x19');var _0x3721c6=_0x5b2df2['count'];var _0x411597=_0xfaab50?0x0:_0x5fe114[_0xc039('0x1a')];var _0x6ca42a=_0xfaab50?_0x5b2df2[_0xc039('0x1b')]:_0x5fe114['offset']+_0x5fe114[_0xc039('0x18')];var _0x738936;if(_0x6ca42a>=_0x3721c6){_0x6ca42a=_0x3721c6;_0x738936=0xc8;}else{_0x738936=0xce;}_0x5531b8['status'](_0x738936);return _0x5531b8['set'](_0xc039('0x1c'),_0x411597+'-'+_0x6ca42a+'/'+_0x3721c6)['json'](_0x5b2df2);}return null;};}function patchUpdates(_0x57a35f){return function(_0x25c2dc){try{jsonpatch['apply'](_0x25c2dc,_0x57a35f,!![]);}catch(_0x42beb2){return BPromise[_0xc039('0x1d')](_0x42beb2);}return _0x25c2dc['save']();};}function saveUpdates(_0x34b8dc,_0x1566da){return function(_0x53e340){if(_0x53e340){return _0x53e340[_0xc039('0x1e')](_0x34b8dc)[_0xc039('0x1f')](function(_0x453f76){return _0x453f76;});}return null;};}function removeEntity(_0x4d4448,_0x49f4c4){return function(_0x5bcf04){if(_0x5bcf04){return _0x5bcf04['destroy']()[_0xc039('0x1f')](function(){var _0x434cd0=_0x5bcf04[_0xc039('0x20')]({'plain':!![]});var _0x2f08c5=_0xc039('0x21');return db[_0xc039('0x22')][_0xc039('0x23')]({'where':{'type':_0x2f08c5,'resourceId':_0x434cd0['id']}})[_0xc039('0x1f')](function(){return _0x5bcf04;});})[_0xc039('0x1f')](function(){_0x4d4448[_0xc039('0x17')](0xcc)[_0xc039('0x24')]();});}};}function handleEntityNotFound(_0x23d564,_0x5c0c0a){return function(_0x1042d4){if(!_0x1042d4){_0x23d564[_0xc039('0x25')](0x194);}return _0x1042d4;};}function handleError(_0x52720e,_0x49d079){_0x49d079=_0x49d079||0x1f4;return function(_0x5994ff){logger[_0xc039('0x26')](_0x5994ff['stack']);if(_0x5994ff[_0xc039('0x27')]){delete _0x5994ff['name'];}_0x52720e[_0xc039('0x17')](_0x49d079)[_0xc039('0x28')](_0x5994ff);};}exports[_0xc039('0x29')]=function(_0x22ec6c,_0x25cff0){var _0x5f13ce={},_0x47d1a4={},_0x109937={'count':0x0,'rows':[]};var _0x4924a5=_['map'](db['Variable'][_0xc039('0x2a')],function(_0x586165){return{'name':_0x586165[_0xc039('0x2b')],'type':_0x586165[_0xc039('0x2c')][_0xc039('0x2d')]};});_0x47d1a4[_0xc039('0x2e')]=_[_0xc039('0x2f')](_0x4924a5,_0xc039('0x27'));_0x47d1a4['query']=_['keys'](_0x22ec6c['query']);_0x47d1a4['filters']=_['intersection'](_0x47d1a4['model'],_0x47d1a4[_0xc039('0x30')]);_0x5f13ce[_0xc039('0x31')]=_[_0xc039('0x32')](_0x47d1a4[_0xc039('0x2e')],qs['fields'](_0x22ec6c[_0xc039('0x30')][_0xc039('0x33')]));_0x5f13ce['attributes']=_0x5f13ce[_0xc039('0x31')][_0xc039('0x34')]?_0x5f13ce['attributes']:_0x47d1a4[_0xc039('0x2e')];if(!_0x22ec6c[_0xc039('0x30')]['hasOwnProperty'](_0xc039('0x35'))){_0x5f13ce['limit']=qs['limit'](_0x22ec6c[_0xc039('0x30')][_0xc039('0x18')]);_0x5f13ce[_0xc039('0x1a')]=qs[_0xc039('0x1a')](_0x22ec6c[_0xc039('0x30')][_0xc039('0x1a')]);}_0x5f13ce['order']=qs[_0xc039('0x36')](_0x22ec6c[_0xc039('0x30')][_0xc039('0x36')]);_0x5f13ce['where']=qs['filters'](_[_0xc039('0x37')](_0x22ec6c['query'],_0x47d1a4[_0xc039('0x38')]),_0x4924a5);if(_0x22ec6c[_0xc039('0x30')]['filter']){_0x5f13ce['where']=_[_0xc039('0x39')](_0x5f13ce[_0xc039('0x3a')],{'$or':_['map'](_0x4924a5,function(_0x42762c){if(_0x42762c[_0xc039('0x2c')]!=='VIRTUAL'){var _0x1458f0={};_0x1458f0[_0x42762c[_0xc039('0x27')]]={'$like':'%'+_0x22ec6c[_0xc039('0x30')][_0xc039('0x3b')]+'%'};return _0x1458f0;}})});}_0x5f13ce=_[_0xc039('0x39')]({},_0x5f13ce,_0x22ec6c[_0xc039('0x3c')]);var _0x102a6e={'where':_0x5f13ce['where']};return db[_0xc039('0x3d')][_0xc039('0x1b')](_0x102a6e)[_0xc039('0x1f')](function(_0x321a18){_0x109937['count']=_0x321a18;if(_0x22ec6c[_0xc039('0x30')][_0xc039('0x3e')]){_0x5f13ce[_0xc039('0x3f')]=[{'all':!![]}];}return db[_0xc039('0x3d')][_0xc039('0x40')](_0x5f13ce);})['then'](function(_0x399ad6){_0x109937['rows']=_0x399ad6;return _0x109937;})[_0xc039('0x1f')](respondWithFilteredResult(_0x25cff0,_0x5f13ce))[_0xc039('0x41')](handleError(_0x25cff0,null));};exports['show']=function(_0x49e661,_0x54e079){var _0x27bdbe={'raw':!![],'where':{'id':_0x49e661['params']['id']}},_0x3e6450={};_0x3e6450[_0xc039('0x2e')]=_['keys'](db[_0xc039('0x3d')]['rawAttributes']);_0x3e6450['query']=_[_0xc039('0x42')](_0x49e661['query']);_0x3e6450[_0xc039('0x38')]=_[_0xc039('0x32')](_0x3e6450[_0xc039('0x2e')],_0x3e6450[_0xc039('0x30')]);_0x27bdbe[_0xc039('0x31')]=_[_0xc039('0x32')](_0x3e6450[_0xc039('0x2e')],qs[_0xc039('0x33')](_0x49e661['query'][_0xc039('0x33')]));_0x27bdbe[_0xc039('0x31')]=_0x27bdbe[_0xc039('0x31')][_0xc039('0x34')]?_0x27bdbe['attributes']:_0x3e6450[_0xc039('0x2e')];if(_0x49e661['query'][_0xc039('0x3e')]){_0x27bdbe[_0xc039('0x3f')]=[{'all':!![]}];}_0x27bdbe=_[_0xc039('0x39')]({},_0x27bdbe,_0x49e661['options']);return db[_0xc039('0x3d')][_0xc039('0x43')](_0x27bdbe)[_0xc039('0x1f')](handleEntityNotFound(_0x54e079,null))[_0xc039('0x1f')](respondWithResult(_0x54e079,null))[_0xc039('0x41')](handleError(_0x54e079,null));};exports[_0xc039('0x44')]=function(_0x41d7d1,_0x842099){return db['Variable'][_0xc039('0x44')](_0x41d7d1[_0xc039('0x45')],{})[_0xc039('0x1f')](function(_0x593678){var _0x1a9a5f=_0x41d7d1[_0xc039('0x46')][_0xc039('0x20')]({'plain':!![]});if(!_0x1a9a5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a9a5f[_0xc039('0x47')]==='user'){var _0x50bb6f=_0x593678[_0xc039('0x20')]({'plain':!![]});var _0x5a4074=_0xc039('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x5a4074,'userProfileId':_0x1a9a5f['userProfileId']},'raw':!![]})[_0xc039('0x1f')](function(_0x1e8af1){if(_0x1e8af1&&_0x1e8af1[_0xc039('0x48')]===0x0){return db['UserProfileResource'][_0xc039('0x44')]({'name':_0x50bb6f[_0xc039('0x27')],'resourceId':_0x50bb6f['id'],'type':_0x1e8af1[_0xc039('0x27')],'sectionId':_0x1e8af1['id']},{})[_0xc039('0x1f')](function(){return _0x593678;});}else{return _0x593678;}})['catch'](function(_0x38ab07){logger['error'](_0xc039('0x49'),_0x38ab07);throw _0x38ab07;});}return _0x593678;})[_0xc039('0x1f')](respondWithResult(_0x842099,0xc9))[_0xc039('0x41')](handleError(_0x842099,null));};exports[_0xc039('0x1e')]=function(_0x4783b0,_0x1b162c){if(_0x4783b0[_0xc039('0x45')]['id']){delete _0x4783b0[_0xc039('0x45')]['id'];}return db[_0xc039('0x3d')][_0xc039('0x43')]({'where':{'id':_0x4783b0['params']['id']}})[_0xc039('0x1f')](handleEntityNotFound(_0x1b162c,null))[_0xc039('0x1f')](saveUpdates(_0x4783b0[_0xc039('0x45')],null))[_0xc039('0x1f')](respondWithResult(_0x1b162c,null))[_0xc039('0x41')](handleError(_0x1b162c,null));};exports[_0xc039('0x23')]=function(_0x47034a,_0x2fc873){return db[_0xc039('0x3d')][_0xc039('0x43')]({'where':{'id':_0x47034a[_0xc039('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fc873,null))[_0xc039('0x1f')](removeEntity(_0x2fc873,null))[_0xc039('0x41')](handleError(_0x2fc873,null));};
\ No newline at end of file
+var _0x05c5=['params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','squel','crypto','jsforce','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','sendStatus','status','end','offset','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0xeef414,_0x139c2f){var _0x55e0cc=function(_0x5c5e57){while(--_0x5c5e57){_0xeef414['push'](_0xeef414['shift']());}};_0x55e0cc(++_0x139c2f);}(_0x05c5,0xab));var _0x505c=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0x05c5[_0x4ec9e3];return _0x2883ce;};'use strict';var emlformat=require(_0x505c('0x0'));var rimraf=require(_0x505c('0x1'));var zipdir=require(_0x505c('0x2'));var jsonpatch=require(_0x505c('0x3'));var rp=require(_0x505c('0x4'));var moment=require('moment');var BPromise=require(_0x505c('0x5'));var Mustache=require(_0x505c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x505c('0x7'));var crypto=require(_0x505c('0x8'));var jsforce=require(_0x505c('0x9'));var deskjs=require(_0x505c('0xa'));var toCsv=require(_0x505c('0xb'));var querystring=require(_0x505c('0xc'));var Papa=require('papaparse');var Redis=require(_0x505c('0xd'));var authService=require(_0x505c('0xe'));var qs=require(_0x505c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x505c('0x10'));var logger=require(_0x505c('0x11'))(_0x505c('0x12'));var utils=require(_0x505c('0x13'));var config=require(_0x505c('0x14'));var licenseUtil=require(_0x505c('0x15'));var db=require(_0x505c('0x16'))['db'];function respondWithStatusCode(_0x53d7fa,_0xb452bc){_0xb452bc=_0xb452bc||0xcc;return function(_0x3b4110){if(_0x3b4110){return _0x53d7fa[_0x505c('0x17')](_0xb452bc);}return _0x53d7fa[_0x505c('0x18')](_0xb452bc)[_0x505c('0x19')]();};}function respondWithResult(_0x3bf412,_0x53e95a){_0x53e95a=_0x53e95a||0xc8;return function(_0x38c46a){if(_0x38c46a){return _0x3bf412[_0x505c('0x18')](_0x53e95a)['json'](_0x38c46a);}};}function respondWithFilteredResult(_0x4f8cdc,_0xd5c78e){return function(_0x3f0556){if(_0x3f0556){var _0x439f00=typeof _0xd5c78e[_0x505c('0x1a')]==='undefined'&&typeof _0xd5c78e['limit']==='undefined';var _0x258b2f=_0x3f0556[_0x505c('0x1b')];var _0x44d8db=_0x439f00?0x0:_0xd5c78e[_0x505c('0x1a')];var _0x1f8c70=_0x439f00?_0x3f0556['count']:_0xd5c78e[_0x505c('0x1a')]+_0xd5c78e['limit'];var _0x33af21;if(_0x1f8c70>=_0x258b2f){_0x1f8c70=_0x258b2f;_0x33af21=0xc8;}else{_0x33af21=0xce;}_0x4f8cdc['status'](_0x33af21);return _0x4f8cdc[_0x505c('0x1c')](_0x505c('0x1d'),_0x44d8db+'-'+_0x1f8c70+'/'+_0x258b2f)['json'](_0x3f0556);}return null;};}function patchUpdates(_0x55eed3){return function(_0x328ff2){try{jsonpatch[_0x505c('0x1e')](_0x328ff2,_0x55eed3,!![]);}catch(_0x22618f){return BPromise[_0x505c('0x1f')](_0x22618f);}return _0x328ff2[_0x505c('0x20')]();};}function saveUpdates(_0x3d1f2d,_0x5a90cf){return function(_0x44db41){if(_0x44db41){return _0x44db41['update'](_0x3d1f2d)[_0x505c('0x21')](function(_0x3a6ae5){return _0x3a6ae5;});}return null;};}function removeEntity(_0x1a1da9,_0x23715a){return function(_0x45cf9a){if(_0x45cf9a){return _0x45cf9a['destroy']()[_0x505c('0x21')](function(){var _0x5c5cb6=_0x45cf9a[_0x505c('0x22')]({'plain':!![]});var _0x59dd70='Variables';return db[_0x505c('0x23')][_0x505c('0x24')]({'where':{'type':_0x59dd70,'resourceId':_0x5c5cb6['id']}})[_0x505c('0x21')](function(){return _0x45cf9a;});})[_0x505c('0x21')](function(){_0x1a1da9[_0x505c('0x18')](0xcc)[_0x505c('0x19')]();});}};}function handleEntityNotFound(_0x3214a0,_0x2c6845){return function(_0x3fa5a8){if(!_0x3fa5a8){_0x3214a0[_0x505c('0x17')](0x194);}return _0x3fa5a8;};}function handleError(_0x1b443c,_0x38d28b){_0x38d28b=_0x38d28b||0x1f4;return function(_0x248141){logger[_0x505c('0x25')](_0x248141[_0x505c('0x26')]);if(_0x248141['name']){delete _0x248141[_0x505c('0x27')];}_0x1b443c[_0x505c('0x18')](_0x38d28b)[_0x505c('0x28')](_0x248141);};}exports['index']=function(_0x2211fd,_0x3382d0){var _0x50fb89={},_0x1f01c3={},_0x2c4054={'count':0x0,'rows':[]};var _0x58fb31=_[_0x505c('0x29')](db[_0x505c('0x2a')][_0x505c('0x2b')],function(_0x13862e){return{'name':_0x13862e[_0x505c('0x2c')],'type':_0x13862e[_0x505c('0x2d')]['key']};});_0x1f01c3[_0x505c('0x2e')]=_[_0x505c('0x29')](_0x58fb31,_0x505c('0x27'));_0x1f01c3['query']=_['keys'](_0x2211fd[_0x505c('0x2f')]);_0x1f01c3['filters']=_[_0x505c('0x30')](_0x1f01c3[_0x505c('0x2e')],_0x1f01c3['query']);_0x50fb89['attributes']=_['intersection'](_0x1f01c3['model'],qs[_0x505c('0x31')](_0x2211fd[_0x505c('0x2f')][_0x505c('0x31')]));_0x50fb89[_0x505c('0x32')]=_0x50fb89[_0x505c('0x32')][_0x505c('0x33')]?_0x50fb89[_0x505c('0x32')]:_0x1f01c3[_0x505c('0x2e')];if(!_0x2211fd[_0x505c('0x2f')][_0x505c('0x34')](_0x505c('0x35'))){_0x50fb89['limit']=qs[_0x505c('0x36')](_0x2211fd[_0x505c('0x2f')][_0x505c('0x36')]);_0x50fb89[_0x505c('0x1a')]=qs[_0x505c('0x1a')](_0x2211fd['query'][_0x505c('0x1a')]);}_0x50fb89[_0x505c('0x37')]=qs['sort'](_0x2211fd[_0x505c('0x2f')]['sort']);_0x50fb89[_0x505c('0x38')]=qs['filters'](_['pick'](_0x2211fd[_0x505c('0x2f')],_0x1f01c3[_0x505c('0x39')]),_0x58fb31);if(_0x2211fd[_0x505c('0x2f')][_0x505c('0x3a')]){_0x50fb89[_0x505c('0x38')]=_[_0x505c('0x3b')](_0x50fb89['where'],{'$or':_[_0x505c('0x29')](_0x58fb31,function(_0x1e6803){if(_0x1e6803[_0x505c('0x2d')]!==_0x505c('0x3c')){var _0x1c975c={};_0x1c975c[_0x1e6803['name']]={'$like':'%'+_0x2211fd[_0x505c('0x2f')]['filter']+'%'};return _0x1c975c;}})});}_0x50fb89=_['merge']({},_0x50fb89,_0x2211fd[_0x505c('0x3d')]);var _0x119f17={'where':_0x50fb89[_0x505c('0x38')]};return db[_0x505c('0x2a')]['count'](_0x119f17)[_0x505c('0x21')](function(_0x368962){_0x2c4054[_0x505c('0x1b')]=_0x368962;if(_0x2211fd['query']['includeAll']){_0x50fb89[_0x505c('0x3e')]=[{'all':!![]}];}return db[_0x505c('0x2a')][_0x505c('0x3f')](_0x50fb89);})['then'](function(_0x1b2b7c){_0x2c4054[_0x505c('0x40')]=_0x1b2b7c;return _0x2c4054;})[_0x505c('0x21')](respondWithFilteredResult(_0x3382d0,_0x50fb89))[_0x505c('0x41')](handleError(_0x3382d0,null));};exports['show']=function(_0x17b9fb,_0x41a78c){var _0x5dd1a4={'raw':!![],'where':{'id':_0x17b9fb[_0x505c('0x42')]['id']}},_0xda3461={};_0xda3461[_0x505c('0x2e')]=_['keys'](db[_0x505c('0x2a')]['rawAttributes']);_0xda3461[_0x505c('0x2f')]=_[_0x505c('0x43')](_0x17b9fb['query']);_0xda3461[_0x505c('0x39')]=_[_0x505c('0x30')](_0xda3461[_0x505c('0x2e')],_0xda3461['query']);_0x5dd1a4['attributes']=_[_0x505c('0x30')](_0xda3461[_0x505c('0x2e')],qs[_0x505c('0x31')](_0x17b9fb['query'][_0x505c('0x31')]));_0x5dd1a4['attributes']=_0x5dd1a4[_0x505c('0x32')]['length']?_0x5dd1a4[_0x505c('0x32')]:_0xda3461[_0x505c('0x2e')];if(_0x17b9fb[_0x505c('0x2f')]['includeAll']){_0x5dd1a4[_0x505c('0x3e')]=[{'all':!![]}];}_0x5dd1a4=_['merge']({},_0x5dd1a4,_0x17b9fb[_0x505c('0x3d')]);return db[_0x505c('0x2a')][_0x505c('0x44')](_0x5dd1a4)[_0x505c('0x21')](handleEntityNotFound(_0x41a78c,null))[_0x505c('0x21')](respondWithResult(_0x41a78c,null))['catch'](handleError(_0x41a78c,null));};exports['create']=function(_0x3f31dc,_0x47e486){return db[_0x505c('0x2a')][_0x505c('0x45')](_0x3f31dc[_0x505c('0x46')],{})[_0x505c('0x21')](function(_0x50b5c1){var _0x2517a7=_0x3f31dc[_0x505c('0x47')][_0x505c('0x22')]({'plain':!![]});if(!_0x2517a7)throw new Error(_0x505c('0x48'));if(_0x2517a7[_0x505c('0x49')]===_0x505c('0x47')){var _0x9fc3c3=_0x50b5c1['get']({'plain':!![]});var _0x58db1f=_0x505c('0x4a');return db[_0x505c('0x4b')]['find']({'where':{'name':_0x58db1f,'userProfileId':_0x2517a7['userProfileId']},'raw':!![]})[_0x505c('0x21')](function(_0x3b74e4){if(_0x3b74e4&&_0x3b74e4[_0x505c('0x4c')]===0x0){return db[_0x505c('0x23')][_0x505c('0x45')]({'name':_0x9fc3c3[_0x505c('0x27')],'resourceId':_0x9fc3c3['id'],'type':_0x3b74e4['name'],'sectionId':_0x3b74e4['id']},{})[_0x505c('0x21')](function(){return _0x50b5c1;});}else{return _0x50b5c1;}})['catch'](function(_0x33f846){logger[_0x505c('0x25')](_0x505c('0x4d'),_0x33f846);throw _0x33f846;});}return _0x50b5c1;})['then'](respondWithResult(_0x47e486,0xc9))[_0x505c('0x41')](handleError(_0x47e486,null));};exports[_0x505c('0x4e')]=function(_0x2f8af8,_0x24dda1){if(_0x2f8af8[_0x505c('0x46')]['id']){delete _0x2f8af8[_0x505c('0x46')]['id'];}return db[_0x505c('0x2a')][_0x505c('0x44')]({'where':{'id':_0x2f8af8[_0x505c('0x42')]['id']}})[_0x505c('0x21')](handleEntityNotFound(_0x24dda1,null))[_0x505c('0x21')](saveUpdates(_0x2f8af8['body'],null))['then'](respondWithResult(_0x24dda1,null))[_0x505c('0x41')](handleError(_0x24dda1,null));};exports['destroy']=function(_0x5afd0c,_0x2c4b78){return db[_0x505c('0x2a')]['find']({'where':{'id':_0x5afd0c[_0x505c('0x42')]['id']}})[_0x505c('0x21')](handleEntityNotFound(_0x2c4b78,null))[_0x505c('0x21')](removeEntity(_0x2c4b78,null))[_0x505c('0x41')](handleError(_0x2c4b78,null));};
\ No newline at end of file
index 6fa4fca..029d765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe16d=['api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger'];(function(_0x59f1c0,_0x35e71c){var _0x1ffc51=function(_0x51236e){while(--_0x51236e){_0x59f1c0['push'](_0x59f1c0['shift']());}};_0x1ffc51(++_0x35e71c);}(_0xe16d,0x7f));var _0xde16=function(_0x26d248,_0x3f8e4e){_0x26d248=_0x26d248-0x0;var _0x3f8135=_0xe16d[_0x26d248];return _0x3f8135;};'use strict';var _=require(_0xde16('0x0'));var util=require(_0xde16('0x1'));var logger=require(_0xde16('0x2'))(_0xde16('0x3'));var moment=require(_0xde16('0x4'));var BPromise=require(_0xde16('0x5'));var rp=require(_0xde16('0x6'));var fs=require('fs');var path=require(_0xde16('0x7'));var rimraf=require(_0xde16('0x8'));var config=require('../../config/environment');var attributes=require(_0xde16('0x9'));module[_0xde16('0xa')]=function(_0x29b03b,_0x1e6ba0){return _0x29b03b[_0xde16('0xb')]('Variable',attributes,{'tableName':_0xde16('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8ac=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0xc8ac[_0x1e06f1];return _0x34f77e;};'use strict';var _=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var logger=require(_0xcc8a('0x2'))(_0xcc8a('0x3'));var moment=require('moment');var BPromise=require(_0xcc8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc8a('0x5'));var rimraf=require(_0xcc8a('0x6'));var config=require(_0xcc8a('0x7'));var attributes=require(_0xcc8a('0x8'));module[_0xcc8a('0x9')]=function(_0x5321e3,_0x4e6a35){return _0x5321e3[_0xcc8a('0xa')](_0xcc8a('0xb'),attributes,{'tableName':_0xcc8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52a489c..a790cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x5fc3[_0x15c421];return _0x5e5ed5;};'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')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\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']('Variable,\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);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
+var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c6ad2,_0x51092b){var _0x215c13=function(_0xf76c84){while(--_0xf76c84){_0x4c6ad2['push'](_0x4c6ad2['shift']());}};_0x215c13(++_0x51092b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4f4cec,_0x43cca3){_0x4f4cec=_0x4f4cec-0x0;var _0x4580c3=_0x8ef6[_0x4f4cec];return _0x4580c3;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});};
\ No newline at end of file
index b44647d..9c8f6ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe803=['/pull','pull','/restart','/migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe803,0x66));var _0x3e80=function(_0x30ac91,_0x5ea452){_0x30ac91=_0x30ac91-0x0;var _0x4a433b=_0xe803[_0x30ac91];return _0x4a433b;};'use strict';var express=require(_0x3e80('0x0'));var router=express[_0x3e80('0x1')]();var auth=require(_0x3e80('0x2'));var controller=require(_0x3e80('0x3'));router[_0x3e80('0x4')]('/',controller['index']);router[_0x3e80('0x4')](_0x3e80('0x5'),auth[_0x3e80('0x6')](),auth[_0x3e80('0x7')](),controller[_0x3e80('0x8')]);router['get'](_0x3e80('0x9'),auth['isAuthenticated'](),auth[_0x3e80('0x7')](),controller['reset']);router['get'](_0x3e80('0xa'),auth[_0x3e80('0x6')](),auth[_0x3e80('0x7')](),controller[_0x3e80('0xb')]);router[_0x3e80('0x4')](_0x3e80('0xc'),auth[_0x3e80('0x6')](),controller['restart']);router[_0x3e80('0x4')](_0x3e80('0xd'),controller['migrations']);module['exports']=router;
\ No newline at end of file
+var _0xf3a5=['isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x23e000,_0x24a5d1){var _0x5879a7=function(_0xb762bb){while(--_0xb762bb){_0x23e000['push'](_0x23e000['shift']());}};_0x5879a7(++_0x24a5d1);}(_0xf3a5,0x82));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x5f3a('0x0')]();var auth=require(_0x5f3a('0x1'));var controller=require(_0x5f3a('0x2'));router[_0x5f3a('0x3')]('/',controller[_0x5f3a('0x4')]);router[_0x5f3a('0x3')](_0x5f3a('0x5'),auth[_0x5f3a('0x6')](),auth[_0x5f3a('0x7')](),controller[_0x5f3a('0x8')]);router['get']('/reset',auth[_0x5f3a('0x6')](),auth['canUpdate'](),controller[_0x5f3a('0x9')]);router['get'](_0x5f3a('0xa'),auth[_0x5f3a('0x6')](),auth[_0x5f3a('0x7')](),controller[_0x5f3a('0xb')]);router[_0x5f3a('0x3')](_0x5f3a('0xc'),auth[_0x5f3a('0x6')](),controller[_0x5f3a('0xd')]);router[_0x5f3a('0x3')](_0x5f3a('0xe'),controller[_0x5f3a('0xf')]);module[_0x5f3a('0x10')]=router;
\ No newline at end of file
index 121ee80..b434589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd5=['Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','server','migrations','length','replace','push','sort','Migration','sequelize','getQueryInterface','constructor','join','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','version','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then'];(function(_0x29aae6,_0x14fdb0){var _0x410c90=function(_0x56ce79){while(--_0x56ce79){_0x29aae6['push'](_0x29aae6['shift']());}};_0x410c90(++_0x14fdb0);}(_0xecd5,0xb5));var _0x5ecd=function(_0x22c964,_0x23bb6f){_0x22c964=_0x22c964-0x0;var _0x42501d=_0xecd5[_0x22c964];return _0x42501d;};'use strict';var Umzug=require(_0x5ecd('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x5ecd('0x1'))(module,'version');var compareVersions=require(_0x5ecd('0x2'));var exec=require(_0x5ecd('0x3'))['exec'];var db=require(_0x5ecd('0x4'))['db'];var config=require(_0x5ecd('0x5'));var pm2=require(_0x5ecd('0x6'));var logger=require('../../config/logger')(_0x5ecd('0x7'));var git=require(_0x5ecd('0x8'))(config[_0x5ecd('0x9')]);exports['index']=function(_0x2236ab,_0x5e9da7){var _0x2c6f8a={'current':module[_0x5ecd('0xa')][_0x5ecd('0xb')],'phonebar':0x2};if(_0x2236ab['query']&&_0x2236ab[_0x5ecd('0xc')]['latest']){return git[_0x5ecd('0xd')]()[_0x5ecd('0xe')](function(_0x17b5b8,_0x257395){_0x2c6f8a[_0x5ecd('0xf')]=(_0x17b5b8?module['exports']['version']:_0x257395[_0x5ecd('0xf')])||_0x5ecd('0x10');return _0x5e9da7[_0x5ecd('0x11')](0xc8)['json'](_0x2c6f8a);});}else{return _0x5e9da7[_0x5ecd('0x11')](0xc8)[_0x5ecd('0x12')](_0x2c6f8a);}};exports['fetch']=function(_0x2ee1ef,_0x20c472){return git['fetch']([_0x5ecd('0x13'),_0x5ecd('0x14')],function(_0x593540){if(_0x593540){logger[_0x5ecd('0x15')](_0x593540);return _0x20c472[_0x5ecd('0x11')](0x1f4)[_0x5ecd('0x12')](_0x593540);}logger[_0x5ecd('0x16')](_0x5ecd('0x17'));return _0x20c472['status'](0xc8)[_0x5ecd('0x12')]({'output':_0x5ecd('0x18')});});};exports[_0x5ecd('0x19')]=function(_0xf62b0b,_0x52e7c4){return git['reset']([_0x5ecd('0x1a'),_0x5ecd('0x1b')],function(_0x1753ce){if(_0x1753ce){logger[_0x5ecd('0x15')](_0x1753ce);return _0x52e7c4[_0x5ecd('0x11')](0x1f4)[_0x5ecd('0x12')](_0x1753ce);}logger[_0x5ecd('0x16')](_0x5ecd('0x1c'));return _0x52e7c4[_0x5ecd('0x11')](0xc8)[_0x5ecd('0x12')]({'output':_0x5ecd('0x1d')});});};exports[_0x5ecd('0x1e')]=function(_0x218d73,_0x4f2b75){exec(_0x5ecd('0x1f'),function(_0x2197ea,_0x2323ae,_0x1c256b){logger[_0x5ecd('0x16')](_0x2323ae);logger[_0x5ecd('0x16')](_0x1c256b);if(_0x2197ea){logger[_0x5ecd('0x15')](_0x2197ea);return _0x4f2b75['status'](0x1f4)[_0x5ecd('0x12')](_0x2197ea);}return _0x4f2b75[_0x5ecd('0x11')](0xc8)['json']({'output':_0x2323ae});});};exports[_0x5ecd('0x20')]=function(_0x1f6d5a,_0x1333d4){return pm2[_0x5ecd('0x20')](_0x5ecd('0x21'))[_0x5ecd('0x22')](function(_0x1f65a8){logger[_0x5ecd('0x16')]('pm2\x20restart\x20motion\x20%s',_0x1f65a8);return _0x1333d4[_0x5ecd('0x11')](0xc8)[_0x5ecd('0x12')]({'output':_0x5ecd('0x23')});})[_0x5ecd('0x24')](function(_0x422957){logger[_0x5ecd('0x15')](_0x422957);return _0x1333d4[_0x5ecd('0x11')](0x1f4)[_0x5ecd('0x12')](_0x422957);});};exports['migrations']=function(_0x5c9974,_0x245b25){var _0x4969ad=fs[_0x5ecd('0x25')](path['join'](config['root'],_0x5ecd('0x26'),_0x5ecd('0x27')));var _0x1d24e2=[];for(var _0x3c91c4=0x0;_0x3c91c4<_0x4969ad[_0x5ecd('0x28')];_0x3c91c4++){var _0x5193c0=_0x4969ad[_0x3c91c4][_0x5ecd('0x29')]('.js','');if(compareVersions(module[_0x5ecd('0xa')][_0x5ecd('0xb')],_0x5193c0)===-0x1){_0x1d24e2[_0x5ecd('0x2a')](_0x5193c0);}}if(_0x1d24e2[_0x5ecd('0x28')]){var _0x12ef2c=_0x1d24e2[_0x5ecd('0x2b')](compareVersions);var _0x1709f1=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x5ecd('0x2c'),'columnName':_0x5ecd('0xb')},'migrations':{'params':[db[_0x5ecd('0x2d')][_0x5ecd('0x2e')](),db[_0x5ecd('0x2d')][_0x5ecd('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x5ecd('0x30')](config[_0x5ecd('0x9')],'server',_0x5ecd('0x27')),'pattern':/\.js$/}});_0x1709f1['up']({'migrations':_[_0x5ecd('0x31')](_0x12ef2c,function(_0x519f54){return _0x519f54+_0x5ecd('0x32');})})['then'](function(){return _0x245b25[_0x5ecd('0x11')](0xc8)[_0x5ecd('0x12')]({'output':_0x5ecd('0x33')+module[_0x5ecd('0xa')][_0x5ecd('0xb')]+_0x5ecd('0x34')+_['last'](_0x12ef2c),'migrations':_[_0x5ecd('0x30')](_0x12ef2c)});})[_0x5ecd('0x24')](function(_0x6a9213){if(_0x6a9213 instanceof db[_0x5ecd('0x2d')]['UniqueConstraintError']){return _0x245b25[_0x5ecd('0x11')](0xc8)[_0x5ecd('0x12')]({'output':_0x5ecd('0x35')});}else{return _0x245b25['status'](0x1f4)[_0x5ecd('0x12')](_0x6a9213);}});}else{return _0x245b25['status'](0xc8)[_0x5ecd('0x12')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0x3c7f=['../../config/logger','update','root','index','exports','version','query','latest','2.0.0','status','json','fetch','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','error','info','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','constructor','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','pkginfo','compare-versions','../../config/environment','../../config/pm2'];(function(_0x5c5626,_0x56c7cd){var _0x3a8811=function(_0x45850e){while(--_0x45850e){_0x5c5626['push'](_0x5c5626['shift']());}};_0x3a8811(++_0x56c7cd);}(_0x3c7f,0x11b));var _0xf3c7=function(_0x62a6ba,_0x5506b3){_0x62a6ba=_0x62a6ba-0x0;var _0x30c69a=_0x3c7f[_0x62a6ba];return _0x30c69a;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0xf3c7('0x0'));var pkginfo=require(_0xf3c7('0x1'))(module,'version');var compareVersions=require(_0xf3c7('0x2'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xf3c7('0x3'));var pm2=require(_0xf3c7('0x4'));var logger=require(_0xf3c7('0x5'))(_0xf3c7('0x6'));var git=require('simple-git')(config[_0xf3c7('0x7')]);exports[_0xf3c7('0x8')]=function(_0x2e2643,_0x3d15c6){var _0x526264={'current':module[_0xf3c7('0x9')][_0xf3c7('0xa')],'phonebar':0x2};if(_0x2e2643[_0xf3c7('0xb')]&&_0x2e2643[_0xf3c7('0xb')]['latest']){return git['fetch']()['tags'](function(_0x2e5853,_0xe85832){_0x526264[_0xf3c7('0xc')]=(_0x2e5853?module[_0xf3c7('0x9')][_0xf3c7('0xa')]:_0xe85832[_0xf3c7('0xc')])||_0xf3c7('0xd');return _0x3d15c6[_0xf3c7('0xe')](0xc8)['json'](_0x526264);});}else{return _0x3d15c6[_0xf3c7('0xe')](0xc8)[_0xf3c7('0xf')](_0x526264);}};exports[_0xf3c7('0x10')]=function(_0x168346,_0x538b17){return git['fetch']([_0xf3c7('0x11'),_0xf3c7('0x12')],function(_0x58b554){if(_0x58b554){logger['error'](_0x58b554);return _0x538b17[_0xf3c7('0xe')](0x1f4)['json'](_0x58b554);}logger['info'](_0xf3c7('0x13'));return _0x538b17[_0xf3c7('0xe')](0xc8)[_0xf3c7('0xf')]({'output':_0xf3c7('0x14')});});};exports[_0xf3c7('0x15')]=function(_0x18859c,_0x4c263d){return git[_0xf3c7('0x15')](['--hard',_0xf3c7('0x16')],function(_0x3a0000){if(_0x3a0000){logger[_0xf3c7('0x17')](_0x3a0000);return _0x4c263d['status'](0x1f4)[_0xf3c7('0xf')](_0x3a0000);}logger[_0xf3c7('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4c263d['status'](0xc8)[_0xf3c7('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0xf3c7('0x19')]=function(_0x23eb9b,_0x4e15e5){exec(_0xf3c7('0x1a'),function(_0x33ed31,_0x40251a,_0x116b10){logger[_0xf3c7('0x18')](_0x40251a);logger[_0xf3c7('0x18')](_0x116b10);if(_0x33ed31){logger[_0xf3c7('0x17')](_0x33ed31);return _0x4e15e5['status'](0x1f4)[_0xf3c7('0xf')](_0x33ed31);}return _0x4e15e5['status'](0xc8)[_0xf3c7('0xf')]({'output':_0x40251a});});};exports[_0xf3c7('0x1b')]=function(_0x218bb6,_0x543f3a){return pm2[_0xf3c7('0x1b')]('motion2')[_0xf3c7('0x1c')](function(_0x143d6d){logger[_0xf3c7('0x18')](_0xf3c7('0x1d'),_0x143d6d);return _0x543f3a[_0xf3c7('0xe')](0xc8)['json']({'output':_0xf3c7('0x1e')});})['catch'](function(_0x37af43){logger['error'](_0x37af43);return _0x543f3a[_0xf3c7('0xe')](0x1f4)[_0xf3c7('0xf')](_0x37af43);});};exports[_0xf3c7('0x1f')]=function(_0x29a8cf,_0x2d02ea){var _0xfa220b=fs[_0xf3c7('0x20')](path[_0xf3c7('0x21')](config[_0xf3c7('0x7')],_0xf3c7('0x22'),_0xf3c7('0x1f')));var _0x4f4244=[];for(var _0x3ca7a6=0x0;_0x3ca7a6<_0xfa220b[_0xf3c7('0x23')];_0x3ca7a6++){var _0x24d89d=_0xfa220b[_0x3ca7a6][_0xf3c7('0x24')](_0xf3c7('0x25'),'');if(compareVersions(module[_0xf3c7('0x9')][_0xf3c7('0xa')],_0x24d89d)===-0x1){_0x4f4244[_0xf3c7('0x26')](_0x24d89d);}}if(_0x4f4244[_0xf3c7('0x23')]){var _0x455c94=_0x4f4244[_0xf3c7('0x27')](compareVersions);var _0x8a7e22=new Umzug({'storage':_0xf3c7('0x28'),'storageOptions':{'model':db[_0xf3c7('0x29')],'modelName':_0xf3c7('0x29'),'columnName':_0xf3c7('0xa')},'migrations':{'params':[db[_0xf3c7('0x28')]['getQueryInterface'](),db[_0xf3c7('0x28')][_0xf3c7('0x2a')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xf3c7('0x21')](config[_0xf3c7('0x7')],'server','migrations'),'pattern':/\.js$/}});_0x8a7e22['up']({'migrations':_['map'](_0x455c94,function(_0x21a576){return _0x21a576+_0xf3c7('0x25');})})[_0xf3c7('0x1c')](function(){return _0x2d02ea['status'](0xc8)[_0xf3c7('0xf')]({'output':_0xf3c7('0x2b')+module[_0xf3c7('0x9')][_0xf3c7('0xa')]+_0xf3c7('0x2c')+_[_0xf3c7('0x2d')](_0x455c94),'migrations':_[_0xf3c7('0x21')](_0x455c94)});})['catch'](function(_0x180f2b){if(_0x180f2b instanceof db[_0xf3c7('0x28')][_0xf3c7('0x2e')]){return _0x2d02ea[_0xf3c7('0xe')](0xc8)[_0xf3c7('0xf')]({'output':_0xf3c7('0x2f')});}else{return _0x2d02ea['status'](0x1f4)[_0xf3c7('0xf')](_0x180f2b);}});}else{return _0x2d02ea[_0xf3c7('0xe')](0xc8)['json']({'output':_0xf3c7('0x2f')});}};
\ No newline at end of file
index c7a1dc0..034eab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf29=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5dd105,_0x2b0b78){var _0x42a1aa=function(_0x246606){while(--_0x246606){_0x5dd105['push'](_0x5dd105['shift']());}};_0x42a1aa(++_0x2b0b78);}(_0xdf29,0x193));var _0x9df2=function(_0x40c783,_0x21312a){_0x40c783=_0x40c783-0x0;var _0x22c833=_0xdf29[_0x40c783];return _0x22c833;};'use strict';var multer=require(_0x9df2('0x0'));var util=require('util');var path=require(_0x9df2('0x1'));var timeout=require(_0x9df2('0x2'));var express=require(_0x9df2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9df2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9df2('0x5'));router[_0x9df2('0x6')]('/',auth[_0x9df2('0x7')](),controller[_0x9df2('0x8')]);router[_0x9df2('0x6')](_0x9df2('0x9'),auth[_0x9df2('0x7')](),controller['describe']);router[_0x9df2('0x6')](_0x9df2('0xa'),auth[_0x9df2('0x7')](),controller[_0x9df2('0xb')]);router[_0x9df2('0xc')]('/',auth[_0x9df2('0x7')](),controller[_0x9df2('0xd')]);router[_0x9df2('0xe')](_0x9df2('0xa'),auth[_0x9df2('0x7')](),controller['update']);router[_0x9df2('0xf')]('/:id',auth[_0x9df2('0x7')](),controller[_0x9df2('0x10')]);module[_0x9df2('0x11')]=router;
\ No newline at end of file
+var _0x7f4b=['exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','delete','destroy'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7f4b,0x144));var _0xb7f4=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x7f4b[_0x58d5ac];return _0x37985c;};'use strict';var multer=require(_0xb7f4('0x0'));var util=require(_0xb7f4('0x1'));var path=require('path');var timeout=require(_0xb7f4('0x2'));var express=require('express');var router=express[_0xb7f4('0x3')]();var fs_extra=require(_0xb7f4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7f4('0x5'));var controller=require(_0xb7f4('0x6'));router[_0xb7f4('0x7')]('/',auth[_0xb7f4('0x8')](),controller[_0xb7f4('0x9')]);router[_0xb7f4('0x7')](_0xb7f4('0xa'),auth['isAuthenticated'](),controller[_0xb7f4('0xb')]);router[_0xb7f4('0x7')](_0xb7f4('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb7f4('0x8')](),controller[_0xb7f4('0xd')]);router['put'](_0xb7f4('0xc'),auth[_0xb7f4('0x8')](),controller['update']);router[_0xb7f4('0xe')](_0xb7f4('0xc'),auth[_0xb7f4('0x8')](),controller[_0xb7f4('0xf')]);module[_0xb7f4('0x10')]=router;
\ No newline at end of file
index c91a853..b493a08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7033=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x11a4d8,_0xb83290){var _0x7e9b04=function(_0x4bee3a){while(--_0x4bee3a){_0x11a4d8['push'](_0x11a4d8['shift']());}};_0x7e9b04(++_0xb83290);}(_0x7033,0x19e));var _0x3703=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7033[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'type':{'type':Sequelize[_0x3703('0x2')]},'uniqueid':{'type':Sequelize[_0x3703('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3703('0x2')]},'queue':{'type':Sequelize[_0x3703('0x2')]},'interface':{'type':Sequelize[_0x3703('0x2')]},'membername':{'type':Sequelize[_0x3703('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3703('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3703('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x3703('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3703('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3703('0x3')]},'holdtime':{'type':Sequelize[_0x3703('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3703('0x4')]},'agentacw':{'type':Sequelize[_0x3703('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3703('0x4')]},'reason':{'type':Sequelize[_0x3703('0x2')]},'lastevent':{'type':Sequelize[_0x3703('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3703('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3703('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3703('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3703('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3703('0x2')]},'priority':{'type':Sequelize[_0x3703('0x2')]},'destchannel':{'type':Sequelize[_0x3703('0x2')]},'destchannelstate':{'type':Sequelize[_0x3703('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x3703('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3703('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3703('0x2')]},'destlanguage':{'type':Sequelize[_0x3703('0x2')]},'destaccountcode':{'type':Sequelize[_0x3703('0x2')]},'destcontext':{'type':Sequelize[_0x3703('0x2')]},'destexten':{'type':Sequelize[_0x3703('0x2')]},'destpriority':{'type':Sequelize[_0x3703('0x2')]},'destuniqueid':{'type':Sequelize[_0x3703('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3703('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x3703('0x2')]},'transfer':{'type':Sequelize[_0x3703('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3703('0x2')],'comment':_0x3703('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3703('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6901=['BOOLEAN','sequelize','STRING','DATE','INTEGER'];(function(_0x4d3b41,_0x4281e1){var _0x2dc795=function(_0x106729){while(--_0x106729){_0x4d3b41['push'](_0x4d3b41['shift']());}};_0x2dc795(++_0x4281e1);}(_0x6901,0x100));var _0x1690=function(_0x31fd70,_0x1530aa){_0x31fd70=_0x31fd70-0x0;var _0x20e61f=_0x6901[_0x31fd70];return _0x20e61f;};'use strict';var Sequelize=require(_0x1690('0x0'));module['exports']={'type':{'type':Sequelize[_0x1690('0x1')]},'uniqueid':{'type':Sequelize[_0x1690('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1690('0x1')]},'interface':{'type':Sequelize[_0x1690('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1690('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x1690('0x2')]},'holdtime':{'type':Sequelize[_0x1690('0x3')]},'agentcomplete':{'type':Sequelize[_0x1690('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1690('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1690('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1690('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1690('0x3')]},'reason':{'type':Sequelize[_0x1690('0x1')]},'lastevent':{'type':Sequelize[_0x1690('0x1')]},'channel':{'type':Sequelize[_0x1690('0x1')]},'channelstate':{'type':Sequelize[_0x1690('0x3')]},'channelstatedesc':{'type':Sequelize[_0x1690('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x1690('0x1')]},'language':{'type':Sequelize[_0x1690('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1690('0x1')]},'exten':{'type':Sequelize[_0x1690('0x1')]},'priority':{'type':Sequelize[_0x1690('0x1')]},'destchannel':{'type':Sequelize[_0x1690('0x1')]},'destchannelstate':{'type':Sequelize[_0x1690('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x1690('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1690('0x1')]},'destcalleridname':{'type':Sequelize[_0x1690('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x1690('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x1690('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x1690('0x1')]},'destcontext':{'type':Sequelize[_0x1690('0x1')]},'destexten':{'type':Sequelize[_0x1690('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1690('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x1690('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x1690('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x1690('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 57b3ca0..33c9fc8 100644 (file)
@@ -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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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
index 0d8497a..e5a2e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4074=['uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x4074,0xf0));var _0x4407=function(_0x384f0b,_0x322c21){_0x384f0b=_0x384f0b-0x0;var _0x30975d=_0x4074[_0x384f0b];return _0x30975d;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x4407('0xc'),_0x4407('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ce6=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x10232d,_0x3ff279){var _0xdcd6ec=function(_0x3d63cc){while(--_0x3d63cc){_0x10232d['push'](_0x10232d['shift']());}};_0xdcd6ec(++_0x3ff279);}(_0x4ce6,0x108));var _0x64ce=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x4ce6[_0x57d370];return _0x550fd2;};'use strict';var _=require(_0x64ce('0x0'));var util=require('util');var logger=require(_0x64ce('0x1'))(_0x64ce('0x2'));var moment=require(_0x64ce('0x3'));var BPromise=require(_0x64ce('0x4'));var rp=require(_0x64ce('0x5'));var fs=require('fs');var path=require(_0x64ce('0x6'));var rimraf=require('rimraf');var config=require(_0x64ce('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x31bc0f,_0x262751){return _0x31bc0f['define'](_0x64ce('0x8'),attributes,{'tableName':_0x64ce('0x9'),'paranoid':![],'indexes':[{'fields':[_0x64ce('0xa'),_0x64ce('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f9669ff..fade2b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11a3=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','bluebird'];(function(_0x4ca320,_0x395d3c){var _0x75430=function(_0x1525ad){while(--_0x1525ad){_0x4ca320['push'](_0x4ca320['shift']());}};_0x75430(++_0x395d3c);}(_0x11a3,0xba));var _0x311a=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x11a3[_0x1ebce2];return _0x4a330c;};'use strict';var _=require(_0x311a('0x0'));var util=require(_0x311a('0x1'));var moment=require('moment');var BPromise=require(_0x311a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x311a('0x3'));var db=require(_0x311a('0x4'))['db'];var utils=require(_0x311a('0x5'));var logger=require('../../config/logger')(_0x311a('0x6'));var config=require('../../config/environment');var jayson=require(_0x311a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3614db,_0x1b5df8,_0x496b58){return new BPromise(function(_0x3575ab,_0x5a3107){return client[_0x311a('0x8')](_0x3614db,_0x496b58)[_0x311a('0x9')](function(_0x3bffcf){logger[_0x311a('0xa')](_0x311a('0xb'),_0x1b5df8,'request\x20sent');logger['debug'](_0x311a('0xc'),_0x1b5df8,_0x311a('0xd'),JSON[_0x311a('0xe')](_0x3bffcf));if(_0x3bffcf[_0x311a('0xf')]){if(_0x3bffcf[_0x311a('0xf')][_0x311a('0x10')]===0x1f4){logger['error'](_0x311a('0xb'),_0x1b5df8,_0x3bffcf['error'][_0x311a('0x11')]);return _0x5a3107(_0x3bffcf[_0x311a('0xf')]['message']);}logger['error'](_0x311a('0xb'),_0x1b5df8,_0x3bffcf['error'][_0x311a('0x11')]);return _0x3575ab(_0x3bffcf['error'][_0x311a('0x11')]);}else{logger[_0x311a('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x1b5df8,_0x311a('0xd'));_0x3575ab(_0x3bffcf['result']['message']);}})[_0x311a('0x12')](function(_0x557c2c){logger[_0x311a('0xf')](_0x311a('0xb'),_0x1b5df8,_0x557c2c);_0x5a3107(_0x557c2c);});});}exports[_0x311a('0x13')]=function(_0x9e9b30){var _0x29bb6e=this;return new Promise(function(_0x5bcec9,_0x5d4401){return db[_0x311a('0x14')]['create'](_0x9e9b30[_0x311a('0x15')],{'raw':_0x9e9b30[_0x311a('0x16')]?_0x9e9b30[_0x311a('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x311a('0x9')](function(_0x321808){logger['info']('CreateVoiceAgentReport',_0x9e9b30);logger['debug'](_0x311a('0x13'),_0x9e9b30,JSON[_0x311a('0xe')](_0x321808));_0x5bcec9(_0x321808);})[_0x311a('0x12')](function(_0xbe1b6f){logger[_0x311a('0xf')](_0x311a('0x13'),_0xbe1b6f['message'],_0x9e9b30);_0x5d4401(_0x29bb6e[_0x311a('0xf')](0x1f4,_0xbe1b6f[_0x311a('0x11')]));});});};exports[_0x311a('0x17')]=function(_0x2c78ae){var _0x5448e6=this;return new Promise(function(_0x34c600,_0x261b31){return db[_0x311a('0x14')][_0x311a('0x18')](_0x2c78ae[_0x311a('0x15')],{'raw':_0x2c78ae[_0x311a('0x16')]?_0x2c78ae['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c78ae[_0x311a('0x16')]?_0x2c78ae[_0x311a('0x16')]['where']||null:null,'attributes':_0x2c78ae[_0x311a('0x16')]?_0x2c78ae['options'][_0x311a('0x19')]||null:null,'limit':_0x2c78ae[_0x311a('0x16')]?_0x2c78ae[_0x311a('0x16')][_0x311a('0x1a')]||null:null})['then'](function(_0x1cc8bd){logger[_0x311a('0xa')](_0x311a('0x17'),_0x2c78ae);logger['debug'](_0x311a('0x17'),_0x2c78ae,JSON['stringify'](_0x1cc8bd));_0x34c600(_0x1cc8bd);})['catch'](function(_0x9246df){logger[_0x311a('0xf')](_0x311a('0x17'),_0x9246df[_0x311a('0x11')],_0x2c78ae);_0x261b31(_0x5448e6[_0x311a('0xf')](0x1f4,_0x9246df[_0x311a('0x11')]));});});};
\ No newline at end of file
+var _0x37cf=['lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','UpdateVoiceAgentReport','update','body','where','attributes','limit'];(function(_0x2f1a7c,_0x58341a){var _0x4424b9=function(_0x30d846){while(--_0x30d846){_0x2f1a7c['push'](_0x2f1a7c['shift']());}};_0x4424b9(++_0x58341a);}(_0x37cf,0x1ba));var _0xf37c=function(_0x29b2a2,_0x4b7224){_0x29b2a2=_0x29b2a2-0x0;var _0x836e8c=_0x37cf[_0x29b2a2];return _0x836e8c;};'use strict';var _=require(_0xf37c('0x0'));var util=require(_0xf37c('0x1'));var moment=require(_0xf37c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf37c('0x3'));var fs=require('fs');var Redis=require(_0xf37c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf37c('0x5'));var logger=require('../../config/logger')(_0xf37c('0x6'));var config=require(_0xf37c('0x7'));var jayson=require(_0xf37c('0x8'));var client=jayson[_0xf37c('0x9')][_0xf37c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe35e66,_0x1d6944,_0x31f41f){return new BPromise(function(_0x304f79,_0xa46e5a){return client[_0xf37c('0xb')](_0xe35e66,_0x31f41f)[_0xf37c('0xc')](function(_0x43e58a){logger[_0xf37c('0xd')](_0xf37c('0xe'),_0x1d6944,_0xf37c('0xf'));logger[_0xf37c('0x10')](_0xf37c('0x11'),_0x1d6944,_0xf37c('0xf'),JSON[_0xf37c('0x12')](_0x43e58a));if(_0x43e58a[_0xf37c('0x13')]){if(_0x43e58a[_0xf37c('0x13')][_0xf37c('0x14')]===0x1f4){logger['error'](_0xf37c('0xe'),_0x1d6944,_0x43e58a['error'][_0xf37c('0x15')]);return _0xa46e5a(_0x43e58a['error'][_0xf37c('0x15')]);}logger[_0xf37c('0x13')](_0xf37c('0xe'),_0x1d6944,_0x43e58a['error']['message']);return _0x304f79(_0x43e58a[_0xf37c('0x13')][_0xf37c('0x15')]);}else{logger[_0xf37c('0xd')](_0xf37c('0xe'),_0x1d6944,_0xf37c('0xf'));_0x304f79(_0x43e58a[_0xf37c('0x16')][_0xf37c('0x15')]);}})[_0xf37c('0x17')](function(_0x397c92){logger[_0xf37c('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d6944,_0x397c92);_0xa46e5a(_0x397c92);});});}exports[_0xf37c('0x18')]=function(_0x387f4d){var _0x3d6778=this;return new Promise(function(_0x59e86a,_0x7b8217){return db[_0xf37c('0x19')][_0xf37c('0x1a')](_0x387f4d['body'],{'raw':_0x387f4d['options']?_0x387f4d[_0xf37c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf37c('0xc')](function(_0x22c076){logger[_0xf37c('0xd')](_0xf37c('0x18'),_0x387f4d);logger[_0xf37c('0x10')](_0xf37c('0x18'),_0x387f4d,JSON[_0xf37c('0x12')](_0x22c076));_0x59e86a(_0x22c076);})[_0xf37c('0x17')](function(_0x2a04d6){logger[_0xf37c('0x13')](_0xf37c('0x18'),_0x2a04d6[_0xf37c('0x15')],_0x387f4d);_0x7b8217(_0x3d6778[_0xf37c('0x13')](0x1f4,_0x2a04d6['message']));});});};exports[_0xf37c('0x1c')]=function(_0x17d616){var _0x2fede9=this;return new Promise(function(_0x265e33,_0x434f85){return db['VoiceAgentReport'][_0xf37c('0x1d')](_0x17d616[_0xf37c('0x1e')],{'raw':_0x17d616[_0xf37c('0x1b')]?_0x17d616['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17d616['options']?_0x17d616['options'][_0xf37c('0x1f')]||null:null,'attributes':_0x17d616[_0xf37c('0x1b')]?_0x17d616['options'][_0xf37c('0x20')]||null:null,'limit':_0x17d616[_0xf37c('0x1b')]?_0x17d616[_0xf37c('0x1b')][_0xf37c('0x21')]||null:null})[_0xf37c('0xc')](function(_0x43dc69){logger['info']('UpdateVoiceAgentReport',_0x17d616);logger[_0xf37c('0x10')]('UpdateVoiceAgentReport',_0x17d616,JSON[_0xf37c('0x12')](_0x43dc69));_0x265e33(_0x43dc69);})['catch'](function(_0xd9af54){logger[_0xf37c('0x13')]('UpdateVoiceAgentReport',_0xd9af54['message'],_0x17d616);_0x434f85(_0x2fede9['error'](0x1f4,_0xd9af54[_0xf37c('0x15')]));});});};
\ No newline at end of file
index d5fadba..74582a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x494a0e,_0x3aa8f1){var _0x4b9da4=function(_0x53fbda){while(--_0x53fbda){_0x494a0e['push'](_0x494a0e['shift']());}};_0x4b9da4(++_0x3aa8f1);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3009a3,_0x2cfb3){_0x3009a3=_0x3009a3-0x0;var _0x88d9ec=_0x8ef6[_0x3009a3];return _0x88d9ec;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/:id',auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router;
\ No newline at end of file
+var _0xf2ca=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','delete'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0xf2ca[_0x1b5080];return _0x195c87;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./voiceCallReport.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/describe',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['post']('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaf2c('0x11')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router;
\ No newline at end of file
index eb633ec..6568092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187c=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','inbound','internal','outbound-fax'];(function(_0x2a0cd2,_0x48d67d){var _0x1fd34e=function(_0x258084){while(--_0x258084){_0x2a0cd2['push'](_0x2a0cd2['shift']());}};_0x1fd34e(++_0x48d67d);}(_0x187c,0x11d));var _0xc187=function(_0x273974,_0x3f1c8b){_0x273974=_0x273974-0x0;var _0x50afa9=_0x187c[_0x273974];return _0x50afa9;};'use strict';var Sequelize=require(_0xc187('0x0'));module[_0xc187('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xc187('0x2'),_0xc187('0x3'),'outbound','inbound-fax',_0xc187('0x4'),_0xc187('0x5'))},'tag':{'type':Sequelize[_0xc187('0x6')]},'accountcode':{'type':Sequelize[_0xc187('0x6')]},'source':{'type':Sequelize[_0xc187('0x6')]},'destination':{'type':Sequelize[_0xc187('0x6')]},'destinationcontext':{'type':Sequelize[_0xc187('0x6')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc187('0x6')]},'destinationchannel':{'type':Sequelize[_0xc187('0x6')]},'lastapplication':{'type':Sequelize[_0xc187('0x6')]},'lastdata':{'type':Sequelize[_0xc187('0x7')]},'starttime':{'type':Sequelize[_0xc187('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc187('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc187('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc187('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xc187('0x6')]},'userDisposition':{'type':Sequelize[_0xc187('0x6')]},'userSecondDisposition':{'type':Sequelize[_0xc187('0x6')]},'userThirdDisposition':{'type':Sequelize[_0xc187('0x6')]},'note':{'type':Sequelize[_0xc187('0x6')]},'prefix':{'type':Sequelize[_0xc187('0x6')]},'routeid':{'type':Sequelize[_0xc187('0x9')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9782=['STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x4adf97,_0x4c2359){var _0x1f77da=function(_0x509edb){while(--_0x509edb){_0x4adf97['push'](_0x4adf97['shift']());}};_0x1f77da(++_0x4c2359);}(_0x9782,0xf6));var _0x2978=function(_0x44a0e9,_0x959f63){_0x44a0e9=_0x44a0e9-0x0;var _0x3b8e8c=_0x9782[_0x44a0e9];return _0x3b8e8c;};'use strict';var Sequelize=require(_0x2978('0x0'));module[_0x2978('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2978('0x2')]('inbound','internal',_0x2978('0x3'),_0x2978('0x4'),_0x2978('0x5'),_0x2978('0x6'))},'tag':{'type':Sequelize[_0x2978('0x7')]},'accountcode':{'type':Sequelize[_0x2978('0x7')]},'source':{'type':Sequelize[_0x2978('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x2978('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2978('0x7')]},'destinationchannel':{'type':Sequelize[_0x2978('0x7')]},'lastapplication':{'type':Sequelize[_0x2978('0x7')]},'lastdata':{'type':Sequelize[_0x2978('0x8')]},'starttime':{'type':Sequelize[_0x2978('0x9')]},'systemanswertime':{'type':Sequelize[_0x2978('0x9')]},'answertime':{'type':Sequelize[_0x2978('0x9')]},'endtime':{'type':Sequelize[_0x2978('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x2978('0xa')]},'mohtime':{'type':Sequelize[_0x2978('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2978('0x7')]},'amaflags':{'type':Sequelize[_0x2978('0x7')]},'userfield':{'type':Sequelize[_0x2978('0x7')]},'userDisposition':{'type':Sequelize[_0x2978('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x2978('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x2978('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 21d84af..687437f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5902f7,_0x45747d){_0x5902f7=_0x5902f7-0x0;var _0x218883=_0x2032[_0x5902f7];return _0x218883;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
+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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'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
index 3b61ec0..7b029c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0332=['lodash','util','../../config/logger','api','bluebird','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x5a378c,_0x150f3f){var _0x323ac2=function(_0x31ccb0){while(--_0x31ccb0){_0x5a378c['push'](_0x5a378c['shift']());}};_0x323ac2(++_0x150f3f);}(_0x0332,0x198));var _0x2033=function(_0x42ad47,_0x2439b1){_0x42ad47=_0x42ad47-0x0;var _0x53cadd=_0x0332[_0x42ad47];return _0x53cadd;};'use strict';var _=require(_0x2033('0x0'));var util=require(_0x2033('0x1'));var logger=require(_0x2033('0x2'))(_0x2033('0x3'));var moment=require('moment');var BPromise=require(_0x2033('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2033('0x5'));var attributes=require(_0x2033('0x6'));module[_0x2033('0x7')]=function(_0x4ae3b9,_0x3e9d8f){return _0x4ae3b9[_0x2033('0x8')](_0x2033('0x9'),attributes,{'tableName':_0x2033('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2033('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a93=['bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x16ae27,_0x3d0212){var _0x4871c5=function(_0x1f226c){while(--_0x1f226c){_0x16ae27['push'](_0x16ae27['shift']());}};_0x4871c5(++_0x3d0212);}(_0x4a93,0x15b));var _0x34a9=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4a93[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x34a9('0x0'));var util=require(_0x34a9('0x1'));var logger=require(_0x34a9('0x2'))(_0x34a9('0x3'));var moment=require('moment');var BPromise=require(_0x34a9('0x4'));var rp=require(_0x34a9('0x5'));var fs=require('fs');var path=require(_0x34a9('0x6'));var rimraf=require(_0x34a9('0x7'));var config=require('../../config/environment');var attributes=require(_0x34a9('0x8'));module['exports']=function(_0x51edc0,_0x129719){return _0x51edc0[_0x34a9('0x9')](_0x34a9('0xa'),attributes,{'tableName':_0x34a9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x34a9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a4a0b28..861ead5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0546=['code','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d3b41,_0x3d8cdc){var _0x9cf6fd=function(_0x20d20d){while(--_0x20d20d){_0x4d3b41['push'](_0x4d3b41['shift']());}};_0x9cf6fd(++_0x3d8cdc);}(_0x0546,0xcf));var _0x6054=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x0546[_0x3bef2c];return _0x331503;};'use strict';var _=require('lodash');var util=require(_0x6054('0x0'));var moment=require(_0x6054('0x1'));var BPromise=require(_0x6054('0x2'));var rs=require(_0x6054('0x3'));var fs=require('fs');var Redis=require(_0x6054('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6054('0x5'));var logger=require(_0x6054('0x6'))('rpc');var config=require(_0x6054('0x7'));var jayson=require(_0x6054('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7c80ad,_0x3a94f7,_0x18463d){return new BPromise(function(_0xb85e6d,_0x395e9c){return client[_0x6054('0x9')](_0x7c80ad,_0x18463d)[_0x6054('0xa')](function(_0x415c6c){logger['info'](_0x6054('0xb'),_0x3a94f7,_0x6054('0xc'));logger['debug'](_0x6054('0xd'),_0x3a94f7,_0x6054('0xc'),JSON[_0x6054('0xe')](_0x415c6c));if(_0x415c6c['error']){if(_0x415c6c['error'][_0x6054('0xf')]===0x1f4){logger[_0x6054('0x10')](_0x6054('0xb'),_0x3a94f7,_0x415c6c[_0x6054('0x10')][_0x6054('0x11')]);return _0x395e9c(_0x415c6c[_0x6054('0x10')][_0x6054('0x11')]);}logger['error'](_0x6054('0xb'),_0x3a94f7,_0x415c6c[_0x6054('0x10')][_0x6054('0x11')]);return _0xb85e6d(_0x415c6c[_0x6054('0x10')][_0x6054('0x11')]);}else{logger[_0x6054('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x3a94f7,_0x6054('0xc'));_0xb85e6d(_0x415c6c[_0x6054('0x13')][_0x6054('0x11')]);}})[_0x6054('0x14')](function(_0x1e6081){logger[_0x6054('0x10')](_0x6054('0xb'),_0x3a94f7,_0x1e6081);_0x395e9c(_0x1e6081);});});}exports[_0x6054('0x15')]=function(_0x33a66e){var _0x532aa2=this;return new Promise(function(_0x459fa6,_0x1d2506){return db[_0x6054('0x16')][_0x6054('0x17')]({'raw':_0x33a66e[_0x6054('0x18')]?_0x33a66e[_0x6054('0x18')][_0x6054('0x19')]===undefined?!![]:![]:!![],'where':_0x33a66e[_0x6054('0x18')]?_0x33a66e[_0x6054('0x18')][_0x6054('0x1a')]||null:null,'attributes':_0x33a66e[_0x6054('0x18')]?_0x33a66e[_0x6054('0x18')][_0x6054('0x1b')]||null:null,'limit':_0x33a66e['options']?_0x33a66e[_0x6054('0x18')][_0x6054('0x1c')]||null:null,'include':_0x33a66e[_0x6054('0x18')]?_0x33a66e[_0x6054('0x18')][_0x6054('0x1d')]?_[_0x6054('0x1e')](_0x33a66e[_0x6054('0x18')][_0x6054('0x1d')],function(_0x3a3eb6){return{'model':db[_0x3a3eb6[_0x6054('0x1f')]],'as':_0x3a3eb6['as'],'attributes':_0x3a3eb6[_0x6054('0x1b')],'include':_0x3a3eb6[_0x6054('0x1d')]?_['map'](_0x3a3eb6[_0x6054('0x1d')],function(_0x194000){return{'model':db[_0x194000[_0x6054('0x1f')]],'as':_0x194000['as'],'attributes':_0x194000[_0x6054('0x1b')],'include':_0x194000['include']?_[_0x6054('0x1e')](_0x194000[_0x6054('0x1d')],function(_0x2e3d51){return{'model':db[_0x2e3d51[_0x6054('0x1f')]],'as':_0x2e3d51['as'],'attributes':_0x2e3d51[_0x6054('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6054('0xa')](function(_0x491646){logger['info'](_0x6054('0x15'),_0x33a66e);logger[_0x6054('0x20')]('GetVoiceCallReport',_0x33a66e,JSON[_0x6054('0xe')](_0x491646));_0x459fa6(_0x491646);})[_0x6054('0x14')](function(_0x527398){logger[_0x6054('0x10')](_0x6054('0x15'),_0x527398[_0x6054('0x11')],_0x33a66e);_0x1d2506(_0x532aa2[_0x6054('0x10')](0x1f4,_0x527398[_0x6054('0x11')]));});});};exports[_0x6054('0x21')]=function(_0x541db2){var _0x363b52=this;return new Promise(function(_0x3f6fed,_0x4bc208){return db[_0x6054('0x16')][_0x6054('0x22')](_0x541db2[_0x6054('0x23')],{'raw':_0x541db2[_0x6054('0x18')]?_0x541db2[_0x6054('0x18')][_0x6054('0x19')]===undefined?!![]:![]:!![]})[_0x6054('0xa')](function(_0x4d5479){logger[_0x6054('0x12')](_0x6054('0x21'),_0x541db2);logger[_0x6054('0x20')](_0x6054('0x21'),_0x541db2,JSON[_0x6054('0xe')](_0x4d5479));_0x3f6fed(_0x4d5479);})['catch'](function(_0x5f3c6e){logger[_0x6054('0x10')](_0x6054('0x21'),_0x5f3c6e[_0x6054('0x11')],_0x541db2);_0x4bc208(_0x363b52[_0x6054('0x10')](0x1f4,_0x5f3c6e['message']));});});};exports['UpdateVoiceCallReport']=function(_0x1ff699){var _0x4a06c0=this;return new Promise(function(_0x582385,_0xa1c2c0){return db[_0x6054('0x16')]['update'](_0x1ff699[_0x6054('0x23')],{'raw':_0x1ff699[_0x6054('0x18')]?_0x1ff699['options'][_0x6054('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff699[_0x6054('0x18')]?_0x1ff699['options'][_0x6054('0x1a')]||null:null,'attributes':_0x1ff699[_0x6054('0x18')]?_0x1ff699[_0x6054('0x18')]['attributes']||null:null,'limit':_0x1ff699[_0x6054('0x18')]?_0x1ff699[_0x6054('0x18')][_0x6054('0x1c')]||null:null})[_0x6054('0xa')](function(_0x284d23){logger[_0x6054('0x12')]('UpdateVoiceCallReport',_0x1ff699);logger[_0x6054('0x20')](_0x6054('0x24'),_0x1ff699,JSON[_0x6054('0xe')](_0x284d23));_0x582385(_0x284d23);})[_0x6054('0x14')](function(_0x56a941){logger[_0x6054('0x10')](_0x6054('0x24'),_0x56a941[_0x6054('0x11')],_0x1ff699);_0xa1c2c0(_0x4a06c0[_0x6054('0x10')](0x1f4,_0x56a941[_0x6054('0x11')]));});});};
\ No newline at end of file
+var _0xde10=['attributes','model','map','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include'];(function(_0x37e600,_0x47ac9e){var _0x545e2f=function(_0x217997){while(--_0x217997){_0x37e600['push'](_0x37e600['shift']());}};_0x545e2f(++_0x47ac9e);}(_0xde10,0x71));var _0x0de1=function(_0x52a1b6,_0x194592){_0x52a1b6=_0x52a1b6-0x0;var _0x2e2c3c=_0xde10[_0x52a1b6];return _0x2e2c3c;};'use strict';var _=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0de1('0x2'));var fs=require('fs');var Redis=require(_0x0de1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de1('0x4'));var logger=require(_0x0de1('0x5'))(_0x0de1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50d4fc,_0x50895a,_0xf357f4){return new BPromise(function(_0x1483ec,_0x3a3705){return client[_0x0de1('0x8')](_0x50d4fc,_0xf357f4)['then'](function(_0x38f157){logger['info'](_0x0de1('0x9'),_0x50895a,'request\x20sent');logger[_0x0de1('0xa')](_0x0de1('0xb'),_0x50895a,_0x0de1('0xc'),JSON[_0x0de1('0xd')](_0x38f157));if(_0x38f157[_0x0de1('0xe')]){if(_0x38f157[_0x0de1('0xe')][_0x0de1('0xf')]===0x1f4){logger['error'](_0x0de1('0x9'),_0x50895a,_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);return _0x3a3705(_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);}logger[_0x0de1('0xe')](_0x0de1('0x9'),_0x50895a,_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);return _0x1483ec(_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);}else{logger[_0x0de1('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x50895a,'request\x20sent');_0x1483ec(_0x38f157['result']['message']);}})[_0x0de1('0x12')](function(_0x3c50e8){logger['error'](_0x0de1('0x9'),_0x50895a,_0x3c50e8);_0x3a3705(_0x3c50e8);});});}exports[_0x0de1('0x13')]=function(_0x55a12a){var _0x1baec0=this;return new Promise(function(_0x51fdce,_0x4d702d){return db[_0x0de1('0x14')][_0x0de1('0x15')]({'raw':_0x55a12a[_0x0de1('0x16')]?_0x55a12a['options'][_0x0de1('0x17')]===undefined?!![]:![]:!![],'where':_0x55a12a[_0x0de1('0x16')]?_0x55a12a[_0x0de1('0x16')][_0x0de1('0x18')]||null:null,'attributes':_0x55a12a[_0x0de1('0x16')]?_0x55a12a[_0x0de1('0x16')]['attributes']||null:null,'limit':_0x55a12a[_0x0de1('0x16')]?_0x55a12a['options'][_0x0de1('0x19')]||null:null,'include':_0x55a12a['options']?_0x55a12a[_0x0de1('0x16')][_0x0de1('0x1a')]?_['map'](_0x55a12a[_0x0de1('0x16')][_0x0de1('0x1a')],function(_0x26c24c){return{'model':db[_0x26c24c['model']],'as':_0x26c24c['as'],'attributes':_0x26c24c[_0x0de1('0x1b')],'include':_0x26c24c[_0x0de1('0x1a')]?_['map'](_0x26c24c[_0x0de1('0x1a')],function(_0x3ad07f){return{'model':db[_0x3ad07f[_0x0de1('0x1c')]],'as':_0x3ad07f['as'],'attributes':_0x3ad07f[_0x0de1('0x1b')],'include':_0x3ad07f[_0x0de1('0x1a')]?_[_0x0de1('0x1d')](_0x3ad07f['include'],function(_0x56cd91){return{'model':db[_0x56cd91[_0x0de1('0x1c')]],'as':_0x56cd91['as'],'attributes':_0x56cd91[_0x0de1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0de1('0x1e')](function(_0x273df8){logger[_0x0de1('0x11')]('GetVoiceCallReport',_0x55a12a);logger[_0x0de1('0xa')](_0x0de1('0x13'),_0x55a12a,JSON['stringify'](_0x273df8));_0x51fdce(_0x273df8);})[_0x0de1('0x12')](function(_0x3c29b4){logger[_0x0de1('0xe')](_0x0de1('0x13'),_0x3c29b4[_0x0de1('0x10')],_0x55a12a);_0x4d702d(_0x1baec0['error'](0x1f4,_0x3c29b4[_0x0de1('0x10')]));});});};exports[_0x0de1('0x1f')]=function(_0x1ccd48){var _0x5d7734=this;return new Promise(function(_0xa12cd4,_0xdabc6d){return db[_0x0de1('0x14')][_0x0de1('0x20')](_0x1ccd48[_0x0de1('0x21')],{'raw':_0x1ccd48[_0x0de1('0x16')]?_0x1ccd48['options'][_0x0de1('0x17')]===undefined?!![]:![]:!![]})[_0x0de1('0x1e')](function(_0x45178e){logger[_0x0de1('0x11')](_0x0de1('0x1f'),_0x1ccd48);logger[_0x0de1('0xa')](_0x0de1('0x1f'),_0x1ccd48,JSON['stringify'](_0x45178e));_0xa12cd4(_0x45178e);})['catch'](function(_0x227ce4){logger[_0x0de1('0xe')](_0x0de1('0x1f'),_0x227ce4[_0x0de1('0x10')],_0x1ccd48);_0xdabc6d(_0x5d7734[_0x0de1('0xe')](0x1f4,_0x227ce4[_0x0de1('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x2fb97a){var _0x32f5c5=this;return new Promise(function(_0x340173,_0xba76dd){return db[_0x0de1('0x14')]['update'](_0x2fb97a['body'],{'raw':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a[_0x0de1('0x16')][_0x0de1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a['options'][_0x0de1('0x18')]||null:null,'attributes':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a['options'][_0x0de1('0x1b')]||null:null,'limit':_0x2fb97a['options']?_0x2fb97a[_0x0de1('0x16')]['limit']||null:null})[_0x0de1('0x1e')](function(_0x3121fe){logger[_0x0de1('0x11')](_0x0de1('0x22'),_0x2fb97a);logger[_0x0de1('0xa')](_0x0de1('0x22'),_0x2fb97a,JSON[_0x0de1('0xd')](_0x3121fe));_0x340173(_0x3121fe);})[_0x0de1('0x12')](function(_0x33ea19){logger['error'](_0x0de1('0x22'),_0x33ea19[_0x0de1('0x10')],_0x2fb97a);_0xba76dd(_0x32f5c5['error'](0x1f4,_0x33ea19['message']));});});};
\ No newline at end of file
index 2cd3639..aa915d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x881a=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x2ccbca,_0x533d56){var _0x29ad87=function(_0x39cb2e){while(--_0x39cb2e){_0x2ccbca['push'](_0x2ccbca['shift']());}};_0x29ad87(++_0x533d56);}(_0x881a,0xd5));var _0xa881=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x881a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa881('0x0'));var util=require(_0xa881('0x1'));var path=require(_0xa881('0x2'));var timeout=require(_0xa881('0x3'));var express=require('express');var router=express[_0xa881('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa881('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa881('0x6'));var controller=require(_0xa881('0x7'));router[_0xa881('0x8')]('/',auth[_0xa881('0x9')](),controller[_0xa881('0xa')]);router['get'](_0xa881('0xb'),auth[_0xa881('0x9')](),controller[_0xa881('0xc')]);router[_0xa881('0xd')]('/',auth[_0xa881('0x9')](),controller['create']);router[_0xa881('0xe')](_0xa881('0xb'),auth[_0xa881('0x9')](),controller[_0xa881('0xf')]);router[_0xa881('0x10')](_0xa881('0xb'),auth[_0xa881('0x9')](),controller[_0xa881('0x11')]);module[_0xa881('0x12')]=router;
\ No newline at end of file
+var _0x2e9e=['path','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util'];(function(_0x52d441,_0x43f3e0){var _0x96a1a=function(_0x11e27f){while(--_0x11e27f){_0x52d441['push'](_0x52d441['shift']());}};_0x96a1a(++_0x43f3e0);}(_0x2e9e,0x1a2));var _0xe2e9=function(_0x494128,_0x5e864d){_0x494128=_0x494128-0x0;var _0x5af532=_0x2e9e[_0x494128];return _0x5af532;};'use strict';var multer=require(_0xe2e9('0x0'));var util=require(_0xe2e9('0x1'));var path=require(_0xe2e9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe2e9('0x3'));var config=require(_0xe2e9('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xe2e9('0x5')]('/',auth[_0xe2e9('0x6')](),controller[_0xe2e9('0x7')]);router[_0xe2e9('0x5')](_0xe2e9('0x8'),auth[_0xe2e9('0x6')](),controller[_0xe2e9('0x9')]);router[_0xe2e9('0xa')]('/',auth[_0xe2e9('0x6')](),controller['create']);router[_0xe2e9('0xb')]('/:id',auth[_0xe2e9('0x6')](),controller['update']);router[_0xe2e9('0xc')](_0xe2e9('0x8'),auth[_0xe2e9('0x6')](),controller['destroy']);module[_0xe2e9('0xd')]=router;
\ No newline at end of file
index ef27041..1e6a849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4978=['split','BOOLEAN','sequelize','exports','STRING','name','getDataValue','options'];(function(_0x21a534,_0x1f8347){var _0x3b9e98=function(_0x5b1edb){while(--_0x5b1edb){_0x21a534['push'](_0x21a534['shift']());}};_0x3b9e98(++_0x1f8347);}(_0x4978,0x16a));var _0x8497=function(_0x1fa226,_0x575465){_0x1fa226=_0x1fa226-0x0;var _0x3579a6=_0x4978[_0x1fa226];return _0x3579a6;};'use strict';var Sequelize=require(_0x8497('0x0'));module[_0x8497('0x1')]={'name':{'type':Sequelize[_0x8497('0x2')]},'prefix':{'type':Sequelize[_0x8497('0x2')],'unique':_0x8497('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x8497('0x2')],'set':function(_0x2a5f41){this['setDataValue']('options',_0x2a5f41?_0x2a5f41['join'](''):[]);},'get':function(){return this[_0x8497('0x4')](_0x8497('0x5'))?this[_0x8497('0x4')](_0x8497('0x5'))[_0x8497('0x6')](''):[];}},'auth':{'type':Sequelize[_0x8497('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8497('0x2')]},'description':{'type':Sequelize[_0x8497('0x2')]}};
\ No newline at end of file
+var _0x9ecf=['name','getDataValue','options','BOOLEAN','exports','STRING'];(function(_0x2b662d,_0x5c64c0){var _0x3737f4=function(_0x50a423){while(--_0x50a423){_0x2b662d['push'](_0x2b662d['shift']());}};_0x3737f4(++_0x5c64c0);}(_0x9ecf,0x1e4));var _0xf9ec=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x9ecf[_0x2f1114];return _0x2fe856;};'use strict';var Sequelize=require('sequelize');module[_0xf9ec('0x0')]={'name':{'type':Sequelize[_0xf9ec('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xf9ec('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xf9ec('0x1')],'set':function(_0x1a66bf){this['setDataValue']('options',_0x1a66bf?_0x1a66bf['join'](''):[]);},'get':function(){return this[_0xf9ec('0x3')](_0xf9ec('0x4'))?this[_0xf9ec('0x3')](_0xf9ec('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xf9ec('0x5')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9ec('0x1')]}};
\ No newline at end of file
index 6a6cc46..d4c03a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f37=['attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','rows','catch','includeAll','include','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x56fa70,_0x36b119){var _0x4a7c1a=function(_0x3e0426){while(--_0x3e0426){_0x56fa70['push'](_0x56fa70['shift']());}};_0x4a7c1a(++_0x36b119);}(_0x8f37,0x190));var _0x78f3=function(_0x401b33,_0x226c83){_0x401b33=_0x401b33-0x0;var _0x67ea86=_0x8f37[_0x401b33];return _0x67ea86;};'use strict';var emlformat=require(_0x78f3('0x0'));var rimraf=require(_0x78f3('0x1'));var zipdir=require(_0x78f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x78f3('0x3'));var BPromise=require(_0x78f3('0x4'));var Mustache=require(_0x78f3('0x5'));var util=require('util');var path=require(_0x78f3('0x6'));var sox=require('sox');var csv=require(_0x78f3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78f3('0x8'));var _=require(_0x78f3('0x9'));var squel=require('squel');var crypto=require(_0x78f3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78f3('0xb'));var toCsv=require(_0x78f3('0x7'));var querystring=require('querystring');var Papa=require(_0x78f3('0xc'));var Redis=require(_0x78f3('0xd'));var authService=require(_0x78f3('0xe'));var qs=require(_0x78f3('0xf'));var as=require(_0x78f3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78f3('0x11'))(_0x78f3('0x12'));var utils=require('../../config/utils');var config=require(_0x78f3('0x13'));var licenseUtil=require(_0x78f3('0x14'));var db=require(_0x78f3('0x15'))['db'];function respondWithStatusCode(_0x532f29,_0x134063){_0x134063=_0x134063||0xcc;return function(_0x217945){if(_0x217945){return _0x532f29[_0x78f3('0x16')](_0x134063);}return _0x532f29[_0x78f3('0x17')](_0x134063)[_0x78f3('0x18')]();};}function respondWithResult(_0x1858f1,_0x33944e){_0x33944e=_0x33944e||0xc8;return function(_0x38db12){if(_0x38db12){return _0x1858f1[_0x78f3('0x17')](_0x33944e)[_0x78f3('0x19')](_0x38db12);}};}function respondWithFilteredResult(_0x225c7f,_0x1e7a83){return function(_0x3e2a15){if(_0x3e2a15){var _0x453270=typeof _0x1e7a83[_0x78f3('0x1a')]===_0x78f3('0x1b')&&typeof _0x1e7a83[_0x78f3('0x1c')]===_0x78f3('0x1b');var _0x301849=_0x3e2a15[_0x78f3('0x1d')];var _0x3c76d2=_0x453270?0x0:_0x1e7a83[_0x78f3('0x1a')];var _0x225176=_0x453270?_0x3e2a15['count']:_0x1e7a83[_0x78f3('0x1a')]+_0x1e7a83[_0x78f3('0x1c')];var _0x53ee6a;if(_0x225176>=_0x301849){_0x225176=_0x301849;_0x53ee6a=0xc8;}else{_0x53ee6a=0xce;}_0x225c7f['status'](_0x53ee6a);return _0x225c7f['set'](_0x78f3('0x1e'),_0x3c76d2+'-'+_0x225176+'/'+_0x301849)[_0x78f3('0x19')](_0x3e2a15);}return null;};}function patchUpdates(_0x31621a){return function(_0x11ee05){try{jsonpatch[_0x78f3('0x1f')](_0x11ee05,_0x31621a,!![]);}catch(_0x560510){return BPromise[_0x78f3('0x20')](_0x560510);}return _0x11ee05[_0x78f3('0x21')]();};}function saveUpdates(_0x116918,_0x3f623f){return function(_0x2049a3){if(_0x2049a3){return _0x2049a3[_0x78f3('0x22')](_0x116918)[_0x78f3('0x23')](function(_0x213604){return _0x213604;});}return null;};}function removeEntity(_0x18189e,_0x3c6bf8){return function(_0x5ea7fd){if(_0x5ea7fd){return _0x5ea7fd[_0x78f3('0x24')]()[_0x78f3('0x23')](function(){var _0x48d727=_0x5ea7fd[_0x78f3('0x25')]({'plain':!![]});var _0x238001=_0x78f3('0x26');return db[_0x78f3('0x27')][_0x78f3('0x24')]({'where':{'type':_0x238001,'resourceId':_0x48d727['id']}})['then'](function(){return _0x5ea7fd;});})[_0x78f3('0x23')](function(){_0x18189e[_0x78f3('0x17')](0xcc)[_0x78f3('0x18')]();});}};}function handleEntityNotFound(_0x28b923,_0x1595b7){return function(_0x54d5ae){if(!_0x54d5ae){_0x28b923[_0x78f3('0x16')](0x194);}return _0x54d5ae;};}function handleError(_0x2d794f,_0x42a049){_0x42a049=_0x42a049||0x1f4;return function(_0x42f03a){logger[_0x78f3('0x28')](_0x42f03a[_0x78f3('0x29')]);if(_0x42f03a[_0x78f3('0x2a')]){delete _0x42f03a[_0x78f3('0x2a')];}_0x2d794f[_0x78f3('0x17')](_0x42a049)[_0x78f3('0x2b')](_0x42f03a);};}exports[_0x78f3('0x2c')]=function(_0x2bfbaf,_0x14863b){var _0x9c0636={},_0x35da30={},_0x413450={'count':0x0,'rows':[]};var _0x1aa130=_[_0x78f3('0x2d')](db[_0x78f3('0x2e')][_0x78f3('0x2f')],function(_0x894dd8){return{'name':_0x894dd8[_0x78f3('0x30')],'type':_0x894dd8[_0x78f3('0x31')]['key']};});_0x35da30[_0x78f3('0x32')]=_['map'](_0x1aa130,_0x78f3('0x2a'));_0x35da30[_0x78f3('0x33')]=_[_0x78f3('0x34')](_0x2bfbaf['query']);_0x35da30[_0x78f3('0x35')]=_[_0x78f3('0x36')](_0x35da30[_0x78f3('0x32')],_0x35da30[_0x78f3('0x33')]);_0x9c0636['attributes']=_['intersection'](_0x35da30[_0x78f3('0x32')],qs[_0x78f3('0x37')](_0x2bfbaf[_0x78f3('0x33')][_0x78f3('0x37')]));_0x9c0636[_0x78f3('0x38')]=_0x9c0636['attributes'][_0x78f3('0x39')]?_0x9c0636[_0x78f3('0x38')]:_0x35da30[_0x78f3('0x32')];if(!_0x2bfbaf['query']['hasOwnProperty'](_0x78f3('0x3a'))){_0x9c0636[_0x78f3('0x1c')]=qs['limit'](_0x2bfbaf[_0x78f3('0x33')][_0x78f3('0x1c')]);_0x9c0636[_0x78f3('0x1a')]=qs[_0x78f3('0x1a')](_0x2bfbaf[_0x78f3('0x33')][_0x78f3('0x1a')]);}_0x9c0636['order']=qs[_0x78f3('0x3b')](_0x2bfbaf['query'][_0x78f3('0x3b')]);_0x9c0636[_0x78f3('0x3c')]=qs['filters'](_['pick'](_0x2bfbaf[_0x78f3('0x33')],_0x35da30[_0x78f3('0x35')]),_0x1aa130);if(_0x2bfbaf[_0x78f3('0x33')][_0x78f3('0x3d')]){_0x9c0636[_0x78f3('0x3c')]=_[_0x78f3('0x3e')](_0x9c0636[_0x78f3('0x3c')],{'$or':_['map'](_0x1aa130,function(_0x4eb0a8){if(_0x4eb0a8[_0x78f3('0x31')]!==_0x78f3('0x3f')){var _0x4d0fbb={};_0x4d0fbb[_0x4eb0a8['name']]={'$like':'%'+_0x2bfbaf[_0x78f3('0x33')][_0x78f3('0x3d')]+'%'};return _0x4d0fbb;}})});}_0x9c0636=_[_0x78f3('0x3e')]({},_0x9c0636,_0x2bfbaf[_0x78f3('0x40')]);var _0x5a42eb={'where':_0x9c0636[_0x78f3('0x3c')]};return db['VoiceChanSpy'][_0x78f3('0x1d')](_0x5a42eb)[_0x78f3('0x23')](function(_0xf8b089){_0x413450['count']=_0xf8b089;if(_0x2bfbaf['query']['includeAll']){_0x9c0636['include']=[{'all':!![]}];}return db[_0x78f3('0x2e')]['findAll'](_0x9c0636);})['then'](function(_0x29daf0){_0x413450[_0x78f3('0x41')]=_0x29daf0;return _0x413450;})['then'](respondWithFilteredResult(_0x14863b,_0x9c0636))[_0x78f3('0x42')](handleError(_0x14863b,null));};exports['show']=function(_0xcacc16,_0x1f8b38){var _0x1c6f28={'raw':![],'where':{'id':_0xcacc16['params']['id']}},_0x22f68e={};_0x22f68e[_0x78f3('0x32')]=_[_0x78f3('0x34')](db[_0x78f3('0x2e')][_0x78f3('0x2f')]);_0x22f68e[_0x78f3('0x33')]=_[_0x78f3('0x34')](_0xcacc16[_0x78f3('0x33')]);_0x22f68e[_0x78f3('0x35')]=_[_0x78f3('0x36')](_0x22f68e[_0x78f3('0x32')],_0x22f68e[_0x78f3('0x33')]);_0x1c6f28[_0x78f3('0x38')]=_['intersection'](_0x22f68e[_0x78f3('0x32')],qs[_0x78f3('0x37')](_0xcacc16['query']['fields']));_0x1c6f28['attributes']=_0x1c6f28[_0x78f3('0x38')][_0x78f3('0x39')]?_0x1c6f28['attributes']:_0x22f68e[_0x78f3('0x32')];if(_0xcacc16[_0x78f3('0x33')][_0x78f3('0x43')]){_0x1c6f28[_0x78f3('0x44')]=[{'all':!![]}];}_0x1c6f28=_[_0x78f3('0x3e')]({},_0x1c6f28,_0xcacc16[_0x78f3('0x40')]);return db[_0x78f3('0x2e')][_0x78f3('0x45')](_0x1c6f28)[_0x78f3('0x23')](handleEntityNotFound(_0x1f8b38,null))[_0x78f3('0x23')](respondWithResult(_0x1f8b38,null))['catch'](handleError(_0x1f8b38,null));};exports[_0x78f3('0x46')]=function(_0x5a4662,_0x5cc5b1){return db[_0x78f3('0x2e')][_0x78f3('0x46')](_0x5a4662[_0x78f3('0x47')],{})['then'](function(_0x12a874){var _0x5e864f=_0x5a4662[_0x78f3('0x48')]['get']({'plain':!![]});if(!_0x5e864f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e864f[_0x78f3('0x49')]===_0x78f3('0x48')){var _0x3a5302=_0x12a874[_0x78f3('0x25')]({'plain':!![]});var _0x372297=_0x78f3('0x26');return db['UserProfileSection'][_0x78f3('0x45')]({'where':{'name':_0x372297,'userProfileId':_0x5e864f['userProfileId']},'raw':!![]})[_0x78f3('0x23')](function(_0x28d48f){if(_0x28d48f&&_0x28d48f['autoAssociation']===0x0){return db[_0x78f3('0x27')][_0x78f3('0x46')]({'name':_0x3a5302[_0x78f3('0x2a')],'resourceId':_0x3a5302['id'],'type':_0x28d48f[_0x78f3('0x2a')],'sectionId':_0x28d48f['id']},{})[_0x78f3('0x23')](function(){return _0x12a874;});}else{return _0x12a874;}})[_0x78f3('0x42')](function(_0x33904f){logger[_0x78f3('0x28')](_0x78f3('0x4a'),_0x33904f);throw _0x33904f;});}return _0x12a874;})[_0x78f3('0x23')](respondWithResult(_0x5cc5b1,0xc9))[_0x78f3('0x42')](handleError(_0x5cc5b1,null));};exports[_0x78f3('0x22')]=function(_0x1fbdb3,_0x3f30cd){if(_0x1fbdb3[_0x78f3('0x47')]['id']){delete _0x1fbdb3['body']['id'];}return db[_0x78f3('0x2e')][_0x78f3('0x45')]({'where':{'id':_0x1fbdb3[_0x78f3('0x4b')]['id']}})[_0x78f3('0x23')](handleEntityNotFound(_0x3f30cd,null))['then'](saveUpdates(_0x1fbdb3['body'],null))[_0x78f3('0x23')](respondWithResult(_0x3f30cd,null))[_0x78f3('0x42')](handleError(_0x3f30cd,null));};exports[_0x78f3('0x24')]=function(_0x4edbaa,_0x511641){return db[_0x78f3('0x2e')][_0x78f3('0x45')]({'where':{'id':_0x4edbaa[_0x78f3('0x4b')]['id']}})[_0x78f3('0x23')](handleEntityNotFound(_0x511641,null))[_0x78f3('0x23')](removeEntity(_0x511641,null))[_0x78f3('0x42')](handleError(_0x511641,null));};
\ No newline at end of file
+var _0xcd31=['send','map','VoiceChanSpy','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','merge','where','VIRTUAL','options','includeAll','findAll','show','params','find','create','body','user','get','role','userProfileId','autoAssociation','catch','error','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','count','limit','set','Content-Range','reject','update','then','ChanSpies','UserProfileResource','end','stack','name'];(function(_0x53d49e,_0x251520){var _0x1504e3=function(_0x1f90e7){while(--_0x1f90e7){_0x53d49e['push'](_0x53d49e['shift']());}};_0x1504e3(++_0x251520);}(_0xcd31,0x15d));var _0x1cd3=function(_0x570b12,_0x9d48b7){_0x570b12=_0x570b12-0x0;var _0x2a4dab=_0xcd31[_0x570b12];return _0x2a4dab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cd3('0x0'));var zipdir=require(_0x1cd3('0x1'));var jsonpatch=require(_0x1cd3('0x2'));var rp=require('request-promise');var moment=require(_0x1cd3('0x3'));var BPromise=require(_0x1cd3('0x4'));var Mustache=require(_0x1cd3('0x5'));var util=require(_0x1cd3('0x6'));var path=require(_0x1cd3('0x7'));var sox=require(_0x1cd3('0x8'));var csv=require('to-csv');var ejs=require(_0x1cd3('0x9'));var fs=require('fs');var fs_extra=require(_0x1cd3('0xa'));var _=require(_0x1cd3('0xb'));var squel=require('squel');var crypto=require(_0x1cd3('0xc'));var jsforce=require(_0x1cd3('0xd'));var deskjs=require(_0x1cd3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1cd3('0xf'));var Papa=require(_0x1cd3('0x10'));var Redis=require(_0x1cd3('0x11'));var authService=require(_0x1cd3('0x12'));var qs=require(_0x1cd3('0x13'));var as=require(_0x1cd3('0x14'));var hardwareService=require(_0x1cd3('0x15'));var logger=require('../../config/logger')(_0x1cd3('0x16'));var utils=require(_0x1cd3('0x17'));var config=require(_0x1cd3('0x18'));var licenseUtil=require(_0x1cd3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfe288e,_0x4c9c6d){_0x4c9c6d=_0x4c9c6d||0xcc;return function(_0x41016f){if(_0x41016f){return _0xfe288e[_0x1cd3('0x1a')](_0x4c9c6d);}return _0xfe288e[_0x1cd3('0x1b')](_0x4c9c6d)['end']();};}function respondWithResult(_0x5b885f,_0x1a874c){_0x1a874c=_0x1a874c||0xc8;return function(_0x1def57){if(_0x1def57){return _0x5b885f[_0x1cd3('0x1b')](_0x1a874c)['json'](_0x1def57);}};}function respondWithFilteredResult(_0x2b28cf,_0x40cbbf){return function(_0x5a2b84){if(_0x5a2b84){var _0x418da3=typeof _0x40cbbf['offset']==='undefined'&&typeof _0x40cbbf['limit']==='undefined';var _0x5ca15c=_0x5a2b84['count'];var _0x14c491=_0x418da3?0x0:_0x40cbbf[_0x1cd3('0x1c')];var _0xf82a46=_0x418da3?_0x5a2b84[_0x1cd3('0x1d')]:_0x40cbbf[_0x1cd3('0x1c')]+_0x40cbbf[_0x1cd3('0x1e')];var _0x35870b;if(_0xf82a46>=_0x5ca15c){_0xf82a46=_0x5ca15c;_0x35870b=0xc8;}else{_0x35870b=0xce;}_0x2b28cf[_0x1cd3('0x1b')](_0x35870b);return _0x2b28cf[_0x1cd3('0x1f')](_0x1cd3('0x20'),_0x14c491+'-'+_0xf82a46+'/'+_0x5ca15c)['json'](_0x5a2b84);}return null;};}function patchUpdates(_0x33fc72){return function(_0x2368b3){try{jsonpatch['apply'](_0x2368b3,_0x33fc72,!![]);}catch(_0x26b59a){return BPromise[_0x1cd3('0x21')](_0x26b59a);}return _0x2368b3['save']();};}function saveUpdates(_0x20cda5,_0x159d22){return function(_0x330741){if(_0x330741){return _0x330741[_0x1cd3('0x22')](_0x20cda5)['then'](function(_0x4f6920){return _0x4f6920;});}return null;};}function removeEntity(_0x29ff8c,_0x1a6dad){return function(_0x49c7b1){if(_0x49c7b1){return _0x49c7b1['destroy']()[_0x1cd3('0x23')](function(){var _0x44b162=_0x49c7b1['get']({'plain':!![]});var _0x55aa9c=_0x1cd3('0x24');return db[_0x1cd3('0x25')]['destroy']({'where':{'type':_0x55aa9c,'resourceId':_0x44b162['id']}})['then'](function(){return _0x49c7b1;});})[_0x1cd3('0x23')](function(){_0x29ff8c[_0x1cd3('0x1b')](0xcc)[_0x1cd3('0x26')]();});}};}function handleEntityNotFound(_0x5e4dc7,_0x55d29b){return function(_0x334ce2){if(!_0x334ce2){_0x5e4dc7['sendStatus'](0x194);}return _0x334ce2;};}function handleError(_0x173f0d,_0x2279c0){_0x2279c0=_0x2279c0||0x1f4;return function(_0x268501){logger['error'](_0x268501[_0x1cd3('0x27')]);if(_0x268501['name']){delete _0x268501[_0x1cd3('0x28')];}_0x173f0d[_0x1cd3('0x1b')](_0x2279c0)[_0x1cd3('0x29')](_0x268501);};}exports['index']=function(_0x2b65d7,_0x909bc6){var _0x3d4963={},_0x4399a1={},_0x2126a2={'count':0x0,'rows':[]};var _0x5a3347=_[_0x1cd3('0x2a')](db[_0x1cd3('0x2b')][_0x1cd3('0x2c')],function(_0x5ea13d){return{'name':_0x5ea13d[_0x1cd3('0x2d')],'type':_0x5ea13d[_0x1cd3('0x2e')]['key']};});_0x4399a1[_0x1cd3('0x2f')]=_[_0x1cd3('0x2a')](_0x5a3347,'name');_0x4399a1['query']=_[_0x1cd3('0x30')](_0x2b65d7[_0x1cd3('0x31')]);_0x4399a1[_0x1cd3('0x32')]=_[_0x1cd3('0x33')](_0x4399a1[_0x1cd3('0x2f')],_0x4399a1['query']);_0x3d4963[_0x1cd3('0x34')]=_['intersection'](_0x4399a1['model'],qs[_0x1cd3('0x35')](_0x2b65d7[_0x1cd3('0x31')][_0x1cd3('0x35')]));_0x3d4963[_0x1cd3('0x34')]=_0x3d4963['attributes'][_0x1cd3('0x36')]?_0x3d4963['attributes']:_0x4399a1[_0x1cd3('0x2f')];if(!_0x2b65d7[_0x1cd3('0x31')][_0x1cd3('0x37')](_0x1cd3('0x38'))){_0x3d4963['limit']=qs['limit'](_0x2b65d7[_0x1cd3('0x31')]['limit']);_0x3d4963[_0x1cd3('0x1c')]=qs[_0x1cd3('0x1c')](_0x2b65d7[_0x1cd3('0x31')][_0x1cd3('0x1c')]);}_0x3d4963[_0x1cd3('0x39')]=qs['sort'](_0x2b65d7['query']['sort']);_0x3d4963['where']=qs[_0x1cd3('0x32')](_['pick'](_0x2b65d7[_0x1cd3('0x31')],_0x4399a1['filters']),_0x5a3347);if(_0x2b65d7[_0x1cd3('0x31')][_0x1cd3('0x3a')]){_0x3d4963['where']=_[_0x1cd3('0x3b')](_0x3d4963[_0x1cd3('0x3c')],{'$or':_[_0x1cd3('0x2a')](_0x5a3347,function(_0x4bec6f){if(_0x4bec6f['type']!==_0x1cd3('0x3d')){var _0x203dc0={};_0x203dc0[_0x4bec6f[_0x1cd3('0x28')]]={'$like':'%'+_0x2b65d7[_0x1cd3('0x31')][_0x1cd3('0x3a')]+'%'};return _0x203dc0;}})});}_0x3d4963=_[_0x1cd3('0x3b')]({},_0x3d4963,_0x2b65d7[_0x1cd3('0x3e')]);var _0x178d60={'where':_0x3d4963[_0x1cd3('0x3c')]};return db['VoiceChanSpy']['count'](_0x178d60)['then'](function(_0x42a2ed){_0x2126a2[_0x1cd3('0x1d')]=_0x42a2ed;if(_0x2b65d7['query'][_0x1cd3('0x3f')]){_0x3d4963['include']=[{'all':!![]}];}return db[_0x1cd3('0x2b')][_0x1cd3('0x40')](_0x3d4963);})[_0x1cd3('0x23')](function(_0x326f08){_0x2126a2['rows']=_0x326f08;return _0x2126a2;})['then'](respondWithFilteredResult(_0x909bc6,_0x3d4963))['catch'](handleError(_0x909bc6,null));};exports[_0x1cd3('0x41')]=function(_0x5a495b,_0x54fdbb){var _0x3ea51f={'raw':![],'where':{'id':_0x5a495b[_0x1cd3('0x42')]['id']}},_0x522890={};_0x522890[_0x1cd3('0x2f')]=_[_0x1cd3('0x30')](db[_0x1cd3('0x2b')][_0x1cd3('0x2c')]);_0x522890[_0x1cd3('0x31')]=_[_0x1cd3('0x30')](_0x5a495b[_0x1cd3('0x31')]);_0x522890['filters']=_[_0x1cd3('0x33')](_0x522890[_0x1cd3('0x2f')],_0x522890[_0x1cd3('0x31')]);_0x3ea51f['attributes']=_['intersection'](_0x522890[_0x1cd3('0x2f')],qs[_0x1cd3('0x35')](_0x5a495b[_0x1cd3('0x31')][_0x1cd3('0x35')]));_0x3ea51f[_0x1cd3('0x34')]=_0x3ea51f[_0x1cd3('0x34')][_0x1cd3('0x36')]?_0x3ea51f['attributes']:_0x522890[_0x1cd3('0x2f')];if(_0x5a495b[_0x1cd3('0x31')][_0x1cd3('0x3f')]){_0x3ea51f['include']=[{'all':!![]}];}_0x3ea51f=_['merge']({},_0x3ea51f,_0x5a495b[_0x1cd3('0x3e')]);return db[_0x1cd3('0x2b')][_0x1cd3('0x43')](_0x3ea51f)[_0x1cd3('0x23')](handleEntityNotFound(_0x54fdbb,null))[_0x1cd3('0x23')](respondWithResult(_0x54fdbb,null))['catch'](handleError(_0x54fdbb,null));};exports['create']=function(_0x500fcf,_0x3cde0b){return db[_0x1cd3('0x2b')][_0x1cd3('0x44')](_0x500fcf[_0x1cd3('0x45')],{})[_0x1cd3('0x23')](function(_0x4ab5d1){var _0x52256a=_0x500fcf[_0x1cd3('0x46')][_0x1cd3('0x47')]({'plain':!![]});if(!_0x52256a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52256a[_0x1cd3('0x48')]===_0x1cd3('0x46')){var _0x2542f6=_0x4ab5d1['get']({'plain':!![]});var _0x4ddfba=_0x1cd3('0x24');return db['UserProfileSection'][_0x1cd3('0x43')]({'where':{'name':_0x4ddfba,'userProfileId':_0x52256a[_0x1cd3('0x49')]},'raw':!![]})[_0x1cd3('0x23')](function(_0x3d2f46){if(_0x3d2f46&&_0x3d2f46[_0x1cd3('0x4a')]===0x0){return db[_0x1cd3('0x25')][_0x1cd3('0x44')]({'name':_0x2542f6[_0x1cd3('0x28')],'resourceId':_0x2542f6['id'],'type':_0x3d2f46['name'],'sectionId':_0x3d2f46['id']},{})[_0x1cd3('0x23')](function(){return _0x4ab5d1;});}else{return _0x4ab5d1;}})[_0x1cd3('0x4b')](function(_0xbd4ea2){logger[_0x1cd3('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbd4ea2);throw _0xbd4ea2;});}return _0x4ab5d1;})[_0x1cd3('0x23')](respondWithResult(_0x3cde0b,0xc9))[_0x1cd3('0x4b')](handleError(_0x3cde0b,null));};exports[_0x1cd3('0x22')]=function(_0x4a493a,_0x5e97af){if(_0x4a493a[_0x1cd3('0x45')]['id']){delete _0x4a493a['body']['id'];}return db[_0x1cd3('0x2b')][_0x1cd3('0x43')]({'where':{'id':_0x4a493a[_0x1cd3('0x42')]['id']}})[_0x1cd3('0x23')](handleEntityNotFound(_0x5e97af,null))['then'](saveUpdates(_0x4a493a[_0x1cd3('0x45')],null))[_0x1cd3('0x23')](respondWithResult(_0x5e97af,null))[_0x1cd3('0x4b')](handleError(_0x5e97af,null));};exports[_0x1cd3('0x4d')]=function(_0x57a1e7,_0x27b8ef){return db[_0x1cd3('0x2b')]['find']({'where':{'id':_0x57a1e7['params']['id']}})[_0x1cd3('0x23')](handleEntityNotFound(_0x27b8ef,null))['then'](removeEntity(_0x27b8ef,null))[_0x1cd3('0x4b')](handleError(_0x27b8ef,null));};
\ No newline at end of file
index ce767d1..420b170 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b6a=['agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','record','length','internal','User','findAll'];(function(_0x4c566d,_0x55d066){var _0x33fd32=function(_0x452ec3){while(--_0x452ec3){_0x4c566d['push'](_0x4c566d['shift']());}};_0x33fd32(++_0x55d066);}(_0x6b6a,0x12a));var _0xa6b6=function(_0x3f4ed1,_0x2b5dad){_0x3f4ed1=_0x3f4ed1-0x0;var _0x26b597=_0x6b6a[_0x3f4ed1];return _0x26b597;};'use strict';var _=require('lodash');var util=require(_0xa6b6('0x0'));var BPromise=require(_0xa6b6('0x1'));var attributes=require(_0xa6b6('0x2'));var getUserApplications=function(_0x15bc58,_0x11f450,_0x411985){var _0x338797=0x1;var _0x3b5edf=[];var _0x1fcb52={'context':_0x11f450[_0xa6b6('0x3')]||_0xa6b6('0x4'),'exten':util[_0xa6b6('0x5')](_0xa6b6('0x6'),_0x15bc58[_0xa6b6('0x7')],_0x411985),'type':_0xa6b6('0x8'),'isApp':![],'ChanSpyId':_0x15bc58['id'],'UserId':_0x11f450['id']};_0x3b5edf[_0xa6b6('0x9')](_[_0xa6b6('0xa')]({'app':_0xa6b6('0xb'),'appdata':util[_0xa6b6('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x338797++},_0x1fcb52));if(_0x15bc58['record']){_0x3b5edf[_0xa6b6('0x9')](_['merge']({'app':'MixMonitor','appdata':util[_0xa6b6('0x5')](_0xa6b6('0xc'),_0x15bc58[_0xa6b6('0xd')]),'priority':_0x338797++},_0x1fcb52));}if(_0x15bc58[_0xa6b6('0xe')]){_0x3b5edf[_0xa6b6('0x9')](_[_0xa6b6('0xa')]({'app':_0xa6b6('0xf'),'appdata':_0x15bc58[_0xa6b6('0x10')],'priority':_0x338797++},_0x1fcb52));}_0x3b5edf[_0xa6b6('0x9')](_['merge']({'app':'ChanSpy','appdata':util[_0xa6b6('0x5')](_0xa6b6('0x11'),_0x11f450[_0xa6b6('0x12')],_0x15bc58['options']?_0x15bc58[_0xa6b6('0x13')][_0xa6b6('0x14')](''):''),'priority':_0x338797++},_0x1fcb52));if(_0x15bc58[_0xa6b6('0x15')]){_0x3b5edf[_0xa6b6('0x9')](_[_0xa6b6('0xa')]({'app':'StopMixMonitor','priority':_0x338797++},_0x1fcb52));}return _0x3b5edf;};var getChanSpyApplications=function(_0x1e6f44,_0x553587){var _0x501bb5=[];for(var _0x5bea82=0x0,_0x2896e3=0x1;_0x5bea82<_0x553587[_0xa6b6('0x16')];_0x5bea82++,_0x2896e3=0x1){_0x501bb5=_0x501bb5['concat'](getUserApplications(_0x1e6f44,_0x553587[_0x5bea82],_0x553587[_0x5bea82][_0xa6b6('0x17')]));if(_0x553587[_0x5bea82][_0xa6b6('0x17')]!=_0x553587[_0x5bea82][_0xa6b6('0x12')]){_0x501bb5=_0x501bb5['concat'](getUserApplications(_0x1e6f44,_0x553587[_0x5bea82],_0x553587[_0x5bea82][_0xa6b6('0x12')]));}}return _0x501bb5;};var getChanSpyPromise=function(_0x353960,_0x33402d){return new BPromise(function(_0x52bd6a,_0x5f47a9){return _0x353960[_0xa6b6('0x18')][_0xa6b6('0x19')]({'attributes':['id',_0xa6b6('0x12'),'internal'],'where':{'role':_0xa6b6('0x1a'),'chanspy':!![]},'raw':!![]})[_0xa6b6('0x1b')](function(_0x34b9f1){if(_0x34b9f1){return _0x52bd6a(getChanSpyApplications(_0x33402d,_0x34b9f1));}return _0x52bd6a([]);})[_0xa6b6('0x1c')](function(_0xd73e4c){_0x5f47a9(_0xd73e4c);});});};module['exports']=function(_0x2be1f7,_0x3ed612){var _0x443c08=_0x2be1f7[_0xa6b6('0x1d')];return _0x2be1f7[_0xa6b6('0x1e')](_0xa6b6('0x1f'),attributes,{'tableName':_0xa6b6('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5876ad,_0x562df1,_0x2a06d8){return getChanSpyPromise(_0x443c08,_0x5876ad)[_0xa6b6('0x1b')](function(_0x22f4f9){if(_0x22f4f9&&_0x22f4f9[_0xa6b6('0x16')]){return _0x443c08[_0xa6b6('0x21')][_0xa6b6('0x22')](_0x22f4f9);}})['then'](function(){_0x2a06d8();})['catch'](function(_0x2cbec3){_0x2a06d8(_0x2cbec3);});},'afterUpdate':function(_0x3ef009,_0x59de0a,_0x448344){return _0x443c08[_0xa6b6('0x21')][_0xa6b6('0x23')]({'where':{'ChanSpyId':_0x3ef009['id']}})['then'](function(){return getChanSpyPromise(_0x443c08,_0x3ef009);})[_0xa6b6('0x1b')](function(_0x25ea29){if(_0x25ea29&&_0x25ea29['length']){return _0x443c08[_0xa6b6('0x21')][_0xa6b6('0x22')](_0x25ea29);}})['then'](function(){_0x448344();})['catch'](function(_0x35b574){_0x448344(_0x35b574);});},'afterDestroy':function(_0x4e3846,_0x210fda,_0x29e07e){return _0x443c08[_0xa6b6('0x21')]['destroy']({'where':{'ChanSpyId':_0x4e3846['id']}})[_0xa6b6('0x1b')](function(){_0x29e07e();})['catch'](function(_0x246e7e){_0x29e07e(_0x246e7e);});}}});};
\ No newline at end of file
+var _0x62bd=['voice_chanspy','then','VoiceExtension','destroy','length','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','Set','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','User','findAll','agent','catch','exports','models','VoiceChanSpy'];(function(_0x237464,_0x5ce8ab){var _0x2e3545=function(_0x4af3a5){while(--_0x4af3a5){_0x237464['push'](_0x237464['shift']());}};_0x2e3545(++_0x5ce8ab);}(_0x62bd,0x1cd));var _0xd62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd62b('0x0'));var BPromise=require('bluebird');var attributes=require(_0xd62b('0x1'));var getUserApplications=function(_0x2256b3,_0x338dca,_0x4be52d){var _0x4b46da=0x1;var _0x1e5bab=[];var _0x3b2c10={'context':_0x338dca[_0xd62b('0x2')]||_0xd62b('0x3'),'exten':util[_0xd62b('0x4')](_0xd62b('0x5'),_0x2256b3[_0xd62b('0x6')],_0x4be52d),'type':_0xd62b('0x7'),'isApp':![],'ChanSpyId':_0x2256b3['id'],'UserId':_0x338dca['id']};_0x1e5bab['push'](_[_0xd62b('0x8')]({'app':_0xd62b('0x9'),'appdata':util[_0xd62b('0x4')]('CDR(type)=%s',_0xd62b('0xa')),'priority':_0x4b46da++},_0x3b2c10));if(_0x2256b3[_0xd62b('0xb')]){_0x1e5bab[_0xd62b('0xc')](_[_0xd62b('0x8')]({'app':_0xd62b('0xd'),'appdata':util[_0xd62b('0x4')](_0xd62b('0xe'),_0x2256b3[_0xd62b('0xf')]),'priority':_0x4b46da++},_0x3b2c10));}if(_0x2256b3[_0xd62b('0x10')]){_0x1e5bab[_0xd62b('0xc')](_['merge']({'app':_0xd62b('0x11'),'appdata':_0x2256b3[_0xd62b('0x12')],'priority':_0x4b46da++},_0x3b2c10));}_0x1e5bab[_0xd62b('0xc')](_[_0xd62b('0x8')]({'app':_0xd62b('0x13'),'appdata':util[_0xd62b('0x4')](_0xd62b('0x14'),_0x338dca[_0xd62b('0x15')],_0x2256b3[_0xd62b('0x16')]?_0x2256b3[_0xd62b('0x16')]['join'](''):''),'priority':_0x4b46da++},_0x3b2c10));if(_0x2256b3['record']){_0x1e5bab[_0xd62b('0xc')](_['merge']({'app':_0xd62b('0x17'),'priority':_0x4b46da++},_0x3b2c10));}return _0x1e5bab;};var getChanSpyApplications=function(_0x10d9ac,_0x3efd31){var _0x110e0f=[];for(var _0x512bf3=0x0,_0x59825a=0x1;_0x512bf3<_0x3efd31['length'];_0x512bf3++,_0x59825a=0x1){_0x110e0f=_0x110e0f[_0xd62b('0x18')](getUserApplications(_0x10d9ac,_0x3efd31[_0x512bf3],_0x3efd31[_0x512bf3]['internal']));if(_0x3efd31[_0x512bf3][_0xd62b('0x19')]!=_0x3efd31[_0x512bf3][_0xd62b('0x15')]){_0x110e0f=_0x110e0f[_0xd62b('0x18')](getUserApplications(_0x10d9ac,_0x3efd31[_0x512bf3],_0x3efd31[_0x512bf3][_0xd62b('0x15')]));}}return _0x110e0f;};var getChanSpyPromise=function(_0x1c7dfa,_0x1e227f){return new BPromise(function(_0x3a72aa,_0xd76815){return _0x1c7dfa[_0xd62b('0x1a')][_0xd62b('0x1b')]({'attributes':['id','name',_0xd62b('0x19')],'where':{'role':_0xd62b('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1eff2f){if(_0x1eff2f){return _0x3a72aa(getChanSpyApplications(_0x1e227f,_0x1eff2f));}return _0x3a72aa([]);})[_0xd62b('0x1d')](function(_0x53d806){_0xd76815(_0x53d806);});});};module[_0xd62b('0x1e')]=function(_0x5e3b87,_0x37b8fb){var _0xdc4b0d=_0x5e3b87[_0xd62b('0x1f')];return _0x5e3b87['define'](_0xd62b('0x20'),attributes,{'tableName':_0xd62b('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x374fd5,_0x2d36f3,_0x228c58){return getChanSpyPromise(_0xdc4b0d,_0x374fd5)[_0xd62b('0x22')](function(_0x45fb82){if(_0x45fb82&&_0x45fb82['length']){return _0xdc4b0d[_0xd62b('0x23')]['bulkCreate'](_0x45fb82);}})[_0xd62b('0x22')](function(){_0x228c58();})[_0xd62b('0x1d')](function(_0x457783){_0x228c58(_0x457783);});},'afterUpdate':function(_0x3277f9,_0x59bb6e,_0x344131){return _0xdc4b0d[_0xd62b('0x23')][_0xd62b('0x24')]({'where':{'ChanSpyId':_0x3277f9['id']}})[_0xd62b('0x22')](function(){return getChanSpyPromise(_0xdc4b0d,_0x3277f9);})[_0xd62b('0x22')](function(_0x32e74d){if(_0x32e74d&&_0x32e74d[_0xd62b('0x25')]){return _0xdc4b0d[_0xd62b('0x23')]['bulkCreate'](_0x32e74d);}})['then'](function(){_0x344131();})[_0xd62b('0x1d')](function(_0x651580){_0x344131(_0x651580);});},'afterDestroy':function(_0x573d00,_0x1dfaee,_0x5b7a63){return _0xdc4b0d['VoiceExtension'][_0xd62b('0x24')]({'where':{'ChanSpyId':_0x573d00['id']}})[_0xd62b('0x22')](function(){_0x5b7a63();})[_0xd62b('0x1d')](function(_0x8dbda0){_0x5b7a63(_0x8dbda0);});}}});};
\ No newline at end of file
index 28a9cf6..b2374ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0d=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x3e05f1,_0x4c5206){_0x3e05f1=_0x3e05f1-0x0;var _0x286db1=_0x9e0d[_0x3e05f1];return _0x286db1;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});}
\ No newline at end of file
+var _0x6308=['stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6308,0x1f2));var _0x8630=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x6308[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var moment=require(_0x8630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8630('0x2'));var db=require(_0x8630('0x3'))['db'];var utils=require(_0x8630('0x4'));var logger=require(_0x8630('0x5'))(_0x8630('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8630('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337086,_0x3d5a10,_0x1bcfea){return new BPromise(function(_0x2b87ea,_0x10cc17){return client[_0x8630('0x8')](_0x337086,_0x1bcfea)['then'](function(_0x8b3652){logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));logger[_0x8630('0xb')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x3d5a10,_0x8630('0xa'),JSON[_0x8630('0xc')](_0x8b3652));if(_0x8b3652[_0x8630('0xd')]){if(_0x8b3652['error'][_0x8630('0xe')]===0x1f4){logger[_0x8630('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3d5a10,_0x8b3652['error'][_0x8630('0xf')]);return _0x10cc17(_0x8b3652[_0x8630('0xd')]['message']);}logger[_0x8630('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3d5a10,_0x8b3652[_0x8630('0xd')]['message']);return _0x2b87ea(_0x8b3652[_0x8630('0xd')]['message']);}else{logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));_0x2b87ea(_0x8b3652['result']['message']);}})[_0x8630('0x10')](function(_0x547667){logger[_0x8630('0xd')](_0x8630('0x9'),_0x3d5a10,_0x547667);_0x10cc17(_0x547667);});});}
\ No newline at end of file
index 9492728..56aa1bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5dc=['/:id','show','post','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc5dc,0x1e3));var _0xcc5d=function(_0x348c6c,_0x45232a){_0x348c6c=_0x348c6c-0x0;var _0x372ec6=_0xc5dc[_0x348c6c];return _0x372ec6;};'use strict';var multer=require(_0xcc5d('0x0'));var util=require(_0xcc5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc5d('0x2'));var router=express[_0xcc5d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcc5d('0x4'));var interaction=require(_0xcc5d('0x5'));var config=require(_0xcc5d('0x6'));var controller=require(_0xcc5d('0x7'));router[_0xcc5d('0x8')]('/',auth[_0xcc5d('0x9')](),controller['index']);router[_0xcc5d('0x8')](_0xcc5d('0xa'),auth[_0xcc5d('0x9')](),controller[_0xcc5d('0xb')]);router[_0xcc5d('0xc')]('/',auth[_0xcc5d('0x9')](),controller[_0xcc5d('0xd')]);router[_0xcc5d('0xe')](_0xcc5d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xcc5d('0xf')]('/:id',auth[_0xcc5d('0x9')](),controller['destroy']);module[_0xcc5d('0x10')]=router;
\ No newline at end of file
+var _0x6945=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x6945,0x91));var _0x5694=function(_0x4f8423,_0x2f1a1c){_0x4f8423=_0x4f8423-0x0;var _0x5bed7f=_0x6945[_0x4f8423];return _0x5bed7f;};'use strict';var multer=require(_0x5694('0x0'));var util=require(_0x5694('0x1'));var path=require('path');var timeout=require(_0x5694('0x2'));var express=require(_0x5694('0x3'));var router=express[_0x5694('0x4')]();var fs_extra=require(_0x5694('0x5'));var auth=require(_0x5694('0x6'));var interaction=require(_0x5694('0x7'));var config=require('../../config/environment');var controller=require(_0x5694('0x8'));router['get']('/',auth[_0x5694('0x9')](),controller[_0x5694('0xa')]);router['get'](_0x5694('0xb'),auth[_0x5694('0x9')](),controller[_0x5694('0xc')]);router[_0x5694('0xd')]('/',auth['isAuthenticated'](),controller[_0x5694('0xe')]);router[_0x5694('0xf')](_0x5694('0xb'),auth[_0x5694('0x9')](),controller[_0x5694('0x10')]);router[_0x5694('0x11')]('/:id',auth[_0x5694('0x9')](),controller[_0x5694('0x12')]);module[_0x5694('0x13')]=router;
\ No newline at end of file
index 0cf9be6..4703aa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3486=['name','STRING','sequelize','exports'];(function(_0x32711b,_0x2bf0f6){var _0x3c0760=function(_0x2e13c4){while(--_0x2e13c4){_0x32711b['push'](_0x32711b['shift']());}};_0x3c0760(++_0x2bf0f6);}(_0x3486,0xd6));var _0x6348=function(_0x2ae1ca,_0x2d1b72){_0x2ae1ca=_0x2ae1ca-0x0;var _0x2a864a=_0x3486[_0x2ae1ca];return _0x2a864a;};'use strict';var Sequelize=require(_0x6348('0x0'));module[_0x6348('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6348('0x2')},'description':{'type':Sequelize[_0x6348('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdf91=['exports','STRING','sequelize'];(function(_0x4a9d65,_0x51296e){var _0x6b2c1b=function(_0x438964){while(--_0x438964){_0x4a9d65['push'](_0x4a9d65['shift']());}};_0x6b2c1b(++_0x51296e);}(_0xdf91,0x164));var _0x1df9=function(_0x16d9ee,_0x283d4d){_0x16d9ee=_0x16d9ee-0x0;var _0x26adfa=_0xdf91[_0x16d9ee];return _0x26adfa;};'use strict';var Sequelize=require(_0x1df9('0x0'));module[_0x1df9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x1df9('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 0aca473..bb98a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0fe=['where','options','includeAll','include','findAll','rows','catch','show','params','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readFileSync','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x520df3,_0x1c4989){var _0x4f8b5b=function(_0x1206ae){while(--_0x1206ae){_0x520df3['push'](_0x520df3['shift']());}};_0x4f8b5b(++_0x1c4989);}(_0xd0fe,0xef));var _0xed0f=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0xd0fe[_0x426fb9];return _0x2d1760;};'use strict';var emlformat=require(_0xed0f('0x0'));var rimraf=require(_0xed0f('0x1'));var zipdir=require(_0xed0f('0x2'));var jsonpatch=require(_0xed0f('0x3'));var rp=require(_0xed0f('0x4'));var moment=require(_0xed0f('0x5'));var BPromise=require(_0xed0f('0x6'));var Mustache=require('mustache');var util=require(_0xed0f('0x7'));var path=require(_0xed0f('0x8'));var sox=require('sox');var csv=require(_0xed0f('0x9'));var ejs=require(_0xed0f('0xa'));var fs=require('fs');var fs_extra=require(_0xed0f('0xb'));var _=require('lodash');var squel=require(_0xed0f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed0f('0xd'));var toCsv=require(_0xed0f('0x9'));var querystring=require(_0xed0f('0xe'));var Papa=require(_0xed0f('0xf'));var Redis=require(_0xed0f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed0f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed0f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xed0f('0x13'));var config=require(_0xed0f('0x14'));var licenseUtil=require(_0xed0f('0x15'));var db=require(_0xed0f('0x16'))['db'];var jayson=require(_0xed0f('0x17'));var client=jayson[_0xed0f('0x18')][_0xed0f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5208d4,_0x1b22ff,_0x53898f,_0x4cfbac){return new BPromise(function(_0x1506fe,_0x32ffb4){var _0x4a08c0=_0x4cfbac||client;return _0x4a08c0[_0xed0f('0x1a')](_0x5208d4,_0x53898f)[_0xed0f('0x1b')](function(_0x1ca5e3){logger['info'](_0xed0f('0x1c'),_0x1b22ff,_0xed0f('0x1d'));logger[_0xed0f('0x1e')](_0xed0f('0x1f'),_0x1b22ff,_0xed0f('0x1d'),JSON[_0xed0f('0x20')](_0x1ca5e3));if(_0x1ca5e3[_0xed0f('0x21')]){if(_0x1ca5e3[_0xed0f('0x21')]['code']===0x1f4){logger[_0xed0f('0x21')](_0xed0f('0x1c'),_0x1b22ff,_0x1ca5e3['error'][_0xed0f('0x22')]);return _0x32ffb4(_0x1ca5e3[_0xed0f('0x21')][_0xed0f('0x22')]);}logger[_0xed0f('0x21')](_0xed0f('0x1c'),_0x1b22ff,_0x1ca5e3[_0xed0f('0x21')]['message']);return _0x1506fe(_0x1ca5e3[_0xed0f('0x21')][_0xed0f('0x22')]);}else{logger[_0xed0f('0x23')]('VoiceContext,\x20%s,\x20%s',_0x1b22ff,_0xed0f('0x1d'));_0x1506fe(_0x1ca5e3[_0xed0f('0x24')][_0xed0f('0x22')]);}})['catch'](function(_0x5b47e6){logger[_0xed0f('0x21')]('VoiceContext,\x20%s,\x20%s',_0x1b22ff,_0x5b47e6);_0x32ffb4(_0x5b47e6);});});}function respondWithStatusCode(_0x3d7dfe,_0x4ee923){_0x4ee923=_0x4ee923||0xcc;return function(_0x3217f6){if(_0x3217f6){return _0x3d7dfe[_0xed0f('0x25')](_0x4ee923);}return _0x3d7dfe[_0xed0f('0x26')](_0x4ee923)[_0xed0f('0x27')]();};}function respondWithResult(_0xba8a08,_0x45bc8d){_0x45bc8d=_0x45bc8d||0xc8;return function(_0x4c73ad){if(_0x4c73ad){return _0xba8a08[_0xed0f('0x26')](_0x45bc8d)[_0xed0f('0x28')](_0x4c73ad);}};}function respondWithFilteredResult(_0xad8b30,_0x2e618f){return function(_0x1feada){if(_0x1feada){var _0x21a099=typeof _0x2e618f[_0xed0f('0x29')]===_0xed0f('0x2a')&&typeof _0x2e618f['limit']===_0xed0f('0x2a');var _0x31350c=_0x1feada[_0xed0f('0x2b')];var _0x4c0d7a=_0x21a099?0x0:_0x2e618f['offset'];var _0x1253b3=_0x21a099?_0x1feada[_0xed0f('0x2b')]:_0x2e618f['offset']+_0x2e618f[_0xed0f('0x2c')];var _0x100c47;if(_0x1253b3>=_0x31350c){_0x1253b3=_0x31350c;_0x100c47=0xc8;}else{_0x100c47=0xce;}_0xad8b30[_0xed0f('0x26')](_0x100c47);return _0xad8b30[_0xed0f('0x2d')](_0xed0f('0x2e'),_0x4c0d7a+'-'+_0x1253b3+'/'+_0x31350c)[_0xed0f('0x28')](_0x1feada);}return null;};}function patchUpdates(_0x4c36e4){return function(_0x180a4d){try{jsonpatch['apply'](_0x180a4d,_0x4c36e4,!![]);}catch(_0x46cef1){return BPromise[_0xed0f('0x2f')](_0x46cef1);}return _0x180a4d[_0xed0f('0x30')]();};}function saveUpdates(_0x39c7d2,_0x435973){return function(_0xd809b4){if(_0xd809b4){return _0xd809b4[_0xed0f('0x31')](_0x39c7d2)[_0xed0f('0x1b')](function(_0x505e45){return _0x505e45;});}return null;};}function removeEntity(_0x293506,_0x28c64e){return function(_0x49d719){if(_0x49d719){return _0x49d719[_0xed0f('0x32')]()[_0xed0f('0x1b')](function(){var _0x40dc8c=_0x49d719[_0xed0f('0x33')]({'plain':!![]});var _0x43fa52=_0xed0f('0x34');return db[_0xed0f('0x35')][_0xed0f('0x32')]({'where':{'type':_0x43fa52,'resourceId':_0x40dc8c['id']}})[_0xed0f('0x1b')](function(){return _0x49d719;});})['then'](function(){_0x293506[_0xed0f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dccf5,_0xa3f204){return function(_0x41e9e){if(!_0x41e9e){_0x3dccf5[_0xed0f('0x25')](0x194);}return _0x41e9e;};}function handleError(_0xaecf79,_0x8399b5){_0x8399b5=_0x8399b5||0x1f4;return function(_0x38a168){logger[_0xed0f('0x21')](_0x38a168[_0xed0f('0x36')]);if(_0x38a168[_0xed0f('0x37')]){delete _0x38a168[_0xed0f('0x37')];}_0xaecf79[_0xed0f('0x26')](_0x8399b5)['send'](_0x38a168);};}exports[_0xed0f('0x38')]=function(_0x907058,_0x95d3a4){var _0x429069={},_0x178888={},_0x5b8175={'count':0x0,'rows':[]};var _0x5d383c=_[_0xed0f('0x39')](db[_0xed0f('0x3a')][_0xed0f('0x3b')],function(_0x32984c){return{'name':_0x32984c[_0xed0f('0x3c')],'type':_0x32984c[_0xed0f('0x3d')]['key']};});_0x178888[_0xed0f('0x3e')]=_['map'](_0x5d383c,_0xed0f('0x37'));_0x178888[_0xed0f('0x3f')]=_[_0xed0f('0x40')](_0x907058[_0xed0f('0x3f')]);_0x178888[_0xed0f('0x41')]=_[_0xed0f('0x42')](_0x178888[_0xed0f('0x3e')],_0x178888[_0xed0f('0x3f')]);_0x429069[_0xed0f('0x43')]=_['intersection'](_0x178888[_0xed0f('0x3e')],qs[_0xed0f('0x44')](_0x907058[_0xed0f('0x3f')][_0xed0f('0x44')]));_0x429069[_0xed0f('0x43')]=_0x429069[_0xed0f('0x43')][_0xed0f('0x45')]?_0x429069['attributes']:_0x178888[_0xed0f('0x3e')];if(!_0x907058[_0xed0f('0x3f')][_0xed0f('0x46')](_0xed0f('0x47'))){_0x429069[_0xed0f('0x2c')]=qs[_0xed0f('0x2c')](_0x907058[_0xed0f('0x3f')][_0xed0f('0x2c')]);_0x429069[_0xed0f('0x29')]=qs[_0xed0f('0x29')](_0x907058[_0xed0f('0x3f')][_0xed0f('0x29')]);}_0x429069[_0xed0f('0x48')]=qs[_0xed0f('0x49')](_0x907058[_0xed0f('0x3f')]['sort']);_0x429069['where']=qs[_0xed0f('0x41')](_[_0xed0f('0x4a')](_0x907058[_0xed0f('0x3f')],_0x178888[_0xed0f('0x41')]),_0x5d383c);if(_0x907058['query'][_0xed0f('0x4b')]){_0x429069[_0xed0f('0x4c')]=_['merge'](_0x429069[_0xed0f('0x4c')],{'$or':_[_0xed0f('0x39')](_0x5d383c,function(_0x2db0d9){if(_0x2db0d9[_0xed0f('0x3d')]!=='VIRTUAL'){var _0x4e4064={};_0x4e4064[_0x2db0d9['name']]={'$like':'%'+_0x907058[_0xed0f('0x3f')][_0xed0f('0x4b')]+'%'};return _0x4e4064;}})});}_0x429069=_['merge']({},_0x429069,_0x907058[_0xed0f('0x4d')]);var _0x4e8d6d={'where':_0x429069['where']};return db[_0xed0f('0x3a')][_0xed0f('0x2b')](_0x4e8d6d)[_0xed0f('0x1b')](function(_0x4b1191){_0x5b8175['count']=_0x4b1191;if(_0x907058[_0xed0f('0x3f')][_0xed0f('0x4e')]){_0x429069[_0xed0f('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0xed0f('0x50')](_0x429069);})[_0xed0f('0x1b')](function(_0x394d5e){_0x5b8175[_0xed0f('0x51')]=_0x394d5e;return _0x5b8175;})[_0xed0f('0x1b')](respondWithFilteredResult(_0x95d3a4,_0x429069))[_0xed0f('0x52')](handleError(_0x95d3a4,null));};exports[_0xed0f('0x53')]=function(_0x2aee4f,_0x450882){var _0x2938b8={'raw':![],'where':{'id':_0x2aee4f[_0xed0f('0x54')]['id']}},_0x2cacd7={};_0x2cacd7[_0xed0f('0x3e')]=_[_0xed0f('0x40')](db[_0xed0f('0x3a')][_0xed0f('0x3b')]);_0x2cacd7[_0xed0f('0x3f')]=_[_0xed0f('0x40')](_0x2aee4f[_0xed0f('0x3f')]);_0x2cacd7[_0xed0f('0x41')]=_[_0xed0f('0x42')](_0x2cacd7[_0xed0f('0x3e')],_0x2cacd7[_0xed0f('0x3f')]);_0x2938b8[_0xed0f('0x43')]=_[_0xed0f('0x42')](_0x2cacd7[_0xed0f('0x3e')],qs['fields'](_0x2aee4f['query'][_0xed0f('0x44')]));_0x2938b8[_0xed0f('0x43')]=_0x2938b8[_0xed0f('0x43')][_0xed0f('0x45')]?_0x2938b8['attributes']:_0x2cacd7[_0xed0f('0x3e')];if(_0x2aee4f[_0xed0f('0x3f')][_0xed0f('0x4e')]){_0x2938b8['include']=[{'all':!![]}];}_0x2938b8=_['merge']({},_0x2938b8,_0x2aee4f[_0xed0f('0x4d')]);return db[_0xed0f('0x3a')]['find'](_0x2938b8)[_0xed0f('0x1b')](handleEntityNotFound(_0x450882,null))[_0xed0f('0x1b')](respondWithResult(_0x450882,null))[_0xed0f('0x52')](handleError(_0x450882,null));};exports['create']=function(_0x368a7c,_0x214f0e,_0x384680){var _0x170d71;return db[_0xed0f('0x3a')][_0xed0f('0x55')](_0x368a7c[_0xed0f('0x56')],{'raw':!![]})[_0xed0f('0x1b')](function(_0x3cf0cc){_0x170d71=_0x3cf0cc;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x9920f0){var _0x5a81e6=fs['readFileSync'](path[_0xed0f('0x57')](config[_0xed0f('0x58')],_0xed0f('0x59')),'utf8');var _0x53e21e=ejs[_0xed0f('0x5a')](_0x5a81e6,{'contexts':_0x9920f0||[]});fs[_0xed0f('0x5b')](_0xed0f('0x5c'),_0x53e21e);})['then'](function(){return respondWithRpcPromise(_0xed0f('0x5d'),_0xed0f('0x55'),{'module':_0xed0f('0x5e')});})['then'](function(){var _0x3d4532=_0x368a7c['user']['get']({'plain':!![]});if(!_0x3d4532)throw new Error(_0xed0f('0x5f'));if(_0x3d4532[_0xed0f('0x60')]===_0xed0f('0x61')){var _0x1f7174=_0x170d71[_0xed0f('0x33')]({'plain':!![]});return db[_0xed0f('0x62')]['find']({'where':{'name':'Contexts','userProfileId':_0x3d4532[_0xed0f('0x63')]},'raw':!![]})[_0xed0f('0x1b')](function(_0x12b5c1){if(_0x12b5c1&&_0x12b5c1[_0xed0f('0x64')]===0x0){return db[_0xed0f('0x35')][_0xed0f('0x55')]({'name':_0x1f7174[_0xed0f('0x37')],'resourceId':_0x1f7174['id'],'type':_0x12b5c1[_0xed0f('0x37')],'sectionId':_0x12b5c1['id']},{})[_0xed0f('0x1b')](function(){return _0x170d71;});}else{return _0x170d71;}})[_0xed0f('0x52')](function(_0x546bbd){logger[_0xed0f('0x21')](_0xed0f('0x65'),_0x546bbd);throw _0x546bbd;});}return _0x170d71;})['then'](respondWithResult(_0x214f0e,0xc9))[_0xed0f('0x52')](handleError(_0x214f0e,null));};exports['update']=function(_0xa75957,_0x47a43a,_0x3b95c9){var _0x45e692;return db[_0xed0f('0x3a')][_0xed0f('0x66')]({'where':{'id':_0xa75957[_0xed0f('0x54')]['id']}})[_0xed0f('0x1b')](handleEntityNotFound(_0x47a43a,null))['then'](saveUpdates(_0xa75957[_0xed0f('0x56')],null))['then'](function(_0x3e8155){if(_0x3e8155){_0x45e692=_0x3e8155;return db[_0xed0f('0x3a')][_0xed0f('0x50')]({'raw':!![]});}})['then'](function(_0x40e4aa){var _0x4fdcd0=fs[_0xed0f('0x67')](path[_0xed0f('0x57')](config[_0xed0f('0x58')],_0xed0f('0x59')),_0xed0f('0x68'));var _0x922e5a=ejs['render'](_0x4fdcd0,{'contexts':_0x40e4aa||[]});fs[_0xed0f('0x5b')](_0xed0f('0x5c'),_0x922e5a);})['then'](function(){return respondWithRpcPromise(_0xed0f('0x5d'),_0xed0f('0x31'),{'module':_0xed0f('0x5e')});})['then'](function(){return _0x45e692;})[_0xed0f('0x1b')](respondWithResult(_0x47a43a,null))['catch'](handleError(_0x47a43a,null));};exports[_0xed0f('0x32')]=function(_0x57655b,_0x533151,_0x2dff73){var _0x4aed70;return db['VoiceContext'][_0xed0f('0x66')]({'where':{'id':_0x57655b['params']['id']}})[_0xed0f('0x1b')](handleEntityNotFound(_0x533151,null))[_0xed0f('0x1b')](removeEntity(_0x533151,null))[_0xed0f('0x1b')](function(){return db[_0xed0f('0x3a')][_0xed0f('0x50')]({'raw':!![]});})[_0xed0f('0x1b')](function(_0x3ddf4e){var _0x4a01c3=fs[_0xed0f('0x67')](path[_0xed0f('0x57')](config[_0xed0f('0x58')],_0xed0f('0x59')),'utf8');var _0x55c3ce=ejs[_0xed0f('0x5a')](_0x4a01c3,{'contexts':_0x3ddf4e});fs[_0xed0f('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x55c3ce);return respondWithRpcPromise(_0xed0f('0x5d'),_0xed0f('0x32'),{'module':_0xed0f('0x5e')});})[_0xed0f('0x52')](handleError(_0x533151,null));};
\ No newline at end of file
+var _0x8b9d=['join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','readFileSync','chan_sip.so','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body'];(function(_0x2e62be,_0x31c056){var _0x159d13=function(_0x418fb8){while(--_0x418fb8){_0x2e62be['push'](_0x2e62be['shift']());}};_0x159d13(++_0x31c056);}(_0x8b9d,0xf1));var _0xd8b9=function(_0x57ad25,_0x30f4b6){_0x57ad25=_0x57ad25-0x0;var _0x14a80c=_0x8b9d[_0x57ad25];return _0x14a80c;};'use strict';var emlformat=require(_0xd8b9('0x0'));var rimraf=require(_0xd8b9('0x1'));var zipdir=require(_0xd8b9('0x2'));var jsonpatch=require(_0xd8b9('0x3'));var rp=require(_0xd8b9('0x4'));var moment=require(_0xd8b9('0x5'));var BPromise=require(_0xd8b9('0x6'));var Mustache=require(_0xd8b9('0x7'));var util=require(_0xd8b9('0x8'));var path=require(_0xd8b9('0x9'));var sox=require(_0xd8b9('0xa'));var csv=require(_0xd8b9('0xb'));var ejs=require(_0xd8b9('0xc'));var fs=require('fs');var fs_extra=require(_0xd8b9('0xd'));var _=require(_0xd8b9('0xe'));var squel=require(_0xd8b9('0xf'));var crypto=require(_0xd8b9('0x10'));var jsforce=require(_0xd8b9('0x11'));var deskjs=require(_0xd8b9('0x12'));var toCsv=require(_0xd8b9('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8b9('0x13'));var authService=require(_0xd8b9('0x14'));var qs=require(_0xd8b9('0x15'));var as=require(_0xd8b9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8b9('0x17'))(_0xd8b9('0x18'));var utils=require('../../config/utils');var config=require(_0xd8b9('0x19'));var licenseUtil=require(_0xd8b9('0x1a'));var db=require(_0xd8b9('0x1b'))['db'];var jayson=require(_0xd8b9('0x1c'));var client=jayson[_0xd8b9('0x1d')][_0xd8b9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ea033,_0x538ca0,_0x13ce31,_0x7057b9){return new BPromise(function(_0x347b0f,_0x1ce01e){var _0x520cea=_0x7057b9||client;return _0x520cea[_0xd8b9('0x1f')](_0x5ea033,_0x13ce31)[_0xd8b9('0x20')](function(_0x239e62){logger[_0xd8b9('0x21')](_0xd8b9('0x22'),_0x538ca0,_0xd8b9('0x23'));logger[_0xd8b9('0x24')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x538ca0,_0xd8b9('0x23'),JSON[_0xd8b9('0x25')](_0x239e62));if(_0x239e62[_0xd8b9('0x26')]){if(_0x239e62[_0xd8b9('0x26')][_0xd8b9('0x27')]===0x1f4){logger['error'](_0xd8b9('0x22'),_0x538ca0,_0x239e62[_0xd8b9('0x26')]['message']);return _0x1ce01e(_0x239e62[_0xd8b9('0x26')][_0xd8b9('0x28')]);}logger[_0xd8b9('0x26')](_0xd8b9('0x22'),_0x538ca0,_0x239e62[_0xd8b9('0x26')][_0xd8b9('0x28')]);return _0x347b0f(_0x239e62[_0xd8b9('0x26')]['message']);}else{logger[_0xd8b9('0x21')](_0xd8b9('0x22'),_0x538ca0,_0xd8b9('0x23'));_0x347b0f(_0x239e62[_0xd8b9('0x29')]['message']);}})['catch'](function(_0x21af2a){logger[_0xd8b9('0x26')](_0xd8b9('0x22'),_0x538ca0,_0x21af2a);_0x1ce01e(_0x21af2a);});});}function respondWithStatusCode(_0x453218,_0x121aa1){_0x121aa1=_0x121aa1||0xcc;return function(_0x159ff2){if(_0x159ff2){return _0x453218[_0xd8b9('0x2a')](_0x121aa1);}return _0x453218['status'](_0x121aa1)[_0xd8b9('0x2b')]();};}function respondWithResult(_0x1182e3,_0x5bf913){_0x5bf913=_0x5bf913||0xc8;return function(_0x31c1f8){if(_0x31c1f8){return _0x1182e3[_0xd8b9('0x2c')](_0x5bf913)[_0xd8b9('0x2d')](_0x31c1f8);}};}function respondWithFilteredResult(_0x5acc73,_0x5dd1b6){return function(_0x807c0f){if(_0x807c0f){var _0x48f419=typeof _0x5dd1b6[_0xd8b9('0x2e')]===_0xd8b9('0x2f')&&typeof _0x5dd1b6[_0xd8b9('0x30')]===_0xd8b9('0x2f');var _0x28c499=_0x807c0f[_0xd8b9('0x31')];var _0x4172ad=_0x48f419?0x0:_0x5dd1b6[_0xd8b9('0x2e')];var _0x355259=_0x48f419?_0x807c0f['count']:_0x5dd1b6['offset']+_0x5dd1b6[_0xd8b9('0x30')];var _0x1a9ced;if(_0x355259>=_0x28c499){_0x355259=_0x28c499;_0x1a9ced=0xc8;}else{_0x1a9ced=0xce;}_0x5acc73['status'](_0x1a9ced);return _0x5acc73[_0xd8b9('0x32')](_0xd8b9('0x33'),_0x4172ad+'-'+_0x355259+'/'+_0x28c499)[_0xd8b9('0x2d')](_0x807c0f);}return null;};}function patchUpdates(_0x414ee8){return function(_0x5e6ada){try{jsonpatch[_0xd8b9('0x34')](_0x5e6ada,_0x414ee8,!![]);}catch(_0x456cde){return BPromise[_0xd8b9('0x35')](_0x456cde);}return _0x5e6ada[_0xd8b9('0x36')]();};}function saveUpdates(_0x93e6a0,_0x105c70){return function(_0xaadcf3){if(_0xaadcf3){return _0xaadcf3['update'](_0x93e6a0)[_0xd8b9('0x20')](function(_0x47621b){return _0x47621b;});}return null;};}function removeEntity(_0x2e91e5,_0xe28e4f){return function(_0x536cff){if(_0x536cff){return _0x536cff[_0xd8b9('0x37')]()[_0xd8b9('0x20')](function(){var _0x324569=_0x536cff[_0xd8b9('0x38')]({'plain':!![]});var _0x6de699=_0xd8b9('0x39');return db[_0xd8b9('0x3a')][_0xd8b9('0x37')]({'where':{'type':_0x6de699,'resourceId':_0x324569['id']}})[_0xd8b9('0x20')](function(){return _0x536cff;});})[_0xd8b9('0x20')](function(){_0x2e91e5[_0xd8b9('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dcd71,_0x28c494){return function(_0x4d74c9){if(!_0x4d74c9){_0x3dcd71[_0xd8b9('0x2a')](0x194);}return _0x4d74c9;};}function handleError(_0x1609fe,_0xf9ff9c){_0xf9ff9c=_0xf9ff9c||0x1f4;return function(_0x30f128){logger[_0xd8b9('0x26')](_0x30f128[_0xd8b9('0x3b')]);if(_0x30f128[_0xd8b9('0x3c')]){delete _0x30f128[_0xd8b9('0x3c')];}_0x1609fe[_0xd8b9('0x2c')](_0xf9ff9c)[_0xd8b9('0x3d')](_0x30f128);};}exports[_0xd8b9('0x3e')]=function(_0x2619d0,_0x4b0abe){var _0x34b51e={},_0x2a6df4={},_0x448f33={'count':0x0,'rows':[]};var _0x263949=_[_0xd8b9('0x3f')](db[_0xd8b9('0x40')]['rawAttributes'],function(_0x10beaa){return{'name':_0x10beaa[_0xd8b9('0x41')],'type':_0x10beaa[_0xd8b9('0x42')][_0xd8b9('0x43')]};});_0x2a6df4[_0xd8b9('0x44')]=_['map'](_0x263949,_0xd8b9('0x3c'));_0x2a6df4[_0xd8b9('0x45')]=_[_0xd8b9('0x46')](_0x2619d0['query']);_0x2a6df4[_0xd8b9('0x47')]=_[_0xd8b9('0x48')](_0x2a6df4[_0xd8b9('0x44')],_0x2a6df4[_0xd8b9('0x45')]);_0x34b51e['attributes']=_[_0xd8b9('0x48')](_0x2a6df4[_0xd8b9('0x44')],qs[_0xd8b9('0x49')](_0x2619d0[_0xd8b9('0x45')][_0xd8b9('0x49')]));_0x34b51e[_0xd8b9('0x4a')]=_0x34b51e['attributes'][_0xd8b9('0x4b')]?_0x34b51e[_0xd8b9('0x4a')]:_0x2a6df4[_0xd8b9('0x44')];if(!_0x2619d0[_0xd8b9('0x45')]['hasOwnProperty'](_0xd8b9('0x4c'))){_0x34b51e['limit']=qs['limit'](_0x2619d0[_0xd8b9('0x45')]['limit']);_0x34b51e[_0xd8b9('0x2e')]=qs[_0xd8b9('0x2e')](_0x2619d0[_0xd8b9('0x45')][_0xd8b9('0x2e')]);}_0x34b51e[_0xd8b9('0x4d')]=qs[_0xd8b9('0x4e')](_0x2619d0[_0xd8b9('0x45')][_0xd8b9('0x4e')]);_0x34b51e[_0xd8b9('0x4f')]=qs['filters'](_[_0xd8b9('0x50')](_0x2619d0['query'],_0x2a6df4[_0xd8b9('0x47')]),_0x263949);if(_0x2619d0[_0xd8b9('0x45')]['filter']){_0x34b51e[_0xd8b9('0x4f')]=_['merge'](_0x34b51e['where'],{'$or':_[_0xd8b9('0x3f')](_0x263949,function(_0x4f641a){if(_0x4f641a[_0xd8b9('0x42')]!==_0xd8b9('0x51')){var _0x527b2d={};_0x527b2d[_0x4f641a[_0xd8b9('0x3c')]]={'$like':'%'+_0x2619d0['query'][_0xd8b9('0x52')]+'%'};return _0x527b2d;}})});}_0x34b51e=_[_0xd8b9('0x53')]({},_0x34b51e,_0x2619d0[_0xd8b9('0x54')]);var _0x4fb7c1={'where':_0x34b51e[_0xd8b9('0x4f')]};return db[_0xd8b9('0x40')][_0xd8b9('0x31')](_0x4fb7c1)[_0xd8b9('0x20')](function(_0x4d6f9c){_0x448f33[_0xd8b9('0x31')]=_0x4d6f9c;if(_0x2619d0['query'][_0xd8b9('0x55')]){_0x34b51e['include']=[{'all':!![]}];}return db[_0xd8b9('0x40')][_0xd8b9('0x56')](_0x34b51e);})['then'](function(_0x41b8dd){_0x448f33[_0xd8b9('0x57')]=_0x41b8dd;return _0x448f33;})['then'](respondWithFilteredResult(_0x4b0abe,_0x34b51e))['catch'](handleError(_0x4b0abe,null));};exports[_0xd8b9('0x58')]=function(_0x336f04,_0x4da524){var _0x5e5660={'raw':![],'where':{'id':_0x336f04['params']['id']}},_0x4a6e85={};_0x4a6e85[_0xd8b9('0x44')]=_[_0xd8b9('0x46')](db[_0xd8b9('0x40')][_0xd8b9('0x59')]);_0x4a6e85[_0xd8b9('0x45')]=_[_0xd8b9('0x46')](_0x336f04[_0xd8b9('0x45')]);_0x4a6e85[_0xd8b9('0x47')]=_[_0xd8b9('0x48')](_0x4a6e85[_0xd8b9('0x44')],_0x4a6e85[_0xd8b9('0x45')]);_0x5e5660[_0xd8b9('0x4a')]=_['intersection'](_0x4a6e85['model'],qs['fields'](_0x336f04[_0xd8b9('0x45')][_0xd8b9('0x49')]));_0x5e5660[_0xd8b9('0x4a')]=_0x5e5660[_0xd8b9('0x4a')][_0xd8b9('0x4b')]?_0x5e5660['attributes']:_0x4a6e85[_0xd8b9('0x44')];if(_0x336f04[_0xd8b9('0x45')][_0xd8b9('0x55')]){_0x5e5660[_0xd8b9('0x5a')]=[{'all':!![]}];}_0x5e5660=_[_0xd8b9('0x53')]({},_0x5e5660,_0x336f04[_0xd8b9('0x54')]);return db['VoiceContext'][_0xd8b9('0x5b')](_0x5e5660)['then'](handleEntityNotFound(_0x4da524,null))[_0xd8b9('0x20')](respondWithResult(_0x4da524,null))[_0xd8b9('0x5c')](handleError(_0x4da524,null));};exports[_0xd8b9('0x5d')]=function(_0x2e712c,_0x254770,_0x30716e){var _0x5c647e;return db[_0xd8b9('0x40')][_0xd8b9('0x5d')](_0x2e712c[_0xd8b9('0x5e')],{'raw':!![]})[_0xd8b9('0x20')](function(_0x41f7b6){_0x5c647e=_0x41f7b6;return db['VoiceContext'][_0xd8b9('0x56')]({'raw':!![]});})[_0xd8b9('0x20')](function(_0x2cae8e){var _0x21db3f=fs['readFileSync'](path[_0xd8b9('0x5f')](config['root'],_0xd8b9('0x60')),_0xd8b9('0x61'));var _0x4ac4cb=ejs[_0xd8b9('0x62')](_0x21db3f,{'contexts':_0x2cae8e||[]});fs[_0xd8b9('0x63')](_0xd8b9('0x64'),_0x4ac4cb);})['then'](function(){return respondWithRpcPromise(_0xd8b9('0x65'),_0xd8b9('0x5d'),{'module':'chan_sip.so'});})['then'](function(){var _0x46955d=_0x2e712c[_0xd8b9('0x66')][_0xd8b9('0x38')]({'plain':!![]});if(!_0x46955d)throw new Error(_0xd8b9('0x67'));if(_0x46955d['role']===_0xd8b9('0x66')){var _0x3f7781=_0x5c647e[_0xd8b9('0x38')]({'plain':!![]});return db['UserProfileSection'][_0xd8b9('0x5b')]({'where':{'name':_0xd8b9('0x39'),'userProfileId':_0x46955d[_0xd8b9('0x68')]},'raw':!![]})[_0xd8b9('0x20')](function(_0x2670e0){if(_0x2670e0&&_0x2670e0[_0xd8b9('0x69')]===0x0){return db[_0xd8b9('0x3a')][_0xd8b9('0x5d')]({'name':_0x3f7781['name'],'resourceId':_0x3f7781['id'],'type':_0x2670e0[_0xd8b9('0x3c')],'sectionId':_0x2670e0['id']},{})[_0xd8b9('0x20')](function(){return _0x5c647e;});}else{return _0x5c647e;}})[_0xd8b9('0x5c')](function(_0x29981c){logger[_0xd8b9('0x26')](_0xd8b9('0x6a'),_0x29981c);throw _0x29981c;});}return _0x5c647e;})['then'](respondWithResult(_0x254770,0xc9))['catch'](handleError(_0x254770,null));};exports[_0xd8b9('0x6b')]=function(_0x34f7af,_0x26c688,_0x7a158f){var _0x383e20;return db['VoiceContext']['find']({'where':{'id':_0x34f7af[_0xd8b9('0x6c')]['id']}})[_0xd8b9('0x20')](handleEntityNotFound(_0x26c688,null))[_0xd8b9('0x20')](saveUpdates(_0x34f7af['body'],null))[_0xd8b9('0x20')](function(_0xfdbb2a){if(_0xfdbb2a){_0x383e20=_0xfdbb2a;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xd8b9('0x20')](function(_0x449c75){var _0x489fcb=fs[_0xd8b9('0x6d')](path[_0xd8b9('0x5f')](config['root'],_0xd8b9('0x60')),_0xd8b9('0x61'));var _0xfbc862=ejs[_0xd8b9('0x62')](_0x489fcb,{'contexts':_0x449c75||[]});fs[_0xd8b9('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xfbc862);})[_0xd8b9('0x20')](function(){return respondWithRpcPromise(_0xd8b9('0x65'),'update',{'module':_0xd8b9('0x6e')});})[_0xd8b9('0x20')](function(){return _0x383e20;})['then'](respondWithResult(_0x26c688,null))['catch'](handleError(_0x26c688,null));};exports['destroy']=function(_0x2e8485,_0xf50d60,_0x4e1311){var _0x23239c;return db['VoiceContext'][_0xd8b9('0x5b')]({'where':{'id':_0x2e8485[_0xd8b9('0x6c')]['id']}})[_0xd8b9('0x20')](handleEntityNotFound(_0xf50d60,null))[_0xd8b9('0x20')](removeEntity(_0xf50d60,null))[_0xd8b9('0x20')](function(){return db[_0xd8b9('0x40')][_0xd8b9('0x56')]({'raw':!![]});})[_0xd8b9('0x20')](function(_0x145c7d){var _0x50aaab=fs[_0xd8b9('0x6d')](path['join'](config[_0xd8b9('0x6f')],_0xd8b9('0x60')),_0xd8b9('0x61'));var _0x2731ff=ejs[_0xd8b9('0x62')](_0x50aaab,{'contexts':_0x145c7d});fs[_0xd8b9('0x63')](_0xd8b9('0x64'),_0x2731ff);return respondWithRpcPromise(_0xd8b9('0x65'),_0xd8b9('0x37'),{'module':'chan_sip.so'});})['catch'](handleError(_0xf50d60,null));};
\ No newline at end of file
index 1813d1f..4f7d4b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x513e=['./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c8c4d,_0x170fc3){var _0x7c72d2=function(_0x249fd1){while(--_0x249fd1){_0x4c8c4d['push'](_0x4c8c4d['shift']());}};_0x7c72d2(++_0x170fc3);}(_0x513e,0x138));var _0xe513=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x513e[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xe513('0x0'));var util=require(_0xe513('0x1'));var logger=require(_0xe513('0x2'))(_0xe513('0x3'));var moment=require(_0xe513('0x4'));var BPromise=require(_0xe513('0x5'));var rp=require(_0xe513('0x6'));var fs=require('fs');var path=require(_0xe513('0x7'));var rimraf=require(_0xe513('0x8'));var config=require(_0xe513('0x9'));var attributes=require(_0xe513('0xa'));module['exports']=function(_0x2babd8,_0x4cf910){return _0x2babd8[_0xe513('0xb')](_0xe513('0xc'),attributes,{'tableName':_0xe513('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a97=['request-promise','path','../../config/environment','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x247b0b,_0x3df01f){var _0x44dfde=function(_0x27bf40){while(--_0x27bf40){_0x247b0b['push'](_0x247b0b['shift']());}};_0x44dfde(++_0x3df01f);}(_0x0a97,0x1a7));var _0x70a9=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x0a97[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0x70a9('0x0'));var util=require(_0x70a9('0x1'));var logger=require(_0x70a9('0x2'))(_0x70a9('0x3'));var moment=require(_0x70a9('0x4'));var BPromise=require(_0x70a9('0x5'));var rp=require(_0x70a9('0x6'));var fs=require('fs');var path=require(_0x70a9('0x7'));var rimraf=require('rimraf');var config=require(_0x70a9('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x5b0a85,_0x425416){return _0x5b0a85[_0x70a9('0x9')]('VoiceContext',attributes,{'tableName':_0x70a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c31c950..e63404d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc9b=['info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xcc9b,0x12e));var _0xbcc9=function(_0x3a65ac,_0x49b5c4){_0x3a65ac=_0x3a65ac-0x0;var _0x45d35a=_0xcc9b[_0x3a65ac];return _0x45d35a;};'use strict';var _=require('lodash');var util=require(_0xbcc9('0x0'));var moment=require('moment');var BPromise=require(_0xbcc9('0x1'));var rs=require(_0xbcc9('0x2'));var fs=require('fs');var Redis=require(_0xbcc9('0x3'));var db=require(_0xbcc9('0x4'))['db'];var utils=require(_0xbcc9('0x5'));var logger=require(_0xbcc9('0x6'))(_0xbcc9('0x7'));var config=require(_0xbcc9('0x8'));var jayson=require(_0xbcc9('0x9'));var client=jayson[_0xbcc9('0xa')][_0xbcc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2990a8,_0x30c12e,_0x36a15c){return new BPromise(function(_0x1b38ae,_0x20a235){return client[_0xbcc9('0xc')](_0x2990a8,_0x36a15c)[_0xbcc9('0xd')](function(_0x939ab3){logger['info'](_0xbcc9('0xe'),_0x30c12e,_0xbcc9('0xf'));logger[_0xbcc9('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x30c12e,_0xbcc9('0xf'),JSON[_0xbcc9('0x11')](_0x939ab3));if(_0x939ab3[_0xbcc9('0x12')]){if(_0x939ab3[_0xbcc9('0x12')]['code']===0x1f4){logger[_0xbcc9('0x12')](_0xbcc9('0xe'),_0x30c12e,_0x939ab3[_0xbcc9('0x12')][_0xbcc9('0x13')]);return _0x20a235(_0x939ab3[_0xbcc9('0x12')][_0xbcc9('0x13')]);}logger[_0xbcc9('0x12')](_0xbcc9('0xe'),_0x30c12e,_0x939ab3[_0xbcc9('0x12')]['message']);return _0x1b38ae(_0x939ab3[_0xbcc9('0x12')][_0xbcc9('0x13')]);}else{logger[_0xbcc9('0x14')](_0xbcc9('0xe'),_0x30c12e,_0xbcc9('0xf'));_0x1b38ae(_0x939ab3[_0xbcc9('0x15')][_0xbcc9('0x13')]);}})[_0xbcc9('0x16')](function(_0x46dd12){logger[_0xbcc9('0x12')](_0xbcc9('0xe'),_0x30c12e,_0x46dd12);_0x20a235(_0x46dd12);});});}
\ No newline at end of file
+var _0x5525=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x52fe2d,_0x227427){var _0xbe709a=function(_0x4f4100){while(--_0x4f4100){_0x52fe2d['push'](_0x52fe2d['shift']());}};_0xbe709a(++_0x227427);}(_0x5525,0xd1));var _0x5552=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5525[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var moment=require(_0x5552('0x2'));var BPromise=require(_0x5552('0x3'));var rs=require(_0x5552('0x4'));var fs=require('fs');var Redis=require(_0x5552('0x5'));var db=require(_0x5552('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5552('0x7'))(_0x5552('0x8'));var config=require('../../config/environment');var jayson=require(_0x5552('0x9'));var client=jayson[_0x5552('0xa')][_0x5552('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ce9f6,_0xb28442,_0x203b88){return new BPromise(function(_0x164626,_0x25a789){return client['request'](_0x1ce9f6,_0x203b88)[_0x5552('0xc')](function(_0x568e10){logger[_0x5552('0xd')]('VoiceContext,\x20%s,\x20%s',_0xb28442,_0x5552('0xe'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0xb28442,_0x5552('0xe'),JSON['stringify'](_0x568e10));if(_0x568e10[_0x5552('0xf')]){if(_0x568e10[_0x5552('0xf')][_0x5552('0x10')]===0x1f4){logger[_0x5552('0xf')](_0x5552('0x11'),_0xb28442,_0x568e10['error'][_0x5552('0x12')]);return _0x25a789(_0x568e10['error']['message']);}logger[_0x5552('0xf')](_0x5552('0x11'),_0xb28442,_0x568e10['error']['message']);return _0x164626(_0x568e10[_0x5552('0xf')][_0x5552('0x12')]);}else{logger[_0x5552('0xd')](_0x5552('0x11'),_0xb28442,_0x5552('0xe'));_0x164626(_0x568e10[_0x5552('0x13')][_0x5552('0x12')]);}})[_0x5552('0x14')](function(_0x1fabec){logger['error'](_0x5552('0x11'),_0xb28442,_0x1fabec);_0x25a789(_0x1fabec);});});}
\ No newline at end of file
index fd2a668..c6506aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a6=['describe','post','create','put','/:id','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x385827,_0x40792a){var _0x2650a9=function(_0x72280e){while(--_0x72280e){_0x385827['push'](_0x385827['shift']());}};_0x2650a9(++_0x40792a);}(_0xd3a6,0x181));var _0x6d3a=function(_0x3b3783,_0x19a40){_0x3b3783=_0x3b3783-0x0;var _0x1d43e5=_0xd3a6[_0x3b3783];return _0x1d43e5;};'use strict';var multer=require(_0x6d3a('0x0'));var util=require('util');var path=require(_0x6d3a('0x1'));var timeout=require(_0x6d3a('0x2'));var express=require(_0x6d3a('0x3'));var router=express[_0x6d3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d3a('0x5'));var interaction=require(_0x6d3a('0x6'));var config=require(_0x6d3a('0x7'));var controller=require('./voiceDialReport.controller');router[_0x6d3a('0x8')]('/',auth[_0x6d3a('0x9')](),controller['index']);router[_0x6d3a('0x8')](_0x6d3a('0xa'),auth[_0x6d3a('0x9')](),controller[_0x6d3a('0xb')]);router[_0x6d3a('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6d3a('0xc')]('/',auth[_0x6d3a('0x9')](),controller[_0x6d3a('0xd')]);router[_0x6d3a('0xe')](_0x6d3a('0xf'),auth[_0x6d3a('0x9')](),controller['update']);router[_0x6d3a('0x10')]('/:id',auth[_0x6d3a('0x9')](),controller['destroy']);module[_0x6d3a('0x11')]=router;
\ No newline at end of file
+var _0x1a72=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id','create','put'];(function(_0x545ba9,_0xc04a8f){var _0x3931b7=function(_0x2df5c0){while(--_0x2df5c0){_0x545ba9['push'](_0x545ba9['shift']());}};_0x3931b7(++_0xc04a8f);}(_0x1a72,0xad));var _0x21a7=function(_0x27c0bd,_0x3b29d2){_0x27c0bd=_0x27c0bd-0x0;var _0x2a80ef=_0x1a72[_0x27c0bd];return _0x2a80ef;};'use strict';var multer=require(_0x21a7('0x0'));var util=require(_0x21a7('0x1'));var path=require('path');var timeout=require(_0x21a7('0x2'));var express=require(_0x21a7('0x3'));var router=express['Router']();var fs_extra=require(_0x21a7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x21a7('0x5'));var config=require('../../config/environment');var controller=require(_0x21a7('0x6'));router['get']('/',auth[_0x21a7('0x7')](),controller[_0x21a7('0x8')]);router[_0x21a7('0x9')](_0x21a7('0xa'),auth[_0x21a7('0x7')](),controller['describe']);router['get'](_0x21a7('0xb'),auth[_0x21a7('0x7')](),controller['show']);router['post']('/',auth[_0x21a7('0x7')](),controller[_0x21a7('0xc')]);router[_0x21a7('0xd')](_0x21a7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x21a7('0xe')]('/:id',auth[_0x21a7('0x7')](),controller[_0x21a7('0xf')]);module[_0x21a7('0x10')]=router;
\ No newline at end of file
index 242ebbe..21f622b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x54ef,0x112));var _0xf54e=function(_0x4a2805,_0x5113b6){_0x4a2805=_0x4a2805-0x0;var _0x494875=_0x54ef[_0x4a2805];return _0x494875;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'privilege':{'type':Sequelize[_0xf54e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf54e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'calleridnum':{'type':Sequelize[_0xf54e('0x2')]},'calleridname':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'language':{'type':Sequelize[_0xf54e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf54e('0x2')]},'priority':{'type':Sequelize[_0xf54e('0x3')]},'uniqueid':{'type':Sequelize[_0xf54e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf54e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'destlanguage':{'type':Sequelize[_0xf54e('0x2')]},'destaccountcode':{'type':Sequelize[_0xf54e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf54e('0x2')]},'destpriority':{'type':Sequelize[_0xf54e('0x3')]},'destuniqueid':{'type':Sequelize[_0xf54e('0x2')]},'destlinkedid':{'type':Sequelize[_0xf54e('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xf54e('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf54e('0x4')]},'lastevent':{'type':Sequelize[_0xf54e('0x2')],'comment':_0xf54e('0x5')},'routeId':{'type':Sequelize[_0xf54e('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf54e('0x3')]},'billableseconds':{'type':Sequelize[_0xf54e('0x3')]}};
\ No newline at end of file
+var _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0xe14d,0x1ee));var _0xde14=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe14d[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 6327458..30a7f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa11e=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','name','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa11e,0xe5));var _0xea11=function(_0x1d13d4,_0x504ee5){_0x1d13d4=_0x1d13d4-0x0;var _0x473275=_0xa11e[_0x1d13d4];return _0x473275;};'use strict';var emlformat=require(_0xea11('0x0'));var rimraf=require(_0xea11('0x1'));var zipdir=require(_0xea11('0x2'));var jsonpatch=require(_0xea11('0x3'));var rp=require(_0xea11('0x4'));var moment=require(_0xea11('0x5'));var BPromise=require(_0xea11('0x6'));var Mustache=require(_0xea11('0x7'));var util=require(_0xea11('0x8'));var path=require(_0xea11('0x9'));var sox=require(_0xea11('0xa'));var csv=require(_0xea11('0xb'));var ejs=require(_0xea11('0xc'));var fs=require('fs');var fs_extra=require(_0xea11('0xd'));var _=require(_0xea11('0xe'));var squel=require('squel');var crypto=require(_0xea11('0xf'));var jsforce=require(_0xea11('0x10'));var deskjs=require(_0xea11('0x11'));var toCsv=require(_0xea11('0xb'));var querystring=require(_0xea11('0x12'));var Papa=require('papaparse');var Redis=require(_0xea11('0x13'));var authService=require(_0xea11('0x14'));var qs=require(_0xea11('0x15'));var as=require(_0xea11('0x16'));var hardwareService=require(_0xea11('0x17'));var logger=require(_0xea11('0x18'))(_0xea11('0x19'));var utils=require(_0xea11('0x1a'));var config=require(_0xea11('0x1b'));var licenseUtil=require(_0xea11('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bca8e,_0x4f6abb){_0x4f6abb=_0x4f6abb||0xcc;return function(_0x33066e){if(_0x33066e){return _0x1bca8e[_0xea11('0x1d')](_0x4f6abb);}return _0x1bca8e[_0xea11('0x1e')](_0x4f6abb)[_0xea11('0x1f')]();};}function respondWithResult(_0x4085da,_0x58f1e2){_0x58f1e2=_0x58f1e2||0xc8;return function(_0x41cd67){if(_0x41cd67){return _0x4085da[_0xea11('0x1e')](_0x58f1e2)[_0xea11('0x20')](_0x41cd67);}};}function respondWithFilteredResult(_0x41999f,_0x3513d9){return function(_0x39f159){if(_0x39f159){var _0x1add4b=typeof _0x3513d9[_0xea11('0x21')]===_0xea11('0x22')&&typeof _0x3513d9['limit']==='undefined';var _0x3534a5=_0x39f159[_0xea11('0x23')];var _0x3490dd=_0x1add4b?0x0:_0x3513d9[_0xea11('0x21')];var _0x58211f=_0x1add4b?_0x39f159[_0xea11('0x23')]:_0x3513d9['offset']+_0x3513d9[_0xea11('0x24')];var _0xa5929f;if(_0x58211f>=_0x3534a5){_0x58211f=_0x3534a5;_0xa5929f=0xc8;}else{_0xa5929f=0xce;}_0x41999f[_0xea11('0x1e')](_0xa5929f);return _0x41999f[_0xea11('0x25')](_0xea11('0x26'),_0x3490dd+'-'+_0x58211f+'/'+_0x3534a5)['json'](_0x39f159);}return null;};}function patchUpdates(_0x40d0ca){return function(_0x1b407e){try{jsonpatch[_0xea11('0x27')](_0x1b407e,_0x40d0ca,!![]);}catch(_0x3f339f){return BPromise[_0xea11('0x28')](_0x3f339f);}return _0x1b407e[_0xea11('0x29')]();};}function saveUpdates(_0x31c16e,_0x58043d){return function(_0x471a44){if(_0x471a44){return _0x471a44[_0xea11('0x2a')](_0x31c16e)['then'](function(_0xd3e12b){return _0xd3e12b;});}return null;};}function removeEntity(_0x2b4b7b,_0x1b74a1){return function(_0x593d13){if(_0x593d13){return _0x593d13[_0xea11('0x2b')]()['then'](function(){_0x2b4b7b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b828,_0x9ba50e){return function(_0x48f50a){if(!_0x48f50a){_0x57b828[_0xea11('0x1d')](0x194);}return _0x48f50a;};}function handleError(_0x1ed7ff,_0x325fb4){_0x325fb4=_0x325fb4||0x1f4;return function(_0xf47c3a){logger[_0xea11('0x2c')](_0xf47c3a[_0xea11('0x2d')]);if(_0xf47c3a['name']){delete _0xf47c3a['name'];}_0x1ed7ff[_0xea11('0x1e')](_0x325fb4)[_0xea11('0x2e')](_0xf47c3a);};}exports['index']=function(_0x3e31b9,_0x17d844){var _0x572772={},_0x1da537={},_0x40462b={'count':0x0,'rows':[]};var _0x22c6f5=_[_0xea11('0x2f')](db[_0xea11('0x30')][_0xea11('0x31')],function(_0x4a08a0){return{'name':_0x4a08a0[_0xea11('0x32')],'type':_0x4a08a0[_0xea11('0x33')][_0xea11('0x34')]};});_0x1da537[_0xea11('0x35')]=_[_0xea11('0x2f')](_0x22c6f5,'name');_0x1da537[_0xea11('0x36')]=_[_0xea11('0x37')](_0x3e31b9[_0xea11('0x36')]);_0x1da537[_0xea11('0x38')]=_[_0xea11('0x39')](_0x1da537[_0xea11('0x35')],_0x1da537[_0xea11('0x36')]);_0x572772[_0xea11('0x3a')]=_['intersection'](_0x1da537[_0xea11('0x35')],qs[_0xea11('0x3b')](_0x3e31b9[_0xea11('0x36')]['fields']));_0x572772['attributes']=_0x572772[_0xea11('0x3a')][_0xea11('0x3c')]?_0x572772[_0xea11('0x3a')]:_0x1da537[_0xea11('0x35')];if(!_0x3e31b9[_0xea11('0x36')][_0xea11('0x3d')](_0xea11('0x3e'))){_0x572772[_0xea11('0x24')]=qs['limit'](_0x3e31b9['query'][_0xea11('0x24')]);_0x572772['offset']=qs[_0xea11('0x21')](_0x3e31b9['query'][_0xea11('0x21')]);}_0x572772[_0xea11('0x3f')]=qs['sort'](_0x3e31b9[_0xea11('0x36')][_0xea11('0x40')]);_0x572772['where']=qs['filters'](_[_0xea11('0x41')](_0x3e31b9['query'],_0x1da537['filters']),_0x22c6f5);if(_0x3e31b9[_0xea11('0x36')][_0xea11('0x42')]){_0x572772['where']=_[_0xea11('0x43')](_0x572772[_0xea11('0x44')],{'$or':_[_0xea11('0x2f')](_0x22c6f5,function(_0x152dd8){if(_0x152dd8[_0xea11('0x33')]!==_0xea11('0x45')){var _0x2e61ad={};_0x2e61ad[_0x152dd8[_0xea11('0x46')]]={'$like':'%'+_0x3e31b9['query'][_0xea11('0x42')]+'%'};return _0x2e61ad;}})});}_0x572772=_[_0xea11('0x43')]({},_0x572772,_0x3e31b9['options']);var _0x3a5ab6={'where':_0x572772[_0xea11('0x44')]};return db[_0xea11('0x30')][_0xea11('0x23')](_0x3a5ab6)[_0xea11('0x47')](function(_0x2a0aaa){_0x40462b[_0xea11('0x23')]=_0x2a0aaa;if(_0x3e31b9['query'][_0xea11('0x48')]){_0x572772[_0xea11('0x49')]=[{'all':!![]}];}return db[_0xea11('0x30')][_0xea11('0x4a')](_0x572772);})[_0xea11('0x47')](function(_0x36f74e){_0x40462b[_0xea11('0x4b')]=_0x36f74e;return _0x40462b;})['then'](respondWithFilteredResult(_0x17d844,_0x572772))[_0xea11('0x4c')](handleError(_0x17d844,null));};exports[_0xea11('0x4d')]=function(_0x1e0cb0,_0x1e8fbf){var _0x1944bd={'raw':!![],'where':{'id':_0x1e0cb0[_0xea11('0x4e')]['id']}},_0x17b37a={};_0x17b37a['model']=_[_0xea11('0x37')](db[_0xea11('0x30')]['rawAttributes']);_0x17b37a[_0xea11('0x36')]=_['keys'](_0x1e0cb0[_0xea11('0x36')]);_0x17b37a[_0xea11('0x38')]=_[_0xea11('0x39')](_0x17b37a[_0xea11('0x35')],_0x17b37a[_0xea11('0x36')]);_0x1944bd[_0xea11('0x3a')]=_['intersection'](_0x17b37a[_0xea11('0x35')],qs[_0xea11('0x3b')](_0x1e0cb0['query'][_0xea11('0x3b')]));_0x1944bd['attributes']=_0x1944bd[_0xea11('0x3a')][_0xea11('0x3c')]?_0x1944bd['attributes']:_0x17b37a[_0xea11('0x35')];if(_0x1e0cb0[_0xea11('0x36')][_0xea11('0x48')]){_0x1944bd[_0xea11('0x49')]=[{'all':!![]}];}_0x1944bd=_[_0xea11('0x43')]({},_0x1944bd,_0x1e0cb0[_0xea11('0x4f')]);return db[_0xea11('0x30')][_0xea11('0x50')](_0x1944bd)[_0xea11('0x47')](handleEntityNotFound(_0x1e8fbf,null))[_0xea11('0x47')](respondWithResult(_0x1e8fbf,null))['catch'](handleError(_0x1e8fbf,null));};exports['create']=function(_0x3bda8f,_0x27ec7a){return db[_0xea11('0x30')][_0xea11('0x51')](_0x3bda8f[_0xea11('0x52')],{})[_0xea11('0x47')](respondWithResult(_0x27ec7a,0xc9))[_0xea11('0x4c')](handleError(_0x27ec7a,null));};exports[_0xea11('0x2a')]=function(_0x545f23,_0x11e904){if(_0x545f23[_0xea11('0x52')]['id']){delete _0x545f23[_0xea11('0x52')]['id'];}return db[_0xea11('0x30')][_0xea11('0x50')]({'where':{'id':_0x545f23['params']['id']}})[_0xea11('0x47')](handleEntityNotFound(_0x11e904,null))[_0xea11('0x47')](saveUpdates(_0x545f23[_0xea11('0x52')],null))[_0xea11('0x47')](respondWithResult(_0x11e904,null))['catch'](handleError(_0x11e904,null));};exports[_0xea11('0x2b')]=function(_0x513deb,_0x374f20){return db[_0xea11('0x30')][_0xea11('0x50')]({'where':{'id':_0x513deb['params']['id']}})['then'](handleEntityNotFound(_0x374f20,null))['then'](removeEntity(_0x374f20,null))[_0xea11('0x4c')](handleError(_0x374f20,null));};exports[_0xea11('0x53')]=function(_0x45054c,_0x3160dc){return db[_0xea11('0x30')]['describe']()[_0xea11('0x47')](respondWithResult(_0x3160dc,null))[_0xea11('0x4c')](handleError(_0x3160dc,null));};
\ No newline at end of file
+var _0x3f3c=['stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','query','filters','intersection','fields','attributes','length','model','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','keys','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy'];(function(_0x2ed9f5,_0x38c10e){var _0x2d3231=function(_0x4f17d4){while(--_0x4f17d4){_0x2ed9f5['push'](_0x2ed9f5['shift']());}};_0x2d3231(++_0x38c10e);}(_0x3f3c,0x67));var _0xc3f3=function(_0x2b7f29,_0x156ef8){_0x2b7f29=_0x2b7f29-0x0;var _0x474047=_0x3f3c[_0x2b7f29];return _0x474047;};'use strict';var emlformat=require(_0xc3f3('0x0'));var rimraf=require(_0xc3f3('0x1'));var zipdir=require(_0xc3f3('0x2'));var jsonpatch=require(_0xc3f3('0x3'));var rp=require(_0xc3f3('0x4'));var moment=require(_0xc3f3('0x5'));var BPromise=require(_0xc3f3('0x6'));var Mustache=require(_0xc3f3('0x7'));var util=require('util');var path=require(_0xc3f3('0x8'));var sox=require('sox');var csv=require(_0xc3f3('0x9'));var ejs=require(_0xc3f3('0xa'));var fs=require('fs');var fs_extra=require(_0xc3f3('0xb'));var _=require('lodash');var squel=require(_0xc3f3('0xc'));var crypto=require('crypto');var jsforce=require(_0xc3f3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc3f3('0x9'));var querystring=require(_0xc3f3('0xe'));var Papa=require('papaparse');var Redis=require(_0xc3f3('0xf'));var authService=require(_0xc3f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc3f3('0x11'));var hardwareService=require(_0xc3f3('0x12'));var logger=require('../../config/logger')(_0xc3f3('0x13'));var utils=require(_0xc3f3('0x14'));var config=require(_0xc3f3('0x15'));var licenseUtil=require(_0xc3f3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4875d4,_0x27ea07){_0x27ea07=_0x27ea07||0xcc;return function(_0x3020c7){if(_0x3020c7){return _0x4875d4[_0xc3f3('0x17')](_0x27ea07);}return _0x4875d4[_0xc3f3('0x18')](_0x27ea07)[_0xc3f3('0x19')]();};}function respondWithResult(_0x5007fc,_0x16864a){_0x16864a=_0x16864a||0xc8;return function(_0x3d1013){if(_0x3d1013){return _0x5007fc[_0xc3f3('0x18')](_0x16864a)['json'](_0x3d1013);}};}function respondWithFilteredResult(_0x3cf853,_0x4b1de3){return function(_0x12c340){if(_0x12c340){var _0x2b2bd4=typeof _0x4b1de3[_0xc3f3('0x1a')]===_0xc3f3('0x1b')&&typeof _0x4b1de3[_0xc3f3('0x1c')]===_0xc3f3('0x1b');var _0x4c9fdb=_0x12c340[_0xc3f3('0x1d')];var _0x5d139f=_0x2b2bd4?0x0:_0x4b1de3[_0xc3f3('0x1a')];var _0x2448b3=_0x2b2bd4?_0x12c340[_0xc3f3('0x1d')]:_0x4b1de3[_0xc3f3('0x1a')]+_0x4b1de3[_0xc3f3('0x1c')];var _0x25809f;if(_0x2448b3>=_0x4c9fdb){_0x2448b3=_0x4c9fdb;_0x25809f=0xc8;}else{_0x25809f=0xce;}_0x3cf853[_0xc3f3('0x18')](_0x25809f);return _0x3cf853['set'](_0xc3f3('0x1e'),_0x5d139f+'-'+_0x2448b3+'/'+_0x4c9fdb)[_0xc3f3('0x1f')](_0x12c340);}return null;};}function patchUpdates(_0x4688aa){return function(_0x327f1f){try{jsonpatch[_0xc3f3('0x20')](_0x327f1f,_0x4688aa,!![]);}catch(_0x5ecce1){return BPromise[_0xc3f3('0x21')](_0x5ecce1);}return _0x327f1f['save']();};}function saveUpdates(_0x5a54c2,_0x2f1407){return function(_0x205b4b){if(_0x205b4b){return _0x205b4b[_0xc3f3('0x22')](_0x5a54c2)[_0xc3f3('0x23')](function(_0x38a42d){return _0x38a42d;});}return null;};}function removeEntity(_0x36427a,_0x1bf1c2){return function(_0x303acd){if(_0x303acd){return _0x303acd[_0xc3f3('0x24')]()[_0xc3f3('0x23')](function(){_0x36427a[_0xc3f3('0x18')](0xcc)[_0xc3f3('0x19')]();});}};}function handleEntityNotFound(_0x2f5423,_0x203d10){return function(_0x3c447a){if(!_0x3c447a){_0x2f5423[_0xc3f3('0x17')](0x194);}return _0x3c447a;};}function handleError(_0x13c116,_0x59c253){_0x59c253=_0x59c253||0x1f4;return function(_0xe0a4cf){logger['error'](_0xe0a4cf[_0xc3f3('0x25')]);if(_0xe0a4cf[_0xc3f3('0x26')]){delete _0xe0a4cf[_0xc3f3('0x26')];}_0x13c116[_0xc3f3('0x18')](_0x59c253)[_0xc3f3('0x27')](_0xe0a4cf);};}exports[_0xc3f3('0x28')]=function(_0x5b2f82,_0x806f0f){var _0x5dd63f={},_0x373a61={},_0x47f1d2={'count':0x0,'rows':[]};var _0x16e1df=_['map'](db[_0xc3f3('0x29')][_0xc3f3('0x2a')],function(_0x28a29f){return{'name':_0x28a29f[_0xc3f3('0x2b')],'type':_0x28a29f['type']['key']};});_0x373a61['model']=_['map'](_0x16e1df,_0xc3f3('0x26'));_0x373a61[_0xc3f3('0x2c')]=_['keys'](_0x5b2f82[_0xc3f3('0x2c')]);_0x373a61[_0xc3f3('0x2d')]=_[_0xc3f3('0x2e')](_0x373a61['model'],_0x373a61[_0xc3f3('0x2c')]);_0x5dd63f['attributes']=_['intersection'](_0x373a61['model'],qs['fields'](_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x2f')]));_0x5dd63f[_0xc3f3('0x30')]=_0x5dd63f[_0xc3f3('0x30')][_0xc3f3('0x31')]?_0x5dd63f[_0xc3f3('0x30')]:_0x373a61[_0xc3f3('0x32')];if(!_0x5b2f82[_0xc3f3('0x2c')]['hasOwnProperty'](_0xc3f3('0x33'))){_0x5dd63f[_0xc3f3('0x1c')]=qs[_0xc3f3('0x1c')](_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x1c')]);_0x5dd63f['offset']=qs[_0xc3f3('0x1a')](_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x1a')]);}_0x5dd63f[_0xc3f3('0x34')]=qs['sort'](_0x5b2f82['query'][_0xc3f3('0x35')]);_0x5dd63f[_0xc3f3('0x36')]=qs[_0xc3f3('0x2d')](_[_0xc3f3('0x37')](_0x5b2f82[_0xc3f3('0x2c')],_0x373a61[_0xc3f3('0x2d')]),_0x16e1df);if(_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x38')]){_0x5dd63f['where']=_[_0xc3f3('0x39')](_0x5dd63f[_0xc3f3('0x36')],{'$or':_['map'](_0x16e1df,function(_0x3660eb){if(_0x3660eb[_0xc3f3('0x3a')]!==_0xc3f3('0x3b')){var _0x286a8e={};_0x286a8e[_0x3660eb[_0xc3f3('0x26')]]={'$like':'%'+_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x38')]+'%'};return _0x286a8e;}})});}_0x5dd63f=_[_0xc3f3('0x39')]({},_0x5dd63f,_0x5b2f82['options']);var _0x1c28d1={'where':_0x5dd63f[_0xc3f3('0x36')]};return db['VoiceDialReport'][_0xc3f3('0x1d')](_0x1c28d1)[_0xc3f3('0x23')](function(_0x25d7c8){_0x47f1d2[_0xc3f3('0x1d')]=_0x25d7c8;if(_0x5b2f82[_0xc3f3('0x2c')][_0xc3f3('0x3c')]){_0x5dd63f[_0xc3f3('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xc3f3('0x3e')](_0x5dd63f);})[_0xc3f3('0x23')](function(_0x14ad7d){_0x47f1d2['rows']=_0x14ad7d;return _0x47f1d2;})[_0xc3f3('0x23')](respondWithFilteredResult(_0x806f0f,_0x5dd63f))['catch'](handleError(_0x806f0f,null));};exports[_0xc3f3('0x3f')]=function(_0x3ce250,_0x2a6c7a){var _0x24db72={'raw':!![],'where':{'id':_0x3ce250['params']['id']}},_0x32dfe6={};_0x32dfe6[_0xc3f3('0x32')]=_[_0xc3f3('0x40')](db[_0xc3f3('0x29')][_0xc3f3('0x2a')]);_0x32dfe6['query']=_[_0xc3f3('0x40')](_0x3ce250[_0xc3f3('0x2c')]);_0x32dfe6[_0xc3f3('0x2d')]=_[_0xc3f3('0x2e')](_0x32dfe6[_0xc3f3('0x32')],_0x32dfe6['query']);_0x24db72[_0xc3f3('0x30')]=_[_0xc3f3('0x2e')](_0x32dfe6[_0xc3f3('0x32')],qs[_0xc3f3('0x2f')](_0x3ce250[_0xc3f3('0x2c')]['fields']));_0x24db72['attributes']=_0x24db72['attributes'][_0xc3f3('0x31')]?_0x24db72[_0xc3f3('0x30')]:_0x32dfe6[_0xc3f3('0x32')];if(_0x3ce250[_0xc3f3('0x2c')][_0xc3f3('0x3c')]){_0x24db72[_0xc3f3('0x3d')]=[{'all':!![]}];}_0x24db72=_[_0xc3f3('0x39')]({},_0x24db72,_0x3ce250['options']);return db[_0xc3f3('0x29')][_0xc3f3('0x41')](_0x24db72)[_0xc3f3('0x23')](handleEntityNotFound(_0x2a6c7a,null))['then'](respondWithResult(_0x2a6c7a,null))[_0xc3f3('0x42')](handleError(_0x2a6c7a,null));};exports['create']=function(_0x4b4ba9,_0x2db7c9){return db[_0xc3f3('0x29')]['create'](_0x4b4ba9['body'],{})[_0xc3f3('0x23')](respondWithResult(_0x2db7c9,0xc9))[_0xc3f3('0x42')](handleError(_0x2db7c9,null));};exports[_0xc3f3('0x22')]=function(_0x29cd0c,_0x1cd8f7){if(_0x29cd0c['body']['id']){delete _0x29cd0c[_0xc3f3('0x43')]['id'];}return db['VoiceDialReport'][_0xc3f3('0x41')]({'where':{'id':_0x29cd0c[_0xc3f3('0x44')]['id']}})[_0xc3f3('0x23')](handleEntityNotFound(_0x1cd8f7,null))['then'](saveUpdates(_0x29cd0c[_0xc3f3('0x43')],null))[_0xc3f3('0x23')](respondWithResult(_0x1cd8f7,null))['catch'](handleError(_0x1cd8f7,null));};exports[_0xc3f3('0x24')]=function(_0x262043,_0x41560d){return db[_0xc3f3('0x29')]['find']({'where':{'id':_0x262043['params']['id']}})[_0xc3f3('0x23')](handleEntityNotFound(_0x41560d,null))[_0xc3f3('0x23')](removeEntity(_0x41560d,null))['catch'](handleError(_0x41560d,null));};exports[_0xc3f3('0x45')]=function(_0x11a2d1,_0x163dd3){return db[_0xc3f3('0x29')][_0xc3f3('0x45')]()[_0xc3f3('0x23')](respondWithResult(_0x163dd3,null))[_0xc3f3('0x42')](handleError(_0x163dd3,null));};
\ No newline at end of file
index aa2875b..36dcfed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb383=['define','VoiceDialReport','uniqueid','lodash','util','api','bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb383,0x87));var _0x3b38=function(_0x3171c9,_0x4fdb05){_0x3171c9=_0x3171c9-0x0;var _0x1b0a95=_0xb383[_0x3171c9];return _0x1b0a95;};'use strict';var _=require(_0x3b38('0x0'));var util=require(_0x3b38('0x1'));var logger=require('../../config/logger')(_0x3b38('0x2'));var moment=require('moment');var BPromise=require(_0x3b38('0x3'));var rp=require(_0x3b38('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b38('0x5'));var attributes=require(_0x3b38('0x6'));module[_0x3b38('0x7')]=function(_0x523df7,_0x5c4802){return _0x523df7[_0x3b38('0x8')](_0x3b38('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x3b38('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb16=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2ce2df,_0x466d52){var _0x17bd72=function(_0x7a6ef3){while(--_0x7a6ef3){_0x2ce2df['push'](_0x2ce2df['shift']());}};_0x17bd72(++_0x466d52);}(_0xfb16,0xd6));var _0x6fb1=function(_0xcb7109,_0x442e7d){_0xcb7109=_0xcb7109-0x0;var _0x153a8b=_0xfb16[_0xcb7109];return _0x153a8b;};'use strict';var _=require(_0x6fb1('0x0'));var util=require(_0x6fb1('0x1'));var logger=require(_0x6fb1('0x2'))('api');var moment=require(_0x6fb1('0x3'));var BPromise=require(_0x6fb1('0x4'));var rp=require(_0x6fb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6fb1('0x6'));var config=require(_0x6fb1('0x7'));var attributes=require(_0x6fb1('0x8'));module[_0x6fb1('0x9')]=function(_0x5b6222,_0x3eec1e){return _0x5b6222[_0x6fb1('0xa')](_0x6fb1('0xb'),attributes,{'tableName':_0x6fb1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6fb1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 58d617f..3c6aafe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa8=['error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','UpdateVoiceDialReport','update','body','where','limit','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x34cb65,_0x8aabe8){var _0x3daf52=function(_0x1016eb){while(--_0x1016eb){_0x34cb65['push'](_0x34cb65['shift']());}};_0x3daf52(++_0x8aabe8);}(_0xcaa8,0xd1));var _0x8caa=function(_0x2d2aa4,_0x4f0c97){_0x2d2aa4=_0x2d2aa4-0x0;var _0x1b54bd=_0xcaa8[_0x2d2aa4];return _0x1b54bd;};'use strict';var _=require('lodash');var util=require(_0x8caa('0x0'));var moment=require('moment');var BPromise=require(_0x8caa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8caa('0x2'));var db=require(_0x8caa('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8caa('0x4'));var config=require('../../config/environment');var jayson=require(_0x8caa('0x5'));var client=jayson[_0x8caa('0x6')][_0x8caa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ba97b,_0x2c1c68,_0x10928d){return new BPromise(function(_0x4f353c,_0x266ab4){return client[_0x8caa('0x8')](_0x3ba97b,_0x10928d)[_0x8caa('0x9')](function(_0x19c67a){logger[_0x8caa('0xa')](_0x8caa('0xb'),_0x2c1c68,'request\x20sent');logger[_0x8caa('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2c1c68,_0x8caa('0xd'),JSON[_0x8caa('0xe')](_0x19c67a));if(_0x19c67a[_0x8caa('0xf')]){if(_0x19c67a[_0x8caa('0xf')][_0x8caa('0x10')]===0x1f4){logger['error'](_0x8caa('0xb'),_0x2c1c68,_0x19c67a['error'][_0x8caa('0x11')]);return _0x266ab4(_0x19c67a[_0x8caa('0xf')][_0x8caa('0x11')]);}logger[_0x8caa('0xf')](_0x8caa('0xb'),_0x2c1c68,_0x19c67a[_0x8caa('0xf')][_0x8caa('0x11')]);return _0x4f353c(_0x19c67a['error'][_0x8caa('0x11')]);}else{logger[_0x8caa('0xa')](_0x8caa('0xb'),_0x2c1c68,_0x8caa('0xd'));_0x4f353c(_0x19c67a['result'][_0x8caa('0x11')]);}})[_0x8caa('0x12')](function(_0xcabb0){logger['error'](_0x8caa('0xb'),_0x2c1c68,_0xcabb0);_0x266ab4(_0xcabb0);});});}exports[_0x8caa('0x13')]=function(_0x2559e3){var _0x19366c=this;return new Promise(function(_0xc2a0dc,_0x4c58a8){return db[_0x8caa('0x14')]['create'](_0x2559e3['body'],{'raw':_0x2559e3['options']?_0x2559e3[_0x8caa('0x15')][_0x8caa('0x16')]===undefined?!![]:![]:!![]})[_0x8caa('0x9')](function(_0x475ac6){logger[_0x8caa('0xa')](_0x8caa('0x13'),_0x2559e3);logger[_0x8caa('0xc')](_0x8caa('0x13'),_0x2559e3,JSON['stringify'](_0x475ac6));_0xc2a0dc(_0x475ac6);})[_0x8caa('0x12')](function(_0x3db907){logger[_0x8caa('0xf')](_0x8caa('0x13'),_0x3db907['message'],_0x2559e3);_0x4c58a8(_0x19366c['error'](0x1f4,_0x3db907['message']));});});};exports[_0x8caa('0x17')]=function(_0x3e74af){var _0x50fa4a=this;return new Promise(function(_0x41a764,_0x36f689){return db['VoiceDialReport'][_0x8caa('0x18')](_0x3e74af[_0x8caa('0x19')],{'raw':_0x3e74af[_0x8caa('0x15')]?_0x3e74af[_0x8caa('0x15')][_0x8caa('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e74af[_0x8caa('0x15')]?_0x3e74af['options'][_0x8caa('0x1a')]||null:null,'attributes':_0x3e74af['options']?_0x3e74af[_0x8caa('0x15')]['attributes']||null:null,'limit':_0x3e74af[_0x8caa('0x15')]?_0x3e74af['options'][_0x8caa('0x1b')]||null:null})[_0x8caa('0x9')](function(_0x26625f){logger['info'](_0x8caa('0x17'),_0x3e74af);logger[_0x8caa('0xc')](_0x8caa('0x17'),_0x3e74af,JSON[_0x8caa('0xe')](_0x26625f));_0x41a764(_0x26625f);})[_0x8caa('0x12')](function(_0x3b66df){logger[_0x8caa('0xf')]('UpdateVoiceDialReport',_0x3b66df[_0x8caa('0x11')],_0x3e74af);_0x36f689(_0x50fa4a[_0x8caa('0xf')](0x1f4,_0x3b66df['message']));});});};
\ No newline at end of file
+var _0xc7bb=['body','options','raw','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','limit','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create'];(function(_0x304d1f,_0x41e22f){var _0x3e3583=function(_0x2a47e3){while(--_0x2a47e3){_0x304d1f['push'](_0x304d1f['shift']());}};_0x3e3583(++_0x41e22f);}(_0xc7bb,0x78));var _0xbc7b=function(_0x598f52,_0x17d001){_0x598f52=_0x598f52-0x0;var _0x445db1=_0xc7bb[_0x598f52];return _0x445db1;};'use strict';var _=require('lodash');var util=require(_0xbc7b('0x0'));var moment=require(_0xbc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc7b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc7b('0x4'))(_0xbc7b('0x5'));var config=require(_0xbc7b('0x6'));var jayson=require(_0xbc7b('0x7'));var client=jayson['client'][_0xbc7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43137d,_0x3ceb1f,_0x48ff4d){return new BPromise(function(_0x22928f,_0x295441){return client['request'](_0x43137d,_0x48ff4d)[_0xbc7b('0x9')](function(_0x391903){logger[_0xbc7b('0xa')](_0xbc7b('0xb'),_0x3ceb1f,_0xbc7b('0xc'));logger['debug'](_0xbc7b('0xd'),_0x3ceb1f,_0xbc7b('0xc'),JSON[_0xbc7b('0xe')](_0x391903));if(_0x391903[_0xbc7b('0xf')]){if(_0x391903[_0xbc7b('0xf')][_0xbc7b('0x10')]===0x1f4){logger[_0xbc7b('0xf')](_0xbc7b('0xb'),_0x3ceb1f,_0x391903[_0xbc7b('0xf')][_0xbc7b('0x11')]);return _0x295441(_0x391903[_0xbc7b('0xf')][_0xbc7b('0x11')]);}logger[_0xbc7b('0xf')](_0xbc7b('0xb'),_0x3ceb1f,_0x391903[_0xbc7b('0xf')][_0xbc7b('0x11')]);return _0x22928f(_0x391903[_0xbc7b('0xf')][_0xbc7b('0x11')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3ceb1f,_0xbc7b('0xc'));_0x22928f(_0x391903['result'][_0xbc7b('0x11')]);}})[_0xbc7b('0x12')](function(_0xe960c1){logger[_0xbc7b('0xf')](_0xbc7b('0xb'),_0x3ceb1f,_0xe960c1);_0x295441(_0xe960c1);});});}exports['CreateVoiceDialReport']=function(_0xc2293e){var _0x1cb77c=this;return new Promise(function(_0x40186b,_0x50ec7d){return db['VoiceDialReport'][_0xbc7b('0x13')](_0xc2293e[_0xbc7b('0x14')],{'raw':_0xc2293e[_0xbc7b('0x15')]?_0xc2293e[_0xbc7b('0x15')][_0xbc7b('0x16')]===undefined?!![]:![]:!![]})[_0xbc7b('0x9')](function(_0x26047e){logger['info'](_0xbc7b('0x17'),_0xc2293e);logger[_0xbc7b('0x18')](_0xbc7b('0x17'),_0xc2293e,JSON[_0xbc7b('0xe')](_0x26047e));_0x40186b(_0x26047e);})[_0xbc7b('0x12')](function(_0x3d0aea){logger[_0xbc7b('0xf')](_0xbc7b('0x17'),_0x3d0aea[_0xbc7b('0x11')],_0xc2293e);_0x50ec7d(_0x1cb77c[_0xbc7b('0xf')](0x1f4,_0x3d0aea[_0xbc7b('0x11')]));});});};exports[_0xbc7b('0x19')]=function(_0xb15baa){var _0x278e76=this;return new Promise(function(_0x5a8739,_0x2791c4){return db['VoiceDialReport'][_0xbc7b('0x1a')](_0xb15baa[_0xbc7b('0x14')],{'raw':_0xb15baa[_0xbc7b('0x15')]?_0xb15baa[_0xbc7b('0x15')][_0xbc7b('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb15baa['options']?_0xb15baa[_0xbc7b('0x15')]['where']||null:null,'attributes':_0xb15baa[_0xbc7b('0x15')]?_0xb15baa[_0xbc7b('0x15')]['attributes']||null:null,'limit':_0xb15baa[_0xbc7b('0x15')]?_0xb15baa[_0xbc7b('0x15')][_0xbc7b('0x1b')]||null:null})['then'](function(_0xac348){logger[_0xbc7b('0xa')](_0xbc7b('0x19'),_0xb15baa);logger[_0xbc7b('0x18')](_0xbc7b('0x19'),_0xb15baa,JSON[_0xbc7b('0xe')](_0xac348));_0x5a8739(_0xac348);})[_0xbc7b('0x12')](function(_0x33ae8f){logger['error'](_0xbc7b('0x19'),_0x33ae8f[_0xbc7b('0x11')],_0xb15baa);_0x2791c4(_0x278e76[_0xbc7b('0xf')](0x1f4,_0x33ae8f[_0xbc7b('0x11')]));});});};
\ No newline at end of file
index 89ea6ba..3975ba1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dfc=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports'];(function(_0x3969d0,_0x25ab64){var _0x5c806c=function(_0x573d57){while(--_0x573d57){_0x3969d0['push'](_0x3969d0['shift']());}};_0x5c806c(++_0x25ab64);}(_0x8dfc,0xdc));var _0xc8df=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x8dfc[_0x49052b];return _0x48c045;};'use strict';var multer=require(_0xc8df('0x0'));var util=require(_0xc8df('0x1'));var path=require('path');var timeout=require(_0xc8df('0x2'));var express=require(_0xc8df('0x3'));var router=express['Router']();var fs_extra=require(_0xc8df('0x4'));var auth=require(_0xc8df('0x5'));var interaction=require(_0xc8df('0x6'));var config=require(_0xc8df('0x7'));var controller=require(_0xc8df('0x8'));router[_0xc8df('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc8df('0x9')](_0xc8df('0xa'),auth[_0xc8df('0xb')](),controller[_0xc8df('0xc')]);router[_0xc8df('0xd')]('/',auth[_0xc8df('0xb')](),controller[_0xc8df('0xe')]);router['post'](_0xc8df('0xf'),auth['isAuthenticated'](),controller[_0xc8df('0x10')]);router[_0xc8df('0x11')](_0xc8df('0xa'),auth[_0xc8df('0xb')](),controller[_0xc8df('0x12')]);router[_0xc8df('0x13')](_0xc8df('0xa'),auth[_0xc8df('0xb')](),controller[_0xc8df('0x14')]);module[_0xc8df('0x15')]=router;
\ No newline at end of file
+var _0x0bc3=['index','get','/:id','show','post','isAuthenticated','create','/:id/applications','addApplications','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x14aa22,_0x4942fb){var _0x4dcd6e=function(_0x44c2c6){while(--_0x44c2c6){_0x14aa22['push'](_0x14aa22['shift']());}};_0x4dcd6e(++_0x4942fb);}(_0x0bc3,0x189));var _0x30bc=function(_0x3e74fc,_0x2109cc){_0x3e74fc=_0x3e74fc-0x0;var _0x27ec7d=_0x0bc3[_0x3e74fc];return _0x27ec7d;};'use strict';var multer=require(_0x30bc('0x0'));var util=require(_0x30bc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30bc('0x2')]();var fs_extra=require(_0x30bc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x30bc('0x4'));var config=require(_0x30bc('0x5'));var controller=require(_0x30bc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x30bc('0x7')]);router[_0x30bc('0x8')](_0x30bc('0x9'),auth['isAuthenticated'](),controller[_0x30bc('0xa')]);router[_0x30bc('0xb')]('/',auth[_0x30bc('0xc')](),controller[_0x30bc('0xd')]);router['post'](_0x30bc('0xe'),auth['isAuthenticated'](),controller[_0x30bc('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x30bc('0x10')]);router[_0x30bc('0x11')](_0x30bc('0x9'),auth[_0x30bc('0xc')](),controller[_0x30bc('0x12')]);module[_0x30bc('0x13')]=router;
\ No newline at end of file
index 431477a..727aee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b33=['*,*,*,*','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0x398a4d,_0x1ea6b4){var _0x35c78f=function(_0x3cc845){while(--_0x3cc845){_0x398a4d['push'](_0x398a4d['shift']());}};_0x35c78f(++_0x1ea6b4);}(_0x4b33,0xb1));var _0x34b3=function(_0x2ade8e,_0x6ccb9){_0x2ade8e=_0x2ade8e-0x0;var _0x42ce93=_0x4b33[_0x2ade8e];return _0x42ce93;};'use strict';var Sequelize=require(_0x34b3('0x0'));module[_0x34b3('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34b3('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34b3('0x2')},'priority':{'type':Sequelize[_0x34b3('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x34b3('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x34b3('0x3')],'allowNull':![],'defaultValue':_0x34b3('0x4')},'appdata':{'type':Sequelize[_0x34b3('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x34b3('0x5')](_0x34b3('0x6'),_0x34b3('0x7'),_0x34b3('0x8'),_0x34b3('0x9'),_0x34b3('0xa'),_0x34b3('0xb'),_0x34b3('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x34b3('0x3')]},'interval':{'type':Sequelize[_0x34b3('0x3')],'allowNull':![],'defaultValue':_0x34b3('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x34b3('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x34b3('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x34b3('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x34b3('0x3')],'defaultValue':_0x34b3('0xf')},'answer':{'type':Sequelize[_0x34b3('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x34b3('0x10')],'get':function(_0x1d9102){return this[_0x34b3('0x11')](_0x34b3('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x58b7=['sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','wav','BOOLEAN','VIRTUAL','getDataValue','exten'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x58b7,0xe4));var _0x758b=function(_0x57d123,_0x2ce3ab){_0x57d123=_0x57d123-0x0;var _0x2fde32=_0x58b7[_0x57d123];return _0x2fde32;};'use strict';var Sequelize=require(_0x758b('0x0'));module[_0x758b('0x1')]={'context':{'type':Sequelize[_0x758b('0x2')],'allowNull':![],'unique':_0x758b('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x758b('0x2')],'allowNull':![],'unique':_0x758b('0x3')},'priority':{'type':Sequelize[_0x758b('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x758b('0x3')},'tag':{'type':Sequelize[_0x758b('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x758b('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x758b('0x4')](_0x758b('0x5'),_0x758b('0x6'),_0x758b('0x7'),_0x758b('0x8'),_0x758b('0x9'),_0x758b('0xa'),_0x758b('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x758b('0x2')],'allowNull':![],'defaultValue':_0x758b('0xc')},'IntervalId':{'type':Sequelize[_0x758b('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x758b('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x758b('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x758b('0x2')],'defaultValue':_0x758b('0xe')},'answer':{'type':Sequelize[_0x758b('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0x758b('0x10')],'get':function(_0x5c3488){return this[_0x758b('0x11')](_0x758b('0x12'));}},'alias':{'type':Sequelize[_0x758b('0x2')],'allowNull':!![]}};
\ No newline at end of file
index f30951b..53a1b34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c1a=['stack','send','fieldName','keys','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','pick','filters','where','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','offset','count','Content-Range','destroy','then','get','InboundRoutes','OutboundRoutes','InternalRoutes','filter','ignore','map','value','type','name','UserProfileResource','error'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0x3c1a,0x98));var _0xa3c1=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x3c1a[_0x532d78];return _0x5990c4;};'use strict';var _=require(_0xa3c1('0x0'));var Redis=require('ioredis');var qs=require(_0xa3c1('0x1'));var logger=require(_0xa3c1('0x2'))(_0xa3c1('0x3'));var config=require(_0xa3c1('0x4'));var db=require(_0xa3c1('0x5'))['db'];config[_0xa3c1('0x6')]=_[_0xa3c1('0x7')](config['redis'],{'host':_0xa3c1('0x8'),'port':0x18eb});var socket=require(_0xa3c1('0x9'))(new Redis(config[_0xa3c1('0x6')]));require(_0xa3c1('0xa'))[_0xa3c1('0xb')](socket);function respondWithStatusCode(_0x1beb5a,_0x4d886c){_0x4d886c=_0x4d886c||0xcc;return function(_0x4d9bd3){if(_0x4d9bd3){return _0x1beb5a[_0xa3c1('0xc')](_0x4d886c);}return _0x1beb5a[_0xa3c1('0xd')](_0x4d886c)[_0xa3c1('0xe')]();};}function respondWithResult(_0x15cb72,_0x6c652b){_0x6c652b=_0x6c652b||0xc8;return function(_0x589940){if(_0x589940){return _0x15cb72['status'](_0x6c652b)[_0xa3c1('0xf')](_0x589940);}};}function respondWithFilteredResult(_0x561e61,_0x1daa4e){return function(_0x4bdfaa){if(_0x4bdfaa){var _0x1b067b=typeof _0x1daa4e['offset']===_0xa3c1('0x10')&&typeof _0x1daa4e['limit']===_0xa3c1('0x10');var _0x1bd78f=_0x4bdfaa['count'];var _0x4fd057=_0x1b067b?0x0:_0x1daa4e[_0xa3c1('0x11')];var _0x1b5522=_0x1b067b?_0x4bdfaa[_0xa3c1('0x12')]:_0x1daa4e[_0xa3c1('0x11')]+_0x1daa4e['limit'];var _0x2a4b6b;if(_0x1b5522>=_0x1bd78f){_0x1b5522=_0x1bd78f;_0x2a4b6b=0xc8;}else{_0x2a4b6b=0xce;}_0x561e61[_0xa3c1('0xd')](_0x2a4b6b);return _0x561e61['set'](_0xa3c1('0x13'),_0x4fd057+'-'+_0x1b5522+'/'+_0x1bd78f)[_0xa3c1('0xf')](_0x4bdfaa);}return null;};}function removeEntity(_0x525814){return function(_0x311185){if(_0x311185){return _0x311185[_0xa3c1('0x14')]()[_0xa3c1('0x15')](function(){var _0x4d99e3=_0x311185[_0xa3c1('0x16')]({'plain':!![]});var _0x20c49c=[{'name':_0xa3c1('0x17'),'value':'inbound','ignore':![]},{'name':_0xa3c1('0x18'),'value':'outbound','ignore':![]},{'name':_0xa3c1('0x19'),'value':'internal','ignore':![]}];var _0x19c1bc=_(_0x20c49c)[_0xa3c1('0x1a')](_0xa3c1('0x1b'))[_0xa3c1('0x1c')](_0xa3c1('0x1d'))['value']();if(_['includes'](_0x19c1bc,_0x4d99e3['type'])){return;}var _0x1b1ef4=_['find'](_0x20c49c,[_0xa3c1('0x1d'),_0x4d99e3[_0xa3c1('0x1e')]])[_0xa3c1('0x1f')];return db[_0xa3c1('0x20')][_0xa3c1('0x14')]({'where':{'type':_0x1b1ef4,'resourceId':_0x4d99e3['id']}})['then'](function(){return _0x311185;});})[_0xa3c1('0x15')](function(){_0x525814['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe4c1b5){return function(_0x2871e1){if(!_0x2871e1){_0xe4c1b5['sendStatus'](0x194);}return _0x2871e1;};}function handleError(_0x4b92a5,_0x160e1f){_0x160e1f=_0x160e1f||0x1f4;return function(_0x481cff){logger[_0xa3c1('0x21')](_0x481cff[_0xa3c1('0x22')]);if(_0x481cff[_0xa3c1('0x1f')]){delete _0x481cff[_0xa3c1('0x1f')];}_0x4b92a5[_0xa3c1('0xd')](_0x160e1f)[_0xa3c1('0x23')](_0x481cff);};}exports['index']=function(_0x312ec2,_0x5654ec){var _0xf6fc33={},_0x25b02d={},_0x16d15f={'count':0x0,'rows':[]};var _0x151144=_[_0xa3c1('0x1c')](db['VoiceExtension']['rawAttributes'],function(_0x232af2){return{'name':_0x232af2[_0xa3c1('0x24')],'type':_0x232af2[_0xa3c1('0x1e')]['key']};});_0x25b02d['model']=_['map'](_0x151144,_0xa3c1('0x1f'));_0x25b02d['query']=_[_0xa3c1('0x25')](_0x312ec2[_0xa3c1('0x26')]);_0x25b02d['filters']=_[_0xa3c1('0x27')](_0x25b02d[_0xa3c1('0x28')],_0x25b02d[_0xa3c1('0x26')]);_0xf6fc33['attributes']=_[_0xa3c1('0x27')](_0x25b02d[_0xa3c1('0x28')],qs[_0xa3c1('0x29')](_0x312ec2[_0xa3c1('0x26')][_0xa3c1('0x29')]));_0xf6fc33['attributes']=_0xf6fc33['attributes'][_0xa3c1('0x2a')]?_0xf6fc33[_0xa3c1('0x2b')]:_0x25b02d[_0xa3c1('0x28')];if(!_0x312ec2['query'][_0xa3c1('0x2c')](_0xa3c1('0x2d'))){_0xf6fc33[_0xa3c1('0x2e')]=qs[_0xa3c1('0x2e')](_0x312ec2[_0xa3c1('0x26')][_0xa3c1('0x2e')]);_0xf6fc33[_0xa3c1('0x11')]=qs[_0xa3c1('0x11')](_0x312ec2[_0xa3c1('0x26')][_0xa3c1('0x11')]);}_0xf6fc33['order']=qs['sort'](_0x312ec2[_0xa3c1('0x26')]['sort']);_0xf6fc33['where']=qs['filters'](_[_0xa3c1('0x2f')](_0x312ec2['query'],_0x25b02d[_0xa3c1('0x30')]),_0x151144);if(_0x312ec2[_0xa3c1('0x26')][_0xa3c1('0x1a')]){_0xf6fc33['where']=_['merge'](_0xf6fc33[_0xa3c1('0x31')],{'$or':_[_0xa3c1('0x1c')](_0x151144,function(_0x599b33){if(_0x599b33[_0xa3c1('0x1e')]!=='VIRTUAL'){var _0x461719={};_0x461719[_0x599b33[_0xa3c1('0x1f')]]={'$like':'%'+_0x312ec2[_0xa3c1('0x26')]['filter']+'%'};return _0x461719;}})});}_0xf6fc33=_[_0xa3c1('0x32')]({},_0xf6fc33,_0x312ec2[_0xa3c1('0x33')]);var _0x6298d9={'where':_0xf6fc33[_0xa3c1('0x31')]};return db[_0xa3c1('0x34')][_0xa3c1('0x12')](_0x6298d9)[_0xa3c1('0x15')](function(_0xb2223f){_0x16d15f['count']=_0xb2223f;if(_0x312ec2[_0xa3c1('0x26')][_0xa3c1('0x35')]){_0xf6fc33[_0xa3c1('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0xa3c1('0x37')](_0xf6fc33);})['then'](function(_0x242752){_0x16d15f[_0xa3c1('0x38')]=_0x242752;return _0x16d15f;})[_0xa3c1('0x15')](respondWithFilteredResult(_0x5654ec,_0xf6fc33))[_0xa3c1('0x39')](handleError(_0x5654ec,null));};exports['show']=function(_0x2c3525,_0x1662a0){var _0x575c7c={'raw':![],'where':{'id':_0x2c3525[_0xa3c1('0x3a')]['id']}},_0x43f869={};_0x43f869[_0xa3c1('0x28')]=_[_0xa3c1('0x25')](db[_0xa3c1('0x34')][_0xa3c1('0x3b')]);_0x43f869[_0xa3c1('0x26')]=_['keys'](_0x2c3525[_0xa3c1('0x26')]);_0x43f869['filters']=_[_0xa3c1('0x27')](_0x43f869[_0xa3c1('0x28')],_0x43f869[_0xa3c1('0x26')]);_0x575c7c[_0xa3c1('0x2b')]=_[_0xa3c1('0x27')](_0x43f869['model'],qs[_0xa3c1('0x29')](_0x2c3525[_0xa3c1('0x26')]['fields']));_0x575c7c[_0xa3c1('0x2b')]=_0x575c7c[_0xa3c1('0x2b')]['length']?_0x575c7c[_0xa3c1('0x2b')]:_0x43f869[_0xa3c1('0x28')];if(_0x2c3525[_0xa3c1('0x26')]['includeAll']){_0x575c7c[_0xa3c1('0x36')]=[{'all':!![]}];}_0x575c7c=_['merge']({},_0x575c7c,_0x2c3525['options']);return db[_0xa3c1('0x34')][_0xa3c1('0x3c')](_0x575c7c)['then'](handleEntityNotFound(_0x1662a0,null))[_0xa3c1('0x15')](respondWithResult(_0x1662a0,null))[_0xa3c1('0x39')](handleError(_0x1662a0,null));};exports['destroy']=function(_0x4df94a,_0x4f5166){return db[_0xa3c1('0x34')][_0xa3c1('0x3c')]({'where':{'id':_0x4df94a[_0xa3c1('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4f5166,null))['then'](removeEntity(_0x4f5166,null))[_0xa3c1('0x39')](handleError(_0x4f5166,null));};exports[_0xa3c1('0x3d')]=function(_0x1b2326,_0x3f6e12){if(_0x1b2326[_0xa3c1('0x3e')]['type']===_0xa3c1('0x3f')&&!_[_0xa3c1('0x40')](_0x1b2326[_0xa3c1('0x3e')]['exten'],'_')){_0x1b2326['body']['exten']='_'['concat'](_0x1b2326['body'][_0xa3c1('0x41')]);}return db[_0xa3c1('0x34')][_0xa3c1('0x3d')](_0x1b2326['body'],{'raw':![]})[_0xa3c1('0x15')](function(_0x4f0178){var _0x3faebf=_0x1b2326[_0xa3c1('0x42')]['get']({'plain':!![]});if(!_0x3faebf)throw new Error(_0xa3c1('0x43'));if(_0x3faebf[_0xa3c1('0x44')]==='user'){var _0x2c406d=_0x4f0178[_0xa3c1('0x16')]({'plain':!![]});var _0x532781=[{'name':_0xa3c1('0x17'),'value':_0xa3c1('0x45')},{'name':_0xa3c1('0x18'),'value':_0xa3c1('0x3f')},{'name':_0xa3c1('0x19'),'value':_0xa3c1('0x46')}];var _0x1cf5d4=_[_0xa3c1('0x3c')](_0x532781,[_0xa3c1('0x1d'),_0x2c406d['type']])[_0xa3c1('0x1f')];return db[_0xa3c1('0x47')][_0xa3c1('0x3c')]({'where':{'name':_0x1cf5d4,'userProfileId':_0x3faebf[_0xa3c1('0x48')]},'raw':!![]})[_0xa3c1('0x15')](function(_0x46c372){if(_0x46c372&&_0x46c372[_0xa3c1('0x49')]===0x0){return db[_0xa3c1('0x20')][_0xa3c1('0x3d')]({'name':_0x2c406d[_0xa3c1('0x1f')],'resourceId':_0x2c406d['id'],'type':_0x46c372['name'],'sectionId':_0x46c372['id']},{})[_0xa3c1('0x15')](function(){return _0x4f0178;});}else{return _0x4f0178;}})[_0xa3c1('0x39')](function(_0x3f1090){logger[_0xa3c1('0x21')](_0xa3c1('0x4a'),_0x3f1090);throw _0x3f1090;});}return _0x4f0178;})[_0xa3c1('0x15')](respondWithResult(_0x3f6e12,0xc9))[_0xa3c1('0x39')](handleError(_0x3f6e12,null));};exports[_0xa3c1('0x4b')]=function(_0x3ccb15,_0x169ea1){if(_0x3ccb15[_0xa3c1('0x3e')]['id']){delete _0x3ccb15[_0xa3c1('0x3e')]['id'];}return db[_0xa3c1('0x34')][_0xa3c1('0x3c')]({'where':{'id':_0x3ccb15['params']['id']}})[_0xa3c1('0x15')](handleEntityNotFound(_0x169ea1,null))['then'](function(_0x176500){if(_0x176500){return db[_0xa3c1('0x34')]['update'](_[_0xa3c1('0x2f')](_0x3ccb15[_0xa3c1('0x3e')],[_0xa3c1('0x41'),'context',_0xa3c1('0x4c'),_0xa3c1('0x4d'),_0xa3c1('0x4e'),_0xa3c1('0x4f'),_0xa3c1('0x50')]),{'where':{'context':_0x176500[_0xa3c1('0x51')],'exten':_0x176500[_0xa3c1('0x41')]},'individualHooks':!![]})['then'](function(_0x371f65){return _0x371f65;});}return null;})[_0xa3c1('0x15')](respondWithStatusCode(_0x169ea1,null))[_0xa3c1('0x39')](handleError(_0x169ea1,null));};exports['addApplications']=function(_0x44f375,_0x49d0a8){var _0x1b7eba=_0x44f375['params']['id'];var _0x545375=_0x44f375[_0xa3c1('0x3e')];var _0x3fcd32=0xc8;var _0x3e02f6=null;return db[_0xa3c1('0x52')][_0xa3c1('0x53')]({'isolationLevel':db[_0xa3c1('0x52')][_0xa3c1('0x54')][_0xa3c1('0x55')][_0xa3c1('0x56')]},function(_0xa462b){return db[_0xa3c1('0x34')][_0xa3c1('0x57')]({'where':{'id':_0x1b7eba},'transaction':_0xa462b})['then'](function(_0x24cc4c){if(_0x24cc4c){return db['VoiceExtension'][_0xa3c1('0x14')]({'where':{'VoiceExtensionId':_0x1b7eba},'transaction':_0xa462b})['then'](function(){var _0x3064db=_['map'](_0x545375,function(_0x24b8f6){_0x24b8f6[_0xa3c1('0x58')]=_0x1b7eba;_0x24b8f6[_0xa3c1('0x59')]=!![];return _0x24b8f6;});return _0x24cc4c[_0xa3c1('0x5a')](_0x3064db);})['then'](function(_0x3617ae){return db[_0xa3c1('0x34')][_0xa3c1('0x5b')](_0x3617ae,{'transaction':_0xa462b});});}else{_0x3fcd32=0x194;_0x3e02f6=[];}});})['then'](function(){if(_0x3fcd32!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1b7eba},'order':_0xa3c1('0x5c')})[_0xa3c1('0x15')](function(_0x28003f){_0x3e02f6=_0x28003f;});}})[_0xa3c1('0x39')](function(_0x408727){_0x3fcd32=0x1f4;logger['error'](_0x408727[_0xa3c1('0x22')]);if(_0x408727[_0xa3c1('0x1f')]){delete _0x408727['name'];}_0x3e02f6=_0x408727;})['finally'](function(){if(_0x3e02f6===null){_0x49d0a8[_0xa3c1('0xc')](_0x3fcd32);}else{if(_0x3fcd32===0x1f4){_0x49d0a8[_0xa3c1('0xd')](_0x3fcd32)['send'](_0x3e02f6);}else{_0x49d0a8[_0xa3c1('0xd')](_0x3fcd32)[_0xa3c1('0xf')](_0x3e02f6);}}});};
\ No newline at end of file
+var _0xf73d=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','sequelize','transaction','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','limit','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','rows','catch','show','intersection','params','create','startsWith','body','exten','concat','user','role','UserProfileSection'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0xf73d,0x64));var _0xdf73=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf73d[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xdf73('0x0'));var Redis=require(_0xdf73('0x1'));var qs=require(_0xdf73('0x2'));var logger=require('../../config/logger')(_0xdf73('0x3'));var config=require(_0xdf73('0x4'));var db=require('../../mysqldb')['db'];config[_0xdf73('0x5')]=_[_0xdf73('0x6')](config[_0xdf73('0x5')],{'host':_0xdf73('0x7'),'port':0x18eb});var socket=require(_0xdf73('0x8'))(new Redis(config[_0xdf73('0x5')]));require('./voiceExtension.socket')[_0xdf73('0x9')](socket);function respondWithStatusCode(_0x18402b,_0x4a310a){_0x4a310a=_0x4a310a||0xcc;return function(_0x22373d){if(_0x22373d){return _0x18402b[_0xdf73('0xa')](_0x4a310a);}return _0x18402b[_0xdf73('0xb')](_0x4a310a)[_0xdf73('0xc')]();};}function respondWithResult(_0x26db66,_0x115121){_0x115121=_0x115121||0xc8;return function(_0x3fb22d){if(_0x3fb22d){return _0x26db66['status'](_0x115121)['json'](_0x3fb22d);}};}function respondWithFilteredResult(_0x1e1d41,_0x87b365){return function(_0x23483f){if(_0x23483f){var _0x1fd3c0=typeof _0x87b365['offset']==='undefined'&&typeof _0x87b365[_0xdf73('0xd')]==='undefined';var _0xc5a947=_0x23483f[_0xdf73('0xe')];var _0x52ec3b=_0x1fd3c0?0x0:_0x87b365[_0xdf73('0xf')];var _0x44c9b2=_0x1fd3c0?_0x23483f[_0xdf73('0xe')]:_0x87b365['offset']+_0x87b365[_0xdf73('0xd')];var _0x5b22df;if(_0x44c9b2>=_0xc5a947){_0x44c9b2=_0xc5a947;_0x5b22df=0xc8;}else{_0x5b22df=0xce;}_0x1e1d41['status'](_0x5b22df);return _0x1e1d41[_0xdf73('0x10')](_0xdf73('0x11'),_0x52ec3b+'-'+_0x44c9b2+'/'+_0xc5a947)['json'](_0x23483f);}return null;};}function removeEntity(_0x10e349){return function(_0x30bcd6){if(_0x30bcd6){return _0x30bcd6[_0xdf73('0x12')]()[_0xdf73('0x13')](function(){var _0x201bfd=_0x30bcd6[_0xdf73('0x14')]({'plain':!![]});var _0x3af54f=[{'name':_0xdf73('0x15'),'value':_0xdf73('0x16'),'ignore':![]},{'name':_0xdf73('0x17'),'value':'outbound','ignore':![]},{'name':_0xdf73('0x18'),'value':_0xdf73('0x19'),'ignore':![]}];var _0x403f94=_(_0x3af54f)[_0xdf73('0x1a')]('ignore')[_0xdf73('0x1b')](_0xdf73('0x1c'))[_0xdf73('0x1c')]();if(_['includes'](_0x403f94,_0x201bfd[_0xdf73('0x1d')])){return;}var _0x6d3e46=_[_0xdf73('0x1e')](_0x3af54f,[_0xdf73('0x1c'),_0x201bfd[_0xdf73('0x1d')]])[_0xdf73('0x1f')];return db[_0xdf73('0x20')][_0xdf73('0x12')]({'where':{'type':_0x6d3e46,'resourceId':_0x201bfd['id']}})[_0xdf73('0x13')](function(){return _0x30bcd6;});})['then'](function(){_0x10e349[_0xdf73('0xb')](0xcc)[_0xdf73('0xc')]();});}};}function handleEntityNotFound(_0x54410b){return function(_0x3d4da7){if(!_0x3d4da7){_0x54410b['sendStatus'](0x194);}return _0x3d4da7;};}function handleError(_0x5420d1,_0x126424){_0x126424=_0x126424||0x1f4;return function(_0xfc0f4a){logger[_0xdf73('0x21')](_0xfc0f4a[_0xdf73('0x22')]);if(_0xfc0f4a[_0xdf73('0x1f')]){delete _0xfc0f4a[_0xdf73('0x1f')];}_0x5420d1[_0xdf73('0xb')](_0x126424)['send'](_0xfc0f4a);};}exports[_0xdf73('0x23')]=function(_0x5b3735,_0x33c0d4){var _0x51f376={},_0x28bee8={},_0x32cdce={'count':0x0,'rows':[]};var _0x1f1629=_['map'](db[_0xdf73('0x24')][_0xdf73('0x25')],function(_0x51e8e0){return{'name':_0x51e8e0[_0xdf73('0x26')],'type':_0x51e8e0[_0xdf73('0x1d')][_0xdf73('0x27')]};});_0x28bee8[_0xdf73('0x28')]=_[_0xdf73('0x1b')](_0x1f1629,_0xdf73('0x1f'));_0x28bee8[_0xdf73('0x29')]=_[_0xdf73('0x2a')](_0x5b3735['query']);_0x28bee8[_0xdf73('0x2b')]=_['intersection'](_0x28bee8[_0xdf73('0x28')],_0x28bee8[_0xdf73('0x29')]);_0x51f376[_0xdf73('0x2c')]=_['intersection'](_0x28bee8['model'],qs['fields'](_0x5b3735[_0xdf73('0x29')]['fields']));_0x51f376[_0xdf73('0x2c')]=_0x51f376['attributes'][_0xdf73('0x2d')]?_0x51f376[_0xdf73('0x2c')]:_0x28bee8[_0xdf73('0x28')];if(!_0x5b3735[_0xdf73('0x29')][_0xdf73('0x2e')](_0xdf73('0x2f'))){_0x51f376[_0xdf73('0xd')]=qs[_0xdf73('0xd')](_0x5b3735[_0xdf73('0x29')][_0xdf73('0xd')]);_0x51f376[_0xdf73('0xf')]=qs['offset'](_0x5b3735[_0xdf73('0x29')]['offset']);}_0x51f376[_0xdf73('0x30')]=qs[_0xdf73('0x31')](_0x5b3735[_0xdf73('0x29')][_0xdf73('0x31')]);_0x51f376[_0xdf73('0x32')]=qs[_0xdf73('0x2b')](_['pick'](_0x5b3735['query'],_0x28bee8[_0xdf73('0x2b')]),_0x1f1629);if(_0x5b3735[_0xdf73('0x29')][_0xdf73('0x1a')]){_0x51f376[_0xdf73('0x32')]=_[_0xdf73('0x33')](_0x51f376['where'],{'$or':_[_0xdf73('0x1b')](_0x1f1629,function(_0x40a7f6){if(_0x40a7f6[_0xdf73('0x1d')]!==_0xdf73('0x34')){var _0x420fd1={};_0x420fd1[_0x40a7f6[_0xdf73('0x1f')]]={'$like':'%'+_0x5b3735[_0xdf73('0x29')]['filter']+'%'};return _0x420fd1;}})});}_0x51f376=_['merge']({},_0x51f376,_0x5b3735['options']);var _0x416770={'where':_0x51f376['where']};return db[_0xdf73('0x24')]['count'](_0x416770)[_0xdf73('0x13')](function(_0xb50cc1){_0x32cdce[_0xdf73('0xe')]=_0xb50cc1;if(_0x5b3735[_0xdf73('0x29')]['includeAll']){_0x51f376[_0xdf73('0x35')]=[{'all':!![]}];}return db[_0xdf73('0x24')][_0xdf73('0x36')](_0x51f376);})['then'](function(_0x5667d8){_0x32cdce[_0xdf73('0x37')]=_0x5667d8;return _0x32cdce;})[_0xdf73('0x13')](respondWithFilteredResult(_0x33c0d4,_0x51f376))[_0xdf73('0x38')](handleError(_0x33c0d4,null));};exports[_0xdf73('0x39')]=function(_0x42bea2,_0x19be8d){var _0x1af4e9={'raw':![],'where':{'id':_0x42bea2['params']['id']}},_0x2b0164={};_0x2b0164[_0xdf73('0x28')]=_[_0xdf73('0x2a')](db[_0xdf73('0x24')][_0xdf73('0x25')]);_0x2b0164['query']=_['keys'](_0x42bea2['query']);_0x2b0164[_0xdf73('0x2b')]=_[_0xdf73('0x3a')](_0x2b0164['model'],_0x2b0164[_0xdf73('0x29')]);_0x1af4e9[_0xdf73('0x2c')]=_['intersection'](_0x2b0164[_0xdf73('0x28')],qs['fields'](_0x42bea2[_0xdf73('0x29')]['fields']));_0x1af4e9[_0xdf73('0x2c')]=_0x1af4e9[_0xdf73('0x2c')]['length']?_0x1af4e9[_0xdf73('0x2c')]:_0x2b0164['model'];if(_0x42bea2[_0xdf73('0x29')]['includeAll']){_0x1af4e9[_0xdf73('0x35')]=[{'all':!![]}];}_0x1af4e9=_[_0xdf73('0x33')]({},_0x1af4e9,_0x42bea2['options']);return db[_0xdf73('0x24')][_0xdf73('0x1e')](_0x1af4e9)[_0xdf73('0x13')](handleEntityNotFound(_0x19be8d,null))['then'](respondWithResult(_0x19be8d,null))['catch'](handleError(_0x19be8d,null));};exports[_0xdf73('0x12')]=function(_0x561d78,_0x291dbc){return db['VoiceExtension'][_0xdf73('0x1e')]({'where':{'id':_0x561d78[_0xdf73('0x3b')]['id']}})[_0xdf73('0x13')](handleEntityNotFound(_0x291dbc,null))[_0xdf73('0x13')](removeEntity(_0x291dbc,null))[_0xdf73('0x38')](handleError(_0x291dbc,null));};exports[_0xdf73('0x3c')]=function(_0x169331,_0x1148c3){if(_0x169331['body'][_0xdf73('0x1d')]==='outbound'&&!_[_0xdf73('0x3d')](_0x169331[_0xdf73('0x3e')][_0xdf73('0x3f')],'_')){_0x169331[_0xdf73('0x3e')]['exten']='_'[_0xdf73('0x40')](_0x169331[_0xdf73('0x3e')]['exten']);}return db[_0xdf73('0x24')][_0xdf73('0x3c')](_0x169331[_0xdf73('0x3e')],{'raw':![]})[_0xdf73('0x13')](function(_0x40e304){var _0x42e54e=_0x169331[_0xdf73('0x41')][_0xdf73('0x14')]({'plain':!![]});if(!_0x42e54e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42e54e[_0xdf73('0x42')]===_0xdf73('0x41')){var _0x336624=_0x40e304[_0xdf73('0x14')]({'plain':!![]});var _0x2f4a8a=[{'name':_0xdf73('0x15'),'value':'inbound'},{'name':_0xdf73('0x17'),'value':'outbound'},{'name':_0xdf73('0x18'),'value':_0xdf73('0x19')}];var _0x505b72=_['find'](_0x2f4a8a,[_0xdf73('0x1c'),_0x336624[_0xdf73('0x1d')]])['name'];return db[_0xdf73('0x43')][_0xdf73('0x1e')]({'where':{'name':_0x505b72,'userProfileId':_0x42e54e['userProfileId']},'raw':!![]})[_0xdf73('0x13')](function(_0xfa9b82){if(_0xfa9b82&&_0xfa9b82['autoAssociation']===0x0){return db[_0xdf73('0x20')]['create']({'name':_0x336624[_0xdf73('0x1f')],'resourceId':_0x336624['id'],'type':_0xfa9b82['name'],'sectionId':_0xfa9b82['id']},{})[_0xdf73('0x13')](function(){return _0x40e304;});}else{return _0x40e304;}})[_0xdf73('0x38')](function(_0xecc1de){logger[_0xdf73('0x21')](_0xdf73('0x44'),_0xecc1de);throw _0xecc1de;});}return _0x40e304;})[_0xdf73('0x13')](respondWithResult(_0x1148c3,0xc9))[_0xdf73('0x38')](handleError(_0x1148c3,null));};exports[_0xdf73('0x45')]=function(_0x5d342a,_0x532a8c){if(_0x5d342a[_0xdf73('0x3e')]['id']){delete _0x5d342a[_0xdf73('0x3e')]['id'];}return db['VoiceExtension'][_0xdf73('0x1e')]({'where':{'id':_0x5d342a[_0xdf73('0x3b')]['id']}})[_0xdf73('0x13')](handleEntityNotFound(_0x532a8c,null))[_0xdf73('0x13')](function(_0x23bea2){if(_0x23bea2){return db['VoiceExtension'][_0xdf73('0x45')](_[_0xdf73('0x46')](_0x5d342a[_0xdf73('0x3e')],[_0xdf73('0x3f'),_0xdf73('0x47'),_0xdf73('0x48'),_0xdf73('0x49'),_0xdf73('0x4a'),_0xdf73('0x4b'),'alias']),{'where':{'context':_0x23bea2['context'],'exten':_0x23bea2[_0xdf73('0x3f')]},'individualHooks':!![]})[_0xdf73('0x13')](function(_0x3649f7){return _0x3649f7;});}return null;})[_0xdf73('0x13')](respondWithStatusCode(_0x532a8c,null))['catch'](handleError(_0x532a8c,null));};exports['addApplications']=function(_0x1ee929,_0x22f1db){var _0x5ed2de=_0x1ee929[_0xdf73('0x3b')]['id'];var _0x45cd2d=_0x1ee929[_0xdf73('0x3e')];var _0x3d9ae2=0xc8;var _0x2bd54a=null;return db[_0xdf73('0x4c')][_0xdf73('0x4d')]({'isolationLevel':db[_0xdf73('0x4c')]['Transaction']['ISOLATION_LEVELS'][_0xdf73('0x4e')]},function(_0x57da00){return db[_0xdf73('0x24')]['findOne']({'where':{'id':_0x5ed2de},'transaction':_0x57da00})[_0xdf73('0x13')](function(_0x46a328){if(_0x46a328){return db[_0xdf73('0x24')][_0xdf73('0x12')]({'where':{'VoiceExtensionId':_0x5ed2de},'transaction':_0x57da00})['then'](function(){var _0x40878a=_[_0xdf73('0x1b')](_0x45cd2d,function(_0x359a6d){_0x359a6d[_0xdf73('0x4f')]=_0x5ed2de;_0x359a6d[_0xdf73('0x50')]=!![];return _0x359a6d;});return _0x46a328[_0xdf73('0x51')](_0x40878a);})[_0xdf73('0x13')](function(_0xf6c463){return db[_0xdf73('0x24')][_0xdf73('0x52')](_0xf6c463,{'transaction':_0x57da00});});}else{_0x3d9ae2=0x194;_0x2bd54a=[];}});})[_0xdf73('0x13')](function(){if(_0x3d9ae2!==0x194){return db[_0xdf73('0x24')][_0xdf73('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5ed2de},'order':'cast(priority\x20as\x20unsigned)'})[_0xdf73('0x13')](function(_0x42c9e7){_0x2bd54a=_0x42c9e7;});}})[_0xdf73('0x38')](function(_0x55b31c){_0x3d9ae2=0x1f4;logger['error'](_0x55b31c[_0xdf73('0x22')]);if(_0x55b31c[_0xdf73('0x1f')]){delete _0x55b31c[_0xdf73('0x1f')];}_0x2bd54a=_0x55b31c;})['finally'](function(){if(_0x2bd54a===null){_0x22f1db[_0xdf73('0xa')](_0x3d9ae2);}else{if(_0x3d9ae2===0x1f4){_0x22f1db[_0xdf73('0xb')](_0x3d9ae2)['send'](_0x2bd54a);}else{_0x22f1db[_0xdf73('0xb')](_0x3d9ae2)['json'](_0x2bd54a);}}});};
\ No newline at end of file
index d9276e9..7d6638f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x520a=['hook','exports','events','VoiceExtension','setMaxListeners','save','emit'];(function(_0x13b39d,_0x2a26b6){var _0x3e2e0=function(_0x20cb87){while(--_0x20cb87){_0x13b39d['push'](_0x13b39d['shift']());}};_0x3e2e0(++_0x2a26b6);}(_0x520a,0x121));var _0xa520=function(_0x20de91,_0x240423){_0x20de91=_0x20de91-0x0;var _0x5bbb5e=_0x520a[_0x20de91];return _0x5bbb5e;};'use strict';var EventEmitter=require(_0xa520('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa520('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa520('0x2')](0x0);var events={'afterCreate':_0xa520('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8b35de){return function(_0x27a70f,_0x5c499a,_0x41c6c2){VoiceExtensionEvents['emit'](_0x8b35de+':'+_0x27a70f['id'],_0x27a70f);VoiceExtensionEvents[_0xa520('0x4')](_0x8b35de,_0x27a70f);_0x41c6c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa520('0x5')](e,emitEvent(event));}}module[_0xa520('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xcd49=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit'];(function(_0x60fb10,_0xd27019){var _0x1de1ef=function(_0x3e0eda){while(--_0x3e0eda){_0x60fb10['push'](_0x60fb10['shift']());}};_0x1de1ef(++_0xd27019);}(_0xcd49,0x16b));var _0x9cd4=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xcd49[_0x4fa438];return _0x4e3958;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9cd4('0x0'))['db'][_0x9cd4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9cd4('0x2')](0x0);var events={'afterCreate':_0x9cd4('0x3'),'afterUpdate':_0x9cd4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x581df3){return function(_0x171621,_0x563bdb,_0x4a7565){VoiceExtensionEvents['emit'](_0x581df3+':'+_0x171621['id'],_0x171621);VoiceExtensionEvents[_0x9cd4('0x5')](_0x581df3,_0x171621);_0x4a7565(null);};}for(var e in events){if(events[_0x9cd4('0x6')](e)){var event=events[e];VoiceExtension[_0x9cd4('0x7')](e,emitEvent(event));}}module[_0x9cd4('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
index eda06d7..eed3193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','name','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x5f4bab,_0x2cfd1e){var _0x599efe=function(_0x3fb19e){while(--_0x3fb19e){_0x5f4bab['push'](_0x5f4bab['shift']());}};_0x599efe(++_0x2cfd1e);}(_0xc090,0x112));var _0x0c09=function(_0x422d8e,_0x579268){_0x422d8e=_0x422d8e-0x0;var _0x1eb8c6=_0xc090[_0x422d8e];return _0x1eb8c6;};'use strict';var _=require(_0x0c09('0x0'));var attributes=require(_0x0c09('0x1'));module[_0x0c09('0x2')]=function(_0xb5d246){var _0x1b6b5c=_0xb5d246[_0x0c09('0x3')];function _0x289436(_0x260c36){var _0x11984f=0x2;var _0x487f03=[{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':'CDR(type)='+_0x260c36['type'],'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36['exten'],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x260c36[_0x0c09('0x7')]?_0x0c09('0x5'):'NoOp','appdata':_0x260c36[_0x0c09('0x7')]?_0x0c09('0x8')+_0x260c36['alias']:_0x0c09('0x9'),'context':_0x260c36['context'],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']}];if(_0x260c36[_0x0c09('0x4')]===_0x0c09('0xb')){_0x487f03[_0x0c09('0xc')]({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x260c36['id'],'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36['exten'],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']});}_0x487f03['push']({'type':_0x260c36[_0x0c09('0x4')],'app':'Set','appdata':_0x0c09('0xd'),'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':_0x0c09('0xe'),'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']});return _0x487f03;}function _0x173f4c(_0x7d5c3c){var _0x20ad8a=0x2;var _0x14995e=[{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x10'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x7d5c3c['alias']?_0x0c09('0x5'):_0x0c09('0x11'),'appdata':_0x7d5c3c['alias']?'CDR(routeAlias)='+_0x7d5c3c[_0x0c09('0x7')]:_0x0c09('0x9'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c['exten'],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x12')+(_0x7d5c3c['cutdigits']?_0x0c09('0x13')+_0x7d5c3c['cutdigits']+'}':_0x0c09('0x14')),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x15')+_0x7d5c3c['id'],'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':'outbound','app':'ExecIf','appdata':_0x0c09('0x16')+(_0x20ad8a+0x2)+_0x0c09('0x17')+(_0x20ad8a+0x1)+')','context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x7d5c3c[_0x0c09('0x18')]?'CDR(prefix)=${EXTEN:0:'+_0x7d5c3c['cutdigits']+'}':_0x0c09('0x19'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0xd'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x7d5c3c['context'],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':'Set','appdata':_0x0c09('0x1a'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x1b')+_0x7d5c3c['id'],'context':_0x7d5c3c['context'],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']}];if(_0x7d5c3c[_0x0c09('0x1c')](_0x0c09('0x1d'))&&_0x7d5c3c['recordingFormat']!==_0x0c09('0x1e')){_0x14995e['push']({'type':'outbound','app':'Set','appdata':_0x0c09('0x1f'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x20')+_0x7d5c3c['recordingFormat']||_0x0c09('0x21'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c['exten'],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']});}return _0x14995e;}function _0x1a72a2(_0x5ccd87,_0x5728f2){var _0x3dde4a=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x0c09('0x22'),'param':0x2},{'name':_0x0c09('0x23'),'param':0x3}];var _0x2ff36c={};var _0x1fef88=_0x5728f2[_0x0c09('0x24')](',');var _0x1b602c=[];for(var _0x10d06f=0x0;_0x10d06f<_0x3dde4a['length'];_0x10d06f++){switch(_0x3dde4a[_0x10d06f][_0x0c09('0x25')]){case _0x0c09('0x26'):_0x2ff36c[_0x0c09('0x26')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]][_0x0c09('0x24')]('/')[0x1];_0x2ff36c[_0x0c09('0x28')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]][_0x0c09('0x24')]('/')[0x2];_0x2ff36c[_0x0c09('0x29')]=_0x2ff36c[_0x0c09('0x28')]?_0x2ff36c[_0x0c09('0x28')][_0x0c09('0x24')]('$')[0x0]:undefined;_0x2ff36c[_0x0c09('0x28')]=_0x5ccd87[_0x0c09('0x18')]?(_0x2ff36c[_0x0c09('0x29')]||'')+_0x0c09('0x13')+_0x5ccd87[_0x0c09('0x18')]+'}':(_0x2ff36c[_0x0c09('0x29')]||'')+_0x0c09('0x14');_0x1b602c[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]]=[_0x0c09('0x2a'),_0x2ff36c[_0x0c09('0x26')],_0x2ff36c['phone']]['join']('/');break;case'options':_0x2ff36c[_0x0c09('0x22')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]];if(_0x5ccd87[_0x0c09('0x1d')]!==_0x0c09('0x1e')){if(_0x2ff36c[_0x0c09('0x22')][_0x0c09('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x2ff36c[_0x0c09('0x22')]+=_0x0c09('0x2c');}}else{_0x2ff36c['options']=_0x2ff36c[_0x0c09('0x22')][_0x0c09('0x2d')]('U(xcally-mixmonitor-context)','');}_0x1b602c[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]]=_0x2ff36c[_0x0c09('0x22')];break;default:_0x1b602c[_0x3dde4a[_0x10d06f]['param']]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]];}}return _0x1b602c[_0x0c09('0x2e')](',');}function _0x5aeb49(_0x448c7c,_0x245372,_0x2ccde9){return new Promise(function(_0x2819d2,_0x24bbbf){var _0x2ab418=[];if(_[_0x0c09('0x2f')](_0x245372))return _0x2819d2(_0x2ab418);_0x1b6b5c[_0x0c09('0x30')]['findAll']({'attributes':['id',_0x0c09('0x31'),_0x0c09('0x32')],'raw':!![]})[_0x0c09('0x33')](function(_0x5395a5){for(var _0xc705be=0x0,_0x3bbd5a=0x0;_0xc705be<_0x245372[_0x0c09('0x34')];_0xc705be++,_0x3bbd5a=0x0){var _0x164f52=_0x245372[_0xc705be];var _0x1ea838=[];var _0x225a72=[];delete _0x164f52['id'];if(_0x164f52[_0x0c09('0x31')]!==_0x0c09('0x35')){_0x164f52['intervals']=[_0x164f52[_0x0c09('0x31')]];}else{_0x164f52[_0x0c09('0x36')]=_0x164f52[_0x0c09('0x32')]?_[_0x0c09('0x37')](_['filter'](_0x5395a5,{'IntervalId':_0x164f52[_0x0c09('0x32')]}),_0x0c09('0x31')):[];}_0x164f52[_0x0c09('0x6')]=_0x448c7c[_0x0c09('0x6')];_0x164f52[_0x0c09('0xa')]=_0x448c7c[_0x0c09('0xa')];if(_0x164f52[_0x0c09('0x4')])_0x164f52[_0x0c09('0x4')]=_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')]();if(_0x448c7c['type']==='outbound'){if(_0x164f52[_0x0c09('0x1c')](_0x0c09('0x39'))&&_0x164f52[_0x0c09('0x39')]&&_0x164f52[_0x0c09('0x39')]!=='--'){_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':'Set','appdata':_0x0c09('0x3a')+_0x164f52[_0x0c09('0x39')],'context':_0x448c7c['context'],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}_0x1ea838['push']({'type':_0x164f52['type'][_0x0c09('0x38')](),'app':_0x0c09('0x3b'),'appdata':_0x0c09('0x3c')+(_0x164f52[_0x0c09('0x3d')]?_0x0c09('0x3e')+_0x164f52['callerID']+')':_0x0c09('0x3f')),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}else{if(_0x164f52[_0x0c09('0x1c')](_0x0c09('0x40'))){if([_0x0c09('0x41'),'playback'][_0x0c09('0x42')](_0x164f52[_0x0c09('0x43')]['toLowerCase']())&&_0x164f52[_0x0c09('0x44')]!==_0x0c09('0x45')){if(_0x164f52[_0x0c09('0x40')]){_0x1ea838['push']({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':_0x0c09('0x3b'),'appdata':_0x0c09('0x46'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x47'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}else{_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':'ExecIf','appdata':_0x0c09('0x48'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});_0x1ea838['push']({'type':_0x164f52['type'][_0x0c09('0x38')](),'app':'Set','appdata':_0x0c09('0x49'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c['exten'],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}}}}for(var _0x1ade1a=0x0;_0x1ade1a<_0x164f52[_0x0c09('0x36')]['length'];_0x1ade1a++){var _0x21a0e4=_0x2ccde9+_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')];var _0x2a7942=_0x1ade1a===_0x164f52[_0x0c09('0x36')]['length']-0x1?_0x2ccde9+_0x1ea838[_0x0c09('0x34')]+_0x225a72[_0x0c09('0x34')]+0x2:_0x2ccde9+_0x1ade1a+0x1;_0x1ea838[_0x0c09('0x4a')](_0x1ade1a,0x0,{'type':_0x448c7c[_0x0c09('0x4')],'app':_0x0c09('0x4b'),'appdata':_0x164f52[_0x0c09('0x36')][_0x1ade1a]+'?'+_0x448c7c['context']+_0x0c09('0x4c')+_0x21a0e4+':'+_0x448c7c[_0x0c09('0x6')]+_0x0c09('0x4c')+_0x2a7942,'exten':_0x448c7c[_0x0c09('0xa')],'context':_0x448c7c[_0x0c09('0x6')],'priority':_0x2ccde9+_0x1ade1a,'VoiceExtensionId':_0x448c7c['id']});}if(_0x164f52['appType']===_0x0c09('0x4d'))_0x164f52[_0x0c09('0x4e')]=_0x1a72a2(_0x448c7c,_0x164f52['appdata']);_0x164f52[_0x0c09('0x4f')]=_0x1ea838['length']?_[_0x0c09('0x50')](_0x1ea838)[_0x0c09('0x4f')]+0x1:_0x2ccde9;_0x2ab418=_[_0x0c09('0x51')](_0x2ab418,_0x1ea838,[_0x164f52],_0x225a72);_0x2ccde9=_['last'](_0x2ab418)[_0x0c09('0x4f')]+0x1;}return _0x2819d2(_0x2ab418);})[_0x0c09('0x52')](function(_0x45de80){_0x24bbbf(_0x45de80);});});}return _0xb5d246[_0x0c09('0x53')](_0x0c09('0x54'),attributes,{'tableName':_0x0c09('0x55'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4f5587){var _0x22f93c=this[_0x0c09('0x56')]({'plain':!![]});var _0x4c6f8d=_0x22f93c[_0x0c09('0x4')]===_0x0c09('0xf')?_0x173f4c(_0x22f93c):_0x289436(_0x22f93c);return _0x5aeb49(_0x22f93c,_0x4f5587,_[_0x0c09('0x50')](_0x4c6f8d)['priority']+0x1)[_0x0c09('0x33')](function(_0x24a148){var _0x169b82=_[_0x0c09('0x51')](_0x4c6f8d,_0x24a148);_0x169b82[_0x0c09('0xc')]({'type':_0x22f93c[_0x0c09('0x4')],'app':_0x0c09('0x57'),'exten':_0x22f93c[_0x0c09('0xa')],'context':_0x22f93c[_0x0c09('0x6')],'priority':_[_0x0c09('0x50')](_0x169b82)[_0x0c09('0x4f')]+0x1,'VoiceExtensionId':_0x22f93c['id']});return _0x169b82;});}}});};
\ No newline at end of file
+var _0x9489=['exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','get','then','concat','Hangup','lodash','./voiceExtension.attributes'];(function(_0xe87deb,_0x3d5e2e){var _0x2d5a61=function(_0x443bdd){while(--_0x443bdd){_0xe87deb['push'](_0xe87deb['shift']());}};_0x2d5a61(++_0x3d5e2e);}(_0x9489,0xb2));var _0x9948=function(_0xdcfc8c,_0x331991){_0xdcfc8c=_0xdcfc8c-0x0;var _0x1ffca4=_0x9489[_0xdcfc8c];return _0x1ffca4;};'use strict';var _=require(_0x9948('0x0'));var attributes=require(_0x9948('0x1'));module[_0x9948('0x2')]=function(_0x928fc4){var _0x210ddc=_0x928fc4[_0x9948('0x3')];function _0x4a3a2f(_0x5c99ef){var _0x1adf4f=0x2;var _0x5776ea=[{'type':_0x5c99ef['type'],'app':_0x9948('0x4'),'appdata':_0x9948('0x5')+_0x5c99ef[_0x9948('0x6')],'context':_0x5c99ef[_0x9948('0x7')],'exten':_0x5c99ef[_0x9948('0x8')],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']},{'type':_0x5c99ef[_0x9948('0x6')],'app':_0x5c99ef[_0x9948('0x9')]?_0x9948('0x4'):_0x9948('0xa'),'appdata':_0x5c99ef['alias']?_0x9948('0xb')+_0x5c99ef[_0x9948('0x9')]:_0x9948('0xc'),'context':_0x5c99ef[_0x9948('0x7')],'exten':_0x5c99ef[_0x9948('0x8')],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']}];if(_0x5c99ef[_0x9948('0x6')]===_0x9948('0xd')){_0x5776ea[_0x9948('0xe')]({'type':_0x9948('0xd'),'app':_0x9948('0x4'),'appdata':_0x9948('0xf')+_0x5c99ef['id'],'context':_0x5c99ef[_0x9948('0x7')],'exten':_0x5c99ef['exten'],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']});}_0x5776ea[_0x9948('0xe')]({'type':_0x5c99ef[_0x9948('0x6')],'app':'Set','appdata':_0x9948('0x10'),'context':_0x5c99ef['context'],'exten':_0x5c99ef[_0x9948('0x8')],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']},{'type':_0x5c99ef[_0x9948('0x6')],'app':'Set','appdata':_0x9948('0x11'),'context':_0x5c99ef[_0x9948('0x7')],'exten':_0x5c99ef[_0x9948('0x8')],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']},{'type':_0x5c99ef[_0x9948('0x6')],'app':_0x9948('0x4'),'appdata':_0x9948('0x12'),'context':_0x5c99ef['context'],'exten':_0x5c99ef[_0x9948('0x8')],'priority':_0x1adf4f++,'VoiceExtensionId':_0x5c99ef['id']});return _0x5776ea;}function _0x1df46f(_0x5a7f10){var _0x34d4f4=0x2;var _0x5d4834=[{'type':'outbound','app':_0x9948('0x4'),'appdata':_0x9948('0x13'),'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':_0x9948('0x14'),'app':_0x5a7f10[_0x9948('0x9')]?_0x9948('0x4'):_0x9948('0xa'),'appdata':_0x5a7f10[_0x9948('0x9')]?'CDR(routeAlias)='+_0x5a7f10[_0x9948('0x9')]:_0x9948('0xc'),'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':_0x9948('0x14'),'app':_0x9948('0x4'),'appdata':'CDR(destination)='+(_0x5a7f10[_0x9948('0x15')]?'${EXTEN:'+_0x5a7f10[_0x9948('0x15')]+'}':_0x9948('0x16')),'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':_0x9948('0x14'),'app':_0x9948('0x4'),'appdata':_0x9948('0xf')+_0x5a7f10['id'],'context':_0x5a7f10['context'],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':_0x9948('0x14'),'app':_0x9948('0x17'),'appdata':_0x9948('0x18')+(_0x34d4f4+0x2)+_0x9948('0x19')+(_0x34d4f4+0x1)+')','context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':'outbound','app':'Set','appdata':_0x5a7f10[_0x9948('0x15')]?_0x9948('0x1a')+_0x5a7f10[_0x9948('0x15')]+'}':_0x9948('0x1b'),'context':_0x5a7f10['context'],'exten':_0x5a7f10['exten'],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':'outbound','app':_0x9948('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':'outbound','app':_0x9948('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':'outbound','app':_0x9948('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':_0x9948('0x14'),'app':_0x9948('0x4'),'appdata':_0x9948('0x1c')+_0x5a7f10['id'],'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']}];if(_0x5a7f10[_0x9948('0x1d')](_0x9948('0x1e'))&&_0x5a7f10['recordingFormat']!==_0x9948('0x1f')){_0x5d4834[_0x9948('0xe')]({'type':_0x9948('0x14'),'app':'Set','appdata':_0x9948('0x20'),'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']},{'type':'outbound','app':_0x9948('0x4'),'appdata':_0x9948('0x21')+_0x5a7f10[_0x9948('0x1e')]||_0x9948('0x22'),'context':_0x5a7f10[_0x9948('0x7')],'exten':_0x5a7f10[_0x9948('0x8')],'priority':_0x34d4f4++,'VoiceExtensionId':_0x5a7f10['id']});}return _0x5d4834;}function _0x902b55(_0x4c5c52,_0x2eeb8c){var _0x4a8d8d=[{'name':_0x9948('0x23'),'param':0x0},{'name':_0x9948('0x24'),'param':0x1},{'name':_0x9948('0x25'),'param':0x2},{'name':_0x9948('0x26'),'param':0x3}];var _0x5464cb={};var _0x532a78=_0x2eeb8c['split'](',');var _0x14a0cd=[];for(var _0x3c8f57=0x0;_0x3c8f57<_0x4a8d8d[_0x9948('0x27')];_0x3c8f57++){switch(_0x4a8d8d[_0x3c8f57][_0x9948('0x28')]){case _0x9948('0x23'):_0x5464cb[_0x9948('0x23')]=_0x532a78[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]][_0x9948('0x2a')]('/')[0x1];_0x5464cb[_0x9948('0x2b')]=_0x532a78[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]][_0x9948('0x2a')]('/')[0x2];_0x5464cb[_0x9948('0x2c')]=_0x5464cb[_0x9948('0x2b')]?_0x5464cb[_0x9948('0x2b')][_0x9948('0x2a')]('$')[0x0]:undefined;_0x5464cb[_0x9948('0x2b')]=_0x4c5c52[_0x9948('0x15')]?(_0x5464cb[_0x9948('0x2c')]||'')+_0x9948('0x2d')+_0x4c5c52[_0x9948('0x15')]+'}':(_0x5464cb['prefix']||'')+_0x9948('0x16');_0x14a0cd[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]]=['SIP',_0x5464cb[_0x9948('0x23')],_0x5464cb[_0x9948('0x2b')]][_0x9948('0x2e')]('/');break;case _0x9948('0x25'):_0x5464cb['options']=_0x532a78[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]];if(_0x4c5c52[_0x9948('0x1e')]!==_0x9948('0x1f')){if(_0x5464cb[_0x9948('0x25')][_0x9948('0x2f')](_0x9948('0x30'))<0x0){_0x5464cb['options']+=_0x9948('0x30');}}else{_0x5464cb['options']=_0x5464cb['options'][_0x9948('0x31')]('U(xcally-mixmonitor-context)','');}_0x14a0cd[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]]=_0x5464cb['options'];break;default:_0x14a0cd[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]]=_0x532a78[_0x4a8d8d[_0x3c8f57][_0x9948('0x29')]];}}return _0x14a0cd['join'](',');}function _0x45a01c(_0x3f7416,_0x35c450,_0xb27208){return new Promise(function(_0x94670c,_0x97c427){var _0x1fa992=[];if(_[_0x9948('0x32')](_0x35c450))return _0x94670c(_0x1fa992);_0x210ddc[_0x9948('0x33')][_0x9948('0x34')]({'attributes':['id','interval',_0x9948('0x35')],'raw':!![]})['then'](function(_0x4df055){for(var _0x570ac7=0x0,_0x424000=0x0;_0x570ac7<_0x35c450[_0x9948('0x27')];_0x570ac7++,_0x424000=0x0){var _0x43b2a3=_0x35c450[_0x570ac7];var _0x54feae=[];var _0x59edd2=[];delete _0x43b2a3['id'];if(_0x43b2a3[_0x9948('0x36')]!==_0x9948('0x37')){_0x43b2a3[_0x9948('0x38')]=[_0x43b2a3[_0x9948('0x36')]];}else{_0x43b2a3[_0x9948('0x38')]=_0x43b2a3['IntervalId']?_[_0x9948('0x39')](_[_0x9948('0x3a')](_0x4df055,{'IntervalId':_0x43b2a3[_0x9948('0x35')]}),_0x9948('0x36')):[];}_0x43b2a3['context']=_0x3f7416['context'];_0x43b2a3[_0x9948('0x8')]=_0x3f7416[_0x9948('0x8')];if(_0x43b2a3['type'])_0x43b2a3['type']=_0x43b2a3[_0x9948('0x6')]['toLowerCase']();if(_0x3f7416[_0x9948('0x6')]===_0x9948('0x14')){if(_0x43b2a3['hasOwnProperty'](_0x9948('0x3b'))&&_0x43b2a3[_0x9948('0x3b')]&&_0x43b2a3[_0x9948('0x3b')]!=='--'){_0x54feae['push']({'type':_0x43b2a3['type'][_0x9948('0x3c')](),'app':_0x9948('0x4'),'appdata':_0x9948('0x3d')+_0x43b2a3[_0x9948('0x3b')],'context':_0x3f7416[_0x9948('0x7')],'exten':_0x3f7416[_0x9948('0x8')],'priority':_0x43b2a3[_0x9948('0x38')][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});}_0x54feae[_0x9948('0xe')]({'type':_0x43b2a3[_0x9948('0x6')][_0x9948('0x3c')](),'app':'ExecIf','appdata':_0x9948('0x3e')+(_0x43b2a3[_0x9948('0x3f')]?_0x9948('0x40')+_0x43b2a3[_0x9948('0x3f')]+')':_0x9948('0x41')),'context':_0x3f7416['context'],'exten':_0x3f7416[_0x9948('0x8')],'priority':_0x43b2a3['intervals'][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});}else{if(_0x43b2a3[_0x9948('0x1d')](_0x9948('0x42'))){if([_0x9948('0x43'),_0x9948('0x44')][_0x9948('0x45')](_0x43b2a3[_0x9948('0x46')][_0x9948('0x3c')]())&&_0x43b2a3[_0x9948('0x47')]!=='custom'){if(_0x43b2a3['answer']){_0x54feae['push']({'type':_0x43b2a3[_0x9948('0x6')][_0x9948('0x3c')](),'app':'ExecIf','appdata':_0x9948('0x48'),'context':_0x3f7416['context'],'exten':_0x3f7416[_0x9948('0x8')],'priority':_0x43b2a3['intervals'][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});_0x54feae['push']({'type':_0x43b2a3['type'][_0x9948('0x3c')](),'app':'Set','appdata':_0x9948('0x49'),'context':_0x3f7416['context'],'exten':_0x3f7416['exten'],'priority':_0x43b2a3[_0x9948('0x38')][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});}else{_0x54feae['push']({'type':_0x43b2a3[_0x9948('0x6')][_0x9948('0x3c')](),'app':_0x9948('0x17'),'appdata':_0x9948('0x4a'),'context':_0x3f7416[_0x9948('0x7')],'exten':_0x3f7416[_0x9948('0x8')],'priority':_0x43b2a3[_0x9948('0x38')][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});_0x54feae[_0x9948('0xe')]({'type':_0x43b2a3[_0x9948('0x6')]['toLowerCase'](),'app':'Set','appdata':_0x9948('0x4b'),'context':_0x3f7416['context'],'exten':_0x3f7416[_0x9948('0x8')],'priority':_0x43b2a3[_0x9948('0x38')][_0x9948('0x27')]+_0xb27208+_0x424000++,'VoiceExtensionId':_0x3f7416['id']});}}}}for(var _0x1c6ac2=0x0;_0x1c6ac2<_0x43b2a3[_0x9948('0x38')]['length'];_0x1c6ac2++){var _0x27969b=_0xb27208+_0x43b2a3['intervals'][_0x9948('0x27')];var _0x537596=_0x1c6ac2===_0x43b2a3[_0x9948('0x38')][_0x9948('0x27')]-0x1?_0xb27208+_0x54feae[_0x9948('0x27')]+_0x59edd2['length']+0x2:_0xb27208+_0x1c6ac2+0x1;_0x54feae[_0x9948('0x4c')](_0x1c6ac2,0x0,{'type':_0x3f7416[_0x9948('0x6')],'app':_0x9948('0x4d'),'appdata':_0x43b2a3[_0x9948('0x38')][_0x1c6ac2]+'?'+_0x3f7416[_0x9948('0x7')]+_0x9948('0x4e')+_0x27969b+':'+_0x3f7416[_0x9948('0x7')]+_0x9948('0x4e')+_0x537596,'exten':_0x3f7416[_0x9948('0x8')],'context':_0x3f7416[_0x9948('0x7')],'priority':_0xb27208+_0x1c6ac2,'VoiceExtensionId':_0x3f7416['id']});}if(_0x43b2a3[_0x9948('0x47')]===_0x9948('0x4f'))_0x43b2a3['appdata']=_0x902b55(_0x3f7416,_0x43b2a3[_0x9948('0x50')]);_0x43b2a3[_0x9948('0x51')]=_0x54feae[_0x9948('0x27')]?_[_0x9948('0x52')](_0x54feae)[_0x9948('0x51')]+0x1:_0xb27208;_0x1fa992=_['concat'](_0x1fa992,_0x54feae,[_0x43b2a3],_0x59edd2);_0xb27208=_[_0x9948('0x52')](_0x1fa992)[_0x9948('0x51')]+0x1;}return _0x94670c(_0x1fa992);})[_0x9948('0x53')](function(_0x27c804){_0x97c427(_0x27c804);});});}return _0x928fc4['define'](_0x9948('0x54'),attributes,{'tableName':_0x9948('0x55'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x61e41e){var _0x3025eb=this[_0x9948('0x56')]({'plain':!![]});var _0x972df8=_0x3025eb['type']===_0x9948('0x14')?_0x1df46f(_0x3025eb):_0x4a3a2f(_0x3025eb);return _0x45a01c(_0x3025eb,_0x61e41e,_[_0x9948('0x52')](_0x972df8)[_0x9948('0x51')]+0x1)[_0x9948('0x57')](function(_0x1fe4a6){var _0x37f527=_[_0x9948('0x58')](_0x972df8,_0x1fe4a6);_0x37f527[_0x9948('0xe')]({'type':_0x3025eb['type'],'app':_0x9948('0x59'),'exten':_0x3025eb[_0x9948('0x8')],'context':_0x3025eb[_0x9948('0x7')],'priority':_[_0x9948('0x52')](_0x37f527)[_0x9948('0x51')]+0x1,'VoiceExtensionId':_0x3025eb['id']});return _0x37f527;});}}});};
\ No newline at end of file
index 1ede213..7001c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['include','model','map','then','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit'];(function(_0x5a0f87,_0x38214a){var _0x24d4dd=function(_0x1c1e12){while(--_0x1c1e12){_0x5a0f87['push'](_0x5a0f87['shift']());}};_0x24d4dd(++_0x38214a);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3435f6,_0x4f6c52){_0x3435f6=_0x3435f6-0x0;var _0x339890=_0xbd51[_0x3435f6];return _0x339890;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});config[_0x1bd5('0x8')]=_[_0x1bd5('0x9')](config[_0x1bd5('0x8')],{'host':_0x1bd5('0xa'),'port':0x18eb});var socket=require(_0x1bd5('0xb'))(new Redis(config['redis']));require(_0x1bd5('0xc'))['register'](socket);function respondWithRpcPromise(_0x2bd975,_0x28df8e,_0x3b868a){return new BPromise(function(_0x1fbc68,_0x2344e1){return client[_0x1bd5('0xd')](_0x2bd975,_0x3b868a)['then'](function(_0x456ef8){logger['info'](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));logger[_0x1bd5('0x10')](_0x1bd5('0x11'),_0x28df8e,_0x1bd5('0xf'),JSON[_0x1bd5('0x12')](_0x456ef8));if(_0x456ef8[_0x1bd5('0x13')]){if(_0x456ef8['error']['code']===0x1f4){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x2344e1(_0x456ef8['error']['message']);}logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x1fbc68(_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));_0x1fbc68(_0x456ef8['result']['message']);}})[_0x1bd5('0x16')](function(_0x260827){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x260827);_0x2344e1(_0x260827);});});}exports[_0x1bd5('0x17')]=function(_0x2ff39a){var _0x3fbb39=this;return new Promise(function(_0x2a746d,_0x456051){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1d')]||null:null,'limit':_0x2ff39a['options']?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1e')]||null:null,'include':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1f')]?_['map'](_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1f')],function(_0x3dba4f){return{'model':db[_0x3dba4f[_0x1bd5('0x20')]],'as':_0x3dba4f['as'],'attributes':_0x3dba4f['attributes'],'include':_0x3dba4f[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3dba4f[_0x1bd5('0x1f')],function(_0x3b1090){return{'model':db[_0x3b1090['model']],'as':_0x3b1090['as'],'attributes':_0x3b1090[_0x1bd5('0x1d')],'include':_0x3b1090[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3b1090[_0x1bd5('0x1f')],function(_0xe54b9f){return{'model':db[_0xe54b9f[_0x1bd5('0x20')]],'as':_0xe54b9f['as'],'attributes':_0xe54b9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x1bd5('0x22')](function(_0x472b22){logger[_0x1bd5('0x15')]('GetVoiceExtension',_0x2ff39a);logger[_0x1bd5('0x10')](_0x1bd5('0x17'),_0x2ff39a,JSON[_0x1bd5('0x12')](_0x472b22));_0x2a746d(_0x472b22);})[_0x1bd5('0x16')](function(_0x1f4456){logger[_0x1bd5('0x13')]('GetVoiceExtension',_0x1f4456['message'],_0x2ff39a);_0x456051(_0x3fbb39[_0x1bd5('0x13')](0x1f4,_0x1f4456[_0x1bd5('0x14')]));});});};
\ No newline at end of file
+var _0x9a5a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','stringify','lodash','util','moment'];(function(_0x2822b3,_0x49842b){var _0x4b9178=function(_0x265ccd){while(--_0x265ccd){_0x2822b3['push'](_0x2822b3['shift']());}};_0x4b9178(++_0x49842b);}(_0x9a5a,0x194));var _0xa9a5=function(_0x32a7c8,_0x1d5fb0){_0x32a7c8=_0x32a7c8-0x0;var _0x572997=_0x9a5a[_0x32a7c8];return _0x572997;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var moment=require(_0xa9a5('0x2'));var BPromise=require(_0xa9a5('0x3'));var rs=require(_0xa9a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a5('0x5'))['db'];var utils=require(_0xa9a5('0x6'));var logger=require(_0xa9a5('0x7'))(_0xa9a5('0x8'));var config=require(_0xa9a5('0x9'));var jayson=require(_0xa9a5('0xa'));var client=jayson['client'][_0xa9a5('0xb')]({'port':0x232a});config[_0xa9a5('0xc')]=_[_0xa9a5('0xd')](config[_0xa9a5('0xc')],{'host':_0xa9a5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xa9a5('0xf')](socket);function respondWithRpcPromise(_0x308f82,_0x186fcf,_0x2c3ff8){return new BPromise(function(_0x158317,_0x3c0f91){return client[_0xa9a5('0x10')](_0x308f82,_0x2c3ff8)['then'](function(_0x54b0b4){logger['info'](_0xa9a5('0x11'),_0x186fcf,_0xa9a5('0x12'));logger[_0xa9a5('0x13')](_0xa9a5('0x14'),_0x186fcf,_0xa9a5('0x12'),JSON['stringify'](_0x54b0b4));if(_0x54b0b4[_0xa9a5('0x15')]){if(_0x54b0b4[_0xa9a5('0x15')][_0xa9a5('0x16')]===0x1f4){logger[_0xa9a5('0x15')](_0xa9a5('0x11'),_0x186fcf,_0x54b0b4[_0xa9a5('0x15')]['message']);return _0x3c0f91(_0x54b0b4[_0xa9a5('0x15')][_0xa9a5('0x17')]);}logger[_0xa9a5('0x15')](_0xa9a5('0x11'),_0x186fcf,_0x54b0b4['error'][_0xa9a5('0x17')]);return _0x158317(_0x54b0b4[_0xa9a5('0x15')][_0xa9a5('0x17')]);}else{logger['info'](_0xa9a5('0x11'),_0x186fcf,'request\x20sent');_0x158317(_0x54b0b4['result'][_0xa9a5('0x17')]);}})[_0xa9a5('0x18')](function(_0x554449){logger[_0xa9a5('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x186fcf,_0x554449);_0x3c0f91(_0x554449);});});}exports[_0xa9a5('0x19')]=function(_0x9f0363){var _0x3bd8e9=this;return new Promise(function(_0x15468f,_0x685963){return db[_0xa9a5('0x1a')][_0xa9a5('0x1b')]({'raw':_0x9f0363[_0xa9a5('0x1c')]?_0x9f0363[_0xa9a5('0x1c')][_0xa9a5('0x1d')]===undefined?!![]:![]:!![],'where':_0x9f0363[_0xa9a5('0x1c')]?_0x9f0363[_0xa9a5('0x1c')]['where']||null:null,'attributes':_0x9f0363['options']?_0x9f0363['options'][_0xa9a5('0x1e')]||null:null,'limit':_0x9f0363['options']?_0x9f0363[_0xa9a5('0x1c')][_0xa9a5('0x1f')]||null:null,'include':_0x9f0363[_0xa9a5('0x1c')]?_0x9f0363['options'][_0xa9a5('0x20')]?_[_0xa9a5('0x21')](_0x9f0363[_0xa9a5('0x1c')]['include'],function(_0x5dd641){return{'model':db[_0x5dd641[_0xa9a5('0x22')]],'as':_0x5dd641['as'],'attributes':_0x5dd641[_0xa9a5('0x1e')],'include':_0x5dd641[_0xa9a5('0x20')]?_['map'](_0x5dd641[_0xa9a5('0x20')],function(_0x45afca){return{'model':db[_0x45afca['model']],'as':_0x45afca['as'],'attributes':_0x45afca[_0xa9a5('0x1e')],'include':_0x45afca[_0xa9a5('0x20')]?_['map'](_0x45afca[_0xa9a5('0x20')],function(_0x52e2ad){return{'model':db[_0x52e2ad[_0xa9a5('0x22')]],'as':_0x52e2ad['as'],'attributes':_0x52e2ad['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9a5('0x23')](function(_0x3b271d){logger['info']('GetVoiceExtension',_0x9f0363);logger[_0xa9a5('0x13')]('GetVoiceExtension',_0x9f0363,JSON[_0xa9a5('0x24')](_0x3b271d));_0x15468f(_0x3b271d);})[_0xa9a5('0x18')](function(_0x5f3184){logger[_0xa9a5('0x15')](_0xa9a5('0x19'),_0x5f3184['message'],_0x9f0363);_0x685963(_0x3bd8e9[_0xa9a5('0x15')](0x1f4,_0x5f3184[_0xa9a5('0x17')]));});});};
\ No newline at end of file
index 0e4b1e5..b966671 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x1f838a,_0x535b39){var _0x57fa3d=function(_0x5d5534){while(--_0x5d5534){_0x1f838a['push'](_0x1f838a['shift']());}};_0x57fa3d(++_0x535b39);}(_0xabce,0x103));var _0xeabc=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xabce[_0x25bea7];return _0x175952;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}};
\ No newline at end of file
+var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x814b,0x1a2));var _0xb814=function(_0xee122e,_0x58ef2e){_0xee122e=_0xee122e-0x0;var _0x34f98a=_0x814b[_0xee122e];return _0x34f98a;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}};
\ No newline at end of file
index 30ae542..55ad097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb145=['show','/:id/messages','getMessages','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id'];(function(_0x522fae,_0x50d864){var _0xf167d4=function(_0x7ba679){while(--_0x7ba679){_0x522fae['push'](_0x522fae['shift']());}};_0xf167d4(++_0x50d864);}(_0xb145,0xa3));var _0x5b14=function(_0xf61548,_0x38b6a1){_0xf61548=_0xf61548-0x0;var _0x1e821b=_0xb145[_0xf61548];return _0x1e821b;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x13')]);router['delete'](_0x5b14('0xc'),auth['isAuthenticated'](),controller[_0x5b14('0x14')]);module[_0x5b14('0x15')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1ad8bd,_0x2db80a){var _0x5c2c71=function(_0x4274ea){while(--_0x4274ea){_0x1ad8bd['push'](_0x1ad8bd['shift']());}};_0x5c2c71(++_0x2db80a);}(_0x5fab,0x177));var _0xb5fa=function(_0x14cc99,_0x2388ac){_0x14cc99=_0x14cc99-0x0;var _0x1cba02=_0x5fab[_0x14cc99];return _0x1cba02;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index 7414bf8..1115215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b3=['yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM'];(function(_0xfea467,_0xac0a06){var _0x29e3ed=function(_0x44eea3){while(--_0x44eea3){_0xfea467['push'](_0xfea467['shift']());}};_0x29e3ed(++_0xac0a06);}(_0xb0b3,0x137));var _0x3b0b=function(_0x344f08,_0x677c9b){_0x344f08=_0x344f08-0x0;var _0x57ecdc=_0xb0b3[_0x344f08];return _0x57ecdc;};'use strict';var Sequelize=require(_0x3b0b('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x3b0b('0x1')]},'context':{'type':Sequelize[_0x3b0b('0x1')],'defaultValue':_0x3b0b('0x2'),'unique':_0x3b0b('0x3')},'mailbox':{'type':Sequelize[_0x3b0b('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x3b0b('0x1')]},'email':{'type':Sequelize[_0x3b0b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2b83c0){this[_0x3b0b('0x4')]('email',typeof _0x2b83c0===_0x3b0b('0x5')&&_0x2b83c0[_0x3b0b('0x6')]()?_0x2b83c0[_0x3b0b('0x6')]():null);}},'pager':{'type':Sequelize[_0x3b0b('0x1')]},'tz':{'type':Sequelize[_0x3b0b('0x1')],'defaultValue':_0x3b0b('0x7')},'attach':{'type':Sequelize[_0x3b0b('0x8')]('yes','no'),'defaultValue':_0x3b0b('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3b0b('0x8')](_0x3b0b('0x9'),'no'),'defaultValue':_0x3b0b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3b0b('0x1')]},'callback':{'type':Sequelize[_0x3b0b('0x1')]},'review':{'type':Sequelize['ENUM'](_0x3b0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3b0b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3b0b('0x8')](_0x3b0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3b0b('0x8')](_0x3b0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3b0b('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3b0b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3b0b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3b0b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3b0b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b0b('0x8')](_0x3b0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3b0b('0x9'),'no'),'defaultValue':_0x3b0b('0x9'),'allowNull':![]},'stamp':{'type':_0x3b0b('0xb')},'emailsubject':{'type':Sequelize[_0x3b0b('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x3b0b('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3b0b('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3b0b('0xd')],'get':function(){return this[_0x3b0b('0xe')]('fullname')+'\x20-\x20'+this['getDataValue'](_0x3b0b('0xf'));}}};
\ No newline at end of file
+var _0xe6a6=['TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes'];(function(_0x45f74e,_0x1798e8){var _0xff03c2=function(_0x45888b){while(--_0x45888b){_0x45f74e['push'](_0x45f74e['shift']());}};_0xff03c2(++_0x1798e8);}(_0xe6a6,0x17d));var _0x6e6a=function(_0x519255,_0x43a99e){_0x519255=_0x519255-0x0;var _0x521c91=_0xe6a6[_0x519255];return _0x521c91;};'use strict';var Sequelize=require(_0x6e6a('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x6e6a('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x6e6a('0x2'),'unique':_0x6e6a('0x3')},'mailbox':{'type':Sequelize[_0x6e6a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6e6a('0x3')},'password':{'type':Sequelize[_0x6e6a('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x36c10f){this['setDataValue'](_0x6e6a('0x4'),typeof _0x36c10f===_0x6e6a('0x5')&&_0x36c10f[_0x6e6a('0x6')]()?_0x36c10f[_0x6e6a('0x6')]():null);}},'pager':{'type':Sequelize[_0x6e6a('0x1')]},'tz':{'type':Sequelize[_0x6e6a('0x1')],'defaultValue':_0x6e6a('0x7')},'attach':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':_0x6e6a('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x6e6a('0x1')]},'review':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6e6a('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x6e6a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6e6a('0x8')](_0x6e6a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6e6a('0xb')},'emailsubject':{'type':Sequelize[_0x6e6a('0x1')]},'emailbody':{'type':Sequelize[_0x6e6a('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6e6a('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6e6a('0xd')](_0x6e6a('0xe'))+_0x6e6a('0xf')+this[_0x6e6a('0xd')](_0x6e6a('0x10'));}}};
\ No newline at end of file
index ca037bf..3afc900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fa=['includeAll','include','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','stack','name','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceMail'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x28f3a5,_0x2a84af){_0x28f3a5=_0x28f3a5-0x0;var _0x1a60bc=_0xa5fa[_0x28f3a5];return _0x1a60bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){var _0x32cd16=_0x5b9f0b[_0xaa5f('0x27')]({'plain':!![]});var _0x1f66c0=_0xaa5f('0x28');return db[_0xaa5f('0x29')][_0xaa5f('0x26')]({'where':{'type':_0x1f66c0,'resourceId':_0x32cd16['id']}})['then'](function(){return _0x5b9f0b;});})[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x5a7cf1,_0x3b17b6){return function(_0x269209){if(!_0x269209){_0x5a7cf1[_0xaa5f('0x17')](0x194);}return _0x269209;};}function handleError(_0x4e50ca,_0x5a90e5){_0x5a90e5=_0x5a90e5||0x1f4;return function(_0x479f29){logger['error'](_0x479f29[_0xaa5f('0x2a')]);if(_0x479f29['name']){delete _0x479f29[_0xaa5f('0x2b')];}_0x4e50ca['status'](_0x5a90e5)['send'](_0x479f29);};}exports['index']=function(_0x26a90d,_0x4ddebd){var _0x310828={},_0xc0bb03={},_0x555876={'count':0x0,'rows':[]};var _0x58f608=_[_0xaa5f('0x2c')](db['VoiceMail'][_0xaa5f('0x2d')],function(_0x36c306){return{'name':_0x36c306['fieldName'],'type':_0x36c306[_0xaa5f('0x2e')][_0xaa5f('0x2f')]};});_0xc0bb03[_0xaa5f('0x30')]=_['map'](_0x58f608,_0xaa5f('0x2b'));_0xc0bb03[_0xaa5f('0x31')]=_['keys'](_0x26a90d['query']);_0xc0bb03['filters']=_['intersection'](_0xc0bb03[_0xaa5f('0x30')],_0xc0bb03[_0xaa5f('0x31')]);_0x310828[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0xc0bb03[_0xaa5f('0x30')],qs[_0xaa5f('0x34')](_0x26a90d[_0xaa5f('0x31')]['fields']));_0x310828[_0xaa5f('0x32')]=_0x310828[_0xaa5f('0x32')][_0xaa5f('0x35')]?_0x310828[_0xaa5f('0x32')]:_0xc0bb03[_0xaa5f('0x30')];if(!_0x26a90d[_0xaa5f('0x31')]['hasOwnProperty'](_0xaa5f('0x36'))){_0x310828[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x1c')]);_0x310828['offset']=qs['offset'](_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x1a')]);}_0x310828[_0xaa5f('0x37')]=qs[_0xaa5f('0x38')](_0x26a90d['query'][_0xaa5f('0x38')]);_0x310828[_0xaa5f('0x39')]=qs[_0xaa5f('0x3a')](_[_0xaa5f('0x3b')](_0x26a90d[_0xaa5f('0x31')],_0xc0bb03[_0xaa5f('0x3a')]),_0x58f608);if(_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x3c')]){_0x310828[_0xaa5f('0x39')]=_[_0xaa5f('0x3d')](_0x310828[_0xaa5f('0x39')],{'$or':_['map'](_0x58f608,function(_0x42fc51){if(_0x42fc51[_0xaa5f('0x2e')]!==_0xaa5f('0x3e')){var _0x2dd9bb={};_0x2dd9bb[_0x42fc51[_0xaa5f('0x2b')]]={'$like':'%'+_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x3c')]+'%'};return _0x2dd9bb;}})});}_0x310828=_[_0xaa5f('0x3d')]({},_0x310828,_0x26a90d[_0xaa5f('0x3f')]);var _0x2dad6f={'where':_0x310828['where']};return db[_0xaa5f('0x40')]['count'](_0x2dad6f)[_0xaa5f('0x25')](function(_0x21f4bc){_0x555876[_0xaa5f('0x1d')]=_0x21f4bc;if(_0x26a90d['query'][_0xaa5f('0x41')]){_0x310828[_0xaa5f('0x42')]=[{'all':!![]}];}return db[_0xaa5f('0x40')]['findAll'](_0x310828);})[_0xaa5f('0x25')](function(_0x179be8){_0x555876[_0xaa5f('0x43')]=_0x179be8;return _0x555876;})[_0xaa5f('0x25')](respondWithFilteredResult(_0x4ddebd,_0x310828))['catch'](handleError(_0x4ddebd,null));};exports[_0xaa5f('0x44')]=function(_0x2b2b4c,_0x3aeded){var _0x38edcc={'raw':!![],'where':{'id':_0x2b2b4c[_0xaa5f('0x45')]['id']}},_0x311729={};_0x311729[_0xaa5f('0x30')]=_[_0xaa5f('0x46')](db['VoiceMail'][_0xaa5f('0x2d')]);_0x311729['query']=_[_0xaa5f('0x46')](_0x2b2b4c['query']);_0x311729[_0xaa5f('0x3a')]=_[_0xaa5f('0x33')](_0x311729['model'],_0x311729[_0xaa5f('0x31')]);_0x38edcc[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0x311729['model'],qs['fields'](_0x2b2b4c['query'][_0xaa5f('0x34')]));_0x38edcc['attributes']=_0x38edcc[_0xaa5f('0x32')][_0xaa5f('0x35')]?_0x38edcc[_0xaa5f('0x32')]:_0x311729[_0xaa5f('0x30')];if(_0x2b2b4c['query'][_0xaa5f('0x41')]){_0x38edcc[_0xaa5f('0x42')]=[{'all':!![]}];}_0x38edcc=_[_0xaa5f('0x3d')]({},_0x38edcc,_0x2b2b4c[_0xaa5f('0x3f')]);return db[_0xaa5f('0x40')][_0xaa5f('0x47')](_0x38edcc)[_0xaa5f('0x25')](handleEntityNotFound(_0x3aeded,null))[_0xaa5f('0x25')](respondWithResult(_0x3aeded,null))[_0xaa5f('0x48')](handleError(_0x3aeded,null));};exports[_0xaa5f('0x49')]=function(_0x3ea553,_0x2de737){return db[_0xaa5f('0x40')][_0xaa5f('0x49')](_0x3ea553[_0xaa5f('0x4a')],{})[_0xaa5f('0x25')](function(_0x554e6d){var _0x3412f8=_0x3ea553[_0xaa5f('0x4b')][_0xaa5f('0x27')]({'plain':!![]});if(!_0x3412f8)throw new Error(_0xaa5f('0x4c'));if(_0x3412f8[_0xaa5f('0x4d')]===_0xaa5f('0x4b')){var _0x32bbed=_0x554e6d['get']({'plain':!![]});var _0xf5a6b6=_0xaa5f('0x28');return db[_0xaa5f('0x4e')][_0xaa5f('0x47')]({'where':{'name':_0xf5a6b6,'userProfileId':_0x3412f8['userProfileId']},'raw':!![]})[_0xaa5f('0x25')](function(_0x186c64){if(_0x186c64&&_0x186c64[_0xaa5f('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x32bbed['name'],'resourceId':_0x32bbed['id'],'type':_0x186c64['name'],'sectionId':_0x186c64['id']},{})['then'](function(){return _0x554e6d;});}else{return _0x554e6d;}})['catch'](function(_0x1f47a0){logger[_0xaa5f('0x50')](_0xaa5f('0x51'),_0x1f47a0);throw _0x1f47a0;});}return _0x554e6d;})[_0xaa5f('0x25')](respondWithResult(_0x2de737,0xc9))[_0xaa5f('0x48')](handleError(_0x2de737,null));};exports[_0xaa5f('0x24')]=function(_0x48c473,_0x584a3d){if(_0x48c473[_0xaa5f('0x4a')]['id']){delete _0x48c473[_0xaa5f('0x4a')]['id'];}return db['VoiceMail'][_0xaa5f('0x47')]({'where':{'id':_0x48c473[_0xaa5f('0x45')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x584a3d,null))[_0xaa5f('0x25')](saveUpdates(_0x48c473[_0xaa5f('0x4a')],null))[_0xaa5f('0x25')](respondWithResult(_0x584a3d,null))[_0xaa5f('0x48')](handleError(_0x584a3d,null));};exports['destroy']=function(_0x47c00d,_0x1be4fa){return db[_0xaa5f('0x40')]['find']({'where':{'id':_0x47c00d['params']['id']}})['then'](handleEntityNotFound(_0x1be4fa,null))[_0xaa5f('0x25')](removeEntity(_0x1be4fa,null))['catch'](handleError(_0x1be4fa,null));};exports[_0xaa5f('0x52')]=function(_0x5afc3c,_0x4c5bf6,_0x29b323){return db[_0xaa5f('0x40')][_0xaa5f('0x53')]({'where':{'id':_0x5afc3c['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4c5bf6,null))[_0xaa5f('0x25')](function(_0x24bcf2){var _0x4fe60d;var _0x21d494={},_0x2fd00c={};_0x2fd00c['model']=_[_0xaa5f('0x46')](db[_0xaa5f('0x54')][_0xaa5f('0x2d')]);_0x2fd00c[_0xaa5f('0x31')]=_[_0xaa5f('0x46')](_0x5afc3c[_0xaa5f('0x31')]);_0x2fd00c[_0xaa5f('0x3a')]=_[_0xaa5f('0x33')](_0x2fd00c[_0xaa5f('0x30')],_0x2fd00c['query']);_0x21d494[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0x2fd00c[_0xaa5f('0x30')],qs[_0xaa5f('0x34')](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x34')]));_0x21d494[_0xaa5f('0x32')]=_0x21d494[_0xaa5f('0x32')]['length']?_0x21d494[_0xaa5f('0x32')]:_0x2fd00c['model'];if(!_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x55')](_0xaa5f('0x36'))){_0x21d494[_0xaa5f('0x1c')]=qs['limit'](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x1c')]);_0x21d494[_0xaa5f('0x1a')]=qs['offset'](_0x5afc3c[_0xaa5f('0x31')]['offset']);}_0x21d494[_0xaa5f('0x37')]=qs['sort'](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x38')]);_0x21d494[_0xaa5f('0x39')]=qs[_0xaa5f('0x3a')](_['pick'](_0x5afc3c[_0xaa5f('0x31')],_0x2fd00c[_0xaa5f('0x3a')]));if(_0x5afc3c['query']['filter']){_0x21d494[_0xaa5f('0x39')]=_[_0xaa5f('0x3d')](_0x21d494['where'],{'$or':_[_0xaa5f('0x2c')](_0x21d494[_0xaa5f('0x32')],function(_0x3047bd){var _0x4bb874={};_0x4bb874[_0x3047bd]={'$like':'%'+_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x3c')]+'%'};return _0x4bb874;})});}_0x21d494['where']=_[_0xaa5f('0x3d')](_0x21d494[_0xaa5f('0x39')],{'mailboxuser':_0x24bcf2[_0xaa5f('0x56')]});_0x21d494=_['merge']({},_0x21d494,_0x5afc3c[_0xaa5f('0x3f')]);return db[_0xaa5f('0x54')]['findAndCountAll'](_0x21d494)[_0xaa5f('0x25')](respondWithFilteredResult(_0x4c5bf6,_0x21d494));})[_0xaa5f('0x48')](handleError(_0x4c5bf6,null));};
\ No newline at end of file
+var _0x69d3=['Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0xca970f,_0x4f794e){var _0x1a6e3d=function(_0x5041e1){while(--_0x5041e1){_0xca970f['push'](_0xca970f['shift']());}};_0x1a6e3d(++_0x4f794e);}(_0x69d3,0xda));var _0x369d=function(_0xf2e701,_0x3e3f9b){_0xf2e701=_0xf2e701-0x0;var _0x42b2a8=_0x69d3[_0xf2e701];return _0x42b2a8;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){var _0x36cf04=_0xcae58['get']({'plain':!![]});var _0x4dfe83=_0x369d('0x25');return db[_0x369d('0x26')][_0x369d('0x23')]({'where':{'type':_0x4dfe83,'resourceId':_0x36cf04['id']}})[_0x369d('0x24')](function(){return _0xcae58;});})[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0x570db4,_0x23656b){return function(_0xe95742){if(!_0xe95742){_0x570db4[_0x369d('0x17')](0x194);}return _0xe95742;};}function handleError(_0xf952a3,_0x345be5){_0x345be5=_0x345be5||0x1f4;return function(_0x41367a){logger[_0x369d('0x27')](_0x41367a['stack']);if(_0x41367a[_0x369d('0x28')]){delete _0x41367a['name'];}_0xf952a3['status'](_0x345be5)[_0x369d('0x29')](_0x41367a);};}exports[_0x369d('0x2a')]=function(_0x5844c7,_0x104540){var _0x5a14ce={},_0x37274f={},_0x39d656={'count':0x0,'rows':[]};var _0xe45219=_[_0x369d('0x2b')](db[_0x369d('0x2c')][_0x369d('0x2d')],function(_0x119c00){return{'name':_0x119c00['fieldName'],'type':_0x119c00[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x37274f[_0x369d('0x30')]=_[_0x369d('0x2b')](_0xe45219,_0x369d('0x28'));_0x37274f[_0x369d('0x31')]=_[_0x369d('0x32')](_0x5844c7[_0x369d('0x31')]);_0x37274f['filters']=_[_0x369d('0x33')](_0x37274f[_0x369d('0x30')],_0x37274f[_0x369d('0x31')]);_0x5a14ce[_0x369d('0x34')]=_[_0x369d('0x33')](_0x37274f['model'],qs[_0x369d('0x35')](_0x5844c7[_0x369d('0x31')][_0x369d('0x35')]));_0x5a14ce[_0x369d('0x34')]=_0x5a14ce[_0x369d('0x34')][_0x369d('0x36')]?_0x5a14ce['attributes']:_0x37274f[_0x369d('0x30')];if(!_0x5844c7[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x5a14ce[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x5844c7[_0x369d('0x31')][_0x369d('0x39')]);_0x5a14ce[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x1b')]);}_0x5a14ce[_0x369d('0x3a')]=qs[_0x369d('0x3b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x3b')]);_0x5a14ce[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x5844c7[_0x369d('0x31')],_0x37274f[_0x369d('0x3d')]),_0xe45219);if(_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]){_0x5a14ce[_0x369d('0x3c')]=_['merge'](_0x5a14ce['where'],{'$or':_[_0x369d('0x2b')](_0xe45219,function(_0x319e5d){if(_0x319e5d[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x3afa89={};_0x3afa89[_0x319e5d[_0x369d('0x28')]]={'$like':'%'+_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]+'%'};return _0x3afa89;}})});}_0x5a14ce=_[_0x369d('0x41')]({},_0x5a14ce,_0x5844c7['options']);var _0x322b13={'where':_0x5a14ce[_0x369d('0x3c')]};return db[_0x369d('0x2c')][_0x369d('0x1d')](_0x322b13)[_0x369d('0x24')](function(_0x25cf4e){_0x39d656[_0x369d('0x1d')]=_0x25cf4e;if(_0x5844c7[_0x369d('0x31')]['includeAll']){_0x5a14ce['include']=[{'all':!![]}];}return db[_0x369d('0x2c')][_0x369d('0x42')](_0x5a14ce);})[_0x369d('0x24')](function(_0x4dad71){_0x39d656['rows']=_0x4dad71;return _0x39d656;})['then'](respondWithFilteredResult(_0x104540,_0x5a14ce))[_0x369d('0x43')](handleError(_0x104540,null));};exports[_0x369d('0x44')]=function(_0x55dfde,_0xe7ba64){var _0x430040={'raw':!![],'where':{'id':_0x55dfde[_0x369d('0x45')]['id']}},_0x102a65={};_0x102a65['model']=_[_0x369d('0x32')](db['VoiceMail'][_0x369d('0x2d')]);_0x102a65['query']=_[_0x369d('0x32')](_0x55dfde[_0x369d('0x31')]);_0x102a65[_0x369d('0x3d')]=_['intersection'](_0x102a65['model'],_0x102a65[_0x369d('0x31')]);_0x430040[_0x369d('0x34')]=_[_0x369d('0x33')](_0x102a65['model'],qs[_0x369d('0x35')](_0x55dfde[_0x369d('0x31')][_0x369d('0x35')]));_0x430040[_0x369d('0x34')]=_0x430040[_0x369d('0x34')][_0x369d('0x36')]?_0x430040[_0x369d('0x34')]:_0x102a65[_0x369d('0x30')];if(_0x55dfde[_0x369d('0x31')]['includeAll']){_0x430040[_0x369d('0x46')]=[{'all':!![]}];}_0x430040=_[_0x369d('0x41')]({},_0x430040,_0x55dfde[_0x369d('0x47')]);return db[_0x369d('0x2c')][_0x369d('0x48')](_0x430040)[_0x369d('0x24')](handleEntityNotFound(_0xe7ba64,null))['then'](respondWithResult(_0xe7ba64,null))[_0x369d('0x43')](handleError(_0xe7ba64,null));};exports[_0x369d('0x49')]=function(_0x16dd8f,_0x44a357){return db[_0x369d('0x2c')][_0x369d('0x49')](_0x16dd8f[_0x369d('0x4a')],{})[_0x369d('0x24')](function(_0x3f8a54){var _0x3c15cb=_0x16dd8f[_0x369d('0x4b')][_0x369d('0x4c')]({'plain':!![]});if(!_0x3c15cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c15cb[_0x369d('0x4d')]===_0x369d('0x4b')){var _0x289eb8=_0x3f8a54[_0x369d('0x4c')]({'plain':!![]});var _0x648a0d='Voicemails';return db[_0x369d('0x4e')]['find']({'where':{'name':_0x648a0d,'userProfileId':_0x3c15cb[_0x369d('0x4f')]},'raw':!![]})[_0x369d('0x24')](function(_0x22b594){if(_0x22b594&&_0x22b594[_0x369d('0x50')]===0x0){return db[_0x369d('0x26')][_0x369d('0x49')]({'name':_0x289eb8[_0x369d('0x28')],'resourceId':_0x289eb8['id'],'type':_0x22b594[_0x369d('0x28')],'sectionId':_0x22b594['id']},{})[_0x369d('0x24')](function(){return _0x3f8a54;});}else{return _0x3f8a54;}})[_0x369d('0x43')](function(_0x4d582a){logger['error'](_0x369d('0x51'),_0x4d582a);throw _0x4d582a;});}return _0x3f8a54;})[_0x369d('0x24')](respondWithResult(_0x44a357,0xc9))[_0x369d('0x43')](handleError(_0x44a357,null));};exports[_0x369d('0x52')]=function(_0x347df4,_0x5cd43f){if(_0x347df4['body']['id']){delete _0x347df4[_0x369d('0x4a')]['id'];}return db[_0x369d('0x2c')]['find']({'where':{'id':_0x347df4[_0x369d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd43f,null))[_0x369d('0x24')](saveUpdates(_0x347df4[_0x369d('0x4a')],null))[_0x369d('0x24')](respondWithResult(_0x5cd43f,null))['catch'](handleError(_0x5cd43f,null));};exports[_0x369d('0x23')]=function(_0x145ba8,_0x45ac3c){return db[_0x369d('0x2c')]['find']({'where':{'id':_0x145ba8['params']['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x45ac3c,null))[_0x369d('0x24')](removeEntity(_0x45ac3c,null))[_0x369d('0x43')](handleError(_0x45ac3c,null));};exports['getMessages']=function(_0x43afd7,_0x2dbbee,_0x402aae){return db['VoiceMail']['findOne']({'where':{'id':_0x43afd7[_0x369d('0x45')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x2dbbee,null))[_0x369d('0x24')](function(_0x158ce7){var _0x5408b3;var _0x33bba6={},_0x1fa6bb={};_0x1fa6bb[_0x369d('0x30')]=_[_0x369d('0x32')](db[_0x369d('0x53')]['rawAttributes']);_0x1fa6bb[_0x369d('0x31')]=_[_0x369d('0x32')](_0x43afd7[_0x369d('0x31')]);_0x1fa6bb['filters']=_[_0x369d('0x33')](_0x1fa6bb['model'],_0x1fa6bb[_0x369d('0x31')]);_0x33bba6['attributes']=_['intersection'](_0x1fa6bb['model'],qs['fields'](_0x43afd7[_0x369d('0x31')]['fields']));_0x33bba6[_0x369d('0x34')]=_0x33bba6['attributes'][_0x369d('0x36')]?_0x33bba6[_0x369d('0x34')]:_0x1fa6bb[_0x369d('0x30')];if(!_0x43afd7['query'][_0x369d('0x37')](_0x369d('0x38'))){_0x33bba6[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x43afd7[_0x369d('0x31')][_0x369d('0x39')]);_0x33bba6['offset']=qs[_0x369d('0x1b')](_0x43afd7['query']['offset']);}_0x33bba6['order']=qs[_0x369d('0x3b')](_0x43afd7[_0x369d('0x31')][_0x369d('0x3b')]);_0x33bba6[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x43afd7[_0x369d('0x31')],_0x1fa6bb[_0x369d('0x3d')]));if(_0x43afd7[_0x369d('0x31')][_0x369d('0x3f')]){_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'$or':_[_0x369d('0x2b')](_0x33bba6[_0x369d('0x34')],function(_0x46f58a){var _0x4fe1b6={};_0x4fe1b6[_0x46f58a]={'$like':'%'+_0x43afd7[_0x369d('0x31')]['filter']+'%'};return _0x4fe1b6;})});}_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'mailboxuser':_0x158ce7[_0x369d('0x54')]});_0x33bba6=_[_0x369d('0x41')]({},_0x33bba6,_0x43afd7['options']);return db[_0x369d('0x53')]['findAndCountAll'](_0x33bba6)['then'](respondWithFilteredResult(_0x2dbbee,_0x33bba6));})[_0x369d('0x43')](handleError(_0x2dbbee,null));};
\ No newline at end of file
index 8d04c2f..cc1825d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e28=['rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','context','lodash','util','moment','bluebird','path'];(function(_0x516244,_0x53a31b){var _0x4589a9=function(_0x42e647){while(--_0x42e647){_0x516244['push'](_0x516244['shift']());}};_0x4589a9(++_0x53a31b);}(_0x6e28,0x67));var _0x86e2=function(_0x2e979f,_0x2c9458){_0x2e979f=_0x2e979f-0x0;var _0x135c89=_0x6e28[_0x2e979f];return _0x135c89;};'use strict';var _=require(_0x86e2('0x0'));var util=require(_0x86e2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x86e2('0x2'));var BPromise=require(_0x86e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86e2('0x4'));var rimraf=require(_0x86e2('0x5'));var config=require(_0x86e2('0x6'));var attributes=require(_0x86e2('0x7'));module[_0x86e2('0x8')]=function(_0x3f14ec,_0x126c5a){return _0x3f14ec['define']('VoiceMail',attributes,{'tableName':_0x86e2('0x9'),'paranoid':![],'indexes':[{'name':_0x86e2('0xa'),'fields':['mailbox',_0x86e2('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x59fa=['mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceMail.attributes','define','VoiceMail','voice_voicemail'];(function(_0x52210f,_0x598fe1){var _0x3f34c2=function(_0x4b855e){while(--_0x4b855e){_0x52210f['push'](_0x52210f['shift']());}};_0x3f34c2(++_0x598fe1);}(_0x59fa,0xa8));var _0xa59f=function(_0x325144,_0x3daa25){_0x325144=_0x325144-0x0;var _0x3f0e07=_0x59fa[_0x325144];return _0x3f0e07;};'use strict';var _=require(_0xa59f('0x0'));var util=require(_0xa59f('0x1'));var logger=require(_0xa59f('0x2'))(_0xa59f('0x3'));var moment=require(_0xa59f('0x4'));var BPromise=require('bluebird');var rp=require(_0xa59f('0x5'));var fs=require('fs');var path=require(_0xa59f('0x6'));var rimraf=require(_0xa59f('0x7'));var config=require('../../config/environment');var attributes=require(_0xa59f('0x8'));module['exports']=function(_0x3dfa03,_0x2c08de){return _0x3dfa03[_0xa59f('0x9')](_0xa59f('0xa'),attributes,{'tableName':_0xa59f('0xb'),'paranoid':![],'indexes':[{'name':_0xa59f('0xc'),'fields':[_0xa59f('0xd'),_0xa59f('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index b9d0648..ff81e3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf29b=['error','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x35b593,_0x457545){var _0x24ea4b=function(_0x58822b){while(--_0x58822b){_0x35b593['push'](_0x35b593['shift']());}};_0x24ea4b(++_0x457545);}(_0xf29b,0x69));var _0xbf29=function(_0x3e008b,_0x4c0ef9){_0x3e008b=_0x3e008b-0x0;var _0x34c884=_0xf29b[_0x3e008b];return _0x34c884;};'use strict';var _=require(_0xbf29('0x0'));var util=require(_0xbf29('0x1'));var moment=require(_0xbf29('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf29('0x3'));var db=require(_0xbf29('0x4'))['db'];var utils=require(_0xbf29('0x5'));var logger=require(_0xbf29('0x6'))(_0xbf29('0x7'));var config=require('../../config/environment');var jayson=require(_0xbf29('0x8'));var client=jayson[_0xbf29('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f361a,_0x2caf18,_0x3a38af){return new BPromise(function(_0x4e957c,_0x16d51a){return client['request'](_0x3f361a,_0x3a38af)[_0xbf29('0xa')](function(_0x38ab56){logger[_0xbf29('0xb')]('VoiceMail,\x20%s,\x20%s',_0x2caf18,_0xbf29('0xc'));logger['debug'](_0xbf29('0xd'),_0x2caf18,_0xbf29('0xc'),JSON[_0xbf29('0xe')](_0x38ab56));if(_0x38ab56['error']){if(_0x38ab56[_0xbf29('0xf')]['code']===0x1f4){logger[_0xbf29('0xf')]('VoiceMail,\x20%s,\x20%s',_0x2caf18,_0x38ab56[_0xbf29('0xf')][_0xbf29('0x10')]);return _0x16d51a(_0x38ab56[_0xbf29('0xf')][_0xbf29('0x10')]);}logger[_0xbf29('0xf')](_0xbf29('0x11'),_0x2caf18,_0x38ab56[_0xbf29('0xf')][_0xbf29('0x10')]);return _0x4e957c(_0x38ab56['error'][_0xbf29('0x10')]);}else{logger[_0xbf29('0xb')](_0xbf29('0x11'),_0x2caf18,_0xbf29('0xc'));_0x4e957c(_0x38ab56[_0xbf29('0x12')]['message']);}})[_0xbf29('0x13')](function(_0x421b77){logger[_0xbf29('0xf')](_0xbf29('0x11'),_0x2caf18,_0x421b77);_0x16d51a(_0x421b77);});});}
\ No newline at end of file
+var _0x18e4=['jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x18e4,0x174));var _0x418e=function(_0x1b0307,_0x4336b1){_0x1b0307=_0x1b0307-0x0;var _0x5c8d34=_0x18e4[_0x1b0307];return _0x5c8d34;};'use strict';var _=require('lodash');var util=require(_0x418e('0x0'));var moment=require(_0x418e('0x1'));var BPromise=require(_0x418e('0x2'));var rs=require(_0x418e('0x3'));var fs=require('fs');var Redis=require(_0x418e('0x4'));var db=require(_0x418e('0x5'))['db'];var utils=require(_0x418e('0x6'));var logger=require(_0x418e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x418e('0x8'));var client=jayson['client'][_0x418e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d583b,_0x45fcbb,_0x3f3fdf){return new BPromise(function(_0x1e02e8,_0x568b83){return client[_0x418e('0xa')](_0x5d583b,_0x3f3fdf)[_0x418e('0xb')](function(_0x40f5fa){logger['info'](_0x418e('0xc'),_0x45fcbb,'request\x20sent');logger[_0x418e('0xd')](_0x418e('0xe'),_0x45fcbb,_0x418e('0xf'),JSON['stringify'](_0x40f5fa));if(_0x40f5fa[_0x418e('0x10')]){if(_0x40f5fa[_0x418e('0x10')][_0x418e('0x11')]===0x1f4){logger[_0x418e('0x10')](_0x418e('0xc'),_0x45fcbb,_0x40f5fa[_0x418e('0x10')]['message']);return _0x568b83(_0x40f5fa['error'][_0x418e('0x12')]);}logger[_0x418e('0x10')]('VoiceMail,\x20%s,\x20%s',_0x45fcbb,_0x40f5fa['error'][_0x418e('0x12')]);return _0x1e02e8(_0x40f5fa[_0x418e('0x10')]['message']);}else{logger['info'](_0x418e('0xc'),_0x45fcbb,_0x418e('0xf'));_0x1e02e8(_0x40f5fa['result'][_0x418e('0x12')]);}})[_0x418e('0x13')](function(_0x1bf8e5){logger[_0x418e('0x10')]('VoiceMail,\x20%s,\x20%s',_0x45fcbb,_0x1bf8e5);_0x568b83(_0x1bf8e5);});});}
\ No newline at end of file
index f317e83..6419737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x779b=['show','/:id/download','create','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x5f2afa,_0x47928f){var _0x3ebef7=function(_0xdf6ecd){while(--_0xdf6ecd){_0x5f2afa['push'](_0x5f2afa['shift']());}};_0x3ebef7(++_0x47928f);}(_0x779b,0x16e));var _0xb779=function(_0x54d932,_0x245c55){_0x54d932=_0x54d932-0x0;var _0x57b2db=_0x779b[_0x54d932];return _0x57b2db;};'use strict';var multer=require(_0xb779('0x0'));var util=require('util');var path=require(_0xb779('0x1'));var timeout=require(_0xb779('0x2'));var express=require(_0xb779('0x3'));var router=express[_0xb779('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb779('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb779('0x6'));var controller=require(_0xb779('0x7'));router[_0xb779('0x8')]('/',auth[_0xb779('0x9')](),controller[_0xb779('0xa')]);router['get'](_0xb779('0xb'),auth['isAuthenticated'](),controller[_0xb779('0xc')]);router[_0xb779('0x8')](_0xb779('0xd'),auth[_0xb779('0x9')](),controller['download']);router['post']('/',auth[_0xb779('0x9')](),controller[_0xb779('0xe')]);router['put'](_0xb779('0xb'),auth[_0xb779('0x9')](),controller[_0xb779('0xf')]);router['delete']('/:id',auth[_0xb779('0x9')](),controller[_0xb779('0x10')]);module[_0xb779('0x11')]=router;
\ No newline at end of file
+var _0xd1ab=['put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xd1ab,0x192));var _0xbd1a=function(_0x2fa605,_0x11afb7){_0x2fa605=_0x2fa605-0x0;var _0x578373=_0xd1ab[_0x2fa605];return _0x578373;};'use strict';var multer=require('multer');var util=require(_0xbd1a('0x0'));var path=require(_0xbd1a('0x1'));var timeout=require(_0xbd1a('0x2'));var express=require('express');var router=express[_0xbd1a('0x3')]();var fs_extra=require(_0xbd1a('0x4'));var auth=require(_0xbd1a('0x5'));var interaction=require(_0xbd1a('0x6'));var config=require(_0xbd1a('0x7'));var controller=require(_0xbd1a('0x8'));router[_0xbd1a('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd1a('0xa')]);router[_0xbd1a('0x9')](_0xbd1a('0xb'),auth['isAuthenticated'](),controller[_0xbd1a('0xc')]);router[_0xbd1a('0x9')](_0xbd1a('0xd'),auth[_0xbd1a('0xe')](),controller[_0xbd1a('0xf')]);router[_0xbd1a('0x10')]('/',auth['isAuthenticated'](),controller[_0xbd1a('0x11')]);router[_0xbd1a('0x12')](_0xbd1a('0xb'),auth[_0xbd1a('0xe')](),controller[_0xbd1a('0x13')]);router['delete'](_0xbd1a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbd1a('0x14')]=router;
\ No newline at end of file
index 559029d..8692b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16be=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','STRING','BLOB'];(function(_0x16d3c7,_0x82a2c4){var _0x1f6edc=function(_0x3719a8){while(--_0x3719a8){_0x16d3c7['push'](_0x16d3c7['shift']());}};_0x1f6edc(++_0x82a2c4);}(_0x16be,0x1ee));var _0xe16b=function(_0x5c34c5,_0x5e11d6){_0x5c34c5=_0x5c34c5-0x0;var _0x3d4026=_0x16be[_0x5c34c5];return _0x3d4026;};'use strict';var Sequelize=require(_0xe16b('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a034f){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'context':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'recording':{'type':Sequelize[_0xe16b('0x2')](_0xe16b('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe16b('0x1')],'defaultValue':''},'stamp':{'type':_0xe16b('0x4'),'defaultValue':Sequelize[_0xe16b('0x5')](_0xe16b('0x6'))}};
\ No newline at end of file
+var _0xfe92=['BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL','getDataValue','STRING'];(function(_0xeefaf,_0x17a3db){var _0x394272=function(_0x3a23a8){while(--_0x3a23a8){_0xeefaf['push'](_0xeefaf['shift']());}};_0x394272(++_0x17a3db);}(_0xfe92,0x195));var _0x2fe9=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0xfe92[_0xcda377];return _0x1c024f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2fe9('0x0')],'get':function(_0xb9942){return this[_0x2fe9('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0x2fe9('0x3')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2fe9('0x2')],'defaultValue':''},'stamp':{'type':_0x2fe9('0x4'),'defaultValue':Sequelize['literal'](_0x2fe9('0x5'))}};
\ No newline at end of file
index bab9daf..0290cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4980=['include','findAll','rows','catch','show','params','keys','options','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VoiceMailMessage','includeAll'];(function(_0x287059,_0x499940){var _0x225c79=function(_0x3aa36e){while(--_0x3aa36e){_0x287059['push'](_0x287059['shift']());}};_0x225c79(++_0x499940);}(_0x4980,0x71));var _0x0498=function(_0x3be564,_0x19ca9a){_0x3be564=_0x3be564-0x0;var _0x3d2449=_0x4980[_0x3be564];return _0x3d2449;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0498('0x0'));var zipdir=require(_0x0498('0x1'));var jsonpatch=require(_0x0498('0x2'));var rp=require(_0x0498('0x3'));var moment=require(_0x0498('0x4'));var BPromise=require(_0x0498('0x5'));var Mustache=require(_0x0498('0x6'));var util=require('util');var path=require(_0x0498('0x7'));var sox=require(_0x0498('0x8'));var csv=require(_0x0498('0x9'));var ejs=require(_0x0498('0xa'));var fs=require('fs');var fs_extra=require(_0x0498('0xb'));var _=require('lodash');var squel=require(_0x0498('0xc'));var crypto=require('crypto');var jsforce=require(_0x0498('0xd'));var deskjs=require(_0x0498('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0498('0xf'));var Papa=require('papaparse');var Redis=require(_0x0498('0x10'));var authService=require(_0x0498('0x11'));var qs=require(_0x0498('0x12'));var as=require(_0x0498('0x13'));var hardwareService=require(_0x0498('0x14'));var logger=require(_0x0498('0x15'))(_0x0498('0x16'));var utils=require(_0x0498('0x17'));var config=require(_0x0498('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0498('0x19'))['db'];function respondWithStatusCode(_0x25fc43,_0x500566){_0x500566=_0x500566||0xcc;return function(_0x1b55bf){if(_0x1b55bf){return _0x25fc43['sendStatus'](_0x500566);}return _0x25fc43[_0x0498('0x1a')](_0x500566)[_0x0498('0x1b')]();};}function respondWithResult(_0x1dd3f3,_0x3d0a25){_0x3d0a25=_0x3d0a25||0xc8;return function(_0x565d8f){if(_0x565d8f){return _0x1dd3f3[_0x0498('0x1a')](_0x3d0a25)[_0x0498('0x1c')](_0x565d8f);}};}function respondWithFilteredResult(_0x423a88,_0x41ddd9){return function(_0x16a7f8){if(_0x16a7f8){var _0xc43ad8=typeof _0x41ddd9[_0x0498('0x1d')]===_0x0498('0x1e')&&typeof _0x41ddd9[_0x0498('0x1f')]==='undefined';var _0xcf9339=_0x16a7f8[_0x0498('0x20')];var _0x41347a=_0xc43ad8?0x0:_0x41ddd9['offset'];var _0x537d23=_0xc43ad8?_0x16a7f8[_0x0498('0x20')]:_0x41ddd9[_0x0498('0x1d')]+_0x41ddd9[_0x0498('0x1f')];var _0x39536e;if(_0x537d23>=_0xcf9339){_0x537d23=_0xcf9339;_0x39536e=0xc8;}else{_0x39536e=0xce;}_0x423a88['status'](_0x39536e);return _0x423a88['set'](_0x0498('0x21'),_0x41347a+'-'+_0x537d23+'/'+_0xcf9339)[_0x0498('0x1c')](_0x16a7f8);}return null;};}function patchUpdates(_0x31bb36){return function(_0x262736){try{jsonpatch[_0x0498('0x22')](_0x262736,_0x31bb36,!![]);}catch(_0x382079){return BPromise[_0x0498('0x23')](_0x382079);}return _0x262736[_0x0498('0x24')]();};}function saveUpdates(_0x1550dc,_0x1aaee0){return function(_0x43fbf1){if(_0x43fbf1){return _0x43fbf1[_0x0498('0x25')](_0x1550dc)['then'](function(_0x1b0991){return _0x1b0991;});}return null;};}function removeEntity(_0x18eec3,_0xa3fbc7){return function(_0x46ab24){if(_0x46ab24){return _0x46ab24[_0x0498('0x26')]()[_0x0498('0x27')](function(){_0x18eec3[_0x0498('0x1a')](0xcc)[_0x0498('0x1b')]();});}};}function handleEntityNotFound(_0x489770,_0x330444){return function(_0x2d7794){if(!_0x2d7794){_0x489770[_0x0498('0x28')](0x194);}return _0x2d7794;};}function handleError(_0x1a2ac1,_0x398906){_0x398906=_0x398906||0x1f4;return function(_0xb25b7e){logger[_0x0498('0x29')](_0xb25b7e[_0x0498('0x2a')]);if(_0xb25b7e[_0x0498('0x2b')]){delete _0xb25b7e[_0x0498('0x2b')];}_0x1a2ac1[_0x0498('0x1a')](_0x398906)[_0x0498('0x2c')](_0xb25b7e);};}exports[_0x0498('0x2d')]=function(_0x78b467,_0x578665){var _0x248e07={},_0x945222={},_0x3073b6={'count':0x0,'rows':[]};var _0x4413c2=_['map'](db['VoiceMailMessage'][_0x0498('0x2e')],function(_0x52a6ce){return{'name':_0x52a6ce[_0x0498('0x2f')],'type':_0x52a6ce[_0x0498('0x30')][_0x0498('0x31')]};});_0x945222[_0x0498('0x32')]=_[_0x0498('0x33')](_[_0x0498('0x34')](_0x4413c2,_0x0498('0x2b')),[_0x0498('0x2b')]);_0x945222[_0x0498('0x35')]=_['keys'](_0x78b467['query']);_0x945222[_0x0498('0x36')]=_['intersection'](_0x945222['model'],_0x945222['query']);_0x248e07[_0x0498('0x37')]=_[_0x0498('0x38')](_0x945222['model'],qs[_0x0498('0x39')](_0x78b467['query'][_0x0498('0x39')]));_0x248e07[_0x0498('0x37')]=_0x248e07[_0x0498('0x37')][_0x0498('0x3a')]?_0x248e07['attributes']:_0x945222[_0x0498('0x32')];if(!_0x78b467[_0x0498('0x35')]['hasOwnProperty']('nolimit')){_0x248e07[_0x0498('0x1f')]=qs[_0x0498('0x1f')](_0x78b467['query'][_0x0498('0x1f')]);_0x248e07[_0x0498('0x1d')]=qs[_0x0498('0x1d')](_0x78b467[_0x0498('0x35')][_0x0498('0x1d')]);}_0x248e07[_0x0498('0x3b')]=qs[_0x0498('0x3c')](_0x78b467[_0x0498('0x35')][_0x0498('0x3c')]);_0x248e07[_0x0498('0x3d')]=qs[_0x0498('0x36')](_[_0x0498('0x3e')](_0x78b467[_0x0498('0x35')],_0x945222[_0x0498('0x36')]),_0x4413c2);if(_0x78b467['query']['filter']){_0x248e07[_0x0498('0x3d')]=_['merge'](_0x248e07[_0x0498('0x3d')],{'$or':_[_0x0498('0x34')](_0x4413c2,function(_0x16cb47){if(_0x16cb47[_0x0498('0x30')]!=='VIRTUAL'){var _0x46c3c3={};_0x46c3c3[_0x16cb47[_0x0498('0x2b')]]={'$like':'%'+_0x78b467['query'][_0x0498('0x3f')]+'%'};return _0x46c3c3;}})});}_0x248e07=_[_0x0498('0x40')]({},_0x248e07,_0x78b467['options']);var _0x58e55b={'where':_0x248e07[_0x0498('0x3d')]};return db[_0x0498('0x41')][_0x0498('0x20')](_0x58e55b)['then'](function(_0x5c54cf){_0x3073b6[_0x0498('0x20')]=_0x5c54cf;if(_0x78b467['query'][_0x0498('0x42')]){_0x248e07[_0x0498('0x43')]=[{'all':!![]}];}return db[_0x0498('0x41')][_0x0498('0x44')](_0x248e07);})[_0x0498('0x27')](function(_0x49ea07){_0x3073b6[_0x0498('0x45')]=_0x49ea07;return _0x3073b6;})[_0x0498('0x27')](respondWithFilteredResult(_0x578665,_0x248e07))[_0x0498('0x46')](handleError(_0x578665,null));};exports[_0x0498('0x47')]=function(_0x1268bb,_0x4e0ab9){var _0x79c4e3={'raw':!![],'where':{'id':_0x1268bb[_0x0498('0x48')]['id']}},_0x2e9fcd={};_0x2e9fcd['model']=_[_0x0498('0x49')](db[_0x0498('0x41')][_0x0498('0x2e')]);_0x2e9fcd[_0x0498('0x35')]=_[_0x0498('0x49')](_0x1268bb['query']);_0x2e9fcd['filters']=_[_0x0498('0x38')](_0x2e9fcd[_0x0498('0x32')],_0x2e9fcd[_0x0498('0x35')]);_0x79c4e3[_0x0498('0x37')]=_[_0x0498('0x38')](_0x2e9fcd[_0x0498('0x32')],qs[_0x0498('0x39')](_0x1268bb[_0x0498('0x35')]['fields']));_0x79c4e3[_0x0498('0x37')]=_0x79c4e3[_0x0498('0x37')][_0x0498('0x3a')]?_0x79c4e3[_0x0498('0x37')]:_0x2e9fcd[_0x0498('0x32')];if(_0x1268bb[_0x0498('0x35')]['includeAll']){_0x79c4e3[_0x0498('0x43')]=[{'all':!![]}];}_0x79c4e3=_[_0x0498('0x40')]({},_0x79c4e3,_0x1268bb[_0x0498('0x4a')]);return db[_0x0498('0x41')]['find'](_0x79c4e3)['then'](handleEntityNotFound(_0x4e0ab9,null))[_0x0498('0x27')](respondWithResult(_0x4e0ab9,null))[_0x0498('0x46')](handleError(_0x4e0ab9,null));};exports[_0x0498('0x4b')]=function(_0x23c15f,_0x5e0e35){return db[_0x0498('0x41')][_0x0498('0x4b')](_0x23c15f[_0x0498('0x4c')],{})[_0x0498('0x27')](respondWithResult(_0x5e0e35,0xc9))[_0x0498('0x46')](handleError(_0x5e0e35,null));};exports[_0x0498('0x25')]=function(_0x5c6921,_0xa539f1){if(_0x5c6921[_0x0498('0x4c')]['id']){delete _0x5c6921[_0x0498('0x4c')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x5c6921['params']['id']}})[_0x0498('0x27')](handleEntityNotFound(_0xa539f1,null))['then'](saveUpdates(_0x5c6921['body'],null))['then'](respondWithResult(_0xa539f1,null))[_0x0498('0x46')](handleError(_0xa539f1,null));};exports['destroy']=function(_0x149b87,_0xbfd399){return db[_0x0498('0x41')][_0x0498('0x4d')]({'where':{'id':_0x149b87[_0x0498('0x48')]['id']}})[_0x0498('0x27')](handleEntityNotFound(_0xbfd399,null))[_0x0498('0x27')](removeEntity(_0xbfd399,null))[_0x0498('0x46')](handleError(_0xbfd399,null));};exports[_0x0498('0x4e')]=function(_0x217dba,_0x5ab126,_0x4ee572){return db['VoiceMailMessage'][_0x0498('0x4d')]({'where':{'id':_0x217dba[_0x0498('0x48')]['id']},'attributes':['id',_0x0498('0x4f'),_0x0498('0x50')]})[_0x0498('0x27')](handleEntityNotFound(_0x5ab126,null))[_0x0498('0x27')](function(_0x4cd477){if(_0x4cd477){if(!_0x4cd477[_0x0498('0x4f')]){throw new db[(_0x0498('0x51'))][(_0x0498('0x52'))](_0x0498('0x53'));}var _0x3c0c90={'Content-Type':_0x0498('0x54'),'Content-Disposition':_0x0498('0x55')};if(_0x4cd477['msg_id']){_0x3c0c90[_0x0498('0x56')]=_0x0498('0x57')+_0x4cd477[_0x0498('0x50')]+_0x0498('0x58');}_0x5ab126[_0x0498('0x59')](_0x3c0c90);return _0x5ab126[_0x0498('0x2c')](new Buffer(_0x4cd477['recording']));}})[_0x0498('0x46')](handleError(_0x5ab126,null));};
\ No newline at end of file
+var _0x5e0d=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','map','VoiceMailMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','catch','body','download','recording','msg_id','Sequelize','ValidationError','attachment','.wav\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x5e0d,0x1d0));var _0xd5e0=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x5e0d[_0x5d7227];return _0x15ac55;};'use strict';var emlformat=require(_0xd5e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5e0('0x1'));var jsonpatch=require(_0xd5e0('0x2'));var rp=require(_0xd5e0('0x3'));var moment=require(_0xd5e0('0x4'));var BPromise=require(_0xd5e0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd5e0('0x6'));var sox=require(_0xd5e0('0x7'));var csv=require(_0xd5e0('0x8'));var ejs=require(_0xd5e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5e0('0xa'));var squel=require(_0xd5e0('0xb'));var crypto=require(_0xd5e0('0xc'));var jsforce=require(_0xd5e0('0xd'));var deskjs=require(_0xd5e0('0xe'));var toCsv=require(_0xd5e0('0x8'));var querystring=require(_0xd5e0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd5e0('0x10'));var authService=require(_0xd5e0('0x11'));var qs=require(_0xd5e0('0x12'));var as=require(_0xd5e0('0x13'));var hardwareService=require(_0xd5e0('0x14'));var logger=require(_0xd5e0('0x15'))(_0xd5e0('0x16'));var utils=require('../../config/utils');var config=require(_0xd5e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5e0('0x18'))['db'];function respondWithStatusCode(_0x18316e,_0xb2620e){_0xb2620e=_0xb2620e||0xcc;return function(_0x1d904d){if(_0x1d904d){return _0x18316e[_0xd5e0('0x19')](_0xb2620e);}return _0x18316e[_0xd5e0('0x1a')](_0xb2620e)['end']();};}function respondWithResult(_0x2d5043,_0x1b8c6a){_0x1b8c6a=_0x1b8c6a||0xc8;return function(_0x474d64){if(_0x474d64){return _0x2d5043[_0xd5e0('0x1a')](_0x1b8c6a)[_0xd5e0('0x1b')](_0x474d64);}};}function respondWithFilteredResult(_0x2522da,_0x6bfc6d){return function(_0x2e8e83){if(_0x2e8e83){var _0x222611=typeof _0x6bfc6d[_0xd5e0('0x1c')]===_0xd5e0('0x1d')&&typeof _0x6bfc6d[_0xd5e0('0x1e')]===_0xd5e0('0x1d');var _0x4dd0eb=_0x2e8e83[_0xd5e0('0x1f')];var _0x1ebdc2=_0x222611?0x0:_0x6bfc6d[_0xd5e0('0x1c')];var _0x21c894=_0x222611?_0x2e8e83['count']:_0x6bfc6d[_0xd5e0('0x1c')]+_0x6bfc6d['limit'];var _0x5d1a9a;if(_0x21c894>=_0x4dd0eb){_0x21c894=_0x4dd0eb;_0x5d1a9a=0xc8;}else{_0x5d1a9a=0xce;}_0x2522da['status'](_0x5d1a9a);return _0x2522da[_0xd5e0('0x20')](_0xd5e0('0x21'),_0x1ebdc2+'-'+_0x21c894+'/'+_0x4dd0eb)[_0xd5e0('0x1b')](_0x2e8e83);}return null;};}function patchUpdates(_0x2b4b78){return function(_0x2a9b89){try{jsonpatch[_0xd5e0('0x22')](_0x2a9b89,_0x2b4b78,!![]);}catch(_0x5f4b55){return BPromise[_0xd5e0('0x23')](_0x5f4b55);}return _0x2a9b89[_0xd5e0('0x24')]();};}function saveUpdates(_0xe3d49,_0xff172b){return function(_0x43ebb3){if(_0x43ebb3){return _0x43ebb3[_0xd5e0('0x25')](_0xe3d49)[_0xd5e0('0x26')](function(_0x18b9f4){return _0x18b9f4;});}return null;};}function removeEntity(_0x43488f,_0x44039a){return function(_0xccaed7){if(_0xccaed7){return _0xccaed7[_0xd5e0('0x27')]()['then'](function(){_0x43488f[_0xd5e0('0x1a')](0xcc)[_0xd5e0('0x28')]();});}};}function handleEntityNotFound(_0xd62bc1,_0x657840){return function(_0x410c16){if(!_0x410c16){_0xd62bc1[_0xd5e0('0x19')](0x194);}return _0x410c16;};}function handleError(_0x5b8c76,_0x1f392e){_0x1f392e=_0x1f392e||0x1f4;return function(_0x232d50){logger[_0xd5e0('0x29')](_0x232d50['stack']);if(_0x232d50[_0xd5e0('0x2a')]){delete _0x232d50[_0xd5e0('0x2a')];}_0x5b8c76['status'](_0x1f392e)['send'](_0x232d50);};}exports['index']=function(_0x343f0c,_0x5fd8b2){var _0x3f43ef={},_0x556692={},_0x46ad9d={'count':0x0,'rows':[]};var _0x3c4d1e=_[_0xd5e0('0x2b')](db[_0xd5e0('0x2c')][_0xd5e0('0x2d')],function(_0x306c20){return{'name':_0x306c20['fieldName'],'type':_0x306c20['type'][_0xd5e0('0x2e')]};});_0x556692[_0xd5e0('0x2f')]=_['differenceBy'](_['map'](_0x3c4d1e,_0xd5e0('0x2a')),['name']);_0x556692[_0xd5e0('0x30')]=_[_0xd5e0('0x31')](_0x343f0c[_0xd5e0('0x30')]);_0x556692[_0xd5e0('0x32')]=_[_0xd5e0('0x33')](_0x556692['model'],_0x556692['query']);_0x3f43ef[_0xd5e0('0x34')]=_['intersection'](_0x556692[_0xd5e0('0x2f')],qs[_0xd5e0('0x35')](_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x35')]));_0x3f43ef[_0xd5e0('0x34')]=_0x3f43ef[_0xd5e0('0x34')]['length']?_0x3f43ef['attributes']:_0x556692[_0xd5e0('0x2f')];if(!_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x36')]('nolimit')){_0x3f43ef[_0xd5e0('0x1e')]=qs['limit'](_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x1e')]);_0x3f43ef[_0xd5e0('0x1c')]=qs[_0xd5e0('0x1c')](_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x1c')]);}_0x3f43ef['order']=qs[_0xd5e0('0x37')](_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x37')]);_0x3f43ef['where']=qs['filters'](_[_0xd5e0('0x38')](_0x343f0c['query'],_0x556692[_0xd5e0('0x32')]),_0x3c4d1e);if(_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x39')]){_0x3f43ef['where']=_[_0xd5e0('0x3a')](_0x3f43ef[_0xd5e0('0x3b')],{'$or':_[_0xd5e0('0x2b')](_0x3c4d1e,function(_0x2c8812){if(_0x2c8812[_0xd5e0('0x3c')]!==_0xd5e0('0x3d')){var _0x4777af={};_0x4777af[_0x2c8812[_0xd5e0('0x2a')]]={'$like':'%'+_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x39')]+'%'};return _0x4777af;}})});}_0x3f43ef=_[_0xd5e0('0x3a')]({},_0x3f43ef,_0x343f0c[_0xd5e0('0x3e')]);var _0x50cbf3={'where':_0x3f43ef[_0xd5e0('0x3b')]};return db['VoiceMailMessage'][_0xd5e0('0x1f')](_0x50cbf3)['then'](function(_0x42eb13){_0x46ad9d[_0xd5e0('0x1f')]=_0x42eb13;if(_0x343f0c[_0xd5e0('0x30')][_0xd5e0('0x3f')]){_0x3f43ef[_0xd5e0('0x40')]=[{'all':!![]}];}return db[_0xd5e0('0x2c')][_0xd5e0('0x41')](_0x3f43ef);})[_0xd5e0('0x26')](function(_0x244ed7){_0x46ad9d[_0xd5e0('0x42')]=_0x244ed7;return _0x46ad9d;})['then'](respondWithFilteredResult(_0x5fd8b2,_0x3f43ef))['catch'](handleError(_0x5fd8b2,null));};exports[_0xd5e0('0x43')]=function(_0x24014f,_0x129c8b){var _0x363c6b={'raw':!![],'where':{'id':_0x24014f[_0xd5e0('0x44')]['id']}},_0x24381f={};_0x24381f['model']=_[_0xd5e0('0x31')](db[_0xd5e0('0x2c')][_0xd5e0('0x2d')]);_0x24381f[_0xd5e0('0x30')]=_['keys'](_0x24014f[_0xd5e0('0x30')]);_0x24381f[_0xd5e0('0x32')]=_['intersection'](_0x24381f[_0xd5e0('0x2f')],_0x24381f[_0xd5e0('0x30')]);_0x363c6b['attributes']=_['intersection'](_0x24381f[_0xd5e0('0x2f')],qs[_0xd5e0('0x35')](_0x24014f['query'][_0xd5e0('0x35')]));_0x363c6b[_0xd5e0('0x34')]=_0x363c6b[_0xd5e0('0x34')][_0xd5e0('0x45')]?_0x363c6b[_0xd5e0('0x34')]:_0x24381f[_0xd5e0('0x2f')];if(_0x24014f[_0xd5e0('0x30')]['includeAll']){_0x363c6b[_0xd5e0('0x40')]=[{'all':!![]}];}_0x363c6b=_[_0xd5e0('0x3a')]({},_0x363c6b,_0x24014f['options']);return db[_0xd5e0('0x2c')][_0xd5e0('0x46')](_0x363c6b)['then'](handleEntityNotFound(_0x129c8b,null))[_0xd5e0('0x26')](respondWithResult(_0x129c8b,null))['catch'](handleError(_0x129c8b,null));};exports[_0xd5e0('0x47')]=function(_0x25cb44,_0xfd4535){return db[_0xd5e0('0x2c')][_0xd5e0('0x47')](_0x25cb44['body'],{})[_0xd5e0('0x26')](respondWithResult(_0xfd4535,0xc9))[_0xd5e0('0x48')](handleError(_0xfd4535,null));};exports[_0xd5e0('0x25')]=function(_0x1527a1,_0x614c06){if(_0x1527a1[_0xd5e0('0x49')]['id']){delete _0x1527a1[_0xd5e0('0x49')]['id'];}return db[_0xd5e0('0x2c')][_0xd5e0('0x46')]({'where':{'id':_0x1527a1[_0xd5e0('0x44')]['id']}})[_0xd5e0('0x26')](handleEntityNotFound(_0x614c06,null))[_0xd5e0('0x26')](saveUpdates(_0x1527a1[_0xd5e0('0x49')],null))[_0xd5e0('0x26')](respondWithResult(_0x614c06,null))[_0xd5e0('0x48')](handleError(_0x614c06,null));};exports[_0xd5e0('0x27')]=function(_0x12e237,_0x46c1e0){return db[_0xd5e0('0x2c')][_0xd5e0('0x46')]({'where':{'id':_0x12e237[_0xd5e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x46c1e0,null))['then'](removeEntity(_0x46c1e0,null))['catch'](handleError(_0x46c1e0,null));};exports[_0xd5e0('0x4a')]=function(_0x40617b,_0xfa0363,_0x25f5e1){return db['VoiceMailMessage']['find']({'where':{'id':_0x40617b['params']['id']},'attributes':['id',_0xd5e0('0x4b'),_0xd5e0('0x4c')]})[_0xd5e0('0x26')](handleEntityNotFound(_0xfa0363,null))['then'](function(_0x430c63){if(_0x430c63){if(!_0x430c63[_0xd5e0('0x4b')]){throw new db[(_0xd5e0('0x4d'))][(_0xd5e0('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x10db01={'Content-Type':'audio/wav','Content-Disposition':_0xd5e0('0x4f')};if(_0x430c63[_0xd5e0('0x4c')]){_0x10db01['Content-Disposition']='attachment;\x20filename=\x22'+_0x430c63[_0xd5e0('0x4c')]+_0xd5e0('0x50');}_0xfa0363[_0xd5e0('0x20')](_0x10db01);return _0xfa0363[_0xd5e0('0x51')](new Buffer(_0x430c63[_0xd5e0('0x4b')]));}})[_0xd5e0('0x48')](handleError(_0xfa0363,null));};
\ No newline at end of file
index d20dd78..dea3601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0906=['dir','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x31d849,_0x3db9bc){var _0x1c55b3=function(_0x3b8040){while(--_0x3b8040){_0x31d849['push'](_0x31d849['shift']());}};_0x1c55b3(++_0x3db9bc);}(_0x0906,0xd3));var _0x6090=function(_0x4ffc75,_0xb86d40){_0x4ffc75=_0x4ffc75-0x0;var _0x130ea2=_0x0906[_0x4ffc75];return _0x130ea2;};'use strict';var _=require(_0x6090('0x0'));var util=require(_0x6090('0x1'));var logger=require(_0x6090('0x2'))(_0x6090('0x3'));var moment=require('moment');var BPromise=require(_0x6090('0x4'));var rp=require(_0x6090('0x5'));var fs=require('fs');var path=require(_0x6090('0x6'));var rimraf=require(_0x6090('0x7'));var config=require(_0x6090('0x8'));var attributes=require(_0x6090('0x9'));module[_0x6090('0xa')]=function(_0xf45699,_0x3208a8){return _0xf45699[_0x6090('0xb')](_0x6090('0xc'),attributes,{'tableName':_0x6090('0xd'),'paranoid':![],'indexes':[{'name':_0x6090('0xe'),'fields':[_0x6090('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7d78=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x3a3e6e,_0x437020){var _0x3514ee=function(_0x426bce){while(--_0x426bce){_0x3a3e6e['push'](_0x3a3e6e['shift']());}};_0x3514ee(++_0x437020);}(_0x7d78,0x1c2));var _0x87d7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7d78[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x87d7('0x0'));var util=require(_0x87d7('0x1'));var logger=require('../../config/logger')(_0x87d7('0x2'));var moment=require('moment');var BPromise=require(_0x87d7('0x3'));var rp=require(_0x87d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87d7('0x5'));var config=require(_0x87d7('0x6'));var attributes=require(_0x87d7('0x7'));module[_0x87d7('0x8')]=function(_0x47d6f1,_0x214bfb){return _0x47d6f1[_0x87d7('0x9')](_0x87d7('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x87d7('0xb'),'fields':[_0x87d7('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 2eff0aa..3e52e83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b5=['code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xd7b5,0xb5));var _0x5d7b=function(_0x3919dd,_0x4432ea){_0x3919dd=_0x3919dd-0x0;var _0x28f034=_0xd7b5[_0x3919dd];return _0x28f034;};'use strict';var _=require(_0x5d7b('0x0'));var util=require(_0x5d7b('0x1'));var moment=require(_0x5d7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d7b('0x3'))['db'];var utils=require(_0x5d7b('0x4'));var logger=require(_0x5d7b('0x5'))(_0x5d7b('0x6'));var config=require(_0x5d7b('0x7'));var jayson=require(_0x5d7b('0x8'));var client=jayson[_0x5d7b('0x9')][_0x5d7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x338a1f,_0x208c17,_0x1e7f57){return new BPromise(function(_0x74c818,_0x542cad){return client['request'](_0x338a1f,_0x1e7f57)[_0x5d7b('0xb')](function(_0x2df3e9){logger['info'](_0x5d7b('0xc'),_0x208c17,_0x5d7b('0xd'));logger[_0x5d7b('0xe')](_0x5d7b('0xf'),_0x208c17,_0x5d7b('0xd'),JSON['stringify'](_0x2df3e9));if(_0x2df3e9[_0x5d7b('0x10')]){if(_0x2df3e9[_0x5d7b('0x10')][_0x5d7b('0x11')]===0x1f4){logger[_0x5d7b('0x10')](_0x5d7b('0xc'),_0x208c17,_0x2df3e9[_0x5d7b('0x10')]['message']);return _0x542cad(_0x2df3e9[_0x5d7b('0x10')][_0x5d7b('0x12')]);}logger[_0x5d7b('0x10')](_0x5d7b('0xc'),_0x208c17,_0x2df3e9[_0x5d7b('0x10')][_0x5d7b('0x12')]);return _0x74c818(_0x2df3e9[_0x5d7b('0x10')]['message']);}else{logger[_0x5d7b('0x13')](_0x5d7b('0xc'),_0x208c17,_0x5d7b('0xd'));_0x74c818(_0x2df3e9[_0x5d7b('0x14')][_0x5d7b('0x12')]);}})[_0x5d7b('0x15')](function(_0x51297d){logger[_0x5d7b('0x10')](_0x5d7b('0xc'),_0x208c17,_0x51297d);_0x542cad(_0x51297d);});});}
\ No newline at end of file
+var _0x2e8e=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch'];(function(_0x4c5946,_0x2534eb){var _0x2e514b=function(_0x1a559d){while(--_0x1a559d){_0x4c5946['push'](_0x4c5946['shift']());}};_0x2e514b(++_0x2534eb);}(_0x2e8e,0x1cc));var _0xe2e8=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x2e8e[_0x36fbef];return _0x45e270;};'use strict';var _=require(_0xe2e8('0x0'));var util=require('util');var moment=require(_0xe2e8('0x1'));var BPromise=require(_0xe2e8('0x2'));var rs=require(_0xe2e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2e8('0x4'))['db'];var utils=require(_0xe2e8('0x5'));var logger=require(_0xe2e8('0x6'))(_0xe2e8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe2e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5640b0,_0x5172b5,_0x461df5){return new BPromise(function(_0x1243d5,_0xe3bbf4){return client[_0xe2e8('0x9')](_0x5640b0,_0x461df5)['then'](function(_0x50bf40){logger[_0xe2e8('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x5172b5,_0xe2e8('0xb'));logger[_0xe2e8('0xc')](_0xe2e8('0xd'),_0x5172b5,_0xe2e8('0xb'),JSON[_0xe2e8('0xe')](_0x50bf40));if(_0x50bf40['error']){if(_0x50bf40[_0xe2e8('0xf')][_0xe2e8('0x10')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5172b5,_0x50bf40[_0xe2e8('0xf')]['message']);return _0xe3bbf4(_0x50bf40[_0xe2e8('0xf')]['message']);}logger['error'](_0xe2e8('0x11'),_0x5172b5,_0x50bf40[_0xe2e8('0xf')]['message']);return _0x1243d5(_0x50bf40[_0xe2e8('0xf')][_0xe2e8('0x12')]);}else{logger['info'](_0xe2e8('0x11'),_0x5172b5,_0xe2e8('0xb'));_0x1243d5(_0x50bf40['result'][_0xe2e8('0x12')]);}})[_0xe2e8('0x13')](function(_0x1bb43c){logger[_0xe2e8('0xf')](_0xe2e8('0x11'),_0x5172b5,_0x1bb43c);_0xe3bbf4(_0x1bb43c);});});}
\ No newline at end of file
index 0443c7d..2fd8335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf646=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/sounds','create','post','addSound','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0xf646,0x11e));var _0x6f64=function(_0x5b3772,_0x32b70a){_0x5b3772=_0x5b3772-0x0;var _0x5b80cf=_0xf646[_0x5b3772];return _0x5b80cf;};'use strict';var multer=require(_0x6f64('0x0'));var util=require(_0x6f64('0x1'));var path=require(_0x6f64('0x2'));var timeout=require(_0x6f64('0x3'));var express=require(_0x6f64('0x4'));var router=express[_0x6f64('0x5')]();var fs_extra=require(_0x6f64('0x6'));var auth=require(_0x6f64('0x7'));var interaction=require(_0x6f64('0x8'));var config=require(_0x6f64('0x9'));var controller=require('./voiceMusicOnHold.controller');router[_0x6f64('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6f64('0xa')](_0x6f64('0xb'),auth[_0x6f64('0xc')](),controller[_0x6f64('0xd')]);router[_0x6f64('0xa')](_0x6f64('0xe'),auth[_0x6f64('0xc')](),controller['getSounds']);router['post']('/',auth[_0x6f64('0xc')](),controller[_0x6f64('0xf')]);router[_0x6f64('0x10')](_0x6f64('0xe'),auth[_0x6f64('0xc')](),controller[_0x6f64('0x11')]);router['put']('/:id',auth[_0x6f64('0xc')](),controller[_0x6f64('0x12')]);router[_0x6f64('0x13')]('/:id',auth[_0x6f64('0xc')](),controller[_0x6f64('0x14')]);router[_0x6f64('0x13')]('/:id/sounds/:id2',auth[_0x6f64('0xc')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
+var _0x5e9f=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','put','delete','destroy','removeSound','exports','multer','util'];(function(_0xced8c0,_0x16843b){var _0x1a7035=function(_0x3de42e){while(--_0x3de42e){_0xced8c0['push'](_0xced8c0['shift']());}};_0x1a7035(++_0x16843b);}(_0x5e9f,0x148));var _0xf5e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5e9f[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xf5e9('0x0'));var util=require(_0xf5e9('0x1'));var path=require('path');var timeout=require(_0xf5e9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf5e9('0x3'));var auth=require(_0xf5e9('0x4'));var interaction=require(_0xf5e9('0x5'));var config=require(_0xf5e9('0x6'));var controller=require(_0xf5e9('0x7'));router[_0xf5e9('0x8')]('/',auth[_0xf5e9('0x9')](),controller[_0xf5e9('0xa')]);router[_0xf5e9('0x8')](_0xf5e9('0xb'),auth[_0xf5e9('0x9')](),controller[_0xf5e9('0xc')]);router['get'](_0xf5e9('0xd'),auth['isAuthenticated'](),controller[_0xf5e9('0xe')]);router['post']('/',auth[_0xf5e9('0x9')](),controller[_0xf5e9('0xf')]);router[_0xf5e9('0x10')](_0xf5e9('0xd'),auth[_0xf5e9('0x9')](),controller['addSound']);router[_0xf5e9('0x11')](_0xf5e9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf5e9('0x12')](_0xf5e9('0xb'),auth['isAuthenticated'](),controller[_0xf5e9('0x13')]);router[_0xf5e9('0x12')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xf5e9('0x14')]);module[_0xf5e9('0x15')]=router;
\ No newline at end of file
index 46f83eb..c940afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d44=['custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM'];(function(_0x1ad8c5,_0x219a1f){var _0x5d93b6=function(_0x256bb8){while(--_0x256bb8){_0x1ad8c5['push'](_0x1ad8c5['shift']());}};_0x5d93b6(++_0x219a1f);}(_0x4d44,0x1dc));var _0x44d4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4d44[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module[_0x44d4('0x0')]={'name':{'type':Sequelize[_0x44d4('0x1')],'allowNull':![],'unique':_0x44d4('0x2')},'mode':{'type':Sequelize[_0x44d4('0x3')](_0x44d4('0x4'),_0x44d4('0x5'),_0x44d4('0x6'),_0x44d4('0x7'),'quietmp3',_0x44d4('0x8')),'allowNull':!![],'defaultValue':_0x44d4('0x5')},'directory':{'type':Sequelize[_0x44d4('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x44d4('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x44d4('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x44d4('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x44d4('0xa')},'defaultEntry':{'type':Sequelize[_0x44d4('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3a29=['STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0xfb6365,_0x254126){var _0x39dcc3=function(_0x23b120){while(--_0x23b120){_0xfb6365['push'](_0xfb6365['shift']());}};_0x39dcc3(++_0x254126);}(_0x3a29,0x178));var _0x93a2=function(_0x284e9b,_0x18622b){_0x284e9b=_0x284e9b-0x0;var _0x491fcd=_0x3a29[_0x284e9b];return _0x491fcd;};'use strict';var Sequelize=require(_0x93a2('0x0'));module[_0x93a2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x93a2('0x2')](_0x93a2('0x3'),_0x93a2('0x4'),_0x93a2('0x5'),'quietmp3nb',_0x93a2('0x6'),_0x93a2('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x93a2('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x93a2('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x93a2('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x93a2('0x8')],'allowNull':!![],'defaultValue':_0x93a2('0x9')},'format':{'type':Sequelize[_0x93a2('0x8')],'allowNull':!![]},'stamp':{'type':_0x93a2('0xa')},'defaultEntry':{'type':Sequelize[_0x93a2('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index a7b896d..a924638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x651a=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','MusicOnHolds','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','VoiceMusicOnHold','length','find','update','body','transaction','mode','files','directory','join','root','create','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','server/files/moh','%s.%s','Sequelize','removeSound','id2','message','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x651a,0x1be));var _0xa651=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0x651a[_0xa0be1c];return _0x546eec;};'use strict';var emlformat=require(_0xa651('0x0'));var rimraf=require(_0xa651('0x1'));var zipdir=require(_0xa651('0x2'));var jsonpatch=require(_0xa651('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa651('0x4'));var Mustache=require(_0xa651('0x5'));var util=require('util');var path=require(_0xa651('0x6'));var sox=require(_0xa651('0x7'));var csv=require(_0xa651('0x8'));var ejs=require(_0xa651('0x9'));var fs=require('fs');var fs_extra=require(_0xa651('0xa'));var _=require(_0xa651('0xb'));var squel=require(_0xa651('0xc'));var crypto=require(_0xa651('0xd'));var jsforce=require(_0xa651('0xe'));var deskjs=require(_0xa651('0xf'));var toCsv=require(_0xa651('0x8'));var querystring=require(_0xa651('0x10'));var Papa=require(_0xa651('0x11'));var Redis=require('ioredis');var authService=require(_0xa651('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa651('0x13'));var hardwareService=require(_0xa651('0x14'));var logger=require(_0xa651('0x15'))(_0xa651('0x16'));var utils=require(_0xa651('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa651('0x18'));var db=require(_0xa651('0x19'))['db'];function respondWithStatusCode(_0xd60f2,_0xbb1620){_0xbb1620=_0xbb1620||0xcc;return function(_0x5464f6){if(_0x5464f6){return _0xd60f2[_0xa651('0x1a')](_0xbb1620);}return _0xd60f2['status'](_0xbb1620)[_0xa651('0x1b')]();};}function respondWithResult(_0x461a06,_0x53a26b){_0x53a26b=_0x53a26b||0xc8;return function(_0x45f3d1){if(_0x45f3d1){return _0x461a06[_0xa651('0x1c')](_0x53a26b)[_0xa651('0x1d')](_0x45f3d1);}};}function respondWithFilteredResult(_0x425408,_0x12ddb1){return function(_0x14700a){if(_0x14700a){var _0xe8aa16=typeof _0x12ddb1[_0xa651('0x1e')]===_0xa651('0x1f')&&typeof _0x12ddb1[_0xa651('0x20')]===_0xa651('0x1f');var _0x3ccd4a=_0x14700a[_0xa651('0x21')];var _0x47a964=_0xe8aa16?0x0:_0x12ddb1[_0xa651('0x1e')];var _0x195c83=_0xe8aa16?_0x14700a[_0xa651('0x21')]:_0x12ddb1['offset']+_0x12ddb1[_0xa651('0x20')];var _0x454904;if(_0x195c83>=_0x3ccd4a){_0x195c83=_0x3ccd4a;_0x454904=0xc8;}else{_0x454904=0xce;}_0x425408['status'](_0x454904);return _0x425408[_0xa651('0x22')](_0xa651('0x23'),_0x47a964+'-'+_0x195c83+'/'+_0x3ccd4a)['json'](_0x14700a);}return null;};}function patchUpdates(_0x11d856){return function(_0x40d79f){try{jsonpatch[_0xa651('0x24')](_0x40d79f,_0x11d856,!![]);}catch(_0xdeb562){return BPromise[_0xa651('0x25')](_0xdeb562);}return _0x40d79f['save']();};}function saveUpdates(_0x5aa6db,_0x275c25){return function(_0x243bb6){if(_0x243bb6){return _0x243bb6['update'](_0x5aa6db)['then'](function(_0x47e442){return _0x47e442;});}return null;};}function removeEntity(_0x2f43be,_0x28c570){return function(_0x129f75){if(_0x129f75){return _0x129f75[_0xa651('0x26')]()[_0xa651('0x27')](function(){var _0x4ca087=_0x129f75[_0xa651('0x28')]({'plain':!![]});var _0x3201b0=_0xa651('0x29');return db['UserProfileResource'][_0xa651('0x26')]({'where':{'type':_0x3201b0,'resourceId':_0x4ca087['id']}})[_0xa651('0x27')](function(){return _0x129f75;});})[_0xa651('0x27')](function(){_0x2f43be[_0xa651('0x1c')](0xcc)[_0xa651('0x1b')]();});}};}function handleEntityNotFound(_0xf3ef19,_0x42a4a2){return function(_0x5604cb){if(!_0x5604cb){_0xf3ef19[_0xa651('0x1a')](0x194);}return _0x5604cb;};}function handleError(_0x338759,_0x445d36){_0x445d36=_0x445d36||0x1f4;return function(_0x312e82){logger[_0xa651('0x2a')](_0x312e82[_0xa651('0x2b')]);if(_0x312e82[_0xa651('0x2c')]){delete _0x312e82[_0xa651('0x2c')];}_0x338759['status'](_0x445d36)[_0xa651('0x2d')](_0x312e82);};}exports[_0xa651('0x2e')]=function(_0x560552,_0x2c034a){var _0x4bd503={},_0x2a6af3={},_0x268a65={'count':0x0,'rows':[]};var _0x961e1d=_['map'](db['VoiceMusicOnHold'][_0xa651('0x2f')],function(_0x4ce1cd){return{'name':_0x4ce1cd[_0xa651('0x30')],'type':_0x4ce1cd[_0xa651('0x31')][_0xa651('0x32')]};});_0x2a6af3[_0xa651('0x33')]=_[_0xa651('0x34')](_0x961e1d,'name');_0x2a6af3[_0xa651('0x35')]=_['keys'](_0x560552[_0xa651('0x35')]);_0x2a6af3[_0xa651('0x36')]=_[_0xa651('0x37')](_0x2a6af3['model'],_0x2a6af3['query']);_0x4bd503[_0xa651('0x38')]=_[_0xa651('0x37')](_0x2a6af3[_0xa651('0x33')],qs[_0xa651('0x39')](_0x560552[_0xa651('0x35')][_0xa651('0x39')]));_0x4bd503[_0xa651('0x38')]=_0x4bd503['attributes']['length']?_0x4bd503[_0xa651('0x38')]:_0x2a6af3[_0xa651('0x33')];if(!_0x560552[_0xa651('0x35')]['hasOwnProperty'](_0xa651('0x3a'))){_0x4bd503[_0xa651('0x20')]=qs[_0xa651('0x20')](_0x560552[_0xa651('0x35')][_0xa651('0x20')]);_0x4bd503[_0xa651('0x1e')]=qs[_0xa651('0x1e')](_0x560552['query'][_0xa651('0x1e')]);}_0x4bd503[_0xa651('0x3b')]=qs['sort'](_0x560552[_0xa651('0x35')][_0xa651('0x3c')]);delete _0x560552[_0xa651('0x35')][_0xa651('0x3c')];_0x4bd503[_0xa651('0x3d')]=qs[_0xa651('0x36')](_[_0xa651('0x3e')](_0x560552[_0xa651('0x35')],_0x2a6af3['filters']),_0x961e1d);if(_0x560552[_0xa651('0x35')]['filter']){_0x4bd503[_0xa651('0x3d')]=_['merge'](_0x4bd503[_0xa651('0x3d')],{'$or':_[_0xa651('0x34')](_0x961e1d,function(_0x25f1a4){if(_0x25f1a4['type']!==_0xa651('0x3f')){var _0x18d676={};_0x18d676[_0x25f1a4['name']]={'$like':'%'+_0x560552[_0xa651('0x35')]['filter']+'%'};return _0x18d676;}})});}_0x4bd503=_[_0xa651('0x40')]({},_0x4bd503,_0x560552[_0xa651('0x41')]);var _0x4b36e7={'where':_0x4bd503[_0xa651('0x3d')]};return db['VoiceMusicOnHold']['count'](_0x4b36e7)['then'](function(_0x2f095e){_0x268a65[_0xa651('0x21')]=_0x2f095e;if(_0x560552[_0xa651('0x35')][_0xa651('0x42')]){_0x4bd503[_0xa651('0x43')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xa651('0x44')](_0x4bd503);})[_0xa651('0x27')](function(_0x31b3){_0x268a65['rows']=_0x31b3;return _0x268a65;})['then'](respondWithFilteredResult(_0x2c034a,_0x4bd503))[_0xa651('0x45')](handleError(_0x2c034a,null));};exports[_0xa651('0x46')]=function(_0x5e7a59,_0x3915fe){var _0x31b527={'raw':![],'where':{'id':_0x5e7a59[_0xa651('0x47')]['id']}},_0x43af01={};_0x43af01[_0xa651('0x33')]=_[_0xa651('0x48')](db[_0xa651('0x49')]['rawAttributes']);_0x43af01['query']=_[_0xa651('0x48')](_0x5e7a59[_0xa651('0x35')]);_0x43af01[_0xa651('0x36')]=_[_0xa651('0x37')](_0x43af01[_0xa651('0x33')],_0x43af01['query']);_0x31b527['attributes']=_['intersection'](_0x43af01[_0xa651('0x33')],qs[_0xa651('0x39')](_0x5e7a59['query']['fields']));_0x31b527[_0xa651('0x38')]=_0x31b527[_0xa651('0x38')][_0xa651('0x4a')]?_0x31b527[_0xa651('0x38')]:_0x43af01[_0xa651('0x33')];if(_0x5e7a59[_0xa651('0x35')][_0xa651('0x42')]){_0x31b527['include']=[{'all':!![]}];}_0x31b527=_[_0xa651('0x40')]({},_0x31b527,_0x5e7a59[_0xa651('0x41')]);return db['VoiceMusicOnHold'][_0xa651('0x4b')](_0x31b527)[_0xa651('0x27')](handleEntityNotFound(_0x3915fe,null))[_0xa651('0x27')](respondWithResult(_0x3915fe,null))['catch'](handleError(_0x3915fe,null));};exports[_0xa651('0x4c')]=function(_0x4a1ef6,_0x31e598){if(_0x4a1ef6[_0xa651('0x4d')]['id']){delete _0x4a1ef6[_0xa651('0x4d')]['id'];}return db[_0xa651('0x49')][_0xa651('0x4b')]({'where':{'id':_0x4a1ef6[_0xa651('0x47')]['id']}})['then'](handleEntityNotFound(_0x31e598,null))[_0xa651('0x27')](saveUpdates(_0x4a1ef6[_0xa651('0x4d')],null))['then'](respondWithResult(_0x31e598,null))[_0xa651('0x45')](handleError(_0x31e598,null));};exports['create']=function(_0x1516b2,_0x4754d9,_0x2deac2){return db['sequelize'][_0xa651('0x4e')](function(_0x488359){if(_0x1516b2[_0xa651('0x4d')][_0xa651('0x4f')]===_0xa651('0x50')){_0x1516b2[_0xa651('0x4d')][_0xa651('0x51')]=path[_0xa651('0x52')](config[_0xa651('0x53')],'server/files/moh',_0x1516b2[_0xa651('0x4d')][_0xa651('0x2c')]);}return db[_0xa651('0x49')][_0xa651('0x54')](_0x1516b2[_0xa651('0x4d')],{'transaction':_0x488359})[_0xa651('0x27')](function(_0x5591a9){if(_0x1516b2['body'][_0xa651('0x4f')]===_0xa651('0x50')){fs['mkdirSync'](_0x5591a9['directory'],parseInt(_0xa651('0x55'),0x8));}var _0x2de638=_0x1516b2[_0xa651('0x56')][_0xa651('0x28')]({'plain':!![]});if(!_0x2de638)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2de638[_0xa651('0x57')]==='user'){var _0x218284=_0x5591a9[_0xa651('0x28')]({'plain':!![]});return db[_0xa651('0x58')][_0xa651('0x4b')]({'where':{'name':_0xa651('0x29'),'userProfileId':_0x2de638[_0xa651('0x59')]},'raw':!![]})[_0xa651('0x27')](function(_0x541c83){if(_0x541c83&&_0x541c83[_0xa651('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x218284['name'],'resourceId':_0x218284['id'],'type':_0x541c83['name'],'sectionId':_0x541c83['id']},{})['then'](function(){return _0x5591a9;});}else{return _0x5591a9;}})[_0xa651('0x45')](function(_0x3694f1){logger[_0xa651('0x2a')](_0xa651('0x5b'),_0x3694f1);});}return _0x5591a9;});})[_0xa651('0x27')](respondWithResult(_0x4754d9,0xc9))[_0xa651('0x45')](handleError(_0x4754d9,null));};exports[_0xa651('0x26')]=function(_0x1d857e,_0xcea47f,_0x51fa5d){var _0x1095d0;return db[_0xa651('0x49')][_0xa651('0x4b')]({'where':{'id':_0x1d857e[_0xa651('0x47')]['id']}})['then'](function(_0x18614f){if(_0x18614f){return db[_0xa651('0x5c')]['transaction'](function(_0x39d896){return _0x18614f[_0xa651('0x26')]({'transaction':_0x39d896,'raw':!![]})[_0xa651('0x27')](function(_0x27aabc){if(_0x27aabc[_0xa651('0x51')]){fs[_0xa651('0x5d')](_0x27aabc[_0xa651('0x51')])[_0xa651('0x5e')](function(_0x2bbed3){fs['unlinkSync'](path[_0xa651('0x52')](_0x27aabc[_0xa651('0x51')],_0x2bbed3));});fs[_0xa651('0x5f')](_0x27aabc['directory']);}return _0x27aabc;});})[_0xa651('0x45')](function(_0x168260){throw new db['Sequelize'][(_0xa651('0x60'))](_0x168260['message']);});}})['then'](handleEntityNotFound(_0xcea47f,null))[_0xa651('0x27')](removeEntity(_0xcea47f,null))[_0xa651('0x45')](handleError(_0xcea47f,null));};exports[_0xa651('0x61')]=function(_0x21e7ae,_0x4a64bf,_0x3033b4){return db[_0xa651('0x5c')][_0xa651('0x4e')](function(_0x23e0d2){var _0x614d0f;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x21e7ae[_0xa651('0x47')]['id']}})['then'](function(_0x57e11b){if(_0x57e11b){_0x614d0f=_0x57e11b;return _0x57e11b['addSound'](_0x21e7ae[_0xa651('0x4d')]['id'],{'transaction':_0x23e0d2});}})['then'](function(_0x5a6445){if(_0x5a6445){return db[_0xa651('0x62')][_0xa651('0x63')]({'where':{'id':_0x21e7ae['body']['id']},'attributes':['id',_0xa651('0x2c'),_0xa651('0x64'),_0xa651('0x65'),_0xa651('0x66')],'raw':!![]});}})[_0xa651('0x27')](function(_0x32bbff){if(_0x32bbff){var _0x185638=path[_0xa651('0x52')](config[_0xa651('0x53')],_0xa651('0x67'),util[_0xa651('0x68')]('%s.%s',path[_0xa651('0x69')](_0x32bbff[_0xa651('0x64')],path[_0xa651('0x6a')](_0x32bbff[_0xa651('0x64')])),_0x32bbff[_0xa651('0x65')]));var _0x31fb81=path[_0xa651('0x52')](config[_0xa651('0x53')],_0xa651('0x6b'),_0x614d0f[_0xa651('0x2c')],util['format'](_0xa651('0x6c'),_0x32bbff[_0xa651('0x2c')],_0x32bbff[_0xa651('0x65')]));fs['symlinkSync'](_0x185638,_0x31fb81);return _0x32bbff;}})['catch'](function(_0x6b3fdb){throw new db[(_0xa651('0x6d'))][(_0xa651('0x60'))](_0x6b3fdb['message']);});})[_0xa651('0x27')](handleEntityNotFound(_0x4a64bf,null))[_0xa651('0x27')](respondWithResult(_0x4a64bf,0xc9))[_0xa651('0x45')](handleError(_0x4a64bf,null));};exports[_0xa651('0x6e')]=function(_0x5ef85e,_0x87e7c8,_0x50157a){return db[_0xa651('0x5c')][_0xa651('0x4e')](function(_0x10c60b){var _0x155860;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5ef85e[_0xa651('0x47')]['id']}})[_0xa651('0x27')](handleEntityNotFound(_0x87e7c8,null))[_0xa651('0x27')](function(_0x366f67){if(_0x366f67){_0x155860=_0x366f67;return _0x366f67[_0xa651('0x6e')](_0x5ef85e[_0xa651('0x47')][_0xa651('0x6f')]);}})[_0xa651('0x27')](function(_0x64e742){if(_0x64e742){return db[_0xa651('0x62')][_0xa651('0x63')]({'where':{'id':_0x5ef85e[_0xa651('0x47')][_0xa651('0x6f')]},'attributes':['id','name',_0xa651('0x64'),_0xa651('0x65'),_0xa651('0x66')],'raw':!![]});}})[_0xa651('0x27')](function(_0x5e3777){if(_0x5e3777){fs['unlinkSync'](path[_0xa651('0x52')](_0x155860['directory'],util[_0xa651('0x68')](_0xa651('0x6c'),_0x5e3777['name'],_0x5e3777[_0xa651('0x65')])));return _0x5e3777;}})[_0xa651('0x45')](function(_0x5ad41c){throw new db[(_0xa651('0x6d'))][(_0xa651('0x60'))](_0x5ad41c[_0xa651('0x70')]);});})[_0xa651('0x27')](handleEntityNotFound(_0x87e7c8,null))[_0xa651('0x27')](respondWithStatusCode(_0x87e7c8,0xcc))[_0xa651('0x45')](handleError(_0x87e7c8,null));};exports[_0xa651('0x71')]=function(_0x231bf4,_0xb3990c,_0x49dd93){var _0x375e06={};var _0x46920c={};var _0x1d2004;var _0x556d8a;return db[_0xa651('0x49')]['findOne']({'where':{'id':_0x231bf4[_0xa651('0x47')]['id']}})['then'](handleEntityNotFound(_0xb3990c,null))[_0xa651('0x27')](function(_0x51c30e){if(_0x51c30e){_0x1d2004=_0x51c30e;_0x46920c[_0xa651('0x33')]=_[_0xa651('0x48')](db['Sound'][_0xa651('0x2f')]);_0x46920c[_0xa651('0x35')]=_[_0xa651('0x48')](_0x231bf4[_0xa651('0x35')]);_0x46920c[_0xa651('0x36')]=_[_0xa651('0x37')](_0x46920c[_0xa651('0x33')],_0x46920c[_0xa651('0x35')]);_0x375e06['attributes']=_[_0xa651('0x37')](_0x46920c[_0xa651('0x33')],qs['fields'](_0x231bf4[_0xa651('0x35')][_0xa651('0x39')]));_0x375e06[_0xa651('0x38')]=_0x375e06[_0xa651('0x38')][_0xa651('0x4a')]?_0x375e06['attributes']:_0x46920c[_0xa651('0x33')];_0x375e06[_0xa651('0x3b')]=qs[_0xa651('0x3c')](_0x231bf4[_0xa651('0x35')][_0xa651('0x3c')]);_0x375e06[_0xa651('0x3d')]=qs[_0xa651('0x36')](_['pick'](_0x231bf4[_0xa651('0x35')],_0x46920c[_0xa651('0x36')]));if(_0x231bf4[_0xa651('0x35')]['filter']){_0x375e06[_0xa651('0x3d')]=_[_0xa651('0x40')](_0x375e06[_0xa651('0x3d')],{'$or':_['map'](_0x375e06[_0xa651('0x38')],function(_0x5c7de8){var _0x58eb76={};_0x58eb76[_0x5c7de8]={'$like':'%'+_0x231bf4['query']['filter']+'%'};return _0x58eb76;})});}_0x375e06=_[_0xa651('0x40')]({},_0x375e06,_0x231bf4[_0xa651('0x41')]);return _0x1d2004['getSounds'](_0x375e06);}})[_0xa651('0x27')](function(_0x55b621){if(_0x55b621){_0x556d8a=_0x55b621[_0xa651('0x4a')];if(!_0x231bf4[_0xa651('0x35')][_0xa651('0x72')](_0xa651('0x3a'))){_0x375e06['limit']=qs[_0xa651('0x20')](_0x231bf4[_0xa651('0x35')]['limit']);_0x375e06[_0xa651('0x1e')]=qs[_0xa651('0x1e')](_0x231bf4[_0xa651('0x35')][_0xa651('0x1e')]);}return _0x1d2004[_0xa651('0x71')](_0x375e06);}})[_0xa651('0x27')](function(_0x2ad510){if(_0x2ad510){return _0x2ad510?{'count':_0x556d8a,'rows':_0x2ad510}:null;}})[_0xa651('0x27')](respondWithResult(_0xb3990c,null))[_0xa651('0x45')](handleError(_0xb3990c,null));};
\ No newline at end of file
+var _0x7920=['files','directory','join','mkdirSync','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','Sequelize','removeSound','id2','unlinkSync','getSounds','order','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','MusicOnHolds','error','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','VoiceMusicOnHold','includeAll','include','findAll','rows','params','fields','find','catch','body','create','transaction','mode'];(function(_0xda88dd,_0x1f166c){var _0x10803e=function(_0x1f200e){while(--_0x1f200e){_0xda88dd['push'](_0xda88dd['shift']());}};_0x10803e(++_0x1f166c);}(_0x7920,0x94));var _0x0792=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x7920[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0792('0x0'));var zipdir=require(_0x0792('0x1'));var jsonpatch=require(_0x0792('0x2'));var rp=require('request-promise');var moment=require(_0x0792('0x3'));var BPromise=require(_0x0792('0x4'));var Mustache=require(_0x0792('0x5'));var util=require(_0x0792('0x6'));var path=require(_0x0792('0x7'));var sox=require(_0x0792('0x8'));var csv=require(_0x0792('0x9'));var ejs=require(_0x0792('0xa'));var fs=require('fs');var fs_extra=require(_0x0792('0xb'));var _=require(_0x0792('0xc'));var squel=require(_0x0792('0xd'));var crypto=require('crypto');var jsforce=require(_0x0792('0xe'));var deskjs=require(_0x0792('0xf'));var toCsv=require(_0x0792('0x9'));var querystring=require(_0x0792('0x10'));var Papa=require(_0x0792('0x11'));var Redis=require(_0x0792('0x12'));var authService=require(_0x0792('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0792('0x14'));var hardwareService=require(_0x0792('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0792('0x16'));var config=require(_0x0792('0x17'));var licenseUtil=require(_0x0792('0x18'));var db=require(_0x0792('0x19'))['db'];function respondWithStatusCode(_0x5c19e9,_0x523014){_0x523014=_0x523014||0xcc;return function(_0x2b942e){if(_0x2b942e){return _0x5c19e9[_0x0792('0x1a')](_0x523014);}return _0x5c19e9[_0x0792('0x1b')](_0x523014)[_0x0792('0x1c')]();};}function respondWithResult(_0x5d8f31,_0x43431d){_0x43431d=_0x43431d||0xc8;return function(_0x2f2e12){if(_0x2f2e12){return _0x5d8f31[_0x0792('0x1b')](_0x43431d)[_0x0792('0x1d')](_0x2f2e12);}};}function respondWithFilteredResult(_0xd4d32b,_0x4ad8b8){return function(_0x343553){if(_0x343553){var _0x50483a=typeof _0x4ad8b8[_0x0792('0x1e')]==='undefined'&&typeof _0x4ad8b8[_0x0792('0x1f')]===_0x0792('0x20');var _0x5cac09=_0x343553[_0x0792('0x21')];var _0x374a39=_0x50483a?0x0:_0x4ad8b8[_0x0792('0x1e')];var _0x52197b=_0x50483a?_0x343553['count']:_0x4ad8b8[_0x0792('0x1e')]+_0x4ad8b8[_0x0792('0x1f')];var _0x2595b2;if(_0x52197b>=_0x5cac09){_0x52197b=_0x5cac09;_0x2595b2=0xc8;}else{_0x2595b2=0xce;}_0xd4d32b['status'](_0x2595b2);return _0xd4d32b['set'](_0x0792('0x22'),_0x374a39+'-'+_0x52197b+'/'+_0x5cac09)[_0x0792('0x1d')](_0x343553);}return null;};}function patchUpdates(_0x2fda95){return function(_0x5f2c2f){try{jsonpatch[_0x0792('0x23')](_0x5f2c2f,_0x2fda95,!![]);}catch(_0x1eecba){return BPromise['reject'](_0x1eecba);}return _0x5f2c2f[_0x0792('0x24')]();};}function saveUpdates(_0x2b319f,_0x42e3f2){return function(_0x457536){if(_0x457536){return _0x457536[_0x0792('0x25')](_0x2b319f)[_0x0792('0x26')](function(_0xa6c76b){return _0xa6c76b;});}return null;};}function removeEntity(_0x47a9c4,_0x1a624f){return function(_0x51e6b7){if(_0x51e6b7){return _0x51e6b7[_0x0792('0x27')]()['then'](function(){var _0x1333eb=_0x51e6b7['get']({'plain':!![]});var _0x3d2dac=_0x0792('0x28');return db['UserProfileResource'][_0x0792('0x27')]({'where':{'type':_0x3d2dac,'resourceId':_0x1333eb['id']}})[_0x0792('0x26')](function(){return _0x51e6b7;});})[_0x0792('0x26')](function(){_0x47a9c4[_0x0792('0x1b')](0xcc)[_0x0792('0x1c')]();});}};}function handleEntityNotFound(_0x567cf9,_0x9b473b){return function(_0x54c65c){if(!_0x54c65c){_0x567cf9['sendStatus'](0x194);}return _0x54c65c;};}function handleError(_0x4e7f76,_0x595680){_0x595680=_0x595680||0x1f4;return function(_0x79c544){logger[_0x0792('0x29')](_0x79c544['stack']);if(_0x79c544[_0x0792('0x2a')]){delete _0x79c544['name'];}_0x4e7f76[_0x0792('0x1b')](_0x595680)[_0x0792('0x2b')](_0x79c544);};}exports[_0x0792('0x2c')]=function(_0xfd14cf,_0x4ee87e){var _0xc853d2={},_0x235b21={},_0x2083c5={'count':0x0,'rows':[]};var _0x2011ba=_['map'](db['VoiceMusicOnHold'][_0x0792('0x2d')],function(_0x48c2ac){return{'name':_0x48c2ac['fieldName'],'type':_0x48c2ac[_0x0792('0x2e')]['key']};});_0x235b21[_0x0792('0x2f')]=_[_0x0792('0x30')](_0x2011ba,_0x0792('0x2a'));_0x235b21[_0x0792('0x31')]=_[_0x0792('0x32')](_0xfd14cf['query']);_0x235b21[_0x0792('0x33')]=_[_0x0792('0x34')](_0x235b21['model'],_0x235b21[_0x0792('0x31')]);_0xc853d2[_0x0792('0x35')]=_[_0x0792('0x34')](_0x235b21[_0x0792('0x2f')],qs['fields'](_0xfd14cf[_0x0792('0x31')]['fields']));_0xc853d2[_0x0792('0x35')]=_0xc853d2[_0x0792('0x35')][_0x0792('0x36')]?_0xc853d2[_0x0792('0x35')]:_0x235b21[_0x0792('0x2f')];if(!_0xfd14cf[_0x0792('0x31')][_0x0792('0x37')](_0x0792('0x38'))){_0xc853d2[_0x0792('0x1f')]=qs[_0x0792('0x1f')](_0xfd14cf[_0x0792('0x31')]['limit']);_0xc853d2['offset']=qs['offset'](_0xfd14cf[_0x0792('0x31')][_0x0792('0x1e')]);}_0xc853d2['order']=qs['sort'](_0xfd14cf[_0x0792('0x31')][_0x0792('0x39')]);delete _0xfd14cf[_0x0792('0x31')][_0x0792('0x39')];_0xc853d2[_0x0792('0x3a')]=qs[_0x0792('0x33')](_['pick'](_0xfd14cf[_0x0792('0x31')],_0x235b21[_0x0792('0x33')]),_0x2011ba);if(_0xfd14cf[_0x0792('0x31')]['filter']){_0xc853d2['where']=_[_0x0792('0x3b')](_0xc853d2['where'],{'$or':_['map'](_0x2011ba,function(_0x18d230){if(_0x18d230['type']!==_0x0792('0x3c')){var _0xf06bf={};_0xf06bf[_0x18d230['name']]={'$like':'%'+_0xfd14cf[_0x0792('0x31')][_0x0792('0x3d')]+'%'};return _0xf06bf;}})});}_0xc853d2=_['merge']({},_0xc853d2,_0xfd14cf[_0x0792('0x3e')]);var _0x3459f7={'where':_0xc853d2[_0x0792('0x3a')]};return db[_0x0792('0x3f')][_0x0792('0x21')](_0x3459f7)[_0x0792('0x26')](function(_0x52723d){_0x2083c5[_0x0792('0x21')]=_0x52723d;if(_0xfd14cf[_0x0792('0x31')][_0x0792('0x40')]){_0xc853d2[_0x0792('0x41')]=[{'all':!![]}];}return db[_0x0792('0x3f')][_0x0792('0x42')](_0xc853d2);})['then'](function(_0x4604fa){_0x2083c5[_0x0792('0x43')]=_0x4604fa;return _0x2083c5;})[_0x0792('0x26')](respondWithFilteredResult(_0x4ee87e,_0xc853d2))['catch'](handleError(_0x4ee87e,null));};exports['show']=function(_0xd26bbc,_0x49d673){var _0x4a9166={'raw':![],'where':{'id':_0xd26bbc[_0x0792('0x44')]['id']}},_0x5bbdcd={};_0x5bbdcd[_0x0792('0x2f')]=_[_0x0792('0x32')](db[_0x0792('0x3f')][_0x0792('0x2d')]);_0x5bbdcd[_0x0792('0x31')]=_[_0x0792('0x32')](_0xd26bbc['query']);_0x5bbdcd[_0x0792('0x33')]=_['intersection'](_0x5bbdcd[_0x0792('0x2f')],_0x5bbdcd[_0x0792('0x31')]);_0x4a9166[_0x0792('0x35')]=_[_0x0792('0x34')](_0x5bbdcd['model'],qs['fields'](_0xd26bbc[_0x0792('0x31')][_0x0792('0x45')]));_0x4a9166[_0x0792('0x35')]=_0x4a9166['attributes'][_0x0792('0x36')]?_0x4a9166[_0x0792('0x35')]:_0x5bbdcd[_0x0792('0x2f')];if(_0xd26bbc[_0x0792('0x31')]['includeAll']){_0x4a9166[_0x0792('0x41')]=[{'all':!![]}];}_0x4a9166=_[_0x0792('0x3b')]({},_0x4a9166,_0xd26bbc['options']);return db['VoiceMusicOnHold'][_0x0792('0x46')](_0x4a9166)[_0x0792('0x26')](handleEntityNotFound(_0x49d673,null))['then'](respondWithResult(_0x49d673,null))[_0x0792('0x47')](handleError(_0x49d673,null));};exports[_0x0792('0x25')]=function(_0x5eb613,_0x4de4bc){if(_0x5eb613[_0x0792('0x48')]['id']){delete _0x5eb613[_0x0792('0x48')]['id'];}return db[_0x0792('0x3f')]['find']({'where':{'id':_0x5eb613[_0x0792('0x44')]['id']}})[_0x0792('0x26')](handleEntityNotFound(_0x4de4bc,null))[_0x0792('0x26')](saveUpdates(_0x5eb613[_0x0792('0x48')],null))[_0x0792('0x26')](respondWithResult(_0x4de4bc,null))['catch'](handleError(_0x4de4bc,null));};exports[_0x0792('0x49')]=function(_0x5df1d5,_0x5be11f,_0xfca6cd){return db['sequelize'][_0x0792('0x4a')](function(_0x190f45){if(_0x5df1d5[_0x0792('0x48')][_0x0792('0x4b')]===_0x0792('0x4c')){_0x5df1d5[_0x0792('0x48')][_0x0792('0x4d')]=path[_0x0792('0x4e')](config['root'],'server/files/moh',_0x5df1d5[_0x0792('0x48')][_0x0792('0x2a')]);}return db[_0x0792('0x3f')][_0x0792('0x49')](_0x5df1d5['body'],{'transaction':_0x190f45})[_0x0792('0x26')](function(_0x17841a){if(_0x5df1d5['body'][_0x0792('0x4b')]===_0x0792('0x4c')){fs[_0x0792('0x4f')](_0x17841a['directory'],parseInt('0777',0x8));}var _0x44f868=_0x5df1d5['user']['get']({'plain':!![]});if(!_0x44f868)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44f868[_0x0792('0x50')]===_0x0792('0x51')){var _0xe0731e=_0x17841a[_0x0792('0x52')]({'plain':!![]});return db[_0x0792('0x53')][_0x0792('0x46')]({'where':{'name':_0x0792('0x28'),'userProfileId':_0x44f868[_0x0792('0x54')]},'raw':!![]})[_0x0792('0x26')](function(_0x1b7e22){if(_0x1b7e22&&_0x1b7e22[_0x0792('0x55')]===0x0){return db['UserProfileResource'][_0x0792('0x49')]({'name':_0xe0731e[_0x0792('0x2a')],'resourceId':_0xe0731e['id'],'type':_0x1b7e22['name'],'sectionId':_0x1b7e22['id']},{})['then'](function(){return _0x17841a;});}else{return _0x17841a;}})[_0x0792('0x47')](function(_0x4b1614){logger['error'](_0x0792('0x56'),_0x4b1614);});}return _0x17841a;});})['then'](respondWithResult(_0x5be11f,0xc9))[_0x0792('0x47')](handleError(_0x5be11f,null));};exports[_0x0792('0x27')]=function(_0x280db4,_0x2199cf,_0x43c7fa){var _0x17bec6;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x280db4[_0x0792('0x44')]['id']}})[_0x0792('0x26')](function(_0xf9807f){if(_0xf9807f){return db[_0x0792('0x57')][_0x0792('0x4a')](function(_0x285bd4){return _0xf9807f[_0x0792('0x27')]({'transaction':_0x285bd4,'raw':!![]})['then'](function(_0x57d3e3){if(_0x57d3e3[_0x0792('0x4d')]){fs[_0x0792('0x58')](_0x57d3e3[_0x0792('0x4d')])[_0x0792('0x59')](function(_0x1b9289){fs['unlinkSync'](path[_0x0792('0x4e')](_0x57d3e3[_0x0792('0x4d')],_0x1b9289));});fs[_0x0792('0x5a')](_0x57d3e3[_0x0792('0x4d')]);}return _0x57d3e3;});})[_0x0792('0x47')](function(_0x43989a){throw new db['Sequelize'][(_0x0792('0x5b'))](_0x43989a[_0x0792('0x5c')]);});}})[_0x0792('0x26')](handleEntityNotFound(_0x2199cf,null))[_0x0792('0x26')](removeEntity(_0x2199cf,null))[_0x0792('0x47')](handleError(_0x2199cf,null));};exports[_0x0792('0x5d')]=function(_0x1eb08c,_0x330587,_0x1e63ff){return db[_0x0792('0x57')]['transaction'](function(_0x16f64e){var _0x5d478c;return db[_0x0792('0x3f')]['find']({'where':{'id':_0x1eb08c[_0x0792('0x44')]['id']}})['then'](function(_0x27a923){if(_0x27a923){_0x5d478c=_0x27a923;return _0x27a923[_0x0792('0x5d')](_0x1eb08c[_0x0792('0x48')]['id'],{'transaction':_0x16f64e});}})['then'](function(_0x3cf611){if(_0x3cf611){return db[_0x0792('0x5e')][_0x0792('0x5f')]({'where':{'id':_0x1eb08c['body']['id']},'attributes':['id',_0x0792('0x2a'),_0x0792('0x60'),_0x0792('0x61'),_0x0792('0x62')],'raw':!![]});}})['then'](function(_0x23c295){if(_0x23c295){var _0x58671b=path['join'](config[_0x0792('0x63')],_0x0792('0x64'),util[_0x0792('0x65')](_0x0792('0x66'),path['basename'](_0x23c295[_0x0792('0x60')],path[_0x0792('0x67')](_0x23c295['save_name'])),_0x23c295[_0x0792('0x61')]));var _0x297f5d=path[_0x0792('0x4e')](config[_0x0792('0x63')],_0x0792('0x68'),_0x5d478c['name'],util[_0x0792('0x65')](_0x0792('0x66'),_0x23c295['name'],_0x23c295[_0x0792('0x61')]));fs[_0x0792('0x69')](_0x58671b,_0x297f5d);return _0x23c295;}})[_0x0792('0x47')](function(_0x2889fc){throw new db[(_0x0792('0x6a'))][(_0x0792('0x5b'))](_0x2889fc[_0x0792('0x5c')]);});})['then'](handleEntityNotFound(_0x330587,null))[_0x0792('0x26')](respondWithResult(_0x330587,0xc9))[_0x0792('0x47')](handleError(_0x330587,null));};exports[_0x0792('0x6b')]=function(_0x583727,_0x37cf3e,_0x1f7f76){return db[_0x0792('0x57')]['transaction'](function(_0x3b7114){var _0x230b0a;return db[_0x0792('0x3f')][_0x0792('0x5f')]({'where':{'id':_0x583727[_0x0792('0x44')]['id']}})[_0x0792('0x26')](handleEntityNotFound(_0x37cf3e,null))[_0x0792('0x26')](function(_0x1c0a4e){if(_0x1c0a4e){_0x230b0a=_0x1c0a4e;return _0x1c0a4e['removeSound'](_0x583727[_0x0792('0x44')][_0x0792('0x6c')]);}})[_0x0792('0x26')](function(_0xd4f1b5){if(_0xd4f1b5){return db[_0x0792('0x5e')]['findOne']({'where':{'id':_0x583727[_0x0792('0x44')][_0x0792('0x6c')]},'attributes':['id',_0x0792('0x2a'),_0x0792('0x60'),_0x0792('0x61'),'createdAt'],'raw':!![]});}})[_0x0792('0x26')](function(_0x621d27){if(_0x621d27){fs[_0x0792('0x6d')](path[_0x0792('0x4e')](_0x230b0a[_0x0792('0x4d')],util['format'](_0x0792('0x66'),_0x621d27[_0x0792('0x2a')],_0x621d27[_0x0792('0x61')])));return _0x621d27;}})[_0x0792('0x47')](function(_0x327251){throw new db[(_0x0792('0x6a'))][(_0x0792('0x5b'))](_0x327251[_0x0792('0x5c')]);});})[_0x0792('0x26')](handleEntityNotFound(_0x37cf3e,null))[_0x0792('0x26')](respondWithStatusCode(_0x37cf3e,0xcc))['catch'](handleError(_0x37cf3e,null));};exports[_0x0792('0x6e')]=function(_0x13fb2f,_0x235027,_0xaab601){var _0x1476a3={};var _0x17292a={};var _0x28e959;var _0x13cca3;return db['VoiceMusicOnHold'][_0x0792('0x5f')]({'where':{'id':_0x13fb2f[_0x0792('0x44')]['id']}})[_0x0792('0x26')](handleEntityNotFound(_0x235027,null))[_0x0792('0x26')](function(_0x374dbc){if(_0x374dbc){_0x28e959=_0x374dbc;_0x17292a[_0x0792('0x2f')]=_[_0x0792('0x32')](db[_0x0792('0x5e')][_0x0792('0x2d')]);_0x17292a[_0x0792('0x31')]=_['keys'](_0x13fb2f[_0x0792('0x31')]);_0x17292a['filters']=_[_0x0792('0x34')](_0x17292a[_0x0792('0x2f')],_0x17292a[_0x0792('0x31')]);_0x1476a3[_0x0792('0x35')]=_['intersection'](_0x17292a[_0x0792('0x2f')],qs[_0x0792('0x45')](_0x13fb2f['query']['fields']));_0x1476a3[_0x0792('0x35')]=_0x1476a3[_0x0792('0x35')]['length']?_0x1476a3[_0x0792('0x35')]:_0x17292a[_0x0792('0x2f')];_0x1476a3[_0x0792('0x6f')]=qs[_0x0792('0x39')](_0x13fb2f[_0x0792('0x31')][_0x0792('0x39')]);_0x1476a3['where']=qs['filters'](_['pick'](_0x13fb2f[_0x0792('0x31')],_0x17292a['filters']));if(_0x13fb2f[_0x0792('0x31')][_0x0792('0x3d')]){_0x1476a3['where']=_[_0x0792('0x3b')](_0x1476a3['where'],{'$or':_[_0x0792('0x30')](_0x1476a3[_0x0792('0x35')],function(_0x10c0fa){var _0x4fc7ec={};_0x4fc7ec[_0x10c0fa]={'$like':'%'+_0x13fb2f[_0x0792('0x31')]['filter']+'%'};return _0x4fc7ec;})});}_0x1476a3=_[_0x0792('0x3b')]({},_0x1476a3,_0x13fb2f[_0x0792('0x3e')]);return _0x28e959['getSounds'](_0x1476a3);}})[_0x0792('0x26')](function(_0x71941b){if(_0x71941b){_0x13cca3=_0x71941b[_0x0792('0x36')];if(!_0x13fb2f[_0x0792('0x31')][_0x0792('0x37')](_0x0792('0x38'))){_0x1476a3[_0x0792('0x1f')]=qs[_0x0792('0x1f')](_0x13fb2f[_0x0792('0x31')][_0x0792('0x1f')]);_0x1476a3[_0x0792('0x1e')]=qs['offset'](_0x13fb2f['query'][_0x0792('0x1e')]);}return _0x28e959[_0x0792('0x6e')](_0x1476a3);}})[_0x0792('0x26')](function(_0x50d69e){if(_0x50d69e){return _0x50d69e?{'count':_0x13cca3,'rows':_0x50d69e}:null;}})[_0x0792('0x26')](respondWithResult(_0x235027,null))[_0x0792('0x47')](handleError(_0x235027,null));};
\ No newline at end of file
index b610f03..34f6183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ae7=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','api','moment','request-promise'];(function(_0x4c008f,_0x3c0d7f){var _0x3f6da2=function(_0x2a338a){while(--_0x2a338a){_0x4c008f['push'](_0x4c008f['shift']());}};_0x3f6da2(++_0x3c0d7f);}(_0x2ae7,0x17b));var _0x72ae=function(_0x502ebd,_0x470f8d){_0x502ebd=_0x502ebd-0x0;var _0x167b0a=_0x2ae7[_0x502ebd];return _0x167b0a;};'use strict';var _=require(_0x72ae('0x0'));var util=require(_0x72ae('0x1'));var logger=require('../../config/logger')(_0x72ae('0x2'));var moment=require(_0x72ae('0x3'));var BPromise=require('bluebird');var rp=require(_0x72ae('0x4'));var fs=require('fs');var path=require(_0x72ae('0x5'));var rimraf=require(_0x72ae('0x6'));var config=require(_0x72ae('0x7'));var attributes=require(_0x72ae('0x8'));module[_0x72ae('0x9')]=function(_0x465bef,_0x333152){return _0x465bef[_0x72ae('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x72ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00e8=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x00e8,0xb4));var _0x800e=function(_0xcbe9ca,_0x2fb2fe){_0xcbe9ca=_0xcbe9ca-0x0;var _0x3c5cec=_0x00e8[_0xcbe9ca];return _0x3c5cec;};'use strict';var _=require(_0x800e('0x0'));var util=require(_0x800e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x800e('0x2'));var rp=require(_0x800e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x800e('0x4'));var config=require(_0x800e('0x5'));var attributes=require(_0x800e('0x6'));module[_0x800e('0x7')]=function(_0x3716fb,_0x361f32){return _0x3716fb[_0x800e('0x8')](_0x800e('0x9'),attributes,{'tableName':_0x800e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a380c59..790fa9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4a366,_0x523cc6){var _0xc0774=function(_0xa87cd5){while(--_0xa87cd5){_0x4a366['push'](_0x4a366['shift']());}};_0xc0774(++_0x523cc6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c3f01,_0x5e7488){_0x1c3f01=_0x1c3f01-0x0;var _0x48b3c3=_0xedd9[_0x1c3f01];return _0x48b3c3;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index d307a41..4ef8192 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5bc=['getAgents','/:id/teams','getTeams','post','create','addTeams','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe5bc,0x8c));var _0xce5b=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xe5bc[_0x2ed8f3];return _0x525a55;};'use strict';var multer=require(_0xce5b('0x0'));var util=require(_0xce5b('0x1'));var path=require(_0xce5b('0x2'));var timeout=require(_0xce5b('0x3'));var express=require(_0xce5b('0x4'));var router=express[_0xce5b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xce5b('0x6'));var interaction=require(_0xce5b('0x7'));var config=require(_0xce5b('0x8'));var controller=require(_0xce5b('0x9'));router[_0xce5b('0xa')]('/',auth[_0xce5b('0xb')](),controller['index']);router[_0xce5b('0xa')]('/describe',auth[_0xce5b('0xb')](),controller[_0xce5b('0xc')]);router['get'](_0xce5b('0xd'),auth['isAuthenticated'](),controller[_0xce5b('0xe')]);router[_0xce5b('0xa')](_0xce5b('0xf'),auth[_0xce5b('0xb')](),controller[_0xce5b('0x10')]);router[_0xce5b('0xa')](_0xce5b('0x11'),auth[_0xce5b('0xb')](),controller[_0xce5b('0x12')]);router[_0xce5b('0x13')]('/',auth[_0xce5b('0xb')](),controller[_0xce5b('0x14')]);router[_0xce5b('0x13')](_0xce5b('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0xce5b('0x13')](_0xce5b('0x11'),auth['isAuthenticated'](),controller[_0xce5b('0x15')]);router['put'](_0xce5b('0xd'),auth[_0xce5b('0xb')](),controller['update']);router[_0xce5b('0x16')](_0xce5b('0xd'),auth[_0xce5b('0xb')](),controller[_0xce5b('0x17')]);router[_0xce5b('0x16')]('/:id/users',auth[_0xce5b('0xb')](),controller[_0xce5b('0x18')]);router[_0xce5b('0x16')](_0xce5b('0x11'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xce5b('0x19')]=router;
\ No newline at end of file
+var _0xea09=['getTeams','post','create','/:id/teams','addTeams','put','delete','destroy','removeTeams','exports','path','fs-extra','../../components/auth/service','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/users','getAgents'];(function(_0x2ea343,_0x439fac){var _0x2a94cf=function(_0x769a8e){while(--_0x769a8e){_0x2ea343['push'](_0x2ea343['shift']());}};_0x2a94cf(++_0x439fac);}(_0xea09,0xd0));var _0x9ea0=function(_0x1dc55a,_0x154882){_0x1dc55a=_0x1dc55a-0x0;var _0x51bef0=_0xea09[_0x1dc55a];return _0x51bef0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9ea0('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9ea0('0x1'));var auth=require(_0x9ea0('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ea0('0x3'));router[_0x9ea0('0x4')]('/',auth['isAuthenticated'](),controller[_0x9ea0('0x5')]);router[_0x9ea0('0x4')](_0x9ea0('0x6'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0x8')]);router[_0x9ea0('0x4')](_0x9ea0('0x9'),auth[_0x9ea0('0x7')](),controller['show']);router[_0x9ea0('0x4')](_0x9ea0('0xa'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0xb')]);router[_0x9ea0('0x4')]('/:id/teams',auth[_0x9ea0('0x7')](),controller[_0x9ea0('0xc')]);router[_0x9ea0('0xd')]('/',auth['isAuthenticated'](),controller[_0x9ea0('0xe')]);router['post']('/:id/users',auth[_0x9ea0('0x7')](),controller['addAgents']);router[_0x9ea0('0xd')](_0x9ea0('0xf'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0x10')]);router[_0x9ea0('0x11')](_0x9ea0('0x9'),auth[_0x9ea0('0x7')](),controller['update']);router[_0x9ea0('0x12')](_0x9ea0('0x9'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0x13')]);router[_0x9ea0('0x12')](_0x9ea0('0xa'),auth[_0x9ea0('0x7')](),controller['removeAgents']);router[_0x9ea0('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9ea0('0x14')]);module[_0x9ea0('0x15')]=router;
\ No newline at end of file
index 58e8686..8c9ee26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1e=['exports','STRING','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x33b270,_0x4ce7c3){var _0x53c101=function(_0x838fa2){while(--_0x838fa2){_0x33b270['push'](_0x33b270['shift']());}};_0x53c101(++_0x4ce7c3);}(_0xaf1e,0x156));var _0xeaf1=function(_0x54a82e,_0x4dffea){_0x54a82e=_0x54a82e-0x0;var _0x5a0c22=_0xaf1e[_0x54a82e];return _0x5a0c22;};'use strict';var Sequelize=require(_0xeaf1('0x0'));module[_0xeaf1('0x1')]={'name':{'type':Sequelize[_0xeaf1('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xeaf1('0x3')],'get':function(_0x58001f){return _0xeaf1('0x4')+this[_0xeaf1('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xeaf1('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xeaf1('0x6')]}};
\ No newline at end of file
+var _0x71ec=['STRING','INTEGER','exports','name','getDataValue'];(function(_0x5b5862,_0x3e710f){var _0x18966f=function(_0x20ef1d){while(--_0x20ef1d){_0x5b5862['push'](_0x5b5862['shift']());}};_0x18966f(++_0x3e710f);}(_0x71ec,0x15b));var _0xc71e=function(_0x1b1a41,_0x37fdba){_0x1b1a41=_0x1b1a41-0x0;var _0x2ef3b7=_0x71ec[_0x1b1a41];return _0x2ef3b7;};'use strict';var Sequelize=require('sequelize');module[_0xc71e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc71e('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2eaa76){return'system-'+this[_0xc71e('0x2')](_0xc71e('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xc71e('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xc71e('0x4')]}};
\ No newline at end of file
index 7ad65b6..48cd066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2272=['Voice\x20Prefix\x20Extension','priority','NoOp','VoicePrefixId','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','context','${EXTEN:','charAt','update','system-','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','User','order','pick','getTeams','findOne','addTeams','Team','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','SELECT','every','TeamId','includes','all','union','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x2227('0x0'));var rimraf=require(_0x2227('0x1'));var zipdir=require(_0x2227('0x2'));var jsonpatch=require(_0x2227('0x3'));var rp=require(_0x2227('0x4'));var moment=require('moment');var BPromise=require(_0x2227('0x5'));var Mustache=require(_0x2227('0x6'));var util=require(_0x2227('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require(_0x2227('0xb'));var squel=require(_0x2227('0xc'));var crypto=require(_0x2227('0xd'));var jsforce=require(_0x2227('0xe'));var deskjs=require(_0x2227('0xf'));var toCsv=require(_0x2227('0x8'));var querystring=require(_0x2227('0x10'));var Papa=require('papaparse');var Redis=require(_0x2227('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2227('0x12'));var as=require(_0x2227('0x13'));var hardwareService=require(_0x2227('0x14'));var logger=require(_0x2227('0x15'))(_0x2227('0x16'));var utils=require('../../config/utils');var config=require(_0x2227('0x17'));var licenseUtil=require(_0x2227('0x18'));var db=require(_0x2227('0x19'))['db'];config[_0x2227('0x1a')]=_[_0x2227('0x1b')](config[_0x2227('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2227('0x1c'))['register'](socket);function respondWithStatusCode(_0x42f60b,_0xb631b0){_0xb631b0=_0xb631b0||0xcc;return function(_0x510b09){if(_0x510b09){return _0x42f60b[_0x2227('0x1d')](_0xb631b0);}return _0x42f60b[_0x2227('0x1e')](_0xb631b0)[_0x2227('0x1f')]();};}function respondWithResult(_0x43e174,_0x42a93c){_0x42a93c=_0x42a93c||0xc8;return function(_0x1e78a8){if(_0x1e78a8){return _0x43e174['status'](_0x42a93c)[_0x2227('0x20')](_0x1e78a8);}};}function respondWithFilteredResult(_0x1cf016,_0x162723){return function(_0x531f75){if(_0x531f75){var _0x11bf80=typeof _0x162723[_0x2227('0x21')]===_0x2227('0x22')&&typeof _0x162723[_0x2227('0x23')]===_0x2227('0x22');var _0x28e642=_0x531f75[_0x2227('0x24')];var _0x4e0bba=_0x11bf80?0x0:_0x162723[_0x2227('0x21')];var _0x59f988=_0x11bf80?_0x531f75[_0x2227('0x24')]:_0x162723[_0x2227('0x21')]+_0x162723[_0x2227('0x23')];var _0x1f28ef;if(_0x59f988>=_0x28e642){_0x59f988=_0x28e642;_0x1f28ef=0xc8;}else{_0x1f28ef=0xce;}_0x1cf016[_0x2227('0x1e')](_0x1f28ef);return _0x1cf016[_0x2227('0x25')](_0x2227('0x26'),_0x4e0bba+'-'+_0x59f988+'/'+_0x28e642)[_0x2227('0x20')](_0x531f75);}return null;};}function patchUpdates(_0x3299fd){return function(_0x34c090){try{jsonpatch[_0x2227('0x27')](_0x34c090,_0x3299fd,!![]);}catch(_0x5a454f){return BPromise[_0x2227('0x28')](_0x5a454f);}return _0x34c090[_0x2227('0x29')]();};}function saveUpdates(_0x5b3a09,_0x2cef4b){return function(_0xbfdce1){if(_0xbfdce1){return _0xbfdce1['update'](_0x5b3a09)['then'](function(_0x17c7a4){return _0x17c7a4;});}return null;};}function removeEntity(_0xa4d18b,_0x35333f){return function(_0x1f30c3){if(_0x1f30c3){return _0x1f30c3['destroy']()[_0x2227('0x2a')](function(){var _0x301304=_0x1f30c3[_0x2227('0x2b')]({'plain':!![]});var _0x1957ee='VoicePrefixes';return db[_0x2227('0x2c')][_0x2227('0x2d')]({'where':{'type':_0x1957ee,'resourceId':_0x301304['id']}})[_0x2227('0x2a')](function(){return _0x1f30c3;});})[_0x2227('0x2a')](function(){_0xa4d18b[_0x2227('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55015e,_0x5d1d56){return function(_0x2dc38d){if(!_0x2dc38d){_0x55015e['sendStatus'](0x194);}return _0x2dc38d;};}function handleError(_0x2ba581,_0x1979d8){_0x1979d8=_0x1979d8||0x1f4;return function(_0x58609e){logger['error'](_0x58609e[_0x2227('0x2e')]);if(_0x58609e[_0x2227('0x2f')]){delete _0x58609e[_0x2227('0x2f')];}_0x2ba581['status'](_0x1979d8)[_0x2227('0x30')](_0x58609e);};}exports['index']=function(_0xaa2bbb,_0x3f108b){var _0x28ad1c={},_0xfa2140={},_0x155095={'count':0x0,'rows':[]};var _0x256b7b=_[_0x2227('0x31')](db[_0x2227('0x32')][_0x2227('0x33')],function(_0x781f79){return{'name':_0x781f79[_0x2227('0x34')],'type':_0x781f79['type'][_0x2227('0x35')]};});_0xfa2140[_0x2227('0x36')]=_[_0x2227('0x31')](_0x256b7b,_0x2227('0x2f'));_0xfa2140['query']=_[_0x2227('0x37')](_0xaa2bbb[_0x2227('0x38')]);_0xfa2140[_0x2227('0x39')]=_[_0x2227('0x3a')](_0xfa2140['model'],_0xfa2140[_0x2227('0x38')]);_0x28ad1c[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0xfa2140['model'],qs['fields'](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x3c')]));_0x28ad1c['attributes']=_0x28ad1c[_0x2227('0x3b')][_0x2227('0x3d')]?_0x28ad1c['attributes']:_0xfa2140[_0x2227('0x36')];if(!_0xaa2bbb['query'][_0x2227('0x3e')](_0x2227('0x3f'))){_0x28ad1c[_0x2227('0x23')]=qs[_0x2227('0x23')](_0xaa2bbb['query'][_0x2227('0x23')]);_0x28ad1c['offset']=qs[_0x2227('0x21')](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x21')]);}_0x28ad1c['order']=qs[_0x2227('0x40')](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x40')]);_0x28ad1c[_0x2227('0x41')]=qs[_0x2227('0x39')](_['pick'](_0xaa2bbb['query'],_0xfa2140[_0x2227('0x39')]),_0x256b7b);if(_0xaa2bbb['query'][_0x2227('0x42')]){_0x28ad1c[_0x2227('0x41')]=_[_0x2227('0x43')](_0x28ad1c[_0x2227('0x41')],{'$or':_[_0x2227('0x31')](_0x256b7b,function(_0xd08cd8){if(_0xd08cd8[_0x2227('0x44')]!==_0x2227('0x45')){var _0x5688b5={};_0x5688b5[_0xd08cd8[_0x2227('0x2f')]]={'$like':'%'+_0xaa2bbb['query'][_0x2227('0x42')]+'%'};return _0x5688b5;}})});}_0x28ad1c=_['merge']({},_0x28ad1c,_0xaa2bbb[_0x2227('0x46')]);var _0x59afc0={'where':_0x28ad1c[_0x2227('0x41')]};return db['VoicePrefix'][_0x2227('0x24')](_0x59afc0)[_0x2227('0x2a')](function(_0x46eb0f){_0x155095[_0x2227('0x24')]=_0x46eb0f;if(_0xaa2bbb[_0x2227('0x38')][_0x2227('0x47')]){_0x28ad1c['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x2227('0x48')](_0x28ad1c);})['then'](function(_0x3552db){_0x155095['rows']=_0x3552db;return _0x155095;})[_0x2227('0x2a')](respondWithFilteredResult(_0x3f108b,_0x28ad1c))[_0x2227('0x49')](handleError(_0x3f108b,null));};exports[_0x2227('0x4a')]=function(_0xa3ae06,_0x3f9787){var _0x2871a6={'raw':![],'where':{'id':_0xa3ae06[_0x2227('0x4b')]['id']}},_0x5f5880={};_0x5f5880[_0x2227('0x36')]=_[_0x2227('0x37')](db[_0x2227('0x32')][_0x2227('0x33')]);_0x5f5880[_0x2227('0x38')]=_[_0x2227('0x37')](_0xa3ae06[_0x2227('0x38')]);_0x5f5880['filters']=_[_0x2227('0x3a')](_0x5f5880[_0x2227('0x36')],_0x5f5880[_0x2227('0x38')]);_0x2871a6[_0x2227('0x3b')]=_['intersection'](_0x5f5880[_0x2227('0x36')],qs[_0x2227('0x3c')](_0xa3ae06['query'][_0x2227('0x3c')]));_0x2871a6[_0x2227('0x3b')]=_0x2871a6[_0x2227('0x3b')][_0x2227('0x3d')]?_0x2871a6[_0x2227('0x3b')]:_0x5f5880[_0x2227('0x36')];if(_0xa3ae06[_0x2227('0x38')]['includeAll']){_0x2871a6[_0x2227('0x4c')]=[{'all':!![]}];}_0x2871a6=_[_0x2227('0x43')]({},_0x2871a6,_0xa3ae06['options']);return db[_0x2227('0x32')]['find'](_0x2871a6)[_0x2227('0x2a')](handleEntityNotFound(_0x3f9787,null))[_0x2227('0x2a')](respondWithResult(_0x3f9787,null))[_0x2227('0x49')](handleError(_0x3f9787,null));};exports[_0x2227('0x2d')]=function(_0x5387fc,_0x4e12c7){return db['VoicePrefix'][_0x2227('0x4d')]({'where':{'id':_0x5387fc[_0x2227('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e12c7,null))[_0x2227('0x2a')](removeEntity(_0x4e12c7,null))[_0x2227('0x49')](handleError(_0x4e12c7,null));};exports[_0x2227('0x4e')]=function(_0x39166b,_0x4ee23c){return db['VoicePrefix'][_0x2227('0x4e')]()[_0x2227('0x2a')](respondWithResult(_0x4ee23c,null))[_0x2227('0x49')](handleError(_0x4ee23c,null));};exports[_0x2227('0x4f')]=function(_0x597f00,_0x26581d){var _0x443933;return db[_0x2227('0x50')][_0x2227('0x51')](function(_0x125fa8){return db[_0x2227('0x32')][_0x2227('0x4f')](_0x597f00[_0x2227('0x52')],{'transaction':_0x125fa8})[_0x2227('0x2a')](function(_0x418ec4){_0x443933=_0x418ec4[_0x2227('0x2b')]({'plain':!![]});return db[_0x2227('0x53')][_0x2227('0x4d')]({'where':{'id':_0x443933[_0x2227('0x54')]},'raw':!![]})[_0x2227('0x2a')](function(_0x10c21a){return createVoicePrefixExtensions(_0x443933,_0x10c21a,_0x125fa8);});});})['then'](function(){var _0xc176c9=_0x597f00[_0x2227('0x55')]['get']({'plain':!![]});if(!_0xc176c9)throw new Error(_0x2227('0x56'));if(_0xc176c9[_0x2227('0x57')]===_0x2227('0x55')){var _0x4e8622=_0x443933;return db['UserProfileSection']['find']({'where':{'name':_0x2227('0x58'),'userProfileId':_0xc176c9[_0x2227('0x59')]},'raw':!![]})['then'](function(_0x2171b1){if(_0x2171b1&&_0x2171b1[_0x2227('0x5a')]===0x0){return db[_0x2227('0x2c')]['create']({'name':_0x4e8622[_0x2227('0x2f')],'resourceId':_0x4e8622['id'],'type':_0x2171b1[_0x2227('0x2f')],'sectionId':_0x2171b1['id']},{})['then'](function(){return _0x443933;});}else{return _0x443933;}})[_0x2227('0x49')](function(_0x1f02be){logger['error'](_0x2227('0x5b'),_0x1f02be);throw _0x1f02be;});}return _0x443933;})[_0x2227('0x2a')](respondWithResult(_0x26581d,null))[_0x2227('0x49')](handleError(_0x26581d,null));};function Extension(_0x1ab7e0,_0x300741,_0x118225,_0x52861f){this['context']=_0x2227('0x5c');this['exten']=_0x1ab7e0;this[_0x2227('0x5d')]=_0x118225;this['type']=_0x2227('0x5e');this[_0x2227('0x5f')]=_0x2227('0x60');this[_0x2227('0x61')]=_0x300741;this['appdata']=_0x52861f;}function createVoicePrefixExtensions(_0x44a025,_0x41359a,_0x10df84){return new BPromise(function(_0x1ec0db,_0x30fbd8){var _0x4fdb8d=new Extension(formatPrefixName(_0x44a025['prefix']),0x1,_0x2227('0x62'),'Voice\x20Prefix');_0x4fdb8d[_0x2227('0x63')]=_0x44a025['id'];return db[_0x2227('0x53')]['create'](_0x4fdb8d,{'transaction':_0x10df84})['then'](function(_0x1aa091){var _0x335798=_0x1aa091[_0x2227('0x2b')]({'plain':!![]});var _0x2f6d49=_[_0x2227('0x31')](addVoicePrefixExtensions(_0x44a025,_0x41359a),function(_0x119d39){_0x119d39[_0x2227('0x54')]=_0x335798['id'];_0x119d39[_0x2227('0x63')]=_0x44a025['id'];return _0x119d39;});return db[_0x2227('0x53')]['bulkCreate'](_0x2f6d49,{'transaction':_0x10df84})[_0x2227('0x2a')](function(_0x1d0e87){if(!_0x1d0e87){return _0x30fbd8('Extensions\x20creation\x20failed');}else{return _0x1ec0db(_0x1d0e87);}})[_0x2227('0x49')](function(_0x108605){return _0x30fbd8(_0x108605);});});;});};function addVoicePrefixExtensions(_0x1b2634,_0x5a41d9){var _0x215fb2=[];var _0xfa23f1=formatPrefixName(_0x1b2634[_0x2227('0x64')]);_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x2,_0x2227('0x66'),_0x2227('0x67')+_0x1b2634[_0x2227('0x2f')]));if(_0x1b2634[_0x2227('0x68')]){_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x3,_0x2227('0x66'),_0x2227('0x69')+_0x1b2634[_0x2227('0x68')]));}else{_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x3,_0x2227('0x62'),'No\x20callerid\x20available'));}_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x4,_0x2227('0x6a'),_0x5a41d9[_0x2227('0x6b')]+','+_0x2227('0x6c')+(0x8+_0x1b2634[_0x2227('0x2f')][_0x2227('0x3d')])+'}'+','+0x1));return _0x215fb2;}function formatPrefixName(_0x1e7779){var _0x4633d8='_';for(var _0x4e0ca2=0x0;_0x4e0ca2<_0x1e7779[_0x2227('0x3d')];_0x4e0ca2++){if(_0x1e7779[_0x2227('0x6d')](_0x4e0ca2)=='-'){_0x4633d8+=_0x1e7779[_0x2227('0x6d')](_0x4e0ca2);}else{_0x4633d8+='['+_0x1e7779['charAt'](_0x4e0ca2)+']';}}_0x4633d8+='.';return _0x4633d8;}exports[_0x2227('0x6e')]=function(_0x4258a3,_0x24b5b0,_0x5bd233){var _0x398d76=_0x4258a3['body'];_0x398d76[_0x2227('0x64')]=_0x2227('0x6f')+_0x398d76[_0x2227('0x2f')]+'-';return db[_0x2227('0x50')]['transaction'](function(_0x3a34d8){return db[_0x2227('0x32')]['update'](_0x398d76,{'where':{'id':_0x398d76['id']},'transaction':_0x3a34d8})['then'](function(){return db[_0x2227('0x53')][_0x2227('0x2d')]({'where':{'VoicePrefixId':_0x398d76['id']},'transaction':_0x3a34d8})[_0x2227('0x2a')](function(){return db[_0x2227('0x53')][_0x2227('0x4d')]({'where':{'id':_0x398d76[_0x2227('0x54')]},'raw':!![]})[_0x2227('0x2a')](function(_0x36a85a){return createVoicePrefixExtensions(_0x398d76,_0x36a85a,_0x3a34d8);});});});})['then'](function(){return db[_0x2227('0x32')][_0x2227('0x70')](_0x398d76['id']);})[_0x2227('0x2a')](respondWithResult(_0x24b5b0,null))['catch'](handleError(_0x24b5b0,null));};exports['addAgents']=function(_0x5147fe,_0xf3038b,_0x57b27a){return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x5147fe[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0xf3038b,null))[_0x2227('0x2a')](function(_0x2435d0){if(_0x2435d0){return _0x2435d0[_0x2227('0x71')](_0x5147fe[_0x2227('0x52')][_0x2227('0x72')],_['omit'](_0x5147fe[_0x2227('0x52')],[_0x2227('0x72'),'id'])||{})[_0x2227('0x73')](function(_0x58e3ee){for(var _0x22a30f=0x0;_0x22a30f<_0x5147fe[_0x2227('0x52')]['ids']['length'];_0x22a30f+=0x1){socket[_0x2227('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x5147fe[_0x2227('0x52')][_0x2227('0x72')][_0x22a30f]),'VoicePrefixId':Number(_0x5147fe[_0x2227('0x4b')]['id'])});}return _0x58e3ee;});}})[_0x2227('0x2a')](respondWithResult(_0xf3038b,null))[_0x2227('0x49')](handleError(_0xf3038b,null));};exports['removeAgents']=function(_0x9b431a,_0x128e74,_0x770f98){return db[_0x2227('0x32')]['find']({'where':{'id':_0x9b431a[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x128e74,null))['then'](function(_0x5af36d){if(_0x5af36d){return _0x5af36d[_0x2227('0x75')](_0x9b431a[_0x2227('0x38')][_0x2227('0x72')])['then'](function(){if(_['isArray'](_0x9b431a[_0x2227('0x38')][_0x2227('0x72')])){for(var _0x13cd17=0x0;_0x13cd17<_0x9b431a[_0x2227('0x38')]['ids']['length'];_0x13cd17+=0x1){socket[_0x2227('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x9b431a[_0x2227('0x38')][_0x2227('0x72')][_0x13cd17]),'VoicePrefixId':Number(_0x9b431a[_0x2227('0x4b')]['id'])});}}else{socket['emit'](_0x2227('0x76'),{'UserId':Number(_0x9b431a['query'][_0x2227('0x72')]),'VoicePrefixId':Number(_0x9b431a[_0x2227('0x4b')]['id'])});}});}})[_0x2227('0x2a')](respondWithStatusCode(_0x128e74,null))[_0x2227('0x49')](handleError(_0x128e74,null));};exports[_0x2227('0x77')]=function(_0x190760,_0x2eea42,_0x9364ec){var _0x50c689={};var _0x266f3b={};var _0x3e2219;var _0x1f0fc8;return db['VoicePrefix']['findOne']({'where':{'id':_0x190760[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x2eea42,null))[_0x2227('0x2a')](function(_0x5daa8b){if(_0x5daa8b){_0x3e2219=_0x5daa8b;_0x266f3b[_0x2227('0x36')]=_['keys'](db[_0x2227('0x78')]['rawAttributes']);_0x266f3b[_0x2227('0x38')]=_[_0x2227('0x37')](_0x190760['query']);_0x266f3b[_0x2227('0x39')]=_[_0x2227('0x3a')](_0x266f3b[_0x2227('0x36')],_0x266f3b[_0x2227('0x38')]);_0x50c689[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0x266f3b['model'],qs['fields'](_0x190760[_0x2227('0x38')][_0x2227('0x3c')]));_0x50c689[_0x2227('0x3b')]=_0x50c689[_0x2227('0x3b')]['length']?_0x50c689['attributes']:_0x266f3b[_0x2227('0x36')];_0x50c689[_0x2227('0x79')]=qs[_0x2227('0x40')](_0x190760['query']['sort']);_0x50c689[_0x2227('0x41')]=qs[_0x2227('0x39')](_[_0x2227('0x7a')](_0x190760[_0x2227('0x38')],_0x266f3b[_0x2227('0x39')]));if(_0x190760[_0x2227('0x38')][_0x2227('0x42')]){_0x50c689[_0x2227('0x41')]=_[_0x2227('0x43')](_0x50c689['where'],{'$or':_['map'](_0x50c689[_0x2227('0x3b')],function(_0x5732e5){var _0x5f1ade={};_0x5f1ade[_0x5732e5]={'$like':'%'+_0x190760[_0x2227('0x38')]['filter']+'%'};return _0x5f1ade;})});}_0x50c689=_[_0x2227('0x43')]({},_0x50c689,_0x190760[_0x2227('0x46')]);return _0x3e2219['getAgents'](_0x50c689);}})[_0x2227('0x2a')](function(_0x3174ef){if(_0x3174ef){_0x1f0fc8=_0x3174ef[_0x2227('0x3d')];if(!_0x190760['query'][_0x2227('0x3e')]('nolimit')){_0x50c689['limit']=qs[_0x2227('0x23')](_0x190760['query'][_0x2227('0x23')]);_0x50c689[_0x2227('0x21')]=qs[_0x2227('0x21')](_0x190760['query'][_0x2227('0x21')]);}return _0x3e2219[_0x2227('0x77')](_0x50c689);}})[_0x2227('0x2a')](function(_0x467380){if(_0x467380){return _0x467380?{'count':_0x1f0fc8,'rows':_0x467380}:null;}})['then'](respondWithResult(_0x2eea42,null))['catch'](handleError(_0x2eea42,null));};exports[_0x2227('0x7b')]=function(_0x3b653f,_0x35c9ea,_0x2e4a1b){var _0x4cd27e={};var _0x1a2852={};var _0x4599ab;var _0x3d592a;return db[_0x2227('0x32')][_0x2227('0x7c')]({'where':{'id':_0x3b653f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x35c9ea,null))['then'](function(_0x524e6a){if(_0x524e6a){_0x4599ab=_0x524e6a;_0x1a2852[_0x2227('0x36')]=_[_0x2227('0x37')](db['Team'][_0x2227('0x33')]);_0x1a2852[_0x2227('0x38')]=_[_0x2227('0x37')](_0x3b653f[_0x2227('0x38')]);_0x1a2852['filters']=_[_0x2227('0x3a')](_0x1a2852['model'],_0x1a2852['query']);_0x4cd27e[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0x1a2852[_0x2227('0x36')],qs[_0x2227('0x3c')](_0x3b653f[_0x2227('0x38')][_0x2227('0x3c')]));_0x4cd27e[_0x2227('0x3b')]=_0x4cd27e[_0x2227('0x3b')][_0x2227('0x3d')]?_0x4cd27e['attributes']:_0x1a2852[_0x2227('0x36')];_0x4cd27e[_0x2227('0x79')]=qs[_0x2227('0x40')](_0x3b653f[_0x2227('0x38')][_0x2227('0x40')]);_0x4cd27e['where']=qs[_0x2227('0x39')](_['pick'](_0x3b653f[_0x2227('0x38')],_0x1a2852[_0x2227('0x39')]));if(_0x3b653f[_0x2227('0x38')][_0x2227('0x42')]){_0x4cd27e[_0x2227('0x41')]=_[_0x2227('0x43')](_0x4cd27e[_0x2227('0x41')],{'$or':_[_0x2227('0x31')](_0x4cd27e['attributes'],function(_0x1686d7){var _0x30101f={};_0x30101f[_0x1686d7]={'$like':'%'+_0x3b653f[_0x2227('0x38')]['filter']+'%'};return _0x30101f;})});}_0x4cd27e=_[_0x2227('0x43')]({},_0x4cd27e,_0x3b653f[_0x2227('0x46')]);return _0x4599ab['getTeams'](_0x4cd27e);}})[_0x2227('0x2a')](function(_0x386b5d){if(_0x386b5d){_0x3d592a=_0x386b5d['length'];if(!_0x3b653f[_0x2227('0x38')][_0x2227('0x3e')](_0x2227('0x3f'))){_0x4cd27e[_0x2227('0x23')]=qs[_0x2227('0x23')](_0x3b653f[_0x2227('0x38')][_0x2227('0x23')]);_0x4cd27e[_0x2227('0x21')]=qs['offset'](_0x3b653f[_0x2227('0x38')][_0x2227('0x21')]);}return _0x4599ab[_0x2227('0x7b')](_0x4cd27e);}})[_0x2227('0x2a')](function(_0x172b34){if(_0x172b34){return _0x172b34?{'count':_0x3d592a,'rows':_0x172b34}:null;}})[_0x2227('0x2a')](respondWithResult(_0x35c9ea,null))['catch'](handleError(_0x35c9ea,null));};exports[_0x2227('0x7d')]=function(_0x2ffe4f,_0x28d3ca,_0x20def8){var _0x42787b=_0x2ffe4f[_0x2227('0x52')][_0x2227('0x72')];var _0x2cf763;return db[_0x2227('0x7e')][_0x2227('0x48')]({'where':{'id':_0x42787b},'attributes':['id'],'include':[{'model':db[_0x2227('0x78')],'as':_0x2227('0x7f'),'attributes':['id','name',_0x2227('0x80'),_0x2227('0x81'),_0x2227('0x82')],'raw':!![]}]})[_0x2227('0x2a')](function(_0x43af43){if(_0x43af43){_0x2cf763=_0x43af43;var _0x1766e5=_[_0x2227('0x83')](_0x43af43,function(_0x2fdf17){var _0x38e805=_0x2fdf17[_0x2227('0x2b')]({'plain':!![]});return _0x38e805['Agents'];});return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x2ffe4f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](function(_0x2fdc19){return db[_0x2227('0x50')][_0x2227('0x51')](function(_0x3f7d5d){return _0x2fdc19['addTeams'](_0x42787b,{'transaction':_0x3f7d5d})[_0x2227('0x2a')](function(){return BPromise[_0x2227('0x84')](_0x2cf763,function(_0x36492d){return db['TeamVoicePrefix'][_0x2227('0x85')]({'TeamId':_0x36492d['id'],'VoicePrefixId':_0x2ffe4f[_0x2227('0x4b')]['id']},{'transaction':_0x3f7d5d});});})['then'](function(){return BPromise[_0x2227('0x84')](_0x1766e5,function(_0x2fb89b){return db[_0x2227('0x86')][_0x2227('0x87')]({'where':{'UserId':_0x2fb89b['id'],'VoicePrefixId':_0x2ffe4f[_0x2227('0x4b')]['id']},'transaction':_0x3f7d5d});});})['then'](function(){_0x1766e5[_0x2227('0x88')](function(_0x12fabe){socket[_0x2227('0x74')](_0x2227('0x89'),{'UserId':_0x12fabe['id'],'VoicePrefixId':_0x2fdc19['id']});});});});});}})[_0x2227('0x2a')](respondWithStatusCode(_0x28d3ca,null))['catch'](handleError(_0x28d3ca,null));};exports['removeTeams']=function(_0x2e153f,_0x312033,_0x1c557d){return db['Team']['findAll']({'where':{'id':_0x2e153f['query'][_0x2227('0x72')]},'attributes':['id'],'include':[{'model':db[_0x2227('0x78')],'as':_0x2227('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x2227('0x2a')](handleEntityNotFound(_0x312033,null))[_0x2227('0x2a')](function(_0x3e5597){var _0x3f58d2=_['map'](_0x3e5597,'id');var _0x2930e9=[];var _0x4505ab=[];var _0x2824b1=squel[_0x2227('0x8a')]();_0x2824b1[_0x2227('0x8b')](_0x2227('0x8c'))[_0x2227('0x8d')](_0x2227('0x8e'),'tq')[_0x2227('0x8f')]('user_has_teams','ut',_0x2227('0x90'))[_0x2227('0x41')](_0x2227('0x91'),_0x2e153f[_0x2227('0x4b')]['id']);for(var _0x3b5b07=0x0;_0x3b5b07<_0x3e5597[_0x2227('0x3d')];_0x3b5b07+=0x1){let _0x19608d=_0x3e5597[_0x3b5b07];for(var _0x5008cc=0x0;_0x5008cc<_0x19608d[_0x2227('0x7f')][_0x2227('0x3d')];_0x5008cc+=0x1){let _0x15b3c4=_0x19608d[_0x2227('0x7f')][_0x5008cc];var _0x1a0805=_0x2824b1[_0x2227('0x92')]();_0x1a0805[_0x2227('0x41')]('ut.UserId\x20=\x20?',_0x15b3c4['id']);_0x4505ab[_0x2227('0x65')](db[_0x2227('0x50')][_0x2227('0x38')](_0x1a0805[_0x2227('0x93')](),{'type':db[_0x2227('0x50')]['QueryTypes'][_0x2227('0x94')]})[_0x2227('0x2a')](function(_0x4f822c){if(_0x4f822c['length']===0x1){return _0x15b3c4['id'];}else{var _0x1bab79=_[_0x2227('0x95')](_[_0x2227('0x31')](_0x4f822c,_0x2227('0x96')),function(_0x26c479){return _[_0x2227('0x97')](_0x3f58d2,_0x26c479);});if(_0x1bab79){return _0x15b3c4['id'];}}}));}}return BPromise[_0x2227('0x98')](_0x4505ab)['then'](function(_0x54db70){_0x2930e9=_(_0x2930e9)[_0x2227('0x99')](_0x54db70)['compact']()['value']();return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x2e153f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](function(_0x152b89){return db[_0x2227('0x50')]['transaction'](function(_0x360f72){return _0x152b89[_0x2227('0x9a')](_0x2e153f['query'][_0x2227('0x72')],{'transaction':_0x360f72})[_0x2227('0x2a')](function(){if(!_[_0x2227('0x9b')](_0x2930e9)){return _0x152b89[_0x2227('0x75')](_0x2930e9,{'transaction':_0x360f72});}})[_0x2227('0x2a')](function(){_0x2930e9[_0x2227('0x88')](function(_0x66aa39){socket[_0x2227('0x74')](_0x2227('0x76'),{'UserId':_0x66aa39,'VoicePrefixId':_0x152b89['id']});});});});});});})[_0x2227('0x2a')](respondWithStatusCode(_0x312033,null))['catch'](handleError(_0x312033,null));};
\ No newline at end of file
+var _0xdb28=['length','nolimit','order','sort','where','filters','pick','filter','merge','VoicePrefix','includeAll','include','findAll','rows','catch','params','fields','describe','create','sequelize','body','VoiceExtension','find','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','findOne','User','options','hasOwnProperty','getAgents','getTeams','rawAttributes','addTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','VoicePrefixes','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x3b47f9,_0x9f0a57){var _0x57b3aa=function(_0x1c1817){while(--_0x1c1817){_0x3b47f9['push'](_0x3b47f9['shift']());}};_0x57b3aa(++_0x9f0a57);}(_0xdb28,0x106));var _0x8db2=function(_0x2aac63,_0x5b8e78){_0x2aac63=_0x2aac63-0x0;var _0x374af6=_0xdb28[_0x2aac63];return _0x374af6;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];config[_0x8db2('0x19')]=_[_0x8db2('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8db2('0x1b'))(new Redis(config[_0x8db2('0x19')]));require(_0x8db2('0x1c'))[_0x8db2('0x1d')](socket);function respondWithStatusCode(_0x227355,_0xfa285b){_0xfa285b=_0xfa285b||0xcc;return function(_0x2f177a){if(_0x2f177a){return _0x227355[_0x8db2('0x1e')](_0xfa285b);}return _0x227355[_0x8db2('0x1f')](_0xfa285b)[_0x8db2('0x20')]();};}function respondWithResult(_0x5489a9,_0x13b0f5){_0x13b0f5=_0x13b0f5||0xc8;return function(_0x24da1b){if(_0x24da1b){return _0x5489a9['status'](_0x13b0f5)[_0x8db2('0x21')](_0x24da1b);}};}function respondWithFilteredResult(_0x44957d,_0x21db8c){return function(_0x3fddc2){if(_0x3fddc2){var _0x2efd06=typeof _0x21db8c[_0x8db2('0x22')]==='undefined'&&typeof _0x21db8c['limit']===_0x8db2('0x23');var _0x104e33=_0x3fddc2[_0x8db2('0x24')];var _0x1b64e4=_0x2efd06?0x0:_0x21db8c['offset'];var _0x431d60=_0x2efd06?_0x3fddc2[_0x8db2('0x24')]:_0x21db8c[_0x8db2('0x22')]+_0x21db8c[_0x8db2('0x25')];var _0x3dbe8e;if(_0x431d60>=_0x104e33){_0x431d60=_0x104e33;_0x3dbe8e=0xc8;}else{_0x3dbe8e=0xce;}_0x44957d['status'](_0x3dbe8e);return _0x44957d[_0x8db2('0x26')](_0x8db2('0x27'),_0x1b64e4+'-'+_0x431d60+'/'+_0x104e33)[_0x8db2('0x21')](_0x3fddc2);}return null;};}function patchUpdates(_0x125be2){return function(_0x2260d8){try{jsonpatch[_0x8db2('0x28')](_0x2260d8,_0x125be2,!![]);}catch(_0x796ec1){return BPromise['reject'](_0x796ec1);}return _0x2260d8[_0x8db2('0x29')]();};}function saveUpdates(_0x4f6516,_0x5725f0){return function(_0x52a9ca){if(_0x52a9ca){return _0x52a9ca['update'](_0x4f6516)[_0x8db2('0x2a')](function(_0x29b5cd){return _0x29b5cd;});}return null;};}function removeEntity(_0x3be281,_0x2baed0){return function(_0x145328){if(_0x145328){return _0x145328[_0x8db2('0x2b')]()['then'](function(){var _0x3544ba=_0x145328[_0x8db2('0x2c')]({'plain':!![]});var _0x430dd5=_0x8db2('0x2d');return db['UserProfileResource'][_0x8db2('0x2b')]({'where':{'type':_0x430dd5,'resourceId':_0x3544ba['id']}})[_0x8db2('0x2a')](function(){return _0x145328;});})[_0x8db2('0x2a')](function(){_0x3be281[_0x8db2('0x1f')](0xcc)[_0x8db2('0x20')]();});}};}function handleEntityNotFound(_0x21bae5,_0xa54ea3){return function(_0x3124d5){if(!_0x3124d5){_0x21bae5[_0x8db2('0x1e')](0x194);}return _0x3124d5;};}function handleError(_0x493cab,_0x4718ec){_0x4718ec=_0x4718ec||0x1f4;return function(_0x50b28d){logger['error'](_0x50b28d[_0x8db2('0x2e')]);if(_0x50b28d[_0x8db2('0x2f')]){delete _0x50b28d[_0x8db2('0x2f')];}_0x493cab['status'](_0x4718ec)[_0x8db2('0x30')](_0x50b28d);};}exports['index']=function(_0x3f7aac,_0x2b653b){var _0x14bd12={},_0x4d9e26={},_0x56e9c1={'count':0x0,'rows':[]};var _0x35d337=_[_0x8db2('0x31')](db['VoicePrefix']['rawAttributes'],function(_0x173989){return{'name':_0x173989[_0x8db2('0x32')],'type':_0x173989[_0x8db2('0x33')][_0x8db2('0x34')]};});_0x4d9e26[_0x8db2('0x35')]=_[_0x8db2('0x31')](_0x35d337,_0x8db2('0x2f'));_0x4d9e26[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x3f7aac[_0x8db2('0x36')]);_0x4d9e26['filters']=_[_0x8db2('0x38')](_0x4d9e26[_0x8db2('0x35')],_0x4d9e26['query']);_0x14bd12[_0x8db2('0x39')]=_[_0x8db2('0x38')](_0x4d9e26['model'],qs['fields'](_0x3f7aac[_0x8db2('0x36')]['fields']));_0x14bd12[_0x8db2('0x39')]=_0x14bd12[_0x8db2('0x39')][_0x8db2('0x3a')]?_0x14bd12[_0x8db2('0x39')]:_0x4d9e26['model'];if(!_0x3f7aac[_0x8db2('0x36')]['hasOwnProperty'](_0x8db2('0x3b'))){_0x14bd12[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x3f7aac[_0x8db2('0x36')]['limit']);_0x14bd12['offset']=qs[_0x8db2('0x22')](_0x3f7aac[_0x8db2('0x36')]['offset']);}_0x14bd12[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0x3f7aac[_0x8db2('0x36')]['sort']);_0x14bd12[_0x8db2('0x3e')]=qs[_0x8db2('0x3f')](_[_0x8db2('0x40')](_0x3f7aac[_0x8db2('0x36')],_0x4d9e26[_0x8db2('0x3f')]),_0x35d337);if(_0x3f7aac[_0x8db2('0x36')][_0x8db2('0x41')]){_0x14bd12[_0x8db2('0x3e')]=_[_0x8db2('0x42')](_0x14bd12[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x35d337,function(_0x20bf0b){if(_0x20bf0b[_0x8db2('0x33')]!=='VIRTUAL'){var _0x3ee510={};_0x3ee510[_0x20bf0b[_0x8db2('0x2f')]]={'$like':'%'+_0x3f7aac['query']['filter']+'%'};return _0x3ee510;}})});}_0x14bd12=_[_0x8db2('0x42')]({},_0x14bd12,_0x3f7aac['options']);var _0x130eb9={'where':_0x14bd12[_0x8db2('0x3e')]};return db[_0x8db2('0x43')][_0x8db2('0x24')](_0x130eb9)[_0x8db2('0x2a')](function(_0x30d606){_0x56e9c1[_0x8db2('0x24')]=_0x30d606;if(_0x3f7aac['query'][_0x8db2('0x44')]){_0x14bd12[_0x8db2('0x45')]=[{'all':!![]}];}return db[_0x8db2('0x43')][_0x8db2('0x46')](_0x14bd12);})['then'](function(_0x424c27){_0x56e9c1[_0x8db2('0x47')]=_0x424c27;return _0x56e9c1;})[_0x8db2('0x2a')](respondWithFilteredResult(_0x2b653b,_0x14bd12))[_0x8db2('0x48')](handleError(_0x2b653b,null));};exports['show']=function(_0x12d62d,_0x4e0749){var _0x19bd06={'raw':![],'where':{'id':_0x12d62d[_0x8db2('0x49')]['id']}},_0x116b69={};_0x116b69['model']=_['keys'](db[_0x8db2('0x43')]['rawAttributes']);_0x116b69[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x12d62d[_0x8db2('0x36')]);_0x116b69[_0x8db2('0x3f')]=_[_0x8db2('0x38')](_0x116b69[_0x8db2('0x35')],_0x116b69[_0x8db2('0x36')]);_0x19bd06[_0x8db2('0x39')]=_[_0x8db2('0x38')](_0x116b69[_0x8db2('0x35')],qs[_0x8db2('0x4a')](_0x12d62d[_0x8db2('0x36')]['fields']));_0x19bd06[_0x8db2('0x39')]=_0x19bd06[_0x8db2('0x39')][_0x8db2('0x3a')]?_0x19bd06[_0x8db2('0x39')]:_0x116b69['model'];if(_0x12d62d['query'][_0x8db2('0x44')]){_0x19bd06[_0x8db2('0x45')]=[{'all':!![]}];}_0x19bd06=_[_0x8db2('0x42')]({},_0x19bd06,_0x12d62d['options']);return db['VoicePrefix']['find'](_0x19bd06)[_0x8db2('0x2a')](handleEntityNotFound(_0x4e0749,null))[_0x8db2('0x2a')](respondWithResult(_0x4e0749,null))[_0x8db2('0x48')](handleError(_0x4e0749,null));};exports[_0x8db2('0x2b')]=function(_0xaab731,_0x4195ef){return db[_0x8db2('0x43')]['find']({'where':{'id':_0xaab731['params']['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x4195ef,null))[_0x8db2('0x2a')](removeEntity(_0x4195ef,null))[_0x8db2('0x48')](handleError(_0x4195ef,null));};exports[_0x8db2('0x4b')]=function(_0x3daed6,_0x2bf408){return db[_0x8db2('0x43')][_0x8db2('0x4b')]()[_0x8db2('0x2a')](respondWithResult(_0x2bf408,null))[_0x8db2('0x48')](handleError(_0x2bf408,null));};exports[_0x8db2('0x4c')]=function(_0x319273,_0x345c74){var _0x2d518a;return db[_0x8db2('0x4d')]['transaction'](function(_0x2ded23){return db[_0x8db2('0x43')]['create'](_0x319273[_0x8db2('0x4e')],{'transaction':_0x2ded23})[_0x8db2('0x2a')](function(_0x3af298){_0x2d518a=_0x3af298['get']({'plain':!![]});return db[_0x8db2('0x4f')][_0x8db2('0x50')]({'where':{'id':_0x2d518a[_0x8db2('0x51')]},'raw':!![]})[_0x8db2('0x2a')](function(_0x1167d5){return createVoicePrefixExtensions(_0x2d518a,_0x1167d5,_0x2ded23);});});})['then'](function(){var _0x467505=_0x319273[_0x8db2('0x52')][_0x8db2('0x2c')]({'plain':!![]});if(!_0x467505)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x467505[_0x8db2('0x53')]===_0x8db2('0x52')){var _0x33dddd=_0x2d518a;return db[_0x8db2('0x54')][_0x8db2('0x50')]({'where':{'name':_0x8db2('0x2d'),'userProfileId':_0x467505[_0x8db2('0x55')]},'raw':!![]})['then'](function(_0x39ff90){if(_0x39ff90&&_0x39ff90[_0x8db2('0x56')]===0x0){return db['UserProfileResource'][_0x8db2('0x4c')]({'name':_0x33dddd[_0x8db2('0x2f')],'resourceId':_0x33dddd['id'],'type':_0x39ff90['name'],'sectionId':_0x39ff90['id']},{})[_0x8db2('0x2a')](function(){return _0x2d518a;});}else{return _0x2d518a;}})[_0x8db2('0x48')](function(_0x63e8f7){logger[_0x8db2('0x57')](_0x8db2('0x58'),_0x63e8f7);throw _0x63e8f7;});}return _0x2d518a;})[_0x8db2('0x2a')](respondWithResult(_0x345c74,null))[_0x8db2('0x48')](handleError(_0x345c74,null));};function Extension(_0x33a600,_0x120ef2,_0x173a5e,_0x12fd12){this[_0x8db2('0x59')]=_0x8db2('0x5a');this[_0x8db2('0x5b')]=_0x33a600;this[_0x8db2('0x5c')]=_0x173a5e;this[_0x8db2('0x33')]='system';this[_0x8db2('0x5d')]=_0x8db2('0x5e');this[_0x8db2('0x5f')]=_0x120ef2;this[_0x8db2('0x60')]=_0x12fd12;}function createVoicePrefixExtensions(_0x349db0,_0x53b2dc,_0x3dd6b1){return new BPromise(function(_0x2c3087,_0x3ab670){var _0x1e1c0d=new Extension(formatPrefixName(_0x349db0[_0x8db2('0x61')]),0x1,_0x8db2('0x62'),_0x8db2('0x63'));_0x1e1c0d[_0x8db2('0x64')]=_0x349db0['id'];return db[_0x8db2('0x4f')][_0x8db2('0x4c')](_0x1e1c0d,{'transaction':_0x3dd6b1})[_0x8db2('0x2a')](function(_0xfe6bac){var _0x170a72=_0xfe6bac[_0x8db2('0x2c')]({'plain':!![]});var _0xed9d36=_[_0x8db2('0x31')](addVoicePrefixExtensions(_0x349db0,_0x53b2dc),function(_0x1d7862){_0x1d7862[_0x8db2('0x51')]=_0x170a72['id'];_0x1d7862['VoicePrefixId']=_0x349db0['id'];return _0x1d7862;});return db[_0x8db2('0x4f')]['bulkCreate'](_0xed9d36,{'transaction':_0x3dd6b1})[_0x8db2('0x2a')](function(_0x570c53){if(!_0x570c53){return _0x3ab670(_0x8db2('0x65'));}else{return _0x2c3087(_0x570c53);}})[_0x8db2('0x48')](function(_0xe4fd6a){return _0x3ab670(_0xe4fd6a);});});;});};function addVoicePrefixExtensions(_0x1e2ccd,_0x1e812e){var _0x59a32e=[];var _0x50c5fb=formatPrefixName(_0x1e2ccd[_0x8db2('0x61')]);_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x2,_0x8db2('0x67'),_0x8db2('0x68')+_0x1e2ccd[_0x8db2('0x2f')]));if(_0x1e2ccd[_0x8db2('0x69')]){_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x3,_0x8db2('0x67'),'PREFIX-CALLERIDALL='+_0x1e2ccd[_0x8db2('0x69')]));}else{_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x3,_0x8db2('0x62'),_0x8db2('0x6a')));}_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x4,_0x8db2('0x6b'),_0x1e812e[_0x8db2('0x59')]+','+_0x8db2('0x6c')+(0x8+_0x1e2ccd['name']['length'])+'}'+','+0x1));return _0x59a32e;}function formatPrefixName(_0x358009){var _0x2f8beb='_';for(var _0x1d2dfc=0x0;_0x1d2dfc<_0x358009[_0x8db2('0x3a')];_0x1d2dfc++){if(_0x358009[_0x8db2('0x6d')](_0x1d2dfc)=='-'){_0x2f8beb+=_0x358009['charAt'](_0x1d2dfc);}else{_0x2f8beb+='['+_0x358009['charAt'](_0x1d2dfc)+']';}}_0x2f8beb+='.';return _0x2f8beb;}exports[_0x8db2('0x6e')]=function(_0x364807,_0x54f0d4,_0xa698bd){var _0x2be647=_0x364807[_0x8db2('0x4e')];_0x2be647['prefix']=_0x8db2('0x6f')+_0x2be647[_0x8db2('0x2f')]+'-';return db[_0x8db2('0x4d')]['transaction'](function(_0x3ff023){return db[_0x8db2('0x43')][_0x8db2('0x6e')](_0x2be647,{'where':{'id':_0x2be647['id']},'transaction':_0x3ff023})[_0x8db2('0x2a')](function(){return db[_0x8db2('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x2be647['id']},'transaction':_0x3ff023})[_0x8db2('0x2a')](function(){return db[_0x8db2('0x4f')][_0x8db2('0x50')]({'where':{'id':_0x2be647['VoiceExtensionId']},'raw':!![]})['then'](function(_0x2cdf3c){return createVoicePrefixExtensions(_0x2be647,_0x2cdf3c,_0x3ff023);});});});})[_0x8db2('0x2a')](function(){return db['VoicePrefix'][_0x8db2('0x70')](_0x2be647['id']);})[_0x8db2('0x2a')](respondWithResult(_0x54f0d4,null))[_0x8db2('0x48')](handleError(_0x54f0d4,null));};exports[_0x8db2('0x71')]=function(_0xbf1fce,_0x16848b,_0x395ebb){return db[_0x8db2('0x43')][_0x8db2('0x50')]({'where':{'id':_0xbf1fce[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x16848b,null))[_0x8db2('0x2a')](function(_0x24a52d){if(_0x24a52d){return _0x24a52d['addAgents'](_0xbf1fce[_0x8db2('0x4e')]['ids'],_[_0x8db2('0x72')](_0xbf1fce[_0x8db2('0x4e')],['ids','id'])||{})[_0x8db2('0x73')](function(_0x2fa89d){for(var _0x5cdf53=0x0;_0x5cdf53<_0xbf1fce[_0x8db2('0x4e')][_0x8db2('0x74')][_0x8db2('0x3a')];_0x5cdf53+=0x1){socket[_0x8db2('0x75')](_0x8db2('0x76'),{'UserId':Number(_0xbf1fce[_0x8db2('0x4e')][_0x8db2('0x74')][_0x5cdf53]),'VoicePrefixId':Number(_0xbf1fce[_0x8db2('0x49')]['id'])});}return _0x2fa89d;});}})[_0x8db2('0x2a')](respondWithResult(_0x16848b,null))['catch'](handleError(_0x16848b,null));};exports['removeAgents']=function(_0x198c3b,_0x508f4a,_0xf8afa5){return db[_0x8db2('0x43')][_0x8db2('0x50')]({'where':{'id':_0x198c3b['params']['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x508f4a,null))[_0x8db2('0x2a')](function(_0x3e37e7){if(_0x3e37e7){return _0x3e37e7['removeAgents'](_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')])[_0x8db2('0x2a')](function(){if(_[_0x8db2('0x77')](_0x198c3b['query'][_0x8db2('0x74')])){for(var _0x5f61b8=0x0;_0x5f61b8<_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')][_0x8db2('0x3a')];_0x5f61b8+=0x1){socket[_0x8db2('0x75')](_0x8db2('0x78'),{'UserId':Number(_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')][_0x5f61b8]),'VoicePrefixId':Number(_0x198c3b[_0x8db2('0x49')]['id'])});}}else{socket[_0x8db2('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')]),'VoicePrefixId':Number(_0x198c3b[_0x8db2('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x508f4a,null))['catch'](handleError(_0x508f4a,null));};exports['getAgents']=function(_0xa09b1d,_0xdba223,_0x3191c8){var _0x454377={};var _0x2ad024={};var _0x313918;var _0x339d09;return db[_0x8db2('0x43')][_0x8db2('0x79')]({'where':{'id':_0xa09b1d[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0xdba223,null))['then'](function(_0x360a06){if(_0x360a06){_0x313918=_0x360a06;_0x2ad024[_0x8db2('0x35')]=_[_0x8db2('0x37')](db[_0x8db2('0x7a')]['rawAttributes']);_0x2ad024['query']=_[_0x8db2('0x37')](_0xa09b1d[_0x8db2('0x36')]);_0x2ad024['filters']=_[_0x8db2('0x38')](_0x2ad024[_0x8db2('0x35')],_0x2ad024[_0x8db2('0x36')]);_0x454377['attributes']=_['intersection'](_0x2ad024['model'],qs[_0x8db2('0x4a')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x4a')]));_0x454377[_0x8db2('0x39')]=_0x454377[_0x8db2('0x39')]['length']?_0x454377[_0x8db2('0x39')]:_0x2ad024['model'];_0x454377[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x3d')]);_0x454377[_0x8db2('0x3e')]=qs['filters'](_['pick'](_0xa09b1d[_0x8db2('0x36')],_0x2ad024['filters']));if(_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x41')]){_0x454377[_0x8db2('0x3e')]=_[_0x8db2('0x42')](_0x454377[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x454377['attributes'],function(_0x19f9a0){var _0x222ea2={};_0x222ea2[_0x19f9a0]={'$like':'%'+_0xa09b1d[_0x8db2('0x36')]['filter']+'%'};return _0x222ea2;})});}_0x454377=_[_0x8db2('0x42')]({},_0x454377,_0xa09b1d[_0x8db2('0x7b')]);return _0x313918['getAgents'](_0x454377);}})[_0x8db2('0x2a')](function(_0x7cb97d){if(_0x7cb97d){_0x339d09=_0x7cb97d[_0x8db2('0x3a')];if(!_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x7c')](_0x8db2('0x3b'))){_0x454377[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0xa09b1d[_0x8db2('0x36')]['limit']);_0x454377[_0x8db2('0x22')]=qs[_0x8db2('0x22')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x22')]);}return _0x313918[_0x8db2('0x7d')](_0x454377);}})[_0x8db2('0x2a')](function(_0x16d1c5){if(_0x16d1c5){return _0x16d1c5?{'count':_0x339d09,'rows':_0x16d1c5}:null;}})[_0x8db2('0x2a')](respondWithResult(_0xdba223,null))[_0x8db2('0x48')](handleError(_0xdba223,null));};exports[_0x8db2('0x7e')]=function(_0x5e6fc4,_0x3e79cc,_0x7e4bf){var _0x339ffe={};var _0x1587e8={};var _0x5d371b;var _0x4589c7;return db[_0x8db2('0x43')][_0x8db2('0x79')]({'where':{'id':_0x5e6fc4['params']['id']}})['then'](handleEntityNotFound(_0x3e79cc,null))[_0x8db2('0x2a')](function(_0x6e5a58){if(_0x6e5a58){_0x5d371b=_0x6e5a58;_0x1587e8[_0x8db2('0x35')]=_[_0x8db2('0x37')](db['Team'][_0x8db2('0x7f')]);_0x1587e8[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x5e6fc4[_0x8db2('0x36')]);_0x1587e8['filters']=_[_0x8db2('0x38')](_0x1587e8[_0x8db2('0x35')],_0x1587e8[_0x8db2('0x36')]);_0x339ffe['attributes']=_['intersection'](_0x1587e8['model'],qs[_0x8db2('0x4a')](_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x4a')]));_0x339ffe[_0x8db2('0x39')]=_0x339ffe['attributes']['length']?_0x339ffe[_0x8db2('0x39')]:_0x1587e8[_0x8db2('0x35')];_0x339ffe[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x3d')]);_0x339ffe['where']=qs[_0x8db2('0x3f')](_['pick'](_0x5e6fc4[_0x8db2('0x36')],_0x1587e8[_0x8db2('0x3f')]));if(_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x41')]){_0x339ffe[_0x8db2('0x3e')]=_['merge'](_0x339ffe[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x339ffe['attributes'],function(_0x28beec){var _0x1334ea={};_0x1334ea[_0x28beec]={'$like':'%'+_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x41')]+'%'};return _0x1334ea;})});}_0x339ffe=_['merge']({},_0x339ffe,_0x5e6fc4[_0x8db2('0x7b')]);return _0x5d371b['getTeams'](_0x339ffe);}})['then'](function(_0xaa90b9){if(_0xaa90b9){_0x4589c7=_0xaa90b9[_0x8db2('0x3a')];if(!_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x7c')](_0x8db2('0x3b'))){_0x339ffe[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x5e6fc4['query'][_0x8db2('0x25')]);_0x339ffe['offset']=qs['offset'](_0x5e6fc4[_0x8db2('0x36')]['offset']);}return _0x5d371b['getTeams'](_0x339ffe);}})[_0x8db2('0x2a')](function(_0x1642a7){if(_0x1642a7){return _0x1642a7?{'count':_0x4589c7,'rows':_0x1642a7}:null;}})[_0x8db2('0x2a')](respondWithResult(_0x3e79cc,null))['catch'](handleError(_0x3e79cc,null));};exports[_0x8db2('0x80')]=function(_0xb2ab8e,_0x30d410,_0x555ed0){var _0x27a916=_0xb2ab8e[_0x8db2('0x4e')][_0x8db2('0x74')];var _0x7ff636;return db[_0x8db2('0x81')][_0x8db2('0x46')]({'where':{'id':_0x27a916},'attributes':['id'],'include':[{'model':db[_0x8db2('0x7a')],'as':_0x8db2('0x82'),'attributes':['id','name',_0x8db2('0x83'),_0x8db2('0x84'),_0x8db2('0x85')],'raw':!![]}]})[_0x8db2('0x2a')](function(_0x20d69b){if(_0x20d69b){_0x7ff636=_0x20d69b;var _0x36199d=_[_0x8db2('0x86')](_0x20d69b,function(_0x2910c8){var _0x3a53e2=_0x2910c8[_0x8db2('0x2c')]({'plain':!![]});return _0x3a53e2[_0x8db2('0x82')];});return db['VoicePrefix'][_0x8db2('0x50')]({'where':{'id':_0xb2ab8e[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](function(_0x58063b){return db[_0x8db2('0x4d')][_0x8db2('0x87')](function(_0x3c105f){return _0x58063b['addTeams'](_0x27a916,{'transaction':_0x3c105f})['then'](function(){return BPromise[_0x8db2('0x88')](_0x7ff636,function(_0x17d3ee){return db[_0x8db2('0x89')][_0x8db2('0x8a')]({'TeamId':_0x17d3ee['id'],'VoicePrefixId':_0xb2ab8e[_0x8db2('0x49')]['id']},{'transaction':_0x3c105f});});})[_0x8db2('0x2a')](function(){return BPromise[_0x8db2('0x88')](_0x36199d,function(_0x1f1aa5){return db[_0x8db2('0x8b')][_0x8db2('0x8c')]({'where':{'UserId':_0x1f1aa5['id'],'VoicePrefixId':_0xb2ab8e['params']['id']},'transaction':_0x3c105f});});})[_0x8db2('0x2a')](function(){_0x36199d[_0x8db2('0x8d')](function(_0x5b8adc){socket[_0x8db2('0x75')](_0x8db2('0x76'),{'UserId':_0x5b8adc['id'],'VoicePrefixId':_0x58063b['id']});});});});});}})[_0x8db2('0x2a')](respondWithStatusCode(_0x30d410,null))[_0x8db2('0x48')](handleError(_0x30d410,null));};exports[_0x8db2('0x8e')]=function(_0x2e4fb3,_0x8f84e4,_0x372efd){return db[_0x8db2('0x81')][_0x8db2('0x46')]({'where':{'id':_0x2e4fb3[_0x8db2('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8db2('0x7a')],'as':_0x8db2('0x82'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x2a')](handleEntityNotFound(_0x8f84e4,null))[_0x8db2('0x2a')](function(_0x1d27e3){var _0x296981=_['map'](_0x1d27e3,'id');var _0x137788=[];var _0x19bc4d=[];var _0x339dbf=squel[_0x8db2('0x8f')]();_0x339dbf[_0x8db2('0x90')](_0x8db2('0x91'))[_0x8db2('0x92')](_0x8db2('0x93'),'tq')[_0x8db2('0x94')](_0x8db2('0x95'),'ut',_0x8db2('0x96'))['where']('VoicePrefixId\x20=\x20?',_0x2e4fb3[_0x8db2('0x49')]['id']);for(var _0x56f59b=0x0;_0x56f59b<_0x1d27e3[_0x8db2('0x3a')];_0x56f59b+=0x1){let _0xccdab2=_0x1d27e3[_0x56f59b];for(var _0x2428f1=0x0;_0x2428f1<_0xccdab2['Agents'][_0x8db2('0x3a')];_0x2428f1+=0x1){let _0x28cfee=_0xccdab2[_0x8db2('0x82')][_0x2428f1];var _0x3e154a=_0x339dbf['clone']();_0x3e154a[_0x8db2('0x3e')](_0x8db2('0x97'),_0x28cfee['id']);_0x19bc4d[_0x8db2('0x66')](db['sequelize'][_0x8db2('0x36')](_0x3e154a[_0x8db2('0x98')](),{'type':db[_0x8db2('0x4d')]['QueryTypes'][_0x8db2('0x99')]})[_0x8db2('0x2a')](function(_0x41957f){if(_0x41957f['length']===0x1){return _0x28cfee['id'];}else{var _0x18ac5c=_[_0x8db2('0x9a')](_['map'](_0x41957f,_0x8db2('0x9b')),function(_0x231360){return _['includes'](_0x296981,_0x231360);});if(_0x18ac5c){return _0x28cfee['id'];}}}));}}return BPromise[_0x8db2('0x9c')](_0x19bc4d)[_0x8db2('0x2a')](function(_0x3d2729){_0x137788=_(_0x137788)['union'](_0x3d2729)['compact']()[_0x8db2('0x9d')]();return db['VoicePrefix']['find']({'where':{'id':_0x2e4fb3[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](function(_0x37fda2){return db[_0x8db2('0x4d')][_0x8db2('0x87')](function(_0x3695cd){return _0x37fda2['removeTeams'](_0x2e4fb3['query'][_0x8db2('0x74')],{'transaction':_0x3695cd})[_0x8db2('0x2a')](function(){if(!_[_0x8db2('0x9e')](_0x137788)){return _0x37fda2[_0x8db2('0x9f')](_0x137788,{'transaction':_0x3695cd});}})['then'](function(){_0x137788[_0x8db2('0x8d')](function(_0x51d15e){socket[_0x8db2('0x75')]('userVoicePrefix:remove',{'UserId':_0x51d15e,'VoicePrefixId':_0x37fda2['id']});});});});});});})[_0x8db2('0x2a')](respondWithStatusCode(_0x8f84e4,null))[_0x8db2('0x48')](handleError(_0x8f84e4,null));};
\ No newline at end of file
index b180a2c..c04f801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ee=['remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','save','update'];(function(_0x510b08,_0x16cd04){var _0xbf9488=function(_0x2bd2bd){while(--_0x2bd2bd){_0x510b08['push'](_0x510b08['shift']());}};_0xbf9488(++_0x16cd04);}(_0x40ee,0x1cf));var _0xe40e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x40ee[_0x311c35];return _0x5cc50c;};'use strict';var EventEmitter=require(_0xe40e('0x0'));var VoicePrefix=require(_0xe40e('0x1'))['db'][_0xe40e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe40e('0x3'),'afterUpdate':_0xe40e('0x4'),'afterDestroy':_0xe40e('0x5')};function emitEvent(_0xe63dec){return function(_0x3a7771,_0x35015c,_0x25a4d6){VoicePrefixEvents[_0xe40e('0x6')](_0xe63dec+':'+_0x3a7771['id'],_0x3a7771);VoicePrefixEvents[_0xe40e('0x6')](_0xe63dec,_0x3a7771);_0x25a4d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xe40e('0x7')](e,emitEvent(event));}}module[_0xe40e('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xd145=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xd145,0x9b));var _0x5d14=function(_0x17a3f8,_0x498558){_0x17a3f8=_0x17a3f8-0x0;var _0x3ffab5=_0xd145[_0x17a3f8];return _0x3ffab5;};'use strict';var EventEmitter=require(_0x5d14('0x0'));var VoicePrefix=require(_0x5d14('0x1'))['db'][_0x5d14('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5d14('0x3')](0x0);var events={'afterCreate':_0x5d14('0x4'),'afterUpdate':_0x5d14('0x5'),'afterDestroy':_0x5d14('0x6')};function emitEvent(_0x53b5ec){return function(_0x89c357,_0x18e28d,_0x5c6a5c){VoicePrefixEvents[_0x5d14('0x7')](_0x53b5ec+':'+_0x89c357['id'],_0x89c357);VoicePrefixEvents[_0x5d14('0x7')](_0x53b5ec,_0x89c357);_0x5c6a5c(null);};}for(var e in events){if(events[_0x5d14('0x8')](e)){var event=events[e];VoicePrefix[_0x5d14('0x9')](e,emitEvent(event));}}module[_0x5d14('0xa')]=VoicePrefixEvents;
\ No newline at end of file
index 23cc533..604146e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8541=['moment','bluebird','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8541,0x17a));var _0x1854=function(_0x190f79,_0x42b941){_0x190f79=_0x190f79-0x0;var _0x297354=_0x8541[_0x190f79];return _0x297354;};'use strict';var _=require(_0x1854('0x0'));var util=require('util');var logger=require(_0x1854('0x1'))('api');var moment=require(_0x1854('0x2'));var BPromise=require(_0x1854('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1854('0x4'));var rimraf=require(_0x1854('0x5'));var config=require(_0x1854('0x6'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x4451ad,_0x29189f){return _0x4451ad[_0x1854('0x7')](_0x1854('0x8'),attributes,{'tableName':_0x1854('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c97=['bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','moment'];(function(_0x1adc63,_0x23a0c3){var _0x38ae16=function(_0x26cfa6){while(--_0x26cfa6){_0x1adc63['push'](_0x1adc63['shift']());}};_0x38ae16(++_0x23a0c3);}(_0x2c97,0xe1));var _0x72c9=function(_0x281677,_0x2a8e0a){_0x281677=_0x281677-0x0;var _0x387bc8=_0x2c97[_0x281677];return _0x387bc8;};'use strict';var _=require('lodash');var util=require(_0x72c9('0x0'));var logger=require(_0x72c9('0x1'))('api');var moment=require(_0x72c9('0x2'));var BPromise=require(_0x72c9('0x3'));var rp=require(_0x72c9('0x4'));var fs=require('fs');var path=require(_0x72c9('0x5'));var rimraf=require('rimraf');var config=require(_0x72c9('0x6'));var attributes=require(_0x72c9('0x7'));module[_0x72c9('0x8')]=function(_0x26e22e,_0xeada43){return _0x26e22e[_0x72c9('0x9')](_0x72c9('0xa'),attributes,{'tableName':_0x72c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5827456..7d83969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0adf=['debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x146b4d,_0x44c4cd){var _0x154f5d=function(_0x9adaa3){while(--_0x9adaa3){_0x146b4d['push'](_0x146b4d['shift']());}};_0x154f5d(++_0x44c4cd);}(_0x0adf,0x1d2));var _0xf0ad=function(_0xa71c9f,_0x5c15dd){_0xa71c9f=_0xa71c9f-0x0;var _0x10533f=_0x0adf[_0xa71c9f];return _0x10533f;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});config[_0xf0ad('0xb')]=_[_0xf0ad('0xc')](config[_0xf0ad('0xb')],{'host':_0xf0ad('0xd'),'port':0x18eb});var socket=require(_0xf0ad('0xe'))(new Redis(config[_0xf0ad('0xb')]));require(_0xf0ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ab4eb,_0x53c81a,_0x24db70){return new BPromise(function(_0x1f2952,_0x43fb01){return client[_0xf0ad('0x10')](_0x2ab4eb,_0x24db70)[_0xf0ad('0x11')](function(_0x4f2b79){logger['info'](_0xf0ad('0x12'),_0x53c81a,_0xf0ad('0x13'));logger[_0xf0ad('0x14')](_0xf0ad('0x15'),_0x53c81a,'request\x20sent',JSON[_0xf0ad('0x16')](_0x4f2b79));if(_0x4f2b79[_0xf0ad('0x17')]){if(_0x4f2b79['error']['code']===0x1f4){logger['error'](_0xf0ad('0x12'),_0x53c81a,_0x4f2b79['error'][_0xf0ad('0x18')]);return _0x43fb01(_0x4f2b79[_0xf0ad('0x17')][_0xf0ad('0x18')]);}logger[_0xf0ad('0x17')](_0xf0ad('0x12'),_0x53c81a,_0x4f2b79['error'][_0xf0ad('0x18')]);return _0x1f2952(_0x4f2b79[_0xf0ad('0x17')][_0xf0ad('0x18')]);}else{logger[_0xf0ad('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x53c81a,'request\x20sent');_0x1f2952(_0x4f2b79[_0xf0ad('0x1a')][_0xf0ad('0x18')]);}})['catch'](function(_0x32d05c){logger[_0xf0ad('0x17')](_0xf0ad('0x12'),_0x53c81a,_0x32d05c);_0x43fb01(_0x32d05c);});});}
\ No newline at end of file
+var _0x1b9b=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','defaults','redis','localhost','./voicePrefix.socket'];(function(_0x202d6c,_0x2bba40){var _0x4c95eb=function(_0x345e73){while(--_0x345e73){_0x202d6c['push'](_0x202d6c['shift']());}};_0x4c95eb(++_0x2bba40);}(_0x1b9b,0x89));var _0xb1b9=function(_0x358d84,_0x363c8a){_0x358d84=_0x358d84-0x0;var _0x1e1706=_0x1b9b[_0x358d84];return _0x1e1706;};'use strict';var _=require(_0xb1b9('0x0'));var util=require('util');var moment=require(_0xb1b9('0x1'));var BPromise=require(_0xb1b9('0x2'));var rs=require(_0xb1b9('0x3'));var fs=require('fs');var Redis=require(_0xb1b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1b9('0x5'));var logger=require(_0xb1b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb1b9('0x7')][_0xb1b9('0x8')]({'port':0x232a});config['redis']=_[_0xb1b9('0x9')](config[_0xb1b9('0xa')],{'host':_0xb1b9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1b9('0xa')]));require(_0xb1b9('0xc'))[_0xb1b9('0xd')](socket);function respondWithRpcPromise(_0x509e87,_0x178bb4,_0x535387){return new BPromise(function(_0x31b546,_0x5a6c8c){return client[_0xb1b9('0xe')](_0x509e87,_0x535387)[_0xb1b9('0xf')](function(_0x1595a6){logger[_0xb1b9('0x10')](_0xb1b9('0x11'),_0x178bb4,_0xb1b9('0x12'));logger[_0xb1b9('0x13')](_0xb1b9('0x14'),_0x178bb4,'request\x20sent',JSON[_0xb1b9('0x15')](_0x1595a6));if(_0x1595a6[_0xb1b9('0x16')]){if(_0x1595a6[_0xb1b9('0x16')]['code']===0x1f4){logger[_0xb1b9('0x16')](_0xb1b9('0x11'),_0x178bb4,_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);return _0x5a6c8c(_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);}logger['error'](_0xb1b9('0x11'),_0x178bb4,_0x1595a6['error'][_0xb1b9('0x17')]);return _0x31b546(_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);}else{logger[_0xb1b9('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x178bb4,_0xb1b9('0x12'));_0x31b546(_0x1595a6[_0xb1b9('0x18')][_0xb1b9('0x17')]);}})['catch'](function(_0x26d012){logger[_0xb1b9('0x16')](_0xb1b9('0x11'),_0x178bb4,_0x26d012);_0x5a6c8c(_0x26d012);});});}
\ No newline at end of file
index 6122546..1e70dfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4627=['remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x4a7676,_0x1da633){var _0x5d4158=function(_0x1b7e00){while(--_0x1b7e00){_0x4a7676['push'](_0x4a7676['shift']());}};_0x5d4158(++_0x1da633);}(_0x4627,0x115));var _0x7462=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x4627[_0x46ae5a];return _0x434986;};'use strict';var VoicePrefixEvents=require(_0x7462('0x0'));var events=[_0x7462('0x1'),_0x7462('0x2'),_0x7462('0x3')];function createListener(_0x25dae7,_0x2759ce){return function(_0xde73dc){_0x2759ce[_0x7462('0x4')](_0x25dae7,_0xde73dc);};}function removeListener(_0x3c7a10,_0x35004e){return function(){VoicePrefixEvents[_0x7462('0x5')](_0x3c7a10,_0x35004e);};}exports[_0x7462('0x6')]=function(_0x363d98){for(var _0x54bd2e=0x0,_0x1a6616=events[_0x7462('0x7')];_0x54bd2e<_0x1a6616;_0x54bd2e++){var _0x2347af=events[_0x54bd2e];var _0x2159ed=createListener(_0x7462('0x8')+_0x2347af,_0x363d98);VoicePrefixEvents['on'](_0x2347af,_0x2159ed);}};
\ No newline at end of file
+var _0x8e44=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x539722,_0x2d567e){var _0x803499=function(_0x59a2cb){while(--_0x59a2cb){_0x539722['push'](_0x539722['shift']());}};_0x803499(++_0x2d567e);}(_0x8e44,0x1ac));var _0x48e4=function(_0x31c6ca,_0x5b37b3){_0x31c6ca=_0x31c6ca-0x0;var _0x1b5088=_0x8e44[_0x31c6ca];return _0x1b5088;};'use strict';var VoicePrefixEvents=require(_0x48e4('0x0'));var events=[_0x48e4('0x1'),_0x48e4('0x2'),'update'];function createListener(_0x4e2dc2,_0x3e0b0d){return function(_0x30d851){_0x3e0b0d[_0x48e4('0x3')](_0x4e2dc2,_0x30d851);};}function removeListener(_0x3c498f,_0x4f1027){return function(){VoicePrefixEvents[_0x48e4('0x4')](_0x3c498f,_0x4f1027);};}exports[_0x48e4('0x5')]=function(_0x27d37f){for(var _0x4dffab=0x0,_0x4e2c12=events[_0x48e4('0x6')];_0x4dffab<_0x4e2c12;_0x4dffab++){var _0xfd30df=events[_0x4dffab];var _0x552cb1=createListener(_0x48e4('0x7')+_0xfd30df,_0x27d37f);VoicePrefixEvents['on'](_0xfd30df,_0x552cb1);}};
\ No newline at end of file
index 40456af..653560c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x323591,_0x518650){var _0x423982=function(_0x1b7a15){while(--_0x1b7a15){_0x323591['push'](_0x323591['shift']());}};_0x423982(++_0x518650);}(_0xb10b,0x12a));var _0xbb10=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0xb10b[_0x45c0da];return _0x51efff;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x21c130,_0x225833){_0x21c130=_0x21c130-0x0;var _0x58f574=_0xb10b[_0x21c130];return _0x58f574;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
index 9502c18..df592b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c8=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','leastrecent','fewestcalls','random','rrmemory','setDataValue','strategy','getDataValue','type','dialMethod','outbound','preview','roundrobin','includes','INTEGER','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','BOOLEAN','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)'];(function(_0x34db65,_0x3a576e){var _0x473fad=function(_0x34c713){while(--_0x34c713){_0x34db65['push'](_0x34db65['shift']());}};_0x473fad(++_0x3a576e);}(_0xf1c8,0x107));var _0x8f1c=function(_0x44aca4,_0x2997c2){_0x44aca4=_0x44aca4-0x0;var _0x44e216=_0xf1c8[_0x44aca4];return _0x44e216;};'use strict';var Sequelize=require(_0x8f1c('0x0'));module[_0x8f1c('0x1')]={'name':{'type':Sequelize[_0x8f1c('0x2')],'allowNull':![],'unique':_0x8f1c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x5'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x8f1c('0x4')]('rr','ringall',_0x8f1c('0x6'),_0x8f1c('0x7'),_0x8f1c('0x8'),_0x8f1c('0x9'),'linear','wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x2a2fdd){this[_0x8f1c('0xa')](_0x8f1c('0xb'),_0x2a2fdd?_0x2a2fdd:_0x8f1c('0x9'));},'get':function(){var _0x1ec084=this[_0x8f1c('0xc')](_0x8f1c('0xd'));var _0x454443=this[_0x8f1c('0xc')](_0x8f1c('0xe'));var _0x1e7d02=this[_0x8f1c('0xc')](_0x8f1c('0xb'));if(_0x1ec084===_0x8f1c('0xf')){if(_0x454443===_0x8f1c('0x10')){return null;}if(_0x454443==='booked'&&![_0x8f1c('0x9'),_0x8f1c('0x11')][_0x8f1c('0x12')](_0x1e7d02)){this['setDataValue'](_0x8f1c('0xb'),_0x8f1c('0x9'));}}return _0x1e7d02;}},'servicelevel':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8f1c('0x13')](0xb)},'timeout':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x8f1c('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8f1c('0x14'),'no'),'defaultValue':_0x8f1c('0x14')},'autopause':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no',_0x8f1c('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8f1c('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8f1c('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8f1c('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8f1c('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defaultValue':_0x8f1c('0x14')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x8f1c('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x8f1c('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8f1c('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8f1c('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x8f1c('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x8f1c('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x34f297){this[_0x8f1c('0xa')]('periodic_announce',_0x34f297?_0x34f297['join'](','):[]);},'get':function(){return this[_0x8f1c('0xc')]('periodic_announce')?this[_0x8f1c('0xc')](_0x8f1c('0x17'))[_0x8f1c('0x18')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x8f1c('0x14'),'set':function(_0x2c23a6){this[_0x8f1c('0xa')](_0x8f1c('0x19'),_0x2c23a6?_0x2c23a6[_0x8f1c('0x1a')](','):undefined);},'get':function(){return this[_0x8f1c('0xc')]('joinempty')?this[_0x8f1c('0xc')]('joinempty')[_0x8f1c('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':'no','set':function(_0x1a43ae){this['setDataValue'](_0x8f1c('0x1b'),_0x1a43ae?_0x1a43ae[_0x8f1c('0x1a')](','):undefined);},'get':function(){return this[_0x8f1c('0xc')](_0x8f1c('0x1b'))?this[_0x8f1c('0xc')](_0x8f1c('0x1b'))[_0x8f1c('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8f1c('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8f1c('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8f1c('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1c539f){this['setDataValue'](_0x8f1c('0x1c'),_0x1c539f);if(_0x1c539f){if(this[_0x8f1c('0xc')](_0x8f1c('0x1d'))<0x2){this[_0x8f1c('0xa')](_0x8f1c('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x8f1c('0x10'),_0x8f1c('0x1f'),_0x8f1c('0x20'),_0x8f1c('0x21'),_0x8f1c('0x22')),'defaultValue':_0x8f1c('0x1f'),'comment':_0x8f1c('0x23')},'dialLimitChannel':{'type':Sequelize[_0x8f1c('0x13')](0x4)[_0x8f1c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8f1c('0x25')},'dialLimitQueue':{'type':Sequelize[_0x8f1c('0x13')](0x4)[_0x8f1c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8f1c('0x26')},'dialPowerLevel':{'type':Sequelize[_0x8f1c('0x27')](0x2)[_0x8f1c('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8f1c('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x29'),'dropRate'),'defaultValue':_0x8f1c('0x2a'),'comment':_0x8f1c('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8f1c('0x27')](0x2)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x8f1c('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8f1c('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8f1c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8f1c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':_0x8f1c('0x2d'),'comment':_0x8f1c('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f1c('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f1c('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f1c('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'comment':_0x8f1c('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f1c('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8f1c('0x34')},'dialTimezone':{'type':Sequelize[_0x8f1c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8f1c('0x35'),_0x8f1c('0x36'),_0x8f1c('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':0x0,'comment':_0x8f1c('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8f1c('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8f1c('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x8f1c('0x13')](0x9)[_0x8f1c('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8f1c('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8f1c('0x13')](0x9)[_0x8f1c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8f1c('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8f1c('0x13')](0x9)[_0x8f1c('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8f1c('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8f1c('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8f1c('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8f1c('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8f1c('0x13')](0x9)[_0x8f1c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8f1c('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8f1c('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':0x0,'comment':_0x8f1c('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8f1c('0x4')](_0x8f1c('0x42'),_0x8f1c('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x8f1c('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8f1c('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8f1c('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8f1c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f1c('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f1c('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)[_0x8f1c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f1c('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f1c('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8f1c('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f1c('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x8f1c('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':![],'comment':_0x8f1c('0x4c'),'set':function(_0x318715){if(!_0x318715)this['setDataValue'](_0x8f1c('0x4d'),null);this['setDataValue'](_0x8f1c('0x4e'),_0x318715);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x8f1c('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8f1c('0x13')](0x3)[_0x8f1c('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8f1c('0x1e')],'defaultValue':![]}};
\ No newline at end of file
+var _0x25df=['Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','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\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','linear','wrandom','rrordered','setDataValue','strategy','type','dialMethod','getDataValue','preview','booked','rrmemory','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','BOOLEAN'];(function(_0x5468bf,_0x48c1ad){var _0x3c6c01=function(_0x34cab0){while(--_0x34cab0){_0x5468bf['push'](_0x5468bf['shift']());}};_0x3c6c01(++_0x48c1ad);}(_0x25df,0xaf));var _0xf25d=function(_0x10183f,_0x2d380e){_0x10183f=_0x10183f-0x0;var _0x337b6f=_0x25df[_0x10183f];return _0x337b6f;};'use strict';var Sequelize=require(_0xf25d('0x0'));module[_0xf25d('0x1')]={'name':{'type':Sequelize[_0xf25d('0x2')],'allowNull':![],'unique':_0xf25d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf25d('0x4')]('inbound',_0xf25d('0x5')),'allowNull':![],'defaultValue':_0xf25d('0x6')},'musiconhold':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':_0xf25d('0x7')},'announce':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf25d('0x4')]('rr',_0xf25d('0x8'),_0xf25d('0x9'),'fewestcalls','random','rrmemory',_0xf25d('0xa'),_0xf25d('0xb'),_0xf25d('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x1f7f69){this[_0xf25d('0xd')](_0xf25d('0xe'),_0x1f7f69?_0x1f7f69:'rrmemory');},'get':function(){var _0x44cd66=this['getDataValue'](_0xf25d('0xf'));var _0x5bdb5b=this['getDataValue'](_0xf25d('0x10'));var _0x137fe5=this[_0xf25d('0x11')]('strategy');if(_0x44cd66===_0xf25d('0x5')){if(_0x5bdb5b===_0xf25d('0x12')){return null;}if(_0x5bdb5b===_0xf25d('0x13')&&![_0xf25d('0x14'),_0xf25d('0x15')]['includes'](_0x137fe5)){this['setDataValue'](_0xf25d('0xe'),_0xf25d('0x14'));}}return _0x137fe5;}},'servicelevel':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf25d('0x16')](0xb)},'timeout':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf25d('0x2')]},'weight':{'type':Sequelize[_0xf25d('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':_0xf25d('0x17')},'autopause':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no',_0xf25d('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf25d('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf25d('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf25d('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf25d('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf25d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':_0xf25d('0x17')},'announce_holdtime':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no',_0xf25d('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xf25d('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf25d('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf25d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf25d('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xf25d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xf25d('0x2')]},'queue_less_than':{'type':Sequelize[_0xf25d('0x2')]},'periodic_announce':{'type':Sequelize[_0xf25d('0x1a')],'set':function(_0x3bd627){this[_0xf25d('0xd')](_0xf25d('0x1b'),_0x3bd627?_0x3bd627[_0xf25d('0x1c')](','):[]);},'get':function(){return this[_0xf25d('0x11')](_0xf25d('0x1b'))?this['getDataValue'](_0xf25d('0x1b'))[_0xf25d('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xf25d('0x17'),'set':function(_0x277b31){this[_0xf25d('0xd')](_0xf25d('0x1e'),_0x277b31?_0x277b31[_0xf25d('0x1c')](','):undefined);},'get':function(){return this[_0xf25d('0x11')]('joinempty')?this[_0xf25d('0x11')](_0xf25d('0x1e'))[_0xf25d('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':'no','set':function(_0x130f2a){this[_0xf25d('0xd')](_0xf25d('0x1f'),_0x130f2a?_0x130f2a['join'](','):undefined);},'get':function(){return this[_0xf25d('0x11')]('leavewhenempty')?this['getDataValue'](_0xf25d('0x1f'))[_0xf25d('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xf25d('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf25d('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf25d('0x2')]},'description':{'type':Sequelize[_0xf25d('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x53e423){this[_0xf25d('0xd')]('acw',_0x53e423);if(_0x53e423){if(this[_0xf25d('0x11')](_0xf25d('0x20'))<0x2){this[_0xf25d('0xd')](_0xf25d('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf25d('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xf25d('0x12'),'progressive',_0xf25d('0x21'),_0xf25d('0x22'),_0xf25d('0x13')),'defaultValue':_0xf25d('0x23'),'comment':_0xf25d('0x24')},'dialLimitChannel':{'type':Sequelize[_0xf25d('0x16')](0x4)[_0xf25d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf25d('0x26')},'dialLimitQueue':{'type':Sequelize[_0xf25d('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xf25d('0x27')](0x2)[_0xf25d('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf25d('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x29'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf25d('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf25d('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf25d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf25d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf25d('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':_0xf25d('0x2d'),'comment':_0xf25d('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x2f')},'dialQueueProject':{'type':Sequelize[_0xf25d('0x2')],'comment':_0xf25d('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf25d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf25d('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf25d('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xf25d('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf25d('0x4')]('always',_0xf25d('0x36'),_0xf25d('0x37')),'defaultValue':_0xf25d('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf25d('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf25d('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf25d('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf25d('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf25d('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf25d('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf25d('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf25d('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf25d('0x16')](0x5)[_0xf25d('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf25d('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf25d('0x16')](0x9)[_0xf25d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xf25d('0x16')](0x5)[_0xf25d('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xf25d('0x40')],'defaultValue':0x0,'comment':_0xf25d('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf25d('0x4')](_0xf25d('0x42'),_0xf25d('0x43')),'defaultValue':_0xf25d('0x42')},'dialQueueProject2':{'type':Sequelize[_0xf25d('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf25d('0x40')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf25d('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf25d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf25d('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf25d('0x16')](0x5)[_0xf25d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0xf25d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf25d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf25d('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf25d('0x16')](0x5)[_0xf25d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf25d('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf25d('0x16')](0x5)[_0xf25d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xf25d('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf25d('0x4e'),'set':function(_0x194067){if(!_0x194067)this[_0xf25d('0xd')]('mandatoryDispositionPauseId',null);this[_0xf25d('0xd')](_0xf25d('0x4f'),_0x194067);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf25d('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xf25d('0x40')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xf25d('0x16')](0x3)[_0xf25d('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xf25d('0x40')],'defaultValue':![]}};
\ No newline at end of file
index 56ce983..89ace39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9c3=['map','value','includes','find','type','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','query','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','findAll','rows','catch','show','params','keys','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','QueueCampaigns','outbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','addTeams','TeamVoiceQueue','upsert','UserVoiceQueue','each','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','transaction','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','inbound','filter','ignore'];(function(_0x505893,_0x1728c3){var _0x46fb77=function(_0x54c497){while(--_0x54c497){_0x505893['push'](_0x505893['shift']());}};_0x46fb77(++_0x1728c3);}(_0xc9c3,0x96));var _0x3c9c=function(_0x5d0a2b,_0x24f216){_0x5d0a2b=_0x5d0a2b-0x0;var _0x4c27d9=_0xc9c3[_0x5d0a2b];return _0x4c27d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];config[_0x3c9c('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c9c('0x19'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x22c495,_0x59d169){_0x59d169=_0x59d169||0xcc;return function(_0x3f1881){if(_0x3f1881){return _0x22c495[_0x3c9c('0x1a')](_0x59d169);}return _0x22c495[_0x3c9c('0x1b')](_0x59d169)[_0x3c9c('0x1c')]();};}function respondWithResult(_0x4a43d2,_0x265cc2){_0x265cc2=_0x265cc2||0xc8;return function(_0x490383){if(_0x490383){return _0x4a43d2['status'](_0x265cc2)['json'](_0x490383);}};}function respondWithFilteredResult(_0x3200a3,_0x32d94a){return function(_0x216fd8){if(_0x216fd8){var _0x3eee19=typeof _0x32d94a[_0x3c9c('0x1d')]===_0x3c9c('0x1e')&&typeof _0x32d94a[_0x3c9c('0x1f')]==='undefined';var _0x15a90a=_0x216fd8['count'];var _0x461711=_0x3eee19?0x0:_0x32d94a['offset'];var _0x164fde=_0x3eee19?_0x216fd8[_0x3c9c('0x20')]:_0x32d94a['offset']+_0x32d94a[_0x3c9c('0x1f')];var _0x29e4ac;if(_0x164fde>=_0x15a90a){_0x164fde=_0x15a90a;_0x29e4ac=0xc8;}else{_0x29e4ac=0xce;}_0x3200a3[_0x3c9c('0x1b')](_0x29e4ac);return _0x3200a3['set'](_0x3c9c('0x21'),_0x461711+'-'+_0x164fde+'/'+_0x15a90a)[_0x3c9c('0x22')](_0x216fd8);}return null;};}function patchUpdates(_0x2d5ffc){return function(_0x937abf){try{jsonpatch[_0x3c9c('0x23')](_0x937abf,_0x2d5ffc,!![]);}catch(_0x3bc5c4){return BPromise[_0x3c9c('0x24')](_0x3bc5c4);}return _0x937abf[_0x3c9c('0x25')]();};}function saveUpdates(_0x509bf7,_0x6ed08a){return function(_0x4d58b9){if(_0x4d58b9){return _0x4d58b9[_0x3c9c('0x26')](_0x509bf7)[_0x3c9c('0x27')](function(_0x4ca078){return _0x4ca078;});}return null;};}function removeEntity(_0x527bb9,_0x379880){return function(_0x1e8589){if(_0x1e8589){return _0x1e8589[_0x3c9c('0x28')]()[_0x3c9c('0x27')](function(){var _0x4c283d=_0x1e8589[_0x3c9c('0x29')]({'plain':!![]});var _0x65b831=[{'name':'VoiceQueues','value':_0x3c9c('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x3aeb60=_(_0x65b831)[_0x3c9c('0x2b')](_0x3c9c('0x2c'))[_0x3c9c('0x2d')](_0x3c9c('0x2e'))['value']();if(_[_0x3c9c('0x2f')](_0x3aeb60,_0x4c283d['type'])){return;}var _0x18b434=_[_0x3c9c('0x30')](_0x65b831,[_0x3c9c('0x2e'),_0x4c283d[_0x3c9c('0x31')]])['name'];return db[_0x3c9c('0x32')][_0x3c9c('0x28')]({'where':{'type':_0x18b434,'resourceId':_0x4c283d['id']}})[_0x3c9c('0x27')](function(){return _0x1e8589;});})[_0x3c9c('0x27')](function(){_0x527bb9[_0x3c9c('0x1b')](0xcc)[_0x3c9c('0x1c')]();});}};}function handleEntityNotFound(_0x314403,_0x317209){return function(_0x4d9c55){if(!_0x4d9c55){_0x314403[_0x3c9c('0x1a')](0x194);}return _0x4d9c55;};}function handleError(_0x1b36a8,_0x1b5226){_0x1b5226=_0x1b5226||0x1f4;return function(_0x38ca2e){logger[_0x3c9c('0x33')](_0x38ca2e[_0x3c9c('0x34')]);if(_0x38ca2e[_0x3c9c('0x35')]){delete _0x38ca2e[_0x3c9c('0x35')];}_0x1b36a8[_0x3c9c('0x1b')](_0x1b5226)[_0x3c9c('0x36')](_0x38ca2e);};}exports[_0x3c9c('0x37')]=function(_0xb86ddc,_0x394a50){var _0x1662ac={},_0x5f4f64={},_0xa1d0f={'count':0x0,'rows':[]};var _0x34266f=_[_0x3c9c('0x2d')](db['VoiceQueue'][_0x3c9c('0x38')],function(_0x7a3545){return{'name':_0x7a3545[_0x3c9c('0x39')],'type':_0x7a3545[_0x3c9c('0x31')]['key']};});_0x5f4f64['model']=_[_0x3c9c('0x2d')](_0x34266f,_0x3c9c('0x35'));_0x5f4f64[_0x3c9c('0x3a')]=_['keys'](_0xb86ddc['query']);_0x5f4f64[_0x3c9c('0x3b')]=_['intersection'](_0x5f4f64['model'],_0x5f4f64[_0x3c9c('0x3a')]);_0x1662ac[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x5f4f64['model'],qs[_0x3c9c('0x3e')](_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x1662ac['attributes']=_0x1662ac['attributes']['length']?_0x1662ac[_0x3c9c('0x3c')]:_0x5f4f64[_0x3c9c('0x3f')];if(!_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x1662ac[_0x3c9c('0x1f')]=qs['limit'](_0xb86ddc['query'][_0x3c9c('0x1f')]);_0x1662ac[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0xb86ddc['query'][_0x3c9c('0x1d')]);}_0x1662ac[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0xb86ddc['query']['sort']);_0x1662ac[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0xb86ddc['query'],_0x5f4f64[_0x3c9c('0x3b')]),_0x34266f);if(_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x1662ac[_0x3c9c('0x44')]=_['merge'](_0x1662ac[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x34266f,function(_0x55496a){if(_0x55496a['type']!==_0x3c9c('0x46')){var _0xe92b80={};_0xe92b80[_0x55496a['name']]={'$like':'%'+_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0xe92b80;}})});}_0x1662ac=_[_0x3c9c('0x47')]({},_0x1662ac,_0xb86ddc[_0x3c9c('0x48')]);var _0x40b45c={'where':_0x1662ac[_0x3c9c('0x44')]};return db['VoiceQueue'][_0x3c9c('0x20')](_0x40b45c)[_0x3c9c('0x27')](function(_0xae0088){_0xa1d0f[_0x3c9c('0x20')]=_0xae0088;if(_0xb86ddc[_0x3c9c('0x3a')]['includeAll']){_0x1662ac['include']=[{'all':!![]}];}return db[_0x3c9c('0x49')][_0x3c9c('0x4a')](_0x1662ac);})[_0x3c9c('0x27')](function(_0x25285d){_0xa1d0f[_0x3c9c('0x4b')]=_0x25285d;return _0xa1d0f;})['then'](respondWithFilteredResult(_0x394a50,_0x1662ac))[_0x3c9c('0x4c')](handleError(_0x394a50,null));};exports[_0x3c9c('0x4d')]=function(_0x27a013,_0x222ffa){var _0xcd7ebc={'raw':![],'where':{'id':_0x27a013[_0x3c9c('0x4e')]['id']}},_0x58f6b7={};_0x58f6b7[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x49')][_0x3c9c('0x38')]);_0x58f6b7[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x27a013['query']);_0x58f6b7[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x58f6b7[_0x3c9c('0x3f')],_0x58f6b7[_0x3c9c('0x3a')]);_0xcd7ebc[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x58f6b7['model'],qs[_0x3c9c('0x3e')](_0x27a013[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0xcd7ebc[_0x3c9c('0x3c')]=_0xcd7ebc[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0xcd7ebc[_0x3c9c('0x3c')]:_0x58f6b7[_0x3c9c('0x3f')];if(_0x27a013[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0xcd7ebc[_0x3c9c('0x52')]=[{'all':!![]}];}_0xcd7ebc=_[_0x3c9c('0x47')]({},_0xcd7ebc,_0x27a013[_0x3c9c('0x48')]);return db[_0x3c9c('0x49')][_0x3c9c('0x30')](_0xcd7ebc)[_0x3c9c('0x27')](handleEntityNotFound(_0x222ffa,null))['then'](respondWithResult(_0x222ffa,null))['catch'](handleError(_0x222ffa,null));};exports['create']=function(_0xff4ef7,_0x3d9301){return db[_0x3c9c('0x49')][_0x3c9c('0x53')](_0xff4ef7['body'],{})[_0x3c9c('0x27')](function(_0x5b98da){var _0x4a4be4=_0xff4ef7[_0x3c9c('0x54')][_0x3c9c('0x29')]({'plain':!![]});if(!_0x4a4be4)throw new Error(_0x3c9c('0x55'));if(_0x4a4be4[_0x3c9c('0x56')]===_0x3c9c('0x54')){var _0x1f961b=_0x5b98da[_0x3c9c('0x29')]({'plain':!![]});var _0x149f42=[{'name':_0x3c9c('0x57'),'value':'inbound'},{'name':_0x3c9c('0x58'),'value':_0x3c9c('0x59')}];var _0x437ff5=_[_0x3c9c('0x30')](_0x149f42,[_0x3c9c('0x2e'),_0x1f961b[_0x3c9c('0x31')]])[_0x3c9c('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x437ff5,'userProfileId':_0x4a4be4[_0x3c9c('0x5a')]},'raw':!![]})[_0x3c9c('0x27')](function(_0x3f6347){if(_0x3f6347&&_0x3f6347[_0x3c9c('0x5b')]===0x0){return db[_0x3c9c('0x32')][_0x3c9c('0x53')]({'name':_0x1f961b[_0x3c9c('0x35')],'resourceId':_0x1f961b['id'],'type':_0x3f6347[_0x3c9c('0x35')],'sectionId':_0x3f6347['id']},{})[_0x3c9c('0x27')](function(){return _0x5b98da;});}else{return _0x5b98da;}})[_0x3c9c('0x4c')](function(_0x13ae81){logger[_0x3c9c('0x33')](_0x3c9c('0x5c'),_0x13ae81);throw _0x13ae81;});}return _0x5b98da;})[_0x3c9c('0x27')](respondWithResult(_0x3d9301,0xc9))['catch'](handleError(_0x3d9301,null));};exports[_0x3c9c('0x5d')]=function(_0x4306fe,_0x1b6f0a){var _0x1573f2={'where':{'id':_0x4306fe['params']['id']}},_0x16fbcf={};_0x16fbcf[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db['VoiceQueue']['rawAttributes']);_0x1573f2[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x16fbcf['model'],qs[_0x3c9c('0x3e')](_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x1573f2[_0x3c9c('0x3c')]=_0x1573f2[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x1573f2[_0x3c9c('0x3c')]:_0x16fbcf[_0x3c9c('0x3f')];if(_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x1573f2[_0x3c9c('0x52')]=[{'all':!![]}];}_0x1573f2=_['merge']({},_0x1573f2,_0x4306fe[_0x3c9c('0x48')]);return db['VoiceQueue']['find'](_0x1573f2)[_0x3c9c('0x27')](handleEntityNotFound(_0x1b6f0a,null))[_0x3c9c('0x27')](function(_0x1a1485){if(_0x1a1485){var _0x4695a7=_0x1a1485[_0x3c9c('0x29')]({'plain':!![]});_0x4695a7=qs[_0x3c9c('0x5e')](_0x4695a7,['id',_0x3c9c('0x5f'),'updatedAt']);_0x4306fe[_0x3c9c('0x60')]=_[_0x3c9c('0x5e')](_0x4306fe[_0x3c9c('0x60')],['id',_0x3c9c('0x5f'),_0x3c9c('0x61')]);return db['VoiceQueue']['create'](_[_0x3c9c('0x47')](_0x4695a7,_0x4306fe[_0x3c9c('0x60')]),{'include':_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x51')]?[{'all':!![]}]:undefined})[_0x3c9c('0x27')](function(_0x990934){var _0x332503=_0x4306fe[_0x3c9c('0x54')][_0x3c9c('0x29')]({'plain':!![]});if(!_0x332503)throw new Error(_0x3c9c('0x55'));if(_0x332503[_0x3c9c('0x56')]===_0x3c9c('0x54')){var _0x4311c0=_0x990934[_0x3c9c('0x29')]({'plain':!![]});var _0xd46ccf=[{'name':_0x3c9c('0x57'),'value':_0x3c9c('0x2a')},{'name':'QueueCampaigns','value':_0x3c9c('0x59')}];var _0x56a197=_['find'](_0xd46ccf,[_0x3c9c('0x2e'),_0x4311c0[_0x3c9c('0x31')]])[_0x3c9c('0x35')];return db['UserProfileSection'][_0x3c9c('0x30')]({'where':{'name':_0x56a197,'userProfileId':_0x332503[_0x3c9c('0x5a')]},'raw':!![]})['then'](function(_0x23cb34){if(_0x23cb34&&_0x23cb34[_0x3c9c('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x4311c0['name'],'resourceId':_0x4311c0['id'],'type':_0x23cb34[_0x3c9c('0x35')],'sectionId':_0x23cb34['id']},{})[_0x3c9c('0x27')](function(){return _0x990934;});}else{return _0x990934;}})[_0x3c9c('0x4c')](function(_0x3d94da){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d94da);throw _0x3d94da;});}return _0x990934;});}})[_0x3c9c('0x27')](respondWithResult(_0x1b6f0a,0xc9))[_0x3c9c('0x4c')](handleError(_0x1b6f0a,null));};exports[_0x3c9c('0x26')]=function(_0x94bc44,_0x4342a9){if(_0x94bc44[_0x3c9c('0x60')]['id']){delete _0x94bc44[_0x3c9c('0x60')]['id'];}return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x94bc44['params']['id']}})['then'](handleEntityNotFound(_0x4342a9,null))[_0x3c9c('0x27')](saveUpdates(_0x94bc44['body'],null))['then'](respondWithResult(_0x4342a9,null))['catch'](handleError(_0x4342a9,null));};exports[_0x3c9c('0x28')]=function(_0x1159c0,_0x5c4237){return db['VoiceQueue'][_0x3c9c('0x30')]({'where':{'id':_0x1159c0['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x5c4237,null))['then'](removeEntity(_0x5c4237,null))[_0x3c9c('0x4c')](handleError(_0x5c4237,null));};exports[_0x3c9c('0x62')]=function(_0x2cbb5f,_0x587598,_0x4c0093){var _0x27c3f9={'raw':![],'where':{}};var _0x5ca292={};var _0x1d2c9d={'count':0x0,'rows':[]};return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x2cbb5f[_0x3c9c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x587598,null))[_0x3c9c('0x27')](function(_0xbeaf58){if(_0xbeaf58){_0x5ca292['model']=_[_0x3c9c('0x4f')](db[_0x3c9c('0x64')]['rawAttributes']);_0x5ca292[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x2cbb5f['query']);_0x5ca292[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x5ca292[_0x3c9c('0x3f')],_0x5ca292['query']);_0x27c3f9['attributes']=_[_0x3c9c('0x3d')](_0x5ca292[_0x3c9c('0x3f')],qs['fields'](_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x27c3f9[_0x3c9c('0x3c')]=_0x27c3f9['attributes'][_0x3c9c('0x50')]?_0x27c3f9[_0x3c9c('0x3c')]:_0x5ca292['model'];if(!_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x27c3f9[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x27c3f9[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x2cbb5f[_0x3c9c('0x3a')]['offset']);}_0x27c3f9[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x2cbb5f['query'][_0x3c9c('0x43')]);_0x27c3f9[_0x3c9c('0x44')]=qs['filters'](_[_0x3c9c('0x45')](_0x2cbb5f[_0x3c9c('0x3a')],_0x5ca292[_0x3c9c('0x3b')]));_0x27c3f9[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0xbeaf58['id'];if(_0x2cbb5f['query'][_0x3c9c('0x2b')]){_0x27c3f9[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x27c3f9[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x27c3f9[_0x3c9c('0x3c')],function(_0x3ef3d1){var _0x2de80a={};_0x2de80a[_0x3ef3d1]={'$like':'%'+_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x2de80a;})});}_0x27c3f9=_[_0x3c9c('0x47')]({},_0x27c3f9,_0x2cbb5f[_0x3c9c('0x48')]);return db[_0x3c9c('0x64')]['count']({'where':_0x27c3f9[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x508903){_0x1d2c9d[_0x3c9c('0x20')]=_0x508903;if(_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x27c3f9['include']=[{'all':!![]}];}return db[_0x3c9c('0x64')][_0x3c9c('0x4a')](_0x27c3f9);})[_0x3c9c('0x27')](function(_0x285ebc){_0x1d2c9d[_0x3c9c('0x4b')]=_0x285ebc;return _0x1d2c9d;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x587598,_0x27c3f9))['catch'](handleError(_0x587598,null));};exports[_0x3c9c('0x66')]=function(_0x4ca0b7,_0x2265e8,_0x48a57f){var _0x4950c3={'raw':!![],'where':{}};var _0x263270={};var _0x5391a7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x4ca0b7[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x2265e8,null))[_0x3c9c('0x27')](function(_0x2f4e79){if(_0x2f4e79){_0x263270[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x67')][_0x3c9c('0x38')]);_0x263270[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x4ca0b7['query']);_0x263270['filters']=_[_0x3c9c('0x3d')](_0x263270['model'],_0x263270['query']);_0x4950c3[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x263270[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x4ca0b7[_0x3c9c('0x3a')]['fields']));_0x4950c3[_0x3c9c('0x3c')]=_0x4950c3[_0x3c9c('0x3c')]['length']?_0x4950c3['attributes']:_0x263270[_0x3c9c('0x3f')];if(!_0x4ca0b7['query'][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x4950c3[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x4950c3[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}_0x4950c3['order']=qs[_0x3c9c('0x43')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x4950c3[_0x3c9c('0x44')]=qs['filters'](_[_0x3c9c('0x45')](_0x4ca0b7['query'],_0x263270[_0x3c9c('0x3b')]));_0x4950c3[_0x3c9c('0x44')]['VoiceQueueId']=_0x2f4e79['id'];if(_0x4ca0b7[_0x3c9c('0x3a')]['filter']){_0x4950c3['where']=_[_0x3c9c('0x47')](_0x4950c3[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x4950c3[_0x3c9c('0x3c')],function(_0x17e5ce){var _0x5c96ad={};_0x5c96ad[_0x17e5ce]={'$like':'%'+_0x4ca0b7[_0x3c9c('0x3a')]['filter']+'%'};return _0x5c96ad;})});}_0x4950c3=_[_0x3c9c('0x47')]({},_0x4950c3,_0x4ca0b7['options']);return db[_0x3c9c('0x67')][_0x3c9c('0x20')]({'where':_0x4950c3[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x126e3d){_0x5391a7[_0x3c9c('0x20')]=_0x126e3d;if(_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x4950c3['include']=[{'all':!![]}];}return db[_0x3c9c('0x67')][_0x3c9c('0x4a')](_0x4950c3);})[_0x3c9c('0x27')](function(_0x5614df){_0x5391a7[_0x3c9c('0x4b')]=_0x5614df;return _0x5391a7;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x2265e8,_0x4950c3))[_0x3c9c('0x4c')](handleError(_0x2265e8,null));};exports[_0x3c9c('0x68')]=function(_0x107f4f,_0xdfe4f7,_0x58e1e8){var _0x10b6b9={'raw':!![],'where':{}};var _0x2ba1f1={};var _0x2e158c={'count':0x0,'rows':[]};return db[_0x3c9c('0x49')]['findOne']({'where':{'id':_0x107f4f[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0xdfe4f7,null))[_0x3c9c('0x27')](function(_0x517fa2){if(_0x517fa2){_0x2ba1f1['model']=_[_0x3c9c('0x4f')](db[_0x3c9c('0x69')][_0x3c9c('0x38')]);_0x2ba1f1[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x107f4f[_0x3c9c('0x3a')]);_0x2ba1f1[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x2ba1f1[_0x3c9c('0x3f')],_0x2ba1f1[_0x3c9c('0x3a')]);_0x10b6b9[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x2ba1f1['model'],qs['fields'](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x10b6b9[_0x3c9c('0x3c')]=_0x10b6b9[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x10b6b9[_0x3c9c('0x3c')]:_0x2ba1f1[_0x3c9c('0x3f')];if(!_0x107f4f['query']['hasOwnProperty'](_0x3c9c('0x41'))){_0x10b6b9['limit']=qs[_0x3c9c('0x1f')](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x10b6b9[_0x3c9c('0x1d')]=qs['offset'](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}_0x10b6b9[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x10b6b9['where']=qs['filters'](_[_0x3c9c('0x45')](_0x107f4f[_0x3c9c('0x3a')],_0x2ba1f1[_0x3c9c('0x3b')]));_0x10b6b9[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0x517fa2['id'];if(_0x107f4f[_0x3c9c('0x3a')]['filter']){_0x10b6b9[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x10b6b9[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x10b6b9['attributes'],function(_0x73dcda){var _0x5460ca={};_0x5460ca[_0x73dcda]={'$like':'%'+_0x107f4f['query'][_0x3c9c('0x2b')]+'%'};return _0x5460ca;})});}_0x10b6b9=_['merge']({},_0x10b6b9,_0x107f4f[_0x3c9c('0x48')]);return db[_0x3c9c('0x69')]['count']({'where':_0x10b6b9[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x189663){_0x2e158c[_0x3c9c('0x20')]=_0x189663;if(_0x107f4f[_0x3c9c('0x3a')]['includeAll']){_0x10b6b9['include']=[{'all':!![]}];}return db[_0x3c9c('0x69')][_0x3c9c('0x4a')](_0x10b6b9);})[_0x3c9c('0x27')](function(_0xf86c09){_0x2e158c[_0x3c9c('0x4b')]=_0xf86c09;return _0x2e158c;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0xdfe4f7,_0x10b6b9))[_0x3c9c('0x4c')](handleError(_0xdfe4f7,null));};exports[_0x3c9c('0x6a')]=function(_0x12f53,_0x1352fa,_0x441c95){var _0x258dd7={'raw':!![],'where':{}};var _0x4b6a24={};var _0x2e9535={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x12f53['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x1352fa,null))[_0x3c9c('0x27')](function(_0x2c5246){if(_0x2c5246){_0x4b6a24[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6b')]['rawAttributes']);_0x4b6a24[_0x3c9c('0x3a')]=_['keys'](_0x12f53[_0x3c9c('0x3a')]);_0x4b6a24['filters']=_[_0x3c9c('0x3d')](_0x4b6a24[_0x3c9c('0x3f')],_0x4b6a24[_0x3c9c('0x3a')]);_0x258dd7['attributes']=_['intersection'](_0x4b6a24['model'],qs[_0x3c9c('0x3e')](_0x12f53['query']['fields']));_0x258dd7['attributes']=_0x258dd7[_0x3c9c('0x3c')]['length']?_0x258dd7['attributes']:_0x4b6a24['model'];if(!_0x12f53[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x258dd7[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x12f53['query'][_0x3c9c('0x1f')]);_0x258dd7['offset']=qs[_0x3c9c('0x1d')](_0x12f53[_0x3c9c('0x3a')]['offset']);}_0x258dd7[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x12f53['query'][_0x3c9c('0x43')]);_0x258dd7[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x12f53[_0x3c9c('0x3a')],_0x4b6a24[_0x3c9c('0x3b')]));_0x258dd7[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0x2c5246['id'];if(_0x12f53[_0x3c9c('0x3a')]['filter']){_0x258dd7[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x258dd7[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x258dd7[_0x3c9c('0x3c')],function(_0x5559d7){var _0x5973d9={};_0x5973d9[_0x5559d7]={'$like':'%'+_0x12f53[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x5973d9;})});}_0x258dd7=_[_0x3c9c('0x47')]({},_0x258dd7,_0x12f53[_0x3c9c('0x48')]);return db[_0x3c9c('0x6b')]['count']({'where':_0x258dd7[_0x3c9c('0x44')]})['then'](function(_0x45811b){_0x2e9535['count']=_0x45811b;if(_0x12f53[_0x3c9c('0x3a')]['includeAll']){_0x258dd7['include']=[{'all':!![]}];}return db[_0x3c9c('0x6b')][_0x3c9c('0x4a')](_0x258dd7);})[_0x3c9c('0x27')](function(_0x50ea44){_0x2e9535[_0x3c9c('0x4b')]=_0x50ea44;return _0x2e9535;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x1352fa,_0x258dd7))[_0x3c9c('0x4c')](handleError(_0x1352fa,null));};exports[_0x3c9c('0x6c')]=function(_0x4b9eb2,_0xc6b2cf,_0x5cc313){var _0x42c9f3={};var _0x47ee15={};var _0x50d273;var _0x2aabae;return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x4b9eb2['params']['id']}})['then'](handleEntityNotFound(_0xc6b2cf,null))['then'](function(_0x3e00ce){if(_0x3e00ce){_0x50d273=_0x3e00ce;_0x47ee15[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6d')]['rawAttributes']);_0x47ee15[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x4b9eb2['query']);_0x47ee15['filters']=_[_0x3c9c('0x3d')](_0x47ee15['model'],_0x47ee15[_0x3c9c('0x3a')]);_0x42c9f3[_0x3c9c('0x3c')]=_['intersection'](_0x47ee15[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x4b9eb2[_0x3c9c('0x3a')]['fields']));_0x42c9f3['attributes']=_0x42c9f3[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x42c9f3['attributes']:_0x47ee15[_0x3c9c('0x3f')];_0x42c9f3['order']=qs['sort'](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x42c9f3['where']=qs['filters'](_[_0x3c9c('0x45')](_0x4b9eb2[_0x3c9c('0x3a')],_0x47ee15[_0x3c9c('0x3b')]));if(_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x42c9f3[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x42c9f3[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x42c9f3['attributes'],function(_0x46602e){var _0x1b3d08={};_0x1b3d08[_0x46602e]={'$like':'%'+_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x1b3d08;})});}_0x42c9f3=_[_0x3c9c('0x47')]({},_0x42c9f3,_0x4b9eb2['options']);return _0x50d273[_0x3c9c('0x6c')](_0x42c9f3);}})[_0x3c9c('0x27')](function(_0x1498f2){if(_0x1498f2){_0x2aabae=_0x1498f2[_0x3c9c('0x50')];if(!_0x4b9eb2['query']['hasOwnProperty'](_0x3c9c('0x41'))){_0x42c9f3[_0x3c9c('0x1f')]=qs['limit'](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x42c9f3[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}return _0x50d273[_0x3c9c('0x6c')](_0x42c9f3);}})[_0x3c9c('0x27')](function(_0x3c98b5){if(_0x3c98b5){return _0x3c98b5?{'count':_0x2aabae,'rows':_0x3c98b5}:null;}})[_0x3c9c('0x27')](respondWithResult(_0xc6b2cf,null))[_0x3c9c('0x4c')](handleError(_0xc6b2cf,null));};exports['addTeams']=function(_0x5abab5,_0x140449,_0x2ab056){var _0x56eb48=_0x5abab5[_0x3c9c('0x60')][_0x3c9c('0x6e')];var _0x31c02b=_['map'](_0x56eb48,'id');return db['Team'][_0x3c9c('0x4a')]({'where':{'id':_0x31c02b},'attributes':['id'],'include':[{'model':db[_0x3c9c('0x6f')],'as':_0x3c9c('0x70'),'attributes':['id',_0x3c9c('0x35'),_0x3c9c('0x71'),_0x3c9c('0x72'),_0x3c9c('0x73')],'raw':!![]}]})['then'](function(_0x5f21c1){if(_0x5f21c1){var _0x32b5b2=_[_0x3c9c('0x74')](_0x5f21c1,function(_0x29a73d){var _0x8bfdea=_0x29a73d['get']({'plain':!![]});_0x8bfdea['Agents'][_0x3c9c('0x75')](function(_0x5c7233){_0x5c7233[_0x3c9c('0x76')]=_[_0x3c9c('0x30')](_0x56eb48,{'id':_0x8bfdea['id']})[_0x3c9c('0x76')];});return _0x8bfdea[_0x3c9c('0x70')];});return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x5abab5[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(_0x575a0e){return db[_0x3c9c('0x77')]['transaction'](function(_0x19484b){return _0x575a0e[_0x3c9c('0x78')](_0x31c02b,{'transaction':_0x19484b})[_0x3c9c('0x27')](function(){return BPromise['each'](_0x56eb48,function(_0x328a43){return db[_0x3c9c('0x79')][_0x3c9c('0x7a')]({'TeamId':_0x328a43['id'],'VoiceQueueId':_0x5abab5[_0x3c9c('0x4e')]['id'],'penalty':_0x328a43[_0x3c9c('0x76')]},{'transaction':_0x19484b});});})['then'](function(){return BPromise['each'](_0x32b5b2,function(_0xc5ed4){return db[_0x3c9c('0x7b')]['findOrCreate']({'where':{'UserId':_0xc5ed4['id'],'VoiceQueueId':_0x5abab5[_0x3c9c('0x4e')]['id']},'defaults':{'penalty':_0xc5ed4[_0x3c9c('0x76')]},'transaction':_0x19484b});});})[_0x3c9c('0x27')](function(){return BPromise[_0x3c9c('0x7c')](_['filter'](_0x32b5b2,{'online':!![]}),function(_0x52c484){return db[_0x3c9c('0x7d')]['upsert']({'membername':_0x52c484[_0x3c9c('0x35')],'UserId':_0x52c484['id'],'queue_name':_0x575a0e[_0x3c9c('0x35')],'VoiceQueueId':_0x575a0e['id'],'interface':_[_0x3c9c('0x7e')](_0x52c484[_0x3c9c('0x73')])?util[_0x3c9c('0x7f')](_0x3c9c('0x80'),_0x52c484[_0x3c9c('0x35')]):_0x52c484[_0x3c9c('0x73')],'paused':_0x52c484[_0x3c9c('0x72')]||![],'penalty':_0x52c484[_0x3c9c('0x76')]},{'transaction':_0x19484b});});})[_0x3c9c('0x27')](function(){_0x32b5b2['forEach'](function(_0x1efa7f){socket[_0x3c9c('0x81')](_0x3c9c('0x82'),{'UserId':_0x1efa7f['id'],'VoiceQueueId':_0x575a0e['id']});});});});});}})['then'](respondWithStatusCode(_0x140449,null))[_0x3c9c('0x4c')](handleError(_0x140449,null));};exports[_0x3c9c('0x83')]=function(_0x172dd9,_0x104299,_0x5341fe){return db[_0x3c9c('0x6d')][_0x3c9c('0x4a')]({'where':{'id':_0x172dd9[_0x3c9c('0x3a')][_0x3c9c('0x84')]},'attributes':['id'],'include':[{'model':db[_0x3c9c('0x6f')],'as':_0x3c9c('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x104299,null))[_0x3c9c('0x27')](function(_0x2471ce){var _0x25e1e7=_['map'](_0x2471ce,'id');var _0x4a1d36=[];var _0x52086d=[];var _0x7d182c=squel[_0x3c9c('0x85')]();_0x7d182c[_0x3c9c('0x86')](_0x3c9c('0x87'))[_0x3c9c('0x88')](_0x3c9c('0x89'),'tq')['join'](_0x3c9c('0x8a'),'ut',_0x3c9c('0x8b'))['where'](_0x3c9c('0x8c'),_0x172dd9[_0x3c9c('0x4e')]['id']);for(var _0x592f68=0x0;_0x592f68<_0x2471ce[_0x3c9c('0x50')];_0x592f68+=0x1){let _0x2e1c83=_0x2471ce[_0x592f68];for(var _0x2cbcd7=0x0;_0x2cbcd7<_0x2e1c83[_0x3c9c('0x70')][_0x3c9c('0x50')];_0x2cbcd7+=0x1){let _0x23c89e=_0x2e1c83[_0x3c9c('0x70')][_0x2cbcd7];var _0x17be35=_0x7d182c[_0x3c9c('0x5d')]();_0x17be35[_0x3c9c('0x44')](_0x3c9c('0x8d'),_0x23c89e['id']);_0x52086d[_0x3c9c('0x8e')](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x17be35[_0x3c9c('0x8f')](),{'type':db[_0x3c9c('0x77')]['QueryTypes']['SELECT']})[_0x3c9c('0x27')](function(_0x1f8f97){if(_0x1f8f97[_0x3c9c('0x50')]===0x1){return _0x23c89e['id'];}else{var _0x3ccfcf=_[_0x3c9c('0x90')](_[_0x3c9c('0x2d')](_0x1f8f97,_0x3c9c('0x91')),function(_0x161f4e){return _[_0x3c9c('0x2f')](_0x25e1e7,_0x161f4e);});if(_0x3ccfcf){return _0x23c89e['id'];}}}));}}return BPromise[_0x3c9c('0x92')](_0x52086d)[_0x3c9c('0x27')](function(_0x288c1c){_0x4a1d36=_(_0x4a1d36)['union'](_0x288c1c)['compact']()['value']();return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x172dd9[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(_0x5e5d3e){return db[_0x3c9c('0x77')][_0x3c9c('0x93')](function(_0x569d4a){return _0x5e5d3e['removeTeams'](_0x172dd9['query'][_0x3c9c('0x84')],{'transaction':_0x569d4a})[_0x3c9c('0x27')](function(){if(!_['isEmpty'](_0x4a1d36)){return _0x5e5d3e[_0x3c9c('0x94')](_0x4a1d36,{'transaction':_0x569d4a})[_0x3c9c('0x27')](function(){return db[_0x3c9c('0x7d')][_0x3c9c('0x28')]({'where':{'VoiceQueueId':_0x172dd9[_0x3c9c('0x4e')]['id'],'UserId':_0x4a1d36},'transaction':_0x569d4a});});}})[_0x3c9c('0x27')](function(){_0x4a1d36[_0x3c9c('0x75')](function(_0x1b4a1a){socket['emit'](_0x3c9c('0x95'),{'UserId':_0x1b4a1a,'VoiceQueueId':_0x5e5d3e['id']});});});});});});})[_0x3c9c('0x27')](respondWithStatusCode(_0x104299,null))['catch'](handleError(_0x104299,null));};exports[_0x3c9c('0x96')]=function(_0x2a5517,_0x3573d5,_0x5d5578){var _0x17d65a,_0x1cf94d;return db['VoiceQueue']['find']({'where':{'id':_0x2a5517[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x3573d5,null))[_0x3c9c('0x27')](function(_0x294f08){if(_0x294f08){_0x1cf94d=_0x294f08;return _0x294f08[_0x3c9c('0x96')](_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')],_['omit'](_0x2a5517[_0x3c9c('0x60')],[_0x3c9c('0x84'),'id'])||{})[_0x3c9c('0x97')](function(_0x184d45){for(var _0x36c8bb=0x0;_0x36c8bb<_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')][_0x3c9c('0x50')];_0x36c8bb+=0x1){socket[_0x3c9c('0x81')](_0x3c9c('0x82'),{'UserId':Number(_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')][_0x36c8bb]),'VoiceQueueId':Number(_0x2a5517[_0x3c9c('0x4e')]['id'])});}return _0x184d45;});}})[_0x3c9c('0x27')](function(_0x4e1681){_0x17d65a=_0x4e1681||[];if(_0x1cf94d){return db['User']['findAll']({'where':{'id':_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')]},'attributes':['id',_0x3c9c('0x35'),_0x3c9c('0x71'),'voicePause',_0x3c9c('0x73')],'raw':!![]});}})[_0x3c9c('0x27')](function(_0x67c740){if(!_['isEmpty'](_0x67c740)){var _0x3a3397=[];for(var _0x5ab1ed=0x0;_0x5ab1ed<_0x67c740['length'];_0x5ab1ed++){if(_0x67c740[_0x5ab1ed]['online']){_0x3a3397[_0x3c9c('0x8e')](db[_0x3c9c('0x7d')][_0x3c9c('0x7a')]({'membername':_0x67c740[_0x5ab1ed]['name'],'UserId':_0x67c740[_0x5ab1ed]['id'],'queue_name':_0x1cf94d[_0x3c9c('0x35')],'VoiceQueueId':_0x1cf94d['id'],'interface':_['isNil'](_0x67c740[_0x5ab1ed][_0x3c9c('0x73')])?util[_0x3c9c('0x7f')](_0x3c9c('0x80'),_0x67c740[_0x5ab1ed]['name']):_0x67c740[_0x5ab1ed][_0x3c9c('0x73')],'paused':_0x67c740[_0x5ab1ed]['voicePause']||![],'penalty':_0x2a5517['body']['penalty']||0x0}));}}return BPromise[_0x3c9c('0x92')](_0x3a3397);}})[_0x3c9c('0x27')](function(){return _0x17d65a;})['then'](respondWithResult(_0x3573d5,null))['catch'](handleError(_0x3573d5,null));};exports['removeAgents']=function(_0x24ab12,_0x56acd6,_0x1240f2){return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x24ab12[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x56acd6,null))[_0x3c9c('0x27')](function(_0x5ed78a){if(_0x5ed78a){return _0x5ed78a['removeAgents'](_0x24ab12['query']['ids'])['then'](function(){if(_[_0x3c9c('0x98')](_0x24ab12[_0x3c9c('0x3a')]['ids'])){for(var _0x42838a=0x0;_0x42838a<_0x24ab12[_0x3c9c('0x3a')][_0x3c9c('0x84')][_0x3c9c('0x50')];_0x42838a+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x24ab12['query'][_0x3c9c('0x84')][_0x42838a]),'VoiceQueueId':Number(_0x24ab12[_0x3c9c('0x4e')]['id'])});}}else{socket['emit'](_0x3c9c('0x95'),{'UserId':Number(_0x24ab12['query'][_0x3c9c('0x84')]),'VoiceQueueId':Number(_0x24ab12[_0x3c9c('0x4e')]['id'])});}});}})['then'](function(_0x15239c){return db[_0x3c9c('0x7d')][_0x3c9c('0x28')]({'where':{'VoiceQueueId':_0x24ab12[_0x3c9c('0x4e')]['id'],'UserId':_0x24ab12[_0x3c9c('0x3a')][_0x3c9c('0x84')]}})['then'](function(){return _0x15239c;});})['then'](respondWithStatusCode(_0x56acd6,null))['catch'](handleError(_0x56acd6,null));};exports[_0x3c9c('0x99')]=function(_0xcdc42b,_0x3b6090,_0x5d852a){var _0x6bf4c6={};var _0x59c6c8={};var _0x28f510;var _0x33b65c;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0xcdc42b[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x3b6090,null))[_0x3c9c('0x27')](function(_0x58b3c8){if(_0x58b3c8){_0x28f510=_0x58b3c8;_0x59c6c8[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6f')][_0x3c9c('0x38')]);_0x59c6c8[_0x3c9c('0x3a')]=_['keys'](_0xcdc42b[_0x3c9c('0x3a')]);_0x59c6c8['filters']=_[_0x3c9c('0x3d')](_0x59c6c8[_0x3c9c('0x3f')],_0x59c6c8['query']);_0x6bf4c6['attributes']=_['intersection'](_0x59c6c8[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0xcdc42b['query'][_0x3c9c('0x3e')]));_0x6bf4c6[_0x3c9c('0x3c')]=_0x6bf4c6['attributes'][_0x3c9c('0x50')]?_0x6bf4c6[_0x3c9c('0x3c')]:_0x59c6c8[_0x3c9c('0x3f')];_0x6bf4c6[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0xcdc42b[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x6bf4c6[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0xcdc42b[_0x3c9c('0x3a')],_0x59c6c8['filters']));if(_0xcdc42b['query']['filter']){_0x6bf4c6[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x6bf4c6[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x6bf4c6[_0x3c9c('0x3c')],function(_0x4f1a9a){var _0x38d941={};_0x38d941[_0x4f1a9a]={'$like':'%'+_0xcdc42b['query'][_0x3c9c('0x2b')]+'%'};return _0x38d941;})});}_0x6bf4c6=_['merge']({},_0x6bf4c6,_0xcdc42b[_0x3c9c('0x48')]);return _0x28f510[_0x3c9c('0x99')](_0x6bf4c6);}})[_0x3c9c('0x27')](function(_0x2adcb2){if(_0x2adcb2){_0x33b65c=_0x2adcb2[_0x3c9c('0x50')];if(!_0xcdc42b[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x6bf4c6['limit']=qs[_0x3c9c('0x1f')](_0xcdc42b[_0x3c9c('0x3a')]['limit']);_0x6bf4c6[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0xcdc42b['query'][_0x3c9c('0x1d')]);}return _0x28f510[_0x3c9c('0x99')](_0x6bf4c6);}})[_0x3c9c('0x27')](function(_0x3b8781){if(_0x3b8781){return _0x3b8781?{'count':_0x33b65c,'rows':_0x3b8781}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x3b6090,null))[_0x3c9c('0x4c')](handleError(_0x3b6090,null));};exports[_0x3c9c('0x9a')]=function(_0x2b6495,_0x21b27b,_0x3fcec9){var _0x13b386={};var _0x13de89={};var _0x52828e;var _0x247a4d;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x2b6495['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x21b27b,null))[_0x3c9c('0x27')](function(_0x236c5e){if(_0x236c5e){_0x52828e=_0x236c5e;_0x13de89[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x7d')][_0x3c9c('0x38')]);_0x13de89[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x2b6495[_0x3c9c('0x3a')]);_0x13de89[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x13de89['model'],_0x13de89[_0x3c9c('0x3a')]);_0x13b386['attributes']=_['intersection'](_0x13de89['model'],qs['fields'](_0x2b6495[_0x3c9c('0x3a')]['fields']));_0x13b386[_0x3c9c('0x3c')]=_0x13b386[_0x3c9c('0x3c')]['length']?_0x13b386[_0x3c9c('0x3c')]:_0x13de89[_0x3c9c('0x3f')];_0x13b386['order']=qs[_0x3c9c('0x43')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x13b386[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x2b6495['query'],_0x13de89[_0x3c9c('0x3b')]));if(_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x13b386['where']=_[_0x3c9c('0x47')](_0x13b386[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x13b386[_0x3c9c('0x3c')],function(_0x24a412){var _0x264827={};_0x264827[_0x24a412]={'$like':'%'+_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x264827;})});}_0x13b386=_[_0x3c9c('0x47')]({},_0x13b386,_0x2b6495[_0x3c9c('0x48')]);return _0x52828e['getMembers'](_0x13b386);}})[_0x3c9c('0x27')](function(_0x38d305){if(_0x38d305){_0x247a4d=_0x38d305[_0x3c9c('0x50')];if(!_0x2b6495[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x13b386['limit']=qs[_0x3c9c('0x1f')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x13b386[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}return _0x52828e[_0x3c9c('0x9a')](_0x13b386);}})[_0x3c9c('0x27')](function(_0x4dbb61){return _0x4dbb61?{'count':_0x247a4d,'rows':_0x4dbb61}:null;})[_0x3c9c('0x27')](respondWithResult(_0x21b27b,null))[_0x3c9c('0x4c')](handleError(_0x21b27b,null));};exports[_0x3c9c('0x9b')]=function(_0x45cd5d,_0x52e16d,_0x1c2779){var _0x5670f0={};var _0xbbcc4f={};var _0x4debfb;var _0x32ae5a;return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x45cd5d[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x52e16d,null))[_0x3c9c('0x27')](function(_0x38dfab){if(_0x38dfab){_0x4debfb=_0x38dfab;_0xbbcc4f[_0x3c9c('0x3f')]=_['keys'](db[_0x3c9c('0x9c')][_0x3c9c('0x38')]);_0xbbcc4f[_0x3c9c('0x3a')]=_['keys'](_0x45cd5d[_0x3c9c('0x3a')]);_0xbbcc4f[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0xbbcc4f['model'],_0xbbcc4f[_0x3c9c('0x3a')]);_0x5670f0[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0xbbcc4f[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x5670f0['attributes']=_0x5670f0['attributes'][_0x3c9c('0x50')]?_0x5670f0[_0x3c9c('0x3c')]:_0xbbcc4f[_0x3c9c('0x3f')];_0x5670f0[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x5670f0['where']=qs[_0x3c9c('0x3b')](_['pick'](_0x45cd5d[_0x3c9c('0x3a')],_0xbbcc4f[_0x3c9c('0x3b')]));if(_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x5670f0[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x5670f0['where'],{'$or':_[_0x3c9c('0x2d')](_0x5670f0['attributes'],function(_0x5dfc52){var _0x2d0c01={};_0x2d0c01[_0x5dfc52]={'$like':'%'+_0x45cd5d[_0x3c9c('0x3a')]['filter']+'%'};return _0x2d0c01;})});}_0x5670f0=_[_0x3c9c('0x47')]({},_0x5670f0,_0x45cd5d[_0x3c9c('0x48')]);return _0x4debfb[_0x3c9c('0x9b')](_0x5670f0);}})[_0x3c9c('0x27')](function(_0x4d79b1){if(_0x4d79b1){_0x32ae5a=_0x4d79b1[_0x3c9c('0x50')];if(!_0x45cd5d['query'][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x5670f0[_0x3c9c('0x1f')]=qs['limit'](_0x45cd5d[_0x3c9c('0x3a')]['limit']);_0x5670f0[_0x3c9c('0x1d')]=qs['offset'](_0x45cd5d[_0x3c9c('0x3a')]['offset']);}return _0x4debfb[_0x3c9c('0x9b')](_0x5670f0);}})[_0x3c9c('0x27')](function(_0xb893de){if(_0xb893de){return _0xb893de?{'count':_0x32ae5a,'rows':_0xb893de}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x52e16d,null))[_0x3c9c('0x4c')](handleError(_0x52e16d,null));};exports[_0x3c9c('0x9d')]=function(_0x1cbf6c,_0x1815dc,_0x110f4c){var _0x2702ac=moment()[_0x3c9c('0x7f')](_0x3c9c('0x9e'));var _0x48b0ea,_0x4d3420;return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x1cbf6c[_0x3c9c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1815dc,null))[_0x3c9c('0x27')](function(_0x2e02ce){if(_0x2e02ce){_0x4d3420=_0x2e02ce;return _0x2e02ce[_0x3c9c('0x9d')](_0x1cbf6c[_0x3c9c('0x60')][_0x3c9c('0x84')],_['omit'](_0x1cbf6c[_0x3c9c('0x60')],[_0x3c9c('0x84'),'id'])||{});}return null;})['spread'](function(_0x2b152d){var _0x4ab3bb;_0x48b0ea=_0x2b152d||[];var _0x32d1d3=[];if(_0x2b152d){for(var _0x2f5596=0x0;_0x2f5596<_0x2b152d[_0x3c9c('0x50')];_0x2f5596+=0x1){var _0x1af3ad=_0x2b152d[_0x2f5596]['get']({'plain':!![]});_0x4d3420['dialCheckDuplicateType']=_0x1cbf6c['body'][_0x3c9c('0x9f')]?_0x1cbf6c['body']['dialCheckDuplicateType']:_0x4d3420['dialCheckDuplicateType'];switch(_0x4d3420[_0x3c9c('0x9f')]){case _0x3c9c('0xa0'):_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))['fromQuery']([_0x3c9c('0xa4'),_0x3c9c('0xa5'),_0x3c9c('0xa6'),_0x3c9c('0xa7'),_0x3c9c('0x65'),'createdAt',_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xa4'),_0x3c9c('0xa4'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0xa5'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))[_0x3c9c('0x86')](_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x1cbf6c['params']['id'][_0x3c9c('0x8f')](),_0x3c9c('0x65'))['field']('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x61'))[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')]('deletedAt\x20IS\x20NULL')[_0x3c9c('0x44')]('ListId\x20=\x20?',_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')]())[_0x3c9c('0x44')](_0x3c9c('0xaa'))['where'](_0x3c9c('0xab'),squel['select']()[_0x3c9c('0x86')](_0x3c9c('0xac'))[_0x3c9c('0x88')](_0x3c9c('0xad'))[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString']()))[_0x3c9c('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xae'))[_0x3c9c('0x88')]('cm_hopper')[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString']())))[_0x3c9c('0x8f')]();break;case'onlyIfOpen':_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),_0x3c9c('0xa5'),'ContactId',_0x3c9c('0xa7'),'VoiceQueueId',_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')]('phone',_0x3c9c('0xa4'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0xa5'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))['field'](_0x1af3ad[_0x3c9c('0xa8')]['toString'](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString'](),_0x3c9c('0x65'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x61'))[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')](_0x3c9c('0xb0'))[_0x3c9c('0x44')](_0x3c9c('0xb1'),_0x1af3ad['CmListId'][_0x3c9c('0x8f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3c9c('0x44')](_0x3c9c('0xab'),squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xae'))[_0x3c9c('0x88')](_0x3c9c('0xa3'))[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id'][_0x3c9c('0x8f')]())))[_0x3c9c('0x8f')]();break;default:_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),_0x3c9c('0xa5'),_0x3c9c('0xa6'),_0x3c9c('0xa7'),_0x3c9c('0x65'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xa4'),_0x3c9c('0xa4'))['field']('\x27'+_0x2702ac+'\x27','scheduledAt')[_0x3c9c('0x86')]('id','ContactId')['field'](_0x1af3ad[_0x3c9c('0xa8')]['toString'](),'ListId')[_0x3c9c('0x86')](_0x1cbf6c[_0x3c9c('0x4e')]['id'][_0x3c9c('0x8f')](),_0x3c9c('0x65'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27','updatedAt')[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')](_0x3c9c('0xb0'))[_0x3c9c('0x44')](_0x3c9c('0xb1'),_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')]())['where'](_0x3c9c('0xaa')))[_0x3c9c('0x8f')]();}_0x32d1d3['push'](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x4ab3bb));}return BPromise[_0x3c9c('0x92')](_0x32d1d3);}})[_0x3c9c('0x27')](function(){var _0x9a85c0=[];var _0x10ff69=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xb2'))[_0x3c9c('0xaf')]([_0x3c9c('0xb3'),_0x3c9c('0xa4'),_0x3c9c('0xb4'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()['field'](_0x3c9c('0xb5'))[_0x3c9c('0x86')](_0x3c9c('0xb6'))['field'](_0x3c9c('0xb7'))['field']('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27','updatedAt')['from'](_0x3c9c('0xb8'),'ci')[_0x3c9c('0xb9')](_0x3c9c('0xa3'),'h',_0x3c9c('0xba'))[_0x3c9c('0x44')](_0x3c9c('0xbb'),_0x2702ac)[_0x3c9c('0x44')]('ci.ItemClass=?',_0x3c9c('0xbc')))[_0x3c9c('0x8f')]();_0x9a85c0['push'](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x10ff69));return BPromise['all'](_0x9a85c0);})['then'](function(){return _0x48b0ea;})['then'](respondWithResult(_0x1815dc,null))[_0x3c9c('0x4c')](handleError(_0x1815dc,null));};exports[_0x3c9c('0xbd')]=function(_0x25b8e1,_0x1bfe77,_0x48183e){return db['VoiceQueue'][_0x3c9c('0x30')]({'where':{'id':_0x25b8e1[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x1bfe77,null))['then'](function(_0x1dc4bd){if(_0x1dc4bd){return _0x1dc4bd['removeLists'](_0x25b8e1['query'][_0x3c9c('0x84')]);}})[_0x3c9c('0x27')](function(_0xecbeb4){if(_0xecbeb4){return db[_0x3c9c('0x64')]['destroy']({'where':{'ListId':_0x25b8e1[_0x3c9c('0x3a')][_0x3c9c('0x84')],'VoiceQueueId':_0x25b8e1[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(){return _0xecbeb4;});}})[_0x3c9c('0x27')](respondWithStatusCode(_0x1bfe77,null))[_0x3c9c('0x4c')](handleError(_0x1bfe77,null));};exports[_0x3c9c('0xbe')]=function(_0x218d51,_0x99501f,_0x2b49c0){var _0x2f52a8={};var _0x4ea6b9={};var _0x1fad28;var _0x3175c4;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x218d51[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x99501f,null))[_0x3c9c('0x27')](function(_0x161d53){if(_0x161d53){_0x1fad28=_0x161d53;_0x4ea6b9[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x9c')][_0x3c9c('0x38')]);_0x4ea6b9[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x218d51[_0x3c9c('0x3a')]);_0x4ea6b9['filters']=_[_0x3c9c('0x3d')](_0x4ea6b9[_0x3c9c('0x3f')],_0x4ea6b9[_0x3c9c('0x3a')]);_0x2f52a8[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x4ea6b9[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x2f52a8[_0x3c9c('0x3c')]=_0x2f52a8[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x2f52a8[_0x3c9c('0x3c')]:_0x4ea6b9[_0x3c9c('0x3f')];_0x2f52a8[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x218d51['query'][_0x3c9c('0x43')]);_0x2f52a8[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x218d51[_0x3c9c('0x3a')],_0x4ea6b9[_0x3c9c('0x3b')]));if(_0x218d51['query'][_0x3c9c('0x2b')]){_0x2f52a8[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x2f52a8[_0x3c9c('0x44')],{'$or':_['map'](_0x2f52a8[_0x3c9c('0x3c')],function(_0x589a5b){var _0x377010={};_0x377010[_0x589a5b]={'$like':'%'+_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x377010;})});}_0x2f52a8=_['merge']({},_0x2f52a8,_0x218d51[_0x3c9c('0x48')]);return _0x1fad28['getBlackLists'](_0x2f52a8);}})['then'](function(_0x4e727d){if(_0x4e727d){_0x3175c4=_0x4e727d[_0x3c9c('0x50')];if(!_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x2f52a8[_0x3c9c('0x1f')]=qs['limit'](_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x2f52a8[_0x3c9c('0x1d')]=qs['offset'](_0x218d51[_0x3c9c('0x3a')]['offset']);}return _0x1fad28[_0x3c9c('0xbe')](_0x2f52a8);}})[_0x3c9c('0x27')](function(_0x585794){if(_0x585794){return _0x585794?{'count':_0x3175c4,'rows':_0x585794}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x99501f,null))[_0x3c9c('0x4c')](handleError(_0x99501f,null));};exports[_0x3c9c('0xbf')]=function(_0x998d43,_0x62e103,_0x2de18b){var _0x10d2c2,_0x4e5c3c;return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x998d43['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x62e103,null))[_0x3c9c('0x27')](function(_0x481933){if(_0x481933){_0x4e5c3c=_0x481933;return _0x481933['addBlackLists'](_0x998d43[_0x3c9c('0x60')][_0x3c9c('0x84')],_[_0x3c9c('0x5e')](_0x998d43[_0x3c9c('0x60')],['ids','id'])||{});}return null;})[_0x3c9c('0x97')](function(_0x1cf0e9){var _0x4da5a9;_0x10d2c2=_0x1cf0e9||[];var _0x52123d=[];if(_0x1cf0e9){for(var _0x295147=0x0;_0x295147<_0x1cf0e9[_0x3c9c('0x50')];_0x295147+=0x1){var _0x6ef991=_0x1cf0e9[_0x295147][_0x3c9c('0x29')]({'plain':!![]});_0x4da5a9=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xc0'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),'ContactId',_0x3c9c('0xa7'),_0x3c9c('0x65'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel['select']()['field'](_0x3c9c('0xa4'),_0x3c9c('0xa4'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))[_0x3c9c('0x86')](_0x6ef991[_0x3c9c('0xa8')][_0x3c9c('0x8f')](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x998d43[_0x3c9c('0x4e')]['id']['toString'](),_0x3c9c('0x65'))[_0x3c9c('0x86')](_0x3c9c('0xc1'),'createdAt')[_0x3c9c('0x86')](_0x3c9c('0xc1'),_0x3c9c('0x61'))[_0x3c9c('0x88')]('cm_contacts')[_0x3c9c('0x44')](_0x3c9c('0xb0'))['where'](_0x3c9c('0xb1'),_0x6ef991[_0x3c9c('0xa8')]['toString']())[_0x3c9c('0x44')](_0x3c9c('0xaa')))[_0x3c9c('0x8f')]();_0x52123d['push'](db['sequelize'][_0x3c9c('0x3a')](_0x4da5a9));}return BPromise[_0x3c9c('0x92')](_0x52123d);}})[_0x3c9c('0x27')](function(){return _0x10d2c2;})['then'](respondWithResult(_0x62e103,null))[_0x3c9c('0x4c')](handleError(_0x62e103,null));};exports[_0x3c9c('0xc2')]=function(_0x1fbed7,_0xea27c,_0x16066f){return db[_0x3c9c('0x49')]['find']({'where':{'id':_0x1fbed7[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0xea27c,null))['then'](function(_0xe84648){if(_0xe84648){return _0xe84648['removeBlackLists'](_0x1fbed7['query'][_0x3c9c('0x84')]);}})[_0x3c9c('0x27')](function(_0xfc7a4c){if(_0xfc7a4c){return db[_0x3c9c('0x6b')][_0x3c9c('0x28')]({'where':{'ListId':_0x1fbed7[_0x3c9c('0x3a')][_0x3c9c('0x84')],'VoiceQueueId':_0x1fbed7[_0x3c9c('0x4e')]['id']}})['then'](function(){return _0xfc7a4c;});}})[_0x3c9c('0x27')](respondWithStatusCode(_0xea27c,null))[_0x3c9c('0x4c')](handleError(_0xea27c,null));};
\ No newline at end of file
+var _0xe260=['VoiceQueues','inbound','filter','ignore','map','value','includes','find','type','UserProfileResource','error','name','send','index','VoiceQueue','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','updatedAt','body','createdAt','QueueCampaigns','UserProfileSection','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','voicePause','interface','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','online','isEmpty','all','isArray','getAgents','getMembers','getLists','CmList','format','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','ListId\x20=\x20?','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xe260,0x94));var _0x0e26=function(_0x759350,_0x56a2a7){_0x759350=_0x759350-0x0;var _0xe37243=_0xe260[_0x759350];return _0xe37243;};'use strict';var emlformat=require(_0x0e26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e26('0x1'));var jsonpatch=require(_0x0e26('0x2'));var rp=require(_0x0e26('0x3'));var moment=require(_0x0e26('0x4'));var BPromise=require(_0x0e26('0x5'));var Mustache=require(_0x0e26('0x6'));var util=require(_0x0e26('0x7'));var path=require(_0x0e26('0x8'));var sox=require(_0x0e26('0x9'));var csv=require(_0x0e26('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e26('0xb'));var squel=require(_0x0e26('0xc'));var crypto=require(_0x0e26('0xd'));var jsforce=require(_0x0e26('0xe'));var deskjs=require(_0x0e26('0xf'));var toCsv=require(_0x0e26('0xa'));var querystring=require(_0x0e26('0x10'));var Papa=require('papaparse');var Redis=require(_0x0e26('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0e26('0x12'));var as=require(_0x0e26('0x13'));var hardwareService=require(_0x0e26('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0e26('0x15'));var config=require(_0x0e26('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e26('0x17'))['db'];config[_0x0e26('0x18')]=_[_0x0e26('0x19')](config['redis'],{'host':_0x0e26('0x1a'),'port':0x18eb});var socket=require(_0x0e26('0x1b'))(new Redis(config[_0x0e26('0x18')]));require(_0x0e26('0x1c'))[_0x0e26('0x1d')](socket);function respondWithStatusCode(_0x32b16c,_0x41a968){_0x41a968=_0x41a968||0xcc;return function(_0x5f50c3){if(_0x5f50c3){return _0x32b16c[_0x0e26('0x1e')](_0x41a968);}return _0x32b16c[_0x0e26('0x1f')](_0x41a968)[_0x0e26('0x20')]();};}function respondWithResult(_0x34a12c,_0x517a7d){_0x517a7d=_0x517a7d||0xc8;return function(_0x12a0a9){if(_0x12a0a9){return _0x34a12c[_0x0e26('0x1f')](_0x517a7d)[_0x0e26('0x21')](_0x12a0a9);}};}function respondWithFilteredResult(_0x240ed1,_0x16782d){return function(_0x5d0c24){if(_0x5d0c24){var _0x177568=typeof _0x16782d[_0x0e26('0x22')]===_0x0e26('0x23')&&typeof _0x16782d[_0x0e26('0x24')]===_0x0e26('0x23');var _0x2a997b=_0x5d0c24[_0x0e26('0x25')];var _0x1cb0b5=_0x177568?0x0:_0x16782d[_0x0e26('0x22')];var _0x23ad05=_0x177568?_0x5d0c24[_0x0e26('0x25')]:_0x16782d[_0x0e26('0x22')]+_0x16782d[_0x0e26('0x24')];var _0x30497c;if(_0x23ad05>=_0x2a997b){_0x23ad05=_0x2a997b;_0x30497c=0xc8;}else{_0x30497c=0xce;}_0x240ed1['status'](_0x30497c);return _0x240ed1[_0x0e26('0x26')]('Content-Range',_0x1cb0b5+'-'+_0x23ad05+'/'+_0x2a997b)[_0x0e26('0x21')](_0x5d0c24);}return null;};}function patchUpdates(_0x57fd1c){return function(_0x5bef55){try{jsonpatch[_0x0e26('0x27')](_0x5bef55,_0x57fd1c,!![]);}catch(_0x324932){return BPromise[_0x0e26('0x28')](_0x324932);}return _0x5bef55[_0x0e26('0x29')]();};}function saveUpdates(_0xa5a108,_0x320d6b){return function(_0x1b3cd8){if(_0x1b3cd8){return _0x1b3cd8[_0x0e26('0x2a')](_0xa5a108)[_0x0e26('0x2b')](function(_0x9eff86){return _0x9eff86;});}return null;};}function removeEntity(_0x2dad4c,_0x544ddb){return function(_0x5403f7){if(_0x5403f7){return _0x5403f7[_0x0e26('0x2c')]()['then'](function(){var _0x5f2fb8=_0x5403f7[_0x0e26('0x2d')]({'plain':!![]});var _0x15be4a=[{'name':_0x0e26('0x2e'),'value':_0x0e26('0x2f'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5863dc=_(_0x15be4a)[_0x0e26('0x30')](_0x0e26('0x31'))[_0x0e26('0x32')](_0x0e26('0x33'))[_0x0e26('0x33')]();if(_[_0x0e26('0x34')](_0x5863dc,_0x5f2fb8['type'])){return;}var _0xd4b9fc=_[_0x0e26('0x35')](_0x15be4a,[_0x0e26('0x33'),_0x5f2fb8[_0x0e26('0x36')]])['name'];return db[_0x0e26('0x37')][_0x0e26('0x2c')]({'where':{'type':_0xd4b9fc,'resourceId':_0x5f2fb8['id']}})[_0x0e26('0x2b')](function(){return _0x5403f7;});})[_0x0e26('0x2b')](function(){_0x2dad4c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbfff4,_0xc66a5a){return function(_0x502a34){if(!_0x502a34){_0xdbfff4['sendStatus'](0x194);}return _0x502a34;};}function handleError(_0x52afea,_0x18853e){_0x18853e=_0x18853e||0x1f4;return function(_0x555961){logger[_0x0e26('0x38')](_0x555961['stack']);if(_0x555961['name']){delete _0x555961[_0x0e26('0x39')];}_0x52afea[_0x0e26('0x1f')](_0x18853e)[_0x0e26('0x3a')](_0x555961);};}exports[_0x0e26('0x3b')]=function(_0xb0de07,_0xb44883){var _0x19a5e4={},_0x520b3e={},_0x6b9e3d={'count':0x0,'rows':[]};var _0x4553cb=_[_0x0e26('0x32')](db[_0x0e26('0x3c')][_0x0e26('0x3d')],function(_0x354216){return{'name':_0x354216[_0x0e26('0x3e')],'type':_0x354216[_0x0e26('0x36')]['key']};});_0x520b3e['model']=_[_0x0e26('0x32')](_0x4553cb,_0x0e26('0x39'));_0x520b3e[_0x0e26('0x3f')]=_['keys'](_0xb0de07['query']);_0x520b3e[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x520b3e[_0x0e26('0x42')],_0x520b3e[_0x0e26('0x3f')]);_0x19a5e4['attributes']=_[_0x0e26('0x41')](_0x520b3e[_0x0e26('0x42')],qs['fields'](_0xb0de07[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x19a5e4[_0x0e26('0x44')]=_0x19a5e4[_0x0e26('0x44')]['length']?_0x19a5e4[_0x0e26('0x44')]:_0x520b3e['model'];if(!_0xb0de07[_0x0e26('0x3f')][_0x0e26('0x45')]('nolimit')){_0x19a5e4[_0x0e26('0x24')]=qs['limit'](_0xb0de07['query'][_0x0e26('0x24')]);_0x19a5e4[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0xb0de07[_0x0e26('0x3f')][_0x0e26('0x22')]);}_0x19a5e4[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0xb0de07['query'][_0x0e26('0x47')]);_0x19a5e4[_0x0e26('0x48')]=qs[_0x0e26('0x40')](_[_0x0e26('0x49')](_0xb0de07[_0x0e26('0x3f')],_0x520b3e['filters']),_0x4553cb);if(_0xb0de07['query']['filter']){_0x19a5e4[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x19a5e4[_0x0e26('0x48')],{'$or':_[_0x0e26('0x32')](_0x4553cb,function(_0x2702fe){if(_0x2702fe[_0x0e26('0x36')]!=='VIRTUAL'){var _0x429e50={};_0x429e50[_0x2702fe[_0x0e26('0x39')]]={'$like':'%'+_0xb0de07[_0x0e26('0x3f')][_0x0e26('0x30')]+'%'};return _0x429e50;}})});}_0x19a5e4=_[_0x0e26('0x4a')]({},_0x19a5e4,_0xb0de07[_0x0e26('0x4b')]);var _0x36cb0e={'where':_0x19a5e4[_0x0e26('0x48')]};return db[_0x0e26('0x3c')][_0x0e26('0x25')](_0x36cb0e)['then'](function(_0x56e54b){_0x6b9e3d[_0x0e26('0x25')]=_0x56e54b;if(_0xb0de07['query'][_0x0e26('0x4c')]){_0x19a5e4[_0x0e26('0x4d')]=[{'all':!![]}];}return db['VoiceQueue'][_0x0e26('0x4e')](_0x19a5e4);})['then'](function(_0x4773a1){_0x6b9e3d[_0x0e26('0x4f')]=_0x4773a1;return _0x6b9e3d;})['then'](respondWithFilteredResult(_0xb44883,_0x19a5e4))[_0x0e26('0x50')](handleError(_0xb44883,null));};exports['show']=function(_0x2b072a,_0x36921d){var _0x5ddcf6={'raw':![],'where':{'id':_0x2b072a[_0x0e26('0x51')]['id']}},_0x4fdb74={};_0x4fdb74[_0x0e26('0x42')]=_['keys'](db[_0x0e26('0x3c')]['rawAttributes']);_0x4fdb74[_0x0e26('0x3f')]=_['keys'](_0x2b072a[_0x0e26('0x3f')]);_0x4fdb74[_0x0e26('0x40')]=_['intersection'](_0x4fdb74[_0x0e26('0x42')],_0x4fdb74['query']);_0x5ddcf6['attributes']=_[_0x0e26('0x41')](_0x4fdb74[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x2b072a[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x5ddcf6['attributes']=_0x5ddcf6['attributes'][_0x0e26('0x52')]?_0x5ddcf6[_0x0e26('0x44')]:_0x4fdb74['model'];if(_0x2b072a['query'][_0x0e26('0x4c')]){_0x5ddcf6[_0x0e26('0x4d')]=[{'all':!![]}];}_0x5ddcf6=_[_0x0e26('0x4a')]({},_0x5ddcf6,_0x2b072a[_0x0e26('0x4b')]);return db[_0x0e26('0x3c')][_0x0e26('0x35')](_0x5ddcf6)['then'](handleEntityNotFound(_0x36921d,null))[_0x0e26('0x2b')](respondWithResult(_0x36921d,null))['catch'](handleError(_0x36921d,null));};exports[_0x0e26('0x53')]=function(_0x2cee42,_0x4025a0){return db['VoiceQueue'][_0x0e26('0x53')](_0x2cee42['body'],{})[_0x0e26('0x2b')](function(_0x3eb245){var _0x399505=_0x2cee42[_0x0e26('0x54')][_0x0e26('0x2d')]({'plain':!![]});if(!_0x399505)throw new Error(_0x0e26('0x55'));if(_0x399505[_0x0e26('0x56')]===_0x0e26('0x54')){var _0x1aed29=_0x3eb245[_0x0e26('0x2d')]({'plain':!![]});var _0x3e3b9c=[{'name':_0x0e26('0x2e'),'value':_0x0e26('0x2f')},{'name':'QueueCampaigns','value':_0x0e26('0x57')}];var _0x9b88c2=_[_0x0e26('0x35')](_0x3e3b9c,[_0x0e26('0x33'),_0x1aed29[_0x0e26('0x36')]])[_0x0e26('0x39')];return db['UserProfileSection']['find']({'where':{'name':_0x9b88c2,'userProfileId':_0x399505[_0x0e26('0x58')]},'raw':!![]})[_0x0e26('0x2b')](function(_0x487320){if(_0x487320&&_0x487320[_0x0e26('0x59')]===0x0){return db[_0x0e26('0x37')][_0x0e26('0x53')]({'name':_0x1aed29[_0x0e26('0x39')],'resourceId':_0x1aed29['id'],'type':_0x487320[_0x0e26('0x39')],'sectionId':_0x487320['id']},{})[_0x0e26('0x2b')](function(){return _0x3eb245;});}else{return _0x3eb245;}})[_0x0e26('0x50')](function(_0x1bce9a){logger[_0x0e26('0x38')](_0x0e26('0x5a'),_0x1bce9a);throw _0x1bce9a;});}return _0x3eb245;})[_0x0e26('0x2b')](respondWithResult(_0x4025a0,0xc9))[_0x0e26('0x50')](handleError(_0x4025a0,null));};exports[_0x0e26('0x5b')]=function(_0x21200c,_0xea717d){var _0x2549e9={'where':{'id':_0x21200c[_0x0e26('0x51')]['id']}},_0x1f2bc9={};_0x1f2bc9[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db['VoiceQueue']['rawAttributes']);_0x2549e9[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x1f2bc9[_0x0e26('0x42')],qs['fields'](_0x21200c['query'][_0x0e26('0x43')]));_0x2549e9[_0x0e26('0x44')]=_0x2549e9['attributes'][_0x0e26('0x52')]?_0x2549e9['attributes']:_0x1f2bc9[_0x0e26('0x42')];if(_0x21200c[_0x0e26('0x3f')][_0x0e26('0x4c')]){_0x2549e9['include']=[{'all':!![]}];}_0x2549e9=_[_0x0e26('0x4a')]({},_0x2549e9,_0x21200c[_0x0e26('0x4b')]);return db['VoiceQueue'][_0x0e26('0x35')](_0x2549e9)[_0x0e26('0x2b')](handleEntityNotFound(_0xea717d,null))['then'](function(_0x3f0a9f){if(_0x3f0a9f){var _0x25af03=_0x3f0a9f[_0x0e26('0x2d')]({'plain':!![]});_0x25af03=qs[_0x0e26('0x5d')](_0x25af03,['id','createdAt',_0x0e26('0x5e')]);_0x21200c['body']=_['omit'](_0x21200c[_0x0e26('0x5f')],['id',_0x0e26('0x60'),_0x0e26('0x5e')]);return db['VoiceQueue']['create'](_[_0x0e26('0x4a')](_0x25af03,_0x21200c['body']),{'include':_0x21200c[_0x0e26('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0x0e26('0x2b')](function(_0x130fd6){var _0x36ea89=_0x21200c[_0x0e26('0x54')][_0x0e26('0x2d')]({'plain':!![]});if(!_0x36ea89)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36ea89[_0x0e26('0x56')]===_0x0e26('0x54')){var _0x9d95e4=_0x130fd6[_0x0e26('0x2d')]({'plain':!![]});var _0x33cd54=[{'name':_0x0e26('0x2e'),'value':_0x0e26('0x2f')},{'name':_0x0e26('0x61'),'value':'outbound'}];var _0x3c67f4=_[_0x0e26('0x35')](_0x33cd54,[_0x0e26('0x33'),_0x9d95e4['type']])[_0x0e26('0x39')];return db[_0x0e26('0x62')][_0x0e26('0x35')]({'where':{'name':_0x3c67f4,'userProfileId':_0x36ea89['userProfileId']},'raw':!![]})['then'](function(_0x5c13b5){if(_0x5c13b5&&_0x5c13b5[_0x0e26('0x59')]===0x0){return db[_0x0e26('0x37')][_0x0e26('0x53')]({'name':_0x9d95e4[_0x0e26('0x39')],'resourceId':_0x9d95e4['id'],'type':_0x5c13b5[_0x0e26('0x39')],'sectionId':_0x5c13b5['id']},{})[_0x0e26('0x2b')](function(){return _0x130fd6;});}else{return _0x130fd6;}})['catch'](function(_0x2cacb1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cacb1);throw _0x2cacb1;});}return _0x130fd6;});}})[_0x0e26('0x2b')](respondWithResult(_0xea717d,0xc9))[_0x0e26('0x50')](handleError(_0xea717d,null));};exports[_0x0e26('0x2a')]=function(_0x2af159,_0x65b1b6){if(_0x2af159[_0x0e26('0x5f')]['id']){delete _0x2af159[_0x0e26('0x5f')]['id'];}return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x2af159[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x65b1b6,null))[_0x0e26('0x2b')](saveUpdates(_0x2af159[_0x0e26('0x5f')],null))[_0x0e26('0x2b')](respondWithResult(_0x65b1b6,null))['catch'](handleError(_0x65b1b6,null));};exports[_0x0e26('0x2c')]=function(_0x3254c1,_0x1e0af0){return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x3254c1[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x1e0af0,null))[_0x0e26('0x2b')](removeEntity(_0x1e0af0,null))[_0x0e26('0x50')](handleError(_0x1e0af0,null));};exports['getHoppers']=function(_0x1c3a46,_0x501e93,_0xa37524){var _0x3d0bc8={'raw':![],'where':{}};var _0x47e92c={};var _0x5dd116={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0e26('0x63')]({'where':{'id':_0x1c3a46['params']['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x501e93,null))['then'](function(_0x1ac3e0){if(_0x1ac3e0){_0x47e92c['model']=_[_0x0e26('0x5c')](db[_0x0e26('0x64')]['rawAttributes']);_0x47e92c[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x1c3a46['query']);_0x47e92c[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x47e92c[_0x0e26('0x42')],_0x47e92c[_0x0e26('0x3f')]);_0x3d0bc8[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x47e92c[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x1c3a46['query'][_0x0e26('0x43')]));_0x3d0bc8[_0x0e26('0x44')]=_0x3d0bc8[_0x0e26('0x44')][_0x0e26('0x52')]?_0x3d0bc8[_0x0e26('0x44')]:_0x47e92c[_0x0e26('0x42')];if(!_0x1c3a46[_0x0e26('0x3f')][_0x0e26('0x45')](_0x0e26('0x65'))){_0x3d0bc8[_0x0e26('0x24')]=qs['limit'](_0x1c3a46[_0x0e26('0x3f')][_0x0e26('0x24')]);_0x3d0bc8[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x1c3a46['query'][_0x0e26('0x22')]);}_0x3d0bc8[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x1c3a46[_0x0e26('0x3f')]['sort']);_0x3d0bc8[_0x0e26('0x48')]=qs['filters'](_['pick'](_0x1c3a46['query'],_0x47e92c[_0x0e26('0x40')]));_0x3d0bc8['where']['VoiceQueueId']=_0x1ac3e0['id'];if(_0x1c3a46[_0x0e26('0x3f')][_0x0e26('0x30')]){_0x3d0bc8[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x3d0bc8['where'],{'$or':_[_0x0e26('0x32')](_0x3d0bc8[_0x0e26('0x44')],function(_0x10ccb6){var _0x5cb84f={};_0x5cb84f[_0x10ccb6]={'$like':'%'+_0x1c3a46[_0x0e26('0x3f')][_0x0e26('0x30')]+'%'};return _0x5cb84f;})});}_0x3d0bc8=_[_0x0e26('0x4a')]({},_0x3d0bc8,_0x1c3a46['options']);return db[_0x0e26('0x64')][_0x0e26('0x25')]({'where':_0x3d0bc8[_0x0e26('0x48')]})['then'](function(_0x19276e){_0x5dd116[_0x0e26('0x25')]=_0x19276e;if(_0x1c3a46[_0x0e26('0x3f')][_0x0e26('0x4c')]){_0x3d0bc8['include']=[{'all':!![]}];}return db['CmHopper'][_0x0e26('0x4e')](_0x3d0bc8);})[_0x0e26('0x2b')](function(_0x5a21d9){_0x5dd116[_0x0e26('0x4f')]=_0x5a21d9;return _0x5dd116;});}})['then'](respondWithFilteredResult(_0x501e93,_0x3d0bc8))[_0x0e26('0x50')](handleError(_0x501e93,null));};exports[_0x0e26('0x66')]=function(_0x7d4fb5,_0x14de03,_0x2d7aef){var _0x21c2cc={'raw':!![],'where':{}};var _0x3101da={};var _0x50a2d1={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0e26('0x63')]({'where':{'id':_0x7d4fb5[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x14de03,null))[_0x0e26('0x2b')](function(_0x96379c){if(_0x96379c){_0x3101da[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db[_0x0e26('0x67')][_0x0e26('0x3d')]);_0x3101da[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x7d4fb5[_0x0e26('0x3f')]);_0x3101da[_0x0e26('0x40')]=_['intersection'](_0x3101da[_0x0e26('0x42')],_0x3101da[_0x0e26('0x3f')]);_0x21c2cc['attributes']=_[_0x0e26('0x41')](_0x3101da[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x7d4fb5[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x21c2cc[_0x0e26('0x44')]=_0x21c2cc['attributes'][_0x0e26('0x52')]?_0x21c2cc[_0x0e26('0x44')]:_0x3101da[_0x0e26('0x42')];if(!_0x7d4fb5[_0x0e26('0x3f')]['hasOwnProperty'](_0x0e26('0x65'))){_0x21c2cc[_0x0e26('0x24')]=qs['limit'](_0x7d4fb5[_0x0e26('0x3f')]['limit']);_0x21c2cc['offset']=qs[_0x0e26('0x22')](_0x7d4fb5['query'][_0x0e26('0x22')]);}_0x21c2cc[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x7d4fb5[_0x0e26('0x3f')][_0x0e26('0x47')]);_0x21c2cc[_0x0e26('0x48')]=qs[_0x0e26('0x40')](_['pick'](_0x7d4fb5[_0x0e26('0x3f')],_0x3101da['filters']));_0x21c2cc[_0x0e26('0x48')][_0x0e26('0x68')]=_0x96379c['id'];if(_0x7d4fb5['query'][_0x0e26('0x30')]){_0x21c2cc['where']=_[_0x0e26('0x4a')](_0x21c2cc['where'],{'$or':_['map'](_0x21c2cc[_0x0e26('0x44')],function(_0x46a6ad){var _0x12b748={};_0x12b748[_0x46a6ad]={'$like':'%'+_0x7d4fb5[_0x0e26('0x3f')][_0x0e26('0x30')]+'%'};return _0x12b748;})});}_0x21c2cc=_[_0x0e26('0x4a')]({},_0x21c2cc,_0x7d4fb5['options']);return db[_0x0e26('0x67')][_0x0e26('0x25')]({'where':_0x21c2cc[_0x0e26('0x48')]})['then'](function(_0x2e090a){_0x50a2d1['count']=_0x2e090a;if(_0x7d4fb5[_0x0e26('0x3f')][_0x0e26('0x4c')]){_0x21c2cc[_0x0e26('0x4d')]=[{'all':!![]}];}return db[_0x0e26('0x67')][_0x0e26('0x4e')](_0x21c2cc);})[_0x0e26('0x2b')](function(_0x2a7ff8){_0x50a2d1[_0x0e26('0x4f')]=_0x2a7ff8;return _0x50a2d1;});}})[_0x0e26('0x2b')](respondWithFilteredResult(_0x14de03,_0x21c2cc))[_0x0e26('0x50')](handleError(_0x14de03,null));};exports['getHopperFinals']=function(_0x63c2c3,_0x2361c5,_0x8b066b){var _0x34748a={'raw':!![],'where':{}};var _0xe785dd={};var _0x11726a={'count':0x0,'rows':[]};return db[_0x0e26('0x3c')][_0x0e26('0x63')]({'where':{'id':_0x63c2c3[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x2361c5,null))[_0x0e26('0x2b')](function(_0x87c20b){if(_0x87c20b){_0xe785dd[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db['CmHopperFinal'][_0x0e26('0x3d')]);_0xe785dd[_0x0e26('0x3f')]=_['keys'](_0x63c2c3[_0x0e26('0x3f')]);_0xe785dd[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0xe785dd[_0x0e26('0x42')],_0xe785dd[_0x0e26('0x3f')]);_0x34748a[_0x0e26('0x44')]=_['intersection'](_0xe785dd[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x63c2c3[_0x0e26('0x3f')]['fields']));_0x34748a[_0x0e26('0x44')]=_0x34748a[_0x0e26('0x44')]['length']?_0x34748a[_0x0e26('0x44')]:_0xe785dd[_0x0e26('0x42')];if(!_0x63c2c3['query'][_0x0e26('0x45')](_0x0e26('0x65'))){_0x34748a[_0x0e26('0x24')]=qs['limit'](_0x63c2c3[_0x0e26('0x3f')]['limit']);_0x34748a[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x63c2c3[_0x0e26('0x3f')]['offset']);}_0x34748a[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x63c2c3['query']['sort']);_0x34748a[_0x0e26('0x48')]=qs['filters'](_[_0x0e26('0x49')](_0x63c2c3[_0x0e26('0x3f')],_0xe785dd[_0x0e26('0x40')]));_0x34748a['where']['VoiceQueueId']=_0x87c20b['id'];if(_0x63c2c3['query'][_0x0e26('0x30')]){_0x34748a[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x34748a[_0x0e26('0x48')],{'$or':_['map'](_0x34748a[_0x0e26('0x44')],function(_0x5db211){var _0x233aa7={};_0x233aa7[_0x5db211]={'$like':'%'+_0x63c2c3['query']['filter']+'%'};return _0x233aa7;})});}_0x34748a=_['merge']({},_0x34748a,_0x63c2c3[_0x0e26('0x4b')]);return db[_0x0e26('0x69')]['count']({'where':_0x34748a[_0x0e26('0x48')]})[_0x0e26('0x2b')](function(_0x2bd1ea){_0x11726a[_0x0e26('0x25')]=_0x2bd1ea;if(_0x63c2c3[_0x0e26('0x3f')][_0x0e26('0x4c')]){_0x34748a[_0x0e26('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0e26('0x4e')](_0x34748a);})[_0x0e26('0x2b')](function(_0x3be73e){_0x11726a['rows']=_0x3be73e;return _0x11726a;});}})[_0x0e26('0x2b')](respondWithFilteredResult(_0x2361c5,_0x34748a))[_0x0e26('0x50')](handleError(_0x2361c5,null));};exports['getHopperBlacks']=function(_0x4afabe,_0xf3d79b,_0x32761e){var _0x349db6={'raw':!![],'where':{}};var _0x3f352c={};var _0x485ebd={'count':0x0,'rows':[]};return db[_0x0e26('0x3c')][_0x0e26('0x63')]({'where':{'id':_0x4afabe[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0xf3d79b,null))[_0x0e26('0x2b')](function(_0x9d626b){if(_0x9d626b){_0x3f352c['model']=_[_0x0e26('0x5c')](db[_0x0e26('0x6a')][_0x0e26('0x3d')]);_0x3f352c[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x4afabe['query']);_0x3f352c['filters']=_[_0x0e26('0x41')](_0x3f352c[_0x0e26('0x42')],_0x3f352c[_0x0e26('0x3f')]);_0x349db6[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x3f352c[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x4afabe[_0x0e26('0x3f')]['fields']));_0x349db6[_0x0e26('0x44')]=_0x349db6[_0x0e26('0x44')][_0x0e26('0x52')]?_0x349db6['attributes']:_0x3f352c[_0x0e26('0x42')];if(!_0x4afabe[_0x0e26('0x3f')][_0x0e26('0x45')](_0x0e26('0x65'))){_0x349db6[_0x0e26('0x24')]=qs[_0x0e26('0x24')](_0x4afabe['query']['limit']);_0x349db6['offset']=qs[_0x0e26('0x22')](_0x4afabe[_0x0e26('0x3f')]['offset']);}_0x349db6[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x4afabe[_0x0e26('0x3f')][_0x0e26('0x47')]);_0x349db6[_0x0e26('0x48')]=qs['filters'](_[_0x0e26('0x49')](_0x4afabe[_0x0e26('0x3f')],_0x3f352c[_0x0e26('0x40')]));_0x349db6[_0x0e26('0x48')][_0x0e26('0x68')]=_0x9d626b['id'];if(_0x4afabe[_0x0e26('0x3f')][_0x0e26('0x30')]){_0x349db6['where']=_[_0x0e26('0x4a')](_0x349db6['where'],{'$or':_[_0x0e26('0x32')](_0x349db6[_0x0e26('0x44')],function(_0x4ef9b2){var _0x3945fc={};_0x3945fc[_0x4ef9b2]={'$like':'%'+_0x4afabe[_0x0e26('0x3f')][_0x0e26('0x30')]+'%'};return _0x3945fc;})});}_0x349db6=_[_0x0e26('0x4a')]({},_0x349db6,_0x4afabe[_0x0e26('0x4b')]);return db[_0x0e26('0x6a')]['count']({'where':_0x349db6[_0x0e26('0x48')]})[_0x0e26('0x2b')](function(_0x700f83){_0x485ebd[_0x0e26('0x25')]=_0x700f83;if(_0x4afabe[_0x0e26('0x3f')][_0x0e26('0x4c')]){_0x349db6['include']=[{'all':!![]}];}return db[_0x0e26('0x6a')]['findAll'](_0x349db6);})['then'](function(_0x24c2e4){_0x485ebd[_0x0e26('0x4f')]=_0x24c2e4;return _0x485ebd;});}})[_0x0e26('0x2b')](respondWithFilteredResult(_0xf3d79b,_0x349db6))[_0x0e26('0x50')](handleError(_0xf3d79b,null));};exports[_0x0e26('0x6b')]=function(_0x35f0a9,_0x570833,_0x42dcb6){var _0x3d1826={};var _0x266a2a={};var _0x525a26;var _0x2c2c63;return db['VoiceQueue'][_0x0e26('0x63')]({'where':{'id':_0x35f0a9['params']['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x570833,null))['then'](function(_0x55a250){if(_0x55a250){_0x525a26=_0x55a250;_0x266a2a[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db[_0x0e26('0x6c')][_0x0e26('0x3d')]);_0x266a2a[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x35f0a9[_0x0e26('0x3f')]);_0x266a2a[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x266a2a[_0x0e26('0x42')],_0x266a2a['query']);_0x3d1826[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x266a2a[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x35f0a9[_0x0e26('0x3f')]['fields']));_0x3d1826[_0x0e26('0x44')]=_0x3d1826[_0x0e26('0x44')][_0x0e26('0x52')]?_0x3d1826[_0x0e26('0x44')]:_0x266a2a['model'];_0x3d1826[_0x0e26('0x46')]=qs['sort'](_0x35f0a9['query'][_0x0e26('0x47')]);_0x3d1826[_0x0e26('0x48')]=qs[_0x0e26('0x40')](_[_0x0e26('0x49')](_0x35f0a9[_0x0e26('0x3f')],_0x266a2a[_0x0e26('0x40')]));if(_0x35f0a9[_0x0e26('0x3f')][_0x0e26('0x30')]){_0x3d1826[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x3d1826[_0x0e26('0x48')],{'$or':_[_0x0e26('0x32')](_0x3d1826[_0x0e26('0x44')],function(_0x1be0b3){var _0x32b38a={};_0x32b38a[_0x1be0b3]={'$like':'%'+_0x35f0a9[_0x0e26('0x3f')]['filter']+'%'};return _0x32b38a;})});}_0x3d1826=_[_0x0e26('0x4a')]({},_0x3d1826,_0x35f0a9['options']);return _0x525a26[_0x0e26('0x6b')](_0x3d1826);}})[_0x0e26('0x2b')](function(_0x1371d7){if(_0x1371d7){_0x2c2c63=_0x1371d7['length'];if(!_0x35f0a9[_0x0e26('0x3f')]['hasOwnProperty'](_0x0e26('0x65'))){_0x3d1826[_0x0e26('0x24')]=qs[_0x0e26('0x24')](_0x35f0a9[_0x0e26('0x3f')]['limit']);_0x3d1826[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x35f0a9[_0x0e26('0x3f')]['offset']);}return _0x525a26[_0x0e26('0x6b')](_0x3d1826);}})[_0x0e26('0x2b')](function(_0x3d4c11){if(_0x3d4c11){return _0x3d4c11?{'count':_0x2c2c63,'rows':_0x3d4c11}:null;}})[_0x0e26('0x2b')](respondWithResult(_0x570833,null))[_0x0e26('0x50')](handleError(_0x570833,null));};exports[_0x0e26('0x6d')]=function(_0x55a690,_0x470471,_0x2775a4){var _0x3ce749=_0x55a690[_0x0e26('0x5f')][_0x0e26('0x6e')];var _0x5a8776=_[_0x0e26('0x32')](_0x3ce749,'id');return db[_0x0e26('0x6c')]['findAll']({'where':{'id':_0x5a8776},'attributes':['id'],'include':[{'model':db[_0x0e26('0x6f')],'as':'Agents','attributes':['id',_0x0e26('0x39'),'online',_0x0e26('0x70'),_0x0e26('0x71')],'raw':!![]}]})[_0x0e26('0x2b')](function(_0x254ace){if(_0x254ace){var _0x23b89f=_['flatMap'](_0x254ace,function(_0x4460bd){var _0x6acf7a=_0x4460bd[_0x0e26('0x2d')]({'plain':!![]});_0x6acf7a['Agents']['forEach'](function(_0x99ff6){_0x99ff6[_0x0e26('0x72')]=_[_0x0e26('0x35')](_0x3ce749,{'id':_0x6acf7a['id']})['penalty'];});return _0x6acf7a[_0x0e26('0x73')];});return db['VoiceQueue'][_0x0e26('0x35')]({'where':{'id':_0x55a690[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](function(_0x218889){return db[_0x0e26('0x74')][_0x0e26('0x75')](function(_0x53f05e){return _0x218889['addTeams'](_0x5a8776,{'transaction':_0x53f05e})[_0x0e26('0x2b')](function(){return BPromise[_0x0e26('0x76')](_0x3ce749,function(_0x299e27){return db[_0x0e26('0x77')]['upsert']({'TeamId':_0x299e27['id'],'VoiceQueueId':_0x55a690[_0x0e26('0x51')]['id'],'penalty':_0x299e27[_0x0e26('0x72')]},{'transaction':_0x53f05e});});})['then'](function(){return BPromise[_0x0e26('0x76')](_0x23b89f,function(_0x2362f8){return db[_0x0e26('0x78')][_0x0e26('0x79')]({'where':{'UserId':_0x2362f8['id'],'VoiceQueueId':_0x55a690[_0x0e26('0x51')]['id']},'defaults':{'penalty':_0x2362f8[_0x0e26('0x72')]},'transaction':_0x53f05e});});})[_0x0e26('0x2b')](function(){return BPromise[_0x0e26('0x76')](_[_0x0e26('0x30')](_0x23b89f,{'online':!![]}),function(_0x5ca968){return db['UserVoiceQueueRt'][_0x0e26('0x7a')]({'membername':_0x5ca968[_0x0e26('0x39')],'UserId':_0x5ca968['id'],'queue_name':_0x218889[_0x0e26('0x39')],'VoiceQueueId':_0x218889['id'],'interface':_[_0x0e26('0x7b')](_0x5ca968[_0x0e26('0x71')])?util['format'](_0x0e26('0x7c'),_0x5ca968[_0x0e26('0x39')]):_0x5ca968[_0x0e26('0x71')],'paused':_0x5ca968[_0x0e26('0x70')]||![],'penalty':_0x5ca968[_0x0e26('0x72')]},{'transaction':_0x53f05e});});})[_0x0e26('0x2b')](function(){_0x23b89f[_0x0e26('0x7d')](function(_0x49e968){socket[_0x0e26('0x7e')](_0x0e26('0x7f'),{'UserId':_0x49e968['id'],'VoiceQueueId':_0x218889['id']});});});});});}})[_0x0e26('0x2b')](respondWithStatusCode(_0x470471,null))[_0x0e26('0x50')](handleError(_0x470471,null));};exports[_0x0e26('0x80')]=function(_0x3c047b,_0x5c0dcb,_0x303b7f){return db[_0x0e26('0x6c')][_0x0e26('0x4e')]({'where':{'id':_0x3c047b[_0x0e26('0x3f')][_0x0e26('0x81')]},'attributes':['id'],'include':[{'model':db[_0x0e26('0x6f')],'as':_0x0e26('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5c0dcb,null))['then'](function(_0x182506){var _0x2904ca=_[_0x0e26('0x32')](_0x182506,'id');var _0x26b031=[];var _0x45fa92=[];var _0x3b2c8b=squel[_0x0e26('0x82')]();_0x3b2c8b[_0x0e26('0x83')]('tq.TeamId')[_0x0e26('0x84')](_0x0e26('0x85'),'tq')[_0x0e26('0x86')]('user_has_teams','ut',_0x0e26('0x87'))[_0x0e26('0x48')](_0x0e26('0x88'),_0x3c047b['params']['id']);for(var _0x125e1a=0x0;_0x125e1a<_0x182506[_0x0e26('0x52')];_0x125e1a+=0x1){let _0x21c85e=_0x182506[_0x125e1a];for(var _0x4b2c56=0x0;_0x4b2c56<_0x21c85e[_0x0e26('0x73')][_0x0e26('0x52')];_0x4b2c56+=0x1){let _0x42b65e=_0x21c85e['Agents'][_0x4b2c56];var _0x188859=_0x3b2c8b[_0x0e26('0x5b')]();_0x188859[_0x0e26('0x48')]('ut.UserId\x20=\x20?',_0x42b65e['id']);_0x45fa92[_0x0e26('0x89')](db[_0x0e26('0x74')][_0x0e26('0x3f')](_0x188859[_0x0e26('0x8a')](),{'type':db['sequelize'][_0x0e26('0x8b')][_0x0e26('0x8c')]})[_0x0e26('0x2b')](function(_0x55ecdf){if(_0x55ecdf['length']===0x1){return _0x42b65e['id'];}else{var _0x10bb14=_['every'](_[_0x0e26('0x32')](_0x55ecdf,_0x0e26('0x8d')),function(_0x4742c1){return _[_0x0e26('0x34')](_0x2904ca,_0x4742c1);});if(_0x10bb14){return _0x42b65e['id'];}}}));}}return BPromise['all'](_0x45fa92)[_0x0e26('0x2b')](function(_0x186594){_0x26b031=_(_0x26b031)[_0x0e26('0x8e')](_0x186594)[_0x0e26('0x8f')]()['value']();return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x3c047b[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](function(_0x197ec9){return db['sequelize'][_0x0e26('0x75')](function(_0x3518d7){return _0x197ec9['removeTeams'](_0x3c047b[_0x0e26('0x3f')][_0x0e26('0x81')],{'transaction':_0x3518d7})[_0x0e26('0x2b')](function(){if(!_['isEmpty'](_0x26b031)){return _0x197ec9[_0x0e26('0x90')](_0x26b031,{'transaction':_0x3518d7})[_0x0e26('0x2b')](function(){return db[_0x0e26('0x91')][_0x0e26('0x2c')]({'where':{'VoiceQueueId':_0x3c047b[_0x0e26('0x51')]['id'],'UserId':_0x26b031},'transaction':_0x3518d7});});}})[_0x0e26('0x2b')](function(){_0x26b031[_0x0e26('0x7d')](function(_0xa9c586){socket['emit'](_0x0e26('0x92'),{'UserId':_0xa9c586,'VoiceQueueId':_0x197ec9['id']});});});});});});})[_0x0e26('0x2b')](respondWithStatusCode(_0x5c0dcb,null))[_0x0e26('0x50')](handleError(_0x5c0dcb,null));};exports[_0x0e26('0x93')]=function(_0x2436da,_0x33c0f4,_0x4cee5e){var _0x5a6b14,_0x4ccbf6;return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x2436da[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x33c0f4,null))['then'](function(_0x244e64){if(_0x244e64){_0x4ccbf6=_0x244e64;return _0x244e64[_0x0e26('0x93')](_0x2436da[_0x0e26('0x5f')][_0x0e26('0x81')],_[_0x0e26('0x5d')](_0x2436da[_0x0e26('0x5f')],[_0x0e26('0x81'),'id'])||{})[_0x0e26('0x94')](function(_0x408370){for(var _0x21a702=0x0;_0x21a702<_0x2436da[_0x0e26('0x5f')]['ids']['length'];_0x21a702+=0x1){socket[_0x0e26('0x7e')]('userVoiceQueue:save',{'UserId':Number(_0x2436da[_0x0e26('0x5f')][_0x0e26('0x81')][_0x21a702]),'VoiceQueueId':Number(_0x2436da[_0x0e26('0x51')]['id'])});}return _0x408370;});}})[_0x0e26('0x2b')](function(_0x533685){_0x5a6b14=_0x533685||[];if(_0x4ccbf6){return db[_0x0e26('0x6f')][_0x0e26('0x4e')]({'where':{'id':_0x2436da[_0x0e26('0x5f')][_0x0e26('0x81')]},'attributes':['id',_0x0e26('0x39'),_0x0e26('0x95'),_0x0e26('0x70'),_0x0e26('0x71')],'raw':!![]});}})[_0x0e26('0x2b')](function(_0x2ebd89){if(!_[_0x0e26('0x96')](_0x2ebd89)){var _0xecf91d=[];for(var _0x27cb28=0x0;_0x27cb28<_0x2ebd89[_0x0e26('0x52')];_0x27cb28++){if(_0x2ebd89[_0x27cb28]['online']){_0xecf91d[_0x0e26('0x89')](db['UserVoiceQueueRt'][_0x0e26('0x7a')]({'membername':_0x2ebd89[_0x27cb28][_0x0e26('0x39')],'UserId':_0x2ebd89[_0x27cb28]['id'],'queue_name':_0x4ccbf6['name'],'VoiceQueueId':_0x4ccbf6['id'],'interface':_[_0x0e26('0x7b')](_0x2ebd89[_0x27cb28][_0x0e26('0x71')])?util['format']('SIP/%s',_0x2ebd89[_0x27cb28][_0x0e26('0x39')]):_0x2ebd89[_0x27cb28][_0x0e26('0x71')],'paused':_0x2ebd89[_0x27cb28][_0x0e26('0x70')]||![],'penalty':_0x2436da[_0x0e26('0x5f')][_0x0e26('0x72')]||0x0}));}}return BPromise[_0x0e26('0x97')](_0xecf91d);}})['then'](function(){return _0x5a6b14;})[_0x0e26('0x2b')](respondWithResult(_0x33c0f4,null))[_0x0e26('0x50')](handleError(_0x33c0f4,null));};exports[_0x0e26('0x90')]=function(_0x6f68c2,_0x43ac3d,_0x8c4365){return db[_0x0e26('0x3c')]['find']({'where':{'id':_0x6f68c2[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x43ac3d,null))[_0x0e26('0x2b')](function(_0x26bf44){if(_0x26bf44){return _0x26bf44['removeAgents'](_0x6f68c2[_0x0e26('0x3f')][_0x0e26('0x81')])['then'](function(){if(_[_0x0e26('0x98')](_0x6f68c2['query'][_0x0e26('0x81')])){for(var _0x5ce0ff=0x0;_0x5ce0ff<_0x6f68c2[_0x0e26('0x3f')][_0x0e26('0x81')][_0x0e26('0x52')];_0x5ce0ff+=0x1){socket[_0x0e26('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x6f68c2['query'][_0x0e26('0x81')][_0x5ce0ff]),'VoiceQueueId':Number(_0x6f68c2[_0x0e26('0x51')]['id'])});}}else{socket[_0x0e26('0x7e')](_0x0e26('0x92'),{'UserId':Number(_0x6f68c2[_0x0e26('0x3f')][_0x0e26('0x81')]),'VoiceQueueId':Number(_0x6f68c2['params']['id'])});}});}})[_0x0e26('0x2b')](function(_0x292880){return db[_0x0e26('0x91')]['destroy']({'where':{'VoiceQueueId':_0x6f68c2[_0x0e26('0x51')]['id'],'UserId':_0x6f68c2['query'][_0x0e26('0x81')]}})[_0x0e26('0x2b')](function(){return _0x292880;});})[_0x0e26('0x2b')](respondWithStatusCode(_0x43ac3d,null))['catch'](handleError(_0x43ac3d,null));};exports[_0x0e26('0x99')]=function(_0x1bfeb1,_0x40b048,_0x580f05){var _0x3647aa={};var _0x5dc599={};var _0x372195;var _0x3b3864;return db['VoiceQueue'][_0x0e26('0x63')]({'where':{'id':_0x1bfeb1['params']['id']}})['then'](handleEntityNotFound(_0x40b048,null))[_0x0e26('0x2b')](function(_0x410c72){if(_0x410c72){_0x372195=_0x410c72;_0x5dc599[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db['User']['rawAttributes']);_0x5dc599[_0x0e26('0x3f')]=_['keys'](_0x1bfeb1[_0x0e26('0x3f')]);_0x5dc599['filters']=_[_0x0e26('0x41')](_0x5dc599['model'],_0x5dc599[_0x0e26('0x3f')]);_0x3647aa[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x5dc599['model'],qs[_0x0e26('0x43')](_0x1bfeb1[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x3647aa[_0x0e26('0x44')]=_0x3647aa[_0x0e26('0x44')][_0x0e26('0x52')]?_0x3647aa[_0x0e26('0x44')]:_0x5dc599[_0x0e26('0x42')];_0x3647aa['order']=qs[_0x0e26('0x47')](_0x1bfeb1[_0x0e26('0x3f')]['sort']);_0x3647aa['where']=qs['filters'](_[_0x0e26('0x49')](_0x1bfeb1['query'],_0x5dc599['filters']));if(_0x1bfeb1[_0x0e26('0x3f')][_0x0e26('0x30')]){_0x3647aa['where']=_['merge'](_0x3647aa[_0x0e26('0x48')],{'$or':_[_0x0e26('0x32')](_0x3647aa['attributes'],function(_0x2da3a7){var _0x2a6e30={};_0x2a6e30[_0x2da3a7]={'$like':'%'+_0x1bfeb1['query']['filter']+'%'};return _0x2a6e30;})});}_0x3647aa=_[_0x0e26('0x4a')]({},_0x3647aa,_0x1bfeb1[_0x0e26('0x4b')]);return _0x372195[_0x0e26('0x99')](_0x3647aa);}})[_0x0e26('0x2b')](function(_0x20e8dd){if(_0x20e8dd){_0x3b3864=_0x20e8dd[_0x0e26('0x52')];if(!_0x1bfeb1['query'][_0x0e26('0x45')]('nolimit')){_0x3647aa[_0x0e26('0x24')]=qs['limit'](_0x1bfeb1[_0x0e26('0x3f')][_0x0e26('0x24')]);_0x3647aa[_0x0e26('0x22')]=qs['offset'](_0x1bfeb1[_0x0e26('0x3f')]['offset']);}return _0x372195[_0x0e26('0x99')](_0x3647aa);}})['then'](function(_0x346530){if(_0x346530){return _0x346530?{'count':_0x3b3864,'rows':_0x346530}:null;}})[_0x0e26('0x2b')](respondWithResult(_0x40b048,null))[_0x0e26('0x50')](handleError(_0x40b048,null));};exports[_0x0e26('0x9a')]=function(_0x402591,_0x247072,_0x17a06e){var _0x124805={};var _0x5d3494={};var _0x5b6b3b;var _0x1c73aa;return db[_0x0e26('0x3c')][_0x0e26('0x63')]({'where':{'id':_0x402591[_0x0e26('0x51')]['id']}})['then'](handleEntityNotFound(_0x247072,null))[_0x0e26('0x2b')](function(_0x5b0641){if(_0x5b0641){_0x5b6b3b=_0x5b0641;_0x5d3494[_0x0e26('0x42')]=_[_0x0e26('0x5c')](db[_0x0e26('0x91')][_0x0e26('0x3d')]);_0x5d3494[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x402591[_0x0e26('0x3f')]);_0x5d3494[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x5d3494[_0x0e26('0x42')],_0x5d3494[_0x0e26('0x3f')]);_0x124805[_0x0e26('0x44')]=_['intersection'](_0x5d3494['model'],qs[_0x0e26('0x43')](_0x402591[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x124805['attributes']=_0x124805['attributes']['length']?_0x124805['attributes']:_0x5d3494[_0x0e26('0x42')];_0x124805[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x402591[_0x0e26('0x3f')][_0x0e26('0x47')]);_0x124805[_0x0e26('0x48')]=qs['filters'](_[_0x0e26('0x49')](_0x402591['query'],_0x5d3494['filters']));if(_0x402591[_0x0e26('0x3f')]['filter']){_0x124805[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x124805[_0x0e26('0x48')],{'$or':_['map'](_0x124805[_0x0e26('0x44')],function(_0x191435){var _0x2a94ac={};_0x2a94ac[_0x191435]={'$like':'%'+_0x402591['query'][_0x0e26('0x30')]+'%'};return _0x2a94ac;})});}_0x124805=_['merge']({},_0x124805,_0x402591['options']);return _0x5b6b3b[_0x0e26('0x9a')](_0x124805);}})[_0x0e26('0x2b')](function(_0x5b497b){if(_0x5b497b){_0x1c73aa=_0x5b497b[_0x0e26('0x52')];if(!_0x402591[_0x0e26('0x3f')][_0x0e26('0x45')]('nolimit')){_0x124805[_0x0e26('0x24')]=qs['limit'](_0x402591['query'][_0x0e26('0x24')]);_0x124805[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x402591[_0x0e26('0x3f')]['offset']);}return _0x5b6b3b[_0x0e26('0x9a')](_0x124805);}})[_0x0e26('0x2b')](function(_0x32602d){return _0x32602d?{'count':_0x1c73aa,'rows':_0x32602d}:null;})[_0x0e26('0x2b')](respondWithResult(_0x247072,null))[_0x0e26('0x50')](handleError(_0x247072,null));};exports[_0x0e26('0x9b')]=function(_0x1c300d,_0x570cae,_0x4b0034){var _0x4b95c8={};var _0x23c32b={};var _0x15be16;var _0x89a4a9;return db[_0x0e26('0x3c')][_0x0e26('0x63')]({'where':{'id':_0x1c300d[_0x0e26('0x51')]['id']}})['then'](handleEntityNotFound(_0x570cae,null))[_0x0e26('0x2b')](function(_0x239580){if(_0x239580){_0x15be16=_0x239580;_0x23c32b[_0x0e26('0x42')]=_['keys'](db[_0x0e26('0x9c')][_0x0e26('0x3d')]);_0x23c32b[_0x0e26('0x3f')]=_[_0x0e26('0x5c')](_0x1c300d[_0x0e26('0x3f')]);_0x23c32b[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x23c32b[_0x0e26('0x42')],_0x23c32b[_0x0e26('0x3f')]);_0x4b95c8[_0x0e26('0x44')]=_['intersection'](_0x23c32b[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x1c300d[_0x0e26('0x3f')][_0x0e26('0x43')]));_0x4b95c8[_0x0e26('0x44')]=_0x4b95c8[_0x0e26('0x44')][_0x0e26('0x52')]?_0x4b95c8[_0x0e26('0x44')]:_0x23c32b[_0x0e26('0x42')];_0x4b95c8[_0x0e26('0x46')]=qs[_0x0e26('0x47')](_0x1c300d[_0x0e26('0x3f')]['sort']);_0x4b95c8[_0x0e26('0x48')]=qs[_0x0e26('0x40')](_['pick'](_0x1c300d[_0x0e26('0x3f')],_0x23c32b[_0x0e26('0x40')]));if(_0x1c300d[_0x0e26('0x3f')]['filter']){_0x4b95c8['where']=_['merge'](_0x4b95c8[_0x0e26('0x48')],{'$or':_[_0x0e26('0x32')](_0x4b95c8[_0x0e26('0x44')],function(_0x27c4d8){var _0x2a545c={};_0x2a545c[_0x27c4d8]={'$like':'%'+_0x1c300d['query']['filter']+'%'};return _0x2a545c;})});}_0x4b95c8=_[_0x0e26('0x4a')]({},_0x4b95c8,_0x1c300d[_0x0e26('0x4b')]);return _0x15be16[_0x0e26('0x9b')](_0x4b95c8);}})[_0x0e26('0x2b')](function(_0x5e8d6d){if(_0x5e8d6d){_0x89a4a9=_0x5e8d6d[_0x0e26('0x52')];if(!_0x1c300d[_0x0e26('0x3f')]['hasOwnProperty']('nolimit')){_0x4b95c8[_0x0e26('0x24')]=qs[_0x0e26('0x24')](_0x1c300d[_0x0e26('0x3f')][_0x0e26('0x24')]);_0x4b95c8[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x1c300d[_0x0e26('0x3f')][_0x0e26('0x22')]);}return _0x15be16[_0x0e26('0x9b')](_0x4b95c8);}})[_0x0e26('0x2b')](function(_0x267b2c){if(_0x267b2c){return _0x267b2c?{'count':_0x89a4a9,'rows':_0x267b2c}:null;}})['then'](respondWithResult(_0x570cae,null))[_0x0e26('0x50')](handleError(_0x570cae,null));};exports['addLists']=function(_0x53c6bf,_0x10d5fe,_0xbc8730){var _0x4226d7=moment()[_0x0e26('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2772d1,_0x3e53a9;return db[_0x0e26('0x3c')]['find']({'where':{'id':_0x53c6bf[_0x0e26('0x51')]['id']}})['then'](handleEntityNotFound(_0x10d5fe,null))['then'](function(_0x1469c6){if(_0x1469c6){_0x3e53a9=_0x1469c6;return _0x1469c6['addLists'](_0x53c6bf[_0x0e26('0x5f')][_0x0e26('0x81')],_['omit'](_0x53c6bf[_0x0e26('0x5f')],[_0x0e26('0x81'),'id'])||{});}return null;})[_0x0e26('0x94')](function(_0x11904f){var _0x3f0f2f;_0x2772d1=_0x11904f||[];var _0x5702e4=[];if(_0x11904f){for(var _0x513c7f=0x0;_0x513c7f<_0x11904f[_0x0e26('0x52')];_0x513c7f+=0x1){var _0x5eaeca=_0x11904f[_0x513c7f][_0x0e26('0x2d')]({'plain':!![]});_0x3e53a9[_0x0e26('0x9e')]=_0x53c6bf[_0x0e26('0x5f')][_0x0e26('0x9e')]?_0x53c6bf[_0x0e26('0x5f')][_0x0e26('0x9e')]:_0x3e53a9[_0x0e26('0x9e')];switch(_0x3e53a9[_0x0e26('0x9e')]){case _0x0e26('0x9f'):_0x3f0f2f=squel[_0x0e26('0xa0')]()['into'](_0x0e26('0xa1'))[_0x0e26('0xa2')](['phone',_0x0e26('0xa3'),_0x0e26('0xa4'),_0x0e26('0xa5'),'VoiceQueueId',_0x0e26('0x60'),_0x0e26('0x5e')],squel['select']()[_0x0e26('0x83')]('phone',_0x0e26('0xa6'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0xa3'))[_0x0e26('0x83')]('id',_0x0e26('0xa4'))[_0x0e26('0x83')](_0x5eaeca['CmListId'][_0x0e26('0x8a')](),'ListId')['field'](_0x53c6bf[_0x0e26('0x51')]['id'][_0x0e26('0x8a')](),'VoiceQueueId')[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0x60'))['field']('\x27'+_0x4226d7+'\x27','updatedAt')[_0x0e26('0x84')]('cm_contacts')['where'](_0x0e26('0xa7'))[_0x0e26('0x48')]('ListId\x20=\x20?',_0x5eaeca[_0x0e26('0xa8')][_0x0e26('0x8a')]())[_0x0e26('0x48')](_0x0e26('0xa9'))[_0x0e26('0x48')](_0x0e26('0xaa'),squel['select']()['field'](_0x0e26('0xab'))[_0x0e26('0x84')](_0x0e26('0xac'))[_0x0e26('0x48')](_0x0e26('0x88'),_0x53c6bf['params']['id'][_0x0e26('0x8a')]()))[_0x0e26('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e26('0x82')]()[_0x0e26('0x83')](_0x0e26('0xad'))[_0x0e26('0x84')](_0x0e26('0xa1'))[_0x0e26('0x48')](_0x0e26('0x88'),_0x53c6bf[_0x0e26('0x51')]['id'][_0x0e26('0x8a')]())))['toString']();break;case _0x0e26('0xae'):_0x3f0f2f=squel[_0x0e26('0xa0')]()[_0x0e26('0xaf')](_0x0e26('0xa1'))['fromQuery']([_0x0e26('0xa6'),'scheduledAt','ContactId',_0x0e26('0xa5'),'VoiceQueueId',_0x0e26('0x60'),_0x0e26('0x5e')],squel[_0x0e26('0x82')]()['field']('phone',_0x0e26('0xa6'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0xa3'))[_0x0e26('0x83')]('id',_0x0e26('0xa4'))['field'](_0x5eaeca['CmListId']['toString'](),_0x0e26('0xa5'))[_0x0e26('0x83')](_0x53c6bf[_0x0e26('0x51')]['id'][_0x0e26('0x8a')](),_0x0e26('0x68'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0x60'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0x5e'))[_0x0e26('0x84')](_0x0e26('0xb0'))['where']('deletedAt\x20IS\x20NULL')[_0x0e26('0x48')](_0x0e26('0xb1'),_0x5eaeca[_0x0e26('0xa8')][_0x0e26('0x8a')]())[_0x0e26('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x0e26('0x48')](_0x0e26('0xaa'),squel[_0x0e26('0x82')]()['field'](_0x0e26('0xad'))[_0x0e26('0x84')]('cm_hopper')[_0x0e26('0x48')](_0x0e26('0x88'),_0x53c6bf[_0x0e26('0x51')]['id']['toString']())))[_0x0e26('0x8a')]();break;default:_0x3f0f2f=squel[_0x0e26('0xa0')]()[_0x0e26('0xaf')](_0x0e26('0xa1'))['fromQuery']([_0x0e26('0xa6'),_0x0e26('0xa3'),_0x0e26('0xa4'),_0x0e26('0xa5'),_0x0e26('0x68'),_0x0e26('0x60'),_0x0e26('0x5e')],squel['select']()[_0x0e26('0x83')](_0x0e26('0xa6'),_0x0e26('0xa6'))['field']('\x27'+_0x4226d7+'\x27',_0x0e26('0xa3'))[_0x0e26('0x83')]('id','ContactId')['field'](_0x5eaeca[_0x0e26('0xa8')]['toString'](),_0x0e26('0xa5'))[_0x0e26('0x83')](_0x53c6bf[_0x0e26('0x51')]['id']['toString'](),_0x0e26('0x68'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0x60'))['field']('\x27'+_0x4226d7+'\x27',_0x0e26('0x5e'))[_0x0e26('0x84')](_0x0e26('0xb0'))[_0x0e26('0x48')]('deletedAt\x20IS\x20NULL')[_0x0e26('0x48')](_0x0e26('0xb1'),_0x5eaeca[_0x0e26('0xa8')][_0x0e26('0x8a')]())[_0x0e26('0x48')](_0x0e26('0xa9')))['toString']();}_0x5702e4['push'](db[_0x0e26('0x74')]['query'](_0x3f0f2f));}return BPromise['all'](_0x5702e4);}})['then'](function(){var _0x1b9af9=[];var _0xef279e=squel[_0x0e26('0xa0')]()[_0x0e26('0xaf')]('cm_hopper_additional_phones')[_0x0e26('0xa2')]([_0x0e26('0xb2'),'phone',_0x0e26('0xb3'),_0x0e26('0x60'),_0x0e26('0x5e')],squel[_0x0e26('0x82')]()['field'](_0x0e26('0xb4'))[_0x0e26('0x83')](_0x0e26('0xb5'))[_0x0e26('0x83')](_0x0e26('0xb6'))[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27','createdAt')[_0x0e26('0x83')]('\x27'+_0x4226d7+'\x27',_0x0e26('0x5e'))[_0x0e26('0x84')](_0x0e26('0xb7'),'ci')[_0x0e26('0x86')](_0x0e26('0xa1'),'h',_0x0e26('0xb8'))['where'](_0x0e26('0xb9'),_0x4226d7)[_0x0e26('0x48')](_0x0e26('0xba'),_0x0e26('0xbb')))[_0x0e26('0x8a')]();_0x1b9af9['push'](db[_0x0e26('0x74')][_0x0e26('0x3f')](_0xef279e));return BPromise[_0x0e26('0x97')](_0x1b9af9);})[_0x0e26('0x2b')](function(){return _0x2772d1;})['then'](respondWithResult(_0x10d5fe,null))[_0x0e26('0x50')](handleError(_0x10d5fe,null));};exports[_0x0e26('0xbc')]=function(_0x51e4b6,_0x42bb44,_0x1c5e46){return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x51e4b6[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x42bb44,null))[_0x0e26('0x2b')](function(_0x741f34){if(_0x741f34){return _0x741f34['removeLists'](_0x51e4b6['query'][_0x0e26('0x81')]);}})[_0x0e26('0x2b')](function(_0x4d581e){if(_0x4d581e){return db[_0x0e26('0x64')][_0x0e26('0x2c')]({'where':{'ListId':_0x51e4b6[_0x0e26('0x3f')][_0x0e26('0x81')],'VoiceQueueId':_0x51e4b6[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](function(){return _0x4d581e;});}})['then'](respondWithStatusCode(_0x42bb44,null))['catch'](handleError(_0x42bb44,null));};exports['getBlackLists']=function(_0x345d98,_0x2ff7a9,_0x1d2dd3){var _0x5077b3={};var _0x4827f8={};var _0x53916e;var _0xaf9018;return db[_0x0e26('0x3c')]['findOne']({'where':{'id':_0x345d98[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x2ff7a9,null))[_0x0e26('0x2b')](function(_0xfd511b){if(_0xfd511b){_0x53916e=_0xfd511b;_0x4827f8['model']=_['keys'](db['CmList'][_0x0e26('0x3d')]);_0x4827f8['query']=_[_0x0e26('0x5c')](_0x345d98[_0x0e26('0x3f')]);_0x4827f8[_0x0e26('0x40')]=_[_0x0e26('0x41')](_0x4827f8[_0x0e26('0x42')],_0x4827f8[_0x0e26('0x3f')]);_0x5077b3[_0x0e26('0x44')]=_[_0x0e26('0x41')](_0x4827f8[_0x0e26('0x42')],qs[_0x0e26('0x43')](_0x345d98['query'][_0x0e26('0x43')]));_0x5077b3['attributes']=_0x5077b3[_0x0e26('0x44')][_0x0e26('0x52')]?_0x5077b3[_0x0e26('0x44')]:_0x4827f8[_0x0e26('0x42')];_0x5077b3[_0x0e26('0x46')]=qs['sort'](_0x345d98[_0x0e26('0x3f')][_0x0e26('0x47')]);_0x5077b3[_0x0e26('0x48')]=qs[_0x0e26('0x40')](_[_0x0e26('0x49')](_0x345d98[_0x0e26('0x3f')],_0x4827f8['filters']));if(_0x345d98[_0x0e26('0x3f')][_0x0e26('0x30')]){_0x5077b3[_0x0e26('0x48')]=_[_0x0e26('0x4a')](_0x5077b3[_0x0e26('0x48')],{'$or':_[_0x0e26('0x32')](_0x5077b3[_0x0e26('0x44')],function(_0x5b111d){var _0x8a1681={};_0x8a1681[_0x5b111d]={'$like':'%'+_0x345d98[_0x0e26('0x3f')][_0x0e26('0x30')]+'%'};return _0x8a1681;})});}_0x5077b3=_[_0x0e26('0x4a')]({},_0x5077b3,_0x345d98[_0x0e26('0x4b')]);return _0x53916e[_0x0e26('0xbd')](_0x5077b3);}})[_0x0e26('0x2b')](function(_0x5a26e8){if(_0x5a26e8){_0xaf9018=_0x5a26e8['length'];if(!_0x345d98[_0x0e26('0x3f')][_0x0e26('0x45')](_0x0e26('0x65'))){_0x5077b3['limit']=qs[_0x0e26('0x24')](_0x345d98[_0x0e26('0x3f')][_0x0e26('0x24')]);_0x5077b3[_0x0e26('0x22')]=qs[_0x0e26('0x22')](_0x345d98[_0x0e26('0x3f')][_0x0e26('0x22')]);}return _0x53916e[_0x0e26('0xbd')](_0x5077b3);}})[_0x0e26('0x2b')](function(_0x2303f6){if(_0x2303f6){return _0x2303f6?{'count':_0xaf9018,'rows':_0x2303f6}:null;}})['then'](respondWithResult(_0x2ff7a9,null))['catch'](handleError(_0x2ff7a9,null));};exports[_0x0e26('0xbe')]=function(_0x36b9b2,_0x3e9a06,_0x438ab1){var _0x2236d8,_0x540002;return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x36b9b2[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x3e9a06,null))[_0x0e26('0x2b')](function(_0x3f05a1){if(_0x3f05a1){_0x540002=_0x3f05a1;return _0x3f05a1['addBlackLists'](_0x36b9b2[_0x0e26('0x5f')]['ids'],_[_0x0e26('0x5d')](_0x36b9b2[_0x0e26('0x5f')],[_0x0e26('0x81'),'id'])||{});}return null;})['spread'](function(_0x883117){var _0x41d5ea;_0x2236d8=_0x883117||[];var _0x2cdc8d=[];if(_0x883117){for(var _0x1478a0=0x0;_0x1478a0<_0x883117[_0x0e26('0x52')];_0x1478a0+=0x1){var _0x1e8426=_0x883117[_0x1478a0][_0x0e26('0x2d')]({'plain':!![]});_0x41d5ea=squel['insert']()[_0x0e26('0xaf')](_0x0e26('0xbf'))[_0x0e26('0xa2')]([_0x0e26('0xa6'),'ContactId',_0x0e26('0xa5'),'VoiceQueueId',_0x0e26('0x60'),_0x0e26('0x5e')],squel[_0x0e26('0x82')]()[_0x0e26('0x83')](_0x0e26('0xa6'),_0x0e26('0xa6'))[_0x0e26('0x83')]('id',_0x0e26('0xa4'))[_0x0e26('0x83')](_0x1e8426['CmListId']['toString'](),_0x0e26('0xa5'))[_0x0e26('0x83')](_0x36b9b2[_0x0e26('0x51')]['id']['toString'](),_0x0e26('0x68'))[_0x0e26('0x83')](_0x0e26('0xc0'),'createdAt')[_0x0e26('0x83')](_0x0e26('0xc0'),_0x0e26('0x5e'))[_0x0e26('0x84')](_0x0e26('0xb0'))[_0x0e26('0x48')](_0x0e26('0xa7'))['where']('ListId\x20=\x20?',_0x1e8426['CmListId']['toString']())[_0x0e26('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0x0e26('0x8a')]();_0x2cdc8d[_0x0e26('0x89')](db['sequelize'][_0x0e26('0x3f')](_0x41d5ea));}return BPromise['all'](_0x2cdc8d);}})['then'](function(){return _0x2236d8;})[_0x0e26('0x2b')](respondWithResult(_0x3e9a06,null))[_0x0e26('0x50')](handleError(_0x3e9a06,null));};exports['removeBlackLists']=function(_0x1296f0,_0x469b2c,_0x5e32e6){return db[_0x0e26('0x3c')][_0x0e26('0x35')]({'where':{'id':_0x1296f0[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](handleEntityNotFound(_0x469b2c,null))[_0x0e26('0x2b')](function(_0x5f373e){if(_0x5f373e){return _0x5f373e[_0x0e26('0xc1')](_0x1296f0[_0x0e26('0x3f')][_0x0e26('0x81')]);}})[_0x0e26('0x2b')](function(_0x3ce16f){if(_0x3ce16f){return db[_0x0e26('0x6a')][_0x0e26('0x2c')]({'where':{'ListId':_0x1296f0[_0x0e26('0x3f')]['ids'],'VoiceQueueId':_0x1296f0[_0x0e26('0x51')]['id']}})[_0x0e26('0x2b')](function(){return _0x3ce16f;});}})['then'](respondWithStatusCode(_0x469b2c,null))[_0x0e26('0x50')](handleError(_0x469b2c,null));};
\ No newline at end of file
index 9b210d9..274bd5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd2=['emit','hook','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xedd2,0x87));var _0x2edd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xedd2[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x2edd('0x0'));var VoiceQueue=require(_0x2edd('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2edd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2edd('0x3'),'afterDestroy':_0x2edd('0x4')};function emitEvent(_0x3edafd){return function(_0x3e9ded,_0x12623c,_0x3fb5ad){VoiceQueueEvents[_0x2edd('0x5')](_0x3edafd+':'+_0x3e9ded['id'],_0x3e9ded);VoiceQueueEvents['emit'](_0x3edafd,_0x3e9ded);_0x3fb5ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x2edd('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0x5a09=['../../mysqldb','VoiceQueue','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x950020,_0x3fb2ca){var _0x24fb56=function(_0x1d346c){while(--_0x1d346c){_0x950020['push'](_0x950020['shift']());}};_0x24fb56(++_0x3fb2ca);}(_0x5a09,0x97));var _0x95a0=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x5a09[_0x1b1e76];return _0x3d743a;};'use strict';var EventEmitter=require(_0x95a0('0x0'));var VoiceQueue=require(_0x95a0('0x1'))['db'][_0x95a0('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x95a0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa65b6f){return function(_0x4ef92e,_0x58276b,_0x244b00){VoiceQueueEvents['emit'](_0xa65b6f+':'+_0x4ef92e['id'],_0x4ef92e);VoiceQueueEvents[_0x95a0('0x4')](_0xa65b6f,_0x4ef92e);_0x244b00(null);};}for(var e in events){if(events[_0x95a0('0x5')](e)){var event=events[e];VoiceQueue[_0x95a0('0x6')](e,emitEvent(event));}}module[_0x95a0('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 1e16ee1..1736a7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x188d8a,_0x16f49b){var _0x53f865=function(_0x3a9a22){while(--_0x3a9a22){_0x188d8a['push'](_0x188d8a['shift']());}};_0x53f865(++_0x16f49b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x55ca,0x126));var _0xa55c=function(_0x55c76f,_0x13b7f4){_0x55c76f=_0x55c76f-0x0;var _0x1571ff=_0x55ca[_0x55c76f];return _0x1571ff;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d6292e2..8e20449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80a0=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','lodash','moment','bluebird'];(function(_0xab4030,_0x3661fc){var _0x1c3cad=function(_0x1db28d){while(--_0x1db28d){_0xab4030['push'](_0xab4030['shift']());}};_0x1c3cad(++_0x3661fc);}(_0x80a0,0x1a1));var _0x080a=function(_0x9c3b6b,_0x2594d2){_0x9c3b6b=_0x9c3b6b-0x0;var _0x3f00ac=_0x80a0[_0x9c3b6b];return _0x3f00ac;};'use strict';var _=require(_0x080a('0x0'));var util=require('util');var moment=require(_0x080a('0x1'));var BPromise=require(_0x080a('0x2'));var rs=require(_0x080a('0x3'));var fs=require('fs');var Redis=require(_0x080a('0x4'));var db=require(_0x080a('0x5'))['db'];var utils=require(_0x080a('0x6'));var logger=require('../../config/logger')(_0x080a('0x7'));var config=require(_0x080a('0x8'));var jayson=require(_0x080a('0x9'));var client=jayson[_0x080a('0xa')][_0x080a('0xb')]({'port':0x232a});config[_0x080a('0xc')]=_[_0x080a('0xd')](config[_0x080a('0xc')],{'host':_0x080a('0xe'),'port':0x18eb});var socket=require(_0x080a('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x080a('0x10')](socket);function respondWithRpcPromise(_0x1ebf54,_0x4a2ccb,_0xe703f5){return new BPromise(function(_0x271dd9,_0x117b13){return client[_0x080a('0x11')](_0x1ebf54,_0xe703f5)[_0x080a('0x12')](function(_0x1908ce){logger['info'](_0x080a('0x13'),_0x4a2ccb,_0x080a('0x14'));logger[_0x080a('0x15')](_0x080a('0x16'),_0x4a2ccb,'request\x20sent',JSON[_0x080a('0x17')](_0x1908ce));if(_0x1908ce[_0x080a('0x18')]){if(_0x1908ce[_0x080a('0x18')][_0x080a('0x19')]===0x1f4){logger[_0x080a('0x18')](_0x080a('0x13'),_0x4a2ccb,_0x1908ce[_0x080a('0x18')][_0x080a('0x1a')]);return _0x117b13(_0x1908ce[_0x080a('0x18')][_0x080a('0x1a')]);}logger[_0x080a('0x18')](_0x080a('0x13'),_0x4a2ccb,_0x1908ce[_0x080a('0x18')][_0x080a('0x1a')]);return _0x271dd9(_0x1908ce[_0x080a('0x18')]['message']);}else{logger[_0x080a('0x1b')](_0x080a('0x13'),_0x4a2ccb,'request\x20sent');_0x271dd9(_0x1908ce['result'][_0x080a('0x1a')]);}})[_0x080a('0x1c')](function(_0x2a652c){logger[_0x080a('0x18')](_0x080a('0x13'),_0x4a2ccb,_0x2a652c);_0x117b13(_0x2a652c);});});}exports[_0x080a('0x1d')]=function(_0x239620){var _0x323785=this;return new Promise(function(_0x1a226b,_0x31a697){return db[_0x080a('0x1e')][_0x080a('0x1f')]({'raw':_0x239620[_0x080a('0x20')]?_0x239620[_0x080a('0x20')][_0x080a('0x21')]===undefined?!![]:![]:!![],'where':_0x239620[_0x080a('0x20')]?_0x239620[_0x080a('0x20')][_0x080a('0x22')]||null:null,'attributes':_0x239620[_0x080a('0x20')]?_0x239620['options'][_0x080a('0x23')]||null:null,'limit':_0x239620['options']?_0x239620[_0x080a('0x20')][_0x080a('0x24')]||null:null,'include':_0x239620[_0x080a('0x20')]?_0x239620[_0x080a('0x20')]['include']?_[_0x080a('0x25')](_0x239620[_0x080a('0x20')][_0x080a('0x26')],function(_0x3ba712){return{'model':db[_0x3ba712[_0x080a('0x27')]],'as':_0x3ba712['as'],'attributes':_0x3ba712['attributes'],'include':_0x3ba712['include']?_[_0x080a('0x25')](_0x3ba712[_0x080a('0x26')],function(_0x342711){return{'model':db[_0x342711[_0x080a('0x27')]],'as':_0x342711['as'],'attributes':_0x342711[_0x080a('0x23')],'include':_0x342711['include']?_['map'](_0x342711['include'],function(_0x8f642d){return{'model':db[_0x8f642d[_0x080a('0x27')]],'as':_0x8f642d['as'],'attributes':_0x8f642d[_0x080a('0x23')]};}):[]};}):[]};}):[]:[]})[_0x080a('0x12')](function(_0x2aa333){logger[_0x080a('0x1b')]('GetVoiceQueue',_0x239620);logger[_0x080a('0x15')]('GetVoiceQueue',_0x239620,JSON[_0x080a('0x17')](_0x2aa333));_0x1a226b(_0x2aa333);})['catch'](function(_0x1c4d9c){logger[_0x080a('0x18')](_0x080a('0x1d'),_0x1c4d9c[_0x080a('0x1a')],_0x239620);_0x31a697(_0x323785[_0x080a('0x18')](0x1f4,_0x1c4d9c['message']));});});};exports[_0x080a('0x28')]=function(_0x5c2a46){var _0x810d5b=this;return new Promise(function(_0x36b0e4,_0x38901b){return db['VoiceQueue'][_0x080a('0x29')]({'raw':_0x5c2a46[_0x080a('0x20')]?_0x5c2a46['options'][_0x080a('0x21')]===undefined?!![]:![]:!![],'where':_0x5c2a46['options']?_0x5c2a46[_0x080a('0x20')][_0x080a('0x22')]||null:null,'attributes':_0x5c2a46[_0x080a('0x20')]?_0x5c2a46[_0x080a('0x20')]['attributes']||null:null,'include':_0x5c2a46[_0x080a('0x20')]?_0x5c2a46[_0x080a('0x20')][_0x080a('0x26')]?_['map'](_0x5c2a46[_0x080a('0x20')]['include'],function(_0x73a1b5){return{'model':db[_0x73a1b5[_0x080a('0x27')]],'as':_0x73a1b5['as'],'attributes':_0x73a1b5[_0x080a('0x23')],'include':_0x73a1b5[_0x080a('0x26')]?_[_0x080a('0x25')](_0x73a1b5[_0x080a('0x26')],function(_0x4be4ac){return{'model':db[_0x4be4ac[_0x080a('0x27')]],'as':_0x4be4ac['as'],'attributes':_0x4be4ac['attributes'],'include':_0x4be4ac['include']?_['map'](_0x4be4ac[_0x080a('0x26')],function(_0x34f210){return{'model':db[_0x34f210['model']],'as':_0x34f210['as'],'attributes':_0x34f210['attributes']};}):[]};}):[]};}):[]:[]})[_0x080a('0x12')](function(_0x75bd8e){logger[_0x080a('0x1b')]('ShowVoiceQueue',_0x5c2a46);logger[_0x080a('0x15')](_0x080a('0x28'),_0x5c2a46,JSON['stringify'](_0x75bd8e));_0x36b0e4(_0x75bd8e);})[_0x080a('0x1c')](function(_0x3725ae){logger['error']('ShowVoiceQueue',_0x3725ae[_0x080a('0x1a')],_0x5c2a46);_0x38901b(_0x810d5b[_0x080a('0x18')](0x1f4,_0x3725ae[_0x080a('0x1a')]));});});};
\ No newline at end of file
+var _0xa0f9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','options','where','limit','include','map','model','attributes','GetVoiceQueue','ShowVoiceQueue','raw','lodash','util','moment'];(function(_0x4f1d73,_0x474569){var _0x3fb032=function(_0x5106a4){while(--_0x5106a4){_0x4f1d73['push'](_0x4f1d73['shift']());}};_0x3fb032(++_0x474569);}(_0xa0f9,0x197));var _0x9a0f=function(_0x48f80a,_0x3bb5d4){_0x48f80a=_0x48f80a-0x0;var _0x1327fb=_0xa0f9[_0x48f80a];return _0x1327fb;};'use strict';var _=require(_0x9a0f('0x0'));var util=require(_0x9a0f('0x1'));var moment=require(_0x9a0f('0x2'));var BPromise=require(_0x9a0f('0x3'));var rs=require(_0x9a0f('0x4'));var fs=require('fs');var Redis=require(_0x9a0f('0x5'));var db=require(_0x9a0f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a0f('0x7'))(_0x9a0f('0x8'));var config=require(_0x9a0f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9a0f('0xa')][_0x9a0f('0xb')]({'port':0x232a});config['redis']=_[_0x9a0f('0xc')](config[_0x9a0f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a0f('0xe'))(new Redis(config[_0x9a0f('0xd')]));require(_0x9a0f('0xf'))[_0x9a0f('0x10')](socket);function respondWithRpcPromise(_0x360acc,_0x4f41e8,_0x13cf9f){return new BPromise(function(_0x4b8110,_0x2c1b3a){return client[_0x9a0f('0x11')](_0x360acc,_0x13cf9f)[_0x9a0f('0x12')](function(_0xa4dd55){logger[_0x9a0f('0x13')](_0x9a0f('0x14'),_0x4f41e8,_0x9a0f('0x15'));logger[_0x9a0f('0x16')](_0x9a0f('0x17'),_0x4f41e8,'request\x20sent',JSON[_0x9a0f('0x18')](_0xa4dd55));if(_0xa4dd55[_0x9a0f('0x19')]){if(_0xa4dd55[_0x9a0f('0x19')][_0x9a0f('0x1a')]===0x1f4){logger[_0x9a0f('0x19')](_0x9a0f('0x14'),_0x4f41e8,_0xa4dd55[_0x9a0f('0x19')][_0x9a0f('0x1b')]);return _0x2c1b3a(_0xa4dd55[_0x9a0f('0x19')][_0x9a0f('0x1b')]);}logger['error'](_0x9a0f('0x14'),_0x4f41e8,_0xa4dd55[_0x9a0f('0x19')][_0x9a0f('0x1b')]);return _0x4b8110(_0xa4dd55[_0x9a0f('0x19')][_0x9a0f('0x1b')]);}else{logger[_0x9a0f('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x4f41e8,_0x9a0f('0x15'));_0x4b8110(_0xa4dd55[_0x9a0f('0x1c')][_0x9a0f('0x1b')]);}})[_0x9a0f('0x1d')](function(_0x36c720){logger[_0x9a0f('0x19')](_0x9a0f('0x14'),_0x4f41e8,_0x36c720);_0x2c1b3a(_0x36c720);});});}exports['GetVoiceQueue']=function(_0x461190){var _0x11d278=this;return new Promise(function(_0x405291,_0x164b9f){return db[_0x9a0f('0x1e')]['findAll']({'raw':_0x461190['options']?_0x461190[_0x9a0f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x461190[_0x9a0f('0x1f')]?_0x461190[_0x9a0f('0x1f')][_0x9a0f('0x20')]||null:null,'attributes':_0x461190[_0x9a0f('0x1f')]?_0x461190[_0x9a0f('0x1f')]['attributes']||null:null,'limit':_0x461190[_0x9a0f('0x1f')]?_0x461190[_0x9a0f('0x1f')][_0x9a0f('0x21')]||null:null,'include':_0x461190[_0x9a0f('0x1f')]?_0x461190[_0x9a0f('0x1f')][_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x461190[_0x9a0f('0x1f')][_0x9a0f('0x22')],function(_0x55e8bb){return{'model':db[_0x55e8bb[_0x9a0f('0x24')]],'as':_0x55e8bb['as'],'attributes':_0x55e8bb[_0x9a0f('0x25')],'include':_0x55e8bb[_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x55e8bb[_0x9a0f('0x22')],function(_0x5dc607){return{'model':db[_0x5dc607[_0x9a0f('0x24')]],'as':_0x5dc607['as'],'attributes':_0x5dc607['attributes'],'include':_0x5dc607[_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x5dc607[_0x9a0f('0x22')],function(_0x53051e){return{'model':db[_0x53051e[_0x9a0f('0x24')]],'as':_0x53051e['as'],'attributes':_0x53051e[_0x9a0f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9a0f('0x12')](function(_0x134e3c){logger[_0x9a0f('0x13')](_0x9a0f('0x26'),_0x461190);logger[_0x9a0f('0x16')]('GetVoiceQueue',_0x461190,JSON[_0x9a0f('0x18')](_0x134e3c));_0x405291(_0x134e3c);})[_0x9a0f('0x1d')](function(_0x17abe8){logger['error'](_0x9a0f('0x26'),_0x17abe8['message'],_0x461190);_0x164b9f(_0x11d278[_0x9a0f('0x19')](0x1f4,_0x17abe8['message']));});});};exports[_0x9a0f('0x27')]=function(_0x26a7df){var _0x103b7f=this;return new Promise(function(_0x4f93e1,_0x1deec9){return db[_0x9a0f('0x1e')]['find']({'raw':_0x26a7df[_0x9a0f('0x1f')]?_0x26a7df[_0x9a0f('0x1f')][_0x9a0f('0x28')]===undefined?!![]:![]:!![],'where':_0x26a7df[_0x9a0f('0x1f')]?_0x26a7df['options']['where']||null:null,'attributes':_0x26a7df['options']?_0x26a7df[_0x9a0f('0x1f')][_0x9a0f('0x25')]||null:null,'include':_0x26a7df[_0x9a0f('0x1f')]?_0x26a7df[_0x9a0f('0x1f')][_0x9a0f('0x22')]?_['map'](_0x26a7df['options'][_0x9a0f('0x22')],function(_0x2f2b83){return{'model':db[_0x2f2b83['model']],'as':_0x2f2b83['as'],'attributes':_0x2f2b83[_0x9a0f('0x25')],'include':_0x2f2b83[_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x2f2b83[_0x9a0f('0x22')],function(_0x378c71){return{'model':db[_0x378c71['model']],'as':_0x378c71['as'],'attributes':_0x378c71['attributes'],'include':_0x378c71[_0x9a0f('0x22')]?_['map'](_0x378c71[_0x9a0f('0x22')],function(_0x13c76e){return{'model':db[_0x13c76e[_0x9a0f('0x24')]],'as':_0x13c76e['as'],'attributes':_0x13c76e[_0x9a0f('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d3bf3){logger[_0x9a0f('0x13')](_0x9a0f('0x27'),_0x26a7df);logger['debug']('ShowVoiceQueue',_0x26a7df,JSON['stringify'](_0x4d3bf3));_0x4f93e1(_0x4d3bf3);})['catch'](function(_0x23beb5){logger[_0x9a0f('0x19')](_0x9a0f('0x27'),_0x23beb5[_0x9a0f('0x1b')],_0x26a7df);_0x1deec9(_0x103b7f[_0x9a0f('0x19')](0x1f4,_0x23beb5[_0x9a0f('0x1b')]));});});};
\ No newline at end of file
index 3de1b36..2cbeacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2677=['save','update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x1385d3,_0x28c9e9){var _0x2a09be=function(_0x2063cf){while(--_0x2063cf){_0x1385d3['push'](_0x1385d3['shift']());}};_0x2a09be(++_0x28c9e9);}(_0x2677,0x195));var _0x7267=function(_0x2c4570,_0x21871d){_0x2c4570=_0x2c4570-0x0;var _0x26f4b0=_0x2677[_0x2c4570];return _0x26f4b0;};'use strict';var VoiceQueueEvents=require(_0x7267('0x0'));var events=[_0x7267('0x1'),'remove',_0x7267('0x2')];function createListener(_0x23a5e0,_0x40ad7d){return function(_0x2e8c56){_0x40ad7d[_0x7267('0x3')](_0x23a5e0,_0x2e8c56);};}function removeListener(_0x231bb3,_0x57e1aa){return function(){VoiceQueueEvents[_0x7267('0x4')](_0x231bb3,_0x57e1aa);};}exports[_0x7267('0x5')]=function(_0x689d5a){for(var _0xa4ae63=0x0,_0x1bdd73=events['length'];_0xa4ae63<_0x1bdd73;_0xa4ae63++){var _0x4a2a0e=events[_0xa4ae63];var _0x7c8b77=createListener(_0x7267('0x6')+_0x4a2a0e,_0x689d5a);VoiceQueueEvents['on'](_0x4a2a0e,_0x7c8b77);}};
\ No newline at end of file
+var _0x80e0=['register','length','voiceQueue:','update','emit','removeListener'];(function(_0x12097a,_0x4c9bb3){var _0x215617=function(_0x16b831){while(--_0x16b831){_0x12097a['push'](_0x12097a['shift']());}};_0x215617(++_0x4c9bb3);}(_0x80e0,0x189));var _0x080e=function(_0x50fa9a,_0x1da236){_0x50fa9a=_0x50fa9a-0x0;var _0x2bff39=_0x80e0[_0x50fa9a];return _0x2bff39;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save','remove',_0x080e('0x0')];function createListener(_0x518221,_0xf68cc6){return function(_0x21c861){_0xf68cc6[_0x080e('0x1')](_0x518221,_0x21c861);};}function removeListener(_0x47aeff,_0x52ca8e){return function(){VoiceQueueEvents[_0x080e('0x2')](_0x47aeff,_0x52ca8e);};}exports[_0x080e('0x3')]=function(_0x2b392d){for(var _0x327e83=0x0,_0x442bc1=events[_0x080e('0x4')];_0x327e83<_0x442bc1;_0x327e83++){var _0x307874=events[_0x327e83];var _0x57ff1e=createListener(_0x080e('0x5')+_0x307874,_0x2b392d);VoiceQueueEvents['on'](_0x307874,_0x57ff1e);}};
\ No newline at end of file
index b8a603b..4de096c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e15=['index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated'];(function(_0x59ddc1,_0x5df8c6){var _0x4fee27=function(_0x3bb570){while(--_0x3bb570){_0x59ddc1['push'](_0x59ddc1['shift']());}};_0x4fee27(++_0x5df8c6);}(_0x2e15,0x17a));var _0x52e1=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x2e15[_0x344adc];return _0x4014b2;};'use strict';var multer=require(_0x52e1('0x0'));var util=require(_0x52e1('0x1'));var path=require(_0x52e1('0x2'));var timeout=require(_0x52e1('0x3'));var express=require(_0x52e1('0x4'));var router=express[_0x52e1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x52e1('0x6'));var interaction=require(_0x52e1('0x7'));var config=require(_0x52e1('0x8'));var controller=require(_0x52e1('0x9'));router[_0x52e1('0xa')]('/',auth[_0x52e1('0xb')](),controller[_0x52e1('0xc')]);router[_0x52e1('0xa')](_0x52e1('0xd'),auth['isAuthenticated'](),controller[_0x52e1('0xe')]);router['get'](_0x52e1('0xf'),auth['isAuthenticated'](),controller[_0x52e1('0x10')]);router[_0x52e1('0xa')]('/:id',auth[_0x52e1('0xb')](),controller[_0x52e1('0x11')]);router[_0x52e1('0x12')]('/',auth[_0x52e1('0xb')](),controller[_0x52e1('0x13')]);router[_0x52e1('0x14')](_0x52e1('0x15'),auth[_0x52e1('0xb')](),controller[_0x52e1('0x16')]);router[_0x52e1('0x17')](_0x52e1('0x15'),auth['isAuthenticated'](),controller[_0x52e1('0x18')]);module[_0x52e1('0x19')]=router;
\ No newline at end of file
+var _0x2ed6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','getVoiceQueuesReport','/:id','show','post','create','put','isAuthenticated','delete','exports','util','path','connect-timeout'];(function(_0xb9fa7f,_0x41a9c9){var _0x58771d=function(_0x47e217){while(--_0x47e217){_0xb9fa7f['push'](_0xb9fa7f['shift']());}};_0x58771d(++_0x41a9c9);}(_0x2ed6,0x128));var _0x62ed=function(_0x5d1780,_0x4723c2){_0x5d1780=_0x5d1780-0x0;var _0x334833=_0x2ed6[_0x5d1780];return _0x334833;};'use strict';var multer=require('multer');var util=require(_0x62ed('0x0'));var path=require(_0x62ed('0x1'));var timeout=require(_0x62ed('0x2'));var express=require(_0x62ed('0x3'));var router=express[_0x62ed('0x4')]();var fs_extra=require(_0x62ed('0x5'));var auth=require(_0x62ed('0x6'));var interaction=require(_0x62ed('0x7'));var config=require(_0x62ed('0x8'));var controller=require(_0x62ed('0x9'));router[_0x62ed('0xa')]('/',auth['isAuthenticated'](),controller[_0x62ed('0xb')]);router['get'](_0x62ed('0xc'),auth['isAuthenticated'](),controller[_0x62ed('0xd')]);router['get']('/index',auth['isAuthenticated'](),controller[_0x62ed('0xe')]);router[_0x62ed('0xa')](_0x62ed('0xf'),auth['isAuthenticated'](),controller[_0x62ed('0x10')]);router[_0x62ed('0x11')]('/',auth['isAuthenticated'](),controller[_0x62ed('0x12')]);router[_0x62ed('0x13')](_0x62ed('0xf'),auth[_0x62ed('0x14')](),controller['update']);router[_0x62ed('0x15')](_0x62ed('0xf'),auth[_0x62ed('0x14')](),controller['destroy']);module[_0x62ed('0x16')]=router;
\ No newline at end of file
index 8139118..c202a2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c92=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5c92,0x15d));var _0x25c9=function(_0x1269d0,_0x377596){_0x1269d0=_0x1269d0-0x0;var _0x280188=_0x5c92[_0x1269d0];return _0x280188;};'use strict';var Sequelize=require(_0x25c9('0x0'));var moment=require('moment');module[_0x25c9('0x1')]={'type':{'type':Sequelize[_0x25c9('0x2')]},'uniqueid':{'type':Sequelize[_0x25c9('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x25c9('0x2')]},'queue':{'type':Sequelize[_0x25c9('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x25c9('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x25c9('0x3')],'set':function(_0x38aa87){var _0x175734=moment(_0x38aa87);var _0x7549c2=moment(this[_0x25c9('0x4')]('queuecallerjoinAt'))[_0x25c9('0x5')](_0x25c9('0x6'));var _0x37f458=_0x175734[_0x25c9('0x7')](_0x7549c2,_0x25c9('0x8'));this[_0x25c9('0x9')](_0x25c9('0xa'),_0x38aa87);this['setDataValue'](_0x25c9('0xb'),_0x37f458||null);}},'position':{'type':Sequelize[_0x25c9('0xc')]},'count':{'type':Sequelize[_0x25c9('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x25c9('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x25c9('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x25c9('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x25c9('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x25c9('0x2')],'comment':_0x25c9('0xe')},'originalposition':{'type':Sequelize[_0x25c9('0xc')]},'channel':{'type':Sequelize[_0x25c9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x25c9('0x2')]},'connectedlinename':{'type':Sequelize[_0x25c9('0x2')]},'accountcode':{'type':Sequelize[_0x25c9('0x2')]},'context':{'type':Sequelize[_0x25c9('0x2')]},'exten':{'type':Sequelize[_0x25c9('0x2')]},'priority':{'type':Sequelize[_0x25c9('0x2')]},'holdtime':{'type':Sequelize[_0x25c9('0xc')]},'mohtime':{'type':Sequelize[_0x25c9('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x25c9('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x25c9('0x2')]},'transfer':{'type':Sequelize[_0x25c9('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x25c9('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x25c9('0x2')]},'transferuniqueid':{'type':Sequelize[_0x25c9('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x25c9('0x2')]},'thirdDisposition':{'type':Sequelize[_0x25c9('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x25c9('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x25c9('0x2')]}};
\ No newline at end of file
+var _0x65c1=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','diff'];(function(_0x5c3bdc,_0x1b69b8){var _0x18ea5f=function(_0x5a173e){while(--_0x5a173e){_0x5c3bdc['push'](_0x5c3bdc['shift']());}};_0x18ea5f(++_0x1b69b8);}(_0x65c1,0x160));var _0x165c=function(_0x412818,_0xe8171a){_0x412818=_0x412818-0x0;var _0x2d40d1=_0x65c1[_0x412818];return _0x2d40d1;};'use strict';var Sequelize=require(_0x165c('0x0'));var moment=require(_0x165c('0x1'));module[_0x165c('0x2')]={'type':{'type':Sequelize[_0x165c('0x3')]},'uniqueid':{'type':Sequelize[_0x165c('0x3')]},'calleridnum':{'type':Sequelize[_0x165c('0x3')]},'calleridname':{'type':Sequelize[_0x165c('0x3')]},'queue':{'type':Sequelize[_0x165c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x165c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x165c('0x4')],'set':function(_0x2fc476){var _0x3a0259=moment(_0x2fc476);var _0x176a82=moment(this[_0x165c('0x5')]('queuecallerjoinAt'))[_0x165c('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x496ce2=_0x3a0259[_0x165c('0x7')](_0x176a82,'seconds');this[_0x165c('0x8')](_0x165c('0x9'),_0x2fc476);this['setDataValue'](_0x165c('0xa'),_0x496ce2||null);}},'position':{'type':Sequelize[_0x165c('0xb')]},'count':{'type':Sequelize[_0x165c('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x165c('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x165c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x165c('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x165c('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x165c('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x165c('0xd')},'originalposition':{'type':Sequelize[_0x165c('0xb')]},'channel':{'type':Sequelize[_0x165c('0x3')]},'connectedlinenum':{'type':Sequelize[_0x165c('0x3')]},'connectedlinename':{'type':Sequelize[_0x165c('0x3')]},'accountcode':{'type':Sequelize[_0x165c('0x3')]},'context':{'type':Sequelize[_0x165c('0x3')]},'exten':{'type':Sequelize[_0x165c('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x165c('0xb')]},'mohtime':{'type':Sequelize[_0x165c('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x165c('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x165c('0x3')],'comment':_0x165c('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x165c('0x3')]},'disposition':{'type':Sequelize[_0x165c('0x3')]},'secondDisposition':{'type':Sequelize[_0x165c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x165c('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x165c('0x3')]}};
\ No newline at end of file
index a8e1dfd..cd23f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d6=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','end','error','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x90d6,0x18b));var _0x690d=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x90d6[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x690d('0x0'));var rimraf=require(_0x690d('0x1'));var zipdir=require(_0x690d('0x2'));var jsonpatch=require(_0x690d('0x3'));var rp=require(_0x690d('0x4'));var moment=require(_0x690d('0x5'));var BPromise=require(_0x690d('0x6'));var Mustache=require('mustache');var util=require(_0x690d('0x7'));var path=require(_0x690d('0x8'));var sox=require(_0x690d('0x9'));var csv=require('to-csv');var ejs=require(_0x690d('0xa'));var fs=require('fs');var fs_extra=require(_0x690d('0xb'));var _=require(_0x690d('0xc'));var squel=require(_0x690d('0xd'));var crypto=require(_0x690d('0xe'));var jsforce=require(_0x690d('0xf'));var deskjs=require(_0x690d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x690d('0x11'));var Papa=require(_0x690d('0x12'));var Redis=require('ioredis');var authService=require(_0x690d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x690d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x690d('0x15'));var config=require(_0x690d('0x16'));var licenseUtil=require(_0x690d('0x17'));var db=require(_0x690d('0x18'))['db'];config[_0x690d('0x19')]=_['defaults'](config['redis'],{'host':_0x690d('0x1a'),'port':0x18eb});var socket=require(_0x690d('0x1b'))(new Redis(config['redis']));require(_0x690d('0x1c'))[_0x690d('0x1d')](socket);function respondWithStatusCode(_0x4cbd5e,_0xb14282){_0xb14282=_0xb14282||0xcc;return function(_0x305bba){if(_0x305bba){return _0x4cbd5e[_0x690d('0x1e')](_0xb14282);}return _0x4cbd5e[_0x690d('0x1f')](_0xb14282)['end']();};}function respondWithResult(_0x4c07fa,_0x318213){_0x318213=_0x318213||0xc8;return function(_0x17f302){if(_0x17f302){return _0x4c07fa[_0x690d('0x1f')](_0x318213)[_0x690d('0x20')](_0x17f302);}};}function respondWithFilteredResult(_0x1d6d47,_0x23c635){return function(_0x10bd1f){if(_0x10bd1f){var _0x2af2be=typeof _0x23c635[_0x690d('0x21')]==='undefined'&&typeof _0x23c635[_0x690d('0x22')]===_0x690d('0x23');var _0x25600b=_0x10bd1f[_0x690d('0x24')];var _0x37ea2e=_0x2af2be?0x0:_0x23c635[_0x690d('0x21')];var _0x5ac57d=_0x2af2be?_0x10bd1f[_0x690d('0x24')]:_0x23c635[_0x690d('0x21')]+_0x23c635['limit'];var _0x2c7097;if(_0x5ac57d>=_0x25600b){_0x5ac57d=_0x25600b;_0x2c7097=0xc8;}else{_0x2c7097=0xce;}_0x1d6d47[_0x690d('0x1f')](_0x2c7097);return _0x1d6d47[_0x690d('0x25')](_0x690d('0x26'),_0x37ea2e+'-'+_0x5ac57d+'/'+_0x25600b)[_0x690d('0x20')](_0x10bd1f);}return null;};}function patchUpdates(_0x4077c0){return function(_0xf8427e){try{jsonpatch[_0x690d('0x27')](_0xf8427e,_0x4077c0,!![]);}catch(_0x5b0fff){return BPromise['reject'](_0x5b0fff);}return _0xf8427e['save']();};}function saveUpdates(_0x249cc4,_0x1c73dd){return function(_0x15f3fe){if(_0x15f3fe){return _0x15f3fe[_0x690d('0x28')](_0x249cc4)[_0x690d('0x29')](function(_0x1b3f82){return _0x1b3f82;});}return null;};}function removeEntity(_0x5f7e80,_0x3f16b2){return function(_0x49f09e){if(_0x49f09e){return _0x49f09e[_0x690d('0x2a')]()['then'](function(){_0x5f7e80[_0x690d('0x1f')](0xcc)[_0x690d('0x2b')]();});}};}function handleEntityNotFound(_0x5e2e5e,_0x472d1c){return function(_0x1cb3f7){if(!_0x1cb3f7){_0x5e2e5e['sendStatus'](0x194);}return _0x1cb3f7;};}function handleError(_0x2ce977,_0x3872c1){_0x3872c1=_0x3872c1||0x1f4;return function(_0x232521){logger[_0x690d('0x2c')](_0x232521['stack']);if(_0x232521['name']){delete _0x232521['name'];}_0x2ce977[_0x690d('0x1f')](_0x3872c1)[_0x690d('0x2d')](_0x232521);};}exports[_0x690d('0x2e')]=function(_0xa1349a,_0x2d3409){var _0x312c96={},_0x34bf3a={},_0x153138={'count':0x0,'rows':[]};var _0x3c0bdf=_[_0x690d('0x2f')](db[_0x690d('0x30')][_0x690d('0x31')],function(_0x2ca054){return{'name':_0x2ca054[_0x690d('0x32')],'type':_0x2ca054[_0x690d('0x33')][_0x690d('0x34')]};});_0x34bf3a[_0x690d('0x35')]=_[_0x690d('0x2f')](_0x3c0bdf,_0x690d('0x36'));_0x34bf3a[_0x690d('0x37')]=_[_0x690d('0x38')](_0xa1349a['query']);_0x34bf3a[_0x690d('0x39')]=_['intersection'](_0x34bf3a[_0x690d('0x35')],_0x34bf3a[_0x690d('0x37')]);_0x312c96[_0x690d('0x3a')]=_[_0x690d('0x3b')](_0x34bf3a[_0x690d('0x35')],qs[_0x690d('0x3c')](_0xa1349a[_0x690d('0x37')][_0x690d('0x3c')]));_0x312c96[_0x690d('0x3a')]=_0x312c96[_0x690d('0x3a')][_0x690d('0x3d')]?_0x312c96[_0x690d('0x3a')]:_0x34bf3a[_0x690d('0x35')];if(!_0xa1349a['query'][_0x690d('0x3e')](_0x690d('0x3f'))){_0x312c96[_0x690d('0x22')]=qs[_0x690d('0x22')](_0xa1349a[_0x690d('0x37')][_0x690d('0x22')]);_0x312c96['offset']=qs[_0x690d('0x21')](_0xa1349a[_0x690d('0x37')][_0x690d('0x21')]);}_0x312c96[_0x690d('0x40')]=qs[_0x690d('0x41')](_0xa1349a['query'][_0x690d('0x41')]);_0x312c96[_0x690d('0x42')]=qs[_0x690d('0x39')](_[_0x690d('0x43')](_0xa1349a[_0x690d('0x37')],_0x34bf3a[_0x690d('0x39')]),_0x3c0bdf);if(_0xa1349a[_0x690d('0x37')]['filter']){_0x312c96['where']=_[_0x690d('0x44')](_0x312c96[_0x690d('0x42')],{'$or':_['map'](_0x3c0bdf,function(_0x4b3b80){if(_0x4b3b80[_0x690d('0x33')]!==_0x690d('0x45')){var _0x4d7ff4={};_0x4d7ff4[_0x4b3b80[_0x690d('0x36')]]={'$like':'%'+_0xa1349a[_0x690d('0x37')][_0x690d('0x46')]+'%'};return _0x4d7ff4;}})});}_0x312c96=_[_0x690d('0x44')]({},_0x312c96,_0xa1349a[_0x690d('0x47')]);var _0x4a7c00={'where':_0x312c96[_0x690d('0x42')]};return db['VoiceQueueReport'][_0x690d('0x24')](_0x4a7c00)['then'](function(_0x11fd02){_0x153138['count']=_0x11fd02;if(_0xa1349a['query'][_0x690d('0x48')]){_0x312c96[_0x690d('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x690d('0x4a')](_0x312c96);})[_0x690d('0x29')](function(_0x2c804b){_0x153138[_0x690d('0x4b')]=_0x2c804b;return _0x153138;})[_0x690d('0x29')](respondWithFilteredResult(_0x2d3409,_0x312c96))[_0x690d('0x4c')](handleError(_0x2d3409,null));};exports['show']=function(_0x1cc8a3,_0x5792c2){var _0x2be8a0={'raw':![],'where':{'id':_0x1cc8a3[_0x690d('0x4d')]['id']}},_0xb3eb84={};_0xb3eb84[_0x690d('0x35')]=_['keys'](db[_0x690d('0x30')][_0x690d('0x31')]);_0xb3eb84[_0x690d('0x37')]=_[_0x690d('0x38')](_0x1cc8a3[_0x690d('0x37')]);_0xb3eb84['filters']=_['intersection'](_0xb3eb84[_0x690d('0x35')],_0xb3eb84[_0x690d('0x37')]);_0x2be8a0['attributes']=_[_0x690d('0x3b')](_0xb3eb84[_0x690d('0x35')],qs[_0x690d('0x3c')](_0x1cc8a3[_0x690d('0x37')][_0x690d('0x3c')]));_0x2be8a0[_0x690d('0x3a')]=_0x2be8a0[_0x690d('0x3a')][_0x690d('0x3d')]?_0x2be8a0[_0x690d('0x3a')]:_0xb3eb84['model'];if(_0x1cc8a3[_0x690d('0x37')]['includeAll']){_0x2be8a0[_0x690d('0x49')]=[{'all':!![]}];}_0x2be8a0=_[_0x690d('0x44')]({},_0x2be8a0,_0x1cc8a3['options']);return db['VoiceQueueReport'][_0x690d('0x4e')](_0x2be8a0)[_0x690d('0x29')](handleEntityNotFound(_0x5792c2,null))[_0x690d('0x29')](respondWithResult(_0x5792c2,null))[_0x690d('0x4c')](handleError(_0x5792c2,null));};exports[_0x690d('0x4f')]=function(_0x2aacc6,_0x428141){return db[_0x690d('0x30')][_0x690d('0x4f')](_0x2aacc6[_0x690d('0x50')],{})[_0x690d('0x29')](respondWithResult(_0x428141,0xc9))['catch'](handleError(_0x428141,null));};exports[_0x690d('0x28')]=function(_0x3f80fd,_0x261d45){if(_0x3f80fd[_0x690d('0x50')]['id']){delete _0x3f80fd[_0x690d('0x50')]['id'];}return db[_0x690d('0x30')][_0x690d('0x4e')]({'where':{'id':_0x3f80fd['params']['id']}})[_0x690d('0x29')](handleEntityNotFound(_0x261d45,null))[_0x690d('0x29')](saveUpdates(_0x3f80fd['body'],null))[_0x690d('0x29')](respondWithResult(_0x261d45,null))[_0x690d('0x4c')](handleError(_0x261d45,null));};exports[_0x690d('0x2a')]=function(_0x14002d,_0x9160e8){return db[_0x690d('0x30')][_0x690d('0x4e')]({'where':{'id':_0x14002d[_0x690d('0x4d')]['id']}})[_0x690d('0x29')](handleEntityNotFound(_0x9160e8,null))[_0x690d('0x29')](removeEntity(_0x9160e8,null))[_0x690d('0x4c')](handleError(_0x9160e8,null));};exports[_0x690d('0x51')]=function(_0x4893bd,_0x48eca9){return db[_0x690d('0x30')][_0x690d('0x51')]()[_0x690d('0x29')](respondWithResult(_0x48eca9,null))[_0x690d('0x4c')](handleError(_0x48eca9,null));};exports[_0x690d('0x52')]=function(_0xfe208,_0x40c2e9){var _0x1111f2={},_0x31bc3a={},_0x3e77cb={'count':0x0,'rows':[]};_0x31bc3a[_0x690d('0x35')]=_[_0x690d('0x38')](db[_0x690d('0x30')]['rawAttributes']);_0x31bc3a[_0x690d('0x37')]=_[_0x690d('0x38')](_0xfe208[_0x690d('0x37')]);_0x31bc3a[_0x690d('0x39')]=_[_0x690d('0x3b')](_0x31bc3a['model'],_0x31bc3a[_0x690d('0x37')]);_0x1111f2[_0x690d('0x3a')]=_['intersection'](_0x31bc3a[_0x690d('0x35')],qs['fields'](_0xfe208[_0x690d('0x37')][_0x690d('0x3c')]));_0x1111f2['attributes']=_0x1111f2[_0x690d('0x3a')][_0x690d('0x3d')]?_0x1111f2[_0x690d('0x3a')]:_0x31bc3a[_0x690d('0x35')];if(!_0xfe208['query']['hasOwnProperty'](_0x690d('0x3f'))){_0x1111f2[_0x690d('0x22')]=qs['limit'](_0xfe208['query'][_0x690d('0x22')]);_0x1111f2['offset']=qs['offset'](_0xfe208['query'][_0x690d('0x21')]);}_0x1111f2['order']=qs[_0x690d('0x41')](_0xfe208['query'][_0x690d('0x41')]);_0x1111f2[_0x690d('0x42')]=qs[_0x690d('0x39')](_[_0x690d('0x43')](_0xfe208[_0x690d('0x37')],_0x31bc3a[_0x690d('0x39')]));if(_0xfe208[_0x690d('0x37')]['filter']){_0x1111f2[_0x690d('0x42')]=_[_0x690d('0x44')](_0x1111f2[_0x690d('0x42')],{'$or':_[_0x690d('0x2f')](_0x1111f2[_0x690d('0x3a')],function(_0x3f7fc1){var _0xfee82d={};_0xfee82d[_0x3f7fc1]={'$like':'%'+_0xfe208['query'][_0x690d('0x46')]+'%'};return _0xfee82d;})});}_0x1111f2=_['merge']({},_0x1111f2,_0xfe208['options']);var _0x404335={'where':_0x1111f2[_0x690d('0x42')]};return db[_0x690d('0x30')]['count'](_0x404335)[_0x690d('0x29')](function(_0x425e82){_0x3e77cb[_0x690d('0x24')]=_0x425e82;if(_0xfe208[_0x690d('0x37')][_0x690d('0x48')]){_0x1111f2['include']=[{'all':!![]}];}return db[_0x690d('0x30')][_0x690d('0x4a')](_0x1111f2);})[_0x690d('0x29')](function(_0x3da396){_0x3e77cb[_0x690d('0x4b')]=_0x3da396;return _0x3e77cb;})[_0x690d('0x29')](respondWithFilteredResult(_0x40c2e9,_0x1111f2,_0x690d('0x52')))[_0x690d('0x4c')](handleError(_0x40c2e9,null,_0x690d('0x52')));};
\ No newline at end of file
+var _0xe2a5=['reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','create','body','find','describe','getVoiceQueuesReport','order','include','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','apply'];(function(_0x2bbdc4,_0x2cb88e){var _0x482d0c=function(_0x4da8ce){while(--_0x4da8ce){_0x2bbdc4['push'](_0x2bbdc4['shift']());}};_0x482d0c(++_0x2cb88e);}(_0xe2a5,0x1bb));var _0x5e2a=function(_0x538875,_0x2d9eac){_0x538875=_0x538875-0x0;var _0x2dcd6d=_0xe2a5[_0x538875];return _0x2dcd6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e2a('0x0'));var jsonpatch=require(_0x5e2a('0x1'));var rp=require('request-promise');var moment=require(_0x5e2a('0x2'));var BPromise=require(_0x5e2a('0x3'));var Mustache=require(_0x5e2a('0x4'));var util=require(_0x5e2a('0x5'));var path=require('path');var sox=require(_0x5e2a('0x6'));var csv=require(_0x5e2a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e2a('0x8'));var crypto=require(_0x5e2a('0x9'));var jsforce=require(_0x5e2a('0xa'));var deskjs=require(_0x5e2a('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5e2a('0xc'));var Redis=require(_0x5e2a('0xd'));var authService=require(_0x5e2a('0xe'));var qs=require(_0x5e2a('0xf'));var as=require(_0x5e2a('0x10'));var hardwareService=require(_0x5e2a('0x11'));var logger=require(_0x5e2a('0x12'))('api');var utils=require(_0x5e2a('0x13'));var config=require(_0x5e2a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e2a('0x15'))['db'];config[_0x5e2a('0x16')]=_[_0x5e2a('0x17')](config['redis'],{'host':_0x5e2a('0x18'),'port':0x18eb});var socket=require(_0x5e2a('0x19'))(new Redis(config[_0x5e2a('0x16')]));require(_0x5e2a('0x1a'))[_0x5e2a('0x1b')](socket);function respondWithStatusCode(_0x1b309a,_0x27fa06){_0x27fa06=_0x27fa06||0xcc;return function(_0x546c1f){if(_0x546c1f){return _0x1b309a[_0x5e2a('0x1c')](_0x27fa06);}return _0x1b309a[_0x5e2a('0x1d')](_0x27fa06)[_0x5e2a('0x1e')]();};}function respondWithResult(_0x38c000,_0x2a8c4d){_0x2a8c4d=_0x2a8c4d||0xc8;return function(_0x1b616f){if(_0x1b616f){return _0x38c000['status'](_0x2a8c4d)[_0x5e2a('0x1f')](_0x1b616f);}};}function respondWithFilteredResult(_0x17a16d,_0x5e90b8){return function(_0x18aabe){if(_0x18aabe){var _0x8d29b9=typeof _0x5e90b8[_0x5e2a('0x20')]==='undefined'&&typeof _0x5e90b8[_0x5e2a('0x21')]===_0x5e2a('0x22');var _0x5a6cf4=_0x18aabe[_0x5e2a('0x23')];var _0x298897=_0x8d29b9?0x0:_0x5e90b8[_0x5e2a('0x20')];var _0x4f7003=_0x8d29b9?_0x18aabe[_0x5e2a('0x23')]:_0x5e90b8[_0x5e2a('0x20')]+_0x5e90b8[_0x5e2a('0x21')];var _0x232e0b;if(_0x4f7003>=_0x5a6cf4){_0x4f7003=_0x5a6cf4;_0x232e0b=0xc8;}else{_0x232e0b=0xce;}_0x17a16d[_0x5e2a('0x1d')](_0x232e0b);return _0x17a16d['set']('Content-Range',_0x298897+'-'+_0x4f7003+'/'+_0x5a6cf4)[_0x5e2a('0x1f')](_0x18aabe);}return null;};}function patchUpdates(_0x3ce570){return function(_0x4d47ae){try{jsonpatch[_0x5e2a('0x24')](_0x4d47ae,_0x3ce570,!![]);}catch(_0x3886d8){return BPromise[_0x5e2a('0x25')](_0x3886d8);}return _0x4d47ae[_0x5e2a('0x26')]();};}function saveUpdates(_0x2cb04f,_0x4027a8){return function(_0x38c0d2){if(_0x38c0d2){return _0x38c0d2[_0x5e2a('0x27')](_0x2cb04f)[_0x5e2a('0x28')](function(_0x32607c){return _0x32607c;});}return null;};}function removeEntity(_0x54c85a,_0x2c8656){return function(_0x3d9dc3){if(_0x3d9dc3){return _0x3d9dc3[_0x5e2a('0x29')]()['then'](function(){_0x54c85a['status'](0xcc)[_0x5e2a('0x1e')]();});}};}function handleEntityNotFound(_0x3307ff,_0x321b40){return function(_0x207c78){if(!_0x207c78){_0x3307ff[_0x5e2a('0x1c')](0x194);}return _0x207c78;};}function handleError(_0xec8cc2,_0x51012e){_0x51012e=_0x51012e||0x1f4;return function(_0x2858d0){logger['error'](_0x2858d0[_0x5e2a('0x2a')]);if(_0x2858d0[_0x5e2a('0x2b')]){delete _0x2858d0[_0x5e2a('0x2b')];}_0xec8cc2[_0x5e2a('0x1d')](_0x51012e)[_0x5e2a('0x2c')](_0x2858d0);};}exports[_0x5e2a('0x2d')]=function(_0x54e4c0,_0x5c1eec){var _0x482157={},_0x544fca={},_0x14087f={'count':0x0,'rows':[]};var _0x5e7566=_[_0x5e2a('0x2e')](db[_0x5e2a('0x2f')][_0x5e2a('0x30')],function(_0x5c5d6d){return{'name':_0x5c5d6d[_0x5e2a('0x31')],'type':_0x5c5d6d[_0x5e2a('0x32')]['key']};});_0x544fca[_0x5e2a('0x33')]=_['map'](_0x5e7566,_0x5e2a('0x2b'));_0x544fca['query']=_[_0x5e2a('0x34')](_0x54e4c0['query']);_0x544fca[_0x5e2a('0x35')]=_[_0x5e2a('0x36')](_0x544fca['model'],_0x544fca[_0x5e2a('0x37')]);_0x482157[_0x5e2a('0x38')]=_['intersection'](_0x544fca[_0x5e2a('0x33')],qs['fields'](_0x54e4c0[_0x5e2a('0x37')]['fields']));_0x482157[_0x5e2a('0x38')]=_0x482157[_0x5e2a('0x38')][_0x5e2a('0x39')]?_0x482157[_0x5e2a('0x38')]:_0x544fca[_0x5e2a('0x33')];if(!_0x54e4c0[_0x5e2a('0x37')][_0x5e2a('0x3a')](_0x5e2a('0x3b'))){_0x482157['limit']=qs['limit'](_0x54e4c0[_0x5e2a('0x37')]['limit']);_0x482157[_0x5e2a('0x20')]=qs[_0x5e2a('0x20')](_0x54e4c0['query'][_0x5e2a('0x20')]);}_0x482157['order']=qs[_0x5e2a('0x3c')](_0x54e4c0[_0x5e2a('0x37')][_0x5e2a('0x3c')]);_0x482157[_0x5e2a('0x3d')]=qs['filters'](_[_0x5e2a('0x3e')](_0x54e4c0['query'],_0x544fca['filters']),_0x5e7566);if(_0x54e4c0[_0x5e2a('0x37')][_0x5e2a('0x3f')]){_0x482157[_0x5e2a('0x3d')]=_[_0x5e2a('0x40')](_0x482157['where'],{'$or':_[_0x5e2a('0x2e')](_0x5e7566,function(_0x46db51){if(_0x46db51[_0x5e2a('0x32')]!==_0x5e2a('0x41')){var _0x5787ca={};_0x5787ca[_0x46db51[_0x5e2a('0x2b')]]={'$like':'%'+_0x54e4c0[_0x5e2a('0x37')][_0x5e2a('0x3f')]+'%'};return _0x5787ca;}})});}_0x482157=_[_0x5e2a('0x40')]({},_0x482157,_0x54e4c0[_0x5e2a('0x42')]);var _0x529218={'where':_0x482157[_0x5e2a('0x3d')]};return db[_0x5e2a('0x2f')][_0x5e2a('0x23')](_0x529218)[_0x5e2a('0x28')](function(_0x308ff7){_0x14087f[_0x5e2a('0x23')]=_0x308ff7;if(_0x54e4c0[_0x5e2a('0x37')][_0x5e2a('0x43')]){_0x482157['include']=[{'all':!![]}];}return db[_0x5e2a('0x2f')][_0x5e2a('0x44')](_0x482157);})['then'](function(_0x1b9000){_0x14087f['rows']=_0x1b9000;return _0x14087f;})[_0x5e2a('0x28')](respondWithFilteredResult(_0x5c1eec,_0x482157))[_0x5e2a('0x45')](handleError(_0x5c1eec,null));};exports[_0x5e2a('0x46')]=function(_0x9c7175,_0x2fbeca){var _0x2cf0f6={'raw':![],'where':{'id':_0x9c7175[_0x5e2a('0x47')]['id']}},_0x166072={};_0x166072[_0x5e2a('0x33')]=_[_0x5e2a('0x34')](db[_0x5e2a('0x2f')]['rawAttributes']);_0x166072[_0x5e2a('0x37')]=_[_0x5e2a('0x34')](_0x9c7175['query']);_0x166072['filters']=_[_0x5e2a('0x36')](_0x166072[_0x5e2a('0x33')],_0x166072['query']);_0x2cf0f6[_0x5e2a('0x38')]=_[_0x5e2a('0x36')](_0x166072['model'],qs[_0x5e2a('0x48')](_0x9c7175[_0x5e2a('0x37')]['fields']));_0x2cf0f6[_0x5e2a('0x38')]=_0x2cf0f6['attributes'][_0x5e2a('0x39')]?_0x2cf0f6['attributes']:_0x166072[_0x5e2a('0x33')];if(_0x9c7175[_0x5e2a('0x37')][_0x5e2a('0x43')]){_0x2cf0f6['include']=[{'all':!![]}];}_0x2cf0f6=_['merge']({},_0x2cf0f6,_0x9c7175[_0x5e2a('0x42')]);return db['VoiceQueueReport']['find'](_0x2cf0f6)[_0x5e2a('0x28')](handleEntityNotFound(_0x2fbeca,null))[_0x5e2a('0x28')](respondWithResult(_0x2fbeca,null))[_0x5e2a('0x45')](handleError(_0x2fbeca,null));};exports[_0x5e2a('0x49')]=function(_0x1db869,_0x142ae5){return db['VoiceQueueReport']['create'](_0x1db869[_0x5e2a('0x4a')],{})[_0x5e2a('0x28')](respondWithResult(_0x142ae5,0xc9))[_0x5e2a('0x45')](handleError(_0x142ae5,null));};exports['update']=function(_0x5be4c5,_0x1f8972){if(_0x5be4c5[_0x5e2a('0x4a')]['id']){delete _0x5be4c5['body']['id'];}return db['VoiceQueueReport'][_0x5e2a('0x4b')]({'where':{'id':_0x5be4c5[_0x5e2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f8972,null))[_0x5e2a('0x28')](saveUpdates(_0x5be4c5[_0x5e2a('0x4a')],null))['then'](respondWithResult(_0x1f8972,null))[_0x5e2a('0x45')](handleError(_0x1f8972,null));};exports['destroy']=function(_0x301528,_0x1e4f41){return db[_0x5e2a('0x2f')][_0x5e2a('0x4b')]({'where':{'id':_0x301528[_0x5e2a('0x47')]['id']}})[_0x5e2a('0x28')](handleEntityNotFound(_0x1e4f41,null))[_0x5e2a('0x28')](removeEntity(_0x1e4f41,null))['catch'](handleError(_0x1e4f41,null));};exports['describe']=function(_0x1cdf4f,_0x356e76){return db[_0x5e2a('0x2f')][_0x5e2a('0x4c')]()[_0x5e2a('0x28')](respondWithResult(_0x356e76,null))['catch'](handleError(_0x356e76,null));};exports[_0x5e2a('0x4d')]=function(_0x1f3609,_0x235598){var _0xeede70={},_0x28931c={},_0x2107ac={'count':0x0,'rows':[]};_0x28931c[_0x5e2a('0x33')]=_[_0x5e2a('0x34')](db[_0x5e2a('0x2f')]['rawAttributes']);_0x28931c['query']=_[_0x5e2a('0x34')](_0x1f3609[_0x5e2a('0x37')]);_0x28931c['filters']=_[_0x5e2a('0x36')](_0x28931c[_0x5e2a('0x33')],_0x28931c[_0x5e2a('0x37')]);_0xeede70[_0x5e2a('0x38')]=_['intersection'](_0x28931c[_0x5e2a('0x33')],qs[_0x5e2a('0x48')](_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x48')]));_0xeede70['attributes']=_0xeede70[_0x5e2a('0x38')][_0x5e2a('0x39')]?_0xeede70[_0x5e2a('0x38')]:_0x28931c['model'];if(!_0x1f3609['query'][_0x5e2a('0x3a')]('nolimit')){_0xeede70[_0x5e2a('0x21')]=qs['limit'](_0x1f3609[_0x5e2a('0x37')]['limit']);_0xeede70[_0x5e2a('0x20')]=qs[_0x5e2a('0x20')](_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x20')]);}_0xeede70[_0x5e2a('0x4e')]=qs['sort'](_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x3c')]);_0xeede70[_0x5e2a('0x3d')]=qs[_0x5e2a('0x35')](_[_0x5e2a('0x3e')](_0x1f3609[_0x5e2a('0x37')],_0x28931c['filters']));if(_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x3f')]){_0xeede70[_0x5e2a('0x3d')]=_['merge'](_0xeede70[_0x5e2a('0x3d')],{'$or':_['map'](_0xeede70['attributes'],function(_0x39f446){var _0x142b9f={};_0x142b9f[_0x39f446]={'$like':'%'+_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x3f')]+'%'};return _0x142b9f;})});}_0xeede70=_[_0x5e2a('0x40')]({},_0xeede70,_0x1f3609[_0x5e2a('0x42')]);var _0x5e16a6={'where':_0xeede70[_0x5e2a('0x3d')]};return db['VoiceQueueReport']['count'](_0x5e16a6)[_0x5e2a('0x28')](function(_0x332b08){_0x2107ac[_0x5e2a('0x23')]=_0x332b08;if(_0x1f3609[_0x5e2a('0x37')][_0x5e2a('0x43')]){_0xeede70[_0x5e2a('0x4f')]=[{'all':!![]}];}return db[_0x5e2a('0x2f')][_0x5e2a('0x44')](_0xeede70);})[_0x5e2a('0x28')](function(_0x225c99){_0x2107ac['rows']=_0x225c99;return _0x2107ac;})[_0x5e2a('0x28')](respondWithFilteredResult(_0x235598,_0xeede70,'getVoiceQueuesReport'))[_0x5e2a('0x45')](handleError(_0x235598,null,_0x5e2a('0x4d')));};
\ No newline at end of file
index 7e71834..f28f8a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7622=['events','update','emit','hasOwnProperty','hook','exports'];(function(_0x4906ce,_0x162889){var _0x448645=function(_0x1d24c4){while(--_0x1d24c4){_0x4906ce['push'](_0x4906ce['shift']());}};_0x448645(++_0x162889);}(_0x7622,0x138));var _0x2762=function(_0x100c9b,_0x493480){_0x100c9b=_0x100c9b-0x0;var _0x518a98=_0x7622[_0x100c9b];return _0x518a98;};'use strict';var EventEmitter=require(_0x2762('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2762('0x1'),'afterDestroy':'remove'};function emitEvent(_0x56b07d){return function(_0x6d1f41,_0x355116,_0x4f9d0f){VoiceQueueReportEvents[_0x2762('0x2')](_0x56b07d+':'+_0x6d1f41['id'],_0x6d1f41);VoiceQueueReportEvents['emit'](_0x56b07d,_0x6d1f41);_0x4f9d0f(null);};}for(var e in events){if(events[_0x2762('0x3')](e)){var event=events[e];VoiceQueueReport[_0x2762('0x4')](e,emitEvent(event));}}module[_0x2762('0x5')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x3e4c=['hook','exports','events','../../mysqldb','VoiceQueueReport','save','remove','emit'];(function(_0x32d0c5,_0x339ced){var _0x99e80=function(_0x161659){while(--_0x161659){_0x32d0c5['push'](_0x32d0c5['shift']());}};_0x99e80(++_0x339ced);}(_0x3e4c,0xd2));var _0xc3e4=function(_0x2a132b,_0x43b7b4){_0x2a132b=_0x2a132b-0x0;var _0x8911e6=_0x3e4c[_0x2a132b];return _0x8911e6;};'use strict';var EventEmitter=require(_0xc3e4('0x0'));var VoiceQueueReport=require(_0xc3e4('0x1'))['db'][_0xc3e4('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e4('0x3'),'afterUpdate':'update','afterDestroy':_0xc3e4('0x4')};function emitEvent(_0x5c3d12){return function(_0x375eec,_0x1f105f,_0x550048){VoiceQueueReportEvents[_0xc3e4('0x5')](_0x5c3d12+':'+_0x375eec['id'],_0x375eec);VoiceQueueReportEvents[_0xc3e4('0x5')](_0x5c3d12,_0x375eec);_0x550048(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xc3e4('0x6')](e,emitEvent(event));}}module[_0xc3e4('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 2c25813..da22358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe23=['exports','report_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x2a7e1a,_0xd188fa){var _0x202852=function(_0x382afc){while(--_0x382afc){_0x2a7e1a['push'](_0x2a7e1a['shift']());}};_0x202852(++_0xd188fa);}(_0xfe23,0xfa));var _0x3fe2=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xfe23[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x3fe2('0x0'));var util=require(_0x3fe2('0x1'));var logger=require(_0x3fe2('0x2'))('api');var moment=require(_0x3fe2('0x3'));var BPromise=require(_0x3fe2('0x4'));var rp=require(_0x3fe2('0x5'));var fs=require('fs');var path=require(_0x3fe2('0x6'));var rimraf=require(_0x3fe2('0x7'));var config=require(_0x3fe2('0x8'));var attributes=require(_0x3fe2('0x9'));module[_0x3fe2('0xa')]=function(_0x1a6810,_0x17334d){return _0x1a6810['define']('VoiceQueueReport',attributes,{'tableName':_0x3fe2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3fe2('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x250b=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','calleridnum'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0x250b,0x136));var _0xb250=function(_0x10f3cc,_0x44b3bf){_0x10f3cc=_0x10f3cc-0x0;var _0x464ba1=_0x250b[_0x10f3cc];return _0x464ba1;};'use strict';var _=require(_0xb250('0x0'));var util=require(_0xb250('0x1'));var logger=require(_0xb250('0x2'))(_0xb250('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb250('0x4'));var rimraf=require(_0xb250('0x5'));var config=require(_0xb250('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xb250('0x7')]=function(_0x3bba7b,_0x2ebc56){return _0x3bba7b[_0xb250('0x8')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xb250('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 0e02159..822d03d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1b4=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info'];(function(_0x123fb6,_0x5a8622){var _0x4b8b44=function(_0x25b81c){while(--_0x25b81c){_0x123fb6['push'](_0x123fb6['shift']());}};_0x4b8b44(++_0x5a8622);}(_0xc1b4,0xd2));var _0x4c1b=function(_0x925b5b,_0x36fe77){_0x925b5b=_0x925b5b-0x0;var _0x107037=_0xc1b4[_0x925b5b];return _0x107037;};'use strict';var _=require(_0x4c1b('0x0'));var util=require('util');var moment=require(_0x4c1b('0x1'));var BPromise=require(_0x4c1b('0x2'));var rs=require(_0x4c1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c1b('0x4'))['db'];var utils=require(_0x4c1b('0x5'));var logger=require(_0x4c1b('0x6'))(_0x4c1b('0x7'));var config=require(_0x4c1b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4c1b('0x9')][_0x4c1b('0xa')]({'port':0x232a});config[_0x4c1b('0xb')]=_[_0x4c1b('0xc')](config[_0x4c1b('0xb')],{'host':_0x4c1b('0xd'),'port':0x18eb});var socket=require(_0x4c1b('0xe'))(new Redis(config['redis']));require(_0x4c1b('0xf'))[_0x4c1b('0x10')](socket);function respondWithRpcPromise(_0x33498f,_0x2fbc15,_0x29a422){return new BPromise(function(_0x19aa59,_0x57b28e){return client[_0x4c1b('0x11')](_0x33498f,_0x29a422)[_0x4c1b('0x12')](function(_0x3d4e9e){logger[_0x4c1b('0x13')](_0x4c1b('0x14'),_0x2fbc15,_0x4c1b('0x15'));logger['debug'](_0x4c1b('0x16'),_0x2fbc15,'request\x20sent',JSON['stringify'](_0x3d4e9e));if(_0x3d4e9e[_0x4c1b('0x17')]){if(_0x3d4e9e[_0x4c1b('0x17')][_0x4c1b('0x18')]===0x1f4){logger[_0x4c1b('0x17')](_0x4c1b('0x14'),_0x2fbc15,_0x3d4e9e['error'][_0x4c1b('0x19')]);return _0x57b28e(_0x3d4e9e[_0x4c1b('0x17')][_0x4c1b('0x19')]);}logger[_0x4c1b('0x17')](_0x4c1b('0x14'),_0x2fbc15,_0x3d4e9e[_0x4c1b('0x17')]['message']);return _0x19aa59(_0x3d4e9e[_0x4c1b('0x17')][_0x4c1b('0x19')]);}else{logger[_0x4c1b('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x2fbc15,_0x4c1b('0x15'));_0x19aa59(_0x3d4e9e[_0x4c1b('0x1a')]['message']);}})[_0x4c1b('0x1b')](function(_0x18b40e){logger[_0x4c1b('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x2fbc15,_0x18b40e);_0x57b28e(_0x18b40e);});});}exports[_0x4c1b('0x1c')]=function(_0x3ebd05){var _0x2a86a7=this;return new Promise(function(_0x3b1cf2,_0x2c2d64){return db[_0x4c1b('0x1d')][_0x4c1b('0x1e')]({'raw':_0x3ebd05['options']?_0x3ebd05[_0x4c1b('0x1f')][_0x4c1b('0x20')]===undefined?!![]:![]:!![],'where':_0x3ebd05['options']?_0x3ebd05[_0x4c1b('0x1f')][_0x4c1b('0x21')]||null:null,'attributes':_0x3ebd05[_0x4c1b('0x1f')]?_0x3ebd05['options'][_0x4c1b('0x22')]||null:null,'limit':_0x3ebd05[_0x4c1b('0x1f')]?_0x3ebd05[_0x4c1b('0x1f')][_0x4c1b('0x23')]||null:null,'include':_0x3ebd05['options']?_0x3ebd05[_0x4c1b('0x1f')][_0x4c1b('0x24')]?_[_0x4c1b('0x25')](_0x3ebd05[_0x4c1b('0x1f')][_0x4c1b('0x24')],function(_0x4d418a){return{'model':db[_0x4d418a[_0x4c1b('0x26')]],'as':_0x4d418a['as'],'attributes':_0x4d418a[_0x4c1b('0x22')],'include':_0x4d418a[_0x4c1b('0x24')]?_[_0x4c1b('0x25')](_0x4d418a[_0x4c1b('0x24')],function(_0x424c58){return{'model':db[_0x424c58[_0x4c1b('0x26')]],'as':_0x424c58['as'],'attributes':_0x424c58[_0x4c1b('0x22')],'include':_0x424c58[_0x4c1b('0x24')]?_[_0x4c1b('0x25')](_0x424c58['include'],function(_0x56ee98){return{'model':db[_0x56ee98[_0x4c1b('0x26')]],'as':_0x56ee98['as'],'attributes':_0x56ee98[_0x4c1b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4c1b('0x12')](function(_0x27dc8b){logger[_0x4c1b('0x13')](_0x4c1b('0x1c'),_0x3ebd05);logger[_0x4c1b('0x27')]('GetVoiceQueueReport',_0x3ebd05,JSON[_0x4c1b('0x28')](_0x27dc8b));_0x3b1cf2(_0x27dc8b);})[_0x4c1b('0x1b')](function(_0x3543e7){logger['error'](_0x4c1b('0x1c'),_0x3543e7[_0x4c1b('0x19')],_0x3ebd05);_0x2c2d64(_0x2a86a7['error'](0x1f4,_0x3543e7[_0x4c1b('0x19')]));});});};exports[_0x4c1b('0x29')]=function(_0x364dcb){var _0x5dc2fd=this;return new Promise(function(_0xc75cf7,_0x3aa60c){return db[_0x4c1b('0x1d')][_0x4c1b('0x2a')](_0x364dcb[_0x4c1b('0x2b')],{'raw':_0x364dcb[_0x4c1b('0x1f')]?_0x364dcb[_0x4c1b('0x1f')][_0x4c1b('0x20')]===undefined?!![]:![]:!![]})[_0x4c1b('0x12')](function(_0x5ab6c4){logger[_0x4c1b('0x13')](_0x4c1b('0x29'),_0x364dcb);logger[_0x4c1b('0x27')]('CreateVoiceQueueReport',_0x364dcb,JSON['stringify'](_0x5ab6c4));_0xc75cf7(_0x5ab6c4);})[_0x4c1b('0x1b')](function(_0x686be4){logger['error'](_0x4c1b('0x29'),_0x686be4[_0x4c1b('0x19')],_0x364dcb);_0x3aa60c(_0x5dc2fd['error'](0x1f4,_0x686be4['message']));});});};exports[_0x4c1b('0x2c')]=function(_0x14266c){var _0x34a525=this;return new Promise(function(_0x71800d,_0x266854){return db['VoiceQueueReport'][_0x4c1b('0x2d')](_0x14266c[_0x4c1b('0x2b')],{'raw':_0x14266c[_0x4c1b('0x1f')]?_0x14266c['options'][_0x4c1b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14266c[_0x4c1b('0x1f')]?_0x14266c[_0x4c1b('0x1f')][_0x4c1b('0x21')]||null:null,'attributes':_0x14266c[_0x4c1b('0x1f')]?_0x14266c[_0x4c1b('0x1f')][_0x4c1b('0x22')]||null:null,'limit':_0x14266c[_0x4c1b('0x1f')]?_0x14266c['options']['limit']||null:null})[_0x4c1b('0x12')](function(_0x2d4068){logger[_0x4c1b('0x13')]('UpdateVoiceQueueReport',_0x14266c);logger['debug'](_0x4c1b('0x2c'),_0x14266c,JSON[_0x4c1b('0x28')](_0x2d4068));_0x71800d(_0x2d4068);})[_0x4c1b('0x1b')](function(_0x5d4063){logger[_0x4c1b('0x17')](_0x4c1b('0x2c'),_0x5d4063[_0x4c1b('0x19')],_0x14266c);_0x266854(_0x34a525['error'](0x1f4,_0x5d4063[_0x4c1b('0x19')]));});});};
\ No newline at end of file
+var _0x7062=['map','model','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include'];(function(_0x47099f,_0x352fc4){var _0x239ad6=function(_0x4254c4){while(--_0x4254c4){_0x47099f['push'](_0x47099f['shift']());}};_0x239ad6(++_0x352fc4);}(_0x7062,0x1c1));var _0x2706=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7062[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2706('0x0'));var util=require(_0x2706('0x1'));var moment=require(_0x2706('0x2'));var BPromise=require('bluebird');var rs=require(_0x2706('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2706('0x4'));var logger=require(_0x2706('0x5'))(_0x2706('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2706('0x7')]['http']({'port':0x232a});config[_0x2706('0x8')]=_[_0x2706('0x9')](config[_0x2706('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2706('0xa'))(new Redis(config[_0x2706('0x8')]));require('./voiceQueueReport.socket')[_0x2706('0xb')](socket);function respondWithRpcPromise(_0x32ec7b,_0x55358b,_0x369132){return new BPromise(function(_0x5ba299,_0x3243b3){return client[_0x2706('0xc')](_0x32ec7b,_0x369132)[_0x2706('0xd')](function(_0x551434){logger[_0x2706('0xe')](_0x2706('0xf'),_0x55358b,_0x2706('0x10'));logger[_0x2706('0x11')](_0x2706('0x12'),_0x55358b,_0x2706('0x10'),JSON['stringify'](_0x551434));if(_0x551434[_0x2706('0x13')]){if(_0x551434[_0x2706('0x13')][_0x2706('0x14')]===0x1f4){logger[_0x2706('0x13')](_0x2706('0xf'),_0x55358b,_0x551434[_0x2706('0x13')][_0x2706('0x15')]);return _0x3243b3(_0x551434[_0x2706('0x13')]['message']);}logger[_0x2706('0x13')](_0x2706('0xf'),_0x55358b,_0x551434[_0x2706('0x13')][_0x2706('0x15')]);return _0x5ba299(_0x551434[_0x2706('0x13')][_0x2706('0x15')]);}else{logger[_0x2706('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x55358b,_0x2706('0x10'));_0x5ba299(_0x551434['result']['message']);}})[_0x2706('0x16')](function(_0x57e9b7){logger[_0x2706('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x55358b,_0x57e9b7);_0x3243b3(_0x57e9b7);});});}exports[_0x2706('0x17')]=function(_0x36cc6b){var _0x608caf=this;return new Promise(function(_0x2dd02e,_0x2fceb3){return db[_0x2706('0x18')][_0x2706('0x19')]({'raw':_0x36cc6b[_0x2706('0x1a')]?_0x36cc6b[_0x2706('0x1a')][_0x2706('0x1b')]===undefined?!![]:![]:!![],'where':_0x36cc6b[_0x2706('0x1a')]?_0x36cc6b[_0x2706('0x1a')][_0x2706('0x1c')]||null:null,'attributes':_0x36cc6b['options']?_0x36cc6b[_0x2706('0x1a')][_0x2706('0x1d')]||null:null,'limit':_0x36cc6b[_0x2706('0x1a')]?_0x36cc6b[_0x2706('0x1a')]['limit']||null:null,'include':_0x36cc6b[_0x2706('0x1a')]?_0x36cc6b[_0x2706('0x1a')]['include']?_['map'](_0x36cc6b[_0x2706('0x1a')]['include'],function(_0x10ac8a){return{'model':db[_0x10ac8a['model']],'as':_0x10ac8a['as'],'attributes':_0x10ac8a[_0x2706('0x1d')],'include':_0x10ac8a[_0x2706('0x1e')]?_[_0x2706('0x1f')](_0x10ac8a[_0x2706('0x1e')],function(_0x29aa18){return{'model':db[_0x29aa18[_0x2706('0x20')]],'as':_0x29aa18['as'],'attributes':_0x29aa18['attributes'],'include':_0x29aa18[_0x2706('0x1e')]?_['map'](_0x29aa18[_0x2706('0x1e')],function(_0x23917a){return{'model':db[_0x23917a[_0x2706('0x20')]],'as':_0x23917a['as'],'attributes':_0x23917a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a22d9){logger[_0x2706('0xe')](_0x2706('0x17'),_0x36cc6b);logger['debug']('GetVoiceQueueReport',_0x36cc6b,JSON[_0x2706('0x21')](_0x3a22d9));_0x2dd02e(_0x3a22d9);})[_0x2706('0x16')](function(_0x12d301){logger[_0x2706('0x13')](_0x2706('0x17'),_0x12d301['message'],_0x36cc6b);_0x2fceb3(_0x608caf[_0x2706('0x13')](0x1f4,_0x12d301[_0x2706('0x15')]));});});};exports[_0x2706('0x22')]=function(_0x1a8846){var _0x236fc3=this;return new Promise(function(_0x2bcfe2,_0xf308be){return db[_0x2706('0x18')][_0x2706('0x23')](_0x1a8846[_0x2706('0x24')],{'raw':_0x1a8846[_0x2706('0x1a')]?_0x1a8846[_0x2706('0x1a')][_0x2706('0x1b')]===undefined?!![]:![]:!![]})[_0x2706('0xd')](function(_0x4ebbba){logger[_0x2706('0xe')](_0x2706('0x22'),_0x1a8846);logger[_0x2706('0x11')](_0x2706('0x22'),_0x1a8846,JSON[_0x2706('0x21')](_0x4ebbba));_0x2bcfe2(_0x4ebbba);})[_0x2706('0x16')](function(_0x5e4449){logger[_0x2706('0x13')](_0x2706('0x22'),_0x5e4449[_0x2706('0x15')],_0x1a8846);_0xf308be(_0x236fc3[_0x2706('0x13')](0x1f4,_0x5e4449[_0x2706('0x15')]));});});};exports[_0x2706('0x25')]=function(_0x271c21){var _0x1aa741=this;return new Promise(function(_0x248cb9,_0x24f6ff){return db[_0x2706('0x18')][_0x2706('0x26')](_0x271c21[_0x2706('0x24')],{'raw':_0x271c21[_0x2706('0x1a')]?_0x271c21[_0x2706('0x1a')][_0x2706('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271c21[_0x2706('0x1a')]?_0x271c21['options'][_0x2706('0x1c')]||null:null,'attributes':_0x271c21['options']?_0x271c21[_0x2706('0x1a')][_0x2706('0x1d')]||null:null,'limit':_0x271c21[_0x2706('0x1a')]?_0x271c21[_0x2706('0x1a')][_0x2706('0x27')]||null:null})[_0x2706('0xd')](function(_0x496136){logger['info'](_0x2706('0x25'),_0x271c21);logger['debug'](_0x2706('0x25'),_0x271c21,JSON[_0x2706('0x21')](_0x496136));_0x248cb9(_0x496136);})['catch'](function(_0x2745af){logger[_0x2706('0x13')](_0x2706('0x25'),_0x2745af['message'],_0x271c21);_0x24f6ff(_0x1aa741['error'](0x1f4,_0x2745af[_0x2706('0x15')]));});});};
\ No newline at end of file
index 51e9328..ff588bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f72=['remove','update','register','length','save'];(function(_0x58fa92,_0x55c01b){var _0xa19a4=function(_0x31c1fc){while(--_0x31c1fc){_0x58fa92['push'](_0x58fa92['shift']());}};_0xa19a4(++_0x55c01b);}(_0x6f72,0xae));var _0x26f7=function(_0x31f25d,_0x26ff71){_0x31f25d=_0x31f25d-0x0;var _0x551e71=_0x6f72[_0x31f25d];return _0x551e71;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x26f7('0x0'),_0x26f7('0x1'),_0x26f7('0x2')];function createListener(_0x5d8f55,_0x26ed0f){return function(_0x34e1f6){_0x26ed0f['emit'](_0x5d8f55,_0x34e1f6);};}function removeListener(_0x4e19f5,_0x10b953){return function(){VoiceQueueReportEvents['removeListener'](_0x4e19f5,_0x10b953);};}exports[_0x26f7('0x3')]=function(_0x50719f){for(var _0x29465a=0x0,_0x529e3f=events[_0x26f7('0x4')];_0x29465a<_0x529e3f;_0x29465a++){var _0x21de0c=events[_0x29465a];var _0x4db9d0=createListener('voiceQueueReport:'+_0x21de0c,_0x50719f);VoiceQueueReportEvents['on'](_0x21de0c,_0x4db9d0);}};
\ No newline at end of file
+var _0x5c1f=['emit','register','length','./voiceQueueReport.events','remove','update'];(function(_0x17dcd1,_0x3b7ccb){var _0x12af77=function(_0x5c3bac){while(--_0x5c3bac){_0x17dcd1['push'](_0x17dcd1['shift']());}};_0x12af77(++_0x3b7ccb);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x5c1f[_0x1b1e76];return _0x3d743a;};'use strict';var VoiceQueueReportEvents=require(_0xf5c1('0x0'));var events=['save',_0xf5c1('0x1'),_0xf5c1('0x2')];function createListener(_0x5dc804,_0x245264){return function(_0xcc7e35){_0x245264[_0xf5c1('0x3')](_0x5dc804,_0xcc7e35);};}function removeListener(_0x51ea7a,_0x5c0515){return function(){VoiceQueueReportEvents['removeListener'](_0x51ea7a,_0x5c0515);};}exports[_0xf5c1('0x4')]=function(_0x3a7475){for(var _0x52e4cb=0x0,_0x34a073=events[_0xf5c1('0x5')];_0x52e4cb<_0x34a073;_0x52e4cb++){var _0x12128b=events[_0x52e4cb];var _0x40cad7=createListener('voiceQueueReport:'+_0x12128b,_0x3a7475);VoiceQueueReportEvents['on'](_0x12128b,_0x40cad7);}};
\ No newline at end of file
index 4b5ef5f..451a214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x31d03c,_0x158cef){var _0x420e61=function(_0x1ddac1){while(--_0x1ddac1){_0x31d03c['push'](_0x31d03c['shift']());}};_0x420e61(++_0x158cef);}(_0x34e8,0x12c));var _0x834e=function(_0x2605a9,_0x556581){_0x2605a9=_0x2605a9-0x0;var _0x469f3d=_0x34e8[_0x2605a9];return _0x469f3d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
+var _0x9997=['get','isAuthenticated','/:id','show','post','create','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x57f6c9,_0x5ad562){var _0x4240a6=function(_0x33a2e8){while(--_0x33a2e8){_0x57f6c9['push'](_0x57f6c9['shift']());}};_0x4240a6(++_0x5ad562);}(_0x9997,0x14b));var _0x7999=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0x9997[_0x3f2fea];return _0x69a4d5;};'use strict';var multer=require('multer');var util=require(_0x7999('0x0'));var path=require(_0x7999('0x1'));var timeout=require(_0x7999('0x2'));var express=require(_0x7999('0x3'));var router=express['Router']();var fs_extra=require(_0x7999('0x4'));var auth=require(_0x7999('0x5'));var interaction=require(_0x7999('0x6'));var config=require(_0x7999('0x7'));var controller=require(_0x7999('0x8'));router[_0x7999('0x9')]('/',auth[_0x7999('0xa')](),controller['index']);router['get'](_0x7999('0xb'),auth[_0x7999('0xa')](),controller[_0x7999('0xc')]);router[_0x7999('0xd')]('/',auth[_0x7999('0xa')](),controller[_0x7999('0xe')]);router['put']('/:id',auth[_0x7999('0xa')](),controller['update']);router[_0x7999('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7999('0x10')]=router;
\ No newline at end of file
index 5b08e99..02aaf9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x395b=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x4978cb,_0x5cc7f3){var _0x548528=function(_0x1e72a9){while(--_0x1e72a9){_0x4978cb['push'](_0x4978cb['shift']());}};_0x548528(++_0x5cc7f3);}(_0x395b,0xb2));var _0xb395=function(_0x262957,_0x34c699){_0x262957=_0x262957-0x0;var _0x27e221=_0x395b[_0x262957];return _0x27e221;};'use strict';var Sequelize=require(_0xb395('0x0'));var moment=require(_0xb395('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb395('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb395('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xb395('0x4')](_0xb395('0x5'))}};
\ No newline at end of file
+var _0xe3c3=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3c3,0x193));var _0x3e3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3c3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3e3c('0x0')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3e3c('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3e3c('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3e3c('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3e3c('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3e3c('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0x3e3c('0x2'))}};
\ No newline at end of file
index 9d1556d..5bcb037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe821=['rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','length','merge','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueuesLog'];(function(_0x5e5f29,_0x30af96){var _0x1889c0=function(_0x3e22cb){while(--_0x3e22cb){_0x5e5f29['push'](_0x5e5f29['shift']());}};_0x1889c0(++_0x30af96);}(_0xe821,0x140));var _0x1e82=function(_0x99a0ea,_0x53f88e){_0x99a0ea=_0x99a0ea-0x0;var _0x31cf29=_0xe821[_0x99a0ea];return _0x31cf29;};'use strict';var emlformat=require(_0x1e82('0x0'));var rimraf=require(_0x1e82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e82('0x2'));var rp=require(_0x1e82('0x3'));var moment=require(_0x1e82('0x4'));var BPromise=require(_0x1e82('0x5'));var Mustache=require(_0x1e82('0x6'));var util=require('util');var path=require(_0x1e82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1e82('0x8'));var fs=require('fs');var fs_extra=require(_0x1e82('0x9'));var _=require('lodash');var squel=require(_0x1e82('0xa'));var crypto=require(_0x1e82('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e82('0xc'));var toCsv=require(_0x1e82('0xd'));var querystring=require(_0x1e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x1e82('0xf'));var authService=require(_0x1e82('0x10'));var qs=require(_0x1e82('0x11'));var as=require(_0x1e82('0x12'));var hardwareService=require(_0x1e82('0x13'));var logger=require(_0x1e82('0x14'))(_0x1e82('0x15'));var utils=require('../../config/utils');var config=require(_0x1e82('0x16'));var licenseUtil=require(_0x1e82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25a4a4,_0x400a97){_0x400a97=_0x400a97||0xcc;return function(_0x464678){if(_0x464678){return _0x25a4a4[_0x1e82('0x18')](_0x400a97);}return _0x25a4a4[_0x1e82('0x19')](_0x400a97)['end']();};}function respondWithResult(_0x409bee,_0xe1b3c6){_0xe1b3c6=_0xe1b3c6||0xc8;return function(_0x327fb5){if(_0x327fb5){return _0x409bee[_0x1e82('0x19')](_0xe1b3c6)['json'](_0x327fb5);}};}function respondWithFilteredResult(_0x4c4db4,_0x1d2038){return function(_0x539492){if(_0x539492){var _0x5acdac=typeof _0x1d2038[_0x1e82('0x1a')]===_0x1e82('0x1b')&&typeof _0x1d2038[_0x1e82('0x1c')]===_0x1e82('0x1b');var _0x37a9fb=_0x539492[_0x1e82('0x1d')];var _0x16a953=_0x5acdac?0x0:_0x1d2038[_0x1e82('0x1a')];var _0x1d01a0=_0x5acdac?_0x539492[_0x1e82('0x1d')]:_0x1d2038['offset']+_0x1d2038[_0x1e82('0x1c')];var _0x3670c5;if(_0x1d01a0>=_0x37a9fb){_0x1d01a0=_0x37a9fb;_0x3670c5=0xc8;}else{_0x3670c5=0xce;}_0x4c4db4[_0x1e82('0x19')](_0x3670c5);return _0x4c4db4[_0x1e82('0x1e')]('Content-Range',_0x16a953+'-'+_0x1d01a0+'/'+_0x37a9fb)[_0x1e82('0x1f')](_0x539492);}return null;};}function patchUpdates(_0x130992){return function(_0x367adc){try{jsonpatch[_0x1e82('0x20')](_0x367adc,_0x130992,!![]);}catch(_0x1bef2c){return BPromise['reject'](_0x1bef2c);}return _0x367adc[_0x1e82('0x21')]();};}function saveUpdates(_0x2c5655,_0x181424){return function(_0x502068){if(_0x502068){return _0x502068[_0x1e82('0x22')](_0x2c5655)[_0x1e82('0x23')](function(_0x39bb7a){return _0x39bb7a;});}return null;};}function removeEntity(_0x2a66ee,_0x4a1240){return function(_0x376c33){if(_0x376c33){return _0x376c33[_0x1e82('0x24')]()['then'](function(){_0x2a66ee[_0x1e82('0x19')](0xcc)[_0x1e82('0x25')]();});}};}function handleEntityNotFound(_0xd02692,_0x33e62b){return function(_0x3c18ac){if(!_0x3c18ac){_0xd02692[_0x1e82('0x18')](0x194);}return _0x3c18ac;};}function handleError(_0x243b9f,_0x124af3){_0x124af3=_0x124af3||0x1f4;return function(_0x283084){logger[_0x1e82('0x26')](_0x283084[_0x1e82('0x27')]);if(_0x283084[_0x1e82('0x28')]){delete _0x283084['name'];}_0x243b9f[_0x1e82('0x19')](_0x124af3)[_0x1e82('0x29')](_0x283084);};}exports[_0x1e82('0x2a')]=function(_0x2c3cc4,_0x1c9148){var _0xb42d97={},_0x3ae6d1={},_0x21649f={'count':0x0,'rows':[]};var _0x1be2d2=_[_0x1e82('0x2b')](db[_0x1e82('0x2c')][_0x1e82('0x2d')],function(_0x45bac4){return{'name':_0x45bac4[_0x1e82('0x2e')],'type':_0x45bac4['type'][_0x1e82('0x2f')]};});_0x3ae6d1['model']=_[_0x1e82('0x2b')](_0x1be2d2,_0x1e82('0x28'));_0x3ae6d1['query']=_[_0x1e82('0x30')](_0x2c3cc4[_0x1e82('0x31')]);_0x3ae6d1[_0x1e82('0x32')]=_[_0x1e82('0x33')](_0x3ae6d1[_0x1e82('0x34')],_0x3ae6d1[_0x1e82('0x31')]);_0xb42d97[_0x1e82('0x35')]=_[_0x1e82('0x33')](_0x3ae6d1[_0x1e82('0x34')],qs[_0x1e82('0x36')](_0x2c3cc4[_0x1e82('0x31')][_0x1e82('0x36')]));_0xb42d97[_0x1e82('0x35')]=_0xb42d97['attributes']['length']?_0xb42d97[_0x1e82('0x35')]:_0x3ae6d1['model'];if(!_0x2c3cc4['query'][_0x1e82('0x37')]('nolimit')){_0xb42d97[_0x1e82('0x1c')]=qs['limit'](_0x2c3cc4[_0x1e82('0x31')]['limit']);_0xb42d97[_0x1e82('0x1a')]=qs[_0x1e82('0x1a')](_0x2c3cc4[_0x1e82('0x31')]['offset']);}_0xb42d97[_0x1e82('0x38')]=qs['sort'](_0x2c3cc4[_0x1e82('0x31')][_0x1e82('0x39')]);_0xb42d97[_0x1e82('0x3a')]=qs[_0x1e82('0x32')](_[_0x1e82('0x3b')](_0x2c3cc4[_0x1e82('0x31')],_0x3ae6d1['filters']),_0x1be2d2);if(_0x2c3cc4['query'][_0x1e82('0x3c')]){_0xb42d97['where']=_['merge'](_0xb42d97[_0x1e82('0x3a')],{'$or':_['map'](_0x1be2d2,function(_0x42e031){if(_0x42e031['type']!==_0x1e82('0x3d')){var _0xde84d5={};_0xde84d5[_0x42e031['name']]={'$like':'%'+_0x2c3cc4[_0x1e82('0x31')]['filter']+'%'};return _0xde84d5;}})});}_0xb42d97=_['merge']({},_0xb42d97,_0x2c3cc4[_0x1e82('0x3e')]);var _0x32c570={'where':_0xb42d97[_0x1e82('0x3a')]};return db[_0x1e82('0x2c')][_0x1e82('0x1d')](_0x32c570)[_0x1e82('0x23')](function(_0x16c29d){_0x21649f['count']=_0x16c29d;if(_0x2c3cc4[_0x1e82('0x31')][_0x1e82('0x3f')]){_0xb42d97[_0x1e82('0x40')]=[{'all':!![]}];}return db[_0x1e82('0x2c')][_0x1e82('0x41')](_0xb42d97);})[_0x1e82('0x23')](function(_0x3d9823){_0x21649f['rows']=_0x3d9823;return _0x21649f;})[_0x1e82('0x23')](respondWithFilteredResult(_0x1c9148,_0xb42d97))[_0x1e82('0x42')](handleError(_0x1c9148,null));};exports[_0x1e82('0x43')]=function(_0x3dd16f,_0x123214){var _0x3588f5={'raw':!![],'where':{'id':_0x3dd16f['params']['id']}},_0x3924d7={};_0x3924d7[_0x1e82('0x34')]=_[_0x1e82('0x30')](db['VoiceQueuesLog'][_0x1e82('0x2d')]);_0x3924d7[_0x1e82('0x31')]=_[_0x1e82('0x30')](_0x3dd16f['query']);_0x3924d7[_0x1e82('0x32')]=_[_0x1e82('0x33')](_0x3924d7[_0x1e82('0x34')],_0x3924d7[_0x1e82('0x31')]);_0x3588f5[_0x1e82('0x35')]=_[_0x1e82('0x33')](_0x3924d7['model'],qs['fields'](_0x3dd16f[_0x1e82('0x31')][_0x1e82('0x36')]));_0x3588f5[_0x1e82('0x35')]=_0x3588f5[_0x1e82('0x35')][_0x1e82('0x44')]?_0x3588f5[_0x1e82('0x35')]:_0x3924d7[_0x1e82('0x34')];if(_0x3dd16f[_0x1e82('0x31')][_0x1e82('0x3f')]){_0x3588f5[_0x1e82('0x40')]=[{'all':!![]}];}_0x3588f5=_[_0x1e82('0x45')]({},_0x3588f5,_0x3dd16f[_0x1e82('0x3e')]);return db[_0x1e82('0x2c')][_0x1e82('0x46')](_0x3588f5)[_0x1e82('0x23')](handleEntityNotFound(_0x123214,null))[_0x1e82('0x23')](respondWithResult(_0x123214,null))[_0x1e82('0x42')](handleError(_0x123214,null));};exports[_0x1e82('0x47')]=function(_0x5e8e06,_0x1f6f05){return db[_0x1e82('0x2c')]['create'](_0x5e8e06['body'],{})[_0x1e82('0x23')](respondWithResult(_0x1f6f05,0xc9))[_0x1e82('0x42')](handleError(_0x1f6f05,null));};exports[_0x1e82('0x22')]=function(_0x219a09,_0x4c148f){if(_0x219a09[_0x1e82('0x48')]['id']){delete _0x219a09[_0x1e82('0x48')]['id'];}return db[_0x1e82('0x2c')]['find']({'where':{'id':_0x219a09['params']['id']}})['then'](handleEntityNotFound(_0x4c148f,null))[_0x1e82('0x23')](saveUpdates(_0x219a09[_0x1e82('0x48')],null))[_0x1e82('0x23')](respondWithResult(_0x4c148f,null))[_0x1e82('0x42')](handleError(_0x4c148f,null));};exports[_0x1e82('0x24')]=function(_0xa325b9,_0x291ba8){return db[_0x1e82('0x2c')][_0x1e82('0x46')]({'where':{'id':_0xa325b9['params']['id']}})[_0x1e82('0x23')](handleEntityNotFound(_0x291ba8,null))[_0x1e82('0x23')](removeEntity(_0x291ba8,null))['catch'](handleError(_0x291ba8,null));};
\ No newline at end of file
+var _0x55b5=['apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','include','VoiceQueuesLog','findAll','catch','show','params','merge','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x13c625,_0xc65b8e){var _0x1f2506=function(_0x318ccc){while(--_0x318ccc){_0x13c625['push'](_0x13c625['shift']());}};_0x1f2506(++_0xc65b8e);}(_0x55b5,0x116));var _0x555b=function(_0x13cb51,_0x205c5c){_0x13cb51=_0x13cb51-0x0;var _0x269d4f=_0x55b5[_0x13cb51];return _0x269d4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x555b('0x0'));var zipdir=require(_0x555b('0x1'));var jsonpatch=require(_0x555b('0x2'));var rp=require(_0x555b('0x3'));var moment=require(_0x555b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x555b('0x5'));var util=require(_0x555b('0x6'));var path=require('path');var sox=require(_0x555b('0x7'));var csv=require(_0x555b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x555b('0x9'));var _=require(_0x555b('0xa'));var squel=require(_0x555b('0xb'));var crypto=require(_0x555b('0xc'));var jsforce=require(_0x555b('0xd'));var deskjs=require(_0x555b('0xe'));var toCsv=require(_0x555b('0x8'));var querystring=require(_0x555b('0xf'));var Papa=require(_0x555b('0x10'));var Redis=require(_0x555b('0x11'));var authService=require(_0x555b('0x12'));var qs=require(_0x555b('0x13'));var as=require(_0x555b('0x14'));var hardwareService=require(_0x555b('0x15'));var logger=require(_0x555b('0x16'))(_0x555b('0x17'));var utils=require(_0x555b('0x18'));var config=require(_0x555b('0x19'));var licenseUtil=require(_0x555b('0x1a'));var db=require(_0x555b('0x1b'))['db'];function respondWithStatusCode(_0x4aecfb,_0x530d22){_0x530d22=_0x530d22||0xcc;return function(_0x318883){if(_0x318883){return _0x4aecfb[_0x555b('0x1c')](_0x530d22);}return _0x4aecfb[_0x555b('0x1d')](_0x530d22)[_0x555b('0x1e')]();};}function respondWithResult(_0x4137c4,_0x1919a0){_0x1919a0=_0x1919a0||0xc8;return function(_0xf266e){if(_0xf266e){return _0x4137c4[_0x555b('0x1d')](_0x1919a0)[_0x555b('0x1f')](_0xf266e);}};}function respondWithFilteredResult(_0x55d33e,_0x39a864){return function(_0x448eb9){if(_0x448eb9){var _0x5e9894=typeof _0x39a864['offset']==='undefined'&&typeof _0x39a864[_0x555b('0x20')]===_0x555b('0x21');var _0x21c7a6=_0x448eb9[_0x555b('0x22')];var _0x4728c6=_0x5e9894?0x0:_0x39a864[_0x555b('0x23')];var _0x3b5512=_0x5e9894?_0x448eb9['count']:_0x39a864['offset']+_0x39a864['limit'];var _0xf93cfc;if(_0x3b5512>=_0x21c7a6){_0x3b5512=_0x21c7a6;_0xf93cfc=0xc8;}else{_0xf93cfc=0xce;}_0x55d33e[_0x555b('0x1d')](_0xf93cfc);return _0x55d33e[_0x555b('0x24')](_0x555b('0x25'),_0x4728c6+'-'+_0x3b5512+'/'+_0x21c7a6)[_0x555b('0x1f')](_0x448eb9);}return null;};}function patchUpdates(_0x37dab5){return function(_0x2f7983){try{jsonpatch[_0x555b('0x26')](_0x2f7983,_0x37dab5,!![]);}catch(_0x1c4fc8){return BPromise[_0x555b('0x27')](_0x1c4fc8);}return _0x2f7983[_0x555b('0x28')]();};}function saveUpdates(_0x3d3aa2,_0x2f1685){return function(_0x316dda){if(_0x316dda){return _0x316dda['update'](_0x3d3aa2)[_0x555b('0x29')](function(_0x194aa1){return _0x194aa1;});}return null;};}function removeEntity(_0x4a12ce,_0x28146b){return function(_0x14c017){if(_0x14c017){return _0x14c017[_0x555b('0x2a')]()[_0x555b('0x29')](function(){_0x4a12ce['status'](0xcc)[_0x555b('0x1e')]();});}};}function handleEntityNotFound(_0x29c028,_0x279c3d){return function(_0x2579a6){if(!_0x2579a6){_0x29c028[_0x555b('0x1c')](0x194);}return _0x2579a6;};}function handleError(_0x4c20af,_0x127e89){_0x127e89=_0x127e89||0x1f4;return function(_0x32257a){logger[_0x555b('0x2b')](_0x32257a[_0x555b('0x2c')]);if(_0x32257a[_0x555b('0x2d')]){delete _0x32257a['name'];}_0x4c20af['status'](_0x127e89)['send'](_0x32257a);};}exports['index']=function(_0x3a50a1,_0x285083){var _0x2a9ab2={},_0xbe5ec={},_0x26f7b0={'count':0x0,'rows':[]};var _0x534547=_[_0x555b('0x2e')](db['VoiceQueuesLog'][_0x555b('0x2f')],function(_0x337842){return{'name':_0x337842[_0x555b('0x30')],'type':_0x337842[_0x555b('0x31')][_0x555b('0x32')]};});_0xbe5ec[_0x555b('0x33')]=_['map'](_0x534547,_0x555b('0x2d'));_0xbe5ec['query']=_[_0x555b('0x34')](_0x3a50a1[_0x555b('0x35')]);_0xbe5ec[_0x555b('0x36')]=_[_0x555b('0x37')](_0xbe5ec['model'],_0xbe5ec[_0x555b('0x35')]);_0x2a9ab2['attributes']=_['intersection'](_0xbe5ec[_0x555b('0x33')],qs['fields'](_0x3a50a1[_0x555b('0x35')][_0x555b('0x38')]));_0x2a9ab2['attributes']=_0x2a9ab2[_0x555b('0x39')][_0x555b('0x3a')]?_0x2a9ab2[_0x555b('0x39')]:_0xbe5ec['model'];if(!_0x3a50a1[_0x555b('0x35')][_0x555b('0x3b')](_0x555b('0x3c'))){_0x2a9ab2[_0x555b('0x20')]=qs[_0x555b('0x20')](_0x3a50a1[_0x555b('0x35')]['limit']);_0x2a9ab2[_0x555b('0x23')]=qs[_0x555b('0x23')](_0x3a50a1['query'][_0x555b('0x23')]);}_0x2a9ab2[_0x555b('0x3d')]=qs[_0x555b('0x3e')](_0x3a50a1[_0x555b('0x35')][_0x555b('0x3e')]);_0x2a9ab2[_0x555b('0x3f')]=qs['filters'](_['pick'](_0x3a50a1[_0x555b('0x35')],_0xbe5ec[_0x555b('0x36')]),_0x534547);if(_0x3a50a1['query']['filter']){_0x2a9ab2[_0x555b('0x3f')]=_['merge'](_0x2a9ab2[_0x555b('0x3f')],{'$or':_['map'](_0x534547,function(_0x1cf115){if(_0x1cf115[_0x555b('0x31')]!==_0x555b('0x40')){var _0xd4587b={};_0xd4587b[_0x1cf115[_0x555b('0x2d')]]={'$like':'%'+_0x3a50a1['query'][_0x555b('0x41')]+'%'};return _0xd4587b;}})});}_0x2a9ab2=_['merge']({},_0x2a9ab2,_0x3a50a1[_0x555b('0x42')]);var _0x38bc88={'where':_0x2a9ab2[_0x555b('0x3f')]};return db['VoiceQueuesLog'][_0x555b('0x22')](_0x38bc88)[_0x555b('0x29')](function(_0x4cad31){_0x26f7b0[_0x555b('0x22')]=_0x4cad31;if(_0x3a50a1[_0x555b('0x35')][_0x555b('0x43')]){_0x2a9ab2[_0x555b('0x44')]=[{'all':!![]}];}return db[_0x555b('0x45')][_0x555b('0x46')](_0x2a9ab2);})[_0x555b('0x29')](function(_0x500e86){_0x26f7b0['rows']=_0x500e86;return _0x26f7b0;})['then'](respondWithFilteredResult(_0x285083,_0x2a9ab2))[_0x555b('0x47')](handleError(_0x285083,null));};exports[_0x555b('0x48')]=function(_0x3c2d3,_0x52b9b1){var _0x433778={'raw':!![],'where':{'id':_0x3c2d3[_0x555b('0x49')]['id']}},_0xa49fb2={};_0xa49fb2[_0x555b('0x33')]=_['keys'](db[_0x555b('0x45')][_0x555b('0x2f')]);_0xa49fb2['query']=_[_0x555b('0x34')](_0x3c2d3['query']);_0xa49fb2[_0x555b('0x36')]=_[_0x555b('0x37')](_0xa49fb2['model'],_0xa49fb2[_0x555b('0x35')]);_0x433778[_0x555b('0x39')]=_[_0x555b('0x37')](_0xa49fb2[_0x555b('0x33')],qs['fields'](_0x3c2d3['query'][_0x555b('0x38')]));_0x433778[_0x555b('0x39')]=_0x433778[_0x555b('0x39')][_0x555b('0x3a')]?_0x433778[_0x555b('0x39')]:_0xa49fb2[_0x555b('0x33')];if(_0x3c2d3['query'][_0x555b('0x43')]){_0x433778[_0x555b('0x44')]=[{'all':!![]}];}_0x433778=_[_0x555b('0x4a')]({},_0x433778,_0x3c2d3['options']);return db[_0x555b('0x45')]['find'](_0x433778)['then'](handleEntityNotFound(_0x52b9b1,null))[_0x555b('0x29')](respondWithResult(_0x52b9b1,null))[_0x555b('0x47')](handleError(_0x52b9b1,null));};exports[_0x555b('0x4b')]=function(_0x3d812b,_0xbbffa9){return db[_0x555b('0x45')][_0x555b('0x4b')](_0x3d812b[_0x555b('0x4c')],{})[_0x555b('0x29')](respondWithResult(_0xbbffa9,0xc9))[_0x555b('0x47')](handleError(_0xbbffa9,null));};exports[_0x555b('0x4d')]=function(_0x52f3d9,_0xee884c){if(_0x52f3d9[_0x555b('0x4c')]['id']){delete _0x52f3d9[_0x555b('0x4c')]['id'];}return db[_0x555b('0x45')][_0x555b('0x4e')]({'where':{'id':_0x52f3d9[_0x555b('0x49')]['id']}})['then'](handleEntityNotFound(_0xee884c,null))[_0x555b('0x29')](saveUpdates(_0x52f3d9['body'],null))[_0x555b('0x29')](respondWithResult(_0xee884c,null))[_0x555b('0x47')](handleError(_0xee884c,null));};exports[_0x555b('0x2a')]=function(_0x3785a4,_0x58a614){return db[_0x555b('0x45')][_0x555b('0x4e')]({'where':{'id':_0x3785a4[_0x555b('0x49')]['id']}})[_0x555b('0x29')](handleEntityNotFound(_0x58a614,null))[_0x555b('0x29')](removeEntity(_0x58a614,null))[_0x555b('0x47')](handleError(_0x58a614,null));};
\ No newline at end of file
index d9b9ca7..ea83477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger'];(function(_0x3b93b4,_0x1f695d){var _0x33e3a0=function(_0x251267){while(--_0x251267){_0x3b93b4['push'](_0x3b93b4['shift']());}};_0x33e3a0(++_0x1f695d);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa3d4[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x4a3d('0x0'));var logger=require(_0x4a3d('0x1'))(_0x4a3d('0x2'));var moment=require('moment');var BPromise=require(_0x4a3d('0x3'));var rp=require(_0x4a3d('0x4'));var fs=require('fs');var path=require(_0x4a3d('0x5'));var rimraf=require(_0x4a3d('0x6'));var config=require(_0x4a3d('0x7'));var attributes=require(_0x4a3d('0x8'));module[_0x4a3d('0x9')]=function(_0x5bb9d0,_0x486c9b){return _0x5bb9d0[_0x4a3d('0xa')](_0x4a3d('0xb'),attributes,{'tableName':_0x4a3d('0xc'),'paranoid':![],'indexes':[{'name':_0x4a3d('0xd'),'fields':[_0x4a3d('0xe'),_0x4a3d('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x0418=['./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x27b6b9,_0x5d347d){var _0x2d72f6=function(_0x5a6bcd){while(--_0x5a6bcd){_0x27b6b9['push'](_0x27b6b9['shift']());}};_0x2d72f6(++_0x5d347d);}(_0x0418,0x165));var _0x8041=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0418[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x8041('0x0'));var util=require(_0x8041('0x1'));var logger=require(_0x8041('0x2'))('api');var moment=require(_0x8041('0x3'));var BPromise=require(_0x8041('0x4'));var rp=require(_0x8041('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8041('0x6'));var attributes=require(_0x8041('0x7'));module[_0x8041('0x8')]=function(_0x250819,_0x3cdb1a){return _0x250819['define'](_0x8041('0x9'),attributes,{'tableName':_0x8041('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x8041('0xb'),_0x8041('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index 01b1f05..134929a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9802=['../../config/environment','client','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34cd7d,_0x1f3627){var _0x867d1c=function(_0x251a7e){while(--_0x251a7e){_0x34cd7d['push'](_0x34cd7d['shift']());}};_0x867d1c(++_0x1f3627);}(_0x9802,0x112));var _0x2980=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9802[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2980('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2980('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2980('0x2'));var db=require(_0x2980('0x3'))['db'];var utils=require(_0x2980('0x4'));var logger=require(_0x2980('0x5'))('rpc');var config=require(_0x2980('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2980('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4981d9,_0x1c4375,_0x5ff778){return new BPromise(function(_0x319bd1,_0x2e6867){return client['request'](_0x4981d9,_0x5ff778)[_0x2980('0x8')](function(_0x151b7b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1c4375,_0x2980('0x9'));logger[_0x2980('0xa')](_0x2980('0xb'),_0x1c4375,_0x2980('0x9'),JSON[_0x2980('0xc')](_0x151b7b));if(_0x151b7b[_0x2980('0xd')]){if(_0x151b7b[_0x2980('0xd')][_0x2980('0xe')]===0x1f4){logger['error'](_0x2980('0xf'),_0x1c4375,_0x151b7b[_0x2980('0xd')][_0x2980('0x10')]);return _0x2e6867(_0x151b7b['error'][_0x2980('0x10')]);}logger['error'](_0x2980('0xf'),_0x1c4375,_0x151b7b[_0x2980('0xd')][_0x2980('0x10')]);return _0x319bd1(_0x151b7b['error'][_0x2980('0x10')]);}else{logger[_0x2980('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1c4375,_0x2980('0x9'));_0x319bd1(_0x151b7b[_0x2980('0x12')][_0x2980('0x10')]);}})[_0x2980('0x13')](function(_0x34bf51){logger[_0x2980('0xd')](_0x2980('0xf'),_0x1c4375,_0x34bf51);_0x2e6867(_0x34bf51);});});}
\ No newline at end of file
+var _0xccea=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50e849,_0x217457){var _0x590e65=function(_0x19ce2b){while(--_0x19ce2b){_0x50e849['push'](_0x50e849['shift']());}};_0x590e65(++_0x217457);}(_0xccea,0x198));var _0xacce=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xccea[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xacce('0x0'));var util=require('util');var moment=require(_0xacce('0x1'));var BPromise=require(_0xacce('0x2'));var rs=require(_0xacce('0x3'));var fs=require('fs');var Redis=require(_0xacce('0x4'));var db=require(_0xacce('0x5'))['db'];var utils=require(_0xacce('0x6'));var logger=require(_0xacce('0x7'))(_0xacce('0x8'));var config=require(_0xacce('0x9'));var jayson=require(_0xacce('0xa'));var client=jayson[_0xacce('0xb')][_0xacce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cc305,_0x53797d,_0x2c426a){return new BPromise(function(_0x201f59,_0x14da75){return client[_0xacce('0xd')](_0x3cc305,_0x2c426a)[_0xacce('0xe')](function(_0x9f7033){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x53797d,'request\x20sent');logger['debug'](_0xacce('0xf'),_0x53797d,_0xacce('0x10'),JSON[_0xacce('0x11')](_0x9f7033));if(_0x9f7033[_0xacce('0x12')]){if(_0x9f7033[_0xacce('0x12')][_0xacce('0x13')]===0x1f4){logger[_0xacce('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x53797d,_0x9f7033[_0xacce('0x12')][_0xacce('0x14')]);return _0x14da75(_0x9f7033['error'][_0xacce('0x14')]);}logger[_0xacce('0x12')](_0xacce('0x15'),_0x53797d,_0x9f7033[_0xacce('0x12')]['message']);return _0x201f59(_0x9f7033['error'][_0xacce('0x14')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x53797d,'request\x20sent');_0x201f59(_0x9f7033['result'][_0xacce('0x14')]);}})[_0xacce('0x16')](function(_0x267340){logger[_0xacce('0x12')](_0xacce('0x15'),_0x53797d,_0x267340);_0x14da75(_0x267340);});});}
\ No newline at end of file
index 4aa285e..ec74e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6766=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','util','path','express'];(function(_0x253bf8,_0x391f74){var _0x48e36e=function(_0x20cae5){while(--_0x20cae5){_0x253bf8['push'](_0x253bf8['shift']());}};_0x48e36e(++_0x391f74);}(_0x6766,0x1b2));var _0x6676=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x6766[_0x587dd0];return _0x56f153;};'use strict';var multer=require('multer');var util=require(_0x6676('0x0'));var path=require(_0x6676('0x1'));var timeout=require('connect-timeout');var express=require(_0x6676('0x2'));var router=express['Router']();var fs_extra=require(_0x6676('0x3'));var auth=require(_0x6676('0x4'));var interaction=require(_0x6676('0x5'));var config=require('../../config/environment');var controller=require(_0x6676('0x6'));router['get']('/',auth[_0x6676('0x7')](),controller[_0x6676('0x8')]);router[_0x6676('0x9')](_0x6676('0xa'),auth[_0x6676('0x7')](),controller[_0x6676('0xb')]);router[_0x6676('0x9')](_0x6676('0xc'),auth[_0x6676('0x7')](),controller[_0x6676('0xd')]);router[_0x6676('0x9')](_0x6676('0xe'),auth[_0x6676('0x7')](),controller['download']);router['get']('/:id/downloads',controller['downloads']);router[_0x6676('0x9')](_0x6676('0xf'),auth[_0x6676('0x7')](),controller[_0x6676('0x10')]);router[_0x6676('0x11')]('/',auth[_0x6676('0x7')](),controller['create']);router[_0x6676('0x11')](_0x6676('0xf'),auth[_0x6676('0x7')](),controller[_0x6676('0x12')]);router[_0x6676('0x13')](_0x6676('0xc'),auth[_0x6676('0x7')](),controller[_0x6676('0x14')]);router[_0x6676('0x15')]('/:id',auth[_0x6676('0x7')](),controller[_0x6676('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xfa31=['download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xfa31,0x1e0));var _0x1fa3=function(_0x346c14,_0x3c5ade){_0x346c14=_0x346c14-0x0;var _0x169cd3=_0xfa31[_0x346c14];return _0x169cd3;};'use strict';var multer=require(_0x1fa3('0x0'));var util=require(_0x1fa3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1fa3('0x2'));var router=express[_0x1fa3('0x3')]();var fs_extra=require(_0x1fa3('0x4'));var auth=require(_0x1fa3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa3('0x6'));var controller=require('./voiceRecording.controller');router[_0x1fa3('0x7')]('/',auth[_0x1fa3('0x8')](),controller[_0x1fa3('0x9')]);router['get'](_0x1fa3('0xa'),auth[_0x1fa3('0x8')](),controller[_0x1fa3('0xb')]);router[_0x1fa3('0x7')](_0x1fa3('0xc'),auth[_0x1fa3('0x8')](),controller[_0x1fa3('0xd')]);router[_0x1fa3('0x7')]('/:id/download',auth[_0x1fa3('0x8')](),controller[_0x1fa3('0xe')]);router[_0x1fa3('0x7')]('/:id/downloads',controller[_0x1fa3('0xf')]);router[_0x1fa3('0x7')](_0x1fa3('0x10'),auth[_0x1fa3('0x8')](),controller[_0x1fa3('0x11')]);router[_0x1fa3('0x12')]('/',auth[_0x1fa3('0x8')](),controller[_0x1fa3('0x13')]);router['post'](_0x1fa3('0x10'),auth[_0x1fa3('0x8')](),controller[_0x1fa3('0x14')]);router[_0x1fa3('0x15')](_0x1fa3('0xc'),auth['isAuthenticated'](),controller[_0x1fa3('0x16')]);router[_0x1fa3('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x1fa3('0x18')]);module[_0x1fa3('0x19')]=router;
\ No newline at end of file
index dda1db7..36949fe 100644 (file)
@@ -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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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
index 002d219..f533de0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87e0=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','error','stack','name','send','index','map','VoiceRecording','fieldName','key','model','differenceBy','format','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','uniqueid','value','decryptFile','secrets','recording','Sequelize','download','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','existsSync','ValidationError','extname','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19bba9,_0x2e69e7){var _0x32dca4=function(_0x143f51){while(--_0x143f51){_0x19bba9['push'](_0x19bba9['shift']());}};_0x32dca4(++_0x2e69e7);}(_0x87e0,0x12e));var _0x087e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x87e0[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x087e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x087e('0x1'));var jsonpatch=require(_0x087e('0x2'));var rp=require(_0x087e('0x3'));var moment=require(_0x087e('0x4'));var BPromise=require(_0x087e('0x5'));var Mustache=require('mustache');var util=require(_0x087e('0x6'));var path=require(_0x087e('0x7'));var sox=require(_0x087e('0x8'));var csv=require(_0x087e('0x9'));var ejs=require(_0x087e('0xa'));var fs=require('fs');var fs_extra=require(_0x087e('0xb'));var _=require(_0x087e('0xc'));var squel=require(_0x087e('0xd'));var crypto=require(_0x087e('0xe'));var jsforce=require(_0x087e('0xf'));var deskjs=require(_0x087e('0x10'));var toCsv=require(_0x087e('0x9'));var querystring=require(_0x087e('0x11'));var Papa=require(_0x087e('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0x087e('0x13'));var Redis=require(_0x087e('0x14'));var authService=require(_0x087e('0x15'));var qs=require(_0x087e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x087e('0x17'));var logger=require(_0x087e('0x18'))(_0x087e('0x19'));var utils=require(_0x087e('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x087e('0x1b'));var db=require(_0x087e('0x1c'))['db'];function respondWithStatusCode(_0x1cf6a1,_0x14606d){_0x14606d=_0x14606d||0xcc;return function(_0x49bbc2){if(_0x49bbc2){return _0x1cf6a1[_0x087e('0x1d')](_0x14606d);}return _0x1cf6a1[_0x087e('0x1e')](_0x14606d)[_0x087e('0x1f')]();};}function respondWithResult(_0x42566d,_0x245ee8){_0x245ee8=_0x245ee8||0xc8;return function(_0x2bf47b){if(_0x2bf47b){return _0x42566d[_0x087e('0x1e')](_0x245ee8)['json'](_0x2bf47b);}};}function respondWithFilteredResult(_0x25ed62,_0x186dca){return function(_0x1a7e95){if(_0x1a7e95){var _0x38d740=typeof _0x186dca[_0x087e('0x20')]===_0x087e('0x21')&&typeof _0x186dca[_0x087e('0x22')]==='undefined';var _0xbb2b84=_0x1a7e95[_0x087e('0x23')];var _0x2928ae=_0x38d740?0x0:_0x186dca[_0x087e('0x20')];var _0x277770=_0x38d740?_0x1a7e95['count']:_0x186dca[_0x087e('0x20')]+_0x186dca[_0x087e('0x22')];var _0x16d439;if(_0x277770>=_0xbb2b84){_0x277770=_0xbb2b84;_0x16d439=0xc8;}else{_0x16d439=0xce;}_0x25ed62[_0x087e('0x1e')](_0x16d439);return _0x25ed62[_0x087e('0x24')]('Content-Range',_0x2928ae+'-'+_0x277770+'/'+_0xbb2b84)[_0x087e('0x25')](_0x1a7e95);}return null;};}function patchUpdates(_0x4f4838){return function(_0x759edf){try{jsonpatch['apply'](_0x759edf,_0x4f4838,!![]);}catch(_0x33d7fa){return BPromise[_0x087e('0x26')](_0x33d7fa);}return _0x759edf['save']();};}function saveUpdates(_0x22bd91,_0x4dde00){return function(_0xfc739b){if(_0xfc739b){return _0xfc739b[_0x087e('0x27')](_0x22bd91)[_0x087e('0x28')](function(_0x2a86cf){return _0x2a86cf;});}return null;};}function removeEntity(_0x39755a,_0x233bb5){return function(_0xcd892f){if(_0xcd892f){return _0xcd892f['destroy']()['then'](function(){_0x39755a[_0x087e('0x1e')](0xcc)[_0x087e('0x1f')]();});}};}function handleEntityNotFound(_0x309473,_0x3688ad){return function(_0x35179b){if(!_0x35179b){_0x309473['sendStatus'](0x194);}return _0x35179b;};}function handleError(_0x5d73d7,_0x5d4067){_0x5d4067=_0x5d4067||0x1f4;return function(_0x57c227){logger[_0x087e('0x29')](_0x57c227[_0x087e('0x2a')]);if(_0x57c227[_0x087e('0x2b')]){delete _0x57c227['name'];}_0x5d73d7[_0x087e('0x1e')](_0x5d4067)[_0x087e('0x2c')](_0x57c227);};}exports[_0x087e('0x2d')]=function(_0x1871f5,_0x5bda23){var _0x1ff724={},_0x1719f4={},_0x470bdc={'count':0x0,'rows':[]};var _0x51bc5f=_[_0x087e('0x2e')](db[_0x087e('0x2f')]['rawAttributes'],function(_0x3ddb08){return{'name':_0x3ddb08[_0x087e('0x30')],'type':_0x3ddb08['type'][_0x087e('0x31')]};});_0x1719f4[_0x087e('0x32')]=_[_0x087e('0x33')](_['map'](_0x51bc5f,_0x087e('0x2b')),[_0x087e('0x34')]);_0x1719f4[_0x087e('0x35')]=_[_0x087e('0x36')](_0x1871f5[_0x087e('0x35')]);_0x1719f4['filters']=_['intersection'](_0x1719f4['model'],_0x1719f4[_0x087e('0x35')]);_0x1ff724[_0x087e('0x37')]=_[_0x087e('0x38')](_0x1719f4[_0x087e('0x32')],qs[_0x087e('0x39')](_0x1871f5[_0x087e('0x35')][_0x087e('0x39')]));_0x1ff724[_0x087e('0x37')]=_0x1ff724[_0x087e('0x37')][_0x087e('0x3a')]?_0x1ff724[_0x087e('0x37')]:_0x1719f4[_0x087e('0x32')];if(!_0x1871f5[_0x087e('0x35')][_0x087e('0x3b')](_0x087e('0x3c'))){_0x1ff724[_0x087e('0x22')]=qs[_0x087e('0x22')](_0x1871f5[_0x087e('0x35')][_0x087e('0x22')]);_0x1ff724[_0x087e('0x20')]=qs[_0x087e('0x20')](_0x1871f5['query'][_0x087e('0x20')]);}_0x1ff724[_0x087e('0x3d')]=qs['sort'](_0x1871f5[_0x087e('0x35')][_0x087e('0x3e')]);_0x1ff724[_0x087e('0x3f')]=qs[_0x087e('0x40')](_[_0x087e('0x41')](_0x1871f5[_0x087e('0x35')],_0x1719f4[_0x087e('0x40')]),_0x51bc5f);if(_0x1871f5['query'][_0x087e('0x42')]){_0x1ff724['where']=_['merge'](_0x1ff724[_0x087e('0x3f')],{'$or':_[_0x087e('0x2e')](_0x51bc5f,function(_0x1a459d){if(_0x1a459d[_0x087e('0x43')]!=='VIRTUAL'){var _0x540fad={};_0x540fad[_0x1a459d['name']]={'$like':'%'+_0x1871f5[_0x087e('0x35')]['filter']+'%'};return _0x540fad;}})});}_0x1ff724=_[_0x087e('0x44')]({},_0x1ff724,_0x1871f5[_0x087e('0x45')]);var _0x1a4ffd={'where':_0x1ff724[_0x087e('0x3f')]};return db[_0x087e('0x2f')][_0x087e('0x23')](_0x1a4ffd)[_0x087e('0x28')](function(_0xeea02){_0x470bdc[_0x087e('0x23')]=_0xeea02;if(_0x1871f5['query'][_0x087e('0x46')]){_0x1ff724[_0x087e('0x47')]=[{'all':!![]}];}return db[_0x087e('0x2f')][_0x087e('0x48')](_0x1ff724);})[_0x087e('0x28')](function(_0x3cee71){_0x470bdc[_0x087e('0x49')]=_0x3cee71;return _0x470bdc;})[_0x087e('0x28')](respondWithFilteredResult(_0x5bda23,_0x1ff724))[_0x087e('0x4a')](handleError(_0x5bda23,null));};exports[_0x087e('0x4b')]=function(_0x51bf3e,_0x5909f4){var _0x46341c={'raw':![],'where':{'id':_0x51bf3e[_0x087e('0x4c')]['id']}},_0x10b710={};_0x10b710[_0x087e('0x32')]=_[_0x087e('0x36')](db[_0x087e('0x2f')][_0x087e('0x4d')]);_0x10b710['query']=_[_0x087e('0x36')](_0x51bf3e[_0x087e('0x35')]);_0x10b710[_0x087e('0x40')]=_[_0x087e('0x38')](_0x10b710['model'],_0x10b710[_0x087e('0x35')]);_0x46341c[_0x087e('0x37')]=_['intersection'](_0x10b710['model'],qs[_0x087e('0x39')](_0x51bf3e[_0x087e('0x35')]['fields']));_0x46341c['attributes']=_0x46341c[_0x087e('0x37')]['length']?_0x46341c[_0x087e('0x37')]:_0x10b710['model'];if(_0x51bf3e[_0x087e('0x35')][_0x087e('0x46')]){_0x46341c[_0x087e('0x47')]=[{'all':!![]}];}_0x46341c=_[_0x087e('0x44')]({},_0x46341c,_0x51bf3e['options']);return db['VoiceRecording'][_0x087e('0x4e')](_0x46341c)[_0x087e('0x28')](handleEntityNotFound(_0x5909f4,null))[_0x087e('0x28')](respondWithResult(_0x5909f4,null))[_0x087e('0x4a')](handleError(_0x5909f4,null));};exports[_0x087e('0x4f')]=function(_0x10a069,_0x3f7151){return db['VoiceRecording'][_0x087e('0x4f')](_0x10a069['body'],{})['then'](respondWithResult(_0x3f7151,0xc9))[_0x087e('0x4a')](handleError(_0x3f7151,null));};exports[_0x087e('0x27')]=function(_0x9ff2cc,_0x259f3f){if(_0x9ff2cc[_0x087e('0x50')]['id']){delete _0x9ff2cc[_0x087e('0x50')]['id'];}return db['VoiceRecording'][_0x087e('0x4e')]({'where':{'id':_0x9ff2cc[_0x087e('0x4c')]['id']}})[_0x087e('0x28')](handleEntityNotFound(_0x259f3f,null))[_0x087e('0x28')](saveUpdates(_0x9ff2cc['body'],null))['then'](respondWithResult(_0x259f3f,null))[_0x087e('0x4a')](handleError(_0x259f3f,null));};exports[_0x087e('0x51')]=function(_0x113669,_0xa8840f){return db[_0x087e('0x2f')][_0x087e('0x51')]()[_0x087e('0x28')](respondWithResult(_0xa8840f,null))['catch'](handleError(_0xa8840f,null));};exports['download']=function(_0x5f47a2,_0x45c348,_0x249ea6){var _0x4c40dc=require('../../components/encryptor');var _0x3b238b=![];var _0x34d4d9={};if(_0x5f47a2[_0x087e('0x35')][_0x087e('0x43')]&&_0x5f47a2[_0x087e('0x35')][_0x087e('0x43')]===_0x087e('0x52')){_0x34d4d9[_0x087e('0x52')]=_0x5f47a2['params']['id'];}else{_0x34d4d9['id']=_0x5f47a2[_0x087e('0x4c')]['id'];}return db[_0x087e('0x2f')][_0x087e('0x4e')]({'where':_0x34d4d9,'attributes':['id',_0x087e('0x53')],'raw':!![]})[_0x087e('0x28')](handleEntityNotFound(_0x45c348,null))['then'](function(_0x3e054c){if(_0x3e054c){var _0x1f4a1a=_0x3e054c['value'];var _0x231cfb=util[_0x087e('0x34')]('%s.cypher',_0x1f4a1a);if(fs['existsSync'](_0x231cfb)){_0x3b238b=!![];return _0x4c40dc[_0x087e('0x54')](_0x231cfb,_0x1f4a1a,config[_0x087e('0x55')][_0x087e('0x56')])[_0x087e('0x28')](function(){return _0x3e054c;});}return _0x3e054c;}})['then'](function(_0x46cdea){if(_0x46cdea){var _0x688b3e=_0x46cdea[_0x087e('0x53')];if(!fs['existsSync'](_0x688b3e)){throw new db[(_0x087e('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x46cdea['filename']){return _0x45c348[_0x087e('0x58')](_0x688b3e,_0x46cdea[_0x087e('0x59')]+path['extname'](_0x688b3e),function(){if(_0x3b238b){fs[_0x087e('0x5a')](_0x688b3e);}});}else{return _0x45c348[_0x087e('0x58')](_0x688b3e,function(_0x202740){if(_0x3b238b){fs[_0x087e('0x5a')](_0x688b3e);}});}}})['catch'](function(_0x4a080e){if(_0x4a080e[_0x087e('0x5b')]===_0x087e('0x5c')){_0x45c348[_0x087e('0x1e')](0x194)['send'](_0x087e('0x5d'));}else{return handleError(_0x45c348,null);}});};exports[_0x087e('0x5e')]=function(_0x22fa04,_0x36eca2,_0xbcdbc2){var _0x126a74=require('../../components/encryptor');var _0x23e06d=![];var _0x304f2d={'$and':[db[_0x087e('0x5f')]['where'](db[_0x087e('0x5f')]['fn']('MD5',db[_0x087e('0x5f')][_0x087e('0x60')](_0x087e('0x52'))),_0x22fa04[_0x087e('0x35')][_0x087e('0x61')])]};if(_0x22fa04[_0x087e('0x35')][_0x087e('0x43')]&&_0x22fa04[_0x087e('0x35')][_0x087e('0x43')]==='uniqueid'){_0x304f2d[_0x087e('0x62')][_0x087e('0x63')]({'uniqueid':_0x22fa04[_0x087e('0x4c')]['id']});}else{_0x304f2d['$and'][_0x087e('0x63')]({'id':_0x22fa04[_0x087e('0x4c')]['id']});}return db[_0x087e('0x2f')][_0x087e('0x4e')]({'where':_0x304f2d,'attributes':['id',_0x087e('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x36eca2,null))[_0x087e('0x28')](function(_0x33ccb8){if(_0x33ccb8){var _0x358f0c=util['format'](_0x087e('0x64'),_0x33ccb8['value']);if(fs[_0x087e('0x65')](_0x358f0c)){_0x23e06d=!![];return _0x126a74['decryptFile'](_0x358f0c,_0x33ccb8[_0x087e('0x53')],config[_0x087e('0x55')][_0x087e('0x56')])[_0x087e('0x28')](function(){return _0x33ccb8;});}return _0x33ccb8;}})[_0x087e('0x28')](function(_0x489799){if(_0x489799){if(!fs['existsSync'](_0x489799[_0x087e('0x53')])){throw new db[(_0x087e('0x57'))][(_0x087e('0x66'))](_0x087e('0x5c'));}if(_0x489799[_0x087e('0x59')]){return _0x36eca2[_0x087e('0x58')](_0x489799[_0x087e('0x53')],_0x489799[_0x087e('0x59')]+path[_0x087e('0x67')](_0x489799[_0x087e('0x53')]),function(){if(_0x23e06d){fs['unlink'](_0x489799[_0x087e('0x53')]);}});}else{return _0x36eca2[_0x087e('0x58')](_0x489799[_0x087e('0x53')],function(_0x19af79){if(_0x23e06d){fs[_0x087e('0x5a')](_0x489799['value']);}});}}})[_0x087e('0x4a')](handleError(_0x36eca2,null));};exports['destroy']=function(_0x237f16,_0x308a55){return db['VoiceRecording'][_0x087e('0x4e')]({'where':{'id':_0x237f16[_0x087e('0x4c')]['id']}})[_0x087e('0x28')](function(_0xcacf61){if(_[_0x087e('0x68')](_0xcacf61)){throw new ReferenceError(_0x087e('0x69'));}return _0xcacf61;})[_0x087e('0x28')](function(_0x58a1d5){var _0xa68bf4=_0x58a1d5[_0x087e('0x53')];logger['info'](_0x087e('0x6a'),_0xa68bf4);if(!_[_0x087e('0x68')](_0x58a1d5[_0x087e('0x53')])&&fs['existsSync'](_0xa68bf4)){logger[_0x087e('0x6b')]('File:\x20\x22'+_0xa68bf4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x087e('0x6c')](_0xa68bf4);}_0xa68bf4=_0xa68bf4+_0x087e('0x6d');if(!_[_0x087e('0x68')](_0x58a1d5[_0x087e('0x53')])&&fs[_0x087e('0x65')](_0xa68bf4)){logger[_0x087e('0x6b')](_0x087e('0x6e')+_0xa68bf4+_0x087e('0x6f'));fs['unlinkSync'](_0xa68bf4);}return _0x58a1d5;})[_0x087e('0x28')](function(_0x7945b8){if(!_0x7945b8)throw new InternalError();return _0x7945b8[_0x087e('0x70')]();})[_0x087e('0x28')](function(){_0x308a55[_0x087e('0x1e')](0xcc)['end']();})[_0x087e('0x4a')](handleError(_0x308a55,null));};function getBucketslist(_0x55de54,_0x18ca32,_0x81b6b3){return new Promise(function(_0x57dcd5,_0x5db6eb){var _0x3f5218=new AWS['S3']({'accessKeyId':_0x18ca32,'secretAccessKey':_0x55de54,'region':_0x81b6b3});_0x3f5218[_0x087e('0x71')]({},function(_0x4d7e01,_0x3abf6d){if(_0x4d7e01){return _0x5db6eb(_0x4d7e01);}else{return _0x57dcd5(_0x3abf6d);}});});}function createBucket(_0x35867a,_0xcbd28,_0x35b37a,_0xd8f966){return new Promise(function(_0xf22b21,_0x8945d){var _0x3d1b4d=new AWS['S3']({'accessKeyId':_0xcbd28,'secretAccessKey':_0x35867a,'region':_0x35b37a});_0x3d1b4d['createBucket']({'Bucket':_0xd8f966},function(_0x422c15,_0x1c23c6){if(_0x422c15){return _0x8945d(_0x422c15);}else{return _0xf22b21(_0x1c23c6);}});});}function uploadFile(_0x192bf2,_0x488c23,_0x4b98d9,_0x519573,_0x2e0447,_0x20a23b){return new Promise(function(_0x1f9403,_0x58beb2){var _0x4f414f=new AWS['S3']({'accessKeyId':_0x488c23,'secretAccessKey':_0x192bf2,'region':_0x4b98d9});_0x4f414f[_0x087e('0x72')]({'Bucket':_0x519573,'Key':_0x2e0447,'Body':_0x20a23b},function(_0x3f5f76,_0x21fa00){if(_0x3f5f76){return _0x58beb2(_0x3f5f76);}else{return _0x1f9403(_0x21fa00);}});});}function startTranscribe(_0x5278b6,_0x4fd8fc,_0x70b22f,_0x38e557,_0x250a36,_0x2e5538){return new Promise(function(_0x230721,_0x38a4af){var _0x95deb0=new AWS[(_0x087e('0x73'))]({'accessKeyId':_0x4fd8fc,'secretAccessKey':_0x5278b6,'region':_0x70b22f});_0x95deb0[_0x087e('0x74')]({'TranscriptionJobName':_0x38e557,'LanguageCode':_0x250a36,'Media':{'MediaFileUri':_0x2e5538}},function(_0x1c6245,_0x154c67){if(_0x1c6245){return _0x38a4af(_0x1c6245);}else{return _0x230721(_0x154c67);}});});}function transcribe(_0x4f04cd,_0x595741,_0x1e4db1,_0xad4d1f,_0x2d4d36,_0x2dcada,_0x1b1039){return new Promise(function(_0x2ec191,_0xde730b){var _0x276f1c={};logger[_0x087e('0x6b')](util[_0x087e('0x34')](_0x087e('0x75'),_0x4f04cd,_0x2d4d36));return uploadFile(_0x595741,_0x1e4db1,_0xad4d1f,_0x2d4d36,path['basename'](_0x2dcada),fs[_0x087e('0x76')](_0x2dcada))[_0x087e('0x28')](function(_0x3fcf38){logger[_0x087e('0x6b')](util[_0x087e('0x34')](_0x087e('0x77'),_0x4f04cd,_0x2d4d36,_0x3fcf38[_0x087e('0x78')]));_0x276f1c[_0x087e('0x79')]=_0x3fcf38[_0x087e('0x7a')];_0x276f1c[_0x087e('0x7b')]=_0x3fcf38[_0x087e('0x78')];logger[_0x087e('0x6b')](util['format'](_0x087e('0x7c'),_0x4f04cd));return startTranscribe(_0x595741,_0x1e4db1,_0xad4d1f,uuidv4(),_0x1b1039,_0x3fcf38['Location']);})['then'](function(_0x6ee710){logger[_0x087e('0x6b')](util[_0x087e('0x34')](_0x087e('0x7d'),_0x4f04cd,_0x6ee710[_0x087e('0x7e')][_0x087e('0x7f')]));_0x276f1c[_0x087e('0x80')]=_0x6ee710['TranscriptionJob'][_0x087e('0x7f')];_0x276f1c[_0x087e('0x81')]=_0x6ee710[_0x087e('0x7e')][_0x087e('0x82')];return _0x2ec191(_0x276f1c);})[_0x087e('0x4a')](function(_0x4b5edd){return _0xde730b(_0x4b5edd);});});}exports[_0x087e('0x83')]=function(_0x34baaf,_0x2ababa,_0x552cbe){var _0x2b62c8;var _0x364fb2;var _0x18139c;var _0x2ccd21=require(_0x087e('0x84'));return db[_0x087e('0x2f')][_0x087e('0x85')]({'where':{'id':_0x34baaf[_0x087e('0x4c')]['id']}})[_0x087e('0x28')](function(_0x5d0786){if(_0x5d0786){var _0x4b598b=util['format'](_0x087e('0x64'),_0x5d0786[_0x087e('0x53')]);if(fs['existsSync'](_0x4b598b)){cypher=!![];return _0x2ccd21['decryptFile'](_0x4b598b,_0x5d0786[_0x087e('0x53')],config[_0x087e('0x55')]['recording'])[_0x087e('0x28')](function(){return _0x5d0786;});}return _0x5d0786;}})[_0x087e('0x28')](function(_0xd134f9){if(!_0xd134f9){throw new db[(_0x087e('0x57'))][(_0x087e('0x66'))](_0x087e('0x86'));}_0x364fb2=_0xd134f9;return db[_0x087e('0x87')][_0x087e('0x85')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2ababa,null))[_0x087e('0x28')](function(_0x358a74){if(_0x358a74){_0x2b62c8=_0x358a74;if(!_0x2b62c8['transcribe']||!_0x2b62c8[_0x087e('0x88')]||!_0x2b62c8[_0x087e('0x89')]||!_0x2b62c8[_0x087e('0x8a')]||!_0x2b62c8[_0x087e('0x79')]){throw new db[(_0x087e('0x57'))]['ValidationError'](_0x087e('0x8b'));}if(_0x34baaf['body'][_0x087e('0x8c')]&&(!_0x2b62c8['sentiment']||!_0x2b62c8[_0x087e('0x8d')]||!_0x2b62c8['sentimentRegion']||!_0x2b62c8[_0x087e('0x8a')]||!_0x2b62c8[_0x087e('0x79')])){throw new db[(_0x087e('0x57'))]['ValidationError'](_0x087e('0x8e'));}return db['CloudProvider']['findOne']({'where':{'id':_0x2b62c8['transcribeAccountId']}});}})[_0x087e('0x28')](function(_0x2de8e3){if(!_0x2de8e3){throw new db[(_0x087e('0x57'))][(_0x087e('0x66'))](_0x087e('0x8f'));}if(!_0x2de8e3[_0x087e('0x90')]||!_0x2de8e3[_0x087e('0x91')]){throw new db['Sequelize'][(_0x087e('0x66'))](_0x087e('0x92'));}_0x18139c=_0x2de8e3;return getBucketslist(_0x18139c[_0x087e('0x90')],_0x18139c[_0x087e('0x91')],_0x2b62c8[_0x087e('0x89')]);})[_0x087e('0x28')](function(_0x42a22a){if(_0x42a22a&&_0x42a22a[_0x087e('0x93')]){var _0x1c49d2=_[_0x087e('0x4e')](_0x42a22a[_0x087e('0x93')],function(_0x395ae9){return _0x395ae9['Name']===_0x2b62c8['bucket'];});if(!_0x1c49d2){logger[_0x087e('0x6b')](util[_0x087e('0x34')](_0x087e('0x94'),_0x34baaf['params']['id'],_0x2b62c8['bucket']));return createBucket(_0x18139c['data1'],_0x18139c[_0x087e('0x91')],_0x2b62c8[_0x087e('0x89')],_0x2b62c8[_0x087e('0x79')]);}logger[_0x087e('0x6b')](util[_0x087e('0x34')](_0x087e('0x95'),_0x34baaf[_0x087e('0x4c')]['id'],_0x2b62c8[_0x087e('0x79')]));return;}})[_0x087e('0x28')](function(_0xad3ce0){if(_0x364fb2[_0x087e('0x81')]==='NEW'){return transcribe(_0x34baaf['params']['id'],_0x18139c[_0x087e('0x90')],_0x18139c[_0x087e('0x91')],_0x2b62c8[_0x087e('0x89')],_0x2b62c8['bucket'],_0x364fb2[_0x087e('0x53')],_0x2b62c8[_0x087e('0x8a')]);}else{logger[_0x087e('0x6b')](util[_0x087e('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x34baaf[_0x087e('0x4c')]['id']));return{'transcribeStatus':_0x087e('0x96')};}})[_0x087e('0x28')](function(_0x208ac2){if(_0x208ac2){_0x208ac2['tempSentiment']=_0x34baaf['body'][_0x087e('0x8c')];return _0x364fb2[_0x087e('0x97')](_0x208ac2);}})[_0x087e('0x28')](respondWithResult(_0x2ababa,null))[_0x087e('0x4a')](handleError(_0x2ababa,null));};function writeFile(_0x470a92,_0x3b4caf){return new Promise(function(_0x12d493,_0x3cd194){fs['writeFile'](_0x3b4caf,_0x470a92,function(_0xd1612d,_0x3b8a26){if(_0xd1612d){return _0x3cd194(_0xd1612d);}else{return _0x12d493(_0x3b8a26);}});});}exports[_0x087e('0x98')]=function(_0x37ac22,_0x94731a,_0x2b7d42){return db['VoiceRecording'][_0x087e('0x85')]({'where':{'id':_0x37ac22[_0x087e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x94731a))['then'](function(_0x3200fb){if(_0x3200fb&&_0x3200fb[_0x087e('0x99')]){var _0x5df2af=_0x3200fb[_0x087e('0x99')];var _0x3412e8=config['root']+_0x087e('0x9a')+_0x3200fb['id']+_0x087e('0x9b');if(fs[_0x087e('0x65')](_0x3412e8)){return _0x3412e8;}return writeFile(_0x5df2af,_0x3412e8)[_0x087e('0x28')](function(){return _0x3412e8;});}else{throw new db[(_0x087e('0x57'))]['ValidationError'](_0x087e('0x9c'));}})[_0x087e('0x28')](function(_0x25dfa4){return _0x94731a[_0x087e('0x58')](_0x25dfa4);})[_0x087e('0x4a')](handleError(_0x94731a));};
\ No newline at end of file
+var _0x217e=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','uuid/v4','../../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','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','ValidationError','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data1','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x56260c,_0x58ccd5){var _0x12f7c2=function(_0x58d574){while(--_0x58d574){_0x56260c['push'](_0x56260c['shift']());}};_0x12f7c2(++_0x58ccd5);}(_0x217e,0x1d1));var _0xe217=function(_0x3241f3,_0x537340){_0x3241f3=_0x3241f3-0x0;var _0x29ac16=_0x217e[_0x3241f3];return _0x29ac16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe217('0x0'));var zipdir=require(_0xe217('0x1'));var jsonpatch=require(_0xe217('0x2'));var rp=require(_0xe217('0x3'));var moment=require(_0xe217('0x4'));var BPromise=require(_0xe217('0x5'));var Mustache=require(_0xe217('0x6'));var util=require(_0xe217('0x7'));var path=require(_0xe217('0x8'));var sox=require(_0xe217('0x9'));var csv=require(_0xe217('0xa'));var ejs=require(_0xe217('0xb'));var fs=require('fs');var fs_extra=require(_0xe217('0xc'));var _=require(_0xe217('0xd'));var squel=require(_0xe217('0xe'));var crypto=require(_0xe217('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe217('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe217('0x11'));var Papa=require(_0xe217('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0xe217('0x13'));var Redis=require('ioredis');var authService=require(_0xe217('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe217('0x15'));var hardwareService=require(_0xe217('0x16'));var logger=require(_0xe217('0x17'))(_0xe217('0x18'));var utils=require(_0xe217('0x19'));var config=require(_0xe217('0x1a'));var licenseUtil=require(_0xe217('0x1b'));var db=require(_0xe217('0x1c'))['db'];function respondWithStatusCode(_0x64d63,_0x461ee8){_0x461ee8=_0x461ee8||0xcc;return function(_0x4bb2f9){if(_0x4bb2f9){return _0x64d63[_0xe217('0x1d')](_0x461ee8);}return _0x64d63[_0xe217('0x1e')](_0x461ee8)[_0xe217('0x1f')]();};}function respondWithResult(_0x4ffb24,_0x1b15e8){_0x1b15e8=_0x1b15e8||0xc8;return function(_0x30725e){if(_0x30725e){return _0x4ffb24[_0xe217('0x1e')](_0x1b15e8)[_0xe217('0x20')](_0x30725e);}};}function respondWithFilteredResult(_0x406ec9,_0x363fe8){return function(_0x3b2516){if(_0x3b2516){var _0xea1c6c=typeof _0x363fe8[_0xe217('0x21')]===_0xe217('0x22')&&typeof _0x363fe8[_0xe217('0x23')]===_0xe217('0x22');var _0x2f958d=_0x3b2516[_0xe217('0x24')];var _0xefcb35=_0xea1c6c?0x0:_0x363fe8[_0xe217('0x21')];var _0x5f523d=_0xea1c6c?_0x3b2516[_0xe217('0x24')]:_0x363fe8[_0xe217('0x21')]+_0x363fe8[_0xe217('0x23')];var _0x270479;if(_0x5f523d>=_0x2f958d){_0x5f523d=_0x2f958d;_0x270479=0xc8;}else{_0x270479=0xce;}_0x406ec9[_0xe217('0x1e')](_0x270479);return _0x406ec9['set'](_0xe217('0x25'),_0xefcb35+'-'+_0x5f523d+'/'+_0x2f958d)[_0xe217('0x20')](_0x3b2516);}return null;};}function patchUpdates(_0x291d49){return function(_0x17d93b){try{jsonpatch[_0xe217('0x26')](_0x17d93b,_0x291d49,!![]);}catch(_0x2a7967){return BPromise[_0xe217('0x27')](_0x2a7967);}return _0x17d93b[_0xe217('0x28')]();};}function saveUpdates(_0x314975,_0x261e28){return function(_0x41eb9e){if(_0x41eb9e){return _0x41eb9e[_0xe217('0x29')](_0x314975)['then'](function(_0x34c5a0){return _0x34c5a0;});}return null;};}function removeEntity(_0x1d2525,_0x5156f4){return function(_0x19a8c2){if(_0x19a8c2){return _0x19a8c2[_0xe217('0x2a')]()[_0xe217('0x2b')](function(){_0x1d2525[_0xe217('0x1e')](0xcc)[_0xe217('0x1f')]();});}};}function handleEntityNotFound(_0x3fb5d2,_0x4a5fba){return function(_0x3edc3e){if(!_0x3edc3e){_0x3fb5d2[_0xe217('0x1d')](0x194);}return _0x3edc3e;};}function handleError(_0x476cfd,_0x126447){_0x126447=_0x126447||0x1f4;return function(_0xde2d2b){logger[_0xe217('0x2c')](_0xde2d2b[_0xe217('0x2d')]);if(_0xde2d2b[_0xe217('0x2e')]){delete _0xde2d2b['name'];}_0x476cfd['status'](_0x126447)[_0xe217('0x2f')](_0xde2d2b);};}exports['index']=function(_0x515bf6,_0x254a12){var _0x265704={},_0x4a0588={},_0x3fc026={'count':0x0,'rows':[]};var _0x2009dd=_[_0xe217('0x30')](db[_0xe217('0x31')][_0xe217('0x32')],function(_0x264eac){return{'name':_0x264eac[_0xe217('0x33')],'type':_0x264eac[_0xe217('0x34')]['key']};});_0x4a0588[_0xe217('0x35')]=_[_0xe217('0x36')](_['map'](_0x2009dd,'name'),[_0xe217('0x37')]);_0x4a0588[_0xe217('0x38')]=_['keys'](_0x515bf6[_0xe217('0x38')]);_0x4a0588[_0xe217('0x39')]=_['intersection'](_0x4a0588[_0xe217('0x35')],_0x4a0588[_0xe217('0x38')]);_0x265704['attributes']=_['intersection'](_0x4a0588[_0xe217('0x35')],qs[_0xe217('0x3a')](_0x515bf6[_0xe217('0x38')]['fields']));_0x265704['attributes']=_0x265704[_0xe217('0x3b')][_0xe217('0x3c')]?_0x265704['attributes']:_0x4a0588['model'];if(!_0x515bf6[_0xe217('0x38')][_0xe217('0x3d')](_0xe217('0x3e'))){_0x265704[_0xe217('0x23')]=qs['limit'](_0x515bf6[_0xe217('0x38')][_0xe217('0x23')]);_0x265704['offset']=qs[_0xe217('0x21')](_0x515bf6[_0xe217('0x38')][_0xe217('0x21')]);}_0x265704[_0xe217('0x3f')]=qs[_0xe217('0x40')](_0x515bf6['query'][_0xe217('0x40')]);_0x265704[_0xe217('0x41')]=qs[_0xe217('0x39')](_[_0xe217('0x42')](_0x515bf6[_0xe217('0x38')],_0x4a0588[_0xe217('0x39')]),_0x2009dd);if(_0x515bf6[_0xe217('0x38')][_0xe217('0x43')]){_0x265704[_0xe217('0x41')]=_['merge'](_0x265704[_0xe217('0x41')],{'$or':_[_0xe217('0x30')](_0x2009dd,function(_0x8afb04){if(_0x8afb04[_0xe217('0x34')]!==_0xe217('0x44')){var _0x10be0b={};_0x10be0b[_0x8afb04[_0xe217('0x2e')]]={'$like':'%'+_0x515bf6['query']['filter']+'%'};return _0x10be0b;}})});}_0x265704=_[_0xe217('0x45')]({},_0x265704,_0x515bf6[_0xe217('0x46')]);var _0x22f05c={'where':_0x265704[_0xe217('0x41')]};return db['VoiceRecording']['count'](_0x22f05c)[_0xe217('0x2b')](function(_0x1d5df7){_0x3fc026[_0xe217('0x24')]=_0x1d5df7;if(_0x515bf6[_0xe217('0x38')][_0xe217('0x47')]){_0x265704[_0xe217('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0xe217('0x49')](_0x265704);})['then'](function(_0x208d95){_0x3fc026[_0xe217('0x4a')]=_0x208d95;return _0x3fc026;})[_0xe217('0x2b')](respondWithFilteredResult(_0x254a12,_0x265704))[_0xe217('0x4b')](handleError(_0x254a12,null));};exports[_0xe217('0x4c')]=function(_0x258472,_0x5885ec){var _0x24a098={'raw':![],'where':{'id':_0x258472[_0xe217('0x4d')]['id']}},_0x3bdd73={};_0x3bdd73[_0xe217('0x35')]=_[_0xe217('0x4e')](db[_0xe217('0x31')][_0xe217('0x32')]);_0x3bdd73[_0xe217('0x38')]=_['keys'](_0x258472[_0xe217('0x38')]);_0x3bdd73[_0xe217('0x39')]=_[_0xe217('0x4f')](_0x3bdd73[_0xe217('0x35')],_0x3bdd73[_0xe217('0x38')]);_0x24a098[_0xe217('0x3b')]=_[_0xe217('0x4f')](_0x3bdd73[_0xe217('0x35')],qs[_0xe217('0x3a')](_0x258472['query'][_0xe217('0x3a')]));_0x24a098[_0xe217('0x3b')]=_0x24a098[_0xe217('0x3b')]['length']?_0x24a098[_0xe217('0x3b')]:_0x3bdd73[_0xe217('0x35')];if(_0x258472['query'][_0xe217('0x47')]){_0x24a098[_0xe217('0x48')]=[{'all':!![]}];}_0x24a098=_[_0xe217('0x45')]({},_0x24a098,_0x258472[_0xe217('0x46')]);return db[_0xe217('0x31')][_0xe217('0x50')](_0x24a098)[_0xe217('0x2b')](handleEntityNotFound(_0x5885ec,null))['then'](respondWithResult(_0x5885ec,null))['catch'](handleError(_0x5885ec,null));};exports[_0xe217('0x51')]=function(_0x5c0db4,_0x1e4334){return db['VoiceRecording'][_0xe217('0x51')](_0x5c0db4[_0xe217('0x52')],{})['then'](respondWithResult(_0x1e4334,0xc9))[_0xe217('0x4b')](handleError(_0x1e4334,null));};exports[_0xe217('0x29')]=function(_0x37d278,_0x1d36a8){if(_0x37d278[_0xe217('0x52')]['id']){delete _0x37d278[_0xe217('0x52')]['id'];}return db['VoiceRecording'][_0xe217('0x50')]({'where':{'id':_0x37d278[_0xe217('0x4d')]['id']}})[_0xe217('0x2b')](handleEntityNotFound(_0x1d36a8,null))[_0xe217('0x2b')](saveUpdates(_0x37d278[_0xe217('0x52')],null))['then'](respondWithResult(_0x1d36a8,null))[_0xe217('0x4b')](handleError(_0x1d36a8,null));};exports['describe']=function(_0x4313c3,_0x196b51){return db[_0xe217('0x31')][_0xe217('0x53')]()[_0xe217('0x2b')](respondWithResult(_0x196b51,null))[_0xe217('0x4b')](handleError(_0x196b51,null));};exports[_0xe217('0x54')]=function(_0x430a97,_0x14562d,_0x226d11){var _0x352a77=require(_0xe217('0x55'));var _0x590aba=![];var _0x48af3d={};if(_0x430a97[_0xe217('0x38')][_0xe217('0x34')]&&_0x430a97[_0xe217('0x38')][_0xe217('0x34')]===_0xe217('0x56')){_0x48af3d[_0xe217('0x56')]=_0x430a97[_0xe217('0x4d')]['id'];}else{_0x48af3d['id']=_0x430a97[_0xe217('0x4d')]['id'];}return db['VoiceRecording'][_0xe217('0x50')]({'where':_0x48af3d,'attributes':['id','value'],'raw':!![]})[_0xe217('0x2b')](handleEntityNotFound(_0x14562d,null))[_0xe217('0x2b')](function(_0xa6f3b5){if(_0xa6f3b5){var _0xa656b7=_0xa6f3b5[_0xe217('0x57')];var _0x58791f=util['format'](_0xe217('0x58'),_0xa656b7);if(fs[_0xe217('0x59')](_0x58791f)){_0x590aba=!![];return _0x352a77[_0xe217('0x5a')](_0x58791f,_0xa656b7,config[_0xe217('0x5b')][_0xe217('0x5c')])[_0xe217('0x2b')](function(){return _0xa6f3b5;});}return _0xa6f3b5;}})[_0xe217('0x2b')](function(_0x409290){if(_0x409290){var _0x2715f7=_0x409290[_0xe217('0x57')];if(!fs['existsSync'](_0x2715f7)){throw new db[(_0xe217('0x5d'))]['ValidationError'](_0xe217('0x5e'));}if(_0x409290[_0xe217('0x5f')]){return _0x14562d['download'](_0x2715f7,_0x409290[_0xe217('0x5f')]+path[_0xe217('0x60')](_0x2715f7),function(){if(_0x590aba){fs[_0xe217('0x61')](_0x2715f7);}});}else{return _0x14562d[_0xe217('0x54')](_0x2715f7,function(_0x3296d9){if(_0x590aba){fs[_0xe217('0x61')](_0x2715f7);}});}}})[_0xe217('0x4b')](function(_0x1f3d35){if(_0x1f3d35[_0xe217('0x62')]===_0xe217('0x5e')){_0x14562d['status'](0x194)[_0xe217('0x2f')](_0xe217('0x63'));}else{return handleError(_0x14562d,null);}});};exports[_0xe217('0x64')]=function(_0x554b15,_0x2581f7,_0x3dc4e0){var _0x4c6d61=require(_0xe217('0x55'));var _0x416b60=![];var _0x6ed333={'$and':[db[_0xe217('0x65')][_0xe217('0x41')](db['sequelize']['fn'](_0xe217('0x66'),db[_0xe217('0x65')][_0xe217('0x67')](_0xe217('0x56'))),_0x554b15['query'][_0xe217('0x68')])]};if(_0x554b15['query']['type']&&_0x554b15[_0xe217('0x38')][_0xe217('0x34')]===_0xe217('0x56')){_0x6ed333[_0xe217('0x69')][_0xe217('0x6a')]({'uniqueid':_0x554b15[_0xe217('0x4d')]['id']});}else{_0x6ed333[_0xe217('0x69')][_0xe217('0x6a')]({'id':_0x554b15['params']['id']});}return db[_0xe217('0x31')][_0xe217('0x50')]({'where':_0x6ed333,'attributes':['id',_0xe217('0x57')],'raw':!![]})[_0xe217('0x2b')](handleEntityNotFound(_0x2581f7,null))[_0xe217('0x2b')](function(_0x323da3){if(_0x323da3){var _0x4c4e6f=util[_0xe217('0x37')](_0xe217('0x58'),_0x323da3[_0xe217('0x57')]);if(fs['existsSync'](_0x4c4e6f)){_0x416b60=!![];return _0x4c6d61['decryptFile'](_0x4c4e6f,_0x323da3[_0xe217('0x57')],config[_0xe217('0x5b')][_0xe217('0x5c')])[_0xe217('0x2b')](function(){return _0x323da3;});}return _0x323da3;}})['then'](function(_0x38963e){if(_0x38963e){if(!fs[_0xe217('0x59')](_0x38963e[_0xe217('0x57')])){throw new db[(_0xe217('0x5d'))][(_0xe217('0x6b'))](_0xe217('0x5e'));}if(_0x38963e[_0xe217('0x5f')]){return _0x2581f7[_0xe217('0x54')](_0x38963e[_0xe217('0x57')],_0x38963e[_0xe217('0x5f')]+path[_0xe217('0x60')](_0x38963e[_0xe217('0x57')]),function(){if(_0x416b60){fs[_0xe217('0x61')](_0x38963e[_0xe217('0x57')]);}});}else{return _0x2581f7[_0xe217('0x54')](_0x38963e[_0xe217('0x57')],function(_0x1b464b){if(_0x416b60){fs[_0xe217('0x61')](_0x38963e['value']);}});}}})[_0xe217('0x4b')](handleError(_0x2581f7,null));};exports[_0xe217('0x2a')]=function(_0x2fef84,_0x2cd471){return db[_0xe217('0x31')][_0xe217('0x50')]({'where':{'id':_0x2fef84[_0xe217('0x4d')]['id']}})['then'](function(_0x2b4b3e){if(_[_0xe217('0x6c')](_0x2b4b3e)){throw new ReferenceError(_0xe217('0x6d'));}return _0x2b4b3e;})[_0xe217('0x2b')](function(_0x53ab8b){var _0x175edb=_0x53ab8b[_0xe217('0x57')];logger[_0xe217('0x6e')]('cancellazione\x20fisica\x20documento\x20%s',_0x175edb);if(!_['isNil'](_0x53ab8b[_0xe217('0x57')])&&fs[_0xe217('0x59')](_0x175edb)){logger[_0xe217('0x6e')]('File:\x20\x22'+_0x175edb+_0xe217('0x6f'));fs[_0xe217('0x70')](_0x175edb);}_0x175edb=_0x175edb+_0xe217('0x71');if(!_['isNil'](_0x53ab8b[_0xe217('0x57')])&&fs[_0xe217('0x59')](_0x175edb)){logger[_0xe217('0x6e')]('File:\x20\x22'+_0x175edb+_0xe217('0x6f'));fs['unlinkSync'](_0x175edb);}return _0x53ab8b;})['then'](function(_0x2b6269){if(!_0x2b6269)throw new InternalError();return _0x2b6269[_0xe217('0x2a')]();})['then'](function(){_0x2cd471['status'](0xcc)['end']();})[_0xe217('0x4b')](handleError(_0x2cd471,null));};function getBucketslist(_0x193840,_0xa9f2e0,_0x2b9228){return new Promise(function(_0x25a156,_0x27949c){var _0x2fbed6=new AWS['S3']({'accessKeyId':_0xa9f2e0,'secretAccessKey':_0x193840,'region':_0x2b9228});_0x2fbed6[_0xe217('0x72')]({},function(_0x29807d,_0xa9f8a3){if(_0x29807d){return _0x27949c(_0x29807d);}else{return _0x25a156(_0xa9f8a3);}});});}function createBucket(_0x353311,_0x4aa4c7,_0x4f4890,_0x15a79c){return new Promise(function(_0x1a054d,_0x334d1e){var _0x7c53a7=new AWS['S3']({'accessKeyId':_0x4aa4c7,'secretAccessKey':_0x353311,'region':_0x4f4890});_0x7c53a7[_0xe217('0x73')]({'Bucket':_0x15a79c},function(_0x39a3d4,_0x5ade6f){if(_0x39a3d4){return _0x334d1e(_0x39a3d4);}else{return _0x1a054d(_0x5ade6f);}});});}function uploadFile(_0x34fb6b,_0x107cb7,_0x308c33,_0x4303cd,_0x19bd80,_0x3225a3){return new Promise(function(_0x51920f,_0x556008){var _0x24a4a3=new AWS['S3']({'accessKeyId':_0x107cb7,'secretAccessKey':_0x34fb6b,'region':_0x308c33});_0x24a4a3['upload']({'Bucket':_0x4303cd,'Key':_0x19bd80,'Body':_0x3225a3},function(_0x5782a6,_0x15e2aa){if(_0x5782a6){return _0x556008(_0x5782a6);}else{return _0x51920f(_0x15e2aa);}});});}function startTranscribe(_0x39a5cb,_0x12d0ff,_0x3c50cb,_0x27e41f,_0x49af7a,_0x13f97c){return new Promise(function(_0x2f15b5,_0x96ca2d){var _0x1733ec=new AWS['TranscribeService']({'accessKeyId':_0x12d0ff,'secretAccessKey':_0x39a5cb,'region':_0x3c50cb});_0x1733ec[_0xe217('0x74')]({'TranscriptionJobName':_0x27e41f,'LanguageCode':_0x49af7a,'Media':{'MediaFileUri':_0x13f97c}},function(_0x266096,_0x2720cd){if(_0x266096){return _0x96ca2d(_0x266096);}else{return _0x2f15b5(_0x2720cd);}});});}function transcribe(_0x1f3af8,_0x41e6e3,_0xedf2d7,_0x437a2b,_0x42070e,_0x45ffe7,_0x339a3d){return new Promise(function(_0x58d3b0,_0x25281a){var _0x5d5405={};logger[_0xe217('0x6e')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x1f3af8,_0x42070e));return uploadFile(_0x41e6e3,_0xedf2d7,_0x437a2b,_0x42070e,path[_0xe217('0x75')](_0x45ffe7),fs[_0xe217('0x76')](_0x45ffe7))[_0xe217('0x2b')](function(_0xf64586){logger[_0xe217('0x6e')](util[_0xe217('0x37')](_0xe217('0x77'),_0x1f3af8,_0x42070e,_0xf64586[_0xe217('0x78')]));_0x5d5405[_0xe217('0x79')]=_0xf64586['Bucket'];_0x5d5405[_0xe217('0x7a')]=_0xf64586[_0xe217('0x78')];logger['info'](util['format'](_0xe217('0x7b'),_0x1f3af8));return startTranscribe(_0x41e6e3,_0xedf2d7,_0x437a2b,uuidv4(),_0x339a3d,_0xf64586['Location']);})[_0xe217('0x2b')](function(_0x2d5975){logger[_0xe217('0x6e')](util[_0xe217('0x37')](_0xe217('0x7c'),_0x1f3af8,_0x2d5975[_0xe217('0x7d')][_0xe217('0x7e')]));_0x5d5405[_0xe217('0x7f')]=_0x2d5975[_0xe217('0x7d')]['TranscriptionJobName'];_0x5d5405[_0xe217('0x80')]=_0x2d5975['TranscriptionJob']['TranscriptionJobStatus'];return _0x58d3b0(_0x5d5405);})[_0xe217('0x4b')](function(_0x433e06){return _0x25281a(_0x433e06);});});}exports['runTranscribe']=function(_0x4d3076,_0x340973,_0x3bd5b5){var _0xfef7b6;var _0x48a324;var _0x1e22f2;var _0x296b57=require(_0xe217('0x55'));return db['VoiceRecording'][_0xe217('0x81')]({'where':{'id':_0x4d3076[_0xe217('0x4d')]['id']}})[_0xe217('0x2b')](function(_0x55d9ac){if(_0x55d9ac){var _0x3140f0=util[_0xe217('0x37')]('%s.cypher',_0x55d9ac[_0xe217('0x57')]);if(fs['existsSync'](_0x3140f0)){cypher=!![];return _0x296b57[_0xe217('0x5a')](_0x3140f0,_0x55d9ac[_0xe217('0x57')],config[_0xe217('0x5b')][_0xe217('0x5c')])[_0xe217('0x2b')](function(){return _0x55d9ac;});}return _0x55d9ac;}})[_0xe217('0x2b')](function(_0x2c5d66){if(!_0x2c5d66){throw new db[(_0xe217('0x5d'))][(_0xe217('0x6b'))](_0xe217('0x82'));}_0x48a324=_0x2c5d66;return db[_0xe217('0x83')]['findOne']({'where':{'id':0x1}});})[_0xe217('0x2b')](handleEntityNotFound(_0x340973,null))[_0xe217('0x2b')](function(_0x47f93f){if(_0x47f93f){_0xfef7b6=_0x47f93f;if(!_0xfef7b6['transcribe']||!_0xfef7b6[_0xe217('0x84')]||!_0xfef7b6[_0xe217('0x85')]||!_0xfef7b6[_0xe217('0x86')]||!_0xfef7b6['bucket']){throw new db[(_0xe217('0x5d'))][(_0xe217('0x6b'))](_0xe217('0x87'));}if(_0x4d3076['body'][_0xe217('0x88')]&&(!_0xfef7b6[_0xe217('0x89')]||!_0xfef7b6[_0xe217('0x8a')]||!_0xfef7b6['sentimentRegion']||!_0xfef7b6[_0xe217('0x86')]||!_0xfef7b6[_0xe217('0x79')])){throw new db[(_0xe217('0x5d'))][(_0xe217('0x6b'))](_0xe217('0x8b'));}return db['CloudProvider'][_0xe217('0x81')]({'where':{'id':_0xfef7b6[_0xe217('0x84')]}});}})['then'](function(_0x494c95){if(!_0x494c95){throw new db['Sequelize']['ValidationError'](_0xe217('0x8c'));}if(!_0x494c95['data1']||!_0x494c95[_0xe217('0x8d')]){throw new db[(_0xe217('0x5d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x1e22f2=_0x494c95;return getBucketslist(_0x1e22f2['data1'],_0x1e22f2[_0xe217('0x8d')],_0xfef7b6[_0xe217('0x85')]);})[_0xe217('0x2b')](function(_0x37b49f){if(_0x37b49f&&_0x37b49f[_0xe217('0x8e')]){var _0x5e352a=_[_0xe217('0x50')](_0x37b49f[_0xe217('0x8e')],function(_0x383d56){return _0x383d56[_0xe217('0x8f')]===_0xfef7b6[_0xe217('0x79')];});if(!_0x5e352a){logger['info'](util[_0xe217('0x37')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4d3076[_0xe217('0x4d')]['id'],_0xfef7b6[_0xe217('0x79')]));return createBucket(_0x1e22f2['data1'],_0x1e22f2[_0xe217('0x8d')],_0xfef7b6[_0xe217('0x85')],_0xfef7b6[_0xe217('0x79')]);}logger['info'](util[_0xe217('0x37')](_0xe217('0x90'),_0x4d3076[_0xe217('0x4d')]['id'],_0xfef7b6['bucket']));return;}})[_0xe217('0x2b')](function(_0x51e517){if(_0x48a324[_0xe217('0x80')]===_0xe217('0x91')){return transcribe(_0x4d3076['params']['id'],_0x1e22f2[_0xe217('0x92')],_0x1e22f2[_0xe217('0x8d')],_0xfef7b6[_0xe217('0x85')],_0xfef7b6['bucket'],_0x48a324[_0xe217('0x57')],_0xfef7b6[_0xe217('0x86')]);}else{logger['info'](util[_0xe217('0x37')](_0xe217('0x93'),_0x4d3076[_0xe217('0x4d')]['id']));return{'transcribeStatus':_0xe217('0x94')};}})[_0xe217('0x2b')](function(_0xd25980){if(_0xd25980){_0xd25980[_0xe217('0x95')]=_0x4d3076[_0xe217('0x52')][_0xe217('0x88')];return _0x48a324[_0xe217('0x96')](_0xd25980);}})[_0xe217('0x2b')](respondWithResult(_0x340973,null))[_0xe217('0x4b')](handleError(_0x340973,null));};function writeFile(_0x40f54b,_0x4c63b3){return new Promise(function(_0x3c1816,_0x5b2c42){fs[_0xe217('0x97')](_0x4c63b3,_0x40f54b,function(_0x86eb64,_0x9c3465){if(_0x86eb64){return _0x5b2c42(_0x86eb64);}else{return _0x3c1816(_0x9c3465);}});});}exports[_0xe217('0x98')]=function(_0x55a2ca,_0x4a8c75,_0x1957a8){return db['VoiceRecording'][_0xe217('0x81')]({'where':{'id':_0x55a2ca[_0xe217('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a8c75))[_0xe217('0x2b')](function(_0x3ec860){if(_0x3ec860&&_0x3ec860['fileText']){var _0x4dd341=_0x3ec860[_0xe217('0x99')];var _0x28a353=config[_0xe217('0x9a')]+_0xe217('0x9b')+_0x3ec860['id']+'.txt';if(fs[_0xe217('0x59')](_0x28a353)){return _0x28a353;}return writeFile(_0x4dd341,_0x28a353)[_0xe217('0x2b')](function(){return _0x28a353;});}else{throw new db[(_0xe217('0x5d'))][(_0xe217('0x6b'))](_0xe217('0x9c'));}})[_0xe217('0x2b')](function(_0x110343){return _0x4a8c75[_0xe217('0x54')](_0x110343);})[_0xe217('0x4b')](handleError(_0x4a8c75));};
\ No newline at end of file
index 3822611..62a1802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['voice_recordings','uniqueid','transcribeStatus','define'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x01d3,0xdb));var _0x301d=function(_0x5b50f2,_0x35a265){_0x5b50f2=_0x5b50f2-0x0;var _0x5d967d=_0x01d3[_0x5b50f2];return _0x5d967d;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x3107c5,_0x2da4e){return _0x3107c5[_0x301d('0x0')]('VoiceRecording',attributes,{'tableName':_0x301d('0x1'),'paranoid':![],'indexes':[{'name':_0x301d('0x2'),'fields':[_0x301d('0x2')]},{'name':_0x301d('0x3'),'fields':[_0x301d('0x3')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc73=['VoiceRecording','uniqueid','transcribeStatus','exports'];(function(_0x1111ca,_0x589ef5){var _0x4baa5=function(_0x5cacf2){while(--_0x5cacf2){_0x1111ca['push'](_0x1111ca['shift']());}};_0x4baa5(++_0x589ef5);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcc73[_0x2b4411];return _0x8e41ef;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x3cc7('0x0')]=function(_0x4f5793,_0x59ba41){return _0x4f5793['define'](_0x3cc7('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3cc7('0x2'),'fields':['uniqueid']},{'name':'transcribeStatus','fields':[_0x3cc7('0x3')]}],'timestamps':!![]});};
\ No newline at end of file
index 3a1ada5..4980c17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x5e5a0e,_0xf3cfbf){var _0x557678=function(_0x1e154c){while(--_0x1e154c){_0x5e5a0e['push'](_0x5e5a0e['shift']());}};_0x557678(++_0xf3cfbf);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});};
\ No newline at end of file
+var _0x7a54=['../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','encryptFile','secrets','unlink','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceRecording','update','body','options','raw','where','attributes','limit','then','UpdateVoiceRecording','CreateVoiceRecording'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x7a54,0x106));var _0x47a5=function(_0x5ed145,_0x38b4d7){_0x5ed145=_0x5ed145-0x0;var _0x222c89=_0x7a54[_0x5ed145];return _0x222c89;};'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')]('VoiceRecording,\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['UpdateVoiceRecording']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateVoiceRecording',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});};exports[_0x47a5('0x1f')]=function(_0x5686db){var _0x1ea9c8=this;return new Promise(function(_0x5b6c4e,_0x23cb77){var _0x378208=require(_0x47a5('0x20'));var _0x1dac65;return db[_0x47a5('0x21')][_0x47a5('0x22')]({'attributes':['id',_0x47a5('0x23')],'where':{'id':0x1},'raw':!![]})[_0x47a5('0x1d')](function(_0x16631f){_0x1dac65=_0x16631f;return db[_0x47a5('0x15')][_0x47a5('0x24')](_0x5686db[_0x47a5('0x17')]);})[_0x47a5('0x1d')](function(_0x528582){if(_0x1dac65[_0x47a5('0x23')]&&fs['existsSync'](_0x528582[_0x47a5('0x25')])){var _0x9ac908=util[_0x47a5('0x26')]('%s.cypher',_0x528582[_0x47a5('0x25')]);return _0x378208[_0x47a5('0x27')](_0x528582[_0x47a5('0x25')],_0x9ac908,config[_0x47a5('0x28')]['recording'])['then'](function(){fs[_0x47a5('0x29')](_0x528582[_0x47a5('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x528582;});}return _0x528582;})[_0x47a5('0x1d')](function(_0x51544e){logger['info'](_0x47a5('0x1f'),_0x5686db);logger['debug'](_0x47a5('0x1f'),_0x5686db,JSON[_0x47a5('0xe')](_0x51544e));_0x5b6c4e(_0x51544e);})['catch'](function(_0x4843c0){logger[_0x47a5('0xf')]('CreateVoiceRecording',_0x4843c0[_0x47a5('0x11')],_0x5686db);_0x23cb77(_0x1ea9c8[_0x47a5('0xf')](0x1f4,_0x4843c0[_0x47a5('0x11')]));});});};
\ No newline at end of file
index a0e2568..c60e351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9858=['describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9858,0x17f));var _0x8985=function(_0x465701,_0x2f2d11){_0x465701=_0x465701-0x0;var _0x2479f0=_0x9858[_0x465701];return _0x2479f0;};'use strict';var multer=require(_0x8985('0x0'));var util=require(_0x8985('0x1'));var path=require(_0x8985('0x2'));var timeout=require('connect-timeout');var express=require(_0x8985('0x3'));var router=express[_0x8985('0x4')]();var fs_extra=require(_0x8985('0x5'));var auth=require(_0x8985('0x6'));var interaction=require(_0x8985('0x7'));var config=require(_0x8985('0x8'));var controller=require(_0x8985('0x9'));router[_0x8985('0xa')]('/',auth['isAuthenticated'](),controller[_0x8985('0xb')]);router[_0x8985('0xa')]('/describe',auth[_0x8985('0xc')](),controller[_0x8985('0xd')]);router[_0x8985('0xa')](_0x8985('0xe'),auth['isAuthenticated'](),controller[_0x8985('0xf')]);router[_0x8985('0x10')]('/',auth[_0x8985('0xc')](),controller[_0x8985('0x11')]);router['put'](_0x8985('0xe'),auth[_0x8985('0xc')](),controller[_0x8985('0x12')]);router[_0x8985('0x13')](_0x8985('0xe'),auth[_0x8985('0xc')](),controller[_0x8985('0x14')]);module[_0x8985('0x15')]=router;
\ No newline at end of file
+var _0xcddf=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x433e25,_0x37a0d2){var _0x1c1370=function(_0x461768){while(--_0x461768){_0x433e25['push'](_0x433e25['shift']());}};_0x1c1370(++_0x37a0d2);}(_0xcddf,0x7a));var _0xfcdd=function(_0x3e3136,_0x12c224){_0x3e3136=_0x3e3136-0x0;var _0x589ffe=_0xcddf[_0x3e3136];return _0x589ffe;};'use strict';var multer=require(_0xfcdd('0x0'));var util=require(_0xfcdd('0x1'));var path=require(_0xfcdd('0x2'));var timeout=require(_0xfcdd('0x3'));var express=require('express');var router=express[_0xfcdd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfcdd('0x5'));var interaction=require(_0xfcdd('0x6'));var config=require(_0xfcdd('0x7'));var controller=require(_0xfcdd('0x8'));router[_0xfcdd('0x9')]('/',auth['isAuthenticated'](),controller[_0xfcdd('0xa')]);router['get']('/describe',auth[_0xfcdd('0xb')](),controller[_0xfcdd('0xc')]);router[_0xfcdd('0x9')](_0xfcdd('0xd'),auth[_0xfcdd('0xb')](),controller[_0xfcdd('0xe')]);router[_0xfcdd('0xf')]('/',auth[_0xfcdd('0xb')](),controller[_0xfcdd('0x10')]);router[_0xfcdd('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfcdd('0x12')]);router[_0xfcdd('0x13')]('/:id',auth[_0xfcdd('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 546a283..4331319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22e3=['moment','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x280d42,_0x43ae2f){var _0x25877b=function(_0x526491){while(--_0x526491){_0x280d42['push'](_0x280d42['shift']());}};_0x25877b(++_0x43ae2f);}(_0x22e3,0x117));var _0x322e=function(_0x293f10,_0x1b950b){_0x293f10=_0x293f10-0x0;var _0x174d25=_0x22e3[_0x293f10];return _0x174d25;};'use strict';var Sequelize=require(_0x322e('0x0'));var moment=require(_0x322e('0x1'));module['exports']={'type':{'type':Sequelize[_0x322e('0x2')](_0x322e('0x3'),_0x322e('0x4'))},'result':{'type':Sequelize[_0x322e('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x322e('0x5')]},'transferercalleridname':{'type':Sequelize[_0x322e('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x322e('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x322e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x322e('0x5')]},'transfereechannel':{'type':Sequelize[_0x322e('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x322e('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x322e('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x322e('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x322e('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x322e('0x5')]},'transfereecontext':{'type':Sequelize[_0x322e('0x5')]},'transfereeexten':{'type':Sequelize[_0x322e('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x322e('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x322e('0x6'),'No')},'context':{'type':Sequelize[_0x322e('0x5')]},'extension':{'type':Sequelize[_0x322e('0x5')]}};
\ No newline at end of file
+var _0x744a=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x744a,0x1d0));var _0xa744=function(_0x478e9a,_0x304a98){_0x478e9a=_0x478e9a-0x0;var _0x1ab8b1=_0x744a[_0x478e9a];return _0x1ab8b1;};'use strict';var Sequelize=require(_0xa744('0x0'));var moment=require(_0xa744('0x1'));module[_0xa744('0x2')]={'type':{'type':Sequelize[_0xa744('0x3')](_0xa744('0x4'),'attended')},'result':{'type':Sequelize[_0xa744('0x5')]},'transfererchannel':{'type':Sequelize[_0xa744('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xa744('0x5')]},'transferercalleridname':{'type':Sequelize[_0xa744('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa744('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xa744('0x5')]},'transferercontext':{'type':Sequelize[_0xa744('0x5')]},'transfererexten':{'type':Sequelize[_0xa744('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xa744('0x5')]},'transfereechannel':{'type':Sequelize[_0xa744('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xa744('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xa744('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa744('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa744('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xa744('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa744('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xa744('0x5')]},'isexternal':{'type':Sequelize[_0xa744('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xa744('0x5')]},'extension':{'type':Sequelize[_0xa744('0x5')]}};
\ No newline at end of file
index 64373f0..5111dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa808=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5554e6,_0x4e220f){var _0x1d7301=function(_0x48bc71){while(--_0x48bc71){_0x5554e6['push'](_0x5554e6['shift']());}};_0x1d7301(++_0x4e220f);}(_0xa808,0x1dc));var _0x8a80=function(_0x5d53fd,_0x26dace){_0x5d53fd=_0x5d53fd-0x0;var _0x1592c7=_0xa808[_0x5d53fd];return _0x1592c7;};'use strict';var emlformat=require(_0x8a80('0x0'));var rimraf=require(_0x8a80('0x1'));var zipdir=require(_0x8a80('0x2'));var jsonpatch=require(_0x8a80('0x3'));var rp=require(_0x8a80('0x4'));var moment=require(_0x8a80('0x5'));var BPromise=require(_0x8a80('0x6'));var Mustache=require(_0x8a80('0x7'));var util=require('util');var path=require(_0x8a80('0x8'));var sox=require(_0x8a80('0x9'));var csv=require(_0x8a80('0xa'));var ejs=require(_0x8a80('0xb'));var fs=require('fs');var fs_extra=require(_0x8a80('0xc'));var _=require(_0x8a80('0xd'));var squel=require(_0x8a80('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a80('0xf'));var toCsv=require(_0x8a80('0xa'));var querystring=require(_0x8a80('0x10'));var Papa=require(_0x8a80('0x11'));var Redis=require(_0x8a80('0x12'));var authService=require(_0x8a80('0x13'));var qs=require(_0x8a80('0x14'));var as=require(_0x8a80('0x15'));var hardwareService=require(_0x8a80('0x16'));var logger=require(_0x8a80('0x17'))(_0x8a80('0x18'));var utils=require(_0x8a80('0x19'));var config=require(_0x8a80('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a80('0x1b'))['db'];function respondWithStatusCode(_0x207836,_0x480e0e){_0x480e0e=_0x480e0e||0xcc;return function(_0x48aea6){if(_0x48aea6){return _0x207836[_0x8a80('0x1c')](_0x480e0e);}return _0x207836[_0x8a80('0x1d')](_0x480e0e)[_0x8a80('0x1e')]();};}function respondWithResult(_0x51d729,_0x532bfc){_0x532bfc=_0x532bfc||0xc8;return function(_0x235733){if(_0x235733){return _0x51d729[_0x8a80('0x1d')](_0x532bfc)[_0x8a80('0x1f')](_0x235733);}};}function respondWithFilteredResult(_0x47d73e,_0x45702e){return function(_0x39d7b1){if(_0x39d7b1){var _0x184e96=typeof _0x45702e[_0x8a80('0x20')]===_0x8a80('0x21')&&typeof _0x45702e[_0x8a80('0x22')]===_0x8a80('0x21');var _0x3ab814=_0x39d7b1[_0x8a80('0x23')];var _0x1807c8=_0x184e96?0x0:_0x45702e['offset'];var _0x2a041e=_0x184e96?_0x39d7b1[_0x8a80('0x23')]:_0x45702e[_0x8a80('0x20')]+_0x45702e['limit'];var _0x2f6dc7;if(_0x2a041e>=_0x3ab814){_0x2a041e=_0x3ab814;_0x2f6dc7=0xc8;}else{_0x2f6dc7=0xce;}_0x47d73e[_0x8a80('0x1d')](_0x2f6dc7);return _0x47d73e[_0x8a80('0x24')](_0x8a80('0x25'),_0x1807c8+'-'+_0x2a041e+'/'+_0x3ab814)[_0x8a80('0x1f')](_0x39d7b1);}return null;};}function patchUpdates(_0x38cfbb){return function(_0x1d18f2){try{jsonpatch[_0x8a80('0x26')](_0x1d18f2,_0x38cfbb,!![]);}catch(_0x346870){return BPromise['reject'](_0x346870);}return _0x1d18f2[_0x8a80('0x27')]();};}function saveUpdates(_0x41c7b3,_0x4a22bb){return function(_0x33ebcd){if(_0x33ebcd){return _0x33ebcd[_0x8a80('0x28')](_0x41c7b3)[_0x8a80('0x29')](function(_0x2305e8){return _0x2305e8;});}return null;};}function removeEntity(_0x13b74f,_0x4cabda){return function(_0x7d6cca){if(_0x7d6cca){return _0x7d6cca[_0x8a80('0x2a')]()['then'](function(){_0x13b74f[_0x8a80('0x1d')](0xcc)[_0x8a80('0x1e')]();});}};}function handleEntityNotFound(_0x272602,_0x374e31){return function(_0x2da688){if(!_0x2da688){_0x272602[_0x8a80('0x1c')](0x194);}return _0x2da688;};}function handleError(_0x5802eb,_0x2268d1){_0x2268d1=_0x2268d1||0x1f4;return function(_0x3eb711){logger[_0x8a80('0x2b')](_0x3eb711[_0x8a80('0x2c')]);if(_0x3eb711[_0x8a80('0x2d')]){delete _0x3eb711[_0x8a80('0x2d')];}_0x5802eb[_0x8a80('0x1d')](_0x2268d1)[_0x8a80('0x2e')](_0x3eb711);};}exports[_0x8a80('0x2f')]=function(_0x308100,_0x2dce6e){var _0x205b20={},_0x228c89={},_0x422e2e={'count':0x0,'rows':[]};var _0x2dfbb5=_[_0x8a80('0x30')](db[_0x8a80('0x31')]['rawAttributes'],function(_0x4ea11d){return{'name':_0x4ea11d[_0x8a80('0x32')],'type':_0x4ea11d['type']['key']};});_0x228c89[_0x8a80('0x33')]=_['map'](_0x2dfbb5,_0x8a80('0x2d'));_0x228c89[_0x8a80('0x34')]=_[_0x8a80('0x35')](_0x308100[_0x8a80('0x34')]);_0x228c89[_0x8a80('0x36')]=_['intersection'](_0x228c89['model'],_0x228c89['query']);_0x205b20['attributes']=_[_0x8a80('0x37')](_0x228c89[_0x8a80('0x33')],qs[_0x8a80('0x38')](_0x308100[_0x8a80('0x34')][_0x8a80('0x38')]));_0x205b20['attributes']=_0x205b20[_0x8a80('0x39')][_0x8a80('0x3a')]?_0x205b20[_0x8a80('0x39')]:_0x228c89[_0x8a80('0x33')];if(!_0x308100['query'][_0x8a80('0x3b')](_0x8a80('0x3c'))){_0x205b20[_0x8a80('0x22')]=qs[_0x8a80('0x22')](_0x308100[_0x8a80('0x34')][_0x8a80('0x22')]);_0x205b20[_0x8a80('0x20')]=qs[_0x8a80('0x20')](_0x308100[_0x8a80('0x34')][_0x8a80('0x20')]);}_0x205b20[_0x8a80('0x3d')]=qs[_0x8a80('0x3e')](_0x308100[_0x8a80('0x34')][_0x8a80('0x3e')]);_0x205b20[_0x8a80('0x3f')]=qs[_0x8a80('0x36')](_[_0x8a80('0x40')](_0x308100[_0x8a80('0x34')],_0x228c89[_0x8a80('0x36')]),_0x2dfbb5);if(_0x308100[_0x8a80('0x34')][_0x8a80('0x41')]){_0x205b20['where']=_['merge'](_0x205b20['where'],{'$or':_[_0x8a80('0x30')](_0x2dfbb5,function(_0x45b96c){if(_0x45b96c[_0x8a80('0x42')]!=='VIRTUAL'){var _0x351646={};_0x351646[_0x45b96c['name']]={'$like':'%'+_0x308100['query'][_0x8a80('0x41')]+'%'};return _0x351646;}})});}_0x205b20=_[_0x8a80('0x43')]({},_0x205b20,_0x308100[_0x8a80('0x44')]);var _0x159acf={'where':_0x205b20[_0x8a80('0x3f')]};return db[_0x8a80('0x31')][_0x8a80('0x23')](_0x159acf)['then'](function(_0x4b42a3){_0x422e2e[_0x8a80('0x23')]=_0x4b42a3;if(_0x308100[_0x8a80('0x34')][_0x8a80('0x45')]){_0x205b20['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x8a80('0x46')](_0x205b20);})[_0x8a80('0x29')](function(_0x14ad91){_0x422e2e[_0x8a80('0x47')]=_0x14ad91;return _0x422e2e;})[_0x8a80('0x29')](respondWithFilteredResult(_0x2dce6e,_0x205b20))[_0x8a80('0x48')](handleError(_0x2dce6e,null));};exports[_0x8a80('0x49')]=function(_0xa0b859,_0x17161a){var _0x462672={'raw':!![],'where':{'id':_0xa0b859[_0x8a80('0x4a')]['id']}},_0x5db7b1={};_0x5db7b1['model']=_[_0x8a80('0x35')](db[_0x8a80('0x31')][_0x8a80('0x4b')]);_0x5db7b1[_0x8a80('0x34')]=_[_0x8a80('0x35')](_0xa0b859[_0x8a80('0x34')]);_0x5db7b1[_0x8a80('0x36')]=_[_0x8a80('0x37')](_0x5db7b1['model'],_0x5db7b1[_0x8a80('0x34')]);_0x462672[_0x8a80('0x39')]=_[_0x8a80('0x37')](_0x5db7b1['model'],qs['fields'](_0xa0b859[_0x8a80('0x34')][_0x8a80('0x38')]));_0x462672[_0x8a80('0x39')]=_0x462672[_0x8a80('0x39')]['length']?_0x462672[_0x8a80('0x39')]:_0x5db7b1[_0x8a80('0x33')];if(_0xa0b859[_0x8a80('0x34')]['includeAll']){_0x462672['include']=[{'all':!![]}];}_0x462672=_['merge']({},_0x462672,_0xa0b859[_0x8a80('0x44')]);return db['VoiceTransferReport']['find'](_0x462672)[_0x8a80('0x29')](handleEntityNotFound(_0x17161a,null))[_0x8a80('0x29')](respondWithResult(_0x17161a,null))[_0x8a80('0x48')](handleError(_0x17161a,null));};exports[_0x8a80('0x4c')]=function(_0x75b215,_0x25e9bb){return db[_0x8a80('0x31')][_0x8a80('0x4c')](_0x75b215[_0x8a80('0x4d')],{})['then'](respondWithResult(_0x25e9bb,0xc9))[_0x8a80('0x48')](handleError(_0x25e9bb,null));};exports[_0x8a80('0x28')]=function(_0x23f2db,_0x847161){if(_0x23f2db['body']['id']){delete _0x23f2db[_0x8a80('0x4d')]['id'];}return db[_0x8a80('0x31')][_0x8a80('0x4e')]({'where':{'id':_0x23f2db[_0x8a80('0x4a')]['id']}})['then'](handleEntityNotFound(_0x847161,null))[_0x8a80('0x29')](saveUpdates(_0x23f2db[_0x8a80('0x4d')],null))[_0x8a80('0x29')](respondWithResult(_0x847161,null))['catch'](handleError(_0x847161,null));};exports[_0x8a80('0x2a')]=function(_0x56e1df,_0x39d564){return db[_0x8a80('0x31')][_0x8a80('0x4e')]({'where':{'id':_0x56e1df[_0x8a80('0x4a')]['id']}})[_0x8a80('0x29')](handleEntityNotFound(_0x39d564,null))['then'](removeEntity(_0x39d564,null))[_0x8a80('0x48')](handleError(_0x39d564,null));};exports[_0x8a80('0x4f')]=function(_0x2a978a,_0x84d2d5){return db[_0x8a80('0x31')][_0x8a80('0x4f')]()[_0x8a80('0x29')](respondWithResult(_0x84d2d5,null))[_0x8a80('0x48')](handleError(_0x84d2d5,null));};
\ No newline at end of file
+var _0xbfb3=['reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceTransferReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply'];(function(_0x2aff8f,_0x176f1e){var _0x5ab9a2=function(_0x110b17){while(--_0x110b17){_0x2aff8f['push'](_0x2aff8f['shift']());}};_0x5ab9a2(++_0x176f1e);}(_0xbfb3,0x1d9));var _0x3bfb=function(_0x379ea6,_0x32e892){_0x379ea6=_0x379ea6-0x0;var _0x1b29f3=_0xbfb3[_0x379ea6];return _0x1b29f3;};'use strict';var emlformat=require(_0x3bfb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3bfb('0x1'));var rp=require(_0x3bfb('0x2'));var moment=require(_0x3bfb('0x3'));var BPromise=require(_0x3bfb('0x4'));var Mustache=require(_0x3bfb('0x5'));var util=require(_0x3bfb('0x6'));var path=require(_0x3bfb('0x7'));var sox=require(_0x3bfb('0x8'));var csv=require('to-csv');var ejs=require(_0x3bfb('0x9'));var fs=require('fs');var fs_extra=require(_0x3bfb('0xa'));var _=require('lodash');var squel=require(_0x3bfb('0xb'));var crypto=require('crypto');var jsforce=require(_0x3bfb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bfb('0xd'));var querystring=require('querystring');var Papa=require(_0x3bfb('0xe'));var Redis=require(_0x3bfb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3bfb('0x10'));var hardwareService=require(_0x3bfb('0x11'));var logger=require('../../config/logger')(_0x3bfb('0x12'));var utils=require('../../config/utils');var config=require(_0x3bfb('0x13'));var licenseUtil=require(_0x3bfb('0x14'));var db=require(_0x3bfb('0x15'))['db'];function respondWithStatusCode(_0x22f7a3,_0x41c1dd){_0x41c1dd=_0x41c1dd||0xcc;return function(_0x16d681){if(_0x16d681){return _0x22f7a3[_0x3bfb('0x16')](_0x41c1dd);}return _0x22f7a3[_0x3bfb('0x17')](_0x41c1dd)['end']();};}function respondWithResult(_0x49a9c9,_0x5e8885){_0x5e8885=_0x5e8885||0xc8;return function(_0x401b16){if(_0x401b16){return _0x49a9c9[_0x3bfb('0x17')](_0x5e8885)[_0x3bfb('0x18')](_0x401b16);}};}function respondWithFilteredResult(_0x1e0f8d,_0x52cce9){return function(_0x397a4f){if(_0x397a4f){var _0x5da31c=typeof _0x52cce9[_0x3bfb('0x19')]===_0x3bfb('0x1a')&&typeof _0x52cce9[_0x3bfb('0x1b')]===_0x3bfb('0x1a');var _0x16e60f=_0x397a4f[_0x3bfb('0x1c')];var _0x479b10=_0x5da31c?0x0:_0x52cce9[_0x3bfb('0x19')];var _0x28c27f=_0x5da31c?_0x397a4f[_0x3bfb('0x1c')]:_0x52cce9['offset']+_0x52cce9[_0x3bfb('0x1b')];var _0x13a142;if(_0x28c27f>=_0x16e60f){_0x28c27f=_0x16e60f;_0x13a142=0xc8;}else{_0x13a142=0xce;}_0x1e0f8d[_0x3bfb('0x17')](_0x13a142);return _0x1e0f8d[_0x3bfb('0x1d')]('Content-Range',_0x479b10+'-'+_0x28c27f+'/'+_0x16e60f)[_0x3bfb('0x18')](_0x397a4f);}return null;};}function patchUpdates(_0x41b6da){return function(_0x25258e){try{jsonpatch[_0x3bfb('0x1e')](_0x25258e,_0x41b6da,!![]);}catch(_0x2dba0c){return BPromise[_0x3bfb('0x1f')](_0x2dba0c);}return _0x25258e[_0x3bfb('0x20')]();};}function saveUpdates(_0x3c2df6,_0xcdc8d1){return function(_0x7cad0){if(_0x7cad0){return _0x7cad0['update'](_0x3c2df6)[_0x3bfb('0x21')](function(_0x1a784d){return _0x1a784d;});}return null;};}function removeEntity(_0x371e9b,_0x1b000f){return function(_0x358375){if(_0x358375){return _0x358375[_0x3bfb('0x22')]()[_0x3bfb('0x21')](function(){_0x371e9b[_0x3bfb('0x17')](0xcc)[_0x3bfb('0x23')]();});}};}function handleEntityNotFound(_0x16aa5b,_0xcf82ab){return function(_0x4bae64){if(!_0x4bae64){_0x16aa5b[_0x3bfb('0x16')](0x194);}return _0x4bae64;};}function handleError(_0x1a9a09,_0xbbe01e){_0xbbe01e=_0xbbe01e||0x1f4;return function(_0x2db9fb){logger['error'](_0x2db9fb[_0x3bfb('0x24')]);if(_0x2db9fb[_0x3bfb('0x25')]){delete _0x2db9fb['name'];}_0x1a9a09[_0x3bfb('0x17')](_0xbbe01e)[_0x3bfb('0x26')](_0x2db9fb);};}exports[_0x3bfb('0x27')]=function(_0x5e0015,_0x421f27){var _0x341318={},_0x1cb1dc={},_0x16b1bc={'count':0x0,'rows':[]};var _0x117658=_[_0x3bfb('0x28')](db['VoiceTransferReport'][_0x3bfb('0x29')],function(_0x1511c1){return{'name':_0x1511c1[_0x3bfb('0x2a')],'type':_0x1511c1[_0x3bfb('0x2b')][_0x3bfb('0x2c')]};});_0x1cb1dc['model']=_[_0x3bfb('0x28')](_0x117658,'name');_0x1cb1dc[_0x3bfb('0x2d')]=_[_0x3bfb('0x2e')](_0x5e0015[_0x3bfb('0x2d')]);_0x1cb1dc[_0x3bfb('0x2f')]=_[_0x3bfb('0x30')](_0x1cb1dc[_0x3bfb('0x31')],_0x1cb1dc[_0x3bfb('0x2d')]);_0x341318[_0x3bfb('0x32')]=_[_0x3bfb('0x30')](_0x1cb1dc[_0x3bfb('0x31')],qs[_0x3bfb('0x33')](_0x5e0015[_0x3bfb('0x2d')][_0x3bfb('0x33')]));_0x341318['attributes']=_0x341318[_0x3bfb('0x32')][_0x3bfb('0x34')]?_0x341318[_0x3bfb('0x32')]:_0x1cb1dc['model'];if(!_0x5e0015['query'][_0x3bfb('0x35')](_0x3bfb('0x36'))){_0x341318[_0x3bfb('0x1b')]=qs[_0x3bfb('0x1b')](_0x5e0015['query']['limit']);_0x341318[_0x3bfb('0x19')]=qs[_0x3bfb('0x19')](_0x5e0015['query'][_0x3bfb('0x19')]);}_0x341318[_0x3bfb('0x37')]=qs[_0x3bfb('0x38')](_0x5e0015[_0x3bfb('0x2d')][_0x3bfb('0x38')]);_0x341318[_0x3bfb('0x39')]=qs[_0x3bfb('0x2f')](_[_0x3bfb('0x3a')](_0x5e0015[_0x3bfb('0x2d')],_0x1cb1dc[_0x3bfb('0x2f')]),_0x117658);if(_0x5e0015[_0x3bfb('0x2d')][_0x3bfb('0x3b')]){_0x341318['where']=_[_0x3bfb('0x3c')](_0x341318[_0x3bfb('0x39')],{'$or':_[_0x3bfb('0x28')](_0x117658,function(_0x5c8884){if(_0x5c8884[_0x3bfb('0x2b')]!=='VIRTUAL'){var _0x454994={};_0x454994[_0x5c8884[_0x3bfb('0x25')]]={'$like':'%'+_0x5e0015[_0x3bfb('0x2d')][_0x3bfb('0x3b')]+'%'};return _0x454994;}})});}_0x341318=_['merge']({},_0x341318,_0x5e0015['options']);var _0x59a17f={'where':_0x341318[_0x3bfb('0x39')]};return db[_0x3bfb('0x3d')][_0x3bfb('0x1c')](_0x59a17f)[_0x3bfb('0x21')](function(_0x11988a){_0x16b1bc[_0x3bfb('0x1c')]=_0x11988a;if(_0x5e0015[_0x3bfb('0x2d')][_0x3bfb('0x3e')]){_0x341318[_0x3bfb('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x3bfb('0x40')](_0x341318);})[_0x3bfb('0x21')](function(_0x1fd90f){_0x16b1bc[_0x3bfb('0x41')]=_0x1fd90f;return _0x16b1bc;})['then'](respondWithFilteredResult(_0x421f27,_0x341318))[_0x3bfb('0x42')](handleError(_0x421f27,null));};exports['show']=function(_0x4240b6,_0x10e733){var _0x13e6ae={'raw':!![],'where':{'id':_0x4240b6[_0x3bfb('0x43')]['id']}},_0x1dc3de={};_0x1dc3de[_0x3bfb('0x31')]=_[_0x3bfb('0x2e')](db[_0x3bfb('0x3d')][_0x3bfb('0x29')]);_0x1dc3de[_0x3bfb('0x2d')]=_[_0x3bfb('0x2e')](_0x4240b6[_0x3bfb('0x2d')]);_0x1dc3de[_0x3bfb('0x2f')]=_[_0x3bfb('0x30')](_0x1dc3de[_0x3bfb('0x31')],_0x1dc3de['query']);_0x13e6ae['attributes']=_[_0x3bfb('0x30')](_0x1dc3de['model'],qs['fields'](_0x4240b6[_0x3bfb('0x2d')]['fields']));_0x13e6ae[_0x3bfb('0x32')]=_0x13e6ae[_0x3bfb('0x32')]['length']?_0x13e6ae['attributes']:_0x1dc3de[_0x3bfb('0x31')];if(_0x4240b6[_0x3bfb('0x2d')][_0x3bfb('0x3e')]){_0x13e6ae['include']=[{'all':!![]}];}_0x13e6ae=_[_0x3bfb('0x3c')]({},_0x13e6ae,_0x4240b6['options']);return db[_0x3bfb('0x3d')][_0x3bfb('0x44')](_0x13e6ae)[_0x3bfb('0x21')](handleEntityNotFound(_0x10e733,null))['then'](respondWithResult(_0x10e733,null))[_0x3bfb('0x42')](handleError(_0x10e733,null));};exports[_0x3bfb('0x45')]=function(_0x1a5560,_0x875475){return db['VoiceTransferReport']['create'](_0x1a5560[_0x3bfb('0x46')],{})[_0x3bfb('0x21')](respondWithResult(_0x875475,0xc9))[_0x3bfb('0x42')](handleError(_0x875475,null));};exports['update']=function(_0x2ef51d,_0x3ede0b){if(_0x2ef51d['body']['id']){delete _0x2ef51d[_0x3bfb('0x46')]['id'];}return db[_0x3bfb('0x3d')][_0x3bfb('0x44')]({'where':{'id':_0x2ef51d[_0x3bfb('0x43')]['id']}})[_0x3bfb('0x21')](handleEntityNotFound(_0x3ede0b,null))[_0x3bfb('0x21')](saveUpdates(_0x2ef51d['body'],null))['then'](respondWithResult(_0x3ede0b,null))[_0x3bfb('0x42')](handleError(_0x3ede0b,null));};exports[_0x3bfb('0x22')]=function(_0x1a81ce,_0x1d187a){return db[_0x3bfb('0x3d')][_0x3bfb('0x44')]({'where':{'id':_0x1a81ce[_0x3bfb('0x43')]['id']}})[_0x3bfb('0x21')](handleEntityNotFound(_0x1d187a,null))[_0x3bfb('0x21')](removeEntity(_0x1d187a,null))[_0x3bfb('0x42')](handleError(_0x1d187a,null));};exports[_0x3bfb('0x47')]=function(_0x29f57a,_0x505cfc){return db[_0x3bfb('0x3d')][_0x3bfb('0x47')]()[_0x3bfb('0x21')](respondWithResult(_0x505cfc,null))['catch'](handleError(_0x505cfc,null));};
\ No newline at end of file
index 2557351..e6d424a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dc7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2978b1,_0x4314ce){var _0x1f3e0b=function(_0x11c4a7){while(--_0x11c4a7){_0x2978b1['push'](_0x2978b1['shift']());}};_0x1f3e0b(++_0x4314ce);}(_0x5dc7,0xf2));var _0x75dc=function(_0x130405,_0x4ff445){_0x130405=_0x130405-0x0;var _0x1443a5=_0x5dc7[_0x130405];return _0x1443a5;};'use strict';var _=require(_0x75dc('0x0'));var util=require(_0x75dc('0x1'));var logger=require(_0x75dc('0x2'))(_0x75dc('0x3'));var moment=require(_0x75dc('0x4'));var BPromise=require(_0x75dc('0x5'));var rp=require(_0x75dc('0x6'));var fs=require('fs');var path=require(_0x75dc('0x7'));var rimraf=require(_0x75dc('0x8'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x75dc('0x9')]=function(_0x5387c5,_0x1d39eb){return _0x5387c5[_0x75dc('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d50=['lodash','util','../../config/logger','api','bluebird','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer'];(function(_0x239bb8,_0x3f02af){var _0x3a895c=function(_0x54f329){while(--_0x54f329){_0x239bb8['push'](_0x239bb8['shift']());}};_0x3a895c(++_0x3f02af);}(_0x9d50,0x6e));var _0x09d5=function(_0x3e96ed,_0x1db5fe){_0x3e96ed=_0x3e96ed-0x0;var _0x277e70=_0x9d50[_0x3e96ed];return _0x277e70;};'use strict';var _=require(_0x09d5('0x0'));var util=require(_0x09d5('0x1'));var logger=require(_0x09d5('0x2'))(_0x09d5('0x3'));var moment=require('moment');var BPromise=require(_0x09d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x09d5('0x5'));var attributes=require(_0x09d5('0x6'));module[_0x09d5('0x7')]=function(_0x329cff,_0x58d7b4){return _0x329cff[_0x09d5('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x09d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8b19b13..1104299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c1=['http','request','then','request\x20sent','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x48c1,0x10e));var _0x148c=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x48c1[_0xdbe2de];return _0x2facd7;};'use strict';var _=require('lodash');var util=require(_0x148c('0x0'));var moment=require(_0x148c('0x1'));var BPromise=require(_0x148c('0x2'));var rs=require(_0x148c('0x3'));var fs=require('fs');var Redis=require(_0x148c('0x4'));var db=require(_0x148c('0x5'))['db'];var utils=require(_0x148c('0x6'));var logger=require('../../config/logger')(_0x148c('0x7'));var config=require(_0x148c('0x8'));var jayson=require(_0x148c('0x9'));var client=jayson['client'][_0x148c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348b83,_0x3fc8df,_0x2d1bfd){return new BPromise(function(_0x483bc3,_0x506dba){return client[_0x148c('0xb')](_0x348b83,_0x2d1bfd)[_0x148c('0xc')](function(_0x135219){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x3fc8df,_0x148c('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3fc8df,_0x148c('0xd'),JSON[_0x148c('0xe')](_0x135219));if(_0x135219['error']){if(_0x135219[_0x148c('0xf')][_0x148c('0x10')]===0x1f4){logger[_0x148c('0xf')](_0x148c('0x11'),_0x3fc8df,_0x135219[_0x148c('0xf')][_0x148c('0x12')]);return _0x506dba(_0x135219['error'][_0x148c('0x12')]);}logger[_0x148c('0xf')](_0x148c('0x11'),_0x3fc8df,_0x135219[_0x148c('0xf')][_0x148c('0x12')]);return _0x483bc3(_0x135219[_0x148c('0xf')][_0x148c('0x12')]);}else{logger[_0x148c('0x13')](_0x148c('0x11'),_0x3fc8df,_0x148c('0xd'));_0x483bc3(_0x135219[_0x148c('0x14')][_0x148c('0x12')]);}})[_0x148c('0x15')](function(_0x3e148a){logger[_0x148c('0xf')](_0x148c('0x11'),_0x3fc8df,_0x3e148a);_0x506dba(_0x3e148a);});});}exports[_0x148c('0x16')]=function(_0xf6255a){var _0x138260=this;return new Promise(function(_0x4a14c6,_0x1bd7cb){return db[_0x148c('0x17')]['create'](_0xf6255a[_0x148c('0x18')],{'raw':_0xf6255a[_0x148c('0x19')]?_0xf6255a[_0x148c('0x19')][_0x148c('0x1a')]===undefined?!![]:![]:!![]})[_0x148c('0xc')](function(_0x3e5254){logger['info'](_0x148c('0x16'),_0xf6255a);logger[_0x148c('0x1b')](_0x148c('0x16'),_0xf6255a,JSON[_0x148c('0xe')](_0x3e5254));_0x4a14c6(_0x3e5254);})[_0x148c('0x15')](function(_0x4b1557){logger['error'](_0x148c('0x16'),_0x4b1557[_0x148c('0x12')],_0xf6255a);_0x1bd7cb(_0x138260[_0x148c('0xf')](0x1f4,_0x4b1557['message']));});});};
\ No newline at end of file
+var _0x9182=['client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9182,0x17b));var _0x2918=function(_0x2739ee,_0x20a883){_0x2739ee=_0x2739ee-0x0;var _0x4e938f=_0x9182[_0x2739ee];return _0x4e938f;};'use strict';var _=require(_0x2918('0x0'));var util=require(_0x2918('0x1'));var moment=require(_0x2918('0x2'));var BPromise=require(_0x2918('0x3'));var rs=require(_0x2918('0x4'));var fs=require('fs');var Redis=require(_0x2918('0x5'));var db=require(_0x2918('0x6'))['db'];var utils=require(_0x2918('0x7'));var logger=require('../../config/logger')(_0x2918('0x8'));var config=require(_0x2918('0x9'));var jayson=require(_0x2918('0xa'));var client=jayson[_0x2918('0xb')][_0x2918('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2beeab,_0x169331,_0x492f5a){return new BPromise(function(_0x1a5bcc,_0x16a16a){return client[_0x2918('0xd')](_0x2beeab,_0x492f5a)[_0x2918('0xe')](function(_0x3cccb2){logger['info'](_0x2918('0xf'),_0x169331,_0x2918('0x10'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x169331,_0x2918('0x10'),JSON[_0x2918('0x11')](_0x3cccb2));if(_0x3cccb2[_0x2918('0x12')]){if(_0x3cccb2[_0x2918('0x12')]['code']===0x1f4){logger[_0x2918('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x169331,_0x3cccb2['error'][_0x2918('0x13')]);return _0x16a16a(_0x3cccb2[_0x2918('0x12')]['message']);}logger[_0x2918('0x12')](_0x2918('0xf'),_0x169331,_0x3cccb2[_0x2918('0x12')]['message']);return _0x1a5bcc(_0x3cccb2[_0x2918('0x12')][_0x2918('0x13')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x169331,'request\x20sent');_0x1a5bcc(_0x3cccb2[_0x2918('0x14')][_0x2918('0x13')]);}})['catch'](function(_0x382b8e){logger[_0x2918('0x12')](_0x2918('0xf'),_0x169331,_0x382b8e);_0x16a16a(_0x382b8e);});});}exports[_0x2918('0x15')]=function(_0x3debae){var _0x5d5f3c=this;return new Promise(function(_0x39fb3e,_0x561c48){return db[_0x2918('0x16')][_0x2918('0x17')](_0x3debae[_0x2918('0x18')],{'raw':_0x3debae[_0x2918('0x19')]?_0x3debae['options'][_0x2918('0x1a')]===undefined?!![]:![]:!![]})[_0x2918('0xe')](function(_0xfdbad5){logger[_0x2918('0x1b')](_0x2918('0x15'),_0x3debae);logger[_0x2918('0x1c')](_0x2918('0x15'),_0x3debae,JSON[_0x2918('0x11')](_0xfdbad5));_0x39fb3e(_0xfdbad5);})[_0x2918('0x1d')](function(_0x43cae6){logger[_0x2918('0x12')](_0x2918('0x15'),_0x43cae6['message'],_0x3debae);_0x561c48(_0x5d5f3c[_0x2918('0x12')](0x1f4,_0x43cae6['message']));});});};
\ No newline at end of file
index 8768beb..b310061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x185a5f,_0x3d5d9d){var _0x1ee746=function(_0x49be2c){while(--_0x49be2c){_0x185a5f['push'](_0x185a5f['shift']());}};_0x1ee746(++_0x3d5d9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router;
\ No newline at end of file
+var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router;
\ No newline at end of file
index 476ebc7..49ba7ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24cd=['number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','originate','info','body','json','callerId','callbackUrl','entityFound:','format','user:%s','hangup','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../config/environment','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate'];(function(_0x89bddd,_0x5c50e8){var _0x3a10e6=function(_0x2c887f){while(--_0x2c887f){_0x89bddd['push'](_0x89bddd['shift']());}};_0x3a10e6(++_0x5c50e8);}(_0x24cd,0x83));var _0xd24c=function(_0x5b0313,_0x563525){_0x5b0313=_0x5b0313-0x0;var _0x184dd0=_0x24cd[_0x5b0313];return _0x184dd0;};'use strict';var path=require(_0xd24c('0x0'));var fs=require('fs');var _=require(_0xd24c('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xd24c('0x2'));var util=require('util');var BPromise=require(_0xd24c('0x3'));var jayson=require(_0xd24c('0x4'));var amiClient=jayson[_0xd24c('0x5')]['http']({'port':0x232a});var logger=require(_0xd24c('0x6'))(_0xd24c('0x7'));var Redis=require('ioredis');config[_0xd24c('0x8')]=_[_0xd24c('0x9')](config[_0xd24c('0x8')],{'host':_0xd24c('0xa'),'port':0x18eb});var io=require(_0xd24c('0xb'))(new Redis(config[_0xd24c('0x8')]));var Schema=require(_0xd24c('0xc'));var originateValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xd24c('0xe')]},'callerId':{'type':_0xd24c('0xf')},'callbackUrl':{'type':_0xd24c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':[!![],_0xd24c('0x11')]},'transferNumber':{'type':_0xd24c('0xf'),'required':[!![],_0xd24c('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd24c('0x10')]}});function emit(_0x3aa193,_0x1a1111,_0x3221a8){logger['info'](_0x3aa193,_0x1a1111,JSON['stringify'](_0x3221a8));io['to'](_0x3aa193)[_0xd24c('0x13')](_0x1a1111,_0x3221a8);}function handleError(_0x34f882){return function(_0x170d59){console['log'](_0xd24c('0x14'),_0x170d59,_0x170d59 instanceof RangeError);logger[_0xd24c('0x15')](_0x170d59[_0xd24c('0x16')]);if(_0x170d59 instanceof RangeError){if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59['name'];}_0x34f882[_0xd24c('0x18')](0x194)['send'](_0x170d59);}else{if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59[_0xd24c('0x17')];}_0x34f882[_0xd24c('0x18')](0x1f4)[_0xd24c('0x19')](_0x170d59);}};}function checkError(){return function(_0x333416){if(!_0x333416){throw new RangeError(_0xd24c('0x1a'));}return _0x333416;};}function respondWithRpcPromise(_0x2f7439,_0x298d73){return new BPromise(function(_0x17375b,_0x206ce7){var _0x48fffd=amiClient;return _0x48fffd[_0xd24c('0x1b')](_0x2f7439,_0x298d73)[_0xd24c('0x1c')](function(_0x2549d0){if(_0x2549d0['error']){if(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1d')]===0x1f4){return _0x206ce7(_0x2549d0[_0xd24c('0x15')]['message']);}return _0x17375b(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1e')]);}else{_0x17375b(_0x2549d0[_0xd24c('0x1f')]);}})[_0xd24c('0x20')](function(_0x574cd4){_0x206ce7(_0x574cd4);});});}function getAgent(_0x5ec0b1){return db[_0xd24c('0x21')]['findOne']({'where':{'id':_0x5ec0b1,'role':_0xd24c('0x22')}})[_0xd24c('0x1c')](checkError());}function getAgentCheckSession(_0x325fcc,_0x4c0d99){return new BPromise(function(_0x4cb1b3,_0x26fd85){var _0x14d44a=respondWithRpcPromise(_0xd24c('0x23'));var _0x160f03=getAgent(_0x325fcc);Promise[_0xd24c('0x24')]([_0x14d44a,_0x160f03])[_0xd24c('0x1c')](function(_0x1be144){var _0x20d37f=_0x1be144[0x0];var _0x1c48d6=_0x1be144[0x1];var _0x3b14c7=_[_0xd24c('0x25')](_0x20d37f['rows'],function(_0x4e128b){return _0x4e128b[_0xd24c('0x26')]==_0x1c48d6['id']&&_0x4e128b[_0xd24c('0x27')]==_0x4c0d99;});if(_0x3b14c7[_0xd24c('0x28')]==0x1){_0x4cb1b3(_0x1c48d6);}else{_0x26fd85(new RangeError('sessionId\x20'+_0x4c0d99+'\x20not\x20found!'));}});});}exports[_0xd24c('0x29')]=function(_0x1678e4,_0x34a64c){logger[_0xd24c('0x2a')]('originate\x20fired:',_0x1678e4[_0xd24c('0x2b')]);var _0x2ae0ce=originateValidation[_0xd24c('0xc')](_0x1678e4[_0xd24c('0x2b')]);if(_0x2ae0ce[_0xd24c('0x28')]>0x0){return _0x34a64c[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x2ae0ce);}var _0x1935f3=_0x1678e4[_0xd24c('0x2b')]['userId'];var _0x4be898=_0x1678e4['body']['callNumber'];var _0x23d014=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2d')];var _0x1113a6=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2e')];return getAgent(_0x1935f3)[_0xd24c('0x1c')](function(_0x483e3f){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x483e3f[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x483e3f[_0xd24c('0x17')]),'webbar:originate',{'callNumber':_0x4be898,'callerId':_0x23d014,'callbackUrl':_0x1113a6});return _0x34a64c[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0xd24c('0x20')](handleError(_0x34a64c));};exports[_0xd24c('0x32')]=function(_0x4bf183,_0x1e5718){logger[_0xd24c('0x2a')]('hangup\x20fired:',_0x4bf183[_0xd24c('0x2b')]);var _0x36d013=hangupValidation[_0xd24c('0xc')](_0x4bf183[_0xd24c('0x2b')]);if(_0x36d013['length']>0x0){return _0x1e5718[_0xd24c('0x18')](0x190)['json'](_0x36d013);}var _0x2a93af=_0x4bf183['body']['userId'];var _0x4b1a7e=_0x4bf183[_0xd24c('0x2b')]['sessionId'];return getAgent(_0x2a93af)['then'](function(_0x66f45){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x66f45[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x66f45['name']),_0xd24c('0x33'),{'sessionId':_0x4b1a7e});return _0x1e5718[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x34')});})[_0xd24c('0x20')](handleError(_0x1e5718));};exports[_0xd24c('0x35')]=function(_0x17f070,_0xd20086){logger[_0xd24c('0x2a')](_0xd24c('0x36'),_0x17f070['body']);var _0x2607e5=answerValidation[_0xd24c('0xc')](_0x17f070['body']);if(_0x2607e5[_0xd24c('0x28')]>0x0){return _0xd20086[_0xd24c('0x18')](0x190)['json'](_0x2607e5);}var _0x2f2981=_0x17f070['body'][_0xd24c('0x37')];var _0x2d46b8=_0x17f070[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2f2981)[_0xd24c('0x1c')](function(_0x5bd78b){logger[_0xd24c('0x2a')]('entityFound:',_0x5bd78b[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x5bd78b[_0xd24c('0x17')]),'webbar:answer',{'sessionId':_0x2d46b8});return _0xd20086[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xd24c('0x20')](handleError(_0xd20086));};exports['hold']=function(_0x548080,_0x5dd31a){logger[_0xd24c('0x2a')](_0xd24c('0x38'),_0x548080['body']);var _0x516734=holdValidation[_0xd24c('0xc')](_0x548080[_0xd24c('0x2b')]);if(_0x516734[_0xd24c('0x28')]>0x0){return _0x5dd31a[_0xd24c('0x18')](0x190)['json'](_0x516734);}var _0x2931b7=_0x548080[_0xd24c('0x2b')]['userId'];var _0x1ee699=_0x548080[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2931b7)['then'](function(_0x3039aa){logger['info'](_0xd24c('0x2f'),_0x3039aa[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x3039aa['name']),_0xd24c('0x39'),{'sessionId':_0x1ee699});return _0x5dd31a[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3a')});})[_0xd24c('0x20')](handleError(_0x5dd31a));};exports[_0xd24c('0x3b')]=function(_0x3ce7d0,_0x34321f){logger[_0xd24c('0x2a')](_0xd24c('0x3c'),_0x3ce7d0[_0xd24c('0x2b')]);var _0x5c2b2c=unholdValidation[_0xd24c('0xc')](_0x3ce7d0[_0xd24c('0x2b')]);if(_0x5c2b2c['length']>0x0){return _0x34321f['status'](0x190)['json'](_0x5c2b2c);}var _0x252f2e=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x4668d2=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x252f2e)[_0xd24c('0x1c')](function(_0xd9b530){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0xd9b530[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0xd9b530[_0xd24c('0x17')]),'webbar:unhold',{'sessionId':_0x4668d2});return _0x34321f[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3d')});})['catch'](handleError(_0x34321f));};exports['calls']=function(_0xdf1f18,_0xd35f63){logger[_0xd24c('0x2a')](_0xd24c('0x3e'),_0xd35f63[_0xd24c('0x2b')]);var _0x3dee09=callsValidation[_0xd24c('0xc')](_0xdf1f18[_0xd24c('0x2b')]);if(_0x3dee09['length']>0x0){return _0xd35f63[_0xd24c('0x18')](0x190)['json'](_0x3dee09);}var _0x4844fc=_0xdf1f18[_0xd24c('0x2b')]['userId'];var _0x4f6b11=respondWithRpcPromise(_0xd24c('0x23'));var _0x1b649e=getAgent(_0x4844fc);return Promise[_0xd24c('0x24')]([_0x4f6b11,_0x1b649e])[_0xd24c('0x1c')](function(_0x4890d6){var _0x66db4a=_0x4890d6[0x0];var _0x1e99e7=_0x4890d6[0x1];var _0x3e6c3b=_[_0xd24c('0x25')](_0x66db4a[_0xd24c('0x3f')],function(_0xcb46e8){return _0xcb46e8[_0xd24c('0x26')]==_0x1e99e7['id'];});return _0xd35f63['status'](0xc8)['json']({'count':_0x3e6c3b['length'],'rows':_0x3e6c3b});})[_0xd24c('0x20')](handleError(_0xd35f63));};exports[_0xd24c('0x40')]=function(_0x42a917,_0x186042){logger[_0xd24c('0x2a')](_0xd24c('0x41'),_0x42a917['body']);var _0x1f2632=conferenceValidation[_0xd24c('0xc')](_0x42a917['body']);if(_0x1f2632[_0xd24c('0x28')]>0x0){return _0x186042[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x1f2632);}var _0x45030d=_0x42a917[_0xd24c('0x2b')]['userId'];return getAgent(_0x45030d)['then'](function(_0x2a6d13){logger[_0xd24c('0x2a')]('entityFound:',_0x2a6d13[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')]('user:%s',_0x2a6d13[_0xd24c('0x17')]),_0xd24c('0x42'));return _0x186042[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x43')});})[_0xd24c('0x20')](handleError(_0x186042));};exports[_0xd24c('0x44')]=function(_0x4af868,_0x522587){logger['info'](_0xd24c('0x45'),_0x4af868['body']);var _0x5293b4=transferValidation['validate'](_0x4af868[_0xd24c('0x2b')]);if(_0x5293b4[_0xd24c('0x28')]>0x0){return _0x522587[_0xd24c('0x18')](0x190)['json'](_0x5293b4);}var _0x312c4c=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x2daf65=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x27')];var _0x52567d=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x46')];return getAgent(_0x312c4c)['then'](function(_0x24ede8){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x24ede8[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x24ede8[_0xd24c('0x17')]),_0xd24c('0x47'),{'sessionId':_0x2daf65,'transferNumber':_0x52567d});return _0x522587[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xd24c('0x20')](handleError(_0x522587));};
\ No newline at end of file
+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(_0x4dc700,_0x1978bb){var _0x23fecb=function(_0xe5b35b){while(--_0xe5b35b){_0x4dc700['push'](_0x4dc700['shift']());}};_0x23fecb(++_0x1978bb);}(_0x9567,0xdc));var _0x7956=function(_0x42a0ff,_0x6d48c5){_0x42a0ff=_0x42a0ff-0x0;var _0x17a2b0=_0x9567[_0x42a0ff];return _0x17a2b0;};'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
index 6d0662c..006dbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0x430c,0x1a1));var _0xc430=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x430c[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var 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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x1a37=['get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addAgents','addApplications','notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a37,0xb4));var _0x71a3=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x1a37[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./whatsappAccount.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0xa')](_0x71a3('0x13'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x15')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x16')]);router[_0x71a3('0x15')](_0x71a3('0xf'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x71a3('0x18')]);router[_0x71a3('0x15')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1a')]);router[_0x71a3('0x15')]('/:id/applications',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1b')]);router['post']('/:id/notify',controller[_0x71a3('0x1c')]);router[_0x71a3('0x15')](_0x71a3('0x1d'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);router['put'](_0x71a3('0x1f'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x20')]);router[_0x71a3('0x21')](_0x71a3('0x1f'),auth['isAuthenticated'](),controller[_0x71a3('0x22')]);router['delete'](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x23')]);router[_0x71a3('0x21')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['removeAnswers']);router[_0x71a3('0x21')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x24')]);module[_0x71a3('0x25')]=router;
\ No newline at end of file
index ef4afda..8054647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc3a=['name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/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','randomstring','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbc3a,0x7c));var _0xabc3=function(_0x1d8123,_0x467de5){_0x1d8123=_0x1d8123-0x0;var _0x1b7e76=_0xbc3a[_0x1d8123];return _0x1b7e76;};'use strict';var Sequelize=require(_0xabc3('0x0'));var rs=require(_0xabc3('0x1'));module[_0xabc3('0x2')]={'name':{'type':Sequelize[_0xabc3('0x3')],'unique':_0xabc3('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xabc3('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xabc3('0x3')],'defaultValue':function(){return rs[_0xabc3('0x5')]();}},'phone':{'type':Sequelize[_0xabc3('0x3')]},'type':{'type':Sequelize['ENUM'](_0xabc3('0x6'),_0xabc3('0x7'))},'accountSid':{'type':Sequelize[_0xabc3('0x3')]},'baseUrl':{'type':Sequelize[_0xabc3('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xabc3('0x8')],'defaultValue':function(){return _0xabc3('0x9');}},'notificationSound':{'type':Sequelize[_0xabc3('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xabc3('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xabc3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xabc3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xabc3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xabc3('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xabc3('0xa')],'defaultValue':![],'comment':_0xabc3('0xd'),'set':function(_0x5b20a5){if(!_0x5b20a5){this[_0xabc3('0xe')]('mandatoryDispositionPauseId',null);}this[_0xabc3('0xe')](_0xabc3('0xf'),_0x5b20a5);}},'description':{'type':Sequelize[_0xabc3('0x3')]}};
\ No newline at end of file
+var _0x2025=['sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','ENUM','twilio'];(function(_0x9d650,_0x393138){var _0x5c21b4=function(_0x255054){while(--_0x255054){_0x9d650['push'](_0x9d650['shift']());}};_0x5c21b4(++_0x393138);}(_0x2025,0x1ac));var _0x5202=function(_0x155225,_0x4c20ba){_0x155225=_0x155225-0x0;var _0x31ab10=_0x2025[_0x155225];return _0x31ab10;};'use strict';var Sequelize=require(_0x5202('0x0'));var rs=require(_0x5202('0x1'));module['exports']={'name':{'type':Sequelize[_0x5202('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5202('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5202('0x2')],'defaultValue':function(){return rs[_0x5202('0x3')]();}},'phone':{'type':Sequelize[_0x5202('0x2')]},'type':{'type':Sequelize[_0x5202('0x4')](_0x5202('0x5'),_0x5202('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5202('0x2')]},'authToken':{'type':Sequelize[_0x5202('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5202('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5202('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5202('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5202('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5202('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5202('0x9')],'comment':_0x5202('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x5202('0x8')],'defaultValue':![],'comment':_0x5202('0xb'),'set':function(_0x3d490c){if(!_0x3d490c){this['setDataValue'](_0x5202('0xc'),null);}this['setDataValue'](_0x5202('0xd'),_0x3d490c);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 78809bd..a3a2659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f7=['ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','Body','MessageSid','sinch','from','notifications','messageId','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','WhatsappInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','body\x20is\x20mandatory\x20and\x20not\x20empty','List','DESC','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','getDispositions','findOne','Disposition','order','WhatsappAccountId','removeDispositions'];(function(_0x207d41,_0x3c5fbf){var _0x4bcfbd=function(_0x3f26ef){while(--_0x3f26ef){_0x207d41['push'](_0x207d41['shift']());}};_0x4bcfbd(++_0x3c5fbf);}(_0x13f7,0x119));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x713f('0x0'));var rimraf=require(_0x713f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x713f('0x2'));var rp=require('request-promise');var moment=require(_0x713f('0x3'));var BPromise=require(_0x713f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x713f('0x5'));var sox=require('sox');var csv=require(_0x713f('0x6'));var ejs=require(_0x713f('0x7'));var fs=require('fs');var fs_extra=require(_0x713f('0x8'));var _=require(_0x713f('0x9'));var squel=require('squel');var crypto=require(_0x713f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x713f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x713f('0xc'));var Papa=require(_0x713f('0xd'));var Redis=require(_0x713f('0xe'));var authService=require(_0x713f('0xf'));var qs=require(_0x713f('0x10'));var as=require(_0x713f('0x11'));var hardwareService=require(_0x713f('0x12'));var logger=require(_0x713f('0x13'))('api');var utils=require(_0x713f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x713f('0x15'));var db=require('../../mysqldb')['db'];config[_0x713f('0x16')]=_[_0x713f('0x17')](config[_0x713f('0x16')],{'host':_0x713f('0x18'),'port':0x18eb});var socket=require(_0x713f('0x19'))(new Redis(config['redis']));require(_0x713f('0x1a'))[_0x713f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x713f('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5ad347,_0x231681,_0x13eeee,_0x1cd5d3){return new BPromise(function(_0x2f9c4d,_0x5cae50){var _0x4b66dd=_0x1cd5d3||client;return _0x4b66dd['request'](_0x5ad347,_0x13eeee)[_0x713f('0x1d')](function(_0x12819a){logger[_0x713f('0x1e')](_0x713f('0x1f'),_0x231681,'request\x20sent');logger[_0x713f('0x20')](_0x713f('0x21'),_0x231681,_0x713f('0x22'),JSON[_0x713f('0x23')](_0x12819a));if(_0x12819a['error']){if(_0x12819a[_0x713f('0x24')][_0x713f('0x25')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x231681,_0x12819a[_0x713f('0x24')][_0x713f('0x26')]);return _0x5cae50(_0x12819a['error']['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x231681,_0x12819a['error'][_0x713f('0x26')]);return _0x2f9c4d(_0x12819a['error'][_0x713f('0x26')]);}else{logger[_0x713f('0x1e')](_0x713f('0x1f'),_0x231681,'request\x20sent');_0x2f9c4d(_0x12819a[_0x713f('0x27')][_0x713f('0x26')]);}})[_0x713f('0x28')](function(_0x50ab5e){logger[_0x713f('0x24')](_0x713f('0x1f'),_0x231681,_0x50ab5e);_0x5cae50(_0x50ab5e);});});}function respondWithStatusCode(_0x193bb7,_0x329757){_0x329757=_0x329757||0xcc;return function(_0x2544f4){if(_0x2544f4){return _0x193bb7[_0x713f('0x29')](_0x329757);}return _0x193bb7[_0x713f('0x2a')](_0x329757)[_0x713f('0x2b')]();};}function respondWithResult(_0x2e24c,_0x573cc7){_0x573cc7=_0x573cc7||0xc8;return function(_0xb2fd8f){if(_0xb2fd8f){return _0x2e24c[_0x713f('0x2a')](_0x573cc7)[_0x713f('0x2c')](_0xb2fd8f);}};}function respondWithFilteredResult(_0x5db312,_0x217163){return function(_0x53b5d3){if(_0x53b5d3){var _0x57213e=typeof _0x217163[_0x713f('0x2d')]==='undefined'&&typeof _0x217163[_0x713f('0x2e')]===_0x713f('0x2f');var _0x4f378d=_0x53b5d3['count'];var _0x4f5273=_0x57213e?0x0:_0x217163[_0x713f('0x2d')];var _0x563c46=_0x57213e?_0x53b5d3['count']:_0x217163[_0x713f('0x2d')]+_0x217163[_0x713f('0x2e')];var _0x4f53df;if(_0x563c46>=_0x4f378d){_0x563c46=_0x4f378d;_0x4f53df=0xc8;}else{_0x4f53df=0xce;}_0x5db312[_0x713f('0x2a')](_0x4f53df);return _0x5db312[_0x713f('0x30')]('Content-Range',_0x4f5273+'-'+_0x563c46+'/'+_0x4f378d)[_0x713f('0x2c')](_0x53b5d3);}return null;};}function patchUpdates(_0x4cefde){return function(_0x5b9ea4){try{jsonpatch[_0x713f('0x31')](_0x5b9ea4,_0x4cefde,!![]);}catch(_0x243641){return BPromise[_0x713f('0x32')](_0x243641);}return _0x5b9ea4['save']();};}function saveUpdates(_0x272464,_0x113cbb){return function(_0x317c9a){if(_0x317c9a){return _0x317c9a[_0x713f('0x33')](_0x272464)['then'](function(_0xc3d8bd){return _0xc3d8bd;});}return null;};}function removeEntity(_0x3cdd6c,_0x57e38e){return function(_0x1fbb7f){if(_0x1fbb7f){return _0x1fbb7f[_0x713f('0x34')]()[_0x713f('0x1d')](function(){var _0x47e64e=_0x1fbb7f[_0x713f('0x35')]({'plain':!![]});var _0x2ce918=_0x713f('0x36');return db[_0x713f('0x37')][_0x713f('0x34')]({'where':{'type':_0x2ce918,'resourceId':_0x47e64e['id']}})['then'](function(){return _0x1fbb7f;});})[_0x713f('0x1d')](function(){_0x3cdd6c[_0x713f('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f6f85,_0x3e752b){return function(_0x55090e){if(!_0x55090e){_0x1f6f85[_0x713f('0x29')](0x194);}return _0x55090e;};}function handleError(_0x585047,_0xa186cc){_0xa186cc=_0xa186cc||0x1f4;return function(_0x236401){logger['error'](_0x236401[_0x713f('0x38')]);if(_0x236401[_0x713f('0x39')]){delete _0x236401[_0x713f('0x39')];}_0x585047['status'](_0xa186cc)[_0x713f('0x3a')](_0x236401);};}exports[_0x713f('0x3b')]=function(_0x3196a5,_0x18de01){var _0x555a39={'include':[{'model':db[_0x713f('0x3c')],'as':_0x713f('0x3d')}]},_0x4034d9={},_0x2da80c={'count':0x0,'rows':[]};var _0x10f9db=_[_0x713f('0x3e')](db[_0x713f('0x3f')][_0x713f('0x40')],function(_0xd441bc){return{'name':_0xd441bc[_0x713f('0x41')],'type':_0xd441bc[_0x713f('0x42')][_0x713f('0x43')]};});_0x4034d9[_0x713f('0x44')]=_[_0x713f('0x3e')](_0x10f9db,_0x713f('0x39'));_0x4034d9[_0x713f('0x45')]=_[_0x713f('0x46')](_0x3196a5[_0x713f('0x45')]);_0x4034d9[_0x713f('0x47')]=_[_0x713f('0x48')](_0x4034d9[_0x713f('0x44')],_0x4034d9[_0x713f('0x45')]);_0x555a39[_0x713f('0x49')]=_['intersection'](_0x4034d9[_0x713f('0x44')],qs[_0x713f('0x4a')](_0x3196a5[_0x713f('0x45')][_0x713f('0x4a')]));_0x555a39['attributes']=_0x555a39[_0x713f('0x49')][_0x713f('0x4b')]?_0x555a39[_0x713f('0x49')]:_0x4034d9[_0x713f('0x44')];if(!_0x3196a5[_0x713f('0x45')][_0x713f('0x4c')](_0x713f('0x4d'))){_0x555a39[_0x713f('0x2e')]=qs[_0x713f('0x2e')](_0x3196a5[_0x713f('0x45')][_0x713f('0x2e')]);_0x555a39[_0x713f('0x2d')]=qs[_0x713f('0x2d')](_0x3196a5[_0x713f('0x45')][_0x713f('0x2d')]);}_0x555a39['order']=qs[_0x713f('0x4e')](_0x3196a5[_0x713f('0x45')][_0x713f('0x4e')]);_0x555a39[_0x713f('0x4f')]=qs[_0x713f('0x47')](_[_0x713f('0x50')](_0x3196a5[_0x713f('0x45')],_0x4034d9['filters']),_0x10f9db);if(_0x3196a5[_0x713f('0x45')][_0x713f('0x51')]){_0x555a39['where']=_['merge'](_0x555a39[_0x713f('0x4f')],{'$or':_[_0x713f('0x3e')](_0x10f9db,function(_0x342dfb){if(_0x342dfb[_0x713f('0x42')]!==_0x713f('0x52')){var _0x438034={};_0x438034[_0x342dfb[_0x713f('0x39')]]={'$like':'%'+_0x3196a5[_0x713f('0x45')][_0x713f('0x51')]+'%'};return _0x438034;}})});}_0x555a39=_[_0x713f('0x53')]({},_0x555a39,_0x3196a5[_0x713f('0x54')]);var _0x4fd8b1={'where':_0x555a39[_0x713f('0x4f')]};return db[_0x713f('0x3f')]['count'](_0x4fd8b1)[_0x713f('0x1d')](function(_0x28d9b){_0x2da80c[_0x713f('0x55')]=_0x28d9b;if(_0x3196a5['query'][_0x713f('0x56')]){_0x555a39[_0x713f('0x57')]=[{'all':!![]}];}return db[_0x713f('0x3f')]['findAll'](_0x555a39);})[_0x713f('0x1d')](function(_0x36a5c3){_0x2da80c[_0x713f('0x58')]=_0x36a5c3;return _0x2da80c;})['then'](respondWithFilteredResult(_0x18de01,_0x555a39))[_0x713f('0x28')](handleError(_0x18de01,null));};exports[_0x713f('0x59')]=function(_0x4e02fa,_0x5a9a24){var _0x535e7d={'raw':![],'where':{'id':_0x4e02fa['params']['id']},'include':[{'model':db[_0x713f('0x3c')],'as':_0x713f('0x3d')}]},_0x3fde1c={};_0x3fde1c['model']=_['keys'](db['WhatsappAccount'][_0x713f('0x40')]);_0x3fde1c[_0x713f('0x45')]=_['keys'](_0x4e02fa[_0x713f('0x45')]);_0x3fde1c['filters']=_[_0x713f('0x48')](_0x3fde1c[_0x713f('0x44')],_0x3fde1c[_0x713f('0x45')]);_0x535e7d[_0x713f('0x49')]=_[_0x713f('0x48')](_0x3fde1c[_0x713f('0x44')],qs[_0x713f('0x4a')](_0x4e02fa[_0x713f('0x45')][_0x713f('0x4a')]));_0x535e7d[_0x713f('0x49')]=_0x535e7d[_0x713f('0x49')][_0x713f('0x4b')]?_0x535e7d[_0x713f('0x49')]:_0x3fde1c[_0x713f('0x44')];if(_0x4e02fa['query']['includeAll']){_0x535e7d[_0x713f('0x57')]=[{'all':!![]}];}_0x535e7d=_[_0x713f('0x53')]({},_0x535e7d,_0x4e02fa[_0x713f('0x54')]);return db[_0x713f('0x3f')][_0x713f('0x5a')](_0x535e7d)[_0x713f('0x1d')](handleEntityNotFound(_0x5a9a24,null))[_0x713f('0x1d')](respondWithResult(_0x5a9a24,null))[_0x713f('0x28')](handleError(_0x5a9a24,null));};exports[_0x713f('0x5b')]=function(_0x2c729e,_0x2242ad){return db[_0x713f('0x3f')]['create'](_0x2c729e[_0x713f('0x5c')],{})[_0x713f('0x1d')](function(_0x430158){var _0x29c503=_0x2c729e['user'][_0x713f('0x35')]({'plain':!![]});if(!_0x29c503)throw new Error(_0x713f('0x5d'));if(_0x29c503['role']===_0x713f('0x5e')){var _0x329dab=_0x430158['get']({'plain':!![]});var _0xf175ef=_0x713f('0x36');return db[_0x713f('0x5f')]['find']({'where':{'name':_0xf175ef,'userProfileId':_0x29c503[_0x713f('0x60')]},'raw':!![]})['then'](function(_0x4003c6){if(_0x4003c6&&_0x4003c6[_0x713f('0x61')]===0x0){return db[_0x713f('0x37')][_0x713f('0x5b')]({'name':_0x329dab[_0x713f('0x39')],'resourceId':_0x329dab['id'],'type':_0x4003c6[_0x713f('0x39')],'sectionId':_0x4003c6['id']},{})[_0x713f('0x1d')](function(){return _0x430158;});}else{return _0x430158;}})['catch'](function(_0x103310){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x103310);throw _0x103310;});}return _0x430158;})[_0x713f('0x1d')](respondWithResult(_0x2242ad,0xc9))['catch'](handleError(_0x2242ad,null));};exports[_0x713f('0x33')]=function(_0x4fce5b,_0x41df32){if(_0x4fce5b[_0x713f('0x5c')]['id']){delete _0x4fce5b['body']['id'];}return db['WhatsappAccount'][_0x713f('0x5a')]({'where':{'id':_0x4fce5b['params']['id']},'include':[{'model':db['Pause'],'as':_0x713f('0x3d')}]})[_0x713f('0x1d')](handleEntityNotFound(_0x41df32,null))[_0x713f('0x1d')](saveUpdates(_0x4fce5b['body'],null))['then'](respondWithResult(_0x41df32,null))[_0x713f('0x28')](handleError(_0x41df32,null));};exports[_0x713f('0x34')]=function(_0x5182bc,_0x328a61){return db[_0x713f('0x3f')][_0x713f('0x5a')]({'where':{'id':_0x5182bc[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x328a61,null))[_0x713f('0x1d')](removeEntity(_0x328a61,null))[_0x713f('0x28')](handleError(_0x328a61,null));};exports[_0x713f('0x63')]=function(_0x256b68,_0x41d80b){return db['WhatsappAccount'][_0x713f('0x63')]()['then'](respondWithResult(_0x41d80b,null))[_0x713f('0x28')](handleError(_0x41d80b,null));};exports[_0x713f('0x64')]=function(_0x5cadc2,_0xa27afe,_0x407d8c){if(_0x5cadc2[_0x713f('0x5c')]['id']){delete _0x5cadc2[_0x713f('0x5c')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x5cadc2[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0xa27afe,null))[_0x713f('0x1d')](function(_0x227362){if(_0x227362){_0x5cadc2[_0x713f('0x5c')]['WhatsappAccountId']=_0x227362['id'];return db['Disposition'][_0x713f('0x5b')](_0x5cadc2['body']);}})['then'](respondWithResult(_0xa27afe,null))[_0x713f('0x28')](handleError(_0xa27afe,null));};exports[_0x713f('0x65')]=function(_0x5a54ed,_0x5c52d6,_0x2a1fa8){var _0x2e1e67={'raw':![],'where':{}};var _0x48cdcf={};var _0x53b03d={'count':0x0,'rows':[]};return db[_0x713f('0x3f')][_0x713f('0x66')]({'where':{'id':_0x5a54ed[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x5c52d6,null))[_0x713f('0x1d')](function(_0x44b978){if(_0x44b978){_0x48cdcf[_0x713f('0x44')]=_[_0x713f('0x46')](db[_0x713f('0x67')]['rawAttributes']);_0x48cdcf[_0x713f('0x45')]=_[_0x713f('0x46')](_0x5a54ed[_0x713f('0x45')]);_0x48cdcf[_0x713f('0x47')]=_[_0x713f('0x48')](_0x48cdcf[_0x713f('0x44')],_0x48cdcf[_0x713f('0x45')]);_0x2e1e67[_0x713f('0x49')]=_['intersection'](_0x48cdcf[_0x713f('0x44')],qs[_0x713f('0x4a')](_0x5a54ed[_0x713f('0x45')][_0x713f('0x4a')]));_0x2e1e67[_0x713f('0x49')]=_0x2e1e67[_0x713f('0x49')][_0x713f('0x4b')]?_0x2e1e67[_0x713f('0x49')]:_0x48cdcf[_0x713f('0x44')];if(!_0x5a54ed['query'][_0x713f('0x4c')](_0x713f('0x4d'))){_0x2e1e67['limit']=qs[_0x713f('0x2e')](_0x5a54ed[_0x713f('0x45')][_0x713f('0x2e')]);_0x2e1e67[_0x713f('0x2d')]=qs[_0x713f('0x2d')](_0x5a54ed['query'][_0x713f('0x2d')]);}_0x2e1e67[_0x713f('0x68')]=qs[_0x713f('0x4e')](_0x5a54ed[_0x713f('0x45')]['sort']);_0x2e1e67[_0x713f('0x4f')]=qs['filters'](_['pick'](_0x5a54ed['query'],_0x48cdcf[_0x713f('0x47')]));_0x2e1e67[_0x713f('0x4f')][_0x713f('0x69')]=_0x44b978['id'];if(_0x5a54ed['query'][_0x713f('0x51')]){_0x2e1e67[_0x713f('0x4f')]=_[_0x713f('0x53')](_0x2e1e67[_0x713f('0x4f')],{'$or':_[_0x713f('0x3e')](_0x2e1e67[_0x713f('0x49')],function(_0x2b3530){var _0x14f0df={};_0x14f0df[_0x2b3530]={'$like':'%'+_0x5a54ed[_0x713f('0x45')][_0x713f('0x51')]+'%'};return _0x14f0df;})});}_0x2e1e67=_[_0x713f('0x53')]({},_0x2e1e67,_0x5a54ed[_0x713f('0x54')]);return db[_0x713f('0x67')][_0x713f('0x55')]({'where':_0x2e1e67[_0x713f('0x4f')]})[_0x713f('0x1d')](function(_0x38ed9f){_0x53b03d['count']=_0x38ed9f;if(_0x5a54ed[_0x713f('0x45')][_0x713f('0x56')]){_0x2e1e67[_0x713f('0x57')]=[{'all':!![]}];}return db[_0x713f('0x67')]['findAll'](_0x2e1e67);})['then'](function(_0x762cd7){_0x53b03d[_0x713f('0x58')]=_0x762cd7;return _0x53b03d;});}})[_0x713f('0x1d')](respondWithFilteredResult(_0x5c52d6,_0x2e1e67))['catch'](handleError(_0x5c52d6,null));};exports['removeDispositions']=function(_0x23f9e8,_0x277e77,_0xf0e171){return db['WhatsappAccount']['find']({'where':{'id':_0x23f9e8[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x277e77,null))['then'](function(_0x2fa09a){if(_0x2fa09a){return _0x2fa09a[_0x713f('0x6a')](_0x23f9e8[_0x713f('0x45')][_0x713f('0x6b')]);}})['then'](respondWithStatusCode(_0x277e77,null))[_0x713f('0x28')](handleError(_0x277e77,null));};exports[_0x713f('0x6c')]=function(_0x2e1295,_0xc2490c,_0xffd68b){if(_0x2e1295[_0x713f('0x5c')]['id']){delete _0x2e1295[_0x713f('0x5c')]['id'];}return db['WhatsappAccount'][_0x713f('0x5a')]({'where':{'id':_0x2e1295[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0xc2490c,null))[_0x713f('0x1d')](function(_0x36e704){if(_0x36e704){_0x2e1295[_0x713f('0x5c')][_0x713f('0x69')]=_0x36e704['id'];return db[_0x713f('0x6d')][_0x713f('0x5b')](_0x2e1295['body']);}})['then'](respondWithResult(_0xc2490c,null))[_0x713f('0x28')](handleError(_0xc2490c,null));};exports[_0x713f('0x6e')]=function(_0x3249d3,_0x3d6947,_0x5eca8f){var _0x5867b1={'raw':![],'where':{}};var _0x4ec6ef={};var _0x25da99={'count':0x0,'rows':[]};return db[_0x713f('0x3f')][_0x713f('0x66')]({'where':{'id':_0x3249d3[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x3d6947,null))[_0x713f('0x1d')](function(_0x1942a5){if(_0x1942a5){_0x4ec6ef[_0x713f('0x44')]=_[_0x713f('0x46')](db[_0x713f('0x6d')][_0x713f('0x40')]);_0x4ec6ef['query']=_[_0x713f('0x46')](_0x3249d3[_0x713f('0x45')]);_0x4ec6ef[_0x713f('0x47')]=_[_0x713f('0x48')](_0x4ec6ef[_0x713f('0x44')],_0x4ec6ef[_0x713f('0x45')]);_0x5867b1['attributes']=_[_0x713f('0x48')](_0x4ec6ef[_0x713f('0x44')],qs[_0x713f('0x4a')](_0x3249d3[_0x713f('0x45')][_0x713f('0x4a')]));_0x5867b1[_0x713f('0x49')]=_0x5867b1[_0x713f('0x49')]['length']?_0x5867b1[_0x713f('0x49')]:_0x4ec6ef[_0x713f('0x44')];if(!_0x3249d3[_0x713f('0x45')][_0x713f('0x4c')](_0x713f('0x4d'))){_0x5867b1[_0x713f('0x2e')]=qs['limit'](_0x3249d3['query'][_0x713f('0x2e')]);_0x5867b1[_0x713f('0x2d')]=qs[_0x713f('0x2d')](_0x3249d3[_0x713f('0x45')][_0x713f('0x2d')]);}_0x5867b1['order']=qs['sort'](_0x3249d3['query'][_0x713f('0x4e')]);_0x5867b1[_0x713f('0x4f')]=qs[_0x713f('0x47')](_[_0x713f('0x50')](_0x3249d3['query'],_0x4ec6ef['filters']));_0x5867b1['where'][_0x713f('0x69')]=_0x1942a5['id'];if(_0x3249d3[_0x713f('0x45')][_0x713f('0x51')]){_0x5867b1['where']=_['merge'](_0x5867b1[_0x713f('0x4f')],{'$or':_['map'](_0x5867b1[_0x713f('0x49')],function(_0x3fea47){var _0x401b5f={};_0x401b5f[_0x3fea47]={'$like':'%'+_0x3249d3['query'][_0x713f('0x51')]+'%'};return _0x401b5f;})});}_0x5867b1=_[_0x713f('0x53')]({},_0x5867b1,_0x3249d3[_0x713f('0x54')]);return db[_0x713f('0x6d')][_0x713f('0x55')]({'where':_0x5867b1[_0x713f('0x4f')]})[_0x713f('0x1d')](function(_0x5441ee){_0x25da99[_0x713f('0x55')]=_0x5441ee;if(_0x3249d3[_0x713f('0x45')][_0x713f('0x56')]){_0x5867b1['include']=[{'all':!![]}];}return db[_0x713f('0x6d')][_0x713f('0x6f')](_0x5867b1);})[_0x713f('0x1d')](function(_0x59e4d0){_0x25da99[_0x713f('0x58')]=_0x59e4d0;return _0x25da99;});}})['then'](respondWithFilteredResult(_0x3d6947,_0x5867b1))[_0x713f('0x28')](handleError(_0x3d6947,null));};exports[_0x713f('0x70')]=function(_0x2e01fd,_0x1e80c8,_0xeb7d69){return db['WhatsappAccount']['find']({'where':{'id':_0x2e01fd['params']['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x1e80c8,null))['then'](function(_0x33c310){if(_0x33c310){return _0x33c310[_0x713f('0x70')](_0x2e01fd['query'][_0x713f('0x6b')]);}})[_0x713f('0x1d')](respondWithStatusCode(_0x1e80c8,null))[_0x713f('0x28')](handleError(_0x1e80c8,null));};exports['addAgents']=function(_0x2cf99c,_0x16fbb2,_0x3b78a6){return db[_0x713f('0x3f')][_0x713f('0x5a')]({'where':{'id':_0x2cf99c['params']['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x16fbb2,null))['then'](function(_0x7921fa){if(_0x7921fa){return _0x7921fa[_0x713f('0x71')](_0x2cf99c['body'][_0x713f('0x6b')],_[_0x713f('0x72')](_0x2cf99c[_0x713f('0x5c')],[_0x713f('0x6b'),'id'])||{})['spread'](function(_0x39ab0d){for(var _0x203aa9=0x0;_0x203aa9<_0x2cf99c['body'][_0x713f('0x6b')][_0x713f('0x4b')];_0x203aa9+=0x1){socket[_0x713f('0x73')](_0x713f('0x74'),{'UserId':Number(_0x2cf99c[_0x713f('0x5c')][_0x713f('0x6b')][_0x203aa9]),'WhatsappAccountId':Number(_0x2cf99c[_0x713f('0x62')]['id'])});}return _0x39ab0d;});}})['then'](respondWithResult(_0x16fbb2,null))[_0x713f('0x28')](handleError(_0x16fbb2,null));};exports[_0x713f('0x75')]=function(_0x1cd65d,_0x162372,_0x5044f){return db[_0x713f('0x3f')][_0x713f('0x5a')]({'where':{'id':_0x1cd65d[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x162372,null))['then'](function(_0x243e3e){if(_0x243e3e){return _0x243e3e[_0x713f('0x75')](_0x1cd65d[_0x713f('0x45')][_0x713f('0x6b')])[_0x713f('0x1d')](function(){if(_[_0x713f('0x76')](_0x1cd65d[_0x713f('0x45')][_0x713f('0x6b')])){for(var _0x59f4c7=0x0;_0x59f4c7<_0x1cd65d[_0x713f('0x45')][_0x713f('0x6b')][_0x713f('0x4b')];_0x59f4c7+=0x1){socket[_0x713f('0x73')](_0x713f('0x77'),{'UserId':Number(_0x1cd65d[_0x713f('0x45')]['ids'][_0x59f4c7]),'WhatsappAccountId':Number(_0x1cd65d[_0x713f('0x62')]['id'])});}}else{socket[_0x713f('0x73')](_0x713f('0x77'),{'UserId':Number(_0x1cd65d['query']['ids']),'WhatsappAccountId':Number(_0x1cd65d[_0x713f('0x62')]['id'])});}});}})[_0x713f('0x1d')](respondWithStatusCode(_0x162372,null))['catch'](handleError(_0x162372,null));};exports['getAgents']=function(_0x236a77,_0x5997ae,_0x1d9749){var _0x46d7fa={};var _0x22be8d={};var _0x9e9078;var _0x9f062d;return db['WhatsappAccount'][_0x713f('0x66')]({'where':{'id':_0x236a77[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x5997ae,null))['then'](function(_0x4a06ac){if(_0x4a06ac){_0x9e9078=_0x4a06ac;_0x22be8d[_0x713f('0x44')]=_['keys'](db[_0x713f('0x78')][_0x713f('0x40')]);_0x22be8d['query']=_[_0x713f('0x46')](_0x236a77['query']);_0x22be8d[_0x713f('0x47')]=_[_0x713f('0x48')](_0x22be8d[_0x713f('0x44')],_0x22be8d[_0x713f('0x45')]);_0x46d7fa[_0x713f('0x49')]=_['intersection'](_0x22be8d[_0x713f('0x44')],qs['fields'](_0x236a77[_0x713f('0x45')][_0x713f('0x4a')]));_0x46d7fa[_0x713f('0x49')]=_0x46d7fa[_0x713f('0x49')][_0x713f('0x4b')]?_0x46d7fa[_0x713f('0x49')]:_0x22be8d[_0x713f('0x44')];_0x46d7fa['order']=qs[_0x713f('0x4e')](_0x236a77[_0x713f('0x45')]['sort']);_0x46d7fa['where']=qs[_0x713f('0x47')](_[_0x713f('0x50')](_0x236a77[_0x713f('0x45')],_0x22be8d['filters']));if(_0x236a77['query'][_0x713f('0x51')]){_0x46d7fa[_0x713f('0x4f')]=_[_0x713f('0x53')](_0x46d7fa[_0x713f('0x4f')],{'$or':_[_0x713f('0x3e')](_0x46d7fa[_0x713f('0x49')],function(_0x4ebbd7){var _0x442861={};_0x442861[_0x4ebbd7]={'$like':'%'+_0x236a77[_0x713f('0x45')]['filter']+'%'};return _0x442861;})});}_0x46d7fa=_['merge']({},_0x46d7fa,_0x236a77[_0x713f('0x54')]);return _0x9e9078[_0x713f('0x79')](_0x46d7fa);}})[_0x713f('0x1d')](function(_0x107533){if(_0x107533){_0x9f062d=_0x107533['length'];if(!_0x236a77['query'][_0x713f('0x4c')](_0x713f('0x4d'))){_0x46d7fa[_0x713f('0x2e')]=qs[_0x713f('0x2e')](_0x236a77[_0x713f('0x45')][_0x713f('0x2e')]);_0x46d7fa['offset']=qs[_0x713f('0x2d')](_0x236a77[_0x713f('0x45')][_0x713f('0x2d')]);}return _0x9e9078[_0x713f('0x79')](_0x46d7fa);}})[_0x713f('0x1d')](function(_0x2b00c2){if(_0x2b00c2){return _0x2b00c2?{'count':_0x9f062d,'rows':_0x2b00c2}:null;}})[_0x713f('0x1d')](respondWithResult(_0x5997ae,null))['catch'](handleError(_0x5997ae,null));};exports[_0x713f('0x7a')]=function(_0x2066c9,_0x15b940){var _0x2b311e=_0x2066c9['params']['id'];var _0x24fd15=_0x2066c9[_0x713f('0x5c')];var _0x395f2a=0xc8;var _0x25b67d=null;return db[_0x713f('0x7b')][_0x713f('0x7c')]({'isolationLevel':db[_0x713f('0x7b')][_0x713f('0x7d')][_0x713f('0x7e')][_0x713f('0x7f')]},function(_0x3783b2){return db[_0x713f('0x3f')][_0x713f('0x66')]({'where':{'id':_0x2b311e},'transaction':_0x3783b2})[_0x713f('0x1d')](function(_0x5ced8b){if(_0x5ced8b){return db[_0x713f('0x80')][_0x713f('0x34')]({'where':{'WhatsappAccountId':_0x2b311e},'transaction':_0x3783b2})['then'](function(){var _0x4413c1=_['map'](_0x24fd15,function(_0x117d5e){_0x117d5e['WhatsappAccountId']=_0x2b311e;return _0x117d5e;});return db[_0x713f('0x80')][_0x713f('0x81')](_0x4413c1,{'transaction':_0x3783b2});});}else{_0x395f2a=0x194;_0x25b67d=[];}});})[_0x713f('0x1d')](function(){if(_0x395f2a!==0x194){return db[_0x713f('0x80')][_0x713f('0x82')]({'where':{'WhatsappAccountId':_0x2b311e},'order':_0x713f('0x83')})['then'](function(_0x39e0fe){_0x25b67d=_0x39e0fe;});}})[_0x713f('0x28')](function(_0x267d75){_0x395f2a=0x1f4;logger[_0x713f('0x24')](_0x267d75[_0x713f('0x38')]);if(_0x267d75['name']){delete _0x267d75[_0x713f('0x39')];}_0x25b67d=_0x267d75;})[_0x713f('0x84')](function(){if(_0x25b67d===null){_0x15b940[_0x713f('0x29')](_0x395f2a);}else{if(_0x395f2a===0x1f4){_0x15b940[_0x713f('0x2a')](_0x395f2a)[_0x713f('0x3a')](_0x25b67d);}else{_0x15b940[_0x713f('0x2a')](_0x395f2a)['json'](_0x25b67d);}}});};exports[_0x713f('0x85')]=function(_0x30b8e2,_0x1c1924,_0x5005a8){var _0x3eb559={};var _0x34dd68={};var _0x16e8bd;var _0x32306d;return db[_0x713f('0x3f')][_0x713f('0x66')]({'where':{'id':_0x30b8e2[_0x713f('0x62')]['id']}})[_0x713f('0x1d')](handleEntityNotFound(_0x1c1924,null))[_0x713f('0x1d')](function(_0x3558c3){if(_0x3558c3){_0x16e8bd=_0x3558c3;_0x34dd68[_0x713f('0x44')]=_[_0x713f('0x46')](db[_0x713f('0x80')][_0x713f('0x40')]);_0x34dd68[_0x713f('0x45')]=_[_0x713f('0x46')](_0x30b8e2[_0x713f('0x45')]);_0x34dd68[_0x713f('0x47')]=_[_0x713f('0x48')](_0x34dd68[_0x713f('0x44')],_0x34dd68[_0x713f('0x45')]);_0x3eb559[_0x713f('0x49')]=_[_0x713f('0x48')](_0x34dd68[_0x713f('0x44')],qs[_0x713f('0x4a')](_0x30b8e2[_0x713f('0x45')]['fields']));_0x3eb559[_0x713f('0x49')]=_0x3eb559[_0x713f('0x49')]['length']?_0x3eb559[_0x713f('0x49')]:_0x34dd68[_0x713f('0x44')];_0x3eb559['order']=qs['sort'](_0x30b8e2['query'][_0x713f('0x4e')]);_0x3eb559[_0x713f('0x4f')]=qs['filters'](_[_0x713f('0x50')](_0x30b8e2[_0x713f('0x45')],_0x34dd68['filters']));if(_0x30b8e2['query'][_0x713f('0x51')]){_0x3eb559['where']=_[_0x713f('0x53')](_0x3eb559[_0x713f('0x4f')],{'$or':_[_0x713f('0x3e')](_0x3eb559[_0x713f('0x49')],function(_0x379b02){var _0x19f43e={};_0x19f43e[_0x379b02]={'$like':'%'+_0x30b8e2[_0x713f('0x45')][_0x713f('0x51')]+'%'};return _0x19f43e;})});}_0x3eb559=_['merge']({},_0x3eb559,_0x30b8e2[_0x713f('0x54')]);return _0x16e8bd[_0x713f('0x85')](_0x3eb559);}})['then'](function(_0x211ddf){if(_0x211ddf){_0x32306d=_0x211ddf[_0x713f('0x4b')];if(!_0x30b8e2['query'][_0x713f('0x4c')](_0x713f('0x4d'))){_0x3eb559[_0x713f('0x2e')]=qs[_0x713f('0x2e')](_0x30b8e2[_0x713f('0x45')][_0x713f('0x2e')]);_0x3eb559[_0x713f('0x2d')]=qs[_0x713f('0x2d')](_0x30b8e2['query'][_0x713f('0x2d')]);}return _0x16e8bd['getApplications'](_0x3eb559);}})[_0x713f('0x1d')](function(_0x5f0b8a){if(_0x5f0b8a){return _0x5f0b8a?{'count':_0x32306d,'rows':_0x5f0b8a}:null;}})['then'](respondWithResult(_0x1c1924,null))['catch'](handleError(_0x1c1924,null));};exports[_0x713f('0x86')]=function(_0x10abdd,_0x3da6a0,_0x5e841d){var _0x7b95eb={'channel':_0x713f('0x87')};var _0x410190=[];var _0x49eafe=[];var _0x509d9d={};return db[_0x713f('0x3f')][_0x713f('0x5a')]({'where':{'id':_0x10abdd[_0x713f('0x62')]['id']},'include':[{'model':db[_0x713f('0x80')],'as':_0x713f('0x88')}]})['then'](handleEntityNotFound(_0x3da6a0,null))[_0x713f('0x1d')](function(_0x5d9218){_0x7b95eb[_0x713f('0x89')]=_0x5d9218;if(_0x7b95eb[_0x713f('0x89')]&&_0x7b95eb[_0x713f('0x89')][_0x713f('0x42')]==='sinch'&&_0x10abdd[_0x713f('0x5c')][_0x713f('0x8a')]){if(_0x10abdd[_0x713f('0x5c')][_0x713f('0x8a')][_0x713f('0x4b')]===0x0)return;if(_0x10abdd[_0x713f('0x5c')]['statuses'][0x0][_0x713f('0x8b')]!=='read')return;return db[_0x713f('0x8c')][_0x713f('0x33')]({'read':!![],'readAt':_0x10abdd[_0x713f('0x5c')][_0x713f('0x8a')][0x0][_0x713f('0x8d')]},{'where':{'messageId':_0x10abdd[_0x713f('0x5c')][_0x713f('0x8a')][0x0][_0x713f('0x8e')]},'individualHooks':!![]})[_0x713f('0x1d')](function(_0x29ff68){return _0x3da6a0[_0x713f('0x2a')](0xc8)[_0x713f('0x2c')](_0x29ff68);});}_0x7b95eb[_0x713f('0x8f')]=_['orderBy'](_0x5d9218[_0x713f('0x88')],['priority'],[_0x713f('0x90')]);if(_0x7b95eb[_0x713f('0x89')][_0x713f('0x88')]){delete _0x7b95eb[_0x713f('0x89')][_0x713f('0x88')];}return db[_0x713f('0x91')]['describe']()[_0x713f('0x1d')](function(_0x53093f){if(!_0x53093f){throw new db[(_0x713f('0x92'))][(_0x713f('0x93'))](_0x713f('0x94'));}_0x410190=_[_0x713f('0x95')](_[_0x713f('0x46')](_0x53093f),[_0x713f('0x96'),_0x713f('0x97')]);_0x49eafe=_[_0x713f('0x95')](_[_0x713f('0x46')](_0x53093f),[_0x713f('0x96'),_0x713f('0x97'),'CompanyId',_0x713f('0x98')]);_0x7b95eb[_0x713f('0x5c')]={'mapKey':_0x713f('0x99')};if(_0x7b95eb[_0x713f('0x89')]&&_0x7b95eb[_0x713f('0x89')][_0x713f('0x42')]===_0x713f('0x9a')){_0x7b95eb[_0x713f('0x5c')]['from']=_0x10abdd[_0x713f('0x5c')]['From']['replace']('whatsapp:','');_0x7b95eb['body'][_0x713f('0x5c')]=_0x10abdd[_0x713f('0x5c')][_0x713f('0x9b')];_0x7b95eb['body']['messageId']=_0x10abdd[_0x713f('0x5c')][_0x713f('0x9c')];}if(_0x7b95eb[_0x713f('0x89')]&&_0x7b95eb['account']['type']===_0x713f('0x9d')){_0x7b95eb[_0x713f('0x5c')][_0x713f('0x9e')]=_0x10abdd[_0x713f('0x5c')][_0x713f('0x9f')][0x0][_0x713f('0x9e')];_0x7b95eb['body'][_0x713f('0x5c')]=_0x10abdd[_0x713f('0x5c')]['notifications'][0x0][_0x713f('0x26')][_0x713f('0x5c')];_0x7b95eb[_0x713f('0x5c')][_0x713f('0xa0')]=_0x10abdd[_0x713f('0x5c')][_0x713f('0x9f')][0x0][_0x713f('0x8e')];}if(_0x7b95eb[_0x713f('0x5c')]['id']){delete _0x7b95eb[_0x713f('0x5c')]['id'];}if(_[_0x713f('0xa1')](_0x7b95eb[_0x713f('0x5c')][_0x713f('0x9e')])){throw new db[(_0x713f('0x92'))][(_0x713f('0x93'))](_0x713f('0xa2'));}if(_[_0x713f('0xa1')](_0x7b95eb[_0x713f('0x5c')][_0x713f('0x5c')])||_0x7b95eb[_0x713f('0x5c')][_0x713f('0x5c')]===''){throw new db[(_0x713f('0x92'))][(_0x713f('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x713f('0xa1')](_0x7b95eb[_0x713f('0x5c')]['mapKey'])){throw new db[(_0x713f('0x92'))][(_0x713f('0x93'))](_0x713f('0xa3')+_0x49eafe);}if(!_[_0x713f('0xa4')](_0x49eafe,_0x7b95eb[_0x713f('0x5c')][_0x713f('0xa5')])){throw new db['Sequelize']['ValidationError'](_0x713f('0xa6')+_0x49eafe);}_0x509d9d[_0x7b95eb[_0x713f('0x5c')][_0x713f('0xa5')]]=_0x7b95eb['body'][_0x713f('0x9e')];return db[_0x713f('0xa7')][_0x713f('0x5a')]({'where':{'id':_0x7b95eb[_0x713f('0x89')][_0x713f('0x98')]},'include':[{'model':db['CmContact'],'as':_0x713f('0xa8'),'where':_0x509d9d,'limit':0x1,'order':[[_0x713f('0x97'),'DESC']]}]});})['then'](handleEntityNotFound(_0x3da6a0,null))[_0x713f('0x1d')](function(_0x35fb8b){if(_0x35fb8b){_0x7b95eb[_0x713f('0xa9')]=_[_0x713f('0x72')](_0x35fb8b,[_0x713f('0xa8')]);if(_0x35fb8b['Contacts']['length']){return _0x35fb8b[_0x713f('0xa8')][0x0];}var _0x7c3b12=_[_0x713f('0x17')](_0x7b95eb[_0x713f('0x5c')],{'firstName':_0x7b95eb['body'][_0x713f('0x9e')],'ListId':_0x35fb8b['id']});_0x7c3b12[_0x7b95eb[_0x713f('0x5c')][_0x713f('0xa5')]]=_0x7b95eb[_0x713f('0x5c')][_0x713f('0x9e')];return db[_0x713f('0x91')][_0x713f('0x5b')](_0x7c3b12,{'fields':_0x410190,'raw':!![]});}})[_0x713f('0x1d')](handleEntityNotFound(_0x3da6a0,null))[_0x713f('0x1d')](function(_0x2d536c){if(_0x2d536c){_0x7b95eb[_0x713f('0xaa')]=_0x2d536c;var _0x57aa58={'ContactId':_0x2d536c['id'],'phone':_0x7b95eb['body'][_0x713f('0x9e')],'WhatsappAccountId':_0x10abdd[_0x713f('0x62')]['id']};var _0x51f4ac={'ContactId':_0x2d536c['id'],'WhatsappAccountId':_0x10abdd['params']['id'],'closed':![]};return db[_0x713f('0xab')][_0x713f('0x5a')]({'where':_0x51f4ac})[_0x713f('0x1d')](function(_0x36620b){if(_0x36620b){return[_0x36620b,![]];}return db['WhatsappInteraction'][_0x713f('0x5b')](_0x57aa58)[_0x713f('0x1d')](function(_0x3cfbab){return[_0x3cfbab,!![]];});});}})[_0x713f('0xac')](function(_0x4c8beb,_0x554fd4){_0x7b95eb[_0x713f('0xad')]=_0x4c8beb[_0x713f('0x35')]({'plain':!![]});_0x7b95eb[_0x713f('0xad')]['created']=![];if(_0x554fd4){if(_0x7b95eb[_0x713f('0x89')][_0x713f('0xae')]){_0x7b95eb[_0x713f('0x8f')][_0x713f('0xaf')]({'id':0x0,'priority':_0x7b95eb[_0x713f('0x8f')]['length']+0x1,'app':_0x713f('0xb0'),'appdata':_0x713f('0xb1'),'interval':_0x713f('0xb2')});}_0x7b95eb['interaction'][_0x713f('0xb3')]=!![];}return db[_0x713f('0x8c')][_0x713f('0x5b')]({'phone':_0x7b95eb[_0x713f('0x5c')][_0x713f('0x9e')],'messageId':_0x7b95eb[_0x713f('0x5c')][_0x713f('0xa0')],'body':_0x7b95eb[_0x713f('0x5c')]['body'],'WhatsappAccountId':_0x10abdd[_0x713f('0x62')]['id'],'WhatsappInteractionId':_0x4c8beb['id'],'direction':'in','ContactId':_0x4c8beb['ContactId'],'AttachmentId':_0x7b95eb['body'][_0x713f('0xb4')]});})[_0x713f('0x1d')](function(_0x50553c){_0x7b95eb[_0x713f('0x26')]=_0x50553c;if(_0x7b95eb[_0x713f('0xad')][_0x713f('0xb5')]){return db[_0x713f('0x78')]['find']({'attributes':['id',_0x713f('0x39')],'where':{'id':_0x7b95eb[_0x713f('0xad')][_0x713f('0xb5')]}})[_0x713f('0x1d')](function(_0x23a1d3){if(_0x23a1d3){_0x7b95eb['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x713f('0xb6'),'appdata':_0x23a1d3[_0x713f('0x39')]+','+(_0x7b95eb[_0x713f('0x89')][_0x713f('0xb7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x713f('0xb8'),'startRouting',_0x7b95eb);});}return respondWithRpcPromise(_0x713f('0xb8'),_0x713f('0xb9'),_0x7b95eb);})['then'](function(_0x5695da){if(_0x5695da){var _0x127128=0xc8;var _0x588170='receiveMessage';logger[_0x713f('0x1e')](_0x713f('0x21'),_0x588170,_0x127128,_0x713f('0xba'));logger[_0x713f('0x20')](_0x713f('0xbb'),_0x588170,_0x127128,_0x713f('0xba'),JSON[_0x713f('0x23')](_0x5695da));if(_0x7b95eb[_0x713f('0x89')][_0x713f('0x42')]===_0x713f('0x9a')){return _0x3da6a0[_0x713f('0x2a')](_0x127128)['set']('Content-Type','text/xml')[_0x713f('0x3a')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x3da6a0[_0x713f('0x2a')](_0x127128)['json'](_0x5695da);}}});})[_0x713f('0x28')](handleError(_0x3da6a0,null));};exports[_0x713f('0x3a')]=function(_0x3f525f,_0x1f1efe,_0x35de4c){var _0x4573b0,_0x348d0f,_0x47877b;if(_[_0x713f('0xa1')](_0x3f525f['body'][_0x713f('0x5c')])||_0x3f525f[_0x713f('0x5c')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x713f('0xbc'));}if(_['isNil'](_0x3f525f[_0x713f('0x5c')]['to'])){throw new db[(_0x713f('0x92'))][(_0x713f('0x93'))]('to\x20is\x20mandatory');}_0x4573b0=_0x3f525f['body']['to'];return db[_0x713f('0x3f')][_0x713f('0x5a')]({'where':{'id':_0x3f525f['params']['id']},'include':[{'model':db[_0x713f('0xa7')],'as':_0x713f('0xbd'),'include':[{'model':db[_0x713f('0x91')],'as':_0x713f('0xa8'),'where':{'mobile':_0x4573b0},'limit':0x1,'order':[['updatedAt',_0x713f('0xbe')]]}]}]})[_0x713f('0x1d')](handleEntityNotFound(_0x1f1efe,null))[_0x713f('0x1d')](function(_0x22908c){if(_0x22908c&&_0x22908c[_0x713f('0xbd')]){_0x348d0f=_0x22908c[_0x713f('0x35')]({'plain':!![]});if(_0x348d0f[_0x713f('0xbd')]&&_0x348d0f[_0x713f('0xbd')]['Contacts'][_0x713f('0x4b')]){return _0x348d0f[_0x713f('0xbd')][_0x713f('0xa8')][0x0];}return db[_0x713f('0x91')][_0x713f('0x5b')](_[_0x713f('0x17')](_0x3f525f[_0x713f('0x5c')],{'firstName':_0x4573b0,'mobile':_0x4573b0,'phone':_0x4573b0,'ListId':_0x348d0f[_0x713f('0x98')]}));}})[_0x713f('0x1d')](handleEntityNotFound(_0x1f1efe,null))[_0x713f('0x1d')](function(_0xdae22a){if(_0xdae22a){_0x47877b=_0xdae22a;return db[_0x713f('0xab')][_0x713f('0x5a')]({'where':{'ContactId':_0x47877b['id'],'closed':![],'WhatsappAccountId':_0x348d0f['id']}})[_0x713f('0x1d')](function(_0x1781f8){if(_0x1781f8){return[_0x1781f8,![]];}return db[_0x713f('0xab')]['create']({'UserId':_0x3f525f['user']['id'],'ContactId':_0x47877b['id'],'WhatsappAccountId':_0x348d0f['id'],'phone':_0x4573b0,'firstMsgDirection':_0x713f('0xbf'),'Messages':[_[_0x713f('0x53')](_0x3f525f[_0x713f('0x5c')],{'read':![],'body':_0x3f525f[_0x713f('0x5c')][_0x713f('0x5c')],'phone':_0x4573b0,'WhatsappAccountId':_0x348d0f['id'],'UserId':_0x3f525f[_0x713f('0x5e')]['id'],'ContactId':_0x47877b['id']})]},{'include':[{'model':db[_0x713f('0x8c')],'as':_0x713f('0xc0')}]})[_0x713f('0x1d')](function(_0x1149a4){return[_0x1149a4,!![]];});});}})[_0x713f('0xac')](function(_0x2aaae3,_0x1046f6){if(_0x1046f6){return _0x2aaae3;}return db[_0x713f('0x8c')][_0x713f('0x5b')](_[_0x713f('0x53')](_0x3f525f[_0x713f('0x5c')],{'read':![],'body':_0x3f525f['body'][_0x713f('0x5c')],'phone':_0x4573b0,'WhatsappAccountId':_0x348d0f['id'],'WhatsappInteractionId':_0x2aaae3['id'],'UserId':_0x3f525f[_0x713f('0x5e')]['id'],'ContactId':_0x47877b['id']}))[_0x713f('0x1d')](function(_0x2011fd){_0x2aaae3[_0x713f('0xc1')][_0x713f('0xc0')]=[];_0x2aaae3[_0x713f('0xc1')][_0x713f('0xc0')]['push'](_0x2011fd[_0x713f('0xc1')]);return _0x2aaae3;});})['then'](respondWithResult(_0x1f1efe,null))[_0x713f('0x28')](handleError(_0x1f1efe,null));};
\ No newline at end of file
+var _0xbee4=['sendStatus','status','json','offset','count','limit','set','Content-Range','apply','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','name','includeAll','include','rows','show','params','keys','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','WhatsappApplication','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','from','replace','whatsapp:','messageId','MessageSid','sinch','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','omit','contact','WhatsappInteraction','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','stringify','Content-Type','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','spread','dataValues','push','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x27923d,_0xa2c725){var _0x1911d3=function(_0x3de7c1){while(--_0x3de7c1){_0x27923d['push'](_0x27923d['shift']());}};_0x1911d3(++_0xa2c725);}(_0xbee4,0x98));var _0x4bee=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbee4[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4bee('0x0'));var zipdir=require(_0x4bee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4bee('0x2'));var BPromise=require(_0x4bee('0x3'));var Mustache=require(_0x4bee('0x4'));var util=require(_0x4bee('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4bee('0x6'));var ejs=require(_0x4bee('0x7'));var fs=require('fs');var fs_extra=require(_0x4bee('0x8'));var _=require(_0x4bee('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4bee('0xa'));var deskjs=require(_0x4bee('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4bee('0xc'));var Papa=require('papaparse');var Redis=require(_0x4bee('0xd'));var authService=require(_0x4bee('0xe'));var qs=require(_0x4bee('0xf'));var as=require(_0x4bee('0x10'));var hardwareService=require(_0x4bee('0x11'));var logger=require(_0x4bee('0x12'))(_0x4bee('0x13'));var utils=require(_0x4bee('0x14'));var config=require(_0x4bee('0x15'));var licenseUtil=require(_0x4bee('0x16'));var db=require(_0x4bee('0x17'))['db'];config[_0x4bee('0x18')]=_[_0x4bee('0x19')](config[_0x4bee('0x18')],{'host':_0x4bee('0x1a'),'port':0x18eb});var socket=require(_0x4bee('0x1b'))(new Redis(config[_0x4bee('0x18')]));require(_0x4bee('0x1c'))[_0x4bee('0x1d')](socket);var jayson=require(_0x4bee('0x1e'));var client=jayson[_0x4bee('0x1f')][_0x4bee('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5bfb6c,_0x2e2dba,_0x253c84,_0x5e16f4){return new BPromise(function(_0x461568,_0x52ae40){var _0x588ba0=_0x5e16f4||client;return _0x588ba0[_0x4bee('0x21')](_0x5bfb6c,_0x253c84)[_0x4bee('0x22')](function(_0x30e3c5){logger[_0x4bee('0x23')](_0x4bee('0x24'),_0x2e2dba,_0x4bee('0x25'));logger[_0x4bee('0x26')](_0x4bee('0x27'),_0x2e2dba,_0x4bee('0x25'),JSON['stringify'](_0x30e3c5));if(_0x30e3c5[_0x4bee('0x28')]){if(_0x30e3c5[_0x4bee('0x28')][_0x4bee('0x29')]===0x1f4){logger[_0x4bee('0x28')](_0x4bee('0x24'),_0x2e2dba,_0x30e3c5[_0x4bee('0x28')][_0x4bee('0x2a')]);return _0x52ae40(_0x30e3c5[_0x4bee('0x28')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2e2dba,_0x30e3c5[_0x4bee('0x28')]['message']);return _0x461568(_0x30e3c5[_0x4bee('0x28')][_0x4bee('0x2a')]);}else{logger[_0x4bee('0x23')](_0x4bee('0x24'),_0x2e2dba,_0x4bee('0x25'));_0x461568(_0x30e3c5[_0x4bee('0x2b')][_0x4bee('0x2a')]);}})[_0x4bee('0x2c')](function(_0xb4fd48){logger[_0x4bee('0x28')](_0x4bee('0x24'),_0x2e2dba,_0xb4fd48);_0x52ae40(_0xb4fd48);});});}function respondWithStatusCode(_0xb7cdb3,_0x39bf0b){_0x39bf0b=_0x39bf0b||0xcc;return function(_0x86a640){if(_0x86a640){return _0xb7cdb3[_0x4bee('0x2d')](_0x39bf0b);}return _0xb7cdb3[_0x4bee('0x2e')](_0x39bf0b)['end']();};}function respondWithResult(_0x49bf66,_0x22d28a){_0x22d28a=_0x22d28a||0xc8;return function(_0x438d59){if(_0x438d59){return _0x49bf66[_0x4bee('0x2e')](_0x22d28a)[_0x4bee('0x2f')](_0x438d59);}};}function respondWithFilteredResult(_0x497864,_0x4b781c){return function(_0x5a2423){if(_0x5a2423){var _0x5f2901=typeof _0x4b781c[_0x4bee('0x30')]==='undefined'&&typeof _0x4b781c['limit']==='undefined';var _0x35fb02=_0x5a2423[_0x4bee('0x31')];var _0x2b250f=_0x5f2901?0x0:_0x4b781c[_0x4bee('0x30')];var _0x13b875=_0x5f2901?_0x5a2423[_0x4bee('0x31')]:_0x4b781c[_0x4bee('0x30')]+_0x4b781c[_0x4bee('0x32')];var _0x2261eb;if(_0x13b875>=_0x35fb02){_0x13b875=_0x35fb02;_0x2261eb=0xc8;}else{_0x2261eb=0xce;}_0x497864[_0x4bee('0x2e')](_0x2261eb);return _0x497864[_0x4bee('0x33')](_0x4bee('0x34'),_0x2b250f+'-'+_0x13b875+'/'+_0x35fb02)[_0x4bee('0x2f')](_0x5a2423);}return null;};}function patchUpdates(_0x36b48f){return function(_0x263dee){try{jsonpatch[_0x4bee('0x35')](_0x263dee,_0x36b48f,!![]);}catch(_0x1d4c39){return BPromise['reject'](_0x1d4c39);}return _0x263dee[_0x4bee('0x36')]();};}function saveUpdates(_0x1bf7bc,_0x742353){return function(_0x527348){if(_0x527348){return _0x527348[_0x4bee('0x37')](_0x1bf7bc)['then'](function(_0x2f55a8){return _0x2f55a8;});}return null;};}function removeEntity(_0x3ab248,_0x263969){return function(_0x5b7e59){if(_0x5b7e59){return _0x5b7e59[_0x4bee('0x38')]()['then'](function(){var _0x164a15=_0x5b7e59['get']({'plain':!![]});var _0x29a927=_0x4bee('0x39');return db[_0x4bee('0x3a')]['destroy']({'where':{'type':_0x29a927,'resourceId':_0x164a15['id']}})[_0x4bee('0x22')](function(){return _0x5b7e59;});})[_0x4bee('0x22')](function(){_0x3ab248[_0x4bee('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ecf66,_0x10f9f0){return function(_0x17f6ab){if(!_0x17f6ab){_0x4ecf66[_0x4bee('0x2d')](0x194);}return _0x17f6ab;};}function handleError(_0x18c83a,_0x4413cb){_0x4413cb=_0x4413cb||0x1f4;return function(_0x11f0fd){logger['error'](_0x11f0fd[_0x4bee('0x3b')]);if(_0x11f0fd['name']){delete _0x11f0fd['name'];}_0x18c83a['status'](_0x4413cb)[_0x4bee('0x3c')](_0x11f0fd);};}exports[_0x4bee('0x3d')]=function(_0x494992,_0x15eb26){var _0x438509={'include':[{'model':db['Pause'],'as':_0x4bee('0x3e')}]},_0x4e1fc3={},_0x88acef={'count':0x0,'rows':[]};var _0x2008b3=_[_0x4bee('0x3f')](db[_0x4bee('0x40')][_0x4bee('0x41')],function(_0x214ea8){return{'name':_0x214ea8[_0x4bee('0x42')],'type':_0x214ea8[_0x4bee('0x43')][_0x4bee('0x44')]};});_0x4e1fc3[_0x4bee('0x45')]=_[_0x4bee('0x3f')](_0x2008b3,'name');_0x4e1fc3[_0x4bee('0x46')]=_['keys'](_0x494992[_0x4bee('0x46')]);_0x4e1fc3[_0x4bee('0x47')]=_[_0x4bee('0x48')](_0x4e1fc3[_0x4bee('0x45')],_0x4e1fc3[_0x4bee('0x46')]);_0x438509['attributes']=_[_0x4bee('0x48')](_0x4e1fc3['model'],qs[_0x4bee('0x49')](_0x494992[_0x4bee('0x46')]['fields']));_0x438509['attributes']=_0x438509[_0x4bee('0x4a')][_0x4bee('0x4b')]?_0x438509[_0x4bee('0x4a')]:_0x4e1fc3['model'];if(!_0x494992[_0x4bee('0x46')][_0x4bee('0x4c')](_0x4bee('0x4d'))){_0x438509[_0x4bee('0x32')]=qs[_0x4bee('0x32')](_0x494992[_0x4bee('0x46')][_0x4bee('0x32')]);_0x438509[_0x4bee('0x30')]=qs[_0x4bee('0x30')](_0x494992[_0x4bee('0x46')][_0x4bee('0x30')]);}_0x438509[_0x4bee('0x4e')]=qs[_0x4bee('0x4f')](_0x494992['query'][_0x4bee('0x4f')]);_0x438509['where']=qs['filters'](_['pick'](_0x494992[_0x4bee('0x46')],_0x4e1fc3[_0x4bee('0x47')]),_0x2008b3);if(_0x494992['query'][_0x4bee('0x50')]){_0x438509[_0x4bee('0x51')]=_[_0x4bee('0x52')](_0x438509[_0x4bee('0x51')],{'$or':_[_0x4bee('0x3f')](_0x2008b3,function(_0x2a867f){if(_0x2a867f[_0x4bee('0x43')]!=='VIRTUAL'){var _0x37136a={};_0x37136a[_0x2a867f[_0x4bee('0x53')]]={'$like':'%'+_0x494992[_0x4bee('0x46')]['filter']+'%'};return _0x37136a;}})});}_0x438509=_['merge']({},_0x438509,_0x494992['options']);var _0x44fe3a={'where':_0x438509[_0x4bee('0x51')]};return db[_0x4bee('0x40')][_0x4bee('0x31')](_0x44fe3a)[_0x4bee('0x22')](function(_0x192427){_0x88acef[_0x4bee('0x31')]=_0x192427;if(_0x494992[_0x4bee('0x46')][_0x4bee('0x54')]){_0x438509[_0x4bee('0x55')]=[{'all':!![]}];}return db[_0x4bee('0x40')]['findAll'](_0x438509);})[_0x4bee('0x22')](function(_0xe6d1bc){_0x88acef[_0x4bee('0x56')]=_0xe6d1bc;return _0x88acef;})[_0x4bee('0x22')](respondWithFilteredResult(_0x15eb26,_0x438509))[_0x4bee('0x2c')](handleError(_0x15eb26,null));};exports[_0x4bee('0x57')]=function(_0x2180e4,_0x9ed612){var _0x58d201={'raw':![],'where':{'id':_0x2180e4[_0x4bee('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x4bee('0x3e')}]},_0x680339={};_0x680339[_0x4bee('0x45')]=_[_0x4bee('0x59')](db[_0x4bee('0x40')][_0x4bee('0x41')]);_0x680339[_0x4bee('0x46')]=_['keys'](_0x2180e4[_0x4bee('0x46')]);_0x680339[_0x4bee('0x47')]=_['intersection'](_0x680339[_0x4bee('0x45')],_0x680339[_0x4bee('0x46')]);_0x58d201[_0x4bee('0x4a')]=_[_0x4bee('0x48')](_0x680339['model'],qs['fields'](_0x2180e4[_0x4bee('0x46')][_0x4bee('0x49')]));_0x58d201[_0x4bee('0x4a')]=_0x58d201[_0x4bee('0x4a')][_0x4bee('0x4b')]?_0x58d201[_0x4bee('0x4a')]:_0x680339[_0x4bee('0x45')];if(_0x2180e4['query'][_0x4bee('0x54')]){_0x58d201[_0x4bee('0x55')]=[{'all':!![]}];}_0x58d201=_[_0x4bee('0x52')]({},_0x58d201,_0x2180e4[_0x4bee('0x5a')]);return db[_0x4bee('0x40')]['find'](_0x58d201)[_0x4bee('0x22')](handleEntityNotFound(_0x9ed612,null))[_0x4bee('0x22')](respondWithResult(_0x9ed612,null))['catch'](handleError(_0x9ed612,null));};exports[_0x4bee('0x5b')]=function(_0x57e405,_0x29e198){return db['WhatsappAccount'][_0x4bee('0x5b')](_0x57e405['body'],{})[_0x4bee('0x22')](function(_0x2afbb7){var _0x805605=_0x57e405[_0x4bee('0x5c')][_0x4bee('0x5d')]({'plain':!![]});if(!_0x805605)throw new Error(_0x4bee('0x5e'));if(_0x805605['role']===_0x4bee('0x5c')){var _0x55babd=_0x2afbb7[_0x4bee('0x5d')]({'plain':!![]});var _0x5155b3=_0x4bee('0x39');return db['UserProfileSection'][_0x4bee('0x5f')]({'where':{'name':_0x5155b3,'userProfileId':_0x805605[_0x4bee('0x60')]},'raw':!![]})['then'](function(_0x483d62){if(_0x483d62&&_0x483d62[_0x4bee('0x61')]===0x0){return db['UserProfileResource'][_0x4bee('0x5b')]({'name':_0x55babd[_0x4bee('0x53')],'resourceId':_0x55babd['id'],'type':_0x483d62['name'],'sectionId':_0x483d62['id']},{})['then'](function(){return _0x2afbb7;});}else{return _0x2afbb7;}})[_0x4bee('0x2c')](function(_0x4ba873){logger['error'](_0x4bee('0x62'),_0x4ba873);throw _0x4ba873;});}return _0x2afbb7;})['then'](respondWithResult(_0x29e198,0xc9))[_0x4bee('0x2c')](handleError(_0x29e198,null));};exports[_0x4bee('0x37')]=function(_0x1cdc5e,_0x24cdf3){if(_0x1cdc5e[_0x4bee('0x63')]['id']){delete _0x1cdc5e[_0x4bee('0x63')]['id'];}return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x1cdc5e[_0x4bee('0x58')]['id']},'include':[{'model':db[_0x4bee('0x64')],'as':_0x4bee('0x3e')}]})[_0x4bee('0x22')](handleEntityNotFound(_0x24cdf3,null))[_0x4bee('0x22')](saveUpdates(_0x1cdc5e['body'],null))[_0x4bee('0x22')](respondWithResult(_0x24cdf3,null))[_0x4bee('0x2c')](handleError(_0x24cdf3,null));};exports[_0x4bee('0x38')]=function(_0x1d3aef,_0x3691b2){return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x1d3aef['params']['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x3691b2,null))[_0x4bee('0x22')](removeEntity(_0x3691b2,null))['catch'](handleError(_0x3691b2,null));};exports[_0x4bee('0x65')]=function(_0x2fa9d2,_0x25c7ce){return db[_0x4bee('0x40')][_0x4bee('0x65')]()['then'](respondWithResult(_0x25c7ce,null))[_0x4bee('0x2c')](handleError(_0x25c7ce,null));};exports['addDisposition']=function(_0x38067e,_0x7a8bee,_0x292070){if(_0x38067e[_0x4bee('0x63')]['id']){delete _0x38067e[_0x4bee('0x63')]['id'];}return db['WhatsappAccount'][_0x4bee('0x5f')]({'where':{'id':_0x38067e[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x7a8bee,null))[_0x4bee('0x22')](function(_0x54963c){if(_0x54963c){_0x38067e['body'][_0x4bee('0x66')]=_0x54963c['id'];return db[_0x4bee('0x67')][_0x4bee('0x5b')](_0x38067e[_0x4bee('0x63')]);}})[_0x4bee('0x22')](respondWithResult(_0x7a8bee,null))[_0x4bee('0x2c')](handleError(_0x7a8bee,null));};exports[_0x4bee('0x68')]=function(_0x3665fd,_0x362120,_0x563a99){var _0x85a63b={'raw':![],'where':{}};var _0x8c51f3={};var _0x397eed={'count':0x0,'rows':[]};return db[_0x4bee('0x40')][_0x4bee('0x69')]({'where':{'id':_0x3665fd[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x362120,null))[_0x4bee('0x22')](function(_0x32d45a){if(_0x32d45a){_0x8c51f3['model']=_[_0x4bee('0x59')](db[_0x4bee('0x67')][_0x4bee('0x41')]);_0x8c51f3['query']=_[_0x4bee('0x59')](_0x3665fd[_0x4bee('0x46')]);_0x8c51f3[_0x4bee('0x47')]=_[_0x4bee('0x48')](_0x8c51f3[_0x4bee('0x45')],_0x8c51f3['query']);_0x85a63b['attributes']=_['intersection'](_0x8c51f3['model'],qs['fields'](_0x3665fd[_0x4bee('0x46')]['fields']));_0x85a63b['attributes']=_0x85a63b['attributes'][_0x4bee('0x4b')]?_0x85a63b[_0x4bee('0x4a')]:_0x8c51f3['model'];if(!_0x3665fd[_0x4bee('0x46')][_0x4bee('0x4c')](_0x4bee('0x4d'))){_0x85a63b['limit']=qs[_0x4bee('0x32')](_0x3665fd[_0x4bee('0x46')][_0x4bee('0x32')]);_0x85a63b[_0x4bee('0x30')]=qs[_0x4bee('0x30')](_0x3665fd['query'][_0x4bee('0x30')]);}_0x85a63b[_0x4bee('0x4e')]=qs[_0x4bee('0x4f')](_0x3665fd[_0x4bee('0x46')]['sort']);_0x85a63b[_0x4bee('0x51')]=qs['filters'](_[_0x4bee('0x6a')](_0x3665fd[_0x4bee('0x46')],_0x8c51f3[_0x4bee('0x47')]));_0x85a63b['where']['WhatsappAccountId']=_0x32d45a['id'];if(_0x3665fd[_0x4bee('0x46')][_0x4bee('0x50')]){_0x85a63b['where']=_['merge'](_0x85a63b[_0x4bee('0x51')],{'$or':_[_0x4bee('0x3f')](_0x85a63b[_0x4bee('0x4a')],function(_0x4809e3){var _0x51897c={};_0x51897c[_0x4809e3]={'$like':'%'+_0x3665fd[_0x4bee('0x46')][_0x4bee('0x50')]+'%'};return _0x51897c;})});}_0x85a63b=_[_0x4bee('0x52')]({},_0x85a63b,_0x3665fd['options']);return db['Disposition']['count']({'where':_0x85a63b[_0x4bee('0x51')]})[_0x4bee('0x22')](function(_0x73e9b3){_0x397eed[_0x4bee('0x31')]=_0x73e9b3;if(_0x3665fd['query'][_0x4bee('0x54')]){_0x85a63b[_0x4bee('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x85a63b);})[_0x4bee('0x22')](function(_0x21634e){_0x397eed[_0x4bee('0x56')]=_0x21634e;return _0x397eed;});}})[_0x4bee('0x22')](respondWithFilteredResult(_0x362120,_0x85a63b))[_0x4bee('0x2c')](handleError(_0x362120,null));};exports[_0x4bee('0x6b')]=function(_0x37ffaf,_0x5e684a,_0x349ca0){return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x37ffaf[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x5e684a,null))[_0x4bee('0x22')](function(_0x177d68){if(_0x177d68){return _0x177d68[_0x4bee('0x6b')](_0x37ffaf['query'][_0x4bee('0x6c')]);}})[_0x4bee('0x22')](respondWithStatusCode(_0x5e684a,null))[_0x4bee('0x2c')](handleError(_0x5e684a,null));};exports[_0x4bee('0x6d')]=function(_0x40b334,_0xd02666,_0x479e8e){if(_0x40b334[_0x4bee('0x63')]['id']){delete _0x40b334[_0x4bee('0x63')]['id'];}return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x40b334[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0xd02666,null))[_0x4bee('0x22')](function(_0x9b6305){if(_0x9b6305){_0x40b334[_0x4bee('0x63')][_0x4bee('0x66')]=_0x9b6305['id'];return db['CannedAnswer'][_0x4bee('0x5b')](_0x40b334[_0x4bee('0x63')]);}})[_0x4bee('0x22')](respondWithResult(_0xd02666,null))[_0x4bee('0x2c')](handleError(_0xd02666,null));};exports[_0x4bee('0x6e')]=function(_0x43e24d,_0xe79b80,_0x49c6f3){var _0x41bc57={'raw':![],'where':{}};var _0x22b3ec={};var _0x3c66b8={'count':0x0,'rows':[]};return db[_0x4bee('0x40')][_0x4bee('0x69')]({'where':{'id':_0x43e24d[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0xe79b80,null))[_0x4bee('0x22')](function(_0x33c512){if(_0x33c512){_0x22b3ec[_0x4bee('0x45')]=_['keys'](db[_0x4bee('0x6f')][_0x4bee('0x41')]);_0x22b3ec[_0x4bee('0x46')]=_[_0x4bee('0x59')](_0x43e24d[_0x4bee('0x46')]);_0x22b3ec[_0x4bee('0x47')]=_['intersection'](_0x22b3ec[_0x4bee('0x45')],_0x22b3ec['query']);_0x41bc57[_0x4bee('0x4a')]=_[_0x4bee('0x48')](_0x22b3ec[_0x4bee('0x45')],qs[_0x4bee('0x49')](_0x43e24d[_0x4bee('0x46')][_0x4bee('0x49')]));_0x41bc57[_0x4bee('0x4a')]=_0x41bc57[_0x4bee('0x4a')][_0x4bee('0x4b')]?_0x41bc57[_0x4bee('0x4a')]:_0x22b3ec[_0x4bee('0x45')];if(!_0x43e24d[_0x4bee('0x46')][_0x4bee('0x4c')](_0x4bee('0x4d'))){_0x41bc57[_0x4bee('0x32')]=qs[_0x4bee('0x32')](_0x43e24d[_0x4bee('0x46')][_0x4bee('0x32')]);_0x41bc57[_0x4bee('0x30')]=qs[_0x4bee('0x30')](_0x43e24d[_0x4bee('0x46')][_0x4bee('0x30')]);}_0x41bc57[_0x4bee('0x4e')]=qs[_0x4bee('0x4f')](_0x43e24d[_0x4bee('0x46')][_0x4bee('0x4f')]);_0x41bc57[_0x4bee('0x51')]=qs['filters'](_[_0x4bee('0x6a')](_0x43e24d[_0x4bee('0x46')],_0x22b3ec[_0x4bee('0x47')]));_0x41bc57[_0x4bee('0x51')][_0x4bee('0x66')]=_0x33c512['id'];if(_0x43e24d['query'][_0x4bee('0x50')]){_0x41bc57[_0x4bee('0x51')]=_[_0x4bee('0x52')](_0x41bc57[_0x4bee('0x51')],{'$or':_[_0x4bee('0x3f')](_0x41bc57['attributes'],function(_0x1e9b2c){var _0x39666d={};_0x39666d[_0x1e9b2c]={'$like':'%'+_0x43e24d[_0x4bee('0x46')]['filter']+'%'};return _0x39666d;})});}_0x41bc57=_[_0x4bee('0x52')]({},_0x41bc57,_0x43e24d[_0x4bee('0x5a')]);return db[_0x4bee('0x6f')][_0x4bee('0x31')]({'where':_0x41bc57[_0x4bee('0x51')]})['then'](function(_0x386015){_0x3c66b8[_0x4bee('0x31')]=_0x386015;if(_0x43e24d[_0x4bee('0x46')]['includeAll']){_0x41bc57['include']=[{'all':!![]}];}return db[_0x4bee('0x6f')][_0x4bee('0x70')](_0x41bc57);})[_0x4bee('0x22')](function(_0x3edd18){_0x3c66b8[_0x4bee('0x56')]=_0x3edd18;return _0x3c66b8;});}})[_0x4bee('0x22')](respondWithFilteredResult(_0xe79b80,_0x41bc57))[_0x4bee('0x2c')](handleError(_0xe79b80,null));};exports[_0x4bee('0x71')]=function(_0x1ea94a,_0x1891d8,_0x52c557){return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x1ea94a[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x1891d8,null))[_0x4bee('0x22')](function(_0x54cae8){if(_0x54cae8){return _0x54cae8[_0x4bee('0x71')](_0x1ea94a['query']['ids']);}})[_0x4bee('0x22')](respondWithStatusCode(_0x1891d8,null))[_0x4bee('0x2c')](handleError(_0x1891d8,null));};exports[_0x4bee('0x72')]=function(_0xd45602,_0x2696f5,_0x364a68){return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0xd45602[_0x4bee('0x58')]['id']}})['then'](handleEntityNotFound(_0x2696f5,null))['then'](function(_0x3bbdf4){if(_0x3bbdf4){return _0x3bbdf4[_0x4bee('0x72')](_0xd45602[_0x4bee('0x63')][_0x4bee('0x6c')],_['omit'](_0xd45602['body'],['ids','id'])||{})['spread'](function(_0x1ca0d0){for(var _0x2e4f3c=0x0;_0x2e4f3c<_0xd45602['body'][_0x4bee('0x6c')][_0x4bee('0x4b')];_0x2e4f3c+=0x1){socket[_0x4bee('0x73')](_0x4bee('0x74'),{'UserId':Number(_0xd45602[_0x4bee('0x63')][_0x4bee('0x6c')][_0x2e4f3c]),'WhatsappAccountId':Number(_0xd45602[_0x4bee('0x58')]['id'])});}return _0x1ca0d0;});}})[_0x4bee('0x22')](respondWithResult(_0x2696f5,null))[_0x4bee('0x2c')](handleError(_0x2696f5,null));};exports[_0x4bee('0x75')]=function(_0x150d1b,_0x4a1d3e,_0x304c14){return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x150d1b[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0x4a1d3e,null))[_0x4bee('0x22')](function(_0x5bba2d){if(_0x5bba2d){return _0x5bba2d['removeAgents'](_0x150d1b[_0x4bee('0x46')][_0x4bee('0x6c')])['then'](function(){if(_[_0x4bee('0x76')](_0x150d1b['query'][_0x4bee('0x6c')])){for(var _0x292309=0x0;_0x292309<_0x150d1b[_0x4bee('0x46')][_0x4bee('0x6c')]['length'];_0x292309+=0x1){socket[_0x4bee('0x73')](_0x4bee('0x77'),{'UserId':Number(_0x150d1b['query'][_0x4bee('0x6c')][_0x292309]),'WhatsappAccountId':Number(_0x150d1b[_0x4bee('0x58')]['id'])});}}else{socket[_0x4bee('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x150d1b[_0x4bee('0x46')][_0x4bee('0x6c')]),'WhatsappAccountId':Number(_0x150d1b[_0x4bee('0x58')]['id'])});}});}})[_0x4bee('0x22')](respondWithStatusCode(_0x4a1d3e,null))[_0x4bee('0x2c')](handleError(_0x4a1d3e,null));};exports[_0x4bee('0x78')]=function(_0xc286b4,_0xf05ffe,_0xfa90b1){var _0x504562={};var _0x55e45b={};var _0x46d609;var _0x1f5764;return db[_0x4bee('0x40')]['findOne']({'where':{'id':_0xc286b4[_0x4bee('0x58')]['id']}})[_0x4bee('0x22')](handleEntityNotFound(_0xf05ffe,null))[_0x4bee('0x22')](function(_0x22a80c){if(_0x22a80c){_0x46d609=_0x22a80c;_0x55e45b[_0x4bee('0x45')]=_[_0x4bee('0x59')](db['User'][_0x4bee('0x41')]);_0x55e45b['query']=_['keys'](_0xc286b4[_0x4bee('0x46')]);_0x55e45b[_0x4bee('0x47')]=_[_0x4bee('0x48')](_0x55e45b[_0x4bee('0x45')],_0x55e45b['query']);_0x504562[_0x4bee('0x4a')]=_[_0x4bee('0x48')](_0x55e45b['model'],qs['fields'](_0xc286b4[_0x4bee('0x46')][_0x4bee('0x49')]));_0x504562[_0x4bee('0x4a')]=_0x504562['attributes'][_0x4bee('0x4b')]?_0x504562[_0x4bee('0x4a')]:_0x55e45b['model'];_0x504562[_0x4bee('0x4e')]=qs['sort'](_0xc286b4['query'][_0x4bee('0x4f')]);_0x504562['where']=qs[_0x4bee('0x47')](_[_0x4bee('0x6a')](_0xc286b4[_0x4bee('0x46')],_0x55e45b[_0x4bee('0x47')]));if(_0xc286b4[_0x4bee('0x46')][_0x4bee('0x50')]){_0x504562[_0x4bee('0x51')]=_[_0x4bee('0x52')](_0x504562[_0x4bee('0x51')],{'$or':_[_0x4bee('0x3f')](_0x504562[_0x4bee('0x4a')],function(_0x38970b){var _0x3027dc={};_0x3027dc[_0x38970b]={'$like':'%'+_0xc286b4[_0x4bee('0x46')][_0x4bee('0x50')]+'%'};return _0x3027dc;})});}_0x504562=_['merge']({},_0x504562,_0xc286b4[_0x4bee('0x5a')]);return _0x46d609[_0x4bee('0x78')](_0x504562);}})[_0x4bee('0x22')](function(_0x218f62){if(_0x218f62){_0x1f5764=_0x218f62[_0x4bee('0x4b')];if(!_0xc286b4[_0x4bee('0x46')][_0x4bee('0x4c')](_0x4bee('0x4d'))){_0x504562[_0x4bee('0x32')]=qs['limit'](_0xc286b4['query'][_0x4bee('0x32')]);_0x504562[_0x4bee('0x30')]=qs[_0x4bee('0x30')](_0xc286b4['query'][_0x4bee('0x30')]);}return _0x46d609[_0x4bee('0x78')](_0x504562);}})['then'](function(_0x5ae557){if(_0x5ae557){return _0x5ae557?{'count':_0x1f5764,'rows':_0x5ae557}:null;}})[_0x4bee('0x22')](respondWithResult(_0xf05ffe,null))[_0x4bee('0x2c')](handleError(_0xf05ffe,null));};exports['addApplications']=function(_0x2737d5,_0x1598fe){var _0xa89911=_0x2737d5[_0x4bee('0x58')]['id'];var _0x40804e=_0x2737d5[_0x4bee('0x63')];var _0x17fb86=0xc8;var _0x2b24a5=null;return db['sequelize'][_0x4bee('0x79')]({'isolationLevel':db[_0x4bee('0x7a')][_0x4bee('0x7b')][_0x4bee('0x7c')][_0x4bee('0x7d')]},function(_0x18d95c){return db[_0x4bee('0x40')][_0x4bee('0x69')]({'where':{'id':_0xa89911},'transaction':_0x18d95c})[_0x4bee('0x22')](function(_0x44c883){if(_0x44c883){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0xa89911},'transaction':_0x18d95c})['then'](function(){var _0x5d4cce=_['map'](_0x40804e,function(_0x55207f){_0x55207f[_0x4bee('0x66')]=_0xa89911;return _0x55207f;});return db['WhatsappApplication'][_0x4bee('0x7e')](_0x5d4cce,{'transaction':_0x18d95c});});}else{_0x17fb86=0x194;_0x2b24a5=[];}});})[_0x4bee('0x22')](function(){if(_0x17fb86!==0x194){return db[_0x4bee('0x7f')][_0x4bee('0x80')]({'where':{'WhatsappAccountId':_0xa89911},'order':_0x4bee('0x81')})['then'](function(_0x524828){_0x2b24a5=_0x524828;});}})[_0x4bee('0x2c')](function(_0x3eecd9){_0x17fb86=0x1f4;logger['error'](_0x3eecd9[_0x4bee('0x3b')]);if(_0x3eecd9[_0x4bee('0x53')]){delete _0x3eecd9[_0x4bee('0x53')];}_0x2b24a5=_0x3eecd9;})[_0x4bee('0x82')](function(){if(_0x2b24a5===null){_0x1598fe[_0x4bee('0x2d')](_0x17fb86);}else{if(_0x17fb86===0x1f4){_0x1598fe[_0x4bee('0x2e')](_0x17fb86)['send'](_0x2b24a5);}else{_0x1598fe['status'](_0x17fb86)['json'](_0x2b24a5);}}});};exports['getApplications']=function(_0x3b6e6a,_0x181742,_0x6237dd){var _0x2cc45f={};var _0x388b05={};var _0x4d9b1c;var _0x464cd1;return db['WhatsappAccount'][_0x4bee('0x69')]({'where':{'id':_0x3b6e6a[_0x4bee('0x58')]['id']}})['then'](handleEntityNotFound(_0x181742,null))[_0x4bee('0x22')](function(_0x416ced){if(_0x416ced){_0x4d9b1c=_0x416ced;_0x388b05[_0x4bee('0x45')]=_['keys'](db[_0x4bee('0x7f')]['rawAttributes']);_0x388b05['query']=_['keys'](_0x3b6e6a[_0x4bee('0x46')]);_0x388b05[_0x4bee('0x47')]=_[_0x4bee('0x48')](_0x388b05['model'],_0x388b05[_0x4bee('0x46')]);_0x2cc45f[_0x4bee('0x4a')]=_[_0x4bee('0x48')](_0x388b05[_0x4bee('0x45')],qs[_0x4bee('0x49')](_0x3b6e6a['query'][_0x4bee('0x49')]));_0x2cc45f['attributes']=_0x2cc45f[_0x4bee('0x4a')][_0x4bee('0x4b')]?_0x2cc45f['attributes']:_0x388b05[_0x4bee('0x45')];_0x2cc45f[_0x4bee('0x4e')]=qs['sort'](_0x3b6e6a[_0x4bee('0x46')][_0x4bee('0x4f')]);_0x2cc45f[_0x4bee('0x51')]=qs[_0x4bee('0x47')](_[_0x4bee('0x6a')](_0x3b6e6a[_0x4bee('0x46')],_0x388b05[_0x4bee('0x47')]));if(_0x3b6e6a[_0x4bee('0x46')][_0x4bee('0x50')]){_0x2cc45f['where']=_[_0x4bee('0x52')](_0x2cc45f[_0x4bee('0x51')],{'$or':_['map'](_0x2cc45f[_0x4bee('0x4a')],function(_0x1b9e99){var _0x3cc9a2={};_0x3cc9a2[_0x1b9e99]={'$like':'%'+_0x3b6e6a[_0x4bee('0x46')]['filter']+'%'};return _0x3cc9a2;})});}_0x2cc45f=_[_0x4bee('0x52')]({},_0x2cc45f,_0x3b6e6a[_0x4bee('0x5a')]);return _0x4d9b1c['getApplications'](_0x2cc45f);}})['then'](function(_0x213ab8){if(_0x213ab8){_0x464cd1=_0x213ab8[_0x4bee('0x4b')];if(!_0x3b6e6a[_0x4bee('0x46')]['hasOwnProperty']('nolimit')){_0x2cc45f[_0x4bee('0x32')]=qs['limit'](_0x3b6e6a['query'][_0x4bee('0x32')]);_0x2cc45f['offset']=qs[_0x4bee('0x30')](_0x3b6e6a[_0x4bee('0x46')]['offset']);}return _0x4d9b1c[_0x4bee('0x83')](_0x2cc45f);}})[_0x4bee('0x22')](function(_0x2ee7e6){if(_0x2ee7e6){return _0x2ee7e6?{'count':_0x464cd1,'rows':_0x2ee7e6}:null;}})['then'](respondWithResult(_0x181742,null))[_0x4bee('0x2c')](handleError(_0x181742,null));};exports['notify']=function(_0x586688,_0x13716f,_0x3e853a){var _0x19d8ce={'channel':_0x4bee('0x84')};var _0x2d1129=[];var _0x2d0df2=[];var _0x2955f1={};return db['WhatsappAccount']['find']({'where':{'id':_0x586688['params']['id']},'include':[{'model':db[_0x4bee('0x7f')],'as':_0x4bee('0x85')}]})['then'](handleEntityNotFound(_0x13716f,null))[_0x4bee('0x22')](function(_0x6e3340){_0x19d8ce[_0x4bee('0x86')]=_0x6e3340;if(_0x19d8ce[_0x4bee('0x86')]&&_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x43')]==='sinch'&&_0x586688[_0x4bee('0x63')][_0x4bee('0x87')]){if(_0x586688['body'][_0x4bee('0x87')][_0x4bee('0x4b')]===0x0)return;if(_0x586688['body']['statuses'][0x0][_0x4bee('0x88')]!=='read')return;return db[_0x4bee('0x89')][_0x4bee('0x37')]({'read':!![],'readAt':_0x586688['body'][_0x4bee('0x87')][0x0][_0x4bee('0x8a')]},{'where':{'messageId':_0x586688['body'][_0x4bee('0x87')][0x0][_0x4bee('0x8b')]},'individualHooks':!![]})[_0x4bee('0x22')](function(_0x478266){return _0x13716f[_0x4bee('0x2e')](0xc8)[_0x4bee('0x2f')](_0x478266);});}_0x19d8ce['applications']=_['orderBy'](_0x6e3340[_0x4bee('0x85')],[_0x4bee('0x81')],[_0x4bee('0x8c')]);if(_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x85')]){delete _0x19d8ce[_0x4bee('0x86')][_0x4bee('0x85')];}return db[_0x4bee('0x8d')][_0x4bee('0x65')]()[_0x4bee('0x22')](function(_0x5e1651){if(!_0x5e1651){throw new db['Sequelize'][(_0x4bee('0x8e'))](_0x4bee('0x8f'));}_0x2d1129=_[_0x4bee('0x90')](_[_0x4bee('0x59')](_0x5e1651),['createdAt',_0x4bee('0x91')]);_0x2d0df2=_['difference'](_[_0x4bee('0x59')](_0x5e1651),['createdAt',_0x4bee('0x91'),_0x4bee('0x92'),_0x4bee('0x93')]);_0x19d8ce[_0x4bee('0x63')]={'mapKey':_0x4bee('0x94')};if(_0x19d8ce['account']&&_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x43')]==='twilio'){_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')]=_0x586688['body']['From'][_0x4bee('0x96')](_0x4bee('0x97'),'');_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x63')]=_0x586688[_0x4bee('0x63')]['Body'];_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x98')]=_0x586688[_0x4bee('0x63')][_0x4bee('0x99')];}if(_0x19d8ce[_0x4bee('0x86')]&&_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x43')]===_0x4bee('0x9a')){_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')]=_0x586688[_0x4bee('0x63')]['notifications'][0x0][_0x4bee('0x95')];_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x63')]=_0x586688[_0x4bee('0x63')]['notifications'][0x0][_0x4bee('0x2a')][_0x4bee('0x63')];_0x19d8ce[_0x4bee('0x63')]['messageId']=_0x586688['body'][_0x4bee('0x9b')][0x0]['message_id'];}if(_0x19d8ce[_0x4bee('0x63')]['id']){delete _0x19d8ce[_0x4bee('0x63')]['id'];}if(_[_0x4bee('0x9c')](_0x19d8ce[_0x4bee('0x63')]['from'])){throw new db[(_0x4bee('0x9d'))][(_0x4bee('0x8e'))](_0x4bee('0x9e'));}if(_['isNil'](_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x63')])||_0x19d8ce['body']['body']===''){throw new db[(_0x4bee('0x9d'))][(_0x4bee('0x8e'))](_0x4bee('0x9f'));}if(_['isNil'](_0x19d8ce['body'][_0x4bee('0xa0')])){throw new db[(_0x4bee('0x9d'))][(_0x4bee('0x8e'))](_0x4bee('0xa1')+_0x2d0df2);}if(!_['includes'](_0x2d0df2,_0x19d8ce['body'][_0x4bee('0xa0')])){throw new db['Sequelize']['ValidationError'](_0x4bee('0xa2')+_0x2d0df2);}_0x2955f1[_0x19d8ce[_0x4bee('0x63')][_0x4bee('0xa0')]]=_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')];return db['CmList'][_0x4bee('0x5f')]({'where':{'id':_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x93')]},'include':[{'model':db['CmContact'],'as':_0x4bee('0xa3'),'where':_0x2955f1,'limit':0x1,'order':[[_0x4bee('0x91'),'DESC']]}]});})[_0x4bee('0x22')](handleEntityNotFound(_0x13716f,null))[_0x4bee('0x22')](function(_0x2dd516){if(_0x2dd516){_0x19d8ce[_0x4bee('0xa4')]=_[_0x4bee('0xa5')](_0x2dd516,['Contacts']);if(_0x2dd516['Contacts']['length']){return _0x2dd516[_0x4bee('0xa3')][0x0];}var _0x5adad7=_[_0x4bee('0x19')](_0x19d8ce[_0x4bee('0x63')],{'firstName':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')],'ListId':_0x2dd516['id']});_0x5adad7[_0x19d8ce[_0x4bee('0x63')]['mapKey']]=_0x19d8ce['body'][_0x4bee('0x95')];return db['CmContact'][_0x4bee('0x5b')](_0x5adad7,{'fields':_0x2d1129,'raw':!![]});}})['then'](handleEntityNotFound(_0x13716f,null))[_0x4bee('0x22')](function(_0x3a3316){if(_0x3a3316){_0x19d8ce[_0x4bee('0xa6')]=_0x3a3316;var _0x51ccf1={'ContactId':_0x3a3316['id'],'phone':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')],'WhatsappAccountId':_0x586688['params']['id']};var _0x275d04={'ContactId':_0x3a3316['id'],'WhatsappAccountId':_0x586688[_0x4bee('0x58')]['id'],'closed':![]};return db[_0x4bee('0xa7')]['find']({'where':_0x275d04})[_0x4bee('0x22')](function(_0x2051fd){if(_0x2051fd){return[_0x2051fd,![]];}return db[_0x4bee('0xa7')][_0x4bee('0x5b')](_0x51ccf1)[_0x4bee('0x22')](function(_0x24c7bd){return[_0x24c7bd,!![]];});});}})['spread'](function(_0xd053eb,_0x3a90e5){_0x19d8ce[_0x4bee('0xa8')]=_0xd053eb[_0x4bee('0x5d')]({'plain':!![]});_0x19d8ce[_0x4bee('0xa8')][_0x4bee('0xa9')]=![];if(_0x3a90e5){if(_0x19d8ce[_0x4bee('0x86')][_0x4bee('0xaa')]){_0x19d8ce['applications']['push']({'id':0x0,'priority':_0x19d8ce[_0x4bee('0xab')][_0x4bee('0x4b')]+0x1,'app':_0x4bee('0xac'),'appdata':_0x4bee('0xad'),'interval':_0x4bee('0xae')});}_0x19d8ce[_0x4bee('0xa8')][_0x4bee('0xa9')]=!![];}return db[_0x4bee('0x89')][_0x4bee('0x5b')]({'phone':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x95')],'messageId':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x98')],'body':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0x63')],'WhatsappAccountId':_0x586688[_0x4bee('0x58')]['id'],'WhatsappInteractionId':_0xd053eb['id'],'direction':'in','ContactId':_0xd053eb[_0x4bee('0xaf')],'AttachmentId':_0x19d8ce[_0x4bee('0x63')][_0x4bee('0xb0')]});})[_0x4bee('0x22')](function(_0x526ce9){_0x19d8ce[_0x4bee('0x2a')]=_0x526ce9;if(_0x19d8ce['interaction']['UserId']){return db[_0x4bee('0xb1')][_0x4bee('0x5f')]({'attributes':['id',_0x4bee('0x53')],'where':{'id':_0x19d8ce[_0x4bee('0xa8')][_0x4bee('0xb2')]}})[_0x4bee('0x22')](function(_0x4a45cc){if(_0x4a45cc){_0x19d8ce[_0x4bee('0xab')][_0x4bee('0xb3')]({'id':0x0,'priority':0x0,'app':_0x4bee('0xb4'),'appdata':_0x4a45cc['name']+','+(_0x19d8ce[_0x4bee('0x86')][_0x4bee('0xb5')]||0xa),'interval':_0x4bee('0xae')});}return respondWithRpcPromise('Start',_0x4bee('0xb6'),_0x19d8ce);});}return respondWithRpcPromise(_0x4bee('0xb7'),_0x4bee('0xb6'),_0x19d8ce);})['then'](function(_0x2fea89){if(_0x2fea89){var _0x3253c0=0xc8;var _0x3f9a2a=_0x4bee('0xb8');logger[_0x4bee('0x23')](_0x4bee('0x27'),_0x3f9a2a,_0x3253c0,_0x4bee('0xb9'));logger[_0x4bee('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3f9a2a,_0x3253c0,_0x4bee('0xb9'),JSON[_0x4bee('0xba')](_0x2fea89));if(_0x19d8ce[_0x4bee('0x86')][_0x4bee('0x43')]==='twilio'){return _0x13716f[_0x4bee('0x2e')](_0x3253c0)['set'](_0x4bee('0xbb'),'text/xml')['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x13716f[_0x4bee('0x2e')](_0x3253c0)[_0x4bee('0x2f')](_0x2fea89);}}});})[_0x4bee('0x2c')](handleError(_0x13716f,null));};exports[_0x4bee('0x3c')]=function(_0x503118,_0x456b91,_0x53469c){var _0x53ebb0,_0x5e0678,_0xcc66bb;if(_[_0x4bee('0x9c')](_0x503118[_0x4bee('0x63')][_0x4bee('0x63')])||_0x503118[_0x4bee('0x63')][_0x4bee('0x63')]===''){throw new db['Sequelize'][(_0x4bee('0x8e'))](_0x4bee('0x9f'));}if(_[_0x4bee('0x9c')](_0x503118[_0x4bee('0x63')]['to'])){throw new db[(_0x4bee('0x9d'))][(_0x4bee('0x8e'))](_0x4bee('0xbc'));}_0x53ebb0=_0x503118[_0x4bee('0x63')]['to'];return db[_0x4bee('0x40')][_0x4bee('0x5f')]({'where':{'id':_0x503118[_0x4bee('0x58')]['id']},'include':[{'model':db[_0x4bee('0xbd')],'as':_0x4bee('0xbe'),'include':[{'model':db[_0x4bee('0x8d')],'as':_0x4bee('0xa3'),'where':{'mobile':_0x53ebb0},'limit':0x1,'order':[['updatedAt',_0x4bee('0xbf')]]}]}]})[_0x4bee('0x22')](handleEntityNotFound(_0x456b91,null))[_0x4bee('0x22')](function(_0x29a03e){if(_0x29a03e&&_0x29a03e[_0x4bee('0xbe')]){_0x5e0678=_0x29a03e['get']({'plain':!![]});if(_0x5e0678[_0x4bee('0xbe')]&&_0x5e0678['List'][_0x4bee('0xa3')][_0x4bee('0x4b')]){return _0x5e0678[_0x4bee('0xbe')][_0x4bee('0xa3')][0x0];}return db[_0x4bee('0x8d')][_0x4bee('0x5b')](_['defaults'](_0x503118[_0x4bee('0x63')],{'firstName':_0x53ebb0,'mobile':_0x53ebb0,'phone':_0x53ebb0,'ListId':_0x5e0678[_0x4bee('0x93')]}));}})[_0x4bee('0x22')](handleEntityNotFound(_0x456b91,null))[_0x4bee('0x22')](function(_0x2fd94d){if(_0x2fd94d){_0xcc66bb=_0x2fd94d;return db['WhatsappInteraction'][_0x4bee('0x5f')]({'where':{'ContactId':_0xcc66bb['id'],'closed':![],'WhatsappAccountId':_0x5e0678['id']}})[_0x4bee('0x22')](function(_0x3dc56d){if(_0x3dc56d){return[_0x3dc56d,![]];}return db[_0x4bee('0xa7')][_0x4bee('0x5b')]({'UserId':_0x503118[_0x4bee('0x5c')]['id'],'ContactId':_0xcc66bb['id'],'WhatsappAccountId':_0x5e0678['id'],'phone':_0x53ebb0,'firstMsgDirection':_0x4bee('0xc0'),'Messages':[_[_0x4bee('0x52')](_0x503118[_0x4bee('0x63')],{'read':![],'body':_0x503118[_0x4bee('0x63')][_0x4bee('0x63')],'phone':_0x53ebb0,'WhatsappAccountId':_0x5e0678['id'],'UserId':_0x503118[_0x4bee('0x5c')]['id'],'ContactId':_0xcc66bb['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x4bee('0xc1')}]})[_0x4bee('0x22')](function(_0xd443ee){return[_0xd443ee,!![]];});});}})[_0x4bee('0xc2')](function(_0x59e7ca,_0x5edf5a){if(_0x5edf5a){return _0x59e7ca;}return db['WhatsappMessage'][_0x4bee('0x5b')](_[_0x4bee('0x52')](_0x503118[_0x4bee('0x63')],{'read':![],'body':_0x503118[_0x4bee('0x63')][_0x4bee('0x63')],'phone':_0x53ebb0,'WhatsappAccountId':_0x5e0678['id'],'WhatsappInteractionId':_0x59e7ca['id'],'UserId':_0x503118[_0x4bee('0x5c')]['id'],'ContactId':_0xcc66bb['id']}))['then'](function(_0x22a79a){_0x59e7ca[_0x4bee('0xc3')][_0x4bee('0xc1')]=[];_0x59e7ca[_0x4bee('0xc3')][_0x4bee('0xc1')][_0x4bee('0xc4')](_0x22a79a['dataValues']);return _0x59e7ca;});})['then'](respondWithResult(_0x456b91,null))[_0x4bee('0x2c')](handleError(_0x456b91,null));};
\ No newline at end of file
index f176b6c..3a5d3bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae1=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount'];(function(_0x1070b6,_0xab68e0){var _0x45f247=function(_0x1082f2){while(--_0x1082f2){_0x1070b6['push'](_0x1070b6['shift']());}};_0x45f247(++_0xab68e0);}(_0x7ae1,0x156));var _0x17ae=function(_0x64fbcd,_0xd984ce){_0x64fbcd=_0x64fbcd-0x0;var _0x29f942=_0x7ae1[_0x64fbcd];return _0x29f942;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x17ae('0x0'))['db'][_0x17ae('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x17ae('0x2')](0x0);var events={'afterCreate':_0x17ae('0x3'),'afterUpdate':_0x17ae('0x4'),'afterDestroy':'remove'};function emitEvent(_0x312085){return function(_0x335ba3,_0x47c4f7,_0x586d4c){WhatsappAccountEvents[_0x17ae('0x5')](_0x312085+':'+_0x335ba3['id'],_0x335ba3);WhatsappAccountEvents[_0x17ae('0x5')](_0x312085,_0x335ba3);_0x586d4c(null);};}for(var e in events){if(events[_0x17ae('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x17ae('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x41a5=['../../mysqldb','WhatsappAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4bcb01,_0x605c91){var _0x2beb77=function(_0x27485a){while(--_0x27485a){_0x4bcb01['push'](_0x4bcb01['shift']());}};_0x2beb77(++_0x605c91);}(_0x41a5,0xb3));var _0x541a=function(_0x224477,_0x1e1f54){_0x224477=_0x224477-0x0;var _0x11a22a=_0x41a5[_0x224477];return _0x11a22a;};'use strict';var EventEmitter=require(_0x541a('0x0'));var WhatsappAccount=require(_0x541a('0x1'))['db'][_0x541a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x541a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x541a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59492f){return function(_0x467bc6,_0x4ec6f7,_0x50f758){WhatsappAccountEvents[_0x541a('0x5')](_0x59492f+':'+_0x467bc6['id'],_0x467bc6);WhatsappAccountEvents[_0x541a('0x5')](_0x59492f,_0x467bc6);_0x50f758(null);};}for(var e in events){if(events[_0x541a('0x6')](e)){var event=events[e];WhatsappAccount[_0x541a('0x7')](e,emitEvent(event));}}module[_0x541a('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index 2fb3c5b..372b037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa07d=['moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','whatsapp_accounts','lodash','util','api'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa07d,0x1d3));var _0xda07=function(_0x378bf8,_0x2e12c9){_0x378bf8=_0x378bf8-0x0;var _0x47a435=_0xa07d[_0x378bf8];return _0x47a435;};'use strict';var _=require(_0xda07('0x0'));var util=require(_0xda07('0x1'));var logger=require('../../config/logger')(_0xda07('0x2'));var moment=require(_0xda07('0x3'));var BPromise=require(_0xda07('0x4'));var rp=require(_0xda07('0x5'));var fs=require('fs');var path=require(_0xda07('0x6'));var rimraf=require(_0xda07('0x7'));var config=require('../../config/environment');var attributes=require(_0xda07('0x8'));module['exports']=function(_0x7be814,_0x31de21){return _0x7be814['define']('WhatsappAccount',attributes,{'tableName':_0xda07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29f9=['path','rimraf','exports','define','WhatsappAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d8f73,_0x1c06ca){var _0x56e078=function(_0x238a6b){while(--_0x238a6b){_0x2d8f73['push'](_0x2d8f73['shift']());}};_0x56e078(++_0x1c06ca);}(_0x29f9,0x155));var _0x929f=function(_0x7c2ee2,_0x4eac0c){_0x7c2ee2=_0x7c2ee2-0x0;var _0x44b0b0=_0x29f9[_0x7c2ee2];return _0x44b0b0;};'use strict';var _=require(_0x929f('0x0'));var util=require(_0x929f('0x1'));var logger=require(_0x929f('0x2'))(_0x929f('0x3'));var moment=require(_0x929f('0x4'));var BPromise=require(_0x929f('0x5'));var rp=require(_0x929f('0x6'));var fs=require('fs');var path=require(_0x929f('0x7'));var rimraf=require(_0x929f('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x929f('0x9')]=function(_0x55ddcc,_0x53b7b9){return _0x55ddcc[_0x929f('0xa')](_0x929f('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4af8d23..42c52f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cbb=['then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','client','defaults','redis','socket.io-emitter','register','request'];(function(_0x2641ce,_0x263897){var _0x325da7=function(_0xfacad0){while(--_0xfacad0){_0x2641ce['push'](_0x2641ce['shift']());}};_0x325da7(++_0x263897);}(_0x5cbb,0x169));var _0xb5cb=function(_0x17f7fa,_0x27fedd){_0x17f7fa=_0x17f7fa-0x0;var _0x4bd961=_0x5cbb[_0x17f7fa];return _0x4bd961;};'use strict';var _=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var moment=require(_0xb5cb('0x2'));var BPromise=require(_0xb5cb('0x3'));var rs=require(_0xb5cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5cb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5cb('0x7')]['http']({'port':0x232a});config['redis']=_[_0xb5cb('0x8')](config[_0xb5cb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5cb('0xa'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xb5cb('0xb')](socket);function respondWithRpcPromise(_0x2d0a24,_0x243278,_0x29639d){return new BPromise(function(_0x5695db,_0x2303e9){return client[_0xb5cb('0xc')](_0x2d0a24,_0x29639d)[_0xb5cb('0xd')](function(_0xb5a0a9){logger[_0xb5cb('0xe')](_0xb5cb('0xf'),_0x243278,_0xb5cb('0x10'));logger[_0xb5cb('0x11')](_0xb5cb('0x12'),_0x243278,_0xb5cb('0x10'),JSON[_0xb5cb('0x13')](_0xb5a0a9));if(_0xb5a0a9['error']){if(_0xb5a0a9[_0xb5cb('0x14')]['code']===0x1f4){logger[_0xb5cb('0x14')](_0xb5cb('0xf'),_0x243278,_0xb5a0a9[_0xb5cb('0x14')]['message']);return _0x2303e9(_0xb5a0a9['error'][_0xb5cb('0x15')]);}logger['error'](_0xb5cb('0xf'),_0x243278,_0xb5a0a9[_0xb5cb('0x14')][_0xb5cb('0x15')]);return _0x5695db(_0xb5a0a9[_0xb5cb('0x14')]['message']);}else{logger[_0xb5cb('0xe')](_0xb5cb('0xf'),_0x243278,_0xb5cb('0x10'));_0x5695db(_0xb5a0a9[_0xb5cb('0x16')][_0xb5cb('0x15')]);}})[_0xb5cb('0x17')](function(_0x4af6a7){logger['error'](_0xb5cb('0xf'),_0x243278,_0x4af6a7);_0x2303e9(_0x4af6a7);});});}exports[_0xb5cb('0x18')]=function(_0x2928ee){var _0x44f001=this;return new Promise(function(_0x2049be,_0x431beb){return db[_0xb5cb('0x19')][_0xb5cb('0x1a')]({'raw':_0x2928ee[_0xb5cb('0x1b')]?_0x2928ee[_0xb5cb('0x1b')][_0xb5cb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2928ee[_0xb5cb('0x1b')]?_0x2928ee[_0xb5cb('0x1b')][_0xb5cb('0x1d')]||null:null,'attributes':_0x2928ee[_0xb5cb('0x1b')]?_0x2928ee[_0xb5cb('0x1b')][_0xb5cb('0x1e')]||null:null,'include':_0x2928ee[_0xb5cb('0x1b')]?_0x2928ee['options'][_0xb5cb('0x1f')]?_['map'](_0x2928ee['options'][_0xb5cb('0x1f')],function(_0x109625){return{'model':db[_0x109625['model']],'as':_0x109625['as'],'attributes':_0x109625[_0xb5cb('0x1e')],'include':_0x109625[_0xb5cb('0x1f')]?_[_0xb5cb('0x20')](_0x109625[_0xb5cb('0x1f')],function(_0x3e6620){return{'model':db[_0x3e6620[_0xb5cb('0x21')]],'as':_0x3e6620['as'],'attributes':_0x3e6620[_0xb5cb('0x1e')],'include':_0x3e6620[_0xb5cb('0x1f')]?_[_0xb5cb('0x20')](_0x3e6620['include'],function(_0x2bfea3){return{'model':db[_0x2bfea3[_0xb5cb('0x21')]],'as':_0x2bfea3['as'],'attributes':_0x2bfea3['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5cb('0xd')](function(_0x1b1f05){logger[_0xb5cb('0xe')](_0xb5cb('0x18'),_0x2928ee);logger[_0xb5cb('0x11')]('ShowWhatsappAccount',_0x2928ee,JSON[_0xb5cb('0x13')](_0x1b1f05));_0x2049be(_0x1b1f05);})[_0xb5cb('0x17')](function(_0x2f6a5d){logger[_0xb5cb('0x14')](_0xb5cb('0x18'),_0x2f6a5d['message'],_0x2928ee);_0x431beb(_0x44f001[_0xb5cb('0x14')](0x1f4,_0x2f6a5d[_0xb5cb('0x15')]));});});};
\ No newline at end of file
+var _0x3439=['code','message','result','ShowWhatsappAccount','options','raw','attributes','include','model','map','debug','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3439,0xd3));var _0x9343=function(_0x269f7e,_0x29d530){_0x269f7e=_0x269f7e-0x0;var _0x52977e=_0x3439[_0x269f7e];return _0x52977e;};'use strict';var _=require(_0x9343('0x0'));var util=require('util');var moment=require(_0x9343('0x1'));var BPromise=require(_0x9343('0x2'));var rs=require(_0x9343('0x3'));var fs=require('fs');var Redis=require(_0x9343('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9343('0x5'));var logger=require(_0x9343('0x6'))(_0x9343('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9343('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9343('0x9')](config[_0x9343('0xa')],{'host':_0x9343('0xb'),'port':0x18eb});var socket=require(_0x9343('0xc'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x9343('0xd')](socket);function respondWithRpcPromise(_0x154de2,_0x2724d3,_0x140cda){return new BPromise(function(_0x3a4199,_0x2eb0a1){return client[_0x9343('0xe')](_0x154de2,_0x140cda)[_0x9343('0xf')](function(_0x655c77){logger[_0x9343('0x10')](_0x9343('0x11'),_0x2724d3,_0x9343('0x12'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2724d3,'request\x20sent',JSON['stringify'](_0x655c77));if(_0x655c77[_0x9343('0x13')]){if(_0x655c77[_0x9343('0x13')][_0x9343('0x14')]===0x1f4){logger[_0x9343('0x13')](_0x9343('0x11'),_0x2724d3,_0x655c77[_0x9343('0x13')][_0x9343('0x15')]);return _0x2eb0a1(_0x655c77[_0x9343('0x13')][_0x9343('0x15')]);}logger[_0x9343('0x13')](_0x9343('0x11'),_0x2724d3,_0x655c77[_0x9343('0x13')][_0x9343('0x15')]);return _0x3a4199(_0x655c77[_0x9343('0x13')][_0x9343('0x15')]);}else{logger['info'](_0x9343('0x11'),_0x2724d3,_0x9343('0x12'));_0x3a4199(_0x655c77[_0x9343('0x16')][_0x9343('0x15')]);}})['catch'](function(_0x36e7f0){logger[_0x9343('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x2724d3,_0x36e7f0);_0x2eb0a1(_0x36e7f0);});});}exports[_0x9343('0x17')]=function(_0x342d70){var _0x3b0e4a=this;return new Promise(function(_0x4aaf1b,_0x1adc9a){return db['WhatsappAccount']['find']({'raw':_0x342d70[_0x9343('0x18')]?_0x342d70['options'][_0x9343('0x19')]===undefined?!![]:![]:!![],'where':_0x342d70['options']?_0x342d70[_0x9343('0x18')]['where']||null:null,'attributes':_0x342d70[_0x9343('0x18')]?_0x342d70[_0x9343('0x18')][_0x9343('0x1a')]||null:null,'include':_0x342d70[_0x9343('0x18')]?_0x342d70[_0x9343('0x18')][_0x9343('0x1b')]?_['map'](_0x342d70[_0x9343('0x18')][_0x9343('0x1b')],function(_0xc940b8){return{'model':db[_0xc940b8[_0x9343('0x1c')]],'as':_0xc940b8['as'],'attributes':_0xc940b8[_0x9343('0x1a')],'include':_0xc940b8[_0x9343('0x1b')]?_[_0x9343('0x1d')](_0xc940b8['include'],function(_0x5ee251){return{'model':db[_0x5ee251[_0x9343('0x1c')]],'as':_0x5ee251['as'],'attributes':_0x5ee251[_0x9343('0x1a')],'include':_0x5ee251[_0x9343('0x1b')]?_[_0x9343('0x1d')](_0x5ee251[_0x9343('0x1b')],function(_0x596a3f){return{'model':db[_0x596a3f['model']],'as':_0x596a3f['as'],'attributes':_0x596a3f[_0x9343('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9343('0xf')](function(_0x10a2f2){logger[_0x9343('0x10')](_0x9343('0x17'),_0x342d70);logger[_0x9343('0x1e')](_0x9343('0x17'),_0x342d70,JSON[_0x9343('0x1f')](_0x10a2f2));_0x4aaf1b(_0x10a2f2);})[_0x9343('0x20')](function(_0x11846c){logger['error'](_0x9343('0x17'),_0x11846c[_0x9343('0x15')],_0x342d70);_0x1adc9a(_0x3b0e4a[_0x9343('0x13')](0x1f4,_0x11846c[_0x9343('0x15')]));});});};
\ No newline at end of file
index 7a7cedc..8d9946a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x010d=['removeListener','length','whatsappAccount:','./whatsappAccount.events','save','update','emit'];(function(_0x488602,_0x4b14b1){var _0x17661d=function(_0x1b77d4){while(--_0x1b77d4){_0x488602['push'](_0x488602['shift']());}};_0x17661d(++_0x4b14b1);}(_0x010d,0x73));var _0xd010=function(_0x318605,_0x393b5a){_0x318605=_0x318605-0x0;var _0x57664b=_0x010d[_0x318605];return _0x57664b;};'use strict';var WhatsappAccountEvents=require(_0xd010('0x0'));var events=[_0xd010('0x1'),'remove',_0xd010('0x2')];function createListener(_0x1e969f,_0x406fb0){return function(_0x109a85){_0x406fb0[_0xd010('0x3')](_0x1e969f,_0x109a85);};}function removeListener(_0x5d3d2c,_0x1ab324){return function(){WhatsappAccountEvents[_0xd010('0x4')](_0x5d3d2c,_0x1ab324);};}exports['register']=function(_0x164bb8){for(var _0x5c07f3=0x0,_0x152764=events[_0xd010('0x5')];_0x5c07f3<_0x152764;_0x5c07f3++){var _0x310793=events[_0x5c07f3];var _0x3b416b=createListener(_0xd010('0x6')+_0x310793,_0x164bb8);WhatsappAccountEvents['on'](_0x310793,_0x3b416b);}};
\ No newline at end of file
+var _0x0c6d=['emit','removeListener','whatsappAccount:','./whatsappAccount.events'];(function(_0x3b6de2,_0x6f004a){var _0x5523f7=function(_0x59738d){while(--_0x59738d){_0x3b6de2['push'](_0x3b6de2['shift']());}};_0x5523f7(++_0x6f004a);}(_0x0c6d,0x12b));var _0xd0c6=function(_0x2c7881,_0xc217d1){_0x2c7881=_0x2c7881-0x0;var _0x90b19d=_0x0c6d[_0x2c7881];return _0x90b19d;};'use strict';var WhatsappAccountEvents=require(_0xd0c6('0x0'));var events=['save','remove','update'];function createListener(_0x1aced9,_0x46c511){return function(_0x190fb0){_0x46c511[_0xd0c6('0x1')](_0x1aced9,_0x190fb0);};}function removeListener(_0x3bd636,_0x4005c0){return function(){WhatsappAccountEvents[_0xd0c6('0x2')](_0x3bd636,_0x4005c0);};}exports['register']=function(_0xa62403){for(var _0x40f673=0x0,_0xf830e9=events['length'];_0x40f673<_0xf830e9;_0x40f673++){var _0x5e1b1d=events[_0x40f673];var _0x4c18d2=createListener(_0xd0c6('0x3')+_0x5e1b1d,_0xa62403);WhatsappAccountEvents['on'](_0x5e1b1d,_0x4c18d2);}};
\ No newline at end of file
index 6df79ef..9014453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x660b=['create','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x660b,0x15a));var _0xb660=function(_0x5f53cd,_0x4cca15){_0x5f53cd=_0x5f53cd-0x0;var _0x3448b2=_0x660b[_0x5f53cd];return _0x3448b2;};'use strict';var multer=require(_0xb660('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb660('0x1'));var express=require(_0xb660('0x2'));var router=express[_0xb660('0x3')]();var fs_extra=require(_0xb660('0x4'));var auth=require(_0xb660('0x5'));var interaction=require(_0xb660('0x6'));var config=require(_0xb660('0x7'));var controller=require(_0xb660('0x8'));router['get']('/',auth[_0xb660('0x9')](),controller[_0xb660('0xa')]);router[_0xb660('0xb')](_0xb660('0xc'),auth[_0xb660('0x9')](),controller[_0xb660('0xd')]);router['post']('/',auth[_0xb660('0x9')](),controller[_0xb660('0xe')]);router[_0xb660('0xf')](_0xb660('0xc'),auth[_0xb660('0x9')](),controller['update']);router[_0xb660('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb660('0x11')]=router;
\ No newline at end of file
+var _0xe56f=['isAuthenticated','show','create','put','multer','util','path','connect-timeout','fs-extra','../../config/environment','./whatsappApplication.controller','get','/:id'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xe56f,0x170));var _0xfe56=function(_0x14b3a6,_0x95a918){_0x14b3a6=_0x14b3a6-0x0;var _0x245603=_0xe56f[_0x14b3a6];return _0x245603;};'use strict';var multer=require(_0xfe56('0x0'));var util=require(_0xfe56('0x1'));var path=require(_0xfe56('0x2'));var timeout=require(_0xfe56('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfe56('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfe56('0x5'));var controller=require(_0xfe56('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfe56('0x7')](_0xfe56('0x8'),auth[_0xfe56('0x9')](),controller[_0xfe56('0xa')]);router['post']('/',auth[_0xfe56('0x9')](),controller[_0xfe56('0xb')]);router[_0xfe56('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xfe56('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index cd7e729..36e05b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6b7=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x39daba,_0x5edc8d){var _0x34d4ff=function(_0x50430b){while(--_0x50430b){_0x39daba['push'](_0x39daba['shift']());}};_0x34d4ff(++_0x5edc8d);}(_0xd6b7,0x10c));var _0x7d6b=function(_0x55bc0b,_0x95ab1b){_0x55bc0b=_0x55bc0b-0x0;var _0x10ffd6=_0xd6b7[_0x55bc0b];return _0x10ffd6;};'use strict';var Sequelize=require(_0x7d6b('0x0'));module[_0x7d6b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d6b('0x2')],'allowNull':![],'defaultValue':_0x7d6b('0x3')},'appdata':{'type':Sequelize[_0x7d6b('0x4')]()},'description':{'type':Sequelize[_0x7d6b('0x2')]},'interval':{'type':Sequelize[_0x7d6b('0x2')],'defaultValue':_0x7d6b('0x5')}};
\ No newline at end of file
+var _0x3a24=['STRING','TEXT','exports','INTEGER'];(function(_0xe406c8,_0x11716a){var _0x42c23e=function(_0x13315c){while(--_0x13315c){_0xe406c8['push'](_0xe406c8['shift']());}};_0x42c23e(++_0x11716a);}(_0x3a24,0xae));var _0x43a2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x3a24[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require('sequelize');module[_0x43a2('0x0')]={'priority':{'type':Sequelize[_0x43a2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x43a2('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x43a2('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x43a2('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 7431d96..d6bbe3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0xf61e,0x191));var _0xef61=function(_0x1f11b3,_0x2ec4d9){_0x1f11b3=_0x1f11b3-0x0;var _0x21c95c=_0xf61e[_0x1f11b3];return _0x21c95c;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['WhatsappApplication']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['WhatsappApplication'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};
\ No newline at end of file
+var _0xb366=['hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length'];(function(_0x1c13f5,_0xd60cb4){var _0x4dcd2d=function(_0x1da10d){while(--_0x1da10d){_0x1c13f5['push'](_0x1c13f5['shift']());}};_0x4dcd2d(++_0xd60cb4);}(_0xb366,0xa4));var _0x6b36=function(_0x35f1de,_0x4dda19){_0x35f1de=_0x35f1de-0x0;var _0x4b66d6=_0xb366[_0x35f1de];return _0x4b66d6;};'use strict';var emlformat=require(_0x6b36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b36('0x1'));var jsonpatch=require(_0x6b36('0x2'));var rp=require('request-promise');var moment=require(_0x6b36('0x3'));var BPromise=require(_0x6b36('0x4'));var Mustache=require(_0x6b36('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b36('0x6'));var ejs=require(_0x6b36('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b36('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b36('0x9'));var deskjs=require(_0x6b36('0xa'));var toCsv=require(_0x6b36('0x6'));var querystring=require(_0x6b36('0xb'));var Papa=require('papaparse');var Redis=require(_0x6b36('0xc'));var authService=require(_0x6b36('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6b36('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b36('0xf'))(_0x6b36('0x10'));var utils=require(_0x6b36('0x11'));var config=require(_0x6b36('0x12'));var licenseUtil=require(_0x6b36('0x13'));var db=require(_0x6b36('0x14'))['db'];function respondWithStatusCode(_0x51ff2a,_0x22bab4){_0x22bab4=_0x22bab4||0xcc;return function(_0x283873){if(_0x283873){return _0x51ff2a['sendStatus'](_0x22bab4);}return _0x51ff2a[_0x6b36('0x15')](_0x22bab4)['end']();};}function respondWithResult(_0x1351f3,_0x4fffe4){_0x4fffe4=_0x4fffe4||0xc8;return function(_0x4dd3ed){if(_0x4dd3ed){return _0x1351f3['status'](_0x4fffe4)[_0x6b36('0x16')](_0x4dd3ed);}};}function respondWithFilteredResult(_0x3cfdff,_0x291a25){return function(_0x4f6ca1){if(_0x4f6ca1){var _0x207dc7=typeof _0x291a25['offset']===_0x6b36('0x17')&&typeof _0x291a25[_0x6b36('0x18')]===_0x6b36('0x17');var _0x58dc48=_0x4f6ca1['count'];var _0x17c969=_0x207dc7?0x0:_0x291a25['offset'];var _0x41334a=_0x207dc7?_0x4f6ca1[_0x6b36('0x19')]:_0x291a25['offset']+_0x291a25[_0x6b36('0x18')];var _0x56b605;if(_0x41334a>=_0x58dc48){_0x41334a=_0x58dc48;_0x56b605=0xc8;}else{_0x56b605=0xce;}_0x3cfdff[_0x6b36('0x15')](_0x56b605);return _0x3cfdff['set'](_0x6b36('0x1a'),_0x17c969+'-'+_0x41334a+'/'+_0x58dc48)[_0x6b36('0x16')](_0x4f6ca1);}return null;};}function patchUpdates(_0xda25fd){return function(_0xa4157f){try{jsonpatch[_0x6b36('0x1b')](_0xa4157f,_0xda25fd,!![]);}catch(_0x280e60){return BPromise[_0x6b36('0x1c')](_0x280e60);}return _0xa4157f[_0x6b36('0x1d')]();};}function saveUpdates(_0xfa1de9,_0xc14d73){return function(_0x189e7b){if(_0x189e7b){return _0x189e7b[_0x6b36('0x1e')](_0xfa1de9)['then'](function(_0x3df348){return _0x3df348;});}return null;};}function removeEntity(_0x3dc7d1,_0x514c0d){return function(_0x264a83){if(_0x264a83){return _0x264a83['destroy']()[_0x6b36('0x1f')](function(){_0x3dc7d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b00d1,_0x2aec5a){return function(_0x1fa74e){if(!_0x1fa74e){_0x5b00d1[_0x6b36('0x20')](0x194);}return _0x1fa74e;};}function handleError(_0xf0eec6,_0x2d1af7){_0x2d1af7=_0x2d1af7||0x1f4;return function(_0x33d343){logger[_0x6b36('0x21')](_0x33d343[_0x6b36('0x22')]);if(_0x33d343['name']){delete _0x33d343[_0x6b36('0x23')];}_0xf0eec6[_0x6b36('0x15')](_0x2d1af7)['send'](_0x33d343);};}exports[_0x6b36('0x24')]=function(_0x432637,_0x4920df){var _0x40741d={},_0x111655={},_0xdf2d9c={'count':0x0,'rows':[]};var _0x45513b=_[_0x6b36('0x25')](db[_0x6b36('0x26')][_0x6b36('0x27')],function(_0xbc15cc){return{'name':_0xbc15cc[_0x6b36('0x28')],'type':_0xbc15cc[_0x6b36('0x29')]['key']};});_0x111655[_0x6b36('0x2a')]=_[_0x6b36('0x25')](_0x45513b,_0x6b36('0x23'));_0x111655[_0x6b36('0x2b')]=_['keys'](_0x432637['query']);_0x111655[_0x6b36('0x2c')]=_['intersection'](_0x111655[_0x6b36('0x2a')],_0x111655[_0x6b36('0x2b')]);_0x40741d[_0x6b36('0x2d')]=_[_0x6b36('0x2e')](_0x111655[_0x6b36('0x2a')],qs[_0x6b36('0x2f')](_0x432637[_0x6b36('0x2b')][_0x6b36('0x2f')]));_0x40741d[_0x6b36('0x2d')]=_0x40741d[_0x6b36('0x2d')][_0x6b36('0x30')]?_0x40741d['attributes']:_0x111655['model'];if(!_0x432637[_0x6b36('0x2b')][_0x6b36('0x31')](_0x6b36('0x32'))){_0x40741d[_0x6b36('0x18')]=qs[_0x6b36('0x18')](_0x432637['query']['limit']);_0x40741d[_0x6b36('0x33')]=qs[_0x6b36('0x33')](_0x432637[_0x6b36('0x2b')]['offset']);}_0x40741d[_0x6b36('0x34')]=qs[_0x6b36('0x35')](_0x432637['query'][_0x6b36('0x35')]);_0x40741d[_0x6b36('0x36')]=qs['filters'](_[_0x6b36('0x37')](_0x432637[_0x6b36('0x2b')],_0x111655[_0x6b36('0x2c')]),_0x45513b);if(_0x432637[_0x6b36('0x2b')]['filter']){_0x40741d[_0x6b36('0x36')]=_[_0x6b36('0x38')](_0x40741d[_0x6b36('0x36')],{'$or':_[_0x6b36('0x25')](_0x45513b,function(_0x49d42b){if(_0x49d42b[_0x6b36('0x29')]!==_0x6b36('0x39')){var _0x5e0455={};_0x5e0455[_0x49d42b[_0x6b36('0x23')]]={'$like':'%'+_0x432637['query'][_0x6b36('0x3a')]+'%'};return _0x5e0455;}})});}_0x40741d=_[_0x6b36('0x38')]({},_0x40741d,_0x432637[_0x6b36('0x3b')]);var _0x2dee8a={'where':_0x40741d[_0x6b36('0x36')]};return db['WhatsappApplication'][_0x6b36('0x19')](_0x2dee8a)[_0x6b36('0x1f')](function(_0x2cb16d){_0xdf2d9c['count']=_0x2cb16d;if(_0x432637[_0x6b36('0x2b')][_0x6b36('0x3c')]){_0x40741d['include']=[{'all':!![]}];}return db[_0x6b36('0x26')][_0x6b36('0x3d')](_0x40741d);})['then'](function(_0x427223){_0xdf2d9c['rows']=_0x427223;return _0xdf2d9c;})[_0x6b36('0x1f')](respondWithFilteredResult(_0x4920df,_0x40741d))[_0x6b36('0x3e')](handleError(_0x4920df,null));};exports[_0x6b36('0x3f')]=function(_0x576687,_0x47f8d6){var _0x226c52={'raw':!![],'where':{'id':_0x576687[_0x6b36('0x40')]['id']}},_0x33b6bc={};_0x33b6bc['model']=_[_0x6b36('0x41')](db[_0x6b36('0x26')][_0x6b36('0x27')]);_0x33b6bc[_0x6b36('0x2b')]=_[_0x6b36('0x41')](_0x576687[_0x6b36('0x2b')]);_0x33b6bc[_0x6b36('0x2c')]=_[_0x6b36('0x2e')](_0x33b6bc['model'],_0x33b6bc[_0x6b36('0x2b')]);_0x226c52[_0x6b36('0x2d')]=_[_0x6b36('0x2e')](_0x33b6bc['model'],qs['fields'](_0x576687[_0x6b36('0x2b')][_0x6b36('0x2f')]));_0x226c52[_0x6b36('0x2d')]=_0x226c52[_0x6b36('0x2d')][_0x6b36('0x30')]?_0x226c52[_0x6b36('0x2d')]:_0x33b6bc[_0x6b36('0x2a')];if(_0x576687[_0x6b36('0x2b')][_0x6b36('0x3c')]){_0x226c52[_0x6b36('0x42')]=[{'all':!![]}];}_0x226c52=_[_0x6b36('0x38')]({},_0x226c52,_0x576687[_0x6b36('0x3b')]);return db[_0x6b36('0x26')][_0x6b36('0x43')](_0x226c52)[_0x6b36('0x1f')](handleEntityNotFound(_0x47f8d6,null))[_0x6b36('0x1f')](respondWithResult(_0x47f8d6,null))['catch'](handleError(_0x47f8d6,null));};exports['create']=function(_0x51f0d4,_0x41e493){return db['WhatsappApplication'][_0x6b36('0x44')](_0x51f0d4[_0x6b36('0x45')],{})['then'](respondWithResult(_0x41e493,0xc9))['catch'](handleError(_0x41e493,null));};exports['update']=function(_0x5823ab,_0x2bfccf){if(_0x5823ab['body']['id']){delete _0x5823ab['body']['id'];}return db[_0x6b36('0x26')][_0x6b36('0x43')]({'where':{'id':_0x5823ab[_0x6b36('0x40')]['id']}})['then'](handleEntityNotFound(_0x2bfccf,null))[_0x6b36('0x1f')](saveUpdates(_0x5823ab[_0x6b36('0x45')],null))[_0x6b36('0x1f')](respondWithResult(_0x2bfccf,null))['catch'](handleError(_0x2bfccf,null));};exports[_0x6b36('0x46')]=function(_0x2b3d00,_0x3e8ca0){return db[_0x6b36('0x26')][_0x6b36('0x43')]({'where':{'id':_0x2b3d00[_0x6b36('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e8ca0,null))[_0x6b36('0x1f')](removeEntity(_0x3e8ca0,null))['catch'](handleError(_0x3e8ca0,null));};
\ No newline at end of file
index dec46b1..bdbbf32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd1=['exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5fd1,0x155));var _0x15fd=function(_0x27d738,_0x12174f){_0x27d738=_0x27d738-0x0;var _0x30bd9c=_0x5fd1[_0x27d738];return _0x30bd9c;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x15fd('0xa'),'collate':_0x15fd('0xb')});};
\ No newline at end of file
+var _0x3e74=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x3e74,0x175));var _0x43e7=function(_0x8ffda4,_0x3eedc4){_0x8ffda4=_0x8ffda4-0x0;var _0x47935c=_0x3e74[_0x8ffda4];return _0x47935c;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43e7('0xa'),'collate':_0x43e7('0xb')});};
\ No newline at end of file
index c611655..776dda3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5efdfc,_0x1a78ca){var _0x3c36fa=function(_0x4bb2e4){while(--_0x4bb2e4){_0x5efdfc['push'](_0x5efdfc['shift']());}};_0x3c36fa(++_0x1a78ca);}(_0x81bd,0x7c));var _0xd81b=function(_0x2eb828,_0x5b4396){_0x2eb828=_0x2eb828-0x0;var _0xdb47b7=_0x81bd[_0x2eb828];return _0xdb47b7;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});}
\ No newline at end of file
+var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x73fdd0,_0x52954a){var _0x24a023=function(_0x424920){while(--_0x424920){_0x73fdd0['push'](_0x73fdd0['shift']());}};_0x24a023(++_0x52954a);}(_0x4b84,0x1cc));var _0x44b8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4b84[_0x6c993a];return _0x27f547;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\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
index 02263f4..de2c650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dcc=['tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x5cb85d,_0x16d190){_0x5cb85d=_0x5cb85d-0x0;var _0x49958e=_0x1dcc[_0x5cb85d];return _0x49958e;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/describe',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['get'](_0xc1dc('0xc'),auth['isAuthenticated'](),controller[_0xc1dc('0xd')]);router['get'](_0xc1dc('0xe'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xf')]);router[_0xc1dc('0xa')](_0xc1dc('0x10'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x11')]);router[_0xc1dc('0x12')]('/',auth[_0xc1dc('0x8')](),controller['create']);router[_0xc1dc('0x12')](_0xc1dc('0xe'),auth[_0xc1dc('0x8')](),controller['addMessage']);router[_0xc1dc('0x12')](_0xc1dc('0x13'),auth[_0xc1dc('0x8')](),interaction[_0xc1dc('0x14')](_0xc1dc('0x15'),_0xc1dc('0x16')),controller[_0xc1dc('0x17')]);router[_0xc1dc('0x18')](_0xc1dc('0xc'),auth[_0xc1dc('0x8')](),interaction[_0xc1dc('0x14')]('whatsapp',_0xc1dc('0x19')),controller[_0xc1dc('0x1a')]);router[_0xc1dc('0x1b')](_0xc1dc('0xc'),auth['isAuthenticated'](),interaction[_0xc1dc('0x14')](_0xc1dc('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xc1dc('0x1b')](_0xc1dc('0x13'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x1c')]);module[_0xc1dc('0x1d')]=router;
\ No newline at end of file
+var _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags'];(function(_0x312de2,_0x59d2a1){var _0x23450f=function(_0xc717ef){while(--_0xc717ef){_0x312de2['push'](_0x312de2['shift']());}};_0x23450f(++_0x59d2a1);}(_0xcd59,0x14b));var _0x9cd5=function(_0x1575cf,_0x1190d4){_0x1575cf=_0x1575cf-0x0;var _0x2b7a4e=_0xcd59[_0x1575cf];return _0x2b7a4e;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0xa')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router['get'](_0x9cd5('0x12'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9cd5('0x14')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x15')]);router[_0x9cd5('0x14')](_0x9cd5('0x16'),auth['isAuthenticated'](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x19')),controller['addTags']);router['put']('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')]('whatsapp',_0x9cd5('0x1a')),controller[_0x9cd5('0x1b')]);router[_0x9cd5('0x1c')]('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x1d')),controller[_0x9cd5('0x1e')]);router[_0x9cd5('0x1c')]('/:id/tags',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x1f')]);module[_0x9cd5('0x20')]=router;
\ No newline at end of file
index 27d93ea..fe1da7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x136ca7,_0x28083d){var _0x222b46=function(_0x5dbeb2){while(--_0x5dbeb2){_0x136ca7['push'](_0x136ca7['shift']());}};_0x222b46(++_0x28083d);}(_0x741c,0x196));var _0xc741=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x741c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xc741('0x0'));var moment=require(_0xc741('0x1'));module[_0xc741('0x2')]={'closed':{'type':Sequelize[_0xc741('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc741('0x4')]},'disposition':{'type':Sequelize[_0xc741('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc741('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc741('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc741('0x6')]('in',_0xc741('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc741('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc741('0x6')]('in',_0xc741('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc741('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x425d=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0xf82695,_0x31e89f){var _0x353407=function(_0x246fba){while(--_0x246fba){_0xf82695['push'](_0xf82695['shift']());}};_0x353407(++_0x31e89f);}(_0x425d,0x1e0));var _0xd425=function(_0x3844bb,_0x1e0222){_0x3844bb=_0x3844bb-0x0;var _0x5c3507=_0x425d[_0x3844bb];return _0x5c3507;};'use strict';var Sequelize=require(_0xd425('0x0'));var moment=require('moment');module[_0xd425('0x1')]={'closed':{'type':Sequelize[_0xd425('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd425('0x3')]},'disposition':{'type':Sequelize[_0xd425('0x4')]},'secondDisposition':{'type':Sequelize[_0xd425('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd425('0x4')]},'note':{'type':Sequelize[_0xd425('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd425('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd425('0x5')]('in',_0xd425('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd425('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd425('0x5')]('in',_0xd425('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 14a0ca2..69a07cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a12=['join','root','server','files','transcript-%d-%s.zip','push','User','fullname','firstName','lastName','attachments','Attachment','createdAt','direction','read','WhatsappAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','out','System','Contact','renderFile','downloadInteraction.ejs','Whatsapp','createPdfFromHTML','rimraf','zip-dir','moment','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','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','whatsapp','query','catch','params','keys','intersection','model','attributes','fields','length','includeAll','merge','options','find','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','filters','pick','where','WhatsappInteractionId','map','filter','$gte','split','format','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','unix'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8a12,0x117));var _0x28a1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8a12[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0x28a1('0x0'));var zipdir=require(_0x28a1('0x1'));var moment=require(_0x28a1('0x2'));var BPromise=require('bluebird');var util=require(_0x28a1('0x3'));var path=require(_0x28a1('0x4'));var ejs=require(_0x28a1('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x28a1('0x6'));var interaction=require(_0x28a1('0x7'));var qs=require(_0x28a1('0x8'));var pdf=require(_0x28a1('0x9'));var logger=require(_0x28a1('0xa'))(_0x28a1('0xb'));var config=require(_0x28a1('0xc'));var db=require(_0x28a1('0xd'))['db'];config[_0x28a1('0xe')]=_[_0x28a1('0xf')](config[_0x28a1('0xe')],{'host':_0x28a1('0x10'),'port':0x18eb});var socket=require(_0x28a1('0x11'))(new Redis(config[_0x28a1('0xe')]));require('./whatsappInteraction.socket')[_0x28a1('0x12')](socket);function respondWithStatusCode(_0x17e3f4,_0x212ca6){_0x212ca6=_0x212ca6||0xcc;return function(_0x1c0fcb){if(_0x1c0fcb){return _0x17e3f4[_0x28a1('0x13')](_0x212ca6);}return _0x17e3f4[_0x28a1('0x14')](_0x212ca6)['end']();};}function respondWithResult(_0x101892,_0x4c0691){_0x4c0691=_0x4c0691||0xc8;return function(_0x4abddf){if(_0x4abddf){return _0x101892[_0x28a1('0x14')](_0x4c0691)[_0x28a1('0x15')](_0x4abddf);}};}function respondWithFilteredResult(_0x57f356,_0x116569){return function(_0x4b50c9){if(_0x4b50c9){var _0x4ec488=typeof _0x116569[_0x28a1('0x16')]===_0x28a1('0x17')&&typeof _0x116569[_0x28a1('0x18')]===_0x28a1('0x17');var _0x3d161b=_0x4b50c9[_0x28a1('0x19')];var _0x37969a=_0x4ec488?0x0:_0x116569[_0x28a1('0x16')];var _0x343b28=_0x4ec488?_0x4b50c9[_0x28a1('0x19')]:_0x116569['offset']+_0x116569['limit'];var _0x2e2ef7;if(_0x343b28>=_0x3d161b){_0x343b28=_0x3d161b;_0x2e2ef7=0xc8;}else{_0x2e2ef7=0xce;}_0x57f356[_0x28a1('0x14')](_0x2e2ef7);return _0x57f356[_0x28a1('0x1a')](_0x28a1('0x1b'),_0x37969a+'-'+_0x343b28+'/'+_0x3d161b)[_0x28a1('0x15')](_0x4b50c9);}return null;};}function saveUpdates(_0x51db97){return function(_0x48bfd6){if(_0x48bfd6){return _0x48bfd6[_0x28a1('0x1c')](_0x51db97)[_0x28a1('0x1d')](function(_0x44a586){return _0x44a586;});}return null;};}function removeEntity(_0x3a75b6){return function(_0x41ff7e){if(_0x41ff7e){return _0x41ff7e[_0x28a1('0x1e')]()['then'](function(){_0x3a75b6['status'](0xcc)[_0x28a1('0x1f')]();});}};}function handleEntityNotFound(_0x2a648b){return function(_0x151788){if(!_0x151788){_0x2a648b[_0x28a1('0x13')](0x194);}return _0x151788;};}function handleError(_0x130776,_0x14c9a9){_0x14c9a9=_0x14c9a9||0x1f4;return function(_0x2709b4){logger[_0x28a1('0x20')](_0x2709b4[_0x28a1('0x21')]);if(_0x2709b4[_0x28a1('0x22')]){delete _0x2709b4[_0x28a1('0x22')];}_0x130776[_0x28a1('0x14')](_0x14c9a9)['send'](_0x2709b4);};}exports[_0x28a1('0x23')]=function(_0x3851d4,_0xac0c8a){var _0x34c6ec={};var _0x52549e=_['map'](db[_0x28a1('0x24')][_0x28a1('0x25')],function(_0x20abbc){return{'name':_0x20abbc[_0x28a1('0x26')],'type':_0x20abbc['type'][_0x28a1('0x27')]};});_0x34c6ec=qs[_0x28a1('0x28')](_0x52549e,_0x3851d4);return interaction[_0x28a1('0x29')](_0x28a1('0x2a'),_0x3851d4[_0x28a1('0x2b')],_0x3851d4['user'],_0x34c6ec,_0x52549e)[_0x28a1('0x1d')](respondWithFilteredResult(_0xac0c8a,_0x34c6ec))[_0x28a1('0x2c')](handleError(_0xac0c8a,null));};exports['show']=function(_0x4d0283,_0x292ade){var _0x323984={'raw':![],'where':{'id':_0x4d0283[_0x28a1('0x2d')]['id']}},_0x12467a={};_0x12467a['model']=_[_0x28a1('0x2e')](db[_0x28a1('0x24')]['rawAttributes']);_0x12467a[_0x28a1('0x2b')]=_[_0x28a1('0x2e')](_0x4d0283[_0x28a1('0x2b')]);_0x12467a['filters']=_[_0x28a1('0x2f')](_0x12467a[_0x28a1('0x30')],_0x12467a[_0x28a1('0x2b')]);_0x323984[_0x28a1('0x31')]=_['intersection'](_0x12467a[_0x28a1('0x30')],qs['fields'](_0x4d0283[_0x28a1('0x2b')][_0x28a1('0x32')]));_0x323984[_0x28a1('0x31')]=_0x323984['attributes'][_0x28a1('0x33')]?_0x323984[_0x28a1('0x31')]:_0x12467a['model'];if(_0x4d0283[_0x28a1('0x2b')][_0x28a1('0x34')]){_0x323984['include']=[{'all':!![]}];}_0x323984=_[_0x28a1('0x35')]({},_0x323984,_0x4d0283[_0x28a1('0x36')]);return db[_0x28a1('0x24')][_0x28a1('0x37')](_0x323984)[_0x28a1('0x1d')](handleEntityNotFound(_0x292ade,null))[_0x28a1('0x1d')](respondWithResult(_0x292ade,null))[_0x28a1('0x2c')](handleError(_0x292ade,null));};exports['create']=function(_0x424deb,_0x587783){return db[_0x28a1('0x24')]['create'](_0x424deb[_0x28a1('0x38')],{})['then'](respondWithResult(_0x587783,0xc9))[_0x28a1('0x2c')](handleError(_0x587783,null));};exports['update']=function(_0x536044,_0x4e6b9b){if(_0x536044['body']['id']){delete _0x536044[_0x28a1('0x38')]['id'];}return db[_0x28a1('0x24')]['find']({'where':{'id':_0x536044[_0x28a1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4e6b9b,null))[_0x28a1('0x1d')](saveUpdates(_0x536044[_0x28a1('0x38')],null))[_0x28a1('0x1d')](respondWithResult(_0x4e6b9b,null))['catch'](handleError(_0x4e6b9b,null));};exports[_0x28a1('0x1e')]=function(_0x308534,_0x353233){return db[_0x28a1('0x24')][_0x28a1('0x37')]({'where':{'id':_0x308534[_0x28a1('0x2d')]['id']}})[_0x28a1('0x1d')](handleEntityNotFound(_0x353233,null))[_0x28a1('0x1d')](removeEntity(_0x353233,null))[_0x28a1('0x2c')](handleError(_0x353233,null));};exports['describe']=function(_0x54d7d8,_0x18ae95){return db['WhatsappInteraction'][_0x28a1('0x39')]()[_0x28a1('0x1d')](respondWithResult(_0x18ae95,null))[_0x28a1('0x2c')](handleError(_0x18ae95,null));};exports[_0x28a1('0x3a')]=function(_0xf6a6e1,_0x299f65){return db[_0x28a1('0x3b')][_0x28a1('0x37')]({'where':{'id':_0xf6a6e1[_0x28a1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x299f65,null))[_0x28a1('0x1d')](function(_0x5f09a7){if(_0x5f09a7){return _0x5f09a7[_0x28a1('0x3a')](_0xf6a6e1['body'][_0x28a1('0x3c')],_[_0x28a1('0x3d')](_0xf6a6e1[_0x28a1('0x38')],[_0x28a1('0x3c'),'id'])||{});}})[_0x28a1('0x1d')](respondWithResult(_0x299f65,null))['catch'](handleError(_0x299f65,null));};exports[_0x28a1('0x3e')]=function(_0x40f49f,_0x3ed2e5){var _0x20a72f={'raw':![],'where':{}};var _0x2d85be={};var _0xe85ab6={'count':0x0,'rows':[]};return db[_0x28a1('0x24')][_0x28a1('0x3f')]({'where':{'id':_0x40f49f[_0x28a1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3ed2e5,null))['then'](function(_0x2d383e){if(_0x2d383e){_0x2d85be[_0x28a1('0x30')]=_[_0x28a1('0x2e')](db['WhatsappMessage']['rawAttributes']);_0x2d85be[_0x28a1('0x2b')]=_['keys'](_0x40f49f['query']);_0x2d85be['filters']=_[_0x28a1('0x2f')](_0x2d85be['model'],_0x2d85be[_0x28a1('0x2b')]);_0x20a72f['attributes']=_[_0x28a1('0x2f')](_0x2d85be['model'],qs[_0x28a1('0x32')](_0x40f49f[_0x28a1('0x2b')][_0x28a1('0x32')]));_0x20a72f[_0x28a1('0x31')]=_0x20a72f['attributes'][_0x28a1('0x33')]?_0x20a72f[_0x28a1('0x31')]:_0x2d85be['model'];if(!_0x40f49f[_0x28a1('0x2b')][_0x28a1('0x40')]('nolimit')){_0x20a72f[_0x28a1('0x18')]=qs[_0x28a1('0x18')](_0x40f49f['query'][_0x28a1('0x18')]);_0x20a72f[_0x28a1('0x16')]=qs['offset'](_0x40f49f['query'][_0x28a1('0x16')]);}_0x20a72f[_0x28a1('0x41')]=qs[_0x28a1('0x42')](_0x40f49f[_0x28a1('0x2b')][_0x28a1('0x42')]);_0x20a72f['where']=qs[_0x28a1('0x43')](_[_0x28a1('0x44')](_0x40f49f[_0x28a1('0x2b')],_0x2d85be[_0x28a1('0x43')]));_0x20a72f[_0x28a1('0x45')][_0x28a1('0x46')]=_0x2d383e['id'];if(_0x40f49f[_0x28a1('0x2b')]['filter']){_0x20a72f[_0x28a1('0x45')]=_[_0x28a1('0x35')](_0x20a72f['where'],{'$or':_[_0x28a1('0x47')](_0x20a72f[_0x28a1('0x31')],function(_0x82b110){var _0x5833f1={};_0x5833f1[_0x82b110]={'$like':'%'+_0x40f49f[_0x28a1('0x2b')][_0x28a1('0x48')]+'%'};return _0x5833f1;})});}if(_0x40f49f[_0x28a1('0x2b')]['$gte']){var _0x231ef1=_0x40f49f[_0x28a1('0x2b')][_0x28a1('0x49')][_0x28a1('0x4a')](',');var _0x2d99ee={};_0x2d99ee[_0x231ef1[0x0]]={'$gte':moment(_0x231ef1[0x1])[_0x28a1('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x20a72f[_0x28a1('0x45')]=_['merge'](_0x20a72f[_0x28a1('0x45')],_0x2d99ee);}_0x20a72f=_[_0x28a1('0x35')]({},_0x20a72f,_0x40f49f[_0x28a1('0x36')]);return db[_0x28a1('0x3b')][_0x28a1('0x19')]({'where':_0x20a72f[_0x28a1('0x45')]})[_0x28a1('0x1d')](function(_0x8f6ff6){_0xe85ab6[_0x28a1('0x19')]=_0x8f6ff6;if(_0x40f49f[_0x28a1('0x2b')]['includeAll']){_0x20a72f['include']=[{'all':!![]}];}return db[_0x28a1('0x3b')][_0x28a1('0x29')](_0x20a72f);})[_0x28a1('0x1d')](function(_0x2b9417){_0xe85ab6['rows']=_0x2b9417;return _0xe85ab6;});}})[_0x28a1('0x1d')](respondWithFilteredResult(_0x3ed2e5,_0x20a72f))[_0x28a1('0x2c')](handleError(_0x3ed2e5,null));};exports[_0x28a1('0x4c')]=function(_0x159e8d,_0x37cc20){return db[_0x28a1('0x24')][_0x28a1('0x37')]({'where':{'id':_0x159e8d['params']['id']}})['then'](handleEntityNotFound(_0x37cc20,null))['then'](function(_0x1e7f10){if(_0x1e7f10){return _0x1e7f10[_0x28a1('0x4d')](_0x159e8d[_0x28a1('0x38')]['ids'],_[_0x28a1('0x3d')](_0x159e8d[_0x28a1('0x38')],['ids','id'])||{})[_0x28a1('0x4e')](function(){return db[_0x28a1('0x4f')]['findAll']({'attributes':['id',_0x28a1('0x22'),'color'],'where':{'id':_0x159e8d[_0x28a1('0x38')]['ids']}});})[_0x28a1('0x1d')](function(_0xf2a3bb){socket[_0x28a1('0x50')](_0x28a1('0x51'),{'id':Number(_0x159e8d[_0x28a1('0x2d')]['id']),'tags':_0xf2a3bb||[]});return{'id':Number(_0x159e8d[_0x28a1('0x2d')]['id']),'tags':_0xf2a3bb||[]};});}})[_0x28a1('0x1d')](respondWithResult(_0x37cc20,null))[_0x28a1('0x2c')](handleError(_0x37cc20,null));};exports[_0x28a1('0x52')]=function(_0x422ca8,_0x1cccba){return db[_0x28a1('0x24')][_0x28a1('0x37')]({'where':{'id':_0x422ca8[_0x28a1('0x2d')]['id']}})[_0x28a1('0x1d')](handleEntityNotFound(_0x1cccba,null))[_0x28a1('0x1d')](function(_0x4a2642){if(_0x4a2642){return _0x4a2642[_0x28a1('0x52')](_0x422ca8[_0x28a1('0x2b')][_0x28a1('0x3c')]);}})[_0x28a1('0x1d')](respondWithStatusCode(_0x1cccba,null))[_0x28a1('0x2c')](handleError(_0x1cccba,null));};exports['download']=function(_0x1ea09b,_0x565e69){var _0x3a7e5a=moment()[_0x28a1('0x53')]()['toString']();var _0xd28d90=path[_0x28a1('0x54')](config[_0x28a1('0x55')],_0x28a1('0x56'),_0x28a1('0x57'),'tmp');var _0xdecc3d=path['join'](config[_0x28a1('0x55')],_0x28a1('0x56'),_0x28a1('0x57'),'attachments');var _0xfe9e84=path[_0x28a1('0x54')](_0xd28d90,_0x3a7e5a);var _0x513071=util[_0x28a1('0x4b')](_0x28a1('0x58'),_0x1ea09b[_0x28a1('0x2d')]['id'],_0x3a7e5a);var _0x47273d=path['join'](_0xd28d90,_0x513071);var _0x37906b=[];_0x37906b[_0x28a1('0x59')]({'model':db[_0x28a1('0x5a')],'as':_0x28a1('0x5a'),'attributes':['id',_0x28a1('0x5b')],'raw':!![]});_0x37906b[_0x28a1('0x59')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x28a1('0x5c'),_0x28a1('0x5d')],'raw':!![]});if(_0x1ea09b[_0x28a1('0x2b')][_0x28a1('0x5e')]){_0x37906b['push']({'model':db[_0x28a1('0x5f')],'as':_0x28a1('0x5f'),'raw':!![]});}var _0x98443a=[{'model':db[_0x28a1('0x3b')],'as':'Messages','attributes':['id',_0x28a1('0x38'),_0x28a1('0x60'),_0x28a1('0x61'),'secret',_0x28a1('0x62')],'include':_0x37906b}];_0x98443a[_0x28a1('0x59')]({'model':db[_0x28a1('0x63')],'as':_0x28a1('0x64'),'attributes':['id','name']});_0x98443a[_0x28a1('0x59')]({'model':db['User'],'as':_0x28a1('0x65'),'attributes':['id',_0x28a1('0x5b')]});return db[_0x28a1('0x24')]['find']({'where':{'id':_0x1ea09b[_0x28a1('0x2d')]['id']},'include':_0x98443a})[_0x28a1('0x1d')](handleEntityNotFound(_0x565e69,null))[_0x28a1('0x1d')](function(_0x43291e){if(_0x43291e){var _0x11d555=_0x43291e[_0x28a1('0x66')]({'plain':!![]});fs['mkdirSync'](_0xfe9e84);var _0x518331={'channel':'Whatsapp','account':_0x11d555['Account']['name'],'agent':_0x11d555[_0x28a1('0x65')]?_0x11d555[_0x28a1('0x65')]['fullname']:_0x28a1('0x67'),'createdAt':moment(_0x11d555['createdAt'])['format'](_0x28a1('0x68'))[_0x28a1('0x69')](),'closedAt':_0x11d555[_0x28a1('0x6a')]?moment(_0x11d555[_0x28a1('0x6b')])[_0x28a1('0x4b')](_0x28a1('0x68'))[_0x28a1('0x69')]():'','disposition':_0x11d555[_0x28a1('0x6c')],'messages':_(_0x11d555[_0x28a1('0x6d')])[_0x28a1('0x48')]({'secret':![]})[_0x28a1('0x47')](function(_0x585821){if(_0x585821['Attachment']){var _0x25dbc2=path[_0x28a1('0x54')](_0xdecc3d,_0x585821[_0x28a1('0x5f')][_0x28a1('0x6e')]);if(fs[_0x28a1('0x6f')](_0x25dbc2)){fs[_0x28a1('0x70')](_0x25dbc2)[_0x28a1('0x71')](fs['createWriteStream'](path[_0x28a1('0x54')](_0xfe9e84,_0x585821[_0x28a1('0x5f')][_0x28a1('0x6e')])));}}return{'date':moment(_0x585821['createdAt'])['format'](_0x28a1('0x68'))[_0x28a1('0x69')](),'sender':_0x585821['direction']===_0x28a1('0x72')?_0x585821[_0x28a1('0x5a')]?_0x585821['User'][_0x28a1('0x5b')]:_0x28a1('0x73'):_0x585821[_0x28a1('0x74')]['firstName']+(_0x585821['Contact'][_0x28a1('0x5d')]?'\x20'+_0x585821[_0x28a1('0x74')][_0x28a1('0x5d')]:''),'body':_0x585821[_0x28a1('0x5f')]?_0x585821[_0x28a1('0x5f')][_0x28a1('0x6e')]:_0x585821['body'],'direction':_0x585821[_0x28a1('0x61')]===_0x28a1('0x72')?'A':'C','secret':_0x585821['secret'],'read':_0x585821[_0x28a1('0x62')],'attachment':_0x585821[_0x28a1('0x5f')]};})['value']()};return ejs[_0x28a1('0x75')](path[_0x28a1('0x54')](config[_0x28a1('0x55')],_0x28a1('0x56'),'views',_0x28a1('0x76')),{'interaction':_0x518331})['then'](function(_0x23120b){var _0x2a267f=path['join'](_0xfe9e84,'transcript-'+_0x11d555['id']+'-'+_0x3a7e5a+'.pdf');var _0x933a2b={'path':_0x2a267f,'channel':_0x28a1('0x77'),'interactionId':_0x11d555['id']};return pdf[_0x28a1('0x78')](_0x23120b,_0x933a2b);})[_0x28a1('0x1d')](function(){return new BPromise(function(_0x3231e6,_0x473af2){zipdir(_0xfe9e84,{'saveTo':_0x47273d},function(_0xfa293d,_0x2a9d55){if(_0xfa293d)return _0x473af2(_0xfa293d);return _0x3231e6(_0x2a9d55);});})[_0x28a1('0x1d')](function(){return new BPromise(function(_0x3b6b17,_0x4822f2){rimraf(_0xfe9e84,function(_0x502165){if(_0x502165)_0x4822f2(_0x502165);return _0x3b6b17();});});})[_0x28a1('0x1d')](function(){return _0x565e69['download'](_0x47273d,_0x513071,function(_0x36ab38){if(_0x36ab38){console['log']('err',_0x36ab38);}else{fs['unlinkSync'](_0x47273d);}});});});}else{return _0x565e69['sendStatus'](0xc8);}})[_0x28a1('0x2c')](handleError(_0x565e69,null));};
\ No newline at end of file
+var _0x779d=['getMessages','hasOwnProperty','limit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','fullname','get','mkdirSync','Whatsapp','Owner','N.A.','closed','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','lastName','value','views','transcript-','.pdf','download','err','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit'];(function(_0x338e77,_0x19cc47){var _0x170f91=function(_0x5d475c){while(--_0x5d475c){_0x338e77['push'](_0x338e77['shift']());}};_0x170f91(++_0x19cc47);}(_0x779d,0x1c2));var _0xd779=function(_0x2633c2,_0x130c4f){_0x2633c2=_0x2633c2-0x0;var _0x5e8e09=_0x779d[_0x2633c2];return _0x5e8e09;};'use strict';var rimraf=require(_0xd779('0x0'));var zipdir=require('zip-dir');var moment=require(_0xd779('0x1'));var BPromise=require(_0xd779('0x2'));var util=require(_0xd779('0x3'));var path=require(_0xd779('0x4'));var ejs=require(_0xd779('0x5'));var fs=require('fs');var _=require(_0xd779('0x6'));var Redis=require(_0xd779('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xd779('0x8'));var logger=require(_0xd779('0x9'))('api');var config=require(_0xd779('0xa'));var db=require('../../mysqldb')['db'];config[_0xd779('0xb')]=_[_0xd779('0xc')](config[_0xd779('0xb')],{'host':_0xd779('0xd'),'port':0x18eb});var socket=require(_0xd779('0xe'))(new Redis(config['redis']));require(_0xd779('0xf'))[_0xd779('0x10')](socket);function respondWithStatusCode(_0x4219fd,_0x39d0b2){_0x39d0b2=_0x39d0b2||0xcc;return function(_0x13f823){if(_0x13f823){return _0x4219fd[_0xd779('0x11')](_0x39d0b2);}return _0x4219fd[_0xd779('0x12')](_0x39d0b2)['end']();};}function respondWithResult(_0x3bd9aa,_0x29d09d){_0x29d09d=_0x29d09d||0xc8;return function(_0x31ad2b){if(_0x31ad2b){return _0x3bd9aa[_0xd779('0x12')](_0x29d09d)[_0xd779('0x13')](_0x31ad2b);}};}function respondWithFilteredResult(_0x5cfeb6,_0x3f1ddb){return function(_0x387472){if(_0x387472){var _0x14530b=typeof _0x3f1ddb[_0xd779('0x14')]==='undefined'&&typeof _0x3f1ddb['limit']==='undefined';var _0x5ce69e=_0x387472['count'];var _0x60332b=_0x14530b?0x0:_0x3f1ddb['offset'];var _0x156d14=_0x14530b?_0x387472[_0xd779('0x15')]:_0x3f1ddb[_0xd779('0x14')]+_0x3f1ddb['limit'];var _0x34ae12;if(_0x156d14>=_0x5ce69e){_0x156d14=_0x5ce69e;_0x34ae12=0xc8;}else{_0x34ae12=0xce;}_0x5cfeb6[_0xd779('0x12')](_0x34ae12);return _0x5cfeb6[_0xd779('0x16')](_0xd779('0x17'),_0x60332b+'-'+_0x156d14+'/'+_0x5ce69e)[_0xd779('0x13')](_0x387472);}return null;};}function saveUpdates(_0x136894){return function(_0x46465c){if(_0x46465c){return _0x46465c[_0xd779('0x18')](_0x136894)[_0xd779('0x19')](function(_0x2134a6){return _0x2134a6;});}return null;};}function removeEntity(_0x80256f){return function(_0x4c838a){if(_0x4c838a){return _0x4c838a[_0xd779('0x1a')]()[_0xd779('0x19')](function(){_0x80256f[_0xd779('0x12')](0xcc)[_0xd779('0x1b')]();});}};}function handleEntityNotFound(_0x25e8c4){return function(_0x1fc662){if(!_0x1fc662){_0x25e8c4[_0xd779('0x11')](0x194);}return _0x1fc662;};}function handleError(_0x2b4ba5,_0x563d8e){_0x563d8e=_0x563d8e||0x1f4;return function(_0x5446d0){logger[_0xd779('0x1c')](_0x5446d0[_0xd779('0x1d')]);if(_0x5446d0[_0xd779('0x1e')]){delete _0x5446d0[_0xd779('0x1e')];}_0x2b4ba5['status'](_0x563d8e)['send'](_0x5446d0);};}exports[_0xd779('0x1f')]=function(_0x561a75,_0x9000a0){var _0x3471ee={};var _0x3396dc=_[_0xd779('0x20')](db[_0xd779('0x21')][_0xd779('0x22')],function(_0x4a47ad){return{'name':_0x4a47ad['fieldName'],'type':_0x4a47ad[_0xd779('0x23')][_0xd779('0x24')]};});_0x3471ee=qs[_0xd779('0x25')](_0x3396dc,_0x561a75);return interaction['findAll'](_0xd779('0x26'),_0x561a75[_0xd779('0x27')],_0x561a75[_0xd779('0x28')],_0x3471ee,_0x3396dc)[_0xd779('0x19')](respondWithFilteredResult(_0x9000a0,_0x3471ee))[_0xd779('0x29')](handleError(_0x9000a0,null));};exports[_0xd779('0x2a')]=function(_0x2bdb87,_0x351adb){var _0x2982df={'raw':![],'where':{'id':_0x2bdb87[_0xd779('0x2b')]['id']}},_0x43fb4a={};_0x43fb4a[_0xd779('0x2c')]=_['keys'](db['WhatsappInteraction'][_0xd779('0x22')]);_0x43fb4a[_0xd779('0x27')]=_[_0xd779('0x2d')](_0x2bdb87[_0xd779('0x27')]);_0x43fb4a[_0xd779('0x2e')]=_[_0xd779('0x2f')](_0x43fb4a['model'],_0x43fb4a[_0xd779('0x27')]);_0x2982df[_0xd779('0x30')]=_[_0xd779('0x2f')](_0x43fb4a[_0xd779('0x2c')],qs['fields'](_0x2bdb87[_0xd779('0x27')][_0xd779('0x31')]));_0x2982df[_0xd779('0x30')]=_0x2982df[_0xd779('0x30')][_0xd779('0x32')]?_0x2982df[_0xd779('0x30')]:_0x43fb4a['model'];if(_0x2bdb87[_0xd779('0x27')][_0xd779('0x33')]){_0x2982df['include']=[{'all':!![]}];}_0x2982df=_[_0xd779('0x34')]({},_0x2982df,_0x2bdb87[_0xd779('0x35')]);return db[_0xd779('0x21')][_0xd779('0x36')](_0x2982df)[_0xd779('0x19')](handleEntityNotFound(_0x351adb,null))[_0xd779('0x19')](respondWithResult(_0x351adb,null))[_0xd779('0x29')](handleError(_0x351adb,null));};exports[_0xd779('0x37')]=function(_0x3d5764,_0x37a333){return db[_0xd779('0x21')][_0xd779('0x37')](_0x3d5764[_0xd779('0x38')],{})[_0xd779('0x19')](respondWithResult(_0x37a333,0xc9))[_0xd779('0x29')](handleError(_0x37a333,null));};exports[_0xd779('0x18')]=function(_0x581a87,_0x5460de){if(_0x581a87[_0xd779('0x38')]['id']){delete _0x581a87[_0xd779('0x38')]['id'];}return db[_0xd779('0x21')][_0xd779('0x36')]({'where':{'id':_0x581a87[_0xd779('0x2b')]['id']}})[_0xd779('0x19')](handleEntityNotFound(_0x5460de,null))[_0xd779('0x19')](saveUpdates(_0x581a87[_0xd779('0x38')],null))[_0xd779('0x19')](respondWithResult(_0x5460de,null))['catch'](handleError(_0x5460de,null));};exports[_0xd779('0x1a')]=function(_0x2307a5,_0x26e0b4){return db[_0xd779('0x21')][_0xd779('0x36')]({'where':{'id':_0x2307a5['params']['id']}})[_0xd779('0x19')](handleEntityNotFound(_0x26e0b4,null))[_0xd779('0x19')](removeEntity(_0x26e0b4,null))['catch'](handleError(_0x26e0b4,null));};exports[_0xd779('0x39')]=function(_0x1295b9,_0x1b9785){return db[_0xd779('0x21')]['describe']()[_0xd779('0x19')](respondWithResult(_0x1b9785,null))['catch'](handleError(_0x1b9785,null));};exports[_0xd779('0x3a')]=function(_0x58cb15,_0x2e6a2e){return db[_0xd779('0x3b')][_0xd779('0x36')]({'where':{'id':_0x58cb15['params']['id']}})[_0xd779('0x19')](handleEntityNotFound(_0x2e6a2e,null))['then'](function(_0x4430e3){if(_0x4430e3){return _0x4430e3['addMessage'](_0x58cb15['body'][_0xd779('0x3c')],_[_0xd779('0x3d')](_0x58cb15[_0xd779('0x38')],['ids','id'])||{});}})[_0xd779('0x19')](respondWithResult(_0x2e6a2e,null))[_0xd779('0x29')](handleError(_0x2e6a2e,null));};exports[_0xd779('0x3e')]=function(_0x367e2f,_0x3b0356){var _0x51884d={'raw':![],'where':{}};var _0x1ee069={};var _0xa74af9={'count':0x0,'rows':[]};return db[_0xd779('0x21')]['findOne']({'where':{'id':_0x367e2f[_0xd779('0x2b')]['id']}})[_0xd779('0x19')](handleEntityNotFound(_0x3b0356,null))['then'](function(_0x182f4b){if(_0x182f4b){_0x1ee069[_0xd779('0x2c')]=_['keys'](db[_0xd779('0x3b')][_0xd779('0x22')]);_0x1ee069['query']=_[_0xd779('0x2d')](_0x367e2f[_0xd779('0x27')]);_0x1ee069[_0xd779('0x2e')]=_['intersection'](_0x1ee069[_0xd779('0x2c')],_0x1ee069[_0xd779('0x27')]);_0x51884d[_0xd779('0x30')]=_['intersection'](_0x1ee069['model'],qs[_0xd779('0x31')](_0x367e2f['query'][_0xd779('0x31')]));_0x51884d[_0xd779('0x30')]=_0x51884d[_0xd779('0x30')][_0xd779('0x32')]?_0x51884d[_0xd779('0x30')]:_0x1ee069['model'];if(!_0x367e2f[_0xd779('0x27')][_0xd779('0x3f')]('nolimit')){_0x51884d[_0xd779('0x40')]=qs['limit'](_0x367e2f[_0xd779('0x27')][_0xd779('0x40')]);_0x51884d[_0xd779('0x14')]=qs[_0xd779('0x14')](_0x367e2f[_0xd779('0x27')][_0xd779('0x14')]);}_0x51884d[_0xd779('0x41')]=qs[_0xd779('0x42')](_0x367e2f['query'][_0xd779('0x42')]);_0x51884d[_0xd779('0x43')]=qs['filters'](_[_0xd779('0x44')](_0x367e2f[_0xd779('0x27')],_0x1ee069[_0xd779('0x2e')]));_0x51884d[_0xd779('0x43')][_0xd779('0x45')]=_0x182f4b['id'];if(_0x367e2f[_0xd779('0x27')]['filter']){_0x51884d[_0xd779('0x43')]=_[_0xd779('0x34')](_0x51884d[_0xd779('0x43')],{'$or':_[_0xd779('0x20')](_0x51884d[_0xd779('0x30')],function(_0x30a3fe){var _0x4baf22={};_0x4baf22[_0x30a3fe]={'$like':'%'+_0x367e2f['query'][_0xd779('0x46')]+'%'};return _0x4baf22;})});}if(_0x367e2f['query'][_0xd779('0x47')]){var _0x51f75c=_0x367e2f['query'][_0xd779('0x47')][_0xd779('0x48')](',');var _0x144941={};_0x144941[_0x51f75c[0x0]]={'$gte':moment(_0x51f75c[0x1])[_0xd779('0x49')](_0xd779('0x4a'))};_0x51884d[_0xd779('0x43')]=_[_0xd779('0x34')](_0x51884d['where'],_0x144941);}_0x51884d=_[_0xd779('0x34')]({},_0x51884d,_0x367e2f['options']);return db[_0xd779('0x3b')]['count']({'where':_0x51884d[_0xd779('0x43')]})[_0xd779('0x19')](function(_0xe68663){_0xa74af9[_0xd779('0x15')]=_0xe68663;if(_0x367e2f['query'][_0xd779('0x33')]){_0x51884d[_0xd779('0x4b')]=[{'all':!![]}];}return db[_0xd779('0x3b')][_0xd779('0x4c')](_0x51884d);})[_0xd779('0x19')](function(_0x10cf86){_0xa74af9[_0xd779('0x4d')]=_0x10cf86;return _0xa74af9;});}})[_0xd779('0x19')](respondWithFilteredResult(_0x3b0356,_0x51884d))[_0xd779('0x29')](handleError(_0x3b0356,null));};exports[_0xd779('0x4e')]=function(_0x3c77f3,_0x2956e3){return db[_0xd779('0x21')][_0xd779('0x36')]({'where':{'id':_0x3c77f3['params']['id']}})['then'](handleEntityNotFound(_0x2956e3,null))[_0xd779('0x19')](function(_0x348dad){if(_0x348dad){return _0x348dad[_0xd779('0x4f')](_0x3c77f3[_0xd779('0x38')][_0xd779('0x3c')],_[_0xd779('0x3d')](_0x3c77f3[_0xd779('0x38')],[_0xd779('0x3c'),'id'])||{})['spread'](function(){return db[_0xd779('0x50')][_0xd779('0x4c')]({'attributes':['id',_0xd779('0x1e'),_0xd779('0x51')],'where':{'id':_0x3c77f3['body'][_0xd779('0x3c')]}});})['then'](function(_0x3ec4bf){socket[_0xd779('0x52')](_0xd779('0x53'),{'id':Number(_0x3c77f3[_0xd779('0x2b')]['id']),'tags':_0x3ec4bf||[]});return{'id':Number(_0x3c77f3[_0xd779('0x2b')]['id']),'tags':_0x3ec4bf||[]};});}})[_0xd779('0x19')](respondWithResult(_0x2956e3,null))[_0xd779('0x29')](handleError(_0x2956e3,null));};exports[_0xd779('0x54')]=function(_0x4d6c78,_0x5a7ccc){return db['WhatsappInteraction']['find']({'where':{'id':_0x4d6c78[_0xd779('0x2b')]['id']}})[_0xd779('0x19')](handleEntityNotFound(_0x5a7ccc,null))[_0xd779('0x19')](function(_0x5a226a){if(_0x5a226a){return _0x5a226a['removeTags'](_0x4d6c78[_0xd779('0x27')][_0xd779('0x3c')]);}})[_0xd779('0x19')](respondWithStatusCode(_0x5a7ccc,null))[_0xd779('0x29')](handleError(_0x5a7ccc,null));};exports['download']=function(_0xeaed07,_0x5313a1){var _0x512be1=moment()['unix']()[_0xd779('0x55')]();var _0x5d3a36=path[_0xd779('0x56')](config[_0xd779('0x57')],_0xd779('0x58'),_0xd779('0x59'),_0xd779('0x5a'));var _0x836c49=path[_0xd779('0x56')](config[_0xd779('0x57')],_0xd779('0x58'),'files',_0xd779('0x5b'));var _0x5414cc=path[_0xd779('0x56')](_0x5d3a36,_0x512be1);var _0x2ef3e0=util[_0xd779('0x49')](_0xd779('0x5c'),_0xeaed07[_0xd779('0x2b')]['id'],_0x512be1);var _0x468a02=path[_0xd779('0x56')](_0x5d3a36,_0x2ef3e0);var _0x3170e8=[];_0x3170e8[_0xd779('0x5d')]({'model':db[_0xd779('0x5e')],'as':_0xd779('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x3170e8[_0xd779('0x5d')]({'model':db[_0xd779('0x5f')],'as':_0xd779('0x60'),'attributes':['id',_0xd779('0x61'),'lastName'],'raw':!![]});if(_0xeaed07[_0xd779('0x27')][_0xd779('0x5b')]){_0x3170e8['push']({'model':db[_0xd779('0x62')],'as':_0xd779('0x62'),'raw':!![]});}var _0x219b11=[{'model':db[_0xd779('0x3b')],'as':_0xd779('0x63'),'attributes':['id',_0xd779('0x38'),_0xd779('0x64'),_0xd779('0x65'),_0xd779('0x66'),_0xd779('0x67')],'include':_0x3170e8}];_0x219b11[_0xd779('0x5d')]({'model':db[_0xd779('0x68')],'as':_0xd779('0x69'),'attributes':['id',_0xd779('0x1e')]});_0x219b11['push']({'model':db[_0xd779('0x5e')],'as':'Owner','attributes':['id',_0xd779('0x6a')]});return db[_0xd779('0x21')][_0xd779('0x36')]({'where':{'id':_0xeaed07[_0xd779('0x2b')]['id']},'include':_0x219b11})[_0xd779('0x19')](handleEntityNotFound(_0x5313a1,null))[_0xd779('0x19')](function(_0x5b1be0){if(_0x5b1be0){var _0x1b71bd=_0x5b1be0[_0xd779('0x6b')]({'plain':!![]});fs[_0xd779('0x6c')](_0x5414cc);var _0x3c3aa6={'channel':_0xd779('0x6d'),'account':_0x1b71bd[_0xd779('0x69')][_0xd779('0x1e')],'agent':_0x1b71bd[_0xd779('0x6e')]?_0x1b71bd['Owner'][_0xd779('0x6a')]:_0xd779('0x6f'),'createdAt':moment(_0x1b71bd[_0xd779('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd779('0x55')](),'closedAt':_0x1b71bd[_0xd779('0x70')]?moment(_0x1b71bd['closedAt'])[_0xd779('0x49')](_0xd779('0x4a'))[_0xd779('0x55')]():'','disposition':_0x1b71bd[_0xd779('0x71')],'messages':_(_0x1b71bd['Messages'])[_0xd779('0x46')]({'secret':![]})['map'](function(_0x468466){if(_0x468466[_0xd779('0x62')]){var _0x450c73=path[_0xd779('0x56')](_0x836c49,_0x468466['Attachment']['basename']);if(fs[_0xd779('0x72')](_0x450c73)){fs[_0xd779('0x73')](_0x450c73)[_0xd779('0x74')](fs[_0xd779('0x75')](path['join'](_0x5414cc,_0x468466[_0xd779('0x62')][_0xd779('0x76')])));}}return{'date':moment(_0x468466['createdAt'])[_0xd779('0x49')](_0xd779('0x4a'))['toString'](),'sender':_0x468466[_0xd779('0x65')]===_0xd779('0x77')?_0x468466[_0xd779('0x5e')]?_0x468466[_0xd779('0x5e')][_0xd779('0x6a')]:_0xd779('0x78'):_0x468466['Contact']['firstName']+(_0x468466['Contact']['lastName']?'\x20'+_0x468466['Contact'][_0xd779('0x79')]:''),'body':_0x468466[_0xd779('0x62')]?_0x468466[_0xd779('0x62')][_0xd779('0x76')]:_0x468466['body'],'direction':_0x468466[_0xd779('0x65')]===_0xd779('0x77')?'A':'C','secret':_0x468466[_0xd779('0x66')],'read':_0x468466['read'],'attachment':_0x468466[_0xd779('0x62')]};})[_0xd779('0x7a')]()};return ejs['renderFile'](path[_0xd779('0x56')](config[_0xd779('0x57')],_0xd779('0x58'),_0xd779('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x3c3aa6})[_0xd779('0x19')](function(_0x3f9bb4){var _0x218f65=path[_0xd779('0x56')](_0x5414cc,_0xd779('0x7c')+_0x1b71bd['id']+'-'+_0x512be1+_0xd779('0x7d'));var _0x2c39ed={'path':_0x218f65,'channel':_0xd779('0x6d'),'interactionId':_0x1b71bd['id']};return pdf['createPdfFromHTML'](_0x3f9bb4,_0x2c39ed);})[_0xd779('0x19')](function(){return new BPromise(function(_0x4b21b8,_0x11ea6e){zipdir(_0x5414cc,{'saveTo':_0x468a02},function(_0x175593,_0x1b3cad){if(_0x175593)return _0x11ea6e(_0x175593);return _0x4b21b8(_0x1b3cad);});})[_0xd779('0x19')](function(){return new BPromise(function(_0x44206b,_0x28114f){rimraf(_0x5414cc,function(_0x40aead){if(_0x40aead)_0x28114f(_0x40aead);return _0x44206b();});});})[_0xd779('0x19')](function(){return _0x5313a1[_0xd779('0x7e')](_0x468a02,_0x2ef3e0,function(_0x64b6d5){if(_0x64b6d5){console['log'](_0xd779('0x7f'),_0x64b6d5);}else{fs['unlinkSync'](_0x468a02);}});});});}else{return _0x5313a1[_0xd779('0x11')](0xc8);}})[_0xd779('0x29')](handleError(_0x5313a1,null));};
\ No newline at end of file
index 52acb0a..c6661a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a1b=['remove','getUsers','then','setDataValue','Users','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x101226,_0x4651c4){_0x101226=_0x101226-0x0;var _0x3e0e44=_0x8a1b[_0x101226];return _0x3e0e44;};'use strict';var EventEmitter=require(_0xb8a1('0x0'));var WhatsappInteraction=require(_0xb8a1('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xb8a1('0x1'))['db'][_0xb8a1('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb8a1('0x3'),'afterDestroy':_0xb8a1('0x4')};function emitEvent(_0x287494){return function(_0x28258c,_0x195250,_0x4d484f){_0x28258c[_0xb8a1('0x5')]({'attributes':['id'],'raw':!![]})[_0xb8a1('0x6')](function(_0x1e8118){_0x28258c[_0xb8a1('0x7')](_0xb8a1('0x8'),_0x1e8118['map'](function(_0x351b6b){return{'id':_0x351b6b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x28258c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2ac8c3){_0x28258c[_0xb8a1('0x7')]('unreadMessages',_0x2ac8c3[_0xb8a1('0x9')]);WhatsappInteractionEvents['emit'](_0x287494+':'+_0x28258c['id'],_0x28258c);WhatsappInteractionEvents[_0xb8a1('0xa')](_0x287494,_0x28258c);_0x4d484f(null);})[_0xb8a1('0xb')](_0x4d484f(null));};}for(var e in events){if(events[_0xb8a1('0xc')](e)){var event=events[e];WhatsappInteraction[_0xb8a1('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xf00e=['length','emit','catch','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x480794,_0x340503){var _0x4778c3=function(_0x161fad){while(--_0x161fad){_0x480794['push'](_0x480794['shift']());}};_0x4778c3(++_0x340503);}(_0xf00e,0x12f));var _0xef00=function(_0x3772b7,_0x2d6364){_0x3772b7=_0x3772b7-0x0;var _0x47e9a8=_0xf00e[_0x3772b7];return _0x47e9a8;};'use strict';var EventEmitter=require(_0xef00('0x0'));var WhatsappInteraction=require(_0xef00('0x1'))['db'][_0xef00('0x2')];var WhatsappMessage=require(_0xef00('0x1'))['db'][_0xef00('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xef00('0x4')](0x0);var events={'afterCreate':_0xef00('0x5'),'afterUpdate':_0xef00('0x6'),'afterDestroy':_0xef00('0x7')};function emitEvent(_0x4261ea){return function(_0x409186,_0x471e92,_0x397c39){_0x409186[_0xef00('0x8')]({'attributes':['id'],'raw':!![]})[_0xef00('0x9')](function(_0x17ec9e){_0x409186[_0xef00('0xa')](_0xef00('0xb'),_0x17ec9e['map'](function(_0x1d3b1c){return{'id':_0x1d3b1c['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x409186['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x173074){_0x409186['setDataValue']('unreadMessages',_0x173074[_0xef00('0xc')]);WhatsappInteractionEvents['emit'](_0x4261ea+':'+_0x409186['id'],_0x409186);WhatsappInteractionEvents[_0xef00('0xd')](_0x4261ea,_0x409186);_0x397c39(null);})[_0xef00('0xe')](_0x397c39(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
index 4ccd6e2..c1a6b49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fac=['../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x8fac,0x70));var _0xc8fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8fac[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xc8fa('0x0'));var util=require('util');var logger=require(_0xc8fa('0x1'))(_0xc8fa('0x2'));var moment=require(_0xc8fa('0x3'));var BPromise=require(_0xc8fa('0x4'));var rp=require(_0xc8fa('0x5'));var fs=require('fs');var path=require(_0xc8fa('0x6'));var rimraf=require('rimraf');var config=require(_0xc8fa('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xc8fa('0x8')]=function(_0x2163cd,_0x3e8af2){return _0x2163cd[_0xc8fa('0x9')](_0xc8fa('0xa'),attributes,{'tableName':_0xc8fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5cee83,_0x5b8efb,_0x3cf393){if(_0x5cee83[_0xc8fa('0xc')](_0xc8fa('0xd'))){_0x5cee83[_0xc8fa('0xe')]=moment()[_0xc8fa('0xf')](_0xc8fa('0x10'));}_0x3cf393(null,_0x5cee83);}}});};
\ No newline at end of file
+var _0x9820=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x3501ee,_0x1e80f8){var _0x5c38d4=function(_0xc21713){while(--_0xc21713){_0x3501ee['push'](_0x3501ee['shift']());}};_0x5c38d4(++_0x1e80f8);}(_0x9820,0x137));var _0x0982=function(_0x846ca1,_0x512517){_0x846ca1=_0x846ca1-0x0;var _0xb052af=_0x9820[_0x846ca1];return _0xb052af;};'use strict';var _=require(_0x0982('0x0'));var util=require(_0x0982('0x1'));var logger=require(_0x0982('0x2'))(_0x0982('0x3'));var moment=require('moment');var BPromise=require(_0x0982('0x4'));var rp=require(_0x0982('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0982('0x6'));var config=require(_0x0982('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x0982('0x8')]=function(_0x2a3dfc,_0x4a9055){return _0x2a3dfc[_0x0982('0x9')](_0x0982('0xa'),attributes,{'tableName':_0x0982('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb9be50,_0x4c6c1b,_0x3136ce){if(_0xb9be50[_0x0982('0xc')](_0x0982('0xd'))){_0xb9be50[_0x0982('0xe')]=moment()[_0x0982('0xf')](_0x0982('0x10'));}_0x3136ce(null,_0xb9be50);}}});};
\ No newline at end of file
index 9eb4e06..cececd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd37=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./whatsappInteraction.socket','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x210347,_0x4ad8a9){var _0x47d6dd=function(_0x4dcf25){while(--_0x4dcf25){_0x210347['push'](_0x210347['shift']());}};_0x47d6dd(++_0x4ad8a9);}(_0xfd37,0x1b8));var _0x7fd3=function(_0x5ca7be,_0x10cbb7){_0x5ca7be=_0x5ca7be-0x0;var _0x1e5956=_0xfd37[_0x5ca7be];return _0x1e5956;};'use strict';var _=require('lodash');var util=require(_0x7fd3('0x0'));var moment=require(_0x7fd3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fd3('0x2'));var db=require(_0x7fd3('0x3'))['db'];var utils=require(_0x7fd3('0x4'));var logger=require(_0x7fd3('0x5'))(_0x7fd3('0x6'));var config=require(_0x7fd3('0x7'));var jayson=require(_0x7fd3('0x8'));var client=jayson['client'][_0x7fd3('0x9')]({'port':0x232a});config[_0x7fd3('0xa')]=_['defaults'](config[_0x7fd3('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fd3('0xa')]));require(_0x7fd3('0xb'))['register'](socket);function respondWithRpcPromise(_0x53c47f,_0x267e2f,_0x1ee136){return new BPromise(function(_0x50eb16,_0x437c2a){return client['request'](_0x53c47f,_0x1ee136)['then'](function(_0x15b1da){logger[_0x7fd3('0xc')](_0x7fd3('0xd'),_0x267e2f,_0x7fd3('0xe'));logger[_0x7fd3('0xf')](_0x7fd3('0x10'),_0x267e2f,_0x7fd3('0xe'),JSON[_0x7fd3('0x11')](_0x15b1da));if(_0x15b1da[_0x7fd3('0x12')]){if(_0x15b1da[_0x7fd3('0x12')][_0x7fd3('0x13')]===0x1f4){logger[_0x7fd3('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x267e2f,_0x15b1da[_0x7fd3('0x12')][_0x7fd3('0x14')]);return _0x437c2a(_0x15b1da['error']['message']);}logger[_0x7fd3('0x12')](_0x7fd3('0xd'),_0x267e2f,_0x15b1da['error'][_0x7fd3('0x14')]);return _0x50eb16(_0x15b1da['error'][_0x7fd3('0x14')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x267e2f,_0x7fd3('0xe'));_0x50eb16(_0x15b1da['result']['message']);}})[_0x7fd3('0x15')](function(_0x4dcb27){logger[_0x7fd3('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x267e2f,_0x4dcb27);_0x437c2a(_0x4dcb27);});});}exports[_0x7fd3('0x16')]=function(_0x1c119e){var _0x6eaf35=this;return new Promise(function(_0x2c5e77,_0x41383c){return db[_0x7fd3('0x17')]['update'](_0x1c119e['body'],{'raw':_0x1c119e[_0x7fd3('0x18')]?_0x1c119e[_0x7fd3('0x18')][_0x7fd3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c119e[_0x7fd3('0x18')]?_0x1c119e[_0x7fd3('0x18')][_0x7fd3('0x1a')]||null:null,'attributes':_0x1c119e[_0x7fd3('0x18')]?_0x1c119e[_0x7fd3('0x18')][_0x7fd3('0x1b')]||null:null,'limit':_0x1c119e[_0x7fd3('0x18')]?_0x1c119e['options'][_0x7fd3('0x1c')]||null:null})[_0x7fd3('0x1d')](function(_0x1a2dd6){logger[_0x7fd3('0xc')]('UpdateWhatsappInteraction',_0x1c119e);logger[_0x7fd3('0xf')]('UpdateWhatsappInteraction',_0x1c119e,JSON['stringify'](_0x1a2dd6));_0x2c5e77(_0x1a2dd6);})[_0x7fd3('0x15')](function(_0x27372e){logger['error'](_0x7fd3('0x16'),_0x27372e[_0x7fd3('0x14')],_0x1c119e);_0x41383c(_0x6eaf35[_0x7fd3('0x12')](0x1f4,_0x27372e[_0x7fd3('0x14')]));});});};exports[_0x7fd3('0x1e')]=function(_0xc5da18){return new Promise(function(_0x29759e,_0x375d2d){return db['WhatsappInteraction'][_0x7fd3('0x1f')]({'where':_0xc5da18[_0x7fd3('0x18')]?_0xc5da18['options'][_0x7fd3('0x1a')]||null:null})[_0x7fd3('0x1d')](function(_0x2c2bcb){if(_0x2c2bcb){return _0x2c2bcb[_0x7fd3('0x20')](_0xc5da18[_0x7fd3('0x21')][_0x7fd3('0x22')],_[_0x7fd3('0x23')](_0xc5da18[_0x7fd3('0x21')],[_0x7fd3('0x22'),'id'])||{});}})[_0x7fd3('0x24')](function(_0x15ab1a){logger[_0x7fd3('0xc')](_0x7fd3('0x25'),_0xc5da18);logger[_0x7fd3('0xf')]('AddTags',_0xc5da18,JSON[_0x7fd3('0x11')](_0x15ab1a));_0x29759e(_0x15ab1a);})[_0x7fd3('0x15')](function(_0x30552f){logger[_0x7fd3('0x12')](_0x7fd3('0x25'),_0x30552f[_0x7fd3('0x14')],_0xc5da18);_0x375d2d(_this[_0x7fd3('0x12')](0x1f4,_0x30552f[_0x7fd3('0x14')]));});});};
\ No newline at end of file
+var _0xafb1=['attributes','limit','debug','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options'];(function(_0x46d672,_0x2fb5bc){var _0x39e13f=function(_0x420e80){while(--_0x420e80){_0x46d672['push'](_0x46d672['shift']());}};_0x39e13f(++_0x2fb5bc);}(_0xafb1,0x165));var _0x1afb=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xafb1[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x1afb('0x0'));var util=require('util');var moment=require(_0x1afb('0x1'));var BPromise=require(_0x1afb('0x2'));var rs=require(_0x1afb('0x3'));var fs=require('fs');var Redis=require(_0x1afb('0x4'));var db=require(_0x1afb('0x5'))['db'];var utils=require(_0x1afb('0x6'));var logger=require(_0x1afb('0x7'))(_0x1afb('0x8'));var config=require(_0x1afb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1afb('0xa')]({'port':0x232a});config['redis']=_[_0x1afb('0xb')](config[_0x1afb('0xc')],{'host':_0x1afb('0xd'),'port':0x18eb});var socket=require(_0x1afb('0xe'))(new Redis(config[_0x1afb('0xc')]));require(_0x1afb('0xf'))[_0x1afb('0x10')](socket);function respondWithRpcPromise(_0x1e1420,_0x3bb458,_0x55a082){return new BPromise(function(_0x5a9b0b,_0x52f494){return client[_0x1afb('0x11')](_0x1e1420,_0x55a082)['then'](function(_0x3078f1){logger[_0x1afb('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3bb458,_0x1afb('0x13'));logger['debug'](_0x1afb('0x14'),_0x3bb458,_0x1afb('0x13'),JSON[_0x1afb('0x15')](_0x3078f1));if(_0x3078f1[_0x1afb('0x16')]){if(_0x3078f1[_0x1afb('0x16')][_0x1afb('0x17')]===0x1f4){logger[_0x1afb('0x16')](_0x1afb('0x18'),_0x3bb458,_0x3078f1['error']['message']);return _0x52f494(_0x3078f1[_0x1afb('0x16')][_0x1afb('0x19')]);}logger[_0x1afb('0x16')](_0x1afb('0x18'),_0x3bb458,_0x3078f1[_0x1afb('0x16')][_0x1afb('0x19')]);return _0x5a9b0b(_0x3078f1[_0x1afb('0x16')][_0x1afb('0x19')]);}else{logger['info'](_0x1afb('0x18'),_0x3bb458,_0x1afb('0x13'));_0x5a9b0b(_0x3078f1[_0x1afb('0x1a')]['message']);}})[_0x1afb('0x1b')](function(_0xfcd69d){logger[_0x1afb('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x3bb458,_0xfcd69d);_0x52f494(_0xfcd69d);});});}exports[_0x1afb('0x1c')]=function(_0x24abca){var _0x58dad1=this;return new Promise(function(_0x31411f,_0x4b5a98){return db[_0x1afb('0x1d')][_0x1afb('0x1e')](_0x24abca[_0x1afb('0x1f')],{'raw':_0x24abca[_0x1afb('0x20')]?_0x24abca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24abca['options']?_0x24abca[_0x1afb('0x20')]['where']||null:null,'attributes':_0x24abca[_0x1afb('0x20')]?_0x24abca['options'][_0x1afb('0x21')]||null:null,'limit':_0x24abca[_0x1afb('0x20')]?_0x24abca[_0x1afb('0x20')][_0x1afb('0x22')]||null:null})['then'](function(_0x18e2d8){logger[_0x1afb('0x12')](_0x1afb('0x1c'),_0x24abca);logger[_0x1afb('0x23')](_0x1afb('0x1c'),_0x24abca,JSON[_0x1afb('0x15')](_0x18e2d8));_0x31411f(_0x18e2d8);})[_0x1afb('0x1b')](function(_0x4ecb46){logger[_0x1afb('0x16')](_0x1afb('0x1c'),_0x4ecb46[_0x1afb('0x19')],_0x24abca);_0x4b5a98(_0x58dad1['error'](0x1f4,_0x4ecb46[_0x1afb('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x45ddcf){return new Promise(function(_0x4302c8,_0x398a60){return db['WhatsappInteraction']['find']({'where':_0x45ddcf['options']?_0x45ddcf[_0x1afb('0x20')]['where']||null:null})['then'](function(_0x324963){if(_0x324963){return _0x324963[_0x1afb('0x24')](_0x45ddcf[_0x1afb('0x1f')][_0x1afb('0x25')],_['omit'](_0x45ddcf['body'],[_0x1afb('0x25'),'id'])||{});}})['spread'](function(_0x234dce){logger[_0x1afb('0x12')](_0x1afb('0x26'),_0x45ddcf);logger[_0x1afb('0x23')](_0x1afb('0x26'),_0x45ddcf,JSON['stringify'](_0x234dce));_0x4302c8(_0x234dce);})[_0x1afb('0x1b')](function(_0x278d32){logger[_0x1afb('0x16')](_0x1afb('0x26'),_0x278d32[_0x1afb('0x19')],_0x45ddcf);_0x398a60(_this[_0x1afb('0x16')](0x1f4,_0x278d32['message']));});});};
\ No newline at end of file
index 142e0b8..86f3988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71dc=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','register','length'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x71dc,0xe1));var _0xc71d=function(_0x34eaf7,_0x36b8d1){_0x34eaf7=_0x34eaf7-0x0;var _0x544fc3=_0x71dc[_0x34eaf7];return _0x544fc3;};'use strict';var WhatsappInteractionEvents=require(_0xc71d('0x0'));var events=[_0xc71d('0x1'),_0xc71d('0x2'),_0xc71d('0x3')];function createListener(_0x31c27b,_0x3a4058){return function(_0x4af802){_0x3a4058[_0xc71d('0x4')](_0x31c27b,_0x4af802);};}function removeListener(_0x101468,_0x347870){return function(){WhatsappInteractionEvents['removeListener'](_0x101468,_0x347870);};}exports[_0xc71d('0x5')]=function(_0x59b21c){for(var _0x45e8c7=0x0,_0x30254b=events[_0xc71d('0x6')];_0x45e8c7<_0x30254b;_0x45e8c7++){var _0x86c42e=events[_0x45e8c7];var _0xf7b376=createListener(_0xc71d('0x7')+_0x86c42e,_0x59b21c);WhatsappInteractionEvents['on'](_0x86c42e,_0xf7b376);}};
\ No newline at end of file
+var _0x8c3b=['emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x54c8b8,_0x244e3d){var _0x1dbdb0=function(_0x2e95b6){while(--_0x2e95b6){_0x54c8b8['push'](_0x54c8b8['shift']());}};_0x1dbdb0(++_0x244e3d);}(_0x8c3b,0xf4));var _0xb8c3=function(_0x38de16,_0x2acea8){_0x38de16=_0x38de16-0x0;var _0x594a90=_0x8c3b[_0x38de16];return _0x594a90;};'use strict';var WhatsappInteractionEvents=require(_0xb8c3('0x0'));var events=[_0xb8c3('0x1'),'remove','update'];function createListener(_0x2ef865,_0x36eefd){return function(_0x2cb21a){_0x36eefd[_0xb8c3('0x2')](_0x2ef865,_0x2cb21a);};}function removeListener(_0x568dae,_0x5301ba){return function(){WhatsappInteractionEvents['removeListener'](_0x568dae,_0x5301ba);};}exports[_0xb8c3('0x3')]=function(_0x3e5226){for(var _0x3aa2ad=0x0,_0x377a6b=events[_0xb8c3('0x4')];_0x3aa2ad<_0x377a6b;_0x3aa2ad++){var _0x3191bc=events[_0x3aa2ad];var _0x12a22f=createListener(_0xb8c3('0x5')+_0x3191bc,_0x3e5226);WhatsappInteractionEvents['on'](_0x3191bc,_0x12a22f);}};
\ No newline at end of file
index 5ce9a7b..4f7fd62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb655=['accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','/describe','/:id','post','whatsapp','whatsappmessage:create','status','update'];(function(_0x3a15ce,_0x5f0345){var _0x57cd6b=function(_0xa66edf){while(--_0xa66edf){_0x3a15ce['push'](_0x3a15ce['shift']());}};_0x57cd6b(++_0x5f0345);}(_0xb655,0x127));var _0x5b65=function(_0x3e556e,_0x313982){_0x3e556e=_0x3e556e-0x0;var _0x4337b9=_0xb655[_0x3e556e];return _0x4337b9;};'use strict';var multer=require(_0x5b65('0x0'));var util=require(_0x5b65('0x1'));var path=require('path');var timeout=require(_0x5b65('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5b65('0x3'));var auth=require(_0x5b65('0x4'));var interaction=require(_0x5b65('0x5'));var config=require('../../config/environment');var controller=require(_0x5b65('0x6'));router['get']('/',auth[_0x5b65('0x7')](),controller[_0x5b65('0x8')]);router[_0x5b65('0x9')](_0x5b65('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x5b65('0x9')](_0x5b65('0xb'),auth[_0x5b65('0x7')](),controller['show']);router[_0x5b65('0xc')]('/',auth[_0x5b65('0x7')](),interaction['tracked'](_0x5b65('0xd'),_0x5b65('0xe')),controller['create']);router[_0x5b65('0xc')]('/:id/status',controller[_0x5b65('0xf')]);router['put'](_0x5b65('0xb'),auth[_0x5b65('0x7')](),controller[_0x5b65('0x10')]);router['put']('/:id/accept',auth[_0x5b65('0x7')](),controller[_0x5b65('0x11')]);router[_0x5b65('0x12')](_0x5b65('0x13'),auth[_0x5b65('0x7')](),controller[_0x5b65('0x14')]);router[_0x5b65('0x15')](_0x5b65('0xb'),auth[_0x5b65('0x7')](),controller[_0x5b65('0x16')]);module[_0x5b65('0x17')]=router;
\ No newline at end of file
+var _0x2f91=['./whatsappMessage.controller','get','index','isAuthenticated','/:id','show','tracked','whatsappmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5600ba,_0xe51f7c){var _0x2db0f1=function(_0x4a5896){while(--_0x4a5896){_0x5600ba['push'](_0x5600ba['shift']());}};_0x2db0f1(++_0xe51f7c);}(_0x2f91,0xd0));var _0x12f9=function(_0x3e9e9e,_0x4ef6aa){_0x3e9e9e=_0x3e9e9e-0x0;var _0x3844f7=_0x2f91[_0x3e9e9e];return _0x3844f7;};'use strict';var multer=require(_0x12f9('0x0'));var util=require('util');var path=require(_0x12f9('0x1'));var timeout=require(_0x12f9('0x2'));var express=require(_0x12f9('0x3'));var router=express[_0x12f9('0x4')]();var fs_extra=require(_0x12f9('0x5'));var auth=require(_0x12f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12f9('0x7'));var controller=require(_0x12f9('0x8'));router[_0x12f9('0x9')]('/',auth['isAuthenticated'](),controller[_0x12f9('0xa')]);router['get']('/describe',auth[_0x12f9('0xb')](),controller['describe']);router[_0x12f9('0x9')](_0x12f9('0xc'),auth[_0x12f9('0xb')](),controller[_0x12f9('0xd')]);router['post']('/',auth[_0x12f9('0xb')](),interaction[_0x12f9('0xe')]('whatsapp',_0x12f9('0xf')),controller[_0x12f9('0x10')]);router[_0x12f9('0x11')](_0x12f9('0x12'),controller[_0x12f9('0x13')]);router[_0x12f9('0x14')]('/:id',auth[_0x12f9('0xb')](),controller[_0x12f9('0x15')]);router[_0x12f9('0x14')](_0x12f9('0x16'),auth[_0x12f9('0xb')](),controller[_0x12f9('0x17')]);router[_0x12f9('0x14')](_0x12f9('0x18'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x12f9('0xc'),auth[_0x12f9('0xb')](),controller[_0x12f9('0x19')]);module[_0x12f9('0x1a')]=router;
\ No newline at end of file
index f8d972b..8ee4f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6e1=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1f043d,_0x5d91f3){var _0x4de6df=function(_0x5c05e9){while(--_0x5c05e9){_0x1f043d['push'](_0x1f043d['shift']());}};_0x4de6df(++_0x5d91f3);}(_0xd6e1,0x9c));var _0x1d6e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd6e1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x1d6e('0x0'));module[_0x1d6e('0x1')]={'body':{'type':Sequelize[_0x1d6e('0x2')](_0x1d6e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1d6e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1d6e('0x5')]('in',_0x1d6e('0x6')),'defaultValue':_0x1d6e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1d6e('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1d6e('0x8')]},'providerResponse':{'type':Sequelize[_0x1d6e('0x2')]}};
\ No newline at end of file
+var _0xa8c4=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0xaca142,_0x2f6a6a){var _0x106f9f=function(_0x5223c6){while(--_0x5223c6){_0xaca142['push'](_0xaca142['shift']());}};_0x106f9f(++_0x2f6a6a);}(_0xa8c4,0x12d));var _0x4a8c=function(_0x50b295,_0x420eaf){_0x50b295=_0x50b295-0x0;var _0x230324=_0xa8c4[_0x50b295];return _0x230324;};'use strict';var Sequelize=require('sequelize');module[_0x4a8c('0x0')]={'body':{'type':Sequelize[_0x4a8c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4a8c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4a8c('0x3')]('in','out'),'defaultValue':_0x4a8c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4a8c('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4a8c('0x5')]},'readAt':{'type':Sequelize[_0x4a8c('0x6')]},'secret':{'type':Sequelize[_0x4a8c('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4a8c('0x5')]},'providerResponse':{'type':Sequelize[_0x4a8c('0x1')]}};
\ No newline at end of file
index ad6959d..9489152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b8f=['messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','include','findAll','rows','catch','show','params','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','Sequelize','contact','fullname','email','internal','manual','channel','motionChannel','accept','EventManager','acceptmessage','WhatsappInteraction','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','interface','SIP/%s','event','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid'];(function(_0x540231,_0x117b98){var _0x31334b=function(_0xd90d86){while(--_0xd90d86){_0x540231['push'](_0x540231['shift']());}};_0x31334b(++_0x117b98);}(_0x1b8f,0x127));var _0xf1b8=function(_0x1e4dbe,_0x448b82){_0x1e4dbe=_0x1e4dbe-0x0;var _0x4b1668=_0x1b8f[_0x1e4dbe];return _0x4b1668;};'use strict';var emlformat=require(_0xf1b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1b8('0x1'));var jsonpatch=require(_0xf1b8('0x2'));var rp=require(_0xf1b8('0x3'));var moment=require('moment');var BPromise=require(_0xf1b8('0x4'));var Mustache=require(_0xf1b8('0x5'));var util=require(_0xf1b8('0x6'));var path=require(_0xf1b8('0x7'));var sox=require(_0xf1b8('0x8'));var csv=require(_0xf1b8('0x9'));var ejs=require(_0xf1b8('0xa'));var fs=require('fs');var fs_extra=require(_0xf1b8('0xb'));var _=require(_0xf1b8('0xc'));var squel=require(_0xf1b8('0xd'));var crypto=require(_0xf1b8('0xe'));var jsforce=require(_0xf1b8('0xf'));var deskjs=require(_0xf1b8('0x10'));var toCsv=require(_0xf1b8('0x9'));var querystring=require(_0xf1b8('0x11'));var Papa=require(_0xf1b8('0x12'));var Redis=require('ioredis');var authService=require(_0xf1b8('0x13'));var qs=require(_0xf1b8('0x14'));var as=require(_0xf1b8('0x15'));var hardwareService=require(_0xf1b8('0x16'));var logger=require(_0xf1b8('0x17'))(_0xf1b8('0x18'));var utils=require(_0xf1b8('0x19'));var config=require(_0xf1b8('0x1a'));var licenseUtil=require(_0xf1b8('0x1b'));var db=require(_0xf1b8('0x1c'))['db'];config[_0xf1b8('0x1d')]=_['defaults'](config[_0xf1b8('0x1d')],{'host':_0xf1b8('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1b8('0x1d')]));require(_0xf1b8('0x1f'))[_0xf1b8('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf1b8('0x21')][_0xf1b8('0x22')]({'port':0x232c});var client9002=jayson[_0xf1b8('0x21')][_0xf1b8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5c8c0d,_0xd8f5d4,_0x7d0adf,_0x5364dd){return new BPromise(function(_0x45d0cc,_0x3365ae){var _0x42dc7b=_0x5364dd||client;return _0x42dc7b[_0xf1b8('0x23')](_0x5c8c0d,_0x7d0adf)[_0xf1b8('0x24')](function(_0x72a294){logger[_0xf1b8('0x25')](_0xf1b8('0x26'),_0xd8f5d4,'request\x20sent');logger[_0xf1b8('0x27')](_0xf1b8('0x28'),_0xd8f5d4,'request\x20sent',JSON[_0xf1b8('0x29')](_0x72a294));if(_0x72a294['error']){if(_0x72a294['error'][_0xf1b8('0x2a')]===0x1f4){logger['error'](_0xf1b8('0x26'),_0xd8f5d4,_0x72a294[_0xf1b8('0x2b')][_0xf1b8('0x2c')]);return _0x3365ae(_0x72a294['error'][_0xf1b8('0x2c')]);}logger[_0xf1b8('0x2b')](_0xf1b8('0x26'),_0xd8f5d4,_0x72a294[_0xf1b8('0x2b')][_0xf1b8('0x2c')]);return _0x45d0cc(_0x72a294[_0xf1b8('0x2b')][_0xf1b8('0x2c')]);}else{logger[_0xf1b8('0x25')](_0xf1b8('0x26'),_0xd8f5d4,'request\x20sent');_0x45d0cc(_0x72a294[_0xf1b8('0x2d')][_0xf1b8('0x2c')]);}})['catch'](function(_0x1dc333){logger[_0xf1b8('0x2b')](_0xf1b8('0x26'),_0xd8f5d4,_0x1dc333);_0x3365ae(_0x1dc333);});});}function respondWithStatusCode(_0x42a29c,_0x117586){_0x117586=_0x117586||0xcc;return function(_0x16f754){if(_0x16f754){return _0x42a29c[_0xf1b8('0x2e')](_0x117586);}return _0x42a29c[_0xf1b8('0x2f')](_0x117586)[_0xf1b8('0x30')]();};}function respondWithResult(_0xa2b830,_0x1799c0){_0x1799c0=_0x1799c0||0xc8;return function(_0x415895){if(_0x415895){return _0xa2b830[_0xf1b8('0x2f')](_0x1799c0)[_0xf1b8('0x31')](_0x415895);}};}function respondWithFilteredResult(_0x285127,_0xa39d94){return function(_0x3d784d){if(_0x3d784d){var _0x4f505a=typeof _0xa39d94[_0xf1b8('0x32')]===_0xf1b8('0x33')&&typeof _0xa39d94[_0xf1b8('0x34')]==='undefined';var _0x43eb2a=_0x3d784d[_0xf1b8('0x35')];var _0x2c43d7=_0x4f505a?0x0:_0xa39d94[_0xf1b8('0x32')];var _0x4e0721=_0x4f505a?_0x3d784d[_0xf1b8('0x35')]:_0xa39d94['offset']+_0xa39d94[_0xf1b8('0x34')];var _0x2a0a22;if(_0x4e0721>=_0x43eb2a){_0x4e0721=_0x43eb2a;_0x2a0a22=0xc8;}else{_0x2a0a22=0xce;}_0x285127[_0xf1b8('0x2f')](_0x2a0a22);return _0x285127[_0xf1b8('0x36')](_0xf1b8('0x37'),_0x2c43d7+'-'+_0x4e0721+'/'+_0x43eb2a)['json'](_0x3d784d);}return null;};}function patchUpdates(_0x1874f8){return function(_0x4dcdf2){try{jsonpatch[_0xf1b8('0x38')](_0x4dcdf2,_0x1874f8,!![]);}catch(_0x52a2b1){return BPromise[_0xf1b8('0x39')](_0x52a2b1);}return _0x4dcdf2[_0xf1b8('0x3a')]();};}function saveUpdates(_0x441ecd,_0x3e7812){return function(_0x21ec55){if(_0x21ec55){return _0x21ec55[_0xf1b8('0x3b')](_0x441ecd)['then'](function(_0x58cfbc){return _0x58cfbc;});}return null;};}function removeEntity(_0x150103,_0x406f4f){return function(_0x47ba4b){if(_0x47ba4b){return _0x47ba4b[_0xf1b8('0x3c')]()[_0xf1b8('0x24')](function(){_0x150103['status'](0xcc)[_0xf1b8('0x30')]();});}};}function handleEntityNotFound(_0x258944,_0x16e2dd){return function(_0x3b6f81){if(!_0x3b6f81){_0x258944[_0xf1b8('0x2e')](0x194);}return _0x3b6f81;};}function handleError(_0x2f7cf4,_0x1a81a3){_0x1a81a3=_0x1a81a3||0x1f4;return function(_0x7ef776){logger[_0xf1b8('0x2b')](_0x7ef776[_0xf1b8('0x3d')]);if(_0x7ef776[_0xf1b8('0x3e')]){delete _0x7ef776['name'];}_0x2f7cf4[_0xf1b8('0x2f')](_0x1a81a3)[_0xf1b8('0x3f')](_0x7ef776);};}exports['index']=function(_0x27636d,_0x5ba349){var _0x1518d0={},_0x209994={},_0x58a1ed={'count':0x0,'rows':[]};var _0x9f902a=_[_0xf1b8('0x40')](db['WhatsappMessage'][_0xf1b8('0x41')],function(_0x26077d){return{'name':_0x26077d['fieldName'],'type':_0x26077d[_0xf1b8('0x42')][_0xf1b8('0x43')]};});_0x209994['model']=_[_0xf1b8('0x40')](_0x9f902a,'name');_0x209994[_0xf1b8('0x44')]=_[_0xf1b8('0x45')](_0x27636d['query']);_0x209994[_0xf1b8('0x46')]=_[_0xf1b8('0x47')](_0x209994['model'],_0x209994[_0xf1b8('0x44')]);_0x1518d0[_0xf1b8('0x48')]=_[_0xf1b8('0x47')](_0x209994[_0xf1b8('0x49')],qs[_0xf1b8('0x4a')](_0x27636d[_0xf1b8('0x44')][_0xf1b8('0x4a')]));_0x1518d0[_0xf1b8('0x48')]=_0x1518d0['attributes'][_0xf1b8('0x4b')]?_0x1518d0[_0xf1b8('0x48')]:_0x209994[_0xf1b8('0x49')];if(!_0x27636d[_0xf1b8('0x44')]['hasOwnProperty'](_0xf1b8('0x4c'))){_0x1518d0['limit']=qs[_0xf1b8('0x34')](_0x27636d[_0xf1b8('0x44')][_0xf1b8('0x34')]);_0x1518d0[_0xf1b8('0x32')]=qs[_0xf1b8('0x32')](_0x27636d[_0xf1b8('0x44')][_0xf1b8('0x32')]);}_0x1518d0[_0xf1b8('0x4d')]=qs[_0xf1b8('0x4e')](_0x27636d[_0xf1b8('0x44')]['sort']);_0x1518d0[_0xf1b8('0x4f')]=qs[_0xf1b8('0x46')](_[_0xf1b8('0x50')](_0x27636d[_0xf1b8('0x44')],_0x209994['filters']),_0x9f902a);if(_0x27636d[_0xf1b8('0x44')][_0xf1b8('0x51')]){_0x1518d0[_0xf1b8('0x4f')]=_[_0xf1b8('0x52')](_0x1518d0['where'],{'$or':_[_0xf1b8('0x40')](_0x9f902a,function(_0xd79eef){if(_0xd79eef[_0xf1b8('0x42')]!==_0xf1b8('0x53')){var _0x422837={};_0x422837[_0xd79eef[_0xf1b8('0x3e')]]={'$like':'%'+_0x27636d[_0xf1b8('0x44')]['filter']+'%'};return _0x422837;}})});}_0x1518d0=_[_0xf1b8('0x52')]({},_0x1518d0,_0x27636d[_0xf1b8('0x54')]);var _0x5385cc={'where':_0x1518d0['where']};return db[_0xf1b8('0x55')][_0xf1b8('0x35')](_0x5385cc)['then'](function(_0x206687){_0x58a1ed[_0xf1b8('0x35')]=_0x206687;if(_0x27636d['query']['includeAll']){_0x1518d0[_0xf1b8('0x56')]=[{'all':!![]}];}return db[_0xf1b8('0x55')][_0xf1b8('0x57')](_0x1518d0);})[_0xf1b8('0x24')](function(_0x221da8){_0x58a1ed[_0xf1b8('0x58')]=_0x221da8;return _0x58a1ed;})[_0xf1b8('0x24')](respondWithFilteredResult(_0x5ba349,_0x1518d0))[_0xf1b8('0x59')](handleError(_0x5ba349,null));};exports[_0xf1b8('0x5a')]=function(_0x47f713,_0x433719){var _0x22013d={'raw':!![],'where':{'id':_0x47f713[_0xf1b8('0x5b')]['id']}},_0x970a00={};_0x970a00[_0xf1b8('0x49')]=_['keys'](db[_0xf1b8('0x55')][_0xf1b8('0x41')]);_0x970a00[_0xf1b8('0x44')]=_[_0xf1b8('0x45')](_0x47f713[_0xf1b8('0x44')]);_0x970a00[_0xf1b8('0x46')]=_[_0xf1b8('0x47')](_0x970a00['model'],_0x970a00['query']);_0x22013d[_0xf1b8('0x48')]=_[_0xf1b8('0x47')](_0x970a00[_0xf1b8('0x49')],qs['fields'](_0x47f713[_0xf1b8('0x44')]['fields']));_0x22013d['attributes']=_0x22013d['attributes'][_0xf1b8('0x4b')]?_0x22013d['attributes']:_0x970a00['model'];if(_0x47f713[_0xf1b8('0x44')]['includeAll']){_0x22013d[_0xf1b8('0x56')]=[{'all':!![]}];}_0x22013d=_[_0xf1b8('0x52')]({},_0x22013d,_0x47f713[_0xf1b8('0x54')]);return db[_0xf1b8('0x55')][_0xf1b8('0x5c')](_0x22013d)[_0xf1b8('0x24')](handleEntityNotFound(_0x433719,null))[_0xf1b8('0x24')](respondWithResult(_0x433719,null))[_0xf1b8('0x59')](handleError(_0x433719,null));};exports[_0xf1b8('0x5d')]=function(_0xcc8745,_0x3a4840){return db[_0xf1b8('0x55')][_0xf1b8('0x5d')](_0xcc8745['body'],{})[_0xf1b8('0x24')](respondWithResult(_0x3a4840,0xc9))[_0xf1b8('0x59')](handleError(_0x3a4840,null));};exports['update']=function(_0x53ac93,_0x3ae8fb){if(_0x53ac93[_0xf1b8('0x5e')]['id']){delete _0x53ac93[_0xf1b8('0x5e')]['id'];}return db[_0xf1b8('0x55')][_0xf1b8('0x5c')]({'where':{'id':_0x53ac93[_0xf1b8('0x5b')]['id']}})[_0xf1b8('0x24')](handleEntityNotFound(_0x3ae8fb,null))[_0xf1b8('0x24')](saveUpdates(_0x53ac93[_0xf1b8('0x5e')],null))[_0xf1b8('0x24')](respondWithResult(_0x3ae8fb,null))[_0xf1b8('0x59')](handleError(_0x3ae8fb,null));};exports['destroy']=function(_0xc2895a,_0x35923b){return db[_0xf1b8('0x55')][_0xf1b8('0x5c')]({'where':{'id':_0xc2895a[_0xf1b8('0x5b')]['id']}})[_0xf1b8('0x24')](handleEntityNotFound(_0x35923b,null))['then'](removeEntity(_0x35923b,null))[_0xf1b8('0x59')](handleError(_0x35923b,null));};exports[_0xf1b8('0x5f')]=function(_0x1b1a38,_0x4b0763){return db[_0xf1b8('0x55')][_0xf1b8('0x5f')]()[_0xf1b8('0x24')](respondWithResult(_0x4b0763,null))[_0xf1b8('0x59')](handleError(_0x4b0763,null));};var interaction_log=require(_0xf1b8('0x17'))(_0xf1b8('0x60'));exports['accept']=function(_0x2ea42f,_0x535800,_0x5d1044){var _0x25cb44={'agent':{},'channel':_0xf1b8('0x61')};if(_0x2ea42f['body']['id']){delete _0x2ea42f['body']['id'];}_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x62')]=!![];_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x63')]=moment()[_0xf1b8('0x64')](_0xf1b8('0x65'));_0x2ea42f[_0xf1b8('0x5e')]['UserId']=_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x66')]||_0x2ea42f[_0xf1b8('0x67')]['id'];_0x25cb44[_0xf1b8('0x68')]['id']=_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x66')];return db[_0xf1b8('0x55')][_0xf1b8('0x5c')]({'where':{'id':_0x2ea42f[_0xf1b8('0x5b')]['id'],'UserId':null}})[_0xf1b8('0x24')](handleEntityNotFound(_0x535800,null))[_0xf1b8('0x24')](saveUpdates(_0x2ea42f['body'],null))[_0xf1b8('0x24')](function(_0x271f0c){if(_0x271f0c){_0x25cb44[_0xf1b8('0x2c')]=_0x271f0c[_0xf1b8('0x69')]({'plain':!![]});return db['WhatsappInteraction'][_0xf1b8('0x5c')]({'where':{'id':_0x271f0c[_0xf1b8('0x6a')]}});}return null;})[_0xf1b8('0x24')](handleEntityNotFound(_0x535800,null))['then'](function(_0x4254e6){if(_0x4254e6){return _0x4254e6['update']({'UserId':_0x2ea42f[_0xf1b8('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x4254e6[_0xf1b8('0x6b')])?moment()[_0xf1b8('0x64')](_0xf1b8('0x65')):undefined});}return null;})[_0xf1b8('0x24')](function(_0x31bccc){if(_0x31bccc){_0x25cb44[_0xf1b8('0x6c')]=_0x31bccc[_0xf1b8('0x69')]({'plain':!![]});interaction_log[_0xf1b8('0x25')](_0xf1b8('0x6d'),_0x2ea42f[_0xf1b8('0x67')]['id'],_0x2ea42f['user'][_0xf1b8('0x3e')],_0x2ea42f['user']['role'],_0x25cb44[_0xf1b8('0x6c')]['id'],_0x2ea42f[_0xf1b8('0x5e')]?JSON[_0xf1b8('0x29')](_0x2ea42f[_0xf1b8('0x5e')]):_0xf1b8('0x6e'));return respondWithRpcPromise(_0xf1b8('0x6f'),_0xf1b8('0x70'),_0x25cb44);}return null;})[_0xf1b8('0x24')](function(_0xa116c){var _0x2a7e42='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa116c[_0xf1b8('0x2c')][_0xf1b8('0x71')];return db['sequelize']['query'](_0x2a7e42,{'type':db[_0xf1b8('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf1b8('0x24')](function(_0x264388){return _0x264388;});})[_0xf1b8('0x24')](function(_0x387785){if(_0x387785){_0x25cb44[_0xf1b8('0x2c')][_0xf1b8('0x73')]=_0x387785[0x0];if(!_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x66')])return;return db['User'][_0xf1b8('0x5c')]({'where':{'id':_0x2ea42f['body'][_0xf1b8('0x66')],'role':_0xf1b8('0x68')},'attributes':['id',_0xf1b8('0x3e'),_0xf1b8('0x74'),_0xf1b8('0x75'),_0xf1b8('0x76')],'raw':!![]});}return null;})['then'](function(_0x37a047){if(!_0x37a047)return null;_0x25cb44[_0xf1b8('0x2c')][_0xf1b8('0x68')]=_0x37a047;return _0x25cb44;})['then'](function(_0x133fff){if(_0x133fff){if(_0x2ea42f[_0xf1b8('0x5e')][_0xf1b8('0x77')]){_0x25cb44[_0xf1b8('0x2c')]['interface']=util[_0xf1b8('0x64')]('SIP/%s',_0x2ea42f[_0xf1b8('0x67')][_0xf1b8('0x3e')]);_0x25cb44[_0xf1b8('0x2c')][_0xf1b8('0x78')]=_0x25cb44[_0xf1b8('0x78')];_0x25cb44[_0xf1b8('0x2c')][_0xf1b8('0x79')]=_0x25cb44[_0xf1b8('0x78')];_0x25cb44[_0xf1b8('0x2c')]['event']=_0xf1b8('0x7a');return respondWithRpcPromise('EventManager',_0xf1b8('0x7b'),{'event':_0xf1b8('0x7c'),'message':_0x25cb44['message']},client9002)[_0xf1b8('0x24')](function(){return _0x25cb44;});}return _0x25cb44;}return null;})['then'](respondWithResult(_0x535800,null))[_0xf1b8('0x59')](handleError(_0x535800,null));};var interaction_log=require(_0xf1b8('0x17'))('whatsapp-interactions');exports['reject']=function(_0x34f787,_0x1ef3ef,_0xc1b3f7){var _0x1e9012={'agent':{},'channel':_0xf1b8('0x61')};if(_0x34f787[_0xf1b8('0x5e')]['id']){delete _0x34f787[_0xf1b8('0x5e')]['id'];}_0x34f787['body'][_0xf1b8('0x66')]=_0x34f787['body'][_0xf1b8('0x66')]||_0x34f787[_0xf1b8('0x67')]['id'];_0x1e9012[_0xf1b8('0x68')]['id']=_0x34f787['body'][_0xf1b8('0x66')];return db[_0xf1b8('0x55')][_0xf1b8('0x5c')]({'where':{'id':_0x34f787[_0xf1b8('0x5b')]['id'],'UserId':null}})[_0xf1b8('0x24')](handleEntityNotFound(_0x1ef3ef,null))[_0xf1b8('0x24')](function(_0x3dafe6){if(_0x3dafe6){_0x1e9012[_0xf1b8('0x2c')]=_0x3dafe6[_0xf1b8('0x69')]({'plain':!![]});return db[_0xf1b8('0x7d')][_0xf1b8('0x5c')]({'where':{'id':_0x3dafe6[_0xf1b8('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x1ef3ef,null))[_0xf1b8('0x24')](function(_0x3da98e){if(_0x3da98e){_0x1e9012[_0xf1b8('0x6c')]=_0x3da98e[_0xf1b8('0x69')]({'plain':!![]});interaction_log[_0xf1b8('0x25')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34f787[_0xf1b8('0x67')]['id'],_0x34f787[_0xf1b8('0x67')][_0xf1b8('0x3e')],_0x34f787['user'][_0xf1b8('0x7e')],_0x1e9012[_0xf1b8('0x6c')]['id'],_0x34f787[_0xf1b8('0x5e')]?JSON[_0xf1b8('0x29')](_0x34f787['body']):_0xf1b8('0x6e'));return respondWithRpcPromise('RejectMessage',_0xf1b8('0x7f'),_0x1e9012);}return null;})[_0xf1b8('0x24')](function(_0xe30920){var _0x2a7b58=_0xf1b8('0x80')+_0xe30920['message'][_0xf1b8('0x71')];return db[_0xf1b8('0x81')][_0xf1b8('0x44')](_0x2a7b58,{'type':db['Sequelize'][_0xf1b8('0x82')][_0xf1b8('0x83')],'raw':!![]})['then'](function(_0x14ae31){return _0x14ae31;});})['then'](function(_0x2a95d5){if(_0x2a95d5){_0x1e9012['message'][_0xf1b8('0x73')]=_0x2a95d5[0x0];if(!_0x34f787[_0xf1b8('0x5e')][_0xf1b8('0x66')])return;return db['User'][_0xf1b8('0x5c')]({'where':{'id':_0x34f787['body'][_0xf1b8('0x66')],'role':_0xf1b8('0x68')},'attributes':['id',_0xf1b8('0x3e'),'fullname','email',_0xf1b8('0x76')],'raw':!![]});}return null;})[_0xf1b8('0x24')](function(_0x419554){if(!_0x419554)return null;_0x1e9012[_0xf1b8('0x2c')]['agent']=_0x419554;return _0x1e9012;})['then'](function(_0x31bba0){if(_0x31bba0){_0x31bba0[_0xf1b8('0x2c')][_0xf1b8('0x84')]=util['format'](_0xf1b8('0x85'),_0x34f787[_0xf1b8('0x67')][_0xf1b8('0x3e')]);_0x31bba0[_0xf1b8('0x2c')]['channel']=_0x1e9012[_0xf1b8('0x78')];_0x31bba0[_0xf1b8('0x2c')][_0xf1b8('0x79')]=_0x1e9012[_0xf1b8('0x78')];_0x31bba0['message'][_0xf1b8('0x86')]=_0xf1b8('0x39');respondWithRpcPromise(_0xf1b8('0x7b'),_0xf1b8('0x7b'),{'event':_0xf1b8('0x87'),'message':_0x31bba0['message']},client9002);return _0x1e9012;}return null;})[_0xf1b8('0x24')](respondWithResult(_0x1ef3ef,null))[_0xf1b8('0x59')](handleError(_0x1ef3ef,null));};exports['status']=function(_0x26fbd4,_0xf0425e,_0x2bd621){if(_0x26fbd4[_0xf1b8('0x5e')]['id']){delete _0x26fbd4[_0xf1b8('0x5e')]['id'];}var _0x4eab54;return db[_0xf1b8('0x55')]['find']({'where':{'id':_0x26fbd4[_0xf1b8('0x5b')]['id']}})['then'](handleEntityNotFound(_0xf0425e,null))[_0xf1b8('0x24')](function(_0x303096){if(_0x303096){_0x4eab54=_0x303096;return db[_0xf1b8('0x88')][_0xf1b8('0x5c')]({'where':{'id':_0x303096['WhatsappAccountId']}});}})[_0xf1b8('0x24')](handleEntityNotFound(_0xf0425e,null))[_0xf1b8('0x24')](function(_0x551977){if(_0x551977){logger[_0xf1b8('0x27')](_0xf1b8('0x89'),_0xf1b8('0x2f'),_0xf1b8('0x8a'),_0x551977[_0xf1b8('0x42')],util['inspect'](_0x26fbd4[_0xf1b8('0x5e')],{'showHidden':![],'depth':null}));switch(_0x551977[_0xf1b8('0x42')]){case'twilio':if(_0x26fbd4[_0xf1b8('0x5e')][_0xf1b8('0x8b')]&&_0x26fbd4[_0xf1b8('0x5e')][_0xf1b8('0x8b')]===_0x4eab54[_0xf1b8('0x8c')]&&_0x26fbd4[_0xf1b8('0x5e')][_0xf1b8('0x8d')]&&_0x26fbd4[_0xf1b8('0x5e')][_0xf1b8('0x8d')]===_0xf1b8('0x62')){return _0x4eab54['update']({'read':!![]});}else{logger['error'](_0xf1b8('0x8e'),_0xf1b8('0x2f'),_0xf1b8('0x8f'),util[_0xf1b8('0x90')](_0x26fbd4[_0xf1b8('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x4eab54;}})['then'](respondWithResult(_0xf0425e,null))[_0xf1b8('0x59')](handleError(_0xf0425e,null));};
\ No newline at end of file
+var _0x8cdf=['WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','whatsapp-interactions','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','fullname','internal','motionChannel','rejectmessage','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3f30e5,_0x3ac3b3){var _0xc22789=function(_0x521a5b){while(--_0x521a5b){_0x3f30e5['push'](_0x3f30e5['shift']());}};_0xc22789(++_0x3ac3b3);}(_0x8cdf,0x69));var _0xf8cd=function(_0x3bb077,_0x3d466d){_0x3bb077=_0x3bb077-0x0;var _0x2d6c9b=_0x8cdf[_0x3bb077];return _0x2d6c9b;};'use strict';var emlformat=require(_0xf8cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8cd('0x1'));var jsonpatch=require(_0xf8cd('0x2'));var rp=require('request-promise');var moment=require(_0xf8cd('0x3'));var BPromise=require(_0xf8cd('0x4'));var Mustache=require(_0xf8cd('0x5'));var util=require(_0xf8cd('0x6'));var path=require(_0xf8cd('0x7'));var sox=require(_0xf8cd('0x8'));var csv=require('to-csv');var ejs=require(_0xf8cd('0x9'));var fs=require('fs');var fs_extra=require(_0xf8cd('0xa'));var _=require(_0xf8cd('0xb'));var squel=require(_0xf8cd('0xc'));var crypto=require('crypto');var jsforce=require(_0xf8cd('0xd'));var deskjs=require(_0xf8cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8cd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf8cd('0x10'));var qs=require(_0xf8cd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8cd('0x12'));var logger=require(_0xf8cd('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf8cd('0x14'));var licenseUtil=require(_0xf8cd('0x15'));var db=require('../../mysqldb')['db'];config[_0xf8cd('0x16')]=_[_0xf8cd('0x17')](config[_0xf8cd('0x16')],{'host':_0xf8cd('0x18'),'port':0x18eb});var socket=require(_0xf8cd('0x19'))(new Redis(config[_0xf8cd('0x16')]));require(_0xf8cd('0x1a'))['register'](socket);var jayson=require(_0xf8cd('0x1b'));var client=jayson[_0xf8cd('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf8cd('0x1c')][_0xf8cd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x45d6a5,_0x1684a1,_0x2b3b94,_0x447755){return new BPromise(function(_0x38d336,_0x211a2c){var _0xa15ed6=_0x447755||client;return _0xa15ed6['request'](_0x45d6a5,_0x2b3b94)[_0xf8cd('0x1e')](function(_0x3260d1){logger[_0xf8cd('0x1f')](_0xf8cd('0x20'),_0x1684a1,_0xf8cd('0x21'));logger['debug'](_0xf8cd('0x22'),_0x1684a1,_0xf8cd('0x21'),JSON[_0xf8cd('0x23')](_0x3260d1));if(_0x3260d1[_0xf8cd('0x24')]){if(_0x3260d1['error']['code']===0x1f4){logger[_0xf8cd('0x24')](_0xf8cd('0x20'),_0x1684a1,_0x3260d1[_0xf8cd('0x24')]['message']);return _0x211a2c(_0x3260d1[_0xf8cd('0x24')][_0xf8cd('0x25')]);}logger[_0xf8cd('0x24')](_0xf8cd('0x20'),_0x1684a1,_0x3260d1[_0xf8cd('0x24')][_0xf8cd('0x25')]);return _0x38d336(_0x3260d1[_0xf8cd('0x24')]['message']);}else{logger['info'](_0xf8cd('0x20'),_0x1684a1,_0xf8cd('0x21'));_0x38d336(_0x3260d1['result']['message']);}})[_0xf8cd('0x26')](function(_0x2108c5){logger[_0xf8cd('0x24')](_0xf8cd('0x20'),_0x1684a1,_0x2108c5);_0x211a2c(_0x2108c5);});});}function respondWithStatusCode(_0x16e66b,_0x1c2e36){_0x1c2e36=_0x1c2e36||0xcc;return function(_0x3b833a){if(_0x3b833a){return _0x16e66b[_0xf8cd('0x27')](_0x1c2e36);}return _0x16e66b[_0xf8cd('0x28')](_0x1c2e36)[_0xf8cd('0x29')]();};}function respondWithResult(_0x50dc71,_0xf2c7ef){_0xf2c7ef=_0xf2c7ef||0xc8;return function(_0x338612){if(_0x338612){return _0x50dc71[_0xf8cd('0x28')](_0xf2c7ef)['json'](_0x338612);}};}function respondWithFilteredResult(_0x59bb74,_0x1bdba6){return function(_0x52e65d){if(_0x52e65d){var _0x39f8d4=typeof _0x1bdba6[_0xf8cd('0x2a')]===_0xf8cd('0x2b')&&typeof _0x1bdba6[_0xf8cd('0x2c')]===_0xf8cd('0x2b');var _0x5359eb=_0x52e65d[_0xf8cd('0x2d')];var _0x13612b=_0x39f8d4?0x0:_0x1bdba6['offset'];var _0x163e11=_0x39f8d4?_0x52e65d[_0xf8cd('0x2d')]:_0x1bdba6[_0xf8cd('0x2a')]+_0x1bdba6[_0xf8cd('0x2c')];var _0x1abefa;if(_0x163e11>=_0x5359eb){_0x163e11=_0x5359eb;_0x1abefa=0xc8;}else{_0x1abefa=0xce;}_0x59bb74[_0xf8cd('0x28')](_0x1abefa);return _0x59bb74[_0xf8cd('0x2e')](_0xf8cd('0x2f'),_0x13612b+'-'+_0x163e11+'/'+_0x5359eb)['json'](_0x52e65d);}return null;};}function patchUpdates(_0xdbac8b){return function(_0x26a451){try{jsonpatch[_0xf8cd('0x30')](_0x26a451,_0xdbac8b,!![]);}catch(_0x135303){return BPromise[_0xf8cd('0x31')](_0x135303);}return _0x26a451[_0xf8cd('0x32')]();};}function saveUpdates(_0x26ee90,_0x1430cc){return function(_0x9a9977){if(_0x9a9977){return _0x9a9977[_0xf8cd('0x33')](_0x26ee90)['then'](function(_0x20f7eb){return _0x20f7eb;});}return null;};}function removeEntity(_0x9100a8,_0x5a8954){return function(_0x2432ef){if(_0x2432ef){return _0x2432ef['destroy']()[_0xf8cd('0x1e')](function(){_0x9100a8['status'](0xcc)[_0xf8cd('0x29')]();});}};}function handleEntityNotFound(_0x465001,_0x217b2d){return function(_0x899857){if(!_0x899857){_0x465001['sendStatus'](0x194);}return _0x899857;};}function handleError(_0x35824b,_0x287e2e){_0x287e2e=_0x287e2e||0x1f4;return function(_0x260269){logger[_0xf8cd('0x24')](_0x260269[_0xf8cd('0x34')]);if(_0x260269[_0xf8cd('0x35')]){delete _0x260269[_0xf8cd('0x35')];}_0x35824b['status'](_0x287e2e)[_0xf8cd('0x36')](_0x260269);};}exports[_0xf8cd('0x37')]=function(_0x501418,_0x12de72){var _0x131169={},_0x18090e={},_0x4bd12d={'count':0x0,'rows':[]};var _0x4f2735=_[_0xf8cd('0x38')](db['WhatsappMessage'][_0xf8cd('0x39')],function(_0x26f910){return{'name':_0x26f910[_0xf8cd('0x3a')],'type':_0x26f910[_0xf8cd('0x3b')]['key']};});_0x18090e[_0xf8cd('0x3c')]=_[_0xf8cd('0x38')](_0x4f2735,_0xf8cd('0x35'));_0x18090e[_0xf8cd('0x3d')]=_[_0xf8cd('0x3e')](_0x501418['query']);_0x18090e[_0xf8cd('0x3f')]=_[_0xf8cd('0x40')](_0x18090e[_0xf8cd('0x3c')],_0x18090e[_0xf8cd('0x3d')]);_0x131169[_0xf8cd('0x41')]=_['intersection'](_0x18090e[_0xf8cd('0x3c')],qs[_0xf8cd('0x42')](_0x501418[_0xf8cd('0x3d')][_0xf8cd('0x42')]));_0x131169[_0xf8cd('0x41')]=_0x131169[_0xf8cd('0x41')][_0xf8cd('0x43')]?_0x131169['attributes']:_0x18090e[_0xf8cd('0x3c')];if(!_0x501418[_0xf8cd('0x3d')][_0xf8cd('0x44')](_0xf8cd('0x45'))){_0x131169[_0xf8cd('0x2c')]=qs[_0xf8cd('0x2c')](_0x501418[_0xf8cd('0x3d')]['limit']);_0x131169[_0xf8cd('0x2a')]=qs[_0xf8cd('0x2a')](_0x501418[_0xf8cd('0x3d')][_0xf8cd('0x2a')]);}_0x131169[_0xf8cd('0x46')]=qs[_0xf8cd('0x47')](_0x501418[_0xf8cd('0x3d')]['sort']);_0x131169[_0xf8cd('0x48')]=qs['filters'](_[_0xf8cd('0x49')](_0x501418[_0xf8cd('0x3d')],_0x18090e[_0xf8cd('0x3f')]),_0x4f2735);if(_0x501418[_0xf8cd('0x3d')][_0xf8cd('0x4a')]){_0x131169[_0xf8cd('0x48')]=_[_0xf8cd('0x4b')](_0x131169[_0xf8cd('0x48')],{'$or':_[_0xf8cd('0x38')](_0x4f2735,function(_0x14bd1b){if(_0x14bd1b['type']!==_0xf8cd('0x4c')){var _0xda57db={};_0xda57db[_0x14bd1b[_0xf8cd('0x35')]]={'$like':'%'+_0x501418[_0xf8cd('0x3d')][_0xf8cd('0x4a')]+'%'};return _0xda57db;}})});}_0x131169=_[_0xf8cd('0x4b')]({},_0x131169,_0x501418[_0xf8cd('0x4d')]);var _0x2b5b9c={'where':_0x131169[_0xf8cd('0x48')]};return db[_0xf8cd('0x4e')]['count'](_0x2b5b9c)['then'](function(_0x137c85){_0x4bd12d[_0xf8cd('0x2d')]=_0x137c85;if(_0x501418['query']['includeAll']){_0x131169[_0xf8cd('0x4f')]=[{'all':!![]}];}return db[_0xf8cd('0x4e')][_0xf8cd('0x50')](_0x131169);})[_0xf8cd('0x1e')](function(_0x40f3b4){_0x4bd12d[_0xf8cd('0x51')]=_0x40f3b4;return _0x4bd12d;})[_0xf8cd('0x1e')](respondWithFilteredResult(_0x12de72,_0x131169))[_0xf8cd('0x26')](handleError(_0x12de72,null));};exports[_0xf8cd('0x52')]=function(_0x487ef7,_0x3531e7){var _0x1cb37={'raw':!![],'where':{'id':_0x487ef7[_0xf8cd('0x53')]['id']}},_0x235180={};_0x235180[_0xf8cd('0x3c')]=_[_0xf8cd('0x3e')](db[_0xf8cd('0x4e')][_0xf8cd('0x39')]);_0x235180[_0xf8cd('0x3d')]=_[_0xf8cd('0x3e')](_0x487ef7[_0xf8cd('0x3d')]);_0x235180[_0xf8cd('0x3f')]=_['intersection'](_0x235180[_0xf8cd('0x3c')],_0x235180[_0xf8cd('0x3d')]);_0x1cb37[_0xf8cd('0x41')]=_[_0xf8cd('0x40')](_0x235180[_0xf8cd('0x3c')],qs[_0xf8cd('0x42')](_0x487ef7[_0xf8cd('0x3d')]['fields']));_0x1cb37[_0xf8cd('0x41')]=_0x1cb37[_0xf8cd('0x41')][_0xf8cd('0x43')]?_0x1cb37[_0xf8cd('0x41')]:_0x235180['model'];if(_0x487ef7[_0xf8cd('0x3d')][_0xf8cd('0x54')]){_0x1cb37[_0xf8cd('0x4f')]=[{'all':!![]}];}_0x1cb37=_['merge']({},_0x1cb37,_0x487ef7[_0xf8cd('0x4d')]);return db['WhatsappMessage'][_0xf8cd('0x55')](_0x1cb37)[_0xf8cd('0x1e')](handleEntityNotFound(_0x3531e7,null))[_0xf8cd('0x1e')](respondWithResult(_0x3531e7,null))['catch'](handleError(_0x3531e7,null));};exports['create']=function(_0x34e8fe,_0x4a59a2){return db['WhatsappMessage'][_0xf8cd('0x56')](_0x34e8fe[_0xf8cd('0x57')],{})[_0xf8cd('0x1e')](respondWithResult(_0x4a59a2,0xc9))[_0xf8cd('0x26')](handleError(_0x4a59a2,null));};exports[_0xf8cd('0x33')]=function(_0x305496,_0x30541c){if(_0x305496[_0xf8cd('0x57')]['id']){delete _0x305496[_0xf8cd('0x57')]['id'];}return db['WhatsappMessage'][_0xf8cd('0x55')]({'where':{'id':_0x305496['params']['id']}})[_0xf8cd('0x1e')](handleEntityNotFound(_0x30541c,null))[_0xf8cd('0x1e')](saveUpdates(_0x305496[_0xf8cd('0x57')],null))['then'](respondWithResult(_0x30541c,null))[_0xf8cd('0x26')](handleError(_0x30541c,null));};exports[_0xf8cd('0x58')]=function(_0x12f28b,_0x3ec2e5){return db[_0xf8cd('0x4e')][_0xf8cd('0x55')]({'where':{'id':_0x12f28b['params']['id']}})[_0xf8cd('0x1e')](handleEntityNotFound(_0x3ec2e5,null))[_0xf8cd('0x1e')](removeEntity(_0x3ec2e5,null))[_0xf8cd('0x26')](handleError(_0x3ec2e5,null));};exports[_0xf8cd('0x59')]=function(_0x4f5733,_0x10b1fc){return db[_0xf8cd('0x4e')][_0xf8cd('0x59')]()[_0xf8cd('0x1e')](respondWithResult(_0x10b1fc,null))[_0xf8cd('0x26')](handleError(_0x10b1fc,null));};var interaction_log=require('../../config/logger')(_0xf8cd('0x5a'));exports['accept']=function(_0x3617d2,_0xf1e00d,_0x227fa8){var _0x23608f={'agent':{},'channel':_0xf8cd('0x5b')};if(_0x3617d2[_0xf8cd('0x57')]['id']){delete _0x3617d2[_0xf8cd('0x57')]['id'];}_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5c')]=!![];_0x3617d2['body']['readAt']=moment()[_0xf8cd('0x5d')](_0xf8cd('0x5e'));_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5f')]=_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5f')]||_0x3617d2[_0xf8cd('0x60')]['id'];_0x23608f[_0xf8cd('0x61')]['id']=_0x3617d2['body'][_0xf8cd('0x5f')];return db[_0xf8cd('0x4e')]['find']({'where':{'id':_0x3617d2[_0xf8cd('0x53')]['id'],'UserId':null}})[_0xf8cd('0x1e')](handleEntityNotFound(_0xf1e00d,null))['then'](saveUpdates(_0x3617d2[_0xf8cd('0x57')],null))[_0xf8cd('0x1e')](function(_0x1ff708){if(_0x1ff708){_0x23608f[_0xf8cd('0x25')]=_0x1ff708[_0xf8cd('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xf8cd('0x55')]({'where':{'id':_0x1ff708[_0xf8cd('0x63')]}});}return null;})['then'](handleEntityNotFound(_0xf1e00d,null))[_0xf8cd('0x1e')](function(_0x5e12b5){if(_0x5e12b5){return _0x5e12b5[_0xf8cd('0x33')]({'UserId':_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5f')],'read1stAt':_[_0xf8cd('0x64')](_0x5e12b5[_0xf8cd('0x65')])?moment()[_0xf8cd('0x5d')](_0xf8cd('0x5e')):undefined});}return null;})[_0xf8cd('0x1e')](function(_0x337bfa){if(_0x337bfa){_0x23608f['interaction']=_0x337bfa[_0xf8cd('0x62')]({'plain':!![]});interaction_log[_0xf8cd('0x1f')](_0xf8cd('0x66'),_0x3617d2[_0xf8cd('0x60')]['id'],_0x3617d2[_0xf8cd('0x60')]['name'],_0x3617d2[_0xf8cd('0x60')]['role'],_0x23608f[_0xf8cd('0x67')]['id'],_0x3617d2[_0xf8cd('0x57')]?JSON[_0xf8cd('0x23')](_0x3617d2[_0xf8cd('0x57')]):_0xf8cd('0x68'));return respondWithRpcPromise(_0xf8cd('0x69'),_0xf8cd('0x6a'),_0x23608f);}return null;})[_0xf8cd('0x1e')](function(_0x2e9e6f){var _0x3817fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e9e6f[_0xf8cd('0x25')][_0xf8cd('0x6b')];return db[_0xf8cd('0x6c')][_0xf8cd('0x3d')](_0x3817fa,{'type':db[_0xf8cd('0x6d')][_0xf8cd('0x6e')][_0xf8cd('0x6f')],'raw':!![]})['then'](function(_0x4eed8b){return _0x4eed8b;});})[_0xf8cd('0x1e')](function(_0x4c1c87){if(_0x4c1c87){_0x23608f[_0xf8cd('0x25')]['contact']=_0x4c1c87[0x0];if(!_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5f')])return;return db[_0xf8cd('0x70')][_0xf8cd('0x55')]({'where':{'id':_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x5f')],'role':'agent'},'attributes':['id','name','fullname',_0xf8cd('0x71'),'internal'],'raw':!![]});}return null;})[_0xf8cd('0x1e')](function(_0x1a2536){if(!_0x1a2536)return null;_0x23608f[_0xf8cd('0x25')][_0xf8cd('0x61')]=_0x1a2536;return _0x23608f;})[_0xf8cd('0x1e')](function(_0x49d55a){if(_0x49d55a){if(_0x3617d2[_0xf8cd('0x57')][_0xf8cd('0x72')]){_0x23608f[_0xf8cd('0x25')][_0xf8cd('0x73')]=util[_0xf8cd('0x5d')](_0xf8cd('0x74'),_0x3617d2[_0xf8cd('0x60')]['name']);_0x23608f[_0xf8cd('0x25')][_0xf8cd('0x75')]=_0x23608f[_0xf8cd('0x75')];_0x23608f[_0xf8cd('0x25')]['motionChannel']=_0x23608f[_0xf8cd('0x75')];_0x23608f['message']['event']=_0xf8cd('0x76');return respondWithRpcPromise(_0xf8cd('0x77'),'EventManager',{'event':_0xf8cd('0x78'),'message':_0x23608f[_0xf8cd('0x25')]},client9002)[_0xf8cd('0x1e')](function(){return _0x23608f;});}return _0x23608f;}return null;})[_0xf8cd('0x1e')](respondWithResult(_0xf1e00d,null))['catch'](handleError(_0xf1e00d,null));};var interaction_log=require(_0xf8cd('0x13'))(_0xf8cd('0x5a'));exports[_0xf8cd('0x31')]=function(_0x141d79,_0x2115bb,_0x152ce2){var _0x5e8457={'agent':{},'channel':_0xf8cd('0x5b')};if(_0x141d79['body']['id']){delete _0x141d79[_0xf8cd('0x57')]['id'];}_0x141d79['body']['UserId']=_0x141d79[_0xf8cd('0x57')][_0xf8cd('0x5f')]||_0x141d79[_0xf8cd('0x60')]['id'];_0x5e8457[_0xf8cd('0x61')]['id']=_0x141d79['body'][_0xf8cd('0x5f')];return db[_0xf8cd('0x4e')]['find']({'where':{'id':_0x141d79[_0xf8cd('0x53')]['id'],'UserId':null}})[_0xf8cd('0x1e')](handleEntityNotFound(_0x2115bb,null))[_0xf8cd('0x1e')](function(_0x2d5a3c){if(_0x2d5a3c){_0x5e8457['message']=_0x2d5a3c[_0xf8cd('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xf8cd('0x55')]({'where':{'id':_0x2d5a3c['WhatsappInteractionId']}});}return null;})[_0xf8cd('0x1e')](handleEntityNotFound(_0x2115bb,null))[_0xf8cd('0x1e')](function(_0x32835b){if(_0x32835b){_0x5e8457[_0xf8cd('0x67')]=_0x32835b['get']({'plain':!![]});interaction_log['info'](_0xf8cd('0x79'),_0x141d79[_0xf8cd('0x60')]['id'],_0x141d79['user']['name'],_0x141d79[_0xf8cd('0x60')][_0xf8cd('0x7a')],_0x5e8457[_0xf8cd('0x67')]['id'],_0x141d79[_0xf8cd('0x57')]?JSON['stringify'](_0x141d79[_0xf8cd('0x57')]):'null');return respondWithRpcPromise(_0xf8cd('0x7b'),_0xf8cd('0x7c'),_0x5e8457);}return null;})[_0xf8cd('0x1e')](function(_0x1dc740){var _0x21b315=_0xf8cd('0x7d')+_0x1dc740['message'][_0xf8cd('0x6b')];return db['sequelize']['query'](_0x21b315,{'type':db[_0xf8cd('0x6d')]['QueryTypes'][_0xf8cd('0x6f')],'raw':!![]})[_0xf8cd('0x1e')](function(_0x4ce794){return _0x4ce794;});})['then'](function(_0x43ec39){if(_0x43ec39){_0x5e8457[_0xf8cd('0x25')][_0xf8cd('0x7e')]=_0x43ec39[0x0];if(!_0x141d79[_0xf8cd('0x57')][_0xf8cd('0x5f')])return;return db[_0xf8cd('0x70')]['find']({'where':{'id':_0x141d79[_0xf8cd('0x57')][_0xf8cd('0x5f')],'role':_0xf8cd('0x61')},'attributes':['id',_0xf8cd('0x35'),_0xf8cd('0x7f'),'email',_0xf8cd('0x80')],'raw':!![]});}return null;})[_0xf8cd('0x1e')](function(_0x1fbcf2){if(!_0x1fbcf2)return null;_0x5e8457[_0xf8cd('0x25')][_0xf8cd('0x61')]=_0x1fbcf2;return _0x5e8457;})[_0xf8cd('0x1e')](function(_0x525667){if(_0x525667){_0x525667[_0xf8cd('0x25')]['interface']=util[_0xf8cd('0x5d')]('SIP/%s',_0x141d79[_0xf8cd('0x60')][_0xf8cd('0x35')]);_0x525667[_0xf8cd('0x25')][_0xf8cd('0x75')]=_0x5e8457[_0xf8cd('0x75')];_0x525667[_0xf8cd('0x25')][_0xf8cd('0x81')]=_0x5e8457['channel'];_0x525667[_0xf8cd('0x25')]['event']='reject';respondWithRpcPromise(_0xf8cd('0x77'),_0xf8cd('0x77'),{'event':_0xf8cd('0x82'),'message':_0x525667['message']},client9002);return _0x5e8457;}return null;})['then'](respondWithResult(_0x2115bb,null))[_0xf8cd('0x26')](handleError(_0x2115bb,null));};exports[_0xf8cd('0x28')]=function(_0x115273,_0x4558d4,_0x14795a){if(_0x115273[_0xf8cd('0x57')]['id']){delete _0x115273['body']['id'];}var _0x2cbf0d;return db[_0xf8cd('0x4e')][_0xf8cd('0x55')]({'where':{'id':_0x115273[_0xf8cd('0x53')]['id']}})['then'](handleEntityNotFound(_0x4558d4,null))[_0xf8cd('0x1e')](function(_0x34aaa0){if(_0x34aaa0){_0x2cbf0d=_0x34aaa0;return db['WhatsappAccount'][_0xf8cd('0x55')]({'where':{'id':_0x34aaa0[_0xf8cd('0x83')]}});}})[_0xf8cd('0x1e')](handleEntityNotFound(_0x4558d4,null))[_0xf8cd('0x1e')](function(_0x489f00){if(_0x489f00){logger[_0xf8cd('0x84')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0xf8cd('0x85'),_0x489f00[_0xf8cd('0x3b')],util[_0xf8cd('0x86')](_0x115273[_0xf8cd('0x57')],{'showHidden':![],'depth':null}));switch(_0x489f00['type']){case _0xf8cd('0x87'):if(_0x115273[_0xf8cd('0x57')][_0xf8cd('0x88')]&&_0x115273[_0xf8cd('0x57')][_0xf8cd('0x88')]===_0x2cbf0d['messageId']&&_0x115273[_0xf8cd('0x57')][_0xf8cd('0x89')]&&_0x115273[_0xf8cd('0x57')][_0xf8cd('0x89')]===_0xf8cd('0x5c')){return _0x2cbf0d[_0xf8cd('0x33')]({'read':!![]});}else{logger[_0xf8cd('0x24')](_0xf8cd('0x8a'),_0xf8cd('0x28'),_0xf8cd('0x87'),util[_0xf8cd('0x86')](_0x115273['body'],{'showHidden':![],'depth':null}));}break;}return _0x2cbf0d;}})[_0xf8cd('0x1e')](respondWithResult(_0x4558d4,null))['catch'](handleError(_0x4558d4,null));};
\ No newline at end of file
index eb9d42b..64468bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x2bfd4b,_0x18a9ee){var _0x7baaf9=function(_0x526e83){while(--_0x526e83){_0x2bfd4b['push'](_0x2bfd4b['shift']());}};_0x7baaf9(++_0x18a9ee);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb9a7[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7b9a('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b9a('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1396ec){return function(_0x40ef7d,_0x37b25b,_0x24cae3){WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec+':'+_0x40ef7d['id'],_0x40ef7d);WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec,_0x40ef7d);_0x24cae3(null);};}for(var e in events){if(events[_0x7b9a('0x3')](e)){var event=events[e];WhatsappMessage[_0x7b9a('0x4')](e,emitEvent(event));}}module[_0x7b9a('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x541a99,_0x46f6fa){var _0x2d17ff=function(_0x2d4574){while(--_0x2d4574){_0x541a99['push'](_0x541a99['shift']());}};_0x2d17ff(++_0x46f6fa);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xdd1f52,_0x227e9e){_0xdd1f52=_0xdd1f52-0x0;var _0x368782=_0xbdb7[_0xdd1f52];return _0x368782;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var WhatsappMessage=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){WhatsappMessageEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);WhatsappMessageEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];WhatsappMessage[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index 3a593fd..8f4f2de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb84=['statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','findOne','WhatsappInteractionId','update','createdAt','catch','out','WhatsappAccount','type','twilio','accountSid','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','POST','Bearer\x20'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xeb84,0x194));var _0x4eb8=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xeb84[_0x450bf9];return _0x268350;};'use strict';var _=require(_0x4eb8('0x0'));var util=require(_0x4eb8('0x1'));var logger=require(_0x4eb8('0x2'))(_0x4eb8('0x3'));var moment=require('moment');var BPromise=require(_0x4eb8('0x4'));var rp=require(_0x4eb8('0x5'));var fetch=require(_0x4eb8('0x6'));var fs=require('fs');var path=require(_0x4eb8('0x7'));var rimraf=require(_0x4eb8('0x8'));var config=require(_0x4eb8('0x9'));var attributes=require(_0x4eb8('0xa'));module['exports']=function(_0x74d87,_0x10129d){return _0x74d87[_0x4eb8('0xb')]('WhatsappMessage',attributes,{'tableName':_0x4eb8('0xc'),'paranoid':![],'indexes':[{'name':_0x4eb8('0xd'),'fields':['messageId']},{'name':_0x4eb8('0xe'),'fields':[_0x4eb8('0xf')],'type':_0x4eb8('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x462369,_0x572108,_0x4d7118){var _0x570ff3=_0x74d87[_0x4eb8('0x11')];var _0x4bff75=_0x462369[_0x4eb8('0x12')]({'plain':!![]});if(_0x4bff75[_0x4eb8('0x13')][_0x4eb8('0x14')]()==='in'||_0x4bff75[_0x4eb8('0x13')][_0x4eb8('0x14')]()==='out'&&!_0x4bff75['secret']&&!_[_0x4eb8('0x15')](_0x4bff75['UserId'])){_0x570ff3['WhatsappInteraction'][_0x4eb8('0x16')]({'where':{'id':_0x4bff75[_0x4eb8('0x17')]}})['then'](function(_0x27746b){if(_0x27746b){_0x27746b[_0x4eb8('0x18')]({'lastMsgAt':_0x4bff75[_0x4eb8('0x19')],'lastMsgDirection':_0x4bff75['direction'][_0x4eb8('0x14')]()});}})[_0x4eb8('0x1a')](function(_0x22e0ef){console['error'](_0x22e0ef);});}if(_0x4bff75[_0x4eb8('0x13')]===_0x4eb8('0x1b')&&!_0x4bff75['secret']){var _0x27de4a;_0x570ff3[_0x4eb8('0x1c')]['find']({'where':{'id':_0x4bff75['WhatsappAccountId']},'raw':!![]})['then'](function(_0x346e0b){_0x27de4a=_0x346e0b;if(_0x27de4a&&_0x27de4a[_0x4eb8('0x1d')]){switch(_0x27de4a[_0x4eb8('0x1d')]){case _0x4eb8('0x1e'):var _0x15c290=require(_0x4eb8('0x1e'));if(_0x27de4a[_0x4eb8('0x1f')]&&_0x27de4a['authToken']&&_0x27de4a[_0x4eb8('0x20')]){var _0x178991=new _0x15c290(_0x27de4a[_0x4eb8('0x1f')],_0x27de4a[_0x4eb8('0x21')]);_0x178991[_0x4eb8('0x22')]['create']({'body':_0x4bff75[_0x4eb8('0xf')],'to':_0x4eb8('0x23')+_0x4bff75[_0x4eb8('0x20')],'from':'whatsapp:'+_0x27de4a[_0x4eb8('0x20')],'statusCallback':_0x27de4a[_0x4eb8('0x24')]+_0x4eb8('0x25')+_0x4bff75['id']+_0x4eb8('0x26')+_0x27de4a[_0x4eb8('0x27')]})[_0x4eb8('0x28')](function(_0x13bb57){if(_0x13bb57['sid']){return _0x462369[_0x4eb8('0x18')]({'messageId':_0x13bb57[_0x4eb8('0x29')]});}})[_0x4eb8('0x1a')](function(_0x567b4a){logger[_0x4eb8('0x2a')](_0x4eb8('0x2b'),_0x4eb8('0x2c'),_0x4eb8('0x1e'),util[_0x4eb8('0x2d')](_0x567b4a,{'showHidden':![],'depth':null}));});}else{logger[_0x4eb8('0x2a')](_0x4eb8('0x2b'),_0x4eb8('0x2c'),_0x4eb8('0x1e'),_0x4eb8('0x2e'));}break;case _0x4eb8('0x2f'):var _0x2e8729=_0x27de4a[_0x4eb8('0x1f')];var _0x5f1639=_0x27de4a['authToken'];var _0x12b414=_0x27de4a['baseUrl']+_0x4eb8('0x30')+_0x2e8729+_0x4eb8('0x31');var _0x52539b={'to':[_0x4bff75[_0x4eb8('0x20')]],'message':{'type':'text','text':_0x4bff75[_0x4eb8('0xf')]}};var _0x574426={'method':_0x4eb8('0x32'),'uri':_0x12b414,'headers':{'Authorization':_0x4eb8('0x33')+_0x5f1639,'Content-Type':'application/json'},'body':_0x52539b,'json':!![]};rp(_0x574426)[_0x4eb8('0x28')](function(_0x23af39){if(_0x23af39[_0x4eb8('0x34')][0x0][_0x4eb8('0x35')]){return _0x462369[_0x4eb8('0x18')]({'messageId':_0x23af39[_0x4eb8('0x34')][0x0][_0x4eb8('0x35')]});}})[_0x4eb8('0x1a')](function(_0x47a726){logger[_0x4eb8('0x36')]('WhatsappMessage,\x20%s',_0x47a726);});break;}}})[_0x4eb8('0x37')](function(){_0x4d7118();});}else{_0x4d7118();}}},'charset':'utf8mb4','collate':_0x4eb8('0x38')});};
\ No newline at end of file
+var _0x7118=['define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','out','WhatsappAccount','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','inspect','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes'];(function(_0x786b3a,_0x2e231a){var _0x1d6f58=function(_0x4d6d49){while(--_0x4d6d49){_0x786b3a['push'](_0x786b3a['shift']());}};_0x1d6f58(++_0x2e231a);}(_0x7118,0x159));var _0x8711=function(_0x2c93e9,_0x316571){_0x2c93e9=_0x2c93e9-0x0;var _0x10b953=_0x7118[_0x2c93e9];return _0x10b953;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fetch=require(_0x8711('0x4'));var fs=require('fs');var path=require(_0x8711('0x5'));var rimraf=require(_0x8711('0x6'));var config=require(_0x8711('0x7'));var attributes=require(_0x8711('0x8'));module['exports']=function(_0x385033,_0x2244c2){return _0x385033[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[{'name':_0x8711('0xc'),'fields':[_0x8711('0xc')]},{'name':_0x8711('0xd'),'fields':[_0x8711('0xe')],'type':_0x8711('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cc68b,_0x4f74ae,_0x52f3e9){var _0x2892a2=_0x385033[_0x8711('0x10')];var _0x13a6a5=_0x1cc68b['get']({'plain':!![]});if(_0x13a6a5['direction'][_0x8711('0x11')]()==='in'||_0x13a6a5[_0x8711('0x12')]['toLowerCase']()==='out'&&!_0x13a6a5[_0x8711('0x13')]&&!_[_0x8711('0x14')](_0x13a6a5[_0x8711('0x15')])){_0x2892a2[_0x8711('0x16')][_0x8711('0x17')]({'where':{'id':_0x13a6a5[_0x8711('0x18')]}})[_0x8711('0x19')](function(_0x4a2330){if(_0x4a2330){_0x4a2330[_0x8711('0x1a')]({'lastMsgAt':_0x13a6a5[_0x8711('0x1b')],'lastMsgDirection':_0x13a6a5[_0x8711('0x12')][_0x8711('0x11')]()});}})[_0x8711('0x1c')](function(_0x4628e9){console['error'](_0x4628e9);});}if(_0x13a6a5[_0x8711('0x12')]===_0x8711('0x1d')&&!_0x13a6a5[_0x8711('0x13')]){var _0xe1e9b3;_0x2892a2[_0x8711('0x1e')]['find']({'where':{'id':_0x13a6a5['WhatsappAccountId']},'raw':!![]})['then'](function(_0x26dfb0){_0xe1e9b3=_0x26dfb0;if(_0xe1e9b3&&_0xe1e9b3[_0x8711('0x1f')]){switch(_0xe1e9b3[_0x8711('0x1f')]){case'twilio':var _0x5042e1=require(_0x8711('0x20'));if(_0xe1e9b3[_0x8711('0x21')]&&_0xe1e9b3[_0x8711('0x22')]&&_0xe1e9b3[_0x8711('0x23')]){var _0x23d977=new _0x5042e1(_0xe1e9b3[_0x8711('0x21')],_0xe1e9b3[_0x8711('0x22')]);_0x23d977[_0x8711('0x24')][_0x8711('0x25')]({'body':_0x13a6a5[_0x8711('0xe')],'to':'whatsapp:'+_0x13a6a5[_0x8711('0x23')],'from':_0x8711('0x26')+_0xe1e9b3[_0x8711('0x23')],'statusCallback':_0xe1e9b3[_0x8711('0x27')]+'/api/whatsapp/messages/'+_0x13a6a5['id']+_0x8711('0x28')+_0xe1e9b3[_0x8711('0x29')]})[_0x8711('0x19')](function(_0x5ab925){if(_0x5ab925[_0x8711('0x2a')]){return _0x1cc68b[_0x8711('0x1a')]({'messageId':_0x5ab925[_0x8711('0x2a')]});}})[_0x8711('0x1c')](function(_0x3f937b){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8711('0x20'),util[_0x8711('0x2b')](_0x3f937b,{'showHidden':![],'depth':null}));});}else{logger[_0x8711('0x2c')](_0x8711('0x2d'),_0x8711('0x2e'),_0x8711('0x20'),_0x8711('0x2f'));}break;case _0x8711('0x30'):var _0x398097=_0xe1e9b3['accountSid'];var _0x27db5d=_0xe1e9b3['authToken'];var _0x28c2d5=_0xe1e9b3[_0x8711('0x31')]+_0x8711('0x32')+_0x398097+'/messages/';var _0x440bc8={'to':[_0x13a6a5['phone']],'message':{'type':_0x8711('0x33'),'text':_0x13a6a5[_0x8711('0xe')]}};var _0x230376={'method':'POST','uri':_0x28c2d5,'headers':{'Authorization':'Bearer\x20'+_0x27db5d,'Content-Type':_0x8711('0x34')},'body':_0x440bc8,'json':!![]};rp(_0x230376)[_0x8711('0x19')](function(_0x35af69){if(_0x35af69[_0x8711('0x35')][0x0][_0x8711('0x36')]){return _0x1cc68b[_0x8711('0x1a')]({'messageId':_0x35af69[_0x8711('0x35')][0x0][_0x8711('0x36')]});}})[_0x8711('0x1c')](function(_0x36f3bd){logger['err'](_0x8711('0x37'),_0x36f3bd);});break;}}})[_0x8711('0x38')](function(){_0x52f3e9();});}else{_0x52f3e9();}}},'charset':_0x8711('0x39'),'collate':_0x8711('0x3a')});};
\ No newline at end of file
index 99c7385..d09e033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1250=['message','result','catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','request\x20sent','debug','stringify','code','error','WhatsappMessage,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1250,0xcf));var _0x0125=function(_0x2413fe,_0x5542fe){_0x2413fe=_0x2413fe-0x0;var _0x5b2b90=_0x1250[_0x2413fe];return _0x5b2b90;};'use strict';var _=require(_0x0125('0x0'));var util=require(_0x0125('0x1'));var moment=require('moment');var BPromise=require(_0x0125('0x2'));var rs=require(_0x0125('0x3'));var fs=require('fs');var Redis=require(_0x0125('0x4'));var db=require(_0x0125('0x5'))['db'];var utils=require(_0x0125('0x6'));var logger=require(_0x0125('0x7'))('rpc');var config=require(_0x0125('0x8'));var jayson=require(_0x0125('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x0125('0xa')]=_[_0x0125('0xb')](config['redis'],{'host':_0x0125('0xc'),'port':0x18eb});var socket=require(_0x0125('0xd'))(new Redis(config[_0x0125('0xa')]));require(_0x0125('0xe'))[_0x0125('0xf')](socket);function respondWithRpcPromise(_0x2f9dcf,_0x4d32f2,_0x5cdb1a){return new BPromise(function(_0x59b4c3,_0x10861e){return client['request'](_0x2f9dcf,_0x5cdb1a)[_0x0125('0x10')](function(_0x2a3240){logger[_0x0125('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x4d32f2,_0x0125('0x12'));logger[_0x0125('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4d32f2,_0x0125('0x12'),JSON[_0x0125('0x14')](_0x2a3240));if(_0x2a3240['error']){if(_0x2a3240['error'][_0x0125('0x15')]===0x1f4){logger[_0x0125('0x16')](_0x0125('0x17'),_0x4d32f2,_0x2a3240['error'][_0x0125('0x18')]);return _0x10861e(_0x2a3240['error'][_0x0125('0x18')]);}logger['error'](_0x0125('0x17'),_0x4d32f2,_0x2a3240['error'][_0x0125('0x18')]);return _0x59b4c3(_0x2a3240[_0x0125('0x16')][_0x0125('0x18')]);}else{logger['info'](_0x0125('0x17'),_0x4d32f2,_0x0125('0x12'));_0x59b4c3(_0x2a3240[_0x0125('0x19')][_0x0125('0x18')]);}})[_0x0125('0x1a')](function(_0x257f36){logger[_0x0125('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4d32f2,_0x257f36);_0x10861e(_0x257f36);});});}exports['CreateWhatsappMessage']=function(_0x4dbd89){var _0x2dae83=this;return new Promise(function(_0x1b41b6,_0x1be1f9){return db[_0x0125('0x1b')][_0x0125('0x1c')](_0x4dbd89[_0x0125('0x1d')],{'raw':_0x4dbd89[_0x0125('0x1e')]?_0x4dbd89[_0x0125('0x1e')][_0x0125('0x1f')]===undefined?!![]:![]:!![]})[_0x0125('0x10')](function(_0x419e5e){logger[_0x0125('0x11')](_0x0125('0x20'),_0x4dbd89);logger[_0x0125('0x13')]('CreateWhatsappMessage',_0x4dbd89,JSON['stringify'](_0x419e5e));_0x1b41b6(_0x419e5e);})[_0x0125('0x1a')](function(_0x178628){logger[_0x0125('0x16')](_0x0125('0x20'),_0x178628['message'],_0x4dbd89);_0x1be1f9(_0x2dae83[_0x0125('0x16')](0x1f4,_0x178628[_0x0125('0x18')]));});});};
\ No newline at end of file
+var _0x21c4=['then','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','info','catch','CreateWhatsappMessage','create','body','options','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request'];(function(_0x5dd6c9,_0x46f807){var _0xc748e=function(_0x3fa3c1){while(--_0x3fa3c1){_0x5dd6c9['push'](_0x5dd6c9['shift']());}};_0xc748e(++_0x46f807);}(_0x21c4,0xcf));var _0x421c=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0x21c4[_0xef4fc0];return _0x57dade;};'use strict';var _=require(_0x421c('0x0'));var util=require('util');var moment=require(_0x421c('0x1'));var BPromise=require(_0x421c('0x2'));var rs=require(_0x421c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x421c('0x4'));var logger=require(_0x421c('0x5'))(_0x421c('0x6'));var config=require(_0x421c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x421c('0x8')][_0x421c('0x9')]({'port':0x232a});config[_0x421c('0xa')]=_[_0x421c('0xb')](config[_0x421c('0xa')],{'host':_0x421c('0xc'),'port':0x18eb});var socket=require(_0x421c('0xd'))(new Redis(config[_0x421c('0xa')]));require(_0x421c('0xe'))[_0x421c('0xf')](socket);function respondWithRpcPromise(_0x497f11,_0x42f475,_0xe9c09a){return new BPromise(function(_0x3e0b4e,_0x3c69d9){return client[_0x421c('0x10')](_0x497f11,_0xe9c09a)[_0x421c('0x11')](function(_0x76d5d3){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x42f475,'request\x20sent');logger[_0x421c('0x12')](_0x421c('0x13'),_0x42f475,_0x421c('0x14'),JSON[_0x421c('0x15')](_0x76d5d3));if(_0x76d5d3['error']){if(_0x76d5d3[_0x421c('0x16')][_0x421c('0x17')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x42f475,_0x76d5d3['error']['message']);return _0x3c69d9(_0x76d5d3[_0x421c('0x16')][_0x421c('0x18')]);}logger[_0x421c('0x16')](_0x421c('0x19'),_0x42f475,_0x76d5d3[_0x421c('0x16')][_0x421c('0x18')]);return _0x3e0b4e(_0x76d5d3['error'][_0x421c('0x18')]);}else{logger[_0x421c('0x1a')](_0x421c('0x19'),_0x42f475,_0x421c('0x14'));_0x3e0b4e(_0x76d5d3['result']['message']);}})[_0x421c('0x1b')](function(_0x16e401){logger[_0x421c('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x42f475,_0x16e401);_0x3c69d9(_0x16e401);});});}exports[_0x421c('0x1c')]=function(_0xcd8d2c){var _0xae7665=this;return new Promise(function(_0x23867f,_0x39cde9){return db['WhatsappMessage'][_0x421c('0x1d')](_0xcd8d2c[_0x421c('0x1e')],{'raw':_0xcd8d2c[_0x421c('0x1f')]?_0xcd8d2c['options']['raw']===undefined?!![]:![]:!![]})[_0x421c('0x11')](function(_0x4ceb6f){logger[_0x421c('0x1a')](_0x421c('0x1c'),_0xcd8d2c);logger['debug'](_0x421c('0x1c'),_0xcd8d2c,JSON['stringify'](_0x4ceb6f));_0x23867f(_0x4ceb6f);})[_0x421c('0x1b')](function(_0x3171ba){logger[_0x421c('0x16')]('CreateWhatsappMessage',_0x3171ba[_0x421c('0x18')],_0xcd8d2c);_0x39cde9(_0xae7665[_0x421c('0x16')](0x1f4,_0x3171ba['message']));});});};
\ No newline at end of file
index 06990be..ab8621e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd06a=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd06a,0x130));var _0xad06=function(_0xbf15d3,_0x27015a){_0xbf15d3=_0xbf15d3-0x0;var _0x2afc1f=_0xd06a[_0xbf15d3];return _0x2afc1f;};'use strict';var WhatsappMessageEvents=require(_0xad06('0x0'));var events=[_0xad06('0x1'),'remove','update'];function createListener(_0x5297a2,_0x17737c){return function(_0x5b6a7a){_0x17737c['emit'](_0x5297a2,_0x5b6a7a);};}function removeListener(_0x595de2,_0x8899f7){return function(){WhatsappMessageEvents[_0xad06('0x2')](_0x595de2,_0x8899f7);};}exports[_0xad06('0x3')]=function(_0x4a12ec){for(var _0x19eafb=0x0,_0x39d996=events[_0xad06('0x4')];_0x19eafb<_0x39d996;_0x19eafb++){var _0x3fe5de=events[_0x19eafb];var _0x21f411=createListener(_0xad06('0x5')+_0x3fe5de,_0x4a12ec);WhatsappMessageEvents['on'](_0x3fe5de,_0x21f411);}};
\ No newline at end of file
+var _0x23fe=['remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x57267d,_0x44976d){var _0x2cab22=function(_0x2dac5e){while(--_0x2dac5e){_0x57267d['push'](_0x57267d['shift']());}};_0x2cab22(++_0x44976d);}(_0x23fe,0xbb));var _0xe23f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x23fe[_0xc4001c];return _0x49f7bc;};'use strict';var WhatsappMessageEvents=require(_0xe23f('0x0'));var events=[_0xe23f('0x1'),_0xe23f('0x2'),_0xe23f('0x3')];function createListener(_0x215067,_0x519be3){return function(_0x469459){_0x519be3[_0xe23f('0x4')](_0x215067,_0x469459);};}function removeListener(_0x43915d,_0x1483ae){return function(){WhatsappMessageEvents[_0xe23f('0x5')](_0x43915d,_0x1483ae);};}exports[_0xe23f('0x6')]=function(_0x33d1c3){for(var _0x114b7b=0x0,_0x1cdf49=events[_0xe23f('0x7')];_0x114b7b<_0x1cdf49;_0x114b7b++){var _0x2a24d0=events[_0x114b7b];var _0x5233c3=createListener(_0xe23f('0x8')+_0x2a24d0,_0x33d1c3);WhatsappMessageEvents['on'](_0x2a24d0,_0x5233c3);}};
\ No newline at end of file
index 6dbd301..20a90c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2b9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x292102,_0x427efa){var _0x54c775=function(_0x27a4b6){while(--_0x27a4b6){_0x292102['push'](_0x292102['shift']());}};_0x54c775(++_0x427efa);}(_0xb2b9,0xea));var _0x9b2b=function(_0x8105e2,_0x2e4324){_0x8105e2=_0x8105e2-0x0;var _0xf19ece=_0xb2b9[_0x8105e2];return _0xf19ece;};'use strict';var multer=require('multer');var util=require(_0x9b2b('0x0'));var path=require(_0x9b2b('0x1'));var timeout=require(_0x9b2b('0x2'));var express=require(_0x9b2b('0x3'));var router=express[_0x9b2b('0x4')]();var fs_extra=require(_0x9b2b('0x5'));var auth=require(_0x9b2b('0x6'));var interaction=require(_0x9b2b('0x7'));var config=require(_0x9b2b('0x8'));var controller=require('./whatsappQueue.controller');router[_0x9b2b('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b2b('0xa')]);router['get'](_0x9b2b('0xb'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0xd')]);router[_0x9b2b('0x9')](_0x9b2b('0xe'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0xf')]);router[_0x9b2b('0x9')]('/:id/members',auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x10')]);router[_0x9b2b('0x9')](_0x9b2b('0x11'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x12')]);router[_0x9b2b('0x9')](_0x9b2b('0x13'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x14')]);router[_0x9b2b('0x15')]('/',auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x16')]);router[_0x9b2b('0x15')]('/:id/teams',auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x17')]);router[_0x9b2b('0x15')](_0x9b2b('0x13'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x18')]);router[_0x9b2b('0x19')](_0x9b2b('0xe'),auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x1a')]);router[_0x9b2b('0x1b')]('/:id',auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x1c')]);router[_0x9b2b('0x1b')]('/:id/teams',auth[_0x9b2b('0xc')](),controller[_0x9b2b('0x1d')]);router[_0x9b2b('0x1b')](_0x9b2b('0x13'),auth[_0x9b2b('0xc')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xdf7c=['addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','getMembers','/:id/teams','getTeams','/:id/users','post','create'];(function(_0x39c12e,_0x585534){var _0x58dbf4=function(_0xd35390){while(--_0xd35390){_0x39c12e['push'](_0x39c12e['shift']());}};_0x58dbf4(++_0x585534);}(_0xdf7c,0x149));var _0xcdf7=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xdf7c[_0x20a558];return _0x53d3f7;};'use strict';var multer=require('multer');var util=require(_0xcdf7('0x0'));var path=require(_0xcdf7('0x1'));var timeout=require(_0xcdf7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcdf7('0x3'));var interaction=require(_0xcdf7('0x4'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xcdf7('0x5')]('/',auth['isAuthenticated'](),controller[_0xcdf7('0x6')]);router['get'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['describe']);router[_0xcdf7('0x5')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller['show']);router[_0xcdf7('0x5')]('/:id/members',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xa')]);router[_0xcdf7('0x5')](_0xcdf7('0xb'),auth['isAuthenticated'](),controller[_0xcdf7('0xc')]);router[_0xcdf7('0x5')](_0xcdf7('0xd'),auth[_0xcdf7('0x8')](),controller['getAgents']);router[_0xcdf7('0xe')]('/',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xf')]);router['post'](_0xcdf7('0xb'),auth[_0xcdf7('0x8')](),controller['addTeams']);router['post'](_0xcdf7('0xd'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0x10')]);router[_0xcdf7('0x11')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller['update']);router[_0xcdf7('0x12')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0x13')]);router[_0xcdf7('0x12')](_0xcdf7('0xb'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0x14')]);router[_0xcdf7('0x12')](_0xcdf7('0xd'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0x15')]);module[_0xcdf7('0x16')]=router;
\ No newline at end of file
index 308cbd0..7a3a4ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb07f=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xb9a2d2,_0x455ce7){var _0x4d279e=function(_0x1a5296){while(--_0x1a5296){_0xb9a2d2['push'](_0xb9a2d2['shift']());}};_0x4d279e(++_0x455ce7);}(_0xb07f,0x109));var _0xfb07=function(_0x378ee1,_0x2786a0){_0x378ee1=_0x378ee1-0x0;var _0xdb7a8e=_0xb07f[_0x378ee1];return _0xdb7a8e;};'use strict';var Sequelize=require(_0xfb07('0x0'));module[_0xfb07('0x1')]={'name':{'type':Sequelize[_0xfb07('0x2')],'unique':_0xfb07('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb07('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb07('0x5')](_0xfb07('0x6'),_0xfb07('0x7'),_0xfb07('0x8'))},'description':{'type':Sequelize[_0xfb07('0x2')]}};
\ No newline at end of file
+var _0x0531=['sequelize','exports','INTEGER','beepall','roundrobin','STRING'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0x0531,0xde));var _0x1053=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x0531[_0xb1cf84];return _0x4bad2e;};'use strict';var Sequelize=require(_0x1053('0x0'));module[_0x1053('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1053('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1053('0x3'),_0x1053('0x4'))},'description':{'type':Sequelize[_0x1053('0x5')]}};
\ No newline at end of file
index 3f80f2a..68edc31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6040=['%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','addAgents','omit','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','rows'];(function(_0xba922d,_0x25425e){var _0x142c2a=function(_0x88af90){while(--_0x88af90){_0xba922d['push'](_0xba922d['shift']());}};_0x142c2a(++_0x25425e);}(_0x6040,0xb3));var _0x0604=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x6040[_0x599e60];return _0x468e19;};'use strict';var emlformat=require(_0x0604('0x0'));var rimraf=require(_0x0604('0x1'));var zipdir=require(_0x0604('0x2'));var jsonpatch=require(_0x0604('0x3'));var rp=require(_0x0604('0x4'));var moment=require(_0x0604('0x5'));var BPromise=require(_0x0604('0x6'));var Mustache=require('mustache');var util=require(_0x0604('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0604('0x8'));var ejs=require(_0x0604('0x9'));var fs=require('fs');var fs_extra=require(_0x0604('0xa'));var _=require(_0x0604('0xb'));var squel=require(_0x0604('0xc'));var crypto=require(_0x0604('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0604('0xe'));var toCsv=require(_0x0604('0x8'));var querystring=require(_0x0604('0xf'));var Papa=require('papaparse');var Redis=require(_0x0604('0x10'));var authService=require(_0x0604('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0604('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0604('0x13'))(_0x0604('0x14'));var utils=require('../../config/utils');var config=require(_0x0604('0x15'));var licenseUtil=require(_0x0604('0x16'));var db=require(_0x0604('0x17'))['db'];config['redis']=_[_0x0604('0x18')](config[_0x0604('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0604('0x1a'))[_0x0604('0x1b')](socket);function respondWithStatusCode(_0x23b8d4,_0x278db6){_0x278db6=_0x278db6||0xcc;return function(_0x389252){if(_0x389252){return _0x23b8d4['sendStatus'](_0x278db6);}return _0x23b8d4[_0x0604('0x1c')](_0x278db6)[_0x0604('0x1d')]();};}function respondWithResult(_0x2a0a6f,_0x5d1504){_0x5d1504=_0x5d1504||0xc8;return function(_0x229a0d){if(_0x229a0d){return _0x2a0a6f['status'](_0x5d1504)[_0x0604('0x1e')](_0x229a0d);}};}function respondWithFilteredResult(_0x3e66fd,_0x11a7fa){return function(_0x16182d){if(_0x16182d){var _0x5b62dd=typeof _0x11a7fa[_0x0604('0x1f')]===_0x0604('0x20')&&typeof _0x11a7fa[_0x0604('0x21')]==='undefined';var _0x240c76=_0x16182d[_0x0604('0x22')];var _0x3ac5be=_0x5b62dd?0x0:_0x11a7fa[_0x0604('0x1f')];var _0x59386a=_0x5b62dd?_0x16182d[_0x0604('0x22')]:_0x11a7fa['offset']+_0x11a7fa[_0x0604('0x21')];var _0x44ab30;if(_0x59386a>=_0x240c76){_0x59386a=_0x240c76;_0x44ab30=0xc8;}else{_0x44ab30=0xce;}_0x3e66fd['status'](_0x44ab30);return _0x3e66fd[_0x0604('0x23')](_0x0604('0x24'),_0x3ac5be+'-'+_0x59386a+'/'+_0x240c76)[_0x0604('0x1e')](_0x16182d);}return null;};}function patchUpdates(_0x1795fc){return function(_0x33b53c){try{jsonpatch[_0x0604('0x25')](_0x33b53c,_0x1795fc,!![]);}catch(_0x4a8df2){return BPromise[_0x0604('0x26')](_0x4a8df2);}return _0x33b53c[_0x0604('0x27')]();};}function saveUpdates(_0x3f018c,_0x1691fb){return function(_0x2b2cae){if(_0x2b2cae){return _0x2b2cae[_0x0604('0x28')](_0x3f018c)['then'](function(_0x320d86){return _0x320d86;});}return null;};}function removeEntity(_0x14c489,_0x1596d1){return function(_0x368974){if(_0x368974){return _0x368974[_0x0604('0x29')]()[_0x0604('0x2a')](function(){var _0x33ba51=_0x368974[_0x0604('0x2b')]({'plain':!![]});var _0x2f5e61=_0x0604('0x2c');return db[_0x0604('0x2d')][_0x0604('0x29')]({'where':{'type':_0x2f5e61,'resourceId':_0x33ba51['id']}})[_0x0604('0x2a')](function(){return _0x368974;});})[_0x0604('0x2a')](function(){_0x14c489[_0x0604('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ff1f,_0x223cdb){return function(_0x15cdc7){if(!_0x15cdc7){_0x33ff1f['sendStatus'](0x194);}return _0x15cdc7;};}function handleError(_0x423edf,_0x5a21b9){_0x5a21b9=_0x5a21b9||0x1f4;return function(_0x36a77b){logger[_0x0604('0x2e')](_0x36a77b[_0x0604('0x2f')]);if(_0x36a77b['name']){delete _0x36a77b['name'];}_0x423edf[_0x0604('0x1c')](_0x5a21b9)[_0x0604('0x30')](_0x36a77b);};}exports[_0x0604('0x31')]=function(_0x1b0e10,_0x57d45b){var _0x113717={},_0x2d939d={},_0x15fcb4={'count':0x0,'rows':[]};var _0x376f32=_[_0x0604('0x32')](db[_0x0604('0x33')][_0x0604('0x34')],function(_0x414c64){return{'name':_0x414c64[_0x0604('0x35')],'type':_0x414c64[_0x0604('0x36')]['key']};});_0x2d939d[_0x0604('0x37')]=_[_0x0604('0x32')](_0x376f32,'name');_0x2d939d[_0x0604('0x38')]=_[_0x0604('0x39')](_0x1b0e10[_0x0604('0x38')]);_0x2d939d[_0x0604('0x3a')]=_[_0x0604('0x3b')](_0x2d939d['model'],_0x2d939d[_0x0604('0x38')]);_0x113717[_0x0604('0x3c')]=_[_0x0604('0x3b')](_0x2d939d[_0x0604('0x37')],qs[_0x0604('0x3d')](_0x1b0e10[_0x0604('0x38')]['fields']));_0x113717[_0x0604('0x3c')]=_0x113717[_0x0604('0x3c')][_0x0604('0x3e')]?_0x113717[_0x0604('0x3c')]:_0x2d939d[_0x0604('0x37')];if(!_0x1b0e10[_0x0604('0x38')][_0x0604('0x3f')](_0x0604('0x40'))){_0x113717[_0x0604('0x21')]=qs['limit'](_0x1b0e10['query'][_0x0604('0x21')]);_0x113717[_0x0604('0x1f')]=qs[_0x0604('0x1f')](_0x1b0e10[_0x0604('0x38')]['offset']);}_0x113717[_0x0604('0x41')]=qs[_0x0604('0x42')](_0x1b0e10[_0x0604('0x38')][_0x0604('0x42')]);_0x113717[_0x0604('0x43')]=qs[_0x0604('0x3a')](_[_0x0604('0x44')](_0x1b0e10[_0x0604('0x38')],_0x2d939d[_0x0604('0x3a')]),_0x376f32);if(_0x1b0e10[_0x0604('0x38')][_0x0604('0x45')]){_0x113717[_0x0604('0x43')]=_[_0x0604('0x46')](_0x113717[_0x0604('0x43')],{'$or':_['map'](_0x376f32,function(_0x413c4a){if(_0x413c4a[_0x0604('0x36')]!==_0x0604('0x47')){var _0x12b970={};_0x12b970[_0x413c4a['name']]={'$like':'%'+_0x1b0e10[_0x0604('0x38')][_0x0604('0x45')]+'%'};return _0x12b970;}})});}_0x113717=_[_0x0604('0x46')]({},_0x113717,_0x1b0e10[_0x0604('0x48')]);var _0x1d029d={'where':_0x113717['where']};return db['WhatsappQueue']['count'](_0x1d029d)[_0x0604('0x2a')](function(_0x4b4f17){_0x15fcb4[_0x0604('0x22')]=_0x4b4f17;if(_0x1b0e10[_0x0604('0x38')][_0x0604('0x49')]){_0x113717[_0x0604('0x4a')]=[{'all':!![]}];}return db[_0x0604('0x33')][_0x0604('0x4b')](_0x113717);})['then'](function(_0x5829ea){_0x15fcb4['rows']=_0x5829ea;return _0x15fcb4;})[_0x0604('0x2a')](respondWithFilteredResult(_0x57d45b,_0x113717))[_0x0604('0x4c')](handleError(_0x57d45b,null));};exports['show']=function(_0x639238,_0x550aaf){var _0x117521={'raw':!![],'where':{'id':_0x639238[_0x0604('0x4d')]['id']}},_0x39a7c8={};_0x39a7c8[_0x0604('0x37')]=_[_0x0604('0x39')](db[_0x0604('0x33')][_0x0604('0x34')]);_0x39a7c8[_0x0604('0x38')]=_[_0x0604('0x39')](_0x639238[_0x0604('0x38')]);_0x39a7c8[_0x0604('0x3a')]=_['intersection'](_0x39a7c8['model'],_0x39a7c8[_0x0604('0x38')]);_0x117521[_0x0604('0x3c')]=_[_0x0604('0x3b')](_0x39a7c8[_0x0604('0x37')],qs[_0x0604('0x3d')](_0x639238['query'][_0x0604('0x3d')]));_0x117521[_0x0604('0x3c')]=_0x117521[_0x0604('0x3c')][_0x0604('0x3e')]?_0x117521['attributes']:_0x39a7c8['model'];if(_0x639238['query']['includeAll']){_0x117521['include']=[{'all':!![]}];}_0x117521=_[_0x0604('0x46')]({},_0x117521,_0x639238[_0x0604('0x48')]);return db['WhatsappQueue']['find'](_0x117521)[_0x0604('0x2a')](handleEntityNotFound(_0x550aaf,null))[_0x0604('0x2a')](respondWithResult(_0x550aaf,null))['catch'](handleError(_0x550aaf,null));};exports['create']=function(_0x1bb375,_0x1ee716){return db[_0x0604('0x33')][_0x0604('0x4e')](_0x1bb375[_0x0604('0x4f')],{})[_0x0604('0x2a')](function(_0x375fcd){var _0x2ba110=_0x1bb375[_0x0604('0x50')][_0x0604('0x2b')]({'plain':!![]});if(!_0x2ba110)throw new Error(_0x0604('0x51'));if(_0x2ba110[_0x0604('0x52')]==='user'){var _0x50beda=_0x375fcd[_0x0604('0x2b')]({'plain':!![]});var _0x45a09f=_0x0604('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x45a09f,'userProfileId':_0x2ba110[_0x0604('0x53')]},'raw':!![]})[_0x0604('0x2a')](function(_0x5da74f){if(_0x5da74f&&_0x5da74f['autoAssociation']===0x0){return db[_0x0604('0x2d')][_0x0604('0x4e')]({'name':_0x50beda[_0x0604('0x54')],'resourceId':_0x50beda['id'],'type':_0x5da74f[_0x0604('0x54')],'sectionId':_0x5da74f['id']},{})[_0x0604('0x2a')](function(){return _0x375fcd;});}else{return _0x375fcd;}})['catch'](function(_0x603572){logger[_0x0604('0x2e')](_0x0604('0x55'),_0x603572);throw _0x603572;});}return _0x375fcd;})[_0x0604('0x2a')](respondWithResult(_0x1ee716,0xc9))[_0x0604('0x4c')](handleError(_0x1ee716,null));};exports[_0x0604('0x28')]=function(_0x1a8ddf,_0x17692d){if(_0x1a8ddf[_0x0604('0x4f')]['id']){delete _0x1a8ddf[_0x0604('0x4f')]['id'];}return db[_0x0604('0x33')][_0x0604('0x56')]({'where':{'id':_0x1a8ddf['params']['id']}})[_0x0604('0x2a')](handleEntityNotFound(_0x17692d,null))[_0x0604('0x2a')](saveUpdates(_0x1a8ddf[_0x0604('0x4f')],null))[_0x0604('0x2a')](respondWithResult(_0x17692d,null))[_0x0604('0x4c')](handleError(_0x17692d,null));};exports[_0x0604('0x29')]=function(_0x55eb6e,_0x47d61b){return db['WhatsappQueue'][_0x0604('0x56')]({'where':{'id':_0x55eb6e['params']['id']}})['then'](handleEntityNotFound(_0x47d61b,null))[_0x0604('0x2a')](removeEntity(_0x47d61b,null))[_0x0604('0x4c')](handleError(_0x47d61b,null));};exports[_0x0604('0x57')]=function(_0x3069af,_0x5787c5){return db[_0x0604('0x33')][_0x0604('0x57')]()[_0x0604('0x2a')](respondWithResult(_0x5787c5,null))['catch'](handleError(_0x5787c5,null));};exports[_0x0604('0x58')]=function(_0x3f6727,_0x2b5f64,_0x3d9c4a){var _0x44d0cf={'raw':!![],'where':{}},_0x18d006={},_0x3005f1;return db['WhatsappQueue'][_0x0604('0x59')]({'where':{'id':_0x3f6727[_0x0604('0x4d')]['id']}})[_0x0604('0x2a')](handleEntityNotFound(_0x2b5f64,null))[_0x0604('0x2a')](function(_0x25346e){if(_0x25346e){_0x3005f1=_0x25346e[_0x0604('0x2b')]({'plain':!![]});_0x18d006[_0x0604('0x37')]=_[_0x0604('0x39')](db[_0x0604('0x5a')][_0x0604('0x34')]);_0x18d006[_0x0604('0x38')]=_[_0x0604('0x39')](_0x3f6727['query']);_0x18d006[_0x0604('0x3a')]=_[_0x0604('0x3b')](_0x18d006['model'],_0x18d006['query']);_0x44d0cf[_0x0604('0x3c')]=_[_0x0604('0x3b')](_0x18d006[_0x0604('0x37')],qs[_0x0604('0x3d')](_0x3f6727[_0x0604('0x38')]['fields']));_0x44d0cf[_0x0604('0x3c')]=_0x44d0cf[_0x0604('0x3c')][_0x0604('0x3e')]?_0x44d0cf[_0x0604('0x3c')]:_0x18d006[_0x0604('0x37')];if(!_0x3f6727[_0x0604('0x38')]['hasOwnProperty']('nolimit')){_0x44d0cf[_0x0604('0x21')]=qs[_0x0604('0x21')](_0x3f6727[_0x0604('0x38')][_0x0604('0x21')]);_0x44d0cf[_0x0604('0x1f')]=qs[_0x0604('0x1f')](_0x3f6727[_0x0604('0x38')][_0x0604('0x1f')]);}_0x44d0cf[_0x0604('0x41')]=qs[_0x0604('0x42')](_0x3f6727[_0x0604('0x38')][_0x0604('0x42')]);_0x44d0cf[_0x0604('0x43')]=qs[_0x0604('0x3a')](_[_0x0604('0x44')](_0x3f6727[_0x0604('0x38')],_0x18d006[_0x0604('0x3a')]));_0x44d0cf[_0x0604('0x43')][_0x0604('0x5b')]=_0x25346e['id'];if(_0x3f6727[_0x0604('0x38')][_0x0604('0x45')]){_0x44d0cf[_0x0604('0x43')]=_[_0x0604('0x46')](_0x44d0cf[_0x0604('0x43')],{'$or':_[_0x0604('0x32')](_0x44d0cf['attributes'],function(_0x3fc443){var _0x129531={};_0x129531[_0x3fc443]={'$like':'%'+_0x3f6727[_0x0604('0x38')]['filter']+'%'};return _0x129531;})});}_0x44d0cf=_['merge']({},_0x44d0cf,_0x3f6727[_0x0604('0x48')]);return db[_0x0604('0x5a')]['findAll'](_0x44d0cf);}})[_0x0604('0x2a')](function(_0x4b4e93){if(_0x4b4e93){return db[_0x0604('0x5c')][_0x0604('0x5d')]({'where':{'id':_[_0x0604('0x32')](_0x4b4e93,_0x0604('0x5e')),'role':'agent'},'attributes':['id',_0x0604('0x54'),_0x0604('0x5f'),_0x0604('0x60'),_0x0604('0x61')]});}})[_0x0604('0x2a')](function(_0x25810c){if(_0x25810c){return{'count':_0x25810c[_0x0604('0x22')],'rows':_[_0x0604('0x32')](_0x25810c[_0x0604('0x62')],function(_0x489c9f){return{'membername':_0x489c9f[_0x0604('0x54')],'UserId':_0x489c9f['id'],'queue_name':_0x3005f1[_0x0604('0x54')],'WhatsappQueueId':_0x3005f1['id'],'interface':util['format'](_0x0604('0x63'),_0x0604('0x64'),_0x489c9f[_0x0604('0x54')]),'penalty':0x0,'paused':_0x489c9f[_0x0604('0x5f')],'createdAt':_0x489c9f[_0x0604('0x61')],'updatedAt':_0x489c9f[_0x0604('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0604('0x2a')](respondWithFilteredResult(_0x2b5f64,_0x44d0cf))[_0x0604('0x4c')](handleError(_0x2b5f64,null));};exports[_0x0604('0x65')]=function(_0x57af5e,_0x3eb929,_0x33cd6b){var _0x2b08ed={};var _0x4ba572={};var _0x224241;var _0x52f0a7;return db['WhatsappQueue'][_0x0604('0x59')]({'where':{'id':_0x57af5e[_0x0604('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3eb929,null))[_0x0604('0x2a')](function(_0x25ba95){if(_0x25ba95){_0x224241=_0x25ba95;_0x4ba572['model']=_[_0x0604('0x39')](db[_0x0604('0x66')]['rawAttributes']);_0x4ba572['query']=_[_0x0604('0x39')](_0x57af5e[_0x0604('0x38')]);_0x4ba572[_0x0604('0x3a')]=_[_0x0604('0x3b')](_0x4ba572[_0x0604('0x37')],_0x4ba572[_0x0604('0x38')]);_0x2b08ed[_0x0604('0x3c')]=_[_0x0604('0x3b')](_0x4ba572[_0x0604('0x37')],qs[_0x0604('0x3d')](_0x57af5e[_0x0604('0x38')][_0x0604('0x3d')]));_0x2b08ed[_0x0604('0x3c')]=_0x2b08ed['attributes'][_0x0604('0x3e')]?_0x2b08ed[_0x0604('0x3c')]:_0x4ba572['model'];_0x2b08ed[_0x0604('0x41')]=qs[_0x0604('0x42')](_0x57af5e['query'][_0x0604('0x42')]);_0x2b08ed[_0x0604('0x43')]=qs[_0x0604('0x3a')](_['pick'](_0x57af5e[_0x0604('0x38')],_0x4ba572[_0x0604('0x3a')]));if(_0x57af5e[_0x0604('0x38')][_0x0604('0x45')]){_0x2b08ed[_0x0604('0x43')]=_['merge'](_0x2b08ed[_0x0604('0x43')],{'$or':_[_0x0604('0x32')](_0x2b08ed[_0x0604('0x3c')],function(_0x27d855){var _0x3c7a28={};_0x3c7a28[_0x27d855]={'$like':'%'+_0x57af5e[_0x0604('0x38')][_0x0604('0x45')]+'%'};return _0x3c7a28;})});}_0x2b08ed=_[_0x0604('0x46')]({},_0x2b08ed,_0x57af5e[_0x0604('0x48')]);return _0x224241[_0x0604('0x65')](_0x2b08ed);}})[_0x0604('0x2a')](function(_0x3eb661){if(_0x3eb661){_0x52f0a7=_0x3eb661[_0x0604('0x3e')];if(!_0x57af5e['query'][_0x0604('0x3f')](_0x0604('0x40'))){_0x2b08ed[_0x0604('0x21')]=qs[_0x0604('0x21')](_0x57af5e[_0x0604('0x38')][_0x0604('0x21')]);_0x2b08ed[_0x0604('0x1f')]=qs[_0x0604('0x1f')](_0x57af5e[_0x0604('0x38')][_0x0604('0x1f')]);}return _0x224241[_0x0604('0x65')](_0x2b08ed);}})[_0x0604('0x2a')](function(_0x4b3f1a){if(_0x4b3f1a){return _0x4b3f1a?{'count':_0x52f0a7,'rows':_0x4b3f1a}:null;}})[_0x0604('0x2a')](respondWithResult(_0x3eb929,null))['catch'](handleError(_0x3eb929,null));};exports[_0x0604('0x67')]=function(_0x5aa2d2,_0x1e1865,_0x42aeda){var _0x4f8a2c=_0x5aa2d2[_0x0604('0x4f')][_0x0604('0x68')];return db[_0x0604('0x66')]['findAll']({'where':{'id':_0x4f8a2c},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x0604('0x54'),'online',_0x0604('0x69'),'interface'],'raw':!![]}]})[_0x0604('0x2a')](function(_0x2e0ac0){if(_0x2e0ac0){var _0x536be7=_[_0x0604('0x6a')](_0x2e0ac0,function(_0x56da08){var _0x1181b3=_0x56da08[_0x0604('0x2b')]({'plain':!![]});return _0x1181b3[_0x0604('0x6b')];});return db[_0x0604('0x33')]['find']({'where':{'id':_0x5aa2d2[_0x0604('0x4d')]['id']}})[_0x0604('0x2a')](function(_0x288a8b){return db[_0x0604('0x6c')][_0x0604('0x6d')](function(_0x171a50){return _0x288a8b[_0x0604('0x67')](_0x4f8a2c,{'transaction':_0x171a50})[_0x0604('0x2a')](function(){return BPromise[_0x0604('0x6e')](_0x536be7,function(_0x4f36ab){return db[_0x0604('0x5a')]['findOrCreate']({'where':{'UserId':_0x4f36ab['id'],'WhatsappQueueId':_0x5aa2d2[_0x0604('0x4d')]['id']},'transaction':_0x171a50});});})[_0x0604('0x2a')](function(){_0x536be7[_0x0604('0x6f')](function(_0x201f05){socket[_0x0604('0x70')](_0x0604('0x71'),{'UserId':_0x201f05['id'],'WhatsappQueueId':_0x288a8b['id']});});});});});}})['then'](respondWithStatusCode(_0x1e1865,null))[_0x0604('0x4c')](handleError(_0x1e1865,null));};exports['removeTeams']=function(_0x408773,_0x8cfed1,_0x5de466){return db['Team']['findAll']({'where':{'id':_0x408773['query'][_0x0604('0x68')]},'attributes':['id'],'include':[{'model':db[_0x0604('0x5c')],'as':_0x0604('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x8cfed1,null))[_0x0604('0x2a')](function(_0x1991af){var _0x271b74=_[_0x0604('0x32')](_0x1991af,'id');var _0x54fa73=[];var _0x405b99=[];var _0x296cdf=squel[_0x0604('0x72')]();_0x296cdf[_0x0604('0x73')](_0x0604('0x74'))[_0x0604('0x75')](_0x0604('0x76'),'tq')['join'](_0x0604('0x77'),'ut',_0x0604('0x78'))[_0x0604('0x43')](_0x0604('0x79'),_0x408773[_0x0604('0x4d')]['id']);for(var _0x5e8528=0x0;_0x5e8528<_0x1991af['length'];_0x5e8528+=0x1){let _0x59953b=_0x1991af[_0x5e8528];for(var _0x2761ee=0x0;_0x2761ee<_0x59953b['Agents']['length'];_0x2761ee+=0x1){let _0x37691e=_0x59953b[_0x0604('0x6b')][_0x2761ee];var _0x211259=_0x296cdf[_0x0604('0x7a')]();_0x211259['where']('ut.UserId\x20=\x20?',_0x37691e['id']);_0x405b99['push'](db[_0x0604('0x6c')][_0x0604('0x38')](_0x211259[_0x0604('0x7b')](),{'type':db[_0x0604('0x6c')][_0x0604('0x7c')][_0x0604('0x7d')]})[_0x0604('0x2a')](function(_0x1d5c6b){if(_0x1d5c6b['length']===0x1){return _0x37691e['id'];}else{var _0x4e3434=_['every'](_[_0x0604('0x32')](_0x1d5c6b,_0x0604('0x7e')),function(_0x341030){return _[_0x0604('0x7f')](_0x271b74,_0x341030);});if(_0x4e3434){return _0x37691e['id'];}}}));}}return BPromise[_0x0604('0x80')](_0x405b99)[_0x0604('0x2a')](function(_0xc309f3){_0x54fa73=_(_0x54fa73)[_0x0604('0x81')](_0xc309f3)[_0x0604('0x82')]()[_0x0604('0x83')]();return db[_0x0604('0x33')][_0x0604('0x56')]({'where':{'id':_0x408773[_0x0604('0x4d')]['id']}})['then'](function(_0x5ba947){return db['sequelize'][_0x0604('0x6d')](function(_0xe7fa52){return _0x5ba947['removeTeams'](_0x408773[_0x0604('0x38')]['ids'],{'transaction':_0xe7fa52})['then'](function(){if(!_['isEmpty'](_0x54fa73)){return _0x5ba947['removeAgents'](_0x54fa73,{'transaction':_0xe7fa52});}})['then'](function(){_0x54fa73['forEach'](function(_0x3c7b74){socket[_0x0604('0x70')]('userWhatsappQueue:remove',{'UserId':_0x3c7b74,'WhatsappQueueId':_0x5ba947['id']});});});});});});})['then'](respondWithStatusCode(_0x8cfed1,null))['catch'](handleError(_0x8cfed1,null));};exports[_0x0604('0x84')]=function(_0x23195f,_0x3bf81a,_0x17ec75){return db[_0x0604('0x33')][_0x0604('0x56')]({'where':{'id':_0x23195f[_0x0604('0x4d')]['id']}})[_0x0604('0x2a')](handleEntityNotFound(_0x3bf81a,null))['then'](function(_0x261c19){if(_0x261c19){return _0x261c19[_0x0604('0x84')](_0x23195f[_0x0604('0x4f')]['ids'],_[_0x0604('0x85')](_0x23195f[_0x0604('0x4f')],['ids','id'])||{})[_0x0604('0x86')](function(_0x5a7e47){for(var _0x49721f=0x0;_0x49721f<_0x23195f[_0x0604('0x4f')][_0x0604('0x68')][_0x0604('0x3e')];_0x49721f+=0x1){socket[_0x0604('0x70')](_0x0604('0x71'),{'UserId':Number(_0x23195f[_0x0604('0x4f')]['ids'][_0x49721f]),'WhatsappQueueId':Number(_0x23195f[_0x0604('0x4d')]['id'])});}return _0x5a7e47;});}})[_0x0604('0x2a')](respondWithResult(_0x3bf81a,null))['catch'](handleError(_0x3bf81a,null));};exports['removeAgents']=function(_0x4e0862,_0x5b223a,_0x19d9d0){return db[_0x0604('0x33')][_0x0604('0x56')]({'where':{'id':_0x4e0862[_0x0604('0x4d')]['id']}})[_0x0604('0x2a')](handleEntityNotFound(_0x5b223a,null))[_0x0604('0x2a')](function(_0x33c7e4){if(_0x33c7e4){return _0x33c7e4[_0x0604('0x87')](_0x4e0862[_0x0604('0x38')][_0x0604('0x68')])['then'](function(){if(_[_0x0604('0x88')](_0x4e0862['query']['ids'])){for(var _0x169ab2=0x0;_0x169ab2<_0x4e0862[_0x0604('0x38')][_0x0604('0x68')][_0x0604('0x3e')];_0x169ab2+=0x1){socket[_0x0604('0x70')](_0x0604('0x89'),{'UserId':Number(_0x4e0862['query'][_0x0604('0x68')][_0x169ab2]),'WhatsappQueueId':Number(_0x4e0862[_0x0604('0x4d')]['id'])});}}else{socket[_0x0604('0x70')](_0x0604('0x89'),{'UserId':Number(_0x4e0862[_0x0604('0x38')][_0x0604('0x68')]),'WhatsappQueueId':Number(_0x4e0862[_0x0604('0x4d')]['id'])});}});}})[_0x0604('0x2a')](respondWithStatusCode(_0x5b223a,null))[_0x0604('0x4c')](handleError(_0x5b223a,null));};exports['getAgents']=function(_0x495990,_0x284f08,_0x5d3e8d){var _0x59ceb6={};var _0x53593b={};var _0x55832d;var _0x583239;return db['WhatsappQueue'][_0x0604('0x59')]({'where':{'id':_0x495990[_0x0604('0x4d')]['id']}})[_0x0604('0x2a')](handleEntityNotFound(_0x284f08,null))[_0x0604('0x2a')](function(_0x45bb08){if(_0x45bb08){_0x55832d=_0x45bb08;_0x53593b[_0x0604('0x37')]=_[_0x0604('0x39')](db['User'][_0x0604('0x34')]);_0x53593b[_0x0604('0x38')]=_[_0x0604('0x39')](_0x495990[_0x0604('0x38')]);_0x53593b[_0x0604('0x3a')]=_['intersection'](_0x53593b[_0x0604('0x37')],_0x53593b[_0x0604('0x38')]);_0x59ceb6[_0x0604('0x3c')]=_[_0x0604('0x3b')](_0x53593b[_0x0604('0x37')],qs[_0x0604('0x3d')](_0x495990[_0x0604('0x38')][_0x0604('0x3d')]));_0x59ceb6['attributes']=_0x59ceb6[_0x0604('0x3c')]['length']?_0x59ceb6[_0x0604('0x3c')]:_0x53593b[_0x0604('0x37')];_0x59ceb6[_0x0604('0x41')]=qs[_0x0604('0x42')](_0x495990[_0x0604('0x38')]['sort']);_0x59ceb6['where']=qs[_0x0604('0x3a')](_['pick'](_0x495990['query'],_0x53593b['filters']));if(_0x495990['query']['filter']){_0x59ceb6['where']=_[_0x0604('0x46')](_0x59ceb6['where'],{'$or':_[_0x0604('0x32')](_0x59ceb6[_0x0604('0x3c')],function(_0x4d80c6){var _0x3cc3a0={};_0x3cc3a0[_0x4d80c6]={'$like':'%'+_0x495990[_0x0604('0x38')][_0x0604('0x45')]+'%'};return _0x3cc3a0;})});}_0x59ceb6=_[_0x0604('0x46')]({},_0x59ceb6,_0x495990[_0x0604('0x48')]);return _0x55832d[_0x0604('0x8a')](_0x59ceb6);}})[_0x0604('0x2a')](function(_0x53c2dd){if(_0x53c2dd){_0x583239=_0x53c2dd[_0x0604('0x3e')];if(!_0x495990[_0x0604('0x38')]['hasOwnProperty'](_0x0604('0x40'))){_0x59ceb6[_0x0604('0x21')]=qs[_0x0604('0x21')](_0x495990['query'][_0x0604('0x21')]);_0x59ceb6['offset']=qs[_0x0604('0x1f')](_0x495990[_0x0604('0x38')][_0x0604('0x1f')]);}return _0x55832d[_0x0604('0x8a')](_0x59ceb6);}})[_0x0604('0x2a')](function(_0x3affbe){if(_0x3affbe){return _0x3affbe?{'count':_0x583239,'rows':_0x3affbe}:null;}})[_0x0604('0x2a')](respondWithResult(_0x284f08,null))['catch'](handleError(_0x284f08,null));};
\ No newline at end of file
+var _0x9b66=['filter','merge','VIRTUAL','includeAll','include','WhatsappQueue','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','Agents','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','ids','select','field','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','get','WhatsappQueues','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b66,0xd0));var _0x69b6=function(_0x496694,_0x58b6e7){_0x496694=_0x496694-0x0;var _0x82259b=_0x9b66[_0x496694];return _0x82259b;};'use strict';var emlformat=require(_0x69b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69b6('0x1'));var jsonpatch=require(_0x69b6('0x2'));var rp=require(_0x69b6('0x3'));var moment=require(_0x69b6('0x4'));var BPromise=require(_0x69b6('0x5'));var Mustache=require('mustache');var util=require(_0x69b6('0x6'));var path=require(_0x69b6('0x7'));var sox=require(_0x69b6('0x8'));var csv=require(_0x69b6('0x9'));var ejs=require(_0x69b6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x69b6('0xb'));var crypto=require(_0x69b6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x69b6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x69b6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x69b6('0xe'));var as=require(_0x69b6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69b6('0x10'))(_0x69b6('0x11'));var utils=require(_0x69b6('0x12'));var config=require(_0x69b6('0x13'));var licenseUtil=require(_0x69b6('0x14'));var db=require(_0x69b6('0x15'))['db'];config[_0x69b6('0x16')]=_['defaults'](config[_0x69b6('0x16')],{'host':_0x69b6('0x17'),'port':0x18eb});var socket=require(_0x69b6('0x18'))(new Redis(config['redis']));require(_0x69b6('0x19'))[_0x69b6('0x1a')](socket);function respondWithStatusCode(_0x5b29e3,_0x3a8e7f){_0x3a8e7f=_0x3a8e7f||0xcc;return function(_0x3934cf){if(_0x3934cf){return _0x5b29e3[_0x69b6('0x1b')](_0x3a8e7f);}return _0x5b29e3['status'](_0x3a8e7f)[_0x69b6('0x1c')]();};}function respondWithResult(_0x3480a1,_0x514c7f){_0x514c7f=_0x514c7f||0xc8;return function(_0x2b1688){if(_0x2b1688){return _0x3480a1[_0x69b6('0x1d')](_0x514c7f)[_0x69b6('0x1e')](_0x2b1688);}};}function respondWithFilteredResult(_0x2867e0,_0x600098){return function(_0x12967d){if(_0x12967d){var _0x34f653=typeof _0x600098[_0x69b6('0x1f')]===_0x69b6('0x20')&&typeof _0x600098[_0x69b6('0x21')]===_0x69b6('0x20');var _0x20a265=_0x12967d[_0x69b6('0x22')];var _0x48f3c2=_0x34f653?0x0:_0x600098[_0x69b6('0x1f')];var _0x1e9c0c=_0x34f653?_0x12967d[_0x69b6('0x22')]:_0x600098[_0x69b6('0x1f')]+_0x600098[_0x69b6('0x21')];var _0x4944a7;if(_0x1e9c0c>=_0x20a265){_0x1e9c0c=_0x20a265;_0x4944a7=0xc8;}else{_0x4944a7=0xce;}_0x2867e0[_0x69b6('0x1d')](_0x4944a7);return _0x2867e0[_0x69b6('0x23')]('Content-Range',_0x48f3c2+'-'+_0x1e9c0c+'/'+_0x20a265)[_0x69b6('0x1e')](_0x12967d);}return null;};}function patchUpdates(_0x42d629){return function(_0x5840ae){try{jsonpatch[_0x69b6('0x24')](_0x5840ae,_0x42d629,!![]);}catch(_0x590b08){return BPromise[_0x69b6('0x25')](_0x590b08);}return _0x5840ae['save']();};}function saveUpdates(_0x1e669f,_0x33ed5e){return function(_0x81c472){if(_0x81c472){return _0x81c472['update'](_0x1e669f)[_0x69b6('0x26')](function(_0x479bc1){return _0x479bc1;});}return null;};}function removeEntity(_0x2be125,_0x29af77){return function(_0x66ef83){if(_0x66ef83){return _0x66ef83['destroy']()[_0x69b6('0x26')](function(){var _0x2d7a76=_0x66ef83[_0x69b6('0x27')]({'plain':!![]});var _0x47856b=_0x69b6('0x28');return db['UserProfileResource'][_0x69b6('0x29')]({'where':{'type':_0x47856b,'resourceId':_0x2d7a76['id']}})[_0x69b6('0x26')](function(){return _0x66ef83;});})[_0x69b6('0x26')](function(){_0x2be125[_0x69b6('0x1d')](0xcc)[_0x69b6('0x1c')]();});}};}function handleEntityNotFound(_0x3967c6,_0x1ba59b){return function(_0x382f4a){if(!_0x382f4a){_0x3967c6['sendStatus'](0x194);}return _0x382f4a;};}function handleError(_0x2f8393,_0x1964a5){_0x1964a5=_0x1964a5||0x1f4;return function(_0x1d9bd5){logger[_0x69b6('0x2a')](_0x1d9bd5[_0x69b6('0x2b')]);if(_0x1d9bd5[_0x69b6('0x2c')]){delete _0x1d9bd5['name'];}_0x2f8393[_0x69b6('0x1d')](_0x1964a5)['send'](_0x1d9bd5);};}exports[_0x69b6('0x2d')]=function(_0x44786a,_0x5a1b2c){var _0x14e8cd={},_0x284656={},_0x32ee2b={'count':0x0,'rows':[]};var _0x3c203a=_['map'](db['WhatsappQueue'][_0x69b6('0x2e')],function(_0x1bddd6){return{'name':_0x1bddd6[_0x69b6('0x2f')],'type':_0x1bddd6[_0x69b6('0x30')][_0x69b6('0x31')]};});_0x284656[_0x69b6('0x32')]=_[_0x69b6('0x33')](_0x3c203a,_0x69b6('0x2c'));_0x284656['query']=_['keys'](_0x44786a[_0x69b6('0x34')]);_0x284656['filters']=_[_0x69b6('0x35')](_0x284656['model'],_0x284656[_0x69b6('0x34')]);_0x14e8cd[_0x69b6('0x36')]=_['intersection'](_0x284656[_0x69b6('0x32')],qs[_0x69b6('0x37')](_0x44786a[_0x69b6('0x34')][_0x69b6('0x37')]));_0x14e8cd['attributes']=_0x14e8cd[_0x69b6('0x36')][_0x69b6('0x38')]?_0x14e8cd[_0x69b6('0x36')]:_0x284656[_0x69b6('0x32')];if(!_0x44786a[_0x69b6('0x34')][_0x69b6('0x39')](_0x69b6('0x3a'))){_0x14e8cd[_0x69b6('0x21')]=qs[_0x69b6('0x21')](_0x44786a['query']['limit']);_0x14e8cd[_0x69b6('0x1f')]=qs[_0x69b6('0x1f')](_0x44786a[_0x69b6('0x34')]['offset']);}_0x14e8cd[_0x69b6('0x3b')]=qs[_0x69b6('0x3c')](_0x44786a[_0x69b6('0x34')]['sort']);_0x14e8cd[_0x69b6('0x3d')]=qs['filters'](_[_0x69b6('0x3e')](_0x44786a[_0x69b6('0x34')],_0x284656[_0x69b6('0x3f')]),_0x3c203a);if(_0x44786a[_0x69b6('0x34')][_0x69b6('0x40')]){_0x14e8cd[_0x69b6('0x3d')]=_[_0x69b6('0x41')](_0x14e8cd['where'],{'$or':_['map'](_0x3c203a,function(_0x207a84){if(_0x207a84[_0x69b6('0x30')]!==_0x69b6('0x42')){var _0x327c33={};_0x327c33[_0x207a84[_0x69b6('0x2c')]]={'$like':'%'+_0x44786a[_0x69b6('0x34')][_0x69b6('0x40')]+'%'};return _0x327c33;}})});}_0x14e8cd=_[_0x69b6('0x41')]({},_0x14e8cd,_0x44786a['options']);var _0xa4590e={'where':_0x14e8cd['where']};return db['WhatsappQueue'][_0x69b6('0x22')](_0xa4590e)[_0x69b6('0x26')](function(_0x33b108){_0x32ee2b[_0x69b6('0x22')]=_0x33b108;if(_0x44786a[_0x69b6('0x34')][_0x69b6('0x43')]){_0x14e8cd[_0x69b6('0x44')]=[{'all':!![]}];}return db[_0x69b6('0x45')][_0x69b6('0x46')](_0x14e8cd);})[_0x69b6('0x26')](function(_0x3e6a4b){_0x32ee2b[_0x69b6('0x47')]=_0x3e6a4b;return _0x32ee2b;})[_0x69b6('0x26')](respondWithFilteredResult(_0x5a1b2c,_0x14e8cd))[_0x69b6('0x48')](handleError(_0x5a1b2c,null));};exports[_0x69b6('0x49')]=function(_0x4c9c91,_0x3cead5){var _0x28d419={'raw':!![],'where':{'id':_0x4c9c91[_0x69b6('0x4a')]['id']}},_0x3ee243={};_0x3ee243['model']=_[_0x69b6('0x4b')](db[_0x69b6('0x45')][_0x69b6('0x2e')]);_0x3ee243[_0x69b6('0x34')]=_[_0x69b6('0x4b')](_0x4c9c91['query']);_0x3ee243[_0x69b6('0x3f')]=_[_0x69b6('0x35')](_0x3ee243[_0x69b6('0x32')],_0x3ee243['query']);_0x28d419['attributes']=_[_0x69b6('0x35')](_0x3ee243[_0x69b6('0x32')],qs['fields'](_0x4c9c91['query']['fields']));_0x28d419[_0x69b6('0x36')]=_0x28d419[_0x69b6('0x36')]['length']?_0x28d419[_0x69b6('0x36')]:_0x3ee243[_0x69b6('0x32')];if(_0x4c9c91[_0x69b6('0x34')]['includeAll']){_0x28d419[_0x69b6('0x44')]=[{'all':!![]}];}_0x28d419=_[_0x69b6('0x41')]({},_0x28d419,_0x4c9c91[_0x69b6('0x4c')]);return db['WhatsappQueue'][_0x69b6('0x4d')](_0x28d419)['then'](handleEntityNotFound(_0x3cead5,null))[_0x69b6('0x26')](respondWithResult(_0x3cead5,null))[_0x69b6('0x48')](handleError(_0x3cead5,null));};exports[_0x69b6('0x4e')]=function(_0x2e4bfd,_0x5628f5){return db[_0x69b6('0x45')]['create'](_0x2e4bfd[_0x69b6('0x4f')],{})[_0x69b6('0x26')](function(_0x4f1f87){var _0xb9fd29=_0x2e4bfd[_0x69b6('0x50')][_0x69b6('0x27')]({'plain':!![]});if(!_0xb9fd29)throw new Error(_0x69b6('0x51'));if(_0xb9fd29['role']===_0x69b6('0x50')){var _0x97d757=_0x4f1f87[_0x69b6('0x27')]({'plain':!![]});var _0x3fde5d=_0x69b6('0x28');return db['UserProfileSection'][_0x69b6('0x4d')]({'where':{'name':_0x3fde5d,'userProfileId':_0xb9fd29[_0x69b6('0x52')]},'raw':!![]})[_0x69b6('0x26')](function(_0x1f64da){if(_0x1f64da&&_0x1f64da[_0x69b6('0x53')]===0x0){return db[_0x69b6('0x54')][_0x69b6('0x4e')]({'name':_0x97d757[_0x69b6('0x2c')],'resourceId':_0x97d757['id'],'type':_0x1f64da[_0x69b6('0x2c')],'sectionId':_0x1f64da['id']},{})['then'](function(){return _0x4f1f87;});}else{return _0x4f1f87;}})[_0x69b6('0x48')](function(_0x45e3bf){logger[_0x69b6('0x2a')](_0x69b6('0x55'),_0x45e3bf);throw _0x45e3bf;});}return _0x4f1f87;})[_0x69b6('0x26')](respondWithResult(_0x5628f5,0xc9))['catch'](handleError(_0x5628f5,null));};exports[_0x69b6('0x56')]=function(_0x4bd300,_0x26d64a){if(_0x4bd300['body']['id']){delete _0x4bd300[_0x69b6('0x4f')]['id'];}return db['WhatsappQueue'][_0x69b6('0x4d')]({'where':{'id':_0x4bd300[_0x69b6('0x4a')]['id']}})[_0x69b6('0x26')](handleEntityNotFound(_0x26d64a,null))['then'](saveUpdates(_0x4bd300[_0x69b6('0x4f')],null))[_0x69b6('0x26')](respondWithResult(_0x26d64a,null))[_0x69b6('0x48')](handleError(_0x26d64a,null));};exports[_0x69b6('0x29')]=function(_0x47ecc5,_0x2f9c2f){return db[_0x69b6('0x45')]['find']({'where':{'id':_0x47ecc5[_0x69b6('0x4a')]['id']}})[_0x69b6('0x26')](handleEntityNotFound(_0x2f9c2f,null))[_0x69b6('0x26')](removeEntity(_0x2f9c2f,null))[_0x69b6('0x48')](handleError(_0x2f9c2f,null));};exports[_0x69b6('0x57')]=function(_0x2d14c1,_0x2166b1){return db[_0x69b6('0x45')][_0x69b6('0x57')]()[_0x69b6('0x26')](respondWithResult(_0x2166b1,null))[_0x69b6('0x48')](handleError(_0x2166b1,null));};exports[_0x69b6('0x58')]=function(_0x42640e,_0x1dce11,_0x91fdf6){var _0x390f58={'raw':!![],'where':{}},_0x1e46c5={},_0x413172;return db[_0x69b6('0x45')][_0x69b6('0x59')]({'where':{'id':_0x42640e['params']['id']}})['then'](handleEntityNotFound(_0x1dce11,null))['then'](function(_0x485d14){if(_0x485d14){_0x413172=_0x485d14['get']({'plain':!![]});_0x1e46c5['model']=_[_0x69b6('0x4b')](db[_0x69b6('0x5a')][_0x69b6('0x2e')]);_0x1e46c5[_0x69b6('0x34')]=_[_0x69b6('0x4b')](_0x42640e[_0x69b6('0x34')]);_0x1e46c5[_0x69b6('0x3f')]=_[_0x69b6('0x35')](_0x1e46c5['model'],_0x1e46c5['query']);_0x390f58[_0x69b6('0x36')]=_['intersection'](_0x1e46c5[_0x69b6('0x32')],qs['fields'](_0x42640e[_0x69b6('0x34')][_0x69b6('0x37')]));_0x390f58[_0x69b6('0x36')]=_0x390f58[_0x69b6('0x36')][_0x69b6('0x38')]?_0x390f58[_0x69b6('0x36')]:_0x1e46c5['model'];if(!_0x42640e['query'][_0x69b6('0x39')](_0x69b6('0x3a'))){_0x390f58['limit']=qs[_0x69b6('0x21')](_0x42640e[_0x69b6('0x34')][_0x69b6('0x21')]);_0x390f58['offset']=qs[_0x69b6('0x1f')](_0x42640e[_0x69b6('0x34')][_0x69b6('0x1f')]);}_0x390f58[_0x69b6('0x3b')]=qs[_0x69b6('0x3c')](_0x42640e[_0x69b6('0x34')][_0x69b6('0x3c')]);_0x390f58[_0x69b6('0x3d')]=qs['filters'](_['pick'](_0x42640e[_0x69b6('0x34')],_0x1e46c5['filters']));_0x390f58[_0x69b6('0x3d')][_0x69b6('0x5b')]=_0x485d14['id'];if(_0x42640e[_0x69b6('0x34')][_0x69b6('0x40')]){_0x390f58[_0x69b6('0x3d')]=_[_0x69b6('0x41')](_0x390f58[_0x69b6('0x3d')],{'$or':_[_0x69b6('0x33')](_0x390f58[_0x69b6('0x36')],function(_0x3b9212){var _0x5e3372={};_0x5e3372[_0x3b9212]={'$like':'%'+_0x42640e[_0x69b6('0x34')][_0x69b6('0x40')]+'%'};return _0x5e3372;})});}_0x390f58=_[_0x69b6('0x41')]({},_0x390f58,_0x42640e[_0x69b6('0x4c')]);return db[_0x69b6('0x5a')]['findAll'](_0x390f58);}})[_0x69b6('0x26')](function(_0x136da4){if(_0x136da4){return db[_0x69b6('0x5c')][_0x69b6('0x5d')]({'where':{'id':_[_0x69b6('0x33')](_0x136da4,'UserId'),'role':_0x69b6('0x5e')},'attributes':['id',_0x69b6('0x2c'),_0x69b6('0x5f'),_0x69b6('0x60'),_0x69b6('0x61')]});}})['then'](function(_0x265d35){if(_0x265d35){return{'count':_0x265d35[_0x69b6('0x22')],'rows':_['map'](_0x265d35['rows'],function(_0x18792b){return{'membername':_0x18792b[_0x69b6('0x2c')],'UserId':_0x18792b['id'],'queue_name':_0x413172[_0x69b6('0x2c')],'WhatsappQueueId':_0x413172['id'],'interface':util['format'](_0x69b6('0x62'),_0x69b6('0x63'),_0x18792b[_0x69b6('0x2c')]),'penalty':0x0,'paused':_0x18792b[_0x69b6('0x5f')],'createdAt':_0x18792b[_0x69b6('0x61')],'updatedAt':_0x18792b[_0x69b6('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x69b6('0x26')](respondWithFilteredResult(_0x1dce11,_0x390f58))[_0x69b6('0x48')](handleError(_0x1dce11,null));};exports[_0x69b6('0x64')]=function(_0x3b8977,_0x22ded5,_0x4501fa){var _0xa926f2={};var _0x522e13={};var _0x1cef05;var _0x1d3aa4;return db[_0x69b6('0x45')]['findOne']({'where':{'id':_0x3b8977[_0x69b6('0x4a')]['id']}})[_0x69b6('0x26')](handleEntityNotFound(_0x22ded5,null))[_0x69b6('0x26')](function(_0x28fde8){if(_0x28fde8){_0x1cef05=_0x28fde8;_0x522e13[_0x69b6('0x32')]=_[_0x69b6('0x4b')](db[_0x69b6('0x65')][_0x69b6('0x2e')]);_0x522e13[_0x69b6('0x34')]=_[_0x69b6('0x4b')](_0x3b8977[_0x69b6('0x34')]);_0x522e13[_0x69b6('0x3f')]=_[_0x69b6('0x35')](_0x522e13[_0x69b6('0x32')],_0x522e13['query']);_0xa926f2[_0x69b6('0x36')]=_[_0x69b6('0x35')](_0x522e13[_0x69b6('0x32')],qs[_0x69b6('0x37')](_0x3b8977['query'][_0x69b6('0x37')]));_0xa926f2[_0x69b6('0x36')]=_0xa926f2[_0x69b6('0x36')][_0x69b6('0x38')]?_0xa926f2['attributes']:_0x522e13[_0x69b6('0x32')];_0xa926f2[_0x69b6('0x3b')]=qs[_0x69b6('0x3c')](_0x3b8977['query']['sort']);_0xa926f2[_0x69b6('0x3d')]=qs['filters'](_[_0x69b6('0x3e')](_0x3b8977['query'],_0x522e13[_0x69b6('0x3f')]));if(_0x3b8977[_0x69b6('0x34')][_0x69b6('0x40')]){_0xa926f2['where']=_[_0x69b6('0x41')](_0xa926f2[_0x69b6('0x3d')],{'$or':_[_0x69b6('0x33')](_0xa926f2[_0x69b6('0x36')],function(_0x3cd641){var _0x5b51df={};_0x5b51df[_0x3cd641]={'$like':'%'+_0x3b8977[_0x69b6('0x34')]['filter']+'%'};return _0x5b51df;})});}_0xa926f2=_['merge']({},_0xa926f2,_0x3b8977[_0x69b6('0x4c')]);return _0x1cef05[_0x69b6('0x64')](_0xa926f2);}})[_0x69b6('0x26')](function(_0x353c60){if(_0x353c60){_0x1d3aa4=_0x353c60[_0x69b6('0x38')];if(!_0x3b8977[_0x69b6('0x34')][_0x69b6('0x39')](_0x69b6('0x3a'))){_0xa926f2[_0x69b6('0x21')]=qs['limit'](_0x3b8977['query']['limit']);_0xa926f2[_0x69b6('0x1f')]=qs[_0x69b6('0x1f')](_0x3b8977['query'][_0x69b6('0x1f')]);}return _0x1cef05['getTeams'](_0xa926f2);}})[_0x69b6('0x26')](function(_0x5c8da){if(_0x5c8da){return _0x5c8da?{'count':_0x1d3aa4,'rows':_0x5c8da}:null;}})[_0x69b6('0x26')](respondWithResult(_0x22ded5,null))[_0x69b6('0x48')](handleError(_0x22ded5,null));};exports['addTeams']=function(_0x3f20a2,_0x208e3b,_0x8e7c96){var _0x5af3f3=_0x3f20a2[_0x69b6('0x4f')]['ids'];return db['Team'][_0x69b6('0x46')]({'where':{'id':_0x5af3f3},'attributes':['id'],'include':[{'model':db[_0x69b6('0x5c')],'as':_0x69b6('0x66'),'attributes':['id',_0x69b6('0x2c'),'online','voicePause',_0x69b6('0x67')],'raw':!![]}]})[_0x69b6('0x26')](function(_0x4c8cc2){if(_0x4c8cc2){var _0x1c2562=_[_0x69b6('0x68')](_0x4c8cc2,function(_0x57deee){var _0x489508=_0x57deee[_0x69b6('0x27')]({'plain':!![]});return _0x489508[_0x69b6('0x66')];});return db[_0x69b6('0x45')][_0x69b6('0x4d')]({'where':{'id':_0x3f20a2[_0x69b6('0x4a')]['id']}})[_0x69b6('0x26')](function(_0x318da9){return db[_0x69b6('0x69')][_0x69b6('0x6a')](function(_0x9f7ba8){return _0x318da9['addTeams'](_0x5af3f3,{'transaction':_0x9f7ba8})[_0x69b6('0x26')](function(){return BPromise['each'](_0x1c2562,function(_0x4652ab){return db[_0x69b6('0x5a')][_0x69b6('0x6b')]({'where':{'UserId':_0x4652ab['id'],'WhatsappQueueId':_0x3f20a2['params']['id']},'transaction':_0x9f7ba8});});})[_0x69b6('0x26')](function(){_0x1c2562[_0x69b6('0x6c')](function(_0x5d61bd){socket[_0x69b6('0x6d')]('userWhatsappQueue:save',{'UserId':_0x5d61bd['id'],'WhatsappQueueId':_0x318da9['id']});});});});});}})[_0x69b6('0x26')](respondWithStatusCode(_0x208e3b,null))['catch'](handleError(_0x208e3b,null));};exports[_0x69b6('0x6e')]=function(_0xc0962,_0x2b83cc,_0x28720d){return db['Team']['findAll']({'where':{'id':_0xc0962[_0x69b6('0x34')][_0x69b6('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x69b6('0x5c')],'as':_0x69b6('0x66'),'attributes':['id'],'raw':!![]}]})[_0x69b6('0x26')](handleEntityNotFound(_0x2b83cc,null))[_0x69b6('0x26')](function(_0x11f73c){var _0x418fd6=_[_0x69b6('0x33')](_0x11f73c,'id');var _0x577873=[];var _0x226cb4=[];var _0x51008c=squel[_0x69b6('0x70')]();_0x51008c[_0x69b6('0x71')]('tq.TeamId')['from'](_0x69b6('0x72'),'tq')['join'](_0x69b6('0x73'),'ut',_0x69b6('0x74'))['where'](_0x69b6('0x75'),_0xc0962[_0x69b6('0x4a')]['id']);for(var _0x3bf887=0x0;_0x3bf887<_0x11f73c['length'];_0x3bf887+=0x1){let _0x5d11b9=_0x11f73c[_0x3bf887];for(var _0x272c7f=0x0;_0x272c7f<_0x5d11b9[_0x69b6('0x66')][_0x69b6('0x38')];_0x272c7f+=0x1){let _0x5d09a5=_0x5d11b9['Agents'][_0x272c7f];var _0x2c441f=_0x51008c[_0x69b6('0x76')]();_0x2c441f[_0x69b6('0x3d')]('ut.UserId\x20=\x20?',_0x5d09a5['id']);_0x226cb4[_0x69b6('0x77')](db[_0x69b6('0x69')][_0x69b6('0x34')](_0x2c441f[_0x69b6('0x78')](),{'type':db[_0x69b6('0x69')][_0x69b6('0x79')][_0x69b6('0x7a')]})['then'](function(_0x372a9b){if(_0x372a9b[_0x69b6('0x38')]===0x1){return _0x5d09a5['id'];}else{var _0x454d3f=_[_0x69b6('0x7b')](_[_0x69b6('0x33')](_0x372a9b,'TeamId'),function(_0x9777d8){return _[_0x69b6('0x7c')](_0x418fd6,_0x9777d8);});if(_0x454d3f){return _0x5d09a5['id'];}}}));}}return BPromise[_0x69b6('0x7d')](_0x226cb4)[_0x69b6('0x26')](function(_0x5dba1e){_0x577873=_(_0x577873)[_0x69b6('0x7e')](_0x5dba1e)[_0x69b6('0x7f')]()[_0x69b6('0x80')]();return db['WhatsappQueue'][_0x69b6('0x4d')]({'where':{'id':_0xc0962[_0x69b6('0x4a')]['id']}})[_0x69b6('0x26')](function(_0x706777){return db[_0x69b6('0x69')][_0x69b6('0x6a')](function(_0x1a69e4){return _0x706777[_0x69b6('0x6e')](_0xc0962[_0x69b6('0x34')]['ids'],{'transaction':_0x1a69e4})[_0x69b6('0x26')](function(){if(!_['isEmpty'](_0x577873)){return _0x706777['removeAgents'](_0x577873,{'transaction':_0x1a69e4});}})[_0x69b6('0x26')](function(){_0x577873[_0x69b6('0x6c')](function(_0x4df6e1){socket[_0x69b6('0x6d')](_0x69b6('0x81'),{'UserId':_0x4df6e1,'WhatsappQueueId':_0x706777['id']});});});});});});})[_0x69b6('0x26')](respondWithStatusCode(_0x2b83cc,null))[_0x69b6('0x48')](handleError(_0x2b83cc,null));};exports['addAgents']=function(_0x1784dc,_0x5e30c5,_0x187da3){return db['WhatsappQueue'][_0x69b6('0x4d')]({'where':{'id':_0x1784dc[_0x69b6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e30c5,null))['then'](function(_0x281820){if(_0x281820){return _0x281820[_0x69b6('0x82')](_0x1784dc[_0x69b6('0x4f')][_0x69b6('0x6f')],_[_0x69b6('0x83')](_0x1784dc[_0x69b6('0x4f')],[_0x69b6('0x6f'),'id'])||{})[_0x69b6('0x84')](function(_0x5803c5){for(var _0x523eb6=0x0;_0x523eb6<_0x1784dc[_0x69b6('0x4f')]['ids'][_0x69b6('0x38')];_0x523eb6+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x1784dc['body'][_0x69b6('0x6f')][_0x523eb6]),'WhatsappQueueId':Number(_0x1784dc[_0x69b6('0x4a')]['id'])});}return _0x5803c5;});}})[_0x69b6('0x26')](respondWithResult(_0x5e30c5,null))[_0x69b6('0x48')](handleError(_0x5e30c5,null));};exports[_0x69b6('0x85')]=function(_0x164efc,_0x2f2a5f,_0x5ef504){return db[_0x69b6('0x45')][_0x69b6('0x4d')]({'where':{'id':_0x164efc[_0x69b6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f2a5f,null))['then'](function(_0x4a824e){if(_0x4a824e){return _0x4a824e[_0x69b6('0x85')](_0x164efc[_0x69b6('0x34')]['ids'])[_0x69b6('0x26')](function(){if(_[_0x69b6('0x86')](_0x164efc[_0x69b6('0x34')]['ids'])){for(var _0x290836=0x0;_0x290836<_0x164efc['query'][_0x69b6('0x6f')][_0x69b6('0x38')];_0x290836+=0x1){socket[_0x69b6('0x6d')](_0x69b6('0x81'),{'UserId':Number(_0x164efc[_0x69b6('0x34')][_0x69b6('0x6f')][_0x290836]),'WhatsappQueueId':Number(_0x164efc[_0x69b6('0x4a')]['id'])});}}else{socket[_0x69b6('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x164efc['query'][_0x69b6('0x6f')]),'WhatsappQueueId':Number(_0x164efc['params']['id'])});}});}})[_0x69b6('0x26')](respondWithStatusCode(_0x2f2a5f,null))[_0x69b6('0x48')](handleError(_0x2f2a5f,null));};exports[_0x69b6('0x87')]=function(_0xf1982e,_0x160055,_0xebac49){var _0x199841={};var _0xf38da6={};var _0x440435;var _0x2d4dc6;return db['WhatsappQueue'][_0x69b6('0x59')]({'where':{'id':_0xf1982e['params']['id']}})[_0x69b6('0x26')](handleEntityNotFound(_0x160055,null))['then'](function(_0x263a58){if(_0x263a58){_0x440435=_0x263a58;_0xf38da6[_0x69b6('0x32')]=_[_0x69b6('0x4b')](db[_0x69b6('0x5c')][_0x69b6('0x2e')]);_0xf38da6['query']=_[_0x69b6('0x4b')](_0xf1982e[_0x69b6('0x34')]);_0xf38da6[_0x69b6('0x3f')]=_[_0x69b6('0x35')](_0xf38da6[_0x69b6('0x32')],_0xf38da6[_0x69b6('0x34')]);_0x199841[_0x69b6('0x36')]=_['intersection'](_0xf38da6[_0x69b6('0x32')],qs[_0x69b6('0x37')](_0xf1982e[_0x69b6('0x34')][_0x69b6('0x37')]));_0x199841['attributes']=_0x199841['attributes'][_0x69b6('0x38')]?_0x199841['attributes']:_0xf38da6[_0x69b6('0x32')];_0x199841[_0x69b6('0x3b')]=qs[_0x69b6('0x3c')](_0xf1982e[_0x69b6('0x34')]['sort']);_0x199841['where']=qs['filters'](_['pick'](_0xf1982e[_0x69b6('0x34')],_0xf38da6[_0x69b6('0x3f')]));if(_0xf1982e[_0x69b6('0x34')][_0x69b6('0x40')]){_0x199841['where']=_[_0x69b6('0x41')](_0x199841[_0x69b6('0x3d')],{'$or':_['map'](_0x199841[_0x69b6('0x36')],function(_0x5eaefc){var _0x145e62={};_0x145e62[_0x5eaefc]={'$like':'%'+_0xf1982e[_0x69b6('0x34')][_0x69b6('0x40')]+'%'};return _0x145e62;})});}_0x199841=_['merge']({},_0x199841,_0xf1982e[_0x69b6('0x4c')]);return _0x440435[_0x69b6('0x87')](_0x199841);}})[_0x69b6('0x26')](function(_0x341a91){if(_0x341a91){_0x2d4dc6=_0x341a91[_0x69b6('0x38')];if(!_0xf1982e[_0x69b6('0x34')][_0x69b6('0x39')]('nolimit')){_0x199841[_0x69b6('0x21')]=qs[_0x69b6('0x21')](_0xf1982e[_0x69b6('0x34')][_0x69b6('0x21')]);_0x199841['offset']=qs[_0x69b6('0x1f')](_0xf1982e[_0x69b6('0x34')]['offset']);}return _0x440435[_0x69b6('0x87')](_0x199841);}})[_0x69b6('0x26')](function(_0x4b9a7f){if(_0x4b9a7f){return _0x4b9a7f?{'count':_0x2d4dc6,'rows':_0x4b9a7f}:null;}})['then'](respondWithResult(_0x160055,null))['catch'](handleError(_0x160055,null));};
\ No newline at end of file
index de72f23..ec32f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc50b=['hasOwnProperty','events','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x37b327,_0x47b877){var _0x184e2f=function(_0x5d692d){while(--_0x5d692d){_0x37b327['push'](_0x37b327['shift']());}};_0x184e2f(++_0x47b877);}(_0xc50b,0x181));var _0xbc50=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0xc50b[_0x55c1f0];return _0x1530fa;};'use strict';var EventEmitter=require(_0xbc50('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xbc50('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbc50('0x2')](0x0);var events={'afterCreate':_0xbc50('0x3'),'afterUpdate':_0xbc50('0x4'),'afterDestroy':_0xbc50('0x5')};function emitEvent(_0x3b95bc){return function(_0xb0350,_0x2c610a,_0x5e54dd){WhatsappQueueEvents[_0xbc50('0x6')](_0x3b95bc+':'+_0xb0350['id'],_0xb0350);WhatsappQueueEvents[_0xbc50('0x6')](_0x3b95bc,_0xb0350);_0x5e54dd(null);};}for(var e in events){if(events[_0xbc50('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x6c04=['emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x5a8981,_0x12fe84){var _0x4a3592=function(_0x56bb10){while(--_0x56bb10){_0x5a8981['push'](_0x5a8981['shift']());}};_0x4a3592(++_0x12fe84);}(_0x6c04,0x85));var _0x46c0=function(_0x2ea05b,_0x330ea5){_0x2ea05b=_0x2ea05b-0x0;var _0x4e9a36=_0x6c04[_0x2ea05b];return _0x4e9a36;};'use strict';var EventEmitter=require(_0x46c0('0x0'));var WhatsappQueue=require(_0x46c0('0x1'))['db'][_0x46c0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x46c0('0x3')](0x0);var events={'afterCreate':_0x46c0('0x4'),'afterUpdate':_0x46c0('0x5'),'afterDestroy':_0x46c0('0x6')};function emitEvent(_0x20a6a5){return function(_0x65e85c,_0x3aca99,_0x59b2fe){WhatsappQueueEvents[_0x46c0('0x7')](_0x20a6a5+':'+_0x65e85c['id'],_0x65e85c);WhatsappQueueEvents[_0x46c0('0x7')](_0x20a6a5,_0x65e85c);_0x59b2fe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x46c0('0x8')](e,emitEvent(event));}}module[_0x46c0('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
index 03d595d..ddf6283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','WhatsappQueue','lodash'];(function(_0x23d4c6,_0x3417dd){var _0x3cc112=function(_0x53422d){while(--_0x53422d){_0x23d4c6['push'](_0x23d4c6['shift']());}};_0x3cc112(++_0x3417dd);}(_0xfd28,0x8f));var _0x8fd2=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xfd28[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x8fd2('0x0'));var util=require('util');var logger=require(_0x8fd2('0x1'))(_0x8fd2('0x2'));var moment=require(_0x8fd2('0x3'));var BPromise=require(_0x8fd2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fd2('0x5'));var config=require(_0x8fd2('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x3fe593,_0x3fe53c){return _0x3fe593[_0x8fd2('0x7')](_0x8fd2('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cfd=['define','WhatsappQueue','whatsapp_queues','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x1726e1,_0x1cc1f4){var _0x44eccc=function(_0x29d671){while(--_0x29d671){_0x1726e1['push'](_0x1726e1['shift']());}};_0x44eccc(++_0x1cc1f4);}(_0x6cfd,0x19a));var _0xd6cf=function(_0x42aea3,_0x12f4db){_0x42aea3=_0x42aea3-0x0;var _0x375ca0=_0x6cfd[_0x42aea3];return _0x375ca0;};'use strict';var _=require('lodash');var util=require(_0xd6cf('0x0'));var logger=require(_0xd6cf('0x1'))('api');var moment=require(_0xd6cf('0x2'));var BPromise=require(_0xd6cf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6cf('0x4'));var config=require(_0xd6cf('0x5'));var attributes=require(_0xd6cf('0x6'));module[_0xd6cf('0x7')]=function(_0x389cac,_0x1ae4b1){return _0x389cac[_0xd6cf('0x8')](_0xd6cf('0x9'),attributes,{'tableName':_0xd6cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2724d79..ddd5e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f57=['model','find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','raw','options','where','attributes','include','map'];(function(_0x4bc25b,_0x28ca80){var _0x5289cc=function(_0x2cd985){while(--_0x2cd985){_0x4bc25b['push'](_0x4bc25b['shift']());}};_0x5289cc(++_0x28ca80);}(_0x5f57,0xd0));var _0x75f5=function(_0x2ffe0b,_0x574134){_0x2ffe0b=_0x2ffe0b-0x0;var _0x2d24a7=_0x5f57[_0x2ffe0b];return _0x2d24a7;};'use strict';var _=require(_0x75f5('0x0'));var util=require(_0x75f5('0x1'));var moment=require(_0x75f5('0x2'));var BPromise=require(_0x75f5('0x3'));var rs=require(_0x75f5('0x4'));var fs=require('fs');var Redis=require(_0x75f5('0x5'));var db=require(_0x75f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x75f5('0x7'))('rpc');var config=require(_0x75f5('0x8'));var jayson=require(_0x75f5('0x9'));var client=jayson['client'][_0x75f5('0xa')]({'port':0x232a});config[_0x75f5('0xb')]=_[_0x75f5('0xc')](config['redis'],{'host':_0x75f5('0xd'),'port':0x18eb});var socket=require(_0x75f5('0xe'))(new Redis(config[_0x75f5('0xb')]));require(_0x75f5('0xf'))[_0x75f5('0x10')](socket);function respondWithRpcPromise(_0x56513b,_0x53aee6,_0x34dc4f){return new BPromise(function(_0x2c4c4b,_0xbb1475){return client[_0x75f5('0x11')](_0x56513b,_0x34dc4f)[_0x75f5('0x12')](function(_0x30cf08){logger[_0x75f5('0x13')](_0x75f5('0x14'),_0x53aee6,_0x75f5('0x15'));logger[_0x75f5('0x16')](_0x75f5('0x17'),_0x53aee6,'request\x20sent',JSON[_0x75f5('0x18')](_0x30cf08));if(_0x30cf08[_0x75f5('0x19')]){if(_0x30cf08[_0x75f5('0x19')][_0x75f5('0x1a')]===0x1f4){logger[_0x75f5('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x53aee6,_0x30cf08['error'][_0x75f5('0x1b')]);return _0xbb1475(_0x30cf08[_0x75f5('0x19')][_0x75f5('0x1b')]);}logger['error'](_0x75f5('0x14'),_0x53aee6,_0x30cf08[_0x75f5('0x19')][_0x75f5('0x1b')]);return _0x2c4c4b(_0x30cf08[_0x75f5('0x19')][_0x75f5('0x1b')]);}else{logger[_0x75f5('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x53aee6,_0x75f5('0x15'));_0x2c4c4b(_0x30cf08['result']['message']);}})[_0x75f5('0x1c')](function(_0x474c84){logger[_0x75f5('0x19')](_0x75f5('0x14'),_0x53aee6,_0x474c84);_0xbb1475(_0x474c84);});});}exports[_0x75f5('0x1d')]=function(_0x514a58){var _0x272e49=this;return new Promise(function(_0x5d493f,_0x4e809f){return db[_0x75f5('0x1e')][_0x75f5('0x1f')]({'raw':_0x514a58['options']?_0x514a58['options'][_0x75f5('0x20')]===undefined?!![]:![]:!![],'where':_0x514a58[_0x75f5('0x21')]?_0x514a58['options'][_0x75f5('0x22')]||null:null,'attributes':_0x514a58[_0x75f5('0x21')]?_0x514a58[_0x75f5('0x21')][_0x75f5('0x23')]||null:null,'limit':_0x514a58['options']?_0x514a58[_0x75f5('0x21')]['limit']||null:null,'include':_0x514a58[_0x75f5('0x21')]?_0x514a58['options'][_0x75f5('0x24')]?_[_0x75f5('0x25')](_0x514a58['options'][_0x75f5('0x24')],function(_0x8e89b3){return{'model':db[_0x8e89b3[_0x75f5('0x26')]],'as':_0x8e89b3['as'],'attributes':_0x8e89b3['attributes'],'include':_0x8e89b3[_0x75f5('0x24')]?_[_0x75f5('0x25')](_0x8e89b3[_0x75f5('0x24')],function(_0x14a883){return{'model':db[_0x14a883[_0x75f5('0x26')]],'as':_0x14a883['as'],'attributes':_0x14a883[_0x75f5('0x23')],'include':_0x14a883[_0x75f5('0x24')]?_[_0x75f5('0x25')](_0x14a883[_0x75f5('0x24')],function(_0x1af68a){return{'model':db[_0x1af68a['model']],'as':_0x1af68a['as'],'attributes':_0x1af68a[_0x75f5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x75f5('0x12')](function(_0x412c2c){logger[_0x75f5('0x13')](_0x75f5('0x1d'),_0x514a58);logger[_0x75f5('0x16')](_0x75f5('0x1d'),_0x514a58,JSON[_0x75f5('0x18')](_0x412c2c));_0x5d493f(_0x412c2c);})['catch'](function(_0x11e4f7){logger['error'](_0x75f5('0x1d'),_0x11e4f7[_0x75f5('0x1b')],_0x514a58);_0x4e809f(_0x272e49[_0x75f5('0x19')](0x1f4,_0x11e4f7[_0x75f5('0x1b')]));});});};exports['ShowWhatsappQueue']=function(_0x281911){var _0x12feb9=this;return new Promise(function(_0x43bf9a,_0x5dca02){return db[_0x75f5('0x1e')][_0x75f5('0x27')]({'raw':_0x281911[_0x75f5('0x21')]?_0x281911[_0x75f5('0x21')][_0x75f5('0x20')]===undefined?!![]:![]:!![],'where':_0x281911['options']?_0x281911[_0x75f5('0x21')]['where']||null:null,'attributes':_0x281911[_0x75f5('0x21')]?_0x281911[_0x75f5('0x21')]['attributes']||null:null,'include':_0x281911[_0x75f5('0x21')]?_0x281911[_0x75f5('0x21')][_0x75f5('0x24')]?_[_0x75f5('0x25')](_0x281911[_0x75f5('0x21')][_0x75f5('0x24')],function(_0x234596){return{'model':db[_0x234596['model']],'as':_0x234596['as'],'attributes':_0x234596[_0x75f5('0x23')],'include':_0x234596[_0x75f5('0x24')]?_[_0x75f5('0x25')](_0x234596[_0x75f5('0x24')],function(_0x3b3495){return{'model':db[_0x3b3495[_0x75f5('0x26')]],'as':_0x3b3495['as'],'attributes':_0x3b3495[_0x75f5('0x23')],'include':_0x3b3495['include']?_['map'](_0x3b3495[_0x75f5('0x24')],function(_0x518262){return{'model':db[_0x518262[_0x75f5('0x26')]],'as':_0x518262['as'],'attributes':_0x518262[_0x75f5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x75f5('0x12')](function(_0x14d570){logger[_0x75f5('0x13')](_0x75f5('0x28'),_0x281911);logger['debug'](_0x75f5('0x28'),_0x281911,JSON[_0x75f5('0x18')](_0x14d570));_0x43bf9a(_0x14d570);})[_0x75f5('0x1c')](function(_0x24e77f){logger['error'](_0x75f5('0x28'),_0x24e77f[_0x75f5('0x1b')],_0x281911);_0x5dca02(_0x12feb9['error'](0x1f4,_0x24e77f['message']));});});};
\ No newline at end of file
+var _0xd72f=['./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','raw','options','include','model','map','attributes','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x6cef73,_0x59143a){var _0x462a1c=function(_0x34a312){while(--_0x34a312){_0x6cef73['push'](_0x6cef73['shift']());}};_0x462a1c(++_0x59143a);}(_0xd72f,0x96));var _0xfd72=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xd72f[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xfd72('0x0'));var util=require(_0xfd72('0x1'));var moment=require(_0xfd72('0x2'));var BPromise=require(_0xfd72('0x3'));var rs=require(_0xfd72('0x4'));var fs=require('fs');var Redis=require(_0xfd72('0x5'));var db=require(_0xfd72('0x6'))['db'];var utils=require(_0xfd72('0x7'));var logger=require(_0xfd72('0x8'))(_0xfd72('0x9'));var config=require(_0xfd72('0xa'));var jayson=require(_0xfd72('0xb'));var client=jayson[_0xfd72('0xc')][_0xfd72('0xd')]({'port':0x232a});config['redis']=_[_0xfd72('0xe')](config[_0xfd72('0xf')],{'host':_0xfd72('0x10'),'port':0x18eb});var socket=require(_0xfd72('0x11'))(new Redis(config[_0xfd72('0xf')]));require(_0xfd72('0x12'))['register'](socket);function respondWithRpcPromise(_0x53c80d,_0x4eb7ae,_0x55ea21){return new BPromise(function(_0x5bcd83,_0x3dd834){return client['request'](_0x53c80d,_0x55ea21)[_0xfd72('0x13')](function(_0x368e1e){logger['info'](_0xfd72('0x14'),_0x4eb7ae,_0xfd72('0x15'));logger[_0xfd72('0x16')](_0xfd72('0x17'),_0x4eb7ae,_0xfd72('0x15'),JSON[_0xfd72('0x18')](_0x368e1e));if(_0x368e1e[_0xfd72('0x19')]){if(_0x368e1e[_0xfd72('0x19')][_0xfd72('0x1a')]===0x1f4){logger[_0xfd72('0x19')](_0xfd72('0x14'),_0x4eb7ae,_0x368e1e[_0xfd72('0x19')]['message']);return _0x3dd834(_0x368e1e[_0xfd72('0x19')][_0xfd72('0x1b')]);}logger[_0xfd72('0x19')](_0xfd72('0x14'),_0x4eb7ae,_0x368e1e[_0xfd72('0x19')][_0xfd72('0x1b')]);return _0x5bcd83(_0x368e1e[_0xfd72('0x19')][_0xfd72('0x1b')]);}else{logger[_0xfd72('0x1c')]('WhatsappQueue,\x20%s,\x20%s',_0x4eb7ae,_0xfd72('0x15'));_0x5bcd83(_0x368e1e[_0xfd72('0x1d')][_0xfd72('0x1b')]);}})[_0xfd72('0x1e')](function(_0x4e8810){logger[_0xfd72('0x19')](_0xfd72('0x14'),_0x4eb7ae,_0x4e8810);_0x3dd834(_0x4e8810);});});}exports[_0xfd72('0x1f')]=function(_0x5c814a){var _0x252f64=this;return new Promise(function(_0x552039,_0x433b05){return db[_0xfd72('0x20')]['findAll']({'raw':_0x5c814a['options']?_0x5c814a['options'][_0xfd72('0x21')]===undefined?!![]:![]:!![],'where':_0x5c814a[_0xfd72('0x22')]?_0x5c814a['options']['where']||null:null,'attributes':_0x5c814a[_0xfd72('0x22')]?_0x5c814a[_0xfd72('0x22')]['attributes']||null:null,'limit':_0x5c814a[_0xfd72('0x22')]?_0x5c814a['options']['limit']||null:null,'include':_0x5c814a[_0xfd72('0x22')]?_0x5c814a[_0xfd72('0x22')][_0xfd72('0x23')]?_['map'](_0x5c814a[_0xfd72('0x22')]['include'],function(_0x3ee37d){return{'model':db[_0x3ee37d[_0xfd72('0x24')]],'as':_0x3ee37d['as'],'attributes':_0x3ee37d['attributes'],'include':_0x3ee37d[_0xfd72('0x23')]?_[_0xfd72('0x25')](_0x3ee37d[_0xfd72('0x23')],function(_0x4b93e8){return{'model':db[_0x4b93e8['model']],'as':_0x4b93e8['as'],'attributes':_0x4b93e8[_0xfd72('0x26')],'include':_0x4b93e8[_0xfd72('0x23')]?_[_0xfd72('0x25')](_0x4b93e8[_0xfd72('0x23')],function(_0x345e84){return{'model':db[_0x345e84[_0xfd72('0x24')]],'as':_0x345e84['as'],'attributes':_0x345e84[_0xfd72('0x26')]};}):[]};}):[]};}):[]:[]})[_0xfd72('0x13')](function(_0x449764){logger[_0xfd72('0x1c')](_0xfd72('0x1f'),_0x5c814a);logger['debug'](_0xfd72('0x1f'),_0x5c814a,JSON[_0xfd72('0x18')](_0x449764));_0x552039(_0x449764);})['catch'](function(_0x148765){logger[_0xfd72('0x19')](_0xfd72('0x1f'),_0x148765[_0xfd72('0x1b')],_0x5c814a);_0x433b05(_0x252f64[_0xfd72('0x19')](0x1f4,_0x148765['message']));});});};exports[_0xfd72('0x27')]=function(_0x4634f2){var _0x2517b3=this;return new Promise(function(_0x471057,_0x54c653){return db[_0xfd72('0x20')][_0xfd72('0x28')]({'raw':_0x4634f2[_0xfd72('0x22')]?_0x4634f2[_0xfd72('0x22')][_0xfd72('0x21')]===undefined?!![]:![]:!![],'where':_0x4634f2['options']?_0x4634f2[_0xfd72('0x22')][_0xfd72('0x29')]||null:null,'attributes':_0x4634f2[_0xfd72('0x22')]?_0x4634f2[_0xfd72('0x22')]['attributes']||null:null,'include':_0x4634f2['options']?_0x4634f2[_0xfd72('0x22')][_0xfd72('0x23')]?_[_0xfd72('0x25')](_0x4634f2[_0xfd72('0x22')][_0xfd72('0x23')],function(_0x6d35b0){return{'model':db[_0x6d35b0[_0xfd72('0x24')]],'as':_0x6d35b0['as'],'attributes':_0x6d35b0[_0xfd72('0x26')],'include':_0x6d35b0[_0xfd72('0x23')]?_['map'](_0x6d35b0[_0xfd72('0x23')],function(_0x168b51){return{'model':db[_0x168b51['model']],'as':_0x168b51['as'],'attributes':_0x168b51[_0xfd72('0x26')],'include':_0x168b51[_0xfd72('0x23')]?_[_0xfd72('0x25')](_0x168b51['include'],function(_0x2deb20){return{'model':db[_0x2deb20[_0xfd72('0x24')]],'as':_0x2deb20['as'],'attributes':_0x2deb20[_0xfd72('0x26')]};}):[]};}):[]};}):[]:[]})[_0xfd72('0x13')](function(_0x50a4ca){logger[_0xfd72('0x1c')](_0xfd72('0x27'),_0x4634f2);logger[_0xfd72('0x16')]('ShowWhatsappQueue',_0x4634f2,JSON['stringify'](_0x50a4ca));_0x471057(_0x50a4ca);})[_0xfd72('0x1e')](function(_0x408633){logger['error'](_0xfd72('0x27'),_0x408633[_0xfd72('0x1b')],_0x4634f2);_0x54c653(_0x2517b3[_0xfd72('0x19')](0x1f4,_0x408633[_0xfd72('0x1b')]));});});};
\ No newline at end of file
index 58dbf97..7cf8b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ba=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x11ba,0xc3));var _0xa11b=function(_0x22c010,_0x4b63f2){_0x22c010=_0x22c010-0x0;var _0x3f3be7=_0x11ba[_0x22c010];return _0x3f3be7;};'use strict';var WhatsappQueueEvents=require(_0xa11b('0x0'));var events=[_0xa11b('0x1'),_0xa11b('0x2'),_0xa11b('0x3')];function createListener(_0x206c3d,_0x20a181){return function(_0x4410f1){_0x20a181[_0xa11b('0x4')](_0x206c3d,_0x4410f1);};}function removeListener(_0x161cbf,_0x287ff9){return function(){WhatsappQueueEvents[_0xa11b('0x5')](_0x161cbf,_0x287ff9);};}exports[_0xa11b('0x6')]=function(_0x41be4a){for(var _0x3d3a6e=0x0,_0x1e8410=events[_0xa11b('0x7')];_0x3d3a6e<_0x1e8410;_0x3d3a6e++){var _0x11f101=events[_0x3d3a6e];var _0x1e5148=createListener(_0xa11b('0x8')+_0x11f101,_0x41be4a);WhatsappQueueEvents['on'](_0x11f101,_0x1e5148);}};
\ No newline at end of file
+var _0xb9fb=['whatsappQueue:','save','remove','update','emit','register','length'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb9fb,0x119));var _0xbb9f=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb9fb[_0x2ec461];return _0x28603d;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xbb9f('0x0'),_0xbb9f('0x1'),_0xbb9f('0x2')];function createListener(_0x4087d6,_0x1e4604){return function(_0xe12120){_0x1e4604[_0xbb9f('0x3')](_0x4087d6,_0xe12120);};}function removeListener(_0x23540d,_0x3b1c28){return function(){WhatsappQueueEvents['removeListener'](_0x23540d,_0x3b1c28);};}exports[_0xbb9f('0x4')]=function(_0x5c2a6){for(var _0x2bd14a=0x0,_0x104752=events[_0xbb9f('0x5')];_0x2bd14a<_0x104752;_0x2bd14a++){var _0x584c32=events[_0x2bd14a];var _0x34f380=createListener(_0xbb9f('0x6')+_0x584c32,_0x5c2a6);WhatsappQueueEvents['on'](_0x584c32,_0x34f380);}};
\ No newline at end of file
index aa631cc..b6aa37a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb687=['create','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','post'];(function(_0x53e738,_0x3ee43e){var _0x5365c2=function(_0x12632f){while(--_0x12632f){_0x53e738['push'](_0x53e738['shift']());}};_0x5365c2(++_0x3ee43e);}(_0xb687,0xc7));var _0x7b68=function(_0x37a980,_0x4984cf){_0x37a980=_0x37a980-0x0;var _0x1e1297=_0xb687[_0x37a980];return _0x1e1297;};'use strict';var multer=require('multer');var util=require(_0x7b68('0x0'));var path=require('path');var timeout=require(_0x7b68('0x1'));var express=require('express');var router=express[_0x7b68('0x2')]();var fs_extra=require(_0x7b68('0x3'));var auth=require(_0x7b68('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x7b68('0x5')]('/',auth[_0x7b68('0x6')](),controller['index']);router['get'](_0x7b68('0x7'),auth['isAuthenticated'](),controller[_0x7b68('0x8')]);router[_0x7b68('0x5')](_0x7b68('0x9'),auth[_0x7b68('0x6')](),controller['show']);router[_0x7b68('0xa')]('/',auth[_0x7b68('0x6')](),controller[_0x7b68('0xb')]);router['put'](_0x7b68('0x9'),auth[_0x7b68('0x6')](),controller[_0x7b68('0xc')]);router[_0x7b68('0xd')](_0x7b68('0x9'),auth['isAuthenticated'](),controller[_0x7b68('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x8d5b=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy'];(function(_0x2bff66,_0x202605){var _0x4677dd=function(_0x3ef8f3){while(--_0x3ef8f3){_0x2bff66['push'](_0x2bff66['shift']());}};_0x4677dd(++_0x202605);}(_0x8d5b,0x8c));var _0xb8d5=function(_0x4c9191,_0xe10c76){_0x4c9191=_0x4c9191-0x0;var _0x593642=_0x8d5b[_0x4c9191];return _0x593642;};'use strict';var multer=require(_0xb8d5('0x0'));var util=require(_0xb8d5('0x1'));var path=require(_0xb8d5('0x2'));var timeout=require('connect-timeout');var express=require(_0xb8d5('0x3'));var router=express['Router']();var fs_extra=require(_0xb8d5('0x4'));var auth=require(_0xb8d5('0x5'));var interaction=require(_0xb8d5('0x6'));var config=require(_0xb8d5('0x7'));var controller=require(_0xb8d5('0x8'));router[_0xb8d5('0x9')]('/',auth[_0xb8d5('0xa')](),controller[_0xb8d5('0xb')]);router[_0xb8d5('0x9')](_0xb8d5('0xc'),auth[_0xb8d5('0xa')](),controller['describe']);router[_0xb8d5('0x9')](_0xb8d5('0xd'),auth['isAuthenticated'](),controller[_0xb8d5('0xe')]);router[_0xb8d5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb8d5('0x10')]('/:id',auth[_0xb8d5('0xa')](),controller[_0xb8d5('0x11')]);router[_0xb8d5('0x12')](_0xb8d5('0xd'),auth[_0xb8d5('0xa')](),controller[_0xb8d5('0x13')]);module['exports']=router;
\ No newline at end of file
index 3de4cbf..1d7d061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1c0bed,_0x51beeb){var _0x248bb4=function(_0x52de07){while(--_0x52de07){_0x1c0bed['push'](_0x1c0bed['shift']());}};_0x248bb4(++_0x51beeb);}(_0x7a54,0x106));var _0x47a5=function(_0x264721,_0x11b585){_0x264721=_0x264721-0x0;var _0x3093de=_0x7a54[_0x264721];return _0x3093de;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x586ccb,_0x5ebab5){var _0x139da9=function(_0x2503ea){while(--_0x2503ea){_0x586ccb['push'](_0x586ccb['shift']());}};_0x139da9(++_0x5ebab5);}(_0x7a54,0x106));var _0x47a5=function(_0x1e5bf9,_0x5ed025){_0x1e5bf9=_0x1e5bf9-0x0;var _0x3f8be5=_0x7a54[_0x1e5bf9];return _0x3f8be5;};'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
index ccc9fe1..43ff8cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd914=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xea59cb,_0x2b8eb4){var _0x59b495=function(_0x22f769){while(--_0x22f769){_0xea59cb['push'](_0xea59cb['shift']());}};_0x59b495(++_0x2b8eb4);}(_0xd914,0x17f));var _0x4d91=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0xd914[_0x367a3d];return _0x460539;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){_0x9cb864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee6b3,_0x112923){return function(_0x3bed98){if(!_0x3bed98){_0x1ee6b3[_0x4d91('0x28')](0x194);}return _0x3bed98;};}function handleError(_0x472f3a,_0x2c7d7a){_0x2c7d7a=_0x2c7d7a||0x1f4;return function(_0x14bdb4){logger['error'](_0x14bdb4[_0x4d91('0x29')]);if(_0x14bdb4[_0x4d91('0x2a')]){delete _0x14bdb4[_0x4d91('0x2a')];}_0x472f3a['status'](_0x2c7d7a)['send'](_0x14bdb4);};}exports[_0x4d91('0x2b')]=function(_0x470079,_0x5ed948){var _0x50fe76={},_0x42d5a0={},_0x2d6981={'count':0x0,'rows':[]};var _0x43371e=_[_0x4d91('0x2c')](db['WhatsappQueueReport'][_0x4d91('0x2d')],function(_0x31bbf8){return{'name':_0x31bbf8[_0x4d91('0x2e')],'type':_0x31bbf8[_0x4d91('0x2f')][_0x4d91('0x30')]};});_0x42d5a0[_0x4d91('0x31')]=_[_0x4d91('0x2c')](_0x43371e,'name');_0x42d5a0[_0x4d91('0x32')]=_['keys'](_0x470079['query']);_0x42d5a0[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x42d5a0['model'],_0x42d5a0[_0x4d91('0x32')]);_0x50fe76[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x42d5a0[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x470079['query'][_0x4d91('0x36')]));_0x50fe76[_0x4d91('0x35')]=_0x50fe76[_0x4d91('0x35')][_0x4d91('0x37')]?_0x50fe76[_0x4d91('0x35')]:_0x42d5a0[_0x4d91('0x31')];if(!_0x470079['query'][_0x4d91('0x38')](_0x4d91('0x39'))){_0x50fe76['limit']=qs[_0x4d91('0x3a')](_0x470079[_0x4d91('0x32')][_0x4d91('0x3a')]);_0x50fe76['offset']=qs[_0x4d91('0x1e')](_0x470079[_0x4d91('0x32')][_0x4d91('0x1e')]);}_0x50fe76[_0x4d91('0x3b')]=qs['sort'](_0x470079[_0x4d91('0x32')][_0x4d91('0x3c')]);_0x50fe76[_0x4d91('0x3d')]=qs[_0x4d91('0x33')](_['pick'](_0x470079['query'],_0x42d5a0[_0x4d91('0x33')]),_0x43371e);if(_0x470079[_0x4d91('0x32')]['filter']){_0x50fe76[_0x4d91('0x3d')]=_[_0x4d91('0x3e')](_0x50fe76[_0x4d91('0x3d')],{'$or':_[_0x4d91('0x2c')](_0x43371e,function(_0x5d93c1){if(_0x5d93c1[_0x4d91('0x2f')]!==_0x4d91('0x3f')){var _0x571a0c={};_0x571a0c[_0x5d93c1[_0x4d91('0x2a')]]={'$like':'%'+_0x470079['query'][_0x4d91('0x40')]+'%'};return _0x571a0c;}})});}_0x50fe76=_['merge']({},_0x50fe76,_0x470079[_0x4d91('0x41')]);var _0x49742b={'where':_0x50fe76[_0x4d91('0x3d')]};return db[_0x4d91('0x42')][_0x4d91('0x20')](_0x49742b)[_0x4d91('0x26')](function(_0x4f6576){_0x2d6981['count']=_0x4f6576;if(_0x470079[_0x4d91('0x32')]['includeAll']){_0x50fe76[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x42')]['findAll'](_0x50fe76);})[_0x4d91('0x26')](function(_0x2ae356){_0x2d6981[_0x4d91('0x44')]=_0x2ae356;return _0x2d6981;})[_0x4d91('0x26')](respondWithFilteredResult(_0x5ed948,_0x50fe76))[_0x4d91('0x45')](handleError(_0x5ed948,null));};exports[_0x4d91('0x46')]=function(_0x23902f,_0x4f6254){var _0x1e4c6d={'raw':!![],'where':{'id':_0x23902f[_0x4d91('0x47')]['id']}},_0x4c70af={};_0x4c70af[_0x4d91('0x31')]=_[_0x4d91('0x48')](db[_0x4d91('0x42')][_0x4d91('0x2d')]);_0x4c70af[_0x4d91('0x32')]=_['keys'](_0x23902f['query']);_0x4c70af[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x4c70af['model'],_0x4c70af[_0x4d91('0x32')]);_0x1e4c6d[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x4c70af[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x23902f[_0x4d91('0x32')][_0x4d91('0x36')]));_0x1e4c6d[_0x4d91('0x35')]=_0x1e4c6d[_0x4d91('0x35')]['length']?_0x1e4c6d['attributes']:_0x4c70af[_0x4d91('0x31')];if(_0x23902f['query'][_0x4d91('0x49')]){_0x1e4c6d[_0x4d91('0x43')]=[{'all':!![]}];}_0x1e4c6d=_[_0x4d91('0x3e')]({},_0x1e4c6d,_0x23902f[_0x4d91('0x41')]);return db['WhatsappQueueReport'][_0x4d91('0x4a')](_0x1e4c6d)['then'](handleEntityNotFound(_0x4f6254,null))['then'](respondWithResult(_0x4f6254,null))[_0x4d91('0x45')](handleError(_0x4f6254,null));};exports[_0x4d91('0x4b')]=function(_0x18073d,_0xa03d75){return db[_0x4d91('0x42')][_0x4d91('0x4b')](_0x18073d['body'],{})[_0x4d91('0x26')](respondWithResult(_0xa03d75,0xc9))[_0x4d91('0x45')](handleError(_0xa03d75,null));};exports[_0x4d91('0x25')]=function(_0x449dd8,_0x106e5b){if(_0x449dd8[_0x4d91('0x4c')]['id']){delete _0x449dd8[_0x4d91('0x4c')]['id'];}return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x449dd8[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x106e5b,null))['then'](saveUpdates(_0x449dd8[_0x4d91('0x4c')],null))['then'](respondWithResult(_0x106e5b,null))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x27')]=function(_0x195e65,_0x386935){return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x195e65[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x386935,null))['then'](removeEntity(_0x386935,null))[_0x4d91('0x45')](handleError(_0x386935,null));};exports[_0x4d91('0x4d')]=function(_0x3fe9ee,_0x2bba43){return db[_0x4d91('0x42')][_0x4d91('0x4d')]()[_0x4d91('0x26')](respondWithResult(_0x2bba43,null))['catch'](handleError(_0x2bba43,null));};
\ No newline at end of file
+var _0x4fc2=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','error','name','send','index','map','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4fc2,0x111));var _0x24fc=function(_0x53056c,_0x1d56a9){_0x53056c=_0x53056c-0x0;var _0x5cec88=_0x4fc2[_0x53056c];return _0x5cec88;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];function respondWithStatusCode(_0x5cc65e,_0x306873){_0x306873=_0x306873||0xcc;return function(_0x76cb25){if(_0x76cb25){return _0x5cc65e[_0x24fc('0x1b')](_0x306873);}return _0x5cc65e[_0x24fc('0x1c')](_0x306873)[_0x24fc('0x1d')]();};}function respondWithResult(_0x326276,_0x537b5c){_0x537b5c=_0x537b5c||0xc8;return function(_0x2a0971){if(_0x2a0971){return _0x326276[_0x24fc('0x1c')](_0x537b5c)[_0x24fc('0x1e')](_0x2a0971);}};}function respondWithFilteredResult(_0x42cbe8,_0x4acd36){return function(_0x2ac989){if(_0x2ac989){var _0x588543=typeof _0x4acd36[_0x24fc('0x1f')]===_0x24fc('0x20')&&typeof _0x4acd36[_0x24fc('0x21')]===_0x24fc('0x20');var _0x25cb40=_0x2ac989['count'];var _0x23873c=_0x588543?0x0:_0x4acd36[_0x24fc('0x1f')];var _0x6cfa0a=_0x588543?_0x2ac989[_0x24fc('0x22')]:_0x4acd36['offset']+_0x4acd36[_0x24fc('0x21')];var _0x4073e0;if(_0x6cfa0a>=_0x25cb40){_0x6cfa0a=_0x25cb40;_0x4073e0=0xc8;}else{_0x4073e0=0xce;}_0x42cbe8[_0x24fc('0x1c')](_0x4073e0);return _0x42cbe8['set'](_0x24fc('0x23'),_0x23873c+'-'+_0x6cfa0a+'/'+_0x25cb40)[_0x24fc('0x1e')](_0x2ac989);}return null;};}function patchUpdates(_0xbf1d6b){return function(_0x2d0e3d){try{jsonpatch['apply'](_0x2d0e3d,_0xbf1d6b,!![]);}catch(_0x323beb){return BPromise['reject'](_0x323beb);}return _0x2d0e3d[_0x24fc('0x24')]();};}function saveUpdates(_0x591c8f,_0x3ed464){return function(_0x44c121){if(_0x44c121){return _0x44c121[_0x24fc('0x25')](_0x591c8f)['then'](function(_0x313a25){return _0x313a25;});}return null;};}function removeEntity(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(_0x2bb93a){return _0x2bb93a[_0x24fc('0x26')]()[_0x24fc('0x27')](function(){_0x552035[_0x24fc('0x1c')](0xcc)[_0x24fc('0x1d')]();});}};}function handleEntityNotFound(_0x3f0875,_0x20192b){return function(_0x168d98){if(!_0x168d98){_0x3f0875[_0x24fc('0x1b')](0x194);}return _0x168d98;};}function handleError(_0x568441,_0x11c913){_0x11c913=_0x11c913||0x1f4;return function(_0x16f27f){logger[_0x24fc('0x28')](_0x16f27f['stack']);if(_0x16f27f[_0x24fc('0x29')]){delete _0x16f27f[_0x24fc('0x29')];}_0x568441[_0x24fc('0x1c')](_0x11c913)[_0x24fc('0x2a')](_0x16f27f);};}exports[_0x24fc('0x2b')]=function(_0x443796,_0x5ac1f2){var _0x240ae7={},_0x29a461={},_0x3c99ed={'count':0x0,'rows':[]};var _0x1c5146=_[_0x24fc('0x2c')](db['WhatsappQueueReport']['rawAttributes'],function(_0x4e6f73){return{'name':_0x4e6f73[_0x24fc('0x2d')],'type':_0x4e6f73['type'][_0x24fc('0x2e')]};});_0x29a461[_0x24fc('0x2f')]=_[_0x24fc('0x2c')](_0x1c5146,_0x24fc('0x29'));_0x29a461['query']=_[_0x24fc('0x30')](_0x443796[_0x24fc('0x31')]);_0x29a461['filters']=_[_0x24fc('0x32')](_0x29a461[_0x24fc('0x2f')],_0x29a461['query']);_0x240ae7['attributes']=_[_0x24fc('0x32')](_0x29a461['model'],qs[_0x24fc('0x33')](_0x443796[_0x24fc('0x31')]['fields']));_0x240ae7[_0x24fc('0x34')]=_0x240ae7[_0x24fc('0x34')][_0x24fc('0x35')]?_0x240ae7[_0x24fc('0x34')]:_0x29a461[_0x24fc('0x2f')];if(!_0x443796[_0x24fc('0x31')][_0x24fc('0x36')](_0x24fc('0x37'))){_0x240ae7[_0x24fc('0x21')]=qs['limit'](_0x443796[_0x24fc('0x31')][_0x24fc('0x21')]);_0x240ae7[_0x24fc('0x1f')]=qs[_0x24fc('0x1f')](_0x443796[_0x24fc('0x31')]['offset']);}_0x240ae7['order']=qs[_0x24fc('0x38')](_0x443796['query'][_0x24fc('0x38')]);_0x240ae7[_0x24fc('0x39')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x3b')](_0x443796['query'],_0x29a461[_0x24fc('0x3a')]),_0x1c5146);if(_0x443796['query'][_0x24fc('0x3c')]){_0x240ae7[_0x24fc('0x39')]=_[_0x24fc('0x3d')](_0x240ae7[_0x24fc('0x39')],{'$or':_[_0x24fc('0x2c')](_0x1c5146,function(_0x508aaf){if(_0x508aaf[_0x24fc('0x3e')]!==_0x24fc('0x3f')){var _0x2181f7={};_0x2181f7[_0x508aaf[_0x24fc('0x29')]]={'$like':'%'+_0x443796['query'][_0x24fc('0x3c')]+'%'};return _0x2181f7;}})});}_0x240ae7=_[_0x24fc('0x3d')]({},_0x240ae7,_0x443796['options']);var _0xf40435={'where':_0x240ae7['where']};return db[_0x24fc('0x40')][_0x24fc('0x22')](_0xf40435)[_0x24fc('0x27')](function(_0x1e045a){_0x3c99ed[_0x24fc('0x22')]=_0x1e045a;if(_0x443796[_0x24fc('0x31')][_0x24fc('0x41')]){_0x240ae7[_0x24fc('0x42')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x24fc('0x43')](_0x240ae7);})[_0x24fc('0x27')](function(_0x32f72c){_0x3c99ed['rows']=_0x32f72c;return _0x3c99ed;})[_0x24fc('0x27')](respondWithFilteredResult(_0x5ac1f2,_0x240ae7))[_0x24fc('0x44')](handleError(_0x5ac1f2,null));};exports['show']=function(_0x2c4a6c,_0x22f30b){var _0x2c598c={'raw':!![],'where':{'id':_0x2c4a6c[_0x24fc('0x45')]['id']}},_0x5e4e9b={};_0x5e4e9b[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x40')][_0x24fc('0x46')]);_0x5e4e9b[_0x24fc('0x31')]=_[_0x24fc('0x30')](_0x2c4a6c['query']);_0x5e4e9b[_0x24fc('0x3a')]=_[_0x24fc('0x32')](_0x5e4e9b[_0x24fc('0x2f')],_0x5e4e9b[_0x24fc('0x31')]);_0x2c598c[_0x24fc('0x34')]=_['intersection'](_0x5e4e9b[_0x24fc('0x2f')],qs[_0x24fc('0x33')](_0x2c4a6c[_0x24fc('0x31')][_0x24fc('0x33')]));_0x2c598c['attributes']=_0x2c598c[_0x24fc('0x34')][_0x24fc('0x35')]?_0x2c598c['attributes']:_0x5e4e9b['model'];if(_0x2c4a6c[_0x24fc('0x31')]['includeAll']){_0x2c598c['include']=[{'all':!![]}];}_0x2c598c=_[_0x24fc('0x3d')]({},_0x2c598c,_0x2c4a6c['options']);return db[_0x24fc('0x40')][_0x24fc('0x47')](_0x2c598c)[_0x24fc('0x27')](handleEntityNotFound(_0x22f30b,null))['then'](respondWithResult(_0x22f30b,null))[_0x24fc('0x44')](handleError(_0x22f30b,null));};exports[_0x24fc('0x48')]=function(_0x1b1f1c,_0x1ad8d6){return db[_0x24fc('0x40')][_0x24fc('0x48')](_0x1b1f1c[_0x24fc('0x49')],{})[_0x24fc('0x27')](respondWithResult(_0x1ad8d6,0xc9))['catch'](handleError(_0x1ad8d6,null));};exports['update']=function(_0x266378,_0x2f1a99){if(_0x266378[_0x24fc('0x49')]['id']){delete _0x266378['body']['id'];}return db['WhatsappQueueReport'][_0x24fc('0x47')]({'where':{'id':_0x266378[_0x24fc('0x45')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x2f1a99,null))[_0x24fc('0x27')](saveUpdates(_0x266378[_0x24fc('0x49')],null))[_0x24fc('0x27')](respondWithResult(_0x2f1a99,null))[_0x24fc('0x44')](handleError(_0x2f1a99,null));};exports[_0x24fc('0x26')]=function(_0x1671b0,_0x4574d3){return db[_0x24fc('0x40')][_0x24fc('0x47')]({'where':{'id':_0x1671b0['params']['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x4574d3,null))[_0x24fc('0x27')](removeEntity(_0x4574d3,null))[_0x24fc('0x44')](handleError(_0x4574d3,null));};exports[_0x24fc('0x4a')]=function(_0x370b6c,_0x5bdc4d){return db[_0x24fc('0x40')]['describe']()[_0x24fc('0x27')](respondWithResult(_0x5bdc4d,null))[_0x24fc('0x44')](handleError(_0x5bdc4d,null));};
\ No newline at end of file
index e6431a3..4e347b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2380=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x2e6308,_0x2f70fa){var _0x137c8f=function(_0x2ea2a4){while(--_0x2ea2a4){_0x2e6308['push'](_0x2e6308['shift']());}};_0x137c8f(++_0x2f70fa);}(_0x2380,0x1da));var _0x0238=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x2380[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0238('0x0'));var util=require(_0x0238('0x1'));var logger=require(_0x0238('0x2'))(_0x0238('0x3'));var moment=require('moment');var BPromise=require(_0x0238('0x4'));var rp=require(_0x0238('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0238('0x6'));var attributes=require(_0x0238('0x7'));module[_0x0238('0x8')]=function(_0x546fa8,_0x2e9106){return _0x546fa8[_0x0238('0x9')](_0x0238('0xa'),attributes,{'tableName':_0x0238('0xb'),'paranoid':![],'indexes':[{'name':_0x0238('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbc3=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xcbc3,0xc5));var _0x3cbc=function(_0x5a33e5,_0xf91e32){_0x5a33e5=_0x5a33e5-0x0;var _0x3e73dd=_0xcbc3[_0x5a33e5];return _0x3e73dd;};'use strict';var _=require(_0x3cbc('0x0'));var util=require(_0x3cbc('0x1'));var logger=require(_0x3cbc('0x2'))(_0x3cbc('0x3'));var moment=require(_0x3cbc('0x4'));var BPromise=require(_0x3cbc('0x5'));var rp=require(_0x3cbc('0x6'));var fs=require('fs');var path=require(_0x3cbc('0x7'));var rimraf=require('rimraf');var config=require(_0x3cbc('0x8'));var attributes=require(_0x3cbc('0x9'));module[_0x3cbc('0xa')]=function(_0x3c9643,_0x33bed4){return _0x3c9643[_0x3cbc('0xb')](_0x3cbc('0xc'),attributes,{'tableName':_0x3cbc('0xd'),'paranoid':![],'indexes':[{'name':_0x3cbc('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 4f0d56c..e2bbfcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','catch','update','where','attributes','limit','then','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring'];(function(_0x2a5755,_0x17f587){var _0x1700da=function(_0x40c908){while(--_0x40c908){_0x2a5755['push'](_0x2a5755['shift']());}};_0x1700da(++_0x17f587);}(_0xdeb2,0x64));var _0x2deb=function(_0x22899b,_0x29900f){_0x22899b=_0x22899b-0x0;var _0x6506bc=_0xdeb2[_0x22899b];return _0x6506bc;};'use strict';var _=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var moment=require(_0x2deb('0x2'));var BPromise=require(_0x2deb('0x3'));var rs=require(_0x2deb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2deb('0x5'))['db'];var utils=require(_0x2deb('0x6'));var logger=require(_0x2deb('0x7'))(_0x2deb('0x8'));var config=require(_0x2deb('0x9'));var jayson=require(_0x2deb('0xa'));var client=jayson['client'][_0x2deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa082c1,_0xefa827,_0x296534){return new BPromise(function(_0x362ed9,_0x2ea587){return client[_0x2deb('0xc')](_0xa082c1,_0x296534)['then'](function(_0x3b463a){logger[_0x2deb('0xd')](_0x2deb('0xe'),_0xefa827,_0x2deb('0xf'));logger['debug'](_0x2deb('0x10'),_0xefa827,'request\x20sent',JSON[_0x2deb('0x11')](_0x3b463a));if(_0x3b463a[_0x2deb('0x12')]){if(_0x3b463a[_0x2deb('0x12')][_0x2deb('0x13')]===0x1f4){logger[_0x2deb('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0xefa827,_0x3b463a['error']['message']);return _0x2ea587(_0x3b463a[_0x2deb('0x12')][_0x2deb('0x14')]);}logger[_0x2deb('0x12')](_0x2deb('0xe'),_0xefa827,_0x3b463a['error'][_0x2deb('0x14')]);return _0x362ed9(_0x3b463a[_0x2deb('0x12')][_0x2deb('0x14')]);}else{logger[_0x2deb('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0xefa827,_0x2deb('0xf'));_0x362ed9(_0x3b463a[_0x2deb('0x15')]['message']);}})['catch'](function(_0x34d97f){logger[_0x2deb('0x12')](_0x2deb('0xe'),_0xefa827,_0x34d97f);_0x2ea587(_0x34d97f);});});}exports[_0x2deb('0x16')]=function(_0x29ab92){var _0xa82464=this;return new Promise(function(_0x446fde,_0x18568d){return db[_0x2deb('0x17')][_0x2deb('0x18')](_0x29ab92['body'],{'raw':_0x29ab92[_0x2deb('0x19')]?_0x29ab92[_0x2deb('0x19')][_0x2deb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x18fbae){logger[_0x2deb('0xd')](_0x2deb('0x16'),_0x29ab92);logger[_0x2deb('0x1b')](_0x2deb('0x16'),_0x29ab92,JSON[_0x2deb('0x11')](_0x18fbae));_0x446fde(_0x18fbae);})[_0x2deb('0x1c')](function(_0x6a1c94){logger[_0x2deb('0x12')]('CreateWhatsappQueueReport',_0x6a1c94[_0x2deb('0x14')],_0x29ab92);_0x18568d(_0xa82464[_0x2deb('0x12')](0x1f4,_0x6a1c94[_0x2deb('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x16b926){var _0x46a51a=this;return new Promise(function(_0x58d3f8,_0x516654){return db[_0x2deb('0x17')][_0x2deb('0x1d')](_0x16b926['body'],{'raw':_0x16b926[_0x2deb('0x19')]?_0x16b926[_0x2deb('0x19')][_0x2deb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16b926['options']?_0x16b926['options'][_0x2deb('0x1e')]||null:null,'attributes':_0x16b926[_0x2deb('0x19')]?_0x16b926['options'][_0x2deb('0x1f')]||null:null,'limit':_0x16b926[_0x2deb('0x19')]?_0x16b926['options'][_0x2deb('0x20')]||null:null})[_0x2deb('0x21')](function(_0x2068c1){logger[_0x2deb('0xd')](_0x2deb('0x22'),_0x16b926);logger[_0x2deb('0x1b')](_0x2deb('0x22'),_0x16b926,JSON[_0x2deb('0x11')](_0x2068c1));_0x58d3f8(_0x2068c1);})['catch'](function(_0x1ba5b8){logger['error'](_0x2deb('0x22'),_0x1ba5b8['message'],_0x16b926);_0x516654(_0x46a51a['error'](0x1f4,_0x1ba5b8[_0x2deb('0x14')]));});});};
\ No newline at end of file
+var _0x845c=['request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','then','UpdateWhatsappQueueReport','update','raw','limit','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ae705,_0xd48c8c){var _0x597c3f=function(_0x596e36){while(--_0x596e36){_0x3ae705['push'](_0x3ae705['shift']());}};_0x597c3f(++_0xd48c8c);}(_0x845c,0xdf));var _0xc845=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x845c[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xc845('0x0'));var moment=require('moment');var BPromise=require(_0xc845('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc845('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc845('0x3'));var logger=require(_0xc845('0x4'))(_0xc845('0x5'));var config=require(_0xc845('0x6'));var jayson=require(_0xc845('0x7'));var client=jayson['client'][_0xc845('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6ac06f,_0x442c47,_0x452e53){return new BPromise(function(_0x207d3a,_0x2902b9){return client[_0xc845('0x9')](_0x6ac06f,_0x452e53)['then'](function(_0x4a9a3d){logger[_0xc845('0xa')](_0xc845('0xb'),_0x442c47,_0xc845('0xc'));logger[_0xc845('0xd')](_0xc845('0xe'),_0x442c47,_0xc845('0xc'),JSON[_0xc845('0xf')](_0x4a9a3d));if(_0x4a9a3d[_0xc845('0x10')]){if(_0x4a9a3d[_0xc845('0x10')]['code']===0x1f4){logger[_0xc845('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x442c47,_0x4a9a3d[_0xc845('0x10')][_0xc845('0x11')]);return _0x2902b9(_0x4a9a3d['error'][_0xc845('0x11')]);}logger[_0xc845('0x10')](_0xc845('0xb'),_0x442c47,_0x4a9a3d[_0xc845('0x10')][_0xc845('0x11')]);return _0x207d3a(_0x4a9a3d[_0xc845('0x10')][_0xc845('0x11')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x442c47,_0xc845('0xc'));_0x207d3a(_0x4a9a3d[_0xc845('0x12')]['message']);}})[_0xc845('0x13')](function(_0x348cee){logger[_0xc845('0x10')](_0xc845('0xb'),_0x442c47,_0x348cee);_0x2902b9(_0x348cee);});});}exports[_0xc845('0x14')]=function(_0x50ea8d){var _0x307e37=this;return new Promise(function(_0x1f3330,_0x4da8db){return db[_0xc845('0x15')]['create'](_0x50ea8d[_0xc845('0x16')],{'raw':_0x50ea8d[_0xc845('0x17')]?_0x50ea8d[_0xc845('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc845('0x18')](function(_0x3b1764){logger['info'](_0xc845('0x14'),_0x50ea8d);logger['debug'](_0xc845('0x14'),_0x50ea8d,JSON['stringify'](_0x3b1764));_0x1f3330(_0x3b1764);})[_0xc845('0x13')](function(_0xb94ff4){logger[_0xc845('0x10')](_0xc845('0x14'),_0xb94ff4['message'],_0x50ea8d);_0x4da8db(_0x307e37['error'](0x1f4,_0xb94ff4[_0xc845('0x11')]));});});};exports[_0xc845('0x19')]=function(_0x196d34){var _0x32636a=this;return new Promise(function(_0x1d3b28,_0x5ef2c3){return db[_0xc845('0x15')][_0xc845('0x1a')](_0x196d34[_0xc845('0x16')],{'raw':_0x196d34['options']?_0x196d34['options'][_0xc845('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196d34['options']?_0x196d34[_0xc845('0x17')]['where']||null:null,'attributes':_0x196d34['options']?_0x196d34[_0xc845('0x17')]['attributes']||null:null,'limit':_0x196d34[_0xc845('0x17')]?_0x196d34[_0xc845('0x17')][_0xc845('0x1c')]||null:null})[_0xc845('0x18')](function(_0x29dda7){logger[_0xc845('0xa')](_0xc845('0x19'),_0x196d34);logger[_0xc845('0xd')](_0xc845('0x19'),_0x196d34,JSON[_0xc845('0xf')](_0x29dda7));_0x1d3b28(_0x29dda7);})[_0xc845('0x13')](function(_0x51e40a){logger['error']('UpdateWhatsappQueueReport',_0x51e40a[_0xc845('0x11')],_0x196d34);_0x5ef2c3(_0x32636a['error'](0x1f4,_0x51e40a[_0xc845('0x11')]));});});};
\ No newline at end of file
index fece8a7..c10af54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd275=['post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x12a66f,_0x30e98d){var _0x36a7d9=function(_0x235039){while(--_0x235039){_0x12a66f['push'](_0x12a66f['shift']());}};_0x36a7d9(++_0x30e98d);}(_0xd275,0xe3));var _0x5d27=function(_0x2fac00,_0x182456){_0x2fac00=_0x2fac00-0x0;var _0x10f666=_0xd275[_0x2fac00];return _0x10f666;};'use strict';var multer=require(_0x5d27('0x0'));var util=require('util');var path=require(_0x5d27('0x1'));var timeout=require(_0x5d27('0x2'));var express=require(_0x5d27('0x3'));var router=express[_0x5d27('0x4')]();var fs_extra=require(_0x5d27('0x5'));var auth=require(_0x5d27('0x6'));var interaction=require(_0x5d27('0x7'));var config=require(_0x5d27('0x8'));var controller=require(_0x5d27('0x9'));router[_0x5d27('0xa')]('/',auth[_0x5d27('0xb')](),controller[_0x5d27('0xc')]);router[_0x5d27('0xa')](_0x5d27('0xd'),auth['isAuthenticated'](),controller[_0x5d27('0xe')]);router[_0x5d27('0xa')]('/:id',auth[_0x5d27('0xb')](),controller['show']);router[_0x5d27('0xf')]('/',auth['isAuthenticated'](),controller[_0x5d27('0x10')]);router[_0x5d27('0x11')](_0x5d27('0x12'),auth[_0x5d27('0xb')](),controller[_0x5d27('0x13')]);router['delete']('/:id',auth[_0x5d27('0xb')](),controller[_0x5d27('0x14')]);module[_0x5d27('0x15')]=router;
\ No newline at end of file
+var _0x5e82=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x4b3438,_0x48d57d){var _0x2e12f1=function(_0x16255a){while(--_0x16255a){_0x4b3438['push'](_0x4b3438['shift']());}};_0x2e12f1(++_0x48d57d);}(_0x5e82,0xde));var _0x25e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e82[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x25e8('0x0'));var util=require(_0x25e8('0x1'));var path=require(_0x25e8('0x2'));var timeout=require(_0x25e8('0x3'));var express=require('express');var router=express[_0x25e8('0x4')]();var fs_extra=require(_0x25e8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x25e8('0x6'));var config=require(_0x25e8('0x7'));var controller=require(_0x25e8('0x8'));router[_0x25e8('0x9')]('/',auth[_0x25e8('0xa')](),controller[_0x25e8('0xb')]);router[_0x25e8('0x9')](_0x25e8('0xc'),auth[_0x25e8('0xa')](),controller['describe']);router['get'](_0x25e8('0xd'),auth[_0x25e8('0xa')](),controller[_0x25e8('0xe')]);router[_0x25e8('0xf')]('/',auth[_0x25e8('0xa')](),controller[_0x25e8('0x10')]);router[_0x25e8('0x11')](_0x25e8('0xd'),auth[_0x25e8('0xa')](),controller[_0x25e8('0x12')]);router[_0x25e8('0x13')](_0x25e8('0xd'),auth['isAuthenticated'](),controller[_0x25e8('0x14')]);module[_0x25e8('0x15')]=router;
\ No newline at end of file
index 3522bb0..3222415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['agent','queue','DATE','sequelize','exports','ENUM','account'];(function(_0x2e7698,_0x263551){var _0x120dde=function(_0x2c43ef){while(--_0x2c43ef){_0x2e7698['push'](_0x2e7698['shift']());}};_0x120dde(++_0x263551);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5caec4,_0x480e8f){_0x5caec4=_0x5caec4-0x0;var _0x5fca2a=_0xf4f4[_0x5caec4];return _0x5fca2a;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4f4f('0x2')](_0x4f4f('0x3'),_0x4f4f('0x4'),_0x4f4f('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4f4f('0x6')]}};
\ No newline at end of file
+var _0x6cb4=['exports','STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x3a6568,_0xd3df53){var _0x12b620=function(_0x17a52f){while(--_0x17a52f){_0x3a6568['push'](_0x3a6568['shift']());}};_0x12b620(++_0xd3df53);}(_0x6cb4,0xff));var _0x46cb=function(_0x3ab214,_0x1437db){_0x3ab214=_0x3ab214-0x0;var _0x287aca=_0x6cb4[_0x3ab214];return _0x287aca;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'uniqueid':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x46cb('0x3')](_0x46cb('0x4'),_0x46cb('0x5'),_0x46cb('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x46cb('0x7')]}};
\ No newline at end of file
index d948df9..e6e2089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x010e=['destroy','error','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then'];(function(_0x66b574,_0x2e6cd0){var _0x556b60=function(_0x296542){while(--_0x296542){_0x66b574['push'](_0x66b574['shift']());}};_0x556b60(++_0x2e6cd0);}(_0x010e,0x103));var _0xe010=function(_0x7bd4c4,_0x28fb59){_0x7bd4c4=_0x7bd4c4-0x0;var _0x2edc59=_0x010e[_0x7bd4c4];return _0x2edc59;};'use strict';var emlformat=require(_0xe010('0x0'));var rimraf=require(_0xe010('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe010('0x2'));var rp=require(_0xe010('0x3'));var moment=require('moment');var BPromise=require(_0xe010('0x4'));var Mustache=require(_0xe010('0x5'));var util=require(_0xe010('0x6'));var path=require(_0xe010('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe010('0x8'));var _=require(_0xe010('0x9'));var squel=require(_0xe010('0xa'));var crypto=require(_0xe010('0xb'));var jsforce=require(_0xe010('0xc'));var deskjs=require(_0xe010('0xd'));var toCsv=require(_0xe010('0xe'));var querystring=require(_0xe010('0xf'));var Papa=require(_0xe010('0x10'));var Redis=require(_0xe010('0x11'));var authService=require(_0xe010('0x12'));var qs=require(_0xe010('0x13'));var as=require(_0xe010('0x14'));var hardwareService=require(_0xe010('0x15'));var logger=require(_0xe010('0x16'))('api');var utils=require(_0xe010('0x17'));var config=require(_0xe010('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe010('0x19'))['db'];function respondWithStatusCode(_0x2c71b5,_0x157fe6){_0x157fe6=_0x157fe6||0xcc;return function(_0x50c42a){if(_0x50c42a){return _0x2c71b5[_0xe010('0x1a')](_0x157fe6);}return _0x2c71b5[_0xe010('0x1b')](_0x157fe6)[_0xe010('0x1c')]();};}function respondWithResult(_0x59cffe,_0x42e7bf){_0x42e7bf=_0x42e7bf||0xc8;return function(_0x4f1eb9){if(_0x4f1eb9){return _0x59cffe[_0xe010('0x1b')](_0x42e7bf)[_0xe010('0x1d')](_0x4f1eb9);}};}function respondWithFilteredResult(_0x13f54a,_0x483505){return function(_0x1dd2d8){if(_0x1dd2d8){var _0x241a1e=typeof _0x483505[_0xe010('0x1e')]==='undefined'&&typeof _0x483505[_0xe010('0x1f')]===_0xe010('0x20');var _0x329256=_0x1dd2d8[_0xe010('0x21')];var _0x524513=_0x241a1e?0x0:_0x483505[_0xe010('0x1e')];var _0x26d856=_0x241a1e?_0x1dd2d8[_0xe010('0x21')]:_0x483505[_0xe010('0x1e')]+_0x483505[_0xe010('0x1f')];var _0x7d058e;if(_0x26d856>=_0x329256){_0x26d856=_0x329256;_0x7d058e=0xc8;}else{_0x7d058e=0xce;}_0x13f54a['status'](_0x7d058e);return _0x13f54a['set'](_0xe010('0x22'),_0x524513+'-'+_0x26d856+'/'+_0x329256)['json'](_0x1dd2d8);}return null;};}function patchUpdates(_0x29c0b8){return function(_0x33671b){try{jsonpatch[_0xe010('0x23')](_0x33671b,_0x29c0b8,!![]);}catch(_0x1f3da5){return BPromise['reject'](_0x1f3da5);}return _0x33671b['save']();};}function saveUpdates(_0x4b51ac,_0x58f288){return function(_0x1ecefb){if(_0x1ecefb){return _0x1ecefb['update'](_0x4b51ac)[_0xe010('0x24')](function(_0x41519c){return _0x41519c;});}return null;};}function removeEntity(_0x25be19,_0x34fd9f){return function(_0x17fc16){if(_0x17fc16){return _0x17fc16[_0xe010('0x25')]()[_0xe010('0x24')](function(){_0x25be19[_0xe010('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ccc7f,_0x223ae6){return function(_0x505fe5){if(!_0x505fe5){_0x4ccc7f[_0xe010('0x1a')](0x194);}return _0x505fe5;};}function handleError(_0x408f6f,_0x436385){_0x436385=_0x436385||0x1f4;return function(_0xf15683){logger[_0xe010('0x26')](_0xf15683[_0xe010('0x27')]);if(_0xf15683['name']){delete _0xf15683[_0xe010('0x28')];}_0x408f6f[_0xe010('0x1b')](_0x436385)[_0xe010('0x29')](_0xf15683);};}exports[_0xe010('0x2a')]=function(_0x1aa8ad,_0xa78271){var _0x43d0b4={},_0x46ba51={},_0x3a6f5a={'count':0x0,'rows':[]};var _0x2a7587=_[_0xe010('0x2b')](db['WhatsappTransferReport']['rawAttributes'],function(_0x13b87b){return{'name':_0x13b87b['fieldName'],'type':_0x13b87b[_0xe010('0x2c')][_0xe010('0x2d')]};});_0x46ba51[_0xe010('0x2e')]=_['map'](_0x2a7587,'name');_0x46ba51[_0xe010('0x2f')]=_[_0xe010('0x30')](_0x1aa8ad[_0xe010('0x2f')]);_0x46ba51[_0xe010('0x31')]=_['intersection'](_0x46ba51[_0xe010('0x2e')],_0x46ba51[_0xe010('0x2f')]);_0x43d0b4[_0xe010('0x32')]=_[_0xe010('0x33')](_0x46ba51['model'],qs[_0xe010('0x34')](_0x1aa8ad['query']['fields']));_0x43d0b4[_0xe010('0x32')]=_0x43d0b4['attributes'][_0xe010('0x35')]?_0x43d0b4[_0xe010('0x32')]:_0x46ba51[_0xe010('0x2e')];if(!_0x1aa8ad[_0xe010('0x2f')][_0xe010('0x36')](_0xe010('0x37'))){_0x43d0b4['limit']=qs[_0xe010('0x1f')](_0x1aa8ad[_0xe010('0x2f')]['limit']);_0x43d0b4[_0xe010('0x1e')]=qs[_0xe010('0x1e')](_0x1aa8ad[_0xe010('0x2f')]['offset']);}_0x43d0b4[_0xe010('0x38')]=qs[_0xe010('0x39')](_0x1aa8ad[_0xe010('0x2f')]['sort']);_0x43d0b4[_0xe010('0x3a')]=qs['filters'](_['pick'](_0x1aa8ad[_0xe010('0x2f')],_0x46ba51[_0xe010('0x31')]),_0x2a7587);if(_0x1aa8ad[_0xe010('0x2f')]['filter']){_0x43d0b4['where']=_['merge'](_0x43d0b4[_0xe010('0x3a')],{'$or':_[_0xe010('0x2b')](_0x2a7587,function(_0x4c71c7){if(_0x4c71c7[_0xe010('0x2c')]!=='VIRTUAL'){var _0x1b145e={};_0x1b145e[_0x4c71c7[_0xe010('0x28')]]={'$like':'%'+_0x1aa8ad[_0xe010('0x2f')]['filter']+'%'};return _0x1b145e;}})});}_0x43d0b4=_[_0xe010('0x3b')]({},_0x43d0b4,_0x1aa8ad[_0xe010('0x3c')]);var _0x1044a1={'where':_0x43d0b4[_0xe010('0x3a')]};return db[_0xe010('0x3d')]['count'](_0x1044a1)['then'](function(_0x19bc3c){_0x3a6f5a['count']=_0x19bc3c;if(_0x1aa8ad[_0xe010('0x2f')][_0xe010('0x3e')]){_0x43d0b4[_0xe010('0x3f')]=[{'all':!![]}];}return db[_0xe010('0x3d')][_0xe010('0x40')](_0x43d0b4);})[_0xe010('0x24')](function(_0x5457e1){_0x3a6f5a[_0xe010('0x41')]=_0x5457e1;return _0x3a6f5a;})['then'](respondWithFilteredResult(_0xa78271,_0x43d0b4))[_0xe010('0x42')](handleError(_0xa78271,null));};exports[_0xe010('0x43')]=function(_0x27fb70,_0x115169){var _0x46d93d={'raw':!![],'where':{'id':_0x27fb70[_0xe010('0x44')]['id']}},_0x2a4bbc={};_0x2a4bbc[_0xe010('0x2e')]=_['keys'](db[_0xe010('0x3d')]['rawAttributes']);_0x2a4bbc[_0xe010('0x2f')]=_['keys'](_0x27fb70[_0xe010('0x2f')]);_0x2a4bbc[_0xe010('0x31')]=_[_0xe010('0x33')](_0x2a4bbc['model'],_0x2a4bbc[_0xe010('0x2f')]);_0x46d93d[_0xe010('0x32')]=_['intersection'](_0x2a4bbc[_0xe010('0x2e')],qs[_0xe010('0x34')](_0x27fb70[_0xe010('0x2f')]['fields']));_0x46d93d[_0xe010('0x32')]=_0x46d93d[_0xe010('0x32')][_0xe010('0x35')]?_0x46d93d[_0xe010('0x32')]:_0x2a4bbc[_0xe010('0x2e')];if(_0x27fb70[_0xe010('0x2f')][_0xe010('0x3e')]){_0x46d93d[_0xe010('0x3f')]=[{'all':!![]}];}_0x46d93d=_[_0xe010('0x3b')]({},_0x46d93d,_0x27fb70[_0xe010('0x3c')]);return db['WhatsappTransferReport'][_0xe010('0x45')](_0x46d93d)[_0xe010('0x24')](handleEntityNotFound(_0x115169,null))[_0xe010('0x24')](respondWithResult(_0x115169,null))[_0xe010('0x42')](handleError(_0x115169,null));};exports[_0xe010('0x46')]=function(_0x476330,_0x41ca56){return db[_0xe010('0x3d')]['create'](_0x476330[_0xe010('0x47')],{})[_0xe010('0x24')](respondWithResult(_0x41ca56,0xc9))[_0xe010('0x42')](handleError(_0x41ca56,null));};exports[_0xe010('0x48')]=function(_0xae0dd4,_0x4504a3){if(_0xae0dd4[_0xe010('0x47')]['id']){delete _0xae0dd4[_0xe010('0x47')]['id'];}return db[_0xe010('0x3d')][_0xe010('0x45')]({'where':{'id':_0xae0dd4[_0xe010('0x44')]['id']}})[_0xe010('0x24')](handleEntityNotFound(_0x4504a3,null))[_0xe010('0x24')](saveUpdates(_0xae0dd4[_0xe010('0x47')],null))[_0xe010('0x24')](respondWithResult(_0x4504a3,null))[_0xe010('0x42')](handleError(_0x4504a3,null));};exports[_0xe010('0x25')]=function(_0x13ab81,_0xf5fdac){return db['WhatsappTransferReport'][_0xe010('0x45')]({'where':{'id':_0x13ab81[_0xe010('0x44')]['id']}})['then'](handleEntityNotFound(_0xf5fdac,null))[_0xe010('0x24')](removeEntity(_0xf5fdac,null))[_0xe010('0x42')](handleError(_0xf5fdac,null));};exports[_0xe010('0x49')]=function(_0x5b5bd6,_0x2ab288){return db[_0xe010('0x3d')]['describe']()[_0xe010('0x24')](respondWithResult(_0x2ab288,null))['catch'](handleError(_0x2ab288,null));};
\ No newline at end of file
+var _0xb718=['error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','show','params','keys','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy'];(function(_0x3f581f,_0x4ea03c){var _0x1e0d19=function(_0x2b9d8a){while(--_0x2b9d8a){_0x3f581f['push'](_0x3f581f['shift']());}};_0x1e0d19(++_0x4ea03c);}(_0xb718,0x1ee));var _0x8b71=function(_0x4eabde,_0x15d845){_0x4eabde=_0x4eabde-0x0;var _0x201e80=_0xb718[_0x4eabde];return _0x201e80;};'use strict';var emlformat=require(_0x8b71('0x0'));var rimraf=require(_0x8b71('0x1'));var zipdir=require(_0x8b71('0x2'));var jsonpatch=require(_0x8b71('0x3'));var rp=require('request-promise');var moment=require(_0x8b71('0x4'));var BPromise=require(_0x8b71('0x5'));var Mustache=require(_0x8b71('0x6'));var util=require(_0x8b71('0x7'));var path=require('path');var sox=require(_0x8b71('0x8'));var csv=require(_0x8b71('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b71('0xa'));var _=require(_0x8b71('0xb'));var squel=require(_0x8b71('0xc'));var crypto=require(_0x8b71('0xd'));var jsforce=require(_0x8b71('0xe'));var deskjs=require(_0x8b71('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b71('0x10'));var Redis=require(_0x8b71('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8b71('0x12'));var as=require(_0x8b71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b71('0x14'));var utils=require(_0x8b71('0x15'));var config=require(_0x8b71('0x16'));var licenseUtil=require(_0x8b71('0x17'));var db=require(_0x8b71('0x18'))['db'];function respondWithStatusCode(_0x3e60e8,_0xb18592){_0xb18592=_0xb18592||0xcc;return function(_0x291cc9){if(_0x291cc9){return _0x3e60e8[_0x8b71('0x19')](_0xb18592);}return _0x3e60e8[_0x8b71('0x1a')](_0xb18592)[_0x8b71('0x1b')]();};}function respondWithResult(_0x332b44,_0x6676d8){_0x6676d8=_0x6676d8||0xc8;return function(_0x464b9e){if(_0x464b9e){return _0x332b44[_0x8b71('0x1a')](_0x6676d8)[_0x8b71('0x1c')](_0x464b9e);}};}function respondWithFilteredResult(_0x28d7e8,_0x51f297){return function(_0x589ba0){if(_0x589ba0){var _0x5cd1b9=typeof _0x51f297[_0x8b71('0x1d')]===_0x8b71('0x1e')&&typeof _0x51f297[_0x8b71('0x1f')]===_0x8b71('0x1e');var _0x32c06e=_0x589ba0['count'];var _0x40f243=_0x5cd1b9?0x0:_0x51f297[_0x8b71('0x1d')];var _0x5f5a82=_0x5cd1b9?_0x589ba0['count']:_0x51f297['offset']+_0x51f297[_0x8b71('0x1f')];var _0x10fd23;if(_0x5f5a82>=_0x32c06e){_0x5f5a82=_0x32c06e;_0x10fd23=0xc8;}else{_0x10fd23=0xce;}_0x28d7e8['status'](_0x10fd23);return _0x28d7e8['set']('Content-Range',_0x40f243+'-'+_0x5f5a82+'/'+_0x32c06e)[_0x8b71('0x1c')](_0x589ba0);}return null;};}function patchUpdates(_0x486194){return function(_0x123900){try{jsonpatch[_0x8b71('0x20')](_0x123900,_0x486194,!![]);}catch(_0x1133a4){return BPromise[_0x8b71('0x21')](_0x1133a4);}return _0x123900[_0x8b71('0x22')]();};}function saveUpdates(_0x569735,_0xae8892){return function(_0x13eb41){if(_0x13eb41){return _0x13eb41[_0x8b71('0x23')](_0x569735)[_0x8b71('0x24')](function(_0x5efcf9){return _0x5efcf9;});}return null;};}function removeEntity(_0x3d7e45,_0x5d0536){return function(_0x4a9800){if(_0x4a9800){return _0x4a9800[_0x8b71('0x25')]()[_0x8b71('0x24')](function(){_0x3d7e45[_0x8b71('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa19f,_0x52a299){return function(_0x2faa1e){if(!_0x2faa1e){_0x4aa19f['sendStatus'](0x194);}return _0x2faa1e;};}function handleError(_0x2c09d5,_0xb2e8a2){_0xb2e8a2=_0xb2e8a2||0x1f4;return function(_0x516ec2){logger[_0x8b71('0x26')](_0x516ec2[_0x8b71('0x27')]);if(_0x516ec2[_0x8b71('0x28')]){delete _0x516ec2[_0x8b71('0x28')];}_0x2c09d5['status'](_0xb2e8a2)[_0x8b71('0x29')](_0x516ec2);};}exports[_0x8b71('0x2a')]=function(_0x545e2b,_0x560b20){var _0x19bd7f={},_0x106a0d={},_0x505053={'count':0x0,'rows':[]};var _0x476878=_[_0x8b71('0x2b')](db[_0x8b71('0x2c')][_0x8b71('0x2d')],function(_0x4df252){return{'name':_0x4df252['fieldName'],'type':_0x4df252[_0x8b71('0x2e')][_0x8b71('0x2f')]};});_0x106a0d['model']=_[_0x8b71('0x2b')](_0x476878,_0x8b71('0x28'));_0x106a0d[_0x8b71('0x30')]=_['keys'](_0x545e2b[_0x8b71('0x30')]);_0x106a0d[_0x8b71('0x31')]=_[_0x8b71('0x32')](_0x106a0d[_0x8b71('0x33')],_0x106a0d['query']);_0x19bd7f[_0x8b71('0x34')]=_[_0x8b71('0x32')](_0x106a0d[_0x8b71('0x33')],qs['fields'](_0x545e2b[_0x8b71('0x30')][_0x8b71('0x35')]));_0x19bd7f[_0x8b71('0x34')]=_0x19bd7f['attributes'][_0x8b71('0x36')]?_0x19bd7f['attributes']:_0x106a0d[_0x8b71('0x33')];if(!_0x545e2b[_0x8b71('0x30')][_0x8b71('0x37')]('nolimit')){_0x19bd7f['limit']=qs[_0x8b71('0x1f')](_0x545e2b[_0x8b71('0x30')]['limit']);_0x19bd7f['offset']=qs[_0x8b71('0x1d')](_0x545e2b[_0x8b71('0x30')][_0x8b71('0x1d')]);}_0x19bd7f[_0x8b71('0x38')]=qs[_0x8b71('0x39')](_0x545e2b[_0x8b71('0x30')][_0x8b71('0x39')]);_0x19bd7f[_0x8b71('0x3a')]=qs[_0x8b71('0x31')](_[_0x8b71('0x3b')](_0x545e2b[_0x8b71('0x30')],_0x106a0d['filters']),_0x476878);if(_0x545e2b[_0x8b71('0x30')][_0x8b71('0x3c')]){_0x19bd7f[_0x8b71('0x3a')]=_[_0x8b71('0x3d')](_0x19bd7f['where'],{'$or':_['map'](_0x476878,function(_0xd61d54){if(_0xd61d54[_0x8b71('0x2e')]!==_0x8b71('0x3e')){var _0x5c2d76={};_0x5c2d76[_0xd61d54[_0x8b71('0x28')]]={'$like':'%'+_0x545e2b[_0x8b71('0x30')][_0x8b71('0x3c')]+'%'};return _0x5c2d76;}})});}_0x19bd7f=_[_0x8b71('0x3d')]({},_0x19bd7f,_0x545e2b['options']);var _0xd2be9={'where':_0x19bd7f['where']};return db['WhatsappTransferReport'][_0x8b71('0x3f')](_0xd2be9)[_0x8b71('0x24')](function(_0x1ca247){_0x505053['count']=_0x1ca247;if(_0x545e2b[_0x8b71('0x30')][_0x8b71('0x40')]){_0x19bd7f[_0x8b71('0x41')]=[{'all':!![]}];}return db[_0x8b71('0x2c')]['findAll'](_0x19bd7f);})['then'](function(_0x3f81f3){_0x505053[_0x8b71('0x42')]=_0x3f81f3;return _0x505053;})[_0x8b71('0x24')](respondWithFilteredResult(_0x560b20,_0x19bd7f))['catch'](handleError(_0x560b20,null));};exports[_0x8b71('0x43')]=function(_0x31dfb2,_0x4fa6ca){var _0x36b9c8={'raw':!![],'where':{'id':_0x31dfb2[_0x8b71('0x44')]['id']}},_0x16311b={};_0x16311b['model']=_[_0x8b71('0x45')](db[_0x8b71('0x2c')]['rawAttributes']);_0x16311b[_0x8b71('0x30')]=_[_0x8b71('0x45')](_0x31dfb2['query']);_0x16311b[_0x8b71('0x31')]=_[_0x8b71('0x32')](_0x16311b[_0x8b71('0x33')],_0x16311b[_0x8b71('0x30')]);_0x36b9c8[_0x8b71('0x34')]=_[_0x8b71('0x32')](_0x16311b['model'],qs['fields'](_0x31dfb2[_0x8b71('0x30')]['fields']));_0x36b9c8[_0x8b71('0x34')]=_0x36b9c8[_0x8b71('0x34')][_0x8b71('0x36')]?_0x36b9c8[_0x8b71('0x34')]:_0x16311b['model'];if(_0x31dfb2[_0x8b71('0x30')][_0x8b71('0x40')]){_0x36b9c8[_0x8b71('0x41')]=[{'all':!![]}];}_0x36b9c8=_[_0x8b71('0x3d')]({},_0x36b9c8,_0x31dfb2[_0x8b71('0x46')]);return db['WhatsappTransferReport'][_0x8b71('0x47')](_0x36b9c8)[_0x8b71('0x24')](handleEntityNotFound(_0x4fa6ca,null))[_0x8b71('0x24')](respondWithResult(_0x4fa6ca,null))[_0x8b71('0x48')](handleError(_0x4fa6ca,null));};exports[_0x8b71('0x49')]=function(_0x377de2,_0x37c188){return db[_0x8b71('0x2c')][_0x8b71('0x49')](_0x377de2[_0x8b71('0x4a')],{})[_0x8b71('0x24')](respondWithResult(_0x37c188,0xc9))[_0x8b71('0x48')](handleError(_0x37c188,null));};exports['update']=function(_0x13f448,_0x2e1968){if(_0x13f448['body']['id']){delete _0x13f448[_0x8b71('0x4a')]['id'];}return db[_0x8b71('0x2c')][_0x8b71('0x47')]({'where':{'id':_0x13f448[_0x8b71('0x44')]['id']}})[_0x8b71('0x24')](handleEntityNotFound(_0x2e1968,null))[_0x8b71('0x24')](saveUpdates(_0x13f448[_0x8b71('0x4a')],null))[_0x8b71('0x24')](respondWithResult(_0x2e1968,null))['catch'](handleError(_0x2e1968,null));};exports[_0x8b71('0x25')]=function(_0x25755e,_0xebdaa4){return db['WhatsappTransferReport'][_0x8b71('0x47')]({'where':{'id':_0x25755e[_0x8b71('0x44')]['id']}})[_0x8b71('0x24')](handleEntityNotFound(_0xebdaa4,null))[_0x8b71('0x24')](removeEntity(_0xebdaa4,null))[_0x8b71('0x48')](handleError(_0xebdaa4,null));};exports[_0x8b71('0x4b')]=function(_0x1dc8dc,_0x2d64a8){return db[_0x8b71('0x2c')][_0x8b71('0x4b')]()[_0x8b71('0x24')](respondWithResult(_0x2d64a8,null))[_0x8b71('0x48')](handleError(_0x2d64a8,null));};
\ No newline at end of file
index 078043b..9c1c1d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbb=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xc20c7,_0x17cc5f){var _0x423b66=function(_0x3b5cd9){while(--_0x3b5cd9){_0xc20c7['push'](_0xc20c7['shift']());}};_0x423b66(++_0x17cc5f);}(_0xfcbb,0x125));var _0xbfcb=function(_0x3a5ff8,_0xf71e5d){_0x3a5ff8=_0x3a5ff8-0x0;var _0x40ddff=_0xfcbb[_0x3a5ff8];return _0x40ddff;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfcb('0x5'));var config=require(_0xbfcb('0x6'));var attributes=require(_0xbfcb('0x7'));module[_0xbfcb('0x8')]=function(_0x6d0c72,_0x3c1844){return _0x6d0c72[_0xbfcb('0x9')](_0xbfcb('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xbfcb('0xb'),'fields':[_0xbfcb('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c69=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x4f9d26,_0x641341){var _0x57debc=function(_0x48f368){while(--_0x48f368){_0x4f9d26['push'](_0x4f9d26['shift']());}};_0x57debc(++_0x641341);}(_0x5c69,0xad));var _0x95c6=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x5c69[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x95c6('0x0'));var logger=require(_0x95c6('0x1'))(_0x95c6('0x2'));var moment=require(_0x95c6('0x3'));var BPromise=require(_0x95c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x95c6('0x5'));var attributes=require(_0x95c6('0x6'));module[_0x95c6('0x7')]=function(_0xdcddbb,_0x37e209){return _0xdcddbb[_0x95c6('0x8')](_0x95c6('0x9'),attributes,{'tableName':_0x95c6('0xa'),'paranoid':![],'indexes':[{'name':_0x95c6('0xb'),'fields':[_0x95c6('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 5a787cc..33afc17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd027=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x3d8a92,_0x2bd8aa){var _0x19fb63=function(_0x265f54){while(--_0x265f54){_0x3d8a92['push'](_0x3d8a92['shift']());}};_0x19fb63(++_0x2bd8aa);}(_0xd027,0x162));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d02('0x0'));var util=require('util');var moment=require(_0x7d02('0x1'));var BPromise=require(_0x7d02('0x2'));var rs=require(_0x7d02('0x3'));var fs=require('fs');var Redis=require(_0x7d02('0x4'));var db=require(_0x7d02('0x5'))['db'];var utils=require(_0x7d02('0x6'));var logger=require(_0x7d02('0x7'))(_0x7d02('0x8'));var config=require(_0x7d02('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d02('0xa')][_0x7d02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc0a278,_0x5553c5,_0x58e020){return new BPromise(function(_0x437dad,_0x5c4529){return client[_0x7d02('0xc')](_0xc0a278,_0x58e020)[_0x7d02('0xd')](function(_0x560fe5){logger[_0x7d02('0xe')](_0x7d02('0xf'),_0x5553c5,_0x7d02('0x10'));logger[_0x7d02('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5553c5,'request\x20sent',JSON['stringify'](_0x560fe5));if(_0x560fe5['error']){if(_0x560fe5[_0x7d02('0x12')]['code']===0x1f4){logger[_0x7d02('0x12')](_0x7d02('0xf'),_0x5553c5,_0x560fe5[_0x7d02('0x12')][_0x7d02('0x13')]);return _0x5c4529(_0x560fe5[_0x7d02('0x12')]['message']);}logger['error'](_0x7d02('0xf'),_0x5553c5,_0x560fe5[_0x7d02('0x12')]['message']);return _0x437dad(_0x560fe5['error']['message']);}else{logger[_0x7d02('0xe')](_0x7d02('0xf'),_0x5553c5,'request\x20sent');_0x437dad(_0x560fe5[_0x7d02('0x14')]['message']);}})[_0x7d02('0x15')](function(_0x42111d){logger['error'](_0x7d02('0xf'),_0x5553c5,_0x42111d);_0x5c4529(_0x42111d);});});}
\ No newline at end of file
+var _0xfea3=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfea3,0x166));var _0x3fea=function(_0x390ab2,_0x5e29bd){_0x390ab2=_0x390ab2-0x0;var _0x414333=_0xfea3[_0x390ab2];return _0x414333;};'use strict';var _=require(_0x3fea('0x0'));var util=require(_0x3fea('0x1'));var moment=require(_0x3fea('0x2'));var BPromise=require('bluebird');var rs=require(_0x3fea('0x3'));var fs=require('fs');var Redis=require(_0x3fea('0x4'));var db=require(_0x3fea('0x5'))['db'];var utils=require(_0x3fea('0x6'));var logger=require(_0x3fea('0x7'))(_0x3fea('0x8'));var config=require(_0x3fea('0x9'));var jayson=require(_0x3fea('0xa'));var client=jayson['client'][_0x3fea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18921e,_0x2e6fea,_0x2f6cc9){return new BPromise(function(_0x1cdf85,_0x1078e7){return client['request'](_0x18921e,_0x2f6cc9)[_0x3fea('0xc')](function(_0x58672d){logger[_0x3fea('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2e6fea,_0x3fea('0xe'));logger[_0x3fea('0xf')](_0x3fea('0x10'),_0x2e6fea,_0x3fea('0xe'),JSON[_0x3fea('0x11')](_0x58672d));if(_0x58672d[_0x3fea('0x12')]){if(_0x58672d['error']['code']===0x1f4){logger[_0x3fea('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2e6fea,_0x58672d[_0x3fea('0x12')][_0x3fea('0x13')]);return _0x1078e7(_0x58672d[_0x3fea('0x12')][_0x3fea('0x13')]);}logger[_0x3fea('0x12')](_0x3fea('0x14'),_0x2e6fea,_0x58672d[_0x3fea('0x12')][_0x3fea('0x13')]);return _0x1cdf85(_0x58672d[_0x3fea('0x12')][_0x3fea('0x13')]);}else{logger[_0x3fea('0xd')](_0x3fea('0x14'),_0x2e6fea,_0x3fea('0xe'));_0x1cdf85(_0x58672d['result'][_0x3fea('0x13')]);}})[_0x3fea('0x15')](function(_0x291642){logger[_0x3fea('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2e6fea,_0x291642);_0x1078e7(_0x291642);});});}
\ No newline at end of file
index 1d7f4c9..1c0a6c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc8d=['map','pm2_env','online','name','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0xc23071,_0x7ec999){var _0x6147a0=function(_0x3cf1eb){while(--_0x3cf1eb){_0xc23071['push'](_0xc23071['shift']());}};_0x6147a0(++_0x7ec999);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbc8('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xdbc8('0x1'));var checkLicense=require(_0xdbc8('0x2'));var rpc=require(_0xdbc8('0x3'));var config=require(_0xdbc8('0x4'));var logger=require('./config/logger')(_0xdbc8('0x5'));var pm2=require(_0xdbc8('0x6'));var pm2Config=require(_0xdbc8('0x7'));var schedule=require('./config/schedule');var chat=require(_0xdbc8('0x8'));var whatsapp=require(_0xdbc8('0x9'));var transcribe=require(_0xdbc8('0xa'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xdbc8('0xb')]['sync']()[_0xdbc8('0xc')](function(){if(config[_0xdbc8('0xd')]){return seedDb['default']();}})[_0xdbc8('0xc')](function(){return checkLicense[_0xdbc8('0xe')]();})[_0xdbc8('0xc')](function(){return rpc[_0xdbc8('0xf')]();})[_0xdbc8('0xc')](function(_0x40a2c5){logger[_0xdbc8('0x10')](_0x40a2c5);return chat[_0xdbc8('0x11')]();})[_0xdbc8('0xc')](function(){return whatsapp[_0xdbc8('0x11')]();})[_0xdbc8('0xc')](function(){return schedule[_0xdbc8('0x11')]();})[_0xdbc8('0xc')](function(){return transcribe[_0xdbc8('0x11')]();})[_0xdbc8('0xc')](function(){return provider['start']();})[_0xdbc8('0xc')](function(_0x562914){logger[_0xdbc8('0x10')](_0x562914);return pm2[_0xdbc8('0x11')](pm2Config);})[_0xdbc8('0xc')](function(_0x3a7698){var _0x1406b9=_0x3a7698[_0xdbc8('0x12')](function(_0x1d5d7e){return typeof _0x1d5d7e[_0xdbc8('0x13')]===_0xdbc8('0x14')&&_0x1d5d7e[_0xdbc8('0x13')]>=0x0;});if(_0x1406b9[_0xdbc8('0x15')]>0x0){throw new Error(_0x1406b9[_0xdbc8('0x15')]+_0xdbc8('0x16')+_[_0xdbc8('0x17')](_0x1406b9,function(_0x4cdb17){return'\x22'+_0x4cdb17[_0xdbc8('0x18')]['name']+'\x22';}));}logger['info']('Online\x20apps:',_['map'](_[_0xdbc8('0x12')](_0x3a7698,{'status':_0xdbc8('0x19')}),_0xdbc8('0x1a'))[_0xdbc8('0x1b')]());logger[_0xdbc8('0x10')](_0xdbc8('0x1c'),_[_0xdbc8('0x17')](_[_0xdbc8('0x12')](_0x3a7698,function(_0x2f0b08){return _0x2f0b08[_0xdbc8('0x1d')]!==_0xdbc8('0x19');}),_0xdbc8('0x1a'))[_0xdbc8('0x1b')]()||_0xdbc8('0x1e'));console[_0xdbc8('0x1f')](_0xdbc8('0x20'));})[_0xdbc8('0x21')](function(_0x2b5a97){console[_0xdbc8('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2b5a97);logger[_0xdbc8('0x22')](_0xdbc8('0x23'),_0x2b5a97);process[_0xdbc8('0x24')](0x1);});}main();
\ No newline at end of file
+var _0x3de0=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','info','Online\x20apps:','online','name','join','Offline\x20apps:','filter','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','start','exitCode'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3de0,0x143));var _0x03de=function(_0x21aca7,_0x547646){_0x21aca7=_0x21aca7-0x0;var _0x4eba0e=_0x3de0[_0x21aca7];return _0x4eba0e;};'use strict';var _=require(_0x03de('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x03de('0x1'));var checkLicense=require(_0x03de('0x2'));var rpc=require('./rpc');var config=require(_0x03de('0x3'));var logger=require(_0x03de('0x4'))('app');var pm2=require(_0x03de('0x5'));var pm2Config=require(_0x03de('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x03de('0x7'));var transcribe=require(_0x03de('0x8'));var provider=require(_0x03de('0x9'));function main(){return db[_0x03de('0xa')][_0x03de('0xb')]()[_0x03de('0xc')](function(){if(config[_0x03de('0xd')]){return seedDb[_0x03de('0xe')]();}})['then'](function(){return checkLicense[_0x03de('0xe')]();})['then'](function(){return rpc['listen']();})[_0x03de('0xc')](function(_0x1d6e87){logger['info'](_0x1d6e87);return chat[_0x03de('0xf')]();})[_0x03de('0xc')](function(){return whatsapp['start']();})[_0x03de('0xc')](function(){return schedule[_0x03de('0xf')]();})['then'](function(){return transcribe[_0x03de('0xf')]();})[_0x03de('0xc')](function(){return provider[_0x03de('0xf')]();})[_0x03de('0xc')](function(_0x1570c3){logger['info'](_0x1570c3);return pm2[_0x03de('0xf')](pm2Config);})[_0x03de('0xc')](function(_0x14d19c){var _0x4064a8=_0x14d19c['filter'](function(_0x453564){return typeof _0x453564[_0x03de('0x10')]===_0x03de('0x11')&&_0x453564[_0x03de('0x10')]>=0x0;});if(_0x4064a8[_0x03de('0x12')]>0x0){throw new Error(_0x4064a8[_0x03de('0x12')]+_0x03de('0x13')+_[_0x03de('0x14')](_0x4064a8,function(_0x313a71){return'\x22'+_0x313a71['pm2_env']['name']+'\x22';}));}logger[_0x03de('0x15')](_0x03de('0x16'),_[_0x03de('0x14')](_['filter'](_0x14d19c,{'status':_0x03de('0x17')}),_0x03de('0x18'))[_0x03de('0x19')]());logger[_0x03de('0x15')](_0x03de('0x1a'),_[_0x03de('0x14')](_[_0x03de('0x1b')](_0x14d19c,function(_0x5cb66b){return _0x5cb66b['status']!=='online';}),_0x03de('0x18'))[_0x03de('0x19')]()||'None');console[_0x03de('0x1c')](_0x03de('0x1d'));})[_0x03de('0x1e')](function(_0x4bc6c8){console[_0x03de('0x1c')](_0x03de('0x1f'),_0x4bc6c8);logger['error'](_0x03de('0x20'),_0x4bc6c8);process[_0x03de('0x21')](0x1);});}main();
\ No newline at end of file
index 4741e24..8f75b46 100644 (file)
@@ -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(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5eb7ef,_0x33865b){_0x5eb7ef=_0x5eb7ef-0x0;var _0x11a6fa=_0xb43b[_0x5eb7ef];return _0x11a6fa;};'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 _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x3c6069,_0x25a3ff){var _0x353317=function(_0x26e1da){while(--_0x26e1da){_0x3c6069['push'](_0x3c6069['shift']());}};_0x353317(++_0x25a3ff);}(_0x00bb,0x1d8));var _0xb00b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x00bb[_0xa1e3e3];return _0xc980e9;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});}
\ No newline at end of file
index 6b4edcb..ea57b70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['rows','catch','keys','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','user','clause','tags','skip','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts'];(function(_0x3d91ea,_0x19aafc){var _0x37043d=function(_0x36a92e){while(--_0x36a92e){_0x3d91ea['push'](_0x3d91ea['shift']());}};_0x37043d(++_0x19aafc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x703343,_0x1133ac){_0x703343=_0x703343-0x0;var _0x2d8777=_0x5f2f[_0x703343];return _0x2d8777;};'use strict';var _=require(_0xf5f2('0x0'));var sqlUtils=require(_0xf5f2('0x1'));var db=require(_0xf5f2('0x2'))['db'];exports[_0xf5f2('0x3')]=function(_0x1172dd,_0x174bc7,_0x3c72ee,_0x107cf){var _0x501fbd={'count':0x0,'rows':[]};var _0x4854b6=sqlUtils[_0xf5f2('0x4')](_0x174bc7,_0x1172dd);if(_0x4854b6){return Promise[_0xf5f2('0x5')](_0x501fbd);}var _0xad7f65=sqlUtils[_0xf5f2('0x6')]();var _0x3133bc={};var _0x473100=![];var _0x5907aa=![];return Promise[_0xf5f2('0x5')]()[_0xf5f2('0x7')](function(){if(_0x1172dd[_0xf5f2('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1172dd[_0xf5f2('0x8')],_0x107cf);}else{return sqlUtils[_0xf5f2('0x9')](_0x1172dd,_0x107cf);}})[_0xf5f2('0x7')](function(_0x4e0e6b){_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['default']);_0xad7f65['where'](_0x4e0e6b[_0xf5f2('0xb')]);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['filter']);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xd')]);_0x3133bc=_0x4e0e6b[_0xf5f2('0xe')];_0x5907aa=_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xf')];return sqlUtils['checkListsRestrictions'](_0x174bc7,_0x1172dd,_0x5907aa);})[_0xf5f2('0x7')](function(_0xea612c){_0xad7f65[_0xf5f2('0xa')](_0xea612c);var _0x1c1a5c=_0x1172dd[_0xf5f2('0x8')]?_0x3133bc['ids']:_0x1172dd[_0xf5f2('0x10')];_0x473100=_0x1c1a5c?!![]:![];return sqlUtils[_0xf5f2('0x11')](_0xad7f65,_0x1c1a5c);})[_0xf5f2('0x7')](function(_0x1b6dd2){_0x501fbd[_0xf5f2('0x12')]=_0x1b6dd2;if(_0x501fbd[_0xf5f2('0x12')]===0x0){return;}return sqlUtils[_0xf5f2('0x13')](_0xad7f65,_0x1172dd[_0xf5f2('0xb')],_0x3c72ee,_0x473100,_0x3133bc[_0xf5f2('0xd')],_0x5907aa);})[_0xf5f2('0x7')](function(_0x20fccd){if(!_0x20fccd){return[];}return sqlUtils[_0xf5f2('0x14')](_0x20fccd,_0x1172dd,_0x3c72ee);})[_0xf5f2('0x7')](function(_0x3ee69){_0x501fbd[_0xf5f2('0x15')]=_0x3ee69;return _0x501fbd;})[_0xf5f2('0x16')](function(_0x1bf655){throw _0x1bf655;});};exports['describe']=function(){var _0x34706d={};var _0x47101e=[];return db['CmContact']['describe']()[_0xf5f2('0x7')](function(_0x388e6c){_0x34706d=_0x388e6c;var _0x4ae323=Object[_0xf5f2('0x17')](_0x34706d)[_0xf5f2('0x18')](function(_0x39e44a){return _[_0xf5f2('0x19')](_0x39e44a,_0xf5f2('0x1a'))?_0x39e44a:undefined;});var _0x4c691a=_0x4ae323[_0xf5f2('0x1b')](function(_0x4669a6){return db[_0xf5f2('0x1c')][_0xf5f2('0x1d')]({'where':{'id':_0x4669a6[_0xf5f2('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x4c691a);})['then'](function(_0x5f1124){for(var _0x3f79d5=0x0;_0x3f79d5<_0x5f1124[_0xf5f2('0x1f')];_0x3f79d5++){if(_0x5f1124[_0x3f79d5]){var _0x1a5bb3=_0xf5f2('0x1a')+_0x5f1124[_0x3f79d5]['id'];_0x34706d[_0x1a5bb3][_0xf5f2('0x20')]=_0x5f1124[_0x3f79d5][_0xf5f2('0x21')];}}_0x47101e=_[_0xf5f2('0x1b')](Object[_0xf5f2('0x17')](_0x34706d),function(_0x4ab014){return{'name':_0x4ab014,'type':_0x34706d[_0x4ab014][_0xf5f2('0x21')]};});return _0x47101e;})[_0xf5f2('0x16')](function(_0x375ca8){throw _0x375ca8;});};
\ No newline at end of file
+var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x5ed096,_0x201b50){var _0x23414b=function(_0x5d2b82){while(--_0x5d2b82){_0x5ed096['push'](_0x5ed096['shift']());}};_0x23414b(++_0x201b50);}(_0xb10b,0x12a));var _0xbb10=function(_0x180e11,_0x24bfb8){_0x180e11=_0x180e11-0x0;var _0x330930=_0xb10b[_0x180e11];return _0x330930;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});};
\ No newline at end of file
index 9bd29e8..2c2f51d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d67=['name','fieldType','castTo','buildExpression','type','default','text','value','end','Tag','map','clause','and','tags','User','user','uc.UserId\x20=\x20?','skip','keys','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','getLists','attributes','group','limit','offset','having','order','subqry.','DESC','color','keyBy','Sequelize','SELECT','query','toString','Tags','clone','COUNT(*)','c.id','getSelectedTags','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../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','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x0d67,0xa1));var _0x70d6=function(_0x4868ba,_0x13d956){_0x4868ba=_0x4868ba-0x0;var _0x2ef43a=_0x0d67[_0x4868ba];return _0x2ef43a;};'use strict';var _=require(_0x70d6('0x0'));var squel=require(_0x70d6('0x1'));var as=require(_0x70d6('0x2'));var qs=require('../parsers/qs');var utils=require(_0x70d6('0x3'));var db=require(_0x70d6('0x4'))['db'];function skipContactsQuery(_0x12a12b,_0x177ffd){var _0x42dbbd=![];if(_0x12a12b[_0x70d6('0x5')]===_0x70d6('0x6')&&!_0x177ffd[_0x70d6('0x7')]&&!_0x177ffd[_0x70d6('0x8')]&&_0x177ffd[_0x70d6('0x9')]!==_0x70d6('0xa')){_0x42dbbd=!![];}return _0x42dbbd;}function getContactsSubquery(){return squel[_0x70d6('0xb')]()[_0x70d6('0xc')](_0x70d6('0xd'),'c')[_0x70d6('0xe')](_0x70d6('0xf'));}function applyJoinClauses(_0x5d7785,_0x4a8c8a){var _0x3fe939=_0x4a8c8a?'c':_0x70d6('0x10');_0x5d7785['left_join'](_0x70d6('0x11'),'uc',_0x70d6('0x12')+_0x3fe939+_0x70d6('0x13'))['left_join']('cm_contact_has_tags','ct',_0x70d6('0x14')+_0x3fe939+'.id')['left_join']('tools_tags','t',_0x70d6('0x15'));return _0x5d7785;}function addFieldsToQuery(_0x746147,_0x38dbda,_0x10811f,_0x4b0096,_0x125315){var _0x58dbac=_0x125315?'c':'subqry';if(!_0x38dbda){_0x38dbda=['id',_0x70d6('0x16'),_0x70d6('0x17'),_0x70d6('0x18'),_0x70d6('0x19'),_0x70d6('0x1a'),_0x70d6('0x1b'),_0x70d6('0x8'),_0x70d6('0x1c'),_0x70d6('0x1d'),'updatedAt',_0x70d6('0x1e'),_0x70d6('0x1f')];}else if(!_0x38dbda[_0x70d6('0x20')]('id')){_0x38dbda[_0x70d6('0x21')]('id');}var _0x123e14=_0x10811f&&_0x125315||!_0x10811f&&!_0x125315;if(_0x4b0096){_0x123e14=_0x4b0096&&_0x125315||!_0x4b0096&&!_0x125315;}_0x38dbda['forEach'](function(_0x394af5){if(_0x394af5===_0x70d6('0x1f')){if(_0x123e14){_0x746147[_0x70d6('0x22')](_0x70d6('0x23'),_0x394af5);}else if(_0x10811f||_0x4b0096){_0x746147[_0x70d6('0x22')](_0x58dbac+'.'+_0x394af5);}}else{_0x746147[_0x70d6('0x22')](_0x58dbac+'.'+_0x394af5);}});return _0x746147;}function getSqlClauses(){var _0x14ea94={'default':squel['expr'](),'fields':squel[_0x70d6('0x24')](),'filter':squel[_0x70d6('0x24')](),'tags':{'clause':squel[_0x70d6('0x24')](),'ids':null},'user':{'clause':squel[_0x70d6('0x24')](),'skip':![]}};return _0x14ea94;}function parseTagParameter(_0xbf249e){var _0x4129af=squel['expr']();if(_0xbf249e){var _0x309d81=utils['getSelectedTags'](_0xbf249e);_0x309d81[_0x70d6('0x25')](function(_0x3f02f9){_0x4129af['or'](_0x70d6('0x26'),'%,'+_0x3f02f9+',%');});}return _0x4129af;}function parseSearchFilter(_0x518a5b){var _0x11175c=squel[_0x70d6('0x24')]();if(_0x518a5b){var _0x1652ae=_0x518a5b[_0x70d6('0x27')]('\x5c','\x5c\x5c')[_0x70d6('0x27')](/'/g,'\x27\x27');if(_0x1652ae[_0x70d6('0x28')]('\x20')['length']>0x1){_0x11175c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x70d6('0x29')](_0x1652ae),null);}else{if(qs['isNumeric'](_0x1652ae)){_0x11175c['or'](_0x70d6('0x2a'),_0x1652ae+'%');_0x11175c['or'](_0x70d6('0x2b'),_0x1652ae+'%');_0x11175c['or'](_0x70d6('0x2c'),_0x1652ae+'%');_0x11175c['or'](_0x70d6('0x2d'),_0x1652ae+'%');}else if(qs[_0x70d6('0x2e')](_0x1652ae)){_0x11175c['or'](_0x70d6('0x2f'),_0x1652ae+'%');}else{_0x11175c['or'](_0x70d6('0x30'),'%'+_0x1652ae+'%');_0x11175c['or'](_0x70d6('0x31'),'%'+_0x1652ae+'%');_0x11175c['or'](_0x70d6('0x2f'),'%'+_0x1652ae+'%');}}}return _0x11175c;}function parseAdvancedSearchFilter(_0x24a69a,_0x1d10a3){var _0xd99c36=getSqlClauses();var _0x103471=as[_0x70d6('0x32')](_0x24a69a);var _0x133ad9=_0x103471[_0x70d6('0x33')];for(var _0x3bde4d=0x0;_0x3bde4d<_0x103471[_0x70d6('0x34')][_0x70d6('0x35')];_0x3bde4d++){var _0x10d66c=_0x103471[_0x70d6('0x34')][_0x3bde4d];var _0x157d19='c';var _0x2ec1fa=_[_0x70d6('0x36')](_0x1d10a3,[_0x70d6('0x37'),_0x10d66c[_0x70d6('0x22')]]);if(_0x2ec1fa){if(_0x10d66c[_0x70d6('0x22')]==='dateOfBirth'||_0x2ec1fa[_0x70d6('0x38')]==='datetime'){_0x10d66c[_0x70d6('0x39')]='DATE';}var _0x34cc4f=as[_0x70d6('0x3a')](_0x157d19,_0x2ec1fa[_0x70d6('0x3b')],_0x10d66c);_0xd99c36[_0x70d6('0x3c')][_0x133ad9](_0x34cc4f[_0x70d6('0x3d')],_0x34cc4f[_0x70d6('0x3e')]['start'],_0x34cc4f['value'][_0x70d6('0x3f')]);}else{if(_0x10d66c[_0x70d6('0x22')]===_0x70d6('0x40')){var _0x3e09d4=_0x10d66c[_0x70d6('0x3e')][_0x70d6('0x28')](',')[_0x70d6('0x41')](function(_0x4c7954){return Number(_0x4c7954);});var _0x3f7b42=parseTagParameter(_0x3e09d4);_0xd99c36['tags'][_0x70d6('0x42')][_0x70d6('0x43')](_0x3f7b42);_0xd99c36[_0x70d6('0x44')]['ids']=_0x3e09d4;}else if(_0x10d66c[_0x70d6('0x22')]===_0x70d6('0x45')){_0xd99c36[_0x70d6('0x46')][_0x70d6('0x42')][_0x70d6('0x43')](_0x70d6('0x47'),_0x10d66c[_0x70d6('0x3e')]);_0xd99c36[_0x70d6('0x46')][_0x70d6('0x48')]=!![];}}}return _0xd99c36;}function parseModelFields(_0x262948,_0x3e144f){var _0x5597cf=squel['expr']();var _0x5b242c=_(_0x262948)[_0x70d6('0x49')]()['map'](function(_0x3fa0af){return _['some'](_0x3e144f,[_0x70d6('0x37'),_0x3fa0af])?_0x3fa0af:undefined;})[_0x70d6('0x4a')]()[_0x70d6('0x3e')]();if(_0x262948[_0x70d6('0x4b')]){_0x5b242c['push'](_0x70d6('0x4b'));}if(_0x5b242c[_0x70d6('0x35')]>0x0){_0x5b242c[_0x70d6('0x25')](function(_0x4a7691){if(_0x4a7691===_0x70d6('0x8')){_0x5597cf[_0x70d6('0x43')](_0x70d6('0x4c'),[][_0x70d6('0x4d')](_0x262948[_0x4a7691]));}else if(_0x4a7691===_0x70d6('0x4b')){var _0x411d09='%'+_0x262948[_0x4a7691]+'%';_0x5597cf[_0x70d6('0x43')](_0x70d6('0x4e'),_0x411d09);}else{_0x5597cf[_0x70d6('0x43')]('c.'+_0x4a7691+_0x70d6('0x4f'),_0x262948[_0x4a7691]);}});}return _0x5597cf;}function parseQueryParameters(_0x500075,_0xb96f15){var _0x24334c=getSqlClauses();return Promise['resolve']()[_0x70d6('0x50')](function(){return parseModelFields(_0x500075,_0xb96f15);})[_0x70d6('0x50')](function(_0x15c9bc){_0x24334c[_0x70d6('0x51')]['and'](_0x15c9bc);return parseTagParameter(_0x500075[_0x70d6('0x52')]);})['then'](function(_0x4ef40b){_0x24334c[_0x70d6('0x44')][_0x70d6('0x42')]['and'](_0x4ef40b);return parseSearchFilter(_0x500075[_0x70d6('0x53')]);})[_0x70d6('0x50')](function(_0x46a622){_0x24334c['filter']=_0x46a622;return _0x24334c;});}function checkListsRestrictions(_0x542365,_0x36e934,_0x339d6d){var _0x141bc4=squel[_0x70d6('0x24')]();return Promise[_0x70d6('0x54')]()['then'](function(){if(_0x36e934['search']&&_0x542365['role']===_0x70d6('0x6')&&!_0x339d6d){return _0x542365[_0x70d6('0x55')]({'attributes':['id'],'raw':!![]});}})[_0x70d6('0x50')](function(_0x599825){if(_0x599825){if(_0x599825[_0x70d6('0x35')]===0x0){_0x141bc4['and']('c.ListId\x20IS\x20NULL');}else{_0x141bc4[_0x70d6('0x43')](_0x70d6('0x4c'),_[_0x70d6('0x41')](_0x599825,'id'));}}})[_0x70d6('0x50')](function(){return _0x141bc4;});}function buildContactsQuery(_0x41a789,_0x154fec,_0x44f623,_0x5602a1,_0x5f1f8f,_0x5ee7f7){if(_0x154fec){_0x154fec=_0x44f623[_0x70d6('0x56')];}_0x41a789=addFieldsToQuery(_0x41a789,_0x154fec,_0x5602a1,_0x5ee7f7,!![]);var _0x31410c=squel['select']();_0x31410c=addFieldsToQuery(_0x31410c,_0x154fec,_0x5602a1,_0x5ee7f7,![]);if(_0x5602a1||_0x5ee7f7){_0x41a789=applyJoinClauses(_0x41a789,!![]);_0x41a789[_0x70d6('0x57')]('c.id');if(_0x44f623[_0x70d6('0x58')]){_0x31410c[_0x70d6('0x58')](_0x44f623[_0x70d6('0x58')]);}if(_0x44f623[_0x70d6('0x59')]){_0x31410c[_0x70d6('0x59')](_0x44f623[_0x70d6('0x59')]);}}else{_0x31410c=applyJoinClauses(_0x31410c,![]);_0x31410c[_0x70d6('0x57')]('subqry.id');if(_0x44f623[_0x70d6('0x58')]){_0x41a789[_0x70d6('0x58')](_0x44f623[_0x70d6('0x58')]);}if(_0x44f623[_0x70d6('0x59')]){_0x41a789['offset'](_0x44f623[_0x70d6('0x59')]);}}_0x31410c[_0x70d6('0x5a')](_0x5f1f8f);if(_0x44f623[_0x70d6('0x5b')]){_0x44f623[_0x70d6('0x5b')][_0x70d6('0x25')](function(_0x28cd37){_0x41a789[_0x70d6('0x5b')]('c.'+_0x28cd37[0x0],_0x28cd37[0x1]==='DESC'?![]:!![]);_0x31410c['order'](_0x70d6('0x5c')+_0x28cd37[0x0],_0x28cd37[0x1]===_0x70d6('0x5d')?![]:!![]);});}_0x31410c[_0x70d6('0xc')](_0x41a789,_0x70d6('0x10'));return _0x31410c;}function getFilteredContacts(_0x11fd22){var _0x3672fd=[];return db[_0x70d6('0x40')]['findAll']({'attributes':['id',_0x70d6('0x37'),_0x70d6('0x5e')],'raw':!![]})[_0x70d6('0x50')](function(_0x5be420){_0x3672fd=_[_0x70d6('0x5f')](_0x5be420,'id');var _0x222008={'type':db[_0x70d6('0x60')]['QueryTypes'][_0x70d6('0x61')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x70d6('0x62')](_0x11fd22[_0x70d6('0x63')](),_0x222008);})[_0x70d6('0x50')](function(_0x4f4a7b){_0x4f4a7b[_0x70d6('0x25')](function(_0x4462b5){if(_0x4462b5['TagIds']){_0x4462b5[_0x70d6('0x64')]=[];_0x4462b5[_0x70d6('0x1f')][_0x70d6('0x28')](',')[_0x70d6('0x25')](function(_0x31e88e){_0x4462b5[_0x70d6('0x64')][_0x70d6('0x21')](_0x3672fd[_0x31e88e]);});}delete _0x4462b5['TagIds'];});return _0x4f4a7b;});}function countFilteredContacts(_0x59179b,_0xe6af64){var _0x37ac2e=_0x59179b[_0x70d6('0x65')]();_0x37ac2e[_0x70d6('0x22')](_0x70d6('0x66'));_0x37ac2e=applyJoinClauses(_0x37ac2e,!![]);_0x59179b['group'](_0x70d6('0x67'));var _0x3c9eb1=utils[_0x70d6('0x68')](_0xe6af64);if(!_['isEmpty'](_0x3c9eb1)){_0x37ac2e[_0x70d6('0xe')](_0x70d6('0x69'),_0x3c9eb1);}var _0x18f48b={'type':db[_0x70d6('0x60')][_0x70d6('0x6a')][_0x70d6('0x61')],'raw':!![]};return db['sequelize'][_0x70d6('0x62')](_0x37ac2e[_0x70d6('0x63')](),_0x18f48b)['then'](function(_0x3af208){return _0x3af208[0x0][_0x70d6('0x66')];});}module[_0x70d6('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0xb6ca=['type','default','text','start','end','Tag','value','split','map','clause','and','tags','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','concat','resolve','then','fields','tag','filter','getLists','select','c.id','limit','offset','group','subqry.id','having','order','DESC','subqry.','findAll','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','COUNT(*)','isEmpty','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','email','ListId','CompanyId','createdAt','updatedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','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.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression'];(function(_0x32ff18,_0x6b905a){var _0x1834dd=function(_0x29882d){while(--_0x29882d){_0x32ff18['push'](_0x32ff18['shift']());}};_0x1834dd(++_0x6b905a);}(_0xb6ca,0x163));var _0xab6c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xb6ca[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xab6c('0x0'));var squel=require(_0xab6c('0x1'));var as=require(_0xab6c('0x2'));var qs=require(_0xab6c('0x3'));var utils=require(_0xab6c('0x4'));var db=require(_0xab6c('0x5'))['db'];function skipContactsQuery(_0x2863cc,_0x18ad0f){var _0x22fc6f=![];if(_0x2863cc[_0xab6c('0x6')]===_0xab6c('0x7')&&!_0x18ad0f[_0xab6c('0x8')]&&!_0x18ad0f['ListId']&&_0x18ad0f['autocomplete']!=='true'){_0x22fc6f=!![];}return _0x22fc6f;}function getContactsSubquery(){return squel['select']()[_0xab6c('0x9')](_0xab6c('0xa'),'c')[_0xab6c('0xb')](_0xab6c('0xc'));}function applyJoinClauses(_0x44f0cc,_0x17c955){var _0x3a8bfd=_0x17c955?'c':'subqry';_0x44f0cc[_0xab6c('0xd')](_0xab6c('0xe'),'uc',_0xab6c('0xf')+_0x3a8bfd+'.id')['left_join'](_0xab6c('0x10'),'ct','ct.CmContactId\x20=\x20'+_0x3a8bfd+'.id')[_0xab6c('0xd')](_0xab6c('0x11'),'t',_0xab6c('0x12'));return _0x44f0cc;}function addFieldsToQuery(_0x29c12d,_0x4bbd42,_0x3f0fe4,_0x11bb8a,_0x4b3935){var _0x1b9f24=_0x4b3935?'c':_0xab6c('0x13');if(!_0x4bbd42){_0x4bbd42=['id',_0xab6c('0x14'),_0xab6c('0x15'),'phone','mobile','fax',_0xab6c('0x16'),_0xab6c('0x17'),_0xab6c('0x18'),_0xab6c('0x19'),_0xab6c('0x1a'),'deletedAt','TagIds'];}else if(!_0x4bbd42[_0xab6c('0x1b')]('id')){_0x4bbd42[_0xab6c('0x1c')]('id');}var _0xdbcb99=_0x3f0fe4&&_0x4b3935||!_0x3f0fe4&&!_0x4b3935;if(_0x11bb8a){_0xdbcb99=_0x11bb8a&&_0x4b3935||!_0x11bb8a&&!_0x4b3935;}_0x4bbd42[_0xab6c('0x1d')](function(_0x35cf36){if(_0x35cf36===_0xab6c('0x1e')){if(_0xdbcb99){_0x29c12d[_0xab6c('0x1f')](_0xab6c('0x20'),_0x35cf36);}else if(_0x3f0fe4||_0x11bb8a){_0x29c12d['field'](_0x1b9f24+'.'+_0x35cf36);}}else{_0x29c12d[_0xab6c('0x1f')](_0x1b9f24+'.'+_0x35cf36);}});return _0x29c12d;}function getSqlClauses(){var _0xd18118={'default':squel['expr'](),'fields':squel[_0xab6c('0x21')](),'filter':squel[_0xab6c('0x21')](),'tags':{'clause':squel[_0xab6c('0x21')](),'ids':null},'user':{'clause':squel[_0xab6c('0x21')](),'skip':![]}};return _0xd18118;}function parseTagParameter(_0x3e2b88){var _0x137272=squel['expr']();if(_0x3e2b88){var _0x40e380=utils[_0xab6c('0x22')](_0x3e2b88);_0x40e380['forEach'](function(_0x2317d2){_0x137272['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2317d2+',%');});}return _0x137272;}function parseSearchFilter(_0x339191){var _0x3da047=squel[_0xab6c('0x21')]();if(_0x339191){var _0x210f4a=_0x339191[_0xab6c('0x23')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x210f4a['split']('\x20')['length']>0x1){_0x3da047['or'](_0xab6c('0x24'),qs[_0xab6c('0x25')](_0x210f4a),null);}else{if(qs[_0xab6c('0x26')](_0x210f4a)){_0x3da047['or'](_0xab6c('0x27'),_0x210f4a+'%');_0x3da047['or']('c.phone\x20LIKE\x20?',_0x210f4a+'%');_0x3da047['or'](_0xab6c('0x28'),_0x210f4a+'%');_0x3da047['or'](_0xab6c('0x29'),_0x210f4a+'%');}else if(qs[_0xab6c('0x2a')](_0x210f4a)){_0x3da047['or'](_0xab6c('0x2b'),_0x210f4a+'%');}else{_0x3da047['or'](_0xab6c('0x2c'),'%'+_0x210f4a+'%');_0x3da047['or'](_0xab6c('0x2d'),'%'+_0x210f4a+'%');_0x3da047['or']('c.email\x20LIKE\x20?','%'+_0x210f4a+'%');}}}return _0x3da047;}function parseAdvancedSearchFilter(_0x4a7eca,_0x34835f){var _0x33067a=getSqlClauses();var _0xad90b1=as[_0xab6c('0x2e')](_0x4a7eca);var _0xfd14c3=_0xad90b1['sqlOperator'];for(var _0x2ad610=0x0;_0x2ad610<_0xad90b1[_0xab6c('0x2f')][_0xab6c('0x30')];_0x2ad610++){var _0x2f5783=_0xad90b1[_0xab6c('0x2f')][_0x2ad610];var _0x314d12='c';var _0x2d6ecf=_[_0xab6c('0x31')](_0x34835f,[_0xab6c('0x32'),_0x2f5783[_0xab6c('0x1f')]]);if(_0x2d6ecf){if(_0x2f5783[_0xab6c('0x1f')]===_0xab6c('0x33')||_0x2d6ecf[_0xab6c('0x34')]===_0xab6c('0x35')){_0x2f5783[_0xab6c('0x36')]=_0xab6c('0x37');}var _0x36c5c2=as[_0xab6c('0x38')](_0x314d12,_0x2d6ecf[_0xab6c('0x39')],_0x2f5783);_0x33067a[_0xab6c('0x3a')][_0xfd14c3](_0x36c5c2[_0xab6c('0x3b')],_0x36c5c2['value'][_0xab6c('0x3c')],_0x36c5c2['value'][_0xab6c('0x3d')]);}else{if(_0x2f5783[_0xab6c('0x1f')]===_0xab6c('0x3e')){var _0x4c3b59=_0x2f5783[_0xab6c('0x3f')][_0xab6c('0x40')](',')[_0xab6c('0x41')](function(_0x3509e2){return Number(_0x3509e2);});var _0x1ae9a4=parseTagParameter(_0x4c3b59);_0x33067a['tags'][_0xab6c('0x42')][_0xab6c('0x43')](_0x1ae9a4);_0x33067a[_0xab6c('0x44')]['ids']=_0x4c3b59;}else if(_0x2f5783['field']==='User'){_0x33067a[_0xab6c('0x45')][_0xab6c('0x42')][_0xab6c('0x43')](_0xab6c('0x46'),_0x2f5783[_0xab6c('0x3f')]);_0x33067a[_0xab6c('0x45')][_0xab6c('0x47')]=!![];}}}return _0x33067a;}function parseModelFields(_0xe7ba33,_0x528b8c){var _0x13eade=squel['expr']();var _0x5891d6=_(_0xe7ba33)[_0xab6c('0x48')]()[_0xab6c('0x41')](function(_0x5ed54e){return _[_0xab6c('0x49')](_0x528b8c,['name',_0x5ed54e])?_0x5ed54e:undefined;})['compact']()[_0xab6c('0x3f')]();if(_0xe7ba33[_0xab6c('0x4a')]){_0x5891d6[_0xab6c('0x1c')]('Contact');}if(_0x5891d6['length']>0x0){_0x5891d6[_0xab6c('0x1d')](function(_0xb2f740){if(_0xb2f740===_0xab6c('0x17')){_0x13eade[_0xab6c('0x43')](_0xab6c('0x4b'),[][_0xab6c('0x4c')](_0xe7ba33[_0xb2f740]));}else if(_0xb2f740===_0xab6c('0x4a')){var _0xe84db8='%'+_0xe7ba33[_0xb2f740]+'%';_0x13eade[_0xab6c('0x43')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0xe84db8);}else{_0x13eade[_0xab6c('0x43')]('c.'+_0xb2f740+'\x20=\x20?',_0xe7ba33[_0xb2f740]);}});}return _0x13eade;}function parseQueryParameters(_0x18d3ba,_0x4524f2){var _0x386f73=getSqlClauses();return Promise[_0xab6c('0x4d')]()[_0xab6c('0x4e')](function(){return parseModelFields(_0x18d3ba,_0x4524f2);})[_0xab6c('0x4e')](function(_0x5be0b8){_0x386f73[_0xab6c('0x4f')][_0xab6c('0x43')](_0x5be0b8);return parseTagParameter(_0x18d3ba[_0xab6c('0x50')]);})[_0xab6c('0x4e')](function(_0xac5969){_0x386f73[_0xab6c('0x44')][_0xab6c('0x42')][_0xab6c('0x43')](_0xac5969);return parseSearchFilter(_0x18d3ba[_0xab6c('0x51')]);})['then'](function(_0x4339c4){_0x386f73[_0xab6c('0x51')]=_0x4339c4;return _0x386f73;});}function checkListsRestrictions(_0x3501c5,_0x4d0f89,_0x2ff365){var _0x1d96fb=squel['expr']();return Promise['resolve']()[_0xab6c('0x4e')](function(){if(_0x4d0f89[_0xab6c('0x8')]&&_0x3501c5[_0xab6c('0x6')]===_0xab6c('0x7')&&!_0x2ff365){return _0x3501c5[_0xab6c('0x52')]({'attributes':['id'],'raw':!![]});}})[_0xab6c('0x4e')](function(_0x112652){if(_0x112652){if(_0x112652[_0xab6c('0x30')]===0x0){_0x1d96fb[_0xab6c('0x43')]('c.ListId\x20IS\x20NULL');}else{_0x1d96fb[_0xab6c('0x43')](_0xab6c('0x4b'),_[_0xab6c('0x41')](_0x112652,'id'));}}})[_0xab6c('0x4e')](function(){return _0x1d96fb;});}function buildContactsQuery(_0x28e168,_0x5c21cb,_0x2c70c7,_0x54db0b,_0x31ee2d,_0x315e79){if(_0x5c21cb){_0x5c21cb=_0x2c70c7['attributes'];}_0x28e168=addFieldsToQuery(_0x28e168,_0x5c21cb,_0x54db0b,_0x315e79,!![]);var _0x52e807=squel[_0xab6c('0x53')]();_0x52e807=addFieldsToQuery(_0x52e807,_0x5c21cb,_0x54db0b,_0x315e79,![]);if(_0x54db0b||_0x315e79){_0x28e168=applyJoinClauses(_0x28e168,!![]);_0x28e168['group'](_0xab6c('0x54'));if(_0x2c70c7[_0xab6c('0x55')]){_0x52e807[_0xab6c('0x55')](_0x2c70c7[_0xab6c('0x55')]);}if(_0x2c70c7['offset']){_0x52e807[_0xab6c('0x56')](_0x2c70c7[_0xab6c('0x56')]);}}else{_0x52e807=applyJoinClauses(_0x52e807,![]);_0x52e807[_0xab6c('0x57')](_0xab6c('0x58'));if(_0x2c70c7[_0xab6c('0x55')]){_0x28e168[_0xab6c('0x55')](_0x2c70c7['limit']);}if(_0x2c70c7[_0xab6c('0x56')]){_0x28e168[_0xab6c('0x56')](_0x2c70c7[_0xab6c('0x56')]);}}_0x52e807[_0xab6c('0x59')](_0x31ee2d);if(_0x2c70c7[_0xab6c('0x5a')]){_0x2c70c7[_0xab6c('0x5a')][_0xab6c('0x1d')](function(_0x494e93){_0x28e168[_0xab6c('0x5a')]('c.'+_0x494e93[0x0],_0x494e93[0x1]===_0xab6c('0x5b')?![]:!![]);_0x52e807[_0xab6c('0x5a')](_0xab6c('0x5c')+_0x494e93[0x0],_0x494e93[0x1]==='DESC'?![]:!![]);});}_0x52e807[_0xab6c('0x9')](_0x28e168,_0xab6c('0x13'));return _0x52e807;}function getFilteredContacts(_0x325f0b){var _0x3f3075=[];return db[_0xab6c('0x3e')][_0xab6c('0x5d')]({'attributes':['id','name','color'],'raw':!![]})[_0xab6c('0x4e')](function(_0xe44ebf){_0x3f3075=_['keyBy'](_0xe44ebf,'id');var _0x2244cb={'type':db[_0xab6c('0x5e')][_0xab6c('0x5f')][_0xab6c('0x60')],'model':db[_0xab6c('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xab6c('0x62')][_0xab6c('0x63')](_0x325f0b['toString'](),_0x2244cb);})['then'](function(_0x4b5868){_0x4b5868[_0xab6c('0x1d')](function(_0x42a0bc){if(_0x42a0bc[_0xab6c('0x1e')]){_0x42a0bc['Tags']=[];_0x42a0bc[_0xab6c('0x1e')][_0xab6c('0x40')](',')[_0xab6c('0x1d')](function(_0x44ec51){_0x42a0bc['Tags'][_0xab6c('0x1c')](_0x3f3075[_0x44ec51]);});}delete _0x42a0bc[_0xab6c('0x1e')];});return _0x4b5868;});}function countFilteredContacts(_0x15fa05,_0x1bf8f3){var _0x528be4=_0x15fa05['clone']();_0x528be4['field'](_0xab6c('0x64'));_0x528be4=applyJoinClauses(_0x528be4,!![]);_0x15fa05[_0xab6c('0x57')](_0xab6c('0x54'));var _0x3c0526=utils[_0xab6c('0x22')](_0x1bf8f3);if(!_[_0xab6c('0x65')](_0x3c0526)){_0x528be4['where']('t.id\x20IN\x20?',_0x3c0526);}var _0x13dfe3={'type':db[_0xab6c('0x5e')][_0xab6c('0x5f')]['SELECT'],'raw':!![]};return db[_0xab6c('0x62')][_0xab6c('0x63')](_0x528be4['toString'](),_0x13dfe3)['then'](function(_0x476ba1){return _0x476ba1[0x0][_0xab6c('0x64')];});}module[_0xab6c('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
index 044e871..6c5336b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3aa=['unlink','decryptFile','createDecipher','data','encryptString','secret','utf8','decryptString','base64','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close'];(function(_0x2b948f,_0x398e62){var _0x1237bc=function(_0x3c1843){while(--_0x3c1843){_0x2b948f['push'](_0x2b948f['shift']());}};_0x1237bc(++_0x398e62);}(_0xb3aa,0xf0));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xab3a('0x0'));var config=require(_0xab3a('0x1'));var logger=require(_0xab3a('0x2'))(_0xab3a('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xab3a('0x4')]['session'],'algorithm':_0xab3a('0x5')};const fileOptions={'algorithm':_0xab3a('0x6')};if(config[_0xab3a('0x7')]&&config[_0xab3a('0x7')][_0xab3a('0x8')]){var isSupported=isAlgorithmSupported(config[_0xab3a('0x7')][_0xab3a('0x8')]);if(isSupported){fileOptions[_0xab3a('0x8')]=config[_0xab3a('0x7')][_0xab3a('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xab3a('0x9')](config[_0xab3a('0x7')]['algorithm'],_0xab3a('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x232efd){return AES_SUPPORTED_RX[_0xab3a('0xb')](_0x232efd);}function getSupportedCiphers(){return crypto[_0xab3a('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x232592){return getSupportedCiphers()[_0xab3a('0xd')](_0x232592)>-0x1;}function combineOptions(_0x32a87b){var _0x45e5b4={};for(var _0x5b098c in fileOptions){if(fileOptions[_0xab3a('0xe')](_0x5b098c)){_0x45e5b4[_0x5b098c]=fileOptions[_0x5b098c];}}if(_0x32a87b){for(var _0xfe927c in _0x32a87b){if(_0x32a87b['hasOwnProperty'](_0xfe927c)){_0x45e5b4[_0xfe927c]=_0x32a87b[_0xfe927c];}}}return _0x45e5b4;}exports['encryptFile']=function(_0x35742b,_0x554d25,_0x562277,_0x2a11fa){return new BPromise(function(_0x3d3633,_0x5838a4){_0x2a11fa=combineOptions(_0x2a11fa);var _0x501285=new Buffer(_0x562277);var _0x39aff9=fs[_0xab3a('0xf')](_0x35742b);var _0x3f9609=fs[_0xab3a('0x10')](_0x554d25);var _0x2f2d75=crypto[_0xab3a('0x11')](_0x2a11fa[_0xab3a('0x8')],_0x501285);_0x39aff9['on']('data',function(_0x1c4d8d){var _0x2809dd=new Buffer(_0x2f2d75[_0xab3a('0x12')](_0x1c4d8d),_0xab3a('0x13'));_0x3f9609[_0xab3a('0x14')](_0x2809dd);});_0x39aff9['on'](_0xab3a('0x15'),function(){try{var _0x3b5ebc=new Buffer(_0x2f2d75[_0xab3a('0x16')](_0xab3a('0x13')),_0xab3a('0x13'));_0x3f9609['write'](_0x3b5ebc);_0x3f9609[_0xab3a('0x15')]();_0x3f9609['on'](_0xab3a('0x17'),function(){return _0x3d3633(_0x554d25);});}catch(_0x19a05c){fs[_0xab3a('0x18')](_0x554d25);return _0x5838a4(_0x19a05c);}});});};exports[_0xab3a('0x19')]=function(_0x59212f,_0x275a02,_0x20aeb5,_0x58ebc1){return new BPromise(function(_0x3594ea,_0xb105ea){_0x58ebc1=combineOptions(_0x58ebc1);var _0x46a028=new Buffer(_0x20aeb5);var _0x47e30f=fs[_0xab3a('0xf')](_0x59212f);var _0x413f74=fs['createWriteStream'](_0x275a02);var _0x24d54d=crypto[_0xab3a('0x1a')](_0x58ebc1[_0xab3a('0x8')],_0x46a028);_0x47e30f['on'](_0xab3a('0x1b'),function(_0x5a4ee9){var _0x93f817=new Buffer(_0x24d54d['update'](_0x5a4ee9),_0xab3a('0x13'));_0x413f74['write'](_0x93f817);});_0x47e30f['on'](_0xab3a('0x15'),function(){try{var _0x56eb19=new Buffer(_0x24d54d[_0xab3a('0x16')]('binary'),_0xab3a('0x13'));_0x413f74[_0xab3a('0x14')](_0x56eb19);_0x413f74[_0xab3a('0x15')]();_0x413f74['on'](_0xab3a('0x17'),function(){return _0x3594ea(_0x275a02);});}catch(_0x1a7556){fs[_0xab3a('0x18')](_0x275a02);return _0xb105ea(_0x1a7556);}});});};exports[_0xab3a('0x1c')]=function(_0xc78096,_0x3c1bac,_0x1b2ea5){var _0x3b2023=_0x1b2ea5||stringOptions[_0xab3a('0x8')];var _0x36c9a3=_0x3c1bac||stringOptions[_0xab3a('0x1d')];var _0x2e82e1=crypto[_0xab3a('0x11')](_0x3b2023,_0x36c9a3);var _0x488ab7=_0x2e82e1[_0xab3a('0x12')](_0xc78096,_0xab3a('0x1e'),'base64');_0x488ab7+=_0x2e82e1[_0xab3a('0x16')]('base64');return _0x488ab7;};exports[_0xab3a('0x1f')]=function(_0x5e93d3,_0x57084a,_0x143955){var _0xf0748b=_0x143955||stringOptions[_0xab3a('0x8')];var _0x417dc4=_0x57084a||stringOptions[_0xab3a('0x1d')];var _0x5a63a8=crypto[_0xab3a('0x1a')](_0xf0748b,_0x417dc4);var _0x360bef=_0x5a63a8[_0xab3a('0x12')](_0x5e93d3,_0xab3a('0x20'),_0xab3a('0x1e'));_0x360bef+=_0x5a63a8[_0xab3a('0x16')](_0xab3a('0x1e'));return _0x360bef;};
\ No newline at end of file
+var _0x1433=['crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','data','update','binary','write','final','end','close','unlink','createWriteStream','createDecipher','encryptString','secret','createCipher','base64','decryptString','utf8'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x1433,0x88));var _0x3143=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1433[_0x397e5f];return _0x5302b8;};'use strict';var crypto=require(_0x3143('0x0'));var fs=require('fs');var BPromise=require(_0x3143('0x1'));var _=require(_0x3143('0x2'));var config=require('../../config/environment');var logger=require(_0x3143('0x3'))(_0x3143('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3143('0x5')][_0x3143('0x6')],'algorithm':_0x3143('0x7')};const fileOptions={'algorithm':_0x3143('0x8')};if(config[_0x3143('0x9')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x3143('0x9')][_0x3143('0xa')]);if(isSupported){fileOptions[_0x3143('0xa')]=config[_0x3143('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x3143('0xb')](config[_0x3143('0x9')][_0x3143('0xa')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x432053){return AES_SUPPORTED_RX[_0x3143('0xc')](_0x432053);}function getSupportedCiphers(){return crypto[_0x3143('0xd')]()[_0x3143('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0xc95a86){return getSupportedCiphers()['indexOf'](_0xc95a86)>-0x1;}function combineOptions(_0x1d027f){var _0x24f443={};for(var _0x2ea338 in fileOptions){if(fileOptions[_0x3143('0xf')](_0x2ea338)){_0x24f443[_0x2ea338]=fileOptions[_0x2ea338];}}if(_0x1d027f){for(var _0x371768 in _0x1d027f){if(_0x1d027f[_0x3143('0xf')](_0x371768)){_0x24f443[_0x371768]=_0x1d027f[_0x371768];}}}return _0x24f443;}exports[_0x3143('0x10')]=function(_0x2977c7,_0x3312e6,_0x398978,_0x396339){return new BPromise(function(_0x5da57f,_0x58ce54){_0x396339=combineOptions(_0x396339);var _0xf9bd4c=new Buffer(_0x398978);var _0x539728=fs[_0x3143('0x11')](_0x2977c7);var _0x3b6350=fs['createWriteStream'](_0x3312e6);var _0x62ba59=crypto['createCipher'](_0x396339['algorithm'],_0xf9bd4c);_0x539728['on'](_0x3143('0x12'),function(_0x32b162){var _0x5e107b=new Buffer(_0x62ba59[_0x3143('0x13')](_0x32b162),_0x3143('0x14'));_0x3b6350[_0x3143('0x15')](_0x5e107b);});_0x539728['on']('end',function(){try{var _0x45c7c1=new Buffer(_0x62ba59[_0x3143('0x16')]('binary'),_0x3143('0x14'));_0x3b6350['write'](_0x45c7c1);_0x3b6350[_0x3143('0x17')]();_0x3b6350['on'](_0x3143('0x18'),function(){return _0x5da57f(_0x3312e6);});}catch(_0x3d383a){fs[_0x3143('0x19')](_0x3312e6);return _0x58ce54(_0x3d383a);}});});};exports['decryptFile']=function(_0x21c232,_0x46aebf,_0x588cab,_0x290afa){return new BPromise(function(_0x5e789a,_0x54b894){_0x290afa=combineOptions(_0x290afa);var _0x477d4a=new Buffer(_0x588cab);var _0x25ee67=fs[_0x3143('0x11')](_0x21c232);var _0x3c3580=fs[_0x3143('0x1a')](_0x46aebf);var _0x1fd4e6=crypto[_0x3143('0x1b')](_0x290afa[_0x3143('0xa')],_0x477d4a);_0x25ee67['on'](_0x3143('0x12'),function(_0x21468d){var _0x456632=new Buffer(_0x1fd4e6[_0x3143('0x13')](_0x21468d),'binary');_0x3c3580[_0x3143('0x15')](_0x456632);});_0x25ee67['on']('end',function(){try{var _0x531b6a=new Buffer(_0x1fd4e6[_0x3143('0x16')](_0x3143('0x14')),'binary');_0x3c3580[_0x3143('0x15')](_0x531b6a);_0x3c3580[_0x3143('0x17')]();_0x3c3580['on'](_0x3143('0x18'),function(){return _0x5e789a(_0x46aebf);});}catch(_0x543404){fs[_0x3143('0x19')](_0x46aebf);return _0x54b894(_0x543404);}});});};exports[_0x3143('0x1c')]=function(_0x4a40fd,_0x5ec873,_0x399f43){var _0x2c0e91=_0x399f43||stringOptions['algorithm'];var _0x47f4d5=_0x5ec873||stringOptions[_0x3143('0x1d')];var _0x17801d=crypto[_0x3143('0x1e')](_0x2c0e91,_0x47f4d5);var _0x1326bd=_0x17801d[_0x3143('0x13')](_0x4a40fd,'utf8',_0x3143('0x1f'));_0x1326bd+=_0x17801d['final'](_0x3143('0x1f'));return _0x1326bd;};exports[_0x3143('0x20')]=function(_0x59ec1f,_0x333b65,_0x592320){var _0x5407c4=_0x592320||stringOptions['algorithm'];var _0x283013=_0x333b65||stringOptions['secret'];var _0x5f2657=crypto[_0x3143('0x1b')](_0x5407c4,_0x283013);var _0x17b1a9=_0x5f2657[_0x3143('0x13')](_0x59ec1f,_0x3143('0x1f'),_0x3143('0x21'));_0x17b1a9+=_0x5f2657[_0x3143('0x16')]('utf8');return _0x17b1a9;};
\ No newline at end of file
index 4a4c820..bba8951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ca=['Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','CSV'];(function(_0x1b766b,_0x96cc4d){var _0x2c20cc=function(_0x1e7308){while(--_0x1e7308){_0x1b766b['push'](_0x1b766b['shift']());}};_0x2c20cc(++_0x96cc4d);}(_0x60ca,0x81));var _0xa60c=function(_0x482423,_0x56266d){_0x482423=_0x482423-0x0;var _0x34d172=_0x60ca[_0x482423];return _0x34d172;};'use strict';var util=require(_0xa60c('0x0'));var path=require(_0xa60c('0x1'));var _=require(_0xa60c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xa60c('0x3'));var zipdir=require(_0xa60c('0x4'));var rimraf=require(_0xa60c('0x5'));var db=require(_0xa60c('0x6'))['db'];var dbH=require(_0xa60c('0x6'))[_0xa60c('0x7')];var logger=require(_0xa60c('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa60c('0x9')][0x2]);var QUERY=process[_0xa60c('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b8fbb,_0x586aa1){var _0x290121={'status':_0x3b8fbb};var _0x2068f2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x586aa1){_0x290121[_0xa60c('0xa')]=_0x586aa1;}return db[_0xa60c('0xb')][_0xa60c('0xc')](_0x290121,_0x2068f2);}function main(){var _0x2cb97b=0x1388;var _0x5abc02;logger['info'](util[_0xa60c('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa60c('0xe')));return db[_0xa60c('0xf')][_0xa60c('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa60c('0x11'),_0xa60c('0x12')]})[_0xa60c('0x13')](function(_0x4c2a7c){if(_0x4c2a7c){_0x5abc02=_0x4c2a7c;_0x2cb97b=_0x5abc02['splitSizeCsv']||0x1388;}})[_0xa60c('0x13')](function(){return dbH['sequelize'][_0xa60c('0x14')](util['format'](_0xa60c('0x15'),QUERY),{'type':dbH[_0xa60c('0x16')][_0xa60c('0x17')][_0xa60c('0x18')]});})[_0xa60c('0x13')](function(_0x5ba0ac){if(!_0x5ba0ac[0x0]['num']){return analyticExtractedReport('Empty');}var _0x7a8c7d=[];var _0x567f55=0x0;if(_0x5abc02[_0xa60c('0x11')]){if(_0x5ba0ac&&_0x5ba0ac[_0xa60c('0x19')]){var _0x2de85f=_[_0xa60c('0x1a')](_0x5ba0ac[0x0]['num']/_0x2cb97b);var _0x29aa7b=Number['isInteger'](_0x5ba0ac[0x0][_0xa60c('0x1b')]/_0x2cb97b)?_0x5ba0ac[0x0][_0xa60c('0x1b')]%_0x2cb97b:0x0;_0x2de85f[_0xa60c('0x1c')](function(_0x4116d8){if(_0x4116d8>0x0){_0x567f55+=_0x2cb97b;}_0x7a8c7d[_0xa60c('0x1d')](dbH['sequelize'][_0xa60c('0x14')](util[_0xa60c('0xd')](_0xa60c('0x1e'),QUERY,_0x2cb97b,_0x567f55),{'type':dbH[_0xa60c('0x16')][_0xa60c('0x17')][_0xa60c('0x18')]}));});if(_0x29aa7b>0x0){_0x567f55+=_0x2cb97b;_0x7a8c7d[_0xa60c('0x1d')](dbH[_0xa60c('0x16')][_0xa60c('0x14')](util[_0xa60c('0xd')](_0xa60c('0x1e'),QUERY,_0x29aa7b,_0x567f55),{'type':dbH[_0xa60c('0x16')]['QueryTypes'][_0xa60c('0x18')]}));}}}else{_0x7a8c7d['push'](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xa60c('0x17')]['SELECT']}));}var _0x1192b3=path[_0xa60c('0x1f')](PATH);var _0x428701=path[_0xa60c('0x20')](PATH,_0xa60c('0x21'));var _0x3e0487=_0x5abc02[_0xa60c('0x11')]&&_0x7a8c7d[_0xa60c('0x19')]>0x1;var _0x1a067f=[];if(!fs[_0xa60c('0x22')](path['join'](_0x1192b3,_0x428701))&&_0x3e0487){fs[_0xa60c('0x23')](path['join'](_0x1192b3,_0x428701));}return BPromise['each'](_0x7a8c7d,function(_0x37c475){_0x1a067f[_0xa60c('0x1d')](_0x37c475);})['then'](function(){for(var _0x14fda9=0x0;_0x14fda9<_0x1a067f[_0xa60c('0x19')];_0x14fda9+=0x1){var _0x4427ca;var _0x4c310f=_0x1a067f[_0x14fda9];if(_0x3e0487){_0x4427ca=path[_0xa60c('0x24')](_0x1192b3,_0x428701,util[_0xa60c('0xd')]('%s%d.%s',_0x428701,_0x14fda9,_0xa60c('0x25')));}else{_0x4427ca=path['join'](_0x1192b3,util['format'](_0xa60c('0x26'),_0x428701,_0xa60c('0x25')));}fs['writeFileSync'](_0x4427ca,csv(_0x4c310f));}})[_0xa60c('0x13')](function(){if(_0x3e0487){return new Promise(function(_0x44a714){zipdir(path['join'](_0x1192b3,_0x428701),{'saveTo':path[_0xa60c('0x24')](_0x1192b3,util[_0xa60c('0xd')](_0xa60c('0x26'),_0x428701,_0xa60c('0x27')))},function(_0x36237f,_0x5241be){rimraf(path[_0xa60c('0x24')](_0x1192b3,_0x428701),function(){});_0x44a714(_0xa60c('0x28'));});});}})['then'](function(){logger['info'](util[_0xa60c('0xd')](_0xa60c('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xa60c('0x2a'),_0x3e0487?util['format'](_0xa60c('0x26'),_0x428701,_0x3e0487?_0xa60c('0x27'):'csv'):null);});})['catch'](function(_0x35db00){logger[_0xa60c('0x2b')](util[_0xa60c('0xd')](_0xa60c('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x35db00,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa60c('0x2d'));})[_0xa60c('0x2e')](function(){process[_0xa60c('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xc6c3=['join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','split','existsSync'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6c3,0x1e3));var _0x3c6c=function(_0x93bb56,_0x189301){_0x93bb56=_0x93bb56-0x0;var _0x4d140b=_0xc6c3[_0x93bb56];return _0x4d140b;};'use strict';var util=require(_0x3c6c('0x0'));var path=require(_0x3c6c('0x1'));var _=require(_0x3c6c('0x2'));var csv=require(_0x3c6c('0x3'));var fs=require('fs');var BPromise=require(_0x3c6c('0x4'));var zipdir=require(_0x3c6c('0x5'));var rimraf=require(_0x3c6c('0x6'));var db=require(_0x3c6c('0x7'))['db'];var dbH=require(_0x3c6c('0x7'))[_0x3c6c('0x8')];var logger=require(_0x3c6c('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3c6c('0xa')][0x2]);var QUERY=process[_0x3c6c('0xa')][0x3];var PATH=process[_0x3c6c('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3905e5,_0x213268){var _0x40a2ed={'status':_0x3905e5};var _0x5f564a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x213268){_0x40a2ed[_0x3c6c('0xb')]=_0x213268;}return db[_0x3c6c('0xc')][_0x3c6c('0xd')](_0x40a2ed,_0x5f564a);}function main(){var _0x1eac6f=0x1388;var _0x140819;logger['info'](util['format'](_0x3c6c('0xe'),EXTRACTED_REPORT_ID,_0x3c6c('0xf')));return db[_0x3c6c('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x3c6c('0x11')](function(_0x349ea8){if(_0x349ea8){_0x140819=_0x349ea8;_0x1eac6f=_0x140819['splitSizeCsv']||0x1388;}})[_0x3c6c('0x11')](function(){return dbH[_0x3c6c('0x12')][_0x3c6c('0x13')](util[_0x3c6c('0x14')](_0x3c6c('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x3c6c('0x16')]});})[_0x3c6c('0x11')](function(_0x49a8c5){if(!_0x49a8c5[0x0][_0x3c6c('0x17')]){return analyticExtractedReport('Empty');}var _0x1b04b7=[];var _0x4baf9e=0x0;if(_0x140819['split']){if(_0x49a8c5&&_0x49a8c5[_0x3c6c('0x18')]){var _0x177600=_[_0x3c6c('0x19')](_0x49a8c5[0x0]['num']/_0x1eac6f);var _0x53814a=Number[_0x3c6c('0x1a')](_0x49a8c5[0x0][_0x3c6c('0x17')]/_0x1eac6f)?_0x49a8c5[0x0]['num']%_0x1eac6f:0x0;_0x177600[_0x3c6c('0x1b')](function(_0x47162d){if(_0x47162d>0x0){_0x4baf9e+=_0x1eac6f;}_0x1b04b7[_0x3c6c('0x1c')](dbH[_0x3c6c('0x12')][_0x3c6c('0x13')](util[_0x3c6c('0x14')](_0x3c6c('0x1d'),QUERY,_0x1eac6f,_0x4baf9e),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));});if(_0x53814a>0x0){_0x4baf9e+=_0x1eac6f;_0x1b04b7[_0x3c6c('0x1c')](dbH[_0x3c6c('0x12')]['query'](util[_0x3c6c('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x53814a,_0x4baf9e),{'type':dbH[_0x3c6c('0x12')][_0x3c6c('0x1e')][_0x3c6c('0x16')]}));}}}else{_0x1b04b7['push'](dbH[_0x3c6c('0x12')][_0x3c6c('0x13')](QUERY,{'type':dbH[_0x3c6c('0x12')][_0x3c6c('0x1e')][_0x3c6c('0x16')]}));}var _0x2a20e3=path['dirname'](PATH);var _0x5ae8e9=path[_0x3c6c('0x1f')](PATH,'.csv');var _0x42ef1c=_0x140819[_0x3c6c('0x20')]&&_0x1b04b7['length']>0x1;var _0x4824b8=[];if(!fs[_0x3c6c('0x21')](path[_0x3c6c('0x22')](_0x2a20e3,_0x5ae8e9))&&_0x42ef1c){fs['mkdirSync'](path['join'](_0x2a20e3,_0x5ae8e9));}return BPromise[_0x3c6c('0x23')](_0x1b04b7,function(_0x41a4ca){_0x4824b8[_0x3c6c('0x1c')](_0x41a4ca);})[_0x3c6c('0x11')](function(){for(var _0x86d312=0x0;_0x86d312<_0x4824b8['length'];_0x86d312+=0x1){var _0x2930b7;var _0x186490=_0x4824b8[_0x86d312];if(_0x42ef1c){_0x2930b7=path[_0x3c6c('0x22')](_0x2a20e3,_0x5ae8e9,util[_0x3c6c('0x14')](_0x3c6c('0x24'),_0x5ae8e9,_0x86d312,_0x3c6c('0x25')));}else{_0x2930b7=path[_0x3c6c('0x22')](_0x2a20e3,util[_0x3c6c('0x14')](_0x3c6c('0x26'),_0x5ae8e9,_0x3c6c('0x25')));}fs[_0x3c6c('0x27')](_0x2930b7,csv(_0x186490));}})['then'](function(){if(_0x42ef1c){return new Promise(function(_0x3b1725){zipdir(path[_0x3c6c('0x22')](_0x2a20e3,_0x5ae8e9),{'saveTo':path[_0x3c6c('0x22')](_0x2a20e3,util[_0x3c6c('0x14')]('%s.%s',_0x5ae8e9,_0x3c6c('0x28')))},function(_0x2e3c4a,_0x5c2f97){rimraf(path[_0x3c6c('0x22')](_0x2a20e3,_0x5ae8e9),function(){});_0x3b1725(_0x3c6c('0x29'));});});}})[_0x3c6c('0x11')](function(){logger[_0x3c6c('0x2a')](util[_0x3c6c('0x14')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x3c6c('0x2b'),_0x42ef1c?util[_0x3c6c('0x14')](_0x3c6c('0x26'),_0x5ae8e9,_0x42ef1c?_0x3c6c('0x28'):_0x3c6c('0x25')):null);});})[_0x3c6c('0x2c')](function(_0x4af34d){logger['info'](util['format'](_0x3c6c('0x2d'),EXTRACTED_REPORT_ID,_0x3c6c('0xf')),util['inspect'](_0x4af34d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x3c6c('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
index d2fe972..a745798 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b95=['length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','header','pageBreak','before','landscape','toString','\x20/\x20','Arial','right','Empty','Setting','then','split','range','num','query','QueryTypes','SELECT','sequelize','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','util','path','moment','zip-dir','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','fill'];(function(_0xdf7c9a,_0x151b54){var _0x35f732=function(_0x517194){while(--_0x517194){_0xdf7c9a['push'](_0xdf7c9a['shift']());}};_0x35f732(++_0x151b54);}(_0x6b95,0x95));var _0x56b9=function(_0xbdc6f3,_0x1dd7bb){_0xbdc6f3=_0xbdc6f3-0x0;var _0x5dd276=_0x6b95[_0xbdc6f3];return _0x5dd276;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x56b9('0x0'));var path=require(_0x56b9('0x1'));var moment=require(_0x56b9('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x56b9('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0x56b9('0x4'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x56b9('0x5'));var db=require(_0x56b9('0x6'))['db'];var dbH=require(_0x56b9('0x6'))[_0x56b9('0x7')];var logger=require(_0x56b9('0x8'))(_0x56b9('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x56b9('0xa')][0x3];var PATH=process[_0x56b9('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x56b9('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xa39fdf,_0x1f343a){var _0x3c2782={'status':_0xa39fdf};var _0x3058af={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f343a){_0x3c2782[_0x56b9('0xc')]=_0x1f343a;}return db[_0x56b9('0xd')][_0x56b9('0xe')](_0x3c2782,_0x3058af);}function getHeaders(_0x74d5de){return _['map'](_0x74d5de,function(_0x311ec6){return{'text':_0x311ec6,'style':_0x56b9('0xf')};});}function getRows(_0x30fa20,_0x5caa84){return _[_0x56b9('0x10')](_0x5caa84,function(_0x5e821b){return _(_0x5e821b)[_0x56b9('0x11')](_0x30fa20)['map'](function(_0x55424a){return _0x55424a?_['toString'](_0x55424a):'';})['value']();});}function createTable(_0x44d1b,_0x59ec8a){var _0x563cb6={'widths':_[_0x56b9('0x12')](Array(_0x44d1b[_0x56b9('0x13')]),0x91),'heights':function(_0x195631){return _0x195631===0x0?_0x56b9('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x387e66=getHeaders(_0x44d1b);_0x563cb6[_0x56b9('0x15')][_0x56b9('0x16')](_0x387e66);var _0x43aedd=getRows(_0x44d1b,_0x59ec8a);_0x563cb6[_0x56b9('0x15')]=_0x563cb6[_0x56b9('0x15')][_0x56b9('0x17')](_0x43aedd);return _0x563cb6;}function createTables(_0x5cd732){var _0x5d72cb=[];var _0x3e2152=_[_0x56b9('0x18')](Object[_0x56b9('0x19')](_0x5cd732[0x0]),0x5);_0x3e2152[_0x56b9('0x1a')](function(_0xa9a156){_0x5d72cb[_0x56b9('0x16')](createTable(_0xa9a156,_0x5cd732));});return _0x5d72cb;}function getPDFDocDefinition(_0x300162){var _0x407cfd=util['format'](_0x56b9('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x56b9('0x1c')])[_0x56b9('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x2a15ba=[];for(var _0x3dc889=0x0;_0x3dc889<_0x300162[_0x56b9('0x13')];_0x3dc889++){var _0x512dd7=[];if(_0x3dc889===0x0){_0x512dd7[_0x56b9('0x16')]({'text':_0x407cfd,'style':_0x56b9('0x1e')});}var _0x4edd9a={'table':_0x300162[_0x3dc889]};if(_0x3dc889>0x0){_0x4edd9a[_0x56b9('0x1f')]=_0x56b9('0x20');_0x4edd9a['margin']=[0x0,0x46,0x0,0x0];}_0x512dd7[_0x56b9('0x16')](_0x4edd9a);_0x2a15ba['push'](_0x512dd7);}return{'pageSize':'A4','pageOrientation':_0x56b9('0x21'),'content':_0x2a15ba,'footer':function(_0x338249,_0x13f8fd){return{'text':_0x338249[_0x56b9('0x22')]()+_0x56b9('0x23')+_0x13f8fd,'style':'footer'};},'defaultStyle':{'font':_0x56b9('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x56b9('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x323cdd){var _0x2b7cb0=0x1388;var _0x5c51c9;if(!_0x323cdd[0x0]['num']){return analyticExtractedReport(_0x56b9('0x26'));}return db[_0x56b9('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x56b9('0x28')](function(_0x3ceaec){if(_0x3ceaec){_0x5c51c9=_0x3ceaec;_0x2b7cb0=_0x5c51c9['splitSizePdf']||0x3e8;}})[_0x56b9('0x28')](function(){var _0x3086e9=[];var _0x2ea7b1=0x0;if(_0x5c51c9[_0x56b9('0x29')]){if(_0x323cdd&&_0x323cdd[_0x56b9('0x13')]){var _0x445f77=_[_0x56b9('0x2a')](_0x323cdd[0x0]['num']/_0x2b7cb0);var _0x209b9b=Number['isInteger'](_0x323cdd[0x0][_0x56b9('0x2b')]/_0x2b7cb0)?_0x323cdd[0x0][_0x56b9('0x2b')]%_0x2b7cb0:0x0;_0x445f77['forEach'](function(_0x31dc2e){if(_0x31dc2e>0x0){_0x2ea7b1+=_0x2b7cb0;}_0x3086e9[_0x56b9('0x16')](dbH['sequelize'][_0x56b9('0x2c')](util[_0x56b9('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2b7cb0,_0x2ea7b1),{'type':dbH['sequelize'][_0x56b9('0x2d')][_0x56b9('0x2e')]}));});if(_0x209b9b>0x0){_0x2ea7b1+=_0x2b7cb0;_0x3086e9[_0x56b9('0x16')](dbH[_0x56b9('0x2f')][_0x56b9('0x2c')](util[_0x56b9('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x209b9b,_0x2ea7b1),{'type':dbH[_0x56b9('0x2f')]['QueryTypes'][_0x56b9('0x2e')]}));}}}else{_0x3086e9[_0x56b9('0x16')](dbH[_0x56b9('0x2f')][_0x56b9('0x2c')](QUERY,{'type':dbH[_0x56b9('0x2f')][_0x56b9('0x2d')][_0x56b9('0x2e')]}));}var _0x4ec534=path[_0x56b9('0x30')](PATH);var _0x331e04=path[_0x56b9('0x31')](PATH,_0x56b9('0x32'));var _0x588f18=_0x5c51c9['split']&&_0x3086e9[_0x56b9('0x13')]>0x1;var _0x3b8f54=[];if(!fs[_0x56b9('0x33')](path[_0x56b9('0x34')](_0x4ec534,_0x331e04))&&_0x588f18){fs[_0x56b9('0x35')](path[_0x56b9('0x34')](_0x4ec534,_0x331e04));}return BPromise[_0x56b9('0x36')](_0x3086e9,function(_0x31a47c){_0x3b8f54[_0x56b9('0x16')](_0x31a47c);})[_0x56b9('0x28')](function(){var _0x187583=[];for(var _0x4b0077=0x0;_0x4b0077<_0x3b8f54[_0x56b9('0x13')];_0x4b0077+=0x1){var _0x240eba=_0x3b8f54[_0x4b0077];var _0x3a4859=createTables(_[_0x56b9('0x37')](_0x240eba));var _0x1334a3;var _0x54cf8e=getPDFDocDefinition(_0x3a4859);var _0x28dceb=getPDFPrinter();var _0x331c81=_0x28dceb[_0x56b9('0x38')](_0x54cf8e);if(_0x588f18){_0x1334a3=path[_0x56b9('0x34')](_0x4ec534,_0x331e04,util['format']('%s%d.%s',_0x331e04,_0x4b0077,'pdf'));}else{_0x1334a3=path[_0x56b9('0x34')](_0x4ec534,util[_0x56b9('0x1d')](_0x56b9('0x39'),_0x331e04,_0x56b9('0x3a')));}_0x187583[_0x56b9('0x16')](writePDFDocument(_0x331c81,_0x1334a3));}return Promise[_0x56b9('0x3b')](_0x187583);})['then'](function(){if(_0x588f18){return new Promise(function(_0x3ff1f3){zipdir(path['join'](_0x4ec534,_0x331e04),{'saveTo':path[_0x56b9('0x34')](_0x4ec534,util['format']('%s.%s',_0x331e04,_0x56b9('0x3c')))},function(){rimraf(path[_0x56b9('0x34')](_0x4ec534,_0x331e04),function(){});_0x3ff1f3(_0x56b9('0x3d'));});});}})['then'](function(){if(!_0x588f18)return;rimraf(path[_0x56b9('0x34')](_0x4ec534,_0x331e04),function(){});})[_0x56b9('0x28')](function(){logger[_0x56b9('0x3e')](util[_0x56b9('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x56b9('0x3f')));return analyticExtractedReport(_0x56b9('0x40'),_0x588f18?util['format'](_0x56b9('0x39'),_0x331e04,_0x588f18?'zip':_0x56b9('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x56b9('0x3e')](util['format'](_0x56b9('0x41'),EXTRACTED_REPORT_ID,_0x56b9('0x3f')));return db[_0x56b9('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x56b9('0x28')](function(_0x23b1c0){EXTRACTED_REPORT=_0x23b1c0;return dbH['sequelize'][_0x56b9('0x2c')](util['format'](_0x56b9('0x42'),QUERY),{'type':dbH[_0x56b9('0x2f')][_0x56b9('0x2d')]['SELECT']});})[_0x56b9('0x28')](extractReport)[_0x56b9('0x43')](function(_0x51d050){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x56b9('0x44')](_0x51d050,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x56b9('0x45'));})[_0x56b9('0x46')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x71a52e=new PdfPrinter({'Arial':{'normal':__dirname+_0x56b9('0x47'),'bold':__dirname+_0x56b9('0x48'),'italics':__dirname+_0x56b9('0x49'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x71a52e;}function getPDFDocDefinitionFromHTML(_0x55de94,_0x4e7619){var _0xc5cf0f=util[_0x56b9('0x1d')]('%s\x20#%d',_0x4e7619[_0x56b9('0x4a')],_0x4e7619['interactionId']);var _0x1f53c2=moment()['format'](_0x56b9('0x4b'))[_0x56b9('0x22')]();var _0x218327=htmlToPdfmake(_0x55de94,{'window':window,'tableAutoSize':!![]});return{'content':[_0x218327],'defaultStyle':{'font':_0x56b9('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x56b9('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x56b9('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x56b9('0x4c')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x56b9('0x1e')}];},'footer':function(_0x3a62a4,_0x1fef26){return[{'text':util[_0x56b9('0x1d')](_0x56b9('0x4d'),_0xc5cf0f,_0x3a62a4,_0x1fef26,_0x1f53c2),'style':_0x56b9('0x4e')}];}};}function writePDFDocument(_0x36b47a,_0x5495e0){return new Promise(function(_0x4d6830,_0x5a9069){var _0x7f66fc=_0x36b47a['pipe'](fs[_0x56b9('0x4f')](_0x5495e0));_0x7f66fc['on'](_0x56b9('0x50'),function(){_0x4d6830(_0x56b9('0x50'));});_0x7f66fc['on'](_0x56b9('0x51'),function(_0x19d28d){_0x5a9069(_0x19d28d);});_0x36b47a[_0x56b9('0x52')]();});}exports[_0x56b9('0x53')]=function(_0x26b1c6,_0x306151){var _0xd7f1d1=getPDFPrinter();var _0x54f504=getPDFDocDefinitionFromHTML(_0x26b1c6,_0x306151);var _0x52e934=_0xd7f1d1['createPdfKitDocument'](_0x54f504);return writePDFDocument(_0x52e934,_0x306151['path'])[_0x56b9('0x43')](function(_0x5d7c06){throw _0x5d7c06;});};
\ No newline at end of file
+var _0x05df=['zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.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','pipe','createWriteStream','finish','error','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','../../mysqldb','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','pick','toString','value','length','auto','push','body','concat','chunk','forEach','format','name','startDate','header','pageBreak','before','margin','landscape','footer','Arial','black','right','num','Empty','Setting','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x05df,0x1c3));var _0xf05d=function(_0x3d0f08,_0x3d1a11){_0x3d0f08=_0x3d0f08-0x0;var _0x32b418=_0x05df[_0x3d0f08];return _0x32b418;};'use strict';var _=require(_0xf05d('0x0'));var fs=require('fs');var util=require(_0xf05d('0x1'));var path=require(_0xf05d('0x2'));var moment=require(_0xf05d('0x3'));var htmlToPdfmake=require(_0xf05d('0x4'));var PdfPrinter=require(_0xf05d('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0xf05d('0x6'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xf05d('0x7'))['db'];var dbH=require(_0xf05d('0x7'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf05d('0x8')][0x2]);var QUERY=process[_0xf05d('0x8')][0x3];var PATH=process[_0xf05d('0x8')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf05d('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x598fbd,_0x2734cc){var _0x1fad10={'status':_0x598fbd};var _0x2079bd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2734cc){_0x1fad10[_0xf05d('0xa')]=_0x2734cc;}return db[_0xf05d('0xb')]['update'](_0x1fad10,_0x2079bd);}function getHeaders(_0x1b0fcd){return _[_0xf05d('0xc')](_0x1b0fcd,function(_0x591e22){return{'text':_0x591e22,'style':'tableHeader'};});}function getRows(_0x378a34,_0x162db1){return _['map'](_0x162db1,function(_0x1de39b){return _(_0x1de39b)[_0xf05d('0xd')](_0x378a34)[_0xf05d('0xc')](function(_0xa491fc){return _0xa491fc?_[_0xf05d('0xe')](_0xa491fc):'';})[_0xf05d('0xf')]();});}function createTable(_0x4fb74c,_0x1fd28e){var _0x26592c={'widths':_['fill'](Array(_0x4fb74c[_0xf05d('0x10')]),0x91),'heights':function(_0x51c2a9){return _0x51c2a9===0x0?_0xf05d('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5a8b5f=getHeaders(_0x4fb74c);_0x26592c['body'][_0xf05d('0x12')](_0x5a8b5f);var _0x2721be=getRows(_0x4fb74c,_0x1fd28e);_0x26592c[_0xf05d('0x13')]=_0x26592c[_0xf05d('0x13')][_0xf05d('0x14')](_0x2721be);return _0x26592c;}function createTables(_0x4a0ac2){var _0x371ff0=[];var _0x4b6ef8=_[_0xf05d('0x15')](Object['keys'](_0x4a0ac2[0x0]),0x5);_0x4b6ef8[_0xf05d('0x16')](function(_0x4cc8b0){_0x371ff0[_0xf05d('0x12')](createTable(_0x4cc8b0,_0x4a0ac2));});return _0x371ff0;}function getPDFDocDefinition(_0x57e7fb){var _0x34af02=util[_0xf05d('0x17')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xf05d('0x18')],moment(EXTRACTED_REPORT[_0xf05d('0x19')])[_0xf05d('0x17')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x3cfb38=[];for(var _0x58de49=0x0;_0x58de49<_0x57e7fb[_0xf05d('0x10')];_0x58de49++){var _0x13b9d5=[];if(_0x58de49===0x0){_0x13b9d5[_0xf05d('0x12')]({'text':_0x34af02,'style':_0xf05d('0x1a')});}var _0x186ab9={'table':_0x57e7fb[_0x58de49]};if(_0x58de49>0x0){_0x186ab9[_0xf05d('0x1b')]=_0xf05d('0x1c');_0x186ab9[_0xf05d('0x1d')]=[0x0,0x46,0x0,0x0];}_0x13b9d5['push'](_0x186ab9);_0x3cfb38[_0xf05d('0x12')](_0x13b9d5);}return{'pageSize':'A4','pageOrientation':_0xf05d('0x1e'),'content':_0x3cfb38,'footer':function(_0x12eca0,_0x3ee402){return{'text':_0x12eca0[_0xf05d('0xe')]()+'\x20/\x20'+_0x3ee402,'style':_0xf05d('0x1f')};},'defaultStyle':{'font':_0xf05d('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf05d('0x21')},'footer':{'alignment':_0xf05d('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x468902){var _0x51d436=0x1388;var _0x2efdc8;if(!_0x468902[0x0][_0xf05d('0x23')]){return analyticExtractedReport(_0xf05d('0x24'));}return db[_0xf05d('0x25')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf05d('0x26'),_0xf05d('0x27')]})[_0xf05d('0x28')](function(_0xf308c1){if(_0xf308c1){_0x2efdc8=_0xf308c1;_0x51d436=_0x2efdc8['splitSizePdf']||0x3e8;}})[_0xf05d('0x28')](function(){var _0xef9e7a=[];var _0x6f37de=0x0;if(_0x2efdc8['split']){if(_0x468902&&_0x468902['length']){var _0x57af3a=_[_0xf05d('0x29')](_0x468902[0x0][_0xf05d('0x23')]/_0x51d436);var _0x1d22a3=Number[_0xf05d('0x2a')](_0x468902[0x0]['num']/_0x51d436)?_0x468902[0x0][_0xf05d('0x23')]%_0x51d436:0x0;_0x57af3a[_0xf05d('0x16')](function(_0x5ce7ca){if(_0x5ce7ca>0x0){_0x6f37de+=_0x51d436;}_0xef9e7a[_0xf05d('0x12')](dbH['sequelize'][_0xf05d('0x2b')](util[_0xf05d('0x17')](_0xf05d('0x2c'),QUERY,_0x51d436,_0x6f37de),{'type':dbH[_0xf05d('0x2d')][_0xf05d('0x2e')][_0xf05d('0x2f')]}));});if(_0x1d22a3>0x0){_0x6f37de+=_0x51d436;_0xef9e7a[_0xf05d('0x12')](dbH[_0xf05d('0x2d')][_0xf05d('0x2b')](util['format'](_0xf05d('0x2c'),QUERY,_0x1d22a3,_0x6f37de),{'type':dbH[_0xf05d('0x2d')][_0xf05d('0x2e')][_0xf05d('0x2f')]}));}}}else{_0xef9e7a[_0xf05d('0x12')](dbH['sequelize'][_0xf05d('0x2b')](QUERY,{'type':dbH[_0xf05d('0x2d')][_0xf05d('0x2e')][_0xf05d('0x2f')]}));}var _0x1cade8=path[_0xf05d('0x30')](PATH);var _0x21bed8=path[_0xf05d('0x31')](PATH,'.pdf');var _0x22e539=_0x2efdc8[_0xf05d('0x26')]&&_0xef9e7a[_0xf05d('0x10')]>0x1;var _0x9f5c27=[];if(!fs[_0xf05d('0x32')](path[_0xf05d('0x33')](_0x1cade8,_0x21bed8))&&_0x22e539){fs[_0xf05d('0x34')](path[_0xf05d('0x33')](_0x1cade8,_0x21bed8));}return BPromise[_0xf05d('0x35')](_0xef9e7a,function(_0x501972){_0x9f5c27['push'](_0x501972);})[_0xf05d('0x28')](function(){var _0x221856=[];for(var _0x2d9d49=0x0;_0x2d9d49<_0x9f5c27[_0xf05d('0x10')];_0x2d9d49+=0x1){var _0x18f0ac=_0x9f5c27[_0x2d9d49];var _0x48e9c8=createTables(_[_0xf05d('0x36')](_0x18f0ac));var _0x36b2ad;var _0x544b76=getPDFDocDefinition(_0x48e9c8);var _0xd52f9f=getPDFPrinter();var _0x43ed2d=_0xd52f9f['createPdfKitDocument'](_0x544b76);if(_0x22e539){_0x36b2ad=path[_0xf05d('0x33')](_0x1cade8,_0x21bed8,util[_0xf05d('0x17')](_0xf05d('0x37'),_0x21bed8,_0x2d9d49,_0xf05d('0x38')));}else{_0x36b2ad=path[_0xf05d('0x33')](_0x1cade8,util[_0xf05d('0x17')](_0xf05d('0x39'),_0x21bed8,_0xf05d('0x38')));}_0x221856[_0xf05d('0x12')](writePDFDocument(_0x43ed2d,_0x36b2ad));}return Promise[_0xf05d('0x3a')](_0x221856);})[_0xf05d('0x28')](function(){if(_0x22e539){return new Promise(function(_0x1f2aaf){zipdir(path['join'](_0x1cade8,_0x21bed8),{'saveTo':path[_0xf05d('0x33')](_0x1cade8,util[_0xf05d('0x17')](_0xf05d('0x39'),_0x21bed8,_0xf05d('0x3b')))},function(){rimraf(path[_0xf05d('0x33')](_0x1cade8,_0x21bed8),function(){});_0x1f2aaf(_0xf05d('0x3c'));});});}})[_0xf05d('0x28')](function(){if(!_0x22e539)return;rimraf(path['join'](_0x1cade8,_0x21bed8),function(){});})[_0xf05d('0x28')](function(){logger['info'](util['format'](_0xf05d('0x3d'),EXTRACTED_REPORT_ID,_0xf05d('0x3e')));return analyticExtractedReport('Completed',_0x22e539?util[_0xf05d('0x17')](_0xf05d('0x39'),_0x21bed8,_0x22e539?_0xf05d('0x3b'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf05d('0x3f')](util[_0xf05d('0x17')](_0xf05d('0x40'),EXTRACTED_REPORT_ID,_0xf05d('0x3e')));return db[_0xf05d('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf05d('0x28')](function(_0x338dd3){EXTRACTED_REPORT=_0x338dd3;return dbH[_0xf05d('0x2d')][_0xf05d('0x2b')](util[_0xf05d('0x17')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xf05d('0x2e')]['SELECT']});})[_0xf05d('0x28')](extractReport)[_0xf05d('0x41')](function(_0x22ea3b){logger[_0xf05d('0x3f')](util[_0xf05d('0x17')](_0xf05d('0x42'),EXTRACTED_REPORT_ID,_0xf05d('0x3e')),util[_0xf05d('0x43')](_0x22ea3b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf05d('0x44')](function(){process[_0xf05d('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x518644=new PdfPrinter({'Arial':{'normal':__dirname+_0xf05d('0x46'),'bold':__dirname+_0xf05d('0x47'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xf05d('0x48')}});return _0x518644;}function getPDFDocDefinitionFromHTML(_0x2d5edd,_0x36e02f){var _0x53de3c=util[_0xf05d('0x17')](_0xf05d('0x49'),_0x36e02f[_0xf05d('0x4a')],_0x36e02f[_0xf05d('0x4b')]);var _0x4d03e2=moment()[_0xf05d('0x17')](_0xf05d('0x4c'))[_0xf05d('0xe')]();var _0x2d83cc=htmlToPdfmake(_0x2d5edd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2d83cc],'defaultStyle':{'font':_0xf05d('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf05d('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf05d('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xf05d('0x4e'),'style':'header'}];},'footer':function(_0x486d61,_0x514a3e){return[{'text':util[_0xf05d('0x17')](_0xf05d('0x4f'),_0x53de3c,_0x486d61,_0x514a3e,_0x4d03e2),'style':_0xf05d('0x1f')}];}};}function writePDFDocument(_0x5df921,_0x2af078){return new Promise(function(_0xeb69fe,_0x384c47){var _0x5dd23c=_0x5df921[_0xf05d('0x50')](fs[_0xf05d('0x51')](_0x2af078));_0x5dd23c['on'](_0xf05d('0x52'),function(){_0xeb69fe('finish');});_0x5dd23c['on'](_0xf05d('0x53'),function(_0x481a5a){_0x384c47(_0x481a5a);});_0x5df921['end']();});}exports['createPdfFromHTML']=function(_0x427c81,_0xd2c489){var _0xeeaf51=getPDFPrinter();var _0x57dcfa=getPDFDocDefinitionFromHTML(_0x427c81,_0xd2c489);var _0x4feb62=_0xeeaf51[_0xf05d('0x54')](_0x57dcfa);return writePDFDocument(_0x4feb62,_0xd2c489[_0xf05d('0x2')])[_0xf05d('0x41')](function(_0x4a5b34){throw _0x4a5b34;});};
\ No newline at end of file
index 0c705dc..cb09bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4314=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','split','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x4314,0xe5));var _0x4431=function(_0x46bd67,_0x1c750e){_0x46bd67=_0x46bd67-0x0;var _0x4ed7dd=_0x4314[_0x46bd67];return _0x4ed7dd;};'use strict';var util=require('util');var path=require('path');var _=require(_0x4431('0x0'));var fs=require('fs');var json2xls=require(_0x4431('0x1'));var BPromise=require(_0x4431('0x2'));var zipdir=require(_0x4431('0x3'));var rimraf=require(_0x4431('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4431('0x5'))[_0x4431('0x6')];var logger=require(_0x4431('0x7'))(_0x4431('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4431('0x9')][0x2]);var QUERY=process[_0x4431('0x9')][0x3];var PATH=process[_0x4431('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x108d9a,_0x339f8f){var _0x182dd1={'status':_0x108d9a};var _0xa623c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x339f8f){_0x182dd1[_0x4431('0xa')]=_0x339f8f;}return db['AnalyticExtractedReport'][_0x4431('0xb')](_0x182dd1,_0xa623c);}function main(){var _0x38bd7f=0x1388;var _0x2b4c1e;logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0xe'),EXTRACTED_REPORT_ID,_0x4431('0xf')));return db[_0x4431('0x10')][_0x4431('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4431('0x12')]})[_0x4431('0x13')](function(_0x47cfe3){if(_0x47cfe3){_0x2b4c1e=_0x47cfe3;_0x38bd7f=_0x2b4c1e['splitSizeXlsx']||0x1388;}})[_0x4431('0x13')](function(){return dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x16'),QUERY),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']});})['then'](function(_0x2f3aa4){if(!_0x2f3aa4[0x0]['num']){return analyticExtractedReport(_0x4431('0x18'));}var _0x24b3a5=[];var _0x2111f5=0x0;if(_0x2b4c1e[_0x4431('0x19')]){if(_0x2f3aa4&&_0x2f3aa4[_0x4431('0x1a')]){var _0x3eab43=_[_0x4431('0x1b')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f);var _0x478822=Number[_0x4431('0x1d')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f)?_0x2f3aa4[0x0][_0x4431('0x1c')]%_0x38bd7f:0x0;_0x3eab43[_0x4431('0x1e')](function(_0x3e2266){if(_0x3e2266>0x0){_0x2111f5+=_0x38bd7f;}_0x24b3a5['push'](dbH[_0x4431('0x14')]['query'](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x38bd7f,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));});if(_0x478822>0x0){_0x2111f5+=_0x38bd7f;_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x478822,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));}}}else{_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4431('0x21')]}));}var _0x51f025=path['dirname'](PATH);var _0x230e93=path[_0x4431('0x22')](PATH,'.xlsx');var _0x40c54e=_0x2b4c1e[_0x4431('0x19')]&&_0x24b3a5[_0x4431('0x1a')]>0x1;var _0x480f71=[];if(!fs[_0x4431('0x23')](path[_0x4431('0x24')](_0x51f025,_0x230e93))&&_0x40c54e){fs[_0x4431('0x25')](path[_0x4431('0x24')](_0x51f025,_0x230e93));}return BPromise['each'](_0x24b3a5,function(_0x3aff5b){_0x480f71[_0x4431('0x20')](_0x3aff5b);})['then'](function(){for(var _0x52a566=0x0;_0x52a566<_0x480f71[_0x4431('0x1a')];_0x52a566+=0x1){var _0x4ee429;var _0x42f280=_0x480f71[_0x52a566];if(_0x40c54e){_0x4ee429=path[_0x4431('0x24')](_0x51f025,_0x230e93,util[_0x4431('0xd')](_0x4431('0x26'),_0x230e93,_0x52a566,_0x4431('0x27')));}else{_0x4ee429=path['join'](_0x51f025,util[_0x4431('0xd')]('%s.%s',_0x230e93,_0x4431('0x27')));}fs['writeFileSync'](_0x4ee429,json2xls(_0x42f280),_0x4431('0x28'));}})[_0x4431('0x13')](function(){if(_0x40c54e){return new Promise(function(_0x137352){zipdir(path[_0x4431('0x24')](_0x51f025,_0x230e93),{'saveTo':path['join'](_0x51f025,util['format'](_0x4431('0x29'),_0x230e93,_0x4431('0x2a')))},function(_0x49aa23,_0x9a5f3e){rimraf(path['join'](_0x51f025,_0x230e93),function(){});_0x137352(_0x4431('0x2b'));});});}})['then'](function(){logger[_0x4431('0xc')](util['format'](_0x4431('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x40c54e?util[_0x4431('0xd')](_0x4431('0x29'),_0x230e93,_0x40c54e?_0x4431('0x2a'):_0x4431('0x27')):null);});})[_0x4431('0x2d')](function(_0x5befad){logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x4431('0x2f')](_0x5befad,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4431('0x30')](function(){process[_0x4431('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x1373=['xlsx','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','finally','exit','util','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','dirname','basename','.xlsx','length','join','mkdirSync','%s%d.%s'];(function(_0xd7b69b,_0x56b291){var _0x21d50e=function(_0x236062){while(--_0x236062){_0xd7b69b['push'](_0xd7b69b['shift']());}};_0x21d50e(++_0x56b291);}(_0x1373,0x1e1));var _0x3137=function(_0x1c4cf8,_0x3f4de9){_0x1c4cf8=_0x1c4cf8-0x0;var _0x4d8891=_0x1373[_0x1c4cf8];return _0x4d8891;};'use strict';var util=require(_0x3137('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x3137('0x1'));var BPromise=require(_0x3137('0x2'));var zipdir=require(_0x3137('0x3'));var rimraf=require(_0x3137('0x4'));var db=require(_0x3137('0x5'))['db'];var dbH=require(_0x3137('0x5'))['dbH'];var logger=require(_0x3137('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3137('0x7')][0x2]);var QUERY=process[_0x3137('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x256a1f,_0x513e02){var _0x2140ef={'status':_0x256a1f};var _0x3b0394={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x513e02){_0x2140ef['savename']=_0x513e02;}return db[_0x3137('0x8')]['update'](_0x2140ef,_0x3b0394);}function main(){var _0x4581ed=0x1388;var _0x133f3d;logger[_0x3137('0x9')](util[_0x3137('0xa')](_0x3137('0xb'),EXTRACTED_REPORT_ID,_0x3137('0xc')));return db[_0x3137('0xd')][_0x3137('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3137('0xf'),_0x3137('0x10')]})[_0x3137('0x11')](function(_0x323e21){if(_0x323e21){_0x133f3d=_0x323e21;_0x4581ed=_0x133f3d[_0x3137('0x10')]||0x1388;}})[_0x3137('0x11')](function(){return dbH[_0x3137('0x12')][_0x3137('0x13')](util[_0x3137('0xa')](_0x3137('0x14'),QUERY),{'type':dbH['sequelize'][_0x3137('0x15')][_0x3137('0x16')]});})['then'](function(_0x111fe1){if(!_0x111fe1[0x0][_0x3137('0x17')]){return analyticExtractedReport(_0x3137('0x18'));}var _0x325ef0=[];var _0x3f3eab=0x0;if(_0x133f3d[_0x3137('0xf')]){if(_0x111fe1&&_0x111fe1['length']){var _0x318aef=_[_0x3137('0x19')](_0x111fe1[0x0]['num']/_0x4581ed);var _0x925c41=Number[_0x3137('0x1a')](_0x111fe1[0x0]['num']/_0x4581ed)?_0x111fe1[0x0][_0x3137('0x17')]%_0x4581ed:0x0;_0x318aef[_0x3137('0x1b')](function(_0x3f1631){if(_0x3f1631>0x0){_0x3f3eab+=_0x4581ed;}_0x325ef0[_0x3137('0x1c')](dbH[_0x3137('0x12')]['query'](util[_0x3137('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4581ed,_0x3f3eab),{'type':dbH[_0x3137('0x12')][_0x3137('0x15')]['SELECT']}));});if(_0x925c41>0x0){_0x3f3eab+=_0x4581ed;_0x325ef0[_0x3137('0x1c')](dbH[_0x3137('0x12')]['query'](util[_0x3137('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x925c41,_0x3f3eab),{'type':dbH[_0x3137('0x12')]['QueryTypes']['SELECT']}));}}}else{_0x325ef0['push'](dbH[_0x3137('0x12')][_0x3137('0x13')](QUERY,{'type':dbH[_0x3137('0x12')][_0x3137('0x15')][_0x3137('0x16')]}));}var _0x37dee6=path[_0x3137('0x1d')](PATH);var _0x452bbf=path[_0x3137('0x1e')](PATH,_0x3137('0x1f'));var _0x543f01=_0x133f3d[_0x3137('0xf')]&&_0x325ef0[_0x3137('0x20')]>0x1;var _0xa5f05b=[];if(!fs['existsSync'](path[_0x3137('0x21')](_0x37dee6,_0x452bbf))&&_0x543f01){fs[_0x3137('0x22')](path[_0x3137('0x21')](_0x37dee6,_0x452bbf));}return BPromise['each'](_0x325ef0,function(_0x571cfb){_0xa5f05b[_0x3137('0x1c')](_0x571cfb);})[_0x3137('0x11')](function(){for(var _0x26b31b=0x0;_0x26b31b<_0xa5f05b['length'];_0x26b31b+=0x1){var _0x53ff5d;var _0x187806=_0xa5f05b[_0x26b31b];if(_0x543f01){_0x53ff5d=path[_0x3137('0x21')](_0x37dee6,_0x452bbf,util['format'](_0x3137('0x23'),_0x452bbf,_0x26b31b,'xlsx'));}else{_0x53ff5d=path['join'](_0x37dee6,util['format']('%s.%s',_0x452bbf,_0x3137('0x24')));}fs[_0x3137('0x25')](_0x53ff5d,json2xls(_0x187806),'binary');}})[_0x3137('0x11')](function(){if(_0x543f01){return new Promise(function(_0x5078e3){zipdir(path[_0x3137('0x21')](_0x37dee6,_0x452bbf),{'saveTo':path[_0x3137('0x21')](_0x37dee6,util[_0x3137('0xa')](_0x3137('0x26'),_0x452bbf,_0x3137('0x27')))},function(_0x39864b,_0x2b4525){rimraf(path[_0x3137('0x21')](_0x37dee6,_0x452bbf),function(){});_0x5078e3(_0x3137('0x28'));});});}})[_0x3137('0x11')](function(){logger[_0x3137('0x9')](util[_0x3137('0xa')](_0x3137('0x29'),EXTRACTED_REPORT_ID,_0x3137('0xc')));return analyticExtractedReport(_0x3137('0x2a'),_0x543f01?util['format'](_0x3137('0x26'),_0x452bbf,_0x543f01?'zip':_0x3137('0x24')):null);});})[_0x3137('0x2b')](function(_0x32adb3){logger[_0x3137('0x9')](util[_0x3137('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3137('0xc')),util[_0x3137('0x2c')](_0x32adb3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3137('0x2d')](function(){process[_0x3137('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
index 2cb1c9a..d726ae0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeed2=['):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag','outbound','callerID','ExecIf','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','intervals','models','VoiceExtension','IntervalId','then','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','playback','hasOwnProperty','extensions','extension','find','push','type','format','CDR(type)=%s','priority','VoiceExtensionId','inbound','Set','CDR(routeid)=','context','${EXTEN:','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('];(function(_0x6d76d0,_0x433f25){var _0x3d35a0=function(_0x3a0df9){while(--_0x3a0df9){_0x6d76d0['push'](_0x6d76d0['shift']());}};_0x3d35a0(++_0x433f25);}(_0xeed2,0x69));var _0x2eed=function(_0x1f693f,_0x5a4ff9){_0x1f693f=_0x1f693f-0x0;var _0x3746ba=_0xeed2[_0x1f693f];return _0x3746ba;};'use strict';var _=require(_0x2eed('0x0'));var util=require(_0x2eed('0x1'));function rewrite(_0x1a8a59,_0x34646e){var _0x3e8ae3=this;return _0x1a8a59['models'][_0x2eed('0x2')][_0x2eed('0x3')]({'raw':!![]})['then'](function(_0x4aef09){_0x3e8ae3[_0x2eed('0x4')]=_0x4aef09;return _0x1a8a59[_0x2eed('0x5')][_0x2eed('0x6')][_0x2eed('0x3')]({'where':{'IntervalId':_0x34646e[_0x2eed('0x7')]},'raw':!![]});})[_0x2eed('0x8')](function(_0x334826){return _0x1a8a59['models'][_0x2eed('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x2eed('0x9')](_['map'](_0x334826,'exten'))}},'order':[{'raw':_0x2eed('0xa')}],'raw':!![]});})['then'](function(_0x1359ed){var _0x2a4c40=_[_0x2eed('0xb')](_0x1359ed,{'priority':'1'});var _0x15af5a=_[_0x2eed('0xb')](_0x1359ed,{'isApp':0x1});var _0x526499=_['groupBy'](_0x15af5a,_0x2eed('0xc'));var _0x3e8128=['queue',_0x2eed('0xd')];var _0x125ba9=[];var _0x2843e9=[];for(var _0x3a17d4 in _0x526499){if(_0x526499[_0x2eed('0xe')](_0x3a17d4)){_0x3e8ae3['priority']=0x2;_0x3e8ae3[_0x2eed('0xf')]=[];_0x3e8ae3[_0x2eed('0x10')]=_[_0x2eed('0x11')](_0x2a4c40,{'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')]});_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':'Set','appdata':util[_0x2eed('0x14')](_0x2eed('0x15'),_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')]),'context':_0x526499[_0x3a17d4][0x0]['context'],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});if(_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')]===_0x2eed('0x18')){_0x3e8ae3['extensions'][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':_0x2eed('0x1a')+_0x526499[_0x3a17d4][0x0]['VoiceExtensionId'],'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0]['exten'],'priority':_0x3e8ae3['priority']++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});}else if(_0x526499[_0x3a17d4][0x0]['type']==='outbound'){if(_0x3e8ae3[_0x2eed('0x10')]){_0x3e8ae3['extensions']['push']({'type':_0x526499[_0x3a17d4][0x0]['type'],'app':_0x2eed('0x19'),'appdata':'CDR(destination)='+(_0x3e8ae3[_0x2eed('0x10')]['cutdigits']?_0x2eed('0x1c')+_0x3e8ae3[_0x2eed('0x10')][_0x2eed('0x1d')]+'}':'${EXTEN}'),'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0]['exten'],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0]['VoiceExtensionId']});}_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0]['type'],'app':'Set','appdata':_0x2eed('0x1a')+_0x526499[_0x3a17d4][0x0]['VoiceExtensionId'],'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3['priority']++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});var _0x51baed=_0x3e8ae3[_0x2eed('0x16')]++;_0x3e8ae3[_0x2eed('0xf')]['push']({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':'ExecIf','appdata':_0x2eed('0x1e')+(_0x51baed+0x2)+_0x2eed('0x1f')+(_0x51baed+0x1)+')','context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0]['exten'],'priority':_0x51baed,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});if(_0x3e8ae3[_0x2eed('0x10')]){_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':_0x3e8ae3[_0x2eed('0x10')][_0x2eed('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x3e8ae3['extension'][_0x2eed('0x1d')]+'}':_0x2eed('0x20'),'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});}_0x3e8ae3['extensions'][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':'Set','appdata':_0x2eed('0x21')+_0x526499[_0x3a17d4][0x0]['VoiceExtensionId'],'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0]['VoiceExtensionId']});if(_0x3e8ae3[_0x2eed('0x10')]&&_0x3e8ae3[_0x2eed('0x10')][_0x2eed('0xe')](_0x2eed('0x22'))&&_0x3e8ae3['extension'][_0x2eed('0x22')]!==_0x2eed('0x23')){_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3['priority']++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':_0x2eed('0x24')+_0x3e8ae3[_0x2eed('0x10')][_0x2eed('0x22')]||_0x2eed('0x25'),'context':_0x526499[_0x3a17d4][0x0]['context'],'exten':_0x526499[_0x3a17d4][0x0]['exten'],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});}}_0x3e8ae3['extensions'][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':_0x2eed('0x26'),'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});_0x3e8ae3['extensions'][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0]['type'],'app':_0x2eed('0x19'),'appdata':_0x2eed('0x27'),'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0]['exten'],'priority':_0x3e8ae3['priority']++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});_0x3e8ae3[_0x2eed('0xf')]['push']({'type':_0x526499[_0x3a17d4][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'exten':_0x526499[_0x3a17d4][0x0][_0x2eed('0xc')],'priority':_0x3e8ae3[_0x2eed('0x16')]++,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0]['VoiceExtensionId']});for(var _0x12e3c3=0x0,_0x4cfb4f=0x0;_0x12e3c3<_0x526499[_0x3a17d4][_0x2eed('0x28')];_0x12e3c3+=0x1,_0x4cfb4f=0x0){var _0x3efcba=_0x526499[_0x3a17d4][_0x12e3c3];if(_0x3efcba['type']){_0x3efcba['type']=_0x3efcba[_0x2eed('0x13')][_0x2eed('0x29')]();}var _0x394917=[];var _0x445087=[];delete _0x3efcba['id'];delete _0x3efcba[_0x2eed('0x2a')];delete _0x3efcba[_0x2eed('0x2b')];var _0x17444d=_0x3efcba[_0x2eed('0x2c')]!==_0x2eed('0x2d')?[_0x3efcba[_0x2eed('0x2c')]]:_0x3efcba[_0x2eed('0x7')]?_[_0x2eed('0x2e')](_[_0x2eed('0xb')](_0x3e8ae3[_0x2eed('0x4')],{'IntervalId':_0x3efcba['IntervalId']}),'interval'):[];if(_0x3efcba[_0x2eed('0xe')](_0x2eed('0x2f'))){if(_0x3efcba['tag']&&_0x3efcba['tag']!=='--'){_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':'CDR(tag)='+_0x3efcba['tag'],'context':_0x3efcba[_0x2eed('0x1b')],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3[_0x2eed('0x16')]+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});}}if(_0x3efcba[_0x2eed('0x13')]===_0x2eed('0x30')&&_0x3efcba['hasOwnProperty']('callerID')){if(_0x3efcba[_0x2eed('0x31')]){_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3efcba[_0x2eed('0x31')]+')','context':_0x3efcba[_0x2eed('0x1b')],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3['priority']+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});}else{_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3efcba[_0x2eed('0x1b')],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3['priority']+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});}}if(_0x3efcba[_0x2eed('0xe')](_0x2eed('0x33'))){if(_0x3e8128[_0x2eed('0x34')](_0x3efcba[_0x2eed('0x35')][_0x2eed('0x29')]())>=0x0&&_0x3efcba['appType']!==_0x2eed('0x36')){if(_0x3efcba[_0x2eed('0x33')]){_0x394917[_0x2eed('0x12')]({'type':_0x3efcba['type'],'app':_0x2eed('0x32'),'appdata':_0x2eed('0x37'),'context':_0x3efcba[_0x2eed('0x1b')],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3['priority']+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3efcba[_0x2eed('0x1b')],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3[_0x2eed('0x16')]+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});}else{_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x32'),'appdata':_0x2eed('0x38'),'context':_0x3efcba['context'],'exten':_0x3efcba[_0x2eed('0xc')],'priority':_0x17444d['length']+_0x3e8ae3['priority']+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba['VoiceExtensionId']});_0x394917[_0x2eed('0x12')]({'type':_0x3efcba[_0x2eed('0x13')],'app':_0x2eed('0x19'),'appdata':_0x2eed('0x39'),'context':_0x3efcba['context'],'exten':_0x3efcba['exten'],'priority':_0x17444d[_0x2eed('0x28')]+_0x3e8ae3[_0x2eed('0x16')]+_0x4cfb4f++,'VoiceExtensionId':_0x3efcba[_0x2eed('0x17')]});}}}for(var _0x1a4c32=0x0;_0x1a4c32<_0x17444d[_0x2eed('0x28')];_0x1a4c32+=0x1){var _0x4dc77f=_0x3e8ae3['priority']+_0x17444d[_0x2eed('0x28')];var _0x4607cb=_0x1a4c32===_0x17444d[_0x2eed('0x28')]-0x1?_0x3e8ae3[_0x2eed('0x16')]+_0x394917[_0x2eed('0x28')]+_0x445087[_0x2eed('0x28')]+0x2:_0x3e8ae3['priority']+_0x1a4c32+0x1;_0x394917['splice'](_0x1a4c32,0x0,{'type':_0x3efcba['type'],'app':_0x2eed('0x3a'),'appdata':_0x17444d[_0x1a4c32]+'?'+_0x3efcba[_0x2eed('0x1b')]+_0x2eed('0x3b')+_0x4dc77f+':'+_0x3efcba['context']+_0x2eed('0x3b')+_0x4607cb,'exten':_0x3efcba[_0x2eed('0xc')],'context':_0x3efcba[_0x2eed('0x1b')],'priority':_0x3e8ae3[_0x2eed('0x16')]+_0x1a4c32,'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});}_0x3efcba[_0x2eed('0x16')]=_0x394917[_0x2eed('0x28')]?_['last'](_0x394917)[_0x2eed('0x16')]+0x1:_0x3e8ae3[_0x2eed('0x16')];_0x3e8ae3[_0x2eed('0x16')]=(_0x445087[_0x2eed('0x28')]?_['last'](_0x445087)['priority']:_0x3efcba[_0x2eed('0x16')])+0x1;_0x3e8ae3[_0x2eed('0xf')]=_[_0x2eed('0x3c')](_0x3e8ae3[_0x2eed('0xf')],_0x394917,[_0x3efcba],_0x445087);}_0x3e8ae3[_0x2eed('0xf')][_0x2eed('0x12')]({'type':_0x526499[_0x3a17d4][0x0][_0x2eed('0x13')],'app':_0x2eed('0x3d'),'exten':_0x526499[_0x3a17d4][0x0]['exten'],'context':_0x526499[_0x3a17d4][0x0][_0x2eed('0x1b')],'priority':_0x3e8ae3[_0x2eed('0x16')],'VoiceExtensionId':_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]});_0x125ba9[_0x2eed('0x12')](_0x526499[_0x3a17d4][0x0][_0x2eed('0x17')]);_0x2843e9=_[_0x2eed('0x3c')](_0x2843e9,_0x3e8ae3['extensions']);}}return _0x1a8a59[_0x2eed('0x3e')](function(_0x207a24){return _0x1a8a59[_0x2eed('0x5')][_0x2eed('0x6')][_0x2eed('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x125ba9}},'transaction':_0x207a24})[_0x2eed('0x8')](function(_0xd94054){return _0x1a8a59['models']['VoiceExtension']['bulkCreate'](_[_0x2eed('0x40')](_0x2843e9,'priority'),{'transaction':_0x207a24});});});})[_0x2eed('0x41')](function(_0x555dd0){console[_0x2eed('0x42')](_0x555dd0);});}exports[_0x2eed('0x43')]=rewrite;
\ No newline at end of file
+var _0x8371=['):Goto(','cutdigits','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','*,*,*,*','interval','IntervalId','filter','tag','outbound','callerID','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','lodash','util','models','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','CDR(destination)=','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('];(function(_0x55ce85,_0x52aa11){var _0x3b6753=function(_0x1f8f91){while(--_0x1f8f91){_0x55ce85['push'](_0x55ce85['shift']());}};_0x3b6753(++_0x52aa11);}(_0x8371,0x16f));var _0x1837=function(_0x5a5acb,_0x45e837){_0x5a5acb=_0x5a5acb-0x0;var _0x2028b7=_0x8371[_0x5a5acb];return _0x2028b7;};'use strict';var _=require(_0x1837('0x0'));var util=require(_0x1837('0x1'));function rewrite(_0x1b7e13,_0x4820b5){var _0x6917e1=this;return _0x1b7e13[_0x1837('0x2')]['Interval'][_0x1837('0x3')]({'raw':!![]})[_0x1837('0x4')](function(_0x207d4f){_0x6917e1[_0x1837('0x5')]=_0x207d4f;return _0x1b7e13[_0x1837('0x2')][_0x1837('0x6')]['findAll']({'where':{'IntervalId':_0x4820b5['IntervalId']},'raw':!![]});})['then'](function(_0x4c03cf){return _0x1b7e13[_0x1837('0x2')][_0x1837('0x6')][_0x1837('0x3')]({'where':{'exten':{'$in':_[_0x1837('0x7')](_[_0x1837('0x8')](_0x4c03cf,_0x1837('0x9')))}},'order':[{'raw':_0x1837('0xa')}],'raw':!![]});})['then'](function(_0x18bf22){var _0x2d6bcd=_['filter'](_0x18bf22,{'priority':'1'});var _0x4c7bfb=_['filter'](_0x18bf22,{'isApp':0x1});var _0x443b82=_['groupBy'](_0x4c7bfb,_0x1837('0x9'));var _0x323b28=['queue','playback'];var _0x45cf4d=[];var _0x1f853e=[];for(var _0x4b9705 in _0x443b82){if(_0x443b82[_0x1837('0xb')](_0x4b9705)){_0x6917e1[_0x1837('0xc')]=0x2;_0x6917e1[_0x1837('0xd')]=[];_0x6917e1[_0x1837('0xe')]=_[_0x1837('0xf')](_0x2d6bcd,{'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')]});_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':util[_0x1837('0x13')](_0x1837('0x14'),_0x443b82[_0x4b9705][0x0][_0x1837('0x11')]),'context':_0x443b82[_0x4b9705][0x0]['context'],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1['priority']++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});if(_0x443b82[_0x4b9705][0x0]['type']===_0x1837('0x16')){_0x6917e1['extensions']['push']({'type':_0x443b82[_0x4b9705][0x0]['type'],'app':_0x1837('0x12'),'appdata':_0x1837('0x17')+_0x443b82[_0x4b9705][0x0][_0x1837('0x15')],'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0]['exten'],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0]['VoiceExtensionId']});}else if(_0x443b82[_0x4b9705][0x0][_0x1837('0x11')]==='outbound'){if(_0x6917e1[_0x1837('0xe')]){_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x19')+(_0x6917e1[_0x1837('0xe')]['cutdigits']?_0x1837('0x1a')+_0x6917e1[_0x1837('0xe')]['cutdigits']+'}':'${EXTEN}'),'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0]['VoiceExtensionId']});}_0x6917e1['extensions']['push']({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':'Set','appdata':_0x1837('0x17')+_0x443b82[_0x4b9705][0x0][_0x1837('0x15')],'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});var _0x316f1b=_0x6917e1[_0x1837('0xc')]++;_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x1b'),'appdata':_0x1837('0x1c')+(_0x316f1b+0x2)+_0x1837('0x1d')+(_0x316f1b+0x1)+')','context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x316f1b,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0]['VoiceExtensionId']});if(_0x6917e1['extension']){_0x6917e1['extensions'][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':'Set','appdata':_0x6917e1[_0x1837('0xe')][_0x1837('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x6917e1[_0x1837('0xe')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0]['VoiceExtensionId']});}_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x1f')+_0x443b82[_0x4b9705][0x0]['VoiceExtensionId'],'context':_0x443b82[_0x4b9705][0x0]['context'],'exten':_0x443b82[_0x4b9705][0x0]['exten'],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});if(_0x6917e1['extension']&&_0x6917e1[_0x1837('0xe')][_0x1837('0xb')]('recordingFormat')&&_0x6917e1['extension'][_0x1837('0x20')]!==_0x1837('0x21')){_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':'Set','appdata':_0x1837('0x22'),'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});_0x6917e1['extensions']['push']({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x23')+_0x6917e1['extension'][_0x1837('0x20')]||_0x1837('0x24'),'context':_0x443b82[_0x4b9705][0x0]['context'],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1['priority']++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});}}_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x25'),'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'priority':_0x6917e1['priority']++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});_0x6917e1[_0x1837('0xd')][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x26'),'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'exten':_0x443b82[_0x4b9705][0x0]['exten'],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});_0x6917e1['extensions'][_0x1837('0x10')]({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x443b82[_0x4b9705][0x0]['context'],'exten':_0x443b82[_0x4b9705][0x0]['exten'],'priority':_0x6917e1[_0x1837('0xc')]++,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});for(var _0x48ff8d=0x0,_0x17edb4=0x0;_0x48ff8d<_0x443b82[_0x4b9705][_0x1837('0x27')];_0x48ff8d+=0x1,_0x17edb4=0x0){var _0x32d97c=_0x443b82[_0x4b9705][_0x48ff8d];if(_0x32d97c[_0x1837('0x11')]){_0x32d97c[_0x1837('0x11')]=_0x32d97c[_0x1837('0x11')][_0x1837('0x28')]();}var _0x189b22=[];var _0x8f957b=[];delete _0x32d97c['id'];delete _0x32d97c[_0x1837('0x29')];delete _0x32d97c['updatedAt'];var _0x964673=_0x32d97c['interval']!==_0x1837('0x2a')?[_0x32d97c[_0x1837('0x2b')]]:_0x32d97c[_0x1837('0x2c')]?_[_0x1837('0x8')](_[_0x1837('0x2d')](_0x6917e1[_0x1837('0x5')],{'IntervalId':_0x32d97c['IntervalId']}),_0x1837('0x2b')):[];if(_0x32d97c[_0x1837('0xb')](_0x1837('0x2e'))){if(_0x32d97c[_0x1837('0x2e')]&&_0x32d97c[_0x1837('0x2e')]!=='--'){_0x189b22[_0x1837('0x10')]({'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':'CDR(tag)='+_0x32d97c[_0x1837('0x2e')],'context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c[_0x1837('0x9')],'priority':_0x964673[_0x1837('0x27')]+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});}}if(_0x32d97c['type']===_0x1837('0x2f')&&_0x32d97c[_0x1837('0xb')]('callerID')){if(_0x32d97c[_0x1837('0x30')]){_0x189b22['push']({'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x32d97c[_0x1837('0x30')]+')','context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c['exten'],'priority':_0x964673[_0x1837('0x27')]+_0x6917e1['priority']+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});}else{_0x189b22['push']({'type':_0x32d97c['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c[_0x1837('0x9')],'priority':_0x964673['length']+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});}}if(_0x32d97c['hasOwnProperty'](_0x1837('0x31'))){if(_0x323b28['indexOf'](_0x32d97c[_0x1837('0x32')]['toLowerCase']())>=0x0&&_0x32d97c[_0x1837('0x33')]!==_0x1837('0x34')){if(_0x32d97c[_0x1837('0x31')]){_0x189b22['push']({'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x1b'),'appdata':_0x1837('0x35'),'context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c[_0x1837('0x9')],'priority':_0x964673[_0x1837('0x27')]+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});_0x189b22[_0x1837('0x10')]({'type':_0x32d97c['type'],'app':_0x1837('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c['exten'],'priority':_0x964673[_0x1837('0x27')]+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});}else{_0x189b22[_0x1837('0x10')]({'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x1b'),'appdata':_0x1837('0x36'),'context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c[_0x1837('0x9')],'priority':_0x964673['length']+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});_0x189b22['push']({'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x12'),'appdata':_0x1837('0x37'),'context':_0x32d97c[_0x1837('0x18')],'exten':_0x32d97c[_0x1837('0x9')],'priority':_0x964673['length']+_0x6917e1[_0x1837('0xc')]+_0x17edb4++,'VoiceExtensionId':_0x32d97c[_0x1837('0x15')]});}}}for(var _0x1e6c98=0x0;_0x1e6c98<_0x964673[_0x1837('0x27')];_0x1e6c98+=0x1){var _0x1bfd7d=_0x6917e1[_0x1837('0xc')]+_0x964673[_0x1837('0x27')];var _0x126bc4=_0x1e6c98===_0x964673[_0x1837('0x27')]-0x1?_0x6917e1['priority']+_0x189b22[_0x1837('0x27')]+_0x8f957b[_0x1837('0x27')]+0x2:_0x6917e1[_0x1837('0xc')]+_0x1e6c98+0x1;_0x189b22['splice'](_0x1e6c98,0x0,{'type':_0x32d97c[_0x1837('0x11')],'app':_0x1837('0x38'),'appdata':_0x964673[_0x1e6c98]+'?'+_0x32d97c[_0x1837('0x18')]+_0x1837('0x39')+_0x1bfd7d+':'+_0x32d97c[_0x1837('0x18')]+_0x1837('0x39')+_0x126bc4,'exten':_0x32d97c['exten'],'context':_0x32d97c['context'],'priority':_0x6917e1['priority']+_0x1e6c98,'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});}_0x32d97c[_0x1837('0xc')]=_0x189b22[_0x1837('0x27')]?_['last'](_0x189b22)[_0x1837('0xc')]+0x1:_0x6917e1[_0x1837('0xc')];_0x6917e1[_0x1837('0xc')]=(_0x8f957b['length']?_[_0x1837('0x3a')](_0x8f957b)[_0x1837('0xc')]:_0x32d97c['priority'])+0x1;_0x6917e1['extensions']=_[_0x1837('0x3b')](_0x6917e1[_0x1837('0xd')],_0x189b22,[_0x32d97c],_0x8f957b);}_0x6917e1[_0x1837('0xd')]['push']({'type':_0x443b82[_0x4b9705][0x0][_0x1837('0x11')],'app':_0x1837('0x3c'),'exten':_0x443b82[_0x4b9705][0x0][_0x1837('0x9')],'context':_0x443b82[_0x4b9705][0x0][_0x1837('0x18')],'priority':_0x6917e1[_0x1837('0xc')],'VoiceExtensionId':_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]});_0x45cf4d['push'](_0x443b82[_0x4b9705][0x0][_0x1837('0x15')]);_0x1f853e=_['concat'](_0x1f853e,_0x6917e1['extensions']);}}return _0x1b7e13[_0x1837('0x3d')](function(_0x3d6776){return _0x1b7e13[_0x1837('0x2')][_0x1837('0x6')][_0x1837('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x45cf4d}},'transaction':_0x3d6776})[_0x1837('0x4')](function(_0xa17773){return _0x1b7e13[_0x1837('0x2')][_0x1837('0x6')][_0x1837('0x3f')](_[_0x1837('0x40')](_0x1f853e,_0x1837('0xc')),{'transaction':_0x3d6776});});});})[_0x1837('0x41')](function(_0x1d32d9){console['error'](_0x1d32d9);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 6cdf011..97ecf93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc93=['../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','from','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','Lists','then','always','query','onlyIfOpen','sequelize','VoiceQueueId','all','BlackLists','get','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb'];(function(_0x257b8b,_0x29d90b){var _0x428dc3=function(_0x132d98){while(--_0x132d98){_0x257b8b['push'](_0x257b8b['shift']());}};_0x428dc3(++_0x29d90b);}(_0xbc93,0xdd));var _0x3bc9=function(_0x3cc575,_0x3e8ae6){_0x3cc575=_0x3cc575-0x0;var _0x276e6b=_0xbc93[_0x3cc575];return _0x276e6b;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3bc9('0x0'));var fs=require('fs');var squel=require(_0x3bc9('0x1'));var Papa=require(_0x3bc9('0x2'));var Redis=require(_0x3bc9('0x3'));var db=require(_0x3bc9('0x4'))['db'];var config=require(_0x3bc9('0x5'));var logger=require(_0x3bc9('0x6'))(_0x3bc9('0x7'));config[_0x3bc9('0x8')]=_[_0x3bc9('0x9')](config[_0x3bc9('0x8')],{'host':_0x3bc9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3bc9('0x8')]));require(_0x3bc9('0xb'))[_0x3bc9('0xc')](socket);try{if(!process[_0x3bc9('0xd')][0x2]||process[_0x3bc9('0xd')][0x2]===_0x3bc9('0xe')||process[_0x3bc9('0xd')][0x2]===_0x3bc9('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x3bc9('0xd')][0x2];if(!process[_0x3bc9('0xd')][0x3]||process[_0x3bc9('0xd')][0x3]==='undefined'||process[_0x3bc9('0xd')][0x3]==='null'||!process[_0x3bc9('0xd')][0x4]||process['argv'][0x4]===_0x3bc9('0xe')||process[_0x3bc9('0xd')][0x4]==='null'){throw new Error(_0x3bc9('0x10'));}var FIELDS=_[_0x3bc9('0x11')](process[_0x3bc9('0xd')][0x3][_0x3bc9('0x12')](','),process[_0x3bc9('0xd')][0x4][_0x3bc9('0x12')](','));if(!process['argv'][0x5]||process[_0x3bc9('0xd')][0x5]===_0x3bc9('0xe')||process[_0x3bc9('0xd')][0x5]==='null'){throw new Error(_0x3bc9('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3bc9('0xd')][0x6]!==_0x3bc9('0xe')&&process[_0x3bc9('0xd')][0x6]!==_0x3bc9('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x3bc9('0xd')][0x7]&&process[_0x3bc9('0xd')][0x7]!==_0x3bc9('0xe')&&process[_0x3bc9('0xd')][0x7]!=='null'?process[_0x3bc9('0xd')][0x7]:null;if(!process[_0x3bc9('0xd')][0x8]||process[_0x3bc9('0xd')][0x8]===_0x3bc9('0xe')||process['argv'][0x8]==='null'){throw new Error(_0x3bc9('0x14'));}var SOCKET_TIMESTAMP=process[_0x3bc9('0xd')][0x8];}catch(_0x56c10d){logger[_0x3bc9('0x15')](_0x56c10d);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(_0x4fb6e7,_0x2377c2,_0x345dfa,_0x557773){var _0x320448={'message':_0x2377c2};_0x320448[_0x4fb6e7]=!![];if(_0x345dfa){_0x320448[_0x3bc9('0x16')]=_0x345dfa;}if(_0x557773){_0x320448[_0x3bc9('0x17')]=_0x557773;}return _0x320448;}function isEmail(_0x556b37){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))*$/[_0x3bc9('0x18')](_0x556b37);}function checkRow(_0x16af21,_0x5d1769,_0x391ac3){return new BPromise(function(_0x312351,_0x2e835e){if(_['isNil'](_0x16af21)){return _0x2e835e(handleCheckRowError('error',_0x3bc9('0x19'),null,_0x391ac3));}if(_0x16af21[_0x3bc9('0x1a')]&&_0x16af21[_0x3bc9('0x1a')]['length']){var _0x324096=_[_0x3bc9('0x1b')](_0x16af21[_0x3bc9('0x1a')],_0x3bc9('0x1c'))[_0x3bc9('0x1d')](';');return _0x2e835e(handleCheckRowError(_0x3bc9('0x15'),_0x324096,null,_0x391ac3));}var _0x3573b0={};for(var _0x54407f in FIELDS){if(FIELDS[_0x3bc9('0x1e')](_0x54407f)&&FIELDS[_0x54407f]){_0x3573b0[_0x54407f]=_0x16af21[_0x3bc9('0x1f')][0x0][FIELDS[_0x54407f]]||_0x16af21[_0x3bc9('0x1f')][0x0]['\ufeff'+FIELDS[_0x54407f]];}}if(!_0x3573b0[_0x3bc9('0x20')]){return _0x2e835e(handleCheckRowError('error',_0x3bc9('0x21'),null,_0x391ac3));}if(!_0x3573b0[_0x3bc9('0x22')]){return _0x2e835e(handleCheckRowError(_0x3bc9('0x15'),_0x3bc9('0x23'),null,_0x391ac3));}if(_0x3573b0[_0x3bc9('0x24')]){var _0xb8195b=moment(_0x3573b0[_0x3bc9('0x24')],_0x3bc9('0x25'));if(!_0xb8195b['isValid']()){return _0x2e835e(handleCheckRowError(_0x3bc9('0x15'),_0x3bc9('0x26'),null,_0x391ac3));}}if(_0x3573b0['email']){if(!isEmail(_0x3573b0['email'])){return _0x2e835e(handleCheckRowError(_0x3bc9('0x15'),_0x3bc9('0x27'),null,_0x391ac3));}}_0x3573b0[_0x3bc9('0x28')]=LISTID;_0x3573b0[_0x3bc9('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3bc9('0x2a')]&&_0x5d1769){var _0x479466={};for(var _0x31875f=0x0,_0x2ac352=DUPLICATES[_0x3bc9('0x2a')];_0x31875f<_0x2ac352;_0x31875f+=0x1){_0x479466[DUPLICATES[_0x31875f]]=_0x3573b0[DUPLICATES[_0x31875f]];}var _0xb5bf27=_[_0x3bc9('0x2b')](_0x5d1769,_0x479466);if(_0xb5bf27){return _0x2e835e(handleCheckRowError(_0x3bc9('0x2c'),_0x3bc9('0x2d'),_0xb5bf27,_0x391ac3));}}return db[_0x3bc9('0x2e')][_0x3bc9('0x2f')](_0x3573b0,{'raw':!![],'hooks':![],'fields':_[_0x3bc9('0x30')](_0x3573b0)})['then'](function(_0x5027cb){if(DUPLICATES&&DUPLICATES[_0x3bc9('0x2a')]&&_0x5d1769){_0x5d1769[_0x3bc9('0x31')](_[_0x3bc9('0x32')](_0x3573b0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5027cb['id'];return _0x312351();})[_0x3bc9('0x33')](function(_0x40ce6e){return _0x2e835e(handleCheckRowError(_0x3bc9('0x15'),_0x3bc9('0x34')+(_0x40ce6e[_0x3bc9('0x1c')]||JSON[_0x3bc9('0x35')](_0x40ce6e)),null,_0x391ac3));});});}function checkHopper(){function _0x142e60(){return function(_0x421bae){logger[_0x3bc9('0x15')](_0x3bc9('0x36'),_0x3bc9('0x37'),util[_0x3bc9('0x38')](_0x421bae,{'showHidden':![],'depth':null}));};}var _0x28eadb=function(_0x4a941c,_0x555ebe){var _0x5370b3=squel[_0x3bc9('0x39')]()[_0x3bc9('0x3a')](_0x3bc9('0x3b'))[_0x3bc9('0x3c')]([_0x3bc9('0x22'),_0x3bc9('0x3d'),_0x3bc9('0x3e'),_0x3bc9('0x28'),_0x555ebe,_0x3bc9('0x3f'),_0x3bc9('0x40')],squel[_0x3bc9('0x41')]()[_0x3bc9('0x42')](_0x3bc9('0x22'),_0x3bc9('0x22'))[_0x3bc9('0x42')]('NOW()',_0x3bc9('0x3d'))[_0x3bc9('0x42')]('id','ContactId')['field'](LISTID[_0x3bc9('0x43')](),_0x3bc9('0x28'))[_0x3bc9('0x42')](_0x4a941c['id'][_0x3bc9('0x43')](),_0x555ebe)[_0x3bc9('0x42')](_0x3bc9('0x44'),_0x3bc9('0x3f'))[_0x3bc9('0x42')](_0x3bc9('0x44'),'updatedAt')['from'](_0x3bc9('0x45'))[_0x3bc9('0x46')](_0x3bc9('0x47'))[_0x3bc9('0x46')]('ListId\x20=\x20?',LISTID[_0x3bc9('0x43')]())[_0x3bc9('0x46')](_0x3bc9('0x48'))[_0x3bc9('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3bc9('0x42')]('phone')[_0x3bc9('0x49')](_0x3bc9('0x3b'))['where'](_0x555ebe+'\x20=\x20?',_0x4a941c['id'][_0x3bc9('0x43')]())))[_0x3bc9('0x43')]();return _0x5370b3;};var _0x11bb7f=function(_0x1d3c42,_0x551e78){var _0x241f95=squel['insert']()[_0x3bc9('0x3a')](_0x3bc9('0x3b'))[_0x3bc9('0x3c')]([_0x3bc9('0x22'),_0x3bc9('0x3d'),_0x3bc9('0x3e'),_0x3bc9('0x28'),_0x551e78,_0x3bc9('0x3f'),_0x3bc9('0x40')],squel[_0x3bc9('0x41')]()[_0x3bc9('0x42')](_0x3bc9('0x22'),_0x3bc9('0x22'))[_0x3bc9('0x42')]('NOW()',_0x3bc9('0x3d'))[_0x3bc9('0x42')]('id',_0x3bc9('0x3e'))[_0x3bc9('0x42')](LISTID['toString'](),_0x3bc9('0x28'))['field'](_0x1d3c42['id']['toString'](),_0x551e78)[_0x3bc9('0x42')]('NOW()',_0x3bc9('0x3f'))[_0x3bc9('0x42')](_0x3bc9('0x44'),_0x3bc9('0x40'))[_0x3bc9('0x49')](_0x3bc9('0x45'))['where'](_0x3bc9('0x47'))[_0x3bc9('0x46')](_0x3bc9('0x4a'),LISTID[_0x3bc9('0x43')]())[_0x3bc9('0x46')](_0x3bc9('0x4b'),squel[_0x3bc9('0x4c')](hopperContacts))[_0x3bc9('0x46')](_0x3bc9('0x48'))[_0x3bc9('0x46')](_0x3bc9('0x4d'),squel['select']()[_0x3bc9('0x42')]('calleridnum')['from'](_0x3bc9('0x4e'))[_0x3bc9('0x46')](_0x551e78+_0x3bc9('0x4f'),_0x1d3c42['id'][_0x3bc9('0x43')]()))[_0x3bc9('0x46')](_0x3bc9('0x4d'),squel[_0x3bc9('0x41')]()[_0x3bc9('0x42')](_0x3bc9('0x22'))['from'](_0x3bc9('0x3b'))['where'](_0x551e78+_0x3bc9('0x4f'),_0x1d3c42['id'][_0x3bc9('0x43')]())))[_0x3bc9('0x43')]();return _0x241f95;};function _0x9a84fc(_0x25a9cf,_0x12dac0){var _0x82d9a7=squel[_0x3bc9('0x39')]()['into'](_0x3bc9('0x3b'))[_0x3bc9('0x3c')](['phone','scheduledAt',_0x3bc9('0x3e'),_0x3bc9('0x28'),_0x12dac0,_0x3bc9('0x3f'),_0x3bc9('0x40')],squel['select']()[_0x3bc9('0x42')](_0x3bc9('0x22'),_0x3bc9('0x22'))[_0x3bc9('0x42')](_0x3bc9('0x44'),_0x3bc9('0x3d'))[_0x3bc9('0x42')]('id','ContactId')[_0x3bc9('0x42')](LISTID['toString'](),'ListId')[_0x3bc9('0x42')](_0x25a9cf['id']['toString'](),_0x12dac0)['field'](_0x3bc9('0x44'),_0x3bc9('0x3f'))['field']('NOW()',_0x3bc9('0x40'))[_0x3bc9('0x49')](_0x3bc9('0x45'))[_0x3bc9('0x46')]('deletedAt\x20IS\x20NULL')[_0x3bc9('0x46')](_0x3bc9('0x4a'),LISTID[_0x3bc9('0x43')]())['where'](_0x3bc9('0x4b'),squel[_0x3bc9('0x4c')](hopperContacts))[_0x3bc9('0x46')](_0x3bc9('0x48')))[_0x3bc9('0x43')]();return _0x82d9a7;}function _0x3b147d(_0x3be6e7,_0x2c6820){var _0x1db1c4=squel[_0x3bc9('0x39')]()[_0x3bc9('0x3a')](_0x3bc9('0x50'))[_0x3bc9('0x3c')]([_0x3bc9('0x22'),_0x3bc9('0x3e'),_0x3bc9('0x28'),_0x2c6820,_0x3bc9('0x3f'),_0x3bc9('0x40')],squel['select']()[_0x3bc9('0x42')]('phone',_0x3bc9('0x22'))[_0x3bc9('0x42')]('id',_0x3bc9('0x3e'))[_0x3bc9('0x42')](LISTID[_0x3bc9('0x43')](),_0x3bc9('0x28'))[_0x3bc9('0x42')](_0x3be6e7['id'][_0x3bc9('0x43')](),_0x2c6820)['field'](_0x3bc9('0x44'),_0x3bc9('0x3f'))['field'](_0x3bc9('0x44'),'updatedAt')['from'](_0x3bc9('0x45'))['where'](_0x3bc9('0x47'))[_0x3bc9('0x46')](_0x3bc9('0x4a'),LISTID[_0x3bc9('0x43')]())['where']('id\x20IN\x20?',squel[_0x3bc9('0x4c')](hopperContacts))['where'](_0x3bc9('0x48')))[_0x3bc9('0x43')]();return _0x1db1c4;}return db[_0x3bc9('0x51')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x3bc9('0x52')],'include':[{'model':db[_0x3bc9('0x53')],'as':_0x3bc9('0x54'),'where':{'id':LISTID}}]})[_0x3bc9('0x55')](function(_0x122f6d){var _0x318dbc=[];if(_0x122f6d){var _0x12bb98;for(var _0x5429fd=0x0,_0x4059fb;_0x5429fd<_0x122f6d['length'];_0x5429fd+=0x1){_0x4059fb=_0x122f6d[_0x5429fd]['get']({'plain':!![]});switch(_0x4059fb[_0x3bc9('0x52')]){case _0x3bc9('0x56'):_0x318dbc[_0x3bc9('0x31')](db['sequelize'][_0x3bc9('0x57')](_0x11bb7f(_0x4059fb,'VoiceQueueId'))['then'](function(){})[_0x3bc9('0x33')](_0x142e60()));break;case _0x3bc9('0x58'):_0x318dbc[_0x3bc9('0x31')](db[_0x3bc9('0x59')]['query'](_0x28eadb(_0x4059fb,_0x3bc9('0x5a')))['then'](function(){})[_0x3bc9('0x33')](_0x142e60()));break;default:_0x318dbc[_0x3bc9('0x31')](db[_0x3bc9('0x59')][_0x3bc9('0x57')](_0x9a84fc(_0x4059fb,_0x3bc9('0x5a')))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));}}}return _0x318dbc;})[_0x3bc9('0x5b')]()[_0x3bc9('0x55')](function(){return db[_0x3bc9('0x51')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3bc9('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2c882e){var _0x52c76e=[];if(_0x2c882e){var _0x47d56f;for(var _0x49f77b=0x0,_0x195a24;_0x49f77b<_0x2c882e[_0x3bc9('0x2a')];_0x49f77b+=0x1){_0x195a24=_0x2c882e[_0x49f77b][_0x3bc9('0x5d')]({'plain':!![]});_0x52c76e[_0x3bc9('0x31')](db['sequelize'][_0x3bc9('0x57')](_0x3b147d(_0x195a24,_0x3bc9('0x5a')))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));}}return _0x52c76e;})[_0x3bc9('0x5b')]();})[_0x3bc9('0x55')](function(){return db[_0x3bc9('0x5e')][_0x3bc9('0x5f')]({'attributes':['id',_0x3bc9('0x52')],'include':[{'model':db[_0x3bc9('0x53')],'as':_0x3bc9('0x54'),'where':{'id':LISTID}}]})[_0x3bc9('0x55')](function(_0x4d793b){var _0x588b21=[];if(_0x4d793b){for(var _0x2e25f9=0x0,_0x3022b9;_0x2e25f9<_0x4d793b['length'];_0x2e25f9+=0x1){_0x3022b9=_0x4d793b[_0x2e25f9]['get']({'plain':!![]});switch(_0x3022b9['dialCheckDuplicateType']){case'always':_0x588b21[_0x3bc9('0x31')](db[_0x3bc9('0x59')]['query'](_0x11bb7f(_0x3022b9,'CampaignId'))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));break;case'onlyIfOpen':_0x588b21[_0x3bc9('0x31')](db['sequelize'][_0x3bc9('0x57')](_0x28eadb(_0x3022b9,_0x3bc9('0x60')))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));break;default:_0x588b21[_0x3bc9('0x31')](db['sequelize']['query'](_0x9a84fc(_0x3022b9,_0x3bc9('0x60')))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));}}}return _0x588b21;})[_0x3bc9('0x5b')]();})[_0x3bc9('0x55')](function(){return db[_0x3bc9('0x5e')][_0x3bc9('0x5f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3bc9('0x5c'),'where':{'id':LISTID}}]})[_0x3bc9('0x55')](function(_0x1d0084){var _0x5cc2c4=[];if(_0x1d0084){for(var _0x5d8964=0x0,_0x4f54cc;_0x5d8964<_0x1d0084[_0x3bc9('0x2a')];_0x5d8964+=0x1){_0x4f54cc=_0x1d0084[_0x5d8964][_0x3bc9('0x5d')]({'plain':!![]});_0x5cc2c4[_0x3bc9('0x31')](db[_0x3bc9('0x59')]['query'](_0x3b147d(_0x4f54cc,_0x3bc9('0x60')))[_0x3bc9('0x55')](function(){})[_0x3bc9('0x33')](_0x142e60()));}}return _0x5cc2c4;})[_0x3bc9('0x5b')]();})['catch'](function(_0x662b8a){logger[_0x3bc9('0x15')](_0x3bc9('0x61'),_0x3bc9('0x62'),_0x662b8a[_0x3bc9('0x1c')]);});}var processPromises=function(_0x574e4b){return BPromise[_0x3bc9('0x5b')](promises)['then'](function(_0x277bbd){})[_0x3bc9('0x33')](function(_0x446ba7){logger[_0x3bc9('0x15')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x446ba7));})[_0x3bc9('0x63')](function(){socket[_0x3bc9('0x64')](_0x3bc9('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x574e4b){return _0x574e4b[_0x3bc9('0x66')]();}});};var endCsv=function(){return BPromise[_0x3bc9('0x67')]()[_0x3bc9('0x55')](function(){if(hopperContacts){return checkHopper();}})[_0x3bc9('0x55')](function(){socket[_0x3bc9('0x64')](_0x3bc9('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3bc9('0x68')](FILEPATH);}catch(_0x452a6a){logger[_0x3bc9('0x15')](_0x3bc9('0x69'),JSON[_0x3bc9('0x35')](_0x452a6a));}finally{process[_0x3bc9('0x6a')](0x0);}});};process['on']('SIGINT',function(){logger[_0x3bc9('0x6b')](_0x3bc9('0x6c'));endCsv();});function main(){return BPromise[_0x3bc9('0x67')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3bc9('0x12')](',');return db[_0x3bc9('0x2e')][_0x3bc9('0x5f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3bc9('0x55')](function(_0x1e3767){var _0x1e257d=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x1e257d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2901f3,_0x56cf3c){total+=0x1;var _0x5ac950=total;promises[_0x3bc9('0x31')](checkRow(_0x2901f3,_0x1e3767,_0x5ac950)[_0x3bc9('0x55')](function(){success+=0x1;})['catch'](function(_0x421ce0){if(_0x421ce0[_0x3bc9('0x15')]){errors+=0x1;delete _0x421ce0[_0x3bc9('0x15')];}else if(_0x421ce0[_0x3bc9('0x2c')]){duplicates+=0x1;delete _0x421ce0[_0x3bc9('0x2c')];}rows[_0x3bc9('0x31')](_0x421ce0);}));if(total%0xc8===0x0){_0x56cf3c[_0x3bc9('0x6d')]();return processPromises(_0x56cf3c);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x3bc9('0x6e'));endCsv();});},'error':function(_0x1e4124,_0x59d754){logger[_0x3bc9('0x6b')](_0x3bc9('0x6f'),JSON['stringify'](_0x1e4124));endCsv();}});})['catch'](function(_0x1fa0ef){logger[_0x3bc9('0x15')](_0x3bc9('0x70'),JSON[_0x3bc9('0x35')](_0x1fa0ef));});}main();
\ No newline at end of file
+var _0x9a82=['then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','into','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','insert','id\x20IN\x20?','calleridnum','cm_hopper_final','str','findAll','dialCheckDuplicateType','CmList','Lists','always','push','sequelize','VoiceQueueId','onlyIfOpen','query','all','VoiceQueue','outbound','get','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a82,0x10f));var _0x29a8=function(_0x15e3dc,_0x2b37ee){_0x15e3dc=_0x15e3dc-0x0;var _0x603afd=_0x9a82[_0x15e3dc];return _0x603afd;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x29a8('0x0'));var fs=require('fs');var squel=require(_0x29a8('0x1'));var Papa=require(_0x29a8('0x2'));var Redis=require(_0x29a8('0x3'));var db=require(_0x29a8('0x4'))['db'];var config=require(_0x29a8('0x5'));var logger=require('../../../config/logger')(_0x29a8('0x6'));config[_0x29a8('0x7')]=_[_0x29a8('0x8')](config['redis'],{'host':_0x29a8('0x9'),'port':0x18eb});var socket=require(_0x29a8('0xa'))(new Redis(config[_0x29a8('0x7')]));require(_0x29a8('0xb'))[_0x29a8('0xc')](socket);try{if(!process[_0x29a8('0xd')][0x2]||process[_0x29a8('0xd')][0x2]===_0x29a8('0xe')||process[_0x29a8('0xd')][0x2]===_0x29a8('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x29a8('0xd')][0x2];if(!process[_0x29a8('0xd')][0x3]||process['argv'][0x3]===_0x29a8('0xe')||process['argv'][0x3]===_0x29a8('0xf')||!process[_0x29a8('0xd')][0x4]||process['argv'][0x4]===_0x29a8('0xe')||process['argv'][0x4]===_0x29a8('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process[_0x29a8('0xd')][0x4][_0x29a8('0x10')](','));if(!process[_0x29a8('0xd')][0x5]||process[_0x29a8('0xd')][0x5]===_0x29a8('0xe')||process[_0x29a8('0xd')][0x5]===_0x29a8('0xf')){throw new Error(_0x29a8('0x11'));}var LISTID=process[_0x29a8('0xd')][0x5];var COMPANYID=process[_0x29a8('0xd')][0x6]&&process['argv'][0x6]!==_0x29a8('0xe')&&process[_0x29a8('0xd')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x29a8('0xd')][0x7]!==_0x29a8('0xe')&&process['argv'][0x7]!==_0x29a8('0xf')?process[_0x29a8('0xd')][0x7]:null;if(!process[_0x29a8('0xd')][0x8]||process[_0x29a8('0xd')][0x8]==='undefined'||process['argv'][0x8]===_0x29a8('0xf')){throw new Error(_0x29a8('0x12'));}var SOCKET_TIMESTAMP=process[_0x29a8('0xd')][0x8];}catch(_0xb697b6){logger[_0x29a8('0x13')](_0xb697b6);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(_0x151dee,_0x520e37,_0x54d5ea,_0x4cc154){var _0x3f9381={'message':_0x520e37};_0x3f9381[_0x151dee]=!![];if(_0x54d5ea){_0x3f9381[_0x29a8('0x14')]=_0x54d5ea;}if(_0x4cc154){_0x3f9381[_0x29a8('0x15')]=_0x4cc154;}return _0x3f9381;}function isEmail(_0xafe66f){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))*$/[_0x29a8('0x16')](_0xafe66f);}function checkRow(_0x35282b,_0x11565c,_0x2454f6){return new BPromise(function(_0x18c43b,_0x4f872f){if(_[_0x29a8('0x17')](_0x35282b)){return _0x4f872f(handleCheckRowError(_0x29a8('0x13'),_0x29a8('0x18'),null,_0x2454f6));}if(_0x35282b[_0x29a8('0x19')]&&_0x35282b[_0x29a8('0x19')][_0x29a8('0x1a')]){var _0x1e2cac=_[_0x29a8('0x1b')](_0x35282b[_0x29a8('0x19')],_0x29a8('0x1c'))['join'](';');return _0x4f872f(handleCheckRowError('error',_0x1e2cac,null,_0x2454f6));}var _0x238191={};for(var _0x11ce6a in FIELDS){if(FIELDS['hasOwnProperty'](_0x11ce6a)&&FIELDS[_0x11ce6a]){_0x238191[_0x11ce6a]=_0x35282b['data'][0x0][FIELDS[_0x11ce6a]]||_0x35282b[_0x29a8('0x1d')][0x0]['\ufeff'+FIELDS[_0x11ce6a]];}}if(!_0x238191[_0x29a8('0x1e')]){return _0x4f872f(handleCheckRowError(_0x29a8('0x13'),'firstName\x20not\x20specified!',null,_0x2454f6));}if(!_0x238191[_0x29a8('0x1f')]){return _0x4f872f(handleCheckRowError(_0x29a8('0x13'),_0x29a8('0x20'),null,_0x2454f6));}if(_0x238191[_0x29a8('0x21')]){var _0x1f9090=moment(_0x238191[_0x29a8('0x21')],_0x29a8('0x22'));if(!_0x1f9090['isValid']()){return _0x4f872f(handleCheckRowError(_0x29a8('0x13'),_0x29a8('0x23'),null,_0x2454f6));}}if(_0x238191['email']){if(!isEmail(_0x238191[_0x29a8('0x24')])){return _0x4f872f(handleCheckRowError('error',_0x29a8('0x25'),null,_0x2454f6));}}_0x238191[_0x29a8('0x26')]=LISTID;_0x238191[_0x29a8('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x11565c){var _0x480248={};for(var _0x4d43a7=0x0,_0x5529a4=DUPLICATES[_0x29a8('0x1a')];_0x4d43a7<_0x5529a4;_0x4d43a7+=0x1){_0x480248[DUPLICATES[_0x4d43a7]]=_0x238191[DUPLICATES[_0x4d43a7]];}var _0x395042=_[_0x29a8('0x28')](_0x11565c,_0x480248);if(_0x395042){return _0x4f872f(handleCheckRowError(_0x29a8('0x29'),_0x29a8('0x2a'),_0x395042,_0x2454f6));}}return db['CmContact']['create'](_0x238191,{'raw':!![],'hooks':![],'fields':_[_0x29a8('0x2b')](_0x238191)})[_0x29a8('0x2c')](function(_0x1e78cd){if(DUPLICATES&&DUPLICATES[_0x29a8('0x1a')]&&_0x11565c){_0x11565c['push'](_[_0x29a8('0x2d')](_0x238191,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1e78cd['id'];return _0x18c43b();})[_0x29a8('0x2e')](function(_0x1e816d){return _0x4f872f(handleCheckRowError(_0x29a8('0x13'),_0x29a8('0x2f')+(_0x1e816d[_0x29a8('0x1c')]||JSON[_0x29a8('0x30')](_0x1e816d)),null,_0x2454f6));});});}function checkHopper(){function _0x1c3922(){return function(_0x7cda22){logger[_0x29a8('0x13')]('cmContact','checkHopper',util[_0x29a8('0x31')](_0x7cda22,{'showHidden':![],'depth':null}));};}var _0x28e51d=function(_0x246a08,_0x7650a0){var _0x1cce46=squel['insert']()[_0x29a8('0x32')]('cm_hopper')[_0x29a8('0x33')]([_0x29a8('0x1f'),_0x29a8('0x34'),_0x29a8('0x35'),_0x29a8('0x26'),_0x7650a0,_0x29a8('0x36'),'updatedAt'],squel[_0x29a8('0x37')]()[_0x29a8('0x38')](_0x29a8('0x1f'),'phone')[_0x29a8('0x38')](_0x29a8('0x39'),'scheduledAt')[_0x29a8('0x38')]('id',_0x29a8('0x35'))[_0x29a8('0x38')](LISTID[_0x29a8('0x3a')](),_0x29a8('0x26'))[_0x29a8('0x38')](_0x246a08['id'][_0x29a8('0x3a')](),_0x7650a0)[_0x29a8('0x38')](_0x29a8('0x39'),'createdAt')[_0x29a8('0x38')](_0x29a8('0x39'),_0x29a8('0x3b'))[_0x29a8('0x3c')](_0x29a8('0x3d'))[_0x29a8('0x3e')](_0x29a8('0x3f'))[_0x29a8('0x3e')](_0x29a8('0x40'),LISTID[_0x29a8('0x3a')]())['where'](_0x29a8('0x41'))['where'](_0x29a8('0x42'),squel['select']()[_0x29a8('0x38')](_0x29a8('0x1f'))['from'](_0x29a8('0x43'))[_0x29a8('0x3e')](_0x7650a0+_0x29a8('0x44'),_0x246a08['id'][_0x29a8('0x3a')]())))['toString']();return _0x1cce46;};var _0x4c3b85=function(_0x20d340,_0x2f6a71){var _0x3ab00c=squel[_0x29a8('0x45')]()[_0x29a8('0x32')]('cm_hopper')['fromQuery']([_0x29a8('0x1f'),_0x29a8('0x34'),_0x29a8('0x35'),_0x29a8('0x26'),_0x2f6a71,_0x29a8('0x36'),'updatedAt'],squel[_0x29a8('0x37')]()[_0x29a8('0x38')](_0x29a8('0x1f'),'phone')['field'](_0x29a8('0x39'),_0x29a8('0x34'))['field']('id',_0x29a8('0x35'))['field'](LISTID[_0x29a8('0x3a')](),'ListId')[_0x29a8('0x38')](_0x20d340['id'][_0x29a8('0x3a')](),_0x2f6a71)[_0x29a8('0x38')]('NOW()','createdAt')[_0x29a8('0x38')](_0x29a8('0x39'),_0x29a8('0x3b'))[_0x29a8('0x3c')]('cm_contacts')[_0x29a8('0x3e')](_0x29a8('0x3f'))[_0x29a8('0x3e')](_0x29a8('0x40'),LISTID[_0x29a8('0x3a')]())[_0x29a8('0x3e')](_0x29a8('0x46'),squel['str'](hopperContacts))['where'](_0x29a8('0x41'))[_0x29a8('0x3e')](_0x29a8('0x42'),squel['select']()[_0x29a8('0x38')](_0x29a8('0x47'))[_0x29a8('0x3c')](_0x29a8('0x48'))[_0x29a8('0x3e')](_0x2f6a71+_0x29a8('0x44'),_0x20d340['id'][_0x29a8('0x3a')]()))[_0x29a8('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x29a8('0x37')]()[_0x29a8('0x38')]('phone')[_0x29a8('0x3c')](_0x29a8('0x43'))[_0x29a8('0x3e')](_0x2f6a71+_0x29a8('0x44'),_0x20d340['id'][_0x29a8('0x3a')]())))[_0x29a8('0x3a')]();return _0x3ab00c;};function _0x24f71e(_0x3e2075,_0x59c637){var _0xfed6a1=squel[_0x29a8('0x45')]()[_0x29a8('0x32')](_0x29a8('0x43'))[_0x29a8('0x33')]([_0x29a8('0x1f'),_0x29a8('0x34'),_0x29a8('0x35'),_0x29a8('0x26'),_0x59c637,_0x29a8('0x36'),_0x29a8('0x3b')],squel[_0x29a8('0x37')]()[_0x29a8('0x38')](_0x29a8('0x1f'),'phone')['field'](_0x29a8('0x39'),_0x29a8('0x34'))[_0x29a8('0x38')]('id',_0x29a8('0x35'))[_0x29a8('0x38')](LISTID[_0x29a8('0x3a')](),_0x29a8('0x26'))[_0x29a8('0x38')](_0x3e2075['id'][_0x29a8('0x3a')](),_0x59c637)['field']('NOW()',_0x29a8('0x36'))['field']('NOW()','updatedAt')[_0x29a8('0x3c')](_0x29a8('0x3d'))['where'](_0x29a8('0x3f'))['where'](_0x29a8('0x40'),LISTID[_0x29a8('0x3a')]())[_0x29a8('0x3e')](_0x29a8('0x46'),squel[_0x29a8('0x49')](hopperContacts))[_0x29a8('0x3e')](_0x29a8('0x41')))[_0x29a8('0x3a')]();return _0xfed6a1;}function _0x4b1445(_0x5a1ed9,_0x134d87){var _0xd638d1=squel[_0x29a8('0x45')]()['into']('cm_hopper_black')['fromQuery']([_0x29a8('0x1f'),'ContactId',_0x29a8('0x26'),_0x134d87,'createdAt','updatedAt'],squel['select']()['field']('phone',_0x29a8('0x1f'))[_0x29a8('0x38')]('id','ContactId')['field'](LISTID[_0x29a8('0x3a')](),_0x29a8('0x26'))[_0x29a8('0x38')](_0x5a1ed9['id'][_0x29a8('0x3a')](),_0x134d87)[_0x29a8('0x38')]('NOW()','createdAt')[_0x29a8('0x38')]('NOW()',_0x29a8('0x3b'))[_0x29a8('0x3c')](_0x29a8('0x3d'))[_0x29a8('0x3e')](_0x29a8('0x3f'))[_0x29a8('0x3e')](_0x29a8('0x40'),LISTID[_0x29a8('0x3a')]())[_0x29a8('0x3e')](_0x29a8('0x46'),squel[_0x29a8('0x49')](hopperContacts))[_0x29a8('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0xd638d1;}return db['VoiceQueue'][_0x29a8('0x4a')]({'where':{'type':'outbound'},'attributes':['id',_0x29a8('0x4b')],'include':[{'model':db[_0x29a8('0x4c')],'as':_0x29a8('0x4d'),'where':{'id':LISTID}}]})[_0x29a8('0x2c')](function(_0x1cc4bd){var _0x4c4adf=[];if(_0x1cc4bd){var _0x90f797;for(var _0x5446d2=0x0,_0x5b38d2;_0x5446d2<_0x1cc4bd['length'];_0x5446d2+=0x1){_0x5b38d2=_0x1cc4bd[_0x5446d2]['get']({'plain':!![]});switch(_0x5b38d2[_0x29a8('0x4b')]){case _0x29a8('0x4e'):_0x4c4adf[_0x29a8('0x4f')](db[_0x29a8('0x50')]['query'](_0x4c3b85(_0x5b38d2,_0x29a8('0x51')))['then'](function(){})[_0x29a8('0x2e')](_0x1c3922()));break;case _0x29a8('0x52'):_0x4c4adf[_0x29a8('0x4f')](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x28e51d(_0x5b38d2,_0x29a8('0x51')))['then'](function(){})[_0x29a8('0x2e')](_0x1c3922()));break;default:_0x4c4adf['push'](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x24f71e(_0x5b38d2,_0x29a8('0x51')))[_0x29a8('0x2c')](function(){})[_0x29a8('0x2e')](_0x1c3922()));}}}return _0x4c4adf;})[_0x29a8('0x54')]()[_0x29a8('0x2c')](function(){return db[_0x29a8('0x55')][_0x29a8('0x4a')]({'where':{'type':_0x29a8('0x56')},'attributes':['id'],'include':[{'model':db[_0x29a8('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x29a8('0x2c')](function(_0x3bb946){var _0x3df72d=[];if(_0x3bb946){var _0x21319d;for(var _0x5501b7=0x0,_0x12db63;_0x5501b7<_0x3bb946[_0x29a8('0x1a')];_0x5501b7+=0x1){_0x12db63=_0x3bb946[_0x5501b7][_0x29a8('0x57')]({'plain':!![]});_0x3df72d[_0x29a8('0x4f')](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x4b1445(_0x12db63,_0x29a8('0x51')))[_0x29a8('0x2c')](function(){})[_0x29a8('0x2e')](_0x1c3922()));}}return _0x3df72d;})[_0x29a8('0x54')]();})[_0x29a8('0x2c')](function(){return db['Campaign'][_0x29a8('0x4a')]({'attributes':['id',_0x29a8('0x4b')],'include':[{'model':db['CmList'],'as':_0x29a8('0x4d'),'where':{'id':LISTID}}]})[_0x29a8('0x2c')](function(_0x1bbdf0){var _0x25cda8=[];if(_0x1bbdf0){for(var _0x35c11d=0x0,_0x23c171;_0x35c11d<_0x1bbdf0[_0x29a8('0x1a')];_0x35c11d+=0x1){_0x23c171=_0x1bbdf0[_0x35c11d][_0x29a8('0x57')]({'plain':!![]});switch(_0x23c171['dialCheckDuplicateType']){case'always':_0x25cda8[_0x29a8('0x4f')](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x4c3b85(_0x23c171,_0x29a8('0x58')))['then'](function(){})[_0x29a8('0x2e')](_0x1c3922()));break;case'onlyIfOpen':_0x25cda8[_0x29a8('0x4f')](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x28e51d(_0x23c171,_0x29a8('0x58')))[_0x29a8('0x2c')](function(){})['catch'](_0x1c3922()));break;default:_0x25cda8[_0x29a8('0x4f')](db[_0x29a8('0x50')][_0x29a8('0x53')](_0x24f71e(_0x23c171,_0x29a8('0x58')))[_0x29a8('0x2c')](function(){})['catch'](_0x1c3922()));}}}return _0x25cda8;})[_0x29a8('0x54')]();})[_0x29a8('0x2c')](function(){return db[_0x29a8('0x59')][_0x29a8('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x29a8('0x4c')],'as':_0x29a8('0x5a'),'where':{'id':LISTID}}]})[_0x29a8('0x2c')](function(_0x31f88a){var _0x34ccac=[];if(_0x31f88a){for(var _0x31d3f6=0x0,_0x17d0d9;_0x31d3f6<_0x31f88a[_0x29a8('0x1a')];_0x31d3f6+=0x1){_0x17d0d9=_0x31f88a[_0x31d3f6]['get']({'plain':!![]});_0x34ccac[_0x29a8('0x4f')](db['sequelize'][_0x29a8('0x53')](_0x4b1445(_0x17d0d9,_0x29a8('0x58')))[_0x29a8('0x2c')](function(){})[_0x29a8('0x2e')](_0x1c3922()));}}return _0x34ccac;})[_0x29a8('0x54')]();})['catch'](function(_0x2bb315){logger[_0x29a8('0x13')](_0x29a8('0x5b'),_0x29a8('0x5c'),_0x2bb315[_0x29a8('0x1c')]);});}var processPromises=function(_0x988d3a){return BPromise[_0x29a8('0x54')](promises)['then'](function(_0x42d390){})[_0x29a8('0x2e')](function(_0xa5a5b3){logger[_0x29a8('0x13')](_0x29a8('0x5d'),JSON[_0x29a8('0x30')](_0xa5a5b3));})['finally'](function(){socket[_0x29a8('0x5e')](_0x29a8('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x988d3a){return _0x988d3a[_0x29a8('0x60')]();}});};var endCsv=function(){return BPromise[_0x29a8('0x61')]()[_0x29a8('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x29a8('0x2c')](function(){socket[_0x29a8('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x29a8('0x62')](FILEPATH);}catch(_0x4b6cb9){logger[_0x29a8('0x13')](_0x29a8('0x63'),JSON[_0x29a8('0x30')](_0x4b6cb9));}finally{process['exit'](0x0);}});};process['on'](_0x29a8('0x64'),function(){logger[_0x29a8('0x65')](_0x29a8('0x66'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x29a8('0x10')](',');return db[_0x29a8('0x67')][_0x29a8('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x29a8('0x2c')](function(_0x43a99f){var _0x9840c0=fs[_0x29a8('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x9840c0,{'header':!![],'skipEmptyLines':!![],'step':function(_0x35090b,_0x1932d2){total+=0x1;var _0x535ddf=total;promises[_0x29a8('0x4f')](checkRow(_0x35090b,_0x43a99f,_0x535ddf)[_0x29a8('0x2c')](function(){success+=0x1;})['catch'](function(_0x2c5665){if(_0x2c5665[_0x29a8('0x13')]){errors+=0x1;delete _0x2c5665[_0x29a8('0x13')];}else if(_0x2c5665[_0x29a8('0x29')]){duplicates+=0x1;delete _0x2c5665['duplicate'];}rows[_0x29a8('0x4f')](_0x2c5665);}));if(total%0xc8===0x0){_0x1932d2['pause']();return processPromises(_0x1932d2);}},'complete':function(){return processPromises()[_0x29a8('0x2c')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2ebd43,_0x156684){logger['info']('CSV\x20parse\x20error',JSON[_0x29a8('0x30')](_0x2ebd43));endCsv();}});})[_0x29a8('0x2e')](function(_0x225460){logger[_0x29a8('0x13')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x29a8('0x30')](_0x225460));});}main();
\ No newline at end of file
index 15208da..efe002b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa994=['cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_hopper_black','ListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','recallme','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','message','errors','code','info','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','set','offset','main','stringify','start','binding','clone','root','server/files/tmp','includes','ContactItemType','name','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','itemTypeId','description','replace','SystemRow','appendFileSync','emit','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','lodash','util','bluebird','moment','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','length','split','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id'];(function(_0x22da79,_0x35b9d2){var _0x2410ef=function(_0x2eb978){while(--_0x2eb978){_0x22da79['push'](_0x22da79['shift']());}};_0x2410ef(++_0x35b9d2);}(_0xa994,0x150));var _0x4a99=function(_0x445d81,_0x31123f){_0x445d81=_0x445d81-0x0;var _0x2ebbe8=_0xa994[_0x445d81];return _0x2ebbe8;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4a99('0x0'));var Papa=require('papaparse');var util=require(_0x4a99('0x1'));var BPromise=require(_0x4a99('0x2'));var moment=require(_0x4a99('0x3'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x4a99('0x4'))['db'];var config=require(_0x4a99('0x5'));var shared=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));config['redis']=_[_0x4a99('0x9')](config[_0x4a99('0xa')],{'host':_0x4a99('0xb'),'port':0x18eb});var socket=require(_0x4a99('0xc'))(new Redis(config[_0x4a99('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x4a99('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x4a99('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xb9ae0b){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))*$/[_0x4a99('0xf')](_0xb9ae0b);}function selectNotIn(_0x38b46e,_0x2c9291,_0x37ce9b,_0xb6082f,_0x1e1602){return squel[_0x4a99('0x10')]()[_0x4a99('0x11')](_0x4a99('0x12'))[_0x4a99('0x13')](_0xb6082f)[_0x4a99('0x14')](_0x2c9291,null,_0x2c9291+_0x4a99('0x15')+_0xb6082f+'.'+_0x37ce9b)[_0x4a99('0x16')](_0xb6082f+'.'+_0x37ce9b+_0x4a99('0x17')+_0x38b46e+'.'+_0x37ce9b)[_0x4a99('0x16')](_0x2c9291+_0x4a99('0x18')+_0x1e1602[_0x4a99('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3712bd,_0x4668db){promisesAdditionalPhones=[];return db[_0x4a99('0x19')][_0x4a99('0x1a')]({'raw':!![],'attributes':['id',_0x4a99('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x4a99('0x1c')](function(_0x816ef6){if(_0x816ef6!==null){var _0x5f02ab=[];for(var _0x445733=0x0;_0x445733<_0x816ef6['length'];_0x445733++){var _0x1c4bf7=_0x816ef6[_0x445733];_0x5f02ab[_0x4a99('0x1d')](insertAdditionalPhones(_0x1c4bf7));}}Promise[_0x4a99('0x1e')](_0x5f02ab)[_0x4a99('0x1c')](function(){_0x3712bd({'val':0x1});});});});}function insertAdditionalPhones(_0xce3f08){return new Promise(function(_0x25110b,_0x2cdcb4){var _0x201bcd=_0xce3f08[_0x4a99('0x1b')];var _0x9bd758=_0x201bcd['split'](';');var _0x387163=[];orderBy=0x0;for(var _0x17d13f=0x0;_0x17d13f<_0x9bd758[_0x4a99('0x1f')];_0x17d13f++){_0x387163[_0x4a99('0x1d')](splitAdditionalPhone(_0xce3f08['id'],_0x9bd758[_0x17d13f]));}Promise['all'](_0x387163)[_0x4a99('0x1c')](function(){_0x25110b({'val':_0x9bd758[_0x4a99('0x1f')]});});});}function splitAdditionalPhone(_0xeac44f,_0x59380f){return new Promise(function(_0x23513c,_0x4ef9bc){var _0x2e87f4=_0x59380f[_0x4a99('0x20')](':');var _0x337f64=_0x2e87f4[0x0];var _0x226ac7=_0x2e87f4[0x1];if(!_['isNil'](_0x226ac7)){var _0x34e89b=_0x226ac7[_0x4a99('0x20')]('|');var _0x1d480d=[];for(var _0x16bb62=0x0;_0x16bb62<_0x34e89b[_0x4a99('0x1f')];_0x16bb62++){if(_0x34e89b[_0x16bb62]!==''){var _0x450cb1=_['filter'](promisesAdditionalPhones,{'contactId':_0xeac44f,'phone':_0x34e89b[_0x16bb62]});if(_0x450cb1[_0x4a99('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0x4a99('0x1d')]({'contactId':_0xeac44f,'contactTypeId':_0x337f64,'phone':_0x34e89b[_0x16bb62],'orderBy':orderBy});}}}_0x23513c({'ok':0x1});}else _0x23513c({'res':0x0});});}function createAdditionalPhone(_0x233538,_0x385d2a,_0x379c10,_0x1335d1){var _0x60c181='';var _0x50c93e='';var _0x47c499=_0x379c10['split']('§');_0x60c181=_0x47c499[0x0];if(_0x47c499[_0x4a99('0x1f')]==0x2)_0x50c93e=_0x47c499[0x1];return new Promise(function(_0x13fe40,_0x28e6e0){return db[_0x4a99('0x21')][_0x4a99('0x22')]({'where':{'CmContactId':_0x233538,'item':_0x60c181}})[_0x4a99('0x1c')](function(_0x63d9f7){if(_0x63d9f7){return db[_0x4a99('0x21')][_0x4a99('0x23')]({'ItemTypeId':_0x385d2a,'description':_0x50c93e,'OrderBy':_0x1335d1},{'where':{'CmContactId':_0x233538,'item':_0x60c181}})['then'](function(_0x3550ce){_0x13fe40({'res':_0x4a99('0x24')});});}else{return db[_0x4a99('0x21')][_0x4a99('0x25')]({'CmContactId':_0x233538,'item':_0x60c181,'description':_0x50c93e,'ItemTypeId':_0x385d2a,'OrderBy':_0x1335d1,'ItemClass':_0x4a99('0x26')})[_0x4a99('0x1c')](function(_0x590797){_0x13fe40({'res':_0x4a99('0x27')});});}});});}function insertCmHopper(_0x16f7e8,_0x1e85bc,_0x21b4a3,_0x4e3670,_0x39fc6f){var _0x325608=['cm_contacts.phone',_0x4a99('0x28'),_0x4a99('0x29'),_0x4a99('0x2a'),_0x1e85bc+'.'+_0x4e3670,'cm_contacts.createdAt',_0x4a99('0x2b'),_0x4a99('0x2c'),_0x4a99('0x2d'),'\x22'+_0x39fc6f+'\x22'];return squel[_0x4a99('0x2e')]()[_0x4a99('0x2f')](_0x4a99('0x30'))[_0x4a99('0x31')](['phone','scheduledat',_0x4a99('0x32'),'ListId',_0x4e3670,_0x4a99('0x33'),_0x4a99('0x34'),_0x4a99('0x35'),_0x4a99('0x36'),'recallme'],squel['select']()[_0x4a99('0x37')](_0x325608)[_0x4a99('0x13')](_0x1e85bc)[_0x4a99('0x14')](_0x4a99('0x38'),null,_0x4a99('0x39')+_0x1e85bc+_0x4a99('0x3a'))['join'](_0x21b4a3,null,_0x21b4a3+_0x4a99('0x15')+_0x1e85bc+'.'+_0x4e3670)[_0x4a99('0x16')](_0x1e85bc+_0x4a99('0x3b'),_0x16f7e8)[_0x4a99('0x16')](_0x4a99('0x3c'),NOW)[_0x4a99('0x16')](_0x4a99('0x3d'),selectNotIn(_0x1e85bc,_0x21b4a3,_0x4e3670,_0x4a99('0x30'),[_0x4a99('0x3e'),_0x4a99('0x3f')]))['where'](_0x4a99('0x3d'),selectNotIn(_0x1e85bc,_0x21b4a3,_0x4e3670,_0x4a99('0x30'),['\x22always\x22'])))[_0x4a99('0x40')]();}function insertCmHopperBlack(_0x22c51f,_0x3af443,_0x3c7ce6,_0xd51470){var _0x3b27bd=[_0x4a99('0x41'),_0x4a99('0x29'),'cm_contacts.ListId',_0x3af443+'.'+_0xd51470,_0x4a99('0x42'),_0x4a99('0x2b')];return squel['insert']()[_0x4a99('0x2f')](_0x4a99('0x43'))[_0x4a99('0x31')]([_0x4a99('0x12'),_0x4a99('0x32'),_0x4a99('0x44'),_0xd51470,_0x4a99('0x33'),_0x4a99('0x34')],squel[_0x4a99('0x10')]()[_0x4a99('0x37')](_0x3b27bd)['from'](_0x3af443)[_0x4a99('0x14')](_0x4a99('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x3af443+'.CmListId')[_0x4a99('0x14')](_0x3c7ce6,null,_0x3c7ce6+_0x4a99('0x15')+_0x3af443+'.'+_0xd51470)[_0x4a99('0x16')](_0x3af443+_0x4a99('0x3b'),_0x22c51f)[_0x4a99('0x16')](_0x4a99('0x3c'),NOW)[_0x4a99('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x4a99('0x10')]()['field'](_0x4a99('0x12'))['from'](_0x4a99('0x43'))[_0x4a99('0x16')](_0x4a99('0x45'),_0x22c51f)[_0x4a99('0x16')](_0xd51470+_0x4a99('0x17')+_0x3af443+'.'+_0xd51470)))[_0x4a99('0x40')]();}function insertTzCmHopper(_0x36462b,_0x3df343,_0x1c0f4c,_0xa0b7c4,_0x4f078c,_0x35e53a){var _0x4930a1=[_0x4a99('0x41'),_0x4a99('0x46')+_0x35e53a+_0x4a99('0x47'),_0x4a99('0x29'),'cm_contacts.ListId',_0x3df343+'.'+_0xa0b7c4,_0x4a99('0x42'),'cm_contacts.updatedAt',_0x4a99('0x2c'),_0x4a99('0x2d'),'\x22'+_0x4f078c+'\x22'];var _0x2ccb99=squel[_0x4a99('0x2e')]()[_0x4a99('0x2f')](_0x4a99('0x30'))[_0x4a99('0x31')]([_0x4a99('0x12'),_0x4a99('0x48'),'ContactId','ListId',_0xa0b7c4,_0x4a99('0x33'),_0x4a99('0x34'),_0x4a99('0x35'),'UserId',_0x4a99('0x49')],squel[_0x4a99('0x10')]()[_0x4a99('0x37')](_0x4930a1)[_0x4a99('0x13')](_0x3df343)['join'](_0x4a99('0x38'),null,_0x4a99('0x39')+_0x3df343+_0x4a99('0x3a'))[_0x4a99('0x14')](_0x1c0f4c,null,_0x1c0f4c+'.id\x20=\x20'+_0x3df343+'.'+_0xa0b7c4)[_0x4a99('0x14')](_0x35e53a,null,_0x35e53a+_0x4a99('0x15')+_0x3df343+'.'+_0xa0b7c4)[_0x4a99('0x16')](_0x3df343+_0x4a99('0x3b'),_0x36462b)[_0x4a99('0x16')](_0x4a99('0x3c'),NOW)[_0x4a99('0x16')](_0x4a99('0x3d'),selectNotIn(_0x3df343,_0x1c0f4c,_0xa0b7c4,'cm_hopper',[_0x4a99('0x3e'),'\x22onlyIfOpen\x22']))[_0x4a99('0x16')](_0x4a99('0x3d'),selectNotIn(_0x3df343,_0x1c0f4c,_0xa0b7c4,_0x4a99('0x30'),[_0x4a99('0x3e')])))['toString']();return _0x2ccb99;}function insertTzCmHopperBlack(_0x3bec05,_0x3c530f,_0x43fa57,_0x456110){var _0x297c3c=[_0x4a99('0x41'),_0x4a99('0x29'),_0x4a99('0x2a'),_0x3c530f+'.'+_0x456110,_0x4a99('0x42'),_0x4a99('0x2b')];return squel[_0x4a99('0x2e')]()['into'](_0x4a99('0x43'))['fromQuery']([_0x4a99('0x12'),_0x4a99('0x32'),_0x4a99('0x44'),_0x456110,'createdAt',_0x4a99('0x34')],squel[_0x4a99('0x10')]()[_0x4a99('0x37')](_0x297c3c)[_0x4a99('0x13')](_0x3c530f)[_0x4a99('0x14')](_0x4a99('0x38'),null,_0x4a99('0x39')+_0x3c530f+_0x4a99('0x3a'))[_0x4a99('0x14')](_0x43fa57,null,_0x43fa57+_0x4a99('0x15')+_0x3c530f+'.'+_0x456110)[_0x4a99('0x16')](_0x3c530f+_0x4a99('0x3b'),_0x3bec05)[_0x4a99('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4a99('0x16')](_0x4a99('0x3d'),squel[_0x4a99('0x10')]()[_0x4a99('0x11')](_0x4a99('0x12'))[_0x4a99('0x13')](_0x4a99('0x43'))[_0x4a99('0x16')](_0x4a99('0x45'),_0x3bec05)['where'](_0x456110+'\x20=\x20'+_0x3c530f+'.'+_0x456110)))[_0x4a99('0x40')]();}function insertCmHopperAdditionalPhones(_0x4f75a1){var _0x576d2e=[_0x4a99('0x4a'),_0x4a99('0x4b'),_0x4a99('0x4c'),'cm_contact_has_items.createdAt',_0x4a99('0x4d')];return squel[_0x4a99('0x2e')]()[_0x4a99('0x2f')](_0x4a99('0x4e'))[_0x4a99('0x31')](['CmHopperId',_0x4a99('0x12'),_0x4a99('0x4f'),'createdAt','updatedAt'],squel[_0x4a99('0x10')]()[_0x4a99('0x37')](_0x576d2e)[_0x4a99('0x13')](_0x4a99('0x30'))[_0x4a99('0x14')](_0x4a99('0x38'),null,_0x4a99('0x50'))['join']('cm_contact_has_items',null,_0x4a99('0x51'))[_0x4a99('0x16')]('cm_hopper.ListId\x20=\x20?',_0x4f75a1)[_0x4a99('0x16')](_0x4a99('0x3c'),NOW))[_0x4a99('0x40')]();}function insertCmContact(_0x26e4f3,_0x489dce,_0x58de91,_0x4e2452){var _0x590ae3=_[_0x4a99('0x52')](_[_0x4a99('0x53')](_0x4e2452),[_0x4a99('0x44'),_0x4a99('0x54'),'createdAt',_0x4a99('0x34')]);return squel[_0x4a99('0x2e')]()['into'](_0x4a99('0x38'))[_0x4a99('0x31')](_0x590ae3,squel['select']()[_0x4a99('0x37')](_0x590ae3)['from'](_0x489dce)[_0x4a99('0x16')]('('+_0x58de91[_0x4a99('0x14')](',')+_0x4a99('0x55'),squel['select']()[_0x4a99('0x37')](_0x58de91)['from'](_0x4a99('0x38'))[_0x4a99('0x16')](_0x4a99('0x45'),_0x26e4f3)[_0x4a99('0x16')](_0x4a99('0x56')))[_0x4a99('0x16')](_0x4a99('0x57'),squel['select']()[_0x4a99('0x11')](_0x4a99('0x58'),_0x4a99('0x59'))[_0x4a99('0x13')](_0x489dce)[_0x4a99('0x5a')](_0x58de91[_0x4a99('0x14')](','))))[_0x4a99('0x40')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x132e57){logger[_0x4a99('0x5b')](_0x132e57[_0x4a99('0x5c')]);process['exit'](0x1);}function handleError(_0x3145d0,_0x35ff5e){stats[_0x4a99('0x5d')]['push']({'name':_0x35ff5e[_0x4a99('0x5e')],'message':_0x35ff5e['message'],'row':_0x3145d0});}function handleQuery(_0x4e0a15){logger[_0x4a99('0x5f')](_0x4e0a15);return db[_0x4a99('0x60')][_0x4a99('0x61')](_0x4e0a15)[_0x4a99('0x62')](function(_0x499902){results['push'](_0x499902);})[_0x4a99('0x63')](function(_0x288c5f){logger['error'](_0x288c5f['message']);});}function updateTzCampaigns(_0x522c20){return new Promise(function(_0x55c150,_0x9d370d){var _0x4e9267=squel['select']()[_0x4a99('0x37')]([_0x4a99('0x64'),_0x4a99('0x65')])[_0x4a99('0x13')](_0x4a99('0x66'))[_0x4a99('0x14')](_0x4a99('0x67'),null,_0x4a99('0x68'))[_0x4a99('0x16')](_0x4a99('0x69')+_0x522c20);db[_0x4a99('0x60')]['query'](_0x4e9267[_0x4a99('0x40')]())[_0x4a99('0x62')](function(_0x41520f){var _0x4c3fae=[];for(var _0x3cf0f7=0x0;_0x3cf0f7<_0x41520f['length'];_0x3cf0f7++){_0x4c3fae[_0x4a99('0x1d')](getTimezoneData(_0x41520f[_0x3cf0f7],tmp_campaigns));}BPromise[_0x4a99('0x1e')](_0x4c3fae)['then'](function(){_0x55c150({'val':0x1});});})[_0x4a99('0x63')](function(_0x1a63fe){logger[_0x4a99('0x5b')](_0x1a63fe[_0x4a99('0x5c')]);_0x55c150({'val':0x0});});});}function updateTzVoiceQueues(_0x715809){return new Promise(function(_0x4fdbbd,_0x1bf752){var _0x51d33a=squel[_0x4a99('0x10')]()['fields']([_0x4a99('0x6a'),_0x4a99('0x6b')])[_0x4a99('0x13')]('voice_queues')[_0x4a99('0x14')](_0x4a99('0x6c'),null,_0x4a99('0x6d'))['where'](_0x4a99('0x6e')+_0x715809);db['sequelize'][_0x4a99('0x61')](_0x51d33a['toString']())[_0x4a99('0x62')](function(_0x239080){var _0x5a9237=[];for(var _0x374b6d=0x0;_0x374b6d<_0x239080[_0x4a99('0x1f')];_0x374b6d++){_0x5a9237[_0x4a99('0x1d')](getTimezoneData(_0x239080[_0x374b6d],tmp_voice_queues));}BPromise['all'](_0x5a9237)[_0x4a99('0x1c')](function(){_0x4fdbbd({'val':0x1});});})[_0x4a99('0x63')](function(_0x50f0d3){logger[_0x4a99('0x5b')](_0x50f0d3[_0x4a99('0x5c')]);_0x4fdbbd({'val':0x0});});});}function getTimezoneData(_0x4c7632,_0x1ea4fb){return new Promise(function(_0xb5e819,_0x4b407b){var _0x5ea9c6=shared[_0x4a99('0x6f')];var _0xaf9936=_0x5ea9c6[_0x4c7632[_0x4a99('0x70')]];if(_[_0x4a99('0x71')](_0xaf9936)){_0xb5e819({'ret':0x1});}else{var _0x5ababa=_0xaf9936['utcOffset'];var _0x5b02a8=squel[_0x4a99('0x2e')]()[_0x4a99('0x2f')](_0x1ea4fb)['set']('id',_0x4c7632['id'])[_0x4a99('0x72')](_0x4a99('0x73'),_0x5ababa)[_0x4a99('0x72')]('dialTimezone',_0x4c7632[_0x4a99('0x70')])[_0x4a99('0x40')]();return db['sequelize'][_0x4a99('0x61')](_0x5b02a8)['spread'](function(_0x2673ae){_0xb5e819({'ret':0x1});})[_0x4a99('0x63')](function(_0x281591){logger[_0x4a99('0x5b')](_0x281591[_0x4a99('0x5c')]);_0x4b407b({'ret':0x1});});}});}function handleTZQuery(_0x3627d0){logger[_0x4a99('0x5f')](_0x3627d0);return db[_0x4a99('0x60')][_0x4a99('0x61')](_0x3627d0)['spread'](function(_0x3c8067){})['catch'](function(_0x1ab825){logger[_0x4a99('0x5b')](_0x1ab825['message']);});}function main(_0x429075,_0x13a2ca,_0x51db08,_0x3bbcd3){logger[_0x4a99('0x5f')](_0x4a99('0x74'),_0x429075,JSON[_0x4a99('0x75')](_0x13a2ca));process['send'](_0x4a99('0x76'));var _0x27cf27=_0x13a2ca[_0x4a99('0x77')];var _0x2c94f8=_[_0x4a99('0x78')](_0x27cf27);var _0x1ab022=_0x13a2ca['socket_timestamp'];var _0x2b1bf2=path[_0x4a99('0x14')](config[_0x4a99('0x79')],_0x4a99('0x7a'),_0x1ab022+'.csv');hasTZ=_['keys'](_0x27cf27)[_0x4a99('0x7b')]('dialTimezone');var _0x118264=_['keys'](_0x27cf27)[_0x4a99('0x14')]();logger['info']('header',_0x118264);db[_0x4a99('0x7c')][_0x4a99('0x1a')]({'raw':!![],'attributes':['id',_0x4a99('0x7d')]})[_0x4a99('0x1c')](function(_0x29ebb4){for(var _0x39343c=0x0;_0x39343c<_0x29ebb4[_0x4a99('0x1f')];_0x39343c++){if(_0x29ebb4[_0x39343c][_0x4a99('0x7d')]in _0x27cf27){contactItemTypes[_0x4a99('0x1d')](_0x29ebb4[_0x39343c]);delete _0x2c94f8[_0x29ebb4[_0x39343c][_0x4a99('0x7d')]];hasAdditionalPhones=!![];}for(var _0x3d32f5 in _0x27cf27){if(_0x29ebb4[_0x39343c]['name']+'_description'===_0x3d32f5){phoneDescriptions[_0x4a99('0x1d')]({'itemTypeId':_0x29ebb4[_0x39343c]['id'],'description':_0x3d32f5});delete _0x2c94f8[_0x3d32f5];}}}if(hasAdditionalPhones)_0x2c94f8[_0x4a99('0x1b')]='';var _0x51e1c0=_[_0x4a99('0x53')](_0x2c94f8)[_0x4a99('0x14')]();logger[_0x4a99('0x5f')]('header',_0x51e1c0);fs[_0x4a99('0x7e')](_0x2b1bf2,_0x51e1c0+'\x0a');Papa[_0x4a99('0x7f')](fs[_0x4a99('0x80')](_0x429075),{'header':!![],'skipEmptyLines':!![],'step':function(_0xaa42ef,_0x875a8b){try{for(var _0x16504b=0x0,_0x5ccfeb=[];_0x16504b<_0xaa42ef[_0x4a99('0x81')]['length'];_0x16504b++){stats[_0x4a99('0x82')]+=0x1;if(_0xaa42ef[_0x4a99('0x5d')][_0x16504b]){handleError(_0xaa42ef[_0x4a99('0x81')][_0x16504b],_0xaa42ef[_0x4a99('0x5d')][_0x16504b]);}else{var _0x30658a=[];var _0x14241d=[];var _0x3483a1={};for(var _0x5e257f in _0x27cf27){let _0x2477f3=contactItemTypes[_0x4a99('0x83')](_0xa4d8ff=>_0xa4d8ff[_0x4a99('0x7d')]===_0x5e257f);let _0x3e5e58=contactItemTypes[_0x4a99('0x83')](_0x205d16=>_0x205d16[_0x4a99('0x7d')]+'_description'===_0x5e257f);if(_['isNil'](_0x2477f3)&&_[_0x4a99('0x71')](_0x3e5e58)){if(_0x27cf27[_0x4a99('0x84')](_0x5e257f)){if(_0xaa42ef['data'][_0x16504b][_0x27cf27[_0x5e257f]]){var _0x20f071=_[_0x4a99('0x85')](_0xaa42ef[_0x4a99('0x81')][_0x16504b][_0x27cf27[_0x5e257f]]['replace'](/"/g,'\x27'));switch(_0x5e257f){case _0x4a99('0x48'):var _0x26cc93=moment(_0x20f071,_0x4a99('0xd'),!![]);if(_0x26cc93[_0x4a99('0x86')]()){_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');}else{_0x30658a['push'](_0x4a99('0x87'));}break;case _0x4a99('0x35'):var _0x17cf30=parseInt(_0x20f071);_0x20f071=_[_0x4a99('0x88')](_0x17cf30)||_0x17cf30<0x0||_0x17cf30>0x4?_0x3bbcd3?0x3:0x2:_0x17cf30;_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');break;case _0x4a99('0x36'):var _0x257674=parseInt(_0x20f071);if(_['isNumber'](_0x257674)&&_[_0x4a99('0x7b')](_0x51db08,_0x257674)){_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x257674+'\x22');}else{_0x30658a[_0x4a99('0x1d')](_0x4a99('0x89'));}break;case _0x4a99('0x8a'):if(isEmail(_0x20f071)){_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');}else{_0x30658a[_0x4a99('0x1d')](_0x4a99('0x8b'));}break;case _0x4a99('0x8c'):var _0x3711d8=moment(_0x20f071,_0x4a99('0x8d'),!![]);if(_0x3711d8[_0x4a99('0x86')]()){_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');}else{_0x30658a[_0x4a99('0x1d')](_0x4a99('0x8e'));}break;case _0x4a99('0x70'):var _0xd56694=shared[_0x4a99('0x6f')];var _0x1d138d=_0xd56694[_0x20f071];if(!_[_0x4a99('0x71')](_0x1d138d)){var _0x3eb499=_0x1d138d[_0x4a99('0x8f')];_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x3eb499+'\x22');}break;default:_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x20f071+'\x22');}}else{switch(_0x5e257f){case'firstName':case _0x4a99('0x12'):_0x30658a[_0x4a99('0x1d')](_0x5e257f+'\x20not\x20specified');break;default:_0x5ccfeb[_0x4a99('0x1d')]('\x22\x22');}}}}else{var _0x24db09='';if(!_['isNil'](_0x2477f3)){if(!_0x3483a1['hasOwnProperty'](_0x2477f3['id'])){if(!_[_0x4a99('0x71')](_0xaa42ef[_0x4a99('0x81')][_0x16504b][_0x27cf27[_0x5e257f]])){var _0x20f071=_['trim'](_0xaa42ef[_0x4a99('0x81')][_0x16504b][_0x27cf27[_0x5e257f]]['replace'](/"/g,'\x27'));var _0x41a0b0=phoneDescriptions['find'](_0xb1b4f3=>_0xb1b4f3[_0x4a99('0x90')]===_0x2477f3['id']);if(!_[_0x4a99('0x71')](_0x41a0b0)){var _0x1bac85=_[_0x4a99('0x85')](_0xaa42ef[_0x4a99('0x81')][_0x16504b][_0x27cf27[_0x41a0b0[_0x4a99('0x91')]]][_0x4a99('0x92')](/"/g,'\x27'));if(!_[_0x4a99('0x71')](_0x1bac85))_0x20f071=_0x20f071+'§'+_0x1bac85;}if(_0x24db09=='')_0x24db09=_0x20f071;else _0x24db09+='|'+_0x20f071;}_0x14241d[_0x4a99('0x1d')](_0x2477f3['id']+':'+_0x24db09);_0x3483a1[_0x2477f3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5ccfeb[_0x4a99('0x1d')]('\x22'+_0x14241d[_0x4a99('0x14')](';')+'\x22');}if(_0x30658a['length']){handleError(_0xaa42ef[_0x4a99('0x81')][_0x16504b],{'code':_0x4a99('0x93'),'message':_0x30658a[_0x4a99('0x14')]()});}else{fs[_0x4a99('0x94')](_0x2b1bf2,_0x5ccfeb[_0x4a99('0x14')]()+'\x0a');}_0x5ccfeb=[];}if(!(stats[_0x4a99('0x82')]%0xc8)){socket[_0x4a99('0x95')]('contact:import:'+_0x1ab022,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x875a8b[_0x4a99('0x96')]();}}catch(_0x5e611e){handleError(_0xaa42ef[_0x4a99('0x81')][_0x16504b],{'code':_0x4a99('0x97'),'message':_0x5e611e[_0x4a99('0x5c')]});logger[_0x4a99('0x5b')](_0x4a99('0x98'),_0x5e611e[_0x4a99('0x5c')]);}},'complete':function(){try{var _0x26f3e4=[];var _0x5e21db=[];var _0x55e270=_0x4a99('0x38');if(_0x13a2ca[_0x4a99('0x99')]&&_0x13a2ca[_0x4a99('0x99')][_0x4a99('0x1f')]){_0x55e270=_0x4a99('0x9a')+_0x1ab022;_0x26f3e4['push'](_0x4a99('0x9b')+_0x55e270+_0x4a99('0x9c'));}tmp_campaigns=_0x4a99('0x9d')+_0x1ab022;tmp_voice_queues=_0x4a99('0x9e')+_0x1ab022;_0x5e21db[_0x4a99('0x1d')](_0x4a99('0x9b')+tmp_campaigns+_0x4a99('0x9f'));_0x5e21db['push'](_0x4a99('0x9b')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x4a99('0xa0')](_0x5e21db,handleTZQuery)[_0x4a99('0x1c')](function(_0x3af86d){updateTzCampaigns(_0x13a2ca[_0x4a99('0x44')])[_0x4a99('0x1c')](function(_0x36e0a2){updateTzVoiceQueues(_0x13a2ca['ListId'])[_0x4a99('0x1c')](function(_0x5f4abd){if(hasTZ)_0x51e1c0=_0x51e1c0[_0x4a99('0x92')](_0x4a99('0x70'),_0x4a99('0xa1'));var _0x3deed2=util[_0x4a99('0xe')](_0x4a99('0xa2'),_0x2b1bf2,_0x55e270,_0x51e1c0,_0x13a2ca[_0x4a99('0x44')],_0x13a2ca['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x27cf27[_0x4a99('0x48')])){_0x3deed2+=_0x4a99('0xa3');}_0x26f3e4['push'](_0x3deed2);if(_0x13a2ca[_0x4a99('0x99')]&&_0x13a2ca[_0x4a99('0x99')][_0x4a99('0x1f')]){_0x26f3e4[_0x4a99('0x1d')](insertCmContact(_0x13a2ca[_0x4a99('0x44')],_0x55e270,_0x13a2ca[_0x4a99('0x99')],_0x27cf27));_0x26f3e4[_0x4a99('0x1d')](_0x4a99('0xa4')+_0x55e270+';');}BPromise[_0x4a99('0xa0')](_0x26f3e4,handleQuery)[_0x4a99('0x1c')](function(_0x21f368){BPromise[_0x4a99('0x1e')]([handleAdditionalPhones()])[_0x4a99('0x1c')](function(){_0x26f3e4=[];for(var _0x370ec7=0x0;_0x370ec7<promisesAdditionalPhones[_0x4a99('0x1f')];_0x370ec7++){if(promisesAdditionalPhones[_0x370ec7][_0x4a99('0x12')]!='§'){_0x26f3e4[_0x4a99('0x1d')](createAdditionalPhone(promisesAdditionalPhones[_0x370ec7][_0x4a99('0xa5')],promisesAdditionalPhones[_0x370ec7][_0x4a99('0xa6')],promisesAdditionalPhones[_0x370ec7][_0x4a99('0x12')],promisesAdditionalPhones[_0x370ec7][_0x4a99('0xa7')]));}}BPromise['all'](_0x26f3e4)[_0x4a99('0x1c')](function(){_0x26f3e4=[];if(hasTZ){_0x26f3e4['push'](insertTzCmHopper(_0x13a2ca['ListId'],_0x4a99('0x6c'),_0x4a99('0xa8'),'VoiceQueueId',_0x3bbcd3,tmp_voice_queues));_0x26f3e4['push'](insertTzCmHopperBlack(_0x13a2ca[_0x4a99('0x44')],_0x4a99('0xa9'),_0x4a99('0xa8'),_0x4a99('0xaa')));_0x26f3e4[_0x4a99('0x1d')](insertTzCmHopper(_0x13a2ca['ListId'],_0x4a99('0x67'),_0x4a99('0x66'),_0x4a99('0xab'),_0x3bbcd3,tmp_campaigns));_0x26f3e4[_0x4a99('0x1d')](insertTzCmHopperBlack(_0x13a2ca[_0x4a99('0x44')],'campaigns_has_cm_blacklists',_0x4a99('0x66'),_0x4a99('0xab')));_0x26f3e4[_0x4a99('0x1d')](insertCmHopperAdditionalPhones(_0x13a2ca[_0x4a99('0x44')]));}else{_0x26f3e4[_0x4a99('0x1d')](insertCmHopper(_0x13a2ca[_0x4a99('0x44')],'voice_queues_has_cm_lists','voice_queues',_0x4a99('0xaa'),_0x3bbcd3));_0x26f3e4[_0x4a99('0x1d')](insertCmHopperBlack(_0x13a2ca[_0x4a99('0x44')],_0x4a99('0xa9'),_0x4a99('0xa8'),_0x4a99('0xaa')));_0x26f3e4[_0x4a99('0x1d')](insertCmHopper(_0x13a2ca[_0x4a99('0x44')],_0x4a99('0x67'),_0x4a99('0x66'),_0x4a99('0xab'),_0x3bbcd3));_0x26f3e4['push'](insertCmHopperBlack(_0x13a2ca[_0x4a99('0x44')],_0x4a99('0xac'),_0x4a99('0x66'),'CampaignId'));_0x26f3e4['push'](insertCmHopperAdditionalPhones(_0x13a2ca[_0x4a99('0x44')]));}_0x26f3e4[_0x4a99('0x1d')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x26f3e4[_0x4a99('0x1d')](_0x4a99('0xa4')+tmp_voice_queues+';');BPromise['each'](_0x26f3e4,handleQuery)[_0x4a99('0x1c')](function(_0xb29247){stats[_0x4a99('0xad')]=!![];stats[_0x4a99('0xae')]=_0x13a2ca[_0x4a99('0x99')]&&_0x13a2ca['duplicates'][_0x4a99('0x1f')]?results[0x2]['affectedRows']:results[0x0][_0x4a99('0xae')];socket['emit'](_0x4a99('0xaf')+_0x1ab022,stats);fs[_0x4a99('0xb0')](_0x429075);fs[_0x4a99('0xb0')](_0x2b1bf2);process['exit'](0x0);})[_0x4a99('0x63')](function(_0x3345b9){logger['error'](_0x3345b9[_0x4a99('0x5c')]);process[_0x4a99('0xb1')](0x1);});});});})[_0x4a99('0x63')](function(_0x19ab9c){logger[_0x4a99('0x5b')](_0x19ab9c['message']);process[_0x4a99('0xb1')](0x1);});});});});}catch(_0x1bd917){logger[_0x4a99('0x5b')](_0x4a99('0xb2'),_0x1bd917[_0x4a99('0x5c')]);process[_0x4a99('0xb1')](0x1);}},'error':function(_0x2fee67,_0x41533e,_0x179582,_0x53e0dd){throw new Error(_0x53e0dd);}});});}function validate(){if(process[_0x4a99('0xb3')]&&process[_0x4a99('0xb3')][_0x4a99('0x1f')]<0x4){throw new Error(_0x4a99('0xb4'));}var _0x5d11b5=path['join'](config['root'],'server/files/tmp',process[_0x4a99('0xb3')][0x2]);if(!fs[_0x4a99('0xb5')](_0x5d11b5)){throw new Error(_0x4a99('0xb6'));}var _0x4dbbc7={};try{_0x4dbbc7=JSON[_0x4a99('0x7f')](process[_0x4a99('0xb3')][0x3]);if(!_0x4dbbc7[_0x4a99('0x77')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x4dbbc7['binding'][_0x4a99('0x12')]){throw new Error(_0x4a99('0xb7'));}if(!_0x4dbbc7[_0x4a99('0x77')][_0x4a99('0xb8')]){throw new Error('firstName\x20is\x20mandatory');}var _0x1f0631=0x0;if(_0x4dbbc7[_0x4a99('0x77')][_0x4a99('0x36')]){_0x1f0631=0x1;}if(!_0x4dbbc7[_0x4a99('0x44')]){throw new Error(_0x4a99('0xb9'));}}catch(_0x19576b){throw new Error('body\x20id\x20mandatory');}var _0x295da0=[];try{_0x295da0=_[_0x4a99('0xba')](JSON[_0x4a99('0x7f')](process[_0x4a99('0xb3')][0x4]),'id');}catch(_0x371484){logger['info']('No\x20agent\x20available');}main(_0x5d11b5,_0x4dbbc7,_0x295da0,_0x1f0631);}validate();process['on'](_0x4a99('0xbb'),handleStop);process['on'](_0x4a99('0xbc'),handleUncaughtException);
\ No newline at end of file
+var _0x1826=['description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','filter','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','insert','cm_hopper_black','createdAt','updatedAt','cm_contacts','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','.CmListId','ListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','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','timezones','dialTimezone','isNil','utcOffset','set','sequelize','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','includes','ContactItemType','name','_description','header','parse','createReadStream','rows','errors','data','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x1826,0x192));var _0x6182=function(_0x1b3f52,_0x4f5b13){_0x1b3f52=_0x1b3f52-0x0;var _0x36bf2c=_0x1826[_0x1b3f52];return _0x36bf2c;};'use strict';var fs=require('fs');var path=require(_0x6182('0x0'));var _=require(_0x6182('0x1'));var Papa=require(_0x6182('0x2'));var util=require(_0x6182('0x3'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x6182('0x4'));var Redis=require(_0x6182('0x5'));var db=require(_0x6182('0x6'))['db'];var config=require(_0x6182('0x7'));var shared=require(_0x6182('0x8'));var logger=require(_0x6182('0x9'))(_0x6182('0xa'));config['redis']=_[_0x6182('0xb')](config['redis'],{'host':_0x6182('0xc'),'port':0x18eb});var socket=require(_0x6182('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6182('0xe')](_0x6182('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x6182('0xf'));function isEmail(_0x2e46bd){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))*$/[_0x6182('0x10')](_0x2e46bd);}function selectNotIn(_0x29fea6,_0x4feebc,_0x40045d,_0x150705,_0x3c398f){return squel[_0x6182('0x11')]()[_0x6182('0x12')](_0x6182('0x13'))[_0x6182('0x14')](_0x150705)[_0x6182('0x15')](_0x4feebc,null,_0x4feebc+_0x6182('0x16')+_0x150705+'.'+_0x40045d)['where'](_0x150705+'.'+_0x40045d+_0x6182('0x17')+_0x29fea6+'.'+_0x40045d)[_0x6182('0x18')](_0x4feebc+_0x6182('0x19')+_0x3c398f[_0x6182('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x244486,_0x32cd7e){promisesAdditionalPhones=[];return db[_0x6182('0x1a')][_0x6182('0x1b')]({'raw':!![],'attributes':['id',_0x6182('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6182('0x1d')](function(_0x34a7ba){if(_0x34a7ba!==null){var _0x2b9cf4=[];for(var _0x54aa3e=0x0;_0x54aa3e<_0x34a7ba[_0x6182('0x1e')];_0x54aa3e++){var _0x308fbd=_0x34a7ba[_0x54aa3e];_0x2b9cf4[_0x6182('0x1f')](insertAdditionalPhones(_0x308fbd));}}Promise[_0x6182('0x20')](_0x2b9cf4)[_0x6182('0x1d')](function(){_0x244486({'val':0x1});});});});}function insertAdditionalPhones(_0x1af2d5){return new Promise(function(_0x96515,_0xeee50b){var _0x1cbe4e=_0x1af2d5[_0x6182('0x1c')];var _0x1e5665=_0x1cbe4e[_0x6182('0x21')](';');var _0x477f06=[];orderBy=0x0;for(var _0x59cb65=0x0;_0x59cb65<_0x1e5665[_0x6182('0x1e')];_0x59cb65++){_0x477f06[_0x6182('0x1f')](splitAdditionalPhone(_0x1af2d5['id'],_0x1e5665[_0x59cb65]));}Promise[_0x6182('0x20')](_0x477f06)[_0x6182('0x1d')](function(){_0x96515({'val':_0x1e5665[_0x6182('0x1e')]});});});}function splitAdditionalPhone(_0x46bdbb,_0x1fdd23){return new Promise(function(_0x451c5b,_0x44b577){var _0xa7347e=_0x1fdd23[_0x6182('0x21')](':');var _0x2eef2a=_0xa7347e[0x0];var _0xc8acaa=_0xa7347e[0x1];if(!_['isNil'](_0xc8acaa)){var _0x3c084f=_0xc8acaa['split']('|');var _0x45b957=[];for(var _0x1bf89d=0x0;_0x1bf89d<_0x3c084f[_0x6182('0x1e')];_0x1bf89d++){if(_0x3c084f[_0x1bf89d]!==''){var _0x4be242=_[_0x6182('0x22')](promisesAdditionalPhones,{'contactId':_0x46bdbb,'phone':_0x3c084f[_0x1bf89d]});if(_0x4be242[_0x6182('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x6182('0x1f')]({'contactId':_0x46bdbb,'contactTypeId':_0x2eef2a,'phone':_0x3c084f[_0x1bf89d],'orderBy':orderBy});}}}_0x451c5b({'ok':0x1});}else _0x451c5b({'res':0x0});});}function createAdditionalPhone(_0x552d1e,_0x454a1d,_0xc8c24,_0x334f1b){var _0x276adc='';var _0x505413='';var _0x59027e=_0xc8c24[_0x6182('0x21')]('§');_0x276adc=_0x59027e[0x0];if(_0x59027e[_0x6182('0x1e')]==0x2)_0x505413=_0x59027e[0x1];return new Promise(function(_0x3a0b8e,_0x45ee87){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x552d1e,'item':_0x276adc}})[_0x6182('0x1d')](function(_0x42dd36){if(_0x42dd36){return db['CmContactHasItem']['update']({'ItemTypeId':_0x454a1d,'description':_0x505413,'OrderBy':_0x334f1b},{'where':{'CmContactId':_0x552d1e,'item':_0x276adc}})[_0x6182('0x1d')](function(_0x11dd21){_0x3a0b8e({'res':_0x6182('0x23')});});}else{return db['CmContactHasItem'][_0x6182('0x24')]({'CmContactId':_0x552d1e,'item':_0x276adc,'description':_0x505413,'ItemTypeId':_0x454a1d,'OrderBy':_0x334f1b,'ItemClass':_0x6182('0x25')})['then'](function(_0x111dae){_0x3a0b8e({'res':'inserted'});});}});});}function insertCmHopper(_0x45a064,_0x2e0c7d,_0x34dfa1,_0x560c22,_0x1ea867){var _0x531d24=[_0x6182('0x26'),_0x6182('0x27'),_0x6182('0x28'),_0x6182('0x29'),_0x2e0c7d+'.'+_0x560c22,_0x6182('0x2a'),_0x6182('0x2b'),'cm_contacts.priority',_0x6182('0x2c'),'\x22'+_0x1ea867+'\x22'];return squel['insert']()[_0x6182('0x2d')](_0x6182('0x2e'))[_0x6182('0x2f')]([_0x6182('0x13'),_0x6182('0x30'),_0x6182('0x31'),_0x6182('0x32'),_0x560c22,'createdAt','updatedAt',_0x6182('0x33'),_0x6182('0x34'),_0x6182('0x35')],squel['select']()[_0x6182('0x36')](_0x531d24)[_0x6182('0x14')](_0x2e0c7d)[_0x6182('0x15')]('cm_contacts',null,_0x6182('0x37')+_0x2e0c7d+'.CmListId')['join'](_0x34dfa1,null,_0x34dfa1+'.id\x20=\x20'+_0x2e0c7d+'.'+_0x560c22)[_0x6182('0x18')](_0x2e0c7d+_0x6182('0x38'),_0x45a064)[_0x6182('0x18')](_0x6182('0x39'),NOW)[_0x6182('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e0c7d,_0x34dfa1,_0x560c22,'cm_hopper',[_0x6182('0x3a'),_0x6182('0x3b')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e0c7d,_0x34dfa1,_0x560c22,_0x6182('0x2e'),[_0x6182('0x3a')])))['toString']();}function insertCmHopperBlack(_0x465eae,_0x5aff0d,_0x1e0051,_0x4f70c2){var _0x2870af=[_0x6182('0x26'),_0x6182('0x28'),_0x6182('0x29'),_0x5aff0d+'.'+_0x4f70c2,_0x6182('0x2a'),_0x6182('0x2b')];return squel[_0x6182('0x3c')]()[_0x6182('0x2d')](_0x6182('0x3d'))['fromQuery']([_0x6182('0x13'),_0x6182('0x31'),'ListId',_0x4f70c2,_0x6182('0x3e'),_0x6182('0x3f')],squel[_0x6182('0x11')]()[_0x6182('0x36')](_0x2870af)[_0x6182('0x14')](_0x5aff0d)[_0x6182('0x15')](_0x6182('0x40'),null,_0x6182('0x37')+_0x5aff0d+'.CmListId')[_0x6182('0x15')](_0x1e0051,null,_0x1e0051+'.id\x20=\x20'+_0x5aff0d+'.'+_0x4f70c2)[_0x6182('0x18')](_0x5aff0d+_0x6182('0x38'),_0x465eae)[_0x6182('0x18')](_0x6182('0x39'),NOW)['where'](_0x6182('0x41'),squel['select']()[_0x6182('0x12')](_0x6182('0x13'))['from'](_0x6182('0x3d'))[_0x6182('0x18')]('ListId\x20=\x20?',_0x465eae)['where'](_0x4f70c2+'\x20=\x20'+_0x5aff0d+'.'+_0x4f70c2)))[_0x6182('0x42')]();}function insertTzCmHopper(_0x3ab277,_0x578ea7,_0xd33161,_0x197671,_0x3f67ae,_0x119efe){var _0xe63a2=[_0x6182('0x26'),_0x6182('0x43')+_0x119efe+_0x6182('0x44'),_0x6182('0x28'),'cm_contacts.ListId',_0x578ea7+'.'+_0x197671,_0x6182('0x2a'),_0x6182('0x2b'),_0x6182('0x45'),_0x6182('0x2c'),'\x22'+_0x3f67ae+'\x22'];var _0x8a4db7=squel[_0x6182('0x3c')]()[_0x6182('0x2d')]('cm_hopper')['fromQuery']([_0x6182('0x13'),_0x6182('0x30'),_0x6182('0x31'),_0x6182('0x32'),_0x197671,_0x6182('0x3e'),_0x6182('0x3f'),'priority',_0x6182('0x34'),_0x6182('0x35')],squel['select']()[_0x6182('0x36')](_0xe63a2)['from'](_0x578ea7)[_0x6182('0x15')]('cm_contacts',null,_0x6182('0x37')+_0x578ea7+_0x6182('0x46'))[_0x6182('0x15')](_0xd33161,null,_0xd33161+'.id\x20=\x20'+_0x578ea7+'.'+_0x197671)[_0x6182('0x15')](_0x119efe,null,_0x119efe+_0x6182('0x16')+_0x578ea7+'.'+_0x197671)[_0x6182('0x18')](_0x578ea7+_0x6182('0x38'),_0x3ab277)[_0x6182('0x18')](_0x6182('0x39'),NOW)[_0x6182('0x18')](_0x6182('0x41'),selectNotIn(_0x578ea7,_0xd33161,_0x197671,'cm_hopper',[_0x6182('0x3a'),_0x6182('0x3b')]))[_0x6182('0x18')](_0x6182('0x41'),selectNotIn(_0x578ea7,_0xd33161,_0x197671,_0x6182('0x2e'),[_0x6182('0x3a')])))[_0x6182('0x42')]();return _0x8a4db7;}function insertTzCmHopperBlack(_0x34dff5,_0x17c8f0,_0x3dc36c,_0x20642c){var _0x3d5b7a=['cm_contacts.phone',_0x6182('0x28'),'cm_contacts.ListId',_0x17c8f0+'.'+_0x20642c,_0x6182('0x2a'),_0x6182('0x2b')];return squel[_0x6182('0x3c')]()[_0x6182('0x2d')]('cm_hopper_black')[_0x6182('0x2f')](['phone',_0x6182('0x31'),_0x6182('0x32'),_0x20642c,'createdAt',_0x6182('0x3f')],squel[_0x6182('0x11')]()[_0x6182('0x36')](_0x3d5b7a)['from'](_0x17c8f0)[_0x6182('0x15')]('cm_contacts',null,_0x6182('0x37')+_0x17c8f0+_0x6182('0x46'))[_0x6182('0x15')](_0x3dc36c,null,_0x3dc36c+'.id\x20=\x20'+_0x17c8f0+'.'+_0x20642c)[_0x6182('0x18')](_0x17c8f0+_0x6182('0x38'),_0x34dff5)[_0x6182('0x18')](_0x6182('0x39'),NOW)[_0x6182('0x18')](_0x6182('0x41'),squel[_0x6182('0x11')]()[_0x6182('0x12')]('phone')['from'](_0x6182('0x3d'))[_0x6182('0x18')](_0x6182('0x47'),_0x34dff5)[_0x6182('0x18')](_0x20642c+'\x20=\x20'+_0x17c8f0+'.'+_0x20642c)))[_0x6182('0x42')]();}function insertCmHopperAdditionalPhones(_0x2cfec0){var _0x54d10a=['cm_hopper.id',_0x6182('0x48'),_0x6182('0x49'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0x6182('0x3c')]()[_0x6182('0x2d')](_0x6182('0x4a'))[_0x6182('0x2f')]([_0x6182('0x4b'),'phone',_0x6182('0x4c'),_0x6182('0x3e'),_0x6182('0x3f')],squel['select']()['fields'](_0x54d10a)['from'](_0x6182('0x2e'))[_0x6182('0x15')](_0x6182('0x40'),null,_0x6182('0x4d'))[_0x6182('0x15')](_0x6182('0x4e'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x6182('0x18')]('cm_hopper.ListId\x20=\x20?',_0x2cfec0)[_0x6182('0x18')](_0x6182('0x39'),NOW))[_0x6182('0x42')]();}function insertCmContact(_0x13bb8e,_0x3e3828,_0x4948f5,_0x5a4f8b){var _0x4f1a25=_[_0x6182('0x4f')](_[_0x6182('0x50')](_0x5a4f8b),[_0x6182('0x32'),_0x6182('0x51'),_0x6182('0x3e'),'updatedAt']);return squel[_0x6182('0x3c')]()[_0x6182('0x2d')](_0x6182('0x40'))['fromQuery'](_0x4f1a25,squel[_0x6182('0x11')]()[_0x6182('0x36')](_0x4f1a25)[_0x6182('0x14')](_0x3e3828)[_0x6182('0x18')]('('+_0x4948f5[_0x6182('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0x6182('0x11')]()[_0x6182('0x36')](_0x4948f5)[_0x6182('0x14')]('cm_contacts')[_0x6182('0x18')](_0x6182('0x47'),_0x13bb8e)[_0x6182('0x18')](_0x6182('0x52')))[_0x6182('0x18')](_0x6182('0x53'),squel['select']()[_0x6182('0x12')](_0x6182('0x54'),_0x6182('0x55'))[_0x6182('0x14')](_0x3e3828)['group'](_0x4948f5[_0x6182('0x15')](','))))[_0x6182('0x42')]();}function handleStop(){logger[_0x6182('0x56')](_0x6182('0x57'));stopped=!![];}function handleUncaughtException(_0x46701d){logger[_0x6182('0x58')](_0x46701d[_0x6182('0x59')]);process[_0x6182('0x5a')](0x1);}function handleError(_0x277990,_0x101dd5){stats['errors'][_0x6182('0x1f')]({'name':_0x101dd5[_0x6182('0x5b')],'message':_0x101dd5[_0x6182('0x59')],'row':_0x277990});}function handleQuery(_0x32c094){logger[_0x6182('0x56')](_0x32c094);return db['sequelize'][_0x6182('0x5c')](_0x32c094)[_0x6182('0x5d')](function(_0x51bc59){results[_0x6182('0x1f')](_0x51bc59);})[_0x6182('0x5e')](function(_0x3747cc){logger[_0x6182('0x58')](_0x3747cc[_0x6182('0x59')]);});}function updateTzCampaigns(_0x36d0e3){return new Promise(function(_0x11973c,_0x2cd92a){var _0x2c31f3=squel[_0x6182('0x11')]()['fields']([_0x6182('0x5f'),_0x6182('0x60')])[_0x6182('0x14')](_0x6182('0x61'))[_0x6182('0x15')](_0x6182('0x62'),null,_0x6182('0x63'))[_0x6182('0x18')](_0x6182('0x64')+_0x36d0e3);db['sequelize'][_0x6182('0x5c')](_0x2c31f3[_0x6182('0x42')]())[_0x6182('0x5d')](function(_0x3114d9){var _0x121d15=[];for(var _0xc84b=0x0;_0xc84b<_0x3114d9[_0x6182('0x1e')];_0xc84b++){_0x121d15[_0x6182('0x1f')](getTimezoneData(_0x3114d9[_0xc84b],tmp_campaigns));}BPromise['all'](_0x121d15)[_0x6182('0x1d')](function(){_0x11973c({'val':0x1});});})[_0x6182('0x5e')](function(_0x13791f){logger[_0x6182('0x58')](_0x13791f[_0x6182('0x59')]);_0x11973c({'val':0x0});});});}function updateTzVoiceQueues(_0x4b7ff5){return new Promise(function(_0x18ca02,_0x3c50c6){var _0x298073=squel[_0x6182('0x11')]()[_0x6182('0x36')]([_0x6182('0x65'),_0x6182('0x66')])[_0x6182('0x14')](_0x6182('0x67'))[_0x6182('0x15')](_0x6182('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where']('voice_queues_has_cm_lists.CmListId='+_0x4b7ff5);db['sequelize'][_0x6182('0x5c')](_0x298073['toString']())[_0x6182('0x5d')](function(_0x2f88c2){var _0x36da97=[];for(var _0x2b14ec=0x0;_0x2b14ec<_0x2f88c2[_0x6182('0x1e')];_0x2b14ec++){_0x36da97[_0x6182('0x1f')](getTimezoneData(_0x2f88c2[_0x2b14ec],tmp_voice_queues));}BPromise[_0x6182('0x20')](_0x36da97)[_0x6182('0x1d')](function(){_0x18ca02({'val':0x1});});})[_0x6182('0x5e')](function(_0x2a5814){logger[_0x6182('0x58')](_0x2a5814[_0x6182('0x59')]);_0x18ca02({'val':0x0});});});}function getTimezoneData(_0x347a1c,_0x1105dc){return new Promise(function(_0x403b13,_0x405d15){var _0x2c38c9=shared[_0x6182('0x69')];var _0x6785f1=_0x2c38c9[_0x347a1c[_0x6182('0x6a')]];if(_[_0x6182('0x6b')](_0x6785f1)){_0x403b13({'ret':0x1});}else{var _0x2ab7d5=_0x6785f1[_0x6182('0x6c')];var _0x33a610=squel[_0x6182('0x3c')]()[_0x6182('0x2d')](_0x1105dc)[_0x6182('0x6d')]('id',_0x347a1c['id'])['set']('offset',_0x2ab7d5)[_0x6182('0x6d')](_0x6182('0x6a'),_0x347a1c[_0x6182('0x6a')])['toString']();return db[_0x6182('0x6e')]['query'](_0x33a610)[_0x6182('0x5d')](function(_0x413612){_0x403b13({'ret':0x1});})[_0x6182('0x5e')](function(_0x49dba4){logger[_0x6182('0x58')](_0x49dba4[_0x6182('0x59')]);_0x405d15({'ret':0x1});});}});}function handleTZQuery(_0x56ee8e){logger[_0x6182('0x56')](_0x56ee8e);return db[_0x6182('0x6e')][_0x6182('0x5c')](_0x56ee8e)['spread'](function(_0x333838){})[_0x6182('0x5e')](function(_0x432dc0){logger[_0x6182('0x58')](_0x432dc0[_0x6182('0x59')]);});}function main(_0xeff391,_0x5ad187,_0x16160a,_0x4f26e9){logger['info']('main',_0xeff391,JSON[_0x6182('0x6f')](_0x5ad187));process[_0x6182('0x70')](_0x6182('0x71'));var _0x479ad9=_0x5ad187[_0x6182('0x72')];var _0x97ad38=_[_0x6182('0x73')](_0x479ad9);var _0x1294bf=_0x5ad187[_0x6182('0x74')];var _0x4fd533=path[_0x6182('0x15')](config[_0x6182('0x75')],_0x6182('0x76'),_0x1294bf+'.csv');hasTZ=_[_0x6182('0x50')](_0x479ad9)[_0x6182('0x77')](_0x6182('0x6a'));var _0x4c358b=_[_0x6182('0x50')](_0x479ad9)['join']();logger[_0x6182('0x56')]('header',_0x4c358b);db[_0x6182('0x78')][_0x6182('0x1b')]({'raw':!![],'attributes':['id',_0x6182('0x79')]})[_0x6182('0x1d')](function(_0x44b267){for(var _0x5c290a=0x0;_0x5c290a<_0x44b267[_0x6182('0x1e')];_0x5c290a++){if(_0x44b267[_0x5c290a]['name']in _0x479ad9){contactItemTypes[_0x6182('0x1f')](_0x44b267[_0x5c290a]);delete _0x97ad38[_0x44b267[_0x5c290a][_0x6182('0x79')]];hasAdditionalPhones=!![];}for(var _0x3b3fa5 in _0x479ad9){if(_0x44b267[_0x5c290a][_0x6182('0x79')]+_0x6182('0x7a')===_0x3b3fa5){phoneDescriptions[_0x6182('0x1f')]({'itemTypeId':_0x44b267[_0x5c290a]['id'],'description':_0x3b3fa5});delete _0x97ad38[_0x3b3fa5];}}}if(hasAdditionalPhones)_0x97ad38[_0x6182('0x1c')]='';var _0x5961fc=_[_0x6182('0x50')](_0x97ad38)[_0x6182('0x15')]();logger[_0x6182('0x56')](_0x6182('0x7b'),_0x5961fc);fs['writeFileSync'](_0x4fd533,_0x5961fc+'\x0a');Papa[_0x6182('0x7c')](fs[_0x6182('0x7d')](_0xeff391),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf49ccd,_0x2a8c31){try{for(var _0x151454=0x0,_0x4c058f=[];_0x151454<_0xf49ccd['data']['length'];_0x151454++){stats[_0x6182('0x7e')]+=0x1;if(_0xf49ccd[_0x6182('0x7f')][_0x151454]){handleError(_0xf49ccd[_0x6182('0x80')][_0x151454],_0xf49ccd[_0x6182('0x7f')][_0x151454]);}else{var _0x18b7f5=[];var _0x44148a=[];var _0x1e80ee={};for(var _0x2a178c in _0x479ad9){let _0x53c683=contactItemTypes[_0x6182('0x81')](_0x233502=>_0x233502['name']===_0x2a178c);let _0x4bd479=contactItemTypes['find'](_0x393754=>_0x393754[_0x6182('0x79')]+_0x6182('0x7a')===_0x2a178c);if(_[_0x6182('0x6b')](_0x53c683)&&_['isNil'](_0x4bd479)){if(_0x479ad9[_0x6182('0x82')](_0x2a178c)){if(_0xf49ccd['data'][_0x151454][_0x479ad9[_0x2a178c]]){var _0x15ff58=_[_0x6182('0x83')](_0xf49ccd[_0x6182('0x80')][_0x151454][_0x479ad9[_0x2a178c]][_0x6182('0x84')](/"/g,'\x27'));switch(_0x2a178c){case _0x6182('0x30'):var _0x4af245=moment(_0x15ff58,_0x6182('0xf'),!![]);if(_0x4af245[_0x6182('0x85')]()){_0x4c058f[_0x6182('0x1f')]('\x22'+_0x15ff58+'\x22');}else{_0x18b7f5['push'](_0x6182('0x86'));}break;case _0x6182('0x33'):var _0x12cfd3=parseInt(_0x15ff58);_0x15ff58=_[_0x6182('0x87')](_0x12cfd3)||_0x12cfd3<0x0||_0x12cfd3>0x4?_0x4f26e9?0x3:0x2:_0x12cfd3;_0x4c058f['push']('\x22'+_0x15ff58+'\x22');break;case _0x6182('0x34'):var _0x2bc3dd=parseInt(_0x15ff58);if(_['isNumber'](_0x2bc3dd)&&_[_0x6182('0x77')](_0x16160a,_0x2bc3dd)){_0x4c058f[_0x6182('0x1f')]('\x22'+_0x2bc3dd+'\x22');}else{_0x18b7f5[_0x6182('0x1f')](_0x6182('0x88'));}break;case'email':if(isEmail(_0x15ff58)){_0x4c058f['push']('\x22'+_0x15ff58+'\x22');}else{_0x18b7f5[_0x6182('0x1f')](_0x6182('0x89'));}break;case _0x6182('0x8a'):var _0x4b9a19=moment(_0x15ff58,_0x6182('0x8b'),!![]);if(_0x4b9a19[_0x6182('0x85')]()){_0x4c058f['push']('\x22'+_0x15ff58+'\x22');}else{_0x18b7f5[_0x6182('0x1f')](_0x6182('0x8c'));}break;case'dialTimezone':var _0x4e9f8c=shared[_0x6182('0x69')];var _0x24c40b=_0x4e9f8c[_0x15ff58];if(!_[_0x6182('0x6b')](_0x24c40b)){var _0x3a7d76=_0x24c40b[_0x6182('0x6c')];_0x4c058f['push']('\x22'+_0x15ff58+'\x22');_0x4c058f[_0x6182('0x1f')]('\x22'+_0x3a7d76+'\x22');}break;default:_0x4c058f[_0x6182('0x1f')]('\x22'+_0x15ff58+'\x22');}}else{switch(_0x2a178c){case _0x6182('0x8d'):case _0x6182('0x13'):_0x18b7f5[_0x6182('0x1f')](_0x2a178c+_0x6182('0x8e'));break;default:_0x4c058f['push']('\x22\x22');}}}}else{var _0x34b675='';if(!_[_0x6182('0x6b')](_0x53c683)){if(!_0x1e80ee[_0x6182('0x82')](_0x53c683['id'])){if(!_[_0x6182('0x6b')](_0xf49ccd[_0x6182('0x80')][_0x151454][_0x479ad9[_0x2a178c]])){var _0x15ff58=_[_0x6182('0x83')](_0xf49ccd[_0x6182('0x80')][_0x151454][_0x479ad9[_0x2a178c]][_0x6182('0x84')](/"/g,'\x27'));var _0x408188=phoneDescriptions[_0x6182('0x81')](_0x5befbc=>_0x5befbc[_0x6182('0x8f')]===_0x53c683['id']);if(!_['isNil'](_0x408188)){var _0x5c4e28=_[_0x6182('0x83')](_0xf49ccd[_0x6182('0x80')][_0x151454][_0x479ad9[_0x408188[_0x6182('0x90')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x5c4e28))_0x15ff58=_0x15ff58+'§'+_0x5c4e28;}if(_0x34b675=='')_0x34b675=_0x15ff58;else _0x34b675+='|'+_0x15ff58;}_0x44148a['push'](_0x53c683['id']+':'+_0x34b675);_0x1e80ee[_0x53c683['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4c058f[_0x6182('0x1f')]('\x22'+_0x44148a[_0x6182('0x15')](';')+'\x22');}if(_0x18b7f5[_0x6182('0x1e')]){handleError(_0xf49ccd[_0x6182('0x80')][_0x151454],{'code':_0x6182('0x91'),'message':_0x18b7f5[_0x6182('0x15')]()});}else{fs[_0x6182('0x92')](_0x4fd533,_0x4c058f[_0x6182('0x15')]()+'\x0a');}_0x4c058f=[];}if(!(stats[_0x6182('0x7e')]%0xc8)){socket[_0x6182('0x93')](_0x6182('0x94')+_0x1294bf,stats);stats['errors']=[];}}if(stopped){logger[_0x6182('0x56')](_0x6182('0x95'));_0x2a8c31['abort']();}}catch(_0x4bbfea){handleError(_0xf49ccd['data'][_0x151454],{'code':_0x6182('0x96'),'message':_0x4bbfea[_0x6182('0x59')]});logger[_0x6182('0x58')](_0x6182('0x97'),_0x4bbfea[_0x6182('0x59')]);}},'complete':function(){try{var _0x330533=[];var _0x2c6964=[];var _0xb9f656=_0x6182('0x40');if(_0x5ad187[_0x6182('0x98')]&&_0x5ad187[_0x6182('0x98')][_0x6182('0x1e')]){_0xb9f656=_0x6182('0x99')+_0x1294bf;_0x330533[_0x6182('0x1f')]('CREATE\x20TABLE\x20'+_0xb9f656+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x6182('0x9a')+_0x1294bf;tmp_voice_queues=_0x6182('0x9b')+_0x1294bf;_0x2c6964[_0x6182('0x1f')](_0x6182('0x9c')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2c6964[_0x6182('0x1f')](_0x6182('0x9c')+tmp_voice_queues+_0x6182('0x9d'));BPromise['each'](_0x2c6964,handleTZQuery)[_0x6182('0x1d')](function(_0x4525dc){updateTzCampaigns(_0x5ad187[_0x6182('0x32')])[_0x6182('0x1d')](function(_0x511d7a){updateTzVoiceQueues(_0x5ad187[_0x6182('0x32')])['then'](function(_0x353a79){if(hasTZ)_0x5961fc=_0x5961fc[_0x6182('0x84')](_0x6182('0x6a'),_0x6182('0x9e'));var _0x420a69=util[_0x6182('0xe')](_0x6182('0x9f'),_0x4fd533,_0xb9f656,_0x5961fc,_0x5ad187[_0x6182('0x32')],_0x5ad187[_0x6182('0x51')]||null,NOW,NOW);if(_[_0x6182('0x6b')](_0x479ad9[_0x6182('0x30')])){_0x420a69+=_0x6182('0xa0');}_0x330533[_0x6182('0x1f')](_0x420a69);if(_0x5ad187[_0x6182('0x98')]&&_0x5ad187[_0x6182('0x98')]['length']){_0x330533['push'](insertCmContact(_0x5ad187[_0x6182('0x32')],_0xb9f656,_0x5ad187['duplicates'],_0x479ad9));_0x330533['push'](_0x6182('0xa1')+_0xb9f656+';');}BPromise[_0x6182('0xa2')](_0x330533,handleQuery)['then'](function(_0x351062){BPromise[_0x6182('0x20')]([handleAdditionalPhones()])[_0x6182('0x1d')](function(){_0x330533=[];for(var _0x5df63b=0x0;_0x5df63b<promisesAdditionalPhones[_0x6182('0x1e')];_0x5df63b++){if(promisesAdditionalPhones[_0x5df63b][_0x6182('0x13')]!='§'){_0x330533[_0x6182('0x1f')](createAdditionalPhone(promisesAdditionalPhones[_0x5df63b][_0x6182('0xa3')],promisesAdditionalPhones[_0x5df63b]['contactTypeId'],promisesAdditionalPhones[_0x5df63b][_0x6182('0x13')],promisesAdditionalPhones[_0x5df63b][_0x6182('0xa4')]));}}BPromise[_0x6182('0x20')](_0x330533)[_0x6182('0x1d')](function(){_0x330533=[];if(hasTZ){_0x330533['push'](insertTzCmHopper(_0x5ad187[_0x6182('0x32')],_0x6182('0x68'),'voice_queues',_0x6182('0xa5'),_0x4f26e9,tmp_voice_queues));_0x330533['push'](insertTzCmHopperBlack(_0x5ad187['ListId'],_0x6182('0xa6'),'voice_queues','VoiceQueueId'));_0x330533[_0x6182('0x1f')](insertTzCmHopper(_0x5ad187['ListId'],'campaigns_has_cm_lists',_0x6182('0x61'),_0x6182('0xa7'),_0x4f26e9,tmp_campaigns));_0x330533[_0x6182('0x1f')](insertTzCmHopperBlack(_0x5ad187[_0x6182('0x32')],'campaigns_has_cm_blacklists','campaigns',_0x6182('0xa7')));_0x330533[_0x6182('0x1f')](insertCmHopperAdditionalPhones(_0x5ad187[_0x6182('0x32')]));}else{_0x330533[_0x6182('0x1f')](insertCmHopper(_0x5ad187[_0x6182('0x32')],_0x6182('0x68'),_0x6182('0x67'),'VoiceQueueId',_0x4f26e9));_0x330533[_0x6182('0x1f')](insertCmHopperBlack(_0x5ad187[_0x6182('0x32')],'voice_queues_has_cm_blacklists',_0x6182('0x67'),_0x6182('0xa5')));_0x330533[_0x6182('0x1f')](insertCmHopper(_0x5ad187['ListId'],'campaigns_has_cm_lists','campaigns',_0x6182('0xa7'),_0x4f26e9));_0x330533[_0x6182('0x1f')](insertCmHopperBlack(_0x5ad187[_0x6182('0x32')],_0x6182('0xa8'),_0x6182('0x61'),_0x6182('0xa7')));_0x330533[_0x6182('0x1f')](insertCmHopperAdditionalPhones(_0x5ad187[_0x6182('0x32')]));}_0x330533['push'](_0x6182('0xa1')+tmp_campaigns+';');_0x330533['push'](_0x6182('0xa1')+tmp_voice_queues+';');BPromise[_0x6182('0xa2')](_0x330533,handleQuery)[_0x6182('0x1d')](function(_0x26edfc){stats[_0x6182('0xa9')]=!![];stats[_0x6182('0xaa')]=_0x5ad187[_0x6182('0x98')]&&_0x5ad187[_0x6182('0x98')][_0x6182('0x1e')]?results[0x2][_0x6182('0xaa')]:results[0x0][_0x6182('0xaa')];socket['emit'](_0x6182('0x94')+_0x1294bf,stats);fs['unlink'](_0xeff391);fs['unlink'](_0x4fd533);process[_0x6182('0x5a')](0x0);})[_0x6182('0x5e')](function(_0x12692c){logger['error'](_0x12692c[_0x6182('0x59')]);process[_0x6182('0x5a')](0x1);});});});})[_0x6182('0x5e')](function(_0x3a9747){logger['error'](_0x3a9747[_0x6182('0x59')]);process[_0x6182('0x5a')](0x1);});});});});}catch(_0x4b1527){logger[_0x6182('0x58')](_0x6182('0xab'),_0x4b1527[_0x6182('0x59')]);process['exit'](0x1);}},'error':function(_0x1cf88b,_0x327a83,_0x51c840,_0x3360c2){throw new Error(_0x3360c2);}});});}function validate(){if(process[_0x6182('0xac')]&&process[_0x6182('0xac')]['length']<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x3d928d=path[_0x6182('0x15')](config[_0x6182('0x75')],_0x6182('0x76'),process[_0x6182('0xac')][0x2]);if(!fs[_0x6182('0xad')](_0x3d928d)){throw new Error(_0x6182('0xae'));}var _0x5db974={};try{_0x5db974=JSON[_0x6182('0x7c')](process[_0x6182('0xac')][0x3]);if(!_0x5db974[_0x6182('0x72')]){throw new Error(_0x6182('0xaf'));}if(!_0x5db974[_0x6182('0x72')]['phone']){throw new Error(_0x6182('0xb0'));}if(!_0x5db974[_0x6182('0x72')][_0x6182('0x8d')]){throw new Error(_0x6182('0xb1'));}var _0xd8badb=0x0;if(_0x5db974[_0x6182('0x72')][_0x6182('0x34')]){_0xd8badb=0x1;}if(!_0x5db974[_0x6182('0x32')]){throw new Error(_0x6182('0xb2'));}}catch(_0x345c28){throw new Error(_0x6182('0xb3'));}var _0x9bffff=[];try{_0x9bffff=_[_0x6182('0xb4')](JSON[_0x6182('0x7c')](process[_0x6182('0xac')][0x4]),'id');}catch(_0x187ebc){logger[_0x6182('0x56')]('No\x20agent\x20available');}main(_0x3d928d,_0x5db974,_0x9bffff,_0xd8badb);}validate();process['on']('SIGINT',handleStop);process['on'](_0x6182('0xb5'),handleUncaughtException);
\ No newline at end of file
index 7887366..700db7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4959=['papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','message','split','length','then','filter','CmContactHasItem','findOne','update','updated','create','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','updatedAt','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','exit','errors','code','query','catch','main','stringify','clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','find','hasOwnProperty','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','itemTypeId','trim','description','SystemRow','rows','contact:import:','Abort\x20parser','abort','SystemError','step','\x20LIKE\x20cm_contacts;','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException'];(function(_0x5ec9e3,_0x13c76f){var _0x588cef=function(_0x404166){while(--_0x404166){_0x5ec9e3['push'](_0x5ec9e3['shift']());}};_0x588cef(++_0x13c76f);}(_0x4959,0x9b));var _0x9495=function(_0x18939a,_0x72645d){_0x18939a=_0x18939a-0x0;var _0x50d72b=_0x4959[_0x18939a];return _0x50d72b;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x9495('0x0'));var util=require(_0x9495('0x1'));var BPromise=require(_0x9495('0x2'));var moment=require('moment');var squel=require(_0x9495('0x3'));var Redis=require(_0x9495('0x4'));var db=require(_0x9495('0x5'))['db'];var config=require(_0x9495('0x6'));var logger=require('../../../config/logger')(_0x9495('0x7'));config[_0x9495('0x8')]=_[_0x9495('0x9')](config[_0x9495('0x8')],{'host':_0x9495('0xa'),'port':0x18eb});var socket=require(_0x9495('0xb'))(new Redis(config[_0x9495('0x8')]));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()[_0x9495('0xc')](_0x9495('0xd'));var tempTableName=_0x9495('0xe')+moment()[_0x9495('0xc')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x184fc3){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'](_0x184fc3);}function selectNotIn(_0x4b53aa,_0x4fb16d,_0x49bf36,_0x1fdde8,_0x5e15a3){return squel[_0x9495('0xf')]()[_0x9495('0x10')](_0x9495('0x11'))[_0x9495('0x12')](_0x1fdde8)[_0x9495('0x13')](_0x4fb16d,null,_0x4fb16d+_0x9495('0x14')+_0x1fdde8+'.'+_0x49bf36)[_0x9495('0x15')](_0x1fdde8+'.'+_0x49bf36+_0x9495('0x16')+_0x4b53aa+'.'+_0x49bf36)[_0x9495('0x15')](_0x4fb16d+_0x9495('0x17')+_0x5e15a3[_0x9495('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xf7e975,_0x41312c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x9495('0x18')]['query'](_0x9495('0x19')+tempTableName)[_0x9495('0x1a')](function(_0x3cf201){if(_0x3cf201!==null){var _0xcfc1e8=[];for(var _0x1e2c6c=0x0;_0x1e2c6c<_0x3cf201['length'];_0x1e2c6c++){var _0x45d5fd=_0x3cf201[_0x1e2c6c];if(!_[_0x9495('0x1b')](_0x45d5fd[_0x9495('0x11')])){if(!_[_0x9495('0x1b')](_0x45d5fd[_0x9495('0x1c')]))_0xcfc1e8['push'](insertAdditionalPhones(_0x45d5fd));promisesContact[_0x9495('0x1d')]({'contact':_0x45d5fd});}}}Promise[_0x9495('0x1e')](_0xcfc1e8)['then'](function(){_0xf7e975({'val':0x1});});})['catch'](function(_0x56be18){logger['error'](_0x56be18[_0x9495('0x1f')]);});});}function insertAdditionalPhones(_0x185a86){return new Promise(function(_0x95e617,_0x1ca75b){var _0x38207a=_0x185a86[_0x9495('0x1c')];if(_[_0x9495('0x1b')](_0x38207a))_0x1ca75b({'val':0x0});else{var _0x8a990e=_0x38207a[_0x9495('0x20')](';');var _0x4053bb=[];orderBy=0x0;for(var _0x4acbaa=0x0;_0x4acbaa<_0x8a990e[_0x9495('0x21')];_0x4acbaa++){_0x4053bb[_0x9495('0x1d')](splitAdditionalPhone(_0x185a86['id'],_0x8a990e[_0x4acbaa]));}Promise[_0x9495('0x1e')](_0x4053bb)[_0x9495('0x22')](function(){_0x95e617({'val':_0x8a990e[_0x9495('0x21')]});});}});}function splitAdditionalPhone(_0x8fa430,_0xf3bf59){return new Promise(function(_0x5aee3f,_0x4087d9){var _0x5751c4=_0xf3bf59[_0x9495('0x20')](':');var _0x195dc6=_0x5751c4[0x0];var _0x3d1ea7=_0x5751c4[0x1];if(_0x3d1ea7!==''){var _0x1e200d=_0x3d1ea7[_0x9495('0x20')]('|');var _0x371eea=[];for(var _0xaa5ab4=0x0;_0xaa5ab4<_0x1e200d[_0x9495('0x21')];_0xaa5ab4++){if(_0x1e200d[_0xaa5ab4]!==''){var _0x535e24=_[_0x9495('0x23')](promisesAdditionalPhones,{'contactId':_0x8fa430,'phone':_0x1e200d[_0xaa5ab4]});if(_0x535e24[_0x9495('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0x9495('0x1d')]({'contactId':_0x8fa430,'contactTypeId':_0x195dc6,'phone':_0x1e200d[_0xaa5ab4],'orderBy':orderBy});}}}_0x5aee3f({'ok':0x1});}else _0x5aee3f({'res':0x0});});}function createAdditionalPhone(_0x23b5e7,_0x5ee329,_0xbaa782,_0x36aac0){var _0x8f20ad='';var _0x5f3d6e='';var _0x42761e=_0xbaa782[_0x9495('0x20')]('§');_0x8f20ad=_0x42761e[0x0];if(_0x42761e[_0x9495('0x21')]==0x2)_0x5f3d6e=_0x42761e[0x1];return new Promise(function(_0xbd2d2f,_0xcbfbee){return db[_0x9495('0x24')][_0x9495('0x25')]({'where':{'CmContactId':_0x23b5e7,'item':_0x8f20ad}})['then'](function(_0x3f6df9){if(_0x3f6df9){return db[_0x9495('0x24')][_0x9495('0x26')]({'ItemTypeId':_0x5ee329,'description':_0x5f3d6e,'OrderBy':_0x36aac0},{'where':{'CmContactId':_0x23b5e7,'item':_0x8f20ad}})[_0x9495('0x22')](function(_0x520f71){_0xbd2d2f({'res':_0x9495('0x27')});});}else{return db[_0x9495('0x24')][_0x9495('0x28')]({'CmContactId':_0x23b5e7,'item':_0x8f20ad,'ItemTypeId':_0x5ee329,'description':_0x5f3d6e,'OrderBy':_0x36aac0,'ItemClass':'PHONE'})[_0x9495('0x22')](function(_0x5830a5){_0xbd2d2f({'res':'inserted'});});}});});}function updateContact(_0x5370ac){return new Promise(function(_0x349db8,_0x231621){var _0x167a1d=_0x5370ac['id'];delete _0x5370ac['id'];return db[_0x9495('0x29')][_0x9495('0x26')](_0x5370ac,{'where':{'id':_0x167a1d}})[_0x9495('0x22')](function(_0x3f724e){updatedRows+=0x1;return db[_0x9495('0x2a')][_0x9495('0x26')]({'phone':_0x5370ac[_0x9495('0x11')]},{'where':{'ContactId':_0x167a1d}})[_0x9495('0x22')](function(_0x2a52fd){_0x349db8({'ret':'OK'});});});});}function insertCmHopper(_0x1e151a,_0x4cc7fe,_0x13824b,_0x347119,_0x9d9b31){var _0x37c6aa=[_0x9495('0x2b'),_0x9495('0x2c'),_0x9495('0x2d'),'cm_contacts.ListId',_0x4cc7fe+'.'+_0x347119,'cm_contacts.createdAt',_0x9495('0x2e'),_0x9495('0x2f'),'cm_contacts.UserId','\x22'+_0x9d9b31+'\x22'];return squel[_0x9495('0x30')]()[_0x9495('0x31')]('cm_hopper')[_0x9495('0x32')]([_0x9495('0x11'),'scheduledat',_0x9495('0x33'),_0x9495('0x34'),_0x347119,_0x9495('0x35'),'updatedAt',_0x9495('0x36'),_0x9495('0x37'),_0x9495('0x38')],squel[_0x9495('0xf')]()[_0x9495('0x39')](_0x37c6aa)[_0x9495('0x12')](_0x4cc7fe)['join'](_0x9495('0x3a'),null,_0x9495('0x3b')+_0x4cc7fe+_0x9495('0x3c'))['join'](_0x13824b,null,_0x13824b+_0x9495('0x14')+_0x4cc7fe+'.'+_0x347119)[_0x9495('0x15')](_0x4cc7fe+_0x9495('0x3d'),_0x1e151a)[_0x9495('0x15')](_0x9495('0x3e'),NOW)[_0x9495('0x15')](_0x9495('0x3f'),selectNotIn(_0x4cc7fe,_0x13824b,_0x347119,_0x9495('0x40'),['\x22always\x22',_0x9495('0x41')]))[_0x9495('0x15')](_0x9495('0x3f'),selectNotIn(_0x4cc7fe,_0x13824b,_0x347119,'cm_hopper',[_0x9495('0x42')])))[_0x9495('0x43')]();}function insertCmHopperBlack(_0x3f3af7,_0x3e2312,_0x49a9e9,_0x3fdf94){var _0x3ea2c2=[_0x9495('0x2b'),_0x9495('0x2d'),_0x9495('0x44'),_0x3e2312+'.'+_0x3fdf94,_0x9495('0x45'),_0x9495('0x2e')];return squel[_0x9495('0x30')]()[_0x9495('0x31')](_0x9495('0x46'))['fromQuery']([_0x9495('0x11'),_0x9495('0x33'),_0x9495('0x34'),_0x3fdf94,_0x9495('0x35'),_0x9495('0x47')],squel['select']()[_0x9495('0x39')](_0x3ea2c2)[_0x9495('0x12')](_0x3e2312)[_0x9495('0x13')](_0x9495('0x3a'),null,_0x9495('0x3b')+_0x3e2312+'.CmListId')[_0x9495('0x13')](_0x49a9e9,null,_0x49a9e9+_0x9495('0x14')+_0x3e2312+'.'+_0x3fdf94)['where'](_0x3e2312+_0x9495('0x3d'),_0x3f3af7)[_0x9495('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9495('0x10')](_0x9495('0x11'))[_0x9495('0x12')](_0x9495('0x46'))[_0x9495('0x15')](_0x9495('0x48'),_0x3f3af7)[_0x9495('0x15')](_0x3fdf94+'\x20=\x20?',_0x3e2312+'.'+_0x3fdf94)))[_0x9495('0x43')]();}function insertCmHopperAdditionalPhones(_0x7b3c2c){var _0xca58e2=[_0x9495('0x49'),'cm_contact_has_items.item',_0x9495('0x4a'),'cm_contact_has_items.createdAt',_0x9495('0x4b')];return squel[_0x9495('0x30')]()['into']('cm_hopper_additional_phones')[_0x9495('0x32')]([_0x9495('0x4c'),'phone',_0x9495('0x4d'),_0x9495('0x35'),_0x9495('0x47')],squel[_0x9495('0xf')]()['fields'](_0xca58e2)['from']('cm_hopper')[_0x9495('0x13')](_0x9495('0x3a'),null,_0x9495('0x4e'))[_0x9495('0x13')](_0x9495('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x9495('0x50'),_0x7b3c2c)['where'](_0x9495('0x3e'),NOW))[_0x9495('0x43')]();}function insertCmContact(_0xaade15,_0x220446,_0x4a52b3,_0x2e519f){var _0x148b29=_[_0x9495('0x51')](_[_0x9495('0x52')](_0x2e519f),[_0x9495('0x34'),'CompanyId','createdAt','updatedAt']);return squel[_0x9495('0x30')]()[_0x9495('0x31')]('cm_contacts')['fromQuery'](_0x148b29,squel[_0x9495('0xf')]()[_0x9495('0x39')](_0x148b29)['from'](_0x220446)['where']('('+_0x4a52b3['join'](',')+_0x9495('0x53'),squel[_0x9495('0xf')]()[_0x9495('0x39')](_0x4a52b3)['from'](_0x9495('0x3a'))[_0x9495('0x15')](_0x9495('0x48'),_0xaade15))['where']('id\x20IN\x20?',squel['select']()[_0x9495('0x10')](_0x9495('0x54'),'min_id')[_0x9495('0x12')](_0x220446)[_0x9495('0x55')](_0x4a52b3[_0x9495('0x13')](','))))['toString']();}function handleStop(){logger[_0x9495('0x56')](_0x9495('0x57'));stopped=!![];}function handleUncaughtException(_0x2b8fd0){logger[_0x9495('0x58')](_0x2b8fd0[_0x9495('0x1f')]);process[_0x9495('0x59')](0x1);}function handleError(_0x315d1d,_0x78ec36){stats[_0x9495('0x5a')][_0x9495('0x1d')]({'name':_0x78ec36[_0x9495('0x5b')],'message':_0x78ec36[_0x9495('0x1f')],'row':_0x315d1d});}function handleQuery(_0x32adf6){logger[_0x9495('0x56')](_0x32adf6);return db[_0x9495('0x18')][_0x9495('0x5c')](_0x32adf6)[_0x9495('0x1a')](function(_0x5f4a7a){results['push'](_0x5f4a7a);})[_0x9495('0x5d')](function(_0x3ab1a1){logger[_0x9495('0x58')](_0x3ab1a1[_0x9495('0x1f')]);});}function main(_0x6986c1,_0x4a2a0f,_0x2f0456,_0xee8656){logger['info'](_0x9495('0x5e'),_0x6986c1,JSON[_0x9495('0x5f')](_0x4a2a0f));process['send']('start');var _0x4dfeb0=_0x4a2a0f['binding'];var _0x92b4ed=_[_0x9495('0x60')](_0x4dfeb0);var _0x3da4d3=_0x4a2a0f[_0x9495('0x61')];var _0x3688ba=path['join'](config[_0x9495('0x62')],_0x9495('0x63'),_0x3da4d3+'.csv');logger[_0x9495('0x56')](_0x9495('0x64'),_0x4a2a0f);db[_0x9495('0x65')][_0x9495('0x66')]({'raw':!![],'attributes':['id',_0x9495('0x67')]})[_0x9495('0x22')](function(_0x35b925){for(var _0x561592=0x0;_0x561592<_0x35b925[_0x9495('0x21')];_0x561592++){if(_0x35b925[_0x561592][_0x9495('0x67')]in _0x4dfeb0){contactItemTypes['push'](_0x35b925[_0x561592]);delete _0x92b4ed[_0x35b925[_0x561592][_0x9495('0x67')]];hasAdditionalPhones=!![];}for(var _0x2b7552 in _0x4dfeb0){if(_0x35b925[_0x561592][_0x9495('0x67')]+_0x9495('0x68')===_0x2b7552){phoneDescriptions[_0x9495('0x1d')]({'itemTypeId':_0x35b925[_0x561592]['id'],'description':_0x2b7552});delete _0x92b4ed[_0x2b7552];}}}if(hasAdditionalPhones)_0x92b4ed['AdditionalPhones']='';var _0x410038=_[_0x9495('0x52')](_0x92b4ed)[_0x9495('0x13')]();logger[_0x9495('0x56')](_0x9495('0x69'),_0x410038);fs[_0x9495('0x6a')](_0x3688ba,_0x410038+'\x0a');Papa[_0x9495('0x6b')](fs[_0x9495('0x6c')](_0x6986c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x505794,_0x35d547){try{for(var _0x38ede0=0x0,_0x222601=[];_0x38ede0<_0x505794['data'][_0x9495('0x21')];_0x38ede0++){stats['rows']+=0x1;if(_0x505794[_0x9495('0x5a')][_0x38ede0]){handleError(_0x505794[_0x9495('0x6d')][_0x38ede0],_0x505794['errors'][_0x38ede0]);}else{var _0x38a36d=[];var _0x2d0051=[];var _0x26692b={};for(var _0x3b0ecd in _0x4dfeb0){let _0x34a449=contactItemTypes[_0x9495('0x6e')](_0x3c87a4=>_0x3c87a4[_0x9495('0x67')]===_0x3b0ecd);let _0x2a9521=contactItemTypes[_0x9495('0x6e')](_0x1acc95=>_0x1acc95['name']+_0x9495('0x68')===_0x3b0ecd);if(_['isNil'](_0x34a449)&&_[_0x9495('0x1b')](_0x2a9521)){if(_0x4dfeb0[_0x9495('0x6f')](_0x3b0ecd)){if(_0x505794[_0x9495('0x6d')][_0x38ede0][_0x4dfeb0[_0x3b0ecd]]){var _0x1cd985=_['trim'](_0x505794[_0x9495('0x6d')][_0x38ede0][_0x4dfeb0[_0x3b0ecd]][_0x9495('0x70')](/"/g,'\x27'));switch(_0x3b0ecd){case _0x9495('0x71'):var _0x7264e6=moment(_0x1cd985,_0x9495('0xd'),!![]);if(_0x7264e6[_0x9495('0x72')]()){_0x222601[_0x9495('0x1d')]('\x22'+_0x1cd985+'\x22');}else{_0x38a36d['push'](_0x9495('0x73'));}break;case _0x9495('0x36'):var _0x1af7c4=parseInt(_0x1cd985);_0x1cd985=_[_0x9495('0x74')](_0x1af7c4)||_0x1af7c4<0x0||_0x1af7c4>0x4?_0xee8656?0x3:0x2:_0x1af7c4;_0x222601[_0x9495('0x1d')]('\x22'+_0x1cd985+'\x22');break;case _0x9495('0x37'):var _0x16897a=parseInt(_0x1cd985);if(_[_0x9495('0x75')](_0x16897a)&&_[_0x9495('0x76')](_0x2f0456,_0x16897a)){_0x222601[_0x9495('0x1d')]('\x22'+_0x16897a+'\x22');}else{_0x38a36d[_0x9495('0x1d')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x1cd985)){_0x222601[_0x9495('0x1d')]('\x22'+_0x1cd985+'\x22');}else{_0x38a36d[_0x9495('0x1d')](_0x9495('0x77'));}break;case _0x9495('0x78'):var _0x166e8f=moment(_0x1cd985,_0x9495('0x79'),!![]);if(_0x166e8f[_0x9495('0x72')]()){_0x222601['push']('\x22'+_0x1cd985+'\x22');}else{_0x38a36d[_0x9495('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x222601['push']('\x22'+_0x1cd985+'\x22');}}else{switch(_0x3b0ecd){case _0x9495('0x7a'):case'phone':_0x38a36d[_0x9495('0x1d')](_0x3b0ecd+'\x20not\x20specified');break;default:_0x222601[_0x9495('0x1d')]('\x22\x22');}}}}else{var _0x32e5f3='';if(!_[_0x9495('0x1b')](_0x34a449)){if(!_0x26692b[_0x9495('0x6f')](_0x34a449['id'])){for(var _0x1b6536=0x0;_0x1b6536<_0x4dfeb0[_0x3b0ecd][_0x9495('0x21')];_0x1b6536++){var _0x1cd985=_['trim'](_0x505794[_0x9495('0x6d')][_0x38ede0][_0x4dfeb0[_0x3b0ecd][_0x1b6536]][_0x9495('0x70')](/"/g,'\x27'));var _0x447f7a=phoneDescriptions[_0x9495('0x6e')](_0x49d0ad=>_0x49d0ad[_0x9495('0x7b')]===_0x34a449['id']);if(!_[_0x9495('0x1b')](_0x447f7a)){var _0xd1d6dd=_[_0x9495('0x7c')](_0x505794[_0x9495('0x6d')][_0x38ede0][_0x4dfeb0[_0x447f7a[_0x9495('0x7d')]][0x0]][_0x9495('0x70')](/"/g,'\x27'));if(!_['isNil'](_0xd1d6dd))_0x1cd985=_0x1cd985+'§'+_0xd1d6dd;}if(_0x32e5f3=='')_0x32e5f3=_0x1cd985;else _0x32e5f3+='|'+_0x1cd985;}_0x2d0051[_0x9495('0x1d')](_0x34a449['id']+':'+_0x32e5f3);_0x26692b[_0x34a449['id']]=0x1;}}}}if(hasAdditionalPhones){_0x222601[_0x9495('0x1d')]('\x22'+_0x2d0051[_0x9495('0x13')](';')+'\x22');}if(_0x38a36d[_0x9495('0x21')]){handleError(_0x505794['data'][_0x38ede0],{'code':_0x9495('0x7e'),'message':_0x38a36d[_0x9495('0x13')]()});}else{fs['appendFileSync'](_0x3688ba,_0x222601[_0x9495('0x13')]()+'\x0a');}_0x222601=[];}if(!(stats[_0x9495('0x7f')]%0xc8)){socket['emit'](_0x9495('0x80')+_0x3da4d3,stats);stats[_0x9495('0x5a')]=[];}}if(stopped){logger[_0x9495('0x56')](_0x9495('0x81'));_0x35d547[_0x9495('0x82')]();}}catch(_0x24049b){handleError(_0x505794[_0x9495('0x6d')][_0x38ede0],{'code':_0x9495('0x83'),'message':_0x24049b[_0x9495('0x1f')]});logger[_0x9495('0x58')](_0x9495('0x84'),_0x24049b[_0x9495('0x1f')]);}},'complete':function(){try{var _0x1fc709=[];var _0x2c6782=tempTableName;_0x1fc709[_0x9495('0x1d')]('CREATE\x20TABLE\x20'+_0x2c6782+_0x9495('0x85'));logger[_0x9495('0x56')]('CIS\x20len',contactItemTypes[_0x9495('0x21')]);var _0x4716d7=util[_0x9495('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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x3688ba,_0x2c6782,_0x410038,_0x4a2a0f[_0x9495('0x34')],_0x4a2a0f[_0x9495('0x86')]||null,NOW,NOW);if(_[_0x9495('0x1b')](_0x4dfeb0[_0x9495('0x71')])){_0x4716d7+=_0x9495('0x87');}_0x1fc709[_0x9495('0x1d')](_0x4716d7);BPromise[_0x9495('0x88')](_0x1fc709,handleQuery)[_0x9495('0x22')](function(_0x47dc90){BPromise[_0x9495('0x1e')]([handleAdditionalPhones()])[_0x9495('0x22')](function(){_0x1fc709=[];for(var _0x5ae053=0x0;_0x5ae053<promisesContact[_0x9495('0x21')];_0x5ae053++){_0x1fc709[_0x9495('0x1d')](updateContact(promisesContact[_0x5ae053][_0x9495('0x89')]));}BPromise['all'](_0x1fc709)[_0x9495('0x22')](function(){_0x1fc709=[];for(var _0xf284f1=0x0;_0xf284f1<promisesAdditionalPhones[_0x9495('0x21')];_0xf284f1++){_0x1fc709[_0x9495('0x1d')](createAdditionalPhone(promisesAdditionalPhones[_0xf284f1][_0x9495('0x8a')],promisesAdditionalPhones[_0xf284f1][_0x9495('0x8b')],promisesAdditionalPhones[_0xf284f1][_0x9495('0x11')],promisesAdditionalPhones[_0xf284f1][_0x9495('0x8c')]));}BPromise[_0x9495('0x1e')](_0x1fc709)[_0x9495('0x22')](function(){_0x1fc709=[];_0x1fc709[_0x9495('0x1d')](insertCmHopperAdditionalPhones(_0x4a2a0f['ListId']));_0x1fc709[_0x9495('0x1d')]('DROP\x20TABLE\x20'+_0x2c6782+';');BPromise['each'](_0x1fc709,handleQuery)[_0x9495('0x22')](function(_0x4cc1b0){stats['finish']=!![];stats[_0x9495('0x8d')]=updatedRows;socket[_0x9495('0x8e')](_0x9495('0x80')+_0x3da4d3,stats);fs[_0x9495('0x8f')](_0x6986c1);fs['unlink'](_0x3688ba);process[_0x9495('0x59')](0x0);})['catch'](function(_0xcf9e21){logger['error'](_0xcf9e21[_0x9495('0x1f')]);process[_0x9495('0x59')](0x1);});});});});})[_0x9495('0x5d')](function(_0x2310e1){logger[_0x9495('0x58')](_0x2310e1[_0x9495('0x1f')]);process[_0x9495('0x59')](0x1);});}catch(_0xbb3e25){logger[_0x9495('0x58')](_0x9495('0x90'),_0xbb3e25[_0x9495('0x1f')]);process[_0x9495('0x59')](0x1);}},'error':function(_0x96b8b4,_0x11b8c3,_0x25c2a5,_0x3030ac){throw new Error(_0x3030ac);}});});}function validate(){if(process[_0x9495('0x91')]&&process[_0x9495('0x91')][_0x9495('0x21')]<0x4){throw new Error(_0x9495('0x92'));}var _0x35758e=path[_0x9495('0x13')](config[_0x9495('0x62')],'server/files/tmp',process[_0x9495('0x91')][0x2]);if(!fs[_0x9495('0x93')](_0x35758e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3f629b={};try{_0x3f629b=JSON[_0x9495('0x6b')](process['argv'][0x3]);if(!_0x3f629b[_0x9495('0x94')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x1ab41f=0x0;if(_0x3f629b[_0x9495('0x94')][_0x9495('0x37')]){_0x1ab41f=0x1;}if(!_0x3f629b[_0x9495('0x34')]){throw new Error(_0x9495('0x95'));}}catch(_0x55fe26){throw new Error(_0x9495('0x96'));}var _0x30ed03=[];try{_0x30ed03=_[_0x9495('0x97')](JSON[_0x9495('0x6b')](process[_0x9495('0x91')][0x4]),'id');}catch(_0x5bd185){logger[_0x9495('0x56')](_0x9495('0x98'));}main(_0x35758e,_0x3f629b,_0x30ed03,_0x1ab41f);}validate();process['on'](_0x9495('0x99'),handleStop);process['on'](_0x9495('0x9a'),handleUncaughtException);
\ No newline at end of file
+var _0x6b1e=['query','spread','main','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','_description','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','email','dateOfBirth','firstName','find','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contact','DROP\x20TABLE\x20','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYYMMDDHHmmss','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','length','isNil','push','all','then','catch','AdditionalPhones','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ListId','createdAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','into','cm_hopper_black','updatedAt','fields','ListId\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0x6b1e,0xd3));var _0xe6b1=function(_0x11ee3a,_0x2896e0){_0x11ee3a=_0x11ee3a-0x0;var _0x427973=_0x6b1e[_0x11ee3a];return _0x427973;};'use strict';var fs=require('fs');var path=require(_0xe6b1('0x0'));var _=require(_0xe6b1('0x1'));var Papa=require(_0xe6b1('0x2'));var util=require(_0xe6b1('0x3'));var BPromise=require(_0xe6b1('0x4'));var moment=require(_0xe6b1('0x5'));var squel=require(_0xe6b1('0x6'));var Redis=require(_0xe6b1('0x7'));var db=require(_0xe6b1('0x8'))['db'];var config=require(_0xe6b1('0x9'));var logger=require(_0xe6b1('0xa'))(_0xe6b1('0xb'));config[_0xe6b1('0xc')]=_[_0xe6b1('0xd')](config[_0xe6b1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6b1('0xe'))(new Redis(config[_0xe6b1('0xc')]));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()[_0xe6b1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0xe6b1('0xf')](_0xe6b1('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x301cf2){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'](_0x301cf2);}function selectNotIn(_0x568c80,_0x43bbc5,_0x370b86,_0x44e6da,_0x12ebe8){return squel[_0xe6b1('0x11')]()['field'](_0xe6b1('0x12'))[_0xe6b1('0x13')](_0x44e6da)[_0xe6b1('0x14')](_0x43bbc5,null,_0x43bbc5+_0xe6b1('0x15')+_0x44e6da+'.'+_0x370b86)[_0xe6b1('0x16')](_0x44e6da+'.'+_0x370b86+_0xe6b1('0x17')+_0x568c80+'.'+_0x370b86)[_0xe6b1('0x16')](_0x43bbc5+_0xe6b1('0x18')+_0x12ebe8[_0xe6b1('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x18b02f,_0x15d1e4){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe6b1('0x19')]['query']('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x18aca4){if(_0x18aca4!==null){var _0xbbed4f=[];for(var _0x599370=0x0;_0x599370<_0x18aca4[_0xe6b1('0x1a')];_0x599370++){var _0x47d93b=_0x18aca4[_0x599370];if(!_[_0xe6b1('0x1b')](_0x47d93b[_0xe6b1('0x12')])){if(!_[_0xe6b1('0x1b')](_0x47d93b['AdditionalPhones']))_0xbbed4f[_0xe6b1('0x1c')](insertAdditionalPhones(_0x47d93b));promisesContact['push']({'contact':_0x47d93b});}}}Promise[_0xe6b1('0x1d')](_0xbbed4f)[_0xe6b1('0x1e')](function(){_0x18b02f({'val':0x1});});})[_0xe6b1('0x1f')](function(_0x512f72){logger['error'](_0x512f72['message']);});});}function insertAdditionalPhones(_0x5d7813){return new Promise(function(_0xe853c,_0x10263a){var _0x10c48e=_0x5d7813[_0xe6b1('0x20')];if(_[_0xe6b1('0x1b')](_0x10c48e))_0x10263a({'val':0x0});else{var _0x5e2631=_0x10c48e[_0xe6b1('0x21')](';');var _0x511fbb=[];orderBy=0x0;for(var _0x307cac=0x0;_0x307cac<_0x5e2631[_0xe6b1('0x1a')];_0x307cac++){_0x511fbb['push'](splitAdditionalPhone(_0x5d7813['id'],_0x5e2631[_0x307cac]));}Promise[_0xe6b1('0x1d')](_0x511fbb)['then'](function(){_0xe853c({'val':_0x5e2631[_0xe6b1('0x1a')]});});}});}function splitAdditionalPhone(_0x44f5c3,_0x39cc9a){return new Promise(function(_0x56a6e9,_0x1480c4){var _0x298c7a=_0x39cc9a[_0xe6b1('0x21')](':');var _0xfd99d0=_0x298c7a[0x0];var _0x280848=_0x298c7a[0x1];if(_0x280848!==''){var _0x101c87=_0x280848['split']('|');var _0x41afdf=[];for(var _0x30e211=0x0;_0x30e211<_0x101c87[_0xe6b1('0x1a')];_0x30e211++){if(_0x101c87[_0x30e211]!==''){var _0x4ac1e3=_[_0xe6b1('0x22')](promisesAdditionalPhones,{'contactId':_0x44f5c3,'phone':_0x101c87[_0x30e211]});if(_0x4ac1e3[_0xe6b1('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xe6b1('0x1c')]({'contactId':_0x44f5c3,'contactTypeId':_0xfd99d0,'phone':_0x101c87[_0x30e211],'orderBy':orderBy});}}}_0x56a6e9({'ok':0x1});}else _0x56a6e9({'res':0x0});});}function createAdditionalPhone(_0x1b088c,_0x2ca04d,_0x3dd04a,_0x49b7a4){var _0x1b2773='';var _0xa5706e='';var _0xab7a40=_0x3dd04a[_0xe6b1('0x21')]('§');_0x1b2773=_0xab7a40[0x0];if(_0xab7a40[_0xe6b1('0x1a')]==0x2)_0xa5706e=_0xab7a40[0x1];return new Promise(function(_0xe31761,_0x3a153c){return db[_0xe6b1('0x23')][_0xe6b1('0x24')]({'where':{'CmContactId':_0x1b088c,'item':_0x1b2773}})[_0xe6b1('0x1e')](function(_0x2e8b7c){if(_0x2e8b7c){return db['CmContactHasItem'][_0xe6b1('0x25')]({'ItemTypeId':_0x2ca04d,'description':_0xa5706e,'OrderBy':_0x49b7a4},{'where':{'CmContactId':_0x1b088c,'item':_0x1b2773}})[_0xe6b1('0x1e')](function(_0x2e9254){_0xe31761({'res':_0xe6b1('0x26')});});}else{return db[_0xe6b1('0x23')][_0xe6b1('0x27')]({'CmContactId':_0x1b088c,'item':_0x1b2773,'ItemTypeId':_0x2ca04d,'description':_0xa5706e,'OrderBy':_0x49b7a4,'ItemClass':_0xe6b1('0x28')})[_0xe6b1('0x1e')](function(_0x2c2f98){_0xe31761({'res':_0xe6b1('0x29')});});}});});}function updateContact(_0x1d14df){return new Promise(function(_0x5d69a3,_0x534a3a){var _0x57c1fd=_0x1d14df['id'];delete _0x1d14df['id'];return db[_0xe6b1('0x2a')]['update'](_0x1d14df,{'where':{'id':_0x57c1fd}})[_0xe6b1('0x1e')](function(_0x352b2f){updatedRows+=0x1;return db[_0xe6b1('0x2b')][_0xe6b1('0x25')]({'phone':_0x1d14df[_0xe6b1('0x12')]},{'where':{'ContactId':_0x57c1fd}})[_0xe6b1('0x1e')](function(_0x29d740){_0x5d69a3({'ret':'OK'});});});});}function insertCmHopper(_0x2b9d09,_0x3d78dd,_0x240f93,_0x3fc7f5,_0x353f43){var _0xb09e66=[_0xe6b1('0x2c'),_0xe6b1('0x2d'),_0xe6b1('0x2e'),_0xe6b1('0x2f'),_0x3d78dd+'.'+_0x3fc7f5,'cm_contacts.createdAt',_0xe6b1('0x30'),_0xe6b1('0x31'),_0xe6b1('0x32'),'\x22'+_0x353f43+'\x22'];return squel[_0xe6b1('0x33')]()['into'](_0xe6b1('0x34'))[_0xe6b1('0x35')]([_0xe6b1('0x12'),_0xe6b1('0x36'),'ContactId',_0xe6b1('0x37'),_0x3fc7f5,_0xe6b1('0x38'),'updatedAt',_0xe6b1('0x39'),_0xe6b1('0x3a'),_0xe6b1('0x3b')],squel[_0xe6b1('0x11')]()['fields'](_0xb09e66)[_0xe6b1('0x13')](_0x3d78dd)[_0xe6b1('0x14')](_0xe6b1('0x3c'),null,_0xe6b1('0x3d')+_0x3d78dd+_0xe6b1('0x3e'))['join'](_0x240f93,null,_0x240f93+_0xe6b1('0x15')+_0x3d78dd+'.'+_0x3fc7f5)[_0xe6b1('0x16')](_0x3d78dd+_0xe6b1('0x3f'),_0x2b9d09)[_0xe6b1('0x16')](_0xe6b1('0x40'),NOW)[_0xe6b1('0x16')](_0xe6b1('0x41'),selectNotIn(_0x3d78dd,_0x240f93,_0x3fc7f5,_0xe6b1('0x34'),[_0xe6b1('0x42'),_0xe6b1('0x43')]))[_0xe6b1('0x16')](_0xe6b1('0x41'),selectNotIn(_0x3d78dd,_0x240f93,_0x3fc7f5,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x4fdf85,_0x2525c6,_0xdbb940,_0x11958c){var _0x4dc35b=[_0xe6b1('0x2c'),_0xe6b1('0x2e'),'cm_contacts.ListId',_0x2525c6+'.'+_0x11958c,'cm_contacts.createdAt',_0xe6b1('0x30')];return squel[_0xe6b1('0x33')]()[_0xe6b1('0x44')](_0xe6b1('0x45'))['fromQuery'](['phone','ContactId',_0xe6b1('0x37'),_0x11958c,_0xe6b1('0x38'),_0xe6b1('0x46')],squel[_0xe6b1('0x11')]()[_0xe6b1('0x47')](_0x4dc35b)[_0xe6b1('0x13')](_0x2525c6)['join'](_0xe6b1('0x3c'),null,_0xe6b1('0x3d')+_0x2525c6+_0xe6b1('0x3e'))[_0xe6b1('0x14')](_0xdbb940,null,_0xdbb940+_0xe6b1('0x15')+_0x2525c6+'.'+_0x11958c)[_0xe6b1('0x16')](_0x2525c6+'.CmListId\x20=\x20?',_0x4fdf85)[_0xe6b1('0x16')](_0xe6b1('0x40'),NOW)[_0xe6b1('0x16')](_0xe6b1('0x41'),squel[_0xe6b1('0x11')]()['field'](_0xe6b1('0x12'))[_0xe6b1('0x13')]('cm_hopper_black')[_0xe6b1('0x16')](_0xe6b1('0x48'),_0x4fdf85)[_0xe6b1('0x16')](_0x11958c+_0xe6b1('0x49'),_0x2525c6+'.'+_0x11958c)))[_0xe6b1('0x4a')]();}function insertCmHopperAdditionalPhones(_0x1e2b18){var _0x433942=[_0xe6b1('0x4b'),'cm_contact_has_items.item',_0xe6b1('0x4c'),_0xe6b1('0x4d'),'cm_contact_has_items.updatedAt'];return squel[_0xe6b1('0x33')]()[_0xe6b1('0x44')](_0xe6b1('0x4e'))[_0xe6b1('0x35')]([_0xe6b1('0x4f'),'phone',_0xe6b1('0x50'),_0xe6b1('0x38'),_0xe6b1('0x46')],squel['select']()[_0xe6b1('0x47')](_0x433942)[_0xe6b1('0x13')](_0xe6b1('0x34'))[_0xe6b1('0x14')](_0xe6b1('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xe6b1('0x14')](_0xe6b1('0x51'),null,_0xe6b1('0x52'))[_0xe6b1('0x16')](_0xe6b1('0x53'),_0x1e2b18)[_0xe6b1('0x16')](_0xe6b1('0x40'),NOW))['toString']();}function insertCmContact(_0x119cef,_0x2671c0,_0x2e893c,_0x49b44c){var _0x290b47=_['concat'](_[_0xe6b1('0x54')](_0x49b44c),[_0xe6b1('0x37'),_0xe6b1('0x55'),_0xe6b1('0x38'),_0xe6b1('0x46')]);return squel[_0xe6b1('0x33')]()[_0xe6b1('0x44')](_0xe6b1('0x3c'))['fromQuery'](_0x290b47,squel[_0xe6b1('0x11')]()[_0xe6b1('0x47')](_0x290b47)[_0xe6b1('0x13')](_0x2671c0)[_0xe6b1('0x16')]('('+_0x2e893c[_0xe6b1('0x14')](',')+_0xe6b1('0x56'),squel[_0xe6b1('0x11')]()[_0xe6b1('0x47')](_0x2e893c)['from'](_0xe6b1('0x3c'))[_0xe6b1('0x16')](_0xe6b1('0x48'),_0x119cef))[_0xe6b1('0x16')](_0xe6b1('0x57'),squel[_0xe6b1('0x11')]()[_0xe6b1('0x58')](_0xe6b1('0x59'),_0xe6b1('0x5a'))['from'](_0x2671c0)[_0xe6b1('0x5b')](_0x2e893c[_0xe6b1('0x14')](','))))[_0xe6b1('0x4a')]();}function handleStop(){logger[_0xe6b1('0x5c')](_0xe6b1('0x5d'));stopped=!![];}function handleUncaughtException(_0x90a410){logger[_0xe6b1('0x5e')](_0x90a410['message']);process[_0xe6b1('0x5f')](0x1);}function handleError(_0x18fcc8,_0x2bdb45){stats[_0xe6b1('0x60')][_0xe6b1('0x1c')]({'name':_0x2bdb45[_0xe6b1('0x61')],'message':_0x2bdb45[_0xe6b1('0x62')],'row':_0x18fcc8});}function handleQuery(_0x505452){logger['info'](_0x505452);return db[_0xe6b1('0x19')][_0xe6b1('0x63')](_0x505452)[_0xe6b1('0x64')](function(_0x54e0b3){results[_0xe6b1('0x1c')](_0x54e0b3);})[_0xe6b1('0x1f')](function(_0x5bdab8){logger['error'](_0x5bdab8[_0xe6b1('0x62')]);});}function main(_0x38803f,_0x360833,_0x165b12,_0x8888b){logger['info'](_0xe6b1('0x65'),_0x38803f,JSON['stringify'](_0x360833));process['send'](_0xe6b1('0x66'));var _0x28f179=_0x360833[_0xe6b1('0x67')];var _0x5937c0=_[_0xe6b1('0x68')](_0x28f179);var _0xd11d3d=_0x360833[_0xe6b1('0x69')];var _0x105c27=path[_0xe6b1('0x14')](config[_0xe6b1('0x6a')],_0xe6b1('0x6b'),_0xd11d3d+_0xe6b1('0x6c'));logger['info'](_0xe6b1('0x6d'),_0x360833);db['ContactItemType'][_0xe6b1('0x6e')]({'raw':!![],'attributes':['id',_0xe6b1('0x6f')]})[_0xe6b1('0x1e')](function(_0x232c88){for(var _0x5345d4=0x0;_0x5345d4<_0x232c88['length'];_0x5345d4++){if(_0x232c88[_0x5345d4][_0xe6b1('0x6f')]in _0x28f179){contactItemTypes['push'](_0x232c88[_0x5345d4]);delete _0x5937c0[_0x232c88[_0x5345d4]['name']];hasAdditionalPhones=!![];}for(var _0x5d2e2b in _0x28f179){if(_0x232c88[_0x5345d4][_0xe6b1('0x6f')]+'_description'===_0x5d2e2b){phoneDescriptions[_0xe6b1('0x1c')]({'itemTypeId':_0x232c88[_0x5345d4]['id'],'description':_0x5d2e2b});delete _0x5937c0[_0x5d2e2b];}}}if(hasAdditionalPhones)_0x5937c0[_0xe6b1('0x20')]='';var _0x35f164=_[_0xe6b1('0x54')](_0x5937c0)['join']();logger[_0xe6b1('0x5c')](_0xe6b1('0x70'),_0x35f164);fs[_0xe6b1('0x71')](_0x105c27,_0x35f164+'\x0a');Papa[_0xe6b1('0x72')](fs[_0xe6b1('0x73')](_0x38803f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x12ef99,_0x1ddfa3){try{for(var _0x1d460f=0x0,_0x2022d4=[];_0x1d460f<_0x12ef99[_0xe6b1('0x74')]['length'];_0x1d460f++){stats[_0xe6b1('0x75')]+=0x1;if(_0x12ef99[_0xe6b1('0x60')][_0x1d460f]){handleError(_0x12ef99[_0xe6b1('0x74')][_0x1d460f],_0x12ef99[_0xe6b1('0x60')][_0x1d460f]);}else{var _0x25be40=[];var _0x25ced9=[];var _0x5530f9={};for(var _0x58d53a in _0x28f179){let _0x158005=contactItemTypes['find'](_0x2bd8a9=>_0x2bd8a9[_0xe6b1('0x6f')]===_0x58d53a);let _0x4d712e=contactItemTypes['find'](_0x2e0c1e=>_0x2e0c1e[_0xe6b1('0x6f')]+_0xe6b1('0x76')===_0x58d53a);if(_['isNil'](_0x158005)&&_[_0xe6b1('0x1b')](_0x4d712e)){if(_0x28f179[_0xe6b1('0x77')](_0x58d53a)){if(_0x12ef99['data'][_0x1d460f][_0x28f179[_0x58d53a]]){var _0x261bc8=_[_0xe6b1('0x78')](_0x12ef99[_0xe6b1('0x74')][_0x1d460f][_0x28f179[_0x58d53a]][_0xe6b1('0x79')](/"/g,'\x27'));switch(_0x58d53a){case _0xe6b1('0x36'):var _0x19a2e5=moment(_0x261bc8,_0xe6b1('0x7a'),!![]);if(_0x19a2e5[_0xe6b1('0x7b')]()){_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x261bc8+'\x22');}else{_0x25be40[_0xe6b1('0x1c')](_0xe6b1('0x7c'));}break;case _0xe6b1('0x39'):var _0x5ce2e7=parseInt(_0x261bc8);_0x261bc8=_['isNaN'](_0x5ce2e7)||_0x5ce2e7<0x0||_0x5ce2e7>0x4?_0x8888b?0x3:0x2:_0x5ce2e7;_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x261bc8+'\x22');break;case'UserId':var _0x1cff09=parseInt(_0x261bc8);if(_['isNumber'](_0x1cff09)&&_[_0xe6b1('0x7d')](_0x165b12,_0x1cff09)){_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x1cff09+'\x22');}else{_0x25be40[_0xe6b1('0x1c')]('agent\x20not\x20exists');}break;case _0xe6b1('0x7e'):if(isEmail(_0x261bc8)){_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x261bc8+'\x22');}else{_0x25be40['push']('email\x20wrong\x20format');}break;case _0xe6b1('0x7f'):var _0x53ae57=moment(_0x261bc8,'YYYY-MM-DD',!![]);if(_0x53ae57[_0xe6b1('0x7b')]()){_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x261bc8+'\x22');}else{_0x25be40[_0xe6b1('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2022d4[_0xe6b1('0x1c')]('\x22'+_0x261bc8+'\x22');}}else{switch(_0x58d53a){case _0xe6b1('0x80'):case _0xe6b1('0x12'):_0x25be40[_0xe6b1('0x1c')](_0x58d53a+'\x20not\x20specified');break;default:_0x2022d4[_0xe6b1('0x1c')]('\x22\x22');}}}}else{var _0x212d67='';if(!_['isNil'](_0x158005)){if(!_0x5530f9[_0xe6b1('0x77')](_0x158005['id'])){for(var _0xb728ab=0x0;_0xb728ab<_0x28f179[_0x58d53a][_0xe6b1('0x1a')];_0xb728ab++){var _0x261bc8=_[_0xe6b1('0x78')](_0x12ef99[_0xe6b1('0x74')][_0x1d460f][_0x28f179[_0x58d53a][_0xb728ab]]['replace'](/"/g,'\x27'));var _0x442a1b=phoneDescriptions[_0xe6b1('0x81')](_0x5b8c6b=>_0x5b8c6b[_0xe6b1('0x82')]===_0x158005['id']);if(!_[_0xe6b1('0x1b')](_0x442a1b)){var _0x268aed=_[_0xe6b1('0x78')](_0x12ef99[_0xe6b1('0x74')][_0x1d460f][_0x28f179[_0x442a1b[_0xe6b1('0x83')]][0x0]][_0xe6b1('0x79')](/"/g,'\x27'));if(!_[_0xe6b1('0x1b')](_0x268aed))_0x261bc8=_0x261bc8+'§'+_0x268aed;}if(_0x212d67=='')_0x212d67=_0x261bc8;else _0x212d67+='|'+_0x261bc8;}_0x25ced9['push'](_0x158005['id']+':'+_0x212d67);_0x5530f9[_0x158005['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2022d4['push']('\x22'+_0x25ced9['join'](';')+'\x22');}if(_0x25be40[_0xe6b1('0x1a')]){handleError(_0x12ef99[_0xe6b1('0x74')][_0x1d460f],{'code':_0xe6b1('0x84'),'message':_0x25be40[_0xe6b1('0x14')]()});}else{fs[_0xe6b1('0x85')](_0x105c27,_0x2022d4[_0xe6b1('0x14')]()+'\x0a');}_0x2022d4=[];}if(!(stats[_0xe6b1('0x75')]%0xc8)){socket[_0xe6b1('0x86')](_0xe6b1('0x87')+_0xd11d3d,stats);stats[_0xe6b1('0x60')]=[];}}if(stopped){logger[_0xe6b1('0x5c')](_0xe6b1('0x88'));_0x1ddfa3['abort']();}}catch(_0x1ea8f1){handleError(_0x12ef99['data'][_0x1d460f],{'code':_0xe6b1('0x89'),'message':_0x1ea8f1[_0xe6b1('0x62')]});logger[_0xe6b1('0x5e')]('step',_0x1ea8f1[_0xe6b1('0x62')]);}},'complete':function(){try{var _0x4f79e5=[];var _0x29305d=tempTableName;_0x4f79e5[_0xe6b1('0x1c')](_0xe6b1('0x8a')+_0x29305d+_0xe6b1('0x8b'));logger[_0xe6b1('0x5c')](_0xe6b1('0x8c'),contactItemTypes[_0xe6b1('0x1a')]);var _0x28f930=util[_0xe6b1('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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x105c27,_0x29305d,_0x35f164,_0x360833[_0xe6b1('0x37')],_0x360833[_0xe6b1('0x55')]||null,NOW,NOW);if(_[_0xe6b1('0x1b')](_0x28f179[_0xe6b1('0x36')])){_0x28f930+=_0xe6b1('0x8d');}_0x4f79e5[_0xe6b1('0x1c')](_0x28f930);BPromise[_0xe6b1('0x8e')](_0x4f79e5,handleQuery)[_0xe6b1('0x1e')](function(_0x55ac3a){BPromise[_0xe6b1('0x1d')]([handleAdditionalPhones()])[_0xe6b1('0x1e')](function(){_0x4f79e5=[];for(var _0x21f16c=0x0;_0x21f16c<promisesContact[_0xe6b1('0x1a')];_0x21f16c++){_0x4f79e5[_0xe6b1('0x1c')](updateContact(promisesContact[_0x21f16c][_0xe6b1('0x8f')]));}BPromise[_0xe6b1('0x1d')](_0x4f79e5)['then'](function(){_0x4f79e5=[];for(var _0x91e587=0x0;_0x91e587<promisesAdditionalPhones[_0xe6b1('0x1a')];_0x91e587++){_0x4f79e5[_0xe6b1('0x1c')](createAdditionalPhone(promisesAdditionalPhones[_0x91e587]['contactId'],promisesAdditionalPhones[_0x91e587]['contactTypeId'],promisesAdditionalPhones[_0x91e587]['phone'],promisesAdditionalPhones[_0x91e587]['orderBy']));}BPromise[_0xe6b1('0x1d')](_0x4f79e5)[_0xe6b1('0x1e')](function(){_0x4f79e5=[];_0x4f79e5[_0xe6b1('0x1c')](insertCmHopperAdditionalPhones(_0x360833['ListId']));_0x4f79e5['push'](_0xe6b1('0x90')+_0x29305d+';');BPromise['each'](_0x4f79e5,handleQuery)[_0xe6b1('0x1e')](function(_0x220511){stats['finish']=!![];stats['affectedRows']=updatedRows;socket[_0xe6b1('0x86')](_0xe6b1('0x87')+_0xd11d3d,stats);fs[_0xe6b1('0x91')](_0x38803f);fs[_0xe6b1('0x91')](_0x105c27);process[_0xe6b1('0x5f')](0x0);})[_0xe6b1('0x1f')](function(_0x2fe1a7){logger[_0xe6b1('0x5e')](_0x2fe1a7[_0xe6b1('0x62')]);process[_0xe6b1('0x5f')](0x1);});});});});})[_0xe6b1('0x1f')](function(_0x396259){logger['error'](_0x396259[_0xe6b1('0x62')]);process[_0xe6b1('0x5f')](0x1);});}catch(_0x3e39fa){logger[_0xe6b1('0x5e')]('complete',_0x3e39fa[_0xe6b1('0x62')]);process['exit'](0x1);}},'error':function(_0x4c8e55,_0x44eac6,_0x399d33,_0x4adbc0){throw new Error(_0x4adbc0);}});});}function validate(){if(process['argv']&&process[_0xe6b1('0x92')][_0xe6b1('0x1a')]<0x4){throw new Error(_0xe6b1('0x93'));}var _0xde7f3d=path[_0xe6b1('0x14')](config['root'],'server/files/tmp',process[_0xe6b1('0x92')][0x2]);if(!fs['existsSync'](_0xde7f3d)){throw new Error(_0xe6b1('0x94'));}var _0x18cd66={};try{_0x18cd66=JSON[_0xe6b1('0x72')](process['argv'][0x3]);if(!_0x18cd66[_0xe6b1('0x67')]){throw new Error(_0xe6b1('0x95'));}var _0x5e7c0e=0x0;if(_0x18cd66[_0xe6b1('0x67')]['UserId']){_0x5e7c0e=0x1;}if(!_0x18cd66['ListId']){throw new Error(_0xe6b1('0x96'));}}catch(_0x36c1a3){throw new Error(_0xe6b1('0x97'));}var _0x46b9f9=[];try{_0x46b9f9=_[_0xe6b1('0x98')](JSON[_0xe6b1('0x72')](process['argv'][0x4]),'id');}catch(_0x379b98){logger[_0xe6b1('0x5c')](_0xe6b1('0x99'));}main(_0xde7f3d,_0x18cd66,_0x46b9f9,_0x5e7c0e);}validate();process['on'](_0xe6b1('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 370b14c..ce041e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b9f=['push','variable','queue','outbound','string','Outbound\x20Call','destcalleridnum','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','***\x20Time\x20Info\x20***','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','voice'];(function(_0x50d5ae,_0x22a349){var _0x1e8d74=function(_0xd256a9){while(--_0xd256a9){_0x50d5ae['push'](_0x50d5ae['shift']());}};_0x1e8d74(++_0x22a349);}(_0x3b9f,0x13d));var _0xf3b9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3b9f[_0x19950b];return _0x3c6b41;};'use strict';exports['getSubjects']=function(_0x35a43f,_0x1bd99a){var _0x223c06=[{'type':'string','content':_0xf3b9('0x0'),'variableName':null}];switch(_0x35a43f[_0xf3b9('0x1')]()){case _0xf3b9('0x2'):switch(_0x1bd99a[_0xf3b9('0x1')]()){case'inbound':_0x223c06[_0xf3b9('0x3')]({'type':_0xf3b9('0x4'),'content':'','variableName':_0xf3b9('0x5')});_0x223c06['push']({'type':_0xf3b9('0x4'),'content':'','variableName':'calleridnum'});break;case _0xf3b9('0x6'):_0x223c06['push']({'type':_0xf3b9('0x7'),'content':_0xf3b9('0x8'),'variableName':null});_0x223c06['push']({'type':_0xf3b9('0x4'),'content':'','variableName':_0xf3b9('0x9')});break;}}return _0x223c06;};exports['getDescriptions']=function(_0x45676c,_0x3ffeac){var _0x5e6fbb=[];switch(_0x45676c[_0xf3b9('0x1')]()){case _0xf3b9('0x2'):switch(_0x3ffeac[_0xf3b9('0x1')]()){case _0xf3b9('0xa'):_0x5e6fbb=[{'type':_0xf3b9('0x7'),'content':_0xf3b9('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0xd'),'keyType':_0xf3b9('0x4'),'variableName':'calleridnum'},{'type':_0xf3b9('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0xe')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0xf'),'keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x10')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x11'),'keyType':_0xf3b9('0x4'),'variableName':'queue'},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x12'),'keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x13')},{'type':_0xf3b9('0xc'),'content':'','key':'Date','keyType':_0xf3b9('0x4'),'variableName':'agentcalledAt'},{'type':_0xf3b9('0x7'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf3b9('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xf3b9('0x14'),'keyType':'variable','variableName':_0xf3b9('0x9')},{'type':_0xf3b9('0x7'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x15'),'keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x16')},{'type':'keyValue','content':'','key':_0xf3b9('0x17'),'keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x18')},{'type':_0xf3b9('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x19')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x1a'),'keyType':_0xf3b9('0x4'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0xf3b9('0x1b'),'keyType':_0xf3b9('0x4'),'variableName':_0xf3b9('0x1c')}];break;case'outbound':_0x5e6fbb=[{'type':'string','content':_0xf3b9('0xb'),'variableName':null},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x1d'),'keyType':'variable','keyContent':'','variableName':_0xf3b9('0x9')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x1e'),'keyType':_0xf3b9('0x4'),'keyContent':'','variableName':_0xf3b9('0x1f')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x12'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x20'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xf3b9('0x7'),'content':_0xf3b9('0x21')},{'type':_0xf3b9('0xc'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xf3b9('0x22')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x23'),'keyType':_0xf3b9('0x4'),'keyContent':'','variableName':_0xf3b9('0x24')},{'type':_0xf3b9('0xc'),'content':'','key':'Duration','keyType':_0xf3b9('0x4'),'keyContent':'','variableName':_0xf3b9('0x25')},{'type':_0xf3b9('0xc'),'content':'','key':_0xf3b9('0x26'),'keyType':_0xf3b9('0x4'),'keyContent':'','variableName':_0xf3b9('0x27')}];break;}}return _0x5e6fbb;};
\ No newline at end of file
+var _0x92eb=['agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','calleridnum','Outbound\x20Call','push','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','uniqueid','Date'];(function(_0x2d2669,_0x3f4767){var _0x587509=function(_0x342b6e){while(--_0x342b6e){_0x2d2669['push'](_0x2d2669['shift']());}};_0x587509(++_0x3f4767);}(_0x92eb,0xa5));var _0xb92e=function(_0x44b2c8,_0x397f1c){_0x44b2c8=_0x44b2c8-0x0;var _0x308980=_0x92eb[_0x44b2c8];return _0x308980;};'use strict';exports[_0xb92e('0x0')]=function(_0x10afaf,_0x451de9){var _0x6f7470=[{'type':_0xb92e('0x1'),'content':_0xb92e('0x2'),'variableName':null}];switch(_0x10afaf[_0xb92e('0x3')]()){case _0xb92e('0x4'):switch(_0x451de9[_0xb92e('0x3')]()){case _0xb92e('0x5'):_0x6f7470['push']({'type':'variable','content':'','variableName':'queue'});_0x6f7470['push']({'type':_0xb92e('0x6'),'content':'','variableName':_0xb92e('0x7')});break;case'outbound':_0x6f7470['push']({'type':_0xb92e('0x1'),'content':_0xb92e('0x8'),'variableName':null});_0x6f7470[_0xb92e('0x9')]({'type':_0xb92e('0x6'),'content':'','variableName':_0xb92e('0xa')});break;}}return _0x6f7470;};exports[_0xb92e('0xb')]=function(_0xb44902,_0x10fedb){var _0x22a794=[];switch(_0xb44902[_0xb92e('0x3')]()){case'voice':switch(_0x10fedb['toLowerCase']()){case _0xb92e('0x5'):_0x22a794=[{'type':_0xb92e('0x1'),'content':_0xb92e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0xe'),'keyType':_0xb92e('0x6'),'variableName':'calleridnum'},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0xf'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x10')},{'type':'keyValue','content':'','key':_0xb92e('0x11'),'keyType':'variable','variableName':_0xb92e('0x12')},{'type':'keyValue','content':'','key':_0xb92e('0x13'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x14')},{'type':_0xb92e('0xd'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0xb92e('0x15')},{'type':'keyValue','content':'','key':_0xb92e('0x16'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x17')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb92e('0x18'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x19')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x1a'),'keyType':_0xb92e('0x6'),'variableName':'destcalleridnum'},{'type':_0xb92e('0x1'),'content':_0xb92e('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb92e('0x1c'),'keyType':_0xb92e('0x6'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0xb92e('0x1d'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x1e')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x1f'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x20')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x21'),'keyType':_0xb92e('0x6'),'variableName':_0xb92e('0x22')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x23'),'keyType':'variable','variableName':_0xb92e('0x24')}];break;case _0xb92e('0x25'):_0x22a794=[{'type':_0xb92e('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x26'),'keyType':_0xb92e('0x6'),'keyContent':'','variableName':_0xb92e('0xa')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x27'),'keyType':'variable','keyContent':'','variableName':_0xb92e('0x28')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x29'),'keyType':_0xb92e('0x6'),'keyContent':'','variableName':_0xb92e('0x15')},{'type':_0xb92e('0xd'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xb92e('0x2a')},{'type':'string','content':_0xb92e('0x1b')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xb92e('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xb92e('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xb92e('0x6'),'keyContent':'','variableName':_0xb92e('0x2b')},{'type':_0xb92e('0xd'),'content':'','key':_0xb92e('0x2c'),'keyType':_0xb92e('0x6'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xb92e('0x2d'),'keyType':'variable','keyContent':'','variableName':_0xb92e('0x2e')}];break;}}return _0x22a794;};
\ No newline at end of file
index fdbd9dd..005b6e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5cd=['tag','countFilteredInteractions','length','count','clause','order','forEach','contactName','closed','getClosedOrderClause','getFilteredInteractions','catch','query','clone','body','omit','html','phone','fax','updateUser','lodash','./sql-utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','contact','where','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids'];(function(_0x48ba90,_0x5bdbb2){var _0x35679b=function(_0xc98da8){while(--_0xc98da8){_0x48ba90['push'](_0x48ba90['shift']());}};_0x35679b(++_0x5bdbb2);}(_0xb5cd,0x1b8));var _0xdb5c=function(_0x58503e,_0xe16afc){_0x58503e=_0x58503e-0x0;var _0x4fdffa=_0xb5cd[_0x58503e];return _0x4fdffa;};'use strict';var _=require(_0xdb5c('0x0'));var sqlUtils=require(_0xdb5c('0x1'));var utils=require('./utils');exports[_0xdb5c('0x2')]=function(_0x25e521,_0x5eb1a6,_0x184969,_0x4530f3,_0xd8bf1a){var _0x56b152={'count':0x0,'rows':[]};var _0x24a072=sqlUtils[_0xdb5c('0x3')](_0x25e521,_0x184969,_0x5eb1a6);if(_0x24a072){return Promise[_0xdb5c('0x4')](_0x56b152);}var _0x1eb5e5=sqlUtils[_0xdb5c('0x5')](_0x25e521);var _0x2b221c={};return Promise[_0xdb5c('0x4')]()[_0xdb5c('0x6')](function(){if(_0x5eb1a6[_0xdb5c('0x7')]){return sqlUtils[_0xdb5c('0x8')](_0x5eb1a6[_0xdb5c('0x7')],_0xd8bf1a);}else{return sqlUtils['parseQueryParameters'](_0x25e521,_0x5eb1a6,_0xd8bf1a);}})['then'](function(_0x2c5864){_0x1eb5e5['where'](_0x2c5864['body']);_0x1eb5e5['where'](_0x2c5864[_0xdb5c('0x9')]);_0x1eb5e5[_0xdb5c('0xa')](_0x2c5864[_0xdb5c('0xb')]);_0x1eb5e5[_0xdb5c('0xa')](_0x2c5864[_0xdb5c('0xc')]);_0x1eb5e5[_0xdb5c('0xa')](_0x2c5864[_0xdb5c('0xd')]);_0x1eb5e5[_0xdb5c('0xa')](_0x2c5864[_0xdb5c('0xe')]);_0x1eb5e5[_0xdb5c('0xf')](_0x2c5864[_0xdb5c('0x10')]);_0x2b221c=_0x2c5864[_0xdb5c('0x11')];return sqlUtils[_0xdb5c('0x12')](_0x25e521,_0x184969,_0x5eb1a6);})[_0xdb5c('0x6')](function(_0x11f1c4){_0x1eb5e5[_0xdb5c('0xa')](_0x11f1c4);_0x1eb5e5[_0xdb5c('0x13')](_0xdb5c('0x14'));var _0x130564=_0x5eb1a6['search']?_0x2b221c[_0xdb5c('0x15')]:_0x5eb1a6[_0xdb5c('0x16')];return sqlUtils[_0xdb5c('0x17')](_0x1eb5e5,_0x130564);})['then'](function(_0x40b6f8){_0x56b152['count']=_0x40b6f8[_0xdb5c('0x18')];if(_0x56b152[_0xdb5c('0x19')]===0x0){return[];}_0x1eb5e5[_0xdb5c('0xf')](_0x2b221c[_0xdb5c('0x1a')]);if(_0x4530f3[_0xdb5c('0x1b')]){_0x4530f3[_0xdb5c('0x1b')][_0xdb5c('0x1c')](function(_0x2af495){var _0x46bbf7=_0x2af495[0x0]===_0xdb5c('0x1d')?_0x2af495[0x0]:'i.'+_0x2af495[0x0];_0x1eb5e5[_0xdb5c('0x1b')](_0x46bbf7,_0x2af495[0x1]==='DESC'?![]:!![]);if(_0x2af495[0x0]===_0xdb5c('0x1e')){var _0x507fc2=sqlUtils[_0xdb5c('0x1f')](_0x25e521,_0x5eb1a6);_0x1eb5e5['order'](_0x507fc2,_0x2af495[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0xdb5c('0x20')](_0x25e521,_0x1eb5e5,_0x5eb1a6,_0x4530f3);})[_0xdb5c('0x6')](function(_0x827149){_0x56b152['rows']=_0x827149;return _0x56b152;})[_0xdb5c('0x21')](function(_0x385596){throw _0x385596;});};exports['tracked']=function(_0x94985f,_0x4ce2c3){return function(_0x428ef7,_0x1e5146,_0x2878b5){var _0xb8ca18=_0x428ef7[_0xdb5c('0xe')];var _0x369192={};var _0x4db27e=_0x428ef7[_0xdb5c('0x22')];if(_0x369192){_0x369192=_[_0xdb5c('0x23')](_0x428ef7[_0xdb5c('0x24')]);_0x369192=_[_0xdb5c('0x25')](_0x369192,[_0xdb5c('0x24'),_0xdb5c('0x26'),_0xdb5c('0x27'),_0xdb5c('0x28'),'mobile']);}utils[_0xdb5c('0x29')](_0xb8ca18,_0x369192,_0x4db27e,_0x94985f,_0x4ce2c3);_0x2878b5(null);};};
\ No newline at end of file
+var _0x1e3b=['i.id','tag','countFilteredInteractions','count','length','having','clause','order','contactName','DESC','closed','getFilteredInteractions','catch','tracked','query','clone','body','omit','html','phone','fax','mobile','lodash','./sql-utils','./utils','findAll','getInteractionsQuery','parseAdvancedSearchFilter','search','then','where','contact','default','fields','filter','user','read','group'];(function(_0x1b6b9b,_0x128fbf){var _0x11ea96=function(_0x2a344a){while(--_0x2a344a){_0x1b6b9b['push'](_0x1b6b9b['shift']());}};_0x11ea96(++_0x128fbf);}(_0x1e3b,0xd4));var _0xb1e3=function(_0x13036c,_0x45ddc3){_0x13036c=_0x13036c-0x0;var _0x557116=_0x1e3b[_0x13036c];return _0x557116;};'use strict';var _=require(_0xb1e3('0x0'));var sqlUtils=require(_0xb1e3('0x1'));var utils=require(_0xb1e3('0x2'));exports[_0xb1e3('0x3')]=function(_0x502eb0,_0x3a52d8,_0x4ea3f1,_0x476423,_0xf0b3bb){var _0x22bc51={'count':0x0,'rows':[]};var _0x205315=sqlUtils['skipInteractionsQuery'](_0x502eb0,_0x4ea3f1,_0x3a52d8);if(_0x205315){return Promise['resolve'](_0x22bc51);}var _0x3e9e2d=sqlUtils[_0xb1e3('0x4')](_0x502eb0);var _0x173d00={};return Promise['resolve']()['then'](function(){if(_0x3a52d8['search']){return sqlUtils[_0xb1e3('0x5')](_0x3a52d8[_0xb1e3('0x6')],_0xf0b3bb);}else{return sqlUtils['parseQueryParameters'](_0x502eb0,_0x3a52d8,_0xf0b3bb);}})[_0xb1e3('0x7')](function(_0x538cdd){_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd['body']);_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd[_0xb1e3('0x9')]);_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd[_0xb1e3('0xa')]);_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd[_0xb1e3('0xb')]);_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd[_0xb1e3('0xc')]);_0x3e9e2d[_0xb1e3('0x8')](_0x538cdd[_0xb1e3('0xd')]);_0x3e9e2d['having'](_0x538cdd[_0xb1e3('0xe')]);_0x173d00=_0x538cdd['tags'];return sqlUtils['checkAccountsRestrictions'](_0x502eb0,_0x4ea3f1,_0x3a52d8);})['then'](function(_0x513b25){_0x3e9e2d[_0xb1e3('0x8')](_0x513b25);_0x3e9e2d[_0xb1e3('0xf')](_0xb1e3('0x10'));var _0x3f21bd=_0x3a52d8[_0xb1e3('0x6')]?_0x173d00['ids']:_0x3a52d8[_0xb1e3('0x11')];return sqlUtils[_0xb1e3('0x12')](_0x3e9e2d,_0x3f21bd);})[_0xb1e3('0x7')](function(_0x36aa19){_0x22bc51[_0xb1e3('0x13')]=_0x36aa19[_0xb1e3('0x14')];if(_0x22bc51[_0xb1e3('0x13')]===0x0){return[];}_0x3e9e2d[_0xb1e3('0x15')](_0x173d00[_0xb1e3('0x16')]);if(_0x476423[_0xb1e3('0x17')]){_0x476423[_0xb1e3('0x17')]['forEach'](function(_0x494e30){var _0x5636d2=_0x494e30[0x0]===_0xb1e3('0x18')?_0x494e30[0x0]:'i.'+_0x494e30[0x0];_0x3e9e2d[_0xb1e3('0x17')](_0x5636d2,_0x494e30[0x1]===_0xb1e3('0x19')?![]:!![]);if(_0x494e30[0x0]===_0xb1e3('0x1a')){var _0x167b94=sqlUtils['getClosedOrderClause'](_0x502eb0,_0x3a52d8);_0x3e9e2d[_0xb1e3('0x17')](_0x167b94,_0x494e30[0x1]===_0xb1e3('0x19')?![]:!![]);}});}return sqlUtils[_0xb1e3('0x1b')](_0x502eb0,_0x3e9e2d,_0x3a52d8,_0x476423);})['then'](function(_0x1df509){_0x22bc51['rows']=_0x1df509;return _0x22bc51;})[_0xb1e3('0x1c')](function(_0x1ba843){throw _0x1ba843;});};exports[_0xb1e3('0x1d')]=function(_0x4ad938,_0x5424d5){return function(_0x54c764,_0x58983b,_0x110ab0){var _0x38897a=_0x54c764[_0xb1e3('0xd')];var _0x1bc5a0={};var _0x33a91c=_0x54c764[_0xb1e3('0x1e')];if(_0x1bc5a0){_0x1bc5a0=_[_0xb1e3('0x1f')](_0x54c764[_0xb1e3('0x20')]);_0x1bc5a0=_[_0xb1e3('0x21')](_0x1bc5a0,[_0xb1e3('0x20'),_0xb1e3('0x22'),_0xb1e3('0x23'),_0xb1e3('0x24'),_0xb1e3('0x25')]);}utils['updateUser'](_0x38897a,_0x1bc5a0,_0x33a91c,_0x4ad938,_0x5424d5);_0x110ab0(null);};};
\ No newline at end of file
index a68ff0b..43db2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','then','fields','tag','filter','getAccountFK','get','chat','Websites','Accounts','resolve','search','i.thirdDisposition','i.disposition','unshift','i.substatus','shift','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.email','Account.email','contactName','i.id','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','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','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','limit','offset','Setting','findOne','enableEmailPreview','all','COUNT(*)','getSelectedTags','isEmpty','where','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./utils','role','agent','select','name','field','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','whatsapp','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','type','default','text','start','value','end','unreadMessages','read','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','contact','Tag','map','tags','clause','and','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','concat','createdAt','parse'];(function(_0x176ac9,_0x472fb4){var _0x53a3d7=function(_0x27a401){while(--_0x27a401){_0x176ac9['push'](_0x176ac9['shift']());}};_0x53a3d7(++_0x472fb4);}(_0x5b02,0xe9));var _0x25b0=function(_0x46314a,_0x89aac9){_0x46314a=_0x46314a-0x0;var _0x34d905=_0x5b02[_0x46314a];return _0x34d905;};'use strict';var _=require(_0x25b0('0x0'));var squel=require(_0x25b0('0x1'));var as=require(_0x25b0('0x2'));var qs=require(_0x25b0('0x3'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require(_0x25b0('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x3e1d20,_0x31c9c2,_0x38dc14){var _0x1928e8=![];var _0x2d84a9=utils['getAccountFK'](_0x3e1d20);if(_0x31c9c2[_0x25b0('0x5')]===_0x25b0('0x6')&&!_0x38dc14['search']&&!_0x38dc14[_0x2d84a9]){_0x1928e8=!![];}return _0x1928e8;}function getTagsQuery(){return squel[_0x25b0('0x7')]()['field']('id')['field'](_0x25b0('0x8'))[_0x25b0('0x9')](_0x25b0('0xa'))['from'](_0x25b0('0xb'));}function getUsersQuery(_0x466612,_0x135afb){var _0x250d31=utils[_0x25b0('0xc')](_0x466612);var _0x2f57af=_0x25b0('0xd')+_0x466612+_0x25b0('0xe');var _0x193c2b=squel[_0x25b0('0x7')]()[_0x25b0('0x9')](_0x25b0('0xf'))[_0x25b0('0x9')](_0x25b0('0x10'))[_0x25b0('0x9')](_0x25b0('0x11')+_0x250d31)[_0x25b0('0x12')](_0x2f57af,'ui')[_0x25b0('0x13')](_0x25b0('0x14'),'u',_0x25b0('0x15'));if(_0x135afb[_0x25b0('0x16')]>0x0){_0x193c2b['where']('ui.'+_0x250d31+_0x25b0('0x17'),_['map'](_0x135afb,'id'));}return _0x193c2b;}function getInteractionsQuery(_0xa8280a){var _0x1d009f=utils[_0x25b0('0x18')](_0xa8280a);var _0x3267b9=utils['getAccountFK'](_0xa8280a);var _0x1d850f=utils[_0x25b0('0xc')](_0xa8280a);return squel[_0x25b0('0x7')]()[_0x25b0('0x12')](_0x1d009f[_0x25b0('0x19')],'i')[_0x25b0('0x13')]('cm_contacts','c',_0x25b0('0x1a'))[_0x25b0('0x13')](_0x25b0('0x14'),'o',_0x25b0('0x1b'))[_0x25b0('0x13')](_0x1d009f[_0x25b0('0x1c')],'a',_0x25b0('0x1d')+_0x3267b9)[_0x25b0('0x13')](_0x1d009f[_0x25b0('0x1e')],'me',_0x25b0('0x1f')+_0x1d850f+_0x25b0('0x20'))[_0x25b0('0x13')](_0x1d009f['interactionsTags'],'it',_0x25b0('0x21')+_0x1d850f+_0x25b0('0x20'))['left_join'](_0x25b0('0xb'),'t',_0x25b0('0x22'));}function getSqlClauses(){var _0x3546f0={'body':squel['expr'](),'contact':squel['expr'](),'default':squel['expr'](),'fields':squel[_0x25b0('0x23')](),'filter':squel[_0x25b0('0x23')](),'read':squel[_0x25b0('0x23')](),'tags':{'clause':squel[_0x25b0('0x23')](),'ids':null},'user':squel[_0x25b0('0x23')]()};return _0x3546f0;}function parseTagParameter(_0x23b396){var _0x40268a=squel[_0x25b0('0x23')]();if(_0x23b396){var _0x22e024=utils['getSelectedTags'](_0x23b396);_0x22e024[_0x25b0('0x24')](function(_0xbfba84){_0x40268a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbfba84+',%');});}return _0x40268a;}function parseReadParameter(_0x567775){var _0x5de43d='';if(_0x567775){_0x5de43d=_0x25b0('0x25');if(_0x567775==='1'){_0x5de43d=_0x5de43d[_0x25b0('0x26')](_0x25b0('0x27'),'=');}else{_0x5de43d=_0x5de43d[_0x25b0('0x26')](_0x25b0('0x27'),'>');}}return _0x5de43d;}function parseSearchFilter(_0x3285ae,_0x12676b){var _0x227287=squel[_0x25b0('0x23')]();if(_0x12676b){var _0x285a2b=_0x12676b[_0x25b0('0x26')]('\x5c','\x5c\x5c')[_0x25b0('0x26')](/'/g,'\x27\x27');if(qs[_0x25b0('0x28')](_0x285a2b)){_0x227287['or']('i.id\x20LIKE\x20?',_0x285a2b+'%');if(['sms',_0x25b0('0x29')]['includes'](_0x3285ae)){_0x227287['or']('i.phone\x20LIKE\x20?',_0x285a2b+'%');}else if(_0x3285ae===_0x25b0('0x2a')){_0x227287['or'](_0x25b0('0x2b'),_0x285a2b+'%');}else if(_0x3285ae===_0x25b0('0x2c')){_0x227287['or'](_0x25b0('0x2d'),_0x285a2b+'%');}}else if(_0x3285ae===_0x25b0('0x2e')&&qs['isEmail'](_0x285a2b)){_0x227287['or'](_0x25b0('0x2f'),_0x285a2b+'%');}else{if(_0x3285ae===_0x25b0('0x2e')){_0x227287['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x25b0('0x30')](_0x285a2b))['or'](_0x25b0('0x31'),qs['getFullTextValue'](_0x285a2b));}else{if(_0x3285ae!==_0x25b0('0x2a')){_0x227287['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x25b0('0x30')](_0x285a2b));}_0x227287['or'](_0x25b0('0x32'),_0x285a2b+'%');}}}return _0x227287;}function parseAdvancedSearchFilter(_0x14ccc6,_0x21db1c){var _0x374bde=getSqlClauses();var _0x1587a7=as[_0x25b0('0x33')](_0x14ccc6);var _0x206186=_0x1587a7[_0x25b0('0x34')];for(var _0x4790fe=0x0;_0x4790fe<_0x1587a7[_0x25b0('0x35')][_0x25b0('0x16')];_0x4790fe++){var _0x3887e8=_0x1587a7[_0x25b0('0x35')][_0x4790fe];var _0xc6180='i';var _0x289416=_[_0x25b0('0x36')](_0x21db1c,[_0x25b0('0x8'),_0x3887e8[_0x25b0('0x9')]]);if(_0x289416){var _0x2d798b=as['buildExpression'](_0xc6180,_0x289416[_0x25b0('0x37')],_0x3887e8);_0x374bde[_0x25b0('0x38')][_0x206186](_0x2d798b[_0x25b0('0x39')],_0x2d798b['value'][_0x25b0('0x3a')],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3c')]);}else{switch(_0x3887e8[_0x25b0('0x9')]){case _0x25b0('0x3d'):var _0xa35c6a=parseReadParameter(_0x3887e8[_0x25b0('0x3b')]);_0x374bde[_0x25b0('0x3e')]['and'](_0xa35c6a);break;case'Contact':if(_0x3887e8[_0x25b0('0x3f')]===_0x25b0('0x40')){if(_0x3887e8[_0x25b0('0x3b')]['split']('\x20')[_0x25b0('0x16')]>0x1){_0x374bde['contact'][_0x206186](_0x25b0('0x41'),qs[_0x25b0('0x30')](_0x3887e8[_0x25b0('0x3b')]),null);}else{var _0x255e31='%'+_0x3887e8[_0x25b0('0x3b')]+'%';_0x374bde['contact'][_0x206186](_0x25b0('0x42'),_0x255e31,_0x255e31,_0x255e31);}}else{_0x289416=_[_0x25b0('0x36')](_0x21db1c,[_0x25b0('0x8'),_0x25b0('0x43')]);_0x3887e8[_0x25b0('0x9')]='ContactId';_0x2d798b=as[_0x25b0('0x44')](_0xc6180,_0x289416[_0x25b0('0x37')],_0x3887e8);_0x374bde[_0x25b0('0x45')][_0x206186](_0x2d798b[_0x25b0('0x39')],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3a')],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3c')]);}break;case _0x25b0('0x46'):var _0x389522=_0x3887e8[_0x25b0('0x3b')]['split'](',')[_0x25b0('0x47')](function(_0x5cb047){return Number(_0x5cb047);});var _0x11a766=parseTagParameter(_0x389522);_0x374bde[_0x25b0('0x48')][_0x25b0('0x49')][_0x25b0('0x4a')](_0x11a766);_0x374bde['tags'][_0x25b0('0x4b')]=_0x389522;break;case _0x25b0('0x4c'):if(_0x3887e8[_0x25b0('0x3f')]==='$substring'){_0x374bde[_0x25b0('0x4d')][_0x206186](_0x25b0('0x4e'),'%'+_0x3887e8[_0x25b0('0x3b')]+'%',null);}else{_0x289416=_[_0x25b0('0x36')](_0x21db1c,[_0x25b0('0x8'),_0x25b0('0x4f')]);_0x3887e8[_0x25b0('0x9')]='UserId';_0x2d798b=as[_0x25b0('0x44')](_0xc6180,_0x289416[_0x25b0('0x37')],_0x3887e8);_0x374bde[_0x25b0('0x4d')][_0x206186](_0x2d798b['text'],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3a')],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3c')]);}break;case _0x25b0('0x50'):case'plainBody':_0x2d798b=as[_0x25b0('0x44')]('me',null,_0x3887e8);_0x374bde[_0x25b0('0x50')][_0x206186](_0x2d798b[_0x25b0('0x39')],_0x2d798b['value'][_0x25b0('0x3a')],_0x2d798b[_0x25b0('0x3b')][_0x25b0('0x3c')]);break;}}}return _0x374bde;}function parseModelFields(_0x1d6d55,_0x29165e,_0x3d4531){var _0x5f19d6=utils['getAccountFK'](_0x1d6d55);var _0x526c05=squel[_0x25b0('0x23')]();var _0x4bd7ba=_(_0x29165e)['keys']()[_0x25b0('0x47')](function(_0x4eb969){return _[_0x25b0('0x51')](_0x3d4531,['name',_0x4eb969])?_0x4eb969:undefined;})['compact']()[_0x25b0('0x3b')]();if(_0x4bd7ba[_0x25b0('0x16')]>0x0){_0x4bd7ba[_0x25b0('0x24')](function(_0x34ded7){if(_0x34ded7===_0x5f19d6){_0x526c05[_0x25b0('0x4a')]('i.'+_0x5f19d6+_0x25b0('0x17'),[][_0x25b0('0x52')](_0x29165e[_0x34ded7]));}else if(_0x34ded7===_0x25b0('0x53')){var _0x2e68ad=JSON[_0x25b0('0x54')](_0x29165e[_0x34ded7])['$gte'];var _0x4d3e9e=JSON['parse'](_0x29165e[_0x34ded7])[_0x25b0('0x55')];_0x526c05[_0x25b0('0x4a')](_0x25b0('0x56'),_0x2e68ad,_0x4d3e9e);}else{if(_0x29165e[_0x34ded7]===_0x25b0('0x57')){_0x526c05[_0x25b0('0x4a')]('i.'+_0x34ded7+_0x25b0('0x58'));}else{_0x526c05[_0x25b0('0x4a')]('i.'+_0x34ded7+'\x20=\x20?',_0x29165e[_0x34ded7]);}}});}return _0x526c05;}function parseQueryParameters(_0x64ffa3,_0x4a8adc,_0x279385){var _0x5367f3=getSqlClauses();return Promise['resolve']()[_0x25b0('0x59')](function(){return parseModelFields(_0x64ffa3,_0x4a8adc,_0x279385);})['then'](function(_0x58d4ad){_0x5367f3[_0x25b0('0x5a')][_0x25b0('0x4a')](_0x58d4ad);return parseReadParameter(_0x4a8adc[_0x25b0('0x3e')]);})[_0x25b0('0x59')](function(_0xce704f){_0x5367f3[_0x25b0('0x3e')][_0x25b0('0x4a')](_0xce704f);return parseTagParameter(_0x4a8adc[_0x25b0('0x5b')]);})[_0x25b0('0x59')](function(_0xfd3b6c){_0x5367f3['tags']['clause'][_0x25b0('0x4a')](_0xfd3b6c);return parseSearchFilter(_0x64ffa3,_0x4a8adc[_0x25b0('0x5c')]);})['then'](function(_0xef5172){_0x5367f3[_0x25b0('0x5c')]=_0xef5172;return _0x5367f3;});}function checkAccountsRestrictions(_0x176a1d,_0x43ad53,_0x345349){var _0x4cce6a=utils[_0x25b0('0x5d')](_0x176a1d);var _0x2d1577=_0x25b0('0x5e')+_['capitalize'](_0x176a1d)+(_0x176a1d===_0x25b0('0x5f')?_0x25b0('0x60'):_0x25b0('0x61'));var _0x2ec034=squel[_0x25b0('0x23')]();return Promise[_0x25b0('0x62')]()[_0x25b0('0x59')](function(){if(_0x345349[_0x25b0('0x63')]&&_0x43ad53[_0x25b0('0x5')]===_0x25b0('0x6')){return _0x43ad53[_0x2d1577]({'attributes':['id'],'raw':!![]});}})[_0x25b0('0x59')](function(_0x131049){if(_0x131049){if(_0x131049[_0x25b0('0x16')]===0x0){_0x2ec034[_0x25b0('0x4a')]('i.'+_0x4cce6a+'\x20IS\x20NULL');}else{_0x2ec034[_0x25b0('0x4a')]('i.'+_0x4cce6a+_0x25b0('0x17'),_['map'](_0x131049,'id'));}}else if(!_0x345349[_0x4cce6a]){_0x2ec034[_0x25b0('0x4a')]('i.'+_0x4cce6a+'\x20IS\x20NOT\x20NULL');}})[_0x25b0('0x59')](function(){return _0x2ec034;});}function getClosedOrderClause(_0x36d918,_0x4cd91f){var _0x4513e8='';var _0xdf8455=[_0x25b0('0x64'),'i.secondDisposition',_0x25b0('0x65')];if(_0x36d918==='mail'){_0xdf8455[_0x25b0('0x66')](_0x25b0('0x67'));}if(_0x4cd91f['closed']==='0'&&_0x36d918===_0x25b0('0x2e')){_0x4513e8=_0x25b0('0x67');}else{if(_0x4cd91f['closed']==='1'){_0xdf8455[_0x25b0('0x68')]();}_0x4513e8='CONCAT_WS(\x27\x27,\x20'+_0xdf8455['join'](',\x20')+')';}return _0x4513e8;}function getFilteredInteractions(_0x5452d0,_0x2e0283,_0x9a855a,_0x2f1d4a){var _0x4ad882=utils[_0x25b0('0xc')](_0x5452d0);var _0x431482=_[_0x25b0('0x69')](_0x5452d0)+_0x25b0('0x6a');var _0x1e4c6e=[];var _0x20d974=getTagsQuery();var _0x1568f4={'type':db[_0x25b0('0x6b')][_0x25b0('0x6c')][_0x25b0('0x6d')],'raw':!![]};var _0x1fb191=[];var _0x280f61=[];return db[_0x25b0('0x6e')][_0x25b0('0x6f')](_0x20d974[_0x25b0('0x70')](),_0x1568f4)[_0x25b0('0x59')](function(_0x19fa5c){_0x1e4c6e=_['keyBy'](_0x19fa5c,'id');_0x1568f4=_[_0x25b0('0x71')](_0x1568f4,{'model':db[_0x431482],'mapToModel':!![],'nest':!![]});if(_0x9a855a['fields']){_0x2f1d4a[_0x25b0('0x72')][_0x25b0('0x24')](function(_0x3e3416){_0x2e0283[_0x25b0('0x9')]('i.'+_0x3e3416);});}else{_0x2e0283['field'](_0x25b0('0x73'),_0x25b0('0x3d'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x74'),_0x25b0('0x75'));_0x2e0283[_0x25b0('0x9')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x5452d0===_0x25b0('0x2e')){_0x2e0283['field'](_0x25b0('0x76'),_0x25b0('0x77'));_0x2e0283[_0x25b0('0x9')]('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',_0x25b0('0x78'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x79'));_0x2e0283[_0x25b0('0x9')]('i.createdAt');_0x2e0283[_0x25b0('0x9')](_0x25b0('0x7a'));_0x2e0283[_0x25b0('0x9')]('i.closed');_0x2e0283[_0x25b0('0x9')](_0x25b0('0x7b'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x7c'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x7d'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x7e'));_0x2e0283['field'](_0x25b0('0x7f'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x65'));_0x2e0283[_0x25b0('0x9')]('i.secondDisposition');_0x2e0283['field'](_0x25b0('0x64'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x67'));_0x2e0283[_0x25b0('0x9')]('i.to');_0x2e0283[_0x25b0('0x9')](_0x25b0('0x80'));_0x2e0283['field'](_0x25b0('0x81'));_0x2e0283[_0x25b0('0x9')]('i.UserId');}else if(_0x5452d0==='openchannel'){_0x2e0283[_0x25b0('0x9')](_0x25b0('0x82'),_0x25b0('0x78'));}else{_0x2e0283[_0x25b0('0x9')](_0x25b0('0x83'),_0x25b0('0x78'));}if(_0x5452d0!==_0x25b0('0x2e')){_0x2e0283[_0x25b0('0x9')](_0x25b0('0x84'));}_0x2e0283[_0x25b0('0x9')](_0x25b0('0x85'),_0x25b0('0x86'));_0x2e0283[_0x25b0('0x9')]('c.lastName',_0x25b0('0x87'));_0x2e0283['field'](_0x25b0('0x88'),_0x25b0('0x89'));_0x2e0283['field'](_0x25b0('0x8a'),_0x25b0('0x8b'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x8c'),_0x25b0('0x8d'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x8e'),_0x25b0('0x8f'));_0x2e0283[_0x25b0('0x9')](_0x25b0('0x90'),_0x25b0('0x91'));_0x2e0283['field']('o.internal',_0x25b0('0x92'));_0x2e0283[_0x25b0('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2f1d4a[_0x25b0('0x93')]){_0x2e0283['limit'](_0x2f1d4a[_0x25b0('0x93')]);}if(_0x2f1d4a[_0x25b0('0x94')]){_0x2e0283['offset'](_0x2f1d4a[_0x25b0('0x94')]);}return db[_0x25b0('0x6e')]['query'](_0x2e0283[_0x25b0('0x70')](),_0x1568f4);})[_0x25b0('0x59')](function(_0x9ee86f){_0x1fb191=_0x9ee86f;var _0x1aba93=getUsersQuery(_0x5452d0,_0x1fb191);return db[_0x25b0('0x6e')]['query'](_0x1aba93['toString'](),_0x1568f4);})[_0x25b0('0x59')](function(_0x5103c8){_0x280f61=_['groupBy'](_0x5103c8,_0x4ad882);if(_0x5452d0==='mail'){return db[_0x25b0('0x95')][_0x25b0('0x96')]({'attributes':[_0x25b0('0x97')],'raw':!![]});}})['then'](function(_0x57f494){var _0x44d743=_0x57f494?_0x57f494[_0x25b0('0x97')]:undefined;var _0x4a4daa=_0x1fb191['map'](function(_0x5470da){return updateInteraction(_0x5470da,_0x1e4c6e,_0x280f61,_0x44d743);});return Promise[_0x25b0('0x98')](_0x4a4daa);});}function countFilteredInteractions(_0x22fd35,_0x1e64de){var _0xef06e9=_0x22fd35['clone']();_0xef06e9[_0x25b0('0x9')](_0x25b0('0x99'));_0xef06e9[_0x25b0('0x9')](_0x25b0('0x73'),_0x25b0('0x3d'));var _0x19642b=utils[_0x25b0('0x9a')](_0x1e64de);if(!_[_0x25b0('0x9b')](_0x19642b)){_0xef06e9[_0x25b0('0x9c')](_0x25b0('0x9d'),_0x19642b);}var _0x11606f={'type':db[_0x25b0('0x6b')][_0x25b0('0x6c')][_0x25b0('0x6d')],'raw':!![]};return db[_0x25b0('0x6e')][_0x25b0('0x6f')](_0xef06e9[_0x25b0('0x70')](),_0x11606f);}module[_0x25b0('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x7980=['Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','role','agent','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','map','select','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','expr','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?','mail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','sqlOperator','conditions','find','buildExpression','default','value','start','read','Contact','operator','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','end','Tag','split','tags','clause','and','ids','User','$substring','UserId','user','body','plainBody','getAccountFK','keys','compact','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','resolve','fields','then','filter','get','capitalize','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','unshift','i.substatus','closed','shift','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','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.closedAt','i.attach','i.lastMsgAt','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0x7980,0xab));var _0x0798=function(_0x4d32ad,_0x2047f){_0x4d32ad=_0x4d32ad-0x0;var _0x5e3cec=_0x7980[_0x4d32ad];return _0x5e3cec;};'use strict';var _=require(_0x0798('0x0'));var squel=require(_0x0798('0x1'));var as=require(_0x0798('0x2'));var qs=require(_0x0798('0x3'));var updateInteraction=require(_0x0798('0x4'))['updateInteraction'];var utils=require(_0x0798('0x5'));var db=require(_0x0798('0x6'))['db'];function skipInteractionsQuery(_0xecc24f,_0x1637db,_0x1a1fe7){var _0x581bf3=![];var _0x22a0f0=utils['getAccountFK'](_0xecc24f);if(_0x1637db[_0x0798('0x7')]===_0x0798('0x8')&&!_0x1a1fe7[_0x0798('0x9')]&&!_0x1a1fe7[_0x22a0f0]){_0x581bf3=!![];}return _0x581bf3;}function getTagsQuery(){return squel['select']()['field']('id')[_0x0798('0xa')](_0x0798('0xb'))[_0x0798('0xa')](_0x0798('0xc'))[_0x0798('0xd')](_0x0798('0xe'));}function getUsersQuery(_0x44e8df,_0xc9b741){var _0x35bfbe=utils[_0x0798('0xf')](_0x44e8df);var _0x597e45=_0x0798('0x10')+_0x44e8df+_0x0798('0x11');var _0x587d18=squel['select']()[_0x0798('0xa')](_0x0798('0x12'))[_0x0798('0xa')](_0x0798('0x13'))[_0x0798('0xa')](_0x0798('0x14')+_0x35bfbe)[_0x0798('0xd')](_0x597e45,'ui')['left_join']('users','u',_0x0798('0x15'));if(_0xc9b741[_0x0798('0x16')]>0x0){_0x587d18['where']('ui.'+_0x35bfbe+_0x0798('0x17'),_[_0x0798('0x18')](_0xc9b741,'id'));}return _0x587d18;}function getInteractionsQuery(_0x258081){var _0x5dc617=utils['getInteractionsTables'](_0x258081);var _0x1c6d6f=utils['getAccountFK'](_0x258081);var _0x41e217=utils[_0x0798('0xf')](_0x258081);return squel[_0x0798('0x19')]()[_0x0798('0xd')](_0x5dc617['interactions'],'i')[_0x0798('0x1a')](_0x0798('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0798('0x1a')](_0x0798('0x1c'),'o',_0x0798('0x1d'))[_0x0798('0x1a')](_0x5dc617[_0x0798('0x1e')],'a',_0x0798('0x1f')+_0x1c6d6f)[_0x0798('0x1a')](_0x5dc617[_0x0798('0x20')],'me',_0x0798('0x21')+_0x41e217+'\x20=\x20i.id')[_0x0798('0x1a')](_0x5dc617[_0x0798('0x22')],'it',_0x0798('0x23')+_0x41e217+_0x0798('0x24'))[_0x0798('0x1a')](_0x0798('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x3f66e2={'body':squel[_0x0798('0x25')](),'contact':squel[_0x0798('0x25')](),'default':squel[_0x0798('0x25')](),'fields':squel[_0x0798('0x25')](),'filter':squel[_0x0798('0x25')](),'read':squel['expr'](),'tags':{'clause':squel[_0x0798('0x25')](),'ids':null},'user':squel[_0x0798('0x25')]()};return _0x3f66e2;}function parseTagParameter(_0x11e24d){var _0x4d4e0a=squel[_0x0798('0x25')]();if(_0x11e24d){var _0x5e7246=utils['getSelectedTags'](_0x11e24d);_0x5e7246[_0x0798('0x26')](function(_0x2dfbff){_0x4d4e0a['or'](_0x0798('0x27'),'%,'+_0x2dfbff+',%');});}return _0x4d4e0a;}function parseReadParameter(_0xaa949b){var _0x11b7f4='';if(_0xaa949b){_0x11b7f4=_0x0798('0x28');if(_0xaa949b==='1'){_0x11b7f4=_0x11b7f4[_0x0798('0x29')](_0x0798('0x2a'),'=');}else{_0x11b7f4=_0x11b7f4['replace'](_0x0798('0x2a'),'>');}}return _0x11b7f4;}function parseSearchFilter(_0x4f5d1d,_0x5f1780){var _0x1196c0=squel['expr']();if(_0x5f1780){var _0x1dabd5=_0x5f1780['replace']('\x5c','\x5c\x5c')[_0x0798('0x29')](/'/g,'\x27\x27');if(qs[_0x0798('0x2b')](_0x1dabd5)){_0x1196c0['or'](_0x0798('0x2c'),_0x1dabd5+'%');if([_0x0798('0x2d'),_0x0798('0x2e')][_0x0798('0x2f')](_0x4f5d1d)){_0x1196c0['or'](_0x0798('0x30'),_0x1dabd5+'%');}else if(_0x4f5d1d===_0x0798('0x31')){_0x1196c0['or'](_0x0798('0x32'),_0x1dabd5+'%');}else if(_0x4f5d1d===_0x0798('0x33')){_0x1196c0['or'](_0x0798('0x34'),_0x1dabd5+'%');}}else if(_0x4f5d1d===_0x0798('0x35')&&qs['isEmail'](_0x1dabd5)){_0x1196c0['or'](_0x0798('0x36'),_0x1dabd5+'%');}else{if(_0x4f5d1d==='mail'){_0x1196c0['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0798('0x37')](_0x1dabd5))['or'](_0x0798('0x38'),qs['getFullTextValue'](_0x1dabd5));}else{if(_0x4f5d1d!=='fax'){_0x1196c0['or'](_0x0798('0x39'),qs[_0x0798('0x37')](_0x1dabd5));}_0x1196c0['or'](_0x0798('0x3a'),_0x1dabd5+'%');}}}return _0x1196c0;}function parseAdvancedSearchFilter(_0xade271,_0xae5843){var _0x2ad922=getSqlClauses();var _0x5db6b3=as['parseSearch'](_0xade271);var _0x1db045=_0x5db6b3[_0x0798('0x3b')];for(var _0x27d9f7=0x0;_0x27d9f7<_0x5db6b3['conditions']['length'];_0x27d9f7++){var _0x533e99=_0x5db6b3[_0x0798('0x3c')][_0x27d9f7];var _0x154980='i';var _0x1194da=_[_0x0798('0x3d')](_0xae5843,[_0x0798('0xb'),_0x533e99[_0x0798('0xa')]]);if(_0x1194da){var _0x238c99=as[_0x0798('0x3e')](_0x154980,_0x1194da['type'],_0x533e99);_0x2ad922[_0x0798('0x3f')][_0x1db045](_0x238c99['text'],_0x238c99[_0x0798('0x40')][_0x0798('0x41')],_0x238c99[_0x0798('0x40')]['end']);}else{switch(_0x533e99[_0x0798('0xa')]){case'unreadMessages':var _0x3538f5=parseReadParameter(_0x533e99[_0x0798('0x40')]);_0x2ad922[_0x0798('0x42')]['and'](_0x3538f5);break;case _0x0798('0x43'):if(_0x533e99[_0x0798('0x44')]==='$substring'){if(_0x533e99[_0x0798('0x40')]['split']('\x20')['length']>0x1){_0x2ad922[_0x0798('0x45')][_0x1db045](_0x0798('0x46'),qs['getFullTextValue'](_0x533e99['value']),null);}else{var _0xa46124='%'+_0x533e99[_0x0798('0x40')]+'%';_0x2ad922[_0x0798('0x45')][_0x1db045](_0x0798('0x47'),_0xa46124,_0xa46124,_0xa46124);}}else{_0x1194da=_[_0x0798('0x3d')](_0xae5843,[_0x0798('0xb'),_0x0798('0x48')]);_0x533e99['field']=_0x0798('0x48');_0x238c99=as[_0x0798('0x3e')](_0x154980,_0x1194da[_0x0798('0x49')],_0x533e99);_0x2ad922[_0x0798('0x45')][_0x1db045](_0x238c99[_0x0798('0x4a')],_0x238c99[_0x0798('0x40')]['start'],_0x238c99[_0x0798('0x40')][_0x0798('0x4b')]);}break;case _0x0798('0x4c'):var _0x2eb3c1=_0x533e99[_0x0798('0x40')][_0x0798('0x4d')](',')[_0x0798('0x18')](function(_0x10a50a){return Number(_0x10a50a);});var _0x3f1beb=parseTagParameter(_0x2eb3c1);_0x2ad922[_0x0798('0x4e')][_0x0798('0x4f')][_0x0798('0x50')](_0x3f1beb);_0x2ad922['tags'][_0x0798('0x51')]=_0x2eb3c1;break;case _0x0798('0x52'):if(_0x533e99[_0x0798('0x44')]===_0x0798('0x53')){_0x2ad922['user'][_0x1db045]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x533e99[_0x0798('0x40')]+'%',null);}else{_0x1194da=_[_0x0798('0x3d')](_0xae5843,[_0x0798('0xb'),_0x0798('0x54')]);_0x533e99['field']=_0x0798('0x54');_0x238c99=as['buildExpression'](_0x154980,_0x1194da['type'],_0x533e99);_0x2ad922[_0x0798('0x55')][_0x1db045](_0x238c99[_0x0798('0x4a')],_0x238c99[_0x0798('0x40')][_0x0798('0x41')],_0x238c99[_0x0798('0x40')][_0x0798('0x4b')]);}break;case _0x0798('0x56'):case _0x0798('0x57'):_0x238c99=as[_0x0798('0x3e')]('me',null,_0x533e99);_0x2ad922['body'][_0x1db045](_0x238c99[_0x0798('0x4a')],_0x238c99['value'][_0x0798('0x41')],_0x238c99[_0x0798('0x40')][_0x0798('0x4b')]);break;}}}return _0x2ad922;}function parseModelFields(_0x54634d,_0x9dea1f,_0x275e6e){var _0x1a1145=utils[_0x0798('0x58')](_0x54634d);var _0x4864b9=squel[_0x0798('0x25')]();var _0x9e6db6=_(_0x9dea1f)[_0x0798('0x59')]()[_0x0798('0x18')](function(_0x374555){return _['some'](_0x275e6e,[_0x0798('0xb'),_0x374555])?_0x374555:undefined;})[_0x0798('0x5a')]()[_0x0798('0x40')]();if(_0x9e6db6[_0x0798('0x16')]>0x0){_0x9e6db6[_0x0798('0x26')](function(_0x2978d6){if(_0x2978d6===_0x1a1145){_0x4864b9[_0x0798('0x50')]('i.'+_0x1a1145+_0x0798('0x17'),[][_0x0798('0x5b')](_0x9dea1f[_0x2978d6]));}else if(_0x2978d6==='createdAt'){var _0x50aaea=JSON[_0x0798('0x5c')](_0x9dea1f[_0x2978d6])[_0x0798('0x5d')];var _0x375f11=JSON[_0x0798('0x5c')](_0x9dea1f[_0x2978d6])[_0x0798('0x5e')];_0x4864b9[_0x0798('0x50')](_0x0798('0x5f'),_0x50aaea,_0x375f11);}else{if(_0x9dea1f[_0x2978d6]==='null'){_0x4864b9[_0x0798('0x50')]('i.'+_0x2978d6+'\x20IS\x20NULL');}else{_0x4864b9[_0x0798('0x50')]('i.'+_0x2978d6+_0x0798('0x60'),_0x9dea1f[_0x2978d6]);}}});}return _0x4864b9;}function parseQueryParameters(_0x3a3cc7,_0x48a072,_0x4d16da){var _0x4fe41b=getSqlClauses();return Promise[_0x0798('0x61')]()['then'](function(){return parseModelFields(_0x3a3cc7,_0x48a072,_0x4d16da);})['then'](function(_0x35a576){_0x4fe41b[_0x0798('0x62')][_0x0798('0x50')](_0x35a576);return parseReadParameter(_0x48a072['read']);})[_0x0798('0x63')](function(_0x46532d){_0x4fe41b[_0x0798('0x42')][_0x0798('0x50')](_0x46532d);return parseTagParameter(_0x48a072['tag']);})['then'](function(_0x136a1f){_0x4fe41b[_0x0798('0x4e')][_0x0798('0x4f')]['and'](_0x136a1f);return parseSearchFilter(_0x3a3cc7,_0x48a072['filter']);})[_0x0798('0x63')](function(_0x82599){_0x4fe41b[_0x0798('0x64')]=_0x82599;return _0x4fe41b;});}function checkAccountsRestrictions(_0x190467,_0x218c56,_0xce8a72){var _0x18c0fa=utils[_0x0798('0x58')](_0x190467);var _0x4f35c7=_0x0798('0x65')+_[_0x0798('0x66')](_0x190467)+(_0x190467==='chat'?_0x0798('0x67'):_0x0798('0x68'));var _0x57ddec=squel[_0x0798('0x25')]();return Promise[_0x0798('0x61')]()[_0x0798('0x63')](function(){if(_0xce8a72[_0x0798('0x9')]&&_0x218c56[_0x0798('0x7')]==='agent'){return _0x218c56[_0x4f35c7]({'attributes':['id'],'raw':!![]});}})[_0x0798('0x63')](function(_0x3b36b5){if(_0x3b36b5){if(_0x3b36b5[_0x0798('0x16')]===0x0){_0x57ddec['and']('i.'+_0x18c0fa+_0x0798('0x69'));}else{_0x57ddec['and']('i.'+_0x18c0fa+_0x0798('0x17'),_[_0x0798('0x18')](_0x3b36b5,'id'));}}else if(!_0xce8a72[_0x18c0fa]){_0x57ddec[_0x0798('0x50')]('i.'+_0x18c0fa+_0x0798('0x6a'));}})[_0x0798('0x63')](function(){return _0x57ddec;});}function getClosedOrderClause(_0x3569e8,_0x5b90ca){var _0x3cc8bd='';var _0xae453a=[_0x0798('0x6b'),_0x0798('0x6c'),'i.disposition'];if(_0x3569e8===_0x0798('0x35')){_0xae453a[_0x0798('0x6d')](_0x0798('0x6e'));}if(_0x5b90ca[_0x0798('0x6f')]==='0'&&_0x3569e8===_0x0798('0x35')){_0x3cc8bd='i.substatus';}else{if(_0x5b90ca[_0x0798('0x6f')]==='1'){_0xae453a[_0x0798('0x70')]();}_0x3cc8bd='CONCAT_WS(\x27\x27,\x20'+_0xae453a[_0x0798('0x71')](',\x20')+')';}return _0x3cc8bd;}function getFilteredInteractions(_0x2d7c96,_0x437e1d,_0x4fcdb4,_0x2f336a){var _0x151565=utils[_0x0798('0xf')](_0x2d7c96);var _0x897ae4=_[_0x0798('0x66')](_0x2d7c96)+_0x0798('0x72');var _0x21c156=[];var _0x41b369=getTagsQuery();var _0x4a4853={'type':db[_0x0798('0x73')][_0x0798('0x74')][_0x0798('0x75')],'raw':!![]};var _0xf5100e=[];var _0x4ad8a1=[];return db[_0x0798('0x76')][_0x0798('0x77')](_0x41b369[_0x0798('0x78')](),_0x4a4853)[_0x0798('0x63')](function(_0x2e34e4){_0x21c156=_[_0x0798('0x79')](_0x2e34e4,'id');_0x4a4853=_[_0x0798('0x7a')](_0x4a4853,{'model':db[_0x897ae4],'mapToModel':!![],'nest':!![]});if(_0x4fcdb4[_0x0798('0x62')]){_0x2f336a['attributes'][_0x0798('0x26')](function(_0x4d594f){_0x437e1d[_0x0798('0xa')]('i.'+_0x4d594f);});}else{_0x437e1d[_0x0798('0xa')](_0x0798('0x7b'),'unreadMessages');_0x437e1d[_0x0798('0xa')](_0x0798('0x7c'),'Account.key');_0x437e1d[_0x0798('0xa')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x2d7c96===_0x0798('0x35')){_0x437e1d[_0x0798('0xa')](_0x0798('0x7d'),_0x0798('0x7e'));_0x437e1d['field'](_0x0798('0x7f'),_0x0798('0x80'));_0x437e1d[_0x0798('0xa')](_0x0798('0x81'));_0x437e1d[_0x0798('0xa')](_0x0798('0x82'));_0x437e1d[_0x0798('0xa')]('i.updatedAt');_0x437e1d['field']('i.closed');_0x437e1d[_0x0798('0xa')](_0x0798('0x83'));_0x437e1d[_0x0798('0xa')](_0x0798('0x84'));_0x437e1d['field'](_0x0798('0x85'));_0x437e1d[_0x0798('0xa')]('i.lastMsgDirection');_0x437e1d[_0x0798('0xa')]('i.subject');_0x437e1d[_0x0798('0xa')]('i.disposition');_0x437e1d[_0x0798('0xa')](_0x0798('0x6c'));_0x437e1d[_0x0798('0xa')](_0x0798('0x6b'));_0x437e1d[_0x0798('0xa')](_0x0798('0x6e'));_0x437e1d[_0x0798('0xa')](_0x0798('0x86'));_0x437e1d['field'](_0x0798('0x87'));_0x437e1d['field'](_0x0798('0x88'));_0x437e1d[_0x0798('0xa')]('i.UserId');}else if(_0x2d7c96===_0x0798('0x33')){_0x437e1d[_0x0798('0xa')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x0798('0x80'));}else{_0x437e1d['field'](_0x0798('0x89'),_0x0798('0x80'));}if(_0x2d7c96!==_0x0798('0x35')){_0x437e1d['field'](_0x0798('0x8a'));}_0x437e1d[_0x0798('0xa')](_0x0798('0x8b'),_0x0798('0x8c'));_0x437e1d['field'](_0x0798('0x8d'),_0x0798('0x8e'));_0x437e1d[_0x0798('0xa')](_0x0798('0x8f'),_0x0798('0x90'));_0x437e1d[_0x0798('0xa')]('c.phone','Contact.phone');_0x437e1d[_0x0798('0xa')](_0x0798('0x91'),_0x0798('0x92'));_0x437e1d[_0x0798('0xa')](_0x0798('0x93'),_0x0798('0x94'));_0x437e1d['field']('o.fullname',_0x0798('0x95'));_0x437e1d[_0x0798('0xa')]('o.internal',_0x0798('0x96'));_0x437e1d[_0x0798('0xa')](_0x0798('0x97'),_0x0798('0x98'));}if(_0x2f336a[_0x0798('0x99')]){_0x437e1d[_0x0798('0x99')](_0x2f336a['limit']);}if(_0x2f336a[_0x0798('0x9a')]){_0x437e1d[_0x0798('0x9a')](_0x2f336a[_0x0798('0x9a')]);}return db[_0x0798('0x76')][_0x0798('0x77')](_0x437e1d[_0x0798('0x78')](),_0x4a4853);})['then'](function(_0x2c68ba){_0xf5100e=_0x2c68ba;var _0x3ff179=getUsersQuery(_0x2d7c96,_0xf5100e);return db[_0x0798('0x76')][_0x0798('0x77')](_0x3ff179['toString'](),_0x4a4853);})[_0x0798('0x63')](function(_0x25f8d3){_0x4ad8a1=_['groupBy'](_0x25f8d3,_0x151565);if(_0x2d7c96===_0x0798('0x35')){return db[_0x0798('0x9b')][_0x0798('0x9c')]({'attributes':[_0x0798('0x9d')],'raw':!![]});}})[_0x0798('0x63')](function(_0x92abd7){var _0x573236=_0x92abd7?_0x92abd7[_0x0798('0x9d')]:undefined;var _0x174e5c=_0xf5100e['map'](function(_0x587b84){return updateInteraction(_0x587b84,_0x21c156,_0x4ad8a1,_0x573236);});return Promise[_0x0798('0x9e')](_0x174e5c);});}function countFilteredInteractions(_0x53394f,_0x4563b4){var _0x44b87d=_0x53394f['clone']();_0x44b87d['field'](_0x0798('0x9f'));_0x44b87d['field'](_0x0798('0x7b'),'unreadMessages');var _0x5533e6=utils['getSelectedTags'](_0x4563b4);if(!_[_0x0798('0xa0')](_0x5533e6)){_0x44b87d['where'](_0x0798('0xa1'),_0x5533e6);}var _0x2b0879={'type':db['Sequelize']['QueryTypes'][_0x0798('0x75')],'raw':!![]};return db[_0x0798('0x76')][_0x0798('0x77')](_0x44b87d[_0x0798('0x78')](),_0x2b0879);}module[_0x0798('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
index fa32689..7a971d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb4=['out','plainBody','then','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','push','waiting','talking','answered','unmanaged','abandoned','closed','UserId','disposition','MailMessage','findOne'];(function(_0x13c58e,_0x5e35e4){var _0x385019=function(_0x18f432){while(--_0x18f432){_0x13c58e['push'](_0x13c58e['shift']());}};_0x385019(++_0x5e35e4);}(_0x9bb4,0x199));var _0x49bb=function(_0x3fd002,_0x5d7289){_0x3fd002=_0x3fd002-0x0;var _0x52bee9=_0x9bb4[_0x3fd002];return _0x52bee9;};'use strict';var _=require(_0x49bb('0x0'));var db=require(_0x49bb('0x1'))['db'];function getInteractionUsers(_0x1a3d97,_0x901035){return new Promise(function(_0x5ca9ca,_0x1c1c1d){try{var _0x474520=[];if(_0x901035[_0x1a3d97]){_0x474520=_0x901035[_0x1a3d97][_0x49bb('0x2')](function(_0x15f96d){return{'id':_0x15f96d['id'],'fullname':_0x15f96d[_0x49bb('0x3')]};});}return _0x5ca9ca(_0x474520);}catch(_0x363fc5){_0x1c1c1d(_0x363fc5);}});}function getInteractionTags(_0x4774fd,_0x5db8ba){var _0x162cf0=[];if(_0x4774fd){_0x4774fd[_0x49bb('0x4')](',')['forEach'](function(_0x362ccb){_0x162cf0[_0x49bb('0x5')](_0x5db8ba[_0x362ccb]);});}return _0x162cf0;}function updateWaitingCounter(_0x3e0c8e){if(_0x3e0c8e[_0x49bb('0x6')]){_0x3e0c8e[_0x49bb('0x6')]-=0x1;}}function updateInteractionCounters(_0x129466){_0x129466[_0x49bb('0x6')]=0x0;_0x129466[_0x49bb('0x7')]=0x0;_0x129466[_0x49bb('0x8')]=0x0;_0x129466[_0x49bb('0x9')]=0x0;_0x129466[_0x49bb('0xa')]=0x0;_0x129466['total']=0x0;if(_0x129466[_0x49bb('0xb')]){if(_0x129466['disposition']===_0x49bb('0xa')){_0x129466[_0x49bb('0xa')]+=0x1;updateWaitingCounter(_0x129466);}if(_0x129466[_0x49bb('0xc')]){_0x129466[_0x49bb('0x8')]+=0x1;if(_0x129466[_0x49bb('0x7')]){_0x129466[_0x49bb('0x7')]-=0x1;}}else{if(_0x129466[_0x49bb('0xd')]){_0x129466['unmanaged']+=0x1;updateWaitingCounter(_0x129466);}}}else{if(!_0x129466[_0x49bb('0xc')]){_0x129466[_0x49bb('0x6')]+=0x1;}if(_0x129466[_0x49bb('0xc')]){_0x129466[_0x49bb('0x7')]+=0x1;updateWaitingCounter(_0x129466);}}_0x129466['total']+=0x1;return _0x129466;}function getLastMessageText(_0x2c840f){return db[_0x49bb('0xe')][_0x49bb('0xf')]({'where':{'$and':[{'MailInteractionId':_0x2c840f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x49bb('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x49bb('0x11')],'order':'-id','raw':!![]})[_0x49bb('0x12')](function(_0x1051a5){if(_0x1051a5&&_0x1051a5['plainBody']){_0x2c840f['lastMsgText']=_[_0x49bb('0x13')](_0x1051a5[_0x49bb('0x11')]);}return _0x2c840f;})[_0x49bb('0x14')](function(_0x2c4f14){throw _0x2c4f14;});}exports[_0x49bb('0x15')]=function(_0x3b4f4b,_0x2488de,_0x2cc543,_0x4c4215){return new Promise(function(_0x33b3cd,_0x3c8766){return getInteractionUsers(_0x3b4f4b['id'],_0x2cc543)['then'](function(_0xc6d195){_0x3b4f4b[_0x49bb('0x16')]=_0xc6d195;return getInteractionTags(_0x3b4f4b[_0x49bb('0x17')],_0x2488de);})['then'](function(_0x4cb710){_0x3b4f4b[_0x49bb('0x18')]=_0x4cb710;delete _0x3b4f4b[_0x49bb('0x17')];return updateInteractionCounters(_0x3b4f4b);})['then'](function(_0xe2fb04){if(_0x4c4215){return getLastMessageText(_0xe2fb04);}else{return _0xe2fb04;}})[_0x49bb('0x12')](function(_0x4b57d9){_0x33b3cd(_0x4b57d9);})['catch'](function(_0x4cc37b){_0x3c8766(_0x4cc37b);});});};
\ No newline at end of file
+var _0x706b=['forEach','push','waiting','talking','answered','abandoned','closed','disposition','UserId','unmanaged','total','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','then','Users','TagIds','lodash','../../mysqldb','map','fullname'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x706b,0x11a));var _0xb706=function(_0x423caf,_0xff6d6e){_0x423caf=_0x423caf-0x0;var _0x41a110=_0x706b[_0x423caf];return _0x41a110;};'use strict';var _=require(_0xb706('0x0'));var db=require(_0xb706('0x1'))['db'];function getInteractionUsers(_0x312026,_0x3a5f06){return new Promise(function(_0x253624,_0x23f0d5){try{var _0x48a411=[];if(_0x3a5f06[_0x312026]){_0x48a411=_0x3a5f06[_0x312026][_0xb706('0x2')](function(_0x25b1d7){return{'id':_0x25b1d7['id'],'fullname':_0x25b1d7[_0xb706('0x3')]};});}return _0x253624(_0x48a411);}catch(_0x1d977c){_0x23f0d5(_0x1d977c);}});}function getInteractionTags(_0x1df14e,_0x4fe18e){var _0xe82e3d=[];if(_0x1df14e){_0x1df14e['split'](',')[_0xb706('0x4')](function(_0x172a44){_0xe82e3d[_0xb706('0x5')](_0x4fe18e[_0x172a44]);});}return _0xe82e3d;}function updateWaitingCounter(_0x512a6d){if(_0x512a6d[_0xb706('0x6')]){_0x512a6d['waiting']-=0x1;}}function updateInteractionCounters(_0x10e3b0){_0x10e3b0[_0xb706('0x6')]=0x0;_0x10e3b0[_0xb706('0x7')]=0x0;_0x10e3b0[_0xb706('0x8')]=0x0;_0x10e3b0['unmanaged']=0x0;_0x10e3b0[_0xb706('0x9')]=0x0;_0x10e3b0['total']=0x0;if(_0x10e3b0[_0xb706('0xa')]){if(_0x10e3b0[_0xb706('0xb')]==='abandoned'){_0x10e3b0[_0xb706('0x9')]+=0x1;updateWaitingCounter(_0x10e3b0);}if(_0x10e3b0[_0xb706('0xc')]){_0x10e3b0[_0xb706('0x8')]+=0x1;if(_0x10e3b0[_0xb706('0x7')]){_0x10e3b0[_0xb706('0x7')]-=0x1;}}else{if(_0x10e3b0[_0xb706('0xb')]){_0x10e3b0[_0xb706('0xd')]+=0x1;updateWaitingCounter(_0x10e3b0);}}}else{if(!_0x10e3b0[_0xb706('0xc')]){_0x10e3b0[_0xb706('0x6')]+=0x1;}if(_0x10e3b0['UserId']){_0x10e3b0['talking']+=0x1;updateWaitingCounter(_0x10e3b0);}}_0x10e3b0[_0xb706('0xe')]+=0x1;return _0x10e3b0;}function getLastMessageText(_0x5f1e5c){return db[_0xb706('0xf')][_0xb706('0x10')]({'where':{'$and':[{'MailInteractionId':_0x5f1e5c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb706('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb706('0x12')],'order':_0xb706('0x13'),'raw':!![]})['then'](function(_0xfd7d13){if(_0xfd7d13&&_0xfd7d13[_0xb706('0x12')]){_0x5f1e5c[_0xb706('0x14')]=_[_0xb706('0x15')](_0xfd7d13[_0xb706('0x12')]);}return _0x5f1e5c;})[_0xb706('0x16')](function(_0x16d669){throw _0x16d669;});}exports['updateInteraction']=function(_0x1cbcd7,_0x2fff8b,_0x412c3,_0x5d7bfd){return new Promise(function(_0x1b23c5,_0x32bc14){return getInteractionUsers(_0x1cbcd7['id'],_0x412c3)[_0xb706('0x17')](function(_0x33f71f){_0x1cbcd7[_0xb706('0x18')]=_0x33f71f;return getInteractionTags(_0x1cbcd7['TagIds'],_0x2fff8b);})[_0xb706('0x17')](function(_0x46d37e){_0x1cbcd7['Tags']=_0x46d37e;delete _0x1cbcd7[_0xb706('0x19')];return updateInteractionCounters(_0x1cbcd7);})[_0xb706('0x17')](function(_0x26e19c){if(_0x5d7bfd){return getLastMessageText(_0x26e19c);}else{return _0x26e19c;}})[_0xb706('0x17')](function(_0x1e4f75){_0x1b23c5(_0x1e4f75);})[_0xb706('0x16')](function(_0x122812){_0x32bc14(_0x122812);});});};
\ No newline at end of file
index 7d9327e..885c57a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9777=['findOne','then','error','exports','lodash','../../config/logger','mail-interactions','sms-interactions','chat-interactions','chat','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9777,0x1a8));var _0x7977=function(_0x3bd557,_0xfcc389){_0x3bd557=_0x3bd557-0x0;var _0x256159=_0x9777[_0x3bd557];return _0x256159;};'use strict';var _=require(_0x7977('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x7977('0x1'))(_0x7977('0x2')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x7977('0x1'))(_0x7977('0x3')),'chat':require(_0x7977('0x1'))(_0x7977('0x4')),'whatsapp':require(_0x7977('0x1'))('whatsapp-interactions')};function getAccountFK(_0x33a096){return _['capitalize'](_0x33a096)+(_0x33a096===_0x7977('0x5')?'Website':_0x7977('0x6'))+'Id';}function getInteractionFK(_0x18027f){return _[_0x7977('0x7')](_0x18027f)+_0x7977('0x8');}function getInteractionId(_0x34c098,_0x14db30,_0x7ea81f){if(_0x34c098&&_0x34c098[_[_0x7977('0x9')](_0x7ea81f)+_0x7977('0x8')]){return _0x34c098[_[_0x7977('0x9')](_0x7ea81f)+_0x7977('0x8')];}else if(_0x34c098&&_0x34c098['id']){return _0x34c098['id'];}else if(_0x14db30&&_0x14db30['id']){return _0x14db30['id'];}else{return _0x7977('0xa');}}function getInteractionsTables(_0x37b3f7){return{'accounts':_0x37b3f7+'_'+(_0x37b3f7===_0x7977('0x5')?_0x7977('0xb'):_0x7977('0xc')),'interactions':_0x37b3f7+_0x7977('0xd'),'interactionsTags':_0x37b3f7+'_interaction_has_tags','messages':_0x37b3f7+_0x7977('0xe'),'userInteractions':_0x7977('0xf')+_0x37b3f7+_0x7977('0xd')};}function getSelectedTags(_0x3f08d5){var _0x110759=[];if(_0x3f08d5){_0x110759=Array[_0x7977('0x10')](_0x3f08d5)?_0x3f08d5:[_0x3f08d5];}return _0x110759;}function log(_0x6ca8c5,_0x1ad3c0,_0x14ee89,_0x5c0008,_0x2d52d4,_0x3a53d0){loggers[_0x2d52d4[_0x7977('0x11')]()][_0x6ca8c5](_0x7977('0x12'),_0x3a53d0[_0x7977('0x13')](),_0x1ad3c0?_0x1ad3c0['id']:null,_0x1ad3c0?_0x1ad3c0[_0x7977('0x14')]:null,_0x1ad3c0?_0x1ad3c0[_0x7977('0x15')]:null,getInteractionId(_0x14ee89,_0x5c0008,_0x2d52d4),_0x14ee89?JSON['stringify'](_0x14ee89):_0x7977('0x16'));}function updateUser(_0x56999a,_0x4b7315,_0x56265a,_0x5a36bf,_0x31876e){db[_[_0x7977('0x9')](_0x5a36bf)+_0x7977('0x17')][_0x7977('0x18')]({'where':{'id':getInteractionId(_0x4b7315,_0x56265a,_0x5a36bf)}})['then'](function(_0x18e28e){if(_0x18e28e){return _0x18e28e['update']({'UserId':_0x56999a?_0x56999a['id']:null});}})[_0x7977('0x19')](function(_0x23f36d){if(_0x23f36d){log('info',_0x56999a,_0x4b7315,_0x56265a,_0x5a36bf,_0x31876e);}})['catch'](function(){log(_0x7977('0x1a'),_0x56999a,_0x4b7315,_0x56265a,_0x5a36bf,_0x31876e);});}module[_0x7977('0x1b')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0xd5de=['update','info','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','upperFirst','InteractionId','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','Interaction','findOne','then'];(function(_0x1b7140,_0x12a81c){var _0x3f8f2a=function(_0x5f2f58){while(--_0x5f2f58){_0x1b7140['push'](_0x1b7140['shift']());}};_0x3f8f2a(++_0x12a81c);}(_0xd5de,0x125));var _0xed5d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd5de[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xed5d('0x0'));var db=require(_0xed5d('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xed5d('0x2')),'mail':require(_0xed5d('0x3'))(_0xed5d('0x4')),'fax':require(_0xed5d('0x3'))('fax-interactions'),'sms':require(_0xed5d('0x3'))('sms-interactions'),'chat':require(_0xed5d('0x3'))(_0xed5d('0x5')),'whatsapp':require(_0xed5d('0x3'))(_0xed5d('0x6'))};function getAccountFK(_0x21e4e6){return _[_0xed5d('0x7')](_0x21e4e6)+(_0x21e4e6===_0xed5d('0x8')?_0xed5d('0x9'):_0xed5d('0xa'))+'Id';}function getInteractionFK(_0x2d2137){return _['capitalize'](_0x2d2137)+'InteractionId';}function getInteractionId(_0x30583e,_0x43a68d,_0x3605af){if(_0x30583e&&_0x30583e[_[_0xed5d('0xb')](_0x3605af)+'InteractionId']){return _0x30583e[_[_0xed5d('0xb')](_0x3605af)+_0xed5d('0xc')];}else if(_0x30583e&&_0x30583e['id']){return _0x30583e['id'];}else if(_0x43a68d&&_0x43a68d['id']){return _0x43a68d['id'];}else{return'unknown';}}function getInteractionsTables(_0x5c4d08){return{'accounts':_0x5c4d08+'_'+(_0x5c4d08===_0xed5d('0x8')?_0xed5d('0xd'):_0xed5d('0xe')),'interactions':_0x5c4d08+_0xed5d('0xf'),'interactionsTags':_0x5c4d08+'_interaction_has_tags','messages':_0x5c4d08+_0xed5d('0x10'),'userInteractions':_0xed5d('0x11')+_0x5c4d08+_0xed5d('0xf')};}function getSelectedTags(_0x225acf){var _0x30bf00=[];if(_0x225acf){_0x30bf00=Array[_0xed5d('0x12')](_0x225acf)?_0x225acf:[_0x225acf];}return _0x30bf00;}function log(_0x3de156,_0x3d1f4f,_0x115a49,_0x3ed847,_0x5cefa8,_0xb16b6e){loggers[_0x5cefa8[_0xed5d('0x13')]()][_0x3de156](_0xed5d('0x14'),_0xb16b6e[_0xed5d('0x15')](),_0x3d1f4f?_0x3d1f4f['id']:null,_0x3d1f4f?_0x3d1f4f[_0xed5d('0x16')]:null,_0x3d1f4f?_0x3d1f4f['role']:null,getInteractionId(_0x115a49,_0x3ed847,_0x5cefa8),_0x115a49?JSON['stringify'](_0x115a49):'null');}function updateUser(_0x30d260,_0x4a1381,_0x4738e5,_0x6b5499,_0x3ea0f7){db[_['upperFirst'](_0x6b5499)+_0xed5d('0x17')][_0xed5d('0x18')]({'where':{'id':getInteractionId(_0x4a1381,_0x4738e5,_0x6b5499)}})[_0xed5d('0x19')](function(_0x2ec07b){if(_0x2ec07b){return _0x2ec07b[_0xed5d('0x1a')]({'UserId':_0x30d260?_0x30d260['id']:null});}})[_0xed5d('0x19')](function(_0x39098f){if(_0x39098f){log(_0xed5d('0x1b'),_0x30d260,_0x4a1381,_0x4738e5,_0x6b5499,_0x3ea0f7);}})['catch'](function(){log('error',_0x30d260,_0x4a1381,_0x4738e5,_0x6b5499,_0x3ea0f7);});}module[_0xed5d('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
index 83b6b66..681309c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5987=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5987,0xd4));var _0x7598=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5987[_0x5b644e];return _0x49c6bf;};'use strict';var crypto=require(_0x7598('0x0'));var util=require(_0x7598('0x1'));var compose=require(_0x7598('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x7598('0x3'));function getValueFromLicense(_0x468c3e,_0x23c6a5){if(_0x468c3e&&_0x23c6a5){if(_0x23c6a5['data1']&&_0x23c6a5[_0x7598('0x4')]){var _0x11fa5a=_0x23c6a5['data1'];var _0x589119=_0x23c6a5['license'];var _0x3b2568=_0x11fa5a['split']('-')[0x4];var _0x64cf84=_0x11fa5a[_0x7598('0x5')]('-')[0x0];var _0x22fec6=crypto[_0x7598('0x6')](_0x7598('0x7'),util[_0x7598('0x8')](_0x7598('0x9'),_0x3b2568,_0x11fa5a,_0x64cf84));var _0x1f15e1=_0x22fec6['update'](_0x589119,_0x7598('0xa'),_0x7598('0xb'));_0x1f15e1+=_0x22fec6['final'](_0x7598('0xb'));var _0x5044ed=JSON[_0x7598('0xc')](_0x1f15e1);return _0x5044ed[_0x7598('0xd')](_0x468c3e)?_0x5044ed[_0x468c3e]:null;}}return null;}function isLimit(_0x4bf2be,_0x5f312f,_0xa8d939,_0xb42184){var _0x27f959=_0x5f312f;return compose()[_0x7598('0xe')](function(_0x420ed1,_0x47755f,_0x2b5c53){return db[_0x7598('0xf')][_0x7598('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x7598('0x11')](function(_0x4972a9){var _0x563b12=getValueFromLicense(_0x4bf2be,_0x4972a9);return _0x563b12?_0x563b12:_0x27f959;})[_0x7598('0x11')](function(_0x2e4fee){_0x27f959=_0x2e4fee;return _0xa8d939[_0x7598('0x12')](_0xb42184);})[_0x7598('0x11')](function(_0x7debc6){if(_0x7debc6>=_0x27f959){return _0x47755f[_0x7598('0x13')](0x193)[_0x7598('0x14')]({'message':util[_0x7598('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4bf2be)});}_0x2b5c53();})[_0x7598('0x15')](function(_0x2079ad){_0x2b5c53(_0x2079ad);});});}function isUserLimit(){return isLimit(_0x7598('0x16'),0x1,db[_0x7598('0x17')],{'where':{'$or':[{'role':_0x7598('0x18')},{'role':_0x7598('0x19')}]}});}exports[_0x7598('0x1a')]=isUserLimit;
\ No newline at end of file
+var _0x3a9a=['then','count','status','json','catch','users','User','user','crypto','util','composable-middleware','../../config/environment','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','hasOwnProperty','use','License','findOne'];(function(_0x51a899,_0x319972){var _0xddf8d3=function(_0x22ef3a){while(--_0x22ef3a){_0x51a899['push'](_0x51a899['shift']());}};_0xddf8d3(++_0x319972);}(_0x3a9a,0xb0));var _0xa3a9=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x3a9a[_0x2962d5];return _0x273406;};'use strict';var crypto=require(_0xa3a9('0x0'));var util=require(_0xa3a9('0x1'));var compose=require(_0xa3a9('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xa3a9('0x3'));function getValueFromLicense(_0x48b6c4,_0x277b5c){if(_0x48b6c4&&_0x277b5c){if(_0x277b5c['data1']&&_0x277b5c[_0xa3a9('0x4')]){var _0x4df6b6=_0x277b5c['data1'];var _0x4915f8=_0x277b5c[_0xa3a9('0x4')];var _0x2fe3fe=_0x4df6b6[_0xa3a9('0x5')]('-')[0x4];var _0x3a962d=_0x4df6b6['split']('-')[0x0];var _0x3d1bbb=crypto[_0xa3a9('0x6')](_0xa3a9('0x7'),util[_0xa3a9('0x8')]('%s:%s:%s',_0x2fe3fe,_0x4df6b6,_0x3a962d));var _0x1a5bd2=_0x3d1bbb[_0xa3a9('0x9')](_0x4915f8,_0xa3a9('0xa'),_0xa3a9('0xb'));_0x1a5bd2+=_0x3d1bbb['final'](_0xa3a9('0xb'));var _0x36a692=JSON['parse'](_0x1a5bd2);return _0x36a692[_0xa3a9('0xc')](_0x48b6c4)?_0x36a692[_0x48b6c4]:null;}}return null;}function isLimit(_0x3a29db,_0x37102e,_0x5f3534,_0x57818b){var _0x453f87=_0x37102e;return compose()[_0xa3a9('0xd')](function(_0x5714f1,_0xa591f8,_0x40a350){return db[_0xa3a9('0xe')][_0xa3a9('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xa3a9('0x10')](function(_0x1475aa){var _0x1bd10f=getValueFromLicense(_0x3a29db,_0x1475aa);return _0x1bd10f?_0x1bd10f:_0x453f87;})[_0xa3a9('0x10')](function(_0x4ef8c3){_0x453f87=_0x4ef8c3;return _0x5f3534[_0xa3a9('0x11')](_0x57818b);})[_0xa3a9('0x10')](function(_0x5d5ab7){if(_0x5d5ab7>=_0x453f87){return _0xa591f8[_0xa3a9('0x12')](0x193)[_0xa3a9('0x13')]({'message':util[_0xa3a9('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3a29db)});}_0x40a350();})[_0xa3a9('0x14')](function(_0x49455d){_0x40a350(_0x49455d);});});}function isUserLimit(){return isLimit(_0xa3a9('0x15'),0x1,db[_0xa3a9('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0xa3a9('0x17')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 3a1cad1..86b5b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x820e=['parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','length','split','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','$eq','$between','includes','$gt','$lte','operator','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x820e,0xe3));var _0xe820=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x820e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe820('0x0'));var moment=require('moment');exports[_0xe820('0x1')]=function(_0xea2ea){var _0x2dc02f={'conditions':[]};_0x2dc02f[_0xe820('0x2')]=_[_0xe820('0x3')](_0xea2ea,_0xe820('0x4'))?'or':'and';var _0x2331e7=_0xea2ea[_0xe820('0x5')](_0xe820('0x6'),'')['replace'](_0xe820('0x4'),'')['split']('||');for(var _0x25cb96=0x0;_0x25cb96<_0x2331e7[_0xe820('0x7')];_0x25cb96++){var _0x418244=_0x2331e7[_0x25cb96][_0xe820('0x8')](':=');var _0x5e079e=_0x418244[0x0];var _0x16c648=_0x418244['slice'](0x1);_0x16c648[_0xe820('0x9')](function(_0x432e6c){var _0x4fb389=_0x432e6c['split']('[')[_0xe820('0xa')]();var _0x46314c=_0x432e6c[_0xe820('0xb')](/\[(.*?)\]/g);_0x46314c[_0xe820('0x9')](function(_0x28d8ff){var _0x11f596=_0x28d8ff[_0xe820('0x8')]('[')[_0xe820('0xc')](function(_0x11bad6){return _0x11bad6[_0xe820('0xd')](']')>-0x1;})[_0xe820('0xe')](function(_0x454789){return _0x454789[_0xe820('0x8')](']')[0x0];})[0x0];_0x2dc02f[_0xe820('0xf')][_0xe820('0x10')]({'field':_0x5e079e,'operator':_0x4fb389,'value':_0x11f596});});});}return _0x2dc02f;};exports['buildExpression']=function(_0x2dd367,_0x1bb37d,_0x4d9843){var _0x51f182={};if(_0x1bb37d===_0xe820('0x11')){if(_0x4d9843['operator']===_0xe820('0x12')){_0x4d9843['operator']=_0xe820('0x13');_0x4d9843['value']+=','+_0x4d9843['value'];}else if(_[_0xe820('0x14')]([_0xe820('0x15'),_0xe820('0x16')],_0x4d9843[_0xe820('0x17')])){_0x4d9843[_0xe820('0x18')]=moment(_0x4d9843[_0xe820('0x18')])[_0xe820('0x19')](0x1,_0xe820('0x1a'))[_0xe820('0x1b')](_0xe820('0x1c'));}}if(_0x4d9843[_0xe820('0x1d')]){_0x1bb37d=_0x4d9843[_0xe820('0x1d')];_0x51f182[_0xe820('0x1e')]=_0xe820('0x1f')+_0x2dd367+'.'+_0x4d9843[_0xe820('0x20')]+_0xe820('0x21')+_0x4d9843[_0xe820('0x1d')]+')\x20'+parseOperator(_0x4d9843['operator']);}else{_0x51f182[_0xe820('0x1e')]=_0x2dd367+'.'+_0x4d9843['field']+'\x20'+parseOperator(_0x4d9843[_0xe820('0x17')]);}if(_[_0xe820('0x14')]([_0xe820('0x22'),'$notIn'],_0x4d9843[_0xe820('0x17')]))_0x51f182[_0xe820('0x1e')]='('+_0x51f182[_0xe820('0x1e')]+_0xe820('0x23')+_0x2dd367+'.'+_0x4d9843[_0xe820('0x20')]+_0xe820('0x24');_0x51f182[_0xe820('0x18')]=parseValue(_0x1bb37d,_0x4d9843['operator'],_0x4d9843[_0xe820('0x18')]);return _0x51f182;};function parseOperator(_0x3686bb){var _0x13a5ec;switch(_0x3686bb){case'$in':_0x13a5ec=_0xe820('0x25');break;case _0xe820('0x26'):_0x13a5ec=_0xe820('0x27');break;case _0xe820('0x12'):_0x13a5ec=_0xe820('0x28');break;case'$ne':_0x13a5ec=_0xe820('0x29');break;case _0xe820('0x2a'):case _0xe820('0x2b'):case _0xe820('0x2c'):_0x13a5ec=_0xe820('0x2d');break;case _0xe820('0x2e'):_0x13a5ec='<\x20?';break;case _0xe820('0x15'):_0x13a5ec=_0xe820('0x2f');break;case _0xe820('0x16'):_0x13a5ec=_0xe820('0x30');break;case _0xe820('0x31'):_0x13a5ec=_0xe820('0x32');break;case'$between':_0x13a5ec='BETWEEN\x20?\x20AND\x20?';break;}return _0x13a5ec;}function parseValue(_0x58eed8,_0x1611f9,_0x3ea877){var _0x4338f1={'start':undefined,'end':undefined};switch(_0x1611f9){case'$in':case _0xe820('0x26'):_0x4338f1[_0xe820('0x33')]=_0x3ea877['split'](',');break;case'$substring':_0x4338f1[_0xe820('0x33')]='%'+_0x3ea877+'%';break;case _0xe820('0x2b'):_0x4338f1['start']=_0x3ea877+'%';break;case _0xe820('0x2c'):_0x4338f1[_0xe820('0x33')]='%'+_0x3ea877;break;case _0xe820('0x13'):var _0x3dd009=_0x3ea877[_0xe820('0x8')](',');var _0x3ea877=_0x3dd009[_0xe820('0xa')]();var _0x214182=_0x3dd009[_0xe820('0x34')]();if(_0x58eed8===_0xe820('0x11')){_0x3ea877=moment(_0x3ea877)[_0xe820('0x35')](0x0,!![])[_0xe820('0x1b')]();_0x214182=moment(_0x214182)[_0xe820('0x35')](0x0,!![])[_0xe820('0x19')](0x17,_0xe820('0x36'))[_0xe820('0x19')](0x3b,_0xe820('0x37'))[_0xe820('0x19')](0x3b,_0xe820('0x38'))[_0xe820('0x1b')]();}_0x4338f1={'start':_0x3ea877,'end':_0x214182};break;default:_0x4338f1[_0xe820('0x33')]=_0x3ea877;break;}return _0x4338f1;}
\ No newline at end of file
+var _0x4c1a=['and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','\x20OR\x20','\x20IS\x20NULL)','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','hours','minutes','lodash','parseSearch','startsWith','[$or]'];(function(_0x110538,_0x2c22c6){var _0x1f1a41=function(_0x393445){while(--_0x393445){_0x110538['push'](_0x110538['shift']());}};_0x1f1a41(++_0x2c22c6);}(_0x4c1a,0x64));var _0xa4c1=function(_0x4e9128,_0x97e0de){_0x4e9128=_0x4e9128-0x0;var _0x379f73=_0x4c1a[_0x4e9128];return _0x379f73;};'use strict';var _=require(_0xa4c1('0x0'));var moment=require('moment');exports[_0xa4c1('0x1')]=function(_0x47640a){var _0x481b77={'conditions':[]};_0x481b77['sqlOperator']=_[_0xa4c1('0x2')](_0x47640a,_0xa4c1('0x3'))?'or':_0xa4c1('0x4');var _0x3f26f9=_0x47640a[_0xa4c1('0x5')](_0xa4c1('0x6'),'')[_0xa4c1('0x5')](_0xa4c1('0x3'),'')[_0xa4c1('0x7')]('||');for(var _0x4c156b=0x0;_0x4c156b<_0x3f26f9[_0xa4c1('0x8')];_0x4c156b++){var _0x4a5b3d=_0x3f26f9[_0x4c156b][_0xa4c1('0x7')](':=');var _0x3c902d=_0x4a5b3d[0x0];var _0x1b92ec=_0x4a5b3d[_0xa4c1('0x9')](0x1);_0x1b92ec[_0xa4c1('0xa')](function(_0x4b5d5c){var _0x237aaa=_0x4b5d5c['split']('[')[_0xa4c1('0xb')]();var _0x553414=_0x4b5d5c[_0xa4c1('0xc')](/\[(.*?)\]/g);_0x553414['forEach'](function(_0x25d9cd){var _0x3d5042=_0x25d9cd[_0xa4c1('0x7')]('[')[_0xa4c1('0xd')](function(_0x39c671){return _0x39c671[_0xa4c1('0xe')](']')>-0x1;})[_0xa4c1('0xf')](function(_0x4c7744){return _0x4c7744[_0xa4c1('0x7')](']')[0x0];})[0x0];_0x481b77['conditions']['push']({'field':_0x3c902d,'operator':_0x237aaa,'value':_0x3d5042});});});}return _0x481b77;};exports[_0xa4c1('0x10')]=function(_0x11a144,_0x5e80a9,_0xc06ae3){var _0x25d6bd={};if(_0x5e80a9===_0xa4c1('0x11')){if(_0xc06ae3[_0xa4c1('0x12')]===_0xa4c1('0x13')){_0xc06ae3[_0xa4c1('0x12')]=_0xa4c1('0x14');_0xc06ae3[_0xa4c1('0x15')]+=','+_0xc06ae3['value'];}else if(_[_0xa4c1('0x16')]([_0xa4c1('0x17'),_0xa4c1('0x18')],_0xc06ae3[_0xa4c1('0x12')])){_0xc06ae3[_0xa4c1('0x15')]=moment(_0xc06ae3['value'])[_0xa4c1('0x19')](0x1,_0xa4c1('0x1a'))[_0xa4c1('0x1b')](_0xa4c1('0x1c'));}}if(_0xc06ae3['castTo']){_0x5e80a9=_0xc06ae3[_0xa4c1('0x1d')];_0x25d6bd['text']='CAST('+_0x11a144+'.'+_0xc06ae3[_0xa4c1('0x1e')]+_0xa4c1('0x1f')+_0xc06ae3[_0xa4c1('0x1d')]+')\x20'+parseOperator(_0xc06ae3[_0xa4c1('0x12')]);}else{_0x25d6bd[_0xa4c1('0x20')]=_0x11a144+'.'+_0xc06ae3[_0xa4c1('0x1e')]+'\x20'+parseOperator(_0xc06ae3[_0xa4c1('0x12')]);}if(_[_0xa4c1('0x16')]([_0xa4c1('0x21'),'$notIn'],_0xc06ae3['operator']))_0x25d6bd[_0xa4c1('0x20')]='('+_0x25d6bd[_0xa4c1('0x20')]+_0xa4c1('0x22')+_0x11a144+'.'+_0xc06ae3['field']+_0xa4c1('0x23');_0x25d6bd[_0xa4c1('0x15')]=parseValue(_0x5e80a9,_0xc06ae3['operator'],_0xc06ae3['value']);return _0x25d6bd;};function parseOperator(_0xde4f4b){var _0x271c11;switch(_0xde4f4b){case'$in':_0x271c11='IN\x20?';break;case _0xa4c1('0x24'):_0x271c11=_0xa4c1('0x25');break;case'$eq':_0x271c11=_0xa4c1('0x26');break;case'$ne':_0x271c11=_0xa4c1('0x27');break;case'$substring':case _0xa4c1('0x28'):case'$endsWith':_0x271c11='LIKE\x20?';break;case'$lt':_0x271c11=_0xa4c1('0x29');break;case _0xa4c1('0x17'):_0x271c11=_0xa4c1('0x2a');break;case _0xa4c1('0x18'):_0x271c11=_0xa4c1('0x2b');break;case _0xa4c1('0x2c'):_0x271c11=_0xa4c1('0x2d');break;case _0xa4c1('0x14'):_0x271c11=_0xa4c1('0x2e');break;}return _0x271c11;}function parseValue(_0x15c718,_0x3b91bf,_0x415c17){var _0x321e5e={'start':undefined,'end':undefined};switch(_0x3b91bf){case _0xa4c1('0x2f'):case'$notIn':_0x321e5e[_0xa4c1('0x30')]=_0x415c17[_0xa4c1('0x7')](',');break;case'$substring':_0x321e5e[_0xa4c1('0x30')]='%'+_0x415c17+'%';break;case _0xa4c1('0x28'):_0x321e5e[_0xa4c1('0x30')]=_0x415c17+'%';break;case'$endsWith':_0x321e5e[_0xa4c1('0x30')]='%'+_0x415c17;break;case _0xa4c1('0x14'):var _0x42c080=_0x415c17['split'](',');var _0x415c17=_0x42c080[_0xa4c1('0xb')]();var _0x294586=_0x42c080['pop']();if(_0x15c718==='DATE'){_0x415c17=moment(_0x415c17)[_0xa4c1('0x31')](0x0,!![])['format']();_0x294586=moment(_0x294586)['utcOffset'](0x0,!![])['add'](0x17,_0xa4c1('0x32'))[_0xa4c1('0x19')](0x3b,_0xa4c1('0x33'))['add'](0x3b,'seconds')[_0xa4c1('0x1b')]();}_0x321e5e={'start':_0x415c17,'end':_0x294586};break;default:_0x321e5e[_0xa4c1('0x30')]=_0x415c17;break;}return _0x321e5e;}
\ No newline at end of file
index 0b41bd1..0c3e6f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56a4=['intersection','model','attributes','nolimit','order','sort','filter','columns','name','where','merge','lower','options','lodash','sequelize','keys','includes','parse','fields','split','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','map','col','priority','unsigned','DESC','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','forEach','push','getOptions','query','$id','filters'];(function(_0x49c2b9,_0xd8cc8d){var _0x37556e=function(_0x46d7ad){while(--_0x46d7ad){_0x49c2b9['push'](_0x49c2b9['shift']());}};_0x37556e(++_0xd8cc8d);}(_0x56a4,0x11b));var _0x456a=function(_0xa711b,_0x81a280){_0xa711b=_0xa711b-0x0;var _0x1f061d=_0x56a4[_0xa711b];return _0x1f061d;};'use strict';var _=require(_0x456a('0x0'));var sequelize=require(_0x456a('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1a164f){var _0x93d98f=['ne'];try{var _0x5f3fe1=JSON['parse'](_0x1a164f);var _0x26a7c6=Object[_0x456a('0x2')](_0x5f3fe1)[0x0];return _0x93d98f[_0x456a('0x3')](_0x26a7c6);}catch(_0x1c904){return![];}}function getOperatorValue(_0x4773f0){var _0x4b8eec=JSON[_0x456a('0x4')](_0x4773f0);var _0x52b38d=Object['keys'](_0x4b8eec)[0x0];var _0x2b6329=_0x4b8eec[_0x52b38d];return{['$'+_0x52b38d]:_0x2b6329};}exports[_0x456a('0x5')]=function(_0x37f1b4){var _0x4c4e05=null;if(_0x37f1b4){_0x4c4e05=_0x37f1b4[_0x456a('0x6')](',');}return _0x4c4e05;};exports['filters']=function(_0xb56df,_0x29073f){var _0x3bb712={};if(!_[_0x456a('0x7')](_0xb56df)){_[_0x456a('0x8')](_0xb56df,function(_0x1ef6b6,_0x1179fa){try{if(_0x29073f){var _0xe60506=_[_0x456a('0x9')](_0x29073f,{'name':_0x1179fa})||{};if(hasSequelizeOperator(_0x1ef6b6)){_0x3bb712[_0x1179fa]=getOperatorValue(_0x1ef6b6);}else if(_0xe60506[_0x456a('0xa')]===_0x456a('0xb')&&_['isPlainObject'](_0x1ef6b6)){var _0x2f4b75=JSON['parse'](_0x1ef6b6);var _0x5aad13={'$gte':moment(moment(_0x2f4b75[_0x456a('0xc')])[_0x456a('0xd')](_0x456a('0xe')))[_0x456a('0xf')]()['format'](),'$lte':moment(moment(_0x2f4b75[_0x456a('0x10')])[_0x456a('0xd')](_0x456a('0xe')))[_0x456a('0xf')]()[_0x456a('0x11')](0x1,'s')[_0x456a('0xd')]()};_0x3bb712[_0x1179fa]=_0x5aad13;}else if(_0xe60506['name']===_0x456a('0x12')){_0x3bb712[_0x1179fa]=_0x1ef6b6;}else{_0x3bb712[_0x1179fa]=_[_0x456a('0x13')](_0x1ef6b6)?_0x1ef6b6:JSON[_0x456a('0x4')](_0x1ef6b6);}}else{_0x3bb712[_0x1179fa]=_[_0x456a('0x13')](_0x1ef6b6)?_0x1ef6b6:JSON['parse'](_0x1ef6b6);}}catch(_0x200eda){_0x3bb712[_0x1179fa]=_0x1ef6b6[_0x456a('0x6')](',');}});}return _0x3bb712;};exports[_0x456a('0x14')]=function(_0x599c2e){_0x599c2e=parseInt(_0x599c2e,0xa);if(!_0x599c2e||_0x599c2e<0x0){_0x599c2e=LIMIT_VALUE;}return _0x599c2e;};exports[_0x456a('0x15')]=function(_0x520f2f){_0x520f2f=parseInt(_0x520f2f,0xa);if(!_0x520f2f||_0x520f2f<0x0){_0x520f2f=0x0;}return _0x520f2f;};exports['sort']=function(_0x33be50){var _0x562cfa,_0x44d79a=null;if(_0x33be50){_0x562cfa=_0x33be50['split'](',');_0x44d79a=_[_0x456a('0x16')](_0x562cfa,function(_0x17d0ae){if(_0x17d0ae['indexOf']('-')===0x0){return[_0x17d0ae==='priority'?sequelize['cast'](sequelize[_0x456a('0x17')](_0x456a('0x18')),_0x456a('0x19')):_0x17d0ae['substr'](0x1),_0x456a('0x1a')];}else{return[_0x17d0ae==='priority'?sequelize['cast'](sequelize['col'](_0x456a('0x18')),_0x456a('0x19')):_0x17d0ae,_0x456a('0x1b')];}});}return _0x44d79a;};exports['omit']=function(_0x45ea0c,_0x360b42){if(_['isEmpty'](_0x45ea0c)){return _0x45ea0c;}if(_[_0x456a('0x13')](_0x45ea0c)){for(var _0x561097=0x0;_0x561097<_0x45ea0c['length'];_0x561097+=0x1){_0x45ea0c[_0x561097]=this[_0x456a('0x1c')](_0x45ea0c[_0x561097],_0x360b42);}return _0x45ea0c;}if(!_['isObject'](_0x45ea0c)){return _0x45ea0c;}if(_[_0x456a('0x1d')](_0x360b42)){_0x360b42=[_0x360b42];}if(!_['isArray'](_0x360b42)){return _0x45ea0c;}for(var _0x1ee212=0x0;_0x1ee212<_0x360b42[_0x456a('0x1e')];_0x1ee212+=0x1){_[_0x456a('0x1f')](_0x45ea0c,_0x360b42[_0x1ee212]);}for(var _0x2e8005 in _0x45ea0c){if(_0x45ea0c[_0x456a('0x20')](_0x2e8005)){_0x45ea0c[_0x2e8005]=this[_0x456a('0x1c')](_0x45ea0c[_0x2e8005],_0x360b42);}}return _0x45ea0c;};exports[_0x456a('0x21')]=function(_0x25da31){return _0x25da31['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x38912b){return _0x38912b[_0x456a('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x28437d){var _0x374149=[];_0x28437d[_0x456a('0x6')](/[ ,]+/)[_0x456a('0x23')](function(_0x257d18){_0x257d18=_0x257d18['replace'](/([^:]")"+/g,'$1');_0x257d18='+'+_0x257d18+'*';var _0x41efdc=/[ `!@#$%^&*()_\-?~]/;if(_0x257d18[_0x456a('0x22')](_0x41efdc))_0x257d18='\x22'+_0x257d18+'\x22';_0x374149[_0x456a('0x24')](_0x257d18);});return _0x374149['join']('\x20');};exports[_0x456a('0x25')]=function(_0x342c76,_0x4f4693,_0x18d035){var _0x24efbc={},_0xd5c0f0={};if(_0x4f4693[_0x456a('0x26')][_0x456a('0x27')]){_0x4f4693['query']['id']=_0x4f4693[_0x456a('0x26')][_0x456a('0x27')];delete _0x4f4693[_0x456a('0x26')]['$id'];}_0x24efbc['model']=_[_0x456a('0x16')](_0x342c76,'name');_0x24efbc['query']=_['keys'](_0x4f4693[_0x456a('0x26')]);_0x24efbc[_0x456a('0x28')]=_[_0x456a('0x29')](_0x24efbc[_0x456a('0x2a')],_0x24efbc['query']);_0xd5c0f0[_0x456a('0x2b')]=_[_0x456a('0x29')](_0x24efbc['model'],this[_0x456a('0x5')](_0x4f4693[_0x456a('0x26')][_0x456a('0x5')]));_0xd5c0f0[_0x456a('0x2b')]=_0xd5c0f0[_0x456a('0x2b')]['length']?_0xd5c0f0[_0x456a('0x2b')]:_0x24efbc[_0x456a('0x2a')];if(!_0x4f4693['query'][_0x456a('0x20')](_0x456a('0x2c'))){_0xd5c0f0[_0x456a('0x14')]=this[_0x456a('0x14')](_0x4f4693[_0x456a('0x26')][_0x456a('0x14')]);_0xd5c0f0[_0x456a('0x15')]=this[_0x456a('0x15')](_0x4f4693['query'][_0x456a('0x15')]);}_0xd5c0f0[_0x456a('0x2d')]=this[_0x456a('0x2e')](_0x4f4693[_0x456a('0x26')][_0x456a('0x2e')]);_0xd5c0f0['where']=this[_0x456a('0x28')](_['pick'](_0x4f4693[_0x456a('0x26')],_0x24efbc[_0x456a('0x28')]),_0x342c76);if(_0x4f4693['query'][_0x456a('0x2f')]){var _0x3515f5=_0x342c76;var _0x23e67f=_0x4f4693['query'][_0x456a('0x2f')];if(typeof _0x23e67f==='object'){_0x3515f5=_['filter'](_0x342c76,function(_0x4421ad){return _['includes'](_0x23e67f[_0x456a('0x30')],_0x4421ad[_0x456a('0x31')]);});_0x23e67f=_0x23e67f['value'];}_0xd5c0f0[_0x456a('0x32')]=_[_0x456a('0x33')](_0xd5c0f0[_0x456a('0x32')],{'$or':_[_0x456a('0x16')](_0x3515f5,function(_0x355ae8){if(_0x355ae8[_0x456a('0xa')]!=='VIRTUAL'){if(_0x18d035){return sequelize[_0x456a('0x32')](sequelize['fn']('lower',sequelize[_0x456a('0x17')](_0x355ae8[_0x456a('0x31')])),{'$like':sequelize['fn'](_0x456a('0x34'),'%'+_0x4f4693[_0x456a('0x26')][_0x456a('0x2f')]+'%')});}else{var _0x58ee37={};_0x58ee37[_0x355ae8[_0x456a('0x31')]]={'$like':'%'+_0x4f4693[_0x456a('0x26')][_0x456a('0x2f')]+'%'};return _0x58ee37;}}})});}_0xd5c0f0=_[_0x456a('0x33')]({},_0xd5c0f0,_0x4f4693[_0x456a('0x35')]);return _0xd5c0f0;};
\ No newline at end of file
+var _0x6334=['omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','name','model','attributes','intersection','nolimit','offset','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','options','lodash','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','find','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','uniqueid','isArray','limit','sort','map','priority','cast','col','unsigned','substr','ASC'];(function(_0x531b7f,_0x571154){var _0x211787=function(_0x5676f4){while(--_0x5676f4){_0x531b7f['push'](_0x531b7f['shift']());}};_0x211787(++_0x571154);}(_0x6334,0x119));var _0x4633=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x6334[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0x4633('0x0'));var sequelize=require(_0x4633('0x1'));var moment=require(_0x4633('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1d53a1){var _0x1e53a0=['ne'];try{var _0x47254b=JSON['parse'](_0x1d53a1);var _0x1099be=Object[_0x4633('0x3')](_0x47254b)[0x0];return _0x1e53a0[_0x4633('0x4')](_0x1099be);}catch(_0x3572d1){return![];}}function getOperatorValue(_0x2ee333){var _0x6493dc=JSON[_0x4633('0x5')](_0x2ee333);var _0x4a8997=Object[_0x4633('0x3')](_0x6493dc)[0x0];var _0x56891d=_0x6493dc[_0x4a8997];return{['$'+_0x4a8997]:_0x56891d};}exports[_0x4633('0x6')]=function(_0x148e72){var _0x4ec5b1=null;if(_0x148e72){_0x4ec5b1=_0x148e72[_0x4633('0x7')](',');}return _0x4ec5b1;};exports[_0x4633('0x8')]=function(_0x4018ba,_0x591266){var _0x45a590={};if(!_[_0x4633('0x9')](_0x4018ba)){_['forOwn'](_0x4018ba,function(_0x6a63b,_0x3d5182){try{if(_0x591266){var _0x42fe10=_[_0x4633('0xa')](_0x591266,{'name':_0x3d5182})||{};if(hasSequelizeOperator(_0x6a63b)){_0x45a590[_0x3d5182]=getOperatorValue(_0x6a63b);}else if(_0x42fe10['type']===_0x4633('0xb')&&_[_0x4633('0xc')](_0x6a63b)){var _0x438e87=JSON['parse'](_0x6a63b);var _0x4d0b96={'$gte':moment(moment(_0x438e87['$gte'])[_0x4633('0xd')](_0x4633('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x438e87[_0x4633('0xf')])['format'](_0x4633('0xe')))[_0x4633('0x10')]()[_0x4633('0x11')](0x1,'s')[_0x4633('0xd')]()};_0x45a590[_0x3d5182]=_0x4d0b96;}else if(_0x42fe10['name']===_0x4633('0x12')){_0x45a590[_0x3d5182]=_0x6a63b;}else{_0x45a590[_0x3d5182]=_[_0x4633('0x13')](_0x6a63b)?_0x6a63b:JSON[_0x4633('0x5')](_0x6a63b);}}else{_0x45a590[_0x3d5182]=_['isArray'](_0x6a63b)?_0x6a63b:JSON[_0x4633('0x5')](_0x6a63b);}}catch(_0x37e536){_0x45a590[_0x3d5182]=_0x6a63b[_0x4633('0x7')](',');}});}return _0x45a590;};exports[_0x4633('0x14')]=function(_0xbab957){_0xbab957=parseInt(_0xbab957,0xa);if(!_0xbab957||_0xbab957<0x0){_0xbab957=LIMIT_VALUE;}return _0xbab957;};exports['offset']=function(_0x4691f2){_0x4691f2=parseInt(_0x4691f2,0xa);if(!_0x4691f2||_0x4691f2<0x0){_0x4691f2=0x0;}return _0x4691f2;};exports[_0x4633('0x15')]=function(_0x5c295d){var _0x57e61c,_0x182901=null;if(_0x5c295d){_0x57e61c=_0x5c295d['split'](',');_0x182901=_[_0x4633('0x16')](_0x57e61c,function(_0x5b5011){if(_0x5b5011['indexOf']('-')===0x0){return[_0x5b5011===_0x4633('0x17')?sequelize[_0x4633('0x18')](sequelize[_0x4633('0x19')](_0x4633('0x17')),_0x4633('0x1a')):_0x5b5011[_0x4633('0x1b')](0x1),'DESC'];}else{return[_0x5b5011===_0x4633('0x17')?sequelize['cast'](sequelize[_0x4633('0x19')](_0x4633('0x17')),_0x4633('0x1a')):_0x5b5011,_0x4633('0x1c')];}});}return _0x182901;};exports[_0x4633('0x1d')]=function(_0x49880a,_0x3af747){if(_[_0x4633('0x9')](_0x49880a)){return _0x49880a;}if(_[_0x4633('0x13')](_0x49880a)){for(var _0x13ec10=0x0;_0x13ec10<_0x49880a[_0x4633('0x1e')];_0x13ec10+=0x1){_0x49880a[_0x13ec10]=this[_0x4633('0x1d')](_0x49880a[_0x13ec10],_0x3af747);}return _0x49880a;}if(!_[_0x4633('0x1f')](_0x49880a)){return _0x49880a;}if(_[_0x4633('0x20')](_0x3af747)){_0x3af747=[_0x3af747];}if(!_[_0x4633('0x13')](_0x3af747)){return _0x49880a;}for(var _0x7d7f2=0x0;_0x7d7f2<_0x3af747[_0x4633('0x1e')];_0x7d7f2+=0x1){_[_0x4633('0x21')](_0x49880a,_0x3af747[_0x7d7f2]);}for(var _0x1fdc67 in _0x49880a){if(_0x49880a[_0x4633('0x22')](_0x1fdc67)){_0x49880a[_0x1fdc67]=this[_0x4633('0x1d')](_0x49880a[_0x1fdc67],_0x3af747);}}return _0x49880a;};exports[_0x4633('0x23')]=function(_0x20ca8b){return _0x20ca8b[_0x4633('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x4633('0x25')]=function(_0x101371){return _0x101371[_0x4633('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x4633('0x26')]=function(_0x45a58f){var _0x182e12=[];_0x45a58f['split'](/[ ,]+/)[_0x4633('0x27')](function(_0x52fc85){_0x52fc85=_0x52fc85[_0x4633('0x28')](/([^:]")"+/g,'$1');_0x52fc85='+'+_0x52fc85+'*';var _0x20aa07=/[ `!@#$%^&*()_\-?~]/;if(_0x52fc85[_0x4633('0x24')](_0x20aa07))_0x52fc85='\x22'+_0x52fc85+'\x22';_0x182e12[_0x4633('0x29')](_0x52fc85);});return _0x182e12[_0x4633('0x2a')]('\x20');};exports[_0x4633('0x2b')]=function(_0x43e23f,_0x308865,_0x2c23c3){var _0x2c5505={},_0xa6d4db={};if(_0x308865[_0x4633('0x2c')][_0x4633('0x2d')]){_0x308865[_0x4633('0x2c')]['id']=_0x308865['query']['$id'];delete _0x308865[_0x4633('0x2c')][_0x4633('0x2d')];}_0x2c5505['model']=_[_0x4633('0x16')](_0x43e23f,_0x4633('0x2e'));_0x2c5505[_0x4633('0x2c')]=_[_0x4633('0x3')](_0x308865['query']);_0x2c5505[_0x4633('0x8')]=_['intersection'](_0x2c5505[_0x4633('0x2f')],_0x2c5505[_0x4633('0x2c')]);_0xa6d4db[_0x4633('0x30')]=_[_0x4633('0x31')](_0x2c5505[_0x4633('0x2f')],this[_0x4633('0x6')](_0x308865[_0x4633('0x2c')][_0x4633('0x6')]));_0xa6d4db['attributes']=_0xa6d4db[_0x4633('0x30')][_0x4633('0x1e')]?_0xa6d4db['attributes']:_0x2c5505[_0x4633('0x2f')];if(!_0x308865[_0x4633('0x2c')][_0x4633('0x22')](_0x4633('0x32'))){_0xa6d4db['limit']=this['limit'](_0x308865[_0x4633('0x2c')]['limit']);_0xa6d4db['offset']=this[_0x4633('0x33')](_0x308865['query']['offset']);}_0xa6d4db[_0x4633('0x34')]=this[_0x4633('0x15')](_0x308865[_0x4633('0x2c')][_0x4633('0x15')]);_0xa6d4db[_0x4633('0x35')]=this['filters'](_[_0x4633('0x36')](_0x308865['query'],_0x2c5505[_0x4633('0x8')]),_0x43e23f);if(_0x308865[_0x4633('0x2c')][_0x4633('0x37')]){var _0x402708=_0x43e23f;var _0x490a18=_0x308865[_0x4633('0x2c')]['filter'];if(typeof _0x490a18===_0x4633('0x38')){_0x402708=_[_0x4633('0x37')](_0x43e23f,function(_0x3c26d6){return _[_0x4633('0x4')](_0x490a18[_0x4633('0x39')],_0x3c26d6['name']);});_0x490a18=_0x490a18['value'];}_0xa6d4db[_0x4633('0x35')]=_[_0x4633('0x3a')](_0xa6d4db[_0x4633('0x35')],{'$or':_[_0x4633('0x16')](_0x402708,function(_0x45fe39){if(_0x45fe39['type']!==_0x4633('0x3b')){if(_0x2c23c3){return sequelize['where'](sequelize['fn'](_0x4633('0x3c'),sequelize['col'](_0x45fe39[_0x4633('0x2e')])),{'$like':sequelize['fn']('lower','%'+_0x308865[_0x4633('0x2c')][_0x4633('0x37')]+'%')});}else{var _0x4773d0={};_0x4773d0[_0x45fe39[_0x4633('0x2e')]]={'$like':'%'+_0x308865[_0x4633('0x2c')][_0x4633('0x37')]+'%'};return _0x4773d0;}}})});}_0xa6d4db=_[_0x4633('0x3a')]({},_0xa6d4db,_0x308865[_0x4633('0x3d')]);return _0xa6d4db;};
\ No newline at end of file
index b3f4319..79c84d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb4=['routealias','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','startCase','Queue','findOne','getAgents','all','map','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','mailPause','smsPause','voicePause','find','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','internal','substring','indexOf','validateSortParameter','sort','globalStatus','pauseType','toLowerCase','sortAgentsByStatus','online','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xaeb4,0xb6));var _0x4aeb=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xaeb4[_0x503564];return _0x4be9fd;};'use strict';var _=require(_0x4aeb('0x0'));var jayson=require(_0x4aeb('0x1'));var db=require(_0x4aeb('0x2'))['db'];var amiClient=jayson[_0x4aeb('0x3')][_0x4aeb('0x4')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x10dc47,_0x54e262){var _0x566205=[_0x10dc47[_0x4aeb('0x5')],_0x10dc47[_0x4aeb('0x6')],_0x10dc47['mailPause'],_0x10dc47[_0x4aeb('0x7')],_0x10dc47['smsPause'],_0x10dc47['voicePause'],_0x10dc47[_0x4aeb('0x8')]];if(!_0x54e262)return _[_0x4aeb('0x9')](_0x566205);var _0x178748=_[_0x4aeb('0xa')](_0x566205);return _0x178748[_0x4aeb('0xb')]>0x0&&_0x178748[_0x4aeb('0xb')]<_0x566205[_0x4aeb('0xb')]?!![]:![];}function isIdle(_0x201aa5){return _0x201aa5===_0x4aeb('0xc')||_0x201aa5==='unknown'||_0x201aa5===_0x4aeb('0xd')||_0x201aa5===_0x4aeb('0xe')||_[_0x4aeb('0xf')](_0x201aa5);}function isAgentIdle(_0x4eff01){if(_0x4eff01[_0x4aeb('0x10')]!=='idle'&&_0x4eff01['voicePause']){_0x4eff01[_0x4aeb('0x10')]=_0x4aeb('0x11');return![];}return _[_0x4aeb('0x9')]([_0x4eff01[_0x4aeb('0x12')],_0x4eff01[_0x4aeb('0x13')],_0x4eff01[_0x4aeb('0x14')],_0x4eff01[_0x4aeb('0x15')],_0x4eff01[_0x4aeb('0x16')],_0x4eff01[_0x4aeb('0x10')],_0x4eff01[_0x4aeb('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x4aeb('0x18')](_0x4aeb('0x19'),{})[_0x4aeb('0x1a')](function(_0x1ef601){if(_0x1ef601[_0x4aeb('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x254f24=_0x1ef601['result'];return routingClient[_0x4aeb('0x18')]('Agents',{})[_0x4aeb('0x1a')](function(_0x118eda){if(_0x118eda[_0x4aeb('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x16cc91=_0x118eda[_0x4aeb('0x1c')];return _[_0x4aeb('0x1d')]({},_0x254f24,_0x16cc91);});})[_0x4aeb('0x1e')](function(_0x2995e0){throw _0x2995e0;});}exports[_0x4aeb('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x389ff4){var _0x5407f6='unknown';if(isAgentPaused(_0x389ff4))_0x5407f6=_0x4aeb('0x11');else if(isAgentPaused(_0x389ff4,!![]))_0x5407f6=_0x4aeb('0x20');else if(isAgentIdle(_0x389ff4))_0x5407f6=_0x4aeb('0xc');else _0x5407f6='busy';return _0x5407f6;}exports[_0x4aeb('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x79060b,_0x1eab26){var _0x233561=_[_0x4aeb('0x22')](_0x79060b)?_0x79060b:[_0x79060b];var _0x3a1592=_[_0x4aeb('0x23')](_0x1eab26)+_0x4aeb('0x24');var _0x1d9e5e=_['map'](_0x233561,function(_0x5bb75f){return db[_0x3a1592][_0x4aeb('0x25')]({'where':{'id':_0x5bb75f}})[_0x4aeb('0x1a')](function(_0x337e8a){if(!_0x337e8a)return[];return _0x337e8a[_0x4aeb('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x4aeb('0x27')](_0x1d9e5e)[_0x4aeb('0x1a')](function(_0x42db5a){var _0x17c8c8=_(_0x42db5a)['flatten']()[_0x4aeb('0x28')]('id')['uniq']()[_0x4aeb('0x29')]();return _0x17c8c8;});}exports[_0x4aeb('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3445fe,_0x1af5dd,_0x1a87c2){try{if(_0x1af5dd[_0x4aeb('0xb')]>0x0){_0x3445fe=_0x3445fe[_0x4aeb('0xa')](function(_0x27faa6){return _0x1af5dd[_0x4aeb('0x2b')](_0x27faa6['id']);});}var _0xc6d9e2=_0x3445fe[_0x4aeb('0xa')](function(_0x33a1b1){var _0x538966='busy';if(isAgentIdle(_0x33a1b1)){_0x538966='idle';}return _0x538966===_0x1a87c2;});return _[_0x4aeb('0x28')](_0xc6d9e2,'id');}catch(_0x421296){throw _0x421296;}}exports[_0x4aeb('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x472d6e,_0x26e0b4,_0x588ad6){return Promise[_0x4aeb('0x2d')]()[_0x4aeb('0x1a')](function(){if(_0x26e0b4[_0x4aeb('0xb')]>0x0){_0x472d6e=_0x472d6e[_0x4aeb('0xa')](function(_0x569fe5){return _0x26e0b4['includes'](_0x569fe5['id']);});}return _0x472d6e;})[_0x4aeb('0x1a')](function(){return db['User'][_0x4aeb('0x2e')]({'attributes':['id',_0x4aeb('0x2f'),_0x4aeb('0x30'),_0x4aeb('0x5'),_0x4aeb('0x6'),_0x4aeb('0x31'),_0x4aeb('0x7'),_0x4aeb('0x32'),_0x4aeb('0x33'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0x4aeb('0x28')](_0x472d6e,'id')}},'raw':!![]});})[_0x4aeb('0x1a')](function(_0x4b158d){return _0x4b158d[_0x4aeb('0x28')](function(_0x3d341c){var _0x5795bb=_[_0x4aeb('0x34')](_0x472d6e,['id',_0x3d341c['id']]);var _0x2443cb=filterAgentAttributes(_0x5795bb);_[_0x4aeb('0x1d')](_0x3d341c,_0x2443cb);_0x3d341c['globalStatus']=getAgentStatus(_0x3d341c);return _0x3d341c;});})['then'](function(_0x3c4b2d){var _0x5bd36a=sortAgentsByStatus(_0x3c4b2d,_0x588ad6);return _[_0x4aeb('0x28')](_0x5bd36a,'id');})['catch'](function(_0x10aaaf){throw _0x10aaaf;});}exports[_0x4aeb('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x82ac3d){var _0x2f6d4e={'fields':[],'order':null};var _0x41c32c=_0x82ac3d[_0x4aeb('0x36')](',');_0x2f6d4e[_0x4aeb('0x37')]=_[_0x4aeb('0xa')](_0x41c32c,function(_0x460c7d){if(!_0x460c7d['includes']('globalStatus')){return!![];}_0x2f6d4e[_0x4aeb('0x38')]=_[_0x4aeb('0x39')](_0x460c7d,'-')?_0x4aeb('0x3a'):_0x4aeb('0x3b');return![];});return _0x2f6d4e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x37404e){if(_0x37404e[_0x4aeb('0x2b')](_0x4aeb('0x30'))&&!_0x37404e[_0x4aeb('0x2b')](_0x4aeb('0x3c'))){var _0x426d4f=_0x37404e[_0x4aeb('0x3d')](0x0,_0x37404e[_0x4aeb('0x3e')](_0x4aeb('0x30')));_0x37404e+=','+_0x426d4f+'internal';}return _0x37404e;}exports[_0x4aeb('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x4f7a12,_0x3c207c){var _0x56c7d7=_0x4f7a12[_0x4aeb('0x40')](function(_0x2ec817,_0x2215eb){if(_0x2ec817['globalStatus']===_0x2215eb['globalStatus']){if(_0x2ec817[_0x4aeb('0x41')]===_0x4aeb('0x11')){if(_0x3c207c===_0x4aeb('0x3a')){return(_0x2ec817['pauseType']||'')<(_0x2215eb[_0x4aeb('0x42')]||'')||_0x2ec817['fullname']['toLowerCase']()>_0x2215eb[_0x4aeb('0x30')][_0x4aeb('0x43')]()?0x1:-0x1;}else{return(_0x2ec817[_0x4aeb('0x42')]||'')<(_0x2215eb[_0x4aeb('0x42')]||'')||_0x2ec817[_0x4aeb('0x30')][_0x4aeb('0x43')]()>_0x2215eb[_0x4aeb('0x30')][_0x4aeb('0x43')]()?-0x1:0x1;}}else{if(_0x3c207c===_0x4aeb('0x3a')){return _0x2ec817[_0x4aeb('0x30')][_0x4aeb('0x43')]()<_0x2215eb['fullname'][_0x4aeb('0x43')]()?0x1:-0x1;}else{return _0x2ec817[_0x4aeb('0x30')][_0x4aeb('0x43')]()<_0x2215eb[_0x4aeb('0x30')][_0x4aeb('0x43')]()?-0x1:0x1;}}}else{if(_0x3c207c==='DESC'){return _0x2ec817['globalStatus']<_0x2215eb[_0x4aeb('0x41')]?0x1:-0x1;}else{return _0x2ec817['globalStatus']<_0x2215eb[_0x4aeb('0x41')]?-0x1:0x1;}}});return _0x56c7d7;}exports[_0x4aeb('0x44')]=sortAgentsByStatus;function filterAgentAttributes(_0x433d66){var _0x363003=['userpic',_0x4aeb('0x45'),'lastLoginAt',_0x4aeb('0x46'),_0x4aeb('0x42'),_0x4aeb('0x46'),_0x4aeb('0x3c'),_0x4aeb('0x47'),'chatPause','openchannelPause','mailPause',_0x4aeb('0x32'),_0x4aeb('0x8'),_0x4aeb('0x6'),_0x4aeb('0x33'),'chatCapacity',_0x4aeb('0x48'),_0x4aeb('0x49'),_0x4aeb('0x4a'),_0x4aeb('0x4b'),_0x4aeb('0x4c'),_0x4aeb('0x4d'),_0x4aeb('0x4e'),_0x4aeb('0x4f'),_0x4aeb('0x50'),'whatsappCurrentCapacity',_0x4aeb('0x51'),_0x4aeb('0x12'),'openchannelStatus',_0x4aeb('0x14'),'smsStatus',_0x4aeb('0x17'),_0x4aeb('0x13'),_0x4aeb('0x10'),_0x4aeb('0x52'),_0x4aeb('0x53'),_0x4aeb('0x54'),'smsStatusTime','whatsappStatusTime','faxStatusTime',_0x4aeb('0x55'),'queue',_0x4aeb('0x56'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x4aeb('0x57'),_0x4aeb('0x58')];var _0x1e8173=['chatPause',_0x4aeb('0x7'),'mailPause','smsPause','whatsappPause','faxPause',_0x4aeb('0x33'),_0x4aeb('0x45')];var _0x1af06d=_(_0x433d66)['omit'](_0x1e8173)[_0x4aeb('0x59')](_0x363003)[_0x4aeb('0x29')]();return _0x1af06d;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
+var _0x4324=['pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','*pause','busy','isArray','startCase','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','chatPause','mailPause','find','merge','globalStatus','catch','split','fields','order','startsWith','internal','sort','pauseType','toLowerCase','DESC','sortAgentsByStatus','userpic','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','online','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus'];(function(_0x550e03,_0x1b3b9c){var _0x493171=function(_0x2c9f68){while(--_0x2c9f68){_0x550e03['push'](_0x550e03['shift']());}};_0x493171(++_0x1b3b9c);}(_0x4324,0x1ab));var _0x4432=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0x4324[_0x17784a];return _0x41aded;};'use strict';var _=require('lodash');var jayson=require(_0x4432('0x0'));var db=require(_0x4432('0x1'))['db'];var amiClient=jayson[_0x4432('0x2')][_0x4432('0x3')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x43c4b4,_0x1a5491){var _0x35d119=[_0x43c4b4['chatPause'],_0x43c4b4[_0x4432('0x4')],_0x43c4b4['mailPause'],_0x43c4b4[_0x4432('0x5')],_0x43c4b4[_0x4432('0x6')],_0x43c4b4[_0x4432('0x7')],_0x43c4b4[_0x4432('0x8')]];if(!_0x1a5491)return _[_0x4432('0x9')](_0x35d119);var _0x46c91d=_[_0x4432('0xa')](_0x35d119);return _0x46c91d[_0x4432('0xb')]>0x0&&_0x46c91d['length']<_0x35d119[_0x4432('0xb')]?!![]:![];}function isIdle(_0xab46d2){return _0xab46d2===_0x4432('0xc')||_0xab46d2===_0x4432('0xd')||_0xab46d2===_0x4432('0xe')||_0xab46d2===_0x4432('0xf')||_[_0x4432('0x10')](_0xab46d2);}function isAgentIdle(_0x166528){if(_0x166528[_0x4432('0x11')]!=='idle'&&_0x166528[_0x4432('0x7')]){_0x166528[_0x4432('0x11')]=_0x4432('0x12');return![];}return _[_0x4432('0x9')]([_0x166528[_0x4432('0x13')],_0x166528[_0x4432('0x14')],_0x166528[_0x4432('0x15')],_0x166528[_0x4432('0x16')],_0x166528[_0x4432('0x17')],_0x166528[_0x4432('0x11')],_0x166528['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x4432('0x18')](_0x4432('0x19'),{})[_0x4432('0x1a')](function(_0x1db6af){if(_0x1db6af[_0x4432('0x1b')]){throw new Error(_0x4432('0x1c'));}var _0x289e33=_0x1db6af['result'];return routingClient[_0x4432('0x18')](_0x4432('0x19'),{})[_0x4432('0x1a')](function(_0x5d282d){if(_0x5d282d[_0x4432('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x57429f=_0x5d282d['result'];return _['merge']({},_0x289e33,_0x57429f);});})['catch'](function(_0x146438){throw _0x146438;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x3c7b85){var _0x5a73d3=_0x4432('0xd');if(isAgentPaused(_0x3c7b85))_0x5a73d3=_0x4432('0x12');else if(isAgentPaused(_0x3c7b85,!![]))_0x5a73d3=_0x4432('0x1d');else if(isAgentIdle(_0x3c7b85))_0x5a73d3=_0x4432('0xc');else _0x5a73d3=_0x4432('0x1e');return _0x5a73d3;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0xe53dc2,_0x1574ed){var _0x3495cd=_[_0x4432('0x1f')](_0xe53dc2)?_0xe53dc2:[_0xe53dc2];var _0x21e576=_[_0x4432('0x20')](_0x1574ed)+'Queue';var _0x5dfdd3=_[_0x4432('0x21')](_0x3495cd,function(_0x49c98c){return db[_0x21e576][_0x4432('0x22')]({'where':{'id':_0x49c98c}})[_0x4432('0x1a')](function(_0x454fbd){if(!_0x454fbd)return[];return _0x454fbd[_0x4432('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x4432('0x24')](_0x5dfdd3)[_0x4432('0x1a')](function(_0x57b884){var _0x4b3759=_(_0x57b884)[_0x4432('0x25')]()[_0x4432('0x21')]('id')[_0x4432('0x26')]()[_0x4432('0x27')]();return _0x4b3759;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5bb523,_0x396092,_0x2b3ff8){try{if(_0x396092['length']>0x0){_0x5bb523=_0x5bb523['filter'](function(_0x3dc1ce){return _0x396092['includes'](_0x3dc1ce['id']);});}var _0x5ce44f=_0x5bb523[_0x4432('0xa')](function(_0x5c47d7){var _0xb4583b=_0x4432('0x1e');if(isAgentIdle(_0x5c47d7)){_0xb4583b=_0x4432('0xc');}return _0xb4583b===_0x2b3ff8;});return _[_0x4432('0x21')](_0x5ce44f,'id');}catch(_0x1e67ac){throw _0x1e67ac;}}exports[_0x4432('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x43b24f,_0x4e392c,_0x1c0c25){return Promise[_0x4432('0x29')]()[_0x4432('0x1a')](function(){if(_0x4e392c[_0x4432('0xb')]>0x0){_0x43b24f=_0x43b24f[_0x4432('0xa')](function(_0x589e2b){return _0x4e392c[_0x4432('0x2a')](_0x589e2b['id']);});}return _0x43b24f;})[_0x4432('0x1a')](function(){return db[_0x4432('0x2b')][_0x4432('0x2c')]({'attributes':['id',_0x4432('0x2d'),_0x4432('0x2e'),_0x4432('0x2f'),'faxPause',_0x4432('0x30'),_0x4432('0x5'),_0x4432('0x6'),_0x4432('0x7'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0x4432('0x21')](_0x43b24f,'id')}},'raw':!![]});})[_0x4432('0x1a')](function(_0xaff73c){return _0xaff73c[_0x4432('0x21')](function(_0x59a131){var _0x139374=_[_0x4432('0x31')](_0x43b24f,['id',_0x59a131['id']]);var _0x2f37c9=filterAgentAttributes(_0x139374);_[_0x4432('0x32')](_0x59a131,_0x2f37c9);_0x59a131[_0x4432('0x33')]=getAgentStatus(_0x59a131);return _0x59a131;});})['then'](function(_0x38c62e){var _0x398a87=sortAgentsByStatus(_0x38c62e,_0x1c0c25);return _[_0x4432('0x21')](_0x398a87,'id');})[_0x4432('0x34')](function(_0x107b8e){throw _0x107b8e;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x37b550){var _0x523f2d={'fields':[],'order':null};var _0x584701=_0x37b550[_0x4432('0x35')](',');_0x523f2d[_0x4432('0x36')]=_[_0x4432('0xa')](_0x584701,function(_0x4bba46){if(!_0x4bba46[_0x4432('0x2a')](_0x4432('0x33'))){return!![];}_0x523f2d[_0x4432('0x37')]=_[_0x4432('0x38')](_0x4bba46,'-')?'DESC':'ASC';return![];});return _0x523f2d;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0xc8c500){if(_0xc8c500['includes']('fullname')&&!_0xc8c500[_0x4432('0x2a')](_0x4432('0x39'))){var _0x16b404=_0xc8c500['substring'](0x0,_0xc8c500['indexOf'](_0x4432('0x2e')));_0xc8c500+=','+_0x16b404+_0x4432('0x39');}return _0xc8c500;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x5fb210,_0x18c66b){var _0x5b4fd9=_0x5fb210[_0x4432('0x3a')](function(_0x30c0bc,_0x205dcd){if(_0x30c0bc['globalStatus']===_0x205dcd[_0x4432('0x33')]){if(_0x30c0bc['globalStatus']===_0x4432('0x12')){if(_0x18c66b==='DESC'){return(_0x30c0bc[_0x4432('0x3b')]||'')<(_0x205dcd[_0x4432('0x3b')]||'')||_0x30c0bc[_0x4432('0x2e')][_0x4432('0x3c')]()>_0x205dcd['fullname'][_0x4432('0x3c')]()?0x1:-0x1;}else{return(_0x30c0bc[_0x4432('0x3b')]||'')<(_0x205dcd[_0x4432('0x3b')]||'')||_0x30c0bc['fullname'][_0x4432('0x3c')]()>_0x205dcd[_0x4432('0x2e')][_0x4432('0x3c')]()?-0x1:0x1;}}else{if(_0x18c66b==='DESC'){return _0x30c0bc[_0x4432('0x2e')][_0x4432('0x3c')]()<_0x205dcd['fullname'][_0x4432('0x3c')]()?0x1:-0x1;}else{return _0x30c0bc[_0x4432('0x2e')]['toLowerCase']()<_0x205dcd[_0x4432('0x2e')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x18c66b===_0x4432('0x3d')){return _0x30c0bc[_0x4432('0x33')]<_0x205dcd['globalStatus']?0x1:-0x1;}else{return _0x30c0bc['globalStatus']<_0x205dcd[_0x4432('0x33')]?-0x1:0x1;}}});return _0x5b4fd9;}exports[_0x4432('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x390b97){var _0x200b08=[_0x4432('0x3f'),'online','lastLoginAt','lastPauseAt',_0x4432('0x3b'),_0x4432('0x40'),_0x4432('0x39'),'address','chatPause',_0x4432('0x5'),_0x4432('0x30'),'smsPause','whatsappPause',_0x4432('0x4'),_0x4432('0x7'),_0x4432('0x41'),_0x4432('0x42'),_0x4432('0x43'),'smsCapacity',_0x4432('0x44'),_0x4432('0x45'),_0x4432('0x46'),_0x4432('0x47'),'mailCurrentCapacity',_0x4432('0x48'),_0x4432('0x49'),_0x4432('0x4a'),'chatStatus',_0x4432('0x16'),_0x4432('0x15'),'smsStatus',_0x4432('0x4b'),'faxStatus',_0x4432('0x11'),_0x4432('0x4c'),_0x4432('0x4d'),_0x4432('0x4e'),_0x4432('0x4f'),'whatsappStatusTime',_0x4432('0x50'),_0x4432('0x51'),_0x4432('0x52'),_0x4432('0x53'),'screenrecording',_0x4432('0x54'),'phoneBarEnableAutomaticScreenRecording','routealias'];var _0x5a00cd=[_0x4432('0x2f'),'openchannelPause',_0x4432('0x30'),'smsPause',_0x4432('0x8'),'faxPause','voicePause',_0x4432('0x55')];var _0x5d85b2=_(_0x390b97)[_0x4432('0x56')](_0x5a00cd)[_0x4432('0x57')](_0x200b08)[_0x4432('0x27')]();return _0x5d85b2;}exports[_0x4432('0x58')]=filterAgentAttributes;
\ No newline at end of file
index 55c04d3..8067b4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','loggedIn','voice','outbound','originated','find','pick','initializeQueues','lodash','jayson/promise','util','http','client','available','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3a8281,_0x2f94f5){_0x3a8281=_0x3a8281-0x0;var _0x412e3a=_0x9ffd[_0x3a8281];return _0x412e3a;};'use strict';var _=require(_0xd9ff('0x0'));var jayson=require(_0xd9ff('0x1'));var util=require(_0xd9ff('0x2'));var amiClient=jayson['client'][_0xd9ff('0x3')]({'port':0x232a});var routingClient=jayson[_0xd9ff('0x4')][_0xd9ff('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd9ff('0x5'),'loggedIn',_0xd9ff('0x6'),_0xd9ff('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xd9ff('0x8'),_0xd9ff('0x9'),_0xd9ff('0xa'),_0xd9ff('0xb'),_0xd9ff('0xc'),_0xd9ff('0xd'),_0xd9ff('0xe'),_0xd9ff('0xf'),_0xd9ff('0x10'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated','message',_0xd9ff('0x11'),_0xd9ff('0x12'),_0xd9ff('0x13'),_0xd9ff('0x14'),_0xd9ff('0x15'),_0xd9ff('0x16'),_0xd9ff('0x17'),_0xd9ff('0x18'),'erlangBusyFactor','dialPredictiveInterval',_0xd9ff('0x19'),_0xd9ff('0x1a'),_0xd9ff('0x1b'),_0xd9ff('0x1c'),_0xd9ff('0x1d'),'predictiveIntervalDroppedCallsTimeout',_0xd9ff('0x1e'),_0xd9ff('0x1f'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0xf14c9f,_0x5db010){var _0x4ffe54=_0x5db010==='voice'?amiClient:routingClient;return _0x4ffe54['request'](_[_0xd9ff('0x20')](_0x5db010)+'Queues',_0xf14c9f)[_0xd9ff('0x21')](function(_0xa30fd2){if(_0xa30fd2[_0xd9ff('0x22')])throw new Error(util[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x5db010));return _0xa30fd2[_0xd9ff('0x25')];})[_0xd9ff('0x26')](function(_0x128588){throw _0x128588;});}exports[_0xd9ff('0x27')]=getRealtimeQueues;function initializeQueues(_0x1f028f,_0x3ea97d,_0x39ef37,_0x46a6ab){var _0x4c8740=DEFAULT_QUEUE_ATTRIBUTES;if(_0x39ef37==='voice'){if(_0x46a6ab===_0xd9ff('0x28')){_0x4c8740=_0x4c8740[_0xd9ff('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x46a6ab==='outbound'){_0x4c8740=_0x4c8740['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1f028f['map'](function(_0x4b1477){var _0x1f4d9e=_0x4b1477['get']({'plain':!![]});_0x1f4d9e[_0xd9ff('0x6')]=0x0;_0x1f4d9e[_0xd9ff('0xa')]=0x0;_0x1f4d9e[_0xd9ff('0x2a')]=0x0;_0x1f4d9e[_0xd9ff('0x5')]=0x0;_0x1f4d9e[_0xd9ff('0x7')]=0x0;if(_0x39ef37===_0xd9ff('0x2b')){_0x1f4d9e['talking']=0x0;_0x1f4d9e['busy']=0x0;if(_0x46a6ab===_0xd9ff('0x2c')){_0x1f4d9e['pTalking']=0x0;_0x1f4d9e[_0xd9ff('0x2d')]=0x0;}}var _0x4d86fe=_[_0xd9ff('0x2e')](_0x3ea97d,['id',_0x1f4d9e['id']]);if(_0x4d86fe){_['merge'](_0x1f4d9e,_[_0xd9ff('0x2f')](_0x4d86fe,_0x4c8740));}return _0x1f4d9e;});}exports[_0xd9ff('0x30')]=initializeQueues;
\ No newline at end of file
+var _0xb7e7=['dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','available','busy','merge','pick','initializeQueues','lodash','util','http','loggedIn','paused','waiting','invalid','loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','dialActive'];(function(_0x23270f,_0x24e94c){var _0x5a56b9=function(_0x2d4f34){while(--_0x2d4f34){_0x23270f['push'](_0x23270f['shift']());}};_0x5a56b9(++_0x24e94c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x7b7e('0x0'));var jayson=require('jayson/promise');var util=require(_0x7b7e('0x1'));var amiClient=jayson['client'][_0x7b7e('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0x7b7e('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x7b7e('0x3'),_0x7b7e('0x4'),_0x7b7e('0x5')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8'),'onHold',_0x7b7e('0x9'),_0x7b7e('0xa'),_0x7b7e('0xb'),_0x7b7e('0xc'),_0x7b7e('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7b7e('0xe'),_0x7b7e('0xf'),'message',_0x7b7e('0x10'),_0x7b7e('0x11'),_0x7b7e('0x12'),_0x7b7e('0x13'),_0x7b7e('0x14'),_0x7b7e('0x15'),_0x7b7e('0x16'),_0x7b7e('0x17'),_0x7b7e('0x18'),'dialPredictiveInterval',_0x7b7e('0x19'),_0x7b7e('0x1a'),'predictiveIntervalAvailable',_0x7b7e('0x1b'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x7b7e('0x1c'),_0x7b7e('0x1d'),_0x7b7e('0x1e')];function getRealtimeQueues(_0x457ec5,_0x3d2fb2){var _0x5703fd=_0x3d2fb2==='voice'?amiClient:routingClient;return _0x5703fd[_0x7b7e('0x1f')](_[_0x7b7e('0x20')](_0x3d2fb2)+_0x7b7e('0x21'),_0x457ec5)[_0x7b7e('0x22')](function(_0x2cc400){if(_0x2cc400[_0x7b7e('0x23')])throw new Error(util[_0x7b7e('0x24')](_0x7b7e('0x25'),_0x3d2fb2));return _0x2cc400[_0x7b7e('0x26')];})[_0x7b7e('0x27')](function(_0x12e8e9){throw _0x12e8e9;});}exports[_0x7b7e('0x28')]=getRealtimeQueues;function initializeQueues(_0x448980,_0x3bec7d,_0x9776c3,_0x864287){var _0x3a7b8b=DEFAULT_QUEUE_ATTRIBUTES;if(_0x9776c3==='voice'){if(_0x864287===_0x7b7e('0x29')){_0x3a7b8b=_0x3a7b8b[_0x7b7e('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x864287===_0x7b7e('0x2b')){_0x3a7b8b=_0x3a7b8b['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x448980[_0x7b7e('0x2c')](function(_0xbf0cb3){var _0x14243b=_0xbf0cb3[_0x7b7e('0x2d')]({'plain':!![]});_0x14243b[_0x7b7e('0x4')]=0x0;_0x14243b[_0x7b7e('0x7')]=0x0;_0x14243b[_0x7b7e('0x3')]=0x0;_0x14243b[_0x7b7e('0x2e')]=0x0;_0x14243b['waiting']=0x0;if(_0x9776c3==='voice'){_0x14243b['talking']=0x0;_0x14243b[_0x7b7e('0x2f')]=0x0;if(_0x864287===_0x7b7e('0x2b')){_0x14243b[_0x7b7e('0xe')]=0x0;_0x14243b['originated']=0x0;}}var _0x51d3b1=_['find'](_0x3bec7d,['id',_0x14243b['id']]);if(_0x51d3b1){_[_0x7b7e('0x30')](_0x14243b,_[_0x7b7e('0x31')](_0x51d3b1,_0x3a7b8b));}return _0x14243b;});}exports[_0x7b7e('0x32')]=initializeQueues;
\ No newline at end of file
index 79910b1..c6d27d5 100644 (file)
@@ -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(_0x493cea,_0x144c6a){var _0x1c32ba=function(_0x47c0f9){while(--_0x47c0f9){_0x493cea['push'](_0x493cea['shift']());}};_0x1c32ba(++_0x144c6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x390752,_0x42cad3){var _0x5eca55=function(_0x529961){while(--_0x529961){_0x390752['push'](_0x390752['shift']());}};_0x5eca55(++_0x42cad3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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
index f4d6c6e..8312053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb83c=['networkInterfaces','orderBy','keys','filter','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','map','model','join','update','digest','hex','getUuid','platform','licenseToken','win32','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb83c,0x1b4));var _0xcb83=function(_0x59be1f,_0x323cbc){_0x59be1f=_0x59be1f-0x0;var _0x20f23d=_0xb83c[_0x59be1f];return _0x20f23d;};'use strict';var _=require(_0xcb83('0x0'));var os=require('os');var crypto=require(_0xcb83('0x1'));var machine=require(_0xcb83('0x2'));var exec=require(_0xcb83('0x3'))[_0xcb83('0x4')];var config=require(_0xcb83('0x5'));function getInterfaces(){var _0x4773c7=[];var _0x5ccd3f=os[_0xcb83('0x6')]();var _0x515c4e=_[_0xcb83('0x7')](_[_0xcb83('0x8')](_0x5ccd3f));for(var _0x4ab638=0x0;_0x4ab638<_0x515c4e['length'];_0x4ab638++){var _0x81135a=_0x5ccd3f[_0x515c4e[_0x4ab638]][_0xcb83('0x9')](function(_0x234041){return _0x234041['family']===_0xcb83('0xa')&&_0x234041[_0xcb83('0xb')]===![];});_0x4773c7=_0x4773c7[_0xcb83('0xc')](_0x81135a);}return _0x4773c7;}function getFirstInterface(){var _0x5876cb=_[_0xcb83('0xd')](getInterfaces());return{'macAddress':_0x5876cb&&_0x5876cb[_0xcb83('0xe')]?_0x5876cb[_0xcb83('0xe')]:'00:00:00:00:00:00','ipAddress':_0x5876cb&&_0x5876cb[_0xcb83('0xf')]?_0x5876cb[_0xcb83('0xf')]:_0xcb83('0x10')};}exports[_0xcb83('0x11')]=getFirstInterface;function getCPUhash(){var _0x12ec1b=_[_0xcb83('0x7')](os['cpus']()[_0xcb83('0x12')](function(_0x22e0d4){return _0x22e0d4[_0xcb83('0x13')];}))[_0xcb83('0x14')](':');return crypto['createHash']('md5')[_0xcb83('0x15')](_0x12ec1b)[_0xcb83('0x16')](_0xcb83('0x17'));}exports[_0xcb83('0x18')]=function(){var _0x582a40=os[_0xcb83('0x19')]();var _0x485cca=/[0-9a-f-]{36}/;if(config[_0xcb83('0x1a')]&&_0x485cca['test'](config['licenseToken'])){return config[_0xcb83('0x1a')];}else if(_0x582a40===_0xcb83('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xcb83('0x1c')]('\x0d\x0a','');}else{var _0x5a8cf7=getFirstInterface();var _0x257a27=getCPUhash();var _0x4d73df=_0x257a27+'|'+os[_0xcb83('0x1d')]()+'|'+_0x5a8cf7[_0xcb83('0x1e')]+'|'+_0x5a8cf7[_0xcb83('0x1f')];var _0xfb1994=crypto[_0xcb83('0x20')]('md5')['update'](_0x4d73df)['digest'](_0xcb83('0x17'));return _0xfb1994['substring'](0x0,0x8)+'-'+_0xfb1994[_0xcb83('0x21')](0x8,0xc)+'-'+_0xfb1994[_0xcb83('0x21')](0xc,0x10)+'-'+_0xfb1994[_0xcb83('0x21')](0x10,0x14)+'-'+_0xfb1994[_0xcb83('0x21')](0x14);}};
\ No newline at end of file
+var _0xa161=['test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','createHash','md5','update','digest','hex','getUuid','platform','licenseToken'];(function(_0x10fe80,_0x170a91){var _0x47ec46=function(_0x38773d){while(--_0x38773d){_0x10fe80['push'](_0x10fe80['shift']());}};_0x47ec46(++_0x170a91);}(_0xa161,0x194));var _0x1a16=function(_0x1e7aa9,_0x3c3e2e){_0x1e7aa9=_0x1e7aa9-0x0;var _0x12cb03=_0xa161[_0x1e7aa9];return _0x12cb03;};'use strict';var _=require(_0x1a16('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x1a16('0x1'));var exec=require(_0x1a16('0x2'))[_0x1a16('0x3')];var config=require(_0x1a16('0x4'));function getInterfaces(){var _0x487260=[];var _0xa9867e=os['networkInterfaces']();var _0x53cf3c=_['orderBy'](_['keys'](_0xa9867e));for(var _0x2bcec1=0x0;_0x2bcec1<_0x53cf3c['length'];_0x2bcec1++){var _0x28fcc9=_0xa9867e[_0x53cf3c[_0x2bcec1]][_0x1a16('0x5')](function(_0x237d88){return _0x237d88[_0x1a16('0x6')]===_0x1a16('0x7')&&_0x237d88[_0x1a16('0x8')]===![];});_0x487260=_0x487260[_0x1a16('0x9')](_0x28fcc9);}return _0x487260;}function getFirstInterface(){var _0x2bf1b7=_[_0x1a16('0xa')](getInterfaces());return{'macAddress':_0x2bf1b7&&_0x2bf1b7[_0x1a16('0xb')]?_0x2bf1b7['mac']:_0x1a16('0xc'),'ipAddress':_0x2bf1b7&&_0x2bf1b7[_0x1a16('0xd')]?_0x2bf1b7[_0x1a16('0xd')]:_0x1a16('0xe')};}exports[_0x1a16('0xf')]=getFirstInterface;function getCPUhash(){var _0x3b1437=_[_0x1a16('0x10')](os[_0x1a16('0x11')]()[_0x1a16('0x12')](function(_0x43daa0){return _0x43daa0[_0x1a16('0x13')];}))['join'](':');return crypto[_0x1a16('0x14')](_0x1a16('0x15'))[_0x1a16('0x16')](_0x3b1437)[_0x1a16('0x17')](_0x1a16('0x18'));}exports[_0x1a16('0x19')]=function(){var _0x51cefd=os[_0x1a16('0x1a')]();var _0x358b1d=/[0-9a-f-]{36}/;if(config[_0x1a16('0x1b')]&&_0x358b1d[_0x1a16('0x1c')](config[_0x1a16('0x1b')])){return config[_0x1a16('0x1b')];}else if(_0x51cefd===_0x1a16('0x1d')){return exec(_0x1a16('0x1e'),{'encoding':_0x1a16('0x1f')})[_0x1a16('0x20')]('\x0d\x0a','');}else{var _0x33ef13=getFirstInterface();var _0x42af16=getCPUhash();var _0x405405=_0x42af16+'|'+os['hostname']()+'|'+_0x33ef13[_0x1a16('0x21')]+'|'+_0x33ef13[_0x1a16('0x22')];var _0x4fba17=crypto[_0x1a16('0x14')]('md5')[_0x1a16('0x16')](_0x405405)['digest'](_0x1a16('0x18'));return _0x4fba17['substring'](0x0,0x8)+'-'+_0x4fba17['substring'](0x8,0xc)+'-'+_0x4fba17[_0x1a16('0x23')](0xc,0x10)+'-'+_0x4fba17['substring'](0x10,0x14)+'-'+_0x4fba17['substring'](0x14);}};
\ No newline at end of file
index 0b42c67..1529972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8357=['SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo','version','./hardware','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x8357,0x1af));var _0x7835=function(_0x4c663c,_0x21c5af){_0x4c663c=_0x4c663c-0x0;var _0x1d138d=_0x8357[_0x4c663c];return _0x1d138d;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x7835('0x0'));var BPromise=require(_0x7835('0x1'));var pkginfo=require(_0x7835('0x2'))(module,_0x7835('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x7835('0x4'));var logger=require('../logger')('license');var HOST=_0x7835('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x53fc82){return new BPromise(function(_0x30c691,_0x551ad8){var _0x24a3b4=util[_0x7835('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x53fc82,module[_0x7835('0x7')]['version']);if(oldToken){_0x24a3b4=util['format'](_0x7835('0x8'),HOST,_0x53fc82,module[_0x7835('0x7')][_0x7835('0x3')],oldToken);}var _0xd3eeab={'uri':_0x24a3b4,'method':_0x7835('0x9'),'timeout':0xea60,'json':!![]};return rp(_0xd3eeab)['then'](function(_0x1cf2d7){_0x30c691(_0x1cf2d7);})[_0x7835('0xa')](function(_0x43985d){_0x551ad8(_0x43985d);});});}function manageLicense(_0x343794,_0x2b0c51){var _0x3d14a9=_0x2b0c51[_0x7835('0xb')]({'plain':!![]});if(!isOldTokenSent&&_0x3d14a9[_0x7835('0xc')]!==_0x343794&&!_0x3d14a9[_0x7835('0xd')]){oldToken=_0x3d14a9[_0x7835('0xc')];}httpRequest(_0x343794)[_0x7835('0xe')](function(_0x92b32a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x92b32a['active']){isOldTokenSent=![];if(!_0x3d14a9[_0x7835('0xf')]&&_0x3d14a9[_0x7835('0xf')]!=_0x92b32a[_0x7835('0xf')]||_0x3d14a9[_0x7835('0xf')]&&_0x3d14a9['data2']){logger[_0x7835('0x10')](_0x7835('0x11'));}if(_0x3d14a9[_0x7835('0xf')]&&!_0x3d14a9[_0x7835('0xd')]&&_0x3d14a9[_0x7835('0xf')]!=_0x92b32a[_0x7835('0xf')]){logger[_0x7835('0x10')](_0x7835('0x12'));}if(_0x3d14a9['license']&&!_0x3d14a9[_0x7835('0xd')]&&_0x3d14a9[_0x7835('0xf')]==_0x92b32a[_0x7835('0xf')]){return _0x2b0c51;}return _0x2b0c51[_0x7835('0x13')]({'data1':_0x343794,'data2':null,'license':_0x92b32a[_0x7835('0xf')]});}else{if(_0x92b32a[_0x7835('0xf')]||_0x3d14a9[_0x7835('0xf')]){if(!_0x3d14a9[_0x7835('0xd')]){if(_0x3d14a9[_0x7835('0xc')]==_0x343794){GRAY_PERIOD_REASON=_0x7835('0x14');logger['info'](_0x7835('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x7835('0x10')](_0x7835('0x16'),_0x3d14a9['data1'],_0x343794);}logger[_0x7835('0x10')](_0x7835('0x17'),GRAY_PERIOD_REASON[_0x7835('0x18')](),moment()[_0x7835('0x6')](_0x7835('0x19')));return _0x2b0c51[_0x7835('0x13')]({'data2':encryptor[_0x7835('0x1a')](moment()[_0x7835('0x6')](_0x7835('0x19')))});}else{if(moment()[_0x7835('0x1b')](encryptor[_0x7835('0x1c')](_0x3d14a9[_0x7835('0xd')]),'days')>DAYS){logger[_0x7835('0x10')](_0x7835('0x1d'),moment()[_0x7835('0x6')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2b0c51[_0x7835('0x13')]({'data1':_0x343794,'data2':null,'license':null});}}}else{if(_0x3d14a9[_0x7835('0xc')]!=_0x343794){logger['info'](_0x7835('0x16'),_0x3d14a9[_0x7835('0xc')],_0x343794);return _0x2b0c51[_0x7835('0x13')]({'data1':_0x343794,'data2':null,'license':null});}}}return _0x2b0c51;})['then'](function(_0x9876f1){_0x2b0c51=_0x9876f1;})['catch'](function(_0x1a84c6){logger[_0x7835('0x1e')](_0x1a84c6[_0x7835('0x1f')]);})[_0x7835('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x7835('0x21')](),_0x2b0c51);},TIME);});}function defaultLicense(){var _0x568887=hardware[_0x7835('0x21')]();if(_0x568887){return db[_0x7835('0x22')][_0x7835('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x568887}})[_0x7835('0x24')](function(_0x4e9d6e,_0x305a77){logger[_0x7835('0x10')](_0x7835('0x25'),_0x568887);manageLicense(_0x568887,_0x4e9d6e);})[_0x7835('0xa')](function(_0xfd533a){logger[_0x7835('0x1e')](_0xfd533a[_0x7835('0x1f')]);});}}exports[_0x7835('0x26')]=defaultLicense;
\ No newline at end of file
+var _0x0064=['YYYY-MM-DD\x20HH:mm','error','finally','getUuid','License','findOrCreate','spread','message','default','util','moment','request-promise','bluebird','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','data1','then','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','diff','days','DEMO\x20START\x20AT\x20%s'];(function(_0x2462c7,_0x51b09d){var _0x1afbf7=function(_0xea68dc){while(--_0xea68dc){_0x2462c7['push'](_0x2462c7['shift']());}};_0x1afbf7(++_0x51b09d);}(_0x0064,0xc7));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4006('0x0'));var moment=require(_0x4006('0x1'));var rp=require(_0x4006('0x2'));var BPromise=require(_0x4006('0x3'));var pkginfo=require('pkginfo')(module,_0x4006('0x4'));var db=require(_0x4006('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x4006('0x6'));var logger=require('../logger')(_0x4006('0x7'));var HOST=_0x4006('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x10b072){return new BPromise(function(_0x17e7b3,_0x47f530){var _0x2ea34c=util[_0x4006('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x10b072,module[_0x4006('0xa')][_0x4006('0x4')]);if(oldToken){_0x2ea34c=util[_0x4006('0x9')](_0x4006('0xb'),HOST,_0x10b072,module[_0x4006('0xa')]['version'],oldToken);}var _0x452682={'uri':_0x2ea34c,'method':_0x4006('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x452682)['then'](function(_0x3c3854){_0x17e7b3(_0x3c3854);})[_0x4006('0xd')](function(_0x27aee7){_0x47f530(_0x27aee7);});});}function manageLicense(_0xfb4cbb,_0x128de1){var _0xa1dc14=_0x128de1['get']({'plain':!![]});if(!isOldTokenSent&&_0xa1dc14[_0x4006('0xe')]!==_0xfb4cbb&&!_0xa1dc14['data2']){oldToken=_0xa1dc14[_0x4006('0xe')];}httpRequest(_0xfb4cbb)[_0x4006('0xf')](function(_0x293a6f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x293a6f[_0x4006('0x10')]){isOldTokenSent=![];if(!_0xa1dc14[_0x4006('0x7')]&&_0xa1dc14[_0x4006('0x7')]!=_0x293a6f[_0x4006('0x7')]||_0xa1dc14[_0x4006('0x7')]&&_0xa1dc14[_0x4006('0x11')]){logger[_0x4006('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xa1dc14[_0x4006('0x7')]&&!_0xa1dc14[_0x4006('0x11')]&&_0xa1dc14['license']!=_0x293a6f[_0x4006('0x7')]){logger[_0x4006('0x12')](_0x4006('0x13'));}if(_0xa1dc14[_0x4006('0x7')]&&!_0xa1dc14[_0x4006('0x11')]&&_0xa1dc14['license']==_0x293a6f[_0x4006('0x7')]){return _0x128de1;}return _0x128de1[_0x4006('0x14')]({'data1':_0xfb4cbb,'data2':null,'license':_0x293a6f['license']});}else{if(_0x293a6f[_0x4006('0x7')]||_0xa1dc14[_0x4006('0x7')]){if(!_0xa1dc14['data2']){if(_0xa1dc14[_0x4006('0xe')]==_0xfb4cbb){GRAY_PERIOD_REASON=_0x4006('0x15');logger[_0x4006('0x12')](_0x4006('0x16'));}else{GRAY_PERIOD_REASON=_0x4006('0x17');logger[_0x4006('0x12')](_0x4006('0x18'),_0xa1dc14[_0x4006('0xe')],_0xfb4cbb);}logger['info'](_0x4006('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x4006('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x128de1['update']({'data2':encryptor['encryptString'](moment()[_0x4006('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x4006('0x1a')](encryptor['decryptString'](_0xa1dc14['data2']),_0x4006('0x1b'))>DAYS){logger[_0x4006('0x12')](_0x4006('0x1c'),moment()[_0x4006('0x9')](_0x4006('0x1d')));isOldTokenSent=![];return _0x128de1[_0x4006('0x14')]({'data1':_0xfb4cbb,'data2':null,'license':null});}}}else{if(_0xa1dc14[_0x4006('0xe')]!=_0xfb4cbb){logger[_0x4006('0x12')](_0x4006('0x18'),_0xa1dc14[_0x4006('0xe')],_0xfb4cbb);return _0x128de1[_0x4006('0x14')]({'data1':_0xfb4cbb,'data2':null,'license':null});}}}return _0x128de1;})['then'](function(_0x5c9403){_0x128de1=_0x5c9403;})[_0x4006('0xd')](function(_0x446c01){logger[_0x4006('0x1e')](_0x446c01['message']);})[_0x4006('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0x4006('0x20')](),_0x128de1);},TIME);});}function defaultLicense(){var _0x4eda57=hardware['getUuid']();if(_0x4eda57){return db[_0x4006('0x21')][_0x4006('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x4eda57}})[_0x4006('0x23')](function(_0x1240ae,_0x495478){logger[_0x4006('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4eda57);manageLicense(_0x4eda57,_0x1240ae);})[_0x4006('0xd')](function(_0x46982b){logger['error'](_0x46982b[_0x4006('0x24')]);});}}exports[_0x4006('0x25')]=defaultLicense;
\ No newline at end of file
index 6cb2560..89b2de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe229=['users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','%s:%s:%s','parse','demo','machineUuid','deadline','days','format','grayReason','changed','disabled','message','findAll','role','sequelize','COUNT','count','admin','user'];(function(_0x541104,_0x222175){var _0x42427c=function(_0x2655e6){while(--_0x2655e6){_0x541104['push'](_0x541104['shift']());}};_0x42427c(++_0x222175);}(_0xe229,0x159));var _0x9e22=function(_0x1a9d24,_0x3f3eac){_0x1a9d24=_0x1a9d24-0x0;var _0x361426=_0xe229[_0x1a9d24];return _0x361426;};'use strict';var util=require(_0x9e22('0x0'));var _=require(_0x9e22('0x1'));var moment=require(_0x9e22('0x2'));var BPromise=require(_0x9e22('0x3'));var hardware=require(_0x9e22('0x4'));var encryptor=require(_0x9e22('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e22('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9e22('0x7'),'machineUuid':hardware[_0x9e22('0x8')](),'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':_0x9e22('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4cea66){return new BPromise(function(_0x5110d5,_0x3d3bb3){return db[_0x9e22('0xa')]['find'](_[_0x9e22('0xb')](_0x4cea66,{'raw':!![],'where':{'id':0x1}}))[_0x9e22('0xc')](function(_0x241b05){return checkLicense(_0x241b05,null);})[_0x9e22('0xc')](function(_0x411ca4){_0x5110d5(_0x411ca4);return;})[_0x9e22('0xd')](function(_0x38be4d){_0x3d3bb3(_0x38be4d);});});}function checkLicense(_0x44aa3a,_0x5d991d){if(!_0x44aa3a){demoLicense[_0x9e22('0xe')]=_0x44aa3a[_0x9e22('0xf')];return demoLicense;}try{var _0x507291=_0x5d991d||_0x44aa3a[_0x9e22('0x10')];if(_[_0x9e22('0x11')](_0x507291)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x167744=_0x44aa3a[_0x9e22('0xf')];var _0x33699d=_0x44aa3a[_0x9e22('0x12')];var _0x18dfcd=_0x167744[_0x9e22('0x13')]('-')[0x4];var _0x5ec47a=_0x167744[_0x9e22('0x13')]('-')[0x0];var _0x3524f3=encryptor[_0x9e22('0x14')](_0x507291,util['format'](_0x9e22('0x15'),_0x18dfcd,_0x167744,_0x5ec47a));var _0x2e244e=JSON[_0x9e22('0x16')](_0x3524f3);_0x2e244e[_0x9e22('0x17')]=![];_0x2e244e[_0x9e22('0xe')]=_0x167744;_0x2e244e[_0x9e22('0x18')]=hardware[_0x9e22('0x8')]();if(_0x33699d){var _0x14151d=encryptor[_0x9e22('0x14')](_0x33699d);_0x2e244e['gray']=_0x14151d;_0x2e244e[_0x9e22('0x19')]=moment(_0x14151d)['add'](0x7,_0x9e22('0x1a'))[_0x9e22('0x1b')]();_0x2e244e[_0x9e22('0x1c')]=_0x2e244e[_0x9e22('0xe')]!=_0x2e244e[_0x9e22('0x18')]?_0x9e22('0x1d'):_0x9e22('0x1e');}return _0x2e244e;}catch(_0x4034b9){breakingLicense[_0x9e22('0xe')]=_0x44aa3a[_0x9e22('0xf')];breakingLicense[_0x9e22('0x1f')]=_0x4034b9['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x55f4a3,_0x1749d3){getLicense()[_0x9e22('0xc')](function(_0x1ed4b1){return db['User'][_0x9e22('0x20')]({'attributes':[_0x9e22('0x21'),[db[_0x9e22('0x22')]['fn'](_0x9e22('0x23'),db[_0x9e22('0x22')]['col']('role')),_0x9e22('0x24')]],'group':_0x9e22('0x21'),'where':{'role':{'$or':[_0x9e22('0x25'),_0x9e22('0x26'),'telephone']}},'raw':!![]})['then'](function(_0x3556e5){var _0x26ced0={'user':_0x1ed4b1[_0x9e22('0x27')]||0x0,'telephone':_0x1ed4b1[_0x9e22('0x28')]||0x0};_0x3556e5[_0x9e22('0x29')](function(_0xc54f57){var _0x521fde=_0xc54f57[_0x9e22('0x21')]==='admin'?_0x9e22('0x26'):_0xc54f57[_0x9e22('0x21')];_0x26ced0[_0x521fde]-=_0xc54f57[_0x9e22('0x24')];if(_0x26ced0[_0x521fde]<0x0)_0x26ced0[_0x521fde]=0x0;});_0x55f4a3(_0x26ced0);return;});})['catch'](function(_0x5c90d2){_0x1749d3(_0x5c90d2);});});}function checkUserLimits(_0x11be46){return new BPromise(function(_0x45ca39,_0x4054f0){getLimits()[_0x9e22('0xc')](function(_0x4349f9){var _0x51d060=_[_0x9e22('0x2a')](_[_0x9e22('0x2b')](_0x11be46,_0x9e22('0x21')),[_0x9e22('0x25'),_0x9e22('0x26'),_0x9e22('0x2c')]);var _0x3fd9f1=(_0x51d060['admin']||0x0)+(_0x51d060['user']||0x0);var _0x3fcbb8=_0x51d060[_0x9e22('0x2c')]||0x0;if(_0x3fd9f1>_0x4349f9[_0x9e22('0x26')])return _0x4054f0(_0x9e22('0x2d'));if(_0x3fcbb8>_0x4349f9[_0x9e22('0x2c')])return _0x4054f0(_0x9e22('0x2e'));return _0x45ca39();})[_0x9e22('0xd')](function(_0x7fad78){_0x4054f0(_0x7fad78);});});}module[_0x9e22('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xcb34=['COUNT','sequelize','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','find','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','role'];(function(_0x1911bc,_0x10c83e){var _0x51ec6c=function(_0x37bdcb){while(--_0x37bdcb){_0x1911bc['push'](_0x1911bc['shift']());}};_0x51ec6c(++_0x10c83e);}(_0xcb34,0xa1));var _0x4cb3=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xcb34[_0x4d613c];return _0x301fe3;};'use strict';var util=require('util');var _=require(_0x4cb3('0x0'));var moment=require(_0x4cb3('0x1'));var BPromise=require(_0x4cb3('0x2'));var hardware=require(_0x4cb3('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x4cb3('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4cb3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4cb3('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4cb3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4cb3('0x7'),'machineUuid':hardware[_0x4cb3('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5e64d3){return new BPromise(function(_0x550c07,_0x5a84dd){return db['License'][_0x4cb3('0x9')](_['defaults'](_0x5e64d3,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3ec8df){return checkLicense(_0x3ec8df,null);})[_0x4cb3('0xa')](function(_0x3e1902){_0x550c07(_0x3e1902);return;})[_0x4cb3('0xb')](function(_0x3188d8){_0x5a84dd(_0x3188d8);});});}function checkLicense(_0x2f4ffe,_0x28fce6){if(!_0x2f4ffe){demoLicense[_0x4cb3('0xc')]=_0x2f4ffe[_0x4cb3('0xd')];return demoLicense;}try{var _0x46fae8=_0x28fce6||_0x2f4ffe['license'];if(_[_0x4cb3('0xe')](_0x46fae8)){throw new Error(_0x4cb3('0xf'));}var _0x373c66=_0x2f4ffe[_0x4cb3('0xd')];var _0x35fa70=_0x2f4ffe[_0x4cb3('0x10')];var _0x306bb0=_0x373c66[_0x4cb3('0x11')]('-')[0x4];var _0x138aa1=_0x373c66[_0x4cb3('0x11')]('-')[0x0];var _0x117ad4=encryptor[_0x4cb3('0x12')](_0x46fae8,util[_0x4cb3('0x13')](_0x4cb3('0x14'),_0x306bb0,_0x373c66,_0x138aa1));var _0x4aeb8e=JSON[_0x4cb3('0x15')](_0x117ad4);_0x4aeb8e[_0x4cb3('0x16')]=![];_0x4aeb8e[_0x4cb3('0xc')]=_0x373c66;_0x4aeb8e[_0x4cb3('0x17')]=hardware['getUuid']();if(_0x35fa70){var _0xcb8de5=encryptor[_0x4cb3('0x12')](_0x35fa70);_0x4aeb8e[_0x4cb3('0x18')]=_0xcb8de5;_0x4aeb8e[_0x4cb3('0x19')]=moment(_0xcb8de5)[_0x4cb3('0x1a')](0x7,_0x4cb3('0x1b'))[_0x4cb3('0x13')]();_0x4aeb8e[_0x4cb3('0x1c')]=_0x4aeb8e['uuid']!=_0x4aeb8e[_0x4cb3('0x17')]?_0x4cb3('0x1d'):_0x4cb3('0x1e');}return _0x4aeb8e;}catch(_0x2dcbbd){breakingLicense[_0x4cb3('0xc')]=_0x2f4ffe[_0x4cb3('0xd')];breakingLicense[_0x4cb3('0x1f')]=_0x2dcbbd['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x9433dd,_0x1278b0){getLicense()[_0x4cb3('0xa')](function(_0x4af89e){return db[_0x4cb3('0x20')][_0x4cb3('0x21')]({'attributes':[_0x4cb3('0x22'),[db['sequelize']['fn'](_0x4cb3('0x23'),db[_0x4cb3('0x24')]['col'](_0x4cb3('0x22'))),_0x4cb3('0x25')]],'group':'role','where':{'role':{'$or':['admin',_0x4cb3('0x26'),_0x4cb3('0x27')]}},'raw':!![]})[_0x4cb3('0xa')](function(_0x4458fa){var _0x537a8c={'user':_0x4af89e[_0x4cb3('0x28')]||0x0,'telephone':_0x4af89e[_0x4cb3('0x29')]||0x0};_0x4458fa[_0x4cb3('0x2a')](function(_0x3f3684){var _0x4b2ab3=_0x3f3684[_0x4cb3('0x22')]===_0x4cb3('0x2b')?_0x4cb3('0x26'):_0x3f3684[_0x4cb3('0x22')];_0x537a8c[_0x4b2ab3]-=_0x3f3684['count'];if(_0x537a8c[_0x4b2ab3]<0x0)_0x537a8c[_0x4b2ab3]=0x0;});_0x9433dd(_0x537a8c);return;});})[_0x4cb3('0xb')](function(_0x368874){_0x1278b0(_0x368874);});});}function checkUserLimits(_0x450a79){return new BPromise(function(_0x4a6070,_0x579886){getLimits()[_0x4cb3('0xa')](function(_0x1a4931){var _0x187504=_[_0x4cb3('0x2c')](_[_0x4cb3('0x2d')](_0x450a79,_0x4cb3('0x22')),['admin',_0x4cb3('0x26'),_0x4cb3('0x27')]);var _0x1252b0=(_0x187504[_0x4cb3('0x2b')]||0x0)+(_0x187504[_0x4cb3('0x26')]||0x0);var _0x4242aa=_0x187504[_0x4cb3('0x27')]||0x0;if(_0x1252b0>_0x1a4931[_0x4cb3('0x26')])return _0x579886(_0x4cb3('0x2e'));if(_0x4242aa>_0x1a4931[_0x4cb3('0x27')])return _0x579886(_0x4cb3('0x2f'));return _0x4a6070();})[_0x4cb3('0xb')](function(_0x87d91){_0x579886(_0x87d91);});});}module[_0x4cb3('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 98922a6..47bdf44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x4e6844,_0x4fffea){_0x4e6844=_0x4e6844-0x0;var _0x50117a=_0xd943[_0x4e6844];return _0x50117a;};'use strict';module[_0x3d94('0x0')]={'DOMAIN':_0x3d94('0x1'),'SESSION_SECRET':_0x3d94('0x2'),'GOOGLE_ID':_0x3d94('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x5eb8=['app-id','secret','myappanuglar-secret'];(function(_0x1e7fe6,_0x4ce9e2){var _0x2f84b3=function(_0x169505){while(--_0x169505){_0x1e7fe6['push'](_0x1e7fe6['shift']());}};_0x2f84b3(++_0x4ce9e2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0x5eb8[_0x23e33d];return _0x818fc;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x85eb('0x0'),'GOOGLE_ID':_0x85eb('0x1'),'GOOGLE_SECRET':_0x85eb('0x2'),'DEBUG':''};
\ No newline at end of file
index 750a903..76a977f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9688=['../utils/loggers','fileLogger','exports'];(function(_0xffdd08,_0x5cfdbc){var _0x2cb77f=function(_0x5a1b9a){while(--_0x5a1b9a){_0xffdd08['push'](_0xffdd08['shift']());}};_0x2cb77f(++_0x5cfdbc);}(_0x9688,0xf6));var _0x8968=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9688[_0xdea41a];return _0x15d0d8;};'use strict';var fileLogger=require(_0x8968('0x0'))[_0x8968('0x1')];module[_0x8968('0x2')]=fileLogger;
\ No newline at end of file
+var _0x9a9d=['fileLogger','exports','../utils/loggers'];(function(_0x384bc4,_0x4f7f81){var _0x2f83e4=function(_0x103cc6){while(--_0x103cc6){_0x384bc4['push'](_0x384bc4['shift']());}};_0x2f83e4(++_0x4f7f81);}(_0x9a9d,0x113));var _0xd9a9=function(_0x46190a,_0x1d94fa){_0x46190a=_0x46190a-0x0;var _0x439b1a=_0x9a9d[_0x46190a];return _0x439b1a;};'use strict';var fileLogger=require(_0xd9a9('0x0'))[_0xd9a9('0x1')];module[_0xd9a9('0x2')]=fileLogger;
\ No newline at end of file
index 152f014..7e2f3f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe751=['express','join','../../services/express/index.js','ami','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0xe751,0x168));var _0x1e75=function(_0x519ddd,_0x518d47){_0x519ddd=_0x519ddd-0x0;var _0x514788=_0xe751[_0x519ddd];return _0x514788;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x1e75('0x0'),'script':path[_0x1e75('0x1')](__dirname,_0x1e75('0x2'))},{'name':_0x1e75('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x1e75('0x1')](__dirname,_0x1e75('0x4'))},{'name':_0x1e75('0x5'),'script':path[_0x1e75('0x1')](__dirname,_0x1e75('0x6'))},{'name':'routing','script':path[_0x1e75('0x1')](__dirname,_0x1e75('0x7'))},{'name':_0x1e75('0x8'),'script':path[_0x1e75('0x1')](__dirname,_0x1e75('0x9'))}]};module['exports']=config;
\ No newline at end of file
+var _0xa664=['join','../../services/express/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express'];(function(_0x59eaf7,_0x54d303){var _0x1fd205=function(_0x2c316b){while(--_0x2c316b){_0x59eaf7['push'](_0x59eaf7['shift']());}};_0x1fd205(++_0x54d303);}(_0xa664,0x77));var _0x4a66=function(_0x23bf91,_0x24c565){_0x23bf91=_0x23bf91-0x0;var _0x372d2c=_0xa664[_0x23bf91];return _0x372d2c;};'use strict';var path=require(_0x4a66('0x0'));var os=require('os');var config={'apps':[{'name':_0x4a66('0x1'),'script':path[_0x4a66('0x2')](__dirname,_0x4a66('0x3'))},{'name':'ami','script':path[_0x4a66('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x4a66('0x2')](__dirname,_0x4a66('0x4'))},{'name':_0x4a66('0x5'),'script':path[_0x4a66('0x2')](__dirname,_0x4a66('0x6'))},{'name':_0x4a66('0x7'),'script':path[_0x4a66('0x2')](__dirname,_0x4a66('0x8'))},{'name':'xdr','script':path['join'](__dirname,_0x4a66('0x9'))}]};module[_0x4a66('0xa')]=config;
\ No newline at end of file
index a9aaaf5..0796f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae4d=['list','describe','delete','dump','saved','pm2','./config','start','then','disconnect','restart'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xae4d,0x1b2));var _0xdae4=function(_0x1533de,_0x15eee3){_0x1533de=_0x1533de-0x0;var _0x17124f=_0xae4d[_0x1533de];return _0x17124f;};'use strict';var pm2=require(_0xdae4('0x0'));var BPromise=require('bluebird');var config=require(_0xdae4('0x1'));function connect(){return new BPromise(function(_0x39409e,_0x4ae9a3){return pm2['connect'](function(_0x482449){if(_0x482449){return _0x4ae9a3(_0x482449);}return _0x39409e('connected');});});};exports[_0xdae4('0x2')]=function(_0x12eb84){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x5339d6,_0x3a372b){return pm2[_0xdae4('0x2')](_0x12eb84,function(_0x361c4d,_0x471a14){if(_0x361c4d){return _0x3a372b(_0x361c4d);}pm2[_0xdae4('0x4')]();return _0x5339d6(_0x471a14);});});});};exports['stop']=function(_0x5cd771){return connect()['then'](function(){return new BPromise(function(_0x40e04e,_0x3dfdf8){return pm2['stop'](_0x5cd771,function(_0x31f076,_0x7f73c){if(_0x31f076){return _0x3dfdf8(_0x31f076);}pm2[_0xdae4('0x4')]();return _0x40e04e(_0x7f73c);});});});};exports[_0xdae4('0x5')]=function(_0x22090a){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x1ade3d,_0x4bc70c){return pm2['restart'](_0x22090a,function(_0x5aa64c,_0x5c3bd4){if(_0x5aa64c){return _0x4bc70c(_0x5aa64c);}pm2['disconnect']();return _0x1ade3d(_0x5c3bd4);});});});};exports[_0xdae4('0x6')]=function(){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x148e04,_0x7a915c){return pm2[_0xdae4('0x6')](function(_0x5cec22,_0x48c029){if(_0x5cec22){return _0x7a915c(_0x5cec22);}pm2[_0xdae4('0x4')]();return _0x148e04(_0x48c029);});});});};exports[_0xdae4('0x7')]=function(_0x3d9226){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x4c0534,_0x175f0c){return pm2[_0xdae4('0x7')](_0x3d9226,function(_0x210dc8,_0x206ef6){if(_0x210dc8){return _0x175f0c(_0x210dc8);}pm2['disconnect']();return _0x4c0534(_0x206ef6);});});});};exports[_0xdae4('0x8')]=function(_0x33b03b){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x29e938,_0x5b0891){return pm2[_0xdae4('0x8')](_0x33b03b,function(_0x1d20e5,_0x410ed2){if(_0x1d20e5){return _0x5b0891(_0x1d20e5);}pm2[_0xdae4('0x4')]();return _0x29e938(_0x410ed2);});});});};exports['dump']=function(){return connect()[_0xdae4('0x3')](function(){return new BPromise(function(_0x45f808,_0xde1c52){return pm2[_0xdae4('0x9')](function(_0x268a45){if(_0x268a45){return _0xde1c52(_0x268a45);}return _0x45f808(_0xdae4('0xa'));});});});};
\ No newline at end of file
+var _0x3e68=['saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3e68,0x1d2));var _0x83e6=function(_0x25fe80,_0x321f79){_0x25fe80=_0x25fe80-0x0;var _0x5cec2e=_0x3e68[_0x25fe80];return _0x5cec2e;};'use strict';var pm2=require(_0x83e6('0x0'));var BPromise=require(_0x83e6('0x1'));var config=require(_0x83e6('0x2'));function connect(){return new BPromise(function(_0x727662,_0xb05fd9){return pm2[_0x83e6('0x3')](function(_0x41046e){if(_0x41046e){return _0xb05fd9(_0x41046e);}return _0x727662(_0x83e6('0x4'));});});};exports[_0x83e6('0x5')]=function(_0x18ddf3){return connect()[_0x83e6('0x6')](function(){return new BPromise(function(_0x24da20,_0x53c9b5){return pm2[_0x83e6('0x5')](_0x18ddf3,function(_0x1fc765,_0x4613f9){if(_0x1fc765){return _0x53c9b5(_0x1fc765);}pm2[_0x83e6('0x7')]();return _0x24da20(_0x4613f9);});});});};exports['stop']=function(_0x594399){return connect()[_0x83e6('0x6')](function(){return new BPromise(function(_0x4abea8,_0x18392d){return pm2[_0x83e6('0x8')](_0x594399,function(_0x3da8df,_0x4b5757){if(_0x3da8df){return _0x18392d(_0x3da8df);}pm2[_0x83e6('0x7')]();return _0x4abea8(_0x4b5757);});});});};exports[_0x83e6('0x9')]=function(_0x70976e){return connect()[_0x83e6('0x6')](function(){return new BPromise(function(_0x2eafcd,_0x4d2bf2){return pm2[_0x83e6('0x9')](_0x70976e,function(_0x14c7a0,_0x4adb9d){if(_0x14c7a0){return _0x4d2bf2(_0x14c7a0);}pm2[_0x83e6('0x7')]();return _0x2eafcd(_0x4adb9d);});});});};exports[_0x83e6('0xa')]=function(){return connect()[_0x83e6('0x6')](function(){return new BPromise(function(_0x870807,_0x19d8a8){return pm2[_0x83e6('0xa')](function(_0xd27ab8,_0x487d10){if(_0xd27ab8){return _0x19d8a8(_0xd27ab8);}pm2[_0x83e6('0x7')]();return _0x870807(_0x487d10);});});});};exports['describe']=function(_0x52780f){return connect()['then'](function(){return new BPromise(function(_0x581588,_0x4f770e){return pm2[_0x83e6('0xb')](_0x52780f,function(_0x28ce6d,_0x3f438c){if(_0x28ce6d){return _0x4f770e(_0x28ce6d);}pm2[_0x83e6('0x7')]();return _0x581588(_0x3f438c);});});});};exports[_0x83e6('0xc')]=function(_0x327b4a){return connect()['then'](function(){return new BPromise(function(_0x5576e6,_0x1fe911){return pm2[_0x83e6('0xc')](_0x327b4a,function(_0x4bacd3,_0x2ce3ce){if(_0x4bacd3){return _0x1fe911(_0x4bacd3);}pm2[_0x83e6('0x7')]();return _0x5576e6(_0x2ce3ce);});});});};exports[_0x83e6('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x32a5ee,_0x5789f9){return pm2[_0x83e6('0xd')](function(_0x52a2ef){if(_0x52a2ef){return _0x5789f9(_0x52a2ef);}return _0x32a5ee(_0x83e6('0xe'));});});});};
\ No newline at end of file
index de6dec9..5961518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f99=['defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis'];(function(_0x41f34a,_0x37c6e6){var _0x42155a=function(_0x27d184){while(--_0x27d184){_0x41f34a['push'](_0x41f34a['shift']());}};_0x42155a(++_0x37c6e6);}(_0x5f99,0xf1));var _0x95f9=function(_0x42f98a,_0x26f0a8){_0x42f98a=_0x42f98a-0x0;var _0x55832f=_0x5f99[_0x42f98a];return _0x55832f;};'use strict';var _=require(_0x95f9('0x0'));var moment=require(_0x95f9('0x1'));var Redis=require(_0x95f9('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x95f9('0x3'))['db'];var logger=require(_0x95f9('0x4'))(_0x95f9('0x5'));config[_0x95f9('0x6')]=_[_0x95f9('0x7')](config[_0x95f9('0x6')],{'host':_0x95f9('0x8'),'port':0x18eb});var io=require(_0x95f9('0x9'))(new Redis(config[_0x95f9('0x6')]));function closeInteractions(){var _0x465695=0x0;var _0x23216b=[];return db[_0x95f9('0xa')]['find']({'raw':!![],'attributes':['id',_0x95f9('0xb')],'where':{'id':0x1}})[_0x95f9('0xc')](function(_0x2180ec){_0x465695=_0x2180ec['chatTimeout'];if(_0x465695){return db[_0x95f9('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x95f9('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x95f9('0xf')](_0x2180ec['chatTimeout'],'minutes')}}});}else{return[];}})[_0x95f9('0xc')](function(_0x1807ba){if(_0x1807ba&&_0x1807ba[_0x95f9('0x10')]){_0x23216b=_[_0x95f9('0x11')](_0x1807ba||[],'id');logger['info'](_0x95f9('0x12'),_0x23216b[_0x95f9('0x13')]());return db[_0x95f9('0xd')][_0x95f9('0x14')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x95f9('0x15')](_0x95f9('0x16'))},{'where':{'id':_0x23216b}});}})['then'](function(){if(_0x23216b&&_0x23216b[_0x95f9('0x10')]){logger[_0x95f9('0x17')](_0x95f9('0x18'),_0x23216b[_0x95f9('0x13')]());for(var _0xe7973=0x0;_0xe7973<_0x23216b[_0x95f9('0x10')];_0xe7973++){io[_0x95f9('0x19')]('chatInteraction:update',{'id':_0x23216b[_0xe7973],'closed':!![]});}}})[_0x95f9('0x1a')](function(_0x3f0af1){logger[_0x95f9('0x1b')](_0x95f9('0x1c'),_0x3f0af1?util[_0x95f9('0x1d')](_0x3f0af1,{'showHidden':![],'depth':null}):'');});}exports[_0x95f9('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xce5c=['socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x405634,_0xafa6e4){var _0xbf9694=function(_0x2f3ad9){while(--_0x2f3ad9){_0x405634['push'](_0x405634['shift']());}};_0xbf9694(++_0xafa6e4);}(_0xce5c,0xe8));var _0xcce5=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xce5c[_0x2fbcf6];return _0x3e7265;};'use strict';var _=require('lodash');var moment=require(_0xcce5('0x0'));var Redis=require('ioredis');var util=require(_0xcce5('0x1'));var config=require('../../config/environment');var db=require(_0xcce5('0x2'))['db'];var logger=require(_0xcce5('0x3'))(_0xcce5('0x4'));config[_0xcce5('0x5')]=_[_0xcce5('0x6')](config[_0xcce5('0x5')],{'host':_0xcce5('0x7'),'port':0x18eb});var io=require(_0xcce5('0x8'))(new Redis(config[_0xcce5('0x5')]));function closeInteractions(){var _0x9dbf69=0x0;var _0x1cf94c=[];return db[_0xcce5('0x9')][_0xcce5('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xcce5('0xb')](function(_0x2c260d){_0x9dbf69=_0x2c260d[_0xcce5('0xc')];if(_0x9dbf69){return db[_0xcce5('0xd')][_0xcce5('0xe')]({'raw':!![],'attributes':['id',_0xcce5('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcce5('0x10')](_0x2c260d['chatTimeout'],'minutes')}}});}else{return[];}})[_0xcce5('0xb')](function(_0x9e7330){if(_0x9e7330&&_0x9e7330[_0xcce5('0x11')]){_0x1cf94c=_[_0xcce5('0x12')](_0x9e7330||[],'id');logger[_0xcce5('0x13')](_0xcce5('0x14'),_0x1cf94c['join']());return db[_0xcce5('0xd')][_0xcce5('0x15')]({'closeReason':'system','disposition':_0xcce5('0x16'),'closed':!![],'closedAt':moment()[_0xcce5('0x17')](_0xcce5('0x18'))},{'where':{'id':_0x1cf94c}});}})[_0xcce5('0xb')](function(){if(_0x1cf94c&&_0x1cf94c[_0xcce5('0x11')]){logger[_0xcce5('0x13')](_0xcce5('0x19'),_0x1cf94c['join']());for(var _0x5c70bf=0x0;_0x5c70bf<_0x1cf94c['length'];_0x5c70bf++){io['emit']('chatInteraction:update',{'id':_0x1cf94c[_0x5c70bf],'closed':!![]});}}})['catch'](function(_0x518ece){logger[_0xcce5('0x1a')](_0xcce5('0x1b'),_0x518ece?util[_0xcce5('0x1c')](_0x518ece,{'showHidden':![],'depth':null}):'');});}exports[_0xcce5('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index df08c86..ff79a85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce9=['startAllRefreshIntervals'];(function(_0x37f5ec,_0x2ef41a){var _0x326867=function(_0x2f54e1){while(--_0x2f54e1){_0x37f5ec['push'](_0x37f5ec['shift']());}};_0x326867(++_0x2ef41a);}(_0x3ce9,0xec));var _0x93ce=function(_0xe4e303,_0x8f9657){_0xe4e303=_0xe4e303-0x0;var _0x39021e=_0x3ce9[_0xe4e303];return _0x39021e;};'use strict';function start(){var _0x53cf88=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x53cf88[_0x93ce('0x0')]();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
+'use strict';function start(){var _0x11d300=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x11d300['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
index c7ca64f..7b1a37a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd7f=['error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','my\x20id','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','update','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0xbd7f,0xda));var _0xfbd7=function(_0x8dee07,_0xa35d0e){_0x8dee07=_0x8dee07-0x0;var _0x209715=_0xbd7f[_0x8dee07];return _0x209715;};'use strict';var fs=require('fs');var util=require(_0xfbd7('0x0'));var path=require('path');var _=require(_0xfbd7('0x1'));var moment=require(_0xfbd7('0x2'));var CronJobManager=require(_0xfbd7('0x3'));var jayson=require(_0xfbd7('0x4'));var BPromise=require(_0xfbd7('0x5'));var logger=require(_0xfbd7('0x6'))(_0xfbd7('0x7'));var db=require(_0xfbd7('0x8'))['db'];var analyticCustomReportController=require(_0xfbd7('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xfbd7('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24d589,_0x186c82){return function(){logger[_0xfbd7('0xb')](_0xfbd7('0xc'),_0x24d589[_0xfbd7('0xd')]);var _0x1e7fc0=!![];var _0x3ab216=_0x24d589[_0xfbd7('0xe')][_0xfbd7('0xf')]();var _0x1a1b86={'account':_0x3ab216,'message':{'from':util[_0xfbd7('0x10')]('\x22%s\x22\x20<%s>',_0x24d589[_0xfbd7('0xe')][_0xfbd7('0x11')],_0x24d589[_0xfbd7('0xe')]['email']||_0x24d589['MailAccount'][_0xfbd7('0x12')][_0xfbd7('0x13')]),'to':_0x24d589[_0xfbd7('0xd')],'cc':_0x24d589['cc'],'bcc':_0x24d589[_0xfbd7('0x14')],'subject':util[_0xfbd7('0x10')](_0xfbd7('0x15'),_0x186c82['name'],_0x24d589[_0xfbd7('0x16')],_0x24d589[_0xfbd7('0x17')])}};var _0x5e2ba7=path[_0xfbd7('0x18')](__dirname,'../../files/reports');var _0x4502ea=_0x186c82[_0xfbd7('0x19')];var _0x2b69c5=util[_0xfbd7('0x10')](_0xfbd7('0x1a'),path[_0xfbd7('0x1b')](_0x186c82[_0xfbd7('0x19')],path[_0xfbd7('0x1c')](_0x186c82[_0xfbd7('0x19')])),_0xfbd7('0x1d'));var _0xa7a83d=path[_0xfbd7('0x18')](_0x5e2ba7,_0x4502ea);var _0x25cbba=path[_0xfbd7('0x18')](_0x5e2ba7,_0x2b69c5);if(fs['existsSync'](_0xa7a83d)){_0x186c82[_0xfbd7('0x1e')]=_0xfbd7('0x1f');_0x1a1b86['message'][_0xfbd7('0x20')]=[{'filename':_0x4502ea,'path':_0xa7a83d}];_0x1a1b86[_0xfbd7('0x21')][_0xfbd7('0x22')]=util['format'](_0xfbd7('0x23'),JSON[_0xfbd7('0x24')](_0x186c82,null,0x2));}else if(fs['existsSync'](_0x25cbba)){_0x186c82['status']='Sent';_0x1a1b86[_0xfbd7('0x21')][_0xfbd7('0x20')]=[{'filename':_0x2b69c5,'path':_0x25cbba}];}else{_0x1a1b86['message']['text']=_0xfbd7('0x25');if(!_0x24d589['sendIfEmpty']){_0x1e7fc0=![];logger['info'](_0xfbd7('0x26'));}}if(_0x1e7fc0){return client[_0xfbd7('0x27')](_0xfbd7('0x28'),_0x1a1b86)[_0xfbd7('0x29')](function(_0x5d60e6){if(_0x5d60e6[_0xfbd7('0x2a')]){return logger[_0xfbd7('0x2a')](_0xfbd7('0x2b'),JSON[_0xfbd7('0x24')](_0x5d60e6));}return logger[_0xfbd7('0xb')](_0xfbd7('0x2c'));})[_0xfbd7('0x2d')](function(_0x2e3c83){return logger[_0xfbd7('0x2a')]('error\x20mail',JSON[_0xfbd7('0x24')](_0x2e3c83));});}};}function handleError(){return function(_0x3a767b){return logger[_0xfbd7('0x2a')](JSON[_0xfbd7('0x24')](_0x3a767b));};}function handleResult(_0x4fc30e){return function(_0x3f94b8){logger[_0xfbd7('0xb')](_0xfbd7('0x2e'),JSON[_0xfbd7('0x24')](_0x3f94b8));if(_0x4fc30e[_0xfbd7('0xe')]&&_0x4fc30e[_0xfbd7('0xe')][_0xfbd7('0x12')]&&!_[_0xfbd7('0x2f')](_0x4fc30e['email'])){setTimeout(handleSendEmail(_0x4fc30e,_0x3f94b8),0x3c*0x3e8);}};}function handleJob(_0x5ba058){return function(){try{if(_[_0xfbd7('0x2f')](_0x5ba058[_0xfbd7('0x16')])){return logger['info'](_0xfbd7('0x30'));}if(_['isNil'](_0x5ba058[_0xfbd7('0x17')])){return logger[_0xfbd7('0xb')](_0xfbd7('0x31'));}var _0x4bf46b={'startDate':moment()[_0xfbd7('0x32')](_0x5ba058[_0xfbd7('0x16')],_0x5ba058[_0xfbd7('0x17')])['format'](_0xfbd7('0x33')),'endDate':moment()[_0xfbd7('0x10')](_0xfbd7('0x33')),'type':_0xfbd7('0x34'),'output':_0x5ba058[_0xfbd7('0x35')],'name':_0x5ba058['name']};if(!_[_0xfbd7('0x2f')](_0x5ba058[_0xfbd7('0x36')])){logger[_0xfbd7('0xb')](_0xfbd7('0x37'),_0x5ba058[_0xfbd7('0x36')]);return analyticDefaultReportController[_0xfbd7('0x38')]({'id':_0x5ba058[_0xfbd7('0x36')]},_0x4bf46b)[_0xfbd7('0x29')](handleResult(_0x5ba058))[_0xfbd7('0x2d')](handleError());}if(!_[_0xfbd7('0x2f')](_0x5ba058[_0xfbd7('0x39')])){logger[_0xfbd7('0xb')](_0xfbd7('0x3a'),_0x5ba058[_0xfbd7('0x39')]);return analyticCustomReportController[_0xfbd7('0x38')]({'id':_0x5ba058[_0xfbd7('0x39')]},_0x4bf46b)[_0xfbd7('0x29')](handleResult(_0x5ba058))[_0xfbd7('0x2d')](handleError());}}catch(_0x453994){logger[_0xfbd7('0x2a')](JSON['stringify'](_0x453994));}return logger[_0xfbd7('0xb')](_0xfbd7('0x3b'));};}function getJobs(_0x56e82e){var _0x2dd02d={};if(_0x56e82e){_0x2dd02d['id']=_0x56e82e;}return db['Schedule'][_0xfbd7('0x3c')]({'where':_0x2dd02d,'include':[{'model':db['MailAccount'],'attributes':['id',_0xfbd7('0x11'),'email'],'include':[{'model':db[_0xfbd7('0x3d')],'as':'Smtp','include':[{'model':db[_0xfbd7('0x3e')],'as':_0xfbd7('0x3e')}]}]}]})[_0xfbd7('0x29')](function(_0x1c4efd){var _0x249da0=_[_0xfbd7('0x3f')](manager[_0xfbd7('0x40')]);var _0x27a022=_[_0xfbd7('0x41')](_0x1c4efd,function(_0x855d50){return _0x855d50['id'][_0xfbd7('0x42')]();});var _0x161022=_[_0xfbd7('0x43')](_0x1c4efd,function(_0x1c3a0a){return _0x1c3a0a['id'][_0xfbd7('0x42')]();});var _0x4015ce=_0x56e82e?_0x27a022:_[_0xfbd7('0x44')](_0x27a022,_0x249da0);var _0x1460b3=_[_0xfbd7('0x45')](_0x27a022,_0x249da0);var _0x861dde=_[_0xfbd7('0x44')](_0x249da0,_0x27a022);var _0x3f9449;var _0x139147;for(_0x3f9449=0x0;_0x3f9449<_0x861dde[_0xfbd7('0x46')]&&!_0x56e82e;_0x3f9449+=0x1){_0x139147=_0x861dde[_0x3f9449][_0xfbd7('0x42')]();if(manager[_0xfbd7('0x47')](_0x139147)){manager[_0xfbd7('0x48')](_0x139147);manager['deleteJob'](_0x139147);logger[_0xfbd7('0xb')](_0xfbd7('0x49'),_0x139147);}}logger[_0xfbd7('0xb')](_0xfbd7('0x4a'),JSON[_0xfbd7('0x24')](_0x4015ce));for(_0x3f9449=0x0;_0x3f9449<_0x4015ce[_0xfbd7('0x46')];_0x3f9449+=0x1){_0x139147=_0x4015ce[_0x3f9449][_0xfbd7('0x42')]();logger[_0xfbd7('0xb')]('index',_0x139147);if(_0x56e82e){logger[_0xfbd7('0xb')](_0xfbd7('0x4b'),_0x56e82e);logger[_0xfbd7('0xb')](JSON[_0xfbd7('0x24')](_0x161022[_0x139147]));BPromise['resolve']()['then'](handleJob(_0x161022[_0x139147]));logger['info']('run\x20job',_0x161022[_0x139147][_0xfbd7('0x11')],_0x161022[_0x139147][_0xfbd7('0x4c')]);}else if(_0x161022[_0x139147][_0xfbd7('0x4c')]&&_0x161022[_0x139147][_0xfbd7('0x4d')]&&moment()[_0xfbd7('0x4e')](_0x161022[_0x139147][_0xfbd7('0x4f')],_0x161022[_0x139147][_0xfbd7('0x50')])){manager[_0xfbd7('0x51')](_0x139147,_0x161022[_0x139147][_0xfbd7('0x4c')],handleJob(_0x161022[_0x139147]));manager[_0xfbd7('0x52')](_0x139147);logger[_0xfbd7('0xb')](_0xfbd7('0x53'),_0x161022[_0x139147][_0xfbd7('0x11')],_0x161022[_0x139147][_0xfbd7('0x4c')]);}else if(manager['exists'](_0x139147)){manager[_0xfbd7('0x48')](_0x139147);manager[_0xfbd7('0x54')](_0x139147);logger[_0xfbd7('0xb')]('stop\x20cron',_0x161022[_0x139147][_0xfbd7('0x11')],_0x161022[_0x139147][_0xfbd7('0x4c')]);}}for(_0x3f9449=0x0,_0x139147;_0x3f9449<_0x1460b3['length']&&!_0x56e82e;_0x3f9449+=0x1){_0x139147=_0x1460b3[_0x3f9449][_0xfbd7('0x42')]();if(manager['exists'](_0x139147)){if(_0x161022[_0x139147][_0xfbd7('0x4c')]&&_0x161022[_0x139147]['active']&&moment()[_0xfbd7('0x4e')](_0x161022[_0x139147][_0xfbd7('0x4f')],_0x161022[_0x139147][_0xfbd7('0x50')])){manager[_0xfbd7('0x55')](_0x139147,_0x161022[_0x139147][_0xfbd7('0x4c')],handleJob(_0x161022[_0x139147]));logger['info']('update\x20cron',_0x161022[_0x139147][_0xfbd7('0x11')],_0x161022[_0x139147]['cron']);}else{manager[_0xfbd7('0x48')](_0x139147);manager[_0xfbd7('0x54')](_0x139147);logger[_0xfbd7('0xb')]('stop\x20cron',_0x161022[_0x139147]['name'],_0x161022[_0x139147][_0xfbd7('0x4c')]);}}}})['catch'](function(_0x1ee3e8){logger[_0xfbd7('0x2a')](JSON[_0xfbd7('0x24')](_0x1ee3e8));});}exports[_0xfbd7('0x56')]=function(_0x515a0b){return getJobs(_0x515a0b);};exports[_0xfbd7('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x1855=['basename','extname','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','catch','error\x20mail','data','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update\x20cron','util','lodash','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x1855,0xea));var _0x5185=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x1855[_0x1fc122];return _0xa2cb13;};'use strict';var fs=require('fs');var util=require(_0x5185('0x0'));var path=require('path');var _=require(_0x5185('0x1'));var moment=require('moment');var CronJobManager=require(_0x5185('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x5185('0x3'));var logger=require('../logger')(_0x5185('0x4'));var db=require(_0x5185('0x5'))['db'];var analyticCustomReportController=require(_0x5185('0x6'));var analyticDefaultReportController=require(_0x5185('0x7'));var client=jayson[_0x5185('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x19b962,_0x1ea53d){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x19b962[_0x5185('0x9')]);var _0x4b6f04=!![];var _0x27a850=_0x19b962[_0x5185('0xa')][_0x5185('0xb')]();var _0x4df5ae={'account':_0x27a850,'message':{'from':util[_0x5185('0xc')](_0x5185('0xd'),_0x19b962[_0x5185('0xa')][_0x5185('0xe')],_0x19b962['MailAccount'][_0x5185('0x9')]||_0x19b962[_0x5185('0xa')]['Smtp'][_0x5185('0xf')]),'to':_0x19b962[_0x5185('0x9')],'cc':_0x19b962['cc'],'bcc':_0x19b962['bcc'],'subject':util['format'](_0x5185('0x10'),_0x1ea53d[_0x5185('0xe')],_0x19b962['subtractNumber'],_0x19b962[_0x5185('0x11')])}};var _0x5d0cdc=path[_0x5185('0x12')](__dirname,_0x5185('0x13'));var _0x30eb6f=_0x1ea53d[_0x5185('0x14')];var _0x13b5a7=util[_0x5185('0xc')]('%s.%s',path[_0x5185('0x15')](_0x1ea53d[_0x5185('0x14')],path[_0x5185('0x16')](_0x1ea53d[_0x5185('0x14')])),'zip');var _0x5d74f4=path[_0x5185('0x12')](_0x5d0cdc,_0x30eb6f);var _0x57de75=path[_0x5185('0x12')](_0x5d0cdc,_0x13b5a7);if(fs[_0x5185('0x17')](_0x5d74f4)){_0x1ea53d[_0x5185('0x18')]=_0x5185('0x19');_0x4df5ae[_0x5185('0x1a')]['attachments']=[{'filename':_0x30eb6f,'path':_0x5d74f4}];_0x4df5ae[_0x5185('0x1a')][_0x5185('0x1b')]=util[_0x5185('0xc')](_0x5185('0x1c'),JSON[_0x5185('0x1d')](_0x1ea53d,null,0x2));}else if(fs['existsSync'](_0x57de75)){_0x1ea53d[_0x5185('0x18')]='Sent';_0x4df5ae[_0x5185('0x1a')][_0x5185('0x1e')]=[{'filename':_0x13b5a7,'path':_0x57de75}];}else{_0x4df5ae[_0x5185('0x1a')][_0x5185('0x1b')]=_0x5185('0x1f');if(!_0x19b962[_0x5185('0x20')]){_0x4b6f04=![];logger[_0x5185('0x21')](_0x5185('0x22'));}}if(_0x4b6f04){return client[_0x5185('0x23')](_0x5185('0x24'),_0x4df5ae)['then'](function(_0x473587){if(_0x473587[_0x5185('0x25')]){return logger[_0x5185('0x25')]('error\x20mail',JSON[_0x5185('0x1d')](_0x473587));}return logger[_0x5185('0x21')](_0x5185('0x26'));})[_0x5185('0x27')](function(_0x257265){return logger[_0x5185('0x25')](_0x5185('0x28'),JSON[_0x5185('0x1d')](_0x257265));});}};}function handleError(){return function(_0x315e6a){return logger[_0x5185('0x25')](JSON[_0x5185('0x1d')](_0x315e6a));};}function handleResult(_0x12e59a){return function(_0x56c44c){logger[_0x5185('0x21')](_0x5185('0x29'),JSON[_0x5185('0x1d')](_0x56c44c));if(_0x12e59a['MailAccount']&&_0x12e59a['MailAccount'][_0x5185('0x2a')]&&!_[_0x5185('0x2b')](_0x12e59a[_0x5185('0x9')])){setTimeout(handleSendEmail(_0x12e59a,_0x56c44c),0x3c*0x3e8);}};}function handleJob(_0x1968e2){return function(){try{if(_['isNil'](_0x1968e2[_0x5185('0x2c')])){return logger[_0x5185('0x21')](_0x5185('0x2d'));}if(_[_0x5185('0x2b')](_0x1968e2['subtractUnit'])){return logger[_0x5185('0x21')](_0x5185('0x2e'));}var _0x264100={'startDate':moment()[_0x5185('0x2f')](_0x1968e2['subtractNumber'],_0x1968e2[_0x5185('0x11')])[_0x5185('0xc')](_0x5185('0x30')),'endDate':moment()[_0x5185('0xc')](_0x5185('0x30')),'type':_0x5185('0x31'),'output':_0x1968e2['output'],'name':_0x1968e2[_0x5185('0xe')]};if(!_[_0x5185('0x2b')](_0x1968e2['DefaultReportId'])){logger[_0x5185('0x21')](_0x5185('0x32'),_0x1968e2['DefaultReportId']);return analyticDefaultReportController[_0x5185('0x33')]({'id':_0x1968e2['DefaultReportId']},_0x264100)[_0x5185('0x34')](handleResult(_0x1968e2))[_0x5185('0x27')](handleError());}if(!_[_0x5185('0x2b')](_0x1968e2[_0x5185('0x35')])){logger[_0x5185('0x21')](_0x5185('0x36'),_0x1968e2[_0x5185('0x35')]);return analyticCustomReportController[_0x5185('0x33')]({'id':_0x1968e2[_0x5185('0x35')]},_0x264100)[_0x5185('0x34')](handleResult(_0x1968e2))[_0x5185('0x27')](handleError());}}catch(_0x16e99a){logger[_0x5185('0x25')](JSON[_0x5185('0x1d')](_0x16e99a));}return logger[_0x5185('0x21')](_0x5185('0x37'));};}function getJobs(_0x33f88d){var _0x285c34={};if(_0x33f88d){_0x285c34['id']=_0x33f88d;}return db[_0x5185('0x38')][_0x5185('0x39')]({'where':_0x285c34,'include':[{'model':db[_0x5185('0xa')],'attributes':['id',_0x5185('0xe'),'email'],'include':[{'model':db[_0x5185('0x3a')],'as':_0x5185('0x2a'),'include':[{'model':db[_0x5185('0x3b')],'as':_0x5185('0x3b')}]}]}]})[_0x5185('0x34')](function(_0x2fbbfc){var _0x4bdcfc=_[_0x5185('0x3c')](manager['jobs']);var _0x3c61e9=_[_0x5185('0x3d')](_0x2fbbfc,function(_0x27ed73){return _0x27ed73['id'][_0x5185('0x3e')]();});var _0x30e256=_[_0x5185('0x3f')](_0x2fbbfc,function(_0x5f0f55){return _0x5f0f55['id'][_0x5185('0x3e')]();});var _0x33e125=_0x33f88d?_0x3c61e9:_[_0x5185('0x40')](_0x3c61e9,_0x4bdcfc);var _0x594dc4=_[_0x5185('0x41')](_0x3c61e9,_0x4bdcfc);var _0x222d22=_[_0x5185('0x40')](_0x4bdcfc,_0x3c61e9);var _0x52ef13;var _0x269ff7;for(_0x52ef13=0x0;_0x52ef13<_0x222d22[_0x5185('0x42')]&&!_0x33f88d;_0x52ef13+=0x1){_0x269ff7=_0x222d22[_0x52ef13][_0x5185('0x3e')]();if(manager[_0x5185('0x43')](_0x269ff7)){manager[_0x5185('0x44')](_0x269ff7);manager[_0x5185('0x45')](_0x269ff7);logger['info'](_0x5185('0x46'),_0x269ff7);}}logger['info']('toRun',JSON[_0x5185('0x1d')](_0x33e125));for(_0x52ef13=0x0;_0x52ef13<_0x33e125['length'];_0x52ef13+=0x1){_0x269ff7=_0x33e125[_0x52ef13][_0x5185('0x3e')]();logger[_0x5185('0x21')](_0x5185('0x47'),_0x269ff7);if(_0x33f88d){logger[_0x5185('0x21')](_0x5185('0x48'),_0x33f88d);logger[_0x5185('0x21')](JSON[_0x5185('0x1d')](_0x30e256[_0x269ff7]));BPromise[_0x5185('0x49')]()[_0x5185('0x34')](handleJob(_0x30e256[_0x269ff7]));logger[_0x5185('0x21')](_0x5185('0x4a'),_0x30e256[_0x269ff7]['name'],_0x30e256[_0x269ff7][_0x5185('0x4b')]);}else if(_0x30e256[_0x269ff7][_0x5185('0x4b')]&&_0x30e256[_0x269ff7][_0x5185('0x4c')]&&moment()[_0x5185('0x4d')](_0x30e256[_0x269ff7][_0x5185('0x4e')],_0x30e256[_0x269ff7]['endAt'])){manager[_0x5185('0x4f')](_0x269ff7,_0x30e256[_0x269ff7][_0x5185('0x4b')],handleJob(_0x30e256[_0x269ff7]));manager[_0x5185('0x50')](_0x269ff7);logger[_0x5185('0x21')](_0x5185('0x51'),_0x30e256[_0x269ff7][_0x5185('0xe')],_0x30e256[_0x269ff7][_0x5185('0x4b')]);}else if(manager[_0x5185('0x43')](_0x269ff7)){manager[_0x5185('0x44')](_0x269ff7);manager[_0x5185('0x45')](_0x269ff7);logger[_0x5185('0x21')](_0x5185('0x52'),_0x30e256[_0x269ff7][_0x5185('0xe')],_0x30e256[_0x269ff7][_0x5185('0x4b')]);}}for(_0x52ef13=0x0,_0x269ff7;_0x52ef13<_0x594dc4[_0x5185('0x42')]&&!_0x33f88d;_0x52ef13+=0x1){_0x269ff7=_0x594dc4[_0x52ef13]['toString']();if(manager['exists'](_0x269ff7)){if(_0x30e256[_0x269ff7]['cron']&&_0x30e256[_0x269ff7]['active']&&moment()['isBetween'](_0x30e256[_0x269ff7][_0x5185('0x4e')],_0x30e256[_0x269ff7][_0x5185('0x53')])){manager['update'](_0x269ff7,_0x30e256[_0x269ff7][_0x5185('0x4b')],handleJob(_0x30e256[_0x269ff7]));logger['info'](_0x5185('0x54'),_0x30e256[_0x269ff7][_0x5185('0xe')],_0x30e256[_0x269ff7][_0x5185('0x4b')]);}else{manager['stop'](_0x269ff7);manager[_0x5185('0x45')](_0x269ff7);logger[_0x5185('0x21')]('stop\x20cron',_0x30e256[_0x269ff7][_0x5185('0xe')],_0x30e256[_0x269ff7][_0x5185('0x4b')]);}}}})[_0x5185('0x27')](function(_0x4b5466){logger[_0x5185('0x25')](JSON[_0x5185('0x1d')](_0x4b5466));});}exports['run']=function(_0x2d96d4){return getJobs(_0x2d96d4);};exports[_0x5185('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 429ae69..65094f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cda=['TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','transcripts','length','results','tempSentiment','Sequelize','sentimentAccountId','language','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','sentimentRegion','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','inspect','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','getTranscriptionJob','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var AWS=require(_0xa7cd('0x0'));var rp=require(_0xa7cd('0x1'));var util=require(_0xa7cd('0x2'));var BPromise=require('bluebird');var db=require(_0xa7cd('0x3'))['db'];var logger=require(_0xa7cd('0x4'))('transcribe');function getTranscriptionJob(_0x232be5,_0xdb8470,_0x5560e0,_0x37990d){return new Promise(function(_0x5f20a2,_0x3d43e6){var _0x5c2b39=new AWS['TranscribeService']({'accessKeyId':_0xdb8470,'secretAccessKey':_0x232be5,'region':_0x5560e0});_0x5c2b39[_0xa7cd('0x5')]({'TranscriptionJobName':_0x37990d},function(_0x4a9e39,_0x2554e8){if(_0x4a9e39){return _0x3d43e6(_0x4a9e39);}else{return _0x5f20a2(_0x2554e8);}});});}function sentiment(_0x205075,_0x108be3,_0x6d21d3,_0x31879f,_0x372273){return new Promise(function(_0x39d8c4,_0x1a66f7){var _0xd20e5d=new AWS['Comprehend']({'accessKeyId':_0x108be3,'secretAccessKey':_0x205075,'region':_0x6d21d3});_0xd20e5d['detectSentiment']({'Text':_0x31879f,'LanguageCode':_0x372273[_0xa7cd('0x6')](0x0,0x2)},function(_0xf902eb,_0x53cf92){if(_0xf902eb){return _0x1a66f7(_0xf902eb);}else{return _0x39d8c4(_0x53cf92);}});});}function checkTranscribeJob(_0xc60cec,_0x4056ee,_0x57fb93){var _0x3bbf3b;return new BPromise(function(_0x3f72f8,_0x136aae){logger['info'](util[_0xa7cd('0x7')](_0xa7cd('0x8'),_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')]));return getTranscriptionJob(_0x57fb93[_0xa7cd('0xa')],_0x57fb93[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0xc')],_0xc60cec['transcribeName'])['then'](function(_0x44d991){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')],_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus']));if(!_0xc60cec[_0xa7cd('0xf')]){switch(_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x10')]){case'COMPLETED':var _0x111774={'transcribeStatus':_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus'],'fileUri':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x11')][_0xa7cd('0x12')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xc60cec['id']));return rp({'uri':_0x44d991[_0xa7cd('0xe')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xa7cd('0x13')](function(_0x4dc29b){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xc60cec['id']));if(_0x4dc29b&&_0x4dc29b['results']&&_0x4dc29b['results'][_0xa7cd('0x14')]&&_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')]){_0x111774['fileText']='';for(var _0x39f093=0x0;_0x39f093<_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')];_0x39f093++){_0x111774['fileText']+=_0x4dc29b[_0xa7cd('0x16')][_0xa7cd('0x14')][_0x39f093]['transcript']+'';}}return _0xc60cec['update'](_0x111774);})[_0xa7cd('0x13')](function(){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee['sentimentRegion']||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x111774[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')]['findOne']({'where':{'id':_settings[_0xa7cd('0x19')]}});}})[_0xa7cd('0x13')](function(_0xb4cfa){if(!_0xb4cfa){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0xb4cfa[_0xa7cd('0xa')]||!_0xb4cfa[_0xa7cd('0xb')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0x3bbf3b=_0xb4cfa;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xc60cec['id']));return sentiment(_0x3bbf3b['data1'],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0x111774['fileText'],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x29c3d2){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x29c3d2[_0xa7cd('0x21')],'sPositive':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x29c3d2['SentimentScore']['Negative'],'sMixed':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x25')]});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});case _0xa7cd('0x26'):return _0xc60cec[_0xa7cd('0x20')]({'transcribeStatus':_0xa7cd('0x26'),'failureReason':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x27')]})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});default:logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x28'),_0xc60cec['id']));break;}}else{return BPromise[_0xa7cd('0x29')]()[_0xa7cd('0x13')](function(){if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee[_0xa7cd('0x1f')]||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee['bucket']){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x2a'));}if(!_0xc60cec[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_settings[_0xa7cd('0x19')]}});}})['then'](function(_0x5d2b48){if(!_0x5d2b48){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x5d2b48[_0xa7cd('0xa')]||!_0x5d2b48['data2']){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x2c'));}_0x3bbf3b=_0x5d2b48;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2d'),_0xc60cec['id']));return sentiment(_0x3bbf3b[_0xa7cd('0xa')],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0xc60cec[_0xa7cd('0xf')],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x31577f){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2e'),_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x31577f['Sentiment'],'sPositive':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x2f')],'sMixed':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x31577f[_0xa7cd('0x22')]['Neutral'],'transcribeStatus':_0xa7cd('0x30')});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util['format'](_0xa7cd('0x31'),_0xc60cec['id']));_0x3f72f8();});}})[_0xa7cd('0x32')](function(_0x6ee082){if(_0x6ee082){if(!_0x6ee082[_0xa7cd('0x33')]||_0x6ee082[_0xa7cd('0x33')]!==_0xa7cd('0x34')){logger[_0xa7cd('0x35')](util[_0xa7cd('0x7')](_0xa7cd('0x36'),_0xc60cec['id']),util['inspect'](_0x6ee082,{'showHidden':![],'depth':null}));}}_0x3f72f8();});});}function checkTranscribe(){var _0x5d1d6d;var _0x54299b;var _0x35e023;return db[_0xa7cd('0x37')][_0xa7cd('0x38')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa7cd('0x13')](function(_0x2104fe){if(!_0x2104fe||!_0x2104fe['length']){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5d1d6d=_0x2104fe;return db[_0xa7cd('0x39')][_0xa7cd('0x2b')]({'where':{'id':0x1}});})[_0xa7cd('0x13')](function(_0x11f0d0){if(!_0x11f0d0){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3a'));}_0x54299b=_0x11f0d0;if(!_0x54299b['transcribe']||!_0x54299b[_0xa7cd('0x3b')]||!_0x54299b['transcribeRegion']||!_0x54299b[_0xa7cd('0x1a')]||!_0x54299b[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3c'));}return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_0x54299b['transcribeAccountId']}});})[_0xa7cd('0x13')](function(_0x51c67f){if(!_0x51c67f){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x51c67f[_0xa7cd('0xa')]||!_0x51c67f[_0xa7cd('0xb')]){throw new db['Sequelize']['ValidationError'](_0xa7cd('0x2c'));}_0x35e023=_0x51c67f;var _0x46b48a=[];_0x5d1d6d[_0xa7cd('0x3d')](function(_0x2101ea){_0x46b48a['push'](checkTranscribeJob(_0x2101ea,_0x54299b,_0x35e023));});return BPromise[_0xa7cd('0x3e')](_0x46b48a);})[_0xa7cd('0x32')](function(_0x2dd1a2){if(_0x2dd1a2){if(!_0x2dd1a2[_0xa7cd('0x33')]||_0x2dd1a2['name']!=='SequelizeValidationError'){logger['error'](util[_0xa7cd('0x3f')](_0x2dd1a2,{'showHidden':![],'depth':null}));}}});}exports[_0xa7cd('0x40')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x63ad=['data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','format','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','tempSentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','ValidationError','sentiment','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','name','error','start','aws-sdk','request-promise','transcribe','TranscribeService','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x63ad,0x7d));var _0xd63a=function(_0x55efeb,_0x2fe549){_0x55efeb=_0x55efeb-0x0;var _0xda34c4=_0x63ad[_0x55efeb];return _0xda34c4;};var _=require('lodash');var AWS=require(_0xd63a('0x0'));var rp=require(_0xd63a('0x1'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xd63a('0x2'));function getTranscriptionJob(_0x2c11bc,_0x4a9034,_0x22f15a,_0x1c4437){return new Promise(function(_0x32e509,_0xcfe533){var _0x3b0ad8=new AWS[(_0xd63a('0x3'))]({'accessKeyId':_0x4a9034,'secretAccessKey':_0x2c11bc,'region':_0x22f15a});_0x3b0ad8['getTranscriptionJob']({'TranscriptionJobName':_0x1c4437},function(_0x1505e0,_0x4e01e3){if(_0x1505e0){return _0xcfe533(_0x1505e0);}else{return _0x32e509(_0x4e01e3);}});});}function sentiment(_0xb861fd,_0x4c671f,_0x432556,_0x2a3cae,_0x32e0d1){return new Promise(function(_0x565aa3,_0x4baa08){var _0x51612b=new AWS[(_0xd63a('0x4'))]({'accessKeyId':_0x4c671f,'secretAccessKey':_0xb861fd,'region':_0x432556});_0x51612b['detectSentiment']({'Text':_0x2a3cae,'LanguageCode':_0x32e0d1[_0xd63a('0x5')](0x0,0x2)},function(_0x135e54,_0x492c0a){if(_0x135e54){return _0x4baa08(_0x135e54);}else{return _0x565aa3(_0x492c0a);}});});}function checkTranscribeJob(_0x2a1e86,_0x24bc2b,_0x2d58fe){var _0x4741f5;return new BPromise(function(_0x2fd204,_0xb1021e){logger[_0xd63a('0x6')](util['format'](_0xd63a('0x7'),_0x2a1e86['id'],_0x2a1e86[_0xd63a('0x8')]));return getTranscriptionJob(_0x2d58fe[_0xd63a('0x9')],_0x2d58fe[_0xd63a('0xa')],_0x24bc2b[_0xd63a('0xb')],_0x2a1e86[_0xd63a('0x8')])[_0xd63a('0xc')](function(_0x59423d){logger[_0xd63a('0x6')](util['format'](_0xd63a('0xd'),_0x2a1e86['id'],_0x2a1e86[_0xd63a('0x8')],_0x59423d[_0xd63a('0xe')][_0xd63a('0xf')]));if(!_0x2a1e86[_0xd63a('0x10')]){switch(_0x59423d[_0xd63a('0xe')][_0xd63a('0xf')]){case _0xd63a('0x11'):var _0x4a02e8={'transcribeStatus':_0x59423d[_0xd63a('0xe')]['TranscriptionJobStatus'],'fileUri':_0x59423d[_0xd63a('0xe')][_0xd63a('0x12')]['TranscriptFileUri']};logger['info'](util[_0xd63a('0x13')](_0xd63a('0x14'),_0x2a1e86['id']));return rp({'uri':_0x59423d[_0xd63a('0xe')][_0xd63a('0x12')]['TranscriptFileUri'],'json':!![]})[_0xd63a('0xc')](function(_0x36dd33){logger[_0xd63a('0x6')](util[_0xd63a('0x13')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x2a1e86['id']));if(_0x36dd33&&_0x36dd33[_0xd63a('0x15')]&&_0x36dd33['results'][_0xd63a('0x16')]&&_0x36dd33[_0xd63a('0x15')]['transcripts'][_0xd63a('0x17')]){_0x4a02e8[_0xd63a('0x10')]='';for(var _0x1924c6=0x0;_0x1924c6<_0x36dd33['results']['transcripts'][_0xd63a('0x17')];_0x1924c6++){_0x4a02e8['fileText']+=_0x36dd33['results'][_0xd63a('0x16')][_0x1924c6][_0xd63a('0x18')]+'';}}return _0x2a1e86[_0xd63a('0x19')](_0x4a02e8);})[_0xd63a('0xc')](function(){logger[_0xd63a('0x6')](util[_0xd63a('0x13')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2a1e86['id']));if(!_0x2a1e86[_0xd63a('0x1a')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x24bc2b['sentiment']||!_0x24bc2b[_0xd63a('0x1b')]||!_0x24bc2b[_0xd63a('0x1c')]||!_0x24bc2b[_0xd63a('0x1d')]||!_0x24bc2b[_0xd63a('0x1e')]){throw new db[(_0xd63a('0x1f'))]['ValidationError'](_0xd63a('0x20'));}if(!_0x4a02e8[_0xd63a('0x10')]){throw new Error(_0xd63a('0x21'));}if(_0x24bc2b[_0xd63a('0x1b')]===_0x2d58fe['id']){return _0x2d58fe;}else{return db[_0xd63a('0x22')][_0xd63a('0x23')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2f3c62){if(!_0x2f3c62){throw new db[(_0xd63a('0x1f'))]['ValidationError'](_0xd63a('0x24'));}if(!_0x2f3c62['data1']||!_0x2f3c62['data2']){throw new db['Sequelize']['ValidationError'](_0xd63a('0x25'));}_0x4741f5=_0x2f3c62;logger['info'](util[_0xd63a('0x13')](_0xd63a('0x26'),_0x2a1e86['id']));return sentiment(_0x4741f5['data1'],_0x4741f5[_0xd63a('0xa')],_0x24bc2b[_0xd63a('0x1c')],_0x4a02e8['fileText'],_0x24bc2b[_0xd63a('0x1d')]);})[_0xd63a('0xc')](function(_0x4e9865){logger[_0xd63a('0x6')](util[_0xd63a('0x13')](_0xd63a('0x27'),_0x2a1e86['id']));return _0x2a1e86['update']({'sentiment':_0x4e9865[_0xd63a('0x28')],'sPositive':_0x4e9865[_0xd63a('0x29')][_0xd63a('0x2a')],'sNegative':_0x4e9865[_0xd63a('0x29')][_0xd63a('0x2b')],'sMixed':_0x4e9865[_0xd63a('0x29')][_0xd63a('0x2c')],'sNeutral':_0x4e9865[_0xd63a('0x29')][_0xd63a('0x2d')]});})['then'](function(){logger[_0xd63a('0x6')](util[_0xd63a('0x13')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2a1e86['id']));_0x2fd204();});case _0xd63a('0x2e'):return _0x2a1e86[_0xd63a('0x19')]({'transcribeStatus':_0xd63a('0x2e'),'failureReason':_0x59423d[_0xd63a('0xe')][_0xd63a('0x2f')]})[_0xd63a('0xc')](function(){logger[_0xd63a('0x6')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2a1e86['id']));_0x2fd204();});default:logger[_0xd63a('0x6')](util[_0xd63a('0x13')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x2a1e86['id']));break;}}else{return BPromise[_0xd63a('0x30')]()[_0xd63a('0xc')](function(){if(!_0x2a1e86['tempSentiment']){throw new db[(_0xd63a('0x1f'))][(_0xd63a('0x31'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x24bc2b[_0xd63a('0x32')]||!_0x24bc2b[_0xd63a('0x1b')]||!_0x24bc2b[_0xd63a('0x1c')]||!_0x24bc2b[_0xd63a('0x1d')]||!_0x24bc2b[_0xd63a('0x1e')]){throw new db[(_0xd63a('0x1f'))][(_0xd63a('0x31'))](_0xd63a('0x20'));}if(!_0x2a1e86[_0xd63a('0x10')]){throw new Error(_0xd63a('0x21'));}if(_0x24bc2b[_0xd63a('0x1b')]===_0x2d58fe['id']){return _0x2d58fe;}else{return db[_0xd63a('0x22')][_0xd63a('0x23')]({'where':{'id':_settings[_0xd63a('0x1b')]}});}})[_0xd63a('0xc')](function(_0x5b6e13){if(!_0x5b6e13){throw new db[(_0xd63a('0x1f'))][(_0xd63a('0x31'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5b6e13[_0xd63a('0x9')]||!_0x5b6e13[_0xd63a('0xa')]){throw new db[(_0xd63a('0x1f'))][(_0xd63a('0x31'))](_0xd63a('0x25'));}_0x4741f5=_0x5b6e13;logger[_0xd63a('0x6')](util[_0xd63a('0x13')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2a1e86['id']));return sentiment(_0x4741f5['data1'],_0x4741f5['data2'],_0x24bc2b['sentimentRegion'],_0x2a1e86[_0xd63a('0x10')],_0x24bc2b[_0xd63a('0x1d')]);})[_0xd63a('0xc')](function(_0x48afef){logger[_0xd63a('0x6')](util[_0xd63a('0x13')](_0xd63a('0x27'),_0x2a1e86['id']));return _0x2a1e86[_0xd63a('0x19')]({'sentiment':_0x48afef[_0xd63a('0x28')],'sPositive':_0x48afef[_0xd63a('0x29')]['Positive'],'sNegative':_0x48afef[_0xd63a('0x29')][_0xd63a('0x2b')],'sMixed':_0x48afef[_0xd63a('0x29')][_0xd63a('0x2c')],'sNeutral':_0x48afef['SentimentScore'][_0xd63a('0x2d')],'transcribeStatus':_0xd63a('0x11')});})[_0xd63a('0xc')](function(){logger[_0xd63a('0x6')](util[_0xd63a('0x13')](_0xd63a('0x33'),_0x2a1e86['id']));_0x2fd204();});}})['catch'](function(_0x3bc278){if(_0x3bc278){if(!_0x3bc278['name']||_0x3bc278['name']!==_0xd63a('0x34')){logger['error'](util[_0xd63a('0x13')](_0xd63a('0x35'),_0x2a1e86['id']),util[_0xd63a('0x36')](_0x3bc278,{'showHidden':![],'depth':null}));}}_0x2fd204();});});}function checkTranscribe(){var _0x5cff6b;var _0xbe579b;var _0x78d162;return db['VoiceRecording'][_0xd63a('0x37')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x1f6427){if(!_0x1f6427||!_0x1f6427[_0xd63a('0x17')]){throw new db[(_0xd63a('0x1f'))]['ValidationError'](_0xd63a('0x38'));}_0x5cff6b=_0x1f6427;return db[_0xd63a('0x39')][_0xd63a('0x23')]({'where':{'id':0x1}});})[_0xd63a('0xc')](function(_0x11fa4d){if(!_0x11fa4d){throw new db[(_0xd63a('0x1f'))][(_0xd63a('0x31'))]('Settings\x20not\x20available');}_0xbe579b=_0x11fa4d;if(!_0xbe579b[_0xd63a('0x2')]||!_0xbe579b[_0xd63a('0x3a')]||!_0xbe579b[_0xd63a('0xb')]||!_0xbe579b['language']||!_0xbe579b[_0xd63a('0x1e')]){throw new db['Sequelize'][(_0xd63a('0x31'))](_0xd63a('0x3b'));}return db[_0xd63a('0x22')][_0xd63a('0x23')]({'where':{'id':_0xbe579b[_0xd63a('0x3a')]}});})['then'](function(_0x1266bf){if(!_0x1266bf){throw new db['Sequelize']['ValidationError'](_0xd63a('0x24'));}if(!_0x1266bf[_0xd63a('0x9')]||!_0x1266bf[_0xd63a('0xa')]){throw new db[(_0xd63a('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x78d162=_0x1266bf;var _0x13f777=[];_0x5cff6b[_0xd63a('0x3c')](function(_0x8d48c5){_0x13f777[_0xd63a('0x3d')](checkTranscribeJob(_0x8d48c5,_0xbe579b,_0x78d162));});return BPromise[_0xd63a('0x3e')](_0x13f777);})[_0xd63a('0x3f')](function(_0x1c2372){if(_0x1c2372){if(!_0x1c2372[_0xd63a('0x40')]||_0x1c2372['name']!==_0xd63a('0x34')){logger[_0xd63a('0x41')](util[_0xd63a('0x36')](_0x1c2372,{'showHidden':![],'depth':null}));}}});}exports[_0xd63a('0x42')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 7d6861e..e6e1ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb73=['[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch'];(function(_0x4675ec,_0x584a47){var _0x120ae0=function(_0x1c77e1){while(--_0x1c77e1){_0x4675ec['push'](_0x4675ec['shift']());}};_0x120ae0(++_0x584a47);}(_0xfb73,0xbd));var _0x3fb7=function(_0x5d928b,_0xe7a2c2){_0x5d928b=_0x5d928b-0x0;var _0x5565c1=_0xfb73[_0x5d928b];return _0x5565c1;};'use strict';var _=require('lodash');var moment=require(_0x3fb7('0x0'));var Redis=require(_0x3fb7('0x1'));var util=require(_0x3fb7('0x2'));var config=require('../../config/environment');var db=require(_0x3fb7('0x3'))['db'];var logger=require(_0x3fb7('0x4'))(_0x3fb7('0x5'));config['redis']=_[_0x3fb7('0x6')](config['redis'],{'host':_0x3fb7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x47cb49=[];return db[_0x3fb7('0x8')][_0x3fb7('0x9')]({'raw':!![],'attributes':['id',_0x3fb7('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3fb7('0xb')](0x18,_0x3fb7('0xc'))}}})['then'](function(_0x21a162){if(_0x21a162&&_0x21a162['length']){_0x47cb49=_[_0x3fb7('0xd')](_0x21a162||[],'id');logger[_0x3fb7('0xe')](_0x3fb7('0xf'),_0x47cb49['join']());return db[_0x3fb7('0x8')][_0x3fb7('0x10')]({'closeReason':_0x3fb7('0x11'),'disposition':_0x3fb7('0x12'),'closed':!![],'closedAt':moment()[_0x3fb7('0x13')](_0x3fb7('0x14'))},{'where':{'id':_0x47cb49}});}})[_0x3fb7('0x15')](function(){if(_0x47cb49&&_0x47cb49[_0x3fb7('0x16')]){logger['info'](_0x3fb7('0x17'),_0x47cb49[_0x3fb7('0x18')]());for(var _0x106572=0x0;_0x106572<_0x47cb49['length'];_0x106572++){io[_0x3fb7('0x19')](_0x3fb7('0x1a'),{'id':_0x47cb49[_0x106572],'closed':!![]});}}})[_0x3fb7('0x1b')](function(_0x54a763){logger['error'](_0x3fb7('0x1c'),_0x54a763?util[_0x3fb7('0x1d')](_0x54a763,{'showHidden':![],'depth':null}):'');});}exports[_0x3fb7('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x7839=['socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../../mysqldb','../logger','schedule','defaults','redis'];(function(_0x35abf6,_0x43902d){var _0x30587a=function(_0x1625af){while(--_0x1625af){_0x35abf6['push'](_0x35abf6['shift']());}};_0x30587a(++_0x43902d);}(_0x7839,0x1ba));var _0x9783=function(_0x3a7ac4,_0x28591c){_0x3a7ac4=_0x3a7ac4-0x0;var _0x567969=_0x7839[_0x3a7ac4];return _0x567969;};'use strict';var _=require(_0x9783('0x0'));var moment=require(_0x9783('0x1'));var Redis=require(_0x9783('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x9783('0x3'))['db'];var logger=require(_0x9783('0x4'))(_0x9783('0x5'));config['redis']=_[_0x9783('0x6')](config[_0x9783('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9783('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x57b7ee=[];return db[_0x9783('0x9')][_0x9783('0xa')]({'raw':!![],'attributes':['id',_0x9783('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9783('0xc')](0x18,'hours')}}})[_0x9783('0xd')](function(_0x16977d){if(_0x16977d&&_0x16977d[_0x9783('0xe')]){_0x57b7ee=_[_0x9783('0xf')](_0x16977d||[],'id');logger[_0x9783('0x10')](_0x9783('0x11'),_0x57b7ee[_0x9783('0x12')]());return db['WhatsappInteraction'][_0x9783('0x13')]({'closeReason':'system','disposition':_0x9783('0x14'),'closed':!![],'closedAt':moment()[_0x9783('0x15')](_0x9783('0x16'))},{'where':{'id':_0x57b7ee}});}})[_0x9783('0xd')](function(){if(_0x57b7ee&&_0x57b7ee[_0x9783('0xe')]){logger['info'](_0x9783('0x17'),_0x57b7ee['join']());for(var _0x1e50fd=0x0;_0x1e50fd<_0x57b7ee[_0x9783('0xe')];_0x1e50fd++){io[_0x9783('0x18')](_0x9783('0x19'),{'id':_0x57b7ee[_0x1e50fd],'closed':!![]});}}})[_0x9783('0x1a')](function(_0x50ae14){logger[_0x9783('0x1b')](_0x9783('0x1c'),_0x50ae14?util[_0x9783('0x1d')](_0x50ae14,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 0a114c3..38bf01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6c=['now','Biondo','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','contacts2','hopper2','catch','Innocenzo','innocenzo.biondo','@xcally.com','push'];(function(_0x85b9ab,_0x260e81){var _0x4da88b=function(_0x326021){while(--_0x326021){_0x85b9ab['push'](_0x85b9ab['shift']());}};_0x4da88b(++_0x260e81);}(_0x7f6c,0x1e9));var _0xc7f6=function(_0x19741a,_0x4716c8){_0x19741a=_0x19741a-0x0;var _0x480e0c=_0x7f6c[_0x19741a];return _0x480e0c;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xc7f6('0x0')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc7f6('0x1')+i+_0xc7f6('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc7f6('0x3')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc7f6('0x4')](),'updatedAt':Date[_0xc7f6('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xc7f6('0x0')+i,'lastName':_0xc7f6('0x5')+i,'phone':0xf879fb460+i,'email':_0xc7f6('0x1')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc7f6('0x3')]({'id':i,'active':![],'scheduledat':Date[_0xc7f6('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc7f6('0x4')]()});}db[_0xc7f6('0x6')][_0xc7f6('0x7')]({'where':{}})[_0xc7f6('0x8')](function(){return db[_0xc7f6('0x6')][_0xc7f6('0x9')](contacts);})['then'](function(){console['log']('finished\x20populating',_0xc7f6('0xa'));return db[_0xc7f6('0xb')][_0xc7f6('0x7')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0xc7f6('0x8')](function(){console[_0xc7f6('0xc')](_0xc7f6('0xd'),'hopper1');return db[_0xc7f6('0x6')][_0xc7f6('0x9')](contacts2);})[_0xc7f6('0x8')](function(){console[_0xc7f6('0xc')]('finished\x20populating',_0xc7f6('0xe'));return db[_0xc7f6('0xb')][_0xc7f6('0x9')](hopper2);})[_0xc7f6('0x8')](function(){console[_0xc7f6('0xc')](_0xc7f6('0xd'),_0xc7f6('0xf'));})[_0xc7f6('0x10')](function(_0x26910e){console[_0xc7f6('0xc')](_0x26910e);});
\ No newline at end of file
+var _0xee1e=['Innocenzo','Biondo','now','push','innocenzo.biondo','@xcally.com','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','contacts2','catch','../mysqldb'];(function(_0x4caa21,_0x3899db){var _0x48598d=function(_0x14a5d7){while(--_0x14a5d7){_0x4caa21['push'](_0x4caa21['shift']());}};_0x48598d(++_0x3899db);}(_0xee1e,0x1ec));var _0xeee1=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0xee1e[_0x23c262];return _0x9b913f;};'use strict';var util=require('util');var db=require(_0xeee1('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xeee1('0x1')+i,'lastName':_0xeee1('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xeee1('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xeee1('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xeee1('0x2')+i,'phone':0xf879fb460+i,'email':_0xeee1('0x5')+i+_0xeee1('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xeee1('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xeee1('0x3')](),'updatedAt':Date[_0xeee1('0x3')]()});}db[_0xeee1('0x7')]['destroy']({'where':{}})[_0xeee1('0x8')](function(){return db[_0xeee1('0x7')][_0xeee1('0x9')](contacts);})['then'](function(){console[_0xeee1('0xa')](_0xeee1('0xb'),_0xeee1('0xc'));return db['CmHopper'][_0xeee1('0xd')]({'where':{}});})[_0xeee1('0x8')](function(){return db[_0xeee1('0xe')]['bulkCreate'](hopper);})[_0xeee1('0x8')](function(){console['log'](_0xeee1('0xb'),'hopper1');return db[_0xeee1('0x7')][_0xeee1('0x9')](contacts2);})[_0xeee1('0x8')](function(){console[_0xeee1('0xa')](_0xeee1('0xb'),_0xeee1('0xf'));return db['CmHopper'][_0xeee1('0x9')](hopper2);})[_0xeee1('0x8')](function(){console['log'](_0xeee1('0xb'),'hopper2');})[_0xeee1('0x10')](function(_0x32c37b){console[_0xeee1('0xa')](_0x32c37b);});
\ No newline at end of file
index db0b31e..1a52ba7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ce1=['%s%s','agent','%s%s@xcally.com','password','udp','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','log','add\x20user','catch','util','format'];(function(_0x13fb21,_0xfc7475){var _0x4067a1=function(_0x2e3cde){while(--_0x2e3cde){_0x13fb21['push'](_0x13fb21['shift']());}};_0x4067a1(++_0xfc7475);}(_0x4ce1,0xbe));var _0x14ce=function(_0x54242e,_0x409d0f){_0x54242e=_0x54242e-0x0;var _0x9bdf58=_0x4ce1[_0x54242e];return _0x9bdf58;};'use strict';var util=require(_0x14ce('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x14ce('0x1')](_0x14ce('0x2'),_0x14ce('0x3'),i),'fullname':util['format'](_0x14ce('0x2'),'agent',i),'email':util[_0x14ce('0x1')](_0x14ce('0x4'),_0x14ce('0x3'),i),'role':_0x14ce('0x3'),'password':_0x14ce('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x14ce('0x6'),'ws','wss'],'disallow':[_0x14ce('0x7')],'allow':[_0x14ce('0x8')],'defaultuser':util[_0x14ce('0x1')](_0x14ce('0x2'),'agent',i),'encryption':'yes','avpf':_0x14ce('0x9'),'force_avp':_0x14ce('0x9'),'icesupport':_0x14ce('0x9'),'dtlsenable':_0x14ce('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x14ce('0xa'),'callerid':util[_0x14ce('0x1')](_0x14ce('0xb'),util['format'](_0x14ce('0x2'),_0x14ce('0x3'),i),0xfa0+i)});}db[_0x14ce('0xc')]['bulkCreate'](users)['then'](function(){console[_0x14ce('0xd')](_0x14ce('0xe'));})[_0x14ce('0xf')](function(_0x32748b){console[_0x14ce('0xd')](_0x32748b);});
\ No newline at end of file
+var _0xa2c5=['\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x54aef6,_0x4155fc){var _0x1a2d10=function(_0x4cefb6){while(--_0x4cefb6){_0x54aef6['push'](_0x54aef6['shift']());}};_0x1a2d10(++_0x4155fc);}(_0xa2c5,0x11e));var _0x5a2c=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xa2c5[_0x4ed520];return _0x4415a6;};'use strict';var util=require('util');var db=require(_0x5a2c('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5a2c('0x1')]({'name':util[_0x5a2c('0x2')](_0x5a2c('0x3'),_0x5a2c('0x4'),i),'fullname':util[_0x5a2c('0x2')]('%s%s',_0x5a2c('0x4'),i),'email':util[_0x5a2c('0x2')](_0x5a2c('0x5'),_0x5a2c('0x4'),i),'role':_0x5a2c('0x4'),'password':_0x5a2c('0x6'),'internal':0xfa0+i,'type':_0x5a2c('0x7'),'transport':[_0x5a2c('0x8'),'ws',_0x5a2c('0x9')],'disallow':[_0x5a2c('0xa')],'allow':['ulaw'],'defaultuser':util[_0x5a2c('0x2')](_0x5a2c('0x3'),'agent',i),'encryption':_0x5a2c('0xb'),'avpf':'yes','force_avp':_0x5a2c('0xb'),'icesupport':_0x5a2c('0xb'),'dtlsenable':_0x5a2c('0xb'),'dtlsverify':'no','dtlscertfile':_0x5a2c('0xc'),'dtlsprivatekey':_0x5a2c('0xd'),'dtlssetup':'actpass','callerid':util[_0x5a2c('0x2')](_0x5a2c('0xe'),util[_0x5a2c('0x2')](_0x5a2c('0x3'),'agent',i),0xfa0+i)});}db['User'][_0x5a2c('0xf')](users)[_0x5a2c('0x10')](function(){console[_0x5a2c('0x11')](_0x5a2c('0x12'));})[_0x5a2c('0x13')](function(_0xad8512){console['log'](_0xad8512);});
\ No newline at end of file
index 4246f3a..8b21e21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1410=['MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueue','WhatsappQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues'];(function(_0x2d4ba9,_0x14314c){var _0x168d72=function(_0x472ae2){while(--_0x472ae2){_0x2d4ba9['push'](_0x2d4ba9['shift']());}};_0x168d72(++_0x14314c);}(_0x1410,0x130));var _0x0141=function(_0x299714,_0x3b8f9f){_0x299714=_0x299714-0x0;var _0xc8b0aa=_0x1410[_0x299714];return _0xc8b0aa;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var BPromise=require(_0x0141('0x2'));var db=require(_0x0141('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x0141('0x4')],'include':[{'as':'Agents','model':db[_0x0141('0x5')],'attributes':['id','name',_0x0141('0x6')],'raw':!![],'where':{'role':_0x0141('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0141('0x4')],'where':{'role':_0x0141('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0141('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x0141('0x4')],'where':{'role':_0x0141('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0141('0x4'),_0x0141('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x19ff64,_0x470b71,_0x2b4f13){return db[_0x0141('0xa')][_0x0141('0xb')]({'where':{'name':_0x19ff64,'userProfileId':_0x470b71},'raw':!![]})[_0x0141('0xc')](function(_0x3f5e8f){if(_0x3f5e8f){if(_0x3f5e8f[_0x0141('0xd')]){switch(_0x19ff64){case'VoiceQueues':case _0x0141('0xe'):case _0x0141('0xf'):case _0x0141('0x10'):case _0x0141('0x11'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2b4f13][_0x0141('0x12')](queryQueues);case _0x0141('0x13'):return db[_0x2b4f13]['findAll'](queryTelephones);case _0x0141('0x14'):return db[_0x2b4f13][_0x0141('0x12')](queryTrunks);case _0x0141('0x15'):return db[_0x2b4f13][_0x0141('0x12')](queryCampaigns);}}else{return db[_0x0141('0x16')]['findAll']({'attributes':[_0x0141('0x17')],'where':{'sectionId':_0x3f5e8f['id']},'raw':!![]})['then'](function(_0x2ee001){if(_0x2ee001){var _0x3db66a={'where':{'id':_[_0x0141('0x18')](_0x2ee001,_0x0141('0x17'))},'raw':!![]};switch(_0x2b4f13){case _0x0141('0x5'):_0x3db66a[_0x0141('0x19')]['role']='telephone';break;case _0x0141('0x1a'):_0x3db66a[_0x0141('0x19')]['type']=_0x0141('0x1b');break;}return db[_0x2b4f13][_0x0141('0x12')](_0x3db66a);}else{return[];}});}}else{return[];}})[_0x0141('0xc')](function(_0x3a58b6){return _0x3a58b6;});}function joinOrLeaveQueues(_0x5427b5,_0x36ca7a,_0x5bf2e8,_0x5e9d0a){_0x5427b5[_0x36ca7a](util[_0x0141('0x1c')](_0x0141('0x1d'),_0x5bf2e8,_0x5e9d0a[_0x0141('0x4')]));if(_0x5e9d0a[_0x0141('0x1e')]){for(var _0x316f70=0x0;_0x316f70<_0x5e9d0a[_0x0141('0x1e')]['length'];_0x316f70+=0x1){_0x5427b5[_0x36ca7a](util[_0x0141('0x1c')](_0x0141('0x1f'),_0x5e9d0a[_0x0141('0x1e')][_0x316f70][_0x0141('0x4')]));}}}function joinOrLeave(_0x2b7a02,_0x1a4b0b,_0xccf0c){var _0x20656b;if(_0x2b7a02[_0x0141('0x20')][_0x0141('0x21')]['id']){db[_0x0141('0x5')][_0x0141('0x22')]({'attributes':['id','name',_0x0141('0x6'),_0x0141('0x23')],'where':{'id':_0x2b7a02[_0x0141('0x20')][_0x0141('0x21')]['id']},'include':[{'model':db[_0x0141('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0141('0x25')],'as':_0x0141('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x0141('0x27')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0141('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0141('0x29')],'as':_0x0141('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x0141('0x2b')],'as':_0x0141('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x0141('0xc')](function(_0x29f463){if(_0x29f463){_0x20656b=_0x29f463;_0x2b7a02[_0x1a4b0b](util[_0x0141('0x1c')](_0x0141('0x1f'),_0x29f463[_0x0141('0x4')]));var _0x308235=[];switch(_0x29f463[_0x0141('0x6')]){case _0x0141('0x2d'):_0x2b7a02[_0x1a4b0b](_0x0141('0x2e'));_0x2b7a02[_0x1a4b0b]('voice:outbound');if(queryQueues[_0x0141('0x2f')]('include')){delete queryQueues[_0x0141('0x30')];}_0x308235[_0x0141('0x31')](db[_0x0141('0x32')][_0x0141('0x12')](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x33')]['findAll'](queryQueues));_0x308235[_0x0141('0x31')](db['FaxQueue'][_0x0141('0x12')](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x34')]['findAll'](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x35')]['findAll'](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x36')][_0x0141('0x12')](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x37')]['findAll'](queryQueues));_0x308235[_0x0141('0x31')](db[_0x0141('0x5')][_0x0141('0x12')](queryTelephones));_0x308235[_0x0141('0x31')](db[_0x0141('0x38')][_0x0141('0x12')](queryTrunks));_0x308235['push'](db['Campaign'][_0x0141('0x12')](queryCampaigns));_0x308235[_0x0141('0x31')](db['User'][_0x0141('0x12')](queryAgents));break;case _0x0141('0x39'):_0x2b7a02[_0x1a4b0b](_0x0141('0x2e'));_0x2b7a02[_0x1a4b0b]('voice:outbound');_0x308235['push'](getAssociatedResources('VoiceQueues',_0x29f463[_0x0141('0x23')],_0x0141('0x32')));_0x308235[_0x0141('0x31')](getAssociatedResources(_0x0141('0xe'),_0x29f463[_0x0141('0x23')],_0x0141('0x33')));_0x308235[_0x0141('0x31')](getAssociatedResources('FaxQueues',_0x29f463[_0x0141('0x23')],_0x0141('0x3a')));_0x308235['push'](getAssociatedResources(_0x0141('0x10'),_0x29f463[_0x0141('0x23')],_0x0141('0x34')));_0x308235[_0x0141('0x31')](getAssociatedResources(_0x0141('0x11'),_0x29f463[_0x0141('0x23')],_0x0141('0x35')));_0x308235[_0x0141('0x31')](getAssociatedResources('OpenchannelQueues',_0x29f463[_0x0141('0x23')],_0x0141('0x36')));_0x308235['push'](getAssociatedResources(_0x0141('0x3b'),_0x29f463[_0x0141('0x23')],_0x0141('0x37')));_0x308235[_0x0141('0x31')](getAssociatedResources(_0x0141('0x13'),_0x29f463['userProfileId'],_0x0141('0x5')));_0x308235['push'](getAssociatedResources(_0x0141('0x14'),_0x29f463['userProfileId'],'Trunk'));_0x308235['push'](getAssociatedResources(_0x0141('0x15'),_0x29f463[_0x0141('0x23')],_0x0141('0x1a')));_0x308235['push'](db[_0x0141('0x5')][_0x0141('0x12')](queryAgents));break;case _0x0141('0x7'):_0x2b7a02[_0x1a4b0b](_0x0141('0x2e'));_0x2b7a02[_0x1a4b0b]('voice:outbound');_0x308235[_0x0141('0x31')](_0x29f463[_0x0141('0x3c')]({'attributes':['id',_0x0141('0x4')]}));_0x308235[_0x0141('0x31')](_0x29f463[_0x0141('0x3d')]({'attributes':['id',_0x0141('0x4')]}));_0x308235[_0x0141('0x31')](_0x29f463[_0x0141('0x3e')]({'attributes':['id','name']}));_0x308235[_0x0141('0x31')](_0x29f463[_0x0141('0x3f')]({'attributes':['id',_0x0141('0x4')]}));_0x308235['push'](_0x29f463[_0x0141('0x40')]({'attributes':['id',_0x0141('0x4')]}));_0x308235[_0x0141('0x31')](_0x29f463['getOpenchannelQueues']({'attributes':['id',_0x0141('0x4')]}));_0x308235['push'](_0x29f463[_0x0141('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0x0141('0x42')](_0x308235);}})['then'](function(_0xaa2b6d){if(_0xaa2b6d&&_0xaa2b6d[_0x0141('0x43')]){for(var _0x12943f=0x0;_0x12943f<_0xaa2b6d[_0x0141('0x43')];_0x12943f+=0x1){for(var _0x20a901=0x0;_0x20a901<_0xaa2b6d[_0x12943f]['length'];_0x20a901+=0x1){switch(_0x12943f){case 0x0:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x44'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x1:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x45'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x2:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x46'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x3:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,'sms',_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x4:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x47'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x5:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x48'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x6:joinOrLeaveQueues(_0x2b7a02,_0x1a4b0b,_0x0141('0x49'),_0xaa2b6d[_0x12943f][_0x20a901]);break;case 0x7:if(_0x20656b['role']!==_0x0141('0x7'))_0x2b7a02[_0x1a4b0b](util['format'](_0x0141('0x4a'),_0xaa2b6d[_0x12943f][_0x20a901][_0x0141('0x4')]));break;case 0x8:if(_0x20656b[_0x0141('0x6')]!==_0x0141('0x7'))_0x2b7a02[_0x1a4b0b](util['format'](_0x0141('0x4b'),_0xaa2b6d[_0x12943f][_0x20a901][_0x0141('0x4')]));break;case 0x9:if(_0x20656b[_0x0141('0x6')]!==_0x0141('0x7'))_0x2b7a02[_0x1a4b0b](util[_0x0141('0x1c')](_0x0141('0x4c'),_0xaa2b6d[_0x12943f][_0x20a901][_0x0141('0x9')],_0xaa2b6d[_0x12943f][_0x20a901]['name']));break;case 0xa:_0x2b7a02[_0x1a4b0b](util[_0x0141('0x1c')](_0x0141('0x1f'),_0xaa2b6d[_0x12943f][_0x20a901][_0x0141('0x4')]));break;}}}}})['then'](function(){if(_0x1a4b0b===_0x0141('0x4d')){var _0x256fcc=_[_0x0141('0x18')](_0x20656b['ChatInteractions'],'id');return _0x20656b[_0x0141('0x4e')](_0x256fcc)['then'](function(){for(var _0x32428d=0x0;_0x32428d<_0x256fcc[_0x0141('0x43')];_0x32428d+=0x1){_0xccf0c[_0x0141('0x4f')](_0x0141('0x50'),{'ChatInteractionId':Number(_0x256fcc[_0x32428d]),'UserId':Number(_0x20656b['id'])});}});}})[_0x0141('0xc')](function(){if(_0x1a4b0b===_0x0141('0x4d')){var _0x42faf1=_[_0x0141('0x18')](_0x20656b[_0x0141('0x26')],'id');return _0x20656b[_0x0141('0x51')](_0x42faf1)[_0x0141('0xc')](function(){for(var _0x53b31f=0x0;_0x53b31f<_0x42faf1[_0x0141('0x43')];_0x53b31f+=0x1){_0xccf0c[_0x0141('0x4f')](_0x0141('0x52'),{'MailInteractionId':Number(_0x42faf1[_0x53b31f]),'UserId':Number(_0x20656b['id'])});}});}})[_0x0141('0xc')](function(){if(_0x1a4b0b==='leave'){var _0x475134=_[_0x0141('0x18')](_0x20656b[_0x0141('0x53')],'id');return _0x20656b[_0x0141('0x54')](_0x475134)[_0x0141('0xc')](function(){for(var _0x3e28eb=0x0;_0x3e28eb<_0x475134['length'];_0x3e28eb+=0x1){_0xccf0c[_0x0141('0x4f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x475134[_0x3e28eb]),'UserId':Number(_0x20656b['id'])});}});}})[_0x0141('0xc')](function(){if(_0x1a4b0b===_0x0141('0x4d')){var _0x45020b=_[_0x0141('0x18')](_0x20656b[_0x0141('0x55')],'id');return _0x20656b[_0x0141('0x56')](_0x45020b)[_0x0141('0xc')](function(){for(var _0x4d515e=0x0;_0x4d515e<_0x45020b['length'];_0x4d515e+=0x1){_0xccf0c[_0x0141('0x4f')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x45020b[_0x4d515e]),'UserId':Number(_0x20656b['id'])});}});}})['then'](function(){if(_0x1a4b0b===_0x0141('0x4d')){var _0x2124a6=_[_0x0141('0x18')](_0x20656b[_0x0141('0x2a')],'id');return _0x20656b[_0x0141('0x57')](_0x2124a6)[_0x0141('0xc')](function(){for(var _0x20d836=0x0;_0x20d836<_0x2124a6[_0x0141('0x43')];_0x20d836+=0x1){_0xccf0c[_0x0141('0x4f')](_0x0141('0x58'),{'OpenchannelInteractionId':Number(_0x2124a6[_0x20d836]),'UserId':Number(_0x20656b['id'])});}});}})['then'](function(){if(_0x1a4b0b===_0x0141('0x4d')){var _0x25017c=_[_0x0141('0x18')](_0x20656b[_0x0141('0x2c')],'id');return _0x20656b[_0x0141('0x59')](_0x25017c)[_0x0141('0xc')](function(){for(var _0x2d8125=0x0;_0x2d8125<_0x25017c[_0x0141('0x43')];_0x2d8125+=0x1){_0xccf0c['emit'](_0x0141('0x5a'),{'WhatsappInteractionId':Number(_0x25017c[_0x2d8125]),'UserId':Number(_0x20656b['id'])});}});}})[_0x0141('0x5b')](function(_0x26b4a6){_0x2b7a02[_0x0141('0x5c')](_0x26b4a6);});}}function onDisconnect(_0x3c7ddc,_0x5c2f7f){joinOrLeave(_0x3c7ddc,'leave',_0x5c2f7f);}function onConnect(_0x3cd93c){joinOrLeave(_0x3cd93c,_0x0141('0x5d'));}exports[_0x0141('0x5e')]=function(_0x2d78d8){_0x2d78d8['on'](_0x0141('0x5f'),function(_0x4e0d6e){_0x4e0d6e[_0x0141('0x60')](0x0);_0x4e0d6e[_0x0141('0x61')]=_0x4e0d6e[_0x0141('0x62')][_0x0141('0x5f')][_0x0141('0x63')]+':'+_0x4e0d6e['request']['connection'][_0x0141('0x64')];_0x4e0d6e[_0x0141('0x65')]=new Date();_0x4e0d6e[_0x0141('0x5c')]=function(_0x1f41e9){console['log'](_0x0141('0x66')+_0x4e0d6e[_0x0141('0x67')][_0x0141('0x4')]+'['+_0x4e0d6e[_0x0141('0x61')]+']',_0x1f41e9);};_0x4e0d6e['on'](_0x0141('0x68'),function(){onDisconnect(_0x4e0d6e,_0x2d78d8);_0x4e0d6e['log'](_0x0141('0x69'));});onConnect(_0x4e0d6e);_0x4e0d6e[_0x0141('0x5c')](_0x0141('0x6a'));});};
\ No newline at end of file
+var _0xaecc=['FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','role','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','voice:inbound','voice:outbound','ChatQueues','OpenchannelQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','removeMailInteractions','removeFaxInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','lodash','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaecc,0x172));var _0xcaec=function(_0x13405d,_0xe260e2){_0x13405d=_0x13405d-0x0;var _0x486569=_0xaecc[_0x13405d];return _0x486569;};'use strict';var _=require(_0xcaec('0x0'));var util=require('util');var BPromise=require(_0xcaec('0x1'));var db=require(_0xcaec('0x2'))['db'];var config=require(_0xcaec('0x3'));var queryQueues={'attributes':['id',_0xcaec('0x4')],'include':[{'as':_0xcaec('0x5'),'model':db[_0xcaec('0x6')],'attributes':['id',_0xcaec('0x4'),'role'],'raw':!![],'where':{'role':_0xcaec('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcaec('0x4')],'where':{'role':_0xcaec('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xcaec('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xcaec('0x4')],'where':{'role':_0xcaec('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcaec('0x4'),_0xcaec('0x9')],'where':{'type':_0xcaec('0xa')}};function getAssociatedResources(_0x505f4b,_0x2c6d02,_0x2bec95){return db[_0xcaec('0xb')]['findOne']({'where':{'name':_0x505f4b,'userProfileId':_0x2c6d02},'raw':!![]})[_0xcaec('0xc')](function(_0xfd38f){if(_0xfd38f){if(_0xfd38f['autoAssociation']){switch(_0x505f4b){case _0xcaec('0xd'):case'ChatQueues':case _0xcaec('0xe'):case _0xcaec('0xf'):case _0xcaec('0x10'):case _0xcaec('0x11'):case _0xcaec('0x12'):return db[_0x2bec95]['findAll'](queryQueues);case _0xcaec('0x13'):return db[_0x2bec95][_0xcaec('0x14')](queryTelephones);case _0xcaec('0x15'):return db[_0x2bec95]['findAll'](queryTrunks);case _0xcaec('0x16'):return db[_0x2bec95][_0xcaec('0x14')](queryCampaigns);}}else{return db[_0xcaec('0x17')]['findAll']({'attributes':[_0xcaec('0x18')],'where':{'sectionId':_0xfd38f['id']},'raw':!![]})[_0xcaec('0xc')](function(_0xa30e97){if(_0xa30e97){var _0x5440ba={'where':{'id':_[_0xcaec('0x19')](_0xa30e97,_0xcaec('0x18'))},'raw':!![]};switch(_0x2bec95){case _0xcaec('0x6'):_0x5440ba[_0xcaec('0x1a')]['role']=_0xcaec('0x8');break;case _0xcaec('0x1b'):_0x5440ba[_0xcaec('0x1a')][_0xcaec('0x9')]=_0xcaec('0xa');break;}return db[_0x2bec95]['findAll'](_0x5440ba);}else{return[];}});}}else{return[];}})[_0xcaec('0xc')](function(_0x35b3dd){return _0x35b3dd;});}function joinOrLeaveQueues(_0x542655,_0x1952d7,_0x1b0198,_0x43de16){_0x542655[_0x1952d7](util[_0xcaec('0x1c')](_0xcaec('0x1d'),_0x1b0198,_0x43de16[_0xcaec('0x4')]));if(_0x43de16[_0xcaec('0x5')]){for(var _0x30312e=0x0;_0x30312e<_0x43de16[_0xcaec('0x5')][_0xcaec('0x1e')];_0x30312e+=0x1){_0x542655[_0x1952d7](util[_0xcaec('0x1c')](_0xcaec('0x1f'),_0x43de16['Agents'][_0x30312e][_0xcaec('0x4')]));}}}function joinOrLeave(_0x338f21,_0x22b82b,_0x429355){var _0x381399;if(_0x338f21[_0xcaec('0x20')][_0xcaec('0x21')]['id']){db[_0xcaec('0x6')][_0xcaec('0x22')]({'attributes':['id',_0xcaec('0x4'),_0xcaec('0x23'),_0xcaec('0x24')],'where':{'id':_0x338f21['handshake']['query']['id']},'include':[{'model':db[_0xcaec('0x25')],'as':_0xcaec('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xcaec('0x27')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xcaec('0x28')],'as':_0xcaec('0x29'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xcaec('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xcaec('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xcaec('0xc')](function(_0xf07371){if(_0xf07371){_0x381399=_0xf07371;_0x338f21[_0x22b82b](util[_0xcaec('0x1c')](_0xcaec('0x1f'),_0xf07371[_0xcaec('0x4')]));var _0x59fdff=[];switch(_0xf07371[_0xcaec('0x23')]){case _0xcaec('0x2c'):_0x338f21[_0x22b82b]('voice:inbound');_0x338f21[_0x22b82b]('voice:outbound');if(queryQueues[_0xcaec('0x2d')](_0xcaec('0x2e'))){delete queryQueues[_0xcaec('0x2e')];}_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x30')]['findAll'](queryQueues));_0x59fdff['push'](db[_0xcaec('0x31')][_0xcaec('0x14')](queryQueues));_0x59fdff['push'](db[_0xcaec('0x32')]['findAll'](queryQueues));_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x33')][_0xcaec('0x14')](queryQueues));_0x59fdff['push'](db[_0xcaec('0x34')][_0xcaec('0x14')](queryQueues));_0x59fdff['push'](db['OpenchannelQueue'][_0xcaec('0x14')](queryQueues));_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x35')][_0xcaec('0x14')](queryQueues));_0x59fdff['push'](db['User'][_0xcaec('0x14')](queryTelephones));_0x59fdff['push'](db[_0xcaec('0x36')][_0xcaec('0x14')](queryTrunks));_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x1b')]['findAll'](queryCampaigns));_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x6')]['findAll'](queryAgents));break;case _0xcaec('0x37'):_0x338f21[_0x22b82b](_0xcaec('0x38'));_0x338f21[_0x22b82b](_0xcaec('0x39'));_0x59fdff['push'](getAssociatedResources('VoiceQueues',_0xf07371[_0xcaec('0x24')],_0xcaec('0x30')));_0x59fdff['push'](getAssociatedResources(_0xcaec('0x3a'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x31')));_0x59fdff['push'](getAssociatedResources(_0xcaec('0xe'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x32')));_0x59fdff[_0xcaec('0x2f')](getAssociatedResources(_0xcaec('0xf'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x33')));_0x59fdff[_0xcaec('0x2f')](getAssociatedResources(_0xcaec('0x10'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x34')));_0x59fdff['push'](getAssociatedResources(_0xcaec('0x11'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x3b')));_0x59fdff[_0xcaec('0x2f')](getAssociatedResources(_0xcaec('0x12'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x35')));_0x59fdff['push'](getAssociatedResources(_0xcaec('0x13'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x6')));_0x59fdff['push'](getAssociatedResources(_0xcaec('0x15'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x36')));_0x59fdff[_0xcaec('0x2f')](getAssociatedResources(_0xcaec('0x16'),_0xf07371[_0xcaec('0x24')],_0xcaec('0x1b')));_0x59fdff[_0xcaec('0x2f')](db[_0xcaec('0x6')]['findAll'](queryAgents));break;case _0xcaec('0x7'):_0x338f21[_0x22b82b](_0xcaec('0x38'));_0x338f21[_0x22b82b](_0xcaec('0x39'));_0x59fdff[_0xcaec('0x2f')](_0xf07371[_0xcaec('0x3c')]({'attributes':['id',_0xcaec('0x4')]}));_0x59fdff[_0xcaec('0x2f')](_0xf07371[_0xcaec('0x3d')]({'attributes':['id','name']}));_0x59fdff[_0xcaec('0x2f')](_0xf07371['getFaxQueues']({'attributes':['id',_0xcaec('0x4')]}));_0x59fdff[_0xcaec('0x2f')](_0xf07371[_0xcaec('0x3e')]({'attributes':['id',_0xcaec('0x4')]}));_0x59fdff['push'](_0xf07371[_0xcaec('0x3f')]({'attributes':['id',_0xcaec('0x4')]}));_0x59fdff[_0xcaec('0x2f')](_0xf07371[_0xcaec('0x40')]({'attributes':['id',_0xcaec('0x4')]}));_0x59fdff['push'](_0xf07371[_0xcaec('0x41')]({'attributes':['id',_0xcaec('0x4')]}));break;}return BPromise['all'](_0x59fdff);}})[_0xcaec('0xc')](function(_0x11e8d4){if(_0x11e8d4&&_0x11e8d4[_0xcaec('0x1e')]){for(var _0x54f9aa=0x0;_0x54f9aa<_0x11e8d4[_0xcaec('0x1e')];_0x54f9aa+=0x1){for(var _0x17fa2d=0x0;_0x17fa2d<_0x11e8d4[_0x54f9aa][_0xcaec('0x1e')];_0x17fa2d+=0x1){switch(_0x54f9aa){case 0x0:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x42'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x1:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x43'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x2:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x44'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x3:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x45'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x4:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x46'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x5:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x47'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x6:joinOrLeaveQueues(_0x338f21,_0x22b82b,_0xcaec('0x48'),_0x11e8d4[_0x54f9aa][_0x17fa2d]);break;case 0x7:if(_0x381399['role']!==_0xcaec('0x7'))_0x338f21[_0x22b82b](util[_0xcaec('0x1c')](_0xcaec('0x49'),_0x11e8d4[_0x54f9aa][_0x17fa2d][_0xcaec('0x4')]));break;case 0x8:if(_0x381399[_0xcaec('0x23')]!=='agent')_0x338f21[_0x22b82b](util['format']('trunk:%s',_0x11e8d4[_0x54f9aa][_0x17fa2d][_0xcaec('0x4')]));break;case 0x9:if(_0x381399['role']!==_0xcaec('0x7'))_0x338f21[_0x22b82b](util[_0xcaec('0x1c')](_0xcaec('0x4a'),_0x11e8d4[_0x54f9aa][_0x17fa2d][_0xcaec('0x9')],_0x11e8d4[_0x54f9aa][_0x17fa2d][_0xcaec('0x4')]));break;case 0xa:_0x338f21[_0x22b82b](util[_0xcaec('0x1c')]('user:%s',_0x11e8d4[_0x54f9aa][_0x17fa2d][_0xcaec('0x4')]));break;}}}}})[_0xcaec('0xc')](function(){if(_0x22b82b===_0xcaec('0x4b')){var _0x5aa58b=_[_0xcaec('0x19')](_0x381399[_0xcaec('0x26')],'id');return _0x381399['removeChatInteractions'](_0x5aa58b)[_0xcaec('0xc')](function(){for(var _0x45bcfb=0x0;_0x45bcfb<_0x5aa58b['length'];_0x45bcfb+=0x1){_0x429355[_0xcaec('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5aa58b[_0x45bcfb]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0xc')](function(){if(_0x22b82b===_0xcaec('0x4b')){var _0x385c76=_[_0xcaec('0x19')](_0x381399['MailInteractions'],'id');return _0x381399[_0xcaec('0x4d')](_0x385c76)['then'](function(){for(var _0xe1fc08=0x0;_0xe1fc08<_0x385c76[_0xcaec('0x1e')];_0xe1fc08+=0x1){_0x429355[_0xcaec('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x385c76[_0xe1fc08]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0xc')](function(){if(_0x22b82b===_0xcaec('0x4b')){var _0x416b1e=_[_0xcaec('0x19')](_0x381399['FaxInteractions'],'id');return _0x381399[_0xcaec('0x4e')](_0x416b1e)['then'](function(){for(var _0x4007dc=0x0;_0x4007dc<_0x416b1e[_0xcaec('0x1e')];_0x4007dc+=0x1){_0x429355[_0xcaec('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x416b1e[_0x4007dc]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0xc')](function(){if(_0x22b82b==='leave'){var _0x570925=_['map'](_0x381399[_0xcaec('0x2a')],'id');return _0x381399['removeSmsInteractions'](_0x570925)[_0xcaec('0xc')](function(){for(var _0x35ba38=0x0;_0x35ba38<_0x570925['length'];_0x35ba38+=0x1){_0x429355[_0xcaec('0x4c')](_0xcaec('0x4f'),{'SmsInteractionId':Number(_0x570925[_0x35ba38]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0xc')](function(){if(_0x22b82b===_0xcaec('0x4b')){var _0x368145=_[_0xcaec('0x19')](_0x381399[_0xcaec('0x50')],'id');return _0x381399[_0xcaec('0x51')](_0x368145)['then'](function(){for(var _0x16f530=0x0;_0x16f530<_0x368145[_0xcaec('0x1e')];_0x16f530+=0x1){_0x429355[_0xcaec('0x4c')](_0xcaec('0x52'),{'OpenchannelInteractionId':Number(_0x368145[_0x16f530]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0xc')](function(){if(_0x22b82b===_0xcaec('0x4b')){var _0x103040=_[_0xcaec('0x19')](_0x381399[_0xcaec('0x2b')],'id');return _0x381399[_0xcaec('0x53')](_0x103040)['then'](function(){for(var _0x39b15f=0x0;_0x39b15f<_0x103040[_0xcaec('0x1e')];_0x39b15f+=0x1){_0x429355[_0xcaec('0x4c')](_0xcaec('0x54'),{'WhatsappInteractionId':Number(_0x103040[_0x39b15f]),'UserId':Number(_0x381399['id'])});}});}})[_0xcaec('0x55')](function(_0x3bb50f){_0x338f21[_0xcaec('0x56')](_0x3bb50f);});}}function onDisconnect(_0x44a009,_0x501ea6){joinOrLeave(_0x44a009,_0xcaec('0x4b'),_0x501ea6);}function onConnect(_0x5e85f8){joinOrLeave(_0x5e85f8,_0xcaec('0x57'));}exports[_0xcaec('0x58')]=function(_0x3693bb){_0x3693bb['on'](_0xcaec('0x59'),function(_0x45f3ce){_0x45f3ce['setMaxListeners'](0x0);_0x45f3ce[_0xcaec('0x5a')]=_0x45f3ce[_0xcaec('0x5b')][_0xcaec('0x59')][_0xcaec('0x5c')]+':'+_0x45f3ce['request'][_0xcaec('0x59')][_0xcaec('0x5d')];_0x45f3ce[_0xcaec('0x5e')]=new Date();_0x45f3ce['log']=function(_0xeb7f47){console[_0xcaec('0x56')](_0xcaec('0x5f')+_0x45f3ce['nsp'][_0xcaec('0x4')]+'['+_0x45f3ce[_0xcaec('0x5a')]+']',_0xeb7f47);};_0x45f3ce['on']('disconnect',function(){onDisconnect(_0x45f3ce,_0x3693bb);_0x45f3ce['log']('DISCONNECTED');});onConnect(_0x45f3ce);_0x45f3ce[_0xcaec('0x56')]('CONNECTED');});};
\ No newline at end of file
index 46b79c1..5712da0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67d=['format','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','motionChannel','offlineMessage','opened','resolve','SIP/%s','closed','changed','substatus','AfterUpdate','User','find','internal','default','length','model','hook','condition','util','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','afterUpdate','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','error','catch','Trigger,\x20%s','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface'];(function(_0x1263c1,_0x287a24){var _0x59639e=function(_0xf1c73c){while(--_0xf1c73c){_0x1263c1['push'](_0x1263c1['shift']());}};_0x59639e(++_0x287a24);}(_0xd67d,0xa7));var _0xdd67=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0xd67d[_0x15797a];return _0x3e2618;};'use strict';var util=require(_0xdd67('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdd67('0x1'));var logger=require(_0xdd67('0x2'))(_0xdd67('0x3'));var client=jayson[_0xdd67('0x4')][_0xdd67('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xdd67('0x6'),'event':_0xdd67('0x7'),'condition':_0xdd67('0x8'),'callback':afterCreate},{'channel':_0xdd67('0x9'),'model':_0xdd67('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdd67('0x9'),'model':'ChatMessage','event':_0xdd67('0x7'),'condition':_0xdd67('0xa'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xdd67('0xb'),'event':'afterCreate','condition':_0xdd67('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xdd67('0xc'),'model':_0xdd67('0xd'),'event':_0xdd67('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdd67('0xc'),'model':_0xdd67('0xd'),'event':'afterUpdate','condition':_0xdd67('0xe'),'callback':afterUpdate},{'channel':_0xdd67('0xc'),'model':_0xdd67('0xf'),'event':_0xdd67('0x7'),'condition':_0xdd67('0xa'),'callback':afterCreateMessage},{'channel':_0xdd67('0x10'),'model':_0xdd67('0x11'),'event':_0xdd67('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdd67('0x10'),'model':_0xdd67('0x11'),'event':_0xdd67('0x12'),'condition':_0xdd67('0xe'),'callback':afterUpdate},{'channel':_0xdd67('0x10'),'model':'WhatsappMessage','event':_0xdd67('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdd67('0x13'),'model':_0xdd67('0x14'),'event':_0xdd67('0x7'),'condition':_0xdd67('0x8'),'callback':afterCreate},{'channel':_0xdd67('0x13'),'model':'FaxInteraction','event':'afterUpdate','condition':_0xdd67('0xe'),'callback':afterUpdate},{'channel':_0xdd67('0x13'),'model':_0xdd67('0x15'),'event':_0xdd67('0x7'),'condition':_0xdd67('0xa'),'callback':afterCreateMessage},{'channel':_0xdd67('0x16'),'model':_0xdd67('0x17'),'event':_0xdd67('0x7'),'condition':_0xdd67('0x8'),'callback':afterCreate},{'channel':_0xdd67('0x16'),'model':_0xdd67('0x17'),'event':_0xdd67('0x12'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdd67('0x16'),'model':_0xdd67('0x18'),'event':_0xdd67('0x7'),'condition':_0xdd67('0xa'),'callback':afterCreateMessage},{'channel':_0xdd67('0x19'),'model':_0xdd67('0x1a'),'event':'afterCreate','condition':_0xdd67('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xdd67('0x1a'),'event':_0xdd67('0x12'),'condition':_0xdd67('0xe'),'callback':afterUpdate},{'channel':_0xdd67('0x19'),'model':_0xdd67('0x1b'),'event':_0xdd67('0x7'),'condition':_0xdd67('0xa'),'callback':afterCreateMessage}];function request(_0x3b4777){return client['request'](_0xdd67('0x1c'),_0x3b4777)[_0xdd67('0x1d')](function(_0x5a8867){logger[_0xdd67('0x1e')]('Trigger,\x20%s',_0xdd67('0x1c'),_0x5a8867);if(_0x5a8867['error']){if(_0x5a8867[_0xdd67('0x1f')]['code']===0x1f4){logger['error']('Trigger,\x20%s',_0xdd67('0x1c'),_0x5a8867[_0xdd67('0x1f')]);}}})[_0xdd67('0x20')](function(_0x7848da){logger[_0xdd67('0x1f')](_0xdd67('0x21'),_0xdd67('0x1c'),_0x7848da);});}function afterCreateMessage(_0x2b9e4b){return function(_0xaaadb5){_0xaaadb5=_0xaaadb5[_0xdd67('0x22')]({'plain':!![]});_0xaaadb5[_0xdd67('0x23')]=_0x2b9e4b;_0xaaadb5['motionChannel']=_0x2b9e4b;_0xaaadb5[_0xdd67('0x24')]=_0xaaadb5[_0xdd67('0x25')];Promise['resolve']()[_0xdd67('0x1d')](function(){if(typeof _0xaaadb5['ContactId']==='undefined')return null;var _0x342d1d=_0xdd67('0x26')+_0xaaadb5[_0xdd67('0x27')];return db[_0xdd67('0x28')][_0xdd67('0x29')](_0x342d1d,{'type':db[_0xdd67('0x2a')][_0xdd67('0x2b')][_0xdd67('0x2c')],'raw':!![]});})[_0xdd67('0x1d')](function(_0x1ca3a0){if(_0x1ca3a0){_0xaaadb5[_0xdd67('0x2d')]=_0x1ca3a0[0x0];}if(typeof _0xaaadb5[_0xdd67('0x2e')]===_0xdd67('0x2f'))return;return getAgent(_0xaaadb5[_0xdd67('0x2e')]);})[_0xdd67('0x1d')](function(_0x4dda6d){if(_0x4dda6d){_0xaaadb5[_0xdd67('0x30')]=util[_0xdd67('0x31')]('SIP/%s',_0x4dda6d[_0xdd67('0x32')]);_0xaaadb5[_0xdd67('0x33')]=_0x4dda6d;_0xaaadb5[_0xdd67('0x23')]=_0x2b9e4b;return request({'event':_0xdd67('0x34'),'message':_0xaaadb5});}else{return request({'event':_0xdd67('0x35'),'message':_0xaaadb5});}})['catch'](function(_0x158f05){logger[_0xdd67('0x1f')](_0xdd67('0x21'),_0xdd67('0x36'),_0x158f05);});};}function afterCreateOfflineMessage(_0x13f351){return function(_0x30f273){_0x30f273=_0x30f273[_0xdd67('0x22')]({'plain':!![]});_0x30f273['channel']=_0x13f351;_0x30f273[_0xdd67('0x37')]=_0x13f351;_0x30f273['event']=_0xdd67('0x38');return request({'event':_0x30f273['event'],'message':_0x30f273});};}function afterCreate(_0x2cb2aa,_0x2a0d10){return function(_0x3d9873){_0x3d9873=_0x3d9873['get']({'plain':!![]});_0x3d9873[_0xdd67('0x23')]=_0x2cb2aa;_0x3d9873[_0xdd67('0x37')]=_0x2cb2aa;_0x3d9873[_0xdd67('0x24')]=_0xdd67('0x39');Promise[_0xdd67('0x3a')]()['then'](function(){var _0x13190e=_0xdd67('0x26')+_0x3d9873['ContactId'];return db['sequelize']['query'](_0x13190e,{'type':db[_0xdd67('0x2a')][_0xdd67('0x2b')]['SELECT'],'raw':!![]});})[_0xdd67('0x1d')](function(_0x5a172e){if(_0x5a172e){_0x3d9873[_0xdd67('0x2d')]=_0x5a172e[0x0];}if(typeof _0x3d9873[_0xdd67('0x2e')]===_0xdd67('0x2f'))return;return getAgent(_0x3d9873[_0xdd67('0x2e')]);})[_0xdd67('0x1d')](function(_0x2312c6){if(_0x2312c6){_0x3d9873[_0xdd67('0x30')]=util['format'](_0xdd67('0x3b'),_0x2312c6[_0xdd67('0x32')]);_0x3d9873['agent']=_0x2312c6;}return request({'event':_0x2a0d10,'message':_0x3d9873});})['catch'](function(_0x4ad43d){logger[_0xdd67('0x1f')](_0xdd67('0x21'),'AfterCreate',_0x4ad43d);});};}function afterUpdate(_0x50c1fd){return function(_0x17a8be){var _0x4dad02=_0x17a8be['changed'](_0xdd67('0x3c'))&&_0x17a8be[_0xdd67('0x3c')];var _0x48e94e=_0x17a8be[_0xdd67('0x3d')]('substatus');if(_0x4dad02||_0x48e94e){var _0x5836a2=_0x4dad02?_0xdd67('0xe'):'substatus';var _0x2f75c7=_0x17a8be['get']({'plain':!![]});_0x2f75c7['channel']=_0x50c1fd;_0x2f75c7['motionChannel']=_0x50c1fd;_0x2f75c7[_0xdd67('0x24')]=_0x4dad02?'closed':_0xdd67('0x3e');var _0x228271=_0xdd67('0x26')+_0x2f75c7[_0xdd67('0x27')];return db[_0xdd67('0x28')][_0xdd67('0x29')](_0x228271,{'type':db[_0xdd67('0x2a')]['QueryTypes'][_0xdd67('0x2c')],'raw':!![]})[_0xdd67('0x1d')](function(_0xe55595){if(_0xe55595){_0x2f75c7['contact']=_0xe55595[0x0];}if(typeof _0x2f75c7[_0xdd67('0x2e')]==='undefined')return;return getAgent(_0x2f75c7[_0xdd67('0x2e')]);})[_0xdd67('0x1d')](function(_0x2b6e62){if(_0x2b6e62){_0x2f75c7['interface']=util[_0xdd67('0x31')](_0xdd67('0x3b'),_0x2b6e62[_0xdd67('0x32')]);_0x2f75c7['agent']=_0x2b6e62;}return request({'event':_0x5836a2,'message':_0x2f75c7});})['catch'](function(_0x1ef50f){logger[_0xdd67('0x1f')](_0xdd67('0x21'),_0xdd67('0x3f'),_0x1ef50f);});}};}function getAgent(_0xbdaf86){return db[_0xdd67('0x40')][_0xdd67('0x41')]({'where':{'id':_0xbdaf86},'attributes':['id',_0xdd67('0x32'),'fullname','email',_0xdd67('0x42')],'raw':!![]})['then'](function(_0x58e2a1){return _0x58e2a1;});}exports[_0xdd67('0x43')]=function(){for(var _0x172f9d=0x0;_0x172f9d<triggers[_0xdd67('0x44')];_0x172f9d+=0x1){if(db['hasOwnProperty'](triggers[_0x172f9d][_0xdd67('0x45')])){db[triggers[_0x172f9d]['model']][_0xdd67('0x46')](triggers[_0x172f9d][_0xdd67('0x24')],triggers[_0x172f9d]['callback'](triggers[_0x172f9d][_0xdd67('0x23')]['toLowerCase'](),triggers[_0x172f9d][_0xdd67('0x47')]));}}};
\ No newline at end of file
+var _0xb1e4=['Trigger,\x20%s','catch','channel','event','direction','resolve','undefined','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','get','motionChannel','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','internal','default','length','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','ChatMessage','afterCreate','newmessage','SmsInteraction','newinteraction','Sms','afterUpdate','closedinteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailMessage','Openchannel','request','EventManager','then','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb1e4,0x70));var _0x4b1e=function(_0x20dff2,_0x2acf3b){_0x20dff2=_0x20dff2-0x0;var _0x47cd56=_0xb1e4[_0x20dff2];return _0x47cd56;};'use strict';var util=require(_0x4b1e('0x0'));var db=require(_0x4b1e('0x1'))['db'];var jayson=require(_0x4b1e('0x2'));var logger=require(_0x4b1e('0x3'))(_0x4b1e('0x4'));var client=jayson['client'][_0x4b1e('0x5')]({'port':0x232a});var triggers=[{'channel':_0x4b1e('0x6'),'model':_0x4b1e('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x4b1e('0x6'),'model':_0x4b1e('0x7'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4b1e('0x6'),'model':_0x4b1e('0x8'),'event':_0x4b1e('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4b1e('0x6'),'model':'ChatOfflineMessage','event':_0x4b1e('0x9'),'condition':_0x4b1e('0xa'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x4b1e('0xb'),'event':'afterCreate','condition':_0x4b1e('0xc'),'callback':afterCreate},{'channel':_0x4b1e('0xd'),'model':'SmsInteraction','event':_0x4b1e('0xe'),'condition':_0x4b1e('0xf'),'callback':afterUpdate},{'channel':_0x4b1e('0xd'),'model':'SmsMessage','event':_0x4b1e('0x9'),'condition':_0x4b1e('0xa'),'callback':afterCreateMessage},{'channel':_0x4b1e('0x10'),'model':_0x4b1e('0x11'),'event':_0x4b1e('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4b1e('0x10'),'model':_0x4b1e('0x11'),'event':'afterUpdate','condition':_0x4b1e('0xf'),'callback':afterUpdate},{'channel':_0x4b1e('0x10'),'model':_0x4b1e('0x12'),'event':_0x4b1e('0x9'),'condition':_0x4b1e('0xa'),'callback':afterCreateMessage},{'channel':_0x4b1e('0x13'),'model':_0x4b1e('0x14'),'event':_0x4b1e('0x9'),'condition':_0x4b1e('0xc'),'callback':afterCreate},{'channel':_0x4b1e('0x13'),'model':_0x4b1e('0x14'),'event':_0x4b1e('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4b1e('0x13'),'model':_0x4b1e('0x15'),'event':'afterCreate','condition':_0x4b1e('0xa'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x4b1e('0x9'),'condition':_0x4b1e('0xc'),'callback':afterCreate},{'channel':_0x4b1e('0x16'),'model':'MailInteraction','event':_0x4b1e('0xe'),'condition':_0x4b1e('0xf'),'callback':afterUpdate},{'channel':_0x4b1e('0x16'),'model':_0x4b1e('0x17'),'event':_0x4b1e('0x9'),'condition':_0x4b1e('0xa'),'callback':afterCreateMessage},{'channel':_0x4b1e('0x18'),'model':'OpenchannelInteraction','event':_0x4b1e('0x9'),'condition':_0x4b1e('0xc'),'callback':afterCreate},{'channel':_0x4b1e('0x18'),'model':'OpenchannelInteraction','event':_0x4b1e('0xe'),'condition':_0x4b1e('0xf'),'callback':afterUpdate},{'channel':_0x4b1e('0x18'),'model':'OpenchannelMessage','event':_0x4b1e('0x9'),'condition':_0x4b1e('0xa'),'callback':afterCreateMessage}];function request(_0x1f8319){return client[_0x4b1e('0x19')](_0x4b1e('0x1a'),_0x1f8319)[_0x4b1e('0x1b')](function(_0x45641c){logger['info']('Trigger,\x20%s',_0x4b1e('0x1a'),_0x45641c);if(_0x45641c[_0x4b1e('0x1c')]){if(_0x45641c[_0x4b1e('0x1c')][_0x4b1e('0x1d')]===0x1f4){logger[_0x4b1e('0x1c')](_0x4b1e('0x1e'),'EventManager',_0x45641c[_0x4b1e('0x1c')]);}}})[_0x4b1e('0x1f')](function(_0x9edd5){logger['error'](_0x4b1e('0x1e'),_0x4b1e('0x1a'),_0x9edd5);});}function afterCreateMessage(_0x569268){return function(_0x131425){_0x131425=_0x131425['get']({'plain':!![]});_0x131425[_0x4b1e('0x20')]=_0x569268;_0x131425['motionChannel']=_0x569268;_0x131425[_0x4b1e('0x21')]=_0x131425[_0x4b1e('0x22')];Promise[_0x4b1e('0x23')]()[_0x4b1e('0x1b')](function(){if(typeof _0x131425['ContactId']===_0x4b1e('0x24'))return null;var _0x35044d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x131425[_0x4b1e('0x25')];return db[_0x4b1e('0x26')][_0x4b1e('0x27')](_0x35044d,{'type':db[_0x4b1e('0x28')][_0x4b1e('0x29')][_0x4b1e('0x2a')],'raw':!![]});})['then'](function(_0x5cdb13){if(_0x5cdb13){_0x131425['contact']=_0x5cdb13[0x0];}if(typeof _0x131425[_0x4b1e('0x2b')]===_0x4b1e('0x24'))return;return getAgent(_0x131425[_0x4b1e('0x2b')]);})[_0x4b1e('0x1b')](function(_0x5670c1){if(_0x5670c1){_0x131425[_0x4b1e('0x2c')]=util[_0x4b1e('0x2d')](_0x4b1e('0x2e'),_0x5670c1[_0x4b1e('0x2f')]);_0x131425[_0x4b1e('0x30')]=_0x5670c1;_0x131425[_0x4b1e('0x20')]=_0x569268;return request({'event':_0x4b1e('0x31'),'message':_0x131425});}else{return request({'event':_0x4b1e('0x32'),'message':_0x131425});}})['catch'](function(_0x187a1f){logger[_0x4b1e('0x1c')](_0x4b1e('0x1e'),'AfterCreateMessage',_0x187a1f);});};}function afterCreateOfflineMessage(_0x4a4651){return function(_0x4cd384){_0x4cd384=_0x4cd384[_0x4b1e('0x33')]({'plain':!![]});_0x4cd384[_0x4b1e('0x20')]=_0x4a4651;_0x4cd384[_0x4b1e('0x34')]=_0x4a4651;_0x4cd384['event']=_0x4b1e('0x35');return request({'event':_0x4cd384[_0x4b1e('0x21')],'message':_0x4cd384});};}function afterCreate(_0x41f96b,_0x4f1a62){return function(_0x42471e){_0x42471e=_0x42471e[_0x4b1e('0x33')]({'plain':!![]});_0x42471e[_0x4b1e('0x20')]=_0x41f96b;_0x42471e[_0x4b1e('0x34')]=_0x41f96b;_0x42471e[_0x4b1e('0x21')]=_0x4b1e('0x36');Promise[_0x4b1e('0x23')]()[_0x4b1e('0x1b')](function(){var _0x1618b4=_0x4b1e('0x37')+_0x42471e[_0x4b1e('0x25')];return db[_0x4b1e('0x26')][_0x4b1e('0x27')](_0x1618b4,{'type':db[_0x4b1e('0x28')][_0x4b1e('0x29')][_0x4b1e('0x2a')],'raw':!![]});})[_0x4b1e('0x1b')](function(_0x508410){if(_0x508410){_0x42471e[_0x4b1e('0x38')]=_0x508410[0x0];}if(typeof _0x42471e['UserId']===_0x4b1e('0x24'))return;return getAgent(_0x42471e[_0x4b1e('0x2b')]);})[_0x4b1e('0x1b')](function(_0x419b32){if(_0x419b32){_0x42471e[_0x4b1e('0x2c')]=util[_0x4b1e('0x2d')](_0x4b1e('0x2e'),_0x419b32[_0x4b1e('0x2f')]);_0x42471e[_0x4b1e('0x30')]=_0x419b32;}return request({'event':_0x4f1a62,'message':_0x42471e});})[_0x4b1e('0x1f')](function(_0x35d274){logger[_0x4b1e('0x1c')](_0x4b1e('0x1e'),_0x4b1e('0x39'),_0x35d274);});};}function afterUpdate(_0x53fc64){return function(_0x4d7b8a){var _0xd144ee=_0x4d7b8a[_0x4b1e('0x3a')](_0x4b1e('0x3b'))&&_0x4d7b8a['closed'];var _0x58ebd9=_0x4d7b8a['changed']('substatus');if(_0xd144ee||_0x58ebd9){var _0x2d1081=_0xd144ee?_0x4b1e('0xf'):'substatus';var _0x4c6b8a=_0x4d7b8a[_0x4b1e('0x33')]({'plain':!![]});_0x4c6b8a[_0x4b1e('0x20')]=_0x53fc64;_0x4c6b8a[_0x4b1e('0x34')]=_0x53fc64;_0x4c6b8a['event']=_0xd144ee?'closed':_0x4b1e('0x3c');var _0x331706=_0x4b1e('0x37')+_0x4c6b8a[_0x4b1e('0x25')];return db['sequelize']['query'](_0x331706,{'type':db[_0x4b1e('0x28')][_0x4b1e('0x29')][_0x4b1e('0x2a')],'raw':!![]})[_0x4b1e('0x1b')](function(_0x19bc2d){if(_0x19bc2d){_0x4c6b8a[_0x4b1e('0x38')]=_0x19bc2d[0x0];}if(typeof _0x4c6b8a[_0x4b1e('0x2b')]===_0x4b1e('0x24'))return;return getAgent(_0x4c6b8a['UserId']);})[_0x4b1e('0x1b')](function(_0x41fe46){if(_0x41fe46){_0x4c6b8a[_0x4b1e('0x2c')]=util[_0x4b1e('0x2d')]('SIP/%s',_0x41fe46[_0x4b1e('0x2f')]);_0x4c6b8a[_0x4b1e('0x30')]=_0x41fe46;}return request({'event':_0x2d1081,'message':_0x4c6b8a});})['catch'](function(_0x3173ef){logger[_0x4b1e('0x1c')](_0x4b1e('0x1e'),_0x4b1e('0x3d'),_0x3173ef);});}};}function getAgent(_0x41aeb7){return db[_0x4b1e('0x3e')][_0x4b1e('0x3f')]({'where':{'id':_0x41aeb7},'attributes':['id','name','fullname','email',_0x4b1e('0x40')],'raw':!![]})['then'](function(_0x25cb3e){return _0x25cb3e;});}exports[_0x4b1e('0x41')]=function(){for(var _0x338e4d=0x0;_0x338e4d<triggers[_0x4b1e('0x42')];_0x338e4d+=0x1){if(db[_0x4b1e('0x43')](triggers[_0x338e4d][_0x4b1e('0x44')])){db[triggers[_0x338e4d][_0x4b1e('0x44')]]['hook'](triggers[_0x338e4d][_0x4b1e('0x21')],triggers[_0x338e4d][_0x4b1e('0x45')](triggers[_0x338e4d][_0x4b1e('0x20')]['toLowerCase'](),triggers[_0x338e4d][_0x4b1e('0x46')]));}}};
\ No newline at end of file
index d8c85ff..6833e10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4609=['includes','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase'];(function(_0x1d75b1,_0x5d78f9){var _0x354260=function(_0x2f5333){while(--_0x2f5333){_0x1d75b1['push'](_0x1d75b1['shift']());}};_0x354260(++_0x5d78f9);}(_0x4609,0xda));var _0x9460=function(_0x4ac76c,_0x11178b){_0x4ac76c=_0x4ac76c-0x0;var _0xad2eda=_0x4609[_0x4ac76c];return _0xad2eda;};'use strict';var _=require(_0x9460('0x0'));var BPromise=require(_0x9460('0x1'));var db=require(_0x9460('0x2'))['db'];var util=require(_0x9460('0x3'));var channels=['voice',_0x9460('0x4'),_0x9460('0x5'),_0x9460('0x6'),_0x9460('0x7'),_0x9460('0x8'),_0x9460('0x9')];exports['getChannels']=function(){return channels;};exports[_0x9460('0xa')]=function(_0x27b6ca){_0x27b6ca=_0x27b6ca[_0x9460('0xb')]();return _[_0x9460('0xc')](channels,_0x27b6ca);};exports['clearBlockUser']=function(_0x33fca4,_0x3dfd3e,_0x2c8d74,_0x237d6b){var _0x40eb9f={'loginAttempts':_0x3dfd3e,'blocked':_0x2c8d74};if(!_[_0x9460('0xd')](_0x237d6b)){_0x40eb9f[_0x9460('0xe')]=_0x237d6b;}return _0x33fca4[_0x9460('0xf')](_0x40eb9f);};exports[_0x9460('0x10')]=function(_0x502131){return new BPromise(function(_0x421c10,_0x3b9bc8){var _0x43e07b=0x0;if(_0x502131['role']!==_0x9460('0x11')){_0x421c10(_0x502131);}db[_0x9460('0x12')]['count']({'where':{'role':_0x9460('0x11'),'online':!![],'id':{'$ne':_0x502131['id']}}})[_0x9460('0x13')](function(_0x90acd9){_0x43e07b=_0x90acd9;return util[_0x9460('0x10')]();})[_0x9460('0x13')](function(_0x80fc59){if(_0x80fc59&&_0x80fc59[_0x9460('0x14')]&&_0x43e07b>=_0x80fc59[_0x9460('0x14')]){throw Error(_0x9460('0x15'));}_0x421c10(_0x502131);})[_0x9460('0x16')](function(_0x5ccf96){_0x3b9bc8(_0x5ccf96);});});};
\ No newline at end of file
+var _0x9973=['toLowerCase','includes','clearBlockUser','isUndefined','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','voice','chat','fax','whatsapp','openchannel','getChannels','isValidChannel'];(function(_0x3070ec,_0x4c4d59){var _0x39aef3=function(_0x46987f){while(--_0x46987f){_0x3070ec['push'](_0x3070ec['shift']());}};_0x39aef3(++_0x4c4d59);}(_0x9973,0x1da));var _0x3997=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9973[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var BPromise=require(_0x3997('0x0'));var db=require(_0x3997('0x1'))['db'];var util=require('./license/util');var channels=[_0x3997('0x2'),'mail',_0x3997('0x3'),_0x3997('0x4'),'sms',_0x3997('0x5'),_0x3997('0x6')];exports[_0x3997('0x7')]=function(){return channels;};exports[_0x3997('0x8')]=function(_0x5a9a38){_0x5a9a38=_0x5a9a38[_0x3997('0x9')]();return _[_0x3997('0xa')](channels,_0x5a9a38);};exports[_0x3997('0xb')]=function(_0x6886e1,_0x18abb5,_0x51d6b6,_0x2ff0ab){var _0x4d5da6={'loginAttempts':_0x18abb5,'blocked':_0x51d6b6};if(!_[_0x3997('0xc')](_0x2ff0ab)){_0x4d5da6['blockedAt']=_0x2ff0ab;}return _0x6886e1['updateAttributes'](_0x4d5da6);};exports[_0x3997('0xd')]=function(_0x5dd5ba){return new BPromise(function(_0x93ec28,_0xe107d4){var _0x216b38=0x0;if(_0x5dd5ba[_0x3997('0xe')]!==_0x3997('0xf')){_0x93ec28(_0x5dd5ba);}db['User'][_0x3997('0x10')]({'where':{'role':_0x3997('0xf'),'online':!![],'id':{'$ne':_0x5dd5ba['id']}}})[_0x3997('0x11')](function(_0x5b836d){_0x216b38=_0x5b836d;return util[_0x3997('0xd')]();})['then'](function(_0x10f76f){if(_0x10f76f&&_0x10f76f[_0x3997('0x12')]&&_0x216b38>=_0x10f76f[_0x3997('0x12')]){throw Error(_0x3997('0x13'));}_0x93ec28(_0x5dd5ba);})[_0x3997('0x14')](function(_0x5473e8){_0xe107d4(_0x5473e8);});});};
\ No newline at end of file
index 86288ea..b2fb886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['OutOfInterval','error','stack','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','inherits'];(function(_0x44a784,_0x479da0){var _0x70d93a=function(_0x2774b8){while(--_0x2774b8){_0x44a784['push'](_0x44a784['shift']());}};_0x70d93a(++_0x479da0);}(_0x70e0,0x17b));var _0x070e=function(_0x219069,_0x4e7e2a){_0x219069=_0x219069-0x0;var _0x2e78a6=_0x70e0[_0x219069];return _0x2e78a6;};'use strict';var util=require(_0x070e('0x0'));var logger=require(_0x070e('0x1'))(_0x070e('0x2'));var APIError=function(_0x4d95bb,_0x579b83){this[_0x070e('0x3')]=_0x4d95bb||_0x070e('0x4');this[_0x070e('0x5')]=_0x579b83||_0x070e('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x7bce9b){this['message']=_0x7bce9b||_0x070e('0x7');this['name']='Bad\x20Request';util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x35ab0c){this[_0x070e('0x3')]=_0x35ab0c||_0x070e('0x8');this[_0x070e('0x5')]=_0x070e('0x9');util[_0x070e('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x11ffa8){switch(_0x11ffa8){case'Bad\x20Request':return 0x190;case'Forbidden',_0x070e('0xb'):return 0x193;case _0x070e('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x12bb37){return function(_0xb8d819){logger[_0x070e('0xc')](_0xb8d819[_0x070e('0xd')]);var _0x25cfe1=getStatusCode(_0xb8d819[_0x070e('0x5')]);if(_0xb8d819[_0x070e('0x5')])delete _0xb8d819[_0x070e('0x5')];return _0x12bb37[_0x070e('0xe')](_0x25cfe1)['send'](_0xb8d819);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0x452144,_0x170931){var _0x37f223=function(_0x32d7b8){while(--_0x32d7b8){_0x452144['push'](_0x452144['shift']());}};_0x37f223(++_0x170931);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1c571e,_0x548a78){_0x1c571e=_0x1c571e-0x0;var _0x4c546e=_0xbdb7[_0x1c571e];return _0x4c546e;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index f74bbe0..4482c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87b1=['exports','status','json','send'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x87b1,0x160));var _0x187b=function(_0x1580a1,_0x836ad3){_0x1580a1=_0x1580a1-0x0;var _0xeed600=_0x87b1[_0x1580a1];return _0xeed600;};'use strict';module[_0x187b('0x0')][0x194]=function pageNotFound(_0x4ddd3e,_0x216375){var _0xda1998='404';var _0x4aca69=0x194;var _0x49f286={'status':_0x4aca69};_0x216375[_0x187b('0x1')](_0x49f286[_0x187b('0x1')]);_0x216375['render'](_0xda1998,{},function(_0x4d7565,_0x422b3e){if(_0x4d7565){return _0x216375[_0x187b('0x1')](_0x49f286['status'])[_0x187b('0x2')](_0x49f286);}_0x216375[_0x187b('0x3')](_0x422b3e);});};
\ No newline at end of file
+var _0x4d56=['render','send','exports','404','status'];(function(_0x58ac34,_0x5b5bfb){var _0x3921ab=function(_0x172dd5){while(--_0x172dd5){_0x58ac34['push'](_0x58ac34['shift']());}};_0x3921ab(++_0x5b5bfb);}(_0x4d56,0x16a));var _0x64d5=function(_0x2f7c8b,_0x1527f6){_0x2f7c8b=_0x2f7c8b-0x0;var _0x1d14d7=_0x4d56[_0x2f7c8b];return _0x1d14d7;};'use strict';module[_0x64d5('0x0')][0x194]=function pageNotFound(_0xe63833,_0x43c738){var _0x49acb2=_0x64d5('0x1');var _0x3e8d4a=0x194;var _0x1b88b2={'status':_0x3e8d4a};_0x43c738[_0x64d5('0x2')](_0x1b88b2[_0x64d5('0x2')]);_0x43c738[_0x64d5('0x3')](_0x49acb2,{},function(_0x5aad65,_0x21ae2a){if(_0x5aad65){return _0x43c738[_0x64d5('0x2')](_0x1b88b2[_0x64d5('0x2')])['json'](_0x1b88b2);}_0x43c738[_0x64d5('0x4')](_0x21ae2a);});};
\ No newline at end of file
index 8ad48f4..65a01f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c8d=['Answers','Interactions','List','ListId','TemplateId','UserMailQueue','team_has_mail_queues','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','FaxAccountId','FaxMessage','fax_interaction_has_tags','Users','FaxInteractionId','team_has_fax_queues','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsAccountId','SmsQueue','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatApplication','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CmContactHasItem','Phones','HopperFinals','HopperHistories','JscriptySessions','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','ParentId','MailApplications','ChatApplications','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','TriggerAllId','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','SalesforceConfiguration','SalesforceField','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Field','Subjects','Description','DeskField','VariableId','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','Dynamics365Configuration','ChatInternalMessage','SmsQueueReport','ProjectId','JscriptyQuestionReport','TeamVoiceQueue','VoiceQueues','MailQueues','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToAgent','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserVoicePrefix','UserProfileSections','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','../config/environment','sequelize','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','database','password','options','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','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','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.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','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','Extensions','ChatInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','Applications','Sounds','VoiceQueueId','CmHopper','Hoppers','HopperBlacks','JscriptySessionReport','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions'];(function(_0x128f51,_0x93d223){var _0x225a3c=function(_0x56a2c7){while(--_0x56a2c7){_0x128f51['push'](_0x128f51['shift']());}};_0x225a3c(++_0x93d223);}(_0x1c8d,0x9f));var _0xd1c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1c8d[_0x1facfa];return _0x9ec701;};'use strict';var config=require(_0xd1c8('0x0'));var Sequelize=require(_0xd1c8('0x1'));var _=require('lodash');var jstz=require(_0xd1c8('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0xd1c8('0x3')](config[_0xd1c8('0x1')],{'database':_0xd1c8('0x4'),'username':'xcall','password':_0xd1c8('0x5'),'options':{'host':_0xd1c8('0x6'),'port':0xcea,'dialect':_0xd1c8('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xd1c8('0x8')](),'define':{'charset':_0xd1c8('0x9'),'collate':_0xd1c8('0xa')}}});config[_0xd1c8('0xb')]=_[_0xd1c8('0x3')](config[_0xd1c8('0xb')],{'database':_0xd1c8('0x4'),'username':_0xd1c8('0xc'),'password':_0xd1c8('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd1c8('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xd1c8('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd1c8('0x1')][_0xd1c8('0xe')],config[_0xd1c8('0x1')]['username'],config[_0xd1c8('0x1')][_0xd1c8('0xf')],config['sequelize'][_0xd1c8('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config['sequelizeHistory']['username'],config[_0xd1c8('0xb')][_0xd1c8('0xf')],config['sequelizeHistory'][_0xd1c8('0x10')])};db['User']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x11'));db['VoiceChanSpy']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x12'));db[_0xd1c8('0x13')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x15'));db[_0xd1c8('0x16')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x17'));db[_0xd1c8('0x18')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x19'));db[_0xd1c8('0x1a')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x1b'));db[_0xd1c8('0x1c')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x1d'));db['ScreenRecording']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x1e'));db[_0xd1c8('0x1f')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x20'));db['VoiceMailMessage']=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xd1c8('0x21')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x22'));db['VoiceDialReport']=db[_0xd1c8('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xd1c8('0x23')]=db['sequelize']['import'](_0xd1c8('0x24'));db[_0xd1c8('0x25')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x26'));db[_0xd1c8('0x27')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x28'));db[_0xd1c8('0x29')]=db[_0xd1c8('0x1')]['import']('../api/trunk/trunk.model');db[_0xd1c8('0x2a')]=db['sequelize']['import'](_0xd1c8('0x2b'));db['UserVoiceQueueRt']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x2c'));db[_0xd1c8('0x2d')]=db['sequelize']['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd1c8('0x2e')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x2f'));db[_0xd1c8('0x30')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x31'));db[_0xd1c8('0x32')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x33'));db[_0xd1c8('0x34')]=db[_0xd1c8('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd1c8('0x35')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x36'));db[_0xd1c8('0x37')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x38'));db[_0xd1c8('0x39')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x3a'));db[_0xd1c8('0x3b')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x3c'));db[_0xd1c8('0x3d')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x3e'));db[_0xd1c8('0x3f')]=db['sequelize']['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xd1c8('0x40')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x41'));db[_0xd1c8('0x42')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x43'));db[_0xd1c8('0x44')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x45'));db['MailQueueReport']=db['sequelize']['import'](_0xd1c8('0x46'));db[_0xd1c8('0x47')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x48'));db[_0xd1c8('0x49')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x4a'));db[_0xd1c8('0x4b')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x4c'));db[_0xd1c8('0x4d')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x4e'));db[_0xd1c8('0x4f')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x50'));db['FaxMessage']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x51'));db[_0xd1c8('0x52')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x53'));db[_0xd1c8('0x54')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xd1c8('0x55')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x56'));db[_0xd1c8('0x57')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x58'));db[_0xd1c8('0x59')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x5a'));db['SmsMessage']=db['sequelize']['import'](_0xd1c8('0x5b'));db['SmsQueue']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x5c'));db[_0xd1c8('0x5d')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x5e'));db[_0xd1c8('0x5f')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x60'));db[_0xd1c8('0x61')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x62'));db[_0xd1c8('0x63')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x64'));db[_0xd1c8('0x65')]=db['sequelize']['import'](_0xd1c8('0x66'));db['ChatWebsite']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x67'));db['OpenchannelQueueReport']=db[_0xd1c8('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x68'));db[_0xd1c8('0x69')]=db['sequelize'][_0xd1c8('0x14')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/chatMessage/chatMessage.model');db[_0xd1c8('0x6a')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x6b'));db[_0xd1c8('0x6c')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x6d'));db[_0xd1c8('0x6e')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x6f'));db[_0xd1c8('0x70')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x71'));db[_0xd1c8('0x72')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x73'));db[_0xd1c8('0x74')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x75'));db['CmHopper']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x76'));db[_0xd1c8('0x77')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x78'));db[_0xd1c8('0x79')]=db['sequelize']['import'](_0xd1c8('0x7a'));db[_0xd1c8('0x7b')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xd1c8('0x7c')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x7d'));db['CmCustomField']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x7e'));db[_0xd1c8('0x7f')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x80'));db['Automation']=db[_0xd1c8('0x1')]['import']('../api/automation/automation.model');db[_0xd1c8('0x81')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x82'));db[_0xd1c8('0x83')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x84'));db[_0xd1c8('0x85')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x86'));db[_0xd1c8('0x87')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/interval/interval.model');db[_0xd1c8('0x88')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x89'));db[_0xd1c8('0x8a')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x8b'));db[_0xd1c8('0x8c')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xd1c8('0x8d')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/schedule/schedule.model');db[_0xd1c8('0x8e')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x8f'));db[_0xd1c8('0x90')]=db[_0xd1c8('0x1')]['import']('../api/tag/tag.model');db[_0xd1c8('0x91')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x92'));db['CmContactHasItem']=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x93'));db[_0xd1c8('0x94')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x95'));db[_0xd1c8('0x96')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x97'));db[_0xd1c8('0x98')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x99'));db[_0xd1c8('0x9a')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x9b'));db['Integration']=db['sequelize']['import'](_0xd1c8('0x9c'));db[_0xd1c8('0x9d')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x9e'));db['AnalyticCustomReport']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x9f'));db[_0xd1c8('0xa0')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xa1'));db[_0xd1c8('0xa2')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xa3'));db[_0xd1c8('0xa4')]=db['sequelize'][_0xd1c8('0x14')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db['sequelize'][_0xd1c8('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xa5'));db[_0xd1c8('0xa6')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xa7'));db['SalesforceConfiguration']=db[_0xd1c8('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xa8'));db[_0xd1c8('0xa9')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xaa'));db[_0xd1c8('0xab')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xac'));db[_0xd1c8('0xad')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xae'));db[_0xd1c8('0xaf')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xb0'));db[_0xd1c8('0xb1')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xb2'));db[_0xd1c8('0xb3')]=db['sequelize']['import'](_0xd1c8('0xb4'));db['ZohoConfiguration']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xb5'));db[_0xd1c8('0xb6')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xb7'));db['ZendeskAccount']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xb8'));db[_0xd1c8('0xb9')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xd1c8('0xba')]=db['sequelize'][_0xd1c8('0x14')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xd1c8('0xbb')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xbc'));db[_0xd1c8('0xbd')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xbe'));db[_0xd1c8('0xbf')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xc0'));db['VtigerConfiguration']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xc1'));db[_0xd1c8('0xc2')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xc3'));db['ServicenowAccount']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xc4'));db[_0xd1c8('0xc5')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xc6'));db[_0xd1c8('0xc7')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0xd1c8('0xc8')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xc9'));db['Dynamics365Configuration']=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xca'));db[_0xd1c8('0xcb')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xd1c8('0xcc')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xcd'));db[_0xd1c8('0xce')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xcf'));db[_0xd1c8('0xd0')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0xd1'));db[_0xd1c8('0xd2')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/integration/integration.model');db[_0xd1c8('0xd3')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xd4'));db[_0xd1c8('0xd5')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xd6'));db[_0xd1c8('0xd7')]=db['sequelize']['import'](_0xd1c8('0xd8'));db['JscriptyQuestionReport']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xd9'));db['JscriptySessionReport']=db[_0xd1c8('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xda'));db[_0xd1c8('0xdb')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xdc'));db['SquareDetailsReport']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xdd'));db[_0xd1c8('0xde')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xdf'));db[_0xd1c8('0xe0')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xe1'));db[_0xd1c8('0xe2')]=db['sequelize']['import']('../api/squareOdbc/squareOdbc.model');db[_0xd1c8('0xe3')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xe4'));db['SquareMessage']=db['sequelize'][_0xd1c8('0x14')]('../api/squareMessage/squareMessage.model');db[_0xd1c8('0xe5')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xe6'));db[_0xd1c8('0xe7')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0xe8'));db[_0xd1c8('0xe9')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xea'));db[_0xd1c8('0xeb')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xec'));db[_0xd1c8('0xed')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xee'));db[_0xd1c8('0xef')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf0'));db[_0xd1c8('0xf1')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf2'));db['ChatTransferReport']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf3'));db[_0xd1c8('0xf4')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf5'));db[_0xd1c8('0xf6')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf7'));db[_0xd1c8('0xf8')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xf9'));db['CmList']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xfa'));db[_0xd1c8('0xfb')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xfc'));db['UserProfile']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0xfd'));db[_0xd1c8('0xfe')]=db['sequelize'][_0xd1c8('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0xd1c8('0xff')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x100'));db[_0xd1c8('0x101')]=db['sequelize']['import'](_0xd1c8('0x102'));db[_0xd1c8('0x103')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x104'));db['WhatsappApplication']=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x105'));db['WhatsappInteraction']=db[_0xd1c8('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xd1c8('0x106')]=db['sequelize']['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xd1c8('0x107')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x108'));db[_0xd1c8('0x109')]=db[_0xd1c8('0x1')]['import'](_0xd1c8('0x10a'));db[_0xd1c8('0x10b')]=db['sequelize'][_0xd1c8('0x14')](_0xd1c8('0x10c'));db['CloudProvider']=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x10d'));db['TeamVoicePrefix']=db[_0xd1c8('0x1')][_0xd1c8('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x10e'));db[_0xd1c8('0x10f')]=db[_0xd1c8('0x1')][_0xd1c8('0x14')](_0xd1c8('0x110'));db[_0xd1c8('0x111')][_0xd1c8('0x112')](db[_0xd1c8('0x1f')],{'as':_0xd1c8('0x1f'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x114')});db['User'][_0xd1c8('0x112')](db['UserSetting'],{'as':'userSetting','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x1c')],{'as':_0xd1c8('0x116'),'foreignKey':'UserId'});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x117')],{'as':'VoiceQueuesRt','foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x16')],{'as':_0xd1c8('0x118'),'onDelete':_0xd1c8('0x113'),'hooks':!![]});db[_0xd1c8('0x111')]['hasMany'](db[_0xd1c8('0x79')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x7c')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0xd1c8('0x115')](db[_0xd1c8('0x61')],{'as':'OpenchannelInteractions','foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db['ChatInteraction'],{'as':_0xd1c8('0x119'),'foreignKey':_0xd1c8('0x114')});db['User']['hasMany'](db[_0xd1c8('0x59')],{'as':'SmsInteractions','foreignKey':_0xd1c8('0x114')});db['User'][_0xd1c8('0x115')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xd1c8('0x40')],{'as':_0xd1c8('0x11a'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x11b')],{'as':_0xd1c8('0x11c'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x111')][_0xd1c8('0x115')](db[_0xd1c8('0x101')],{'as':_0xd1c8('0x11d'),'foreignKey':'SenderId'});db[_0xd1c8('0x111')][_0xd1c8('0x11e')](db[_0xd1c8('0x11f')],{'as':_0xd1c8('0x11f'),'foreignKey':_0xd1c8('0x120')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x6e')],{'as':_0xd1c8('0x122'),'through':_0xd1c8('0x123')});db['User'][_0xd1c8('0x121')](db['CmContact'],{'as':_0xd1c8('0x124'),'through':_0xd1c8('0x125')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x127'),'through':_0xd1c8('0x128')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x129')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x40')],{'as':_0xd1c8('0x11a'),'through':_0xd1c8('0x12a')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['ChatInteraction'],{'as':_0xd1c8('0x119'),'through':'user_has_chat_interactions'});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x4f')],{'as':_0xd1c8('0x12b'),'through':_0xd1c8('0x12c')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x59')],{'as':_0xd1c8('0x12d'),'through':_0xd1c8('0x12e')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x61')],{'as':_0xd1c8('0x12f'),'through':_0xd1c8('0x130')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['WhatsappInteraction'],{'as':_0xd1c8('0x11c'),'through':_0xd1c8('0x131')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xd1c8('0x2d'),'required':![]});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User'][_0xd1c8('0x121')](db['MailQueue'],{'as':'MailQueues','through':'UserMailQueue','required':![]});db['User'][_0xd1c8('0x121')](db['ChatQueue'],{'as':'ChatQueues','through':_0xd1c8('0x2e'),'required':![],'hooks':!![]});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x52')],{'as':_0xd1c8('0x132'),'through':_0xd1c8('0x30'),'required':![]});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['SmsQueue'],{'as':_0xd1c8('0x133'),'through':_0xd1c8('0x32'),'required':![]});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['OpenchannelQueue'],{'as':_0xd1c8('0x134'),'through':_0xd1c8('0x34'),'required':![]});db[_0xd1c8('0x111')]['belongsToMany'](db[_0xd1c8('0x10b')],{'as':_0xd1c8('0x135'),'through':'UserWhatsappQueue','required':![]});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x126')],{'through':'cm_user_has_lists'});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x137'),'through':_0xd1c8('0x138')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x4b')],{'as':_0xd1c8('0x139'),'through':_0xd1c8('0x13a')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x3b')],{'as':_0xd1c8('0x13b'),'through':_0xd1c8('0x13c')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db[_0xd1c8('0x5d')],{'as':_0xd1c8('0x13d'),'through':_0xd1c8('0x13e')});db[_0xd1c8('0x111')]['belongsToMany'](db[_0xd1c8('0x55')],{'as':'SmsAccounts','through':_0xd1c8('0x13f')});db[_0xd1c8('0x111')][_0xd1c8('0x121')](db['WhatsappAccount'],{'as':_0xd1c8('0x140'),'through':_0xd1c8('0x141')});db[_0xd1c8('0x142')]['hasMany'](db['VoiceExtension'],{'as':_0xd1c8('0x143'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0xd1c8('0x13')][_0xd1c8('0x115')](db['VoiceExtension'],{'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x16')]['hasMany'](db[_0xd1c8('0x16')],{'as':_0xd1c8('0x144'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x18')][_0xd1c8('0x121')](db['Sound'],{'as':_0xd1c8('0x145'),'through':'moh_has_sounds'});db[_0xd1c8('0x1a')][_0xd1c8('0x115')](db[_0xd1c8('0x117')],{'as':'Members','foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')][_0xd1c8('0x115')](db[_0xd1c8('0x147')],{'as':_0xd1c8('0x148'),'foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')][_0xd1c8('0x115')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')]['hasMany'](db[_0xd1c8('0x7b')],{'as':'HopperHistories','foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')]['hasMany'](db[_0xd1c8('0x7c')],{'as':_0xd1c8('0x7c'),'foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')]['hasMany'](db[_0xd1c8('0x77')],{'as':_0xd1c8('0x149'),'foreignKey':_0xd1c8('0x146')});db[_0xd1c8('0x1a')][_0xd1c8('0x115')](db[_0xd1c8('0x14a')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xd1c8('0x1a')][_0xd1c8('0x11e')](db[_0xd1c8('0x29')],{'as':_0xd1c8('0x29'),'foreignKey':'TrunkId'});db[_0xd1c8('0x1a')]['belongsTo'](db[_0xd1c8('0x29')],{'as':_0xd1c8('0x14b'),'foreignKey':'TrunkBackupId'});db[_0xd1c8('0x1a')][_0xd1c8('0x11e')](db[_0xd1c8('0x87')],{'as':'Interval','foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0x1a')][_0xd1c8('0x11e')](db['Pause'],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db['VoiceQueue'][_0xd1c8('0x121')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x127'),'through':_0xd1c8('0x14f')});db[_0xd1c8('0x1a')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x2d')});db['VoiceQueue'][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'as':_0xd1c8('0x151'),'through':'TeamVoiceQueue'});db[_0xd1c8('0x1a')][_0xd1c8('0x121')](db['CmList'],{'as':'BlackLists','through':_0xd1c8('0x152')});db[_0xd1c8('0x1c')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x111'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x153')]['belongsTo'](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x111'),'foreignKey':'UserId'});db[_0xd1c8('0x1f')][_0xd1c8('0x115')](db[_0xd1c8('0x154')],{'as':_0xd1c8('0x155'),'onDelete':'cascade','foreignKey':_0xd1c8('0x156'),'sourceKey':'mailbox'});db[_0xd1c8('0x154')][_0xd1c8('0x11e')](db[_0xd1c8('0x1f')],{'foreignKey':_0xd1c8('0x156'),'targetKey':'mailbox'});db[_0xd1c8('0x21')][_0xd1c8('0x115')](db[_0xd1c8('0x25')],{'as':_0xd1c8('0x157'),'foreignKey':_0xd1c8('0x158'),'constraints':![]});db[_0xd1c8('0x21')][_0xd1c8('0x115')](db['VoiceAgentReport'],{'as':_0xd1c8('0x159'),'foreignKey':_0xd1c8('0x158'),'constraints':![]});db[_0xd1c8('0x21')][_0xd1c8('0x11e')](db['User'],{'as':_0xd1c8('0x111'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x21')]['belongsTo'](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db['MailServerIn'][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'as':_0xd1c8('0x3b'),'foreignKey':_0xd1c8('0x15c')});db[_0xd1c8('0x37')][_0xd1c8('0x11e')](db[_0xd1c8('0x15d')],{'as':'CloudProvider','foreignKey':_0xd1c8('0x15e'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x39')]['belongsTo'](db[_0xd1c8('0x3b')],{'as':_0xd1c8('0x3b'),'foreignKey':_0xd1c8('0x15c')});db[_0xd1c8('0x39')][_0xd1c8('0x11e')](db[_0xd1c8('0x15d')],{'as':'CloudProvider','foreignKey':_0xd1c8('0x15e'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x3b')][_0xd1c8('0x112')](db[_0xd1c8('0x37')],{'as':_0xd1c8('0x160'),'onDelete':'cascade'});db[_0xd1c8('0x3b')]['hasOne'](db[_0xd1c8('0x39')],{'as':_0xd1c8('0x161'),'onDelete':_0xd1c8('0x113')});db['MailAccount'][_0xd1c8('0x115')](db[_0xd1c8('0x83')],{'as':_0xd1c8('0x162'),'foreignKey':_0xd1c8('0x15c'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x3b')]['hasMany'](db['CannedAnswer'],{'as':_0xd1c8('0x163'),'foreignKey':_0xd1c8('0x15c')});db['MailAccount'][_0xd1c8('0x115')](db[_0xd1c8('0x42')],{'as':_0xd1c8('0x155'),'foreignKey':'MailAccountId'});db[_0xd1c8('0x3b')][_0xd1c8('0x115')](db[_0xd1c8('0x40')],{'as':_0xd1c8('0x164')});db[_0xd1c8('0x3b')][_0xd1c8('0x115')](db[_0xd1c8('0x44')],{'as':'Applications'});db[_0xd1c8('0x3b')]['belongsTo'](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db['MailAccount'][_0xd1c8('0x11e')](db[_0xd1c8('0x96')],{'as':_0xd1c8('0x96'),'foreignKey':_0xd1c8('0x167')});db[_0xd1c8('0x3b')][_0xd1c8('0x11e')](db[_0xd1c8('0x88')],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db[_0xd1c8('0x3b')]['belongsToMany'](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x13c')});db[_0xd1c8('0x3d')][_0xd1c8('0x121')](db['User'],{'as':'Agents','through':_0xd1c8('0x168')});db['MailQueue'][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x169'),'as':_0xd1c8('0x151')});db['MailInteraction']['hasMany'](db[_0xd1c8('0x42')],{'as':_0xd1c8('0x155'),'onDelete':'cascade','foreignKey':_0xd1c8('0x16a')});db[_0xd1c8('0x40')][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'as':'Account','foreignKey':_0xd1c8('0x15c')});db[_0xd1c8('0x40')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x40')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x40')][_0xd1c8('0x121')](db['Tag'],{'through':_0xd1c8('0x16c'),'as':_0xd1c8('0x16d')});db[_0xd1c8('0x40')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x16c'),'as':_0xd1c8('0x16e')});db[_0xd1c8('0x40')][_0xd1c8('0x121')](db['User'],{'as':'Users','through':_0xd1c8('0x12a'),'foreignKey':_0xd1c8('0x16a')});db[_0xd1c8('0x42')]['hasMany'](db[_0xd1c8('0xed')],{'as':_0xd1c8('0x16f'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x111')});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'onDelete':'cascade','as':'Contact'});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db[_0xd1c8('0x40')],{'as':_0xd1c8('0x170'),'foreignKey':_0xd1c8('0x16a')});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'as':_0xd1c8('0x171'),'foreignKey':'MailAccountId'});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x136'),'foreignKey':_0xd1c8('0x172')});db[_0xd1c8('0x42')][_0xd1c8('0x11e')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xd1c8('0x173')});db[_0xd1c8('0x44')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':'restrict'});db[_0xd1c8('0x44')]['belongsTo'](db[_0xd1c8('0x3d')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x44')][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x44')]['belongsTo'](db[_0xd1c8('0x87')],{'onDelete':_0xd1c8('0x15f'),'foreignKey':'IntervalId'});db[_0xd1c8('0x44')][_0xd1c8('0x11e')](db[_0xd1c8('0x90')],{'onDelete':'restrict','foreignKey':_0xd1c8('0x174')});db['MailQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{});db[_0xd1c8('0x175')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x175')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':'ContactId'});db[_0xd1c8('0x175')][_0xd1c8('0x11e')](db['MailInteraction'],{});db[_0xd1c8('0x175')][_0xd1c8('0x11e')](db[_0xd1c8('0x42')],{});db['MailQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{});db['MailQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x3d')],{});db['Dashboard'][_0xd1c8('0x115')](db[_0xd1c8('0x49')],{'as':'Items','onDelete':'cascade'});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x83')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x81')],{'as':_0xd1c8('0x163'),'foreignKey':_0xd1c8('0x176')});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x4f')],{'as':_0xd1c8('0x164')});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x4d')],{'as':_0xd1c8('0x144')});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x16')],{'as':'Exntensions','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x4b')][_0xd1c8('0x115')](db[_0xd1c8('0x177')],{'as':'Messages'});db[_0xd1c8('0x4b')][_0xd1c8('0x11e')](db['Trunk'],{'as':_0xd1c8('0x29')});db[_0xd1c8('0x4b')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x4b')][_0xd1c8('0x11e')](db[_0xd1c8('0x88')],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db['FaxAccount'][_0xd1c8('0x121')](db['User'],{'as':_0xd1c8('0x150'),'through':'user_has_fax_accounts'});db[_0xd1c8('0x4d')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x4d')][_0xd1c8('0x11e')](db[_0xd1c8('0x52')],{'onDelete':'restrict'});db[_0xd1c8('0x4d')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x4d')][_0xd1c8('0x11e')](db[_0xd1c8('0x90')],{'onDelete':_0xd1c8('0x15f'),'foreignKey':_0xd1c8('0x174')});db[_0xd1c8('0x4f')][_0xd1c8('0x115')](db['FaxMessage'],{'as':_0xd1c8('0x155'),'onDelete':_0xd1c8('0x113'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xd1c8('0x11e')](db[_0xd1c8('0x4b')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x176')});db[_0xd1c8('0x4f')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x4f')][_0xd1c8('0x11e')](db['User'],{'as':'Owner','foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x4f')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':'fax_interaction_has_tags','as':_0xd1c8('0x16d')});db[_0xd1c8('0x4f')]['belongsToMany'](db['Tag'],{'through':_0xd1c8('0x178'),'as':_0xd1c8('0x16e')});db['FaxInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x179'),'through':'user_has_fax_interactions','foreignKey':_0xd1c8('0x17a')});db[_0xd1c8('0x177')]['belongsTo'](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x111')});db[_0xd1c8('0x177')][_0xd1c8('0x11e')](db[_0xd1c8('0x4f')],{'as':_0xd1c8('0x170'),'foreignKey':_0xd1c8('0x17a')});db[_0xd1c8('0x177')][_0xd1c8('0x11e')](db['CmContact'],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x15a')});db['FaxMessage'][_0xd1c8('0x11e')](db['Attachment'],{'as':_0xd1c8('0xed'),'foreignKey':'AttachmentId'});db[_0xd1c8('0x177')]['belongsTo'](db[_0xd1c8('0x4b')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x176')});db[_0xd1c8('0x52')]['belongsToMany'](db['User'],{'as':_0xd1c8('0x150'),'through':'UserFaxQueue'});db[_0xd1c8('0x52')][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x17b'),'as':_0xd1c8('0x151')});db[_0xd1c8('0x54')][_0xd1c8('0x11e')](db['FaxAccount'],{});db[_0xd1c8('0x54')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':'ListId'});db[_0xd1c8('0x54')][_0xd1c8('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x54')]['belongsTo'](db[_0xd1c8('0x4f')],{});db['FaxQueueReport']['belongsTo'](db[_0xd1c8('0x177')],{});db[_0xd1c8('0x54')][_0xd1c8('0x11e')](db['User'],{});db[_0xd1c8('0x54')]['belongsTo'](db[_0xd1c8('0x52')],{});db['SmsAccount'][_0xd1c8('0x115')](db[_0xd1c8('0x83')],{'as':_0xd1c8('0x162'),'foreignKey':'SmsAccountId','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x55')][_0xd1c8('0x115')](db[_0xd1c8('0x81')],{'as':_0xd1c8('0x163'),'foreignKey':'SmsAccountId'});db[_0xd1c8('0x55')]['hasMany'](db[_0xd1c8('0x17c')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xd1c8('0x55')]['hasMany'](db[_0xd1c8('0x59')],{'as':'Interactions'});db[_0xd1c8('0x55')]['hasMany'](db[_0xd1c8('0x57')],{'as':'Applications'});db[_0xd1c8('0x55')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x55')][_0xd1c8('0x11e')](db[_0xd1c8('0x88')],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db[_0xd1c8('0x55')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x13f')});db['SmsApplication'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x57')][_0xd1c8('0x11e')](db['SmsQueue'],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x57')][_0xd1c8('0x11e')](db[_0xd1c8('0x55')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x57')]['belongsTo'](db['Interval'],{'onDelete':_0xd1c8('0x15f'),'foreignKey':_0xd1c8('0x14c')});db['SmsApplication']['belongsTo'](db[_0xd1c8('0x90')],{'onDelete':'restrict','foreignKey':_0xd1c8('0x174')});db['SmsInteraction'][_0xd1c8('0x115')](db[_0xd1c8('0x17c')],{'as':'Messages','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x17d')});db[_0xd1c8('0x59')][_0xd1c8('0x11e')](db[_0xd1c8('0x55')],{'as':_0xd1c8('0x171'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x59')]['belongsTo'](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x59')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x17e'),'as':_0xd1c8('0x16d')});db['SmsInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x17e'),'as':_0xd1c8('0x16e')});db['SmsInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':'Users','through':_0xd1c8('0x12e'),'foreignKey':'SmsInteractionId'});db[_0xd1c8('0x17c')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x111')});db[_0xd1c8('0x17c')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xd1c8('0x15a')});db[_0xd1c8('0x17c')][_0xd1c8('0x11e')](db['SmsInteraction'],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x170'),'foreignKey':'SmsInteractionId'});db[_0xd1c8('0x17c')][_0xd1c8('0x11e')](db[_0xd1c8('0x55')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x17f')});db[_0xd1c8('0x180')]['belongsToMany'](db['User'],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x32'),'foreignKey':_0xd1c8('0x181')});db[_0xd1c8('0x180')][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':'team_has_sms_queues','as':_0xd1c8('0x151')});db[_0xd1c8('0x5d')]['hasMany'](db['Disposition'],{'as':_0xd1c8('0x162'),'foreignKey':_0xd1c8('0x182'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x5d')][_0xd1c8('0x115')](db[_0xd1c8('0x81')],{'as':_0xd1c8('0x163'),'foreignKey':_0xd1c8('0x182')});db[_0xd1c8('0x5d')][_0xd1c8('0x115')](db[_0xd1c8('0x61')],{'as':_0xd1c8('0x164'),'foreignKey':_0xd1c8('0x182')});db[_0xd1c8('0x5d')][_0xd1c8('0x115')](db[_0xd1c8('0x63')],{'as':_0xd1c8('0x155'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xd1c8('0x5f')],{'as':_0xd1c8('0x144'),'foreignKey':_0xd1c8('0x182')});db[_0xd1c8('0x5d')][_0xd1c8('0x11e')](db['CmList'],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x5d')][_0xd1c8('0x11e')](db[_0xd1c8('0x88')],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db[_0xd1c8('0x5d')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':'Agents','through':_0xd1c8('0x13e')});db[_0xd1c8('0x5f')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x5f')][_0xd1c8('0x11e')](db[_0xd1c8('0x65')],{'onDelete':'restrict','foreignKey':_0xd1c8('0x183')});db['OpenchannelApplication'][_0xd1c8('0x11e')](db[_0xd1c8('0x5d')],{'onDelete':_0xd1c8('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0xd1c8('0x5f')]['belongsTo'](db['Interval'],{'onDelete':_0xd1c8('0x15f'),'foreignKey':_0xd1c8('0x14c')});db['OpenchannelApplication']['belongsTo'](db[_0xd1c8('0x90')],{'onDelete':_0xd1c8('0x15f'),'foreignKey':_0xd1c8('0x174')});db['OpenchannelInteraction'][_0xd1c8('0x115')](db[_0xd1c8('0x63')],{'as':_0xd1c8('0x155'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x184')});db['OpenchannelInteraction'][_0xd1c8('0x11e')](db[_0xd1c8('0x5d')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x182')});db[_0xd1c8('0x61')]['belongsTo'](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x61')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x61')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':'openchannel_interaction_has_tags','as':_0xd1c8('0x16d')});db['OpenchannelInteraction']['belongsToMany'](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x185'),'as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db['User'],{'as':_0xd1c8('0x179'),'through':_0xd1c8('0x130'),'foreignKey':'OpenchannelInteractionId'});db[_0xd1c8('0x63')]['belongsTo'](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x111')});db['OpenchannelMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x15a')});db['OpenchannelMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x61')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x170'),'foreignKey':_0xd1c8('0x184')});db['OpenchannelMessage'][_0xd1c8('0x11e')](db['Attachment'],{'as':_0xd1c8('0xed'),'foreignKey':_0xd1c8('0x186')});db[_0xd1c8('0x63')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xd1c8('0x182')});db['OpenchannelQueue'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0xd1c8('0x65')][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x187'),'as':_0xd1c8('0x151')});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db[_0xd1c8('0x83')],{'as':_0xd1c8('0x162'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db[_0xd1c8('0x81')],{'as':_0xd1c8('0x163'),'foreignKey':_0xd1c8('0x172')});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db[_0xd1c8('0x69')],{'as':_0xd1c8('0x164')});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db[_0xd1c8('0x188')],{'as':_0xd1c8('0x144')});db[_0xd1c8('0x136')][_0xd1c8('0x115')](db[_0xd1c8('0x189')],{'as':_0xd1c8('0x155')});db['ChatWebsite'][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':'ListId'});db[_0xd1c8('0x136')][_0xd1c8('0x11e')](db[_0xd1c8('0x87')],{'as':_0xd1c8('0x87'),'foreignKey':'IntervalId'});db[_0xd1c8('0x136')][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'as':_0xd1c8('0x3b'),'foreignKey':'MailAccountId'});db[_0xd1c8('0x136')][_0xd1c8('0x11e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xd1c8('0x136')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':'Agents','through':_0xd1c8('0x138')});db[_0xd1c8('0x18a')][_0xd1c8('0x11e')](db[_0xd1c8('0x5d')],{});db[_0xd1c8('0x18a')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':'List','foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x18a')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd1c8('0x18a')]['belongsTo'](db[_0xd1c8('0x61')],{});db[_0xd1c8('0x18a')][_0xd1c8('0x11e')](db['OpenchannelMessage'],{});db[_0xd1c8('0x18a')]['belongsTo'](db[_0xd1c8('0x111')],{});db[_0xd1c8('0x18a')]['belongsTo'](db['OpenchannelQueue'],{});db['ChatApplication'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x18b'),'foreignKey':_0xd1c8('0x114'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x188')]['belongsTo'](db[_0xd1c8('0x6c')],{'as':_0xd1c8('0x18c'),'foreignKey':_0xd1c8('0x18d'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x188')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x18e'),'foreignKey':_0xd1c8('0x172'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xd1c8('0x90')],{'onDelete':'restrict','foreignKey':_0xd1c8('0x174')});db[_0xd1c8('0x69')][_0xd1c8('0x115')](db['ChatMessage'],{'as':_0xd1c8('0x155'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x18f')});db[_0xd1c8('0x69')][_0xd1c8('0x11e')](db['ChatWebsite'],{'as':_0xd1c8('0x171'),'foreignKey':'ChatWebsiteId'});db[_0xd1c8('0x69')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':'Contact','foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x69')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':_0xd1c8('0x114')});db[_0xd1c8('0x69')][_0xd1c8('0x121')](db['Tag'],{'through':_0xd1c8('0x190'),'as':_0xd1c8('0x16d')});db['ChatInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x190'),'as':_0xd1c8('0x16e')});db['ChatInteraction'][_0xd1c8('0x121')](db['User'],{'as':_0xd1c8('0x179'),'through':_0xd1c8('0x191'),'foreignKey':_0xd1c8('0x18f')});db[_0xd1c8('0x189')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x113'),'as':'User'});db['ChatMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x15a'),'foreignKey':'ContactId'});db[_0xd1c8('0x189')][_0xd1c8('0x11e')](db[_0xd1c8('0x69')],{'onDelete':_0xd1c8('0x113'),'as':'Interaction','foreignKey':_0xd1c8('0x18f')});db[_0xd1c8('0x189')]['belongsTo'](db[_0xd1c8('0xed')],{'as':_0xd1c8('0xed'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x171'),'foreignKey':'ChatWebsiteId'});db[_0xd1c8('0x6a')][_0xd1c8('0x115')](db[_0xd1c8('0xed')],{'as':_0xd1c8('0x16f'),'foreignKey':_0xd1c8('0x173'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x6a')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x172')});db[_0xd1c8('0x6c')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':'Agents','through':_0xd1c8('0x2e'),'hooks':!![]});db[_0xd1c8('0x6c')][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x192'),'as':_0xd1c8('0x151')});db[_0xd1c8('0x6e')][_0xd1c8('0x115')](db['ChatInternalMessage'],{'as':_0xd1c8('0x155'),'foreignKey':_0xd1c8('0x193'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x6e')][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':'Members','through':_0xd1c8('0x123')});db[_0xd1c8('0x70')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'as':_0xd1c8('0x18e'),'foreignKey':_0xd1c8('0x172')});db[_0xd1c8('0x72')][_0xd1c8('0x115')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x124'),'foreignKey':'CompanyId'});db['CmContact'][_0xd1c8('0x115')](db[_0xd1c8('0x194')],{'as':_0xd1c8('0x195'),'foreignKey':'CmContactId'});db[_0xd1c8('0x74')]['hasMany'](db[_0xd1c8('0x147')],{'as':_0xd1c8('0x148'),'foreignKey':'ContactId'});db['CmContact'][_0xd1c8('0x115')](db['CmHopperFinal'],{'as':_0xd1c8('0x196'),'foreignKey':_0xd1c8('0x15b')});db['CmContact'][_0xd1c8('0x115')](db[_0xd1c8('0x7b')],{'as':_0xd1c8('0x197'),'foreignKey':_0xd1c8('0x15b')});db['CmContact'][_0xd1c8('0x115')](db[_0xd1c8('0x7c')],{'as':_0xd1c8('0x7c'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x74')][_0xd1c8('0x115')](db['JscriptySessionReport'],{'as':_0xd1c8('0x198'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x74')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x74')][_0xd1c8('0x115')](db['ChatInteraction'],{'as':_0xd1c8('0x119'),'foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x15f')});db['CmContact'][_0xd1c8('0x115')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x74')][_0xd1c8('0x115')](db[_0xd1c8('0x4f')],{'as':_0xd1c8('0x12b'),'foreignKey':'ContactId','onDelete':_0xd1c8('0x15f')});db['CmContact'][_0xd1c8('0x115')](db[_0xd1c8('0x40')],{'as':_0xd1c8('0x11a'),'foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x15f')});db['CmContact'][_0xd1c8('0x11e')](db[_0xd1c8('0x72')],{'as':_0xd1c8('0x199'),'foreignKey':_0xd1c8('0x19a')});db[_0xd1c8('0x74')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166'),'onDelete':'cascade'});db[_0xd1c8('0x74')][_0xd1c8('0x121')](db['User'],{'as':_0xd1c8('0x179'),'through':_0xd1c8('0x125')});db['CmContact'][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'as':_0xd1c8('0x16d'),'through':_0xd1c8('0x19b')});db[_0xd1c8('0x74')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x19b'),'as':_0xd1c8('0x16e')});db[_0xd1c8('0x147')][_0xd1c8('0x115')](db['CmHopperAdditionalPhone'],{'as':_0xd1c8('0x19c'),'foreignKey':_0xd1c8('0x19d')});db[_0xd1c8('0x147')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x147')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166'),'onDelete':_0xd1c8('0x113')});db['CmHopper']['belongsTo'](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x18b'),'foreignKey':'UserId'});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0xd1c8('0x18c'),'foreignKey':'VoiceQueueId','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x147')]['belongsTo'](db[_0xd1c8('0xe9')],{'as':_0xd1c8('0xe9'),'foreignKey':_0xd1c8('0x19e'),'onDelete':'cascade'});db[_0xd1c8('0x147')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':'OwnerId'});db[_0xd1c8('0x77')]['belongsTo'](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b'),'onDelete':_0xd1c8('0x113')});db['CmHopperBlack'][_0xd1c8('0x11e')](db['CmList'],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x77')]['belongsTo'](db[_0xd1c8('0x1a')],{'as':_0xd1c8('0x18c'),'foreignKey':_0xd1c8('0x146'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0xd1c8('0xe9')],{'as':_0xd1c8('0xe9'),'foreignKey':_0xd1c8('0x19e'),'onDelete':'cascade'});db[_0xd1c8('0x19f')][_0xd1c8('0x115')](db[_0xd1c8('0x85')],{'as':{'plural':_0xd1c8('0x1a0'),'singular':_0xd1c8('0x1a1')},'foreignKey':_0xd1c8('0x1a2'),'onDelete':_0xd1c8('0x113'),'hooks':!![]});db[_0xd1c8('0x19f')][_0xd1c8('0x115')](db[_0xd1c8('0x85')],{'as':{'plural':_0xd1c8('0x1a3'),'singular':_0xd1c8('0x1a4')},'foreignKey':_0xd1c8('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0xd1c8('0x19f')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0xd1c8('0x113'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xd1c8('0x83')],{'as':_0xd1c8('0x162'),'foreignKey':_0xd1c8('0x1a6'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x87')][_0xd1c8('0x115')](db[_0xd1c8('0x87')],{'as':'Intervals','foreignKey':_0xd1c8('0x14c'),'onDelete':_0xd1c8('0x113'),'hooks':!![],'required':![]});db[_0xd1c8('0x87')][_0xd1c8('0x115')](db['VoiceExtension'],{'as':_0xd1c8('0x118'),'foreignKey':_0xd1c8('0x14c'),'onDelete':_0xd1c8('0x15f')});db['Interval'][_0xd1c8('0x115')](db[_0xd1c8('0x44')],{'as':_0xd1c8('0x1a7'),'foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0x87')]['hasMany'](db[_0xd1c8('0x188')],{'as':_0xd1c8('0x1a8'),'foreignKey':_0xd1c8('0x14c')});db['Interval'][_0xd1c8('0x115')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0x87')][_0xd1c8('0x115')](db[_0xd1c8('0x57')],{'as':'SmsApplications','foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0x8d')][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{});db[_0xd1c8('0x8d')][_0xd1c8('0x11e')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xd1c8('0x8d')][_0xd1c8('0x11e')](db[_0xd1c8('0x1a9')],{'foreignKey':_0xd1c8('0x1aa')});db[_0xd1c8('0x8e')]['belongsToMany'](db[_0xd1c8('0x18')],{'as':_0xd1c8('0x1ab'),'through':'moh_has_sounds','onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x90')]['belongsToMany'](db[_0xd1c8('0x74')],{'through':_0xd1c8('0x19b')});db[_0xd1c8('0x90')][_0xd1c8('0x121')](db['ChatInteraction'],{'through':_0xd1c8('0x190')});db[_0xd1c8('0x90')][_0xd1c8('0x121')](db[_0xd1c8('0x40')],{'through':'mail_interaction_has_tags'});db[_0xd1c8('0x90')][_0xd1c8('0x121')](db[_0xd1c8('0x59')],{'through':_0xd1c8('0x17e')});db[_0xd1c8('0x90')]['belongsToMany'](db[_0xd1c8('0x4f')],{'through':_0xd1c8('0x178')});db[_0xd1c8('0x90')][_0xd1c8('0x121')](db[_0xd1c8('0x61')],{'through':_0xd1c8('0x185')});db[_0xd1c8('0x90')][_0xd1c8('0x121')](db['WhatsappInteraction'],{'through':_0xd1c8('0x1ac')});db['CmContactHasItem'][_0xd1c8('0x11e')](db['ContactItemType'],{'as':_0xd1c8('0x1ad'),'foreignKey':_0xd1c8('0x1ae')});db[_0xd1c8('0x94')]['belongsTo'](db[_0xd1c8('0x147')],{'as':_0xd1c8('0x1af'),'foreignKey':_0xd1c8('0x19d')});db[_0xd1c8('0x194')][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x1b0')});db[_0xd1c8('0x98')][_0xd1c8('0x115')](db['Condition'],{'as':{'plural':_0xd1c8('0x1b1'),'singular':_0xd1c8('0x1b2')},'foreignKey':_0xd1c8('0x1b3'),'onDelete':_0xd1c8('0x113'),'hooks':!![]});db['Trigger'][_0xd1c8('0x115')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xd1c8('0x1b4'),'onDelete':_0xd1c8('0x113'),'hooks':!![]});db[_0xd1c8('0x98')][_0xd1c8('0x115')](db[_0xd1c8('0x7f')],{'as':_0xd1c8('0x1b5'),'foreignKey':_0xd1c8('0x1b6'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0xd1c8('0x115')](db[_0xd1c8('0x1b7')],{'as':_0xd1c8('0x1b8'),'onDelete':_0xd1c8('0x113'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xd1c8('0xa0')]['hasMany'](db[_0xd1c8('0x1b7')],{'as':_0xd1c8('0x1b8'),'onDelete':_0xd1c8('0x113'),'foreignKey':'DefaultReportId'});db[_0xd1c8('0xa4')]['hasMany'](db[_0xd1c8('0x1b7')],{'as':_0xd1c8('0x1b8'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1b9')});db[_0xd1c8('0x1b7')][_0xd1c8('0x11e')](db[_0xd1c8('0xa4')],{'foreignKey':_0xd1c8('0x1b9')});db[_0xd1c8('0xa6')][_0xd1c8('0x115')](db['SalesforceConfiguration'],{'as':_0xd1c8('0x1ba'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0x1bc')][_0xd1c8('0x115')](db[_0xd1c8('0x1bd')],{'as':'Subjects','onDelete':_0xd1c8('0x113'),'foreignKey':'SubjectId'});db[_0xd1c8('0x1bc')][_0xd1c8('0x115')](db[_0xd1c8('0x1bd')],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0x1bc')]['hasMany'](db[_0xd1c8('0x1bd')],{'as':'Fields','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1c0')});db['SalesforceConfiguration']['belongsTo'](db[_0xd1c8('0xa6')],{'as':_0xd1c8('0x171'),'foreignKey':'AccountId'});db[_0xd1c8('0x1bd')][_0xd1c8('0x115')](db[_0xd1c8('0x1bd')],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db['SalesforceField'][_0xd1c8('0x115')](db[_0xd1c8('0x1bd')],{'as':'Description','foreignKey':_0xd1c8('0x1bf')});db['SalesforceField'][_0xd1c8('0x115')](db[_0xd1c8('0x1bd')],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0x1bd')][_0xd1c8('0x11e')](db[_0xd1c8('0x9a')],{'as':_0xd1c8('0x9a'),'foreignKey':'VariableId'});db[_0xd1c8('0xa9')][_0xd1c8('0x115')](db[_0xd1c8('0xab')],{'as':_0xd1c8('0x1ba'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xab')][_0xd1c8('0x115')](db[_0xd1c8('0xad')],{'as':_0xd1c8('0x1c4'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xab')][_0xd1c8('0x115')](db['SugarcrmField'],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xab')][_0xd1c8('0x115')](db[_0xd1c8('0xad')],{'as':_0xd1c8('0x1b8'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration']['belongsTo'](db[_0xd1c8('0xa9')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xad')][_0xd1c8('0x115')](db['SugarcrmField'],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xad')][_0xd1c8('0x115')](db[_0xd1c8('0xad')],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db['SugarcrmField'][_0xd1c8('0x115')](db[_0xd1c8('0xad')],{'as':'Field','foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xad')][_0xd1c8('0x11e')](db[_0xd1c8('0x9a')],{'as':_0xd1c8('0x9a'),'foreignKey':'VariableId'});db[_0xd1c8('0xaf')]['hasMany'](db[_0xd1c8('0xb1')],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xb1')][_0xd1c8('0x115')](db[_0xd1c8('0x1c6')],{'as':_0xd1c8('0x1c4'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1c2')});db['DeskConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0x1c6')],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bf')});db['DeskConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0x1c6')],{'as':'Fields','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xb1')][_0xd1c8('0x11e')](db[_0xd1c8('0xaf')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xb1')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':'int_desk_configuration_has_tags'});db[_0xd1c8('0x1c6')][_0xd1c8('0x115')](db[_0xd1c8('0x1c6')],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0x1c6')][_0xd1c8('0x115')](db['DeskField'],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0x1c6')][_0xd1c8('0x115')](db[_0xd1c8('0x1c6')],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0x1c6')][_0xd1c8('0x11e')](db['Variable'],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0xb3')][_0xd1c8('0x115')](db[_0xd1c8('0x1c8')],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0x1c8')][_0xd1c8('0x115')](db['ZohoField'],{'as':'Subjects','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0x1c8')][_0xd1c8('0x115')](db[_0xd1c8('0xb6')],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bf')});db['ZohoConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0xb6')],{'as':'Fields','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1c0')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xb6')][_0xd1c8('0x115')](db['ZohoField'],{'as':'Subject','foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xb6')][_0xd1c8('0x115')](db[_0xd1c8('0xb6')],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xb6')][_0xd1c8('0x115')](db[_0xd1c8('0xb6')],{'as':_0xd1c8('0x1c3'),'foreignKey':'FieldId'});db[_0xd1c8('0xb6')][_0xd1c8('0x11e')](db[_0xd1c8('0x9a')],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0x1c9')][_0xd1c8('0x115')](db[_0xd1c8('0xb9')],{'as':_0xd1c8('0x1ba'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xb9')][_0xd1c8('0x115')](db[_0xd1c8('0xba')],{'as':_0xd1c8('0x1c4'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xb9')][_0xd1c8('0x115')](db[_0xd1c8('0xba')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd1c8('0xb9')]['hasMany'](db[_0xd1c8('0xba')],{'as':_0xd1c8('0x1b8'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xb9')]['belongsTo'](db[_0xd1c8('0x1c9')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1bb')});db['ZendeskConfiguration'][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x1ca')});db[_0xd1c8('0xba')]['hasMany'](db[_0xd1c8('0xba')],{'as':_0xd1c8('0x1c1'),'foreignKey':'SubjectId'});db['ZendeskField']['hasMany'](db[_0xd1c8('0xba')],{'as':_0xd1c8('0x1c5'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0xd1c8('0x115')](db[_0xd1c8('0xba')],{'as':_0xd1c8('0x1c3'),'foreignKey':'FieldId'});db[_0xd1c8('0xba')][_0xd1c8('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0x1cb')][_0xd1c8('0x115')](db['FreshdeskConfiguration'],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db['FreshdeskConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0xbd')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0xbd')],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xbb')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xd1c8('0x113'),'foreignKey':'FieldId'});db[_0xd1c8('0xbb')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xbb')][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x1cc')});db[_0xd1c8('0xbd')][_0xd1c8('0x115')](db[_0xd1c8('0xbd')],{'as':_0xd1c8('0x1c1'),'foreignKey':'SubjectId'});db[_0xd1c8('0xbd')][_0xd1c8('0x115')](db[_0xd1c8('0xbd')],{'as':'Description','foreignKey':_0xd1c8('0x1bf')});db['FreshdeskField'][_0xd1c8('0x115')](db['FreshdeskField'],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xbd')]['belongsTo'](db['Variable'],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0xbf')][_0xd1c8('0x115')](db[_0xd1c8('0x1cd')],{'as':'Configurations','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0x1cd')][_0xd1c8('0x115')](db[_0xd1c8('0xc2')],{'as':_0xd1c8('0x1c4'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0x1cd')][_0xd1c8('0x115')](db[_0xd1c8('0xc2')],{'as':_0xd1c8('0x1be'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0x1cd')][_0xd1c8('0x115')](db[_0xd1c8('0xc2')],{'as':_0xd1c8('0x1b8'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0x1cd')]['belongsTo'](db[_0xd1c8('0xbf')],{'as':'Account','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xc2')][_0xd1c8('0x115')](db[_0xd1c8('0xc2')],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xc2')][_0xd1c8('0x115')](db[_0xd1c8('0xc2')],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xc2')][_0xd1c8('0x11e')](db['Variable'],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0x1ce')][_0xd1c8('0x115')](db['ServicenowConfiguration'],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xc5')][_0xd1c8('0x115')](db[_0xd1c8('0xc7')],{'as':'Subjects','foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xc5')][_0xd1c8('0x115')](db[_0xd1c8('0xc7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd1c8('0xc5')][_0xd1c8('0x115')](db[_0xd1c8('0xc7')],{'as':_0xd1c8('0x1b8'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xc5')][_0xd1c8('0x11e')](db['ServicenowAccount'],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xc7')][_0xd1c8('0x115')](db[_0xd1c8('0xc7')],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xc7')]['hasMany'](db[_0xd1c8('0xc7')],{'as':'Description','foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xc7')]['hasMany'](db['ServicenowField'],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xc7')][_0xd1c8('0x11e')](db[_0xd1c8('0x9a')],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db[_0xd1c8('0xc8')]['hasMany'](db[_0xd1c8('0x1cf')],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':'AccountId'});db[_0xd1c8('0xc8')][_0xd1c8('0x11e')](db[_0xd1c8('0x15d')],{'as':_0xd1c8('0x15d'),'foreignKey':_0xd1c8('0x15e')});db[_0xd1c8('0x1cf')][_0xd1c8('0x115')](db[_0xd1c8('0xcb')],{'as':_0xd1c8('0x1c4'),'onDelete':'cascade','foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0x1cf')]['hasMany'](db['Dynamics365Field'],{'as':_0xd1c8('0x1be'),'onDelete':_0xd1c8('0x113'),'foreignKey':'DescriptionId'});db[_0xd1c8('0x1cf')][_0xd1c8('0x115')](db[_0xd1c8('0xcb')],{'as':_0xd1c8('0x1b8'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xd1c8('0x1cf')][_0xd1c8('0x11e')](db[_0xd1c8('0xc8')],{'as':'Account','foreignKey':_0xd1c8('0x1bb')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xd1c8('0x1c2')});db[_0xd1c8('0xcb')][_0xd1c8('0x115')](db['Dynamics365Field'],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xcb')][_0xd1c8('0x115')](db[_0xd1c8('0xcb')],{'as':_0xd1c8('0x1c3'),'foreignKey':_0xd1c8('0x1c0')});db[_0xd1c8('0xcb')][_0xd1c8('0x11e')](db[_0xd1c8('0x9a')],{'as':_0xd1c8('0x9a'),'foreignKey':_0xd1c8('0x1c7')});db['FreshsalesAccount']['hasMany'](db[_0xd1c8('0xce')],{'as':_0xd1c8('0x1ba'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xce')][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':'Subjects','foreignKey':_0xd1c8('0x1c2')});db['FreshsalesConfiguration'][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':_0xd1c8('0x1be'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xce')][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':_0xd1c8('0x1b8'),'foreignKey':'FieldId'});db[_0xd1c8('0xce')][_0xd1c8('0x11e')](db[_0xd1c8('0xcc')],{'as':'Account','foreignKey':_0xd1c8('0x1bb')});db[_0xd1c8('0xd0')][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':_0xd1c8('0x1c1'),'foreignKey':_0xd1c8('0x1c2')});db['FreshsalesField'][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':_0xd1c8('0x1c5'),'foreignKey':_0xd1c8('0x1bf')});db[_0xd1c8('0xd0')][_0xd1c8('0x115')](db[_0xd1c8('0xd0')],{'as':_0xd1c8('0x1c3'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xd1c8('0x11e')](db['Variable'],{'as':_0xd1c8('0x9a'),'foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db[_0xd1c8('0x136')],{});db[_0xd1c8('0xd5')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db['ChatQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0xd5')]['belongsTo'](db[_0xd1c8('0x69')],{});db[_0xd1c8('0xd5')]['belongsTo'](db[_0xd1c8('0x189')],{});db[_0xd1c8('0xd5')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{});db[_0xd1c8('0xd5')][_0xd1c8('0x11e')](db[_0xd1c8('0x6c')],{});db[_0xd1c8('0x1d0')][_0xd1c8('0x11e')](db['User'],{'onDelete':_0xd1c8('0x113'),'foreignKey':'FromId'});db[_0xd1c8('0x1d0')]['belongsTo'](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x113'),'foreignKey':'ToId'});db[_0xd1c8('0x14a')][_0xd1c8('0x115')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x14a')]['hasMany'](db[_0xd1c8('0xd7')],{'foreignKey':'SessionId','onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x1d1')]['belongsTo'](db[_0xd1c8('0x55')],{});db[_0xd1c8('0x1d1')][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x165'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':'Contact','foreignKey':_0xd1c8('0x15b')});db[_0xd1c8('0x1d1')][_0xd1c8('0x11e')](db[_0xd1c8('0x59')],{});db[_0xd1c8('0x1d1')][_0xd1c8('0x11e')](db[_0xd1c8('0x17c')],{});db['SmsQueueReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{});db[_0xd1c8('0x1d1')][_0xd1c8('0x11e')](db[_0xd1c8('0x180')],{});db['JscriptyProject'][_0xd1c8('0x115')](db[_0xd1c8('0x14a')],{'foreignKey':_0xd1c8('0x1d2')});db[_0xd1c8('0xde')][_0xd1c8('0x115')](db[_0xd1c8('0x1d3')],{'foreignKey':_0xd1c8('0x1d2')});db[_0xd1c8('0xde')][_0xd1c8('0x115')](db[_0xd1c8('0xd7')],{'foreignKey':_0xd1c8('0x1d2')});db['Team'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x129')});db[_0xd1c8('0xe5')][_0xd1c8('0x121')](db[_0xd1c8('0x1a')],{'through':_0xd1c8('0x1d4'),'as':_0xd1c8('0x1d5')});db[_0xd1c8('0xe5')][_0xd1c8('0x121')](db['MailQueue'],{'through':_0xd1c8('0x169'),'as':_0xd1c8('0x1d6')});db['Team'][_0xd1c8('0x121')](db[_0xd1c8('0x6c')],{'through':'team_has_chat_queues','as':_0xd1c8('0x1d7')});db[_0xd1c8('0xe5')][_0xd1c8('0x121')](db[_0xd1c8('0x52')],{'through':_0xd1c8('0x17b'),'as':_0xd1c8('0x132')});db[_0xd1c8('0xe5')]['belongsToMany'](db[_0xd1c8('0x180')],{'through':_0xd1c8('0x1d8'),'as':_0xd1c8('0x133')});db[_0xd1c8('0xe5')]['belongsToMany'](db[_0xd1c8('0x65')],{'through':_0xd1c8('0x187'),'as':_0xd1c8('0x134')});db[_0xd1c8('0xe5')][_0xd1c8('0x121')](db[_0xd1c8('0x10b')],{'through':_0xd1c8('0x1d9'),'as':_0xd1c8('0x135')});db[_0xd1c8('0xe5')][_0xd1c8('0x121')](db[_0xd1c8('0xfb')],{'through':_0xd1c8('0x1da'),'as':'VoicePrefixes'});db['Campaign'][_0xd1c8('0x115')](db[_0xd1c8('0x147')],{'as':_0xd1c8('0x148'),'foreignKey':'CampaignId'});db[_0xd1c8('0xe9')]['hasMany'](db[_0xd1c8('0x79')],{'as':_0xd1c8('0x196'),'foreignKey':_0xd1c8('0x19e')});db['Campaign'][_0xd1c8('0x115')](db[_0xd1c8('0x7b')],{'as':_0xd1c8('0x197'),'foreignKey':_0xd1c8('0x19e')});db['Campaign'][_0xd1c8('0x115')](db[_0xd1c8('0x77')],{'as':_0xd1c8('0x149'),'foreignKey':_0xd1c8('0x19e')});db[_0xd1c8('0xe9')][_0xd1c8('0x11e')](db[_0xd1c8('0x29')],{'as':_0xd1c8('0x29'),'foreignKey':_0xd1c8('0x1db')});db[_0xd1c8('0xe9')][_0xd1c8('0x11e')](db[_0xd1c8('0x29')],{'as':_0xd1c8('0x14b'),'foreignKey':_0xd1c8('0x1dc')});db[_0xd1c8('0xe9')][_0xd1c8('0x11e')](db[_0xd1c8('0x87')],{'as':'Interval','foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0xe9')]['belongsTo'](db[_0xd1c8('0xe3')],{'as':'SquareProject','foreignKey':_0xd1c8('0x1dd')});db['Campaign']['belongsToMany'](db[_0xd1c8('0x126')],{'as':_0xd1c8('0x127'),'through':'campaigns_has_cm_lists'});db[_0xd1c8('0xe9')]['belongsToMany'](db[_0xd1c8('0x126')],{'as':'BlackLists','through':_0xd1c8('0x1de')});db[_0xd1c8('0xed')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xd1c8('0x6a'),'foreignKey':_0xd1c8('0x173')});db[_0xd1c8('0xf1')][_0xd1c8('0x11e')](db['MailMessage'],{});db[_0xd1c8('0xf1')][_0xd1c8('0x11e')](db[_0xd1c8('0x40')],{});db['MailTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x3b')],{'foreignKey':_0xd1c8('0x1df'),'as':_0xd1c8('0x1e0')});db[_0xd1c8('0xf1')]['belongsTo'](db[_0xd1c8('0x111')],{'foreignKey':_0xd1c8('0x1e1'),'as':_0xd1c8('0x1e2')});db['MailTransferReport'][_0xd1c8('0x11e')](db['User'],{'foreignKey':_0xd1c8('0x1e3'),'as':'ToAgent'});db[_0xd1c8('0xf1')][_0xd1c8('0x11e')](db['MailQueue'],{'foreignKey':_0xd1c8('0x1e4'),'as':_0xd1c8('0x1e5')});db[_0xd1c8('0xf1')][_0xd1c8('0x11e')](db['MailAccount'],{'foreignKey':_0xd1c8('0x1e6'),'as':'ToAccount'});db['ChatTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x189')],{});db['ChatTransferReport'][_0xd1c8('0x11e')](db['ChatInteraction'],{});db[_0xd1c8('0x1e7')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'foreignKey':_0xd1c8('0x1e8'),'as':_0xd1c8('0x1e0')});db['ChatTransferReport'][_0xd1c8('0x11e')](db['User'],{'foreignKey':_0xd1c8('0x1e1'),'as':'FromAgent'});db[_0xd1c8('0x1e7')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd1c8('0x1e7')][_0xd1c8('0x11e')](db[_0xd1c8('0x6c')],{'foreignKey':'ToChatQueueId','as':_0xd1c8('0x1e5')});db[_0xd1c8('0x1e7')][_0xd1c8('0x11e')](db[_0xd1c8('0x136')],{'foreignKey':_0xd1c8('0x1e9'),'as':_0xd1c8('0x1ea')});db[_0xd1c8('0xf4')][_0xd1c8('0x11e')](db['FaxMessage'],{});db[_0xd1c8('0xf4')][_0xd1c8('0x11e')](db[_0xd1c8('0x4f')],{});db[_0xd1c8('0xf4')][_0xd1c8('0x11e')](db[_0xd1c8('0x4b')],{'foreignKey':_0xd1c8('0x1eb'),'as':_0xd1c8('0x1e0')});db['FaxTransferReport']['belongsTo'](db[_0xd1c8('0x111')],{'foreignKey':'FromUserId','as':_0xd1c8('0x1e2')});db[_0xd1c8('0xf4')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'foreignKey':_0xd1c8('0x1e3'),'as':'ToAgent'});db[_0xd1c8('0xf4')]['belongsTo'](db[_0xd1c8('0x52')],{'foreignKey':_0xd1c8('0x1ec'),'as':_0xd1c8('0x1e5')});db[_0xd1c8('0xf4')][_0xd1c8('0x11e')](db[_0xd1c8('0x4b')],{'foreignKey':'ToFaxAccountId','as':_0xd1c8('0x1ea')});db[_0xd1c8('0xf6')][_0xd1c8('0x11e')](db[_0xd1c8('0x63')],{});db[_0xd1c8('0xf6')]['belongsTo'](db[_0xd1c8('0x61')],{});db[_0xd1c8('0xf6')]['belongsTo'](db[_0xd1c8('0x5d')],{'foreignKey':_0xd1c8('0x1ed'),'as':_0xd1c8('0x1e0')});db[_0xd1c8('0xf6')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'foreignKey':_0xd1c8('0x1e1'),'as':_0xd1c8('0x1e2')});db[_0xd1c8('0xf6')][_0xd1c8('0x11e')](db['User'],{'foreignKey':_0xd1c8('0x1e3'),'as':_0xd1c8('0x1ee')});db[_0xd1c8('0xf6')][_0xd1c8('0x11e')](db['OpenchannelQueue'],{'foreignKey':_0xd1c8('0x1ef'),'as':_0xd1c8('0x1e5')});db[_0xd1c8('0xf6')][_0xd1c8('0x11e')](db['OpenchannelAccount'],{'foreignKey':_0xd1c8('0x1f0'),'as':_0xd1c8('0x1ea')});db['SmsTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x17c')],{});db[_0xd1c8('0xf8')][_0xd1c8('0x11e')](db['SmsInteraction'],{});db[_0xd1c8('0xf8')]['belongsTo'](db[_0xd1c8('0x55')],{'foreignKey':_0xd1c8('0x1f1'),'as':_0xd1c8('0x1e0')});db['SmsTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'foreignKey':'FromUserId','as':_0xd1c8('0x1e2')});db[_0xd1c8('0xf8')][_0xd1c8('0x11e')](db['User'],{'foreignKey':_0xd1c8('0x1e3'),'as':_0xd1c8('0x1ee')});db[_0xd1c8('0xf8')][_0xd1c8('0x11e')](db[_0xd1c8('0x180')],{'foreignKey':_0xd1c8('0x1f2'),'as':_0xd1c8('0x1e5')});db[_0xd1c8('0xf8')]['belongsTo'](db[_0xd1c8('0x55')],{'foreignKey':_0xd1c8('0x1f3'),'as':_0xd1c8('0x1ea')});db[_0xd1c8('0x126')][_0xd1c8('0x115')](db['Disposition'],{'as':_0xd1c8('0x162'),'foreignKey':_0xd1c8('0x166'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x126')][_0xd1c8('0x115')](db[_0xd1c8('0x1f4')],{'as':_0xd1c8('0x1f5'),'foreignKey':'ListId'});db[_0xd1c8('0x126')][_0xd1c8('0x115')](db[_0xd1c8('0x74')],{'as':'Contacts','onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x126')][_0xd1c8('0x115')](db[_0xd1c8('0x79')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0xd1c8('0x126')][_0xd1c8('0x115')](db[_0xd1c8('0x7b')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xd1c8('0x126')]['hasMany'](db[_0xd1c8('0x7c')],{'as':_0xd1c8('0x7c'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x126')]['belongsToMany'](db['VoiceQueue'],{'as':_0xd1c8('0x1f6'),'through':_0xd1c8('0x14f')});db[_0xd1c8('0x126')]['belongsToMany'](db['User'],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x128')});db['VoicePrefix']['hasMany'](db[_0xd1c8('0x16')],{'as':_0xd1c8('0x118'),'onDelete':'cascade'});db['VoicePrefix'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x150'),'through':_0xd1c8('0x1f7')});db['VoicePrefix'][_0xd1c8('0x121')](db[_0xd1c8('0xe5')],{'through':_0xd1c8('0x1da'),'as':_0xd1c8('0x151')});db['UserProfile'][_0xd1c8('0x115')](db[_0xd1c8('0x111')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile'][_0xd1c8('0x115')](db[_0xd1c8('0xfe')],{'as':_0xd1c8('0x1f8'),'foreignKey':_0xd1c8('0x120'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0xfe')][_0xd1c8('0x115')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xd1c8('0x1f9'),'onDelete':'cascade'});db[_0xd1c8('0x103')][_0xd1c8('0x115')](db['Disposition'],{'as':_0xd1c8('0x162'),'foreignKey':_0xd1c8('0x1fa'),'onDelete':_0xd1c8('0x113')});db[_0xd1c8('0x103')][_0xd1c8('0x115')](db[_0xd1c8('0x81')],{'as':_0xd1c8('0x163'),'foreignKey':_0xd1c8('0x1fa')});db[_0xd1c8('0x103')][_0xd1c8('0x115')](db[_0xd1c8('0x106')],{'as':_0xd1c8('0x155'),'foreignKey':_0xd1c8('0x1fa')});db[_0xd1c8('0x103')][_0xd1c8('0x115')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0xd1c8('0x103')]['hasMany'](db[_0xd1c8('0x1fb')],{'as':'Applications'});db['WhatsappAccount'][_0xd1c8('0x11e')](db[_0xd1c8('0x126')],{'as':'List','foreignKey':_0xd1c8('0x166')});db['WhatsappAccount'][_0xd1c8('0x11e')](db['Pause'],{'as':_0xd1c8('0x14d'),'foreignKey':_0xd1c8('0x14e')});db['WhatsappAccount'][_0xd1c8('0x121')](db['User'],{'as':_0xd1c8('0x150'),'through':'user_has_whatsapp_accounts'});db[_0xd1c8('0x1fb')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'onDelete':_0xd1c8('0x15f')});db['WhatsappApplication'][_0xd1c8('0x11e')](db[_0xd1c8('0x10b')],{'onDelete':_0xd1c8('0x15f')});db[_0xd1c8('0x1fb')]['belongsTo'](db[_0xd1c8('0x103')],{'onDelete':_0xd1c8('0x15f')});db['WhatsappApplication'][_0xd1c8('0x11e')](db['Interval'],{'onDelete':_0xd1c8('0x15f'),'foreignKey':_0xd1c8('0x14c')});db[_0xd1c8('0x1fb')][_0xd1c8('0x11e')](db['Tag'],{'onDelete':_0xd1c8('0x15f'),'foreignKey':'TagId'});db[_0xd1c8('0x11b')][_0xd1c8('0x115')](db[_0xd1c8('0x106')],{'as':_0xd1c8('0x155'),'onDelete':_0xd1c8('0x113'),'foreignKey':_0xd1c8('0x1fc')});db[_0xd1c8('0x11b')]['belongsTo'](db[_0xd1c8('0x103')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1fa')});db['WhatsappInteraction'][_0xd1c8('0x11e')](db[_0xd1c8('0x74')],{'as':_0xd1c8('0x15a'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x16b'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x90')],{'through':_0xd1c8('0x1ac'),'as':_0xd1c8('0x16d')});db['WhatsappInteraction']['belongsToMany'](db[_0xd1c8('0x90')],{'through':'whatsapp_interaction_has_tags','as':_0xd1c8('0x16e')});db['WhatsappInteraction'][_0xd1c8('0x121')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x179'),'through':_0xd1c8('0x131'),'foreignKey':_0xd1c8('0x1fc')});db[_0xd1c8('0x106')]['belongsTo'](db['User'],{'as':_0xd1c8('0x111')});db[_0xd1c8('0x106')]['belongsTo'](db[_0xd1c8('0x74')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x15a')});db['WhatsappMessage'][_0xd1c8('0x11e')](db[_0xd1c8('0x11b')],{'onDelete':_0xd1c8('0x113'),'as':_0xd1c8('0x170'),'foreignKey':_0xd1c8('0x1fc')});db[_0xd1c8('0x106')][_0xd1c8('0x11e')](db[_0xd1c8('0x103')],{'as':_0xd1c8('0x171'),'foreignKey':_0xd1c8('0x1fa')});db['WhatsappQueueReport']['belongsTo'](db[_0xd1c8('0x103')],{});db[_0xd1c8('0x107')][_0xd1c8('0x11e')](db['CmList'],{'as':_0xd1c8('0x165'),'foreignKey':_0xd1c8('0x166')});db[_0xd1c8('0x107')][_0xd1c8('0x11e')](db['CmContact'],{'as':_0xd1c8('0x15a'),'foreignKey':'ContactId'});db[_0xd1c8('0x107')][_0xd1c8('0x11e')](db['WhatsappInteraction'],{});db[_0xd1c8('0x107')]['belongsTo'](db[_0xd1c8('0x10b')],{});db[_0xd1c8('0x107')][_0xd1c8('0x11e')](db[_0xd1c8('0x106')],{});db[_0xd1c8('0x107')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{});db[_0xd1c8('0x109')][_0xd1c8('0x11e')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x11b')],{});db[_0xd1c8('0x109')][_0xd1c8('0x11e')](db[_0xd1c8('0x103')],{'foreignKey':_0xd1c8('0x1fd'),'as':_0xd1c8('0x1e0')});db['WhatsappTransferReport'][_0xd1c8('0x11e')](db[_0xd1c8('0x103')],{'foreignKey':_0xd1c8('0x1fe'),'as':_0xd1c8('0x1ea')});db[_0xd1c8('0x109')][_0xd1c8('0x11e')](db[_0xd1c8('0x10b')],{'foreignKey':_0xd1c8('0x1ff'),'as':_0xd1c8('0x1e5')});db[_0xd1c8('0x109')][_0xd1c8('0x11e')](db['User'],{'foreignKey':'FromUserId','as':_0xd1c8('0x1e2')});db['WhatsappTransferReport']['belongsTo'](db[_0xd1c8('0x111')],{'foreignKey':_0xd1c8('0x1e3'),'as':_0xd1c8('0x1ee')});db[_0xd1c8('0x10b')][_0xd1c8('0x121')](db['User'],{'as':_0xd1c8('0x150'),'through':'UserWhatsappQueue','foreignKey':_0xd1c8('0x200')});db[_0xd1c8('0x10b')][_0xd1c8('0x121')](db['Team'],{'through':_0xd1c8('0x1d9'),'as':'Teams'});db[_0xd1c8('0x10f')][_0xd1c8('0x11e')](db[_0xd1c8('0x111')],{'as':_0xd1c8('0x201'),'foreignKey':_0xd1c8('0x114'),'onDelete':'cascade','hooks':!![]});db[_0xd1c8('0x15d')][_0xd1c8('0x112')](db[_0xd1c8('0xc8')],{'as':_0xd1c8('0xc8'),'onDelete':'restrict'});db[_0xd1c8('0x15d')][_0xd1c8('0x112')](db['MailServerIn'],{'as':_0xd1c8('0x160'),'onDelete':_0xd1c8('0x15f')});db['CloudProvider'][_0xd1c8('0x112')](db[_0xd1c8('0x39')],{'as':_0xd1c8('0x161'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xf02b=['Sound','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','../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','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappAccount','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/user-setting/user-setting.model','cascade','UserId','UserSetting','userSetting','VoiceRecording','Recordings','hasMany','VoiceQueuesRt','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','FaxAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','VoiceQueueId','Hoppers','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Agents','Teams','BlackLists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','hasOne','Imap','Smtp','Answers','Interactions','List','ListId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Contact','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','ChatOfflineMessageId','TagId','Dispositions','FaxAccountId','FaxApplication','Exntensions','user_has_fax_accounts','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','FaxQueue','UserFaxQueue','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Interaction','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','Phones','CmContactId','JscriptySessions','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','CampaignId','All','AutomationAllId','Any','AutomationAnyId','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','Hopper','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','Descriptions','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','Configurations','Subjects','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','VtigerField','ServicenowAccount','ServicenowConfiguration','FreshsalesConfiguration','FreshsalesField','FreshsalesAccount','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','user_has_teams','MailQueues','team_has_chat_queues','team_has_whatsapp_queues','TeamVoicePrefix','HopperHistories','SquareProject','Lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','Extensions','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','../api/schedule/schedule.model'];(function(_0x41466c,_0x470a23){var _0x2903f7=function(_0x25d04d){while(--_0x25d04d){_0x41466c['push'](_0x41466c['shift']());}};_0x2903f7(++_0x470a23);}(_0xf02b,0x16e));var _0xbf02=function(_0x1649fe,_0x5916da){_0x1649fe=_0x1649fe-0x0;var _0x473a67=_0xf02b[_0x1649fe];return _0x473a67;};'use strict';var config=require(_0xbf02('0x0'));var Sequelize=require(_0xbf02('0x1'));var _=require(_0xbf02('0x2'));var jstz=require(_0xbf02('0x3'));var timezone=jstz['determine']();config[_0xbf02('0x1')]=_[_0xbf02('0x4')](config[_0xbf02('0x1')],{'database':_0xbf02('0x5'),'username':_0xbf02('0x6'),'password':_0xbf02('0x7'),'options':{'host':_0xbf02('0x8'),'port':0xcea,'dialect':_0xbf02('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xbf02('0xa')](),'define':{'charset':_0xbf02('0xb'),'collate':_0xbf02('0xc')}}});config[_0xbf02('0xd')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xbf02('0x5'),'username':'xcall','password':_0xbf02('0x7'),'options':{'host':_0xbf02('0x8'),'port':0xcea,'dialect':_0xbf02('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xbf02('0xb'),'collate':_0xbf02('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbf02('0x1')][_0xbf02('0xe')],config[_0xbf02('0x1')][_0xbf02('0xf')],config[_0xbf02('0x1')]['password'],config[_0xbf02('0x1')][_0xbf02('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbf02('0xd')]['database'],config[_0xbf02('0xd')][_0xbf02('0xf')],config['sequelizeHistory'][_0xbf02('0x11')],config[_0xbf02('0xd')][_0xbf02('0x10')])};db[_0xbf02('0x12')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x14'));db[_0xbf02('0x15')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x16'));db['VoiceContext']=db['sequelize']['import'](_0xbf02('0x17'));db[_0xbf02('0x18')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x19'));db[_0xbf02('0x1a')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x1b'));db[_0xbf02('0x1c')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x1d'));db['VoiceRecording']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x1e'));db[_0xbf02('0x1f')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x20'));db[_0xbf02('0x21')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x22'));db[_0xbf02('0x23')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x24'));db[_0xbf02('0x25')]=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xbf02('0x26')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x27'));db['VoiceAgentReport']=db[_0xbf02('0x1')]['import'](_0xbf02('0x28'));db[_0xbf02('0x29')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x2a'));db['MemberReport']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x2b'));db[_0xbf02('0x2c')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x2d'));db[_0xbf02('0x2e')]=db[_0xbf02('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xbf02('0x2f')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x30'));db[_0xbf02('0x31')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x32'));db[_0xbf02('0x33')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x34'));db[_0xbf02('0x35')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x36'));db['UserFaxQueue']=db[_0xbf02('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xbf02('0x37')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x38'));db[_0xbf02('0x39')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x3a'));db['UserWhatsappQueue']=db[_0xbf02('0x1')]['import'](_0xbf02('0x3b'));db[_0xbf02('0x3c')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x3d'));db[_0xbf02('0x3e')]=db['sequelize'][_0xbf02('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0xbf02('0x3f')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x40'));db[_0xbf02('0x41')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x42'));db[_0xbf02('0x43')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x44'));db[_0xbf02('0x45')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x46'));db[_0xbf02('0x47')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x48'));db[_0xbf02('0x49')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x4a'));db[_0xbf02('0x4b')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x4c'));db[_0xbf02('0x4d')]=db['sequelize']['import'](_0xbf02('0x4e'));db[_0xbf02('0x4f')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x50'));db[_0xbf02('0x51')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x52'));db['FaxApplication']=db['sequelize'][_0xbf02('0x13')]('../api/faxApplication/faxApplication.model');db[_0xbf02('0x53')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x54'));db[_0xbf02('0x55')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x56'));db['FaxQueue']=db[_0xbf02('0x1')]['import'](_0xbf02('0x57'));db['FaxQueueReport']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x58'));db[_0xbf02('0x59')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/smsAccount/smsAccount.model');db[_0xbf02('0x5a')]=db['sequelize']['import'](_0xbf02('0x5b'));db['SmsInteraction']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xbf02('0x1')]['import'](_0xbf02('0x5c'));db[_0xbf02('0x5d')]=db[_0xbf02('0x1')]['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x5e'));db[_0xbf02('0x5f')]=db['sequelize'][_0xbf02('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0xbf02('0x60')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x61'));db[_0xbf02('0x62')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x63'));db[_0xbf02('0x64')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x65'));db[_0xbf02('0x66')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0xbf02('0x67')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x68'));db[_0xbf02('0x69')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x6a'));db[_0xbf02('0x6b')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x6c'));db[_0xbf02('0x6d')]=db[_0xbf02('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0xbf02('0x6e')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x6f'));db['ChatQueue']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x70'));db[_0xbf02('0x71')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x72'));db['ChatProactiveAction']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x73'));db[_0xbf02('0x74')]=db[_0xbf02('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0xbf02('0x75')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x76'));db[_0xbf02('0x77')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x78'));db[_0xbf02('0x79')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x7a'));db[_0xbf02('0x7b')]=db[_0xbf02('0x1')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0xbf02('0x7c')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x7d'));db[_0xbf02('0x7e')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x7f'));db[_0xbf02('0x80')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x81'));db[_0xbf02('0x82')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x83'));db[_0xbf02('0x84')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x85'));db[_0xbf02('0x86')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x87'));db[_0xbf02('0x88')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x89'));db[_0xbf02('0x8a')]=db['sequelize']['import'](_0xbf02('0x8b'));db[_0xbf02('0x8c')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x8d'));db[_0xbf02('0x8e')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/pause/pause.model');db[_0xbf02('0x8f')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/cdr/cdr.model');db[_0xbf02('0x90')]=db['sequelize'][_0xbf02('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x91'));db[_0xbf02('0x92')]=db[_0xbf02('0x1')]['import']('../api/sound/sound.model');db[_0xbf02('0x93')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x94'));db[_0xbf02('0x95')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/contactItemType/contactItemType.model');db[_0xbf02('0x96')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x97'));db[_0xbf02('0x98')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x99'));db[_0xbf02('0x9a')]=db[_0xbf02('0x1')]['import'](_0xbf02('0x9b'));db[_0xbf02('0x9c')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x9d'));db['Integration']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x9e'));db[_0xbf02('0x9f')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xa0'));db[_0xbf02('0xa1')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xa2'));db['AnalyticDefaultReport']=db[_0xbf02('0x1')]['import'](_0xbf02('0xa3'));db['AnalyticExtractedReport']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xa4'));db[_0xbf02('0xa5')]=db['sequelize']['import'](_0xbf02('0xa6'));db[_0xbf02('0xa7')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xa8'));db[_0xbf02('0xa9')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xaa'));db[_0xbf02('0xab')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xac'));db[_0xbf02('0xad')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xbf02('0xae')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xaf'));db[_0xbf02('0xb0')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xb1'));db['SugarcrmConfiguration']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xb2'));db[_0xbf02('0xb3')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xbf02('0xb4')]=db['sequelize']['import'](_0xbf02('0xb5'));db[_0xbf02('0xb6')]=db['sequelize'][_0xbf02('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xbf02('0xb7')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xb8'));db['ZohoAccount']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xb9'));db['ZohoConfiguration']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xba'));db[_0xbf02('0xbb')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xbf02('0xbc')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xbd'));db['ZendeskField']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xbe'));db[_0xbf02('0xbf')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xc0'));db[_0xbf02('0xc1')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xc2'));db['FreshdeskField']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xc3'));db['VtigerAccount']=db[_0xbf02('0x1')]['import'](_0xbf02('0xc4'));db['VtigerConfiguration']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xc5'));db['VtigerField']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xc6'));db['ServicenowAccount']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xbf02('0xc7')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xc8'));db[_0xbf02('0xc9')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xca'));db[_0xbf02('0xcb')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xbf02('0xcc')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xbf02('0x1')]['import'](_0xbf02('0xcd'));db['FreshsalesField']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xce'));db[_0xbf02('0xcf')]=db['sequelize']['import'](_0xbf02('0x9e'));db[_0xbf02('0xd0')]=db[_0xbf02('0x1')]['import']('../api/network/network.model');db[_0xbf02('0xd1')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xd2'));db['ChatInternalMessage']=db['sequelize'][_0xbf02('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xbf02('0xd3')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xd4'));db['JscriptyQuestionReport']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xd5'));db[_0xbf02('0xd6')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xd7'));db[_0xbf02('0xd8')]=db['sequelize'][_0xbf02('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xbf02('0xd9')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xda'));db[_0xbf02('0xdb')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xbf02('0xdc')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xdd'));db[_0xbf02('0xde')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xdf'));db['SquareProject']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xe0'));db[_0xbf02('0xe1')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xe2'));db[_0xbf02('0xe3')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xe4'));db[_0xbf02('0xe5')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xe6'));db[_0xbf02('0xe7')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xe8'));db[_0xbf02('0xe9')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xea'));db[_0xbf02('0xeb')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xec'));db[_0xbf02('0xed')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xee'));db[_0xbf02('0xef')]=db['sequelize']['import'](_0xbf02('0xf0'));db['MailTransferReport']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0xf1'));db[_0xbf02('0xf2')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0xbf02('0xf3')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xf4'));db[_0xbf02('0xf5')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xf6'));db[_0xbf02('0xf7')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xf8'));db[_0xbf02('0xf9')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/cmList/cmList.model');db[_0xbf02('0xfa')]=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0xbf02('0xfb')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0xfc'));db[_0xbf02('0xfd')]=db[_0xbf02('0x1')]['import'](_0xbf02('0xfe'));db[_0xbf02('0xff')]=db['sequelize'][_0xbf02('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0xbf02('0x100')]=db['sequelize'][_0xbf02('0x13')]('../api/userNotification/userNotification.model');db[_0xbf02('0x101')]=db['sequelize']['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xbf02('0x1')][_0xbf02('0x13')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db['sequelize']['import'](_0xbf02('0x102'));db[_0xbf02('0x103')]=db[_0xbf02('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xbf02('0x104')]=db['sequelize']['import'](_0xbf02('0x105'));db['WhatsappTransferReport']=db[_0xbf02('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xbf02('0x106')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x107'));db[_0xbf02('0x108')]=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x109'));db[_0xbf02('0x10a')]=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x10b'));db['TeamVoicePrefix']=db['sequelize'][_0xbf02('0x13')](_0xbf02('0x10c'));db[_0xbf02('0x10d')]=db['sequelize'][_0xbf02('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0xbf02('0x1')][_0xbf02('0x13')](_0xbf02('0x10e'));db[_0xbf02('0x12')]['hasOne'](db[_0xbf02('0x21')],{'as':_0xbf02('0x21'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')]['hasOne'](db[_0xbf02('0x111')],{'as':_0xbf02('0x112'),'onDelete':'cascade','foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')]['hasMany'](db[_0xbf02('0x113')],{'as':_0xbf02('0x114'),'foreignKey':'UserId'});db['User'][_0xbf02('0x115')](db[_0xbf02('0x2f')],{'as':_0xbf02('0x116'),'foreignKey':'UserId'});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x18')],{'as':'Extensions','onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x7b')],{'as':_0xbf02('0x117'),'foreignKey':'UserId'});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x7c')],{'as':'HopperHistory','foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')]['hasMany'](db[_0xbf02('0x7e')],{'as':_0xbf02('0x7e'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')][_0xbf02('0x115')](db['OpenchannelInteraction'],{'as':_0xbf02('0x118'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x6b')],{'as':_0xbf02('0x119'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x11a')],{'as':_0xbf02('0x11b'),'foreignKey':_0xbf02('0x110')});db['User'][_0xbf02('0x115')](db['FaxInteraction'],{'as':_0xbf02('0x11c'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')]['hasMany'](db[_0xbf02('0x45')],{'as':_0xbf02('0x11d'),'foreignKey':'UserId'});db[_0xbf02('0x12')]['hasMany'](db[_0xbf02('0x11e')],{'as':_0xbf02('0x11f'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x12')][_0xbf02('0x115')](db[_0xbf02('0x100')],{'as':_0xbf02('0x120'),'foreignKey':'SenderId'});db[_0xbf02('0x12')][_0xbf02('0x121')](db[_0xbf02('0xfb')],{'as':'UserProfile','foreignKey':_0xbf02('0x122')});db[_0xbf02('0x12')][_0xbf02('0x123')](db['ChatGroup'],{'as':'Groups','through':_0xbf02('0x124')});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x75')],{'as':_0xbf02('0x125'),'through':_0xbf02('0x126')});db['User'][_0xbf02('0x123')](db[_0xbf02('0xf9')],{'as':'Lists','through':_0xbf02('0x127')});db['User'][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0xbf02('0x45')],{'as':_0xbf02('0x11d'),'through':'user_has_mail_interactions'});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x6b')],{'as':'ChatInteractions','through':_0xbf02('0x128')});db[_0xbf02('0x12')]['belongsToMany'](db[_0xbf02('0x53')],{'as':_0xbf02('0x11c'),'through':'user_has_fax_interactions'});db[_0xbf02('0x12')]['belongsToMany'](db[_0xbf02('0x11a')],{'as':_0xbf02('0x11b'),'through':_0xbf02('0x129')});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x60')],{'as':_0xbf02('0x118'),'through':_0xbf02('0x12a')});db['User'][_0xbf02('0x123')](db[_0xbf02('0x11e')],{'as':_0xbf02('0x11f'),'through':_0xbf02('0x12b')});db[_0xbf02('0x12')][_0xbf02('0x123')](db['VoiceQueue'],{'as':_0xbf02('0x12c'),'through':_0xbf02('0x31'),'required':![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0xfa')],{'as':_0xbf02('0x12d'),'through':'UserVoicePrefix','required':![]});db['User'][_0xbf02('0x123')](db[_0xbf02('0x41')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x12e')],{'as':_0xbf02('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db['FaxQueue'],{'as':_0xbf02('0x130'),'through':'UserFaxQueue','required':![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x5d')],{'as':_0xbf02('0x131'),'through':_0xbf02('0x37'),'required':![]});db['User'][_0xbf02('0x123')](db['OpenchannelQueue'],{'as':_0xbf02('0x132'),'through':'UserOpenchannelQueue','required':![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x106')],{'as':_0xbf02('0x133'),'through':_0xbf02('0x134'),'required':![]});db[_0xbf02('0x12')][_0xbf02('0x123')](db['CmList'],{'through':_0xbf02('0x127')});db[_0xbf02('0x12')][_0xbf02('0x123')](db['ChatWebsite'],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x51')],{'as':_0xbf02('0x135'),'through':'user_has_fax_accounts'});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x3f')],{'as':'MailAccounts','through':_0xbf02('0x136')});db[_0xbf02('0x12')][_0xbf02('0x123')](db[_0xbf02('0x137')],{'as':_0xbf02('0x138'),'through':'user_has_openchannel_accounts'});db['User'][_0xbf02('0x123')](db[_0xbf02('0x59')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0xbf02('0x123')](db[_0xbf02('0x101')],{'as':_0xbf02('0x139'),'through':_0xbf02('0x13a')});db[_0xbf02('0x15')]['hasMany'](db[_0xbf02('0x18')],{'as':_0xbf02('0x13b'),'onDelete':'cascade','foreignKey':_0xbf02('0x13c')});db[_0xbf02('0x13d')][_0xbf02('0x115')](db[_0xbf02('0x18')],{'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x18')]['hasMany'](db['VoiceExtension'],{'as':_0xbf02('0x13e'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x1a')][_0xbf02('0x123')](db[_0xbf02('0x92')],{'as':_0xbf02('0x13f'),'through':'moh_has_sounds'});db[_0xbf02('0x1c')][_0xbf02('0x115')](db[_0xbf02('0x2f')],{'as':_0xbf02('0x140'),'foreignKey':_0xbf02('0x141')});db['VoiceQueue']['hasMany'](db[_0xbf02('0x77')],{'as':_0xbf02('0x142'),'foreignKey':_0xbf02('0x141')});db[_0xbf02('0x1c')][_0xbf02('0x115')](db[_0xbf02('0x7b')],{'as':_0xbf02('0x117'),'foreignKey':_0xbf02('0x141')});db[_0xbf02('0x1c')][_0xbf02('0x115')](db[_0xbf02('0x7c')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0xbf02('0x1c')][_0xbf02('0x115')](db[_0xbf02('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0xbf02('0x141')});db[_0xbf02('0x1c')][_0xbf02('0x115')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xbf02('0x141')});db[_0xbf02('0x1c')][_0xbf02('0x115')](db[_0xbf02('0xd6')],{'as':'JscriptySessions','foreignKey':_0xbf02('0x141')});db[_0xbf02('0x1c')][_0xbf02('0x121')](db['Trunk'],{'as':_0xbf02('0x2c'),'foreignKey':_0xbf02('0x143')});db[_0xbf02('0x1c')][_0xbf02('0x121')](db[_0xbf02('0x2c')],{'as':_0xbf02('0x144'),'foreignKey':_0xbf02('0x145')});db[_0xbf02('0x1c')][_0xbf02('0x121')](db[_0xbf02('0x8c')],{'as':_0xbf02('0x8c'),'foreignKey':_0xbf02('0x146')});db['VoiceQueue'][_0xbf02('0x121')](db[_0xbf02('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0xbf02('0x147')});db[_0xbf02('0x1c')][_0xbf02('0x123')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xbf02('0x1c')]['belongsToMany'](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x31')});db['VoiceQueue'][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'as':_0xbf02('0x149'),'through':_0xbf02('0x10a')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0xbf02('0x14a'),'through':'voice_queues_has_cm_blacklists'});db[_0xbf02('0x113')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':'User','foreignKey':_0xbf02('0x110')});db[_0xbf02('0x1f')]['belongsTo'](db[_0xbf02('0x12')],{'as':_0xbf02('0x12'),'foreignKey':'UserId'});db['VoiceMail'][_0xbf02('0x115')](db[_0xbf02('0x23')],{'as':_0xbf02('0x14b'),'onDelete':_0xbf02('0x10f'),'foreignKey':'mailboxuser','sourceKey':_0xbf02('0x14c')});db[_0xbf02('0x23')]['belongsTo'](db[_0xbf02('0x21')],{'foreignKey':_0xbf02('0x14d'),'targetKey':_0xbf02('0x14c')});db[_0xbf02('0x25')][_0xbf02('0x115')](db['VoiceQueueReport'],{'as':_0xbf02('0x14e'),'foreignKey':_0xbf02('0x14f'),'constraints':![]});db['VoiceCallReport'][_0xbf02('0x115')](db[_0xbf02('0x150')],{'as':_0xbf02('0x151'),'foreignKey':_0xbf02('0x14f'),'constraints':![]});db[_0xbf02('0x25')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x12'),'foreignKey':'UserId'});db[_0xbf02('0x25')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':'Contact','foreignKey':_0xbf02('0x152')});db['MailServerIn'][_0xbf02('0x121')](db['MailAccount'],{'as':_0xbf02('0x3f'),'foreignKey':_0xbf02('0x153')});db[_0xbf02('0x3c')]['belongsTo'](db['CloudProvider'],{'as':_0xbf02('0x108'),'foreignKey':_0xbf02('0x154'),'onDelete':_0xbf02('0x155')});db['MailServerOut']['belongsTo'](db[_0xbf02('0x3f')],{'as':_0xbf02('0x3f'),'foreignKey':_0xbf02('0x153')});db[_0xbf02('0x3e')][_0xbf02('0x121')](db[_0xbf02('0x108')],{'as':_0xbf02('0x108'),'foreignKey':_0xbf02('0x154'),'onDelete':'restrict'});db['MailAccount'][_0xbf02('0x156')](db[_0xbf02('0x3c')],{'as':_0xbf02('0x157'),'onDelete':'cascade'});db[_0xbf02('0x3f')][_0xbf02('0x156')](db[_0xbf02('0x3e')],{'as':_0xbf02('0x158'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x3f')][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':'Dispositions','foreignKey':_0xbf02('0x153'),'onDelete':'cascade'});db['MailAccount'][_0xbf02('0x115')](db[_0xbf02('0x86')],{'as':_0xbf02('0x159'),'foreignKey':_0xbf02('0x153')});db['MailAccount'][_0xbf02('0x115')](db[_0xbf02('0x47')],{'as':_0xbf02('0x14b'),'foreignKey':'MailAccountId'});db[_0xbf02('0x3f')]['hasMany'](db[_0xbf02('0x45')],{'as':_0xbf02('0x15a')});db[_0xbf02('0x3f')][_0xbf02('0x115')](db[_0xbf02('0x49')],{'as':_0xbf02('0x13e')});db[_0xbf02('0x3f')][_0xbf02('0x121')](db['CmList'],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x3f')][_0xbf02('0x121')](db['Template'],{'as':_0xbf02('0x98'),'foreignKey':'TemplateId'});db[_0xbf02('0x3f')][_0xbf02('0x121')](db[_0xbf02('0x8e')],{'as':_0xbf02('0x15d'),'foreignKey':_0xbf02('0x147')});db['MailAccount'][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x148'),'through':_0xbf02('0x136')});db[_0xbf02('0x41')]['belongsToMany'](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x35')});db[_0xbf02('0x41')][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'through':_0xbf02('0x15e'),'as':_0xbf02('0x149')});db['MailInteraction'][_0xbf02('0x115')](db['MailMessage'],{'as':_0xbf02('0x14b'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x15f')});db[_0xbf02('0x45')]['belongsTo'](db[_0xbf02('0x3f')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x153')});db[_0xbf02('0x45')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':'ContactId'});db[_0xbf02('0x45')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':'Owner','foreignKey':_0xbf02('0x110')});db[_0xbf02('0x45')][_0xbf02('0x123')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xbf02('0x162')});db['MailInteraction'][_0xbf02('0x123')](db['Tag'],{'through':_0xbf02('0x163'),'as':_0xbf02('0x164')});db[_0xbf02('0x45')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'through':_0xbf02('0x166'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xbf02('0x115')](db[_0xbf02('0xed')],{'as':'Attachments','onDelete':_0xbf02('0x10f')});db[_0xbf02('0x47')]['belongsTo'](db['User'],{'as':_0xbf02('0x12')});db[_0xbf02('0x47')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'onDelete':_0xbf02('0x10f'),'as':'Contact'});db['MailMessage'][_0xbf02('0x121')](db[_0xbf02('0x45')],{'as':'Interaction','foreignKey':_0xbf02('0x15f')});db[_0xbf02('0x47')][_0xbf02('0x121')](db[_0xbf02('0x3f')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xbf02('0x47')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':_0xbf02('0x66'),'foreignKey':'ChatWebsiteId'});db[_0xbf02('0x47')][_0xbf02('0x121')](db[_0xbf02('0x6e')],{'as':'ChatOfflineMessage','foreignKey':_0xbf02('0x167')});db[_0xbf02('0x49')][_0xbf02('0x121')](db['User'],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x49')][_0xbf02('0x121')](db[_0xbf02('0x41')],{'onDelete':'restrict'});db[_0xbf02('0x49')][_0xbf02('0x121')](db['MailAccount'],{'onDelete':_0xbf02('0x155')});db['MailApplication'][_0xbf02('0x121')](db[_0xbf02('0x8c')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x49')][_0xbf02('0x121')](db[_0xbf02('0x93')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x168')});db[_0xbf02('0x4b')]['belongsTo'](db[_0xbf02('0x3f')],{});db[_0xbf02('0x4b')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x4b')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db['MailQueueReport'][_0xbf02('0x121')](db[_0xbf02('0x45')],{});db[_0xbf02('0x4b')][_0xbf02('0x121')](db[_0xbf02('0x47')],{});db['MailQueueReport'][_0xbf02('0x121')](db[_0xbf02('0x12')],{});db[_0xbf02('0x4b')][_0xbf02('0x121')](db[_0xbf02('0x41')],{});db[_0xbf02('0x4d')][_0xbf02('0x115')](db[_0xbf02('0x4f')],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':_0xbf02('0x169'),'foreignKey':_0xbf02('0x16a'),'onDelete':'cascade'});db[_0xbf02('0x51')][_0xbf02('0x115')](db[_0xbf02('0x86')],{'as':_0xbf02('0x159'),'foreignKey':_0xbf02('0x16a')});db[_0xbf02('0x51')][_0xbf02('0x115')](db[_0xbf02('0x53')],{'as':'Interactions'});db[_0xbf02('0x51')][_0xbf02('0x115')](db[_0xbf02('0x16b')],{'as':_0xbf02('0x13e')});db[_0xbf02('0x51')][_0xbf02('0x115')](db[_0xbf02('0x18')],{'as':_0xbf02('0x16c'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x51')][_0xbf02('0x115')](db['FaxMessage'],{'as':_0xbf02('0x14b')});db[_0xbf02('0x51')]['belongsTo'](db[_0xbf02('0x2c')],{'as':_0xbf02('0x2c')});db[_0xbf02('0x51')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x51')]['belongsTo'](db['Pause'],{'as':_0xbf02('0x15d'),'foreignKey':_0xbf02('0x147')});db[_0xbf02('0x51')]['belongsToMany'](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x16d')});db[_0xbf02('0x16b')]['belongsTo'](db[_0xbf02('0x12')],{'onDelete':'restrict'});db[_0xbf02('0x16b')][_0xbf02('0x121')](db['FaxQueue'],{'onDelete':_0xbf02('0x155')});db['FaxApplication'][_0xbf02('0x121')](db[_0xbf02('0x51')],{'onDelete':_0xbf02('0x155')});db['FaxApplication'][_0xbf02('0x121')](db[_0xbf02('0x93')],{'onDelete':'restrict','foreignKey':_0xbf02('0x168')});db[_0xbf02('0x53')][_0xbf02('0x115')](db[_0xbf02('0x55')],{'as':'Messages','onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x16e')});db[_0xbf02('0x53')][_0xbf02('0x121')](db[_0xbf02('0x51')],{'as':_0xbf02('0x160'),'foreignKey':'FaxAccountId'});db[_0xbf02('0x53')][_0xbf02('0x121')](db['CmContact'],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x53')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x16f'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x53')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0xbf02('0x123')](db['Tag'],{'through':_0xbf02('0x170'),'as':'ThroughTags'});db[_0xbf02('0x53')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'through':_0xbf02('0x171'),'foreignKey':_0xbf02('0x16e')});db[_0xbf02('0x55')][_0xbf02('0x121')](db['User'],{'onDelete':'cascade','as':_0xbf02('0x12')});db[_0xbf02('0x55')]['belongsTo'](db[_0xbf02('0x53')],{'as':'Interaction','foreignKey':_0xbf02('0x16e')});db['FaxMessage'][_0xbf02('0x121')](db['CmContact'],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x161')});db['FaxMessage'][_0xbf02('0x121')](db['Attachment'],{'as':_0xbf02('0xed'),'foreignKey':'AttachmentId'});db[_0xbf02('0x55')][_0xbf02('0x121')](db[_0xbf02('0x51')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x16a')});db[_0xbf02('0x172')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x173')});db[_0xbf02('0x172')][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'through':_0xbf02('0x174'),'as':_0xbf02('0x149')});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0x51')],{});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':'Contact','foreignKey':_0xbf02('0x152')});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0x53')],{});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0x55')],{});db['FaxQueueReport']['belongsTo'](db[_0xbf02('0x12')],{});db[_0xbf02('0x175')][_0xbf02('0x121')](db[_0xbf02('0x172')],{});db[_0xbf02('0x59')][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':_0xbf02('0x169'),'foreignKey':_0xbf02('0x176'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x59')]['hasMany'](db[_0xbf02('0x86')],{'as':_0xbf02('0x159'),'foreignKey':_0xbf02('0x176')});db[_0xbf02('0x59')][_0xbf02('0x115')](db[_0xbf02('0x177')],{'as':_0xbf02('0x14b'),'foreignKey':'SmsAccountId'});db[_0xbf02('0x59')][_0xbf02('0x115')](db[_0xbf02('0x11a')],{'as':_0xbf02('0x15a')});db[_0xbf02('0x59')][_0xbf02('0x115')](db[_0xbf02('0x5a')],{'as':_0xbf02('0x13e')});db[_0xbf02('0x59')][_0xbf02('0x121')](db['CmList'],{'as':'List','foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x59')][_0xbf02('0x121')](db['Pause'],{'as':_0xbf02('0x15d'),'foreignKey':_0xbf02('0x147')});db[_0xbf02('0x59')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':'user_has_sms_accounts'});db[_0xbf02('0x5a')][_0xbf02('0x121')](db['User'],{'onDelete':_0xbf02('0x155')});db['SmsApplication'][_0xbf02('0x121')](db[_0xbf02('0x5d')],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x5a')][_0xbf02('0x121')](db[_0xbf02('0x59')],{'onDelete':_0xbf02('0x155')});db['SmsApplication'][_0xbf02('0x121')](db['Interval'],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x146')});db['SmsApplication'][_0xbf02('0x121')](db[_0xbf02('0x93')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x168')});db['SmsInteraction'][_0xbf02('0x115')](db[_0xbf02('0x177')],{'as':'Messages','onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x178')});db[_0xbf02('0x11a')][_0xbf02('0x121')](db[_0xbf02('0x59')],{'as':_0xbf02('0x160'),'foreignKey':'SmsAccountId'});db[_0xbf02('0x11a')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db['SmsInteraction'][_0xbf02('0x121')](db['User'],{'as':_0xbf02('0x16f'),'foreignKey':_0xbf02('0x110')});db[_0xbf02('0x11a')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x179'),'as':'Tags'});db[_0xbf02('0x11a')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':'sms_interaction_has_tags','as':_0xbf02('0x164')});db['SmsInteraction'][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'through':_0xbf02('0x129'),'foreignKey':_0xbf02('0x178')});db[_0xbf02('0x177')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x12')});db[_0xbf02('0x177')]['belongsTo'](db[_0xbf02('0x75')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x161')});db[_0xbf02('0x177')][_0xbf02('0x121')](db[_0xbf02('0x11a')],{'onDelete':_0xbf02('0x10f'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xbf02('0x177')][_0xbf02('0x121')](db[_0xbf02('0x59')],{'as':'Account','foreignKey':_0xbf02('0x176')});db[_0xbf02('0x5d')][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x148'),'through':'UserSmsQueue','foreignKey':_0xbf02('0x17a')});db[_0xbf02('0x5d')][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'through':_0xbf02('0x17b'),'as':'Teams'});db[_0xbf02('0x137')][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':_0xbf02('0x169'),'foreignKey':_0xbf02('0x17c'),'onDelete':'cascade'});db[_0xbf02('0x137')][_0xbf02('0x115')](db[_0xbf02('0x86')],{'as':_0xbf02('0x159'),'foreignKey':_0xbf02('0x17c')});db[_0xbf02('0x137')][_0xbf02('0x115')](db[_0xbf02('0x60')],{'as':_0xbf02('0x15a'),'foreignKey':_0xbf02('0x17c')});db[_0xbf02('0x137')][_0xbf02('0x115')](db[_0xbf02('0x62')],{'as':_0xbf02('0x14b'),'foreignKey':_0xbf02('0x17c')});db['OpenchannelAccount']['hasMany'](db['OpenchannelApplication'],{'as':_0xbf02('0x13e'),'foreignKey':_0xbf02('0x17c')});db[_0xbf02('0x137')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x137')][_0xbf02('0x121')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbf02('0x147')});db[_0xbf02('0x137')][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x148'),'through':_0xbf02('0x17d')});db[_0xbf02('0x5f')]['belongsTo'](db[_0xbf02('0x12')],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x5f')]['belongsTo'](db[_0xbf02('0x64')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x17e')});db[_0xbf02('0x5f')]['belongsTo'](db[_0xbf02('0x137')],{'onDelete':'restrict','foreignKey':_0xbf02('0x17c')});db['OpenchannelApplication'][_0xbf02('0x121')](db[_0xbf02('0x8c')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x5f')][_0xbf02('0x121')](db[_0xbf02('0x93')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x168')});db[_0xbf02('0x60')][_0xbf02('0x115')](db['OpenchannelMessage'],{'as':_0xbf02('0x14b'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x17f')});db[_0xbf02('0x60')][_0xbf02('0x121')](db[_0xbf02('0x137')],{'as':'Account','foreignKey':_0xbf02('0x17c')});db[_0xbf02('0x60')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x60')][_0xbf02('0x121')](db['User'],{'as':'Owner','foreignKey':_0xbf02('0x110')});db['OpenchannelInteraction'][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x180'),'as':_0xbf02('0x162')});db[_0xbf02('0x60')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x180'),'as':_0xbf02('0x164')});db[_0xbf02('0x60')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'through':_0xbf02('0x12a'),'foreignKey':_0xbf02('0x17f')});db[_0xbf02('0x62')][_0xbf02('0x121')](db['User'],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x12')});db[_0xbf02('0x62')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x161')});db['OpenchannelMessage']['belongsTo'](db[_0xbf02('0x60')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x181'),'foreignKey':_0xbf02('0x17f')});db[_0xbf02('0x62')]['belongsTo'](db[_0xbf02('0xed')],{'as':_0xbf02('0xed'),'foreignKey':_0xbf02('0x182')});db[_0xbf02('0x62')][_0xbf02('0x121')](db[_0xbf02('0x137')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x17c')});db['OpenchannelQueue'][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x148'),'through':_0xbf02('0x39'),'foreignKey':_0xbf02('0x17e')});db['OpenchannelQueue'][_0xbf02('0x123')](db[_0xbf02('0xe5')],{'through':_0xbf02('0x183'),'as':_0xbf02('0x149')});db[_0xbf02('0x66')][_0xbf02('0x115')](db['Disposition'],{'as':_0xbf02('0x169'),'foreignKey':_0xbf02('0x184'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x66')]['hasMany'](db[_0xbf02('0x86')],{'as':_0xbf02('0x159'),'foreignKey':'ChatWebsiteId'});db[_0xbf02('0x66')][_0xbf02('0x115')](db[_0xbf02('0x185')],{'as':_0xbf02('0x186')});db['ChatWebsite']['hasMany'](db[_0xbf02('0x6b')],{'as':_0xbf02('0x15a')});db[_0xbf02('0x66')][_0xbf02('0x115')](db[_0xbf02('0x69')],{'as':_0xbf02('0x13e')});db['ChatWebsite'][_0xbf02('0x115')](db[_0xbf02('0x6d')],{'as':_0xbf02('0x14b')});db[_0xbf02('0x66')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':'List','foreignKey':_0xbf02('0x15c')});db['ChatWebsite'][_0xbf02('0x121')](db['Interval'],{'as':_0xbf02('0x8c'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x66')][_0xbf02('0x121')](db['MailAccount'],{'as':_0xbf02('0x3f'),'foreignKey':_0xbf02('0x153')});db[_0xbf02('0x66')]['belongsTo'](db['Pause'],{'as':_0xbf02('0x15d'),'foreignKey':_0xbf02('0x147')});db[_0xbf02('0x66')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0xbf02('0x67')][_0xbf02('0x121')](db[_0xbf02('0x137')],{});db['OpenchannelQueueReport'][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x67')]['belongsTo'](db['CmContact'],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x67')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xbf02('0x67')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xbf02('0x67')][_0xbf02('0x121')](db[_0xbf02('0x12')],{});db[_0xbf02('0x67')][_0xbf02('0x121')](db[_0xbf02('0x64')],{});db[_0xbf02('0x69')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x187'),'foreignKey':_0xbf02('0x110'),'onDelete':_0xbf02('0x155')});db[_0xbf02('0x69')][_0xbf02('0x121')](db[_0xbf02('0x12e')],{'as':_0xbf02('0x188'),'foreignKey':_0xbf02('0x189'),'onDelete':_0xbf02('0x155')});db[_0xbf02('0x69')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':_0xbf02('0x18a'),'foreignKey':'ChatWebsiteId','onDelete':_0xbf02('0x155')});db['ChatApplication'][_0xbf02('0x121')](db['Tag'],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x168')});db['ChatInteraction'][_0xbf02('0x115')](db[_0xbf02('0x6d')],{'as':_0xbf02('0x14b'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x18b')});db[_0xbf02('0x6b')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':'Account','foreignKey':_0xbf02('0x184')});db[_0xbf02('0x6b')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x6b')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x16f'),'foreignKey':'UserId'});db[_0xbf02('0x6b')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x18c'),'as':'Tags'});db[_0xbf02('0x6b')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0xbf02('0x6b')][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x165'),'through':_0xbf02('0x128'),'foreignKey':_0xbf02('0x18b')});db[_0xbf02('0x6d')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x12')});db['ChatMessage'][_0xbf02('0x121')](db[_0xbf02('0x75')],{'onDelete':'cascade','as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x6d')][_0xbf02('0x121')](db[_0xbf02('0x6b')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x181'),'foreignKey':_0xbf02('0x18b')});db[_0xbf02('0x6d')][_0xbf02('0x121')](db[_0xbf02('0xed')],{'as':'Attachment','foreignKey':_0xbf02('0x182')});db[_0xbf02('0x6d')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x184')});db[_0xbf02('0x6e')][_0xbf02('0x115')](db[_0xbf02('0xed')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0xbf02('0x10f'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xbf02('0x75')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x6e')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':'Account','foreignKey':_0xbf02('0x184')});db['ChatQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0xbf02('0x33'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0xbf02('0xe5')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xbf02('0x71')]['hasMany'](db[_0xbf02('0x18d')],{'as':_0xbf02('0x14b'),'foreignKey':'ChatGroupId','onDelete':_0xbf02('0x10f')});db[_0xbf02('0x71')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':'Members','through':_0xbf02('0x124')});db['ChatProactiveAction'][_0xbf02('0x121')](db[_0xbf02('0x66')],{'as':'Website','foreignKey':_0xbf02('0x184')});db[_0xbf02('0x74')][_0xbf02('0x115')](db['CmContact'],{'as':_0xbf02('0x125'),'foreignKey':'CompanyId'});db[_0xbf02('0x75')][_0xbf02('0x115')](db['CmContactHasItem'],{'as':_0xbf02('0x18e'),'foreignKey':_0xbf02('0x18f')});db[_0xbf02('0x75')][_0xbf02('0x115')](db['CmHopper'],{'as':_0xbf02('0x142'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x75')][_0xbf02('0x115')](db[_0xbf02('0x7b')],{'as':_0xbf02('0x117'),'foreignKey':'ContactId'});db[_0xbf02('0x75')][_0xbf02('0x115')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xbf02('0x152')});db['CmContact'][_0xbf02('0x115')](db[_0xbf02('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0xbf02('0x152')});db[_0xbf02('0x75')][_0xbf02('0x115')](db['JscriptySessionReport'],{'as':_0xbf02('0x190'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x75')][_0xbf02('0x115')](db[_0xbf02('0x60')],{'as':_0xbf02('0x118'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xbf02('0x75')]['hasMany'](db[_0xbf02('0x6b')],{'as':_0xbf02('0x119'),'foreignKey':_0xbf02('0x152'),'onDelete':_0xbf02('0x155')});db['CmContact'][_0xbf02('0x115')](db[_0xbf02('0x11a')],{'as':_0xbf02('0x11b'),'foreignKey':_0xbf02('0x152'),'onDelete':'restrict'});db['CmContact'][_0xbf02('0x115')](db[_0xbf02('0x53')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xbf02('0x75')][_0xbf02('0x115')](db[_0xbf02('0x45')],{'as':'MailInteractions','foreignKey':_0xbf02('0x152'),'onDelete':_0xbf02('0x155')});db['CmContact'][_0xbf02('0x121')](db[_0xbf02('0x74')],{'as':'Company','foreignKey':_0xbf02('0x191')});db['CmContact'][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c'),'onDelete':_0xbf02('0x10f')});db['CmContact'][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'through':_0xbf02('0x126')});db['CmContact']['belongsToMany'](db['Tag'],{'as':_0xbf02('0x162'),'through':_0xbf02('0x192')});db[_0xbf02('0x75')]['belongsToMany'](db[_0xbf02('0x93')],{'through':_0xbf02('0x192'),'as':'ThroughTags'});db['CmHopper'][_0xbf02('0x115')](db[_0xbf02('0x193')],{'as':_0xbf02('0x194'),'foreignKey':_0xbf02('0x195')});db[_0xbf02('0x77')][_0xbf02('0x121')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0xbf02('0x77')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':'List','foreignKey':_0xbf02('0x15c'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x77')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x187'),'foreignKey':'UserId'});db['CmHopper'][_0xbf02('0x121')](db[_0xbf02('0x1c')],{'as':_0xbf02('0x188'),'foreignKey':_0xbf02('0x141'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x77')]['belongsTo'](db[_0xbf02('0xe9')],{'as':_0xbf02('0xe9'),'foreignKey':_0xbf02('0x196'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x77')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x16f'),'foreignKey':'OwnerId'});db[_0xbf02('0x79')]['belongsTo'](db[_0xbf02('0x75')],{'as':'Contact','foreignKey':_0xbf02('0x152'),'onDelete':'cascade'});db[_0xbf02('0x79')]['belongsTo'](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':'ListId','onDelete':_0xbf02('0x10f')});db['CmHopperBlack'][_0xbf02('0x121')](db[_0xbf02('0x1c')],{'as':_0xbf02('0x188'),'foreignKey':'VoiceQueueId','onDelete':_0xbf02('0x10f')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xbf02('0xe9'),'foreignKey':_0xbf02('0x196'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x84')][_0xbf02('0x115')](db[_0xbf02('0x8a')],{'as':{'plural':_0xbf02('0x197'),'singular':'OneAll'},'foreignKey':_0xbf02('0x198'),'onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0x84')][_0xbf02('0x115')](db[_0xbf02('0x8a')],{'as':{'plural':_0xbf02('0x199'),'singular':'OneAny'},'foreignKey':_0xbf02('0x19a'),'onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0x84')][_0xbf02('0x115')](db[_0xbf02('0x82')],{'as':'Actions','foreignKey':_0xbf02('0x19b'),'onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db[_0xbf02('0x88')],{'as':'Dispositions','foreignKey':_0xbf02('0x19c'),'onDelete':_0xbf02('0x10f')});db['Interval'][_0xbf02('0x115')](db[_0xbf02('0x8c')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xbf02('0x10f'),'hooks':!![],'required':![]});db[_0xbf02('0x8c')][_0xbf02('0x115')](db[_0xbf02('0x18')],{'as':'Extensions','foreignKey':_0xbf02('0x146'),'onDelete':'restrict'});db[_0xbf02('0x8c')][_0xbf02('0x115')](db['MailApplication'],{'as':_0xbf02('0x19d'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x8c')][_0xbf02('0x115')](db[_0xbf02('0x69')],{'as':_0xbf02('0x19e'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x8c')][_0xbf02('0x115')](db[_0xbf02('0x16b')],{'as':_0xbf02('0x19f'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x8c')][_0xbf02('0x115')](db[_0xbf02('0x5a')],{'as':_0xbf02('0x1a0'),'foreignKey':_0xbf02('0x146')});db[_0xbf02('0x1a1')][_0xbf02('0x121')](db['MailAccount'],{});db[_0xbf02('0x1a1')][_0xbf02('0x121')](db[_0xbf02('0x1a2')],{'foreignKey':_0xbf02('0x1a3')});db[_0xbf02('0x1a1')][_0xbf02('0x121')](db[_0xbf02('0xa1')],{'foreignKey':_0xbf02('0x1a4')});db['Sound'][_0xbf02('0x123')](db[_0xbf02('0x1a')],{'as':_0xbf02('0x1a5'),'through':_0xbf02('0x1a6'),'onDelete':_0xbf02('0x155')});db[_0xbf02('0x93')][_0xbf02('0x123')](db[_0xbf02('0x75')],{'through':_0xbf02('0x192')});db[_0xbf02('0x93')]['belongsToMany'](db[_0xbf02('0x6b')],{'through':_0xbf02('0x18c')});db[_0xbf02('0x93')]['belongsToMany'](db[_0xbf02('0x45')],{'through':_0xbf02('0x163')});db['Tag'][_0xbf02('0x123')](db[_0xbf02('0x11a')],{'through':_0xbf02('0x179')});db['Tag'][_0xbf02('0x123')](db[_0xbf02('0x53')],{'through':_0xbf02('0x170')});db[_0xbf02('0x93')]['belongsToMany'](db[_0xbf02('0x60')],{'through':_0xbf02('0x180')});db[_0xbf02('0x93')][_0xbf02('0x123')](db[_0xbf02('0x11e')],{'through':_0xbf02('0x1a7')});db[_0xbf02('0x96')][_0xbf02('0x121')](db[_0xbf02('0x95')],{'as':_0xbf02('0x1a8'),'foreignKey':'ItemTypeId'});db[_0xbf02('0x193')]['belongsTo'](db[_0xbf02('0x77')],{'as':_0xbf02('0x1a9'),'foreignKey':_0xbf02('0x195')});db[_0xbf02('0x96')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x18f')});db[_0xbf02('0x9a')][_0xbf02('0x115')](db[_0xbf02('0x8a')],{'as':{'plural':'AllConditions','singular':_0xbf02('0x1aa')},'foreignKey':_0xbf02('0x1ab'),'onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0x9a')]['hasMany'](db[_0xbf02('0x8a')],{'as':{'plural':_0xbf02('0x1ac'),'singular':_0xbf02('0x1ad')},'foreignKey':_0xbf02('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0xbf02('0x9a')][_0xbf02('0x115')](db[_0xbf02('0x82')],{'as':_0xbf02('0x1af'),'foreignKey':_0xbf02('0x1b0'),'onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0xa1')][_0xbf02('0x115')](db[_0xbf02('0xa7')],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1a4'),'hooks':!![]});db[_0xbf02('0x1a2')][_0xbf02('0x115')](db['AnalyticFieldReport'],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1a3')});db[_0xbf02('0xa5')]['hasMany'](db[_0xbf02('0xa7')],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0xbf02('0x121')](db[_0xbf02('0xa5')],{'foreignKey':'MetricId'});db[_0xbf02('0xab')]['hasMany'](db[_0xbf02('0xad')],{'as':'Configurations','onDelete':_0xbf02('0x10f'),'foreignKey':'AccountId'});db[_0xbf02('0xad')][_0xbf02('0x115')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xbf02('0x10f'),'foreignKey':'SubjectId'});db[_0xbf02('0xad')][_0xbf02('0x115')](db[_0xbf02('0xae')],{'as':_0xbf02('0x1b2'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xad')][_0xbf02('0x115')](db['SalesforceField'],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xad')][_0xbf02('0x121')](db[_0xbf02('0xab')],{'as':'Account','foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0xae')][_0xbf02('0x115')](db[_0xbf02('0xae')],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db['SalesforceField']['hasMany'](db[_0xbf02('0xae')],{'as':_0xbf02('0x1b8'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xae')][_0xbf02('0x115')](db[_0xbf02('0xae')],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xae')]['belongsTo'](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':_0xbf02('0x1ba')});db[_0xbf02('0xb0')][_0xbf02('0x115')](db[_0xbf02('0x1bb')],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xbf02('0x115')](db[_0xbf02('0xb3')],{'as':_0xbf02('0x1bd'),'onDelete':_0xbf02('0x10f'),'foreignKey':'SubjectId'});db[_0xbf02('0x1bb')][_0xbf02('0x115')](db[_0xbf02('0xb3')],{'as':'Descriptions','onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0x1bb')][_0xbf02('0x115')](db['SugarcrmField'],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0x1bb')]['belongsTo'](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0xb3')][_0xbf02('0x115')](db['SugarcrmField'],{'as':_0xbf02('0x1b6'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0xbf02('0x115')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xb3')][_0xbf02('0x115')](db[_0xbf02('0xb3')],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xb3')]['belongsTo'](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':'VariableId'});db[_0xbf02('0xb4')][_0xbf02('0x115')](db[_0xbf02('0xb6')],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0xb6')]['hasMany'](db[_0xbf02('0xb7')],{'as':_0xbf02('0x1bd'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0xb6')][_0xbf02('0x115')](db[_0xbf02('0xb7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xbf02('0x1b3')});db['DeskConfiguration']['hasMany'](db[_0xbf02('0xb7')],{'as':_0xbf02('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xbf02('0xb6')]['belongsTo'](db[_0xbf02('0xb4')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x1be')});db[_0xbf02('0xb7')][_0xbf02('0x115')](db[_0xbf02('0xb7')],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db['DeskField'][_0xbf02('0x115')](db['DeskField'],{'as':_0xbf02('0x1b8'),'foreignKey':'DescriptionId'});db[_0xbf02('0xb7')][_0xbf02('0x115')](db[_0xbf02('0xb7')],{'as':'Field','foreignKey':_0xbf02('0x1b4')});db['DeskField'][_0xbf02('0x121')](db[_0xbf02('0x9c')],{'as':_0xbf02('0x9c'),'foreignKey':'VariableId'});db[_0xbf02('0x1bf')]['hasMany'](db['ZohoConfiguration'],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0x1c0')]['hasMany'](db['ZohoField'],{'as':_0xbf02('0x1bd'),'onDelete':'cascade','foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0x1c0')][_0xbf02('0x115')](db[_0xbf02('0x1c1')],{'as':_0xbf02('0x1b2'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0x1c0')][_0xbf02('0x115')](db[_0xbf02('0x1c1')],{'as':'Fields','onDelete':_0xbf02('0x10f'),'foreignKey':'FieldId'});db[_0xbf02('0x1c0')][_0xbf02('0x121')](db[_0xbf02('0x1bf')],{'as':'Account','foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0x1c1')]['hasMany'](db[_0xbf02('0x1c1')],{'as':_0xbf02('0x1b6'),'foreignKey':'SubjectId'});db['ZohoField']['hasMany'](db[_0xbf02('0x1c1')],{'as':_0xbf02('0x1b8'),'foreignKey':'DescriptionId'});db[_0xbf02('0x1c1')][_0xbf02('0x115')](db['ZohoField'],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0x1c1')][_0xbf02('0x121')](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':'VariableId'});db[_0xbf02('0xbb')][_0xbf02('0x115')](db[_0xbf02('0xbc')],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':'AccountId'});db[_0xbf02('0xbc')]['hasMany'](db[_0xbf02('0x1c2')],{'as':'Subjects','foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0xbc')][_0xbf02('0x115')](db[_0xbf02('0x1c2')],{'as':_0xbf02('0x1b2'),'foreignKey':_0xbf02('0x1b3')});db['ZendeskConfiguration'][_0xbf02('0x115')](db[_0xbf02('0x1c2')],{'as':_0xbf02('0x1b1'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xbf02('0xbb')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0xbc')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x1c3')});db[_0xbf02('0x1c2')][_0xbf02('0x115')](db[_0xbf02('0x1c2')],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db['ZendeskField'][_0xbf02('0x115')](db[_0xbf02('0x1c2')],{'as':_0xbf02('0x1b8'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0x1c2')][_0xbf02('0x115')](db[_0xbf02('0x1c2')],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0x1c2')][_0xbf02('0x121')](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':_0xbf02('0x1ba')});db[_0xbf02('0xbf')][_0xbf02('0x115')](db[_0xbf02('0xc1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xbf02('0x1b5')});db['FreshdeskConfiguration']['hasMany'](db[_0xbf02('0x1c4')],{'as':'Subjects','onDelete':_0xbf02('0x10f'),'foreignKey':'SubjectId'});db[_0xbf02('0xc1')][_0xbf02('0x115')](db[_0xbf02('0x1c4')],{'as':_0xbf02('0x1b2'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xc1')]['hasMany'](db[_0xbf02('0x1c4')],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xc1')][_0xbf02('0x121')](db[_0xbf02('0xbf')],{'as':'Account','foreignKey':'AccountId'});db[_0xbf02('0xc1')][_0xbf02('0x123')](db[_0xbf02('0x93')],{'through':_0xbf02('0x1c5')});db['FreshdeskField'][_0xbf02('0x115')](db[_0xbf02('0x1c4')],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0x1c4')]['hasMany'](db[_0xbf02('0x1c4')],{'as':'Description','foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0x1c4')][_0xbf02('0x115')](db[_0xbf02('0x1c4')],{'as':_0xbf02('0x1b9'),'foreignKey':'FieldId'});db[_0xbf02('0x1c4')]['belongsTo'](db[_0xbf02('0x9c')],{'as':_0xbf02('0x9c'),'foreignKey':_0xbf02('0x1ba')});db[_0xbf02('0x1c6')]['hasMany'](db[_0xbf02('0x1c7')],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':'AccountId'});db[_0xbf02('0x1c7')][_0xbf02('0x115')](db[_0xbf02('0x1c8')],{'as':_0xbf02('0x1bd'),'foreignKey':'SubjectId'});db[_0xbf02('0x1c7')][_0xbf02('0x115')](db['VtigerField'],{'as':_0xbf02('0x1b2'),'foreignKey':'DescriptionId'});db[_0xbf02('0x1c7')]['hasMany'](db[_0xbf02('0x1c8')],{'as':_0xbf02('0x1b1'),'foreignKey':'FieldId'});db[_0xbf02('0x1c7')][_0xbf02('0x121')](db['VtigerAccount'],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0x1c8')][_0xbf02('0x115')](db['VtigerField'],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0x1c8')][_0xbf02('0x115')](db[_0xbf02('0x1c8')],{'as':_0xbf02('0x1b8'),'foreignKey':'DescriptionId'});db['VtigerField'][_0xbf02('0x115')](db[_0xbf02('0x1c8')],{'as':'Field','foreignKey':'FieldId'});db[_0xbf02('0x1c8')]['belongsTo'](db[_0xbf02('0x9c')],{'as':'Variable','foreignKey':_0xbf02('0x1ba')});db[_0xbf02('0x1c9')]['hasMany'](db[_0xbf02('0x1ca')],{'as':_0xbf02('0x1bc'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0x1ca')]['hasMany'](db[_0xbf02('0xc7')],{'as':'Subjects','foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0x1ca')][_0xbf02('0x115')](db['ServicenowField'],{'as':_0xbf02('0x1b2'),'foreignKey':_0xbf02('0x1b3')});db['ServicenowConfiguration'][_0xbf02('0x115')](db[_0xbf02('0xc7')],{'as':_0xbf02('0x1b1'),'foreignKey':'FieldId'});db[_0xbf02('0x1ca')][_0xbf02('0x121')](db[_0xbf02('0x1c9')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x1b5')});db['ServicenowField']['hasMany'](db[_0xbf02('0xc7')],{'as':'Subject','foreignKey':_0xbf02('0x1b7')});db['ServicenowField'][_0xbf02('0x115')](db[_0xbf02('0xc7')],{'as':_0xbf02('0x1b8'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xc7')]['hasMany'](db[_0xbf02('0xc7')],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xc7')][_0xbf02('0x121')](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':'VariableId'});db[_0xbf02('0xc9')][_0xbf02('0x115')](db[_0xbf02('0xcb')],{'as':_0xbf02('0x1bc'),'onDelete':'cascade','foreignKey':_0xbf02('0x1b5')});db[_0xbf02('0xc9')]['belongsTo'](db[_0xbf02('0x108')],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db['Dynamics365Configuration'][_0xbf02('0x115')](db['Dynamics365Field'],{'as':_0xbf02('0x1bd'),'onDelete':'cascade','foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0xcb')][_0xbf02('0x115')](db[_0xbf02('0xcc')],{'as':_0xbf02('0x1b2'),'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0xcb')]['hasMany'](db[_0xbf02('0xcc')],{'as':_0xbf02('0x1b1'),'onDelete':_0xbf02('0x10f'),'foreignKey':'FieldId'});db[_0xbf02('0xcb')]['belongsTo'](db[_0xbf02('0xc9')],{'as':_0xbf02('0x160'),'foreignKey':'AccountId'});db[_0xbf02('0xcc')][_0xbf02('0x115')](db[_0xbf02('0xcc')],{'as':_0xbf02('0x1b6'),'foreignKey':_0xbf02('0x1b7')});db['Dynamics365Field'][_0xbf02('0x115')](db[_0xbf02('0xcc')],{'as':_0xbf02('0x1b8'),'foreignKey':'DescriptionId'});db[_0xbf02('0xcc')][_0xbf02('0x115')](db['Dynamics365Field'],{'as':_0xbf02('0x1b9'),'foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0xcc')][_0xbf02('0x121')](db['Variable'],{'as':_0xbf02('0x9c'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xbf02('0x115')](db[_0xbf02('0x1cb')],{'as':_0xbf02('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0xbf02('0x115')](db[_0xbf02('0x1cc')],{'as':'Subjects','foreignKey':_0xbf02('0x1b7')});db['FreshsalesConfiguration']['hasMany'](db[_0xbf02('0x1cc')],{'as':'Descriptions','foreignKey':_0xbf02('0x1b3')});db[_0xbf02('0x1cb')][_0xbf02('0x115')](db[_0xbf02('0x1cc')],{'as':'Fields','foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0x1cb')][_0xbf02('0x121')](db[_0xbf02('0x1cd')],{'as':_0xbf02('0x160'),'foreignKey':'AccountId'});db[_0xbf02('0x1cc')]['hasMany'](db[_0xbf02('0x1cc')],{'as':'Subject','foreignKey':_0xbf02('0x1b7')});db[_0xbf02('0x1cc')]['hasMany'](db[_0xbf02('0x1cc')],{'as':_0xbf02('0x1b8'),'foreignKey':_0xbf02('0x1b3')});db['FreshsalesField'][_0xbf02('0x115')](db[_0xbf02('0x1cc')],{'as':'Field','foreignKey':_0xbf02('0x1b4')});db[_0xbf02('0x1cc')][_0xbf02('0x121')](db[_0xbf02('0x9c')],{'as':_0xbf02('0x9c'),'foreignKey':_0xbf02('0x1ba')});db['ChatQueueReport'][_0xbf02('0x121')](db[_0xbf02('0x66')],{});db[_0xbf02('0xd1')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xd1')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':'ContactId'});db[_0xbf02('0xd1')][_0xbf02('0x121')](db[_0xbf02('0x6b')],{});db[_0xbf02('0xd1')][_0xbf02('0x121')](db[_0xbf02('0x6d')],{});db['ChatQueueReport'][_0xbf02('0x121')](db['User'],{});db[_0xbf02('0xd1')][_0xbf02('0x121')](db[_0xbf02('0x12e')],{});db[_0xbf02('0x18d')][_0xbf02('0x121')](db['User'],{'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1ce')});db[_0xbf02('0x18d')][_0xbf02('0x121')](db['User'],{'onDelete':_0xbf02('0x10f'),'foreignKey':_0xbf02('0x1cf')});db[_0xbf02('0xd6')][_0xbf02('0x115')](db[_0xbf02('0x1d0')],{'foreignKey':_0xbf02('0x1d1'),'onDelete':'cascade'});db[_0xbf02('0xd6')][_0xbf02('0x115')](db[_0xbf02('0xd3')],{'foreignKey':_0xbf02('0x1d1'),'onDelete':_0xbf02('0x10f')});db['SmsQueueReport'][_0xbf02('0x121')](db['SmsAccount'],{});db[_0xbf02('0xd8')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xd8')][_0xbf02('0x121')](db[_0xbf02('0x75')],{'as':_0xbf02('0x161'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xbf02('0x121')](db[_0xbf02('0x11a')],{});db[_0xbf02('0xd8')][_0xbf02('0x121')](db[_0xbf02('0x177')],{});db[_0xbf02('0xd8')][_0xbf02('0x121')](db[_0xbf02('0x12')],{});db[_0xbf02('0xd8')]['belongsTo'](db[_0xbf02('0x5d')],{});db[_0xbf02('0xdc')][_0xbf02('0x115')](db[_0xbf02('0xd6')],{'foreignKey':_0xbf02('0x1d2')});db[_0xbf02('0xdc')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xbf02('0x1d2')});db[_0xbf02('0xdc')][_0xbf02('0x115')](db[_0xbf02('0xd3')],{'foreignKey':_0xbf02('0x1d2')});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':'Agents','through':_0xbf02('0x1d3')});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0x1c')],{'through':_0xbf02('0x10a'),'as':'VoiceQueues'});db[_0xbf02('0xe5')][_0xbf02('0x123')](db['MailQueue'],{'through':_0xbf02('0x15e'),'as':_0xbf02('0x1d4')});db['Team'][_0xbf02('0x123')](db[_0xbf02('0x12e')],{'through':_0xbf02('0x1d5'),'as':'ChatQueues'});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0x172')],{'through':'team_has_fax_queues','as':_0xbf02('0x130')});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0x5d')],{'through':_0xbf02('0x17b'),'as':_0xbf02('0x131')});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0x64')],{'through':'team_has_openchannel_queues','as':_0xbf02('0x132')});db[_0xbf02('0xe5')]['belongsToMany'](db['WhatsappQueue'],{'through':_0xbf02('0x1d6'),'as':_0xbf02('0x133')});db[_0xbf02('0xe5')][_0xbf02('0x123')](db[_0xbf02('0xfa')],{'through':_0xbf02('0x1d7'),'as':_0xbf02('0x12d')});db[_0xbf02('0xe9')][_0xbf02('0x115')](db['CmHopper'],{'as':_0xbf02('0x142'),'foreignKey':_0xbf02('0x196')});db[_0xbf02('0xe9')][_0xbf02('0x115')](db['CmHopperFinal'],{'as':_0xbf02('0x117'),'foreignKey':_0xbf02('0x196')});db[_0xbf02('0xe9')][_0xbf02('0x115')](db[_0xbf02('0x7c')],{'as':_0xbf02('0x1d8'),'foreignKey':_0xbf02('0x196')});db[_0xbf02('0xe9')][_0xbf02('0x115')](db[_0xbf02('0x79')],{'as':'HopperBlacks','foreignKey':_0xbf02('0x196')});db['Campaign'][_0xbf02('0x121')](db['Trunk'],{'as':_0xbf02('0x2c'),'foreignKey':'TrunkId'});db[_0xbf02('0xe9')][_0xbf02('0x121')](db[_0xbf02('0x2c')],{'as':_0xbf02('0x144'),'foreignKey':'TrunkBackupId'});db[_0xbf02('0xe9')][_0xbf02('0x121')](db['Interval'],{'as':_0xbf02('0x8c'),'foreignKey':'IntervalId'});db[_0xbf02('0xe9')][_0xbf02('0x121')](db[_0xbf02('0x1d9')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xbf02('0xe9')][_0xbf02('0x123')](db[_0xbf02('0xf9')],{'as':_0xbf02('0x1da'),'through':'campaigns_has_cm_lists'});db[_0xbf02('0xe9')]['belongsToMany'](db['CmList'],{'as':_0xbf02('0x14a'),'through':_0xbf02('0x1db')});db[_0xbf02('0xed')][_0xbf02('0x121')](db[_0xbf02('0x6e')],{'as':_0xbf02('0x6e'),'foreignKey':_0xbf02('0x167')});db[_0xbf02('0x1dc')][_0xbf02('0x121')](db[_0xbf02('0x47')],{});db['MailTransferReport'][_0xbf02('0x121')](db['MailInteraction'],{});db['MailTransferReport'][_0xbf02('0x121')](db[_0xbf02('0x3f')],{'foreignKey':_0xbf02('0x1dd'),'as':_0xbf02('0x1de')});db[_0xbf02('0x1dc')]['belongsTo'](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1df'),'as':_0xbf02('0x1e0')});db[_0xbf02('0x1dc')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1e1'),'as':_0xbf02('0x1e2')});db[_0xbf02('0x1dc')][_0xbf02('0x121')](db['MailQueue'],{'foreignKey':_0xbf02('0x1e3'),'as':_0xbf02('0x1e4')});db[_0xbf02('0x1dc')][_0xbf02('0x121')](db[_0xbf02('0x3f')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport'][_0xbf02('0x121')](db[_0xbf02('0x6d')],{});db[_0xbf02('0xf2')][_0xbf02('0x121')](db['ChatInteraction'],{});db[_0xbf02('0xf2')][_0xbf02('0x121')](db[_0xbf02('0x66')],{'foreignKey':_0xbf02('0x1e5'),'as':_0xbf02('0x1de')});db[_0xbf02('0xf2')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':'FromUserId','as':_0xbf02('0x1e0')});db[_0xbf02('0xf2')][_0xbf02('0x121')](db['User'],{'foreignKey':_0xbf02('0x1e1'),'as':_0xbf02('0x1e2')});db[_0xbf02('0xf2')][_0xbf02('0x121')](db[_0xbf02('0x12e')],{'foreignKey':_0xbf02('0x1e6'),'as':_0xbf02('0x1e4')});db['ChatTransferReport'][_0xbf02('0x121')](db[_0xbf02('0x66')],{'foreignKey':_0xbf02('0x1e7'),'as':'ToAccount'});db[_0xbf02('0xf3')][_0xbf02('0x121')](db[_0xbf02('0x55')],{});db[_0xbf02('0xf3')][_0xbf02('0x121')](db[_0xbf02('0x53')],{});db[_0xbf02('0xf3')][_0xbf02('0x121')](db['FaxAccount'],{'foreignKey':_0xbf02('0x1e8'),'as':'FromAccount'});db[_0xbf02('0xf3')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1df'),'as':'FromAgent'});db['FaxTransferReport'][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1e1'),'as':_0xbf02('0x1e2')});db[_0xbf02('0xf3')][_0xbf02('0x121')](db[_0xbf02('0x172')],{'foreignKey':'ToFaxQueueId','as':_0xbf02('0x1e4')});db[_0xbf02('0xf3')][_0xbf02('0x121')](db['FaxAccount'],{'foreignKey':_0xbf02('0x1e9'),'as':_0xbf02('0x1ea')});db[_0xbf02('0xf5')][_0xbf02('0x121')](db['OpenchannelMessage'],{});db[_0xbf02('0xf5')][_0xbf02('0x121')](db['OpenchannelInteraction'],{});db[_0xbf02('0xf5')][_0xbf02('0x121')](db[_0xbf02('0x137')],{'foreignKey':_0xbf02('0x1eb'),'as':_0xbf02('0x1de')});db['OpenchannelTransferReport'][_0xbf02('0x121')](db['User'],{'foreignKey':_0xbf02('0x1df'),'as':_0xbf02('0x1e0')});db[_0xbf02('0xf5')][_0xbf02('0x121')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xbf02('0xf5')][_0xbf02('0x121')](db[_0xbf02('0x64')],{'foreignKey':_0xbf02('0x1ec'),'as':_0xbf02('0x1e4')});db[_0xbf02('0xf5')][_0xbf02('0x121')](db[_0xbf02('0x137')],{'foreignKey':_0xbf02('0x1ed'),'as':_0xbf02('0x1ea')});db['SmsTransferReport'][_0xbf02('0x121')](db['SmsMessage'],{});db[_0xbf02('0xf7')][_0xbf02('0x121')](db['SmsInteraction'],{});db[_0xbf02('0xf7')][_0xbf02('0x121')](db['SmsAccount'],{'foreignKey':_0xbf02('0x1ee'),'as':_0xbf02('0x1de')});db[_0xbf02('0xf7')]['belongsTo'](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1df'),'as':_0xbf02('0x1e0')});db['SmsTransferReport'][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1e1'),'as':'ToAgent'});db[_0xbf02('0xf7')][_0xbf02('0x121')](db[_0xbf02('0x5d')],{'foreignKey':'ToSmsQueueId','as':_0xbf02('0x1e4')});db[_0xbf02('0xf7')][_0xbf02('0x121')](db[_0xbf02('0x59')],{'foreignKey':_0xbf02('0x1ef'),'as':_0xbf02('0x1ea')});db[_0xbf02('0xf9')][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':_0xbf02('0x169'),'foreignKey':'ListId','onDelete':_0xbf02('0x10f')});db[_0xbf02('0xf9')][_0xbf02('0x115')](db[_0xbf02('0x80')],{'as':_0xbf02('0x1f0'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xf9')][_0xbf02('0x115')](db[_0xbf02('0x75')],{'as':_0xbf02('0x125'),'onDelete':'cascade','foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xf9')][_0xbf02('0x115')](db['CmHopperFinal'],{'as':_0xbf02('0x117'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xf9')]['hasMany'](db[_0xbf02('0x7c')],{'as':_0xbf02('0x1f1'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0xf9')][_0xbf02('0x115')](db['ReportAgentPreview'],{'as':_0xbf02('0x7e'),'foreignKey':_0xbf02('0x15c')});db['CmList'][_0xbf02('0x123')](db['VoiceQueue'],{'as':_0xbf02('0x1f2'),'through':_0xbf02('0x1f3')});db[_0xbf02('0xf9')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x127')});db[_0xbf02('0xfa')][_0xbf02('0x115')](db[_0xbf02('0x18')],{'as':_0xbf02('0x1f4'),'onDelete':'cascade'});db[_0xbf02('0xfa')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x10d')});db[_0xbf02('0xfa')]['belongsToMany'](db['Team'],{'through':_0xbf02('0x1d7'),'as':'Teams'});db[_0xbf02('0xfb')][_0xbf02('0x115')](db[_0xbf02('0x12')],{'as':_0xbf02('0x165'),'foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0xbf02('0xfd')],{'as':_0xbf02('0x1f5'),'foreignKey':'userProfileId','onDelete':_0xbf02('0x10f')});db[_0xbf02('0xfd')][_0xbf02('0x115')](db[_0xbf02('0xff')],{'as':_0xbf02('0x1f6'),'foreignKey':'sectionId','onDelete':_0xbf02('0x10f')});db[_0xbf02('0x101')][_0xbf02('0x115')](db[_0xbf02('0x88')],{'as':_0xbf02('0x169'),'foreignKey':_0xbf02('0x1f7'),'onDelete':_0xbf02('0x10f')});db[_0xbf02('0x101')]['hasMany'](db[_0xbf02('0x86')],{'as':'Answers','foreignKey':_0xbf02('0x1f7')});db[_0xbf02('0x101')][_0xbf02('0x115')](db[_0xbf02('0x103')],{'as':_0xbf02('0x14b'),'foreignKey':'WhatsappAccountId'});db[_0xbf02('0x101')][_0xbf02('0x115')](db[_0xbf02('0x11e')],{'as':'Interactions'});db[_0xbf02('0x101')][_0xbf02('0x115')](db[_0xbf02('0x1f8')],{'as':_0xbf02('0x13e')});db[_0xbf02('0x101')][_0xbf02('0x121')](db[_0xbf02('0xf9')],{'as':'List','foreignKey':_0xbf02('0x15c')});db['WhatsappAccount'][_0xbf02('0x121')](db[_0xbf02('0x8e')],{'as':_0xbf02('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbf02('0x101')][_0xbf02('0x123')](db['User'],{'as':_0xbf02('0x148'),'through':_0xbf02('0x13a')});db[_0xbf02('0x1f8')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x1f8')][_0xbf02('0x121')](db[_0xbf02('0x106')],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x1f8')][_0xbf02('0x121')](db[_0xbf02('0x101')],{'onDelete':_0xbf02('0x155')});db[_0xbf02('0x1f8')][_0xbf02('0x121')](db[_0xbf02('0x8c')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x146')});db['WhatsappApplication'][_0xbf02('0x121')](db[_0xbf02('0x93')],{'onDelete':_0xbf02('0x155'),'foreignKey':_0xbf02('0x168')});db[_0xbf02('0x11e')][_0xbf02('0x115')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xbf02('0x10f'),'foreignKey':'WhatsappInteractionId'});db[_0xbf02('0x11e')]['belongsTo'](db[_0xbf02('0x101')],{'as':_0xbf02('0x160'),'foreignKey':_0xbf02('0x1f7')});db[_0xbf02('0x11e')]['belongsTo'](db['CmContact'],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x11e')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x16f'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0xbf02('0x123')](db['Tag'],{'through':_0xbf02('0x1a7'),'as':_0xbf02('0x162')});db[_0xbf02('0x11e')][_0xbf02('0x123')](db['Tag'],{'through':_0xbf02('0x1a7'),'as':_0xbf02('0x164')});db[_0xbf02('0x11e')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':'Users','through':_0xbf02('0x12b'),'foreignKey':_0xbf02('0x1f9')});db[_0xbf02('0x103')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':'User'});db[_0xbf02('0x103')][_0xbf02('0x121')](db['CmContact'],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x161')});db['WhatsappMessage'][_0xbf02('0x121')](db[_0xbf02('0x11e')],{'onDelete':_0xbf02('0x10f'),'as':_0xbf02('0x181'),'foreignKey':_0xbf02('0x1f9')});db[_0xbf02('0x103')][_0xbf02('0x121')](db['WhatsappAccount'],{'as':_0xbf02('0x160'),'foreignKey':'WhatsappAccountId'});db[_0xbf02('0x104')][_0xbf02('0x121')](db['WhatsappAccount'],{});db[_0xbf02('0x104')]['belongsTo'](db[_0xbf02('0xf9')],{'as':_0xbf02('0x15b'),'foreignKey':_0xbf02('0x15c')});db[_0xbf02('0x104')][_0xbf02('0x121')](db['CmContact'],{'as':_0xbf02('0x161'),'foreignKey':_0xbf02('0x152')});db[_0xbf02('0x104')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0xbf02('0x121')](db[_0xbf02('0x106')],{});db[_0xbf02('0x104')][_0xbf02('0x121')](db['WhatsappMessage'],{});db[_0xbf02('0x104')][_0xbf02('0x121')](db['User'],{});db[_0xbf02('0x1fa')]['belongsTo'](db[_0xbf02('0x103')],{});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db['WhatsappInteraction'],{});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db[_0xbf02('0x101')],{'foreignKey':_0xbf02('0x1fb'),'as':_0xbf02('0x1de')});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db[_0xbf02('0x101')],{'foreignKey':_0xbf02('0x1fc'),'as':_0xbf02('0x1ea')});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db['WhatsappQueue'],{'foreignKey':_0xbf02('0x1fd'),'as':_0xbf02('0x1e4')});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':_0xbf02('0x1df'),'as':_0xbf02('0x1e0')});db[_0xbf02('0x1fa')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'foreignKey':'ToUserId','as':_0xbf02('0x1e2')});db[_0xbf02('0x106')][_0xbf02('0x123')](db[_0xbf02('0x12')],{'as':_0xbf02('0x148'),'through':_0xbf02('0x134'),'foreignKey':'WhatsappQueueId'});db[_0xbf02('0x106')][_0xbf02('0x123')](db['Team'],{'through':'team_has_whatsapp_queues','as':_0xbf02('0x149')});db[_0xbf02('0x111')][_0xbf02('0x121')](db[_0xbf02('0x12')],{'as':_0xbf02('0x1fe'),'foreignKey':_0xbf02('0x110'),'onDelete':_0xbf02('0x10f'),'hooks':!![]});db[_0xbf02('0x108')]['hasOne'](db[_0xbf02('0xc9')],{'as':_0xbf02('0xc9'),'onDelete':_0xbf02('0x155')});db[_0xbf02('0x108')]['hasOne'](db[_0xbf02('0x3c')],{'as':_0xbf02('0x157'),'onDelete':_0xbf02('0x155')});db[_0xbf02('0x108')][_0xbf02('0x156')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xbf02('0x155')});module[_0xbf02('0x1ff')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 479a592..8b871be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefdf=['/api/whatsapp/reports/queue','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/action','/api/automations','./api/automation','/api/canned_answers','/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/tag','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./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/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xefdf,0x129));var _0xfefd=function(_0x1ca122,_0x5cab7c){_0x1ca122=_0x1ca122-0x0;var _0x50d1ba=_0xefdf[_0x1ca122];return _0x50d1ba;};'use strict';var path=require('path');var express=require(_0xfefd('0x0'));var errors=require(_0xfefd('0x1'));var config=require(_0xfefd('0x2'));var setupLoggers=require(_0xfefd('0x3'))[_0xfefd('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xfefd('0x5')]=function(_0x233a70){return setupLoggers(_0x233a70)['then'](function(){_0x233a70[_0xfefd('0x6')]('/api/users',require(_0xfefd('0x7')));_0x233a70['use'](_0xfefd('0x8'),require(_0xfefd('0x9')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xa'),require(_0xfefd('0xb')));_0x233a70['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x233a70['use'](_0xfefd('0xc'),require('./api/voiceMusicOnHold'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd'),require('./api/voiceQueue'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xe'),require(_0xfefd('0xf')));_0x233a70['use'](_0xfefd('0x10'),require('./api/screenRecording'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x11'),require('./api/voiceMail'));_0x233a70['use']('/api/voice/mails/messages',require(_0xfefd('0x12')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x13'),require(_0xfefd('0x14')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x15'),require(_0xfefd('0x16')));_0x233a70['use']('/api/voice/agents/reports',require(_0xfefd('0x17')));_0x233a70['use'](_0xfefd('0x18'),require('./api/voiceQueueReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x19'),require(_0xfefd('0x1a')));_0x233a70[_0xfefd('0x6')]('/api/trunks',require(_0xfefd('0x1b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x1c'),require(_0xfefd('0x1d')));_0x233a70[_0xfefd('0x6')]('/api/mail/out_servers',require(_0xfefd('0x1e')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x1f'),require(_0xfefd('0x20')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x21'),require(_0xfefd('0x22')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x23'),require(_0xfefd('0x24')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x25'),require(_0xfefd('0x26')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x27'),require(_0xfefd('0x28')));_0x233a70[_0xfefd('0x6')]('/api/mail/applications',require(_0xfefd('0x29')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x2a'),require(_0xfefd('0x2b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x2c'),require(_0xfefd('0x2d')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x2e'),require(_0xfefd('0x2f')));_0x233a70['use'](_0xfefd('0x30'),require(_0xfefd('0x31')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x32'),require(_0xfefd('0x33')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x34'),require(_0xfefd('0x35')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x36'),require(_0xfefd('0x37')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x38'),require(_0xfefd('0x39')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x3a'),require('./api/faxQueueReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x3b'),require(_0xfefd('0x3c')));_0x233a70['use']('/api/sms/applications',require(_0xfefd('0x3d')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x3e'),require('./api/smsInteraction'));_0x233a70['use'](_0xfefd('0x3f'),require(_0xfefd('0x40')));_0x233a70[_0xfefd('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x41'),require(_0xfefd('0x42')));_0x233a70['use'](_0xfefd('0x43'),require('./api/openchannelApplication'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x44'),require(_0xfefd('0x45')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x46'),require('./api/openchannelMessage'));_0x233a70[_0xfefd('0x6')]('/api/openchannel/queues',require(_0xfefd('0x47')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x48'),require(_0xfefd('0x49')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x4a'),require(_0xfefd('0x4b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x4c'),require(_0xfefd('0x4d')));_0x233a70['use'](_0xfefd('0x4e'),require(_0xfefd('0x4f')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x50'),require('./api/chatMessage'));_0x233a70['use'](_0xfefd('0x51'),require(_0xfefd('0x52')));_0x233a70[_0xfefd('0x6')]('/api/chat/queues',require(_0xfefd('0x53')));_0x233a70['use'](_0xfefd('0x54'),require(_0xfefd('0x55')));_0x233a70[_0xfefd('0x6')]('/api/chat/proactive_actions',require(_0xfefd('0x56')));_0x233a70['use'](_0xfefd('0x57'),require(_0xfefd('0x58')));_0x233a70[_0xfefd('0x6')]('/api/cm/contacts',require(_0xfefd('0x59')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x5a'),require(_0xfefd('0x5b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x5c'),require(_0xfefd('0x5d')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x5e'),require(_0xfefd('0x5f')));_0x233a70['use']('/api/cm/hopper_history',require(_0xfefd('0x60')));_0x233a70[_0xfefd('0x6')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x233a70[_0xfefd('0x6')]('/api/actions',require(_0xfefd('0x61')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x62'),require(_0xfefd('0x63')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x64'),require('./api/cannedAnswer'));_0x233a70['use'](_0xfefd('0x65'),require(_0xfefd('0x66')));_0x233a70['use'](_0xfefd('0x67'),require('./api/condition'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x68'),require('./api/interval'));_0x233a70[_0xfefd('0x6')]('/api/pauses',require(_0xfefd('0x69')));_0x233a70['use'](_0xfefd('0x6a'),require('./api/cdr'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x6b'),require(_0xfefd('0x6c')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x6d'),require(_0xfefd('0x6e')));_0x233a70['use'](_0xfefd('0x6f'),require(_0xfefd('0x70')));_0x233a70[_0xfefd('0x6')]('/api/tags',require(_0xfefd('0x71')));_0x233a70[_0xfefd('0x6')]('/api/contact_item_types',require('./api/contactItemType'));_0x233a70[_0xfefd('0x6')]('/api/cm_contact_has_items',require(_0xfefd('0x72')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x73'),require(_0xfefd('0x74')));_0x233a70['use']('/api/templates',require(_0xfefd('0x75')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x76'),require('./api/trigger'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x77'),require('./api/variable'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x78'),require(_0xfefd('0x79')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x7a'),require(_0xfefd('0x7b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x7c'),require('./api/analyticCustomReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x7d'),require(_0xfefd('0x7e')));_0x233a70['use'](_0xfefd('0x7f'),require(_0xfefd('0x80')));_0x233a70['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x233a70[_0xfefd('0x6')](_0xfefd('0x81'),require(_0xfefd('0x82')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x83'),require(_0xfefd('0x84')));_0x233a70['use'](_0xfefd('0x85'),require(_0xfefd('0x86')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x87'),require(_0xfefd('0x88')));_0x233a70['use'](_0xfefd('0x89'),require(_0xfefd('0x8a')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x8b'),require('./api/intSugarcrmAccount'));_0x233a70[_0xfefd('0x6')]('/api/integrations/sugarcrm/configurations',require(_0xfefd('0x8c')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x8d'),require(_0xfefd('0x8e')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x8f'),require(_0xfefd('0x90')));_0x233a70[_0xfefd('0x6')]('/api/integrations/desk/configurations',require(_0xfefd('0x91')));_0x233a70[_0xfefd('0x6')]('/api/integrations/desk/fields',require(_0xfefd('0x92')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x93'),require(_0xfefd('0x94')));_0x233a70['use'](_0xfefd('0x95'),require(_0xfefd('0x96')));_0x233a70[_0xfefd('0x6')]('/api/integrations/zoho/fields',require(_0xfefd('0x97')));_0x233a70['use'](_0xfefd('0x98'),require(_0xfefd('0x99')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x9a'),require(_0xfefd('0x9b')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x9c'),require(_0xfefd('0x9d')));_0x233a70[_0xfefd('0x6')](_0xfefd('0x9e'),require(_0xfefd('0x9f')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xa0'),require(_0xfefd('0xa1')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xa2'),require('./api/intFreshdeskField'));_0x233a70[_0xfefd('0x6')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x233a70[_0xfefd('0x6')]('/api/integrations/vtiger/configurations',require(_0xfefd('0xa3')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xa4'),require(_0xfefd('0xa5')));_0x233a70['use'](_0xfefd('0xa6'),require(_0xfefd('0xa7')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xa8'),require('./api/intServicenowConfiguration'));_0x233a70[_0xfefd('0x6')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x233a70[_0xfefd('0x6')]('/api/integrations/dynamics365/accounts',require(_0xfefd('0xa9')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xaa'),require(_0xfefd('0xab')));_0x233a70[_0xfefd('0x6')]('/api/integrations/dynamics365/fields',require(_0xfefd('0xac')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xad'),require(_0xfefd('0xae')));_0x233a70['use'](_0xfefd('0xaf'),require('./api/intFreshsalesConfiguration'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xb0'),require(_0xfefd('0xb1')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xb2'),require('./api/network'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xb3'),require(_0xfefd('0xb4')));_0x233a70[_0xfefd('0x6')]('/api/chat/internal/messages',require(_0xfefd('0xb5')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xb6'),require(_0xfefd('0xb7')));_0x233a70[_0xfefd('0x6')]('/api/jscripty/questions/reports',require(_0xfefd('0xb8')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xb9'),require('./api/jscriptySessionReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xba'),require(_0xfefd('0xbb')));_0x233a70[_0xfefd('0x6')]('/api/square/reports',require('./api/squareReport'));_0x233a70['use'](_0xfefd('0xbc'),require(_0xfefd('0xbd')));_0x233a70[_0xfefd('0x6')]('/api/jscripty/projects',require(_0xfefd('0xbe')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xbf'),require('./api/setting'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xc0'),require(_0xfefd('0xc1')));_0x233a70['use']('/api/square/projects',require(_0xfefd('0xc2')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xc3'),require(_0xfefd('0xc4')));_0x233a70['use'](_0xfefd('0xc5'),require(_0xfefd('0xc6')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xc7'),require(_0xfefd('0xc8')));_0x233a70['use'](_0xfefd('0xc9'),require(_0xfefd('0xca')));_0x233a70['use'](_0xfefd('0xcb'),require('./api/campaign'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xcc'),require(_0xfefd('0xcd')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xce'),require('./api/attachment'));_0x233a70[_0xfefd('0x6')]('/api/plugins',require(_0xfefd('0xcf')));_0x233a70['use'](_0xfefd('0xd0'),require('./api/mailTransferReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd1'),require('./api/chatTransferReport'));_0x233a70['use'](_0xfefd('0xd2'),require('./api/faxTransferReport'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd3'),require('./api/openchannelTransferReport'));_0x233a70[_0xfefd('0x6')]('/api/sms/reports/transfer',require(_0xfefd('0xd4')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd5'),require('./api/cmList'));_0x233a70['use'](_0xfefd('0xd6'),require('./api/voicePrefix'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd7'),require(_0xfefd('0xd8')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xd9'),require(_0xfefd('0xda')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xdb'),require(_0xfefd('0xdc')));_0x233a70['use'](_0xfefd('0xdd'),require(_0xfefd('0xde')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xdf'),require('./api/whatsappAccount'));_0x233a70['use'](_0xfefd('0xe0'),require(_0xfefd('0xe1')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xe2'),require(_0xfefd('0xe3')));_0x233a70[_0xfefd('0x6')]('/api/whatsapp/messages',require(_0xfefd('0xe4')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xe5'),require('./api/whatsappQueueReport'));_0x233a70[_0xfefd('0x6')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x233a70['use']('/api/whatsapp/queues',require(_0xfefd('0xe6')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xe7'),require(_0xfefd('0xe8')));_0x233a70['use'](_0xfefd('0xe9'),require(_0xfefd('0xea')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xeb'),require('./api/user-setting'));_0x233a70['use'](_0xfefd('0xec'),require(_0xfefd('0xed')));_0x233a70[_0xfefd('0x6')]('/api/auth/google',require(_0xfefd('0xee')));_0x233a70['use'](_0xfefd('0xef'),require('./api/authActiveDirectory'));_0x233a70[_0xfefd('0x6')](_0xfefd('0xf0'),require(_0xfefd('0xf1')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xf2'),require(_0xfefd('0xf3')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xf4'),require(_0xfefd('0xf5')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xf6'),require(_0xfefd('0xf7')));_0x233a70[_0xfefd('0x6')]('/api/pm2',require(_0xfefd('0xf8')));_0x233a70[_0xfefd('0x6')]('/api/webbar',require(_0xfefd('0xf9')));_0x233a70[_0xfefd('0x6')](_0xfefd('0xfa'),clientSideLogs);_0x233a70[_0xfefd('0x6')](_0xfefd('0xfb'),express[_0xfefd('0xfc')](path[_0xfefd('0xfd')](config[_0xfefd('0xfe')],_0xfefd('0xfb'))));_0x233a70[_0xfefd('0x6')](_0xfefd('0xff'),express[_0xfefd('0xfc')](path[_0xfefd('0xfd')](config[_0xfefd('0xfe')],_0xfefd('0xff'))));_0x233a70[_0xfefd('0x6')](_0xfefd('0x100'),express[_0xfefd('0xfc')](path[_0xfefd('0xfd')](config[_0xfefd('0xfe')],_0xfefd('0x100'))));_0x233a70[_0xfefd('0x6')]('/snippet',express[_0xfefd('0xfc')](path[_0xfefd('0xfd')](config[_0xfefd('0xfe')],'snippet',_0xfefd('0x101'))));_0x233a70[_0xfefd('0x6')](_0xfefd('0x102'),express[_0xfefd('0xfc')](path[_0xfefd('0xfd')](config[_0xfefd('0xfe')],_0xfefd('0x103'))));_0x233a70[_0xfefd('0x104')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xfefd('0x105')](errors[0x194]);_0x233a70['route']('/*')[_0xfefd('0x105')](function(_0x51873e,_0x2293d0){_0x2293d0[_0xfefd('0x106')](path['resolve'](_0x233a70['get']('appPath')+'/index.html'));});return _0x233a70;});};
\ No newline at end of file
+var _0x8368=['/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/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/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/snippet','3.0.0','/plugins','/server/files/plugins','get','route','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./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/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intFreshsalesAccount'];(function(_0x48eae6,_0x3051cc){var _0x17d8c2=function(_0x2d0669){while(--_0x2d0669){_0x48eae6['push'](_0x48eae6['shift']());}};_0x17d8c2(++_0x3051cc);}(_0x8368,0x66));var _0x8836=function(_0x51a1ae,_0x1c2023){_0x51a1ae=_0x51a1ae-0x0;var _0x2d7a2d=_0x8368[_0x51a1ae];return _0x2d7a2d;};'use strict';var path=require(_0x8836('0x0'));var express=require(_0x8836('0x1'));var errors=require(_0x8836('0x2'));var config=require(_0x8836('0x3'));var setupLoggers=require(_0x8836('0x4'))[_0x8836('0x5')];var clientSideLogs=require(_0x8836('0x6'));exports[_0x8836('0x7')]=function(_0x50a3b6){return setupLoggers(_0x50a3b6)[_0x8836('0x8')](function(){_0x50a3b6['use'](_0x8836('0x9'),require('./api/user'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb'),require(_0x8836('0xc')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd'),require(_0x8836('0xe')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xf'),require('./api/voiceExtension'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x10'),require(_0x8836('0x11')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x12'),require('./api/voiceQueue'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x13'),require(_0x8836('0x14')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x15'),require(_0x8836('0x16')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x17'),require(_0x8836('0x18')));_0x50a3b6[_0x8836('0xa')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x50a3b6[_0x8836('0xa')]('/api/voice/calls/reports',require(_0x8836('0x19')));_0x50a3b6[_0x8836('0xa')]('/api/voice/dials/reports',require(_0x8836('0x1a')));_0x50a3b6['use'](_0x8836('0x1b'),require(_0x8836('0x1c')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x1d'),require('./api/voiceQueueReport'));_0x50a3b6['use']('/api/members/reports',require(_0x8836('0x1e')));_0x50a3b6[_0x8836('0xa')]('/api/trunks',require('./api/trunk'));_0x50a3b6[_0x8836('0xa')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x50a3b6['use'](_0x8836('0x1f'),require('./api/mailServerOut'));_0x50a3b6['use'](_0x8836('0x20'),require('./api/mailAccount'));_0x50a3b6['use'](_0x8836('0x21'),require(_0x8836('0x22')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x23'),require('./api/mailSubstatus'));_0x50a3b6[_0x8836('0xa')]('/api/mail/interactions',require(_0x8836('0x24')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x25'),require(_0x8836('0x26')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x27'),require(_0x8836('0x28')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x29'),require('./api/mailQueueReport'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x2a'),require(_0x8836('0x2b')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x2c'),require(_0x8836('0x2d')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x2e'),require(_0x8836('0x2f')));_0x50a3b6[_0x8836('0xa')]('/api/fax/applications',require(_0x8836('0x30')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x31'),require(_0x8836('0x32')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x33'),require(_0x8836('0x34')));_0x50a3b6['use']('/api/fax/queues',require(_0x8836('0x35')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x36'),require(_0x8836('0x37')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x38'),require('./api/smsAccount'));_0x50a3b6[_0x8836('0xa')]('/api/sms/applications',require('./api/smsApplication'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x39'),require(_0x8836('0x3a')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x3b'),require(_0x8836('0x3c')));_0x50a3b6[_0x8836('0xa')]('/api/sms/queues',require(_0x8836('0x3d')));_0x50a3b6['use'](_0x8836('0x3e'),require(_0x8836('0x3f')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x40'),require('./api/openchannelApplication'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x41'),require(_0x8836('0x42')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x43'),require(_0x8836('0x44')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x45'),require(_0x8836('0x46')));_0x50a3b6['use'](_0x8836('0x47'),require(_0x8836('0x48')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x49'),require(_0x8836('0x4a')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x4b'),require(_0x8836('0x4c')));_0x50a3b6['use'](_0x8836('0x4d'),require(_0x8836('0x4e')));_0x50a3b6['use'](_0x8836('0x4f'),require(_0x8836('0x50')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x51'),require(_0x8836('0x52')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x53'),require(_0x8836('0x54')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x55'),require('./api/chatGroup'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x56'),require('./api/chatProactiveAction'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x57'),require('./api/cmCompany'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x58'),require(_0x8836('0x59')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x5a'),require('./api/cmHopper'));_0x50a3b6[_0x8836('0xa')]('/api/cm/hopper_black',require(_0x8836('0x5b')));_0x50a3b6['use'](_0x8836('0x5c'),require('./api/cmHopperFinal'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x5d'),require(_0x8836('0x5e')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x5f'),require(_0x8836('0x60')));_0x50a3b6['use'](_0x8836('0x61'),require(_0x8836('0x62')));_0x50a3b6['use']('/api/automations',require(_0x8836('0x63')));_0x50a3b6['use'](_0x8836('0x64'),require(_0x8836('0x65')));_0x50a3b6['use']('/api/dispositions',require(_0x8836('0x66')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x67'),require(_0x8836('0x68')));_0x50a3b6['use']('/api/intervals',require(_0x8836('0x69')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x6a'),require(_0x8836('0x6b')));_0x50a3b6[_0x8836('0xa')]('/api/cdr',require(_0x8836('0x6c')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x6d'),require(_0x8836('0x6e')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x6f'),require('./api/schedule'));_0x50a3b6['use'](_0x8836('0x70'),require(_0x8836('0x71')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x72'),require(_0x8836('0x73')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x74'),require(_0x8836('0x75')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x76'),require('./api/cmContactHasItem'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x77'),require('./api/cmHopperAdditionalPhone'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x78'),require('./api/template'));_0x50a3b6['use'](_0x8836('0x79'),require('./api/trigger'));_0x50a3b6[_0x8836('0xa')]('/api/variables',require(_0x8836('0x7a')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x7b'),require(_0x8836('0x7c')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x7d'),require(_0x8836('0x7e')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x7f'),require(_0x8836('0x80')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x81'),require(_0x8836('0x82')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x83'),require(_0x8836('0x84')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x85'),require(_0x8836('0x86')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x87'),require(_0x8836('0x88')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x89'),require(_0x8836('0x8a')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x8b'),require(_0x8836('0x8c')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x8d'),require(_0x8836('0x8e')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x8f'),require(_0x8836('0x90')));_0x50a3b6[_0x8836('0xa')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x50a3b6['use'](_0x8836('0x91'),require(_0x8836('0x92')));_0x50a3b6[_0x8836('0xa')]('/api/integrations/sugarcrm/fields',require(_0x8836('0x93')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x94'),require(_0x8836('0x95')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x96'),require('./api/intDeskConfiguration'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x97'),require(_0x8836('0x98')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x99'),require('./api/intZohoAccount'));_0x50a3b6[_0x8836('0xa')]('/api/integrations/zoho/configurations',require(_0x8836('0x9a')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x9b'),require(_0x8836('0x9c')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x9d'),require(_0x8836('0x9e')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x9f'),require(_0x8836('0xa0')));_0x50a3b6['use']('/api/integrations/zendesk/fields',require(_0x8836('0xa1')));_0x50a3b6[_0x8836('0xa')]('/api/integrations/freshdesk/accounts',require(_0x8836('0xa2')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xa3'),require(_0x8836('0xa4')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xa5'),require('./api/intFreshdeskField'));_0x50a3b6['use']('/api/integrations/vtiger/accounts',require(_0x8836('0xa6')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xa7'),require('./api/intVtigerConfiguration'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xa8'),require(_0x8836('0xa9')));_0x50a3b6['use'](_0x8836('0xaa'),require(_0x8836('0xab')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xac'),require(_0x8836('0xad')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xae'),require(_0x8836('0xaf')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb0'),require('./api/intDynamics365Account'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb1'),require('./api/intDynamics365Configuration'));_0x50a3b6[_0x8836('0xa')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x50a3b6[_0x8836('0xa')]('/api/integrations/freshsales/accounts',require(_0x8836('0xb2')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb3'),require(_0x8836('0xb4')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb5'),require(_0x8836('0xb6')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb7'),require(_0x8836('0xb8')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xb9'),require(_0x8836('0xba')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xbb'),require(_0x8836('0xbc')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xbd'),require(_0x8836('0xbe')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xbf'),require('./api/jscriptyQuestionReport'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xc0'),require(_0x8836('0xc1')));_0x50a3b6[_0x8836('0xa')]('/api/sms/reports/queue',require(_0x8836('0xc2')));_0x50a3b6['use'](_0x8836('0xc3'),require(_0x8836('0xc4')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xc5'),require(_0x8836('0xc6')));_0x50a3b6[_0x8836('0xa')]('/api/jscripty/projects',require(_0x8836('0xc7')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xc8'),require(_0x8836('0xc9')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xca'),require(_0x8836('0xcb')));_0x50a3b6['use'](_0x8836('0xcc'),require(_0x8836('0xcd')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xce'),require(_0x8836('0xcf')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd0'),require(_0x8836('0xd1')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd2'),require(_0x8836('0xd3')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd4'),require(_0x8836('0xd5')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd6'),require('./api/campaign'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xd7'),require(_0x8836('0xd8')));_0x50a3b6['use'](_0x8836('0xd9'),require(_0x8836('0xda')));_0x50a3b6[_0x8836('0xa')]('/api/plugins',require(_0x8836('0xdb')));_0x50a3b6[_0x8836('0xa')]('/api/mail/reports/transfer',require(_0x8836('0xdc')));_0x50a3b6[_0x8836('0xa')]('/api/chat/reports/transfer',require(_0x8836('0xdd')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xde'),require(_0x8836('0xdf')));_0x50a3b6[_0x8836('0xa')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xe0'),require(_0x8836('0xe1')));_0x50a3b6['use']('/api/cm/lists',require(_0x8836('0xe2')));_0x50a3b6[_0x8836('0xa')]('/api/voice/prefixes',require(_0x8836('0xe3')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xe4'),require('./api/userProfile'));_0x50a3b6[_0x8836('0xa')](_0x8836('0xe5'),require(_0x8836('0xe6')));_0x50a3b6['use'](_0x8836('0xe7'),require(_0x8836('0xe8')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xe9'),require(_0x8836('0xea')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xeb'),require(_0x8836('0xec')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xed'),require(_0x8836('0xee')));_0x50a3b6[_0x8836('0xa')]('/api/whatsapp/interactions',require(_0x8836('0xef')));_0x50a3b6[_0x8836('0xa')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x50a3b6['use'](_0x8836('0xf0'),require(_0x8836('0xf1')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xf2'),require(_0x8836('0xf3')));_0x50a3b6['use'](_0x8836('0xf4'),require(_0x8836('0xf5')));_0x50a3b6['use'](_0x8836('0xf6'),require(_0x8836('0xf7')));_0x50a3b6[_0x8836('0xa')](_0x8836('0xf8'),require(_0x8836('0xf9')));_0x50a3b6['use']('/api/user-settings',require(_0x8836('0xfa')));_0x50a3b6['use'](_0x8836('0xfb'),require(_0x8836('0xfc')));_0x50a3b6['use']('/api/auth/google',require(_0x8836('0xfd')));_0x50a3b6[_0x8836('0xa')]('/api/auth/activedirectory',require(_0x8836('0xfe')));_0x50a3b6[_0x8836('0xa')]('/api/jira',require(_0x8836('0xff')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x100'),require(_0x8836('0x101')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x102'),require(_0x8836('0x103')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x104'),require('./api/system'));_0x50a3b6[_0x8836('0xa')](_0x8836('0x105'),require(_0x8836('0x106')));_0x50a3b6['use'](_0x8836('0x107'),require(_0x8836('0x108')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x109'),clientSideLogs);_0x50a3b6[_0x8836('0xa')]('/apidoc',express[_0x8836('0x10a')](path[_0x8836('0x10b')](config[_0x8836('0x10c')],_0x8836('0x10d'))));_0x50a3b6[_0x8836('0xa')](_0x8836('0x10e'),express['static'](path[_0x8836('0x10b')](config['root'],_0x8836('0x10e'))));_0x50a3b6[_0x8836('0xa')]('/demo',express[_0x8836('0x10a')](path['join'](config[_0x8836('0x10c')],'/demo')));_0x50a3b6[_0x8836('0xa')](_0x8836('0x10f'),express[_0x8836('0x10a')](path[_0x8836('0x10b')](config['root'],'snippet',_0x8836('0x110'))));_0x50a3b6[_0x8836('0xa')](_0x8836('0x111'),express[_0x8836('0x10a')](path[_0x8836('0x10b')](config['root'],_0x8836('0x112'))));_0x50a3b6['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x8836('0x113')](errors[0x194]);_0x50a3b6[_0x8836('0x114')]('/*')[_0x8836('0x113')](function(_0x13d6cb,_0x22314b){_0x22314b[_0x8836('0x115')](path[_0x8836('0x116')](_0x50a3b6['get'](_0x8836('0x117'))+_0x8836('0x118')));});return _0x50a3b6;});};
\ No newline at end of file
index 451af56..f65a39e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e04=['jayson/promise','lodash','listen','../api/user/user.rpc','merge','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.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/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','log','../config/triggers','default','RPC\x20listening\x20on\x20'];(function(_0x3ee257,_0x469fc5){var _0x88b23f=function(_0x537d37){while(--_0x537d37){_0x3ee257['push'](_0x3ee257['shift']());}};_0x88b23f(++_0x469fc5);}(_0x5e04,0x130));var _0x45e0=function(_0x42c3ea,_0x2cae04){_0x42c3ea=_0x42c3ea-0x0;var _0x294a04=_0x5e04[_0x42c3ea];return _0x294a04;};'use strict';var jayson=require(_0x45e0('0x0'));var _=require(_0x45e0('0x1'));var config=require('../config/environment');exports[_0x45e0('0x2')]=function(){return new Promise(function(_0x2163e0,_0xb26375){var _0x2b7c9c={};_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x3')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/voiceExtension/voiceExtension.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/voiceQueue/voiceQueue.rpc'));_0x2b7c9c=_['merge'](_0x2b7c9c,require('../api/voiceRecording/voiceRecording.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x5')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x6')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x7')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x8')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x9')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xa')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xb')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xc')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xd')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xe')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0xf')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x10')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x11')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x12')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x13')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x14')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x15')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x16')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x17')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/faxQueue/faxQueue.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x18')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/smsAccount/smsAccount.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x19')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x1a')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x1b')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x1c')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x1d')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x1e')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x1f')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x20')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x21')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x22')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/cmContact/cmContact.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x23')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x24')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x25')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x26')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x27')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x28')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x29')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x2a')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x2b')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/trigger/trigger.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x2c')));_0x2b7c9c=_['merge'](_0x2b7c9c,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x2d')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x2e')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x2f')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x30')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x31')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x32')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x33')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x34')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x35')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x36')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require('../api/squareReport/squareReport.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x37')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x38')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x39')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3a')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3b')));_0x2b7c9c=_['merge'](_0x2b7c9c,require('../api/squareMessage/squareMessage.rpc'));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3c')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3d')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3e')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x3f')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x40')));_0x2b7c9c=_[_0x45e0('0x4')](_0x2b7c9c,require(_0x45e0('0x41')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x42')));_0x2b7c9c=_['merge'](_0x2b7c9c,require(_0x45e0('0x43')));var _0x19e35d=jayson['server'](_0x2b7c9c)[_0x45e0('0x44')]();var _0xadcde2=config[_0x45e0('0x45')][_0x45e0('0x46')]||config[_0x45e0('0x46')]+0x1;var _0x533aac=config[_0x45e0('0x45')]['ip']||'localhost';_0x19e35d['on'](_0x45e0('0x47'),function(_0x5ec728){return _0xb26375(_0x5ec728);});_0x19e35d[_0x45e0('0x2')](_0xadcde2,_0x533aac,function(){console[_0x45e0('0x48')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x533aac,_0xadcde2);require(_0x45e0('0x49'))[_0x45e0('0x4a')]();return _0x2163e0(_0x45e0('0x4b')+_0x533aac+':'+_0xadcde2);});});};
\ No newline at end of file
+var _0x2378=['../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x2378,0x64));var _0x8237=function(_0xa8b370,_0x2b77db){_0xa8b370=_0xa8b370-0x0;var _0x643e37=_0x2378[_0xa8b370];return _0x643e37;};'use strict';var jayson=require(_0x8237('0x0'));var _=require(_0x8237('0x1'));var config=require(_0x8237('0x2'));exports['listen']=function(){return new Promise(function(_0x17cbba,_0x4084ce){var _0x1b2547={};_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x4')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x5')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/voiceQueue/voiceQueue.rpc'));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x6')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x7')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x8')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x9')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0xa')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/trunk/trunk.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1b2547=_['merge'](_0x1b2547,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0xb')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0xc')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/mailQueue/mailQueue.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0xd')));_0x1b2547=_['merge'](_0x1b2547,require('../api/mailMessage/mailMessage.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0xe')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0xf')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x10')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x11')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/faxInteraction/faxInteraction.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x12')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x13')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x14')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/smsInteraction/smsInteraction.rpc'));_0x1b2547=_['merge'](_0x1b2547,require('../api/smsMessage/smsMessage.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x15')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x16')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x17')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x18')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x19')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x1a')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x1b')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x1c')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x1d')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x1e')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/cmHopper/cmHopper.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x1f')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x20')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x21')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x22')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x23')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x24')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x25')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x26')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x27')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/trigger/trigger.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/variable/variable.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x28')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x29')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x2a')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x2b')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x2c')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x2d')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x2e')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1b2547=_['merge'](_0x1b2547,require('../api/squareReport/squareReport.rpc'));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x2f')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x30')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x31')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x32')));_0x1b2547=_['merge'](_0x1b2547,require('../api/squareRecording/squareRecording.rpc'));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x33')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x34')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x35')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x36')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x37')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x38')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x39')));_0x1b2547=_[_0x8237('0x3')](_0x1b2547,require(_0x8237('0x3a')));_0x1b2547=_['merge'](_0x1b2547,require(_0x8237('0x3b')));var _0x29b4f3=jayson[_0x8237('0x3c')](_0x1b2547)[_0x8237('0x3d')]();var _0x4e99b1=config[_0x8237('0x3e')][_0x8237('0x3f')]||config[_0x8237('0x3f')]+0x1;var _0x2ccef5=config[_0x8237('0x3e')]['ip']||_0x8237('0x40');_0x29b4f3['on'](_0x8237('0x41'),function(_0x3e98bc){return _0x4084ce(_0x3e98bc);});_0x29b4f3['listen'](_0x4e99b1,_0x2ccef5,function(){console['log'](_0x8237('0x42'),_0x2ccef5,_0x4e99b1);require('../config/triggers')[_0x8237('0x43')]();return _0x17cbba('RPC\x20listening\x20on\x20'+_0x2ccef5+':'+_0x4e99b1);});});};
\ No newline at end of file
index cdf741c..1d5ee16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20b6=['wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','WAIT','exports','util','lodash','events','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','replace','indexOf','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x57f996,_0x5740ea){var _0xb47da=function(_0x3d886a){while(--_0x3d886a){_0x57f996['push'](_0x57f996['shift']());}};_0xb47da(++_0x5740ea);}(_0x20b6,0x1ab));var _0x620b=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x20b6[_0x4812e0];return _0x252e0f;};'use strict';var util=require(_0x620b('0x0'));var _=require(_0x620b('0x1'));var EventEmitter=require(_0x620b('0x2'))[_0x620b('0x3')];var AGIReply=require(_0x620b('0x4'));var AGIError=require('./error');function AGIChannel(_0x196a15){var _0x5ec738=this,_0x45ba0e=new AGIReply(),_0x4f51c9=![],_0x1f5d79={};EventEmitter[_0x620b('0x5')](_0x5ec738);_0x196a15['setEncoding'](_0x620b('0x6'));_0x196a15[_0x620b('0x7')](0x8*0x3c*0x3c*0x3e8);_0x45ba0e[_0x620b('0x8')](_0x620b('0x6'));_0x45ba0e['on'](_0x620b('0x9'),function(_0xa632b7){for(var _0x3ab396 in _0xa632b7){_0x5ec738[_0x3ab396]=_0xa632b7[_0x3ab396];}_0x5ec738[_0x620b('0xa')](_0x620b('0xb'));});_0x45ba0e['on'](_0x620b('0xc'),function(_0x18451e){if(_0x18451e[_0x620b('0xd')]()==_0x620b('0xe')){_0x5ec738[_0x620b('0xa')](_0x620b('0xe'));return;}if(_0x18451e[_0x620b('0xf')](0x0,0xb)==_0x620b('0x10')){_0x4f51c9=!![];}if(_0x4f51c9){_0x1f5d79['rx']+=_0x18451e+'\x0a';if(_0x18451e['search'](_0x620b('0x11'))!=-0x1){_0x4f51c9=![];}}else{_0x1f5d79['rx']=_0x18451e;}if(_0x4f51c9){return;}if(typeof _0x1f5d79['cb']==_0x620b('0x12')){var _0x439058=_0x1f5d79['rx'][_0x620b('0xf')](0x0,0x3),_0x5db9bf=null,_0x3b6218=null;_0x439058=parseInt(_0x439058);if(isNaN(_0x439058)){_0x1f5d79['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x439058!=0xc8){_0x1f5d79['cb'](null,{'code':_0x439058,'result':-0x1,'extra':'KO'});return;}_0x5db9bf=_0x1f5d79['rx'][_0x620b('0xf')](0x4)[_0x620b('0x13')]('result=','');if(_0x5db9bf[_0x620b('0x14')]('\x20')!=-0x1){_0x5db9bf=_0x5db9bf[_0x620b('0x15')](0x0,_0x5db9bf['indexOf']('\x20'));}if(_[_0x620b('0x16')](_0x5db9bf,'-1')){_0x5db9bf=parseInt(_0x5db9bf);}_0x3b6218=_0x1f5d79['rx']['split']('\x20');if(_0x3b6218['length']==0x3){_0x3b6218=_0x3b6218[0x2][_0x620b('0xf')](0x1,_0x3b6218[0x2][_0x620b('0x17')]-0x1);}else if(_0x3b6218['length']>0x3){var _0x10d22c=/\((.+)\)/;var _0x2d4efb=_0x1f5d79['rx'][_0x620b('0x18')](_0x10d22c);if(_0x2d4efb){_0x3b6218=_0x2d4efb[0x1];}else{_0x3b6218=null;}}else{_0x3b6218=null;}_0x1f5d79['cb'](null,{'code':_0x439058,'result':_0x5db9bf,'extra':_0x3b6218});}});_0x196a15['on'](_0x620b('0x19'),function(_0xb71dda){_0x5ec738[_0x620b('0xa')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0xb71dda[_0x620b('0x1a')]));});_0x196a15['on'](_0x620b('0x1b'),function(){_0x5ec738[_0x620b('0xa')]('close',new AGIError(_0x620b('0x1c')));});_0x196a15['on'](_0x620b('0x1d'),function(){_0x5ec738['emit'](_0x620b('0x1d'),new AGIError(_0x620b('0x1e')));_0x196a15['destroy']();});_0x196a15[_0x620b('0x1f')](_0x45ba0e);this[_0x620b('0x20')]=function(_0x20ea20,_0x5f56b7){var _0x20ea20=_0x20ea20||'',_0x5f56b7=typeof _0x5f56b7==_0x620b('0x12')?_0x5f56b7:new Function();_0x1f5d79={'tx':_0x20ea20,'rx':'','cb':_0x5f56b7};_0x196a15[_0x620b('0x21')](_0x20ea20+'\x0a');},this[_0x620b('0x1b')]=function(){_0x196a15['destroy']();};}util[_0x620b('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x620b('0x23')][_0x620b('0x24')]=function(_0x3c0059){return this[_0x620b('0x20')][_0x620b('0x25')](this,_0x3c0059);};AGIChannel[_0x620b('0x23')][_0x620b('0x26')]=function(){return this[_0x620b('0x24')](_0x620b('0x27'));};AGIChannel[_0x620b('0x23')][_0x620b('0x28')]=function(_0xc8ea12,_0x24ef70,_0xb5e59c){_0xc8ea12=_0xc8ea12===undefined?_0x620b('0x29'):_0xc8ea12;_0x24ef70=_0x24ef70===undefined?'5':_0x24ef70;_0xb5e59c=_0xb5e59c===undefined?'1':_0xb5e59c;return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x2b'),_0xc8ea12,_0x24ef70*0x3e8,_0xb5e59c));};AGIChannel[_0x620b('0x23')][_0x620b('0x2c')]=function(_0x6bd9a){_0x6bd9a=_0x6bd9a||_0x620b('0x2d');return this[_0x620b('0x24')](util[_0x620b('0x2a')]('VERBOSE\x20\x22%s\x22',_0x6bd9a));};AGIChannel[_0x620b('0x23')]['exec']=function(_0x321a82,_0x4d72a6){if(_[_0x620b('0x2e')](_0x4d72a6)){return this[_0x620b('0x24')](util['format'](_0x620b('0x2f'),_0x321a82,_0x4d72a6[_0x620b('0x30')](',')));}return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x2f'),_0x321a82,_0x4d72a6));};AGIChannel[_0x620b('0x23')]['setContext']=function(_0x620fd8){return this['sendRequest'](util[_0x620b('0x2a')]('SET\x20CONTEXT\x20%s',_0x620fd8));};AGIChannel['prototype']['setExtension']=function(_0x33ef41){return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x31'),_0x33ef41));};AGIChannel[_0x620b('0x23')]['setPriority']=function(_0x275d67){return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x32'),_0x275d67));};AGIChannel[_0x620b('0x23')]['hangup']=function(){return this[_0x620b('0x24')]('HANGUP');};AGIChannel[_0x620b('0x23')][_0x620b('0x33')]=function(_0x5c8a19,_0x2d19ba){var _0x3a8d9d=_['isBoolean'](_0x2d19ba)||_[_0x620b('0x34')](_0x2d19ba)?_0x2d19ba[_0x620b('0x35')]():_0x2d19ba;return this[_0x620b('0x24')](util[_0x620b('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5c8a19,_0x3a8d9d?_0x3a8d9d[_0x620b('0x35')]()[_0x620b('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x620b('0x23')][_0x620b('0x36')]=function(_0x374173,_0x5f2a61){return this[_0x620b('0x24')](util[_0x620b('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x374173,_0x5f2a61));};AGIChannel[_0x620b('0x23')]['sayDigits']=function(_0x4c8caf,_0x4e9348){return this['sendRequest'](util[_0x620b('0x2a')](_0x620b('0x37'),_0x4c8caf,_0x4e9348));};AGIChannel[_0x620b('0x23')][_0x620b('0x38')]=function(_0x2ec27f,_0x9fb1b7){return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x39'),_0x2ec27f,_0x9fb1b7));};AGIChannel[_0x620b('0x23')][_0x620b('0x3a')]=function(_0x48adac,_0x21c62b,_0x24e247){_0x21c62b=_0x21c62b||this['extension'];_0x24e247=_0x24e247||0x1;this['setContext'](_0x48adac);this[_0x620b('0x3b')](_0x21c62b);this['setPriority'](_0x24e247);return this['noop'](util[_0x620b('0x2a')](_0x620b('0x3c'),_0x48adac,_0x21c62b,_0x24e247));};AGIChannel[_0x620b('0x23')][_0x620b('0x3d')]=function(_0x21f9c3){return this['sendRequest'](util[_0x620b('0x2a')](_0x620b('0x3e'),_0x21f9c3));};AGIChannel[_0x620b('0x23')]['recordFile']=function(_0x2ca063,_0x5c5d4c,_0x554102,_0x43fbc1,_0x1b4663,_0x1012ac){_0x5c5d4c=_0x5c5d4c||_0x620b('0x3f');_0x554102=_0x554102||'';_0x43fbc1=_0x43fbc1===undefined?-0x1:_0x43fbc1==='-1'?-0x1:_0x43fbc1*0x3e8;_0x1b4663=_0x1b4663===undefined?'':'s='+_0x1b4663;_0x1012ac=_0x1012ac?'BEEP':'';return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x40'),_0x2ca063,_0x5c5d4c,_0x554102,_0x43fbc1,_0x1012ac,_0x1b4663));};AGIChannel[_0x620b('0x23')]['streamFile']=function(_0x2d3313,_0x2bc4ed){_0x2bc4ed=_0x2bc4ed||'';return this[_0x620b('0x24')](util[_0x620b('0x2a')](_0x620b('0x41'),_0x2d3313,_0x2bc4ed));};AGIChannel[_0x620b('0x23')]['agi']=function(_0x410f2c){return this[_0x620b('0x42')](_0x620b('0x43'),_0x410f2c);};AGIChannel[_0x620b('0x23')]['wait']=function(_0x423902){return this[_0x620b('0x42')](_0x620b('0x44'),_0x423902);};AGIChannel[_0x620b('0x23')][_0x620b('0x19')]=function(_0x103849,_0x49c8fc){this[_0x620b('0x2c')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x103849['id'],_0x103849['label'],_0x49c8fc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x620b('0x45')]=AGIChannel;
\ No newline at end of file
+var _0x7373=['VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','noop','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','label','exports','util','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','command','sync','sendRequest','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE'];(function(_0x25dbcb,_0x40eb18){var _0x329d76=function(_0x7c38ea){while(--_0x7c38ea){_0x25dbcb['push'](_0x25dbcb['shift']());}};_0x329d76(++_0x40eb18);}(_0x7373,0x1db));var _0x3737=function(_0x88d49e,_0x15a105){_0x88d49e=_0x88d49e-0x0;var _0xb274a=_0x7373[_0x88d49e];return _0xb274a;};'use strict';var util=require(_0x3737('0x0'));var _=require('lodash');var EventEmitter=require(_0x3737('0x1'))[_0x3737('0x2')];var AGIReply=require(_0x3737('0x3'));var AGIError=require(_0x3737('0x4'));function AGIChannel(_0x3ae9c8){var _0xc213fb=this,_0xda40f7=new AGIReply(),_0x4c0061=![],_0xa0d96f={};EventEmitter[_0x3737('0x5')](_0xc213fb);_0x3ae9c8['setEncoding'](_0x3737('0x6'));_0x3ae9c8[_0x3737('0x7')](0x8*0x3c*0x3c*0x3e8);_0xda40f7[_0x3737('0x8')](_0x3737('0x6'));_0xda40f7['on'](_0x3737('0x9'),function(_0x4c32cb){for(var _0x3eccf4 in _0x4c32cb){_0xc213fb[_0x3eccf4]=_0x4c32cb[_0x3eccf4];}_0xc213fb[_0x3737('0xa')]('ready');});_0xda40f7['on']('line',function(_0x531475){if(_0x531475[_0x3737('0xb')]()==_0x3737('0xc')){_0xc213fb[_0x3737('0xa')](_0x3737('0xc'));return;}if(_0x531475[_0x3737('0xd')](0x0,0xb)==_0x3737('0xe')){_0x4c0061=!![];}if(_0x4c0061){_0xa0d96f['rx']+=_0x531475+'\x0a';if(_0x531475[_0x3737('0xf')](_0x3737('0x10'))!=-0x1){_0x4c0061=![];}}else{_0xa0d96f['rx']=_0x531475;}if(_0x4c0061){return;}if(typeof _0xa0d96f['cb']==_0x3737('0x11')){var _0x1e0562=_0xa0d96f['rx'][_0x3737('0xd')](0x0,0x3),_0x4af37d=null,_0x3c80cb=null;_0x1e0562=parseInt(_0x1e0562);if(isNaN(_0x1e0562)){_0xa0d96f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1e0562!=0xc8){_0xa0d96f['cb'](null,{'code':_0x1e0562,'result':-0x1,'extra':'KO'});return;}_0x4af37d=_0xa0d96f['rx'][_0x3737('0xd')](0x4)[_0x3737('0x12')](_0x3737('0x13'),'');if(_0x4af37d[_0x3737('0x14')]('\x20')!=-0x1){_0x4af37d=_0x4af37d[_0x3737('0x15')](0x0,_0x4af37d[_0x3737('0x14')]('\x20'));}if(_[_0x3737('0x16')](_0x4af37d,'-1')){_0x4af37d=parseInt(_0x4af37d);}_0x3c80cb=_0xa0d96f['rx'][_0x3737('0x17')]('\x20');if(_0x3c80cb[_0x3737('0x18')]==0x3){_0x3c80cb=_0x3c80cb[0x2]['substring'](0x1,_0x3c80cb[0x2][_0x3737('0x18')]-0x1);}else if(_0x3c80cb[_0x3737('0x18')]>0x3){var _0x43d972=/\((.+)\)/;var _0x3ff628=_0xa0d96f['rx']['match'](_0x43d972);if(_0x3ff628){_0x3c80cb=_0x3ff628[0x1];}else{_0x3c80cb=null;}}else{_0x3c80cb=null;}_0xa0d96f['cb'](null,{'code':_0x1e0562,'result':_0x4af37d,'extra':_0x3c80cb});}});_0x3ae9c8['on'](_0x3737('0x19'),function(_0x141fbe){_0xc213fb['emit'](_0x3737('0x19'),new AGIError(_0x3737('0x1a'),_0x141fbe[_0x3737('0x1b')]));});_0x3ae9c8['on'](_0x3737('0x1c'),function(){_0xc213fb[_0x3737('0xa')](_0x3737('0x1c'),new AGIError(_0x3737('0x1d')));});_0x3ae9c8['on'](_0x3737('0x1e'),function(){_0xc213fb['emit'](_0x3737('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3ae9c8[_0x3737('0x1f')]();});_0x3ae9c8[_0x3737('0x20')](_0xda40f7);this['command']=function(_0x1e158a,_0x711877){var _0x1e158a=_0x1e158a||'',_0x711877=typeof _0x711877=='function'?_0x711877:new Function();_0xa0d96f={'tx':_0x1e158a,'rx':'','cb':_0x711877};_0x3ae9c8[_0x3737('0x21')](_0x1e158a+'\x0a');},this[_0x3737('0x1c')]=function(){_0x3ae9c8[_0x3737('0x1f')]();};}util[_0x3737('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x3737('0x23')]['sendRequest']=function(_0xd86d66){return this[_0x3737('0x24')][_0x3737('0x25')](this,_0xd86d66);};AGIChannel[_0x3737('0x23')]['answer']=function(){return this[_0x3737('0x26')](_0x3737('0x27'));};AGIChannel[_0x3737('0x23')]['getData']=function(_0x2173cd,_0x5e96f4,_0x47b19f){_0x2173cd=_0x2173cd===undefined?'beep':_0x2173cd;_0x5e96f4=_0x5e96f4===undefined?'5':_0x5e96f4;_0x47b19f=_0x47b19f===undefined?'1':_0x47b19f;return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x29'),_0x2173cd,_0x5e96f4*0x3e8,_0x47b19f));};AGIChannel[_0x3737('0x23')]['noop']=function(_0x1062b9){_0x1062b9=_0x1062b9||_0x3737('0x2a');return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x2b'),_0x1062b9));};AGIChannel['prototype'][_0x3737('0x2c')]=function(_0x1a3c68,_0x1ba6fa){if(_[_0x3737('0x2d')](_0x1ba6fa)){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x2e'),_0x1a3c68,_0x1ba6fa[_0x3737('0x2f')](',')));}return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x2e'),_0x1a3c68,_0x1ba6fa));};AGIChannel[_0x3737('0x23')][_0x3737('0x30')]=function(_0x18343a){return this[_0x3737('0x26')](util['format']('SET\x20CONTEXT\x20%s',_0x18343a));};AGIChannel[_0x3737('0x23')][_0x3737('0x31')]=function(_0x87e3a8){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x32'),_0x87e3a8));};AGIChannel[_0x3737('0x23')]['setPriority']=function(_0x32e4a7){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x33'),_0x32e4a7));};AGIChannel[_0x3737('0x23')][_0x3737('0xc')]=function(){return this[_0x3737('0x26')]('HANGUP');};AGIChannel[_0x3737('0x23')]['setVariable']=function(_0x2a19fe,_0xc94f9f){var _0x2a2510=_[_0x3737('0x34')](_0xc94f9f)||_[_0x3737('0x35')](_0xc94f9f)?_0xc94f9f['toString']():_0xc94f9f;return this[_0x3737('0x26')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x2a19fe,_0x2a2510?_0x2a2510[_0x3737('0x36')]()[_0x3737('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x3737('0x37')]=function(_0x332c80,_0x480fda){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x38'),_0x332c80,_0x480fda));};AGIChannel['prototype']['sayDigits']=function(_0x237fcc,_0x12edde){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x39'),_0x237fcc,_0x12edde));};AGIChannel[_0x3737('0x23')]['sayPhonetic']=function(_0x1d255f,_0x7496d6){return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x3a'),_0x1d255f,_0x7496d6));};AGIChannel[_0x3737('0x23')][_0x3737('0x3b')]=function(_0x27c5f1,_0x543afa,_0x3cae14){_0x543afa=_0x543afa||this[_0x3737('0x3c')];_0x3cae14=_0x3cae14||0x1;this[_0x3737('0x30')](_0x27c5f1);this['setExtension'](_0x543afa);this[_0x3737('0x3d')](_0x3cae14);return this[_0x3737('0x3e')](util[_0x3737('0x28')](_0x3737('0x3f'),_0x27c5f1,_0x543afa,_0x3cae14));};AGIChannel[_0x3737('0x23')]['getVariable']=function(_0x56e6ef){return this[_0x3737('0x26')](util[_0x3737('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x56e6ef));};AGIChannel['prototype'][_0x3737('0x40')]=function(_0xf5921c,_0x975105,_0x48ff38,_0x147717,_0x3c92f9,_0x577178){_0x975105=_0x975105||_0x3737('0x41');_0x48ff38=_0x48ff38||'';_0x147717=_0x147717===undefined?-0x1:_0x147717==='-1'?-0x1:_0x147717*0x3e8;_0x3c92f9=_0x3c92f9===undefined?'':'s='+_0x3c92f9;_0x577178=_0x577178?_0x3737('0x42'):'';return this[_0x3737('0x26')](util[_0x3737('0x28')](_0x3737('0x43'),_0xf5921c,_0x975105,_0x48ff38,_0x147717,_0x577178,_0x3c92f9));};AGIChannel['prototype'][_0x3737('0x44')]=function(_0x23cbc8,_0x47ed7f){_0x47ed7f=_0x47ed7f||'';return this[_0x3737('0x26')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x23cbc8,_0x47ed7f));};AGIChannel[_0x3737('0x23')]['agi']=function(_0x271d39){return this[_0x3737('0x2c')](_0x3737('0x45'),_0x271d39);};AGIChannel[_0x3737('0x23')][_0x3737('0x46')]=function(_0xea42df){return this['exec'](_0x3737('0x47'),_0xea42df);};AGIChannel[_0x3737('0x23')][_0x3737('0x19')]=function(_0x171390,_0x364d6a){this['noop'](util[_0x3737('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x171390['id'],_0x171390[_0x3737('0x48')],_0x364d6a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3737('0x49')]=AGIChannel;
\ No newline at end of file
index c8871c8..1e886e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x617a=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x4d6dbb,_0x111b6c){var _0x134097=function(_0x2d57e4){while(--_0x2d57e4){_0x4d6dbb['push'](_0x4d6dbb['shift']());}};_0x134097(++_0x111b6c);}(_0x617a,0xbc));var _0xa617=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x617a[_0x1bc0ae];return _0x501104;};'use strict';var util=require(_0xa617('0x0'));var error={'E_AGI_UNDEFINED':_0xa617('0x1'),'E_AGI_ARGUMENT_PORT':_0xa617('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xa617('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa617('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xa617('0x5'),'E_AGI_SOCKET_ERROR':_0xa617('0x6'),'E_AGI_SOCKET_CLOSE':_0xa617('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xa617('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa617('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x410d4){var _0x410d4=_0x410d4||null,_0x57743d=_0x57743d||[],_0x2fe51b=0x1,_0x51342b='';if(!error[_0x410d4]){_0x410d4='E_AGI_UNDEFINED';}_0x57743d['push'](error[_0x410d4]);while(arguments[_0x2fe51b]){_0x57743d[_0xa617('0xa')](arguments[_0x2fe51b]);_0x2fe51b++;}_0x51342b=util[_0xa617('0xb')][_0xa617('0xc')](util,_0x57743d);this['message']=_0x51342b;this['name']=_0x410d4;}module[_0xa617('0xd')]=AGIError;
\ No newline at end of file
+var _0x44a3=['format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x4cc5c3,_0x15f2c3){var _0x34aa0d=function(_0xedd7d2){while(--_0xedd7d2){_0x4cc5c3['push'](_0x4cc5c3['shift']());}};_0x34aa0d(++_0x15f2c3);}(_0x44a3,0x8c));var _0x344a=function(_0x327f41,_0x5c3672){_0x327f41=_0x327f41-0x0;var _0x3ffdae=_0x44a3[_0x327f41];return _0x3ffdae;};'use strict';var util=require(_0x344a('0x0'));var error={'E_AGI_UNDEFINED':_0x344a('0x1'),'E_AGI_ARGUMENT_PORT':_0x344a('0x2'),'E_AGI_SERVER_ERROR':_0x344a('0x3'),'E_AGI_SERVER_CLOSE':_0x344a('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x344a('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x344a('0x6'),'E_AGI_SOCKET_ERROR':_0x344a('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x344a('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x344a('0x9'),'E_AGI_IVR_ENTRY':_0x344a('0xa')};function AGIError(_0x531c0f){var _0x531c0f=_0x531c0f||null,_0x4226ce=_0x4226ce||[],_0x4b0e37=0x1,_0x369c47='';if(!error[_0x531c0f]){_0x531c0f=_0x344a('0xb');}_0x4226ce[_0x344a('0xc')](error[_0x531c0f]);while(arguments[_0x4b0e37]){_0x4226ce[_0x344a('0xc')](arguments[_0x4b0e37]);_0x4b0e37++;}_0x369c47=util[_0x344a('0xd')][_0x344a('0xe')](util,_0x4226ce);this[_0x344a('0xf')]=_0x369c47;this['name']=_0x531c0f;}module[_0x344a('0x10')]=AGIError;
\ No newline at end of file
index fc683c3..04dac71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d8f=['redis','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','EventEmitter','./error','../../config/environment','defaults'];(function(_0x2dc464,_0x518b84){var _0x2eca3b=function(_0x24b78d){while(--_0x24b78d){_0x2dc464['push'](_0x2dc464['shift']());}};_0x2eca3b(++_0x518b84);}(_0x2d8f,0x7a));var _0xf2d8=function(_0x4f526c,_0x6c4dbe){_0x4f526c=_0x4f526c-0x0;var _0x38a51e=_0x2d8f[_0x4f526c];return _0x38a51e;};'use strict';var _=require(_0xf2d8('0x0'));var EventEmitter=require(_0xf2d8('0x1'))[_0xf2d8('0x2')];var Redis=require('ioredis');var AGIError=require(_0xf2d8('0x3'));var config=require(_0xf2d8('0x4'));config['redis']=_[_0xf2d8('0x5')](config[_0xf2d8('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xf2d8('0x7')](_0xf2d8('0x8'),function(_0x303c26){if(_0x303c26)return eventEmitter[_0xf2d8('0x9')](_0xf2d8('0xa'),new AGIError(_0xf2d8('0xb'),_0x303c26));});sub['on'](_0xf2d8('0xc'),function(_0x1a2356,_0x2eb236){if(_0x1a2356!==_0xf2d8('0x8'))return;try{var _0xc746f=JSON[_0xf2d8('0xd')](_0x2eb236);eventEmitter['emit'](_0xf2d8('0xe'),_0xc746f);}catch(_0x49c31a){eventEmitter[_0xf2d8('0x9')](_0xf2d8('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x49c31a));}});module[_0xf2d8('0xf')]={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0xcdae=['../../config/environment','redis','localhost','subscribe','agi','message','emit','error','exports','ioredis','./error'];(function(_0x35b0bf,_0x216f69){var _0x3c3329=function(_0x3b57ce){while(--_0x3b57ce){_0x35b0bf['push'](_0x35b0bf['shift']());}};_0x3c3329(++_0x216f69);}(_0xcdae,0x111));var _0xecda=function(_0x29dbdd,_0x225196){_0x29dbdd=_0x29dbdd-0x0;var _0x528fef=_0xcdae[_0x29dbdd];return _0x528fef;};'use strict';var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0xecda('0x0'));var AGIError=require(_0xecda('0x1'));var config=require(_0xecda('0x2'));config[_0xecda('0x3')]=_['defaults'](config[_0xecda('0x3')],{'host':_0xecda('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xecda('0x3')]);sub[_0xecda('0x5')](_0xecda('0x6'),function(_0x36d8d2){if(_0x36d8d2)return eventEmitter['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x36d8d2));});sub['on'](_0xecda('0x7'),function(_0x282e2f,_0x123744){if(_0x282e2f!=='agi')return;try{var _0x1627a8=JSON['parse'](_0x123744);eventEmitter['emit']('projectUpdate',_0x1627a8);}catch(_0x301770){eventEmitter[_0xecda('0x8')](_0xecda('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x301770));}});module[_0xecda('0xa')]={'EventEmitter':eventEmitter};
\ No newline at end of file
index 48b809e..a778b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3662=['vertices','edges','numberOfEdges','addVertex','addEdge','push','size','prototype','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getsecretdigits'];(function(_0x3e0cc1,_0xf42a9){var _0x5f0fbd=function(_0x1f5035){while(--_0x1f5035){_0x3e0cc1['push'](_0x3e0cc1['shift']());}};_0x5f0fbd(++_0xf42a9);}(_0x3662,0x1db));var _0x2366=function(_0x3818d0,_0x541a5b){_0x3818d0=_0x3818d0-0x0;var _0x34f9a8=_0x3662[_0x3818d0];return _0x34f9a8;};'use strict';var _=require(_0x2366('0x0'));var logger=require(_0x2366('0x1'))(_0x2366('0x2'));var verticesWithRetry=[_0x2366('0x3'),'getdigits',_0x2366('0x4')];var Graph=function(){this[_0x2366('0x5')]={};this[_0x2366('0x6')]={};this[_0x2366('0x7')]=0x0;};Graph['prototype'][_0x2366('0x8')]=function(_0x5ae1b6){this[_0x2366('0x5')][_0x5ae1b6['id']]=_0x5ae1b6;this[_0x2366('0x6')][_0x5ae1b6['id']]=[];};Graph['prototype'][_0x2366('0x9')]=function(_0xf0c327,_0x2b03d5,_0x5b10e1){this['edges'][_0xf0c327][_0x2366('0xa')]({'target':_0x2b03d5,'condition':_0x5b10e1});this[_0x2366('0x7')]+=0x1;};Graph['prototype'][_0x2366('0xb')]=function(){return _[_0x2366('0xb')](this[_0x2366('0x5')]);};Graph[_0x2366('0xc')][_0x2366('0xd')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x2366('0xe')]=function(_0x99b2b6){return this['vertices'][_0x99b2b6];};Graph[_0x2366('0xc')][_0x2366('0xf')]=function(_0x4215e7,_0x305af3){if(!this['vertices'][_0x4215e7]){return logger[_0x2366('0x10')](_0x2366('0x11'));}var _0x407e4d=_0x305af3(this['vertices'][_0x4215e7]);if(!_0x407e4d){return logger[_0x2366('0x10')](_0x2366('0x12'));}if(this[_0x2366('0x6')][_0x4215e7][_0x2366('0x13')]===0x0){return logger[_0x2366('0x10')](_0x2366('0x14'));}for(var _0x443c54=0x0,_0x2c5dc3=[],_0x282542=![];_0x443c54<this[_0x2366('0x6')][_0x4215e7][_0x2366('0x13')];_0x443c54+=0x1){if(this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x15')]){_0x2c5dc3=this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x15')][_0x2366('0x16')](',');for(var _0x5c3897=0x0;_0x5c3897<_0x2c5dc3[_0x2366('0x13')];_0x5c3897+=0x1){if(this[_0x2366('0x5')][_0x4215e7][_0x2366('0x17')]==='vswitch'&&_0x2c5dc3[_0x5c3897]==='-'){_0x282542=this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x18')];logger[_0x2366('0x10')](_0x2366('0x19'),_0x2c5dc3[_0x5c3897],this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x18')]);}else if(this[_0x2366('0x5')][_0x4215e7][_0x2366('0x17')]===_0x2366('0x3')&&_0x2c5dc3[_0x5c3897]==='i'){_0x282542=this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x18')];logger[_0x2366('0x10')](_0x2366('0x1a'),_0x2c5dc3[_0x5c3897],this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x18')]);}if(_0x2c5dc3[_0x5c3897]===_0x407e4d){return this[_0x2366('0xf')](this['edges'][_0x4215e7][_0x443c54][_0x2366('0x18')],_0x305af3);}}}else{return this[_0x2366('0xf')](this[_0x2366('0x6')][_0x4215e7][_0x443c54][_0x2366('0x18')],_0x305af3);}}if(_0x2c5dc3[_0x2366('0x13')]){if(this[_0x2366('0x5')][_0x4215e7][_0x2366('0x17')]===_0x2366('0x1b')){if(_0x282542){return this[_0x2366('0xf')](_0x282542,_0x305af3);}return logger[_0x2366('0x10')]('default\x20on\x20switch\x20not\x20found');}else if(_['includes'](verticesWithRetry,this[_0x2366('0x5')][_0x4215e7][_0x2366('0x17')])){if(_0x407e4d==='-'){return logger[_0x2366('0x10')](_0x2366('0x1c'));}if(_0x282542&&_0x407e4d!=='t'){return this[_0x2366('0xf')](_0x282542,_0x305af3);}return this['traverseBFS'](_0x4215e7,_0x305af3);}return logger['info']('condition\x20not\x20found');}};module[_0x2366('0x1d')]=Graph;
\ No newline at end of file
+var _0x3f22=['invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','prototype','addEdge','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','vswitch','target','default','agicommand'];(function(_0x1e019b,_0x359da8){var _0x2c3958=function(_0x3da1ba){while(--_0x3da1ba){_0x1e019b['push'](_0x1e019b['shift']());}};_0x2c3958(++_0x359da8);}(_0x3f22,0x18b));var _0x23f2=function(_0xa65012,_0x19f486){_0xa65012=_0xa65012-0x0;var _0x2e2edf=_0x3f22[_0xa65012];return _0x2e2edf;};'use strict';var _=require(_0x23f2('0x0'));var logger=require(_0x23f2('0x1'))(_0x23f2('0x2'));var verticesWithRetry=[_0x23f2('0x3'),_0x23f2('0x4'),_0x23f2('0x5')];var Graph=function(){this[_0x23f2('0x6')]={};this[_0x23f2('0x7')]={};this['numberOfEdges']=0x0;};Graph['prototype']['addVertex']=function(_0xdbd06d){this[_0x23f2('0x6')][_0xdbd06d['id']]=_0xdbd06d;this[_0x23f2('0x7')][_0xdbd06d['id']]=[];};Graph[_0x23f2('0x8')][_0x23f2('0x9')]=function(_0x2f1f96,_0x4cf017,_0x117c06){this[_0x23f2('0x7')][_0x2f1f96]['push']({'target':_0x4cf017,'condition':_0x117c06});this[_0x23f2('0xa')]+=0x1;};Graph[_0x23f2('0x8')][_0x23f2('0xb')]=function(){return _[_0x23f2('0xb')](this[_0x23f2('0x6')]);};Graph[_0x23f2('0x8')][_0x23f2('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x23f2('0x8')][_0x23f2('0xd')]=function(_0x4e4077){return this[_0x23f2('0x6')][_0x4e4077];};Graph[_0x23f2('0x8')][_0x23f2('0xe')]=function(_0x11d35a,_0x29cba7){if(!this[_0x23f2('0x6')][_0x11d35a]){return logger[_0x23f2('0xf')](_0x23f2('0x10'));}var _0x189956=_0x29cba7(this[_0x23f2('0x6')][_0x11d35a]);if(!_0x189956){return logger[_0x23f2('0xf')](_0x23f2('0x11'));}if(this[_0x23f2('0x7')][_0x11d35a][_0x23f2('0x12')]===0x0){return logger[_0x23f2('0xf')]('no\x20edge/s\x20available');}for(var _0x5a277a=0x0,_0x192047=[],_0x1bc6e1=![];_0x5a277a<this['edges'][_0x11d35a][_0x23f2('0x12')];_0x5a277a+=0x1){if(this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x13')]){_0x192047=this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x13')][_0x23f2('0x14')](',');for(var _0x5cef69=0x0;_0x5cef69<_0x192047[_0x23f2('0x12')];_0x5cef69+=0x1){if(this[_0x23f2('0x6')][_0x11d35a]['agicommand']===_0x23f2('0x15')&&_0x192047[_0x5cef69]==='-'){_0x1bc6e1=this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x16')];logger[_0x23f2('0xf')](_0x23f2('0x17'),_0x192047[_0x5cef69],this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x16')]);}else if(this[_0x23f2('0x6')][_0x11d35a][_0x23f2('0x18')]===_0x23f2('0x3')&&_0x192047[_0x5cef69]==='i'){_0x1bc6e1=this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x16')];logger[_0x23f2('0xf')](_0x23f2('0x19'),_0x192047[_0x5cef69],this['edges'][_0x11d35a][_0x5a277a][_0x23f2('0x16')]);}if(_0x192047[_0x5cef69]===_0x189956){return this[_0x23f2('0xe')](this['edges'][_0x11d35a][_0x5a277a][_0x23f2('0x16')],_0x29cba7);}}}else{return this['traverseBFS'](this[_0x23f2('0x7')][_0x11d35a][_0x5a277a][_0x23f2('0x16')],_0x29cba7);}}if(_0x192047[_0x23f2('0x12')]){if(this[_0x23f2('0x6')][_0x11d35a]['agicommand']==='vswitch'){if(_0x1bc6e1){return this[_0x23f2('0xe')](_0x1bc6e1,_0x29cba7);}return logger[_0x23f2('0xf')](_0x23f2('0x1a'));}else if(_['includes'](verticesWithRetry,this[_0x23f2('0x6')][_0x11d35a][_0x23f2('0x18')])){if(_0x189956==='-'){return logger[_0x23f2('0xf')](_0x23f2('0x1b'));}if(_0x1bc6e1&&_0x189956!=='t'){return this[_0x23f2('0xe')](_0x1bc6e1,_0x29cba7);}return this[_0x23f2('0xe')](_0x11d35a,_0x29cba7);}return logger[_0x23f2('0xf')](_0x23f2('0x1c'));}};module[_0x23f2('0x1d')]=Graph;
\ No newline at end of file
index 807317b..794b25f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeac5=['find','handleNotFound','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','close','lodash','util','../../config/environment','./rpc','./project','./events','EventEmitter','agi','defaults','127.0.0.1','projectUpdate','nextTick','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','error','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup'];(function(_0x22b568,_0x1ef41f){var _0x37b2bf=function(_0x2312b8){while(--_0x2312b8){_0x22b568['push'](_0x22b568['shift']());}};_0x37b2bf(++_0x1ef41f);}(_0xeac5,0x1d7));var _0x5eac=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xeac5[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x5eac('0x0'));var syncho=require('syncho');var util=require(_0x5eac('0x1'));var config=require(_0x5eac('0x2'));var logger=require('../../config/logger')('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x5eac('0x3'));var Project=require(_0x5eac('0x4'));var AGIEmitter=require(_0x5eac('0x5'))[_0x5eac('0x6')];var projects=[];config[_0x5eac('0x7')]=_[_0x5eac('0x8')](config[_0x5eac('0x7')],{'ip':_0x5eac('0x9'),'port':0x11dd});AGIEmitter['on'](_0x5eac('0xa'),projectUpdateHandler);function connectionHandler(_0x59a1f7){process[_0x5eac('0xb')](function(){syncho(function(){try{setChannelVariables(_0x59a1f7);agiHandler(_0x59a1f7);}catch(_0x44256b){logger['error'](_0x44256b['stack']);}});});}function projectUpdateHandler(_0x3cbd0d){try{var _0x1726e9=_['findIndex'](projects,['id',_0x3cbd0d['id']]);if(_0x1726e9>-0x1){if(_0x3cbd0d['deleted']===!![]){projects['splice'](_0x1726e9,0x1);}else{projects[_0x1726e9]=_0x3cbd0d;}}else{projects[_0x5eac('0xc')](_0x3cbd0d);}}catch(_0x9bf6ce){logger['error'](_0x9bf6ce[_0x5eac('0xd')]);}}function listeningHandler(){console[_0x5eac('0xe')](_0x5eac('0xf'),config['agi']['port']);logger[_0x5eac('0x10')](util[_0x5eac('0x11')](_0x5eac('0x12'),config['agi']['ip'],config['agi'][_0x5eac('0x13')]));}function errorHandler(_0x2f26e8){if(_0x2f26e8&&_0x2f26e8[_0x5eac('0x14')]&&_0x2f26e8[_0x5eac('0x15')]){logger[_0x5eac('0x16')](util[_0x5eac('0x11')](_0x5eac('0x17'),_0x2f26e8['name'],_0x2f26e8[_0x5eac('0x15')]));}else{logger['error'](util[_0x5eac('0x11')](_0x5eac('0x18'),_0x2f26e8[_0x5eac('0xd')]));}}function closeHandler(){logger[_0x5eac('0x10')](util['format'](_0x5eac('0x19'),this[_0x5eac('0x1a')],this['calleridname'],this['callerid'],this['dnid'],this[_0x5eac('0x1b')]));try{createSquareReport(this);}catch(_0x13bd41){logger[_0x5eac('0x16')](_0x13bd41[_0x5eac('0xd')]);}}function timeoutHandler(){logger['info'](util[_0x5eac('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x5eac('0x1a')],this['calleridname'],this[_0x5eac('0x1c')],this[_0x5eac('0x1d')],this[_0x5eac('0x1b')]));}function hangupHandler(){logger[_0x5eac('0x10')](util['format'](_0x5eac('0x1e'),this[_0x5eac('0x1a')],this['calleridname'],this[_0x5eac('0x1c')],this[_0x5eac('0x1d')],this[_0x5eac('0x1b')]));this[_0x5eac('0x1f')]=!![];}function createSquareReport(_0x2fa9c9,_0x113e5a){rpc[_0x5eac('0x20')](_0x2fa9c9)[_0x5eac('0x21')](function(_0x382e50){if(_0x113e5a){_0x113e5a(null,_0x382e50);}})['catch'](function(_0x592d6c){if(_0x113e5a){_0x113e5a(null,_0x592d6c);}});}function setChannelVariables(_0x5a22e4){for(var _0x3755e9 in _0x5a22e4){if(_0x5a22e4[_0x5eac('0x22')](_0x3755e9)){if(_0x3755e9[_0x5eac('0x23')]('agi_')===0x0){_0x5a22e4[_0x3755e9['substring'](0x4)]=_0x5a22e4[_0x3755e9];delete _0x5a22e4[_0x3755e9];}}}}function agiHandler(_0x1bcdb2){logger[_0x5eac('0x24')](_0x5eac('0x25'),JSON[_0x5eac('0x26')](_0x1bcdb2,null,0x2));logger[_0x5eac('0x10')](util[_0x5eac('0x11')](_0x5eac('0x27'),_0x1bcdb2[_0x5eac('0x1a')],_0x1bcdb2['calleridname'],_0x1bcdb2[_0x5eac('0x1c')],_0x1bcdb2['dnid'],_0x1bcdb2['uniqueid']));_0x1bcdb2['on'](_0x5eac('0x16'),errorHandler);_0x1bcdb2['on']('close',closeHandler);_0x1bcdb2['on'](_0x5eac('0x28'),timeoutHandler);_0x1bcdb2[_0x5eac('0x1f')]=![];_0x1bcdb2['on'](_0x5eac('0x29'),hangupHandler);var _0x4d0d89=_[_0x5eac('0x2a')](projects,[_0x5eac('0x14'),_0x1bcdb2[_0x5eac('0x1a')]]);if(!_0x4d0d89)return Project[_0x5eac('0x2b')](_0x1bcdb2);if(!_0x4d0d89['production'])return Project['handleUnpublished'](_0x1bcdb2);return Project[_0x5eac('0x2c')](_0x4d0d89,_0x1bcdb2);}function main(){var _0x139760;return utilLicense[_0x5eac('0x2d')]()['then'](function(_0x113277){if(!_0x113277)return;if(_0x113277[_0x5eac('0x2e')]){if(_0x113277[_0x5eac('0x2f')]&&_0x113277[_0x5eac('0x2f')]>0x0){logger[_0x5eac('0x10')](util[_0x5eac('0x11')](_0x5eac('0x30'),_0x113277['callysquare']));_0x139760=_0x113277['callysquare'];}else{logger[_0x5eac('0x10')](_0x5eac('0x31'));}}else{logger[_0x5eac('0x10')](_0x5eac('0x32'));_0x139760=-0x1;}})[_0x5eac('0x21')](function(){return Project['getAll']();})['then'](function(_0x1e4814){projects=_0x1e4814;return;})['catch'](function(_0x3af3c2){logger['error'](_0x5eac('0x33'),_0x3af3c2[_0x5eac('0xd')]);})[_0x5eac('0x34')](function(){var _0x49bc3d=require(_0x5eac('0x35'))(config[_0x5eac('0x7')][_0x5eac('0x13')],config[_0x5eac('0x7')]['ip'],_0x139760);_0x49bc3d['on'](_0x5eac('0x16'),errorHandler);_0x49bc3d['on'](_0x5eac('0x36'),listeningHandler);_0x49bc3d['on'](_0x5eac('0x37'),connectionHandler);_0x49bc3d['on'](_0x5eac('0x38'),closeHandler);});}main();
\ No newline at end of file
+var _0x9b9b=['syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','nextTick','stack','findIndex','deleted','splice','push','log','port','format','name','message','error','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','getLicense','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b9b,0x77));var _0xb9b9=function(_0x3e0600,_0x9bb3c9){_0x3e0600=_0x3e0600-0x0;var _0x5e1117=_0x9b9b[_0x3e0600];return _0x5e1117;};'use strict';var _=require(_0xb9b9('0x0'));var syncho=require(_0xb9b9('0x1'));var util=require(_0xb9b9('0x2'));var config=require(_0xb9b9('0x3'));var logger=require(_0xb9b9('0x4'))(_0xb9b9('0x5'));var utilLicense=require(_0xb9b9('0x6'));var rpc=require(_0xb9b9('0x7'));var Project=require(_0xb9b9('0x8'));var AGIEmitter=require(_0xb9b9('0x9'))['EventEmitter'];var projects=[];config[_0xb9b9('0x5')]=_[_0xb9b9('0xa')](config[_0xb9b9('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x133f97){process[_0xb9b9('0xb')](function(){syncho(function(){try{setChannelVariables(_0x133f97);agiHandler(_0x133f97);}catch(_0x5a36b1){logger['error'](_0x5a36b1[_0xb9b9('0xc')]);}});});}function projectUpdateHandler(_0x2d38e1){try{var _0x3fd280=_[_0xb9b9('0xd')](projects,['id',_0x2d38e1['id']]);if(_0x3fd280>-0x1){if(_0x2d38e1[_0xb9b9('0xe')]===!![]){projects[_0xb9b9('0xf')](_0x3fd280,0x1);}else{projects[_0x3fd280]=_0x2d38e1;}}else{projects[_0xb9b9('0x10')](_0x2d38e1);}}catch(_0x5a5891){logger['error'](_0x5a5891[_0xb9b9('0xc')]);}}function listeningHandler(){console[_0xb9b9('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xb9b9('0x12')]);logger['info'](util[_0xb9b9('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb9b9('0x5')]['ip'],config[_0xb9b9('0x5')]['port']));}function errorHandler(_0x4dcf6d){if(_0x4dcf6d&&_0x4dcf6d[_0xb9b9('0x14')]&&_0x4dcf6d[_0xb9b9('0x15')]){logger[_0xb9b9('0x16')](util[_0xb9b9('0x13')]('[%s]\x20%s',_0x4dcf6d[_0xb9b9('0x14')],_0x4dcf6d[_0xb9b9('0x15')]));}else{logger[_0xb9b9('0x16')](util[_0xb9b9('0x13')](_0xb9b9('0x17'),_0x4dcf6d['stack']));}}function closeHandler(){logger[_0xb9b9('0x18')](util[_0xb9b9('0x13')](_0xb9b9('0x19'),this[_0xb9b9('0x1a')],this[_0xb9b9('0x1b')],this[_0xb9b9('0x1c')],this[_0xb9b9('0x1d')],this[_0xb9b9('0x1e')]));try{createSquareReport(this);}catch(_0x36abde){logger[_0xb9b9('0x16')](_0x36abde[_0xb9b9('0xc')]);}}function timeoutHandler(){logger[_0xb9b9('0x18')](util[_0xb9b9('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xb9b9('0x1a')],this[_0xb9b9('0x1b')],this['callerid'],this[_0xb9b9('0x1d')],this['uniqueid']));}function hangupHandler(){logger[_0xb9b9('0x18')](util[_0xb9b9('0x13')](_0xb9b9('0x1f'),this[_0xb9b9('0x1a')],this[_0xb9b9('0x1b')],this['callerid'],this[_0xb9b9('0x1d')],this[_0xb9b9('0x1e')]));this[_0xb9b9('0x20')]=!![];}function createSquareReport(_0x12fdf8,_0x1fa984){rpc[_0xb9b9('0x21')](_0x12fdf8)[_0xb9b9('0x22')](function(_0x2ba932){if(_0x1fa984){_0x1fa984(null,_0x2ba932);}})[_0xb9b9('0x23')](function(_0x2ab245){if(_0x1fa984){_0x1fa984(null,_0x2ab245);}});}function setChannelVariables(_0x3cc3a7){for(var _0x163f56 in _0x3cc3a7){if(_0x3cc3a7[_0xb9b9('0x24')](_0x163f56)){if(_0x163f56[_0xb9b9('0x25')](_0xb9b9('0x26'))===0x0){_0x3cc3a7[_0x163f56[_0xb9b9('0x27')](0x4)]=_0x3cc3a7[_0x163f56];delete _0x3cc3a7[_0x163f56];}}}}function agiHandler(_0x473116){logger[_0xb9b9('0x28')](_0xb9b9('0x29'),JSON[_0xb9b9('0x2a')](_0x473116,null,0x2));logger['info'](util[_0xb9b9('0x13')](_0xb9b9('0x2b'),_0x473116[_0xb9b9('0x1a')],_0x473116[_0xb9b9('0x1b')],_0x473116[_0xb9b9('0x1c')],_0x473116['dnid'],_0x473116['uniqueid']));_0x473116['on'](_0xb9b9('0x16'),errorHandler);_0x473116['on'](_0xb9b9('0x2c'),closeHandler);_0x473116['on'](_0xb9b9('0x2d'),timeoutHandler);_0x473116[_0xb9b9('0x20')]=![];_0x473116['on'](_0xb9b9('0x2e'),hangupHandler);var _0x5a7191=_[_0xb9b9('0x2f')](projects,[_0xb9b9('0x14'),_0x473116[_0xb9b9('0x1a')]]);if(!_0x5a7191)return Project[_0xb9b9('0x30')](_0x473116);if(!_0x5a7191[_0xb9b9('0x31')])return Project['handleUnpublished'](_0x473116);return Project['initialize'](_0x5a7191,_0x473116);}function main(){var _0x1bab9c;return utilLicense[_0xb9b9('0x32')]()[_0xb9b9('0x22')](function(_0x383f49){if(!_0x383f49)return;if(_0x383f49[_0xb9b9('0x33')]){if(_0x383f49[_0xb9b9('0x34')]&&_0x383f49[_0xb9b9('0x34')]>0x0){logger['info'](util[_0xb9b9('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x383f49[_0xb9b9('0x34')]));_0x1bab9c=_0x383f49[_0xb9b9('0x34')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xb9b9('0x18')](_0xb9b9('0x35'));_0x1bab9c=-0x1;}})[_0xb9b9('0x22')](function(){return Project[_0xb9b9('0x36')]();})[_0xb9b9('0x22')](function(_0xc4b519){projects=_0xc4b519;return;})[_0xb9b9('0x23')](function(_0x58ccc1){logger['error'](_0xb9b9('0x37'),_0x58ccc1[_0xb9b9('0xc')]);})[_0xb9b9('0x38')](function(){var _0x56ca82=require(_0xb9b9('0x39'))(config[_0xb9b9('0x5')]['port'],config[_0xb9b9('0x5')]['ip'],_0x1bab9c);_0x56ca82['on'](_0xb9b9('0x16'),errorHandler);_0x56ca82['on'](_0xb9b9('0x3a'),listeningHandler);_0x56ca82['on'](_0xb9b9('0x3b'),connectionHandler);_0x56ca82['on'](_0xb9b9('0x2c'),closeHandler);});}main();
\ No newline at end of file
index 0663b05..e7921b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b4f=['message','result','catch','sendMailMessage','SendMail','bluebird','http','request','then','error'];(function(_0x4c24a8,_0x2e32ea){var _0x11df9a=function(_0x2f51df){while(--_0x2f51df){_0x4c24a8['push'](_0x4c24a8['shift']());}};_0x11df9a(++_0x2e32ea);}(_0x7b4f,0x1a9));var _0xf7b4=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x7b4f[_0xf2662b];return _0x257dc7;};'use strict';var BPromise=require(_0xf7b4('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7b4('0x1')]({'port':0x232b});function request(_0x32441d,_0x11177c){return new BPromise(function(_0x9c06b1,_0x51d4bc){return client[_0xf7b4('0x2')](_0x32441d,_0x11177c)[_0xf7b4('0x3')](function(_0x1b8843){if(_0x1b8843[_0xf7b4('0x4')]){return _0x51d4bc(_0x1b8843[_0xf7b4('0x4')][_0xf7b4('0x5')]);}else{return _0x9c06b1(_0x1b8843[_0xf7b4('0x6')]);}})[_0xf7b4('0x7')](function(_0x58e38c){return _0x51d4bc(_0x58e38c);});});}exports[_0xf7b4('0x8')]=function(_0x1286c2,_0xc66049){return request(_0xf7b4('0x9'),{'account':_0x1286c2,'message':_0xc66049});};
\ No newline at end of file
+var _0xe0c2=['jayson/promise','http','error','message','catch','sendMailMessage','SendMail','bluebird'];(function(_0x147810,_0x52806d){var _0x3bc630=function(_0x4f15d9){while(--_0x4f15d9){_0x147810['push'](_0x147810['shift']());}};_0x3bc630(++_0x52806d);}(_0xe0c2,0xcf));var _0x2e0c=function(_0x361ecd,_0x32451e){_0x361ecd=_0x361ecd-0x0;var _0x31942f=_0xe0c2[_0x361ecd];return _0x31942f;};'use strict';var BPromise=require(_0x2e0c('0x0'));var jayson=require(_0x2e0c('0x1'));var client=jayson['client'][_0x2e0c('0x2')]({'port':0x232b});function request(_0x271fee,_0x27bbb3){return new BPromise(function(_0x31e0d2,_0x2745e7){return client['request'](_0x271fee,_0x27bbb3)['then'](function(_0x9b751b){if(_0x9b751b[_0x2e0c('0x3')]){return _0x2745e7(_0x9b751b['error'][_0x2e0c('0x4')]);}else{return _0x31e0d2(_0x9b751b['result']);}})[_0x2e0c('0x5')](function(_0x27f9e0){return _0x2745e7(_0x27f9e0);});});}exports[_0x2e0c('0x6')]=function(_0x2513f5,_0x30e0ba){return request(_0x2e0c('0x7'),{'account':_0x2513f5,'message':_0x30e0ba});};
\ No newline at end of file
index 3cda02f..0cf0021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a60=['info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','debug','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','toString','finally','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','lodash','util','../../config/logger','./rpc','./graph','./vertices','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','value','root','inspect','production','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4f9f40,_0x4a2409){var _0xd70c41=function(_0x5af871){while(--_0x5af871){_0x4f9f40['push'](_0x4f9f40['shift']());}};_0xd70c41(++_0x4a2409);}(_0x8a60,0x129));var _0x08a6=function(_0x368cfb,_0x571855){_0x368cfb=_0x368cfb-0x0;var _0x27e714=_0x8a60[_0x368cfb];return _0x27e714;};'use strict';var _=require(_0x08a6('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x08a6('0x1'));var logger=require(_0x08a6('0x2'))('agi');var rpc=require(_0x08a6('0x3'));var mailRpc=require('./mailRpc');var Graph=require(_0x08a6('0x4'));var Vertices=require(_0x08a6('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x31bb12){logger[_0x08a6('0x6')](_0x08a6('0x7'),_0x31bb12[_0x08a6('0x8')]);return[];});}function addVertex(_0x4b4e78,_0x1639d0,_0x48aa5e){_0x1639d0['agicommand']=_0x48aa5e;if(_0x1639d0[_0x08a6('0x9')](_0x08a6('0xa'))){_0x1639d0[_0x08a6('0xb')]=parseInt(_0x1639d0['retry'],0xa);}_0x4b4e78[_0x08a6('0xc')](_[_0x08a6('0xd')](_0x1639d0,_0x08a6('0xe')));}function initGraph(_0x16b0b7,_0x4e078a){var _0x220924=new Graph();for(var _0x30c94a in _0x16b0b7){if(_0x16b0b7[_0x08a6('0x9')](_0x30c94a)){if(_[_0x08a6('0xf')](_0x16b0b7[_0x30c94a])){for(var _0x3f4cd4=0x0;_0x3f4cd4<_0x16b0b7[_0x30c94a][_0x08a6('0x10')];_0x3f4cd4+=0x1){addVertex(_0x220924,_0x16b0b7[_0x30c94a][_0x3f4cd4],_0x30c94a);}}else{addVertex(_0x220924,_0x16b0b7[_0x30c94a],_0x30c94a);}}}for(var _0x4a033a=0x0;_0x4a033a<_0x4e078a['length'];_0x4a033a+=0x1){if(_0x4e078a[_0x4a033a]['source']&&_0x4e078a[_0x4a033a][_0x08a6('0x11')]){_0x220924['addEdge'](_0x4e078a[_0x4a033a]['source'],_0x4e078a[_0x4a033a][_0x08a6('0x11')],_0x4e078a[_0x4a033a][_0x08a6('0x12')]);}}return _0x220924;}function getRoot(_0x452d93){return parser['toJson'](_0x452d93,{'object':!![]})['mxGraphModel'][_0x08a6('0x13')];}function inspect(_0x4f98b8){return util[_0x08a6('0x14')](_0x4f98b8,{'showHidden':![],'depth':null});}function initialize(_0x5af195,_0x5b155d){var _0x6f4f06=getRoot(_0x5af195[_0x08a6('0x15')]);if(!_0x6f4f06||!_0x6f4f06[_0x08a6('0x16')])return;var _0x475a2b,_0x29e5d0,_0x526829;logger['debug'](_0x08a6('0x13'),JSON[_0x08a6('0x17')](_0x6f4f06,null,0x2));_0x5b155d[_0x08a6('0x18')]=moment()[_0x08a6('0x19')](_0x08a6('0x1a'));_0x475a2b=initGraph(_[_0x08a6('0xd')](_0x6f4f06,_0x08a6('0xe')),_0x6f4f06[_0x08a6('0xe')]);_0x29e5d0=new Vertices(_0x5b155d,rpc,mailRpc);logger[_0x08a6('0x1b')](util[_0x08a6('0x19')](_0x08a6('0x1c'),_0x5b155d['arg_1'],_0x5b155d[_0x08a6('0x1d')],_0x5b155d[_0x08a6('0x1e')],_0x5b155d[_0x08a6('0x1f')],_0x5b155d[_0x08a6('0x20')]));_0x475a2b[_0x08a6('0x21')](_0x6f4f06[_0x08a6('0x16')]['id'],function(_0x217545){try{_0x217545=_0x29e5d0[_0x08a6('0x22')](_0x217545);logger[_0x08a6('0x23')](_0x08a6('0x24'),JSON['stringify'](_0x217545,null,0x2));if(_0x217545[_0x08a6('0x25')]===_0x08a6('0x26')){logger[_0x08a6('0x1b')](_0x08a6('0x27'));_0x5b155d[_0x08a6('0x28')]=_0x217545[_0x08a6('0x28')]||_0x5b155d[_0x08a6('0x28')];_0x5b155d[_0x08a6('0x29')]=_0x217545['extension'];_0x5b155d[_0x08a6('0x2a')]=_0x217545[_0x08a6('0x2a')]?_0x217545[_0x08a6('0x2a')]-0x1:0x1;return null;}else if(_0x217545&&_0x29e5d0[_0x217545[_0x08a6('0x25')]]){_0x526829=_0x29e5d0[_0x217545[_0x08a6('0x25')]](_0x217545);logger[_0x08a6('0x1b')](_0x08a6('0x2b'),JSON[_0x08a6('0x17')](_0x526829,null,0x2));if(_0x526829&&_0x526829[_0x08a6('0x2c')]===AGI_CODE_SUCCESS&&_0x526829[_0x08a6('0x2d')]!==AGI_RESULT_ERROR&&!_0x5b155d[_0x08a6('0x2e')]){logger[_0x08a6('0x23')](_0x08a6('0x2b'),inspect(_0x526829));return _['isUndefined'](_0x526829['result'])?null:_0x526829[_0x08a6('0x2d')][_0x08a6('0x2f')]();}else{logger['error']('response',inspect(_0x526829));return null;}}else{logger[_0x08a6('0x6')]('agicommand\x20not\x20found');return null;}}catch(_0x4b35c4){logger['error'](_0x4b35c4['stack']);return null;}});if(_0x6f4f06[_0x08a6('0x30')]){logger[_0x08a6('0x1b')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b155d[_0x08a6('0x31')],_0x5b155d[_0x08a6('0x1d')],_0x5b155d[_0x08a6('0x1e')],_0x5b155d[_0x08a6('0x1f')],_0x5b155d[_0x08a6('0x20')]));_0x475a2b['traverseBFS'](_0x6f4f06[_0x08a6('0x30')]['id'],function(_0x1f67d4){try{_0x1f67d4=_0x29e5d0[_0x08a6('0x22')](_0x1f67d4);logger['debug']('vertex',JSON[_0x08a6('0x17')](_0x1f67d4,null,0x2));if(_0x1f67d4&&_0x29e5d0[_0x1f67d4['agicommand']]){_0x526829=_0x29e5d0[_0x1f67d4['agicommand']](_0x1f67d4);if(_0x526829){logger[_0x08a6('0x23')](_0x08a6('0x2b'),inspect(_0x526829));return _['isUndefined'](_0x526829['result'])?null:_0x526829[_0x08a6('0x2d')][_0x08a6('0x2f')]();}else{logger[_0x08a6('0x6')](_0x08a6('0x2b'),inspect(_0x526829));return null;}}else{logger[_0x08a6('0x6')]('agicommand\x20not\x20found');return null;}}catch(_0x47b585){logger['error'](_0x47b585[_0x08a6('0x8')]);return null;}});}logger[_0x08a6('0x1b')](util[_0x08a6('0x19')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b155d[_0x08a6('0x31')],_0x5b155d[_0x08a6('0x1d')],_0x5b155d[_0x08a6('0x1e')],_0x5b155d['dnid'],_0x5b155d[_0x08a6('0x20')]));logger[_0x08a6('0x1b')](util['format'](_0x08a6('0x32'),_0x5b155d['context'],_0x5b155d['extension'],parseInt(_0x5b155d[_0x08a6('0x2a')],0xa)+0x1));_0x5b155d[_0x08a6('0x33')](_0x5b155d[_0x08a6('0x28')],_0x5b155d[_0x08a6('0x29')],parseInt(_0x5b155d['priority'],0xa)+0x1);_0x5b155d[_0x08a6('0x34')]();}function handleNotFound(_0x574c20){logger[_0x08a6('0x6')](util[_0x08a6('0x19')](_0x08a6('0x35'),_0x574c20[_0x08a6('0x31')]));_0x574c20[_0x08a6('0x33')](_0x574c20[_0x08a6('0x28')],_0x574c20[_0x08a6('0x29')],parseInt(_0x574c20['priority'],0xa)+0x1);_0x574c20[_0x08a6('0x34')]();}function handleUnpublished(_0x3476b8){logger[_0x08a6('0x6')](util[_0x08a6('0x19')]('Project\x20%s\x20not\x20published',_0x3476b8['arg_1']));_0x3476b8['continueAt'](_0x3476b8['context'],_0x3476b8['extension'],parseInt(_0x3476b8[_0x08a6('0x2a')],0xa)+0x1);_0x3476b8[_0x08a6('0x34')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x5f73=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','exports','lodash','xml2json','util','./graph','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','inspect','start','debug','root','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','stringify','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','toString'];(function(_0x4f5327,_0x3f9e5d){var _0x37a5c7=function(_0x81bb58){while(--_0x81bb58){_0x4f5327['push'](_0x4f5327['shift']());}};_0x37a5c7(++_0x3f9e5d);}(_0x5f73,0x19b));var _0x35f7=function(_0x31deba,_0x47afbc){_0x31deba=_0x31deba-0x0;var _0x56cb65=_0x5f73[_0x31deba];return _0x56cb65;};'use strict';var _=require(_0x35f7('0x0'));var moment=require('moment');var parser=require(_0x35f7('0x1'));var util=require(_0x35f7('0x2'));var logger=require('../../config/logger')('agi');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x35f7('0x3'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x4f0a38){logger[_0x35f7('0x4')](_0x35f7('0x5'),_0x4f0a38['stack']);return[];});}function addVertex(_0x3ddf3a,_0x3c9eb5,_0x20949b){_0x3c9eb5[_0x35f7('0x6')]=_0x20949b;if(_0x3c9eb5[_0x35f7('0x7')](_0x35f7('0x8'))){_0x3c9eb5['maxRetry']=parseInt(_0x3c9eb5[_0x35f7('0x8')],0xa);}_0x3ddf3a[_0x35f7('0x9')](_[_0x35f7('0xa')](_0x3c9eb5,_0x35f7('0xb')));}function initGraph(_0x43544a,_0x5f0c50){var _0x2c40ef=new Graph();for(var _0x4e8b5c in _0x43544a){if(_0x43544a[_0x35f7('0x7')](_0x4e8b5c)){if(_[_0x35f7('0xc')](_0x43544a[_0x4e8b5c])){for(var _0x12cbd4=0x0;_0x12cbd4<_0x43544a[_0x4e8b5c][_0x35f7('0xd')];_0x12cbd4+=0x1){addVertex(_0x2c40ef,_0x43544a[_0x4e8b5c][_0x12cbd4],_0x4e8b5c);}}else{addVertex(_0x2c40ef,_0x43544a[_0x4e8b5c],_0x4e8b5c);}}}for(var _0x51e3f8=0x0;_0x51e3f8<_0x5f0c50[_0x35f7('0xd')];_0x51e3f8+=0x1){if(_0x5f0c50[_0x51e3f8][_0x35f7('0xe')]&&_0x5f0c50[_0x51e3f8][_0x35f7('0xf')]){_0x2c40ef[_0x35f7('0x10')](_0x5f0c50[_0x51e3f8][_0x35f7('0xe')],_0x5f0c50[_0x51e3f8][_0x35f7('0xf')],_0x5f0c50[_0x51e3f8][_0x35f7('0x11')]);}}return _0x2c40ef;}function getRoot(_0x246ee2){return parser[_0x35f7('0x12')](_0x246ee2,{'object':!![]})[_0x35f7('0x13')]['root'];}function inspect(_0x148457){return util[_0x35f7('0x14')](_0x148457,{'showHidden':![],'depth':null});}function initialize(_0x2737d4,_0x1b2423){var _0xfb8bb4=getRoot(_0x2737d4['production']);if(!_0xfb8bb4||!_0xfb8bb4[_0x35f7('0x15')])return;var _0x4e84c0,_0x16f29f,_0x2e667a;logger[_0x35f7('0x16')](_0x35f7('0x17'),JSON['stringify'](_0xfb8bb4,null,0x2));_0x1b2423[_0x35f7('0x18')]=moment()[_0x35f7('0x19')](_0x35f7('0x1a'));_0x4e84c0=initGraph(_[_0x35f7('0xa')](_0xfb8bb4,'mxCell'),_0xfb8bb4[_0x35f7('0xb')]);_0x16f29f=new Vertices(_0x1b2423,rpc,mailRpc);logger[_0x35f7('0x1b')](util[_0x35f7('0x19')](_0x35f7('0x1c'),_0x1b2423[_0x35f7('0x1d')],_0x1b2423[_0x35f7('0x1e')],_0x1b2423['callerid'],_0x1b2423['dnid'],_0x1b2423[_0x35f7('0x1f')]));_0x4e84c0[_0x35f7('0x20')](_0xfb8bb4[_0x35f7('0x15')]['id'],function(_0x3e61dc){try{_0x3e61dc=_0x16f29f[_0x35f7('0x21')](_0x3e61dc);logger['debug'](_0x35f7('0x22'),JSON['stringify'](_0x3e61dc,null,0x2));if(_0x3e61dc[_0x35f7('0x6')]===_0x35f7('0x23')){logger[_0x35f7('0x1b')](_0x35f7('0x24'));_0x1b2423[_0x35f7('0x25')]=_0x3e61dc[_0x35f7('0x25')]||_0x1b2423[_0x35f7('0x25')];_0x1b2423['extension']=_0x3e61dc[_0x35f7('0x26')];_0x1b2423[_0x35f7('0x27')]=_0x3e61dc[_0x35f7('0x27')]?_0x3e61dc[_0x35f7('0x27')]-0x1:0x1;return null;}else if(_0x3e61dc&&_0x16f29f[_0x3e61dc[_0x35f7('0x6')]]){_0x2e667a=_0x16f29f[_0x3e61dc[_0x35f7('0x6')]](_0x3e61dc);logger['info'](_0x35f7('0x28'),JSON[_0x35f7('0x29')](_0x2e667a,null,0x2));if(_0x2e667a&&_0x2e667a[_0x35f7('0x2a')]===AGI_CODE_SUCCESS&&_0x2e667a[_0x35f7('0x2b')]!==AGI_RESULT_ERROR&&!_0x1b2423[_0x35f7('0x2c')]){logger[_0x35f7('0x16')](_0x35f7('0x28'),inspect(_0x2e667a));return _[_0x35f7('0x2d')](_0x2e667a[_0x35f7('0x2b')])?null:_0x2e667a['result']['toString']();}else{logger[_0x35f7('0x4')](_0x35f7('0x28'),inspect(_0x2e667a));return null;}}else{logger[_0x35f7('0x4')](_0x35f7('0x2e'));return null;}}catch(_0x1e57ee){logger[_0x35f7('0x4')](_0x1e57ee[_0x35f7('0x2f')]);return null;}});if(_0xfb8bb4[_0x35f7('0x30')]){logger[_0x35f7('0x1b')](util[_0x35f7('0x19')](_0x35f7('0x31'),_0x1b2423[_0x35f7('0x1d')],_0x1b2423[_0x35f7('0x1e')],_0x1b2423[_0x35f7('0x32')],_0x1b2423[_0x35f7('0x33')],_0x1b2423[_0x35f7('0x1f')]));_0x4e84c0['traverseBFS'](_0xfb8bb4['finally']['id'],function(_0xdfd3d){try{_0xdfd3d=_0x16f29f['clear'](_0xdfd3d);logger[_0x35f7('0x16')](_0x35f7('0x22'),JSON[_0x35f7('0x29')](_0xdfd3d,null,0x2));if(_0xdfd3d&&_0x16f29f[_0xdfd3d[_0x35f7('0x6')]]){_0x2e667a=_0x16f29f[_0xdfd3d[_0x35f7('0x6')]](_0xdfd3d);if(_0x2e667a){logger[_0x35f7('0x16')](_0x35f7('0x28'),inspect(_0x2e667a));return _['isUndefined'](_0x2e667a[_0x35f7('0x2b')])?null:_0x2e667a[_0x35f7('0x2b')][_0x35f7('0x34')]();}else{logger[_0x35f7('0x4')]('response',inspect(_0x2e667a));return null;}}else{logger[_0x35f7('0x4')]('agicommand\x20not\x20found');return null;}}catch(_0x3f11ce){logger['error'](_0x3f11ce[_0x35f7('0x2f')]);return null;}});}logger[_0x35f7('0x1b')](util[_0x35f7('0x19')](_0x35f7('0x35'),_0x1b2423[_0x35f7('0x1d')],_0x1b2423[_0x35f7('0x1e')],_0x1b2423[_0x35f7('0x32')],_0x1b2423[_0x35f7('0x33')],_0x1b2423[_0x35f7('0x1f')]));logger[_0x35f7('0x1b')](util[_0x35f7('0x19')](_0x35f7('0x36'),_0x1b2423[_0x35f7('0x25')],_0x1b2423[_0x35f7('0x26')],parseInt(_0x1b2423[_0x35f7('0x27')],0xa)+0x1));_0x1b2423[_0x35f7('0x37')](_0x1b2423[_0x35f7('0x25')],_0x1b2423['extension'],parseInt(_0x1b2423['priority'],0xa)+0x1);_0x1b2423['close']();}function handleNotFound(_0x3b3610){logger['error'](util[_0x35f7('0x19')](_0x35f7('0x38'),_0x3b3610['arg_1']));_0x3b3610[_0x35f7('0x37')](_0x3b3610['context'],_0x3b3610['extension'],parseInt(_0x3b3610['priority'],0xa)+0x1);_0x3b3610['close']();}function handleUnpublished(_0x24ce26){logger[_0x35f7('0x4')](util[_0x35f7('0x19')]('Project\x20%s\x20not\x20published',_0x24ce26[_0x35f7('0x1d')]));_0x24ce26['continueAt'](_0x24ce26['context'],_0x24ce26[_0x35f7('0x26')],parseInt(_0x24ce26['priority'],0xa)+0x1);_0x24ce26['close']();}module[_0x35f7('0x39')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index 824c67b..fbeb069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db1=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_inBody','substring','split','indexOf','slice','trim','length','emit','headers','exports','util','stream','Transform','call','_localBuffer'];(function(_0xc5e2ec,_0xf8986c){var _0x40c26c=function(_0x10fd2d){while(--_0x10fd2d){_0xc5e2ec['push'](_0xc5e2ec['shift']());}};_0x40c26c(++_0xf8986c);}(_0x6db1,0x13e));var _0x16db=function(_0x4c2c4f,_0x27539a){_0x4c2c4f=_0x4c2c4f-0x0;var _0x5aaf24=_0x6db1[_0x4c2c4f];return _0x5aaf24;};'use strict';var util=require(_0x16db('0x0'));var Transform=require(_0x16db('0x1'))[_0x16db('0x2')];function AGIReply(_0x2fc0f4){Transform[_0x16db('0x3')](this,_0x2fc0f4);this[_0x16db('0x4')]='';this['_inBody']=![];}util[_0x16db('0x5')](AGIReply,Transform);AGIReply[_0x16db('0x6')][_0x16db('0x7')]=function(_0x275e0d,_0x5a1ebd,_0x1cf88f){var _0x38b8af='\x0a',_0x1adae8=['\x0a\x0a',_0x16db('0x8')],_0x163676=-0x1,_0x400d33=-0x1,_0x1a9012='',_0x4e4916=0x0,_0x16a89b='',_0x228e05='';this[_0x16db('0x4')]+=_0x275e0d['toString']();_0x16a89b=this[_0x16db('0x4')];if(!this[_0x16db('0x9')]){_0x4e4916=0x0;while(_0x1adae8[_0x4e4916]){while((_0x400d33=_0x16a89b['indexOf'](_0x1adae8[_0x4e4916]))!=-0x1){_0x1a9012=_0x1adae8[_0x4e4916];_0x228e05=_0x16a89b[_0x16db('0xa')](0x0,_0x400d33);_0x16a89b=_0x16a89b[_0x16db('0xa')](_0x400d33+_0x1a9012['length']);var _0x430841=_0x228e05[_0x16db('0xb')](_0x38b8af),_0x104b52=0x0,_0x41222d={},_0x1df450='',_0x4b792d='',_0x3c6e81=-0x1;while(_0x430841[_0x104b52]){_0x3c6e81=_0x430841[_0x104b52][_0x16db('0xc')](':');if(_0x3c6e81!=-0x1){_0x1df450=_0x430841[_0x104b52][_0x16db('0xd')](0x0,_0x3c6e81)[_0x16db('0xe')]();_0x4b792d=_0x430841[_0x104b52][_0x16db('0xd')](_0x3c6e81+0x1)[_0x16db('0xe')]();if(_0x1df450[_0x16db('0xf')]>0x0){_0x41222d[_0x1df450]=_0x4b792d;}}else{}_0x104b52++;}this[_0x16db('0x10')](_0x16db('0x11'),_0x41222d);this[_0x16db('0x9')]=!![];}_0x4e4916++;}this[_0x16db('0x4')]=_0x16a89b;}else{while((_0x163676=_0x16a89b['indexOf'](_0x38b8af))!=-0x1){_0x228e05=_0x16a89b[_0x16db('0xa')](0x0,_0x163676);this['emit']('line',_0x228e05);_0x16a89b=_0x16a89b[_0x16db('0xa')](_0x163676+_0x38b8af[_0x16db('0xf')]);}this[_0x16db('0x4')]=_0x16a89b;}_0x1cf88f();};module[_0x16db('0x12')]=AGIReply;
\ No newline at end of file
+var _0x128f=['Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line','exports'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x128f,0xff));var _0xf128=function(_0x189af7,_0x42e7ed){_0x189af7=_0x189af7-0x0;var _0x483af6=_0x128f[_0x189af7];return _0x483af6;};'use strict';var util=require('util');var Transform=require('stream')[_0xf128('0x0')];function AGIReply(_0x4031bd){Transform[_0xf128('0x1')](this,_0x4031bd);this[_0xf128('0x2')]='';this[_0xf128('0x3')]=![];}util[_0xf128('0x4')](AGIReply,Transform);AGIReply[_0xf128('0x5')]['_transform']=function(_0x59a6d1,_0x1d896f,_0x3dd21f){var _0x446c34='\x0a',_0x44b6a9=['\x0a\x0a',_0xf128('0x6')],_0x1d1c69=-0x1,_0x11f693=-0x1,_0x29c938='',_0x3728d7=0x0,_0x5cd18a='',_0x3b8d9f='';this[_0xf128('0x2')]+=_0x59a6d1[_0xf128('0x7')]();_0x5cd18a=this[_0xf128('0x2')];if(!this[_0xf128('0x3')]){_0x3728d7=0x0;while(_0x44b6a9[_0x3728d7]){while((_0x11f693=_0x5cd18a[_0xf128('0x8')](_0x44b6a9[_0x3728d7]))!=-0x1){_0x29c938=_0x44b6a9[_0x3728d7];_0x3b8d9f=_0x5cd18a[_0xf128('0x9')](0x0,_0x11f693);_0x5cd18a=_0x5cd18a[_0xf128('0x9')](_0x11f693+_0x29c938[_0xf128('0xa')]);var _0x79bdd2=_0x3b8d9f[_0xf128('0xb')](_0x446c34),_0x1916ba=0x0,_0xe2aa3d={},_0x355452='',_0x577152='',_0x51276a=-0x1;while(_0x79bdd2[_0x1916ba]){_0x51276a=_0x79bdd2[_0x1916ba][_0xf128('0x8')](':');if(_0x51276a!=-0x1){_0x355452=_0x79bdd2[_0x1916ba][_0xf128('0xc')](0x0,_0x51276a)[_0xf128('0xd')]();_0x577152=_0x79bdd2[_0x1916ba]['slice'](_0x51276a+0x1)[_0xf128('0xd')]();if(_0x355452[_0xf128('0xa')]>0x0){_0xe2aa3d[_0x355452]=_0x577152;}}else{}_0x1916ba++;}this[_0xf128('0xe')]('headers',_0xe2aa3d);this[_0xf128('0x3')]=!![];}_0x3728d7++;}this[_0xf128('0x2')]=_0x5cd18a;}else{while((_0x1d1c69=_0x5cd18a[_0xf128('0x8')](_0x446c34))!=-0x1){_0x3b8d9f=_0x5cd18a[_0xf128('0x9')](0x0,_0x1d1c69);this[_0xf128('0xe')](_0xf128('0xf'),_0x3b8d9f);_0x5cd18a=_0x5cd18a['substring'](_0x1d1c69+_0x446c34[_0xf128('0xa')]);}this['_localBuffer']=_0x5cd18a;}_0x3dd21f();};module[_0xf128('0x10')]=AGIReply;
\ No newline at end of file
index 25848ac..0309f55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefc=['getVariableById','ShowSquareOdbc','dsn','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','phone','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','error','result','getSquareProjects','GetSquareProjects','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','getSquareProjectById','getVoiceQueueById'];(function(_0x1a46da,_0x5a1b9d){var _0x3ec43f=function(_0x1dae9e){while(--_0x1dae9e){_0x1a46da['push'](_0x1a46da['shift']());}};_0x3ec43f(++_0x5a1b9d);}(_0xaefc,0xc8));var _0xcaef=function(_0x14b8fb,_0x1e3588){_0x14b8fb=_0x14b8fb-0x0;var _0x3e9c49=_0xaefc[_0x14b8fb];return _0x3e9c49;};'use strict';var _=require(_0xcaef('0x0'));var moment=require(_0xcaef('0x1'));var jayson=require(_0xcaef('0x2'));var client=jayson['client'][_0xcaef('0x3')]({'port':0x2329});function request(_0xd60229,_0x49cc54){return new Promise(function(_0x575523,_0x37a134){return client[_0xcaef('0x4')](_0xd60229,_0x49cc54)['then'](function(_0x5caa80){if(_0x5caa80[_0xcaef('0x5')]){return _0x37a134(_0x5caa80[_0xcaef('0x5')]['message']);}else{return _0x575523(_0x5caa80[_0xcaef('0x6')]);}})['catch'](function(_0x49d64c){return _0x37a134(_0x49d64c);});});}exports[_0xcaef('0x7')]=function(){return request(_0xcaef('0x8'),{'options':{'raw':![],'attributes':['id','name',_0xcaef('0x9')]}});};exports[_0xcaef('0xa')]=function(_0x591c48){return request(_0xcaef('0xb'),{'options':{'raw':![],'where':{'name':_0x591c48},'attributes':[_0xcaef('0x9')]}});};exports[_0xcaef('0xc')]=function(_0x1c490c){return request(_0xcaef('0xd'),{'options':{'raw':![],'where':{'id':_0x1c490c},'include':[{'model':_0xcaef('0xe'),'as':_0xcaef('0xf'),'include':[{'model':_0xcaef('0x10'),'as':_0xcaef('0x10')}]}],'attributes':['id',_0xcaef('0x11'),'email'],'smtp':!![]}});};exports[_0xcaef('0x12')]=function(_0x1f856c){return request(_0xcaef('0xb'),{'options':{'where':{'id':_0x1f856c},'attributes':[_0xcaef('0x11')]}});};exports[_0xcaef('0x13')]=function(_0x48eac6){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x48eac6},'attributes':[_0xcaef('0x11')]}});};exports[_0xcaef('0x14')]=function(_0x568944){return request('ShowVariable',{'options':{'where':{'id':_0x568944},'attributes':[_0xcaef('0x11')]}});};exports['getSquareOdbcById']=function(_0x1f252e){return request(_0xcaef('0x15'),{'options':{'where':{'id':_0x1f252e},'attributes':[_0xcaef('0x16')]}});};exports['getUserById']=function(_0x15c549){return request('ShowUser',{'options':{'where':{'id':_0x15c549},'attributes':['name']}});};exports[_0xcaef('0x17')]=function(_0x545ad3){return request(_0xcaef('0x18'),{'options':{'where':{'phone':_0x545ad3['phone']},'attributes':['id']}});};exports[_0xcaef('0x19')]=function(_0x33520d){return request(_0xcaef('0x1a'),{'options':{'where':{'id':_0x33520d},'attributes':[_0xcaef('0x11')]}});};exports[_0xcaef('0x1b')]=function(_0x23d3af){return request(_0xcaef('0x1c'),{'options':{'where':{'id':_0x23d3af},'attributes':[_0xcaef('0x1d')]}});};exports[_0xcaef('0x1e')]=function(_0x1224f6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1224f6},'include':[{'model':_0xcaef('0x1f'),'as':_0xcaef('0x20')}]}});};exports['getSmsAccountById']=function(_0x3bf242){return request(_0xcaef('0x21'),{'options':{'where':{'id':_0x3bf242},'attributes':['id',_0xcaef('0x11')]}});};exports[_0xcaef('0x22')]=function(_0x5c1c94){return request('CreateSmsMessage',{'body':_0x5c1c94});};exports[_0xcaef('0x23')]=function(_0x5de45c){return request(_0xcaef('0x24'),{'body':_0x5de45c});};exports[_0xcaef('0x25')]=function(_0x5e92d9){return request('CreateSquareReport',{'body':_[_0xcaef('0x26')](_0x5e92d9,{'project_name':_0x5e92d9[_0xcaef('0x27')],'prev_project_name':_0x5e92d9[_0xcaef('0x28')]||'','is_subproject':_0x5e92d9['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xcaef('0x29'))})});};exports['createSquareRecording']=function(_0x482ce4){return request(_0xcaef('0x2a'),{'body':_0x482ce4});};exports['createSquareMessage']=function(_0x56ef7d){return request(_0xcaef('0x2b'),{'body':_0x56ef7d});};exports[_0xcaef('0x2c')]=function(_0x8bb9c5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x8bb9c5[_0xcaef('0x2d')],'ListId':_0x8bb9c5['ListId']}}})[_0xcaef('0x2e')](function(_0x2b7f11){if(_0x2b7f11){return _0x2b7f11;}return request(_0xcaef('0x2f'),{'body':_0x8bb9c5});});};exports[_0xcaef('0x30')]=function(_0x478059){return request('ShowPause',{'options':{'where':{'id':_0x478059},'attributes':[_0xcaef('0x11')]}});};exports[_0xcaef('0x31')]=function(_0x3c770f,_0x4a0467){return request(_0xcaef('0x32'),{'body':{'interface':_0x4a0467},'options':{'where':_0x3c770f}});};exports[_0xcaef('0x33')]=function(_0x2e9a0a,_0x4f8e04,_0x13d2bc){return request('PauseUser',{'body':{'type':_0x4f8e04,'uniqueid':_0x13d2bc},'options':{'where':_0x2e9a0a}});};exports['agentUnpause']=function(_0x1f7e7a){return request(_0xcaef('0x34'),{'body':{},'options':{'where':_0x1f7e7a}});};exports[_0xcaef('0x35')]=function(_0x568749){return request(_0xcaef('0x36'),{'body':{},'options':{'where':_0x568749}});};
\ No newline at end of file
+var _0x5577=['production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name'];(function(_0x1dffbd,_0x11c500){var _0x47b0ac=function(_0x212f86){while(--_0x212f86){_0x1dffbd['push'](_0x1dffbd['shift']());}};_0x47b0ac(++_0x11c500);}(_0x5577,0x1b4));var _0x7557=function(_0x18405f,_0x3ed101){_0x18405f=_0x18405f-0x0;var _0x3a86da=_0x5577[_0x18405f];return _0x3a86da;};'use strict';var _=require(_0x7557('0x0'));var moment=require('moment');var jayson=require(_0x7557('0x1'));var client=jayson[_0x7557('0x2')]['http']({'port':0x2329});function request(_0x34636a,_0x289758){return new Promise(function(_0x25c0da,_0x3c4697){return client[_0x7557('0x3')](_0x34636a,_0x289758)[_0x7557('0x4')](function(_0x5862e6){if(_0x5862e6[_0x7557('0x5')]){return _0x3c4697(_0x5862e6[_0x7557('0x5')][_0x7557('0x6')]);}else{return _0x25c0da(_0x5862e6[_0x7557('0x7')]);}})[_0x7557('0x8')](function(_0x37f335){return _0x3c4697(_0x37f335);});});}exports[_0x7557('0x9')]=function(){return request(_0x7557('0xa'),{'options':{'raw':![],'attributes':['id',_0x7557('0xb'),_0x7557('0xc')]}});};exports[_0x7557('0xd')]=function(_0x32ae8c){return request(_0x7557('0xe'),{'options':{'raw':![],'where':{'name':_0x32ae8c},'attributes':[_0x7557('0xc')]}});};exports[_0x7557('0xf')]=function(_0x5b6d12){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5b6d12},'include':[{'model':_0x7557('0x10'),'as':_0x7557('0x11'),'include':[{'model':_0x7557('0x12'),'as':_0x7557('0x12')}]}],'attributes':['id',_0x7557('0xb'),_0x7557('0x13')],'smtp':!![]}});};exports[_0x7557('0x14')]=function(_0x26abc8){return request(_0x7557('0xe'),{'options':{'where':{'id':_0x26abc8},'attributes':[_0x7557('0xb')]}});};exports['getVoiceQueueById']=function(_0x276031){return request(_0x7557('0x15'),{'options':{'where':{'id':_0x276031},'attributes':[_0x7557('0xb')]}});};exports['getVariableById']=function(_0x3ad3a1){return request(_0x7557('0x16'),{'options':{'where':{'id':_0x3ad3a1},'attributes':[_0x7557('0xb')]}});};exports[_0x7557('0x17')]=function(_0x54295b){return request(_0x7557('0x18'),{'options':{'where':{'id':_0x54295b},'attributes':[_0x7557('0x19')]}});};exports['getUserById']=function(_0x4a9cae){return request(_0x7557('0x1a'),{'options':{'where':{'id':_0x4a9cae},'attributes':[_0x7557('0xb')]}});};exports[_0x7557('0x1b')]=function(_0x40a81b){return request('GetContactByPhone',{'options':{'where':{'phone':_0x40a81b[_0x7557('0x1c')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x3e2972){return request(_0x7557('0x1d'),{'options':{'where':{'id':_0x3e2972},'attributes':[_0x7557('0xb')]}});};exports[_0x7557('0x1e')]=function(_0x5463bc){return request(_0x7557('0x1f'),{'options':{'where':{'id':_0x5463bc},'attributes':[_0x7557('0x20')]}});};exports[_0x7557('0x21')]=function(_0x34bed5){return request(_0x7557('0x22'),{'options':{'raw':![],'where':{'id':_0x34bed5},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x211fbe){return request('ShowSmsAccount',{'options':{'where':{'id':_0x211fbe},'attributes':['id',_0x7557('0xb')]}});};exports[_0x7557('0x23')]=function(_0x1e97d3){return request(_0x7557('0x24'),{'body':_0x1e97d3});};exports[_0x7557('0x25')]=function(_0x14bd5e){return request(_0x7557('0x26'),{'body':_0x14bd5e});};exports['createSquareReport']=function(_0x3c8a33){return request('CreateSquareReport',{'body':_[_0x7557('0x27')](_0x3c8a33,{'project_name':_0x3c8a33['arg_1'],'prev_project_name':_0x3c8a33[_0x7557('0x28')]||'','is_subproject':_0x3c8a33[_0x7557('0x28')]?!![]:![],'leaveAt':moment()[_0x7557('0x29')](_0x7557('0x2a'))})});};exports['createSquareRecording']=function(_0x2aed02){return request('CreateSquareRecording',{'body':_0x2aed02});};exports[_0x7557('0x2b')]=function(_0x8960dd){return request(_0x7557('0x2c'),{'body':_0x8960dd});};exports['createCmContact']=function(_0x3b36eb){return request(_0x7557('0x2d'),{'options':{'raw':![],'where':{'phone':_0x3b36eb[_0x7557('0x1c')],'ListId':_0x3b36eb[_0x7557('0x2e')]}}})[_0x7557('0x4')](function(_0x414eec){if(_0x414eec){return _0x414eec;}return request('CreateCmContact',{'body':_0x3b36eb});});};exports[_0x7557('0x2f')]=function(_0x1a8c82){return request(_0x7557('0x30'),{'options':{'where':{'id':_0x1a8c82},'attributes':[_0x7557('0xb')]}});};exports['agentLogin']=function(_0x3e7dae,_0x9afab1){return request(_0x7557('0x31'),{'body':{'interface':_0x9afab1},'options':{'where':_0x3e7dae}});};exports[_0x7557('0x32')]=function(_0x4745de,_0x2f3fd3,_0x20a3ab){return request(_0x7557('0x33'),{'body':{'type':_0x2f3fd3,'uniqueid':_0x20a3ab},'options':{'where':_0x4745de}});};exports[_0x7557('0x34')]=function(_0x4410ce){return request(_0x7557('0x35'),{'body':{},'options':{'where':_0x4410ce}});};exports[_0x7557('0x36')]=function(_0x11aaff){return request(_0x7557('0x37'),{'body':{},'options':{'where':_0x11aaff}});};
\ No newline at end of file
index 98d84b9..6249676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77a9=['./polly','exports'];(function(_0x12ba01,_0x13ec8b){var _0x3b20ef=function(_0x2811e2){while(--_0x2811e2){_0x12ba01['push'](_0x12ba01['shift']());}};_0x3b20ef(++_0x13ec8b);}(_0x77a9,0x19e));var _0x977a=function(_0x1d4360,_0x200ba3){_0x1d4360=_0x1d4360-0x0;var _0x319f53=_0x77a9[_0x1d4360];return _0x319f53;};var polly=require(_0x977a('0x0'));var lex=require('./lex');module[_0x977a('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xe626=['exports','./polly','./lex'];(function(_0x377b04,_0xdc5060){var _0x42c599=function(_0x16bc43){while(--_0x16bc43){_0x377b04['push'](_0x377b04['shift']());}};_0x42c599(++_0xdc5060);}(_0xe626,0x9d));var _0x6e62=function(_0x5d919d,_0x486c78){_0x5d919d=_0x5d919d-0x0;var _0x336599=_0xe626[_0x5d919d];return _0x336599;};var polly=require(_0x6e62('0x0'));var lex=require(_0x6e62('0x1'));module[_0x6e62('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 85baeb1..ed02239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['./lib/api','exports'];(function(_0x547fb3,_0x4deabc){var _0x3fc05a=function(_0x16278f){while(--_0x16278f){_0x547fb3['push'](_0x547fb3['shift']());}};_0x3fc05a(++_0x4deabc);}(_0x5c00,0x17e));var _0x05c0=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0x5c00[_0x5d6c3e];return _0x44ecb7;};'use strict';var lex=require(_0x05c0('0x0'));module[_0x05c0('0x1')]=function(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9){return lex(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9);};
\ No newline at end of file
+var _0x13f6=['./lib/api','exports'];(function(_0x428d96,_0x3a6a42){var _0xe68a66=function(_0x528f19){while(--_0x528f19){_0x428d96['push'](_0x428d96['shift']());}};_0xe68a66(++_0x3a6a42);}(_0x13f6,0x124));var _0x613f=function(_0x5c4cc3,_0x192001){_0x5c4cc3=_0x5c4cc3-0x0;var _0x41fcc6=_0x13f6[_0x5c4cc3];return _0x41fcc6;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);};
\ No newline at end of file
index 0896957..ae2a9ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x162035,_0x168335){var _0x4270ef=function(_0x3f6b4d){while(--_0x3f6b4d){_0x162035['push'](_0x162035['shift']());}};_0x4270ef(++_0x168335);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x16c92c,_0x5e0837){var _0x58d8cf=function(_0x51a630){while(--_0x51a630){_0x16c92c['push'](_0x16c92c['shift']());}};_0x58d8cf(++_0x5e0837);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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
index aa26d30..c489780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60d0=['./lib/api','exports'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0x60d0,0xec));var _0x060d=function(_0xfff47f,_0x4f9551){_0xfff47f=_0xfff47f-0x0;var _0x370e76=_0x60d0[_0xfff47f];return _0x370e76;};'use strict';var polly=require(_0x060d('0x0'));module[_0x060d('0x1')]=function(_0x4d7a6e,_0x5998b1,_0x53a2ea,_0xcdde0e,_0x11275e,_0x4ca3ff,_0x3875e2){return polly(_0x4d7a6e,_0x5998b1,_0x53a2ea,_0xcdde0e,_0x11275e,_0x4ca3ff,_0x3875e2);};
\ No newline at end of file
+var _0xfad4=['./lib/api','exports'];(function(_0x187955,_0x5596ad){var _0x116166=function(_0x5bfdff){while(--_0x5bfdff){_0x187955['push'](_0x187955['shift']());}};_0x116166(++_0x5596ad);}(_0xfad4,0xa4));var _0x4fad=function(_0x1c24ae,_0x2d76db){_0x1c24ae=_0x1c24ae-0x0;var _0xa9ebf6=_0xfad4[_0x1c24ae];return _0xa9ebf6;};'use strict';var polly=require(_0x4fad('0x0'));module[_0x4fad('0x1')]=function(_0x3aaefb,_0x2d8e2b,_0x502898,_0x3bea4d,_0x50784a,_0x1cf5a3,_0x54f1e4){return polly(_0x3aaefb,_0x2d8e2b,_0x502898,_0x3bea4d,_0x50784a,_0x1cf5a3,_0x54f1e4);};
\ No newline at end of file
index 4322045..575189b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e9=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x58e9,0x1d0));var _0x958e=function(_0x5b0c9b,_0x82c6c9){_0x5b0c9b=_0x5b0c9b-0x0;var _0x316448=_0x58e9[_0x5b0c9b];return _0x316448;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x958e('0x0'));var rs=require(_0x958e('0x1'));var AWS=require(_0x958e('0x2'));function pollyResult(_0x56d0aa,_0x653acd,_0x53d36b){return new BPromise(function(_0x3edcb2,_0x1f4a20){_0x56d0aa[_0x958e('0x3')](_0x653acd,function(_0x266b49,_0x22679b){if(_0x266b49){_0x1f4a20(_0x266b49);}else if(_0x22679b){if(_0x22679b[_0x958e('0x4')]instanceof Buffer){fs[_0x958e('0x5')](_0x53d36b,_0x22679b[_0x958e('0x4')],function(_0x33398f){if(_0x33398f){_0x1f4a20(_0x33398f);}else{_0x3edcb2();}});}else{_0x1f4a20(new Error(_0x958e('0x6')));}}else{_0x1f4a20(new Error(_0x958e('0x7')));}});});}module['exports']=function(_0x231b3f,_0x1b61af,_0x9890fa,_0x211700,_0x20c951,_0x36a96a,_0x11c0f1){var _0x4201ba=new AWS[(_0x958e('0x8'))]({'accessKeyId':_0x231b3f,'secretAccessKey':_0x1b61af,'region':_0x9890fa});var _0x31f7fe={'Text':_0x20c951,'TextType':_0x36a96a||'text','OutputFormat':'mp3','VoiceId':_0x211700};return pollyResult(_0x4201ba,_0x31f7fe,_0x11c0f1);};
\ No newline at end of file
+var _0xc2f8=['randomstring','aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird'];(function(_0xf738ad,_0x5e1d7f){var _0x598570=function(_0x35088e){while(--_0x35088e){_0xf738ad['push'](_0xf738ad['shift']());}};_0x598570(++_0x5e1d7f);}(_0xc2f8,0xe5));var _0x8c2f=function(_0x55b871,_0x4c1cf2){_0x55b871=_0x55b871-0x0;var _0x4a734d=_0xc2f8[_0x55b871];return _0x4a734d;};'use strict';var fs=require('fs');var path=require(_0x8c2f('0x0'));var BPromise=require(_0x8c2f('0x1'));var rs=require(_0x8c2f('0x2'));var AWS=require(_0x8c2f('0x3'));function pollyResult(_0x91c1f7,_0x317d4b,_0x3c8a0c){return new BPromise(function(_0x57b1f3,_0x361f3d){_0x91c1f7['synthesizeSpeech'](_0x317d4b,function(_0x45f86e,_0x1476f5){if(_0x45f86e){_0x361f3d(_0x45f86e);}else if(_0x1476f5){if(_0x1476f5['AudioStream']instanceof Buffer){fs[_0x8c2f('0x4')](_0x3c8a0c,_0x1476f5[_0x8c2f('0x5')],function(_0x527d68){if(_0x527d68){_0x361f3d(_0x527d68);}else{_0x57b1f3();}});}else{_0x361f3d(new Error(_0x8c2f('0x6')));}}else{_0x361f3d(new Error(_0x8c2f('0x7')));}});});}module[_0x8c2f('0x8')]=function(_0x928bd7,_0x2525b9,_0x38c875,_0x4524dc,_0x8eb45,_0x47c83b,_0x1b834a){var _0x24d3a9=new AWS[(_0x8c2f('0x9'))]({'accessKeyId':_0x928bd7,'secretAccessKey':_0x2525b9,'region':_0x38c875});var _0x5ab8d0={'Text':_0x8eb45,'TextType':_0x47c83b||'text','OutputFormat':_0x8c2f('0xa'),'VoiceId':_0x4524dc};return pollyResult(_0x24d3a9,_0x5ab8d0,_0x1b834a);};
\ No newline at end of file
index 5c40ca5..a80a66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x615d=['./lib/api'];(function(_0x42eed7,_0x308dcc){var _0x40cef4=function(_0x289056){while(--_0x289056){_0x42eed7['push'](_0x42eed7['shift']());}};_0x40cef4(++_0x308dcc);}(_0x615d,0x89));var _0xd615=function(_0x2393c0,_0x5d5d61){_0x2393c0=_0x2393c0-0x0;var _0x188aa9=_0x615d[_0x2393c0];return _0x188aa9;};'use strict';var asr=require(_0xd615('0x0'));module['exports']=function(_0x251dcb,_0x3514f4,_0x5b64e8,_0xe9c2a3){return asr(_0x251dcb,_0x3514f4,_0x5b64e8);};
\ No newline at end of file
+var _0x96d9=['exports','./lib/api'];(function(_0x2617a1,_0x30d9db){var _0x5bd4bd=function(_0x214db2){while(--_0x214db2){_0x2617a1['push'](_0x2617a1['shift']());}};_0x5bd4bd(++_0x30d9db);}(_0x96d9,0x141));var _0x996d=function(_0x460e2,_0x4dce5c){_0x460e2=_0x460e2-0x0;var _0x4416d6=_0x96d9[_0x460e2];return _0x4416d6;};'use strict';var asr=require(_0x996d('0x0'));module[_0x996d('0x1')]=function(_0x5603ac,_0x174eca,_0x55c983,_0x511c76){return asr(_0x5603ac,_0x174eca,_0x55c983);};
\ No newline at end of file
index 49fe860..e42a4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22dd=['undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0xd22d('0x0'));var BPromise=require(_0xd22d('0x1'));var fs=require('fs');var host=_0xd22d('0x2');module['exports']=function(_0x4f39fe,_0x42ad34,_0x3764ac){return new BPromise(function(_0x2412eb,_0x166f52){var _0x26e4ba;if(typeof _0x4f39fe!==_0xd22d('0x3')||_0x4f39fe[_0xd22d('0x4')]===0x0){return _0x166f52(_0xd22d('0x5'));}if(typeof _0x42ad34!==_0xd22d('0x3')||_0x42ad34[_0xd22d('0x4')]===0x0){return _0x166f52('key\x20should\x20be\x20a\x20string');}if(typeof _0x3764ac!==_0xd22d('0x6')&&(typeof _0x3764ac!==_0xd22d('0x3')||_0x3764ac['length']===0x0)){return _0x166f52(_0xd22d('0x7'));}try{_0x26e4ba=fs['readFileSync'](_0x4f39fe)[_0xd22d('0x8')]('base64');}catch(_0x2318ce){return _0x166f52(_0x2318ce);}return _0x2412eb({'method':_0xd22d('0x9'),'uri':host+_0xd22d('0xa')+_0x42ad34,'body':{'config':{'encoding':_0xd22d('0xb'),'sampleRateHertz':_0xd22d('0xc'),'languageCode':_0x3764ac},'audio':{'content':_0x26e4ba}},'json':!![]});});};
\ No newline at end of file
+var _0xb332=['readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string'];(function(_0x4fb721,_0x245cab){var _0x8e7738=function(_0x1eddbe){while(--_0x1eddbe){_0x4fb721['push'](_0x4fb721['shift']());}};_0x8e7738(++_0x245cab);}(_0xb332,0xd9));var _0x2b33=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xb332[_0x349a9e];return _0x24c207;};'use strict';var url=require(_0x2b33('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x2b33('0x1');module[_0x2b33('0x2')]=function(_0x5ee720,_0xf8c6a7,_0x548a70){return new BPromise(function(_0x1fe6b1,_0x4c6634){var _0x34b111;if(typeof _0x5ee720!=='string'||_0x5ee720[_0x2b33('0x3')]===0x0){return _0x4c6634(_0x2b33('0x4'));}if(typeof _0xf8c6a7!==_0x2b33('0x5')||_0xf8c6a7[_0x2b33('0x3')]===0x0){return _0x4c6634('key\x20should\x20be\x20a\x20string');}if(typeof _0x548a70!=='undefined'&&(typeof _0x548a70!==_0x2b33('0x5')||_0x548a70['length']===0x0)){return _0x4c6634(_0x2b33('0x6'));}try{_0x34b111=fs[_0x2b33('0x7')](_0x5ee720)[_0x2b33('0x8')](_0x2b33('0x9'));}catch(_0x5834bb){return _0x4c6634(_0x5834bb);}return _0x1fe6b1({'method':_0x2b33('0xa'),'uri':host+_0x2b33('0xb')+_0xf8c6a7,'body':{'config':{'encoding':_0x2b33('0xc'),'sampleRateHertz':_0x2b33('0xd'),'languageCode':_0x548a70},'audio':{'content':_0x34b111}},'json':!![]});});};
\ No newline at end of file
index 1b249fb..9d33b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3765=['exports','./asr'];(function(_0x492e50,_0x49f462){var _0x31c104=function(_0xcdf37c){while(--_0xcdf37c){_0x492e50['push'](_0x492e50['shift']());}};_0x31c104(++_0x49f462);}(_0x3765,0x1ed));var _0x5376=function(_0x27da47,_0x8e32ef){_0x27da47=_0x27da47-0x0;var _0x267601=_0x3765[_0x27da47];return _0x267601;};var asr=require(_0x5376('0x0'));module[_0x5376('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x6fa4=['exports','./asr'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x6fa4,0x7f));var _0x46fa=function(_0x485ee4,_0x465e76){_0x485ee4=_0x485ee4-0x0;var _0x2e9d97=_0x6fa4[_0x485ee4];return _0x2e9d97;};var asr=require(_0x46fa('0x0'));module[_0x46fa('0x1')]={'asr':asr};
\ No newline at end of file
index fe7fc6d..c7599dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe594=['Tilde\x20ASR\x20confidence','awsPolly','.wav','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','error','download\x20error','pipe','host','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','unlink','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','then','writeFile','googleCloudTTS\x20path','split','utf8','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription'];(function(_0x3c9b69,_0x4dbb2b){var _0xdb7d1d=function(_0x43d8d8){while(--_0x43d8d8){_0x3c9b69['push'](_0x3c9b69['shift']());}};_0xdb7d1d(++_0x4dbb2b);}(_0xe594,0x9c));var _0x4e59=function(_0x233b2a,_0x440cd1){_0x233b2a=_0x233b2a-0x0;var _0x4e828a=_0xe594[_0x233b2a];return _0x4e828a;};'use strict';var apiai=require(_0x4e59('0x0'));var BPromise=require(_0x4e59('0x1'));var dialogflow=require(_0x4e59('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x4e59('0x3'));var md5=require(_0x4e59('0x4'));var path=require(_0x4e59('0x5'));var querystring=require('querystring');var rp=require(_0x4e59('0x6'));var rs=require(_0x4e59('0x7'));var sox=require(_0x4e59('0x8'));var tts=require(_0x4e59('0x9'));var urlParse=require(_0x4e59('0xa'))['parse'];var util=require('util');var aws=require('./aws');var google=require(_0x4e59('0xb'));var sestek=require(_0x4e59('0xc'));var tilde=require('./tilde');var logger=require(_0x4e59('0xd'))(_0x4e59('0xe'));var ISPEECH_API=_0x4e59('0xf');function downloadFile(_0x5806ed,_0x5c68ba){return new BPromise(function(_0x2c5b35,_0x26e595){var _0x4c31ce=urlParse(_0x5806ed);var _0x2845eb=_0x4c31ce[_0x4e59('0x10')]===_0x4e59('0x11')?https:http;var _0x1cb002={'host':_0x4c31ce['host'],'path':_0x4c31ce[_0x4e59('0x5')],'headers':{'user-agent':_0x4e59('0x12')}};_0x2845eb['get'](_0x1cb002,function(_0x56d979){if(_0x56d979[_0x4e59('0x13')]!==0xc8){logger['error'](_0x4e59('0x14')+_0x5806ed+_0x4e59('0x15')+_0x56d979[_0x4e59('0x13')]+'\x20('+_0x56d979[_0x4e59('0x16')]+')');_0x26e595(new Error(_0x4e59('0x14')+_0x5806ed+_0x4e59('0x15')+_0x56d979[_0x4e59('0x13')]+'\x20('+_0x56d979[_0x4e59('0x16')]+')'));return;}var _0x4c2ac5=fs[_0x4e59('0x17')](_0x5c68ba);_0x4c2ac5['on'](_0x4e59('0x18'),function(){logger[_0x4e59('0x19')](_0x4e59('0x1a'));_0x4c2ac5['close'](_0x2c5b35);});_0x4c2ac5['on'](_0x4e59('0x1b'),function(_0x1291a8){fs['unlink'](_0x5c68ba);logger['error'](_0x4e59('0x1c'),_0x1291a8);_0x26e595(_0x1291a8);});_0x56d979[_0x4e59('0x1d')](_0x4c2ac5);})['on']('error',function(_0x317c7a){logger['error'](_0x317c7a);_0x26e595(_0x317c7a);})['end']();});}function uploadFile(_0x53b7db){return new BPromise(function(_0x5b9359,_0x3e68d1){var _0x34849e=urlParse(_0x53b7db);var _0x120d82=_0x34849e[_0x4e59('0x10')]===_0x4e59('0x11')?https:http;var _0x992f47={'host':_0x34849e[_0x4e59('0x1e')],'path':_0x34849e[_0x4e59('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x120d82['get'](_0x992f47,function(_0x430901){if(_0x430901['statusCode']!==0xc8){_0x3e68d1(new Error('request\x20to\x20'+_0x53b7db+_0x4e59('0x15')+_0x430901['statusCode']+'\x20('+_0x430901['statusMessage']+')'));return;}var _0x5693b3='';_0x430901['on'](_0x4e59('0x1f'),function(_0x57e831){_0x5693b3+=_0x57e831;});_0x430901['on'](_0x4e59('0x20'),function(){_0x5b9359(_0x5693b3);});})['on'](_0x4e59('0x1b'),function(_0x36609a){_0x3e68d1(_0x36609a);})[_0x4e59('0x20')]();});}function convertFile(_0x5d02a5,_0x34cf8a){return new BPromise(function(_0x37e5a4,_0x1a0462){var _0x4c5655=sox[_0x4e59('0x21')](_0x5d02a5,_0x34cf8a,{'sampleRate':0x1f40,'format':_0x4e59('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c5655['on'](_0x4e59('0x1b'),function(_0x2d84cf){logger[_0x4e59('0x1b')](_0x4e59('0x23'),_0x2d84cf);_0x1a0462(_0x2d84cf);});_0x4c5655['on'](_0x4e59('0x20'),function(){logger[_0x4e59('0x19')](_0x4e59('0x24'));_0x37e5a4();});_0x4c5655[_0x4e59('0x25')]();});}function base64Decode(_0x292e65,_0x2ea679){var _0xbeefd9=path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs[_0x4e59('0x28')](0x4)+'.wav');fs[_0x4e59('0x29')](_0xbeefd9,_0x292e65,'base64');return convertFile(_0xbeefd9,_0x2ea679)['then'](function(){try{fs[_0x4e59('0x2a')](_0xbeefd9);fs[_0x4e59('0x2b')](_0x2ea679,_0x4e59('0x2c'));}catch(_0x2264eb){logger['error'](_0x2264eb);}return _0x2ea679['split']('.')[0x0];});}function base64Encode(_0x3f022f){var _0x4d9ee1=fs[_0x4e59('0x2d')](_0x3f022f);return new Buffer(_0x4d9ee1)[_0x4e59('0x2e')](_0x4e59('0x2f'));}exports[_0x4e59('0x30')]=function(_0x2e0c4c,_0x409de5,_0x25627e,_0x3e9fe6,_0x526123,_0x17b2bf){var _0x53d3fd,_0x147808;var _0x36dc5c=_0x4e59('0x31');var _0x5f3762=_0x4e59('0x32')+_0x2e0c4c;var _0x3c123d={};if(_0x409de5===_0x4e59('0x33')){_0x3c123d[_0x4e59('0x34')]={'ssml':_0x25627e};}else{_0x3c123d[_0x4e59('0x34')]={'text':_0x25627e};};_0x3c123d[_0x4e59('0x35')]={'languageCode':_0x3e9fe6,'ssmlGender':_0x526123};_0x3c123d['audioConfig']={'audioEncoding':_0x4e59('0x36'),'sampleRateHertz':0x1f40};var _0x4e3a57={'url':_0x36dc5c+_0x4e59('0x37')+_0x5f3762,'method':_0x4e59('0x38'),'json':!![],'body':_0x3c123d};return rp(_0x4e3a57)[_0x4e59('0x39')](function(_0x565849){return new BPromise(function(_0x12d592,_0x2eec82){_0x53d3fd=path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs[_0x4e59('0x28')](0x4)+'.mp3');var _0x4383e2=Buffer['from'](_0x565849['audioContent'],_0x4e59('0x2f'));return fs[_0x4e59('0x3a')](_0x53d3fd,_0x4383e2,function(_0x2b843a){_0x2eec82(_0x2b843a);},function(_0x5c7d86){fs[_0x4e59('0x2b')](_0x53d3fd,_0x4e59('0x2c'));_0x12d592(_0x5c7d86);});});})[_0x4e59('0x39')](function(_0x98ea6b){_0x147808=path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x53d3fd,_0x147808);})[_0x4e59('0x39')](function(){try{fs[_0x4e59('0x2a')](_0x53d3fd);fs[_0x4e59('0x2b')](_0x147808,_0x4e59('0x2c'));}catch(_0x781622){logger[_0x4e59('0x1b')](_0x781622);}logger[_0x4e59('0x19')](_0x4e59('0x3b'),_0x147808[_0x4e59('0x3c')]('.')[0x0]);return _0x147808[_0x4e59('0x3c')]('.')[0x0];});};exports['googleTTS']=function(_0x2c5a2f,_0x502696){var _0x5140d4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0xac5232,_0xdec1c7;var _0x3bdbf6;var _0x8e730={'encoding':_0x4e59('0x3d'),'method':_0x4e59('0x38'),'timeout':0x2710,'url':_0x5140d4,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4e59('0x3e')+encodeURIComponent(JSON[_0x4e59('0x3f')]([[['jQ1olc',JSON['stringify']([_0x2c5a2f,_0x502696||'en',![],_0x4e59('0x40')]),null,_0x4e59('0x41')]]]))};return rp(_0x8e730)[_0x4e59('0x39')](function(_0x57d2e6){try{_0x3bdbf6=eval(_0x57d2e6['slice'](0x5))[0x0][0x2];}catch(_0x168a92){throw new Error(_0x4e59('0x42')+_0x57d2e6[_0x4e59('0x1f')]);}if(!_0x3bdbf6){if(_0x2c5a2f[_0x4e59('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x4e59('0x44')+_0x502696+_0x4e59('0x45'));}}try{_0x3bdbf6=eval(_0x3bdbf6)[0x0];}catch(_0x470202){throw new Error(_0x4e59('0x42')+res[_0x4e59('0x1f')]);}const _0x114c6e=_0x3bdbf6;_0xac5232=path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs['generate'](0x4)+'.mp3');fs[_0x4e59('0x29')](_0xac5232,_0x3bdbf6,{'encoding':_0x4e59('0x2f')});_0xdec1c7=path['resolve'](__dirname,'tmp',rs[_0x4e59('0x28')](0x4)+'.wav');return convertFile(_0xac5232,_0xdec1c7);})['then'](function(){try{fs[_0x4e59('0x2a')](_0xac5232);fs[_0x4e59('0x2b')](_0xdec1c7,_0x4e59('0x2c'));}catch(_0x2fda43){logger[_0x4e59('0x1b')](_0x2fda43);}logger[_0x4e59('0x19')]('goggleTTS\x20path',_0xdec1c7[_0x4e59('0x3c')]('.')[0x0]);return _0xdec1c7[_0x4e59('0x3c')]('.')[0x0];});};exports[_0x4e59('0x46')]=function(_0x36e843,_0x5afbf8,_0x1a925a){return google[_0x4e59('0x47')](_0x36e843,_0x5afbf8,_0x1a925a)[_0x4e59('0x39')](function(_0x29aeba){logger[_0x4e59('0x19')](_0x29aeba['uri']);return rp(_0x29aeba);})['then'](function(_0x39b1a7){var _0x1dd9a4='';var _0x307170=0x0;try{fs[_0x4e59('0x2a')](_0x36e843);}catch(_0x1dcc86){logger[_0x4e59('0x1b')](_0x1dcc86);}if(_0x39b1a7&&_0x39b1a7[_0x4e59('0x48')]){_0x1dd9a4=_0x39b1a7[_0x4e59('0x48')][_0x4e59('0x49')](function(_0x3a8d89){return _0x3a8d89&&_0x3a8d89[_0x4e59('0x4a')][0x0]&&_0x3a8d89[_0x4e59('0x4a')][0x0][_0x4e59('0x4b')]?_0x3a8d89['alternatives'][0x0][_0x4e59('0x4b')]:'';})[_0x4e59('0x4c')]('\x0a');_0x307170=_0x39b1a7[_0x4e59('0x48')]['map'](function(_0x47da3b){return _0x47da3b&&_0x47da3b['alternatives'][0x0]&&_0x47da3b['alternatives'][0x0][_0x4e59('0x4d')]?_0x47da3b['alternatives'][0x0][_0x4e59('0x4d')]:0x0;})[_0x4e59('0x4c')]('\x0a');}logger['info']('googleASR\x20transcription',_0x1dd9a4);logger[_0x4e59('0x19')](_0x4e59('0x4e'),_0x307170);return{'transcript':_0x1dd9a4,'confidence':_0x307170};})[_0x4e59('0x4f')](function(_0x3c983a){logger['error'](_0x4e59('0x50'),_0x3c983a[_0x4e59('0x13')],_0x3c983a[_0x4e59('0x51')],_0x3c983a[_0x4e59('0x52')]);});};exports['googleDialogflow']=function(_0x1a99df,_0x21cb91,_0x111e31,_0x4cbdb3){var _0x884c83=apiai(_0x21cb91,{'language':_0x4cbdb3||'en'});return _0x884c83[_0x4e59('0x53')](_0x111e31,{'sessionId':md5(_0x1a99df)})[_0x4e59('0x39')](function(_0x1bcb93){logger[_0x4e59('0x19')](JSON[_0x4e59('0x3f')](_0x1bcb93));return{'source':_0x1bcb93['result'][_0x4e59('0x54')],'resolvedQuery':_0x1bcb93[_0x4e59('0x55')][_0x4e59('0x56')],'action':_0x1bcb93[_0x4e59('0x55')][_0x4e59('0x57')],'actionIncomplete':_0x1bcb93['result'][_0x4e59('0x58')],'speech':_0x1bcb93['result'][_0x4e59('0x59')]['speech'],'score':_0x1bcb93[_0x4e59('0x55')][_0x4e59('0x5a')],'statusCode':_0x1bcb93[_0x4e59('0x5b')][_0x4e59('0x5c')],'endConversation':_0x1bcb93['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x1bcb93['result'][_0x4e59('0x5d')][_0x4e59('0x5e')]};});};exports[_0x4e59('0x5f')]=function(_0x19fb47,_0x20eb46,_0x41292d,_0x593c76,_0x5f208c,_0x4ba572){var _0x6c5ecf=_0x593c76[_0x4e59('0x60')](/\\n/g,'\x0a');var _0x40cc7c={'credentials':{'private_key':_0x6c5ecf,'client_email':_0x41292d}};var _0x5a5a3d=new dialogflow[(_0x4e59('0x61'))](_0x40cc7c);var _0x1dbd72=_0x5a5a3d[_0x4e59('0x62')](_0x20eb46,md5(_0x19fb47));var _0x3c0195={'session':_0x1dbd72,'queryInput':{'text':{'text':_0x5f208c,'languageCode':_0x4ba572}}};return _0x5a5a3d[_0x4e59('0x63')](_0x3c0195)[_0x4e59('0x39')](function(_0x8200fb){if(_0x8200fb&&_0x8200fb[_0x4e59('0x43')]){logger[_0x4e59('0x19')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x8200fb));var _0x5edb28=_0x8200fb[0x0];if(_0x5edb28){var _0x349f25={'action':_0x5edb28['queryResult'][_0x4e59('0x57')],'allRequiredParamsPresent':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x65')],'endConversation':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x66')]&&_0x5edb28[_0x4e59('0x64')][_0x4e59('0x66')][_0x4e59('0x67')]?_0x5edb28[_0x4e59('0x64')][_0x4e59('0x66')][_0x4e59('0x67')][_0x4e59('0x68')][_0x4e59('0x69')]:![],'fulfillmentText':_0x5edb28['queryResult'][_0x4e59('0x6a')],'intentName':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x6b')][_0x4e59('0x51')],'intentDisplayName':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x6b')][_0x4e59('0x6c')],'isFallbackIntent':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x6b')][_0x4e59('0x6d')],'languageCode':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x6e')],'queryText':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x6f')],'responseId':_0x5edb28[_0x4e59('0x70')],'score':_0x5edb28[_0x4e59('0x64')][_0x4e59('0x71')],'speech':_0x5edb28['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x4e59('0x3f')](_0x8200fb)};return _0x349f25;}}});};exports[_0x4e59('0x72')]=function(_0x26e12c,_0x51f393,_0x3a2632,_0x26512c){return tilde[_0x4e59('0x47')](_0x26e12c,_0x51f393,_0x3a2632,_0x26512c)['then'](function(_0x23093b){try{fs[_0x4e59('0x2a')](_0x26e12c);}catch(_0x42abe7){logger[_0x4e59('0x1b')](_0x42abe7);}logger[_0x4e59('0x19')](_0x4e59('0x73'),_0x23093b[_0x4e59('0x4b')]);logger['info'](_0x4e59('0x74'),_0x23093b[_0x4e59('0x4d')]);return _0x23093b;});};exports[_0x4e59('0x75')]=function(_0x2ca525,_0x321801,_0x4ce64e,_0x3fa420,_0x2643b1,_0x4a1736){var _0x2d9856=path[_0x4e59('0x26')](__dirname,'tmp',rs[_0x4e59('0x28')](0x4)+'.mp3');var _0x358588;return aws['polly'](_0x2ca525,_0x321801,_0x4ce64e,_0x3fa420,_0x2643b1,_0x4a1736,_0x2d9856)[_0x4e59('0x39')](function(){_0x358588=path[_0x4e59('0x26')](__dirname,'tmp',rs[_0x4e59('0x28')](0x4)+_0x4e59('0x76'));return convertFile(_0x2d9856,_0x358588);})['then'](function(){try{fs['unlink'](_0x2d9856);fs[_0x4e59('0x2b')](_0x358588,_0x4e59('0x2c'));}catch(_0x29a97e){logger['error'](_0x29a97e);}return _0x358588[_0x4e59('0x3c')]('.')[0x0];});};exports[_0x4e59('0x77')]=function(_0x5a5bec,_0x1d433b,_0x535be8,_0x19dcd0,_0x2930ab,_0x1d8abf){return aws['lex'](_0x5a5bec,_0x1d433b,_0x535be8,_0x19dcd0,_0x2930ab,_0x1d8abf)[_0x4e59('0x39')](function(_0x5410bb){logger[_0x4e59('0x19')](JSON[_0x4e59('0x3f')](_0x5410bb));return _0x5410bb;});};exports[_0x4e59('0x78')]=function(_0x3ce2bf,_0x1de3e2,_0x558c72,_0x246893){var _0x4690f6=util[_0x4e59('0x79')](_0x4e59('0x7a'),ISPEECH_API,_0x3ce2bf,encodeURIComponent(_0x1de3e2),_0x558c72,_0x246893);var _0x59ee6c=path['resolve'](__dirname,_0x4e59('0x27'),rs['generate'](0x4)+'.mp3');var _0x4a93cf;return downloadFile(_0x4690f6,_0x59ee6c)[_0x4e59('0x39')](function(){_0x4a93cf=path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs[_0x4e59('0x28')](0x4)+_0x4e59('0x76'));return convertFile(_0x59ee6c,_0x4a93cf);})[_0x4e59('0x39')](function(){try{fs[_0x4e59('0x2a')](_0x59ee6c);fs[_0x4e59('0x2b')](_0x4a93cf,_0x4e59('0x2c'));}catch(_0x36663a){logger[_0x4e59('0x1b')](_0x36663a);}return _0x4a93cf[_0x4e59('0x3c')]('.')[0x0];});};exports['ispeechASR']=function(_0x10958f,_0x500545,_0x10bb44,_0x4bb9b0){var _0x4173f3=util['format'](_0x4e59('0x7b'),ISPEECH_API,_0x500545,_0x10bb44,base64Encode(_0x10958f),_0x4bb9b0?util[_0x4e59('0x79')](_0x4e59('0x7c'),encodeURIComponent(_0x4bb9b0)):_0x4e59('0x7d'));return uploadFile(_0x4173f3)[_0x4e59('0x39')](function(_0x3f9b38){return querystring[_0x4e59('0x7e')](_0x3f9b38);});};exports[_0x4e59('0x7f')]=function(_0x239b7b,_0x4378bb){return sestek[_0x4e59('0x80')](_0x239b7b,_0x4378bb)[_0x4e59('0x39')](function(_0x249ba2){logger[_0x4e59('0x19')](JSON[_0x4e59('0x3f')](_0x249ba2));var _0x5b27bc={'speech':_0x249ba2[_0x4e59('0x81')],'action':_0x249ba2[_0x4e59('0x82')]?_0x249ba2[_0x4e59('0x82')][_0x4e59('0x83')]:undefined,'actiondata':_0x249ba2['channelData']?_0x249ba2[_0x4e59('0x82')]['CustomActionData']:undefined};if(_0x249ba2[_0x4e59('0x82')]&&_0x249ba2[_0x4e59('0x82')][_0x4e59('0x84')]){return base64Decode(_0x249ba2[_0x4e59('0x82')]['AudioFromTts'][_0x4e59('0x85')],path[_0x4e59('0x26')](__dirname,_0x4e59('0x27'),rs[_0x4e59('0x28')](0x4)+_0x4e59('0x76')))[_0x4e59('0x39')](function(_0x48b2a5){_0x5b27bc[_0x4e59('0x86')]=_0x48b2a5;return _0x5b27bc;});}return _0x5b27bc;});};exports[_0x4e59('0x87')]=function(){return __dirname;};
\ No newline at end of file
+var _0x39fc=['googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','responseId','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22'];(function(_0x206f79,_0x3cb5a2){var _0x3d6374=function(_0x18c35b){while(--_0x18c35b){_0x206f79['push'](_0x206f79['shift']());}};_0x3d6374(++_0x3cb5a2);}(_0x39fc,0x15f));var _0xc39f=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0x39fc[_0x5aa373];return _0x590e8e;};'use strict';var apiai=require(_0xc39f('0x0'));var BPromise=require(_0xc39f('0x1'));var dialogflow=require(_0xc39f('0x2'));var fs=require('fs');var http=require(_0xc39f('0x3'));var https=require('https');var md5=require(_0xc39f('0x4'));var path=require('path');var querystring=require(_0xc39f('0x5'));var rp=require('request-promise');var rs=require(_0xc39f('0x6'));var sox=require(_0xc39f('0x7'));var tts=require(_0xc39f('0x8'));var urlParse=require(_0xc39f('0x9'))[_0xc39f('0xa')];var util=require(_0xc39f('0xb'));var aws=require(_0xc39f('0xc'));var google=require(_0xc39f('0xd'));var sestek=require(_0xc39f('0xe'));var tilde=require(_0xc39f('0xf'));var logger=require(_0xc39f('0x10'))(_0xc39f('0x11'));var ISPEECH_API=_0xc39f('0x12');function downloadFile(_0x47b18f,_0x5e7e54){return new BPromise(function(_0x1245c8,_0x1a5832){var _0x1c5d0e=urlParse(_0x47b18f);var _0x17e1f8=_0x1c5d0e[_0xc39f('0x13')]===_0xc39f('0x14')?https:http;var _0x452ed6={'host':_0x1c5d0e[_0xc39f('0x15')],'path':_0x1c5d0e[_0xc39f('0x16')],'headers':{'user-agent':_0xc39f('0x17')}};_0x17e1f8[_0xc39f('0x18')](_0x452ed6,function(_0x3cf7a1){if(_0x3cf7a1[_0xc39f('0x19')]!==0xc8){logger[_0xc39f('0x1a')](_0xc39f('0x1b')+_0x47b18f+_0xc39f('0x1c')+_0x3cf7a1[_0xc39f('0x19')]+'\x20('+_0x3cf7a1[_0xc39f('0x1d')]+')');_0x1a5832(new Error(_0xc39f('0x1b')+_0x47b18f+'\x20failed,\x20status\x20code\x20=\x20'+_0x3cf7a1[_0xc39f('0x19')]+'\x20('+_0x3cf7a1['statusMessage']+')'));return;}var _0x858858=fs[_0xc39f('0x1e')](_0x5e7e54);_0x858858['on']('finish',function(){logger[_0xc39f('0x1f')](_0xc39f('0x20'));_0x858858[_0xc39f('0x21')](_0x1245c8);});_0x858858['on'](_0xc39f('0x1a'),function(_0x3ba9b3){fs[_0xc39f('0x22')](_0x5e7e54);logger[_0xc39f('0x1a')](_0xc39f('0x23'),_0x3ba9b3);_0x1a5832(_0x3ba9b3);});_0x3cf7a1[_0xc39f('0x24')](_0x858858);})['on'](_0xc39f('0x1a'),function(_0x1c5ce5){logger[_0xc39f('0x1a')](_0x1c5ce5);_0x1a5832(_0x1c5ce5);})[_0xc39f('0x25')]();});}function uploadFile(_0x28484a){return new BPromise(function(_0x2f660b,_0x56d5ba){var _0x2b4686=urlParse(_0x28484a);var _0x5a93a0=_0x2b4686['protocol']===_0xc39f('0x14')?https:http;var _0x3ab08b={'host':_0x2b4686[_0xc39f('0x15')],'path':_0x2b4686[_0xc39f('0x16')],'headers':{'user-agent':_0xc39f('0x17')}};_0x5a93a0['get'](_0x3ab08b,function(_0x2d8f6c){if(_0x2d8f6c[_0xc39f('0x19')]!==0xc8){_0x56d5ba(new Error(_0xc39f('0x1b')+_0x28484a+_0xc39f('0x1c')+_0x2d8f6c[_0xc39f('0x19')]+'\x20('+_0x2d8f6c['statusMessage']+')'));return;}var _0x1e94b1='';_0x2d8f6c['on'](_0xc39f('0x26'),function(_0x1371da){_0x1e94b1+=_0x1371da;});_0x2d8f6c['on'](_0xc39f('0x25'),function(){_0x2f660b(_0x1e94b1);});})['on'](_0xc39f('0x1a'),function(_0x232dbb){_0x56d5ba(_0x232dbb);})[_0xc39f('0x25')]();});}function convertFile(_0x31bf3a,_0x582c70){return new BPromise(function(_0x37a3bc,_0x17545a){var _0x1406f1=sox[_0xc39f('0x27')](_0x31bf3a,_0x582c70,{'sampleRate':0x1f40,'format':_0xc39f('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1406f1['on'](_0xc39f('0x1a'),function(_0x5920b9){logger[_0xc39f('0x1a')](_0xc39f('0x29'),_0x5920b9);_0x17545a(_0x5920b9);});_0x1406f1['on'](_0xc39f('0x25'),function(){logger['info'](_0xc39f('0x2a'));_0x37a3bc();});_0x1406f1[_0xc39f('0x2b')]();});}function base64Decode(_0x7d7155,_0x595bb2){var _0x3c62f7=path[_0xc39f('0x2c')](__dirname,_0xc39f('0x2d'),rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x2f'));fs[_0xc39f('0x30')](_0x3c62f7,_0x7d7155,_0xc39f('0x31'));return convertFile(_0x3c62f7,_0x595bb2)[_0xc39f('0x32')](function(){try{fs[_0xc39f('0x22')](_0x3c62f7);fs[_0xc39f('0x33')](_0x595bb2,_0xc39f('0x34'));}catch(_0x1d90a0){logger[_0xc39f('0x1a')](_0x1d90a0);}return _0x595bb2[_0xc39f('0x35')]('.')[0x0];});}function base64Encode(_0x23f9a7){var _0x4c9069=fs[_0xc39f('0x36')](_0x23f9a7);return new Buffer(_0x4c9069)[_0xc39f('0x37')](_0xc39f('0x31'));}exports[_0xc39f('0x38')]=function(_0x521a2f,_0x47dd45,_0x4dc43d,_0x5e8d52,_0x26218f,_0x58392d){var _0x49f3b3,_0x172c13;var _0x400ab7=_0xc39f('0x39');var _0x29c19d=_0xc39f('0x3a')+_0x521a2f;var _0x5b5813={};if(_0x47dd45===_0xc39f('0x3b')){_0x5b5813[_0xc39f('0x3c')]={'ssml':_0x4dc43d};}else{_0x5b5813[_0xc39f('0x3c')]={'text':_0x4dc43d};};_0x5b5813[_0xc39f('0x3d')]={'languageCode':_0x5e8d52,'ssmlGender':_0x26218f};_0x5b5813[_0xc39f('0x3e')]={'audioEncoding':_0xc39f('0x3f'),'sampleRateHertz':0x1f40};var _0x18ce11={'url':_0x400ab7+'text:synthesize'+_0x29c19d,'method':_0xc39f('0x40'),'json':!![],'body':_0x5b5813};return rp(_0x18ce11)['then'](function(_0x4c4a06){return new BPromise(function(_0x26b809,_0x4f63b2){_0x49f3b3=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xc39f('0x41'));var _0x4dc7f0=Buffer[_0xc39f('0x42')](_0x4c4a06[_0xc39f('0x43')],_0xc39f('0x31'));return fs[_0xc39f('0x44')](_0x49f3b3,_0x4dc7f0,function(_0x17162d){_0x4f63b2(_0x17162d);},function(_0x3476ed){fs[_0xc39f('0x33')](_0x49f3b3,_0xc39f('0x34'));_0x26b809(_0x3476ed);});});})[_0xc39f('0x32')](function(_0x3d09d8){_0x172c13=path[_0xc39f('0x2c')](__dirname,'tmp',rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x2f'));return convertFile(_0x49f3b3,_0x172c13);})[_0xc39f('0x32')](function(){try{fs[_0xc39f('0x22')](_0x49f3b3);fs[_0xc39f('0x33')](_0x172c13,_0xc39f('0x34'));}catch(_0x36b299){logger['error'](_0x36b299);}logger[_0xc39f('0x1f')](_0xc39f('0x45'),_0x172c13[_0xc39f('0x35')]('.')[0x0]);return _0x172c13[_0xc39f('0x35')]('.')[0x0];});};exports[_0xc39f('0x46')]=function(_0x52cfb2,_0x579e09){var _0x1b2c51=_0xc39f('0x47');var _0x13996f,_0x40e303;var _0x86c178;var _0x2f57f9={'encoding':'utf8','method':_0xc39f('0x40'),'timeout':0x2710,'url':_0x1b2c51,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xc39f('0x48')+encodeURIComponent(JSON[_0xc39f('0x49')]([[[_0xc39f('0x4a'),JSON[_0xc39f('0x49')]([_0x52cfb2,_0x579e09||'en',![],_0xc39f('0x4b')]),null,_0xc39f('0x4c')]]]))};return rp(_0x2f57f9)[_0xc39f('0x32')](function(_0x41aa9d){try{_0x86c178=eval(_0x41aa9d[_0xc39f('0x4d')](0x5))[0x0][0x2];}catch(_0x3c1efb){throw new Error(_0xc39f('0x4e')+_0x41aa9d['data']);}if(!_0x86c178){if(_0x52cfb2['length']>0xc8){throw new Error(_0xc39f('0x4f'));}else{throw new Error(_0xc39f('0x50')+_0x579e09+'\x22\x20might\x20not\x20exist');}}try{_0x86c178=eval(_0x86c178)[0x0];}catch(_0x2c522e){throw new Error(_0xc39f('0x4e')+res[_0xc39f('0x26')]);}const _0x456fa6=_0x86c178;_0x13996f=path[_0xc39f('0x2c')](__dirname,_0xc39f('0x2d'),rs[_0xc39f('0x2e')](0x4)+'.mp3');fs[_0xc39f('0x30')](_0x13996f,_0x86c178,{'encoding':_0xc39f('0x31')});_0x40e303=path[_0xc39f('0x2c')](__dirname,_0xc39f('0x2d'),rs['generate'](0x4)+'.wav');return convertFile(_0x13996f,_0x40e303);})[_0xc39f('0x32')](function(){try{fs['unlink'](_0x13996f);fs['chmodSync'](_0x40e303,_0xc39f('0x34'));}catch(_0x4a7102){logger[_0xc39f('0x1a')](_0x4a7102);}logger['info']('goggleTTS\x20path',_0x40e303[_0xc39f('0x35')]('.')[0x0]);return _0x40e303[_0xc39f('0x35')]('.')[0x0];});};exports[_0xc39f('0x51')]=function(_0x1765ed,_0x3f2cfa,_0x990037){return google[_0xc39f('0x52')](_0x1765ed,_0x3f2cfa,_0x990037)[_0xc39f('0x32')](function(_0x49537d){logger['info'](_0x49537d['uri']);return rp(_0x49537d);})[_0xc39f('0x32')](function(_0x8f8caf){var _0x5c2b4a='';var _0x3d8b19=0x0;try{fs[_0xc39f('0x22')](_0x1765ed);}catch(_0xe96ff8){logger[_0xc39f('0x1a')](_0xe96ff8);}if(_0x8f8caf&&_0x8f8caf[_0xc39f('0x53')]){_0x5c2b4a=_0x8f8caf['results'][_0xc39f('0x54')](function(_0x3eeaf6){return _0x3eeaf6&&_0x3eeaf6[_0xc39f('0x55')][0x0]&&_0x3eeaf6['alternatives'][0x0][_0xc39f('0x56')]?_0x3eeaf6[_0xc39f('0x55')][0x0][_0xc39f('0x56')]:'';})[_0xc39f('0x57')]('\x0a');_0x3d8b19=_0x8f8caf['results']['map'](function(_0x5d0dc8){return _0x5d0dc8&&_0x5d0dc8[_0xc39f('0x55')][0x0]&&_0x5d0dc8['alternatives'][0x0]['confidence']?_0x5d0dc8[_0xc39f('0x55')][0x0][_0xc39f('0x58')]:0x0;})['join']('\x0a');}logger['info'](_0xc39f('0x59'),_0x5c2b4a);logger[_0xc39f('0x1f')]('googleASR\x20confidence',_0x3d8b19);return{'transcript':_0x5c2b4a,'confidence':_0x3d8b19};})['catch'](function(_0x282d56){logger[_0xc39f('0x1a')](_0xc39f('0x5a'),_0x282d56[_0xc39f('0x19')],_0x282d56['name'],_0x282d56[_0xc39f('0x5b')]);});};exports[_0xc39f('0x5c')]=function(_0x10d621,_0x4b2644,_0x12add7,_0x35fb71){var _0x1fcf14=apiai(_0x4b2644,{'language':_0x35fb71||'en'});return _0x1fcf14[_0xc39f('0x5d')](_0x12add7,{'sessionId':md5(_0x10d621)})[_0xc39f('0x32')](function(_0x146cce){logger['info'](JSON[_0xc39f('0x49')](_0x146cce));return{'source':_0x146cce['result'][_0xc39f('0x5e')],'resolvedQuery':_0x146cce['result'][_0xc39f('0x5f')],'action':_0x146cce[_0xc39f('0x60')][_0xc39f('0x61')],'actionIncomplete':_0x146cce['result'][_0xc39f('0x62')],'speech':_0x146cce[_0xc39f('0x60')][_0xc39f('0x63')][_0xc39f('0x64')],'score':_0x146cce[_0xc39f('0x60')][_0xc39f('0x65')],'statusCode':_0x146cce[_0xc39f('0x66')][_0xc39f('0x67')],'endConversation':_0x146cce[_0xc39f('0x60')][_0xc39f('0x68')][_0xc39f('0x69')]||![],'isFallbackIntent':_0x146cce['result'][_0xc39f('0x68')][_0xc39f('0x6a')]};});};exports[_0xc39f('0x6b')]=function(_0x167171,_0x8a8df5,_0x4f9b82,_0x564095,_0x4eb550,_0x348131){var _0xe660b4=_0x564095['replace'](/\\n/g,'\x0a');var _0x8053ce={'credentials':{'private_key':_0xe660b4,'client_email':_0x4f9b82}};var _0xefcfa2=new dialogflow[(_0xc39f('0x6c'))](_0x8053ce);var _0xb5c33e=_0xefcfa2['sessionPath'](_0x8a8df5,md5(_0x167171));var _0x16b1b9={'session':_0xb5c33e,'queryInput':{'text':{'text':_0x4eb550,'languageCode':_0x348131}}};return _0xefcfa2[_0xc39f('0x6d')](_0x16b1b9)['then'](function(_0x203b61){if(_0x203b61&&_0x203b61[_0xc39f('0x6e')]){logger['info'](_0xc39f('0x6f'),JSON[_0xc39f('0x49')](_0x203b61));var _0x2b24f9=_0x203b61[0x0];if(_0x2b24f9){var _0x2a4ee6={'action':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x61')],'allRequiredParamsPresent':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x71')],'endConversation':_0x2b24f9[_0xc39f('0x70')]['diagnosticInfo']&&_0x2b24f9['queryResult']['diagnosticInfo'][_0xc39f('0x72')]?_0x2b24f9['queryResult'][_0xc39f('0x73')][_0xc39f('0x72')][_0xc39f('0x74')][_0xc39f('0x75')]:![],'fulfillmentText':_0x2b24f9['queryResult'][_0xc39f('0x76')],'intentName':_0x2b24f9[_0xc39f('0x70')]['intent'][_0xc39f('0x77')],'intentDisplayName':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x78')][_0xc39f('0x79')],'isFallbackIntent':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x78')][_0xc39f('0x7a')],'languageCode':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x7b')],'queryText':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x7c')],'responseId':_0x2b24f9[_0xc39f('0x7d')],'score':_0x2b24f9['queryResult']['intentDetectionConfidence'],'speech':_0x2b24f9[_0xc39f('0x70')][_0xc39f('0x76')],'providerResponse':JSON[_0xc39f('0x49')](_0x203b61)};return _0x2a4ee6;}}});};exports['tildeASR']=function(_0x574a7e,_0x4e8007,_0x721713,_0x14edb0){return tilde[_0xc39f('0x52')](_0x574a7e,_0x4e8007,_0x721713,_0x14edb0)[_0xc39f('0x32')](function(_0x2e7962){try{fs[_0xc39f('0x22')](_0x574a7e);}catch(_0x1d0645){logger['error'](_0x1d0645);}logger[_0xc39f('0x1f')](_0xc39f('0x7e'),_0x2e7962['transcript']);logger['info'](_0xc39f('0x7f'),_0x2e7962[_0xc39f('0x58')]);return _0x2e7962;});};exports[_0xc39f('0x80')]=function(_0x984be7,_0x449b3c,_0x1991a1,_0x2aa9a6,_0x5d2822,_0x6150da){var _0x1c8a66=path[_0xc39f('0x2c')](__dirname,_0xc39f('0x2d'),rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x41'));var _0x13cf5d;return aws['polly'](_0x984be7,_0x449b3c,_0x1991a1,_0x2aa9a6,_0x5d2822,_0x6150da,_0x1c8a66)[_0xc39f('0x32')](function(){_0x13cf5d=path[_0xc39f('0x2c')](__dirname,'tmp',rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x2f'));return convertFile(_0x1c8a66,_0x13cf5d);})[_0xc39f('0x32')](function(){try{fs[_0xc39f('0x22')](_0x1c8a66);fs[_0xc39f('0x33')](_0x13cf5d,_0xc39f('0x34'));}catch(_0x27ff3e){logger[_0xc39f('0x1a')](_0x27ff3e);}return _0x13cf5d[_0xc39f('0x35')]('.')[0x0];});};exports[_0xc39f('0x81')]=function(_0x1ba396,_0x38c9c3,_0x1410b9,_0x130b14,_0x2695c5,_0x1939b1){return aws[_0xc39f('0x82')](_0x1ba396,_0x38c9c3,_0x1410b9,_0x130b14,_0x2695c5,_0x1939b1)[_0xc39f('0x32')](function(_0x4b96e8){logger[_0xc39f('0x1f')](JSON[_0xc39f('0x49')](_0x4b96e8));return _0x4b96e8;});};exports[_0xc39f('0x83')]=function(_0x430d2b,_0x10f474,_0x39b319,_0x157a0c){var _0xd9cfc7=util[_0xc39f('0x84')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x430d2b,encodeURIComponent(_0x10f474),_0x39b319,_0x157a0c);var _0x460e1e=path[_0xc39f('0x2c')](__dirname,'tmp',rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x41'));var _0x3fbfb5;return downloadFile(_0xd9cfc7,_0x460e1e)[_0xc39f('0x32')](function(){_0x3fbfb5=path[_0xc39f('0x2c')](__dirname,'tmp',rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x2f'));return convertFile(_0x460e1e,_0x3fbfb5);})['then'](function(){try{fs[_0xc39f('0x22')](_0x460e1e);fs[_0xc39f('0x33')](_0x3fbfb5,_0xc39f('0x34'));}catch(_0x4bb46d){logger[_0xc39f('0x1a')](_0x4bb46d);}return _0x3fbfb5[_0xc39f('0x35')]('.')[0x0];});};exports[_0xc39f('0x85')]=function(_0x5866f3,_0x239b73,_0x560f9a,_0x5f19bb){var _0x199c0f=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x239b73,_0x560f9a,base64Encode(_0x5866f3),_0x5f19bb?util['format']('model=%s',encodeURIComponent(_0x5f19bb)):_0xc39f('0x86'));return uploadFile(_0x199c0f)['then'](function(_0x267f06){return querystring[_0xc39f('0xa')](_0x267f06);});};exports[_0xc39f('0x87')]=function(_0x2be1a2,_0xae4d7f){return sestek[_0xc39f('0x88')](_0x2be1a2,_0xae4d7f)[_0xc39f('0x32')](function(_0x3cacb5){logger[_0xc39f('0x1f')](JSON['stringify'](_0x3cacb5));var _0x3c587e={'speech':_0x3cacb5[_0xc39f('0x89')],'action':_0x3cacb5['channelData']?_0x3cacb5[_0xc39f('0x8a')]['CustomAction']:undefined,'actiondata':_0x3cacb5[_0xc39f('0x8a')]?_0x3cacb5[_0xc39f('0x8a')][_0xc39f('0x8b')]:undefined};if(_0x3cacb5['channelData']&&_0x3cacb5['channelData'][_0xc39f('0x8c')]){return base64Decode(_0x3cacb5['channelData'][_0xc39f('0x8c')][_0xc39f('0x8d')],path[_0xc39f('0x2c')](__dirname,_0xc39f('0x2d'),rs[_0xc39f('0x2e')](0x4)+_0xc39f('0x2f')))[_0xc39f('0x32')](function(_0x9fea93){_0x3c587e[_0xc39f('0x8e')]=_0x9fea93;return _0x3c587e;});}return _0x3c587e;});};exports[_0xc39f('0x8f')]=function(){return __dirname;};
\ No newline at end of file
index 431e748..769c4a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af2=['exports'];(function(_0x4cbc05,_0xf785df){var _0x134e8b=function(_0x2b80e3){while(--_0x2b80e3){_0x4cbc05['push'](_0x4cbc05['shift']());}};_0x134e8b(++_0xf785df);}(_0x1af2,0xe2));var _0x21af=function(_0x4c9191,_0xe10c76){_0x4c9191=_0x4c9191-0x0;var _0x593642=_0x1af2[_0x4c9191];return _0x593642;};var nda=require('./nda');module[_0x21af('0x0')]={'nda':nda};
\ No newline at end of file
+var _0xc431=['./nda','exports'];(function(_0x3bd043,_0x41b75a){var _0x85bcf9=function(_0x36b987){while(--_0x36b987){_0x3bd043['push'](_0x3bd043['shift']());}};_0x85bcf9(++_0x41b75a);}(_0xc431,0x1ae));var _0x1c43=function(_0x43e1b4,_0xed9ed9){_0x43e1b4=_0x43e1b4-0x0;var _0x5b6e04=_0xc431[_0x43e1b4];return _0x5b6e04;};var nda=require(_0x1c43('0x0'));module[_0x1c43('0x1')]={'nda':nda};
\ No newline at end of file
index 1ebcec2..e1f1704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x682e=['text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname'];(function(_0x36d45b,_0x417426){var _0x3dc01c=function(_0x37d04b){while(--_0x37d04b){_0x36d45b['push'](_0x36d45b['shift']());}};_0x3dc01c(++_0x417426);}(_0x682e,0x1ce));var _0xe682=function(_0x4d86ea,_0x3f55fc){_0x4d86ea=_0x4d86ea-0x0;var _0x47945a=_0x682e[_0x4d86ea];return _0x47945a;};'use strict';var rp=require(_0xe682('0x0'));var url=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));module[_0xe682('0x4')]=function(_0x31f019,_0x5cbf47){var _0x2779a7={'method':_0xe682('0x5'),'uri':url[_0xe682('0x6')](_0x5cbf47[_0xe682('0x7')],_0xe682('0x8')),'form':{'grant_type':_0xe682('0x9'),'username':_0x5cbf47[_0xe682('0xa')],'password':_0x5cbf47[_0xe682('0x9')]},'json':!![]};return rp(_0x2779a7)[_0xe682('0xb')](function(_0x1ab428){var _0x4e7e7d={'method':_0xe682('0x5'),'uri':url[_0xe682('0x6')](_0x5cbf47[_0xe682('0xc')],_0xe682('0xd')),'body':{'type':_0x5cbf47[_0xe682('0xe')]||_0xe682('0xf'),'channelId':'Nda','conversation':{'id':_0x31f019[_0xe682('0x10')]},'from':{'id':_0x31f019['callerid'],'name':_0x31f019[_0xe682('0x11')]},'recipient':{'id':_0x31f019['dnid'],'name':_0x31f019['extension']},'text':_0x5cbf47[_0xe682('0x12')],'channelData':{}},'headers':{'Authorization':_0xe682('0x13')+_0x1ab428[_0xe682('0x14')]},'json':!![]};if(_0x5cbf47[_0xe682('0x15')]){_0x4e7e7d[_0xe682('0x16')][_0xe682('0x17')]['ProjectName']=_0x5cbf47[_0xe682('0x15')];}if(_0x5cbf47[_0xe682('0x18')]=='1'){_0x4e7e7d[_0xe682('0x16')][_0xe682('0x17')][_0xe682('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe682('0x1a')};}if(_0x5cbf47[_0xe682('0x1b')]){_0x4e7e7d[_0xe682('0x16')]['channelData'][_0xe682('0x1c')]=_0x5cbf47['custom_action'];if(_0x5cbf47['custom_action_data']){_0x4e7e7d['body'][_0xe682('0x17')][_0xe682('0x1d')]=_0x5cbf47[_0xe682('0x1e')];}}logger[_0xe682('0x1f')](JSON['stringify'](_0x4e7e7d));return rp(_0x4e7e7d);});};
\ No newline at end of file
+var _0x14b7=['url','../../../../../config/logger','agi','POST','resolve','password','username','ndassistant_url','ndaactivity_type','message','Nda','callerid','extension','text','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','stringify','request-promise'];(function(_0x5a12bb,_0x3c41b2){var _0x204c79=function(_0x14d8e6){while(--_0x14d8e6){_0x5a12bb['push'](_0x5a12bb['shift']());}};_0x204c79(++_0x3c41b2);}(_0x14b7,0x144));var _0x714b=function(_0xab9630,_0xe19d9c){_0xab9630=_0xab9630-0x0;var _0x1567a3=_0x14b7[_0xab9630];return _0x1567a3;};'use strict';var rp=require(_0x714b('0x0'));var url=require(_0x714b('0x1'));var logger=require(_0x714b('0x2'))(_0x714b('0x3'));module['exports']=function(_0x136e8b,_0x2e5367){var _0x40d423={'method':_0x714b('0x4'),'uri':url[_0x714b('0x5')](_0x2e5367['ndauth_url'],'/token'),'form':{'grant_type':_0x714b('0x6'),'username':_0x2e5367[_0x714b('0x7')],'password':_0x2e5367[_0x714b('0x6')]},'json':!![]};return rp(_0x40d423)['then'](function(_0x39b5e4){var _0x26489c={'method':_0x714b('0x4'),'uri':url[_0x714b('0x5')](_0x2e5367[_0x714b('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x2e5367[_0x714b('0x9')]||_0x714b('0xa'),'channelId':_0x714b('0xb'),'conversation':{'id':_0x136e8b['uniqueid']},'from':{'id':_0x136e8b[_0x714b('0xc')],'name':_0x136e8b['calleridname']},'recipient':{'id':_0x136e8b['dnid'],'name':_0x136e8b[_0x714b('0xd')]},'text':_0x2e5367[_0x714b('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x39b5e4[_0x714b('0xf')]},'json':!![]};if(_0x2e5367[_0x714b('0x10')]){_0x26489c[_0x714b('0x11')][_0x714b('0x12')]['ProjectName']=_0x2e5367[_0x714b('0x10')];}if(_0x2e5367['ndagenerate_audio']=='1'){_0x26489c[_0x714b('0x11')][_0x714b('0x12')][_0x714b('0x13')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x714b('0x14')};}if(_0x2e5367[_0x714b('0x15')]){_0x26489c[_0x714b('0x11')][_0x714b('0x12')][_0x714b('0x16')]=_0x2e5367[_0x714b('0x15')];if(_0x2e5367[_0x714b('0x17')]){_0x26489c[_0x714b('0x11')][_0x714b('0x12')]['CustomActionData']=_0x2e5367[_0x714b('0x17')];}}logger['info'](JSON[_0x714b('0x18')](_0x26489c));return rp(_0x26489c);});};
\ No newline at end of file
index 451ecf8..fa62056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e77=['exports','./lib/api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e77,0x1cb));var _0x71e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e77[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0x71e7('0x0'));module[_0x71e7('0x1')]=function(_0x3ee77a,_0x6c7300,_0x280555,_0x3ee6e6){return asr(_0x3ee77a,_0x6c7300,_0x280555,_0x3ee6e6);};
\ No newline at end of file
+var _0x687f=['exports','./lib/api'];(function(_0x62e287,_0x28a84e){var _0x28650c=function(_0x3a40f1){while(--_0x3a40f1){_0x62e287['push'](_0x62e287['shift']());}};_0x28650c(++_0x28a84e);}(_0x687f,0x113));var _0xf687=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x687f[_0x954b3a];return _0x3a313e;};'use strict';var asr=require(_0xf687('0x0'));module[_0xf687('0x1')]=function(_0x4c269f,_0x32a33c,_0x3b9b1a,_0x48e0c6){return asr(_0x4c269f,_0x32a33c,_0x3b9b1a,_0x48e0c6);};
\ No newline at end of file
index 22397f8..de5e124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9534=['info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','unix','send','createReadStream','data','close','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','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','open','message','bluebird','moment','crypto','agi'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9534,0x90));var _0x4953=function(_0x32d469,_0x9e939){_0x32d469=_0x32d469-0x0;var _0x59f3b7=_0x9534[_0x32d469];return _0x59f3b7;};'use strict';var BPromise=require(_0x4953('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4953('0x1'));var crypto=require(_0x4953('0x2'));var logger=require('../../../../../../config/logger')(_0x4953('0x3'));module['exports']=function(_0x155988,_0xcdf024,_0x1b6c3b,_0x505030){return new BPromise(function(_0x23aa9b,_0x249a6f){logger[_0x4953('0x4')](_0x4953('0x5'),_0x505030||_0x4953('0x6'));var _0x1acc02=new WebSocket(_0x505030||_0x4953('0x6'),{'perMessageDeflate':![]});var _0xdee952='';var _0xf6dc9f='0';var _0x17b565='1';var _0x420677='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x169e2c(_0x58a648){var _0x13d70c=crypto[_0x4953('0x7')](_0x4953('0x8'));_0x13d70c[_0x4953('0x9')](_0x58a648);return _0x13d70c[_0x4953('0xa')](_0x4953('0xb'));}function _0x380e5d(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x574ddb=moment()[_0x4953('0xc')]();var _0x209244=_0x169e2c(_0x574ddb+_0xcdf024+_0x1b6c3b);_0x1acc02[_0x4953('0xd')](JSON['stringify']({'appID':_0xcdf024,'timestamp':_0x574ddb,'appKey':_0x209244}));var _0x530408=fs[_0x4953('0xe')](_0x155988);_0x530408['on'](_0x4953('0xf'),function(_0x1c54fe){_0x1acc02[_0x4953('0xd')](_0x1c54fe);});_0x530408['on'](_0x4953('0x10'),function(){_0x1acc02[_0x4953('0xd')](_0x4953('0x11'));});}catch(_0x11da1e){logger[_0x4953('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x11da1e));_0x1acc02[_0x4953('0x13')]();}}function _0x108c0a(_0x21cee1){try{if(_0x21cee1){var _0x146777=JSON[_0x4953('0x14')](_0x21cee1);switch(_0x146777['status']){case 0x0:if(_0x146777[_0x4953('0x15')]){if(_0x146777[_0x4953('0x15')][_0x4953('0x16')]){logger[_0x4953('0x4')](_0x4953('0x17'),JSON[_0x4953('0x18')](_0x146777[_0x4953('0x15')][_0x4953('0x19')]));_0xdee952=_0x146777[_0x4953('0x15')][_0x4953('0x19')][0x0]['transcript'];_0xf6dc9f=_0x146777['result'][_0x4953('0x19')][0x0]['likelihood'];_0x17b565='0';_0x420677=_0x4953('0x1a');_0x1acc02[_0x4953('0x13')]();}}break;case 0x1:logger[_0x4953('0x4')](_0x4953('0x1b'));_0x17b565='1';_0x420677='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x4953('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x17b565='2';_0x420677=_0x4953('0x1c');break;case 0x9:logger['info'](_0x4953('0x1d'));_0x17b565='9';_0x420677=_0x4953('0x1d');break;case 0xa:logger[_0x4953('0x4')]('Authentication\x20failed.');_0x17b565='10';_0x420677='Authentication\x20failed.';break;case 0xb:logger[_0x4953('0x4')](_0x4953('0x1e'));_0x17b565='11';_0x420677='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4db008){logger[_0x4953('0x12')](_0x4953('0x1f'),JSON[_0x4953('0x18')](_0x4db008));_0x1acc02['terminate']();}}function _0x481519(){logger['info'](_0x4953('0x20'));_0x23aa9b({'transcript':_0xdee952,'confidence':_0xf6dc9f,'status':_0x17b565,'status_message':_0x420677});}function _0x186b6f(_0x2a2e27){logger['error'](_0x4953('0x21'));if(!_[_0x4953('0x22')](_0x2a2e27)){logger[_0x4953('0x12')](_['isObject'](_0x2a2e27)?JSON[_0x4953('0x18')](_0x2a2e27):_0x2a2e27);}}_0x1acc02['on'](_0x4953('0x23'),_0x380e5d);_0x1acc02['on'](_0x4953('0x24'),_0x108c0a);_0x1acc02['on']('close',_0x481519);_0x1acc02['on'](_0x4953('0x12'),_0x186b6f);});};
\ No newline at end of file
+var _0x2c34=['close','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data'];(function(_0x3e3003,_0x4f144e){var _0x1a3e07=function(_0x5e6cf6){while(--_0x5e6cf6){_0x3e3003['push'](_0x3e3003['shift']());}};_0x1a3e07(++_0x4f144e);}(_0x2c34,0xbf));var _0x42c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2c34[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require('bluebird');var _=require(_0x42c3('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x42c3('0x1'));var crypto=require(_0x42c3('0x2'));var logger=require(_0x42c3('0x3'))(_0x42c3('0x4'));module['exports']=function(_0x26394d,_0x14b9f3,_0xe5cd30,_0xc9a7a){return new BPromise(function(_0x29123a,_0x37fe9e){logger[_0x42c3('0x5')](_0x42c3('0x6'),_0xc9a7a||_0x42c3('0x7'));var _0x9363a0=new WebSocket(_0xc9a7a||_0x42c3('0x7'),{'perMessageDeflate':![]});var _0x117bc6='';var _0x463e6c='0';var _0x146220='1';var _0x4a3da1=_0x42c3('0x8');function _0x57e22c(_0x5612a4){var _0x234999=crypto[_0x42c3('0x9')](_0x42c3('0xa'));_0x234999[_0x42c3('0xb')](_0x5612a4);return _0x234999[_0x42c3('0xc')](_0x42c3('0xd'));}function _0x3bcd58(){try{logger[_0x42c3('0x5')](_0x42c3('0xe'));var _0x2bb98b=moment()[_0x42c3('0xf')]();var _0x3745a8=_0x57e22c(_0x2bb98b+_0x14b9f3+_0xe5cd30);_0x9363a0['send'](JSON[_0x42c3('0x10')]({'appID':_0x14b9f3,'timestamp':_0x2bb98b,'appKey':_0x3745a8}));var _0xc3d13f=fs[_0x42c3('0x11')](_0x26394d);_0xc3d13f['on'](_0x42c3('0x12'),function(_0x32a69b){_0x9363a0['send'](_0x32a69b);});_0xc3d13f['on'](_0x42c3('0x13'),function(){_0x9363a0[_0x42c3('0x14')](_0x42c3('0x15'));});}catch(_0x13b9c1){logger[_0x42c3('0x16')](_0x42c3('0x17'),JSON['stringify'](_0x13b9c1));_0x9363a0[_0x42c3('0x18')]();}}function _0x319d1e(_0x5735cf){try{if(_0x5735cf){var _0x3bf824=JSON[_0x42c3('0x19')](_0x5735cf);switch(_0x3bf824[_0x42c3('0x1a')]){case 0x0:if(_0x3bf824[_0x42c3('0x1b')]){if(_0x3bf824[_0x42c3('0x1b')][_0x42c3('0x1c')]){logger[_0x42c3('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x42c3('0x10')](_0x3bf824['result']['hypotheses']));_0x117bc6=_0x3bf824[_0x42c3('0x1b')]['hypotheses'][0x0][_0x42c3('0x1d')];_0x463e6c=_0x3bf824[_0x42c3('0x1b')]['hypotheses'][0x0][_0x42c3('0x1e')];_0x146220='0';_0x4a3da1='Success.';_0x9363a0[_0x42c3('0x18')]();}}break;case 0x1:logger['info'](_0x42c3('0x8'));_0x146220='1';_0x4a3da1=_0x42c3('0x8');break;case 0x2:logger[_0x42c3('0x5')](_0x42c3('0x1f'));_0x146220='2';_0x4a3da1=_0x42c3('0x1f');break;case 0x9:logger['info'](_0x42c3('0x20'));_0x146220='9';_0x4a3da1=_0x42c3('0x20');break;case 0xa:logger[_0x42c3('0x5')](_0x42c3('0x21'));_0x146220='10';_0x4a3da1=_0x42c3('0x21');break;case 0xb:logger[_0x42c3('0x5')](_0x42c3('0x22'));_0x146220='11';_0x4a3da1='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4a9687){logger['error'](_0x42c3('0x23'),JSON['stringify'](_0x4a9687));_0x9363a0[_0x42c3('0x18')]();}}function _0x56872a(){logger[_0x42c3('0x5')](_0x42c3('0x24'));_0x29123a({'transcript':_0x117bc6,'confidence':_0x463e6c,'status':_0x146220,'status_message':_0x4a3da1});}function _0x458e1e(_0x50490a){logger[_0x42c3('0x16')](_0x42c3('0x25'));if(!_[_0x42c3('0x26')](_0x50490a)){logger['error'](_[_0x42c3('0x27')](_0x50490a)?JSON['stringify'](_0x50490a):_0x50490a);}}_0x9363a0['on'](_0x42c3('0x28'),_0x3bcd58);_0x9363a0['on'](_0x42c3('0x29'),_0x319d1e);_0x9363a0['on'](_0x42c3('0x13'),_0x56872a);_0x9363a0['on'](_0x42c3('0x16'),_0x458e1e);});};
\ No newline at end of file
index 4a2b208..10cb4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75e4=['./asr'];(function(_0x382ea3,_0x513772){var _0x51095d=function(_0x534b51){while(--_0x534b51){_0x382ea3['push'](_0x382ea3['shift']());}};_0x51095d(++_0x513772);}(_0x75e4,0x11f));var _0x475e=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x75e4[_0x1d87fc];return _0x492b56;};var asr=require(_0x475e('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var asr=require('./asr');module['exports']={'asr':asr};
\ No newline at end of file
index eab2d5e..2f99c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0xe706,0xa3));var _0x6e70=function(_0x55976e,_0x27e156){_0x55976e=_0x55976e-0x0;var _0x169ee6=_0xe706[_0x55976e];return _0x169ee6;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
+var _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(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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
index aa35951..7cc0a32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd732=['close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','scheduledAt','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','text','google_tts_language','url','timeout','includes','POST','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','uri','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isString','isPlainObject','saveRestApiResult','%s.%s','length','recursiveNodeIndex','split','replaceAll','getVariable','extra','result','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','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','SIP/%s/%s','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','restAPI','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','number','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','template_id','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','moment','mustache','agi','../../config/environment/shared','./scripts','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xd732,0x18e));var _0x2d73=function(_0x4f3bbe,_0x3c268d){_0x4f3bbe=_0x4f3bbe-0x0;var _0x3addf8=_0xd732[_0x4f3bbe];return _0x3addf8;};'use strict';var fs=require('fs');var util=require(_0x2d73('0x0'));var _=require('lodash');var sh=require(_0x2d73('0x1'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x2d73('0x2'));var Mustache=require(_0x2d73('0x3'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x2d73('0x4'));var config=require('../../config/environment');var shared=require(_0x2d73('0x5'));var scripts=require(_0x2d73('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x2d73('0x7')];var verticesWithRetry=['menu',_0x2d73('0x8'),_0x2d73('0x9')];var AGIVertices=function(_0x28ad42,_0x37682a,_0x56f52d){this[_0x2d73('0xa')]=_0x28ad42;this[_0x2d73('0xb')]=_0x37682a;this[_0x2d73('0xc')]=_0x56f52d;};AGIVertices[_0x2d73('0xd')]['getVariable']=function(_0x3a8c79,_0xb06fad){this[_0x2d73('0xb')][_0x2d73('0xe')](_0x3a8c79)[_0x2d73('0xf')](function(_0x45008a){_0xb06fad(null,_0x45008a?_0x45008a[_0x2d73('0x10')]:![]);})[_0x2d73('0x11')](function(_0x295c21){_0xb06fad(_0x295c21);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x12')]=function(_0x293183,_0x4b3525){this[_0x2d73('0xb')]['getVoiceQueueById'](_0x293183)[_0x2d73('0xf')](function(_0x5678e2){_0x4b3525(null,_0x5678e2?_0x5678e2[_0x2d73('0x10')]:![]);})[_0x2d73('0x11')](function(_0x54e386){_0x4b3525(_0x54e386);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x13')]=function(_0x4b1564,_0x57721e){this['rpc'][_0x2d73('0x14')](_0x4b1564)[_0x2d73('0xf')](function(_0x43a2a5){_0x57721e(null,_0x43a2a5?_0x43a2a5['name']:![]);})[_0x2d73('0x11')](function(_0xd7e922){_0x57721e(_0xd7e922);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x15')]=function(_0x5934e2,_0x53e565){this[_0x2d73('0xb')][_0x2d73('0x16')](_0x5934e2)[_0x2d73('0xf')](function(_0x350d7d){_0x53e565(null,_0x350d7d?_0x350d7d[_0x2d73('0x17')]:![]);})[_0x2d73('0x11')](function(_0x1e7144){_0x53e565(_0x1e7144);});};AGIVertices[_0x2d73('0xd')]['getUser']=function(_0x408067,_0x233f57){this[_0x2d73('0xb')][_0x2d73('0x18')](_0x408067)['then'](function(_0x186b9a){_0x233f57(null,_0x186b9a?_0x186b9a[_0x2d73('0x10')]:![]);})[_0x2d73('0x11')](function(_0x1bcb10){_0x233f57(_0x1bcb10);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x19')]=function(_0x263b35,_0x26e87e){this[_0x2d73('0xb')][_0x2d73('0x1a')](_0x263b35)[_0x2d73('0xf')](function(_0x20b818){_0x26e87e(null,_0x20b818?_0x20b818[_0x2d73('0x10')]:![]);})[_0x2d73('0x11')](function(_0x24aecc){_0x26e87e(_0x24aecc);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1b')]=function(_0x5b21fe,_0x21faff){var _0x59b4cf=this;this[_0x2d73('0xb')]['getSoundById'](_0x5b21fe)['then'](function(_0x1458b7){_0x21faff(null,_0x1458b7?_0x59b4cf[_0x2d73('0x1c')](_0x1458b7['save_name']):![]);})['catch'](function(_0x1beaef){_0x21faff(_0x1beaef);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1d')]=function(_0x5955a8,_0x4a47d3){this[_0x2d73('0xb')][_0x2d73('0x1e')](_0x5955a8)[_0x2d73('0xf')](function(_0x4b22b6){_0x4a47d3(null,_0x4b22b6?_0x4b22b6:![]);})['catch'](function(_0x100bca){_0x4a47d3(_0x100bca);});};AGIVertices['prototype'][_0x2d73('0x1f')]=function(_0x34cb34,_0x376de7,_0x207aad){this[_0x2d73('0xc')][_0x2d73('0x1f')](_0x34cb34,_0x376de7)[_0x2d73('0xf')](function(){_0x207aad(null);})[_0x2d73('0x11')](function(_0x300be8){_0x207aad(_0x300be8);});};AGIVertices[_0x2d73('0xd')]['getIntervals']=function(_0x2de7c9,_0x537e64){this[_0x2d73('0xb')]['getIntervalById'](_0x2de7c9)[_0x2d73('0xf')](function(_0x28bc43){if(_0x28bc43){if(_0x28bc43[_0x2d73('0x20')]){_0x537e64(null,[_0x28bc43[_0x2d73('0x21')]]);}else{_0x537e64(null,_[_0x2d73('0x22')](_0x28bc43[_0x2d73('0x23')],_0x2d73('0x21')));}}else{_0x537e64(null,![]);}})[_0x2d73('0x11')](function(_0x4a3980){_0x537e64(_0x4a3980);});};AGIVertices[_0x2d73('0xd')]['getSoundPath']=function(_0x3c4c11){return util[_0x2d73('0x24')](_0x2d73('0x25'),FILES_PATH,_0x3c4c11);};AGIVertices[_0x2d73('0xd')][_0x2d73('0x26')]=function(_0x1fcb4f,_0x48c626,_0x59969a){odbc[_0x2d73('0x27')](_0x1fcb4f,function(_0x403f36){if(_0x403f36){logger['error'](_0x2d73('0x28'),_0x403f36);_0x59969a(_0x403f36);}else{logger[_0x2d73('0x29')](_0x2d73('0x2a'));odbc['query'](_0x48c626,function(_0x551fc7,_0x14c169){if(_0x551fc7){logger['info'](_0x2d73('0x2b'),_0x48c626);_0x59969a(_0x551fc7);}else{logger[_0x2d73('0x29')]('Query\x20executed\x20correctly\x20%s',_0x48c626);odbc[_0x2d73('0x2c')](function(_0x5c6304){if(_0x5c6304){logger[_0x2d73('0x2d')](_0x2d73('0x2e'),_0x5c6304);}_0x59969a(null,_0x14c169);});}});}});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x2f')]=function(_0x2f7064,_0x2cd461){this[_0x2d73('0xb')][_0x2d73('0x30')](_0x2f7064)[_0x2d73('0xf')](function(_0x5ca027){_0x2cd461(null,_0x5ca027?_0x5ca027:![]);})['catch'](function(_0x5cf801){_0x2cd461(_0x5cf801);});};AGIVertices['prototype'][_0x2d73('0x31')]=function(_0x360bf1,_0x1f6ba5){this['rpc'][_0x2d73('0x31')](_0x360bf1)[_0x2d73('0xf')](function(_0x11ad78){_0x1f6ba5(null,_0x11ad78);})[_0x2d73('0x11')](function(_0xa910d5){_0x1f6ba5(_0xa910d5);});};AGIVertices['prototype'][_0x2d73('0x32')]=function(_0x31c6b3,_0x2c3068,_0x53b4f2){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x2d73('0xa')][_0x2d73('0x33')],'node':_0x31c6b3[_0x2d73('0x34')],'application':_0x31c6b3[_0x2d73('0x35')],'data':_0x2c3068||null,'project_name':this['channel'][_0x2d73('0x36')],'callerid':this[_0x2d73('0xa')][_0x2d73('0x37')]})[_0x2d73('0xf')](function(_0x5dd170){if(_0x53b4f2){_0x53b4f2(null,_0x5dd170);}})[_0x2d73('0x11')](function(_0x147d66){if(_0x53b4f2){_0x53b4f2(_0x147d66);}});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x38')]=function(_0x4918c4,_0x5f2e35,_0x1c2243,_0x40db79){this[_0x2d73('0xb')][_0x2d73('0x38')]({'uniqueid':this['channel'][_0x2d73('0x33')],'callerid':this[_0x2d73('0xa')][_0x2d73('0x37')],'calleridname':this['channel'][_0x2d73('0x39')],'context':this[_0x2d73('0xa')]['context'],'extension':this[_0x2d73('0xa')][_0x2d73('0x3a')],'priority':this[_0x2d73('0xa')][_0x2d73('0x3b')],'accountcode':this['channel'][_0x2d73('0x3c')],'dnid':this[_0x2d73('0xa')][_0x2d73('0x3d')],'projectName':this[_0x2d73('0xa')][_0x2d73('0x36')],'saveName':_0x5f2e35,'filename':_0x4918c4['file']||_0x5f2e35,'savePath':_0x1c2243})[_0x2d73('0xf')](function(_0x47e346){_0x40db79(null,_0x47e346);})['catch'](function(_0x3c7e19){_0x40db79(_0x3c7e19);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x3e')]=function(_0x5190b3,_0x2b6554,_0x580e7a,_0x4dc270,_0x2033c9){this[_0x2d73('0xb')][_0x2d73('0x3e')]({'uniqueid':this[_0x2d73('0xa')]['uniqueid'],'body':_0x5190b3,'direction':_0x2b6554,'providerName':_0x580e7a,'providerResponse':_0x4dc270})[_0x2d73('0xf')](function(_0x27c737){if(_0x2033c9){_0x2033c9(null,_0x27c737);}})['catch'](function(_0x13dbd3){if(_0x2033c9){_0x2033c9(_0x13dbd3);}});};AGIVertices['prototype'][_0x2d73('0x3f')]=function(_0x31e052,_0x29ce8a){this[_0x2d73('0xb')]['createCmContact']({'firstName':_[_0x2d73('0x40')](_0x31e052['name'])||_[_0x2d73('0x41')](_0x31e052['name'])?_0x2d73('0x42')+Math[_0x2d73('0x43')]():_0x31e052[_0x2d73('0x10')],'lastName':_['isEmpty'](_0x31e052[_0x2d73('0x44')])||_[_0x2d73('0x41')](_0x31e052[_0x2d73('0x44')])?null:_0x31e052[_0x2d73('0x44')],'phone':_0x31e052['phone'],'ListId':_0x31e052[_0x2d73('0x45')],'scheduledat':_0x31e052['scheduledAt'],'callbackUniqueid':this[_0x2d73('0xa')]['uniqueid'],'tags':_0x2d73('0x46'),'description':'Callback\x20scheduled\x20at\x20'+_0x31e052[_0x2d73('0x47')][_0x2d73('0x48')](),'priority':_0x31e052[_0x2d73('0x49')]})[_0x2d73('0xf')](function(_0x2b4090){_0x29ce8a(null,_0x2b4090);})[_0x2d73('0x11')](function(_0x2b0f60){_0x29ce8a(_0x2b0f60);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x4a')]=function(_0x28b4ee,_0x2d41cf){this[_0x2d73('0xb')]['getPauseById'](_0x28b4ee)[_0x2d73('0xf')](function(_0x285b18){_0x2d41cf(null,_0x285b18?_0x285b18['name']:![]);})[_0x2d73('0x11')](function(_0x205cfa){_0x2d41cf(_0x205cfa);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x4b')]=function(_0x2d5372,_0x1e5b04,_0x86d85a){var _0x23e35d={'role':'agent'};_0x23e35d[_0x2d5372]=this[_0x2d73('0xa')]['callerid'];this[_0x2d73('0xb')][_0x2d73('0x4b')](_0x23e35d,_0x1e5b04,this[_0x2d73('0xa')]['uniqueid'])[_0x2d73('0xf')](function(_0x1d1249){_0x86d85a(null,_[_0x2d73('0x41')](_0x1d1249)?![]:!![]);})['catch'](function(_0xa38777){logger[_0x2d73('0x2d')](_0xa38777);_0x86d85a(null,![]);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x4c')]=function(_0x3b3666,_0x1b4b46){var _0x552732={'role':_0x2d73('0x4d')};_0x552732[_0x3b3666]=this[_0x2d73('0xa')]['callerid'];this[_0x2d73('0xb')]['agentUnpause'](_0x552732)['then'](function(_0x61dc82){_0x1b4b46(null,_[_0x2d73('0x41')](_0x61dc82)?![]:!![]);})[_0x2d73('0x11')](function(_0x42f839){logger[_0x2d73('0x2d')](_0x42f839);_0x1b4b46(null,![]);});};AGIVertices['prototype'][_0x2d73('0x4e')]=function(_0x125fce,_0x4efd8e){var _0x2254d1={'role':_0x2d73('0x4d')};_0x2254d1[_0x125fce]=this[_0x2d73('0xa')][_0x2d73('0x37')];this[_0x2d73('0xb')][_0x2d73('0x4e')](_0x2254d1)['then'](function(_0x1afc81){_0x4efd8e(null,_['isNil'](_0x1afc81)?![]:!![]);})[_0x2d73('0x11')](function(_0x1f690b){logger['error'](_0x1f690b);_0x4efd8e(null,![]);});};AGIVertices['prototype'][_0x2d73('0x4f')]=function(_0x5f4b0a,_0x1973a6){var _0x54bc06={'role':_0x2d73('0x4d')};_0x54bc06[_0x5f4b0a]=this[_0x2d73('0xa')][_0x2d73('0x37')];var _0x327954=_0x5f4b0a!=_0x2d73('0x50')?util[_0x2d73('0x24')](_0x2d73('0x51'),'LOCAL',this[_0x2d73('0xa')][_0x2d73('0x37')]):undefined;this[_0x2d73('0xb')]['agentLogin'](_0x54bc06,_0x327954)['then'](function(_0x1ea9c8){_0x1973a6(null,_[_0x2d73('0x41')](_0x1ea9c8)?![]:!![]);})[_0x2d73('0x11')](function(_0x5030f2){logger['error'](_0x5030f2);_0x1973a6(null,![]);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x52')]=function(_0x224dd4,_0x3a749c){sh[_0x2d73('0x53')](_[_0x2d73('0x54')](_0x224dd4),function(_0x37a6a8,_0x5e2969){var _0x20fa90=_0x5e2969[_0x2d73('0x55')](/(\r\n|\n|\r)/gm,'');_0x3a749c(null,_0x20fa90);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x56')]=function(_0x35ffc8,_0x2c3591){scripts['googleCloudTTS'](_0x35ffc8[_0x2d73('0x57')],_0x35ffc8[_0x2d73('0x58')]||'text',_0x35ffc8['text'],_0x35ffc8[_0x2d73('0x59')]||'en-US',_0x35ffc8[_0x2d73('0x5a')]||_0x2d73('0x5b'),_0x35ffc8[_0x2d73('0x5c')]||_0x2d73('0x5d'))[_0x2d73('0xf')](function(_0x2717af){_0x2c3591(null,_0x2717af);})[_0x2d73('0x11')](function(_0x74abf2){_0x2c3591(_0x74abf2);});};AGIVertices['prototype'][_0x2d73('0x5e')]=function(_0x91b0d,_0x263140){scripts[_0x2d73('0x5e')](_0x91b0d[_0x2d73('0x5f')],_0x91b0d[_0x2d73('0x60')]||'en',0x1)['then'](function(_0x347fe7){_0x263140(null,_0x347fe7);})[_0x2d73('0x11')](function(_0x1070e0){_0x263140(_0x1070e0);});};AGIVertices[_0x2d73('0xd')]['restAPI']=function(_0x127989,_0x1fd7ba){var _0x199dd6={'uri':_0x127989[_0x2d73('0x61')],'method':_0x127989['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x127989['timeout'])==='number'&&parseInt(_0x127989[_0x2d73('0x62')])>=0x1?parseInt(_0x127989['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x2d73('0x63')]([_0x2d73('0x64'),'PUT'],_0x199dd6['method'][_0x2d73('0x65')]())){try{_0x199dd6[_0x2d73('0x66')]=_0x127989[_0x2d73('0x7')]?JSON[_0x2d73('0x67')](_0x127989[_0x2d73('0x7')]):{};}catch(_0x1bee49){logger[_0x2d73('0x2d')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1bee49);}}try{_0x199dd6[_0x2d73('0x68')]=_0x127989[_0x2d73('0x69')]?JSON[_0x2d73('0x67')](_0x127989[_0x2d73('0x69')]):{};}catch(_0x17270b){logger[_0x2d73('0x2d')](_0x2d73('0x6a'),_0x17270b);}if(_0x127989[_0x2d73('0x6b')]){try{var _0x4e9d4d=require(_0x127989['computedVariables'])[_0x2d73('0x6c')](this,_0x199dd6);_0x199dd6['uri']=Mustache['render'](_0x127989[_0x2d73('0x61')],_0x4e9d4d,{},['$$','$$']);if(_0x199dd6[_0x2d73('0x68')]){_0x199dd6[_0x2d73('0x68')]=JSON[_0x2d73('0x67')](Mustache['render'](JSON['stringify'](_0x199dd6[_0x2d73('0x68')]),_0x4e9d4d,{},['$$','$$']));}if(_0x199dd6['body']){_0x199dd6[_0x2d73('0x66')]=JSON[_0x2d73('0x67')](Mustache['render'](JSON[_0x2d73('0x6d')](_0x199dd6[_0x2d73('0x66')]),_0x4e9d4d,{},['$$','$$']));}}catch(_0x5da61b){logger[_0x2d73('0x2d')](_0x2d73('0x6e'),_0x5da61b);}}rp(_0x199dd6)[_0x2d73('0xf')](function(_0x2b46fd){var _0x4f630d={'statusCode':_0x2b46fd[_0x2d73('0x6f')]||0xc8,'statusMessage':_0x2b46fd[_0x2d73('0x70')]||'OK','headers':_0x2b46fd[_0x2d73('0x68')]||{},'body':_0x2b46fd[_0x2d73('0x66')]||{}};_0x1fd7ba(null,_0x4f630d);})[_0x2d73('0x11')](function(_0x11c174){var _0x1d75eb={'statusCode':_0x11c174[_0x2d73('0x6f')]||0x1f4,'statusMessage':_0x11c174[_0x2d73('0x71')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x11c174[_0x2d73('0x72')][_0x2d73('0x68')]||{},'body':_0x11c174['options'][_0x2d73('0x66')]||{}};_0x1fd7ba(null,_0x1d75eb);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x73')]=function(_0x208a1f,_0x74656){scripts[_0x2d73('0x73')](this[_0x2d73('0xa')][_0x2d73('0x33')],_0x208a1f[_0x2d73('0x74')],_0x208a1f[_0x2d73('0x5f')],_0x208a1f[_0x2d73('0x75')]||'en')['then'](function(_0x3733a7){_0x74656(null,_0x3733a7);})['catch'](function(_0x22bfc5){_0x74656(_0x22bfc5);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x76')]=function(_0x2ca6bb,_0x31d8dc){scripts[_0x2d73('0x76')](this[_0x2d73('0xa')][_0x2d73('0x33')],_0x2ca6bb['dialogflowV2_project_id'],_0x2ca6bb[_0x2d73('0x77')],_0x2ca6bb['private_key'],_0x2ca6bb[_0x2d73('0x5f')],_0x2ca6bb['dialogflowV2_language']||'en')[_0x2d73('0xf')](function(_0x2bc1cf){_0x31d8dc(null,_0x2bc1cf);})[_0x2d73('0x11')](function(_0x228b4e){_0x31d8dc(_0x228b4e);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x78')]=function(_0x1d6c9b,_0x36a6a2){scripts[_0x2d73('0x78')](this[_0x2d73('0xa')],_0x1d6c9b)[_0x2d73('0xf')](function(_0x4c7d09){_0x36a6a2(null,_0x4c7d09);})[_0x2d73('0x11')](function(_0xe9a28a){_0x36a6a2(_0xe9a28a);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x79')]=function(_0x592f02,_0x5c5e75){scripts[_0x2d73('0x79')](_0x592f02['key'],_0x592f02['text'],_0x592f02[_0x2d73('0x7a')]||_0x2d73('0x7b'),_0x592f02[_0x2d73('0x7c')])[_0x2d73('0xf')](function(_0x115b80){_0x5c5e75(null,_0x115b80);})[_0x2d73('0x11')](function(_0x3494b7){_0x5c5e75(_0x3494b7);});};AGIVertices[_0x2d73('0xd')]['ispeechASR']=function(_0x153f6c,_0x1f16ed,_0x39a3b9){scripts[_0x2d73('0x7d')](_0x1f16ed,_0x153f6c['key'],_0x153f6c['ispeech_asr_language']||_0x2d73('0x7b'),this[_0x2d73('0x7e')](_0x153f6c[_0x2d73('0x7f')])?_0x153f6c[_0x2d73('0x7f')]:undefined)[_0x2d73('0xf')](function(_0x3f82e5){_0x39a3b9(null,_0x3f82e5);})[_0x2d73('0x11')](function(_0x158f68){_0x39a3b9(_0x158f68);});};AGIVertices[_0x2d73('0xd')]['awsPolly']=function(_0x7e4790,_0x561c2b){scripts[_0x2d73('0x80')](_0x7e4790[_0x2d73('0x81')],_0x7e4790[_0x2d73('0x82')],_0x7e4790[_0x2d73('0x83')],_0x7e4790[_0x2d73('0x84')]||'Amy',_0x7e4790[_0x2d73('0x5f')],_0x7e4790[_0x2d73('0x85')]||_0x2d73('0x5f'))['then'](function(_0x209947){_0x561c2b(null,_0x209947);})[_0x2d73('0x11')](function(_0x341478){_0x561c2b(_0x341478);});};AGIVertices['prototype'][_0x2d73('0x86')]=function(_0x44c17d,_0x16206c){scripts['awsLex'](this['channel'][_0x2d73('0x33')],_0x44c17d[_0x2d73('0x81')],_0x44c17d[_0x2d73('0x82')],_0x44c17d[_0x2d73('0x87')],_0x44c17d['text'],_0x44c17d[_0x2d73('0x88')])[_0x2d73('0xf')](function(_0x5e88ed){_0x16206c(null,_0x5e88ed);})['catch'](function(_0xcdab26){_0x16206c(_0xcdab26);});};AGIVertices[_0x2d73('0xd')]['googleASR']=function(_0x4a4f54,_0x41ff13,_0x16a95e){scripts['googleASR'](_0x41ff13,_0x4a4f54[_0x2d73('0x74')],_0x4a4f54[_0x2d73('0x89')]||_0x2d73('0x7b'))[_0x2d73('0xf')](function(_0x1d4d71){_0x16a95e(null,_0x1d4d71);})[_0x2d73('0x11')](function(_0x335834){_0x16a95e(_0x335834);});};AGIVertices[_0x2d73('0xd')][_0x2d73('0x8a')]=function(_0x6c8fcf,_0x358247,_0x1f1b01){scripts[_0x2d73('0x8a')](_0x358247,_0x6c8fcf[_0x2d73('0x8b')],_0x6c8fcf[_0x2d73('0x8c')],_0x6c8fcf[_0x2d73('0x8d')])[_0x2d73('0xf')](function(_0x2488ce){_0x1f1b01(null,_0x2488ce);})[_0x2d73('0x11')](function(_0x2e6155){_0x1f1b01(_0x2e6155);});};AGIVertices[_0x2d73('0xd')]['clear']=function(_0x5cc89f){var _0x5014a3=_['includes'](verticesWithRetry,_0x5cc89f[_0x2d73('0x35')])?_0x5cc89f:_[_0x2d73('0x8e')](_0x5cc89f);for(var _0x1733e9 in _0x5014a3){if(_0x5014a3[_0x2d73('0x8f')](_0x1733e9)){if(_0x5014a3[_0x1733e9]&&_['isString'](_0x5014a3[_0x1733e9])){if(_['includes'](recursiveMapAttributes,_0x1733e9)){_0x5014a3[_0x1733e9]=this[_0x2d73('0x90')](_0x5014a3[_0x1733e9]);}else{_0x5014a3[_0x1733e9]=this[_0x2d73('0x91')](_0x5014a3[_0x1733e9]);}}}}return _0x5014a3;};AGIVertices[_0x2d73('0xd')]['recursiveNodeIndex']=function(_0x21bfc6){for(var _0x2b6f2b in _0x21bfc6){if(_0x21bfc6[_0x2d73('0x8f')](_0x2b6f2b)){if(_['isPlainObject'](_0x21bfc6[_0x2b6f2b])){this['recursiveNodeIndex'](_0x21bfc6[_0x2b6f2b]);}else if(_['isArray'](_0x21bfc6[_0x2b6f2b])){for(var _0x50f96f=0x0;_0x50f96f<_0x21bfc6[_0x2b6f2b]['length'];_0x50f96f++){this['recursiveNodeIndex'](_0x21bfc6[_0x2b6f2b][_0x50f96f]);}}else if(_[_0x2d73('0x92')](_0x21bfc6[_0x2b6f2b])){_0x21bfc6[_0x2b6f2b]=this[_0x2d73('0x91')](_0x21bfc6[_0x2b6f2b]);}}}};AGIVertices[_0x2d73('0xd')]['saveRestApiResult']=function(_0x11394d,_0x5a01f7){for(var _0x25531f in _0x11394d){if(_0x11394d[_0x2d73('0x8f')](_0x25531f)){if(_[_0x2d73('0x93')](_0x11394d[_0x25531f])){if(!_[_0x2d73('0x40')](_0x11394d[_0x25531f])){this[_0x2d73('0x94')](_0x11394d[_0x25531f],util[_0x2d73('0x24')](_0x2d73('0x95'),_0x5a01f7,_0x25531f));}}else if(_['isArray'](_0x11394d[_0x25531f])){for(var _0x5b3fc2=0x0;_0x5b3fc2<_0x11394d[_0x25531f][_0x2d73('0x96')];_0x5b3fc2++){this[_0x2d73('0x94')](_0x11394d[_0x25531f][_0x5b3fc2],util['format'](_0x2d73('0x95'),_0x5a01f7,_0x25531f+'['+_0x5b3fc2+']'));}}else{if(!_[_0x2d73('0x41')](_0x11394d[_0x25531f])){this[_0x2d73('0xa')]['setVariable'](util[_0x2d73('0x24')](_0x2d73('0x95'),_0x5a01f7,_0x25531f),_0x11394d[_0x25531f]);}}}}};AGIVertices[_0x2d73('0xd')][_0x2d73('0x90')]=function(_0x9cf57b){try{var _0x2a3a11=JSON[_0x2d73('0x67')](_0x9cf57b);this[_0x2d73('0x97')](_0x2a3a11);return JSON[_0x2d73('0x6d')](_0x2a3a11);}catch(_0x4fc488){return this[_0x2d73('0x91')](_0x9cf57b);}};AGIVertices['prototype'][_0x2d73('0x91')]=function(_0xf59601){var _0x5184db=_0xf59601[_0x2d73('0x98')]('{');for(var _0x3c51dd=0x1;_0x3c51dd<_0x5184db[_0x2d73('0x96')];_0x3c51dd+=0x1){var _0x2ee797=_0x5184db[_0x3c51dd][_0x2d73('0x98')]('}');if(_0x2ee797[_0x2d73('0x96')]>0x1){_0xf59601=_0xf59601[_0x2d73('0x99')]('{'+_0x2ee797[0x0]+'}',this[_0x2d73('0xa')][_0x2d73('0x9a')](_0x2ee797[0x0])[_0x2d73('0x9b')]||_0x2ee797[0x0]);}}if(_0x5184db[_0x2d73('0x96')]===0x1){return _0xf59601['toString']();}return this[_0x2d73('0x91')](_0xf59601);};AGIVertices[_0x2d73('0xd')]['getAndSetVariable']=function(_0x3a04d8,_0x9afb84){var _0x4aebf0=this[_0x2d73('0xa')][_0x2d73('0x9a')](_0x3a04d8);if(_0x4aebf0[_0x2d73('0x9c')]===-0x1){return _0x4aebf0;}logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x9afb84,_0x4aebf0['extra']));return this[_0x2d73('0xa')][_0x2d73('0x9d')](_0x9afb84,_0x4aebf0['extra']);};AGIVertices[_0x2d73('0xd')][_0x2d73('0x7e')]=function(_0x4bc14d){return _0x4bc14d&&_0x4bc14d!=='0'&&_0x4bc14d!=='-1'&&_0x4bc14d!=='';};AGIVertices[_0x2d73('0xd')][_0x2d73('0x9e')]=function(_0x5c904e){this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x5c904e,'-');_0x5c904e[_0x2d73('0x9f')]=_0x5c904e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2d73('0xd')][_0x2d73('0xa0')]=function(_0x5ce9a3){logger[_0x2d73('0x29')](util['format'](_0x2d73('0xa1'),_0x5ce9a3[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x5ce9a3[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}var _0x36279b='\x22'+_0x5ce9a3['text']+'\x22';if(this['isConfigured'](_0x5ce9a3['options'])){_0x36279b+=','+_0x5ce9a3['options'];}var _0x1dd75f=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xa4'),_0x36279b);if(_0x1dd75f['result']===-0x1){return _0x1dd75f;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x36279b));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xa5')]=function(_0x57da70){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x57da70[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x57da70['grammar'])){return this[_0x2d73('0xa')]['noop'](_0x2d73('0xa6'));}var _0x11810f=_0x57da70[_0x2d73('0xa7')];if(this[_0x2d73('0x7e')](_0x57da70[_0x2d73('0x72')])){_0x11810f+=','+_0x57da70['options'];}var _0x54249a=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xa8'),_0x11810f);if(_0x54249a[_0x2d73('0x9c')]===-0x1){return _0x54249a;}var _0x251e3c=this['getAndSetVariable'](_0x2d73('0xa9'),_0x2d73('0xaa'));if(_0x251e3c[_0x2d73('0x9c')]===-0x1){return _0x251e3c;}var _0x570121=this[_0x2d73('0xab')]('RECOG_INPUT()',_0x2d73('0xac'));if(_0x570121[_0x2d73('0x9c')]===-0x1){return _0x570121;}var _0x360705=this['getAndSetVariable'](_0x2d73('0xad'),'MRCP_RECOG_INSTANCE');if(_0x360705[_0x2d73('0x9c')]===-0x1){return _0x360705;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xae'),_0x11810f));};AGIVertices[_0x2d73('0xd')]['agi']=function(_0x264f0d){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xaf'),_0x264f0d[_0x2d73('0x34')]));return this[_0x2d73('0xa')][_0x2d73('0x4')]([_0x264f0d[_0x2d73('0xb0')],_0x264f0d['args']]);};AGIVertices[_0x2d73('0xd')]['answer']=function(_0x3dcc0b){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xb1'),_0x3dcc0b['label']));if(this[_0x2d73('0x7e')](_0x3dcc0b[_0x2d73('0x62')])){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xb2'),_0x3dcc0b['timeout']));var _0x50ace1=this['channel'][_0x2d73('0xb3')](_0x3dcc0b[_0x2d73('0x62')]);if(_0x50ace1[_0x2d73('0x9c')]===-0x1){return _0x50ace1;}}return this[_0x2d73('0xa')]['answer']();};AGIVertices['prototype']['callback']=function(_0x14dacd){logger[_0x2d73('0x29')](util['format'](_0x2d73('0xb4'),_0x14dacd['label']));if(!this[_0x2d73('0x7e')](_0x14dacd[_0x2d73('0x45')])){return this[_0x2d73('0xa')]['error'](_0x14dacd,'no\x20list\x20selected');}_0x14dacd[_0x2d73('0x47')]=moment();if(this[_0x2d73('0x7e')](_0x14dacd[_0x2d73('0xb5')])){_0x14dacd[_0x2d73('0x47')]=moment()['add'](_0x14dacd[_0x2d73('0xb5')],_0x2d73('0xb6'));}if(!this[_0x2d73('0x7e')](_0x14dacd[_0x2d73('0x49')])){_0x14dacd[_0x2d73('0x49')]=0x2;}this[_0x2d73('0x3f')][_0x2d73('0x6c')](this,_0x14dacd);return this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xb7'),_0x14dacd['phone'],_0x14dacd[_0x2d73('0x45')],_0x14dacd[_0x2d73('0x47')]));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xb8')]=function(_0xf0cc46){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xb9'),_0xf0cc46['label']));var _0x101309=this[_0x2d73('0xa')]['exec'](_0xf0cc46[_0x2d73('0xba')],_0xf0cc46[_0x2d73('0x72')]);if(_0x101309[_0x2d73('0x9c')]===-0x1){return _0x101309;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xbb'),_0xf0cc46['application'],_0xf0cc46[_0x2d73('0x72')]));};AGIVertices['prototype'][_0x2d73('0xbc')]=function(_0x712599){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x712599[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x712599[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}var _0x22af2f='\x22'+_0x712599[_0x2d73('0x5f')]+'\x22';if(this[_0x2d73('0x7e')](_0x712599[_0x2d73('0x72')])){_0x22af2f+=','+_0x712599[_0x2d73('0x72')];}var _0x571951=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xa4'),_0x22af2f);if(_0x571951[_0x2d73('0x9c')]===-0x1){return _0x571951;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x22af2f));};AGIVertices['prototype'][_0x2d73('0xbd')]=function(_0x485347){logger[_0x2d73('0x29')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x485347[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x485347['text'])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}var _0x24c78a='\x22'+_0x485347[_0x2d73('0x5f')]+'\x22';if(this[_0x2d73('0x7e')](_0x485347['options'])){_0x24c78a+=','+_0x485347[_0x2d73('0x72')];}var _0x21ab6c=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xa4'),_0x24c78a);if(_0x21ab6c[_0x2d73('0x9c')]===-0x1){return _0x21ab6c;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x24c78a));};AGIVertices['prototype'][_0x2d73('0xbe')]=function(_0x34965a){logger[_0x2d73('0x29')](util['format'](_0x2d73('0xbf'),_0x34965a['label']));if(!this[_0x2d73('0x7e')](_0x34965a[_0x2d73('0xa7')])){return this[_0x2d73('0xa')]['noop'](_0x2d73('0xa6'));}var _0x54cb7f=_0x34965a[_0x2d73('0xa7')];if(this['isConfigured'](_0x34965a[_0x2d73('0x72')])){_0x54cb7f+=','+_0x34965a['options'];}var _0xcb9d5d=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xa8'),_0x54cb7f);if(_0xcb9d5d[_0x2d73('0x9c')]===-0x1){return _0xcb9d5d;}var _0x3f1281=this[_0x2d73('0xab')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x3f1281['result']===-0x1){return _0x3f1281;}var _0xef837f=this[_0x2d73('0xab')](_0x2d73('0xc0'),_0x2d73('0xc1'));if(_0xef837f[_0x2d73('0x9c')]===-0x1){return _0xef837f;}var _0x2c30dc=this[_0x2d73('0xab')](_0x2d73('0xad'),_0x2d73('0xc2'));if(_0x2c30dc['result']===-0x1){return _0x2c30dc;}return this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xae'),_0x54cb7f));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xc3')]=function(_0x5b5a52){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5b5a52[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x5b5a52[_0x2d73('0xa7')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa6'));}var _0x2cd954=_0x5b5a52['grammar'];if(this[_0x2d73('0x7e')](_0x5b5a52[_0x2d73('0x72')])){_0x2cd954+=','+_0x5b5a52['options'];}var _0x3380b8=this['channel'][_0x2d73('0x53')](_0x2d73('0xa8'),_0x2cd954);if(_0x3380b8[_0x2d73('0x9c')]===-0x1){return _0x3380b8;}var _0x7c25b5=this['getAndSetVariable'](_0x2d73('0xa9'),_0x2d73('0xc4'));if(_0x7c25b5[_0x2d73('0x9c')]===-0x1){return _0x7c25b5;}var _0x17c70a=this[_0x2d73('0xab')](_0x2d73('0xc0'),'SESTEK_ASR_TRANSCRIPT');if(_0x17c70a[_0x2d73('0x9c')]===-0x1){return _0x17c70a;}var _0x23d0b9=this[_0x2d73('0xab')](_0x2d73('0xad'),_0x2d73('0xc5'));if(_0x23d0b9[_0x2d73('0x9c')]===-0x1){return _0x23d0b9;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xae'),_0x2cd954));};AGIVertices[_0x2d73('0xd')]['database']=function(_0x243ff7){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xc6'),_0x243ff7['label']));if(!this[_0x2d73('0x7e')](_0x243ff7[_0x2d73('0xc7')])){return this['channel']['error'](_0x243ff7,_0x2d73('0xc8'));}var _0x48a87b=this[_0x2d73('0x15')]['sync'](this,_0x243ff7[_0x2d73('0xc7')]);if(!_0x48a87b){return this[_0x2d73('0xa')]['error'](_0x243ff7,'no\x20odbc\x20database\x20found');}if(!this[_0x2d73('0x7e')](_0x243ff7[_0x2d73('0xc9')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x243ff7,_0x2d73('0xca'));}var _0x25018a=_0x243ff7[_0x2d73('0xc9')][_0x2d73('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x2d73('0xa')]['noop'](util['format']('query:\x20%s',_0x25018a));var _0x3db071=this[_0x2d73('0x26')]['sync'](this,_0x48a87b,_0x25018a);this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x243ff7,_0x25018a);if(!this['isConfigured'](_0x243ff7['variable_id'])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xcb'));}var _0x18d9ee=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x243ff7['variable_id']);if(!_0x18d9ee){return this['channel'][_0x2d73('0x2d')](_0x243ff7,'no\x20variable\x20found');}var _0x151442=this;_0x3db071[_0x2d73('0xcc')](function(_0x399b00,_0x3b960a){Object[_0x2d73('0xcd')](_0x399b00)['forEach'](function(_0x33ad2f){_0x151442[_0x2d73('0xa')][_0x2d73('0x9d')](util['format']('%s[%s][%s]',_0x18d9ee,_0x3b960a,_0x33ad2f),_0x399b00[_0x33ad2f]);});});this['channel']['setVariable'](util[_0x2d73('0x24')](_0x2d73('0xce'),_0x18d9ee),_0x3db071['length']);return this['channel']['noop'](util['format']('variable\x20%s\x20set',_0x18d9ee));};AGIVertices['prototype'][_0x2d73('0xcf')]=function(_0x14f6f3){logger[_0x2d73('0xd0')](util['format'](_0x2d73('0xd1'),_0x14f6f3[_0x2d73('0x34')]));if(!this['isConfigured'](_0x14f6f3[_0x2d73('0xd2')])){return this['channel'][_0x2d73('0x2d')](_0x14f6f3,_0x2d73('0xd3'));}var _0xadf60f=this[_0x2d73('0xd4')][_0x2d73('0x6c')](this,_0x14f6f3[_0x2d73('0xd2')]);if(!_0xadf60f){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x14f6f3,'no\x20user\x20found');}var _0x4c54d6=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0xd5'),[util[_0x2d73('0x24')](_0x2d73('0xd6'),_0xadf60f),_0x14f6f3[_0x2d73('0x62')],_0x14f6f3[_0x2d73('0xd7')],_0x14f6f3[_0x2d73('0x61')]]);if(_0x4c54d6[_0x2d73('0x9c')]===-0x1){return _0x4c54d6;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xd8'),_0x2d73('0xd5')));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xd9')]=function(_0x278898){logger[_0x2d73('0x29')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x278898[_0x2d73('0x34')]));if(!this['isConfigured'](_0x278898[_0x2d73('0x74')])){return this['channel'][_0x2d73('0xa2')](_0x2d73('0xda'));}if(!this[_0x2d73('0x7e')](_0x278898['text'])){return this[_0x2d73('0xa')]['noop']('no\x20text\x20configured');}this[_0x2d73('0xa')][_0x2d73('0xdb')]=!![];this[_0x2d73('0x32')](_0x278898);this['createSquareMessage'](_0x278898['text'],'in','','');this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Trying\x20Dialogflow:\x20%s',_0x278898['text']));var _0x39ece1=this[_0x2d73('0x73')][_0x2d73('0x6c')](this,_0x278898);if(_0x39ece1){for(var _0x1fd43b in _0x39ece1){if(_0x39ece1[_0x2d73('0x8f')](_0x1fd43b)){this[_0x2d73('0xa')][_0x2d73('0x9d')](util['format'](_0x2d73('0xdc'),_0x1fd43b['toUpperCase']()),_0x39ece1[_0x1fd43b]);}}this['createSquareMessage'](_0x39ece1[_0x2d73('0xdd')],'out',_0x2d73('0xd9'),'');return this['channel']['noop'](util[_0x2d73('0x24')](_0x2d73('0xde'),_0x39ece1[_0x2d73('0xdd')]));}return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x278898,_0x2d73('0xdf'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xe0')]=function(_0x5cb7a3){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5cb7a3[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x5cb7a3['dialogflowV2_project_id'])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xe1'));}if(!this[_0x2d73('0x7e')](_0x5cb7a3[_0x2d73('0x77')])){return this['channel']['noop'](_0x2d73('0xe2'));}if(!this[_0x2d73('0x7e')](_0x5cb7a3[_0x2d73('0xe3')])){return this[_0x2d73('0xa')]['noop'](_0x2d73('0xe4'));}if(!this[_0x2d73('0x7e')](_0x5cb7a3[_0x2d73('0xe5')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')]('no\x20anguage\x20configured');}if(!this[_0x2d73('0x7e')](_0x5cb7a3[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}this[_0x2d73('0xa')][_0x2d73('0xdb')]=!![];this[_0x2d73('0x32')](_0x5cb7a3);this[_0x2d73('0x3e')](_0x5cb7a3[_0x2d73('0x5f')],'in','','');this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xe6'),_0x5cb7a3['text']));var _0x194137=this[_0x2d73('0x76')][_0x2d73('0x6c')](this,_0x5cb7a3);if(_0x194137){for(var _0x13bebc in _0x194137){if(_0x194137[_0x2d73('0x8f')](_0x13bebc)){if(_0x13bebc!==_0x2d73('0xe7')){this[_0x2d73('0xa')]['setVariable'](util[_0x2d73('0x24')]('DIALOGFLOW_%s',_0x13bebc[_0x2d73('0x65')]()),_0x194137[_0x13bebc]);}}}this[_0x2d73('0x3e')](_0x194137[_0x2d73('0xdd')],_0x2d73('0xe8'),'dialogflowV2',_0x194137[_0x2d73('0xe7')]);return this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xe9'),_0x194137[_0x2d73('0xdd')]));}return this[_0x2d73('0xa')]['error'](_0x5cb7a3,_0x2d73('0xea'));};AGIVertices['prototype']['sesteknda']=function(_0x21ea13){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xeb'),_0x21ea13[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x21ea13[_0x2d73('0xec')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xed'));}if(!this[_0x2d73('0x7e')](_0x21ea13[_0x2d73('0xee')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xef'));}if(!this[_0x2d73('0x7e')](_0x21ea13[_0x2d73('0xf0')])){return this['channel'][_0x2d73('0xa2')]('no\x20password\x20configured');}if(!this[_0x2d73('0x7e')](_0x21ea13[_0x2d73('0xf1')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}this[_0x2d73('0xa')]['bot']=!![];this[_0x2d73('0x32')](_0x21ea13);this['createSquareMessage'](_0x21ea13[_0x2d73('0x5f')],'in','','');this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xf2'),_0x21ea13['text']));var _0x886263=this[_0x2d73('0x78')]['sync'](this,_0x21ea13);if(_0x886263){for(var _0x574922 in _0x886263){if(_0x886263[_0x2d73('0x8f')](_0x574922)){this[_0x2d73('0xa')][_0x2d73('0x9d')](util[_0x2d73('0x24')](_0x2d73('0xf3'),_0x574922[_0x2d73('0x65')]()),_0x886263[_0x574922]);}}this[_0x2d73('0x3e')](_0x886263['speech'],_0x2d73('0xe8'),_0x2d73('0xf4'),'');if(_0x886263[_0x2d73('0xf5')]){this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x886263[_0x2d73('0xf5')]));var _0x929100=this['channel'][_0x2d73('0xf6')](_0x886263['audiofile']);try{fs[_0x2d73('0xf7')](_0x886263[_0x2d73('0xf5')]+_0x2d73('0xf8'));}catch(_0x46431a){logger[_0x2d73('0x2d')](_0x46431a);}return _0x929100;}else{return this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0xf9'),_0x886263[_0x2d73('0xdd')]));}}return this['channel']['error'](_0x21ea13,_0x2d73('0xfa'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xfb')]=function(_0x59426f){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xfc'),_0x59426f[_0x2d73('0x34')]));return this[_0x2d73('0xa')]['noop'](_0x2d73('0xfb'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0xfd')]=function(_0x36db64){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0xfe'),_0x36db64[_0x2d73('0x34')]));var _0x7e9e24='';if(_0x36db64[_0x2d73('0xff')]){if(!this[_0x2d73('0x7e')](_0x36db64[_0x2d73('0xff')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x36db64,_0x2d73('0x100'));}else{var _0x8fe9a2=parseInt(_0x36db64[_0x2d73('0xff')],0xa);if(isNaN(_0x8fe9a2)){_0x7e9e24=_0x36db64[_0x2d73('0xff')];}else{_0x7e9e24=this[_0x2d73('0x19')][_0x2d73('0x6c')](this,_0x36db64[_0x2d73('0xff')]);if(!_0x7e9e24){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x36db64,_0x2d73('0x101'));}}}}else if(_0x36db64[_0x2d73('0x102')]){_0x7e9e24=_0x36db64[_0x2d73('0x102')];}else{return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x36db64,_0x2d73('0x100'));}var _0x15a934=this['channel'][_0x2d73('0x53')](_0x2d73('0xd5'),[util['format'](_0x2d73('0x103'),_0x7e9e24,_0x36db64[_0x2d73('0x104')]),_0x36db64[_0x2d73('0x62')],_0x36db64[_0x2d73('0xd7')],_0x36db64[_0x2d73('0x61')]]);if(_0x15a934[_0x2d73('0x9c')]===-0x1){return _0x15a934;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xd8'),_0x2d73('0xd5')));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x105')]=function(_0x1fd395){logger['info'](util[_0x2d73('0x24')](_0x2d73('0x106'),_0x1fd395[_0x2d73('0x34')]));return this[_0x2d73('0xa')][_0x2d73('0xa2')]('finally');};AGIVertices[_0x2d73('0xd')]['getdigits']=function(_0x410bb0){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x410bb0['label']));if(_0x410bb0[_0x2d73('0x9f')]===0x0){return this[_0x2d73('0x9e')](_0x410bb0);}_0x410bb0[_0x2d73('0x9f')]-=0x1;if(!this['isConfigured'](_0x410bb0[_0x2d73('0x107')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x410bb0,_0x2d73('0x108'));}var _0x32f4df=this['getSound']['sync'](this,_0x410bb0[_0x2d73('0x107')]);if(!_0x32f4df){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x410bb0,_0x2d73('0x109'));}if(!this[_0x2d73('0x7e')](_0x410bb0[_0x2d73('0x10a')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x2d73('0xcb'));}var _0x2ea911=this[_0x2d73('0xa')][_0x2d73('0x10b')](_0x32f4df,_0x410bb0[_0x2d73('0x10c')],_0x410bb0[_0x2d73('0x10d')]);var _0x21e061=_0x2ea911[_0x2d73('0x9c')]?_0x2ea911[_0x2d73('0x9c')][_0x2d73('0x48')]():'';logger[_0x2d73('0x29')]('test',JSON[_0x2d73('0x6d')](_0x2ea911));if(_0x2ea911[_0x2d73('0x9c')]===-0x1){this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x410bb0,_0x21e061);return _0x2ea911;}else if(_0x2ea911[_0x2d73('0x9b')]===_0x2d73('0x62')){_0x2ea911[_0x2d73('0x9c')]=_0x21e061[_0x2d73('0x96')]>=parseInt(_0x410bb0['mindigit'])?'x':'i';}else{_0x2ea911['result']=_0x21e061['length']>=parseInt(_0x410bb0[_0x2d73('0x10e')])&&_0x21e061[_0x2d73('0x96')]<=parseInt(_0x410bb0[_0x2d73('0x10d')])?'x':'i';}var _0x14213a=this['getVariable'][_0x2d73('0x6c')](this,_0x410bb0[_0x2d73('0x10a')]);if(!_0x14213a){return this[_0x2d73('0xa')]['error'](_0x410bb0,'no\x20variable\x20found');}this[_0x2d73('0xa')]['setVariable'](_0x14213a,_0x21e061);if(this['isConfigured'](_0x410bb0[_0x2d73('0x10f')])){var _0x31fd77=parseInt(_0x410bb0[_0x2d73('0x10f')],0xa);var _0x7081ea=rs[_0x2d73('0x110')]({'charset':'*','length':_0x31fd77});var _0x3f83f2=_0x21e061[_0x2d73('0x96')];if(_0x3f83f2>0x0){if(_0x3f83f2>_0x31fd77){this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x410bb0,_0x410bb0[_0x2d73('0x111')]==='first'?_0x7081ea+_0x21e061[_0x2d73('0x112')](_0x31fd77):_0x21e061[_0x2d73('0x112')](0x0,_0x3f83f2-_0x31fd77)+_0x7081ea);}else{this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x410bb0,rs['generate']({'charset':'*','length':_0x3f83f2}));}}else{this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x410bb0,'');}}else{this['createSquareDetailsReport'][_0x2d73('0x6c')](this,_0x410bb0,_0x21e061);}return _0x2ea911;};AGIVertices[_0x2d73('0xd')][_0x2d73('0x9')]=function(_0x372d34){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x372d34[_0x2d73('0x34')]));return this[_0x2d73('0x8')](_0x372d34);};AGIVertices[_0x2d73('0xd')]['goal']=function(_0x5b8793){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x113'),_0x5b8793[_0x2d73('0x34')]));this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x5b8793,_0x5b8793[_0x2d73('0x114')]);return this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x115'),_0x5b8793[_0x2d73('0x114')]));};AGIVertices['prototype'][_0x2d73('0x116')]=function(_0x32d036){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x117'),_0x32d036[_0x2d73('0x34')]));if(!this['isConfigured'](_0x32d036['aws_access_key_id'])||!this[_0x2d73('0x7e')](_0x32d036[_0x2d73('0x82')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0x118'));}if(!this[_0x2d73('0x7e')](_0x32d036[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')]('no\x20text\x20configured');}this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x119'),_0x32d036[_0x2d73('0x5f')]));var _0x3f427d=this[_0x2d73('0x80')][_0x2d73('0x6c')](this,_0x32d036);if(_0x3f427d){this[_0x2d73('0xa')][_0x2d73('0xa2')](util['format'](_0x2d73('0x11a'),_0x3f427d));var _0xd1cf02=this[_0x2d73('0xa')][_0x2d73('0xf6')](_0x3f427d);try{fs[_0x2d73('0xf7')](_0x3f427d+_0x2d73('0xf8'));}catch(_0x1efd70){logger['error'](_0x1efd70);}return _0xd1cf02;}return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x32d036,_0x2d73('0x11b'));};AGIVertices['prototype'][_0x2d73('0x11c')]=function(_0x458bb1){logger['info'](util['format'](_0x2d73('0x11d'),_0x458bb1[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x458bb1[_0x2d73('0x81')])||!this[_0x2d73('0x7e')](_0x458bb1[_0x2d73('0x82')])){return this['channel']['noop'](_0x2d73('0x118'));}if(!this[_0x2d73('0x7e')](_0x458bb1[_0x2d73('0x88')])){return this['channel'][_0x2d73('0xa2')]('no\x20bot\x20name\x20configured');}if(!this[_0x2d73('0x7e')](_0x458bb1[_0x2d73('0x5f')])){return this['channel'][_0x2d73('0xa2')](_0x2d73('0xa3'));}this[_0x2d73('0xa')]['bot']=!![];this['createSquareDetailsReport'](_0x458bb1);this['createSquareMessage'](_0x458bb1['text'],'in','','');this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x11e'),_0x458bb1['text']));var _0x48ce6a=this['awsLex'][_0x2d73('0x6c')](this,_0x458bb1);if(_0x48ce6a){for(var _0x5e67d3 in _0x48ce6a){if(_0x48ce6a['hasOwnProperty'](_0x5e67d3)&&_[_0x2d73('0x92')](_0x48ce6a[_0x5e67d3])){this[_0x2d73('0xa')][_0x2d73('0x9d')](util[_0x2d73('0x24')](_0x2d73('0x11f'),_0x5e67d3[_0x2d73('0x65')]()),_0x48ce6a[_0x5e67d3]);}}if(_[_0x2d73('0x41')](_0x48ce6a[_0x2d73('0x71')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x48ce6a[_0x2d73('0x71')],_0x2d73('0xe8'),'amazonlex','');return this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')]('Amazon\x20Lex\x20Result\x20%s',_0x48ce6a[_0x2d73('0x71')]));}}return this[_0x2d73('0xa')]['error'](_0x458bb1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x2d73('0x120')]=function(_0x550705){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x121'),_0x550705[_0x2d73('0x34')],_0x550705['timeout']));if(!this[_0x2d73('0x7e')](_0x550705[_0x2d73('0x74')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')]('no\x20key\x20configured');}var _0x1b4013=_0x2d73('0x122');var _0x5eec14=util[_0x2d73('0x24')](_0x2d73('0x123'),FILES_PATH,rs[_0x2d73('0x110')](0x4));var _0x5409e3=util[_0x2d73('0x24')]('%s.%s',_0x5eec14,_0x1b4013);var _0x3f331b=!![];if(_0x550705[_0x2d73('0x124')]==='NOBEEP'){_0x3f331b=![];}var _0x2d0017=this['channel'][_0x2d73('0x125')](_0x5eec14,_0x1b4013,_0x550705[_0x2d73('0x126')],_0x550705[_0x2d73('0x62')],undefined,_0x3f331b);if(_0x2d0017[_0x2d73('0x9c')]!==-0x1){this['channel']['noop'](util[_0x2d73('0x24')](_0x2d73('0x127'),_0x5409e3));var _0x5641ef=this['googleASR'][_0x2d73('0x6c')](this,_0x550705,_0x5409e3);if(_0x5641ef){for(var _0x5ef4d0 in _0x5641ef){if(_0x5641ef[_0x2d73('0x8f')](_0x5ef4d0)){this[_0x2d73('0xa')][_0x2d73('0x9d')](util[_0x2d73('0x24')](_0x2d73('0x128'),_0x5ef4d0['toUpperCase']()),_0x5641ef[_0x5ef4d0]);}}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x129'),JSON[_0x2d73('0x6d')](_0x5641ef)));}}return _0x2d0017;};AGIVertices[_0x2d73('0xd')][_0x2d73('0x12a')]=function(_0x4a1e8d){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4a1e8d[_0x2d73('0x34')]));if(!this['isConfigured'](_0x4a1e8d[_0x2d73('0x8b')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0x12b'));}if(!this[_0x2d73('0x7e')](_0x4a1e8d[_0x2d73('0x8c')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')]('no\x20appsecret\x20configured');}var _0x560173='wav';var _0x1b62fc=util[_0x2d73('0x24')](_0x2d73('0x123'),FILES_PATH,rs[_0x2d73('0x110')](0x4));var _0x2244c8=util[_0x2d73('0x24')](_0x2d73('0x95'),_0x1b62fc,_0x560173);var _0x3f0764=!![];if(_0x4a1e8d[_0x2d73('0x124')]===_0x2d73('0x12c')){_0x3f0764=![];}var _0x2fa011=this['channel'][_0x2d73('0x125')](_0x1b62fc,_0x560173,_0x4a1e8d[_0x2d73('0x126')],_0x4a1e8d[_0x2d73('0x62')],undefined,_0x3f0764);if(_0x2fa011[_0x2d73('0x9c')]!==-0x1){this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x12d'),_0x2244c8));var _0xae0502=this[_0x2d73('0x8a')][_0x2d73('0x6c')](this,_0x4a1e8d,_0x2244c8);if(_0xae0502){for(var _0xe538d8 in _0xae0502){if(_0xae0502['hasOwnProperty'](_0xe538d8)){this[_0x2d73('0xa')][_0x2d73('0x9d')](util[_0x2d73('0x24')](_0x2d73('0x12e'),_0xe538d8['toUpperCase']()),_0xae0502[_0xe538d8]);}}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util['format'](_0x2d73('0x12f'),JSON[_0x2d73('0x6d')](_0xae0502)));}}return _0x2fa011;};AGIVertices[_0x2d73('0xd')][_0x2d73('0x130')]=function(_0xb0889){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x131'),_0xb0889[_0x2d73('0x34')]));return this['channel']['continueAt'](_0xb0889[_0x2d73('0x132')],_0xb0889[_0x2d73('0x3a')],_0xb0889[_0x2d73('0x3b')]);};AGIVertices[_0x2d73('0xd')]['gotoif']=function(_0x570952){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x570952['label']));if(!this[_0x2d73('0x7e')](_0x570952[_0x2d73('0x133')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x570952,_0x2d73('0x134'));}try{var _0x3023df=eval(_0x570952[_0x2d73('0x133')])?_0x2d73('0x135'):_0x2d73('0x136');this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x137'),_0x570952[_0x2d73('0x133')],_0x3023df));return{'code':0xc8,'result':_0x3023df};}catch(_0x430d92){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x2d73('0xd')][_0x2d73('0x138')]=function(_0x37d79c){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x139'),_0x37d79c[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x37d79c[_0x2d73('0x13a')])){return this['channel'][_0x2d73('0x2d')](_0x37d79c,_0x2d73('0x13b'));}var _0x85b60f=this[_0x2d73('0x13c')]['sync'](this,_0x37d79c['interval_id']);if(!_0x85b60f){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x37d79c,_0x2d73('0x13d'));}for(var _0x9b6f5d=0x0;_0x9b6f5d<_0x85b60f[_0x2d73('0x96')];_0x9b6f5d+=0x1){var _0x119585=this[_0x2d73('0xa')]['getVariable'](util[_0x2d73('0x24')]('IFTIME(%s?true:false)',_0x85b60f[_0x9b6f5d]));if(_0x119585['result']===-0x1){return _0x119585;}logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x13e'),_0x85b60f[_0x9b6f5d],_0x119585[_0x2d73('0x9b')]));if(_0x119585[_0x2d73('0x9b')]===_0x2d73('0x135')){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x13e'),_0x85b60f[_0x9b6f5d],_0x2d73('0x135')));this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('IFTIME\x20%s\x20%s',_0x85b60f[_0x9b6f5d],_0x2d73('0x135')));return{'code':0xc8,'result':_0x2d73('0x135')};}else{logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x13e'),_0x85b60f[_0x9b6f5d],_0x2d73('0x136')));this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')]('IFTIME\x20%s\x20%s',_0x85b60f[_0x9b6f5d],_0x2d73('0x136')));}}return{'code':0xc8,'result':_0x2d73('0x136')};};AGIVertices[_0x2d73('0xd')][_0x2d73('0x13f')]=function(_0xe5858b){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x140'),_0xe5858b['label']));return this[_0x2d73('0xa')][_0x2d73('0x13f')]();};AGIVertices[_0x2d73('0xd')]['ispeechasr']=function(_0x1cc2f0){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x141'),_0x1cc2f0['label']));if(!this['isConfigured'](_0x1cc2f0[_0x2d73('0x74')])){return this[_0x2d73('0xa')]['noop']('no\x20key\x20configured');}var _0x5d9beb='wav';var _0x150528=util[_0x2d73('0x24')]('%s/recordings/%s',FILES_PATH,rs[_0x2d73('0x110')](0x4));var _0x485169=util[_0x2d73('0x24')](_0x2d73('0x95'),_0x150528,_0x5d9beb);var _0x11e078=!![];if(_0x1cc2f0[_0x2d73('0x124')]==='NOBEEP'){_0x11e078=![];}var _0x117a79=this[_0x2d73('0xa')][_0x2d73('0x125')](_0x150528,_0x5d9beb,_0x1cc2f0['intKey'],_0x1cc2f0[_0x2d73('0x62')],undefined,_0x11e078);if(_0x117a79['result']!==-0x1){this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('ispeech\x20%s\x20file\x20created',_0x485169));var _0x753c4f=this['ispeechASR'][_0x2d73('0x6c')](this,_0x1cc2f0,_0x485169);if(_0x753c4f){for(var _0x2d6df8 in _0x753c4f){if(_0x753c4f['hasOwnProperty'](_0x2d6df8)){this[_0x2d73('0xa')]['setVariable'](util['format'](_0x2d73('0x142'),_0x2d6df8[_0x2d73('0x65')]()),_0x753c4f[_0x2d6df8]);}}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x143'),JSON[_0x2d73('0x6d')](_0x753c4f)));}}return _0x117a79;};AGIVertices['prototype'][_0x2d73('0x144')]=function(_0x834d12){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x834d12[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x834d12[_0x2d73('0x74')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xda'));}if(!this[_0x2d73('0x7e')](_0x834d12[_0x2d73('0x5f')])){return this[_0x2d73('0xa')]['noop'](_0x2d73('0xa3'));}this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x145'),_0x834d12[_0x2d73('0x5f')]));var _0x41a2a8=this['ispeechTTS'][_0x2d73('0x6c')](this,_0x834d12);if(_0x41a2a8){this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x146'),_0x41a2a8));var _0x29385e=this[_0x2d73('0xa')]['streamFile'](_0x41a2a8,_0x834d12['intKey']);try{fs[_0x2d73('0xf7')](_0x41a2a8+'.wav');}catch(_0x4f4c6f){logger['error'](_0x4f4c6f);}return _0x29385e;}return this[_0x2d73('0xa')]['error'](_0x834d12,_0x2d73('0x147'));};AGIVertices['prototype'][_0x2d73('0x148')]=function(_0x4cb966){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x149'),_0x4cb966[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x4cb966[_0x2d73('0x14a')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x4cb966,_0x2d73('0x14b'));}logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x2d73('0xa')][_0x2d73('0x37')],_0x4cb966[_0x2d73('0x14a')]));var _0x47b981=this[_0x2d73('0x4f')][_0x2d73('0x6c')](this,_0x4cb966[_0x2d73('0x14a')]);if(_0x47b981){logger['info'](util[_0x2d73('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2d73('0xa')][_0x2d73('0x37')],_0x4cb966['findBy']));this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x14c'),this['channel']['callerid'],_0x4cb966[_0x2d73('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x2d73('0x14d'),this[_0x2d73('0xa')]['callerid'],_0x4cb966['findBy']));this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x14d'),this['channel'][_0x2d73('0x37')],_0x4cb966[_0x2d73('0x14a')]));return{'code':0xc8,'result':_0x2d73('0x14e')};}};AGIVertices[_0x2d73('0xd')][_0x2d73('0x14f')]=function(_0x3386e2){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x150'),_0x3386e2[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x3386e2[_0x2d73('0x14a')])){return this[_0x2d73('0xa')]['error'](_0x3386e2,_0x2d73('0x14b'));}logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x2d73('0xa')][_0x2d73('0x37')],_0x3386e2[_0x2d73('0x14a')]));var _0xbb8702=this['agentLogout'][_0x2d73('0x6c')](this,_0x3386e2[_0x2d73('0x14a')]);if(_0xbb8702){logger['info'](util[_0x2d73('0x24')](_0x2d73('0x14c'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x3386e2['findBy']));this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3386e2['findBy']));return{'code':0xc8,'result':_0x2d73('0x151')};}else{logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x14d'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x3386e2['findBy']));this['channel']['noop'](util[_0x2d73('0x24')](_0x2d73('0x14d'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x3386e2['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2d73('0xd')]['math']=function(_0x4693be){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x152'),_0x4693be[_0x2d73('0x34')]));if(!this['isConfigured'](_0x4693be[_0x2d73('0x153')])){return this['channel']['error'](_0x4693be,_0x2d73('0x154'));}this[_0x2d73('0xa')][_0x2d73('0xa2')](util['format'](_0x2d73('0x155'),_0x4693be[_0x2d73('0x153')]));var _0x47ea87=eval(_0x4693be[_0x2d73('0x153')]);if(!this['isConfigured'](_0x4693be['variable_id'])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xcb'));}var _0x52a515=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x4693be[_0x2d73('0x10a')]);if(!_0x52a515){return this[_0x2d73('0xa')]['error'](_0x4693be,_0x2d73('0x156'));}if(_['isArray'](_0x47ea87)){var _0x5bd333=this;_0x47ea87[_0x2d73('0xcc')](function(_0x4153f5,_0x2222d4){_0x5bd333['channel']['setVariable'](util['format']('%s[%s]',_0x52a515,_0x2222d4),_0x4153f5);});return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x157'),_0x52a515));}else{return this[_0x2d73('0xa')]['setVariable'](_0x52a515,_0x47ea87);}};AGIVertices[_0x2d73('0xd')][_0x2d73('0x158')]=function(_0x58ef5b){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x159'),_0x58ef5b['label']));if(_0x58ef5b[_0x2d73('0x9f')]===0x0){return this[_0x2d73('0x9e')](_0x58ef5b);}_0x58ef5b[_0x2d73('0x9f')]-=0x1;if(!this['isConfigured'](_0x58ef5b['file_id'])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x58ef5b,_0x2d73('0x108'));}var _0x46ef21=this['getSound']['sync'](this,_0x58ef5b[_0x2d73('0x107')]);if(!_0x46ef21){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x58ef5b,_0x2d73('0x109'));}var _0x37ea61=this[_0x2d73('0xa')][_0x2d73('0x10b')](_0x46ef21,_0x58ef5b['response'],_0x58ef5b['digit']);var _0x38f864=_0x37ea61['result'];if(_0x37ea61[_0x2d73('0x9c')]===-0x1){this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x58ef5b,'-1');return _0x37ea61;}else if(_0x37ea61[_0x2d73('0x9b')]===_0x2d73('0x62')){_0x37ea61[_0x2d73('0x9c')]=_0x37ea61[_0x2d73('0x9c')]['length']>0x0?_0x37ea61[_0x2d73('0x9c')]:'t';}else if(_[_0x2d73('0x40')](_0x37ea61[_0x2d73('0x9c')])){_0x37ea61[_0x2d73('0x9c')]='#';_0x38f864='#';}if(!this[_0x2d73('0x7e')](_0x58ef5b['variable_id'])){this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xcb'));}else{var _0x3bf2d8=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x58ef5b['variable_id']);if(!_0x3bf2d8){return this['channel'][_0x2d73('0x2d')](_0x58ef5b,_0x2d73('0x156'));}this['channel'][_0x2d73('0x9d')](_0x3bf2d8,_0x38f864);}this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x58ef5b,_0x38f864);return _0x37ea61;};AGIVertices[_0x2d73('0xd')][_0x2d73('0xa2')]=function(_0x2dfe33){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x15a'),_0x2dfe33['label']));return this['channel'][_0x2d73('0xa2')](_0x2dfe33[_0x2d73('0x15b')]||_0x2dfe33['label']);};AGIVertices[_0x2d73('0xd')][_0x2d73('0x15c')]=function(_0x4d3684){logger['info'](util[_0x2d73('0x24')](_0x2d73('0x15d'),_0x4d3684[_0x2d73('0x34')]));if(!this['isConfigured'](_0x4d3684[_0x2d73('0x14a')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x4d3684,_0x2d73('0x14b'));}logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x15e'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x4d3684['findBy']));var _0x185a1f=this[_0x2d73('0x4a')][_0x2d73('0x6c')](this,_0x4d3684[_0x2d73('0x15f')]);var _0x32fa65=this['agentPause'][_0x2d73('0x6c')](this,_0x4d3684[_0x2d73('0x14a')],_0x185a1f);if(_0x32fa65){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x14c'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x4d3684[_0x2d73('0x14a')]));this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x14c'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x4d3684['findBy']));return{'code':0xc8,'result':_0x2d73('0x151')};}else{logger[_0x2d73('0x29')](util['format'](_0x2d73('0x14d'),this[_0x2d73('0xa')]['callerid'],_0x4d3684[_0x2d73('0x14a')]));this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x14c'),this['channel'][_0x2d73('0x37')],_0x4d3684[_0x2d73('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2d73('0xd')][_0x2d73('0x160')]=function(_0x5c1b1e){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x161'),_0x5c1b1e[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x5c1b1e[_0x2d73('0x107')])){return this[_0x2d73('0xa')]['error'](_0x5c1b1e,'no\x20file\x20audio\x20selected');}var _0x2ec103=this[_0x2d73('0x1b')][_0x2d73('0x6c')](this,_0x5c1b1e[_0x2d73('0x107')]);if(!_0x2ec103){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x5c1b1e,_0x2d73('0x109'));}var _0x11cdee=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0x162'),[_0x2ec103,_0x5c1b1e[_0x2d73('0xd7')]]);if(_0x11cdee[_0x2d73('0x9c')]===-0x1){return _0x11cdee;}return this['channel'][_0x2d73('0xa2')](util['format'](_0x2d73('0xbb'),_0x2d73('0x162'),_0x2ec103));};AGIVertices[_0x2d73('0xd')]['queue']=function(_0x4a19d7){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x163'),_0x4a19d7['label']));if(!this[_0x2d73('0x7e')](_0x4a19d7[_0x2d73('0x164')])){return this[_0x2d73('0xa')]['error'](_0x4a19d7,'no\x20queue\x20selected');}var _0x2d48c6='';var _0x25ef76=parseInt(_0x4a19d7[_0x2d73('0x164')],0xa);if(isNaN(_0x25ef76)){_0x2d48c6=_0x4a19d7[_0x2d73('0x164')];}else{_0x2d48c6=this[_0x2d73('0x12')][_0x2d73('0x6c')](this,_0x4a19d7[_0x2d73('0x164')]);if(!_0x2d48c6){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x4a19d7,_0x2d73('0x165'));}}var _0x20c138='';if(this[_0x2d73('0x7e')](_0x4a19d7[_0x2d73('0x107')])){var _0x3e72ae=this[_0x2d73('0x1b')][_0x2d73('0x6c')](this,_0x4a19d7['file_id']);if(_0x3e72ae){_0x20c138=_0x3e72ae;}}this['createSquareDetailsReport'][_0x2d73('0x6c')](this,_0x4a19d7,_0x2d48c6);if(_0x4a19d7[_0x2d73('0xd7')]['indexOf']('x')<0x0){_0x4a19d7['opts']+='x';}if(_0x4a19d7[_0x2d73('0xd7')]['indexOf']('X')<0x0){_0x4a19d7[_0x2d73('0xd7')]+='X';}this['channel'][_0x2d73('0x9d')]('XMCS-QUEUE',_0x2d48c6?_0x2d48c6[_0x2d73('0x166')]():'');var _0x543346=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0x167'),[_0x2d48c6,_0x4a19d7['opts'],_0x4a19d7[_0x2d73('0x61')],_0x20c138,_0x4a19d7[_0x2d73('0x62')],_0x4a19d7[_0x2d73('0x4')],_0x4a19d7[_0x2d73('0x168')],_0x4a19d7[_0x2d73('0x169')],'',_0x4a19d7[_0x2d73('0x16a')]]);if(_0x543346[_0x2d73('0x9c')]===-0x1){return _0x543346;}return this['channel']['noop'](util[_0x2d73('0x24')]('Executed\x20command\x20%s\x20%s',_0x2d73('0x167'),_0x2d48c6));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x16b')]=function(_0x2b5081){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x16c'),_0x2b5081[_0x2d73('0x34')]));var _0x2c33fe=_0x2b5081[_0x2d73('0x16d')]||'wav';var _0x4b7603=util['format']('%s_%s',this[_0x2d73('0xa')]['uniqueid'],rs[_0x2d73('0x110')](0x5));var _0x2e8775=util[_0x2d73('0x24')](_0x2d73('0x16e'),FILES_PATH,_0x4b7603,_0x2c33fe);var _0x5923ad=util[_0x2d73('0x24')]('%s/recordings/%s',FILES_PATH,_0x4b7603);this[_0x2d73('0x38')][_0x2d73('0x6c')](this,_0x2b5081,_0x4b7603,_0x2e8775);this['channel'][_0x2d73('0x9d')](_0x2d73('0x16f'),_0x4b7603);logger[_0x2d73('0x29')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5923ad,_0x2c33fe,_0x2b5081[_0x2d73('0x170')],_0x2b5081[_0x2d73('0x62')]);return this['channel'][_0x2d73('0x125')](_0x5923ad,_0x2c33fe,_0x2b5081[_0x2d73('0x170')],_0x2b5081[_0x2d73('0x62')],undefined,!![]);};AGIVertices['prototype'][_0x2d73('0x171')]=function(_0x3d2e37){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x3d2e37[_0x2d73('0x34')]));if(!this['isConfigured'](_0x3d2e37[_0x2d73('0x61')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0x172'));}var _0x3b774d=this[_0x2d73('0x173')][_0x2d73('0x6c')](this,_0x3d2e37);logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Response:',util['inspect'](_0x3b774d,{'showHidden':![],'depth':null})));if(!this[_0x2d73('0x7e')](_0x3d2e37[_0x2d73('0x10a')])){return this['channel'][_0x2d73('0xa2')](_0x2d73('0x174'));}var _0x713438=this[_0x2d73('0x9a')]['sync'](this,_0x3d2e37[_0x2d73('0x10a')]);if(!_0x713438){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x3d2e37,'no\x20variable\x20found');}this['channel'][_0x2d73('0x9d')](util['format'](_0x2d73('0x175'),_0x713438),_0x3b774d['statusCode']?_0x3b774d[_0x2d73('0x6f')]:_0x2d73('0x176'));this[_0x2d73('0xa')][_0x2d73('0x9d')](util[_0x2d73('0x24')](_0x2d73('0x177'),_0x713438),_0x3b774d['statusMessage']?_0x3b774d['statusMessage']:'OK');if(_0x3b774d[_0x2d73('0x66')]){try{this[_0x2d73('0x94')](_0x3b774d[_0x2d73('0x66')],_0x713438);}catch(_0x31c38e){logger[_0x2d73('0x2d')](util[_0x2d73('0x24')](_0x2d73('0x178'),_0x713438));}}return this['channel']['noop'](util[_0x2d73('0x24')](_0x2d73('0x179'),_0x713438));};AGIVertices['prototype'][_0x2d73('0x17a')]=function(_0x2621c7){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x17b'),_0x2621c7[_0x2d73('0x34')]));return this['channel'][_0x2d73('0x17c')](_0x2621c7['digits'][_0x2d73('0x55')](/\s+/g,''),_0x2621c7[_0x2d73('0x170')]);};AGIVertices[_0x2d73('0xd')][_0x2d73('0x17d')]=function(_0x3f5527){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3f5527[_0x2d73('0x34')]));return this[_0x2d73('0xa')][_0x2d73('0x17e')](_0x3f5527[_0x2d73('0x17f')][_0x2d73('0x55')](/\s+/g,''),_0x3f5527[_0x2d73('0x170')]);};AGIVertices[_0x2d73('0xd')]['sayphonetic']=function(_0x49c3bc){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x49c3bc[_0x2d73('0x34')]));return this[_0x2d73('0xa')][_0x2d73('0x180')](_0x49c3bc[_0x2d73('0x5f')],_0x49c3bc[_0x2d73('0x170')]);};AGIVertices[_0x2d73('0xd')]['sendMail']=function(_0x5670d3){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x181'),_0x5670d3[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x5670d3['account_id'])){return this['channel']['noop'](_0x2d73('0x182'));}var _0x484dc0=this[_0x2d73('0x1d')]['sync'](this,_0x5670d3[_0x2d73('0x183')]);if(!_0x484dc0||!_0x484dc0[_0x2d73('0x184')]){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x5670d3,_0x2d73('0x185'));}var _0x4fd4ad={'from':util[_0x2d73('0x24')](_0x2d73('0x186'),_0x484dc0[_0x2d73('0x10')],_0x484dc0['email']||_0x484dc0[_0x2d73('0x184')]['user']),'to':_0x5670d3['to']||'','cc':_0x5670d3['cc']||'','bcc':_0x5670d3[_0x2d73('0x187')]||'','subject':_0x5670d3['subject'],'html':_0x5670d3[_0x2d73('0x5f')],'text':_0x5670d3[_0x2d73('0x5f')]};if(this[_0x2d73('0x7e')](_0x5670d3[_0x2d73('0x188')])){}logger['debug']('sendMail\x20message',JSON[_0x2d73('0x6d')](_0x4fd4ad));this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x5670d3,_0x5670d3[_0x2d73('0x183')]);this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x484dc0['name']));this[_0x2d73('0x1f')][_0x2d73('0x6c')](this,_0x484dc0[_0x2d73('0x189')],_0x4fd4ad);return this['channel'][_0x2d73('0xa2')](_0x2d73('0x18a'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x18b')]=function(_0x2734a4){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x18c'),_0x2734a4[_0x2d73('0x34')]));return this[_0x2d73('0xa')]['noop'](_0x2d73('0x18d'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x18e')]=function(_0x3e5c9a){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3e5c9a[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x3e5c9a['sms_account_id'])){return this['channel'][_0x2d73('0xa2')]('no\x20sms\x20account\x20configured');}var _0x146784=this[_0x2d73('0x2f')][_0x2d73('0x6c')](this,_0x3e5c9a[_0x2d73('0x18f')]);if(!_0x146784){return this[_0x2d73('0xa')]['error'](_0x3e5c9a,_0x2d73('0x190'));}var _0x2dab61={'body':_0x3e5c9a[_0x2d73('0x191')],'phone':_0x3e5c9a['to']||'','SmsAccountId':_0x146784['id']};logger['debug'](_0x2d73('0x192'),JSON[_0x2d73('0x6d')](_0x2dab61));this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x3e5c9a,_0x3e5c9a['sms_account_id']);this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x193'),_0x146784['name']));this['createSmsMessage'][_0x2d73('0x6c')](this,_0x2dab61);return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0x194'));};AGIVertices[_0x2d73('0xd')]['set']=function(_0x86c339){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x86c339[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x86c339[_0x2d73('0x10a')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x86c339,_0x2d73('0x195'));}var _0x51d26e=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x86c339['variable_id']);if(!_0x51d26e){return this[_0x2d73('0xa')]['error'](_0x86c339,_0x2d73('0x156'));}return this['channel']['setVariable'](_0x51d26e,_0x86c339['variable_value']);};AGIVertices['prototype'][_0x2d73('0x196')]=function(_0x5f33c2){logger['info'](util[_0x2d73('0x24')](_0x2d73('0x197'),_0x5f33c2[_0x2d73('0x34')]));this[_0x2d73('0xa')]['noop'](_0x2d73('0x198'));if(_0x5f33c2[_0x2d73('0x199')]===_0x2d73('0x19a')){this['channel']['noop'](_0x2d73('0x19b'));return this[_0x2d73('0xa')]['answer']();}return this['channel'][_0x2d73('0xa2')](_0x2d73('0x19c'));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x19d')]=function(_0x33876e){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x19e'),_0x33876e['label']));if(!this['isConfigured'](_0x33876e[_0x2d73('0x19f')])){return this['channel']['error'](_0x33876e,'no\x20subproject\x20selected');}var _0x2c6816=this['getSquareProject']['sync'](this,_0x33876e[_0x2d73('0x19f')]);if(!this['isConfigured'](_0x2c6816)){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x33876e,util['format'](_0x2d73('0x1a0'),_0x33876e[_0x2d73('0x19f')]));}if(_0x2c6816===this['channel']['arg_1']){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x33876e,_0x2d73('0x1a1'));}this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x33876e,_0x2c6816);var _0x3392cb=this['channel']['exec'](_0x2d73('0x1a2'),util[_0x2d73('0x24')](_0x2d73('0x1a3'),config[_0x2d73('0x4')][_0x2d73('0x1a4')]||_0x2d73('0x1a5'),_0x2c6816,this['channel']['arg_1']));if(_0x3392cb[_0x2d73('0x9c')]===-0x1){return _0x3392cb;}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0xbb'),_0x2d73('0x1a2'),_0x2c6816));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1a6')]=function(_0x22e878){logger[_0x2d73('0x29')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x22e878[_0x2d73('0x34')]));var _0x4e6d2d=this[_0x2d73('0x52')][_0x2d73('0x6c')](this,_0x22e878[_0x2d73('0xb0')]);this[_0x2d73('0x32')][_0x2d73('0x6c')](this,_0x22e878,_0x22e878[_0x2d73('0xb0')]);if(this[_0x2d73('0x7e')](_0x22e878[_0x2d73('0x10a')])){var _0x1c70f7=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x22e878['variable_id']);if(_0x1c70f7){this['channel'][_0x2d73('0x9d')](_0x1c70f7,_0x4e6d2d);return this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x1a7'),_0x22e878['command'],_0x1c70f7));}}return this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x22e878[_0x2d73('0xb0')]));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1a8')]=function(_0x582ac7){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x1a9'),_0x582ac7['label']));_0x582ac7[_0x2d73('0x5f')]=_0x582ac7['text'][_0x2d73('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2d73('0x7e')](_0x582ac7[_0x2d73('0x57')])){return this[_0x2d73('0xa')]['noop'](_0x2d73('0x1aa'));}if(!this[_0x2d73('0x7e')](_0x582ac7[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x1ab'),_0x582ac7[_0x2d73('0x5f')]));var _0x2548f2=this[_0x2d73('0x56')]['sync'](this,_0x582ac7);if(_0x2548f2){this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x1ac'),_0x2548f2));var _0x539024=this[_0x2d73('0xa')][_0x2d73('0xf6')](_0x2548f2);try{fs[_0x2d73('0xf7')](_0x2548f2+_0x2d73('0xf8'));}catch(_0x27623f){logger[_0x2d73('0x2d')](_0x27623f);}return _0x539024;}return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x582ac7,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1ad')]=function(_0x2e4bb5){logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2e4bb5[_0x2d73('0x34')]));_0x2e4bb5[_0x2d73('0x5f')]=_0x2e4bb5[_0x2d73('0x5f')][_0x2d73('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2d73('0x7e')](_0x2e4bb5[_0x2d73('0x5f')])){return this[_0x2d73('0xa')][_0x2d73('0xa2')](_0x2d73('0xa3'));}this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x1ae'),_0x2e4bb5[_0x2d73('0x5f')]));var _0x3fea88=this[_0x2d73('0x5e')][_0x2d73('0x6c')](this,_0x2e4bb5);if(_0x3fea88){this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0x1af'),_0x3fea88));var _0x15a772=this[_0x2d73('0xa')][_0x2d73('0xf6')](_0x3fea88);try{fs[_0x2d73('0xf7')](_0x3fea88+_0x2d73('0xf8'));}catch(_0x15e8cf){logger[_0x2d73('0x2d')](_0x15e8cf);}return _0x15a772;}return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x2e4bb5,_0x2d73('0x1b0'));};AGIVertices[_0x2d73('0xd')]['unpause']=function(_0x2de2f5){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x1b1'),_0x2de2f5[_0x2d73('0x34')]));if(!this[_0x2d73('0x7e')](_0x2de2f5['findBy'])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x2de2f5,'no\x20find\x20by\x20configured');}logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x15e'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x2de2f5[_0x2d73('0x14a')]));var _0x5cf9fa=this[_0x2d73('0x4c')][_0x2d73('0x6c')](this,_0x2de2f5[_0x2d73('0x14a')]);if(_0x5cf9fa){logger['info'](util[_0x2d73('0x24')](_0x2d73('0x14c'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x2de2f5['findBy']));this[_0x2d73('0xa')][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x14c'),this[_0x2d73('0xa')]['callerid'],_0x2de2f5[_0x2d73('0x14a')]));return{'code':0xc8,'result':_0x2d73('0x151')};}else{logger[_0x2d73('0x29')](util[_0x2d73('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x2d73('0x37')],_0x2de2f5[_0x2d73('0x14a')]));this['channel'][_0x2d73('0xa2')](util[_0x2d73('0x24')](_0x2d73('0x14d'),this[_0x2d73('0xa')][_0x2d73('0x37')],_0x2de2f5['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x2d73('0x1b2')]=function(_0x1a859e){logger[_0x2d73('0x29')](util['format'](_0x2d73('0x1b3'),_0x1a859e[_0x2d73('0x34')]));var _0x20b661=this[_0x2d73('0xa')][_0x2d73('0x53')](_0x2d73('0x1b4'),[_0x1a859e['mailbox'],_0x1a859e[_0x2d73('0x72')]]);if(_0x20b661[_0x2d73('0x9c')]===-0x1){return _0x20b661;}return this[_0x2d73('0xa')]['noop'](util[_0x2d73('0x24')](_0x2d73('0xbb'),_0x2d73('0x1b4'),_0x1a859e[_0x2d73('0x1b5')]));};AGIVertices[_0x2d73('0xd')][_0x2d73('0x1b6')]=function(_0x2f8b57){logger[_0x2d73('0x29')](util[_0x2d73('0x24')](_0x2d73('0x1b7'),_0x2f8b57[_0x2d73('0x34')]));if(!this['isConfigured'](_0x2f8b57[_0x2d73('0x10a')])){return this[_0x2d73('0xa')][_0x2d73('0x2d')](_0x2f8b57,_0x2d73('0x195'));}var _0x41c8cf=this[_0x2d73('0x9a')][_0x2d73('0x6c')](this,_0x2f8b57['variable_id']);if(!_0x41c8cf){return this['channel'][_0x2d73('0x2d')](_0x2f8b57,_0x2d73('0x156'));}var _0x3059b5=this[_0x2d73('0xa')][_0x2d73('0x9a')](_0x41c8cf);return{'code':0xc8,'result':_0x3059b5[_0x2d73('0x9b')]?_0x3059b5['extra']:'-'};};String['prototype'][_0x2d73('0x99')]=function(_0x11a668,_0x4a89ab){return this[_0x2d73('0x98')](_0x11a668)[_0x2d73('0x1b8')](_0x4a89ab);};module[_0x2d73('0x1b9')]=AGIVertices;
\ No newline at end of file
+var _0xc664=['TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','bcc','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','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','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','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','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProject','getSquareOdbcById','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','ODBC\x20connection\x20successfully','info','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','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','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','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','no\x20database\x20selected','getSquareOdbc','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created'];(function(_0x5780ad,_0x1eb0fb){var _0x270c3d=function(_0x588e53){while(--_0x588e53){_0x5780ad['push'](_0x5780ad['shift']());}};_0x270c3d(++_0x1eb0fb);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x4c66('0x0'));var _=require(_0x4c66('0x1'));var sh=require('shelljs');var odbc=require(_0x4c66('0x2'))();var rs=require(_0x4c66('0x3'));var moment=require(_0x4c66('0x4'));var Mustache=require(_0x4c66('0x5'));var rp=require(_0x4c66('0x6'));var logger=require('../../config/logger')(_0x4c66('0x7'));var config=require(_0x4c66('0x8'));var shared=require(_0x4c66('0x9'));var scripts=require(_0x4c66('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x4c66('0xb'),_0x4c66('0xc')];var verticesWithRetry=[_0x4c66('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x236ffe,_0x60a744,_0xb870a5){this[_0x4c66('0xe')]=_0x236ffe;this['rpc']=_0x60a744;this[_0x4c66('0xf')]=_0xb870a5;};AGIVertices[_0x4c66('0x10')][_0x4c66('0x11')]=function(_0x27b48c,_0x3d151f){this[_0x4c66('0x12')][_0x4c66('0x13')](_0x27b48c)[_0x4c66('0x14')](function(_0x462f51){_0x3d151f(null,_0x462f51?_0x462f51['name']:![]);})['catch'](function(_0x51b6f9){_0x3d151f(_0x51b6f9);});};AGIVertices['prototype'][_0x4c66('0x15')]=function(_0x33bf4e,_0x1b3135){this[_0x4c66('0x12')][_0x4c66('0x16')](_0x33bf4e)[_0x4c66('0x14')](function(_0x26aa6f){_0x1b3135(null,_0x26aa6f?_0x26aa6f[_0x4c66('0x17')]:![]);})[_0x4c66('0x18')](function(_0x23d1b6){_0x1b3135(_0x23d1b6);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x19')]=function(_0x7181c4,_0x144982){this[_0x4c66('0x12')]['getSquareProjectById'](_0x7181c4)[_0x4c66('0x14')](function(_0x1a85cc){_0x144982(null,_0x1a85cc?_0x1a85cc[_0x4c66('0x17')]:![]);})['catch'](function(_0x4a61bd){_0x144982(_0x4a61bd);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x1cfd00,_0xc62d80){this['rpc'][_0x4c66('0x1a')](_0x1cfd00)['then'](function(_0x160601){_0xc62d80(null,_0x160601?_0x160601['dsn']:![]);})['catch'](function(_0x53c879){_0xc62d80(_0x53c879);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1b')]=function(_0x19c37d,_0x862fa4){this[_0x4c66('0x12')][_0x4c66('0x1c')](_0x19c37d)[_0x4c66('0x14')](function(_0x963188){_0x862fa4(null,_0x963188?_0x963188[_0x4c66('0x17')]:![]);})[_0x4c66('0x18')](function(_0x35084b){_0x862fa4(_0x35084b);});};AGIVertices[_0x4c66('0x10')]['getTrunk']=function(_0x195f6e,_0xd88cce){this[_0x4c66('0x12')]['getTrunkById'](_0x195f6e)['then'](function(_0x4fa0c0){_0xd88cce(null,_0x4fa0c0?_0x4fa0c0[_0x4c66('0x17')]:![]);})[_0x4c66('0x18')](function(_0x5258c){_0xd88cce(_0x5258c);});};AGIVertices['prototype'][_0x4c66('0x1d')]=function(_0xb9d88a,_0x5921a7){var _0xa04f8b=this;this[_0x4c66('0x12')][_0x4c66('0x1e')](_0xb9d88a)[_0x4c66('0x14')](function(_0x152c5d){_0x5921a7(null,_0x152c5d?_0xa04f8b[_0x4c66('0x1f')](_0x152c5d[_0x4c66('0x20')]):![]);})[_0x4c66('0x18')](function(_0x39024b){_0x5921a7(_0x39024b);});};AGIVertices['prototype'][_0x4c66('0x21')]=function(_0x75656c,_0x404c10){this['rpc'][_0x4c66('0x22')](_0x75656c)[_0x4c66('0x14')](function(_0x32c5dc){_0x404c10(null,_0x32c5dc?_0x32c5dc:![]);})[_0x4c66('0x18')](function(_0x253db4){_0x404c10(_0x253db4);});};AGIVertices['prototype']['sendMailMessage']=function(_0x19c50e,_0xb41fc2,_0x16fbdc){this['mailRpc'][_0x4c66('0x23')](_0x19c50e,_0xb41fc2)['then'](function(){_0x16fbdc(null);})[_0x4c66('0x18')](function(_0x50d3a1){_0x16fbdc(_0x50d3a1);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x24')]=function(_0x1668fd,_0xfbb363){this[_0x4c66('0x12')][_0x4c66('0x25')](_0x1668fd)[_0x4c66('0x14')](function(_0x4c86cd){if(_0x4c86cd){if(_0x4c86cd[_0x4c66('0x26')]){_0xfbb363(null,[_0x4c86cd[_0x4c66('0x27')]]);}else{_0xfbb363(null,_[_0x4c66('0x28')](_0x4c86cd[_0x4c66('0x29')],'interval'));}}else{_0xfbb363(null,![]);}})['catch'](function(_0x2320aa){_0xfbb363(_0x2320aa);});};AGIVertices['prototype'][_0x4c66('0x1f')]=function(_0x73edae){return util[_0x4c66('0x2a')](_0x4c66('0x2b'),FILES_PATH,_0x73edae);};AGIVertices['prototype'][_0x4c66('0x2c')]=function(_0xf2c484,_0x139d0b,_0x3b900f){odbc[_0x4c66('0x2d')](_0xf2c484,function(_0x254e6c){if(_0x254e6c){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x254e6c);_0x3b900f(_0x254e6c);}else{logger['info'](_0x4c66('0x2e'));odbc['query'](_0x139d0b,function(_0x33d566,_0x5d2f5d){if(_0x33d566){logger[_0x4c66('0x2f')]('Error\x20executing\x20query\x20%s',_0x139d0b);_0x3b900f(_0x33d566);}else{logger[_0x4c66('0x2f')](_0x4c66('0x30'),_0x139d0b);odbc[_0x4c66('0x31')](function(_0x4cf2e6){if(_0x4cf2e6){logger[_0x4c66('0x32')](_0x4c66('0x33'),_0x4cf2e6);}_0x3b900f(null,_0x5d2f5d);});}});}});};AGIVertices['prototype'][_0x4c66('0x34')]=function(_0x3c9dd0,_0x3b0b36){this['rpc'][_0x4c66('0x35')](_0x3c9dd0)[_0x4c66('0x14')](function(_0x4da7b3){_0x3b0b36(null,_0x4da7b3?_0x4da7b3:![]);})[_0x4c66('0x18')](function(_0x478ce4){_0x3b0b36(_0x478ce4);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x36')]=function(_0x32806f,_0x5ee046){this[_0x4c66('0x12')][_0x4c66('0x36')](_0x32806f)['then'](function(_0x5bf5a3){_0x5ee046(null,_0x5bf5a3);})[_0x4c66('0x18')](function(_0x2886e4){_0x5ee046(_0x2886e4);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x37')]=function(_0x5eb957,_0x4c538a,_0x3a3cb1){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel'][_0x4c66('0x38')],'node':_0x5eb957[_0x4c66('0x39')],'application':_0x5eb957[_0x4c66('0x3a')],'data':_0x4c538a||null,'project_name':this[_0x4c66('0xe')][_0x4c66('0x3b')],'callerid':this[_0x4c66('0xe')][_0x4c66('0x3c')]})[_0x4c66('0x14')](function(_0x2dad96){if(_0x3a3cb1){_0x3a3cb1(null,_0x2dad96);}})[_0x4c66('0x18')](function(_0x1dbac1){if(_0x3a3cb1){_0x3a3cb1(_0x1dbac1);}});};AGIVertices['prototype'][_0x4c66('0x3d')]=function(_0x2ea303,_0x2fc42a,_0x4d2184,_0x5a58db){this[_0x4c66('0x12')][_0x4c66('0x3d')]({'uniqueid':this['channel'][_0x4c66('0x38')],'callerid':this[_0x4c66('0xe')][_0x4c66('0x3c')],'calleridname':this['channel'][_0x4c66('0x3e')],'context':this['channel'][_0x4c66('0x3f')],'extension':this[_0x4c66('0xe')][_0x4c66('0x40')],'priority':this[_0x4c66('0xe')][_0x4c66('0x41')],'accountcode':this[_0x4c66('0xe')][_0x4c66('0x42')],'dnid':this[_0x4c66('0xe')][_0x4c66('0x43')],'projectName':this[_0x4c66('0xe')][_0x4c66('0x3b')],'saveName':_0x2fc42a,'filename':_0x2ea303[_0x4c66('0x44')]||_0x2fc42a,'savePath':_0x4d2184})[_0x4c66('0x14')](function(_0x545264){_0x5a58db(null,_0x545264);})[_0x4c66('0x18')](function(_0x4c7185){_0x5a58db(_0x4c7185);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x45')]=function(_0x2444f,_0x33ff7b,_0x3b3ef0,_0x4c4ae7,_0x5b6c63){this[_0x4c66('0x12')][_0x4c66('0x45')]({'uniqueid':this[_0x4c66('0xe')][_0x4c66('0x38')],'body':_0x2444f,'direction':_0x33ff7b,'providerName':_0x3b3ef0,'providerResponse':_0x4c4ae7})[_0x4c66('0x14')](function(_0x2089f8){if(_0x5b6c63){_0x5b6c63(null,_0x2089f8);}})['catch'](function(_0x18fb19){if(_0x5b6c63){_0x5b6c63(_0x18fb19);}});};AGIVertices[_0x4c66('0x10')]['createCmContact']=function(_0x3cf812,_0xf5b365){this[_0x4c66('0x12')][_0x4c66('0x46')]({'firstName':_['isEmpty'](_0x3cf812[_0x4c66('0x17')])||_[_0x4c66('0x47')](_0x3cf812[_0x4c66('0x17')])?_0x4c66('0x48')+Math['random']():_0x3cf812[_0x4c66('0x17')],'lastName':_[_0x4c66('0x49')](_0x3cf812[_0x4c66('0x4a')])||_[_0x4c66('0x47')](_0x3cf812[_0x4c66('0x4a')])?null:_0x3cf812['lastName'],'phone':_0x3cf812['phone'],'ListId':_0x3cf812['list_id'],'scheduledat':_0x3cf812[_0x4c66('0x4b')],'callbackUniqueid':this[_0x4c66('0xe')][_0x4c66('0x38')],'tags':_0x4c66('0x4c'),'description':_0x4c66('0x4d')+_0x3cf812[_0x4c66('0x4b')][_0x4c66('0x4e')](),'priority':_0x3cf812['callback_priority']})['then'](function(_0x4f269b){_0xf5b365(null,_0x4f269b);})[_0x4c66('0x18')](function(_0x26f38a){_0xf5b365(_0x26f38a);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x4f')]=function(_0x4ae735,_0x24e94e){this[_0x4c66('0x12')]['getPauseById'](_0x4ae735)[_0x4c66('0x14')](function(_0x19c074){_0x24e94e(null,_0x19c074?_0x19c074[_0x4c66('0x17')]:![]);})['catch'](function(_0x5de287){_0x24e94e(_0x5de287);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x50')]=function(_0x141266,_0x42d65e,_0x2bfa01){var _0x179596={'role':_0x4c66('0x51')};_0x179596[_0x141266]=this[_0x4c66('0xe')]['callerid'];this[_0x4c66('0x12')]['agentPause'](_0x179596,_0x42d65e,this[_0x4c66('0xe')]['uniqueid'])[_0x4c66('0x14')](function(_0x1ae867){_0x2bfa01(null,_[_0x4c66('0x47')](_0x1ae867)?![]:!![]);})[_0x4c66('0x18')](function(_0x44032d){logger[_0x4c66('0x32')](_0x44032d);_0x2bfa01(null,![]);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x52')]=function(_0x2c1480,_0x5646e4){var _0x51215a={'role':_0x4c66('0x51')};_0x51215a[_0x2c1480]=this[_0x4c66('0xe')][_0x4c66('0x3c')];this[_0x4c66('0x12')][_0x4c66('0x52')](_0x51215a)[_0x4c66('0x14')](function(_0x57216e){_0x5646e4(null,_[_0x4c66('0x47')](_0x57216e)?![]:!![]);})[_0x4c66('0x18')](function(_0x2dc4d2){logger[_0x4c66('0x32')](_0x2dc4d2);_0x5646e4(null,![]);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x53')]=function(_0x351714,_0x274f7a){var _0x5dff60={'role':_0x4c66('0x51')};_0x5dff60[_0x351714]=this[_0x4c66('0xe')][_0x4c66('0x3c')];this[_0x4c66('0x12')][_0x4c66('0x53')](_0x5dff60)[_0x4c66('0x14')](function(_0xcad241){_0x274f7a(null,_[_0x4c66('0x47')](_0xcad241)?![]:!![]);})[_0x4c66('0x18')](function(_0x379fdf){logger[_0x4c66('0x32')](_0x379fdf);_0x274f7a(null,![]);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x54')]=function(_0x254067,_0x12d0cb){var _0x492c59={'role':_0x4c66('0x51')};_0x492c59[_0x254067]=this[_0x4c66('0xe')][_0x4c66('0x3c')];var _0x42e0d4=_0x254067!=_0x4c66('0x55')?util[_0x4c66('0x2a')](_0x4c66('0x56'),_0x4c66('0x57'),this[_0x4c66('0xe')][_0x4c66('0x3c')]):undefined;this['rpc'][_0x4c66('0x54')](_0x492c59,_0x42e0d4)['then'](function(_0x3fa41e){_0x12d0cb(null,_[_0x4c66('0x47')](_0x3fa41e)?![]:!![]);})['catch'](function(_0x3e7d83){logger['error'](_0x3e7d83);_0x12d0cb(null,![]);});};AGIVertices[_0x4c66('0x10')]['shellCommand']=function(_0x3bc48c,_0x212c35){sh[_0x4c66('0x58')](_[_0x4c66('0x59')](_0x3bc48c),function(_0x18d14e,_0x39db47){var _0x330992=_0x39db47[_0x4c66('0x5a')](/(\r\n|\n|\r)/gm,'');_0x212c35(null,_0x330992);});};AGIVertices['prototype'][_0x4c66('0x5b')]=function(_0xa45272,_0x41ee0c){scripts[_0x4c66('0x5b')](_0xa45272[_0x4c66('0x5c')],_0xa45272['google_cloud_tts_text_type']||_0x4c66('0x5d'),_0xa45272[_0x4c66('0x5d')],_0xa45272['languageCode']||_0x4c66('0x5e'),_0xa45272[_0x4c66('0x5f')]||'MALE',_0xa45272[_0x4c66('0x60')]||_0x4c66('0x61'))['then'](function(_0x5dce87){_0x41ee0c(null,_0x5dce87);})[_0x4c66('0x18')](function(_0x3ca26b){_0x41ee0c(_0x3ca26b);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x62')]=function(_0x153f01,_0x259bdb){scripts[_0x4c66('0x62')](_0x153f01[_0x4c66('0x5d')],_0x153f01[_0x4c66('0x63')]||'en',0x1)[_0x4c66('0x14')](function(_0x1570cb){_0x259bdb(null,_0x1570cb);})['catch'](function(_0x5931ad){_0x259bdb(_0x5931ad);});};AGIVertices['prototype'][_0x4c66('0x64')]=function(_0x151f29,_0x432f22){var _0x3bb73e={'uri':_0x151f29[_0x4c66('0x65')],'method':_0x151f29[_0x4c66('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x151f29['timeout'])==='number'&&parseInt(_0x151f29[_0x4c66('0x67')])>=0x1?parseInt(_0x151f29['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x4c66('0x68')]([_0x4c66('0x69'),_0x4c66('0x6a')],_0x3bb73e[_0x4c66('0x66')][_0x4c66('0x6b')]())){try{_0x3bb73e[_0x4c66('0x6c')]=_0x151f29[_0x4c66('0xc')]?JSON[_0x4c66('0x6d')](_0x151f29[_0x4c66('0xc')]):{};}catch(_0x26071b){logger[_0x4c66('0x32')](_0x4c66('0x6e'),_0x26071b);}}try{_0x3bb73e[_0x4c66('0x6f')]=_0x151f29[_0x4c66('0xb')]?JSON['parse'](_0x151f29[_0x4c66('0xb')]):{};}catch(_0x36c53a){logger[_0x4c66('0x32')](_0x4c66('0x70'),_0x36c53a);}if(_0x151f29[_0x4c66('0x71')]){try{var _0x456a5a=require(_0x151f29[_0x4c66('0x71')])['sync'](this,_0x3bb73e);_0x3bb73e[_0x4c66('0x72')]=Mustache[_0x4c66('0x73')](_0x151f29[_0x4c66('0x65')],_0x456a5a,{},['$$','$$']);if(_0x3bb73e[_0x4c66('0x6f')]){_0x3bb73e[_0x4c66('0x6f')]=JSON[_0x4c66('0x6d')](Mustache[_0x4c66('0x73')](JSON[_0x4c66('0x74')](_0x3bb73e[_0x4c66('0x6f')]),_0x456a5a,{},['$$','$$']));}if(_0x3bb73e[_0x4c66('0x6c')]){_0x3bb73e['body']=JSON[_0x4c66('0x6d')](Mustache[_0x4c66('0x73')](JSON[_0x4c66('0x74')](_0x3bb73e[_0x4c66('0x6c')]),_0x456a5a,{},['$$','$$']));}}catch(_0x1bd22f){logger[_0x4c66('0x32')](_0x4c66('0x75'),_0x1bd22f);}}rp(_0x3bb73e)[_0x4c66('0x14')](function(_0x1e9482){var _0x11e8fd={'statusCode':_0x1e9482[_0x4c66('0x76')]||0xc8,'statusMessage':_0x1e9482[_0x4c66('0x77')]||'OK','headers':_0x1e9482[_0x4c66('0x6f')]||{},'body':_0x1e9482[_0x4c66('0x6c')]||{}};_0x432f22(null,_0x11e8fd);})[_0x4c66('0x18')](function(_0x313308){var _0x3fa5fc={'statusCode':_0x313308[_0x4c66('0x76')]||0x1f4,'statusMessage':_0x313308[_0x4c66('0x78')]||_0x4c66('0x79'),'headers':_0x313308[_0x4c66('0x7a')]['headers']||{},'body':_0x313308[_0x4c66('0x7a')]['body']||{}};_0x432f22(null,_0x3fa5fc);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x7b')]=function(_0x2cf7c7,_0x1ba9a0){scripts['googleDialogflow'](this[_0x4c66('0xe')][_0x4c66('0x38')],_0x2cf7c7[_0x4c66('0x7c')],_0x2cf7c7[_0x4c66('0x5d')],_0x2cf7c7[_0x4c66('0x7d')]||'en')['then'](function(_0x2bf269){_0x1ba9a0(null,_0x2bf269);})['catch'](function(_0x4955f2){_0x1ba9a0(_0x4955f2);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x7e')]=function(_0x4ab8d7,_0x269d2c){scripts[_0x4c66('0x7e')](this[_0x4c66('0xe')][_0x4c66('0x38')],_0x4ab8d7['dialogflowV2_project_id'],_0x4ab8d7[_0x4c66('0x7f')],_0x4ab8d7[_0x4c66('0x80')],_0x4ab8d7['text'],_0x4ab8d7[_0x4c66('0x81')]||'en')[_0x4c66('0x14')](function(_0x1c1b29){_0x269d2c(null,_0x1c1b29);})[_0x4c66('0x18')](function(_0x497483){_0x269d2c(_0x497483);});};AGIVertices[_0x4c66('0x10')]['sestekNDA']=function(_0x1ee496,_0x54b99a){scripts[_0x4c66('0x82')](this[_0x4c66('0xe')],_0x1ee496)['then'](function(_0x4b8117){_0x54b99a(null,_0x4b8117);})[_0x4c66('0x18')](function(_0x1a3d88){_0x54b99a(_0x1a3d88);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x83')]=function(_0x3b72a3,_0x3f81b4){scripts[_0x4c66('0x83')](_0x3b72a3[_0x4c66('0x7c')],_0x3b72a3[_0x4c66('0x5d')],_0x3b72a3[_0x4c66('0x84')]||_0x4c66('0x5e'),_0x3b72a3[_0x4c66('0x85')])[_0x4c66('0x14')](function(_0x53bf3a){_0x3f81b4(null,_0x53bf3a);})[_0x4c66('0x18')](function(_0x5dcbce){_0x3f81b4(_0x5dcbce);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x86')]=function(_0x4dc474,_0x402cd1,_0x1e2852){scripts[_0x4c66('0x86')](_0x402cd1,_0x4dc474[_0x4c66('0x7c')],_0x4dc474[_0x4c66('0x87')]||_0x4c66('0x5e'),this[_0x4c66('0x88')](_0x4dc474[_0x4c66('0x89')])?_0x4dc474['model']:undefined)['then'](function(_0x586cd1){_0x1e2852(null,_0x586cd1);})[_0x4c66('0x18')](function(_0x66e590){_0x1e2852(_0x66e590);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x8a')]=function(_0x56b7e2,_0x486f83){scripts['awsPolly'](_0x56b7e2[_0x4c66('0x8b')],_0x56b7e2[_0x4c66('0x8c')],_0x56b7e2['aws_polly_region'],_0x56b7e2[_0x4c66('0x8d')]||_0x4c66('0x8e'),_0x56b7e2[_0x4c66('0x5d')],_0x56b7e2[_0x4c66('0x8f')]||'text')[_0x4c66('0x14')](function(_0x4c2b19){_0x486f83(null,_0x4c2b19);})[_0x4c66('0x18')](function(_0x341026){_0x486f83(_0x341026);});};AGIVertices['prototype'][_0x4c66('0x90')]=function(_0x42dcc8,_0x16a462){scripts[_0x4c66('0x90')](this[_0x4c66('0xe')][_0x4c66('0x38')],_0x42dcc8[_0x4c66('0x8b')],_0x42dcc8[_0x4c66('0x8c')],_0x42dcc8['aws_lex_region'],_0x42dcc8[_0x4c66('0x5d')],_0x42dcc8['aws_bot_name'])[_0x4c66('0x14')](function(_0x1f6dd6){_0x16a462(null,_0x1f6dd6);})[_0x4c66('0x18')](function(_0x1bfa27){_0x16a462(_0x1bfa27);});};AGIVertices[_0x4c66('0x10')][_0x4c66('0x91')]=function(_0x21df57,_0x3f5016,_0x3ccd6d){scripts[_0x4c66('0x91')](_0x3f5016,_0x21df57['key'],_0x21df57[_0x4c66('0x92')]||_0x4c66('0x5e'))['then'](function(_0x4810e9){_0x3ccd6d(null,_0x4810e9);})['catch'](function(_0x1f90c9){_0x3ccd6d(_0x1f90c9);});};AGIVertices[_0x4c66('0x10')]['tildeASR']=function(_0x2aed3a,_0x48bed3,_0x5777bf){scripts[_0x4c66('0x93')](_0x48bed3,_0x2aed3a[_0x4c66('0x94')],_0x2aed3a[_0x4c66('0x95')],_0x2aed3a[_0x4c66('0x72')])[_0x4c66('0x14')](function(_0x24b302){_0x5777bf(null,_0x24b302);})['catch'](function(_0x2a2b20){_0x5777bf(_0x2a2b20);});};AGIVertices['prototype']['clear']=function(_0x3fce76){var _0x24a969=_['includes'](verticesWithRetry,_0x3fce76[_0x4c66('0x3a')])?_0x3fce76:_[_0x4c66('0x96')](_0x3fce76);for(var _0x800c77 in _0x24a969){if(_0x24a969[_0x4c66('0x97')](_0x800c77)){if(_0x24a969[_0x800c77]&&_['isString'](_0x24a969[_0x800c77])){if(_[_0x4c66('0x68')](recursiveMapAttributes,_0x800c77)){_0x24a969[_0x800c77]=this[_0x4c66('0x98')](_0x24a969[_0x800c77]);}else{_0x24a969[_0x800c77]=this[_0x4c66('0x99')](_0x24a969[_0x800c77]);}}}}return _0x24a969;};AGIVertices[_0x4c66('0x10')][_0x4c66('0x9a')]=function(_0x29d735){for(var _0x33dd3b in _0x29d735){if(_0x29d735[_0x4c66('0x97')](_0x33dd3b)){if(_[_0x4c66('0x9b')](_0x29d735[_0x33dd3b])){this[_0x4c66('0x9a')](_0x29d735[_0x33dd3b]);}else if(_[_0x4c66('0x9c')](_0x29d735[_0x33dd3b])){for(var _0x114ca9=0x0;_0x114ca9<_0x29d735[_0x33dd3b][_0x4c66('0x9d')];_0x114ca9++){this[_0x4c66('0x9a')](_0x29d735[_0x33dd3b][_0x114ca9]);}}else if(_[_0x4c66('0x9e')](_0x29d735[_0x33dd3b])){_0x29d735[_0x33dd3b]=this['replaceAllVariables'](_0x29d735[_0x33dd3b]);}}}};AGIVertices[_0x4c66('0x10')]['saveRestApiResult']=function(_0x170169,_0x70001e){for(var _0x3bd507 in _0x170169){if(_0x170169[_0x4c66('0x97')](_0x3bd507)){if(_[_0x4c66('0x9b')](_0x170169[_0x3bd507])){if(!_[_0x4c66('0x49')](_0x170169[_0x3bd507])){this[_0x4c66('0x9f')](_0x170169[_0x3bd507],util[_0x4c66('0x2a')](_0x4c66('0xa0'),_0x70001e,_0x3bd507));}}else if(_[_0x4c66('0x9c')](_0x170169[_0x3bd507])){for(var _0x371f97=0x0;_0x371f97<_0x170169[_0x3bd507][_0x4c66('0x9d')];_0x371f97++){this[_0x4c66('0x9f')](_0x170169[_0x3bd507][_0x371f97],util[_0x4c66('0x2a')](_0x4c66('0xa0'),_0x70001e,_0x3bd507+'['+_0x371f97+']'));}}else{if(!_[_0x4c66('0x47')](_0x170169[_0x3bd507])){this['channel']['setVariable'](util[_0x4c66('0x2a')]('%s.%s',_0x70001e,_0x3bd507),_0x170169[_0x3bd507]);}}}}};AGIVertices[_0x4c66('0x10')]['replaceObjectAllVariables']=function(_0x196b7f){try{var _0x106e61=JSON[_0x4c66('0x6d')](_0x196b7f);this[_0x4c66('0x9a')](_0x106e61);return JSON[_0x4c66('0x74')](_0x106e61);}catch(_0x526291){return this[_0x4c66('0x99')](_0x196b7f);}};AGIVertices['prototype'][_0x4c66('0x99')]=function(_0x117cf2){var _0x31d43b=_0x117cf2['split']('{');for(var _0x4c2bfb=0x1;_0x4c2bfb<_0x31d43b[_0x4c66('0x9d')];_0x4c2bfb+=0x1){var _0x30da4f=_0x31d43b[_0x4c2bfb][_0x4c66('0xa1')]('}');if(_0x30da4f[_0x4c66('0x9d')]>0x1){_0x117cf2=_0x117cf2[_0x4c66('0xa2')]('{'+_0x30da4f[0x0]+'}',this[_0x4c66('0xe')][_0x4c66('0x11')](_0x30da4f[0x0])[_0x4c66('0xa3')]||_0x30da4f[0x0]);}}if(_0x31d43b[_0x4c66('0x9d')]===0x1){return _0x117cf2[_0x4c66('0x4e')]();}return this[_0x4c66('0x99')](_0x117cf2);};AGIVertices[_0x4c66('0x10')][_0x4c66('0xa4')]=function(_0x41d7a1,_0x27014d){var _0x549c5f=this[_0x4c66('0xe')][_0x4c66('0x11')](_0x41d7a1);if(_0x549c5f[_0x4c66('0xa5')]===-0x1){return _0x549c5f;}logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xa6'),_0x27014d,_0x549c5f[_0x4c66('0xa3')]));return this[_0x4c66('0xe')]['setVariable'](_0x27014d,_0x549c5f['extra']);};AGIVertices['prototype'][_0x4c66('0x88')]=function(_0x351fb6){return _0x351fb6&&_0x351fb6!=='0'&&_0x351fb6!=='-1'&&_0x351fb6!=='';};AGIVertices[_0x4c66('0x10')][_0x4c66('0xa7')]=function(_0x3d4ff6){this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x3d4ff6,'-');_0x3d4ff6[_0x4c66('0xa9')]=_0x3d4ff6[_0x4c66('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4c66('0x10')][_0x4c66('0xaa')]=function(_0x40057e){logger['info'](util[_0x4c66('0x2a')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x40057e[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x40057e[_0x4c66('0x5d')])){return this['channel']['noop'](_0x4c66('0xab'));}var _0x4b97f0='\x22'+_0x40057e[_0x4c66('0x5d')]+'\x22';if(this[_0x4c66('0x88')](_0x40057e[_0x4c66('0x7a')])){_0x4b97f0+=','+_0x40057e[_0x4c66('0x7a')];}var _0x393b9d=this['channel']['exec'](_0x4c66('0xac'),_0x4b97f0);if(_0x393b9d[_0x4c66('0xa5')]===-0x1){return _0x393b9d;}return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4b97f0));};AGIVertices[_0x4c66('0x10')]['mrcprecog']=function(_0x22e072){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0xad'),_0x22e072['label']));if(!this[_0x4c66('0x88')](_0x22e072[_0x4c66('0xae')])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0xb0'));}var _0x35f411=_0x22e072[_0x4c66('0xae')];if(this[_0x4c66('0x88')](_0x22e072['options'])){_0x35f411+=','+_0x22e072[_0x4c66('0x7a')];}var _0x2526a6=this[_0x4c66('0xe')]['exec'](_0x4c66('0xb1'),_0x35f411);if(_0x2526a6[_0x4c66('0xa5')]===-0x1){return _0x2526a6;}var _0x36a45a=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x4c66('0xb2'));if(_0x36a45a['result']===-0x1){return _0x36a45a;}var _0x59eed3=this[_0x4c66('0xa4')](_0x4c66('0xb3'),_0x4c66('0xb4'));if(_0x59eed3[_0x4c66('0xa5')]===-0x1){return _0x59eed3;}var _0x513f8b=this[_0x4c66('0xa4')](_0x4c66('0xb5'),_0x4c66('0xb6'));if(_0x513f8b[_0x4c66('0xa5')]===-0x1){return _0x513f8b;}return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0xb7'),_0x35f411));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x7')]=function(_0x22275f){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0xb8'),_0x22275f[_0x4c66('0x39')]));return this['channel'][_0x4c66('0x7')]([_0x22275f[_0x4c66('0xb9')],_0x22275f[_0x4c66('0xba')]]);};AGIVertices[_0x4c66('0x10')]['answer']=function(_0x297e86){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xbb'),_0x297e86[_0x4c66('0x39')]));if(this['isConfigured'](_0x297e86[_0x4c66('0x67')])){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0xbc'),_0x297e86['timeout']));var _0x9a5050=this[_0x4c66('0xe')][_0x4c66('0xbd')](_0x297e86[_0x4c66('0x67')]);if(_0x9a5050[_0x4c66('0xa5')]===-0x1){return _0x9a5050;}}return this[_0x4c66('0xe')][_0x4c66('0xbe')]();};AGIVertices['prototype'][_0x4c66('0x4c')]=function(_0x260c67){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0xbf'),_0x260c67[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x260c67['list_id'])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x260c67,_0x4c66('0xc0'));}_0x260c67[_0x4c66('0x4b')]=moment();if(this[_0x4c66('0x88')](_0x260c67[_0x4c66('0xc1')])){_0x260c67['scheduledAt']=moment()['add'](_0x260c67[_0x4c66('0xc1')],_0x4c66('0xc2'));}if(!this[_0x4c66('0x88')](_0x260c67[_0x4c66('0xc3')])){_0x260c67['callback_priority']=0x2;}this[_0x4c66('0x46')][_0x4c66('0xa8')](this,_0x260c67);return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x260c67[_0x4c66('0xc4')],_0x260c67['list_id'],_0x260c67[_0x4c66('0x4b')]));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xc5')]=function(_0x11d773){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xc6'),_0x11d773['label']));var _0x3aed8d=this[_0x4c66('0xe')]['exec'](_0x11d773[_0x4c66('0xc7')],_0x11d773['options']);if(_0x3aed8d[_0x4c66('0xa5')]===-0x1){return _0x3aed8d;}return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0xc8'),_0x11d773[_0x4c66('0xc7')],_0x11d773['options']));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xc9')]=function(_0x359154){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xca'),_0x359154[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x359154[_0x4c66('0x5d')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xab'));}var _0x4a56f2='\x22'+_0x359154['text']+'\x22';if(this[_0x4c66('0x88')](_0x359154[_0x4c66('0x7a')])){_0x4a56f2+=','+_0x359154['options'];}var _0x24af5f=this[_0x4c66('0xe')][_0x4c66('0x58')](_0x4c66('0xac'),_0x4a56f2);if(_0x24af5f[_0x4c66('0xa5')]===-0x1){return _0x24af5f;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4a56f2));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xcb')]=function(_0x5329e2){logger['info'](util[_0x4c66('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5329e2[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x5329e2[_0x4c66('0x5d')])){return this['channel']['noop'](_0x4c66('0xab'));}var _0x32f011='\x22'+_0x5329e2[_0x4c66('0x5d')]+'\x22';if(this[_0x4c66('0x88')](_0x5329e2['options'])){_0x32f011+=','+_0x5329e2[_0x4c66('0x7a')];}var _0x54bd93=this[_0x4c66('0xe')]['exec'](_0x4c66('0xac'),_0x32f011);if(_0x54bd93[_0x4c66('0xa5')]===-0x1){return _0x54bd93;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x32f011));};AGIVertices['prototype'][_0x4c66('0xcc')]=function(_0xa7b07a){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xa7b07a[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0xa7b07a['grammar'])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xb0'));}var _0x288344=_0xa7b07a['grammar'];if(this[_0x4c66('0x88')](_0xa7b07a[_0x4c66('0x7a')])){_0x288344+=','+_0xa7b07a['options'];}var _0x2bd1cd=this[_0x4c66('0xe')][_0x4c66('0x58')](_0x4c66('0xb1'),_0x288344);if(_0x2bd1cd[_0x4c66('0xa5')]===-0x1){return _0x2bd1cd;}var _0x140f75=this['getAndSetVariable'](_0x4c66('0xcd'),'LUMENVOX_ASR_CONFIDENCE');if(_0x140f75[_0x4c66('0xa5')]===-0x1){return _0x140f75;}var _0x4a1a40=this[_0x4c66('0xa4')](_0x4c66('0xb3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x4a1a40['result']===-0x1){return _0x4a1a40;}var _0x2907a1=this[_0x4c66('0xa4')]('RECOG_INSTANCE()',_0x4c66('0xce'));if(_0x2907a1[_0x4c66('0xa5')]===-0x1){return _0x2907a1;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x288344));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xcf')]=function(_0x4454e0){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xd0'),_0x4454e0[_0x4c66('0x39')]));if(!this['isConfigured'](_0x4454e0['grammar'])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0xb0'));}var _0x3e5ca8=_0x4454e0[_0x4c66('0xae')];if(this[_0x4c66('0x88')](_0x4454e0[_0x4c66('0x7a')])){_0x3e5ca8+=','+_0x4454e0[_0x4c66('0x7a')];}var _0x922c70=this['channel'][_0x4c66('0x58')](_0x4c66('0xb1'),_0x3e5ca8);if(_0x922c70['result']===-0x1){return _0x922c70;}var _0x369598=this['getAndSetVariable'](_0x4c66('0xcd'),_0x4c66('0xd1'));if(_0x369598[_0x4c66('0xa5')]===-0x1){return _0x369598;}var _0x2a1948=this[_0x4c66('0xa4')]('RECOG_INPUT()',_0x4c66('0xd2'));if(_0x2a1948[_0x4c66('0xa5')]===-0x1){return _0x2a1948;}var _0x11d4a8=this[_0x4c66('0xa4')]('RECOG_INSTANCE()',_0x4c66('0xd3'));if(_0x11d4a8[_0x4c66('0xa5')]===-0x1){return _0x11d4a8;}return this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0xb7'),_0x3e5ca8));};AGIVertices[_0x4c66('0x10')]['database']=function(_0x3e62f7){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3e62f7['label']));if(!this[_0x4c66('0x88')](_0x3e62f7['odbc_id'])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x3e62f7,_0x4c66('0xd4'));}var _0x56fc1c=this[_0x4c66('0xd5')]['sync'](this,_0x3e62f7['odbc_id']);if(!_0x56fc1c){return this['channel'][_0x4c66('0x32')](_0x3e62f7,'no\x20odbc\x20database\x20found');}if(!this[_0x4c66('0x88')](_0x3e62f7[_0x4c66('0xd6')])){return this['channel']['error'](_0x3e62f7,_0x4c66('0xd7'));}var _0xb07739=_0x3e62f7[_0x4c66('0xd6')][_0x4c66('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x4c66('0x2a')]('query:\x20%s',_0xb07739));var _0x226a91=this[_0x4c66('0x2c')]['sync'](this,_0x56fc1c,_0xb07739);this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0x3e62f7,_0xb07739);if(!this[_0x4c66('0x88')](_0x3e62f7[_0x4c66('0xd8')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xd9'));}var _0x255d9e=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x3e62f7[_0x4c66('0xd8')]);if(!_0x255d9e){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x3e62f7,_0x4c66('0xda'));}var _0x2290f0=this;_0x226a91[_0x4c66('0xdb')](function(_0x492e6a,_0x406d76){Object[_0x4c66('0xdc')](_0x492e6a)[_0x4c66('0xdb')](function(_0x3255eb){_0x2290f0[_0x4c66('0xe')][_0x4c66('0xdd')](util[_0x4c66('0x2a')](_0x4c66('0xde'),_0x255d9e,_0x406d76,_0x3255eb),_0x492e6a[_0x3255eb]);});});this[_0x4c66('0xe')][_0x4c66('0xdd')](util[_0x4c66('0x2a')](_0x4c66('0xdf'),_0x255d9e),_0x226a91[_0x4c66('0x9d')]);return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0xe0'),_0x255d9e));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xe1')]=function(_0x28f5ad){logger[_0x4c66('0xe2')](util[_0x4c66('0x2a')](_0x4c66('0xe3'),_0x28f5ad[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x28f5ad[_0x4c66('0xe4')])){return this['channel']['error'](_0x28f5ad,_0x4c66('0xe5'));}var _0x3298e8=this['getUser']['sync'](this,_0x28f5ad[_0x4c66('0xe4')]);if(!_0x3298e8){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x28f5ad,_0x4c66('0xe6'));}var _0x4da430=this['channel']['exec'](_0x4c66('0xe7'),[util[_0x4c66('0x2a')](_0x4c66('0xe8'),_0x3298e8),_0x28f5ad[_0x4c66('0x67')],_0x28f5ad[_0x4c66('0xe9')],_0x28f5ad[_0x4c66('0x65')]]);if(_0x4da430['result']===-0x1){return _0x4da430;}return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0xea'),_0x4c66('0xe7')));};AGIVertices[_0x4c66('0x10')]['dialogflow']=function(_0xd2929a){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0xeb'),_0xd2929a['label']));if(!this['isConfigured'](_0xd2929a[_0x4c66('0x7c')])){return this['channel']['noop'](_0x4c66('0xec'));}if(!this[_0x4c66('0x88')](_0xd2929a[_0x4c66('0x5d')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20text\x20configured');}this[_0x4c66('0xe')][_0x4c66('0xed')]=!![];this['createSquareDetailsReport'](_0xd2929a);this['createSquareMessage'](_0xd2929a[_0x4c66('0x5d')],'in','','');this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0xee'),_0xd2929a[_0x4c66('0x5d')]));var _0x1ac46b=this[_0x4c66('0x7b')][_0x4c66('0xa8')](this,_0xd2929a);if(_0x1ac46b){for(var _0x26d975 in _0x1ac46b){if(_0x1ac46b[_0x4c66('0x97')](_0x26d975)){this[_0x4c66('0xe')]['setVariable'](util['format'](_0x4c66('0xef'),_0x26d975[_0x4c66('0x6b')]()),_0x1ac46b[_0x26d975]);}}this[_0x4c66('0x45')](_0x1ac46b[_0x4c66('0xf0')],_0x4c66('0xf1'),_0x4c66('0xf2'),'');return this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0xf3'),_0x1ac46b[_0x4c66('0xf0')]));}return this[_0x4c66('0xe')][_0x4c66('0x32')](_0xd2929a,_0x4c66('0xf4'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xf5')]=function(_0x477ab0){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0xf6'),_0x477ab0['label']));if(!this[_0x4c66('0x88')](_0x477ab0['dialogflowV2_project_id'])){return this[_0x4c66('0xe')]['noop'](_0x4c66('0xf7'));}if(!this['isConfigured'](_0x477ab0[_0x4c66('0x7f')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xf8'));}if(!this['isConfigured'](_0x477ab0[_0x4c66('0x80')])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0xf9'));}if(!this[_0x4c66('0x88')](_0x477ab0[_0x4c66('0x81')])){return this[_0x4c66('0xe')]['noop']('no\x20anguage\x20configured');}if(!this[_0x4c66('0x88')](_0x477ab0[_0x4c66('0x5d')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xab'));}this[_0x4c66('0xe')][_0x4c66('0xed')]=!![];this['createSquareDetailsReport'](_0x477ab0);this[_0x4c66('0x45')](_0x477ab0[_0x4c66('0x5d')],'in','','');this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0xfa'),_0x477ab0['text']));var _0x95cef9=this[_0x4c66('0x7e')][_0x4c66('0xa8')](this,_0x477ab0);if(_0x95cef9){for(var _0x4fa4e1 in _0x95cef9){if(_0x95cef9[_0x4c66('0x97')](_0x4fa4e1)){if(_0x4fa4e1!==_0x4c66('0xfb')){this[_0x4c66('0xe')][_0x4c66('0xdd')](util['format'](_0x4c66('0xef'),_0x4fa4e1['toUpperCase']()),_0x95cef9[_0x4fa4e1]);}}}this[_0x4c66('0x45')](_0x95cef9[_0x4c66('0xf0')],_0x4c66('0xf1'),'dialogflowV2',_0x95cef9[_0x4c66('0xfb')]);return this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0xfc'),_0x95cef9[_0x4c66('0xf0')]));}return this[_0x4c66('0xe')]['error'](_0x477ab0,_0x4c66('0xfd'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0xfe')]=function(_0x53d893){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x53d893[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x53d893[_0x4c66('0xff')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x100'));}if(!this[_0x4c66('0x88')](_0x53d893[_0x4c66('0x101')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x53d893[_0x4c66('0x102')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x103'));}if(!this[_0x4c66('0x88')](_0x53d893[_0x4c66('0x104')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20text\x20configured');}this['channel'][_0x4c66('0xed')]=!![];this[_0x4c66('0x37')](_0x53d893);this[_0x4c66('0x45')](_0x53d893['text'],'in','','');this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x105'),_0x53d893[_0x4c66('0x5d')]));var _0x1b363b=this[_0x4c66('0x82')]['sync'](this,_0x53d893);if(_0x1b363b){for(var _0x35eff9 in _0x1b363b){if(_0x1b363b[_0x4c66('0x97')](_0x35eff9)){this[_0x4c66('0xe')]['setVariable'](util['format'](_0x4c66('0x106'),_0x35eff9['toUpperCase']()),_0x1b363b[_0x35eff9]);}}this[_0x4c66('0x45')](_0x1b363b[_0x4c66('0xf0')],_0x4c66('0xf1'),_0x4c66('0xfe'),'');if(_0x1b363b[_0x4c66('0x107')]){this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1b363b[_0x4c66('0x107')]));var _0x3023ec=this['channel']['streamFile'](_0x1b363b['audiofile']);try{fs['unlink'](_0x1b363b[_0x4c66('0x107')]+_0x4c66('0x108'));}catch(_0x3f82a9){logger['error'](_0x3f82a9);}return _0x3023ec;}else{return this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x109'),_0x1b363b[_0x4c66('0xf0')]));}}return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x53d893,_0x4c66('0x10a'));};AGIVertices['prototype']['end']=function(_0x50ce30){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x10b'),_0x50ce30[_0x4c66('0x39')]));return this['channel'][_0x4c66('0xaf')](_0x4c66('0x10c'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x10d')]=function(_0xc87de1){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x10e'),_0xc87de1[_0x4c66('0x39')]));var _0x181021='';if(_0xc87de1['trunk_id']){if(!this[_0x4c66('0x88')](_0xc87de1[_0x4c66('0x10f')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0xc87de1,'no\x20trunk\x20selected');}else{var _0x39c0e4=parseInt(_0xc87de1[_0x4c66('0x10f')],0xa);if(isNaN(_0x39c0e4)){_0x181021=_0xc87de1[_0x4c66('0x10f')];}else{_0x181021=this[_0x4c66('0x110')][_0x4c66('0xa8')](this,_0xc87de1[_0x4c66('0x10f')]);if(!_0x181021){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0xc87de1,'no\x20trunk\x20found');}}}}else if(_0xc87de1[_0x4c66('0x111')]){_0x181021=_0xc87de1[_0x4c66('0x111')];}else{return this[_0x4c66('0xe')][_0x4c66('0x32')](_0xc87de1,_0x4c66('0x112'));}var _0x1f7337=this[_0x4c66('0xe')][_0x4c66('0x58')](_0x4c66('0xe7'),[util[_0x4c66('0x2a')](_0x4c66('0x113'),_0x181021,_0xc87de1[_0x4c66('0xc4')]),_0xc87de1[_0x4c66('0x67')],_0xc87de1[_0x4c66('0xe9')],_0xc87de1[_0x4c66('0x65')]]);if(_0x1f7337[_0x4c66('0xa5')]===-0x1){return _0x1f7337;}return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x114')]=function(_0x2c2a9e){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2c2a9e[_0x4c66('0x39')]));return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x114'));};AGIVertices[_0x4c66('0x10')]['getdigits']=function(_0x39ed7a){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x39ed7a[_0x4c66('0x39')]));if(_0x39ed7a['retry']===0x0){return this[_0x4c66('0xa7')](_0x39ed7a);}_0x39ed7a[_0x4c66('0xa9')]-=0x1;if(!this[_0x4c66('0x88')](_0x39ed7a['file_id'])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x39ed7a,'no\x20file\x20audio\x20selected');}var _0x20fbb4=this[_0x4c66('0x1d')][_0x4c66('0xa8')](this,_0x39ed7a[_0x4c66('0x115')]);if(!_0x20fbb4){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x39ed7a,_0x4c66('0x116'));}if(!this[_0x4c66('0x88')](_0x39ed7a[_0x4c66('0xd8')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x4c66('0xd9'));}var _0x3d544f=this[_0x4c66('0xe')]['getData'](_0x20fbb4,_0x39ed7a[_0x4c66('0x117')],_0x39ed7a[_0x4c66('0x118')]);var _0x5f5561=_0x3d544f[_0x4c66('0xa5')]?_0x3d544f['result'][_0x4c66('0x4e')]():'';logger[_0x4c66('0x2f')](_0x4c66('0x119'),JSON['stringify'](_0x3d544f));if(_0x3d544f['result']===-0x1){this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0x39ed7a,_0x5f5561);return _0x3d544f;}else if(_0x3d544f[_0x4c66('0xa3')]===_0x4c66('0x67')){_0x3d544f[_0x4c66('0xa5')]=_0x5f5561[_0x4c66('0x9d')]>=parseInt(_0x39ed7a[_0x4c66('0x11a')])?'x':'i';}else{_0x3d544f[_0x4c66('0xa5')]=_0x5f5561[_0x4c66('0x9d')]>=parseInt(_0x39ed7a[_0x4c66('0x11a')])&&_0x5f5561[_0x4c66('0x9d')]<=parseInt(_0x39ed7a[_0x4c66('0x118')])?'x':'i';}var _0x173ad0=this['getVariable']['sync'](this,_0x39ed7a[_0x4c66('0xd8')]);if(!_0x173ad0){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x39ed7a,_0x4c66('0xda'));}this[_0x4c66('0xe')][_0x4c66('0xdd')](_0x173ad0,_0x5f5561);if(this[_0x4c66('0x88')](_0x39ed7a[_0x4c66('0x11b')])){var _0x3a8530=parseInt(_0x39ed7a[_0x4c66('0x11b')],0xa);var _0x101b48=rs[_0x4c66('0x11c')]({'charset':'*','length':_0x3a8530});var _0x92709b=_0x5f5561[_0x4c66('0x9d')];if(_0x92709b>0x0){if(_0x92709b>_0x3a8530){this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x39ed7a,_0x39ed7a[_0x4c66('0x11d')]===_0x4c66('0x11e')?_0x101b48+_0x5f5561['substr'](_0x3a8530):_0x5f5561[_0x4c66('0x11f')](0x0,_0x92709b-_0x3a8530)+_0x101b48);}else{this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0x39ed7a,rs[_0x4c66('0x11c')]({'charset':'*','length':_0x92709b}));}}else{this[_0x4c66('0x37')]['sync'](this,_0x39ed7a,'');}}else{this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0x39ed7a,_0x5f5561);}return _0x3d544f;};AGIVertices[_0x4c66('0x10')][_0x4c66('0x120')]=function(_0x327577){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x121'),_0x327577['label']));return this[_0x4c66('0x122')](_0x327577);};AGIVertices[_0x4c66('0x10')]['goal']=function(_0xb11d88){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x123'),_0xb11d88[_0x4c66('0x39')]));this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0xb11d88,_0xb11d88['goalname']);return this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('GOAL\x20%s',_0xb11d88['goalname']));};AGIVertices['prototype'][_0x4c66('0x124')]=function(_0x340087){logger['info'](util[_0x4c66('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x340087[_0x4c66('0x39')]));if(!this['isConfigured'](_0x340087[_0x4c66('0x8b')])||!this[_0x4c66('0x88')](_0x340087[_0x4c66('0x8c')])){return this[_0x4c66('0xe')]['noop'](_0x4c66('0x125'));}if(!this[_0x4c66('0x88')](_0x340087['text'])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20text\x20configured');}this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x126'),_0x340087[_0x4c66('0x5d')]));var _0x2c4356=this[_0x4c66('0x8a')]['sync'](this,_0x340087);if(_0x2c4356){this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x127'),_0x2c4356));var _0x2735d9=this[_0x4c66('0xe')][_0x4c66('0x128')](_0x2c4356);try{fs['unlink'](_0x2c4356+_0x4c66('0x108'));}catch(_0x2fa944){logger['error'](_0x2fa944);}return _0x2735d9;}return this['channel'][_0x4c66('0x32')](_0x340087,_0x4c66('0x129'));};AGIVertices['prototype']['awslex']=function(_0x5c602e){logger['info'](util[_0x4c66('0x2a')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5c602e[_0x4c66('0x39')]));if(!this['isConfigured'](_0x5c602e['aws_access_key_id'])||!this[_0x4c66('0x88')](_0x5c602e[_0x4c66('0x8c')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x125'));}if(!this[_0x4c66('0x88')](_0x5c602e[_0x4c66('0x12a')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x12b'));}if(!this['isConfigured'](_0x5c602e['text'])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xab'));}this['channel'][_0x4c66('0xed')]=!![];this[_0x4c66('0x37')](_0x5c602e);this[_0x4c66('0x45')](_0x5c602e[_0x4c66('0x5d')],'in','','');this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0x12c'),_0x5c602e['text']));var _0x55767c=this[_0x4c66('0x90')][_0x4c66('0xa8')](this,_0x5c602e);if(_0x55767c){for(var _0x382dba in _0x55767c){if(_0x55767c[_0x4c66('0x97')](_0x382dba)&&_[_0x4c66('0x9e')](_0x55767c[_0x382dba])){this['channel'][_0x4c66('0xdd')](util[_0x4c66('0x2a')]('AWS_LEX_%s',_0x382dba['toUpperCase']()),_0x55767c[_0x382dba]);}}if(_[_0x4c66('0x47')](_0x55767c[_0x4c66('0x78')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x12d'));}else{this[_0x4c66('0x45')](_0x55767c[_0x4c66('0x78')],_0x4c66('0xf1'),'amazonlex','');return this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x12e'),_0x55767c[_0x4c66('0x78')]));}}return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x5c602e,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x4c66('0x10')][_0x4c66('0x12f')]=function(_0x34dd57){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x130'),_0x34dd57[_0x4c66('0x39')],_0x34dd57[_0x4c66('0x67')]));if(!this[_0x4c66('0x88')](_0x34dd57[_0x4c66('0x7c')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xec'));}var _0x4f273b='wav';var _0x38f253=util[_0x4c66('0x2a')](_0x4c66('0x131'),FILES_PATH,rs['generate'](0x4));var _0x15600f=util[_0x4c66('0x2a')](_0x4c66('0xa0'),_0x38f253,_0x4f273b);var _0x9f174e=!![];if(_0x34dd57[_0x4c66('0x132')]===_0x4c66('0x133')){_0x9f174e=![];}var _0x5ae121=this['channel'][_0x4c66('0x134')](_0x38f253,_0x4f273b,_0x34dd57['intKey'],_0x34dd57[_0x4c66('0x67')],undefined,_0x9f174e);if(_0x5ae121[_0x4c66('0xa5')]!==-0x1){this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x135'),_0x15600f));var _0x53aa6c=this[_0x4c66('0x91')][_0x4c66('0xa8')](this,_0x34dd57,_0x15600f);if(_0x53aa6c){for(var _0x56e5e1 in _0x53aa6c){if(_0x53aa6c['hasOwnProperty'](_0x56e5e1)){this[_0x4c66('0xe')][_0x4c66('0xdd')](util['format'](_0x4c66('0x136'),_0x56e5e1[_0x4c66('0x6b')]()),_0x53aa6c[_0x56e5e1]);}}return this['channel'][_0x4c66('0xaf')](util['format'](_0x4c66('0x137'),JSON['stringify'](_0x53aa6c)));}}return _0x5ae121;};AGIVertices[_0x4c66('0x10')][_0x4c66('0x138')]=function(_0x345483){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x139'),_0x345483[_0x4c66('0x39')]));if(!this['isConfigured'](_0x345483['appid'])){return this['channel'][_0x4c66('0xaf')]('no\x20appid\x20configured');}if(!this[_0x4c66('0x88')](_0x345483[_0x4c66('0x95')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x13a'));}var _0x21c0db='wav';var _0x22f6d8=util[_0x4c66('0x2a')](_0x4c66('0x131'),FILES_PATH,rs[_0x4c66('0x11c')](0x4));var _0x4f041c=util[_0x4c66('0x2a')](_0x4c66('0xa0'),_0x22f6d8,_0x21c0db);var _0x1c0cd8=!![];if(_0x345483[_0x4c66('0x132')]===_0x4c66('0x133')){_0x1c0cd8=![];}var _0x16fcd0=this[_0x4c66('0xe')]['recordFile'](_0x22f6d8,_0x21c0db,_0x345483[_0x4c66('0x13b')],_0x345483['timeout'],undefined,_0x1c0cd8);if(_0x16fcd0[_0x4c66('0xa5')]!==-0x1){this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x13c'),_0x4f041c));var _0x384893=this[_0x4c66('0x93')][_0x4c66('0xa8')](this,_0x345483,_0x4f041c);if(_0x384893){for(var _0x113771 in _0x384893){if(_0x384893[_0x4c66('0x97')](_0x113771)){this[_0x4c66('0xe')][_0x4c66('0xdd')](util[_0x4c66('0x2a')](_0x4c66('0x13d'),_0x113771[_0x4c66('0x6b')]()),_0x384893[_0x113771]);}}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x13e'),JSON[_0x4c66('0x74')](_0x384893)));}}return _0x16fcd0;};AGIVertices['prototype'][_0x4c66('0x13f')]=function(_0x4cd538){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4cd538[_0x4c66('0x39')]));return this['channel']['continueAt'](_0x4cd538[_0x4c66('0x3f')],_0x4cd538[_0x4c66('0x40')],_0x4cd538['priority']);};AGIVertices['prototype'][_0x4c66('0x140')]=function(_0x25451c){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x141'),_0x25451c[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x25451c[_0x4c66('0x142')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x25451c,_0x4c66('0x143'));}try{var _0x25634a=eval(_0x25451c['condition'])?_0x4c66('0x144'):'false';this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0x145'),_0x25451c['condition'],_0x25634a));return{'code':0xc8,'result':_0x25634a};}catch(_0x2674b9){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x4c66('0x146')]=function(_0x335222){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x147'),_0x335222[_0x4c66('0x39')]));if(!this['isConfigured'](_0x335222[_0x4c66('0x148')])){return this['channel']['error'](_0x335222,_0x4c66('0x149'));}var _0x425cde=this[_0x4c66('0x24')]['sync'](this,_0x335222[_0x4c66('0x148')]);if(!_0x425cde){return this['channel'][_0x4c66('0x32')](_0x335222,_0x4c66('0x14a'));}for(var _0x147a7e=0x0;_0x147a7e<_0x425cde['length'];_0x147a7e+=0x1){var _0x3924bd=this[_0x4c66('0xe')][_0x4c66('0x11')](util[_0x4c66('0x2a')](_0x4c66('0x14b'),_0x425cde[_0x147a7e]));if(_0x3924bd[_0x4c66('0xa5')]===-0x1){return _0x3924bd;}logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x14c'),_0x425cde[_0x147a7e],_0x3924bd[_0x4c66('0xa3')]));if(_0x3924bd[_0x4c66('0xa3')]===_0x4c66('0x144')){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x14c'),_0x425cde[_0x147a7e],_0x4c66('0x144')));this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x14c'),_0x425cde[_0x147a7e],_0x4c66('0x144')));return{'code':0xc8,'result':_0x4c66('0x144')};}else{logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x14c'),_0x425cde[_0x147a7e],_0x4c66('0x14d')));this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('IFTIME\x20%s\x20%s',_0x425cde[_0x147a7e],_0x4c66('0x14d')));}}return{'code':0xc8,'result':_0x4c66('0x14d')};};AGIVertices[_0x4c66('0x10')]['hangup']=function(_0x324f5d){logger['info'](util['format'](_0x4c66('0x14e'),_0x324f5d['label']));return this['channel'][_0x4c66('0x14f')]();};AGIVertices[_0x4c66('0x10')][_0x4c66('0x150')]=function(_0x129700){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x151'),_0x129700['label']));if(!this[_0x4c66('0x88')](_0x129700['key'])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0xec'));}var _0x41ff9f='wav';var _0x4309a1=util[_0x4c66('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x4c66('0x11c')](0x4));var _0x2e32b3=util['format']('%s.%s',_0x4309a1,_0x41ff9f);var _0xb03222=!![];if(_0x129700[_0x4c66('0x132')]===_0x4c66('0x133')){_0xb03222=![];}var _0x108a83=this[_0x4c66('0xe')][_0x4c66('0x134')](_0x4309a1,_0x41ff9f,_0x129700[_0x4c66('0x13b')],_0x129700[_0x4c66('0x67')],undefined,_0xb03222);if(_0x108a83[_0x4c66('0xa5')]!==-0x1){this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x152'),_0x2e32b3));var _0x373224=this[_0x4c66('0x86')]['sync'](this,_0x129700,_0x2e32b3);if(_0x373224){for(var _0x53300b in _0x373224){if(_0x373224[_0x4c66('0x97')](_0x53300b)){this[_0x4c66('0xe')]['setVariable'](util[_0x4c66('0x2a')]('ISPEECH_ASR_%s',_0x53300b[_0x4c66('0x6b')]()),_0x373224[_0x53300b]);}}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0x153'),JSON[_0x4c66('0x74')](_0x373224)));}}return _0x108a83;};AGIVertices[_0x4c66('0x10')]['ispeechtts']=function(_0x43b6f8){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x154'),_0x43b6f8[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x43b6f8[_0x4c66('0x7c')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x43b6f8[_0x4c66('0x5d')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xab'));}this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x155'),_0x43b6f8[_0x4c66('0x5d')]));var _0x4d38db=this[_0x4c66('0x83')][_0x4c66('0xa8')](this,_0x43b6f8);if(_0x4d38db){this['channel']['noop'](util[_0x4c66('0x2a')](_0x4c66('0x152'),_0x4d38db));var _0xf463a5=this['channel'][_0x4c66('0x128')](_0x4d38db,_0x43b6f8[_0x4c66('0x13b')]);try{fs[_0x4c66('0x156')](_0x4d38db+_0x4c66('0x108'));}catch(_0x448986){logger[_0x4c66('0x32')](_0x448986);}return _0xf463a5;}return this['channel']['error'](_0x43b6f8,_0x4c66('0x157'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x158')]=function(_0x55f991){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x159'),_0x55f991[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x55f991[_0x4c66('0x15a')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x55f991,_0x4c66('0x15b'));}logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x15c'),this['channel'][_0x4c66('0x3c')],_0x55f991[_0x4c66('0x15a')]));var _0x3f79c8=this[_0x4c66('0x54')][_0x4c66('0xa8')](this,_0x55f991[_0x4c66('0x15a')]);if(_0x3f79c8){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x55f991[_0x4c66('0x15a')]));this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x55f991['findBy']));return{'code':0xc8,'result':_0x4c66('0x15e')};}else{logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x55f991['findBy']));this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x55f991['findBy']));return{'code':0xc8,'result':_0x4c66('0x160')};}};AGIVertices['prototype'][_0x4c66('0x161')]=function(_0x87f767){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x162'),_0x87f767[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x87f767[_0x4c66('0x15a')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x87f767,'no\x20find\x20by\x20configured');}logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x15c'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x87f767['findBy']));var _0x144af0=this['agentLogout'][_0x4c66('0xa8')](this,_0x87f767[_0x4c66('0x15a')]);if(_0x144af0){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this[_0x4c66('0xe')]['callerid'],_0x87f767['findBy']));this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0x15d'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x87f767[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x15e')};}else{logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this['channel'][_0x4c66('0x3c')],_0x87f767[_0x4c66('0x15a')]));this['channel'][_0x4c66('0xaf')](util['format'](_0x4c66('0x15f'),this[_0x4c66('0xe')]['callerid'],_0x87f767[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x160')};}};AGIVertices['prototype'][_0x4c66('0x163')]=function(_0x1ad9a2){logger[_0x4c66('0x2f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1ad9a2[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x1ad9a2[_0x4c66('0x164')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x1ad9a2,_0x4c66('0x165'));}this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0x166'),_0x1ad9a2[_0x4c66('0x164')]));var _0xe8284=eval(_0x1ad9a2[_0x4c66('0x164')]);if(!this['isConfigured'](_0x1ad9a2[_0x4c66('0xd8')])){return this[_0x4c66('0xe')]['noop'](_0x4c66('0xd9'));}var _0x4a1d8c=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x1ad9a2['variable_id']);if(!_0x4a1d8c){return this['channel'][_0x4c66('0x32')](_0x1ad9a2,_0x4c66('0xda'));}if(_['isArray'](_0xe8284)){var _0x3fff65=this;_0xe8284[_0x4c66('0xdb')](function(_0x4853fc,_0x1adc61){_0x3fff65[_0x4c66('0xe')][_0x4c66('0xdd')](util[_0x4c66('0x2a')](_0x4c66('0x167'),_0x4a1d8c,_0x1adc61),_0x4853fc);});return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x168'),_0x4a1d8c));}else{return this['channel'][_0x4c66('0xdd')](_0x4a1d8c,_0xe8284);}};AGIVertices[_0x4c66('0x10')][_0x4c66('0xd')]=function(_0x1c26cc){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x169'),_0x1c26cc[_0x4c66('0x39')]));if(_0x1c26cc['retry']===0x0){return this[_0x4c66('0xa7')](_0x1c26cc);}_0x1c26cc[_0x4c66('0xa9')]-=0x1;if(!this[_0x4c66('0x88')](_0x1c26cc['file_id'])){return this[_0x4c66('0xe')]['error'](_0x1c26cc,'no\x20file\x20audio\x20selected');}var _0x5dc7c0=this['getSound'][_0x4c66('0xa8')](this,_0x1c26cc[_0x4c66('0x115')]);if(!_0x5dc7c0){return this[_0x4c66('0xe')]['error'](_0x1c26cc,_0x4c66('0x116'));}var _0x5b98bb=this[_0x4c66('0xe')][_0x4c66('0x16a')](_0x5dc7c0,_0x1c26cc[_0x4c66('0x117')],_0x1c26cc['digit']);var _0x4f2c9a=_0x5b98bb[_0x4c66('0xa5')];if(_0x5b98bb[_0x4c66('0xa5')]===-0x1){this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x1c26cc,'-1');return _0x5b98bb;}else if(_0x5b98bb[_0x4c66('0xa3')]===_0x4c66('0x67')){_0x5b98bb[_0x4c66('0xa5')]=_0x5b98bb[_0x4c66('0xa5')][_0x4c66('0x9d')]>0x0?_0x5b98bb['result']:'t';}else if(_[_0x4c66('0x49')](_0x5b98bb[_0x4c66('0xa5')])){_0x5b98bb[_0x4c66('0xa5')]='#';_0x4f2c9a='#';}if(!this['isConfigured'](_0x1c26cc[_0x4c66('0xd8')])){this['channel'][_0x4c66('0xaf')](_0x4c66('0xd9'));}else{var _0x23c7da=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x1c26cc[_0x4c66('0xd8')]);if(!_0x23c7da){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x1c26cc,_0x4c66('0xda'));}this[_0x4c66('0xe')][_0x4c66('0xdd')](_0x23c7da,_0x4f2c9a);}this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x1c26cc,_0x4f2c9a);return _0x5b98bb;};AGIVertices['prototype']['noop']=function(_0x3d4842){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x16b'),_0x3d4842[_0x4c66('0x39')]));return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x3d4842['output']||_0x3d4842[_0x4c66('0x39')]);};AGIVertices[_0x4c66('0x10')][_0x4c66('0x16c')]=function(_0x4daeee){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x16d'),_0x4daeee[_0x4c66('0x39')]));if(!this['isConfigured'](_0x4daeee[_0x4c66('0x15a')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x4daeee,_0x4c66('0x15b'));}logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x4daeee['findBy']));var _0x5a5b8b=this['getPause']['sync'](this,_0x4daeee[_0x4c66('0x16e')]);var _0x548ea9=this[_0x4c66('0x50')][_0x4c66('0xa8')](this,_0x4daeee[_0x4c66('0x15a')],_0x5a5b8b);if(_0x548ea9){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x4daeee[_0x4c66('0x15a')]));this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this['channel']['callerid'],_0x4daeee[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x15e')};}else{logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this[_0x4c66('0xe')]['callerid'],_0x4daeee[_0x4c66('0x15a')]));this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x4daeee[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x160')};}};AGIVertices['prototype'][_0x4c66('0x16f')]=function(_0x4df56b){logger['info'](util[_0x4c66('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4df56b[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x4df56b[_0x4c66('0x115')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x4df56b,_0x4c66('0x170'));}var _0x52981f=this[_0x4c66('0x1d')]['sync'](this,_0x4df56b[_0x4c66('0x115')]);if(!_0x52981f){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x4df56b,_0x4c66('0x116'));}var _0x10a574=this['channel'][_0x4c66('0x58')](_0x4c66('0x171'),[_0x52981f,_0x4df56b[_0x4c66('0xe9')]]);if(_0x10a574[_0x4c66('0xa5')]===-0x1){return _0x10a574;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0xc8'),'PLAYBACK',_0x52981f));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x172')]=function(_0x434649){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x173'),_0x434649['label']));if(!this['isConfigured'](_0x434649['queue_id'])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x434649,_0x4c66('0x174'));}var _0x36e711='';var _0x416c03=parseInt(_0x434649[_0x4c66('0x175')],0xa);if(isNaN(_0x416c03)){_0x36e711=_0x434649[_0x4c66('0x175')];}else{_0x36e711=this['getVoiceQueue'][_0x4c66('0xa8')](this,_0x434649[_0x4c66('0x175')]);if(!_0x36e711){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x434649,_0x4c66('0x176'));}}var _0x3224ac='';if(this[_0x4c66('0x88')](_0x434649['file_id'])){var _0x309c4e=this[_0x4c66('0x1d')][_0x4c66('0xa8')](this,_0x434649[_0x4c66('0x115')]);if(_0x309c4e){_0x3224ac=_0x309c4e;}}this['createSquareDetailsReport'][_0x4c66('0xa8')](this,_0x434649,_0x36e711);if(_0x434649['opts'][_0x4c66('0x177')]('x')<0x0){_0x434649[_0x4c66('0xe9')]+='x';}if(_0x434649[_0x4c66('0xe9')][_0x4c66('0x177')]('X')<0x0){_0x434649[_0x4c66('0xe9')]+='X';}this['channel']['setVariable'](_0x4c66('0x178'),_0x36e711?_0x36e711[_0x4c66('0x179')]():'');var _0x28754b=this[_0x4c66('0xe')]['exec'](_0x4c66('0x17a'),[_0x36e711,_0x434649[_0x4c66('0xe9')],_0x434649[_0x4c66('0x65')],_0x3224ac,_0x434649[_0x4c66('0x67')],_0x434649[_0x4c66('0x7')],_0x434649[_0x4c66('0x17b')],_0x434649[_0x4c66('0x17c')],'',_0x434649[_0x4c66('0x17d')]]);if(_0x28754b[_0x4c66('0xa5')]===-0x1){return _0x28754b;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0xc8'),_0x4c66('0x17a'),_0x36e711));};AGIVertices['prototype']['record']=function(_0x57dd52){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x17e'),_0x57dd52['label']));var _0x1c5ff0=_0x57dd52[_0x4c66('0x17f')]||'wav';var _0x17c88e=util[_0x4c66('0x2a')]('%s_%s',this[_0x4c66('0xe')][_0x4c66('0x38')],rs[_0x4c66('0x11c')](0x5));var _0x34ca1a=util['format'](_0x4c66('0x180'),FILES_PATH,_0x17c88e,_0x1c5ff0);var _0x2e521c=util['format'](_0x4c66('0x131'),FILES_PATH,_0x17c88e);this[_0x4c66('0x3d')]['sync'](this,_0x57dd52,_0x17c88e,_0x34ca1a);this[_0x4c66('0xe')][_0x4c66('0xdd')](_0x4c66('0x181'),_0x17c88e);logger['info'](_0x4c66('0x182'),_0x2e521c,_0x1c5ff0,_0x57dd52[_0x4c66('0x183')],_0x57dd52[_0x4c66('0x67')]);return this[_0x4c66('0xe')][_0x4c66('0x134')](_0x2e521c,_0x1c5ff0,_0x57dd52[_0x4c66('0x183')],_0x57dd52['timeout'],undefined,!![]);};AGIVertices[_0x4c66('0x10')]['restapi']=function(_0x56da60){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x184'),_0x56da60[_0x4c66('0x39')]));if(!this['isConfigured'](_0x56da60['url'])){return this[_0x4c66('0xe')][_0x4c66('0xaf')]('no\x20url\x20configured');}var _0x34e8a8=this['restAPI'][_0x4c66('0xa8')](this,_0x56da60);logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x185'),util[_0x4c66('0x186')](_0x34e8a8,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x56da60['variable_id'])){return this[_0x4c66('0xe')]['noop'](_0x4c66('0x187'));}var _0x447c85=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x56da60[_0x4c66('0xd8')]);if(!_0x447c85){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x56da60,'no\x20variable\x20found');}this[_0x4c66('0xe')][_0x4c66('0xdd')](util[_0x4c66('0x2a')](_0x4c66('0x188'),_0x447c85),_0x34e8a8[_0x4c66('0x76')]?_0x34e8a8[_0x4c66('0x76')]:_0x4c66('0x189'));this[_0x4c66('0xe')]['setVariable'](util[_0x4c66('0x2a')]('%s_STATUS_MESSAGE',_0x447c85),_0x34e8a8['statusMessage']?_0x34e8a8[_0x4c66('0x77')]:'OK');if(_0x34e8a8[_0x4c66('0x6c')]){try{this[_0x4c66('0x9f')](_0x34e8a8[_0x4c66('0x6c')],_0x447c85);}catch(_0x5bddc2){logger[_0x4c66('0x32')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x447c85));}}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util['format'](_0x4c66('0xe0'),_0x447c85));};AGIVertices['prototype'][_0x4c66('0x18a')]=function(_0x54eac0){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x18b'),_0x54eac0[_0x4c66('0x39')]));return this['channel'][_0x4c66('0x18c')](_0x54eac0[_0x4c66('0x18d')][_0x4c66('0x5a')](/\s+/g,''),_0x54eac0[_0x4c66('0x183')]);};AGIVertices['prototype'][_0x4c66('0x18e')]=function(_0xeb9835){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x18f'),_0xeb9835[_0x4c66('0x39')]));return this[_0x4c66('0xe')][_0x4c66('0x190')](_0xeb9835[_0x4c66('0x191')][_0x4c66('0x5a')](/\s+/g,''),_0xeb9835[_0x4c66('0x183')]);};AGIVertices[_0x4c66('0x10')][_0x4c66('0x192')]=function(_0xb9fbdc){logger['info'](util['format'](_0x4c66('0x193'),_0xb9fbdc[_0x4c66('0x39')]));return this[_0x4c66('0xe')][_0x4c66('0x194')](_0xb9fbdc[_0x4c66('0x5d')],_0xb9fbdc[_0x4c66('0x183')]);};AGIVertices['prototype']['sendMail']=function(_0xb2a08a){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x195'),_0xb2a08a['label']));if(!this[_0x4c66('0x88')](_0xb2a08a[_0x4c66('0x196')])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0x197'));}var _0x210762=this[_0x4c66('0x21')][_0x4c66('0xa8')](this,_0xb2a08a[_0x4c66('0x196')]);if(!_0x210762||!_0x210762['Smtp']){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0xb2a08a,'no\x20mail\x20account\x20found');}var _0x5f4854={'from':util[_0x4c66('0x2a')](_0x4c66('0x198'),_0x210762[_0x4c66('0x17')],_0x210762[_0x4c66('0x199')]||_0x210762['Smtp']['user']),'to':_0xb2a08a['to']||'','cc':_0xb2a08a['cc']||'','bcc':_0xb2a08a[_0x4c66('0x19a')]||'','subject':_0xb2a08a['subject'],'html':_0xb2a08a['text'],'text':_0xb2a08a[_0x4c66('0x5d')]};if(this[_0x4c66('0x88')](_0xb2a08a['template_id'])){}logger[_0x4c66('0xe2')](_0x4c66('0x19b'),JSON[_0x4c66('0x74')](_0x5f4854));this[_0x4c66('0x37')]['sync'](this,_0xb2a08a,_0xb2a08a[_0x4c66('0x196')]);this['channel']['noop'](util['format'](_0x4c66('0x19c'),_0x210762[_0x4c66('0x17')]));this[_0x4c66('0x23')][_0x4c66('0xa8')](this,_0x210762[_0x4c66('0x19d')],_0x5f4854);return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x19e'));};AGIVertices['prototype'][_0x4c66('0x19f')]=function(_0x4e76fb){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1a0'),_0x4e76fb['label']));return this['channel'][_0x4c66('0xaf')](_0x4c66('0x1a1'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1a2')]=function(_0x50832a){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x50832a[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x50832a['sms_account_id'])){return this[_0x4c66('0xe')]['noop'](_0x4c66('0x1a3'));}var _0xf28dc7=this[_0x4c66('0x34')][_0x4c66('0xa8')](this,_0x50832a[_0x4c66('0x1a4')]);if(!_0xf28dc7){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x50832a,_0x4c66('0x1a5'));}var _0x420098={'body':_0x50832a[_0x4c66('0x1a6')],'phone':_0x50832a['to']||'','SmsAccountId':_0xf28dc7['id']};logger[_0x4c66('0xe2')](_0x4c66('0x1a7'),JSON[_0x4c66('0x74')](_0x420098));this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x50832a,_0x50832a['sms_account_id']);this[_0x4c66('0xe')]['noop'](util['format'](_0x4c66('0x1a8'),_0xf28dc7[_0x4c66('0x17')]));this[_0x4c66('0x36')][_0x4c66('0xa8')](this,_0x420098);return this[_0x4c66('0xe')][_0x4c66('0xaf')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x22c526){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x22c526[_0x4c66('0x39')]));if(!this[_0x4c66('0x88')](_0x22c526[_0x4c66('0xd8')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x22c526,_0x4c66('0x1a9'));}var _0x35ae33=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x22c526[_0x4c66('0xd8')]);if(!_0x35ae33){return this[_0x4c66('0xe')]['error'](_0x22c526,'no\x20variable\x20found');}return this['channel'][_0x4c66('0xdd')](_0x35ae33,_0x22c526[_0x4c66('0x1aa')]);};AGIVertices[_0x4c66('0x10')]['start']=function(_0x2f5102){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1ab'),_0x2f5102[_0x4c66('0x39')]));this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x1ac'));if(_0x2f5102['answer']===_0x4c66('0x1ad')){this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x1ae'));return this[_0x4c66('0xe')][_0x4c66('0xbe')]();}return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0x1af'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1b0')]=function(_0x27bd89){logger['info'](util[_0x4c66('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x27bd89['label']));if(!this[_0x4c66('0x88')](_0x27bd89['project_id'])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x27bd89,'no\x20subproject\x20selected');}var _0x12f24f=this[_0x4c66('0x19')][_0x4c66('0xa8')](this,_0x27bd89[_0x4c66('0x1b1')]);if(!this['isConfigured'](_0x12f24f)){return this['channel'][_0x4c66('0x32')](_0x27bd89,util[_0x4c66('0x2a')](_0x4c66('0x1b2'),_0x27bd89[_0x4c66('0x1b1')]));}if(_0x12f24f===this[_0x4c66('0xe')]['arg_1']){return this['channel'][_0x4c66('0x32')](_0x27bd89,_0x4c66('0x1b3'));}this[_0x4c66('0x37')][_0x4c66('0xa8')](this,_0x27bd89,_0x12f24f);var _0x4ee349=this[_0x4c66('0xe')][_0x4c66('0x58')](_0x4c66('0x1b4'),util[_0x4c66('0x2a')](_0x4c66('0x1b5'),config[_0x4c66('0x7')][_0x4c66('0x1b6')]||'127.0.0.1',_0x12f24f,this[_0x4c66('0xe')][_0x4c66('0x3b')]));if(_0x4ee349[_0x4c66('0xa5')]===-0x1){return _0x4ee349;}return this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Executed\x20command\x20%s\x20%s','AGI',_0x12f24f));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1b7')]=function(_0x8a7ab9){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1b8'),_0x8a7ab9['label']));var _0x21499d=this['shellCommand'][_0x4c66('0xa8')](this,_0x8a7ab9[_0x4c66('0xb9')]);this[_0x4c66('0x37')]['sync'](this,_0x8a7ab9,_0x8a7ab9['command']);if(this['isConfigured'](_0x8a7ab9[_0x4c66('0xd8')])){var _0x198f45=this['getVariable'][_0x4c66('0xa8')](this,_0x8a7ab9[_0x4c66('0xd8')]);if(_0x198f45){this[_0x4c66('0xe')][_0x4c66('0xdd')](_0x198f45,_0x21499d);return this['channel'][_0x4c66('0xaf')](util['format'](_0x4c66('0x1b9'),_0x8a7ab9[_0x4c66('0xb9')],_0x198f45));}}return this['channel']['noop'](util[_0x4c66('0x2a')](_0x4c66('0x1ba'),_0x8a7ab9[_0x4c66('0xb9')]));};AGIVertices['prototype'][_0x4c66('0x1bb')]=function(_0x1a97fd){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1bc'),_0x1a97fd[_0x4c66('0x39')]));_0x1a97fd[_0x4c66('0x5d')]=_0x1a97fd[_0x4c66('0x5d')][_0x4c66('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4c66('0x88')](_0x1a97fd[_0x4c66('0x5c')])){return this['channel']['noop'](_0x4c66('0x1bd'));}if(!this[_0x4c66('0x88')](_0x1a97fd[_0x4c66('0x5d')])){return this['channel'][_0x4c66('0xaf')](_0x4c66('0xab'));}this[_0x4c66('0xe')]['noop'](util[_0x4c66('0x2a')](_0x4c66('0x1be'),_0x1a97fd['text']));var _0x4f404b=this[_0x4c66('0x5b')][_0x4c66('0xa8')](this,_0x1a97fd);if(_0x4f404b){this['channel'][_0x4c66('0xaf')](util['format'](_0x4c66('0x1bf'),_0x4f404b));var _0x37ce18=this[_0x4c66('0xe')]['streamFile'](_0x4f404b);try{fs[_0x4c66('0x156')](_0x4f404b+_0x4c66('0x108'));}catch(_0x3bb4d2){logger[_0x4c66('0x32')](_0x3bb4d2);}return _0x37ce18;}return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x1a97fd,_0x4c66('0x1c0'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1c1')]=function(_0x3605d2){logger[_0x4c66('0x2f')](util['format'](_0x4c66('0x1c2'),_0x3605d2[_0x4c66('0x39')]));_0x3605d2[_0x4c66('0x5d')]=_0x3605d2[_0x4c66('0x5d')][_0x4c66('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4c66('0x88')](_0x3605d2[_0x4c66('0x5d')])){return this[_0x4c66('0xe')][_0x4c66('0xaf')](_0x4c66('0xab'));}this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('Trying\x20Google\x20TTS\x20%s',_0x3605d2[_0x4c66('0x5d')]));var _0x3dbfe7=this[_0x4c66('0x62')]['sync'](this,_0x3605d2);if(_0x3dbfe7){this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x1c3'),_0x3dbfe7));var _0x283ed5=this[_0x4c66('0xe')][_0x4c66('0x128')](_0x3dbfe7);try{fs[_0x4c66('0x156')](_0x3dbfe7+'.wav');}catch(_0x3debe0){logger[_0x4c66('0x32')](_0x3debe0);}return _0x283ed5;}return this['channel']['error'](_0x3605d2,_0x4c66('0x1c4'));};AGIVertices[_0x4c66('0x10')][_0x4c66('0x1c5')]=function(_0x269876){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1c6'),_0x269876['label']));if(!this[_0x4c66('0x88')](_0x269876[_0x4c66('0x15a')])){return this[_0x4c66('0xe')][_0x4c66('0x32')](_0x269876,_0x4c66('0x15b'));}logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x15c'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x269876[_0x4c66('0x15a')]));var _0x12aa2f=this[_0x4c66('0x52')][_0x4c66('0xa8')](this,_0x269876[_0x4c66('0x15a')]);if(_0x12aa2f){logger['info'](util[_0x4c66('0x2a')](_0x4c66('0x15d'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x269876['findBy']));this['channel'][_0x4c66('0xaf')](util[_0x4c66('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x269876[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x15e')};}else{logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this[_0x4c66('0xe')][_0x4c66('0x3c')],_0x269876[_0x4c66('0x15a')]));this[_0x4c66('0xe')][_0x4c66('0xaf')](util[_0x4c66('0x2a')](_0x4c66('0x15f'),this['channel'][_0x4c66('0x3c')],_0x269876[_0x4c66('0x15a')]));return{'code':0xc8,'result':_0x4c66('0x160')};}};AGIVertices[_0x4c66('0x10')]['voicemail']=function(_0x30a6d1){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x30a6d1[_0x4c66('0x39')]));var _0x2f4cf8=this[_0x4c66('0xe')][_0x4c66('0x58')](_0x4c66('0x1c7'),[_0x30a6d1[_0x4c66('0x1c8')],_0x30a6d1[_0x4c66('0x7a')]]);if(_0x2f4cf8[_0x4c66('0xa5')]===-0x1){return _0x2f4cf8;}return this['channel']['noop'](util[_0x4c66('0x2a')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x30a6d1[_0x4c66('0x1c8')]));};AGIVertices['prototype'][_0x4c66('0x1c9')]=function(_0x1ae05b){logger[_0x4c66('0x2f')](util[_0x4c66('0x2a')](_0x4c66('0x1ca'),_0x1ae05b[_0x4c66('0x39')]));if(!this['isConfigured'](_0x1ae05b[_0x4c66('0xd8')])){return this['channel'][_0x4c66('0x32')](_0x1ae05b,_0x4c66('0x1a9'));}var _0x56a0f2=this[_0x4c66('0x11')][_0x4c66('0xa8')](this,_0x1ae05b[_0x4c66('0xd8')]);if(!_0x56a0f2){return this['channel'][_0x4c66('0x32')](_0x1ae05b,'no\x20variable\x20found');}var _0x27a5c8=this['channel'][_0x4c66('0x11')](_0x56a0f2);return{'code':0xc8,'result':_0x27a5c8[_0x4c66('0xa3')]?_0x27a5c8[_0x4c66('0xa3')]:'-'};};String['prototype'][_0x4c66('0xa2')]=function(_0xad9679,_0x248822){return this[_0x4c66('0xa1')](_0xad9679)[_0x4c66('0x1cb')](_0x248822);};module[_0x4c66('0x1cc')]=AGIVertices;
\ No newline at end of file
index ff1795a..e7bb196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87bc=['syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','saveUnpause','update','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','hangup','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview'];(function(_0xf018cb,_0x189731){var _0x22997f=function(_0x4c6d60){while(--_0x4c6d60){_0xf018cb['push'](_0xf018cb['shift']());}};_0x22997f(++_0x189731);}(_0x87bc,0x8c));var _0xc87b=function(_0x21a14f,_0xcb9c26){_0x21a14f=_0x21a14f-0x0;var _0x1b1362=_0x87bc[_0x21a14f];return _0x1b1362;};'use strict';var _=require(_0xc87b('0x0'));var moment=require(_0xc87b('0x1'));var ami=require('../ami');var logger=require(_0xc87b('0x2'))(_0xc87b('0x3'));var RpcUser=require(_0xc87b('0x4'));var RpcVoiceAgentReport=require(_0xc87b('0x5'));function Acw(_0x26de7d){this['voiceQueues']=_0x26de7d[_0xc87b('0x6')];this['agents']=_0x26de7d[_0xc87b('0x7')];this[_0xc87b('0x8')]=_0x26de7d[_0xc87b('0x8')];this[_0xc87b('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xc87b('0xa')](this));ami['on'](_0xc87b('0xb'),this[_0xc87b('0xc')][_0xc87b('0xa')](this));ami['on'](_0xc87b('0xd'),this['syncHangup'][_0xc87b('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xc87b('0xa')](this));ami['on'](_0xc87b('0xe'),this[_0xc87b('0xf')][_0xc87b('0xa')](this));ami['on']('blindtransfer',this[_0xc87b('0x10')][_0xc87b('0xa')](this));ami['on'](_0xc87b('0x11'),this[_0xc87b('0x12')][_0xc87b('0xa')](this));}function getDiff(_0x1a2fa7){var _0x39c4e4=moment()[_0xc87b('0x13')](0x0);var _0x5886aa=moment(_0x1a2fa7)[_0xc87b('0x13')](0x0);return _0x39c4e4[_0xc87b('0x14')](_0x5886aa,_0xc87b('0x15'));}Acw[_0xc87b('0x16')][_0xc87b('0x17')]=function(_0x5c9b19){try{var _0x4b65a8=this;var _0x43730c=this[_0xc87b('0x9')][_0x5c9b19][_0xc87b('0x18')];var _0x334cf9=this[_0xc87b('0x9')][_0x5c9b19]['queue'];var _0x4608f8=this[_0xc87b('0x6')][_0x334cf9];var _0x37f66a=![];var _0x104185=_0xc87b('0x19');if(_0x4608f8[_0xc87b('0x1a')]){if(_0x4608f8['mandatoryDispositionPause'][_0xc87b('0x1b')]){_0x37f66a=!![];_0x104185=_0x4608f8['mandatoryDispositionPause'][_0xc87b('0x1b')];}}return ami[_0xc87b('0x1c')]({'action':_0xc87b('0x1d'),'interface':_0x43730c,'paused':!![],'reason':_0x104185})[_0xc87b('0x1e')](function(){if(_0x4b65a8['agents'][_0x43730c]){return RpcUser['getAgent'](_0x4b65a8[_0xc87b('0x7')][_0x43730c]['id'])['then'](function(_0x576519){if(_0x576519&&!_0x576519[_0xc87b('0x1f')]){logger[_0xc87b('0x20')](_0xc87b('0x21'),_0x5c9b19,_0x43730c,_0x334cf9);var _0x5e5c28=_0x4b65a8[_0xc87b('0x9')][_0x5c9b19][_0xc87b('0x22')]&&_0x4b65a8[_0xc87b('0x9')][_0x5c9b19][_0xc87b('0x23')]?_0x4b65a8[_0xc87b('0x9')][_0x5c9b19][_0xc87b('0x23')]:_0x5c9b19;return RpcUser['savePause'](_0x4b65a8['agents'][_0x43730c],_0x104185,_0x5e5c28)[_0xc87b('0x1e')](function(){if(!_0x37f66a){_0x4b65a8[_0xc87b('0x8')][_0x43730c]={};logger[_0xc87b('0x20')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5c9b19,_0x4b65a8[_0xc87b('0x6')][_0x334cf9][_0xc87b('0x24')],_0x43730c,_0x334cf9);_0x4b65a8['timers'][_0x43730c]['timer']=setTimeout(_0x4b65a8[_0xc87b('0x25')][_0xc87b('0xa')](_0x4b65a8,_0x43730c),_0x4b65a8[_0xc87b('0x6')][_0x334cf9][_0xc87b('0x24')]*0x3e8);_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x26')]=moment()[_0xc87b('0x27')](_0xc87b('0x28'));_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x29')]=_0x5c9b19;_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x2a')]=_0x334cf9;_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x2b')]=function(){var _0x45ddde=getDiff(_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x26')]);clearTimeout(_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x2c')]);_0x4b65a8[_0xc87b('0x8')][_0x43730c][_0xc87b('0x2c')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x45ddde},_0x4b65a8['timers'][_0x43730c][_0xc87b('0x29')],_0x43730c)['then'](function(_0x2a2116){logger[_0xc87b('0x20')](_0xc87b('0x2d'),_0x5c9b19,_0x45ddde,_0x2a2116);})[_0xc87b('0x2e')](function(_0x10be9e){logger[_0xc87b('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x5c9b19,_0x10be9e);});delete _0x4b65a8[_0xc87b('0x8')][_0x43730c];};}});}else{logger[_0xc87b('0x20')](_0xc87b('0x30'),_0x5c9b19,_0x43730c,_0x334cf9);}});}})[_0xc87b('0x2e')](function(){logger[_0xc87b('0x2f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5c9b19,_0x4b65a8[_0xc87b('0x6')][_0x334cf9][_0xc87b('0x24')],_0x43730c,_0x334cf9);})['finally'](function(){delete _0x4b65a8['channels'][_0x5c9b19];});}catch(_0x22ec25){logger['error'](_0xc87b('0x31'),_0x22ec25[_0xc87b('0x32')]);}};Acw['prototype'][_0xc87b('0x25')]=function(_0x124bd1){try{var _0x428a7d=this;if(_0x428a7d[_0xc87b('0x8')][_0x124bd1]){_0x428a7d[_0xc87b('0x8')][_0x124bd1][_0xc87b('0x2c')]=![];var _0x5e8412=_0x428a7d[_0xc87b('0x8')][_0x124bd1][_0xc87b('0x29')];var _0x55f022=_0x428a7d[_0xc87b('0x8')][_0x124bd1][_0xc87b('0x2a')];var _0xf6b219=_0x428a7d[_0xc87b('0x6')][_0x55f022]['acwTimeout'];logger[_0xc87b('0x20')]('[%s][TIMER][STOP][AGENT:%s]',_0x5e8412,_0x124bd1);RpcUser[_0xc87b('0x33')](this['agents'][_0x124bd1]);RpcVoiceAgentReport[_0xc87b('0x34')]({'acwtime':_0xf6b219,'agentacw':!![]},_0x5e8412,_0x124bd1)[_0xc87b('0x1e')](function(_0x3606a0){logger['info'](_0xc87b('0x2d'),_0x5e8412,_0xf6b219,_0x3606a0);})[_0xc87b('0x2e')](function(_0x3143de){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x5e8412,_0x3143de);});}else{logger[_0xc87b('0x2f')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x124bd1);if(_0x428a7d['timers']){logger['info']('[ACW][TIMERS]',JSON[_0xc87b('0x35')](_0x428a7d[_0xc87b('0x8')]));}}}catch(_0x56534e){logger[_0xc87b('0x2f')](_0xc87b('0x36'),_0x56534e[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')]['syncAgentConnect']=function(_0x5fd5ce){try{if(this['voiceQueues'][_0x5fd5ce[_0xc87b('0x2a')]]&&(this['voiceQueues'][_0x5fd5ce[_0xc87b('0x2a')]][_0xc87b('0x3')]||this[_0xc87b('0x6')][_0x5fd5ce['queue']][_0xc87b('0x1a')])){if(this[_0xc87b('0x7')][_0x5fd5ce['interface']]){this[_0xc87b('0x9')][_0x5fd5ce[_0xc87b('0x29')]]={'queue':_0x5fd5ce['queue'],'interface':_0x5fd5ce['interface'],'destlinkedid':_0x5fd5ce['destlinkedid']};}}}catch(_0x480347){logger[_0xc87b('0x2f')](_0xc87b('0x37'),_0x480347[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')][_0xc87b('0x12')]=function(_0x5a89de){try{if(this[_0xc87b('0x6')][_0x5a89de[_0xc87b('0x2a')]]&&(this[_0xc87b('0x6')][_0x5a89de[_0xc87b('0x2a')]][_0xc87b('0x3')]||this['voiceQueues'][_0x5a89de['queue']][_0xc87b('0x1a')])){if(this[_0xc87b('0x7')][_0x5a89de[_0xc87b('0x18')]]){this[_0xc87b('0x9')][_0x5a89de[_0xc87b('0x29')]]={'queue':_0x5a89de['queue'],'interface':_0x5a89de[_0xc87b('0x18')]};}}}catch(_0x92df66){logger['error'](_0xc87b('0x38'),_0x92df66[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')][_0xc87b('0xc')]=function(_0x354345){try{if(this[_0xc87b('0x9')][_0x354345[_0xc87b('0x29')]]&&_['isUndefined'](this[_0xc87b('0x9')][_0x354345[_0xc87b('0x29')]]['attended'])){logger[_0xc87b('0x20')](_0xc87b('0x39'),_0x354345[_0xc87b('0x29')]);this[_0xc87b('0x17')](_0x354345[_0xc87b('0x29')]);}else if(this['channels'][_0x354345['linkedid']]&&_['isUndefined'](this['channels'][_0x354345[_0xc87b('0x3a')]]['attended'])){logger[_0xc87b('0x20')](_0xc87b('0x3b'),_0x354345[_0xc87b('0x3a')]);this[_0xc87b('0x17')](_0x354345[_0xc87b('0x3a')]);}}catch(_0x221b4c){logger[_0xc87b('0x2f')](_0xc87b('0x3c'),_0x221b4c[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')][_0xc87b('0x3d')]=function(_0x3068e9){try{if(this[_0xc87b('0x9')][_0x3068e9[_0xc87b('0x29')]]&&this[_0xc87b('0x9')][_0x3068e9[_0xc87b('0x29')]][_0xc87b('0x22')]){logger[_0xc87b('0x20')](_0xc87b('0x3e'),_0x3068e9['uniqueid']);this[_0xc87b('0x17')](_0x3068e9[_0xc87b('0x29')]);}else if(this[_0xc87b('0x9')][_0x3068e9[_0xc87b('0x3a')]]&&this[_0xc87b('0x9')][_0x3068e9[_0xc87b('0x3a')]][_0xc87b('0x22')]){logger['info'](_0xc87b('0x3f'),_0x3068e9['linkedid']);this[_0xc87b('0x17')](_0x3068e9[_0xc87b('0x3a')]);}}catch(_0x14e986){logger[_0xc87b('0x2f')](_0xc87b('0x40'),_0x14e986[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')][_0xc87b('0xf')]=function(_0x58518b){try{if(!_[_0xc87b('0x41')](this['channels'][_0x58518b[_0xc87b('0x42')]])){this[_0xc87b('0x17')](_0x58518b[_0xc87b('0x42')]);if(this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x43')]]){this[_0xc87b('0x9')][_0x58518b['secondtransfereruniqueid']][_0xc87b('0x22')]=!![];this['channels'][_0x58518b['transfertargetuniqueid']]=this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x43')]];delete this[_0xc87b('0x9')][_0x58518b['secondtransfereruniqueid']];}}else if(!_[_0xc87b('0x41')](this['channels'][_0x58518b['transfertargetuniqueid']])){this[_0xc87b('0x17')](_0x58518b[_0xc87b('0x44')]);if(this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x45')]]){this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x45')]][_0xc87b('0x22')]=!![];this[_0xc87b('0x9')][_0x58518b['transfereeuniqueid']]=this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x45')]];delete this[_0xc87b('0x9')][_0x58518b[_0xc87b('0x45')]];}}}catch(_0x75bbef){logger['error'](_0xc87b('0x46'),_0x75bbef['message']);}};Acw['prototype'][_0xc87b('0x10')]=function(_0x47e68d){try{if(this[_0xc87b('0x9')][_0x47e68d[_0xc87b('0x47')]]){logger['info'](_0xc87b('0x48'),JSON[_0xc87b('0x35')](_0x47e68d['transfereruniqueid']));this[_0xc87b('0x17')](_0x47e68d[_0xc87b('0x47')]);}else if(this[_0xc87b('0x9')][_0x47e68d['transfererlinkedid']]){logger[_0xc87b('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xc87b('0x35')](_0x47e68d[_0xc87b('0x49')]));this[_0xc87b('0x17')](_0x47e68d[_0xc87b('0x49')]);}}catch(_0x149cd7){logger['error'](_0xc87b('0x4a'),_0x149cd7[_0xc87b('0x32')]);}};Acw[_0xc87b('0x16')]['syncAgentRingNoAnswer']=function(_0x3ac6a6){try{if(this['voiceQueues'][_0x3ac6a6[_0xc87b('0x2a')]]&&this[_0xc87b('0x6')][_0x3ac6a6[_0xc87b('0x2a')]][_0xc87b('0x4b')]==='all'){if(this['agents'][_0x3ac6a6['interface']]){logger['info'](_0xc87b('0x4c'),_0x3ac6a6['uniqueid'],_0x3ac6a6[_0xc87b('0x18')],_0x3ac6a6[_0xc87b('0x2a')]);return RpcUser['savePause'](this['agents'][_0x3ac6a6[_0xc87b('0x18')]],'Auto-Pause',_0x3ac6a6[_0xc87b('0x29')]);}}}catch(_0x53fc17){logger[_0xc87b('0x2f')](_0xc87b('0x4d'),_0x53fc17[_0xc87b('0x32')]);}};module[_0xc87b('0x4e')]=Acw;
\ No newline at end of file
+var _0x6aa9=['mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncHangupRequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDispositionPause','name','Action','QueuePause','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','then','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect'];(function(_0x468c23,_0x256ae4){var _0x27a291=function(_0x1e0e75){while(--_0x1e0e75){_0x468c23['push'](_0x468c23['shift']());}};_0x27a291(++_0x256ae4);}(_0x6aa9,0x6f));var _0x96aa=function(_0x59dfa9,_0x54d7e0){_0x59dfa9=_0x59dfa9-0x0;var _0x2fe379=_0x6aa9[_0x59dfa9];return _0x2fe379;};'use strict';var _=require(_0x96aa('0x0'));var moment=require(_0x96aa('0x1'));var ami=require(_0x96aa('0x2'));var logger=require(_0x96aa('0x3'))(_0x96aa('0x4'));var RpcUser=require(_0x96aa('0x5'));var RpcVoiceAgentReport=require(_0x96aa('0x6'));function Acw(_0x3bfc9c){this[_0x96aa('0x7')]=_0x3bfc9c[_0x96aa('0x7')];this[_0x96aa('0x8')]=_0x3bfc9c['agents'];this[_0x96aa('0x9')]=_0x3bfc9c[_0x96aa('0x9')];this[_0x96aa('0xa')]={};ami['on'](_0x96aa('0xb'),this['syncAgentConnect']['bind'](this));ami['on']('hanguprequest',this[_0x96aa('0xc')][_0x96aa('0xd')](this));ami['on'](_0x96aa('0xe'),this['syncHangup'][_0x96aa('0xd')](this));ami['on'](_0x96aa('0xf'),this[_0x96aa('0x10')][_0x96aa('0xd')](this));ami['on'](_0x96aa('0x11'),this[_0x96aa('0x12')][_0x96aa('0xd')](this));ami['on']('blindtransfer',this[_0x96aa('0x13')][_0x96aa('0xd')](this));ami['on'](_0x96aa('0x14'),this[_0x96aa('0x15')]['bind'](this));}function getDiff(_0x587cde){var _0x25b3c0=moment()[_0x96aa('0x16')](0x0);var _0x510c18=moment(_0x587cde)['milliseconds'](0x0);return _0x25b3c0[_0x96aa('0x17')](_0x510c18,_0x96aa('0x18'));}Acw[_0x96aa('0x19')][_0x96aa('0x1a')]=function(_0x3ad476){try{var _0x1f2d5d=this;var _0x37fd66=this[_0x96aa('0xa')][_0x3ad476][_0x96aa('0x1b')];var _0x2e590d=this[_0x96aa('0xa')][_0x3ad476][_0x96aa('0x1c')];var _0x4d7abd=this[_0x96aa('0x7')][_0x2e590d];var _0x2ed383=![];var _0x11091d='ACW';if(_0x4d7abd['mandatoryDisposition']){if(_0x4d7abd[_0x96aa('0x1d')][_0x96aa('0x1e')]){_0x2ed383=!![];_0x11091d=_0x4d7abd[_0x96aa('0x1d')][_0x96aa('0x1e')];}}return ami[_0x96aa('0x1f')]({'action':_0x96aa('0x20'),'interface':_0x37fd66,'paused':!![],'reason':_0x11091d})['then'](function(){if(_0x1f2d5d[_0x96aa('0x8')][_0x37fd66]){return RpcUser['getAgent'](_0x1f2d5d['agents'][_0x37fd66]['id'])['then'](function(_0x1dc669){if(_0x1dc669&&!_0x1dc669[_0x96aa('0x21')]){logger['info'](_0x96aa('0x22'),_0x3ad476,_0x37fd66,_0x2e590d);var _0x537129=_0x1f2d5d[_0x96aa('0xa')][_0x3ad476][_0x96aa('0x23')]&&_0x1f2d5d[_0x96aa('0xa')][_0x3ad476][_0x96aa('0x24')]?_0x1f2d5d[_0x96aa('0xa')][_0x3ad476][_0x96aa('0x24')]:_0x3ad476;return RpcUser[_0x96aa('0x25')](_0x1f2d5d[_0x96aa('0x8')][_0x37fd66],_0x11091d,_0x537129)['then'](function(){if(!_0x2ed383){_0x1f2d5d[_0x96aa('0x9')][_0x37fd66]={};logger[_0x96aa('0x26')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3ad476,_0x1f2d5d[_0x96aa('0x7')][_0x2e590d][_0x96aa('0x27')],_0x37fd66,_0x2e590d);_0x1f2d5d['timers'][_0x37fd66][_0x96aa('0x28')]=setTimeout(_0x1f2d5d[_0x96aa('0x29')]['bind'](_0x1f2d5d,_0x37fd66),_0x1f2d5d[_0x96aa('0x7')][_0x2e590d][_0x96aa('0x27')]*0x3e8);_0x1f2d5d['timers'][_0x37fd66]['lastPauseAt']=moment()[_0x96aa('0x2a')](_0x96aa('0x2b'));_0x1f2d5d[_0x96aa('0x9')][_0x37fd66][_0x96aa('0x2c')]=_0x3ad476;_0x1f2d5d[_0x96aa('0x9')][_0x37fd66]['queue']=_0x2e590d;_0x1f2d5d['timers'][_0x37fd66][_0x96aa('0x2d')]=function(){var _0x5e74a3=getDiff(_0x1f2d5d[_0x96aa('0x9')][_0x37fd66][_0x96aa('0x2e')]);clearTimeout(_0x1f2d5d[_0x96aa('0x9')][_0x37fd66]['timer']);_0x1f2d5d[_0x96aa('0x9')][_0x37fd66][_0x96aa('0x28')]=![];RpcVoiceAgentReport[_0x96aa('0x2f')]({'acwtime':_0x5e74a3},_0x1f2d5d[_0x96aa('0x9')][_0x37fd66][_0x96aa('0x2c')],_0x37fd66)['then'](function(_0x528e2e){logger[_0x96aa('0x26')](_0x96aa('0x30'),_0x3ad476,_0x5e74a3,_0x528e2e);})[_0x96aa('0x31')](function(_0x3941b5){logger[_0x96aa('0x32')](_0x96aa('0x33'),_0x3ad476,_0x3941b5);});delete _0x1f2d5d[_0x96aa('0x9')][_0x37fd66];};}});}else{logger[_0x96aa('0x26')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x3ad476,_0x37fd66,_0x2e590d);}});}})['catch'](function(){logger[_0x96aa('0x32')](_0x96aa('0x34'),_0x3ad476,_0x1f2d5d[_0x96aa('0x7')][_0x2e590d][_0x96aa('0x27')],_0x37fd66,_0x2e590d);})[_0x96aa('0x35')](function(){delete _0x1f2d5d[_0x96aa('0xa')][_0x3ad476];});}catch(_0x134e76){logger[_0x96aa('0x32')](_0x96aa('0x36'),_0x134e76[_0x96aa('0x37')]);}};Acw[_0x96aa('0x19')][_0x96aa('0x29')]=function(_0x3c1a57){try{var _0x2a906a=this;if(_0x2a906a[_0x96aa('0x9')][_0x3c1a57]){_0x2a906a[_0x96aa('0x9')][_0x3c1a57]['timer']=![];var _0x344125=_0x2a906a['timers'][_0x3c1a57][_0x96aa('0x2c')];var _0x5217f7=_0x2a906a[_0x96aa('0x9')][_0x3c1a57][_0x96aa('0x1c')];var _0x97036b=_0x2a906a[_0x96aa('0x7')][_0x5217f7][_0x96aa('0x27')];logger['info'](_0x96aa('0x38'),_0x344125,_0x3c1a57);RpcUser['saveUnpause'](this[_0x96aa('0x8')][_0x3c1a57]);RpcVoiceAgentReport[_0x96aa('0x2f')]({'acwtime':_0x97036b,'agentacw':!![]},_0x344125,_0x3c1a57)[_0x96aa('0x39')](function(_0x22c682){logger['info'](_0x96aa('0x30'),_0x344125,_0x97036b,_0x22c682);})[_0x96aa('0x31')](function(_0x5b0a0d){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x344125,_0x5b0a0d);});}else{logger['error'](_0x96aa('0x3a'),_0x3c1a57);if(_0x2a906a[_0x96aa('0x9')]){logger[_0x96aa('0x26')](_0x96aa('0x3b'),JSON[_0x96aa('0x3c')](_0x2a906a[_0x96aa('0x9')]));}}}catch(_0x57bfea){logger[_0x96aa('0x32')](_0x96aa('0x3d'),_0x57bfea[_0x96aa('0x37')]);}};Acw[_0x96aa('0x19')][_0x96aa('0x3e')]=function(_0x543f1b){try{if(this[_0x96aa('0x7')][_0x543f1b['queue']]&&(this[_0x96aa('0x7')][_0x543f1b[_0x96aa('0x1c')]]['acw']||this[_0x96aa('0x7')][_0x543f1b[_0x96aa('0x1c')]][_0x96aa('0x3f')])){if(this[_0x96aa('0x8')][_0x543f1b[_0x96aa('0x1b')]]){this[_0x96aa('0xa')][_0x543f1b[_0x96aa('0x2c')]]={'queue':_0x543f1b[_0x96aa('0x1c')],'interface':_0x543f1b[_0x96aa('0x1b')],'destlinkedid':_0x543f1b['destlinkedid']};}}}catch(_0x22f7fd){logger['error'](_0x96aa('0x40'),_0x22f7fd[_0x96aa('0x37')]);}};Acw['prototype'][_0x96aa('0x15')]=function(_0x1a7008){try{if(this[_0x96aa('0x7')][_0x1a7008['queue']]&&(this['voiceQueues'][_0x1a7008['queue']][_0x96aa('0x4')]||this[_0x96aa('0x7')][_0x1a7008['queue']][_0x96aa('0x3f')])){if(this[_0x96aa('0x8')][_0x1a7008[_0x96aa('0x1b')]]){this[_0x96aa('0xa')][_0x1a7008[_0x96aa('0x2c')]]={'queue':_0x1a7008[_0x96aa('0x1c')],'interface':_0x1a7008[_0x96aa('0x1b')]};}}}catch(_0x3aeee6){logger[_0x96aa('0x32')](_0x96aa('0x41'),_0x3aeee6[_0x96aa('0x37')]);}};Acw['prototype'][_0x96aa('0xc')]=function(_0x13f931){try{if(this['channels'][_0x13f931[_0x96aa('0x2c')]]&&_[_0x96aa('0x42')](this[_0x96aa('0xa')][_0x13f931[_0x96aa('0x2c')]]['attended'])){logger['info'](_0x96aa('0x43'),_0x13f931[_0x96aa('0x2c')]);this[_0x96aa('0x1a')](_0x13f931[_0x96aa('0x2c')]);}else if(this['channels'][_0x13f931[_0x96aa('0x44')]]&&_[_0x96aa('0x42')](this[_0x96aa('0xa')][_0x13f931[_0x96aa('0x44')]][_0x96aa('0x23')])){logger[_0x96aa('0x26')]('[%s][HANGUP:LINKEDID]',_0x13f931[_0x96aa('0x44')]);this['startAcw'](_0x13f931['linkedid']);}}catch(_0x5f39f3){logger[_0x96aa('0x32')](_0x96aa('0x45'),_0x5f39f3[_0x96aa('0x37')]);}};Acw['prototype'][_0x96aa('0x46')]=function(_0x3074ff){try{if(this[_0x96aa('0xa')][_0x3074ff['uniqueid']]&&this[_0x96aa('0xa')][_0x3074ff['uniqueid']][_0x96aa('0x23')]){logger[_0x96aa('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3074ff[_0x96aa('0x2c')]);this['startAcw'](_0x3074ff[_0x96aa('0x2c')]);}else if(this[_0x96aa('0xa')][_0x3074ff[_0x96aa('0x44')]]&&this[_0x96aa('0xa')][_0x3074ff[_0x96aa('0x44')]][_0x96aa('0x23')]){logger[_0x96aa('0x26')](_0x96aa('0x47'),_0x3074ff[_0x96aa('0x44')]);this['startAcw'](_0x3074ff[_0x96aa('0x44')]);}}catch(_0x2e32c0){logger[_0x96aa('0x32')]('[ACW][syncHangup]\x20%s',_0x2e32c0[_0x96aa('0x37')]);}};Acw['prototype'][_0x96aa('0x12')]=function(_0x409a73){try{if(!_['isNil'](this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x48')]])){this['startAcw'](_0x409a73[_0x96aa('0x48')]);if(this[_0x96aa('0xa')][_0x409a73['secondtransfereruniqueid']]){this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x49')]]['attended']=!![];this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x4a')]]=this['channels'][_0x409a73[_0x96aa('0x49')]];delete this[_0x96aa('0xa')][_0x409a73['secondtransfereruniqueid']];}}else if(!_[_0x96aa('0x4b')](this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x4a')]])){this[_0x96aa('0x1a')](_0x409a73[_0x96aa('0x4a')]);if(this['channels'][_0x409a73[_0x96aa('0x4c')]]){this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x4c')]][_0x96aa('0x23')]=!![];this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x48')]]=this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x4c')]];delete this[_0x96aa('0xa')][_0x409a73[_0x96aa('0x4c')]];}}}catch(_0x32e267){logger[_0x96aa('0x32')](_0x96aa('0x4d'),_0x32e267[_0x96aa('0x37')]);}};Acw[_0x96aa('0x19')][_0x96aa('0x13')]=function(_0x344d46){try{if(this[_0x96aa('0xa')][_0x344d46[_0x96aa('0x4e')]]){logger[_0x96aa('0x26')](_0x96aa('0x4f'),JSON[_0x96aa('0x3c')](_0x344d46[_0x96aa('0x4e')]));this[_0x96aa('0x1a')](_0x344d46[_0x96aa('0x4e')]);}else if(this[_0x96aa('0xa')][_0x344d46[_0x96aa('0x50')]]){logger[_0x96aa('0x26')](_0x96aa('0x51'),JSON[_0x96aa('0x3c')](_0x344d46[_0x96aa('0x50')]));this[_0x96aa('0x1a')](_0x344d46[_0x96aa('0x50')]);}}catch(_0x22b042){logger[_0x96aa('0x32')]('[ACW][syncBlindTransfer]\x20%s',_0x22b042['message']);}};Acw[_0x96aa('0x19')][_0x96aa('0x10')]=function(_0x34d3d8){try{if(this['voiceQueues'][_0x34d3d8[_0x96aa('0x1c')]]&&this[_0x96aa('0x7')][_0x34d3d8['queue']][_0x96aa('0x52')]===_0x96aa('0x53')){if(this[_0x96aa('0x8')][_0x34d3d8[_0x96aa('0x1b')]]){logger[_0x96aa('0x26')](_0x96aa('0x54'),_0x34d3d8['uniqueid'],_0x34d3d8[_0x96aa('0x1b')],_0x34d3d8[_0x96aa('0x1c')]);return RpcUser[_0x96aa('0x25')](this[_0x96aa('0x8')][_0x34d3d8['interface']],'Auto-Pause',_0x34d3d8['uniqueid']);}}}catch(_0x8d5db4){logger[_0x96aa('0x32')](_0x96aa('0x55'),_0x8d5db4['message']);}};module[_0x96aa('0x56')]=Acw;
\ No newline at end of file
index be04760..65cdcea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf731=['util','../../config/logger','../../config/environment','asterisk','username','password','keepConnected','promisify','error','format','port','inspect','actionSipShowRegistry','Action','actionDeviceStateList','sippeerstatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird'];(function(_0x41fdb8,_0x3559bb){var _0x4ca617=function(_0x3bd6cb){while(--_0x3bd6cb){_0x41fdb8['push'](_0x41fdb8['shift']());}};_0x4ca617(++_0x3559bb);}(_0xf731,0x67));var _0x1f73=function(_0x57eb23,_0x203eec){_0x57eb23=_0x57eb23-0x0;var _0xdc4d=_0xf731[_0x57eb23];return _0xdc4d;};'use strict';var Manager=require(_0x1f73('0x0'));var BPromise=require(_0x1f73('0x1'));var util=require(_0x1f73('0x2'));var logger=require(_0x1f73('0x3'))('ami');var config=require(_0x1f73('0x4'));var ami=new Manager(config[_0x1f73('0x5')]['port'],config[_0x1f73('0x5')]['ip'],config[_0x1f73('0x5')][_0x1f73('0x6')],config['asterisk'][_0x1f73('0x7')],!![]);ami[_0x1f73('0x8')]();ami['Action']=BPromise[_0x1f73('0x9')](ami['action']);function error(_0x43934b){logger[_0x1f73('0xa')](util[_0x1f73('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1f73('0x5')][_0x1f73('0x6')],config[_0x1f73('0x5')]['ip'],config[_0x1f73('0x5')][_0x1f73('0xc')],util[_0x1f73('0xd')](_0x43934b,![],null)));}function close(){logger[_0x1f73('0xa')](util[_0x1f73('0xb')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x1f73('0x5')]['username'],config[_0x1f73('0x5')]['ip'],config['asterisk'][_0x1f73('0xc')]));}ami[_0x1f73('0xe')]=function(){return function(){return ami[_0x1f73('0xf')]({'action':'sipshowregistry'});};};ami[_0x1f73('0x10')]=function(){return function(){return ami[_0x1f73('0xf')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x1f73('0xf')]({'action':_0x1f73('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x1f73('0x12')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x1f73('0xf')]({'action':_0x1f73('0x13')});};};function connect(){logger[_0x1f73('0x14')](util[_0x1f73('0xb')](_0x1f73('0x15'),config['asterisk'][_0x1f73('0x6')],config[_0x1f73('0x5')]['ip'],config['asterisk']['port']));ami[_0x1f73('0x16')](_0x1f73('0xa'),error);ami['once'](_0x1f73('0x17'),close);}ami['on'](_0x1f73('0x18'),connect);ami['on'](_0x1f73('0x19'),function(_0x27bb5e){logger[_0x1f73('0x14')](util['format'](_0x1f73('0x1a'),config['asterisk'][_0x1f73('0x6')],config[_0x1f73('0x5')]['ip'],config[_0x1f73('0x5')]['port'],util[_0x1f73('0xd')](_0x27bb5e,![],null)));});ami['on'](_0x1f73('0x1b'),function(){logger[_0x1f73('0x14')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0x1f73('0x6')],config[_0x1f73('0x5')]['ip'],config[_0x1f73('0x5')]['port']));return Promise['resolve']()[_0x1f73('0x1c')](ami['actionSipShowRegistry']())[_0x1f73('0x1c')](ami['actionDeviceStateList']())[_0x1f73('0x1c')](ami[_0x1f73('0x1d')]())[_0x1f73('0x1c')](ami[_0x1f73('0x1e')]())['then'](ami[_0x1f73('0x1f')]())[_0x1f73('0x20')](function(_0x43d5f5){logger[_0x1f73('0xa')](_0x1f73('0x21'),util[_0x1f73('0xd')](_0x43d5f5,{'showHidden':![],'depth':null}));});});ami[_0x1f73('0x16')](_0x1f73('0xa'),error);ami['once']('close',close);module[_0x1f73('0x22')]=ami;
\ No newline at end of file
+var _0xf808=['asterisk','password','Action','format','port','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger'];(function(_0x5af27f,_0x53b125){var _0x5bfab1=function(_0x3984bf){while(--_0x3984bf){_0x5af27f['push'](_0x5af27f['shift']());}};_0x5bfab1(++_0x53b125);}(_0xf808,0x11c));var _0x8f80=function(_0x5d00ff,_0x4fa675){_0x5d00ff=_0x5d00ff-0x0;var _0x4bf092=_0xf808[_0x5d00ff];return _0x4bf092;};'use strict';var Manager=require(_0x8f80('0x0'));var BPromise=require(_0x8f80('0x1'));var util=require(_0x8f80('0x2'));var logger=require(_0x8f80('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk']['port'],config[_0x8f80('0x4')]['ip'],config['asterisk']['username'],config[_0x8f80('0x4')][_0x8f80('0x5')],!![]);ami['keepConnected']();ami[_0x8f80('0x6')]=BPromise['promisify'](ami['action']);function error(_0x22d118){logger['error'](util[_0x8f80('0x7')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x8f80('0x4')]['username'],config['asterisk']['ip'],config['asterisk'][_0x8f80('0x8')],util['inspect'](_0x22d118,![],null)));}function close(){logger[_0x8f80('0x9')](util[_0x8f80('0x7')](_0x8f80('0xa'),config[_0x8f80('0x4')][_0x8f80('0xb')],config[_0x8f80('0x4')]['ip'],config[_0x8f80('0x4')]['port']));}ami[_0x8f80('0xc')]=function(){return function(){return ami[_0x8f80('0x6')]({'action':_0x8f80('0xd')});};};ami[_0x8f80('0xe')]=function(){return function(){return ami[_0x8f80('0x6')]({'action':_0x8f80('0xf')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x8f80('0x6')]({'action':_0x8f80('0x10')});};};ami[_0x8f80('0x11')]=function(){return function(){return ami[_0x8f80('0x6')]({'action':_0x8f80('0x12')});};};ami[_0x8f80('0x13')]=function(){return function(){return ami[_0x8f80('0x6')]({'action':_0x8f80('0x14')});};};function connect(){logger[_0x8f80('0x15')](util[_0x8f80('0x7')](_0x8f80('0x16'),config[_0x8f80('0x4')][_0x8f80('0xb')],config[_0x8f80('0x4')]['ip'],config['asterisk']['port']));ami[_0x8f80('0x17')](_0x8f80('0x9'),error);ami['once'](_0x8f80('0x18'),close);}ami['on']('connect',connect);ami['on'](_0x8f80('0x19'),function(_0x5079fd){logger['info'](util[_0x8f80('0x7')](_0x8f80('0x1a'),config[_0x8f80('0x4')][_0x8f80('0xb')],config[_0x8f80('0x4')]['ip'],config[_0x8f80('0x4')]['port'],util[_0x8f80('0x1b')](_0x5079fd,![],null)));});ami['on'](_0x8f80('0x1c'),function(){logger['info'](util[_0x8f80('0x7')](_0x8f80('0x1d'),config['asterisk']['username'],config[_0x8f80('0x4')]['ip'],config['asterisk'][_0x8f80('0x8')]));return Promise[_0x8f80('0x1e')]()[_0x8f80('0x1f')](ami[_0x8f80('0xc')]())['then'](ami[_0x8f80('0xe')]())[_0x8f80('0x1f')](ami[_0x8f80('0x20')]())['then'](ami[_0x8f80('0x11')]())[_0x8f80('0x1f')](ami[_0x8f80('0x13')]())[_0x8f80('0x21')](function(_0x22e3c1){logger[_0x8f80('0x9')](_0x8f80('0x22'),util['inspect'](_0x22e3c1,{'showHidden':![],'depth':null}));});});ami[_0x8f80('0x17')](_0x8f80('0x9'),error);ami['once']('close',close);module[_0x8f80('0x23')]=ami;
\ No newline at end of file
index c7bf87a..8ebd809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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
+var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xac4a,0x13f));var _0xaac4=function(_0x31fe5a,_0x1a1849){_0x31fe5a=_0x31fe5a-0x0;var _0x560a4d=_0xac4a[_0x31fe5a];return _0x560a4d;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client;
\ No newline at end of file
index e24cd9d..1d408a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cac=['[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','entity\x20is\x20undefine','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','talking','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','dialLimitQueue','pTalking','not_inuse','reachable','getContactDialer','countReScheduled','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','--------\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','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Interval:\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','lodash','uuid','moment','./utils','./utils/hopper','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','tail','sequence','preview','voiceQueues','agents','trunks','channels','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isEmpty','CAMPAIGN_STATUS','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','prototype','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','then','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','campaigns','isIVRCampaignActive','resolve','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncCampaigns]','dialMethod','progressive','handlePower','power','Queue','reject','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','isGlobal','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','dialAgiAfterHangupAgent','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','statedesc','dropreason','agiafterat','countdropretry','countglobal','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','additional','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','updateOriginated','rescheduleContact','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','countmachineretry','amd','emit','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','[actions]','clearZombieChannels','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','launchHandleIvr','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','dialQueueOptions','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','Contact','tags','createdAt','updatedAt','toUpper','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3cac,0x99));var _0xc3ca=function(_0x1b11f7,_0x345edc){_0x1b11f7=_0x1b11f7-0x0;var _0x5dac9e=_0x3cac[_0x1b11f7];return _0x5dac9e;};'use strict';var util=require('util');var _=require(_0xc3ca('0x0'));var uuid=require(_0xc3ca('0x1'));var moment=require(_0xc3ca('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xc3ca('0x3'));var hopperUtils=require(_0xc3ca('0x4'));var ut=require(_0xc3ca('0x5'));var config=require('../../../config/environment/');var logger=require(_0xc3ca('0x6'))(_0xc3ca('0x7'));var loggerBooked=require(_0xc3ca('0x6'))(_0xc3ca('0x8'));var loggerPredictive=require(_0xc3ca('0x6'))(_0xc3ca('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc3ca('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc3ca('0xb'));var ami=require('../ami');config[_0xc3ca('0xc')]=_[_0xc3ca('0xd')](config[_0xc3ca('0xc')],{'host':_0xc3ca('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc3ca('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xc3ca('0xf'));var RpcSetting=require(_0xc3ca('0x10'));var Interval=require('../rpc/interval');var Action=require(_0xc3ca('0x11'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0xc3ca('0x12'));var QueueCallerAbandon=require(_0xc3ca('0x13'));var Hangup=require(_0xc3ca('0x14'));var ipAgi=process[_0xc3ca('0x15')][_0xc3ca('0x16')]||_0xc3ca('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x1c6347){this[_0xc3ca('0x18')]=this[_0xc3ca('0x18')]?this['tail']['finally'](_0x1c6347):_0x1c6347();};function Dialer(_0x137c23,_0x3abf28){this[_0xc3ca('0x19')]=new Sequence();this[_0xc3ca('0x1a')]=_0x3abf28;this[_0xc3ca('0x1b')]=_0x137c23[_0xc3ca('0x1b')];this['campaigns']=_0x137c23['campaigns'];this['agents']=_0x137c23[_0xc3ca('0x1c')];this['trunks']=_0x137c23[_0xc3ca('0x1d')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xc3ca('0x1e')]={};this['actions']={};this[_0xc3ca('0x1f')]={};this[_0xc3ca('0x20')]={};this[_0xc3ca('0x21')]={};this['startPredictive']={};this[_0xc3ca('0x22')]={};this['ivrOriginated']={};this[_0xc3ca('0x23')]={};this[_0xc3ca('0x24')]={};this[_0xc3ca('0x25')]={};ami['on'](_0xc3ca('0x26'),this[_0xc3ca('0x27')]['bind'](this));ami['on']('queuecallerabandon',this[_0xc3ca('0x28')][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x2a'),this[_0xc3ca('0x2b')][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x2c'),this[_0xc3ca('0x2d')][_0xc3ca('0x29')](this));ami['on']('custom:queuesummary',this[_0xc3ca('0xb')]['bind'](this));ami['on'](_0xc3ca('0x2e'),this[_0xc3ca('0x2f')][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x30'),this[_0xc3ca('0x31')][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x32'),this[_0xc3ca('0x33')]['bind'](this));ami['on'](_0xc3ca('0x34'),this['syncVarSet'][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x35'),this[_0xc3ca('0x36')][_0xc3ca('0x29')](this));ami['on'](_0xc3ca('0x37'),this['syncQueueStatusComplete'][_0xc3ca('0x29')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting['getSettings']()['then'](function(_0x6661e8){previewRecallmeReminderInterval=_0x6661e8[_0xc3ca('0x38')];});}function isNotNull(_0x17188a){return _0x17188a!==null&&!_[_0xc3ca('0x39')](_0x17188a);}function msgResponse(_0x2d1989,_0xfd267a,_0x4a392f){return{'action':_0x2d1989,'response':_0xfd267a,'message':_0x4a392f,'stack':_0x4a392f};}function emit(_0x2cb7f6,_0x1a90fb,_0x1daa7c){io['to'](_0x2cb7f6)['emit'](_0x1a90fb,_0x1daa7c);}function emitOutboundVoiceQueueSummary(_0xb23f16){if(_0xb23f16[_0xc3ca('0x3a')]==='outbound'){logger[_0xc3ca('0x3b')](_0xc3ca('0x3c'),util[_0xc3ca('0x3d')](_0xb23f16,{'showHidden':![],'depth':null}));emit(util[_0xc3ca('0x3e')](_0xc3ca('0x3f'),_0xb23f16[_0xc3ca('0x40')]),_0xc3ca('0x41'),_0xb23f16);}}function checkGetDataPredictive(_0x1fce5a){if(isNotNull(_0x1fce5a)&&!_['isEmpty'](_0x1fce5a)){loggerPredictive['info'](_0xc3ca('0x42'));loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x44'),_0x1fce5a[_0xc3ca('0x45')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x46'),_0x1fce5a[_0xc3ca('0x47')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x48'),_0x1fce5a[_0xc3ca('0x49')]);loggerPredictive[_0xc3ca('0x43')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1fce5a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xc3ca('0x4a'),_0x1fce5a[_0xc3ca('0x4b')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x4c'),_0x1fce5a[_0xc3ca('0x4d')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x4e'));if(_0x1fce5a[_0xc3ca('0x45')]>0x0){if(!_[_0xc3ca('0x39')](_0x1fce5a[_0xc3ca('0x4d')])&&_0x1fce5a[_0xc3ca('0x4d')]>0x0){return!![];}loggerPredictive[_0xc3ca('0x43')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x1fce5a[_0xc3ca('0x4b')])&&_0x1fce5a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0xc3ca('0x4f'));}else{loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x50'));}}else{loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x51'));}return![];}function mergeDataErlangB(_0xc8ff9){return function(_0x48fcad){loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x52'));loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x53'),_0x48fcad['erlangCalls']);loggerPredictive[_0xc3ca('0x43')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48fcad[_0xc3ca('0x54')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x55'),_0x48fcad['erlangAbandonmentRate']);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x56'),_0x48fcad['erlangBusyFactor']);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x55'),_0x48fcad[_0xc3ca('0x57')]);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x4e'));_[_0xc3ca('0x58')](_0xc8ff9,_0x48fcad);};}function ifInterval(_0x4d73cc,_0x3bb92d){if(_['isUndefined'](_0x3bb92d)){return![];}return utils[_0xc3ca('0x59')](undefined,_0x3bb92d)<_0x4d73cc*0x3c;}function clearPredictiveAttributes(_0xdb5ff4){if(_0xdb5ff4[_0xc3ca('0x22')]){_0xdb5ff4[_0xc3ca('0x22')]=undefined;loggerPredictive[_0xc3ca('0x3b')](_0xdb5ff4[_0xc3ca('0x40')],_0xc3ca('0x5a'));}if(_0xdb5ff4['startPredictive']){_0xdb5ff4[_0xc3ca('0x5b')]=undefined;loggerPredictive[_0xc3ca('0x3b')](_0xdb5ff4[_0xc3ca('0x40')],_0xc3ca('0x5c'));}if(_0xdb5ff4[_0xc3ca('0x5d')]){clearInterval(_0xdb5ff4[_0xc3ca('0x5d')]);_0xdb5ff4['handlePredictive']=undefined;loggerPredictive[_0xc3ca('0x3b')](_0xdb5ff4[_0xc3ca('0x40')],_0xc3ca('0x5e'));}}function loggerCatchPredictive(_0x5d1a83,_0x47db89){return function(_0x150b7d){loggerPredictive[_0xc3ca('0x5f')](_0x47db89['name'],_0x5d1a83);loggerPredictive['error'](_0x150b7d['stack']);clearPredictiveAttributes(_0x47db89);};}function loggerCatch(_0x438373){return function(_0x4043b6){logger['error'](_0x438373,util[_0xc3ca('0x3d')](_0x4043b6,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x22062e,_0x4d17ba,_0x3b8a51){return function(_0x2dee7b){utils[_0xc3ca('0x60')](_0x4d17ba,_0x3b8a51,0x0);logger[_0xc3ca('0x5f')](_0x22062e,util[_0xc3ca('0x3d')](_0x2dee7b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4624f8){return function(_0x57b534){if(isNotNull(_0x57b534)&&isNotNull(_0x57b534[0x0])){if(_0x57b534[0x0][_0xc3ca('0x61')]>0x0){_0x4624f8[_0xc3ca('0x62')]=utils['CAMPAIGN_STATUS'][_0xc3ca('0x63')];logger[_0xc3ca('0x43')](_0xc3ca('0x64')+_0x4624f8[_0xc3ca('0x40')],_0x57b534[0x0]['contactsRescheduled'],_0xc3ca('0x65'));}else{_0x4624f8[_0xc3ca('0x62')]=utils['CAMPAIGN_STATUS'][_0xc3ca('0x66')];logger[_0xc3ca('0x43')](_0xc3ca('0x67')+_0x4624f8[_0xc3ca('0x40')]);}}};}function createObjHistory(_0x433ec2,_0x459089,_0x447070,_0x349d5e,_0x25f7a8){_0x433ec2['message']=_0x447070;var _0x4d82dc=new Action(_0x433ec2,_0x459089);var _0x4a294b=new History(_0x4d82dc);_0x4a294b[_0xc3ca('0x68')]=_0x349d5e;_0x4a294b['statedesc']=_0x25f7a8;_0x4a294b[_0xc3ca('0x69')]=_0x4d82dc[_0xc3ca('0x6a')];return _0x4a294b;}function unlockQueueStatus(_0x511200,_0x23591a){setTimeout(function(){if(_[_0xc3ca('0x39')](_0x511200[_0xc3ca('0x6b')])){loggerBooked[_0xc3ca('0x5f')](_0xc3ca('0x6c'),_0x23591a);}_0x511200[_0xc3ca('0x6b')]=!![];loggerBooked[_0xc3ca('0x43')](_0xc3ca('0x6d'),_0x23591a,JSON[_0xc3ca('0x6e')](_[_0xc3ca('0x6f')](_0x511200,[_0xc3ca('0x40'),_0xc3ca('0x6b')])));},0x1f3);}function checkInterval(_0x418783){return function(){if(!isNotNull(_0x418783[_0xc3ca('0x70')])){_0x418783[_0xc3ca('0x62')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x418783['name']+_0xc3ca('0x71');}if(!isNotNull(_0x418783['Interval'][_0xc3ca('0x72')])){_0x418783[_0xc3ca('0x62')]=utils['CAMPAIGN_STATUS'][_0xc3ca('0x73')];throw _0x418783['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xc3ca('0x74')](_0x418783[_0xc3ca('0x70')][_0xc3ca('0x72')]))){_0x418783[_0xc3ca('0x62')]=utils['CAMPAIGN_STATUS'][_0xc3ca('0x73')];throw _0x418783[_0xc3ca('0x40')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x54bf4f){return function(){if(!utils['isIVRCampaignActive'](_0x54bf4f)){_0x54bf4f[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x76')];throw _0x54bf4f[_0xc3ca('0x40')]+_0xc3ca('0x77');}};}function emitCampaignSummary(_0x2cb4f2){if(utils[_0xc3ca('0x78')](_0x2cb4f2)){emit(util[_0xc3ca('0x3e')](_0xc3ca('0x79'),_0x2cb4f2[_0xc3ca('0x40')]),_0xc3ca('0x7a'),_0x2cb4f2);}}function loggerCatchQueueSummary(_0x30c718,_0x6070ab){return function(_0x5729b1){clearPredictiveAttributes(_0x6070ab);emitCampaignSummary(_0x6070ab);loggerSyncQueueSummary[_0xc3ca('0x3b')](_0x30c718,util[_0xc3ca('0x3d')](_0x5729b1,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x109ec4){if(_0x109ec4['sendMessageOneNotActive']){if(_0x109ec4[_0xc3ca('0x7b')]===0x0){_0x109ec4[_0xc3ca('0x7c')]=![];_0x109ec4['message']=utils[_0xc3ca('0x75')]['INACTIVE'];loggerSyncQueueSummary[_0xc3ca('0x3b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x109ec4[_0xc3ca('0x40')],_0xc3ca('0x7d'));}else{_0x109ec4[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x7e')];loggerSyncQueueSummary['debug'](_0xc3ca('0x7f'),_0x109ec4['name'],_0xc3ca('0x80'));}emitCampaignSummary(_0x109ec4);}}function myreject(_0x3a658c){return function(_0x5df343){return _0x3a658c(msgResponse(_0xc3ca('0x81'),_0xc3ca('0x82'),JSON[_0xc3ca('0x6e')](_0x5df343)));};}Dialer[_0xc3ca('0x83')][_0xc3ca('0x84')]=function(_0x14d883){return!_['isUndefined'](_0x14d883)&&_0x14d883&&!_[_0xc3ca('0x39')](_0x14d883[_0xc3ca('0x40')])&&!_[_0xc3ca('0x39')](_0x14d883[_0xc3ca('0x85')])&&_0x14d883[_0xc3ca('0x85')]&&(this[_0xc3ca('0x1d')][util[_0xc3ca('0x3e')](_0xc3ca('0x86'),_0x14d883['name'])][_0xc3ca('0x87')]==='reachable'||this['trunks'][util['format'](_0xc3ca('0x86'),_0x14d883[_0xc3ca('0x40')])]['status']===_0xc3ca('0x88'));};Dialer['prototype'][_0xc3ca('0x89')]=function(_0x49cbf4){var _0x223d85=this;return function(){if(!_0x223d85['isTrunkReachable'](_0x49cbf4[_0xc3ca('0x8a')])){if(!_0x223d85['isTrunkReachable'](_0x49cbf4[_0xc3ca('0x8b')])){_0x49cbf4[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')]['TRUNK_NOT_REACHABLE'];throw _0x49cbf4['name']+_0xc3ca('0x8c');}}};};Dialer[_0xc3ca('0x83')]['checkIfTime']=function(_0x5e7844,_0x4d5a99,_0x3370d9,_0x4c9261){var _0x384be4=this;return function(){var _0x102745=!![];return _0x384be4[_0xc3ca('0x8d')](_0x5e7844,_0x4d5a99,_0x3370d9,_0x4c9261,_0x102745);};};Dialer[_0xc3ca('0x83')]['checkIfTimeIntervals']=function(_0x2770bf,_0x3f068a,_0x47dba1,_0x840970){var _0x294fcc=this;return function(){var _0x384d46=![];return _0x294fcc[_0xc3ca('0x8d')](_0x2770bf[_0xc3ca('0x72')],_0x3f068a,_0x47dba1,_0x840970,_0x384d46);};};Dialer[_0xc3ca('0x83')]['ifTimeIvr']=function(_0x30a6a7,_0x5f2d4b,_0x367cd8,_0x2441f5,_0x55c841){var _0x2efd63=[];return new Promise(function(_0x4624f4,_0x345556){if(!isNotNull(_0x30a6a7)){_0x2441f5[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x73')];return _0x345556(msgResponse(_0xc3ca('0x8e'),_0xc3ca('0x8f'),_0x367cd8+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xc3ca('0x74')](_0x30a6a7)){_0x2441f5['message']=utils[_0xc3ca('0x75')][_0xc3ca('0x90')];return _0x345556(msgResponse(_0xc3ca('0x8e'),'Failure',_0x367cd8+_0xc3ca('0x91')));}if(_0x5f2d4b&&_[_0xc3ca('0x39')](config[_0xc3ca('0x92')][_0x5f2d4b])){_0x2441f5[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x93')];return _0x345556(msgResponse(_0xc3ca('0x8e'),_0xc3ca('0x8f'),_0x367cd8+_0xc3ca('0x94')+_0x5f2d4b));}if(_['isArray'](_0x30a6a7)){for(var _0x222af1=0x0;_0x222af1<_0x30a6a7[_0xc3ca('0x95')];_0x222af1+=0x1){_0x2efd63[_0xc3ca('0x96')](ami[_0xc3ca('0x97')]({'action':_0xc3ca('0x98'),'command':util['format'](_0xc3ca('0x99'),_0x30a6a7[_0x222af1]['interval'],!_[_0xc3ca('0x39')](config[_0xc3ca('0x92')][_0x5f2d4b])?_0x5f2d4b:'')})[_0xc3ca('0x9a')](function(_0x1bdb8c){return _0x1bdb8c['content'][_0xc3ca('0x9b')](_0xc3ca('0x9c'))>=0x0;})[_0xc3ca('0x9d')](myreject(_0x345556)));}}else{_0x2efd63['push'](ami[_0xc3ca('0x97')]({'action':_0xc3ca('0x98'),'command':util[_0xc3ca('0x3e')](_0xc3ca('0x99'),_0x30a6a7,!_[_0xc3ca('0x39')](config[_0xc3ca('0x92')][_0x5f2d4b])?_0x5f2d4b:'')})[_0xc3ca('0x9a')](function(_0x249cb7){return _0x249cb7['content'][_0xc3ca('0x9b')](_0xc3ca('0x9c'))>=0x0;})['catch'](myreject(_0x345556)));}Promise[_0xc3ca('0x9e')](_0x2efd63)[_0xc3ca('0x9a')](function(_0x59f7bb){var _0x4be0cb=_['some'](_0x59f7bb);if(_0x4be0cb){return _0x4624f4(_0x4be0cb);}else{_0x2441f5['message']=_0x55c841?utils['CAMPAIGN_STATUS'][_0xc3ca('0x9f')]:utils[_0xc3ca('0x75')]['OVERTIME_INTERVAL'];return _0x345556(msgResponse('[ifTime][promiseAll]',_0xc3ca('0x8f'),_0xc3ca('0xa0')+_0x55c841+'\x20'+_0x367cd8+'\x20Interval\x20is\x20overtime:\x20'+util[_0xc3ca('0x3d')](_0x30a6a7,{'showHidden':![],'depth':null})+_0xc3ca('0xa1')+_0x5f2d4b));}})['catch'](function(_0x5b9bb2){return _0x345556(msgResponse(_0xc3ca('0x8e'),'Failure',JSON[_0xc3ca('0x6e')](_0x5b9bb2)));});});};Dialer[_0xc3ca('0x83')]['loopCampaigns']=function(){var _0x427a37=this;return cmHopper[_0xc3ca('0xa2')]({'active':![]},{'where':{'active':!![]}})[_0xc3ca('0x9a')](function(){setInterval(function(){_0x427a37[_0xc3ca('0xa3')]();},0x3e8);});};Dialer[_0xc3ca('0x83')]['syncCampaigns']=function(){var _0x529561=this;var _0x26b332;for(var _0xb7fe08 in this[_0xc3ca('0xa4')]){if(typeof this[_0xc3ca('0xa4')][_0xb7fe08]!=='undefined'){_0x26b332=this[_0xc3ca('0xa4')][_0xb7fe08];if(utils['isIVRCampaign'](_0x26b332)&&utils[_0xc3ca('0xa5')](_0x26b332)){_0x26b332[_0xc3ca('0x7c')]=!![];Promise[_0xc3ca('0xa6')]()[_0xc3ca('0x9a')](checkIsIVRCampaignActive(_0x26b332))[_0xc3ca('0x9a')](checkInterval(_0x26b332))[_0xc3ca('0x9a')](_0x529561[_0xc3ca('0x89')](_0x26b332))[_0xc3ca('0x9a')](_0x529561['checkIfTime'](_0x26b332[_0xc3ca('0xa7')],_0x26b332['dialTimezone'],_0x26b332[_0xc3ca('0x40')],_0x26b332))['then'](_0x529561[_0xc3ca('0xa8')](_0x26b332[_0xc3ca('0x70')],_0x26b332[_0xc3ca('0xa9')],_0x26b332[_0xc3ca('0x40')],_0x26b332))[_0xc3ca('0x9a')](_0x529561['launchHandleIvr'](_0x26b332))[_0xc3ca('0x9d')](loggerCatchQueueSummary(_0xc3ca('0xaa'),_0x26b332));}else{notSendMessagesCampaign(_0x26b332);}}}};Dialer[_0xc3ca('0x83')]['checkDialMethod']=function(_0x27fdaa){if(_0x27fdaa[_0xc3ca('0xab')]!==_0xc3ca('0x9')){clearPredictiveAttributes(_0x27fdaa);}switch(_0x27fdaa[_0xc3ca('0xab')]){case _0xc3ca('0xac'):return this[_0xc3ca('0xad')](_0x27fdaa,0x1);case _0xc3ca('0xae'):return this[_0xc3ca('0xad')](_0x27fdaa,_0x27fdaa['dialPowerLevel']);case _0xc3ca('0x9'):return this[_0xc3ca('0x9')](_0x27fdaa);case _0xc3ca('0x8'):return this[_0xc3ca('0xad')](_0x27fdaa,0x1);default:logger[_0xc3ca('0x5f')](_0xc3ca('0xaf'),_0x27fdaa[_0xc3ca('0x40')],'method\x20not\x20recognized');return Promise[_0xc3ca('0xb0')]();}};Dialer[_0xc3ca('0x83')]['ifTime']=function(_0x2a7de2,_0x114838){var _0x23253d=_0x2a7de2[_0xc3ca('0xa9')];var _0x1a5851=_0x114838?_0x2a7de2[_0xc3ca('0xa7')]:_0x2a7de2[_0xc3ca('0x70')][_0xc3ca('0x72')];logger[_0xc3ca('0xb1')](_0xc3ca('0xb2'),_0x1a5851,_0x23253d,_0x2a7de2['name'],util['format'](_0xc3ca('0xb3'),_0x2a7de2[_0xc3ca('0x40')],_0x2a7de2['id']));var _0x196075=null;return Interval[_0xc3ca('0xb4')](_0x1a5851,_0x23253d)['then'](function(_0x478936){if(_0x478936===!![]){return _0x478936;}else{_0x2a7de2['message']=_0x114838?utils['CAMPAIGN_STATUS'][_0xc3ca('0x9f')]:utils['CAMPAIGN_STATUS'][_0xc3ca('0xb5')];_0x196075=msgResponse(_0xc3ca('0xb6'),'Failure',_0xc3ca('0xa0')+_0x114838+'\x20'+_0x2a7de2[_0xc3ca('0x40')]+_0xc3ca('0xb7')+util[_0xc3ca('0x3d')](_0x1a5851,{'showHidden':![],'depth':null})+_0xc3ca('0xa1')+_0x23253d);}if(_0x196075!==null){logger[_0xc3ca('0xb1')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x196075);_0x196075[_0xc3ca('0xb8')]=_0x114838;throw _0x196075;}})[_0xc3ca('0x9d')](function(_0x2b343c){logger['error']('AMI\x20IfTime',_0x2b343c);throw msgResponse(_0xc3ca('0x81'),_0xc3ca('0x82'),util[_0xc3ca('0x3d')](_0x2b343c,{'showHidden':![],'depth':null}));});};Dialer[_0xc3ca('0x83')][_0xc3ca('0x27')]=function(_0x36545e){if(this[_0xc3ca('0x1b')][_0x36545e[_0xc3ca('0xb9')]]){if(this['uniqueId'][_0x36545e[_0xc3ca('0xba')]]&&this[_0xc3ca('0x20')][_0x36545e[_0xc3ca('0xba')]][_0xc3ca('0x3a')]!==_0xc3ca('0xbb')){this['updateOriginated'](this[_0xc3ca('0x1b')][_0x36545e[_0xc3ca('0xb9')]]);this[_0xc3ca('0x20')][_0x36545e['uniqueid']][_0xc3ca('0xbc')]=moment()['format'](_0xc3ca('0xbd'));}}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x2d')]=function(_0x3f8a53){var _0x4f1f87=this[_0xc3ca('0x20')][_0x3f8a53[_0xc3ca('0xba')]];if(this[_0xc3ca('0x1b')][_0x3f8a53['queue']]){if(_0x4f1f87&&_0x4f1f87[_0xc3ca('0x3a')]!==_0xc3ca('0xbb')){delete this[_0xc3ca('0x20')][_0x3f8a53['uniqueid']];this['voiceQueues'][_0x3f8a53[_0xc3ca('0xb9')]]['outboundAnswerCallsDay']+=0x1;var _0x5bf5b3=new AgentComplete(_0x4f1f87,_0x3f8a53);if(_0x3f8a53[_0xc3ca('0xbe')]==='agent'){_0x5bf5b3['agiafterat']=this[_0xc3ca('0x1b')][_0x3f8a53[_0xc3ca('0xb9')]]['dialQueueProject2']&&this[_0xc3ca('0x1b')][_0x3f8a53[_0xc3ca('0xb9')]][_0xc3ca('0xbf')]?moment()[_0xc3ca('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0x5bf5b3)[_0xc3ca('0x9d')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xc3ca('0xc0')](_0x5bf5b3)['catch'](loggerCatch(_0xc3ca('0xc1')));}}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x28')]=function(_0x3151b3){var _0x4638be=this['uniqueId'][_0x3151b3[_0xc3ca('0xba')]];var _0x56c98f=this;var _0x226721=![];var _0x25e5d5;var _0xdd4970;if(this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]]){if(_0x4638be&&_0x4638be[_0xc3ca('0x3a')]!==_0xc3ca('0xbb')){delete this[_0xc3ca('0x20')][_0x3151b3['uniqueid']];this['updateOriginated'](this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]]);_0x4638be[_0xc3ca('0xc2')]=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));var _0x2e2c84=new QueueCallerAbandon(_0x4638be,_0x3151b3);if(utils[_0xc3ca('0x59')](_0x4638be[_0xc3ca('0xc2')],_0x4638be[_0xc3ca('0xc3')])>=_0x4638be[_0xc3ca('0xc4')]){this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0x49')]+=0x1;this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xc5')]+=0x1;this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2e2c84[_0xc3ca('0x68')]=0xa;_0x2e2c84[_0xc3ca('0xc6')]='Drop';_0x2e2c84[_0xc3ca('0xc7')]='TIMEOUT';_0x2e2c84[_0xc3ca('0xc8')]=this['voiceQueues'][_0x3151b3['queue']]['dialQueueProject2']?moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd')):undefined;_0x2e2c84[_0xc3ca('0xc9')]+=0x1;_0x2e2c84[_0xc3ca('0xca')]+=0x1;_0x25e5d5=this['voiceQueues'][_0x3151b3['queue']]['dialDropRetryFrequency'];_0xdd4970=this[_0xc3ca('0x1b')][_0x3151b3['queue']][_0xc3ca('0xcb')];hopperUtils['verifyAdditionalPhones'](_0x2e2c84,_0x2e2c84[_0xc3ca('0x68')],_0x4638be[_0xc3ca('0xcc')])[_0xc3ca('0x9a')](function(_0x380ee6){_0x226721=_0x380ee6['additional']==0x1;if(_0x2e2c84[_0xc3ca('0xc9')]>=_0x56c98f['voiceQueues'][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xcd')]){_0x56c98f[_0xc3ca('0xce')](_0x2e2c84,_0x380ee6['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2e2c84['countdropretry'],'scheduledat':moment()[_0xc3ca('0xcf')](_0x56c98f[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xd0')],'minutes')[_0xc3ca('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4638be[_0xc3ca('0xd1')],'ListId':_0x4638be[_0xc3ca('0xd2')],'VoiceQueueId':_0x4638be[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x4638be[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0xd5')));var _0x5bc7e0=new History(_0x2e2c84);_0x5bc7e0['state']=0xa;_0x5bc7e0[_0xc3ca('0xc6')]=_0xc3ca('0xd6');_0x5bc7e0[_0xc3ca('0x6a')]=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));_0x5bc7e0[_0xc3ca('0x69')]=_0x5bc7e0[_0xc3ca('0x6a')];_0x5bc7e0[_0xc3ca('0xd7')]=_0x2e2c84[_0xc3ca('0xd7')];_0x5bc7e0[_0xc3ca('0xd8')]=_0x2e2c84[_0xc3ca('0xd8')];hopperUtils[_0xc3ca('0xd9')](_0x5bc7e0)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0xda')));}})[_0xc3ca('0x9a')](function(){if(_0x226721)hopperUtils[_0xc3ca('0xdb')](_0x2e2c84,_0x25e5d5,_0xdd4970)[_0xc3ca('0x9a')](function(){return 0x1;});});}else{this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xdc')]+=0x1;this['voiceQueues'][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xdd')]+=0x1;_0x2e2c84['state']=0xb;_0x2e2c84[_0xc3ca('0xc6')]=_0xc3ca('0xde');_0x2e2c84['dropreason']=_0xc3ca('0xdf');_0x2e2c84[_0xc3ca('0xe0')]+=0x1;_0x2e2c84[_0xc3ca('0xca')]+=0x1;_0x25e5d5=this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xe1')];_0xdd4970=this[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xe2')](_0x2e2c84,_0x2e2c84[_0xc3ca('0x68')],_0x4638be[_0xc3ca('0xcc')])['then'](function(_0x2ec524){if(_0x2e2c84['countabandonedretry']>=_0x56c98f[_0xc3ca('0x1b')][_0x3151b3['queue']]['dialAbandonedMaxRetry']){_0x56c98f['queueCallerAbandonCreateState'](_0x2e2c84,_0x2ec524[_0xc3ca('0xe3')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x2e2c84[_0xc3ca('0xe0')],'scheduledat':moment()[_0xc3ca('0xcf')](_0x56c98f[_0xc3ca('0x1b')][_0x3151b3[_0xc3ca('0xb9')]][_0xc3ca('0xe1')],_0xc3ca('0xe4'))[_0xc3ca('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4638be['ContactId'],'ListId':_0x4638be[_0xc3ca('0xd2')],'VoiceQueueId':_0x4638be[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x4638be['CampaignId']||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0xe5')));var _0x2b8c75=new History(_0x2e2c84);_0x2b8c75[_0xc3ca('0x68')]=0xb;_0x2b8c75[_0xc3ca('0xc6')]=_0xc3ca('0xde');_0x2b8c75[_0xc3ca('0x6a')]=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));_0x2b8c75[_0xc3ca('0x69')]=_0x2b8c75['starttime'];_0x2b8c75[_0xc3ca('0xd7')]=_0x2e2c84['calleridname'];_0x2b8c75[_0xc3ca('0xd8')]=_0x2e2c84['calleridnum'];hopperUtils[_0xc3ca('0xd9')](_0x2b8c75)['catch'](loggerCatch(_0xc3ca('0xe6')));}})[_0xc3ca('0x9a')](function(){if(_0x226721)hopperUtils[_0xc3ca('0xdb')](_0x2e2c84,_0x25e5d5,_0xdd4970)[_0xc3ca('0x9a')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xc3ca('0x33')]=function(_0x2aa57e){if(this[_0xc3ca('0xe7')][_0x2aa57e[_0xc3ca('0xba')]]){this['actions'][_0x2aa57e['uniqueid']][_0xc3ca('0xe8')]=_0x2aa57e[_0xc3ca('0xe8')];}if(this[_0xc3ca('0x20')][_0x2aa57e[_0xc3ca('0xba')]]){this[_0xc3ca('0x20')][_0x2aa57e[_0xc3ca('0xba')]][_0xc3ca('0xe8')]=_0x2aa57e[_0xc3ca('0xe8')];}};Dialer['prototype'][_0xc3ca('0x36')]=function(_0x36033b){if(!this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]]){return;}var _0x4e2425=this[_0xc3ca('0x1b')][this['actions'][_0x36033b[_0xc3ca('0xe9')]]['queue']][_0xc3ca('0xea')]||_0xc3ca('0xeb');if(_0x4e2425===_0xc3ca('0xec')){if(this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]]&&_[_0xc3ca('0xed')](this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]][_0xc3ca('0xee')])&&_0x36033b['status']==='1'&&_0x36033b[_0xc3ca('0xef')]==='0'){if(this[_0xc3ca('0x1c')][_0x36033b[_0xc3ca('0xf0')]]){if(!this[_0xc3ca('0x1c')][_0x36033b[_0xc3ca('0xf0')]][_0xc3ca('0xee')]){this['agents'][_0x36033b['stateinterface']][_0xc3ca('0xee')]=!![];this[_0xc3ca('0xe7')][_0x36033b['actionid']][_0xc3ca('0xee')]=!![];this['actions'][_0x36033b[_0xc3ca('0xe9')]][_0xc3ca('0xf0')]=_0x36033b[_0xc3ca('0xf0')];}}}}else if(_0x4e2425===_0xc3ca('0xeb')){if(this[_0xc3ca('0xe7')][_0x36033b['actionid']]){if(this[_0xc3ca('0x1c')][_0x36033b[_0xc3ca('0xf0')]]){this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]][_0xc3ca('0xf0')]=_0x36033b[_0xc3ca('0xf0')];if(_['isNil'](this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]])){this[_0xc3ca('0x23')][this['actions'][_0x36033b['actionid']][_0xc3ca('0xb9')]]=[];}this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0x36033b[_0xc3ca('0xe9')]]['queue']][_0xc3ca('0x96')](_['merge'](_[_0xc3ca('0x6f')](this[_0xc3ca('0xe7')][_0x36033b['actionid']],['idHopper',_0xc3ca('0xf0')]),{'status':_0x36033b[_0xc3ca('0x87')],'paused':_0x36033b[_0xc3ca('0xef')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0xd5cf1c){if(!this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]){return;}var _0x5989d5=this;var _0x197b03=this[_0xc3ca('0x1b')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['queue']];var _0x48c18d=_0x197b03[_0xc3ca('0xea')]||_0xc3ca('0xeb');if(_0x48c18d===_0xc3ca('0xec')){if(this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]&&this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xf0')]){this['preview'][_0xc3ca('0xf1')](this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xf2')],this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']][_0xc3ca('0xf0')])[_0xc3ca('0x9d')](function(_0x4fba6b){logger[_0xc3ca('0x5f')](_0xc3ca('0xf3'),util[_0xc3ca('0x3d')](_0x4fba6b,{'showHidden':![],'depth':null}));})[_0xc3ca('0xf4')](function(){_0x5989d5[_0xc3ca('0xf5')](_0x5989d5[_0xc3ca('0x1b')][_0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c['actionid']]['queue']]);_0x5989d5[_0xc3ca('0x1c')][_0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c['actionid']]['stateinterface']][_0xc3ca('0xee')]=![];delete _0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03);});}else{this[_0xc3ca('0xf5')](this[_0xc3ca('0x1b')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]);hopperUtils[_0xc3ca('0xf6')]({'active':![],'ContactId':this['actions'][_0xd5cf1c['actionid']][_0xc3ca('0xd1')],'ListId':this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd2')],'VoiceQueueId':this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']][_0xc3ca('0xd3')]||undefined,'CampaignId':this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03);}}else if(_0x48c18d==='rrmemory'){var _0x3e2182;if(this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']]&&!_[_0xc3ca('0x74')](this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['queue']])){if(this[_0xc3ca('0x24')][_0x5989d5['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]){this['queueBookedRR'][_0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['queue']]=this[_0xc3ca('0x24')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]?this[_0xc3ca('0x24')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['queue']]:this['queueBooked'][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]?this['queueBooked'][this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]][_0xc3ca('0xf7')]||0x0:0x0;}this[_0xc3ca('0x23')][this['actions'][_0xd5cf1c['actionid']][_0xc3ca('0xb9')]][_0xc3ca('0xf7')]=this[_0xc3ca('0x24')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]];for(var _0x1c27ba=0x0;_0x1c27ba<this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]['length'];_0x1c27ba+=0x1){_0x3e2182=rr(this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]);this[_0xc3ca('0x24')][_0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]=this[_0xc3ca('0x23')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]][_0xc3ca('0xf7')];if(_0x3e2182[_0xc3ca('0x87')]==='1'&&_0x3e2182[_0xc3ca('0xef')]==='0'){break;}}if(!_[_0xc3ca('0xed')](_0x3e2182)){this[_0xc3ca('0x1c')][_0x3e2182[_0xc3ca('0xf0')]][_0xc3ca('0xf8')]=_[_0xc3ca('0x39')](this[_0xc3ca('0x1c')][_0x3e2182[_0xc3ca('0xf0')]]['unlockRR'])?!![]:this[_0xc3ca('0x1c')][_0x3e2182[_0xc3ca('0xf0')]][_0xc3ca('0xf8')];}loggerBooked[_0xc3ca('0x43')](_0xc3ca('0xf9'),_0xd5cf1c[_0xc3ca('0xe9')],_0xc3ca('0xfa'),JSON[_0xc3ca('0x6e')](_[_0xc3ca('0x6f')](this['agents'][_0x3e2182['stateinterface']],[_0xc3ca('0x40'),_0xc3ca('0xf8')])),_0xc3ca('0xfb'),JSON[_0xc3ca('0x6e')](_0x3e2182[_0xc3ca('0xf2')]));if(!_['isNil'](_0x3e2182)&&_0x3e2182['status']==='1'&&_0x3e2182[_0xc3ca('0xef')]==='0'&&this['agents'][_0x3e2182[_0xc3ca('0xf0')]][_0xc3ca('0xf8')]){this[_0xc3ca('0x1c')][_0x3e2182['stateinterface']][_0xc3ca('0xf8')]=![];this[_0xc3ca('0x23')][_0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c['actionid']][_0xc3ca('0xb9')]]=[];this[_0xc3ca('0x1a')][_0xc3ca('0xf1')](_0x3e2182[_0xc3ca('0xf2')],_0x3e2182[_0xc3ca('0xf0')])[_0xc3ca('0x9d')](function(_0x203292){logger[_0xc3ca('0x5f')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc3ca('0x3d')](_0x203292,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5989d5['updateOriginated'](_0x5989d5['voiceQueues'][_0x5989d5['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]);setTimeout(function(){_0x5989d5[_0xc3ca('0x1c')][_0x3e2182[_0xc3ca('0xf0')]][_0xc3ca('0xf8')]=!![];loggerBooked[_0xc3ca('0x43')](_0xc3ca('0xfc'),_0xd5cf1c[_0xc3ca('0xe9')],_0xc3ca('0xfa'),JSON['stringify'](_[_0xc3ca('0x6f')](_0x5989d5[_0xc3ca('0x1c')][_0x3e2182[_0xc3ca('0xf0')]],[_0xc3ca('0x40'),_0xc3ca('0xf8')])),_0xc3ca('0xfb'),JSON[_0xc3ca('0x6e')](_0x3e2182[_0xc3ca('0xf2')]));},0xc7);delete _0x5989d5[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03,_0xd5cf1c[_0xc3ca('0xe9')]);});}else{loggerBooked[_0xc3ca('0x43')]('[booked][unlock]');this[_0xc3ca('0xf5')](this[_0xc3ca('0x1b')][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]);hopperUtils[_0xc3ca('0xf6')]({'active':![],'ContactId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['ContactId'],'ListId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd2')],'VoiceQueueId':this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']][_0xc3ca('0xd3')]||undefined,'CampaignId':this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']][_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch(_0xc3ca('0xfd')));delete this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03);}}else{loggerBooked[_0xc3ca('0x43')](_0xc3ca('0xfe'));this[_0xc3ca('0xf5')](this['voiceQueues'][this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xb9')]]);hopperUtils[_0xc3ca('0xf6')]({'active':![],'ContactId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['ContactId'],'ListId':this[_0xc3ca('0xe7')][_0xd5cf1c['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd3')]||undefined,'CampaignId':this['actions'][_0xd5cf1c['actionid']]['CampaignId']||undefined})[_0xc3ca('0x9d')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03);}}else{loggerBooked[_0xc3ca('0x43')](_0xc3ca('0xff'));this[_0xc3ca('0xf5')](this['voiceQueues'][this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0xd5cf1c[_0xc3ca('0xe9')]]['ContactId'],'ListId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd2')],'VoiceQueueId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]][_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch(_0xc3ca('0x100')));delete this[_0xc3ca('0xe7')][_0xd5cf1c[_0xc3ca('0xe9')]];unlockQueueStatus(_0x197b03);}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x2b')]=function(_0x188f9f){var _0x45565a=this[_0xc3ca('0xe7')][_0x188f9f['actionid']];if(_0x45565a){delete this[_0xc3ca('0xe7')][_0x188f9f[_0xc3ca('0xe9')]];_0x45565a[_0xc3ca('0xc3')]=moment()[_0xc3ca('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x17769a=_0x45565a[_0xc3ca('0x3a')]===_0xc3ca('0xbb')?this[_0xc3ca('0xa4')][_0x45565a['queue']]:this[_0xc3ca('0x1b')][_0x45565a[_0xc3ca('0x101')]()];if(_0x188f9f[_0xc3ca('0x102')]!==_0xc3ca('0x103')){this[_0xc3ca('0xf5')](_0x17769a);return this['callProgressDetecting'](_0x45565a,_0x17769a,_0x188f9f)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x104')));}this[_0xc3ca('0x20')][_0x188f9f[_0xc3ca('0xba')]]=_0x45565a;}};Dialer['prototype'][_0xc3ca('0x105')]=function(_0x1eb4e2){var _0x32c04c=this;var _0x2efbaf=this[_0xc3ca('0x20')][_0x1eb4e2[_0xc3ca('0xba')]];var _0xf6964f;if(!_[_0xc3ca('0xed')](_0x1eb4e2)&&!_[_0xc3ca('0xed')](_0x1eb4e2[_0xc3ca('0x106')])&&!_['isNil'](_0x1eb4e2['variable'][_0xc3ca('0x107')])&&_0x1eb4e2[_0xc3ca('0x108')]==='xcally-motion-dialer'&&_0x2efbaf){if(_0x2efbaf['type']!==_0xc3ca('0xbb')&&this[_0xc3ca('0x1b')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x109')]&&_0x1eb4e2[_0xc3ca('0x10a')]===_0xc3ca('0x10b')){delete this[_0xc3ca('0x20')][_0x1eb4e2['uniqueid']];this[_0xc3ca('0xf5')](this[_0xc3ca('0x1b')][_0x2efbaf['queue']]);this[_0xc3ca('0x1b')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x10c')]+=0x1;this[_0xc3ca('0x1b')][_0x2efbaf['queue']][_0xc3ca('0x10d')]+=0x1;_0xf6964f=new Hangup(_0x2efbaf,_0x1eb4e2);_0xf6964f['state']=0x12;_0xf6964f[_0xc3ca('0xc6')]=_0xc3ca('0x10e');_0xf6964f[_0xc3ca('0x10f')]='AMD';ami['emit'](_0xc3ca('0x110'),ut['buildObj'](_0xf6964f,'amd'));this[_0xc3ca('0x111')](_0xf6964f,_0xc3ca('0x112'),'[syncHangupInAMD]');}if(_0x2efbaf[_0xc3ca('0x3a')]!==_0xc3ca('0xbb')&&this[_0xc3ca('0x1b')][_0x2efbaf['queue']]['dialAMDActive']&&_0x1eb4e2['value']===_0xc3ca('0x113')){return new Promise(function(_0x43334c,_0x306a31){delete _0x32c04c[_0xc3ca('0x20')][_0x1eb4e2[_0xc3ca('0xba')]];_0x32c04c[_0xc3ca('0xf5')](_0x32c04c[_0xc3ca('0x1b')][_0x2efbaf[_0xc3ca('0xb9')]]);_0x32c04c[_0xc3ca('0x1b')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x10c')]+=0x1;_0x32c04c[_0xc3ca('0x1b')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x10d')]+=0x1;var _0x353e07=_0x32c04c['voiceQueues'][_0x2efbaf[_0xc3ca('0xb9')]];var _0x1286cc=new Hangup(_0x2efbaf,_0x1eb4e2);_0x1286cc[_0xc3ca('0x68')]=0x13;_0x1286cc['statedesc']=_0xc3ca('0x114');_0x1286cc[_0xc3ca('0x10f')]=_0xc3ca('0x115');_0x1286cc[_0xc3ca('0x116')]+=0x1;_0x1286cc[_0xc3ca('0xca')]+=0x1;_0x1286cc[_0xc3ca('0x117')]=!![];ami[_0xc3ca('0x118')](_0xc3ca('0x110'),ut[_0xc3ca('0x119')](_0x1286cc,_0xc3ca('0x117')));hopperUtils['createHistory'](_0x1286cc)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x11a')));if(_0x1286cc[_0xc3ca('0x11b')]+_0x1286cc[_0xc3ca('0x11c')]+_0x1286cc[_0xc3ca('0x11d')]+_0x1286cc[_0xc3ca('0x11e')]+_0x1286cc[_0xc3ca('0xc9')]+_0x1286cc['countabandonedretry']+_0x1286cc[_0xc3ca('0x116')]+_0x1286cc[_0xc3ca('0x11f')]>=_0x353e07['dialGlobalMaxRetry']){_0x32c04c[_0xc3ca('0x120')](_0x1286cc,_0x43334c,_0x306a31,_0xc3ca('0x121'));}else{if(_0x1286cc['countmachineretry']>=_0x353e07['dialMachineMaxRetry']){_0x32c04c[_0xc3ca('0x122')](_0x1286cc,_0x43334c,_0x306a31,_0xc3ca('0x123'));}else{hopperUtils[_0xc3ca('0xf6')]({'active':![],'countmachineretry':_0x1286cc[_0xc3ca('0x116')],'scheduledat':moment()[_0xc3ca('0xcf')](_0x353e07[_0xc3ca('0x124')],_0xc3ca('0xe4'))['format'](_0xc3ca('0xbd')),'ContactId':_0x1286cc[_0xc3ca('0xd1')],'ListId':_0x1286cc[_0xc3ca('0xd2')],'VoiceQueueId':_0x1286cc[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1286cc[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x125')));_0x43334c({'reschedule':0x1});}}});}if(_0x2efbaf[_0xc3ca('0x3a')]==='ivr'&&this[_0xc3ca('0xa4')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x109')]&&_0x1eb4e2['value']===_0xc3ca('0x10b')){delete this[_0xc3ca('0x20')][_0x1eb4e2[_0xc3ca('0xba')]];this['updateOriginated'](this[_0xc3ca('0xa4')][_0x2efbaf[_0xc3ca('0xb9')]]);_0xf6964f=new Hangup(_0x2efbaf,_0x1eb4e2);_0xf6964f[_0xc3ca('0x68')]=0x12;_0xf6964f[_0xc3ca('0xc6')]=_0xc3ca('0x10e');_0xf6964f[_0xc3ca('0x10f')]=_0xc3ca('0x115');ami['emit'](_0xc3ca('0x110'),ut[_0xc3ca('0x119')](_0xf6964f,_0xc3ca('0x117')));this[_0xc3ca('0x111')](_0xf6964f,_0xc3ca('0x126'),_0xc3ca('0x127'));}if(_0x2efbaf['type']===_0xc3ca('0xbb')&&this[_0xc3ca('0xa4')][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x109')]&&_0x1eb4e2[_0xc3ca('0x10a')]===_0xc3ca('0x113')){return new Promise(function(_0x5250de,_0x1de942){delete _0x32c04c['uniqueId'][_0x1eb4e2[_0xc3ca('0xba')]];_0x32c04c[_0xc3ca('0xf5')](_0x32c04c[_0xc3ca('0xa4')][_0x2efbaf['queue']]);_0x32c04c[_0xc3ca('0xa4')][_0x2efbaf['queue']][_0xc3ca('0x10c')]+=0x1;_0x32c04c['campaigns'][_0x2efbaf[_0xc3ca('0xb9')]][_0xc3ca('0x10d')]+=0x1;var _0x47ef4d=_0x32c04c[_0xc3ca('0xa4')][_0x2efbaf[_0xc3ca('0xb9')]];var _0x10b49b=new Hangup(_0x2efbaf,_0x1eb4e2);_0x10b49b['state']=0x13;_0x10b49b[_0xc3ca('0xc6')]=_0xc3ca('0x114');_0x10b49b[_0xc3ca('0x10f')]=_0xc3ca('0x115');_0x10b49b[_0xc3ca('0x116')]+=0x1;_0x10b49b[_0xc3ca('0xca')]+=0x1;_0x10b49b[_0xc3ca('0x117')]=!![];ami[_0xc3ca('0x118')](_0xc3ca('0x110'),ut[_0xc3ca('0x119')](_0x10b49b,_0xc3ca('0x117')));hopperUtils[_0xc3ca('0xd9')](_0x10b49b)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x11a')));if(_0x10b49b[_0xc3ca('0x11b')]+_0x10b49b[_0xc3ca('0x11c')]+_0x10b49b[_0xc3ca('0x11d')]+_0x10b49b['countnosuchnumberretry']+_0x10b49b[_0xc3ca('0xc9')]+_0x10b49b['countabandonedretry']+_0x10b49b[_0xc3ca('0x116')]+_0x10b49b[_0xc3ca('0x11f')]>=_0x47ef4d[_0xc3ca('0x128')]){_0x32c04c[_0xc3ca('0x120')](_0x10b49b,_0x5250de,_0x1de942,_0xc3ca('0x121'));}else{if(_0x10b49b[_0xc3ca('0x116')]>=_0x47ef4d[_0xc3ca('0x129')]){_0x32c04c[_0xc3ca('0x122')](_0x10b49b,_0x5250de,_0x1de942,_0xc3ca('0x123'));}else{hopperUtils[_0xc3ca('0xf6')]({'active':![],'countmachineretry':_0x10b49b[_0xc3ca('0x116')],'scheduledat':moment()[_0xc3ca('0xcf')](_0x47ef4d[_0xc3ca('0x124')],_0xc3ca('0xe4'))[_0xc3ca('0x3e')](_0xc3ca('0xbd')),'ContactId':_0x10b49b[_0xc3ca('0xd1')],'ListId':_0x10b49b[_0xc3ca('0xd2')],'VoiceQueueId':_0x10b49b[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x10b49b['CampaignId']||undefined})['catch'](loggerCatch(_0xc3ca('0x125')));_0x5250de({'reschedule':0x1});}}});}}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x31')]=function(_0x497e4d){var _0x3962ce=this[_0xc3ca('0x20')][_0x497e4d[_0xc3ca('0xba')]];var _0x5ef4a8;if(_0x3962ce&&_0x3962ce[_0xc3ca('0x3a')]==='ivr'){delete this[_0xc3ca('0x20')][_0x497e4d[_0xc3ca('0xba')]];this[_0xc3ca('0xf5')](this[_0xc3ca('0xa4')][_0x3962ce[_0xc3ca('0xb9')]]);this[_0xc3ca('0xa4')][_0x3962ce['queue']][_0xc3ca('0x12a')]+=0x1;_0x5ef4a8=new Hangup(_0x3962ce,_0x497e4d);hopperUtils[_0xc3ca('0xd9')](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12b')));hopperUtils[_0xc3ca('0xc0')](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12c')));}if(_0x3962ce&&_0x3962ce[_0xc3ca('0x3a')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x3962ce[_0xc3ca('0xb9')]][_0xc3ca('0x12d')])){delete this[_0xc3ca('0x20')][_0x497e4d[_0xc3ca('0xba')]];this['updateOriginated'](this[_0xc3ca('0x1b')][_0x3962ce[_0xc3ca('0xb9')]]);this[_0xc3ca('0x1b')][_0x3962ce[_0xc3ca('0xb9')]][_0xc3ca('0x10c')]+=0x1;this['voiceQueues'][_0x3962ce['queue']][_0xc3ca('0x10d')]+=0x1;_0x5ef4a8=new Hangup(_0x3962ce,_0x497e4d);_0x5ef4a8[_0xc3ca('0x68')]=0x10;_0x5ef4a8[_0xc3ca('0xc6')]=_0xc3ca('0x12e');_0x5ef4a8[_0xc3ca('0x10f')]=_0xc3ca('0x12f');hopperUtils[_0xc3ca('0xd9')](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12b')));hopperUtils[_0xc3ca('0xc0')](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12c')));}if(_0x3962ce&&_0x3962ce[_0xc3ca('0x3a')]!==_0xc3ca('0xbb')&&!isNotNull(this[_0xc3ca('0x1b')][_0x3962ce[_0xc3ca('0xb9')]]['dialQueueProject'])){delete this[_0xc3ca('0x20')][_0x497e4d[_0xc3ca('0xba')]];this[_0xc3ca('0xf5')](this['voiceQueues'][_0x3962ce[_0xc3ca('0xb9')]]);this[_0xc3ca('0x1b')][_0x3962ce[_0xc3ca('0xb9')]][_0xc3ca('0x130')]+=0x1;_0x5ef4a8=new Hangup(_0x3962ce,_0x497e4d);_0x5ef4a8['state']=0xc;_0x5ef4a8['statedesc']=_0x497e4d[_0xc3ca('0x131')];_0x5ef4a8[_0xc3ca('0x10f')]=_0xc3ca('0x132');hopperUtils[_0xc3ca('0xd9')](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12b')));hopperUtils['moveContactManagedDialer'](_0x5ef4a8)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x12c')));}};Dialer[_0xc3ca('0x83')][_0xc3ca('0xb')]=function(_0x47b2f0){var _0x9fc043=this;if(!_0x9fc043[_0xc3ca('0x25')][_0x47b2f0[_0xc3ca('0x40')]]){_0x9fc043['queuesSummary'][_0x47b2f0[_0xc3ca('0x40')]]={'running':![]};}else if(_0x9fc043[_0xc3ca('0x25')][_0x47b2f0[_0xc3ca('0x40')]]['running']===!![]){return;}else if(_0x9fc043[_0xc3ca('0x25')][_0x47b2f0[_0xc3ca('0x40')]][_0xc3ca('0x133')]===![]){_0x9fc043[_0xc3ca('0x25')][_0x47b2f0['name']]['running']=!![];}var _0x207e8f=_0x9fc043[_0xc3ca('0x1b')][_0x47b2f0[_0xc3ca('0x40')]];var _0x4424a4=_0x207e8f[_0xc3ca('0x62')]!==utils[_0xc3ca('0x75')]['INACTIVE'];var _0x5700a7=utils[_0xc3ca('0x134')](_0x207e8f);_0x207e8f['message']=utils['getQueueCampaignStatusMessage'](_0x207e8f,_0x9fc043[_0xc3ca('0x1d')]);Promise['resolve']()['then'](function(){if(_0x207e8f['message']===utils[_0xc3ca('0x75')]['INACTIVE']){if(_0x4424a4){clearPredictiveAttributes(_0x207e8f);_0x47b2f0[_0xc3ca('0x5b')]=undefined;_0x47b2f0[_0xc3ca('0x22')]=undefined;}if(_0x207e8f[_0xc3ca('0x62')]===utils[_0xc3ca('0x75')][_0xc3ca('0x76')]){_0x47b2f0['available']=0x0;}}else if(_0x207e8f[_0xc3ca('0x62')]===utils[_0xc3ca('0x75')][_0xc3ca('0x135')]&&!_0x5700a7){return _0x9fc043[_0xc3ca('0x8e')](_0x207e8f,!![])[_0xc3ca('0x9a')](function(){return _0x9fc043[_0xc3ca('0x8e')](_0x207e8f,![]);})[_0xc3ca('0x9a')](function(){return _0x9fc043[_0xc3ca('0x136')](_0x207e8f);})[_0xc3ca('0x9d')](function(_0x1437fd){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0xc3ca('0x3d')](_0x1437fd,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x207e8f);});}else{clearPredictiveAttributes(_0x207e8f);}})[_0xc3ca('0x9a')](function(){var _0x577234=_0x47b2f0[_0xc3ca('0x137')](_0x207e8f);if(_0x577234||_0x207e8f[_0xc3ca('0x138')]){_0x207e8f['queueSummaryCountersUpdated']=![];_0x47b2f0[_0xc3ca('0x139')](_0x207e8f);Object[_0xc3ca('0x13a')](_0x207e8f,_0x47b2f0);emitOutboundVoiceQueueSummary(_0x47b2f0);}_0x9fc043[_0xc3ca('0x25')][_0x207e8f[_0xc3ca('0x40')]][_0xc3ca('0x133')]=![];})['catch'](function(_0x3118ff){logger[_0xc3ca('0x5f')](_0xc3ca('0x13b'),util[_0xc3ca('0x3d')](_0x3118ff,{'showHidden':![],'depth':null}));_0x9fc043[_0xc3ca('0x25')][_0x207e8f[_0xc3ca('0x40')]][_0xc3ca('0x133')]=![];});};Dialer['prototype'][_0xc3ca('0x2f')]=_[_0xc3ca('0x13c')](function(){var _0x436c16=_[_0xc3ca('0x13d')](this[_0xc3ca('0x1b')],function(_0x27240e){return _0x27240e['dialPreviewRecallmeReminder'];});var _0x8db997=_['filter'](this[_0xc3ca('0x1c')],function(_0x22bd73){return _0x22bd73[_0xc3ca('0x13e')]&&_0x22bd73[_0xc3ca('0x87')]==='reachable';});if(_0x436c16['length']>0x0&&_0x8db997[_0xc3ca('0x95')]>0x0){return Promise[_0xc3ca('0xa6')]()[_0xc3ca('0x9a')](cmHopper[_0xc3ca('0x13f')](_[_0xc3ca('0x140')](_0x436c16,'id'),previewRecallmeReminderInterval,_[_0xc3ca('0x140')](_0x8db997,'id')))['then'](function(_0x45217f){for(var _0x5dc657=0x0;_0x5dc657<_0x45217f[_0xc3ca('0x95')];_0x5dc657++){var _0x116193=_0x45217f[_0x5dc657][_0xc3ca('0x141')][_0xc3ca('0x40')];if(_0x116193)io['to'](util[_0xc3ca('0x3e')](_0xc3ca('0x142'),_0x116193))[_0xc3ca('0x118')](_0xc3ca('0x143'),{'hopper':_0x45217f[_0x5dc657]});}})[_0xc3ca('0x9d')](function(_0x43b981){logger[_0xc3ca('0x5f')](_0xc3ca('0x144'),_0x43b981);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xc3ca('0x83')]['loopClearZombieChannels']=function(){var _0x1e4ccd=this;setInterval(function(){_0x1e4ccd['clearZombieChannels'](_0x1e4ccd[_0xc3ca('0x20')],_0xc3ca('0x145'));_0x1e4ccd['clearZombieChannels'](_0x1e4ccd[_0xc3ca('0xe7')],_0xc3ca('0x146'));},0x32c8);};Dialer[_0xc3ca('0x83')][_0xc3ca('0x147')]=function(_0x412d43,_0x4a4efb){var _0x1605e1=this;for(var _0x1b412a in _0x412d43){if(typeof _0x412d43[_0x1b412a]!==_0xc3ca('0x148')){this[_0xc3ca('0x19')][_0xc3ca('0x149')](function(){if(!_[_0xc3ca('0xed')](_0x412d43[_0x1b412a])){return ami[_0xc3ca('0x97')]({'action':_0xc3ca('0x87'),'channel':_0x412d43[_0x1b412a][_0xc3ca('0xe8')]})[_0xc3ca('0x9d')](function(_0x39ec90){if(_0x39ec90['message']===_0xc3ca('0x14a')){setTimeout(function(){if(_0x412d43[_0x1b412a]&&_0x412d43[_0x1b412a][_0xc3ca('0x3a')]!=='ivr'){_0x1605e1['updateOriginated'](_0x1605e1[_0xc3ca('0x1b')][_0x412d43[_0x1b412a]['queue']]);logger[_0xc3ca('0x5f')](_0xc3ca('0x14b'),_0x4a4efb,_0x1b412a,_0x412d43[_0x1b412a][_0xc3ca('0xb9')]);delete _0x412d43[_0x1b412a];}if(_0x412d43[_0x1b412a]&&_0x412d43[_0x1b412a][_0xc3ca('0x3a')]===_0xc3ca('0xbb')){_0x1605e1[_0xc3ca('0xf5')](_0x1605e1[_0xc3ca('0xa4')][_0x412d43[_0x1b412a][_0xc3ca('0xb9')]]);logger[_0xc3ca('0x5f')](_0xc3ca('0x14c'),_0x4a4efb,_0x1b412a,_0x412d43[_0x1b412a]['queue']);delete _0x412d43[_0x1b412a];}},0x2328);}});}});}}};Dialer['prototype'][_0xc3ca('0x14d')]=function(_0x2cf342){return Promise['resolve']()['then'](voiceQueueRt[_0xc3ca('0x14d')](_0x2cf342))['catch'](loggerCatch(_0xc3ca('0x14e')));};Dialer[_0xc3ca('0x83')][_0xc3ca('0xf5')]=function(_0x379632){if(!_[_0xc3ca('0x39')](_0x379632)&&_0x379632!==null){if(typeof _0x379632[_0xc3ca('0x7b')]!==_0xc3ca('0x148')){if(_0x379632[_0xc3ca('0x7b')]>0x0){_0x379632['originated']-=0x1;}else{logger[_0xc3ca('0x5f')](_0xc3ca('0x14f'));}}}else{logger[_0xc3ca('0x5f')](_0xc3ca('0x150'));}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x151')]=function(_0x9390da,_0x44773a){var _0x3bffaf=this;return function(_0x314f3b){_0x3bffaf[_0xc3ca('0xf5')](_0x44773a);logger[_0xc3ca('0x5f')](_0x9390da,util[_0xc3ca('0x3d')](_0x314f3b,{'showHidden':![],'depth':null}));};};Dialer[_0xc3ca('0x83')][_0xc3ca('0x152')]=function(_0x4a6159,_0x3e67db,_0x596ef2){var _0x4dcf6f={'state':0x19,'statedesc':_0xc3ca('0x153')};this[_0xc3ca('0xf5')](_0x3e67db);this[_0xc3ca('0x111')](_[_0xc3ca('0x58')](_0x4dcf6f,_['pick'](_0x596ef2,[_0xc3ca('0xd1'),'ListId','UserId',_0xc3ca('0xd3'),'CampaignId'])),_0xc3ca('0x154'),_0xc3ca('0x155'));logger[_0xc3ca('0x5f')](_0x4a6159);};Dialer[_0xc3ca('0x83')][_0xc3ca('0x111')]=function(_0x15cbeb,_0x794c0a,_0x231a1c){hopperUtils[_0xc3ca('0xd9')](_0x15cbeb)['catch'](loggerCatch(_0x794c0a));hopperUtils[_0xc3ca('0xc0')](_0x15cbeb)['catch'](loggerCatch(_0x231a1c));};Dialer[_0xc3ca('0x83')]['queueCallerAbandonCreateState']=function(_0x13e107,_0x56e537){hopperUtils[_0xc3ca('0xd9')](_0x13e107)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x156')));if(_0x56e537==0x0){hopperUtils[_0xc3ca('0xc0')](_0x13e107)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x157')));}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x144')]=function(_0xfa2119){return Promise['resolve']()[_0xc3ca('0x9a')](cmHopper['handlePreviewRecallNotifications'](_0xfa2119['id'],previewRecallmeReminderInterval))[_0xc3ca('0x9a')](function(_0x207f84){for(var _0x5a4cb9=0x0;_0x5a4cb9<_0x207f84[_0xc3ca('0x95')];_0x5a4cb9++){var _0x1e8248=_0x207f84[_0x5a4cb9][_0xc3ca('0x141')]['name'];if(_0x1e8248)io['to'](util[_0xc3ca('0x3e')](_0xc3ca('0x142'),_0x1e8248))[_0xc3ca('0x118')](_0xc3ca('0x143'),{'hopper':_0x207f84[_0x5a4cb9]});}})['catch'](function(){});};Dialer[_0xc3ca('0x83')][_0xc3ca('0x158')]=function(_0x3d3dc9){var _0x18bae2=this;return function(){_0x18bae2[_0xc3ca('0x159')](_0x3d3dc9);};};Dialer['prototype'][_0xc3ca('0x15a')]=function(_0x174980,_0x51dd11){var _0x36560f=this;var _0x36a0e4=uuid['v4']();this['actions'][_0x36a0e4]=new Action(_0x174980,_0x51dd11,_0x36a0e4);return new Promise(function(_0x382b33,_0x2d9d13){if(_['isUndefined'](_0x174980)&&typeof _0x174980!=='object'){return _0x2d9d13(msgResponse(_0xc3ca('0x15b'),_0xc3ca('0x8f'),_0xc3ca('0x15c')));}if(_[_0xc3ca('0x39')](_0x51dd11[_0xc3ca('0x15d')])||_0x51dd11['phone']===null){return _0x2d9d13(msgResponse('originate',_0xc3ca('0x8f'),_0xc3ca('0x15e')));}var _0x42d5b4={'XMD-CALLERID':_0x36560f[_0xc3ca('0xe7')][_0x36a0e4][_0xc3ca('0x15f')](),'XMD-AGI':_0x174980[_0xc3ca('0x12d')]?util[_0xc3ca('0x3e')](_0xc3ca('0x160'),ipAgi,_0x174980[_0xc3ca('0x12d')]):_0xc3ca('0x161'),'XMD-AGIAFTER':_0x174980['dialQueueProject2']?util['format'](_0xc3ca('0x160'),ipAgi,_0x174980[_0xc3ca('0x162')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x174980)?util[_0xc3ca('0x3e')]('\x22%s,%s%s,,,%s\x22',_0x174980[_0xc3ca('0x40')],_0x174980[_0xc3ca('0x163')]||'',_0x174980['dialAgiAfterHangupAgent']?'c':'',_0x174980[_0xc3ca('0xc4')]||0x3):_0xc3ca('0x161'),'XMD-CONTACTID':_0x51dd11['ContactId'],'XMD-CDRTYPE':_0xc3ca('0x7'),'CALLERID(all)':_0x36560f[_0xc3ca('0xe7')][_0x36a0e4]['getCaller'](),'XMD-AMD':_0x174980[_0xc3ca('0x109')]?_0xc3ca('0x135'):_0xc3ca('0x161'),'XMD-DESTINATION':_0xc3ca('0x164')};if(_0x174980[_0xc3ca('0x109')]){_0x42d5b4['XMD-AMDINITIALSILENCE']=_0x174980[_0xc3ca('0x165')]||0x9c4;_0x42d5b4[_0xc3ca('0x166')]=_0x174980[_0xc3ca('0x167')]||0x5dc;_0x42d5b4[_0xc3ca('0x168')]=_0x174980[_0xc3ca('0x169')]||0x320;_0x42d5b4[_0xc3ca('0x16a')]=_0x174980[_0xc3ca('0x16b')]||0x1388;_0x42d5b4['XMD-AMDMINWORDLENGTH']=_0x174980[_0xc3ca('0x16c')]||0x64;_0x42d5b4[_0xc3ca('0x16d')]=_0x174980[_0xc3ca('0x16e')]||0x32;_0x42d5b4['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x174980[_0xc3ca('0x16f')]||0x3;_0x42d5b4[_0xc3ca('0x170')]=_0x174980[_0xc3ca('0x171')]||0x100;_0x42d5b4[_0xc3ca('0x172')]=_0x174980[_0xc3ca('0x173')]||0x1388;}if(utils[_0xc3ca('0x174')](_0x174980)){_0x42d5b4[_0xc3ca('0x175')]=_0x51dd11[_0xc3ca('0xd3')];}else{_0x42d5b4['XMD-CAMPAIGNID']=_0x51dd11[_0xc3ca('0xd4')];}for(var _0x551f04 in _0x51dd11[_0xc3ca('0x176')]){if(typeof _0x51dd11[_0xc3ca('0x176')][_0x551f04]!==_0xc3ca('0x148')){if(isNotNull(_0x51dd11[_0xc3ca('0x176')][_0x551f04])&&_0x551f04!=='id'&&_0x551f04!==_0xc3ca('0x177')&&_0x551f04!==_0xc3ca('0x178')&&_0x551f04!==_0xc3ca('0x179')){_0x42d5b4[util[_0xc3ca('0x3e')]('%s%s','XMD-',_[_0xc3ca('0x17a')](_0x551f04))]=_0x51dd11[_0xc3ca('0x176')][_0x551f04];}}}var _0x22fa15=_0x36560f['isTrunkReachable'](_0x174980[_0xc3ca('0x8a')])?utils[_0xc3ca('0x17b')](_0x174980['Trunk'][_0xc3ca('0x17c')],_0x174980['dialOriginateCallerIdName'],_0x174980[_0xc3ca('0x17d')]>0x0?utils[_0xc3ca('0x17e')](_0x174980['dialOriginateCallerIdNumber'],_0x174980['dialRandomLastDigitCallerIdNumber']):_0x174980[_0xc3ca('0x17f')]):utils[_0xc3ca('0x17b')](_[_0xc3ca('0xed')](_0x174980[_0xc3ca('0x8b')])?_0x174980['Trunk'][_0xc3ca('0x17c')]:_0x174980['TrunkBackup'][_0xc3ca('0x17c')],_0x174980[_0xc3ca('0x180')],_0x174980[_0xc3ca('0x17d')]>0x0?utils['getCallerIdRandom'](_0x174980[_0xc3ca('0x17f')],_0x174980['dialRandomLastDigitCallerIdNumber']):_0x174980['dialOriginateCallerIdNumber']);if(_0x22fa15){_0x42d5b4[_0xc3ca('0x181')]=_0x36560f['actions'][_0x36a0e4][_0xc3ca('0x182')]=utils['extractCalleridName'](_0x22fa15);_0x42d5b4[_0xc3ca('0x183')]=_0x51dd11['phone'];}_0x174980['variables']=_0x42d5b4;return ami[_0xc3ca('0x97')]({'actionid':_0x36a0e4,'action':_0xc3ca('0x15b'),'channel':_0x36560f['isTrunkReachable'](_0x174980[_0xc3ca('0x8a')])?util[_0xc3ca('0x3e')](_0xc3ca('0x184'),_0x174980[_0xc3ca('0x8a')][_0xc3ca('0x40')],isNotNull(_0x174980['dialPrefix'])?_0x174980['dialPrefix'][_0xc3ca('0x185')]()||'':'',_0x174980[_0xc3ca('0x186')]>0x0?_0x51dd11[_0xc3ca('0x15d')][_0xc3ca('0x187')](_0x174980[_0xc3ca('0x186')]):_0x51dd11[_0xc3ca('0x15d')]):util[_0xc3ca('0x3e')](_0xc3ca('0x184'),_[_0xc3ca('0xed')](_0x174980[_0xc3ca('0x8b')])?_0x174980[_0xc3ca('0x8a')]['name']:_0x174980[_0xc3ca('0x8b')][_0xc3ca('0x40')],isNotNull(_0x174980[_0xc3ca('0x188')])?_0x174980['dialPrefix'][_0xc3ca('0x185')]()||'':'',_0x174980['dialCutDigit']>0x0?_0x51dd11[_0xc3ca('0x15d')][_0xc3ca('0x187')](_0x174980[_0xc3ca('0x186')]):_0x51dd11[_0xc3ca('0x15d')]),'callerid':_0x22fa15,'Exten':_0xc3ca('0x164'),'Context':_0xc3ca('0x189'),'Priority':'1','variable':_0x42d5b4,'timeout':(_0x174980[_0xc3ca('0x18a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x36a0e4})['then'](function(_0x2fc09b){return _0x382b33(_0x2fc09b);})['catch'](function(_0x854c78){_0x174980[_0xc3ca('0x18b')]+=0x1;var _0x5ee80b=new History(_0x36560f[_0xc3ca('0xe7')][_0x36a0e4]);logger[_0xc3ca('0x5f')](util['format'](_0xc3ca('0x18c'),JSON[_0xc3ca('0x6e')](_0x854c78)));_0x5ee80b[_0xc3ca('0x68')]=0xe;_0x5ee80b[_0xc3ca('0xc6')]=_0xc3ca('0x18d');_0x5ee80b['starttime']=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));_0x5ee80b[_0xc3ca('0x69')]=_0x5ee80b[_0xc3ca('0x6a')];hopperUtils[_0xc3ca('0xd9')](_0x5ee80b)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x18e')));_0x36560f['moveContactManagedDialer'](_0x5ee80b)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x18e')))[_0xc3ca('0xf4')](function(){delete _0x36560f[_0xc3ca('0xe7')][_0x36a0e4];return _0x2d9d13(msgResponse('originate','Error',_0xc3ca('0x18f')));});});});};Dialer[_0xc3ca('0x83')][_0xc3ca('0x190')]=function(_0x549432,_0x180689,_0x4e0e83){var _0x1e29ca=new History(_0x180689);if(_0x1e29ca[_0xc3ca('0x11b')]+_0x1e29ca[_0xc3ca('0x11c')]+_0x1e29ca[_0xc3ca('0x11d')]+_0x1e29ca[_0xc3ca('0x11e')]+_0x1e29ca[_0xc3ca('0xc9')]+_0x1e29ca['countabandonedretry']+_0x1e29ca['countmachineretry']+_0x1e29ca[_0xc3ca('0x11f')]>=_0x4e0e83[_0xc3ca('0x128')]-0x1){return!![];}switch(_0x549432){case 0x3:if(_0x1e29ca[_0xc3ca('0x11d')]>=_0x4e0e83[_0xc3ca('0x191')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1e29ca['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83[_0xc3ca('0x192')],_0xc3ca('0xe4'))[_0xc3ca('0x3e')](_0xc3ca('0xbd')),'ContactId':_0x1e29ca[_0xc3ca('0xd1')],'ListId':_0x1e29ca['ListId'],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1e29ca[_0xc3ca('0x11b')]>=_0x4e0e83[_0xc3ca('0x193')]-0x1){return!![];}hopperUtils[_0xc3ca('0xf6')]({'active':![],'countbusyretry':_0x1e29ca[_0xc3ca('0x11b')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83['dialBusyRetryFrequency'],_0xc3ca('0xe4'))['format'](_0xc3ca('0xbd')),'ContactId':_0x1e29ca[_0xc3ca('0xd1')],'ListId':_0x1e29ca[_0xc3ca('0xd2')],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x194')));break;case 0x8:if(_0x1e29ca[_0xc3ca('0x11c')]>=_0x4e0e83[_0xc3ca('0x195')]-0x1){return!![];}hopperUtils[_0xc3ca('0xf6')]({'active':![],'countcongestionretry':_0x1e29ca[_0xc3ca('0x11c')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83[_0xc3ca('0x196')],'minutes')['format'](_0xc3ca('0xbd')),'ContactId':_0x1e29ca['ContactId'],'ListId':_0x1e29ca[_0xc3ca('0xd2')],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch(_0xc3ca('0x197')));break;case 0x0:if(_0x1e29ca[_0xc3ca('0x11e')]>=_0x4e0e83[_0xc3ca('0x198')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1e29ca[_0xc3ca('0x11e')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83[_0xc3ca('0x199')],_0xc3ca('0xe4'))[_0xc3ca('0x3e')](_0xc3ca('0xbd')),'ContactId':_0x1e29ca['ContactId'],'ListId':_0x1e29ca[_0xc3ca('0xd2')],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca['CampaignId']||undefined})['catch'](loggerCatch(_0xc3ca('0x19a')));}break;case 0xa:if(_0x1e29ca[_0xc3ca('0xc9')]>=_0x4e0e83[_0xc3ca('0xcd')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1e29ca[_0xc3ca('0xc9')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83[_0xc3ca('0xd0')],'minutes')[_0xc3ca('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e29ca[_0xc3ca('0xd1')],'ListId':_0x1e29ca[_0xc3ca('0xd2')],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch(_0xc3ca('0xd5')));break;case 0xb:if(_0x1e29ca[_0xc3ca('0xe0')]>=_0x4e0e83[_0xc3ca('0x19b')]-0x1){return!![];}hopperUtils[_0xc3ca('0xf6')]({'active':![],'countabandonedretry':_0x1e29ca[_0xc3ca('0xe0')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83[_0xc3ca('0xe1')],'minutes')['format'](_0xc3ca('0xbd')),'ContactId':_0x1e29ca[_0xc3ca('0xd1')],'ListId':_0x1e29ca['ListId'],'VoiceQueueId':_0x1e29ca['VoiceQueueId']||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0xe5')));break;case 0x13:if(_0x1e29ca[_0xc3ca('0x116')]>=_0x4e0e83['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0xc3ca('0xf6')]({'active':![],'countmachineretry':_0x1e29ca['countmachineretry']+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83['dialMachineRetryFrequency'],_0xc3ca('0xe4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e29ca[_0xc3ca('0xd1')],'ListId':_0x1e29ca['ListId'],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})['catch'](loggerCatch(_0xc3ca('0x125')));break;case 0x14:if(_0x1e29ca[_0xc3ca('0x11f')]>=_0x4e0e83[_0xc3ca('0x19c')]-0x1){return!![];}hopperUtils[_0xc3ca('0xf6')]({'active':![],'countagentrejectretry':_0x1e29ca[_0xc3ca('0x11f')]+=0x1,'scheduledat':moment()[_0xc3ca('0xcf')](_0x4e0e83['dialAgentRejectRetryFrequency'],_0xc3ca('0xe4'))['format'](_0xc3ca('0xbd')),'ContactId':_0x1e29ca['ContactId'],'ListId':_0x1e29ca[_0xc3ca('0xd2')],'VoiceQueueId':_0x1e29ca[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x1e29ca[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xc3ca('0x83')]['callProgressDetecting']=function(_0x46259d,_0x5ebfee,_0x4cb1d8){var _0x42f5f5=this;var _0x4af411=new History(_0x46259d);var _0x5577e4=![];var _0x1a06a7;var _0x3894a8;return new Promise(function(_0x31c1ec,_0x2567e2){if(_[_0xc3ca('0x39')](_0x5ebfee)&&typeof _0x5ebfee!=='object'){return _0x2567e2(msgResponse('[callProgressDetecting]',_0xc3ca('0x8f'),_0xc3ca('0x19d')));}if(_[_0xc3ca('0x39')](_0x4cb1d8)&&typeof _0x4cb1d8!==_0xc3ca('0x19e')){return _0x2567e2(msgResponse(_0xc3ca('0x19f'),'Failure',_0xc3ca('0x1a0')));}hopperUtils[_0xc3ca('0xe2')](_0x4af411,_0x4cb1d8[_0xc3ca('0xbe')],_0x5ebfee)[_0xc3ca('0x9a')](function(_0x251c7f){if(_0x251c7f['additional']==0x1)_0x5577e4=!![];switch(_0x4cb1d8[_0xc3ca('0xbe')]){case'0':_0x5ebfee[_0xc3ca('0x1a1')]+=0x1;_0x4af411['state']=0x0;_0x4af411['statedesc']=_0xc3ca('0x1a2');_0x4af411[_0xc3ca('0x11e')]+=0x1;_0x4af411[_0xc3ca('0xca')]+=0x1;ami[_0xc3ca('0x118')](_0xc3ca('0x1a3'),ut[_0xc3ca('0x119')](_0x46259d,_0xc3ca('0x1a4')));_0x1a06a7=_0x5ebfee[_0xc3ca('0x199')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x11a')));if(_0x42f5f5[_0xc3ca('0x190')](0x0,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411[_0xc3ca('0x11e')]>=_0x5ebfee['dialNoSuchNumberMaxRetry']){_0x42f5f5['createStateFinal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1a5'));}else{_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1a5'));}}break;case'3':_0x5ebfee[_0xc3ca('0x1a6')]+=0x1;_0x4af411[_0xc3ca('0x68')]=0x3;_0x4af411[_0xc3ca('0xc6')]='NoAnswer';_0x4af411[_0xc3ca('0x11d')]+=0x1;_0x4af411['countglobal']+=0x1;var _0x53c19f=ut[_0xc3ca('0x1a7')](_0x46259d,_0x5ebfee);ami['emit']('custom:agentnoanswer',_0x53c19f);_0x1a06a7=_0x5ebfee[_0xc3ca('0x192')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xd9')](_0x4af411)['catch'](loggerCatch(_0xc3ca('0x1a8')));if(_0x42f5f5['checkRetriveMax'](0x3,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411[_0xc3ca('0x11d')]>=_0x5ebfee[_0xc3ca('0x191')]){_0x42f5f5[_0xc3ca('0x122')](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1a9'));}else{_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5ebfee[_0xc3ca('0x1aa')]+=0x1;_0x4af411[_0xc3ca('0x68')]=0x5;_0x4af411[_0xc3ca('0xc6')]=_0xc3ca('0x1ab');_0x4af411['countbusyretry']+=0x1;_0x4af411[_0xc3ca('0xca')]+=0x1;ami['emit'](_0xc3ca('0x1ac'),ut[_0xc3ca('0x119')](_0x46259d,_0xc3ca('0x1ad')));_0x1a06a7=_0x5ebfee[_0xc3ca('0x1ae')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x1af')));if(_0x42f5f5[_0xc3ca('0x190')](0x5,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411['countbusyretry']>=_0x5ebfee['dialBusyMaxRetry']){_0x42f5f5[_0xc3ca('0x122')](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b0'));}else{_0x42f5f5[_0xc3ca('0x120')](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b0'));}}break;case'8':_0x5ebfee['outboundCongestionCallsDay']+=0x1;_0x4af411[_0xc3ca('0x68')]=0x8;_0x4af411[_0xc3ca('0xc6')]=_0xc3ca('0x1b1');_0x4af411[_0xc3ca('0x11c')]+=0x1;_0x4af411['countglobal']+=0x1;_0x1a06a7=_0x5ebfee['dialCongestionRetryFrequency'];_0x3894a8=_0x5ebfee['callAdditionalPhoneAfterMin'];ami[_0xc3ca('0x118')](_0xc3ca('0x1b2'),ut['buildObj'](_0x46259d,_0xc3ca('0x1b3')));hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x42f5f5[_0xc3ca('0x190')](0x8,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411[_0xc3ca('0x11c')]>=_0x5ebfee[_0xc3ca('0x195')]){_0x42f5f5[_0xc3ca('0x122')](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b4'));}else{_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b4'));}}break;case'11':_0x5ebfee['outboundAbandonedCallsDay']+=0x1;_0x4af411[_0xc3ca('0x68')]=0xb;_0x4af411[_0xc3ca('0xc6')]=_0xc3ca('0xde');_0x4af411[_0xc3ca('0xe0')]+=0x1;_0x4af411[_0xc3ca('0xca')]+=0x1;_0x1a06a7=_0x5ebfee[_0xc3ca('0xe1')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0xe6')));if(_0x42f5f5['checkRetriveMax'](0xb,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411[_0xc3ca('0xe0')]>=_0x5ebfee[_0xc3ca('0x19b')]){_0x42f5f5['createStateFinal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b5'));}else{_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1b5'));}}break;case'20':_0x5ebfee[_0xc3ca('0x1b6')]+=0x1;_0x4af411[_0xc3ca('0x68')]=0x14;_0x4af411['statedesc']='AgentReject';_0x4af411[_0xc3ca('0x11f')]+=0x1;_0x4af411[_0xc3ca('0xca')]+=0x1;_0x1a06a7=_0x5ebfee[_0xc3ca('0x1b7')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];ami[_0xc3ca('0x118')](_0xc3ca('0x1b8'),ut[_0xc3ca('0x119')](_0x46259d,'agentreject'));hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x1b9')));if(_0x42f5f5[_0xc3ca('0x190')](0x14,_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411[_0xc3ca('0x11f')]>=_0x5ebfee[_0xc3ca('0x19c')]){_0x42f5f5['createStateFinal'](_0x4af411,_0x31c1ec,_0x2567e2,_0xc3ca('0x1ba'));}else{_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,'reason\x2020\x20agentreject');}}break;default:_0x5ebfee[_0xc3ca('0x130')]+=0x1;_0x4af411[_0xc3ca('0x68')]=0xc;_0x4af411[_0xc3ca('0xc6')]=_0x4cb1d8['reason'];_0x1a06a7=_0x5ebfee[_0xc3ca('0x1b7')];_0x3894a8=_0x5ebfee[_0xc3ca('0xcb')];hopperUtils[_0xc3ca('0xd9')](_0x4af411)[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x1bb')));if(_0x42f5f5[_0xc3ca('0x190')](_0x4cb1d8[_0xc3ca('0xbe')],_0x46259d,_0x5ebfee)&&!_0x5577e4){if(_0x4af411['countbusyretry']+_0x4af411[_0xc3ca('0x11c')]+_0x4af411[_0xc3ca('0x11d')]+_0x4af411[_0xc3ca('0x11e')]+_0x4af411[_0xc3ca('0xc9')]+_0x4af411['countabandonedretry']+_0x4af411[_0xc3ca('0x116')]+_0x4af411['countagentrejectretry']>=_0x5ebfee[_0xc3ca('0x128')]){_0x42f5f5['stateGlobal'](_0x4af411,_0x31c1ec,_0x2567e2,_0x4cb1d8[_0xc3ca('0xbe')]);}else{_0x42f5f5['createStateFinal'](_0x4af411,_0x31c1ec,_0x2567e2,_0x4cb1d8[_0xc3ca('0xbe')]);}}}})['then'](function(){if(_0x5577e4){hopperUtils[_0xc3ca('0xdb')](_0x4af411,_0x1a06a7,_0x3894a8)[_0xc3ca('0x9a')](function(){return _0x31c1ec(0x1);});}});});};Dialer[_0xc3ca('0x83')][_0xc3ca('0x120')]=function(_0x4f1e97,_0x3bb271,_0x43e71b,_0x3f85db){var _0x4e56ed=new Final(_0x4f1e97);_0x4e56ed[_0xc3ca('0x68')]=0xf;_0x4e56ed['statedesc']=_0xc3ca('0x1bc');this[_0xc3ca('0x122')](_0x4e56ed,_0x3bb271,_0x43e71b,_0x3f85db);};Dialer[_0xc3ca('0x83')][_0xc3ca('0x122')]=function(_0x39560e,_0x212233,_0x328698,_0xfc7f4f){hopperUtils[_0xc3ca('0xc0')](_0x39560e)[_0xc3ca('0x9a')](function(){return _0x212233(msgResponse(_0xc3ca('0x19f'),'Success',_0xfc7f4f));})[_0xc3ca('0x9d')](function(){return _0x328698(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0xc3ca('0x9')]=function(_0x510faf){var _0x3ef15b=_0x510faf[_0xc3ca('0x1bd')]/0x64;var _0x19e0ae=_0x510faf[_0xc3ca('0xc5')]/(_0x510faf['outboundDropCallsDayTimeout']+_0x510faf[_0xc3ca('0x10c')]);var _0x2366d4=Math[_0xc3ca('0x1be')](_0x510faf[_0xc3ca('0x1bf')]*(_0x510faf[_0xc3ca('0x1c0')]/0x64));var _0x4fa393=Math[_0xc3ca('0x1be')](_0x510faf[_0xc3ca('0x1bf')]*(_0x510faf[_0xc3ca('0x1c1')]/0x64));var _0x585236=_0x510faf[_0xc3ca('0x1c2')]+_0x510faf[_0xc3ca('0x1c3')];var _0x23abdc=Math['floor'](_0x510faf[_0xc3ca('0x1c4')]*_0x510faf[_0xc3ca('0x57')]*_0x510faf[_0xc3ca('0x1c5')]*_0x510faf[_0xc3ca('0x1c6')]);if(_['isUndefined'](_0x510faf[_0xc3ca('0x22')])){if(!_[_0xc3ca('0x39')](_0x510faf[_0xc3ca('0x5b')])){_0x510faf[_0xc3ca('0x5b')]=undefined;loggerPredictive[_0xc3ca('0x5f')]('[startMethodPredictive][StartProgressive]',_0xc3ca('0x1c7'));}if(!_[_0xc3ca('0x39')](_0x510faf[_0xc3ca('0x5d')])){loggerPredictive[_0xc3ca('0x5f')]('[startMethodPredictive][StartProgressive]',_0xc3ca('0x1c8'));clearInterval(_0x510faf[_0xc3ca('0x5d')]);_0x510faf[_0xc3ca('0x5d')]=undefined;}_0x510faf[_0xc3ca('0x22')]=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));loggerPredictive[_0xc3ca('0x43')](_0x510faf[_0xc3ca('0x40')],_0xc3ca('0x1c9'),_0x510faf[_0xc3ca('0x22')]);return this['handlePower'](_0x510faf,0x1);}else if(ifInterval(_0x510faf[_0xc3ca('0x1ca')],_0x510faf[_0xc3ca('0x22')])){loggerPredictiveCalls[_0xc3ca('0x43')]('[startMethodPredictive][StartProgressive][Loop]',_0x510faf['startProgressive'],_0x510faf[_0xc3ca('0x40')]);_0x510faf[_0xc3ca('0x1c4')]=0x0;_0x510faf[_0xc3ca('0x1cb')]=0x0;return this['handlePower'](_0x510faf,0x1);}else if(_0x3ef15b<_0x19e0ae&&_0x510faf[_0xc3ca('0x1cc')]===_0xc3ca('0x1cd')){clearPredictiveAttributes(_0x510faf);loggerPredictive['info'](_0xc3ca('0x1ce'),_0xc3ca('0x1cf'),_0x19e0ae,_0xc3ca('0x22'),_0x510faf[_0xc3ca('0x40')]);}else if(_0x23abdc<_0x510faf[_0xc3ca('0x1cb')]&&_0x510faf[_0xc3ca('0x1cc')]===_0xc3ca('0x1cd')){clearPredictiveAttributes(_0x510faf);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x1d0'),_0xc3ca('0x1d1'),_0x23abdc,_0xc3ca('0x1d2'),_0x510faf[_0xc3ca('0x1cb')],_0xc3ca('0x22'),_0x510faf['name']);}else if(!ifInterval(_0x510faf[_0xc3ca('0x1ca')],_0x510faf['startProgressive'])&&_[_0xc3ca('0x39')](_0x510faf[_0xc3ca('0x5b')])&&!_[_0xc3ca('0x39')](_0x510faf['startProgressive'])){_0x510faf['startPredictive']=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));loggerPredictive[_0xc3ca('0x43')](_0x510faf[_0xc3ca('0x40')],_0xc3ca('0x1d3'),_0x510faf[_0xc3ca('0x5b')]);return hopperUtils['avgHandleTime'](_0x510faf[_0xc3ca('0x1ca')])[_0xc3ca('0x9a')](this[_0xc3ca('0x1d4')](_0x510faf))[_0xc3ca('0x9a')](mergeDataErlangB(_0x510faf))['then'](this[_0xc3ca('0x1d5')](_0x510faf))[_0xc3ca('0x9d')](loggerCatchPredictive(_0xc3ca('0x1d6'),_0x510faf));}else if(!ifInterval(_0x510faf[_0xc3ca('0x1ca')],_0x510faf[_0xc3ca('0x5b')])){_0x510faf[_0xc3ca('0x1cb')]=0x0;_0x510faf[_0xc3ca('0x5b')]=moment()[_0xc3ca('0x3e')](_0xc3ca('0xbd'));loggerPredictive[_0xc3ca('0x43')](_0x510faf[_0xc3ca('0x40')],_0xc3ca('0x1d7'),_0x510faf[_0xc3ca('0x5b')]);clearInterval(_0x510faf[_0xc3ca('0x5d')]);_0x510faf[_0xc3ca('0x5d')]=undefined;return hopperUtils[_0xc3ca('0x1d8')](_0x510faf[_0xc3ca('0x1ca')])['then'](this[_0xc3ca('0x1d4')](_0x510faf))['then'](mergeDataErlangB(_0x510faf))[_0xc3ca('0x9a')](this[_0xc3ca('0x1d5')](_0x510faf))[_0xc3ca('0x9d')](loggerCatchPredictive(_0xc3ca('0x1d9'),_0x510faf));}else if(_0x510faf[_0xc3ca('0x1bf')]&&_0x585236<_0x510faf['predictiveIntervalAvailable']-_0x4fa393){clearPredictiveAttributes(_0x510faf);loggerPredictive[_0xc3ca('0x43')](_0x510faf[_0xc3ca('0x40')],_0xc3ca('0x1da'),_0x585236,_0xc3ca('0x1db'),_0x510faf['predictiveIntervalAvailable'],'-',_0x4fa393,'=',_0x510faf[_0xc3ca('0x1bf')]-_0x4fa393,')');}else if(_0x510faf[_0xc3ca('0x1bf')]&&_0x585236>_0x510faf[_0xc3ca('0x1bf')]+_0x2366d4){clearPredictiveAttributes(_0x510faf);loggerPredictive[_0xc3ca('0x43')](_0x510faf['name'],_0xc3ca('0x1da'),_0x585236,_0xc3ca('0x1dc'),_0x510faf[_0xc3ca('0x1bf')],'+',_0x2366d4,'=',_0x510faf[_0xc3ca('0x1bf')]+_0x2366d4,')');}return Promise[_0xc3ca('0xa6')]();};Dialer[_0xc3ca('0x83')][_0xc3ca('0x1d4')]=function(_0xb1551a){var _0x8c3d01=this;return function(_0x116f12){return new Promise(function(_0x5213f4,_0x2da989){_[_0xc3ca('0x58')](_0xb1551a,_0x116f12[0x0]);if(checkGetDataPredictive(_0x116f12[0x0])){var _0x5cddb2=_0xb1551a['predictiveIntervalAvailable']=_0xb1551a[_0xc3ca('0x1c3')]+_0xb1551a[_0xc3ca('0x1c2')];var _0x2dc419=_0xb1551a[_0xc3ca('0x1ca')]*0x3c;var _0x47a288=_0x116f12[0x0][_0xc3ca('0x4d')]+_0x116f12[0x0][_0xc3ca('0x4b')];var _0x1e925f=(_0x116f12[0x0]['predictiveIntervalAnsweredCalls']+_0x116f12[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x116f12[0x0][_0xc3ca('0xdc')])/_0x116f12[0x0][_0xc3ca('0x45')];_0xb1551a[_0xc3ca('0x1c5')]=_0x1e925f>0x0?_0x1e925f:0x1;switch(_0xb1551a['dialPredictiveOptimization']){case _0xc3ca('0x1cd'):var _0x41736a=_0xb1551a['dialPredictiveOptimizationPercentage']/0x64;return _0x8c3d01[_0xc3ca('0x1dd')](_0x5cddb2,_0x2dc419,_0x47a288,_0x1e925f,_0x41736a)[_0xc3ca('0x9a')](function(_0x2c2449){return _0x5213f4(_0x2c2449);});case _0xc3ca('0x1de'):var _0x460819=_0xb1551a[_0xc3ca('0x1bd')]/0x64;return _0x8c3d01[_0xc3ca('0x1df')](_0x5cddb2,_0x2dc419,_0x47a288,_0x1e925f,_0x460819)[_0xc3ca('0x9a')](function(_0x49cd5d){return _0x5213f4(_0x49cd5d);});default:return _0x2da989(msgResponse(_0xc3ca('0x1e0'),_0xc3ca('0x8f'),'Unknown\x20Predictive'));}}else{return _0x2da989(msgResponse(_0xc3ca('0x1e0'),_0xc3ca('0x8f'),_0xc3ca('0x1e1')));}});};};Dialer[_0xc3ca('0x83')][_0xc3ca('0x1e2')]=function(_0x33e736){var _0x125a06=this;return function(_0x270b5e){return new Promise(function(_0x456b61,_0x3c3e02){_['merge'](_0x33e736,_0x270b5e[0x0]);if(checkGetDataPredictive(_0x270b5e[0x0])){loggerPredictive[_0xc3ca('0x43')](JSON['stringify'](_0x270b5e[0x0]));if(_0x33e736[_0xc3ca('0x1cc')]===_0xc3ca('0x1cd')){return _0x125a06[_0xc3ca('0x14d')](_0x33e736['id'])[_0xc3ca('0x9a')](function(_0x3f56d5){var _0x409571=_0x33e736[_0xc3ca('0x1e3')]-_0x3f56d5[0x0][_0xc3ca('0x1e4')];var _0x2bfcfd=_0x33e736[_0xc3ca('0x1ca')]*0x3c;var _0x2aa034=_0x270b5e[0x0][_0xc3ca('0x4d')]+_0x270b5e[0x0][_0xc3ca('0x4b')];var _0x192728=(_0x270b5e[0x0][_0xc3ca('0x47')]+_0x270b5e[0x0][_0xc3ca('0x49')]+_0x270b5e[0x0][_0xc3ca('0xdc')])/_0x270b5e[0x0][_0xc3ca('0x45')];var _0x31d2f0=_0x33e736[_0xc3ca('0x1bd')]/0x64;_0x33e736[_0xc3ca('0x1e5')]=_0x3f56d5[0x0][_0xc3ca('0x1e4')]||0x0;_0x33e736['predictiveIntervalHitRate']=_0x192728>0x0?_0x192728:0x1;return _0x125a06[_0xc3ca('0x1dd')](_0x409571,_0x2bfcfd,_0x2aa034,_0x192728,_0x31d2f0);})[_0xc3ca('0x9a')](function(_0x20dcdc){return _0x456b61(_0x20dcdc);})[_0xc3ca('0x9d')](function(_0x2870b1){return _0x3c3e02(msgResponse(_0xc3ca('0x1e6'),_0xc3ca('0x8f'),JSON[_0xc3ca('0x6e')](_0x2870b1)));});}if(_0x33e736[_0xc3ca('0x1cc')]===_0xc3ca('0x1de')){return _0x125a06['getVoiceQueueRtPauses'](_0x33e736['id'])[_0xc3ca('0x9a')](function(_0x3fafcd){var _0x1ea6d1=_0x33e736[_0xc3ca('0x1e3')]-_0x3fafcd[0x0][_0xc3ca('0x1e4')];var _0x363387=_0x33e736[_0xc3ca('0x1ca')]*0x3c;var _0xcf53b=_0x270b5e[0x0][_0xc3ca('0x4d')]+_0x270b5e[0x0][_0xc3ca('0x4b')];var _0x553454=(_0x270b5e[0x0][_0xc3ca('0x47')]+_0x270b5e[0x0][_0xc3ca('0x49')]+_0x270b5e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x270b5e[0x0]['predictiveIntervalTotalCalls'];var _0xb28d86=_0x33e736['dialPredictiveOptimizationPercentage']/0x64;_0x33e736[_0xc3ca('0x1e5')]=_0x3fafcd[0x0][_0xc3ca('0x1e4')]||0x0;_0x33e736[_0xc3ca('0x1c5')]=_0x553454>0x0?_0x553454:0x1;return _0x125a06[_0xc3ca('0x1df')](_0x1ea6d1,_0x363387,_0xcf53b,_0x553454,_0xb28d86);})[_0xc3ca('0x9a')](function(_0x26a0d5){return _0x456b61(_0x26a0d5);})[_0xc3ca('0x9d')](function(_0x2b772a){return _0x3c3e02(msgResponse(_0xc3ca('0x1e6'),'Failure',JSON[_0xc3ca('0x6e')](_0x2b772a)));});}}else{return _0x3c3e02(msgResponse(_0xc3ca('0x1e0'),_0xc3ca('0x8f'),_0xc3ca('0x1e1')));}});};};Dialer[_0xc3ca('0x83')]['startMethodPredictive']=function(_0x4a3902){var _0x360484=this;return function(){var _0x2214f0=0x0;var _0x167013=Math[_0xc3ca('0x1e7')](_0x4a3902[_0xc3ca('0x54')]*0x3e8);if(_0x167013>0x0){_0x167013=_0x167013<0x64?0x64:_0x167013;loggerPredictive[_0xc3ca('0x43')](_0x4a3902[_0xc3ca('0x40')],_0xc3ca('0x1e8'),_0x167013,_0xc3ca('0x1e9'));_0x4a3902[_0xc3ca('0x5d')]=setInterval(function(){_0x360484[_0xc3ca('0x5d')](_0x4a3902);loggerPredictiveCalls['info'](_0xc3ca('0x1ea'),_0x2214f0+=0x1);},_0x167013);}else{loggerPredictive[_0xc3ca('0x43')](_0x4a3902[_0xc3ca('0x40')],_0xc3ca('0x1eb'));}};};Dialer[_0xc3ca('0x83')][_0xc3ca('0x1ec')]=function(_0x5420f2,_0x181c38){var _0x5b84a2=this;return function(_0x5de053){if(_[_0xc3ca('0x74')](_0x5de053)){if(_[_0xc3ca('0xed')](_0x181c38[_0xc3ca('0x1ed')])||!_0x181c38[_0xc3ca('0x1ee')]){if(_0x5420f2[_0xc3ca('0xab')]==='booked'){_0x5420f2[_0xc3ca('0x6b')]=_[_0xc3ca('0x39')](_0x5420f2['queueStatusComplete'])?!![]:_0x5420f2[_0xc3ca('0x6b')];var _0x2ed559=uuid['v4']();_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559]=new Action(_0x5420f2,_0x181c38,_0x2ed559);loggerBooked['info'](_0xc3ca('0x1ef'),_0x2ed559,_0xc3ca('0x1f0'),JSON[_0xc3ca('0x6e')](_0x5420f2[_0xc3ca('0x6b')]),_0xc3ca('0x1f1'),_0x5420f2['name']);if(_0x5420f2[_0xc3ca('0x6b')]){_0x5420f2[_0xc3ca('0x6b')]=![];_0x5b84a2['queueBooked'][_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xb9')]]=[];ami[_0xc3ca('0x97')]({'actionid':_0x2ed559,'action':_0xc3ca('0x1f2'),'queue':_0x5420f2[_0xc3ca('0x40')]})['catch'](function(){_0x5b84a2[_0xc3ca('0xf5')](_0x5420f2);hopperUtils[_0xc3ca('0xf6')]({'active':![],'ContactId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xd1')],'ListId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xd2')],'VoiceQueueId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xd3')]||undefined,'CampaignId':_0x5b84a2['actions'][_0x2ed559][_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5b84a2['actions'][_0x2ed559];});}else{loggerBooked[_0xc3ca('0x43')](_0xc3ca('0x1f3'),JSON['stringify'](_0x5420f2[_0xc3ca('0x6b')]),_0xc3ca('0x1f1'),_0x5420f2['name']);_0x5b84a2[_0xc3ca('0xf5')](_0x5420f2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xd1')],'ListId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559][_0xc3ca('0xd2')],'VoiceQueueId':_0x5b84a2['actions'][_0x2ed559][_0xc3ca('0xd3')]||undefined,'CampaignId':_0x5b84a2[_0xc3ca('0xe7')][_0x2ed559]['CampaignId']||undefined})[_0xc3ca('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5b84a2[_0xc3ca('0xe7')][_0x2ed559];}}else{return _0x5b84a2[_0xc3ca('0x15a')](_0x5420f2,_0x181c38);}}else{if(utils['getSeconds'](undefined,_0x181c38[_0xc3ca('0x1f4')])<_0x5420f2[_0xc3ca('0x1f5')]*0x3c){if(_0x181c38[_0xc3ca('0x141')]&&!_0x181c38[_0xc3ca('0x141')][_0xc3ca('0x1f6')]){_0x5b84a2[_0xc3ca('0x1a')][_0xc3ca('0xf1')](_0x181c38['id'])[_0xc3ca('0xf4')](function(){_0x5b84a2['updateOriginated'](_0x5420f2);});}else{hopperUtils[_0xc3ca('0x1f7')]({'active':![]},_0x181c38['id'],0x1)['finally'](function(){_0x5b84a2['updateOriginated'](_0x5420f2);});}}else{_0x5420f2[_0xc3ca('0x1f8')]+=0x1;_0x5b84a2['updateOriginated'](_0x5420f2);if(_0x5420f2[_0xc3ca('0x1f9')]){hopperUtils[_0xc3ca('0xf6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x181c38[_0xc3ca('0xd1')],'ListId':_0x181c38[_0xc3ca('0xd2')],'VoiceQueueId':_0x181c38[_0xc3ca('0xd3')]||undefined,'CampaignId':_0x181c38[_0xc3ca('0xd4')]||undefined})[_0xc3ca('0x9d')](loggerCatch(_0xc3ca('0x1fa')));hopperUtils[_0xc3ca('0xd9')](createObjHistory(_0x5420f2,_0x181c38,utils[_0xc3ca('0x75')][_0xc3ca('0x1fb')],0x17,_0xc3ca('0x1fc')))[_0xc3ca('0x9d')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5b84a2[_0xc3ca('0x111')](createObjHistory(_0x5420f2,_0x181c38,utils[_0xc3ca('0x75')]['RECALL_TIMEOUT'],0x16,_0xc3ca('0x1fd')),_0xc3ca('0x1fe'),_0xc3ca('0x1ff'));}}}}else{_0x5420f2[_0xc3ca('0x200')]+=0x1;_0x5b84a2[_0xc3ca('0x111')](createObjHistory(_0x5420f2,_0x181c38,utils[_0xc3ca('0x75')][_0xc3ca('0x201')],0xd,'Blacklist'),_0xc3ca('0x202'),'[Originate][MoveBlacklist]');throw _0xc3ca('0x203');}};};Dialer['prototype'][_0xc3ca('0x159')]=function(_0x3c83e0){var _0x272df2=this;var _0x51e7d1=_0x3c83e0[_0xc3ca('0x204')]-_0x3c83e0[_0xc3ca('0x7b')]-_0x3c83e0[_0xc3ca('0x205')];emitCampaignSummary(_0x3c83e0);if(_0x51e7d1>0x0){if(_0x51e7d1>this['maxNumberOriginate']){_0x51e7d1=this[_0xc3ca('0x206')];}_0x3c83e0['temp']+=_0x51e7d1;hopperUtils[_0xc3ca('0x207')](_0x3c83e0['id'],_0x51e7d1,_0x3c83e0['dialOrderByScheduledAt'],_0x3c83e0)[_0xc3ca('0x9a')](function(_0x5e509f){_0x3c83e0[_0xc3ca('0x205')]-=_0x51e7d1;_0x3c83e0['temp']=_0x3c83e0[_0xc3ca('0x205')]>0x0?_0x3c83e0[_0xc3ca('0x205')]:0x0;if(!utils[_0xc3ca('0x208')](_0x5e509f)){_0x3c83e0[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x66')];logger['info'](_0xc3ca('0x209')+_0x3c83e0['name']);}else{_0x3c83e0[_0xc3ca('0x7b')]+=_0x5e509f['length'];_0x3c83e0[_0xc3ca('0x62')]=utils[_0xc3ca('0x75')][_0xc3ca('0x20a')];for(var _0x336485=0x0;_0x336485<_0x5e509f[_0xc3ca('0x95')];_0x336485+=0x1){_0x3c83e0['ivrTotalCallsDays']+=0x1;if(_[_0xc3ca('0xed')](_0x5e509f[_0x336485])||_[_0xc3ca('0xed')](_0x5e509f[_0x336485][_0xc3ca('0x176')])||_[_0xc3ca('0xed')](_0x5e509f[_0x336485][_0xc3ca('0x15d')])){_0x272df2[_0xc3ca('0x152')](_0xc3ca('0x20b'),_0x3c83e0,_0x5e509f[_0x336485]);}else{hopperUtils[_0xc3ca('0x20c')](_[_0xc3ca('0x6f')](_0x5e509f[_0x336485],[_0xc3ca('0xd4'),'phone']))['then'](_0x272df2[_0xc3ca('0x1ec')](_0x3c83e0,_0x5e509f[_0x336485]))[_0xc3ca('0x9d')](_0x272df2[_0xc3ca('0x151')]('[actionOriginateIvr]\x20',_0x3c83e0));}}}})[_0xc3ca('0x9d')](loggerGetContactDialer('[getContactCampaign2]',_0x3c83e0,_0x51e7d1));}};Dialer[_0xc3ca('0x83')][_0xc3ca('0xad')]=function(_0x4968db,_0x706355){var _0xe1326a=this;var _0x17e319=[];if(_0x706355<0x1||_0x4968db[_0xc3ca('0xab')]===_0xc3ca('0x8')){_0x706355=0x1;}var _0x2838a6=Math['floor'](_0x4968db[_0xc3ca('0x1c2')]*_0x706355)-_0x4968db['originated']-_0x4968db[_0xc3ca('0x205')];if(_0x4968db[_0xc3ca('0x20d')]>0x0){var _0x268c9b=_0x4968db['dialLimitQueue']-_0x4968db[_0xc3ca('0x7b')]-_0x4968db[_0xc3ca('0x1c3')]-_0x4968db['temp']-_0x4968db[_0xc3ca('0x20e')];if(_0x2838a6>_0x268c9b){_0x2838a6=_0x268c9b;}}if(_0x2838a6>0x0){if(_0x4968db[_0xc3ca('0xab')]===_0xc3ca('0x8')){_0x2838a6=0x1;}if(_0x2838a6>this[_0xc3ca('0x206')]){_0x2838a6=this[_0xc3ca('0x206')];}_0x4968db[_0xc3ca('0x205')]+=_0x2838a6;for(var _0x2e9aff in this[_0xc3ca('0x1c')]){if(typeof this['agents'][_0x2e9aff]!=='undefined'){if(this[_0xc3ca('0x1c')][_0x2e9aff][_0xc3ca('0x68')]===_0xc3ca('0x20f')&&this['agents'][_0x2e9aff][_0xc3ca('0x87')]===_0xc3ca('0x210')){_0x17e319['push'](this[_0xc3ca('0x1c')][_0x2e9aff]['id']);}}}return hopperUtils[_0xc3ca('0x211')](_0x4968db,_0x17e319,_0x2838a6)['then'](function(_0x422528){_0x4968db[_0xc3ca('0x205')]-=_0x2838a6;_0x4968db[_0xc3ca('0x205')]=_0x4968db[_0xc3ca('0x205')]>0x0?_0x4968db[_0xc3ca('0x205')]:0x0;if(!utils['checkContactEmpty'](_0x422528)){return hopperUtils[_0xc3ca('0x212')](_0x4968db)[_0xc3ca('0x9a')](sendMessageReschedule(_0x4968db))[_0xc3ca('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x4968db[_0xc3ca('0x7b')]+=_0x422528[_0xc3ca('0x95')];_0x4968db[_0xc3ca('0x62')]=_0x4968db[_0xc3ca('0xab')]===_0xc3ca('0x8')?utils[_0xc3ca('0x75')][_0xc3ca('0x135')]:utils[_0xc3ca('0x75')][_0xc3ca('0x20a')];for(var _0x5180a7=0x0;_0x5180a7<_0x422528[_0xc3ca('0x95')];_0x5180a7+=0x1){if(_[_0xc3ca('0xed')](_0x422528[_0x5180a7])||_[_0xc3ca('0xed')](_0x422528[_0x5180a7][_0xc3ca('0x176')])||_['isNil'](_0x422528[_0x5180a7][_0xc3ca('0x15d')])){_0xe1326a[_0xc3ca('0x152')]('[actionOriginate]\x20',_0x4968db,_0x422528[_0x5180a7]);}else{return hopperUtils[_0xc3ca('0x213')](_[_0xc3ca('0x6f')](_0x422528[_0x5180a7],[_0xc3ca('0xd3'),_0xc3ca('0x15d')]))[_0xc3ca('0x9a')](_0xe1326a[_0xc3ca('0x1ec')](_0x4968db,_0x422528[_0x5180a7]))['catch'](_0xe1326a[_0xc3ca('0x151')]('[actionOriginate]\x20',_0x4968db));}}}})[_0xc3ca('0x9d')](loggerGetContactDialer('[getContactDialer2]',_0x4968db,_0x2838a6));}};Dialer[_0xc3ca('0x83')][_0xc3ca('0x5d')]=function(_0x32ecab){if(_0x32ecab[_0xc3ca('0x20d')]>0x0){var _0x2b5551=_0x32ecab['dialLimitQueue']-_0x32ecab[_0xc3ca('0x7b')]-_0x32ecab['talking'];if(_0x2b5551>0x0){this['tryOriginatePredictive'](_0x32ecab);}else{loggerPredictiveCalls[_0xc3ca('0x43')](_0xc3ca('0x214'));}}else{this[_0xc3ca('0x215')](_0x32ecab);}};Dialer['prototype'][_0xc3ca('0x215')]=function(_0x48970e){var _0x4c2222=this;var _0x300cd7=[];_0x48970e[_0xc3ca('0x7b')]+=0x1;for(var _0x33aa4c in this[_0xc3ca('0x1c')]){if(typeof this[_0xc3ca('0x1c')][_0x33aa4c]!==_0xc3ca('0x148')){if(this[_0xc3ca('0x1c')][_0x33aa4c][_0xc3ca('0x68')]===_0xc3ca('0x20f')&&this[_0xc3ca('0x1c')][_0x33aa4c][_0xc3ca('0x87')]===_0xc3ca('0x210')){_0x300cd7['push'](this[_0xc3ca('0x1c')][_0x33aa4c]['id']);}}}return this[_0xc3ca('0x211')](_0x48970e['id'],_0x300cd7,0x1,_0x48970e[_0xc3ca('0x216')],_0x48970e)[_0xc3ca('0x9a')](function(_0x1cc7e0){if(!utils[_0xc3ca('0x208')](_0x1cc7e0)){utils[_0xc3ca('0x60')](_0x48970e,0x1,0x0);return hopperUtils['countReScheduled'](_0x48970e)[_0xc3ca('0x9a')](sendMessageReschedule(_0x48970e))[_0xc3ca('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x48970e['message']=utils[_0xc3ca('0x75')][_0xc3ca('0x20a')];if(_[_0xc3ca('0xed')](_0x1cc7e0[0x0])||_[_0xc3ca('0xed')](_0x1cc7e0[0x0]['Contact'])||_[_0xc3ca('0xed')](_0x1cc7e0[0x0]['phone'])){_0x4c2222[_0xc3ca('0x152')]('[actionOriginate]\x20',_0x48970e,_0x1cc7e0[0x0]);}else{return hopperUtils[_0xc3ca('0x213')](_[_0xc3ca('0x6f')](_0x1cc7e0[0x0],[_0xc3ca('0xd3'),_0xc3ca('0x15d')]))['then'](_0x4c2222[_0xc3ca('0x1ec')](_0x48970e,_0x1cc7e0[0x0]))[_0xc3ca('0x9d')](_0x4c2222[_0xc3ca('0x151')](_0xc3ca('0x217'),_0x48970e));}}})[_0xc3ca('0x9d')](loggerGetContactDialer('[getContactDialerPredictive]',_0x48970e,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x3de558,_0x3c988f,_0xf70f5c,_0x82e995,_0x2b1c89,_0x1ebde6){loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x218'));loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x219'),_0x3de558);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c988f);loggerPredictive['info'](_0xc3ca('0x21a'),_0xf70f5c);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x21b'),_0x82e995);loggerPredictive[_0xc3ca('0x43')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b1c89);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x4e'));return new Promise(function(_0x244249,_0x3e2bfd){if(_0x3de558<=0x0||isNaN(_0x3de558)){return _0x3e2bfd(msgResponse(_0xc3ca('0x21c'),'Error',_0xc3ca('0x21d')+_0x3de558));}if(_0xf70f5c<=0x0||isNaN(_0xf70f5c)){return _0x3e2bfd(msgResponse(_0xc3ca('0x21c'),_0xc3ca('0x82'),_0xc3ca('0x21e')+_0xf70f5c));}if(_0x82e995<=0x0||isNaN(_0x82e995)){return _0x3e2bfd(msgResponse('[abandonmentRate]','Error',_0xc3ca('0x21f')+_0x82e995));}if(_0x3c988f<=0x0||isNaN(_0x3c988f)){return _0x3e2bfd(msgResponse(_0xc3ca('0x21c'),'Error',_0xc3ca('0x220')+_0x3c988f));}if(_0x2b1c89<=0x0||isNaN(_0x2b1c89)){return _0x3e2bfd(msgResponse(_0xc3ca('0x21c'),_0xc3ca('0x82'),_0xc3ca('0x221')+_0x2b1c89));}_0x1ebde6=_0x1ebde6||0x0;var _0x56aee8=0x1/_0xf70f5c;var _0x451f36=0x0;var _0x10f735=0x0;var _0x523b35=0x0;var _0x58473f=0x0;for(var _0x37bdf1=0x0;_0x523b35<_0x2b1c89;_0x37bdf1+=0x1){_0x10f735=_0x37bdf1/_0x3c988f;_0x451f36=(_0x82e995*_0x10f735+_0x1ebde6)/_0x56aee8;_0x523b35=utils[_0xc3ca('0x222')](_0x451f36,_0x3de558);_0x58473f=_0x451f36/_0x3de558*(0x1-utils[_0xc3ca('0x222')](_0x451f36,_0x3de558));}return _0x244249({'erlangCalls':_0x37bdf1,'erlangCallToSecond':_0x3c988f/_0x37bdf1,'erlangAbandonmentRate':_0x523b35,'erlangBusyFactor':_0x58473f});});};Dialer[_0xc3ca('0x83')][_0xc3ca('0x1df')]=function(_0x111ab8,_0x25e2aa,_0x1f71cb,_0x27bd17,_0x5ce397,_0x66a5d6){loggerPredictive[_0xc3ca('0x43')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xc3ca('0x43')]('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',_0x111ab8);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x223'),_0x25e2aa);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x21a'),_0x1f71cb);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x21b'),_0x27bd17);loggerPredictive['info'](_0xc3ca('0x224'),_0x5ce397);loggerPredictive[_0xc3ca('0x43')](_0xc3ca('0x4e'));return new Promise(function(_0x48e70f,_0x325353){if(_0x111ab8<=0x0||isNaN(_0x111ab8)){return _0x325353(msgResponse(_0xc3ca('0x225'),_0xc3ca('0x82'),_0xc3ca('0x21d')+_0x111ab8));}if(_0x1f71cb<=0x0||isNaN(_0x1f71cb)){return _0x325353(msgResponse(_0xc3ca('0x225'),_0xc3ca('0x82'),'Ts\x20=\x20'+_0x1f71cb));}if(_0x27bd17<=0x0||isNaN(_0x27bd17)){return _0x325353(msgResponse(_0xc3ca('0x225'),_0xc3ca('0x82'),_0xc3ca('0x21f')+_0x27bd17));}if(_0x25e2aa<=0x0||isNaN(_0x25e2aa)){return _0x325353(msgResponse(_0xc3ca('0x225'),_0xc3ca('0x82'),_0xc3ca('0x220')+_0x25e2aa));}if(_0x5ce397<=0x0||isNaN(_0x5ce397)){return _0x325353(msgResponse('[busyFactor]',_0xc3ca('0x82'),_0xc3ca('0x226')+_0x5ce397));}_0x66a5d6=_0x66a5d6||0x0;var _0x2fed9a=0x1/_0x1f71cb;var _0x9de0af=0x0;var _0x323846=0x0;var _0xa2633b=0x0;var _0x44f63e=0x0;for(var _0x406ab9=0x0;_0x44f63e<_0x5ce397;_0x406ab9+=0x1){_0x323846=_0x406ab9/_0x25e2aa;_0x9de0af=(_0x27bd17*_0x323846+_0x66a5d6)/_0x2fed9a;_0xa2633b=utils['erlangb'](_0x9de0af,_0x111ab8);_0x44f63e=_0x9de0af/_0x111ab8*(0x1-utils[_0xc3ca('0x222')](_0x9de0af,_0x111ab8));}return _0x48e70f({'erlangCalls':_0x406ab9,'erlangCallToSecond':_0x25e2aa/_0x406ab9,'erlangAbandonmentRate':_0xa2633b,'erlangBusyFactor':_0x44f63e});});};module['exports']=Dialer;
\ No newline at end of file
+var _0xba4c=['dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','talking','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','run','unlockContact','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','emptyContact','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','[ifTime][Action]','Error','stringify','isTrunkReachable','active','status','reachable','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','isArray','length','Action','command','iftime\x20%s,%s','content','true','catch','push','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','ivr','updateOriginated','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','dialQueueProject2','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','rescheduleContact','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','stateinterface','locked','idHopper','paused','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','isEmpty','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','amd','buildObj','countbusyretry','countcongestionretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','[syncHangupInAMDIvr][createHistory]','countnoanswerretry','countagentrejectretry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','isPreviewCampaign','getQueueCampaignStatusMessage','available','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','xcally-motion-dialer','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion'];(function(_0x7a90c2,_0x245c3a){var _0x3f0507=function(_0x28ff6e){while(--_0x28ff6e){_0x7a90c2['push'](_0x7a90c2['shift']());}};_0x3f0507(++_0x245c3a);}(_0xba4c,0x71));var _0xcba4=function(_0x3520c4,_0x143a63){_0x3520c4=_0x3520c4-0x0;var _0x560f18=_0xba4c[_0x3520c4];return _0x560f18;};'use strict';var util=require(_0xcba4('0x0'));var _=require(_0xcba4('0x1'));var uuid=require(_0xcba4('0x2'));var moment=require(_0xcba4('0x3'));var rr=require('rr');var Redis=require(_0xcba4('0x4'));var utils=require(_0xcba4('0x5'));var hopperUtils=require(_0xcba4('0x6'));var ut=require(_0xcba4('0x7'));var config=require('../../../config/environment/');var logger=require(_0xcba4('0x8'))('dialer');var loggerBooked=require(_0xcba4('0x8'))(_0xcba4('0x9'));var loggerPredictive=require('../../../config/logger')(_0xcba4('0xa'));var loggerPredictiveCalls=require(_0xcba4('0x8'))(_0xcba4('0xb'));var loggerSyncQueueSummary=require(_0xcba4('0x8'))(_0xcba4('0xc'));var ami=require('../ami');config[_0xcba4('0xd')]=_['defaults'](config[_0xcba4('0xd')],{'host':_0xcba4('0xe'),'port':0x18eb});var io=require(_0xcba4('0xf'))(new Redis(config[_0xcba4('0xd')]));var cmHopper=require(_0xcba4('0x10'));var voiceQueueRt=require(_0xcba4('0x11'));var RpcSetting=require(_0xcba4('0x12'));var Interval=require(_0xcba4('0x13'));var Action=require(_0xcba4('0x14'));var History=require(_0xcba4('0x15'));var Final=require(_0xcba4('0x16'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xcba4('0x17'));var Hangup=require('./models/hangup');var ipAgi=process[_0xcba4('0x18')][_0xcba4('0x19')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xcba4('0x1a')][_0xcba4('0x1b')]=function(_0x29e5de){this[_0xcba4('0x1c')]=this['tail']?this['tail'][_0xcba4('0x1d')](_0x29e5de):_0x29e5de();};function Dialer(_0x351976,_0x52b66e){this['sequence']=new Sequence();this[_0xcba4('0x1e')]=_0x52b66e;this['voiceQueues']=_0x351976[_0xcba4('0x1f')];this[_0xcba4('0x20')]=_0x351976[_0xcba4('0x20')];this[_0xcba4('0x21')]=_0x351976[_0xcba4('0x21')];this[_0xcba4('0x22')]=_0x351976[_0xcba4('0x22')];this['maxNumberOriginate']=config[_0xcba4('0x23')]||0x2;this[_0xcba4('0x24')]={};this[_0xcba4('0x25')]={};this[_0xcba4('0x26')]={};this[_0xcba4('0x27')]={};this['optionPredictive']={};this[_0xcba4('0x28')]={};this[_0xcba4('0x29')]={};this[_0xcba4('0x2a')]={};this[_0xcba4('0x2b')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on'](_0xcba4('0x2c'),this['syncAgentConnect'][_0xcba4('0x2d')](this));ami['on'](_0xcba4('0x2e'),this[_0xcba4('0x2f')]['bind'](this));ami['on'](_0xcba4('0x30'),this[_0xcba4('0x31')]['bind'](this));ami['on'](_0xcba4('0x32'),this[_0xcba4('0x33')][_0xcba4('0x2d')](this));ami['on'](_0xcba4('0x34'),this['syncQueueSummary']['bind'](this));ami['on'](_0xcba4('0x35'),this[_0xcba4('0x36')]['bind'](this));ami['on'](_0xcba4('0x37'),this[_0xcba4('0x38')][_0xcba4('0x2d')](this));ami['on'](_0xcba4('0x39'),this['syncNewExten'][_0xcba4('0x2d')](this));ami['on'](_0xcba4('0x3a'),this[_0xcba4('0x3b')]['bind'](this));ami['on'](_0xcba4('0x3c'),this[_0xcba4('0x3d')][_0xcba4('0x2d')](this));ami['on'](_0xcba4('0x3e'),this['syncQueueStatusComplete'][_0xcba4('0x2d')](this));this[_0xcba4('0x3f')]();this[_0xcba4('0x40')]();RpcSetting[_0xcba4('0x41')]()[_0xcba4('0x42')](function(_0x19dab8){previewRecallmeReminderInterval=_0x19dab8['previewRecallmeReminderInterval'];});}function isNotNull(_0x178008){return _0x178008!==null&&!_[_0xcba4('0x43')](_0x178008);}function msgResponse(_0x4a7546,_0x25cfea,_0x13d255){return{'action':_0x4a7546,'response':_0x25cfea,'message':_0x13d255,'stack':_0x13d255};}function emit(_0x1e7d0b,_0x30b0b6,_0x5e5441){io['to'](_0x1e7d0b)[_0xcba4('0x44')](_0x30b0b6,_0x5e5441);}function emitOutboundVoiceQueueSummary(_0x3326da){if(_0x3326da[_0xcba4('0x45')]===_0xcba4('0x46')){logger[_0xcba4('0x47')](_0xcba4('0x48'),util['inspect'](_0x3326da,{'showHidden':![],'depth':null}));emit(util[_0xcba4('0x49')](_0xcba4('0x4a'),_0x3326da[_0xcba4('0x4b')]),'voice_queue:save',_0x3326da);}}function checkGetDataPredictive(_0x5ef88e){if(isNotNull(_0x5ef88e)&&!_['isEmpty'](_0x5ef88e)){loggerPredictive[_0xcba4('0x4c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xcba4('0x4d'),_0x5ef88e['predictiveIntervalTotalCalls']);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x4e'),_0x5ef88e[_0xcba4('0x4f')]);loggerPredictive[_0xcba4('0x4c')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ef88e[_0xcba4('0x50')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x51'),_0x5ef88e[_0xcba4('0x52')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ef88e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xcba4('0x53'),_0x5ef88e[_0xcba4('0x54')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x55'));if(_0x5ef88e[_0xcba4('0x56')]>0x0){if(!_[_0xcba4('0x43')](_0x5ef88e[_0xcba4('0x54')])&&_0x5ef88e[_0xcba4('0x54')]>0x0){return!![];}loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x57'));if(!_[_0xcba4('0x43')](_0x5ef88e['predictiveIntervalAvgHoldtime'])&&_0x5ef88e[_0xcba4('0x58')]>0x0){return!![];}loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x59'));}else{loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x5a'));}}else{loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x5b'));}return![];}function mergeDataErlangB(_0x5a2afc){return function(_0x21ebe8){loggerPredictive[_0xcba4('0x4c')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x5c'),_0x21ebe8[_0xcba4('0x5d')]);loggerPredictive[_0xcba4('0x4c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x21ebe8[_0xcba4('0x5e')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x5f'),_0x21ebe8[_0xcba4('0x60')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x61'),_0x21ebe8[_0xcba4('0x62')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x5f'),_0x21ebe8[_0xcba4('0x60')]);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x55'));_[_0xcba4('0x63')](_0x5a2afc,_0x21ebe8);};}function ifInterval(_0x79d4c0,_0x55d3cb){if(_['isUndefined'](_0x55d3cb)){return![];}return utils['getSeconds'](undefined,_0x55d3cb)<_0x79d4c0*0x3c;}function clearPredictiveAttributes(_0xfcfbdb){if(_0xfcfbdb[_0xcba4('0x29')]){_0xfcfbdb['startProgressive']=undefined;loggerPredictive[_0xcba4('0x47')](_0xfcfbdb[_0xcba4('0x4b')],'startProgressive\x20value\x20cleared');}if(_0xfcfbdb[_0xcba4('0x28')]){_0xfcfbdb[_0xcba4('0x28')]=undefined;loggerPredictive[_0xcba4('0x47')](_0xfcfbdb[_0xcba4('0x4b')],_0xcba4('0x64'));}if(_0xfcfbdb[_0xcba4('0x65')]){clearInterval(_0xfcfbdb[_0xcba4('0x65')]);_0xfcfbdb[_0xcba4('0x65')]=undefined;loggerPredictive[_0xcba4('0x47')](_0xfcfbdb[_0xcba4('0x4b')],_0xcba4('0x66'));}}function loggerCatchPredictive(_0x2fcb54,_0x4be7fd){return function(_0xb58ace){loggerPredictive[_0xcba4('0x67')](_0x4be7fd[_0xcba4('0x4b')],_0x2fcb54);loggerPredictive[_0xcba4('0x67')](_0xb58ace[_0xcba4('0x68')]);clearPredictiveAttributes(_0x4be7fd);};}function loggerCatch(_0x4e2127){return function(_0x4f7799){logger[_0xcba4('0x67')](_0x4e2127,util['inspect'](_0x4f7799,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1781b2,_0x3e5819,_0x2752bd){return function(_0x470b43){utils[_0xcba4('0x69')](_0x3e5819,_0x2752bd,0x0);logger[_0xcba4('0x67')](_0x1781b2,util[_0xcba4('0x6a')](_0x470b43,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xd84f1f){return function(_0x46ccef){if(isNotNull(_0x46ccef)&&isNotNull(_0x46ccef[0x0])){if(_0x46ccef[0x0][_0xcba4('0x6b')]>0x0){_0xd84f1f[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')][_0xcba4('0x6e')];logger['info'](_0xcba4('0x6f')+_0xd84f1f[_0xcba4('0x4b')],_0x46ccef[0x0][_0xcba4('0x6b')],_0xcba4('0x70'));}else{_0xd84f1f[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')][_0xcba4('0x71')];logger[_0xcba4('0x4c')](_0xcba4('0x72')+_0xd84f1f[_0xcba4('0x4b')]);}}};}function createObjHistory(_0x2007d1,_0x1c6e06,_0x3fa417,_0x5bdea5,_0x3b1ced){_0x2007d1[_0xcba4('0x6c')]=_0x3fa417;var _0x30c4b7=new Action(_0x2007d1,_0x1c6e06);var _0x3f00f1=new History(_0x30c4b7);_0x3f00f1[_0xcba4('0x73')]=_0x5bdea5;_0x3f00f1[_0xcba4('0x74')]=_0x3b1ced;_0x3f00f1[_0xcba4('0x75')]=_0x30c4b7[_0xcba4('0x76')];return _0x3f00f1;}function unlockQueueStatus(_0x8b3417,_0x59d0a6){setTimeout(function(){if(_[_0xcba4('0x43')](_0x8b3417[_0xcba4('0x77')])){loggerBooked['error'](_0xcba4('0x78'),_0x59d0a6);}_0x8b3417[_0xcba4('0x77')]=!![];loggerBooked[_0xcba4('0x4c')](_0xcba4('0x79'),_0x59d0a6,JSON['stringify'](_[_0xcba4('0x7a')](_0x8b3417,[_0xcba4('0x4b'),_0xcba4('0x77')])));},0x1f3);}function checkInterval(_0x4ef495){return function(){if(!isNotNull(_0x4ef495[_0xcba4('0x7b')])){_0x4ef495[_0xcba4('0x6c')]=utils['CAMPAIGN_STATUS'][_0xcba4('0x7c')];throw _0x4ef495[_0xcba4('0x4b')]+_0xcba4('0x7d');}if(!isNotNull(_0x4ef495[_0xcba4('0x7b')][_0xcba4('0x7e')])){_0x4ef495['message']=utils[_0xcba4('0x6d')][_0xcba4('0x7c')];throw _0x4ef495[_0xcba4('0x4b')]+_0xcba4('0x7d');}if(!isNotNull(_['isEmpty'](_0x4ef495[_0xcba4('0x7b')][_0xcba4('0x7e')]))){_0x4ef495[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')][_0xcba4('0x7c')];throw _0x4ef495['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x28b6e3){return function(){if(!utils[_0xcba4('0x7f')](_0x28b6e3)){_0x28b6e3['message']=utils[_0xcba4('0x6d')][_0xcba4('0x80')];throw _0x28b6e3['name']+_0xcba4('0x81');}};}function emitCampaignSummary(_0x3e2b7c){if(utils['isIVRCampaign'](_0x3e2b7c)){emit(util[_0xcba4('0x49')](_0xcba4('0x82'),_0x3e2b7c['name']),'campaign:save',_0x3e2b7c);}}function loggerCatchQueueSummary(_0x23a220,_0x21c4d7){return function(_0x3e0714){clearPredictiveAttributes(_0x21c4d7);emitCampaignSummary(_0x21c4d7);loggerSyncQueueSummary['debug'](_0x23a220,util[_0xcba4('0x6a')](_0x3e0714,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x50b370){if(_0x50b370[_0xcba4('0x83')]){if(_0x50b370[_0xcba4('0x84')]===0x0){_0x50b370['sendMessageOneNotActive']=![];_0x50b370['message']=utils[_0xcba4('0x6d')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0xcba4('0x85'),_0x50b370[_0xcba4('0x4b')],'is\x20not\x20active');}else{_0x50b370[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')][_0xcba4('0x86')];loggerSyncQueueSummary[_0xcba4('0x47')](_0xcba4('0x85'),_0x50b370[_0xcba4('0x4b')],'is\x20disactive');}emitCampaignSummary(_0x50b370);}}function myreject(_0x3bfa4a){return function(_0x4e7ce8){return _0x3bfa4a(msgResponse(_0xcba4('0x87'),_0xcba4('0x88'),JSON[_0xcba4('0x89')](_0x4e7ce8)));};}Dialer[_0xcba4('0x1a')][_0xcba4('0x8a')]=function(_0x425a89){return!_[_0xcba4('0x43')](_0x425a89)&&_0x425a89&&!_[_0xcba4('0x43')](_0x425a89['name'])&&!_[_0xcba4('0x43')](_0x425a89[_0xcba4('0x8b')])&&_0x425a89[_0xcba4('0x8b')]&&(this['trunks'][util[_0xcba4('0x49')]('SIP/%s',_0x425a89[_0xcba4('0x4b')])][_0xcba4('0x8c')]===_0xcba4('0x8d')||this[_0xcba4('0x22')][util[_0xcba4('0x49')]('SIP/%s',_0x425a89['name'])]['status']==='unmonitored');};Dialer[_0xcba4('0x1a')][_0xcba4('0x8e')]=function(_0x5da945){var _0x5afa1c=this;return function(){if(!_0x5afa1c[_0xcba4('0x8a')](_0x5da945[_0xcba4('0x8f')])){if(!_0x5afa1c[_0xcba4('0x8a')](_0x5da945[_0xcba4('0x90')])){_0x5da945[_0xcba4('0x6c')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x5da945[_0xcba4('0x4b')]+_0xcba4('0x91');}}};};Dialer[_0xcba4('0x1a')][_0xcba4('0x92')]=function(_0x51f34e,_0x10e673,_0x31c6c6,_0x4ed297){var _0x3689ea=this;return function(){var _0x5ae9b4=!![];return _0x3689ea['ifTimeIvr'](_0x51f34e,_0x10e673,_0x31c6c6,_0x4ed297,_0x5ae9b4);};};Dialer[_0xcba4('0x1a')][_0xcba4('0x93')]=function(_0x5dfad4,_0x5b3406,_0x5bc921,_0x5c241f){var _0x33a9e1=this;return function(){var _0xe18130=![];return _0x33a9e1['ifTimeIvr'](_0x5dfad4[_0xcba4('0x7e')],_0x5b3406,_0x5bc921,_0x5c241f,_0xe18130);};};Dialer['prototype']['ifTimeIvr']=function(_0x3649bf,_0x4a43ff,_0x5dfca6,_0x43d985,_0x49c582){var _0x4edab9=[];return new Promise(function(_0x5724dd,_0x2fc74c){if(!isNotNull(_0x3649bf)){_0x43d985[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')]['NULL_INTERVAL'];return _0x2fc74c(msgResponse(_0xcba4('0x94'),_0xcba4('0x95'),_0x5dfca6+_0xcba4('0x96')));}if(_['isEmpty'](_0x3649bf)){_0x43d985['message']=utils['CAMPAIGN_STATUS'][_0xcba4('0x97')];return _0x2fc74c(msgResponse('ifTime',_0xcba4('0x95'),_0x5dfca6+_0xcba4('0x98')));}if(_0x4a43ff&&_['isUndefined'](config[_0xcba4('0x99')][_0x4a43ff])){_0x43d985[_0xcba4('0x6c')]=utils[_0xcba4('0x6d')][_0xcba4('0x9a')];return _0x2fc74c(msgResponse(_0xcba4('0x94'),_0xcba4('0x95'),_0x5dfca6+'\x20Timezone\x20unknow\x20'+_0x4a43ff));}if(_[_0xcba4('0x9b')](_0x3649bf)){for(var _0x47d196=0x0;_0x47d196<_0x3649bf[_0xcba4('0x9c')];_0x47d196+=0x1){_0x4edab9['push'](ami[_0xcba4('0x9d')]({'action':_0xcba4('0x9e'),'command':util[_0xcba4('0x49')](_0xcba4('0x9f'),_0x3649bf[_0x47d196]['interval'],!_['isUndefined'](config[_0xcba4('0x99')][_0x4a43ff])?_0x4a43ff:'')})['then'](function(_0x38a61a){return _0x38a61a[_0xcba4('0xa0')]['indexOf'](_0xcba4('0xa1'))>=0x0;})[_0xcba4('0xa2')](myreject(_0x2fc74c)));}}else{_0x4edab9[_0xcba4('0xa3')](ami[_0xcba4('0x9d')]({'action':_0xcba4('0x9e'),'command':util[_0xcba4('0x49')](_0xcba4('0x9f'),_0x3649bf,!_[_0xcba4('0x43')](config[_0xcba4('0x99')][_0x4a43ff])?_0x4a43ff:'')})[_0xcba4('0x42')](function(_0x51ad63){return _0x51ad63[_0xcba4('0xa0')][_0xcba4('0xa4')](_0xcba4('0xa1'))>=0x0;})[_0xcba4('0xa2')](myreject(_0x2fc74c)));}Promise[_0xcba4('0xa5')](_0x4edab9)['then'](function(_0x4c561e){var _0xe54bd1=_[_0xcba4('0xa6')](_0x4c561e);if(_0xe54bd1){return _0x5724dd(_0xe54bd1);}else{_0x43d985[_0xcba4('0x6c')]=_0x49c582?utils[_0xcba4('0x6d')][_0xcba4('0xa7')]:utils[_0xcba4('0x6d')][_0xcba4('0xa8')];return _0x2fc74c(msgResponse(_0xcba4('0xa9'),_0xcba4('0x95'),_0xcba4('0xaa')+_0x49c582+'\x20'+_0x5dfca6+_0xcba4('0xab')+util[_0xcba4('0x6a')](_0x3649bf,{'showHidden':![],'depth':null})+_0xcba4('0xac')+_0x4a43ff));}})[_0xcba4('0xa2')](function(_0x2e6d03){return _0x2fc74c(msgResponse(_0xcba4('0x94'),'Failure',JSON[_0xcba4('0x89')](_0x2e6d03)));});});};Dialer[_0xcba4('0x1a')][_0xcba4('0x3f')]=function(){var _0x26cfe4=this;return cmHopper[_0xcba4('0xad')]({'active':![]},{'where':{'active':!![]}})[_0xcba4('0x42')](function(){setInterval(function(){_0x26cfe4[_0xcba4('0xae')]();},0x3e8);});};Dialer[_0xcba4('0x1a')]['syncCampaigns']=function(){var _0x560cfe=this;var _0x971f2b;for(var _0x13dbfe in this[_0xcba4('0x20')]){if(typeof this[_0xcba4('0x20')][_0x13dbfe]!=='undefined'){_0x971f2b=this[_0xcba4('0x20')][_0x13dbfe];if(utils['isIVRCampaign'](_0x971f2b)&&utils[_0xcba4('0x7f')](_0x971f2b)){_0x971f2b[_0xcba4('0x83')]=!![];Promise[_0xcba4('0xaf')]()[_0xcba4('0x42')](checkIsIVRCampaignActive(_0x971f2b))['then'](checkInterval(_0x971f2b))[_0xcba4('0x42')](_0x560cfe[_0xcba4('0x8e')](_0x971f2b))[_0xcba4('0x42')](_0x560cfe[_0xcba4('0x92')](_0x971f2b[_0xcba4('0xb0')],_0x971f2b[_0xcba4('0xb1')],_0x971f2b['name'],_0x971f2b))[_0xcba4('0x42')](_0x560cfe['checkIfTimeIntervals'](_0x971f2b[_0xcba4('0x7b')],_0x971f2b[_0xcba4('0xb1')],_0x971f2b[_0xcba4('0x4b')],_0x971f2b))[_0xcba4('0x42')](_0x560cfe[_0xcba4('0xb2')](_0x971f2b))[_0xcba4('0xa2')](loggerCatchQueueSummary('[syncCampaigns]',_0x971f2b));}else{notSendMessagesCampaign(_0x971f2b);}}}};Dialer['prototype']['checkDialMethod']=function(_0x1e332f){if(_0x1e332f[_0xcba4('0xb3')]!==_0xcba4('0xa')){clearPredictiveAttributes(_0x1e332f);}switch(_0x1e332f[_0xcba4('0xb3')]){case _0xcba4('0xb4'):this[_0xcba4('0xb5')](_0x1e332f,0x1);break;case _0xcba4('0xb6'):this[_0xcba4('0xb5')](_0x1e332f,_0x1e332f['dialPowerLevel']);break;case _0xcba4('0xa'):this['predictive'](_0x1e332f);break;case'booked':this[_0xcba4('0xb5')](_0x1e332f,0x1);break;default:logger[_0xcba4('0x67')](_0xcba4('0xb7'),_0x1e332f[_0xcba4('0x4b')],_0xcba4('0xb8'));}};Dialer['prototype']['ifTime']=function(_0x56c387,_0x55e1de){var _0x37ffe5=_0x56c387[_0xcba4('0xb1')];var _0x505d8e=_0x55e1de?_0x56c387[_0xcba4('0xb0')]:_0x56c387['Interval'][_0xcba4('0x7e')];logger[_0xcba4('0xb9')](_0xcba4('0xba'),_0x505d8e,_0x37ffe5,_0x56c387[_0xcba4('0x4b')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x56c387[_0xcba4('0x4b')],_0x56c387['id']));var _0xa6c06=null;return Interval[_0xcba4('0xbb')](_0x505d8e,_0x37ffe5)[_0xcba4('0x42')](function(_0x5e9b0b){if(_0x5e9b0b===!![]){return _0x5e9b0b;}else{_0x56c387[_0xcba4('0x6c')]=_0x55e1de?utils[_0xcba4('0x6d')][_0xcba4('0xa7')]:utils[_0xcba4('0x6d')][_0xcba4('0xa8')];_0xa6c06=msgResponse(_0xcba4('0xa9'),'Failure','Global:\x20'+_0x55e1de+'\x20'+_0x56c387[_0xcba4('0x4b')]+_0xcba4('0xab')+util[_0xcba4('0x6a')](_0x505d8e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x37ffe5);}if(_0xa6c06!==null){logger[_0xcba4('0xb9')](_0xcba4('0xbc'),_0xa6c06);_0xa6c06['isGlobal']=_0x55e1de;throw _0xa6c06;}})['catch'](function(_0x2fc715){logger[_0xcba4('0x67')](_0xcba4('0xbd'),_0x2fc715);throw msgResponse(_0xcba4('0x87'),'Error',util[_0xcba4('0x6a')](_0x2fc715,{'showHidden':![],'depth':null}));});};Dialer[_0xcba4('0x1a')]['syncAgentConnect']=function(_0x3ef096){if(this[_0xcba4('0x1f')][_0x3ef096[_0xcba4('0xbe')]]){if(this[_0xcba4('0x27')][_0x3ef096['uniqueid']]&&this[_0xcba4('0x27')][_0x3ef096['uniqueid']][_0xcba4('0x45')]!==_0xcba4('0xbf')){this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][_0x3ef096[_0xcba4('0xbe')]]);this['uniqueId'][_0x3ef096[_0xcba4('0xc1')]][_0xcba4('0xc2')]=moment()[_0xcba4('0x49')](_0xcba4('0xc3'));}}};Dialer[_0xcba4('0x1a')][_0xcba4('0x33')]=function(_0x1fcf15){var _0x1c9f4e=this[_0xcba4('0x27')][_0x1fcf15[_0xcba4('0xc1')]];if(this[_0xcba4('0x1f')][_0x1fcf15['queue']]){if(_0x1c9f4e&&_0x1c9f4e[_0xcba4('0x45')]!==_0xcba4('0xbf')){delete this[_0xcba4('0x27')][_0x1fcf15[_0xcba4('0xc1')]];this[_0xcba4('0x1f')][_0x1fcf15[_0xcba4('0xbe')]][_0xcba4('0xc4')]+=0x1;var _0x2dd89c=new AgentComplete(_0x1c9f4e,_0x1fcf15);if(_0x1fcf15[_0xcba4('0xc5')]===_0xcba4('0xc6')){_0x2dd89c[_0xcba4('0xc7')]=this[_0xcba4('0x1f')][_0x1fcf15[_0xcba4('0xbe')]]['dialQueueProject2']&&this[_0xcba4('0x1f')][_0x1fcf15[_0xcba4('0xbe')]][_0xcba4('0xc8')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xcba4('0xc9')](_0x2dd89c)['catch'](loggerCatch(_0xcba4('0xca')));hopperUtils[_0xcba4('0xcb')](_0x2dd89c)['catch'](loggerCatch(_0xcba4('0xcc')));}}};Dialer['prototype'][_0xcba4('0x2f')]=function(_0x2f49ed){var _0x3d1a0b=this[_0xcba4('0x27')][_0x2f49ed[_0xcba4('0xc1')]];var _0x137360=this;var _0x543de1=![];var _0x29747f;var _0x4b80ac;if(this['voiceQueues'][_0x2f49ed['queue']]){if(_0x3d1a0b&&_0x3d1a0b[_0xcba4('0x45')]!==_0xcba4('0xbf')){delete this['uniqueId'][_0x2f49ed[_0xcba4('0xc1')]];this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]]);_0x3d1a0b[_0xcba4('0xcd')]=moment()[_0xcba4('0x49')](_0xcba4('0xc3'));var _0x540d66=new QueueCallerAbandon(_0x3d1a0b,_0x2f49ed);if(utils[_0xcba4('0xce')](_0x3d1a0b[_0xcba4('0xcd')],_0x3d1a0b[_0xcba4('0xcf')])>=_0x3d1a0b[_0xcba4('0xd0')]){this[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x2f49ed[_0xcba4('0xbe')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]][_0xcba4('0xd1')]+=0x1;_0x540d66['state']=0xa;_0x540d66['statedesc']='Drop';_0x540d66[_0xcba4('0xd2')]='TIMEOUT';_0x540d66[_0xcba4('0xc7')]=this[_0xcba4('0x1f')][_0x2f49ed['queue']][_0xcba4('0xd3')]?moment()[_0xcba4('0x49')](_0xcba4('0xc3')):undefined;_0x540d66[_0xcba4('0xd4')]+=0x1;_0x540d66[_0xcba4('0xd5')]+=0x1;_0x29747f=this['voiceQueues'][_0x2f49ed['queue']]['dialDropRetryFrequency'];_0x4b80ac=this['voiceQueues'][_0x2f49ed[_0xcba4('0xbe')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xcba4('0xd6')](_0x540d66,_0x540d66[_0xcba4('0x73')],_0x3d1a0b[_0xcba4('0xd7')])[_0xcba4('0x42')](function(_0x27f6bb){_0x543de1=_0x27f6bb['additional']==0x1;if(_0x540d66[_0xcba4('0xd4')]>=_0x137360[_0xcba4('0x1f')][_0x2f49ed['queue']][_0xcba4('0xd8')]){_0x137360[_0xcba4('0xd9')](_0x540d66,_0x27f6bb[_0xcba4('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x540d66[_0xcba4('0xd4')],'scheduledat':moment()[_0xcba4('0xdb')](_0x137360['voiceQueues'][_0x2f49ed[_0xcba4('0xbe')]]['dialDropRetryFrequency'],_0xcba4('0xdc'))[_0xcba4('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3d1a0b[_0xcba4('0xdd')],'ListId':_0x3d1a0b[_0xcba4('0xde')],'VoiceQueueId':_0x3d1a0b[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3d1a0b[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact][Drop]'));var _0x3adbdc=new History(_0x540d66);_0x3adbdc[_0xcba4('0x73')]=0xa;_0x3adbdc[_0xcba4('0x74')]=_0xcba4('0xe1');_0x3adbdc[_0xcba4('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3adbdc[_0xcba4('0x75')]=_0x3adbdc['starttime'];_0x3adbdc[_0xcba4('0xe2')]=_0x540d66[_0xcba4('0xe2')];_0x3adbdc[_0xcba4('0xe3')]=_0x540d66['calleridnum'];hopperUtils[_0xcba4('0xc9')](_0x3adbdc)['catch'](loggerCatch(_0xcba4('0xe4')));}})[_0xcba4('0x42')](function(){if(_0x543de1)hopperUtils[_0xcba4('0xe5')](_0x540d66,_0x29747f,_0x4b80ac)['then'](function(){return 0x1;});});}else{this[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]][_0xcba4('0x52')]+=0x1;this[_0xcba4('0x1f')][_0x2f49ed['queue']][_0xcba4('0xe6')]+=0x1;_0x540d66['state']=0xb;_0x540d66[_0xcba4('0x74')]=_0xcba4('0xe7');_0x540d66[_0xcba4('0xd2')]=_0xcba4('0xe8');_0x540d66[_0xcba4('0xe9')]+=0x1;_0x540d66['countglobal']+=0x1;_0x29747f=this[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]][_0xcba4('0xea')];_0x4b80ac=this[_0xcba4('0x1f')][_0x2f49ed['queue']][_0xcba4('0xeb')];hopperUtils[_0xcba4('0xd6')](_0x540d66,_0x540d66['state'],_0x3d1a0b[_0xcba4('0xd7')])[_0xcba4('0x42')](function(_0x3d0e7c){if(_0x540d66[_0xcba4('0xe9')]>=_0x137360[_0xcba4('0x1f')][_0x2f49ed[_0xcba4('0xbe')]][_0xcba4('0xec')]){_0x137360[_0xcba4('0xd9')](_0x540d66,_0x3d0e7c[_0xcba4('0xda')]);}else{hopperUtils[_0xcba4('0xed')]({'active':![],'countabandonedretry':_0x540d66[_0xcba4('0xe9')],'scheduledat':moment()[_0xcba4('0xdb')](_0x137360[_0xcba4('0x1f')][_0x2f49ed['queue']][_0xcba4('0xea')],_0xcba4('0xdc'))['format'](_0xcba4('0xc3')),'ContactId':_0x3d1a0b[_0xcba4('0xdd')],'ListId':_0x3d1a0b['ListId'],'VoiceQueueId':_0x3d1a0b[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3d1a0b[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5a263b=new History(_0x540d66);_0x5a263b[_0xcba4('0x73')]=0xb;_0x5a263b[_0xcba4('0x74')]=_0xcba4('0xe7');_0x5a263b[_0xcba4('0x76')]=moment()['format'](_0xcba4('0xc3'));_0x5a263b[_0xcba4('0x75')]=_0x5a263b[_0xcba4('0x76')];_0x5a263b[_0xcba4('0xe2')]=_0x540d66[_0xcba4('0xe2')];_0x5a263b[_0xcba4('0xe3')]=_0x540d66[_0xcba4('0xe3')];hopperUtils[_0xcba4('0xc9')](_0x5a263b)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0xee')));}})[_0xcba4('0x42')](function(){if(_0x543de1)hopperUtils[_0xcba4('0xe5')](_0x540d66,_0x29747f,_0x4b80ac)[_0xcba4('0x42')](function(){return 0x1;});});}}}};Dialer[_0xcba4('0x1a')]['syncNewExten']=function(_0xdb77b5){if(this[_0xcba4('0x25')][_0xdb77b5[_0xcba4('0xc1')]]){this[_0xcba4('0x25')][_0xdb77b5[_0xcba4('0xc1')]][_0xcba4('0xef')]=_0xdb77b5[_0xcba4('0xef')];}if(this['uniqueId'][_0xdb77b5[_0xcba4('0xc1')]]){this[_0xcba4('0x27')][_0xdb77b5['uniqueid']][_0xcba4('0xef')]=_0xdb77b5[_0xcba4('0xef')];}};Dialer['prototype'][_0xcba4('0x3d')]=function(_0x4ed731){if(!this[_0xcba4('0x25')][_0x4ed731[_0xcba4('0xf0')]]){return;}var _0x45ea02=this[_0xcba4('0x1f')][this['actions'][_0x4ed731['actionid']][_0xcba4('0xbe')]][_0xcba4('0xf1')]||_0xcba4('0xf2');if(_0x45ea02===_0xcba4('0xf3')){if(this['actions'][_0x4ed731[_0xcba4('0xf0')]]&&_[_0xcba4('0xf4')](this['actions'][_0x4ed731[_0xcba4('0xf0')]]['locked'])&&_0x4ed731[_0xcba4('0x8c')]==='1'&&_0x4ed731['paused']==='0'){if(this[_0xcba4('0x21')][_0x4ed731[_0xcba4('0xf5')]]){if(!this[_0xcba4('0x21')][_0x4ed731[_0xcba4('0xf5')]][_0xcba4('0xf6')]){this[_0xcba4('0x21')][_0x4ed731['stateinterface']][_0xcba4('0xf6')]=!![];this[_0xcba4('0x25')][_0x4ed731['actionid']]['locked']=!![];this['actions'][_0x4ed731['actionid']][_0xcba4('0xf5')]=_0x4ed731[_0xcba4('0xf5')];}}}}else if(_0x45ea02===_0xcba4('0xf2')){if(this[_0xcba4('0x25')][_0x4ed731[_0xcba4('0xf0')]]){if(this['agents'][_0x4ed731[_0xcba4('0xf5')]]){this[_0xcba4('0x25')][_0x4ed731[_0xcba4('0xf0')]][_0xcba4('0xf5')]=_0x4ed731['stateinterface'];if(_[_0xcba4('0xf4')](this[_0xcba4('0x2b')][this['actions'][_0x4ed731['actionid']]['queue']])){this['queueBooked'][this['actions'][_0x4ed731[_0xcba4('0xf0')]]['queue']]=[];}this[_0xcba4('0x2b')][this[_0xcba4('0x25')][_0x4ed731[_0xcba4('0xf0')]]['queue']][_0xcba4('0xa3')](_[_0xcba4('0x63')](_[_0xcba4('0x7a')](this[_0xcba4('0x25')][_0x4ed731[_0xcba4('0xf0')]],[_0xcba4('0xf7'),'stateinterface']),{'status':_0x4ed731[_0xcba4('0x8c')],'paused':_0x4ed731[_0xcba4('0xf8')]}));}}}};Dialer[_0xcba4('0x1a')][_0xcba4('0xf9')]=function(_0x4261ac){if(!this[_0xcba4('0x25')][_0x4261ac['actionid']]){return;}var _0x28a4a2=this;var _0x3410d1=this[_0xcba4('0x1f')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]];var _0x3dffbd=_0x3410d1[_0xcba4('0xf1')]||_0xcba4('0xf2');if(_0x3dffbd===_0xcba4('0xf3')){if(this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]]&&this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xf5')]){this[_0xcba4('0x1e')]['run'](this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xf7')],this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xf5')])[_0xcba4('0xa2')](function(_0x41cc37){logger[_0xcba4('0x67')](_0xcba4('0xfa'),util[_0xcba4('0x6a')](_0x41cc37,{'showHidden':![],'depth':null}));})[_0xcba4('0x1d')](function(){_0x28a4a2[_0xcba4('0xc0')](_0x28a4a2[_0xcba4('0x1f')][_0x28a4a2[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);_0x28a4a2[_0xcba4('0x21')][_0x28a4a2[_0xcba4('0x25')][_0x4261ac['actionid']]['stateinterface']]['locked']=![];delete _0x28a4a2[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1);});}else{this['updateOriginated'](this[_0xcba4('0x1f')][this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x4261ac['actionid']][_0xcba4('0xdd')],'ListId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xde')],'VoiceQueueId':this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xdf')]||undefined,'CampaignId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0xfb')));delete this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1);}}else if(_0x3dffbd===_0xcba4('0xf2')){var _0xe88c2e;if(this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]]&&!_[_0xcba4('0xfc')](this[_0xcba4('0x2b')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]])){if(this[_0xcba4('0xfd')][_0x28a4a2['actions'][_0x4261ac[_0xcba4('0xf0')]]['queue']]){this[_0xcba4('0xfd')][_0x28a4a2[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]=this[_0xcba4('0xfd')][this[_0xcba4('0x25')][_0x4261ac['actionid']][_0xcba4('0xbe')]]?this[_0xcba4('0xfd')][this[_0xcba4('0x25')][_0x4261ac['actionid']][_0xcba4('0xbe')]]:this[_0xcba4('0x2b')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]]['queue']]?this[_0xcba4('0x2b')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]][_0xcba4('0xfe')]||0x0:0x0;}this[_0xcba4('0x2b')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]][_0xcba4('0xfe')]=this['queueBookedRR'][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]];for(var _0x513d7d=0x0;_0x513d7d<this[_0xcba4('0x2b')][this['actions'][_0x4261ac['actionid']][_0xcba4('0xbe')]][_0xcba4('0x9c')];_0x513d7d+=0x1){_0xe88c2e=rr(this[_0xcba4('0x2b')][this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);this[_0xcba4('0xfd')][_0x28a4a2[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]]['queue']]=this[_0xcba4('0x2b')][this['actions'][_0x4261ac[_0xcba4('0xf0')]]['queue']]['_rr'];if(_0xe88c2e['status']==='1'&&_0xe88c2e[_0xcba4('0xf8')]==='0'){break;}}if(!_[_0xcba4('0xf4')](_0xe88c2e)){this[_0xcba4('0x21')][_0xe88c2e[_0xcba4('0xf5')]][_0xcba4('0xff')]=_[_0xcba4('0x43')](this['agents'][_0xe88c2e[_0xcba4('0xf5')]][_0xcba4('0xff')])?!![]:this[_0xcba4('0x21')][_0xe88c2e[_0xcba4('0xf5')]]['unlockRR'];}loggerBooked[_0xcba4('0x4c')](_0xcba4('0x100'),_0x4261ac[_0xcba4('0xf0')],'Agent:\x20',JSON[_0xcba4('0x89')](_[_0xcba4('0x7a')](this[_0xcba4('0x21')][_0xe88c2e[_0xcba4('0xf5')]],[_0xcba4('0x4b'),'unlockRR'])),_0xcba4('0x101'),JSON[_0xcba4('0x89')](_0xe88c2e[_0xcba4('0xf7')]));if(!_[_0xcba4('0xf4')](_0xe88c2e)&&_0xe88c2e[_0xcba4('0x8c')]==='1'&&_0xe88c2e[_0xcba4('0xf8')]==='0'&&this['agents'][_0xe88c2e[_0xcba4('0xf5')]]['unlockRR']){this[_0xcba4('0x21')][_0xe88c2e[_0xcba4('0xf5')]][_0xcba4('0xff')]=![];this[_0xcba4('0x2b')][_0x28a4a2['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]=[];this[_0xcba4('0x1e')]['run'](_0xe88c2e[_0xcba4('0xf7')],_0xe88c2e[_0xcba4('0xf5')])[_0xcba4('0xa2')](function(_0x151e92){logger[_0xcba4('0x67')](_0xcba4('0xfa'),util[_0xcba4('0x6a')](_0x151e92,{'showHidden':![],'depth':null}));})['finally'](function(){_0x28a4a2['updateOriginated'](_0x28a4a2['voiceQueues'][_0x28a4a2[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);setTimeout(function(){_0x28a4a2['agents'][_0xe88c2e['stateinterface']][_0xcba4('0xff')]=!![];loggerBooked[_0xcba4('0x4c')]('[booked][RR][finaly]',_0x4261ac['actionid'],'Agent:\x20',JSON[_0xcba4('0x89')](_['pick'](_0x28a4a2[_0xcba4('0x21')][_0xe88c2e[_0xcba4('0xf5')]],[_0xcba4('0x4b'),'unlockRR'])),_0xcba4('0x101'),JSON['stringify'](_0xe88c2e[_0xcba4('0xf7')]));},0xc7);delete _0x28a4a2['actions'][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1,_0x4261ac[_0xcba4('0xf0')]);});}else{loggerBooked[_0xcba4('0x4c')](_0xcba4('0x102'));this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xcba4('0x25')][_0x4261ac['actionid']][_0xcba4('0xdd')],'ListId':this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xde')],'VoiceQueueId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xdf')]||undefined,'CampaignId':this[_0xcba4('0x25')][_0x4261ac['actionid']]['CampaignId']||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0xfb')));delete this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1);}}else{loggerBooked[_0xcba4('0x4c')](_0xcba4('0x103'));this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][this['actions'][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);hopperUtils[_0xcba4('0xed')]({'active':![],'ContactId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xdd')],'ListId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]]['ListId'],'VoiceQueueId':this[_0xcba4('0x25')][_0x4261ac['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xcba4('0x25')][_0x4261ac['actionid']][_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1);}}else{loggerBooked['info'](_0xcba4('0x104'));this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xbe')]]);hopperUtils[_0xcba4('0xed')]({'active':![],'ContactId':this[_0xcba4('0x25')][_0x4261ac['actionid']][_0xcba4('0xdd')],'ListId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xde')],'VoiceQueueId':this['actions'][_0x4261ac[_0xcba4('0xf0')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xcba4('0x25')][_0x4261ac[_0xcba4('0xf0')]][_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x105')));delete this['actions'][_0x4261ac[_0xcba4('0xf0')]];unlockQueueStatus(_0x3410d1);}};Dialer[_0xcba4('0x1a')][_0xcba4('0x31')]=function(_0x1462ed){var _0x32c633=this[_0xcba4('0x25')][_0x1462ed['actionid']];if(_0x32c633){delete this[_0xcba4('0x25')][_0x1462ed['actionid']];_0x32c633['responsetime']=moment()[_0xcba4('0x49')]('YYYY-MM-DD\x20HH:mm:ss');var _0x29fcf8=_0x32c633[_0xcba4('0x45')]===_0xcba4('0xbf')?this[_0xcba4('0x20')][_0x32c633[_0xcba4('0xbe')]]:this[_0xcba4('0x1f')][_0x32c633[_0xcba4('0x106')]()];if(_0x1462ed[_0xcba4('0x107')]!==_0xcba4('0x108')){this[_0xcba4('0xc0')](_0x29fcf8);return this[_0xcba4('0x109')](_0x32c633,_0x29fcf8,_0x1462ed)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x10a')));}this[_0xcba4('0x27')][_0x1462ed[_0xcba4('0xc1')]]=_0x32c633;}};Dialer[_0xcba4('0x1a')][_0xcba4('0x3b')]=function(_0x35745b){var _0x1a4c87=this;var _0x25700d=this['uniqueId'][_0x35745b[_0xcba4('0xc1')]];var _0x38bcce;if(!_[_0xcba4('0xf4')](_0x35745b)&&!_[_0xcba4('0xf4')](_0x35745b[_0xcba4('0x10b')])&&!_[_0xcba4('0xf4')](_0x35745b[_0xcba4('0x10b')]['amdstatus'])&&_0x35745b[_0xcba4('0x10c')]==='xcally-motion-dialer'&&_0x25700d){if(_0x25700d[_0xcba4('0x45')]!==_0xcba4('0xbf')&&this[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0x10d')]&&_0x35745b['value']===_0xcba4('0x10e')){delete this['uniqueId'][_0x35745b[_0xcba4('0xc1')]];this['updateOriginated'](this[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]]);this[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0xc4')]+=0x1;this['voiceQueues'][_0x25700d['queue']][_0xcba4('0x10f')]+=0x1;_0x38bcce=new Hangup(_0x25700d,_0x35745b);_0x38bcce[_0xcba4('0x73')]=0x12;_0x38bcce['statedesc']=_0xcba4('0x110');_0x38bcce[_0xcba4('0x111')]=_0xcba4('0x112');ami['emit'](_0xcba4('0x113'),ut['buildObj'](_0x38bcce,'amd'));this[_0xcba4('0x114')](_0x38bcce,_0xcba4('0x115'),_0xcba4('0x116'));}if(_0x25700d[_0xcba4('0x45')]!==_0xcba4('0xbf')&&this['voiceQueues'][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0x10d')]&&_0x35745b[_0xcba4('0x117')]===_0xcba4('0x118')){return new Promise(function(_0x195912,_0x53fe93){delete _0x1a4c87['uniqueId'][_0x35745b['uniqueid']];_0x1a4c87[_0xcba4('0xc0')](_0x1a4c87[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]]);_0x1a4c87['voiceQueues'][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0xc4')]+=0x1;_0x1a4c87[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x40523a=_0x1a4c87[_0xcba4('0x1f')][_0x25700d[_0xcba4('0xbe')]];var _0x5f58aa=new Hangup(_0x25700d,_0x35745b);_0x5f58aa[_0xcba4('0x73')]=0x13;_0x5f58aa[_0xcba4('0x74')]=_0xcba4('0x119');_0x5f58aa[_0xcba4('0x111')]='AMD';_0x5f58aa[_0xcba4('0x11a')]+=0x1;_0x5f58aa[_0xcba4('0xd5')]+=0x1;_0x5f58aa[_0xcba4('0x11b')]=!![];ami[_0xcba4('0x44')](_0xcba4('0x113'),ut[_0xcba4('0x11c')](_0x5f58aa,_0xcba4('0x11b')));hopperUtils[_0xcba4('0xc9')](_0x5f58aa)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5f58aa[_0xcba4('0x11d')]+_0x5f58aa[_0xcba4('0x11e')]+_0x5f58aa['countnoanswerretry']+_0x5f58aa[_0xcba4('0x11f')]+_0x5f58aa[_0xcba4('0xd4')]+_0x5f58aa[_0xcba4('0xe9')]+_0x5f58aa[_0xcba4('0x11a')]+_0x5f58aa['countagentrejectretry']>=_0x40523a[_0xcba4('0x120')]){_0x1a4c87[_0xcba4('0x121')](_0x5f58aa,_0x195912,_0x53fe93,_0xcba4('0x122'));}else{if(_0x5f58aa[_0xcba4('0x11a')]>=_0x40523a['dialMachineMaxRetry']){_0x1a4c87[_0xcba4('0x123')](_0x5f58aa,_0x195912,_0x53fe93,'reason\x2019\x20machine....');}else{hopperUtils[_0xcba4('0xed')]({'active':![],'countmachineretry':_0x5f58aa['countmachineretry'],'scheduledat':moment()[_0xcba4('0xdb')](_0x40523a['dialMachineRetryFrequency'],'minutes')[_0xcba4('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5f58aa['ContactId'],'ListId':_0x5f58aa[_0xcba4('0xde')],'VoiceQueueId':_0x5f58aa['VoiceQueueId']||undefined,'CampaignId':_0x5f58aa['CampaignId']||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact][Machine]'));_0x195912({'reschedule':0x1});}}});}if(_0x25700d['type']==='ivr'&&this[_0xcba4('0x20')][_0x25700d[_0xcba4('0xbe')]]['dialAMDActive']&&_0x35745b['value']==='HANGUP'){delete this[_0xcba4('0x27')][_0x35745b[_0xcba4('0xc1')]];this[_0xcba4('0xc0')](this[_0xcba4('0x20')][_0x25700d['queue']]);_0x38bcce=new Hangup(_0x25700d,_0x35745b);_0x38bcce['state']=0x12;_0x38bcce[_0xcba4('0x74')]=_0xcba4('0x110');_0x38bcce[_0xcba4('0x111')]=_0xcba4('0x112');ami['emit'](_0xcba4('0x113'),ut[_0xcba4('0x11c')](_0x38bcce,_0xcba4('0x11b')));this['saveInDb'](_0x38bcce,_0xcba4('0x124'),'[syncHangupInAMDIvr]');}if(_0x25700d[_0xcba4('0x45')]==='ivr'&&this[_0xcba4('0x20')][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0x10d')]&&_0x35745b[_0xcba4('0x117')]===_0xcba4('0x118')){return new Promise(function(_0x2632ce,_0x14712f){delete _0x1a4c87[_0xcba4('0x27')][_0x35745b[_0xcba4('0xc1')]];_0x1a4c87[_0xcba4('0xc0')](_0x1a4c87[_0xcba4('0x20')][_0x25700d['queue']]);_0x1a4c87[_0xcba4('0x20')][_0x25700d[_0xcba4('0xbe')]][_0xcba4('0xc4')]+=0x1;_0x1a4c87[_0xcba4('0x20')][_0x25700d['queue']][_0xcba4('0x10f')]+=0x1;var _0x4e7ca5=_0x1a4c87[_0xcba4('0x20')][_0x25700d[_0xcba4('0xbe')]];var _0x35a016=new Hangup(_0x25700d,_0x35745b);_0x35a016[_0xcba4('0x73')]=0x13;_0x35a016['statedesc']=_0xcba4('0x119');_0x35a016[_0xcba4('0x111')]='AMD';_0x35a016[_0xcba4('0x11a')]+=0x1;_0x35a016[_0xcba4('0xd5')]+=0x1;_0x35a016[_0xcba4('0x11b')]=!![];ami['emit'](_0xcba4('0x113'),ut[_0xcba4('0x11c')](_0x35a016,_0xcba4('0x11b')));hopperUtils[_0xcba4('0xc9')](_0x35a016)[_0xcba4('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x35a016[_0xcba4('0x11d')]+_0x35a016[_0xcba4('0x11e')]+_0x35a016[_0xcba4('0x125')]+_0x35a016['countnosuchnumberretry']+_0x35a016[_0xcba4('0xd4')]+_0x35a016[_0xcba4('0xe9')]+_0x35a016['countmachineretry']+_0x35a016[_0xcba4('0x126')]>=_0x4e7ca5['dialGlobalMaxRetry']){_0x1a4c87[_0xcba4('0x121')](_0x35a016,_0x2632ce,_0x14712f,'reason19\x20machine....');}else{if(_0x35a016[_0xcba4('0x11a')]>=_0x4e7ca5[_0xcba4('0x127')]){_0x1a4c87[_0xcba4('0x123')](_0x35a016,_0x2632ce,_0x14712f,_0xcba4('0x128'));}else{hopperUtils[_0xcba4('0xed')]({'active':![],'countmachineretry':_0x35a016[_0xcba4('0x11a')],'scheduledat':moment()[_0xcba4('0xdb')](_0x4e7ca5[_0xcba4('0x129')],_0xcba4('0xdc'))[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x35a016[_0xcba4('0xdd')],'ListId':_0x35a016[_0xcba4('0xde')],'VoiceQueueId':_0x35a016[_0xcba4('0xdf')]||undefined,'CampaignId':_0x35a016['CampaignId']||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact][Machine]'));_0x2632ce({'reschedule':0x1});}}});}}};Dialer[_0xcba4('0x1a')][_0xcba4('0x38')]=function(_0x4e23b6){var _0x2e3549=this[_0xcba4('0x27')][_0x4e23b6['uniqueid']];var _0x48b4bc;if(_0x2e3549&&_0x2e3549[_0xcba4('0x45')]===_0xcba4('0xbf')){delete this[_0xcba4('0x27')][_0x4e23b6[_0xcba4('0xc1')]];this[_0xcba4('0xc0')](this['campaigns'][_0x2e3549['queue']]);this['campaigns'][_0x2e3549[_0xcba4('0xbe')]][_0xcba4('0x12a')]+=0x1;_0x48b4bc=new Hangup(_0x2e3549,_0x4e23b6);hopperUtils[_0xcba4('0xc9')](_0x48b4bc)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x12b')));hopperUtils[_0xcba4('0xcb')](_0x48b4bc)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x12c')));}if(_0x2e3549&&_0x2e3549['type']!==_0xcba4('0xbf')&&isNotNull(this['voiceQueues'][_0x2e3549[_0xcba4('0xbe')]][_0xcba4('0x12d')])){delete this[_0xcba4('0x27')][_0x4e23b6['uniqueid']];this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][_0x2e3549[_0xcba4('0xbe')]]);this[_0xcba4('0x1f')][_0x2e3549['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xcba4('0x1f')][_0x2e3549[_0xcba4('0xbe')]][_0xcba4('0x10f')]+=0x1;_0x48b4bc=new Hangup(_0x2e3549,_0x4e23b6);_0x48b4bc[_0xcba4('0x73')]=0x10;_0x48b4bc[_0xcba4('0x74')]=_0xcba4('0x12e');_0x48b4bc[_0xcba4('0x111')]=_0xcba4('0x12f');hopperUtils[_0xcba4('0xc9')](_0x48b4bc)['catch'](loggerCatch(_0xcba4('0x12b')));hopperUtils[_0xcba4('0xcb')](_0x48b4bc)['catch'](loggerCatch(_0xcba4('0x12c')));}if(_0x2e3549&&_0x2e3549['type']!=='ivr'&&!isNotNull(this[_0xcba4('0x1f')][_0x2e3549[_0xcba4('0xbe')]][_0xcba4('0x12d')])){delete this[_0xcba4('0x27')][_0x4e23b6[_0xcba4('0xc1')]];this[_0xcba4('0xc0')](this[_0xcba4('0x1f')][_0x2e3549[_0xcba4('0xbe')]]);this[_0xcba4('0x1f')][_0x2e3549[_0xcba4('0xbe')]][_0xcba4('0x130')]+=0x1;_0x48b4bc=new Hangup(_0x2e3549,_0x4e23b6);_0x48b4bc[_0xcba4('0x73')]=0xc;_0x48b4bc[_0xcba4('0x74')]=_0x4e23b6[_0xcba4('0x131')];_0x48b4bc['membername']=_0xcba4('0x132');hopperUtils[_0xcba4('0xc9')](_0x48b4bc)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x12b')));hopperUtils[_0xcba4('0xcb')](_0x48b4bc)[_0xcba4('0xa2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xcba4('0x1a')][_0xcba4('0xc')]=function(_0x1ddda9){var _0xe183c4=this;if(!_0xe183c4[_0xcba4('0x133')][_0x1ddda9[_0xcba4('0x4b')]]){_0xe183c4[_0xcba4('0x133')][_0x1ddda9['name']]={'running':![]};}else if(_0xe183c4['queuesSummary'][_0x1ddda9[_0xcba4('0x4b')]][_0xcba4('0x134')]===!![]){return;}else if(_0xe183c4[_0xcba4('0x133')][_0x1ddda9[_0xcba4('0x4b')]][_0xcba4('0x134')]===![]){_0xe183c4[_0xcba4('0x133')][_0x1ddda9[_0xcba4('0x4b')]][_0xcba4('0x134')]=!![];}var _0x38f588=_0xe183c4[_0xcba4('0x1f')][_0x1ddda9['name']];var _0x1d2f86=_0x38f588[_0xcba4('0x6c')]!==utils[_0xcba4('0x6d')][_0xcba4('0x80')];var _0x69f098=utils[_0xcba4('0x135')](_0x38f588);_0x38f588['message']=utils[_0xcba4('0x136')](_0x38f588,_0xe183c4[_0xcba4('0x22')]);Promise[_0xcba4('0xaf')]()[_0xcba4('0x42')](function(){if(_0x38f588['message']===utils[_0xcba4('0x6d')][_0xcba4('0x80')]){if(_0x1d2f86){clearPredictiveAttributes(_0x38f588);_0x1ddda9[_0xcba4('0x28')]=undefined;_0x1ddda9['startProgressive']=undefined;}if(_0x38f588[_0xcba4('0x6c')]===utils[_0xcba4('0x6d')][_0xcba4('0x80')]){_0x1ddda9[_0xcba4('0x137')]=0x0;}}else if(_0x38f588['message']===utils[_0xcba4('0x6d')][_0xcba4('0x138')]&&!_0x69f098){return _0xe183c4[_0xcba4('0x94')](_0x38f588,!![])[_0xcba4('0x42')](function(){return _0xe183c4['ifTime'](_0x38f588,![]);})[_0xcba4('0x42')](function(){return _0xe183c4['checkDialMethod'](_0x38f588);})['catch'](function(_0x3dda02){loggerSyncQueueSummary[_0xcba4('0x47')](_0xcba4('0x139'),util[_0xcba4('0x6a')](_0x3dda02,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x38f588);});}else{clearPredictiveAttributes(_0x38f588);}})['then'](function(){var _0x1909eb=_0x1ddda9[_0xcba4('0x13a')](_0x38f588);if(_0x1909eb||_0x38f588[_0xcba4('0x13b')]){_0x38f588['queueSummaryCountersUpdated']=![];_0x1ddda9[_0xcba4('0x13c')](_0x38f588);Object['assign'](_0x38f588,_0x1ddda9);emitOutboundVoiceQueueSummary(_0x1ddda9);}_0xe183c4[_0xcba4('0x133')][_0x38f588[_0xcba4('0x4b')]]['running']=![];})['catch'](function(_0x2570e){logger['error'](_0xcba4('0x139'),util[_0xcba4('0x6a')](_0x2570e,{'showHidden':![],'depth':null}));_0xe183c4[_0xcba4('0x133')][_0x38f588[_0xcba4('0x4b')]]['running']=![];});};Dialer[_0xcba4('0x1a')][_0xcba4('0x36')]=_['throttle'](function(){var _0x24b53a=_[_0xcba4('0x13d')](this['voiceQueues'],function(_0x278ff3){return _0x278ff3[_0xcba4('0x13e')];});var _0x1e2d95=_['filter'](this[_0xcba4('0x21')],function(_0x4dbbfd){return _0x4dbbfd['online']&&_0x4dbbfd['status']===_0xcba4('0x8d');});if(_0x24b53a[_0xcba4('0x9c')]>0x0&&_0x1e2d95[_0xcba4('0x9c')]>0x0){return Promise['resolve']()[_0xcba4('0x42')](cmHopper[_0xcba4('0x13f')](_[_0xcba4('0x140')](_0x24b53a,'id'),previewRecallmeReminderInterval,_[_0xcba4('0x140')](_0x1e2d95,'id')))[_0xcba4('0x42')](function(_0x1961ee){for(var _0xa59f40=0x0;_0xa59f40<_0x1961ee['length'];_0xa59f40++){var _0x270f25=_0x1961ee[_0xa59f40][_0xcba4('0x141')][_0xcba4('0x4b')];if(_0x270f25)io['to'](util[_0xcba4('0x49')](_0xcba4('0x142'),_0x270f25))[_0xcba4('0x44')](_0xcba4('0x143'),{'hopper':_0x1961ee[_0xa59f40]});}})[_0xcba4('0xa2')](function(_0x321512){logger[_0xcba4('0x67')](_0xcba4('0x144'),_0x321512);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xcba4('0x40')]=function(){var _0xb64cf8=this;setInterval(function(){_0xb64cf8[_0xcba4('0x145')](_0xb64cf8[_0xcba4('0x27')],_0xcba4('0x146'));_0xb64cf8['clearZombieChannels'](_0xb64cf8[_0xcba4('0x25')],_0xcba4('0x147'));},0x32c8);};Dialer[_0xcba4('0x1a')][_0xcba4('0x145')]=function(_0x50bf4f,_0x3050f7){var _0x1628df=this;for(var _0x25bba2 in _0x50bf4f){if(typeof _0x50bf4f[_0x25bba2]!==_0xcba4('0x148')){this['sequence'][_0xcba4('0x1b')](function(){if(!_['isNil'](_0x50bf4f[_0x25bba2])){return ami[_0xcba4('0x9d')]({'action':_0xcba4('0x8c'),'channel':_0x50bf4f[_0x25bba2][_0xcba4('0xef')]})['catch'](function(_0x34362b){if(_0x34362b[_0xcba4('0x6c')]===_0xcba4('0x149')){setTimeout(function(){if(_0x50bf4f[_0x25bba2]&&_0x50bf4f[_0x25bba2][_0xcba4('0x45')]!==_0xcba4('0xbf')){_0x1628df[_0xcba4('0xc0')](_0x1628df[_0xcba4('0x1f')][_0x50bf4f[_0x25bba2]['queue']]);logger[_0xcba4('0x67')]('[Dialer][checkChannel]',_0x3050f7,_0x25bba2,_0x50bf4f[_0x25bba2][_0xcba4('0xbe')]);delete _0x50bf4f[_0x25bba2];}if(_0x50bf4f[_0x25bba2]&&_0x50bf4f[_0x25bba2][_0xcba4('0x45')]===_0xcba4('0xbf')){_0x1628df[_0xcba4('0xc0')](_0x1628df[_0xcba4('0x20')][_0x50bf4f[_0x25bba2][_0xcba4('0xbe')]]);logger['error'](_0xcba4('0x14a'),_0x3050f7,_0x25bba2,_0x50bf4f[_0x25bba2][_0xcba4('0xbe')]);delete _0x50bf4f[_0x25bba2];}},0x2328);}});}});}}};Dialer['prototype'][_0xcba4('0x14b')]=function(_0x4a8549){return Promise['resolve']()[_0xcba4('0x42')](voiceQueueRt[_0xcba4('0x14b')](_0x4a8549))[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x14c')));};Dialer[_0xcba4('0x1a')]['updateOriginated']=function(_0x5cf950){if(!_['isUndefined'](_0x5cf950)&&_0x5cf950!==null){if(typeof _0x5cf950[_0xcba4('0x84')]!=='undefined'){if(_0x5cf950[_0xcba4('0x84')]>0x0){_0x5cf950[_0xcba4('0x84')]-=0x1;}else{logger[_0xcba4('0x67')](_0xcba4('0x14d'));}}}else{logger['error'](_0xcba4('0x14e'));}};Dialer[_0xcba4('0x1a')][_0xcba4('0x14f')]=function(_0x270dc1,_0x3be2d4){var _0x3172e7=this;return function(_0x55f3cf){_0x3172e7[_0xcba4('0xc0')](_0x3be2d4);logger[_0xcba4('0x67')](_0x270dc1,util[_0xcba4('0x6a')](_0x55f3cf,{'showHidden':![],'depth':null}));};};Dialer[_0xcba4('0x1a')]['emptyContact']=function(_0x1a719d,_0x5a5eb4,_0x516dbd){var _0x2925b0={'state':0x19,'statedesc':_0xcba4('0x150')};this[_0xcba4('0xc0')](_0x5a5eb4);this['saveInDb'](_[_0xcba4('0x63')](_0x2925b0,_[_0xcba4('0x7a')](_0x516dbd,[_0xcba4('0xdd'),_0xcba4('0xde'),_0xcba4('0x151'),_0xcba4('0xdf'),_0xcba4('0xe0')])),_0xcba4('0x152'),'[emptyContact]');logger['error'](_0x1a719d);};Dialer[_0xcba4('0x1a')][_0xcba4('0x114')]=function(_0x5296a7,_0x5227cc,_0x1502d0){hopperUtils['createHistory'](_0x5296a7)[_0xcba4('0xa2')](loggerCatch(_0x5227cc));hopperUtils['moveContactManagedDialer'](_0x5296a7)[_0xcba4('0xa2')](loggerCatch(_0x1502d0));};Dialer[_0xcba4('0x1a')][_0xcba4('0xd9')]=function(_0x220e2c,_0x48c714){hopperUtils[_0xcba4('0xc9')](_0x220e2c)[_0xcba4('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x48c714==0x0){hopperUtils[_0xcba4('0xcb')](_0x220e2c)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x153')));}};Dialer[_0xcba4('0x1a')]['checkPreviewRecallReminder']=function(_0xb538b1){return Promise[_0xcba4('0xaf')]()[_0xcba4('0x42')](cmHopper[_0xcba4('0x13f')](_0xb538b1['id'],previewRecallmeReminderInterval))[_0xcba4('0x42')](function(_0xdf4468){for(var _0x2e19a5=0x0;_0x2e19a5<_0xdf4468[_0xcba4('0x9c')];_0x2e19a5++){var _0x56b655=_0xdf4468[_0x2e19a5]['Agent']['name'];if(_0x56b655)io['to'](util[_0xcba4('0x49')](_0xcba4('0x142'),_0x56b655))[_0xcba4('0x44')](_0xcba4('0x143'),{'hopper':_0xdf4468[_0x2e19a5]});}})['catch'](function(){});};Dialer[_0xcba4('0x1a')][_0xcba4('0xb2')]=function(_0xc6965d){var _0x23361=this;return function(){_0x23361[_0xcba4('0x154')](_0xc6965d);};};Dialer[_0xcba4('0x1a')][_0xcba4('0x155')]=function(_0x2d7c0f,_0xa62a03){var _0x5efc6d=this;var _0x5710c9=uuid['v4']();this['actions'][_0x5710c9]=new Action(_0x2d7c0f,_0xa62a03,_0x5710c9);return new Promise(function(_0xf6b4a8,_0x4a67f3){if(_['isUndefined'](_0x2d7c0f)&&typeof _0x2d7c0f!==_0xcba4('0x156')){return _0x4a67f3(msgResponse(_0xcba4('0x157'),'Failure',_0xcba4('0x158')));}if(_[_0xcba4('0x43')](_0xa62a03[_0xcba4('0x159')])||_0xa62a03[_0xcba4('0x159')]===null){return _0x4a67f3(msgResponse('originate',_0xcba4('0x95'),'contact\x20is\x20undefine'));}var _0x58d4f4={'XMD-CALLERID':_0x5efc6d[_0xcba4('0x25')][_0x5710c9][_0xcba4('0x15a')](),'XMD-AGI':_0x2d7c0f[_0xcba4('0x12d')]?util[_0xcba4('0x49')](_0xcba4('0x15b'),ipAgi,_0x2d7c0f[_0xcba4('0x12d')]):_0xcba4('0x15c'),'XMD-AGIAFTER':_0x2d7c0f[_0xcba4('0xd3')]?util[_0xcba4('0x49')](_0xcba4('0x15b'),ipAgi,_0x2d7c0f[_0xcba4('0xd3')]):_0xcba4('0x15c'),'XMD-QUEUE':utils[_0xcba4('0x15d')](_0x2d7c0f)?util['format'](_0xcba4('0x15e'),_0x2d7c0f['name'],_0x2d7c0f['dialQueueOptions']||'',_0x2d7c0f['dialAgiAfterHangupAgent']?'c':'',_0x2d7c0f[_0xcba4('0xd0')]||0x3):'NONE','XMD-CONTACTID':_0xa62a03[_0xcba4('0xdd')],'XMD-CDRTYPE':_0xcba4('0x15f'),'CALLERID(all)':_0x5efc6d[_0xcba4('0x25')][_0x5710c9][_0xcba4('0x15a')](),'XMD-AMD':_0x2d7c0f[_0xcba4('0x10d')]?'ACTIVE':_0xcba4('0x15c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x2d7c0f[_0xcba4('0x10d')]){_0x58d4f4['XMD-AMDINITIALSILENCE']=_0x2d7c0f[_0xcba4('0x160')]||0x9c4;_0x58d4f4[_0xcba4('0x161')]=_0x2d7c0f['dialAMDGreeting']||0x5dc;_0x58d4f4['XMD-AMDAFTERGREETINGSILENCE']=_0x2d7c0f[_0xcba4('0x162')]||0x320;_0x58d4f4['XMD-AMDTOTALANALYSISTIME']=_0x2d7c0f[_0xcba4('0x163')]||0x1388;_0x58d4f4[_0xcba4('0x164')]=_0x2d7c0f['dialAMDMinWordLength']||0x64;_0x58d4f4['XMD-AMDBETWEENWORDSSILENCE']=_0x2d7c0f[_0xcba4('0x165')]||0x32;_0x58d4f4[_0xcba4('0x166')]=_0x2d7c0f[_0xcba4('0x167')]||0x3;_0x58d4f4[_0xcba4('0x168')]=_0x2d7c0f['dialAMDSilenceThreshold']||0x100;_0x58d4f4[_0xcba4('0x169')]=_0x2d7c0f[_0xcba4('0x16a')]||0x1388;}if(utils[_0xcba4('0x15d')](_0x2d7c0f)){_0x58d4f4[_0xcba4('0x16b')]=_0xa62a03[_0xcba4('0xdf')];}else{_0x58d4f4[_0xcba4('0x16c')]=_0xa62a03[_0xcba4('0xe0')];}for(var _0x2d458e in _0xa62a03[_0xcba4('0x16d')]){if(typeof _0xa62a03[_0xcba4('0x16d')][_0x2d458e]!==_0xcba4('0x148')){if(isNotNull(_0xa62a03[_0xcba4('0x16d')][_0x2d458e])&&_0x2d458e!=='id'&&_0x2d458e!==_0xcba4('0x16e')&&_0x2d458e!==_0xcba4('0x16f')&&_0x2d458e!==_0xcba4('0x170')){_0x58d4f4[util[_0xcba4('0x49')](_0xcba4('0x171'),_0xcba4('0x172'),_[_0xcba4('0x173')](_0x2d458e))]=_0xa62a03[_0xcba4('0x16d')][_0x2d458e];}}}var _0x280492=_0x5efc6d['isTrunkReachable'](_0x2d7c0f[_0xcba4('0x8f')])?utils['getCallerId'](_0x2d7c0f['Trunk']['callerid'],_0x2d7c0f[_0xcba4('0x174')],_0x2d7c0f[_0xcba4('0x175')]>0x0?utils[_0xcba4('0x176')](_0x2d7c0f[_0xcba4('0x177')],_0x2d7c0f[_0xcba4('0x175')]):_0x2d7c0f[_0xcba4('0x177')]):utils['getCallerId'](_[_0xcba4('0xf4')](_0x2d7c0f[_0xcba4('0x90')])?_0x2d7c0f[_0xcba4('0x8f')]['callerid']:_0x2d7c0f[_0xcba4('0x90')][_0xcba4('0x178')],_0x2d7c0f['dialOriginateCallerIdName'],_0x2d7c0f[_0xcba4('0x175')]>0x0?utils[_0xcba4('0x176')](_0x2d7c0f[_0xcba4('0x177')],_0x2d7c0f['dialRandomLastDigitCallerIdNumber']):_0x2d7c0f['dialOriginateCallerIdNumber']);if(_0x280492){_0x58d4f4['XMD-ORIGINATECALLERIDNAME']=_0x5efc6d['actions'][_0x5710c9][_0xcba4('0x179')]=utils['extractCalleridName'](_0x280492);_0x58d4f4[_0xcba4('0x17a')]=_0xa62a03['phone'];}_0x2d7c0f[_0xcba4('0x17b')]=_0x58d4f4;return ami[_0xcba4('0x9d')]({'actionid':_0x5710c9,'action':'originate','channel':_0x5efc6d['isTrunkReachable'](_0x2d7c0f['Trunk'])?util[_0xcba4('0x49')](_0xcba4('0x17c'),_0x2d7c0f[_0xcba4('0x8f')][_0xcba4('0x4b')],isNotNull(_0x2d7c0f[_0xcba4('0x17d')])?_0x2d7c0f['dialPrefix']['trim']()||'':'',_0x2d7c0f[_0xcba4('0x17e')]>0x0?_0xa62a03[_0xcba4('0x159')][_0xcba4('0x17f')](_0x2d7c0f[_0xcba4('0x17e')]):_0xa62a03['phone']):util[_0xcba4('0x49')](_0xcba4('0x17c'),_[_0xcba4('0xf4')](_0x2d7c0f[_0xcba4('0x90')])?_0x2d7c0f['Trunk'][_0xcba4('0x4b')]:_0x2d7c0f[_0xcba4('0x90')][_0xcba4('0x4b')],isNotNull(_0x2d7c0f[_0xcba4('0x17d')])?_0x2d7c0f[_0xcba4('0x17d')][_0xcba4('0x180')]()||'':'',_0x2d7c0f[_0xcba4('0x17e')]>0x0?_0xa62a03['phone'][_0xcba4('0x17f')](_0x2d7c0f[_0xcba4('0x17e')]):_0xa62a03[_0xcba4('0x159')]),'callerid':_0x280492,'Exten':_0xcba4('0x181'),'Context':_0xcba4('0x182'),'Priority':'1','variable':_0x58d4f4,'timeout':(_0x2d7c0f[_0xcba4('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5710c9})[_0xcba4('0x42')](function(_0x19fe56){return _0xf6b4a8(_0x19fe56);})[_0xcba4('0xa2')](function(_0x3270da){_0x2d7c0f[_0xcba4('0x184')]+=0x1;var _0x3167fe=new History(_0x5efc6d[_0xcba4('0x25')][_0x5710c9]);logger[_0xcba4('0x67')](util['format'](_0xcba4('0x185'),JSON[_0xcba4('0x89')](_0x3270da)));_0x3167fe[_0xcba4('0x73')]=0xe;_0x3167fe[_0xcba4('0x74')]=_0xcba4('0x186');_0x3167fe[_0xcba4('0x76')]=moment()[_0xcba4('0x49')](_0xcba4('0xc3'));_0x3167fe[_0xcba4('0x75')]=_0x3167fe['starttime'];hopperUtils['createHistory'](_0x3167fe)[_0xcba4('0xa2')](loggerCatch('[originate][error]'));_0x5efc6d['moveContactManagedDialer'](_0x3167fe)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x187')))[_0xcba4('0x1d')](function(){delete _0x5efc6d[_0xcba4('0x25')][_0x5710c9];return _0x4a67f3(msgResponse(_0xcba4('0x157'),_0xcba4('0x88'),'originate\x20action\x20Error'));});});});};Dialer[_0xcba4('0x1a')][_0xcba4('0x188')]=function(_0x243875,_0x356ba8,_0x29cf97){var _0x3004a8=new History(_0x356ba8);if(_0x3004a8[_0xcba4('0x11d')]+_0x3004a8[_0xcba4('0x11e')]+_0x3004a8[_0xcba4('0x125')]+_0x3004a8['countnosuchnumberretry']+_0x3004a8['countdropretry']+_0x3004a8['countabandonedretry']+_0x3004a8[_0xcba4('0x11a')]+_0x3004a8[_0xcba4('0x126')]>=_0x29cf97[_0xcba4('0x120')]-0x1){return!![];}switch(_0x243875){case 0x3:if(_0x3004a8[_0xcba4('0x125')]>=_0x29cf97[_0xcba4('0x189')]-0x1){return!![];}hopperUtils[_0xcba4('0xed')]({'active':![],'countnoanswerretry':_0x3004a8['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97[_0xcba4('0x18a')],'minutes')[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8['VoiceQueueId']||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x18b')));break;case 0x5:if(_0x3004a8['countbusyretry']>=_0x29cf97[_0xcba4('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x3004a8[_0xcba4('0x11d')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97[_0xcba4('0x18d')],_0xcba4('0xdc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3004a8['ContactId'],'ListId':_0x3004a8['ListId'],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})['catch'](loggerCatch(_0xcba4('0x18e')));break;case 0x8:if(_0x3004a8['countcongestionretry']>=_0x29cf97['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xcba4('0xed')]({'active':![],'countcongestionretry':_0x3004a8[_0xcba4('0x11e')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97[_0xcba4('0x18f')],_0xcba4('0xdc'))[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x3004a8['ContactId'],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3004a8[_0xcba4('0x11f')]>=_0x29cf97[_0xcba4('0x190')]-0x1){return!![];}else{hopperUtils[_0xcba4('0xed')]({'active':![],'countnosuchnumberretry':_0x3004a8[_0xcba4('0x11f')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97[_0xcba4('0x191')],_0xcba4('0xdc'))['format'](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8['CampaignId']||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x192')));}break;case 0xa:if(_0x3004a8[_0xcba4('0xd4')]>=_0x29cf97['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3004a8[_0xcba4('0xd4')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97['dialDropRetryFrequency'],'minutes')[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8['VoiceQueueId']||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x193')));break;case 0xb:if(_0x3004a8[_0xcba4('0xe9')]>=_0x29cf97[_0xcba4('0xec')]-0x1){return!![];}hopperUtils[_0xcba4('0xed')]({'active':![],'countabandonedretry':_0x3004a8[_0xcba4('0xe9')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97[_0xcba4('0xea')],_0xcba4('0xdc'))[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3004a8[_0xcba4('0x11a')]>=_0x29cf97[_0xcba4('0x127')]-0x1){return!![];}hopperUtils[_0xcba4('0xed')]({'active':![],'countmachineretry':_0x3004a8[_0xcba4('0x11a')]+=0x1,'scheduledat':moment()[_0xcba4('0xdb')](_0x29cf97['dialMachineRetryFrequency'],_0xcba4('0xdc'))[_0xcba4('0x49')](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8[_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x194')));break;case 0x14:if(_0x3004a8[_0xcba4('0x126')]>=_0x29cf97[_0xcba4('0x195')]-0x1){return!![];}hopperUtils[_0xcba4('0xed')]({'active':![],'countagentrejectretry':_0x3004a8['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x29cf97[_0xcba4('0x196')],_0xcba4('0xdc'))['format'](_0xcba4('0xc3')),'ContactId':_0x3004a8[_0xcba4('0xdd')],'ListId':_0x3004a8[_0xcba4('0xde')],'VoiceQueueId':_0x3004a8[_0xcba4('0xdf')]||undefined,'CampaignId':_0x3004a8['CampaignId']||undefined})[_0xcba4('0xa2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xcba4('0x1a')][_0xcba4('0x109')]=function(_0x29bef4,_0x3a1bc6,_0x331e21){var _0x4f5be1=this;var _0x746eea=new History(_0x29bef4);var _0x4e1fdd=![];var _0x6007c4;var _0x44ed9b;return new Promise(function(_0x3975fe,_0xe6b70d){if(_[_0xcba4('0x43')](_0x3a1bc6)&&typeof _0x3a1bc6!==_0xcba4('0x156')){return _0xe6b70d(msgResponse(_0xcba4('0x197'),'Failure',_0xcba4('0x198')));}if(_[_0xcba4('0x43')](_0x331e21)&&typeof _0x331e21!=='object'){return _0xe6b70d(msgResponse(_0xcba4('0x197'),_0xcba4('0x95'),_0xcba4('0x199')));}hopperUtils[_0xcba4('0xd6')](_0x746eea,_0x331e21['reason'],_0x3a1bc6)[_0xcba4('0x42')](function(_0x312c0c){if(_0x312c0c[_0xcba4('0xda')]==0x1)_0x4e1fdd=!![];switch(_0x331e21[_0xcba4('0xc5')]){case'0':_0x3a1bc6[_0xcba4('0x19a')]+=0x1;_0x746eea[_0xcba4('0x73')]=0x0;_0x746eea[_0xcba4('0x74')]=_0xcba4('0x19b');_0x746eea[_0xcba4('0x11f')]+=0x1;_0x746eea[_0xcba4('0xd5')]+=0x1;ami[_0xcba4('0x44')]('custom:agentnosuchnumber',ut[_0xcba4('0x11c')](_0x29bef4,_0xcba4('0x19c')));_0x6007c4=_0x3a1bc6[_0xcba4('0x191')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];hopperUtils[_0xcba4('0xc9')](_0x746eea)[_0xcba4('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4f5be1[_0xcba4('0x188')](0x0,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea[_0xcba4('0x11f')]>=_0x3a1bc6['dialNoSuchNumberMaxRetry']){_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x19d'));}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x19d'));}}break;case'3':_0x3a1bc6[_0xcba4('0x19e')]+=0x1;_0x746eea['state']=0x3;_0x746eea[_0xcba4('0x74')]=_0xcba4('0x19f');_0x746eea['countnoanswerretry']+=0x1;_0x746eea['countglobal']+=0x1;var _0xc7ee55=ut['buildNoAnswerEventPayload'](_0x29bef4,_0x3a1bc6);ami[_0xcba4('0x44')](_0xcba4('0x1a0'),_0xc7ee55);_0x6007c4=_0x3a1bc6[_0xcba4('0x18a')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];hopperUtils['createHistory'](_0x746eea)[_0xcba4('0xa2')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4f5be1[_0xcba4('0x188')](0x3,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea[_0xcba4('0x125')]>=_0x3a1bc6[_0xcba4('0x189')]){_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1a1'));}}break;case'5':_0x3a1bc6[_0xcba4('0x1a2')]+=0x1;_0x746eea['state']=0x5;_0x746eea[_0xcba4('0x74')]='Busy';_0x746eea['countbusyretry']+=0x1;_0x746eea['countglobal']+=0x1;ami[_0xcba4('0x44')]('custom:agentbusy',ut[_0xcba4('0x11c')](_0x29bef4,_0xcba4('0x1a3')));_0x6007c4=_0x3a1bc6[_0xcba4('0x18d')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];hopperUtils[_0xcba4('0xc9')](_0x746eea)['catch'](loggerCatch(_0xcba4('0x1a4')));if(_0x4f5be1[_0xcba4('0x188')](0x5,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea[_0xcba4('0x11d')]>=_0x3a1bc6[_0xcba4('0x18c')]){_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,'reason\x205\x20busy');}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1a5'));}}break;case'8':_0x3a1bc6['outboundCongestionCallsDay']+=0x1;_0x746eea[_0xcba4('0x73')]=0x8;_0x746eea[_0xcba4('0x74')]=_0xcba4('0x1a6');_0x746eea['countcongestionretry']+=0x1;_0x746eea['countglobal']+=0x1;_0x6007c4=_0x3a1bc6['dialCongestionRetryFrequency'];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];ami[_0xcba4('0x44')](_0xcba4('0x1a7'),ut['buildObj'](_0x29bef4,_0xcba4('0x1a8')));hopperUtils[_0xcba4('0xc9')](_0x746eea)[_0xcba4('0xa2')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4f5be1[_0xcba4('0x188')](0x8,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea[_0xcba4('0x11e')]>=_0x3a1bc6[_0xcba4('0x1a9')]){_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,'reason\x208\x20congestion');}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1aa'));}}break;case'11':_0x3a1bc6[_0xcba4('0x1ab')]+=0x1;_0x746eea[_0xcba4('0x73')]=0xb;_0x746eea['statedesc']=_0xcba4('0xe7');_0x746eea[_0xcba4('0xe9')]+=0x1;_0x746eea[_0xcba4('0xd5')]+=0x1;_0x6007c4=_0x3a1bc6[_0xcba4('0xea')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];hopperUtils[_0xcba4('0xc9')](_0x746eea)['catch'](loggerCatch(_0xcba4('0xee')));if(_0x4f5be1[_0xcba4('0x188')](0xb,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea[_0xcba4('0xe9')]>=_0x3a1bc6[_0xcba4('0xec')]){_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1ac'));}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1ac'));}}break;case'20':_0x3a1bc6[_0xcba4('0x1ad')]+=0x1;_0x746eea[_0xcba4('0x73')]=0x14;_0x746eea['statedesc']=_0xcba4('0x1ae');_0x746eea[_0xcba4('0x126')]+=0x1;_0x746eea[_0xcba4('0xd5')]+=0x1;_0x6007c4=_0x3a1bc6[_0xcba4('0x196')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];ami['emit']('custom:agentreject',ut['buildObj'](_0x29bef4,'agentreject'));hopperUtils[_0xcba4('0xc9')](_0x746eea)['catch'](loggerCatch(_0xcba4('0x1af')));if(_0x4f5be1[_0xcba4('0x188')](0x14,_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea['countagentrejectretry']>=_0x3a1bc6['dialAgentRejectMaxRetry']){_0x4f5be1['createStateFinal'](_0x746eea,_0x3975fe,_0xe6b70d,_0xcba4('0x1b0'));}else{_0x4f5be1[_0xcba4('0x121')](_0x746eea,_0x3975fe,_0xe6b70d,'reason\x2020\x20agentreject');}}break;default:_0x3a1bc6[_0xcba4('0x130')]+=0x1;_0x746eea[_0xcba4('0x73')]=0xc;_0x746eea[_0xcba4('0x74')]=_0x331e21[_0xcba4('0xc5')];_0x6007c4=_0x3a1bc6[_0xcba4('0x196')];_0x44ed9b=_0x3a1bc6[_0xcba4('0xeb')];hopperUtils['createHistory'](_0x746eea)[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x1b1')));if(_0x4f5be1[_0xcba4('0x188')](_0x331e21[_0xcba4('0xc5')],_0x29bef4,_0x3a1bc6)&&!_0x4e1fdd){if(_0x746eea['countbusyretry']+_0x746eea[_0xcba4('0x11e')]+_0x746eea[_0xcba4('0x125')]+_0x746eea['countnosuchnumberretry']+_0x746eea[_0xcba4('0xd4')]+_0x746eea[_0xcba4('0xe9')]+_0x746eea['countmachineretry']+_0x746eea['countagentrejectretry']>=_0x3a1bc6[_0xcba4('0x120')]){_0x4f5be1['stateGlobal'](_0x746eea,_0x3975fe,_0xe6b70d,_0x331e21[_0xcba4('0xc5')]);}else{_0x4f5be1[_0xcba4('0x123')](_0x746eea,_0x3975fe,_0xe6b70d,_0x331e21['reason']);}}}})[_0xcba4('0x42')](function(){if(_0x4e1fdd){hopperUtils['swapAdditionalPhones'](_0x746eea,_0x6007c4,_0x44ed9b)[_0xcba4('0x42')](function(){return _0x3975fe(0x1);});}});});};Dialer[_0xcba4('0x1a')]['stateGlobal']=function(_0x1b5846,_0x2b7ce8,_0x2380b0,_0x53dab9){var _0x20a668=new Final(_0x1b5846);_0x20a668['state']=0xf;_0x20a668[_0xcba4('0x74')]=_0xcba4('0x1b2');this[_0xcba4('0x123')](_0x20a668,_0x2b7ce8,_0x2380b0,_0x53dab9);};Dialer[_0xcba4('0x1a')][_0xcba4('0x123')]=function(_0x56e0d4,_0x55d3a4,_0x29cc12,_0x4c24f6){hopperUtils[_0xcba4('0xcb')](_0x56e0d4)['then'](function(){return _0x55d3a4(msgResponse(_0xcba4('0x197'),'Success',_0x4c24f6));})['catch'](function(){return _0x29cc12(msgResponse('[moveContactManagedDialer][0]',_0xcba4('0x95'),_0xcba4('0x1b3')));});};Dialer[_0xcba4('0x1a')]['predictive']=function(_0x606108){var _0x1f79a3=_0x606108[_0xcba4('0x1b4')]/0x64;var _0x5af4ee=_0x606108[_0xcba4('0x1b5')]/(_0x606108[_0xcba4('0x1b5')]+_0x606108[_0xcba4('0xc4')]);var _0x5cc9ea=Math[_0xcba4('0x1b6')](_0x606108[_0xcba4('0x1b7')]*(_0x606108[_0xcba4('0x1b8')]/0x64));var _0x28e352=Math[_0xcba4('0x1b6')](_0x606108[_0xcba4('0x1b7')]*(_0x606108['predictiveIntervalMinThreshold']/0x64));var _0x2fa662=_0x606108[_0xcba4('0x137')]+_0x606108[_0xcba4('0x1b9')];var _0x1e40c5=Math['floor'](_0x606108['erlangCalls']*_0x606108['erlangAbandonmentRate']*_0x606108['predictiveIntervalHitRate']*_0x606108[_0xcba4('0x1ba')]);if(_[_0xcba4('0x43')](_0x606108[_0xcba4('0x29')])){if(!_['isUndefined'](_0x606108[_0xcba4('0x28')])){_0x606108[_0xcba4('0x28')]=undefined;loggerPredictive[_0xcba4('0x67')](_0xcba4('0x1bb'),_0xcba4('0x1bc'));}if(!_[_0xcba4('0x43')](_0x606108[_0xcba4('0x65')])){loggerPredictive[_0xcba4('0x67')](_0xcba4('0x1bb'),_0xcba4('0x1bd'));clearInterval(_0x606108['handlePredictive']);_0x606108[_0xcba4('0x65')]=undefined;}_0x606108[_0xcba4('0x29')]=moment()[_0xcba4('0x49')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xcba4('0x4c')](_0x606108[_0xcba4('0x4b')],_0xcba4('0x1be'),_0x606108[_0xcba4('0x29')]);this[_0xcba4('0xb5')](_0x606108,0x1);}else if(ifInterval(_0x606108['dialPredictiveInterval'],_0x606108[_0xcba4('0x29')])){this[_0xcba4('0xb5')](_0x606108,0x1);loggerPredictiveCalls['info'](_0xcba4('0x1bf'),_0x606108[_0xcba4('0x29')],_0x606108[_0xcba4('0x4b')]);_0x606108[_0xcba4('0x5d')]=0x0;_0x606108[_0xcba4('0xd1')]=0x0;}else if(_0x1f79a3<_0x5af4ee&&_0x606108[_0xcba4('0x1c0')]===_0xcba4('0x1c1')){clearPredictiveAttributes(_0x606108);loggerPredictive[_0xcba4('0x4c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xcba4('0x1c2'),_0x5af4ee,_0xcba4('0x29'),_0x606108[_0xcba4('0x4b')]);}else if(_0x1e40c5<_0x606108[_0xcba4('0xd1')]&&_0x606108[_0xcba4('0x1c0')]===_0xcba4('0x1c1')){clearPredictiveAttributes(_0x606108);loggerPredictive[_0xcba4('0x4c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xcba4('0x1c3'),_0x1e40c5,_0xcba4('0x1c4'),_0x606108['predictiveIntervalErlangCallsDroppedCalls'],_0xcba4('0x29'),_0x606108[_0xcba4('0x4b')]);}else if(!ifInterval(_0x606108[_0xcba4('0x1c5')],_0x606108[_0xcba4('0x29')])&&_[_0xcba4('0x43')](_0x606108[_0xcba4('0x28')])&&!_['isUndefined'](_0x606108[_0xcba4('0x29')])){_0x606108[_0xcba4('0x28')]=moment()[_0xcba4('0x49')](_0xcba4('0xc3'));loggerPredictive[_0xcba4('0x4c')](_0x606108['name'],_0xcba4('0x1c6'),_0x606108[_0xcba4('0x28')]);hopperUtils['avgHandleTime'](_0x606108[_0xcba4('0x1c5')])[_0xcba4('0x42')](this['getDataPredictive'](_0x606108))[_0xcba4('0x42')](mergeDataErlangB(_0x606108))[_0xcba4('0x42')](this[_0xcba4('0x1c7')](_0x606108))[_0xcba4('0xa2')](loggerCatchPredictive(_0xcba4('0x1c8'),_0x606108));}else if(!ifInterval(_0x606108[_0xcba4('0x1c5')],_0x606108[_0xcba4('0x28')])){_0x606108[_0xcba4('0xd1')]=0x0;_0x606108[_0xcba4('0x28')]=moment()[_0xcba4('0x49')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x606108[_0xcba4('0x4b')],_0xcba4('0x1c9'),_0x606108['startPredictive']);clearInterval(_0x606108[_0xcba4('0x65')]);_0x606108[_0xcba4('0x65')]=undefined;hopperUtils[_0xcba4('0x1ca')](_0x606108[_0xcba4('0x1c5')])[_0xcba4('0x42')](this[_0xcba4('0x1cb')](_0x606108))[_0xcba4('0x42')](mergeDataErlangB(_0x606108))['then'](this[_0xcba4('0x1c7')](_0x606108))['catch'](loggerCatchPredictive(_0xcba4('0x1cc'),_0x606108));}else if(_0x606108[_0xcba4('0x1b7')]&&_0x2fa662<_0x606108['predictiveIntervalAvailable']-_0x28e352){clearPredictiveAttributes(_0x606108);loggerPredictive[_0xcba4('0x4c')](_0x606108[_0xcba4('0x4b')],_0xcba4('0x1cd'),_0x2fa662,_0xcba4('0x1ce'),_0x606108['predictiveIntervalAvailable'],'-',_0x28e352,'=',_0x606108['predictiveIntervalAvailable']-_0x28e352,')');}else if(_0x606108[_0xcba4('0x1b7')]&&_0x2fa662>_0x606108[_0xcba4('0x1b7')]+_0x5cc9ea){clearPredictiveAttributes(_0x606108);loggerPredictive[_0xcba4('0x4c')](_0x606108[_0xcba4('0x4b')],_0xcba4('0x1cd'),_0x2fa662,_0xcba4('0x1cf'),_0x606108['predictiveIntervalAvailable'],'+',_0x5cc9ea,'=',_0x606108[_0xcba4('0x1b7')]+_0x5cc9ea,')');}};Dialer[_0xcba4('0x1a')][_0xcba4('0x1cb')]=function(_0x5bf43b){var _0xda3696=this;return function(_0x502df3){return new Promise(function(_0x185f11,_0x29b421){_[_0xcba4('0x63')](_0x5bf43b,_0x502df3[0x0]);if(checkGetDataPredictive(_0x502df3[0x0])){var _0x35d97d=_0x5bf43b[_0xcba4('0x1b7')]=_0x5bf43b[_0xcba4('0x1b9')]+_0x5bf43b[_0xcba4('0x137')];var _0xf363bf=_0x5bf43b[_0xcba4('0x1c5')]*0x3c;var _0x957ede=_0x502df3[0x0]['predictiveIntervalAvgTalktime']+_0x502df3[0x0][_0xcba4('0x58')];var _0x4dca87=(_0x502df3[0x0][_0xcba4('0x4f')]+_0x502df3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x502df3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x502df3[0x0][_0xcba4('0x56')];_0x5bf43b[_0xcba4('0x1d0')]=_0x4dca87>0x0?_0x4dca87:0x1;switch(_0x5bf43b[_0xcba4('0x1c0')]){case _0xcba4('0x1c1'):var _0x2c9c9b=_0x5bf43b[_0xcba4('0x1b4')]/0x64;return _0xda3696['abandonmentRate'](_0x35d97d,_0xf363bf,_0x957ede,_0x4dca87,_0x2c9c9b)[_0xcba4('0x42')](function(_0x2bc052){return _0x185f11(_0x2bc052);});case'agentBusyFactor':var _0x24e13c=_0x5bf43b['dialPredictiveOptimizationPercentage']/0x64;return _0xda3696[_0xcba4('0x1d1')](_0x35d97d,_0xf363bf,_0x957ede,_0x4dca87,_0x24e13c)[_0xcba4('0x42')](function(_0x4f9ad6){return _0x185f11(_0x4f9ad6);});default:return _0x29b421(msgResponse('[getDataPredictive]',_0xcba4('0x95'),'Unknown\x20Predictive'));}}else{return _0x29b421(msgResponse(_0xcba4('0x1d2'),_0xcba4('0x95'),_0xcba4('0x1d3')));}});};};Dialer[_0xcba4('0x1a')][_0xcba4('0x1d4')]=function(_0x2c7a74){var _0x1a6c82=this;return function(_0x39e206){return new Promise(function(_0x394f41,_0x319b87){_[_0xcba4('0x63')](_0x2c7a74,_0x39e206[0x0]);if(checkGetDataPredictive(_0x39e206[0x0])){loggerPredictive[_0xcba4('0x4c')](JSON[_0xcba4('0x89')](_0x39e206[0x0]));if(_0x2c7a74[_0xcba4('0x1c0')]==='dropRate'){return _0x1a6c82[_0xcba4('0x14b')](_0x2c7a74['id'])[_0xcba4('0x42')](function(_0x3cd260){var _0x373747=_0x2c7a74[_0xcba4('0x1d5')]-_0x3cd260[0x0][_0xcba4('0x1d6')];var _0x2f2bf9=_0x2c7a74[_0xcba4('0x1c5')]*0x3c;var _0x28b056=_0x39e206[0x0][_0xcba4('0x54')]+_0x39e206[0x0][_0xcba4('0x58')];var _0x36ead9=(_0x39e206[0x0]['predictiveIntervalAnsweredCalls']+_0x39e206[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x39e206[0x0][_0xcba4('0x52')])/_0x39e206[0x0]['predictiveIntervalTotalCalls'];var _0x2ee41e=_0x2c7a74[_0xcba4('0x1b4')]/0x64;_0x2c7a74[_0xcba4('0x1d7')]=_0x3cd260[0x0][_0xcba4('0x1d6')]||0x0;_0x2c7a74[_0xcba4('0x1d0')]=_0x36ead9>0x0?_0x36ead9:0x1;return _0x1a6c82[_0xcba4('0x1d8')](_0x373747,_0x2f2bf9,_0x28b056,_0x36ead9,_0x2ee41e);})[_0xcba4('0x42')](function(_0x5d2c49){return _0x394f41(_0x5d2c49);})[_0xcba4('0xa2')](function(_0x4b7d3f){return _0x319b87(msgResponse(_0xcba4('0x1d9'),_0xcba4('0x95'),JSON['stringify'](_0x4b7d3f)));});}if(_0x2c7a74[_0xcba4('0x1c0')]==='agentBusyFactor'){return _0x1a6c82[_0xcba4('0x14b')](_0x2c7a74['id'])['then'](function(_0x4040a5){var _0x2b6508=_0x2c7a74[_0xcba4('0x1d5')]-_0x4040a5[0x0][_0xcba4('0x1d6')];var _0x20e50d=_0x2c7a74[_0xcba4('0x1c5')]*0x3c;var _0x585d04=_0x39e206[0x0][_0xcba4('0x54')]+_0x39e206[0x0]['predictiveIntervalAvgHoldtime'];var _0x5be05e=(_0x39e206[0x0][_0xcba4('0x4f')]+_0x39e206[0x0][_0xcba4('0x50')]+_0x39e206[0x0][_0xcba4('0x52')])/_0x39e206[0x0][_0xcba4('0x56')];var _0x11b596=_0x2c7a74['dialPredictiveOptimizationPercentage']/0x64;_0x2c7a74[_0xcba4('0x1d7')]=_0x4040a5[0x0]['outboundQueuePauses']||0x0;_0x2c7a74[_0xcba4('0x1d0')]=_0x5be05e>0x0?_0x5be05e:0x1;return _0x1a6c82['busyFactor'](_0x2b6508,_0x20e50d,_0x585d04,_0x5be05e,_0x11b596);})['then'](function(_0x403b9b){return _0x394f41(_0x403b9b);})[_0xcba4('0xa2')](function(_0x3eab2a){return _0x319b87(msgResponse(_0xcba4('0x1d9'),_0xcba4('0x95'),JSON[_0xcba4('0x89')](_0x3eab2a)));});}}else{return _0x319b87(msgResponse(_0xcba4('0x1d2'),_0xcba4('0x95'),'check\x20failure'));}});};};Dialer[_0xcba4('0x1a')][_0xcba4('0x1c7')]=function(_0x5e3d5c){var _0x3ac166=this;return function(){var _0xe9542f=0x0;var _0x1b7e98=Math[_0xcba4('0x1da')](_0x5e3d5c[_0xcba4('0x5e')]*0x3e8);if(_0x1b7e98>0x0){_0x1b7e98=_0x1b7e98<0x64?0x64:_0x1b7e98;loggerPredictive['info'](_0x5e3d5c[_0xcba4('0x4b')],_0xcba4('0x1db'),_0x1b7e98,_0xcba4('0x1dc'));_0x5e3d5c[_0xcba4('0x65')]=setInterval(function(){_0x3ac166[_0xcba4('0x65')](_0x5e3d5c);loggerPredictiveCalls['info'](_0xcba4('0x1dd'),_0xe9542f+=0x1);},_0x1b7e98);}else{loggerPredictive['info'](_0x5e3d5c[_0xcba4('0x4b')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xcba4('0x1de')]=function(_0x48d91a,_0x310173){var _0x1150f4=this;return function(_0x3109ac){if(_[_0xcba4('0xfc')](_0x3109ac)){if(_[_0xcba4('0xf4')](_0x310173[_0xcba4('0x151')])||!_0x310173[_0xcba4('0x1df')]){if(_0x48d91a[_0xcba4('0xb3')]===_0xcba4('0x9')){_0x48d91a[_0xcba4('0x77')]=_[_0xcba4('0x43')](_0x48d91a['queueStatusComplete'])?!![]:_0x48d91a['queueStatusComplete'];var _0x2c287d=uuid['v4']();_0x1150f4[_0xcba4('0x25')][_0x2c287d]=new Action(_0x48d91a,_0x310173,_0x2c287d);loggerBooked[_0xcba4('0x4c')](_0xcba4('0x1e0'),_0x2c287d,_0xcba4('0x1e1'),JSON[_0xcba4('0x89')](_0x48d91a[_0xcba4('0x77')]),_0xcba4('0x1e2'),_0x48d91a[_0xcba4('0x4b')]);if(_0x48d91a['queueStatusComplete']){_0x48d91a[_0xcba4('0x77')]=![];_0x1150f4[_0xcba4('0x2b')][_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xbe')]]=[];ami[_0xcba4('0x9d')]({'actionid':_0x2c287d,'action':'queuestatus','queue':_0x48d91a[_0xcba4('0x4b')]})[_0xcba4('0xa2')](function(){_0x1150f4[_0xcba4('0xc0')](_0x48d91a);hopperUtils[_0xcba4('0xed')]({'active':![],'ContactId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xdd')],'ListId':_0x1150f4[_0xcba4('0x25')][_0x2c287d]['ListId'],'VoiceQueueId':_0x1150f4[_0xcba4('0x25')][_0x2c287d]['VoiceQueueId']||undefined,'CampaignId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1150f4[_0xcba4('0x25')][_0x2c287d];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x48d91a[_0xcba4('0x77')]),'Queue:\x20',_0x48d91a['name']);_0x1150f4[_0xcba4('0xc0')](_0x48d91a);hopperUtils[_0xcba4('0xed')]({'active':![],'ContactId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xdd')],'ListId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xde')],'VoiceQueueId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xdf')]||undefined,'CampaignId':_0x1150f4[_0xcba4('0x25')][_0x2c287d][_0xcba4('0xe0')]||undefined})[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x1e3')));delete _0x1150f4['actions'][_0x2c287d];}}else{return _0x1150f4[_0xcba4('0x155')](_0x48d91a,_0x310173);}}else{if(utils['getSeconds'](undefined,_0x310173[_0xcba4('0x1e4')])<_0x48d91a[_0xcba4('0x1e5')]*0x3c){if(_0x310173[_0xcba4('0x141')]&&!_0x310173['Agent'][_0xcba4('0x1e6')]){_0x1150f4[_0xcba4('0x1e')][_0xcba4('0x1e7')](_0x310173['id'])[_0xcba4('0x1d')](function(){_0x1150f4[_0xcba4('0xc0')](_0x48d91a);});}else{hopperUtils[_0xcba4('0x1e8')]({'active':![]},_0x310173['id'],0x1)[_0xcba4('0x1d')](function(){_0x1150f4[_0xcba4('0xc0')](_0x48d91a);});}}else{_0x48d91a['outboundReCallsDay']+=0x1;_0x1150f4['updateOriginated'](_0x48d91a);if(_0x48d91a['dialRecallInQueue']){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x310173['ContactId'],'ListId':_0x310173[_0xcba4('0xde')],'VoiceQueueId':_0x310173[_0xcba4('0xdf')]||undefined,'CampaignId':_0x310173[_0xcba4('0xe0')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xcba4('0xc9')](createObjHistory(_0x48d91a,_0x310173,utils['CAMPAIGN_STATUS'][_0xcba4('0x1e9')],0x17,'RecallInQueue'))[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x1ea')));}else{_0x1150f4[_0xcba4('0x114')](createObjHistory(_0x48d91a,_0x310173,utils['CAMPAIGN_STATUS'][_0xcba4('0x1eb')],0x16,_0xcba4('0x1ec')),_0xcba4('0x1ed'),'[Originate][HistoryRecallClose]');}}}}else{_0x48d91a['outboundBlacklistCallsDay']+=0x1;_0x1150f4[_0xcba4('0x114')](createObjHistory(_0x48d91a,_0x310173,utils['CAMPAIGN_STATUS'][_0xcba4('0x1ee')],0xd,_0xcba4('0x1ef')),_0xcba4('0x1f0'),_0xcba4('0x1f1'));throw _0xcba4('0x1f2');}};};Dialer[_0xcba4('0x1a')]['handleIvr']=function(_0x25060c){var _0x473359=this;var _0x82556c=_0x25060c[_0xcba4('0x1f3')]-_0x25060c[_0xcba4('0x84')]-_0x25060c[_0xcba4('0x1f4')];emitCampaignSummary(_0x25060c);if(_0x82556c>0x0){if(_0x82556c>this[_0xcba4('0x23')]){_0x82556c=this[_0xcba4('0x23')];}_0x25060c[_0xcba4('0x1f4')]+=_0x82556c;hopperUtils[_0xcba4('0x1f5')](_0x25060c['id'],_0x82556c,_0x25060c[_0xcba4('0x1f6')],_0x25060c)[_0xcba4('0x42')](function(_0x4387e8){_0x25060c[_0xcba4('0x1f4')]-=_0x82556c;_0x25060c[_0xcba4('0x1f4')]=_0x25060c[_0xcba4('0x1f4')]>0x0?_0x25060c[_0xcba4('0x1f4')]:0x0;if(!utils['checkContactEmpty'](_0x4387e8)){_0x25060c['message']=utils[_0xcba4('0x6d')][_0xcba4('0x71')];logger[_0xcba4('0x4c')](_0xcba4('0x1f7')+_0x25060c[_0xcba4('0x4b')]);}else{_0x25060c[_0xcba4('0x84')]+=_0x4387e8[_0xcba4('0x9c')];_0x25060c['message']=utils[_0xcba4('0x6d')][_0xcba4('0x1f8')];for(var _0x3c3a62=0x0;_0x3c3a62<_0x4387e8[_0xcba4('0x9c')];_0x3c3a62+=0x1){_0x25060c[_0xcba4('0x1f9')]+=0x1;if(_['isNil'](_0x4387e8[_0x3c3a62])||_[_0xcba4('0xf4')](_0x4387e8[_0x3c3a62][_0xcba4('0x16d')])||_[_0xcba4('0xf4')](_0x4387e8[_0x3c3a62][_0xcba4('0x159')])){_0x473359['emptyContact'](_0xcba4('0x1fa'),_0x25060c,_0x4387e8[_0x3c3a62]);}else{hopperUtils[_0xcba4('0x1fb')](_['pick'](_0x4387e8[_0x3c3a62],['CampaignId','phone']))[_0xcba4('0x42')](_0x473359[_0xcba4('0x1de')](_0x25060c,_0x4387e8[_0x3c3a62]))[_0xcba4('0xa2')](_0x473359[_0xcba4('0x14f')](_0xcba4('0x1fc'),_0x25060c));}}}})[_0xcba4('0xa2')](loggerGetContactDialer('[getContactCampaign2]',_0x25060c,_0x82556c));}};Dialer[_0xcba4('0x1a')][_0xcba4('0xb5')]=function(_0x3a20be,_0x559715){var _0xca178c=this;var _0x811569=[];if(_0x559715<0x1||_0x3a20be[_0xcba4('0xb3')]===_0xcba4('0x9')){_0x559715=0x1;}var _0x3fe09a=Math['floor'](_0x3a20be[_0xcba4('0x137')]*_0x559715)-_0x3a20be[_0xcba4('0x84')]-_0x3a20be[_0xcba4('0x1f4')];if(_0x3a20be[_0xcba4('0x1fd')]>0x0){var _0x139503=_0x3a20be[_0xcba4('0x1fd')]-_0x3a20be[_0xcba4('0x84')]-_0x3a20be[_0xcba4('0x1b9')]-_0x3a20be['temp']-_0x3a20be[_0xcba4('0x1fe')];if(_0x3fe09a>_0x139503){_0x3fe09a=_0x139503;}}if(_0x3fe09a>0x0){if(_0x3a20be[_0xcba4('0xb3')]===_0xcba4('0x9')){_0x3fe09a=0x1;}if(_0x3fe09a>this[_0xcba4('0x23')]){_0x3fe09a=this[_0xcba4('0x23')];}_0x3a20be[_0xcba4('0x1f4')]+=_0x3fe09a;for(var _0x5e4a78 in this[_0xcba4('0x21')]){if(typeof this['agents'][_0x5e4a78]!==_0xcba4('0x148')){if(this[_0xcba4('0x21')][_0x5e4a78][_0xcba4('0x73')]===_0xcba4('0x1ff')&&this[_0xcba4('0x21')][_0x5e4a78][_0xcba4('0x8c')]==='reachable'){_0x811569['push'](this['agents'][_0x5e4a78]['id']);}}}hopperUtils[_0xcba4('0x200')](_0x3a20be,_0x811569,_0x3fe09a)[_0xcba4('0x42')](function(_0x1e4528){_0x3a20be[_0xcba4('0x1f4')]-=_0x3fe09a;_0x3a20be[_0xcba4('0x1f4')]=_0x3a20be[_0xcba4('0x1f4')]>0x0?_0x3a20be[_0xcba4('0x1f4')]:0x0;if(!utils[_0xcba4('0x201')](_0x1e4528)){hopperUtils[_0xcba4('0x202')](_0x3a20be)[_0xcba4('0x42')](sendMessageReschedule(_0x3a20be))[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x203')));}else{_0x3a20be[_0xcba4('0x84')]+=_0x1e4528['length'];_0x3a20be[_0xcba4('0x6c')]=_0x3a20be[_0xcba4('0xb3')]===_0xcba4('0x9')?utils[_0xcba4('0x6d')][_0xcba4('0x138')]:utils['CAMPAIGN_STATUS'][_0xcba4('0x1f8')];for(var _0x32a029=0x0;_0x32a029<_0x1e4528[_0xcba4('0x9c')];_0x32a029+=0x1){if(_['isNil'](_0x1e4528[_0x32a029])||_[_0xcba4('0xf4')](_0x1e4528[_0x32a029][_0xcba4('0x16d')])||_[_0xcba4('0xf4')](_0x1e4528[_0x32a029]['phone'])){_0xca178c[_0xcba4('0x204')]('[actionOriginate]\x20',_0x3a20be,_0x1e4528[_0x32a029]);}else{hopperUtils[_0xcba4('0x205')](_[_0xcba4('0x7a')](_0x1e4528[_0x32a029],[_0xcba4('0xdf'),_0xcba4('0x159')]))[_0xcba4('0x42')](_0xca178c[_0xcba4('0x1de')](_0x3a20be,_0x1e4528[_0x32a029]))[_0xcba4('0xa2')](_0xca178c[_0xcba4('0x14f')]('[actionOriginate]\x20',_0x3a20be));}}}})[_0xcba4('0xa2')](loggerGetContactDialer('[getContactDialer2]',_0x3a20be,_0x3fe09a));}};Dialer[_0xcba4('0x1a')][_0xcba4('0x65')]=function(_0x30ffc6){if(_0x30ffc6[_0xcba4('0x1fd')]>0x0){var _0x17dc35=_0x30ffc6[_0xcba4('0x1fd')]-_0x30ffc6[_0xcba4('0x84')]-_0x30ffc6['talking'];if(_0x17dc35>0x0){this[_0xcba4('0x206')](_0x30ffc6);}else{loggerPredictiveCalls[_0xcba4('0x4c')](_0xcba4('0x207'));}}else{this[_0xcba4('0x206')](_0x30ffc6);}};Dialer[_0xcba4('0x1a')][_0xcba4('0x206')]=function(_0x71163e){var _0x616d40=this;var _0x2dc2bf=[];_0x71163e[_0xcba4('0x84')]+=0x1;for(var _0x151137 in this[_0xcba4('0x21')]){if(typeof this[_0xcba4('0x21')][_0x151137]!=='undefined'){if(this[_0xcba4('0x21')][_0x151137]['state']===_0xcba4('0x1ff')&&this['agents'][_0x151137][_0xcba4('0x8c')]==='reachable'){_0x2dc2bf[_0xcba4('0xa3')](this[_0xcba4('0x21')][_0x151137]['id']);}}}return this['getContactDialer'](_0x71163e['id'],_0x2dc2bf,0x1,_0x71163e[_0xcba4('0x1f6')],_0x71163e)[_0xcba4('0x42')](function(_0x153f80){if(!utils[_0xcba4('0x201')](_0x153f80)){utils[_0xcba4('0x69')](_0x71163e,0x1,0x0);return hopperUtils['countReScheduled'](_0x71163e)['then'](sendMessageReschedule(_0x71163e))[_0xcba4('0xa2')](loggerCatch(_0xcba4('0x203')));}else{_0x71163e[_0xcba4('0x6c')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_['isNil'](_0x153f80[0x0])||_[_0xcba4('0xf4')](_0x153f80[0x0][_0xcba4('0x16d')])||_[_0xcba4('0xf4')](_0x153f80[0x0][_0xcba4('0x159')])){_0x616d40['emptyContact'](_0xcba4('0x1fa'),_0x71163e,_0x153f80[0x0]);}else{return hopperUtils[_0xcba4('0x205')](_[_0xcba4('0x7a')](_0x153f80[0x0],[_0xcba4('0xdf'),_0xcba4('0x159')]))[_0xcba4('0x42')](_0x616d40[_0xcba4('0x1de')](_0x71163e,_0x153f80[0x0]))['catch'](_0x616d40[_0xcba4('0x14f')](_0xcba4('0x208'),_0x71163e));}}})[_0xcba4('0xa2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x71163e,0x1));};Dialer[_0xcba4('0x1a')][_0xcba4('0x1d8')]=function(_0x38a5dd,_0x33bd06,_0x39068a,_0x54114a,_0x44a855,_0x57182a){loggerPredictive['info'](_0xcba4('0x209'));loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20a'),_0x38a5dd);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20b'),_0x33bd06);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20c'),_0x39068a);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20d'),_0x54114a);loggerPredictive['info'](_0xcba4('0x20e'),_0x44a855);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x55'));return new Promise(function(_0x4ea48b,_0x1d544a){if(_0x38a5dd<=0x0||isNaN(_0x38a5dd)){return _0x1d544a(msgResponse(_0xcba4('0x20f'),'Error',_0xcba4('0x210')+_0x38a5dd));}if(_0x39068a<=0x0||isNaN(_0x39068a)){return _0x1d544a(msgResponse('[abandonmentRate]','Error',_0xcba4('0x211')+_0x39068a));}if(_0x54114a<=0x0||isNaN(_0x54114a)){return _0x1d544a(msgResponse(_0xcba4('0x20f'),'Error',_0xcba4('0x212')+_0x54114a));}if(_0x33bd06<=0x0||isNaN(_0x33bd06)){return _0x1d544a(msgResponse(_0xcba4('0x20f'),_0xcba4('0x88'),_0xcba4('0x213')+_0x33bd06));}if(_0x44a855<=0x0||isNaN(_0x44a855)){return _0x1d544a(msgResponse('[abandonmentRate]',_0xcba4('0x88'),_0xcba4('0x214')+_0x44a855));}_0x57182a=_0x57182a||0x0;var _0x2cce77=0x1/_0x39068a;var _0x1aa453=0x0;var _0x148ee8=0x0;var _0x1113ec=0x0;var _0x56cafa=0x0;for(var _0x1f8623=0x0;_0x1113ec<_0x44a855;_0x1f8623+=0x1){_0x148ee8=_0x1f8623/_0x33bd06;_0x1aa453=(_0x54114a*_0x148ee8+_0x57182a)/_0x2cce77;_0x1113ec=utils[_0xcba4('0x215')](_0x1aa453,_0x38a5dd);_0x56cafa=_0x1aa453/_0x38a5dd*(0x1-utils[_0xcba4('0x215')](_0x1aa453,_0x38a5dd));}return _0x4ea48b({'erlangCalls':_0x1f8623,'erlangCallToSecond':_0x33bd06/_0x1f8623,'erlangAbandonmentRate':_0x1113ec,'erlangBusyFactor':_0x56cafa});});};Dialer[_0xcba4('0x1a')][_0xcba4('0x1d1')]=function(_0x5c864d,_0x53e39e,_0x5d716a,_0x15eae7,_0x259f9d,_0x842118){loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x216'));loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20a'),_0x5c864d);loggerPredictive['info'](_0xcba4('0x20b'),_0x53e39e);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20c'),_0x5d716a);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x20d'),_0x15eae7);loggerPredictive[_0xcba4('0x4c')](_0xcba4('0x217'),_0x259f9d);loggerPredictive[_0xcba4('0x4c')]('---------------------------');return new Promise(function(_0x18b7fa,_0x546cdb){if(_0x5c864d<=0x0||isNaN(_0x5c864d)){return _0x546cdb(msgResponse('[busyFactor]',_0xcba4('0x88'),'m\x20=\x20'+_0x5c864d));}if(_0x5d716a<=0x0||isNaN(_0x5d716a)){return _0x546cdb(msgResponse(_0xcba4('0x218'),_0xcba4('0x88'),'Ts\x20=\x20'+_0x5d716a));}if(_0x15eae7<=0x0||isNaN(_0x15eae7)){return _0x546cdb(msgResponse(_0xcba4('0x218'),_0xcba4('0x88'),'p\x20=\x20'+_0x15eae7));}if(_0x53e39e<=0x0||isNaN(_0x53e39e)){return _0x546cdb(msgResponse(_0xcba4('0x218'),'Error',_0xcba4('0x213')+_0x53e39e));}if(_0x259f9d<=0x0||isNaN(_0x259f9d)){return _0x546cdb(msgResponse(_0xcba4('0x218'),_0xcba4('0x88'),'Umin\x20=\x20'+_0x259f9d));}_0x842118=_0x842118||0x0;var _0x3eb24f=0x1/_0x5d716a;var _0x318fda=0x0;var _0x321db0=0x0;var _0x172166=0x0;var _0x484197=0x0;for(var _0x2d8fdf=0x0;_0x484197<_0x259f9d;_0x2d8fdf+=0x1){_0x321db0=_0x2d8fdf/_0x53e39e;_0x318fda=(_0x15eae7*_0x321db0+_0x842118)/_0x3eb24f;_0x172166=utils[_0xcba4('0x215')](_0x318fda,_0x5c864d);_0x484197=_0x318fda/_0x5c864d*(0x1-utils[_0xcba4('0x215')](_0x318fda,_0x5c864d));}return _0x18b7fa({'erlangCalls':_0x2d8fdf,'erlangCallToSecond':_0x53e39e/_0x2d8fdf,'erlangAbandonmentRate':_0x172166,'erlangBusyFactor':_0x484197});});};module[_0xcba4('0x219')]=Dialer;
\ No newline at end of file
index 1c929e9..bb823a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f1f=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','firstName','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x179d31,_0x581c6a){var _0x8039d5=function(_0x9e0c4c){while(--_0x9e0c4c){_0x179d31['push'](_0x179d31['shift']());}};_0x8039d5(++_0x581c6a);}(_0x8f1f,0x197));var _0xf8f1=function(_0x13b853,_0x409644){_0x13b853=_0x13b853-0x0;var _0xec64c2=_0x8f1f[_0x13b853];return _0xec64c2;};'use strict';var util=require('util');var _=require(_0xf8f1('0x0'));var moment=require(_0xf8f1('0x1'));function checkNameSurname(_0x4ab20b,_0x562e34,_0x920df0){var _0x29c8a5='';if(!_[_0xf8f1('0x2')](_0x562e34)&&_0xf8f1('0x3')===typeof _0x562e34){_0x29c8a5+=_0x562e34;}if(!_[_0xf8f1('0x2')](_0x920df0)&&_0xf8f1('0x3')===typeof _0x920df0){_0x29c8a5+='\x20'+_0x920df0;}if(_0x29c8a5!==''){return _0x29c8a5;}return _0x4ab20b;}function Action(_0x3d3a59,_0x1c733f,_0x4aa094){this[_0xf8f1('0x4')]=_0x3d3a59;this[_0xf8f1('0x5')]=_0x4aa094||undefined;this[_0xf8f1('0x6')]=checkNameSurname(_0x1c733f['Contact'][_0xf8f1('0x7')],_0x1c733f['Contact'][_0xf8f1('0x8')],_0x1c733f[_0xf8f1('0x9')][_0xf8f1('0xa')]);this[_0xf8f1('0xb')]=_0x1c733f[_0xf8f1('0x7')];this[_0xf8f1('0xc')]=_0x3d3a59['name'];this[_0xf8f1('0xd')]=_0x1c733f[_0xf8f1('0xd')]||![];this[_0xf8f1('0xe')]=_0x3d3a59['type'];this[_0xf8f1('0xf')]=_0x3d3a59['dialQueueTimeout']||0x3;this['scheduledat']=_0x1c733f[_0xf8f1('0x10')];this[_0xf8f1('0x11')]=_0x1c733f[_0xf8f1('0x11')];this[_0xf8f1('0x12')]=_0x1c733f[_0xf8f1('0x12')];this[_0xf8f1('0x13')]=_0x1c733f['countnoanswerretry'];this[_0xf8f1('0x14')]=_0x1c733f[_0xf8f1('0x14')];this['countdropretry']=_0x1c733f[_0xf8f1('0x15')];this[_0xf8f1('0x16')]=_0x1c733f[_0xf8f1('0x16')];this['countmachineretry']=_0x1c733f['countmachineretry'];this[_0xf8f1('0x17')]=_0x1c733f[_0xf8f1('0x17')];this[_0xf8f1('0x18')]=_0x1c733f[_0xf8f1('0x18')];this[_0xf8f1('0x19')]=_0x1c733f[_0xf8f1('0x19')];this[_0xf8f1('0x1a')]=_0x1c733f[_0xf8f1('0x1a')];this['VoiceQueueId']=_0x1c733f['VoiceQueueId'];this[_0xf8f1('0x1b')]=_0x1c733f['CampaignId'];this[_0xf8f1('0x1c')]=_0x1c733f['id'];this[_0xf8f1('0x1d')]=_0x1c733f[_0xf8f1('0x9')][_0xf8f1('0x8')]||'';this['starttime']=moment()[_0xf8f1('0x1e')](_0xf8f1('0x1f'));this[_0xf8f1('0x20')]=_0x1c733f[_0xf8f1('0x20')];this['callbackuniqueid']=_0x1c733f[_0xf8f1('0x21')];this[_0xf8f1('0x22')]=_0x1c733f[_0xf8f1('0x22')];this[_0xf8f1('0x23')]=_0x1c733f[_0xf8f1('0x23')];this[_0xf8f1('0x24')]='';this[_0xf8f1('0x25')]='';}Action[_0xf8f1('0x26')]['getCaller']=function(){return util['format'](_0xf8f1('0x27'),this[_0xf8f1('0x6')],this[_0xf8f1('0x4')]['dialCutDigit']>0x0?this[_0xf8f1('0xb')][_0xf8f1('0x28')](this[_0xf8f1('0x4')][_0xf8f1('0x29')]):this['number']);};Action[_0xf8f1('0x26')][_0xf8f1('0x2a')]=function(){return this[_0xf8f1('0xc')];};module[_0xf8f1('0x2b')]=Action;
\ No newline at end of file
+var _0x8a23=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','prototype','queue','exports','util','string','voiceQueue','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x653922,_0x189357){var _0x14df5c=function(_0x1ea4f2){while(--_0x1ea4f2){_0x653922['push'](_0x653922['shift']());}};_0x14df5c(++_0x189357);}(_0x8a23,0x134));var _0x38a2=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0x8a23[_0x208505];return _0x1a985f;};'use strict';var util=require(_0x38a2('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x17b8ba,_0x745676,_0x11e994){var _0xd6aeca='';if(!_['isNil'](_0x745676)&&_0x38a2('0x1')===typeof _0x745676){_0xd6aeca+=_0x745676;}if(!_['isNil'](_0x11e994)&&_0x38a2('0x1')===typeof _0x11e994){_0xd6aeca+='\x20'+_0x11e994;}if(_0xd6aeca!==''){return _0xd6aeca;}return _0x17b8ba;}function Action(_0x1d09a9,_0x52991a,_0x53af93){this[_0x38a2('0x2')]=_0x1d09a9;this['uniqueid']=_0x53af93||undefined;this[_0x38a2('0x3')]=checkNameSurname(_0x52991a[_0x38a2('0x4')][_0x38a2('0x5')],_0x52991a[_0x38a2('0x4')][_0x38a2('0x6')],_0x52991a[_0x38a2('0x4')][_0x38a2('0x7')]);this['number']=_0x52991a[_0x38a2('0x5')];this['queue']=_0x1d09a9[_0x38a2('0x3')];this[_0x38a2('0x8')]=_0x52991a['active']||![];this[_0x38a2('0x9')]=_0x1d09a9[_0x38a2('0x9')];this[_0x38a2('0xa')]=_0x1d09a9['dialQueueTimeout']||0x3;this[_0x38a2('0xb')]=_0x52991a['scheduledat'];this[_0x38a2('0xc')]=_0x52991a[_0x38a2('0xc')];this[_0x38a2('0xd')]=_0x52991a['countcongestionretry'];this['countnoanswerretry']=_0x52991a[_0x38a2('0xe')];this[_0x38a2('0xf')]=_0x52991a['countnosuchnumberretry'];this[_0x38a2('0x10')]=_0x52991a['countdropretry'];this['countabandonedretry']=_0x52991a[_0x38a2('0x11')];this[_0x38a2('0x12')]=_0x52991a[_0x38a2('0x12')];this[_0x38a2('0x13')]=_0x52991a['countagentrejectretry'];this['ContactId']=_0x52991a[_0x38a2('0x14')];this[_0x38a2('0x15')]=_0x52991a[_0x38a2('0x15')];this[_0x38a2('0x16')]=_0x52991a[_0x38a2('0x16')];this[_0x38a2('0x17')]=_0x52991a[_0x38a2('0x17')];this['CampaignId']=_0x52991a[_0x38a2('0x18')];this[_0x38a2('0x19')]=_0x52991a['id'];this['ContactFirstName']=_0x52991a['Contact'][_0x38a2('0x6')]||'';this[_0x38a2('0x1a')]=moment()['format'](_0x38a2('0x1b'));this[_0x38a2('0x1c')]=_0x52991a['callback'];this[_0x38a2('0x1d')]=_0x52991a['callbackuniqueid'];this['callbackat']=_0x52991a[_0x38a2('0x1e')];this['recallme']=_0x52991a['recallme'];this['originatecalleridnum']='';this[_0x38a2('0x1f')]='';}Action['prototype'][_0x38a2('0x20')]=function(){return util[_0x38a2('0x21')](_0x38a2('0x22'),this[_0x38a2('0x3')],this['voiceQueue'][_0x38a2('0x23')]>0x0?this[_0x38a2('0x24')][_0x38a2('0x25')](this[_0x38a2('0x2')]['dialCutDigit']):this[_0x38a2('0x24')]);};Action[_0x38a2('0x26')]['getQueue']=function(){return this[_0x38a2('0x27')];};module[_0x38a2('0x28')]=Action;
\ No newline at end of file
index 81cee9a..635cfb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90fd=['ListId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','exports','moment','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x1d8788,_0x53bfa1){var _0x397c31=function(_0x4759f6){while(--_0x4759f6){_0x1d8788['push'](_0x1d8788['shift']());}};_0x397c31(++_0x53bfa1);}(_0x90fd,0x177));var _0xd90f=function(_0x23a8dc,_0x25b05b){_0x23a8dc=_0x23a8dc-0x0;var _0x3503fa=_0x90fd[_0x23a8dc];return _0x3503fa;};'use strict';var moment=require(_0xd90f('0x0'));var utils=require(_0xd90f('0x1'));function AgentComplete(_0x226479,_0x5a29b5){this['state']=0x4;this['statedesc']='Answer';this[_0xd90f('0x2')]=_0x226479[_0xd90f('0x2')];this[_0xd90f('0x3')]=_0x226479[_0xd90f('0x3')];this[_0xd90f('0x4')]=_0x226479[_0xd90f('0x3')]===_0xd90f('0x5')?_0xd90f('0x6'):_0x226479[_0xd90f('0x3')];this[_0xd90f('0x7')]=_0x226479[_0xd90f('0x7')];this[_0xd90f('0x8')]=_0x226479[_0xd90f('0x8')];this[_0xd90f('0x9')]=_0x226479[_0xd90f('0x9')];this[_0xd90f('0xa')]=_0x226479[_0xd90f('0x7')]+_0x226479['countcongestionretry']+_0x226479[_0xd90f('0x9')]+_0x226479[_0xd90f('0xb')]+_0x226479[_0xd90f('0xc')]+_0x226479[_0xd90f('0xd')]+_0x226479[_0xd90f('0xe')]+_0x226479[_0xd90f('0xf')];this[_0xd90f('0xb')]=_0x226479[_0xd90f('0xb')];this[_0xd90f('0xc')]=_0x226479[_0xd90f('0xc')];this[_0xd90f('0xd')]=_0x226479[_0xd90f('0xd')];this['countmachineretry']=_0x226479[_0xd90f('0xe')];this[_0xd90f('0xf')]=_0x226479[_0xd90f('0xf')];this[_0xd90f('0x10')]=_0x5a29b5[_0xd90f('0x10')];this[_0xd90f('0x11')]=_0x226479[_0xd90f('0x12')];this[_0xd90f('0x13')]=_0x226479[_0xd90f('0x14')];this[_0xd90f('0x15')]=_0x226479[_0xd90f('0x15')];this[_0xd90f('0x16')]=_0x226479[_0xd90f('0x16')];this[_0xd90f('0x17')]=_0x226479[_0xd90f('0x17')];this[_0xd90f('0x18')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils['getSeconds'](_0x226479[_0xd90f('0x16')],_0x226479[_0xd90f('0x15')]);this[_0xd90f('0x19')]=utils[_0xd90f('0x1a')](_0x226479[_0xd90f('0x17')],_0x226479[_0xd90f('0x16')]);this[_0xd90f('0x1b')]=utils['getSeconds'](this[_0xd90f('0x18')],_0x226479[_0xd90f('0x17')]);this[_0xd90f('0x6')]=_0x5a29b5['queue'];this['membername']=_0x5a29b5[_0xd90f('0x1c')];this[_0xd90f('0x1d')]=_0x5a29b5['reason'];this[_0xd90f('0x1e')]=_0x226479[_0xd90f('0x1e')];this['callbackuniqueid']=_0x226479[_0xd90f('0x1f')];this['callbackat']=_0x226479[_0xd90f('0x20')];this[_0xd90f('0x21')]=_0x226479['recallme'];this[_0xd90f('0x22')]=_0x226479[_0xd90f('0x22')];this[_0xd90f('0x23')]=_0x226479[_0xd90f('0x23')];this['UserId']=_0x226479['UserId'];this[_0xd90f('0x24')]=_0x226479[_0xd90f('0x24')];this[_0xd90f('0x25')]=_0x226479[_0xd90f('0x25')];this[_0xd90f('0x26')]=_0x226479[_0xd90f('0x26')]||'';this['originatecalleridname']=_0x226479['originatecalleridname']||'';this[_0xd90f('0x27')]=_0x226479[_0xd90f('0x27')];}module[_0xd90f('0x28')]=AgentComplete;
\ No newline at end of file
+var _0xc463=['callback','callbackuniqueid','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','responsetime','answertime','endtime','format','ringtime','getSeconds','starttime','holdtime','talktime','membername','reason'];(function(_0x1e9d08,_0x1027a7){var _0x1f53cb=function(_0x56bc29){while(--_0x56bc29){_0x1e9d08['push'](_0x1e9d08['shift']());}};_0x1f53cb(++_0x1027a7);}(_0xc463,0x7f));var _0x3c46=function(_0x368682,_0x56698f){_0x368682=_0x368682-0x0;var _0x2bc428=_0xc463[_0x368682];return _0x2bc428;};'use strict';var moment=require(_0x3c46('0x0'));var utils=require(_0x3c46('0x1'));function AgentComplete(_0x5d4de3,_0x3e1ad6){this['state']=0x4;this['statedesc']='Answer';this[_0x3c46('0x2')]=_0x5d4de3['scheduledat'];this[_0x3c46('0x3')]=_0x5d4de3[_0x3c46('0x3')];this[_0x3c46('0x4')]=_0x5d4de3['type']==='outbound'?_0x3c46('0x5'):_0x5d4de3[_0x3c46('0x3')];this[_0x3c46('0x6')]=_0x5d4de3[_0x3c46('0x6')];this['countcongestionretry']=_0x5d4de3[_0x3c46('0x7')];this[_0x3c46('0x8')]=_0x5d4de3[_0x3c46('0x8')];this['countglobal']=_0x5d4de3[_0x3c46('0x6')]+_0x5d4de3[_0x3c46('0x7')]+_0x5d4de3[_0x3c46('0x8')]+_0x5d4de3[_0x3c46('0x9')]+_0x5d4de3[_0x3c46('0xa')]+_0x5d4de3[_0x3c46('0xb')]+_0x5d4de3[_0x3c46('0xc')]+_0x5d4de3[_0x3c46('0xd')];this['countnosuchnumberretry']=_0x5d4de3[_0x3c46('0x9')];this[_0x3c46('0xa')]=_0x5d4de3[_0x3c46('0xa')];this['countabandonedretry']=_0x5d4de3[_0x3c46('0xb')];this[_0x3c46('0xc')]=_0x5d4de3[_0x3c46('0xc')];this[_0x3c46('0xd')]=_0x5d4de3[_0x3c46('0xd')];this[_0x3c46('0xe')]=_0x3e1ad6[_0x3c46('0xe')];this[_0x3c46('0xf')]=_0x5d4de3[_0x3c46('0x10')];this[_0x3c46('0x11')]=_0x5d4de3['number'];this['starttime']=_0x5d4de3['starttime'];this['responsetime']=_0x5d4de3[_0x3c46('0x12')];this[_0x3c46('0x13')]=_0x5d4de3[_0x3c46('0x13')];this[_0x3c46('0x14')]=moment()[_0x3c46('0x15')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3c46('0x16')]=utils[_0x3c46('0x17')](_0x5d4de3[_0x3c46('0x12')],_0x5d4de3[_0x3c46('0x18')]);this[_0x3c46('0x19')]=utils[_0x3c46('0x17')](_0x5d4de3[_0x3c46('0x13')],_0x5d4de3['responsetime']);this[_0x3c46('0x1a')]=utils[_0x3c46('0x17')](this[_0x3c46('0x14')],_0x5d4de3[_0x3c46('0x13')]);this[_0x3c46('0x5')]=_0x3e1ad6['queue'];this['membername']=_0x3e1ad6[_0x3c46('0x1b')];this[_0x3c46('0x1c')]=_0x3e1ad6['reason'];this[_0x3c46('0x1d')]=_0x5d4de3['callback'];this[_0x3c46('0x1e')]=_0x5d4de3[_0x3c46('0x1e')];this['callbackat']=_0x5d4de3['callbackat'];this['recallme']=_0x5d4de3['recallme'];this[_0x3c46('0x1f')]=_0x5d4de3[_0x3c46('0x1f')];this[_0x3c46('0x20')]=_0x5d4de3[_0x3c46('0x20')];this['UserId']=_0x5d4de3['UserId'];this[_0x3c46('0x21')]=_0x5d4de3[_0x3c46('0x21')];this[_0x3c46('0x22')]=_0x5d4de3['CampaignId'];this['originatecalleridnum']=_0x5d4de3[_0x3c46('0x23')]||'';this[_0x3c46('0x24')]=_0x5d4de3[_0x3c46('0x24')]||'';this[_0x3c46('0x25')]=_0x5d4de3['agiafterat'];}module[_0x3c46('0x26')]=AgentComplete;
\ No newline at end of file
index 22ed05a..3e554b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1bd=['countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x19ad72,_0x80d275){var _0x3c9427=function(_0x2c5bf7){while(--_0x2c5bf7){_0x19ad72['push'](_0x19ad72['shift']());}};_0x3c9427(++_0x80d275);}(_0xc1bd,0xa9));var _0xdc1b=function(_0x35bfdf,_0x12e6d1){_0x35bfdf=_0x35bfdf-0x0;var _0x30d138=_0xc1bd[_0x35bfdf];return _0x30d138;};'use strict';function Final(_0x2daa91){this[_0xdc1b('0x0')]=_0x2daa91[_0xdc1b('0x0')];this[_0xdc1b('0x1')]=_0x2daa91['scheduledat'];this[_0xdc1b('0x2')]=_0x2daa91[_0xdc1b('0x2')];this[_0xdc1b('0x3')]=_0x2daa91[_0xdc1b('0x2')]===_0xdc1b('0x4')?_0xdc1b('0x5'):_0x2daa91[_0xdc1b('0x2')];this['countbusyretry']=_0x2daa91['countbusyretry'];this[_0xdc1b('0x6')]=_0x2daa91['countcongestionretry'];this['countnoanswerretry']=_0x2daa91[_0xdc1b('0x7')];this[_0xdc1b('0x8')]=_0x2daa91[_0xdc1b('0x9')]+_0x2daa91[_0xdc1b('0x6')]+_0x2daa91[_0xdc1b('0x7')]+_0x2daa91[_0xdc1b('0xa')]+_0x2daa91[_0xdc1b('0xb')]+_0x2daa91['countabandonedretry']+_0x2daa91[_0xdc1b('0xc')]+_0x2daa91['countagentrejectretry'];this['countnosuchnumberretry']=_0x2daa91[_0xdc1b('0xa')];this['countdropretry']=_0x2daa91[_0xdc1b('0xb')];this[_0xdc1b('0xd')]=_0x2daa91[_0xdc1b('0xd')];this[_0xdc1b('0xc')]=_0x2daa91[_0xdc1b('0xc')];this[_0xdc1b('0xe')]=_0x2daa91[_0xdc1b('0xe')];this[_0xdc1b('0x5')]=_0x2daa91[_0xdc1b('0x5')];this[_0xdc1b('0xf')]=_0x2daa91[_0xdc1b('0xf')];this['calleridnum']=_0x2daa91['calleridnum'];this[_0xdc1b('0x10')]=_0x2daa91['starttime'];this[_0xdc1b('0x11')]=_0x2daa91[_0xdc1b('0x11')];this[_0xdc1b('0x12')]=_0x2daa91[_0xdc1b('0x11')];this[_0xdc1b('0x13')]=_0x2daa91[_0xdc1b('0x13')]||0x0;this[_0xdc1b('0x14')]=_0x2daa91[_0xdc1b('0x14')]||0x0;this[_0xdc1b('0x15')]=_0x2daa91[_0xdc1b('0x15')]||0x0;this['callback']=_0x2daa91[_0xdc1b('0x16')];this['callbackuniqueid']=_0x2daa91[_0xdc1b('0x17')];this[_0xdc1b('0x18')]=_0x2daa91[_0xdc1b('0x18')];this[_0xdc1b('0x19')]=_0x2daa91[_0xdc1b('0x19')];this[_0xdc1b('0x1a')]=_0x2daa91[_0xdc1b('0x1a')];this['ListId']=_0x2daa91['ListId'];this[_0xdc1b('0x1b')]=_0x2daa91[_0xdc1b('0x1b')];this[_0xdc1b('0x1c')]=_0x2daa91[_0xdc1b('0x1c')];this[_0xdc1b('0x1d')]=_0x2daa91[_0xdc1b('0x1d')];this['originatecalleridnum']=_0x2daa91[_0xdc1b('0x1e')]||'';this[_0xdc1b('0x1f')]=_0x2daa91[_0xdc1b('0x1f')]||'';this[_0xdc1b('0x20')]=_0x2daa91[_0xdc1b('0x20')];this[_0xdc1b('0x21')]=_0x2daa91[_0xdc1b('0x21')];}module[_0xdc1b('0x22')]=Final;
\ No newline at end of file
+var _0x1af9=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x467d1b,_0x2f3b7f){var _0x100125=function(_0x212d4e){while(--_0x212d4e){_0x467d1b['push'](_0x467d1b['shift']());}};_0x100125(++_0x2f3b7f);}(_0x1af9,0x153));var _0x91af=function(_0x328642,_0x2efdba){_0x328642=_0x328642-0x0;var _0x307fdd=_0x1af9[_0x328642];return _0x307fdd;};'use strict';function Final(_0x5c120e){this[_0x91af('0x0')]=_0x5c120e['uniqueid'];this[_0x91af('0x1')]=_0x5c120e[_0x91af('0x1')];this[_0x91af('0x2')]=_0x5c120e[_0x91af('0x2')];this[_0x91af('0x3')]=_0x5c120e['type']===_0x91af('0x4')?_0x91af('0x5'):_0x5c120e[_0x91af('0x2')];this[_0x91af('0x6')]=_0x5c120e[_0x91af('0x6')];this[_0x91af('0x7')]=_0x5c120e[_0x91af('0x7')];this[_0x91af('0x8')]=_0x5c120e[_0x91af('0x8')];this[_0x91af('0x9')]=_0x5c120e[_0x91af('0x6')]+_0x5c120e['countcongestionretry']+_0x5c120e[_0x91af('0x8')]+_0x5c120e[_0x91af('0xa')]+_0x5c120e[_0x91af('0xb')]+_0x5c120e[_0x91af('0xc')]+_0x5c120e[_0x91af('0xd')]+_0x5c120e[_0x91af('0xe')];this[_0x91af('0xa')]=_0x5c120e['countnosuchnumberretry'];this[_0x91af('0xb')]=_0x5c120e[_0x91af('0xb')];this[_0x91af('0xc')]=_0x5c120e[_0x91af('0xc')];this['countmachineretry']=_0x5c120e[_0x91af('0xd')];this['countagentrejectretry']=_0x5c120e[_0x91af('0xe')];this['queue']=_0x5c120e['queue'];this['calleridname']=_0x5c120e[_0x91af('0xf')];this[_0x91af('0x10')]=_0x5c120e[_0x91af('0x10')];this['starttime']=_0x5c120e['starttime'];this[_0x91af('0x11')]=_0x5c120e['responsetime'];this[_0x91af('0x12')]=_0x5c120e[_0x91af('0x11')];this[_0x91af('0x13')]=_0x5c120e[_0x91af('0x13')]||0x0;this['holdtime']=_0x5c120e[_0x91af('0x14')]||0x0;this[_0x91af('0x15')]=_0x5c120e['talktime']||0x0;this[_0x91af('0x16')]=_0x5c120e[_0x91af('0x16')];this[_0x91af('0x17')]=_0x5c120e[_0x91af('0x17')];this[_0x91af('0x18')]=_0x5c120e['callbackat'];this['recallme']=_0x5c120e[_0x91af('0x19')];this['ContactId']=_0x5c120e['ContactId'];this['ListId']=_0x5c120e[_0x91af('0x1a')];this[_0x91af('0x1b')]=_0x5c120e[_0x91af('0x1b')];this[_0x91af('0x1c')]=_0x5c120e[_0x91af('0x1c')];this['CampaignId']=_0x5c120e[_0x91af('0x1d')];this[_0x91af('0x1e')]=_0x5c120e[_0x91af('0x1e')]||'';this[_0x91af('0x1f')]=_0x5c120e['originatecalleridname']||'';this[_0x91af('0x20')]=_0x5c120e[_0x91af('0x20')];this[_0x91af('0x21')]=_0x5c120e[_0x91af('0x21')];}module[_0x91af('0x22')]=Final;
\ No newline at end of file
index 5653892..c0a056b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb7=['queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x518de8,_0x3845aa){var _0x356218=function(_0x3edfcb){while(--_0x3edfcb){_0x518de8['push'](_0x518de8['shift']());}};_0x356218(++_0x3845aa);}(_0x1cb7,0x1f0));var _0x71cb=function(_0x4aa12a,_0x45cb6f){_0x4aa12a=_0x4aa12a-0x0;var _0x506346=_0x1cb7[_0x4aa12a];return _0x506346;};'use strict';var moment=require(_0x71cb('0x0'));var utils=require('../utils');function Hangup(_0x31c83e,_0x1f5000){this[_0x71cb('0x1')]=0x4;this[_0x71cb('0x2')]=_0x71cb('0x3');this[_0x71cb('0x4')]=_0x31c83e['scheduledat'];this['type']=_0x31c83e[_0x71cb('0x5')];this[_0x71cb('0x6')]=_0x31c83e[_0x71cb('0x5')]===_0x71cb('0x7')?_0x71cb('0x8'):_0x31c83e[_0x71cb('0x5')];this[_0x71cb('0x9')]=_0x31c83e[_0x71cb('0x9')]||![];this[_0x71cb('0xa')]=_0x31c83e[_0x71cb('0xa')];this['countcongestionretry']=_0x31c83e[_0x71cb('0xb')];this[_0x71cb('0xc')]=_0x31c83e[_0x71cb('0xc')];this[_0x71cb('0xd')]=_0x31c83e[_0x71cb('0xa')]+_0x31c83e[_0x71cb('0xb')]+_0x31c83e['countnoanswerretry']+_0x31c83e[_0x71cb('0xe')]+_0x31c83e[_0x71cb('0xf')]+_0x31c83e[_0x71cb('0x10')]+_0x31c83e[_0x71cb('0x11')]+_0x31c83e['countagentrejectretry'];this[_0x71cb('0xe')]=_0x31c83e['countnosuchnumberretry'];this['countdropretry']=_0x31c83e[_0x71cb('0xf')];this[_0x71cb('0x10')]=_0x31c83e[_0x71cb('0x10')];this[_0x71cb('0x11')]=_0x31c83e[_0x71cb('0x11')];this[_0x71cb('0x12')]=_0x31c83e[_0x71cb('0x12')];this[_0x71cb('0x13')]=_0x1f5000[_0x71cb('0x13')];this['calleridname']=_0x31c83e['name'];this[_0x71cb('0x14')]=_0x31c83e['number'];this[_0x71cb('0x15')]=_0x31c83e[_0x71cb('0x15')];this[_0x71cb('0x16')]=_0x31c83e[_0x71cb('0x16')];this[_0x71cb('0x17')]=moment()[_0x71cb('0x18')](_0x71cb('0x19'));this[_0x71cb('0x1a')]=utils[_0x71cb('0x1b')](_0x31c83e[_0x71cb('0x16')],_0x31c83e[_0x71cb('0x15')]);this[_0x71cb('0x1c')]=0x0;this[_0x71cb('0x1d')]=utils[_0x71cb('0x1b')](this['endtime'],_0x31c83e[_0x71cb('0x16')]);this[_0x71cb('0x8')]=_0x31c83e['queue'];this['membername']=_0x71cb('0x1e');this[_0x71cb('0x1f')]=_0x1f5000[_0x71cb('0x20')];this[_0x71cb('0x21')]=_0x31c83e[_0x71cb('0x21')];this['callbackuniqueid']=_0x31c83e[_0x71cb('0x22')];this['callbackat']=_0x31c83e[_0x71cb('0x23')];this[_0x71cb('0x24')]=_0x31c83e['recallme'];this[_0x71cb('0x25')]=_0x31c83e[_0x71cb('0x25')];this[_0x71cb('0x26')]=_0x31c83e['ListId'];this['UserId']=_0x31c83e[_0x71cb('0x27')];this['VoiceQueueId']=_0x31c83e[_0x71cb('0x28')];this[_0x71cb('0x29')]=_0x31c83e[_0x71cb('0x29')];}module['exports']=Hangup;
\ No newline at end of file
+var _0x028d=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','membername','IVR','reason','cause-txt','callback'];(function(_0x209db1,_0x58b08e){var _0x16e440=function(_0x3faf2e){while(--_0x3faf2e){_0x209db1['push'](_0x209db1['shift']());}};_0x16e440(++_0x58b08e);}(_0x028d,0x14a));var _0xd028=function(_0x1290ed,_0x2d15ac){_0x1290ed=_0x1290ed-0x0;var _0x28cfa7=_0x028d[_0x1290ed];return _0x28cfa7;};'use strict';var moment=require(_0xd028('0x0'));var utils=require(_0xd028('0x1'));function Hangup(_0x522730,_0x3c1525){this[_0xd028('0x2')]=0x4;this[_0xd028('0x3')]=_0xd028('0x4');this[_0xd028('0x5')]=_0x522730[_0xd028('0x5')];this['type']=_0x522730[_0xd028('0x6')];this[_0xd028('0x7')]=_0x522730[_0xd028('0x6')]===_0xd028('0x8')?_0xd028('0x9'):_0x522730[_0xd028('0x6')];this['amd']=_0x522730['amd']||![];this[_0xd028('0xa')]=_0x522730[_0xd028('0xa')];this[_0xd028('0xb')]=_0x522730[_0xd028('0xb')];this[_0xd028('0xc')]=_0x522730[_0xd028('0xc')];this[_0xd028('0xd')]=_0x522730[_0xd028('0xa')]+_0x522730[_0xd028('0xb')]+_0x522730[_0xd028('0xc')]+_0x522730[_0xd028('0xe')]+_0x522730[_0xd028('0xf')]+_0x522730[_0xd028('0x10')]+_0x522730[_0xd028('0x11')]+_0x522730['countagentrejectretry'];this['countnosuchnumberretry']=_0x522730['countnosuchnumberretry'];this[_0xd028('0xf')]=_0x522730[_0xd028('0xf')];this[_0xd028('0x10')]=_0x522730[_0xd028('0x10')];this['countmachineretry']=_0x522730[_0xd028('0x11')];this[_0xd028('0x12')]=_0x522730[_0xd028('0x12')];this[_0xd028('0x13')]=_0x3c1525[_0xd028('0x13')];this[_0xd028('0x14')]=_0x522730[_0xd028('0x15')];this[_0xd028('0x16')]=_0x522730[_0xd028('0x17')];this[_0xd028('0x18')]=_0x522730[_0xd028('0x18')];this[_0xd028('0x19')]=_0x522730[_0xd028('0x19')];this[_0xd028('0x1a')]=moment()[_0xd028('0x1b')](_0xd028('0x1c'));this[_0xd028('0x1d')]=utils['getSeconds'](_0x522730[_0xd028('0x19')],_0x522730[_0xd028('0x18')]);this[_0xd028('0x1e')]=0x0;this[_0xd028('0x1f')]=utils[_0xd028('0x20')](this[_0xd028('0x1a')],_0x522730[_0xd028('0x19')]);this[_0xd028('0x9')]=_0x522730[_0xd028('0x9')];this[_0xd028('0x21')]=_0xd028('0x22');this[_0xd028('0x23')]=_0x3c1525[_0xd028('0x24')];this[_0xd028('0x25')]=_0x522730[_0xd028('0x25')];this['callbackuniqueid']=_0x522730['callbackuniqueid'];this[_0xd028('0x26')]=_0x522730['callbackat'];this[_0xd028('0x27')]=_0x522730[_0xd028('0x27')];this['ContactId']=_0x522730[_0xd028('0x28')];this[_0xd028('0x29')]=_0x522730[_0xd028('0x29')];this[_0xd028('0x2a')]=_0x522730[_0xd028('0x2a')];this['VoiceQueueId']=_0x522730[_0xd028('0x2b')];this[_0xd028('0x2c')]=_0x522730[_0xd028('0x2c')];}module[_0xd028('0x2d')]=Hangup;
\ No newline at end of file
index 572ff6b..3a4672a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed1=['VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x248f3b,_0x42fba9){var _0x3368f8=function(_0x15158b){while(--_0x15158b){_0x248f3b['push'](_0x248f3b['shift']());}};_0x3368f8(++_0x42fba9);}(_0xfed1,0x1f4));var _0x1fed=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfed1[_0x42cae2];return _0x5f256f;};'use strict';var utils=require('../utils');function History(_0x408e52){this[_0x1fed('0x0')]=_0x408e52[_0x1fed('0x0')];this['scheduledat']=_0x408e52[_0x1fed('0x1')]||undefined;this[_0x1fed('0x2')]=_0x408e52['type'];this[_0x1fed('0x3')]=_0x408e52[_0x1fed('0x2')]===_0x1fed('0x4')?_0x1fed('0x5'):_0x408e52['type'];this['countbusyretry']=_0x408e52[_0x1fed('0x6')];this[_0x1fed('0x7')]=_0x408e52['countcongestionretry'];this[_0x1fed('0x8')]=_0x408e52[_0x1fed('0x8')];this[_0x1fed('0x9')]=_0x408e52[_0x1fed('0x6')]+_0x408e52[_0x1fed('0x7')]+_0x408e52[_0x1fed('0x8')]+_0x408e52[_0x1fed('0xa')]+_0x408e52['countdropretry']+_0x408e52[_0x1fed('0xb')]+_0x408e52[_0x1fed('0xc')]+_0x408e52[_0x1fed('0xd')];this['countnosuchnumberretry']=_0x408e52[_0x1fed('0xa')];this['countdropretry']=_0x408e52[_0x1fed('0xe')];this[_0x1fed('0xb')]=_0x408e52[_0x1fed('0xb')];this[_0x1fed('0xc')]=_0x408e52[_0x1fed('0xc')];this[_0x1fed('0xd')]=_0x408e52[_0x1fed('0xd')];this[_0x1fed('0x5')]=_0x408e52[_0x1fed('0x5')];this[_0x1fed('0xf')]=_0x408e52[_0x1fed('0x10')];this[_0x1fed('0x11')]=_0x408e52[_0x1fed('0x12')];this[_0x1fed('0x13')]=_0x408e52[_0x1fed('0x13')];this[_0x1fed('0x14')]=_0x408e52['responsetime'];this[_0x1fed('0x15')]=_0x408e52['responsetime'];this[_0x1fed('0x16')]=utils[_0x1fed('0x17')](_0x408e52['responsetime'],_0x408e52[_0x1fed('0x13')]);this[_0x1fed('0x18')]=0x0;this['talktime']=0x0;this[_0x1fed('0x19')]=_0x408e52['callback'];this['callbackuniqueid']=_0x408e52[_0x1fed('0x1a')];this[_0x1fed('0x1b')]=_0x408e52[_0x1fed('0x1b')];this[_0x1fed('0x1c')]=_0x408e52['recallme'];this[_0x1fed('0x1d')]=_0x408e52['ContactId'];this['ListId']=_0x408e52[_0x1fed('0x1e')];this[_0x1fed('0x1f')]=_0x408e52[_0x1fed('0x1f')];this[_0x1fed('0x20')]=_0x408e52[_0x1fed('0x20')];this['CampaignId']=_0x408e52['CampaignId'];this[_0x1fed('0x21')]=_0x408e52[_0x1fed('0x21')]||'';this[_0x1fed('0x22')]=_0x408e52[_0x1fed('0x22')]||'';this[_0x1fed('0x23')]=_0x408e52['state'];this['statedesc']=_0x408e52[_0x1fed('0x24')];}module[_0x1fed('0x25')]=History;
\ No newline at end of file
+var _0xe42a=['ringtime','getSeconds','holdtime','talktime','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','../utils','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime'];(function(_0x275a8f,_0x54c858){var _0x13785d=function(_0x1b1465){while(--_0x1b1465){_0x275a8f['push'](_0x275a8f['shift']());}};_0x13785d(++_0x54c858);}(_0xe42a,0xc3));var _0xae42=function(_0x4fd3d2,_0x43efc8){_0x4fd3d2=_0x4fd3d2-0x0;var _0x7d8bc6=_0xe42a[_0x4fd3d2];return _0x7d8bc6;};'use strict';var utils=require(_0xae42('0x0'));function History(_0x3954bb){this[_0xae42('0x1')]=_0x3954bb[_0xae42('0x1')];this[_0xae42('0x2')]=_0x3954bb[_0xae42('0x2')]||undefined;this[_0xae42('0x3')]=_0x3954bb[_0xae42('0x3')];this['campaigntype']=_0x3954bb[_0xae42('0x3')]===_0xae42('0x4')?_0xae42('0x5'):_0x3954bb[_0xae42('0x3')];this['countbusyretry']=_0x3954bb[_0xae42('0x6')];this[_0xae42('0x7')]=_0x3954bb['countcongestionretry'];this[_0xae42('0x8')]=_0x3954bb[_0xae42('0x8')];this[_0xae42('0x9')]=_0x3954bb['countbusyretry']+_0x3954bb[_0xae42('0x7')]+_0x3954bb[_0xae42('0x8')]+_0x3954bb[_0xae42('0xa')]+_0x3954bb[_0xae42('0xb')]+_0x3954bb[_0xae42('0xc')]+_0x3954bb[_0xae42('0xd')]+_0x3954bb[_0xae42('0xe')];this[_0xae42('0xa')]=_0x3954bb[_0xae42('0xa')];this['countdropretry']=_0x3954bb[_0xae42('0xb')];this[_0xae42('0xc')]=_0x3954bb[_0xae42('0xc')];this['countmachineretry']=_0x3954bb[_0xae42('0xd')];this[_0xae42('0xe')]=_0x3954bb[_0xae42('0xe')];this['queue']=_0x3954bb[_0xae42('0x5')];this[_0xae42('0xf')]=_0x3954bb[_0xae42('0x10')];this['calleridnum']=_0x3954bb[_0xae42('0x11')];this[_0xae42('0x12')]=_0x3954bb[_0xae42('0x12')];this[_0xae42('0x13')]=_0x3954bb[_0xae42('0x13')];this[_0xae42('0x14')]=_0x3954bb[_0xae42('0x13')];this[_0xae42('0x15')]=utils[_0xae42('0x16')](_0x3954bb[_0xae42('0x13')],_0x3954bb[_0xae42('0x12')]);this[_0xae42('0x17')]=0x0;this[_0xae42('0x18')]=0x0;this['callback']=_0x3954bb['callback'];this[_0xae42('0x19')]=_0x3954bb[_0xae42('0x19')];this['callbackat']=_0x3954bb['callbackat'];this[_0xae42('0x1a')]=_0x3954bb[_0xae42('0x1a')];this[_0xae42('0x1b')]=_0x3954bb[_0xae42('0x1b')];this[_0xae42('0x1c')]=_0x3954bb[_0xae42('0x1c')];this[_0xae42('0x1d')]=_0x3954bb['UserId'];this[_0xae42('0x1e')]=_0x3954bb[_0xae42('0x1e')];this[_0xae42('0x1f')]=_0x3954bb[_0xae42('0x1f')];this[_0xae42('0x20')]=_0x3954bb[_0xae42('0x20')]||'';this['originatecalleridname']=_0x3954bb[_0xae42('0x21')]||'';this[_0xae42('0x22')]=_0x3954bb[_0xae42('0x22')];this['statedesc']=_0x3954bb['statedesc'];}module[_0xae42('0x23')]=History;
\ No newline at end of file
index b7ac059..10c2128 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8913=['calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x25337e,_0xb0ce0d){var _0x4a9540=function(_0x5d6d05){while(--_0x5d6d05){_0x25337e['push'](_0x25337e['shift']());}};_0x4a9540(++_0xb0ce0d);}(_0x8913,0x148));var _0x3891=function(_0x5aa027,_0x4fd555){_0x5aa027=_0x5aa027-0x0;var _0x583941=_0x8913[_0x5aa027];return _0x583941;};'use strict';var utils=require(_0x3891('0x0'));function QueueCallerAbandon(_0x50646c,_0x3d5ce4){this[_0x3891('0x1')]=_0x50646c['scheduledat'];this[_0x3891('0x2')]=_0x50646c[_0x3891('0x2')];this[_0x3891('0x3')]=_0x50646c[_0x3891('0x2')]===_0x3891('0x4')?'queue':_0x50646c[_0x3891('0x2')];this[_0x3891('0x5')]=_0x50646c[_0x3891('0x5')];this[_0x3891('0x6')]=_0x50646c[_0x3891('0x6')];this[_0x3891('0x7')]=_0x50646c[_0x3891('0x7')];this['countglobal']=_0x50646c[_0x3891('0x5')]+_0x50646c[_0x3891('0x6')]+_0x50646c['countnoanswerretry']+_0x50646c['countnosuchnumberretry']+_0x50646c['countdropretry']+_0x50646c[_0x3891('0x8')]+_0x50646c[_0x3891('0x9')]+_0x50646c['countagentrejectretry'];this[_0x3891('0xa')]=_0x50646c['countnosuchnumberretry'];this['countdropretry']=_0x50646c[_0x3891('0xb')];this[_0x3891('0x8')]=_0x50646c[_0x3891('0x8')];this[_0x3891('0x9')]=_0x50646c['countmachineretry'];this[_0x3891('0xc')]=_0x50646c[_0x3891('0xc')];this['uniqueid']=_0x3d5ce4[_0x3891('0xd')];this[_0x3891('0xe')]=_0x50646c[_0x3891('0xf')];this[_0x3891('0x10')]=_0x50646c['number'];this[_0x3891('0x11')]=_0x50646c['starttime'];this[_0x3891('0x12')]=_0x50646c[_0x3891('0x12')];this[_0x3891('0x13')]=_0x50646c[_0x3891('0x13')];this[_0x3891('0x14')]=_0x50646c[_0x3891('0x14')];this[_0x3891('0x15')]=this[_0x3891('0x13')];this[_0x3891('0x16')]=utils[_0x3891('0x17')](_0x50646c[_0x3891('0x12')],_0x50646c['starttime']);this['holdtime']=utils[_0x3891('0x17')](this['droptime'],_0x50646c['responsetime']);this[_0x3891('0x18')]=0x0;this[_0x3891('0x19')]=_0x3d5ce4[_0x3891('0x19')];this[_0x3891('0x1a')]=_0x3d5ce4[_0x3891('0x1b')];this[_0x3891('0x1c')]=_0x3d5ce4[_0x3891('0x1c')];this[_0x3891('0x1d')]=_0x50646c['callback'];this[_0x3891('0x1e')]=_0x50646c['callbackuniqueid'];this[_0x3891('0x1f')]=_0x50646c[_0x3891('0x1f')];this[_0x3891('0x20')]=_0x50646c['recallme'];this[_0x3891('0x21')]=_0x50646c[_0x3891('0x21')];this[_0x3891('0x22')]=_0x50646c[_0x3891('0x22')];this[_0x3891('0x23')]=_0x50646c[_0x3891('0x23')];this['VoiceQueueId']=_0x50646c[_0x3891('0x24')];this['CampaignId']=_0x50646c['CampaignId'];this['originatecalleridnum']=_0x50646c[_0x3891('0x25')]||'';this[_0x3891('0x26')]=_0x50646c[_0x3891('0x26')]||'';this[_0x3891('0x27')]=_0x50646c['agiafterat'];this[_0x3891('0x28')]=_0x50646c[_0x3891('0x28')];this[_0x3891('0x29')]=_0x50646c['statedesc'];}module[_0x3891('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x7057=['VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x5b4185,_0x2c16f0){var _0x1fa04f=function(_0x5d40b7){while(--_0x5d40b7){_0x5b4185['push'](_0x5b4185['shift']());}};_0x1fa04f(++_0x2c16f0);}(_0x7057,0x137));var _0x7705=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x7057[_0x17406a];return _0x1501ff;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x3d49f0,_0x3d67bd){this[_0x7705('0x0')]=_0x3d49f0[_0x7705('0x0')];this[_0x7705('0x1')]=_0x3d49f0[_0x7705('0x1')];this[_0x7705('0x2')]=_0x3d49f0[_0x7705('0x1')]===_0x7705('0x3')?_0x7705('0x4'):_0x3d49f0['type'];this[_0x7705('0x5')]=_0x3d49f0[_0x7705('0x5')];this['countcongestionretry']=_0x3d49f0['countcongestionretry'];this[_0x7705('0x6')]=_0x3d49f0[_0x7705('0x6')];this[_0x7705('0x7')]=_0x3d49f0[_0x7705('0x5')]+_0x3d49f0['countcongestionretry']+_0x3d49f0['countnoanswerretry']+_0x3d49f0['countnosuchnumberretry']+_0x3d49f0['countdropretry']+_0x3d49f0['countabandonedretry']+_0x3d49f0[_0x7705('0x8')]+_0x3d49f0[_0x7705('0x9')];this[_0x7705('0xa')]=_0x3d49f0[_0x7705('0xa')];this[_0x7705('0xb')]=_0x3d49f0[_0x7705('0xb')];this[_0x7705('0xc')]=_0x3d49f0['countabandonedretry'];this[_0x7705('0x8')]=_0x3d49f0[_0x7705('0x8')];this[_0x7705('0x9')]=_0x3d49f0['countagentrejectretry'];this['uniqueid']=_0x3d67bd[_0x7705('0xd')];this['calleridname']=_0x3d49f0[_0x7705('0xe')];this[_0x7705('0xf')]=_0x3d49f0[_0x7705('0x10')];this[_0x7705('0x11')]=_0x3d49f0['starttime'];this[_0x7705('0x12')]=_0x3d49f0['responsetime'];this[_0x7705('0x13')]=_0x3d49f0['droptime'];this['dropreason']=_0x3d49f0[_0x7705('0x14')];this[_0x7705('0x15')]=this[_0x7705('0x13')];this['ringtime']=utils[_0x7705('0x16')](_0x3d49f0[_0x7705('0x12')],_0x3d49f0[_0x7705('0x11')]);this['holdtime']=utils[_0x7705('0x16')](this[_0x7705('0x13')],_0x3d49f0['responsetime']);this['talktime']=0x0;this['queue']=_0x3d67bd[_0x7705('0x4')];this[_0x7705('0x17')]=_0x3d67bd['connectedlinename'];this['reason']=_0x3d67bd[_0x7705('0x18')];this[_0x7705('0x19')]=_0x3d49f0[_0x7705('0x19')];this[_0x7705('0x1a')]=_0x3d49f0['callbackuniqueid'];this[_0x7705('0x1b')]=_0x3d49f0['callbackat'];this[_0x7705('0x1c')]=_0x3d49f0['recallme'];this[_0x7705('0x1d')]=_0x3d49f0[_0x7705('0x1d')];this['ListId']=_0x3d49f0[_0x7705('0x1e')];this['UserId']=_0x3d49f0['UserId'];this[_0x7705('0x1f')]=_0x3d49f0[_0x7705('0x1f')];this[_0x7705('0x20')]=_0x3d49f0['CampaignId'];this['originatecalleridnum']=_0x3d49f0[_0x7705('0x21')]||'';this['originatecalleridname']=_0x3d49f0['originatecalleridname']||'';this[_0x7705('0x22')]=_0x3d49f0[_0x7705('0x22')];this[_0x7705('0x23')]=_0x3d49f0[_0x7705('0x23')];this[_0x7705('0x24')]=_0x3d49f0[_0x7705('0x24')];}module[_0x7705('0x25')]=QueueCallerAbandon;
\ No newline at end of file
index 0c94770..a74af4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3be498,_0x3b992b){var _0x1caa19=function(_0xf12ebe){while(--_0xf12ebe){_0x3be498['push'](_0x3be498['shift']());}};_0x1caa19(++_0x3b992b);}(_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
+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(_0x18238c,_0x322b07){var _0x5f44eb=function(_0x242249){while(--_0x242249){_0x18238c['push'](_0x18238c['shift']());}};_0x5f44eb(++_0x322b07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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
index c532846..ca798fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x067d=['pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','includes','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','type','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','diff','seconds','getSeconds','dialActive','available','loggedIn','loggedInDb','paused','talking'];(function(_0x205e68,_0x5a74f2){var _0x1cc76c=function(_0x42721c){while(--_0x42721c){_0x205e68['push'](_0x205e68['shift']());}};_0x1cc76c(++_0x5a74f2);}(_0x067d,0x116));var _0xd067=function(_0x54e3ab,_0x1c8fcc){_0x54e3ab=_0x54e3ab-0x0;var _0x5c2814=_0x067d[_0x54e3ab];return _0x5c2814;};'use strict';var _=require(_0xd067('0x0'));var moment=require(_0xd067('0x1'));var util=require('util');var logger=require(_0xd067('0x2'))(_0xd067('0x3'));var timezones=require(_0xd067('0x4'))[_0xd067('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xd067('0x6'),'BLACKLIST':_0xd067('0x7'),'CONTACTS_RESCHEDULED':_0xd067('0x8'),'DEACTIVATED':_0xd067('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xd067('0xa'),'NO_AGENTS_LOGGED':_0xd067('0xb'),'NO_AVAILABLE_CONTACTS':_0xd067('0xc'),'NULL_INTERVAL':_0xd067('0xd'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xd067('0xe'),'QUEUE_RECALL':_0xd067('0xf'),'RECALL_TIMEOUT':_0xd067('0x10'),'RUNNING':_0xd067('0x11'),'UNKNOWN_TIMEZONE':_0xd067('0x12'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xd067('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4eb954){return _0x4eb954[_0xd067('0x14')]===_0xd067('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x12e88b){return _0x12e88b[_0xd067('0x16')]==='ivr';}exports[_0xd067('0x17')]=isIVRCampaign;function isOutboundQueue(_0x1967a8){return _0x1967a8['type']===_0xd067('0x18');}exports[_0xd067('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x295238){return _0x295238['dialActive'];}exports[_0xd067('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x49c6cd){return _0x49c6cd[_0xd067('0x1b')];}exports[_0xd067('0x1c')]=isIVRCampaignActive;function getSeconds(_0x5ec9f5,_0x26a2cd){var _0x3972c4=moment(_0x5ec9f5)['milliseconds'](0x0);var _0x3b7dd1=moment(_0x26a2cd)['milliseconds'](0x0);return _0x3972c4[_0xd067('0x1d')](_0x3b7dd1,_0xd067('0x1e'));}exports[_0xd067('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x31ab05,_0x2df2d9){var _0xdfa679=![];var _0x3a6598=_0x31ab05['dialMethod']!==_0x2df2d9[_0xd067('0x14')]||_0x31ab05[_0xd067('0x20')]!==_0x2df2d9[_0xd067('0x20')]||_0x31ab05['message']!==_0x2df2d9['message'];var _0x332425=_0x31ab05['available']!==_0x2df2d9[_0xd067('0x21')]||_0x31ab05[_0xd067('0x22')]!==_0x2df2d9[_0xd067('0x22')]||_0x31ab05[_0xd067('0x23')]!==_0x2df2d9[_0xd067('0x23')]||_0x31ab05[_0xd067('0x24')]!==_0x2df2d9['paused']||_0x31ab05[_0xd067('0x25')]!==_0x2df2d9['talking']||_0x31ab05['pTalking']!==_0x2df2d9[_0xd067('0x26')]||_0x31ab05[_0xd067('0x27')]!==_0x2df2d9[_0xd067('0x27')]||_0x31ab05[_0xd067('0x28')]!==_0x2df2d9[_0xd067('0x28')]||_0x31ab05[_0xd067('0x29')]!==_0x2df2d9[_0xd067('0x29')];if(_0x31ab05[_0xd067('0x2a')]&&_0x2df2d9['Trunk']){_0xdfa679=_0x31ab05[_0xd067('0x2a')][_0xd067('0x2b')]!==_0x2df2d9[_0xd067('0x2a')][_0xd067('0x2b')]||_0x31ab05['Trunk'][_0xd067('0x1b')]!==_0x2df2d9['Trunk'][_0xd067('0x1b')];}return _0x3a6598||_0x332425||_0xdfa679;}exports[_0xd067('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2794c4){var _0x3ef65e=null;var _0x2cc7bb=_0x2794c4['dialTimezone'];if(_[_0xd067('0x2d')](_0x2794c4[_0xd067('0x2e')])||_[_0xd067('0x2d')](_0x2794c4[_0xd067('0x2f')])||_['isNil'](_0x2794c4[_0xd067('0x2f')][_0xd067('0x30')])){_0x3ef65e=CAMPAIGN_STATUS[_0xd067('0x31')];}else if(_[_0xd067('0x32')](_0x2794c4[_0xd067('0x2e')])||_[_0xd067('0x32')](_0x2794c4[_0xd067('0x2f')][_0xd067('0x30')])){_0x3ef65e=CAMPAIGN_STATUS[_0xd067('0x33')];}else if(_0x2cc7bb&&!timezones[_0x2cc7bb]){_0x3ef65e=CAMPAIGN_STATUS[_0xd067('0x34')];}return _0x3ef65e;}function checkAnyValidTrunk(_0x15bf17,_0x28cdc9){var _0x319a8a=null;var _0x18b11e=_0xd067('0x35');var _0xb1fec4=[_0xd067('0x36'),_0xd067('0x37')];var _0x35e0a3=!![];if(_0x15bf17[_0xd067('0x2a')]&&_0x15bf17[_0xd067('0x2a')]['active']){_0x18b11e+=_0x15bf17['Trunk'][_0xd067('0x2b')];_0x319a8a=_0x28cdc9[_0x18b11e];_0x35e0a3=_0xb1fec4['includes'](_0x319a8a['status']);}else if(_0x15bf17[_0xd067('0x38')]&&_0x15bf17['TrunkBackup']['active']){_0x18b11e+=_0x15bf17[_0xd067('0x38')][_0xd067('0x2b')];_0x319a8a=_0x28cdc9[_0x18b11e];_0x35e0a3=_0xb1fec4[_0xd067('0x39')](_0x319a8a['status']);}return _0x35e0a3;}function getQueueCampaignStatusMessage(_0x19cf61,_0x183316){var _0x4339c4=CAMPAIGN_STATUS[_0xd067('0x6')];var _0x164b9f=isPreviewCampaign(_0x19cf61);if(!isQueueCampaignActive(_0x19cf61)){if(_0x164b9f){_0x4339c4=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x19cf61[_0xd067('0x29')]===0x0&&_0x19cf61[_0xd067('0x25')]===0x0&&_0x19cf61['waiting']===0x0&&(_0x19cf61[_0xd067('0x26')]||0x0)===0x0){_0x4339c4=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4339c4=CAMPAIGN_STATUS[_0xd067('0x3a')];}}}else if(_0x19cf61['loggedIn']===0x0){_0x4339c4=CAMPAIGN_STATUS[_0xd067('0x3b')];}else if(!checkAnyValidTrunk(_0x19cf61,_0x183316)){_0x4339c4=CAMPAIGN_STATUS[_0xd067('0x3c')];}else if(!isPreviewCampaign(_0x19cf61)){var _0x2cfe7b=checkAnyValidQueueCampaignInterval(_0x19cf61);if(_0x2cfe7b){_0x4339c4=_0x2cfe7b;}}return _0x4339c4;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x1f7192){var _0x239e16=CAMPAIGN_STATUS[_0xd067('0x3a')];if(_0x1f7192[_0xd067('0x29')]===0x0&&_0x1f7192['talking']===0x0&&_0x1f7192[_0xd067('0x27')]===0x0&&(_0x1f7192[_0xd067('0x26')]||0x0)===0x0){_0x239e16=CAMPAIGN_STATUS['INACTIVE'];}return _0x239e16;}exports[_0xd067('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x18f46b){var _0x3a62ff=_0x18f46b[_0xd067('0x3e')](/"(.*?)"/);return _0x3a62ff?_0x3a62ff[0x1]:_0x18f46b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x232a57,_0x5c2ebe,_0x3f7c17){if(!_[_0xd067('0x3f')](_0x3f7c17)&&typeof _0x3f7c17===_0xd067('0x40')&&!_[_0xd067('0x32')](_0x3f7c17)){if(!_[_0xd067('0x3f')](_0x5c2ebe)&&typeof _0x5c2ebe===_0xd067('0x40')&&!_[_0xd067('0x32')](_0x5c2ebe)){return util[_0xd067('0x41')](_0xd067('0x42'),_0x5c2ebe,_0x3f7c17);}return util['format'](_0xd067('0x42'),_0x3f7c17,_0x3f7c17);}if(!_['isUndefined'](_0x232a57)&&typeof _0x232a57==='string'&&!_['isEmpty'](_0x232a57)){return _0x232a57;}return'\x22\x22\x20<>';}exports[_0xd067('0x43')]=getCallerId;function getCallerIdRandom(_0x1bb960,_0x465739){var _0x439c83;var _0x2d8bf2;var _0x2484a4;if(_0x465739<=0x0){_0x465739=0x1;}_0x439c83=new RegExp(_0xd067('0x44')+_0x465739+'}$');_0x2d8bf2=Math[_0xd067('0x45')](0xa,_0x465739-0x1);_0x2484a4=Math['pow'](0xa,_0x465739)-0x1;return util[_0xd067('0x41')]('%s',_['replace'](_0x1bb960,_0x439c83,_[_0xd067('0x46')](_0x2d8bf2,_0x2484a4)[_0xd067('0x47')]()));}exports[_0xd067('0x48')]=getCallerIdRandom;function decrementOriginate(_0x2e9a14){if(_0x2e9a14[_0xd067('0x29')]&&_0x2e9a14[_0xd067('0x29')]>0x0){_0x2e9a14[_0xd067('0x29')]-=0x1;}else{logger[_0xd067('0x49')](_0xd067('0x4a'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x458b7f){return _0x458b7f&&_0x458b7f[_0xd067('0x4b')]>0x0;}exports[_0xd067('0x4c')]=checkContactEmpty;function erlangb(_0x22e6cd,_0x4ccb2a){if(_0x4ccb2a===0x0){return 0x0;}var _0x1178d6=0x1;for(var _0x1dd688=0x1;_0x1dd688<=_0x4ccb2a;_0x1dd688+=0x1){_0x1178d6=0x1+_0x1178d6*_0x1dd688/_0x22e6cd;}return 0x1/_0x1178d6;}exports[_0xd067('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x44ff22,_0x58440f,_0x350ec9){if(_0x58440f>_0x350ec9){for(var _0x19c285=0x0;_0x19c285<_0x58440f-_0x350ec9;_0x19c285+=0x1){decrementOriginate(_0x44ff22);}}}exports[_0xd067('0x4e')]=checkContactLowerLimitOriginate;
\ No newline at end of file
+var _0x4109=['dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','DISACTIVED','originated','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','\x22%s\x22\x20<%s>','format','isUndefined','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','moment','util','../../../../config/logger','../../../../config/environment/shared','ACTIVE','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','dialMethod','preview','type','ivr','outbound','isOutboundQueue','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialActive','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','Trunk','name','active','hasQueueCampaignDataChanged','isNil'];(function(_0x29e314,_0x19d592){var _0x4c9fcb=function(_0xcb1c9){while(--_0xcb1c9){_0x29e314['push'](_0x29e314['shift']());}};_0x4c9fcb(++_0x19d592);}(_0x4109,0x102));var _0x9410=function(_0x25b35c,_0x39098d){_0x25b35c=_0x25b35c-0x0;var _0xb01066=_0x4109[_0x25b35c];return _0xb01066;};'use strict';var _=require('lodash');var moment=require(_0x9410('0x0'));var util=require(_0x9410('0x1'));var logger=require(_0x9410('0x2'))('dialer');var timezones=require(_0x9410('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x9410('0x4'),'BLACKLIST':_0x9410('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x9410('0x6'),'EMPTY_INTERVAL':_0x9410('0x7'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x9410('0x8'),'NO_AVAILABLE_CONTACTS':_0x9410('0x9'),'NULL_INTERVAL':_0x9410('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x9410('0xb'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x9410('0xc'),'RUNNING':_0x9410('0xd'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x776fd9){return _0x776fd9[_0x9410('0xe')]===_0x9410('0xf');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x1b84da){return _0x1b84da[_0x9410('0x10')]===_0x9410('0x11');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x14b4b2){return _0x14b4b2['type']===_0x9410('0x12');}exports[_0x9410('0x13')]=isOutboundQueue;function isQueueCampaignActive(_0x4f2e9e){return _0x4f2e9e['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x286b44){return _0x286b44['active'];}exports[_0x9410('0x14')]=isIVRCampaignActive;function getSeconds(_0x453fb1,_0x27a05e){var _0x5dad5d=moment(_0x453fb1)[_0x9410('0x15')](0x0);var _0x554fe0=moment(_0x27a05e)[_0x9410('0x15')](0x0);return _0x5dad5d['diff'](_0x554fe0,_0x9410('0x16'));}exports[_0x9410('0x17')]=getSeconds;function hasQueueCampaignDataChanged(_0x2e8fe1,_0x15e3f1){var _0x108d61=![];var _0x41a598=_0x2e8fe1[_0x9410('0xe')]!==_0x15e3f1[_0x9410('0xe')]||_0x2e8fe1[_0x9410('0x18')]!==_0x15e3f1[_0x9410('0x18')]||_0x2e8fe1['message']!==_0x15e3f1['message'];var _0x8ea896=_0x2e8fe1[_0x9410('0x19')]!==_0x15e3f1[_0x9410('0x19')]||_0x2e8fe1[_0x9410('0x1a')]!==_0x15e3f1[_0x9410('0x1a')]||_0x2e8fe1[_0x9410('0x1b')]!==_0x15e3f1[_0x9410('0x1b')]||_0x2e8fe1[_0x9410('0x1c')]!==_0x15e3f1[_0x9410('0x1c')]||_0x2e8fe1[_0x9410('0x1d')]!==_0x15e3f1[_0x9410('0x1d')]||_0x2e8fe1[_0x9410('0x1e')]!==_0x15e3f1[_0x9410('0x1e')]||_0x2e8fe1[_0x9410('0x1f')]!==_0x15e3f1[_0x9410('0x1f')]||_0x2e8fe1[_0x9410('0x20')]!==_0x15e3f1['inUse']||_0x2e8fe1['originated']!==_0x15e3f1['originated'];if(_0x2e8fe1[_0x9410('0x21')]&&_0x15e3f1['Trunk']){_0x108d61=_0x2e8fe1['Trunk'][_0x9410('0x22')]!==_0x15e3f1[_0x9410('0x21')][_0x9410('0x22')]||_0x2e8fe1['Trunk']['active']!==_0x15e3f1[_0x9410('0x21')][_0x9410('0x23')];}return _0x41a598||_0x8ea896||_0x108d61;}exports[_0x9410('0x24')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5237c9){var _0x5a4205=null;var _0x3e3d6f=_0x5237c9['dialTimezone'];if(_[_0x9410('0x25')](_0x5237c9[_0x9410('0x26')])||_[_0x9410('0x25')](_0x5237c9[_0x9410('0x27')])||_[_0x9410('0x25')](_0x5237c9['Interval'][_0x9410('0x28')])){_0x5a4205=CAMPAIGN_STATUS[_0x9410('0x29')];}else if(_[_0x9410('0x2a')](_0x5237c9['dialGlobalInterval'])||_[_0x9410('0x2a')](_0x5237c9['Interval'][_0x9410('0x28')])){_0x5a4205=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x3e3d6f&&!timezones[_0x3e3d6f]){_0x5a4205=CAMPAIGN_STATUS[_0x9410('0x2b')];}return _0x5a4205;}function checkAnyValidTrunk(_0x45cb18,_0x5e3f16){var _0x31ba19=null;var _0x4103eb=_0x9410('0x2c');var _0x1e1ff4=[_0x9410('0x2d'),_0x9410('0x2e')];var _0x1b5b79=!![];if(_0x45cb18[_0x9410('0x21')]&&_0x45cb18['Trunk'][_0x9410('0x23')]){_0x4103eb+=_0x45cb18[_0x9410('0x21')][_0x9410('0x22')];_0x31ba19=_0x5e3f16[_0x4103eb];_0x1b5b79=_0x1e1ff4[_0x9410('0x2f')](_0x31ba19[_0x9410('0x30')]);}else if(_0x45cb18[_0x9410('0x31')]&&_0x45cb18[_0x9410('0x31')][_0x9410('0x23')]){_0x4103eb+=_0x45cb18[_0x9410('0x31')][_0x9410('0x22')];_0x31ba19=_0x5e3f16[_0x4103eb];_0x1b5b79=_0x1e1ff4[_0x9410('0x2f')](_0x31ba19['status']);}return _0x1b5b79;}function getQueueCampaignStatusMessage(_0x22bf7b,_0x552243){var _0x1a8792=CAMPAIGN_STATUS[_0x9410('0x4')];var _0x138309=isPreviewCampaign(_0x22bf7b);if(!isQueueCampaignActive(_0x22bf7b)){if(_0x138309){_0x1a8792=CAMPAIGN_STATUS[_0x9410('0x32')];}else{if(_0x22bf7b['originated']===0x0&&_0x22bf7b[_0x9410('0x1d')]===0x0&&_0x22bf7b[_0x9410('0x1f')]===0x0&&(_0x22bf7b[_0x9410('0x1e')]||0x0)===0x0){_0x1a8792=CAMPAIGN_STATUS[_0x9410('0x32')];}else{_0x1a8792=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x22bf7b[_0x9410('0x1a')]===0x0){_0x1a8792=CAMPAIGN_STATUS[_0x9410('0x33')];}else if(!checkAnyValidTrunk(_0x22bf7b,_0x552243)){_0x1a8792=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x22bf7b)){var _0x7d8d71=checkAnyValidQueueCampaignInterval(_0x22bf7b);if(_0x7d8d71){_0x1a8792=_0x7d8d71;}}return _0x1a8792;}exports[_0x9410('0x34')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x21eaf7){var _0x176c3b=CAMPAIGN_STATUS[_0x9410('0x35')];if(_0x21eaf7[_0x9410('0x36')]===0x0&&_0x21eaf7['talking']===0x0&&_0x21eaf7[_0x9410('0x1f')]===0x0&&(_0x21eaf7[_0x9410('0x1e')]||0x0)===0x0){_0x176c3b=CAMPAIGN_STATUS[_0x9410('0x32')];}return _0x176c3b;}exports[_0x9410('0x37')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3e32ec){var _0xab3f7b=_0x3e32ec[_0x9410('0x38')](/"(.*?)"/);return _0xab3f7b?_0xab3f7b[0x1]:_0x3e32ec;}exports[_0x9410('0x39')]=extractCalleridName;function getCallerId(_0x3c27a4,_0x18d233,_0x345017){if(!_['isUndefined'](_0x345017)&&typeof _0x345017===_0x9410('0x3a')&&!_['isEmpty'](_0x345017)){if(!_['isUndefined'](_0x18d233)&&typeof _0x18d233===_0x9410('0x3a')&&!_[_0x9410('0x2a')](_0x18d233)){return util['format'](_0x9410('0x3b'),_0x18d233,_0x345017);}return util[_0x9410('0x3c')](_0x9410('0x3b'),_0x345017,_0x345017);}if(!_[_0x9410('0x3d')](_0x3c27a4)&&typeof _0x3c27a4===_0x9410('0x3a')&&!_['isEmpty'](_0x3c27a4)){return _0x3c27a4;}return _0x9410('0x3e');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x13b11f,_0x58ebf1){var _0xb66d73;var _0x361401;var _0x459aee;if(_0x58ebf1<=0x0){_0x58ebf1=0x1;}_0xb66d73=new RegExp(_0x9410('0x3f')+_0x58ebf1+'}$');_0x361401=Math[_0x9410('0x40')](0xa,_0x58ebf1-0x1);_0x459aee=Math[_0x9410('0x40')](0xa,_0x58ebf1)-0x1;return util['format']('%s',_[_0x9410('0x41')](_0x13b11f,_0xb66d73,_[_0x9410('0x42')](_0x361401,_0x459aee)[_0x9410('0x43')]()));}exports[_0x9410('0x44')]=getCallerIdRandom;function decrementOriginate(_0x8222a7){if(_0x8222a7[_0x9410('0x36')]&&_0x8222a7['originated']>0x0){_0x8222a7[_0x9410('0x36')]-=0x1;}else{logger[_0x9410('0x45')](_0x9410('0x46'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x5938c6){return _0x5938c6&&_0x5938c6['length']>0x0;}exports[_0x9410('0x47')]=checkContactEmpty;function erlangb(_0x30683c,_0x1c7037){if(_0x1c7037===0x0){return 0x0;}var _0x2251ac=0x1;for(var _0x12f6b1=0x1;_0x12f6b1<=_0x1c7037;_0x12f6b1+=0x1){_0x2251ac=0x1+_0x2251ac*_0x12f6b1/_0x30683c;}return 0x1/_0x2251ac;}exports[_0x9410('0x48')]=erlangb;function checkContactLowerLimitOriginate(_0x537d3c,_0x5bd4c4,_0x366b03){if(_0x5bd4c4>_0x366b03){for(var _0x395244=0x0;_0x395244<_0x5bd4c4-_0x366b03;_0x395244+=0x1){decrementOriginate(_0x537d3c);}}}exports[_0x9410('0x49')]=checkContactLowerLimitOriginate;
\ No newline at end of file
index 393e018..569782a 100644 (file)
@@ -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(_0xfb473f,_0x1ca685){var _0x330953=function(_0x106e6c){while(--_0x106e6c){_0xfb473f['push'](_0xfb473f['shift']());}};_0x330953(++_0x1ca685);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x3dd381,_0xe531ff){var _0x24bb27=function(_0x4d5524){while(--_0x4d5524){_0x3dd381['push'](_0x3dd381['shift']());}};_0x24bb27(++_0xe531ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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
index 6068cbb..6f0ed6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b6e=['exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','application/pdf','notify','error','\x20notify\x20','stringify','catch','syncOriginateResponse','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','format','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','util','lodash','bluebird','uuid','path','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','context','from-voip-provider','hasOwnProperty'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7b6e,0xc9));var _0xe7b6=function(_0x422890,_0x434494){_0x422890=_0x422890-0x0;var _0x202cf0=_0x7b6e[_0x422890];return _0x202cf0;};'use strict';var util=require(_0xe7b6('0x0'));var _=require(_0xe7b6('0x1'));var BPromise=require(_0xe7b6('0x2'));var uuid=require(_0xe7b6('0x3'));var moment=require('moment');var path=require(_0xe7b6('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xe7b6('0x5'));var logger=require('../../../config/logger')(_0xe7b6('0x6'));var ami=require(_0xe7b6('0x7'));var rpcDb=require(_0xe7b6('0x8'));var Channel=require(_0xe7b6('0x9'));var ut=require(_0xe7b6('0xa'));var Action=require(_0xe7b6('0xb'));var faxAccount=require(_0xe7b6('0xc'));var attachment=require(_0xe7b6('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x21e999){this['channels']={};this[_0xe7b6('0xe')]=_0x21e999[_0xe7b6('0xe')];this[_0xe7b6('0xf')]=_0x21e999[_0xe7b6('0xf')];this[_0xe7b6('0x10')]={};ami['on'](_0xe7b6('0x11'),this[_0xe7b6('0x12')][_0xe7b6('0x13')](this));ami['on'](_0xe7b6('0x14'),this[_0xe7b6('0x15')]['bind'](this));ami['on'](_0xe7b6('0x16'),this[_0xe7b6('0x17')][_0xe7b6('0x13')](this));ami['on'](_0xe7b6('0x18'),this[_0xe7b6('0x19')][_0xe7b6('0x13')](this));ami['on'](_0xe7b6('0x1a'),this[_0xe7b6('0x1b')]['bind'](this));ami['on'](_0xe7b6('0x1c'),this[_0xe7b6('0x1d')]['bind'](this));ami['on'](_0xe7b6('0x1e'),this[_0xe7b6('0x1f')][_0xe7b6('0x13')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xe7b6('0x13')](this));}Fax['prototype'][_0xe7b6('0x12')]=function(_0x3b405e){if(_0x3b405e[_0xe7b6('0x20')]===_0xe7b6('0x21')){for(var _0x5d93c6 in this[_0xe7b6('0xe')]){if(this[_0xe7b6('0xe')][_0xe7b6('0x22')](_0x5d93c6)){if(_0x3b405e[_0xe7b6('0x23')]===this['faxAccounts'][_0x5d93c6][_0xe7b6('0x24')]){this[_0xe7b6('0x25')][_0x3b405e[_0xe7b6('0x26')]]={};this[_0xe7b6('0x25')][_0x3b405e[_0xe7b6('0x26')]][_0xe7b6('0x27')]=_0x3b405e[_0xe7b6('0x27')];this['channels'][_0x3b405e[_0xe7b6('0x26')]]['id']=this[_0xe7b6('0xe')][_0x5d93c6]['id'];this[_0xe7b6('0x25')][_0x3b405e[_0xe7b6('0x26')]][_0xe7b6('0x28')]=this[_0xe7b6('0xe')][_0x5d93c6]['name'];logger[_0xe7b6('0x29')](_0x3b405e[_0xe7b6('0x26')],_0xe7b6('0x2a'));}}}}if(this['actions'][_0x3b405e[_0xe7b6('0x26')]]){this[_0xe7b6('0x25')][_0x3b405e[_0xe7b6('0x26')]]={};this[_0xe7b6('0x25')][_0x3b405e[_0xe7b6('0x26')]][_0xe7b6('0x27')]=_0x3b405e[_0xe7b6('0x27')];logger[_0xe7b6('0x29')](_0x3b405e[_0xe7b6('0x26')],_0xe7b6('0x2a'));}};Fax[_0xe7b6('0x2b')]['syncVarSet']=function(_0x2d0ed7){if(this['channels'][_0x2d0ed7[_0xe7b6('0x26')]]){for(var _0x22c34d in _0x2d0ed7[_0xe7b6('0x2c')]){if(_0x2d0ed7['variable'][_0xe7b6('0x22')](_0x22c34d)){this['channels'][_0x2d0ed7[_0xe7b6('0x26')]][_0x22c34d]=_0x2d0ed7['value'];}}}};Fax[_0xe7b6('0x2b')][_0xe7b6('0x17')]=function(_0x2518a0){if(this[_0xe7b6('0x25')][_0x2518a0[_0xe7b6('0x26')]]){this[_0xe7b6('0x25')][_0x2518a0[_0xe7b6('0x26')]][_0xe7b6('0x2d')]=_0x2518a0[_0xe7b6('0x2d')];this[_0xe7b6('0x25')][_0x2518a0[_0xe7b6('0x26')]][_0xe7b6('0x2e')]=_0x2518a0[_0xe7b6('0x2e')];}};Fax['prototype'][_0xe7b6('0x19')]=function(_0x599223){if(this[_0xe7b6('0x25')][_0x599223[_0xe7b6('0x26')]]){for(var _0x15cae1 in _0x599223[_0xe7b6('0x2c')]){if(_0x599223[_0xe7b6('0x2c')]['hasOwnProperty'](_0x15cae1)){this[_0xe7b6('0x25')][_0x599223[_0xe7b6('0x26')]][_0x15cae1]=_0x599223[_0xe7b6('0x2f')];}}}};Fax['prototype'][_0xe7b6('0x1b')]=function(_0x391bcf){if(this['channels'][_0x391bcf[_0xe7b6('0x26')]]){this[_0xe7b6('0x25')][_0x391bcf[_0xe7b6('0x26')]][_0xe7b6('0x30')]=_0x391bcf[_0xe7b6('0x30')];this['channels'][_0x391bcf[_0xe7b6('0x26')]][_0xe7b6('0x31')]=_0x391bcf[_0xe7b6('0x31')];this['channels'][_0x391bcf[_0xe7b6('0x26')]][_0xe7b6('0x24')]=_0x391bcf['localstationid'];this[_0xe7b6('0x25')][_0x391bcf[_0xe7b6('0x26')]][_0xe7b6('0x32')]=_0x391bcf[_0xe7b6('0x32')];logger['info'](_0x391bcf[_0xe7b6('0x26')],_0xe7b6('0x33'));}};Fax[_0xe7b6('0x2b')][_0xe7b6('0x1d')]=function(_0x358648){var _0x5cb94f=this;if(this[_0xe7b6('0x25')][_0x358648[_0xe7b6('0x26')]]){var _0x31bac8=this[_0xe7b6('0x25')][_0x358648[_0xe7b6('0x26')]]['id'];this['channels'][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x34')]=_0x358648[_0xe7b6('0x34')];this['channels'][_0x358648[_0xe7b6('0x26')]]['pagestransferred']=_0x358648[_0xe7b6('0x35')];this[_0xe7b6('0x25')][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x24')]=_0x358648[_0xe7b6('0x24')];this['channels'][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x36')]=_0x358648[_0xe7b6('0x36')];this['channels'][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x37')]=_0x358648[_0xe7b6('0x37')];this['channels'][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x32')]=_0x358648[_0xe7b6('0x32')];this[_0xe7b6('0x25')][_0x358648['uniqueid']][_0xe7b6('0x38')]=_0x358648[_0xe7b6('0x38')];if(this['channels'][_0x358648[_0xe7b6('0x26')]][_0xe7b6('0x35')]>0x0){tiff2pdf(_0x358648[_0xe7b6('0x32')],_0xe7b6('0x39'),function(_0x2cb5ae){logger[_0xe7b6('0x29')](_0x358648[_0xe7b6('0x26')],'\x20result\x20conversion\x20file\x20',_0x2cb5ae[_0xe7b6('0x3a')]);attachment['create']({'name':path['parse'](_0x358648[_0xe7b6('0x32')])['name'],'basename':path[_0xe7b6('0x3b')](_0x358648[_0xe7b6('0x32')])[_0xe7b6('0x28')]+_0xe7b6('0x3c'),'type':_0xe7b6('0x3d')})['then'](function(_0x336224){faxAccount[_0xe7b6('0x3e')](_0x31bac8,{'from':_0x358648['calleridnum'],'mapKey':_0xe7b6('0x6'),'body':path['parse'](_0x358648['filename'])['name']+_0xe7b6('0x3c'),'AttachmentId':_0x336224['id']})['catch'](function(_0x59b30c){logger[_0xe7b6('0x3f')](_0x358648[_0xe7b6('0x26')],_0xe7b6('0x40'),JSON[_0xe7b6('0x41')](_0x59b30c));});})[_0xe7b6('0x42')](function(_0x25ddbf){logger[_0xe7b6('0x3f')](_0x358648[_0xe7b6('0x26')],'\x20receiveFax\x20',JSON[_0xe7b6('0x41')](_0x25ddbf));});});}logger['info'](_0x358648[_0xe7b6('0x26')],'\x20receiveFax\x20');}};Fax[_0xe7b6('0x2b')][_0xe7b6('0x43')]=function(_0x12dbb7){if(this[_0xe7b6('0x10')][_0x12dbb7[_0xe7b6('0x26')]]){_['merge'](this[_0xe7b6('0x25')][_0x12dbb7[_0xe7b6('0x26')]],_['pick'](_0x12dbb7,[_0xe7b6('0x44'),_0xe7b6('0x45')]));}};function updateStatus(_0x4f45aa){if(_0x4f45aa[_0xe7b6('0x46')]){faxMessage[_0xe7b6('0x47')](_0x4f45aa[_0xe7b6('0x46')],{'failMessage':_0xe7b6('0x48')})[_0xe7b6('0x49')](function(_0xba226c){ut[_0xe7b6('0x4a')](_0xe7b6('0x4b'),_0xba226c);})[_0xe7b6('0x42')](function(_0x56a91a){ut[_0xe7b6('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0x56a91a);});}else{ut[_0xe7b6('0x4a')](_0xe7b6('0x4c'));}}Fax[_0xe7b6('0x2b')][_0xe7b6('0x4d')]=function(_0x4c3db9,_0x1c90b5,_0x33e229){var _0x2f8454=this;var _0x472a34={};if(_0x1c90b5){_0x472a34={'read':_0x1c90b5};}else{_0x472a34={'failMessage':_0x33e229};}if(this['actions'][_0x4c3db9]['AttachmentId']){faxMessage[_0xe7b6('0x47')](this[_0xe7b6('0x10')][_0x4c3db9][_0xe7b6('0x46')],_0x472a34)[_0xe7b6('0x49')](function(_0x46c962){ut[_0xe7b6('0x4a')](_0xe7b6('0x4e'),_0x46c962);})[_0xe7b6('0x42')](function(_0x2b49d3){ut[_0xe7b6('0x4a')]('[Fax][Message][NoUpdate1]',_0x2b49d3);})[_0xe7b6('0x4f')](function(){delete _0x2f8454['channels'][_0x4c3db9];delete _0x2f8454[_0xe7b6('0x10')][_0x4c3db9];});}else{ut[_0xe7b6('0x4a')](_0xe7b6('0x50'));delete this[_0xe7b6('0x25')][_0x4c3db9];delete this[_0xe7b6('0x10')][_0x4c3db9];}};Fax[_0xe7b6('0x2b')]['syncHangup']=function(_0x2e7968){var _0x35f018=this;if(this[_0xe7b6('0x25')][_0x2e7968[_0xe7b6('0x26')]]){if(this[_0xe7b6('0x10')][_0x2e7968['uniqueid']]){this[_0xe7b6('0x25')][_0x2e7968[_0xe7b6('0x26')]]['id']=this[_0xe7b6('0x10')][_0x2e7968[_0xe7b6('0x26')]]['id'];this[_0xe7b6('0x25')][_0x2e7968[_0xe7b6('0x26')]][_0xe7b6('0x28')]=this['actions'][_0x2e7968['uniqueid']][_0xe7b6('0x28')];}logger['info'](_0x2e7968[_0xe7b6('0x26')],this[_0xe7b6('0x10')][_0x2e7968[_0xe7b6('0x26')]]?_0xe7b6('0x51'):'\x20hangup\x20faxRiceive\x20',JSON[_0xe7b6('0x41')](this[_0xe7b6('0x25')][_0x2e7968['uniqueid']]));if(this[_0xe7b6('0x10')][_0x2e7968['uniqueid']]){if(this[_0xe7b6('0x25')][_0x2e7968['uniqueid']][_0xe7b6('0x52')]>0x0&&this[_0xe7b6('0x25')][_0x2e7968[_0xe7b6('0x26')]]['faxstatus']===_0xe7b6('0x53')){this['updateStatus'](_0x2e7968['uniqueid'],!![]);}else{this[_0xe7b6('0x4d')](_0x2e7968[_0xe7b6('0x26')],![],this[_0xe7b6('0x25')][_0x2e7968[_0xe7b6('0x26')]][_0xe7b6('0x54')]?_0xe7b6('0x55')+this['channels'][_0x2e7968[_0xe7b6('0x26')]][_0xe7b6('0x54')]:_0xe7b6('0x56'));}}}};Fax['prototype']['send']=function(_0x4e0780){var _0xc1747=this;return new BPromise(function(_0x1c4d84,_0x5e2933){_0xc1747[_0xe7b6('0x57')](_0x4e0780,_0xc1747[_0xe7b6('0xe')][_0x4e0780[_0xe7b6('0x58')]])['then'](function(_0x12322c){ut[_0xe7b6('0x4a')](_0xe7b6('0x59'),_0x12322c);_0x1c4d84(ut[_0xe7b6('0x3a')](_0xe7b6('0x5a')));})[_0xe7b6('0x42')](function(_0x51f9ac){ut['logger'](_0xe7b6('0x5b'),_0x51f9ac);updateStatus(_0x4e0780);_0x5e2933(ut[_0xe7b6('0x3a')](_0xe7b6('0x5c')));});});};Fax[_0xe7b6('0x2b')][_0xe7b6('0x5d')]=function(_0xba7566){var _0x42af19=this;return new BPromise(function(_0x2e28f7,_0x51666e){var _0x43dde2=_0x42af19[_0xe7b6('0x5e')](_0x42af19[_0xe7b6('0xe')][_0xba7566['FaxAccountId']][_0xe7b6('0x5f')],_0xba7566);if(_0x43dde2[_0xe7b6('0x60')]){_0x2e28f7(ut['message']('Trunk\x20Reachable'));}else{_0x51666e(ut['message'](_0x43dde2[_0xe7b6('0x3a')]));}});};function originate(_0x16c048,_0x529e03,_0x25f82c){return new BPromise(function(_0x379ce3,_0x545c05){if(_0x25f82c){var _0x217607=util['format'](_0xe7b6('0x61'),path[_0xe7b6('0x3b')](_0x16c048[_0xe7b6('0x4')])['name'],_0x16c048[_0xe7b6('0x4')]);gs[_0xe7b6('0x62')](_0x217607)[_0xe7b6('0x49')](function(){_0x16c048[_0xe7b6('0x4')]=util['format']('%s/%s.tif',path[_0xe7b6('0x3b')](_0x16c048[_0xe7b6('0x4')])[_0xe7b6('0x63')],path[_0xe7b6('0x3b')](_0x16c048[_0xe7b6('0x4')])[_0xe7b6('0x28')]);_0x529e03[_0xe7b6('0x64')]=_0x16c048[_0xe7b6('0x4')];ut[_0xe7b6('0x4a')](_0xe7b6('0x65'),'');ami[_0xe7b6('0x66')](ut[_0xe7b6('0x67')](_0x16c048,_0x529e03))[_0xe7b6('0x49')](function(_0x406a8c){_0x379ce3(_0x406a8c);})[_0xe7b6('0x42')](function(_0x201fb){_0x545c05(_0x201fb);});})['catch'](function(_0x384cbd){_0x545c05(_0x384cbd);});}else{ami[_0xe7b6('0x66')](ut['variablesAction'](_0x16c048,_0x529e03))[_0xe7b6('0x49')](function(_0x44ae61){_0x379ce3(_0x44ae61);})[_0xe7b6('0x42')](function(_0xec13c){_0x545c05(_0xec13c);});}});}Fax['prototype'][_0xe7b6('0x57')]=function(_0x3f468e,_0x5224a5){var _0x1720f5=this;return new BPromise(function(_0x5e9465,_0x3b04af){var _0x33e09d=uuid['v4']();var _0xc78b95=ut[_0xe7b6('0x68')](_0x3f468e,_0x5224a5);_0x1720f5[_0xe7b6('0x10')][_0x33e09d]=new Action(_0x33e09d,_0x5224a5,_0x3f468e);var _0x3b66a1=_0x1720f5[_0xe7b6('0x10')][_0x33e09d];if(path[_0xe7b6('0x3b')](_0x3f468e['path'])[_0xe7b6('0x69')]===_0xe7b6('0x3c')){originate(_0x3b66a1,_0xc78b95,!![])[_0xe7b6('0x49')](function(_0x106bc5){_0x5e9465(_0x106bc5);})[_0xe7b6('0x42')](function(_0x1c66da){_0x3b04af(_0x1c66da);});}else{originate(_0x3b66a1,_0xc78b95,![])[_0xe7b6('0x49')](function(_0x4fc589){_0x5e9465(_0x4fc589);})['catch'](function(_0x5ad07e){_0x3b04af(_0x5ad07e);});}});};Fax['prototype']['isTrunkReachable']=function(_0x18064e){return!_[_0xe7b6('0x6a')](_0x18064e)&&!_[_0xe7b6('0x6a')](_0x18064e['name'])&&!_[_0xe7b6('0x6a')](_0x18064e[_0xe7b6('0x6b')])&&_0x18064e[_0xe7b6('0x6b')]&&!_[_0xe7b6('0x6a')](this['trunks'][util[_0xe7b6('0x6c')]('SIP/%s',_0x18064e[_0xe7b6('0x28')])])&&!_[_0xe7b6('0x6a')](this[_0xe7b6('0xf')][util['format'](_0xe7b6('0x6d'),_0x18064e[_0xe7b6('0x28')])][_0xe7b6('0x31')])&&(this[_0xe7b6('0xf')][util[_0xe7b6('0x6c')](_0xe7b6('0x6d'),_0x18064e[_0xe7b6('0x28')])][_0xe7b6('0x31')]===_0xe7b6('0x6e')||this['trunks'][util[_0xe7b6('0x6c')]('SIP/%s',_0x18064e[_0xe7b6('0x28')])][_0xe7b6('0x31')]===_0xe7b6('0x6f'));};Fax['prototype'][_0xe7b6('0x5e')]=function(_0x3e19b9,_0x283de3){if(!this[_0xe7b6('0x70')](_0x3e19b9)){ut[_0xe7b6('0x4a')](_0xe7b6('0x71'),_[_0xe7b6('0x6a')](_0x3e19b9)?'':_0x3e19b9[_0xe7b6('0x28')]+_0xe7b6('0x72'));return{'isValid':![],'message':_0xe7b6('0x73')};}if(_[_0xe7b6('0x6a')](_0x283de3['fax'])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xe7b6('0x41')](_0x283de3));return{'isValid':![],'message':_0xe7b6('0x74')};}if(_[_0xe7b6('0x6a')](_0x283de3[_0xe7b6('0x4')])){ut[_0xe7b6('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xe7b6('0x41')](_0x283de3));return{'isValid':![],'message':_0xe7b6('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
+var _0xc2ee=['reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','fax','.pdf','catch','error','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s'];(function(_0x87132c,_0xbad9c9){var _0x1f15dc=function(_0x1fb9d6){while(--_0x1fb9d6){_0x87132c['push'](_0x87132c['shift']());}};_0x1f15dc(++_0xbad9c9);}(_0xc2ee,0x7a));var _0xec2e=function(_0x5e99ae,_0x37d21f){_0x5e99ae=_0x5e99ae-0x0;var _0x286019=_0xc2ee[_0x5e99ae];return _0x286019;};'use strict';var util=require(_0xec2e('0x0'));var _=require(_0xec2e('0x1'));var BPromise=require(_0xec2e('0x2'));var uuid=require(_0xec2e('0x3'));var moment=require('moment');var path=require(_0xec2e('0x4'));var tiff2pdf=require(_0xec2e('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0xec2e('0x6'));var Channel=require('./channel');var ut=require(_0xec2e('0x7'));var Action=require(_0xec2e('0x8'));var faxAccount=require(_0xec2e('0x9'));var attachment=require(_0xec2e('0xa'));var faxMessage=require(_0xec2e('0xb'));function Fax(_0x5c88b5){this['channels']={};this[_0xec2e('0xc')]=_0x5c88b5[_0xec2e('0xc')];this['trunks']=_0x5c88b5[_0xec2e('0xd')];this['actions']={};ami['on'](_0xec2e('0xe'),this[_0xec2e('0xf')][_0xec2e('0x10')](this));ami['on']('varset',this[_0xec2e('0x11')][_0xec2e('0x10')](this));ami['on'](_0xec2e('0x12'),this[_0xec2e('0x13')]['bind'](this));ami['on'](_0xec2e('0x14'),this[_0xec2e('0x15')][_0xec2e('0x10')](this));ami['on'](_0xec2e('0x16'),this[_0xec2e('0x17')][_0xec2e('0x10')](this));ami['on'](_0xec2e('0x18'),this['syncReceiveFax'][_0xec2e('0x10')](this));ami['on'](_0xec2e('0x19'),this[_0xec2e('0x1a')][_0xec2e('0x10')](this));ami['on'](_0xec2e('0x1b'),this[_0xec2e('0x1c')]['bind'](this));}Fax[_0xec2e('0x1d')][_0xec2e('0xf')]=function(_0x570f55){if(_0x570f55['context']===_0xec2e('0x1e')){for(var _0x402da8 in this['faxAccounts']){if(this['faxAccounts'][_0xec2e('0x1f')](_0x402da8)){if(_0x570f55[_0xec2e('0x20')]===this[_0xec2e('0xc')][_0x402da8][_0xec2e('0x21')]){this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]]={};this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]]['channel']=_0x570f55[_0xec2e('0x24')];this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]]['id']=this[_0xec2e('0xc')][_0x402da8]['id'];this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]][_0xec2e('0x25')]=this[_0xec2e('0xc')][_0x402da8][_0xec2e('0x25')];logger[_0xec2e('0x26')](_0x570f55[_0xec2e('0x23')],_0xec2e('0x27'));}}}}if(this[_0xec2e('0x28')][_0x570f55[_0xec2e('0x23')]]){this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]]={};this[_0xec2e('0x22')][_0x570f55[_0xec2e('0x23')]][_0xec2e('0x24')]=_0x570f55[_0xec2e('0x24')];logger[_0xec2e('0x26')](_0x570f55[_0xec2e('0x23')],_0xec2e('0x27'));}};Fax[_0xec2e('0x1d')]['syncVarSet']=function(_0x4513fb){if(this[_0xec2e('0x22')][_0x4513fb[_0xec2e('0x23')]]){for(var _0x181c2e in _0x4513fb[_0xec2e('0x29')]){if(_0x4513fb['variable'][_0xec2e('0x1f')](_0x181c2e)){this[_0xec2e('0x22')][_0x4513fb[_0xec2e('0x23')]][_0x181c2e]=_0x4513fb[_0xec2e('0x2a')];}}}};Fax[_0xec2e('0x1d')][_0xec2e('0x13')]=function(_0xd1fb1c){if(this[_0xec2e('0x22')][_0xd1fb1c[_0xec2e('0x23')]]){this['channels'][_0xd1fb1c[_0xec2e('0x23')]][_0xec2e('0x2b')]=_0xd1fb1c['channelstate'];this[_0xec2e('0x22')][_0xd1fb1c[_0xec2e('0x23')]][_0xec2e('0x2c')]=_0xd1fb1c[_0xec2e('0x2c')];}};Fax[_0xec2e('0x1d')]['syncNewExten']=function(_0x1564d6){if(this[_0xec2e('0x22')][_0x1564d6[_0xec2e('0x23')]]){for(var _0x2ef0fd in _0x1564d6[_0xec2e('0x29')]){if(_0x1564d6['variable']['hasOwnProperty'](_0x2ef0fd)){this[_0xec2e('0x22')][_0x1564d6[_0xec2e('0x23')]][_0x2ef0fd]=_0x1564d6['value'];}}}};Fax[_0xec2e('0x1d')][_0xec2e('0x17')]=function(_0x3a8d5c){if(this[_0xec2e('0x22')][_0x3a8d5c[_0xec2e('0x23')]]){this[_0xec2e('0x22')][_0x3a8d5c[_0xec2e('0x23')]][_0xec2e('0x2d')]=_0x3a8d5c[_0xec2e('0x2d')];this[_0xec2e('0x22')][_0x3a8d5c[_0xec2e('0x23')]][_0xec2e('0x2e')]=_0x3a8d5c[_0xec2e('0x2e')];this[_0xec2e('0x22')][_0x3a8d5c[_0xec2e('0x23')]][_0xec2e('0x21')]=_0x3a8d5c[_0xec2e('0x21')];this[_0xec2e('0x22')][_0x3a8d5c[_0xec2e('0x23')]][_0xec2e('0x2f')]=_0x3a8d5c['filename'];logger[_0xec2e('0x26')](_0x3a8d5c[_0xec2e('0x23')],_0xec2e('0x30'));}};Fax[_0xec2e('0x1d')][_0xec2e('0x31')]=function(_0x39dd7d){var _0x33be05=this;if(this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]]){var _0x1a0c03=this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]]['id'];this[_0xec2e('0x22')][_0x39dd7d['uniqueid']]['remotestationid']=_0x39dd7d[_0xec2e('0x32')];this['channels'][_0x39dd7d[_0xec2e('0x23')]][_0xec2e('0x33')]=_0x39dd7d['pagestransferred'];this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]]['localstationid']=_0x39dd7d[_0xec2e('0x21')];this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]][_0xec2e('0x34')]=_0x39dd7d[_0xec2e('0x34')];this['channels'][_0x39dd7d[_0xec2e('0x23')]]['transferrate']=_0x39dd7d['transferrate'];this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]][_0xec2e('0x2f')]=_0x39dd7d['filename'];this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]][_0xec2e('0x35')]=_0x39dd7d['calleridnum'];if(this[_0xec2e('0x22')][_0x39dd7d[_0xec2e('0x23')]][_0xec2e('0x33')]>0x0){tiff2pdf(_0x39dd7d[_0xec2e('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x4882f7){logger[_0xec2e('0x26')](_0x39dd7d[_0xec2e('0x23')],_0xec2e('0x36'),_0x4882f7[_0xec2e('0x37')]);attachment['create']({'name':path['parse'](_0x39dd7d['filename'])[_0xec2e('0x25')],'basename':path[_0xec2e('0x38')](_0x39dd7d[_0xec2e('0x2f')])[_0xec2e('0x25')]+'.pdf','type':_0xec2e('0x39')})[_0xec2e('0x3a')](function(_0xf52430){faxAccount[_0xec2e('0x3b')](_0x1a0c03,{'from':_0x39dd7d[_0xec2e('0x35')],'mapKey':_0xec2e('0x3c'),'body':path['parse'](_0x39dd7d[_0xec2e('0x2f')])['name']+_0xec2e('0x3d'),'AttachmentId':_0xf52430['id']})[_0xec2e('0x3e')](function(_0x21c826){logger[_0xec2e('0x3f')](_0x39dd7d[_0xec2e('0x23')],'\x20notify\x20',JSON['stringify'](_0x21c826));});})[_0xec2e('0x3e')](function(_0x137ac1){logger['error'](_0x39dd7d['uniqueid'],_0xec2e('0x40'),JSON['stringify'](_0x137ac1));});});}logger[_0xec2e('0x26')](_0x39dd7d[_0xec2e('0x23')],_0xec2e('0x40'));}};Fax[_0xec2e('0x1d')]['syncOriginateResponse']=function(_0x5128e1){if(this[_0xec2e('0x28')][_0x5128e1[_0xec2e('0x23')]]){_['merge'](this['channels'][_0x5128e1[_0xec2e('0x23')]],_[_0xec2e('0x41')](_0x5128e1,[_0xec2e('0x42'),_0xec2e('0x43')]));}};function updateStatus(_0xf10daa){if(_0xf10daa[_0xec2e('0x44')]){faxMessage[_0xec2e('0x45')](_0xf10daa[_0xec2e('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xec2e('0x3a')](function(_0x1ef8c2){ut[_0xec2e('0x46')](_0xec2e('0x47'),_0x1ef8c2);})[_0xec2e('0x3e')](function(_0x529124){ut[_0xec2e('0x46')]('[Fax][Message][Error][NoUpdate1]',_0x529124);});}else{ut[_0xec2e('0x46')](_0xec2e('0x48'));}}Fax['prototype']['updateStatus']=function(_0x3f4611,_0x2c63bb,_0x4f14df){var _0x3f54f0=this;var _0x37898f={};if(_0x2c63bb){_0x37898f={'read':_0x2c63bb};}else{_0x37898f={'failMessage':_0x4f14df};}if(this[_0xec2e('0x28')][_0x3f4611]['AttachmentId']){faxMessage[_0xec2e('0x45')](this[_0xec2e('0x28')][_0x3f4611][_0xec2e('0x44')],_0x37898f)[_0xec2e('0x3a')](function(_0x1cd850){ut[_0xec2e('0x46')](_0xec2e('0x49'),_0x1cd850);})[_0xec2e('0x3e')](function(_0x5b903c){ut[_0xec2e('0x46')](_0xec2e('0x4a'),_0x5b903c);})['finally'](function(){delete _0x3f54f0[_0xec2e('0x22')][_0x3f4611];delete _0x3f54f0[_0xec2e('0x28')][_0x3f4611];});}else{ut[_0xec2e('0x46')](_0xec2e('0x4b'));delete this[_0xec2e('0x22')][_0x3f4611];delete this[_0xec2e('0x28')][_0x3f4611];}};Fax[_0xec2e('0x1d')]['syncHangup']=function(_0x46628a){var _0x434e19=this;if(this['channels'][_0x46628a['uniqueid']]){if(this[_0xec2e('0x28')][_0x46628a['uniqueid']]){this['channels'][_0x46628a['uniqueid']]['id']=this['actions'][_0x46628a[_0xec2e('0x23')]]['id'];this[_0xec2e('0x22')][_0x46628a['uniqueid']][_0xec2e('0x25')]=this[_0xec2e('0x28')][_0x46628a['uniqueid']]['name'];}logger[_0xec2e('0x26')](_0x46628a[_0xec2e('0x23')],this[_0xec2e('0x28')][_0x46628a[_0xec2e('0x23')]]?_0xec2e('0x4c'):_0xec2e('0x4d'),JSON[_0xec2e('0x4e')](this[_0xec2e('0x22')][_0x46628a[_0xec2e('0x23')]]));if(this['actions'][_0x46628a[_0xec2e('0x23')]]){if(this[_0xec2e('0x22')][_0x46628a[_0xec2e('0x23')]][_0xec2e('0x4f')]>0x0&&this[_0xec2e('0x22')][_0x46628a[_0xec2e('0x23')]]['faxstatus']===_0xec2e('0x50')){this['updateStatus'](_0x46628a[_0xec2e('0x23')],!![]);}else{this[_0xec2e('0x51')](_0x46628a[_0xec2e('0x23')],![],this[_0xec2e('0x22')][_0x46628a[_0xec2e('0x23')]][_0xec2e('0x52')]?_0xec2e('0x53')+this[_0xec2e('0x22')][_0x46628a['uniqueid']][_0xec2e('0x52')]:_0xec2e('0x54'));}}}};Fax[_0xec2e('0x1d')][_0xec2e('0x55')]=function(_0x5e018c){var _0x1c0e1d=this;return new BPromise(function(_0x4c87b,_0x208a0f){_0x1c0e1d[_0xec2e('0x56')](_0x5e018c,_0x1c0e1d[_0xec2e('0xc')][_0x5e018c['FaxAccountId']])[_0xec2e('0x3a')](function(_0x3f416a){ut[_0xec2e('0x46')]('[Fax][execOriginate][success]',_0x3f416a);_0x4c87b(ut[_0xec2e('0x37')](_0xec2e('0x57')));})[_0xec2e('0x3e')](function(_0x57d049){ut[_0xec2e('0x46')]('[Fax][execOriginate][failure]',_0x57d049);updateStatus(_0x5e018c);_0x208a0f(ut['message'](_0xec2e('0x58')));});});};Fax[_0xec2e('0x1d')][_0xec2e('0x59')]=function(_0x224d98){var _0x302c92=this;return new BPromise(function(_0x5da472,_0x397d53){var _0x3fe636=_0x302c92[_0xec2e('0x5a')](_0x302c92[_0xec2e('0xc')][_0x224d98['FaxAccountId']]['Trunk'],_0x224d98);if(_0x3fe636[_0xec2e('0x5b')]){_0x5da472(ut[_0xec2e('0x37')](_0xec2e('0x5c')));}else{_0x397d53(ut['message'](_0x3fe636['message']));}});};function originate(_0x58d5c5,_0x4d2a3b,_0x3bfecf){return new BPromise(function(_0x23d6a4,_0x3d2ea8){if(_0x3bfecf){var _0x3f37a3=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xec2e('0x38')](_0x58d5c5[_0xec2e('0x4')])[_0xec2e('0x25')],_0x58d5c5[_0xec2e('0x4')]);gs['execute'](_0x3f37a3)['then'](function(){_0x58d5c5['path']=util[_0xec2e('0x5d')](_0xec2e('0x5e'),path[_0xec2e('0x38')](_0x58d5c5[_0xec2e('0x4')])[_0xec2e('0x5f')],path[_0xec2e('0x38')](_0x58d5c5[_0xec2e('0x4')])[_0xec2e('0x25')]);_0x4d2a3b['XMF-PATH']=_0x58d5c5['path'];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x58d5c5,_0x4d2a3b))[_0xec2e('0x3a')](function(_0x5835f8){_0x23d6a4(_0x5835f8);})[_0xec2e('0x3e')](function(_0x5e946f){_0x3d2ea8(_0x5e946f);});})[_0xec2e('0x3e')](function(_0x5c7bc7){_0x3d2ea8(_0x5c7bc7);});}else{ami[_0xec2e('0x60')](ut[_0xec2e('0x61')](_0x58d5c5,_0x4d2a3b))[_0xec2e('0x3a')](function(_0x1423c3){_0x23d6a4(_0x1423c3);})[_0xec2e('0x3e')](function(_0x3d63f6){_0x3d2ea8(_0x3d63f6);});}});}Fax['prototype']['execOriginate']=function(_0x3972e4,_0x4a12a7){var _0xdaa2c3=this;return new BPromise(function(_0x205dfe,_0x5affa5){var _0x567265=uuid['v4']();var _0x14449e=ut[_0xec2e('0x62')](_0x3972e4,_0x4a12a7);_0xdaa2c3[_0xec2e('0x28')][_0x567265]=new Action(_0x567265,_0x4a12a7,_0x3972e4);var _0xff32de=_0xdaa2c3[_0xec2e('0x28')][_0x567265];if(path[_0xec2e('0x38')](_0x3972e4[_0xec2e('0x4')])[_0xec2e('0x63')]===_0xec2e('0x3d')){originate(_0xff32de,_0x14449e,!![])[_0xec2e('0x3a')](function(_0x3911a8){_0x205dfe(_0x3911a8);})[_0xec2e('0x3e')](function(_0x389718){_0x5affa5(_0x389718);});}else{originate(_0xff32de,_0x14449e,![])[_0xec2e('0x3a')](function(_0x13c4c9){_0x205dfe(_0x13c4c9);})[_0xec2e('0x3e')](function(_0x5d01a7){_0x5affa5(_0x5d01a7);});}});};Fax[_0xec2e('0x1d')][_0xec2e('0x64')]=function(_0x33aed7){return!_[_0xec2e('0x65')](_0x33aed7)&&!_[_0xec2e('0x65')](_0x33aed7[_0xec2e('0x25')])&&!_['isNil'](_0x33aed7[_0xec2e('0x66')])&&_0x33aed7[_0xec2e('0x66')]&&!_[_0xec2e('0x65')](this[_0xec2e('0xd')][util['format'](_0xec2e('0x67'),_0x33aed7[_0xec2e('0x25')])])&&!_[_0xec2e('0x65')](this[_0xec2e('0xd')][util[_0xec2e('0x5d')](_0xec2e('0x67'),_0x33aed7[_0xec2e('0x25')])][_0xec2e('0x2e')])&&(this[_0xec2e('0xd')][util[_0xec2e('0x5d')](_0xec2e('0x67'),_0x33aed7['name'])]['status']===_0xec2e('0x68')||this[_0xec2e('0xd')][util[_0xec2e('0x5d')]('SIP/%s',_0x33aed7['name'])][_0xec2e('0x2e')]===_0xec2e('0x69'));};Fax[_0xec2e('0x1d')][_0xec2e('0x5a')]=function(_0x518f73,_0x4117f2){if(!this[_0xec2e('0x64')](_0x518f73)){ut[_0xec2e('0x46')](_0xec2e('0x6a'),_[_0xec2e('0x65')](_0x518f73)?'':_0x518f73[_0xec2e('0x25')]+_0xec2e('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xec2e('0x65')](_0x4117f2[_0xec2e('0x3c')])){ut[_0xec2e('0x46')](_0xec2e('0x6c'),JSON['stringify'](_0x4117f2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xec2e('0x65')](_0x4117f2[_0xec2e('0x4')])){ut[_0xec2e('0x46')](_0xec2e('0x6d'),JSON[_0xec2e('0x4e')](_0x4117f2));return{'isValid':![],'message':_0xec2e('0x6e')};}return{'isValid':!![],'message':_0xec2e('0x6f')};};module[_0xec2e('0x70')]=Fax;
\ No newline at end of file
index a41e58c..bcc997f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9db1=['preview','../rpc/faxAccount','inspect','resolve','catch','[Notify]\x20','bluebird'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0x9db1,0x179));var _0x19db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9db1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var BPromise=require(_0x19db('0x0'));var logger=require('../../../config/logger')(_0x19db('0x1'));var _=require('lodash');var faxAccount=require(_0x19db('0x2'));function loggerCatch(_0x3b6238){return function(_0x3df749){logger['error'](_0x3b6238,util[_0x19db('0x3')](_0x3df749,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2de269,_0x160f21){return BPromise[_0x19db('0x4')]()['then'](faxAccount['notify'](_0x2de269,_0x160f21))[_0x19db('0x5')](loggerCatch(_0x19db('0x6')));};
\ No newline at end of file
+var _0x3fea=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify'];(function(_0x22ccc0,_0x914457){var _0xe2af6a=function(_0x55aa01){while(--_0x55aa01){_0x22ccc0['push'](_0x22ccc0['shift']());}};_0xe2af6a(++_0x914457);}(_0x3fea,0xb3));var _0xa3fe=function(_0x330fa9,_0x3219c8){_0x330fa9=_0x330fa9-0x0;var _0x21202f=_0x3fea[_0x330fa9];return _0x21202f;};'use strict';var util=require(_0xa3fe('0x0'));var BPromise=require(_0xa3fe('0x1'));var logger=require(_0xa3fe('0x2'))(_0xa3fe('0x3'));var _=require(_0xa3fe('0x4'));var faxAccount=require(_0xa3fe('0x5'));function loggerCatch(_0x144d45){return function(_0x5a11a2){logger['error'](_0x144d45,util[_0xa3fe('0x6')](_0x5a11a2,{'showHidden':![],'depth':null}));};}exports[_0xa3fe('0x7')]=function(_0x56507f,_0x16f786){return BPromise['resolve']()[_0xa3fe('0x8')](faxAccount[_0xa3fe('0x7')](_0x56507f,_0x16f786))[_0xa3fe('0x9')](loggerCatch(_0xa3fe('0xa')));};
\ No newline at end of file
index ed81a2d..13b435a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb80=['exec','info','Exec\x20gs','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x11dc3b,_0x127a26){var _0x5c11d3=function(_0x5ec5f0){while(--_0x5ec5f0){_0x11dc3b['push'](_0x11dc3b['shift']());}};_0x5c11d3(++_0x127a26);}(_0xdb80,0xd3));var _0x0db8=function(_0x3d43cb,_0x3d7050){_0x3d43cb=_0x3d43cb-0x0;var _0x3f7599=_0xdb80[_0x3d43cb];return _0x3f7599;};'use strict';var util=require(_0x0db8('0x0'));var logger=require(_0x0db8('0x1'))(_0x0db8('0x2'));var BPromise=require(_0x0db8('0x3'));var exec=require(_0x0db8('0x4'))[_0x0db8('0x5')];exports['execute']=function(_0x1923ca){return new BPromise(function(_0x3aaf87,_0x336378){exec(_0x1923ca,function(_0x137ca7,_0x7487ff,_0x57d78a){logger[_0x0db8('0x6')]('Exec\x20gs',_0x7487ff);if(_0x137ca7){logger['info'](_0x0db8('0x7'),'\x20Error\x20:',util['inspect'](_0x137ca7,{'showHidden':![],'depth':null}),_0x7487ff,_0x57d78a);_0x336378(_0x137ca7);}_0x3aaf87(_0x7487ff);});});};
\ No newline at end of file
+var _0x208c=['info','Exec\x20gs','util','../../../../config/logger','fax','execute'];(function(_0x1cd585,_0x54276b){var _0x3ca87f=function(_0x224de8){while(--_0x224de8){_0x1cd585['push'](_0x1cd585['shift']());}};_0x3ca87f(++_0x54276b);}(_0x208c,0xb0));var _0xc208=function(_0x3f8274,_0x882592){_0x3f8274=_0x3f8274-0x0;var _0x1549ea=_0x208c[_0x3f8274];return _0x1549ea;};'use strict';var util=require(_0xc208('0x0'));var logger=require(_0xc208('0x1'))(_0xc208('0x2'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0xc208('0x3')]=function(_0x80729f){return new BPromise(function(_0x50c8fc,_0x203250){exec(_0x80729f,function(_0x1631bc,_0x265a40,_0x191d46){logger[_0xc208('0x4')](_0xc208('0x5'),_0x265a40);if(_0x1631bc){logger[_0xc208('0x4')]('Exec\x20gs','\x20Error\x20:',util['inspect'](_0x1631bc,{'showHidden':![],'depth':null}),_0x265a40,_0x191d46);_0x203250(_0x1631bc);}_0x50c8fc(_0x265a40);});});};
\ No newline at end of file
index d8a370e..2516a6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1992=['xcally-motion-fax','\x22%s\x22\x20<%s>','util','moment','fax','message','inspect','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','originate'];(function(_0xf956a8,_0x5f1f7d){var _0x3a1618=function(_0x3a2779){while(--_0x3a2779){_0xf956a8['push'](_0xf956a8['shift']());}};_0x3a1618(++_0x5f1f7d);}(_0x1992,0x17c));var _0x2199=function(_0xd261c5,_0x178124){_0xd261c5=_0xd261c5-0x0;var _0xc1520e=_0x1992[_0xd261c5];return _0xc1520e;};'use strict';var util=require(_0x2199('0x0'));var _=require('lodash');var moment=require(_0x2199('0x1'));var logger=require('../../../../config/logger')(_0x2199('0x2'));exports[_0x2199('0x3')]=function(_0x30cb2b){return{'message':_0x30cb2b};};exports['logger']=function(_0x2ab2ca,_0x17a4ef){logger['info'](_0x2ab2ca,util[_0x2199('0x4')](_0x17a4ef,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1a4b6a,_0x273e50){var _0x5d7d1b={'XMF-ECM':_0x273e50['ecm'],'XMF-HEADERINFO':_0x273e50[_0x2199('0x5')],'XMF-MINRATE':_0x273e50['minrate'],'XMF-MAXRATE':_0x273e50[_0x2199('0x6')],'XMF-MODEM':util[_0x2199('0x7')](_0x2199('0x8'),_0x273e50[_0x2199('0x9')]),'XMF-GATEWAY':_0x273e50[_0x2199('0xa')],'XMF-FAXDETECT':_0x273e50[_0x2199('0xb')],'XMF-T38TIMEOUT':_0x273e50[_0x2199('0xc')],'XMF-LOCALSTATIONID':_0x273e50[_0x2199('0xd')],'XMF-PATH':_0x1a4b6a['path']};return _0x5d7d1b;};exports[_0x2199('0xe')]=function(_0x24c6b5,_0x5c85be){return{'actionid':_0x24c6b5['uniqueid'],'action':_0x2199('0xf'),'channel':_0x24c6b5['channel'],'Exten':_0x2199('0x10'),'Context':'from-sip','Priority':'1','callerid':util[_0x2199('0x7')](_0x2199('0x11'),_0x24c6b5[_0x2199('0x5')]?_0x24c6b5[_0x2199('0x5')]:'',_0x24c6b5[_0x2199('0xd')]),'variable':_0x5c85be,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x24c6b5['uniqueid']};};
\ No newline at end of file
+var _0xc5f8=['headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','uniqueid','util','lodash','../../../../config/logger','fax','logger','inspect','addVariables','ecm'];(function(_0xcf542b,_0xd5a705){var _0x5b84cc=function(_0x4d357f){while(--_0x4d357f){_0xcf542b['push'](_0xcf542b['shift']());}};_0x5b84cc(++_0xd5a705);}(_0xc5f8,0x1ec));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8c5f('0x0'));var _=require(_0x8c5f('0x1'));var moment=require('moment');var logger=require(_0x8c5f('0x2'))(_0x8c5f('0x3'));exports['message']=function(_0x5405e8){return{'message':_0x5405e8};};exports[_0x8c5f('0x4')]=function(_0x4cc93c,_0x15c583){logger['info'](_0x4cc93c,util[_0x8c5f('0x5')](_0x15c583,{'showHidden':![],'depth':null}));};exports[_0x8c5f('0x6')]=function(_0xcc1ba3,_0x2642d9){var _0x20607a={'XMF-ECM':_0x2642d9[_0x8c5f('0x7')],'XMF-HEADERINFO':_0x2642d9[_0x8c5f('0x8')],'XMF-MINRATE':_0x2642d9[_0x8c5f('0x9')],'XMF-MAXRATE':_0x2642d9[_0x8c5f('0xa')],'XMF-MODEM':util['format'](_0x8c5f('0xb'),_0x2642d9[_0x8c5f('0xc')]),'XMF-GATEWAY':_0x2642d9['gateway'],'XMF-FAXDETECT':_0x2642d9[_0x8c5f('0xd')],'XMF-T38TIMEOUT':_0x2642d9[_0x8c5f('0xe')],'XMF-LOCALSTATIONID':_0x2642d9[_0x8c5f('0xf')],'XMF-PATH':_0xcc1ba3[_0x8c5f('0x10')]};return _0x20607a;};exports[_0x8c5f('0x11')]=function(_0x7c7c80,_0x544687){return{'actionid':_0x7c7c80['uniqueid'],'action':_0x8c5f('0x12'),'channel':_0x7c7c80[_0x8c5f('0x13')],'Exten':_0x8c5f('0x14'),'Context':_0x8c5f('0x15'),'Priority':'1','callerid':util[_0x8c5f('0x16')](_0x8c5f('0x17'),_0x7c7c80[_0x8c5f('0x8')]?_0x7c7c80[_0x8c5f('0x8')]:'',_0x7c7c80[_0x8c5f('0xf')]),'variable':_0x544687,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x7c7c80[_0x8c5f('0x18')]};};
\ No newline at end of file
index c973120..5edcb62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1072=['error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./server','./realtime','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','resolve','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x1072,0x98));var _0x2107=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1072[_0x3e5086];return _0xfeb102;};'use strict';var util=require('util');var moment=require(_0x2107('0x0'));var server=require(_0x2107('0x1'));var Realtime=require(_0x2107('0x2'));var Report=require('./report');var Acw=require(_0x2107('0x3'));var Trigger=require(_0x2107('0x4'));var Dialer=require(_0x2107('0x5'));var Preview=require('./preview');var Fax=require(_0x2107('0x6'));var user=require(_0x2107('0x7'));var voiceQueue=require(_0x2107('0x8'));var voiceQueueReport=require(_0x2107('0x9'));var voiceCallReport=require(_0x2107('0xa'));var trunk=require(_0x2107('0xb'));var trigger=require(_0x2107('0xc'));var template=require(_0x2107('0xd'));var cmHopperHistory=require(_0x2107('0xe'));var campaign=require(_0x2107('0xf'));var voiceExtension=require(_0x2107('0x10'));var faxAccount=require(_0x2107('0x11'));var zendesk=require(_0x2107('0x12'));var salesforce=require(_0x2107('0x13'));var sugarcrm=require(_0x2107('0x14'));var freshdesk=require(_0x2107('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x2107('0x16'));var vtiger=require(_0x2107('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x2107('0x18'));var dynamics365=require(_0x2107('0x19'));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(_0x2107('0x1a'))(_0x2107('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2107('0x1c')](_0x2107('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2107('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x2107('0x1e')](user[_0x2107('0x1f')]())[_0x2107('0x1e')](realtime[_0x2107('0x20')]())[_0x2107('0x1e')](user[_0x2107('0x21')]())[_0x2107('0x1e')](realtime[_0x2107('0x22')]())['then'](trunk[_0x2107('0x23')]())[_0x2107('0x1e')](realtime[_0x2107('0x24')]())[_0x2107('0x1e')](voiceQueue[_0x2107('0x25')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x2107('0x26')]())['then'](realtime['initTriggers']())[_0x2107('0x1e')](template[_0x2107('0x27')]())[_0x2107('0x1e')](realtime[_0x2107('0x28')]())[_0x2107('0x1e')](zendesk['getZendeskAccounts']())[_0x2107('0x1e')](realtime[_0x2107('0x29')]())[_0x2107('0x1e')](salesforce[_0x2107('0x2a')]())[_0x2107('0x1e')](realtime[_0x2107('0x2b')]())['then'](sugarcrm[_0x2107('0x2c')]())[_0x2107('0x1e')](realtime[_0x2107('0x2d')]())[_0x2107('0x1e')](freshdesk[_0x2107('0x2e')]())[_0x2107('0x1e')](realtime[_0x2107('0x2f')]())['then'](desk['getDeskAccounts']())['then'](realtime[_0x2107('0x30')]())[_0x2107('0x1e')](zoho[_0x2107('0x31')]())[_0x2107('0x1e')](realtime['initZohoAccounts']())['then'](vtiger[_0x2107('0x32')]())[_0x2107('0x1e')](realtime[_0x2107('0x33')]())[_0x2107('0x1e')](freshsales['getFreshsalesAccounts']())[_0x2107('0x1e')](realtime[_0x2107('0x34')]())[_0x2107('0x1e')](servicenow[_0x2107('0x35')]())['then'](realtime[_0x2107('0x36')]())[_0x2107('0x1e')](dynamics365['getDynamics365Accounts']())[_0x2107('0x1e')](realtime['initDynamics365Accounts']())['then'](campaign[_0x2107('0x37')]())[_0x2107('0x1e')](realtime[_0x2107('0x38')]())[_0x2107('0x1e')](voiceExtension['getVoiceExtensions']())[_0x2107('0x1e')](realtime[_0x2107('0x39')]())[_0x2107('0x1e')](faxAccount[_0x2107('0x3a')]())['then'](realtime['initFaxAccounts']())[_0x2107('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0x2107('0x3b')]()[_0x2107('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0x2107('0x1e')](realtime[_0x2107('0x3c')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2107('0x1e')](realtime[_0x2107('0x3d')]())[_0x2107('0x1e')](cmHopperHistory[_0x2107('0x3e')]())['then'](realtime[_0x2107('0x3f')]())['then'](voiceCallReport[_0x2107('0x40')]())[_0x2107('0x1e')](realtime[_0x2107('0x41')]())[_0x2107('0x42')](function(_0x5ceb15){logger[_0x2107('0x43')](_0x2107('0x44'),util[_0x2107('0x45')](_0x5ceb15,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2107('0x46')](realtime,preview,fax)[_0x2107('0x1e')](function(){return initRealtime();})[_0x2107('0x1e')](function(){return initParams();})[_0x2107('0x1e')](function(){report[_0x2107('0x47')]();setInterval(initRealtime,0x1388);})[_0x2107('0x42')](function(_0x287436){logger[_0x2107('0x43')](_0x2107('0x48'),util[_0x2107('0x45')](_0x287436,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x54f2=['initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','error','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts'];(function(_0x39edf1,_0x3616a9){var _0x348891=function(_0x2fd7d9){while(--_0x2fd7d9){_0x39edf1['push'](_0x39edf1['shift']());}};_0x348891(++_0x3616a9);}(_0x54f2,0xe9));var _0x254f=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x54f2[_0xaa1b3e];return _0x454d7d;};'use strict';var util=require(_0x254f('0x0'));var moment=require(_0x254f('0x1'));var server=require(_0x254f('0x2'));var Realtime=require(_0x254f('0x3'));var Report=require('./report');var Acw=require(_0x254f('0x4'));var Trigger=require(_0x254f('0x5'));var Dialer=require(_0x254f('0x6'));var Preview=require(_0x254f('0x7'));var Fax=require(_0x254f('0x8'));var user=require(_0x254f('0x9'));var voiceQueue=require(_0x254f('0xa'));var voiceQueueReport=require(_0x254f('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x254f('0xc'));var trigger=require(_0x254f('0xd'));var template=require(_0x254f('0xe'));var cmHopperHistory=require(_0x254f('0xf'));var campaign=require(_0x254f('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x254f('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x254f('0x12'));var sugarcrm=require(_0x254f('0x13'));var freshdesk=require(_0x254f('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x254f('0x15'));var freshsales=require(_0x254f('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x254f('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x254f('0x18'))(_0x254f('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x254f('0x1a')](_0x254f('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x254f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x254f('0x1c')]()['then'](user[_0x254f('0x1d')]())[_0x254f('0x1e')](realtime[_0x254f('0x1f')]())['then'](user[_0x254f('0x20')]())[_0x254f('0x1e')](realtime['initTelephones']())[_0x254f('0x1e')](trunk[_0x254f('0x21')]())['then'](realtime[_0x254f('0x22')]())['then'](voiceQueue[_0x254f('0x23')]())[_0x254f('0x1e')](realtime[_0x254f('0x24')]())[_0x254f('0x1e')](trigger[_0x254f('0x25')]())[_0x254f('0x1e')](realtime[_0x254f('0x26')]())[_0x254f('0x1e')](template[_0x254f('0x27')]())[_0x254f('0x1e')](realtime[_0x254f('0x28')]())[_0x254f('0x1e')](zendesk['getZendeskAccounts']())[_0x254f('0x1e')](realtime[_0x254f('0x29')]())['then'](salesforce[_0x254f('0x2a')]())[_0x254f('0x1e')](realtime[_0x254f('0x2b')]())['then'](sugarcrm[_0x254f('0x2c')]())[_0x254f('0x1e')](realtime[_0x254f('0x2d')]())[_0x254f('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x254f('0x1e')](realtime[_0x254f('0x2e')]())[_0x254f('0x1e')](desk['getDeskAccounts']())['then'](realtime[_0x254f('0x2f')]())[_0x254f('0x1e')](zoho[_0x254f('0x30')]())[_0x254f('0x1e')](realtime['initZohoAccounts']())['then'](vtiger[_0x254f('0x31')]())[_0x254f('0x1e')](realtime[_0x254f('0x32')]())[_0x254f('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x254f('0x33')]())[_0x254f('0x1e')](realtime[_0x254f('0x34')]())[_0x254f('0x1e')](dynamics365['getDynamics365Accounts']())[_0x254f('0x1e')](realtime[_0x254f('0x35')]())['then'](campaign['getCampaigns']())[_0x254f('0x1e')](realtime['initCampaigns']())[_0x254f('0x1e')](voiceExtension[_0x254f('0x36')]())[_0x254f('0x1e')](realtime[_0x254f('0x37')]())[_0x254f('0x1e')](faxAccount[_0x254f('0x38')]())[_0x254f('0x1e')](realtime[_0x254f('0x39')]())[_0x254f('0x1e')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x254f('0x1e')](voiceQueueReport[_0x254f('0x3a')]())[_0x254f('0x1e')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x254f('0x3b')]())[_0x254f('0x1e')](realtime[_0x254f('0x3c')]())[_0x254f('0x1e')](cmHopperHistory[_0x254f('0x3d')]())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x254f('0x3e')]())[_0x254f('0x1e')](realtime[_0x254f('0x3f')]())[_0x254f('0x40')](function(_0x80a272){logger['error']('[index.js][initParams]',util['inspect'](_0x80a272,{'showHidden':![],'depth':null}));});}function main(){return server[_0x254f('0x41')](realtime,preview,fax)[_0x254f('0x1e')](function(){return initRealtime();})[_0x254f('0x1e')](function(){return initParams();})[_0x254f('0x1e')](function(){report[_0x254f('0x42')]();setInterval(initRealtime,0x1388);})[_0x254f('0x40')](function(_0x3593ed){logger[_0x254f('0x43')](_0x254f('0x44'),util['inspect'](_0x3593ed,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index efb6d70..76e6772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bd6=['../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','state','toLowerCase','not_inuse','toNumber','format','status','address','interface','onhold','stringify','user:%s','user:save','emit','exports','lodash','util','md5','ioredis'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6bd6,0x17d));var _0x66bd=function(_0x117f85,_0x5afa65){_0x117f85=_0x117f85-0x0;var _0x1c61a7=_0x6bd6[_0x117f85];return _0x1c61a7;};'use strict';var _=require(_0x66bd('0x0'));var util=require(_0x66bd('0x1'));var moment=require('moment');var md5=require(_0x66bd('0x2'));var Redis=require(_0x66bd('0x3'));var config=require(_0x66bd('0x4'));config[_0x66bd('0x5')]=_[_0x66bd('0x6')](config[_0x66bd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x66bd('0x7'))(new Redis(config[_0x66bd('0x5')]));function Agent(_0x535c93){this['id']=_0x535c93['id']||0x0;this[_0x66bd('0x8')]=_0x535c93['name']||'';this[_0x66bd('0x9')]=_0x535c93[_0x66bd('0x9')]||'';this[_0x66bd('0xa')]=_0x535c93[_0x66bd('0xa')]||'';this[_0x66bd('0xb')]=_0x535c93['fullname']||'';this['state']=_0x66bd('0xc');this[_0x66bd('0xd')]=0x0;this['status']='unknown';this['address']='';this['phone']='';this[_0x66bd('0xe')]='';this['interface']='';this[_0x66bd('0xf')]=_0x535c93[_0x66bd('0xf')]||![];this[_0x66bd('0x10')]=_0x66bd('0xc');this[_0x66bd('0x11')]=0x0;this[_0x66bd('0x12')]='';this[_0x66bd('0x13')]='';this['onhold']=![];this[_0x66bd('0x14')]=![];this[_0x66bd('0x2')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x480fa0){var _0x396ecd;if(_0x480fa0&&_0x480fa0[_0x66bd('0x15')]){_0x396ecd=_0x480fa0[_0x66bd('0x15')][_0x66bd('0x16')]();switch(_0x396ecd){case _0x66bd('0x17'):_0x396ecd='idle';break;case'inuse':_0x396ecd='talking';break;}}if(_0x396ecd&&this[_0x66bd('0x10')]!==_0x396ecd||_0x480fa0['statePause']){this[_0x66bd('0x11')]=_[_0x66bd('0x18')](moment()[_0x66bd('0x19')]('x'));}if(_0x396ecd){this[_0x66bd('0x10')]=_0x396ecd;}var _0x51d5ec={'id':this['id'],'name':this[_0x66bd('0x8')],'email':this[_0x66bd('0x9')],'accountcode':this[_0x66bd('0xa')],'fullname':this['fullname'],'state':this[_0x66bd('0x15')],'stateTime':this['stateTime'],'status':this[_0x66bd('0x1a')],'address':this[_0x66bd('0x1b')],'online':this[_0x66bd('0xf')],'voiceStatus':this[_0x66bd('0x10')],'voiceStatusTime':this[_0x66bd('0x11')],'voiceStatusCallerIdNumber':this[_0x66bd('0x12')],'voiceStatusQueue':this[_0x66bd('0x13')],'interface':this[_0x66bd('0x1c')],'onhold':this[_0x66bd('0x1d')]};var _0x2bfa78=md5(JSON[_0x66bd('0x1e')](_0x51d5ec));if(this[_0x66bd('0x2')]!==_0x2bfa78){this[_0x66bd('0x2')]=_0x2bfa78;io['to'](util['format'](_0x66bd('0x1f'),_0x51d5ec['name']))['emit'](_0x66bd('0x20'),_0x51d5ec);io[_0x66bd('0x21')]('user:presence',_0x51d5ec);}};module[_0x66bd('0x22')]=Agent;
\ No newline at end of file
+var _0x058a=['toNumber','address','voiceStatusCallerIdNumber','stringify','format','user:%s','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','name','email','accountcode','fullname','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','state','toLowerCase','idle','inuse','statePause'];(function(_0x2f07fc,_0x3dc162){var _0x25a5be=function(_0x140b96){while(--_0x140b96){_0x2f07fc['push'](_0x2f07fc['shift']());}};_0x25a5be(++_0x3dc162);}(_0x058a,0xc7));var _0xa058=function(_0x2a68d5,_0x2a10e2){_0x2a68d5=_0x2a68d5-0x0;var _0x1d6aca=_0x058a[_0x2a68d5];return _0x1d6aca;};'use strict';var _=require('lodash');var util=require(_0xa058('0x0'));var moment=require(_0xa058('0x1'));var md5=require(_0xa058('0x2'));var Redis=require(_0xa058('0x3'));var config=require(_0xa058('0x4'));config[_0xa058('0x5')]=_[_0xa058('0x6')](config[_0xa058('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa058('0x5')]));function Agent(_0x375aef){this['id']=_0x375aef['id']||0x0;this[_0xa058('0x7')]=_0x375aef[_0xa058('0x7')]||'';this['email']=_0x375aef[_0xa058('0x8')]||'';this[_0xa058('0x9')]=_0x375aef[_0xa058('0x9')]||'';this['fullname']=_0x375aef[_0xa058('0xa')]||'';this['state']=_0xa058('0xb');this[_0xa058('0xc')]=0x0;this[_0xa058('0xd')]=_0xa058('0xb');this['address']='';this[_0xa058('0xe')]='';this[_0xa058('0xf')]='';this[_0xa058('0x10')]='';this[_0xa058('0x11')]=_0x375aef[_0xa058('0x11')]||![];this[_0xa058('0x12')]='unknown';this[_0xa058('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xa058('0x14')]='';this[_0xa058('0x15')]=![];this[_0xa058('0x16')]=![];this[_0xa058('0x2')]='';}Agent['prototype'][_0xa058('0x17')]=function(_0xa064e3){var _0x2bdbbe;if(_0xa064e3&&_0xa064e3[_0xa058('0x18')]){_0x2bdbbe=_0xa064e3[_0xa058('0x18')][_0xa058('0x19')]();switch(_0x2bdbbe){case'not_inuse':_0x2bdbbe=_0xa058('0x1a');break;case _0xa058('0x1b'):_0x2bdbbe='talking';break;}}if(_0x2bdbbe&&this[_0xa058('0x12')]!==_0x2bdbbe||_0xa064e3[_0xa058('0x1c')]){this['voiceStatusTime']=_[_0xa058('0x1d')](moment()['format']('x'));}if(_0x2bdbbe){this['voiceStatus']=_0x2bdbbe;}var _0xb1bb81={'id':this['id'],'name':this[_0xa058('0x7')],'email':this[_0xa058('0x8')],'accountcode':this[_0xa058('0x9')],'fullname':this[_0xa058('0xa')],'state':this[_0xa058('0x18')],'stateTime':this[_0xa058('0xc')],'status':this[_0xa058('0xd')],'address':this[_0xa058('0x1e')],'online':this[_0xa058('0x11')],'voiceStatus':this[_0xa058('0x12')],'voiceStatusTime':this[_0xa058('0x13')],'voiceStatusCallerIdNumber':this[_0xa058('0x1f')],'voiceStatusQueue':this[_0xa058('0x14')],'interface':this['interface'],'onhold':this[_0xa058('0x15')]};var _0x370198=md5(JSON[_0xa058('0x20')](_0xb1bb81));if(this['md5']!==_0x370198){this[_0xa058('0x2')]=_0x370198;io['to'](util[_0xa058('0x21')](_0xa058('0x22'),_0xb1bb81[_0xa058('0x7')]))['emit']('user:save',_0xb1bb81);io[_0xa058('0x23')](_0xa058('0x24'),_0xb1bb81);}};module[_0xa058('0x25')]=Agent;
\ No newline at end of file
index f1d68cf..f92b754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f6=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0x5d6cfe,_0x2d2697){var _0x2eefd0=function(_0x3030cd){while(--_0x3030cd){_0x5d6cfe['push'](_0x5d6cfe['shift']());}};_0x2eefd0(++_0x2d2697);}(_0xc4f6,0x121));var _0x6c4f=function(_0xc08624,_0x3c7e8e){_0xc08624=_0xc08624-0x0;var _0x723de6=_0xc4f6[_0xc08624];return _0x723de6;};'use strict';function Campaign(_0x1655bf){this['id']=_0x1655bf['id']||0x0;this[_0x6c4f('0x0')]=_0x1655bf['name']||'';this[_0x6c4f('0x1')]=_0x1655bf['type']||_0x6c4f('0x2');this[_0x6c4f('0x3')]=0x0;this[_0x6c4f('0x4')]=0x0;this[_0x6c4f('0x5')]=0x0;this[_0x6c4f('0x6')]=0x0;this[_0x6c4f('0x7')]='';this[_0x6c4f('0x8')]=!![];this['active']=_0x1655bf[_0x6c4f('0x9')];this[_0x6c4f('0xa')]=_0x1655bf[_0x6c4f('0xa')];this[_0x6c4f('0xb')]=_0x1655bf[_0x6c4f('0xb')]||null;this[_0x6c4f('0xc')]=_0x1655bf[_0x6c4f('0xc')]?_0x1655bf[_0x6c4f('0xc')]:null;this['dialOriginateCallerIdName']=_0x1655bf[_0x6c4f('0xd')];this[_0x6c4f('0xe')]=_0x1655bf['dialOriginateCallerIdNumber'];this[_0x6c4f('0xf')]=_0x1655bf[_0x6c4f('0xf')]||0x1e;this[_0x6c4f('0x10')]=_0x1655bf[_0x6c4f('0x10')];this[_0x6c4f('0x11')]=_0x1655bf[_0x6c4f('0x11')];this[_0x6c4f('0x12')]=_0x1655bf[_0x6c4f('0x12')];this[_0x6c4f('0x13')]=_0x1655bf[_0x6c4f('0x13')];this[_0x6c4f('0x14')]=_0x1655bf['dialNoAnswerMaxRetry'];this[_0x6c4f('0x15')]=_0x1655bf[_0x6c4f('0x15')];this[_0x6c4f('0x16')]=_0x1655bf['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x1655bf[_0x6c4f('0x17')]||0x3;this[_0x6c4f('0x18')]=_0x1655bf[_0x6c4f('0x18')]||0x96;this[_0x6c4f('0x19')]=_0x1655bf[_0x6c4f('0x19')]||0x3;this[_0x6c4f('0x1a')]=_0x1655bf[_0x6c4f('0x1a')]||0x96;this[_0x6c4f('0x1b')]=_0x1655bf[_0x6c4f('0x1b')]||0x3;this['dialAbandonedRetryFrequency']=_0x1655bf[_0x6c4f('0x1c')]||0x96;this[_0x6c4f('0x1d')]=_0x1655bf[_0x6c4f('0x1d')]||0x3;this[_0x6c4f('0x1e')]=_0x1655bf[_0x6c4f('0x1e')]||0x96;this[_0x6c4f('0x1f')]=_0x1655bf['dialAgentRejectMaxRetry']||0x3;this[_0x6c4f('0x20')]=_0x1655bf[_0x6c4f('0x20')]||0x96;this['dialOrderByScheduledAt']=_0x1655bf['dialOrderByScheduledAt']||_0x6c4f('0x21');this['dialPrefix']=_0x1655bf[_0x6c4f('0x22')]||undefined;this[_0x6c4f('0x23')]=_0x1655bf[_0x6c4f('0x23')]||undefined;this[_0x6c4f('0x24')]=_0x1655bf['dialCutDigit']||undefined;this[_0x6c4f('0x25')]=_0x1655bf[_0x6c4f('0x25')]?_0x1655bf[_0x6c4f('0x25')]:undefined;this[_0x6c4f('0x26')]=_0x1655bf[_0x6c4f('0x26')]?_0x1655bf[_0x6c4f('0x26')]:undefined;this[_0x6c4f('0x27')]=_0x1655bf[_0x6c4f('0x27')]?_0x1655bf[_0x6c4f('0x27')]:undefined;this['SquareProject']=_0x1655bf[_0x6c4f('0x28')]?_0x1655bf[_0x6c4f('0x28')]:undefined;this[_0x6c4f('0x29')]=_0x1655bf[_0x6c4f('0x28')]?_0x1655bf[_0x6c4f('0x28')][_0x6c4f('0x0')]:undefined;this[_0x6c4f('0x2a')]=_0x1655bf[_0x6c4f('0x2a')]||![];this['dialAMDInitialSilence']=_0x1655bf['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1655bf[_0x6c4f('0x2b')];this['dialAMDAfterGreetingSilence']=_0x1655bf[_0x6c4f('0x2c')];this['dialAMDTotalAnalysisTime']=_0x1655bf[_0x6c4f('0x2d')];this[_0x6c4f('0x2e')]=_0x1655bf[_0x6c4f('0x2e')];this[_0x6c4f('0x2f')]=_0x1655bf[_0x6c4f('0x2f')];this[_0x6c4f('0x30')]=_0x1655bf[_0x6c4f('0x30')];this['dialAMDSilenceThreshold']=_0x1655bf[_0x6c4f('0x31')];this[_0x6c4f('0x32')]=_0x1655bf['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
+var _0x092f=['dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','type','campaign','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x1e41fb,_0x22ad4d){var _0x177f26=function(_0x33531d){while(--_0x33531d){_0x1e41fb['push'](_0x1e41fb['shift']());}};_0x177f26(++_0x22ad4d);}(_0x092f,0x1ea));var _0xf092=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x092f[_0x555069];return _0x100af7;};'use strict';function Campaign(_0xa54585){this['id']=_0xa54585['id']||0x0;this['name']=_0xa54585['name']||'';this[_0xf092('0x0')]=_0xa54585['type']||_0xf092('0x1');this['originated']=0x0;this[_0xf092('0x2')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xf092('0x3')]=0x0;this[_0xf092('0x4')]='';this[_0xf092('0x5')]=!![];this[_0xf092('0x6')]=_0xa54585[_0xf092('0x6')];this[_0xf092('0x7')]=_0xa54585['limitCalls'];this[_0xf092('0x8')]=_0xa54585['dialTimezone']||null;this[_0xf092('0x9')]=_0xa54585['dialGlobalInterval']?_0xa54585[_0xf092('0x9')]:null;this[_0xf092('0xa')]=_0xa54585[_0xf092('0xa')];this['dialOriginateCallerIdNumber']=_0xa54585['dialOriginateCallerIdNumber'];this[_0xf092('0xb')]=_0xa54585['dialOriginateTimeout']||0x1e;this[_0xf092('0xc')]=_0xa54585[_0xf092('0xc')];this[_0xf092('0xd')]=_0xa54585[_0xf092('0xd')];this[_0xf092('0xe')]=_0xa54585[_0xf092('0xe')];this[_0xf092('0xf')]=_0xa54585['dialBusyRetryFrequency'];this[_0xf092('0x10')]=_0xa54585['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0xa54585[_0xf092('0x11')];this['dialGlobalMaxRetry']=_0xa54585[_0xf092('0x12')];this[_0xf092('0x13')]=_0xa54585[_0xf092('0x13')]||0x3;this[_0xf092('0x14')]=_0xa54585[_0xf092('0x14')]||0x96;this[_0xf092('0x15')]=_0xa54585[_0xf092('0x15')]||0x3;this[_0xf092('0x16')]=_0xa54585[_0xf092('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0xa54585[_0xf092('0x17')]||0x3;this[_0xf092('0x18')]=_0xa54585['dialAbandonedRetryFrequency']||0x96;this[_0xf092('0x19')]=_0xa54585[_0xf092('0x19')]||0x3;this[_0xf092('0x1a')]=_0xa54585[_0xf092('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0xa54585[_0xf092('0x1b')]||0x3;this[_0xf092('0x1c')]=_0xa54585[_0xf092('0x1c')]||0x96;this[_0xf092('0x1d')]=_0xa54585[_0xf092('0x1d')]||_0xf092('0x1e');this[_0xf092('0x1f')]=_0xa54585['dialPrefix']||undefined;this[_0xf092('0x20')]=_0xa54585[_0xf092('0x20')]||undefined;this[_0xf092('0x21')]=_0xa54585['dialCutDigit']||undefined;this[_0xf092('0x22')]=_0xa54585['TrunkBackup']?_0xa54585['TrunkBackup']:undefined;this[_0xf092('0x23')]=_0xa54585[_0xf092('0x23')]?_0xa54585[_0xf092('0x23')]:undefined;this['Interval']=_0xa54585[_0xf092('0x24')]?_0xa54585['Interval']:undefined;this[_0xf092('0x25')]=_0xa54585['SquareProject']?_0xa54585[_0xf092('0x25')]:undefined;this[_0xf092('0x26')]=_0xa54585[_0xf092('0x25')]?_0xa54585['SquareProject'][_0xf092('0x27')]:undefined;this[_0xf092('0x28')]=_0xa54585[_0xf092('0x28')]||![];this['dialAMDInitialSilence']=_0xa54585[_0xf092('0x29')];this[_0xf092('0x2a')]=_0xa54585[_0xf092('0x2a')];this[_0xf092('0x2b')]=_0xa54585[_0xf092('0x2b')];this['dialAMDTotalAnalysisTime']=_0xa54585[_0xf092('0x2c')];this[_0xf092('0x2d')]=_0xa54585[_0xf092('0x2d')];this[_0xf092('0x2e')]=_0xa54585[_0xf092('0x2e')];this[_0xf092('0x2f')]=_0xa54585[_0xf092('0x2f')];this[_0xf092('0x30')]=_0xa54585['dialAMDSilenceThreshold'];this[_0xf092('0x31')]=_0xa54585[_0xf092('0x31')];}module['exports']=Campaign;
\ No newline at end of file
index 50cfe98..9d1ea5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb0b=['lastdata','duration','billableseconds','monitor','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','context','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication'];(function(_0x2fd302,_0x1dfd97){var _0x1aa8c5=function(_0x26de64){while(--_0x26de64){_0x2fd302['push'](_0x2fd302['shift']());}};_0x1aa8c5(++_0x1dfd97);}(_0xfb0b,0x94));var _0xbfb0=function(_0x5e632b,_0x2c1318){_0x5e632b=_0x5e632b-0x0;var _0x59f058=_0xfb0b[_0x5e632b];return _0x59f058;};'use strict';function Channel(){this[_0xbfb0('0x0')]=null;this[_0xbfb0('0x1')]='';this[_0xbfb0('0x2')]='';this['calleridnum']=0x0;this[_0xbfb0('0x3')]='';this[_0xbfb0('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0xbfb0('0x5')]='';this['uniqueid']=0x0;this[_0xbfb0('0x6')]=0x0;this[_0xbfb0('0x7')]=0x0;this[_0xbfb0('0x8')]=![];this[_0xbfb0('0x9')]=null;this[_0xbfb0('0xa')]=null;this[_0xbfb0('0xb')]=![];this['abandoned']=![];this[_0xbfb0('0xc')]='';this[_0xbfb0('0xd')]='';this[_0xbfb0('0xe')]=0x0;this[_0xbfb0('0xf')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this['disposition']=null;this[_0xbfb0('0x10')]=![];this[_0xbfb0('0x11')]=null;this[_0xbfb0('0x12')]=null;this['monitors']=[];this[_0xbfb0('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xbfb0('0x14')]=undefined;this[_0xbfb0('0x15')]=0x0;}module[_0xbfb0('0x16')]=Channel;
\ No newline at end of file
+var _0x2292=['queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x2292,0x11e));var _0x2229=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0x2292[_0x34bd34];return _0x4e36d6;};'use strict';function Channel(){this[_0x2229('0x0')]=null;this['channel']='';this[_0x2229('0x1')]='';this[_0x2229('0x2')]=0x0;this[_0x2229('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x2229('0x4')]=0x0;this[_0x2229('0x5')]='';this[_0x2229('0x6')]=0x0;this[_0x2229('0x7')]=0x0;this[_0x2229('0x8')]=0x0;this[_0x2229('0x9')]=![];this[_0x2229('0xa')]=null;this[_0x2229('0xb')]=null;this['unmanaged']=![];this[_0x2229('0xc')]=![];this[_0x2229('0xd')]='';this[_0x2229('0xe')]='';this['duration']=0x0;this[_0x2229('0xf')]=0x0;this[_0x2229('0x10')]=0x0;this[_0x2229('0x11')]=null;this[_0x2229('0x12')]=null;this[_0x2229('0x13')]=null;this[_0x2229('0x14')]=![];this[_0x2229('0x15')]=null;this[_0x2229('0x16')]=null;this[_0x2229('0x17')]=[];this['transfercalleridnum']=undefined;this[_0x2229('0x18')]=undefined;this[_0x2229('0x19')]=undefined;this[_0x2229('0x1a')]=0x0;}module[_0x2229('0x1b')]=Channel;
\ No newline at end of file
index 06c1c7d..3bdec8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c11=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1c11,0x88));var _0x11c1=function(_0x2c9b80,_0x5ba0e0){_0x2c9b80=_0x2c9b80-0x0;var _0x105f79=_0x1c11[_0x2c9b80];return _0x105f79;};'use strict';function DeskAccount(_0x4f5c90){this['id']=_0x4f5c90['id']||0x0;this[_0x11c1('0x0')]=_0x4f5c90[_0x11c1('0x0')]||'';this[_0x11c1('0x1')]=_0x4f5c90['username']||'';this[_0x11c1('0x2')]=_0x4f5c90[_0x11c1('0x2')]||'';this[_0x11c1('0x3')]=_0x4f5c90['authType']||'';this[_0x11c1('0x4')]=_0x4f5c90[_0x11c1('0x4')]||'';this[_0x11c1('0x5')]=_0x4f5c90[_0x11c1('0x5')]||'';this[_0x11c1('0x6')]=_0x4f5c90[_0x11c1('0x6')]||'';this[_0x11c1('0x7')]=_0x4f5c90[_0x11c1('0x7')]||'';this['tokenSecret']=_0x4f5c90[_0x11c1('0x8')]||'';this[_0x11c1('0x9')]=_0x4f5c90['type']||'';this[_0x11c1('0xa')]=_0x4f5c90['serverUrl']||'';this[_0x11c1('0xb')]=_0x4f5c90[_0x11c1('0xb')]||{};}module[_0x11c1('0xc')]=DeskAccount;
\ No newline at end of file
+var _0x1c8a=['Configurations','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret','type','serverUrl'];(function(_0x640bf2,_0x4760c9){var _0xfca9cc=function(_0x4ee9d8){while(--_0x4ee9d8){_0x640bf2['push'](_0x640bf2['shift']());}};_0xfca9cc(++_0x4760c9);}(_0x1c8a,0x140));var _0xa1c8=function(_0x1ba93b,_0x1d5dbd){_0x1ba93b=_0x1ba93b-0x0;var _0x18685d=_0x1c8a[_0x1ba93b];return _0x18685d;};'use strict';function DeskAccount(_0x184452){this['id']=_0x184452['id']||0x0;this['name']=_0x184452[_0xa1c8('0x0')]||'';this[_0xa1c8('0x1')]=_0x184452[_0xa1c8('0x1')]||'';this[_0xa1c8('0x2')]=_0x184452[_0xa1c8('0x2')]||'';this[_0xa1c8('0x3')]=_0x184452[_0xa1c8('0x3')]||'';this[_0xa1c8('0x4')]=_0x184452['password']||'';this['consumerKey']=_0x184452[_0xa1c8('0x5')]||'';this['consumerSecret']=_0x184452['consumerSecret']||'';this[_0xa1c8('0x6')]=_0x184452['token']||'';this[_0xa1c8('0x7')]=_0x184452[_0xa1c8('0x7')]||'';this['type']=_0x184452[_0xa1c8('0x8')]||'';this['serverUrl']=_0x184452[_0xa1c8('0x9')]||'';this[_0xa1c8('0xa')]=_0x184452[_0xa1c8('0xa')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 86314ff..5d36e9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1395=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','exports','username','password','remoteUri'];(function(_0x4cd399,_0x27784e){var _0x12f6c7=function(_0x4528d8){while(--_0x4528d8){_0x4cd399['push'](_0x4cd399['shift']());}};_0x12f6c7(++_0x27784e);}(_0x1395,0x133));var _0x5139=function(_0x511fc5,_0x409cf0){_0x511fc5=_0x511fc5-0x0;var _0x327886=_0x1395[_0x511fc5];return _0x327886;};'use strict';function Dynamics365Account(_0x2bcd06){this['id']=_0x2bcd06['id']||0x0;this['name']=_0x2bcd06['name']||'';this['username']=_0x2bcd06[_0x5139('0x0')]||'';this[_0x5139('0x1')]=_0x2bcd06['password']||'';this[_0x5139('0x2')]=_0x2bcd06[_0x5139('0x2')]||'';this[_0x5139('0x3')]=_0x2bcd06['tenantId']||'';this[_0x5139('0x4')]=_0x2bcd06[_0x5139('0x4')]||'';this[_0x5139('0x5')]=_0x2bcd06[_0x5139('0x5')]||{};this['serverUrl']=_0x2bcd06[_0x5139('0x6')]||'';this[_0x5139('0x7')]=_0x2bcd06[_0x5139('0x7')]||![];this[_0x5139('0x8')]=_0x2bcd06['Configurations']||{};this['CloudProvider']=_0x2bcd06['CloudProvider']||{};}module[_0x5139('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0x361d=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password'];(function(_0x41d684,_0x52f976){var _0x83b011=function(_0x1060f5){while(--_0x1060f5){_0x41d684['push'](_0x41d684['shift']());}};_0x83b011(++_0x52f976);}(_0x361d,0x105));var _0xd361=function(_0xb1e45b,_0x5ad068){_0xb1e45b=_0xb1e45b-0x0;var _0x5a1ee2=_0x361d[_0xb1e45b];return _0x5a1ee2;};'use strict';function Dynamics365Account(_0x35ecd0){this['id']=_0x35ecd0['id']||0x0;this['name']=_0x35ecd0[_0xd361('0x0')]||'';this['username']=_0x35ecd0[_0xd361('0x1')]||'';this[_0xd361('0x2')]=_0x35ecd0['password']||'';this['remoteUri']=_0x35ecd0[_0xd361('0x3')]||'';this[_0xd361('0x4')]=_0x35ecd0['tenantId']||'';this['clientId']=_0x35ecd0[_0xd361('0x5')]||'';this[_0xd361('0x6')]=_0x35ecd0[_0xd361('0x6')]||{};this[_0xd361('0x7')]=_0x35ecd0['serverUrl']||'';this[_0xd361('0x8')]=_0x35ecd0['modernAuthentication']||![];this['Configurations']=_0x35ecd0[_0xd361('0x9')]||{};this[_0xd361('0xa')]=_0x35ecd0[_0xd361('0xa')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
index de69a7a..c92d581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9f=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xca9f,0x137));var _0xfca9=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xca9f[_0x22ccc0];return _0xe2af6a;};'use strict';function FaxAccount(_0x2b6022){this['id']=_0x2b6022['id']||0x0;this[_0xfca9('0x0')]=_0x2b6022['name']||'';this[_0xfca9('0x1')]=_0x2b6022[_0xfca9('0x1')];this['ecm']=_0x2b6022[_0xfca9('0x2')];this['headerinfo']=_0x2b6022[_0xfca9('0x3')];this[_0xfca9('0x4')]=_0x2b6022[_0xfca9('0x4')];this[_0xfca9('0x5')]=_0x2b6022[_0xfca9('0x5')]||0x960;this['maxrate']=_0x2b6022[_0xfca9('0x6')]||0x3840;this['modem']=_0x2b6022[_0xfca9('0x7')]||_0xfca9('0x8');this[_0xfca9('0x9')]=_0x2b6022[_0xfca9('0x9')]||'no';this[_0xfca9('0xa')]=_0x2b6022['faxdetect']||'no';this['t38timeout']=_0x2b6022['t38timeout']||0x1388;this[_0xfca9('0xb')]=_0x2b6022['tech']||_0xfca9('0xc');this[_0xfca9('0xd')]=_0x2b6022['Trunk']?_0x2b6022[_0xfca9('0xd')]:undefined;this['ListId']=_0x2b6022[_0xfca9('0xe')];this[_0xfca9('0xf')]=_0x2b6022[_0xfca9('0xf')];}module[_0xfca9('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x9b13=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x9b13,0xa3));var _0x39b1=function(_0x41eac9,_0xf3e312){_0x41eac9=_0x41eac9-0x0;var _0x549f4a=_0x9b13[_0x41eac9];return _0x549f4a;};'use strict';function FaxAccount(_0x55e924){this['id']=_0x55e924['id']||0x0;this[_0x39b1('0x0')]=_0x55e924[_0x39b1('0x0')]||'';this['description']=_0x55e924[_0x39b1('0x1')];this[_0x39b1('0x2')]=_0x55e924[_0x39b1('0x2')];this[_0x39b1('0x3')]=_0x55e924[_0x39b1('0x3')];this[_0x39b1('0x4')]=_0x55e924[_0x39b1('0x4')];this['minrate']=_0x55e924[_0x39b1('0x5')]||0x960;this[_0x39b1('0x6')]=_0x55e924[_0x39b1('0x6')]||0x3840;this[_0x39b1('0x7')]=_0x55e924[_0x39b1('0x7')]||_0x39b1('0x8');this['gateway']=_0x55e924[_0x39b1('0x9')]||'no';this[_0x39b1('0xa')]=_0x55e924[_0x39b1('0xa')]||'no';this[_0x39b1('0xb')]=_0x55e924[_0x39b1('0xb')]||0x1388;this['tech']=_0x55e924[_0x39b1('0xc')]||_0x39b1('0xd');this['Trunk']=_0x55e924[_0x39b1('0xe')]?_0x55e924[_0x39b1('0xe')]:undefined;this['ListId']=_0x55e924[_0x39b1('0xf')];this[_0x39b1('0x10')]=_0x55e924[_0x39b1('0x10')];}module[_0x39b1('0x11')]=FaxAccount;
\ No newline at end of file
index b9f6abc..70d191f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fd4=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x53451c,_0x49865a){var _0x3e5599=function(_0x402dcf){while(--_0x402dcf){_0x53451c['push'](_0x53451c['shift']());}};_0x3e5599(++_0x49865a);}(_0x3fd4,0x7d));var _0x43fd=function(_0x207da0,_0x361e27){_0x207da0=_0x207da0-0x0;var _0x518951=_0x3fd4[_0x207da0];return _0x518951;};'use strict';function FreshdeskAccount(_0x4d6e9c){this['id']=_0x4d6e9c['id']||0x0;this[_0x43fd('0x0')]=_0x4d6e9c['name']||'';this['username']=_0x4d6e9c[_0x43fd('0x1')]||'';this[_0x43fd('0x2')]=_0x4d6e9c[_0x43fd('0x3')]||'';this[_0x43fd('0x4')]=_0x4d6e9c[_0x43fd('0x4')]||'';this[_0x43fd('0x5')]=_0x4d6e9c['serverUrl']||'';this['Configurations']=_0x4d6e9c[_0x43fd('0x6')]||{};}module[_0x43fd('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0xb7e0=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x6acde0,_0x497054){var _0x112c59=function(_0x3cb757){while(--_0x3cb757){_0x6acde0['push'](_0x6acde0['shift']());}};_0x112c59(++_0x497054);}(_0xb7e0,0xc9));var _0x0b7e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb7e0[_0x3b380d];return _0x54502b;};'use strict';function FreshdeskAccount(_0x4dfa30){this['id']=_0x4dfa30['id']||0x0;this['name']=_0x4dfa30[_0x0b7e('0x0')]||'';this[_0x0b7e('0x1')]=_0x4dfa30[_0x0b7e('0x1')]||'';this[_0x0b7e('0x2')]=_0x4dfa30[_0x0b7e('0x3')]||'';this[_0x0b7e('0x4')]=_0x4dfa30['remoteUri']||'';this['serverUrl']=_0x4dfa30[_0x0b7e('0x5')]||'';this['Configurations']=_0x4dfa30[_0x0b7e('0x6')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 6d12e5f..5a2d6d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd0=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x521a45,_0x5734bd){var _0x25dfa4=function(_0x4bc47f){while(--_0x4bc47f){_0x521a45['push'](_0x521a45['shift']());}};_0x25dfa4(++_0x5734bd);}(_0x2cd0,0x8a));var _0x02cd=function(_0x43f4c8,_0x22a037){_0x43f4c8=_0x43f4c8-0x0;var _0x3a2e0c=_0x2cd0[_0x43f4c8];return _0x3a2e0c;};'use strict';function FreshsalesAccount(_0x1c8e0f){this['id']=_0x1c8e0f['id']||0x0;this[_0x02cd('0x0')]=_0x1c8e0f['name']||'';this['username']=_0x1c8e0f[_0x02cd('0x1')]||'';this['apiKey']=_0x1c8e0f['token']||'';this[_0x02cd('0x2')]=_0x1c8e0f[_0x02cd('0x2')]||'';this[_0x02cd('0x3')]=_0x1c8e0f[_0x02cd('0x3')]||'';this[_0x02cd('0x4')]=_0x1c8e0f[_0x02cd('0x4')]||{};}module[_0x02cd('0x5')]=FreshsalesAccount;
\ No newline at end of file
+var _0x06bf=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0x06bf,0x105));var _0xf06b=function(_0x42f3a8,_0x55681a){_0x42f3a8=_0x42f3a8-0x0;var _0x1cd493=_0x06bf[_0x42f3a8];return _0x1cd493;};'use strict';function FreshsalesAccount(_0x86e28f){this['id']=_0x86e28f['id']||0x0;this[_0xf06b('0x0')]=_0x86e28f[_0xf06b('0x0')]||'';this[_0xf06b('0x1')]=_0x86e28f[_0xf06b('0x1')]||'';this[_0xf06b('0x2')]=_0x86e28f[_0xf06b('0x3')]||'';this[_0xf06b('0x4')]=_0x86e28f['remoteUri']||'';this[_0xf06b('0x5')]=_0x86e28f[_0xf06b('0x5')]||'';this[_0xf06b('0x6')]=_0x86e28f['Configurations']||{};}module[_0xf06b('0x7')]=FreshsalesAccount;
\ No newline at end of file
index ea887ab..fec7f54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf5e=['position','count','queuecallerabandon','originalposition','channel','connectedlinenum','accountcode','exten','holdtime','assigned','motionChannel','voice','routealias','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt'];(function(_0x5784ad,_0xd8bb32){var _0x4d2d60=function(_0x191e7d){while(--_0x191e7d){_0x5784ad['push'](_0x5784ad['shift']());}};_0x4d2d60(++_0xd8bb32);}(_0xdf5e,0xeb));var _0xedf5=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0xdf5e[_0x34b87f];return _0x449805;};'use strict';function QueueReport(){this[_0xedf5('0x0')]=_0xedf5('0x1');this[_0xedf5('0x2')]='';this[_0xedf5('0x3')]='';this[_0xedf5('0x4')]='';this[_0xedf5('0x5')]='';this[_0xedf5('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xedf5('0x7')]=0x1;this[_0xedf5('0x8')]=0x1;this[_0xedf5('0x9')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xedf5('0xa')]=0x1;this[_0xedf5('0xb')]='';this[_0xedf5('0xc')]='';this['connectedlinename']='';this[_0xedf5('0xd')]='';this['context']='';this[_0xedf5('0xe')]='';this['priority']='';this[_0xedf5('0xf')]=0x0;this[_0xedf5('0x10')]=![];this['lastAssignedTo']='';this[_0xedf5('0x11')]=_0xedf5('0x12');this[_0xedf5('0x13')]=null;this[_0xedf5('0x14')]=0x0;this['variables']={};}module[_0xedf5('0x15')]=QueueReport;
\ No newline at end of file
+var _0x024f=['mohtime','variables','exports','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','motionChannel','voice','routealias'];(function(_0x1f38c6,_0x428650){var _0x259367=function(_0x22bad0){while(--_0x22bad0){_0x1f38c6['push'](_0x1f38c6['shift']());}};_0x259367(++_0x428650);}(_0x024f,0xfd));var _0xf024=function(_0x259788,_0x3a80db){_0x259788=_0x259788-0x0;var _0x3a0c8c=_0x024f[_0x259788];return _0x3a0c8c;};'use strict';function QueueReport(){this['type']=_0xf024('0x0');this['uniqueid']='';this[_0xf024('0x1')]='';this[_0xf024('0x2')]='';this[_0xf024('0x3')]='';this[_0xf024('0x4')]=null;this[_0xf024('0x5')]=null;this[_0xf024('0x6')]=0x1;this[_0xf024('0x7')]=0x1;this[_0xf024('0x8')]=![];this[_0xf024('0x9')]=null;this[_0xf024('0xa')]=![];this[_0xf024('0xb')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xf024('0xc')]=0x1;this['channel']='';this[_0xf024('0xd')]='';this[_0xf024('0xe')]='';this[_0xf024('0xf')]='';this[_0xf024('0x10')]='';this['exten']='';this[_0xf024('0x11')]='';this[_0xf024('0x12')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xf024('0x13')]=_0xf024('0x14');this[_0xf024('0x15')]=null;this[_0xf024('0x16')]=0x0;this[_0xf024('0x17')]={};}module[_0xf024('0x18')]=QueueReport;
\ No newline at end of file
index 2e64fd1..0be1fd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c90=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x43fbc0,_0x1350a4){var _0x535c37=function(_0x5d4aff){while(--_0x5d4aff){_0x43fbc0['push'](_0x43fbc0['shift']());}};_0x535c37(++_0x1350a4);}(_0x1c90,0x188));var _0x01c9=function(_0x43bfea,_0xb5f861){_0x43bfea=_0x43bfea-0x0;var _0x1c26be=_0x1c90[_0x43bfea];return _0x1c26be;};'use strict';function SalesforceAccount(_0x42fdf8){this['id']=_0x42fdf8['id']||0x0;this['name']=_0x42fdf8[_0x01c9('0x0')]||'';this['username']=_0x42fdf8[_0x01c9('0x1')]||'';this[_0x01c9('0x2')]=_0x42fdf8[_0x01c9('0x2')]||'';this[_0x01c9('0x3')]=_0x42fdf8[_0x01c9('0x3')]||'';this[_0x01c9('0x4')]=_0x42fdf8[_0x01c9('0x4')]||'';this[_0x01c9('0x5')]=_0x42fdf8[_0x01c9('0x5')]||'';this[_0x01c9('0x6')]=_0x42fdf8[_0x01c9('0x6')]||'';this['type']=_0x42fdf8[_0x01c9('0x7')]||_0x01c9('0x8');this[_0x01c9('0x9')]=_0x42fdf8[_0x01c9('0x9')]||'';this[_0x01c9('0xa')]=_0x42fdf8['Configurations']||{};}module[_0x01c9('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0xa3a4=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','Configurations'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xa3a4,0x6e));var _0x4a3a=function(_0xcc4519,_0x13073f){_0xcc4519=_0xcc4519-0x0;var _0x1232b4=_0xa3a4[_0xcc4519];return _0x1232b4;};'use strict';function SalesforceAccount(_0x17e9c4){this['id']=_0x17e9c4['id']||0x0;this[_0x4a3a('0x0')]=_0x17e9c4[_0x4a3a('0x0')]||'';this[_0x4a3a('0x1')]=_0x17e9c4['username']||'';this[_0x4a3a('0x2')]=_0x17e9c4[_0x4a3a('0x2')]||'';this[_0x4a3a('0x3')]=_0x17e9c4[_0x4a3a('0x3')]||'';this['clientId']=_0x17e9c4[_0x4a3a('0x4')]||'';this[_0x4a3a('0x5')]=_0x17e9c4['clientSecret']||'';this['securityToken']=_0x17e9c4[_0x4a3a('0x6')]||'';this['type']=_0x17e9c4[_0x4a3a('0x7')]||_0x4a3a('0x8');this['serverUrl']=_0x17e9c4['serverUrl']||'';this[_0x4a3a('0x9')]=_0x17e9c4[_0x4a3a('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index cc740f3..2bb6247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae7=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x4830b6,_0x3162e0){var _0x4113f8=function(_0x4cc536){while(--_0x4cc536){_0x4830b6['push'](_0x4830b6['shift']());}};_0x4113f8(++_0x3162e0);}(_0xeae7,0x1a4));var _0x7eae=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xeae7[_0xc6be3a];return _0x56a310;};'use strict';function ServicenowAccount(_0x8b2248){this['id']=_0x8b2248['id']||0x0;this[_0x7eae('0x0')]=_0x8b2248[_0x7eae('0x0')]||'';this[_0x7eae('0x1')]=_0x8b2248[_0x7eae('0x1')]||'';this[_0x7eae('0x2')]=_0x8b2248['password']||'';this['remoteUri']=_0x8b2248[_0x7eae('0x3')]||'';this[_0x7eae('0x4')]=_0x8b2248['serverUrl']||'';this['Configurations']=_0x8b2248['Configurations']||{};}module[_0x7eae('0x5')]=ServicenowAccount;
\ No newline at end of file
+var _0x0eae=['password','serverUrl','Configurations','name','username'];(function(_0x2ecbfd,_0x5bacbc){var _0x2c65a2=function(_0x569338){while(--_0x569338){_0x2ecbfd['push'](_0x2ecbfd['shift']());}};_0x2c65a2(++_0x5bacbc);}(_0x0eae,0x1c5));var _0xe0ea=function(_0x4ad6e4,_0x103161){_0x4ad6e4=_0x4ad6e4-0x0;var _0x11e62a=_0x0eae[_0x4ad6e4];return _0x11e62a;};'use strict';function ServicenowAccount(_0x4f6c31){this['id']=_0x4f6c31['id']||0x0;this['name']=_0x4f6c31[_0xe0ea('0x0')]||'';this[_0xe0ea('0x1')]=_0x4f6c31[_0xe0ea('0x1')]||'';this[_0xe0ea('0x2')]=_0x4f6c31[_0xe0ea('0x2')]||'';this['remoteUri']=_0x4f6c31['remoteUri']||'';this[_0xe0ea('0x3')]=_0x4f6c31['serverUrl']||'';this[_0xe0ea('0x4')]=_0x4f6c31[_0xe0ea('0x4')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
index e24cba6..4c6dd53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a00=['username','password','remoteUri','serverUrl','Configurations'];(function(_0x146998,_0x18d2f1){var _0x26978f=function(_0x4dafc8){while(--_0x4dafc8){_0x146998['push'](_0x146998['shift']());}};_0x26978f(++_0x18d2f1);}(_0x3a00,0x64));var _0x03a0=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x3a00[_0x25e7cb];return _0x375d92;};'use strict';function SugarcrmAccount(_0x574f5f){this['id']=_0x574f5f['id']||0x0;this['name']=_0x574f5f['name']||'';this[_0x03a0('0x0')]=_0x574f5f[_0x03a0('0x0')]||'';this[_0x03a0('0x1')]=_0x574f5f['password']||'';this[_0x03a0('0x2')]=_0x574f5f[_0x03a0('0x2')]||'';this[_0x03a0('0x3')]=_0x574f5f[_0x03a0('0x3')]||'';this[_0x03a0('0x4')]=_0x574f5f[_0x03a0('0x4')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0xe214=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4a9ed8,_0x2327eb){var _0x96fe73=function(_0x39e937){while(--_0x39e937){_0x4a9ed8['push'](_0x4a9ed8['shift']());}};_0x96fe73(++_0x2327eb);}(_0xe214,0x11e));var _0x4e21=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe214[_0x502c7d];return _0x30b7ed;};'use strict';function SugarcrmAccount(_0x3fd633){this['id']=_0x3fd633['id']||0x0;this[_0x4e21('0x0')]=_0x3fd633[_0x4e21('0x0')]||'';this[_0x4e21('0x1')]=_0x3fd633[_0x4e21('0x1')]||'';this['password']=_0x3fd633['password']||'';this[_0x4e21('0x2')]=_0x3fd633[_0x4e21('0x2')]||'';this[_0x4e21('0x3')]=_0x3fd633[_0x4e21('0x3')]||'';this[_0x4e21('0x4')]=_0x3fd633['Configurations']||{};}module[_0x4e21('0x5')]=SugarcrmAccount;
\ No newline at end of file
index c91b0d1..c428e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e7b=['exports','name','accountcode','unknown','stateTime','status'];(function(_0x428340,_0x551314){var _0x3e5ae6=function(_0x1b38de){while(--_0x1b38de){_0x428340['push'](_0x428340['shift']());}};_0x3e5ae6(++_0x551314);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1e7b[_0x501510];return _0x1e6ee5;};'use strict';function Telephone(_0x5627ff){this['id']=_0x5627ff['id']||0x0;this[_0xb1e7('0x0')]=_0x5627ff['name']||'';this[_0xb1e7('0x1')]=_0x5627ff[_0xb1e7('0x1')]||'';this['state']=_0xb1e7('0x2');this[_0xb1e7('0x3')]=0x0;this[_0xb1e7('0x4')]=_0xb1e7('0x2');this['address']='';}module[_0xb1e7('0x5')]=Telephone;
\ No newline at end of file
+var _0x0b2f=['status','unknown','exports','name','accountcode'];(function(_0x33929d,_0x56c88f){var _0x32cab7=function(_0x5d66e5){while(--_0x5d66e5){_0x33929d['push'](_0x33929d['shift']());}};_0x32cab7(++_0x56c88f);}(_0x0b2f,0x1f2));var _0xf0b2=function(_0x1bcfec,_0x4a6cdb){_0x1bcfec=_0x1bcfec-0x0;var _0x115615=_0x0b2f[_0x1bcfec];return _0x115615;};'use strict';function Telephone(_0x3696ff){this['id']=_0x3696ff['id']||0x0;this['name']=_0x3696ff[_0xf0b2('0x0')]||'';this[_0xf0b2('0x1')]=_0x3696ff[_0xf0b2('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xf0b2('0x2')]=_0xf0b2('0x3');this['address']='';}module[_0xf0b2('0x4')]=Telephone;
\ No newline at end of file
index a87b156..2de61e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0xdc09c0,_0x2de323){var _0x144a12=function(_0x775a24){while(--_0x775a24){_0xdc09c0['push'](_0xdc09c0['shift']());}};_0x144a12(++_0x2de323);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xb10b=['name','html'];(function(_0x3b4b5d,_0x859408){var _0x152722=function(_0x4b35e8){while(--_0x4b35e8){_0x3b4b5d['push'](_0x3b4b5d['shift']());}};_0x152722(++_0x859408);}(_0xb10b,0x12a));var _0xbb10=function(_0x454f02,_0x32ce79){_0x454f02=_0x454f02-0x0;var _0x3369f7=_0xb10b[_0x454f02];return _0x3369f7;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
index 12458eb..7b87de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x6b4173,_0x33679b){var _0x39a374=function(_0x183944){while(--_0x183944){_0x6b4173['push'](_0x6b4173['shift']());}};_0x39a374(++_0x33679b);}(_0x4fc2,0x111));var _0x24fc=function(_0x58eb93,_0x3b8263){_0x58eb93=_0x58eb93-0x0;var _0xc0d5c0=_0x4fc2[_0x58eb93];return _0xc0d5c0;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x26adbc,_0x3054f3){var _0x8b9afc=function(_0x45bbdc){while(--_0x45bbdc){_0x26adbc['push'](_0x26adbc['shift']());}};_0x8b9afc(++_0x3054f3);}(_0x2032,0xd9));var _0x2203=function(_0x464bcd,_0xb62f25){_0x464bcd=_0x464bcd-0x0;var _0x790e03=_0x2032[_0x464bcd];return _0x790e03;};'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
index 14c3723..a461658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d48=['host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime','registry','indexOf','split'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x0d48,0x1a8));var _0x80d4=function(_0x35009a,_0x4c647b){_0x35009a=_0x35009a-0x0;var _0x41ae8a=_0x0d48[_0x35009a];return _0x41ae8a;};'use strict';function Trunk(_0x599ead){this['id']=_0x599ead['id']||0x0;this[_0x80d4('0x0')]=_0x599ead[_0x80d4('0x0')]||![];this[_0x80d4('0x1')]=_0x599ead[_0x80d4('0x1')]||'';this[_0x80d4('0x2')]=_0x80d4('0x3');this[_0x80d4('0x4')]=0x0;this['status']=_0x80d4('0x3');this[_0x80d4('0x5')]=_0x599ead[_0x80d4('0x5')]&&_0x599ead[_0x80d4('0x5')][_0x80d4('0x6')](':')?_0x599ead[_0x80d4('0x5')][_0x80d4('0x7')](':')[0x0]:'';this[_0x80d4('0x8')]='';this[_0x80d4('0x9')]='';this[_0x80d4('0xa')]='';this[_0x80d4('0xb')]='';this[_0x80d4('0xc')]='';this[_0x80d4('0xd')]='unknown';this[_0x80d4('0xe')]='';this['address']='';this[_0x80d4('0xf')]=_0x599ead[_0x80d4('0xf')]||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0xdc09=['address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x21dcea,_0x36bfd3){var _0x180d54=function(_0x44bf7d){while(--_0x44bf7d){_0x21dcea['push'](_0x21dcea['shift']());}};_0x180d54(++_0x36bfd3);}(_0xdc09,0x111));var _0x9dc0=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xdc09[_0x11e05d];return _0x335588;};'use strict';function Trunk(_0x7441a2){this['id']=_0x7441a2['id']||0x0;this[_0x9dc0('0x0')]=_0x7441a2['active']||![];this[_0x9dc0('0x1')]=_0x7441a2['name']||'';this[_0x9dc0('0x2')]='unknown';this[_0x9dc0('0x3')]=0x0;this[_0x9dc0('0x4')]=_0x9dc0('0x5');this[_0x9dc0('0x6')]=_0x7441a2['registry']&&_0x7441a2[_0x9dc0('0x6')]['indexOf'](':')?_0x7441a2['registry'][_0x9dc0('0x7')](':')[0x0]:'';this[_0x9dc0('0x8')]='';this[_0x9dc0('0x9')]='';this[_0x9dc0('0xa')]='';this[_0x9dc0('0xb')]='';this[_0x9dc0('0xc')]='';this[_0x9dc0('0xd')]=_0x9dc0('0x5');this[_0x9dc0('0xe')]='';this[_0x9dc0('0xf')]='';this[_0x9dc0('0x10')]=_0x7441a2[_0x9dc0('0x10')]||'';}module[_0x9dc0('0x11')]=Trunk;
\ No newline at end of file
index f91e751..68f4b95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a8=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x29a8,0x13a));var _0x829a=function(_0x56503a,_0x1c4b81){_0x56503a=_0x56503a-0x0;var _0x52e0d4=_0x29a8[_0x56503a];return _0x52e0d4;};'use strict';function voiceExtension(_0x159b33){this['id']=_0x159b33['id']||0x0;this[_0x829a('0x0')]=_0x159b33[_0x829a('0x0')]||'';this[_0x829a('0x1')]=_0x159b33[_0x829a('0x1')]||_0x829a('0x2');this[_0x829a('0x3')]=_0x159b33['mandatoryDisposition']||![];}module[_0x829a('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x0b88=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x154a72,_0x51e82d){var _0x4222a8=function(_0x58b44c){while(--_0x58b44c){_0x154a72['push'](_0x154a72['shift']());}};_0x4222a8(++_0x51e82d);}(_0x0b88,0x85));var _0x80b8=function(_0x1821f1,_0x52e9cb){_0x1821f1=_0x1821f1-0x0;var _0x55ad4f=_0x0b88[_0x1821f1];return _0x55ad4f;};'use strict';function voiceExtension(_0x1ebb47){this['id']=_0x1ebb47['id']||0x0;this['exten']=_0x1ebb47[_0x80b8('0x0')]||'';this[_0x80b8('0x1')]=_0x1ebb47[_0x80b8('0x1')]||_0x80b8('0x2');this[_0x80b8('0x3')]=_0x1ebb47[_0x80b8('0x3')]||![];}module[_0x80b8('0x4')]=voiceExtension;
\ No newline at end of file
index 29019b2..edbf209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c4d=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','linear','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','invalid','loggedIn','notInUse','paused','talking','unavailable','unknown','acw','acwTimeout','sendMessageOneNotActive','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','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x11f18f,_0x1b436b){_0x11f18f=_0x11f18f-0x0;var _0x153bd6=_0x1c4d[_0x11f18f];return _0x153bd6;};'use strict';var monitorFormat={'wav':_0xd1c4('0x0'),'wav49':_0xd1c4('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xd1c4('0x2'),'leastrecent':'leastrecent','linear':_0xd1c4('0x3'),'random':'random','ringall':_0xd1c4('0x4'),'rr':_0xd1c4('0x5'),'rrmemory':'rrmemory','rrordered':_0xd1c4('0x6'),'wrandom':_0xd1c4('0x7')};function VoiceQueue(_0x49a148){this['id']=_0x49a148['id']||0x0;this[_0xd1c4('0x8')]=_0x49a148[_0xd1c4('0x8')]||'';this[_0xd1c4('0x9')]=_0x49a148[_0xd1c4('0x9')]||'';this[_0xd1c4('0xa')]=_0x49a148[_0xd1c4('0xa')]||'inbound';this[_0xd1c4('0xb')]=0x0;this[_0xd1c4('0xc')]=0x0;this[_0xd1c4('0xd')]=0x0;this[_0xd1c4('0xe')]=0x0;this[_0xd1c4('0xf')]=0x0;this[_0xd1c4('0x10')]=0x0;this['unmanaged']=0x0;this[_0xd1c4('0x11')]=0x0;this[_0xd1c4('0x12')]=0x0;this['busy']=0x0;this['inUse']=0x0;this[_0xd1c4('0x13')]=0x0;this[_0xd1c4('0x14')]=0x0;this[_0xd1c4('0x15')]=0x0;this['onHold']=0x0;this[_0xd1c4('0x16')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0xd1c4('0x17')]=0x0;this[_0xd1c4('0x18')]=0x0;this[_0xd1c4('0x19')]=0x0;this['acw']=_0x49a148[_0xd1c4('0x1a')]||![];this[_0xd1c4('0x1b')]=_0x49a148[_0xd1c4('0x1b')]||0xa;this['autopause']=_0x49a148['autopause']||'no';this[_0xd1c4('0x1c')]=!![];this['message']='';this[_0xd1c4('0x1d')]=0x0;this[_0xd1c4('0x1e')]=0x0;this['dialTimezone']=_0x49a148[_0xd1c4('0x1f')]||null;this[_0xd1c4('0x20')]=_0x49a148['dialGlobalInterval']?_0x49a148[_0xd1c4('0x20')]:null;this[_0xd1c4('0x21')]=_0x49a148['dialActive'];this['dialMethod']=_0x49a148[_0xd1c4('0x22')]||_0xd1c4('0x23');this[_0xd1c4('0x24')]=_0x49a148[_0xd1c4('0x24')]||0x0;this[_0xd1c4('0x25')]=_0x49a148['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x49a148[_0xd1c4('0x26')]||0x1;this[_0xd1c4('0x27')]=_0x49a148[_0xd1c4('0x27')]||_0xd1c4('0x28');this[_0xd1c4('0x29')]=_0x49a148[_0xd1c4('0x29')]||0.03;this[_0xd1c4('0x2a')]=_0x49a148[_0xd1c4('0x2a')]||0x258;this[_0xd1c4('0x2b')]=_0x49a148[_0xd1c4('0x2b')]||_0xd1c4('0x2c');this[_0xd1c4('0x2d')]=_0x49a148[_0xd1c4('0x2d')]||_0xd1c4('0x2c');this[_0xd1c4('0x2e')]=_0x49a148[_0xd1c4('0x2e')]||0x1e;this[_0xd1c4('0x2f')]=_0x49a148[_0xd1c4('0x2f')]||_0xd1c4('0x30');this[_0xd1c4('0x31')]=_0x49a148[_0xd1c4('0x31')]||0x3;this[_0xd1c4('0x32')]=_0x49a148['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x49a148[_0xd1c4('0x33')]||0x3;this['dialCongestionRetryFrequency']=_0x49a148['dialCongestionRetryFrequency']||0x96;this[_0xd1c4('0x34')]=_0x49a148[_0xd1c4('0x34')]||0x3;this[_0xd1c4('0x35')]=_0x49a148[_0xd1c4('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0x49a148[_0xd1c4('0x36')]||0x3;this['dialNoAnswerRetryFrequency']=_0x49a148[_0xd1c4('0x37')]||0x96;this[_0xd1c4('0x38')]=_0x49a148[_0xd1c4('0x38')]||0x3;this[_0xd1c4('0x39')]=_0x49a148[_0xd1c4('0x39')]||0x96;this[_0xd1c4('0x3a')]=_0x49a148[_0xd1c4('0x3a')]||0x3;this['dialDropRetryFrequency']=_0x49a148[_0xd1c4('0x3b')]||0x96;this['dialAbandonedMaxRetry']=_0x49a148[_0xd1c4('0x3c')]||0x3;this[_0xd1c4('0x3d')]=_0x49a148[_0xd1c4('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x49a148['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x49a148[_0xd1c4('0x3e')]||0x96;this[_0xd1c4('0x3f')]=_0x49a148[_0xd1c4('0x3f')]||0x3;this[_0xd1c4('0x40')]=_0x49a148[_0xd1c4('0x40')]||0x96;this['callAdditionalPhoneAfterMin']=_0x49a148[_0xd1c4('0x41')]||0x3;this[_0xd1c4('0x42')]=_0x49a148['dialGlobalMaxRetry']||0x4;this[_0xd1c4('0x43')]=_0x49a148[_0xd1c4('0x43')]?_0x49a148[_0xd1c4('0x43')]:undefined;this[_0xd1c4('0x44')]=_0x49a148['TrunkBackup']?_0x49a148[_0xd1c4('0x44')]:undefined;this[_0xd1c4('0x45')]=_0x49a148[_0xd1c4('0x45')]||undefined;this['Interval']=_0x49a148[_0xd1c4('0x46')]?_0x49a148[_0xd1c4('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x49a148[_0xd1c4('0x47')]||'DESC';this[_0xd1c4('0x48')]=_0x49a148[_0xd1c4('0x48')]||undefined;this['dialCutDigit']=_0x49a148[_0xd1c4('0x49')]||undefined;this[_0xd1c4('0x4a')]=strategy[_0x49a148['strategy']];this[_0xd1c4('0x4b')]=!![];this['dialAMDActive']=_0x49a148['dialAMDActive']||![];this[_0xd1c4('0x4c')]=_0x49a148['dialAMDInitialSilence'];this[_0xd1c4('0x4d')]=_0x49a148['dialAMDGreeting'];this[_0xd1c4('0x4e')]=_0x49a148[_0xd1c4('0x4e')];this['dialAMDTotalAnalysisTime']=_0x49a148['dialAMDTotalAnalysisTime'];this[_0xd1c4('0x4f')]=_0x49a148[_0xd1c4('0x4f')];this[_0xd1c4('0x50')]=_0x49a148[_0xd1c4('0x50')];this[_0xd1c4('0x51')]=_0x49a148[_0xd1c4('0x51')];this[_0xd1c4('0x52')]=_0x49a148[_0xd1c4('0x52')];this['dialAMDMaximumWordLength']=_0x49a148[_0xd1c4('0x53')];this[_0xd1c4('0x54')]=0x0;this[_0xd1c4('0x55')]=0x0;this[_0xd1c4('0x56')]=_0x49a148[_0xd1c4('0x56')];this[_0xd1c4('0x57')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xd1c4('0x58')]=0x0;this[_0xd1c4('0x59')]=0x0;this[_0xd1c4('0x5a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd1c4('0x5b')]=0x0;this[_0xd1c4('0x5c')]=0x0;this[_0xd1c4('0x5d')]=0x0;this[_0xd1c4('0x5e')]=0x0;this[_0xd1c4('0x5f')]=0x0;this[_0xd1c4('0x60')]=0x0;this[_0xd1c4('0x61')]=0x0;this['startProgressive']=undefined;this[_0xd1c4('0x62')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xd1c4('0x63')]=0x0;this[_0xd1c4('0x64')]=0x0;this[_0xd1c4('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xd1c4('0x66')]=0x0;this[_0xd1c4('0x67')]=0x0;this[_0xd1c4('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x49a148[_0xd1c4('0x69')]||0x14;this[_0xd1c4('0x6a')]=_0x49a148['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xd1c4('0x6b')]=0x0;this[_0xd1c4('0x6c')]=0x0;this[_0xd1c4('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0xd1c4('0x6e')]=0x0;this[_0xd1c4('0x6f')]=0x0;this[_0xd1c4('0x70')]=0x0;this[_0xd1c4('0x71')]=_0x49a148[_0xd1c4('0x71')]||0x1e;this['dialRecallInQueue']=_0x49a148[_0xd1c4('0x72')]||![];this['dialPreviewAutoRecallMe']=!!_0x49a148['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x49a148[_0xd1c4('0x73')]||![];this[_0xd1c4('0x74')]=_0x49a148[_0xd1c4('0x74')]||undefined;this[_0xd1c4('0x75')]=_0x49a148[_0xd1c4('0x75')]||![];this[_0xd1c4('0x76')]=_0x49a148[_0xd1c4('0x76')]||![];this['monitor_format']=monitorFormat[_0x49a148[_0xd1c4('0x9')]]?monitorFormat[_0x49a148[_0xd1c4('0x9')]]:undefined;this[_0xd1c4('0x77')]=_0x49a148[_0xd1c4('0x77')]||![];this[_0xd1c4('0x78')]=_0x49a148[_0xd1c4('0x78')]?_0x49a148[_0xd1c4('0x78')]:undefined;this[_0xd1c4('0x79')]=![];}module[_0xd1c4('0x7a')]=VoiceQueue;
\ No newline at end of file
+var _0x44aa=['dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','gsm','leastrecent','linear','random','rrmemory','rrordered','monitor_format','type','inbound','waiting','total','sumDuration','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x44aa,0x1e8));var _0xa44a=function(_0x2b4ff3,_0x194423){_0x2b4ff3=_0x2b4ff3-0x0;var _0x4eb967=_0x44aa[_0x2b4ff3];return _0x4eb967;};'use strict';var monitorFormat={'wav':_0xa44a('0x0'),'wav49':'wav49','gsm':_0xa44a('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xa44a('0x2'),'linear':_0xa44a('0x3'),'random':_0xa44a('0x4'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0xa44a('0x5'),'rrordered':_0xa44a('0x6'),'wrandom':'wrandom'};function VoiceQueue(_0x2b822d){this['id']=_0x2b822d['id']||0x0;this['name']=_0x2b822d['name']||'';this[_0xa44a('0x7')]=_0x2b822d[_0xa44a('0x7')]||'';this[_0xa44a('0x8')]=_0x2b822d[_0xa44a('0x8')]||_0xa44a('0x9');this[_0xa44a('0xa')]=0x0;this[_0xa44a('0xb')]=0x0;this['answered']=0x0;this[_0xa44a('0xc')]=0x0;this['sumHoldTime']=0x0;this[_0xa44a('0xd')]=0x0;this[_0xa44a('0xe')]=0x0;this[_0xa44a('0xf')]=0x0;this[_0xa44a('0x10')]=0x0;this[_0xa44a('0x11')]=0x0;this[_0xa44a('0x12')]=0x0;this[_0xa44a('0x13')]=0x0;this[_0xa44a('0x14')]=0x0;this[_0xa44a('0x15')]=0x0;this['onHold']=0x0;this[_0xa44a('0x16')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0xa44a('0x17')]=0x0;this[_0xa44a('0x18')]=0x0;this[_0xa44a('0x19')]=_0x2b822d[_0xa44a('0x19')]||![];this[_0xa44a('0x1a')]=_0x2b822d[_0xa44a('0x1a')]||0xa;this[_0xa44a('0x1b')]=_0x2b822d[_0xa44a('0x1b')]||'no';this[_0xa44a('0x1c')]=!![];this[_0xa44a('0x1d')]='';this['originated']=0x0;this[_0xa44a('0x1e')]=0x0;this['dialTimezone']=_0x2b822d[_0xa44a('0x1f')]||null;this[_0xa44a('0x20')]=_0x2b822d[_0xa44a('0x20')]?_0x2b822d[_0xa44a('0x20')]:null;this[_0xa44a('0x21')]=_0x2b822d[_0xa44a('0x21')];this['dialMethod']=_0x2b822d[_0xa44a('0x22')]||_0xa44a('0x23');this['dialLimitChannel']=_0x2b822d['dialLimitChannel']||0x0;this[_0xa44a('0x24')]=_0x2b822d[_0xa44a('0x24')]||0x0;this['dialPowerLevel']=_0x2b822d[_0xa44a('0x25')]||0x1;this['dialPredictiveOptimization']=_0x2b822d[_0xa44a('0x26')]||_0xa44a('0x27');this[_0xa44a('0x28')]=_0x2b822d[_0xa44a('0x28')]||0.03;this['dialPredictiveInterval']=_0x2b822d[_0xa44a('0x29')]||0x258;this[_0xa44a('0x2a')]=_0x2b822d['dialOriginateCallerIdName']||_0xa44a('0x2b');this[_0xa44a('0x2c')]=_0x2b822d[_0xa44a('0x2c')]||'anonymous';this[_0xa44a('0x2d')]=_0x2b822d[_0xa44a('0x2d')]||0x1e;this[_0xa44a('0x2e')]=_0x2b822d[_0xa44a('0x2e')]||'tTxX';this['dialQueueTimeout']=_0x2b822d[_0xa44a('0x2f')]||0x3;this['dialQueueProject']=_0x2b822d[_0xa44a('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x2b822d['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x2b822d[_0xa44a('0x31')]||0x96;this[_0xa44a('0x32')]=_0x2b822d[_0xa44a('0x32')]||0x3;this[_0xa44a('0x33')]=_0x2b822d[_0xa44a('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x2b822d[_0xa44a('0x34')]||0x3;this[_0xa44a('0x35')]=_0x2b822d['dialNoAnswerRetryFrequency']||0x96;this[_0xa44a('0x36')]=_0x2b822d[_0xa44a('0x36')]||0x3;this[_0xa44a('0x37')]=_0x2b822d[_0xa44a('0x37')]||0x96;this[_0xa44a('0x38')]=_0x2b822d[_0xa44a('0x38')]||0x3;this[_0xa44a('0x39')]=_0x2b822d['dialDropRetryFrequency']||0x96;this[_0xa44a('0x3a')]=_0x2b822d[_0xa44a('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x2b822d['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2b822d['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x2b822d['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x2b822d['dialAgentRejectMaxRetry']||0x3;this[_0xa44a('0x3b')]=_0x2b822d[_0xa44a('0x3b')]||0x96;this[_0xa44a('0x3c')]=_0x2b822d['callAdditionalPhoneAfterMin']||0x3;this[_0xa44a('0x3d')]=_0x2b822d[_0xa44a('0x3d')]||0x4;this[_0xa44a('0x3e')]=_0x2b822d[_0xa44a('0x3e')]?_0x2b822d[_0xa44a('0x3e')]:undefined;this['TrunkBackup']=_0x2b822d[_0xa44a('0x3f')]?_0x2b822d[_0xa44a('0x3f')]:undefined;this['dialPrefix']=_0x2b822d[_0xa44a('0x40')]||undefined;this[_0xa44a('0x41')]=_0x2b822d[_0xa44a('0x41')]?_0x2b822d[_0xa44a('0x41')]:undefined;this[_0xa44a('0x42')]=_0x2b822d[_0xa44a('0x42')]||_0xa44a('0x43');this[_0xa44a('0x44')]=_0x2b822d[_0xa44a('0x44')]||undefined;this[_0xa44a('0x45')]=_0x2b822d[_0xa44a('0x45')]||undefined;this[_0xa44a('0x46')]=strategy[_0x2b822d[_0xa44a('0x46')]];this[_0xa44a('0x47')]=!![];this['dialAMDActive']=_0x2b822d[_0xa44a('0x48')]||![];this['dialAMDInitialSilence']=_0x2b822d['dialAMDInitialSilence'];this[_0xa44a('0x49')]=_0x2b822d[_0xa44a('0x49')];this[_0xa44a('0x4a')]=_0x2b822d[_0xa44a('0x4a')];this[_0xa44a('0x4b')]=_0x2b822d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2b822d[_0xa44a('0x4c')];this[_0xa44a('0x4d')]=_0x2b822d['dialAMDBetweenWordsSilence'];this[_0xa44a('0x4e')]=_0x2b822d['dialAMDMaximumNumberOfWords'];this[_0xa44a('0x4f')]=_0x2b822d[_0xa44a('0x4f')];this['dialAMDMaximumWordLength']=_0x2b822d[_0xa44a('0x50')];this[_0xa44a('0x51')]=0x0;this[_0xa44a('0x52')]=0x0;this[_0xa44a('0x53')]=_0x2b822d['timeout'];this[_0xa44a('0x54')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xa44a('0x55')]=0x0;this[_0xa44a('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xa44a('0x57')]=0x0;this[_0xa44a('0x58')]=0x0;this[_0xa44a('0x59')]=0x0;this[_0xa44a('0x5a')]=0x0;this[_0xa44a('0x5b')]=0x0;this[_0xa44a('0x5c')]=0x0;this[_0xa44a('0x5d')]=0x0;this[_0xa44a('0x5e')]=0x0;this[_0xa44a('0x5f')]=undefined;this[_0xa44a('0x60')]=undefined;this[_0xa44a('0x61')]=undefined;this[_0xa44a('0x62')]=1.05;this[_0xa44a('0x63')]=0x0;this[_0xa44a('0x64')]=0x0;this[_0xa44a('0x65')]=0x0;this[_0xa44a('0x66')]=0x0;this[_0xa44a('0x67')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x2b822d[_0xa44a('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x2b822d[_0xa44a('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa44a('0x69')]=0x0;this[_0xa44a('0x6a')]=0x1;this[_0xa44a('0x6b')]=0x0;this[_0xa44a('0x6c')]=0x0;this[_0xa44a('0x6d')]=0x0;this['erlangBusyFactor']=0x0;this[_0xa44a('0x6e')]=_0x2b822d[_0xa44a('0x6e')]||0x1e;this[_0xa44a('0x6f')]=_0x2b822d['dialRecallInQueue']||![];this[_0xa44a('0x70')]=!!_0x2b822d[_0xa44a('0x70')]||![];this['dialPreviewRecallmeReminder']=!!_0x2b822d[_0xa44a('0x71')]||![];this['dialQueueProject2']=_0x2b822d[_0xa44a('0x72')]||undefined;this[_0xa44a('0x73')]=_0x2b822d[_0xa44a('0x73')]||![];this[_0xa44a('0x74')]=_0x2b822d[_0xa44a('0x74')]||![];this[_0xa44a('0x7')]=monitorFormat[_0x2b822d[_0xa44a('0x7')]]?monitorFormat[_0x2b822d[_0xa44a('0x7')]]:undefined;this[_0xa44a('0x75')]=_0x2b822d[_0xa44a('0x75')]||![];this[_0xa44a('0x76')]=_0x2b822d[_0xa44a('0x76')]?_0x2b822d[_0xa44a('0x76')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0xa44a('0x77')]=VoiceQueue;
\ No newline at end of file
index 14ce2a4..ee4e1ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb3=['createReport','inUse','loggedin','callers','length','online','includes','status','booked','queue','dialer','exten','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','outboundAbandonedCallsDay','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','originated','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','total','name','strategy','abandoned','available','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid'];(function(_0x11f511,_0x534bf1){var _0x54c909=function(_0x1da6a6){while(--_0x1da6a6){_0x11f511['push'](_0x11f511['shift']());}};_0x54c909(++_0x534bf1);}(_0xcdb3,0x1ca));var _0x3cdb=function(_0x596c0c,_0x7e200){_0x596c0c=_0x596c0c-0x0;var _0x244a9c=_0xcdb3[_0x596c0c];return _0x244a9c;};'use strict';var INBOUND_COUNTERS=['available',_0x3cdb('0x0'),_0x3cdb('0x1'),_0x3cdb('0x2'),_0x3cdb('0x3'),_0x3cdb('0x4'),_0x3cdb('0x5')];var OUTBOUND_COUNTERS=['available',_0x3cdb('0x6'),'inUse',_0x3cdb('0x0'),_0x3cdb('0x1'),_0x3cdb('0x7'),'outboundAbandonedCallsDay',_0x3cdb('0x8'),'outboundBlacklistCallsDay',_0x3cdb('0x9'),_0x3cdb('0xa'),_0x3cdb('0xb'),_0x3cdb('0xc'),_0x3cdb('0xd'),_0x3cdb('0xe'),_0x3cdb('0xf'),_0x3cdb('0x2'),'pTalking',_0x3cdb('0x4'),_0x3cdb('0x10'),'sumDuration',_0x3cdb('0x11'),_0x3cdb('0x5')];function VoiceQueueSummary(_0x24d231){this['id']=_0x24d231['id'];this[_0x3cdb('0x12')]=_0x24d231[_0x3cdb('0x12')];this[_0x3cdb('0x13')]=_0x24d231[_0x3cdb('0x13')];this['abandoned']=_0x24d231[_0x3cdb('0x14')]||0x0;this[_0x3cdb('0x6')]=_0x24d231[_0x3cdb('0x6')]||0x0;this[_0x3cdb('0x15')]=_0x24d231[_0x3cdb('0x15')]||0x0;this[_0x3cdb('0x16')]=_0x24d231['busy']||0x0;this['inUse']=_0x24d231['inUse']||0x0;this[_0x3cdb('0x17')]=_0x24d231[_0x3cdb('0x17')]||0x0;this[_0x3cdb('0x0')]=_0x24d231['loggedIn']||0x0;this[_0x3cdb('0x1')]=_0x24d231[_0x3cdb('0x1')]||0x0;this[_0x3cdb('0x18')]=_0x24d231[_0x3cdb('0x18')]||0x0;this[_0x3cdb('0x19')]=_0x24d231[_0x3cdb('0x19')]||0x0;this[_0x3cdb('0x2')]=_0x24d231[_0x3cdb('0x2')]||0x0;this[_0x3cdb('0x3')]=_0x24d231['ringing']||0x0;this[_0x3cdb('0x1a')]=_0x24d231[_0x3cdb('0x1a')];this[_0x3cdb('0x10')]=_0x24d231[_0x3cdb('0x10')];this[_0x3cdb('0x1b')]=_0x24d231[_0x3cdb('0x1b')];this[_0x3cdb('0x1c')]=_0x24d231[_0x3cdb('0x1c')]||0x0;this['talking']=_0x24d231['talking']||0x0;this[_0x3cdb('0x11')]=_0x24d231['total']||0x0;this[_0x3cdb('0x1d')]=_0x24d231[_0x3cdb('0x1d')];this[_0x3cdb('0x1e')]=_0x24d231[_0x3cdb('0x1e')]||0x0;this['unknown']=_0x24d231[_0x3cdb('0x1f')]||0x0;this[_0x3cdb('0x20')]=_0x24d231[_0x3cdb('0x20')]||0x0;this[_0x3cdb('0x5')]=_0x24d231[_0x3cdb('0x5')]||0x0;if(_0x24d231[_0x3cdb('0x1d')]===_0x3cdb('0x21')){this[_0x3cdb('0x22')]=_0x24d231[_0x3cdb('0x22')]||0x0;this['dialActive']=_0x24d231[_0x3cdb('0x23')];this[_0x3cdb('0x24')]=_0x24d231[_0x3cdb('0x24')];this[_0x3cdb('0x25')]=_0x24d231[_0x3cdb('0x25')];this['dialOriginateCallerIdNumber']=_0x24d231[_0x3cdb('0x26')];this[_0x3cdb('0x27')]=_0x24d231[_0x3cdb('0x27')];this[_0x3cdb('0x28')]=_0x24d231[_0x3cdb('0x28')];this[_0x3cdb('0x29')]=_0x24d231['temp'];this[_0x3cdb('0x2a')]=_0x24d231[_0x3cdb('0x2a')];this[_0x3cdb('0x8')]=_0x24d231['outboundAnswerCallsDay'];this[_0x3cdb('0x2b')]=_0x24d231[_0x3cdb('0x2b')];this[_0x3cdb('0x9')]=_0x24d231[_0x3cdb('0x9')];this[_0x3cdb('0xa')]=_0x24d231[_0x3cdb('0xa')];this[_0x3cdb('0x2c')]=_0x24d231[_0x3cdb('0x2c')];this['outboundDropCallsDayCallersExit']=_0x24d231[_0x3cdb('0x2d')];this[_0x3cdb('0x2e')]=_0x24d231[_0x3cdb('0x2e')];this[_0x3cdb('0xb')]=_0x24d231[_0x3cdb('0xb')];this['outboundNoSuchCallsDay']=_0x24d231[_0x3cdb('0xc')];this[_0x3cdb('0x2f')]=_0x24d231[_0x3cdb('0x2f')];this['outboundReCallsDay']=_0x24d231['outboundReCallsDay'];this[_0x3cdb('0xe')]=_0x24d231[_0x3cdb('0xe')];this[_0x3cdb('0xf')]=_0x24d231[_0x3cdb('0xf')];this[_0x3cdb('0x30')]=_0x24d231['predictiveIntervalAnsweredCalls'];this[_0x3cdb('0x31')]=_0x24d231[_0x3cdb('0x31')];this[_0x3cdb('0x32')]=_0x24d231[_0x3cdb('0x32')];this[_0x3cdb('0x33')]=_0x24d231[_0x3cdb('0x33')];this[_0x3cdb('0x34')]=_0x24d231['predictiveIntervalDroppedCallsTimeout'];this[_0x3cdb('0x35')]=_0x24d231[_0x3cdb('0x35')];this[_0x3cdb('0x36')]=_0x24d231[_0x3cdb('0x36')];this[_0x3cdb('0x37')]=_0x24d231[_0x3cdb('0x37')];this[_0x3cdb('0x38')]=_0x24d231[_0x3cdb('0x38')];this[_0x3cdb('0x39')]=_0x24d231[_0x3cdb('0x39')];this[_0x3cdb('0x3a')]=_0x24d231[_0x3cdb('0x3a')];this[_0x3cdb('0x3b')]=_0x24d231['predictiveIntervalTotalCalls'];this[_0x3cdb('0x3c')]=_0x24d231['message'];this[_0x3cdb('0x7')]=_0x24d231[_0x3cdb('0x7')];this[_0x3cdb('0x3d')]=_0x24d231[_0x3cdb('0x3d')];this[_0x3cdb('0x3e')]=_0x24d231[_0x3cdb('0x3e')];this[_0x3cdb('0x3f')]=_0x24d231[_0x3cdb('0x3f')];this[_0x3cdb('0x40')]=_0x24d231[_0x3cdb('0x40')];this[_0x3cdb('0x41')]=_0x24d231['startPredictive'];this['startProgressive']=_0x24d231[_0x3cdb('0x42')];}if(_0x24d231[_0x3cdb('0x43')]){this['Trunk']={'id':_0x24d231[_0x3cdb('0x43')]['id'],'name':_0x24d231['Trunk']['name'],'active':_0x24d231[_0x3cdb('0x43')][_0x3cdb('0x44')],'callerid':_0x24d231['Trunk'][_0x3cdb('0x45')]};}}VoiceQueueSummary['prototype'][_0x3cdb('0x46')]=function(_0x378968,_0x5c0152,_0x705603,_0x4f9a8a){this[_0x3cdb('0x1')]=0x0;this[_0x3cdb('0x4')]=0x0;this[_0x3cdb('0x2')]=0x0;this[_0x3cdb('0x1f')]=0x0;this[_0x3cdb('0x19')]=0x0;this[_0x3cdb('0x47')]=0x0;this['busy']=0x0;this[_0x3cdb('0x17')]=0x0;this[_0x3cdb('0x1e')]=0x0;this[_0x3cdb('0x3')]=0x0;this[_0x3cdb('0x1a')]=0x0;this[_0x3cdb('0x18')]=0x0;if(_0x705603){if(_0x705603[_0x3cdb('0x15')]){this['available']=Number(_0x705603[_0x3cdb('0x15')]);}if(_0x705603['loggedin']){this['loggedIn']=Number(_0x705603[_0x3cdb('0x48')]);}if(_0x705603[_0x3cdb('0x49')]){this[_0x3cdb('0x5')]=Number(_0x705603[_0x3cdb('0x49')]);}}for(var _0x5b33d2=0x0;_0x5b33d2<_0x378968[_0x3cdb('0x4a')];_0x5b33d2++){var _0x5f05e6=_0x5c0152['SIP/'+_0x378968[_0x5b33d2]['name']];if(_0x5f05e6&&_0x5f05e6[_0x3cdb('0x4b')]){this[_0x3cdb('0x1')]+=0x1;}if(_0x378968[_0x5b33d2]['incall']==='1'){this[_0x3cdb('0x4')]+=0x1;}if(_0x378968[_0x5b33d2][_0x3cdb('0x2')]==='1'&&!['2','7','8'][_0x3cdb('0x4c')](_0x378968[_0x5b33d2][_0x3cdb('0x4d')])){this[_0x3cdb('0x2')]+=0x1;}switch(_0x378968[_0x5b33d2][_0x3cdb('0x4d')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x3cdb('0x19')]+=0x1;break;case'2':this[_0x3cdb('0x47')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x3cdb('0x17')]+=0x1;break;case'5':this[_0x3cdb('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x3cdb('0x1a')]+=0x1;break;case'8':this[_0x3cdb('0x18')]+=0x1;break;}}if(this[_0x3cdb('0x24')]===_0x3cdb('0x4e')){var _0x399c5a=Object['keys'](_0x4f9a8a);for(var _0x22d5cf=0x0;_0x22d5cf<_0x399c5a[_0x3cdb('0x4a')];_0x22d5cf++){var _0x332180=_0x399c5a[_0x22d5cf];var _0x279331=_0x4f9a8a[_0x332180];if(_0x279331[_0x3cdb('0x4f')]===this[_0x3cdb('0x12')]&&_0x279331[_0x3cdb('0x6')]&&_0x279331[_0x3cdb('0x1d')]===_0x3cdb('0x50')&&_0x279331[_0x3cdb('0x51')]===_0x3cdb('0x52')){this[_0x3cdb('0x4')]+=0x1;}}}return this;};VoiceQueueSummary[_0x3cdb('0x53')][_0x3cdb('0x54')]=function(_0x23499f){var _0x23e299=![];if(_0x23499f){_0x23e299=INBOUND_COUNTERS[_0x3cdb('0x55')](function(_0x162c19){return this[_0x162c19]!==_0x23499f[_0x162c19];},this);}return _0x23e299;};VoiceQueueSummary[_0x3cdb('0x53')][_0x3cdb('0x56')]=function(_0x16d4e0){var _0x2a0ea8=![];var _0x50aefb=![];var _0x59b5eb=![];if(_0x16d4e0){_0x2a0ea8=this[_0x3cdb('0x24')]!==_0x16d4e0[_0x3cdb('0x24')]||this[_0x3cdb('0x23')]!==_0x16d4e0[_0x3cdb('0x23')]||this[_0x3cdb('0x3c')]!==_0x16d4e0['message'];_0x50aefb=OUTBOUND_COUNTERS[_0x3cdb('0x55')](function(_0x1a3cdb){return this[_0x1a3cdb]!==_0x16d4e0[_0x1a3cdb];},this);if(this[_0x3cdb('0x43')]&&_0x16d4e0[_0x3cdb('0x43')]){_0x59b5eb=this[_0x3cdb('0x43')][_0x3cdb('0x12')]!==_0x16d4e0[_0x3cdb('0x43')][_0x3cdb('0x12')]||this['Trunk']['active']!==_0x16d4e0[_0x3cdb('0x43')][_0x3cdb('0x44')];}}return _0x2a0ea8||_0x50aefb||_0x59b5eb;};VoiceQueueSummary[_0x3cdb('0x53')]['updateReportFromOutboundQueue']=function(_0x236c67){this[_0x3cdb('0x6')]=_0x236c67[_0x3cdb('0x6')];this[_0x3cdb('0x3c')]=_0x236c67['message'];this[_0x3cdb('0x7')]=_0x236c67['originated'];this[_0x3cdb('0x57')]=_0x236c67[_0x3cdb('0x57')];this[_0x3cdb('0x8')]=_0x236c67[_0x3cdb('0x8')];this[_0x3cdb('0x2b')]=_0x236c67[_0x3cdb('0x2b')];this['outboundBusyCallsDay']=_0x236c67[_0x3cdb('0x9')];this[_0x3cdb('0xa')]=_0x236c67[_0x3cdb('0xa')];this[_0x3cdb('0xb')]=_0x236c67['outboundNoAnswerCallsDay'];this[_0x3cdb('0xc')]=_0x236c67[_0x3cdb('0xc')];this['outboundReCallsDay']=_0x236c67[_0x3cdb('0xd')];this[_0x3cdb('0xe')]=_0x236c67[_0x3cdb('0xe')];this[_0x3cdb('0xf')]=_0x236c67['outboundUnknownCallsDay'];this[_0x3cdb('0x22')]=_0x236c67[_0x3cdb('0x22')];this[_0x3cdb('0x10')]=_0x236c67[_0x3cdb('0x10')];this[_0x3cdb('0x1b')]=_0x236c67[_0x3cdb('0x1b')];this[_0x3cdb('0x11')]=_0x236c67['total'];};module['exports']=VoiceQueueSummary;
\ No newline at end of file
+var _0xbae6=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','createReport','loggedin','callers','length','SIP/','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','prototype','some','compareToOutboundQueue','updateReportFromOutboundQueue','exports','available','loggedIn','loggedInDb','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumBillable','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls'];(function(_0x21a8b7,_0x58d34c){var _0x3cebec=function(_0x181801){while(--_0x181801){_0x21a8b7['push'](_0x21a8b7['shift']());}};_0x3cebec(++_0x58d34c);}(_0xbae6,0xcd));var _0x6bae=function(_0x2179ba,_0x1848e2){_0x2179ba=_0x2179ba-0x0;var _0x516f1=_0xbae6[_0x2179ba];return _0x516f1;};'use strict';var INBOUND_COUNTERS=[_0x6bae('0x0'),_0x6bae('0x1'),_0x6bae('0x2'),'paused','ringing',_0x6bae('0x3'),_0x6bae('0x4')];var OUTBOUND_COUNTERS=[_0x6bae('0x0'),_0x6bae('0x5'),_0x6bae('0x6'),_0x6bae('0x1'),_0x6bae('0x2'),_0x6bae('0x7'),_0x6bae('0x8'),_0x6bae('0x9'),_0x6bae('0xa'),_0x6bae('0xb'),_0x6bae('0xc'),_0x6bae('0xd'),'outboundNoSuchCallsDay',_0x6bae('0xe'),_0x6bae('0xf'),'outboundUnknownCallsDay',_0x6bae('0x10'),_0x6bae('0x11'),'talking','sumBillable',_0x6bae('0x12'),'total',_0x6bae('0x4')];function VoiceQueueSummary(_0x264d24){this['id']=_0x264d24['id'];this[_0x6bae('0x13')]=_0x264d24['name'];this[_0x6bae('0x14')]=_0x264d24[_0x6bae('0x14')];this[_0x6bae('0x15')]=_0x264d24[_0x6bae('0x15')]||0x0;this[_0x6bae('0x5')]=_0x264d24[_0x6bae('0x5')]||0x0;this['available']=_0x264d24[_0x6bae('0x0')]||0x0;this[_0x6bae('0x16')]=_0x264d24['busy']||0x0;this[_0x6bae('0x6')]=_0x264d24[_0x6bae('0x6')]||0x0;this[_0x6bae('0x17')]=_0x264d24[_0x6bae('0x17')]||0x0;this['loggedIn']=_0x264d24[_0x6bae('0x1')]||0x0;this[_0x6bae('0x2')]=_0x264d24['loggedInDb']||0x0;this[_0x6bae('0x18')]=_0x264d24[_0x6bae('0x18')]||0x0;this[_0x6bae('0x19')]=_0x264d24[_0x6bae('0x19')]||0x0;this[_0x6bae('0x10')]=_0x264d24[_0x6bae('0x10')]||0x0;this[_0x6bae('0x1a')]=_0x264d24[_0x6bae('0x1a')]||0x0;this[_0x6bae('0x1b')]=_0x264d24[_0x6bae('0x1b')];this[_0x6bae('0x1c')]=_0x264d24['sumBillable'];this[_0x6bae('0x12')]=_0x264d24[_0x6bae('0x12')];this[_0x6bae('0x1d')]=_0x264d24[_0x6bae('0x1d')]||0x0;this[_0x6bae('0x3')]=_0x264d24[_0x6bae('0x3')]||0x0;this[_0x6bae('0x1e')]=_0x264d24[_0x6bae('0x1e')]||0x0;this[_0x6bae('0x1f')]=_0x264d24[_0x6bae('0x1f')];this[_0x6bae('0x20')]=_0x264d24[_0x6bae('0x20')]||0x0;this[_0x6bae('0x21')]=_0x264d24['unknown']||0x0;this['unmanaged']=_0x264d24[_0x6bae('0x22')]||0x0;this[_0x6bae('0x4')]=_0x264d24[_0x6bae('0x4')]||0x0;if(_0x264d24[_0x6bae('0x1f')]===_0x6bae('0x23')){this[_0x6bae('0x11')]=_0x264d24['pTalking']||0x0;this[_0x6bae('0x24')]=_0x264d24[_0x6bae('0x24')];this[_0x6bae('0x25')]=_0x264d24[_0x6bae('0x25')];this[_0x6bae('0x26')]=_0x264d24['dialOriginateCallerIdName'];this[_0x6bae('0x27')]=_0x264d24[_0x6bae('0x27')];this['dialOriginateTimeout']=_0x264d24[_0x6bae('0x28')];this['dialPrefix']=_0x264d24[_0x6bae('0x29')];this[_0x6bae('0x2a')]=_0x264d24['temp'];this['outboundAnswerAgiCallsDay']=_0x264d24['outboundAnswerAgiCallsDay'];this[_0x6bae('0x9')]=_0x264d24['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x264d24['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x264d24[_0x6bae('0xb')];this['outboundCongestionCallsDay']=_0x264d24[_0x6bae('0xc')];this[_0x6bae('0x2b')]=_0x264d24[_0x6bae('0x2b')];this[_0x6bae('0x2c')]=_0x264d24[_0x6bae('0x2c')];this[_0x6bae('0x2d')]=_0x264d24['outboundDropCallsDayTimeout'];this[_0x6bae('0xd')]=_0x264d24[_0x6bae('0xd')];this[_0x6bae('0x2e')]=_0x264d24[_0x6bae('0x2e')];this[_0x6bae('0x2f')]=_0x264d24[_0x6bae('0x2f')];this[_0x6bae('0xe')]=_0x264d24['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x264d24[_0x6bae('0xf')];this[_0x6bae('0x30')]=_0x264d24[_0x6bae('0x30')];this[_0x6bae('0x31')]=_0x264d24[_0x6bae('0x31')];this[_0x6bae('0x32')]=_0x264d24[_0x6bae('0x32')];this[_0x6bae('0x33')]=_0x264d24[_0x6bae('0x33')];this[_0x6bae('0x34')]=_0x264d24['predictiveIntervalDroppedCallsCallersExit'];this[_0x6bae('0x35')]=_0x264d24[_0x6bae('0x35')];this[_0x6bae('0x36')]=_0x264d24['predictiveIntervalErlangCalls'];this[_0x6bae('0x37')]=_0x264d24[_0x6bae('0x37')];this[_0x6bae('0x38')]=_0x264d24[_0x6bae('0x38')];this[_0x6bae('0x39')]=_0x264d24[_0x6bae('0x39')];this['predictiveIntervalPauses']=_0x264d24['predictiveIntervalPauses'];this[_0x6bae('0x3a')]=_0x264d24['predictiveIntervalAvailable'];this[_0x6bae('0x3b')]=_0x264d24['predictiveIntervalTotalCalls'];this[_0x6bae('0x3c')]=_0x264d24[_0x6bae('0x3c')];this[_0x6bae('0x7')]=_0x264d24[_0x6bae('0x7')];this[_0x6bae('0x3d')]=_0x264d24[_0x6bae('0x3d')];this[_0x6bae('0x3e')]=_0x264d24[_0x6bae('0x3e')];this[_0x6bae('0x3f')]=_0x264d24[_0x6bae('0x3f')];this[_0x6bae('0x40')]=_0x264d24[_0x6bae('0x40')];this['startPredictive']=_0x264d24[_0x6bae('0x41')];this[_0x6bae('0x42')]=_0x264d24['startProgressive'];}if(_0x264d24[_0x6bae('0x43')]){this['Trunk']={'id':_0x264d24[_0x6bae('0x43')]['id'],'name':_0x264d24[_0x6bae('0x43')][_0x6bae('0x13')],'active':_0x264d24['Trunk'][_0x6bae('0x44')],'callerid':_0x264d24[_0x6bae('0x43')][_0x6bae('0x45')]};}}VoiceQueueSummary['prototype'][_0x6bae('0x46')]=function(_0xdada19,_0x30b732,_0x209441,_0x1b95f1){this[_0x6bae('0x2')]=0x0;this[_0x6bae('0x3')]=0x0;this[_0x6bae('0x10')]=0x0;this[_0x6bae('0x21')]=0x0;this[_0x6bae('0x19')]=0x0;this[_0x6bae('0x6')]=0x0;this[_0x6bae('0x16')]=0x0;this[_0x6bae('0x17')]=0x0;this['unavailable']=0x0;this[_0x6bae('0x1a')]=0x0;this[_0x6bae('0x1b')]=0x0;this[_0x6bae('0x18')]=0x0;if(_0x209441){if(_0x209441[_0x6bae('0x0')]){this[_0x6bae('0x0')]=Number(_0x209441[_0x6bae('0x0')]);}if(_0x209441[_0x6bae('0x47')]){this['loggedIn']=Number(_0x209441[_0x6bae('0x47')]);}if(_0x209441[_0x6bae('0x48')]){this['waiting']=Number(_0x209441[_0x6bae('0x48')]);}}for(var _0x4740f3=0x0;_0x4740f3<_0xdada19[_0x6bae('0x49')];_0x4740f3++){var _0x45c355=_0x30b732[_0x6bae('0x4a')+_0xdada19[_0x4740f3]['name']];if(_0x45c355&&_0x45c355['online']){this[_0x6bae('0x2')]+=0x1;}if(_0xdada19[_0x4740f3][_0x6bae('0x4b')]==='1'){this[_0x6bae('0x3')]+=0x1;}if(_0xdada19[_0x4740f3][_0x6bae('0x10')]==='1'&&!['2','7','8'][_0x6bae('0x4c')](_0xdada19[_0x4740f3]['status'])){this[_0x6bae('0x10')]+=0x1;}switch(_0xdada19[_0x4740f3][_0x6bae('0x4d')]){case'0':this[_0x6bae('0x21')]+=0x1;break;case'1':this[_0x6bae('0x19')]+=0x1;break;case'2':this[_0x6bae('0x6')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x6bae('0x17')]+=0x1;break;case'5':this[_0x6bae('0x20')]+=0x1;break;case'6':this[_0x6bae('0x1a')]+=0x1;break;case'7':this[_0x6bae('0x1b')]+=0x1;break;case'8':this[_0x6bae('0x18')]+=0x1;break;}}if(this[_0x6bae('0x25')]===_0x6bae('0x4e')){var _0x53142d=Object[_0x6bae('0x4f')](_0x1b95f1);for(var _0x4a9eb3=0x0;_0x4a9eb3<_0x53142d[_0x6bae('0x49')];_0x4a9eb3++){var _0x219646=_0x53142d[_0x4a9eb3];var _0x16c56f=_0x1b95f1[_0x219646];if(_0x16c56f[_0x6bae('0x50')]===this[_0x6bae('0x13')]&&_0x16c56f[_0x6bae('0x5')]&&_0x16c56f['type']===_0x6bae('0x51')&&_0x16c56f[_0x6bae('0x52')]===_0x6bae('0x53')){this[_0x6bae('0x3')]+=0x1;}}}return this;};VoiceQueueSummary[_0x6bae('0x54')]['compareToInboundQueue']=function(_0x220824){var _0x5a070a=![];if(_0x220824){_0x5a070a=INBOUND_COUNTERS[_0x6bae('0x55')](function(_0x58288e){return this[_0x58288e]!==_0x220824[_0x58288e];},this);}return _0x5a070a;};VoiceQueueSummary[_0x6bae('0x54')][_0x6bae('0x56')]=function(_0x4166fc){var _0x6a85b7=![];var _0x4a276f=![];var _0x1f2217=![];if(_0x4166fc){_0x6a85b7=this['dialMethod']!==_0x4166fc[_0x6bae('0x25')]||this['dialActive']!==_0x4166fc[_0x6bae('0x24')]||this[_0x6bae('0x3c')]!==_0x4166fc['message'];_0x4a276f=OUTBOUND_COUNTERS['some'](function(_0x5d1259){return this[_0x5d1259]!==_0x4166fc[_0x5d1259];},this);if(this[_0x6bae('0x43')]&&_0x4166fc['Trunk']){_0x1f2217=this[_0x6bae('0x43')]['name']!==_0x4166fc[_0x6bae('0x43')]['name']||this[_0x6bae('0x43')][_0x6bae('0x44')]!==_0x4166fc[_0x6bae('0x43')][_0x6bae('0x44')];}}return _0x6a85b7||_0x4a276f||_0x1f2217;};VoiceQueueSummary[_0x6bae('0x54')][_0x6bae('0x57')]=function(_0x5c427b){this['answered']=_0x5c427b['answered'];this[_0x6bae('0x3c')]=_0x5c427b[_0x6bae('0x3c')];this[_0x6bae('0x7')]=_0x5c427b['originated'];this[_0x6bae('0x8')]=_0x5c427b[_0x6bae('0x8')];this[_0x6bae('0x9')]=_0x5c427b[_0x6bae('0x9')];this[_0x6bae('0xa')]=_0x5c427b[_0x6bae('0xa')];this['outboundBusyCallsDay']=_0x5c427b['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x5c427b['outboundCongestionCallsDay'];this[_0x6bae('0xd')]=_0x5c427b[_0x6bae('0xd')];this[_0x6bae('0x2e')]=_0x5c427b[_0x6bae('0x2e')];this[_0x6bae('0xe')]=_0x5c427b[_0x6bae('0xe')];this['outboundRejectCallsDay']=_0x5c427b[_0x6bae('0xf')];this[_0x6bae('0x30')]=_0x5c427b[_0x6bae('0x30')];this[_0x6bae('0x11')]=_0x5c427b['pTalking'];this['sumBillable']=_0x5c427b[_0x6bae('0x1c')];this[_0x6bae('0x12')]=_0x5c427b[_0x6bae('0x12')];this[_0x6bae('0x1e')]=_0x5c427b[_0x6bae('0x1e')];};module[_0x6bae('0x58')]=VoiceQueueSummary;
\ No newline at end of file
index 546ce81..ff9250d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0094=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x47c558,_0x2c9f29){var _0x1180cc=function(_0x415070){while(--_0x415070){_0x47c558['push'](_0x47c558['shift']());}};_0x1180cc(++_0x2c9f29);}(_0x0094,0x161));var _0x4009=function(_0x58864d,_0x42f8b7){_0x58864d=_0x58864d-0x0;var _0x490294=_0x0094[_0x58864d];return _0x490294;};'use strict';function VtigerAccount(_0x5efe48){this['id']=_0x5efe48['id']||0x0;this['name']=_0x5efe48[_0x4009('0x0')]||'';this[_0x4009('0x1')]=_0x5efe48[_0x4009('0x1')]||'';this[_0x4009('0x2')]=_0x5efe48[_0x4009('0x2')]||'';this[_0x4009('0x3')]=_0x5efe48[_0x4009('0x3')]||'';this[_0x4009('0x4')]=_0x5efe48[_0x4009('0x4')]||'';this[_0x4009('0x5')]=_0x5efe48[_0x4009('0x5')]||{};}module[_0x4009('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x1623=['serverUrl','Configurations','exports','username','accessKey','remoteUri'];(function(_0x46a010,_0x326d4e){var _0x1739e5=function(_0x3b1116){while(--_0x3b1116){_0x46a010['push'](_0x46a010['shift']());}};_0x1739e5(++_0x326d4e);}(_0x1623,0xab));var _0x3162=function(_0xe0c3e1,_0xf13e2d){_0xe0c3e1=_0xe0c3e1-0x0;var _0x52afba=_0x1623[_0xe0c3e1];return _0x52afba;};'use strict';function VtigerAccount(_0x452299){this['id']=_0x452299['id']||0x0;this['name']=_0x452299['name']||'';this[_0x3162('0x0')]=_0x452299[_0x3162('0x0')]||'';this[_0x3162('0x1')]=_0x452299[_0x3162('0x1')]||'';this[_0x3162('0x2')]=_0x452299['remoteUri']||'';this['serverUrl']=_0x452299[_0x3162('0x3')]||'';this['Configurations']=_0x452299[_0x3162('0x4')]||{};}module[_0x3162('0x5')]=VtigerAccount;
\ No newline at end of file
index d2175ff..175bf67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e2=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password','token'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc3e2,0x1b5));var _0x2c3e=function(_0x1c6739,_0x1a0c8f){_0x1c6739=_0x1c6739-0x0;var _0x261903=_0xc3e2[_0x1c6739];return _0x261903;};'use strict';function ZendeskAccount(_0x590dff){this['id']=_0x590dff['id']||0x0;this['name']=_0x590dff['name']||'';this[_0x2c3e('0x0')]=_0x590dff[_0x2c3e('0x0')]||'';this['password']=_0x590dff[_0x2c3e('0x1')]||'';this[_0x2c3e('0x2')]=_0x590dff['token']||'';this[_0x2c3e('0x3')]=_0x590dff[_0x2c3e('0x3')]||'';this[_0x2c3e('0x4')]=_0x590dff[_0x2c3e('0x4')]||'';this[_0x2c3e('0x5')]=_0x590dff['type']||_0x2c3e('0x6');this[_0x2c3e('0x7')]=_0x590dff['serverUrl']||'';this[_0x2c3e('0x8')]=_0x590dff[_0x2c3e('0x8')]||{};}module[_0x2c3e('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0x80d6=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x71f1f0,_0x2fc627){var _0x4fc4ff=function(_0x1dbbbe){while(--_0x1dbbbe){_0x71f1f0['push'](_0x71f1f0['shift']());}};_0x4fc4ff(++_0x2fc627);}(_0x80d6,0x1e7));var _0x680d=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x80d6[_0xe4bb3d];return _0xd9e51;};'use strict';function ZendeskAccount(_0x4bc8e3){this['id']=_0x4bc8e3['id']||0x0;this[_0x680d('0x0')]=_0x4bc8e3[_0x680d('0x0')]||'';this['username']=_0x4bc8e3[_0x680d('0x1')]||'';this[_0x680d('0x2')]=_0x4bc8e3['password']||'';this[_0x680d('0x3')]=_0x4bc8e3[_0x680d('0x3')]||'';this[_0x680d('0x4')]=_0x4bc8e3[_0x680d('0x4')]||'';this[_0x680d('0x5')]=_0x4bc8e3['authType']||'';this[_0x680d('0x6')]=_0x4bc8e3['type']||_0x680d('0x7');this[_0x680d('0x8')]=_0x4bc8e3[_0x680d('0x8')]||'';this[_0x680d('0x9')]=_0x4bc8e3[_0x680d('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index 6d5ba3d..d0545e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf45f=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name'];(function(_0x85a0c6,_0x39c27e){var _0x55db98=function(_0x44ff3c){while(--_0x44ff3c){_0x85a0c6['push'](_0x85a0c6['shift']());}};_0x55db98(++_0x39c27e);}(_0xf45f,0x1ad));var _0xff45=function(_0x3c40eb,_0x885e96){_0x3c40eb=_0x3c40eb-0x0;var _0x198f0c=_0xf45f[_0x3c40eb];return _0x198f0c;};'use strict';function ZohoAccount(_0x20e9fb){this['id']=_0x20e9fb['id']||0x0;this[_0xff45('0x0')]=_0x20e9fb[_0xff45('0x0')]||'';this[_0xff45('0x1')]=_0x20e9fb[_0xff45('0x1')]||'';this[_0xff45('0x2')]=_0x20e9fb[_0xff45('0x2')]||'';this[_0xff45('0x3')]=_0x20e9fb[_0xff45('0x3')]||'';this[_0xff45('0x4')]=_0x20e9fb[_0xff45('0x4')]||'';this[_0xff45('0x5')]=_0x20e9fb[_0xff45('0x5')]||'';this[_0xff45('0x6')]=_0x20e9fb[_0xff45('0x6')]||'';this[_0xff45('0x7')]=_0x20e9fb[_0xff45('0x7')]||'';this[_0xff45('0x8')]=_0x20e9fb['refreshToken']||'';this[_0xff45('0x9')]=_0x20e9fb[_0xff45('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x8261=['description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','name'];(function(_0x8ba5e9,_0x514d8a){var _0x514f48=function(_0x2da79c){while(--_0x2da79c){_0x8ba5e9['push'](_0x8ba5e9['shift']());}};_0x514f48(++_0x514d8a);}(_0x8261,0x86));var _0x1826=function(_0x1ac468,_0x4453df){_0x1ac468=_0x1ac468-0x0;var _0x245381=_0x8261[_0x1ac468];return _0x245381;};'use strict';function ZohoAccount(_0x7a1c77){this['id']=_0x7a1c77['id']||0x0;this[_0x1826('0x0')]=_0x7a1c77[_0x1826('0x0')]||'';this['description']=_0x7a1c77[_0x1826('0x1')]||'';this[_0x1826('0x2')]=_0x7a1c77['host']||'';this['zone']=_0x7a1c77[_0x1826('0x3')]||'';this[_0x1826('0x4')]=_0x7a1c77['clientId']||'';this['clientSecret']=_0x7a1c77['clientSecret']||'';this[_0x1826('0x5')]=_0x7a1c77[_0x1826('0x5')]||'';this['code']=_0x7a1c77[_0x1826('0x6')]||'';this[_0x1826('0x7')]=_0x7a1c77[_0x1826('0x7')]||'';this[_0x1826('0x8')]=_0x7a1c77['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index fe77148..4b434ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2e=['countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','calleridname','phone','Contact','firstName','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0xc1d834,_0xfa2d76){_0xc1d834=_0xc1d834-0x0;var _0x23f83b=_0x4e2e[_0xc1d834];return _0x23f83b;};'use strict';var util=require('util');var _=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));function checkNameSurname(_0x2ae450,_0x1b178f,_0x2041b9){var _0x4284bf='';if(!_['isNil'](_0x1b178f)&&_0xe4e2('0x2')===typeof _0x1b178f){_0x4284bf+=_0x1b178f;}if(!_[_0xe4e2('0x3')](_0x2041b9)&&_0xe4e2('0x2')===typeof _0x2041b9){_0x4284bf+='\x20'+_0x2041b9;}if(_0x4284bf!==''){return _0x4284bf;}return _0x2ae450;}function Action(_0x38c84c,_0x48e83d,_0x322295,_0x36b1c6,_0x1c4e64){this[_0xe4e2('0x4')]=_0x322295||undefined;this[_0xe4e2('0x5')]=_0x38c84c['id'];this[_0xe4e2('0x6')]=_0x48e83d[_0xe4e2('0x7')];this[_0xe4e2('0x8')]=_0x48e83d['type'];this[_0xe4e2('0x9')]=_0xe4e2('0x6');this[_0xe4e2('0xa')]=![];this['membername']=_[_0xe4e2('0x3')](_0x38c84c[_0xe4e2('0xb')])?undefined:_0x38c84c[_0xe4e2('0xb')][_0xe4e2('0x7')];this[_0xe4e2('0xc')]=this['membername']?util[_0xe4e2('0xd')](_0xe4e2('0xe'),this[_0xe4e2('0xf')]):_0x36b1c6||undefined;this[_0xe4e2('0x10')]=checkNameSurname(_0x38c84c['Contact'][_0xe4e2('0x11')],_0x38c84c[_0xe4e2('0x12')][_0xe4e2('0x13')],_0x38c84c[_0xe4e2('0x12')][_0xe4e2('0x14')]);this['active']=_0x38c84c['active']||![];this[_0xe4e2('0x15')]=_0x38c84c[_0xe4e2('0x11')];this[_0xe4e2('0x16')]=_0x38c84c[_0xe4e2('0x16')];this[_0xe4e2('0x17')]=_0x38c84c['countbusyretry']||0x0;this[_0xe4e2('0x18')]=_0x38c84c[_0xe4e2('0x18')]||0x0;this[_0xe4e2('0x19')]=_0x38c84c['countnoanswerretry']||0x0;this[_0xe4e2('0x1a')]=(_0x38c84c['countbusyretry']||0x0)+(_0x38c84c[_0xe4e2('0x18')]||0x0)+(_0x38c84c[_0xe4e2('0x19')]||0x0)+(_0x38c84c[_0xe4e2('0x1b')]||0x0)+(_0x38c84c[_0xe4e2('0x1c')]||0x0)+(_0x38c84c[_0xe4e2('0x1d')]||0x0)+(_0x38c84c[_0xe4e2('0x1e')]||0x0)+(_0x38c84c[_0xe4e2('0x1f')]||0x0);this[_0xe4e2('0x1b')]=_0x38c84c[_0xe4e2('0x1b')]||0x0;this[_0xe4e2('0x1c')]=_0x38c84c['countdropretry']||0x0;this[_0xe4e2('0x1d')]=_0x38c84c[_0xe4e2('0x1d')]||0x0;this[_0xe4e2('0x1e')]=_0x38c84c[_0xe4e2('0x1e')]||0x0;this[_0xe4e2('0x1f')]=_0x38c84c[_0xe4e2('0x1f')]||0x0;this[_0xe4e2('0x20')]=_0x38c84c['callback'];this[_0xe4e2('0x21')]=_0x38c84c[_0xe4e2('0x21')];this[_0xe4e2('0x22')]=_0x38c84c['callbackat'];this[_0xe4e2('0x23')]=_0x38c84c[_0xe4e2('0x23')];this['ContactId']=_0x38c84c[_0xe4e2('0x24')];this[_0xe4e2('0x25')]=_0x38c84c[_0xe4e2('0x25')];this[_0xe4e2('0x26')]=_[_0xe4e2('0x3')](_0x38c84c['Agent'])?_0x38c84c[_0xe4e2('0x26')]:_0x38c84c[_0xe4e2('0xb')]['id'];this[_0xe4e2('0x27')]=_0x38c84c['VoiceQueueId'];this[_0xe4e2('0x28')]='';this[_0xe4e2('0x29')]='';}Action[_0xe4e2('0x2a')]['getCaller']=function(){return util[_0xe4e2('0xd')]('\x22%s\x22\x20<%s>',this[_0xe4e2('0x10')],this[_0xe4e2('0x2b')]);};module['exports']=Action;
\ No newline at end of file
+var _0x896e=['Contact','phone','firstName','lastName','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','queue','membername','Agent','format','SIP/%s','calleridname'];(function(_0x503967,_0x1e4a6b){var _0x39340a=function(_0x12d12b){while(--_0x12d12b){_0x503967['push'](_0x503967['shift']());}};_0x39340a(++_0x1e4a6b);}(_0x896e,0x1e9));var _0xe896=function(_0x2e0411,_0x3a8dc6){_0x2e0411=_0x2e0411-0x0;var _0x401af9=_0x896e[_0x2e0411];return _0x401af9;};'use strict';var util=require(_0xe896('0x0'));var _=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));function checkNameSurname(_0x229b59,_0x36085e,_0x26d296){var _0x2af995='';if(!_[_0xe896('0x3')](_0x36085e)&&_0xe896('0x4')===typeof _0x36085e){_0x2af995+=_0x36085e;}if(!_[_0xe896('0x3')](_0x26d296)&&_0xe896('0x4')===typeof _0x26d296){_0x2af995+='\x20'+_0x26d296;}if(_0x2af995!==''){return _0x2af995;}return _0x229b59;}function Action(_0x318a7b,_0x52ac80,_0x24c430,_0x7a0721,_0x3b902c){this[_0xe896('0x5')]=_0x24c430||undefined;this[_0xe896('0x6')]=_0x318a7b['id'];this['queue']=_0x52ac80[_0xe896('0x7')];this[_0xe896('0x8')]=_0x52ac80[_0xe896('0x8')];this['campaigntype']=_0xe896('0x9');this['dialAnswer']=![];this[_0xe896('0xa')]=_['isNil'](_0x318a7b[_0xe896('0xb')])?undefined:_0x318a7b[_0xe896('0xb')][_0xe896('0x7')];this['channelAgent']=this[_0xe896('0xa')]?util[_0xe896('0xc')](_0xe896('0xd'),this['membername']):_0x7a0721||undefined;this[_0xe896('0xe')]=checkNameSurname(_0x318a7b[_0xe896('0xf')][_0xe896('0x10')],_0x318a7b['Contact'][_0xe896('0x11')],_0x318a7b[_0xe896('0xf')][_0xe896('0x12')]);this['active']=_0x318a7b['active']||![];this[_0xe896('0x13')]=_0x318a7b[_0xe896('0x10')];this['scheduledat']=_0x318a7b['scheduledat'];this[_0xe896('0x14')]=_0x318a7b[_0xe896('0x14')]||0x0;this['countcongestionretry']=_0x318a7b[_0xe896('0x15')]||0x0;this['countnoanswerretry']=_0x318a7b[_0xe896('0x16')]||0x0;this[_0xe896('0x17')]=(_0x318a7b[_0xe896('0x14')]||0x0)+(_0x318a7b['countcongestionretry']||0x0)+(_0x318a7b[_0xe896('0x16')]||0x0)+(_0x318a7b[_0xe896('0x18')]||0x0)+(_0x318a7b[_0xe896('0x19')]||0x0)+(_0x318a7b[_0xe896('0x1a')]||0x0)+(_0x318a7b[_0xe896('0x1b')]||0x0)+(_0x318a7b[_0xe896('0x1c')]||0x0);this[_0xe896('0x18')]=_0x318a7b[_0xe896('0x18')]||0x0;this['countdropretry']=_0x318a7b[_0xe896('0x19')]||0x0;this['countabandonedretry']=_0x318a7b['countabandonedretry']||0x0;this[_0xe896('0x1b')]=_0x318a7b[_0xe896('0x1b')]||0x0;this[_0xe896('0x1c')]=_0x318a7b[_0xe896('0x1c')]||0x0;this['callback']=_0x318a7b[_0xe896('0x1d')];this['callbackuniqueid']=_0x318a7b['callbackuniqueid'];this[_0xe896('0x1e')]=_0x318a7b[_0xe896('0x1e')];this[_0xe896('0x1f')]=_0x318a7b[_0xe896('0x1f')];this[_0xe896('0x20')]=_0x318a7b[_0xe896('0x20')];this[_0xe896('0x21')]=_0x318a7b['ListId'];this[_0xe896('0x22')]=_[_0xe896('0x3')](_0x318a7b[_0xe896('0xb')])?_0x318a7b['UserId']:_0x318a7b[_0xe896('0xb')]['id'];this[_0xe896('0x23')]=_0x318a7b[_0xe896('0x23')];this[_0xe896('0x24')]='';this[_0xe896('0x25')]='';}Action[_0xe896('0x26')]['getCaller']=function(){return util[_0xe896('0xc')](_0xe896('0x27'),this[_0xe896('0xe')],this[_0xe896('0x28')]);};module[_0xe896('0x29')]=Action;
\ No newline at end of file
index 3e15f62..e8a41f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','CAMPAIGN_STATUS','NO_AGENTS_LOGGED','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','answered','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','additional','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countbusyretry','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','verifyAdditionalPhones','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','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','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','syncNewExten','actionid','clone','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','INACTIVE','logger','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','dialActive','setMessage'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xf3cd[_0x521929];return _0x632436;};'use strict';var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var uuid=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var Redis=require(_0xdf3c('0x4'));var config=require(_0xdf3c('0x5'));var logger=require('../../../config/logger')(_0xdf3c('0x6'));var loggerAction=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var ami=require('../ami');var rpcDb=require(_0xdf3c('0x9'));var cmHopperAdditionalPhone=require(_0xdf3c('0xa'));var Action=require(_0xdf3c('0xb'));var ut=require(_0xdf3c('0xc'));var utils=require(_0xdf3c('0xd'));config[_0xdf3c('0xe')]=_['defaults'](config[_0xdf3c('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdf3c('0xe')]));var Sequence=function(){};Sequence[_0xdf3c('0xf')]['enqueue']=function(_0x1dba4c){this[_0xdf3c('0x10')]=this[_0xdf3c('0x10')]?this[_0xdf3c('0x10')][_0xdf3c('0x11')](_0x1dba4c):_0x1dba4c();};function Preview(_0x1c456b){this[_0xdf3c('0x12')]=new Sequence();this[_0xdf3c('0x13')]=_0x1c456b['voiceQueues'];this[_0xdf3c('0x14')]=_0x1c456b[_0xdf3c('0x14')];this[_0xdf3c('0x15')]={};this[_0xdf3c('0x16')]=_0x1c456b['agents'];this[_0xdf3c('0x17')]=0x0;ami['on'](_0xdf3c('0x18'),this[_0xdf3c('0x19')]['bind'](this));ami['on'](_0xdf3c('0x1a'),this[_0xdf3c('0x1b')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1d'),this[_0xdf3c('0x1e')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1f'),this[_0xdf3c('0x20')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x21'),this['syncNewExten'][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x22'),this[_0xdf3c('0x23')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x24'),this[_0xdf3c('0x25')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x26'),this[_0xdf3c('0x27')][_0xdf3c('0x1c')](this));this[_0xdf3c('0x28')](this[_0xdf3c('0x13')]);}function emit(_0x25487c,_0x5d2390,_0x4d620f){io['to'](_0x25487c)[_0xdf3c('0x29')](_0x5d2390,_0x4d620f);}function emitVoiceQueueChannelRemove(_0x583ce4){logger[_0xdf3c('0x2a')](_0xdf3c('0x2b'),JSON[_0xdf3c('0x2c')](_0x583ce4));emit(util[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x583ce4[_0xdf3c('0x2f')]),'voice_queue_channel:remove',_0x583ce4);io[_0xdf3c('0x29')](_0xdf3c('0x30'),_0x583ce4);}function notSendMessagesQueue(_0x13e3ca){if(_0x13e3ca[_0xdf3c('0x31')]){if(_0x13e3ca[_0xdf3c('0x32')]===0x0&&_0x13e3ca[_0xdf3c('0x33')]===0x0){_0x13e3ca[_0xdf3c('0x31')]=![];_0x13e3ca[_0xdf3c('0x34')]=0x0;_0x13e3ca[_0xdf3c('0x35')]=0x0;_0x13e3ca[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x37')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca[_0xdf3c('0x2f')]+'\x20is\x20not\x20active');}else{_0x13e3ca['message']=utils['CAMPAIGN_STATUS'][_0xdf3c('0x39')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca['name']+_0xdf3c('0x3a'));}}}Preview[_0xdf3c('0xf')][_0xdf3c('0x28')]=function(){var _0x1ccdd4=this;setInterval(function(){_0x1ccdd4['syncCampaigns']();},0x7cf);};Preview[_0xdf3c('0xf')][_0xdf3c('0x3b')]=function(){var _0x5386bf=this['campaignsPreview'];this[_0xdf3c('0x17')]+=0x1;for(var _0x46f0e3 in _0x5386bf){if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&(_0x5386bf[_0x46f0e3]['dialMethod']===_0xdf3c('0x6')||_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x3e'))&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(this[_0xdf3c('0x17')]>0x7){this[_0xdf3c('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x6')&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(_0x5386bf[_0x46f0e3][_0xdf3c('0x40')]){this[_0xdf3c('0x41')](_0x5386bf[_0x46f0e3]);if(_0x5386bf[_0x46f0e3][_0xdf3c('0x42')])this[_0xdf3c('0x43')](_0x5386bf[_0x46f0e3]);}else{notSendMessagesQueue(_0x5386bf[_0x46f0e3]);}}}};Preview['prototype'][_0xdf3c('0x44')]=function(_0x3e7a4b){var _0x5ddd21=this;this['sequence'][_0xdf3c('0x45')](function(){if(!_['isNil'](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b])){loggerAction['info']('[clearZombieChannels][talking]',_0x3e7a4b,'Queue',_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')],_0xdf3c('0x47'),JSON[_0xdf3c('0x2c')](_0x5ddd21['campaignsPreview'][_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x46')]]['originated']),_0xdf3c('0x48'),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]][_0xdf3c('0x33')]),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x49')]),JSON['stringify'](_[_0xdf3c('0x4a')](_0x5ddd21['actions'][_0x3e7a4b],['contactId',_0xdf3c('0x4b'),'VoiceQueueId',_0xdf3c('0x4c')])));return ami['Action']({'action':_0xdf3c('0x4d'),'channel':_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x4e')]})[_0xdf3c('0x4f')](function(_0x3098cb){if(_0x3098cb[_0xdf3c('0x36')]===_0xdf3c('0x50')){setTimeout(function(){if(_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b]){ut[_0xdf3c('0x51')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],'[clearZombieChannel]');if(_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x49')]===!![]){ut['decrementTalkink'](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],_0xdf3c('0x52'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);}ut[_0xdf3c('0x53')]('[Dialer][checkChannel][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);delete _0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b];}},0x2328);}});}});};Preview[_0xdf3c('0xf')]['clearZombieChannels']=function(){var _0x127685=this;loggerAction[_0xdf3c('0x2a')](_0xdf3c('0x54'),_[_0xdf3c('0x55')](this[_0xdf3c('0x15')]));for(var _0x55849e in this[_0xdf3c('0x15')]){if(_0x127685[_0xdf3c('0x15')][_0xdf3c('0x3c')](_0x55849e)){_0x127685[_0xdf3c('0x44')](_0x55849e);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x43')]=function(_0x555389){var _0x4d6349=this;rpcDb[_0xdf3c('0x56')](_0x555389['id'],ut[_0xdf3c('0x57')](this['agents']))['then'](function(_0x269723){if(!_[_0xdf3c('0x58')](_0x269723)){for(var _0x46b2bd=0x0;_0x46b2bd<_0x269723[_0xdf3c('0x59')];_0x46b2bd+=0x1){if(ut[_0xdf3c('0x5a')](_0x269723[_0x46b2bd][_0xdf3c('0x5b')])<_0x555389[_0xdf3c('0x5c')]*0x3c){if(_0x269723[_0x46b2bd][_0xdf3c('0x5d')]&&!_0x269723[_0x46b2bd][_0xdf3c('0x5d')]['voicePause']){_0x4d6349[_0xdf3c('0x5e')](_0x269723[_0x46b2bd]['id'])[_0xdf3c('0x5f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')))[_0xdf3c('0x4f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')));}else{rpcDb['disableContact'](_0x269723[_0x46b2bd]['id']);}}else{var _0x1751a8=new Action(_0x269723[_0x46b2bd],_0x555389);_0x1751a8['starttime']=moment()[_0xdf3c('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x555389[_0xdf3c('0x62')]+=0x1;ut[_0xdf3c('0x63')](_0x1751a8,0x17,_0xdf3c('0x64'));if(_0x555389[_0xdf3c('0x65')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x269723[_0x46b2bd]));rpcDb['createCustomerHistory'](_0x1751a8,_0xdf3c('0x66'));}else{ut['logCustomer'](_0x1751a8,0x16,_0xdf3c('0x67'));rpcDb[_0xdf3c('0x68')](_0x1751a8,_0xdf3c('0x69'));rpcDb[_0xdf3c('0x6a')](_0x1751a8,_0xdf3c('0x69'));}}}}})['catch'](ut['logger2'](_0xdf3c('0x6b')));};Preview[_0xdf3c('0xf')]['setMessage']=function(_0x3b215d){_0x3b215d[_0xdf3c('0x31')]=!![];if(ut[_0xdf3c('0x6c')](_0x3b215d[_0xdf3c('0x6d')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x6f')];}else if(!ut['isActive'](_0x3b215d['dialActive'])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x37')];}else if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x71')])){if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x72')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x73')];}else{_0x3b215d[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x74')];}}else{_0x3b215d['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x1afc6c,_0x1c18a9,_0x5c53cd){var _0x4257c4=this;var _0x32427e=this['actions'][_0x1c18a9];var _0xa8dddb=this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]];var _0x1389e0;var _0x396461=![];var _0x28f387=0x2;var _0xb54629=0x3;if(_0xa8dddb){switch(_0x5c53cd){case'1':_0xa8dddb[_0xdf3c('0x75')]+=0x1;_0x32427e[_0xdf3c('0x76')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x0,_0xdf3c('0x79'));ami[_0xdf3c('0x29')](_0xdf3c('0x7a'),ut['buildObj'](_0x32427e,_0xdf3c('0x7b')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x7c'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'0',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x13bf69){_0x396461=_0x13bf69['additional']==0x1;_0x28f387=_0xa8dddb[_0xdf3c('0x7d')];_0xb54629=_0xa8dddb['callAdditionalPhoneAfterMin'];if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0x81'));}else{if(_0x32427e[_0xdf3c('0x76')]>=_0xa8dddb[_0xdf3c('0x82')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x81'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0x76'),_0xa8dddb[_0xdf3c('0x7d')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}delete this[_0xdf3c('0x15')][_0x1afc6c['linkedid']];}else{_0x32427e['countnosuchnumberretry']++;logger[_0xdf3c('0x2a')](_0xdf3c('0x87'),_0x32427e[_0xdf3c('0x76')]);logger['info']('id',_0x32427e[_0xdf3c('0x88')]);_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countnosuchnumberretry':_0x32427e[_0xdf3c('0x76')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0x8a'):var _0x9b7034=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x32427e[_0xdf3c('0x8c')]=_0x9b7034;_0x32427e[_0xdf3c('0x8d')]=_0x9b7034;_0x32427e[_0xdf3c('0x49')]=!![];_0xa8dddb[_0xdf3c('0x33')]+=0x1;logger[_0xdf3c('0x2a')]('[syncHangup][talking][increment]',_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);ami['emit'](_0xdf3c('0x90'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x92'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));if(_0xa8dddb[_0xdf3c('0x93')]){ami[_0xdf3c('0x29')](_0xdf3c('0x94'),ut[_0xdf3c('0x95')](_0x32427e));}break;case'16':ami[_0xdf3c('0x29')]('custom:agentcomplete',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));emitVoiceQueueChannelRemove(ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96')));_0xa8dddb[_0xdf3c('0x97')]+=0x1;_0xa8dddb['total']+=0x1;_0xa8dddb[_0xdf3c('0x98')]+=0x1;ut[_0xdf3c('0x99')](_0xa8dddb,'[16]');_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x9b'));rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x9c'));rpcDb[_0xdf3c('0x9d')](_0x32427e);_0xa8dddb['sumDuration']+=_0x32427e[_0xdf3c('0x9e')];_0xa8dddb[_0xdf3c('0x9f')]+=_0x32427e[_0xdf3c('0x9e')];logger['info'](_0xdf3c('0xa0'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb['name'],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;case _0xdf3c('0xa2'):_0xa8dddb[_0xdf3c('0xa3')]+=0x1;_0x32427e['countbusyretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x5,'Busy');_0x28f387=_0xa8dddb[_0xdf3c('0xa4')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')]('custom:agentbusy',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xa6')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logBusy]');_0x4257c4['verifyAdditionalPhones'](_0x32427e,'5',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x4e3517){_0x396461=_0x4e3517[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x32427e['countbusyretry']>=_0xa8dddb[_0xdf3c('0xa8')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xa9'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xaa'),_0xa8dddb['dialBusyRetryFrequency']),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xaa')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countbusyretry':_0x32427e[_0xdf3c('0xaa')]}})[_0xdf3c('0x5f')](function(){_0x4257c4['swapAdditionalPhones'](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xac'):_0xa8dddb[_0xdf3c('0xad')]+=0x1;_0x32427e['countnoanswerretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x3,_0xdf3c('0xae'));_0x28f387=_0xa8dddb[_0xdf3c('0xaf')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];var _0x391042=ut[_0xdf3c('0xb0')](_0x32427e,_0xa8dddb);ami[_0xdf3c('0x29')]('custom:agentnoanswer',_0x391042);rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logNoAnswer]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'3',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x2e5f82){_0x396461=_0x2e5f82[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xb2'));}else{if(_0x32427e[_0xdf3c('0xb3')]>=_0xa8dddb[_0xdf3c('0xb4')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xb5'));}else{rpcDb['rescheduleContact'](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xb3'),_0xa8dddb[_0xdf3c('0xaf')]),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e['idContact'],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xb6'):_0xa8dddb[_0xdf3c('0xb7')]+=0x1;_0x32427e['countcongestionretry']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x8,_0xdf3c('0xb8'));_0x28f387=_0xa8dddb[_0xdf3c('0xb9')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami['emit'](_0xdf3c('0xba'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xbb')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xbc'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'8',_0xa8dddb)['then'](function(_0x5c99f2){_0x396461=_0x5c99f2[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xbd'));}else{if(_0x32427e[_0xdf3c('0xbe')]>=_0xa8dddb['dialCongestionMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xbc'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xbe'),_0xa8dddb[_0xdf3c('0xa4')]),_0x32427e['unlockAgent'],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xbe')]++;_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countcongestionretry':_0x32427e[_0xdf3c('0xbe')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'CANCEL':_0xa8dddb[_0xdf3c('0xbf')]+=0x1;_0x32427e[_0xdf3c('0xc0')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x14,_0xdf3c('0xc1'));_0x28f387=_0xa8dddb['dialAgentRejectRetryFrequency'];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')](_0xdf3c('0xc2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xc3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xc4'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x1745fd){_0x396461=_0x1745fd[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb['dialGlobalMaxRetry']){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x1389e0,_0xdf3c('0xc5'));}else{if(_0x32427e[_0xdf3c('0xc0')]>=_0xa8dddb['dialAgentRejectMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xdf3c('0x83')](ut['scheduledAt'](_0x32427e,_0xdf3c('0xc0'),_0xa8dddb[_0xdf3c('0xc6')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xc7'):_0xa8dddb[_0xdf3c('0xc8')]+=0x1;_0x32427e[_0xdf3c('0xc9')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xb,_0xdf3c('0xca'));rpcDb['createCustomerHistory'](_0x32427e,_0xdf3c('0xcb'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'11',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x6e1899){_0x396461=_0x6e1899[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xcb'));}else{if(_0x32427e['countabandonedetry']>=_0xa8dddb[_0xdf3c('0xcc')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xcb'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xc9'),_0xa8dddb[_0xdf3c('0xcd')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'18':_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e[_0xdf3c('0xcf')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x12,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);ami[_0xdf3c('0x29')](_0xdf3c('0xd2'),ut['buildObj'](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)['then'](function(_0x418021){_0x396461=_0x418021[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x12,_0xdf3c('0x80'));rpcDb['createCustomerFinal'](_0x1389e0,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});delete this['actions'][_0x1afc6c[_0xdf3c('0xa1')]];break;case'19':_0xa8dddb['outboundUnknownCallsDay']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x13,_0x1afc6c['cause-txt']||_0x1afc6c[_0xdf3c('0xd1')]);ami['emit'](_0xdf3c('0xd2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd4'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x1d95d9){_0x396461=_0x1d95d9[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xd4'));}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});});}});delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;default:if(_0x32427e[_0xdf3c('0x49')]){ut[_0xdf3c('0x99')](_0xa8dddb,_0xdf3c('0xd5'));ut[_0xdf3c('0x53')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xa8dddb[_0xdf3c('0x2f')],_0x1afc6c);}_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xc,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);_0x28f387=_0xa8dddb[_0xdf3c('0xc6')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd6'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x44dc52){_0x396461=_0x44dc52[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,'Global');rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];}else{_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});}});}if(!(_0x32427e[_0xdf3c('0x49')]&&_0x5c53cd==='16')){ut[_0xdf3c('0x51')](_0xa8dddb,'[callProgressDetectingCustomer]');logger['info'](_0xdf3c('0xd7'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa8dddb[_0xdf3c('0x32')]);}if(_0x5c53cd!==_0xdf3c('0x8a')){delete this['actions'][_0x1afc6c['linkedid']];delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xd8')]];}_0xa8dddb[_0xdf3c('0xd9')]=!![];}};Preview[_0xdf3c('0xf')][_0xdf3c('0xda')]=function(_0x268aa9,_0xa10e73,_0x828c9c){if(_[_0xdf3c('0xdb')](_0xa10e73)&&_0xdf3c('0xdc')!==typeof _0xa10e73){return;}if(_[_0xdf3c('0xdb')](_0x828c9c)&&_0xdf3c('0xdc')!==typeof _0x828c9c){return;}switch(_0x828c9c[_0xdf3c('0xdd')]){case'0':ut[_0xdf3c('0xde')](_0x268aa9,0x0,_0xdf3c('0x79'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe0'));break;case'3':ut[_0xdf3c('0xde')](_0x268aa9,0x3,_0xdf3c('0xae'));rpcDb['createAgentHistory'](_0x268aa9,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xdf3c('0xde')](_0x268aa9,0x5,'Busy');rpcDb['createAgentHistory'](_0x268aa9,_0xdf3c('0xe1'));break;case'8':ut['logAgent'](_0x268aa9,0x8,_0xdf3c('0xb8'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x268aa9,0x16,'AnswerAGI');rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe2'));break;default:ut[_0xdf3c('0xde')](_0x268aa9,0xc,_0x828c9c['reason']);rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdf3c('0x51')](_0xa10e73,'[callProgressDetectingAgent]');logger['info'](_0xdf3c('0xe3'),_0x268aa9[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa10e73[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa10e73[_0xdf3c('0x32')]);delete this['actions'][_0x268aa9['uniqueid']];};Preview[_0xdf3c('0xf')]['verifyAdditionalPhones']=function(_0x1a5e31,_0x14244a,_0x18e639){return cmHopperAdditionalPhone[_0xdf3c('0xb1')](_0x1a5e31,_0x14244a,_0x18e639)[_0xdf3c('0x4f')](logger[_0xdf3c('0x2a')](_0xdf3c('0xe4')));};Preview['prototype']['swapAdditionalPhones']=function(_0x40fdd4,_0x1446af,_0x3fa455){return cmHopperAdditionalPhone[_0xdf3c('0x89')](_0x40fdd4,_0x1446af,_0x3fa455)['catch'](logger[_0xdf3c('0x2a')](_0xdf3c('0xe5')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xab')]=function(_0x33ef58){return Promise[_0xdf3c('0xe6')]()['then'](cmHopperAdditionalPhone[_0xdf3c('0xab')](_0x33ef58))[_0xdf3c('0x4f')](logger['info'](_0xdf3c('0xe7')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xe8')]=function(_0x511a40,_0x87ec92,_0x1ebfff,_0x3487cf,_0xb1c08d){var _0x3100fa=this;return new Promise(function(_0x147769,_0x3c91ba){if(_[_0xdf3c('0x58')](_0x87ec92)||_[_0xdf3c('0x58')](_0x87ec92['Contact'])||_[_0xdf3c('0x58')](_0x87ec92['phone'])||_[_0xdf3c('0x58')](_0x87ec92[_0xdf3c('0xe9')])){_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xea'),_0x3487cf,_0xb1c08d));return;}var _0x90c66=uuid['v4']();var _0x34344b=_0x3100fa[_0xdf3c('0x13')][_0x87ec92[_0xdf3c('0xeb')][_0xdf3c('0x2f')]];var _0x36a8c7=_0x1ebfff?_0x3100fa[_0xdf3c('0x16')][_0x1ebfff]['id']:undefined;_0x3100fa['actions'][_0x90c66]=new Action(_0x87ec92,_0x34344b,_0x90c66,_0x1ebfff,_0x36a8c7);var _0x379996=_0x3100fa[_0xdf3c('0x15')][_0x90c66];_0x379996['unlockAgent']=_0x3487cf;_0x379996[_0xdf3c('0x86')]=_0xb1c08d;_0x379996[_0xdf3c('0xec')]=_0x1ebfff;if(_[_0xdf3c('0xed')](_0x511a40)){_0x3100fa[_0xdf3c('0xee')](_0x379996,_0x34344b,_0x87ec92,_0x1ebfff)['then'](function(_0x2670ef){logger[_0xdf3c('0x2a')](_0xdf3c('0xef'),'Queue:\x20'+_0x379996['queue']+'\x20IdHopper:\x20'+_0x379996[_0xdf3c('0x88')],JSON[_0xdf3c('0x2c')](_0x2670ef));ami[_0xdf3c('0x29')](_0xdf3c('0xf0'),ut[_0xdf3c('0x91')](_0x379996,_0xdf3c('0xf1'),_0x3100fa[_0xdf3c('0x13')][_0x379996[_0xdf3c('0x46')]]));_0x147769(ut['message'](_0xdf3c('0xf2')));})['catch'](function(_0x359366){ut[_0xdf3c('0x38')](_0xdf3c('0xf3'),_0x359366);_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf4'),_0x3487cf,_0xb1c08d));});}else{_0x34344b[_0xdf3c('0xf5')]+=0x1;ut['logBlacklist'](_0x379996);rpcDb[_0xdf3c('0xf6')](_0x379996,_0xdf3c('0xf7'));delete _0x3100fa['actions'][_0x90c66];_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf8'),_0x3487cf,_0xb1c08d));}});};Preview[_0xdf3c('0xf')][_0xdf3c('0x70')]=function(_0x4e66a3){return!_[_0xdf3c('0x58')](_0x4e66a3)&&!_['isNil'](_0x4e66a3[_0xdf3c('0x2f')])&&!_[_0xdf3c('0x58')](_0x4e66a3[_0xdf3c('0xf9')])&&_0x4e66a3[_0xdf3c('0xf9')]&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3['name'])])&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3[_0xdf3c('0x2f')])]['status'])&&(this['trunks'][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]==='reachable'||this[_0xdf3c('0x14')][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]===_0xdf3c('0xfb'));};Preview[_0xdf3c('0xf')][_0xdf3c('0x5e')]=function(_0xd5aa90,_0x2eef6f){return this[_0xdf3c('0xfc')](_0xd5aa90,_0x2eef6f)['then'](function(_0x17add4){return _[_0xdf3c('0x4a')](_0x17add4,['message']);})[_0xdf3c('0x4f')](function(_0x1e8646){if(_0x1e8646['unlock']){rpcDb[_0xdf3c('0xfd')](_0xd5aa90);}if(_0x1e8646['active']){rpcDb[_0xdf3c('0xfe')](_0xd5aa90);}throw _[_0xdf3c('0x4a')](_0x1e8646,[_0xdf3c('0x36')]);});};Preview[_0xdf3c('0xf')][_0xdf3c('0xfc')]=function(_0x1086a3,_0x232b34){var _0x41b5f4=this;var _0x171231,_0x2b27de;return rpcDb[_0xdf3c('0xff')](_0x1086a3)[_0xdf3c('0x5f')](function(_0x2a4dbf){if(!_[_0xdf3c('0x58')](_0x2a4dbf[0x0])){_0x2b27de=_0x2a4dbf[0x0][_0xdf3c('0x100')]?![]:!![];_0x171231=_0x2a4dbf[0x0][_0xdf3c('0x100')]?!![]:![];_0x171231=_0x232b34?!![]:_0x171231;}var _0x542a02=_0x41b5f4[_0xdf3c('0x101')](_0x2a4dbf);if(_0x542a02[_0xdf3c('0x102')]){rpcDb['checkIsBlackList'](_[_0xdf3c('0x4a')](_0x2a4dbf[0x0],[_0xdf3c('0xe9'),_0xdf3c('0x103')]))[_0xdf3c('0x5f')](function(_0x518290){_0x41b5f4[_0xdf3c('0xe8')](_0x518290,_0x2a4dbf[0x0],_0x232b34,_0x2b27de,_0x171231)[_0xdf3c('0x5f')](function(_0x5b25d7){return _0x5b25d7;})[_0xdf3c('0x4f')](function(_0x37b1a6){throw _0x37b1a6;});})['catch'](function(_0x59c8f9){ut[_0xdf3c('0x38')](_0xdf3c('0x104'),_0x59c8f9);throw ut[_0xdf3c('0x36')]('Call\x20unsuccessful',_0x2b27de,_0x171231);});}else{throw ut[_0xdf3c('0x36')](_0x542a02['message'],_0x2b27de,_0x171231);}})[_0xdf3c('0x4f')](function(_0x246958){ut[_0xdf3c('0x38')](_0xdf3c('0x105'),_0x246958);throw ut[_0xdf3c('0x36')](_0xdf3c('0x106'),![],!![]);});};Preview['prototype'][_0xdf3c('0x101')]=function(_0x47f9d1){if(_[_0xdf3c('0x58')](_0x47f9d1)||_[_0xdf3c('0xed')](_0x47f9d1)||!_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'])&&_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'][_0xdf3c('0x2f')])){ut[_0xdf3c('0x38')]('[Preview][validateContact][Empty\x20Contact]',_0x47f9d1);return{'isValid':![],'message':_0xdf3c('0x107')};}var _0x4185f0=this[_0xdf3c('0x13')][_0x47f9d1[0x0][_0xdf3c('0xeb')]['name']];_0x4185f0[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x74')];if(_[_0xdf3c('0x58')](_0x4185f0)){ut[_0xdf3c('0x38')](_0xdf3c('0x108'),_0x4185f0);return{'isValid':![],'message':_0xdf3c('0x109')};}if(!this['isTrunkReachable'](_0x4185f0[_0xdf3c('0x71')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x10c'));if(!this[_0xdf3c('0x70')](_0x4185f0[_0xdf3c('0x72')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0x4185f0[_0xdf3c('0x2f')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdf3c('0x10d')};}}if(!ut[_0xdf3c('0x10e')](_0x4185f0[_0xdf3c('0x40')])){ut['logger'](_0xdf3c('0x10f'),_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x110'));return{'isValid':![],'message':_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xdf3c('0x111')};};Preview[_0xdf3c('0xf')]['execCall']=function(_0x2a0943,_0x3d4dc5,_0x38c6f3,_0xb39cc){var _0xcc2f18=this;return new Promise(function(_0x13ee9b,_0x8d7c0c){var _0x3d9041=_0x2a0943[_0xdf3c('0x8e')];var _0x4f8990=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5[_0xdf3c('0x71')])?util['format'](_0xdf3c('0x112'),_0x3d4dc5[_0xdf3c('0x71')]['name'],_['isNil'](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5[_0xdf3c('0x113')][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')][_0xdf3c('0x116')](_0x3d4dc5[_0xdf3c('0x115')]):_0x38c6f3[_0xdf3c('0x103')]):util['format'](_0xdf3c('0x112'),_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')]['name']:_0x3d4dc5[_0xdf3c('0x72')][_0xdf3c('0x2f')],_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5['dialPrefix'][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')]['substring'](_0x3d4dc5['dialCutDigit']):_0x38c6f3[_0xdf3c('0x103')]);var _0xcaea00=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5['Trunk'])?ut[_0xdf3c('0x117')](_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut['getCallerIdRandom'](_0x3d4dc5['dialOriginateCallerIdNumber'],_0x3d4dc5[_0xdf3c('0x11a')]):_0x3d4dc5['dialOriginateCallerIdNumber']):ut[_0xdf3c('0x117')](_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')]:_0x3d4dc5[_0xdf3c('0x72')]['callerid'],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut[_0xdf3c('0x11b')](_0x3d4dc5[_0xdf3c('0x11c')],_0x3d4dc5['dialRandomLastDigitCallerIdNumber']):_0x3d4dc5[_0xdf3c('0x11c')]);if(_0xcaea00){_0x2a0943[_0xdf3c('0x11d')]=ut[_0xdf3c('0x11e')](_0xcaea00);_0x2a0943['originatecalleridnum']=ut['extractCalleridNumber'](_0xcaea00);}var _0x1617d8=ut[_0xdf3c('0x11f')](_0x3d4dc5,_0x38c6f3,_0x4f8990,_0xcaea00,_0x3d9041,_0x2a0943);_['merge'](_0x2a0943,ut[_0xdf3c('0x120')](_0x1617d8));_0x2a0943['starttime']=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x3d4dc5[_0xdf3c('0x121')]=_0x1617d8;var _0x1961cd=ut[_0xdf3c('0x122')](_0x2a0943,_0x3d4dc5,_0x1617d8,_0x2a0943[_0xdf3c('0x86')],_0xb39cc);return ami['Action'](_0x1961cd)[_0xdf3c('0x5f')](function(_0x2c24b7){_0x3d4dc5[_0xdf3c('0x32')]+=0x1;logger[_0xdf3c('0x2a')](_0xdf3c('0x123'),_0x3d9041,_0xdf3c('0x8f'),_0x3d4dc5[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0x3d4dc5[_0xdf3c('0x32')]);_0x13ee9b(_0x2c24b7);})[_0xdf3c('0x4f')](function(_0x340107){ut['logAgent'](_0x2a0943,0xe,_0xdf3c('0x124'));rpcDb[_0xdf3c('0xdf')](_0x2a0943,'[originateFailure][logOriginateFailure]');_0x8d7c0c(_0x340107);});});};Preview[_0xdf3c('0xf')][_0xdf3c('0x125')]=function(_0x2accb4){if(this[_0xdf3c('0x15')][_0x2accb4[_0xdf3c('0xa1')]]){this['actions'][_0x2accb4[_0xdf3c('0xa1')]][_0xdf3c('0x4e')]=_0x2accb4[_0xdf3c('0x4e')];}};Preview[_0xdf3c('0xf')][_0xdf3c('0x19')]=function(_0x31391d){var _0x158c75=this;var _0x7554e2=this[_0xdf3c('0x15')][_0x31391d[_0xdf3c('0x126')]];if(_0x7554e2){if(_0x7554e2[_0xdf3c('0xec')]&&this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]){ut['logLookAgent'](_0x7554e2,this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['name'],this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['id']);}var _0x44388c=_[_0xdf3c('0x127')](_0x7554e2);_0x44388c[_0xdf3c('0x8c')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));var _0x15322a=_0x158c75[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]];if(ut['isFailure'](_0x31391d[_0xdf3c('0x128')])){if(_0x7554e2[_0xdf3c('0x85')]){rpcDb['unlockContact'](_0x7554e2[_0xdf3c('0x88')]);}if(_0x7554e2['activeContact']){rpcDb[_0xdf3c('0xfe')](_0x7554e2['idContact']);}ami[_0xdf3c('0x29')]('custom:agentringnoanswer',ut[_0xdf3c('0x91')](_0x7554e2,_0xdf3c('0x129'),this[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]]));this[_0xdf3c('0xda')](_0x44388c,_0x15322a,_0x31391d);}else{_0x7554e2[_0xdf3c('0x12a')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));ut['logAgent'](_0x44388c,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0xdf')](_0x44388c,_0xdf3c('0x12b'));}}};Preview['prototype'][_0xdf3c('0x1b')]=function(_0x30b5c8){var _0x30e5ab=this[_0xdf3c('0x15')][_0x30b5c8['linkedid']];var _0x55a4fa;if(_0x30e5ab){_0x55a4fa=this['campaignsPreview'][_0x30e5ab['queue']];logger[_0xdf3c('0x2a')](_0xdf3c('0x12c'),_0x30b5c8[_0xdf3c('0xa1')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);}if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]&&_0x30b5c8['linkedid']!==_0x30b5c8[_0xdf3c('0x8e')]){if(_0x30b5c8[_0xdf3c('0x12d')]==='16'&&this[_0xdf3c('0x15')][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],'\x20Queue',_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}}else if(_0x30e5ab&&_[_0xdf3c('0x58')](_0x30e5ab[_0xdf3c('0x130')])&&_0x55a4fa[_0xdf3c('0x131')]&&_0x30b5c8[_0xdf3c('0xa1')]===_0x30b5c8[_0xdf3c('0x8e')]&&_['isNil'](_0x30b5c8[_0xdf3c('0xdd')])&&_0x30b5c8[_0xdf3c('0x12d')]==='16'&&_0x30b5c8[_0xdf3c('0x132')]==='6'&&_[_0xdf3c('0xdb')](_0x30e5ab[_0xdf3c('0x133')])){if(_0x30e5ab[_0xdf3c('0x85')]){rpcDb[_0xdf3c('0xfd')](_0x30e5ab['idContact']);}if(_0x30e5ab[_0xdf3c('0x86')]){rpcDb['disableContact'](_0x30e5ab[_0xdf3c('0x88')]);}_0x30b5c8['reason']='22';this[_0xdf3c('0xda')](_0x30e5ab,_0x55a4fa,_0x30b5c8);}else if(_0x30e5ab&&_0x30e5ab[_0xdf3c('0x133')]){if(_0x30b5c8['cause']==='16'&&this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x134'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]['dialAnswer']){logger['info'](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],'pTalking:\x20',_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x20')]=function(_0x386a3b){if(this[_0xdf3c('0x15')][_0x386a3b['destlinkedid']]&&_0x386a3b[_0xdf3c('0xd8')]!==_0x386a3b[_0xdf3c('0x135')]){this[_0xdf3c('0x12e')](_0x386a3b,_0x386a3b[_0xdf3c('0xd8')],_0x386a3b[_0xdf3c('0xd1')]);}};Preview['prototype'][_0xdf3c('0x1e')]=function(_0x43fc55){if(this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]]&&_0x43fc55[_0xdf3c('0xa1')]!==_0x43fc55[_0xdf3c('0x8e')]&&!this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){if(_0x43fc55[_0xdf3c('0x12d')]==='1'){this[_0xdf3c('0x12e')](_0x43fc55,_0x43fc55[_0xdf3c('0xa1')],_0x43fc55[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x136')]=function(_0x2be6c7,_0x18bbe0,_0x174e96){if(this['actions'][_0x2be6c7]){if(_[_0xdf3c('0x58')](this[_0xdf3c('0x15')][_0x2be6c7][_0xdf3c('0x121')])){this['actions'][_0x2be6c7][_0xdf3c('0x121')]={};}this['actions'][_0x2be6c7][_0xdf3c('0x121')][_0x18bbe0]=_0x174e96;}};Preview['prototype'][_0xdf3c('0x23')]=function(_0xd721b1){try{if(!_[_0xdf3c('0x58')](_0xd721b1)){if(ut[_0xdf3c('0x137')](_[_0xdf3c('0x138')](_0xd721b1[_0xdf3c('0x139')])[0x0])){this[_0xdf3c('0x136')](_0xd721b1[_0xdf3c('0x8e')],_[_0xdf3c('0x138')](_0xd721b1['variable'])[0x0],_0xd721b1[_0xdf3c('0x13a')]);}}}catch(_0x3e3d63){logger[_0xdf3c('0x13b')](_0xdf3c('0x13c'),util['inspect'](_0x3e3d63,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdf3c('0x25')]=function(_0x2d412f){if(_0x2d412f){if(this[_0xdf3c('0x15')][_0x2d412f[_0xdf3c('0x13d')]]){this['actions'][_0x2d412f[_0xdf3c('0x13d')]]['transfer']=!![];}}};Preview['prototype'][_0xdf3c('0x27')]=function(_0x4255cd){if(_0x4255cd){if(this['actions'][_0x4255cd[_0xdf3c('0x13e')]]){this[_0xdf3c('0x15')][_0x4255cd['transfererlinkedid']][_0xdf3c('0x133')]=!![];}}};module[_0xdf3c('0x13f')]=Preview;
\ No newline at end of file
+var _0x9c44=['Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','Answer','[syncHangup][talking]','cause','statedesc','channelstate','transfer','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','localhost','socket.io-emitter','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','info','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','available','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','prototype','syncCampaigns','dialMethod','booked','type','outbound','clearZombieChannels','hasOwnProperty','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','sequence','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','catch','disableContact','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','name','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','originated','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','isNil','Contact','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','phone','checkInBlack','[Preview][checkIsBlackList]'];(function(_0x228ab1,_0x192ac7){var _0x3751ac=function(_0x2bbc9c){while(--_0x2bbc9c){_0x228ab1['push'](_0x228ab1['shift']());}};_0x3751ac(++_0x192ac7);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0x49c4('0x0'));var moment=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));var logger=require(_0x49c4('0x4'))(_0x49c4('0x5'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x49c4('0x6'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x49c4('0x7'));var Action=require(_0x49c4('0x8'));var ut=require(_0x49c4('0x9'));var utils=require(_0x49c4('0xa'));config[_0x49c4('0xb')]=_['defaults'](config[_0x49c4('0xb')],{'host':_0x49c4('0xc'),'port':0x18eb});var io=require(_0x49c4('0xd'))(new Redis(config[_0x49c4('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x451ea6){this[_0x49c4('0xe')]=this['tail']?this[_0x49c4('0xe')][_0x49c4('0xf')](_0x451ea6):_0x451ea6();};function Preview(_0x4adb3c){this['sequence']=new Sequence();this[_0x49c4('0x10')]=_0x4adb3c[_0x49c4('0x11')];this['trunks']=_0x4adb3c[_0x49c4('0x12')];this[_0x49c4('0x13')]={};this['agents']=_0x4adb3c[_0x49c4('0x14')];this[_0x49c4('0x15')]=0x0;ami['on'](_0x49c4('0x16'),this[_0x49c4('0x17')][_0x49c4('0x18')](this));ami['on'](_0x49c4('0x19'),this[_0x49c4('0x1a')][_0x49c4('0x18')](this));ami['on']('hanguprequest',this[_0x49c4('0x1b')][_0x49c4('0x18')](this));ami['on'](_0x49c4('0x1c'),this[_0x49c4('0x1d')][_0x49c4('0x18')](this));ami['on']('newexten',this[_0x49c4('0x1e')][_0x49c4('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x49c4('0x18')](this));ami['on'](_0x49c4('0x1f'),this[_0x49c4('0x20')]['bind'](this));ami['on'](_0x49c4('0x21'),this['syncBlindTransfer'][_0x49c4('0x18')](this));this[_0x49c4('0x22')](this[_0x49c4('0x10')]);}function emit(_0x291526,_0x382040,_0x41078c){io['to'](_0x291526)[_0x49c4('0x23')](_0x382040,_0x41078c);}function emitVoiceQueueChannelRemove(_0x46e475){logger[_0x49c4('0x24')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x46e475));emit(util['format'](_0x49c4('0x25'),_0x46e475['name']),'voice_queue_channel:remove',_0x46e475);io[_0x49c4('0x23')](_0x49c4('0x26'),_0x46e475);}function notSendMessagesQueue(_0x26c640){if(_0x26c640[_0x49c4('0x27')]){if(_0x26c640['originated']===0x0&&_0x26c640['pTalking']===0x0){_0x26c640[_0x49c4('0x27')]=![];_0x26c640[_0x49c4('0x28')]=0x0;_0x26c640['paused']=0x0;_0x26c640[_0x49c4('0x29')]=utils[_0x49c4('0x2a')][_0x49c4('0x2b')];ut[_0x49c4('0x2c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x26c640['name']+_0x49c4('0x2d'));}else{_0x26c640['message']=utils[_0x49c4('0x2a')][_0x49c4('0x2e')];ut[_0x49c4('0x2c')](_0x49c4('0x2f'),_0x26c640['name']+_0x49c4('0x30'));}}}Preview[_0x49c4('0x31')][_0x49c4('0x22')]=function(){var _0x4f28a2=this;setInterval(function(){_0x4f28a2[_0x49c4('0x32')]();},0x7cf);};Preview[_0x49c4('0x31')][_0x49c4('0x32')]=function(){var _0x427b26=this[_0x49c4('0x10')];this[_0x49c4('0x15')]+=0x1;for(var _0x46f7ea in _0x427b26){if(_0x427b26['hasOwnProperty'](_0x46f7ea)&&(_0x427b26[_0x46f7ea]['dialMethod']==='preview'||_0x427b26[_0x46f7ea][_0x49c4('0x33')]===_0x49c4('0x34'))&&_0x427b26[_0x46f7ea][_0x49c4('0x35')]===_0x49c4('0x36')){if(this[_0x49c4('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x49c4('0x37')]();}}if(_0x427b26[_0x49c4('0x38')](_0x46f7ea)&&_0x427b26[_0x46f7ea][_0x49c4('0x33')]===_0x49c4('0x5')&&_0x427b26[_0x46f7ea]['type']==='outbound'){if(_0x427b26[_0x46f7ea][_0x49c4('0x39')]){this[_0x49c4('0x3a')](_0x427b26[_0x46f7ea]);if(_0x427b26[_0x46f7ea][_0x49c4('0x3b')])this[_0x49c4('0x3c')](_0x427b26[_0x46f7ea]);}else{notSendMessagesQueue(_0x427b26[_0x46f7ea]);}}}};Preview[_0x49c4('0x31')]['clearZombieChannel']=function(_0x2aac35){var _0x84c621=this;this[_0x49c4('0x3d')]['enqueue'](function(){if(!_['isNil'](_0x84c621[_0x49c4('0x13')][_0x2aac35])){loggerAction[_0x49c4('0x24')](_0x49c4('0x3e'),_0x2aac35,_0x49c4('0x3f'),_0x84c621[_0x49c4('0x13')][_0x2aac35][_0x49c4('0x40')],_0x49c4('0x41'),JSON[_0x49c4('0x42')](_0x84c621[_0x49c4('0x10')][_0x84c621['actions'][_0x2aac35][_0x49c4('0x40')]]['originated']),_0x49c4('0x43'),JSON[_0x49c4('0x42')](_0x84c621[_0x49c4('0x10')][_0x84c621[_0x49c4('0x13')][_0x2aac35]['queue']][_0x49c4('0x44')]),JSON[_0x49c4('0x42')](_0x84c621[_0x49c4('0x13')][_0x2aac35]['dialAnswer']),JSON[_0x49c4('0x42')](_[_0x49c4('0x45')](_0x84c621[_0x49c4('0x13')][_0x2aac35],[_0x49c4('0x46'),_0x49c4('0x47'),_0x49c4('0x48'),_0x49c4('0x49')])));return ami[_0x49c4('0x4a')]({'action':_0x49c4('0x4b'),'channel':_0x84c621[_0x49c4('0x13')][_0x2aac35][_0x49c4('0x4c')]})['catch'](function(_0x2d2510){if(_0x2d2510[_0x49c4('0x29')]===_0x49c4('0x4d')){setTimeout(function(){if(_0x84c621[_0x49c4('0x13')][_0x2aac35]){ut[_0x49c4('0x4e')](_0x84c621[_0x49c4('0x10')][_0x84c621[_0x49c4('0x13')][_0x2aac35][_0x49c4('0x40')]],_0x49c4('0x4f'));if(_0x84c621[_0x49c4('0x13')][_0x2aac35][_0x49c4('0x50')]===!![]){ut[_0x49c4('0x51')](_0x84c621[_0x49c4('0x10')][_0x84c621['actions'][_0x2aac35][_0x49c4('0x40')]],'[clearZombieChannel]');ut[_0x49c4('0x52')](_0x49c4('0x53')+_0x2aac35,_0x84c621[_0x49c4('0x13')][_0x2aac35][_0x49c4('0x40')]);}ut[_0x49c4('0x52')](_0x49c4('0x54')+_0x2aac35,_0x84c621['actions'][_0x2aac35]['queue']);delete _0x84c621[_0x49c4('0x13')][_0x2aac35];}},0x2328);}});}});};Preview[_0x49c4('0x31')][_0x49c4('0x37')]=function(){var _0x117151=this;loggerAction['info'](_0x49c4('0x55'),_[_0x49c4('0x56')](this[_0x49c4('0x13')]));for(var _0x444270 in this[_0x49c4('0x13')]){if(_0x117151[_0x49c4('0x13')][_0x49c4('0x38')](_0x444270)){_0x117151[_0x49c4('0x57')](_0x444270);}}};Preview[_0x49c4('0x31')]['recallMe']=function(_0x2ad771){var _0x4d27d0=this;rpcDb[_0x49c4('0x58')](_0x2ad771['id'],ut[_0x49c4('0x59')](this[_0x49c4('0x14')]))[_0x49c4('0x5a')](function(_0x2d93d8){if(!_['isNil'](_0x2d93d8)){for(var _0x592e8e=0x0;_0x592e8e<_0x2d93d8[_0x49c4('0x5b')];_0x592e8e+=0x1){if(ut[_0x49c4('0x5c')](_0x2d93d8[_0x592e8e][_0x49c4('0x5d')])<_0x2ad771[_0x49c4('0x5e')]*0x3c){if(_0x2d93d8[_0x592e8e][_0x49c4('0x5f')]&&!_0x2d93d8[_0x592e8e][_0x49c4('0x5f')]['voicePause']){_0x4d27d0[_0x49c4('0x60')](_0x2d93d8[_0x592e8e]['id'])['then'](ut[_0x49c4('0x61')](_0x49c4('0x62')))[_0x49c4('0x63')](ut[_0x49c4('0x61')](_0x49c4('0x62')));}else{rpcDb[_0x49c4('0x64')](_0x2d93d8[_0x592e8e]['id']);}}else{var _0x2c6be1=new Action(_0x2d93d8[_0x592e8e],_0x2ad771);_0x2c6be1['starttime']=moment()[_0x49c4('0x65')](_0x49c4('0x66'));_0x2ad771['outboundReCallsDay']+=0x1;ut[_0x49c4('0x67')](_0x2c6be1,0x17,_0x49c4('0x68'));if(_0x2ad771[_0x49c4('0x69')]){rpcDb[_0x49c4('0x6a')](ut['createBody'](_0x2d93d8[_0x592e8e]));rpcDb['createCustomerHistory'](_0x2c6be1,_0x49c4('0x6b'));}else{ut['logCustomer'](_0x2c6be1,0x16,_0x49c4('0x6c'));rpcDb[_0x49c4('0x6d')](_0x2c6be1,_0x49c4('0x6e'));rpcDb[_0x49c4('0x6f')](_0x2c6be1,_0x49c4('0x6e'));}}}}})[_0x49c4('0x63')](ut[_0x49c4('0x61')]('[getContactRecallMe]'));};Preview[_0x49c4('0x31')][_0x49c4('0x3a')]=function(_0x3936d3){_0x3936d3[_0x49c4('0x27')]=!![];if(ut[_0x49c4('0x70')](_0x3936d3[_0x49c4('0x71')])){_0x3936d3[_0x49c4('0x29')]=utils[_0x49c4('0x2a')][_0x49c4('0x72')];}else if(!ut[_0x49c4('0x73')](_0x3936d3['dialActive'])){_0x3936d3['message']=utils[_0x49c4('0x2a')][_0x49c4('0x2b')];}else if(!this['isTrunkReachable'](_0x3936d3['Trunk'])){if(!this[_0x49c4('0x74')](_0x3936d3['TrunkBackup'])){_0x3936d3['message']=utils[_0x49c4('0x2a')][_0x49c4('0x75')];}else{_0x3936d3[_0x49c4('0x29')]=utils[_0x49c4('0x2a')][_0x49c4('0x76')];}}else{_0x3936d3[_0x49c4('0x29')]=utils[_0x49c4('0x2a')]['ACTIVE'];}};Preview[_0x49c4('0x31')][_0x49c4('0x77')]=function(_0x207572,_0x208208,_0x73840f){var _0xa431d=this;var _0x5d24f3=this['actions'][_0x208208];var _0x1ef0c1=this[_0x49c4('0x10')][_0x5d24f3[_0x49c4('0x40')]];var _0xf7a10f;var _0x23288e=![];var _0x6b2592=0x2;var _0xc2033f=0x3;if(_0x1ef0c1){switch(_0x73840f){case'1':_0x1ef0c1['outboundNoSuchCallsDay']+=0x1;_0x5d24f3[_0x49c4('0x78')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut['totalGlobal'](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x0,'NoSuchNumber');ami[_0x49c4('0x23')](_0x49c4('0x7a'),ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0x7c')));rpcDb[_0x49c4('0x6d')](_0x5d24f3,_0x49c4('0x7d'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'0',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x483770){_0x23288e=_0x483770[_0x49c4('0x7f')]==0x1;_0x6b2592=_0x1ef0c1[_0x49c4('0x80')];_0xc2033f=_0x1ef0c1['callAdditionalPhoneAfterMin'];if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut['cloneAction'](_0x5d24f3,0xf,_0x49c4('0x83'));rpcDb[_0x49c4('0x6f')](_0xf7a10f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5d24f3['countnosuchnumberretry']>=_0x1ef0c1['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x5d24f3,_0x49c4('0x84'));}else{rpcDb['rescheduleContact'](ut[_0x49c4('0x85')](_0x5d24f3,_0x49c4('0x78'),_0x1ef0c1['dialNoSuchNumberRetryFrequency']),_0x5d24f3[_0x49c4('0x86')],_0x5d24f3[_0x49c4('0x87')]);}}delete this['actions'][_0x207572[_0x49c4('0x88')]];}else{_0x5d24f3[_0x49c4('0x78')]++;logger[_0x49c4('0x24')](_0x49c4('0x89'),_0x5d24f3['countnosuchnumberretry']);logger[_0x49c4('0x24')]('id',_0x5d24f3[_0x49c4('0x8a')]);_0xa431d[_0x49c4('0x8b')]({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countnosuchnumberretry':_0x5d24f3['countnosuchnumberretry']}})[_0x49c4('0x5a')](function(){_0xa431d['swapAdditionalPhones'](_0x5d24f3,_0x6b2592,_0xc2033f)['then'](function(){});});}});break;case'ANSWER':var _0x5d6de0=moment()[_0x49c4('0x65')](_0x49c4('0x66'));_0x5d24f3[_0x49c4('0x8c')]=_0x5d6de0;_0x5d24f3[_0x49c4('0x8d')]=_0x5d6de0;_0x5d24f3['dialAnswer']=!![];_0x1ef0c1['pTalking']+=0x1;logger[_0x49c4('0x24')](_0x49c4('0x8e'),_0x5d24f3[_0x49c4('0x8f')],_0x49c4('0x90'),_0x1ef0c1[_0x49c4('0x91')],_0x49c4('0x43'),_0x1ef0c1[_0x49c4('0x44')]);ami[_0x49c4('0x23')]('custom:agentconnect',ut[_0x49c4('0x7b')](_0x5d24f3,'connect',this[_0x49c4('0x10')][_0x5d24f3[_0x49c4('0x40')]]));if(_0x1ef0c1[_0x49c4('0x92')]){ami[_0x49c4('0x23')](_0x49c4('0x93'),ut[_0x49c4('0x94')](_0x5d24f3));}break;case'16':ami[_0x49c4('0x23')](_0x49c4('0x95'),ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0x96'),this[_0x49c4('0x10')][_0x5d24f3[_0x49c4('0x40')]]));emitVoiceQueueChannelRemove(ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0x96')));_0x1ef0c1[_0x49c4('0x97')]+=0x1;_0x1ef0c1[_0x49c4('0x98')]+=0x1;_0x1ef0c1[_0x49c4('0x99')]+=0x1;ut[_0x49c4('0x51')](_0x1ef0c1,'[16]');_0x5d24f3['countglobal']=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x4,'Answer');rpcDb[_0x49c4('0x6d')](_0x5d24f3,_0x49c4('0x9a'));rpcDb[_0x49c4('0x6f')](_0x5d24f3,_0x49c4('0x9b'));rpcDb['crateCustomerReportQueue'](_0x5d24f3);_0x1ef0c1['sumDuration']+=_0x5d24f3['talktime'];_0x1ef0c1[_0x49c4('0x9c')]+=_0x5d24f3[_0x49c4('0x9d')];logger[_0x49c4('0x24')](_0x49c4('0x9e'),_0x5d24f3[_0x49c4('0x8f')],_0x49c4('0x90'),_0x1ef0c1[_0x49c4('0x91')],_0x49c4('0x43'),_0x1ef0c1[_0x49c4('0x44')]);delete this['actions'][_0x207572[_0x49c4('0x88')]];break;case _0x49c4('0x9f'):_0x1ef0c1[_0x49c4('0xa0')]+=0x1;_0x5d24f3['countbusyretry']+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x5,_0x49c4('0xa1'));_0x6b2592=_0x1ef0c1[_0x49c4('0xa2')];_0xc2033f=_0x1ef0c1[_0x49c4('0xa3')];ami[_0x49c4('0x23')](_0x49c4('0xa4'),ut['buildObj'](_0x5d24f3,_0x49c4('0xa5')));rpcDb[_0x49c4('0x6d')](_0x5d24f3,_0x49c4('0xa6'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'5',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x4a204d){_0x23288e=_0x4a204d['additional']==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1['dialGlobalMaxRetry']){_0xf7a10f=ut[_0x49c4('0xa7')](_0x5d24f3,0xf,'Global');rpcDb[_0x49c4('0x6f')](_0xf7a10f,_0x49c4('0xa8'));}else{if(_0x5d24f3[_0x49c4('0xa9')]>=_0x1ef0c1[_0x49c4('0xaa')]){rpcDb['createCustomerFinal'](_0x5d24f3,_0x49c4('0xa6'));}else{rpcDb[_0x49c4('0xab')](ut[_0x49c4('0x85')](_0x5d24f3,_0x49c4('0xa9'),_0x1ef0c1[_0x49c4('0xa2')]),_0x5d24f3[_0x49c4('0x86')],_0x5d24f3[_0x49c4('0x87')]);}}}else{_0x5d24f3[_0x49c4('0xa9')]++;_0xa431d[_0x49c4('0x8b')]({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countbusyretry':_0x5d24f3['countbusyretry']}})[_0x49c4('0x5a')](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)['then'](function(){});});}});break;case _0x49c4('0xad'):_0x1ef0c1['outboundNoAnswerCallsDay']+=0x1;_0x5d24f3[_0x49c4('0xae')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x3,_0x49c4('0xaf'));_0x6b2592=_0x1ef0c1['dialNoAnswerRetryFrequency'];_0xc2033f=_0x1ef0c1[_0x49c4('0xa3')];var _0x2329b6=ut['buildNoAnswerEventPayload'](_0x5d24f3,_0x1ef0c1);ami[_0x49c4('0x23')](_0x49c4('0xb0'),_0x2329b6);rpcDb['createCustomerHistory'](_0x5d24f3,_0x49c4('0xb1'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'3',_0x1ef0c1)['then'](function(_0x37fef1){_0x23288e=_0x37fef1[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut['cloneAction'](_0x5d24f3,0xf,_0x49c4('0x83'));rpcDb[_0x49c4('0x6f')](_0xf7a10f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x5d24f3[_0x49c4('0xae')]>=_0x1ef0c1['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x5d24f3,_0x49c4('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5d24f3,_0x49c4('0xae'),_0x1ef0c1[_0x49c4('0xb2')]),_0x5d24f3['unlockAgent'],_0x5d24f3[_0x49c4('0x87')]);}}}else{_0x5d24f3['countnoanswerretry']++;_0xa431d['incrementPreviewCounters']({'id':_0x5d24f3['idContact'],'field':{'countnoanswerretry':_0x5d24f3[_0x49c4('0xae')]}})[_0x49c4('0x5a')](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});});}});break;case'CONGESTION':_0x1ef0c1['outboundCongestionCallsDay']+=0x1;_0x5d24f3[_0x49c4('0xb3')]+=0x1;_0x5d24f3['countglobal']=ut[_0x49c4('0x81')](_0x5d24f3);ut['logCustomer'](_0x5d24f3,0x8,_0x49c4('0xb4'));_0x6b2592=_0x1ef0c1[_0x49c4('0xb5')];_0xc2033f=_0x1ef0c1[_0x49c4('0xa3')];ami[_0x49c4('0x23')](_0x49c4('0xb6'),ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0xb7')));rpcDb['createCustomerHistory'](_0x5d24f3,_0x49c4('0xb8'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'8',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x16864c){_0x23288e=_0x16864c[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut['totalGlobal'](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut[_0x49c4('0xa7')](_0x5d24f3,0xf,_0x49c4('0x83'));rpcDb['createCustomerFinal'](_0xf7a10f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x5d24f3[_0x49c4('0xb3')]>=_0x1ef0c1[_0x49c4('0xb9')]){rpcDb[_0x49c4('0x6f')](_0x5d24f3,_0x49c4('0xb8'));}else{rpcDb[_0x49c4('0xab')](ut['scheduledAt'](_0x5d24f3,_0x49c4('0xb3'),_0x1ef0c1[_0x49c4('0xa2')]),_0x5d24f3[_0x49c4('0x86')],_0x5d24f3[_0x49c4('0x87')]);}}}else{_0x5d24f3['countcongestionretry']++;_0xa431d['incrementPreviewCounters']({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countcongestionretry':_0x5d24f3[_0x49c4('0xb3')]}})[_0x49c4('0x5a')](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});});}});break;case'CANCEL':_0x1ef0c1[_0x49c4('0xba')]+=0x1;_0x5d24f3[_0x49c4('0xbb')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x14,_0x49c4('0xbc'));_0x6b2592=_0x1ef0c1['dialAgentRejectRetryFrequency'];_0xc2033f=_0x1ef0c1[_0x49c4('0xa3')];ami[_0x49c4('0x23')](_0x49c4('0xbd'),ut[_0x49c4('0x7b')](_0x5d24f3,'agentreject'));rpcDb['createCustomerHistory'](_0x5d24f3,_0x49c4('0xbe'));_0xa431d['verifyAdditionalPhones'](_0x5d24f3,'20',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x532ba5){_0x23288e=_0x532ba5[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut[_0x49c4('0xa7')](_0x5d24f3,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0xf7a10f,_0x49c4('0xbf'));}else{if(_0x5d24f3[_0x49c4('0xbb')]>=_0x1ef0c1[_0x49c4('0xc0')]){rpcDb['createCustomerFinal'](_0x5d24f3,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x49c4('0xab')](ut['scheduledAt'](_0x5d24f3,'countagentrejectretry',_0x1ef0c1[_0x49c4('0xc1')]),_0x5d24f3['unlockAgent'],_0x5d24f3[_0x49c4('0x87')]);}}}else{_0x5d24f3[_0x49c4('0xae')]++;_0xa431d['incrementPreviewCounters']({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countnoanswerretry':_0x5d24f3[_0x49c4('0xae')]}})['then'](function(){_0xa431d['swapAdditionalPhones'](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});});}});break;case'ABANDONED':_0x1ef0c1[_0x49c4('0xc2')]+=0x1;_0x5d24f3[_0x49c4('0xc3')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0xb,_0x49c4('0xc4'));rpcDb[_0x49c4('0x6d')](_0x5d24f3,'[callProgressDetectingCustomer][logAbandoned]');_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'11',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x85418e){_0x23288e=_0x85418e[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1['dialGlobalMaxRetry']){_0xf7a10f=ut[_0x49c4('0xa7')](_0x5d24f3,0xf,'Global');rpcDb[_0x49c4('0x6f')](_0xf7a10f,_0x49c4('0xc5'));}else{if(_0x5d24f3[_0x49c4('0xc6')]>=_0x1ef0c1[_0x49c4('0xc7')]){rpcDb['createCustomerFinal'](_0x5d24f3,_0x49c4('0xc5'));}else{rpcDb[_0x49c4('0xab')](ut[_0x49c4('0x85')](_0x5d24f3,_0x49c4('0xc3'),_0x1ef0c1[_0x49c4('0xc8')]),_0x5d24f3[_0x49c4('0x86')],_0x5d24f3['activeContact']);}}}else{_0x5d24f3[_0x49c4('0xae')]++;_0xa431d['incrementPreviewCounters']({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countnoanswerretry':_0x5d24f3[_0x49c4('0xae')]}})[_0x49c4('0x5a')](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)['then'](function(){});});}});break;case'18':_0x1ef0c1[_0x49c4('0xc9')]+=0x1;_0x5d24f3[_0x49c4('0xca')]+=0x1;_0x5d24f3['countglobal']=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x12,_0x207572['cause-txt']||_0x207572['dialstatus']);ami[_0x49c4('0x23')](_0x49c4('0xcb'),ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0xcc')));rpcDb[_0x49c4('0x6d')](_0x5d24f3,_0x49c4('0xcd'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'18',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x2b6e61){_0x23288e=_0x2b6e61[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1['dialGlobalMaxRetry']){_0xf7a10f=ut['cloneAction'](_0x5d24f3,0x12,_0x49c4('0x83'));rpcDb[_0x49c4('0x6f')](_0xf7a10f,_0x49c4('0xcd'));}else{rpcDb['createCustomerFinal'](_0x5d24f3,_0x49c4('0xcd'));}}else{_0x5d24f3[_0x49c4('0xae')]++;_0xa431d['incrementPreviewCounters']({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countnoanswerretry':_0x5d24f3['countnoanswerretry']}})[_0x49c4('0x5a')](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});});}});delete this[_0x49c4('0x13')][_0x207572['linkedid']];break;case'19':_0x1ef0c1[_0x49c4('0xc9')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0x13,_0x207572[_0x49c4('0xce')]||_0x207572['dialstatus']);ami['emit']('custom:amd',ut[_0x49c4('0x7b')](_0x5d24f3,_0x49c4('0xcc')));rpcDb[_0x49c4('0x6d')](_0x5d24f3,_0x49c4('0xcf'));_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'18',_0x1ef0c1)['then'](function(_0x3ea304){_0x23288e=_0x3ea304[_0x49c4('0x7f')]==0x1;if(!_0x23288e){if(ut[_0x49c4('0x81')](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut['cloneAction'](_0x5d24f3,0xf,_0x49c4('0x83'));rpcDb[_0x49c4('0x6f')](_0xf7a10f,_0x49c4('0xcf'));}else{rpcDb[_0x49c4('0x6f')](_0x5d24f3,_0x49c4('0xcf'));}}else{_0x5d24f3['countnoanswerretry']++;_0xa431d[_0x49c4('0x8b')]({'id':_0x5d24f3[_0x49c4('0x8a')],'field':{'countnoanswerretry':_0x5d24f3[_0x49c4('0xae')]}})['then'](function(){_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});});}});delete this[_0x49c4('0x13')][_0x207572['linkedid']];break;default:if(_0x5d24f3[_0x49c4('0x50')]){ut['decrementTalkink'](_0x1ef0c1,'[default]');ut[_0x49c4('0x52')](_0x49c4('0xd0')+_0x1ef0c1['name'],_0x207572);}_0x1ef0c1[_0x49c4('0xc9')]+=0x1;_0x5d24f3[_0x49c4('0x79')]=ut[_0x49c4('0x81')](_0x5d24f3);ut[_0x49c4('0x67')](_0x5d24f3,0xc,_0x207572[_0x49c4('0xce')]||_0x207572[_0x49c4('0xd1')]);_0x6b2592=_0x1ef0c1[_0x49c4('0xc1')];_0xc2033f=_0x1ef0c1[_0x49c4('0xa3')];rpcDb['createCustomerHistory'](_0x5d24f3,'[callProgressDetectingCustomer][logUnknown]');_0xa431d[_0x49c4('0x7e')](_0x5d24f3,'20',_0x1ef0c1)[_0x49c4('0x5a')](function(_0x42f2db){_0x23288e=_0x42f2db['additional']==0x1;if(!_0x23288e){if(ut['totalGlobal'](_0x5d24f3)>=_0x1ef0c1[_0x49c4('0x82')]){_0xf7a10f=ut[_0x49c4('0xa7')](_0x5d24f3,0xf,_0x49c4('0x83'));rpcDb[_0x49c4('0x6f')](_0xf7a10f,_0x49c4('0xd2'));}else{rpcDb[_0x49c4('0x6f')](_0x5d24f3,_0x49c4('0xd2'));}delete this[_0x49c4('0x13')][_0x207572[_0x49c4('0x88')]];}else{_0xa431d[_0x49c4('0xac')](_0x5d24f3,_0x6b2592,_0xc2033f)[_0x49c4('0x5a')](function(){});}});}if(!(_0x5d24f3[_0x49c4('0x50')]&&_0x73840f==='16')){ut[_0x49c4('0x4e')](_0x1ef0c1,_0x49c4('0xd3'));logger['info'](_0x49c4('0xd4'),_0x5d24f3[_0x49c4('0x8f')],_0x49c4('0x90'),_0x1ef0c1[_0x49c4('0x91')],'originated:\x20',_0x1ef0c1['originated']);}if(_0x73840f!==_0x49c4('0xd5')){delete this['actions'][_0x207572[_0x49c4('0x88')]];delete this[_0x49c4('0x13')][_0x207572[_0x49c4('0xd6')]];}_0x1ef0c1[_0x49c4('0xd7')]=!![];}};Preview[_0x49c4('0x31')][_0x49c4('0xd8')]=function(_0x3238e7,_0xe9e187,_0x31ba95){if(_[_0x49c4('0xd9')](_0xe9e187)&&_0x49c4('0xda')!==typeof _0xe9e187){return;}if(_[_0x49c4('0xd9')](_0x31ba95)&&'object'!==typeof _0x31ba95){return;}switch(_0x31ba95[_0x49c4('0xdb')]){case'0':ut[_0x49c4('0xdc')](_0x3238e7,0x0,_0x49c4('0xdd'));rpcDb['createAgentHistory'](_0x3238e7,_0x49c4('0xde'));break;case'3':ut['logAgent'](_0x3238e7,0x3,_0x49c4('0xaf'));rpcDb[_0x49c4('0xdf')](_0x3238e7,_0x49c4('0xe0'));break;case'5':ut[_0x49c4('0xdc')](_0x3238e7,0x5,'Busy');rpcDb[_0x49c4('0xdf')](_0x3238e7,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x3238e7,0x8,_0x49c4('0xb4'));rpcDb[_0x49c4('0xdf')](_0x3238e7,_0x49c4('0xe1'));break;case'22':ut['logAgent'](_0x3238e7,0x16,'AnswerAGI');rpcDb[_0x49c4('0xdf')](_0x3238e7,_0x49c4('0xe2'));break;default:ut[_0x49c4('0xdc')](_0x3238e7,0xc,_0x31ba95[_0x49c4('0xdb')]);rpcDb[_0x49c4('0xdf')](_0x3238e7,_0x49c4('0xe1'));}ut[_0x49c4('0x4e')](_0xe9e187,_0x49c4('0xe3'));logger[_0x49c4('0x24')]('[originated][decrement][callProgressDetectingAgent]',_0x3238e7[_0x49c4('0x8f')],_0x49c4('0x90'),_0xe9e187['name'],'originated:\x20',_0xe9e187[_0x49c4('0xe4')]);delete this['actions'][_0x3238e7[_0x49c4('0x8f')]];};Preview['prototype'][_0x49c4('0x7e')]=function(_0x4b83a6,_0x30781e,_0x1fb51e){return cmHopperAdditionalPhone[_0x49c4('0x7e')](_0x4b83a6,_0x30781e,_0x1fb51e)[_0x49c4('0x63')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0x49c4('0x31')][_0x49c4('0xac')]=function(_0x3ce256,_0x5737b4,_0x367d3d){return cmHopperAdditionalPhone[_0x49c4('0xac')](_0x3ce256,_0x5737b4,_0x367d3d)['catch'](logger['info'](_0x49c4('0xe5')));};Preview[_0x49c4('0x31')][_0x49c4('0x8b')]=function(_0x49dc8a){return Promise[_0x49c4('0xe6')]()[_0x49c4('0x5a')](cmHopperAdditionalPhone[_0x49c4('0x8b')](_0x49dc8a))[_0x49c4('0x63')](logger['info'](_0x49c4('0xe7')));};Preview['prototype']['checkInBlack']=function(_0xf5f718,_0x171530,_0x12fda9,_0x24ff20,_0x5adb90){var _0x32b6e4=this;return new Promise(function(_0x947dd8,_0xa6f48){if(_[_0x49c4('0xe8')](_0x171530)||_['isNil'](_0x171530[_0x49c4('0xe9')])||_['isNil'](_0x171530['phone'])||_[_0x49c4('0xe8')](_0x171530[_0x49c4('0x48')])){_0xa6f48(ut[_0x49c4('0x29')]('Contact\x20is\x20undefined',_0x24ff20,_0x5adb90));return;}var _0x336853=uuid['v4']();var _0x4a874a=_0x32b6e4[_0x49c4('0x10')][_0x171530[_0x49c4('0x3f')][_0x49c4('0x91')]];var _0x3738d7=_0x12fda9?_0x32b6e4[_0x49c4('0x14')][_0x12fda9]['id']:undefined;_0x32b6e4[_0x49c4('0x13')][_0x336853]=new Action(_0x171530,_0x4a874a,_0x336853,_0x12fda9,_0x3738d7);var _0x2b31ac=_0x32b6e4['actions'][_0x336853];_0x2b31ac[_0x49c4('0x86')]=_0x24ff20;_0x2b31ac[_0x49c4('0x87')]=_0x5adb90;_0x2b31ac[_0x49c4('0xea')]=_0x12fda9;if(_[_0x49c4('0xeb')](_0xf5f718)){_0x32b6e4['execCall'](_0x2b31ac,_0x4a874a,_0x171530,_0x12fda9)['then'](function(_0x4c15ff){logger[_0x49c4('0x24')](_0x49c4('0xec'),_0x49c4('0xed')+_0x2b31ac[_0x49c4('0x40')]+_0x49c4('0xee')+_0x2b31ac[_0x49c4('0x8a')],JSON[_0x49c4('0x42')](_0x4c15ff));ami['emit'](_0x49c4('0xef'),ut[_0x49c4('0x7b')](_0x2b31ac,'called',_0x32b6e4['campaignsPreview'][_0x2b31ac['queue']]));_0x947dd8(ut[_0x49c4('0x29')](_0x49c4('0xf0')));})[_0x49c4('0x63')](function(_0x3d0013){ut[_0x49c4('0x2c')](_0x49c4('0xf1'),_0x3d0013);_0xa6f48(ut[_0x49c4('0x29')]('Call\x20failed',_0x24ff20,_0x5adb90));});}else{_0x4a874a[_0x49c4('0xf2')]+=0x1;ut[_0x49c4('0xf3')](_0x2b31ac);rpcDb[_0x49c4('0xf4')](_0x2b31ac,_0x49c4('0xf5'));delete _0x32b6e4['actions'][_0x336853];_0xa6f48(ut[_0x49c4('0x29')](_0x49c4('0xf6'),_0x24ff20,_0x5adb90));}});};Preview[_0x49c4('0x31')][_0x49c4('0x74')]=function(_0x12d707){return!_['isNil'](_0x12d707)&&!_[_0x49c4('0xe8')](_0x12d707['name'])&&!_['isNil'](_0x12d707[_0x49c4('0xf7')])&&_0x12d707[_0x49c4('0xf7')]&&!_[_0x49c4('0xe8')](this[_0x49c4('0x12')][util[_0x49c4('0x65')]('SIP/%s',_0x12d707[_0x49c4('0x91')])])&&!_[_0x49c4('0xe8')](this[_0x49c4('0x12')][util['format'](_0x49c4('0xf8'),_0x12d707[_0x49c4('0x91')])]['status'])&&(this[_0x49c4('0x12')][util[_0x49c4('0x65')](_0x49c4('0xf8'),_0x12d707[_0x49c4('0x91')])][_0x49c4('0x4b')]===_0x49c4('0xf9')||this[_0x49c4('0x12')][util['format'](_0x49c4('0xf8'),_0x12d707[_0x49c4('0x91')])][_0x49c4('0x4b')]===_0x49c4('0xfa'));};Preview[_0x49c4('0x31')]['run']=function(_0x34ce60,_0x39dc83){return this[_0x49c4('0xfb')](_0x34ce60,_0x39dc83)[_0x49c4('0x5a')](function(_0xa2c8cf){return _['pick'](_0xa2c8cf,[_0x49c4('0x29')]);})[_0x49c4('0x63')](function(_0x789121){if(_0x789121[_0x49c4('0xfc')]){rpcDb[_0x49c4('0xfd')](_0x34ce60);}if(_0x789121[_0x49c4('0xf7')]){rpcDb[_0x49c4('0x64')](_0x34ce60);}throw _[_0x49c4('0x45')](_0x789121,[_0x49c4('0x29')]);});};Preview[_0x49c4('0x31')]['execRun']=function(_0x2d3211,_0x1b6966){var _0x2c4d2a=this;var _0x1745f8,_0xe22808;return rpcDb['getContactPreview'](_0x2d3211)['then'](function(_0x13aab1){if(!_[_0x49c4('0xe8')](_0x13aab1[0x0])){_0xe22808=_0x13aab1[0x0][_0x49c4('0xfe')]?![]:!![];_0x1745f8=_0x13aab1[0x0][_0x49c4('0xfe')]?!![]:![];_0x1745f8=_0x1b6966?!![]:_0x1745f8;}var _0xd87f7e=_0x2c4d2a[_0x49c4('0xff')](_0x13aab1);if(_0xd87f7e['isValid']){rpcDb[_0x49c4('0x100')](_[_0x49c4('0x45')](_0x13aab1[0x0],['VoiceQueueId',_0x49c4('0x101')]))['then'](function(_0x30d99a){_0x2c4d2a[_0x49c4('0x102')](_0x30d99a,_0x13aab1[0x0],_0x1b6966,_0xe22808,_0x1745f8)[_0x49c4('0x5a')](function(_0x5db4a1){return _0x5db4a1;})[_0x49c4('0x63')](function(_0x4f431e){throw _0x4f431e;});})[_0x49c4('0x63')](function(_0x5025ee){ut['logger'](_0x49c4('0x103'),_0x5025ee);throw ut[_0x49c4('0x29')](_0x49c4('0x104'),_0xe22808,_0x1745f8);});}else{throw ut[_0x49c4('0x29')](_0xd87f7e[_0x49c4('0x29')],_0xe22808,_0x1745f8);}})[_0x49c4('0x63')](function(_0x5a06d7){ut['logger'](_0x49c4('0x105'),_0x5a06d7);throw ut[_0x49c4('0x29')](_0x49c4('0x104'),![],!![]);});};Preview[_0x49c4('0x31')][_0x49c4('0xff')]=function(_0x3d2dd0){if(_[_0x49c4('0xe8')](_0x3d2dd0)||_['isEmpty'](_0x3d2dd0)||!_['isNil'](_0x3d2dd0[0x0]['Agent'])&&_['isNil'](_0x3d2dd0[0x0][_0x49c4('0x5f')]['name'])){ut[_0x49c4('0x2c')](_0x49c4('0x106'),_0x3d2dd0);return{'isValid':![],'message':_0x49c4('0x107')};}var _0x53dd04=this['campaignsPreview'][_0x3d2dd0[0x0][_0x49c4('0x3f')][_0x49c4('0x91')]];_0x53dd04['message']=utils[_0x49c4('0x2a')][_0x49c4('0x76')];if(_[_0x49c4('0xe8')](_0x53dd04)){ut[_0x49c4('0x2c')](_0x49c4('0x108'),_0x53dd04);return{'isValid':![],'message':_0x49c4('0x109')};}if(!this['isTrunkReachable'](_0x53dd04[_0x49c4('0x10a')])){ut[_0x49c4('0x2c')](_0x49c4('0x10b'),'campaign\x20Name:\x20'+_0x53dd04[_0x49c4('0x91')]+_0x49c4('0x10c'));if(!this[_0x49c4('0x74')](_0x53dd04[_0x49c4('0x10d')])){ut[_0x49c4('0x2c')](_0x49c4('0x10b'),_0x53dd04[_0x49c4('0x91')]+_0x49c4('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x49c4('0x73')](_0x53dd04[_0x49c4('0x39')])){ut[_0x49c4('0x2c')](_0x49c4('0x10f'),_0x53dd04[_0x49c4('0x91')]+_0x49c4('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53dd04[_0x49c4('0x91')]+_0x49c4('0x110')};}return{'isValid':!![],'message':_0x49c4('0x111')};};Preview[_0x49c4('0x31')][_0x49c4('0x112')]=function(_0x3a8fe1,_0x29c6fc,_0x1642fd,_0x4806ac){var _0xc641bc=this;return new Promise(function(_0xcec186,_0x1c8258){var _0x471e28=_0x3a8fe1[_0x49c4('0x8f')];var _0x5a471d=_0xc641bc['isTrunkReachable'](_0x29c6fc[_0x49c4('0x10a')])?util[_0x49c4('0x65')]('SIP/%s/%s%s',_0x29c6fc['Trunk'][_0x49c4('0x91')],_['isNil'](_0x29c6fc[_0x49c4('0x113')])?'':_0x29c6fc[_0x49c4('0x113')][_0x49c4('0x114')]()||'',_0x29c6fc[_0x49c4('0x115')]>0x0?_0x1642fd[_0x49c4('0x101')][_0x49c4('0x116')](_0x29c6fc[_0x49c4('0x115')]):_0x1642fd[_0x49c4('0x101')]):util['format'](_0x49c4('0x117'),_[_0x49c4('0xe8')](_0x29c6fc[_0x49c4('0x10d')])?_0x29c6fc[_0x49c4('0x10a')][_0x49c4('0x91')]:_0x29c6fc['TrunkBackup'][_0x49c4('0x91')],_[_0x49c4('0xe8')](_0x29c6fc['dialPrefix'])?'':_0x29c6fc[_0x49c4('0x113')][_0x49c4('0x114')]()||'',_0x29c6fc['dialCutDigit']>0x0?_0x1642fd[_0x49c4('0x101')][_0x49c4('0x116')](_0x29c6fc[_0x49c4('0x115')]):_0x1642fd['phone']);var _0x1ee36e=_0xc641bc[_0x49c4('0x74')](_0x29c6fc[_0x49c4('0x10a')])?ut[_0x49c4('0x118')](_0x29c6fc['Trunk'][_0x49c4('0x119')],_0x29c6fc['dialOriginateCallerIdName'],_0x29c6fc[_0x49c4('0x11a')]>0x0?ut[_0x49c4('0x11b')](_0x29c6fc[_0x49c4('0x11c')],_0x29c6fc[_0x49c4('0x11a')]):_0x29c6fc['dialOriginateCallerIdNumber']):ut[_0x49c4('0x118')](_[_0x49c4('0xe8')](_0x29c6fc[_0x49c4('0x10d')])?_0x29c6fc[_0x49c4('0x10a')][_0x49c4('0x119')]:_0x29c6fc[_0x49c4('0x10d')]['callerid'],_0x29c6fc['dialOriginateCallerIdName'],_0x29c6fc[_0x49c4('0x11a')]>0x0?ut[_0x49c4('0x11b')](_0x29c6fc[_0x49c4('0x11c')],_0x29c6fc[_0x49c4('0x11a')]):_0x29c6fc[_0x49c4('0x11c')]);if(_0x1ee36e){_0x3a8fe1[_0x49c4('0x11d')]=ut[_0x49c4('0x11e')](_0x1ee36e);_0x3a8fe1[_0x49c4('0x11f')]=ut[_0x49c4('0x120')](_0x1ee36e);}var _0x37dbbf=ut[_0x49c4('0x121')](_0x29c6fc,_0x1642fd,_0x5a471d,_0x1ee36e,_0x471e28,_0x3a8fe1);_[_0x49c4('0x122')](_0x3a8fe1,ut['toLowerVariables'](_0x37dbbf));_0x3a8fe1[_0x49c4('0x123')]=moment()[_0x49c4('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x29c6fc[_0x49c4('0x124')]=_0x37dbbf;var _0x5adc01=ut[_0x49c4('0x125')](_0x3a8fe1,_0x29c6fc,_0x37dbbf,_0x3a8fe1[_0x49c4('0x87')],_0x4806ac);return ami['Action'](_0x5adc01)[_0x49c4('0x5a')](function(_0x245fae){_0x29c6fc[_0x49c4('0xe4')]+=0x1;logger[_0x49c4('0x24')](_0x49c4('0x126'),_0x471e28,'\x20Queue',_0x29c6fc[_0x49c4('0x91')],'originated:\x20',_0x29c6fc[_0x49c4('0xe4')]);_0xcec186(_0x245fae);})[_0x49c4('0x63')](function(_0x294b2c){ut['logAgent'](_0x3a8fe1,0xe,_0x49c4('0x127'));rpcDb[_0x49c4('0xdf')](_0x3a8fe1,_0x49c4('0x128'));_0x1c8258(_0x294b2c);});});};Preview['prototype']['syncNewExten']=function(_0x256d6b){if(this[_0x49c4('0x13')][_0x256d6b[_0x49c4('0x88')]]){this[_0x49c4('0x13')][_0x256d6b[_0x49c4('0x88')]][_0x49c4('0x4c')]=_0x256d6b['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x2eae62){var _0x417cef=this;var _0x153450=this[_0x49c4('0x13')][_0x2eae62['actionid']];if(_0x153450){if(_0x153450[_0x49c4('0xea')]&&this[_0x49c4('0x14')][_0x153450[_0x49c4('0xea')]]){ut[_0x49c4('0x129')](_0x153450,this[_0x49c4('0x14')][_0x153450[_0x49c4('0xea')]][_0x49c4('0x91')],this[_0x49c4('0x14')][_0x153450[_0x49c4('0xea')]]['id']);}var _0x39e6f5=_[_0x49c4('0x12a')](_0x153450);_0x39e6f5['responsetime']=moment()[_0x49c4('0x65')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3308c4=_0x417cef[_0x49c4('0x10')][_0x153450[_0x49c4('0x40')]];if(ut[_0x49c4('0x12b')](_0x2eae62['response'])){if(_0x153450[_0x49c4('0x86')]){rpcDb['unlockContact'](_0x153450['idContact']);}if(_0x153450['activeContact']){rpcDb[_0x49c4('0x64')](_0x153450[_0x49c4('0x8a')]);}ami[_0x49c4('0x23')]('custom:agentringnoanswer',ut[_0x49c4('0x7b')](_0x153450,'rejected',this[_0x49c4('0x10')][_0x153450[_0x49c4('0x40')]]));this[_0x49c4('0xd8')](_0x39e6f5,_0x3308c4,_0x2eae62);}else{_0x153450['starttime']=moment()[_0x49c4('0x65')](_0x49c4('0x66'));ut[_0x49c4('0xdc')](_0x39e6f5,0x4,_0x49c4('0x12c'));rpcDb[_0x49c4('0xdf')](_0x39e6f5,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x49c4('0x31')][_0x49c4('0x1a')]=function(_0x15e35f){var _0x6b1554=this['actions'][_0x15e35f['linkedid']];var _0x238884;if(_0x6b1554){_0x238884=this[_0x49c4('0x10')][_0x6b1554['queue']];logger[_0x49c4('0x24')](_0x49c4('0x12d'),_0x15e35f[_0x49c4('0x88')],_0x49c4('0x90'),_0x238884['name'],_0x49c4('0x43'),_0x238884[_0x49c4('0x44')]);}if(this['actions'][_0x15e35f['linkedid']]&&_0x15e35f[_0x49c4('0x88')]!==_0x15e35f[_0x49c4('0x8f')]){if(_0x15e35f[_0x49c4('0x12e')]==='16'&&this[_0x49c4('0x13')][_0x15e35f[_0x49c4('0x88')]]['dialAnswer']){this[_0x49c4('0x77')](_0x15e35f,_0x15e35f['linkedid'],_0x15e35f[_0x49c4('0x12e')]);}else if(this[_0x49c4('0x13')][_0x15e35f[_0x49c4('0x88')]][_0x49c4('0x50')]){logger['info']('[syncHangup][talking][cause]',_0x15e35f['linkedid'],_0x15e35f[_0x49c4('0x12e')],_0x49c4('0x90'),_0x238884[_0x49c4('0x91')],_0x49c4('0x43'),_0x238884['pTalking']);this['callProgressDetectingCustomer'](_0x15e35f,_0x15e35f[_0x49c4('0x88')],_0x15e35f['cause']);}}else if(_0x6b1554&&_[_0x49c4('0xe8')](_0x6b1554[_0x49c4('0x12f')])&&_0x238884['dialQueueProject']&&_0x15e35f[_0x49c4('0x88')]===_0x15e35f[_0x49c4('0x8f')]&&_[_0x49c4('0xe8')](_0x15e35f['reason'])&&_0x15e35f[_0x49c4('0x12e')]==='16'&&_0x15e35f[_0x49c4('0x130')]==='6'&&_[_0x49c4('0xd9')](_0x6b1554['transfer'])){if(_0x6b1554[_0x49c4('0x86')]){rpcDb[_0x49c4('0xfd')](_0x6b1554['idContact']);}if(_0x6b1554[_0x49c4('0x87')]){rpcDb[_0x49c4('0x64')](_0x6b1554['idContact']);}_0x15e35f[_0x49c4('0xdb')]='22';this[_0x49c4('0xd8')](_0x6b1554,_0x238884,_0x15e35f);}else if(_0x6b1554&&_0x6b1554[_0x49c4('0x131')]){if(_0x15e35f[_0x49c4('0x12e')]==='16'&&this[_0x49c4('0x13')][_0x15e35f['linkedid']][_0x49c4('0x50')]){logger[_0x49c4('0x24')]('[syncHangup][talking][transfer]',_0x15e35f[_0x49c4('0x88')],_0x15e35f[_0x49c4('0x12e')],_0x49c4('0x90'),_0x238884['name'],_0x49c4('0x43'),_0x238884['pTalking']);this[_0x49c4('0x77')](_0x15e35f,_0x15e35f[_0x49c4('0x88')],_0x15e35f['cause']);}else if(this[_0x49c4('0x13')][_0x15e35f['linkedid']][_0x49c4('0x50')]){logger[_0x49c4('0x24')]('[syncHangup][talking][cause]',_0x15e35f[_0x49c4('0x88')],_0x15e35f[_0x49c4('0x12e')],'\x20Queue',_0x238884['name'],_0x49c4('0x43'),_0x238884[_0x49c4('0x44')]);this[_0x49c4('0x77')](_0x15e35f,_0x15e35f[_0x49c4('0x88')],_0x15e35f[_0x49c4('0x12e')]);}}};Preview['prototype'][_0x49c4('0x1d')]=function(_0x40afb8){if(this[_0x49c4('0x13')][_0x40afb8[_0x49c4('0xd6')]]&&_0x40afb8[_0x49c4('0xd6')]!==_0x40afb8['destuniqueid']){this[_0x49c4('0x77')](_0x40afb8,_0x40afb8[_0x49c4('0xd6')],_0x40afb8[_0x49c4('0xd1')]);}};Preview[_0x49c4('0x31')][_0x49c4('0x1b')]=function(_0x39abbf){if(this[_0x49c4('0x13')][_0x39abbf[_0x49c4('0x88')]]&&_0x39abbf['linkedid']!==_0x39abbf[_0x49c4('0x8f')]&&!this[_0x49c4('0x13')][_0x39abbf[_0x49c4('0x88')]]['dialAnswer']){if(_0x39abbf['cause']==='1'){this[_0x49c4('0x77')](_0x39abbf,_0x39abbf['linkedid'],_0x39abbf[_0x49c4('0x12e')]);}}};Preview[_0x49c4('0x31')][_0x49c4('0x132')]=function(_0x3f0e74,_0x55f423,_0x3ce0f9){if(this[_0x49c4('0x13')][_0x3f0e74]){if(_[_0x49c4('0xe8')](this[_0x49c4('0x13')][_0x3f0e74]['variables'])){this[_0x49c4('0x13')][_0x3f0e74][_0x49c4('0x124')]={};}this['actions'][_0x3f0e74][_0x49c4('0x124')][_0x55f423]=_0x3ce0f9;}};Preview[_0x49c4('0x31')][_0x49c4('0x133')]=function(_0x72eab6){try{if(!_[_0x49c4('0xe8')](_0x72eab6)){if(ut[_0x49c4('0x134')](_[_0x49c4('0x135')](_0x72eab6[_0x49c4('0x136')])[0x0])){this['addVariable'](_0x72eab6['uniqueid'],_['keys'](_0x72eab6[_0x49c4('0x136')])[0x0],_0x72eab6[_0x49c4('0x137')]);}}}catch(_0x418ead){logger[_0x49c4('0x138')](_0x49c4('0x139'),util['inspect'](_0x418ead,{'showHidden':![],'depth':null}));}};Preview[_0x49c4('0x31')][_0x49c4('0x20')]=function(_0x9786bf){if(_0x9786bf){if(this[_0x49c4('0x13')][_0x9786bf['transfertargetlinkedid']]){this['actions'][_0x9786bf[_0x49c4('0x13a')]][_0x49c4('0x131')]=!![];}}};Preview[_0x49c4('0x31')][_0x49c4('0x13b')]=function(_0x281151){if(_0x281151){if(this[_0x49c4('0x13')][_0x281151['transfererlinkedid']]){this['actions'][_0x281151[_0x49c4('0x13c')]][_0x49c4('0x131')]=!![];}}};module[_0x49c4('0x13d')]=Preview;
\ No newline at end of file
index 0af5a59..09df111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf35=['resolve','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0xdf35,0x163));var _0x5df3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xdf35[_0x199572];return _0x13cfa3;};'use strict';var util=require(_0x5df3('0x0'));var BPromise=require(_0x5df3('0x1'));var logger=require(_0x5df3('0x2'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x5df3('0x3'));var cmHopperBlack=require(_0x5df3('0x4'));var agentReportPreview=require(_0x5df3('0x5'));var voiceQueueReport=require(_0x5df3('0x6'));function loggerCatch(_0x330aaa){return function(_0x7bcbaa){logger[_0x5df3('0x7')](_0x330aaa,util['inspect'](_0x7bcbaa,{'showHidden':![],'depth':null}));};}function create(_0x331617){return cmHopperHistory[_0x5df3('0x8')](_0x331617)[_0x5df3('0x9')](loggerCatch(_0x5df3('0xa')));}function createAgent(_0x3cf34a){return BPromise['resolve']()[_0x5df3('0xb')](agentReportPreview[_0x5df3('0x8')](_0x3cf34a))[_0x5df3('0x9')](loggerCatch(_0x5df3('0xa')));}function moveContact(_0x540cf0){return cmHopper[_0x5df3('0xc')](_0x540cf0,!![])[_0x5df3('0x9')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x5df3('0xd')]=function(_0x436d1d){return cmHopperBlack[_0x5df3('0xd')](_0x436d1d)[_0x5df3('0x9')](loggerCatch(_0x5df3('0xe')));};exports[_0x5df3('0xf')]=function(_0x58536a){return BPromise['resolve']()[_0x5df3('0xb')](cmHopper[_0x5df3('0xf')](_0x58536a))[_0x5df3('0x9')](loggerCatch(_0x5df3('0x10')));};exports[_0x5df3('0x8')]=function(_0x1e4ffb,_0x45bb29){create(_0x1e4ffb)['catch'](loggerCatch(_0x45bb29));moveContact(_0x1e4ffb)[_0x5df3('0x9')](loggerCatch(_0x45bb29));};exports[_0x5df3('0x11')]=function(_0x11530e,_0x357f9b){createAgent(_0x11530e)[_0x5df3('0x9')](loggerCatch(_0x357f9b));};exports[_0x5df3('0x12')]=function(_0x3da367,_0x3927f6){create(_0x3da367)[_0x5df3('0x9')](loggerCatch(_0x3927f6));};exports[_0x5df3('0x13')]=function(_0x1fcd2b,_0x4f0224){moveContact(_0x1fcd2b)['catch'](loggerCatch(_0x4f0224));};exports['rescheduleContact']=function(_0x4ac352,_0x5f4abf,_0x2f9e40){if(_0x5f4abf){_0x4ac352[_0x5df3('0x14')]=null;}if(_0x2f9e40){_0x4ac352[_0x5df3('0x15')]=![];}return cmHopper[_0x5df3('0x16')](_0x4ac352)[_0x5df3('0x9')](loggerCatch(_0x5df3('0x17')));};exports[_0x5df3('0x18')]=function(_0xb2b6e){return cmHopper['countReScheduled'](_0xb2b6e)[_0x5df3('0x9')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x74ff75){return cmHopper[_0x5df3('0x19')]({'UserId':null},_0x74ff75,0x1)['catch'](loggerCatch(_0x5df3('0x1a')));};exports[_0x5df3('0x1b')]=function(_0x536096){return cmHopper[_0x5df3('0x19')]({'active':![]},_0x536096,0x1)[_0x5df3('0x9')](loggerCatch(_0x5df3('0x1c')));};exports[_0x5df3('0x1d')]=function(_0x1f7923){var _0x3e516e={};_0x3e516e[_0x5df3('0x1e')]=_0x1f7923['type'];_0x3e516e[_0x5df3('0x1f')]=_0x1f7923['uniqueid'];_0x3e516e[_0x5df3('0x20')]=_0x1f7923['calleridnum'];_0x3e516e[_0x5df3('0x21')]=_0x1f7923[_0x5df3('0x21')];_0x3e516e['queue']=_0x1f7923[_0x5df3('0x22')];_0x3e516e[_0x5df3('0x23')]=_0x1f7923[_0x5df3('0x24')];_0x3e516e[_0x5df3('0x25')]=_0x1f7923[_0x5df3('0x24')];_0x3e516e[_0x5df3('0x26')]=0x1;_0x3e516e[_0x5df3('0x27')]=_0x1f7923[_0x5df3('0x28')];_0x3e516e[_0x5df3('0x29')]=_0x1f7923[_0x5df3('0x2a')];_0x3e516e[_0x5df3('0x2b')]='from-sip';_0x3e516e[_0x5df3('0x2c')]=_0x5df3('0x2d');_0x3e516e[_0x5df3('0x2e')]=0x0;_0x3e516e[_0x5df3('0x2f')]=0x1;_0x3e516e[_0x5df3('0x30')]=_0x1f7923[_0x5df3('0x2a')];_0x3e516e[_0x5df3('0x31')]=_0x5df3('0x32');return BPromise[_0x5df3('0x33')]()[_0x5df3('0xb')](voiceQueueReport[_0x5df3('0x34')](_0x3e516e))[_0x5df3('0x9')](loggerCatch(_0x5df3('0x35')));};exports[_0x5df3('0x36')]=function(_0x254ec2,_0x1ce6e1){return BPromise[_0x5df3('0x33')]()[_0x5df3('0xb')](cmHopper[_0x5df3('0x36')](_0x254ec2,_0x1ce6e1))[_0x5df3('0x9')](loggerCatch(_0x5df3('0x37')));};exports[_0x5df3('0x38')]=function(_0x2da85b){return cmHopper[_0x5df3('0x16')](_0x2da85b,!![],!![])[_0x5df3('0x9')](loggerCatch(_0x5df3('0x39')));};
\ No newline at end of file
+var _0x2d91=['resolve','then','createHistory','[createHistory]\x20','catch','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','exten','assigned','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect'];(function(_0x5390a3,_0x4d60f7){var _0x45d220=function(_0x47904f){while(--_0x47904f){_0x5390a3['push'](_0x5390a3['shift']());}};_0x45d220(++_0x4d60f7);}(_0x2d91,0x1c2));var _0x12d9=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x2d91[_0x2e986d];return _0x351c79;};'use strict';var util=require(_0x12d9('0x0'));var BPromise=require(_0x12d9('0x1'));var logger=require(_0x12d9('0x2'))('preview');var cmHopper=require(_0x12d9('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x12d9('0x4'));var agentReportPreview=require(_0x12d9('0x5'));var voiceQueueReport=require(_0x12d9('0x6'));function loggerCatch(_0x2d6dfe){return function(_0x1feb5b){logger[_0x12d9('0x7')](_0x2d6dfe,util[_0x12d9('0x8')](_0x1feb5b,{'showHidden':![],'depth':null}));};}function create(_0x15a484){return cmHopperHistory['createHistory'](_0x15a484)['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x5b659d){return BPromise[_0x12d9('0x9')]()[_0x12d9('0xa')](agentReportPreview[_0x12d9('0xb')](_0x5b659d))['catch'](loggerCatch(_0x12d9('0xc')));}function moveContact(_0x2a8d9c){return cmHopper['moveContactManagedDialer'](_0x2a8d9c,!![])[_0x12d9('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x12d9('0xe')]=function(_0x285d9d){return cmHopperBlack[_0x12d9('0xe')](_0x285d9d)['catch'](loggerCatch(_0x12d9('0xf')));};exports['getContactPreview']=function(_0x556ecd){return BPromise[_0x12d9('0x9')]()[_0x12d9('0xa')](cmHopper['getContactPreview'](_0x556ecd))[_0x12d9('0xd')](loggerCatch(_0x12d9('0x10')));};exports[_0x12d9('0xb')]=function(_0x4529e9,_0x37efea){create(_0x4529e9)[_0x12d9('0xd')](loggerCatch(_0x37efea));moveContact(_0x4529e9)[_0x12d9('0xd')](loggerCatch(_0x37efea));};exports[_0x12d9('0x11')]=function(_0x2bc25f,_0x25e511){createAgent(_0x2bc25f)[_0x12d9('0xd')](loggerCatch(_0x25e511));};exports[_0x12d9('0x12')]=function(_0x10118d,_0x4c55ff){create(_0x10118d)[_0x12d9('0xd')](loggerCatch(_0x4c55ff));};exports[_0x12d9('0x13')]=function(_0x4473d2,_0x3fe58c){moveContact(_0x4473d2)['catch'](loggerCatch(_0x3fe58c));};exports['rescheduleContact']=function(_0x183f1b,_0x8abb59,_0x4a8111){if(_0x8abb59){_0x183f1b[_0x12d9('0x14')]=null;}if(_0x4a8111){_0x183f1b['active']=![];}return cmHopper[_0x12d9('0x15')](_0x183f1b)[_0x12d9('0xd')](loggerCatch(_0x12d9('0x16')));};exports[_0x12d9('0x17')]=function(_0x4cd29a){return cmHopper[_0x12d9('0x17')](_0x4cd29a)[_0x12d9('0xd')](loggerCatch(_0x12d9('0x18')));};exports[_0x12d9('0x19')]=function(_0x20e4de){return cmHopper[_0x12d9('0x19')]({'UserId':null},_0x20e4de,0x1)['catch'](loggerCatch(_0x12d9('0x1a')));};exports['disableContact']=function(_0x1d92dc){return cmHopper[_0x12d9('0x19')]({'active':![]},_0x1d92dc,0x1)[_0x12d9('0xd')](loggerCatch(_0x12d9('0x1b')));};exports[_0x12d9('0x1c')]=function(_0x55409a){var _0x583682={};_0x583682[_0x12d9('0x1d')]=_0x55409a[_0x12d9('0x1d')];_0x583682[_0x12d9('0x1e')]=_0x55409a[_0x12d9('0x1e')];_0x583682[_0x12d9('0x1f')]=_0x55409a[_0x12d9('0x1f')];_0x583682['calleridname']=_0x55409a[_0x12d9('0x20')];_0x583682[_0x12d9('0x21')]=_0x55409a[_0x12d9('0x21')];_0x583682[_0x12d9('0x22')]=_0x55409a[_0x12d9('0x23')];_0x583682[_0x12d9('0x24')]=_0x55409a[_0x12d9('0x23')];_0x583682[_0x12d9('0x25')]=0x1;_0x583682['queuecallercompleteAt']=_0x55409a[_0x12d9('0x26')];_0x583682[_0x12d9('0x27')]=_0x55409a[_0x12d9('0x28')];_0x583682[_0x12d9('0x29')]='from-sip';_0x583682[_0x12d9('0x2a')]='xcally-motion-preview';_0x583682['holdtime']=0x0;_0x583682[_0x12d9('0x2b')]=0x1;_0x583682['lastAssignedTo']=_0x55409a[_0x12d9('0x28')];_0x583682['queuecallerexitreason']=_0x12d9('0x2c');return BPromise[_0x12d9('0x9')]()['then'](voiceQueueReport[_0x12d9('0x2d')](_0x583682))['catch'](loggerCatch(_0x12d9('0x2e')));};exports['getContactRecallMe']=function(_0x4e115b,_0x5b4c02){return BPromise[_0x12d9('0x9')]()[_0x12d9('0xa')](cmHopper[_0x12d9('0x2f')](_0x4e115b,_0x5b4c02))[_0x12d9('0xd')](loggerCatch(_0x12d9('0x30')));};exports[_0x12d9('0x31')]=function(_0xe16b00){return cmHopper[_0x12d9('0x15')](_0xe16b00,!![],!![])['catch'](loggerCatch(_0x12d9('0x32')));};
\ No newline at end of file
index 21ebb1e..629a39a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a2=['replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','info','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','statedesc','responsetime','ringtime','getSeconds','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','active','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow'];(function(_0x1ef2e7,_0x5404db){var _0x1cc129=function(_0x4e66f7){while(--_0x4e66f7){_0x1ef2e7['push'](_0x1ef2e7['shift']());}};_0x1cc129(++_0x5404db);}(_0xe4a2,0x1cd));var _0x2e4a=function(_0x20f9cb,_0x23d168){_0x20f9cb=_0x20f9cb-0x0;var _0x41ce92=_0xe4a2[_0x20f9cb];return _0x41ce92;};'use strict';var util=require('util');var _=require(_0x2e4a('0x0'));var moment=require(_0x2e4a('0x1'));var logger=require(_0x2e4a('0x2'))(_0x2e4a('0x3'));var ipAgi=process[_0x2e4a('0x4')][_0x2e4a('0x5')]||_0x2e4a('0x6');var utils=require(_0x2e4a('0x7'));exports[_0x2e4a('0x8')]=function(_0x381582){return function(_0x54630a){logger[_0x2e4a('0x9')](_0x381582,util[_0x2e4a('0xa')](_0x54630a,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x26656c,_0x25e7dd){logger[_0x2e4a('0xb')](_0x26656c,util[_0x2e4a('0xa')](_0x25e7dd,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x40c27e,_0x387866){logger[_0x2e4a('0x9')](_0x40c27e,util['inspect'](_0x387866,{'showHidden':![],'depth':null}));};exports[_0x2e4a('0xc')]=function(_0x1ddfed){return function(_0x19982e){logger['info'](_0x1ddfed,util[_0x2e4a('0xa')](_0x19982e,{'showHidden':![],'depth':null}));};};exports[_0x2e4a('0xd')]=function(_0x36c9eb,_0x939a96,_0x1861a0){return{'message':_0x36c9eb,'unlock':_0x939a96,'active':_0x1861a0};};exports[_0x2e4a('0xe')]=function(_0x16f3ab,_0xac44d8,_0x2f1021){if(!_['isUndefined'](_0x2f1021)&&_0x2e4a('0xf')===typeof _0x2f1021&&!_[_0x2e4a('0x10')](_0x2f1021)){if(!_['isUndefined'](_0xac44d8)&&'string'===typeof _0xac44d8&&!_[_0x2e4a('0x10')](_0xac44d8)){return util[_0x2e4a('0x11')](_0x2e4a('0x12'),_0xac44d8,_0x2f1021);}return util[_0x2e4a('0x11')](_0x2e4a('0x12'),_0x2f1021,_0x2f1021);}if(!_['isUndefined'](_0x16f3ab)&&_0x2e4a('0xf')===typeof _0x16f3ab&&!_[_0x2e4a('0x10')](_0x16f3ab)){return _0x16f3ab;}return _0x2e4a('0x13');};exports[_0x2e4a('0x14')]=function(_0x32e7d6){if(_[_0x2e4a('0x15')](_0x32e7d6)){return![];}return _0x32e7d6;};exports[_0x2e4a('0x16')]=function(_0x437220,_0x2052c2,_0xf1b570,_0xa014ad,_0x5a8036,_0x370864){var _0x5ce838={'XMD-QUEUE':_0x2052c2[_0x2e4a('0x17')]?_0x2052c2[_0x2e4a('0x17')][_0x2e4a('0x18')]:'','XMD-CALLERID':_0xa014ad,'XMD-CALLERID-PREVIEW':_0x370864?util[_0x2e4a('0x11')](_0x2e4a('0x12'),_0x370864[_0x2e4a('0x19')],_0x370864[_0x2e4a('0x1a')]):_0xa014ad,'XMD-DIALID':_0x5a8036,'XMD-CONTACTID':_0x2052c2[_0x2e4a('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xa014ad,'XMD-VOICEQUEUEID':_0x2052c2[_0x2e4a('0x1c')],'XMD-DIALCHANNEL':_0xf1b570,'XMD-DIALTIMEOUT':_0x437220[_0x2e4a('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x2e4a('0x11')]('\x22rtTxX%s%s\x22',_0x437220[_0x2e4a('0x1e')]?'g':'',_[_0x2e4a('0x10')](_0x437220[_0x2e4a('0x1f')])?'':_0x2e4a('0x20')),'XMD-DIALURL':_0x437220[_0x2e4a('0x21')]||'','XMD-AGI':_0x437220['dialQueueProject']?util[_0x2e4a('0x11')](_0x2e4a('0x22'),ipAgi,_0x437220[_0x2e4a('0x23')]):'NONE','XMD-AGIAFTER':_0x437220[_0x2e4a('0x1e')]?util['format'](_0x2e4a('0x22'),ipAgi,_0x437220[_0x2e4a('0x1e')]):_0x2e4a('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x370864?_0x370864['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x370864?_0x370864[_0x2e4a('0x25')]:'','XMD-DESTINATION':_0x2e4a('0x26'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x437220[_0x2e4a('0x1f')])){_0x5ce838[util[_0x2e4a('0x11')]('%s',_0x2e4a('0x27'))]=_0x437220[_0x2e4a('0x1f')];_0x5ce838[util[_0x2e4a('0x11')]('%s',_0x2e4a('0x28'))]=_0x5a8036;}if(_0x2052c2&&_0x2052c2[_0x2e4a('0x29')]){for(var _0x3fbd2b in _0x2052c2[_0x2e4a('0x29')]){if(_0x2052c2[_0x2e4a('0x29')]['hasOwnProperty'](_0x3fbd2b)){if(!_[_0x2e4a('0x15')](_0x2052c2[_0x2e4a('0x29')][_0x3fbd2b])&&_0x3fbd2b!=='id'&&_0x3fbd2b!==_0x2e4a('0x2a')&&_0x3fbd2b!=='createdAt'&&_0x3fbd2b!==_0x2e4a('0x2b')){_0x5ce838[util[_0x2e4a('0x11')](_0x2e4a('0x2c'),'XMD-',_[_0x2e4a('0x2d')](_0x3fbd2b))]=_0x2052c2[_0x2e4a('0x29')][_0x3fbd2b];}}}}return _0x5ce838;};exports[_0x2e4a('0x2e')]=function(_0x232904){var _0x2d9495={};for(var _0x37db61 in _0x232904){if(_0x232904[_0x2e4a('0x2f')](_0x37db61)){_0x2d9495[util[_0x2e4a('0x11')]('%s',_[_0x2e4a('0x30')](_0x37db61))]=_0x232904[_0x37db61];}}return{'variables':_0x2d9495};};exports[_0x2e4a('0x31')]=function(_0x5085cf,_0x260022){if(!_[_0x2e4a('0x15')](_0x5085cf)){if(_0x5085cf[_0x2e4a('0x2f')](_0x2e4a('0x32'))){if(_0x5085cf[_0x2e4a('0x32')]>0x0){_0x5085cf[_0x2e4a('0x32')]-=0x1;}else{logger['error'](_0x2e4a('0x33'),_0x260022);}}}else{logger[_0x2e4a('0x9')](_0x2e4a('0x34'),_0x260022);}};exports['logBlacklist']=function(_0x13ff6d){var _0x4f6c15=moment()[_0x2e4a('0x11')](_0x2e4a('0x35'));_0x13ff6d[_0x2e4a('0x36')]=0xd;_0x13ff6d['statedesc']=_0x2e4a('0x37');_0x13ff6d[_0x2e4a('0x38')]=_0x4f6c15;_0x13ff6d['responsetime']=_0x4f6c15;_0x13ff6d[_0x2e4a('0x39')]=_0x4f6c15;};exports[_0x2e4a('0x3a')]=function(_0x2e2e59,_0x5047f0,_0xdaa620){var _0xc538e=moment()['format'](_0x2e4a('0x35'));_0x2e2e59[_0x2e4a('0x36')]=_0x5047f0;_0x2e2e59[_0x2e4a('0x3b')]=_0xdaa620;_0x2e2e59[_0x2e4a('0x3c')]=_0xc538e;_0x2e2e59[_0x2e4a('0x3d')]=utils[_0x2e4a('0x3e')](_0x2e2e59[_0x2e4a('0x3c')],_0x2e2e59[_0x2e4a('0x38')]);};exports[_0x2e4a('0x3f')]=function(_0x298962,_0xeb3b5c,_0x537df8){_0x298962['membername']=_0xeb3b5c;_0x298962[_0x2e4a('0x40')]=_0x537df8;};exports[_0x2e4a('0x41')]=function(_0x37a1b1,_0x34e7c8,_0x1af293){var _0x299b31=moment()[_0x2e4a('0x11')](_0x2e4a('0x35'));_0x37a1b1['state']=_0x34e7c8;_0x37a1b1[_0x2e4a('0x3b')]=_0x1af293;_0x37a1b1[_0x2e4a('0x3c')]=_0x37a1b1['responsetime']?_0x37a1b1['responsetime']:_0x299b31;_0x37a1b1[_0x2e4a('0x39')]=_0x37a1b1['endtime']?_0x37a1b1[_0x2e4a('0x39')]:_0x299b31;_0x37a1b1[_0x2e4a('0x3d')]=utils['getSeconds'](_0x37a1b1[_0x2e4a('0x3c')]||0x0,_0x37a1b1[_0x2e4a('0x38')]||0x0);_0x37a1b1[_0x2e4a('0x42')]=_0x37a1b1[_0x2e4a('0x43')]?utils[_0x2e4a('0x3e')](_0x37a1b1['endtime'],_0x37a1b1[_0x2e4a('0x43')]):0x0;};exports[_0x2e4a('0x44')]=function(_0x413691){return _0x413691===_0x2e4a('0x45');};exports[_0x2e4a('0x46')]=function(_0x478f80,_0x4c8f05,_0x3bb836,_0x24f20e,_0x48fd42){var _0x106631=_0x24f20e?_0x2e4a('0x47'):_0x478f80[_0x2e4a('0x19')];_0x106631=_0x48fd42?'BOOKED':_0x106631;return{'actionid':_0x478f80[_0x2e4a('0x48')],'action':'originate','channel':_0x478f80[_0x2e4a('0x49')],'callerid':util[_0x2e4a('0x11')](_0x2e4a('0x12'),_0x106631,_0x478f80[_0x2e4a('0x1a')]),'Exten':_0x2e4a('0x26'),'Context':'from-sip','Priority':'1','variable':_0x3bb836,'timeout':(_0x4c8f05[_0x2e4a('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x478f80[_0x2e4a('0x48')]};};exports[_0x2e4a('0x4b')]=function(_0x248f14){return _0x248f14[_0x2e4a('0x4c')]+_0x248f14[_0x2e4a('0x4d')]+_0x248f14[_0x2e4a('0x4e')]+_0x248f14['countagentrejectretry']+_0x248f14['countnosuchnumberretry'];};exports[_0x2e4a('0x4f')]=function(_0x198c80){var _0x2a32e3=_[_0x2e4a('0x50')](_0x198c80);_0x2a32e3['state']=0xf;_0x2a32e3[_0x2e4a('0x3b')]=_0x2e4a('0x51');return _0x2a32e3;};exports['scheduledAt']=function(_0x54f81f,_0x4d1097,_0x2f0dec){var _0x2ecb9f={};_0x2ecb9f[_0x4d1097]=_0x54f81f[_0x4d1097];_0x2ecb9f[_0x2e4a('0x52')]=![];_0x2ecb9f[_0x2e4a('0x53')]=moment()[_0x2e4a('0x54')](_0x2f0dec,_0x2e4a('0x55'))[_0x2e4a('0x11')](_0x2e4a('0x35'));_0x2ecb9f[_0x2e4a('0x1b')]=_0x54f81f[_0x2e4a('0x1b')];_0x2ecb9f['ListId']=_0x54f81f['ListId'];_0x2ecb9f[_0x2e4a('0x1c')]=_0x54f81f[_0x2e4a('0x1c')]||undefined;return _0x2ecb9f;};exports[_0x2e4a('0x56')]=function(_0x1b708c,_0x8db23e){if(!_[_0x2e4a('0x15')](_0x1b708c)){if(_0x1b708c[_0x2e4a('0x57')]>0x0){_0x1b708c['pTalking']-=0x1;}else{logger[_0x2e4a('0x9')](_0x8db23e,_0x2e4a('0x58'));}}else{logger[_0x2e4a('0x9')](_0x8db23e,_0x2e4a('0x59'));}};exports['IsNotLoggedIn']=function(_0x267b7a){if(_0x267b7a<=0x0){return!![];}return![];};function buildObj(_0x4b820a,_0x4d4a1b,_0x2f3572){_0x4b820a['lastevent']=_0x4d4a1b;_0x4b820a[_0x2e4a('0x18')]=_0x4b820a[_0x2e4a('0x5a')];_0x4b820a[_0x2e4a('0x5b')]=_0x4b820a['channelAgent'];_0x4b820a[_0x2e4a('0x5c')]='voice';if(_0x2f3572){_0x4b820a[_0x2e4a('0x5d')]=_0x2f3572[_0x2e4a('0x5d')];}return _0x4b820a;}exports[_0x2e4a('0x5e')]=buildObj;exports[_0x2e4a('0x5f')]=function(_0x19e7d8){var _0x5ae79a={};_0x5ae79a['queue']=_0x19e7d8['queue'];_0x5ae79a[_0x2e4a('0x5b')]=_0x19e7d8['channelAgent'];_0x5ae79a[_0x2e4a('0x48')]=_0x19e7d8['uniqueid'];return _0x5ae79a;};exports[_0x2e4a('0x60')]=function(_0x31eb3c){var _0x3979cf=[];for(var _0x37e95f in _0x31eb3c){if(_0x31eb3c[_0x2e4a('0x2f')](_0x37e95f)){if(!_[_0x2e4a('0x15')](_0x31eb3c[_0x37e95f])&&_0x31eb3c[_0x37e95f][_0x2e4a('0x36')]===_0x2e4a('0x61')&&_0x31eb3c[_0x37e95f][_0x2e4a('0x62')]==='reachable'){_0x3979cf[_0x2e4a('0x63')](_0x31eb3c[_0x37e95f]['id']);}}}return _0x3979cf;};exports[_0x2e4a('0x64')]=function(_0x2f56bf){var _0x54c296=moment()[_0x2e4a('0x65')](0x0);var _0x219c56=moment(_0x2f56bf)[_0x2e4a('0x65')](0x0);return _0x54c296[_0x2e4a('0x66')](_0x219c56,_0x2e4a('0x67'));};exports[_0x2e4a('0x68')]=function(_0xc47ab5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xc47ab5[_0x2e4a('0x1b')],'ListId':_0xc47ab5['ListId'],'VoiceQueueId':_0xc47ab5[_0x2e4a('0x1c')]||undefined,'CampaignId':_0xc47ab5[_0x2e4a('0x69')]||undefined};};exports['filterKey']=function(_0x55abaa){if(_0x55abaa===_0x2e4a('0x48')||_0x55abaa===_0x2e4a('0x6a')||_0x55abaa===_0x2e4a('0x5a')||_0x55abaa===_0x2e4a('0x6b')||_0x55abaa===_0x2e4a('0x6c')||_0x55abaa===_0x2e4a('0x6d')||_0x55abaa==='membername'||_0x55abaa===_0x2e4a('0x49')||_0x55abaa==='calleridname'||_0x55abaa===_0x2e4a('0x52')||_0x55abaa==='calleridnum'||_0x55abaa===_0x2e4a('0x53')||_0x55abaa===_0x2e4a('0x4c')||_0x55abaa==='countcongestionretry'||_0x55abaa===_0x2e4a('0x4e')||_0x55abaa===_0x2e4a('0x6e')||_0x55abaa==='callback'||_0x55abaa==='callbackuniqueid'||_0x55abaa===_0x2e4a('0x6f')||_0x55abaa===_0x2e4a('0x70')||_0x55abaa===_0x2e4a('0x1b')||_0x55abaa==='ListId'||_0x55abaa===_0x2e4a('0x40')||_0x55abaa===_0x2e4a('0x1c')||_0x55abaa===_0x2e4a('0x71')||_0x55abaa===_0x2e4a('0x72')||_0x55abaa===_0x2e4a('0x73')||_0x55abaa===_0x2e4a('0x74')||_0x55abaa===_0x2e4a('0x75')||_0x55abaa===_0x2e4a('0x76')||_0x55abaa===_0x2e4a('0x77')||_0x55abaa===_0x2e4a('0x78')||_0x55abaa===_0x2e4a('0x79')||_0x55abaa===_0x2e4a('0x7a')||_0x55abaa==='xmd-contactid'||_0x55abaa===_0x2e4a('0x7b')||_0x55abaa===_0x2e4a('0x7c')||_0x55abaa==='xmd-agiafter'||_0x55abaa===_0x2e4a('0x7d')||_0x55abaa===_0x2e4a('0x7e')||_0x55abaa===_0x2e4a('0x7f')||_0x55abaa==='rtpaudioqosjitter'||_0x55abaa===_0x2e4a('0x80')||_0x55abaa===_0x2e4a('0x81')||_0x55abaa==='rtpaudioqoslossbridged'||_0x55abaa===_0x2e4a('0x82')||_0x55abaa===_0x2e4a('0x83')||_0x55abaa===_0x2e4a('0x7e')||_0x55abaa===_0x2e4a('0x7f')||_0x55abaa===_0x2e4a('0x84')||_0x55abaa===_0x2e4a('0x80')||_0x55abaa===_0x2e4a('0x81')||_0x55abaa===_0x2e4a('0x85')||_0x55abaa===_0x2e4a('0x82')||_0x55abaa==='rtpaudioqosrttbridged'||_0x55abaa===_0x2e4a('0x86')||_0x55abaa===_0x2e4a('0x87')||_0x55abaa===_0x2e4a('0x36')||_0x55abaa===_0x2e4a('0x3b')){return![];}return!![];};exports[_0x2e4a('0x88')]=function(_0x4e682e,_0x93e7f1){var _0x3d4a6f,_0x5514be,_0x59b37b;if(_0x93e7f1<=0x0){_0x93e7f1=0x1;}_0x3d4a6f=new RegExp(_0x2e4a('0x89')+_0x93e7f1+'}$');_0x5514be=Math[_0x2e4a('0x8a')](0xa,_0x93e7f1-0x1);_0x59b37b=Math[_0x2e4a('0x8a')](0xa,_0x93e7f1)-0x1;return util[_0x2e4a('0x11')]('%s',_[_0x2e4a('0x8b')](_0x4e682e,_0x3d4a6f,_[_0x2e4a('0x8c')](_0x5514be,_0x59b37b)));};exports[_0x2e4a('0x8d')]=function(_0x523ef6){var _0x4e4bad=_0x523ef6[_0x2e4a('0x8e')](/"(.*?)"/);return _0x4e4bad?_0x4e4bad[0x1]:_0x523ef6;};exports[_0x2e4a('0x8f')]=function(_0x3ed3d5){var _0x590829=_0x3ed3d5[_0x2e4a('0x8e')](/<(.*?)>/);return _0x590829?_0x590829[0x1]:_0x3ed3d5;};function buildNoAnswerEventPayload(_0x127e5a,_0x2e29a7){var _0x3d2215=buildObj(_0x127e5a,_0x2e4a('0x90'));if(!_['isEmpty'](_0x2e29a7[_0x2e4a('0x91')])){Object[_0x2e4a('0x92')](_0x2e29a7['variables'])[_0x2e4a('0x93')](function(_0x2eb328){_0x3d2215[_0x2eb328[_0x2e4a('0x94')]()]=_0x2e29a7['variables'][_0x2eb328];});}return _0x3d2215;}exports[_0x2e4a('0x95')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x2429=['variablesAction','calleridname','originate','channelAgent','from-sip','timeout','uniqueid','countbusyretry','countcongestionretry','Global','active','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','voice','mandatoryDisposition','buildObj','queue','agentReadyId','not_inuse','reachable','getDiff','milliseconds','diff','seconds','ListId','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','loggerError','error','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','name','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','logAgent','state','statedesc','responsetime','ringtime','logLookAgent','UserId','endtime','getSeconds','talktime','answertime','isFailure'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2429,0x169));var _0x9242=function(_0x4450b1,_0x125d47){_0x4450b1=_0x4450b1-0x0;var _0x13508e=_0x2429[_0x4450b1];return _0x13508e;};'use strict';var util=require(_0x9242('0x0'));var _=require('lodash');var moment=require(_0x9242('0x1'));var logger=require(_0x9242('0x2'))(_0x9242('0x3'));var ipAgi=process['env'][_0x9242('0x4')]||_0x9242('0x5');var utils=require(_0x9242('0x6'));exports[_0x9242('0x7')]=function(_0x2eaebf){return function(_0x5a7224){logger['error'](_0x2eaebf,util[_0x9242('0x8')](_0x5a7224,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x17f608,_0x4d5947){logger['info'](_0x17f608,util[_0x9242('0x8')](_0x4d5947,{'showHidden':![],'depth':null}));};exports[_0x9242('0x9')]=function(_0x38a75b,_0x2bb62e){logger[_0x9242('0xa')](_0x38a75b,util[_0x9242('0x8')](_0x2bb62e,{'showHidden':![],'depth':null}));};exports[_0x9242('0xb')]=function(_0x40d815){return function(_0xf0a013){logger[_0x9242('0xc')](_0x40d815,util[_0x9242('0x8')](_0xf0a013,{'showHidden':![],'depth':null}));};};exports[_0x9242('0xd')]=function(_0x4f8c02,_0x2a3c9f,_0x417ce4){return{'message':_0x4f8c02,'unlock':_0x2a3c9f,'active':_0x417ce4};};exports[_0x9242('0xe')]=function(_0x2b5442,_0x39ce38,_0x5668c0){if(!_[_0x9242('0xf')](_0x5668c0)&&_0x9242('0x10')===typeof _0x5668c0&&!_[_0x9242('0x11')](_0x5668c0)){if(!_[_0x9242('0xf')](_0x39ce38)&&'string'===typeof _0x39ce38&&!_[_0x9242('0x11')](_0x39ce38)){return util['format'](_0x9242('0x12'),_0x39ce38,_0x5668c0);}return util[_0x9242('0x13')]('\x22%s\x22\x20<%s>',_0x5668c0,_0x5668c0);}if(!_['isUndefined'](_0x2b5442)&&_0x9242('0x10')===typeof _0x2b5442&&!_[_0x9242('0x11')](_0x2b5442)){return _0x2b5442;}return _0x9242('0x14');};exports['isActive']=function(_0x1fca9b){if(_['isNil'](_0x1fca9b)){return![];}return _0x1fca9b;};exports[_0x9242('0x15')]=function(_0x45335e,_0x1cdc24,_0xe9ccd7,_0x1b037a,_0x142e15,_0x2cb6f0){var _0xf4defd={'XMD-QUEUE':_0x1cdc24['Queue']?_0x1cdc24['Queue'][_0x9242('0x16')]:'','XMD-CALLERID':_0x1b037a,'XMD-CALLERID-PREVIEW':_0x2cb6f0?util[_0x9242('0x13')](_0x9242('0x12'),_0x2cb6f0['calleridname'],_0x2cb6f0[_0x9242('0x17')]):_0x1b037a,'XMD-DIALID':_0x142e15,'XMD-CONTACTID':_0x1cdc24[_0x9242('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1b037a,'XMD-VOICEQUEUEID':_0x1cdc24[_0x9242('0x19')],'XMD-DIALCHANNEL':_0xe9ccd7,'XMD-DIALTIMEOUT':_0x45335e[_0x9242('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x9242('0x13')](_0x9242('0x1b'),_0x45335e[_0x9242('0x1c')]?'g':'',_[_0x9242('0x11')](_0x45335e[_0x9242('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x45335e['dialPreviewUrl']||'','XMD-AGI':_0x45335e[_0x9242('0x1e')]?util[_0x9242('0x13')](_0x9242('0x1f'),ipAgi,_0x45335e[_0x9242('0x1e')]):'NONE','XMD-AGIAFTER':_0x45335e[_0x9242('0x1c')]?util[_0x9242('0x13')](_0x9242('0x1f'),ipAgi,_0x45335e[_0x9242('0x1c')]):_0x9242('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x2cb6f0?_0x2cb6f0[_0x9242('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x2cb6f0?_0x2cb6f0[_0x9242('0x22')]:'','XMD-DESTINATION':_0x9242('0x23'),'SIPADDHEADER':_0x9242('0x24')};if(!_[_0x9242('0x11')](_0x45335e[_0x9242('0x1d')])){_0xf4defd[util[_0x9242('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x45335e['monitor_format'];_0xf4defd[util['format']('%s',_0x9242('0x25'))]=_0x142e15;}if(_0x1cdc24&&_0x1cdc24[_0x9242('0x26')]){for(var _0x109325 in _0x1cdc24[_0x9242('0x26')]){if(_0x1cdc24[_0x9242('0x26')]['hasOwnProperty'](_0x109325)){if(!_[_0x9242('0x27')](_0x1cdc24[_0x9242('0x26')][_0x109325])&&_0x109325!=='id'&&_0x109325!=='tags'&&_0x109325!=='createdAt'&&_0x109325!=='updatedAt'){_0xf4defd[util['format']('%s%s',_0x9242('0x28'),_[_0x9242('0x29')](_0x109325))]=_0x1cdc24['Contact'][_0x109325];}}}}return _0xf4defd;};exports[_0x9242('0x2a')]=function(_0x5cfc45){var _0x3a258e={};for(var _0x5d39e5 in _0x5cfc45){if(_0x5cfc45['hasOwnProperty'](_0x5d39e5)){_0x3a258e[util[_0x9242('0x13')]('%s',_[_0x9242('0x2b')](_0x5d39e5))]=_0x5cfc45[_0x5d39e5];}}return{'variables':_0x3a258e};};exports[_0x9242('0x2c')]=function(_0xaed579,_0x36d235){if(!_[_0x9242('0x27')](_0xaed579)){if(_0xaed579[_0x9242('0x2d')](_0x9242('0x2e'))){if(_0xaed579[_0x9242('0x2e')]>0x0){_0xaed579[_0x9242('0x2e')]-=0x1;}else{logger[_0x9242('0xa')](_0x9242('0x2f'),_0x36d235);}}}else{logger[_0x9242('0xa')](_0x9242('0x30'),_0x36d235);}};exports[_0x9242('0x31')]=function(_0xab7b18){var _0x5f4fdb=moment()['format'](_0x9242('0x32'));_0xab7b18['state']=0xd;_0xab7b18['statedesc']=_0x9242('0x33');_0xab7b18[_0x9242('0x34')]=_0x5f4fdb;_0xab7b18['responsetime']=_0x5f4fdb;_0xab7b18['endtime']=_0x5f4fdb;};exports[_0x9242('0x35')]=function(_0x54482d,_0x36f8b9,_0x4af541){var _0x15dacc=moment()[_0x9242('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x54482d[_0x9242('0x36')]=_0x36f8b9;_0x54482d[_0x9242('0x37')]=_0x4af541;_0x54482d[_0x9242('0x38')]=_0x15dacc;_0x54482d[_0x9242('0x39')]=utils['getSeconds'](_0x54482d['responsetime'],_0x54482d[_0x9242('0x34')]);};exports[_0x9242('0x3a')]=function(_0x4f1c02,_0x197504,_0x3b5d39){_0x4f1c02['membername']=_0x197504;_0x4f1c02[_0x9242('0x3b')]=_0x3b5d39;};exports['logCustomer']=function(_0x39c8c7,_0x2157f5,_0x1ad455){var _0x575597=moment()[_0x9242('0x13')](_0x9242('0x32'));_0x39c8c7[_0x9242('0x36')]=_0x2157f5;_0x39c8c7['statedesc']=_0x1ad455;_0x39c8c7[_0x9242('0x38')]=_0x39c8c7[_0x9242('0x38')]?_0x39c8c7[_0x9242('0x38')]:_0x575597;_0x39c8c7[_0x9242('0x3c')]=_0x39c8c7[_0x9242('0x3c')]?_0x39c8c7[_0x9242('0x3c')]:_0x575597;_0x39c8c7[_0x9242('0x39')]=utils[_0x9242('0x3d')](_0x39c8c7[_0x9242('0x38')]||0x0,_0x39c8c7[_0x9242('0x34')]||0x0);_0x39c8c7[_0x9242('0x3e')]=_0x39c8c7[_0x9242('0x3f')]?utils[_0x9242('0x3d')](_0x39c8c7[_0x9242('0x3c')],_0x39c8c7[_0x9242('0x3f')]):0x0;};exports[_0x9242('0x40')]=function(_0x246099){return _0x246099==='Failure';};exports[_0x9242('0x41')]=function(_0x26e9bb,_0x3251e3,_0x3b99f4,_0x1015df,_0x5da27d){var _0x4027d8=_0x1015df?'RECALL':_0x26e9bb[_0x9242('0x42')];_0x4027d8=_0x5da27d?'BOOKED':_0x4027d8;return{'actionid':_0x26e9bb['uniqueid'],'action':_0x9242('0x43'),'channel':_0x26e9bb[_0x9242('0x44')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x4027d8,_0x26e9bb['calleridnum']),'Exten':_0x9242('0x23'),'Context':_0x9242('0x45'),'Priority':'1','variable':_0x3b99f4,'timeout':(_0x3251e3[_0x9242('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x26e9bb[_0x9242('0x47')]};};exports['totalGlobal']=function(_0x1c00bc){return _0x1c00bc[_0x9242('0x48')]+_0x1c00bc[_0x9242('0x49')]+_0x1c00bc['countnoanswerretry']+_0x1c00bc['countagentrejectretry']+_0x1c00bc['countnosuchnumberretry'];};exports['cloneAction']=function(_0x57f3fd){var _0x5a545e=_['clone'](_0x57f3fd);_0x5a545e['state']=0xf;_0x5a545e[_0x9242('0x37')]=_0x9242('0x4a');return _0x5a545e;};exports['scheduledAt']=function(_0x145a69,_0x351f85,_0x449b50){var _0x2e894e={};_0x2e894e[_0x351f85]=_0x145a69[_0x351f85];_0x2e894e[_0x9242('0x4b')]=![];_0x2e894e['scheduledat']=moment()['add'](_0x449b50,_0x9242('0x4c'))[_0x9242('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e894e['ContactId']=_0x145a69['ContactId'];_0x2e894e['ListId']=_0x145a69['ListId'];_0x2e894e[_0x9242('0x19')]=_0x145a69['VoiceQueueId']||undefined;return _0x2e894e;};exports[_0x9242('0x4d')]=function(_0x258e0a,_0xf56962){if(!_[_0x9242('0x27')](_0x258e0a)){if(_0x258e0a[_0x9242('0x4e')]>0x0){_0x258e0a[_0x9242('0x4e')]-=0x1;}else{logger[_0x9242('0xa')](_0xf56962,_0x9242('0x4f'));}}else{logger['error'](_0xf56962,_0x9242('0x50'));}};exports[_0x9242('0x51')]=function(_0x475484){if(_0x475484<=0x0){return!![];}return![];};function buildObj(_0x551c48,_0x4e66df,_0x5e0d88){_0x551c48[_0x9242('0x52')]=_0x4e66df;_0x551c48[_0x9242('0x16')]=_0x551c48['queue'];_0x551c48[_0x9242('0x53')]=_0x551c48['channelAgent'];_0x551c48['motionChannel']=_0x9242('0x54');if(_0x5e0d88){_0x551c48[_0x9242('0x55')]=_0x5e0d88[_0x9242('0x55')];}return _0x551c48;}exports[_0x9242('0x56')]=buildObj;exports['buildAcw']=function(_0x3c6895){var _0x2ee143={};_0x2ee143['queue']=_0x3c6895[_0x9242('0x57')];_0x2ee143[_0x9242('0x53')]=_0x3c6895[_0x9242('0x44')];_0x2ee143[_0x9242('0x47')]=_0x3c6895[_0x9242('0x47')];return _0x2ee143;};exports[_0x9242('0x58')]=function(_0x4a8ada){var _0x1c63eb=[];for(var _0x521fca in _0x4a8ada){if(_0x4a8ada[_0x9242('0x2d')](_0x521fca)){if(!_[_0x9242('0x27')](_0x4a8ada[_0x521fca])&&_0x4a8ada[_0x521fca][_0x9242('0x36')]===_0x9242('0x59')&&_0x4a8ada[_0x521fca]['status']===_0x9242('0x5a')){_0x1c63eb['push'](_0x4a8ada[_0x521fca]['id']);}}}return _0x1c63eb;};exports[_0x9242('0x5b')]=function(_0x509b76){var _0x39915c=moment()[_0x9242('0x5c')](0x0);var _0xf1c7b8=moment(_0x509b76)[_0x9242('0x5c')](0x0);return _0x39915c[_0x9242('0x5d')](_0xf1c7b8,_0x9242('0x5e'));};exports['createBody']=function(_0x3b80b4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b80b4[_0x9242('0x18')],'ListId':_0x3b80b4[_0x9242('0x5f')],'VoiceQueueId':_0x3b80b4[_0x9242('0x19')]||undefined,'CampaignId':_0x3b80b4[_0x9242('0x60')]||undefined};};exports[_0x9242('0x61')]=function(_0x4abc0c){if(_0x4abc0c===_0x9242('0x47')||_0x4abc0c===_0x9242('0x62')||_0x4abc0c===_0x9242('0x57')||_0x4abc0c===_0x9242('0x63')||_0x4abc0c===_0x9242('0x64')||_0x4abc0c===_0x9242('0x65')||_0x4abc0c==='membername'||_0x4abc0c==='channelAgent'||_0x4abc0c===_0x9242('0x42')||_0x4abc0c===_0x9242('0x4b')||_0x4abc0c===_0x9242('0x17')||_0x4abc0c===_0x9242('0x66')||_0x4abc0c===_0x9242('0x48')||_0x4abc0c==='countcongestionretry'||_0x4abc0c===_0x9242('0x67')||_0x4abc0c===_0x9242('0x68')||_0x4abc0c===_0x9242('0x69')||_0x4abc0c==='callbackuniqueid'||_0x4abc0c===_0x9242('0x6a')||_0x4abc0c===_0x9242('0x6b')||_0x4abc0c===_0x9242('0x18')||_0x4abc0c===_0x9242('0x5f')||_0x4abc0c==='UserId'||_0x4abc0c==='VoiceQueueId'||_0x4abc0c===_0x9242('0x6c')||_0x4abc0c===_0x9242('0x6d')||_0x4abc0c===_0x9242('0x6e')||_0x4abc0c===_0x9242('0x6f')||_0x4abc0c===_0x9242('0x70')||_0x4abc0c===_0x9242('0x71')||_0x4abc0c===_0x9242('0x72')||_0x4abc0c===_0x9242('0x73')||_0x4abc0c===_0x9242('0x74')||_0x4abc0c===_0x9242('0x75')||_0x4abc0c===_0x9242('0x76')||_0x4abc0c===_0x9242('0x77')||_0x4abc0c===_0x9242('0x78')||_0x4abc0c==='xmd-agiafter'||_0x4abc0c==='xmd-agi'||_0x4abc0c===_0x9242('0x79')||_0x4abc0c===_0x9242('0x7a')||_0x4abc0c===_0x9242('0x7b')||_0x4abc0c===_0x9242('0x7c')||_0x4abc0c===_0x9242('0x7d')||_0x4abc0c==='rtpaudioqoslossbridged'||_0x4abc0c==='rtpaudioqosrtt'||_0x4abc0c===_0x9242('0x7e')||_0x4abc0c==='rtpaudioqos'||_0x4abc0c===_0x9242('0x7a')||_0x4abc0c===_0x9242('0x7b')||_0x4abc0c===_0x9242('0x7c')||_0x4abc0c===_0x9242('0x7d')||_0x4abc0c===_0x9242('0x7f')||_0x4abc0c===_0x9242('0x80')||_0x4abc0c===_0x9242('0x7e')||_0x4abc0c===_0x9242('0x81')||_0x4abc0c===_0x9242('0x82')||_0x4abc0c==='state'||_0x4abc0c===_0x9242('0x37')){return![];}return!![];};exports[_0x9242('0x83')]=function(_0x308a12,_0x42fb8d){var _0x224b7c,_0x160825,_0xe0be5a;if(_0x42fb8d<=0x0){_0x42fb8d=0x1;}_0x224b7c=new RegExp('\x5cw{0,'+_0x42fb8d+'}$');_0x160825=Math[_0x9242('0x84')](0xa,_0x42fb8d-0x1);_0xe0be5a=Math[_0x9242('0x84')](0xa,_0x42fb8d)-0x1;return util[_0x9242('0x13')]('%s',_[_0x9242('0x85')](_0x308a12,_0x224b7c,_[_0x9242('0x86')](_0x160825,_0xe0be5a)));};exports[_0x9242('0x87')]=function(_0x1021b2){var _0x14e383=_0x1021b2[_0x9242('0x88')](/"(.*?)"/);return _0x14e383?_0x14e383[0x1]:_0x1021b2;};exports[_0x9242('0x89')]=function(_0x19d422){var _0x14597b=_0x19d422[_0x9242('0x88')](/<(.*?)>/);return _0x14597b?_0x14597b[0x1]:_0x19d422;};function buildNoAnswerEventPayload(_0xa03880,_0x42ae80){var _0x4dcf16=buildObj(_0xa03880,_0x9242('0x8a'));if(!_[_0x9242('0x11')](_0x42ae80[_0x9242('0x8b')])){Object[_0x9242('0x8c')](_0x42ae80[_0x9242('0x8b')])[_0x9242('0x8d')](function(_0x4cd265){_0x4dcf16[_0x4cd265['toLowerCase']()]=_0x42ae80[_0x9242('0x8b')][_0x4cd265];});}return _0x4dcf16;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file
index d0aeb54..8a67276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f9d=['voicechannel','voicequeuechannelhangup','queueadd','string','number','queuepause','boolean','voicequeuechannel'];(function(_0x5a1613,_0x4a1fc7){var _0x58476f=function(_0x328e0c){while(--_0x328e0c){_0x5a1613['push'](_0x5a1613['shift']());}};_0x58476f(++_0x4a1fc7);}(_0x6f9d,0x12a));var _0xd6f9=function(_0x4535c7,_0x2c89c7){_0x4535c7=_0x4535c7-0x0;var _0x37ca9c=_0x6f9d[_0x4535c7];return _0x37ca9c;};'use strict';exports[_0xd6f9('0x0')]={'queue':{'type':_0xd6f9('0x1'),'required':!![]},'interface':{'type':_0xd6f9('0x1'),'required':!![]},'membername':{'type':_0xd6f9('0x1'),'required':!![]},'penalty':{'type':_0xd6f9('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xd6f9('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xd6f9('0x3')]={'interface':{'type':_0xd6f9('0x1'),'required':!![]},'paused':{'type':_0xd6f9('0x4')},'reason':{'type':_0xd6f9('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xd6f9('0x1'),'required':![]}};exports[_0xd6f9('0x5')]={'uniqueid':{'type':_0xd6f9('0x1'),'required':!![]}};exports[_0xd6f9('0x6')]={'uniqueid':{'type':_0xd6f9('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xd6f9('0x1')},'mixmonitorid':{'type':_0xd6f9('0x1')}};exports[_0xd6f9('0x7')]={'uniqueid':{'type':_0xd6f9('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd6f9('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd6f9('0x1')}};
\ No newline at end of file
+var _0xafeb=['boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number'];(function(_0x3ac060,_0x1c67dd){var _0x9520cf=function(_0x292df4){while(--_0x292df4){_0x3ac060['push'](_0x3ac060['shift']());}};_0x9520cf(++_0x1c67dd);}(_0xafeb,0x85));var _0xbafe=function(_0x1232a9,_0x28f6d6){_0x1232a9=_0x1232a9-0x0;var _0x1cb707=_0xafeb[_0x1232a9];return _0x1cb707;};'use strict';exports['queueadd']={'queue':{'type':_0xbafe('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xbafe('0x0'),'required':!![]},'penalty':{'type':_0xbafe('0x1'),'required':![]},'paused':{'type':_0xbafe('0x2'),'required':![]}};exports[_0xbafe('0x3')]={'queue':{'type':_0xbafe('0x0'),'required':!![]},'interface':{'type':_0xbafe('0x0'),'required':!![]}};exports[_0xbafe('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xbafe('0x2')},'reason':{'type':'string','required':![]}};exports[_0xbafe('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbafe('0x0'),'required':!![]}};exports[_0xbafe('0x6')]={'uniqueid':{'type':_0xbafe('0x0'),'required':!![]},'filename':{'type':_0xbafe('0x0')},'format':{'type':_0xbafe('0x0')},'mixmonitorid':{'type':_0xbafe('0x0')}};exports[_0xbafe('0x7')]={'uniqueid':{'type':_0xbafe('0x0'),'required':!![]}};exports[_0xbafe('0x8')]={'uniqueid':{'type':_0xbafe('0x0'),'required':!![]},'exten':{'type':_0xbafe('0x0'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 668712f..4576b0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x124331,_0x4a0e03){var _0x2f9514=function(_0x2f3c4f){while(--_0x2f3c4f){_0x124331['push'](_0x124331['shift']());}};_0x2f9514(++_0x4a0e03);}(_0x757a,0xde));var _0xa757=function(_0x71d1e3,_0x494c94){_0x71d1e3=_0x71d1e3-0x0;var _0x13af9d=_0x757a[_0x71d1e3];return _0x13af9d;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime;
\ No newline at end of file
+var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x35dc28,_0x4610cc){var _0x3b3dc1=function(_0x202959){while(--_0x202959){_0x35dc28['push'](_0x35dc28['shift']());}};_0x3b3dc1(++_0x4610cc);}(_0xadb5,0xad));var _0x5adb=function(_0x3020ab,_0x3334c9){_0x3020ab=_0x3020ab-0x0;var _0x78534e=_0xadb5[_0x3020ab];return _0x78534e;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime;
\ No newline at end of file
index b70535e..d2ea522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x663e=['mergeDBDataToRealtime','assign'];(function(_0x2adcfa,_0x2e4e82){var _0x5a2ed7=function(_0x257be3){while(--_0x257be3){_0x2adcfa['push'](_0x2adcfa['shift']());}};_0x5a2ed7(++_0x2e4e82);}(_0x663e,0x1c7));var _0xe663=function(_0x1ac731,_0xa2b2c7){_0x1ac731=_0x1ac731-0x0;var _0x494be0=_0x663e[_0x1ac731];return _0x494be0;};'use strict';function mergeDBDataToRealtime(_0x4dcc1e,_0x180878){var _0x4cdfcd=Object[_0xe663('0x0')]({},_0x4dcc1e);for(var _0x1c62be in _0x180878){if(_0x4cdfcd['hasOwnProperty'](_0x1c62be)){_0x4cdfcd[_0x1c62be]=_0x180878[_0x1c62be];}}return _0x4cdfcd;}exports[_0xe663('0x1')]=mergeDBDataToRealtime;
\ No newline at end of file
+var _0x57c0=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x5bc221,_0x22ede5){var _0x27a3e0=function(_0x81b08){while(--_0x81b08){_0x5bc221['push'](_0x5bc221['shift']());}};_0x27a3e0(++_0x22ede5);}(_0x57c0,0xec));var _0x057c=function(_0x41f85a,_0x5f3b48){_0x41f85a=_0x41f85a-0x0;var _0x5c13f1=_0x57c0[_0x41f85a];return _0x5c13f1;};'use strict';function mergeDBDataToRealtime(_0x1513a8,_0x6c6f0b){var _0x1a858d=Object[_0x057c('0x0')]({},_0x1513a8);for(var _0x12b7df in _0x6c6f0b){if(_0x1a858d[_0x057c('0x1')](_0x12b7df)){_0x1a858d[_0x12b7df]=_0x6c6f0b[_0x12b7df];}}return _0x1a858d;}exports[_0x057c('0x2')]=mergeDBDataToRealtime;
\ No newline at end of file
index da8e3a8..532f36a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7711=['type','UserId','split','monitorFilename','monitors','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','substring','mobile','phone','indexOf','lastIndexOf','blindTransfer','transfererlinkedid','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','keys','getCallType','channel','getAgentByInternal','calleridnum','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid'];(function(_0x575a56,_0x5a5f09){var _0x34b558=function(_0x343586){while(--_0x343586){_0x575a56['push'](_0x575a56['shift']());}};_0x34b558(++_0x5a5f09);}(_0x7711,0x187));var _0x1771=function(_0x241a13,_0x183199){_0x241a13=_0x241a13-0x0;var _0x12f692=_0x7711[_0x241a13];return _0x12f692;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x1771('0x0'));var config=require(_0x1771('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x1771('0x2'));var RpcVoiceCallReport=require(_0x1771('0x3'));var RpcVoiceDialReport=require(_0x1771('0x4'));var RpcMemberReport=require(_0x1771('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x1771('0x6'));var RpcVoiceTransferReport=require(_0x1771('0x7'));var VoiceQueueReport=require(_0x1771('0x8'));var VoiceCallReport=require(_0x1771('0x9'));var VoiceAgentReport=require(_0x1771('0xa'));var VoiceDialReport=require(_0x1771('0xb'));var UserReport=require(_0x1771('0xc'));function Report(_0x4e24d8){this[_0x1771('0xd')]=_0x4e24d8;this[_0x1771('0xe')]=_0x4e24d8[_0x1771('0xe')];this[_0x1771('0xf')]=_0x4e24d8['telephones'];}Report[_0x1771('0x10')][_0x1771('0x11')]=function(_0x429bec){var _0x29a8f5=new VoiceQueueReport(this[_0x1771('0xd')]);var _0x42b134=new VoiceAgentReport(this[_0x1771('0xd')]);var _0x49e51d=new VoiceDialReport(this['realtime']);var _0x388c06=new VoiceCallReport(this[_0x1771('0xd')]);var _0x3bd386=new UserReport(this[_0x1771('0xd')]);if(config[_0x1771('0x12')]&&config[_0x1771('0x12')]['disabled']){ami['on'](_0x1771('0x13'),this[_0x1771('0x14')][_0x1771('0x15')](this));ami['on'](_0x1771('0x16'),this[_0x1771('0x17')]['bind'](this));ami['on'](_0x1771('0x18'),this[_0x1771('0x19')][_0x1771('0x15')](this));ami['on'](_0x1771('0x1a'),this[_0x1771('0x1b')][_0x1771('0x15')](this));ami['on'](_0x1771('0x1c'),this['blindTransfer']['bind'](this));ami['on'](_0x1771('0x1d'),this[_0x1771('0x1e')][_0x1771('0x15')](this));}};Report[_0x1771('0x10')][_0x1771('0x1f')]=function(_0x519202){var _0x2297ee;_0x2297ee=_[_0x1771('0x20')](this[_0x1771('0xe')],function(_0x20177f){return _0x20177f[_0x1771('0x21')]==_0x519202||_0x20177f[_0x1771('0x22')]==_0x519202;});if(_[_0x1771('0x23')](_0x2297ee)){var _0x418ac5=_[_0x1771('0x20')](this[_0x1771('0xf')],function(_0x51ef07){return _0x51ef07[_0x1771('0x21')]==_0x519202||_0x51ef07[_0x1771('0x22')]==_0x519202;});if(_0x418ac5){_0x2297ee=_[_0x1771('0x20')](this['agents'],function(_0x4f819e){return _0x4f819e[_0x1771('0x24')]==util[_0x1771('0x25')](_0x1771('0x26'),_0x418ac5['name']);});}}return _0x2297ee;};Report['prototype'][_0x1771('0x14')]=function(_0x5440d4){for(var _0x43a076=0x0;_0x43a076<_0x5440d4[_0x1771('0x27')];_0x43a076+=0x1){var _0x2f1f85=this['findAgent'](_0x5440d4[_0x43a076][_0x1771('0x28')]);if(_0x2f1f85){_0x5440d4[_0x43a076][_0x1771('0x21')]=_0x2f1f85[_0x1771('0x21')];_0x5440d4[_0x43a076][_0x1771('0x29')]=!![];_0x5440d4[_0x43a076][_0x1771('0x2a')]=_0x2f1f85[_0x1771('0x22')];_0x5440d4[_0x43a076][_0x1771('0x24')]=_[_0x1771('0x23')](_0x2f1f85['interface'])?util['format'](_0x1771('0x26'),_0x2f1f85[_0x1771('0x22')]):_0x2f1f85[_0x1771('0x24')];if(_0x5440d4[_0x43a076][_0x1771('0x2b')]){_0x5440d4[_0x43a076][_0x1771('0x2c')]=moment()[_0x1771('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5440d4[_0x43a076][_0x1771('0x2d')]){_0x5440d4[_0x43a076][_0x1771('0x2e')]=moment()['format'](_0x1771('0x2f'));}RpcMemberReport[_0x1771('0x14')](_0x5440d4[_0x43a076]);}RpcVoiceQueueReport[_0x1771('0x30')](_0x5440d4[_0x43a076]);}};function extractCalleridNumber(_0x289804){var _0x5497da=_0x289804[_0x1771('0x31')](/<(.*?)>/);return _0x5497da?_0x5497da[0x1]:_0x289804;}Report[_0x1771('0x10')]['getAgentByInternal']=function(_0x2914e1){for(var _0x563153=0x0;_0x563153<Object[_0x1771('0x32')](this[_0x1771('0xe')])[_0x1771('0x27')];_0x563153++){var _0xe2f43b=Object['keys'](this['agents'])[_0x563153];var _0x3ef397=this[_0x1771('0xe')][_0xe2f43b];if(_0x3ef397[_0x1771('0x21')]===Number(_0x2914e1))return _0x3ef397;}return null;};Report[_0x1771('0x10')][_0x1771('0x33')]=function(_0x39e1ba){var _0x497d49=_0x39e1ba[_0x1771('0x34')]['split']('-')[0x0];var _0x488e93=this[_0x1771('0xe')][_0x497d49];if(!_0x488e93)_0x488e93=this[_0x1771('0x35')](_0x39e1ba[_0x1771('0x36')]);return!_0x488e93?'outbound':'internal';};Report[_0x1771('0x10')]['voiceCallReport']=function(_0x5ece4b){_0x5ece4b[_0x1771('0x37')]=_0x5ece4b[_0x1771('0x37')]||_0x5ece4b[_0x1771('0x38')];if(_0x5ece4b['type']==_0x1771('0x39')){_0x5ece4b[_0x1771('0x3a')]=_0x1771('0x3b');_0x5ece4b[_0x1771('0x3c')]=_0x5ece4b[_0x1771('0x3b')];if(_0x5ece4b[_0x1771('0x3d')]==_0x1771('0x3e')){_0x5ece4b[_0x1771('0x21')]='';_0x5ece4b[_0x1771('0x37')]=extractCalleridNumber(_0x5ece4b['callerid']);}else if(_0x5ece4b['context']=='from-sip'){if(_0x5ece4b['destination']==_0x1771('0x3f')){_0x5ece4b[_0x1771('0x37')]=extractCalleridNumber(_0x5ece4b[_0x1771('0x40')]);_0x5ece4b[_0x1771('0x36')]=_0x5ece4b[_0x1771('0x41')];_0x5ece4b[_0x1771('0x42')]=[_0x5ece4b[_0x1771('0x34')],_0x5ece4b[_0x1771('0x34')]=_0x5ece4b[_0x1771('0x42')]][0x0];_0x5ece4b['callerid']=_0x5ece4b['calleridpreview'];}else{_0x5ece4b[_0x1771('0x37')]=_0x5ece4b['calleridnum'];_0x5ece4b[_0x1771('0x36')]=_0x5ece4b[_0x1771('0x41')];if(_0x5ece4b['disposition']==_0x1771('0x43')){_0x5ece4b['accountcode']=_0x5ece4b[_0x1771('0x28')];}else{_0x5ece4b[_0x1771('0x21')]='';}}}}else{_0x5ece4b['callerid']=util[_0x1771('0x25')](_0x1771('0x44'),_0x5ece4b[_0x1771('0x45')],_0x5ece4b['calleridnum']);}if(RpcVoiceTransferReport[_0x1771('0x46')][_0x5ece4b['linkedid']]){var _0x283829=RpcVoiceTransferReport[_0x1771('0x46')][_0x5ece4b[_0x1771('0x47')]];_0x283829[_0x1771('0x48')]=_0x5ece4b[_0x1771('0x49')];RpcVoiceTransferReport['blindTransfer'](_0x283829);delete RpcVoiceTransferReport['transfers'][_0x5ece4b[_0x1771('0x47')]];}if(_[_0x1771('0x23')](_0x5ece4b[_0x1771('0x4a')])){_0x5ece4b[_0x1771('0x4a')]=this[_0x1771('0x33')](_0x5ece4b);}if(_[_0x1771('0x23')](_0x5ece4b[_0x1771('0x4b')])){var _0x2beeda=_0x5ece4b['channel'][_0x1771('0x4c')]('-')[0x0];var _0x376a93=this[_0x1771('0xe')][_0x2beeda];if(!_0x376a93)_0x376a93=this[_0x1771('0x35')](_0x5ece4b[_0x1771('0x21')]);if(_0x376a93){_0x5ece4b[_0x1771('0x4b')]=_0x376a93['id'];_0x5ece4b['membername']=_0x376a93[_0x1771('0x22')];}}RpcVoiceCallReport[_0x1771('0x30')](_0x5ece4b);if(_0x5ece4b['monitor']){for(var _0x26e697=0x0;_0x26e697<_0x5ece4b['monitors'][_0x1771('0x27')];_0x26e697+=0x1){_0x5ece4b[_0x1771('0x4d')]=_0x5ece4b[_0x1771('0x4e')][_0x26e697][_0x1771('0x4f')];_0x5ece4b[_0x1771('0x50')]=_0x5ece4b[_0x1771('0x4e')][_0x26e697][_0x1771('0x50')];if(_0x5ece4b[_0x1771('0x38')]==_0x1771('0x3f')){_0x5ece4b[_0x1771('0x36')]=_0x5ece4b[_0x1771('0x28')];_0x5ece4b['calleridname']=_0x5ece4b[_0x1771('0x51')];_0x5ece4b[_0x1771('0x28')]=_0x5ece4b[_0x1771('0x21')];_0x5ece4b[_0x1771('0x51')]=_0x5ece4b[_0x1771('0x52')];_0x5ece4b[_0x1771('0x38')]=_0x5ece4b['originatecalleridnum'];}else if(_0x5ece4b[_0x1771('0x38')]==_0x1771('0x53')){_0x5ece4b[_0x1771('0x36')]=_0x5ece4b[_0x1771('0x37')];_0x5ece4b[_0x1771('0x38')]=_0x5ece4b[_0x1771('0x41')];}RpcVoiceRecording[_0x1771('0x30')](_0x5ece4b);}}};Report['prototype']['voiceAgentReport']=function(_0x101e16){if(_[_0x1771('0x54')](_0x101e16)){_0x101e16[_0x1771('0x55')](function(_0x2454b4){RpcVoiceAgentReport[_0x1771('0x30')](_0x2454b4);});}else{RpcVoiceAgentReport['create'](_0x101e16);}};Report[_0x1771('0x10')][_0x1771('0x1b')]=function(_0x877868){RpcVoiceDialReport[_0x1771('0x30')](_0x877868);var _0xb0a248;var _0x3a07bc;var _0x28c2e3=_0x877868['channel'];if(_['startsWith'](_0x28c2e3,'Local')){_0x3a07bc=_0x28c2e3[_0x1771('0x56')](_0x28c2e3['indexOf']('/')+0x1,_0x28c2e3['indexOf']('@'));_0xb0a248=_[_0x1771('0x20')](this['agents'],function(_0x3fd7a5){return _0x3fd7a5[_0x1771('0x57')]==_0x3a07bc||_0x3fd7a5[_0x1771('0x58')]==_0x3a07bc||_0x3fd7a5[_0x1771('0x21')]==_0x3a07bc;});}else{_0x3a07bc=_0x28c2e3[_0x1771('0x56')](_0x28c2e3[_0x1771('0x59')]('/')+0x1,_0x28c2e3[_0x1771('0x5a')]('-'));_0xb0a248=this['findAgent'](_0x3a07bc);}if(_0xb0a248){_0x877868['interface']=_['isNil'](_0xb0a248[_0x1771('0x24')])?util[_0x1771('0x25')](_0x1771('0x26'),_0xb0a248[_0x1771('0x22')]):_0xb0a248[_0x1771('0x24')];_0x877868[_0x1771('0x52')]=_0xb0a248[_0x1771('0x22')];_0x877868[_0x1771('0x21')]=_0xb0a248[_0x1771('0x21')];RpcMemberReport['voiceDialReport'](_0x877868);}};Report['prototype'][_0x1771('0x5b')]=function(_0x4c6e88){RpcVoiceTransferReport[_0x1771('0x46')][_0x4c6e88[_0x1771('0x5c')]]=_0x4c6e88;};Report['prototype'][_0x1771('0x1e')]=function(_0x597327){RpcVoiceTransferReport[_0x1771('0x1e')](_0x597327);};module['exports']=Report;
\ No newline at end of file
+var _0x84a1=['format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','destination','exten','type','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','voiceDialReport','transfererlinkedid','exports','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','name','telephones','accountcode','interface'];(function(_0x168dcb,_0x5256f0){var _0x59d92d=function(_0x1a380f){while(--_0x1a380f){_0x168dcb['push'](_0x168dcb['shift']());}};_0x59d92d(++_0x5256f0);}(_0x84a1,0x99));var _0x184a=function(_0x3ff6e0,_0x4893e7){_0x3ff6e0=_0x3ff6e0-0x0;var _0x4800f8=_0x84a1[_0x3ff6e0];return _0x4800f8;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x184a('0x0'));var config=require('../../../config/environment');var ami=require(_0x184a('0x1'));var RpcVoiceAgentReport=require(_0x184a('0x2'));var RpcVoiceCallReport=require(_0x184a('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x184a('0x4'));var RpcVoiceQueueReport=require(_0x184a('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x184a('0x6'));var VoiceQueueReport=require(_0x184a('0x7'));var VoiceCallReport=require(_0x184a('0x8'));var VoiceAgentReport=require(_0x184a('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x184a('0xa'));function Report(_0x420a04){this[_0x184a('0xb')]=_0x420a04;this[_0x184a('0xc')]=_0x420a04[_0x184a('0xc')];this['telephones']=_0x420a04['telephones'];}Report[_0x184a('0xd')][_0x184a('0xe')]=function(_0x35609a){var _0x44193c=new VoiceQueueReport(this[_0x184a('0xb')]);var _0x45541e=new VoiceAgentReport(this[_0x184a('0xb')]);var _0x692692=new VoiceDialReport(this['realtime']);var _0x3b935e=new VoiceCallReport(this[_0x184a('0xb')]);var _0x226bca=new UserReport(this['realtime']);if(config[_0x184a('0xf')]&&config[_0x184a('0xf')][_0x184a('0x10')]){ami['on'](_0x184a('0x11'),this['voiceQueueReport'][_0x184a('0x12')](this));ami['on'](_0x184a('0x13'),this[_0x184a('0x14')][_0x184a('0x12')](this));ami['on'](_0x184a('0x15'),this[_0x184a('0x16')][_0x184a('0x12')](this));ami['on'](_0x184a('0x17'),this['voiceDialReport'][_0x184a('0x12')](this));ami['on']('blindtransfer',this[_0x184a('0x18')][_0x184a('0x12')](this));ami['on'](_0x184a('0x19'),this[_0x184a('0x1a')][_0x184a('0x12')](this));}};Report[_0x184a('0xd')][_0x184a('0x1b')]=function(_0x416247){var _0x254973;_0x254973=_[_0x184a('0x1c')](this[_0x184a('0xc')],function(_0x350452){return _0x350452['accountcode']==_0x416247||_0x350452[_0x184a('0x1d')]==_0x416247;});if(_['isNil'](_0x254973)){var _0x5e1cc8=_[_0x184a('0x1c')](this[_0x184a('0x1e')],function(_0x234a26){return _0x234a26[_0x184a('0x1f')]==_0x416247||_0x234a26[_0x184a('0x1d')]==_0x416247;});if(_0x5e1cc8){_0x254973=_[_0x184a('0x1c')](this[_0x184a('0xc')],function(_0x5d08bd){return _0x5d08bd[_0x184a('0x20')]==util[_0x184a('0x21')](_0x184a('0x22'),_0x5e1cc8[_0x184a('0x1d')]);});}}return _0x254973;};Report[_0x184a('0xd')][_0x184a('0x23')]=function(_0x397bf0){for(var _0xc4d060=0x0;_0xc4d060<_0x397bf0[_0x184a('0x24')];_0xc4d060+=0x1){var _0x4bc9a5=this['findAgent'](_0x397bf0[_0xc4d060][_0x184a('0x25')]);if(_0x4bc9a5){_0x397bf0[_0xc4d060][_0x184a('0x1f')]=_0x4bc9a5[_0x184a('0x1f')];_0x397bf0[_0xc4d060][_0x184a('0x26')]=!![];_0x397bf0[_0xc4d060][_0x184a('0x27')]=_0x4bc9a5[_0x184a('0x1d')];_0x397bf0[_0xc4d060][_0x184a('0x20')]=_[_0x184a('0x28')](_0x4bc9a5['interface'])?util[_0x184a('0x21')](_0x184a('0x22'),_0x4bc9a5[_0x184a('0x1d')]):_0x4bc9a5['interface'];if(_0x397bf0[_0xc4d060][_0x184a('0x29')]){_0x397bf0[_0xc4d060][_0x184a('0x2a')]=moment()['format'](_0x184a('0x2b'));}if(_0x397bf0[_0xc4d060][_0x184a('0x2c')]){_0x397bf0[_0xc4d060][_0x184a('0x2d')]=moment()[_0x184a('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x184a('0x23')](_0x397bf0[_0xc4d060]);}RpcVoiceQueueReport[_0x184a('0x2e')](_0x397bf0[_0xc4d060]);}};function extractCalleridNumber(_0x1b7cc4){var _0x331f2a=_0x1b7cc4[_0x184a('0x2f')](/<(.*?)>/);return _0x331f2a?_0x331f2a[0x1]:_0x1b7cc4;}Report['prototype']['getAgentByInternal']=function(_0x399a84){for(var _0x31d0c9=0x0;_0x31d0c9<Object[_0x184a('0x30')](this[_0x184a('0xc')])[_0x184a('0x24')];_0x31d0c9++){var _0x8cfc0b=Object[_0x184a('0x30')](this[_0x184a('0xc')])[_0x31d0c9];var _0x39cce4=this['agents'][_0x8cfc0b];if(_0x39cce4[_0x184a('0x1f')]===Number(_0x399a84))return _0x39cce4;}return null;};Report[_0x184a('0xd')][_0x184a('0x31')]=function(_0x51d5ee){var _0x297a61=_0x51d5ee[_0x184a('0x32')][_0x184a('0x33')]('-')[0x0];var _0x5be53b=this['agents'][_0x297a61];if(!_0x5be53b)_0x5be53b=this[_0x184a('0x34')](_0x51d5ee[_0x184a('0x35')]);return!_0x5be53b?_0x184a('0x36'):'internal';};Report[_0x184a('0xd')]['voiceCallReport']=function(_0x27c9b1){_0x27c9b1[_0x184a('0x37')]=_0x27c9b1[_0x184a('0x37')]||_0x27c9b1[_0x184a('0x38')];if(_0x27c9b1[_0x184a('0x39')]==_0x184a('0x3a')){_0x27c9b1[_0x184a('0x3b')]='queue';_0x27c9b1[_0x184a('0x3c')]=_0x27c9b1['queue'];if(_0x27c9b1[_0x184a('0x3d')]==_0x184a('0x3e')){_0x27c9b1[_0x184a('0x1f')]='';_0x27c9b1[_0x184a('0x37')]=extractCalleridNumber(_0x27c9b1[_0x184a('0x3f')]);}else if(_0x27c9b1[_0x184a('0x3d')]=='from-sip'){if(_0x27c9b1[_0x184a('0x37')]==_0x184a('0x40')){_0x27c9b1[_0x184a('0x37')]=extractCalleridNumber(_0x27c9b1[_0x184a('0x41')]);_0x27c9b1['calleridnum']=_0x27c9b1[_0x184a('0x42')];_0x27c9b1['destinationchannel']=[_0x27c9b1[_0x184a('0x32')],_0x27c9b1[_0x184a('0x32')]=_0x27c9b1[_0x184a('0x43')]][0x0];_0x27c9b1['callerid']=_0x27c9b1[_0x184a('0x41')];}else{_0x27c9b1[_0x184a('0x37')]=_0x27c9b1[_0x184a('0x35')];_0x27c9b1[_0x184a('0x35')]=_0x27c9b1[_0x184a('0x42')];if(_0x27c9b1[_0x184a('0x44')]==_0x184a('0x45')){_0x27c9b1[_0x184a('0x1f')]=_0x27c9b1[_0x184a('0x25')];}else{_0x27c9b1[_0x184a('0x1f')]='';}}}}else{_0x27c9b1[_0x184a('0x3f')]=util[_0x184a('0x21')]('\x22%s\x22\x20<%s>',_0x27c9b1[_0x184a('0x46')],_0x27c9b1[_0x184a('0x35')]);}if(RpcVoiceTransferReport[_0x184a('0x47')][_0x27c9b1[_0x184a('0x48')]]){var _0x56e826=RpcVoiceTransferReport[_0x184a('0x47')][_0x27c9b1['linkedid']];_0x56e826[_0x184a('0x49')]=_0x27c9b1[_0x184a('0x4a')];RpcVoiceTransferReport['blindTransfer'](_0x56e826);delete RpcVoiceTransferReport[_0x184a('0x47')][_0x27c9b1[_0x184a('0x48')]];}if(_['isNil'](_0x27c9b1['type'])){_0x27c9b1[_0x184a('0x39')]=this[_0x184a('0x31')](_0x27c9b1);}if(_[_0x184a('0x28')](_0x27c9b1[_0x184a('0x4b')])){var _0x35bbfc=_0x27c9b1[_0x184a('0x32')][_0x184a('0x33')]('-')[0x0];var _0xef1ce2=this[_0x184a('0xc')][_0x35bbfc];if(!_0xef1ce2)_0xef1ce2=this['getAgentByInternal'](_0x27c9b1[_0x184a('0x1f')]);if(_0xef1ce2){_0x27c9b1[_0x184a('0x4b')]=_0xef1ce2['id'];_0x27c9b1[_0x184a('0x4c')]=_0xef1ce2[_0x184a('0x1d')];}}RpcVoiceCallReport['create'](_0x27c9b1);if(_0x27c9b1[_0x184a('0x4d')]){for(var _0x5049e4=0x0;_0x5049e4<_0x27c9b1[_0x184a('0x4e')][_0x184a('0x24')];_0x5049e4+=0x1){_0x27c9b1['monitorFilename']=_0x27c9b1[_0x184a('0x4e')][_0x5049e4][_0x184a('0x4f')];_0x27c9b1[_0x184a('0x50')]=_0x27c9b1[_0x184a('0x4e')][_0x5049e4][_0x184a('0x50')];if(_0x27c9b1[_0x184a('0x38')]==_0x184a('0x40')){_0x27c9b1[_0x184a('0x35')]=_0x27c9b1[_0x184a('0x25')];_0x27c9b1[_0x184a('0x46')]=_0x27c9b1[_0x184a('0x51')];_0x27c9b1[_0x184a('0x25')]=_0x27c9b1[_0x184a('0x1f')];_0x27c9b1[_0x184a('0x51')]=_0x27c9b1[_0x184a('0x4c')];_0x27c9b1[_0x184a('0x38')]=_0x27c9b1[_0x184a('0x42')];}else if(_0x27c9b1[_0x184a('0x38')]=='xcally-motion-dialer'){_0x27c9b1[_0x184a('0x35')]=_0x27c9b1[_0x184a('0x37')];_0x27c9b1['exten']=_0x27c9b1['originatecalleridnum'];}RpcVoiceRecording[_0x184a('0x2e')](_0x27c9b1);}}};Report[_0x184a('0xd')][_0x184a('0x16')]=function(_0xbc31ea){if(_[_0x184a('0x52')](_0xbc31ea)){_0xbc31ea[_0x184a('0x53')](function(_0x462b2f){RpcVoiceAgentReport[_0x184a('0x2e')](_0x462b2f);});}else{RpcVoiceAgentReport['create'](_0xbc31ea);}};Report[_0x184a('0xd')]['voiceDialReport']=function(_0x5695e1){RpcVoiceDialReport[_0x184a('0x2e')](_0x5695e1);var _0x1d9746;var _0x2d042b;var _0x4a8467=_0x5695e1[_0x184a('0x32')];if(_[_0x184a('0x54')](_0x4a8467,'Local')){_0x2d042b=_0x4a8467[_0x184a('0x55')](_0x4a8467['indexOf']('/')+0x1,_0x4a8467[_0x184a('0x56')]('@'));_0x1d9746=_[_0x184a('0x1c')](this['agents'],function(_0x30c92d){return _0x30c92d[_0x184a('0x57')]==_0x2d042b||_0x30c92d[_0x184a('0x58')]==_0x2d042b||_0x30c92d['accountcode']==_0x2d042b;});}else{_0x2d042b=_0x4a8467[_0x184a('0x55')](_0x4a8467['indexOf']('/')+0x1,_0x4a8467[_0x184a('0x59')]('-'));_0x1d9746=this[_0x184a('0x1b')](_0x2d042b);}if(_0x1d9746){_0x5695e1[_0x184a('0x20')]=_[_0x184a('0x28')](_0x1d9746[_0x184a('0x20')])?util[_0x184a('0x21')](_0x184a('0x22'),_0x1d9746[_0x184a('0x1d')]):_0x1d9746[_0x184a('0x20')];_0x5695e1[_0x184a('0x4c')]=_0x1d9746[_0x184a('0x1d')];_0x5695e1[_0x184a('0x1f')]=_0x1d9746['accountcode'];RpcMemberReport[_0x184a('0x5a')](_0x5695e1);}};Report[_0x184a('0xd')][_0x184a('0x18')]=function(_0x1b6496){RpcVoiceTransferReport[_0x184a('0x47')][_0x1b6496[_0x184a('0x5b')]]=_0x1b6496;};Report[_0x184a('0xd')][_0x184a('0x1a')]=function(_0x2252e6){RpcVoiceTransferReport[_0x184a('0x1a')](_0x2252e6);};module[_0x184a('0x5c')]=Report;
\ No newline at end of file
index 85d50fa..0e67690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7189=['indexOf','mobile','phone','accountcode','local','[userReport][devicestatechange]','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','localhost','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','inuse','toLowerCase','toNumber','updateStatusRealtime','stateTime','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local'];(function(_0x1f31fa,_0x5e96a){var _0x1b50ba=function(_0x4cbe5b){while(--_0x4cbe5b){_0x1f31fa['push'](_0x1f31fa['shift']());}};_0x1b50ba(++_0x5e96a);}(_0x7189,0x186));var _0x9718=function(_0x1efa26,_0x2a2295){_0x1efa26=_0x1efa26-0x0;var _0x4bdc5f=_0x7189[_0x1efa26];return _0x4bdc5f;};'use strict';var _=require('lodash');var moment=require(_0x9718('0x0'));var util=require(_0x9718('0x1'));var Redis=require(_0x9718('0x2'));var BPromise=require(_0x9718('0x3'));var config=require(_0x9718('0x4'));var logger=require('../../../config/logger')(_0x9718('0x5'));var ami=require(_0x9718('0x6'));config['redis']=_['defaults'](config[_0x9718('0x7')],{'host':_0x9718('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9718('0x7')]));function UserReport(_0x4171df){this[_0x9718('0x9')]=_0x4171df[_0x9718('0x9')];this[_0x9718('0xa')]=_0x4171df[_0x9718('0xa')];this[_0x9718('0xb')]=_0x4171df[_0x9718('0xb')];ami['on'](_0x9718('0xc'),this['syncRegistry'][_0x9718('0xd')](this));ami['on'](_0x9718('0xe'),this[_0x9718('0xf')][_0x9718('0xd')](this));ami['on'](_0x9718('0x10'),this[_0x9718('0x11')][_0x9718('0xd')](this));ami['on'](_0x9718('0x12'),this['syncPeerStatus'][_0x9718('0xd')](this));return this[_0x9718('0x13')]();}function showSipRegistrations(){Promise[_0x9718('0x14')]()['then'](ami[_0x9718('0x15')]())[_0x9718('0x16')](function(_0x1486ea){logger[_0x9718('0x17')](_0x9718('0x18'),util[_0x9718('0x19')](_0x1486ea,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x9718('0x14')]()[_0x9718('0x1a')](ami['actionDeviceStateList']())[_0x9718('0x16')](function(_0x2e88b5){logger['error'](_0x9718('0x1b'),util['inspect'](_0x2e88b5,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x9718('0x1a')](ami['actionSipPeerStatus']())[_0x9718('0x16')](function(_0x365844){logger['error'](_0x9718('0x1c'),util[_0x9718('0x19')](_0x365844,{'showHidden':![],'depth':null}));});}UserReport[_0x9718('0x1d')][_0x9718('0x13')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x9718('0x1a')](listDeviceStates())[_0x9718('0x1a')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x9718('0x1e')]=function(_0x5909d1){return _0x5909d1!==null&&!_[_0x9718('0x1f')](_0x5909d1);};UserReport['prototype']['emit']=function(_0x148193,_0x2dd1e0,_0x1e7b54){io['to'](_0x148193)[_0x9718('0x20')](_0x2dd1e0,_0x1e7b54);};UserReport['prototype'][_0x9718('0xf')]=function(_0x48483a){try{if(this['isNotNull'](_0x48483a)){logger['info'](_0x9718('0x21'),_0x48483a[_0x9718('0x22')],_0x48483a[_0x9718('0x23')]);logger['debug'](_0x9718('0x24'),util[_0x9718('0x19')](_0x48483a,{'showHidden':![],'depth':null}));var _0x2d5d27=_[_0x9718('0x25')](this['trunks'],{'defaultuser':_0x48483a[_0x9718('0x22')]});if(_0x2d5d27){_0x48483a[_0x9718('0x26')]=_0x48483a[_0x9718('0x23')];_[_0x9718('0x27')](_0x2d5d27,_[_0x9718('0x28')](_0x48483a,[_0x9718('0x29'),_0x9718('0x2a'),_0x9718('0x22'),'state']));logger[_0x9718('0x2b')](_0x9718('0x2c'),util[_0x9718('0x19')](_0x2d5d27,{'showHidden':![],'depth':null}));this[_0x9718('0x20')](util[_0x9718('0x2d')](_0x9718('0x2e'),_0x2d5d27[_0x9718('0x2f')]),'trunk:save',_0x2d5d27);}}}catch(_0x3699ea){logger[_0x9718('0x17')](_0x9718('0x24'),util['inspect'](_0x3699ea,{'showHidden':![],'depth':null}));}};UserReport[_0x9718('0x1d')]['syncDeviceState']=function(_0x35b96f){try{if(this['isNotNull'](_0x35b96f)){logger[_0x9718('0x30')](_0x9718('0x31'),_0x35b96f[_0x9718('0x32')],_0x35b96f['state']);logger[_0x9718('0x2b')]('[userReport][devicestatechange]',util[_0x9718('0x19')](_0x35b96f,{'showHidden':![],'depth':null}));if(this['agents'][_0x35b96f['device']]){if(!this['agents'][_0x35b96f['device']]['local']||_0x35b96f[_0x9718('0x23')]['toLowerCase']()==_0x9718('0x33')){this[_0x9718('0xa')][_0x35b96f[_0x9718('0x32')]]['local']=![];if(this[_0x9718('0xa')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x23')]!==_0x35b96f[_0x9718('0x23')][_0x9718('0x34')]()){this[_0x9718('0xa')][_0x35b96f[_0x9718('0x32')]]['stateTime']=_[_0x9718('0x35')](moment()['format']('x'));}this[_0x9718('0xa')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x23')]=_0x35b96f[_0x9718('0x23')][_0x9718('0x34')]();this[_0x9718('0xa')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x36')](_0x35b96f);}}else if(this['telephones'][_0x35b96f['device']]){if(this[_0x9718('0xb')][_0x35b96f[_0x9718('0x32')]]['state']!==_0x35b96f['state']['toLowerCase']()){this['telephones'][_0x35b96f[_0x9718('0x32')]][_0x9718('0x37')]=_[_0x9718('0x35')](moment()[_0x9718('0x2d')]('x'));}this[_0x9718('0xb')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x23')]=_0x35b96f[_0x9718('0x23')][_0x9718('0x34')]();logger[_0x9718('0x2b')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x9718('0x19')](this['telephones'][_0x35b96f['device']],{'showHidden':![],'depth':null}));this[_0x9718('0x20')](util[_0x9718('0x2d')]('telephone:%s',this[_0x9718('0xb')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x2f')]),_0x9718('0x38'),this['telephones'][_0x35b96f[_0x9718('0x32')]]);}else if(this['trunks'][_0x35b96f[_0x9718('0x32')]]){if(this[_0x9718('0x9')][_0x35b96f[_0x9718('0x32')]]['state']!==_0x35b96f[_0x9718('0x23')][_0x9718('0x34')]()){this['trunks'][_0x35b96f[_0x9718('0x32')]][_0x9718('0x37')]=_[_0x9718('0x35')](moment()[_0x9718('0x2d')]('x'));}this[_0x9718('0x9')][_0x35b96f[_0x9718('0x32')]][_0x9718('0x23')]=_0x35b96f[_0x9718('0x23')][_0x9718('0x34')]();logger['debug'](_0x9718('0x39'),util[_0x9718('0x19')](this[_0x9718('0x9')][_0x35b96f[_0x9718('0x32')]],{'showHidden':![],'depth':null}));this[_0x9718('0x20')](util['format'](_0x9718('0x2e'),this[_0x9718('0x9')][_0x35b96f[_0x9718('0x32')]]['name']),_0x9718('0x3a'),this['trunks'][_0x35b96f[_0x9718('0x32')]]);}else if(_['startsWith'](_0x35b96f['device'],_0x9718('0x3b'))){var _0x29fe68=_0x35b96f[_0x9718('0x32')];var _0x2bdc07=_0x29fe68['substring'](_0x29fe68[_0x9718('0x3c')]('/')+0x1,_0x29fe68['indexOf']('@'));var _0x355e71=_['find'](this[_0x9718('0xa')],function(_0x2e7202){return _0x2e7202[_0x9718('0x3d')]==_0x2bdc07||_0x2e7202[_0x9718('0x3e')]==_0x2bdc07||_0x2e7202[_0x9718('0x3f')]==_0x2bdc07;});if(_0x355e71){if(_0x355e71[_0x9718('0x23')]!==_0x35b96f['state'][_0x9718('0x34')]()){_0x355e71['stateTime']=_[_0x9718('0x35')](moment()[_0x9718('0x2d')]('x'));}_0x355e71[_0x9718('0x23')]=_0x35b96f['state'][_0x9718('0x34')]();_0x355e71[_0x9718('0x40')]=!![];_0x355e71[_0x9718('0x36')](_0x35b96f);}}}}catch(_0x337238){logger['error'](_0x9718('0x41'),util['inspect'](_0x337238,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x9718('0x42')]=function(_0x1d23d0){try{if(this['isNotNull'](_0x1d23d0)&&this[_0x9718('0x1e')](_0x1d23d0['peerstatus'])){logger['info'](_0x9718('0x43'),_0x1d23d0[_0x9718('0x44')],_0x1d23d0[_0x9718('0x45')],_0x1d23d0[_0x9718('0x12')]);logger[_0x9718('0x2b')](_0x9718('0x46'),util[_0x9718('0x19')](_0x1d23d0,{'showHidden':![],'depth':null}));if(this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]]){if(!this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x40')]||_0x1d23d0['peerstatus'][_0x9718('0x34')]()==_0x9718('0x47')){this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]]['local']=![];this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]]['status']=_0x1d23d0[_0x9718('0x12')][_0x9718('0x34')]();this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x45')]=_0x1d23d0[_0x9718('0x45')];this[_0x9718('0xa')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x36')](_0x1d23d0);}}else if(this[_0x9718('0xb')][_0x1d23d0[_0x9718('0x44')]]){this[_0x9718('0xb')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x48')]=_0x1d23d0[_0x9718('0x12')][_0x9718('0x34')]();this[_0x9718('0xb')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x45')]=_0x1d23d0['address'];logger[_0x9718('0x2b')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x9718('0x19')](this[_0x9718('0xb')][_0x1d23d0['peer']],{'showHidden':![],'depth':null}));this[_0x9718('0x20')](util[_0x9718('0x2d')](_0x9718('0x49'),this[_0x9718('0xb')][_0x1d23d0['peer']]['name']),_0x9718('0x38'),this['telephones'][_0x1d23d0[_0x9718('0x44')]]);}else if(this[_0x9718('0x9')][_0x1d23d0[_0x9718('0x44')]]){this[_0x9718('0x9')][_0x1d23d0['peer']][_0x9718('0x48')]=_0x1d23d0['peerstatus']['toLowerCase']();this[_0x9718('0x9')][_0x1d23d0[_0x9718('0x44')]][_0x9718('0x45')]=_0x1d23d0[_0x9718('0x45')];logger[_0x9718('0x2b')](_0x9718('0x4a'),util[_0x9718('0x19')](this[_0x9718('0x9')][_0x1d23d0['peer']],{'showHidden':![],'depth':null}));this[_0x9718('0x20')](util['format']('trunk:%s',this[_0x9718('0x9')][_0x1d23d0['peer']][_0x9718('0x2f')]),_0x9718('0x3a'),this[_0x9718('0x9')][_0x1d23d0[_0x9718('0x44')]]);}}}catch(_0x30ba8e){logger[_0x9718('0x17')](_0x9718('0x46'),util[_0x9718('0x19')](_0x30ba8e,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0x14dd=['debug','[userReport][registry]','find','stateRegistry','omit','event','actionid','format','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','phone','syncPeerStatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','peerstatus','syncRealtimeShow','resolve','catch','error','[userReport][sipshowregistry]','then','actionDeviceStateList','[userReport][devicestatelist]','inspect','[userReport][sippeerstatus]','isNotNull','isUndefined','emit','prototype','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state'];(function(_0x94b8ea,_0x270abc){var _0x4e9b8d=function(_0x2bacfd){while(--_0x2bacfd){_0x94b8ea['push'](_0x94b8ea['shift']());}};_0x4e9b8d(++_0x270abc);}(_0x14dd,0x1e2));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xd14d('0x0'));var Redis=require('ioredis');var BPromise=require(_0xd14d('0x1'));var config=require(_0xd14d('0x2'));var logger=require(_0xd14d('0x3'))(_0xd14d('0x4'));var ami=require(_0xd14d('0x5'));config[_0xd14d('0x6')]=_[_0xd14d('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd14d('0x8'))(new Redis(config[_0xd14d('0x6')]));function UserReport(_0x517349){this[_0xd14d('0x9')]=_0x517349[_0xd14d('0x9')];this['agents']=_0x517349[_0xd14d('0xa')];this['telephones']=_0x517349[_0xd14d('0xb')];ami['on'](_0xd14d('0xc'),this[_0xd14d('0xd')]['bind'](this));ami['on'](_0xd14d('0xe'),this[_0xd14d('0xd')][_0xd14d('0xf')](this));ami['on'](_0xd14d('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0xd14d('0x11'),this['syncPeerStatus'][_0xd14d('0xf')](this));return this[_0xd14d('0x12')]();}function showSipRegistrations(){Promise[_0xd14d('0x13')]()['then'](ami['actionSipShowRegistry']())[_0xd14d('0x14')](function(_0x510562){logger[_0xd14d('0x15')](_0xd14d('0x16'),util['inspect'](_0x510562,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xd14d('0x17')](ami[_0xd14d('0x18')]())['catch'](function(_0x5b1e18){logger[_0xd14d('0x15')](_0xd14d('0x19'),util[_0xd14d('0x1a')](_0x5b1e18,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd14d('0x13')]()[_0xd14d('0x17')](ami['actionSipPeerStatus']())[_0xd14d('0x14')](function(_0x4b3c51){logger['error'](_0xd14d('0x1b'),util['inspect'](_0x4b3c51,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xd14d('0x12')]=function(){setInterval(function(){BPromise[_0xd14d('0x13')]()[_0xd14d('0x17')](showSipRegistrations())[_0xd14d('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xd14d('0x1c')]=function(_0x12cc21){return _0x12cc21!==null&&!_[_0xd14d('0x1d')](_0x12cc21);};UserReport['prototype'][_0xd14d('0x1e')]=function(_0x33aea5,_0x1998c0,_0x4ca5b7){io['to'](_0x33aea5)[_0xd14d('0x1e')](_0x1998c0,_0x4ca5b7);};UserReport[_0xd14d('0x1f')]['syncRegistry']=function(_0x488168){try{if(this['isNotNull'](_0x488168)){logger[_0xd14d('0x20')](_0xd14d('0x21'),_0x488168[_0xd14d('0x22')],_0x488168[_0xd14d('0x23')]);logger[_0xd14d('0x24')](_0xd14d('0x25'),util['inspect'](_0x488168,{'showHidden':![],'depth':null}));var _0x5d7de4=_[_0xd14d('0x26')](this[_0xd14d('0x9')],{'defaultuser':_0x488168['username']});if(_0x5d7de4){_0x488168[_0xd14d('0x27')]=_0x488168[_0xd14d('0x23')];_['merge'](_0x5d7de4,_[_0xd14d('0x28')](_0x488168,[_0xd14d('0x29'),_0xd14d('0x2a'),_0xd14d('0x22'),_0xd14d('0x23')]));logger[_0xd14d('0x24')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x5d7de4,{'showHidden':![],'depth':null}));this[_0xd14d('0x1e')](util[_0xd14d('0x2b')](_0xd14d('0x2c'),_0x5d7de4[_0xd14d('0x2d')]),_0xd14d('0x2e'),_0x5d7de4);}}}catch(_0x288c4e){logger[_0xd14d('0x15')]('[userReport][registry]',util['inspect'](_0x288c4e,{'showHidden':![],'depth':null}));}};UserReport[_0xd14d('0x1f')][_0xd14d('0x2f')]=function(_0x1d7575){try{if(this[_0xd14d('0x1c')](_0x1d7575)){logger[_0xd14d('0x20')](_0xd14d('0x30'),_0x1d7575['device'],_0x1d7575[_0xd14d('0x23')]);logger[_0xd14d('0x24')]('[userReport][devicestatechange]',util[_0xd14d('0x1a')](_0x1d7575,{'showHidden':![],'depth':null}));if(this[_0xd14d('0xa')][_0x1d7575[_0xd14d('0x31')]]){if(!this[_0xd14d('0xa')][_0x1d7575['device']][_0xd14d('0x32')]||_0x1d7575[_0xd14d('0x23')][_0xd14d('0x33')]()==_0xd14d('0x34')){this[_0xd14d('0xa')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x32')]=![];if(this[_0xd14d('0xa')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x23')]!==_0x1d7575['state'][_0xd14d('0x33')]()){this['agents'][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x35')]=_[_0xd14d('0x36')](moment()[_0xd14d('0x2b')]('x'));}this['agents'][_0x1d7575['device']][_0xd14d('0x23')]=_0x1d7575[_0xd14d('0x23')][_0xd14d('0x33')]();this[_0xd14d('0xa')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x37')](_0x1d7575);}}else if(this['telephones'][_0x1d7575[_0xd14d('0x31')]]){if(this[_0xd14d('0xb')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x23')]!==_0x1d7575[_0xd14d('0x23')][_0xd14d('0x33')]()){this['telephones'][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x35')]=_[_0xd14d('0x36')](moment()[_0xd14d('0x2b')]('x'));}this['telephones'][_0x1d7575[_0xd14d('0x31')]]['state']=_0x1d7575[_0xd14d('0x23')][_0xd14d('0x33')]();logger[_0xd14d('0x24')](_0xd14d('0x38'),util[_0xd14d('0x1a')](this[_0xd14d('0xb')][_0x1d7575['device']],{'showHidden':![],'depth':null}));this[_0xd14d('0x1e')](util[_0xd14d('0x2b')]('telephone:%s',this[_0xd14d('0xb')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x2d')]),_0xd14d('0x39'),this[_0xd14d('0xb')][_0x1d7575[_0xd14d('0x31')]]);}else if(this[_0xd14d('0x9')][_0x1d7575[_0xd14d('0x31')]]){if(this[_0xd14d('0x9')][_0x1d7575[_0xd14d('0x31')]]['state']!==_0x1d7575['state'][_0xd14d('0x33')]()){this[_0xd14d('0x9')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x35')]=_[_0xd14d('0x36')](moment()['format']('x'));}this[_0xd14d('0x9')][_0x1d7575[_0xd14d('0x31')]][_0xd14d('0x23')]=_0x1d7575[_0xd14d('0x23')][_0xd14d('0x33')]();logger['debug'](_0xd14d('0x3a'),util['inspect'](this['trunks'][_0x1d7575[_0xd14d('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd14d('0x2b')]('trunk:%s',this['trunks'][_0x1d7575['device']][_0xd14d('0x2d')]),_0xd14d('0x2e'),this[_0xd14d('0x9')][_0x1d7575[_0xd14d('0x31')]]);}else if(_[_0xd14d('0x3b')](_0x1d7575[_0xd14d('0x31')],_0xd14d('0x3c'))){var _0x30f882=_0x1d7575[_0xd14d('0x31')];var _0x4c5e2c=_0x30f882[_0xd14d('0x3d')](_0x30f882[_0xd14d('0x3e')]('/')+0x1,_0x30f882['indexOf']('@'));var _0x38df19=_['find'](this[_0xd14d('0xa')],function(_0x145488){return _0x145488['mobile']==_0x4c5e2c||_0x145488[_0xd14d('0x3f')]==_0x4c5e2c||_0x145488['accountcode']==_0x4c5e2c;});if(_0x38df19){if(_0x38df19[_0xd14d('0x23')]!==_0x1d7575['state'][_0xd14d('0x33')]()){_0x38df19[_0xd14d('0x35')]=_['toNumber'](moment()[_0xd14d('0x2b')]('x'));}_0x38df19['state']=_0x1d7575['state'][_0xd14d('0x33')]();_0x38df19[_0xd14d('0x32')]=!![];_0x38df19['updateStatusRealtime'](_0x1d7575);}}}}catch(_0x239852){logger['error']('[userReport][devicestatechange]',util[_0xd14d('0x1a')](_0x239852,{'showHidden':![],'depth':null}));}};UserReport[_0xd14d('0x1f')][_0xd14d('0x40')]=function(_0x18ba2b){try{if(this['isNotNull'](_0x18ba2b)&&this[_0xd14d('0x1c')](_0x18ba2b[_0xd14d('0x11')])){logger[_0xd14d('0x20')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x18ba2b[_0xd14d('0x41')],_0x18ba2b[_0xd14d('0x42')],_0x18ba2b[_0xd14d('0x11')]);logger[_0xd14d('0x24')](_0xd14d('0x43'),util['inspect'](_0x18ba2b,{'showHidden':![],'depth':null}));if(this[_0xd14d('0xa')][_0x18ba2b[_0xd14d('0x41')]]){if(!this['agents'][_0x18ba2b[_0xd14d('0x41')]]['local']||_0x18ba2b[_0xd14d('0x11')][_0xd14d('0x33')]()==_0xd14d('0x44')){this[_0xd14d('0xa')][_0x18ba2b[_0xd14d('0x41')]][_0xd14d('0x32')]=![];this[_0xd14d('0xa')][_0x18ba2b[_0xd14d('0x41')]][_0xd14d('0x45')]=_0x18ba2b['peerstatus'][_0xd14d('0x33')]();this[_0xd14d('0xa')][_0x18ba2b[_0xd14d('0x41')]][_0xd14d('0x42')]=_0x18ba2b[_0xd14d('0x42')];this[_0xd14d('0xa')][_0x18ba2b['peer']][_0xd14d('0x37')](_0x18ba2b);}}else if(this[_0xd14d('0xb')][_0x18ba2b[_0xd14d('0x41')]]){this[_0xd14d('0xb')][_0x18ba2b[_0xd14d('0x41')]][_0xd14d('0x45')]=_0x18ba2b[_0xd14d('0x11')][_0xd14d('0x33')]();this['telephones'][_0x18ba2b['peer']][_0xd14d('0x42')]=_0x18ba2b['address'];logger[_0xd14d('0x24')](_0xd14d('0x46'),util[_0xd14d('0x1a')](this[_0xd14d('0xb')][_0x18ba2b[_0xd14d('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xd14d('0x47'),this['telephones'][_0x18ba2b['peer']][_0xd14d('0x2d')]),'telephone:save',this['telephones'][_0x18ba2b[_0xd14d('0x41')]]);}else if(this[_0xd14d('0x9')][_0x18ba2b[_0xd14d('0x41')]]){this['trunks'][_0x18ba2b['peer']][_0xd14d('0x45')]=_0x18ba2b[_0xd14d('0x11')][_0xd14d('0x33')]();this[_0xd14d('0x9')][_0x18ba2b[_0xd14d('0x41')]]['address']=_0x18ba2b[_0xd14d('0x42')];logger[_0xd14d('0x24')](_0xd14d('0x48'),util[_0xd14d('0x1a')](this[_0xd14d('0x9')][_0x18ba2b[_0xd14d('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd14d('0x2b')](_0xd14d('0x2c'),this[_0xd14d('0x9')][_0x18ba2b[_0xd14d('0x41')]]['name']),_0xd14d('0x2e'),this[_0xd14d('0x9')][_0x18ba2b['peer']]);}}}catch(_0x372106){logger['error'](_0xd14d('0x43'),util['inspect'](_0x372106,{'showHidden':![],'depth':null}));}};module[_0xd14d('0x49')]=UserReport;
\ No newline at end of file
index 026cc02..f2550a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93dd=['syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','value','keys','isUndefined','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentconnectAt','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','socket.io-emitter','redis','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','debug','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','pick','channel','split','name','accountcode','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','agentacw','destconnectedlinenum','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete'];(function(_0x38aa2f,_0x253676){var _0x1f16cc=function(_0x1d7622){while(--_0x1d7622){_0x38aa2f['push'](_0x38aa2f['shift']());}};_0x1f16cc(++_0x253676);}(_0x93dd,0x17a));var _0xd93d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x93dd[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd93d('0x0'));var moment=require(_0xd93d('0x1'));var util=require(_0xd93d('0x2'));var Redis=require(_0xd93d('0x3'));var config=require(_0xd93d('0x4'));var logger=require(_0xd93d('0x5'))(_0xd93d('0x6'));var ami=require(_0xd93d('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd93d('0x8'))(new Redis(config[_0xd93d('0x9')]));function VoiceAgentReport(_0xc8859a){this['channels']={};this[_0xd93d('0xa')]=_0xc8859a[_0xd93d('0xb')];this['voiceQueues']=_0xc8859a[_0xd93d('0xc')];this[_0xd93d('0xd')]=_0xc8859a[_0xd93d('0xd')];this[_0xd93d('0xe')]={};ami['on'](_0xd93d('0xf'),this[_0xd93d('0x10')][_0xd93d('0x11')](this));ami['on']('agentconnect',this[_0xd93d('0x12')]['bind'](this));ami['on'](_0xd93d('0x13'),this[_0xd93d('0x14')]['bind'](this));ami['on'](_0xd93d('0x15'),this[_0xd93d('0x16')][_0xd93d('0x11')](this));ami['on'](_0xd93d('0x17'),this['syncAgentComplete'][_0xd93d('0x11')](this));ami['on']('varset',this['syncVarSet'][_0xd93d('0x11')](this));ami['on'](_0xd93d('0x18'),this[_0xd93d('0x19')][_0xd93d('0x11')](this));ami['on'](_0xd93d('0x1a'),this[_0xd93d('0x1b')]['bind'](this));ami['on'](_0xd93d('0x1c'),this[_0xd93d('0x1d')][_0xd93d('0x11')](this));ami['on'](_0xd93d('0x1e'),this[_0xd93d('0x1f')][_0xd93d('0x11')](this));ami['on']('blindtransfer',this[_0xd93d('0x20')][_0xd93d('0x11')](this));}VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x22')]=function(_0x3c76cc,_0xa0acf8,_0x2c5188){io['to'](_0x3c76cc)[_0xd93d('0x22')](_0xa0acf8,_0x2c5188);};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x23')]=function(_0x3a128c){return _0x3a128c!==null&&!_['isUndefined'](_0x3a128c);};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x10')]=function(_0x5dd38b){try{if(this[_0xd93d('0x23')](_0x5dd38b)){logger[_0xd93d('0x24')](_0xd93d('0x25'),_0x5dd38b['uniqueid'],_0x5dd38b[_0xd93d('0x26')],_0x5dd38b[_0xd93d('0x27')]);logger['debug'](_0xd93d('0x28'),_0x5dd38b['uniqueid'],util['inspect'](_0x5dd38b,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd93d('0xb')][_0x5dd38b[_0xd93d('0x29')]])){this[_0xd93d('0xb')][_0x5dd38b[_0xd93d('0x29')]]={};}var _0x2484c4=this[_0xd93d('0xd')][_0x5dd38b[_0xd93d('0x2a')]];var _0x7a2380=this['channels'][_0x5dd38b[_0xd93d('0x29')]][_0x5dd38b[_0xd93d('0x27')]];var _0x1d1e7b=this['voiceQueues'][_0x5dd38b[_0xd93d('0x2b')]];var _0x5daeae=this[_0xd93d('0xe')][_0x5dd38b['uniqueid']];if(_['isUndefined'](_0x7a2380)){_0x7a2380={'agentcalledAt':moment()[_0xd93d('0x2c')](_0xd93d('0x2d')),'lastevent':_0xd93d('0x2e'),'mandatoryDisposition':_0x1d1e7b&&_0x1d1e7b[_0xd93d('0x2f')]?_0x1d1e7b[_0xd93d('0x2f')]:![],'type':_0x1d1e7b&&_0x1d1e7b['type']?_0x1d1e7b[_0xd93d('0x30')]:_0xd93d('0x31'),'variables':_0x5daeae,'motionChannel':_0xd93d('0x32')};}_[_0xd93d('0x33')](_0x7a2380,_['omit'](_0x5dd38b,[_0xd93d('0x34'),_0xd93d('0x35')]));logger['debug'](_0xd93d('0x36'),_0x5dd38b[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x7a2380,{'showHidden':![],'depth':null}));ami[_0xd93d('0x22')](_0xd93d('0x38'),_0x7a2380);var _0x45e01a={'id':_0x2484c4['id'],'calleridnum':_0x7a2380[_0xd93d('0x39')],'queue':_0x7a2380[_0xd93d('0x2b')],'variables':_0x7a2380['variables'],'uniqueid':_0x5dd38b[_0xd93d('0x29')]};logger[_0xd93d('0x3a')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x5dd38b[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x45e01a,{'showHidden':![],'depth':null}));this[_0xd93d('0x22')](util[_0xd93d('0x2c')]('user:%s',_0x5dd38b[_0xd93d('0x26')]),_0xd93d('0x3b'),_0x45e01a);}}catch(_0x1007a1){logger[_0xd93d('0x3c')](_0xd93d('0x3d'),_0x5dd38b[_0xd93d('0x29')],util['inspect'](_0x1007a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd93d('0x12')]=function(_0x268984){try{if(this[_0xd93d('0x23')](_0x268984)){if(this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]]){logger[_0xd93d('0x3a')](_0xd93d('0x3e'),_0x268984[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x268984,{'showHidden':![],'depth':null}));for(var _0x2cc1d7 in this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]]){if(this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0xd93d('0x3f')](_0x2cc1d7)){if(_0x268984[_0xd93d('0x27')]===_0x2cc1d7){logger['info'](_0xd93d('0x40'),_0x268984[_0xd93d('0x29')],_0x268984[_0xd93d('0x26')],_0x268984['destuniqueid']);this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['agentconnectAt']=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x41')]=_0x268984[_0xd93d('0x41')];this['channels'][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['connectedlinenum']=_0x268984[_0xd93d('0x42')];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['destchannelstate']=_0x268984['destchannelstate'];this['channels'][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x43')]=_0x268984[_0xd93d('0x43')];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['holdtime']=_0x268984[_0xd93d('0x44')];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x45')]=_0xd93d('0x46');if(this['voiceChannels'][this[_0xd93d('0xb')][_0x268984['uniqueid']][_0x2cc1d7][_0xd93d('0x29')]]){var _0x195e0f=this[_0xd93d('0xa')][this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x29')]][_0xd93d('0x47')];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x47')]=_0x195e0f;_0x268984['routealias']=_0x195e0f;}_[_0xd93d('0x33')](this[_0xd93d('0xd')][_0x268984['interface']],_[_0xd93d('0x48')](_0x268984,[_0xd93d('0x2b'),'destconnectedlinenum',_0xd93d('0x47')]));var _0x56fe1a=this[_0xd93d('0xd')][_0x268984[_0xd93d('0x49')][_0xd93d('0x4a')]('-')[0x0]];var _0x584782={'id':_0x56fe1a['id'],'name':_0x56fe1a[_0xd93d('0x4b')],'agentconnected':!![],'destaccountcode':_0x56fe1a[_0xd93d('0x4c')],'destconnectedlinenum':this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x268984[_0xd93d('0x27')]]['exten'],'queue':this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x268984['destuniqueid']][_0xd93d('0x2b')],'routealias':this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x268984[_0xd93d('0x27')]][_0xd93d('0x47')],'uniqueid':this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x268984[_0xd93d('0x27')]][_0xd93d('0x29')]};logger[_0xd93d('0x3a')](_0xd93d('0x4d'),_0x268984[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x584782,{'showHidden':![],'depth':null}));ami[_0xd93d('0x22')](_0xd93d('0x4e'),_0x584782);logger[_0xd93d('0x3a')](_0xd93d('0x4f'),_0x268984[_0xd93d('0x29')],util['inspect'](_0x584782,{'showHidden':![],'depth':null}));this['emit'](util[_0xd93d('0x2c')](_0xd93d('0x50'),_0x268984[_0xd93d('0x26')]),_0xd93d('0x51'),_0x584782);}else if(!this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['agentringnoanswer']&&!this[_0xd93d('0xb')][_0x268984['uniqueid']][_0x2cc1d7][_0xd93d('0x17')]){logger['info'](_0xd93d('0x52'),_0x268984['uniqueid'],this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['membername'],_0x2cc1d7);this['channels'][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]['agentringnoanswer']=!![];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x53')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));this['channels'][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x54')]=_0x268984['destuniqueid'];this[_0xd93d('0xb')][_0x268984[_0xd93d('0x29')]][_0x2cc1d7][_0xd93d('0x55')]=_0x268984[_0xd93d('0x26')];this[_0xd93d('0xb')][_0x268984['uniqueid']][_0x2cc1d7][_0xd93d('0x45')]=_0xd93d('0x56');this[_0xd93d('0xb')][_0x268984['uniqueid']][_0x2cc1d7][_0xd93d('0x57')]=_0xd93d('0x56');logger['debug'](_0xd93d('0x58'),_0x268984[_0xd93d('0x29')],util[_0xd93d('0x37')](this[_0xd93d('0xb')][_0x268984['uniqueid']][_0x2cc1d7],{'showHidden':![],'depth':null}));ami[_0xd93d('0x22')](_0xd93d('0x59'),this['channels'][_0x268984[_0xd93d('0x29')]][_0x2cc1d7]);}}}}}}catch(_0x2fd94f){logger[_0xd93d('0x3c')](_0xd93d('0x5a'),_0x268984[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x2fd94f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')]['syncAgentRingNoAnswer']=function(_0x57ca37){try{if(this[_0xd93d('0x23')](_0x57ca37)){logger[_0xd93d('0x3a')](_0xd93d('0x5b'),_0x57ca37[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x57ca37,{'showHidden':![],'depth':null}));if(this[_0xd93d('0xb')][_0x57ca37[_0xd93d('0x29')]]&&this[_0xd93d('0xb')][_0x57ca37['uniqueid']][_0x57ca37[_0xd93d('0x27')]]){logger['info'](_0xd93d('0x5c'),_0x57ca37['uniqueid'],_0x57ca37[_0xd93d('0x26')],_0x57ca37[_0xd93d('0x27')]);var _0x4ac24c=this[_0xd93d('0xd')][_0x57ca37['interface']];var _0x41a1eb=this['channels'][_0x57ca37['uniqueid']][_0x57ca37['destuniqueid']];_0x41a1eb[_0xd93d('0x13')]=!![];_0x41a1eb[_0xd93d('0x53')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));_0x41a1eb[_0xd93d('0x45')]='rejected';_0x41a1eb[_0xd93d('0x57')]=_0xd93d('0x5d');var _0x57f5d3={'id':_0x4ac24c['id'],'name':_0x4ac24c[_0xd93d('0x4b')],'queue':_0x41a1eb[_0xd93d('0x2b')],'uniqueid':_0x41a1eb[_0xd93d('0x29')]};logger[_0xd93d('0x3a')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x57ca37[_0xd93d('0x29')],util['inspect'](_0x57f5d3,{'showHidden':![],'depth':null}));this['emit'](util[_0xd93d('0x2c')]('user:%s',_0x4ac24c[_0xd93d('0x4b')]),_0xd93d('0x5e'),_0x57f5d3);ami[_0xd93d('0x22')](_0xd93d('0x5f'),_0x41a1eb);}}}catch(_0x117a02){logger['error'](_0xd93d('0x60'),_0x57ca37['uniqueid'],util[_0xd93d('0x37')](_0x117a02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x16')]=function(_0x45cfb4){try{if(this[_0xd93d('0x23')](_0x45cfb4)){logger['debug'](_0xd93d('0x61'),_0x45cfb4['uniqueid'],util['inspect'](_0x45cfb4,{'showHidden':![],'depth':null}));if(this['channels'][_0x45cfb4[_0xd93d('0x29')]]){for(var _0x375271 in this[_0xd93d('0xb')][_0x45cfb4[_0xd93d('0x29')]]){if(this[_0xd93d('0xb')][_0x45cfb4['uniqueid']][_0xd93d('0x3f')](_0x375271)&&!this[_0xd93d('0xb')][_0x45cfb4['uniqueid']][_0x375271][_0xd93d('0x13')]&&!this['channels'][_0x45cfb4[_0xd93d('0x29')]][_0x375271]['agentcomplete']){logger[_0xd93d('0x24')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x45cfb4[_0xd93d('0x29')],this[_0xd93d('0xb')][_0x45cfb4[_0xd93d('0x29')]][_0x375271]['membername'],_0x375271);this[_0xd93d('0xb')][_0x45cfb4['uniqueid']][_0x375271][_0xd93d('0x13')]=!![];this['channels'][_0x45cfb4[_0xd93d('0x29')]][_0x375271][_0xd93d('0x53')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));this[_0xd93d('0xb')][_0x45cfb4[_0xd93d('0x29')]][_0x375271]['lastevent']=_0xd93d('0x62');this['channels'][_0x45cfb4[_0xd93d('0x29')]][_0x375271][_0xd93d('0x57')]=_0xd93d('0x62');logger[_0xd93d('0x3a')](_0xd93d('0x63'),_0x45cfb4[_0xd93d('0x29')],util[_0xd93d('0x37')](this[_0xd93d('0xb')][_0x45cfb4['uniqueid']][_0x375271],{'showHidden':![],'depth':null}));ami[_0xd93d('0x22')](_0xd93d('0x64'),this['channels'][_0x45cfb4['uniqueid']][_0x375271]);}}}}}catch(_0x3a6f60){logger['error'](_0xd93d('0x65'),_0x45cfb4[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x3a6f60,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x66')]=function(_0x2d3316){try{if(this[_0xd93d('0x23')](_0x2d3316)){logger['debug'](_0xd93d('0x67'),_0x2d3316['uniqueid'],util[_0xd93d('0x37')](_0x2d3316,{'showHidden':![],'depth':null}));if(this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]]){for(var _0xee52ab in this['channels'][_0x2d3316['uniqueid']]){if(this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xd93d('0x3f')](_0xee52ab)){if(this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab]['agentconnectAt']&&!this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x17')]){logger[_0xd93d('0x24')](_0xd93d('0x68'),_0x2d3316[_0xd93d('0x29')],this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x26')],_0xee52ab);this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x17')]=!![];this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x69')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x45')]=_0xd93d('0x6a');this['channels'][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x57')]=_0x2d3316['reason']=='transfer'?_0xd93d('0x6b'):_0x2d3316[_0xd93d('0x57')];this['channels'][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x6c')]=_0x2d3316[_0xd93d('0x6c')];if(this['voiceQueues'][_0x2d3316[_0xd93d('0x2b')]]&&this[_0xd93d('0xc')][_0x2d3316['queue']][_0xd93d('0x6d')]){this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab]['acwtime']=this[_0xd93d('0xc')][_0x2d3316[_0xd93d('0x2b')]][_0xd93d('0x6e')];this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab][_0xd93d('0x6f')]=!![];}this['agents'][_0x2d3316[_0xd93d('0x2a')]]=_['omit'](this[_0xd93d('0xd')][_0x2d3316['interface']],[_0xd93d('0x2b'),_0xd93d('0x70')]);logger[_0xd93d('0x3a')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x2d3316[_0xd93d('0x29')],util[_0xd93d('0x37')](this['channels'][_0x2d3316[_0xd93d('0x29')]][_0xee52ab],{'showHidden':![],'depth':null}));ami[_0xd93d('0x22')](_0xd93d('0x71'),this[_0xd93d('0xb')][_0x2d3316[_0xd93d('0x29')]][_0xee52ab]);logger['debug'](_0xd93d('0x72'),_0x2d3316[_0xd93d('0x29')],util['inspect']({'id':this[_0xd93d('0xd')][_0x2d3316['interface']]['id'],'destaccountcode':_0x2d3316[_0xd93d('0x73')]},{'showHidden':![],'depth':null}));this[_0xd93d('0x22')](util['format'](_0xd93d('0x50'),_0x2d3316['membername']),_0xd93d('0x74'),{'id':this[_0xd93d('0xd')][_0x2d3316['interface']]['id'],'destaccountcode':Number(_0x2d3316[_0xd93d('0x73')])});}}}}}}catch(_0x14fb1b){logger['error']('[%s][voiceAgentReport][agentcomplete]',_0x2d3316[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x14fb1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x75')]=function(_0x1bc060){try{if(this[_0xd93d('0x23')](_0x1bc060)){logger['debug'](_0xd93d('0x76'),_0x1bc060[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x1bc060,{'showHidden':![],'depth':null}));this[_0xd93d('0x77')](_0x1bc060['uniqueid'],_['keys'](_0x1bc060[_0xd93d('0x78')])[0x0],_0x1bc060[_0xd93d('0x79')]);if(this['channels'][_0x1bc060[_0xd93d('0x29')]]){for(var _0x205548 in this[_0xd93d('0xb')][_0x1bc060[_0xd93d('0x29')]]){if(this[_0xd93d('0xb')][_0x1bc060['uniqueid']][_0xd93d('0x3f')](_0x205548)){logger[_0xd93d('0x24')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x1bc060[_0xd93d('0x29')],_0x205548,_[_0xd93d('0x7a')](_0x1bc060[_0xd93d('0x78')])[0x0],_0x1bc060[_0xd93d('0x79')]);if(_[_0xd93d('0x7b')](this['channels'][_0x1bc060['uniqueid']][_0x205548]['variables'])){this[_0xd93d('0xb')][_0x1bc060['uniqueid']][_0x205548][_0xd93d('0xe')]={};}this['channels'][_0x1bc060[_0xd93d('0x29')]][_0x205548][_0xd93d('0xe')]=this[_0xd93d('0xe')][_0x1bc060[_0xd93d('0x29')]];}}}}}catch(_0x3e5dd1){logger[_0xd93d('0x3c')](_0xd93d('0x7c'),_0x1bc060[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x3e5dd1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x77')]=function(_0x1397fc,_0x14b81d,_0x15e013){var _0x4555a4=['rtpaudioqos',_0xd93d('0x7d'),_0xd93d('0x7e'),_0xd93d('0x7f'),_0xd93d('0x80'),_0xd93d('0x81'),_0xd93d('0x82'),_0xd93d('0x83'),_0xd93d('0x84'),_0xd93d('0x85'),'bridgepeer',_0xd93d('0x86'),_0xd93d('0x87'),_0xd93d('0x88'),_0xd93d('0x89'),_0xd93d('0x8a'),_0xd93d('0x26'),'memberpenalty',_0xd93d('0x8b')];if(!_['isNil'](_0x14b81d)&&!_[_0xd93d('0x8c')](_0x4555a4,_0x14b81d)){if(_[_0xd93d('0x7b')](this['variables'][_0x1397fc])){this['variables'][_0x1397fc]={};}this['variables'][_0x1397fc][_0x14b81d]=_0x15e013;}};VoiceAgentReport[_0xd93d('0x21')][_0xd93d('0x19')]=function(_0x2456b1){try{if(this[_0xd93d('0x23')](_0x2456b1)){logger[_0xd93d('0x3a')](_0xd93d('0x8d'),_0x2456b1[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x2456b1,{'showHidden':![],'depth':null}));if(this[_0xd93d('0xb')][_0x2456b1[_0xd93d('0x29')]]){for(var _0x3cf422 in this[_0xd93d('0xb')][_0x2456b1['uniqueid']]){if(this['channels'][_0x2456b1['uniqueid']]['hasOwnProperty'](_0x3cf422)){if(this[_0xd93d('0xb')][_0x2456b1[_0xd93d('0x29')]][_0x3cf422]['reason']==_0xd93d('0x8e')&&this[_0xd93d('0xb')][_0x2456b1[_0xd93d('0x29')]][_0x3cf422][_0xd93d('0x17')]){logger['info'](_0xd93d('0x8f'),_0x2456b1[_0xd93d('0x29')],_0x3cf422);this[_0xd93d('0xb')][_0x2456b1['uniqueid']][_0x3cf422][_0xd93d('0x69')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));}}}logger[_0xd93d('0x3a')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2456b1[_0xd93d('0x29')],util[_0xd93d('0x37')](_[_0xd93d('0x90')](this[_0xd93d('0xb')][_0x2456b1[_0xd93d('0x29')]]),{'showHidden':![],'depth':null}));ami['emit'](_0xd93d('0x91'),_['values'](this[_0xd93d('0xb')][_0x2456b1['uniqueid']]));delete this[_0xd93d('0xb')][_0x2456b1['uniqueid']];}if(this[_0xd93d('0xe')][_0x2456b1[_0xd93d('0x29')]]){delete this['variables'][_0x2456b1[_0xd93d('0x29')]];}}}catch(_0x1fe52f){logger['error'](_0xd93d('0x92'),_0x2456b1[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x1fe52f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')]['syncAttendedTransfer']=function(_0x4a5fa4){try{if(this[_0xd93d('0x23')](_0x4a5fa4)){logger['debug'](_0xd93d('0x93'),_0x4a5fa4[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x4a5fa4,{'showHidden':![],'depth':null}));if(this['channels'][_0x4a5fa4['transfereeuniqueid']]){for(var _0xa67d5b in this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]]){if(this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]]['hasOwnProperty'](_0xa67d5b)){if(_0x4a5fa4[_0xd93d('0x95')]===_0xa67d5b){logger[_0xd93d('0x24')](_0xd93d('0x96'),_0x4a5fa4[_0xd93d('0x29')],this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b][_0xd93d('0x26')],_0xa67d5b);var _0xd239f6=moment();this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b][_0xd93d('0x17')]=!![];this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b][_0xd93d('0x69')]=moment()[_0xd93d('0x2c')](_0xd93d('0x2d'));this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b]['lastevent']=_0xd93d('0x6a');this['channels'][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b][_0xd93d('0x57')]=_0xd93d('0x8e');this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b]['talktime']=_0xd239f6[_0xd93d('0x97')](this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]][_0xa67d5b]['agentconnectAt'],'seconds');}}}}if(this['channels'][_0x4a5fa4[_0xd93d('0x98')]]){var _0x4ff017=this[_0xd93d('0xb')][_0x4a5fa4['secondtransfereruniqueid']];this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x98')]]=this['channels'][_0x4a5fa4[_0xd93d('0x94')]];this[_0xd93d('0xb')][_0x4a5fa4[_0xd93d('0x94')]]=_0x4ff017;}}}catch(_0x14ecd9){logger['error'](_0xd93d('0x99'),_0x4a5fa4[_0xd93d('0x29')],util['inspect'](_0x14ecd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd93d('0x20')]=function(_0x42ad48){try{if(this[_0xd93d('0x23')](_0x42ad48)){logger['debug'](_0xd93d('0x9a'),_0x42ad48[_0xd93d('0x29')],util['inspect'](_0x42ad48,{'showHidden':![],'depth':null}));if(this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]]){for(var _0x1425e6 in this['channels'][_0x42ad48[_0xd93d('0x94')]]){if(this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]][_0xd93d('0x3f')](_0x1425e6)){if(_0x42ad48['transfereruniqueid']===_0x1425e6){logger[_0xd93d('0x24')](_0xd93d('0x9b'),_0x42ad48[_0xd93d('0x29')],this[_0xd93d('0xb')][_0x42ad48['transfereeuniqueid']][_0x1425e6][_0xd93d('0x26')],_0x1425e6);var _0xa82461=moment();this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]][_0x1425e6][_0xd93d('0x17')]=!![];this['channels'][_0x42ad48['transfereeuniqueid']][_0x1425e6][_0xd93d('0x69')]=_0xa82461;this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]][_0x1425e6][_0xd93d('0x45')]=_0xd93d('0x6a');this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]][_0x1425e6]['reason']='transfer';this[_0xd93d('0xb')][_0x42ad48[_0xd93d('0x94')]][_0x1425e6]['talktime']=_0xa82461[_0xd93d('0x97')](this[_0xd93d('0xb')][_0x42ad48['transfereeuniqueid']][_0x1425e6][_0xd93d('0x9c')],_0xd93d('0x9d'));}}}}}}catch(_0x435b6a){logger['error'](_0xd93d('0x9e'),_0x42ad48[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x435b6a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd93d('0x1b')]=function(_0x8617bd){var _0x1c6267='';try{if(this[_0xd93d('0x23')](_0x8617bd)){logger[_0xd93d('0x3a')](_0xd93d('0x9f'),_0x8617bd[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x8617bd,{'showHidden':![],'depth':null}));if(_0x8617bd[_0xd93d('0x49')]){_0x1c6267=_0x8617bd[_0xd93d('0x49')][_0xd93d('0xa0')](0x0,_0x8617bd[_0xd93d('0x49')][_0xd93d('0xa1')]('-'));if(this[_0xd93d('0xd')][_0x1c6267]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x8617bd[_0xd93d('0x29')],_0x1c6267);this['agents'][_0x1c6267][_0xd93d('0xa2')]=!![];}}}}catch(_0x1de4e8){logger['error'](_0xd93d('0xa3'),_0x8617bd[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x1de4e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd93d('0x21')]['syncMusicOnHoldStop']=function(_0x37390f){var _0x17325a='';try{if(this[_0xd93d('0x23')](_0x37390f)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x37390f[_0xd93d('0x29')],util[_0xd93d('0x37')](_0x37390f,{'showHidden':![],'depth':null}));if(_0x37390f[_0xd93d('0x49')]){_0x17325a=_0x37390f[_0xd93d('0x49')][_0xd93d('0xa0')](0x0,_0x37390f['channel'][_0xd93d('0xa1')]('-'));if(this[_0xd93d('0xd')][_0x17325a]){logger[_0xd93d('0x24')](_0xd93d('0xa4'),_0x37390f['uniqueid'],_0x17325a);this['agents'][_0x17325a][_0xd93d('0xa2')]=![];}}}}catch(_0x38df1f){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x37390f['uniqueid'],util['inspect'](_0x38df1f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xeed0=['syncAgentCalled','bind','agentconnect','queuecallerabandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstop','blindtransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','channels','interface','destuniqueid','voiceQueues','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','merge','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','error','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','routealias','destconnectedlinenum','channel','split','name','accountcode','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','user:%s','agentringnoanswer','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','reason','rejected','user:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','agents','variables','agentcalled'];(function(_0x531f91,_0x876745){var _0x2ee70f=function(_0x41d769){while(--_0x41d769){_0x531f91['push'](_0x531f91['shift']());}};_0x2ee70f(++_0x876745);}(_0xeed0,0x1c2));var _0x0eed=function(_0x551876,_0x14bc1b){_0x551876=_0x551876-0x0;var _0x337952=_0xeed0[_0x551876];return _0x337952;};'use strict';var _=require(_0x0eed('0x0'));var moment=require('moment');var util=require(_0x0eed('0x1'));var Redis=require(_0x0eed('0x2'));var config=require(_0x0eed('0x3'));var logger=require(_0x0eed('0x4'))(_0x0eed('0x5'));var ami=require(_0x0eed('0x6'));config[_0x0eed('0x7')]=_[_0x0eed('0x8')](config[_0x0eed('0x7')],{'host':_0x0eed('0x9'),'port':0x18eb});var io=require(_0x0eed('0xa'))(new Redis(config[_0x0eed('0x7')]));function VoiceAgentReport(_0x1ad057){this['channels']={};this[_0x0eed('0xb')]=_0x1ad057['channels'];this['voiceQueues']=_0x1ad057['voiceQueues'];this[_0x0eed('0xc')]=_0x1ad057[_0x0eed('0xc')];this[_0x0eed('0xd')]={};ami['on'](_0x0eed('0xe'),this[_0x0eed('0xf')][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x11'),this['syncAgentConnect'][_0x0eed('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x0eed('0x12'),this['syncQueueCallerAbandon'][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x13'),this[_0x0eed('0x14')][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x15'),this['syncVarSet'][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x16'),this[_0x0eed('0x17')]['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x18'),this['syncMusicOnHoldStop'][_0x0eed('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0eed('0x10')](this));ami['on'](_0x0eed('0x19'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x1b')]=function(_0x1bcdee,_0x5884ab,_0x15405c){io['to'](_0x1bcdee)['emit'](_0x5884ab,_0x15405c);};VoiceAgentReport['prototype'][_0x0eed('0x1c')]=function(_0x5af736){return _0x5af736!==null&&!_[_0x0eed('0x1d')](_0x5af736);};VoiceAgentReport[_0x0eed('0x1a')]['syncAgentCalled']=function(_0x564678){try{if(this[_0x0eed('0x1c')](_0x564678)){logger[_0x0eed('0x1e')](_0x0eed('0x1f'),_0x564678[_0x0eed('0x20')],_0x564678[_0x0eed('0x21')],_0x564678['destuniqueid']);logger[_0x0eed('0x22')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x564678['uniqueid'],util['inspect'](_0x564678,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0eed('0x23')][_0x564678[_0x0eed('0x20')]])){this['channels'][_0x564678[_0x0eed('0x20')]]={};}var _0x1eb411=this[_0x0eed('0xc')][_0x564678[_0x0eed('0x24')]];var _0x81c16d=this[_0x0eed('0x23')][_0x564678[_0x0eed('0x20')]][_0x564678[_0x0eed('0x25')]];var _0x189ab7=this[_0x0eed('0x26')][_0x564678[_0x0eed('0x27')]];var _0x50aac6=this['variables'][_0x564678[_0x0eed('0x20')]];if(_[_0x0eed('0x1d')](_0x81c16d)){_0x81c16d={'agentcalledAt':moment()['format'](_0x0eed('0x28')),'lastevent':_0x0eed('0x29'),'mandatoryDisposition':_0x189ab7&&_0x189ab7[_0x0eed('0x2a')]?_0x189ab7[_0x0eed('0x2a')]:![],'type':_0x189ab7&&_0x189ab7[_0x0eed('0x2b')]?_0x189ab7[_0x0eed('0x2b')]:_0x0eed('0x2c'),'variables':_0x50aac6,'motionChannel':'voice'};}_[_0x0eed('0x2d')](_0x81c16d,_['omit'](_0x564678,[_0x0eed('0x2e'),_0x0eed('0x2f')]));logger['debug'](_0x0eed('0x30'),_0x564678[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x81c16d,{'showHidden':![],'depth':null}));ami[_0x0eed('0x1b')](_0x0eed('0x32'),_0x81c16d);var _0x452afe={'id':_0x1eb411['id'],'calleridnum':_0x81c16d[_0x0eed('0x33')],'queue':_0x81c16d[_0x0eed('0x27')],'variables':_0x81c16d[_0x0eed('0xd')],'uniqueid':_0x564678[_0x0eed('0x20')]};logger[_0x0eed('0x22')](_0x0eed('0x34'),_0x564678['uniqueid'],util[_0x0eed('0x31')](_0x452afe,{'showHidden':![],'depth':null}));this['emit'](util[_0x0eed('0x35')]('user:%s',_0x564678[_0x0eed('0x21')]),_0x0eed('0x36'),_0x452afe);}}catch(_0x185c98){logger[_0x0eed('0x37')]('[%s][voiceAgentReport][agentcalled]',_0x564678['uniqueid'],util[_0x0eed('0x31')](_0x185c98,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x38')]=function(_0x27b373){try{if(this['isNotNull'](_0x27b373)){if(this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]]){logger['debug'](_0x0eed('0x39'),_0x27b373[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x27b373,{'showHidden':![],'depth':null}));for(var _0x8076f6 in this[_0x0eed('0x23')][_0x27b373['uniqueid']]){if(this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x0eed('0x3a')](_0x8076f6)){if(_0x27b373[_0x0eed('0x25')]===_0x8076f6){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x27b373['uniqueid'],_0x27b373['membername'],_0x27b373['destuniqueid']);this['channels'][_0x27b373['uniqueid']][_0x8076f6][_0x0eed('0x3b')]=moment()[_0x0eed('0x35')](_0x0eed('0x28'));this['channels'][_0x27b373['uniqueid']][_0x8076f6][_0x0eed('0x3c')]=_0x27b373['connectedlinename'];this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['connectedlinenum']=_0x27b373[_0x0eed('0x3d')];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x3e')]=_0x27b373[_0x0eed('0x3e')];this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x3f')]=_0x27b373[_0x0eed('0x3f')];this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['holdtime']=_0x27b373['holdtime'];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x40')]=_0x0eed('0x41');if(this[_0x0eed('0xb')][this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x20')]]){var _0x139cc1=this[_0x0eed('0xb')][this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x20')]]['routealias'];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['routealias']=_0x139cc1;_0x27b373[_0x0eed('0x42')]=_0x139cc1;}_[_0x0eed('0x2d')](this['agents'][_0x27b373[_0x0eed('0x24')]],_['pick'](_0x27b373,[_0x0eed('0x27'),_0x0eed('0x43'),_0x0eed('0x42')]));var _0x4ea8a4=this[_0x0eed('0xc')][_0x27b373[_0x0eed('0x44')][_0x0eed('0x45')]('-')[0x0]];var _0x350aec={'id':_0x4ea8a4['id'],'name':_0x4ea8a4[_0x0eed('0x46')],'agentconnected':!![],'destaccountcode':_0x4ea8a4[_0x0eed('0x47')],'destconnectedlinenum':this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x27b373[_0x0eed('0x25')]]['exten'],'queue':this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x27b373[_0x0eed('0x25')]][_0x0eed('0x27')],'routealias':this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x27b373[_0x0eed('0x25')]][_0x0eed('0x42')],'uniqueid':this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x27b373[_0x0eed('0x25')]][_0x0eed('0x20')]};logger[_0x0eed('0x22')](_0x0eed('0x48'),_0x27b373[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x350aec,{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',_0x350aec);logger[_0x0eed('0x22')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x27b373[_0x0eed('0x20')],util['inspect'](_0x350aec,{'showHidden':![],'depth':null}));this[_0x0eed('0x1b')](util[_0x0eed('0x35')](_0x0eed('0x49'),_0x27b373['membername']),'user:agentconnect',_0x350aec);}else if(!this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x4a')]&&!this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x13')]){logger[_0x0eed('0x1e')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x27b373[_0x0eed('0x20')],this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['membername'],_0x8076f6);this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['agentringnoanswer']=!![];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x4b')]=moment()[_0x0eed('0x35')](_0x0eed('0x28'));this[_0x0eed('0x23')][_0x27b373['uniqueid']][_0x8076f6]['answeredelsewheredestinationuniqueid']=_0x27b373[_0x0eed('0x25')];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6][_0x0eed('0x4c')]=_0x27b373[_0x0eed('0x21')];this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['lastevent']='answered_elsewhere';this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6]['reason']=_0x0eed('0x4d');logger[_0x0eed('0x22')](_0x0eed('0x4e'),_0x27b373['uniqueid'],util[_0x0eed('0x31')](this[_0x0eed('0x23')][_0x27b373[_0x0eed('0x20')]][_0x8076f6],{'showHidden':![],'depth':null}));ami[_0x0eed('0x1b')](_0x0eed('0x4f'),this['channels'][_0x27b373[_0x0eed('0x20')]][_0x8076f6]);}}}}}}catch(_0x53940f){logger[_0x0eed('0x37')](_0x0eed('0x50'),_0x27b373[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x53940f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x51')]=function(_0x31d9e6){try{if(this[_0x0eed('0x1c')](_0x31d9e6)){logger[_0x0eed('0x22')](_0x0eed('0x52'),_0x31d9e6[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x31d9e6,{'showHidden':![],'depth':null}));if(this[_0x0eed('0x23')][_0x31d9e6[_0x0eed('0x20')]]&&this[_0x0eed('0x23')][_0x31d9e6[_0x0eed('0x20')]][_0x31d9e6['destuniqueid']]){logger[_0x0eed('0x1e')](_0x0eed('0x53'),_0x31d9e6[_0x0eed('0x20')],_0x31d9e6[_0x0eed('0x21')],_0x31d9e6[_0x0eed('0x25')]);var _0x267068=this[_0x0eed('0xc')][_0x31d9e6['interface']];var _0x5d87d8=this['channels'][_0x31d9e6[_0x0eed('0x20')]][_0x31d9e6[_0x0eed('0x25')]];_0x5d87d8['agentringnoanswer']=!![];_0x5d87d8[_0x0eed('0x4b')]=moment()[_0x0eed('0x35')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d87d8[_0x0eed('0x40')]='rejected';_0x5d87d8[_0x0eed('0x54')]=_0x0eed('0x55');var _0x9e0c0e={'id':_0x267068['id'],'name':_0x267068[_0x0eed('0x46')],'queue':_0x5d87d8['queue'],'uniqueid':_0x5d87d8[_0x0eed('0x20')]};logger[_0x0eed('0x22')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x31d9e6[_0x0eed('0x20')],util['inspect'](_0x9e0c0e,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0eed('0x49'),_0x267068['name']),_0x0eed('0x56'),_0x9e0c0e);ami[_0x0eed('0x1b')]('custom:agentringnoanswer',_0x5d87d8);}}}catch(_0x330436){logger[_0x0eed('0x37')](_0x0eed('0x57'),_0x31d9e6[_0x0eed('0x20')],util['inspect'](_0x330436,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eed('0x58')]=function(_0xacbc11){try{if(this[_0x0eed('0x1c')](_0xacbc11)){logger['debug'](_0x0eed('0x59'),_0xacbc11[_0x0eed('0x20')],util[_0x0eed('0x31')](_0xacbc11,{'showHidden':![],'depth':null}));if(this['channels'][_0xacbc11[_0x0eed('0x20')]]){for(var _0x4ced79 in this['channels'][_0xacbc11['uniqueid']]){if(this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]]['hasOwnProperty'](_0x4ced79)&&!this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79][_0x0eed('0x4a')]&&!this[_0x0eed('0x23')][_0xacbc11['uniqueid']][_0x4ced79][_0x0eed('0x13')]){logger[_0x0eed('0x1e')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xacbc11[_0x0eed('0x20')],this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79]['membername'],_0x4ced79);this[_0x0eed('0x23')][_0xacbc11['uniqueid']][_0x4ced79][_0x0eed('0x4a')]=!![];this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79]['agentringnoanswerAt']=moment()['format'](_0x0eed('0x28'));this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79][_0x0eed('0x40')]='abandoned';this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79][_0x0eed('0x54')]=_0x0eed('0x5a');logger['debug'](_0x0eed('0x5b'),_0xacbc11[_0x0eed('0x20')],util[_0x0eed('0x31')](this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79],{'showHidden':![],'depth':null}));ami['emit']('custom:agentqueuecallerabandon',this[_0x0eed('0x23')][_0xacbc11[_0x0eed('0x20')]][_0x4ced79]);}}}}}catch(_0x873387){logger[_0x0eed('0x37')]('[%s][voiceAgentReport][queuecallerabandon]',_0xacbc11['uniqueid'],util[_0x0eed('0x31')](_0x873387,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eed('0x14')]=function(_0x16dbd6){try{if(this['isNotNull'](_0x16dbd6)){logger[_0x0eed('0x22')](_0x0eed('0x5c'),_0x16dbd6[_0x0eed('0x20')],util['inspect'](_0x16dbd6,{'showHidden':![],'depth':null}));if(this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]]){for(var _0x5cc086 in this[_0x0eed('0x23')][_0x16dbd6['uniqueid']]){if(this['channels'][_0x16dbd6[_0x0eed('0x20')]][_0x0eed('0x3a')](_0x5cc086)){if(this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086][_0x0eed('0x3b')]&&!this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086][_0x0eed('0x13')]){logger['info']('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x16dbd6[_0x0eed('0x20')],this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086][_0x0eed('0x21')],_0x5cc086);this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086][_0x0eed('0x13')]=!![];this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086]['agentcompleteAt']=moment()[_0x0eed('0x35')](_0x0eed('0x28'));this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086][_0x0eed('0x40')]=_0x0eed('0x5d');this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086]['reason']=_0x16dbd6['reason']==_0x0eed('0x5e')?_0x0eed('0x5f'):_0x16dbd6[_0x0eed('0x54')];this['channels'][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086][_0x0eed('0x60')]=_0x16dbd6[_0x0eed('0x60')];if(this[_0x0eed('0x26')][_0x16dbd6[_0x0eed('0x27')]]&&this[_0x0eed('0x26')][_0x16dbd6['queue']][_0x0eed('0x61')]){this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086][_0x0eed('0x62')]=this[_0x0eed('0x26')][_0x16dbd6[_0x0eed('0x27')]][_0x0eed('0x63')];this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086]['agentacw']=!![];}this[_0x0eed('0xc')][_0x16dbd6['interface']]=_[_0x0eed('0x64')](this[_0x0eed('0xc')][_0x16dbd6[_0x0eed('0x24')]],[_0x0eed('0x27'),_0x0eed('0x43')]);logger['debug'](_0x0eed('0x65'),_0x16dbd6[_0x0eed('0x20')],util[_0x0eed('0x31')](this[_0x0eed('0x23')][_0x16dbd6['uniqueid']][_0x5cc086],{'showHidden':![],'depth':null}));ami[_0x0eed('0x1b')](_0x0eed('0x66'),this[_0x0eed('0x23')][_0x16dbd6[_0x0eed('0x20')]][_0x5cc086]);logger[_0x0eed('0x22')](_0x0eed('0x67'),_0x16dbd6['uniqueid'],util[_0x0eed('0x31')]({'id':this['agents'][_0x16dbd6['interface']]['id'],'destaccountcode':_0x16dbd6[_0x0eed('0x68')]},{'showHidden':![],'depth':null}));this[_0x0eed('0x1b')](util[_0x0eed('0x35')]('user:%s',_0x16dbd6['membername']),_0x0eed('0x69'),{'id':this['agents'][_0x16dbd6['interface']]['id'],'destaccountcode':Number(_0x16dbd6[_0x0eed('0x68')])});}}}}}}catch(_0x3a6dbf){logger[_0x0eed('0x37')](_0x0eed('0x6a'),_0x16dbd6[_0x0eed('0x20')],util['inspect'](_0x3a6dbf,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eed('0x6b')]=function(_0x579d1b){try{if(this[_0x0eed('0x1c')](_0x579d1b)){logger[_0x0eed('0x22')](_0x0eed('0x6c'),_0x579d1b[_0x0eed('0x20')],util['inspect'](_0x579d1b,{'showHidden':![],'depth':null}));this['addVariable'](_0x579d1b[_0x0eed('0x20')],_[_0x0eed('0x6d')](_0x579d1b[_0x0eed('0x6e')])[0x0],_0x579d1b[_0x0eed('0x6f')]);if(this[_0x0eed('0x23')][_0x579d1b[_0x0eed('0x20')]]){for(var _0x3a1a00 in this['channels'][_0x579d1b[_0x0eed('0x20')]]){if(this[_0x0eed('0x23')][_0x579d1b[_0x0eed('0x20')]][_0x0eed('0x3a')](_0x3a1a00)){logger['info']('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x579d1b[_0x0eed('0x20')],_0x3a1a00,_[_0x0eed('0x6d')](_0x579d1b[_0x0eed('0x6e')])[0x0],_0x579d1b[_0x0eed('0x6f')]);if(_['isUndefined'](this[_0x0eed('0x23')][_0x579d1b[_0x0eed('0x20')]][_0x3a1a00][_0x0eed('0xd')])){this[_0x0eed('0x23')][_0x579d1b[_0x0eed('0x20')]][_0x3a1a00][_0x0eed('0xd')]={};}this[_0x0eed('0x23')][_0x579d1b[_0x0eed('0x20')]][_0x3a1a00][_0x0eed('0xd')]=this[_0x0eed('0xd')][_0x579d1b['uniqueid']];}}}}}catch(_0x110c9d){logger[_0x0eed('0x37')](_0x0eed('0x70'),_0x579d1b[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x110c9d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x71')]=function(_0x3891cb,_0x14df92,_0x4015f8){var _0x556f58=['rtpaudioqos',_0x0eed('0x72'),_0x0eed('0x73'),'rtpaudioqosjitterbridged',_0x0eed('0x74'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x0eed('0x75'),'sipcallid',_0x0eed('0x76'),'bridgepeer',_0x0eed('0x77'),_0x0eed('0x78'),_0x0eed('0x79'),_0x0eed('0x7a'),_0x0eed('0x7b'),_0x0eed('0x21'),_0x0eed('0x7c'),_0x0eed('0x7d')];if(!_[_0x0eed('0x7e')](_0x14df92)&&!_[_0x0eed('0x7f')](_0x556f58,_0x14df92)){if(_['isUndefined'](this[_0x0eed('0xd')][_0x3891cb])){this[_0x0eed('0xd')][_0x3891cb]={};}this['variables'][_0x3891cb][_0x14df92]=_0x4015f8;}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x17')]=function(_0x7f2c6b){try{if(this[_0x0eed('0x1c')](_0x7f2c6b)){logger[_0x0eed('0x22')](_0x0eed('0x80'),_0x7f2c6b['uniqueid'],util[_0x0eed('0x31')](_0x7f2c6b,{'showHidden':![],'depth':null}));if(this['channels'][_0x7f2c6b[_0x0eed('0x20')]]){for(var _0x5bb026 in this['channels'][_0x7f2c6b[_0x0eed('0x20')]]){if(this['channels'][_0x7f2c6b[_0x0eed('0x20')]][_0x0eed('0x3a')](_0x5bb026)){if(this['channels'][_0x7f2c6b[_0x0eed('0x20')]][_0x5bb026][_0x0eed('0x54')]=='transfer'&&this[_0x0eed('0x23')][_0x7f2c6b['uniqueid']][_0x5bb026][_0x0eed('0x13')]){logger[_0x0eed('0x1e')](_0x0eed('0x81'),_0x7f2c6b[_0x0eed('0x20')],_0x5bb026);this['channels'][_0x7f2c6b[_0x0eed('0x20')]][_0x5bb026][_0x0eed('0x82')]=moment()[_0x0eed('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0eed('0x22')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x7f2c6b['uniqueid'],util[_0x0eed('0x31')](_[_0x0eed('0x83')](this[_0x0eed('0x23')][_0x7f2c6b[_0x0eed('0x20')]]),{'showHidden':![],'depth':null}));ami[_0x0eed('0x1b')]('custom:voiceAgentReport',_['values'](this[_0x0eed('0x23')][_0x7f2c6b[_0x0eed('0x20')]]));delete this[_0x0eed('0x23')][_0x7f2c6b[_0x0eed('0x20')]];}if(this[_0x0eed('0xd')][_0x7f2c6b[_0x0eed('0x20')]]){delete this[_0x0eed('0xd')][_0x7f2c6b[_0x0eed('0x20')]];}}}catch(_0x526011){logger[_0x0eed('0x37')](_0x0eed('0x84'),_0x7f2c6b[_0x0eed('0x20')],util['inspect'](_0x526011,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eed('0x85')]=function(_0x30dd5e){try{if(this[_0x0eed('0x1c')](_0x30dd5e)){logger[_0x0eed('0x22')](_0x0eed('0x86'),_0x30dd5e[_0x0eed('0x20')],util['inspect'](_0x30dd5e,{'showHidden':![],'depth':null}));if(this['channels'][_0x30dd5e[_0x0eed('0x87')]]){for(var _0x2a7963 in this['channels'][_0x30dd5e[_0x0eed('0x87')]]){if(this['channels'][_0x30dd5e[_0x0eed('0x87')]][_0x0eed('0x3a')](_0x2a7963)){if(_0x30dd5e['origtransfereruniqueid']===_0x2a7963){logger[_0x0eed('0x1e')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x30dd5e[_0x0eed('0x20')],this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963][_0x0eed('0x21')],_0x2a7963);var _0x2d14c9=moment();this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963]['agentcomplete']=!![];this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963][_0x0eed('0x82')]=moment()[_0x0eed('0x35')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963][_0x0eed('0x40')]='complete';this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963][_0x0eed('0x54')]='transfer';this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963]['talktime']=_0x2d14c9[_0x0eed('0x88')](this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]][_0x2a7963]['agentconnectAt'],'seconds');}}}}if(this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x89')]]){var _0x1ed1a4=this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x89')]];this['channels'][_0x30dd5e['secondtransfereruniqueid']]=this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]];this[_0x0eed('0x23')][_0x30dd5e[_0x0eed('0x87')]]=_0x1ed1a4;}}}catch(_0x19d1c7){logger['error'](_0x0eed('0x8a'),_0x30dd5e[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x19d1c7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x8b')]=function(_0x491974){try{if(this[_0x0eed('0x1c')](_0x491974)){logger[_0x0eed('0x22')](_0x0eed('0x8c'),_0x491974[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x491974,{'showHidden':![],'depth':null}));if(this[_0x0eed('0x23')][_0x491974['transfereeuniqueid']]){for(var _0x54d004 in this[_0x0eed('0x23')][_0x491974['transfereeuniqueid']]){if(this['channels'][_0x491974['transfereeuniqueid']][_0x0eed('0x3a')](_0x54d004)){if(_0x491974['transfereruniqueid']===_0x54d004){logger['info'](_0x0eed('0x8d'),_0x491974[_0x0eed('0x20')],this[_0x0eed('0x23')][_0x491974[_0x0eed('0x87')]][_0x54d004]['membername'],_0x54d004);var _0x5c3a80=moment();this['channels'][_0x491974[_0x0eed('0x87')]][_0x54d004]['agentcomplete']=!![];this[_0x0eed('0x23')][_0x491974['transfereeuniqueid']][_0x54d004][_0x0eed('0x82')]=_0x5c3a80;this[_0x0eed('0x23')][_0x491974[_0x0eed('0x87')]][_0x54d004][_0x0eed('0x40')]=_0x0eed('0x5d');this[_0x0eed('0x23')][_0x491974[_0x0eed('0x87')]][_0x54d004][_0x0eed('0x54')]=_0x0eed('0x5e');this[_0x0eed('0x23')][_0x491974[_0x0eed('0x87')]][_0x54d004][_0x0eed('0x60')]=_0x5c3a80['diff'](this[_0x0eed('0x23')][_0x491974['transfereeuniqueid']][_0x54d004][_0x0eed('0x3b')],_0x0eed('0x8e'));}}}}}}catch(_0x46e05f){logger['error'](_0x0eed('0x8f'),_0x491974[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x46e05f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eed('0x90')]=function(_0x2526e6){var _0x4caad3='';try{if(this[_0x0eed('0x1c')](_0x2526e6)){logger[_0x0eed('0x22')](_0x0eed('0x91'),_0x2526e6[_0x0eed('0x20')],util['inspect'](_0x2526e6,{'showHidden':![],'depth':null}));if(_0x2526e6['channel']){_0x4caad3=_0x2526e6[_0x0eed('0x44')][_0x0eed('0x92')](0x0,_0x2526e6[_0x0eed('0x44')][_0x0eed('0x93')]('-'));if(this['agents'][_0x4caad3]){logger[_0x0eed('0x1e')](_0x0eed('0x94'),_0x2526e6[_0x0eed('0x20')],_0x4caad3);this[_0x0eed('0xc')][_0x4caad3]['onhold']=!![];}}}}catch(_0x1d821d){logger[_0x0eed('0x37')](_0x0eed('0x95'),_0x2526e6[_0x0eed('0x20')],util[_0x0eed('0x31')](_0x1d821d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eed('0x1a')][_0x0eed('0x96')]=function(_0xb261e3){var _0x57a214='';try{if(this[_0x0eed('0x1c')](_0xb261e3)){logger[_0x0eed('0x22')](_0x0eed('0x97'),_0xb261e3[_0x0eed('0x20')],util[_0x0eed('0x31')](_0xb261e3,{'showHidden':![],'depth':null}));if(_0xb261e3[_0x0eed('0x44')]){_0x57a214=_0xb261e3[_0x0eed('0x44')]['substring'](0x0,_0xb261e3[_0x0eed('0x44')]['lastIndexOf']('-'));if(this['agents'][_0x57a214]){logger[_0x0eed('0x1e')](_0x0eed('0x98'),_0xb261e3[_0x0eed('0x20')],_0x57a214);this['agents'][_0x57a214]['onhold']=![];}}}}catch(_0x255bdd){logger['error'](_0x0eed('0x99'),_0xb261e3[_0x0eed('0x20')],util['inspect'](_0x255bdd,{'showHidden':![],'depth':null}));}};module[_0x0eed('0x9a')]=VoiceAgentReport;
\ No newline at end of file
index 692b19b..e3edd50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcb9=['[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','routeid','origtransfererlinkedid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','isNil','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','channels','agents','coreshowchannel','bind','newexten','syncNewExten','syncNewChannel','newstate','syncNewState','varset','hangup','syncHangup','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','keys','from-sip','channel','split','xcally-motion-preview','connectedlinenum','user:%s','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','destconnectedlinenum','accountcode','[%s][voiceCallReport][newchannel]','OutgoingSpoolFailed','application','toLowerCase','appdata','applicationdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','membername','UserId','routealias','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit'];(function(_0x2ef578,_0x21f202){var _0x3900c4=function(_0x47ad9d){while(--_0x47ad9d){_0x2ef578['push'](_0x2ef578['shift']());}};_0x3900c4(++_0x21f202);}(_0xdcb9,0x1be));var _0x9dcb=function(_0x29e820,_0x4c6f2c){_0x29e820=_0x29e820-0x0;var _0x5ab1cb=_0xdcb9[_0x29e820];return _0x5ab1cb;};'use strict';var _=require(_0x9dcb('0x0'));var moment=require(_0x9dcb('0x1'));var util=require('util');var path=require('path');var Redis=require(_0x9dcb('0x2'));var config=require(_0x9dcb('0x3'));var logger=require(_0x9dcb('0x4'))(_0x9dcb('0x5'));var ami=require(_0x9dcb('0x6'));var Channel=require(_0x9dcb('0x7'));var RpcSetting=require(_0x9dcb('0x8'));var applications=['set',_0x9dcb('0x9'),_0x9dcb('0xa'),_0x9dcb('0xb'),'playback','voicemail'];var dispositions=[_0x9dcb('0xc'),_0x9dcb('0xd'),_0x9dcb('0xd'),'NO\x20ANSWER',_0x9dcb('0xc'),_0x9dcb('0xc'),_0x9dcb('0xe'),_0x9dcb('0xf'),_0x9dcb('0xd'),_0x9dcb('0xd'),_0x9dcb('0xd')];config['redis']=_[_0x9dcb('0x10')](config[_0x9dcb('0x11')],{'host':_0x9dcb('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0xd27cdd){this['channels']=_0xd27cdd[_0x9dcb('0x13')];this[_0x9dcb('0x14')]=_0xd27cdd['agents'];this['blindTransfers']={};ami['on'](_0x9dcb('0x15'),this['syncNewExten'][_0x9dcb('0x16')](this));ami['on'](_0x9dcb('0x17'),this[_0x9dcb('0x18')][_0x9dcb('0x16')](this));ami['on']('newchannel',this[_0x9dcb('0x19')][_0x9dcb('0x16')](this));ami['on'](_0x9dcb('0x1a'),this[_0x9dcb('0x1b')][_0x9dcb('0x16')](this));ami['on'](_0x9dcb('0x1c'),this['syncVarSet']['bind'](this));ami['on'](_0x9dcb('0x1d'),this[_0x9dcb('0x1e')]['bind'](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x9dcb('0x16')](this));ami['on']('attendedtransfer',this[_0x9dcb('0x1f')]['bind'](this));ami['on'](_0x9dcb('0x20'),this['syncBlindTransfer'][_0x9dcb('0x16')](this));ami['on'](_0x9dcb('0x21'),this[_0x9dcb('0x22')]['bind'](this));ami['on']('musiconholdstop',this[_0x9dcb('0x23')][_0x9dcb('0x16')](this));try{logger[_0x9dcb('0x24')](_0x9dcb('0x25'));ami[_0x9dcb('0x26')]();}catch(_0x598597){logger[_0x9dcb('0x27')](_0x9dcb('0x28'),util['inspect'](_0x598597,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x2a')]=function(_0x105518){return _0x105518!==null&&!_[_0x9dcb('0x2b')](_0x105518);};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x2c')]=function(_0x30a777,_0x1c4a97,_0x25c317){io['to'](_0x30a777)[_0x9dcb('0x2c')](_0x1c4a97,_0x25c317);};VoiceCallReport[_0x9dcb('0x29')]['syncNewCallerId']=function(_0x4acbad){try{if(this[_0x9dcb('0x2a')](_0x4acbad)){logger['info'](_0x9dcb('0x2d'),_0x4acbad[_0x9dcb('0x2e')],_0x4acbad['calleridname'],_0x4acbad[_0x9dcb('0x2f')]);logger[_0x9dcb('0x30')](_0x9dcb('0x31'),_0x4acbad[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x4acbad,{'showHidden':![],'depth':null}));if(_0x4acbad[_0x9dcb('0x2e')]===_0x4acbad[_0x9dcb('0x33')]){if(!_[_0x9dcb('0x2b')](this[_0x9dcb('0x13')][_0x4acbad[_0x9dcb('0x2e')]])){_[_0x9dcb('0x34')](this[_0x9dcb('0x13')][_0x4acbad['uniqueid']],_['pick'](_0x4acbad,_[_0x9dcb('0x35')](this[_0x9dcb('0x13')][_0x4acbad['uniqueid']])));}}if(_0x4acbad['context']===_0x9dcb('0x36')){if(this[_0x9dcb('0x14')][_0x4acbad[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]]){if(_0x4acbad['exten']==_0x9dcb('0x39')){this[_0x9dcb('0x14')][_0x4acbad[_0x9dcb('0x37')]['split']('-')[0x0]]['destconnectedlinenum']=_0x4acbad[_0x9dcb('0x3a')];this['emit'](util['format'](_0x9dcb('0x3b'),this[_0x9dcb('0x14')][_0x4acbad[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]][_0x9dcb('0x3c')]),_0x9dcb('0x3d'),{'destaccountcode':this[_0x9dcb('0x14')][_0x4acbad[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4acbad[_0x9dcb('0x3a')]});}}}}}catch(_0x575ad0){logger['error'](_0x9dcb('0x3e'),_0x4acbad[_0x9dcb('0x2e')],util['inspect'](_0x575ad0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x19')]=function(_0x13fc80){try{if(this[_0x9dcb('0x2a')](_0x13fc80)){logger[_0x9dcb('0x30')](_0x9dcb('0x3f'),_0x13fc80[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x13fc80,{'showHidden':![],'depth':null}));if(this['channels'][_0x13fc80[_0x9dcb('0x2e')]]){return;}if(_0x13fc80[_0x9dcb('0x37')]==='OutgoingSpoolFailed'){return;}if(_0x13fc80[_0x9dcb('0x2e')]!==_0x13fc80[_0x9dcb('0x33')]&&!this[_0x9dcb('0x40')][_0x13fc80['linkedid']]){return;}logger[_0x9dcb('0x24')](_0x9dcb('0x41'),_0x13fc80[_0x9dcb('0x2e')],_0x13fc80[_0x9dcb('0x42')],_0x13fc80[_0x9dcb('0x43')]);this['channels'][_0x13fc80[_0x9dcb('0x2e')]]=new Channel();this[_0x9dcb('0x13')][_0x13fc80[_0x9dcb('0x2e')]][_0x9dcb('0x44')]=moment()[_0x9dcb('0x45')](_0x9dcb('0x46'));this[_0x9dcb('0x13')][_0x13fc80[_0x9dcb('0x2e')]][_0x9dcb('0x47')]=dispositions[_['toNumber'](_0x13fc80[_0x9dcb('0x48')])];_[_0x9dcb('0x34')](this['channels'][_0x13fc80[_0x9dcb('0x2e')]],_['pick'](_0x13fc80,_[_0x9dcb('0x35')](this[_0x9dcb('0x13')][_0x13fc80['uniqueid']])));if(_0x13fc80[_0x9dcb('0x42')]===_0x9dcb('0x36')){var _0x4b56f2=this[_0x9dcb('0x14')][_0x13fc80[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]];if(_0x4b56f2&&typeof _0x4b56f2[_0x9dcb('0x49')]==='undefined'){_0x4b56f2['destconnectedlinenum']=_0x13fc80[_0x9dcb('0x43')];logger[_0x9dcb('0x30')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x13fc80[_0x9dcb('0x2e')],util[_0x9dcb('0x32')]({'id':_0x4b56f2['id'],'destaccountcode':_0x4b56f2[_0x9dcb('0x4a')],'destconnectedlinenum':_0x13fc80['exten']},{'showHidden':![],'depth':null}));this[_0x9dcb('0x2c')](util[_0x9dcb('0x45')]('user:%s',_0x4b56f2[_0x9dcb('0x3c')]),_0x9dcb('0x3d'),{'id':_0x4b56f2['id'],'destaccountcode':_0x4b56f2[_0x9dcb('0x4a')],'destconnectedlinenum':_0x13fc80['exten']});}}}}catch(_0xff1b60){logger['error'](_0x9dcb('0x4b'),_0x13fc80[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0xff1b60,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x18')]=function(_0x9ead43){try{if(this[_0x9dcb('0x2a')](_0x9ead43)){logger[_0x9dcb('0x30')]('[%s][voiceCallReport][newexten]\x20event:',_0x9ead43[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x9ead43,{'showHidden':![],'depth':null}));if(_0x9ead43[_0x9dcb('0x37')]===_0x9dcb('0x4c')||_0x9ead43[_0x9dcb('0x43')]==='h')return;if(_0x9ead43['uniqueid']===_0x9ead43[_0x9dcb('0x33')]||this['blindTransfers'][_0x9ead43[_0x9dcb('0x33')]]){_0x9ead43['application']=_0x9ead43[_0x9dcb('0x4d')]?_0x9ead43[_0x9dcb('0x4d')][_0x9dcb('0x4e')]():undefined;_0x9ead43['applicationdata']=_0x9ead43[_0x9dcb('0x4f')]||_0x9ead43[_0x9dcb('0x50')];if(_0x9ead43[_0x9dcb('0x4f')]&&!_0x9ead43['appdata']['startsWith'](_0x9dcb('0x51'))&&_0x9ead43[_0x9dcb('0x4d')]!=='queue'){_0x9ead43[_0x9dcb('0x50')]=_0x9ead43[_0x9dcb('0x50')][_0x9dcb('0x4e')]();}logger[_0x9dcb('0x24')](_0x9dcb('0x52'),_0x9ead43['uniqueid'],_0x9ead43[_0x9dcb('0x4d')],_0x9ead43[_0x9dcb('0x50')]);if(_[_0x9dcb('0x2b')](this['channels'][_0x9ead43[_0x9dcb('0x2e')]])){this['channels'][_0x9ead43['uniqueid']]=new Channel();this['channels'][_0x9ead43[_0x9dcb('0x2e')]]['starttime']=_0x9ead43[_0x9dcb('0x53')]?moment()[_0x9dcb('0x54')](moment[_0x9dcb('0x53')](_0x9ead43['duration'])[_0x9dcb('0x55')](),_0x9dcb('0x55'))[_0x9dcb('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x9dcb('0x45')](_0x9dcb('0x46'));this[_0x9dcb('0x13')][_0x9ead43['uniqueid']][_0x9dcb('0x47')]=_0x9dcb('0xc');}_[_0x9dcb('0x34')](this['channels'][_0x9ead43['uniqueid']],_['pick'](_0x9ead43,_[_0x9dcb('0x35')](this[_0x9dcb('0x13')][_0x9ead43[_0x9dcb('0x2e')]])));if(_[_0x9dcb('0x56')](applications,_0x9ead43[_0x9dcb('0x4d')])){this[_0x9dcb('0x13')][_0x9ead43[_0x9dcb('0x2e')]][_0x9dcb('0x57')]=_0x9ead43[_0x9dcb('0x4d')];this[_0x9dcb('0x13')][_0x9ead43['uniqueid']][_0x9dcb('0x58')]=_0x9ead43[_0x9dcb('0x50')];if(_0x9ead43[_0x9dcb('0x4d')]==='set'&&_[_0x9dcb('0x59')](_0x9ead43[_0x9dcb('0x50')][_0x9dcb('0x4e')](),_0x9dcb('0x5a'))){var _0x2fb0b2=_0x9ead43[_0x9dcb('0x50')][_0x9dcb('0x38')]('=');var _0x926c=_0x2fb0b2[0x0][_0x9dcb('0x4e')]()[_0x9dcb('0x5b')](/cdr\((.*)\)/);if(_0x926c){if(_0x926c[0x1]===_0x9dcb('0x5c')&&!_['isNil'](this['channels'][_0x9ead43['uniqueid']][_0x926c[0x1]]))return;this[_0x9dcb('0x13')][_0x9ead43[_0x9dcb('0x2e')]][_0x926c[0x1]]=_0x2fb0b2[0x1];}}else if(_0x9ead43[_0x9dcb('0x4d')]===_0x9dcb('0x9')){this[_0x9dcb('0x13')][_0x9ead43[_0x9dcb('0x2e')]][_0x9dcb('0x9')]=_0x9ead43[_0x9dcb('0x50')][_0x9dcb('0x38')](',')[0x0];}}}}}catch(_0xabdd6e){logger[_0x9dcb('0x27')](_0x9dcb('0x5d'),_0x9ead43[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0xabdd6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x1b')]=function(_0x35595d){try{if(this[_0x9dcb('0x2a')](_0x35595d)){logger[_0x9dcb('0x24')](_0x9dcb('0x5e'),_0x35595d[_0x9dcb('0x2e')],_0x35595d['linkedid'],_0x35595d[_0x9dcb('0x5f')],_0x35595d[_0x9dcb('0x2f')]);logger[_0x9dcb('0x30')](_0x9dcb('0x60'),_0x35595d['uniqueid'],util['inspect'](_0x35595d,{'showHidden':![],'depth':null}));if(_0x35595d['channelstate']!=='6')return;var _0xc668eb=this[_0x9dcb('0x14')][_0x35595d[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]];if(_0x35595d[_0x9dcb('0x2e')]!==_0x35595d['linkedid']){var _0x27670d=moment();if(this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]]){if(!this[_0x9dcb('0x13')][_0x35595d['linkedid']]['answered']){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x61')]=!![];this['channels'][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x62')]=_0x27670d[_0x9dcb('0x45')](_0x9dcb('0x46'));if(this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x44')]){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x63')]=_0x27670d[_0x9dcb('0x64')](this['channels'][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x44')],'seconds');}}this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x33')]=_0x35595d[_0x9dcb('0x2e')];if(_0x35595d[_0x9dcb('0x2f')]!=='xcally-motion-preview'){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x3a')]=_0x35595d[_0x9dcb('0x2f')];}this['channels'][_0x35595d['linkedid']][_0x9dcb('0x65')]=_0x35595d['calleridname'];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x66')]=_0x35595d[_0x9dcb('0x37')];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x47')]=dispositions[_['toNumber'](_0x35595d[_0x9dcb('0x48')])];if(_0xc668eb){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]]['UserId']=_0xc668eb['id'];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x33')]][_0x9dcb('0x67')]=_0xc668eb[_0x9dcb('0x3c')];}}if(this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]){if(!this['channels'][_0x35595d[_0x9dcb('0x2e')]]['answered']){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]['answered']=!![];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x62')]=_0x27670d[_0x9dcb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x35595d['uniqueid']]['starttime']){this['channels'][_0x35595d['uniqueid']][_0x9dcb('0x63')]=_0x27670d[_0x9dcb('0x64')](this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x44')],_0x9dcb('0x55'));}}if(_0x35595d[_0x9dcb('0x2f')]!==_0x9dcb('0x39')){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x3a')]=_0x35595d['calleridnum'];}this['channels'][_0x35595d['uniqueid']][_0x9dcb('0x65')]=_0x35595d[_0x9dcb('0x5f')];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x66')]=_0x35595d[_0x9dcb('0x37')];this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]['disposition']=dispositions[_['toNumber'](_0x35595d['channelstate'])];}}else{if(this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]){if(_0xc668eb){this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x68')]=_0xc668eb['id'];this['channels'][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x67')]=_0xc668eb['name'];}}}if(_0x35595d[_0x9dcb('0x42')]===_0x9dcb('0x36')){if(_0xc668eb){_0xc668eb[_0x9dcb('0x49')]=_0x35595d[_0x9dcb('0x43')];var _0x1ba567,_0xcd173a;if(this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]){_0x1ba567=this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]]['routealias'];_0xcd173a=this[_0x9dcb('0x13')][_0x35595d[_0x9dcb('0x2e')]][_0x9dcb('0x9')];}else if(this['channels'][_0x35595d[_0x9dcb('0x33')]]){_0x1ba567=this['channels'][_0x35595d['linkedid']][_0x9dcb('0x69')];_0xcd173a=this['channels'][_0x35595d[_0x9dcb('0x33')]]['queue'];}_0xc668eb[_0x9dcb('0x9')]=_0xcd173a;_0xc668eb[_0x9dcb('0x69')]=_0x1ba567;var _0xeaaede={'id':_0xc668eb['id'],'name':_0xc668eb[_0x9dcb('0x3c')],'agentconnected':!![],'destaccountcode':_0xc668eb[_0x9dcb('0x4a')],'destconnectedlinenum':_0x35595d[_0x9dcb('0x43')],'queue':_0xcd173a||undefined,'routealias':_0x1ba567,'uniqueid':_0x35595d[_0x9dcb('0x33')]};logger[_0x9dcb('0x30')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x35595d[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0xeaaede,{'showHidden':![],'depth':null}));this[_0x9dcb('0x2c')](util['format'](_0x9dcb('0x3b'),_0xc668eb[_0x9dcb('0x3c')]),'user:agentconnect',_0xeaaede);}}}}catch(_0x2e33c0){logger[_0x9dcb('0x27')](_0x9dcb('0x6a'),_0x35595d['uniqueid'],util['inspect'](_0x2e33c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')]['syncMixMonitorFilename']=function(_0x205ee,_0xc2eab9){try{if(this['channels'][_0x205ee]){logger[_0x9dcb('0x24')](_0x9dcb('0x6b'),_0x205ee,_0xc2eab9);this[_0x9dcb('0x13')][_0x205ee][_0x9dcb('0x6c')]=!![];if(_['endsWith'](_0xc2eab9,_0x9dcb('0x6d'))){_0xc2eab9=_0xc2eab9[_0x9dcb('0x6e')](_0x9dcb('0x6d'),_0x9dcb('0x6f'));}this[_0x9dcb('0x13')][_0x205ee][_0x9dcb('0x70')]=_0xc2eab9;var _0x404d68=_[_0x9dcb('0x71')](this[_0x9dcb('0x13')][_0x205ee]['monitors'],{'filename':_0xc2eab9});if(_['isNil'](_0x404d68)){this[_0x9dcb('0x13')][_0x205ee][_0x9dcb('0x72')][_0x9dcb('0x73')]({'filename':_0xc2eab9,'createdAt':moment()[_0x9dcb('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x9dcb('0x74')});}}}catch(_0x2edc97){logger['error'](_0x9dcb('0x75'),_0x205ee,util[_0x9dcb('0x32')](_0x2edc97,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x76')]=function(_0x44708b){try{if(this[_0x9dcb('0x2a')](_0x44708b)){logger[_0x9dcb('0x30')](_0x9dcb('0x77'),_0x44708b['uniqueid'],util[_0x9dcb('0x32')](_0x44708b,{'showHidden':![],'depth':null}));if(this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x2e')]]&&_0x44708b[_0x9dcb('0x37')]!=_0x9dcb('0x4c')){if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')])){if(this['isNotNull'](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x79')])){logger[_0x9dcb('0x24')](_0x9dcb('0x7a'),_0x44708b[_0x9dcb('0x2e')],_0x44708b['value']);this[_0x9dcb('0x7b')](_0x44708b['uniqueid'],_0x44708b[_0x9dcb('0x7c')]);}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x7d')])){logger[_0x9dcb('0x24')](_0x9dcb('0x7e'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x2f')]=_0x44708b['value'];}else if(this[_0x9dcb('0x2a')](_0x44708b['variable']['xmd-callerid'])){logger[_0x9dcb('0x24')](_0x9dcb('0x7f'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b['uniqueid']]['callerid']=_0x44708b[_0x9dcb('0x7c')];}else if(this['isNotNull'](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x80')])){logger[_0x9dcb('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this['channels'][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x5c')]=_0x44708b[_0x9dcb('0x7c')];}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x81')])){logger[_0x9dcb('0x24')](_0x9dcb('0x82'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')][_0x9dcb('0x38')](',')[0x0]);this['channels'][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x9')]=_0x44708b[_0x9dcb('0x7c')][_0x9dcb('0x38')](',')[0x0];}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')]['xmd-originatecalleridnum'])){logger[_0x9dcb('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this['channels'][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x83')]=_0x44708b[_0x9dcb('0x7c')];}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x84')])){logger[_0x9dcb('0x24')](_0x9dcb('0x85'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this['channels'][_0x44708b['uniqueid']][_0x9dcb('0x86')]=_0x44708b[_0x9dcb('0x7c')];}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x87')])){logger[_0x9dcb('0x24')](_0x9dcb('0x88'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x89')]=_0x44708b[_0x9dcb('0x7c')];}else if(this['isNotNull'](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x8a')])){logger[_0x9dcb('0x24')](_0x9dcb('0x8b'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x2e')]][_0x9dcb('0x9')]=_0x44708b[_0x9dcb('0x7c')];}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x8c')])){logger[_0x9dcb('0x24')](_0x9dcb('0x8d'),_0x44708b[_0x9dcb('0x2e')],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x2e')]]['sipcalluniqueid']=_0x44708b[_0x9dcb('0x7c')];}}}else if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')]['mixmonitor_filename'])){if(_0x44708b['value']){var _0x56b627=path[_0x9dcb('0x8e')](_0x44708b[_0x9dcb('0x7c')])['name'];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x56b627,_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x7b')](_0x56b627,_0x44708b[_0x9dcb('0x7c')]);}}else if(this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x33')]]){if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')])){if(this[_0x9dcb('0x2a')](_0x44708b[_0x9dcb('0x78')][_0x9dcb('0x8c')])){logger[_0x9dcb('0x24')](_0x9dcb('0x8d'),_0x44708b['linkedid'],_0x44708b[_0x9dcb('0x7c')]);this[_0x9dcb('0x13')][_0x44708b[_0x9dcb('0x33')]][_0x9dcb('0x8f')]=_0x44708b[_0x9dcb('0x7c')];}}}}}catch(_0x15c55e){logger[_0x9dcb('0x27')](_0x9dcb('0x90'),_0x44708b[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x15c55e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x1e')]=function(_0x5cfc8e){try{if(this[_0x9dcb('0x2a')](_0x5cfc8e)){logger[_0x9dcb('0x30')](_0x9dcb('0x91'),_0x5cfc8e['uniqueid'],util['inspect'](_0x5cfc8e,{'showHidden':![],'depth':null}));if(this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]]){if(this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]]){this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]][_0x9dcb('0x2e')]=_0x5cfc8e['uniqueid'];this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]][_0x9dcb('0x61')]=this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x61')];this[_0x9dcb('0x13')][this['blindTransfers'][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]][_0x9dcb('0x62')]=this['channels'][_0x5cfc8e[_0x9dcb('0x2e')]]['answertime'];this['channels'][this['blindTransfers'][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]][_0x9dcb('0x66')]=this['channels'][this['blindTransfers'][_0x5cfc8e['linkedid']][_0x9dcb('0x33')]][_0x9dcb('0x37')];this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]]['linkedid']][_0x9dcb('0x47')]=this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x47')];this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]=this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e['linkedid']][_0x9dcb('0x33')]];delete this['channels'][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x33')]];}else if(this[_0x9dcb('0x13')][this['blindTransfers'][_0x5cfc8e['linkedid']][_0x9dcb('0x2e')]]){this[_0x9dcb('0x13')][this['blindTransfers'][_0x5cfc8e['linkedid']][_0x9dcb('0x2e')]][_0x9dcb('0x2e')]=[this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x2e')]][_0x9dcb('0x33')],this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]]['uniqueid']]['linkedid']=this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e['linkedid']][_0x9dcb('0x2e')]][_0x9dcb('0x2e')]][0x0];this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]]['uniqueid']][_0x9dcb('0x61')]=this[_0x9dcb('0x13')][_0x5cfc8e['uniqueid']]['answered'];this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x2e')]][_0x9dcb('0x62')]=this['channels'][_0x5cfc8e[_0x9dcb('0x2e')]]['answertime'];this['channels'][this[_0x9dcb('0x40')][_0x5cfc8e['linkedid']][_0x9dcb('0x2e')]][_0x9dcb('0x66')]=this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x2e')]][_0x9dcb('0x37')];this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x2e')]]['disposition']=this['channels'][_0x5cfc8e[_0x9dcb('0x2e')]]['disposition'];this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]=this[_0x9dcb('0x13')][this[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x33')]][_0x9dcb('0x2e')]];delete this['channels'][this['blindTransfers'][_0x5cfc8e[_0x9dcb('0x33')]]['uniqueid']];}}if(this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]){logger['info'](_0x9dcb('0x92'),_0x5cfc8e['uniqueid'],_0x5cfc8e[_0x9dcb('0x93')]);var _0x3b3abc=moment();this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x94')]=_0x3b3abc[_0x9dcb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x53')]=_0x3b3abc[_0x9dcb('0x64')](this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x44')],_0x9dcb('0x55'));if(this[_0x9dcb('0x13')][_0x5cfc8e['uniqueid']][_0x9dcb('0x61')]){this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x95')]=_0x3b3abc[_0x9dcb('0x64')](this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]['answertime'],_0x9dcb('0x55'));this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x63')]=this['channels'][_0x5cfc8e['uniqueid']][_0x9dcb('0x53')]-this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x95')];}if(_0x5cfc8e[_0x9dcb('0x42')]===_0x9dcb('0x36')){if(this[_0x9dcb('0x14')][_0x5cfc8e[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]]){this['agents'][_0x5cfc8e[_0x9dcb('0x37')]['split']('-')[0x0]]=_[_0x9dcb('0x96')](this[_0x9dcb('0x14')][_0x5cfc8e[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]],[_0x9dcb('0x49')]);logger[_0x9dcb('0x30')](_0x9dcb('0x97'),_0x5cfc8e[_0x9dcb('0x2e')],util['inspect']({'id':this[_0x9dcb('0x14')][_0x5cfc8e[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9dcb('0x14')][_0x5cfc8e[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]][_0x9dcb('0x4a')]},{'showHidden':![],'depth':null}));this[_0x9dcb('0x2c')](util[_0x9dcb('0x45')](_0x9dcb('0x3b'),this[_0x9dcb('0x14')][_0x5cfc8e['channel'][_0x9dcb('0x38')]('-')[0x0]]['name']),_0x9dcb('0x98'),{'id':this['agents'][_0x5cfc8e[_0x9dcb('0x37')][_0x9dcb('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9dcb('0x14')][_0x5cfc8e['channel']['split']('-')[0x0]][_0x9dcb('0x4a')]});for(var _0x44e2eb=0x0;_0x44e2eb<Object[_0x9dcb('0x35')](this['agents'])[_0x9dcb('0x99')];_0x44e2eb++){var _0x9f3c69=Object[_0x9dcb('0x35')](this['agents'])[_0x44e2eb];var _0x582c1a=this[_0x9dcb('0x14')][_0x9f3c69];if(_0x582c1a['accountcode']===Number(this[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x3a')])){this[_0x9dcb('0x2c')](util[_0x9dcb('0x45')]('user:%s',_0x582c1a[_0x9dcb('0x3c')]),_0x9dcb('0x98'),{'id':_0x582c1a['id'],'destaccountcode':_0x582c1a['accountcode'],'transfer':this['channels'][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x9a')]});break;}}}}var _0x3cd85e=this;Promise[_0x9dcb('0x9b')]()[_0x9dcb('0x9c')](function(){var _0x53dece=_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]];if(typeof _0x53dece[_0x9dcb('0x9a')]==='undefined')return;if(_[_0x9dcb('0x9d')](_0x53dece[_0x9dcb('0x72')]))return;return RpcSetting[_0x9dcb('0x9e')]()['then'](function(_0x110d85){if(!_0x110d85[_0x9dcb('0x9f')])return;return Promise[_0x9dcb('0x9b')]()[_0x9dcb('0x9c')](function(){return ami[_0x9dcb('0xa0')]({'action':'StopMixMonitor','channel':_0x53dece[_0x9dcb('0x37')]})['catch'](function(){});})[_0x9dcb('0x9c')](function(){return ami[_0x9dcb('0xa0')]({'action':_0x9dcb('0xa1'),'channel':_0x53dece['destinationchannel']})[_0x9dcb('0xa2')](function(){})['finally'](function(){var _0x39a842=_0x3cd85e[_0x9dcb('0x14')][_0x53dece[_0x9dcb('0x66')][_0x9dcb('0x38')]('-')[0x0]];if(!_0x39a842)return;io[_0x9dcb('0x2c')](_0x9dcb('0xa3'),{'agentId':_0x39a842['id'],'uniqueid':_0x53dece['uniqueid']});});});});})[_0x9dcb('0x9c')](function(){if(_0x5cfc8e[_0x9dcb('0xa4')]===_0x9dcb('0xa5')){_0x3cd85e['blindTransfers'][_0x5cfc8e[_0x9dcb('0x2e')]]=_0x5cfc8e;}else{if(_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e['uniqueid']]['type']===_0x9dcb('0xa6')&&_0x3cd85e[_0x9dcb('0x40')][_0x5cfc8e[_0x9dcb('0x2e')]]){_0x3cd85e['channels'][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x2e')]=[_0x3cd85e['channels'][_0x5cfc8e[_0x9dcb('0x2e')]][_0x9dcb('0x33')],_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]['linkedid']=_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e['uniqueid']][_0x9dcb('0x2e')]][0x0];delete _0x3cd85e[_0x9dcb('0x40')][_0x5cfc8e['uniqueid']];}}logger['debug'](_0x9dcb('0xa7'),_0x5cfc8e[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]],{'showHidden':![],'depth':null}));ami[_0x9dcb('0x2c')](_0x9dcb('0xa8'),_0x3cd85e[_0x9dcb('0x13')][_0x5cfc8e[_0x9dcb('0x2e')]]);delete _0x3cd85e['channels'][_0x5cfc8e[_0x9dcb('0x2e')]];});}}}catch(_0x3bd5b3){logger[_0x9dcb('0x27')]('[%s][voiceCallReport][hangup]',_0x5cfc8e[_0x9dcb('0x2e')],util['inspect'](_0x3bd5b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')]['syncAttendedTransfer']=function(_0xf92ad5){try{if(this['isNotNull'](_0xf92ad5)){logger[_0x9dcb('0x24')](_0x9dcb('0xa9'),_0xf92ad5[_0x9dcb('0x2e')],_0xf92ad5[_0x9dcb('0xaa')],_0xf92ad5[_0x9dcb('0xab')]);logger[_0x9dcb('0x30')](_0x9dcb('0xac'),_0xf92ad5[_0x9dcb('0x2e')],util['inspect'](_0xf92ad5,{'showHidden':![],'depth':null}));var _0x114d92;if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xad')]]){this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xad')]][_0x9dcb('0xae')]=_0xf92ad5[_0x9dcb('0xaa')];this['channels'][_0xf92ad5[_0x9dcb('0xad')]][_0x9dcb('0xaf')]=_0xf92ad5[_0x9dcb('0xab')];if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]]){_0x114d92=this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]];this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]]=this['channels'][_0xf92ad5['transfereeuniqueid']];this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xad')]]=_0x114d92;}this[_0x9dcb('0x13')][_0xf92ad5['secondtransfereruniqueid']][_0x9dcb('0x9a')]=_0x9dcb('0xb1');}else if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb2')]]){this['channels'][_0xf92ad5['transfertargetuniqueid']][_0x9dcb('0xae')]=_0xf92ad5[_0x9dcb('0xaa')];this[_0x9dcb('0x13')][_0xf92ad5['transfertargetuniqueid']][_0x9dcb('0xaf')]=_0xf92ad5[_0x9dcb('0xab')];if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]]){_0x114d92=this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]];this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]]=this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb2')]];this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb2')]]=_0x114d92;}this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb2')]][_0x9dcb('0x9a')]=_0x9dcb('0xb1');}if((this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]]||this[_0x9dcb('0x13')][_0xf92ad5['origtransfererlinkedid']])&&this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]]){var _0x52713f=_['some']([this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]],this[_0x9dcb('0x13')][_0xf92ad5['origtransfererlinkedid']],this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]]],function(_0x4b98d4){return _0x4b98d4&&_0x4b98d4[_0x9dcb('0x5c')]===_0x9dcb('0xa6')&&_0x4b98d4[_0x9dcb('0xb4')];});if(_0x52713f){if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb3')]])this['channels'][_0xf92ad5[_0x9dcb('0xb3')]][_0x9dcb('0x9a')]=_0x9dcb('0xb1');if(this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb5')]])this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb5')]][_0x9dcb('0x9a')]=_0x9dcb('0xb1');this[_0x9dcb('0x13')][_0xf92ad5[_0x9dcb('0xb0')]][_0x9dcb('0x9a')]=_0x9dcb('0xb1');}}}}catch(_0x4b43fa){logger[_0x9dcb('0x27')]('[%s][voiceCallReport][attendedtransfer]',_0xf92ad5[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x4b43fa,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9dcb('0xb6')]=function(_0x223887){try{if(this['isNotNull'](_0x223887)){logger['info'](_0x9dcb('0xb7'),_0x223887[_0x9dcb('0x2e')],_0x223887[_0x9dcb('0xb8')],_0x223887[_0x9dcb('0xb9')]);logger[_0x9dcb('0x30')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x223887[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x223887,{'showHidden':![],'depth':null}));if(this['channels'][_0x223887[_0x9dcb('0xad')]]){this[_0x9dcb('0x13')][_0x223887[_0x9dcb('0xad')]]['transfercalleridnum']=_0x223887['transfereecalleridnum'];this[_0x9dcb('0x13')][_0x223887[_0x9dcb('0xad')]]['transferconnectedlinenum']=_0x223887[_0x9dcb('0xb9')];this[_0x9dcb('0x13')][_0x223887[_0x9dcb('0xad')]][_0x9dcb('0x9a')]=_0x9dcb('0xba');this[_0x9dcb('0x1e')]({'event':_0x9dcb('0xa5'),'uniqueid':_0x223887['transfereeuniqueid'],'linkedid':_0x223887[_0x9dcb('0xbb')],'context':_0x223887[_0x9dcb('0x42')],'channel':_0x223887[_0x9dcb('0xbc')]});}else{this[_0x9dcb('0x13')][_0x223887[_0x9dcb('0xbb')]]['transferType']=_0x9dcb('0xba');this[_0x9dcb('0x1e')]({'event':_0x9dcb('0xa5'),'uniqueid':_0x223887['transfereruniqueid'],'linkedid':_0x223887[_0x9dcb('0xad')],'context':_0x223887[_0x9dcb('0x42')],'channel':_0x223887[_0x9dcb('0xbc')]});}}}catch(_0x54cea8){logger[_0x9dcb('0x27')]('[%s][voiceCallReport][blindtransfer]',_0x223887[_0x9dcb('0x2e')],util['inspect'](_0x54cea8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x22')]=function(_0x30df29){try{if(this[_0x9dcb('0x2a')](_0x30df29)){logger[_0x9dcb('0x30')](_0x9dcb('0xbd'),_0x30df29[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x30df29,{'showHidden':![],'depth':null}));if(this[_0x9dcb('0x13')][_0x30df29[_0x9dcb('0x2e')]]){if(!_['isNil'](this[_0x9dcb('0x13')][_0x30df29['uniqueid']][_0x9dcb('0x62')])){this[_0x9dcb('0x13')][_0x30df29[_0x9dcb('0x2e')]]['mohstarttime']=moment()[_0x9dcb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9dcb('0x24')](_0x9dcb('0xbe'),_0x30df29['uniqueid'],this[_0x9dcb('0x13')][_0x30df29[_0x9dcb('0x2e')]][_0x9dcb('0xbf')]);}}}}catch(_0x13d166){logger['error'](_0x9dcb('0xc0'),_0x30df29[_0x9dcb('0x2e')],util[_0x9dcb('0x32')](_0x13d166,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9dcb('0x29')][_0x9dcb('0x23')]=function(_0x5cee79){try{if(this[_0x9dcb('0x2a')](_0x5cee79)){logger[_0x9dcb('0x30')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5cee79[_0x9dcb('0x2e')],util['inspect'](_0x5cee79,{'showHidden':![],'depth':null}));if(this[_0x9dcb('0x13')][_0x5cee79[_0x9dcb('0x2e')]]){if(!_[_0x9dcb('0xc1')](this[_0x9dcb('0x13')][_0x5cee79[_0x9dcb('0x2e')]][_0x9dcb('0xbf')])){this[_0x9dcb('0x13')][_0x5cee79[_0x9dcb('0x2e')]][_0x9dcb('0xc2')]+=moment()[_0x9dcb('0xc3')](0x0)[_0x9dcb('0x64')](this[_0x9dcb('0x13')][_0x5cee79[_0x9dcb('0x2e')]]['mohstarttime'],'seconds');logger[_0x9dcb('0x24')](_0x9dcb('0xc4'),_0x5cee79[_0x9dcb('0x2e')],this['channels'][_0x5cee79[_0x9dcb('0x2e')]][_0x9dcb('0xc2')]);delete this[_0x9dcb('0x13')][_0x5cee79[_0x9dcb('0x2e')]][_0x9dcb('0xbf')];}}}}catch(_0x2c314c){logger[_0x9dcb('0x27')](_0x9dcb('0xc5'),_0x5cee79['uniqueid'],util['inspect'](_0x2c314c,{'showHidden':![],'depth':null}));}};module[_0x9dcb('0xc6')]=VoiceCallReport;
\ No newline at end of file
+var _0x03a4=['[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answertime','diff','connectedlinename','destinationchannel','membername','answered','holdtime','UserId','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','[%s][voiceCallReport][mixMonitorFilename]','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','BlindTransfer','outbound','custom:voiceCallReport','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','ioredis','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','dial','playback','NO\x20ANSWER','ANSWERED','BUSY','FAILED','defaults','redis','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','info','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','isNil'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x03a4,0x1e2));var _0x403a=function(_0x241b4b,_0x206d5a){_0x241b4b=_0x241b4b-0x0;var _0x2220d0=_0x03a4[_0x241b4b];return _0x2220d0;};'use strict';var _=require(_0x403a('0x0'));var moment=require(_0x403a('0x1'));var util=require(_0x403a('0x2'));var path=require(_0x403a('0x3'));var Redis=require(_0x403a('0x4'));var config=require('../../../config/environment');var logger=require(_0x403a('0x5'))(_0x403a('0x6'));var ami=require(_0x403a('0x7'));var Channel=require(_0x403a('0x8'));var RpcSetting=require(_0x403a('0x9'));var applications=[_0x403a('0xa'),_0x403a('0xb'),'agi',_0x403a('0xc'),_0x403a('0xd'),'voicemail'];var dispositions=[_0x403a('0xe'),'FAILED','FAILED',_0x403a('0xe'),_0x403a('0xe'),_0x403a('0xe'),_0x403a('0xf'),_0x403a('0x10'),_0x403a('0x11'),_0x403a('0x11'),'FAILED'];config['redis']=_[_0x403a('0x12')](config[_0x403a('0x13')],{'host':_0x403a('0x14'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x403a('0x13')]));function VoiceCallReport(_0x419071){this[_0x403a('0x15')]=_0x419071['channels'];this[_0x403a('0x16')]=_0x419071['agents'];this[_0x403a('0x17')]={};ami['on'](_0x403a('0x18'),this[_0x403a('0x19')][_0x403a('0x1a')](this));ami['on'](_0x403a('0x1b'),this[_0x403a('0x19')]['bind'](this));ami['on']('newchannel',this[_0x403a('0x1c')][_0x403a('0x1a')](this));ami['on'](_0x403a('0x1d'),this[_0x403a('0x1e')][_0x403a('0x1a')](this));ami['on'](_0x403a('0x1f'),this[_0x403a('0x20')][_0x403a('0x1a')](this));ami['on'](_0x403a('0x21'),this[_0x403a('0x22')][_0x403a('0x1a')](this));ami['on']('newcallerid',this[_0x403a('0x23')]['bind'](this));ami['on'](_0x403a('0x24'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x403a('0x25'),this[_0x403a('0x26')][_0x403a('0x1a')](this));ami['on'](_0x403a('0x27'),this[_0x403a('0x28')]['bind'](this));ami['on'](_0x403a('0x29'),this[_0x403a('0x2a')][_0x403a('0x1a')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x403a('0x2b')]();}catch(_0x248730){logger[_0x403a('0x2c')]('[voiceCallReport][coreshowchannels]',util[_0x403a('0x2d')](_0x248730,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x403a('0x2e')][_0x403a('0x2f')]=function(_0x5b7fa2){return _0x5b7fa2!==null&&!_[_0x403a('0x30')](_0x5b7fa2);};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x31')]=function(_0x36d120,_0x2835b3,_0x58cb82){io['to'](_0x36d120)[_0x403a('0x31')](_0x2835b3,_0x58cb82);};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x23')]=function(_0x311674){try{if(this[_0x403a('0x2f')](_0x311674)){logger[_0x403a('0x32')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x311674[_0x403a('0x33')],_0x311674[_0x403a('0x34')],_0x311674['calleridnum']);logger[_0x403a('0x35')](_0x403a('0x36'),_0x311674[_0x403a('0x33')],util['inspect'](_0x311674,{'showHidden':![],'depth':null}));if(_0x311674[_0x403a('0x33')]===_0x311674[_0x403a('0x37')]){if(!_[_0x403a('0x30')](this[_0x403a('0x15')][_0x311674[_0x403a('0x33')]])){_[_0x403a('0x38')](this[_0x403a('0x15')][_0x311674['uniqueid']],_[_0x403a('0x39')](_0x311674,_[_0x403a('0x3a')](this[_0x403a('0x15')][_0x311674[_0x403a('0x33')]])));}}if(_0x311674[_0x403a('0x3b')]==='from-sip'){if(this[_0x403a('0x16')][_0x311674[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]]){if(_0x311674[_0x403a('0x3e')]==_0x403a('0x3f')){this[_0x403a('0x16')][_0x311674[_0x403a('0x3c')]['split']('-')[0x0]][_0x403a('0x40')]=_0x311674[_0x403a('0x41')];this[_0x403a('0x31')](util[_0x403a('0x42')](_0x403a('0x43'),this[_0x403a('0x16')][_0x311674['channel'][_0x403a('0x3d')]('-')[0x0]][_0x403a('0x44')]),_0x403a('0x45'),{'destaccountcode':this['agents'][_0x311674[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]][_0x403a('0x46')],'destconnectedlinenum':_0x311674[_0x403a('0x41')]});}}}}}catch(_0x35d159){logger['error']('[%s][voiceCallReport][newcallerid]',_0x311674[_0x403a('0x33')],util[_0x403a('0x2d')](_0x35d159,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')]['syncNewChannel']=function(_0x28765c){try{if(this[_0x403a('0x2f')](_0x28765c)){logger[_0x403a('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0x28765c[_0x403a('0x33')],util[_0x403a('0x2d')](_0x28765c,{'showHidden':![],'depth':null}));if(this['channels'][_0x28765c[_0x403a('0x33')]]){return;}if(_0x28765c['channel']===_0x403a('0x47')){return;}if(_0x28765c['uniqueid']!==_0x28765c['linkedid']&&!this[_0x403a('0x17')][_0x28765c[_0x403a('0x37')]]){return;}logger[_0x403a('0x32')](_0x403a('0x48'),_0x28765c[_0x403a('0x33')],_0x28765c[_0x403a('0x3b')],_0x28765c[_0x403a('0x3e')]);this['channels'][_0x28765c[_0x403a('0x33')]]=new Channel();this[_0x403a('0x15')][_0x28765c[_0x403a('0x33')]][_0x403a('0x49')]=moment()[_0x403a('0x42')](_0x403a('0x4a'));this[_0x403a('0x15')][_0x28765c['uniqueid']][_0x403a('0x4b')]=dispositions[_[_0x403a('0x4c')](_0x28765c[_0x403a('0x4d')])];_[_0x403a('0x38')](this[_0x403a('0x15')][_0x28765c[_0x403a('0x33')]],_[_0x403a('0x39')](_0x28765c,_[_0x403a('0x3a')](this[_0x403a('0x15')][_0x28765c['uniqueid']])));if(_0x28765c[_0x403a('0x3b')]===_0x403a('0x4e')){var _0x923c9d=this[_0x403a('0x16')][_0x28765c[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]];if(_0x923c9d&&typeof _0x923c9d['destconnectedlinenum']==='undefined'){_0x923c9d[_0x403a('0x40')]=_0x28765c[_0x403a('0x3e')];logger[_0x403a('0x35')](_0x403a('0x4f'),_0x28765c[_0x403a('0x33')],util[_0x403a('0x2d')]({'id':_0x923c9d['id'],'destaccountcode':_0x923c9d[_0x403a('0x46')],'destconnectedlinenum':_0x28765c[_0x403a('0x3e')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x403a('0x43'),_0x923c9d[_0x403a('0x44')]),_0x403a('0x45'),{'id':_0x923c9d['id'],'destaccountcode':_0x923c9d[_0x403a('0x46')],'destconnectedlinenum':_0x28765c[_0x403a('0x3e')]});}}}}catch(_0x4ba158){logger[_0x403a('0x2c')](_0x403a('0x50'),_0x28765c[_0x403a('0x33')],util['inspect'](_0x4ba158,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x19')]=function(_0x20b630){try{if(this['isNotNull'](_0x20b630)){logger['debug'](_0x403a('0x51'),_0x20b630[_0x403a('0x33')],util['inspect'](_0x20b630,{'showHidden':![],'depth':null}));if(_0x20b630[_0x403a('0x3c')]==='OutgoingSpoolFailed'||_0x20b630['exten']==='h')return;if(_0x20b630[_0x403a('0x33')]===_0x20b630['linkedid']||this[_0x403a('0x17')][_0x20b630['linkedid']]){_0x20b630[_0x403a('0x52')]=_0x20b630['application']?_0x20b630[_0x403a('0x52')][_0x403a('0x53')]():undefined;_0x20b630[_0x403a('0x54')]=_0x20b630['appdata']||_0x20b630[_0x403a('0x54')];if(_0x20b630['appdata']&&!_0x20b630[_0x403a('0x55')][_0x403a('0x56')](_0x403a('0x57'))&&_0x20b630[_0x403a('0x52')]!==_0x403a('0xb')){_0x20b630[_0x403a('0x54')]=_0x20b630[_0x403a('0x54')][_0x403a('0x53')]();}logger['info']('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x20b630[_0x403a('0x33')],_0x20b630[_0x403a('0x52')],_0x20b630['applicationdata']);if(_[_0x403a('0x30')](this['channels'][_0x20b630[_0x403a('0x33')]])){this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]]=new Channel();this['channels'][_0x20b630[_0x403a('0x33')]]['starttime']=_0x20b630[_0x403a('0x58')]?moment()[_0x403a('0x59')](moment['duration'](_0x20b630['duration'])[_0x403a('0x5a')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x403a('0x4a'));this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]][_0x403a('0x4b')]=_0x403a('0xe');}_[_0x403a('0x38')](this[_0x403a('0x15')][_0x20b630['uniqueid']],_[_0x403a('0x39')](_0x20b630,_[_0x403a('0x3a')](this['channels'][_0x20b630[_0x403a('0x33')]])));if(_[_0x403a('0x5b')](applications,_0x20b630['application'])){this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]][_0x403a('0x5c')]=_0x20b630['application'];this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]][_0x403a('0x5d')]=_0x20b630[_0x403a('0x54')];if(_0x20b630[_0x403a('0x52')]===_0x403a('0xa')&&_[_0x403a('0x56')](_0x20b630['applicationdata']['toLowerCase'](),_0x403a('0x5e'))){var _0x331c96=_0x20b630[_0x403a('0x54')]['split']('=');var _0x4b368d=_0x331c96[0x0][_0x403a('0x53')]()[_0x403a('0x5f')](/cdr\((.*)\)/);if(_0x4b368d){if(_0x4b368d[0x1]==='type'&&!_[_0x403a('0x60')](this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]][_0x4b368d[0x1]]))return;this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]][_0x4b368d[0x1]]=_0x331c96[0x1];}}else if(_0x20b630[_0x403a('0x52')]===_0x403a('0xb')){this[_0x403a('0x15')][_0x20b630[_0x403a('0x33')]]['queue']=_0x20b630[_0x403a('0x54')][_0x403a('0x3d')](',')[0x0];}}}}}catch(_0x2f5568){logger[_0x403a('0x2c')]('[%s][voiceCallReport][newexten]',_0x20b630[_0x403a('0x33')],util['inspect'](_0x2f5568,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x1e')]=function(_0x96ccc6){try{if(this[_0x403a('0x2f')](_0x96ccc6)){logger[_0x403a('0x32')](_0x403a('0x61'),_0x96ccc6[_0x403a('0x33')],_0x96ccc6[_0x403a('0x37')],_0x96ccc6[_0x403a('0x34')],_0x96ccc6[_0x403a('0x62')]);logger['debug'](_0x403a('0x63'),_0x96ccc6['uniqueid'],util[_0x403a('0x2d')](_0x96ccc6,{'showHidden':![],'depth':null}));if(_0x96ccc6[_0x403a('0x4d')]!=='6')return;var _0x346b75=this[_0x403a('0x16')][_0x96ccc6[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]];if(_0x96ccc6['uniqueid']!==_0x96ccc6[_0x403a('0x37')]){var _0x15e7ba=moment();if(this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]]){if(!this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]]['answered']){this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]]['answered']=!![];this['channels'][_0x96ccc6['linkedid']][_0x403a('0x64')]=_0x15e7ba[_0x403a('0x42')](_0x403a('0x4a'));if(this[_0x403a('0x15')][_0x96ccc6['linkedid']][_0x403a('0x49')]){this[_0x403a('0x15')][_0x96ccc6['linkedid']]['holdtime']=_0x15e7ba[_0x403a('0x65')](this['channels'][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x49')],_0x403a('0x5a'));}}this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]]['linkedid']=_0x96ccc6[_0x403a('0x33')];if(_0x96ccc6[_0x403a('0x62')]!=='xcally-motion-preview'){this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x41')]=_0x96ccc6['calleridnum'];}this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x66')]=_0x96ccc6['calleridname'];this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x67')]=_0x96ccc6[_0x403a('0x3c')];this['channels'][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x4b')]=dispositions[_['toNumber'](_0x96ccc6[_0x403a('0x4d')])];if(_0x346b75){this[_0x403a('0x15')][_0x96ccc6['linkedid']]['UserId']=_0x346b75['id'];this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x68')]=_0x346b75[_0x403a('0x44')];}}if(this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]]){if(!this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x69')]){this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x69')]=!![];this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x64')]=_0x15e7ba['format'](_0x403a('0x4a'));if(this[_0x403a('0x15')][_0x96ccc6['uniqueid']][_0x403a('0x49')]){this['channels'][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x6a')]=_0x15e7ba[_0x403a('0x65')](this['channels'][_0x96ccc6[_0x403a('0x33')]]['starttime'],_0x403a('0x5a'));}}if(_0x96ccc6['calleridnum']!=='xcally-motion-preview'){this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x41')]=_0x96ccc6['calleridnum'];}this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x66')]=_0x96ccc6[_0x403a('0x34')];this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x67')]=_0x96ccc6[_0x403a('0x3c')];this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x4b')]=dispositions[_[_0x403a('0x4c')](_0x96ccc6['channelstate'])];}}else{if(this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]]){if(_0x346b75){this['channels'][_0x96ccc6[_0x403a('0x33')]][_0x403a('0x6b')]=_0x346b75['id'];this[_0x403a('0x15')][_0x96ccc6['uniqueid']][_0x403a('0x68')]=_0x346b75[_0x403a('0x44')];}}}if(_0x96ccc6[_0x403a('0x3b')]==='from-sip'){if(_0x346b75){_0x346b75[_0x403a('0x40')]=_0x96ccc6['exten'];var _0x38aa78,_0x4183b4;if(this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x33')]]){_0x38aa78=this[_0x403a('0x15')][_0x96ccc6['uniqueid']]['routealias'];_0x4183b4=this[_0x403a('0x15')][_0x96ccc6['uniqueid']][_0x403a('0xb')];}else if(this[_0x403a('0x15')][_0x96ccc6[_0x403a('0x37')]]){_0x38aa78=this['channels'][_0x96ccc6[_0x403a('0x37')]][_0x403a('0x6c')];_0x4183b4=this['channels'][_0x96ccc6[_0x403a('0x37')]][_0x403a('0xb')];}_0x346b75[_0x403a('0xb')]=_0x4183b4;_0x346b75[_0x403a('0x6c')]=_0x38aa78;var _0x38b165={'id':_0x346b75['id'],'name':_0x346b75['name'],'agentconnected':!![],'destaccountcode':_0x346b75[_0x403a('0x46')],'destconnectedlinenum':_0x96ccc6[_0x403a('0x3e')],'queue':_0x4183b4||undefined,'routealias':_0x38aa78,'uniqueid':_0x96ccc6[_0x403a('0x37')]};logger[_0x403a('0x35')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x96ccc6[_0x403a('0x33')],util[_0x403a('0x2d')](_0x38b165,{'showHidden':![],'depth':null}));this[_0x403a('0x31')](util[_0x403a('0x42')](_0x403a('0x43'),_0x346b75['name']),_0x403a('0x45'),_0x38b165);}}}}catch(_0x112c09){logger[_0x403a('0x2c')](_0x403a('0x6d'),_0x96ccc6[_0x403a('0x33')],util['inspect'](_0x112c09,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x6e')]=function(_0x139efc,_0x38a98d){try{if(this[_0x403a('0x15')][_0x139efc]){logger[_0x403a('0x32')](_0x403a('0x6f'),_0x139efc,_0x38a98d);this[_0x403a('0x15')][_0x139efc][_0x403a('0x70')]=!![];if(_[_0x403a('0x71')](_0x38a98d,_0x403a('0x72'))){_0x38a98d=_0x38a98d[_0x403a('0x73')](_0x403a('0x72'),_0x403a('0x74'));}this['channels'][_0x139efc][_0x403a('0x75')]=_0x38a98d;var _0x4946af=_[_0x403a('0x76')](this['channels'][_0x139efc]['monitors'],{'filename':_0x38a98d});if(_[_0x403a('0x60')](_0x4946af)){this['channels'][_0x139efc][_0x403a('0x77')]['push']({'filename':_0x38a98d,'createdAt':moment()['format'](_0x403a('0x4a')),'mixmonitorid':'','status':'rec'});}}}catch(_0x481467){logger[_0x403a('0x2c')](_0x403a('0x78'),_0x139efc,util[_0x403a('0x2d')](_0x481467,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x403a('0x20')]=function(_0x58d7fa){try{if(this[_0x403a('0x2f')](_0x58d7fa)){logger[_0x403a('0x35')]('[%s][voiceCallReport][varset]\x20event:',_0x58d7fa[_0x403a('0x33')],util[_0x403a('0x2d')](_0x58d7fa,{'showHidden':![],'depth':null}));if(this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]]&&_0x58d7fa[_0x403a('0x3c')]!=_0x403a('0x47')){if(this['isNotNull'](_0x58d7fa[_0x403a('0x79')])){if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')]['mixmonitor_filename'])){logger[_0x403a('0x32')](_0x403a('0x7a'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x6e')](_0x58d7fa['uniqueid'],_0x58d7fa['value']);}else if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')]['xmd-phone'])){logger[_0x403a('0x32')](_0x403a('0x7c'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]][_0x403a('0x62')]=_0x58d7fa[_0x403a('0x7b')];}else if(this[_0x403a('0x2f')](_0x58d7fa['variable'][_0x403a('0x7d')])){logger[_0x403a('0x32')](_0x403a('0x7e'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa['value']);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]][_0x403a('0x7f')]=_0x58d7fa[_0x403a('0x7b')];}else if(this['isNotNull'](_0x58d7fa['variable'][_0x403a('0x80')])){logger[_0x403a('0x32')](_0x403a('0x81'),_0x58d7fa['uniqueid'],_0x58d7fa['value']);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]][_0x403a('0x82')]=_0x58d7fa[_0x403a('0x7b')];}else if(this[_0x403a('0x2f')](_0x58d7fa['variable']['xmd-queue'])){logger[_0x403a('0x32')](_0x403a('0x83'),_0x58d7fa['uniqueid'],_0x58d7fa[_0x403a('0x7b')][_0x403a('0x3d')](',')[0x0]);this['channels'][_0x58d7fa[_0x403a('0x33')]][_0x403a('0xb')]=_0x58d7fa[_0x403a('0x7b')][_0x403a('0x3d')](',')[0x0];}else if(this[_0x403a('0x2f')](_0x58d7fa['variable']['xmd-originatecalleridnum'])){logger[_0x403a('0x32')](_0x403a('0x84'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]][_0x403a('0x85')]=_0x58d7fa[_0x403a('0x7b')];}else if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')][_0x403a('0x86')])){logger[_0x403a('0x32')](_0x403a('0x87'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa['uniqueid']][_0x403a('0x88')]=_0x58d7fa['value'];}else if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')][_0x403a('0x89')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]]['calleridpreview']=_0x58d7fa[_0x403a('0x7b')];}else if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')]['xmcs-queue'])){logger[_0x403a('0x32')](_0x403a('0x8a'),_0x58d7fa['uniqueid'],_0x58d7fa[_0x403a('0x7b')]);this['channels'][_0x58d7fa[_0x403a('0x33')]][_0x403a('0xb')]=_0x58d7fa[_0x403a('0x7b')];}else if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')]['sipcallid'])){logger[_0x403a('0x32')](_0x403a('0x8b'),_0x58d7fa[_0x403a('0x33')],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x33')]][_0x403a('0x8c')]=_0x58d7fa[_0x403a('0x7b')];}}}else if(this[_0x403a('0x2f')](_0x58d7fa['variable'][_0x403a('0x8d')])){if(_0x58d7fa['value']){var _0x49a7bc=path[_0x403a('0x8e')](_0x58d7fa[_0x403a('0x7b')])[_0x403a('0x44')];logger[_0x403a('0x32')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x49a7bc,_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x6e')](_0x49a7bc,_0x58d7fa['value']);}}else if(this[_0x403a('0x15')][_0x58d7fa['linkedid']]){if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')])){if(this[_0x403a('0x2f')](_0x58d7fa[_0x403a('0x79')]['sipcallid'])){logger['info'](_0x403a('0x8b'),_0x58d7fa['linkedid'],_0x58d7fa[_0x403a('0x7b')]);this[_0x403a('0x15')][_0x58d7fa[_0x403a('0x37')]][_0x403a('0x8f')]=_0x58d7fa['value'];}}}}}catch(_0x3ff760){logger[_0x403a('0x2c')](_0x403a('0x90'),_0x58d7fa[_0x403a('0x33')],util[_0x403a('0x2d')](_0x3ff760,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')]['syncHangup']=function(_0x189bd4){try{if(this[_0x403a('0x2f')](_0x189bd4)){logger[_0x403a('0x35')]('[%s][voiceCallReport][hangup]\x20event:',_0x189bd4[_0x403a('0x33')],util[_0x403a('0x2d')](_0x189bd4,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x189bd4[_0x403a('0x37')]]){if(this['channels'][this[_0x403a('0x17')][_0x189bd4['linkedid']][_0x403a('0x37')]]){this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]]['linkedid']][_0x403a('0x33')]=_0x189bd4[_0x403a('0x33')];this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4['linkedid']]['linkedid']]['answered']=this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]]['answered'];this[_0x403a('0x15')][this['blindTransfers'][_0x189bd4[_0x403a('0x37')]]['linkedid']][_0x403a('0x64')]=this['channels'][_0x189bd4[_0x403a('0x33')]]['answertime'];this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4['linkedid']][_0x403a('0x37')]][_0x403a('0x67')]=this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x37')]][_0x403a('0x3c')];this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x37')]]['disposition']=this['channels'][_0x189bd4[_0x403a('0x33')]][_0x403a('0x4b')];this[_0x403a('0x15')][_0x189bd4['uniqueid']]=this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x37')]];delete this['channels'][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x37')]];}else if(this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4['linkedid']][_0x403a('0x33')]]){this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]][_0x403a('0x33')]=[this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]]['linkedid'],this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]]['linkedid']=this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]]['uniqueid']][_0x403a('0x33')]][0x0];this['channels'][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]]['uniqueid']][_0x403a('0x69')]=this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x69')];this['channels'][this['blindTransfers'][_0x189bd4[_0x403a('0x37')]]['uniqueid']]['answertime']=this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x64')];this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]]['destinationchannel']=this['channels'][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]]['uniqueid']][_0x403a('0x3c')];this['channels'][this['blindTransfers'][_0x189bd4[_0x403a('0x37')]]['uniqueid']][_0x403a('0x4b')]=this[_0x403a('0x15')][_0x189bd4['uniqueid']][_0x403a('0x4b')];this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]]=this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]];delete this[_0x403a('0x15')][this[_0x403a('0x17')][_0x189bd4[_0x403a('0x37')]][_0x403a('0x33')]];}}if(this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]]){logger[_0x403a('0x32')](_0x403a('0x91'),_0x189bd4[_0x403a('0x33')],_0x189bd4[_0x403a('0x92')]);var _0x1c9db8=moment();this['channels'][_0x189bd4['uniqueid']]['endtime']=_0x1c9db8['format'](_0x403a('0x4a'));this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]]['duration']=_0x1c9db8['diff'](this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x49')],_0x403a('0x5a'));if(this['channels'][_0x189bd4[_0x403a('0x33')]]['answered']){this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]]['billableseconds']=_0x1c9db8['diff'](this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x64')],_0x403a('0x5a'));this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x6a')]=this['channels'][_0x189bd4['uniqueid']]['duration']-this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x93')];}if(_0x189bd4[_0x403a('0x3b')]==='from-sip'){if(this['agents'][_0x189bd4[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]]){this[_0x403a('0x16')][_0x189bd4[_0x403a('0x3c')]['split']('-')[0x0]]=_['omit'](this['agents'][_0x189bd4[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]],[_0x403a('0x40')]);logger[_0x403a('0x35')](_0x403a('0x94'),_0x189bd4[_0x403a('0x33')],util[_0x403a('0x2d')]({'id':this[_0x403a('0x16')][_0x189bd4[_0x403a('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x403a('0x16')][_0x189bd4[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x403a('0x31')](util['format'](_0x403a('0x43'),this[_0x403a('0x16')][_0x189bd4[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]]['name']),_0x403a('0x95'),{'id':this['agents'][_0x189bd4[_0x403a('0x3c')][_0x403a('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x403a('0x16')][_0x189bd4[_0x403a('0x3c')]['split']('-')[0x0]][_0x403a('0x46')]});for(var _0x231c8c=0x0;_0x231c8c<Object[_0x403a('0x3a')](this['agents'])[_0x403a('0x96')];_0x231c8c++){var _0xf4966c=Object['keys'](this[_0x403a('0x16')])[_0x231c8c];var _0x2168f0=this[_0x403a('0x16')][_0xf4966c];if(_0x2168f0['accountcode']===Number(this['channels'][_0x189bd4['uniqueid']][_0x403a('0x41')])){this[_0x403a('0x31')](util[_0x403a('0x42')](_0x403a('0x43'),_0x2168f0[_0x403a('0x44')]),_0x403a('0x95'),{'id':_0x2168f0['id'],'destaccountcode':_0x2168f0[_0x403a('0x46')],'transfer':this[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x97')]});break;}}}}var _0x503d73=this;Promise[_0x403a('0x98')]()[_0x403a('0x99')](function(){var _0x5cf24a=_0x503d73[_0x403a('0x15')][_0x189bd4['uniqueid']];if(typeof _0x5cf24a[_0x403a('0x97')]===_0x403a('0x9a'))return;if(_[_0x403a('0x9b')](_0x5cf24a[_0x403a('0x77')]))return;return RpcSetting[_0x403a('0x9c')]()['then'](function(_0x1f1920){if(!_0x1f1920[_0x403a('0x9d')])return;return Promise[_0x403a('0x98')]()[_0x403a('0x99')](function(){return ami[_0x403a('0x9e')]({'action':_0x403a('0x9f'),'channel':_0x5cf24a[_0x403a('0x3c')]})[_0x403a('0xa0')](function(){});})[_0x403a('0x99')](function(){return ami[_0x403a('0x9e')]({'action':_0x403a('0x9f'),'channel':_0x5cf24a['destinationchannel']})[_0x403a('0xa0')](function(){})[_0x403a('0xa1')](function(){var _0x51ba12=_0x503d73[_0x403a('0x16')][_0x5cf24a[_0x403a('0x67')][_0x403a('0x3d')]('-')[0x0]];if(!_0x51ba12)return;io[_0x403a('0x31')]('webbar:stopmonitors',{'agentId':_0x51ba12['id'],'uniqueid':_0x5cf24a[_0x403a('0x33')]});});});});})['then'](function(){if(_0x189bd4['event']===_0x403a('0xa2')){_0x503d73[_0x403a('0x17')][_0x189bd4[_0x403a('0x33')]]=_0x189bd4;}else{if(_0x503d73[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]][_0x403a('0x82')]===_0x403a('0xa3')&&_0x503d73['blindTransfers'][_0x189bd4['uniqueid']]){_0x503d73['channels'][_0x189bd4[_0x403a('0x33')]][_0x403a('0x33')]=[_0x503d73[_0x403a('0x15')][_0x189bd4['uniqueid']]['linkedid'],_0x503d73[_0x403a('0x15')][_0x189bd4['uniqueid']]['linkedid']=_0x503d73[_0x403a('0x15')][_0x189bd4['uniqueid']][_0x403a('0x33')]][0x0];delete _0x503d73[_0x403a('0x17')][_0x189bd4['uniqueid']];}}logger[_0x403a('0x35')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x189bd4['uniqueid'],util['inspect'](_0x503d73[_0x403a('0x15')][_0x189bd4[_0x403a('0x33')]],{'showHidden':![],'depth':null}));ami['emit'](_0x403a('0xa4'),_0x503d73[_0x403a('0x15')][_0x189bd4['uniqueid']]);delete _0x503d73['channels'][_0x189bd4[_0x403a('0x33')]];});}}}catch(_0xd98548){logger[_0x403a('0x2c')]('[%s][voiceCallReport][hangup]',_0x189bd4[_0x403a('0x33')],util[_0x403a('0x2d')](_0xd98548,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0xa5')]=function(_0x26ebf2){try{if(this[_0x403a('0x2f')](_0x26ebf2)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x26ebf2[_0x403a('0x33')],_0x26ebf2[_0x403a('0xa6')],_0x26ebf2[_0x403a('0xa7')]);logger[_0x403a('0x35')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x26ebf2[_0x403a('0x33')],util[_0x403a('0x2d')](_0x26ebf2,{'showHidden':![],'depth':null}));var _0x21a26c;if(this['channels'][_0x26ebf2[_0x403a('0xa8')]]){this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xa8')]][_0x403a('0xa9')]=_0x26ebf2[_0x403a('0xa6')];this['channels'][_0x26ebf2[_0x403a('0xa8')]][_0x403a('0xaa')]=_0x26ebf2['transfertargetcalleridnum'];if(this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xab')]]){_0x21a26c=this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xab')]];this['channels'][_0x26ebf2[_0x403a('0xab')]]=this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xa8')]];this['channels'][_0x26ebf2[_0x403a('0xa8')]]=_0x21a26c;}this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xab')]][_0x403a('0x97')]=_0x403a('0xac');}else if(this['channels'][_0x26ebf2['transfertargetuniqueid']]){this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xad')]][_0x403a('0xa9')]=_0x26ebf2['origtransferercalleridnum'];this[_0x403a('0x15')][_0x26ebf2['transfertargetuniqueid']][_0x403a('0xaa')]=_0x26ebf2[_0x403a('0xa7')];if(this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xae')]]){_0x21a26c=this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xae')]];this['channels'][_0x26ebf2['origtransfereruniqueid']]=this['channels'][_0x26ebf2['transfertargetuniqueid']];this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xad')]]=_0x21a26c;}this[_0x403a('0x15')][_0x26ebf2['transfertargetuniqueid']][_0x403a('0x97')]=_0x403a('0xac');}if((this[_0x403a('0x15')][_0x26ebf2['origtransfereruniqueid']]||this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xaf')]])&&this['channels'][_0x26ebf2[_0x403a('0xab')]]){var _0x55115e=_[_0x403a('0xb0')]([this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xae')]],this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xaf')]],this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xab')]]],function(_0x382054){return _0x382054&&_0x382054[_0x403a('0x82')]===_0x403a('0xa3')&&_0x382054[_0x403a('0xb1')];});if(_0x55115e){if(this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xae')]])this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xae')]]['transferType']=_0x403a('0xac');if(this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xaf')]])this[_0x403a('0x15')][_0x26ebf2[_0x403a('0xaf')]]['transferType']=_0x403a('0xac');this['channels'][_0x26ebf2[_0x403a('0xab')]][_0x403a('0x97')]='ATTENDED';}}}}catch(_0x4b5293){logger[_0x403a('0x2c')](_0x403a('0xb2'),_0x26ebf2[_0x403a('0x33')],util[_0x403a('0x2d')](_0x4b5293,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')]['syncBlindTransfer']=function(_0x2a1dc2){try{if(this['isNotNull'](_0x2a1dc2)){logger[_0x403a('0x32')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2a1dc2[_0x403a('0x33')],_0x2a1dc2[_0x403a('0xb3')],_0x2a1dc2[_0x403a('0xb4')]);logger[_0x403a('0x35')](_0x403a('0xb5'),_0x2a1dc2[_0x403a('0x33')],util[_0x403a('0x2d')](_0x2a1dc2,{'showHidden':![],'depth':null}));if(this['channels'][_0x2a1dc2[_0x403a('0xa8')]]){this['channels'][_0x2a1dc2['transfereeuniqueid']][_0x403a('0xa9')]=_0x2a1dc2[_0x403a('0xb3')];this[_0x403a('0x15')][_0x2a1dc2[_0x403a('0xa8')]][_0x403a('0xaa')]=_0x2a1dc2['extension'];this['channels'][_0x2a1dc2[_0x403a('0xa8')]][_0x403a('0x97')]='BLIND';this[_0x403a('0x22')]({'event':_0x403a('0xa2'),'uniqueid':_0x2a1dc2['transfereeuniqueid'],'linkedid':_0x2a1dc2[_0x403a('0xb6')],'context':_0x2a1dc2['context'],'channel':_0x2a1dc2[_0x403a('0xb7')]});}else{this['channels'][_0x2a1dc2[_0x403a('0xb6')]][_0x403a('0x97')]=_0x403a('0xb8');this[_0x403a('0x22')]({'event':'BlindTransfer','uniqueid':_0x2a1dc2['transfereruniqueid'],'linkedid':_0x2a1dc2[_0x403a('0xa8')],'context':_0x2a1dc2[_0x403a('0x3b')],'channel':_0x2a1dc2[_0x403a('0xb7')]});}}}catch(_0x2903e4){logger[_0x403a('0x2c')](_0x403a('0xb9'),_0x2a1dc2[_0x403a('0x33')],util[_0x403a('0x2d')](_0x2903e4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x28')]=function(_0x26cd58){try{if(this[_0x403a('0x2f')](_0x26cd58)){logger[_0x403a('0x35')](_0x403a('0xba'),_0x26cd58[_0x403a('0x33')],util[_0x403a('0x2d')](_0x26cd58,{'showHidden':![],'depth':null}));if(this[_0x403a('0x15')][_0x26cd58[_0x403a('0x33')]]){if(!_['isNil'](this['channels'][_0x26cd58[_0x403a('0x33')]]['answertime'])){this[_0x403a('0x15')][_0x26cd58[_0x403a('0x33')]][_0x403a('0xbb')]=moment()[_0x403a('0x42')](_0x403a('0x4a'));logger[_0x403a('0x32')](_0x403a('0xbc'),_0x26cd58[_0x403a('0x33')],this[_0x403a('0x15')][_0x26cd58[_0x403a('0x33')]][_0x403a('0xbb')]);}}}}catch(_0x507e26){logger['error'](_0x403a('0xbd'),_0x26cd58[_0x403a('0x33')],util['inspect'](_0x507e26,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x403a('0x2e')][_0x403a('0x2a')]=function(_0x469ed4){try{if(this[_0x403a('0x2f')](_0x469ed4)){logger['debug'](_0x403a('0xbe'),_0x469ed4[_0x403a('0x33')],util[_0x403a('0x2d')](_0x469ed4,{'showHidden':![],'depth':null}));if(this['channels'][_0x469ed4[_0x403a('0x33')]]){if(!_[_0x403a('0x60')](this['channels'][_0x469ed4[_0x403a('0x33')]][_0x403a('0xbb')])){this[_0x403a('0x15')][_0x469ed4[_0x403a('0x33')]]['mohtime']+=moment()['milliseconds'](0x0)['diff'](this[_0x403a('0x15')][_0x469ed4[_0x403a('0x33')]][_0x403a('0xbb')],_0x403a('0x5a'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x469ed4[_0x403a('0x33')],this[_0x403a('0x15')][_0x469ed4[_0x403a('0x33')]][_0x403a('0xbf')]);delete this[_0x403a('0x15')][_0x469ed4['uniqueid']][_0x403a('0xbb')];}}}}catch(_0x54b6c7){logger['error'](_0x403a('0xc0'),_0x469ed4[_0x403a('0x33')],util[_0x403a('0x2d')](_0x54b6c7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 98ce102..439b0d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['syncDialEnd','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','lastevent','total','answered','billableseconds','holdtime','sumBillable','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','syncNewExten','toLowerCase','set','applicationdata','appdata','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','bind','dialend'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x305528,_0x263ca6){_0x305528=_0x305528-0x0;var _0x2531f0=_0x3f8a[_0x305528];return _0x2531f0;};'use strict';var _=require(_0xa3f8('0x0'));var moment=require(_0xa3f8('0x1'));var util=require(_0xa3f8('0x2'));var Redis=require(_0xa3f8('0x3'));var config=require('../../../config/environment');var logger=require(_0xa3f8('0x4'))(_0xa3f8('0x5'));var ami=require(_0xa3f8('0x6'));config[_0xa3f8('0x7')]=_[_0xa3f8('0x8')](config[_0xa3f8('0x7')],{'host':_0xa3f8('0x9'),'port':0x18eb});var io=require(_0xa3f8('0xa'))(new Redis(config[_0xa3f8('0x7')]));function VoiceDialReport(_0xf895d9){this[_0xa3f8('0xb')]=_0xf895d9[_0xa3f8('0xc')];this[_0xa3f8('0xd')]=_0xf895d9[_0xa3f8('0xd')];this[_0xa3f8('0xe')]={};this[_0xa3f8('0xf')]={};ami['on'](_0xa3f8('0x10'),this['syncDialBegin'][_0xa3f8('0x11')](this));ami['on'](_0xa3f8('0x12'),this[_0xa3f8('0x13')][_0xa3f8('0x11')](this));ami['on']('varset',this[_0xa3f8('0x14')][_0xa3f8('0x11')](this));ami['on'](_0xa3f8('0x15'),this[_0xa3f8('0x16')][_0xa3f8('0x11')](this));}VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x18')]=function(_0x63de8b){return _0x63de8b!==null&&!_[_0xa3f8('0x19')](_0x63de8b);};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x1a')]=function(_0x2c5e15,_0x5b2c33,_0x2d8f74){io['to'](_0x2c5e15)[_0xa3f8('0x1a')](_0x5b2c33,_0x2d8f74);};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x1b')]=function(_0x5caebf){try{if(this[_0xa3f8('0x18')](_0x5caebf)){logger[_0xa3f8('0x1c')](_0xa3f8('0x1d'),_0x5caebf[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x5caebf,{'showHidden':![],'depth':null}));if(this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]]){_[_0xa3f8('0x20')](this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]],{'starttime':moment()['format'](_0xa3f8('0x21')),'lastevent':'called','interface':_0x5caebf[_0xa3f8('0x22')][_0xa3f8('0x23')](0x0,_0x5caebf[_0xa3f8('0x22')][_0xa3f8('0x24')]('-')),'membername':_0x5caebf['channel'][_0xa3f8('0x23')](_0x5caebf['channel'][_0xa3f8('0x24')]('/')+0x1,_0x5caebf['channel'][_0xa3f8('0x24')]('-'))},_[_0xa3f8('0x25')](_0x5caebf,[_0xa3f8('0x26'),_0xa3f8('0x27')]));logger[_0xa3f8('0x28')](_0xa3f8('0x29'),_0x5caebf[_0xa3f8('0x1e')],this['channels'][_0x5caebf[_0xa3f8('0x1e')]]['membername'],this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]][_0xa3f8('0x2a')]);logger[_0xa3f8('0x1c')](_0xa3f8('0x2b'),_0x5caebf[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));if(this[_0xa3f8('0xe')][_0x5caebf['uniqueid']])_[_0xa3f8('0x20')](this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]],this['applications'][_0x5caebf[_0xa3f8('0x1e')]]);this['emit'](_0xa3f8('0x2c'),_0xa3f8('0x2d'),this[_0xa3f8('0xb')][_0x5caebf['uniqueid']]);logger[_0xa3f8('0x1c')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x5caebf[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xa3f8('0x1a')](_0xa3f8('0x2e'),this[_0xa3f8('0xb')][_0x5caebf[_0xa3f8('0x1e')]]);}}}catch(_0x25f9f5){logger[_0xa3f8('0x2f')](_0xa3f8('0x30'),_0x5caebf['uniqueid'],util[_0xa3f8('0x1f')](_0x25f9f5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x13')]=function(_0x1954f5){try{if(this[_0xa3f8('0x18')](_0x1954f5)){logger['debug'](_0xa3f8('0x31'),_0x1954f5[_0xa3f8('0x1e')],util['inspect'](_0x1954f5,{'showHidden':![],'depth':null}));if(this[_0xa3f8('0xb')][_0x1954f5[_0xa3f8('0x1e')]]){this['channels'][_0x1954f5[_0xa3f8('0x1e')]]['dialstatus']=_0x1954f5['dialstatus'];if(_0x1954f5[_0xa3f8('0x32')]===_0xa3f8('0x33')){this['channels'][_0x1954f5[_0xa3f8('0x1e')]]['connectedlinenum']=_0x1954f5[_0xa3f8('0x34')];this[_0xa3f8('0xb')][_0x1954f5[_0xa3f8('0x1e')]][_0xa3f8('0x35')]=_0x1954f5['connectedlinename'];this[_0xa3f8('0xb')][_0x1954f5['uniqueid']][_0xa3f8('0x36')]=moment()['format'](_0xa3f8('0x21'));this['channels'][_0x1954f5['uniqueid']]['lastevent']=_0xa3f8('0x37');logger[_0xa3f8('0x28')](_0xa3f8('0x38'),_0x1954f5[_0xa3f8('0x1e')],_0x1954f5['channel'][_0xa3f8('0x23')](_0x1954f5[_0xa3f8('0x22')][_0xa3f8('0x24')]('/')+0x1,_0x1954f5[_0xa3f8('0x22')][_0xa3f8('0x24')]('-')));logger[_0xa3f8('0x1c')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x1954f5[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x1954f5['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xa3f8('0x1a')](_0xa3f8('0x39'),this['channels'][_0x1954f5[_0xa3f8('0x1e')]]);}logger['debug'](_0xa3f8('0x3a'),_0x1954f5['uniqueid'],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x1954f5[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));this[_0xa3f8('0x1a')](_0xa3f8('0x2c'),'voice_outbound_channel:save',this[_0xa3f8('0xb')][_0x1954f5[_0xa3f8('0x1e')]]);}}}catch(_0x4db9c5){logger[_0xa3f8('0x2f')]('[%s][voiceDialReport][dialend]',_0x1954f5[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x4db9c5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x14')]=function(_0x357712){try{if(this['isNotNull'](_0x357712)){logger[_0xa3f8('0x1c')](_0xa3f8('0x3b'),_0x357712[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x357712,{'showHidden':![],'depth':null}));this[_0xa3f8('0x3c')](_0x357712['uniqueid'],_[_0xa3f8('0x3d')](_0x357712[_0xa3f8('0x3e')])[0x0],_0x357712[_0xa3f8('0x3f')]);if(this[_0xa3f8('0x18')](_0x357712[_0xa3f8('0x3e')])&&this[_0xa3f8('0x18')](_0x357712[_0xa3f8('0x3e')][_0xa3f8('0x40')])){if(_[_0xa3f8('0x19')](this[_0xa3f8('0xb')][_0x357712[_0xa3f8('0x1e')]])){this[_0xa3f8('0xb')][_0x357712[_0xa3f8('0x1e')]]={'routeId':_0x357712['value'],'variables':this['variables'][_0x357712['uniqueid']],'motionChannel':_0xa3f8('0x41')};logger[_0xa3f8('0x28')](_0xa3f8('0x42'),_0x357712[_0xa3f8('0x1e')],_0x357712[_0xa3f8('0x3e')][_0xa3f8('0x40')],_['keys'](_0x357712[_0xa3f8('0x3e')])[0x0],_0x357712[_0xa3f8('0x3f')]);logger[_0xa3f8('0x1c')](_0xa3f8('0x43'),_0x357712['uniqueid'],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x357712[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:save',this[_0xa3f8('0xb')][_0x357712[_0xa3f8('0x1e')]]);}}}}catch(_0x5a2a7c){logger[_0xa3f8('0x2f')](_0xa3f8('0x44'),_0x357712[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x5a2a7c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x3c')]=function(_0x375ffd,_0x37fa3d,_0xbfef86){var _0xe1f66d=[_0xa3f8('0x45'),_0xa3f8('0x46'),_0xa3f8('0x47'),_0xa3f8('0x48'),_0xa3f8('0x49'),_0xa3f8('0x4a'),_0xa3f8('0x4b'),'rtpaudioqosrttbridged','sipcallid',_0xa3f8('0x4c'),_0xa3f8('0x4d'),'bridgepvtcallid',_0xa3f8('0x4e'),_0xa3f8('0x4f'),_0xa3f8('0x50'),_0xa3f8('0x51'),_0xa3f8('0x52'),_0xa3f8('0x53'),_0xa3f8('0x54')];if(!_[_0xa3f8('0x55')](_0x37fa3d)&&!_[_0xa3f8('0x56')](_0xe1f66d,_0x37fa3d)){if(_[_0xa3f8('0x19')](this[_0xa3f8('0xf')][_0x375ffd])){this[_0xa3f8('0xf')][_0x375ffd]={};}this[_0xa3f8('0xf')][_0x375ffd][_0x37fa3d]=_0xbfef86;}};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x16')]=function(_0x3169d3){try{if(this['isNotNull'](_0x3169d3)){logger['debug'](_0xa3f8('0x57'),_0x3169d3['uniqueid'],util[_0xa3f8('0x1f')](_0x3169d3,{'showHidden':![],'depth':null}));if(this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]){logger['info'](_0xa3f8('0x58'),_0x3169d3[_0xa3f8('0x1e')],_0x3169d3[_0xa3f8('0x59')]);this[_0xa3f8('0xb')][_0x3169d3['uniqueid']][_0xa3f8('0x5a')]=moment()['format'](_0xa3f8('0x21'));this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]['duration']=moment(this['channels'][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x5a')])[_0xa3f8('0x5b')](this[_0xa3f8('0xb')][_0x3169d3['uniqueid']][_0xa3f8('0x5c')],_0xa3f8('0x5d'));this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x5e')]='complete';this['outbound'][_0xa3f8('0x5f')]+=0x1;if(this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x36')]){this[_0xa3f8('0xd')][_0xa3f8('0x60')]+=0x1;this[_0xa3f8('0xb')][_0x3169d3['uniqueid']]['holdtime']=moment(this['channels'][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x36')])[_0xa3f8('0x5b')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x5c')],_0xa3f8('0x5d'));this[_0xa3f8('0xb')][_0x3169d3['uniqueid']][_0xa3f8('0x61')]=moment(this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x5a')])[_0xa3f8('0x5b')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]['answertime'],_0xa3f8('0x5d'));this[_0xa3f8('0xd')]['sumHoldTime']+=this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x62')]||0x0;this[_0xa3f8('0xd')][_0xa3f8('0x63')]+=this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]['billableseconds'];}this['outbound'][_0xa3f8('0x64')]+=this['channels'][_0x3169d3[_0xa3f8('0x1e')]][_0xa3f8('0x65')];logger[_0xa3f8('0x1c')](_0xa3f8('0x66'),_0x3169d3[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xa3f8('0x1a')](_0xa3f8('0x67'),this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]);logger[_0xa3f8('0x1c')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x3169d3[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xa3f8('0x1a')](_0xa3f8('0x68'),this['channels'][_0x3169d3[_0xa3f8('0x1e')]]);logger[_0xa3f8('0x1c')](_0xa3f8('0x69'),_0x3169d3[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));this[_0xa3f8('0x1a')](_0xa3f8('0x2c'),_0xa3f8('0x6a'),this[_0xa3f8('0xd')]);logger['info'](_0xa3f8('0x6b'),JSON[_0xa3f8('0x6c')](this['channels'][_0x3169d3['uniqueid']]));logger[_0xa3f8('0x1c')](_0xa3f8('0x6d'),_0x3169d3[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]],{'showHidden':![],'depth':null}));this[_0xa3f8('0x1a')](_0xa3f8('0x2c'),'voice_outbound_channel:remove',this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x1e')]]);delete this[_0xa3f8('0xb')][_0x3169d3['uniqueid']];}else if(this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x6e')]]){this['channels'][_0x3169d3[_0xa3f8('0x6e')]][_0xa3f8('0x1e')]=this[_0xa3f8('0xb')][_0x3169d3[_0xa3f8('0x6e')]][_0xa3f8('0x6f')];}if(this[_0xa3f8('0xf')][_0x3169d3[_0xa3f8('0x1e')]]){delete this[_0xa3f8('0xf')][_0x3169d3[_0xa3f8('0x1e')]];}}}catch(_0x55087e){logger[_0xa3f8('0x2f')]('[%s][voiceDialReport][hangup]',_0x3169d3[_0xa3f8('0x1e')],util['inspect'](_0x55087e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa3f8('0x17')][_0xa3f8('0x70')]=function(_0x407986){try{if(this[_0xa3f8('0x18')](_0x407986)){logger[_0xa3f8('0x1c')]('[%s][voiceDialReport][newexten]\x20event:',_0x407986[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x407986,{'showHidden':![],'depth':null}));if(_0x407986['application'][_0xa3f8('0x71')]()===_0xa3f8('0x72')){_0x407986[_0xa3f8('0x73')]=(_0x407986[_0xa3f8('0x74')]||_0x407986[_0xa3f8('0x73')])[_0xa3f8('0x71')]();if(_['startsWith'](_0x407986[_0xa3f8('0x73')],_0xa3f8('0x75'))){if(_[_0xa3f8('0x19')](this['applications'][_0x407986[_0xa3f8('0x1e')]]))this['applications'][_0x407986[_0xa3f8('0x1e')]]={};logger['info']('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x407986[_0xa3f8('0x1e')],_0x407986['application'],_0x407986[_0xa3f8('0x73')]);var _0x5f174a=_0x407986[_0xa3f8('0x73')][_0xa3f8('0x76')]('=');var _0x279131=_0x5f174a[0x0][_0xa3f8('0x77')](/cdr\((.*)\)/);if(_0x279131)this['applications'][_0x407986[_0xa3f8('0x1e')]][_0x279131[0x1]]=_0x5f174a[0x1];}}}}catch(_0x35db48){logger['error'](_0xa3f8('0x78'),_0x407986[_0xa3f8('0x1e')],util[_0xa3f8('0x1f')](_0x35db48,{'showHidden':![],'depth':null}));}};module[_0xa3f8('0x79')]=VoiceDialReport;
\ No newline at end of file
+var _0xae24=['[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','variables','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','sumHoldTime','holdtime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','startsWith','split','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','outbound','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0xae24,0x182));var _0x4ae2=function(_0x36634c,_0x121033){_0x36634c=_0x36634c-0x0;var _0x5bb350=_0xae24[_0x36634c];return _0x5bb350;};'use strict';var _=require(_0x4ae2('0x0'));var moment=require('moment');var util=require(_0x4ae2('0x1'));var Redis=require('ioredis');var config=require(_0x4ae2('0x2'));var logger=require(_0x4ae2('0x3'))('ami');var ami=require('../ami');config[_0x4ae2('0x4')]=_['defaults'](config[_0x4ae2('0x4')],{'host':_0x4ae2('0x5'),'port':0x18eb});var io=require(_0x4ae2('0x6'))(new Redis(config[_0x4ae2('0x4')]));function VoiceDialReport(_0x428054){this[_0x4ae2('0x7')]=_0x428054['outboundChannels'];this['outbound']=_0x428054[_0x4ae2('0x8')];this['applications']={};this['variables']={};ami['on'](_0x4ae2('0x9'),this[_0x4ae2('0xa')]['bind'](this));ami['on'](_0x4ae2('0xb'),this[_0x4ae2('0xc')][_0x4ae2('0xd')](this));ami['on'](_0x4ae2('0xe'),this['syncVarSet'][_0x4ae2('0xd')](this));ami['on'](_0x4ae2('0xf'),this[_0x4ae2('0x10')]['bind'](this));}VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x12')]=function(_0x30d6c4){return _0x30d6c4!==null&&!_[_0x4ae2('0x13')](_0x30d6c4);};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x14')]=function(_0x145287,_0x3cabc9,_0xd527a0){io['to'](_0x145287)['emit'](_0x3cabc9,_0xd527a0);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x2f3936){try{if(this[_0x4ae2('0x12')](_0x2f3936)){logger['debug'](_0x4ae2('0x15'),_0x2f3936[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x2f3936,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]){_[_0x4ae2('0x18')](this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]],{'starttime':moment()[_0x4ae2('0x19')](_0x4ae2('0x1a')),'lastevent':'called','interface':_0x2f3936['channel'][_0x4ae2('0x1b')](0x0,_0x2f3936[_0x4ae2('0x1c')]['lastIndexOf']('-')),'membername':_0x2f3936[_0x4ae2('0x1c')][_0x4ae2('0x1b')](_0x2f3936[_0x4ae2('0x1c')][_0x4ae2('0x1d')]('/')+0x1,_0x2f3936[_0x4ae2('0x1c')]['lastIndexOf']('-'))},_[_0x4ae2('0x1e')](_0x2f3936,['event','privilege']));logger[_0x4ae2('0x1f')](_0x4ae2('0x20'),_0x2f3936[_0x4ae2('0x16')],this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]['membername'],this[_0x4ae2('0x7')][_0x2f3936['uniqueid']][_0x4ae2('0x21')]);logger[_0x4ae2('0x22')](_0x4ae2('0x23'),_0x2f3936['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x24')][_0x2f3936[_0x4ae2('0x16')]])_[_0x4ae2('0x18')](this['channels'][_0x2f3936['uniqueid']],this[_0x4ae2('0x24')][_0x2f3936[_0x4ae2('0x16')]]);this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x26'),this[_0x4ae2('0x7')][_0x2f3936['uniqueid']]);logger['debug'](_0x4ae2('0x27'),_0x2f3936['uniqueid'],util['inspect'](this['channels'][_0x2f3936[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')]('custom:dialbegin',this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]);}}}catch(_0x3d56ea){logger[_0x4ae2('0x28')](_0x4ae2('0x29'),_0x2f3936[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x3d56ea,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0xc')]=function(_0x3542df){try{if(this[_0x4ae2('0x12')](_0x3542df)){logger[_0x4ae2('0x22')](_0x4ae2('0x2a'),_0x3542df[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x3542df,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]]){this['channels'][_0x3542df[_0x4ae2('0x16')]]['dialstatus']=_0x3542df[_0x4ae2('0x2b')];if(_0x3542df[_0x4ae2('0x2b')]==='ANSWER'){this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2c')]=_0x3542df[_0x4ae2('0x2c')];this['channels'][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2d')]=_0x3542df[_0x4ae2('0x2d')];this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2e')]=moment()[_0x4ae2('0x19')](_0x4ae2('0x1a'));this[_0x4ae2('0x7')][_0x3542df['uniqueid']][_0x4ae2('0x2f')]='connect';logger[_0x4ae2('0x1f')](_0x4ae2('0x30'),_0x3542df[_0x4ae2('0x16')],_0x3542df[_0x4ae2('0x1c')][_0x4ae2('0x1b')](_0x3542df[_0x4ae2('0x1c')]['lastIndexOf']('/')+0x1,_0x3542df[_0x4ae2('0x1c')][_0x4ae2('0x1d')]('-')));logger[_0x4ae2('0x22')](_0x4ae2('0x31'),_0x3542df['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')](_0x4ae2('0x32'),this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]]);}logger[_0x4ae2('0x22')](_0x4ae2('0x33'),_0x3542df[_0x4ae2('0x16')],util[_0x4ae2('0x17')](this['channels'][_0x3542df[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x26'),this['channels'][_0x3542df['uniqueid']]);}}}catch(_0xd46eed){logger[_0x4ae2('0x28')](_0x4ae2('0x34'),_0x3542df[_0x4ae2('0x16')],util['inspect'](_0xd46eed,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x35')]=function(_0x5ca188){try{if(this[_0x4ae2('0x12')](_0x5ca188)){logger[_0x4ae2('0x22')](_0x4ae2('0x36'),_0x5ca188['uniqueid'],util[_0x4ae2('0x17')](_0x5ca188,{'showHidden':![],'depth':null}));this[_0x4ae2('0x37')](_0x5ca188[_0x4ae2('0x16')],_[_0x4ae2('0x38')](_0x5ca188[_0x4ae2('0x39')])[0x0],_0x5ca188[_0x4ae2('0x3a')]);if(this[_0x4ae2('0x12')](_0x5ca188[_0x4ae2('0x39')])&&this['isNotNull'](_0x5ca188[_0x4ae2('0x39')][_0x4ae2('0x3b')])){if(_['isUndefined'](this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]])){this['channels'][_0x5ca188[_0x4ae2('0x16')]]={'routeId':_0x5ca188[_0x4ae2('0x3a')],'variables':this['variables'][_0x5ca188[_0x4ae2('0x16')]],'motionChannel':_0x4ae2('0x3c')};logger[_0x4ae2('0x1f')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x5ca188['uniqueid'],_0x5ca188[_0x4ae2('0x39')][_0x4ae2('0x3b')],_[_0x4ae2('0x38')](_0x5ca188[_0x4ae2('0x39')])[0x0],_0x5ca188['value']);logger[_0x4ae2('0x22')](_0x4ae2('0x3d'),_0x5ca188[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')]('voice:outbound',_0x4ae2('0x26'),this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]]);}}}}catch(_0x39d365){logger[_0x4ae2('0x28')](_0x4ae2('0x3e'),_0x5ca188[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x39d365,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x37')]=function(_0x48afbb,_0x3db48e,_0x4a70c6){var _0x10db30=[_0x4ae2('0x3f'),_0x4ae2('0x40'),_0x4ae2('0x41'),_0x4ae2('0x42'),_0x4ae2('0x43'),'rtpaudioqoslossbridged',_0x4ae2('0x44'),_0x4ae2('0x45'),'sipcallid',_0x4ae2('0x46'),_0x4ae2('0x47'),'bridgepvtcallid',_0x4ae2('0x48'),'memberdynamic',_0x4ae2('0x49'),'memberlastcall',_0x4ae2('0x4a'),_0x4ae2('0x4b'),_0x4ae2('0x4c')];if(!_[_0x4ae2('0x4d')](_0x3db48e)&&!_[_0x4ae2('0x4e')](_0x10db30,_0x3db48e)){if(_[_0x4ae2('0x13')](this[_0x4ae2('0x4f')][_0x48afbb])){this[_0x4ae2('0x4f')][_0x48afbb]={};}this[_0x4ae2('0x4f')][_0x48afbb][_0x3db48e]=_0x4a70c6;}};VoiceDialReport['prototype'][_0x4ae2('0x10')]=function(_0x4284b4){try{if(this[_0x4ae2('0x12')](_0x4284b4)){logger[_0x4ae2('0x22')]('[%s][voiceDialReport][hangup]\x20event:',_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x4284b4,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]){logger['info'](_0x4ae2('0x50'),_0x4284b4[_0x4ae2('0x16')],_0x4284b4[_0x4ae2('0x51')]);this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x52')]=moment()[_0x4ae2('0x19')](_0x4ae2('0x1a'));this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x53')]=moment(this['channels'][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x52')])[_0x4ae2('0x54')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x55')],_0x4ae2('0x56'));this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]['lastevent']=_0x4ae2('0x57');this[_0x4ae2('0x8')][_0x4ae2('0x58')]+=0x1;if(this['channels'][_0x4284b4['uniqueid']][_0x4ae2('0x2e')]){this[_0x4ae2('0x8')][_0x4ae2('0x59')]+=0x1;this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]['holdtime']=moment(this['channels'][_0x4284b4['uniqueid']][_0x4ae2('0x2e')])['diff'](this['channels'][_0x4284b4[_0x4ae2('0x16')]]['starttime'],_0x4ae2('0x56'));this['channels'][_0x4284b4[_0x4ae2('0x16')]]['billableseconds']=moment(this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x52')])[_0x4ae2('0x54')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x2e')],'seconds');this['outbound'][_0x4ae2('0x5a')]+=this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x5b')]||0x0;this[_0x4ae2('0x8')]['sumBillable']+=this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]['billableseconds'];}this['outbound'][_0x4ae2('0x5c')]+=this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x53')];logger[_0x4ae2('0x22')](_0x4ae2('0x5d'),_0x4284b4[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4ae2('0x5e'),this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x4284b4[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x4284b4['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')]('custom:dialend',this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]);logger[_0x4ae2('0x22')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x4284b4['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x5f'),this[_0x4ae2('0x8')]);logger[_0x4ae2('0x1f')](_0x4ae2('0x60'),JSON[_0x4ae2('0x61')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]));logger['debug'](_0x4ae2('0x62'),_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x4284b4['uniqueid']],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')]('voice:outbound',_0x4ae2('0x63'),this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]);delete this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]];}else if(this[_0x4ae2('0x7')][_0x4284b4['linkedid']]){this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x64')]][_0x4ae2('0x16')]=this['channels'][_0x4284b4[_0x4ae2('0x64')]][_0x4ae2('0x65')];}if(this[_0x4ae2('0x4f')][_0x4284b4['uniqueid']]){delete this[_0x4ae2('0x4f')][_0x4284b4[_0x4ae2('0x16')]];}}}catch(_0x209f6c){logger['error'](_0x4ae2('0x66'),_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x209f6c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')]['syncNewExten']=function(_0x390c71){try{if(this[_0x4ae2('0x12')](_0x390c71)){logger[_0x4ae2('0x22')](_0x4ae2('0x67'),_0x390c71[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x390c71,{'showHidden':![],'depth':null}));if(_0x390c71[_0x4ae2('0x68')]['toLowerCase']()==='set'){_0x390c71[_0x4ae2('0x69')]=(_0x390c71[_0x4ae2('0x6a')]||_0x390c71[_0x4ae2('0x69')])[_0x4ae2('0x6b')]();if(_[_0x4ae2('0x6c')](_0x390c71[_0x4ae2('0x69')],'cdr(')){if(_[_0x4ae2('0x13')](this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]]))this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]]={};logger[_0x4ae2('0x1f')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x390c71[_0x4ae2('0x16')],_0x390c71[_0x4ae2('0x68')],_0x390c71[_0x4ae2('0x69')]);var _0x3a84d7=_0x390c71[_0x4ae2('0x69')][_0x4ae2('0x6d')]('=');var _0x5efbe9=_0x3a84d7[0x0]['match'](/cdr\((.*)\)/);if(_0x5efbe9)this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]][_0x5efbe9[0x1]]=_0x3a84d7[0x1];}}}}catch(_0x517ecb){logger[_0x4ae2('0x28')](_0x4ae2('0x6e'),_0x390c71[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x517ecb,{'showHidden':![],'depth':null}));}};module[_0x4ae2('0x6f')]=VoiceDialReport;
\ No newline at end of file
index 9e54524..c2dc9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','queueChannels','voiceQueues','campaigns','summary','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueMember','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','queueStatusComplete','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','uniqueid','ATTENDEDTRANSFER','queue','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','queuestatus','actionid','[voiceQueueReport][queuesummary]','summaryEvent','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','YYYY-MM-DD\x20HH:mm:ss','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','linkedid','FORWARDTRANSFER','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','keys','variable','value','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','memberdynamic','memberinterface','memberrealtime','includes','unmanaged','abandoned','sumHoldTime','diff','seconds','length','sumDuration','queuecallerjoinAt','total','answered','sumBillable','milliseconds','custom:queuecallerunmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','transfereeuniqueid','secondtransfereruniqueid','transfertype','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','secondtransfererexten','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/voiceQueueSummary','defaults'];(function(_0x596c6f,_0x5ba0f0){var _0x3292b0=function(_0x5ac421){while(--_0x5ac421){_0x596c6f['push'](_0x596c6f['shift']());}};_0x3292b0(++_0x5ba0f0);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x44633b,_0x2e6db8){_0x44633b=_0x44633b-0x0;var _0x3451f8=_0xf4f4[_0x44633b];return _0x3451f8;};'use strict';var _=require(_0x4f4f('0x0'));var moment=require(_0x4f4f('0x1'));var util=require('util');var Redis=require(_0x4f4f('0x2'));var config=require(_0x4f4f('0x3'));var logger=require(_0x4f4f('0x4'))(_0x4f4f('0x5'));var ami=require(_0x4f4f('0x6'));var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x4f4f('0x7'));config['redis']=_[_0x4f4f('0x8')](config[_0x4f4f('0x9')],{'host':_0x4f4f('0xa'),'port':0x18eb});var io=require(_0x4f4f('0xb'))(new Redis(config[_0x4f4f('0x9')]));var Sequence=function(){};Sequence[_0x4f4f('0xc')][_0x4f4f('0xd')]=function(_0x3768d7){this['tail']=this[_0x4f4f('0xe')]?this[_0x4f4f('0xe')][_0x4f4f('0xf')](_0x3768d7):_0x3768d7();};function VoiceQueueReport(_0x2d86d1){this[_0x4f4f('0x10')]=new Sequence();this[_0x4f4f('0x11')]={};this[_0x4f4f('0x12')]=_0x2d86d1;this[_0x4f4f('0x13')]=_0x2d86d1['agents'];this['channels']=_0x2d86d1[_0x4f4f('0x14')];this[_0x4f4f('0x15')]=_0x2d86d1[_0x4f4f('0x15')];this[_0x4f4f('0x16')]=_0x2d86d1[_0x4f4f('0x16')];this[_0x4f4f('0x17')]=initializeSummary();this['variables']={};ami['on'](_0x4f4f('0x18'),this['syncQueueSummary'][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x1a'),this[_0x4f4f('0x1b')][_0x4f4f('0x19')](this));ami['on']('queuemember',this[_0x4f4f('0x1c')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x1d'),this[_0x4f4f('0x1e')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x1f'),this[_0x4f4f('0x20')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x21'),this[_0x4f4f('0x22')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x23'),this[_0x4f4f('0x24')]['bind'](this));ami['on'](_0x4f4f('0x25'),this[_0x4f4f('0x26')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x27'),this[_0x4f4f('0x28')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x29'),this[_0x4f4f('0x2a')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x2b'),this[_0x4f4f('0x2c')][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x2d'),this[_0x4f4f('0x2e')]['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x2f'),this['syncAttendedTransfer'][_0x4f4f('0x19')](this));ami['on'](_0x4f4f('0x30'),this[_0x4f4f('0x31')][_0x4f4f('0x19')](this));this[_0x4f4f('0x32')]();this[_0x4f4f('0x33')]();}function clearChannels(_0xa6371b){if(!_['isEmpty'](_0xa6371b)){for(var _0x39fb9f in _0xa6371b){if(_0xa6371b[_0x4f4f('0x34')](_0x39fb9f)){delete _0xa6371b[_0x39fb9f];}}}}function clearCampaigns(_0x18e718){if(!_[_0x4f4f('0x35')](_0x18e718)){for(var _0x18e864 in _0x18e718){if(_0x18e718['hasOwnProperty'](_0x18e864)){_0x18e718[_0x18e864][_0x4f4f('0x36')]=0x0;}}}}function clearVoiceQueues(_0xaf3de1){if(!_[_0x4f4f('0x35')](_0xaf3de1)){for(var _0x5deda9 in _0xaf3de1){if(_0xaf3de1['hasOwnProperty'](_0x5deda9)){_0xaf3de1[_0x5deda9]['originated']=0x0;_0xaf3de1[_0x5deda9][_0x4f4f('0x37')]=0x0;_0xaf3de1[_0x5deda9]['pTalking']=0x0;_0xaf3de1[_0x5deda9][_0x4f4f('0x38')]=0x0;_0xaf3de1[_0x5deda9][_0x4f4f('0x39')]=!![];}}}}function clearAgentBooked(_0x2e688a){if(!_['isEmpty'](_0x2e688a)){for(var _0x460546 in _0x2e688a){if(_0x2e688a[_0x4f4f('0x34')](_0x460546)){_0x2e688a[_0x460546]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x3a')]=function(){var _0x38cd62=this;for(var _0x5b937e in this[_0x4f4f('0x3b')]){if(this[_0x4f4f('0x3b')]['hasOwnProperty'](_0x5b937e)&&!this['channels'][_0x5b937e][_0x4f4f('0x3c')]){this[_0x4f4f('0x10')][_0x4f4f('0xd')](function(){if(!_[_0x4f4f('0x3d')](_0x38cd62[_0x4f4f('0x3b')][_0x5b937e])){return ami[_0x4f4f('0x3e')]({'action':_0x4f4f('0x3f'),'channel':_0x38cd62[_0x4f4f('0x3b')][_0x5b937e][_0x4f4f('0x40')]})[_0x4f4f('0x41')](function(_0x54c095){if(_0x54c095['message']===_0x4f4f('0x42')){setTimeout(function(){if(_0x38cd62['channels'][_0x5b937e]){delete _0x38cd62[_0x4f4f('0x3b')][_0x5b937e];logger[_0x4f4f('0x43')](_0x4f4f('0x44'),_0x5b937e,util[_0x4f4f('0x45')](_0x54c095,{'showHidden':![],'depth':null}));}if(_0x38cd62[_0x4f4f('0x11')][_0x5b937e]){delete _0x38cd62[_0x4f4f('0x11')][_0x5b937e];logger[_0x4f4f('0x43')](_0x4f4f('0x46'),_0x5b937e,util[_0x4f4f('0x45')](_0x54c095,{'showHidden':![],'depth':null}));}if(_0x38cd62[_0x4f4f('0x47')][_0x5b937e]){delete _0x38cd62[_0x4f4f('0x47')][_0x5b937e];logger[_0x4f4f('0x43')]('[%s][voiceQueueReport][checkVariables]',_0x5b937e,util[_0x4f4f('0x45')](_0x54c095,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x2c')]=function(){logger[_0x4f4f('0x43')](_0x4f4f('0x48'));clearChannels(this[_0x4f4f('0x3b')]);this[_0x4f4f('0x49')](this[_0x4f4f('0x11')]);clearAgentBooked(this[_0x4f4f('0x13')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x4f4f('0x16')]);this[_0x4f4f('0x17')]=initializeSummary();};VoiceQueueReport[_0x4f4f('0xc')]['clearQueueReport']=function(_0x5b9b85){var _0xc2bc33=this;if(!_[_0x4f4f('0x35')](_0x5b9b85)){for(var _0x3bb91c in _0x5b9b85){if(_0x5b9b85[_0x4f4f('0x34')](_0x3bb91c)){_0xc2bc33[_0x4f4f('0x4a')](_0x5b9b85[_0x3bb91c],_0x4f4f('0x4b'));delete _0x5b9b85[_0x3bb91c];}}}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x4c')]=function(_0x2eb6c8,_0x455aa0,_0x14afb1){io['to'](_0x2eb6c8)[_0x4f4f('0x4c')](_0x455aa0,_0x14afb1);};VoiceQueueReport['prototype'][_0x4f4f('0x4d')]=function(_0x1b031e,_0x306ee7){logger[_0x4f4f('0x4e')](_0x4f4f('0x4f')+_0x306ee7+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1b031e['uniqueid'],util[_0x4f4f('0x45')](_0x1b031e,{'showHidden':![],'depth':null}));this[_0x4f4f('0x4c')](util[_0x4f4f('0x50')](_0x4f4f('0x51'),_0x1b031e['queue']),_0x4f4f('0x52'),_0x1b031e);io['emit'](_0x4f4f('0x53'),_0x1b031e);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x399023,_0x4f3a0f){logger[_0x4f4f('0x4e')](_0x4f4f('0x4f')+_0x4f3a0f+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x399023[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x399023,{'showHidden':![],'depth':null}));if(_0x399023['queuecallerexitreason']===_0x4f4f('0x55')){return;}this[_0x4f4f('0x4c')](util[_0x4f4f('0x50')](_0x4f4f('0x51'),_0x399023[_0x4f4f('0x56')]),_0x4f4f('0x57'),_0x399023);io[_0x4f4f('0x4c')](_0x4f4f('0x58'),_0x399023);};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x59')]=function(_0x475969){if(_0x475969[_0x4f4f('0x5a')]===_0x4f4f('0x5b')){logger[_0x4f4f('0x4e')](_0x4f4f('0x5c'),util['inspect'](_0x475969,{'showHidden':![],'depth':null}));this[_0x4f4f('0x4c')](util['format']('voice:queue:%s',_0x475969[_0x4f4f('0x5d')]),_0x4f4f('0x5e'),_0x475969);}};VoiceQueueReport['prototype'][_0x4f4f('0x5f')]=function(_0x3a5b96){return _0x3a5b96!==null&&!_[_0x4f4f('0x60')](_0x3a5b96);};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x33')]=function(){var _0x545dd6=this;setInterval(function(){_0x545dd6[_0x4f4f('0x3a')]();ami[_0x4f4f('0x3e')]({'action':_0x4f4f('0x61')})[_0x4f4f('0x41')](function(_0x196426){logger[_0x4f4f('0x43')](_0x4f4f('0x62'),util[_0x4f4f('0x45')](_0x196426,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4f4f('0xc')]['loopQueueSummary']=function(){var _0x747dcf=this;setInterval(function(){if(!_0x747dcf[_0x4f4f('0x17')]['isRunning']){return ami['Action']({'action':'queuesummary'})[_0x4f4f('0x63')](function(_0x13f453){_0x747dcf[_0x4f4f('0x17')]['id']=_0x13f453['actionid'];_0x747dcf[_0x4f4f('0x17')]['isRunning']=!![];_0x747dcf[_0x4f4f('0x17')][_0x4f4f('0x64')][_0x13f453[_0x4f4f('0x65')]]={};})[_0x4f4f('0x41')](function(_0xe03548){logger[_0x4f4f('0x43')](_0x4f4f('0x66'),util[_0x4f4f('0x45')](_0xe03548,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x4f4f('0xc')]['createQueueSummaryReport']=function(_0x59e207,_0x36cfcf){var _0x8edee4=this['summary']['queues'][_0x59e207[_0x4f4f('0x5d')]][_0x4f4f('0x67')];var _0x15fd73=new VoiceQueueSummary(_0x59e207);return _0x15fd73['createReport'](_0x36cfcf['agents'],this[_0x4f4f('0x13')],_0x8edee4,this[_0x4f4f('0x12')][_0x4f4f('0x3b')]);};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x68')]=function(_0x35ca6b,_0xe66fc){var _0x26a879=this[_0x4f4f('0x69')](_0x35ca6b,_0xe66fc);var _0x135cea=![];_0x135cea=_0x26a879[_0x4f4f('0x6a')](_0x35ca6b);if(_0x135cea){Object['assign'](_0x35ca6b,_0x26a879);this['realtime'][_0x4f4f('0x15')][_0x35ca6b[_0x4f4f('0x5d')]]=_0x35ca6b;this[_0x4f4f('0x59')](_0x26a879);}};VoiceQueueReport[_0x4f4f('0xc')]['syncQueueStatusComplete']=function(_0x1bef77){var _0x57a11f=null;var _0x36cc22=this[_0x4f4f('0x17')]['id'];if(this[_0x4f4f('0x17')]['queuestatus'][_0x36cc22]){_0x57a11f=this[_0x4f4f('0x17')][_0x4f4f('0x64')][_0x36cc22][_0x1bef77[_0x4f4f('0x65')]];}if(!_0x57a11f){this['summary']=initializeSummary();return;}var _0x182633=this[_0x4f4f('0x15')][_0x57a11f[_0x4f4f('0x56')]];if(_0x182633['type']===_0x4f4f('0x5b')){this[_0x4f4f('0x68')](_0x182633,_0x57a11f);}else if(_0x182633[_0x4f4f('0x5a')]==='outbound'){var _0x90f8d7=this['createQueueSummaryReport'](_0x182633,_0x57a11f);ami[_0x4f4f('0x4c')](_0x4f4f('0x6b'),_0x90f8d7);}this[_0x4f4f('0x17')][_0x4f4f('0x6c')]-=0x1;var _0x427ff3=this[_0x4f4f('0x17')][_0x4f4f('0x6c')]>0x0?!![]:![];if(!_0x427ff3){return this[_0x4f4f('0x1b')](this[_0x4f4f('0x17')][_0x4f4f('0x6d')]);}};VoiceQueueReport[_0x4f4f('0xc')]['syncQueueMember']=function(_0x4794fe){var _0x297c9c=this[_0x4f4f('0x17')]['id'];if(this['summary'][_0x4f4f('0x64')][_0x297c9c]&&this[_0x4f4f('0x17')][_0x4f4f('0x64')][_0x297c9c][_0x4794fe[_0x4f4f('0x65')]]){this['summary'][_0x4f4f('0x64')][_0x297c9c][_0x4794fe[_0x4f4f('0x65')]][_0x4f4f('0x13')][_0x4f4f('0x6e')](_0x4794fe);}};VoiceQueueReport[_0x4f4f('0xc')]['syncQueueSummary']=function(_0xe105e9){var _0x484ae2=this;try{if(this[_0x4f4f('0x5f')](_0xe105e9)&&this[_0x4f4f('0x5f')](_0xe105e9[_0x4f4f('0x56')])){logger[_0x4f4f('0x4e')](_0x4f4f('0x6f'),util[_0x4f4f('0x45')](_0xe105e9,{'showHidden':![],'depth':null}));var _0x4bbbf6=this['voiceQueues'][_0xe105e9[_0x4f4f('0x56')]];if(_0x4bbbf6){logger['info'](_0x4f4f('0x70'),_0x4bbbf6[_0x4f4f('0x5d')]);this[_0x4f4f('0x17')][_0x4f4f('0x61')][_0x4bbbf6[_0x4f4f('0x5d')]]={'summaryEvent':_0xe105e9};this[_0x4f4f('0x17')][_0x4f4f('0x6c')]+=0x1;return ami[_0x4f4f('0x3e')]({'action':_0x4f4f('0x64'),'queue':_0x4bbbf6[_0x4f4f('0x5d')]})[_0x4f4f('0x63')](function(_0x4fb751){if(!_0x484ae2['summary']['queuestatus'][_0xe105e9[_0x4f4f('0x65')]]){_0x484ae2[_0x4f4f('0x17')]['queuestatus'][_0xe105e9[_0x4f4f('0x65')]]={};}_0x484ae2[_0x4f4f('0x17')][_0x4f4f('0x64')][_0xe105e9[_0x4f4f('0x65')]][_0x4fb751[_0x4f4f('0x65')]]={'queue':_0x4bbbf6[_0x4f4f('0x5d')],'agents':[]};})['catch'](function(_0x3961e8){throw _0x3961e8;});}}}catch(_0x12597f){logger[_0x4f4f('0x43')](_0x4f4f('0x66'),util[_0x4f4f('0x45')](_0x12597f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x1b')]=function(_0x7f5e70){if(this['summary'][_0x4f4f('0x6c')]>0x0){this[_0x4f4f('0x17')][_0x4f4f('0x6d')]=_0x7f5e70;return;}logger[_0x4f4f('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x4f4f('0x45')](_0x7f5e70,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x4f4f('0x4c')]('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0x4f4f('0x1e')]=function(_0xa19f8f){try{if(this[_0x4f4f('0x5f')](_0xa19f8f)){logger[_0x4f4f('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0xa19f8f[_0x4f4f('0x54')],util['inspect'](_0xa19f8f,{'showHidden':![],'depth':null}));if(_[_0x4f4f('0x60')](this['queueReports'][_0xa19f8f[_0x4f4f('0x54')]])){this[_0x4f4f('0x11')][_0xa19f8f[_0x4f4f('0x54')]]=[];}if(_['isUndefined'](this[_0x4f4f('0x3b')][_0xa19f8f['uniqueid']])){this[_0x4f4f('0x3b')][_0xa19f8f[_0x4f4f('0x54')]]={};}var _0x40000d=new QueueReport();_0x40000d[_0x4f4f('0x56')]=_0xa19f8f[_0x4f4f('0x56')];_0x40000d[_0x4f4f('0x5a')]=this[_0x4f4f('0x15')][_0x40000d[_0x4f4f('0x56')]]&&this[_0x4f4f('0x15')][_0x40000d['queue']][_0x4f4f('0x5a')]?this[_0x4f4f('0x15')][_0x40000d[_0x4f4f('0x56')]][_0x4f4f('0x5a')]||_0x4f4f('0x5b'):_0x4f4f('0x5b');_0x40000d['queuecallerjoinAt']=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));_0x40000d[_0x4f4f('0x72')]=_0xa19f8f[_0x4f4f('0x72')];_0x40000d['count']=_0xa19f8f[_0x4f4f('0x73')];_0x40000d[_0x4f4f('0x54')]=_0xa19f8f[_0x4f4f('0x54')];_0x40000d['routealias']=this[_0x4f4f('0x3b')][_0xa19f8f[_0x4f4f('0x54')]]['routealias'];logger[_0x4f4f('0x74')](_0x4f4f('0x75'),_0x40000d[_0x4f4f('0x56')],_0x40000d[_0x4f4f('0x5a')]);_[_0x4f4f('0x76')](_0x40000d,_[_0x4f4f('0x77')](_0xa19f8f,_['keys'](_0x40000d)));this[_0x4f4f('0x11')][_0xa19f8f[_0x4f4f('0x54')]][_0x4f4f('0x6e')](_0x40000d);this[_0x4f4f('0x3b')][_0xa19f8f[_0x4f4f('0x54')]]=_0x40000d;this[_0x4f4f('0x4d')](_0x40000d,'queuecallerjoin');}}catch(_0x38ed6b){logger[_0x4f4f('0x43')](_0x4f4f('0x78'),_0xa19f8f['uniqueid'],util[_0x4f4f('0x45')](_0x38ed6b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x20')]=function(_0x2f6085){try{if(this[_0x4f4f('0x5f')](_0x2f6085)){logger['debug'](_0x4f4f('0x79'),_0x2f6085['uniqueid'],util['inspect'](_0x2f6085,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x2f6085[_0x4f4f('0x54')]]){var _0x3df1ba=_[_0x4f4f('0x7a')](this[_0x4f4f('0x11')][_0x2f6085[_0x4f4f('0x54')]]);_0x3df1ba[_0x4f4f('0x7b')]=![];_0x3df1ba[_0x4f4f('0x7c')]=null;_0x3df1ba[_0x4f4f('0x7d')]=_0x2f6085['holdtime'];_0x3df1ba[_0x4f4f('0x7e')]=_0x2f6085['originalposition'];_0x3df1ba[_0x4f4f('0x1f')]=!![];_0x3df1ba[_0x4f4f('0x7f')]=moment()['format'](_0x4f4f('0x71'));_0x3df1ba[_0x4f4f('0x80')]=_0x4f4f('0x81');_0x3df1ba[_0x4f4f('0x82')]=null;logger[_0x4f4f('0x74')](_0x4f4f('0x83'),_0x3df1ba[_0x4f4f('0x56')],_0x3df1ba[_0x4f4f('0x5a')]);this['channels'][_0x2f6085[_0x4f4f('0x54')]]=_0x3df1ba;this[_0x4f4f('0x4a')](_0x3df1ba,_0x4f4f('0x1f'));}}}catch(_0x55ec65){logger[_0x4f4f('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2f6085['uniqueid'],util[_0x4f4f('0x45')](_0x55ec65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x22')]=function(_0x2c8be9){try{if(this['isNotNull'](_0x2c8be9)){logger[_0x4f4f('0x4e')]('[%s][voiceQueueReport][queuecallerleave]',_0x2c8be9[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x2c8be9,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x2c8be9[_0x4f4f('0x54')]]){var _0x2179f4=_[_0x4f4f('0x7a')](this[_0x4f4f('0x11')][_0x2c8be9[_0x4f4f('0x54')]]);_0x2179f4[_0x4f4f('0x84')]=moment()[_0x4f4f('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x2179f4['connectedlinenum']=_0x2c8be9[_0x4f4f('0x85')];_0x2179f4[_0x4f4f('0x86')]=_0x2c8be9[_0x4f4f('0x86')];logger[_0x4f4f('0x74')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2179f4['queue'],_0x2179f4[_0x4f4f('0x5a')],_0x2c8be9[_0x4f4f('0x85')],_0x2c8be9[_0x4f4f('0x86')]);this[_0x4f4f('0x3b')][_0x2c8be9[_0x4f4f('0x54')]]=_0x2179f4;this['emitVoiceQueueChannelSave'](_0x2179f4,_0x4f4f('0x21'));}}}catch(_0x3bda3a){logger[_0x4f4f('0x43')](_0x4f4f('0x87'),_0x2c8be9[_0x4f4f('0x54')],util['inspect'](_0x3bda3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')]['syncAgentConnect']=function(_0x59e932){try{if(this[_0x4f4f('0x5f')](_0x59e932)){logger[_0x4f4f('0x4e')](_0x4f4f('0x88'),_0x59e932['uniqueid'],util[_0x4f4f('0x45')](_0x59e932,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x59e932['uniqueid']]){var _0x32a5e2=_[_0x4f4f('0x7a')](this['queueReports'][_0x59e932[_0x4f4f('0x54')]]);_0x32a5e2[_0x4f4f('0x7b')]=!![];_0x32a5e2[_0x4f4f('0x80')]=_0x4f4f('0x89');logger[_0x4f4f('0x74')](_0x4f4f('0x8a'),_0x32a5e2['queue'],_0x32a5e2[_0x4f4f('0x5a')]);}}}catch(_0x27044f){logger[_0x4f4f('0x43')](_0x4f4f('0x88'),_0x59e932[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x27044f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x24')]=function(_0xce220f){try{if(this[_0x4f4f('0x5f')](_0xce220f)){logger[_0x4f4f('0x4e')](_0x4f4f('0x8b'),_0xce220f[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0xce220f,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0xce220f['uniqueid']]){var _0x261678=_['last'](this[_0x4f4f('0x11')][_0xce220f[_0x4f4f('0x54')]]);_0x261678[_0x4f4f('0x1f')]=![];_0x261678['queuecallerabandonAt']=null;_0x261678[_0x4f4f('0x8c')]=!![];_0x261678[_0x4f4f('0x82')]=_0xce220f[_0x4f4f('0x8d')];_0x261678[_0x4f4f('0x7d')]=_0xce220f[_0x4f4f('0x7d')];_0x261678['queuecallercomplete']=!![];_0x261678[_0x4f4f('0x8e')]=![];_0x261678[_0x4f4f('0x8f')]=null;if(!_0x261678[_0x4f4f('0x90')]){if(_0xce220f['reason']==_0x4f4f('0x90')){_0x261678[_0x4f4f('0x80')]=_0x4f4f('0x91');logger['info'](_0x4f4f('0x92'),_0x261678['queue'],_0x261678[_0x4f4f('0x5a')]);}else{if(_['startsWith'](_0xce220f['channel']['toLowerCase'](),'local/')){if(this['queueReports'][_0xce220f[_0x4f4f('0x93')]]){var _0x2f2cb9=_['last'](this['queueReports'][_0xce220f[_0x4f4f('0x93')]]);_0x2f2cb9[_0x4f4f('0x7b')]=![];_0x2f2cb9[_0x4f4f('0x8e')]=!![];_0x2f2cb9['queuecallerexitAt']=moment(_0x261678['queuecallerjoinAt'])['add'](_0xce220f[_0x4f4f('0x7d')],'seconds')['format'](_0x4f4f('0x71'));_0x2f2cb9['queuecallerexitreason']=_0x4f4f('0x94');_0x2f2cb9[_0x4f4f('0x90')]=!![];_0x2f2cb9['transfertype']=_0x4f4f('0x95');_0x2f2cb9[_0x4f4f('0x96')]=_0xce220f['destexten'];_0x2f2cb9[_0x4f4f('0x97')]=_0xce220f[_0x4f4f('0x54')];logger[_0x4f4f('0x74')](_0x4f4f('0x98'),_0x2f2cb9['queue'],_0x2f2cb9[_0x4f4f('0x5a')]);var _0x349e9c=this[_0x4f4f('0x11')][_0xce220f[_0x4f4f('0x93')]];this['queueReports'][_0xce220f[_0x4f4f('0x93')]]=this[_0x4f4f('0x11')][_0xce220f[_0x4f4f('0x54')]];this[_0x4f4f('0x11')][_0xce220f[_0x4f4f('0x54')]]=_0x349e9c;}}else{_0x261678[_0x4f4f('0x80')]=_0x4f4f('0x99')+_0xce220f[_0x4f4f('0x9a')][_0x4f4f('0x9b')]();logger[_0x4f4f('0x74')](_0x4f4f('0x9c'),_0x261678[_0x4f4f('0x56')],_0x261678[_0x4f4f('0x5a')],_0x261678[_0x4f4f('0x80')]);}}}this['channels'][_0xce220f[_0x4f4f('0x54')]]=_0x261678;this[_0x4f4f('0x4a')](_0x261678,_0x4f4f('0x23'));}}}catch(_0x158ea5){logger[_0x4f4f('0x43')](_0x4f4f('0x8b'),_0xce220f['uniqueid'],util[_0x4f4f('0x45')](_0x158ea5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4f4f('0x28')]=function(_0x4a43de){try{if(this[_0x4f4f('0x5f')](_0x4a43de)){logger['debug'](_0x4f4f('0x9d'),_0x4a43de[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x4a43de,{'showHidden':![],'depth':null}));this['addVariable'](_0x4a43de[_0x4f4f('0x54')],_[_0x4f4f('0x9e')](_0x4a43de[_0x4f4f('0x9f')])[0x0],_0x4a43de[_0x4f4f('0xa0')]);if(this[_0x4f4f('0x11')][_0x4a43de['uniqueid']]){var _0x3221e5=_['last'](this[_0x4f4f('0x11')][_0x4a43de[_0x4f4f('0x54')]]);if(_0x3221e5){if(this['isNotNull'](_0x4a43de['variable'])&&this['isNotNull'](_0x4a43de[_0x4f4f('0x9f')][_0x4f4f('0x64')])){switch(_0x4a43de[_0x4f4f('0xa0')]){case'CONTINUE':_0x3221e5[_0x4f4f('0x8e')]=![];_0x3221e5['queuecallerexitAt']=null;break;case _0x4f4f('0xa1'):_0x3221e5['lastevent']=_0x4f4f('0xa2');_0x3221e5['queuecallerexit']=!![];_0x3221e5[_0x4f4f('0x8f')]=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));_0x3221e5[_0x4f4f('0x84')]=moment()['format'](_0x4f4f('0x71'));logger[_0x4f4f('0x4e')](_0x4f4f('0xa3'),_0x4a43de[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x3221e5,{'showHidden':![],'depth':null}));ami[_0x4f4f('0x4c')](_0x4f4f('0xa4'),_0x3221e5);break;default:_0x3221e5[_0x4f4f('0x8e')]=!![];_0x3221e5[_0x4f4f('0x8f')]=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));_0x3221e5['queuecallerleaveAt']=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));}_0x3221e5[_0x4f4f('0x1f')]=![];_0x3221e5[_0x4f4f('0x7f')]=null;_0x3221e5[_0x4f4f('0x80')]=_0x4a43de['value'];this[_0x4f4f('0x3b')][_0x4a43de['uniqueid']]=_0x3221e5;this[_0x4f4f('0x4a')](_0x3221e5,_0x4f4f('0x27'));}else if(this[_0x4f4f('0x5f')](_0x4a43de[_0x4f4f('0x9f')])&&this['isNotNull'](_0x4a43de[_0x4f4f('0x9f')]['queueposition'])){if(!_0x3221e5[_0x4f4f('0x1f')]){_0x3221e5[_0x4f4f('0x8e')]=!![];_0x3221e5[_0x4f4f('0x8f')]=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));_0x3221e5[_0x4f4f('0x80')]=_0x4f4f('0xa5');_0x3221e5[_0x4f4f('0x84')]=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));this['channels'][_0x4a43de[_0x4f4f('0x54')]]=_0x3221e5;}}logger['info'](_0x4f4f('0xa6'),_0x4a43de['uniqueid'],_0x3221e5[_0x4f4f('0x56')],_0x3221e5[_0x4f4f('0x5a')],_[_0x4f4f('0x9e')](_0x4a43de[_0x4f4f('0x9f')])[0x0],_0x4a43de[_0x4f4f('0xa0')]);_0x3221e5[_0x4f4f('0x47')]=this[_0x4f4f('0x47')][_0x4a43de[_0x4f4f('0x54')]];}}}}catch(_0x4e6e41){logger[_0x4f4f('0x43')](_0x4f4f('0x9d'),_0x4a43de['uniqueid'],util[_0x4f4f('0x45')](_0x4e6e41,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0xa7')]=function(_0x35e9e7,_0x56487a,_0x24e4ef){var _0x4f8c5a=[_0x4f4f('0xa8'),'rtpaudioqosbridged',_0x4f4f('0xa9'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x4f4f('0xaa'),_0x4f4f('0xab'),_0x4f4f('0xac'),_0x4f4f('0xad'),'sipuri','bridgepeer','bridgepvtcallid','membercalls',_0x4f4f('0xae'),_0x4f4f('0xaf'),'memberlastcall',_0x4f4f('0x8d'),'memberpenalty',_0x4f4f('0xb0')];if(!_[_0x4f4f('0x3d')](_0x56487a)&&!_[_0x4f4f('0xb1')](_0x4f8c5a,_0x56487a)){if(_[_0x4f4f('0x60')](this[_0x4f4f('0x47')][_0x35e9e7])){this[_0x4f4f('0x47')][_0x35e9e7]={};}this[_0x4f4f('0x47')][_0x35e9e7][_0x56487a]=_0x24e4ef;}};VoiceQueueReport[_0x4f4f('0xc')]['handleHangup']=function(_0x62d0ed,_0x242855,_0x1eceff){var _0x39a78b={};for(var _0x4b16f4=0x0;_0x4b16f4<this[_0x4f4f('0x11')][_0x62d0ed]['length'];_0x4b16f4+=0x1){_0x39a78b=this['queueReports'][_0x62d0ed][_0x4b16f4];if(this['voiceQueues'][_0x39a78b['queue']]){if(_0x39a78b[_0x4f4f('0x8e')]&&_0x39a78b[_0x4f4f('0x90')]!=!![]){this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xb2')]+=0x1;}if(_0x39a78b[_0x4f4f('0x1f')]){this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xb3')]+=0x1;}this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xb4')]+=moment(_0x39a78b[_0x4f4f('0x84')])[_0x4f4f('0xb5')](_0x39a78b['queuecallerjoinAt'],_0x4f4f('0xb6'))||0x0;if(_0x4b16f4===this[_0x4f4f('0x11')][_0x62d0ed][_0x4f4f('0xb7')]-0x1){this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xb8')]+=moment()['milliseconds'](0x0)[_0x4f4f('0xb5')](_0x39a78b[_0x4f4f('0xb9')],_0x4f4f('0xb6'));this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xba')]+=0x1;if(_0x39a78b[_0x4f4f('0x7b')]){this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xbb')]+=0x1;this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]][_0x4f4f('0xbc')]+=moment()[_0x4f4f('0xbd')](0x0)[_0x4f4f('0xb5')](_0x39a78b[_0x4f4f('0x84')],_0x4f4f('0xb6'));_0x39a78b[_0x4f4f('0x7c')]=moment()[_0x4f4f('0x50')](_0x4f4f('0x71'));_0x39a78b[_0x4f4f('0x8e')]=![];_0x39a78b[_0x4f4f('0x8f')]=null;}if(_0x39a78b[_0x4f4f('0x8e')]&&_0x39a78b[_0x4f4f('0x90')]!=!![]){_0x39a78b['lastevent']='unmanaged';logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x62d0ed,util[_0x4f4f('0x45')](_0x39a78b,{'showHidden':![],'depth':null}));ami['emit'](_0x4f4f('0xbe'),_0x39a78b);}if(_0x39a78b[_0x4f4f('0x1f')]){_0x39a78b[_0x4f4f('0xbf')]=_0x4f4f('0xb3');logger[_0x4f4f('0x4e')](_0x4f4f('0xc0'),_0x62d0ed,util[_0x4f4f('0x45')](_0x39a78b,{'showHidden':![],'depth':null}));ami[_0x4f4f('0x4c')]('custom:queuecallerabandon',_0x39a78b);}}else{this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]]['sumDuration']+=this[_0x4f4f('0x15')][_0x39a78b[_0x4f4f('0x56')]]['sumHoldTime'];}logger[_0x4f4f('0x74')](_0x4f4f('0xc1'),_0x62d0ed,_0x39a78b[_0x4f4f('0x56')],_0x39a78b[_0x4f4f('0x5a')],_0x242855);if(_0x1eceff&&_0x39a78b[_0x4f4f('0x80')]===_0x4f4f('0x55')){_0x39a78b[_0x4f4f('0x80')]=_0x4f4f('0x89');}this[_0x4f4f('0x3b')][_0x62d0ed]=_0x39a78b;this['emitVoiceQueueChannelRemove'](_0x39a78b,_0x4f4f('0x29'));}}logger[_0x4f4f('0x4e')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x62d0ed,util[_0x4f4f('0x45')](this[_0x4f4f('0x11')][_0x62d0ed],{'showHidden':![],'depth':null}));ami[_0x4f4f('0x4c')]('custom:voiceQueueReport',this[_0x4f4f('0x11')][_0x62d0ed]);if(_0x39a78b['queuecallerexitreason']===_0x4f4f('0x55')){return;}if(_0x39a78b[_0x4f4f('0x8e')]||_0x39a78b[_0x4f4f('0x1f')]||_0x39a78b[_0x4f4f('0x7b')]){delete this[_0x4f4f('0x11')][_0x62d0ed];delete this['channels'][_0x62d0ed];if(this[_0x4f4f('0x47')][_0x62d0ed]){delete this[_0x4f4f('0x47')][_0x62d0ed];}}};VoiceQueueReport[_0x4f4f('0xc')]['syncHangup']=function(_0x564932){try{if(this[_0x4f4f('0x5f')](_0x564932)){logger[_0x4f4f('0x4e')](_0x4f4f('0xc2'),_0x564932[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x564932,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x564932[_0x4f4f('0x54')]]){return this[_0x4f4f('0xc3')](_0x564932[_0x4f4f('0x54')],_0x564932[_0x4f4f('0xc4')],![]);}if(this[_0x4f4f('0x11')][_0x564932[_0x4f4f('0x93')]]){if(_0x564932[_0x4f4f('0xc5')]==='21'){return;}return this['handleHangup'](_0x564932['linkedid'],_0x564932[_0x4f4f('0xc4')],!![]);}var _0x580df7=Object['keys'](this['queueReports']);for(var _0x406773=0x0;_0x406773<_0x580df7['length'];_0x406773++){var _0x5729fa=_['last'](this[_0x4f4f('0x11')][_0x580df7[_0x406773]]);if(_0x5729fa&&_0x5729fa[_0x4f4f('0xc6')]===_0x564932['uniqueid']){return this[_0x4f4f('0xc3')](_0x5729fa['uniqueid'],_0x564932[_0x4f4f('0xc4')],!![]);}}}}catch(_0x5f1dfc){logger[_0x4f4f('0x43')](_0x4f4f('0xc2'),_0x564932['uniqueid'],util['inspect'](_0x5f1dfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')]['syncAttendedTransfer']=function(_0x57c0bb){try{if(this[_0x4f4f('0x5f')](_0x57c0bb)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0x57c0bb[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x57c0bb,{'showHidden':![],'depth':null}));var _0x48ddc1;var _0x4836f9;var _0x5f3c08;if(this[_0x4f4f('0x11')][_0x57c0bb['transfereeuniqueid']]){_0x48ddc1=_['last'](this['queueReports'][_0x57c0bb[_0x4f4f('0xc7')]]);_0x48ddc1[_0x4f4f('0x96')]=_0x57c0bb['secondtransfererexten'];_0x48ddc1[_0x4f4f('0x97')]=_0x57c0bb[_0x4f4f('0xc8')];_0x48ddc1[_0x4f4f('0x80')]=_0x4f4f('0x55');_0x48ddc1[_0x4f4f('0x90')]=!![];_0x48ddc1[_0x4f4f('0xc9')]=_0x4f4f('0xca');if(this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xc8')]]){_0x5f3c08=this[_0x4f4f('0x11')][_0x57c0bb['secondtransfereruniqueid']];this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xc8')]]=this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xc7')]];this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xc7')]]=_0x5f3c08;_0x4836f9=_[_0x4f4f('0x7a')](this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xc7')]]);_0x4836f9[_0x4f4f('0x3c')]=!![];}logger[_0x4f4f('0x74')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x57c0bb[_0x4f4f('0x54')],_0x48ddc1[_0x4f4f('0x56')],_0x48ddc1['type'],_0x48ddc1[_0x4f4f('0x96')],_0x48ddc1[_0x4f4f('0x97')]);}else if(this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcb')]]){_0x48ddc1=_[_0x4f4f('0x7a')](this['queueReports'][_0x57c0bb[_0x4f4f('0xcb')]]);_0x48ddc1[_0x4f4f('0x96')]=_0x57c0bb[_0x4f4f('0xcc')];_0x48ddc1[_0x4f4f('0x97')]=_0x57c0bb[_0x4f4f('0xcd')];_0x48ddc1[_0x4f4f('0x80')]=_0x4f4f('0x55');_0x48ddc1['transfer']=!![];_0x48ddc1['transfertype']=_0x4f4f('0xca');if(this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcd')]]){_0x5f3c08=this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcd')]];this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcd')]]=this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcb')]];this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcb')]]=_0x5f3c08;_0x4836f9=_['last'](this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcb')]]);_0x4836f9['switch']=!![];}logger['info'](_0x4f4f('0xce'),_0x57c0bb['uniqueid'],_0x48ddc1[_0x4f4f('0x56')],_0x48ddc1[_0x4f4f('0x5a')],_0x48ddc1[_0x4f4f('0x96')],_0x48ddc1[_0x4f4f('0x97')]);}else if(this[_0x4f4f('0x11')][_0x57c0bb[_0x4f4f('0xcd')]]){_0x48ddc1=_[_0x4f4f('0x7a')](this['queueReports'][_0x57c0bb['origtransfereruniqueid']]);_0x48ddc1['transferexten']=_0x57c0bb[_0x4f4f('0xcc')];_0x48ddc1[_0x4f4f('0x97')]=_0x57c0bb['origtransfereruniqueid'];_0x48ddc1['queuecallerexitreason']=_0x4f4f('0x55');_0x48ddc1[_0x4f4f('0x90')]=!![];_0x48ddc1[_0x4f4f('0xc9')]=_0x4f4f('0xca');_0x48ddc1[_0x4f4f('0x3c')]=!![];_0x48ddc1[_0x4f4f('0xc6')]=_0x57c0bb['transfereeuniqueid'];}else if(this['queueReports'][_0x57c0bb[_0x4f4f('0xc8')]]){_0x48ddc1=_[_0x4f4f('0x7a')](this[_0x4f4f('0x11')][_0x57c0bb['secondtransfereruniqueid']]);_0x48ddc1[_0x4f4f('0x96')]=_0x57c0bb[_0x4f4f('0xcf')];_0x48ddc1['transferuniqueid']=_0x57c0bb['secondtransfereruniqueid'];_0x48ddc1[_0x4f4f('0x80')]='ATTENDEDTRANSFER';_0x48ddc1[_0x4f4f('0x90')]=!![];_0x48ddc1[_0x4f4f('0xc9')]=_0x4f4f('0xca');_0x48ddc1[_0x4f4f('0x3c')]=!![];_0x48ddc1[_0x4f4f('0xc6')]=_0x57c0bb[_0x4f4f('0xcb')];}}}catch(_0x186065){logger[_0x4f4f('0x43')](_0x4f4f('0xd0'),_0x57c0bb[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x186065,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')]['syncBlindTransfer']=function(_0xc4c79f){try{if(this[_0x4f4f('0x5f')](_0xc4c79f)){logger[_0x4f4f('0x4e')](_0x4f4f('0xd1'),_0xc4c79f[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0xc4c79f,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0xc4c79f['transfereeuniqueid']]){var _0x15f5ca=_['last'](this[_0x4f4f('0x11')][_0xc4c79f[_0x4f4f('0xc7')]]);_0x15f5ca[_0x4f4f('0x80')]=_0x4f4f('0xd2');_0x15f5ca[_0x4f4f('0x90')]=!![];_0x15f5ca[_0x4f4f('0xc9')]=_0x4f4f('0xd3');_0x15f5ca[_0x4f4f('0x96')]=_0xc4c79f[_0x4f4f('0xd4')];_0x15f5ca[_0x4f4f('0x97')]=_0xc4c79f[_0x4f4f('0xc7')];logger[_0x4f4f('0x74')](_0x4f4f('0xd5'),_0xc4c79f[_0x4f4f('0x54')],_0x15f5ca['queue'],_0x15f5ca[_0x4f4f('0x5a')],_0x15f5ca[_0x4f4f('0x96')],_0x15f5ca['transferuniqueid']);this[_0x4f4f('0x2a')]({'event':_0x4f4f('0xd6'),'uniqueid':_0xc4c79f[_0x4f4f('0xc7')],'context':_0xc4c79f['context'],'channel':_0xc4c79f[_0x4f4f('0xd7')]});}}}catch(_0x4bdcc1){logger['error'](_0x4f4f('0xd1'),_0xc4c79f[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x4bdcc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')][_0x4f4f('0x2e')]=function(_0x22d815){try{if(this[_0x4f4f('0x5f')](_0x22d815)){logger[_0x4f4f('0x4e')](_0x4f4f('0xd8'),_0x22d815[_0x4f4f('0x54')],util['inspect'](_0x22d815,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x22d815['uniqueid']]){var _0x164a92=_['last'](this[_0x4f4f('0x11')][_0x22d815[_0x4f4f('0x54')]]);if(!_[_0x4f4f('0x3d')](_0x164a92['queuecallerleaveAt'])){_0x164a92[_0x4f4f('0xd9')]=moment()['format'](_0x4f4f('0x71'));logger[_0x4f4f('0x74')](_0x4f4f('0xda'),_0x22d815[_0x4f4f('0x54')],_0x164a92[_0x4f4f('0xd9')]);}}}}catch(_0x498d2d){logger[_0x4f4f('0x43')](_0x4f4f('0xd8'),_0x22d815[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x498d2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')]['syncMusicOnHoldStop']=function(_0x3cf89e){try{if(this['isNotNull'](_0x3cf89e)){logger['debug'](_0x4f4f('0xdb'),_0x3cf89e['uniqueid'],util[_0x4f4f('0x45')](_0x3cf89e,{'showHidden':![],'depth':null}));if(this[_0x4f4f('0x11')][_0x3cf89e['uniqueid']]){var _0x314964=_['last'](this[_0x4f4f('0x11')][_0x3cf89e[_0x4f4f('0x54')]]);if(!_[_0x4f4f('0x3d')](_0x314964[_0x4f4f('0xd9')])){_0x314964[_0x4f4f('0xdc')]+=moment()['milliseconds'](0x0)[_0x4f4f('0xb5')](_0x314964[_0x4f4f('0xd9')],_0x4f4f('0xb6'));logger[_0x4f4f('0x74')](_0x4f4f('0xdd'),_0x3cf89e[_0x4f4f('0x54')],_0x314964[_0x4f4f('0xdc')]);delete _0x314964[_0x4f4f('0xd9')];}}}}catch(_0xe3e50){logger[_0x4f4f('0x43')](_0x4f4f('0xdb'),_0x3cf89e[_0x4f4f('0x54')],util['inspect'](_0xe3e50,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f4f('0xc')]['syncNewExten']=function(_0x6bdd7d){try{if(this[_0x4f4f('0x5f')](_0x6bdd7d)){logger[_0x4f4f('0x4e')](_0x4f4f('0xde'),_0x6bdd7d[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x6bdd7d,{'showHidden':![],'depth':null}));if(_0x6bdd7d[_0x4f4f('0xdf')][_0x4f4f('0xe0')]()===_0x4f4f('0xe1')){_0x6bdd7d[_0x4f4f('0xe2')]=_0x6bdd7d[_0x4f4f('0xe3')]&&_0x6bdd7d[_0x4f4f('0xe3')][_0x4f4f('0xe4')](_0x4f4f('0xe5'))?_0x6bdd7d['appdata']:(_0x6bdd7d[_0x4f4f('0xe3')]||_0x6bdd7d['applicationdata'])[_0x4f4f('0xe0')]();if(_[_0x4f4f('0xe4')](_0x6bdd7d[_0x4f4f('0xe2')][_0x4f4f('0xe0')](),_0x4f4f('0xe6'))){logger[_0x4f4f('0x74')](_0x4f4f('0xe7'),_0x6bdd7d[_0x4f4f('0x54')],_0x6bdd7d[_0x4f4f('0xdf')],_0x6bdd7d[_0x4f4f('0xe2')]);if(_['isUndefined'](this[_0x4f4f('0x3b')][_0x6bdd7d['uniqueid']]))this[_0x4f4f('0x3b')][_0x6bdd7d['uniqueid']]={};var _0x5430d0=_0x6bdd7d['applicationdata'][_0x4f4f('0xe8')]('=');var _0x631609=_0x5430d0[0x0][_0x4f4f('0xe0')]()[_0x4f4f('0xe9')](/cdr\((.*)\)/);if(_0x631609)this['channels'][_0x6bdd7d[_0x4f4f('0x54')]][_0x631609[0x1]]=_0x5430d0[0x1];}}}}catch(_0x48508d){logger[_0x4f4f('0x43')](_0x4f4f('0xea'),_0x6bdd7d[_0x4f4f('0x54')],util[_0x4f4f('0x45')](_0x48508d,{'showHidden':![],'depth':null}));}};module[_0x4f4f('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0x3fce=['custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','ATTENDEDTRANSFER','[%s][voiceQueueReport][hangup]','cause','cause-txt','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','secondtransfererexten','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','enqueue','tail','finally','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','syncQueueSummary','bind','syncQueueSummaryComplete','syncQueueMember','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','syncHangup','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','sequence','isNil','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','handleInboundQueueSummaryReport','compareToInboundQueue','assign','syncQueueStatusComplete','type','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','queue','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','[%s][voiceQueueReport][queuecallerjoin]','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerabandon','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','syncAgentComplete','queuecallerabandonAt','assigned','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','queuecallerjoinAt','add','seconds','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','addVariable','keys','variable','value','CONTINUE','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','includes','handleHangup','length','unmanaged','sumHoldTime','sumDuration','milliseconds','diff','total','answered','sumBillable','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:'];(function(_0x34ceb2,_0x231a8f){var _0xa3aab0=function(_0x48e9e7){while(--_0x48e9e7){_0x34ceb2['push'](_0x34ceb2['shift']());}};_0xa3aab0(++_0x231a8f);}(_0x3fce,0x121));var _0xe3fc=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x3fce[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var moment=require(_0xe3fc('0x0'));var util=require(_0xe3fc('0x1'));var Redis=require(_0xe3fc('0x2'));var config=require(_0xe3fc('0x3'));var logger=require(_0xe3fc('0x4'))(_0xe3fc('0x5'));var ami=require(_0xe3fc('0x6'));var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require('../model/voiceQueueSummary');config['redis']=_['defaults'](config[_0xe3fc('0x7')],{'host':_0xe3fc('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe3fc('0x7')]));var Sequence=function(){};Sequence['prototype'][_0xe3fc('0x9')]=function(_0x4a192d){this[_0xe3fc('0xa')]=this[_0xe3fc('0xa')]?this[_0xe3fc('0xa')][_0xe3fc('0xb')](_0x4a192d):_0x4a192d();};function VoiceQueueReport(_0x182656){this['sequence']=new Sequence();this['queueReports']={};this[_0xe3fc('0xc')]=_0x182656;this[_0xe3fc('0xd')]=_0x182656[_0xe3fc('0xd')];this['channels']=_0x182656[_0xe3fc('0xe')];this[_0xe3fc('0xf')]=_0x182656[_0xe3fc('0xf')];this[_0xe3fc('0x10')]=_0x182656[_0xe3fc('0x10')];this[_0xe3fc('0x11')]=initializeSummary();this[_0xe3fc('0x12')]={};ami['on']('queuesummary',this[_0xe3fc('0x13')][_0xe3fc('0x14')](this));ami['on']('queuesummarycomplete',this[_0xe3fc('0x15')][_0xe3fc('0x14')](this));ami['on']('queuemember',this[_0xe3fc('0x16')][_0xe3fc('0x14')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));ami['on'](_0xe3fc('0x17'),this[_0xe3fc('0x18')][_0xe3fc('0x14')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xe3fc('0x14')](this));ami['on']('queuecallerleave',this[_0xe3fc('0x19')][_0xe3fc('0x14')](this));ami['on'](_0xe3fc('0x1a'),this['syncAgentComplete']['bind'](this));ami['on'](_0xe3fc('0x1b'),this[_0xe3fc('0x1c')][_0xe3fc('0x14')](this));ami['on']('varset',this[_0xe3fc('0x1d')][_0xe3fc('0x14')](this));ami['on']('hangup',this[_0xe3fc('0x1e')][_0xe3fc('0x14')](this));ami['on']('fullybooted',this[_0xe3fc('0x1f')][_0xe3fc('0x14')](this));ami['on'](_0xe3fc('0x20'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xe3fc('0x21'),this[_0xe3fc('0x22')]['bind'](this));ami['on'](_0xe3fc('0x23'),this[_0xe3fc('0x24')][_0xe3fc('0x14')](this));ami['on'](_0xe3fc('0x25'),this['syncBlindTransfer'][_0xe3fc('0x14')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x5abdb3){if(!_['isEmpty'](_0x5abdb3)){for(var _0x51dc35 in _0x5abdb3){if(_0x5abdb3[_0xe3fc('0x26')](_0x51dc35)){delete _0x5abdb3[_0x51dc35];}}}}function clearCampaigns(_0x35a7b5){if(!_['isEmpty'](_0x35a7b5)){for(var _0x60e9b8 in _0x35a7b5){if(_0x35a7b5[_0xe3fc('0x26')](_0x60e9b8)){_0x35a7b5[_0x60e9b8]['originated']=0x0;}}}}function clearVoiceQueues(_0x46f549){if(!_[_0xe3fc('0x27')](_0x46f549)){for(var _0x1ecb86 in _0x46f549){if(_0x46f549[_0xe3fc('0x26')](_0x1ecb86)){_0x46f549[_0x1ecb86][_0xe3fc('0x28')]=0x0;_0x46f549[_0x1ecb86][_0xe3fc('0x29')]=0x0;_0x46f549[_0x1ecb86][_0xe3fc('0x2a')]=0x0;_0x46f549[_0x1ecb86][_0xe3fc('0x2b')]=0x0;_0x46f549[_0x1ecb86][_0xe3fc('0x2c')]=!![];}}}}function clearAgentBooked(_0xbb0f17){if(!_[_0xe3fc('0x27')](_0xbb0f17)){for(var _0x39f375 in _0xbb0f17){if(_0xbb0f17[_0xe3fc('0x26')](_0x39f375)){_0xbb0f17[_0x39f375][_0xe3fc('0x2d')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x2f')]=function(){var _0x59cc02=this;for(var _0x353c14 in this[_0xe3fc('0x30')]){if(this[_0xe3fc('0x30')]['hasOwnProperty'](_0x353c14)&&!this[_0xe3fc('0x30')][_0x353c14][_0xe3fc('0x31')]){this[_0xe3fc('0x32')]['enqueue'](function(){if(!_[_0xe3fc('0x33')](_0x59cc02[_0xe3fc('0x30')][_0x353c14])){return ami[_0xe3fc('0x34')]({'action':_0xe3fc('0x35'),'channel':_0x59cc02[_0xe3fc('0x30')][_0x353c14][_0xe3fc('0x36')]})['catch'](function(_0x3b0820){if(_0x3b0820[_0xe3fc('0x37')]===_0xe3fc('0x38')){setTimeout(function(){if(_0x59cc02[_0xe3fc('0x30')][_0x353c14]){delete _0x59cc02[_0xe3fc('0x30')][_0x353c14];logger[_0xe3fc('0x39')](_0xe3fc('0x3a'),_0x353c14,util[_0xe3fc('0x3b')](_0x3b0820,{'showHidden':![],'depth':null}));}if(_0x59cc02[_0xe3fc('0x3c')][_0x353c14]){delete _0x59cc02[_0xe3fc('0x3c')][_0x353c14];logger[_0xe3fc('0x39')](_0xe3fc('0x3d'),_0x353c14,util[_0xe3fc('0x3b')](_0x3b0820,{'showHidden':![],'depth':null}));}if(_0x59cc02['variables'][_0x353c14]){delete _0x59cc02['variables'][_0x353c14];logger['error'](_0xe3fc('0x3e'),_0x353c14,util[_0xe3fc('0x3b')](_0x3b0820,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x1f')]=function(){logger[_0xe3fc('0x39')](_0xe3fc('0x3f'));clearChannels(this[_0xe3fc('0x30')]);this[_0xe3fc('0x40')](this['queueReports']);clearAgentBooked(this[_0xe3fc('0xd')]);clearVoiceQueues(this[_0xe3fc('0xf')]);clearCampaigns(this['campaigns']);this[_0xe3fc('0x11')]=initializeSummary();};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x40')]=function(_0x3307cb){var _0x36ffee=this;if(!_['isEmpty'](_0x3307cb)){for(var _0x4430f5 in _0x3307cb){if(_0x3307cb['hasOwnProperty'](_0x4430f5)){_0x36ffee['emitVoiceQueueChannelRemove'](_0x3307cb[_0x4430f5],_0xe3fc('0x41'));delete _0x3307cb[_0x4430f5];}}}};VoiceQueueReport[_0xe3fc('0x2e')]['emit']=function(_0x1a881b,_0x575910,_0x24600b){io['to'](_0x1a881b)[_0xe3fc('0x42')](_0x575910,_0x24600b);};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x43')]=function(_0x54d491,_0x1cd5e2){logger[_0xe3fc('0x44')](_0xe3fc('0x45')+_0x1cd5e2+_0xe3fc('0x46'),_0x54d491[_0xe3fc('0x47')],util['inspect'](_0x54d491,{'showHidden':![],'depth':null}));this[_0xe3fc('0x42')](util[_0xe3fc('0x48')](_0xe3fc('0x49'),_0x54d491['queue']),_0xe3fc('0x4a'),_0x54d491);io['emit'](_0xe3fc('0x4b'),_0x54d491);};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x4c')]=function(_0xcdfa6d,_0x31256b){logger['debug'](_0xe3fc('0x45')+_0x31256b+_0xe3fc('0x4d'),_0xcdfa6d[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0xcdfa6d,{'showHidden':![],'depth':null}));if(_0xcdfa6d[_0xe3fc('0x4e')]==='ATTENDEDTRANSFER'){return;}this[_0xe3fc('0x42')](util['format']('voice:queue:%s',_0xcdfa6d['queue']),_0xe3fc('0x4f'),_0xcdfa6d);io[_0xe3fc('0x42')](_0xe3fc('0x50'),_0xcdfa6d);};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x51')]=function(_0x429df0){if(_0x429df0['type']===_0xe3fc('0x52')){logger['debug'](_0xe3fc('0x53'),util[_0xe3fc('0x3b')](_0x429df0,{'showHidden':![],'depth':null}));this[_0xe3fc('0x42')](util[_0xe3fc('0x48')]('voice:queue:%s',_0x429df0[_0xe3fc('0x54')]),_0xe3fc('0x55'),_0x429df0);}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x56')]=function(_0xde6752){return _0xde6752!==null&&!_[_0xe3fc('0x57')](_0xde6752);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x39ef31=this;setInterval(function(){_0x39ef31[_0xe3fc('0x2f')]();ami[_0xe3fc('0x34')]({'action':_0xe3fc('0x58')})[_0xe3fc('0x59')](function(_0x3a14cc){logger['error'](_0xe3fc('0x5a'),util['inspect'](_0x3a14cc,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xe3fc('0x2e')]['loopQueueSummary']=function(){var _0x507932=this;setInterval(function(){if(!_0x507932['summary'][_0xe3fc('0x5b')]){return ami[_0xe3fc('0x34')]({'action':'queuesummary'})[_0xe3fc('0x5c')](function(_0x5338c4){_0x507932[_0xe3fc('0x11')]['id']=_0x5338c4[_0xe3fc('0x5d')];_0x507932[_0xe3fc('0x11')][_0xe3fc('0x5b')]=!![];_0x507932[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x5338c4['actionid']]={};})['catch'](function(_0x2f7f20){logger[_0xe3fc('0x39')](_0xe3fc('0x5f'),util[_0xe3fc('0x3b')](_0x2f7f20,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x60')]=function(_0x305506,_0x4fcbf5){var _0x256131=this[_0xe3fc('0x11')][_0xe3fc('0x58')][_0x305506[_0xe3fc('0x54')]]['summaryEvent'];var _0x51faad=new VoiceQueueSummary(_0x305506);return _0x51faad['createReport'](_0x4fcbf5[_0xe3fc('0xd')],this[_0xe3fc('0xd')],_0x256131,this[_0xe3fc('0xc')][_0xe3fc('0x30')]);};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x61')]=function(_0x3af1ed,_0x27d0bf){var _0x189ae9=this[_0xe3fc('0x60')](_0x3af1ed,_0x27d0bf);var _0x1b9389=![];_0x1b9389=_0x189ae9[_0xe3fc('0x62')](_0x3af1ed);if(_0x1b9389){Object[_0xe3fc('0x63')](_0x3af1ed,_0x189ae9);this['realtime']['voiceQueues'][_0x3af1ed['name']]=_0x3af1ed;this[_0xe3fc('0x51')](_0x189ae9);}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x64')]=function(_0x4e5eb8){var _0x4b06cf=null;var _0x832a89=this[_0xe3fc('0x11')]['id'];if(this[_0xe3fc('0x11')]['queuestatus'][_0x832a89]){_0x4b06cf=this['summary']['queuestatus'][_0x832a89][_0x4e5eb8[_0xe3fc('0x5d')]];}if(!_0x4b06cf){this['summary']=initializeSummary();return;}var _0x4c41dd=this[_0xe3fc('0xf')][_0x4b06cf['queue']];if(_0x4c41dd['type']==='inbound'){this[_0xe3fc('0x61')](_0x4c41dd,_0x4b06cf);}else if(_0x4c41dd[_0xe3fc('0x65')]===_0xe3fc('0x66')){var _0x2303df=this[_0xe3fc('0x60')](_0x4c41dd,_0x4b06cf);ami['emit'](_0xe3fc('0x67'),_0x2303df);}this[_0xe3fc('0x11')]['statusRequests']-=0x1;var _0x2a95e1=this[_0xe3fc('0x11')][_0xe3fc('0x68')]>0x0?!![]:![];if(!_0x2a95e1){return this[_0xe3fc('0x15')](this[_0xe3fc('0x11')][_0xe3fc('0x69')]);}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x16')]=function(_0x3dbf21){var _0x1dbffe=this[_0xe3fc('0x11')]['id'];if(this[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x1dbffe]&&this[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x1dbffe][_0x3dbf21[_0xe3fc('0x5d')]]){this[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x1dbffe][_0x3dbf21[_0xe3fc('0x5d')]]['agents'][_0xe3fc('0x6a')](_0x3dbf21);}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x13')]=function(_0x51650d){var _0x137d5e=this;try{if(this['isNotNull'](_0x51650d)&&this[_0xe3fc('0x56')](_0x51650d['queue'])){logger['debug'](_0xe3fc('0x6b'),util[_0xe3fc('0x3b')](_0x51650d,{'showHidden':![],'depth':null}));var _0x35561b=this[_0xe3fc('0xf')][_0x51650d['queue']];if(_0x35561b){logger[_0xe3fc('0x6c')](_0xe3fc('0x6d'),_0x35561b[_0xe3fc('0x54')]);this[_0xe3fc('0x11')][_0xe3fc('0x58')][_0x35561b[_0xe3fc('0x54')]]={'summaryEvent':_0x51650d};this[_0xe3fc('0x11')]['statusRequests']+=0x1;return ami[_0xe3fc('0x34')]({'action':'queuestatus','queue':_0x35561b[_0xe3fc('0x54')]})[_0xe3fc('0x5c')](function(_0x13606f){if(!_0x137d5e[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x51650d['actionid']]){_0x137d5e[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x51650d[_0xe3fc('0x5d')]]={};}_0x137d5e[_0xe3fc('0x11')][_0xe3fc('0x5e')][_0x51650d[_0xe3fc('0x5d')]][_0x13606f['actionid']]={'queue':_0x35561b[_0xe3fc('0x54')],'agents':[]};})[_0xe3fc('0x59')](function(_0x39a97c){throw _0x39a97c;});}}}catch(_0x37d4b0){logger[_0xe3fc('0x39')]('[voiceQueueReport][queuesummary]',util[_0xe3fc('0x3b')](_0x37d4b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x15')]=function(_0x59c5f9){if(this[_0xe3fc('0x11')][_0xe3fc('0x68')]>0x0){this['summary'][_0xe3fc('0x69')]=_0x59c5f9;return;}logger[_0xe3fc('0x44')](_0xe3fc('0x6e'),util['inspect'](_0x59c5f9,{'showHidden':![],'depth':null}));this[_0xe3fc('0x11')]=initializeSummary();ami[_0xe3fc('0x42')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x18')]=function(_0x3b9077){try{if(this[_0xe3fc('0x56')](_0x3b9077)){logger[_0xe3fc('0x44')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3b9077['uniqueid'],util[_0xe3fc('0x3b')](_0x3b9077,{'showHidden':![],'depth':null}));if(_[_0xe3fc('0x57')](this[_0xe3fc('0x3c')][_0x3b9077['uniqueid']])){this['queueReports'][_0x3b9077[_0xe3fc('0x47')]]=[];}if(_[_0xe3fc('0x57')](this[_0xe3fc('0x30')][_0x3b9077[_0xe3fc('0x47')]])){this[_0xe3fc('0x30')][_0x3b9077[_0xe3fc('0x47')]]={};}var _0x1179ca=new QueueReport();_0x1179ca[_0xe3fc('0x6f')]=_0x3b9077[_0xe3fc('0x6f')];_0x1179ca[_0xe3fc('0x65')]=this[_0xe3fc('0xf')][_0x1179ca['queue']]&&this[_0xe3fc('0xf')][_0x1179ca[_0xe3fc('0x6f')]][_0xe3fc('0x65')]?this[_0xe3fc('0xf')][_0x1179ca[_0xe3fc('0x6f')]][_0xe3fc('0x65')]||_0xe3fc('0x52'):'inbound';_0x1179ca['queuecallerjoinAt']=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));_0x1179ca[_0xe3fc('0x71')]=_0x3b9077['position'];_0x1179ca[_0xe3fc('0x72')]=_0x3b9077[_0xe3fc('0x72')];_0x1179ca[_0xe3fc('0x47')]=_0x3b9077[_0xe3fc('0x47')];_0x1179ca['routealias']=this['channels'][_0x3b9077[_0xe3fc('0x47')]][_0xe3fc('0x73')];logger[_0xe3fc('0x6c')](_0xe3fc('0x74'),_0x1179ca[_0xe3fc('0x6f')],_0x1179ca['type']);_[_0xe3fc('0x75')](_0x1179ca,_[_0xe3fc('0x76')](_0x3b9077,_['keys'](_0x1179ca)));this[_0xe3fc('0x3c')][_0x3b9077[_0xe3fc('0x47')]][_0xe3fc('0x6a')](_0x1179ca);this[_0xe3fc('0x30')][_0x3b9077[_0xe3fc('0x47')]]=_0x1179ca;this[_0xe3fc('0x43')](_0x1179ca,_0xe3fc('0x17'));}}catch(_0xb29841){logger['error'](_0xe3fc('0x77'),_0x3b9077[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0xb29841,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x78')]=function(_0x392d40){try{if(this[_0xe3fc('0x56')](_0x392d40)){logger['debug'](_0xe3fc('0x79'),_0x392d40['uniqueid'],util['inspect'](_0x392d40,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0x392d40[_0xe3fc('0x47')]]){var _0x4bb1b1=_[_0xe3fc('0x7a')](this['queueReports'][_0x392d40[_0xe3fc('0x47')]]);_0x4bb1b1[_0xe3fc('0x7b')]=![];_0x4bb1b1[_0xe3fc('0x7c')]=null;_0x4bb1b1[_0xe3fc('0x7d')]=_0x392d40[_0xe3fc('0x7d')];_0x4bb1b1[_0xe3fc('0x7e')]=_0x392d40['originalposition'];_0x4bb1b1['queuecallerabandon']=!![];_0x4bb1b1['queuecallerabandonAt']=moment()[_0xe3fc('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bb1b1[_0xe3fc('0x4e')]='ABANDONED';_0x4bb1b1[_0xe3fc('0x7f')]=null;logger[_0xe3fc('0x6c')](_0xe3fc('0x80'),_0x4bb1b1[_0xe3fc('0x6f')],_0x4bb1b1['type']);this['channels'][_0x392d40['uniqueid']]=_0x4bb1b1;this[_0xe3fc('0x4c')](_0x4bb1b1,_0xe3fc('0x81'));}}}catch(_0x30f8e0){logger[_0xe3fc('0x39')](_0xe3fc('0x79'),_0x392d40[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x30f8e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe3fc('0x19')]=function(_0x33930d){try{if(this[_0xe3fc('0x56')](_0x33930d)){logger[_0xe3fc('0x44')](_0xe3fc('0x82'),_0x33930d[_0xe3fc('0x47')],util['inspect'](_0x33930d,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0x33930d['uniqueid']]){var _0x54d82a=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x33930d[_0xe3fc('0x47')]]);_0x54d82a[_0xe3fc('0x83')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));_0x54d82a['connectedlinenum']=_0x33930d[_0xe3fc('0x84')];_0x54d82a[_0xe3fc('0x85')]=_0x33930d[_0xe3fc('0x85')];logger[_0xe3fc('0x6c')](_0xe3fc('0x86'),_0x54d82a[_0xe3fc('0x6f')],_0x54d82a[_0xe3fc('0x65')],_0x33930d[_0xe3fc('0x84')],_0x33930d[_0xe3fc('0x85')]);this[_0xe3fc('0x30')][_0x33930d[_0xe3fc('0x47')]]=_0x54d82a;this[_0xe3fc('0x43')](_0x54d82a,_0xe3fc('0x87'));}}}catch(_0x1e2485){logger[_0xe3fc('0x39')](_0xe3fc('0x82'),_0x33930d['uniqueid'],util[_0xe3fc('0x3b')](_0x1e2485,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')]['syncAgentConnect']=function(_0xb4e018){try{if(this[_0xe3fc('0x56')](_0xb4e018)){logger['debug'](_0xe3fc('0x88'),_0xb4e018[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0xb4e018,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0xb4e018[_0xe3fc('0x47')]]){var _0x45a470=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0xb4e018[_0xe3fc('0x47')]]);_0x45a470[_0xe3fc('0x7b')]=!![];_0x45a470['queuecallerexitreason']=_0xe3fc('0x89');logger[_0xe3fc('0x6c')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x45a470[_0xe3fc('0x6f')],_0x45a470[_0xe3fc('0x65')]);}}}catch(_0x38b605){logger['error'](_0xe3fc('0x88'),_0xb4e018[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x38b605,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x8a')]=function(_0x3804dc){try{if(this[_0xe3fc('0x56')](_0x3804dc)){logger[_0xe3fc('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x3804dc[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x3804dc,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0x3804dc[_0xe3fc('0x47')]]){var _0x189e08=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x3804dc['uniqueid']]);_0x189e08['queuecallerabandon']=![];_0x189e08[_0xe3fc('0x8b')]=null;_0x189e08[_0xe3fc('0x8c')]=!![];_0x189e08[_0xe3fc('0x7f')]=_0x3804dc['membername'];_0x189e08['holdtime']=_0x3804dc[_0xe3fc('0x7d')];_0x189e08[_0xe3fc('0x7b')]=!![];_0x189e08[_0xe3fc('0x8d')]=![];_0x189e08[_0xe3fc('0x8e')]=null;if(!_0x189e08[_0xe3fc('0x8f')]){if(_0x3804dc['reason']==_0xe3fc('0x8f')){_0x189e08[_0xe3fc('0x4e')]=_0xe3fc('0x90');logger[_0xe3fc('0x6c')](_0xe3fc('0x91'),_0x189e08[_0xe3fc('0x6f')],_0x189e08[_0xe3fc('0x65')]);}else{if(_[_0xe3fc('0x92')](_0x3804dc['channel']['toLowerCase'](),_0xe3fc('0x93'))){if(this[_0xe3fc('0x3c')][_0x3804dc[_0xe3fc('0x94')]]){var _0x307060=_[_0xe3fc('0x7a')](this['queueReports'][_0x3804dc[_0xe3fc('0x94')]]);_0x307060[_0xe3fc('0x7b')]=![];_0x307060[_0xe3fc('0x8d')]=!![];_0x307060[_0xe3fc('0x8e')]=moment(_0x189e08[_0xe3fc('0x95')])[_0xe3fc('0x96')](_0x3804dc[_0xe3fc('0x7d')],_0xe3fc('0x97'))[_0xe3fc('0x48')](_0xe3fc('0x70'));_0x307060[_0xe3fc('0x4e')]='FORWARDTRANSFER';_0x307060[_0xe3fc('0x8f')]=!![];_0x307060[_0xe3fc('0x98')]=_0xe3fc('0x99');_0x307060[_0xe3fc('0x9a')]=_0x3804dc[_0xe3fc('0x9b')];_0x307060['transferuniqueid']=_0x3804dc[_0xe3fc('0x47')];logger[_0xe3fc('0x6c')](_0xe3fc('0x9c'),_0x307060[_0xe3fc('0x6f')],_0x307060[_0xe3fc('0x65')]);var _0x539bb5=this[_0xe3fc('0x3c')][_0x3804dc[_0xe3fc('0x94')]];this['queueReports'][_0x3804dc[_0xe3fc('0x94')]]=this['queueReports'][_0x3804dc[_0xe3fc('0x47')]];this[_0xe3fc('0x3c')][_0x3804dc[_0xe3fc('0x47')]]=_0x539bb5;}}else{_0x189e08[_0xe3fc('0x4e')]=_0xe3fc('0x9d')+_0x3804dc['reason'][_0xe3fc('0x9e')]();logger[_0xe3fc('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x189e08[_0xe3fc('0x6f')],_0x189e08['type'],_0x189e08[_0xe3fc('0x4e')]);}}}this['channels'][_0x3804dc[_0xe3fc('0x47')]]=_0x189e08;this[_0xe3fc('0x4c')](_0x189e08,_0xe3fc('0x1a'));}}}catch(_0x13e9a6){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x3804dc[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x13e9a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x1d')]=function(_0x2370f4){try{if(this[_0xe3fc('0x56')](_0x2370f4)){logger['debug']('[%s][voiceQueueReport][varset]',_0x2370f4[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x2370f4,{'showHidden':![],'depth':null}));this[_0xe3fc('0x9f')](_0x2370f4[_0xe3fc('0x47')],_[_0xe3fc('0xa0')](_0x2370f4[_0xe3fc('0xa1')])[0x0],_0x2370f4['value']);if(this[_0xe3fc('0x3c')][_0x2370f4[_0xe3fc('0x47')]]){var _0x680682=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x2370f4[_0xe3fc('0x47')]]);if(_0x680682){if(this[_0xe3fc('0x56')](_0x2370f4[_0xe3fc('0xa1')])&&this[_0xe3fc('0x56')](_0x2370f4[_0xe3fc('0xa1')]['queuestatus'])){switch(_0x2370f4[_0xe3fc('0xa2')]){case _0xe3fc('0xa3'):_0x680682['queuecallerexit']=![];_0x680682[_0xe3fc('0x8e')]=null;break;case'TIMEOUT':_0x680682['lastevent']=_0xe3fc('0xa4');_0x680682[_0xe3fc('0x8d')]=!![];_0x680682['queuecallerexitAt']=moment()[_0xe3fc('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x680682[_0xe3fc('0x83')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));logger['debug'](_0xe3fc('0xa5'),_0x2370f4[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x680682,{'showHidden':![],'depth':null}));ami[_0xe3fc('0x42')]('custom:timeout',_0x680682);break;default:_0x680682['queuecallerexit']=!![];_0x680682[_0xe3fc('0x8e')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));_0x680682[_0xe3fc('0x83')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));}_0x680682[_0xe3fc('0x81')]=![];_0x680682[_0xe3fc('0x8b')]=null;_0x680682[_0xe3fc('0x4e')]=_0x2370f4['value'];this[_0xe3fc('0x30')][_0x2370f4[_0xe3fc('0x47')]]=_0x680682;this[_0xe3fc('0x4c')](_0x680682,'varset');}else if(this[_0xe3fc('0x56')](_0x2370f4[_0xe3fc('0xa1')])&&this['isNotNull'](_0x2370f4[_0xe3fc('0xa1')][_0xe3fc('0xa6')])){if(!_0x680682[_0xe3fc('0x81')]){_0x680682[_0xe3fc('0x8d')]=!![];_0x680682[_0xe3fc('0x8e')]=moment()['format'](_0xe3fc('0x70'));_0x680682[_0xe3fc('0x4e')]=_0xe3fc('0xa7');_0x680682[_0xe3fc('0x83')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));this[_0xe3fc('0x30')][_0x2370f4['uniqueid']]=_0x680682;}}logger[_0xe3fc('0x6c')](_0xe3fc('0xa8'),_0x2370f4[_0xe3fc('0x47')],_0x680682[_0xe3fc('0x6f')],_0x680682[_0xe3fc('0x65')],_['keys'](_0x2370f4['variable'])[0x0],_0x2370f4['value']);_0x680682[_0xe3fc('0x12')]=this[_0xe3fc('0x12')][_0x2370f4[_0xe3fc('0x47')]];}}}}catch(_0x337f56){logger[_0xe3fc('0x39')](_0xe3fc('0xa9'),_0x2370f4[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x337f56,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x378503,_0x527434,_0x411cf0){var _0x1b6674=[_0xe3fc('0xaa'),_0xe3fc('0xab'),_0xe3fc('0xac'),_0xe3fc('0xad'),_0xe3fc('0xae'),_0xe3fc('0xaf'),_0xe3fc('0xb0'),_0xe3fc('0xb1'),_0xe3fc('0xb2'),_0xe3fc('0xb3'),_0xe3fc('0xb4'),_0xe3fc('0xb5'),'membercalls',_0xe3fc('0xb6'),'memberinterface',_0xe3fc('0xb7'),'membername','memberpenalty','memberrealtime'];if(!_[_0xe3fc('0x33')](_0x527434)&&!_[_0xe3fc('0xb8')](_0x1b6674,_0x527434)){if(_[_0xe3fc('0x57')](this['variables'][_0x378503])){this[_0xe3fc('0x12')][_0x378503]={};}this[_0xe3fc('0x12')][_0x378503][_0x527434]=_0x411cf0;}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0xb9')]=function(_0x2c58f0,_0x2757c3,_0x34db05){var _0x1833b4={};for(var _0x163470=0x0;_0x163470<this[_0xe3fc('0x3c')][_0x2c58f0][_0xe3fc('0xba')];_0x163470+=0x1){_0x1833b4=this[_0xe3fc('0x3c')][_0x2c58f0][_0x163470];if(this['voiceQueues'][_0x1833b4[_0xe3fc('0x6f')]]){if(_0x1833b4[_0xe3fc('0x8d')]&&_0x1833b4[_0xe3fc('0x8f')]!=!![]){this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xbb')]+=0x1;}if(_0x1833b4[_0xe3fc('0x81')]){this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]]['abandoned']+=0x1;}this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xbc')]+=moment(_0x1833b4[_0xe3fc('0x83')])['diff'](_0x1833b4[_0xe3fc('0x95')],_0xe3fc('0x97'))||0x0;if(_0x163470===this[_0xe3fc('0x3c')][_0x2c58f0][_0xe3fc('0xba')]-0x1){this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xbd')]+=moment()[_0xe3fc('0xbe')](0x0)[_0xe3fc('0xbf')](_0x1833b4[_0xe3fc('0x95')],_0xe3fc('0x97'));this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xc0')]+=0x1;if(_0x1833b4[_0xe3fc('0x7b')]){this['voiceQueues'][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xc1')]+=0x1;this[_0xe3fc('0xf')][_0x1833b4['queue']][_0xe3fc('0xc2')]+=moment()[_0xe3fc('0xbe')](0x0)[_0xe3fc('0xbf')](_0x1833b4['queuecallerleaveAt'],'seconds');_0x1833b4['queuecallercompleteAt']=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));_0x1833b4[_0xe3fc('0x8d')]=![];_0x1833b4['queuecallerexitAt']=null;}if(_0x1833b4[_0xe3fc('0x8d')]&&_0x1833b4[_0xe3fc('0x8f')]!=!![]){_0x1833b4[_0xe3fc('0xc3')]=_0xe3fc('0xbb');logger[_0xe3fc('0x44')](_0xe3fc('0xc4'),_0x2c58f0,util[_0xe3fc('0x3b')](_0x1833b4,{'showHidden':![],'depth':null}));ami[_0xe3fc('0x42')](_0xe3fc('0xc5'),_0x1833b4);}if(_0x1833b4['queuecallerabandon']){_0x1833b4[_0xe3fc('0xc3')]=_0xe3fc('0xc6');logger[_0xe3fc('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x2c58f0,util[_0xe3fc('0x3b')](_0x1833b4,{'showHidden':![],'depth':null}));ami['emit'](_0xe3fc('0xc7'),_0x1833b4);}}else{this[_0xe3fc('0xf')][_0x1833b4[_0xe3fc('0x6f')]]['sumDuration']+=this['voiceQueues'][_0x1833b4[_0xe3fc('0x6f')]][_0xe3fc('0xbc')];}logger['info'](_0xe3fc('0xc8'),_0x2c58f0,_0x1833b4[_0xe3fc('0x6f')],_0x1833b4['type'],_0x2757c3);if(_0x34db05&&_0x1833b4[_0xe3fc('0x4e')]==='ATTENDEDTRANSFER'){_0x1833b4[_0xe3fc('0x4e')]='COMPLETEDBYAGENT';}this['channels'][_0x2c58f0]=_0x1833b4;this[_0xe3fc('0x4c')](_0x1833b4,'hangup');}}logger[_0xe3fc('0x44')](_0xe3fc('0xc9'),_0x2c58f0,util[_0xe3fc('0x3b')](this[_0xe3fc('0x3c')][_0x2c58f0],{'showHidden':![],'depth':null}));ami[_0xe3fc('0x42')](_0xe3fc('0xca'),this['queueReports'][_0x2c58f0]);if(_0x1833b4[_0xe3fc('0x4e')]===_0xe3fc('0xcb')){return;}if(_0x1833b4[_0xe3fc('0x8d')]||_0x1833b4['queuecallerabandon']||_0x1833b4[_0xe3fc('0x7b')]){delete this[_0xe3fc('0x3c')][_0x2c58f0];delete this[_0xe3fc('0x30')][_0x2c58f0];if(this['variables'][_0x2c58f0]){delete this['variables'][_0x2c58f0];}}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x1e')]=function(_0x149b01){try{if(this[_0xe3fc('0x56')](_0x149b01)){logger[_0xe3fc('0x44')](_0xe3fc('0xcc'),_0x149b01['uniqueid'],util[_0xe3fc('0x3b')](_0x149b01,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0x149b01['uniqueid']]){return this[_0xe3fc('0xb9')](_0x149b01['uniqueid'],_0x149b01['cause-txt'],![]);}if(this[_0xe3fc('0x3c')][_0x149b01[_0xe3fc('0x94')]]){if(_0x149b01[_0xe3fc('0xcd')]==='21'){return;}return this[_0xe3fc('0xb9')](_0x149b01['linkedid'],_0x149b01[_0xe3fc('0xce')],!![]);}var _0x229ebc=Object[_0xe3fc('0xa0')](this[_0xe3fc('0x3c')]);for(var _0x40ed1b=0x0;_0x40ed1b<_0x229ebc[_0xe3fc('0xba')];_0x40ed1b++){var _0x2dcbc4=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x229ebc[_0x40ed1b]]);if(_0x2dcbc4&&_0x2dcbc4[_0xe3fc('0xcf')]===_0x149b01['uniqueid']){return this[_0xe3fc('0xb9')](_0x2dcbc4[_0xe3fc('0x47')],_0x149b01['cause-txt'],!![]);}}}}catch(_0xa4a24b){logger[_0xe3fc('0x39')]('[%s][voiceQueueReport][hangup]',_0x149b01['uniqueid'],util[_0xe3fc('0x3b')](_0xa4a24b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0x24')]=function(_0x447c7b){try{if(this[_0xe3fc('0x56')](_0x447c7b)){logger[_0xe3fc('0x44')](_0xe3fc('0xd0'),_0x447c7b[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x447c7b,{'showHidden':![],'depth':null}));var _0xfe6cbb;var _0x3bbc0d;var _0x1b0ce1;if(this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd1')]]){_0xfe6cbb=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd1')]]);_0xfe6cbb[_0xe3fc('0x9a')]=_0x447c7b['secondtransfererexten'];_0xfe6cbb[_0xe3fc('0xd2')]=_0x447c7b['secondtransfereruniqueid'];_0xfe6cbb[_0xe3fc('0x4e')]=_0xe3fc('0xcb');_0xfe6cbb['transfer']=!![];_0xfe6cbb[_0xe3fc('0x98')]='ATTENDED';if(this['queueReports'][_0x447c7b[_0xe3fc('0xd3')]]){_0x1b0ce1=this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd3')]];this[_0xe3fc('0x3c')][_0x447c7b['secondtransfereruniqueid']]=this[_0xe3fc('0x3c')][_0x447c7b['transfereeuniqueid']];this[_0xe3fc('0x3c')][_0x447c7b['transfereeuniqueid']]=_0x1b0ce1;_0x3bbc0d=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd1')]]);_0x3bbc0d[_0xe3fc('0x31')]=!![];}logger[_0xe3fc('0x6c')](_0xe3fc('0xd4'),_0x447c7b[_0xe3fc('0x47')],_0xfe6cbb[_0xe3fc('0x6f')],_0xfe6cbb['type'],_0xfe6cbb[_0xe3fc('0x9a')],_0xfe6cbb[_0xe3fc('0xd2')]);}else if(this[_0xe3fc('0x3c')][_0x447c7b['transfertargetuniqueid']]){_0xfe6cbb=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0x447c7b['transfertargetuniqueid']]);_0xfe6cbb['transferexten']=_0x447c7b[_0xe3fc('0xd5')];_0xfe6cbb[_0xe3fc('0xd2')]=_0x447c7b[_0xe3fc('0xd6')];_0xfe6cbb[_0xe3fc('0x4e')]=_0xe3fc('0xcb');_0xfe6cbb[_0xe3fc('0x8f')]=!![];_0xfe6cbb[_0xe3fc('0x98')]='ATTENDED';if(this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd6')]]){_0x1b0ce1=this['queueReports'][_0x447c7b[_0xe3fc('0xd6')]];this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd6')]]=this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd7')]];this[_0xe3fc('0x3c')][_0x447c7b['transfertargetuniqueid']]=_0x1b0ce1;_0x3bbc0d=_['last'](this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd7')]]);_0x3bbc0d[_0xe3fc('0x31')]=!![];}logger[_0xe3fc('0x6c')](_0xe3fc('0xd4'),_0x447c7b[_0xe3fc('0x47')],_0xfe6cbb['queue'],_0xfe6cbb['type'],_0xfe6cbb[_0xe3fc('0x9a')],_0xfe6cbb[_0xe3fc('0xd2')]);}else if(this['queueReports'][_0x447c7b[_0xe3fc('0xd6')]]){_0xfe6cbb=_['last'](this['queueReports'][_0x447c7b[_0xe3fc('0xd6')]]);_0xfe6cbb['transferexten']=_0x447c7b[_0xe3fc('0xd5')];_0xfe6cbb['transferuniqueid']=_0x447c7b[_0xe3fc('0xd6')];_0xfe6cbb[_0xe3fc('0x4e')]=_0xe3fc('0xcb');_0xfe6cbb[_0xe3fc('0x8f')]=!![];_0xfe6cbb['transfertype']='ATTENDED';_0xfe6cbb[_0xe3fc('0x31')]=!![];_0xfe6cbb[_0xe3fc('0xcf')]=_0x447c7b[_0xe3fc('0xd1')];}else if(this[_0xe3fc('0x3c')][_0x447c7b[_0xe3fc('0xd3')]]){_0xfe6cbb=_[_0xe3fc('0x7a')](this['queueReports'][_0x447c7b[_0xe3fc('0xd3')]]);_0xfe6cbb[_0xe3fc('0x9a')]=_0x447c7b[_0xe3fc('0xd8')];_0xfe6cbb[_0xe3fc('0xd2')]=_0x447c7b[_0xe3fc('0xd3')];_0xfe6cbb[_0xe3fc('0x4e')]=_0xe3fc('0xcb');_0xfe6cbb[_0xe3fc('0x8f')]=!![];_0xfe6cbb[_0xe3fc('0x98')]=_0xe3fc('0xd9');_0xfe6cbb['switch']=!![];_0xfe6cbb[_0xe3fc('0xcf')]=_0x447c7b[_0xe3fc('0xd7')];}}}catch(_0x1f8462){logger['error']('[%s][voiceQueueReport][attendedtransfer]',_0x447c7b['uniqueid'],util[_0xe3fc('0x3b')](_0x1f8462,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')]['syncBlindTransfer']=function(_0xe1c79c){try{if(this['isNotNull'](_0xe1c79c)){logger[_0xe3fc('0x44')](_0xe3fc('0xda'),_0xe1c79c['uniqueid'],util[_0xe3fc('0x3b')](_0xe1c79c,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0xe1c79c[_0xe3fc('0xd1')]]){var _0x551578=_[_0xe3fc('0x7a')](this[_0xe3fc('0x3c')][_0xe1c79c[_0xe3fc('0xd1')]]);_0x551578[_0xe3fc('0x4e')]=_0xe3fc('0xdb');_0x551578['transfer']=!![];_0x551578[_0xe3fc('0x98')]='BLIND';_0x551578[_0xe3fc('0x9a')]=_0xe1c79c[_0xe3fc('0xdc')];_0x551578['transferuniqueid']=_0xe1c79c[_0xe3fc('0xd1')];logger[_0xe3fc('0x6c')](_0xe3fc('0xdd'),_0xe1c79c['uniqueid'],_0x551578[_0xe3fc('0x6f')],_0x551578['type'],_0x551578[_0xe3fc('0x9a')],_0x551578[_0xe3fc('0xd2')]);this[_0xe3fc('0x1e')]({'event':_0xe3fc('0xde'),'uniqueid':_0xe1c79c['transfereeuniqueid'],'context':_0xe1c79c['context'],'channel':_0xe1c79c['transfererchannel']});}}}catch(_0x1b323f){logger[_0xe3fc('0x39')](_0xe3fc('0xda'),_0xe1c79c[_0xe3fc('0x47')],util['inspect'](_0x1b323f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')][_0xe3fc('0xdf')]=function(_0x1d1628){try{if(this[_0xe3fc('0x56')](_0x1d1628)){logger[_0xe3fc('0x44')](_0xe3fc('0xe0'),_0x1d1628[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x1d1628,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1d1628[_0xe3fc('0x47')]]){var _0x574c27=_[_0xe3fc('0x7a')](this['queueReports'][_0x1d1628[_0xe3fc('0x47')]]);if(!_[_0xe3fc('0x33')](_0x574c27[_0xe3fc('0x83')])){_0x574c27[_0xe3fc('0xe1')]=moment()[_0xe3fc('0x48')](_0xe3fc('0x70'));logger[_0xe3fc('0x6c')](_0xe3fc('0xe2'),_0x1d1628[_0xe3fc('0x47')],_0x574c27[_0xe3fc('0xe1')]);}}}}catch(_0x3d6c50){logger[_0xe3fc('0x39')](_0xe3fc('0xe0'),_0x1d1628[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x3d6c50,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe3fc('0x22')]=function(_0x5279d3){try{if(this[_0xe3fc('0x56')](_0x5279d3)){logger[_0xe3fc('0x44')]('[%s][voiceQueueReport][musiconholdstop]',_0x5279d3['uniqueid'],util[_0xe3fc('0x3b')](_0x5279d3,{'showHidden':![],'depth':null}));if(this[_0xe3fc('0x3c')][_0x5279d3[_0xe3fc('0x47')]]){var _0x3badbe=_['last'](this[_0xe3fc('0x3c')][_0x5279d3['uniqueid']]);if(!_[_0xe3fc('0x33')](_0x3badbe['mohstarttime'])){_0x3badbe[_0xe3fc('0xe3')]+=moment()[_0xe3fc('0xbe')](0x0)[_0xe3fc('0xbf')](_0x3badbe[_0xe3fc('0xe1')],_0xe3fc('0x97'));logger[_0xe3fc('0x6c')](_0xe3fc('0xe4'),_0x5279d3[_0xe3fc('0x47')],_0x3badbe['mohtime']);delete _0x3badbe['mohstarttime'];}}}}catch(_0x2b7023){logger[_0xe3fc('0x39')](_0xe3fc('0xe5'),_0x5279d3[_0xe3fc('0x47')],util['inspect'](_0x2b7023,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe3fc('0x2e')]['syncNewExten']=function(_0x37d25e){try{if(this[_0xe3fc('0x56')](_0x37d25e)){logger[_0xe3fc('0x44')](_0xe3fc('0xe6'),_0x37d25e[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x37d25e,{'showHidden':![],'depth':null}));if(_0x37d25e[_0xe3fc('0xe7')][_0xe3fc('0xe8')]()===_0xe3fc('0xe9')){_0x37d25e[_0xe3fc('0xea')]=_0x37d25e[_0xe3fc('0xeb')]&&_0x37d25e[_0xe3fc('0xeb')]['startsWith'](_0xe3fc('0xec'))?_0x37d25e[_0xe3fc('0xeb')]:(_0x37d25e[_0xe3fc('0xeb')]||_0x37d25e[_0xe3fc('0xea')])[_0xe3fc('0xe8')]();if(_['startsWith'](_0x37d25e['applicationdata'][_0xe3fc('0xe8')](),_0xe3fc('0xed'))){logger[_0xe3fc('0x6c')](_0xe3fc('0xee'),_0x37d25e[_0xe3fc('0x47')],_0x37d25e[_0xe3fc('0xe7')],_0x37d25e[_0xe3fc('0xea')]);if(_[_0xe3fc('0x57')](this[_0xe3fc('0x30')][_0x37d25e[_0xe3fc('0x47')]]))this[_0xe3fc('0x30')][_0x37d25e[_0xe3fc('0x47')]]={};var _0x2c8e38=_0x37d25e[_0xe3fc('0xea')][_0xe3fc('0xef')]('=');var _0x22b3a0=_0x2c8e38[0x0][_0xe3fc('0xe8')]()[_0xe3fc('0xf0')](/cdr\((.*)\)/);if(_0x22b3a0)this['channels'][_0x37d25e['uniqueid']][_0x22b3a0[0x1]]=_0x2c8e38[0x1];}}}}catch(_0x42d75a){logger['error'](_0xe3fc('0xf1'),_0x37d25e[_0xe3fc('0x47')],util[_0xe3fc('0x3b')](_0x42d75a,{'showHidden':![],'depth':null}));}};module[_0xe3fc('0xf2')]=VoiceQueueReport;
\ No newline at end of file
index 7e64d48..ba4f60e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x953e=['queue','Request','CreateReportAgentPreview','createHistory','campaign'];(function(_0x27a234,_0x22d4c7){var _0x1ae888=function(_0x2d356f){while(--_0x2d356f){_0x27a234['push'](_0x27a234['shift']());}};_0x1ae888(++_0x22d4c7);}(_0x953e,0xc6));var _0xe953=function(_0x6032a8,_0x89e2fb){_0x6032a8=_0x6032a8-0x0;var _0x3df9d6=_0x953e[_0x6032a8];return _0x3df9d6;};'use strict';var client=require('../client');exports[_0xe953('0x0')]=function(_0x5d2c92){return function(){_0x5d2c92[_0xe953('0x1')]=_0x5d2c92[_0xe953('0x2')];return client[_0xe953('0x3')](_0xe953('0x4'),{'body':_0x5d2c92,'log':_0xe953('0x4')});};};
\ No newline at end of file
+var _0x52d1=['CreateReportAgentPreview','../client','campaign','queue','Request'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x52d1,0x123));var _0x152d=function(_0x39c22d,_0x2fc23f){_0x39c22d=_0x39c22d-0x0;var _0x33c198=_0x52d1[_0x39c22d];return _0x33c198;};'use strict';var client=require(_0x152d('0x0'));exports['createHistory']=function(_0x548375){return function(){_0x548375[_0x152d('0x1')]=_0x548375[_0x152d('0x2')];return client[_0x152d('0x3')](_0x152d('0x4'),{'body':_0x548375,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index 815dea1..c3f9323 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x518c=['../client','create','Request','CreateAttachment'];(function(_0x4f8c85,_0x51dcad){var _0x5c001a=function(_0x44747a){while(--_0x44747a){_0x4f8c85['push'](_0x4f8c85['shift']());}};_0x5c001a(++_0x51dcad);}(_0x518c,0x150));var _0xc518=function(_0x21927c,_0x536f4b){_0x21927c=_0x21927c-0x0;var _0x4c443f=_0x518c[_0x21927c];return _0x4c443f;};'use strict';var client=require(_0xc518('0x0'));exports[_0xc518('0x1')]=function(_0x4e4a6b){return client[_0xc518('0x2')]('CreateAttachment',{'body':_0x4e4a6b,'log':_0xc518('0x3')});};
\ No newline at end of file
+var _0xcb49=['../client','Request','CreateAttachment'];(function(_0x683e47,_0x164c0f){var _0x2476be=function(_0x1ee986){while(--_0x1ee986){_0x683e47['push'](_0x683e47['shift']());}};_0x2476be(++_0x164c0f);}(_0xcb49,0x156));var _0x9cb4=function(_0x31ec29,_0x58915c){_0x31ec29=_0x31ec29-0x0;var _0x3275fc=_0xcb49[_0x31ec29];return _0x3275fc;};'use strict';var client=require(_0x9cb4('0x0'));exports['create']=function(_0x3a7326){return client[_0x9cb4('0x1')](_0x9cb4('0x2'),{'body':_0x3a7326,'log':_0x9cb4('0x2')});};
\ No newline at end of file
index e468a39..07c3dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x105fa5,_0x4753ec){var _0x5a6e8c=function(_0x29f85d){while(--_0x29f85d){_0x105fa5['push'](_0x105fa5['shift']());}};_0x5a6e8c(++_0x4753ec);}(_0xadb5,0xad));var _0x5adb=function(_0x164b19,_0x20a6dc){_0x164b19=_0x164b19-0x0;var _0x65dbed=_0xadb5[_0x164b19];return _0x65dbed;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'active',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'dialOriginateTimeout',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'dialAMDActive',_0x5adb('0x18'),'dialAMDGreeting',_0x5adb('0x19'),'dialAMDTotalAnalysisTime',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'dialAMDSilenceThreshold',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'dialRandomLastDigitCallerIdNumber',_0x5adb('0x20')],'include':[{'model':'Trunk','as':_0x5adb('0x21'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':_0x5adb('0x21'),'as':_0x5adb('0x24'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':'Interval','as':_0x5adb('0x25'),'attributes':['id','name'],'include':[{'model':_0x5adb('0x25'),'as':'Intervals','attributes':['id',_0x5adb('0x2'),'interval']}]},{'model':'SquareProject','as':_0x5adb('0x26'),'attributes':['id',_0x5adb('0x2')]}]},'log':_0x5adb('0x27')});};};
\ No newline at end of file
+var _0x5f2f=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','Trunk','callerid','TrunkBackup','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','GetCampaign','name','type','active','limitCalls'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x58d40e,_0x131ad3){_0x58d40e=_0x58d40e-0x0;var _0x330b1a=_0x5f2f[_0x58d40e];return _0x330b1a;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'dialNoAnswerRetryFrequency',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'dialDropMaxRetry',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'dialMachineMaxRetry',_0xf5f2('0x14'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xf5f2('0x15'),_0xf5f2('0x16'),'dialAMDActive',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'dialAMDMaximumNumberOfWords',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21'),'dialCutDigit'],'include':[{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x22'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x24'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x25'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x26'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x27')]}]},{'model':'SquareProject','as':_0xf5f2('0x28'),'attributes':['id',_0xf5f2('0x4')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index 8c99af3..c295ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d6f=['CreateCmContact','getContacts','GetCmContact','../client','createContact','Request'];(function(_0x319a03,_0x4456d4){var _0x3b6704=function(_0x1f3476){while(--_0x1f3476){_0x319a03['push'](_0x319a03['shift']());}};_0x3b6704(++_0x4456d4);}(_0x3d6f,0x10b));var _0xf3d6=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0x3d6f[_0x2c753c];return _0x23ba20;};'use strict';var client=require(_0xf3d6('0x0'));exports[_0xf3d6('0x1')]=function(_0x13afe9){return function(){return client[_0xf3d6('0x2')](_0xf3d6('0x3'),{'body':_0x13afe9,'log':_0xf3d6('0x3')});};};exports[_0xf3d6('0x4')]=function(_0xeb7f1e){return function(){return client[_0xf3d6('0x2')]('GetCmContact',{'options':_0xeb7f1e,'log':_0xf3d6('0x5')});};};
\ No newline at end of file
+var _0x47e8=['getContacts','Request','GetCmContact','createContact','CreateCmContact'];(function(_0x3eef2e,_0x1ac1c3){var _0x3605a3=function(_0x322af3){while(--_0x322af3){_0x3eef2e['push'](_0x3eef2e['shift']());}};_0x3605a3(++_0x1ac1c3);}(_0x47e8,0x125));var _0x847e=function(_0x2badac,_0x4b93fa){_0x2badac=_0x2badac-0x0;var _0x28276c=_0x47e8[_0x2badac];return _0x28276c;};'use strict';var client=require('../client');exports[_0x847e('0x0')]=function(_0x5b7c9b){return function(){return client['Request'](_0x847e('0x1'),{'body':_0x5b7c9b,'log':_0x847e('0x1')});};};exports[_0x847e('0x2')]=function(_0x28b633){return function(){return client[_0x847e('0x3')]('GetCmContact',{'options':_0x28b633,'log':_0x847e('0x4')});};};
\ No newline at end of file
index 06ba076..a358414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ce=['CmContact','updateContacts','Request','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','scheduledat','ASC','getContactDialerIvr','Contact','DESC','moveContactManagedDialer','campaign','queue','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue','Queue','getCmHopper','unlockContact','voicePause','db.CmHopper.UserId','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','moment','getContacts'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x24ce,0x1de));var _0xe24c=function(_0x4593a3,_0x15e23f){_0x4593a3=_0x4593a3-0x0;var _0x993b4c=_0x24ce[_0x4593a3];return _0x993b4c;};'use strict';var client=require('../client');var moment=require(_0xe24c('0x0'));exports[_0xe24c('0x1')]=function(_0x3df739,_0x1ce128){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x3df739},'include':[{'model':_0xe24c('0x2'),'as':'Contact'}],'limit':_0x1ce128,'raw':![]},'log':'getCmHopper'});};};exports[_0xe24c('0x3')]=function(_0x18e92c,_0x6f92e0,_0x1ac59c){return function(){return client[_0xe24c('0x4')]('UpdateCmHopper',{'body':_0x18e92c,'options':{'where':{'VoiceQueueId':_0x6f92e0,'scheduledat':{'$lte':moment()[_0xe24c('0x5')](_0xe24c('0x6'))}},'limit':_0x1ac59c},'log':_0xe24c('0x7')});};};exports[_0xe24c('0x8')]=function(_0x2df0eb){return client[_0xe24c('0x4')](_0xe24c('0x7'),{'body':_0x2df0eb,'options':{'where':{'ContactId':_0x2df0eb[_0xe24c('0x9')],'ListId':_0x2df0eb[_0xe24c('0xa')],'VoiceQueueId':_0x2df0eb[_0xe24c('0xb')],'CampaignId':_0x2df0eb[_0xe24c('0xc')]}},'log':_0xe24c('0x8')});};exports[_0xe24c('0xd')]=function(_0x49fc72,_0x1dc586,_0x487e3b){return function(){return client[_0xe24c('0x4')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x49fc72,'ListId':_0x1dc586,'ContactId':_0x487e3b}},'log':_0xe24c('0xe')});};};exports[_0xe24c('0xf')]=function(_0x546b16,_0x572824,_0x4d3b73,_0x3f0955){return client['Request'](_0xe24c('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x546b16,'active':![],'scheduledat':{'$lte':moment()[_0xe24c('0x5')](_0xe24c('0x6'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x572824}}]},'order':[[_0xe24c('0x11'),'DESC'],[_0xe24c('0x12'),_0x3f0955],['id',_0xe24c('0x13')]],'raw':!![],'limit':_0x4d3b73},'log':_0xe24c('0x10')});};exports[_0xe24c('0x14')]=function(_0x261609,_0x2445df,_0xbd9e1d){return client[_0xe24c('0x4')](_0xe24c('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x261609,'active':![],'scheduledat':{'$lte':moment()[_0xe24c('0x5')](_0xe24c('0x6'))}},'include':[{'model':_0xe24c('0x2'),'as':_0xe24c('0x15')}],'order':[['priority',_0xe24c('0x16')],[_0xe24c('0x12'),_0xbd9e1d],['id',_0xe24c('0x13')]],'raw':!![],'limit':_0x2445df},'log':'GetContactDialerIvr'});};exports[_0xe24c('0x17')]=function(_0x258d10,_0x2462f2){_0x258d10[_0xe24c('0x18')]=_0x258d10[_0xe24c('0x19')];return client[_0xe24c('0x4')]('MoveContactManagedDialer',{'body':_0x258d10,'options':{'where':{'ContactId':_0x258d10['ContactId'],'ListId':_0x258d10['ListId'],'VoiceQueueId':_0x258d10[_0xe24c('0xb')],'CampaignId':_0x258d10['CampaignId'],'active':_0x2462f2?undefined:!![]}},'log':'MoveContactManagedDialer'});};exports[_0xe24c('0x1a')]=function(_0x2edb8f){return client[_0xe24c('0x4')](_0xe24c('0x1b'),{'options':{'where':{'VoiceQueueId':_0x2edb8f['id']?_0x2edb8f['id']||null:null}},'log':_0xe24c('0x1a')});};exports[_0xe24c('0x1c')]=function(_0x20b8e1){return function(){return client[_0xe24c('0x4')](_0xe24c('0x1d'),{'options':{'where':{'id':_0x20b8e1},'include':[{'model':_0xe24c('0x2'),'as':_0xe24c('0x15')},{'model':'User','as':_0xe24c('0x1e'),'attributes':['id',_0xe24c('0x1f')]},{'model':_0xe24c('0x20'),'as':_0xe24c('0x21'),'attributes':['id',_0xe24c('0x1f')]}],'raw':!![]},'log':_0xe24c('0x22')});};};exports[_0xe24c('0x23')]=function(_0x3f7494,_0x28f2bd,_0x2c1e57){return client['Request'](_0xe24c('0x7'),{'body':_0x3f7494,'options':{'where':{'id':_0x28f2bd},'limit':_0x2c1e57},'log':_0xe24c('0x7')});};exports['getContactRecallMe']=function(_0x318972,_0x2f291a){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x318972,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xe24c('0x5')](_0xe24c('0x6'))},'UserId':{'$in':_0x2f291a}},'order':[[_0xe24c('0x11'),'DESC'],[_0xe24c('0x12'),'DESC'],['id','ASC']],'include':[{'model':_0xe24c('0x2'),'as':_0xe24c('0x15')},{'model':'User','as':'Agent','attributes':['id',_0xe24c('0x1f'),_0xe24c('0x24')]}],'group':_0xe24c('0x25'),'raw':!![]},'log':_0xe24c('0x10')});};};exports['resetActiveCalls']=function(_0x5ce3b9,_0x4dc4cf){return client[_0xe24c('0x4')](_0xe24c('0x26'),{'body':_0x5ce3b9,'options':_0x4dc4cf||{},'log':_0xe24c('0x26')});};exports['handlePreviewRecallNotifications']=function(_0x1fccad,_0x290e0b,_0x265eed){return function(){return client[_0xe24c('0x4')](_0xe24c('0x27'),{'body':{'where':{'voiceQueueIds':_0x1fccad,'interval':_0x290e0b,'availableAgentsIds':_0x265eed}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
+var _0x1a0b=['DESC','scheduledat','ASC','getContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','unlockContact','getContactRecallMe','GetContactRecallMe','db.CmHopper.UserId','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','YYYY-MM-DD\x20HH:mm:ss','priority'];(function(_0x2fca3c,_0xbe8fa5){var _0x1d8d95=function(_0x3abf22){while(--_0x3abf22){_0x2fca3c['push'](_0x2fca3c['shift']());}};_0x1d8d95(++_0xbe8fa5);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x1aed01,_0x33502a){_0x1aed01=_0x1aed01-0x0;var _0x67da35=_0x1a0b[_0x1aed01];return _0x67da35;};'use strict';var client=require(_0xb1a0('0x0'));var moment=require('moment');exports[_0xb1a0('0x1')]=function(_0x4045d3,_0x292b7e){return function(){return client[_0xb1a0('0x2')](_0xb1a0('0x3'),{'options':{'where':{'VoiceQueueId':_0x4045d3},'include':[{'model':_0xb1a0('0x4'),'as':_0xb1a0('0x5')}],'limit':_0x292b7e,'raw':![]},'log':_0xb1a0('0x6')});};};exports[_0xb1a0('0x7')]=function(_0x31c4f3,_0x2467a5,_0x598ff3){return function(){return client['Request'](_0xb1a0('0x8'),{'body':_0x31c4f3,'options':{'where':{'VoiceQueueId':_0x2467a5,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x598ff3},'log':_0xb1a0('0x8')});};};exports[_0xb1a0('0x9')]=function(_0x3273c2){return client['Request']('UpdateCmHopper',{'body':_0x3273c2,'options':{'where':{'ContactId':_0x3273c2[_0xb1a0('0xa')],'ListId':_0x3273c2[_0xb1a0('0xb')],'VoiceQueueId':_0x3273c2[_0xb1a0('0xc')],'CampaignId':_0x3273c2[_0xb1a0('0xd')]}},'log':_0xb1a0('0x9')});};exports[_0xb1a0('0xe')]=function(_0x5a2338,_0x125e5e,_0x5d1ac9){return function(){return client[_0xb1a0('0x2')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x5a2338,'ListId':_0x125e5e,'ContactId':_0x5d1ac9}},'log':_0xb1a0('0xf')});};};exports[_0xb1a0('0x10')]=function(_0x2d034e,_0x180c44,_0x47f82a,_0x236504){return client[_0xb1a0('0x2')](_0xb1a0('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2d034e,'active':![],'scheduledat':{'$lte':moment()[_0xb1a0('0x12')](_0xb1a0('0x13'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x180c44}}]},'order':[[_0xb1a0('0x14'),_0xb1a0('0x15')],[_0xb1a0('0x16'),_0x236504],['id',_0xb1a0('0x17')]],'raw':!![],'limit':_0x47f82a},'log':_0xb1a0('0x11')});};exports[_0xb1a0('0x18')]=function(_0x65f9b3,_0x2bbb14,_0x3e6d71){return client[_0xb1a0('0x2')](_0xb1a0('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x65f9b3,'active':![],'scheduledat':{'$lte':moment()[_0xb1a0('0x12')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':'Contact'}],'order':[['priority','DESC'],['scheduledat',_0x3e6d71],['id','ASC']],'raw':!![],'limit':_0x2bbb14},'log':'GetContactDialerIvr'});};exports[_0xb1a0('0x19')]=function(_0xe0d8ce,_0x3af888){_0xe0d8ce['campaign']=_0xe0d8ce[_0xb1a0('0x1a')];return client[_0xb1a0('0x2')](_0xb1a0('0x1b'),{'body':_0xe0d8ce,'options':{'where':{'ContactId':_0xe0d8ce['ContactId'],'ListId':_0xe0d8ce[_0xb1a0('0xb')],'VoiceQueueId':_0xe0d8ce['VoiceQueueId'],'CampaignId':_0xe0d8ce[_0xb1a0('0xd')],'active':_0x3af888?undefined:!![]}},'log':_0xb1a0('0x1b')});};exports[_0xb1a0('0x1c')]=function(_0x1a306d){return client['Request'](_0xb1a0('0x1d'),{'options':{'where':{'VoiceQueueId':_0x1a306d['id']?_0x1a306d['id']||null:null}},'log':'countReScheduled'});};exports[_0xb1a0('0x1e')]=function(_0x44941e){return function(){return client[_0xb1a0('0x2')](_0xb1a0('0x1f'),{'options':{'where':{'id':_0x44941e},'include':[{'model':_0xb1a0('0x4'),'as':_0xb1a0('0x5')},{'model':_0xb1a0('0x20'),'as':_0xb1a0('0x21'),'attributes':['id',_0xb1a0('0x22')]},{'model':'VoiceQueue','as':'Queue','attributes':['id',_0xb1a0('0x22')]}],'raw':!![]},'log':_0xb1a0('0x6')});};};exports[_0xb1a0('0x23')]=function(_0x480854,_0x1d5f19,_0x4b3fe8){return client[_0xb1a0('0x2')]('UpdateCmHopper',{'body':_0x480854,'options':{'where':{'id':_0x1d5f19},'limit':_0x4b3fe8},'log':_0xb1a0('0x8')});};exports[_0xb1a0('0x24')]=function(_0x42ee38,_0x3a6c03){return function(){return client[_0xb1a0('0x2')](_0xb1a0('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x42ee38,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xb1a0('0x12')](_0xb1a0('0x13'))},'UserId':{'$in':_0x3a6c03}},'order':[[_0xb1a0('0x14'),'DESC'],[_0xb1a0('0x16'),_0xb1a0('0x15')],['id',_0xb1a0('0x17')]],'include':[{'model':_0xb1a0('0x4'),'as':_0xb1a0('0x5')},{'model':_0xb1a0('0x20'),'as':_0xb1a0('0x21'),'attributes':['id','name','voicePause']}],'group':_0xb1a0('0x26'),'raw':!![]},'log':_0xb1a0('0x11')});};};exports['resetActiveCalls']=function(_0x42008f,_0x36c9a2){return client[_0xb1a0('0x2')](_0xb1a0('0x27'),{'body':_0x42008f,'options':_0x36c9a2||{},'log':_0xb1a0('0x27')});};exports[_0xb1a0('0x28')]=function(_0x461ef9,_0x22f4b8,_0x39e4f2){return function(){return client[_0xb1a0('0x2')](_0xb1a0('0x29'),{'body':{'where':{'voiceQueueIds':_0x461ef9,'interval':_0x22f4b8,'availableAgentsIds':_0x39e4f2}},'log':_0xb1a0('0x28')});};};
\ No newline at end of file
index e6fcd38..d624692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa35f=['verifyAdditionalPhones','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','IncrementPreviewCounters'];(function(_0x22c1cf,_0x4215d3){var _0x8a8ae0=function(_0x42a229){while(--_0x42a229){_0x22c1cf['push'](_0x22c1cf['shift']());}};_0x8a8ae0(++_0x4215d3);}(_0xa35f,0x11a));var _0xfa35=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xa35f[_0x578275];return _0xf78041;};'use strict';var client=require('../client');exports[_0xfa35('0x0')]=function(_0x50718f,_0x5c6173,_0x3bf8d9){return client[_0xfa35('0x1')](_0xfa35('0x2'),{'body':_0x50718f,'reason':_0x5c6173,'entity':_0x3bf8d9,'log':_0xfa35('0x2')});};exports[_0xfa35('0x3')]=function(_0x1d28bd,_0x41db07,_0x58cc6f){return client[_0xfa35('0x1')](_0xfa35('0x4'),{'body':_0x1d28bd,'duration':_0x41db07,'waitTime':_0x58cc6f,'log':'SwapAdditionalPhones'});};exports['incrementPreviewCounters']=function(_0x26f291){return function(){return client[_0xfa35('0x1')](_0xfa35('0x5'),{'body':_0x26f291,'log':_0xfa35('0x5')});};};
\ No newline at end of file
+var _0xc10a=['incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones','VerifyAdditionalPhones','Request','SwapAdditionalPhones'];(function(_0x20d08e,_0x4cc575){var _0x2cbd12=function(_0x3de355){while(--_0x3de355){_0x20d08e['push'](_0x20d08e['shift']());}};_0x2cbd12(++_0x4cc575);}(_0xc10a,0x167));var _0xac10=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0xc10a[_0x5ee3d3];return _0x4b272f;};'use strict';var client=require(_0xac10('0x0'));exports[_0xac10('0x1')]=function(_0x435b50,_0x392d1c,_0x169b5c){return client['Request'](_0xac10('0x2'),{'body':_0x435b50,'reason':_0x392d1c,'entity':_0x169b5c,'log':_0xac10('0x2')});};exports['swapAdditionalPhones']=function(_0x31215b,_0x4bbe90,_0x30af08){return client[_0xac10('0x3')](_0xac10('0x4'),{'body':_0x31215b,'duration':_0x4bbe90,'waitTime':_0x30af08,'log':'SwapAdditionalPhones'});};exports[_0xac10('0x5')]=function(_0x427b1e){return function(){return client['Request'](_0xac10('0x6'),{'body':_0x427b1e,'log':'IncrementPreviewCounters'});};};
\ No newline at end of file
index eed5e2b..9327fb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c21=['../client','checkIsBlackList','Request','VoiceQueueId','phone','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr'];(function(_0x4046b9,_0x4ef479){var _0x4a17e0=function(_0x4ac9fe){while(--_0x4ac9fe){_0x4046b9['push'](_0x4046b9['shift']());}};_0x4a17e0(++_0x4ef479);}(_0x9c21,0xe1));var _0x19c2=function(_0x200d6b,_0x30fae0){_0x200d6b=_0x200d6b-0x0;var _0x4e2611=_0x9c21[_0x200d6b];return _0x4e2611;};'use strict';var client=require(_0x19c2('0x0'));exports[_0x19c2('0x1')]=function(_0x11ffa6){return client[_0x19c2('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x11ffa6[_0x19c2('0x3')],'phone':_0x11ffa6[_0x19c2('0x4')]},'raw':![]},'log':_0x19c2('0x5')});};exports[_0x19c2('0x6')]=function(_0x286563){return function(){return client['Request'](_0x19c2('0x5'),{'options':{'where':{'CampaignId':_0x286563[_0x19c2('0x7')],'phone':_0x286563['phone']},'raw':![]},'log':_0x19c2('0x8')});};};
\ No newline at end of file
+var _0x832b=['CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','VoiceQueueId','phone','GetCmHopperBlack','checkIsBlackListIvr'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x832b,0x1bb));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb832('0x0'));exports[_0xb832('0x1')]=function(_0x3edf98){return client[_0xb832('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x3edf98[_0xb832('0x3')],'phone':_0x3edf98[_0xb832('0x4')]},'raw':![]},'log':_0xb832('0x5')});};exports[_0xb832('0x6')]=function(_0x1dbfe1){return function(){return client[_0xb832('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x1dbfe1[_0xb832('0x7')],'phone':_0x1dbfe1[_0xb832('0x4')]},'raw':![]},'log':_0xb832('0x8')});};};
\ No newline at end of file
index 8e72c7c..7d9e805 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f3=['../client','createContact','campaign','queue','Request','CreateCmHopperFinal'];(function(_0x36c270,_0x2569ff){var _0x276c73=function(_0x27ea41){while(--_0x27ea41){_0x36c270['push'](_0x36c270['shift']());}};_0x276c73(++_0x2569ff);}(_0x28f3,0x96));var _0x328f=function(_0x1e7e1f,_0x121fb8){_0x1e7e1f=_0x1e7e1f-0x0;var _0x4abade=_0x28f3[_0x1e7e1f];return _0x4abade;};'use strict';var client=require(_0x328f('0x0'));exports[_0x328f('0x1')]=function(_0x5ce24b){return function(){_0x5ce24b[_0x328f('0x2')]=_0x5ce24b[_0x328f('0x3')];return client[_0x328f('0x4')](_0x328f('0x5'),{'body':_0x5ce24b,'log':_0x328f('0x5')});};};
\ No newline at end of file
+var _0xb2d2=['CreateCmHopperFinal','../client','createContact','campaign','Request'];(function(_0x26c867,_0x3b1622){var _0x59fe07=function(_0x2dcb04){while(--_0x2dcb04){_0x26c867['push'](_0x26c867['shift']());}};_0x59fe07(++_0x3b1622);}(_0xb2d2,0x119));var _0x2b2d=function(_0x4d725a,_0x53eb83){_0x4d725a=_0x4d725a-0x0;var _0x4d6500=_0xb2d2[_0x4d725a];return _0x4d6500;};'use strict';var client=require(_0x2b2d('0x0'));exports[_0x2b2d('0x1')]=function(_0x380c54){return function(){_0x380c54[_0x2b2d('0x2')]=_0x380c54['queue'];return client[_0x2b2d('0x3')](_0x2b2d('0x4'),{'body':_0x380c54,'log':_0x2b2d('0x4')});};};
\ No newline at end of file
index 3255342..f61eac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e61=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','ivr','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','AvgHandleTime','subtract','minutes','format'];(function(_0x4f06a3,_0x3d875c){var _0x5565b7=function(_0xa85ad6){while(--_0xa85ad6){_0x4f06a3['push'](_0x4f06a3['shift']());}};_0x5565b7(++_0x3d875c);}(_0x2e61,0x11b));var _0x12e6=function(_0x37fa30,_0x54838e){_0x37fa30=_0x37fa30-0x0;var _0x504218=_0x2e61[_0x37fa30];return _0x504218;};'use strict';var client=require(_0x12e6('0x0'));var moment=require(_0x12e6('0x1'));exports[_0x12e6('0x2')]=function(_0xed8a31){_0xed8a31[_0x12e6('0x3')]=_0xed8a31[_0x12e6('0x4')];return client[_0x12e6('0x5')](_0x12e6('0x6'),{'body':_0xed8a31,'log':_0x12e6('0x6')});};exports['avgHandleTime']=function(_0x452397){return client[_0x12e6('0x5')](_0x12e6('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x12e6('0x8')](_0x452397,_0x12e6('0x9'))[_0x12e6('0xa')](_0x12e6('0xb')),moment()[_0x12e6('0xa')](_0x12e6('0xb'))]}},'raw':![]},'log':_0x12e6('0xc')});};exports[_0x12e6('0xd')]=function(){return function(){return client[_0x12e6('0x5')](_0x12e6('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x12e6('0xf')](_0x12e6('0x10'))[_0x12e6('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')['format'](_0x12e6('0xb'))]},'campaigntype':_0x12e6('0x4')},'raw':![]},'log':_0x12e6('0xe')});};};exports[_0x12e6('0x11')]=function(){return function(){return client['Request'](_0x12e6('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x12e6('0xf')](_0x12e6('0x10'))[_0x12e6('0xa')](_0x12e6('0xb')),moment()[_0x12e6('0x13')](_0x12e6('0x10'))[_0x12e6('0xa')](_0x12e6('0xb'))]},'campaigntype':_0x12e6('0x14')},'raw':![]},'log':_0x12e6('0x12')});};};
\ No newline at end of file
+var _0x2dac=['minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','ivr','GetCampaignHopperHistory','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2dac,0x14c));var _0xc2da=function(_0x8355e1,_0x37553d){_0x8355e1=_0x8355e1-0x0;var _0x11dac8=_0x2dac[_0x8355e1];return _0x11dac8;};'use strict';var client=require('../client');var moment=require(_0xc2da('0x0'));exports[_0xc2da('0x1')]=function(_0x2328f7){_0x2328f7[_0xc2da('0x2')]=_0x2328f7[_0xc2da('0x3')];return client[_0xc2da('0x4')](_0xc2da('0x5'),{'body':_0x2328f7,'log':'CreateCmHopperHistory'});};exports[_0xc2da('0x6')]=function(_0x1ab2fa){return client[_0xc2da('0x4')](_0xc2da('0x7'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x1ab2fa,_0xc2da('0x8'))[_0xc2da('0x9')](_0xc2da('0xa')),moment()['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0xc2da('0xb')});};exports[_0xc2da('0xc')]=function(){return function(){return client[_0xc2da('0x4')](_0xc2da('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xc2da('0xe')](_0xc2da('0xf'))['format'](_0xc2da('0xa')),moment()[_0xc2da('0x10')](_0xc2da('0xf'))[_0xc2da('0x9')](_0xc2da('0xa'))]},'campaigntype':_0xc2da('0x3')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xc2da('0x11')]=function(){return function(){return client[_0xc2da('0x4')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xc2da('0xe')](_0xc2da('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xc2da('0xf'))[_0xc2da('0x9')](_0xc2da('0xa'))]},'campaigntype':_0xc2da('0x12')},'raw':![]},'log':_0xc2da('0x13')});};};
\ No newline at end of file
index 501dd23..dc765af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb7e=['description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xdb7e,0x11a));var _0xedb7=function(_0x4a84d8,_0x17f37a){_0x4a84d8=_0x4a84d8-0x0;var _0x5b873d=_0xdb7e[_0x4a84d8];return _0x5b873d;};'use strict';var client=require(_0xedb7('0x0'));exports[_0xedb7('0x1')]=function(){return function(){return client[_0xedb7('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xedb7('0x3'),_0xedb7('0x4'),_0xedb7('0x5'),'headerinfo',_0xedb7('0x6'),_0xedb7('0x7'),_0xedb7('0x8'),_0xedb7('0x9'),_0xedb7('0xa'),_0xedb7('0xb'),_0xedb7('0xc'),_0xedb7('0xd'),_0xedb7('0xe'),_0xedb7('0xf'),'key'],'include':[{'model':_0xedb7('0x10'),'as':_0xedb7('0x10'),'attributes':['id',_0xedb7('0x3'),_0xedb7('0x11'),_0xedb7('0x12')]}]},'log':_0xedb7('0x13')});};};exports[_0xedb7('0x14')]=function(_0x10b19d,_0x103da0){return client[_0xedb7('0x2')](_0xedb7('0x15'),{'account':{'id':_0x10b19d},'body':_0x103da0,'log':_0xedb7('0x15')});};
\ No newline at end of file
+var _0x341c=['callerid','active','getFaxAccount','NotifyFaxAccount','../client','Request','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','tech','TrunkId','ListId','Trunk'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x341c,0xcc));var _0xc341=function(_0xa99357,_0x50ffad){_0xa99357=_0xa99357-0x0;var _0x111875=_0x341c[_0xa99357];return _0x111875;};'use strict';var client=require(_0xc341('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0xc341('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xc341('0x2'),_0xc341('0x3'),_0xc341('0x4'),_0xc341('0x5'),_0xc341('0x6'),_0xc341('0x7'),_0xc341('0x8'),_0xc341('0x9'),'gateway',_0xc341('0xa'),_0xc341('0xb'),_0xc341('0xc'),_0xc341('0xd'),_0xc341('0xe'),'key'],'include':[{'model':_0xc341('0xf'),'as':_0xc341('0xf'),'attributes':['id',_0xc341('0x2'),_0xc341('0x10'),_0xc341('0x11')]}]},'log':_0xc341('0x12')});};};exports['notify']=function(_0x2d08da,_0x23418f){return client[_0xc341('0x1')](_0xc341('0x13'),{'account':{'id':_0x2d08da},'body':_0x23418f,'log':_0xc341('0x13')});};
\ No newline at end of file
index 182a2cb..de555b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe00f=['../client','update','Request','UpdateFaxMessage'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe00f,0xcc));var _0xfe00=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe00f[_0x24237f];return _0x48298e;};'use strict';var client=require(_0xfe00('0x0'));exports[_0xfe00('0x1')]=function(_0x4db8ef,_0x1c8e42){return client[_0xfe00('0x2')]('UpdateFaxMessage',{'body':_0x1c8e42,'options':{'where':{'AttachmentId':_0x4db8ef}},'log':_0xfe00('0x3')});};
\ No newline at end of file
+var _0xe94b=['Request','UpdateFaxMessage','../client','update'];(function(_0x164ee3,_0x9b865e){var _0x4e04f3=function(_0x5751e3){while(--_0x5751e3){_0x164ee3['push'](_0x164ee3['shift']());}};_0x4e04f3(++_0x9b865e);}(_0xe94b,0x182));var _0xbe94=function(_0x1256cf,_0x359628){_0x1256cf=_0x1256cf-0x0;var _0x1d16b7=_0xe94b[_0x1256cf];return _0x1d16b7;};'use strict';var client=require(_0xbe94('0x0'));exports[_0xbe94('0x1')]=function(_0x27c273,_0x121786){return client[_0xbe94('0x2')](_0xbe94('0x3'),{'body':_0x121786,'options':{'where':{'AttachmentId':_0x27c273}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index ae9ddd9..9480f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe173=['nameField','customField','Tag','../../client','getDeskAccounts','Request','GetDeskAccount','name','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','variableName','Variable','Descriptions','content','key','keyType','idField'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe173,0xf3));var _0x3e17=function(_0x3e59d0,_0x48366c){_0x3e59d0=_0x3e59d0-0x0;var _0x13a891=_0xe173[_0x3e59d0];return _0x13a891;};'use strict';var client=require(_0x3e17('0x0'));exports[_0x3e17('0x1')]=function(){return function(_0xe4fcac){return client[_0x3e17('0x2')](_0x3e17('0x3'),{'options':{'raw':![],'attributes':['id',_0x3e17('0x4'),'description',_0x3e17('0x5'),_0x3e17('0x6'),_0x3e17('0x7'),_0x3e17('0x8'),_0x3e17('0x9'),_0x3e17('0xa')],'include':[{'model':_0x3e17('0xb'),'as':_0x3e17('0xc'),'attributes':['id',_0x3e17('0x4')],'include':[{'model':_0x3e17('0xd'),'as':'Subjects','attributes':['id',_0x3e17('0x9'),'content',_0x3e17('0xe')],'include':[{'model':'Variable','as':_0x3e17('0xf'),'attributes':['id',_0x3e17('0x4')]}]},{'model':'DeskField','as':_0x3e17('0x10'),'attributes':['id',_0x3e17('0x9'),_0x3e17('0x11'),_0x3e17('0x12'),_0x3e17('0x13'),'keyContent',_0x3e17('0xe')],'include':[{'model':_0x3e17('0xf'),'as':_0x3e17('0xf'),'attributes':['id','name']}]},{'model':_0x3e17('0xd'),'as':'Fields','attributes':['id',_0x3e17('0x9'),'content',_0x3e17('0x14'),_0x3e17('0x15'),_0x3e17('0x16'),_0x3e17('0xe')],'include':[{'model':_0x3e17('0xf'),'as':_0x3e17('0xf'),'attributes':['id','name']}]},{'model':_0x3e17('0x17'),'as':'Tags','attributes':['id',_0x3e17('0x4')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
+var _0x7235=['Fields','idField','nameField','customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','variableName','Variable','Descriptions','content','key','keyType','keyContent'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x7235,0x145));var _0x5723=function(_0x19c6f0,_0x3f74b5){_0x19c6f0=_0x19c6f0-0x0;var _0x1cd4e1=_0x7235[_0x19c6f0];return _0x1cd4e1;};'use strict';var client=require(_0x5723('0x0'));exports[_0x5723('0x1')]=function(){return function(_0x119962){return client[_0x5723('0x2')](_0x5723('0x3'),{'options':{'raw':![],'attributes':['id',_0x5723('0x4'),_0x5723('0x5'),_0x5723('0x6'),_0x5723('0x7'),_0x5723('0x8'),_0x5723('0x9'),_0x5723('0xa'),_0x5723('0xb')],'include':[{'model':_0x5723('0xc'),'as':_0x5723('0xd'),'attributes':['id',_0x5723('0x4')],'include':[{'model':_0x5723('0xe'),'as':_0x5723('0xf'),'attributes':['id',_0x5723('0xa'),'content',_0x5723('0x10')],'include':[{'model':_0x5723('0x11'),'as':'Variable','attributes':['id',_0x5723('0x4')]}]},{'model':_0x5723('0xe'),'as':_0x5723('0x12'),'attributes':['id',_0x5723('0xa'),_0x5723('0x13'),_0x5723('0x14'),_0x5723('0x15'),_0x5723('0x16'),'variableName'],'include':[{'model':'Variable','as':_0x5723('0x11'),'attributes':['id','name']}]},{'model':_0x5723('0xe'),'as':_0x5723('0x17'),'attributes':['id',_0x5723('0xa'),_0x5723('0x13'),_0x5723('0x18'),_0x5723('0x19'),_0x5723('0x1a'),_0x5723('0x10')],'include':[{'model':_0x5723('0x11'),'as':_0x5723('0x11'),'attributes':['id',_0x5723('0x4')]}]},{'model':_0x5723('0x1b'),'as':_0x5723('0x1c'),'attributes':['id','name']}]}]},'log':_0x5723('0x3')});};};
\ No newline at end of file
index 3eba6c1..022671a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd523=['Fields','type','idField','nameField','customField','CloudProvider','data5','data7','GetDynamics365Account','../../client','getDynamics365Accounts','Request','name','username','password','tenantId','clientId','clientSecret','serverUrl','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','openNewTab','Dynamics365Field','Subjects','content','variableName','Variable','Descriptions','key','keyType'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xd523,0x153));var _0x3d52=function(_0xe01018,_0x5431fe){_0xe01018=_0xe01018-0x0;var _0xa8b323=_0xd523[_0xe01018];return _0xa8b323;};'use strict';var client=require(_0x3d52('0x0'));exports[_0x3d52('0x1')]=function(){return function(_0x3d35b0){return client[_0x3d52('0x2')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x3d52('0x3'),_0x3d52('0x4'),_0x3d52('0x5'),'remoteUri',_0x3d52('0x6'),_0x3d52('0x7'),_0x3d52('0x8'),_0x3d52('0x9'),'description','modernAuthentication'],'include':[{'model':_0x3d52('0xa'),'as':_0x3d52('0xb'),'attributes':['id',_0x3d52('0x3'),_0x3d52('0xc'),_0x3d52('0xd'),_0x3d52('0xe'),_0x3d52('0xf')],'include':[{'model':_0x3d52('0x10'),'as':_0x3d52('0x11'),'attributes':['id','type',_0x3d52('0x12'),_0x3d52('0x13')],'include':[{'model':_0x3d52('0x14'),'as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]},{'model':'Dynamics365Field','as':_0x3d52('0x15'),'attributes':['id','type','content',_0x3d52('0x16'),_0x3d52('0x17'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]},{'model':_0x3d52('0x10'),'as':_0x3d52('0x18'),'attributes':['id',_0x3d52('0x19'),_0x3d52('0x12'),_0x3d52('0x1a'),_0x3d52('0x1b'),_0x3d52('0x1c'),_0x3d52('0x13')],'include':[{'model':_0x3d52('0x14'),'as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]}]},{'model':_0x3d52('0x1d'),'as':_0x3d52('0x1d'),'attributes':['id','data2',_0x3d52('0x1e'),_0x3d52('0x1f')]}]},'log':_0x3d52('0x20')});};};
\ No newline at end of file
+var _0x26f9=['Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','nameField','customField','data2','data5','GetDynamics365Account','../../client','getDynamics365Accounts','Request','username','password','tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','name','ticketType','additionalSearchContact','Dynamics365Field'];(function(_0x5642ad,_0x3d7243){var _0x4c1041=function(_0x2a889b){while(--_0x2a889b){_0x5642ad['push'](_0x5642ad['shift']());}};_0x4c1041(++_0x3d7243);}(_0x26f9,0x16f));var _0x926f=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x26f9[_0x23e6bb];return _0x1e3b4c;};'use strict';var client=require(_0x926f('0x0'));exports[_0x926f('0x1')]=function(){return function(_0x4fdca2){return client[_0x926f('0x2')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id','name',_0x926f('0x3'),_0x926f('0x4'),'remoteUri',_0x926f('0x5'),_0x926f('0x6'),_0x926f('0x7'),_0x926f('0x8'),_0x926f('0x9'),_0x926f('0xa')],'include':[{'model':_0x926f('0xb'),'as':_0x926f('0xc'),'attributes':['id',_0x926f('0xd'),_0x926f('0xe'),'moduleCreate',_0x926f('0xf'),'openNewTab'],'include':[{'model':_0x926f('0x10'),'as':_0x926f('0x11'),'attributes':['id','type',_0x926f('0x12'),_0x926f('0x13')],'include':[{'model':_0x926f('0x14'),'as':_0x926f('0x14'),'attributes':['id',_0x926f('0xd')]}]},{'model':'Dynamics365Field','as':_0x926f('0x15'),'attributes':['id',_0x926f('0x16'),_0x926f('0x12'),_0x926f('0x17'),_0x926f('0x18'),_0x926f('0x19'),_0x926f('0x13')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x926f('0x10'),'as':_0x926f('0x1a'),'attributes':['id',_0x926f('0x16'),_0x926f('0x12'),'idField',_0x926f('0x1b'),_0x926f('0x1c'),'variableName'],'include':[{'model':_0x926f('0x14'),'as':'Variable','attributes':['id',_0x926f('0xd')]}]}]},{'model':'CloudProvider','as':'CloudProvider','attributes':['id',_0x926f('0x1d'),_0x926f('0x1e'),'data7']}]},'log':_0x926f('0x1f')});};};
\ No newline at end of file
index 6f6c6b2..350f50c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4157=['serverUrl','FreshdeskConfiguration','Configurations','name','Tag','Subjects','content','Variable','FreshdeskField','Descriptions','type','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','username','apiKey','remoteUri'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0x4157,0xf3));var _0x7415=function(_0x351b0f,_0x1d16ff){_0x351b0f=_0x351b0f-0x0;var _0x21fcb4=_0x4157[_0x351b0f];return _0x21fcb4;};'use strict';var client=require(_0x7415('0x0'));exports[_0x7415('0x1')]=function(){return function(_0x325318){return client[_0x7415('0x2')](_0x7415('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7415('0x4'),_0x7415('0x5'),_0x7415('0x6'),_0x7415('0x7')],'include':[{'model':_0x7415('0x8'),'as':_0x7415('0x9'),'attributes':['id',_0x7415('0xa')],'include':[{'model':_0x7415('0xb'),'attributes':['id',_0x7415('0xa')]},{'model':'FreshdeskField','as':_0x7415('0xc'),'attributes':['id','type',_0x7415('0xd'),'variableName'],'include':[{'model':_0x7415('0xe'),'as':_0x7415('0xe'),'attributes':['id',_0x7415('0xa')]}]},{'model':_0x7415('0xf'),'as':_0x7415('0x10'),'attributes':['id',_0x7415('0x11'),_0x7415('0xd'),'key',_0x7415('0x12'),_0x7415('0x13'),_0x7415('0x14')],'include':[{'model':_0x7415('0xe'),'as':_0x7415('0xe'),'attributes':['id','name']}]},{'model':_0x7415('0xf'),'as':_0x7415('0x15'),'attributes':['id',_0x7415('0x11'),_0x7415('0xd'),_0x7415('0x16'),_0x7415('0x17'),_0x7415('0x18'),_0x7415('0x14')],'include':[{'model':_0x7415('0xe'),'as':_0x7415('0xe'),'attributes':['id',_0x7415('0xa')]}]}]}]},'log':_0x7415('0x3')});};};
\ No newline at end of file
+var _0x00ea=['remoteUri','serverUrl','Configurations','Tag','Subjects','type','variableName','Variable','FreshdeskField','Descriptions','content','key','keyContent','nameField','getFreshdeskAccounts','GetFreshdeskAccount','name','username','apiKey'];(function(_0x573716,_0x3783c0){var _0xd1245b=function(_0x56a4df){while(--_0x56a4df){_0x573716['push'](_0x573716['shift']());}};_0xd1245b(++_0x3783c0);}(_0x00ea,0x19d));var _0xa00e=function(_0x441cdd,_0x3d61f8){_0x441cdd=_0x441cdd-0x0;var _0xb407ea=_0x00ea[_0x441cdd];return _0xb407ea;};'use strict';var client=require('../../client');exports[_0xa00e('0x0')]=function(){return function(_0x1e8d97){return client['Request'](_0xa00e('0x1'),{'options':{'raw':![],'attributes':['id',_0xa00e('0x2'),_0xa00e('0x3'),_0xa00e('0x4'),_0xa00e('0x5'),_0xa00e('0x6')],'include':[{'model':'FreshdeskConfiguration','as':_0xa00e('0x7'),'attributes':['id',_0xa00e('0x2')],'include':[{'model':_0xa00e('0x8'),'attributes':['id',_0xa00e('0x2')]},{'model':'FreshdeskField','as':_0xa00e('0x9'),'attributes':['id',_0xa00e('0xa'),'content',_0xa00e('0xb')],'include':[{'model':_0xa00e('0xc'),'as':'Variable','attributes':['id',_0xa00e('0x2')]}]},{'model':_0xa00e('0xd'),'as':_0xa00e('0xe'),'attributes':['id','type',_0xa00e('0xf'),_0xa00e('0x10'),'keyType',_0xa00e('0x11'),'variableName'],'include':[{'model':_0xa00e('0xc'),'as':_0xa00e('0xc'),'attributes':['id',_0xa00e('0x2')]}]},{'model':_0xa00e('0xd'),'as':'Fields','attributes':['id',_0xa00e('0xa'),_0xa00e('0xf'),'idField',_0xa00e('0x12'),'customField',_0xa00e('0xb')],'include':[{'model':_0xa00e('0xc'),'as':_0xa00e('0xc'),'attributes':['id','name']}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index 660f7c3..24f77de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd101=['serverUrl','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri'];(function(_0xd7049e,_0x4efb6c){var _0x5cd0cd=function(_0x1d4178){while(--_0x1d4178){_0xd7049e['push'](_0xd7049e['shift']());}};_0x5cd0cd(++_0x4efb6c);}(_0xd101,0xc1));var _0x1d10=function(_0x2e756a,_0x5b27b3){_0x2e756a=_0x2e756a-0x0;var _0x51ea5a=_0xd101[_0x2e756a];return _0x51ea5a;};'use strict';var client=require(_0x1d10('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x2ced74){return client[_0x1d10('0x1')](_0x1d10('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d10('0x3'),_0x1d10('0x4'),_0x1d10('0x5'),_0x1d10('0x6'),_0x1d10('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0x1d10('0x8'),'attributes':['id',_0x1d10('0x3')],'include':[{'model':_0x1d10('0x9'),'as':_0x1d10('0xa'),'attributes':['id',_0x1d10('0xb'),_0x1d10('0xc'),_0x1d10('0xd')],'include':[{'model':_0x1d10('0xe'),'as':_0x1d10('0xe'),'attributes':['id',_0x1d10('0x3')]}]},{'model':_0x1d10('0x9'),'as':_0x1d10('0xf'),'attributes':['id',_0x1d10('0xb'),_0x1d10('0xc'),_0x1d10('0x10'),_0x1d10('0x11'),_0x1d10('0x12'),'variableName'],'include':[{'model':_0x1d10('0xe'),'as':_0x1d10('0xe'),'attributes':['id',_0x1d10('0x3')]}]}]}]},'log':_0x1d10('0x13')});};};
\ No newline at end of file
+var _0xbd0a=['Subjects','content','variableName','Variable','Descriptions','type','key','keyContent','GetFreshsalesccount','../../client','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','name','FreshsalesField'];(function(_0x2f5b7c,_0x2895d5){var _0x36234f=function(_0x30030e){while(--_0x30030e){_0x2f5b7c['push'](_0x2f5b7c['shift']());}};_0x36234f(++_0x2895d5);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x1aa9da,_0x569f95){_0x1aa9da=_0x1aa9da-0x0;var _0x130ce6=_0xbd0a[_0x1aa9da];return _0x130ce6;};'use strict';var client=require(_0xabd0('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x3b0fc0){return client['Request']('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id','name',_0xabd0('0x1'),_0xabd0('0x2'),_0xabd0('0x3'),_0xabd0('0x4')],'include':[{'model':_0xabd0('0x5'),'as':_0xabd0('0x6'),'attributes':['id',_0xabd0('0x7')],'include':[{'model':_0xabd0('0x8'),'as':_0xabd0('0x9'),'attributes':['id','type',_0xabd0('0xa'),_0xabd0('0xb')],'include':[{'model':_0xabd0('0xc'),'as':'Variable','attributes':['id',_0xabd0('0x7')]}]},{'model':'FreshsalesField','as':_0xabd0('0xd'),'attributes':['id',_0xabd0('0xe'),_0xabd0('0xa'),_0xabd0('0xf'),'keyType',_0xabd0('0x10'),'variableName'],'include':[{'model':_0xabd0('0xc'),'as':_0xabd0('0xc'),'attributes':['id',_0xabd0('0x7')]}]}]}]},'log':_0xabd0('0x11')});};};
\ No newline at end of file
index 803ae57..7bc6327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a21=['remoteUri','clientId','clientSecret','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','ticketType','leadId','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Descriptions','Variable','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password'];(function(_0x4b287f,_0x4bc091){var _0x26bf92=function(_0x2275c9){while(--_0x2275c9){_0x4b287f['push'](_0x4b287f['shift']());}};_0x26bf92(++_0x4bc091);}(_0x1a21,0x1d9));var _0x11a2=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x1a21[_0x187ee1];return _0x388160;};'use strict';var client=require(_0x11a2('0x0'));exports[_0x11a2('0x1')]=function(){return function(_0x3df01b){return client[_0x11a2('0x2')](_0x11a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x11a2('0x4'),_0x11a2('0x5'),_0x11a2('0x6'),_0x11a2('0x7'),_0x11a2('0x8'),_0x11a2('0x9'),'securityToken',_0x11a2('0xa'),_0x11a2('0xb')],'include':[{'model':_0x11a2('0xc'),'as':_0x11a2('0xd'),'attributes':['id',_0x11a2('0x4'),_0x11a2('0xe'),'moduleCreate',_0x11a2('0xf'),_0x11a2('0x10'),_0x11a2('0x11'),_0x11a2('0x12'),'additionalSearchLead'],'include':[{'model':_0x11a2('0x13'),'as':_0x11a2('0x14'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x11a2('0x4')]}]},{'model':'SalesforceField','as':_0x11a2('0x15'),'include':[{'model':_0x11a2('0x16'),'as':_0x11a2('0x16'),'attributes':['id','name']}]},{'model':_0x11a2('0x13'),'as':_0x11a2('0x17'),'include':[{'model':_0x11a2('0x16'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x11a2('0x3')});};};
\ No newline at end of file
+var _0x1af1=['additionalSearchAccount','additionalSearchContact','additionalSearchLead','Subjects','Variable','SalesforceField','Descriptions','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientId','securityToken','type','moduleCreate','leadId'];(function(_0x470117,_0xa878ed){var _0x2bd036=function(_0x591c1b){while(--_0x591c1b){_0x470117['push'](_0x470117['shift']());}};_0x2bd036(++_0xa878ed);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x11af('0x0'));exports[_0x11af('0x1')]=function(){return function(_0x32dd8e){return client[_0x11af('0x2')](_0x11af('0x3'),{'options':{'raw':![],'attributes':['id',_0x11af('0x4'),_0x11af('0x5'),_0x11af('0x6'),_0x11af('0x7'),_0x11af('0x8'),'clientSecret',_0x11af('0x9'),'serverUrl',_0x11af('0xa')],'include':[{'model':'SalesforceConfiguration','as':'Configurations','attributes':['id',_0x11af('0x4'),'moduleSearch',_0x11af('0xb'),'ticketType',_0x11af('0xc'),_0x11af('0xd'),_0x11af('0xe'),_0x11af('0xf')],'include':[{'model':'SalesforceField','as':_0x11af('0x10'),'include':[{'model':_0x11af('0x11'),'as':_0x11af('0x11'),'attributes':['id',_0x11af('0x4')]}]},{'model':_0x11af('0x12'),'as':_0x11af('0x13'),'include':[{'model':_0x11af('0x11'),'as':_0x11af('0x11'),'attributes':['id',_0x11af('0x4')]}]},{'model':_0x11af('0x12'),'as':'Fields','include':[{'model':_0x11af('0x11'),'as':_0x11af('0x11'),'attributes':['id',_0x11af('0x4')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index dd58dfd..db5b057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['type','variableName','Variable','keyType','Fields','content','nameField','GetServicenowkAccount','../../client','Request','name','description','username','password','email','serverUrl','ServicenowConfiguration','ServicenowField'];(function(_0x3a5362,_0x26100d){var _0x4ed1b3=function(_0x4a7d1b){while(--_0x4a7d1b){_0x3a5362['push'](_0x3a5362['shift']());}};_0x4ed1b3(++_0x26100d);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xee2f('0x0'));exports['getServicenowAccounts']=function(){return function(_0x521787){return client[_0xee2f('0x1')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xee2f('0x2'),_0xee2f('0x3'),_0xee2f('0x4'),_0xee2f('0x5'),_0xee2f('0x6'),'remoteUri',_0xee2f('0x7')],'include':[{'model':_0xee2f('0x8'),'as':'Configurations','attributes':['id',_0xee2f('0x2')],'include':[{'model':_0xee2f('0x9'),'as':'Subjects','attributes':['id',_0xee2f('0xa'),'content',_0xee2f('0xb')],'include':[{'model':_0xee2f('0xc'),'as':'Variable','attributes':['id',_0xee2f('0x2')]}]},{'model':_0xee2f('0x9'),'as':'Descriptions','attributes':['id','type','content','key',_0xee2f('0xd'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0xee2f('0xc'),'attributes':['id',_0xee2f('0x2')]}]},{'model':_0xee2f('0x9'),'as':_0xee2f('0xe'),'attributes':['id',_0xee2f('0xa'),_0xee2f('0xf'),'idField',_0xee2f('0x10'),'customField',_0xee2f('0xb')],'include':[{'model':_0xee2f('0xc'),'as':'Variable','attributes':['id',_0xee2f('0x2')]}]}]}]},'log':_0xee2f('0x11')});};};
\ No newline at end of file
+var _0xc4aa=['keyContent','Fields','content','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','variableName','Variable','Descriptions','type','key'];(function(_0x29107e,_0x1c68f9){var _0x3a4ffb=function(_0x32a717){while(--_0x32a717){_0x29107e['push'](_0x29107e['shift']());}};_0x3a4ffb(++_0x1c68f9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(_0x40a0d0){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),'description','username','password',_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7')],'include':[{'model':_0xac4a('0x8'),'as':_0xac4a('0x9'),'attributes':['id',_0xac4a('0x4')],'include':[{'model':_0xac4a('0xa'),'as':_0xac4a('0xb'),'attributes':['id','type','content',_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id','name']}]},{'model':_0xac4a('0xa'),'as':_0xac4a('0xe'),'attributes':['id',_0xac4a('0xf'),'content',_0xac4a('0x10'),'keyType',_0xac4a('0x11'),'variableName'],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]},{'model':'ServicenowField','as':_0xac4a('0x12'),'attributes':['id',_0xac4a('0xf'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]}]}]},'log':_0xac4a('0x17')});};};
\ No newline at end of file
index 22d4251..024a5c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0xf273f9,_0x486198){var _0xb4abcc=function(_0x2f9418){while(--_0x2f9418){_0xf273f9['push'](_0xf273f9['shift']());}};_0xb4abcc(++_0x486198);}(_0xdb28,0x106));var _0x8db2=function(_0x577aa7,_0x4ef759){_0x577aa7=_0x577aa7-0x0;var _0x1700fc=_0xdb28[_0x577aa7];return _0x1700fc;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
+var _0x0295=['remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','customField','GetSugarcrmAccount','../../client','Request','username','password'];(function(_0x50264d,_0x426d9b){var _0x321f89=function(_0x45a7c6){while(--_0x45a7c6){_0x50264d['push'](_0x50264d['shift']());}};_0x321f89(++_0x426d9b);}(_0x0295,0x1f0));var _0x5029=function(_0x43b22b,_0xea722c){_0x43b22b=_0x43b22b-0x0;var _0xd4e124=_0x0295[_0x43b22b];return _0xd4e124;};'use strict';var client=require(_0x5029('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5')],'include':[{'model':_0x5029('0x6'),'as':_0x5029('0x7'),'attributes':['id',_0x5029('0x8')],'include':[{'model':_0x5029('0x9'),'as':_0x5029('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x5029('0xb'),'as':'Variable','attributes':['id',_0x5029('0x8')]}]},{'model':'SugarcrmField','as':_0x5029('0xc'),'attributes':['id','type',_0x5029('0xd'),_0x5029('0xe'),_0x5029('0xf'),'keyContent',_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id','name']}]},{'model':_0x5029('0x9'),'as':_0x5029('0x11'),'attributes':['id','type','content','idField','nameField',_0x5029('0x12'),_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id',_0x5029('0x8')]}]}]}]},'log':_0x5029('0x13')});};};
\ No newline at end of file
index 2681cac..0d8679f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab62=['keyContent','idField','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','description','username','remoteUri','name','VtigerField','Subjects','type','content','variableName','Variable','key','keyType'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xab62,0x15a));var _0x2ab6=function(_0x4b0bec,_0x59e2c9){_0x4b0bec=_0x4b0bec-0x0;var _0x7049b7=_0xab62[_0x4b0bec];return _0x7049b7;};'use strict';var client=require(_0x2ab6('0x0'));exports[_0x2ab6('0x1')]=function(){return function(_0x19f3aa){return client['Request'](_0x2ab6('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2ab6('0x3'),_0x2ab6('0x4'),'accessKey',_0x2ab6('0x5'),'serverUrl'],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0x2ab6('0x6')],'include':[{'model':_0x2ab6('0x7'),'as':_0x2ab6('0x8'),'attributes':['id',_0x2ab6('0x9'),_0x2ab6('0xa'),_0x2ab6('0xb')],'include':[{'model':_0x2ab6('0xc'),'as':_0x2ab6('0xc'),'attributes':['id',_0x2ab6('0x6')]}]},{'model':_0x2ab6('0x7'),'as':'Descriptions','attributes':['id',_0x2ab6('0x9'),_0x2ab6('0xa'),_0x2ab6('0xd'),_0x2ab6('0xe'),_0x2ab6('0xf'),_0x2ab6('0xb')],'include':[{'model':'Variable','as':_0x2ab6('0xc'),'attributes':['id',_0x2ab6('0x6')]}]},{'model':_0x2ab6('0x7'),'as':'Fields','attributes':['id','type',_0x2ab6('0xa'),_0x2ab6('0x10'),_0x2ab6('0x11'),_0x2ab6('0x12'),_0x2ab6('0xb')],'include':[{'model':_0x2ab6('0xc'),'as':_0x2ab6('0xc'),'attributes':['id','name']}]}]}]},'log':_0x2ab6('0x2')});};};
\ No newline at end of file
+var _0xfba6=['name','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','VtigerField','Subjects','content','Variable','Descriptions','keyType','keyContent','variableName','Fields','type','customField','../../client','Request','GetVtigerAccount'];(function(_0x42c587,_0x224d2a){var _0x3410cc=function(_0x4c8815){while(--_0x4c8815){_0x42c587['push'](_0x42c587['shift']());}};_0x3410cc(++_0x224d2a);}(_0xfba6,0x7b));var _0x6fba=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0xfba6[_0x2b2c53];return _0x311ec2;};'use strict';var client=require(_0x6fba('0x0'));exports['getVtigerAccounts']=function(){return function(_0x3708d2){return client[_0x6fba('0x1')](_0x6fba('0x2'),{'options':{'raw':![],'attributes':['id',_0x6fba('0x3'),_0x6fba('0x4'),_0x6fba('0x5'),_0x6fba('0x6'),_0x6fba('0x7'),'serverUrl'],'include':[{'model':_0x6fba('0x8'),'as':_0x6fba('0x9'),'attributes':['id',_0x6fba('0x3')],'include':[{'model':_0x6fba('0xa'),'as':_0x6fba('0xb'),'attributes':['id','type',_0x6fba('0xc'),'variableName'],'include':[{'model':_0x6fba('0xd'),'as':_0x6fba('0xd'),'attributes':['id',_0x6fba('0x3')]}]},{'model':_0x6fba('0xa'),'as':_0x6fba('0xe'),'attributes':['id','type',_0x6fba('0xc'),'key',_0x6fba('0xf'),_0x6fba('0x10'),_0x6fba('0x11')],'include':[{'model':_0x6fba('0xd'),'as':'Variable','attributes':['id',_0x6fba('0x3')]}]},{'model':'VtigerField','as':_0x6fba('0x12'),'attributes':['id',_0x6fba('0x13'),_0x6fba('0xc'),'idField','nameField',_0x6fba('0x14'),'variableName'],'include':[{'model':_0x6fba('0xd'),'as':_0x6fba('0xd'),'attributes':['id',_0x6fba('0x3')]}]}]}]},'log':_0x6fba('0x2')});};};
\ No newline at end of file
index 511542e..52727ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc929=['token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','name','Tag','ZendeskField','Subjects','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','password'];(function(_0x3a3188,_0x19d713){var _0x48b301=function(_0xdf7285){while(--_0xdf7285){_0x3a3188['push'](_0x3a3188['shift']());}};_0x48b301(++_0x19d713);}(_0xc929,0x14a));var _0x9c92=function(_0x3ac208,_0x56b9fb){_0x3ac208=_0x3ac208-0x0;var _0x26fb39=_0xc929[_0x3ac208];return _0x26fb39;};'use strict';var client=require(_0x9c92('0x0'));exports[_0x9c92('0x1')]=function(){return function(_0x353f6b){return client[_0x9c92('0x2')](_0x9c92('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9c92('0x4'),_0x9c92('0x5'),_0x9c92('0x6'),_0x9c92('0x7'),_0x9c92('0x8'),_0x9c92('0x9'),_0x9c92('0xa')],'include':[{'model':_0x9c92('0xb'),'as':'Configurations','attributes':['id',_0x9c92('0xc')],'include':[{'model':_0x9c92('0xd'),'attributes':['id',_0x9c92('0xc')]},{'model':_0x9c92('0xe'),'as':_0x9c92('0xf'),'attributes':['id','type',_0x9c92('0x10'),_0x9c92('0x11')],'include':[{'model':_0x9c92('0x12'),'as':'Variable','attributes':['id',_0x9c92('0xc')]}]},{'model':_0x9c92('0xe'),'as':_0x9c92('0x13'),'attributes':['id','type',_0x9c92('0x10'),_0x9c92('0x14'),'keyType',_0x9c92('0x15'),_0x9c92('0x11')],'include':[{'model':_0x9c92('0x12'),'as':_0x9c92('0x12'),'attributes':['id',_0x9c92('0xc')]}]},{'model':_0x9c92('0xe'),'as':_0x9c92('0x16'),'attributes':['id',_0x9c92('0xa'),_0x9c92('0x10'),_0x9c92('0x17'),'nameField','customField','variableName'],'include':[{'model':_0x9c92('0x12'),'as':_0x9c92('0x12'),'attributes':['id',_0x9c92('0xc')]}]}]}]},'log':_0x9c92('0x3')});};};
\ No newline at end of file
+var _0x3dcc=['Fields','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','password','serverUrl','type','ZendeskConfiguration','Configurations','name','Tag','Subjects','variableName','Variable','ZendeskField','Descriptions','content','key','keyContent'];(function(_0x5e864d,_0x25b34b){var _0xd8c1b2=function(_0x2d77ab){while(--_0x2d77ab){_0x5e864d['push'](_0x5e864d['shift']());}};_0xd8c1b2(++_0x25b34b);}(_0x3dcc,0xf4));var _0xc3dc=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x3dcc[_0x2112d4];return _0x434972;};'use strict';var client=require(_0xc3dc('0x0'));exports[_0xc3dc('0x1')]=function(){return function(_0x125cf1){return client[_0xc3dc('0x2')](_0xc3dc('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc3dc('0x4'),_0xc3dc('0x5'),'token','remoteUri','authType',_0xc3dc('0x6'),_0xc3dc('0x7')],'include':[{'model':_0xc3dc('0x8'),'as':_0xc3dc('0x9'),'attributes':['id',_0xc3dc('0xa')],'include':[{'model':_0xc3dc('0xb'),'attributes':['id',_0xc3dc('0xa')]},{'model':'ZendeskField','as':_0xc3dc('0xc'),'attributes':['id',_0xc3dc('0x7'),'content',_0xc3dc('0xd')],'include':[{'model':_0xc3dc('0xe'),'as':_0xc3dc('0xe'),'attributes':['id','name']}]},{'model':_0xc3dc('0xf'),'as':_0xc3dc('0x10'),'attributes':['id',_0xc3dc('0x7'),_0xc3dc('0x11'),_0xc3dc('0x12'),'keyType',_0xc3dc('0x13'),_0xc3dc('0xd')],'include':[{'model':'Variable','as':_0xc3dc('0xe'),'attributes':['id',_0xc3dc('0xa')]}]},{'model':'ZendeskField','as':_0xc3dc('0x14'),'attributes':['id',_0xc3dc('0x7'),_0xc3dc('0x11'),_0xc3dc('0x15'),_0xc3dc('0x16'),_0xc3dc('0x17'),_0xc3dc('0xd')],'include':[{'model':_0xc3dc('0xe'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xc3dc('0x3')});};};
\ No newline at end of file
index e6517df..7fa0ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5644=['ZohoField','Descriptions','content','key','keyType','keyContent','customField','../../client','getZohoAccounts','name','description','host','zone','clientId','clientSecret','serverUrl','code','ZohoConfiguration','moduleCreate','moduleSearch','Subjects','type','variableName','Variable'];(function(_0x571f4f,_0x176d9a){var _0x23c85f=function(_0x245353){while(--_0x245353){_0x571f4f['push'](_0x571f4f['shift']());}};_0x23c85f(++_0x176d9a);}(_0x5644,0x1cf));var _0x4564=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x5644[_0x5751e6];return _0x4199e4;};'use strict';var client=require(_0x4564('0x0'));exports[_0x4564('0x1')]=function(){return function(_0x3a6537){return client['Request']('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0x4564('0x2'),_0x4564('0x3'),_0x4564('0x4'),_0x4564('0x5'),_0x4564('0x6'),_0x4564('0x7'),_0x4564('0x8'),_0x4564('0x9'),'refreshToken'],'include':[{'model':_0x4564('0xa'),'as':'Configurations','attributes':['id','name',_0x4564('0xb'),_0x4564('0xc'),_0x4564('0x3')],'include':[{'model':'ZohoField','as':_0x4564('0xd'),'attributes':['id',_0x4564('0xe'),'content',_0x4564('0xf')],'include':[{'model':_0x4564('0x10'),'as':_0x4564('0x10'),'attributes':['id','name']}]},{'model':_0x4564('0x11'),'as':_0x4564('0x12'),'attributes':['id','type',_0x4564('0x13'),_0x4564('0x14'),_0x4564('0x15'),_0x4564('0x16'),_0x4564('0xf')],'include':[{'model':_0x4564('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':'ZohoField','as':'Fields','attributes':['id',_0x4564('0xe'),_0x4564('0x13'),'idField','nameField',_0x4564('0x17'),_0x4564('0xf')],'include':[{'model':'Variable','as':_0x4564('0x10'),'attributes':['id','name']}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0x2d01=['Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','content','idField','nameField','customField','getZohoAccounts'];(function(_0x1044e2,_0x555631){var _0x494b55=function(_0x5e6446){while(--_0x5e6446){_0x1044e2['push'](_0x1044e2['shift']());}};_0x494b55(++_0x555631);}(_0x2d01,0x149));var _0x12d0=function(_0x46b979,_0x3f0e9a){_0x46b979=_0x46b979-0x0;var _0x355217=_0x2d01[_0x46b979];return _0x355217;};'use strict';var client=require('../../client');exports[_0x12d0('0x0')]=function(){return function(_0x1cf041){return client[_0x12d0('0x1')](_0x12d0('0x2'),{'options':{'raw':![],'attributes':['id',_0x12d0('0x3'),_0x12d0('0x4'),_0x12d0('0x5'),_0x12d0('0x6'),_0x12d0('0x7'),_0x12d0('0x8'),_0x12d0('0x9'),_0x12d0('0xa'),_0x12d0('0xb')],'include':[{'model':_0x12d0('0xc'),'as':_0x12d0('0xd'),'attributes':['id',_0x12d0('0x3'),_0x12d0('0xe'),_0x12d0('0xf'),_0x12d0('0x4')],'include':[{'model':_0x12d0('0x10'),'as':_0x12d0('0x11'),'attributes':['id','type','content',_0x12d0('0x12')],'include':[{'model':_0x12d0('0x13'),'as':'Variable','attributes':['id',_0x12d0('0x3')]}]},{'model':_0x12d0('0x10'),'as':_0x12d0('0x14'),'attributes':['id',_0x12d0('0x15'),'content',_0x12d0('0x16'),_0x12d0('0x17'),_0x12d0('0x18'),'variableName'],'include':[{'model':_0x12d0('0x13'),'as':_0x12d0('0x13'),'attributes':['id','name']}]},{'model':_0x12d0('0x10'),'as':_0x12d0('0x19'),'attributes':['id',_0x12d0('0x15'),_0x12d0('0x1a'),_0x12d0('0x1b'),_0x12d0('0x1c'),_0x12d0('0x1d'),_0x12d0('0x12')],'include':[{'model':_0x12d0('0x13'),'as':_0x12d0('0x13'),'attributes':['id',_0x12d0('0x3')]}]}]}]},'log':_0x12d0('0x2')});};};
\ No newline at end of file
index c8fbf1b..3b3b6b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x634d=['interval','concat','IntervalIftime','../../../config/logger','dialer','replace','trim','silly','isArray','resolve','every','string','map'];(function(_0x2877f4,_0x431490){var _0x537736=function(_0x4bd9b2){while(--_0x4bd9b2){_0x2877f4['push'](_0x2877f4['shift']());}};_0x537736(++_0x431490);}(_0x634d,0x1e4));var _0xd634=function(_0x5d1c48,_0x1c428b){_0x5d1c48=_0x5d1c48-0x0;var _0x109bac=_0x634d[_0x5d1c48];return _0x109bac;};var logger=require(_0xd634('0x0'))(_0xd634('0x1'));var client=require('../client');function intervalIftime(_0x365883,_0x248383){const _0xc804ef=new Error()['stack'][_0xd634('0x2')](/^Error/,'')[_0xd634('0x3')]();logger[_0xd634('0x4')]('intervalIftime\x20called\x20with',_0x365883,_0x248383,_0xc804ef);const _0x2a361a=Array[_0xd634('0x5')](_0x365883);if(!_0x365883||_0x2a361a&&_0x365883['length']===0x0){return Promise[_0xd634('0x6')](![]);}else{var _0x3c6241=[];var _0x201a21=[];var _0x61f23a=_0x2a361a?_0x365883:[_0x365883];var _0xd9006a=_0x61f23a[_0xd634('0x7')](function(_0x320680){return typeof _0x320680==='number';});var _0x1781bd=_0x61f23a[_0xd634('0x7')](function(_0x1ccb6d){return typeof _0x1ccb6d===_0xd634('0x8');});if(!_0xd9006a&&!_0x1781bd){_0x3c6241=_0x61f23a['map'](function(_0xf0942d){return _0xf0942d['id'];});if(_0x3c6241['length']===0x0){_0x201a21=_0x61f23a[_0xd634('0x9')](function(_0xeac31d){return _0xeac31d[_0xd634('0xa')];});}}else{if(_0xd9006a){_0x3c6241=_0x3c6241[_0xd634('0xb')](_0x61f23a);}if(_0x1781bd){_0x201a21=_0x201a21[_0xd634('0xb')](_0x61f23a);}}return client['Request'](_0xd634('0xc'),{'intervalIds':_0x3c6241,'intervals':_0x201a21,'timezone':_0x248383,'log':'IntervalIftime'});}}exports['intervalIftime']=intervalIftime;
\ No newline at end of file
+var _0x0a03=['intervalIftime','../client','stack','trim','isArray','length','resolve','every','map','interval','concat','Request','IntervalIftime'];(function(_0x15f88f,_0x6a3a24){var _0x2d008d=function(_0x527bf3){while(--_0x527bf3){_0x15f88f['push'](_0x15f88f['shift']());}};_0x2d008d(++_0x6a3a24);}(_0x0a03,0xde));var _0x30a0=function(_0x250127,_0x11c8ae){_0x250127=_0x250127-0x0;var _0x4222ef=_0x0a03[_0x250127];return _0x4222ef;};var logger=require('../../../config/logger')('dialer');var client=require(_0x30a0('0x0'));function intervalIftime(_0x1f6be8,_0x228c8c){const _0xa7984f=new Error()[_0x30a0('0x1')]['replace'](/^Error/,'')[_0x30a0('0x2')]();logger['silly']('intervalIftime\x20called\x20with',_0x1f6be8,_0x228c8c,_0xa7984f);const _0x1c77f5=Array[_0x30a0('0x3')](_0x1f6be8);if(!_0x1f6be8||_0x1c77f5&&_0x1f6be8[_0x30a0('0x4')]===0x0){return Promise[_0x30a0('0x5')](![]);}else{var _0xb034c1=[];var _0x62a2b6=[];var _0x4e9410=_0x1c77f5?_0x1f6be8:[_0x1f6be8];var _0x4c9269=_0x4e9410[_0x30a0('0x6')](function(_0x2085d9){return typeof _0x2085d9==='number';});var _0x11d49c=_0x4e9410[_0x30a0('0x6')](function(_0x331b1e){return typeof _0x331b1e==='string';});if(!_0x4c9269&&!_0x11d49c){_0xb034c1=_0x4e9410['map'](function(_0x39ca00){return _0x39ca00['id'];});if(_0xb034c1['length']===0x0){_0x62a2b6=_0x4e9410[_0x30a0('0x7')](function(_0x3f21f1){return _0x3f21f1[_0x30a0('0x8')];});}}else{if(_0x4c9269){_0xb034c1=_0xb034c1[_0x30a0('0x9')](_0x4e9410);}if(_0x11d49c){_0x62a2b6=_0x62a2b6[_0x30a0('0x9')](_0x4e9410);}}return client[_0x30a0('0xa')](_0x30a0('0xb'),{'intervalIds':_0xb034c1,'intervals':_0x62a2b6,'timezone':_0x228c8c,'log':_0x30a0('0xb')});}}exports[_0x30a0('0xc')]=intervalIftime;
\ No newline at end of file
index 4e2c457..f3ced93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfee3=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','CreateMemberReport','voice','membername','starttime','endtime','outbound','dialstring','uniqueid','moment','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xfee3,0x156));var _0x3fee=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xfee3[_0x373dee];return _0x46798f;};'use strict';var moment=require(_0x3fee('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x3fee('0x1'));exports[_0x3fee('0x2')]=function(_0x778953){var _0x859054=_0x778953[_0x3fee('0x3')]||_0x778953[_0x3fee('0x4')];return client[_0x3fee('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x778953[_0x3fee('0x6')],'interface':_[_0x3fee('0x7')](_0x778953[_0x3fee('0x8')])?util[_0x3fee('0x9')](_0x3fee('0xa'),_0x778953[_0x3fee('0x6')]):_0x778953[_0x3fee('0x8')],'type':_0x3fee('0xb'),'enterAt':_0x778953[_0x3fee('0xc')],'exitAt':_0x859054,'duration':moment(_0x859054)[_0x3fee('0xd')](_0x778953[_0x3fee('0xc')],_0x3fee('0xe')),'data1':_0x3fee('0xf'),'data2':_0x778953[_0x3fee('0x10')],'data3':_0x778953[_0x3fee('0x11')],'data4':null,'data5':_0x778953['queue'],'role':_0x3fee('0x12'),'internal':_0x778953[_0x3fee('0x13')]?_[_0x3fee('0x14')](_0x778953[_0x3fee('0x13')]):undefined,'uniqueid':_0x778953['uniqueid']},'log':_0x3fee('0x15')});};exports['voiceDialReport']=function(_0x34aaa2){return client[_0x3fee('0x5')]('CreateMemberReport',{'body':{'channel':_0x3fee('0x16'),'membername':_0x34aaa2[_0x3fee('0x17')],'interface':_0x34aaa2['interface'],'type':_0x3fee('0xb'),'enterAt':_0x34aaa2[_0x3fee('0x18')],'exitAt':_0x34aaa2[_0x3fee('0x19')],'duration':moment(_0x34aaa2[_0x3fee('0x19')])['diff'](_0x34aaa2['starttime'],'seconds')>=0x0?moment(_0x34aaa2['endtime'])[_0x3fee('0xd')](_0x34aaa2['starttime'],_0x3fee('0xe')):null,'data1':_0x3fee('0x1a'),'data2':_0x34aaa2['accountcode'],'data3':_0x34aaa2['exten'],'data4':_0x34aaa2[_0x3fee('0x1b')]||null,'role':_0x3fee('0x12'),'internal':_0x34aaa2['accountcode']?_[_0x3fee('0x14')](_0x34aaa2[_0x3fee('0x13')]):undefined,'uniqueid':_0x34aaa2[_0x3fee('0x1c')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x2f14=['interface','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','exten','queue','agent','accountcode','CreateMemberReport','voiceDialReport','membername','TALKING','starttime','endtime','outbound','toNumber','uniqueid','moment','lodash','util','../client','queuecallerexitAt','Request','voice','lastAssignedTo','isNil'];(function(_0x3b033e,_0x1ebbd1){var _0x4c3694=function(_0x49ab2d){while(--_0x49ab2d){_0x3b033e['push'](_0x3b033e['shift']());}};_0x4c3694(++_0x1ebbd1);}(_0x2f14,0x17f));var _0x42f1=function(_0x3dd9f4,_0xbacf00){_0x3dd9f4=_0x3dd9f4-0x0;var _0x273392=_0x2f14[_0x3dd9f4];return _0x273392;};'use strict';var moment=require(_0x42f1('0x0'));var _=require(_0x42f1('0x1'));var util=require(_0x42f1('0x2'));var client=require(_0x42f1('0x3'));exports['voiceQueueReport']=function(_0x5aca71){var _0x31071e=_0x5aca71['queuecallercompleteAt']||_0x5aca71[_0x42f1('0x4')];return client[_0x42f1('0x5')]('CreateMemberReport',{'body':{'channel':_0x42f1('0x6'),'membername':_0x5aca71[_0x42f1('0x7')],'interface':_[_0x42f1('0x8')](_0x5aca71[_0x42f1('0x9')])?util['format'](_0x42f1('0xa'),_0x5aca71['lastAssignedTo']):_0x5aca71['interface'],'type':'TALKING','enterAt':_0x5aca71['queuecallerleaveAt'],'exitAt':_0x31071e,'duration':moment(_0x31071e)[_0x42f1('0xb')](_0x5aca71[_0x42f1('0xc')],_0x42f1('0xd')),'data1':_0x42f1('0xe'),'data2':_0x5aca71['calleridnum'],'data3':_0x5aca71[_0x42f1('0xf')],'data4':null,'data5':_0x5aca71[_0x42f1('0x10')],'role':_0x42f1('0x11'),'internal':_0x5aca71[_0x42f1('0x12')]?_['toNumber'](_0x5aca71[_0x42f1('0x12')]):undefined,'uniqueid':_0x5aca71['uniqueid']},'log':_0x42f1('0x13')});};exports[_0x42f1('0x14')]=function(_0x2cf090){return client[_0x42f1('0x5')](_0x42f1('0x13'),{'body':{'channel':_0x42f1('0x6'),'membername':_0x2cf090[_0x42f1('0x15')],'interface':_0x2cf090[_0x42f1('0x9')],'type':_0x42f1('0x16'),'enterAt':_0x2cf090[_0x42f1('0x17')],'exitAt':_0x2cf090['endtime'],'duration':moment(_0x2cf090[_0x42f1('0x18')])['diff'](_0x2cf090[_0x42f1('0x17')],_0x42f1('0xd'))>=0x0?moment(_0x2cf090[_0x42f1('0x18')])[_0x42f1('0xb')](_0x2cf090[_0x42f1('0x17')],'seconds'):null,'data1':_0x42f1('0x19'),'data2':_0x2cf090[_0x42f1('0x12')],'data3':_0x2cf090[_0x42f1('0xf')],'data4':_0x2cf090['dialstring']||null,'role':_0x42f1('0x11'),'internal':_0x2cf090['accountcode']?_[_0x42f1('0x1a')](_0x2cf090[_0x42f1('0x12')]):undefined,'uniqueid':_0x2cf090[_0x42f1('0x1b')]},'log':_0x42f1('0x13')});};
\ No newline at end of file
index 9d4cc18..9464146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf604=['../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x6f71ea,_0x7f03d8){var _0x4f5076=function(_0x6f01e4){while(--_0x6f01e4){_0x6f71ea['push'](_0x6f71ea['shift']());}};_0x4f5076(++_0x7f03d8);}(_0xf604,0x1a4));var _0x4f60=function(_0x46b979,_0x3f0e9a){_0x46b979=_0x46b979-0x0;var _0x355217=_0xf604[_0x46b979];return _0x355217;};'use strict';var client=require(_0x4f60('0x0'));exports[_0x4f60('0x1')]=function(){return client[_0x4f60('0x2')](_0x4f60('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4f60('0x4'),_0x4f60('0x5')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x1cc3=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x1609cf,_0x197913){var _0x54cf96=function(_0x5239c8){while(--_0x5239c8){_0x1609cf['push'](_0x1609cf['shift']());}};_0x54cf96(++_0x197913);}(_0x1cc3,0x11b));var _0x31cc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1cc3[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x31cc('0x0'));exports[_0x31cc('0x1')]=function(){return client['Request'](_0x31cc('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x31cc('0x3')]},'log':_0x31cc('0x4')});};
\ No newline at end of file
index 3efff0b..3f62c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87ee=['../client','Request','GetTemplate','name'];(function(_0x44b5a0,_0x528dfd){var _0x3ddd8f=function(_0x4257bf){while(--_0x4257bf){_0x44b5a0['push'](_0x44b5a0['shift']());}};_0x3ddd8f(++_0x528dfd);}(_0x87ee,0x120));var _0xe87e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x87ee[_0x2b7764];return _0x848dcb;};'use strict';var client=require(_0xe87e('0x0'));exports['getTemplates']=function(_0x56d295){return function(_0x4f7eba){return client[_0xe87e('0x1')](_0xe87e('0x2'),{'options':{'raw':!![],'attributes':['id',_0xe87e('0x3'),'html']},'log':_0xe87e('0x2')});};};
\ No newline at end of file
+var _0xac31=['getTemplates','GetTemplate','../client'];(function(_0x1f78ad,_0x204cca){var _0x278af8=function(_0x20443a){while(--_0x20443a){_0x1f78ad['push'](_0x1f78ad['shift']());}};_0x278af8(++_0x204cca);}(_0xac31,0x134));var _0x1ac3=function(_0x12d41e,_0x2d41e9){_0x12d41e=_0x12d41e-0x0;var _0x2ae6c3=_0xac31[_0x12d41e];return _0x2ae6c3;};'use strict';var client=require(_0x1ac3('0x0'));exports[_0x1ac3('0x1')]=function(_0x71fc49){return function(_0xc28717){return client['Request'](_0x1ac3('0x2'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};};
\ No newline at end of file
index c194b19..e60b6f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0079=['data5','data6','data7','../client','Request','GetTrigger','name','status','Condition','AllConditions','field','value','AnyConditions','operator','Actions','action','data1','data2','data3','data4'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x0079,0x16b));var _0x9007=function(_0x4d6ea4,_0x386d55){_0x4d6ea4=_0x4d6ea4-0x0;var _0xc77671=_0x0079[_0x4d6ea4];return _0xc77671;};'use strict';var client=require(_0x9007('0x0'));exports['getTriggers']=function(_0x3aedbe){return function(_0x3c75f8){return client[_0x9007('0x1')](_0x9007('0x2'),{'options':{'raw':![],'attributes':['id',_0x9007('0x3'),'channel',_0x9007('0x4')],'include':[{'model':_0x9007('0x5'),'as':_0x9007('0x6'),'attributes':['id',_0x9007('0x7'),'operator',_0x9007('0x8')]},{'model':_0x9007('0x5'),'as':_0x9007('0x9'),'attributes':['id',_0x9007('0x7'),_0x9007('0xa'),_0x9007('0x8')]},{'model':'Action','as':_0x9007('0xb'),'attributes':['id',_0x9007('0xc'),_0x9007('0xd'),_0x9007('0xe'),_0x9007('0xf'),_0x9007('0x10'),_0x9007('0x11'),_0x9007('0x12'),_0x9007('0x13')]}]},'log':_0x9007('0x2')});};};
\ No newline at end of file
+var _0x08cc=['status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data3','data4','data6','../client','getTriggers','Request','GetTrigger','name'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x08cc,0x13e));var _0xc08c=function(_0x15841a,_0x4b77f0){_0x15841a=_0x15841a-0x0;var _0x5ecf41=_0x08cc[_0x15841a];return _0x5ecf41;};'use strict';var client=require(_0xc08c('0x0'));exports[_0xc08c('0x1')]=function(_0x4ccabf){return function(_0x3b7d46){return client[_0xc08c('0x2')](_0xc08c('0x3'),{'options':{'raw':![],'attributes':['id',_0xc08c('0x4'),'channel',_0xc08c('0x5')],'include':[{'model':_0xc08c('0x6'),'as':_0xc08c('0x7'),'attributes':['id',_0xc08c('0x8'),_0xc08c('0x9'),_0xc08c('0xa')]},{'model':_0xc08c('0x6'),'as':_0xc08c('0xb'),'attributes':['id',_0xc08c('0x8'),_0xc08c('0x9'),_0xc08c('0xa')]},{'model':_0xc08c('0xc'),'as':_0xc08c('0xd'),'attributes':['id',_0xc08c('0xe'),_0xc08c('0xf'),'data2',_0xc08c('0x10'),_0xc08c('0x11'),'data5',_0xc08c('0x12'),'data7']}]},'log':_0xc08c('0x3')});};};
\ No newline at end of file
index 3dc5497..d4e43b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['GetTrunk','../client','Request','registry'];(function(_0x1af00d,_0x3632e6){var _0xc4db0e=function(_0x598ba8){while(--_0x598ba8){_0x1af00d['push'](_0x1af00d['shift']());}};_0xc4db0e(++_0x3632e6);}(_0x3e74,0x175));var _0x43e7=function(_0x42f853,_0x4a021e){_0x42f853=_0x42f853-0x0;var _0x5433b5=_0x3e74[_0x42f853];return _0x5433b5;};'use strict';var client=require(_0x43e7('0x0'));exports['getTrunks']=function(_0x349480){return function(_0x287a1d){return client[_0x43e7('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x43e7('0x2'),'defaultuser']},'log':_0x43e7('0x3')});};};
\ No newline at end of file
+var _0x88b4=['../client','getTrunks','Request','registry','defaultuser','GetTrunk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88b4,0xa8));var _0x488b=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x88b4[_0x44a3b0];return _0x39e6f6;};'use strict';var client=require(_0x488b('0x0'));exports[_0x488b('0x1')]=function(_0x14b182){return function(_0x50ef2b){return client[_0x488b('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x488b('0x3'),_0x488b('0x4')]},'log':_0x488b('0x5')});};};
\ No newline at end of file
index 75a85df..47b11cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x5d60e0,_0x58e473){var _0x2fbdbe=function(_0x524805){while(--_0x524805){_0x5d60e0['push'](_0x5d60e0['shift']());}};_0x2fbdbe(++_0x58e473);}(_0x70e0,0x17b));var _0x070e=function(_0x29fe4d,_0x36d228){_0x29fe4d=_0x29fe4d-0x0;var _0x7d8df8=_0x70e0[_0x29fe4d];return _0x7d8df8;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
+var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0xef9608,_0x4db90c){var _0x5d0980=function(_0x363382){while(--_0x363382){_0xef9608['push'](_0xef9608['shift']());}};_0x5d0980(++_0x4db90c);}(_0x70e0,0x17b));var _0x070e=function(_0x48073f,_0x5badb8){_0x48073f=_0x48073f-0x0;var _0x5e4d01=_0x70e0[_0x48073f];return _0x5e4d01;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
index 114de2c..5d181ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6fa=['update','Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xc6fa,0x183));var _0xac6f=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0xc6fa[_0x188703];return _0x1a0c81;};'use strict';var client=require(_0xac6f('0x0'));exports[_0xac6f('0x1')]=function(_0x128867){return client['Request']('CreateVoiceAgentReport',{'body':_0x128867,'log':_0xac6f('0x2')});};exports[_0xac6f('0x3')]=function(_0x3eeb06,_0x5e8731,_0x22e941){return client[_0xac6f('0x4')](_0xac6f('0x5'),{'body':_0x3eeb06,'options':{'where':{'uniqueid':_0x5e8731,'interface':_0x22e941,'agentcomplete':!![]}},'log':_0xac6f('0x5')});};
\ No newline at end of file
+var _0x957e=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x957e,0x1a2));var _0xe957=function(_0x20e06e,_0x15a44a){_0x20e06e=_0x20e06e-0x0;var _0x2b2387=_0x957e[_0x20e06e];return _0x2b2387;};'use strict';var client=require(_0xe957('0x0'));exports['create']=function(_0x416514){return client[_0xe957('0x1')](_0xe957('0x2'),{'body':_0x416514,'log':_0xe957('0x2')});};exports[_0xe957('0x3')]=function(_0x505b41,_0x5abf03,_0x1af6b0){return client[_0xe957('0x1')](_0xe957('0x4'),{'body':_0x505b41,'options':{'where':{'uniqueid':_0x5abf03,'interface':_0x1af6b0,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index f8b94b8..6d685ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e1b=['day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','merge','context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','endOf'];(function(_0x26f968,_0xf04cd){var _0x1d8e65=function(_0xb76ae7){while(--_0xb76ae7){_0x26f968['push'](_0x26f968['shift']());}};_0x1d8e65(++_0xf04cd);}(_0x4e1b,0x125));var _0xb4e1=function(_0x421bf7,_0x486131){_0x421bf7=_0x421bf7-0x0;var _0x19efa9=_0x4e1b[_0x421bf7];return _0x19efa9;};'use strict';var moment=require('moment');var util=require(_0xb4e1('0x0'));var _=require(_0xb4e1('0x1'));var client=require(_0xb4e1('0x2'));exports[_0xb4e1('0x3')]=function(_0x240e20){return client[_0xb4e1('0x4')]('CreateVoiceCallReport',{'body':_[_0xb4e1('0x5')](_0x240e20,{'source':_0x240e20['calleridnum'],'destinationcontext':_0x240e20[_0xb4e1('0x6')],'callerid':_0x240e20['callerid'],'amaflags':_0xb4e1('0x7')}),'log':_0xb4e1('0x8')});};exports[_0xb4e1('0x9')]=function(){return function(){return client['Request'](_0xb4e1('0xa'),{'options':{'where':{'type':[_0xb4e1('0xb')],'createdAt':{'$between':[moment()[_0xb4e1('0xc')]('day')[_0xb4e1('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xb4e1('0xe')](_0xb4e1('0xf'))[_0xb4e1('0xd')](_0xb4e1('0x10'))]}},'attributes':[_0xb4e1('0x11'),_0xb4e1('0x12'),_0xb4e1('0x13'),_0xb4e1('0x14')]},'log':_0xb4e1('0x15')});};};
\ No newline at end of file
+var _0xc65f=['util','lodash','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x213227,_0xab47b1){var _0x525544=function(_0x359221){while(--_0x359221){_0x213227['push'](_0x213227['shift']());}};_0x525544(++_0xab47b1);}(_0xc65f,0xf6));var _0xfc65=function(_0x19e92f,_0x5c9b8e){_0x19e92f=_0x19e92f-0x0;var _0x4a3aca=_0xc65f[_0x19e92f];return _0x4a3aca;};'use strict';var moment=require(_0xfc65('0x0'));var util=require(_0xfc65('0x1'));var _=require(_0xfc65('0x2'));var client=require('../client');exports['create']=function(_0x235e0c){return client[_0xfc65('0x3')](_0xfc65('0x4'),{'body':_['merge'](_0x235e0c,{'source':_0x235e0c['calleridnum'],'destinationcontext':_0x235e0c[_0xfc65('0x5')],'callerid':_0x235e0c[_0xfc65('0x6')],'amaflags':_0xfc65('0x7')}),'log':_0xfc65('0x4')});};exports[_0xfc65('0x8')]=function(){return function(){return client['Request'](_0xfc65('0x9'),{'options':{'where':{'type':[_0xfc65('0xa')],'createdAt':{'$between':[moment()[_0xfc65('0xb')](_0xfc65('0xc'))[_0xfc65('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xfc65('0xc'))[_0xfc65('0xd')](_0xfc65('0xe'))]}},'attributes':['type',_0xfc65('0xf'),_0xfc65('0x10'),_0xfc65('0x11')]},'log':_0xfc65('0x12')});};};
\ No newline at end of file
index fa97464..34ad66a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1297=['create','CreateVoiceDialReport'];(function(_0x46cd2a,_0x43d845){var _0x44e498=function(_0xdf88ed){while(--_0xdf88ed){_0x46cd2a['push'](_0x46cd2a['shift']());}};_0x44e498(++_0x43d845);}(_0x1297,0xdc));var _0x7129=function(_0x18e405,_0x2a3a73){_0x18e405=_0x18e405-0x0;var _0x5a6bac=_0x1297[_0x18e405];return _0x5a6bac;};'use strict';var client=require('../client');exports[_0x7129('0x0')]=function(_0xc1aa0b){return client['Request'](_0x7129('0x1'),{'body':_0xc1aa0b,'log':_0x7129('0x1')});};
\ No newline at end of file
+var _0xb926=['../client','Request','CreateVoiceDialReport'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xb926,0xe1));var _0x6b92=function(_0x18ba00,_0x3d4010){_0x18ba00=_0x18ba00-0x0;var _0x2fbfb0=_0xb926[_0x18ba00];return _0x2fbfb0;};'use strict';var client=require(_0x6b92('0x0'));exports['create']=function(_0x5e86ba){return client[_0x6b92('0x1')](_0x6b92('0x2'),{'body':_0x5e86ba,'log':_0x6b92('0x2')});};
\ No newline at end of file
index ea745df..89d16d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9f=['getVoiceExtensions','exten','../client'];(function(_0x46cdd1,_0x5deeff){var _0x26f8fc=function(_0x3b2980){while(--_0x3b2980){_0x46cdd1['push'](_0x46cdd1['shift']());}};_0x26f8fc(++_0x5deeff);}(_0x0e9f,0x116));var _0xf0e9=function(_0x4240ba,_0x59804f){_0x4240ba=_0x4240ba-0x0;var _0x14f76b=_0x0e9f[_0x4240ba];return _0x14f76b;};'use strict';var client=require(_0xf0e9('0x0'));exports[_0xf0e9('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xf0e9('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0xd110=['Request','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x586daf,_0x4cc2ec){var _0x5eae83=function(_0x56c999){while(--_0x56c999){_0x586daf['push'](_0x586daf['shift']());}};_0x5eae83(++_0x4cc2ec);}(_0xd110,0x1e8));var _0x0d11=function(_0x10c9a0,_0x13fa8f){_0x10c9a0=_0x10c9a0-0x0;var _0x43f8a2=_0xd110[_0x10c9a0];return _0x43f8a2;};'use strict';var client=require(_0x0d11('0x0'));exports[_0x0d11('0x1')]=function(){return function(){return client[_0x0d11('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x0d11('0x3'),_0x0d11('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x0d11('0x1')});};};
\ No newline at end of file
index 725840a..3c51e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc943=['dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x3c6b68,_0x37a20f){var _0x4c22c2=function(_0x3089){while(--_0x3089){_0x3c6b68['push'](_0x3c6b68['shift']());}};_0x4c22c2(++_0x37a20f);}(_0xc943,0x157));var _0x3c94=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0xc943[_0x33c603];return _0xae96f4;};'use strict';var client=require(_0x3c94('0x0'));exports[_0x3c94('0x1')]=function(){return function(){return client[_0x3c94('0x2')](_0x3c94('0x3'),{'options':{'raw':![],'attributes':['id',_0x3c94('0x4'),_0x3c94('0x5'),_0x3c94('0x6'),'autopause',_0x3c94('0x7'),'type','dialActive',_0x3c94('0x8'),_0x3c94('0x9'),_0x3c94('0xa'),_0x3c94('0xb'),_0x3c94('0xc'),_0x3c94('0xd'),'dialPredictiveInterval',_0x3c94('0xe'),_0x3c94('0xf'),_0x3c94('0x10'),'dialQueueOptions','dialQueueTimeout',_0x3c94('0x11'),'dialCongestionMaxRetry',_0x3c94('0x12'),'dialBusyMaxRetry',_0x3c94('0x13'),_0x3c94('0x14'),_0x3c94('0x15'),_0x3c94('0x16'),_0x3c94('0x17'),'dialGlobalInterval',_0x3c94('0x18'),_0x3c94('0x19'),'dialAMDActive',_0x3c94('0x1a'),'dialAMDGreeting',_0x3c94('0x1b'),_0x3c94('0x1c'),_0x3c94('0x1d'),_0x3c94('0x1e'),'dialAMDMaximumNumberOfWords',_0x3c94('0x1f'),_0x3c94('0x20'),_0x3c94('0x21'),_0x3c94('0x22'),_0x3c94('0x23'),'dialOrderByScheduledAt',_0x3c94('0x24'),_0x3c94('0x25'),'dialQueueProject2',_0x3c94('0x7'),_0x3c94('0x26'),_0x3c94('0x27'),'dialCutDigit',_0x3c94('0x28'),_0x3c94('0x29'),_0x3c94('0x2a'),_0x3c94('0x2b'),_0x3c94('0x2c'),'dialAbandonedRetryFrequency',_0x3c94('0x2d'),_0x3c94('0x2e'),_0x3c94('0x2f'),_0x3c94('0x30'),_0x3c94('0x31'),_0x3c94('0x32'),_0x3c94('0x33'),_0x3c94('0x34'),_0x3c94('0x35')],'include':[{'model':'Trunk','as':_0x3c94('0x36'),'attributes':['id',_0x3c94('0x4'),_0x3c94('0x37'),_0x3c94('0x38')]},{'model':_0x3c94('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x3c94('0x4')]},{'model':_0x3c94('0x36'),'as':_0x3c94('0x3a'),'attributes':['id',_0x3c94('0x4'),'callerid',_0x3c94('0x38')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x3c94('0x4'),_0x3c94('0x3b')]}]}]},'log':_0x3c94('0x1')});};};
\ No newline at end of file
+var _0x0032=['getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','autopause','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval'];(function(_0x3a58aa,_0x583fcb){var _0x4d102b=function(_0x4eced6){while(--_0x4eced6){_0x3a58aa['push'](_0x3a58aa['shift']());}};_0x4d102b(++_0x583fcb);}(_0x0032,0xe5));var _0x2003=function(_0x496380,_0xdf128a){_0x496380=_0x496380-0x0;var _0x438e2f=_0x0032[_0x496380];return _0x438e2f;};'use strict';var client=require(_0x2003('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x2003('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x2003('0x2'),_0x2003('0x3'),_0x2003('0x4'),'monitor_format','type',_0x2003('0x5'),_0x2003('0x6'),'dialLimitChannel','dialLimitQueue',_0x2003('0x7'),_0x2003('0x8'),_0x2003('0x9'),_0x2003('0xa'),_0x2003('0xb'),_0x2003('0xc'),_0x2003('0xd'),'dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0x2003('0xe'),'dialBusyMaxRetry',_0x2003('0xf'),'dialNoAnswerMaxRetry',_0x2003('0x10'),'dialGlobalMaxRetry',_0x2003('0x11'),_0x2003('0x12'),_0x2003('0x13'),'dialCheckDuplicateType',_0x2003('0x14'),_0x2003('0x15'),_0x2003('0x16'),_0x2003('0x17'),'dialAMDTotalAnalysisTime',_0x2003('0x18'),_0x2003('0x19'),_0x2003('0x1a'),_0x2003('0x1b'),'dialAMDMaximumWordLength',_0x2003('0x1c'),_0x2003('0x1d'),'dialRecallInQueue','dialOrderByScheduledAt',_0x2003('0x1e'),'dialAgiAfterHangupClient',_0x2003('0x1f'),_0x2003('0x20'),'strategy',_0x2003('0x21'),_0x2003('0x22'),_0x2003('0x23'),_0x2003('0x24'),'dialDropMaxRetry',_0x2003('0x25'),'dialAbandonedMaxRetry',_0x2003('0x26'),_0x2003('0x27'),'dialMachineRetryFrequency',_0x2003('0x28'),_0x2003('0x29'),_0x2003('0x2a'),'dialPredictiveIntervalMaxThreshold',_0x2003('0x2b'),_0x2003('0x2c'),_0x2003('0x2d')],'include':[{'model':'Trunk','as':_0x2003('0x2e'),'attributes':['id',_0x2003('0x2f'),_0x2003('0x30'),_0x2003('0x31')]},{'model':_0x2003('0x32'),'as':_0x2003('0x33'),'attributes':['id','name']},{'model':_0x2003('0x2e'),'as':_0x2003('0x34'),'attributes':['id',_0x2003('0x2f'),'callerid',_0x2003('0x31')]},{'model':_0x2003('0x35'),'as':_0x2003('0x35'),'attributes':['id',_0x2003('0x2f')],'include':[{'model':_0x2003('0x35'),'as':_0x2003('0x36'),'attributes':['id',_0x2003('0x2f'),_0x2003('0x37')]}]}]},'log':_0x2003('0x38')});};};
\ No newline at end of file
index e8f603d..7dccd36 100644 (file)
@@ -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(_0x24aa3f,_0x4ca62c){var _0x35d192=function(_0x601df7){while(--_0x601df7){_0x24aa3f['push'](_0x24aa3f['shift']());}};_0x35d192(++_0x4ca62c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x18d7ae,_0x17a05a){var _0x498035=function(_0x35c6e7){while(--_0x35c6e7){_0x18d7ae['push'](_0x18d7ae['shift']());}};_0x498035(++_0x17a05a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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
index 74679b0..822e7ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6e7=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf6e7,0xcf));var _0x7f6e=function(_0x3c4cfa,_0x305c1d){_0x3c4cfa=_0x3c4cfa-0x0;var _0x386e05=_0xf6e7[_0x3c4cfa];return _0x386e05;};'use strict';var client=require(_0x7f6e('0x0'));exports[_0x7f6e('0x1')]=function(_0x43f1c2){return function(){return client[_0x7f6e('0x2')](_0x7f6e('0x3'),{'options':{'where':{'VoiceQueueId':_0x43f1c2,'paused':!![]},'raw':!![]},'log':_0x7f6e('0x1')});};};
\ No newline at end of file
+var _0x199c=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x4b37e8,_0x59f749){var _0x4dfb4c=function(_0xd6f5be){while(--_0xd6f5be){_0x4b37e8['push'](_0x4b37e8['shift']());}};_0x4dfb4c(++_0x59f749);}(_0x199c,0x7d));var _0xc199=function(_0x3d9a60,_0xb6bbb3){_0x3d9a60=_0x3d9a60-0x0;var _0x3c014a=_0x199c[_0x3d9a60];return _0x3c014a;};'use strict';var client=require(_0xc199('0x0'));exports[_0xc199('0x1')]=function(_0x21b4ea){return function(){return client[_0xc199('0x2')](_0xc199('0x3'),{'options':{'where':{'VoiceQueueId':_0x21b4ea,'paused':!![]},'raw':!![]},'log':_0xc199('0x1')});};};
\ No newline at end of file
index 15b9e5b..cb08a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x30a17b,_0x34fe3d){var _0x3a897a=function(_0x9a5b2d){while(--_0x9a5b2d){_0x30a17b['push'](_0x30a17b['shift']());}};_0x3a897a(++_0x34fe3d);}(_0x7a54,0x106));var _0x47a5=function(_0x4fc880,_0x564501){_0x4fc880=_0x4fc880-0x0;var _0x5ce93c=_0x7a54[_0x4fc880];return _0x5ce93c;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5b3206,_0x47cade){var _0x315b8d=function(_0x149ad4){while(--_0x149ad4){_0x5b3206['push'](_0x5b3206['shift']());}};_0x315b8d(++_0x47cade);}(_0x7a54,0x106));var _0x47a5=function(_0x27c88c,_0x38e6a4){_0x27c88c=_0x27c88c-0x0;var _0x5a25d4=_0x7a54[_0x27c88c];return _0x5a25d4;};'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
index 95e7243..400ec22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a7=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0xf8d678,_0x54a0ae){var _0x19c8ce=function(_0x2921a0){while(--_0x2921a0){_0xf8d678['push'](_0xf8d678['shift']());}};_0x19c8ce(++_0x54a0ae);}(_0xa4a7,0x106));var _0x7a4a=function(_0x33206b,_0x5660ca){_0x33206b=_0x33206b-0x0;var _0x5ba064=_0xa4a7[_0x33206b];return _0x5ba064;};'use strict';var client=require(_0x7a4a('0x0'));exports['transfers']={};exports[_0x7a4a('0x1')]=function(_0x4b497f){return client[_0x7a4a('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x4b497f['result'],'transfererchannel':_0x4b497f[_0x7a4a('0x3')],'transferercalleridnum':_0x4b497f[_0x7a4a('0x4')],'transferercalleridname':_0x4b497f[_0x7a4a('0x5')],'transfererconnectedlinenum':_0x4b497f['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4b497f[_0x7a4a('0x6')],'transfereraccountcode':_0x4b497f[_0x7a4a('0x7')],'transferercontext':_0x4b497f[_0x7a4a('0x8')],'transfererexten':_0x4b497f['transfererexten'],'transfererlinkedid':_0x4b497f['transfererlinkedid'],'transfereechannel':_0x4b497f[_0x7a4a('0x9')],'transfereecalleridnum':_0x4b497f['transfereecalleridnum'],'transfereecalleridname':_0x4b497f['transfereecalleridname'],'transfereeconnectedlinenum':_0x4b497f[_0x7a4a('0xa')],'transfereeconnectedlinename':_0x4b497f[_0x7a4a('0xb')],'transfereeaccountcode':_0x4b497f[_0x7a4a('0xc')],'transfereecontext':_0x4b497f[_0x7a4a('0xd')],'transfereeexten':_0x4b497f[_0x7a4a('0xe')],'transfereelinkedid':_0x4b497f[_0x7a4a('0xf')],'isexternal':_0x4b497f[_0x7a4a('0x10')],'context':_0x4b497f[_0x7a4a('0x11')],'extension':_0x4b497f['extension'],'type':_0x7a4a('0x12')},'log':_0x7a4a('0x13')});};exports[_0x7a4a('0x14')]=function(_0x249f4a){return client[_0x7a4a('0x2')](_0x7a4a('0x13'),{'body':{'result':_0x249f4a[_0x7a4a('0x15')],'transfererchannel':_0x249f4a[_0x7a4a('0x16')],'transferercalleridnum':_0x249f4a[_0x7a4a('0x17')],'transferercalleridname':_0x249f4a[_0x7a4a('0x18')],'transfererconnectedlinenum':_0x249f4a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x249f4a[_0x7a4a('0x19')],'transfereraccountcode':_0x249f4a[_0x7a4a('0x1a')],'transferercontext':_0x249f4a[_0x7a4a('0x1b')],'transfererexten':_0x249f4a[_0x7a4a('0x1c')],'transfererlinkedid':_0x249f4a[_0x7a4a('0x1d')],'transfereechannel':_0x249f4a[_0x7a4a('0x1e')],'transfereecalleridnum':_0x249f4a[_0x7a4a('0x1f')],'transfereecalleridname':_0x249f4a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x249f4a[_0x7a4a('0x20')],'transfereeconnectedlinename':_0x249f4a[_0x7a4a('0x21')],'transfereeaccountcode':_0x249f4a[_0x7a4a('0x22')],'transfereecontext':_0x249f4a[_0x7a4a('0x23')],'transfereeexten':_0x249f4a[_0x7a4a('0x24')],'transfereelinkedid':_0x249f4a[_0x7a4a('0x25')],'isexternal':_0x249f4a[_0x7a4a('0x10')],'context':_0x249f4a[_0x7a4a('0x26')],'extension':_0x249f4a[_0x7a4a('0x27')],'type':_0x7a4a('0x28')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0xa289=['origtransfereraccountcode','secondtransferercontext','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0xa289,0xce));var _0x9a28=function(_0x4ad8e5,_0x423414){_0x4ad8e5=_0x4ad8e5-0x0;var _0x4b0ead=_0xa289[_0x4ad8e5];return _0x4b0ead;};'use strict';var client=require(_0x9a28('0x0'));exports[_0x9a28('0x1')]={};exports[_0x9a28('0x2')]=function(_0x326d4e){return client[_0x9a28('0x3')](_0x9a28('0x4'),{'body':{'result':_0x326d4e[_0x9a28('0x5')],'transfererchannel':_0x326d4e[_0x9a28('0x6')],'transferercalleridnum':_0x326d4e['transferercalleridnum'],'transferercalleridname':_0x326d4e[_0x9a28('0x7')],'transfererconnectedlinenum':_0x326d4e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x326d4e[_0x9a28('0x8')],'transfereraccountcode':_0x326d4e[_0x9a28('0x9')],'transferercontext':_0x326d4e['transferercontext'],'transfererexten':_0x326d4e['transfererexten'],'transfererlinkedid':_0x326d4e[_0x9a28('0xa')],'transfereechannel':_0x326d4e[_0x9a28('0xb')],'transfereecalleridnum':_0x326d4e[_0x9a28('0xc')],'transfereecalleridname':_0x326d4e[_0x9a28('0xd')],'transfereeconnectedlinenum':_0x326d4e[_0x9a28('0xe')],'transfereeconnectedlinename':_0x326d4e[_0x9a28('0xf')],'transfereeaccountcode':_0x326d4e[_0x9a28('0x10')],'transfereecontext':_0x326d4e['transfereecontext'],'transfereeexten':_0x326d4e[_0x9a28('0x11')],'transfereelinkedid':_0x326d4e[_0x9a28('0x12')],'isexternal':_0x326d4e[_0x9a28('0x13')],'context':_0x326d4e[_0x9a28('0x14')],'extension':_0x326d4e[_0x9a28('0x15')],'type':_0x9a28('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x9a28('0x17')]=function(_0x392222){return client[_0x9a28('0x3')](_0x9a28('0x4'),{'body':{'result':_0x392222[_0x9a28('0x5')],'transfererchannel':_0x392222[_0x9a28('0x18')],'transferercalleridnum':_0x392222[_0x9a28('0x19')],'transferercalleridname':_0x392222[_0x9a28('0x1a')],'transfererconnectedlinenum':_0x392222['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x392222[_0x9a28('0x1b')],'transfereraccountcode':_0x392222[_0x9a28('0x1c')],'transferercontext':_0x392222[_0x9a28('0x1d')],'transfererexten':_0x392222['secondtransfererexten'],'transfererlinkedid':_0x392222['origtransfererlinkedid'],'transfereechannel':_0x392222['transfertargetchannel'],'transfereecalleridnum':_0x392222[_0x9a28('0x1e')],'transfereecalleridname':_0x392222[_0x9a28('0x1f')],'transfereeconnectedlinenum':_0x392222[_0x9a28('0x20')],'transfereeconnectedlinename':_0x392222[_0x9a28('0x21')],'transfereeaccountcode':_0x392222['transfertargetaccountcode'],'transfereecontext':_0x392222[_0x9a28('0x22')],'transfereeexten':_0x392222[_0x9a28('0x23')],'transfereelinkedid':_0x392222[_0x9a28('0x24')],'isexternal':_0x392222[_0x9a28('0x13')],'context':_0x392222['origtransferercontext'],'extension':_0x392222[_0x9a28('0x25')],'type':_0x9a28('0x26')},'log':_0x9a28('0x4')});};
\ No newline at end of file
index a445e18..7e97b8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x826a=['module','action','Action','then','message','catch','isConnected','ami\x20disconnected','pick','Command','content','voiceQueues','push','length','find','omit','undefined','channels','username','map','uniqueid','channel','%s.%s','filename','wav','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','Channel\x20doesn\x27t\x20exist','voicechannel','destinationchannel','StopMixMonitor','status','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','type','count','rows','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','join','reload'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x826a,0x1aa));var _0xa826=function(_0x4237bb,_0x41fc7b){_0x4237bb=_0x4237bb-0x0;var _0x23d7e5=_0x826a[_0x4237bb];return _0x23d7e5;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var jayson=require('jayson/promise');var schema=require(_0xa826('0x1'));var moment=require('moment');var config=require(_0xa826('0x2'));var properties=require(_0xa826('0x3'));var ami=require(_0xa826('0x4'));var VoiceQueueSummary=require(_0xa826('0x5'));exports['listen']=function(_0x30875f,_0x15f777,_0x3929d4){return new Promise(function(_0x34327b,_0x45154f){var _0x4124f5={'QueuePause':function(_0x4339f9){return new Promise(function(_0x14c2ba){var _0xc348d2=util[_0xa826('0x6')](_0xa826('0x7'),_0xa826('0x8'),_0x4339f9[_0xa826('0x9')]);if(_0x30875f[_0xa826('0xa')]&&_0x30875f[_0xa826('0xa')][_0xc348d2]&&_0x30875f[_0xa826('0xa')][_0xc348d2]['timer']){_0x30875f[_0xa826('0xa')][_0xc348d2]['updateAcw']();}if(_0x30875f[_0xa826('0xb')][_0xc348d2]){_0x30875f[_0xa826('0xb')][_0xc348d2][_0xa826('0xc')]({'statePause':_0x4339f9[_0xa826('0xd')]?!![]:![]});}_0x14c2ba({'code':0xc8,'message':_0xa826('0xe')});});},'Reload':function(_0x40838f){var _0x2f1d39=this;return new Promise(function(_0x528cb8,_0x74f6ec){if(ami['isConnected']()==![]){return _0x74f6ec(_0x2f1d39[_0xa826('0xf')](0x1f4,[config[_0xa826('0x10')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xa826('0x11')]('\x20')));}_0x40838f=_['pick'](_0x40838f,_['keys'](properties[_0xa826('0x12')][_0xa826('0x13')]));_0x40838f[_0xa826('0x14')]='Reload';return ami[_0xa826('0x15')](_0x40838f)[_0xa826('0x16')](function(_0x258915){_0x528cb8({'code':0xc8,'message':_0x258915[_0xa826('0x17')]});})[_0xa826('0x18')](function(_0x48930f){_0x74f6ec(_0x2f1d39[_0xa826('0xf')](0x1f5,_0x48930f[_0xa826('0x17')]));});});},'Command':function(_0x229b90){var _0x57e96e=this;return new Promise(function(_0x5d8161,_0x156127){if(ami[_0xa826('0x19')]()==![]){return _0x156127(_0x57e96e[_0xa826('0xf')](0x1f4,[config[_0xa826('0x10')]['ip'],config[_0xa826('0x10')]['username'],_0xa826('0x1a')][_0xa826('0x11')]('\x20')));}_0x229b90=_[_0xa826('0x1b')](_0x229b90,'command');_0x229b90['action']=_0xa826('0x1c');return ami[_0xa826('0x15')](_0x229b90)[_0xa826('0x16')](function(_0x4eb4f3){_0x5d8161({'code':0xc8,'message':_0x4eb4f3[_0xa826('0x1d')]});})[_0xa826('0x18')](function(_0x1d4ade){_0x156127(_0x57e96e[_0xa826('0xf')](0x1f5,_0x1d4ade[_0xa826('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4d6909){var _0x13329a=[];for(var _0x4fa5db in _0x30875f[_0xa826('0x1e')]){if(_0x30875f[_0xa826('0x1e')]['hasOwnProperty'](_0x4fa5db)){var _0xfc0448=_0x30875f[_0xa826('0x1e')][_0x4fa5db];var _0x38c919=new VoiceQueueSummary(_0xfc0448);_0x13329a[_0xa826('0x1f')](_0x38c919);}}_0x4d6909({'count':_0x13329a[_0xa826('0x20')],'rows':_0x13329a});});},'UpdateVoiceQueue':function(_0x3c6307){return new Promise(function(_0x14e836,_0x3b9c6d){var _0x36ded2=_[_0xa826('0x21')](_0x30875f[_0xa826('0x1e')],{'id':parseInt(_0x3c6307['id'])});var _0x473d8d=_[_0xa826('0x22')](_0x3c6307,['id']);if(_0x36ded2){for(var _0x2cb586 in _0x473d8d){if(typeof _0x473d8d[_0x2cb586]!==_0xa826('0x23')&&typeof _0x36ded2[_0x2cb586]!==_0xa826('0x23')){_0x36ded2[_0x2cb586]=_0x473d8d[_0x2cb586];}}_0x14e836(_0x36ded2);}else{_0x3b9c6d();}});},'VoiceChannels':function(){return new Promise(function(_0x55886f){var _0x19bd84=_['values'](_0x30875f[_0xa826('0x24')]);_0x55886f({'count':_0x19bd84[_0xa826('0x20')],'rows':_0x19bd84});});},'VoiceChannelMixMonitor':function(_0xb6171d){var _0x27d779=this;return new Promise(function(_0xddac0f,_0x5d40f5){if(ami['isConnected']()==![]){return _0x5d40f5(_0x27d779[_0xa826('0xf')](0x1f4,[config[_0xa826('0x10')]['ip'],config[_0xa826('0x10')][_0xa826('0x25')],'ami\x20disconnected'][_0xa826('0x11')]('\x20')));}var _0x3e308d=schema(properties['voicechannel'])[_0xa826('0x1')](_0xb6171d);if(_0x3e308d['length']>0x0){return _0x5d40f5(_0x27d779[_0xa826('0xf')](0x1f4,_[_0xa826('0x26')](_0x3e308d,_0xa826('0x17'))[_0xa826('0x11')](',\x20')));}var _0x24efa7=_['find'](_0x30875f[_0xa826('0x24')],{'uniqueid':_0xb6171d[_0xa826('0x27')]});if(_0x24efa7&&_0x24efa7[_0xa826('0x28')]){var _0x110ce5=util[_0xa826('0x6')](_0xa826('0x29'),_0xb6171d[_0xa826('0x2a')]||_0xb6171d[_0xa826('0x27')],_0xb6171d[_0xa826('0x6')]||_0xa826('0x2b'));return ami[_0xa826('0x15')]({'action':'MixMonitor','channel':_0x24efa7[_0xa826('0x28')],'file':_0x110ce5,'options':'ai(mixmonitorid)'})[_0xa826('0x16')](function(_0x4d8c2a){var _0x179c29=_[_0xa826('0x21')](_0x24efa7[_0xa826('0x2c')],{'filename':_0xa826('0x2d')+_0x110ce5[_0xa826('0x2e')]()});if(_[_0xa826('0x2f')](_0x179c29)){_0x24efa7[_0xa826('0x2c')][_0xa826('0x1f')]({'filename':_0xa826('0x2d')+_0x110ce5[_0xa826('0x2e')](),'createdAt':moment()[_0xa826('0x6')](_0xa826('0x30')),'mixmonitorid':_0x4d8c2a['mixmonitorid'],'status':_0xa826('0x31')});}else{_0x179c29[_0xa826('0x32')]=_0x4d8c2a[_0xa826('0x32')];_0x179c29['status']=_0xa826('0x31');}_0xddac0f({'code':0xc8,'message':[_0xb6171d[_0xa826('0x27')],'MixMonitor\x20Success',_0x4d8c2a[_0xa826('0x32')]]['join']('\x20'),'mixmonitorid':_0x4d8c2a['mixmonitorid']});})[_0xa826('0x18')](function(_0x111a3c){_0x5d40f5(_0x27d779[_0xa826('0xf')](0x1f5,[_0xb6171d[_0xa826('0x27')],_0x111a3c[_0xa826('0x17')][_0xa826('0x2e')]()]['join']('\x20')));});}else{return _0x5d40f5(_0x27d779[_0xa826('0xf')](0x1f5,_0xa826('0x33')));}});},'VoiceChannelStopMixMonitor':function(_0x2be07c){var _0x14fc0d=this;return new Promise(function(_0x244fd3,_0x19292e){if(ami['isConnected']()==![]){return _0x19292e(_0x14fc0d[_0xa826('0xf')](0x1f4,[config[_0xa826('0x10')]['ip'],config[_0xa826('0x10')][_0xa826('0x25')],_0xa826('0x1a')]['join']('\x20')));}var _0x3f7df5=schema(properties[_0xa826('0x34')])[_0xa826('0x1')](_0x2be07c);if(_0x3f7df5[_0xa826('0x20')]>0x0){return _0x19292e(_0x14fc0d[_0xa826('0xf')](0x1f4,_[_0xa826('0x26')](_0x3f7df5,_0xa826('0x17'))[_0xa826('0x11')](',\x20')));}var _0x459c79=_[_0xa826('0x21')](_0x30875f[_0xa826('0x24')],{'uniqueid':_0x2be07c[_0xa826('0x27')]});if(_0x459c79){return Promise['resolve']()[_0xa826('0x16')](function(){if(_0x459c79[_0xa826('0x28')]){return ami[_0xa826('0x15')]({'action':'StopMixMonitor','channel':_0x459c79[_0xa826('0x28')],'mixmonitorid':_0x2be07c[_0xa826('0x32')]})[_0xa826('0x18')](function(){});}})[_0xa826('0x16')](function(){if(_0x459c79[_0xa826('0x35')]){return ami['Action']({'action':_0xa826('0x36'),'channel':_0x459c79[_0xa826('0x35')],'mixmonitorid':_0x2be07c[_0xa826('0x32')]})[_0xa826('0x18')](function(){});}})[_0xa826('0x16')](function(){var _0x30aac0=_[_0xa826('0x21')](_0x459c79['monitors'],{'mixmonitorid':_0x2be07c[_0xa826('0x32')]});if(_0x30aac0){_0x30aac0['status']='stop';}})['then'](function(){var _0x26a858=util[_0xa826('0x6')](_0xa826('0x29'),_0x2be07c[_0xa826('0x2a')]||_0x2be07c['uniqueid'],_0x2be07c[_0xa826('0x6')]||'wav');var _0x5e0947=_[_0xa826('0x21')](_0x459c79[_0xa826('0x2c')],{'filename':'/var/spool/asterisk/monitor/'+_0x26a858[_0xa826('0x2e')]()});if(_0x5e0947){_0x5e0947[_0xa826('0x37')]='stop';}})['then'](function(){_0x244fd3({'code':0xc8,'message':[_0x2be07c['uniqueid'],'StopMixMonitor\x20Success']['join']('\x20')});})['catch'](function(_0x4f0b33){_0x19292e(_0x14fc0d[_0xa826('0xf')](0x1f5,[_0x2be07c['uniqueid'],_0x4f0b33[_0xa826('0x17')]['toLowerCase']()][_0xa826('0x11')]('\x20')));});}else{return _0x19292e(_0x14fc0d[_0xa826('0xf')](0x1f5,_0xa826('0x33')));}});},'VoiceQueuesChannels':function(_0x302a52){var _0x27f3a8=this;return new Promise(function(_0x52cf5e){var _0x209704=_['values'](_0x30875f['queueChannels']);var _0x3f258c={'count':_0x209704[_0xa826('0x20')],'rows':_0x209704};if(_0x302a52&&_0x302a52['type']){if(![_0xa826('0x38'),_0xa826('0x39')][_0xa826('0x3a')](_0x302a52['type'])){return _0x45154f(_0x27f3a8[_0xa826('0xf')](0x190,_0xa826('0x3b')));}var _0x2845ec=_[_0xa826('0x3c')](_0x209704,function(_0x3806a5){return _0x3806a5[_0xa826('0x3d')]===_0x302a52[_0xa826('0x3d')];});_0x3f258c[_0xa826('0x3e')]=_0x2845ec['length'];_0x3f258c[_0xa826('0x3f')]=_0x2845ec;}_0x52cf5e(_0x3f258c);});},'VoiceQueuesChannel':function(_0x3a2510){var _0x363df5=this;return new Promise(function(_0x2d39ad,_0x3f3e8b){var _0x4a1dfe=schema(properties[_0xa826('0x40')])[_0xa826('0x1')](_0x3a2510);if(_0x4a1dfe[_0xa826('0x20')]>0x0){return _0x3f3e8b(_0x363df5['error'](0x1f4,_[_0xa826('0x26')](_0x4a1dfe,_0xa826('0x17'))['join'](',\x20')));}var _0x10b8da=_[_0xa826('0x21')](_0x30875f[_0xa826('0x41')],{'uniqueid':_0x3a2510[_0xa826('0x27')]});if(_0x10b8da){_0x2d39ad(_0x10b8da);}else{return _0x3f3e8b(_0x363df5[_0xa826('0xf')](0x1f5,_0xa826('0x33')));}});},'VoiceQueuesChannelHangup':function(_0x21469f){var _0x115337=this;return new Promise(function(_0x1d5ad1,_0x2287ea){if(ami[_0xa826('0x19')]()==![]){return _0x2287ea(_0x115337['error'](0x1f4,[config[_0xa826('0x10')]['ip'],config[_0xa826('0x10')][_0xa826('0x25')],_0xa826('0x1a')][_0xa826('0x11')]('\x20')));}var _0x2f4b12=schema(properties[_0xa826('0x42')])[_0xa826('0x1')](_0x21469f);if(_0x2f4b12['length']>0x0){return _0x2287ea(_0x115337[_0xa826('0xf')](0x1f4,_[_0xa826('0x26')](_0x2f4b12,_0xa826('0x17'))['join'](',\x20')));}var _0x1a38f6=_[_0xa826('0x21')](_0x30875f[_0xa826('0x41')],{'uniqueid':_0x21469f['uniqueid']});if(_0x1a38f6&&_0x1a38f6['channel']){return ami[_0xa826('0x15')]({'action':_0xa826('0x43'),'channel':_0x1a38f6[_0xa826('0x28')]})[_0xa826('0x16')](function(_0x478e95){_0x1d5ad1({'code':0xc8,'message':[_0x21469f[_0xa826('0x27')],_0x478e95[_0xa826('0x17')][_0xa826('0x2e')]()][_0xa826('0x11')]('\x20')});})[_0xa826('0x18')](function(_0x46bc53){_0x2287ea(_0x115337[_0xa826('0xf')](0x1f5,[_0x21469f[_0xa826('0x27')],_0x46bc53[_0xa826('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2287ea(_0x115337['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x215601){var _0x19437f=this;return new Promise(function(_0x8149d7,_0x176a81){if(ami[_0xa826('0x19')]()==![]){return _0x176a81(_0x19437f[_0xa826('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xa826('0x10')][_0xa826('0x25')],_0xa826('0x1a')]['join']('\x20')));}var _0x341750=schema(properties[_0xa826('0x44')])[_0xa826('0x1')](_0x215601);if(_0x341750[_0xa826('0x20')]>0x0){return _0x176a81(_0x19437f[_0xa826('0xf')](0x1f4,_[_0xa826('0x26')](_0x341750,_0xa826('0x17'))[_0xa826('0x11')](',\x20')));}var _0x464bb9=_[_0xa826('0x21')](_0x30875f[_0xa826('0x41')],{'uniqueid':_0x215601[_0xa826('0x27')]});if(_0x464bb9&&_0x464bb9[_0xa826('0x28')]){return ami[_0xa826('0x15')]({'action':_0xa826('0x45'),'channel':_0x464bb9['channel'],'exten':_0x215601[_0xa826('0x46')],'context':_0x215601['context']||_0x464bb9[_0xa826('0x47')],'priority':0x1})['then'](function(_0x36dd93){_0x8149d7({'code':0xc8,'message':[_0x215601['uniqueid'],_0x36dd93[_0xa826('0x17')][_0xa826('0x2e')]()][_0xa826('0x11')]('\x20')});})['catch'](function(_0x5d41f8){_0x176a81(_0x19437f['error'](0x1f5,[_0x215601[_0xa826('0x27')],_0x5d41f8[_0xa826('0x17')][_0xa826('0x2e')]()]['join']('\x20')));});}else{return _0x176a81(_0x19437f[_0xa826('0xf')](0x1f5,_0xa826('0x33')));}});},'Agents':function(_0x19e39f){return new Promise(function(_0x425fe2){var _0x594c8d=_[_0xa826('0x48')](_0x30875f[_0xa826('0xb')]);if(_0x19e39f&&_0x19e39f['id']){var _0x3a9f91=_[_0xa826('0x21')](_0x594c8d,function(_0xcce875){return _0xcce875['id']===_0x19e39f['id'];});_0x425fe2(_0x3a9f91);}else{_0x425fe2({'count':_0x594c8d['length'],'rows':_0x594c8d});}});},'Telephones':function(){return new Promise(function(_0x5f0a0a){var _0x28a81d=_[_0xa826('0x48')](_0x30875f[_0xa826('0x49')]);_0x5f0a0a({'count':_0x28a81d[_0xa826('0x20')],'rows':_0x28a81d});});},'Trunks':function(){return new Promise(function(_0x235870){var _0x501d6f=_['values'](_0x30875f[_0xa826('0x4a')]);_0x235870({'count':_0x501d6f[_0xa826('0x20')],'rows':_0x501d6f});});},'OutboundChannels':function(){return new Promise(function(_0x3339a9){var _0x3912af=_[_0xa826('0x48')](_0x30875f[_0xa826('0x4b')]);_0x3339a9({'count':_0x3912af['length'],'rows':_0x3912af});});},'Outbound':function(){return new Promise(function(_0x2cd92e){_0x2cd92e(_0x30875f['outbound']);});},'Campaigns':function(){return new Promise(function(_0x2fc42e){var _0xf7f2de=_['values'](_0x30875f[_0xa826('0x4c')]);_0x2fc42e({'count':_0xf7f2de['length'],'rows':_0xf7f2de});});},'VoiceQueuesPreview':function(_0x108510){var _0x4791e2=this;return new Promise(function(_0x232b5f,_0x1518d3){_0x15f777[_0xa826('0x4d')](_0x108510['id'])[_0xa826('0x16')](function(_0x1fe35d){_0x232b5f({'code':0xc8,'message':_0x1fe35d[_0xa826('0x17')]});})['catch'](function(_0x5c92ce){_0x1518d3(_0x4791e2[_0xa826('0xf')](0x1f4,_0x5c92ce['message']));});});},'EventManager':function(_0x6a2528){var _0x1b3c99=this;return new Promise(function(_0x412158,_0x486470){if(!_0x6a2528[_0xa826('0x4e')]){return _0x486470(_0x1b3c99[_0xa826('0xf')](0x1f4,_0xa826('0x4f')));}ami[_0xa826('0x50')](_0xa826('0x51')+_0x6a2528['event'],_0x6a2528[_0xa826('0x17')]);_0x412158({'code':0xc8,'message':_0x6a2528});});},'FaxAccounts':function(){return new Promise(function(_0x156949){var _0x31c2f3=_[_0xa826('0x48')](_0x30875f[_0xa826('0x52')]);_0x156949({'count':_0x31c2f3[_0xa826('0x20')],'rows':_0x31c2f3});});},'SendFax':function(_0x22cc5c){var _0x32b22=this;return new Promise(function(_0x1b7eaf,_0x1f42f3){_0x3929d4['send'](_0x22cc5c)[_0xa826('0x16')](function(_0x103b7e){_0x1b7eaf({'code':0xc8,'message':_0x103b7e['message']});})['catch'](function(_0x28aabc){_0x1f42f3(_0x32b22[_0xa826('0xf')](0x1f4,_0x28aabc['message']));});});},'CheckAfterSend':function(_0x1d26c7){var _0x5fc4ad=this;return new Promise(function(_0x336ca8,_0x36a996){_0x3929d4['checkAfterSend'](_0x1d26c7)['then'](function(_0x46ec4a){_0x336ca8({'code':0xc8,'message':_0x46ec4a[_0xa826('0x17')]});})['catch'](function(_0x3447f5){_0x36a996(_0x5fc4ad[_0xa826('0xf')](0x1f4,_0x3447f5[_0xa826('0x17')]));});});}};var _0xb8d5ad=jayson[_0xa826('0x53')](_0x4124f5)[_0xa826('0x54')]();_0xb8d5ad['on'](_0xa826('0xf'),function(_0x471ea9){return _0x45154f(_0x471ea9);});_0xb8d5ad['listen'](0x232a,_0xa826('0x55'),function(){console[_0xa826('0x56')](_0xa826('0x57'),0x232a);return _0x34327b(_0xa826('0x58')+0x232a);});});};
\ No newline at end of file
+var _0xcca7=['action','content','catch','voiceQueues','hasOwnProperty','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','count','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../properties','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','Reload','Action','then','message','pick','command'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xcca7,0x1aa));var _0x7cca=function(_0x5e0943,_0x17fc05){_0x5e0943=_0x5e0943-0x0;var _0x35449b=_0xcca7[_0x5e0943];return _0x35449b;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var jayson=require(_0x7cca('0x2'));var schema=require(_0x7cca('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x7cca('0x4'));var ami=require('../ami');var VoiceQueueSummary=require(_0x7cca('0x5'));exports[_0x7cca('0x6')]=function(_0x2126f7,_0x312e98,_0x1c6c95){return new Promise(function(_0xe70805,_0x5aec51){var _0x508f29={'QueuePause':function(_0x937fad){return new Promise(function(_0xd7a28d){var _0x1aed1b=util[_0x7cca('0x7')](_0x7cca('0x8'),_0x7cca('0x9'),_0x937fad[_0x7cca('0xa')]);if(_0x2126f7[_0x7cca('0xb')]&&_0x2126f7[_0x7cca('0xb')][_0x1aed1b]&&_0x2126f7[_0x7cca('0xb')][_0x1aed1b]['timer']){_0x2126f7[_0x7cca('0xb')][_0x1aed1b][_0x7cca('0xc')]();}if(_0x2126f7[_0x7cca('0xd')][_0x1aed1b]){_0x2126f7[_0x7cca('0xd')][_0x1aed1b][_0x7cca('0xe')]({'statePause':_0x937fad['pause']?!![]:![]});}_0xd7a28d({'code':0xc8,'message':_0x7cca('0xf')});});},'Reload':function(_0x41e0a2){var _0x2854c7=this;return new Promise(function(_0x4d0d6d,_0x54e492){if(ami[_0x7cca('0x10')]()==![]){return _0x54e492(_0x2854c7[_0x7cca('0x11')](0x1f4,[config[_0x7cca('0x12')]['ip'],config[_0x7cca('0x12')][_0x7cca('0x13')],_0x7cca('0x14')][_0x7cca('0x15')]('\x20')));}_0x41e0a2=_['pick'](_0x41e0a2,_[_0x7cca('0x16')](properties['reload']['module']));_0x41e0a2['action']=_0x7cca('0x17');return ami[_0x7cca('0x18')](_0x41e0a2)[_0x7cca('0x19')](function(_0x33db6b){_0x4d0d6d({'code':0xc8,'message':_0x33db6b[_0x7cca('0x1a')]});})['catch'](function(_0xb35e1d){_0x54e492(_0x2854c7['error'](0x1f5,_0xb35e1d['message']));});});},'Command':function(_0x5d7ac6){var _0x370469=this;return new Promise(function(_0x25297b,_0x2beb6c){if(ami[_0x7cca('0x10')]()==![]){return _0x2beb6c(_0x370469[_0x7cca('0x11')](0x1f4,[config[_0x7cca('0x12')]['ip'],config[_0x7cca('0x12')][_0x7cca('0x13')],'ami\x20disconnected'][_0x7cca('0x15')]('\x20')));}_0x5d7ac6=_[_0x7cca('0x1b')](_0x5d7ac6,_0x7cca('0x1c'));_0x5d7ac6[_0x7cca('0x1d')]='Command';return ami[_0x7cca('0x18')](_0x5d7ac6)[_0x7cca('0x19')](function(_0x4367f9){_0x25297b({'code':0xc8,'message':_0x4367f9[_0x7cca('0x1e')]});})[_0x7cca('0x1f')](function(_0x3fc157){_0x2beb6c(_0x370469[_0x7cca('0x11')](0x1f5,_0x3fc157[_0x7cca('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4b99b6){var _0xfe121c=[];for(var _0x1dd3b3 in _0x2126f7[_0x7cca('0x20')]){if(_0x2126f7[_0x7cca('0x20')][_0x7cca('0x21')](_0x1dd3b3)){var _0x21da68=_0x2126f7[_0x7cca('0x20')][_0x1dd3b3];var _0x40ac86=new VoiceQueueSummary(_0x21da68);_0xfe121c['push'](_0x40ac86);}}_0x4b99b6({'count':_0xfe121c[_0x7cca('0x22')],'rows':_0xfe121c});});},'UpdateVoiceQueue':function(_0x5c8410){return new Promise(function(_0xc86c1b,_0x201fbb){var _0x5a87d6=_[_0x7cca('0x23')](_0x2126f7[_0x7cca('0x20')],{'id':parseInt(_0x5c8410['id'])});var _0x5533fb=_[_0x7cca('0x24')](_0x5c8410,['id']);if(_0x5a87d6){for(var _0x1cd53a in _0x5533fb){if(typeof _0x5533fb[_0x1cd53a]!==_0x7cca('0x25')&&typeof _0x5a87d6[_0x1cd53a]!=='undefined'){_0x5a87d6[_0x1cd53a]=_0x5533fb[_0x1cd53a];}}_0xc86c1b(_0x5a87d6);}else{_0x201fbb();}});},'VoiceChannels':function(){return new Promise(function(_0x5adfd1){var _0x41f5bc=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0x27')]);_0x5adfd1({'count':_0x41f5bc[_0x7cca('0x22')],'rows':_0x41f5bc});});},'VoiceChannelMixMonitor':function(_0x34336c){var _0xe1ee18=this;return new Promise(function(_0x3a77c8,_0x5a2c7c){if(ami['isConnected']()==![]){return _0x5a2c7c(_0xe1ee18[_0x7cca('0x11')](0x1f4,[config[_0x7cca('0x12')]['ip'],config[_0x7cca('0x12')]['username'],_0x7cca('0x14')]['join']('\x20')));}var _0x2061fe=schema(properties[_0x7cca('0x28')])[_0x7cca('0x3')](_0x34336c);if(_0x2061fe[_0x7cca('0x22')]>0x0){return _0x5a2c7c(_0xe1ee18['error'](0x1f4,_[_0x7cca('0x29')](_0x2061fe,_0x7cca('0x1a'))[_0x7cca('0x15')](',\x20')));}var _0x52eaf7=_['find'](_0x2126f7['channels'],{'uniqueid':_0x34336c[_0x7cca('0x2a')]});if(_0x52eaf7&&_0x52eaf7[_0x7cca('0x2b')]){var _0x4e2fbe=util[_0x7cca('0x7')](_0x7cca('0x2c'),_0x34336c[_0x7cca('0x2d')]||_0x34336c[_0x7cca('0x2a')],_0x34336c[_0x7cca('0x7')]||_0x7cca('0x2e'));return ami[_0x7cca('0x18')]({'action':'MixMonitor','channel':_0x52eaf7[_0x7cca('0x2b')],'file':_0x4e2fbe,'options':_0x7cca('0x2f')})[_0x7cca('0x19')](function(_0x147cf8){var _0x4f28ac=_[_0x7cca('0x23')](_0x52eaf7[_0x7cca('0x30')],{'filename':_0x7cca('0x31')+_0x4e2fbe['toLowerCase']()});if(_[_0x7cca('0x32')](_0x4f28ac)){_0x52eaf7['monitors'][_0x7cca('0x33')]({'filename':_0x7cca('0x31')+_0x4e2fbe[_0x7cca('0x34')](),'createdAt':moment()[_0x7cca('0x7')](_0x7cca('0x35')),'mixmonitorid':_0x147cf8[_0x7cca('0x36')],'status':_0x7cca('0x37')});}else{_0x4f28ac[_0x7cca('0x36')]=_0x147cf8[_0x7cca('0x36')];_0x4f28ac['status']='rec';}_0x3a77c8({'code':0xc8,'message':[_0x34336c[_0x7cca('0x2a')],_0x7cca('0x38'),_0x147cf8['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x147cf8[_0x7cca('0x36')]});})[_0x7cca('0x1f')](function(_0x1837b0){_0x5a2c7c(_0xe1ee18[_0x7cca('0x11')](0x1f5,[_0x34336c[_0x7cca('0x2a')],_0x1837b0['message'][_0x7cca('0x34')]()]['join']('\x20')));});}else{return _0x5a2c7c(_0xe1ee18['error'](0x1f5,_0x7cca('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x33d069){var _0x4c27de=this;return new Promise(function(_0x3b120b,_0x5d1a4a){if(ami[_0x7cca('0x10')]()==![]){return _0x5d1a4a(_0x4c27de[_0x7cca('0x11')](0x1f4,[config[_0x7cca('0x12')]['ip'],config['asterisk'][_0x7cca('0x13')],_0x7cca('0x14')][_0x7cca('0x15')]('\x20')));}var _0x3e7f95=schema(properties['voicechannel'])[_0x7cca('0x3')](_0x33d069);if(_0x3e7f95[_0x7cca('0x22')]>0x0){return _0x5d1a4a(_0x4c27de[_0x7cca('0x11')](0x1f4,_[_0x7cca('0x29')](_0x3e7f95,_0x7cca('0x1a'))[_0x7cca('0x15')](',\x20')));}var _0x57f440=_['find'](_0x2126f7['channels'],{'uniqueid':_0x33d069['uniqueid']});if(_0x57f440){return Promise[_0x7cca('0x3a')]()['then'](function(){if(_0x57f440['channel']){return ami[_0x7cca('0x18')]({'action':_0x7cca('0x3b'),'channel':_0x57f440[_0x7cca('0x2b')],'mixmonitorid':_0x33d069[_0x7cca('0x36')]})[_0x7cca('0x1f')](function(){});}})['then'](function(){if(_0x57f440[_0x7cca('0x3c')]){return ami[_0x7cca('0x18')]({'action':_0x7cca('0x3b'),'channel':_0x57f440[_0x7cca('0x3c')],'mixmonitorid':_0x33d069[_0x7cca('0x36')]})[_0x7cca('0x1f')](function(){});}})[_0x7cca('0x19')](function(){var _0x71f1d0=_[_0x7cca('0x23')](_0x57f440[_0x7cca('0x30')],{'mixmonitorid':_0x33d069[_0x7cca('0x36')]});if(_0x71f1d0){_0x71f1d0['status']='stop';}})[_0x7cca('0x19')](function(){var _0x5913eb=util[_0x7cca('0x7')](_0x7cca('0x2c'),_0x33d069[_0x7cca('0x2d')]||_0x33d069[_0x7cca('0x2a')],_0x33d069[_0x7cca('0x7')]||_0x7cca('0x2e'));var _0x184b56=_[_0x7cca('0x23')](_0x57f440[_0x7cca('0x30')],{'filename':_0x7cca('0x31')+_0x5913eb['toLowerCase']()});if(_0x184b56){_0x184b56[_0x7cca('0x3d')]=_0x7cca('0x3e');}})[_0x7cca('0x19')](function(){_0x3b120b({'code':0xc8,'message':[_0x33d069[_0x7cca('0x2a')],_0x7cca('0x3f')][_0x7cca('0x15')]('\x20')});})[_0x7cca('0x1f')](function(_0x19298c){_0x5d1a4a(_0x4c27de[_0x7cca('0x11')](0x1f5,[_0x33d069[_0x7cca('0x2a')],_0x19298c[_0x7cca('0x1a')][_0x7cca('0x34')]()][_0x7cca('0x15')]('\x20')));});}else{return _0x5d1a4a(_0x4c27de[_0x7cca('0x11')](0x1f5,_0x7cca('0x39')));}});},'VoiceQueuesChannels':function(_0x123727){var _0x45d6ff=this;return new Promise(function(_0x27c527){var _0x343a64=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0x40')]);var _0xa7c67d={'count':_0x343a64[_0x7cca('0x22')],'rows':_0x343a64};if(_0x123727&&_0x123727[_0x7cca('0x41')]){if(![_0x7cca('0x42'),_0x7cca('0x43')]['includes'](_0x123727[_0x7cca('0x41')])){return _0x5aec51(_0x45d6ff[_0x7cca('0x11')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x49bce5=_['filter'](_0x343a64,function(_0x41278c){return _0x41278c[_0x7cca('0x41')]===_0x123727['type'];});_0xa7c67d[_0x7cca('0x44')]=_0x49bce5[_0x7cca('0x22')];_0xa7c67d['rows']=_0x49bce5;}_0x27c527(_0xa7c67d);});},'VoiceQueuesChannel':function(_0x347496){var _0x4e871b=this;return new Promise(function(_0x1aa39b,_0x385e4e){var _0x33300a=schema(properties[_0x7cca('0x45')])[_0x7cca('0x3')](_0x347496);if(_0x33300a[_0x7cca('0x22')]>0x0){return _0x385e4e(_0x4e871b[_0x7cca('0x11')](0x1f4,_[_0x7cca('0x29')](_0x33300a,_0x7cca('0x1a'))[_0x7cca('0x15')](',\x20')));}var _0x172ce1=_[_0x7cca('0x23')](_0x2126f7[_0x7cca('0x40')],{'uniqueid':_0x347496['uniqueid']});if(_0x172ce1){_0x1aa39b(_0x172ce1);}else{return _0x385e4e(_0x4e871b[_0x7cca('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x2078e8){var _0x4d37ba=this;return new Promise(function(_0x372c73,_0x282e6b){if(ami[_0x7cca('0x10')]()==![]){return _0x282e6b(_0x4d37ba['error'](0x1f4,[config[_0x7cca('0x12')]['ip'],config[_0x7cca('0x12')][_0x7cca('0x13')],_0x7cca('0x14')][_0x7cca('0x15')]('\x20')));}var _0x538b56=schema(properties['voicequeuechannelhangup'])[_0x7cca('0x3')](_0x2078e8);if(_0x538b56[_0x7cca('0x22')]>0x0){return _0x282e6b(_0x4d37ba[_0x7cca('0x11')](0x1f4,_[_0x7cca('0x29')](_0x538b56,_0x7cca('0x1a'))[_0x7cca('0x15')](',\x20')));}var _0x474a24=_[_0x7cca('0x23')](_0x2126f7[_0x7cca('0x40')],{'uniqueid':_0x2078e8[_0x7cca('0x2a')]});if(_0x474a24&&_0x474a24[_0x7cca('0x2b')]){return ami[_0x7cca('0x18')]({'action':_0x7cca('0x46'),'channel':_0x474a24['channel']})[_0x7cca('0x19')](function(_0x4e3582){_0x372c73({'code':0xc8,'message':[_0x2078e8['uniqueid'],_0x4e3582[_0x7cca('0x1a')][_0x7cca('0x34')]()][_0x7cca('0x15')]('\x20')});})['catch'](function(_0x1985b){_0x282e6b(_0x4d37ba[_0x7cca('0x11')](0x1f5,[_0x2078e8[_0x7cca('0x2a')],_0x1985b[_0x7cca('0x1a')][_0x7cca('0x34')]()]['join']('\x20')));});}else{return _0x282e6b(_0x4d37ba[_0x7cca('0x11')](0x1f5,_0x7cca('0x39')));}});},'VoiceQueuesChannelRedirect':function(_0x3bf984){var _0x3da37b=this;return new Promise(function(_0x4ae638,_0x399d14){if(ami[_0x7cca('0x10')]()==![]){return _0x399d14(_0x3da37b['error'](0x1f4,[config[_0x7cca('0x12')]['ip'],config['asterisk'][_0x7cca('0x13')],'ami\x20disconnected'][_0x7cca('0x15')]('\x20')));}var _0x3aa651=schema(properties[_0x7cca('0x47')])[_0x7cca('0x3')](_0x3bf984);if(_0x3aa651[_0x7cca('0x22')]>0x0){return _0x399d14(_0x3da37b[_0x7cca('0x11')](0x1f4,_[_0x7cca('0x29')](_0x3aa651,_0x7cca('0x1a'))[_0x7cca('0x15')](',\x20')));}var _0x468ffa=_[_0x7cca('0x23')](_0x2126f7[_0x7cca('0x40')],{'uniqueid':_0x3bf984[_0x7cca('0x2a')]});if(_0x468ffa&&_0x468ffa[_0x7cca('0x2b')]){return ami['Action']({'action':_0x7cca('0x48'),'channel':_0x468ffa[_0x7cca('0x2b')],'exten':_0x3bf984[_0x7cca('0x49')],'context':_0x3bf984['context']||_0x468ffa[_0x7cca('0x4a')],'priority':0x1})['then'](function(_0x10c470){_0x4ae638({'code':0xc8,'message':[_0x3bf984[_0x7cca('0x2a')],_0x10c470[_0x7cca('0x1a')][_0x7cca('0x34')]()][_0x7cca('0x15')]('\x20')});})[_0x7cca('0x1f')](function(_0xb6832){_0x399d14(_0x3da37b[_0x7cca('0x11')](0x1f5,[_0x3bf984[_0x7cca('0x2a')],_0xb6832[_0x7cca('0x1a')][_0x7cca('0x34')]()][_0x7cca('0x15')]('\x20')));});}else{return _0x399d14(_0x3da37b[_0x7cca('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x36fc17){return new Promise(function(_0x4ac68e){var _0xca272e=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0xd')]);if(_0x36fc17&&_0x36fc17['id']){var _0x3422cf=_['find'](_0xca272e,function(_0x319a03){return _0x319a03['id']===_0x36fc17['id'];});_0x4ac68e(_0x3422cf);}else{_0x4ac68e({'count':_0xca272e[_0x7cca('0x22')],'rows':_0xca272e});}});},'Telephones':function(){return new Promise(function(_0x2e981b){var _0x209b37=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0x4b')]);_0x2e981b({'count':_0x209b37['length'],'rows':_0x209b37});});},'Trunks':function(){return new Promise(function(_0x41fde5){var _0x479558=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0x4c')]);_0x41fde5({'count':_0x479558[_0x7cca('0x22')],'rows':_0x479558});});},'OutboundChannels':function(){return new Promise(function(_0xdada0d){var _0x33dfec=_[_0x7cca('0x26')](_0x2126f7[_0x7cca('0x4d')]);_0xdada0d({'count':_0x33dfec['length'],'rows':_0x33dfec});});},'Outbound':function(){return new Promise(function(_0x1ef432){_0x1ef432(_0x2126f7[_0x7cca('0x43')]);});},'Campaigns':function(){return new Promise(function(_0x4c55e6){var _0x327227=_['values'](_0x2126f7[_0x7cca('0x4e')]);_0x4c55e6({'count':_0x327227[_0x7cca('0x22')],'rows':_0x327227});});},'VoiceQueuesPreview':function(_0x313cd1){var _0x27e79c=this;return new Promise(function(_0x1a490b,_0x2af32b){_0x312e98[_0x7cca('0x4f')](_0x313cd1['id'])[_0x7cca('0x19')](function(_0x6a8a74){_0x1a490b({'code':0xc8,'message':_0x6a8a74[_0x7cca('0x1a')]});})['catch'](function(_0x3bc1a7){_0x2af32b(_0x27e79c[_0x7cca('0x11')](0x1f4,_0x3bc1a7[_0x7cca('0x1a')]));});});},'EventManager':function(_0x294484){var _0x37deae=this;return new Promise(function(_0x2395c8,_0x414d6c){if(!_0x294484[_0x7cca('0x50')]){return _0x414d6c(_0x37deae['error'](0x1f4,_0x7cca('0x51')));}ami[_0x7cca('0x52')](_0x7cca('0x53')+_0x294484['event'],_0x294484[_0x7cca('0x1a')]);_0x2395c8({'code':0xc8,'message':_0x294484});});},'FaxAccounts':function(){return new Promise(function(_0x174fbd){var _0x56c665=_[_0x7cca('0x26')](_0x2126f7['faxAccounts']);_0x174fbd({'count':_0x56c665[_0x7cca('0x22')],'rows':_0x56c665});});},'SendFax':function(_0x198784){var _0x2e93d6=this;return new Promise(function(_0xaa0e03,_0xf759d9){_0x1c6c95[_0x7cca('0x54')](_0x198784)[_0x7cca('0x19')](function(_0x4d8f5d){_0xaa0e03({'code':0xc8,'message':_0x4d8f5d[_0x7cca('0x1a')]});})[_0x7cca('0x1f')](function(_0x1fd60d){_0xf759d9(_0x2e93d6[_0x7cca('0x11')](0x1f4,_0x1fd60d[_0x7cca('0x1a')]));});});},'CheckAfterSend':function(_0x5afecc){var _0x30204b=this;return new Promise(function(_0x1c45c3,_0x5465d7){_0x1c6c95[_0x7cca('0x55')](_0x5afecc)[_0x7cca('0x19')](function(_0x5d23d5){_0x1c45c3({'code':0xc8,'message':_0x5d23d5[_0x7cca('0x1a')]});})[_0x7cca('0x1f')](function(_0x23ce9b){_0x5465d7(_0x30204b[_0x7cca('0x11')](0x1f4,_0x23ce9b[_0x7cca('0x1a')]));});});}};var _0x40a3e8=jayson[_0x7cca('0x56')](_0x508f29)[_0x7cca('0x57')]();_0x40a3e8['on'](_0x7cca('0x11'),function(_0xfde4f3){return _0x5aec51(_0xfde4f3);});_0x40a3e8[_0x7cca('0x6')](0x232a,_0x7cca('0x58'),function(){console['log'](_0x7cca('0x59'),0x232a);return _0xe70805(_0x7cca('0x5a')+0x232a);});});};
\ No newline at end of file
index c842b5b..93cd04d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd87=['routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','uniqueid','data4','isNil','calleridname','<unknown>','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','emit','exec','data2','data5','xmd-contactid','data3','split','phone','map'];(function(_0x424900,_0x5565b8){var _0x32968d=function(_0x1255c9){while(--_0x1255c9){_0x424900['push'](_0x424900['shift']());}};_0x32968d(++_0x5565b8);}(_0xbd87,0x84));var _0x7bd8=function(_0xbc1f5f,_0xbde0a6){_0xbc1f5f=_0xbc1f5f-0x0;var _0x1bc6f7=_0xbd87[_0xbc1f5f];return _0x1bc6f7;};'use strict';var _=require('lodash');var BPromise=require(_0x7bd8('0x0'));var Redis=require(_0x7bd8('0x1'));var util=require(_0x7bd8('0x2'));var config=require(_0x7bd8('0x3'));var logger=require(_0x7bd8('0x4'))(_0x7bd8('0x5'));var cmContactRpc=require(_0x7bd8('0x6'));config[_0x7bd8('0x7')]=_[_0x7bd8('0x8')](config[_0x7bd8('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x7bd8('0x9'))(new Redis(config['redis']));function emit(_0x1441d8,_0x83bd0e,_0x514577,_0x2039ef,_0x1a250c){logger[_0x7bd8('0xa')]('[CM][%s][%s]',_0x1441d8,_0x83bd0e['id'],_0x514577,_0x2039ef,JSON[_0x7bd8('0xb')](_0x1a250c));io['to'](_0x514577)[_0x7bd8('0xc')](_0x2039ef,_0x1a250c);}exports[_0x7bd8('0xd')]=function(_0x44d0dc,_0x3c7bec,_0xc531f8,_0x1809b5){var _0x28effc,_0xcea16c;var _0x2bc5b8={};var _0x49547c;var _0x17b324=Number(_0xc531f8['data1']);var _0x5d80e7=_0xc531f8[_0x7bd8('0xe')]?Boolean(Number(_0xc531f8[_0x7bd8('0xe')])):![];var _0x2d25ac;var _0x103b69=![];if(!_['isNil'](_0xc531f8['data5'])){if(_0xc531f8[_0x7bd8('0xf')]=='1')_0x103b69=!![];}if(!_0x103b69){if(_0x1809b5[_0x7bd8('0x10')]){_0x2bc5b8['id']=_0x1809b5[_0x7bd8('0x10')];}}if(!_0x2bc5b8['id']){_0x2bc5b8['ListId']=_0x17b324;_0x2d25ac=_0xc531f8['data3']&&_0xc531f8[_0x7bd8('0x11')]!=='0'?_0xc531f8[_0x7bd8('0x11')][_0x7bd8('0x12')](','):[_0x7bd8('0x13')];_0x2bc5b8['$or']=_[_0x7bd8('0x14')](_0x2d25ac,function(_0x39c046){var _0xd5dd5e={};_0xd5dd5e[_0x39c046]=_0x1809b5[_0x7bd8('0x15')]?_0x1809b5[_0x7bd8('0x16')]:_0x1809b5[_0x7bd8('0x17')];return _0xd5dd5e;});_0x49547c=_0x1809b5['routeId']?_0x1809b5[_0x7bd8('0x16')]:_0x1809b5[_0x7bd8('0x17')];}var _0x4c3edf=['id',_0x7bd8('0x18'),'lastName',_0x7bd8('0x13'),_0x7bd8('0x19'),_0x7bd8('0x1a'),'ListId',_0x7bd8('0x1b'),_0x7bd8('0x1c'),_0x7bd8('0x1d')];var _0x30b3ef=_['union'](_0x4c3edf,_0x2d25ac);BPromise[_0x7bd8('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x30b3ef,'where':_0x2bc5b8,'phone':_0x49547c}))[_0x7bd8('0x1f')](function(_0x6cd6b0){_0xcea16c=_0x6cd6b0;if(!_[_0x7bd8('0x20')](_0xcea16c)){if(_0xcea16c[_0x7bd8('0x21')]===0x1){_0x28effc=_0xcea16c[0x0];logger[_0x7bd8('0xa')](_0x7bd8('0x22'),_0x1809b5['uniqueid'],_0x3c7bec['id'],_0x28effc['id']);}else{logger[_0x7bd8('0xa')](_0x7bd8('0x23'),_0x1809b5['uniqueid'],_0x3c7bec['id'],_[_0x7bd8('0x14')](_0xcea16c,'id')[_0x7bd8('0x24')](','));}return;}else{logger[_0x7bd8('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x1809b5[_0x7bd8('0x25')],_0x3c7bec['id']);var _0x2da419={'ListId':_0x17b324};var _0x235685=_0xc531f8['data4']&&_0xc531f8[_0x7bd8('0x26')]!=='0'?_0xc531f8[_0x7bd8('0x26')]:_0x7bd8('0x13');if(_0x5d80e7){logger[_0x7bd8('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1809b5['uniqueid'],_0x3c7bec['id']);_0x2da419[_0x235685]=_[_0x7bd8('0x27')](_0x1809b5[_0x7bd8('0x15')])?_0x1809b5[_0x7bd8('0x17')]:_0x1809b5[_0x7bd8('0x16')];if(_[_0x7bd8('0x27')](_0x1809b5[_0x7bd8('0x15')])){_0x2da419[_0x7bd8('0x18')]=_0x1809b5[_0x7bd8('0x28')]&&_0x1809b5['calleridname']!==_0x7bd8('0x29')?_0x1809b5['calleridname']:_0x7bd8('0x2a');}else{_0x2da419['firstName']=_0x1809b5['destcalleridname']&&_0x1809b5['destcalleridname']!==_0x7bd8('0x29')?_0x1809b5[_0x7bd8('0x2b')]:_0x7bd8('0x2a');}return BPromise[_0x7bd8('0x1e')]()[_0x7bd8('0x1f')](cmContactRpc[_0x7bd8('0x2c')](_0x2da419))['then'](function(_0xc03d74){_0x28effc=_0xc03d74;_0xcea16c['push'](_0xc03d74);if(_0x28effc){logger[_0x7bd8('0xa')](_0x7bd8('0x2d'),_0x1809b5[_0x7bd8('0x25')],_0x3c7bec['id'],_0x28effc['id']);}return;});}else{logger[_0x7bd8('0xa')](_0x7bd8('0x2e'),_0x1809b5[_0x7bd8('0x25')],_0x3c7bec['id']);_0x2da419[_0x235685]=_['isNil'](_0x1809b5[_0x7bd8('0x15')])?_0x1809b5[_0x7bd8('0x17')]:_0x1809b5['destcalleridnum'];if(_[_0x7bd8('0x27')](_0x1809b5[_0x7bd8('0x15')])){_0x2da419[_0x7bd8('0x18')]=_0x1809b5[_0x7bd8('0x28')]&&_0x1809b5[_0x7bd8('0x28')]!==_0x7bd8('0x29')?_0x1809b5[_0x7bd8('0x28')]:_0x7bd8('0x2a');}else{_0x2da419[_0x7bd8('0x18')]=_0x1809b5[_0x7bd8('0x2b')]&&_0x1809b5[_0x7bd8('0x2b')]!==_0x7bd8('0x29')?_0x1809b5[_0x7bd8('0x2b')]:'Unknown';}_0x28effc=_0x2da419;_0xcea16c['push'](_0x2da419);return;}}})[_0x7bd8('0x1f')](function(){if(_0x44d0dc){emit(_0x1809b5[_0x7bd8('0x25')],_0x3c7bec,util[_0x7bd8('0x2f')]('user:%s',_0x44d0dc[_0x7bd8('0x30')]),util[_0x7bd8('0x2f')](_0x7bd8('0x31'),_0xc531f8['action']['toLowerCase']()),{'evt':_[_0x7bd8('0x32')](_0x1809b5,{'autoCreate':_0x5d80e7}),'contact':_0x28effc===undefined?{}:_0x28effc,'contacts':_0xcea16c['length']===0x0?undefined:_0xcea16c});}});};
\ No newline at end of file
+var _0x5865=['user:%s','format','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','<unknown>','Unknown','destcalleridname','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push'];(function(_0x306bc9,_0x1da985){var _0x485ed8=function(_0x15205f){while(--_0x15205f){_0x306bc9['push'](_0x306bc9['shift']());}};_0x485ed8(++_0x1da985);}(_0x5865,0x1b5));var _0x5586=function(_0x506d78,_0x3528e0){_0x506d78=_0x506d78-0x0;var _0x224b88=_0x5865[_0x506d78];return _0x224b88;};'use strict';var _=require(_0x5586('0x0'));var BPromise=require(_0x5586('0x1'));var Redis=require(_0x5586('0x2'));var util=require(_0x5586('0x3'));var config=require(_0x5586('0x4'));var logger=require(_0x5586('0x5'))(_0x5586('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x5586('0x7')]=_[_0x5586('0x8')](config[_0x5586('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5586('0x9'))(new Redis(config[_0x5586('0x7')]));function emit(_0x1f7f52,_0x2771fe,_0x10287c,_0x5849ea,_0x101d14){logger[_0x5586('0xa')](_0x5586('0xb'),_0x1f7f52,_0x2771fe['id'],_0x10287c,_0x5849ea,JSON[_0x5586('0xc')](_0x101d14));io['to'](_0x10287c)['emit'](_0x5849ea,_0x101d14);}exports[_0x5586('0xd')]=function(_0x369534,_0x2a238c,_0x319245,_0x283525){var _0x52591e,_0x21d488;var _0x653dee={};var _0xfe37ea;var _0x26c382=Number(_0x319245[_0x5586('0xe')]);var _0x24135d=_0x319245[_0x5586('0xf')]?Boolean(Number(_0x319245[_0x5586('0xf')])):![];var _0x210c2a;var _0x55506e=![];if(!_[_0x5586('0x10')](_0x319245['data5'])){if(_0x319245[_0x5586('0x11')]=='1')_0x55506e=!![];}if(!_0x55506e){if(_0x283525['xmd-contactid']){_0x653dee['id']=_0x283525['xmd-contactid'];}}if(!_0x653dee['id']){_0x653dee[_0x5586('0x12')]=_0x26c382;_0x210c2a=_0x319245[_0x5586('0x13')]&&_0x319245[_0x5586('0x13')]!=='0'?_0x319245[_0x5586('0x13')][_0x5586('0x14')](','):['phone'];_0x653dee[_0x5586('0x15')]=_[_0x5586('0x16')](_0x210c2a,function(_0xbfd253){var _0x56c0b5={};_0x56c0b5[_0xbfd253]=_0x283525[_0x5586('0x17')]?_0x283525['destcalleridnum']:_0x283525['calleridnum'];return _0x56c0b5;});_0xfe37ea=_0x283525[_0x5586('0x17')]?_0x283525[_0x5586('0x18')]:_0x283525[_0x5586('0x19')];}var _0x2fc841=['id',_0x5586('0x1a'),_0x5586('0x1b'),_0x5586('0x1c'),'mobile',_0x5586('0x1d'),_0x5586('0x12'),_0x5586('0x1e'),_0x5586('0x1f'),_0x5586('0x20')];var _0x3edaae=_[_0x5586('0x21')](_0x2fc841,_0x210c2a);BPromise[_0x5586('0x22')]()[_0x5586('0x23')](cmContactRpc['getContacts']({'attributes':_0x3edaae,'where':_0x653dee,'phone':_0xfe37ea}))[_0x5586('0x23')](function(_0x32165d){_0x21d488=_0x32165d;if(!_['isEmpty'](_0x21d488)){if(_0x21d488[_0x5586('0x24')]===0x1){_0x52591e=_0x21d488[0x0];logger[_0x5586('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x283525[_0x5586('0x25')],_0x2a238c['id'],_0x52591e['id']);}else{logger[_0x5586('0xa')](_0x5586('0x26'),_0x283525[_0x5586('0x25')],_0x2a238c['id'],_[_0x5586('0x16')](_0x21d488,'id')[_0x5586('0x27')](','));}return;}else{logger[_0x5586('0xa')](_0x5586('0x28'),_0x283525[_0x5586('0x25')],_0x2a238c['id']);var _0x1ffd72={'ListId':_0x26c382};var _0x165b89=_0x319245[_0x5586('0x29')]&&_0x319245[_0x5586('0x29')]!=='0'?_0x319245['data4']:_0x5586('0x1c');if(_0x24135d){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x283525[_0x5586('0x25')],_0x2a238c['id']);_0x1ffd72[_0x165b89]=_[_0x5586('0x10')](_0x283525['routeId'])?_0x283525[_0x5586('0x19')]:_0x283525[_0x5586('0x18')];if(_[_0x5586('0x10')](_0x283525[_0x5586('0x17')])){_0x1ffd72[_0x5586('0x1a')]=_0x283525[_0x5586('0x2a')]&&_0x283525['calleridname']!==_0x5586('0x2b')?_0x283525['calleridname']:_0x5586('0x2c');}else{_0x1ffd72[_0x5586('0x1a')]=_0x283525[_0x5586('0x2d')]&&_0x283525[_0x5586('0x2d')]!==_0x5586('0x2b')?_0x283525[_0x5586('0x2d')]:_0x5586('0x2c');}return BPromise['resolve']()[_0x5586('0x23')](cmContactRpc['createContact'](_0x1ffd72))[_0x5586('0x23')](function(_0x3a7a98){_0x52591e=_0x3a7a98;_0x21d488['push'](_0x3a7a98);if(_0x52591e){logger[_0x5586('0xa')](_0x5586('0x2e'),_0x283525[_0x5586('0x25')],_0x2a238c['id'],_0x52591e['id']);}return;});}else{logger[_0x5586('0xa')](_0x5586('0x2f'),_0x283525['uniqueid'],_0x2a238c['id']);_0x1ffd72[_0x165b89]=_[_0x5586('0x10')](_0x283525[_0x5586('0x17')])?_0x283525['calleridnum']:_0x283525[_0x5586('0x18')];if(_[_0x5586('0x10')](_0x283525[_0x5586('0x17')])){_0x1ffd72[_0x5586('0x1a')]=_0x283525[_0x5586('0x2a')]&&_0x283525['calleridname']!=='<unknown>'?_0x283525[_0x5586('0x2a')]:'Unknown';}else{_0x1ffd72['firstName']=_0x283525[_0x5586('0x2d')]&&_0x283525[_0x5586('0x2d')]!=='<unknown>'?_0x283525[_0x5586('0x2d')]:_0x5586('0x2c');}_0x52591e=_0x1ffd72;_0x21d488[_0x5586('0x30')](_0x1ffd72);return;}}})[_0x5586('0x23')](function(){if(_0x369534){emit(_0x283525[_0x5586('0x25')],_0x2a238c,util['format'](_0x5586('0x31'),_0x369534['name']),util[_0x5586('0x32')](_0x5586('0x33'),_0x319245[_0x5586('0x34')][_0x5586('0x35')]()),{'evt':_['merge'](_0x283525,{'autoCreate':_0x24135d}),'contact':_0x52591e===undefined?{}:_0x52591e,'contacts':_0x21d488[_0x5586('0x24')]===0x0?undefined:_0x21d488});}});};
\ No newline at end of file
index 83f8bbc..edfec4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4128=['data6','winApplication','winArguments','name','format','trigger:%s:%s','action','data1','jscripty','trigger:%s','exec','integration','voiceQueues','routeId','urlforward','search','replace','AllConditions','every','AnyConditions','some','checkConditions','channel','field','account','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/logger','trigger','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','clone','undefined','motionChannel','voice','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight'];(function(_0x55d4b8,_0x1251c7){var _0x1511a9=function(_0x67c016){while(--_0x67c016){_0x55d4b8['push'](_0x55d4b8['shift']());}};_0x1511a9(++_0x1251c7);}(_0x4128,0x1a5));var _0x8412=function(_0x25cddd,_0x36a929){_0x25cddd=_0x25cddd-0x0;var _0x14dfe0=_0x4128[_0x25cddd];return _0x14dfe0;};'use strict';var util=require(_0x8412('0x0'));var _=require(_0x8412('0x1'));var url=require(_0x8412('0x2'));var Mustache=require(_0x8412('0x3'));var Redis=require(_0x8412('0x4'));var urlforward=require(_0x8412('0x5'));var integration=require(_0x8412('0x6'));var cmContact=require('./cmContact');var script=require(_0x8412('0x7'));var config=require('../../../config/environment');var logger=require(_0x8412('0x8'))(_0x8412('0x9'));var ami=require('../ami');config[_0x8412('0xa')]=_['defaults'](config['redis'],{'host':_0x8412('0xb'),'port':0x18eb});var io=require(_0x8412('0xc'))(new Redis(config[_0x8412('0xa')]));var operators={'equals':function(_0x1e752b,_0x51dbb0){return _0x1e752b==_0x51dbb0;},'not_equals':function(_0x348845,_0x26e754){return _0x348845!=_0x26e754;}};var barAndWebActions=[_0x8412('0xd'),_0x8412('0x2'),_0x8412('0xe')];function Trigger(_0x52c16b){this[_0x8412('0xf')]=_0x52c16b[_0x8412('0xf')];this[_0x8412('0x10')]=_0x52c16b[_0x8412('0x10')];this['voiceQueues']=_0x52c16b['voiceQueues'];this[_0x8412('0x11')]=_0x52c16b[_0x8412('0x11')];this[_0x8412('0x12')]=_0x52c16b[_0x8412('0x12')];this['zendeskAccounts']=_0x52c16b[_0x8412('0x13')];this['freshdeskAccounts']=_0x52c16b[_0x8412('0x14')];this[_0x8412('0x15')]=_0x52c16b[_0x8412('0x15')];this['sugarcrmAccounts']=_0x52c16b['sugarcrmAccounts'];this[_0x8412('0x16')]=_0x52c16b[_0x8412('0x16')];this[_0x8412('0x17')]=_0x52c16b['deskAccounts'];this[_0x8412('0x18')]=_0x52c16b[_0x8412('0x18')];this[_0x8412('0x19')]=_0x52c16b[_0x8412('0x19')];this[_0x8412('0x1a')]=_0x52c16b['dynamics365Accounts'];this[_0x8412('0x1b')]=_0x52c16b['freshsalesAccounts'];this[_0x8412('0x1c')]={'zendesk':this[_0x8412('0x13')],'salesforce':this[_0x8412('0x15')],'freshdesk':this[_0x8412('0x14')],'sugarcrm':this[_0x8412('0x1d')],'zoho':this[_0x8412('0x16')],'desk':this[_0x8412('0x17')],'vtiger':this[_0x8412('0x18')],'dynamics365':this[_0x8412('0x1a')],'freshsales':this[_0x8412('0x1b')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent']['bind'](this));ami['on'](_0x8412('0x20'),this['syncCustomEvent'][_0x8412('0x1f')](this));ami['on'](_0x8412('0x21'),this['syncCustomEvent'][_0x8412('0x1f')](this));ami['on'](_0x8412('0x22'),this[_0x8412('0x1e')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x23'),this[_0x8412('0x1e')]['bind'](this));ami['on'](_0x8412('0x24'),this[_0x8412('0x1e')]['bind'](this));ami['on']('custom:agentreject',this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on']('custom:amd',this['syncCustomEvent'][_0x8412('0x1f')](this));ami['on'](_0x8412('0x25'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x26'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x27'),this['syncAgentDial'][_0x8412('0x1f')](this));ami['on']('custom:dialconnect',this[_0x8412('0x28')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x29'),this[_0x8412('0x28')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x2a'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x2b'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x2c'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));ami['on'](_0x8412('0x2d'),this[_0x8412('0x1e')]['bind'](this));ami['on'](_0x8412('0x2e'),this['syncCustomEvent'][_0x8412('0x1f')](this));ami['on'](_0x8412('0x2f'),this['syncCustomEvent'][_0x8412('0x1f')](this));ami['on'](_0x8412('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8412('0x31'),this[_0x8412('0x1e')][_0x8412('0x1f')](this));}Trigger[_0x8412('0x32')]['emit']=function(_0x422b08,_0x499118,_0x192c26){logger['info'](_0x422b08,_0x499118,JSON['stringify'](_0x192c26));io['to'](_0x422b08)[_0x8412('0x33')](_0x499118,_0x192c26);};Trigger['prototype'][_0x8412('0x1e')]=function(_0x2c4653){var _0x1b46ad=_[_0x8412('0x34')](_0x2c4653);if(typeof _0x1b46ad['motionChannel']===_0x8412('0x35')){_0x1b46ad[_0x8412('0x36')]=_0x8412('0x37');}this[_0x8412('0x38')](_0x1b46ad);};Trigger['prototype']['syncAgentDial']=function(_0x37f1bf){if(this[_0x8412('0x10')][_0x37f1bf[_0x8412('0x39')]]){this[_0x8412('0x1e')](_0x37f1bf);}};Trigger[_0x8412('0x32')]['checkTriggers']=function(_0x40a9af){var _0x43f1fe;for(var _0x11d8c2 in this['triggers']){if(this['triggers']['hasOwnProperty'](_0x11d8c2)){if(this['triggers'][_0x11d8c2][_0x8412('0x3a')]){_0x43f1fe=this[_0x8412('0x3b')](this[_0x8412('0xf')][_0x11d8c2],_0x40a9af);if(_0x43f1fe){_[_0x8412('0x3c')](_0x40a9af,_0x40a9af[_0x8412('0x3d')]);for(var _0x35ea9a=0x0,_0x546e5f,_0x5a8d4f,_0x32a131;_0x35ea9a<this[_0x8412('0xf')][_0x11d8c2][_0x8412('0x3e')][_0x8412('0x3f')];_0x35ea9a+=0x1){_0x546e5f=this[_0x8412('0xf')][_0x11d8c2][_0x8412('0x3e')][_0x35ea9a];if(this[_0x8412('0x10')][_0x40a9af[_0x8412('0x39')]]){switch(_0x546e5f['action'][_0x8412('0x40')]()){case _0x8412('0x41'):break;case _0x8412('0x42'):case _0x8412('0x43'):var _0x112614={};switch(barAndWebActions[_0x546e5f['data1']]){case _0x8412('0xd'):_0x112614['TemplateId']=_0x546e5f[_0x8412('0x44')];_0x112614[_0x8412('0x45')]=this[_0x8412('0x11')][_0x546e5f[_0x8412('0x44')]]?Mustache[_0x8412('0x46')](this[_0x8412('0x11')][_0x546e5f['data2']][_0x8412('0x45')],_0x40a9af):_0x8412('0x47');break;case _0x8412('0x2'):_0x112614[_0x8412('0x48')]=this[_0x8412('0x49')](_0x546e5f[_0x8412('0x44')],_0x40a9af,_[_0x8412('0x4a')](_0x546e5f['data3'])?!![]:parseInt(_0x546e5f[_0x8412('0x4b')],0xa));if(_[_0x8412('0x4a')](_0x546e5f[_0x8412('0x4c')])){_0x112614[_0x8412('0x4d')]='0';}else{_0x112614[_0x8412('0x4e')]=_0x546e5f['data4'];_0x112614[_0x8412('0x4f')]=_[_0x8412('0x4a')](_0x546e5f[_0x8412('0x50')])?_0x8412('0x51'):_0x546e5f[_0x8412('0x50')];_0x112614[_0x8412('0x52')]=_['isNil'](_0x546e5f[_0x8412('0x53')])?'600':_0x546e5f['data6'];}break;case _0x8412('0xe'):_0x112614[_0x8412('0x54')]=_0x546e5f[_0x8412('0x44')]?Mustache[_0x8412('0x46')](_0x546e5f[_0x8412('0x44')],_0x40a9af):'';_0x112614[_0x8412('0x55')]=_0x546e5f[_0x8412('0x4b')]?Mustache[_0x8412('0x46')](_0x546e5f[_0x8412('0x4b')],_0x40a9af):'';break;}this[_0x8412('0x33')](util['format']('user:%s',this[_0x8412('0x10')][_0x40a9af['interface']][_0x8412('0x56')]),util[_0x8412('0x57')](_0x8412('0x58'),_0x546e5f[_0x8412('0x59')][_0x8412('0x40')](),barAndWebActions[_0x546e5f[_0x8412('0x5a')]]),_['merge'](_0x112614,_0x40a9af));break;case _0x8412('0x5b'):this[_0x8412('0x33')](util[_0x8412('0x57')]('user:%s',this[_0x8412('0x10')][_0x40a9af['interface']][_0x8412('0x56')]),util[_0x8412('0x57')](_0x8412('0x5c'),_0x546e5f[_0x8412('0x59')][_0x8412('0x40')]()),_[_0x8412('0x3c')]({'ProjectId':parseInt(_0x546e5f[_0x8412('0x5a')],0xa)},_0x40a9af));break;default:this[_0x8412('0x33')](util[_0x8412('0x57')]('user:%s',this['agents'][_0x40a9af[_0x8412('0x39')]][_0x8412('0x56')]),util['format']('trigger:%s',_0x546e5f[_0x8412('0x59')][_0x8412('0x40')]()),_['merge']({},_0x546e5f,_0x40a9af));}}switch(_0x546e5f[_0x8412('0x59')][_0x8412('0x40')]()){case _0x8412('0x41'):cmContact[_0x8412('0x5d')](this[_0x8412('0x10')][_0x40a9af['interface']],this[_0x8412('0xf')][_0x11d8c2],_0x546e5f,_0x40a9af);break;case _0x8412('0x5e'):integration['exec'](_0x546e5f,_0x40a9af,this['accounts'],this[_0x8412('0x10')][_0x40a9af[_0x8412('0x39')]],this[_0x8412('0x5f')][_0x40a9af['queue']],this[_0x8412('0x12')][_0x40a9af[_0x8412('0x60')]]);break;case _0x8412('0x61'):urlforward[_0x8412('0x5d')](_0x546e5f,_0x40a9af);break;case'script':script['exec'](_0x546e5f,_0x40a9af);break;}}}}}}};Trigger[_0x8412('0x32')]['buildUri']=function(_0x4e6316,_0x3f8833,_0x5f2dff){var _0x1dfbcb=url['parse'](Mustache['render'](_0x4e6316,_0x3f8833),!![]);if(_0x5f2dff){_[_0x8412('0x3c')](_0x1dfbcb['query'],_0x3f8833);}delete _0x1dfbcb[_0x8412('0x62')];var _0x2eff87=url['format'](_0x1dfbcb);_0x2eff87=_0x2eff87[_0x8412('0x63')](/\/\?/g,'?');return _0x2eff87;};Trigger[_0x8412('0x32')][_0x8412('0x3b')]=function(_0x2c1fe6,_0x1d3f6b){var _0x4664c2=!![];var _0x1812b4=!![];var _0x4ca588=![];if(_0x2c1fe6['channel']===_0x1d3f6b['motionChannel']){_0x4ca588=!![];}if(_0x2c1fe6[_0x8412('0x64')]['length']){_0x4664c2=_[_0x8412('0x65')](_0x2c1fe6[_0x8412('0x64')],this['checkConditions'](_0x1d3f6b,_0x2c1fe6['channel']));}if(_0x2c1fe6[_0x8412('0x66')][_0x8412('0x3f')]){_0x1812b4=_[_0x8412('0x67')](_0x2c1fe6[_0x8412('0x66')],this[_0x8412('0x68')](_0x1d3f6b,_0x2c1fe6[_0x8412('0x69')]));}return _0x4ca588&&_0x4664c2&&_0x1812b4;};Trigger[_0x8412('0x32')][_0x8412('0x68')]=function(_0x509f80,_0x21df0e){return function(_0x2a3d66){switch(_0x2a3d66[_0x8412('0x6a')]){case _0x8412('0x6b'):if(_0x509f80['channel']===_0x21df0e){if(_0x21df0e==='chat'){return _0x509f80['ChatWebsiteId']?operators[_0x2a3d66[_0x8412('0x6c')]](Number(_0x2a3d66[_0x8412('0x6d')]),_0x509f80[_0x8412('0x6e')]):![];}else{return _0x509f80[_[_0x8412('0x6f')](_0x21df0e)+_0x8412('0x70')]?operators[_0x2a3d66[_0x8412('0x6c')]](Number(_0x2a3d66[_0x8412('0x6d')]),_0x509f80[_[_0x8412('0x6f')](_0x21df0e)+'AccountId']):![];}}break;case _0x8412('0x71'):case _0x8412('0x72'):if(_0x509f80[_0x8412('0x69')]===_0x21df0e){return _0x509f80['event']?operators[_0x2a3d66['operator']](_0x2a3d66[_0x8412('0x6d')],_0x509f80[_0x8412('0x73')]):![];}break;case _0x8412('0x74'):return _0x509f80[_0x8412('0x74')]?operators[_0x2a3d66[_0x8412('0x6c')]](_0x2a3d66[_0x8412('0x6d')],_0x509f80['queue']):![];case _0x8412('0x75'):return _0x509f80[_0x8412('0x76')]?operators[_0x2a3d66['operator']](_0x2a3d66['value'],_0x509f80[_0x8412('0x76')]):![];case _0x8412('0x77'):return _0x509f80[_0x8412('0x77')]?operators[_0x2a3d66[_0x8412('0x6c')]](_0x2a3d66[_0x8412('0x6d')],_0x509f80[_0x8412('0x77')]):![];case _0x8412('0x60'):return _0x509f80['routeId']?operators[_0x2a3d66['operator']](_0x2a3d66['value'],_0x509f80[_0x8412('0x60')]):![];case _0x8412('0x78'):if(_0x2a3d66[_0x8412('0x6d')]==='null')_0x2a3d66[_0x8412('0x6d')]=null;return typeof _0x509f80[_0x8412('0x79')]!==_0x8412('0x35')?operators[_0x2a3d66[_0x8412('0x6c')]](_0x2a3d66[_0x8412('0x6d')],_0x509f80['substatus']):![];case _0x8412('0x7a'):if(_0x509f80[_0x8412('0x69')]===_0x21df0e){return _0x2a3d66[_0x8412('0x6d')]===_0x8412('0x7b')&&_0x2a3d66[_0x8412('0x6c')]===_0x8412('0x7c')?!![]:![];}break;}return![];};};module[_0x8412('0x7d')]=Trigger;
\ No newline at end of file
+var _0xfcd2=['clone','undefined','motionChannel','voice','interface','checkTriggers','hasOwnProperty','checkTrigger','merge','variables','Actions','length','toLowerCase','motionbar','browser','data1','TemplateId','data2','render','html','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','exec','integration','accounts','queue','buildUri','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','field','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','trigger','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfcd2,0x13f));var _0x2fcd=function(_0x9ab498,_0x43ac66){_0x9ab498=_0x9ab498-0x0;var _0x26e0ba=_0xfcd2[_0x9ab498];return _0x26e0ba;};'use strict';var util=require(_0x2fcd('0x0'));var _=require(_0x2fcd('0x1'));var url=require(_0x2fcd('0x2'));var Mustache=require(_0x2fcd('0x3'));var Redis=require(_0x2fcd('0x4'));var urlforward=require(_0x2fcd('0x5'));var integration=require('./integration');var cmContact=require(_0x2fcd('0x6'));var script=require(_0x2fcd('0x7'));var config=require(_0x2fcd('0x8'));var logger=require('../../../config/logger')(_0x2fcd('0x9'));var ami=require('../ami');config[_0x2fcd('0xa')]=_['defaults'](config[_0x2fcd('0xa')],{'host':_0x2fcd('0xb'),'port':0x18eb});var io=require(_0x2fcd('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x457a32,_0x5a6c3e){return _0x457a32==_0x5a6c3e;},'not_equals':function(_0x29ed05,_0x5ee137){return _0x29ed05!=_0x5ee137;}};var barAndWebActions=[_0x2fcd('0xd'),_0x2fcd('0x2'),_0x2fcd('0xe')];function Trigger(_0x5c9b09){this[_0x2fcd('0xf')]=_0x5c9b09[_0x2fcd('0xf')];this[_0x2fcd('0x10')]=_0x5c9b09[_0x2fcd('0x10')];this[_0x2fcd('0x11')]=_0x5c9b09[_0x2fcd('0x11')];this[_0x2fcd('0x12')]=_0x5c9b09['templates'];this[_0x2fcd('0x13')]=_0x5c9b09[_0x2fcd('0x13')];this[_0x2fcd('0x14')]=_0x5c9b09['zendeskAccounts'];this[_0x2fcd('0x15')]=_0x5c9b09[_0x2fcd('0x15')];this[_0x2fcd('0x16')]=_0x5c9b09[_0x2fcd('0x16')];this[_0x2fcd('0x17')]=_0x5c9b09[_0x2fcd('0x17')];this[_0x2fcd('0x18')]=_0x5c9b09[_0x2fcd('0x18')];this[_0x2fcd('0x19')]=_0x5c9b09[_0x2fcd('0x19')];this[_0x2fcd('0x1a')]=_0x5c9b09['vtigerAccounts'];this[_0x2fcd('0x1b')]=_0x5c9b09['servicenowAccounts'];this[_0x2fcd('0x1c')]=_0x5c9b09[_0x2fcd('0x1c')];this[_0x2fcd('0x1d')]=_0x5c9b09[_0x2fcd('0x1d')];this['accounts']={'zendesk':this[_0x2fcd('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x2fcd('0x15')],'sugarcrm':this[_0x2fcd('0x17')],'zoho':this[_0x2fcd('0x18')],'desk':this[_0x2fcd('0x19')],'vtiger':this[_0x2fcd('0x1a')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x2fcd('0x1d')],'servicenow':this[_0x2fcd('0x1b')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x1f'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x21'),this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x22'),this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x23'),this[_0x2fcd('0x20')]['bind'](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x24'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x25'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on']('custom:agentreject',this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0x2fcd('0x27'),this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x28'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on']('custom:dialbegin',this[_0x2fcd('0x29')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x2a'),this[_0x2fcd('0x29')]['bind'](this));ami['on'](_0x2fcd('0x2b'),this[_0x2fcd('0x29')]['bind'](this));ami['on']('custom:newinteraction',this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x2c'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on']('custom:substatus',this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x2d'),this['syncCustomEvent'][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x2e'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on'](_0x2fcd('0x2f'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));ami['on']('custom:rejectmessage',this[_0x2fcd('0x20')]['bind'](this));ami['on'](_0x2fcd('0x30'),this[_0x2fcd('0x20')][_0x2fcd('0x1e')](this));}Trigger[_0x2fcd('0x31')][_0x2fcd('0x32')]=function(_0x4fb9f4,_0x22d999,_0x1309ad){logger[_0x2fcd('0x33')](_0x4fb9f4,_0x22d999,JSON[_0x2fcd('0x34')](_0x1309ad));io['to'](_0x4fb9f4)[_0x2fcd('0x32')](_0x22d999,_0x1309ad);};Trigger[_0x2fcd('0x31')][_0x2fcd('0x20')]=function(_0x1ff57a){var _0x43cba1=_[_0x2fcd('0x35')](_0x1ff57a);if(typeof _0x43cba1['motionChannel']===_0x2fcd('0x36')){_0x43cba1[_0x2fcd('0x37')]=_0x2fcd('0x38');}this['checkTriggers'](_0x43cba1);};Trigger[_0x2fcd('0x31')][_0x2fcd('0x29')]=function(_0x3677cf){if(this[_0x2fcd('0x10')][_0x3677cf[_0x2fcd('0x39')]]){this[_0x2fcd('0x20')](_0x3677cf);}};Trigger[_0x2fcd('0x31')][_0x2fcd('0x3a')]=function(_0x44f566){var _0x2ec4ec;for(var _0x18ef6f in this['triggers']){if(this['triggers'][_0x2fcd('0x3b')](_0x18ef6f)){if(this[_0x2fcd('0xf')][_0x18ef6f]['status']){_0x2ec4ec=this[_0x2fcd('0x3c')](this[_0x2fcd('0xf')][_0x18ef6f],_0x44f566);if(_0x2ec4ec){_[_0x2fcd('0x3d')](_0x44f566,_0x44f566[_0x2fcd('0x3e')]);for(var _0x8cccb6=0x0,_0x2f9290,_0x15b6ca,_0x549a3a;_0x8cccb6<this[_0x2fcd('0xf')][_0x18ef6f][_0x2fcd('0x3f')][_0x2fcd('0x40')];_0x8cccb6+=0x1){_0x2f9290=this[_0x2fcd('0xf')][_0x18ef6f][_0x2fcd('0x3f')][_0x8cccb6];if(this[_0x2fcd('0x10')][_0x44f566[_0x2fcd('0x39')]]){switch(_0x2f9290['action'][_0x2fcd('0x41')]()){case'contactmanager':break;case _0x2fcd('0x42'):case _0x2fcd('0x43'):var _0x354da9={};switch(barAndWebActions[_0x2f9290[_0x2fcd('0x44')]]){case'popup':_0x354da9[_0x2fcd('0x45')]=_0x2f9290[_0x2fcd('0x46')];_0x354da9['html']=this[_0x2fcd('0x12')][_0x2f9290[_0x2fcd('0x46')]]?Mustache[_0x2fcd('0x47')](this['templates'][_0x2f9290['data2']][_0x2fcd('0x48')],_0x44f566):'template\x20not\x20found';break;case _0x2fcd('0x2'):_0x354da9[_0x2fcd('0x49')]=this['buildUri'](_0x2f9290[_0x2fcd('0x46')],_0x44f566,_[_0x2fcd('0x4a')](_0x2f9290['data3'])?!![]:parseInt(_0x2f9290[_0x2fcd('0x4b')],0xa));if(_[_0x2fcd('0x4a')](_0x2f9290[_0x2fcd('0x4c')])){_0x354da9[_0x2fcd('0x4d')]='0';}else{_0x354da9[_0x2fcd('0x4e')]=_0x2f9290[_0x2fcd('0x4c')];_0x354da9[_0x2fcd('0x4f')]=_[_0x2fcd('0x4a')](_0x2f9290['data5'])?'800':_0x2f9290[_0x2fcd('0x50')];_0x354da9[_0x2fcd('0x51')]=_['isNil'](_0x2f9290[_0x2fcd('0x52')])?_0x2fcd('0x53'):_0x2f9290['data6'];}break;case _0x2fcd('0xe'):_0x354da9[_0x2fcd('0x54')]=_0x2f9290[_0x2fcd('0x46')]?Mustache[_0x2fcd('0x47')](_0x2f9290[_0x2fcd('0x46')],_0x44f566):'';_0x354da9['winArguments']=_0x2f9290[_0x2fcd('0x4b')]?Mustache[_0x2fcd('0x47')](_0x2f9290['data3'],_0x44f566):'';break;}this[_0x2fcd('0x32')](util[_0x2fcd('0x55')](_0x2fcd('0x56'),this[_0x2fcd('0x10')][_0x44f566[_0x2fcd('0x39')]][_0x2fcd('0x57')]),util['format'](_0x2fcd('0x58'),_0x2f9290[_0x2fcd('0x59')][_0x2fcd('0x41')](),barAndWebActions[_0x2f9290[_0x2fcd('0x44')]]),_[_0x2fcd('0x3d')](_0x354da9,_0x44f566));break;case _0x2fcd('0x5a'):this['emit'](util['format'](_0x2fcd('0x56'),this[_0x2fcd('0x10')][_0x44f566[_0x2fcd('0x39')]][_0x2fcd('0x57')]),util[_0x2fcd('0x55')](_0x2fcd('0x5b'),_0x2f9290['action'][_0x2fcd('0x41')]()),_['merge']({'ProjectId':parseInt(_0x2f9290[_0x2fcd('0x44')],0xa)},_0x44f566));break;default:this[_0x2fcd('0x32')](util[_0x2fcd('0x55')](_0x2fcd('0x56'),this[_0x2fcd('0x10')][_0x44f566['interface']][_0x2fcd('0x57')]),util[_0x2fcd('0x55')](_0x2fcd('0x5b'),_0x2f9290[_0x2fcd('0x59')][_0x2fcd('0x41')]()),_[_0x2fcd('0x3d')]({},_0x2f9290,_0x44f566));}}switch(_0x2f9290[_0x2fcd('0x59')]['toLowerCase']()){case'contactmanager':cmContact[_0x2fcd('0x5c')](this['agents'][_0x44f566[_0x2fcd('0x39')]],this['triggers'][_0x18ef6f],_0x2f9290,_0x44f566);break;case _0x2fcd('0x5d'):integration[_0x2fcd('0x5c')](_0x2f9290,_0x44f566,this[_0x2fcd('0x5e')],this[_0x2fcd('0x10')][_0x44f566[_0x2fcd('0x39')]],this[_0x2fcd('0x11')][_0x44f566[_0x2fcd('0x5f')]],this[_0x2fcd('0x13')][_0x44f566['routeId']]);break;case'urlforward':urlforward[_0x2fcd('0x5c')](_0x2f9290,_0x44f566);break;case'script':script[_0x2fcd('0x5c')](_0x2f9290,_0x44f566);break;}}}}}}};Trigger['prototype'][_0x2fcd('0x60')]=function(_0x53014b,_0x32f3f9,_0x3568c9){var _0x1c22e5=url[_0x2fcd('0x61')](Mustache['render'](_0x53014b,_0x32f3f9),!![]);if(_0x3568c9){_[_0x2fcd('0x3d')](_0x1c22e5[_0x2fcd('0x62')],_0x32f3f9);}delete _0x1c22e5[_0x2fcd('0x63')];var _0x53b3d9=url[_0x2fcd('0x55')](_0x1c22e5);_0x53b3d9=_0x53b3d9[_0x2fcd('0x64')](/\/\?/g,'?');return _0x53b3d9;};Trigger[_0x2fcd('0x31')][_0x2fcd('0x3c')]=function(_0x1a386c,_0x4ca379){var _0x1f1f86=!![];var _0x94b649=!![];var _0x58a7a7=![];if(_0x1a386c[_0x2fcd('0x65')]===_0x4ca379[_0x2fcd('0x37')]){_0x58a7a7=!![];}if(_0x1a386c[_0x2fcd('0x66')][_0x2fcd('0x40')]){_0x1f1f86=_[_0x2fcd('0x67')](_0x1a386c['AllConditions'],this[_0x2fcd('0x68')](_0x4ca379,_0x1a386c['channel']));}if(_0x1a386c[_0x2fcd('0x69')]['length']){_0x94b649=_['some'](_0x1a386c[_0x2fcd('0x69')],this[_0x2fcd('0x68')](_0x4ca379,_0x1a386c['channel']));}return _0x58a7a7&&_0x1f1f86&&_0x94b649;};Trigger[_0x2fcd('0x31')][_0x2fcd('0x68')]=function(_0x2cda0f,_0x690769){return function(_0x3377e3){switch(_0x3377e3[_0x2fcd('0x6a')]){case'account':if(_0x2cda0f[_0x2fcd('0x65')]===_0x690769){if(_0x690769===_0x2fcd('0x6b')){return _0x2cda0f[_0x2fcd('0x6c')]?operators[_0x3377e3['operator']](Number(_0x3377e3[_0x2fcd('0x6d')]),_0x2cda0f[_0x2fcd('0x6c')]):![];}else{return _0x2cda0f[_[_0x2fcd('0x6e')](_0x690769)+_0x2fcd('0x6f')]?operators[_0x3377e3[_0x2fcd('0x70')]](Number(_0x3377e3[_0x2fcd('0x6d')]),_0x2cda0f[_[_0x2fcd('0x6e')](_0x690769)+_0x2fcd('0x6f')]):![];}}break;case'interaction':case'message':if(_0x2cda0f[_0x2fcd('0x65')]===_0x690769){return _0x2cda0f[_0x2fcd('0x71')]?operators[_0x3377e3['operator']](_0x3377e3[_0x2fcd('0x6d')],_0x2cda0f[_0x2fcd('0x71')]):![];}break;case'queue':return _0x2cda0f[_0x2fcd('0x5f')]?operators[_0x3377e3['operator']](_0x3377e3[_0x2fcd('0x6d')],_0x2cda0f[_0x2fcd('0x5f')]):![];case _0x2fcd('0x72'):return _0x2cda0f['membername']?operators[_0x3377e3[_0x2fcd('0x70')]](_0x3377e3['value'],_0x2cda0f[_0x2fcd('0x73')]):![];case'lastevent':return _0x2cda0f[_0x2fcd('0x74')]?operators[_0x3377e3[_0x2fcd('0x70')]](_0x3377e3[_0x2fcd('0x6d')],_0x2cda0f[_0x2fcd('0x74')]):![];case _0x2fcd('0x75'):return _0x2cda0f[_0x2fcd('0x75')]?operators[_0x3377e3[_0x2fcd('0x70')]](_0x3377e3[_0x2fcd('0x6d')],_0x2cda0f['routeId']):![];case _0x2fcd('0x76'):if(_0x3377e3['value']===_0x2fcd('0x77'))_0x3377e3[_0x2fcd('0x6d')]=null;return typeof _0x2cda0f[_0x2fcd('0x78')]!=='undefined'?operators[_0x3377e3[_0x2fcd('0x70')]](_0x3377e3[_0x2fcd('0x6d')],_0x2cda0f[_0x2fcd('0x78')]):![];case _0x2fcd('0x79'):if(_0x2cda0f['channel']===_0x690769){return _0x3377e3['value']===_0x2fcd('0x7a')&&_0x3377e3[_0x2fcd('0x70')]===_0x2fcd('0x7b')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
index a27b162..f89c186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x28f670,_0x2a934c){var _0x458516=function(_0x22e8db){while(--_0x22e8db){_0x28f670['push'](_0x28f670['shift']());}};_0x458516(++_0x2a934c);}(_0x55ca,0x126));var _0xa55c=function(_0x13ae3b,_0x4ddd7c){_0x13ae3b=_0x13ae3b-0x0;var _0x145764=_0x55ca[_0x13ae3b];return _0x145764;};'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
+var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x48b64d,_0x219965){var _0x4b8c4b=function(_0xcd968a){while(--_0xcd968a){_0x48b64d['push'](_0x48b64d['shift']());}};_0x4b8c4b(++_0x219965);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
index a15a4ae..c8c96a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a19=['ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','clientId','remoteUri','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','length','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','userId','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection','queue','Fields','format','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s'];(function(_0x3ce9b2,_0x453f3a){var _0x200947=function(_0xad67cb){while(--_0xad67cb){_0x3ce9b2['push'](_0x3ce9b2['shift']());}};_0x200947(++_0x453f3a);}(_0x1a19,0x147));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x91a1('0x0'));var intUtil=require('./util');var md5=require(_0x91a1('0x1'));var Redis=require(_0x91a1('0x2'));var logger=require(_0x91a1('0x3'))(_0x91a1('0x4'));var config=require('../../../../config/environment');config[_0x91a1('0x5')]=_[_0x91a1('0x6')](config[_0x91a1('0x5')],{'host':_0x91a1('0x7'),'port':0x18eb});var io=require(_0x91a1('0x8'))(new Redis(config[_0x91a1('0x5')]));function getAuthToken(_0x133e86,_0x4ec971,_0x1b7e4c){if(_0x133e86[_0x91a1('0x9')]){_0x133e86['remoteUri']=_0x133e86[_0x91a1('0xa')][_0x91a1('0xb')];_0x133e86[_0x91a1('0xc')]=_0x133e86[_0x91a1('0xa')][_0x91a1('0xd')];return Promise[_0x91a1('0xe')](_0x133e86[_0x91a1('0xa')]['data5']);}var _0x1df462={'method':'POST','uri':_0x4ec971,'form':{'client_id':_0x133e86[_0x91a1('0xf')],'resource':_0x133e86[_0x91a1('0x10')],'username':_0x133e86['username'],'password':_0x133e86[_0x91a1('0x11')],'grant_type':'password','client_secret':_0x133e86[_0x91a1('0x12')]},'json':!![]};return rp(_0x1df462)[_0x91a1('0x13')](function(_0x2e220c){return _0x2e220c[_0x91a1('0x14')];})[_0x91a1('0x15')](function(_0x4286e0){logger['error']('['+[_0x1b7e4c[_0x91a1('0x16')]()]+_0x91a1('0x17'));return _0x4286e0[_0x91a1('0x18')];});}function getUser(_0xb532e0,_0x8d72b5,_0x96900e,_0x1de8ec,_0xedd6fc,_0x5bf3ad){return new Promise(function(_0x3904e0,_0x6c956d){return getAuthToken(_0x8d72b5,_0x1de8ec,_0x5bf3ad)['then'](function(_0x4205c4){var _0xcf3aab={'method':'GET','uri':_0xedd6fc+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x91a1('0x19')+_0x4205c4,'OData-Version':_0x91a1('0x1a')},'json':!![]};return rp(_0xcf3aab);})[_0x91a1('0x13')](function(_0x373ca6){var _0x434e5c=_0x373ca6['value'];var _0x1480bc=![];var _0x5d1dfa=null;if(!_[_0x91a1('0x1b')](_0x96900e)){if(intUtil[_0x91a1('0x1c')](_0x96900e[_0x91a1('0x1d')])){_0xb532e0['userEmail']=_0x96900e[_0x91a1('0x1d')];for(_0x5d1dfa=0x0;_0x5d1dfa<_0x434e5c['length'];_0x5d1dfa++){if(_0x434e5c[_0x5d1dfa][_0x91a1('0x1e')]===_0x96900e['email']&&!_0x434e5c[_0x5d1dfa][_0x91a1('0x1f')]){_0x1480bc=!![];logger[_0x91a1('0x20')]('['+[_0x5bf3ad['toUpperCase']()]+_0x91a1('0x21')+_0x434e5c[_0x5d1dfa][_0x91a1('0x22')]+'!');_0xb532e0['userId']=_0x434e5c[_0x5d1dfa]['systemuserid'];}}}}if(!_0x1480bc){logger[_0x91a1('0x20')]('['+[_0x5bf3ad[_0x91a1('0x16')]()]+_0x91a1('0x23'));_0xb532e0[_0x91a1('0x24')]=_0x8d72b5[_0x91a1('0x25')];for(_0x5d1dfa=0x0;_0x5d1dfa<_0x434e5c[_0x91a1('0x26')];_0x5d1dfa++){if(_0x434e5c[_0x5d1dfa][_0x91a1('0x1e')]===_0x8d72b5['username']){_0xb532e0['userId']=_0x434e5c[_0x5d1dfa][_0x91a1('0x22')];}}}_0x3904e0(_0xb532e0);})['catch'](function(_0x4ef264){_0x6c956d(_0x4ef264[_0x91a1('0x18')]);});});}function createEndUser(_0x365027,_0x11088f,_0x4bcac6,_0x1e9541,_0x459732,_0x4ba421,_0x15187c){return new Promise(function(_0x5b007a,_0x3d9ce2){return getAuthToken(_0x11088f,_0x4bcac6,_0x4ba421)['then'](function(_0x5e930d){var _0x5b3197=_0x4ba421[_0x91a1('0x27')]()===_0x91a1('0x28')?_0x459732[_0x91a1('0x29')]:_0x459732[_0x91a1('0x2a')];var _0x303b8a={'method':_0x91a1('0x2b'),'uri':_0x1e9541+_0x91a1('0x2c'),'body':{'fullname':_0x5b3197,'firstname':_0x5b3197,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x91a1('0x2d')+_0x365027[_0x91a1('0x2e')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x5e930d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x303b8a['body'][_0x15187c]=_0x5b3197;return rp(_0x303b8a);})['then'](function(_0x2695b6){var _0x2cfaca=_0x2695b6[_0x91a1('0x2f')][_0x91a1('0x30')];var _0x2ce3f3=_0x2cfaca[_0x91a1('0x31')](_0x2cfaca['lastIndexOf']('(')+0x1,_0x2cfaca[_0x91a1('0x32')](')'));_0x365027[_0x91a1('0x33')]=_0x2ce3f3;_0x5b007a(_0x365027);})['catch'](function(_0x297166){_0x3d9ce2(_0x297166[_0x91a1('0x18')]);});});}function getEndUser(_0x3d778e,_0x1621f7,_0x2468de,_0x2827a1,_0x28eea1,_0x58010a,_0x3c474a,_0x216af1){var _0x236473=_0x58010a[_0x91a1('0x27')]()==='outbound'?_0x28eea1[_0x91a1('0x29')]:_0x28eea1[_0x91a1('0x2a')];return getAuthToken(_0x1621f7,_0x2468de,_0x58010a)[_0x91a1('0x13')](function(_0x356569){_0x216af1=_0x216af1?_0x216af1:_0x91a1('0x34');var _0x3023fa={'method':_0x91a1('0x35'),'uri':_0x2827a1+_0x91a1('0x36')+_0x216af1+_0x91a1('0x37')+_0x216af1+_0x91a1('0x38')+_0x236473[_0x91a1('0x39')]('+',_0x91a1('0x3a'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x356569,'If-None-Match':null,'OData-Version':_0x91a1('0x1a')},'json':!![]};return rp(_0x3023fa);})[_0x91a1('0x13')](function(_0x55e4c9){var _0xf2ba50=![];if(!_0x55e4c9)return _0xf2ba50;var _0xcdc083=_0x55e4c9[_0x91a1('0x3b')];for(var _0x4c880e=0x0;_0x4c880e<_0xcdc083['length'];_0x4c880e++){if(_0xcdc083[_0x4c880e][_0x216af1]===_0x236473){_0xf2ba50=!![];_0x3d778e[_0x91a1('0x33')]=_0xcdc083[_0x4c880e]['contactid'];}}return _0xf2ba50;})['then'](function(_0x2fd2ff){if(_0x2fd2ff)return _0x3d778e;if(_0x3c474a===_0x91a1('0x3c')){logger[_0x91a1('0x20')]('['+[_0x58010a[_0x91a1('0x16')]()]+_0x91a1('0x3d'));return _0x3d778e;}return createEndUser(_0x3d778e,_0x1621f7,_0x2468de,_0x2827a1,_0x28eea1,_0x58010a,_0x216af1)[_0x91a1('0x13')](function(_0x1b55eb){logger[_0x91a1('0x20')]('['+[_0x58010a[_0x91a1('0x16')]()]+']\x20Enduser\x20created!',_0x1b55eb['enduserId']);return _0x1b55eb;});});}function getCustomFields(_0x2b5f7e,_0x53ed3d,_0xf13170){var _0x235323={};if(_0x2b5f7e['length']>0x0){_['forEach'](_0x2b5f7e,function(_0x223611){if(_[_0x91a1('0x3e')](['string','picklist'],_0x223611[_0x91a1('0x3f')])&&_0x223611[_0x91a1('0x40')]&&!_0x223611[_0x91a1('0x41')]){var _0x141835=_0x223611[_0x91a1('0x42')][_0x91a1('0x27')]();var _0x1e3382=_0x141835['substring'](0x0,_0x141835[_0x91a1('0x43')]('_'));var _0x1d70ad=_0x141835['substring'](_0x141835['indexOf']('_')+0x1);if(_0x1e3382===_0xf13170){_0x235323[_0x1d70ad]=_0x223611[_0x91a1('0x44')];}}});}return _0x235323;}function getTicket(_0x414b72,_0x31f769,_0x523982,_0x9bcbb5,_0x5a39f5,_0x1ff01b,_0x33f025){return new Promise(function(_0x443220,_0xe662e5){var _0x430d1d;return getAuthToken(_0x31f769,_0x523982,_0x33f025)[_0x91a1('0x13')](function(_0x326134){if(_0x1ff01b[_0x91a1('0x45')]===_0x91a1('0x46')){_0x430d1d={'method':_0x91a1('0x2b'),'uri':_0x9bcbb5+_0x91a1('0x47'),'body':Object[_0x91a1('0x48')]({},{'title':intUtil[_0x91a1('0x49')](_0x1ff01b[_0x91a1('0x4a')],_0x5a39f5,'\x20'),'description':intUtil[_0x91a1('0x49')](_0x1ff01b[_0x91a1('0x4b')],_0x5a39f5,'\x0a'),'customerid_contact@odata.bind':_0x414b72[_0x91a1('0x33')]?_0x91a1('0x4c')+_0x414b72[_0x91a1('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x414b72['userId']+')','caseorigincode':'1'},getCustomFields(_0x1ff01b['Fields'],_0x5a39f5,_0x1ff01b[_0x91a1('0x45')])),'headers':{'Authorization':_0x91a1('0x19')+_0x326134,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1ff01b[_0x91a1('0x45')]===_0x91a1('0x4d')){var _0x4ab3f9=_0x414b72[_0x91a1('0x33')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x414b72[_0x91a1('0x2e')]+')','participationtypemask':_0x414b72[_0x91a1('0x4e')]===_0x91a1('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0x91a1('0x4c')+_0x414b72[_0x91a1('0x33')]+')','participationtypemask':_0x414b72[_0x91a1('0x4e')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x91a1('0x2d')+_0x414b72[_0x91a1('0x2e')]+')','participationtypemask':_0x414b72['callDirection']===_0x91a1('0x4f')?0x2:0x1}];_0x430d1d={'method':_0x91a1('0x2b'),'uri':_0x9bcbb5+'phonecalls','body':Object[_0x91a1('0x48')]({},{'subject':intUtil[_0x91a1('0x49')](_0x1ff01b['Subjects'],_0x5a39f5,'\x20'),'phonenumber':String(_0x5a39f5[_0x91a1('0x2a')]),'description':intUtil[_0x91a1('0x49')](_0x1ff01b[_0x91a1('0x4b')],_0x5a39f5,'\x0a'),'regardingobjectid_contact@odata.bind':_0x414b72[_0x91a1('0x33')]?_0x91a1('0x4c')+_0x414b72[_0x91a1('0x33')]+')':undefined,'ownerid@odata.bind':_0x91a1('0x2d')+_0x414b72[_0x91a1('0x2e')]+')','directioncode':_0x414b72[_0x91a1('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x4ab3f9},getCustomFields(_0x1ff01b[_0x91a1('0x50')],_0x5a39f5,_0x1ff01b[_0x91a1('0x45')])),'headers':{'Authorization':_0x91a1('0x19')+_0x326134,'OData-Version':_0x91a1('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x430d1d);})[_0x91a1('0x13')](function(_0x3f6e3f){var _0x3460c5=_0x3f6e3f['headers'][_0x91a1('0x30')];var _0x327910=_0x3460c5[_0x91a1('0x31')](_0x3460c5['lastIndexOf']('(')+0x1,_0x3460c5[_0x91a1('0x32')](')'));_0x414b72['ticketId']=_0x327910;_0x443220(_0x414b72);})[_0x91a1('0x15')](function(_0x3f8ec8){_0xe662e5(_0x3f8ec8['message']);});});}function emit(_0x38d4d2,_0x352f1c,_0x28ccfc,_0x3ca017){var _0x34d222={'uri':util[_0x91a1('0x51')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x38d4d2,_0x28ccfc,_0x3ca017)};io['to'](util[_0x91a1('0x51')]('user:%s',_0x352f1c))[_0x91a1('0x52')]('trigger:browser:url',_0x34d222);}exports['cs']=function(_0x1a2842,_0x2c84e4,_0x153c5b,_0x1e9406,_0x2a6383,_0x1b4069,_0x4a2270,_0x1738ef){var _0x4286f4={};_0x1b4069[_0x91a1('0x10')]=_0x1b4069[_0x91a1('0x9')]?intUtil[_0x91a1('0x53')](_0x1b4069['CloudProvider'][_0x91a1('0xb')]):intUtil[_0x91a1('0x53')](_0x1b4069['remoteUri']);_0x1b4069[_0x91a1('0x54')]=intUtil[_0x91a1('0x53')](_0x1b4069[_0x91a1('0x54')]);_0x4286f4[_0x91a1('0x4e')]=_0x1738ef===_0x91a1('0x4f')||_0x1738ef===_0x91a1('0x55')?_0x91a1('0x4f'):_0x91a1('0x28');var _0x2424ea=_0x1b4069[_0x91a1('0x9')]?util[_0x91a1('0x51')](_0x91a1('0x56'),_0x1b4069[_0x91a1('0xa')][_0x91a1('0xb')]):util[_0x91a1('0x51')](_0x91a1('0x56'),_0x1b4069[_0x91a1('0x10')]);var _0x2676de=util[_0x91a1('0x51')](_0x91a1('0x57'),_0x1b4069['tenantId']);var _0x43eb17=util[_0x91a1('0x51')](_0x91a1('0x58'),_0x1b4069[_0x91a1('0x54')],_0x2c84e4[_0x91a1('0x59')],md5(_0x2c84e4[_0x91a1('0x59')]));if(_0x2a6383&&_0x2a6383[_0x91a1('0x5a')]){logger[_0x91a1('0x20')]('[QUEUE]',_0x91a1('0x5b'));_0x2c84e4[_0x91a1('0x5c')]=_0x43eb17;}else if(_0x4a2270&&_0x4a2270['recordingFormat']&&_0x4a2270[_0x91a1('0x5d')]!==_0x91a1('0x5e')){logger[_0x91a1('0x20')]('[OUTBOUND]',_0x91a1('0x5b'));_0x2c84e4[_0x91a1('0x5c')]=_0x43eb17;}else{_0x2c84e4[_0x91a1('0x5c')]='';}return getUser(_0x4286f4,_0x1b4069,_0x1e9406,_0x2676de,_0x2424ea,_0x1738ef)['then'](function(_0x1e26e9){logger[_0x91a1('0x20')]('['+_0x1738ef[_0x91a1('0x16')]()+_0x91a1('0x5f'),_0x1e26e9[_0x91a1('0x2e')]);logger['info']('['+_0x1738ef[_0x91a1('0x16')]()+']\x20The\x20User\x20email\x20is:',_0x1e26e9[_0x91a1('0x24')]);return getEndUser(_0x1e26e9,_0x1b4069,_0x2676de,_0x2424ea,_0x2c84e4,_0x1738ef,_0x153c5b[_0x91a1('0x60')],_0x153c5b[_0x91a1('0x61')]);})[_0x91a1('0x13')](function(_0x25863f){logger[_0x91a1('0x20')]('['+_0x1738ef['toUpperCase']()+_0x91a1('0x62'),_0x25863f['enduserId']);logger[_0x91a1('0x20')]('['+_0x1738ef[_0x91a1('0x16')]()+_0x91a1('0x63'),_0x2c84e4['calleridnum']);return getTicket(_0x25863f,_0x1b4069,_0x2676de,_0x2424ea,_0x2c84e4,_0x153c5b,_0x1738ef);})[_0x91a1('0x13')](function(_0x59736f){logger[_0x91a1('0x20')](util[_0x91a1('0x51')]('['+_0x1738ef[_0x91a1('0x16')]()+_0x91a1('0x64'),_0x153c5b[_0x91a1('0x45')],_0x59736f[_0x91a1('0x65')]));logger[_0x91a1('0x20')](util[_0x91a1('0x51')]('['+_0x1738ef[_0x91a1('0x16')]()+_0x91a1('0x66'),_0x1738ef));if(_0x1738ef!==_0x91a1('0x55')&&_0x153c5b[_0x91a1('0x67')]){logger[_0x91a1('0x20')]('['+_0x1738ef[_0x91a1('0x16')]()+']',_0x91a1('0x68'));emit(_0x1b4069[_0x91a1('0x10')],_0x1e9406['name'],_0x153c5b['ticketType'],_0x59736f[_0x91a1('0x65')]);}})[_0x91a1('0x15')](function(_0xe66cc3){logger[_0x91a1('0x69')]('['+_0x1738ef[_0x91a1('0x16')]()+_0x91a1('0x6a'),_0xe66cc3[_0x91a1('0x18')]);console[_0x91a1('0x69')]('Error\x20running\x20Dynamics365\x20integration',_0xe66cc3);});};
\ No newline at end of file
+var _0x8c22=['POST','headers','odata-entityid','substring','lastIndexOf','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','enduserId','contactid','nothing',']\x20Enduser\x20created!','length','picklist','type','nameField','customField','idField','indexOf','content','incidents','assign','Subjects','getString','Descriptions','/contacts(','ticketType','phonecall','/systemusers(','callDirection','queue','phonecalls','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','name','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','toLowerCase','outbound','destcalleridnum'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x8c22,0xa2));var _0x28c2=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0x8c22[_0xc1263e];return _0x471f07;};'use strict';var _=require('lodash');var rp=require(_0x28c2('0x0'));var util=require(_0x28c2('0x1'));var intUtil=require(_0x28c2('0x2'));var md5=require(_0x28c2('0x3'));var Redis=require(_0x28c2('0x4'));var logger=require(_0x28c2('0x5'))(_0x28c2('0x6'));var config=require(_0x28c2('0x7'));config[_0x28c2('0x8')]=_['defaults'](config[_0x28c2('0x8')],{'host':_0x28c2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x28c2('0x8')]));function getAuthToken(_0xe821b3,_0x1f87a9,_0x42856a){if(_0xe821b3[_0x28c2('0xa')]){_0xe821b3[_0x28c2('0xb')]=_0xe821b3[_0x28c2('0xc')][_0x28c2('0xd')];_0xe821b3[_0x28c2('0xe')]=_0xe821b3[_0x28c2('0xc')][_0x28c2('0xf')];return Promise[_0x28c2('0x10')](_0xe821b3[_0x28c2('0xc')]['data5']);}var _0x446961={'method':'POST','uri':_0x1f87a9,'form':{'client_id':_0xe821b3['clientId'],'resource':_0xe821b3[_0x28c2('0xb')],'username':_0xe821b3[_0x28c2('0x11')],'password':_0xe821b3[_0x28c2('0x12')],'grant_type':_0x28c2('0x12'),'client_secret':_0xe821b3[_0x28c2('0x13')]},'json':!![]};return rp(_0x446961)[_0x28c2('0x14')](function(_0x212ca7){return _0x212ca7[_0x28c2('0x15')];})[_0x28c2('0x16')](function(_0x39ded1){logger[_0x28c2('0x17')]('['+[_0x42856a[_0x28c2('0x18')]()]+_0x28c2('0x19'));return _0x39ded1[_0x28c2('0x1a')];});}function getUser(_0x10567f,_0x3c61cb,_0x5c001b,_0x5bc356,_0x4c8f70,_0xa03114){return new Promise(function(_0x57f07e,_0xbd9af2){return getAuthToken(_0x3c61cb,_0x5bc356,_0xa03114)['then'](function(_0x1b94d9){var _0x4ac4dc={'method':_0x28c2('0x1b'),'uri':_0x4c8f70+_0x28c2('0x1c'),'headers':{'Authorization':_0x28c2('0x1d')+_0x1b94d9,'OData-Version':_0x28c2('0x1e')},'json':!![]};return rp(_0x4ac4dc);})['then'](function(_0x5e1894){var _0x200bbb=_0x5e1894[_0x28c2('0x1f')];var _0x495cf4=![];var _0x4e52c6=null;if(!_['isNil'](_0x5c001b)){if(intUtil[_0x28c2('0x20')](_0x5c001b[_0x28c2('0x21')])){_0x10567f['userEmail']=_0x5c001b['email'];for(_0x4e52c6=0x0;_0x4e52c6<_0x200bbb['length'];_0x4e52c6++){if(_0x200bbb[_0x4e52c6][_0x28c2('0x22')]===_0x5c001b['email']&&!_0x200bbb[_0x4e52c6][_0x28c2('0x23')]){_0x495cf4=!![];logger[_0x28c2('0x24')]('['+[_0xa03114['toUpperCase']()]+_0x28c2('0x25')+_0x200bbb[_0x4e52c6][_0x28c2('0x26')]+'!');_0x10567f[_0x28c2('0x27')]=_0x200bbb[_0x4e52c6]['systemuserid'];}}}}if(!_0x495cf4){logger[_0x28c2('0x24')]('['+[_0xa03114[_0x28c2('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x10567f[_0x28c2('0x28')]=_0x3c61cb[_0x28c2('0x11')];for(_0x4e52c6=0x0;_0x4e52c6<_0x200bbb['length'];_0x4e52c6++){if(_0x200bbb[_0x4e52c6][_0x28c2('0x22')]===_0x3c61cb[_0x28c2('0x11')]){_0x10567f[_0x28c2('0x27')]=_0x200bbb[_0x4e52c6][_0x28c2('0x26')];}}}_0x57f07e(_0x10567f);})['catch'](function(_0x4d1499){_0xbd9af2(_0x4d1499[_0x28c2('0x1a')]);});});}function createEndUser(_0x596e01,_0x7fd8af,_0x52cd90,_0x5d4623,_0x45b3db,_0x2670e7,_0x5c59b5){return new Promise(function(_0x3b8907,_0x3b61d9){return getAuthToken(_0x7fd8af,_0x52cd90,_0x2670e7)['then'](function(_0x4e2689){var _0x1de4fc=_0x2670e7[_0x28c2('0x29')]()===_0x28c2('0x2a')?_0x45b3db[_0x28c2('0x2b')]:_0x45b3db['calleridnum'];var _0x15f705={'method':_0x28c2('0x2c'),'uri':_0x5d4623+'contacts','body':{'fullname':_0x1de4fc,'firstname':_0x1de4fc,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x596e01[_0x28c2('0x27')]+')'},'headers':{'Authorization':_0x28c2('0x1d')+_0x4e2689,'OData-Version':_0x28c2('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x15f705['body'][_0x5c59b5]=_0x1de4fc;return rp(_0x15f705);})[_0x28c2('0x14')](function(_0x250907){var _0x5a5ea8=_0x250907[_0x28c2('0x2d')][_0x28c2('0x2e')];var _0x2574fa=_0x5a5ea8[_0x28c2('0x2f')](_0x5a5ea8[_0x28c2('0x30')]('(')+0x1,_0x5a5ea8[_0x28c2('0x30')](')'));_0x596e01['enduserId']=_0x2574fa;_0x3b8907(_0x596e01);})['catch'](function(_0x3b9770){_0x3b61d9(_0x3b9770[_0x28c2('0x1a')]);});});}function getEndUser(_0x5c075f,_0x42ef95,_0xff1bad,_0x4d11a1,_0x256b58,_0x498d51,_0x43b0a6,_0x5d16cd){var _0xe6fe77=_0x498d51[_0x28c2('0x29')]()===_0x28c2('0x2a')?_0x256b58[_0x28c2('0x2b')]:_0x256b58[_0x28c2('0x31')];return getAuthToken(_0x42ef95,_0xff1bad,_0x498d51)[_0x28c2('0x14')](function(_0x398397){_0x5d16cd=_0x5d16cd?_0x5d16cd:_0x28c2('0x32');var _0x2f20b8={'method':_0x28c2('0x1b'),'uri':_0x4d11a1+_0x28c2('0x33')+_0x5d16cd+_0x28c2('0x34')+_0x5d16cd+_0x28c2('0x35')+_0xe6fe77[_0x28c2('0x36')]('+','%2b')+'\x27','headers':{'Authorization':_0x28c2('0x1d')+_0x398397,'If-None-Match':null,'OData-Version':_0x28c2('0x1e')},'json':!![]};return rp(_0x2f20b8);})[_0x28c2('0x14')](function(_0x5eb1e4){var _0x11688f=![];if(!_0x5eb1e4)return _0x11688f;var _0x3fed36=_0x5eb1e4[_0x28c2('0x1f')];for(var _0x3bcc55=0x0;_0x3bcc55<_0x3fed36['length'];_0x3bcc55++){if(_0x3fed36[_0x3bcc55][_0x5d16cd]===_0xe6fe77){_0x11688f=!![];_0x5c075f[_0x28c2('0x37')]=_0x3fed36[_0x3bcc55][_0x28c2('0x38')];}}return _0x11688f;})[_0x28c2('0x14')](function(_0x15254b){if(_0x15254b)return _0x5c075f;if(_0x43b0a6===_0x28c2('0x39')){logger[_0x28c2('0x24')]('['+[_0x498d51['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5c075f;}return createEndUser(_0x5c075f,_0x42ef95,_0xff1bad,_0x4d11a1,_0x256b58,_0x498d51,_0x5d16cd)[_0x28c2('0x14')](function(_0x30b727){logger['info']('['+[_0x498d51[_0x28c2('0x18')]()]+_0x28c2('0x3a'),_0x30b727[_0x28c2('0x37')]);return _0x30b727;});});}function getCustomFields(_0x4a8636,_0x372bac,_0x22c4f4){var _0x5d064c={};if(_0x4a8636[_0x28c2('0x3b')]>0x0){_['forEach'](_0x4a8636,function(_0x41ea69){if(_['includes'](['string',_0x28c2('0x3c')],_0x41ea69[_0x28c2('0x3d')])&&_0x41ea69[_0x28c2('0x3e')]&&!_0x41ea69[_0x28c2('0x3f')]){var _0x5e44e4=_0x41ea69[_0x28c2('0x40')][_0x28c2('0x29')]();var _0x34a903=_0x5e44e4['substring'](0x0,_0x5e44e4[_0x28c2('0x41')]('_'));var _0x5076d6=_0x5e44e4['substring'](_0x5e44e4[_0x28c2('0x41')]('_')+0x1);if(_0x34a903===_0x22c4f4){_0x5d064c[_0x5076d6]=_0x41ea69[_0x28c2('0x42')];}}});}return _0x5d064c;}function getTicket(_0x58ed36,_0x493d4a,_0x3c25bf,_0x4f4fd0,_0x1178a2,_0x4ca423,_0x48d197){return new Promise(function(_0xc44982,_0x199d41){var _0x107c78;return getAuthToken(_0x493d4a,_0x3c25bf,_0x48d197)[_0x28c2('0x14')](function(_0x4417bf){if(_0x4ca423['ticketType']==='incident'){_0x107c78={'method':_0x28c2('0x2c'),'uri':_0x4f4fd0+_0x28c2('0x43'),'body':Object[_0x28c2('0x44')]({},{'title':intUtil['getString'](_0x4ca423[_0x28c2('0x45')],_0x1178a2,'\x20'),'description':intUtil[_0x28c2('0x46')](_0x4ca423[_0x28c2('0x47')],_0x1178a2,'\x0a'),'customerid_contact@odata.bind':_0x58ed36['enduserId']?_0x28c2('0x48')+_0x58ed36[_0x28c2('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x58ed36['userId']+')','caseorigincode':'1'},getCustomFields(_0x4ca423['Fields'],_0x1178a2,_0x4ca423[_0x28c2('0x49')])),'headers':{'Authorization':_0x28c2('0x1d')+_0x4417bf,'OData-Version':_0x28c2('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4ca423['ticketType']===_0x28c2('0x4a')){var _0x1b5425=_0x58ed36[_0x28c2('0x37')]?[{'partyid_systemuser@odata.bind':_0x28c2('0x4b')+_0x58ed36[_0x28c2('0x27')]+')','participationtypemask':_0x58ed36[_0x28c2('0x4c')]===_0x28c2('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x28c2('0x48')+_0x58ed36['enduserId']+')','participationtypemask':_0x58ed36['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x28c2('0x4b')+_0x58ed36[_0x28c2('0x27')]+')','participationtypemask':_0x58ed36[_0x28c2('0x4c')]===_0x28c2('0x4d')?0x2:0x1}];_0x107c78={'method':_0x28c2('0x2c'),'uri':_0x4f4fd0+_0x28c2('0x4e'),'body':Object[_0x28c2('0x44')]({},{'subject':intUtil[_0x28c2('0x46')](_0x4ca423['Subjects'],_0x1178a2,'\x20'),'phonenumber':String(_0x1178a2[_0x28c2('0x31')]),'description':intUtil[_0x28c2('0x46')](_0x4ca423['Descriptions'],_0x1178a2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x58ed36['enduserId']?_0x28c2('0x48')+_0x58ed36[_0x28c2('0x37')]+')':undefined,'ownerid@odata.bind':_0x28c2('0x4b')+_0x58ed36['userId']+')','directioncode':_0x58ed36[_0x28c2('0x4c')]===_0x28c2('0x4d')?![]:!![],'phonecall_activity_parties':_0x1b5425},getCustomFields(_0x4ca423['Fields'],_0x1178a2,_0x4ca423['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4417bf,'OData-Version':_0x28c2('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x107c78);})[_0x28c2('0x14')](function(_0x10fa43){var _0x389644=_0x10fa43['headers'][_0x28c2('0x2e')];var _0x28c4c9=_0x389644[_0x28c2('0x2f')](_0x389644[_0x28c2('0x30')]('(')+0x1,_0x389644['lastIndexOf'](')'));_0x58ed36[_0x28c2('0x4f')]=_0x28c4c9;_0xc44982(_0x58ed36);})[_0x28c2('0x16')](function(_0x19dd4c){_0x199d41(_0x19dd4c[_0x28c2('0x1a')]);});});}function emit(_0x9b29cf,_0x532ff9,_0x2c1b32,_0x50f06e){var _0x38daee={'uri':util[_0x28c2('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x9b29cf,_0x2c1b32,_0x50f06e)};io['to'](util['format']('user:%s',_0x532ff9))[_0x28c2('0x51')](_0x28c2('0x52'),_0x38daee);}exports['cs']=function(_0x4c554c,_0x70420b,_0x3f8e28,_0x24da0b,_0x556a3c,_0x3783db,_0x45028c,_0x3b6d28){var _0x45c983={};_0x3783db[_0x28c2('0xb')]=_0x3783db[_0x28c2('0xa')]?intUtil['stripTrailingSlash'](_0x3783db[_0x28c2('0xc')]['data7']):intUtil[_0x28c2('0x53')](_0x3783db[_0x28c2('0xb')]);_0x3783db['serverUrl']=intUtil[_0x28c2('0x53')](_0x3783db[_0x28c2('0x54')]);_0x45c983[_0x28c2('0x4c')]=_0x3b6d28===_0x28c2('0x4d')||_0x3b6d28==='unmanaged'?'queue':_0x28c2('0x2a');var _0x1791d6=_0x3783db['modernAuthentication']?util[_0x28c2('0x50')](_0x28c2('0x55'),_0x3783db[_0x28c2('0xc')][_0x28c2('0xd')]):util[_0x28c2('0x50')](_0x28c2('0x55'),_0x3783db[_0x28c2('0xb')]);var _0x32c1f7=util['format'](_0x28c2('0x56'),_0x3783db[_0x28c2('0xe')]);var _0x52bb4f=util[_0x28c2('0x50')](_0x28c2('0x57'),_0x3783db[_0x28c2('0x54')],_0x70420b[_0x28c2('0x58')],md5(_0x70420b[_0x28c2('0x58')]));if(_0x556a3c&&_0x556a3c[_0x28c2('0x59')]){logger[_0x28c2('0x24')](_0x28c2('0x5a'),_0x28c2('0x5b'));_0x70420b[_0x28c2('0x5c')]=_0x52bb4f;}else if(_0x45028c&&_0x45028c[_0x28c2('0x5d')]&&_0x45028c[_0x28c2('0x5d')]!==_0x28c2('0x5e')){logger[_0x28c2('0x24')]('[OUTBOUND]',_0x28c2('0x5b'));_0x70420b[_0x28c2('0x5c')]=_0x52bb4f;}else{_0x70420b['recordingURL']='';}return getUser(_0x45c983,_0x3783db,_0x24da0b,_0x32c1f7,_0x1791d6,_0x3b6d28)[_0x28c2('0x14')](function(_0x2f37c5){logger['info']('['+_0x3b6d28['toUpperCase']()+_0x28c2('0x5f'),_0x2f37c5[_0x28c2('0x27')]);logger[_0x28c2('0x24')]('['+_0x3b6d28['toUpperCase']()+_0x28c2('0x60'),_0x2f37c5[_0x28c2('0x28')]);return getEndUser(_0x2f37c5,_0x3783db,_0x32c1f7,_0x1791d6,_0x70420b,_0x3b6d28,_0x3f8e28['moduleCreate'],_0x3f8e28['additionalSearchContact']);})['then'](function(_0x5b95b3){logger['info']('['+_0x3b6d28[_0x28c2('0x18')]()+_0x28c2('0x61'),_0x5b95b3[_0x28c2('0x37')]);logger[_0x28c2('0x24')]('['+_0x3b6d28['toUpperCase']()+_0x28c2('0x62'),_0x70420b['calleridnum']);return getTicket(_0x5b95b3,_0x3783db,_0x32c1f7,_0x1791d6,_0x70420b,_0x3f8e28,_0x3b6d28);})[_0x28c2('0x14')](function(_0x2e9a95){logger[_0x28c2('0x24')](util[_0x28c2('0x50')]('['+_0x3b6d28[_0x28c2('0x18')]()+_0x28c2('0x63'),_0x3f8e28[_0x28c2('0x49')],_0x2e9a95[_0x28c2('0x4f')]));logger[_0x28c2('0x24')](util['format']('['+_0x3b6d28[_0x28c2('0x18')]()+']\x20Call\x20direction:\x20%s',_0x3b6d28));if(_0x3b6d28!=='unmanaged'&&_0x3f8e28[_0x28c2('0x64')]){logger['info']('['+_0x3b6d28[_0x28c2('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3783db[_0x28c2('0xb')],_0x24da0b[_0x28c2('0x65')],_0x3f8e28[_0x28c2('0x49')],_0x2e9a95[_0x28c2('0x4f')]);}})[_0x28c2('0x16')](function(_0x4025a8){logger['error']('['+_0x3b6d28[_0x28c2('0x18')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x4025a8[_0x28c2('0x1a')]);console[_0x28c2('0x17')](_0x28c2('0x66'),_0x4025a8);});};
\ No newline at end of file
index aca93f2..9894904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f0=['format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','name','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','then','info','validateEmail','%s/api/v2/agents','length','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','includes','picklist','type','nameField','customField','string','idField','push','content','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','user:%s','error','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xf9f0,0xb1));var _0x0f9f=function(_0x55413a,_0x457b10){_0x55413a=_0x55413a-0x0;var _0x3739f4=_0xf9f0[_0x55413a];return _0x3739f4;};'use strict';var _=require(_0x0f9f('0x0'));var rp=require(_0x0f9f('0x1'));var md5=require(_0x0f9f('0x2'));var util=require(_0x0f9f('0x3'));var Redis=require(_0x0f9f('0x4'));var intUtil=require(_0x0f9f('0x5'));var config=require(_0x0f9f('0x6'));var logger=require(_0x0f9f('0x7'))(_0x0f9f('0x8'));config[_0x0f9f('0x9')]=_[_0x0f9f('0xa')](config['redis'],{'host':_0x0f9f('0xb'),'port':0x18eb});var io=require(_0x0f9f('0xc'))(new Redis(config[_0x0f9f('0x9')]));var headers={'Content-Type':_0x0f9f('0xd'),'Accept':'application/json'};function emit(_0x4a587c,_0x45180b,_0x111261){io['to'](_0x4a587c)[_0x0f9f('0xe')](_0x45180b,_0x111261);}function getTicket(_0x2245dd,_0x9404d9,_0x1ce898,_0x2260a8,_0x35d415){logger['info'](_0x0f9f('0xf'));var _0x14ebd3=_[_0x0f9f('0x10')]({'responder_id':_0x9404d9['id'],'requester_id':_0x1ce898['id'],'name':util[_0x0f9f('0x11')](_0x0f9f('0x12'),_0x35d415[_0x0f9f('0x13')]),'phone':_0x35d415['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0f9f('0x14')](_0x2260a8[_0x0f9f('0x15')],_0x35d415,'\x20'),'description':intUtil[_0x0f9f('0x14')](_0x2260a8[_0x0f9f('0x16')],_0x35d415,'<br>'),'tags':getTags(_0x2260a8[_0x0f9f('0x17')],_0x0f9f('0x18'))},getCustomFields(_0x2260a8[_0x0f9f('0x19')],_0x35d415));_0x14ebd3['custom_fields']=_['mapValues'](_[_0x0f9f('0x1a')](_0x14ebd3[_0x0f9f('0x1b')],'id'),_0x0f9f('0x1c'));return request({'uri':util[_0x0f9f('0x11')](_0x0f9f('0x1d'),_0x2245dd[_0x0f9f('0x1e')]),'method':'POST','body':_0x14ebd3})[_0x0f9f('0x1f')](function(_0x5a90ea){logger[_0x0f9f('0x20')]('Ticket\x20created!');return _0x5a90ea;});}function getUser(_0x215eb1,_0x5120f0){if(intUtil[_0x0f9f('0x21')](_0x5120f0)){return request({'uri':util[_0x0f9f('0x11')](_0x0f9f('0x22'),_0x215eb1[_0x0f9f('0x1e')]),'qs':{'email':_0x5120f0}})[_0x0f9f('0x1f')](function(_0x5d62dd){if(_0x5d62dd[_0x0f9f('0x23')]){logger['info']('Agent\x20found!');return _[_0x0f9f('0x24')](_0x5d62dd,function(_0x5b9def){return _0x5b9def['contact'][_0x0f9f('0x25')]===_0x5120f0;});}else{logger[_0x0f9f('0x20')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0f9f('0x11')](_0x0f9f('0x26'),_0x215eb1[_0x0f9f('0x1e')])})[_0x0f9f('0x1f')](function(_0x59c35a){logger[_0x0f9f('0x20')](_0x0f9f('0x27'));return _0x59c35a;});}});}else{logger[_0x0f9f('0x20')](_0x0f9f('0x28'));return request({'uri':util[_0x0f9f('0x11')]('%s/api/v2/agents/me',_0x215eb1[_0x0f9f('0x1e')])})[_0x0f9f('0x1f')](function(_0x3a21e4){logger[_0x0f9f('0x20')](_0x0f9f('0x27'));return _0x3a21e4;});}}function getEndUser(_0xa1036c,_0x1e0d47,_0x344b4a){logger['info'](_0x0f9f('0x29'),_0x344b4a);return request({'uri':util[_0x0f9f('0x11')](_0x0f9f('0x2a'),_0xa1036c[_0x0f9f('0x1e')]),'qs':{'phone':_0x344b4a}})[_0x0f9f('0x1f')](function(_0x12b7f5){if(_0x12b7f5[_0x0f9f('0x23')]){logger['info']('Enduser\x20found!');return _[_0x0f9f('0x24')](_0x12b7f5,{'phone':_0x344b4a});}else{logger['info'](_0x0f9f('0x2b'));return request({'uri':util['format'](_0x0f9f('0x2a'),_0xa1036c[_0x0f9f('0x1e')]),'method':_0x0f9f('0x2c'),'body':{'name':_0x1e0d47,'phone':_0x344b4a}})[_0x0f9f('0x1f')](function(_0x34ac8f){logger[_0x0f9f('0x20')](_0x0f9f('0x2d'));return _0x34ac8f;});}});}function getAuth(_0x33eec2){return util[_0x0f9f('0x11')](_0x0f9f('0x2e'),new Buffer(_0x33eec2[_0x0f9f('0x2f')]+':X')[_0x0f9f('0x30')](_0x0f9f('0x31')));}function request(_0x15af85){logger['debug'](_0x0f9f('0x32'),JSON[_0x0f9f('0x33')](_0x15af85));return rp(_['defaults'](_0x15af85,{'method':_0x0f9f('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x42b10e,_0x1ff53d){var _0x1bea06=[];if(_0x42b10e&&_0x42b10e[_0x0f9f('0x23')]>0x0){_0x1bea06=_[_0x0f9f('0x35')](_0x42b10e,_0x1ff53d);}return _0x1bea06;}function getCustomFields(_0x5c8655,_0x11c6a1){var _0x3d9cb8=[];var _0x3a8cee={'custom_fields':[]};if(_0x5c8655[_0x0f9f('0x23')]>0x0){_['forEach'](_0x5c8655,function(_0x2a4d76){if(_[_0x0f9f('0x36')](['string',_0x0f9f('0x37')],_0x2a4d76[_0x0f9f('0x38')])&&_0x2a4d76[_0x0f9f('0x39')]&&!_0x2a4d76[_0x0f9f('0x3a')]){_0x3a8cee[_0x2a4d76[_0x0f9f('0x39')]['toLowerCase']()]=_0x2a4d76['content'][_0x0f9f('0x30')]();}else if(_[_0x0f9f('0x36')]([_0x0f9f('0x3b'),_0x0f9f('0x37')],_0x2a4d76['type'])&&_0x2a4d76[_0x0f9f('0x3c')]&&_0x2a4d76[_0x0f9f('0x3a')]){_0x3a8cee[_0x0f9f('0x1b')][_0x0f9f('0x3d')]({'id':_0x2a4d76[_0x0f9f('0x3c')],'value':_0x2a4d76[_0x0f9f('0x3e')][_0x0f9f('0x30')]()});}else if(_0x2a4d76[_0x0f9f('0x38')]===_0x0f9f('0x3f')&&_0x2a4d76[_0x0f9f('0x40')]&&_0x2a4d76[_0x0f9f('0x3c')]&&_0x2a4d76[_0x0f9f('0x3a')]){_0x11c6a1[_0x2a4d76[_0x0f9f('0x40')]]&&_0x3a8cee[_0x0f9f('0x1b')]['push']({'id':_0x2a4d76[_0x0f9f('0x3c')],'value':_0x11c6a1[_0x2a4d76['variableName']]['toString']()});}else if(_0x2a4d76[_0x0f9f('0x38')]===_0x0f9f('0x41')&&_0x2a4d76[_0x0f9f('0x42')]&&_0x2a4d76['Variable'][_0x0f9f('0x18')]&&_0x2a4d76[_0x0f9f('0x3c')]&&_0x2a4d76['customField']){_0x11c6a1[_0x2a4d76['Variable'][_0x0f9f('0x18')][_0x0f9f('0x43')]()]&&_0x3a8cee[_0x0f9f('0x1b')][_0x0f9f('0x3d')]({'id':_0x2a4d76[_0x0f9f('0x3c')],'value':_0x11c6a1[_0x2a4d76[_0x0f9f('0x42')][_0x0f9f('0x18')]['toLowerCase']()][_0x0f9f('0x30')]()});}});}return _0x3a8cee;}exports[_0x0f9f('0x44')]=function(_0x49f86d,_0x4c4f5a,_0x386c27,_0x224f98,_0x5036c4,_0xd7c622){var _0x275606,_0x8b84a1;_0xd7c622[_0x0f9f('0x1e')]=intUtil[_0x0f9f('0x45')](_0xd7c622['remoteUri']);_0xd7c622['serverUrl']=intUtil['stripTrailingSlash'](_0xd7c622[_0x0f9f('0x46')]);if(_0x5036c4&&_0x5036c4['monitor_format']){logger[_0x0f9f('0x20')](_0x0f9f('0x47'),_0x0f9f('0x48'));_0x4c4f5a[_0x0f9f('0x49')]=util[_0x0f9f('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd7c622['serverUrl'],_0x4c4f5a[_0x0f9f('0x4a')],md5(_0x4c4f5a[_0x0f9f('0x4a')]));}else{_0x4c4f5a['recordingURL']='';}headers[_0x0f9f('0x4b')]=getAuth(_0xd7c622);return getUser(_0xd7c622,_0x224f98[_0x0f9f('0x25')])[_0x0f9f('0x1f')](function(_0x3f23ae){_0x275606=_0x3f23ae;logger[_0x0f9f('0x20')](_0x0f9f('0x4c'),_0x275606['id']);return getEndUser(_0xd7c622,_0x4c4f5a[_0x0f9f('0x13')],_0x4c4f5a[_0x0f9f('0x4d')]);})[_0x0f9f('0x1f')](function(_0x2e6388){_0x8b84a1=_0x2e6388;logger[_0x0f9f('0x20')](_0x0f9f('0x4e'),_0x8b84a1['id']);return getTicket(_0xd7c622,_0x275606,_0x8b84a1,_0x386c27,_0x4c4f5a);})['then'](function(_0x199cef){if(_0x199cef&&_0x199cef['id']){logger[_0x0f9f('0x20')](_0x0f9f('0x4f'));logger['info'](_0x0f9f('0x50'),_0x199cef['id']);logger['info'](_0x0f9f('0x47'),_0x0f9f('0x51'));emit(util[_0x0f9f('0x11')]('user:%s',_0x224f98[_0x0f9f('0x18')]),_0x0f9f('0x52'),{'uri':util[_0x0f9f('0x11')](_0x0f9f('0x53'),_0xd7c622[_0x0f9f('0x1e')],_0x199cef['id'])});}})[_0x0f9f('0x54')](function(_0x25d8c4){logger['error']('[QUEUE]',JSON[_0x0f9f('0x33')](_0x25d8c4));});};exports[_0x0f9f('0x55')]=function(_0x184cfe,_0x4be36a,_0x20b1ed,_0x45f060,_0x1a0c4b,_0x2bdb73,_0x2dc6ae){var _0x2b47fd,_0x4f07f5;_0x2bdb73[_0x0f9f('0x1e')]=intUtil['stripTrailingSlash'](_0x2bdb73[_0x0f9f('0x1e')]);_0x2bdb73[_0x0f9f('0x46')]=intUtil['stripTrailingSlash'](_0x2bdb73[_0x0f9f('0x46')]);if(_0x2dc6ae&&_0x2dc6ae[_0x0f9f('0x56')]&&_0x2dc6ae[_0x0f9f('0x56')]!==_0x0f9f('0x57')){logger[_0x0f9f('0x20')](_0x0f9f('0x58'),_0x0f9f('0x48'));_0x4be36a['recordingURL']=util['format'](_0x0f9f('0x59'),_0x2bdb73[_0x0f9f('0x46')],_0x4be36a[_0x0f9f('0x4a')],md5(_0x4be36a['uniqueid']));}headers[_0x0f9f('0x4b')]=getAuth(_0x2bdb73);return getUser(_0x2bdb73,_0x45f060[_0x0f9f('0x25')])[_0x0f9f('0x1f')](function(_0x290ee4){_0x2b47fd=_0x290ee4;logger[_0x0f9f('0x20')](_0x0f9f('0x4c'),_0x2b47fd['id']);return getEndUser(_0x2bdb73,_0x4be36a[_0x0f9f('0x5a')],_0x4be36a['destcalleridnum']);})['then'](function(_0x38ea2a){_0x4f07f5=_0x38ea2a;logger[_0x0f9f('0x20')](_0x0f9f('0x4e'),_0x4f07f5['id']);return getTicket(_0x2bdb73,_0x2b47fd,_0x4f07f5,_0x20b1ed,_0x4be36a);})['then'](function(_0x29c8e6){if(_0x29c8e6&&_0x29c8e6['id']){logger[_0x0f9f('0x20')]('Ticket\x20created!');logger['info'](_0x0f9f('0x50'),_0x29c8e6['id']);logger[_0x0f9f('0x20')](_0x0f9f('0x58'),_0x0f9f('0x51'));emit(util[_0x0f9f('0x11')](_0x0f9f('0x5b'),_0x45f060[_0x0f9f('0x18')]),_0x0f9f('0x52'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x2bdb73[_0x0f9f('0x1e')],_0x29c8e6['id'])});}})[_0x0f9f('0x54')](function(_0x440361){logger[_0x0f9f('0x5c')](_0x0f9f('0x58'),JSON['stringify'](_0x440361));});};exports[_0x0f9f('0x5d')]=function(_0x18774d,_0x223f48,_0x3f21af,_0x25c604,_0x127daa,_0x109cf6){var _0x29e6cf,_0x503dca;_0x109cf6['remoteUri']=intUtil['stripTrailingSlash'](_0x109cf6[_0x0f9f('0x1e')]);_0x109cf6['serverUrl']=intUtil[_0x0f9f('0x45')](_0x109cf6['serverUrl']);if(_0x127daa&&_0x127daa[_0x0f9f('0x5e')]){logger[_0x0f9f('0x20')]('['+_0x223f48['lastevent'][_0x0f9f('0x5f')]()+']',_0x0f9f('0x48'));_0x223f48[_0x0f9f('0x49')]=util[_0x0f9f('0x11')](_0x0f9f('0x59'),_0x109cf6[_0x0f9f('0x46')],_0x223f48[_0x0f9f('0x4a')],md5(_0x223f48[_0x0f9f('0x4a')]));}else{_0x223f48[_0x0f9f('0x49')]='';}headers[_0x0f9f('0x4b')]=getAuth(_0x109cf6);return getUser(_0x109cf6,'')['then'](function(_0x5c0dfc){_0x29e6cf=_0x5c0dfc;logger[_0x0f9f('0x20')](_0x0f9f('0x4c'),_0x29e6cf['id']);return getEndUser(_0x109cf6,_0x223f48[_0x0f9f('0x13')],_0x223f48[_0x0f9f('0x4d')]);})[_0x0f9f('0x1f')](function(_0x31a580){_0x503dca=_0x31a580;logger[_0x0f9f('0x20')](_0x0f9f('0x4e'),_0x503dca['id']);return getTicket(_0x109cf6,_0x29e6cf,_0x503dca,_0x3f21af,_0x223f48);})[_0x0f9f('0x1f')](function(_0x18a30e){if(_0x18a30e){logger['info'](_0x0f9f('0x4f'));logger['info'](_0x0f9f('0x50'),_0x18a30e['id']);}})[_0x0f9f('0x54')](function(_0x120f90){logger[_0x0f9f('0x5c')]('['+_0x223f48[_0x0f9f('0x60')][_0x0f9f('0x5f')]()+']',JSON[_0x0f9f('0x33')](_0x120f90));});};
\ No newline at end of file
+var _0x9876=['Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','base64','debug','GET','forEach','includes','picklist','nameField','customField','toLowerCase','content','toString','type','push','idField','variableName','customVariable','Variable','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridname','unmanaged','lastevent','toUpperCase','request-promise','md5','util','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.'];(function(_0x4f1688,_0x4914aa){var _0x2d6440=function(_0x132713){while(--_0x132713){_0x4f1688['push'](_0x4f1688['shift']());}};_0x2d6440(++_0x4914aa);}(_0x9876,0x8e));var _0x6987=function(_0x327e57,_0x3342a1){_0x327e57=_0x327e57-0x0;var _0x3279f6=_0x9876[_0x327e57];return _0x3279f6;};'use strict';var _=require('lodash');var rp=require(_0x6987('0x0'));var md5=require(_0x6987('0x1'));var util=require(_0x6987('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6987('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6987('0x4'))(_0x6987('0x5'));config[_0x6987('0x6')]=_[_0x6987('0x7')](config[_0x6987('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6987('0x8'))(new Redis(config[_0x6987('0x6')]));var headers={'Content-Type':_0x6987('0x9'),'Accept':_0x6987('0x9')};function emit(_0x726230,_0x18ac8b,_0x6d5276){io['to'](_0x726230)[_0x6987('0xa')](_0x18ac8b,_0x6d5276);}function getTicket(_0x24d1a9,_0x5ebcf5,_0x357ea0,_0x4d3847,_0x462e09){logger[_0x6987('0xb')](_0x6987('0xc'));var _0x9076b8=_[_0x6987('0xd')]({'responder_id':_0x5ebcf5['id'],'requester_id':_0x357ea0['id'],'name':util[_0x6987('0xe')](_0x6987('0xf'),_0x462e09[_0x6987('0x10')]),'phone':_0x462e09[_0x6987('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6987('0x12')](_0x4d3847[_0x6987('0x13')],_0x462e09,'\x20'),'description':intUtil['getString'](_0x4d3847[_0x6987('0x14')],_0x462e09,_0x6987('0x15')),'tags':getTags(_0x4d3847[_0x6987('0x16')],_0x6987('0x17'))},getCustomFields(_0x4d3847['Fields'],_0x462e09));_0x9076b8[_0x6987('0x18')]=_[_0x6987('0x19')](_[_0x6987('0x1a')](_0x9076b8[_0x6987('0x18')],'id'),_0x6987('0x1b'));return request({'uri':util[_0x6987('0xe')](_0x6987('0x1c'),_0x24d1a9['remoteUri']),'method':_0x6987('0x1d'),'body':_0x9076b8})[_0x6987('0x1e')](function(_0x4cbfce){logger[_0x6987('0xb')](_0x6987('0x1f'));return _0x4cbfce;});}function getUser(_0x407bf1,_0xe91599){if(intUtil['validateEmail'](_0xe91599)){return request({'uri':util['format'](_0x6987('0x20'),_0x407bf1['remoteUri']),'qs':{'email':_0xe91599}})[_0x6987('0x1e')](function(_0x379e30){if(_0x379e30['length']){logger[_0x6987('0xb')]('Agent\x20found!');return _[_0x6987('0x21')](_0x379e30,function(_0x329912){return _0x329912[_0x6987('0x22')]['email']===_0xe91599;});}else{logger[_0x6987('0xb')](_0x6987('0x23'));return request({'uri':util[_0x6987('0xe')](_0x6987('0x24'),_0x407bf1['remoteUri'])})[_0x6987('0x1e')](function(_0x19fa71){logger[_0x6987('0xb')](_0x6987('0x25'));return _0x19fa71;});}});}else{logger[_0x6987('0xb')](_0x6987('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x407bf1[_0x6987('0x27')])})['then'](function(_0x16717b){logger[_0x6987('0xb')]('Admin\x20account\x20selected.');return _0x16717b;});}}function getEndUser(_0x3a6b87,_0x14717e,_0x585806){logger[_0x6987('0xb')](_0x6987('0x28'),_0x585806);return request({'uri':util[_0x6987('0xe')]('%s/api/v2/contacts',_0x3a6b87[_0x6987('0x27')]),'qs':{'phone':_0x585806}})[_0x6987('0x1e')](function(_0x1a105e){if(_0x1a105e[_0x6987('0x29')]){logger[_0x6987('0xb')](_0x6987('0x2a'));return _['find'](_0x1a105e,{'phone':_0x585806});}else{logger[_0x6987('0xb')](_0x6987('0x2b'));return request({'uri':util['format'](_0x6987('0x2c'),_0x3a6b87[_0x6987('0x27')]),'method':'POST','body':{'name':_0x14717e,'phone':_0x585806}})[_0x6987('0x1e')](function(_0x586f15){logger[_0x6987('0xb')](_0x6987('0x2d'));return _0x586f15;});}});}function getAuth(_0x14ea9c){return util[_0x6987('0xe')](_0x6987('0x2e'),new Buffer(_0x14ea9c['apiKey']+':X')['toString'](_0x6987('0x2f')));}function request(_0x5a0353){logger[_0x6987('0x30')]('[HTTP]',JSON['stringify'](_0x5a0353));return rp(_['defaults'](_0x5a0353,{'method':_0x6987('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3fc1cb,_0x820b20){var _0x4ce011=[];if(_0x3fc1cb&&_0x3fc1cb[_0x6987('0x29')]>0x0){_0x4ce011=_['map'](_0x3fc1cb,_0x820b20);}return _0x4ce011;}function getCustomFields(_0x2b3181,_0x333d89){var _0x5c0748=[];var _0x77bde6={'custom_fields':[]};if(_0x2b3181['length']>0x0){_[_0x6987('0x32')](_0x2b3181,function(_0x45a7b0){if(_[_0x6987('0x33')](['string',_0x6987('0x34')],_0x45a7b0['type'])&&_0x45a7b0[_0x6987('0x35')]&&!_0x45a7b0[_0x6987('0x36')]){_0x77bde6[_0x45a7b0[_0x6987('0x35')][_0x6987('0x37')]()]=_0x45a7b0[_0x6987('0x38')][_0x6987('0x39')]();}else if(_[_0x6987('0x33')](['string','picklist'],_0x45a7b0[_0x6987('0x3a')])&&_0x45a7b0['idField']&&_0x45a7b0[_0x6987('0x36')]){_0x77bde6[_0x6987('0x18')][_0x6987('0x3b')]({'id':_0x45a7b0[_0x6987('0x3c')],'value':_0x45a7b0['content'][_0x6987('0x39')]()});}else if(_0x45a7b0[_0x6987('0x3a')]==='variable'&&_0x45a7b0[_0x6987('0x3d')]&&_0x45a7b0['idField']&&_0x45a7b0[_0x6987('0x36')]){_0x333d89[_0x45a7b0[_0x6987('0x3d')]]&&_0x77bde6[_0x6987('0x18')]['push']({'id':_0x45a7b0[_0x6987('0x3c')],'value':_0x333d89[_0x45a7b0[_0x6987('0x3d')]]['toString']()});}else if(_0x45a7b0[_0x6987('0x3a')]===_0x6987('0x3e')&&_0x45a7b0[_0x6987('0x3f')]&&_0x45a7b0[_0x6987('0x3f')][_0x6987('0x17')]&&_0x45a7b0[_0x6987('0x3c')]&&_0x45a7b0[_0x6987('0x36')]){_0x333d89[_0x45a7b0['Variable'][_0x6987('0x17')][_0x6987('0x37')]()]&&_0x77bde6['custom_fields']['push']({'id':_0x45a7b0[_0x6987('0x3c')],'value':_0x333d89[_0x45a7b0[_0x6987('0x3f')][_0x6987('0x17')]['toLowerCase']()]['toString']()});}});}return _0x77bde6;}exports['queue']=function(_0x40382b,_0x43cae7,_0xdd387,_0x4bb3b3,_0x405cd2,_0x1811fb){var _0x1f1319,_0x24d9bf;_0x1811fb['remoteUri']=intUtil[_0x6987('0x40')](_0x1811fb[_0x6987('0x27')]);_0x1811fb['serverUrl']=intUtil[_0x6987('0x40')](_0x1811fb['serverUrl']);if(_0x405cd2&&_0x405cd2[_0x6987('0x41')]){logger[_0x6987('0xb')]('[QUEUE]',_0x6987('0x42'));_0x43cae7[_0x6987('0x43')]=util['format'](_0x6987('0x44'),_0x1811fb[_0x6987('0x45')],_0x43cae7[_0x6987('0x46')],md5(_0x43cae7[_0x6987('0x46')]));}else{_0x43cae7[_0x6987('0x43')]='';}headers[_0x6987('0x47')]=getAuth(_0x1811fb);return getUser(_0x1811fb,_0x4bb3b3['email'])['then'](function(_0x477cbc){_0x1f1319=_0x477cbc;logger[_0x6987('0xb')](_0x6987('0x48'),_0x1f1319['id']);return getEndUser(_0x1811fb,_0x43cae7[_0x6987('0x10')],_0x43cae7[_0x6987('0x11')]);})[_0x6987('0x1e')](function(_0x55bf07){_0x24d9bf=_0x55bf07;logger[_0x6987('0xb')](_0x6987('0x49'),_0x24d9bf['id']);return getTicket(_0x1811fb,_0x1f1319,_0x24d9bf,_0xdd387,_0x43cae7);})[_0x6987('0x1e')](function(_0xce71c5){if(_0xce71c5&&_0xce71c5['id']){logger[_0x6987('0xb')](_0x6987('0x1f'));logger[_0x6987('0xb')](_0x6987('0x4a'),_0xce71c5['id']);logger[_0x6987('0xb')](_0x6987('0x4b'),_0x6987('0x4c'));emit(util[_0x6987('0xe')](_0x6987('0x4d'),_0x4bb3b3['name']),_0x6987('0x4e'),{'uri':util[_0x6987('0xe')](_0x6987('0x4f'),_0x1811fb[_0x6987('0x27')],_0xce71c5['id'])});}})[_0x6987('0x50')](function(_0x57dc4c){logger[_0x6987('0x51')](_0x6987('0x4b'),JSON[_0x6987('0x52')](_0x57dc4c));});};exports['outbound']=function(_0x499b34,_0x2421b8,_0x4a851,_0x477c7e,_0x4904ff,_0x2cbef1,_0xd2bf39){var _0x59d39c,_0x602739;_0x2cbef1[_0x6987('0x27')]=intUtil[_0x6987('0x40')](_0x2cbef1[_0x6987('0x27')]);_0x2cbef1[_0x6987('0x45')]=intUtil['stripTrailingSlash'](_0x2cbef1[_0x6987('0x45')]);if(_0xd2bf39&&_0xd2bf39[_0x6987('0x53')]&&_0xd2bf39[_0x6987('0x53')]!==_0x6987('0x54')){logger['info'](_0x6987('0x55'),_0x6987('0x42'));_0x2421b8[_0x6987('0x43')]=util[_0x6987('0xe')](_0x6987('0x44'),_0x2cbef1[_0x6987('0x45')],_0x2421b8[_0x6987('0x46')],md5(_0x2421b8['uniqueid']));}headers[_0x6987('0x47')]=getAuth(_0x2cbef1);return getUser(_0x2cbef1,_0x477c7e['email'])['then'](function(_0x1fa883){_0x59d39c=_0x1fa883;logger[_0x6987('0xb')](_0x6987('0x48'),_0x59d39c['id']);return getEndUser(_0x2cbef1,_0x2421b8[_0x6987('0x56')],_0x2421b8['destcalleridnum']);})['then'](function(_0x33b048){_0x602739=_0x33b048;logger[_0x6987('0xb')](_0x6987('0x49'),_0x602739['id']);return getTicket(_0x2cbef1,_0x59d39c,_0x602739,_0x4a851,_0x2421b8);})['then'](function(_0x558dd7){if(_0x558dd7&&_0x558dd7['id']){logger['info'](_0x6987('0x1f'));logger[_0x6987('0xb')](_0x6987('0x4a'),_0x558dd7['id']);logger[_0x6987('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6987('0xe')]('user:%s',_0x477c7e['name']),_0x6987('0x4e'),{'uri':util[_0x6987('0xe')](_0x6987('0x4f'),_0x2cbef1[_0x6987('0x27')],_0x558dd7['id'])});}})[_0x6987('0x50')](function(_0x4a8480){logger[_0x6987('0x51')](_0x6987('0x55'),JSON[_0x6987('0x52')](_0x4a8480));});};exports[_0x6987('0x57')]=function(_0x326c6f,_0x2c2880,_0x190ccf,_0x45cc39,_0x44fcd6,_0x288fac){var _0x303c8a,_0x48fa71;_0x288fac['remoteUri']=intUtil[_0x6987('0x40')](_0x288fac[_0x6987('0x27')]);_0x288fac[_0x6987('0x45')]=intUtil[_0x6987('0x40')](_0x288fac[_0x6987('0x45')]);if(_0x44fcd6&&_0x44fcd6[_0x6987('0x41')]){logger[_0x6987('0xb')]('['+_0x2c2880[_0x6987('0x58')]['toUpperCase']()+']',_0x6987('0x42'));_0x2c2880[_0x6987('0x43')]=util[_0x6987('0xe')](_0x6987('0x44'),_0x288fac[_0x6987('0x45')],_0x2c2880['uniqueid'],md5(_0x2c2880[_0x6987('0x46')]));}else{_0x2c2880[_0x6987('0x43')]='';}headers[_0x6987('0x47')]=getAuth(_0x288fac);return getUser(_0x288fac,'')['then'](function(_0x56af2d){_0x303c8a=_0x56af2d;logger[_0x6987('0xb')](_0x6987('0x48'),_0x303c8a['id']);return getEndUser(_0x288fac,_0x2c2880[_0x6987('0x10')],_0x2c2880[_0x6987('0x11')]);})[_0x6987('0x1e')](function(_0x26d42e){_0x48fa71=_0x26d42e;logger[_0x6987('0xb')](_0x6987('0x49'),_0x48fa71['id']);return getTicket(_0x288fac,_0x303c8a,_0x48fa71,_0x190ccf,_0x2c2880);})[_0x6987('0x1e')](function(_0x24515b){if(_0x24515b){logger[_0x6987('0xb')]('Ticket\x20created!');logger[_0x6987('0xb')](_0x6987('0x4a'),_0x24515b['id']);}})['catch'](function(_0x1cf32a){logger[_0x6987('0x51')]('['+_0x2c2880[_0x6987('0x58')][_0x6987('0x59')]()+']',JSON['stringify'](_0x1cf32a));});};
\ No newline at end of file
index 1b4cb82..66eaf30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fb6=['headers','info','Getting\x20admin\x20information','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','then','users','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Admin\x20selected','adminEmail','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','/api/selector/owners'];(function(_0x1f464a,_0x20488e){var _0x3630a0=function(_0x28690a){while(--_0x28690a){_0x1f464a['push'](_0x1f464a['shift']());}};_0x3630a0(++_0x20488e);}(_0x9fb6,0x184));var _0x69fb=function(_0x5d4996,_0x5337ab){_0x5d4996=_0x5d4996-0x0;var _0x4c64ad=_0x9fb6[_0x5d4996];return _0x4c64ad;};'use strict';var _=require('lodash');var rp=require(_0x69fb('0x0'));var md5=require('md5');var util=require(_0x69fb('0x1'));var moment=require('moment');var Promise=require(_0x69fb('0x2'));var Redis=require(_0x69fb('0x3'));var intUtil=require(_0x69fb('0x4'));var config=require(_0x69fb('0x5'));var logger=require(_0x69fb('0x6'))(_0x69fb('0x7'));config[_0x69fb('0x8')]=_[_0x69fb('0x9')](config[_0x69fb('0x8')],{'host':_0x69fb('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x59288d,_0x4a655b,_0x4c569d,_0x172e63){return new Promise(function(_0x2d9a02,_0x417243){var _0x51133c=![];var _0x24fa2a={'method':'GET','uri':_0x172e63+_0x69fb('0xb'),'json':!![]};_0x24fa2a[_0x69fb('0xc')]=_0x4c569d;logger[_0x69fb('0xd')](_0x69fb('0xe'));return rp(_0x24fa2a)['then'](function(_0x2549c8){if(_0x2549c8){var _0x433e34=_0x2549c8['users'];var _0x2a7627=null;for(_0x2a7627=0x0;_0x2a7627<_0x433e34['length'];_0x2a7627++){if(_0x433e34[_0x2a7627][_0x69fb('0xf')]===_0x59288d['adminEmail']){_0x59288d['adminId']=_0x433e34[_0x2a7627]['id'];_0x51133c=!![];}}if(_0x51133c){logger[_0x69fb('0xd')](_0x69fb('0x10'),_0x59288d[_0x69fb('0x11')]);_0x2d9a02(_0x59288d);}else{_0x417243({'statusCode':0x194,'message':_0x69fb('0x12')});}}else{_0x417243({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x69fb('0x13')](function(_0x3a58be){logger['error']('['+[_0x4a655b[_0x69fb('0x14')]()]+']',_0x3a58be[_0x69fb('0x15')]);_0x417243(_0x3a58be);});});}function getUser(_0x1c1c15,_0x46d61f,_0x3f671d){return function(_0xd7d8cc){return new Promise(function(_0x4b0098,_0x31f728){var _0x1b8b6={'method':_0x69fb('0x16'),'uri':_0x3f671d+_0x69fb('0xb'),'json':!![]};_0x1b8b6['headers']=_0x46d61f;logger['info']('Getting\x20user\x20list');return rp(_0x1b8b6)[_0x69fb('0x17')](function(_0x4a3e09){if(_0x4a3e09){var _0x18357f=_0x4a3e09[_0x69fb('0x18')];var _0x5995c0=![];var _0x4155de=null;if(_0xd7d8cc[_0x69fb('0x19')]!==null){logger[_0x69fb('0xd')](_0x69fb('0x1a'),_0xd7d8cc[_0x69fb('0x19')]);_0xd7d8cc['userEmail']=_0xd7d8cc['agentEmail'];for(_0x4155de=0x0;_0x4155de<_0x18357f['length'];_0x4155de++){if(_0x18357f[_0x4155de][_0x69fb('0xf')]===_0xd7d8cc[_0x69fb('0x19')]){_0x5995c0=!![];_0xd7d8cc['userId']=_0x18357f[_0x4155de]['id'];logger[_0x69fb('0xd')](_0x69fb('0x1b'),_0xd7d8cc[_0x69fb('0x1c')]);}}}if(!_0x5995c0){logger['info'](_0x69fb('0x1d'));_0xd7d8cc['userEmail']=_0xd7d8cc[_0x69fb('0x1e')];_0xd7d8cc[_0x69fb('0x1c')]=_0xd7d8cc['adminId'];_0x5995c0=!![];}if(_0x5995c0){_0x4b0098(_0xd7d8cc);}else{_0x31f728({'statusCode':0x194,'message':_0x69fb('0x12')});}}else{_0x31f728({'statusCode':0x194,'message':_0x69fb('0x12')});}})['catch'](function(_0x14cd8e){logger[_0x69fb('0x1f')]('['+[_0x1c1c15['toUpperCase']()]+']',_0x14cd8e[_0x69fb('0x15')]);_0x31f728(_0x14cd8e);});});};}function searchContact(_0x345eba,_0x5acada,_0x26d57e,_0x44e486){return new Promise(function(_0x255b86,_0x541aa1){var _0x59a9e7={'method':_0x69fb('0x16'),'headers':_0x5acada,'uri':_0x345eba+_0x69fb('0x20')+_0x44e486+_0x69fb('0x21')+_0x26d57e+_0x69fb('0x22'),'json':!![]};rp(_0x59a9e7)[_0x69fb('0x17')](function(_0x34dbb1){var _0x4f2a5f=_[_0x69fb('0x23')](_0x34dbb1[_0x69fb('0x24')][_0x69fb('0x24')],[_0x26d57e,_0x44e486]);_0x255b86(_0x4f2a5f);})['catch'](function(_0x51611d){_0x541aa1(_0x51611d);});});}function getEndUser(_0x5cf71,_0x4eda9f,_0x36e639){return function(_0x3ce475){return new Promise(function(_0x3b697e,_0x3a2835){logger[_0x69fb('0xd')](util[_0x69fb('0x25')](_0x69fb('0x26'),_0x3ce475[_0x69fb('0x27')]));searchContact(_0x36e639,_0x4eda9f,_0x69fb('0x28'),_0x3ce475['contactNumber'])[_0x69fb('0x17')](function(_0x212bbb){if(_0x212bbb){_0x3ce475[_0x69fb('0x29')]=_0x212bbb['id'];logger[_0x69fb('0xd')](_0x69fb('0x2a'),_0x3ce475[_0x69fb('0x29')]);return _0x3b697e(_0x3ce475);}searchContact(_0x36e639,_0x4eda9f,_0x69fb('0x2b'),_0x3ce475['contactNumber'])['then'](function(_0x1e33a5){if(_0x1e33a5){_0x3ce475[_0x69fb('0x29')]=_0x1e33a5['id'];logger[_0x69fb('0xd')](_0x69fb('0x2c'),_0x3ce475[_0x69fb('0x29')]);return _0x3b697e(_0x3ce475);}createEndUser(_0x3ce475,_0x5cf71,_0x4eda9f,_0x36e639)[_0x69fb('0x17')](function(_0x20ac33){logger[_0x69fb('0xd')](_0x69fb('0x2d'),_0x20ac33['endUserId']);return _0x3b697e(_0x20ac33);});});})['catch'](function(_0x1d3757){_0x3a2835(_0x1d3757);});});};}function createEndUser(_0x5daaa9,_0x1ea829,_0x4c5aa0,_0x5e8447){return new Promise(function(_0x4ff9f0,_0x1b07fa){var _0x83345=moment();var _0x4fac60={'method':'POST','uri':_0x5e8447+'/api/contacts','body':{'contact':{'last_name':_0x5daaa9['contactNumber'],'work_number':_0x5daaa9[_0x69fb('0x27')],'mobile_number':_0x5daaa9[_0x69fb('0x27')],'owner_id':_0x5daaa9[_0x69fb('0x1c')],'created_at':_0x83345[_0x69fb('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4fac60[_0x69fb('0xc')]=_0x4c5aa0;logger[_0x69fb('0xd')](_0x69fb('0x2e'));return rp(_0x4fac60)[_0x69fb('0x17')](function(_0x2653d2){_0x5daaa9[_0x69fb('0x29')]=_0x2653d2[_0x69fb('0x2f')]['id'];_0x4ff9f0(_0x5daaa9);})['catch'](function(_0x3dd46c){logger[_0x69fb('0x1f')]('['+[_0x1ea829['toUpperCase']()]+']',_0x3dd46c[_0x69fb('0x15')]);_0x1b07fa(_0x3dd46c[_0x69fb('0x15')]);});});}function getTicket(_0x7bfc59,_0x959840,_0x5e158d,_0x132f28,_0x3942ae){return function(_0xffb6bc){logger[_0x69fb('0xd')](_0x69fb('0x30'));return new Promise(function(_0x458316,_0x287fe3){var _0x2844ce=moment();var _0x1df2be={'method':'POST','uri':_0x5e158d+_0x69fb('0x31'),'body':{'title':intUtil['getString'](_0x132f28[_0x69fb('0x32')],_0x3942ae,'\x20'),'description':intUtil['getString'](_0x132f28[_0x69fb('0x33')],_0x3942ae,'\x0a'),'owner_id':_0xffb6bc[_0x69fb('0x1c')],'creater_id':_0xffb6bc[_0x69fb('0x11')],'targetable_id':_0xffb6bc[_0x69fb('0x29')],'targetable_type':_0x69fb('0x34'),'created_at':_0x2844ce[_0x69fb('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2844ce[_0x69fb('0x35')](0x1e,'m')[_0x69fb('0x25')](_0x69fb('0x36'))},'json':!![]};_0x1df2be[_0x69fb('0xc')]=_0x959840;return rp(_0x1df2be)['then'](function(_0x53f2bf){_0xffb6bc[_0x69fb('0x37')]=_0x53f2bf['task']['id'];logger['info'](_0x69fb('0x38'),_0xffb6bc[_0x69fb('0x37')]);_0x458316(_0xffb6bc);})['catch'](function(_0x4dab57){logger[_0x69fb('0x1f')]('['+[_0x7bfc59[_0x69fb('0x14')]()]+']',_0x4dab57[_0x69fb('0x15')]);_0x287fe3(_0x4dab57['message']);});});};}function emit(_0x501b45,_0xe6b7ea,_0x4d89bb){var _0x57f8c4={'uri':_0x501b45+_0x69fb('0x39')+_0x4d89bb};io['to'](util['format'](_0x69fb('0x3a'),_0xe6b7ea))['emit'](_0x69fb('0x3b'),_0x57f8c4);}exports['cs']=function(_0x29ab4e,_0x3d5675,_0x56c37d,_0x13127e,_0x4f5fb4,_0x1f13a9,_0x5bcbcd,_0x448b70){var _0x12e537={};var _0x2b15c8={'Authorization':_0x69fb('0x3c')+_0x1f13a9['apiKey']};_0x1f13a9[_0x69fb('0x3d')]=intUtil[_0x69fb('0x3e')](_0x1f13a9[_0x69fb('0x3d')]);_0x1f13a9[_0x69fb('0x3f')]=intUtil[_0x69fb('0x3e')](_0x1f13a9['serverUrl']);var _0x4570af=_0x1f13a9[_0x69fb('0x3d')];_0x12e537[_0x69fb('0x1e')]=_0x1f13a9['username'];_0x12e537[_0x69fb('0x27')]=_0x448b70[_0x69fb('0x40')]()===_0x69fb('0x41')?_0x3d5675['destcalleridnum']:_0x3d5675['calleridnum'];_0x12e537['callDirection']=_0x448b70===_0x69fb('0x42')||_0x448b70===_0x69fb('0x43')?_0x69fb('0x42'):_0x69fb('0x41');if(_0x13127e){_0x12e537[_0x69fb('0x19')]=_0x13127e['email'];}var _0x199e0c=util[_0x69fb('0x25')](_0x69fb('0x44'),_0x1f13a9[_0x69fb('0x3f')],_0x3d5675[_0x69fb('0x45')],md5(_0x3d5675['uniqueid']));if(_0x4f5fb4&&_0x4f5fb4[_0x69fb('0x46')]){logger[_0x69fb('0xd')](_0x69fb('0x47'),_0x69fb('0x48'));_0x3d5675[_0x69fb('0x49')]=_0x199e0c;}else if(_0x5bcbcd&&_0x5bcbcd['recordingFormat']&&_0x5bcbcd[_0x69fb('0x4a')]!=='none'){logger[_0x69fb('0xd')](_0x69fb('0x4b'),_0x69fb('0x48'));_0x3d5675[_0x69fb('0x49')]=_0x199e0c;}else{_0x3d5675[_0x69fb('0x49')]='';}return getAdminId(_0x12e537,_0x448b70,_0x2b15c8,_0x4570af)[_0x69fb('0x17')](getUser(_0x448b70,_0x2b15c8,_0x4570af))[_0x69fb('0x17')](getEndUser(_0x448b70,_0x2b15c8,_0x4570af))[_0x69fb('0x17')](getTicket(_0x448b70,_0x2b15c8,_0x4570af,_0x56c37d,_0x3d5675))[_0x69fb('0x17')](function(_0x5bac16){logger[_0x69fb('0xd')](util[_0x69fb('0x25')](_0x69fb('0x4c'),_0x5bac16[_0x69fb('0x37')]));if(_0x448b70!==_0x69fb('0x43')){logger[_0x69fb('0xd')]('['+[_0x448b70[_0x69fb('0x14')]()]+']',_0x69fb('0x4d'));emit(_0x4570af,_0x13127e[_0x69fb('0x4e')],_0x5bac16[_0x69fb('0x29')]);}})[_0x69fb('0x13')](function(_0x18b45a){logger['error']('['+[_0x448b70[_0x69fb('0x14')]()]+_0x69fb('0x4f'),util['inspect'](_0x18b45a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2fa7=['email','userId','Admin\x20selected','catch','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','headers','then','users','length','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail'];(function(_0x4abf33,_0x4c42fa){var _0x58eccf=function(_0x33a93c){while(--_0x33a93c){_0x4abf33['push'](_0x4abf33['shift']());}};_0x58eccf(++_0x4c42fa);}(_0x2fa7,0x17a));var _0x72fa=function(_0x5805e5,_0x980477){_0x5805e5=_0x5805e5-0x0;var _0x8a6b05=_0x2fa7[_0x5805e5];return _0x8a6b05;};'use strict';var _=require(_0x72fa('0x0'));var rp=require(_0x72fa('0x1'));var md5=require(_0x72fa('0x2'));var util=require(_0x72fa('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x72fa('0x4'));var config=require(_0x72fa('0x5'));var logger=require(_0x72fa('0x6'))(_0x72fa('0x7'));config['redis']=_['defaults'](config[_0x72fa('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x72fa('0x9'))(new Redis(config[_0x72fa('0x8')]));function getAdminId(_0x583c6b,_0x5d7c5f,_0x4729de,_0x36747e){return new Promise(function(_0x5efc64,_0x250876){var _0xf0bf3=![];var _0x1c4aa9={'method':_0x72fa('0xa'),'uri':_0x36747e+'/api/selector/owners','json':!![]};_0x1c4aa9[_0x72fa('0xb')]=_0x4729de;logger['info']('Getting\x20admin\x20information');return rp(_0x1c4aa9)[_0x72fa('0xc')](function(_0x4fb540){if(_0x4fb540){var _0x1ab49b=_0x4fb540[_0x72fa('0xd')];var _0x39543d=null;for(_0x39543d=0x0;_0x39543d<_0x1ab49b[_0x72fa('0xe')];_0x39543d++){if(_0x1ab49b[_0x39543d]['email']===_0x583c6b[_0x72fa('0xf')]){_0x583c6b[_0x72fa('0x10')]=_0x1ab49b[_0x39543d]['id'];_0xf0bf3=!![];}}if(_0xf0bf3){logger[_0x72fa('0x11')](_0x72fa('0x12'),_0x583c6b[_0x72fa('0x10')]);_0x5efc64(_0x583c6b);}else{_0x250876({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x250876({'statusCode':0x194,'message':_0x72fa('0x13')});}})['catch'](function(_0x2ce20b){logger['error']('['+[_0x5d7c5f[_0x72fa('0x14')]()]+']',_0x2ce20b[_0x72fa('0x15')]);_0x250876(_0x2ce20b);});});}function getUser(_0x45b00a,_0x38ce20,_0x2662e2){return function(_0x1561d4){return new Promise(function(_0x473a0c,_0xa6e004){var _0x29a318={'method':_0x72fa('0xa'),'uri':_0x2662e2+_0x72fa('0x16'),'json':!![]};_0x29a318[_0x72fa('0xb')]=_0x38ce20;logger[_0x72fa('0x11')](_0x72fa('0x17'));return rp(_0x29a318)[_0x72fa('0xc')](function(_0xa3473f){if(_0xa3473f){var _0x21eab0=_0xa3473f[_0x72fa('0xd')];var _0x483bf9=![];var _0xe4f8f2=null;if(_0x1561d4[_0x72fa('0x18')]!==null){logger['info'](_0x72fa('0x19'),_0x1561d4[_0x72fa('0x18')]);_0x1561d4[_0x72fa('0x1a')]=_0x1561d4[_0x72fa('0x18')];for(_0xe4f8f2=0x0;_0xe4f8f2<_0x21eab0[_0x72fa('0xe')];_0xe4f8f2++){if(_0x21eab0[_0xe4f8f2][_0x72fa('0x1b')]===_0x1561d4['agentEmail']){_0x483bf9=!![];_0x1561d4[_0x72fa('0x1c')]=_0x21eab0[_0xe4f8f2]['id'];logger[_0x72fa('0x11')]('User\x20found:',_0x1561d4['userId']);}}}if(!_0x483bf9){logger[_0x72fa('0x11')](_0x72fa('0x1d'));_0x1561d4['userEmail']=_0x1561d4['adminEmail'];_0x1561d4[_0x72fa('0x1c')]=_0x1561d4[_0x72fa('0x10')];_0x483bf9=!![];}if(_0x483bf9){_0x473a0c(_0x1561d4);}else{_0xa6e004({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xa6e004({'statusCode':0x194,'message':_0x72fa('0x13')});}})[_0x72fa('0x1e')](function(_0x2685be){logger[_0x72fa('0x1f')]('['+[_0x45b00a[_0x72fa('0x14')]()]+']',_0x2685be[_0x72fa('0x15')]);_0xa6e004(_0x2685be);});});};}function searchContact(_0x343dad,_0x4428c2,_0x1960f4,_0x41c803){return new Promise(function(_0x3aa4e1,_0x24236f){var _0x1244f0={'method':'GET','headers':_0x4428c2,'uri':_0x343dad+_0x72fa('0x20')+_0x41c803+_0x72fa('0x21')+_0x1960f4+_0x72fa('0x22'),'json':!![]};rp(_0x1244f0)[_0x72fa('0xc')](function(_0x1d059f){var _0x3fc9ea=_[_0x72fa('0x23')](_0x1d059f['contacts'][_0x72fa('0x24')],[_0x1960f4,_0x41c803]);_0x3aa4e1(_0x3fc9ea);})[_0x72fa('0x1e')](function(_0x9f5206){_0x24236f(_0x9f5206);});});}function getEndUser(_0x39318e,_0x1f454c,_0x35dd14){return function(_0x8d53e8){return new Promise(function(_0x8c1750,_0x22f599){logger[_0x72fa('0x11')](util[_0x72fa('0x25')](_0x72fa('0x26'),_0x8d53e8[_0x72fa('0x27')]));searchContact(_0x35dd14,_0x1f454c,_0x72fa('0x28'),_0x8d53e8['contactNumber'])[_0x72fa('0xc')](function(_0x124175){if(_0x124175){_0x8d53e8[_0x72fa('0x29')]=_0x124175['id'];logger[_0x72fa('0x11')](_0x72fa('0x2a'),_0x8d53e8[_0x72fa('0x29')]);return _0x8c1750(_0x8d53e8);}searchContact(_0x35dd14,_0x1f454c,'work_number',_0x8d53e8[_0x72fa('0x27')])[_0x72fa('0xc')](function(_0x75dab2){if(_0x75dab2){_0x8d53e8[_0x72fa('0x29')]=_0x75dab2['id'];logger[_0x72fa('0x11')]('Contact\x20found\x20work_number:',_0x8d53e8[_0x72fa('0x29')]);return _0x8c1750(_0x8d53e8);}createEndUser(_0x8d53e8,_0x39318e,_0x1f454c,_0x35dd14)[_0x72fa('0xc')](function(_0x2b8530){logger[_0x72fa('0x11')](_0x72fa('0x2b'),_0x2b8530[_0x72fa('0x29')]);return _0x8c1750(_0x2b8530);});});})['catch'](function(_0x229818){_0x22f599(_0x229818);});});};}function createEndUser(_0x3e30fe,_0x29b994,_0x4b5268,_0x4b80a5){return new Promise(function(_0x3596d4,_0x27e055){var _0x1f62c4=moment();var _0x1f4857={'method':'POST','uri':_0x4b80a5+_0x72fa('0x2c'),'body':{'contact':{'last_name':_0x3e30fe[_0x72fa('0x27')],'work_number':_0x3e30fe['contactNumber'],'mobile_number':_0x3e30fe['contactNumber'],'owner_id':_0x3e30fe['userId'],'created_at':_0x1f62c4[_0x72fa('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x1f4857[_0x72fa('0xb')]=_0x4b5268;logger[_0x72fa('0x11')](_0x72fa('0x2d'));return rp(_0x1f4857)[_0x72fa('0xc')](function(_0x3b89b3){_0x3e30fe[_0x72fa('0x29')]=_0x3b89b3[_0x72fa('0x2e')]['id'];_0x3596d4(_0x3e30fe);})[_0x72fa('0x1e')](function(_0x2ef86e){logger[_0x72fa('0x1f')]('['+[_0x29b994[_0x72fa('0x14')]()]+']',_0x2ef86e['message']);_0x27e055(_0x2ef86e[_0x72fa('0x15')]);});});}function getTicket(_0x562d13,_0x16e56d,_0x366111,_0x2c3f1f,_0x3e1914){return function(_0x58a989){logger[_0x72fa('0x11')]('Creating\x20new\x20task');return new Promise(function(_0x34e308,_0x2b9fb8){var _0x4d0f55=moment();var _0x48678e={'method':_0x72fa('0x2f'),'uri':_0x366111+_0x72fa('0x30'),'body':{'title':intUtil[_0x72fa('0x31')](_0x2c3f1f[_0x72fa('0x32')],_0x3e1914,'\x20'),'description':intUtil[_0x72fa('0x31')](_0x2c3f1f[_0x72fa('0x33')],_0x3e1914,'\x0a'),'owner_id':_0x58a989[_0x72fa('0x1c')],'creater_id':_0x58a989[_0x72fa('0x10')],'targetable_id':_0x58a989[_0x72fa('0x29')],'targetable_type':_0x72fa('0x34'),'created_at':_0x4d0f55[_0x72fa('0x25')](_0x72fa('0x35')),'due_date':_0x4d0f55[_0x72fa('0x36')](0x1e,'m')[_0x72fa('0x25')](_0x72fa('0x35'))},'json':!![]};_0x48678e[_0x72fa('0xb')]=_0x16e56d;return rp(_0x48678e)['then'](function(_0x138597){_0x58a989['ticketId']=_0x138597[_0x72fa('0x37')]['id'];logger[_0x72fa('0x11')](_0x72fa('0x38'),_0x58a989[_0x72fa('0x39')]);_0x34e308(_0x58a989);})[_0x72fa('0x1e')](function(_0x3c0a6e){logger[_0x72fa('0x1f')]('['+[_0x562d13[_0x72fa('0x14')]()]+']',_0x3c0a6e[_0x72fa('0x15')]);_0x2b9fb8(_0x3c0a6e[_0x72fa('0x15')]);});});};}function emit(_0x2be9f7,_0x468f72,_0x517a95){var _0x13d21f={'uri':_0x2be9f7+_0x72fa('0x3a')+_0x517a95};io['to'](util['format'](_0x72fa('0x3b'),_0x468f72))[_0x72fa('0x3c')](_0x72fa('0x3d'),_0x13d21f);}exports['cs']=function(_0x27f852,_0x3cc903,_0x3e0e30,_0x5378a5,_0x3a0928,_0x2402a8,_0x339c99,_0x55dcd4){var _0x339453={};var _0x5cd6aa={'Authorization':_0x72fa('0x3e')+_0x2402a8[_0x72fa('0x3f')]};_0x2402a8['remoteUri']=intUtil['stripTrailingSlash'](_0x2402a8['remoteUri']);_0x2402a8[_0x72fa('0x40')]=intUtil[_0x72fa('0x41')](_0x2402a8[_0x72fa('0x40')]);var _0x4da916=_0x2402a8['remoteUri'];_0x339453[_0x72fa('0xf')]=_0x2402a8[_0x72fa('0x42')];_0x339453[_0x72fa('0x27')]=_0x55dcd4[_0x72fa('0x43')]()===_0x72fa('0x44')?_0x3cc903[_0x72fa('0x45')]:_0x3cc903[_0x72fa('0x46')];_0x339453[_0x72fa('0x47')]=_0x55dcd4==='queue'||_0x55dcd4===_0x72fa('0x48')?_0x72fa('0x49'):'outbound';if(_0x5378a5){_0x339453[_0x72fa('0x18')]=_0x5378a5[_0x72fa('0x1b')];}var _0x397a2f=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2402a8[_0x72fa('0x40')],_0x3cc903[_0x72fa('0x4a')],md5(_0x3cc903[_0x72fa('0x4a')]));if(_0x3a0928&&_0x3a0928[_0x72fa('0x4b')]){logger['info']('[QUEUE]',_0x72fa('0x4c'));_0x3cc903[_0x72fa('0x4d')]=_0x397a2f;}else if(_0x339c99&&_0x339c99['recordingFormat']&&_0x339c99['recordingFormat']!=='none'){logger[_0x72fa('0x11')](_0x72fa('0x4e'),'Recording\x20is\x20enabled!');_0x3cc903[_0x72fa('0x4d')]=_0x397a2f;}else{_0x3cc903['recordingURL']='';}return getAdminId(_0x339453,_0x55dcd4,_0x5cd6aa,_0x4da916)[_0x72fa('0xc')](getUser(_0x55dcd4,_0x5cd6aa,_0x4da916))[_0x72fa('0xc')](getEndUser(_0x55dcd4,_0x5cd6aa,_0x4da916))[_0x72fa('0xc')](getTicket(_0x55dcd4,_0x5cd6aa,_0x4da916,_0x3e0e30,_0x3cc903))[_0x72fa('0xc')](function(_0x14dfd0){logger['info'](util[_0x72fa('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x14dfd0[_0x72fa('0x39')]));if(_0x55dcd4!==_0x72fa('0x48')){logger[_0x72fa('0x11')]('['+[_0x55dcd4[_0x72fa('0x14')]()]+']',_0x72fa('0x4f'));emit(_0x4da916,_0x5378a5['name'],_0x14dfd0[_0x72fa('0x29')]);}})['catch'](function(_0x1f3029){logger['error']('['+[_0x55dcd4['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x72fa('0x50')](_0x1f3029,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index e479a89..64476e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a7d=['zoho','desk','vtiger','dynamics365','freshsales','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk'];(function(_0xc2842b,_0x4ebdb2){var _0x19cd2f=function(_0x3f3575){while(--_0x3f3575){_0xc2842b['push'](_0xc2842b['shift']());}};_0x19cd2f(++_0x4ebdb2);}(_0x8a7d,0x159));var _0xd8a7=function(_0x52eb7f,_0x54520d){_0x52eb7f=_0x52eb7f-0x0;var _0x438998=_0x8a7d[_0x52eb7f];return _0x438998;};'use strict';var _=require(_0xd8a7('0x0'));var util=require(_0xd8a7('0x1'));var zendesk=require(_0xd8a7('0x2'));var salesforce=require(_0xd8a7('0x3'));var sugarcrm=require(_0xd8a7('0x4'));var freshdesk=require(_0xd8a7('0x5'));var zoho=require(_0xd8a7('0x6'));var desk=require(_0xd8a7('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0xd8a7('0x8'));var dynamics365=require(_0xd8a7('0x9'));var freshsales=require(_0xd8a7('0xa'));var integrations=[_0xd8a7('0xb'),_0xd8a7('0xc'),_0xd8a7('0xd'),_0xd8a7('0xe'),_0xd8a7('0xf'),_0xd8a7('0x10'),_0xd8a7('0x11'),_0xd8a7('0x12'),_0xd8a7('0x13'),'servicenow'];exports[_0xd8a7('0x14')]=function(_0x39b58b,_0x491861,_0x21aee3,_0x2b1c6e,_0x569ecb,_0xa986af){if(_0x21aee3){if(_['includes'](integrations,_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')]())){try{var _0x477373=null;var _0x1e4e07='';var _0x405613=_0x21aee3[_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')]()];if(_0x405613){var _0x3a7b6a=_0x405613[_0x39b58b[_0xd8a7('0x17')]];if(_0x3a7b6a){var _0x32c533=_[_0xd8a7('0x18')](_0x3a7b6a[_0xd8a7('0x19')],{'id':parseInt(_0x39b58b[_0xd8a7('0x1a')],0xa)});if(_0x32c533){if(_0x2b1c6e){if(_0x569ecb&&_0x491861[_0xd8a7('0x1b')]){_0x1e4e07=_0xd8a7('0x1b');}else if(_0x491861[_0xd8a7('0x1c')]){_0x1e4e07='outbound';}else{console[_0xd8a7('0x1d')](_0xd8a7('0x1e'),_0x491861);}}else{_0x1e4e07=_0xd8a7('0x1f');}switch(_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')]()){case _0xd8a7('0xb'):zendesk[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case _0xd8a7('0xc'):salesforce[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case'sugarcrm':sugarcrm[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case _0xd8a7('0xe'):freshdesk[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case'zoho':zoho[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case _0xd8a7('0x10'):desk[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case _0xd8a7('0x11'):vtiger[_0x1e4e07](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af);break;case _0xd8a7('0x13'):freshsales['cs'](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af,_0x1e4e07);break;case _0xd8a7('0x20'):servicenow['cs'](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af,_0x1e4e07);break;case'dynamics365':dynamics365['cs'](_0x39b58b,_0x491861,_0x32c533,_0x2b1c6e,_0x569ecb,_0x3a7b6a,_0xa986af,_0x1e4e07);break;default:console[_0xd8a7('0x1d')](_0xd8a7('0x21'));}}else{_0x477373=require(_0xd8a7('0x22'))(_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')]());_0x477373[_0xd8a7('0x23')](_0xd8a7('0x24'),util['format'](_0xd8a7('0x25'),_0x39b58b[_0xd8a7('0x15')]['toLowerCase'](),_0x39b58b['data3']));}}else{_0x477373=require('../../../../config/logger')(_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')]());_0x477373[_0xd8a7('0x23')](_0xd8a7('0x24'),util[_0xd8a7('0x26')](_0xd8a7('0x27'),_0x39b58b[_0xd8a7('0x15')][_0xd8a7('0x16')](),_0x39b58b[_0xd8a7('0x17')]));}}else{}}catch(_0x1fc007){console[_0xd8a7('0x23')](_0x1fc007);}}}};
\ No newline at end of file
+var _0x9721=['lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./freshsales','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','freshdesk','unknown\x20integration','../../../../config/logger','data1','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]'];(function(_0x56b4fd,_0x540412){var _0x4733c7=function(_0x3e0782){while(--_0x3e0782){_0x56b4fd['push'](_0x56b4fd['shift']());}};_0x4733c7(++_0x540412);}(_0x9721,0x9c));var _0x1972=function(_0x5b46df,_0x21ce32){_0x5b46df=_0x5b46df-0x0;var _0x157311=_0x9721[_0x5b46df];return _0x157311;};'use strict';var _=require(_0x1972('0x0'));var util=require(_0x1972('0x1'));var zendesk=require(_0x1972('0x2'));var salesforce=require(_0x1972('0x3'));var sugarcrm=require(_0x1972('0x4'));var freshdesk=require(_0x1972('0x5'));var zoho=require(_0x1972('0x6'));var desk=require(_0x1972('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x1972('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x1972('0x9'));var integrations=['zendesk','salesforce',_0x1972('0xa'),'freshdesk',_0x1972('0xb'),_0x1972('0xc'),_0x1972('0xd'),_0x1972('0xe'),_0x1972('0xf'),_0x1972('0x10')];exports[_0x1972('0x11')]=function(_0x5b9adf,_0x549ac8,_0x4e2973,_0xb1d778,_0x75b114,_0xf0852b){if(_0x4e2973){if(_[_0x1972('0x12')](integrations,_0x5b9adf['data1'][_0x1972('0x13')]())){try{var _0x10c64c=null;var _0x4b7712='';var _0x3c4700=_0x4e2973[_0x5b9adf['data1'][_0x1972('0x13')]()];if(_0x3c4700){var _0x349509=_0x3c4700[_0x5b9adf[_0x1972('0x14')]];if(_0x349509){var _0x1c77ea=_[_0x1972('0x15')](_0x349509[_0x1972('0x16')],{'id':parseInt(_0x5b9adf['data3'],0xa)});if(_0x1c77ea){if(_0xb1d778){if(_0x75b114&&_0x549ac8['queue']){_0x4b7712=_0x1972('0x17');}else if(_0x549ac8[_0x1972('0x18')]){_0x4b7712=_0x1972('0x19');}else{console[_0x1972('0x1a')](_0x1972('0x1b'),_0x549ac8);}}else{_0x4b7712=_0x1972('0x1c');}switch(_0x5b9adf['data1'][_0x1972('0x13')]()){case _0x1972('0x1d'):zendesk[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case'salesforce':salesforce[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case _0x1972('0xa'):sugarcrm[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case _0x1972('0x1e'):freshdesk[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case'zoho':zoho[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case _0x1972('0xc'):desk[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case'vtiger':vtiger[_0x4b7712](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b);break;case _0x1972('0xf'):freshsales['cs'](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b,_0x4b7712);break;case _0x1972('0x10'):servicenow['cs'](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b,_0x4b7712);break;case _0x1972('0xe'):dynamics365['cs'](_0x5b9adf,_0x549ac8,_0x1c77ea,_0xb1d778,_0x75b114,_0x349509,_0xf0852b,_0x4b7712);break;default:console[_0x1972('0x1a')](_0x1972('0x1f'));}}else{_0x10c64c=require(_0x1972('0x20'))(_0x5b9adf[_0x1972('0x21')][_0x1972('0x13')]());_0x10c64c[_0x1972('0x22')]('[EXEC]',util[_0x1972('0x23')](_0x1972('0x24'),_0x5b9adf[_0x1972('0x21')][_0x1972('0x13')](),_0x5b9adf[_0x1972('0x25')]));}}else{_0x10c64c=require(_0x1972('0x20'))(_0x5b9adf[_0x1972('0x21')][_0x1972('0x13')]());_0x10c64c['error'](_0x1972('0x26'),util[_0x1972('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x5b9adf[_0x1972('0x21')][_0x1972('0x13')](),_0x5b9adf[_0x1972('0x14')]));}}else{}}catch(_0xd714c2){console[_0x1972('0x22')](_0xd714c2);}}}};
\ No newline at end of file
index ba93b5a..7e2009d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0696=[']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','Email','info','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.','moduleSearch','additionalSearchContact','merge','length','cloneDeep','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','[OUTBOUND]','unmanaged','toUpperCase','calleridname','lastevent'];(function(_0x19f33,_0x11fbc1){var _0x2508be=function(_0x38f804){while(--_0x38f804){_0x19f33['push'](_0x19f33['shift']());}};_0x2508be(++_0x11fbc1);}(_0x0696,0xfe));var _0x6069=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x0696[_0x459423];return _0x42ed14;};'use strict';var _=require('lodash');var rp=require(_0x6069('0x0'));var moment=require(_0x6069('0x1'));var BPromise=require('bluebird');var md5=require(_0x6069('0x2'));var jsforce=require(_0x6069('0x3'));var util=require('util');var Redis=require(_0x6069('0x4'));var intUtil=require(_0x6069('0x5'));var config=require(_0x6069('0x6'));var logger=require('../../../../config/logger')(_0x6069('0x7'));config[_0x6069('0x8')]=_[_0x6069('0x9')](config['redis'],{'host':_0x6069('0xa'),'port':0x18eb});var io=require(_0x6069('0xb'))(new Redis(config[_0x6069('0x8')]));function emit(_0x103c85,_0x8e9369,_0x3f9ab1){io['to'](_0x103c85)[_0x6069('0xc')](_0x8e9369,_0x3f9ab1);}function getTicket(_0x4950fb,_0x11b027,_0x960118,_0x179164,_0x4be852,_0x1be227,_0x5060a2,_0x2cd1db){var _0x5822d5=Object[_0x6069('0xd')]({},{'OwnerId':_0x11b027['id'],'Subject':intUtil[_0x6069('0xe')](_0x179164[_0x6069('0xf')],_0x4be852,'\x20'),'Description':intUtil[_0x6069('0xe')](_0x179164[_0x6069('0x10')],_0x4be852,'\x0a')},getCustomFields(_0x1be227,_0x4be852));if(_0x960118){if(_0x179164[_0x6069('0x11')]==='Task'){_0x5822d5[_0x6069('0x12')]=moment[_0x6069('0x13')]();_0x5822d5[_0x6069('0x14')]=![];_0x5822d5[_0x6069('0x15')]=![];if(_0x960118[_0x6069('0x16')]===_0x6069('0x17')||_0x960118[_0x6069('0x16')]===_0x6069('0x18')){_0x5822d5[_0x6069('0x19')]=_0x960118['id'];}else if(_0x960118[_0x6069('0x16')]===_0x6069('0x1a')){_0x5822d5[_0x6069('0x1b')]=_0x960118['id'];}}else if(_0x179164[_0x6069('0x11')]==='Case'){if(_0x960118[_0x6069('0x16')]===_0x6069('0x17')){_0x5822d5['ContactId']=_0x960118['id'];}else if(_0x960118[_0x6069('0x16')]==='account'){_0x5822d5[_0x6069('0x1c')]=_0x960118['id'];}else if(_0x960118[_0x6069('0x16')]===_0x6069('0x18')&&_0x179164[_0x6069('0x1d')]){_0x5822d5[_0x179164[_0x6069('0x1d')]]=_0x960118['id'];}else{logger['info'](_0x6069('0x1e'));}}}return _0x5060a2['sobject'](_0x179164[_0x6069('0x11')])[_0x6069('0x1f')](_0x5822d5);}function getUser(_0x3533b8,_0x194dec,_0x32eee0){if(!_['isNil'](_0x194dec)&&intUtil[_0x6069('0x20')](_0x194dec)){var _0x4df5d2={'Email':_0x194dec};var _0x10cdf5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x32eee0[_0x6069('0x21')](_0x6069('0x22'))[_0x6069('0x23')](_0x4df5d2,_0x10cdf5)[_0x6069('0x24')]()[_0x6069('0x25')](function(_0x52cb85){if(_0x52cb85['length']){var _0x46c40f=_[_0x6069('0x23')](_0x52cb85,function(_0x30fc9e){return _0x30fc9e[_0x6069('0x26')]===_0x194dec;});if(_0x46c40f){logger[_0x6069('0x27')](_0x6069('0x28'),_0x194dec);return BPromise[_0x6069('0x29')]({'id':_0x46c40f['Id'],'name':_0x46c40f[_0x6069('0x2a')]});}}else{logger[_0x6069('0x27')](_0x6069('0x2b'),_0x194dec);return _0x32eee0[_0x6069('0x2c')]()[_0x6069('0x25')](function(_0x2ab06f){return BPromise['resolve']({'id':_0x2ab06f[_0x6069('0x2d')],'name':_0x2ab06f[_0x6069('0x2e')]});});}});}else{logger[_0x6069('0x27')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x194dec);return _0x32eee0[_0x6069('0x2c')]()[_0x6069('0x25')](function(_0x57f547){return BPromise[_0x6069('0x29')]({'id':_0x57f547['user_id'],'name':_0x57f547[_0x6069('0x2e')]});});}}function getEndUser(_0x2f83be,_0x4ab001,_0x3f18b8,_0x66465a,_0x120a72){var _0x4a8b92={'$or':{'Phone':_0x66465a}};var _0x4e71f4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6069('0x29')]()[_0x6069('0x25')](function(){logger[_0x6069('0x27')](_0x6069('0x2f'),_0x66465a,_0x4ab001['moduleSearch']);switch(_0x4ab001[_0x6069('0x30')]){case'contact_lead':var _0x443185=_['cloneDeep'](_0x4a8b92);if(_0x4ab001[_0x6069('0x31')]){var _0xc03c95={};_0xc03c95[_0x4ab001['additionalSearchContact']]=_0x66465a;_[_0x6069('0x32')](_0x443185['$or'],_0xc03c95);}return _0x120a72['sobject']('Contact')['find'](_0x443185,_0x4e71f4)[_0x6069('0x24')]()['then'](function(_0x18f20f){if(_0x18f20f&&_0x18f20f[_0x6069('0x33')]){return _0x18f20f;}else{var _0x30d12a=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001[_0x6069('0x35')]){var _0x5b329c={};_0x5b329c[_0x4ab001[_0x6069('0x35')]]=_0x66465a;_['merge'](_0x30d12a[_0x6069('0x36')],_0x5b329c);}return _0x120a72[_0x6069('0x21')](_0x6069('0x37'))[_0x6069('0x23')](_0x30d12a,_0x4e71f4);}});case _0x6069('0x38'):var _0x4569f9=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001[_0x6069('0x39')]){var _0xc03c95={};_0xc03c95[_0x4ab001[_0x6069('0x39')]]=_0x66465a;_[_0x6069('0x32')](_0x4569f9[_0x6069('0x36')],_0xc03c95);}return _0x120a72[_0x6069('0x21')](_0x6069('0x3a'))[_0x6069('0x23')](_0x4569f9,_0x4e71f4)[_0x6069('0x24')]()[_0x6069('0x25')](function(_0x1e8f5b){if(_0x1e8f5b&&_0x1e8f5b['length']){return _0x1e8f5b;}else{var _0x5ec554=_['cloneDeep'](_0x4a8b92);if(_0x4ab001[_0x6069('0x31')]){var _0xf3d3cc={};_0xf3d3cc[_0x4ab001[_0x6069('0x31')]]=_0x66465a;_[_0x6069('0x32')](_0x5ec554[_0x6069('0x36')],_0xf3d3cc);}return _0x120a72['sobject']('Contact')['find'](_0x5ec554,_0x4e71f4)[_0x6069('0x25')](function(_0x27e692){if(_0x27e692&&_0x27e692[_0x6069('0x33')]){return _0x27e692;}else{var _0x98d220=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001[_0x6069('0x35')]){var _0x111b85={};_0x111b85[_0x4ab001['additionalSearchLead']]=_0x66465a;_['merge'](_0x98d220[_0x6069('0x36')],_0x111b85);}return _0x120a72[_0x6069('0x21')]('Lead')['find'](_0x98d220,_0x4e71f4);}});}});case _0x6069('0x17'):var _0x443185=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001['additionalSearchContact']){var _0xc03c95={};_0xc03c95[_0x4ab001[_0x6069('0x31')]]=_0x66465a;_[_0x6069('0x32')](_0x443185['$or'],_0xc03c95);}return _0x120a72['sobject'](_0x6069('0x3b'))['find'](_0x443185,_0x4e71f4)[_0x6069('0x24')]();case _0x6069('0x18'):var _0x506b72=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001[_0x6069('0x35')]){var _0xc03c95={};_0xc03c95[_0x4ab001[_0x6069('0x35')]]=_0x66465a;_[_0x6069('0x32')](_0x506b72[_0x6069('0x36')],_0xc03c95);}return _0x120a72['sobject']('Lead')[_0x6069('0x23')](_0x506b72,_0x4e71f4);case _0x6069('0x1a'):var _0x4569f9=_[_0x6069('0x34')](_0x4a8b92);if(_0x4ab001[_0x6069('0x39')]){var _0xc03c95={};_0xc03c95[_0x4ab001['additionalSearchAccount']]=_0x66465a;_[_0x6069('0x32')](_0x4569f9['$or'],_0xc03c95);}return _0x120a72[_0x6069('0x21')](_0x6069('0x3a'))[_0x6069('0x23')](_0x4569f9,_0x4e71f4);default:return null;}})[_0x6069('0x25')](function(_0x8042c1){if(_0x8042c1&&_0x8042c1['length']){var _0x5e1497=_[_0x6069('0x3c')](_0x8042c1);if(_0x5e1497){return BPromise[_0x6069('0x29')]({'id':_0x5e1497['Id'],'name':_0x5e1497[_0x6069('0x2a')],'phone':_0x5e1497['Phone'],'endUserType':_0x5e1497[_0x6069('0x3d')][_0x6069('0x3e')][_0x6069('0x3f')]()});}}})[_0x6069('0x25')](function(_0x219621){if(_0x219621){logger[_0x6069('0x27')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x219621['endUserType'],_0x66465a);return BPromise[_0x6069('0x29')](_0x219621);}else{logger[_0x6069('0x27')](_0x6069('0x40'),_0x66465a);var _0x51d07a={'Phone':_0x66465a};if(_0x4ab001['moduleCreate']){if(_0x4ab001[_0x6069('0x41')]===_0x6069('0x17')){logger['info'](_0x6069('0x42'),_0x66465a,_0x4ab001[_0x6069('0x41')]);_0x51d07a[_0x6069('0x43')]=_0x3f18b8!==_0x6069('0x44')?_0x3f18b8:util['format'](_0x6069('0x45'),_0x66465a);}else if(_0x4ab001[_0x6069('0x41')]===_0x6069('0x18')){logger[_0x6069('0x27')](_0x6069('0x42'),_0x66465a,_0x4ab001[_0x6069('0x41')]);_0x51d07a['LastName']=_0x3f18b8!==_0x6069('0x44')?_0x3f18b8:util[_0x6069('0x46')](_0x6069('0x45'),_0x66465a);_0x51d07a[_0x6069('0x47')]=_0x6069('0x48');}else if(_0x4ab001[_0x6069('0x41')]==='account'){logger[_0x6069('0x27')](_0x6069('0x42'),_0x66465a,_0x4ab001[_0x6069('0x41')]);_0x51d07a[_0x6069('0x2a')]=_0x3f18b8!==_0x6069('0x44')?_0x3f18b8:util[_0x6069('0x46')]('Caller\x20-\x20%s',_0x66465a);}else{return null;}}return _0x120a72[_0x6069('0x21')](_[_0x6069('0x49')](_0x4ab001[_0x6069('0x41')]))[_0x6069('0x1f')](_0x51d07a)[_0x6069('0x25')](function(_0x48c3cf){return BPromise[_0x6069('0x29')]({'id':_0x48c3cf['id'],'endUserType':_0x4ab001['moduleCreate']});});}});}function getCustomFields(_0x2b5a3c,_0x210b1e){var _0x5debd1={};if(_0x2b5a3c[_0x6069('0x33')]>0x0){_[_0x6069('0x4a')](_0x2b5a3c,function(_0x224c67){if(_[_0x6069('0x4b')]([_0x6069('0x4c'),_0x6069('0x4d')],_0x224c67[_0x6069('0x3e')])&&_0x224c67[_0x6069('0x4e')]){_0x5debd1[_0x224c67[_0x6069('0x4e')]]=_0x224c67[_0x6069('0x4f')]['toString']();}else if(_0x224c67[_0x6069('0x3e')]===_0x6069('0x50')&&_0x224c67[_0x6069('0x51')]&&_0x224c67[_0x6069('0x4e')]){_0x210b1e[_0x224c67[_0x6069('0x51')]]&&(_0x5debd1[_0x224c67[_0x6069('0x4e')]]=_0x210b1e[_0x224c67['variableName']][_0x6069('0x52')]());}else if(_0x224c67['type']==='customVariable'&&_0x224c67[_0x6069('0x53')]&&_0x224c67[_0x6069('0x53')][_0x6069('0x54')]&&_0x224c67[_0x6069('0x4e')]){_0x210b1e[_0x224c67['Variable'][_0x6069('0x54')]['toLowerCase']()]&&(_0x5debd1[_0x224c67[_0x6069('0x4e')]]=_0x210b1e[_0x224c67[_0x6069('0x53')][_0x6069('0x54')][_0x6069('0x3f')]()][_0x6069('0x52')]());}});}return _0x5debd1;}function getConnection(_0x206252){var _0x4fdae=_0x206252[_0x6069('0x55')][_0x6069('0x56')](_0x206252[_0x6069('0x57')]);var _0xa80b1b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x206252[_0x6069('0x58')]||_0x6069('0x59'),'clientId':_0x206252[_0x6069('0x5a')],'clientSecret':_0x206252[_0x6069('0x5b')]}});return _0xa80b1b['login'](_0x206252[_0x6069('0x5c')],_0x4fdae)[_0x6069('0x25')](function(){logger[_0x6069('0x27')]('Connection\x20established.');return _0xa80b1b;});}exports[_0x6069('0x5d')]=function(_0xe04d7e,_0x5d6a07,_0x2d5a45,_0xfffa89,_0x180400,_0x4349f2){var _0x5f2dd7,_0x52c493,_0xac75d1,_0x4893c2;_0x4349f2[_0x6069('0x5e')]=intUtil[_0x6069('0x5f')](_0x4349f2[_0x6069('0x5e')]);_0x4349f2[_0x6069('0x58')]=intUtil[_0x6069('0x5f')](_0x4349f2['remoteUri']);if(_0x180400&&_0x180400[_0x6069('0x60')]){logger[_0x6069('0x27')]('[QUEUE]',_0x6069('0x61'));_0x5d6a07[_0x6069('0x62')]=util[_0x6069('0x46')](_0x6069('0x63'),_0x4349f2['serverUrl'],_0x5d6a07[_0x6069('0x64')],md5(_0x5d6a07[_0x6069('0x64')]));}else{_0x5d6a07[_0x6069('0x62')]='';}return getConnection(_0x4349f2)[_0x6069('0x25')](function(_0x131f4b){_0x4893c2=_0x131f4b;return getUser(_0x4349f2,_0xfffa89[_0x6069('0x65')],_0x4893c2);})[_0x6069('0x25')](function(_0x5343fe){_0x5f2dd7=_0x5343fe;return getEndUser(_0x4349f2,_0x2d5a45,_0x5d6a07['calleridname'],_0x5d6a07[_0x6069('0x66')],_0x4893c2);})[_0x6069('0x25')](function(_0x5bb6bb){_0x52c493=_0x5bb6bb;return getTicket(_0x4349f2,_0x5f2dd7,_0x52c493,_0x2d5a45,_0x5d6a07,_0x2d5a45['Fields'],_0x4893c2,_0x6069('0x5d'));})[_0x6069('0x25')](function(_0x3ad4f7){_0xac75d1=_0x3ad4f7;logger[_0x6069('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0xac75d1['id']);logger[_0x6069('0x27')](_0x6069('0x67'),_0xac75d1['id'],_0xfffa89['name'],_0x4349f2[_0x6069('0x3e')]);switch(_0x4349f2['type']){case _0x6069('0x68'):emit(util['format'](_0x6069('0x69'),_0xfffa89[_0x6069('0x54')]),'trigger:salesforce:display',{'recordId':_0xac75d1['id']});break;case'newTab':emit(util[_0x6069('0x46')](_0x6069('0x69'),_0xfffa89[_0x6069('0x54')]),_0x6069('0x6a'),{'uri':util[_0x6069('0x46')](_0x6069('0x6b'),_0x4893c2[_0x6069('0x6c')],_0xac75d1['id'])});break;default:logger[_0x6069('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x6069('0x6e')](function(_0x4b9ba8){logger['error'](_0x6069('0x6f'),_0x4b9ba8);});};exports[_0x6069('0x70')]=function(_0x5076d3,_0x577254,_0x96ac45,_0x3eb06b,_0x19d2a8,_0x3b92bc,_0x2d1fdb){var _0x35849e,_0x3f74a6,_0x290f29,_0x571778;_0x3b92bc[_0x6069('0x5e')]=intUtil[_0x6069('0x5f')](_0x3b92bc[_0x6069('0x5e')]);_0x3b92bc[_0x6069('0x58')]=intUtil['stripTrailingSlash'](_0x3b92bc['remoteUri']);if(_0x2d1fdb&&_0x2d1fdb['recordingFormat']&&_0x2d1fdb['recordingFormat']!==_0x6069('0x71')){logger['info']('[OUTBOUND]',_0x6069('0x61'));_0x577254[_0x6069('0x62')]=util[_0x6069('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b92bc[_0x6069('0x5e')],_0x577254[_0x6069('0x64')],md5(_0x577254[_0x6069('0x64')]));}return getConnection(_0x3b92bc)['then'](function(_0x7c7213){_0x571778=_0x7c7213;return getUser(_0x3b92bc,_0x3eb06b[_0x6069('0x65')],_0x571778);})[_0x6069('0x25')](function(_0x27c499){_0x35849e=_0x27c499;return getEndUser(_0x3b92bc,_0x96ac45,_0x577254[_0x6069('0x72')],_0x577254[_0x6069('0x73')],_0x571778);})[_0x6069('0x25')](function(_0x5eb61f){_0x3f74a6=_0x5eb61f;return getTicket(_0x3b92bc,_0x35849e,_0x3f74a6,_0x96ac45,_0x577254,_0x96ac45[_0x6069('0x74')],_0x571778,'outbound');})[_0x6069('0x25')](function(_0x91f895){_0x290f29=_0x91f895;logger[_0x6069('0x27')](_0x6069('0x75'),_0x290f29['id']);logger[_0x6069('0x27')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x290f29['id'],_0x3eb06b[_0x6069('0x54')],_0x3b92bc[_0x6069('0x3e')]);switch(_0x3b92bc[_0x6069('0x3e')]){case'integrationTab':emit(util[_0x6069('0x46')](_0x6069('0x69'),_0x3eb06b['name']),'trigger:salesforce:display',{'recordId':_0x290f29['id']});break;case _0x6069('0x76'):emit(util[_0x6069('0x46')](_0x6069('0x69'),_0x3eb06b['name']),_0x6069('0x6a'),{'uri':util[_0x6069('0x46')](_0x6069('0x6b'),_0x571778[_0x6069('0x6c')],_0x290f29['id'])});break;default:logger['error'](_0x6069('0x77'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x6069('0x6e')](function(_0x162430){logger['error'](_0x6069('0x77'),_0x162430);});};exports[_0x6069('0x78')]=function(_0x2ce90e,_0x3cb931,_0x5a31e3,_0x4a532f,_0x4edbca,_0x1ff64d){var _0x485b7b,_0x46ed85,_0x4871c3,_0xcf4479;_0x1ff64d['serverUrl']=intUtil['stripTrailingSlash'](_0x1ff64d[_0x6069('0x5e')]);_0x1ff64d[_0x6069('0x58')]=intUtil['stripTrailingSlash'](_0x1ff64d['remoteUri']);if(_0x4edbca&&_0x4edbca[_0x6069('0x60')]){logger[_0x6069('0x27')]('['+_0x3cb931['lastevent'][_0x6069('0x79')]()+']',_0x6069('0x61'));_0x3cb931[_0x6069('0x62')]=util[_0x6069('0x46')](_0x6069('0x63'),_0x1ff64d[_0x6069('0x5e')],_0x3cb931[_0x6069('0x64')],md5(_0x3cb931[_0x6069('0x64')]));}else{_0x3cb931[_0x6069('0x62')]='';}return getConnection(_0x1ff64d)[_0x6069('0x25')](function(_0x1eeb99){_0xcf4479=_0x1eeb99;if(!_['isNil'](_0x4a532f)){return getUser(_0x1ff64d,_0x4a532f[_0x6069('0x54')],_0xcf4479);}else{return getUser(_0x1ff64d,null,_0xcf4479);}})[_0x6069('0x25')](function(_0x427900){_0x485b7b=_0x427900;return getEndUser(_0x1ff64d,_0x5a31e3,_0x3cb931[_0x6069('0x7a')],_0x3cb931[_0x6069('0x66')],_0xcf4479);})[_0x6069('0x25')](function(_0x5bd97e){_0x46ed85=_0x5bd97e;return getTicket(_0x1ff64d,_0x485b7b,_0x46ed85,_0x5a31e3,_0x3cb931,_0x5a31e3[_0x6069('0x74')],_0xcf4479);})[_0x6069('0x25')](function(_0x33b65e){_0x4871c3=_0x33b65e;logger[_0x6069('0x27')]('['+_0x3cb931[_0x6069('0x7b')][_0x6069('0x79')]()+_0x6069('0x7c'),_0x4871c3['id']);logger[_0x6069('0x27')]('['+_0x3cb931[_0x6069('0x7b')][_0x6069('0x79')]()+_0x6069('0x7d'),_0x1ff64d[_0x6069('0x3e')]);})[_0x6069('0x6e')](function(_0x150a04){logger[_0x6069('0x6d')]('['+_0x3cb931['lastevent'][_0x6069('0x79')]()+']',_0x150a04);});};
\ No newline at end of file
+var _0x87a8=['clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','ticketType','create','isNil','validateEmail','User','find','execute','then','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','<unknown>','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','toString','variableName','Variable','name','concat','Connection','remoteUri','https://login.salesforce.com','clientId'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x87a8,0xa8));var _0x887a=function(_0xd3fee5,_0x1428b5){_0xd3fee5=_0xd3fee5-0x0;var _0xb7815a=_0x87a8[_0xd3fee5];return _0xb7815a;};'use strict';var _=require('lodash');var rp=require(_0x887a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x887a('0x1'));var jsforce=require('jsforce');var util=require(_0x887a('0x2'));var Redis=require(_0x887a('0x3'));var intUtil=require(_0x887a('0x4'));var config=require(_0x887a('0x5'));var logger=require(_0x887a('0x6'))(_0x887a('0x7'));config[_0x887a('0x8')]=_[_0x887a('0x9')](config[_0x887a('0x8')],{'host':_0x887a('0xa'),'port':0x18eb});var io=require(_0x887a('0xb'))(new Redis(config[_0x887a('0x8')]));function emit(_0x4e3c7d,_0x224469,_0x493826){io['to'](_0x4e3c7d)[_0x887a('0xc')](_0x224469,_0x493826);}function getTicket(_0xfc9f32,_0x308ead,_0x92e2ac,_0x2e8efe,_0x107568,_0x52162e,_0x1fa0b5,_0xdabf60){var _0x20c7cf=Object[_0x887a('0xd')]({},{'OwnerId':_0x308ead['id'],'Subject':intUtil[_0x887a('0xe')](_0x2e8efe[_0x887a('0xf')],_0x107568,'\x20'),'Description':intUtil[_0x887a('0xe')](_0x2e8efe['Descriptions'],_0x107568,'\x0a')},getCustomFields(_0x52162e,_0x107568));if(_0x92e2ac){if(_0x2e8efe['ticketType']===_0x887a('0x10')){_0x20c7cf[_0x887a('0x11')]=moment[_0x887a('0x12')]();_0x20c7cf[_0x887a('0x13')]=![];_0x20c7cf[_0x887a('0x14')]=![];if(_0x92e2ac[_0x887a('0x15')]===_0x887a('0x16')||_0x92e2ac[_0x887a('0x15')]===_0x887a('0x17')){_0x20c7cf[_0x887a('0x18')]=_0x92e2ac['id'];}else if(_0x92e2ac['endUserType']===_0x887a('0x19')){_0x20c7cf[_0x887a('0x1a')]=_0x92e2ac['id'];}}else if(_0x2e8efe['ticketType']===_0x887a('0x1b')){if(_0x92e2ac[_0x887a('0x15')]===_0x887a('0x16')){_0x20c7cf[_0x887a('0x1c')]=_0x92e2ac['id'];}else if(_0x92e2ac[_0x887a('0x15')]==='account'){_0x20c7cf['AccountId']=_0x92e2ac['id'];}else if(_0x92e2ac[_0x887a('0x15')]==='lead'&&_0x2e8efe[_0x887a('0x1d')]){_0x20c7cf[_0x2e8efe[_0x887a('0x1d')]]=_0x92e2ac['id'];}else{logger[_0x887a('0x1e')](_0x887a('0x1f'));}}}return _0x1fa0b5[_0x887a('0x20')](_0x2e8efe[_0x887a('0x21')])[_0x887a('0x22')](_0x20c7cf);}function getUser(_0x28d3f3,_0x135ca4,_0xd962dc){if(!_[_0x887a('0x23')](_0x135ca4)&&intUtil[_0x887a('0x24')](_0x135ca4)){var _0x4d56b5={'Email':_0x135ca4};var _0x3d5620={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd962dc['sobject'](_0x887a('0x25'))[_0x887a('0x26')](_0x4d56b5,_0x3d5620)[_0x887a('0x27')]()[_0x887a('0x28')](function(_0x271202){if(_0x271202['length']){var _0x141429=_['find'](_0x271202,function(_0x36cc1f){return _0x36cc1f['Email']===_0x135ca4;});if(_0x141429){logger[_0x887a('0x1e')](_0x887a('0x29'),_0x135ca4);return BPromise[_0x887a('0x2a')]({'id':_0x141429['Id'],'name':_0x141429[_0x887a('0x2b')]});}}else{logger[_0x887a('0x1e')](_0x887a('0x2c'),_0x135ca4);return _0xd962dc['identity']()['then'](function(_0x3ce96c){return BPromise[_0x887a('0x2a')]({'id':_0x3ce96c[_0x887a('0x2d')],'name':_0x3ce96c['display_name']});});}});}else{logger[_0x887a('0x1e')](_0x887a('0x2c'),_0x135ca4);return _0xd962dc[_0x887a('0x2e')]()[_0x887a('0x28')](function(_0x390d2a){return BPromise[_0x887a('0x2a')]({'id':_0x390d2a[_0x887a('0x2d')],'name':_0x390d2a[_0x887a('0x2f')]});});}}function getEndUser(_0x1dcb28,_0x5e6918,_0x11295c,_0xb5c9aa,_0x1c78e0){var _0x8d2a2b={'$or':{'Phone':_0xb5c9aa}};var _0x1ee0a6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x887a('0x2a')]()[_0x887a('0x28')](function(){logger[_0x887a('0x1e')](_0x887a('0x30'),_0xb5c9aa,_0x5e6918[_0x887a('0x31')]);switch(_0x5e6918[_0x887a('0x31')]){case _0x887a('0x32'):var _0x317185=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x34')]){var _0x2c310f={};_0x2c310f[_0x5e6918[_0x887a('0x34')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x317185[_0x887a('0x36')],_0x2c310f);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x37'))[_0x887a('0x26')](_0x317185,_0x1ee0a6)[_0x887a('0x27')]()[_0x887a('0x28')](function(_0x3f7f07){if(_0x3f7f07&&_0x3f7f07[_0x887a('0x38')]){return _0x3f7f07;}else{var _0x48a517=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918['additionalSearchLead']){var _0x4239c8={};_0x4239c8[_0x5e6918[_0x887a('0x39')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x48a517['$or'],_0x4239c8);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x3a'))['find'](_0x48a517,_0x1ee0a6);}});case _0x887a('0x3b'):var _0x390c9b=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x3c')]){var _0x2c310f={};_0x2c310f[_0x5e6918[_0x887a('0x3c')]]=_0xb5c9aa;_['merge'](_0x390c9b[_0x887a('0x36')],_0x2c310f);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x3d'))[_0x887a('0x26')](_0x390c9b,_0x1ee0a6)[_0x887a('0x27')]()[_0x887a('0x28')](function(_0x53f12e){if(_0x53f12e&&_0x53f12e[_0x887a('0x38')]){return _0x53f12e;}else{var _0x4c34aa=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x34')]){var _0x1b41ab={};_0x1b41ab[_0x5e6918[_0x887a('0x34')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x4c34aa['$or'],_0x1b41ab);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x37'))['find'](_0x4c34aa,_0x1ee0a6)[_0x887a('0x28')](function(_0x289041){if(_0x289041&&_0x289041[_0x887a('0x38')]){return _0x289041;}else{var _0x1c9915=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x39')]){var _0x49a4b0={};_0x49a4b0[_0x5e6918['additionalSearchLead']]=_0xb5c9aa;_[_0x887a('0x35')](_0x1c9915[_0x887a('0x36')],_0x49a4b0);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x3a'))[_0x887a('0x26')](_0x1c9915,_0x1ee0a6);}});}});case _0x887a('0x16'):var _0x317185=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x34')]){var _0x2c310f={};_0x2c310f[_0x5e6918[_0x887a('0x34')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x317185[_0x887a('0x36')],_0x2c310f);}return _0x1c78e0[_0x887a('0x20')]('Contact')['find'](_0x317185,_0x1ee0a6)['execute']();case _0x887a('0x17'):var _0x25c767=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x39')]){var _0x2c310f={};_0x2c310f[_0x5e6918[_0x887a('0x39')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x25c767[_0x887a('0x36')],_0x2c310f);}return _0x1c78e0[_0x887a('0x20')](_0x887a('0x3a'))[_0x887a('0x26')](_0x25c767,_0x1ee0a6);case'account':var _0x390c9b=_[_0x887a('0x33')](_0x8d2a2b);if(_0x5e6918[_0x887a('0x3c')]){var _0x2c310f={};_0x2c310f[_0x5e6918[_0x887a('0x3c')]]=_0xb5c9aa;_[_0x887a('0x35')](_0x390c9b[_0x887a('0x36')],_0x2c310f);}return _0x1c78e0[_0x887a('0x20')]('Account')['find'](_0x390c9b,_0x1ee0a6);default:return null;}})[_0x887a('0x28')](function(_0x2181d5){if(_0x2181d5&&_0x2181d5[_0x887a('0x38')]){var _0x3dc70e=_['first'](_0x2181d5);if(_0x3dc70e){return BPromise['resolve']({'id':_0x3dc70e['Id'],'name':_0x3dc70e[_0x887a('0x2b')],'phone':_0x3dc70e[_0x887a('0x3e')],'endUserType':_0x3dc70e[_0x887a('0x3f')][_0x887a('0x40')][_0x887a('0x41')]()});}}})[_0x887a('0x28')](function(_0x45a361){if(_0x45a361){logger[_0x887a('0x1e')](_0x887a('0x42'),_0x45a361[_0x887a('0x15')],_0xb5c9aa);return BPromise[_0x887a('0x2a')](_0x45a361);}else{logger[_0x887a('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0xb5c9aa);var _0x5613ad={'Phone':_0xb5c9aa};if(_0x5e6918[_0x887a('0x43')]){if(_0x5e6918[_0x887a('0x43')]===_0x887a('0x16')){logger[_0x887a('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xb5c9aa,_0x5e6918[_0x887a('0x43')]);_0x5613ad['LastName']=_0x11295c!==_0x887a('0x44')?_0x11295c:util[_0x887a('0x45')]('Caller\x20-\x20%s',_0xb5c9aa);}else if(_0x5e6918['moduleCreate']==='lead'){logger[_0x887a('0x1e')](_0x887a('0x46'),_0xb5c9aa,_0x5e6918[_0x887a('0x43')]);_0x5613ad[_0x887a('0x47')]=_0x11295c!=='<unknown>'?_0x11295c:util[_0x887a('0x45')](_0x887a('0x48'),_0xb5c9aa);_0x5613ad[_0x887a('0x49')]=_0x887a('0x4a');}else if(_0x5e6918['moduleCreate']===_0x887a('0x19')){logger[_0x887a('0x1e')](_0x887a('0x46'),_0xb5c9aa,_0x5e6918[_0x887a('0x43')]);_0x5613ad[_0x887a('0x2b')]=_0x11295c!==_0x887a('0x44')?_0x11295c:util[_0x887a('0x45')]('Caller\x20-\x20%s',_0xb5c9aa);}else{return null;}}return _0x1c78e0['sobject'](_[_0x887a('0x4b')](_0x5e6918[_0x887a('0x43')]))[_0x887a('0x22')](_0x5613ad)[_0x887a('0x28')](function(_0x200e98){return BPromise[_0x887a('0x2a')]({'id':_0x200e98['id'],'endUserType':_0x5e6918['moduleCreate']});});}});}function getCustomFields(_0x29c980,_0x3b9c63){var _0x4bb88b={};if(_0x29c980['length']>0x0){_[_0x887a('0x4c')](_0x29c980,function(_0x2712cc){if(_[_0x887a('0x4d')]([_0x887a('0x4e'),_0x887a('0x4f')],_0x2712cc[_0x887a('0x40')])&&_0x2712cc[_0x887a('0x50')]){_0x4bb88b[_0x2712cc[_0x887a('0x50')]]=_0x2712cc['content'][_0x887a('0x51')]();}else if(_0x2712cc[_0x887a('0x40')]==='variable'&&_0x2712cc[_0x887a('0x52')]&&_0x2712cc[_0x887a('0x50')]){_0x3b9c63[_0x2712cc[_0x887a('0x52')]]&&(_0x4bb88b[_0x2712cc['idField']]=_0x3b9c63[_0x2712cc['variableName']]['toString']());}else if(_0x2712cc[_0x887a('0x40')]==='customVariable'&&_0x2712cc[_0x887a('0x53')]&&_0x2712cc[_0x887a('0x53')]['name']&&_0x2712cc[_0x887a('0x50')]){_0x3b9c63[_0x2712cc[_0x887a('0x53')][_0x887a('0x54')][_0x887a('0x41')]()]&&(_0x4bb88b[_0x2712cc[_0x887a('0x50')]]=_0x3b9c63[_0x2712cc[_0x887a('0x53')][_0x887a('0x54')][_0x887a('0x41')]()][_0x887a('0x51')]());}});}return _0x4bb88b;}function getConnection(_0x36cae8){var _0x2a3f93=_0x36cae8['password'][_0x887a('0x55')](_0x36cae8['securityToken']);var _0x47a760=new jsforce[(_0x887a('0x56'))]({'oauth2':{'loginUrl':_0x36cae8[_0x887a('0x57')]||_0x887a('0x58'),'clientId':_0x36cae8[_0x887a('0x59')],'clientSecret':_0x36cae8[_0x887a('0x5a')]}});return _0x47a760[_0x887a('0x5b')](_0x36cae8[_0x887a('0x5c')],_0x2a3f93)[_0x887a('0x28')](function(){logger[_0x887a('0x1e')](_0x887a('0x5d'));return _0x47a760;});}exports[_0x887a('0x5e')]=function(_0x2cbb56,_0x3bdb8c,_0x36eb25,_0x2adfd5,_0x4b85f6,_0x1114b0){var _0x35c3da,_0x42d7a,_0x257bee,_0x5ed2f3;_0x1114b0[_0x887a('0x5f')]=intUtil['stripTrailingSlash'](_0x1114b0[_0x887a('0x5f')]);_0x1114b0['remoteUri']=intUtil[_0x887a('0x60')](_0x1114b0[_0x887a('0x57')]);if(_0x4b85f6&&_0x4b85f6['monitor_format']){logger[_0x887a('0x1e')]('[QUEUE]',_0x887a('0x61'));_0x3bdb8c[_0x887a('0x62')]=util[_0x887a('0x45')](_0x887a('0x63'),_0x1114b0['serverUrl'],_0x3bdb8c[_0x887a('0x64')],md5(_0x3bdb8c[_0x887a('0x64')]));}else{_0x3bdb8c[_0x887a('0x62')]='';}return getConnection(_0x1114b0)['then'](function(_0x5e02d7){_0x5ed2f3=_0x5e02d7;return getUser(_0x1114b0,_0x2adfd5[_0x887a('0x65')],_0x5ed2f3);})['then'](function(_0x50f9c7){_0x35c3da=_0x50f9c7;return getEndUser(_0x1114b0,_0x36eb25,_0x3bdb8c[_0x887a('0x66')],_0x3bdb8c[_0x887a('0x67')],_0x5ed2f3);})[_0x887a('0x28')](function(_0x3713be){_0x42d7a=_0x3713be;return getTicket(_0x1114b0,_0x35c3da,_0x42d7a,_0x36eb25,_0x3bdb8c,_0x36eb25[_0x887a('0x68')],_0x5ed2f3,'queue');})[_0x887a('0x28')](function(_0x2f3d8b){_0x257bee=_0x2f3d8b;logger[_0x887a('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x257bee['id']);logger[_0x887a('0x1e')](_0x887a('0x69'),_0x257bee['id'],_0x2adfd5[_0x887a('0x54')],_0x1114b0[_0x887a('0x40')]);switch(_0x1114b0[_0x887a('0x40')]){case _0x887a('0x6a'):emit(util[_0x887a('0x45')](_0x887a('0x6b'),_0x2adfd5[_0x887a('0x54')]),_0x887a('0x6c'),{'recordId':_0x257bee['id']});break;case _0x887a('0x6d'):emit(util[_0x887a('0x45')](_0x887a('0x6b'),_0x2adfd5[_0x887a('0x54')]),_0x887a('0x6e'),{'uri':util['format'](_0x887a('0x6f'),_0x5ed2f3['instanceUrl'],_0x257bee['id'])});break;default:logger[_0x887a('0x70')](_0x887a('0x71'));}})['catch'](function(_0x51351f){logger['error'](_0x887a('0x72'),_0x51351f);});};exports[_0x887a('0x73')]=function(_0x56f633,_0x990b0d,_0x519815,_0x159bed,_0xc6401b,_0x33f265,_0x3b7fe5){var _0x4e745c,_0xa090a7,_0x34a9ed,_0x46dae9;_0x33f265[_0x887a('0x5f')]=intUtil['stripTrailingSlash'](_0x33f265['serverUrl']);_0x33f265[_0x887a('0x57')]=intUtil[_0x887a('0x60')](_0x33f265[_0x887a('0x57')]);if(_0x3b7fe5&&_0x3b7fe5[_0x887a('0x74')]&&_0x3b7fe5[_0x887a('0x74')]!=='none'){logger['info'](_0x887a('0x75'),_0x887a('0x61'));_0x990b0d[_0x887a('0x62')]=util['format'](_0x887a('0x63'),_0x33f265[_0x887a('0x5f')],_0x990b0d[_0x887a('0x64')],md5(_0x990b0d[_0x887a('0x64')]));}return getConnection(_0x33f265)['then'](function(_0x3fbac5){_0x46dae9=_0x3fbac5;return getUser(_0x33f265,_0x159bed['email'],_0x46dae9);})[_0x887a('0x28')](function(_0xe144e1){_0x4e745c=_0xe144e1;return getEndUser(_0x33f265,_0x519815,_0x990b0d[_0x887a('0x76')],_0x990b0d[_0x887a('0x77')],_0x46dae9);})['then'](function(_0x3476ad){_0xa090a7=_0x3476ad;return getTicket(_0x33f265,_0x4e745c,_0xa090a7,_0x519815,_0x990b0d,_0x519815['Fields'],_0x46dae9,_0x887a('0x73'));})['then'](function(_0x2610d2){_0x34a9ed=_0x2610d2;logger[_0x887a('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x34a9ed['id']);logger[_0x887a('0x1e')](_0x887a('0x78'),_0x34a9ed['id'],_0x159bed['name'],_0x33f265[_0x887a('0x40')]);switch(_0x33f265[_0x887a('0x40')]){case _0x887a('0x6a'):emit(util[_0x887a('0x45')](_0x887a('0x6b'),_0x159bed[_0x887a('0x54')]),'trigger:salesforce:display',{'recordId':_0x34a9ed['id']});break;case _0x887a('0x6d'):emit(util[_0x887a('0x45')](_0x887a('0x6b'),_0x159bed[_0x887a('0x54')]),'trigger:browser:url',{'uri':util[_0x887a('0x45')]('%s/%s/e',_0x46dae9['instanceUrl'],_0x34a9ed['id'])});break;default:logger['error']('[OUTBOUND]',_0x887a('0x79'));}})['catch'](function(_0xe1fbc2){logger[_0x887a('0x70')]('[OUTBOUND]',_0xe1fbc2);});};exports[_0x887a('0x7a')]=function(_0x45a9fb,_0x1bbc73,_0x50b654,_0x501b4d,_0x49eed0,_0x30f247){var _0x191dba,_0x352cd7,_0x529c61,_0x48adf9;_0x30f247[_0x887a('0x5f')]=intUtil[_0x887a('0x60')](_0x30f247[_0x887a('0x5f')]);_0x30f247[_0x887a('0x57')]=intUtil['stripTrailingSlash'](_0x30f247[_0x887a('0x57')]);if(_0x49eed0&&_0x49eed0[_0x887a('0x7b')]){logger[_0x887a('0x1e')]('['+_0x1bbc73[_0x887a('0x7c')][_0x887a('0x7d')]()+']',_0x887a('0x61'));_0x1bbc73[_0x887a('0x62')]=util['format'](_0x887a('0x63'),_0x30f247[_0x887a('0x5f')],_0x1bbc73[_0x887a('0x64')],md5(_0x1bbc73[_0x887a('0x64')]));}else{_0x1bbc73[_0x887a('0x62')]='';}return getConnection(_0x30f247)[_0x887a('0x28')](function(_0x54404b){_0x48adf9=_0x54404b;if(!_['isNil'](_0x501b4d)){return getUser(_0x30f247,_0x501b4d['name'],_0x48adf9);}else{return getUser(_0x30f247,null,_0x48adf9);}})[_0x887a('0x28')](function(_0x16b26e){_0x191dba=_0x16b26e;return getEndUser(_0x30f247,_0x50b654,_0x1bbc73[_0x887a('0x66')],_0x1bbc73[_0x887a('0x67')],_0x48adf9);})[_0x887a('0x28')](function(_0xa02de){_0x352cd7=_0xa02de;return getTicket(_0x30f247,_0x191dba,_0x352cd7,_0x50b654,_0x1bbc73,_0x50b654[_0x887a('0x68')],_0x48adf9);})[_0x887a('0x28')](function(_0x5d196b){_0x529c61=_0x5d196b;logger[_0x887a('0x1e')]('['+_0x1bbc73[_0x887a('0x7c')][_0x887a('0x7d')]()+_0x887a('0x7e'),_0x529c61['id']);logger[_0x887a('0x1e')]('['+_0x1bbc73[_0x887a('0x7c')][_0x887a('0x7d')]()+_0x887a('0x7f'),_0x30f247[_0x887a('0x40')]);})[_0x887a('0x80')](function(_0x34e5e6){logger[_0x887a('0x70')]('['+_0x1bbc73[_0x887a('0x7c')]['toUpperCase']()+']',_0x34e5e6);});};
\ No newline at end of file
index fa8f6f1..b7747ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bff=['socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name','incident','assign','getString','Subjects','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0x4bff,0xcc));var _0xf4bf=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x4bff[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xf4bf('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0xf4bf('0x1'));var Redis=require(_0xf4bf('0x2'));var intUtil=require(_0xf4bf('0x3'));var config=require(_0xf4bf('0x4'));var logger=require('../../../../config/logger')('servicenow');config[_0xf4bf('0x5')]=_[_0xf4bf('0x6')](config['redis'],{'host':_0xf4bf('0x7'),'port':0x18eb});var io=require(_0xf4bf('0x8'))(new Redis(config[_0xf4bf('0x5')]));function getAdminUser(_0x204091,_0x4748c9,_0x38dfd9,_0x4a9b6c,_0x2e3138,_0x4b95eb){return new Promise(function(_0x4b653c,_0x52c092){var _0x2b2905={'method':_0xf4bf('0x9'),'uri':_0x4a9b6c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x2e3138+'&'+_0x4b95eb,'auth':_0x4748c9,'json':!![]};return rp(_0x2b2905)[_0xf4bf('0xa')](function(_0x166ad1){if(_0x166ad1[_0xf4bf('0xb')][_0xf4bf('0xc')]>0x0){_0x38dfd9[_0xf4bf('0xd')]=_0x166ad1[_0xf4bf('0xb')][0x0][_0xf4bf('0xe')];}logger[_0xf4bf('0xf')]('['+[_0x204091[_0xf4bf('0x10')]()]+_0xf4bf('0x11'),_0x38dfd9);_0x4b653c(_0x38dfd9);})[_0xf4bf('0x12')](function(_0x53c981){logger[_0xf4bf('0x13')]('['+[_0x204091[_0xf4bf('0x10')]()]+']',_0x53c981['message']);_0x52c092(_0x53c981[_0xf4bf('0x14')]);});});}function getUser(_0xe1a24,_0xe26da9,_0x29b075,_0x38df3f,_0x4f4dfd){return function(_0x4fab06){logger['info']('['+[_0xe1a24[_0xf4bf('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x4fab06);return new Promise(function(_0x58868b,_0x28d071){if(intUtil[_0xf4bf('0x15')](_0x4fab06[_0xf4bf('0x16')])){var _0x2c6fad={'method':_0xf4bf('0x9'),'uri':_0x29b075+_0xf4bf('0x17')+_0x4fab06[_0xf4bf('0x16')]+'&'+_0x38df3f+'&'+_0x4f4dfd,'auth':_0xe26da9,'json':!![]};logger[_0xf4bf('0xf')]('['+[_0xe1a24[_0xf4bf('0x10')]()]+_0xf4bf('0x18'),_0x2c6fad);return rp(_0x2c6fad)[_0xf4bf('0xa')](function(_0x28a531){logger[_0xf4bf('0xf')]('['+[_0xe1a24['toUpperCase']()]+_0xf4bf('0x19'),_0x28a531);if(_0x28a531[_0xf4bf('0xb')][_0xf4bf('0xc')]>0x0&&String(_0x28a531['result'][0x0][_0xf4bf('0x1a')])===_0xf4bf('0x1b')){_0x4fab06[_0xf4bf('0x1c')]=_0x28a531[_0xf4bf('0xb')][0x0][_0xf4bf('0xe')];}else{_0x4fab06[_0xf4bf('0x1c')]=_0x4fab06[_0xf4bf('0xd')];_0x4fab06[_0xf4bf('0x16')]=_0x4fab06['adminEmail'];}logger[_0xf4bf('0xf')]('['+[_0xe1a24[_0xf4bf('0x10')]()]+_0xf4bf('0x1d'),_0x4fab06);_0x58868b(_0x4fab06);})[_0xf4bf('0x12')](function(_0x43854a){logger['error']('['+[_0xe1a24['toUpperCase']()]+']',_0x43854a['message']);_0x28d071(_0x43854a['message']);});}else{logger[_0xf4bf('0xf')]('['+[_0xe1a24[_0xf4bf('0x10')]()]+']\x20using\x20admin\x20profile');_0x4fab06[_0xf4bf('0x1c')]=_0x4fab06['adminId'];_0x4fab06[_0xf4bf('0x16')]=_0x4fab06[_0xf4bf('0x1e')];_0x58868b(_0x4fab06);}});};}function createEndUser(_0x527841,_0x555543,_0x2e2943,_0x54e221,_0x39b040){logger['info']('['+[_0x527841[_0xf4bf('0x10')]()]+_0xf4bf('0x1f'),_0x2e2943);return new Promise(function(_0x2ffa91,_0xd0dcf){var _0x1ed39e={'method':_0xf4bf('0x20'),'uri':_0x54e221+_0xf4bf('0x21')+_0x39b040,'body':{'user_name':_0x2e2943['endUserNumber'],'roles':'user','first_name':_0x2e2943[_0xf4bf('0x22')],'active':_0xf4bf('0x1b'),'date_format':_0xf4bf('0x23'),'phone':_0x2e2943[_0xf4bf('0x22')]},'auth':_0x555543,'json':!![]};return rp(_0x1ed39e)[_0xf4bf('0xa')](function(_0x38bae9){logger[_0xf4bf('0xf')]('['+[_0x527841[_0xf4bf('0x10')]()]+_0xf4bf('0x24'),_0x38bae9[_0xf4bf('0xb')]);_0x2e2943[_0xf4bf('0x25')]=_0x38bae9[_0xf4bf('0xb')][_0xf4bf('0xe')];_0x2ffa91(_0x2e2943);})['catch'](function(_0x5cdc3d){logger[_0xf4bf('0x13')]('['+[_0x527841[_0xf4bf('0x10')]()]+']',_0x5cdc3d[_0xf4bf('0x14')]);_0xd0dcf(_0x5cdc3d[_0xf4bf('0x14')]);});});}function getEndUser(_0x5038e5,_0xb93207,_0x3ab859,_0x60511d,_0x35a55a){return function(_0x3171e7){logger[_0xf4bf('0xf')]('['+[_0x5038e5[_0xf4bf('0x10')]()]+_0xf4bf('0x26'),_0x3171e7);return new Promise(function(_0x31156a,_0x5368d8){var _0x7c4e97={'method':_0xf4bf('0x9'),'uri':_0x3ab859+_0xf4bf('0x27')+_0x3171e7[_0xf4bf('0x22')]+'&'+_0x60511d+'&'+_0x35a55a,'auth':_0xb93207,'json':!![]};return rp(_0x7c4e97)[_0xf4bf('0xa')](function(_0xea8bcd){if(_0xea8bcd[_0xf4bf('0xb')][_0xf4bf('0xc')]>0x0){_0x3171e7[_0xf4bf('0x25')]=_0xea8bcd['result'][0x0]['sys_id'];logger[_0xf4bf('0xf')]('['+[_0x5038e5[_0xf4bf('0x10')]()]+'],\x20getEndUser\x20crm',_0x3171e7);_0x31156a(_0x3171e7);}else{return createEndUser(_0x5038e5,_0xb93207,_0x3171e7,_0x3ab859,_0x60511d)[_0xf4bf('0xa')](function(_0x33357c){logger['info']('['+[_0x5038e5[_0xf4bf('0x10')]()]+'],\x20createEndUser\x20crm',_0x33357c);_0x31156a(_0x33357c);});}})['catch'](function(_0x131252){logger[_0xf4bf('0x13')]('['+[_0x5038e5['toUpperCase']()]+']',_0x131252['message']);_0x5368d8(_0x131252[_0xf4bf('0x14')]);});});};}function getCustomFields(_0xa3fb0f,_0x2153bc){var _0x277b48={};if(_0xa3fb0f[_0xf4bf('0xc')]>0x0){_[_0xf4bf('0x28')](_0xa3fb0f,function(_0x22b19a){if(_[_0xf4bf('0x29')]([_0xf4bf('0x2a'),_0xf4bf('0x2b')],_0x22b19a[_0xf4bf('0x2c')])&&_0x22b19a[_0xf4bf('0x2d')]&&!_0x22b19a[_0xf4bf('0x2e')]){_0x277b48[_0x22b19a[_0xf4bf('0x2d')][_0xf4bf('0x2f')]()]=_0x22b19a[_0xf4bf('0x30')][_0xf4bf('0x31')]();}else if(_['includes'](['string','picklist'],_0x22b19a[_0xf4bf('0x2c')])&&_0x22b19a[_0xf4bf('0x32')]&&_0x22b19a['customField']){_0x277b48[_0x22b19a[_0xf4bf('0x32')][_0xf4bf('0x2f')]()]=_0x22b19a['content'][_0xf4bf('0x31')]();}else if(_0x22b19a[_0xf4bf('0x2c')]===_0xf4bf('0x33')&&_0x22b19a[_0xf4bf('0x34')]&&_0x22b19a[_0xf4bf('0x32')]&&_0x22b19a[_0xf4bf('0x2e')]){_0x277b48[_0x22b19a[_0xf4bf('0x32')][_0xf4bf('0x2f')]()]=_0x2153bc[_0x22b19a[_0xf4bf('0x34')]][_0xf4bf('0x31')]();}else if(_0x22b19a[_0xf4bf('0x2c')]===_0xf4bf('0x35')&&_0x22b19a[_0xf4bf('0x36')]&&_0x22b19a[_0xf4bf('0x36')][_0xf4bf('0x37')]&&_0x22b19a[_0xf4bf('0x32')]&&_0x22b19a[_0xf4bf('0x2e')]){_0x277b48[_0x22b19a[_0xf4bf('0x32')][_0xf4bf('0x2f')]()]=_0x2153bc[_0x22b19a[_0xf4bf('0x36')][_0xf4bf('0x37')][_0xf4bf('0x2f')]()][_0xf4bf('0x31')]();}});}return _0x277b48;}function getTicket(_0x2d0f21,_0x518607,_0x4990b1,_0x1253b1,_0x562662,_0x291c34){return function(_0x463b90){logger[_0xf4bf('0xf')]('['+[_0x2d0f21[_0xf4bf('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x463b90);return new Promise(function(_0x526c62,_0x40a9b6){var _0x3c224b=_0x2d0f21[_0xf4bf('0x2f')]()==='outbound'?_0x463b90['userId']:_0x463b90[_0xf4bf('0x25')];var _0x55479a={'method':'POST','uri':_0x4990b1+_0xf4bf('0x38')+'?'+_0x291c34,'body':Object[_0xf4bf('0x39')]({},{'active':_0xf4bf('0x1b'),'caller_id':_0x3c224b,'assigned_to':_0x463b90['userId'],'short_description':intUtil[_0xf4bf('0x3a')](_0x1253b1[_0xf4bf('0x3b')],_0x562662,'\x20'),'description':intUtil[_0xf4bf('0x3a')](_0x1253b1[_0xf4bf('0x3c')],_0x562662,'\x0a')},getCustomFields(_0x1253b1['Fields'],_0x562662)),'auth':_0x518607,'json':!![]};return rp(_0x55479a)[_0xf4bf('0xa')](function(_0xb3668e){logger[_0xf4bf('0xf')]('['+[_0x2d0f21[_0xf4bf('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0xb3668e['result']);_0x463b90[_0xf4bf('0x3d')]=_0xb3668e[_0xf4bf('0xb')][_0xf4bf('0xe')];_0x463b90[_0xf4bf('0x3e')]=_0xb3668e[_0xf4bf('0xb')][_0xf4bf('0x3f')];logger[_0xf4bf('0xf')]('['+[_0x2d0f21[_0xf4bf('0x10')]()]+_0xf4bf('0x40'),_0x463b90);_0x526c62(_0x463b90);})[_0xf4bf('0x12')](function(_0x43b8a1){logger[_0xf4bf('0x13')]('['+[_0x2d0f21[_0xf4bf('0x10')]()]+']',_0x43b8a1[_0xf4bf('0x14')]);_0x40a9b6(_0x43b8a1['message']);});});};}function createRemoteTag(_0x4e0bc5,_0x1a54df,_0x538e64,_0x30a29f){return new Promise(function(_0xebede9,_0x1aa71e){var _0x2d0c97={'method':_0xf4bf('0x20'),'uri':_0x538e64+_0xf4bf('0x41')+'?'+_0x30a29f,'body':{'short_description':_0x4e0bc5,'global':!![],'active':!![],'name':_0x4e0bc5},'auth':_0x1a54df,'json':!![]};return rp(_0x2d0c97)['then'](function(_0x3a828a){var _0x50d53a=_0x3a828a['result'][_0xf4bf('0xe')];_0xebede9(_0x50d53a);});});}function getRemoteTag(_0x583df2,_0x3a4934,_0x3b867f,_0x2f0720,_0x4df2f1){return new Promise(function(_0x347e19,_0x4442ae){var _0x563367={'method':_0xf4bf('0x9'),'uri':_0x3b867f+'label'+_0xf4bf('0x42')+_0x583df2+'&'+_0x2f0720,'auth':_0x3a4934,'json':!![]};return rp(_0x563367)[_0xf4bf('0xa')](function(_0x1522ad){if(_0x1522ad[_0xf4bf('0xb')][_0xf4bf('0xc')]>0x0){var _0x363111=_0x1522ad[_0xf4bf('0xb')][0x0]['sys_id'];_0x347e19(_0x363111);}else{return createRemoteTag(_0x583df2,_0x3a4934,_0x3b867f,_0x2f0720)[_0xf4bf('0xa')](function(_0x15415b){_0x347e19(_0x15415b);});}});});}function assignTagToIncident(_0x394b37,_0x18f2cd,_0x1a6655,_0x23713f,_0x9d9db5){return new Promise(function(_0x4b1dfc,_0x5e1318){var _0x24aecd={'method':_0xf4bf('0x20'),'uri':_0x1a6655+_0xf4bf('0x43')+'?'+_0x9d9db5,'body':{'label':_0x394b37,'table':_0xf4bf('0x38'),'id_type':_0xf4bf('0x44'),'table_key':_0x23713f['ticketId'],'title':_0xf4bf('0x45')+_0x23713f[_0xf4bf('0x3e')],'id_display':_0x23713f[_0xf4bf('0x3e')]},'auth':_0x18f2cd,'json':!![]};return rp(_0x24aecd)[_0xf4bf('0xa')](function(_0x157bd9){_0x4b1dfc();})['catch'](function(){_0x4b1dfc();});});}function manageTags(_0xe6f7b9,_0x590d48,_0x37b966,_0x3fa0d7,_0x49af8b,_0x5ca765,_0x14d0d4){return new Promise(function(_0x1d8955,_0xc1d850){var _0x135176=[];_0x590d48['forEach'](function(_0x1bea5e){_0x135176[_0xf4bf('0x46')](getRemoteTag(_0x1bea5e,_0x37b966,_0x3fa0d7,_0x5ca765,_0x14d0d4));});return Promise[_0xf4bf('0x47')](_0x135176)['then'](function(_0x1d6fb9){if(_0x1d6fb9[_0xf4bf('0xc')]){logger[_0xf4bf('0xf')]('['+[_0xe6f7b9['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1d6fb9);var _0x20ff50=[];_0x1d6fb9[_0xf4bf('0x28')](function(_0x273d99){_0x20ff50[_0xf4bf('0x46')](assignTagToIncident(_0x273d99,_0x37b966,_0x3fa0d7,_0x49af8b,_0x5ca765));});return Promise[_0xf4bf('0x47')](_0x20ff50)[_0xf4bf('0xa')](function(){_0x1d8955();})[_0xf4bf('0x12')](function(){_0x1d8955();});}else{_0x1d8955();}});});}function getTags(_0x3c7a84,_0x3600f0,_0x3be079,_0x2cbd29,_0x32413f,_0x463e44){return function(_0x544b5b){return new Promise(function(_0x9188e8,_0x35be0c){var _0x58254a=[];var _0x472765=_0x2cbd29[_0xf4bf('0x48')];if(_0x472765&&_0x472765[_0xf4bf('0xc')]>0x0){_0x58254a=_['map'](_0x472765,_0xf4bf('0x37'));}if(_0x58254a[_0xf4bf('0xc')]>0x0){return manageTags(_0x3c7a84,_0x58254a,_0x3600f0,_0x3be079,_0x544b5b,_0x32413f,_0x463e44)[_0xf4bf('0xa')](function(){_0x9188e8(_0x544b5b);});}else{_0x9188e8(_0x544b5b);}});};}function emit(_0x560fbd,_0x208b25,_0x3b9a2a){var _0x2b5658='%26sysparm_record_target%3Dincident'+_0xf4bf('0x49')+_0xf4bf('0x4a')+_0xf4bf('0x4b');var _0x26cd43={'uri':_0x560fbd+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3b9a2a+_0x2b5658};io['to'](util[_0xf4bf('0x4c')](_0xf4bf('0x4d'),_0x208b25))[_0xf4bf('0x4e')](_0xf4bf('0x4f'),_0x26cd43);}exports['cs']=function(_0x249011,_0x3217a5,_0x390da8,_0x55d1b2,_0xaa34eb,_0x2d2d1d,_0x2d415d,_0x41112e){var _0x529e03={};var _0x274d05={'user':_0x2d2d1d[_0xf4bf('0x50')],'pass':_0x2d2d1d[_0xf4bf('0x51')]};var _0x2dd237='sysparm_limit=1';var _0x3d8669=_0xf4bf('0x52');_0x2d2d1d['remoteUri']=intUtil['stripTrailingSlash'](_0x2d2d1d[_0xf4bf('0x53')]);_0x2d2d1d[_0xf4bf('0x54')]=intUtil[_0xf4bf('0x55')](_0x2d2d1d[_0xf4bf('0x54')]);var _0x1d3a09=util['format'](_0xf4bf('0x56'),_0x2d2d1d[_0xf4bf('0x53')]);_0x529e03[_0xf4bf('0x16')]=!_[_0xf4bf('0x57')](_0x55d1b2)?_0x55d1b2[_0xf4bf('0x58')]:null;_0x529e03[_0xf4bf('0x1e')]=_0x2d2d1d[_0xf4bf('0x58')];_0x529e03[_0xf4bf('0x22')]=_0x41112e[_0xf4bf('0x2f')]()==='outbound'?_0x3217a5[_0xf4bf('0x59')]:_0x3217a5[_0xf4bf('0x5a')];_0x529e03[_0xf4bf('0x5b')]=_0x41112e===_0xf4bf('0x5c')||_0x41112e===_0xf4bf('0x5d')?_0xf4bf('0x5c'):'outbound';var _0x2b3fbe=util[_0xf4bf('0x4c')](_0xf4bf('0x5e'),_0x2d2d1d[_0xf4bf('0x54')],_0x3217a5[_0xf4bf('0x5f')],md5(_0x3217a5['uniqueid']));if(_0xaa34eb&&_0xaa34eb[_0xf4bf('0x60')]){logger[_0xf4bf('0xf')](_0xf4bf('0x61'),_0xf4bf('0x62'));_0x3217a5[_0xf4bf('0x63')]=_0x2b3fbe;}else if(_0x2d415d&&_0x2d415d[_0xf4bf('0x64')]&&_0x2d415d['recordingFormat']!==_0xf4bf('0x65')){logger[_0xf4bf('0xf')](_0xf4bf('0x66'),'Recording\x20is\x20enabled!');_0x3217a5[_0xf4bf('0x63')]=_0x2b3fbe;}else{_0x3217a5[_0xf4bf('0x63')]='';}return getAdminUser(_0x41112e,_0x274d05,_0x529e03,_0x1d3a09,_0x3d8669,_0x2dd237)[_0xf4bf('0xa')](getUser(_0x41112e,_0x274d05,_0x1d3a09,_0x3d8669,_0x2dd237))[_0xf4bf('0xa')](getEndUser(_0x41112e,_0x274d05,_0x1d3a09,_0x3d8669,_0x2dd237))[_0xf4bf('0xa')](getTicket(_0x41112e,_0x274d05,_0x1d3a09,_0x390da8,_0x3217a5,_0x3d8669))[_0xf4bf('0xa')](function(_0x1caab8){logger[_0xf4bf('0xf')](util[_0xf4bf('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1caab8[_0xf4bf('0x3d')]));logger[_0xf4bf('0xf')](util['format'](_0xf4bf('0x67'),_0x41112e));if(_0x41112e!==_0xf4bf('0x5d')){logger[_0xf4bf('0xf')]('['+[_0x41112e[_0xf4bf('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2d2d1d['remoteUri'],_0x55d1b2[_0xf4bf('0x37')],_0x1caab8['ticketId']);}})['catch'](function(_0x1e0c31){logger['error']('['+[_0x41112e[_0xf4bf('0x10')]()]+_0xf4bf('0x68'),util[_0xf4bf('0x69')](_0x1e0c31,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xf0d6=['../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','sys_id','adminId','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','adminEmail','email','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf0d6,0xdc));var _0x6f0d=function(_0x3f474a,_0xd54130){_0x3f474a=_0x3f474a-0x0;var _0x272589=_0xf0d6[_0x3f474a];return _0x272589;};'use strict';var _=require(_0x6f0d('0x0'));var Promise=require(_0x6f0d('0x1'));var rp=require(_0x6f0d('0x2'));var util=require('util');var md5=require(_0x6f0d('0x3'));var Redis=require(_0x6f0d('0x4'));var intUtil=require('./util');var config=require(_0x6f0d('0x5'));var logger=require(_0x6f0d('0x6'))(_0x6f0d('0x7'));config[_0x6f0d('0x8')]=_[_0x6f0d('0x9')](config['redis'],{'host':_0x6f0d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f0d('0x8')]));function getAdminUser(_0x1e7842,_0x46c45d,_0x46281b,_0x4cc986,_0x33c8c4,_0xef85ab){return new Promise(function(_0x64244f,_0x424b66){var _0x4c0611={'method':_0x6f0d('0xb'),'uri':_0x4cc986+_0x6f0d('0xc')+'&'+_0x33c8c4+'&'+_0xef85ab,'auth':_0x46c45d,'json':!![]};return rp(_0x4c0611)['then'](function(_0x106a2f){if(_0x106a2f[_0x6f0d('0xd')][_0x6f0d('0xe')]>0x0){_0x46281b['adminId']=_0x106a2f['result'][0x0]['sys_id'];}logger[_0x6f0d('0xf')]('['+[_0x1e7842[_0x6f0d('0x10')]()]+_0x6f0d('0x11'),_0x46281b);_0x64244f(_0x46281b);})[_0x6f0d('0x12')](function(_0x5009c9){logger[_0x6f0d('0x13')]('['+[_0x1e7842[_0x6f0d('0x10')]()]+']',_0x5009c9[_0x6f0d('0x14')]);_0x424b66(_0x5009c9[_0x6f0d('0x14')]);});});}function getUser(_0x31c8cd,_0x236deb,_0x5155ef,_0x4abc96,_0x17591f){return function(_0xf62806){logger[_0x6f0d('0xf')]('['+[_0x31c8cd[_0x6f0d('0x10')]()]+_0x6f0d('0x15'),_0xf62806);return new Promise(function(_0xddeeef,_0x144076){if(intUtil[_0x6f0d('0x16')](_0xf62806[_0x6f0d('0x17')])){var _0xbf89a={'method':_0x6f0d('0xb'),'uri':_0x5155ef+_0x6f0d('0x18')+_0xf62806[_0x6f0d('0x17')]+'&'+_0x4abc96+'&'+_0x17591f,'auth':_0x236deb,'json':!![]};logger['info']('['+[_0x31c8cd[_0x6f0d('0x10')]()]+_0x6f0d('0x19'),_0xbf89a);return rp(_0xbf89a)[_0x6f0d('0x1a')](function(_0x54b180){logger[_0x6f0d('0xf')]('['+[_0x31c8cd[_0x6f0d('0x10')]()]+_0x6f0d('0x1b'),_0x54b180);if(_0x54b180[_0x6f0d('0xd')][_0x6f0d('0xe')]>0x0&&String(_0x54b180[_0x6f0d('0xd')][0x0][_0x6f0d('0x1c')])==='true'){_0xf62806[_0x6f0d('0x1d')]=_0x54b180[_0x6f0d('0xd')][0x0][_0x6f0d('0x1e')];}else{_0xf62806['userId']=_0xf62806['adminId'];_0xf62806[_0x6f0d('0x17')]=_0xf62806['adminEmail'];}logger[_0x6f0d('0xf')]('['+[_0x31c8cd['toUpperCase']()]+'],\x20getUser\x20crm',_0xf62806);_0xddeeef(_0xf62806);})[_0x6f0d('0x12')](function(_0x31b820){logger[_0x6f0d('0x13')]('['+[_0x31c8cd[_0x6f0d('0x10')]()]+']',_0x31b820[_0x6f0d('0x14')]);_0x144076(_0x31b820[_0x6f0d('0x14')]);});}else{logger[_0x6f0d('0xf')]('['+[_0x31c8cd[_0x6f0d('0x10')]()]+']\x20using\x20admin\x20profile');_0xf62806[_0x6f0d('0x1d')]=_0xf62806[_0x6f0d('0x1f')];_0xf62806[_0x6f0d('0x17')]=_0xf62806['adminEmail'];_0xddeeef(_0xf62806);}});};}function createEndUser(_0x39c428,_0x4c63be,_0x3c1e94,_0x4f1ca2,_0x19ccb9){logger[_0x6f0d('0xf')]('['+[_0x39c428['toUpperCase']()]+_0x6f0d('0x20'),_0x3c1e94);return new Promise(function(_0x2fe349,_0x316778){var _0x5e0d5e={'method':_0x6f0d('0x21'),'uri':_0x4f1ca2+'sys_user?'+_0x19ccb9,'body':{'user_name':_0x3c1e94[_0x6f0d('0x22')],'roles':_0x6f0d('0x23'),'first_name':_0x3c1e94[_0x6f0d('0x22')],'active':_0x6f0d('0x24'),'date_format':_0x6f0d('0x25'),'phone':_0x3c1e94[_0x6f0d('0x22')]},'auth':_0x4c63be,'json':!![]};return rp(_0x5e0d5e)[_0x6f0d('0x1a')](function(_0x12dd6e){logger[_0x6f0d('0xf')]('['+[_0x39c428[_0x6f0d('0x10')]()]+_0x6f0d('0x26'),_0x12dd6e['result']);_0x3c1e94[_0x6f0d('0x27')]=_0x12dd6e[_0x6f0d('0xd')][_0x6f0d('0x1e')];_0x2fe349(_0x3c1e94);})[_0x6f0d('0x12')](function(_0x4cdbbb){logger[_0x6f0d('0x13')]('['+[_0x39c428[_0x6f0d('0x10')]()]+']',_0x4cdbbb[_0x6f0d('0x14')]);_0x316778(_0x4cdbbb[_0x6f0d('0x14')]);});});}function getEndUser(_0x4f4dd4,_0x22cb11,_0x2a5786,_0x145224,_0x210c33){return function(_0x245ccc){logger[_0x6f0d('0xf')]('['+[_0x4f4dd4[_0x6f0d('0x10')]()]+_0x6f0d('0x28'),_0x245ccc);return new Promise(function(_0x3d3cb0,_0x59a410){var _0x2d5572={'method':_0x6f0d('0xb'),'uri':_0x2a5786+_0x6f0d('0x29')+_0x245ccc[_0x6f0d('0x22')]+'&'+_0x145224+'&'+_0x210c33,'auth':_0x22cb11,'json':!![]};return rp(_0x2d5572)[_0x6f0d('0x1a')](function(_0x20b43a){if(_0x20b43a['result'][_0x6f0d('0xe')]>0x0){_0x245ccc[_0x6f0d('0x27')]=_0x20b43a[_0x6f0d('0xd')][0x0]['sys_id'];logger[_0x6f0d('0xf')]('['+[_0x4f4dd4[_0x6f0d('0x10')]()]+_0x6f0d('0x2a'),_0x245ccc);_0x3d3cb0(_0x245ccc);}else{return createEndUser(_0x4f4dd4,_0x22cb11,_0x245ccc,_0x2a5786,_0x145224)[_0x6f0d('0x1a')](function(_0x1f8485){logger['info']('['+[_0x4f4dd4[_0x6f0d('0x10')]()]+_0x6f0d('0x2b'),_0x1f8485);_0x3d3cb0(_0x1f8485);});}})['catch'](function(_0x28692a){logger[_0x6f0d('0x13')]('['+[_0x4f4dd4[_0x6f0d('0x10')]()]+']',_0x28692a[_0x6f0d('0x14')]);_0x59a410(_0x28692a[_0x6f0d('0x14')]);});});};}function getCustomFields(_0x462210,_0x4d2c88){var _0x28b14e={};if(_0x462210[_0x6f0d('0xe')]>0x0){_[_0x6f0d('0x2c')](_0x462210,function(_0x5c0dea){if(_[_0x6f0d('0x2d')]([_0x6f0d('0x2e'),_0x6f0d('0x2f')],_0x5c0dea['type'])&&_0x5c0dea[_0x6f0d('0x30')]&&!_0x5c0dea[_0x6f0d('0x31')]){_0x28b14e[_0x5c0dea[_0x6f0d('0x30')][_0x6f0d('0x32')]()]=_0x5c0dea[_0x6f0d('0x33')]['toString']();}else if(_[_0x6f0d('0x2d')]([_0x6f0d('0x2e'),_0x6f0d('0x2f')],_0x5c0dea[_0x6f0d('0x34')])&&_0x5c0dea[_0x6f0d('0x35')]&&_0x5c0dea[_0x6f0d('0x31')]){_0x28b14e[_0x5c0dea[_0x6f0d('0x35')][_0x6f0d('0x32')]()]=_0x5c0dea[_0x6f0d('0x33')][_0x6f0d('0x36')]();}else if(_0x5c0dea[_0x6f0d('0x34')]===_0x6f0d('0x37')&&_0x5c0dea[_0x6f0d('0x38')]&&_0x5c0dea[_0x6f0d('0x35')]&&_0x5c0dea[_0x6f0d('0x31')]){_0x28b14e[_0x5c0dea['idField'][_0x6f0d('0x32')]()]=_0x4d2c88[_0x5c0dea['variableName']][_0x6f0d('0x36')]();}else if(_0x5c0dea[_0x6f0d('0x34')]===_0x6f0d('0x39')&&_0x5c0dea['Variable']&&_0x5c0dea[_0x6f0d('0x3a')][_0x6f0d('0x3b')]&&_0x5c0dea['idField']&&_0x5c0dea['customField']){_0x28b14e[_0x5c0dea[_0x6f0d('0x35')]['toLowerCase']()]=_0x4d2c88[_0x5c0dea[_0x6f0d('0x3a')][_0x6f0d('0x3b')][_0x6f0d('0x32')]()][_0x6f0d('0x36')]();}});}return _0x28b14e;}function getTicket(_0x14f772,_0x3a39e2,_0x3ccf9f,_0x5abc38,_0x2d0503,_0xd5b47){return function(_0x170f70){logger[_0x6f0d('0xf')]('['+[_0x14f772[_0x6f0d('0x10')]()]+_0x6f0d('0x3c'),_0x170f70);return new Promise(function(_0x1f7cf6,_0x42838a){var _0x562976=_0x14f772[_0x6f0d('0x32')]()==='outbound'?_0x170f70[_0x6f0d('0x1d')]:_0x170f70['endUserId'];var _0x34548a={'method':'POST','uri':_0x3ccf9f+'incident'+'?'+_0xd5b47,'body':Object[_0x6f0d('0x3d')]({},{'active':_0x6f0d('0x24'),'caller_id':_0x562976,'assigned_to':_0x170f70[_0x6f0d('0x1d')],'short_description':intUtil[_0x6f0d('0x3e')](_0x5abc38[_0x6f0d('0x3f')],_0x2d0503,'\x20'),'description':intUtil[_0x6f0d('0x3e')](_0x5abc38['Descriptions'],_0x2d0503,'\x0a')},getCustomFields(_0x5abc38['Fields'],_0x2d0503)),'auth':_0x3a39e2,'json':!![]};return rp(_0x34548a)[_0x6f0d('0x1a')](function(_0xbaf4ba){logger['info']('['+[_0x14f772['toUpperCase']()]+_0x6f0d('0x40'),_0xbaf4ba[_0x6f0d('0xd')]);_0x170f70[_0x6f0d('0x41')]=_0xbaf4ba[_0x6f0d('0xd')][_0x6f0d('0x1e')];_0x170f70[_0x6f0d('0x42')]=_0xbaf4ba[_0x6f0d('0xd')][_0x6f0d('0x43')];logger[_0x6f0d('0xf')]('['+[_0x14f772['toUpperCase']()]+_0x6f0d('0x44'),_0x170f70);_0x1f7cf6(_0x170f70);})[_0x6f0d('0x12')](function(_0xe8e568){logger[_0x6f0d('0x13')]('['+[_0x14f772[_0x6f0d('0x10')]()]+']',_0xe8e568[_0x6f0d('0x14')]);_0x42838a(_0xe8e568[_0x6f0d('0x14')]);});});};}function createRemoteTag(_0x1e7ede,_0x3ed257,_0x5a0f4f,_0xbb951a){return new Promise(function(_0x3f961f,_0x51503d){var _0x3f732={'method':_0x6f0d('0x21'),'uri':_0x5a0f4f+_0x6f0d('0x45')+'?'+_0xbb951a,'body':{'short_description':_0x1e7ede,'global':!![],'active':!![],'name':_0x1e7ede},'auth':_0x3ed257,'json':!![]};return rp(_0x3f732)['then'](function(_0xd8773c){var _0x162680=_0xd8773c['result'][_0x6f0d('0x1e')];_0x3f961f(_0x162680);});});}function getRemoteTag(_0x191463,_0x440062,_0x2a685e,_0x530439,_0xfb51e5){return new Promise(function(_0x1108b6,_0x595e1c){var _0x496547={'method':_0x6f0d('0xb'),'uri':_0x2a685e+_0x6f0d('0x45')+_0x6f0d('0x46')+_0x191463+'&'+_0x530439,'auth':_0x440062,'json':!![]};return rp(_0x496547)[_0x6f0d('0x1a')](function(_0x848f65){if(_0x848f65['result'][_0x6f0d('0xe')]>0x0){var _0x1f7df8=_0x848f65['result'][0x0][_0x6f0d('0x1e')];_0x1108b6(_0x1f7df8);}else{return createRemoteTag(_0x191463,_0x440062,_0x2a685e,_0x530439)[_0x6f0d('0x1a')](function(_0x42f652){_0x1108b6(_0x42f652);});}});});}function assignTagToIncident(_0x3d085b,_0x47937f,_0x4daece,_0x4333aa,_0xe1c958){return new Promise(function(_0x28031c,_0x2d89b9){var _0x1ad971={'method':_0x6f0d('0x21'),'uri':_0x4daece+_0x6f0d('0x47')+'?'+_0xe1c958,'body':{'label':_0x3d085b,'table':'incident','id_type':_0x6f0d('0x48'),'table_key':_0x4333aa[_0x6f0d('0x41')],'title':_0x6f0d('0x49')+_0x4333aa[_0x6f0d('0x42')],'id_display':_0x4333aa[_0x6f0d('0x42')]},'auth':_0x47937f,'json':!![]};return rp(_0x1ad971)[_0x6f0d('0x1a')](function(_0x5902b1){_0x28031c();})['catch'](function(){_0x28031c();});});}function manageTags(_0x532468,_0x247900,_0x4065a4,_0xd25921,_0x1a5338,_0x21203c,_0x578e70){return new Promise(function(_0xd6c603,_0x55ae13){var _0x52f5d2=[];_0x247900[_0x6f0d('0x2c')](function(_0x3a49c6){_0x52f5d2[_0x6f0d('0x4a')](getRemoteTag(_0x3a49c6,_0x4065a4,_0xd25921,_0x21203c,_0x578e70));});return Promise[_0x6f0d('0x4b')](_0x52f5d2)[_0x6f0d('0x1a')](function(_0x47e286){if(_0x47e286[_0x6f0d('0xe')]){logger[_0x6f0d('0xf')]('['+[_0x532468[_0x6f0d('0x10')]()]+_0x6f0d('0x4c'),_0x47e286);var _0x34c835=[];_0x47e286[_0x6f0d('0x2c')](function(_0x445a9c){_0x34c835['push'](assignTagToIncident(_0x445a9c,_0x4065a4,_0xd25921,_0x1a5338,_0x21203c));});return Promise['all'](_0x34c835)[_0x6f0d('0x1a')](function(){_0xd6c603();})[_0x6f0d('0x12')](function(){_0xd6c603();});}else{_0xd6c603();}});});}function getTags(_0x2f007d,_0x944fff,_0x16a9f3,_0x28f9c4,_0x2e464e,_0x1ac646){return function(_0x117cb0){return new Promise(function(_0x218c0a,_0x9bc13f){var _0x3a13db=[];var _0x479057=_0x28f9c4['Tags'];if(_0x479057&&_0x479057[_0x6f0d('0xe')]>0x0){_0x3a13db=_[_0x6f0d('0x4d')](_0x479057,_0x6f0d('0x3b'));}if(_0x3a13db[_0x6f0d('0xe')]>0x0){return manageTags(_0x2f007d,_0x3a13db,_0x944fff,_0x16a9f3,_0x117cb0,_0x2e464e,_0x1ac646)[_0x6f0d('0x1a')](function(){_0x218c0a(_0x117cb0);});}else{_0x218c0a(_0x117cb0);}});};}function emit(_0x488649,_0x27409b,_0x3b6acb){var _0x546a3f=_0x6f0d('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x6f0d('0x4f');var _0x2fb4de={'uri':_0x488649+_0x6f0d('0x50')+_0x3b6acb+_0x546a3f};io['to'](util[_0x6f0d('0x51')](_0x6f0d('0x52'),_0x27409b))[_0x6f0d('0x53')](_0x6f0d('0x54'),_0x2fb4de);}exports['cs']=function(_0x19b3be,_0x5b3333,_0x502a1d,_0x48b8fc,_0x23eb82,_0x258e70,_0x17acbe,_0x3b8c2e){var _0x235fc4={};var _0x25c882={'user':_0x258e70[_0x6f0d('0x55')],'pass':_0x258e70['password']};var _0x2a8570=_0x6f0d('0x56');var _0x26fa88=_0x6f0d('0x57');_0x258e70['remoteUri']=intUtil[_0x6f0d('0x58')](_0x258e70[_0x6f0d('0x59')]);_0x258e70[_0x6f0d('0x5a')]=intUtil[_0x6f0d('0x58')](_0x258e70[_0x6f0d('0x5a')]);var _0x190d02=util[_0x6f0d('0x51')](_0x6f0d('0x5b'),_0x258e70[_0x6f0d('0x59')]);_0x235fc4[_0x6f0d('0x17')]=!_[_0x6f0d('0x5c')](_0x48b8fc)?_0x48b8fc['email']:null;_0x235fc4[_0x6f0d('0x5d')]=_0x258e70[_0x6f0d('0x5e')];_0x235fc4['endUserNumber']=_0x3b8c2e[_0x6f0d('0x32')]()==='outbound'?_0x5b3333[_0x6f0d('0x5f')]:_0x5b3333[_0x6f0d('0x60')];_0x235fc4[_0x6f0d('0x61')]=_0x3b8c2e===_0x6f0d('0x62')||_0x3b8c2e==='unmanaged'?'queue':_0x6f0d('0x63');var _0x2f1876=util[_0x6f0d('0x51')](_0x6f0d('0x64'),_0x258e70['serverUrl'],_0x5b3333[_0x6f0d('0x65')],md5(_0x5b3333[_0x6f0d('0x65')]));if(_0x23eb82&&_0x23eb82[_0x6f0d('0x66')]){logger[_0x6f0d('0xf')](_0x6f0d('0x67'),_0x6f0d('0x68'));_0x5b3333[_0x6f0d('0x69')]=_0x2f1876;}else if(_0x17acbe&&_0x17acbe['recordingFormat']&&_0x17acbe[_0x6f0d('0x6a')]!=='none'){logger['info'](_0x6f0d('0x6b'),_0x6f0d('0x68'));_0x5b3333['recordingURL']=_0x2f1876;}else{_0x5b3333[_0x6f0d('0x69')]='';}return getAdminUser(_0x3b8c2e,_0x25c882,_0x235fc4,_0x190d02,_0x26fa88,_0x2a8570)[_0x6f0d('0x1a')](getUser(_0x3b8c2e,_0x25c882,_0x190d02,_0x26fa88,_0x2a8570))[_0x6f0d('0x1a')](getEndUser(_0x3b8c2e,_0x25c882,_0x190d02,_0x26fa88,_0x2a8570))[_0x6f0d('0x1a')](getTicket(_0x3b8c2e,_0x25c882,_0x190d02,_0x502a1d,_0x5b3333,_0x26fa88))[_0x6f0d('0x1a')](function(_0x14b348){logger[_0x6f0d('0xf')](util[_0x6f0d('0x51')](_0x6f0d('0x6c'),_0x14b348[_0x6f0d('0x41')]));logger[_0x6f0d('0xf')](util[_0x6f0d('0x51')](_0x6f0d('0x6d'),_0x3b8c2e));if(_0x3b8c2e!==_0x6f0d('0x6e')){logger[_0x6f0d('0xf')]('['+[_0x3b8c2e[_0x6f0d('0x10')]()]+']',_0x6f0d('0x6f'));emit(_0x258e70[_0x6f0d('0x59')],_0x48b8fc[_0x6f0d('0x3b')],_0x14b348[_0x6f0d('0x41')]);}})[_0x6f0d('0x12')](function(_0x4f9b3e){logger[_0x6f0d('0x13')]('['+[_0x3b8c2e['toUpperCase']()]+_0x6f0d('0x70'),util['inspect'](_0x4f9b3e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index caa1555..6ff5515 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2352=['../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_type','parent_name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','value','resolve','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','forEach','string','nameField','customField','toLowerCase','type','custom_fields','idField','content','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','lodash','request-promise','bluebird','util','ioredis','./util'];(function(_0x2e505b,_0x47475c){var _0xe177c4=function(_0x33d158){while(--_0x33d158){_0x2e505b['push'](_0x2e505b['shift']());}};_0xe177c4(++_0x47475c);}(_0x2352,0x1e2));var _0x2235=function(_0x5dd5c3,_0x5e5226){_0x5dd5c3=_0x5dd5c3-0x0;var _0x32ec5d=_0x2352[_0x5dd5c3];return _0x32ec5d;};'use strict';var _=require(_0x2235('0x0'));var rp=require(_0x2235('0x1'));var BPromise=require(_0x2235('0x2'));var md5=require('md5');var util=require(_0x2235('0x3'));var Redis=require(_0x2235('0x4'));var intUtil=require(_0x2235('0x5'));var config=require(_0x2235('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x2235('0x7')]=_[_0x2235('0x8')](config[_0x2235('0x7')],{'host':_0x2235('0x9'),'port':0x18eb});var io=require(_0x2235('0xa'))(new Redis(config[_0x2235('0x7')]));var def={'method':_0x2235('0xb'),'json':!![]};function emit(_0x20740f,_0x45c1dd,_0x3717f1){io['to'](_0x20740f)['emit'](_0x45c1dd,_0x3717f1);}function getTicket(_0x4bd32c,_0x3c898d,_0x574ac8,_0x4badeb,_0x4ad65b,_0x2cea11,_0x3a2174,_0x3ab429){logger['info'](_0x2235('0xc'));var _0x36d9d7=new Date();var _0x958be6=[{'name':_0x2235('0xd'),'value':intUtil[_0x2235('0xe')](_0x4badeb[_0x2235('0xf')],_0x4ad65b,'\x20')},{'name':'assigned_user_id','value':_0x3c898d['id']},{'name':_0x2235('0x10'),'value':_0x3c898d['id']},{'name':'description','value':intUtil[_0x2235('0xe')](_0x4badeb[_0x2235('0x11')],_0x4ad65b,'\x0a')},{'name':_0x2235('0x12'),'value':_0x36d9d7['toISOString']()[_0x2235('0x13')](0x0,0x13)[_0x2235('0x14')]('T','\x20')},{'name':_0x2235('0x15'),'value':'0'},{'name':_0x2235('0x16'),'value':'15'},{'name':'parent_id','value':_0x574ac8['id']},{'name':_0x2235('0x17'),'value':'Contacts'},{'name':_0x2235('0x18'),'value':_0x574ac8[_0x2235('0xd')]},{'name':_0x2235('0x19'),'value':_0x3ab429}];if(_0x2cea11[_0x2235('0x1a')]){_['forEach'](_0x2cea11,function(_0x438aa0){if(_0x4ad65b[_0x438aa0[_0x2235('0x1b')]]){_0x958be6[_0x2235('0x1c')]({'name':_0x438aa0['idField'],'value':_0x4ad65b[_0x438aa0[_0x2235('0x1b')]]});}});}return request({'form':{'method':_0x2235('0x1d'),'input_type':_0x2235('0x1e'),'response_type':'JSON','rest_data':JSON[_0x2235('0x1f')]({'session':_0x3a2174['id'],'module_name':_0x2235('0x20'),'name_value_list':_0x958be6})}});}function getAuth(_0x41ac56){return util[_0x2235('0x21')](_0x2235('0x22'),new Buffer(_0x41ac56[_0x2235('0x23')]+':X')[_0x2235('0x24')]('base64'));}function getServerInfo(_0xe7a03f){return request({'form':{'method':_0x2235('0x25'),'input_type':_0x2235('0x1e'),'response_type':_0x2235('0x1e'),'rest_data':JSON['stringify']({'session':_0xe7a03f['id']})}});}function getUser(_0x386e9f,_0x1b3be4,_0x3442b7){if(!_[_0x2235('0x26')](_0x1b3be4)){logger[_0x2235('0x27')](_0x2235('0x28'),_0x1b3be4);return request({'form':{'method':'get_entry_list','input_type':_0x2235('0x1e'),'response_type':_0x2235('0x1e'),'rest_data':JSON['stringify']({'session':_0x3442b7['id'],'module_name':_0x2235('0x29'),'query':util[_0x2235('0x21')](_0x2235('0x2a'),_0x1b3be4),'order_by':'','offset':'0','select_fields':['id',_0x2235('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2235('0x2b')](function(_0x1487b9){if(_0x1487b9[_0x2235('0x2c')][_0x2235('0x1a')]){var _0x4ab3cd=_[_0x2235('0x2d')](_0x1487b9['entry_list'],function(_0x20718c){return _0x20718c[_0x2235('0x2e')]['user_name'][_0x2235('0x2f')]===_0x1b3be4;});if(_0x4ab3cd){logger[_0x2235('0x27')]('Agent\x20found!');return BPromise[_0x2235('0x30')]({'id':_0x4ab3cd[_0x2235('0x2e')]['id'][_0x2235('0x2f')],'name':_0x4ab3cd[_0x2235('0x2e')][_0x2235('0xd')][_0x2235('0x2f')]});}}logger[_0x2235('0x27')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2235('0x30')]({'id':_0x3442b7[_0x2235('0x2e')]['user_id'][_0x2235('0x2f')],'name':_0x3442b7[_0x2235('0x2e')][_0x2235('0x31')][_0x2235('0x2f')]});});}else{logger[_0x2235('0x27')](_0x2235('0x32'));return BPromise[_0x2235('0x30')]({'id':_0x3442b7[_0x2235('0x2e')][_0x2235('0x33')][_0x2235('0x2f')],'name':_0x3442b7[_0x2235('0x2e')][_0x2235('0x31')][_0x2235('0x2f')]});}}function getEndUser(_0x31fc26,_0x2e7275,_0x10c6ec,_0xfcbc8b){logger[_0x2235('0x27')](_0x2235('0x34'),_0x10c6ec);return request({'form':{'method':_0x2235('0x35'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2235('0x1f')]({'session':_0xfcbc8b['id'],'module_name':_0x2235('0x36'),'query':util[_0x2235('0x21')](_0x2235('0x37'),_0x10c6ec),'order_by':'','offset':'0','select_fields':['id',_0x2235('0xd'),_0x2235('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2235('0x2b')](function(_0xa0a005){if(_0xa0a005[_0x2235('0x2c')][_0x2235('0x1a')]){var _0xd7edc2=_[_0x2235('0x2d')](_0xa0a005[_0x2235('0x2c')],function(_0x341501){return _0x341501[_0x2235('0x2e')][_0x2235('0x38')][_0x2235('0x2f')]===_0x10c6ec;});if(_0xd7edc2){logger[_0x2235('0x27')]('Enduser\x20found!');return BPromise['resolve']({'id':_0xd7edc2['name_value_list']['id'][_0x2235('0x2f')],'name':_0xd7edc2[_0x2235('0x2e')]['name'][_0x2235('0x2f')],'phone':_0xd7edc2['name_value_list']['phone_home'][_0x2235('0x2f')]});}}else{logger[_0x2235('0x27')](_0x2235('0x39'));return request({'form':{'method':_0x2235('0x1d'),'input_type':_0x2235('0x1e'),'response_type':_0x2235('0x1e'),'rest_data':JSON[_0x2235('0x1f')]({'session':_0xfcbc8b['id'],'module_name':'Contacts','name_value_list':[{'name':_0x2235('0x3a'),'value':_0x2e7275!==_0x2235('0x3b')?_0x2e7275:util['format'](_0x2235('0x3c'),_0x10c6ec)},{'name':_0x2235('0x38'),'value':_0x10c6ec}]})}})[_0x2235('0x2b')](function(_0x1ad8e1){logger[_0x2235('0x27')](_0x2235('0x3d'));return BPromise[_0x2235('0x30')]({'id':_0x1ad8e1['id'],'name':_0x1ad8e1[_0x2235('0x2c')][_0x2235('0x3a')][_0x2235('0x2f')],'phone':_0x1ad8e1[_0x2235('0x2c')][_0x2235('0x38')]['value']});});}});}function request(_0x13e022){logger[_0x2235('0x3e')](_0x2235('0x3f'),JSON['stringify'](_0x13e022));return rp(_['merge'](def,_0x13e022));}function getTags(_0x57ccd1,_0x526ee7){var _0x100646=[];if(_0x57ccd1&&_0x57ccd1[_0x2235('0x1a')]>0x0){_0x100646=_['map'](_0x57ccd1,_0x526ee7);}return _0x100646;}function getCustomFields(_0x21317e,_0xdf7774){var _0x202170=[];var _0x49cc18={'custom_fields':[]};if(_0x21317e['length']>0x0){_[_0x2235('0x40')](_0x21317e,function(_0x17d0f1){if(_0x17d0f1['type']===_0x2235('0x41')&&_0x17d0f1[_0x2235('0x42')]&&!_0x17d0f1[_0x2235('0x43')]){_0x49cc18[_0x17d0f1[_0x2235('0x42')][_0x2235('0x44')]()]=_0x17d0f1['content'][_0x2235('0x24')]();}else if(_0x17d0f1[_0x2235('0x45')]===_0x2235('0x41')&&_0x17d0f1['idField']&&_0x17d0f1[_0x2235('0x43')]){_0x49cc18[_0x2235('0x46')]['push']({'id':_0x17d0f1[_0x2235('0x47')],'value':_0x17d0f1[_0x2235('0x48')][_0x2235('0x24')]()});}else if(_0x17d0f1['type']===_0x2235('0x49')&&_0x17d0f1[_0x2235('0x1b')]&&_0x17d0f1[_0x2235('0x47')]&&_0x17d0f1[_0x2235('0x43')]){_0xdf7774[_0x17d0f1[_0x2235('0x1b')]]&&_0x49cc18[_0x2235('0x46')][_0x2235('0x1c')]({'id':_0x17d0f1[_0x2235('0x47')],'value':_0xdf7774[_0x17d0f1[_0x2235('0x1b')]]['toString']()});}else if(_0x17d0f1[_0x2235('0x45')]===_0x2235('0x4a')&&_0x17d0f1[_0x2235('0x4b')]&&_0x17d0f1[_0x2235('0x4b')][_0x2235('0xd')]&&_0x17d0f1[_0x2235('0x47')]&&_0x17d0f1['customField']){_0xdf7774[_0x17d0f1[_0x2235('0x4b')][_0x2235('0xd')][_0x2235('0x44')]()]&&_0x49cc18[_0x2235('0x46')][_0x2235('0x1c')]({'id':_0x17d0f1[_0x2235('0x47')],'value':_0xdf7774[_0x17d0f1[_0x2235('0x4b')][_0x2235('0xd')]['toLowerCase']()][_0x2235('0x24')]()});}});}return _0x49cc18;}function getConnection(_0xac7805){return request({'method':_0x2235('0xb'),'form':{'method':_0x2235('0x4c'),'input_type':_0x2235('0x1e'),'response_type':_0x2235('0x1e'),'rest_data':JSON[_0x2235('0x1f')]({'user_auth':{'user_name':_0xac7805['username'],'password':_0xac7805[_0x2235('0x4d')],'encryption':_0x2235('0x4e')},'application':_0x2235('0x4f')})}})[_0x2235('0x2b')](function(_0x25907e){var _0x370a7=_0x25907e;if(_0x370a7['id']){def[_0x2235('0x50')]=_0x370a7['id'];return BPromise['resolve'](_0x370a7);}else{throw new Error(util[_0x2235('0x21')](_0x2235('0x51'),_0xac7805['id']));}});}function setRelationship(_0x1569b1,_0x208ea1,_0x29a95e,_0xcf2026){return request({'form':{'method':_0x2235('0x52'),'input_type':_0x2235('0x1e'),'response_type':'JSON','rest_data':JSON[_0x2235('0x1f')]({'session':_0x1569b1['id'],'module_name':_0x2235('0x20'),'module_id':_0x29a95e['id'],'link_field_name':_0xcf2026,'related_ids':[_0x208ea1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2235('0x53')]=function(_0x1c37d9,_0x48d9c4,_0x12a18c,_0x51cee9,_0xfaaf2f,_0x162c35){var _0x322b6e,_0x49ab49,_0x4c95c0,_0x1b4734;_0x162c35[_0x2235('0x54')]=intUtil[_0x2235('0x55')](_0x162c35[_0x2235('0x54')]);_0x162c35[_0x2235('0x56')]=intUtil['stripTrailingSlash'](_0x162c35[_0x2235('0x56')]);def[_0x2235('0x57')]=util[_0x2235('0x21')](_0x2235('0x58'),_0x162c35['remoteUri']);if(_0xfaaf2f&&_0xfaaf2f[_0x2235('0x59')]){logger[_0x2235('0x27')](_0x2235('0x5a'),'Recording\x20is\x20enabled!');_0x48d9c4[_0x2235('0x5b')]=util[_0x2235('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x162c35[_0x2235('0x56')],_0x48d9c4[_0x2235('0x5c')],md5(_0x48d9c4[_0x2235('0x5c')]));}else{_0x48d9c4[_0x2235('0x5b')]='';}return getConnection(_0x162c35)[_0x2235('0x2b')](function(_0x5b52f3){_0x1b4734=_0x5b52f3;return getUser(_0x162c35,_0x51cee9[_0x2235('0xd')],_0x1b4734);})[_0x2235('0x2b')](function(_0x1309e7){_0x322b6e=_0x1309e7;logger[_0x2235('0x27')]('The\x20User\x20ID\x20is:',_0x322b6e['id']);return getEndUser(_0x162c35,_0x48d9c4[_0x2235('0x5d')],_0x48d9c4[_0x2235('0x5e')],_0x1b4734);})[_0x2235('0x2b')](function(_0x15e215){_0x49ab49=_0x15e215;logger[_0x2235('0x27')](_0x2235('0x5f'),_0x49ab49['id']);return getTicket(_0x162c35,_0x322b6e,_0x49ab49,_0x12a18c,_0x48d9c4,_0x12a18c[_0x2235('0x60')],_0x1b4734,_0x2235('0x61'));})[_0x2235('0x2b')](function(_0xb7f1ab){_0x4c95c0=_0xb7f1ab;logger[_0x2235('0x27')](_0x2235('0x62'));logger[_0x2235('0x27')](_0x2235('0x63'),_0x4c95c0['id']);return setRelationship(_0x1b4734,_0x322b6e,_0x4c95c0,'users');})[_0x2235('0x2b')](function(){return setRelationship(_0x1b4734,_0x49ab49,_0x4c95c0,_0x2235('0x64'));})[_0x2235('0x2b')](function(){return getServerInfo(_0x1b4734);})['then'](function(_0xedbd78){var _0x45863f=parseInt(_0xedbd78[_0x2235('0x65')][_0x2235('0x66')](0x0));var _0x4f7103=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x162c35['remoteUri'],_0x4c95c0['id']);if(_0x45863f>0x6){_0x4f7103=util[_0x2235('0x21')](_0x2235('0x67'),_0x162c35[_0x2235('0x54')],_0x4c95c0['id']);}logger[_0x2235('0x27')](_0x2235('0x5a'),_0x2235('0x68'));emit(util['format'](_0x2235('0x69'),_0x51cee9['name']),_0x2235('0x6a'),{'uri':_0x4f7103});})[_0x2235('0x6b')](function(_0x2721f0){logger['error']('[QUEUE]',JSON[_0x2235('0x1f')](_0x2721f0));});};exports[_0x2235('0x6c')]=function(_0x20f9b2,_0x1f990e,_0x1e6172,_0x589fe9,_0x3ded19,_0xdc7a1e,_0x28f099){var _0x3b2412,_0x2bf779,_0x10b3ee,_0x28b094;_0xdc7a1e[_0x2235('0x54')]=intUtil[_0x2235('0x55')](_0xdc7a1e[_0x2235('0x54')]);_0xdc7a1e['serverUrl']=intUtil[_0x2235('0x55')](_0xdc7a1e['serverUrl']);def['uri']=util[_0x2235('0x21')]('%s/service/v4_1/rest.php',_0xdc7a1e[_0x2235('0x54')]);if(_0x28f099&&_0x28f099['recordingFormat']&&_0x28f099[_0x2235('0x6d')]!=='none'){logger[_0x2235('0x27')](_0x2235('0x6e'),_0x2235('0x6f'));_0x1f990e[_0x2235('0x5b')]=util[_0x2235('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xdc7a1e[_0x2235('0x56')],_0x1f990e['uniqueid'],md5(_0x1f990e['uniqueid']));}return getConnection(_0xdc7a1e)[_0x2235('0x2b')](function(_0xb87d10){_0x28b094=_0xb87d10;return getUser(_0xdc7a1e,_0x589fe9['name'],_0x28b094);})[_0x2235('0x2b')](function(_0x56aa29){_0x3b2412=_0x56aa29;logger[_0x2235('0x27')]('The\x20User\x20ID\x20is:',_0x3b2412['id']);return getEndUser(_0xdc7a1e,_0x1f990e[_0x2235('0x70')],_0x1f990e[_0x2235('0x71')],_0x28b094);})[_0x2235('0x2b')](function(_0x570579){_0x2bf779=_0x570579;logger[_0x2235('0x27')](_0x2235('0x5f'),_0x2bf779['id']);return getTicket(_0xdc7a1e,_0x3b2412,_0x2bf779,_0x1e6172,_0x1f990e,_0x1e6172[_0x2235('0x60')],_0x28b094,_0x2235('0x72'));})[_0x2235('0x2b')](function(_0x290482){_0x10b3ee=_0x290482;logger['info'](_0x2235('0x62'));logger['info'](_0x2235('0x63'),_0x10b3ee['id']);return setRelationship(_0x28b094,_0x3b2412,_0x10b3ee,_0x2235('0x73'));})[_0x2235('0x2b')](function(){return setRelationship(_0x28b094,_0x2bf779,_0x10b3ee,_0x2235('0x64'));})[_0x2235('0x2b')](function(){return getServerInfo(_0x28b094);})[_0x2235('0x2b')](function(_0x1581bc){var _0xfc88ff=parseInt(_0x1581bc[_0x2235('0x65')][_0x2235('0x66')](0x0));var _0x41ffb7=util[_0x2235('0x21')](_0x2235('0x74'),_0xdc7a1e[_0x2235('0x54')],_0x10b3ee['id']);if(_0xfc88ff>0x6){_0x41ffb7=util[_0x2235('0x21')](_0x2235('0x67'),_0xdc7a1e[_0x2235('0x54')],_0x10b3ee['id']);}logger['info'](_0x2235('0x6e'),_0x2235('0x68'));emit(util[_0x2235('0x21')](_0x2235('0x69'),_0x589fe9[_0x2235('0xd')]),_0x2235('0x6a'),{'uri':_0x41ffb7});})[_0x2235('0x6b')](function(_0x3ea15c){logger['error'](_0x2235('0x6e'),JSON[_0x2235('0x1f')](_0x3ea15c));});};exports[_0x2235('0x75')]=function(_0x42a0ab,_0x55a1c5,_0x2f1d1c,_0x86bb99,_0x57ca6d,_0x3ccc46){var _0xd46668,_0x4a1679,_0x3c6c21,_0xdff38f;_0x3ccc46['remoteUri']=intUtil[_0x2235('0x55')](_0x3ccc46[_0x2235('0x54')]);_0x3ccc46['serverUrl']=intUtil['stripTrailingSlash'](_0x3ccc46['serverUrl']);def['uri']=util[_0x2235('0x21')](_0x2235('0x58'),_0x3ccc46[_0x2235('0x54')]);if(_0x57ca6d&&_0x57ca6d[_0x2235('0x59')]){logger[_0x2235('0x27')]('['+_0x55a1c5[_0x2235('0x76')][_0x2235('0x77')]()+']',_0x2235('0x6f'));_0x55a1c5[_0x2235('0x5b')]=util[_0x2235('0x21')](_0x2235('0x78'),_0x3ccc46[_0x2235('0x56')],_0x55a1c5[_0x2235('0x5c')],md5(_0x55a1c5['uniqueid']));}else{_0x55a1c5[_0x2235('0x5b')]='';}return getConnection(_0x3ccc46)[_0x2235('0x2b')](function(_0x305556){_0xdff38f=_0x305556;if(!_[_0x2235('0x26')](_0x86bb99)){return getUser(_0x3ccc46,_0x86bb99[_0x2235('0xd')],_0xdff38f);}else{return getUser(_0x3ccc46,null,_0xdff38f);}})['then'](function(_0x2ac516){_0xd46668=_0x2ac516;logger[_0x2235('0x27')](_0x2235('0x79'),_0xd46668['id']);return getEndUser(_0x3ccc46,_0x55a1c5[_0x2235('0x5d')],_0x55a1c5[_0x2235('0x5e')],_0xdff38f);})['then'](function(_0x5e7b1a){_0x4a1679=_0x5e7b1a;logger['info'](_0x2235('0x5f'),_0x4a1679['id']);return getTicket(_0x3ccc46,_0xd46668,_0x4a1679,_0x2f1d1c,_0x55a1c5,_0x2f1d1c[_0x2235('0x60')],_0xdff38f,_0x2235('0x61'));})[_0x2235('0x2b')](function(_0x3caa63){_0x3c6c21=_0x3caa63;logger['info']('Ticket\x20created!');logger['info'](_0x2235('0x63'),_0x3c6c21['id']);return setRelationship(_0xdff38f,_0xd46668,_0x3c6c21,_0x2235('0x73'));})[_0x2235('0x2b')](function(){return setRelationship(_0xdff38f,_0x4a1679,_0x3c6c21,'contacts');})[_0x2235('0x2b')](function(){return getServerInfo(_0xdff38f);})[_0x2235('0x6b')](function(_0x2bb14b){logger['error']('['+_0x55a1c5[_0x2235('0x76')]['toUpperCase']()+']',JSON[_0x2235('0x1f')](_0x2bb14b));});};
\ No newline at end of file
+var _0xd41b=['bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','Calls','format','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','string','nameField','customField','content','toString','custom_fields','type','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','remoteUri','stripTrailingSlash','uri','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','contacts','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','[OUTBOUND]','catch','unmanaged','monitor_format','lastevent','Fields','lodash','request-promise'];(function(_0x2acca4,_0x2bf35d){var _0x3a7b1d=function(_0x1a3f98){while(--_0x1a3f98){_0x2acca4['push'](_0x2acca4['shift']());}};_0x3a7b1d(++_0x2bf35d);}(_0xd41b,0x169));var _0xbd41=function(_0x3423a5,_0x4cb48d){_0x3423a5=_0x3423a5-0x0;var _0x35469e=_0xd41b[_0x3423a5];return _0x35469e;};'use strict';var _=require(_0xbd41('0x0'));var rp=require(_0xbd41('0x1'));var BPromise=require(_0xbd41('0x2'));var md5=require(_0xbd41('0x3'));var util=require(_0xbd41('0x4'));var Redis=require(_0xbd41('0x5'));var intUtil=require(_0xbd41('0x6'));var config=require(_0xbd41('0x7'));var logger=require('../../../../config/logger')(_0xbd41('0x8'));config[_0xbd41('0x9')]=_[_0xbd41('0xa')](config[_0xbd41('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xbd41('0xb'))(new Redis(config[_0xbd41('0x9')]));var def={'method':_0xbd41('0xc'),'json':!![]};function emit(_0x22c678,_0x41cd01,_0x1192ba){io['to'](_0x22c678)[_0xbd41('0xd')](_0x41cd01,_0x1192ba);}function getTicket(_0x114e60,_0x521b68,_0x3eb043,_0x5d02b4,_0x277967,_0x5e12eb,_0x32d692,_0x1c296f){logger[_0xbd41('0xe')]('Creating\x20new\x20ticket...');var _0x1e7caf=new Date();var _0xdf9ce3=[{'name':_0xbd41('0xf'),'value':intUtil[_0xbd41('0x10')](_0x5d02b4[_0xbd41('0x11')],_0x277967,'\x20')},{'name':'assigned_user_id','value':_0x521b68['id']},{'name':_0xbd41('0x12'),'value':_0x521b68['id']},{'name':_0xbd41('0x13'),'value':intUtil[_0xbd41('0x10')](_0x5d02b4[_0xbd41('0x14')],_0x277967,'\x0a')},{'name':_0xbd41('0x15'),'value':_0x1e7caf[_0xbd41('0x16')]()[_0xbd41('0x17')](0x0,0x13)[_0xbd41('0x18')]('T','\x20')},{'name':_0xbd41('0x19'),'value':'0'},{'name':_0xbd41('0x1a'),'value':'15'},{'name':_0xbd41('0x1b'),'value':_0x3eb043['id']},{'name':_0xbd41('0x1c'),'value':_0xbd41('0x1d')},{'name':_0xbd41('0x1e'),'value':_0x3eb043[_0xbd41('0xf')]},{'name':_0xbd41('0x1f'),'value':_0x1c296f}];if(_0x5e12eb[_0xbd41('0x20')]){_[_0xbd41('0x21')](_0x5e12eb,function(_0x451ee8){if(_0x277967[_0x451ee8[_0xbd41('0x22')]]){_0xdf9ce3[_0xbd41('0x23')]({'name':_0x451ee8[_0xbd41('0x24')],'value':_0x277967[_0x451ee8['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0xbd41('0x25'),'response_type':_0xbd41('0x25'),'rest_data':JSON['stringify']({'session':_0x32d692['id'],'module_name':_0xbd41('0x26'),'name_value_list':_0xdf9ce3})}});}function getAuth(_0x39e42d){return util[_0xbd41('0x27')]('Basic\x20%s',new Buffer(_0x39e42d['apiKey']+':X')['toString'](_0xbd41('0x28')));}function getServerInfo(_0x57f48b){return request({'form':{'method':_0xbd41('0x29'),'input_type':_0xbd41('0x25'),'response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'session':_0x57f48b['id']})}});}function getUser(_0x1ed0cf,_0x5d8ab2,_0x270f2b){if(!_[_0xbd41('0x2b')](_0x5d8ab2)){logger[_0xbd41('0xe')](_0xbd41('0x2c'),_0x5d8ab2);return request({'form':{'method':_0xbd41('0x2d'),'input_type':_0xbd41('0x25'),'response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'session':_0x270f2b['id'],'module_name':_0xbd41('0x2e'),'query':util[_0xbd41('0x27')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5d8ab2),'order_by':'','offset':'0','select_fields':['id',_0xbd41('0xf'),_0xbd41('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbd41('0x30')](function(_0x3a5589){if(_0x3a5589['entry_list'][_0xbd41('0x20')]){var _0x20c6d6=_[_0xbd41('0x31')](_0x3a5589[_0xbd41('0x32')],function(_0x8e1ec1){return _0x8e1ec1[_0xbd41('0x33')]['user_name'][_0xbd41('0x34')]===_0x5d8ab2;});if(_0x20c6d6){logger[_0xbd41('0xe')](_0xbd41('0x35'));return BPromise[_0xbd41('0x36')]({'id':_0x20c6d6[_0xbd41('0x33')]['id'][_0xbd41('0x34')],'name':_0x20c6d6['name_value_list'][_0xbd41('0xf')][_0xbd41('0x34')]});}}logger[_0xbd41('0xe')](_0xbd41('0x37'));return BPromise['resolve']({'id':_0x270f2b[_0xbd41('0x33')][_0xbd41('0x38')]['value'],'name':_0x270f2b[_0xbd41('0x33')]['user_name'][_0xbd41('0x34')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x270f2b['name_value_list']['user_id'][_0xbd41('0x34')],'name':_0x270f2b['name_value_list'][_0xbd41('0x2f')]['value']});}}function getEndUser(_0x3c9f17,_0x255b10,_0x2ae3fd,_0x2ca2b2){logger[_0xbd41('0xe')](_0xbd41('0x39'),_0x2ae3fd);return request({'form':{'method':_0xbd41('0x2d'),'input_type':_0xbd41('0x25'),'response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'session':_0x2ca2b2['id'],'module_name':_0xbd41('0x1d'),'query':util[_0xbd41('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2ae3fd),'order_by':'','offset':'0','select_fields':['id',_0xbd41('0xf'),_0xbd41('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbd41('0x30')](function(_0x10fbe4){if(_0x10fbe4['entry_list']['length']){var _0x2ce800=_[_0xbd41('0x31')](_0x10fbe4['entry_list'],function(_0xeea4a2){return _0xeea4a2['name_value_list']['phone_home'][_0xbd41('0x34')]===_0x2ae3fd;});if(_0x2ce800){logger[_0xbd41('0xe')](_0xbd41('0x3b'));return BPromise[_0xbd41('0x36')]({'id':_0x2ce800[_0xbd41('0x33')]['id'][_0xbd41('0x34')],'name':_0x2ce800[_0xbd41('0x33')][_0xbd41('0xf')]['value'],'phone':_0x2ce800['name_value_list'][_0xbd41('0x3a')][_0xbd41('0x34')]});}}else{logger[_0xbd41('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xbd41('0x3c'),'input_type':_0xbd41('0x25'),'response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'session':_0x2ca2b2['id'],'module_name':_0xbd41('0x1d'),'name_value_list':[{'name':_0xbd41('0x3d'),'value':_0x255b10!==_0xbd41('0x3e')?_0x255b10:util[_0xbd41('0x27')](_0xbd41('0x3f'),_0x2ae3fd)},{'name':'phone_home','value':_0x2ae3fd}]})}})[_0xbd41('0x30')](function(_0x1d8a12){logger['info'](_0xbd41('0x40'));return BPromise['resolve']({'id':_0x1d8a12['id'],'name':_0x1d8a12[_0xbd41('0x32')][_0xbd41('0x3d')][_0xbd41('0x34')],'phone':_0x1d8a12[_0xbd41('0x32')][_0xbd41('0x3a')]['value']});});}});}function request(_0x49f622){logger['debug'](_0xbd41('0x41'),JSON['stringify'](_0x49f622));return rp(_[_0xbd41('0x42')](def,_0x49f622));}function getTags(_0x235993,_0xdeb70c){var _0x144611=[];if(_0x235993&&_0x235993[_0xbd41('0x20')]>0x0){_0x144611=_[_0xbd41('0x43')](_0x235993,_0xdeb70c);}return _0x144611;}function getCustomFields(_0x32f80d,_0x4b31b8){var _0x3b4659=[];var _0x4f8fec={'custom_fields':[]};if(_0x32f80d[_0xbd41('0x20')]>0x0){_[_0xbd41('0x21')](_0x32f80d,function(_0x292b07){if(_0x292b07['type']===_0xbd41('0x44')&&_0x292b07[_0xbd41('0x45')]&&!_0x292b07[_0xbd41('0x46')]){_0x4f8fec[_0x292b07[_0xbd41('0x45')]['toLowerCase']()]=_0x292b07[_0xbd41('0x47')][_0xbd41('0x48')]();}else if(_0x292b07['type']===_0xbd41('0x44')&&_0x292b07['idField']&&_0x292b07[_0xbd41('0x46')]){_0x4f8fec[_0xbd41('0x49')][_0xbd41('0x23')]({'id':_0x292b07[_0xbd41('0x24')],'value':_0x292b07[_0xbd41('0x47')][_0xbd41('0x48')]()});}else if(_0x292b07[_0xbd41('0x4a')]===_0xbd41('0x4b')&&_0x292b07[_0xbd41('0x22')]&&_0x292b07['idField']&&_0x292b07[_0xbd41('0x46')]){_0x4b31b8[_0x292b07[_0xbd41('0x22')]]&&_0x4f8fec['custom_fields'][_0xbd41('0x23')]({'id':_0x292b07[_0xbd41('0x24')],'value':_0x4b31b8[_0x292b07[_0xbd41('0x22')]][_0xbd41('0x48')]()});}else if(_0x292b07[_0xbd41('0x4a')]===_0xbd41('0x4c')&&_0x292b07[_0xbd41('0x4d')]&&_0x292b07[_0xbd41('0x4d')][_0xbd41('0xf')]&&_0x292b07[_0xbd41('0x24')]&&_0x292b07[_0xbd41('0x46')]){_0x4b31b8[_0x292b07[_0xbd41('0x4d')]['name'][_0xbd41('0x4e')]()]&&_0x4f8fec[_0xbd41('0x49')][_0xbd41('0x23')]({'id':_0x292b07[_0xbd41('0x24')],'value':_0x4b31b8[_0x292b07[_0xbd41('0x4d')][_0xbd41('0xf')][_0xbd41('0x4e')]()][_0xbd41('0x48')]()});}});}return _0x4f8fec;}function getConnection(_0x5d4f6e){return request({'method':_0xbd41('0xc'),'form':{'method':_0xbd41('0x4f'),'input_type':'JSON','response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'user_auth':{'user_name':_0x5d4f6e[_0xbd41('0x50')],'password':_0x5d4f6e[_0xbd41('0x51')],'encryption':_0xbd41('0x52')},'application':_0xbd41('0x53')})}})[_0xbd41('0x30')](function(_0x3fc964){var _0x528683=_0x3fc964;if(_0x528683['id']){def['sessionID']=_0x528683['id'];return BPromise[_0xbd41('0x36')](_0x528683);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x5d4f6e['id']));}});}function setRelationship(_0x3947d,_0x283274,_0x37b0ae,_0x4408f9){return request({'form':{'method':_0xbd41('0x54'),'input_type':'JSON','response_type':_0xbd41('0x25'),'rest_data':JSON[_0xbd41('0x2a')]({'session':_0x3947d['id'],'module_name':_0xbd41('0x26'),'module_id':_0x37b0ae['id'],'link_field_name':_0x4408f9,'related_ids':[_0x283274['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x47d70e,_0xfc6c39,_0x2e34ee,_0x3f74ed,_0x47acd5,_0x440fbd){var _0x20b8b7,_0xf07cd5,_0x3ccbfa,_0x5d086a;_0x440fbd[_0xbd41('0x55')]=intUtil[_0xbd41('0x56')](_0x440fbd['remoteUri']);_0x440fbd['serverUrl']=intUtil[_0xbd41('0x56')](_0x440fbd['serverUrl']);def[_0xbd41('0x57')]=util['format']('%s/service/v4_1/rest.php',_0x440fbd[_0xbd41('0x55')]);if(_0x47acd5&&_0x47acd5['monitor_format']){logger['info'](_0xbd41('0x58'),'Recording\x20is\x20enabled!');_0xfc6c39[_0xbd41('0x59')]=util[_0xbd41('0x27')](_0xbd41('0x5a'),_0x440fbd[_0xbd41('0x5b')],_0xfc6c39[_0xbd41('0x5c')],md5(_0xfc6c39[_0xbd41('0x5c')]));}else{_0xfc6c39[_0xbd41('0x59')]='';}return getConnection(_0x440fbd)[_0xbd41('0x30')](function(_0x163f14){_0x5d086a=_0x163f14;return getUser(_0x440fbd,_0x3f74ed[_0xbd41('0xf')],_0x5d086a);})[_0xbd41('0x30')](function(_0x4df4c5){_0x20b8b7=_0x4df4c5;logger['info'](_0xbd41('0x5d'),_0x20b8b7['id']);return getEndUser(_0x440fbd,_0xfc6c39[_0xbd41('0x5e')],_0xfc6c39['calleridnum'],_0x5d086a);})['then'](function(_0x3e1e4f){_0xf07cd5=_0x3e1e4f;logger[_0xbd41('0xe')](_0xbd41('0x5f'),_0xf07cd5['id']);return getTicket(_0x440fbd,_0x20b8b7,_0xf07cd5,_0x2e34ee,_0xfc6c39,_0x2e34ee['Fields'],_0x5d086a,_0xbd41('0x60'));})['then'](function(_0x52866e){_0x3ccbfa=_0x52866e;logger['info'](_0xbd41('0x61'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3ccbfa['id']);return setRelationship(_0x5d086a,_0x20b8b7,_0x3ccbfa,_0xbd41('0x62'));})[_0xbd41('0x30')](function(){return setRelationship(_0x5d086a,_0xf07cd5,_0x3ccbfa,'contacts');})[_0xbd41('0x30')](function(){return getServerInfo(_0x5d086a);})[_0xbd41('0x30')](function(_0x50f122){var _0x48c01f=parseInt(_0x50f122[_0xbd41('0x63')]['charAt'](0x0));var _0x8743d8=util[_0xbd41('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x440fbd['remoteUri'],_0x3ccbfa['id']);if(_0x48c01f>0x6){_0x8743d8=util[_0xbd41('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x440fbd['remoteUri'],_0x3ccbfa['id']);}logger[_0xbd41('0xe')](_0xbd41('0x58'),_0xbd41('0x64'));emit(util[_0xbd41('0x27')](_0xbd41('0x65'),_0x3f74ed[_0xbd41('0xf')]),_0xbd41('0x66'),{'uri':_0x8743d8});})['catch'](function(_0x7b2d08){logger[_0xbd41('0x67')]('[QUEUE]',JSON['stringify'](_0x7b2d08));});};exports['outbound']=function(_0x5b7e5b,_0x25f097,_0xd77954,_0x5248c6,_0x5d54b8,_0x472ba0,_0x64c496){var _0xf1861c,_0x3cc4b7,_0x237c33,_0x251028;_0x472ba0[_0xbd41('0x55')]=intUtil[_0xbd41('0x56')](_0x472ba0[_0xbd41('0x55')]);_0x472ba0[_0xbd41('0x5b')]=intUtil[_0xbd41('0x56')](_0x472ba0[_0xbd41('0x5b')]);def[_0xbd41('0x57')]=util['format'](_0xbd41('0x68'),_0x472ba0[_0xbd41('0x55')]);if(_0x64c496&&_0x64c496[_0xbd41('0x69')]&&_0x64c496[_0xbd41('0x69')]!==_0xbd41('0x6a')){logger['info']('[OUTBOUND]',_0xbd41('0x6b'));_0x25f097[_0xbd41('0x59')]=util[_0xbd41('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x472ba0['serverUrl'],_0x25f097['uniqueid'],md5(_0x25f097['uniqueid']));}return getConnection(_0x472ba0)['then'](function(_0x130d49){_0x251028=_0x130d49;return getUser(_0x472ba0,_0x5248c6[_0xbd41('0xf')],_0x251028);})[_0xbd41('0x30')](function(_0x2d88cc){_0xf1861c=_0x2d88cc;logger[_0xbd41('0xe')](_0xbd41('0x5d'),_0xf1861c['id']);return getEndUser(_0x472ba0,_0x25f097[_0xbd41('0x6c')],_0x25f097[_0xbd41('0x6d')],_0x251028);})['then'](function(_0x354ee9){_0x3cc4b7=_0x354ee9;logger['info'](_0xbd41('0x5f'),_0x3cc4b7['id']);return getTicket(_0x472ba0,_0xf1861c,_0x3cc4b7,_0xd77954,_0x25f097,_0xd77954['Fields'],_0x251028,'Outbound');})[_0xbd41('0x30')](function(_0x5db50f){_0x237c33=_0x5db50f;logger[_0xbd41('0xe')](_0xbd41('0x61'));logger['info'](_0xbd41('0x6e'),_0x237c33['id']);return setRelationship(_0x251028,_0xf1861c,_0x237c33,'users');})[_0xbd41('0x30')](function(){return setRelationship(_0x251028,_0x3cc4b7,_0x237c33,_0xbd41('0x6f'));})[_0xbd41('0x30')](function(){return getServerInfo(_0x251028);})[_0xbd41('0x30')](function(_0x415d98){var _0x1124b3=parseInt(_0x415d98[_0xbd41('0x63')][_0xbd41('0x70')](0x0));var _0xa0ed0=util[_0xbd41('0x27')](_0xbd41('0x71'),_0x472ba0[_0xbd41('0x55')],_0x237c33['id']);if(_0x1124b3>0x6){_0xa0ed0=util['format'](_0xbd41('0x72'),_0x472ba0['remoteUri'],_0x237c33['id']);}logger[_0xbd41('0xe')](_0xbd41('0x73'),_0xbd41('0x64'));emit(util[_0xbd41('0x27')]('user:%s',_0x5248c6[_0xbd41('0xf')]),_0xbd41('0x66'),{'uri':_0xa0ed0});})[_0xbd41('0x74')](function(_0x954b48){logger[_0xbd41('0x67')](_0xbd41('0x73'),JSON['stringify'](_0x954b48));});};exports[_0xbd41('0x75')]=function(_0x5e937b,_0x40deed,_0x18bbbe,_0x450a5e,_0x129492,_0x259874){var _0x43c9a4,_0x4700fb,_0x4c1140,_0x4bb79d;_0x259874[_0xbd41('0x55')]=intUtil['stripTrailingSlash'](_0x259874[_0xbd41('0x55')]);_0x259874['serverUrl']=intUtil[_0xbd41('0x56')](_0x259874['serverUrl']);def[_0xbd41('0x57')]=util[_0xbd41('0x27')](_0xbd41('0x68'),_0x259874[_0xbd41('0x55')]);if(_0x129492&&_0x129492[_0xbd41('0x76')]){logger['info']('['+_0x40deed[_0xbd41('0x77')]['toUpperCase']()+']',_0xbd41('0x6b'));_0x40deed[_0xbd41('0x59')]=util['format'](_0xbd41('0x5a'),_0x259874[_0xbd41('0x5b')],_0x40deed[_0xbd41('0x5c')],md5(_0x40deed[_0xbd41('0x5c')]));}else{_0x40deed[_0xbd41('0x59')]='';}return getConnection(_0x259874)[_0xbd41('0x30')](function(_0x2d409a){_0x4bb79d=_0x2d409a;if(!_[_0xbd41('0x2b')](_0x450a5e)){return getUser(_0x259874,_0x450a5e[_0xbd41('0xf')],_0x4bb79d);}else{return getUser(_0x259874,null,_0x4bb79d);}})['then'](function(_0xc3261a){_0x43c9a4=_0xc3261a;logger[_0xbd41('0xe')]('The\x20User\x20ID\x20is:',_0x43c9a4['id']);return getEndUser(_0x259874,_0x40deed[_0xbd41('0x5e')],_0x40deed['calleridnum'],_0x4bb79d);})[_0xbd41('0x30')](function(_0x39cfb0){_0x4700fb=_0x39cfb0;logger['info'](_0xbd41('0x5f'),_0x4700fb['id']);return getTicket(_0x259874,_0x43c9a4,_0x4700fb,_0x18bbbe,_0x40deed,_0x18bbbe[_0xbd41('0x78')],_0x4bb79d,'Inbound');})[_0xbd41('0x30')](function(_0x5b3cd3){_0x4c1140=_0x5b3cd3;logger[_0xbd41('0xe')](_0xbd41('0x61'));logger[_0xbd41('0xe')](_0xbd41('0x6e'),_0x4c1140['id']);return setRelationship(_0x4bb79d,_0x43c9a4,_0x4c1140,'users');})[_0xbd41('0x30')](function(){return setRelationship(_0x4bb79d,_0x4700fb,_0x4c1140,_0xbd41('0x6f'));})[_0xbd41('0x30')](function(){return getServerInfo(_0x4bb79d);})['catch'](function(_0x3f4151){logger[_0xbd41('0x67')]('['+_0x40deed[_0xbd41('0x77')]['toUpperCase']()+']',JSON['stringify'](_0x3f4151));});};
\ No newline at end of file
index 49d7570..139e267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a2e=['toLowerCase','keyType','key','format','keyContent','%s:\x20%s','slice','substring','lastIndexOf','isNil','test','util','getString','length','string','type','variable','variableName','push','toString','customVariable','Variable','name'];(function(_0x35b705,_0x57ef6d){var _0x38bcb6=function(_0x54eec9){while(--_0x54eec9){_0x35b705['push'](_0x35b705['shift']());}};_0x38bcb6(++_0x57ef6d);}(_0x4a2e,0x14d));var _0xe4a2=function(_0x390143,_0x2b54ac){_0x390143=_0x390143-0x0;var _0x11361b=_0x4a2e[_0x390143];return _0x11361b;};'use strict';var _=require('lodash');var util=require(_0xe4a2('0x0'));exports[_0xe4a2('0x1')]=function(_0x3b5435,_0x408017,_0x387a5b){var _0x31fa7a=[];if(_0x3b5435[_0xe4a2('0x2')]>0x0){var _0x1177a5=_['sortBy'](_0x3b5435,['id']);for(var _0x2ad4f3=0x0;_0x2ad4f3<_0x1177a5['length'];_0x2ad4f3++){var _0x28bce6=_0x1177a5[_0x2ad4f3];if(_0x28bce6['type']===_0xe4a2('0x3')){_0x31fa7a['push'](_0x28bce6['content']);}else if(_0x28bce6[_0xe4a2('0x4')]===_0xe4a2('0x5')&&_0x28bce6['variableName']){_0x408017[_0x28bce6[_0xe4a2('0x6')]]&&_0x31fa7a[_0xe4a2('0x7')](_0x408017[_0x28bce6['variableName']][_0xe4a2('0x8')]());}else if(_0x28bce6[_0xe4a2('0x4')]===_0xe4a2('0x9')&&_0x28bce6[_0xe4a2('0xa')]&&_0x28bce6[_0xe4a2('0xa')][_0xe4a2('0xb')]){_0x408017[_0x28bce6[_0xe4a2('0xa')][_0xe4a2('0xb')][_0xe4a2('0xc')]()]&&_0x31fa7a[_0xe4a2('0x7')](_0x408017[_0x28bce6[_0xe4a2('0xa')][_0xe4a2('0xb')][_0xe4a2('0xc')]()][_0xe4a2('0x8')]());}else if(_0x28bce6['type']==='keyValue'){if(_0x28bce6[_0xe4a2('0xd')]===_0xe4a2('0x3')&&_0x28bce6[_0xe4a2('0xe')]){_0x31fa7a[_0xe4a2('0x7')](util[_0xe4a2('0xf')]('%s:\x20%s',_0x28bce6[_0xe4a2('0xe')],_0x28bce6[_0xe4a2('0x10')]));}else if(_0x28bce6[_0xe4a2('0xd')]==='variable'&&_0x28bce6[_0xe4a2('0x6')]&&_0x28bce6[_0xe4a2('0xe')]){_0x408017[_0x28bce6[_0xe4a2('0x6')]]&&_0x31fa7a[_0xe4a2('0x7')](util[_0xe4a2('0xf')]('%s:\x20%s',_0x28bce6[_0xe4a2('0xe')],_0x408017[_0x28bce6['variableName']]));}else if(_0x28bce6[_0xe4a2('0xd')]===_0xe4a2('0x9')&&_0x28bce6[_0xe4a2('0xa')]&&_0x28bce6[_0xe4a2('0xa')][_0xe4a2('0xb')]&&_0x28bce6[_0xe4a2('0xe')]){_0x408017[_0x28bce6['Variable'][_0xe4a2('0xb')]['toLowerCase']()]&&_0x31fa7a[_0xe4a2('0x7')](util[_0xe4a2('0xf')](_0xe4a2('0x11'),_0x28bce6['key'],_0x408017[_0x28bce6[_0xe4a2('0xa')]['name'][_0xe4a2('0xc')]()]));}}}}return _0x31fa7a['join'](_0x387a5b);};exports['stripTrailingSlash']=function(_0xbc0589){var _0x29210c=_0xbc0589[_0xe4a2('0x12')](-0x1);if(_0x29210c==='/'){_0xbc0589=_0xbc0589[_0xe4a2('0x13')](0x0,_0xbc0589[_0xe4a2('0x14')](_0x29210c));}return _0xbc0589;};exports['validateEmail']=function(_0x2393b6){if(!_[_0xe4a2('0x15')](_0x2393b6)&&_0x2393b6!==''){var _0x11c7a6=/^(([^<>()\[\]\\.,;:\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 _0x11c7a6[_0xe4a2('0x16')](String(_0x2393b6)[_0xe4a2('0xc')]());}else{return![];}};
\ No newline at end of file
+var _0xdf00=['toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','util','getString','length','type','string','push','variable','variableName'];(function(_0x1026d2,_0x42fe66){var _0x4a6773=function(_0x1a295f){while(--_0x1a295f){_0x1026d2['push'](_0x1026d2['shift']());}};_0x4a6773(++_0x42fe66);}(_0xdf00,0xad));var _0x0df0=function(_0x6f99e3,_0x6258d1){_0x6f99e3=_0x6f99e3-0x0;var _0x120d98=_0xdf00[_0x6f99e3];return _0x120d98;};'use strict';var _=require(_0x0df0('0x0'));var util=require(_0x0df0('0x1'));exports[_0x0df0('0x2')]=function(_0x2e5800,_0x519f33,_0x482360){var _0x2bdab0=[];if(_0x2e5800[_0x0df0('0x3')]>0x0){var _0x3bf8af=_['sortBy'](_0x2e5800,['id']);for(var _0x51f205=0x0;_0x51f205<_0x3bf8af['length'];_0x51f205++){var _0x2d677a=_0x3bf8af[_0x51f205];if(_0x2d677a[_0x0df0('0x4')]===_0x0df0('0x5')){_0x2bdab0[_0x0df0('0x6')](_0x2d677a['content']);}else if(_0x2d677a['type']===_0x0df0('0x7')&&_0x2d677a[_0x0df0('0x8')]){_0x519f33[_0x2d677a[_0x0df0('0x8')]]&&_0x2bdab0['push'](_0x519f33[_0x2d677a['variableName']][_0x0df0('0x9')]());}else if(_0x2d677a[_0x0df0('0x4')]===_0x0df0('0xa')&&_0x2d677a[_0x0df0('0xb')]&&_0x2d677a[_0x0df0('0xb')][_0x0df0('0xc')]){_0x519f33[_0x2d677a['Variable']['name']['toLowerCase']()]&&_0x2bdab0[_0x0df0('0x6')](_0x519f33[_0x2d677a[_0x0df0('0xb')][_0x0df0('0xc')][_0x0df0('0xd')]()][_0x0df0('0x9')]());}else if(_0x2d677a[_0x0df0('0x4')]===_0x0df0('0xe')){if(_0x2d677a[_0x0df0('0xf')]==='string'&&_0x2d677a[_0x0df0('0x10')]){_0x2bdab0['push'](util['format'](_0x0df0('0x11'),_0x2d677a[_0x0df0('0x10')],_0x2d677a[_0x0df0('0x12')]));}else if(_0x2d677a[_0x0df0('0xf')]===_0x0df0('0x7')&&_0x2d677a[_0x0df0('0x8')]&&_0x2d677a[_0x0df0('0x10')]){_0x519f33[_0x2d677a[_0x0df0('0x8')]]&&_0x2bdab0[_0x0df0('0x6')](util[_0x0df0('0x13')]('%s:\x20%s',_0x2d677a[_0x0df0('0x10')],_0x519f33[_0x2d677a[_0x0df0('0x8')]]));}else if(_0x2d677a[_0x0df0('0xf')]===_0x0df0('0xa')&&_0x2d677a[_0x0df0('0xb')]&&_0x2d677a[_0x0df0('0xb')]['name']&&_0x2d677a[_0x0df0('0x10')]){_0x519f33[_0x2d677a[_0x0df0('0xb')][_0x0df0('0xc')]['toLowerCase']()]&&_0x2bdab0[_0x0df0('0x6')](util['format']('%s:\x20%s',_0x2d677a[_0x0df0('0x10')],_0x519f33[_0x2d677a[_0x0df0('0xb')]['name']['toLowerCase']()]));}}}}return _0x2bdab0['join'](_0x482360);};exports[_0x0df0('0x14')]=function(_0x54dee2){var _0x466389=_0x54dee2[_0x0df0('0x15')](-0x1);if(_0x466389==='/'){_0x54dee2=_0x54dee2[_0x0df0('0x16')](0x0,_0x54dee2[_0x0df0('0x17')](_0x466389));}return _0x54dee2;};exports[_0x0df0('0x18')]=function(_0x379399){if(!_['isNil'](_0x379399)&&_0x379399!==''){var _0x43dbe0=/^(([^<>()\[\]\\.,;:\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 _0x43dbe0[_0x0df0('0x19')](String(_0x379399)[_0x0df0('0xd')]());}else{return![];}};
\ No newline at end of file
index 786b247..bac989a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x321b98,_0x4c7b2b){var _0x22948f=function(_0x12ac50){while(--_0x12ac50){_0x321b98['push'](_0x321b98['shift']());}};_0x22948f(++_0x4c7b2b);}(_0xe706,0xa3));var _0x6e70=function(_0x536076,_0x4c5460){_0x536076=_0x536076-0x0;var _0x246902=_0xe706[_0x536076];return _0x246902;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
+var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x29e72b,_0x1c04c3){var _0x5ce4d6=function(_0x15b13d){while(--_0x15b13d){_0x29e72b['push'](_0x29e72b['shift']());}};_0x5ce4d6(++_0x1c04c3);}(_0xe706,0xa3));var _0x6e70=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xe706[_0x146a97];return _0x259d5c;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
index 3640718..4abae72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6a0=['recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','The\x20Enduser\x20ID\x20is:','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','base64','debug','defaults','map','forEach','includes','string','type','nameField','customField','toLowerCase','picklist','idField','content','toString','variable','variableName','custom_fields','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound'];(function(_0x365837,_0x1db4cc){var _0x41bfe9=function(_0x4551ae){while(--_0x4551ae){_0x365837['push'](_0x365837['shift']());}};_0x41bfe9(++_0x1db4cc);}(_0xf6a0,0x1d8));var _0x0f6a=function(_0x363d20,_0x24b73f){_0x363d20=_0x363d20-0x0;var _0x279d54=_0xf6a0[_0x363d20];return _0x279d54;};'use strict';var _=require('lodash');var rp=require(_0x0f6a('0x0'));var md5=require(_0x0f6a('0x1'));var util=require(_0x0f6a('0x2'));var Redis=require(_0x0f6a('0x3'));var intUtil=require(_0x0f6a('0x4'));var config=require(_0x0f6a('0x5'));var logger=require(_0x0f6a('0x6'))(_0x0f6a('0x7'));config[_0x0f6a('0x8')]=_['defaults'](config[_0x0f6a('0x8')],{'host':_0x0f6a('0x9'),'port':0x18eb});var io=require(_0x0f6a('0xa'))(new Redis(config[_0x0f6a('0x8')]));function emit(_0x439785,_0xaa7709,_0x40e4d6){io['to'](_0x439785)[_0x0f6a('0xb')](_0xaa7709,_0x40e4d6);}var headers={'Content-Type':'application/json','Accept':_0x0f6a('0xc')};function getTicket(_0x44be3e,_0x3bd8c8,_0x11e21f,_0x424a65,_0x39abe6){logger[_0x0f6a('0xd')](_0x0f6a('0xe'));return request({'uri':util[_0x0f6a('0xf')](_0x0f6a('0x10'),_0x44be3e[_0x0f6a('0x11')]),'method':_0x0f6a('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x11e21f['id'],'submitter_id':_0x3bd8c8?_0x3bd8c8['id']:undefined,'assignee_id':_0x3bd8c8?_0x3bd8c8['id']:undefined,'tags':getTags(_0x424a65['Tags'],_0x0f6a('0x13')),'subject':intUtil['getString'](_0x424a65[_0x0f6a('0x14')],_0x39abe6,'\x20'),'description':intUtil['getString'](_0x424a65['Descriptions'],_0x39abe6,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x424a65[_0x0f6a('0x15')],_0x39abe6,'\x0a')}},getCustomFields(_0x424a65[_0x0f6a('0x16')],_0x39abe6))}})[_0x0f6a('0x17')](function(_0x46bce9){logger[_0x0f6a('0xd')](_0x0f6a('0x18'));return _0x46bce9[_0x0f6a('0x19')];});}function getUser(_0x568729,_0x3c608d){if(intUtil[_0x0f6a('0x1a')](_0x3c608d)){logger[_0x0f6a('0xd')](_0x0f6a('0x1b'),_0x3c608d);return request({'uri':util[_0x0f6a('0xf')](_0x0f6a('0x1c'),_0x568729['remoteUri']),'qs':{'query':util[_0x0f6a('0xf')](_0x0f6a('0x1d'),_0x3c608d)}})['then'](function(_0x3f2223){if(_0x3f2223[_0x0f6a('0x1e')]){logger[_0x0f6a('0xd')](_0x0f6a('0x1f'));return _[_0x0f6a('0x20')](_0x3f2223[_0x0f6a('0x21')],{'email':_0x3c608d,'role':_0x0f6a('0x22')});}else{logger[_0x0f6a('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0f6a('0xf')](_0x0f6a('0x23'),_0x568729[_0x0f6a('0x11')])})['then'](function(_0x41175b){logger[_0x0f6a('0xd')](_0x0f6a('0x24'));return _0x41175b[_0x0f6a('0x25')];});}});}else{logger[_0x0f6a('0xd')](_0x0f6a('0x26'));return request({'uri':util[_0x0f6a('0xf')](_0x0f6a('0x23'),_0x568729[_0x0f6a('0x11')])})['then'](function(_0x61e44c){logger['info'](_0x0f6a('0x24'));return _0x61e44c['user'];});}}function getEndUser(_0x1f4ea1,_0x1b751c,_0x34ad83){logger[_0x0f6a('0xd')](_0x0f6a('0x27'),_0x34ad83);return request({'uri':util[_0x0f6a('0xf')]('%s/search.json',_0x1f4ea1[_0x0f6a('0x11')]),'qs':{'query':util[_0x0f6a('0xf')](_0x0f6a('0x28'),_0x34ad83)}})['then'](function(_0x3fb0a1){var _0x3c8675;if(_0x3fb0a1[_0x0f6a('0x21')][_0x0f6a('0x29')]){_0x3fb0a1[_0x0f6a('0x21')]=_[_0x0f6a('0x2a')](_0x3fb0a1[_0x0f6a('0x21')],{'suspended':![],'role':_0x0f6a('0x2b')});if(_0x3fb0a1[_0x0f6a('0x21')][_0x0f6a('0x29')]){_0x3c8675=_['first'](_0x3fb0a1[_0x0f6a('0x21')]);}}if(_0x3c8675){logger[_0x0f6a('0xd')](_0x0f6a('0x2c'));return _0x3c8675;}else{logger['info'](_0x0f6a('0x2d'));return request({'uri':util['format'](_0x0f6a('0x2e'),_0x1f4ea1[_0x0f6a('0x11')]),'method':'POST','body':{'user':{'role':_0x0f6a('0x2b'),'name':util[_0x0f6a('0xf')](_0x0f6a('0x2f'),_0x1b751c||_0x34ad83),'phone':_0x34ad83}}})[_0x0f6a('0x17')](function(_0x3fd8af){logger[_0x0f6a('0xd')]('Enduser\x20created.');return _0x3fd8af['user'];});}});}function getAuth(_0x2b5aa1){var _0x306d0e;if(_0x2b5aa1[_0x0f6a('0x30')]===_0x0f6a('0x31')){_0x306d0e=util[_0x0f6a('0xf')](_0x0f6a('0x32'),_0x2b5aa1['username'],_0x2b5aa1[_0x0f6a('0x31')]);}else if(_0x2b5aa1['authType']==='token'){_0x306d0e=util[_0x0f6a('0xf')]('%s/token:%s',_0x2b5aa1[_0x0f6a('0x33')],_0x2b5aa1[_0x0f6a('0x34')]);}return util[_0x0f6a('0xf')]('Basic\x20%s',new Buffer(_0x306d0e)['toString'](_0x0f6a('0x35')));}function request(_0xd817e9){logger[_0x0f6a('0x36')]('[HTTP]',JSON['stringify'](_0xd817e9));return rp(_[_0x0f6a('0x37')](_0xd817e9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5c3aef,_0x41439e){var _0x150daa=[];if(_0x5c3aef&&_0x5c3aef[_0x0f6a('0x29')]>0x0){_0x150daa=_[_0x0f6a('0x38')](_0x5c3aef,_0x41439e);}return _0x150daa;}function getCustomFields(_0x514c4d,_0x189f22){var _0x3dea4e=[];var _0x16460e={'custom_fields':[]};if(_0x514c4d[_0x0f6a('0x29')]>0x0){_[_0x0f6a('0x39')](_0x514c4d,function(_0x17c0a4){if(_[_0x0f6a('0x3a')]([_0x0f6a('0x3b'),'picklist'],_0x17c0a4[_0x0f6a('0x3c')])&&_0x17c0a4[_0x0f6a('0x3d')]&&!_0x17c0a4[_0x0f6a('0x3e')]){_0x16460e[_0x17c0a4[_0x0f6a('0x3d')][_0x0f6a('0x3f')]()]=_0x17c0a4['content']['toString']();}else if(_[_0x0f6a('0x3a')]([_0x0f6a('0x3b'),_0x0f6a('0x40')],_0x17c0a4[_0x0f6a('0x3c')])&&_0x17c0a4['idField']&&_0x17c0a4['customField']){_0x16460e['custom_fields']['push']({'id':_0x17c0a4[_0x0f6a('0x41')],'value':_0x17c0a4[_0x0f6a('0x42')][_0x0f6a('0x43')]()});}else if(_0x17c0a4[_0x0f6a('0x3c')]===_0x0f6a('0x44')&&_0x17c0a4[_0x0f6a('0x45')]&&_0x17c0a4[_0x0f6a('0x41')]&&_0x17c0a4[_0x0f6a('0x3e')]){_0x189f22[_0x17c0a4['variableName']]&&_0x16460e[_0x0f6a('0x46')][_0x0f6a('0x47')]({'id':_0x17c0a4[_0x0f6a('0x41')],'value':_0x189f22[_0x17c0a4[_0x0f6a('0x45')]]['toString']()});}else if(_0x17c0a4[_0x0f6a('0x3c')]===_0x0f6a('0x48')&&_0x17c0a4[_0x0f6a('0x49')]&&_0x17c0a4[_0x0f6a('0x49')][_0x0f6a('0x13')]&&_0x17c0a4[_0x0f6a('0x41')]&&_0x17c0a4[_0x0f6a('0x3e')]){_0x189f22[_0x17c0a4[_0x0f6a('0x49')]['name'][_0x0f6a('0x3f')]()]&&_0x16460e['custom_fields'][_0x0f6a('0x47')]({'id':_0x17c0a4[_0x0f6a('0x41')],'value':_0x189f22[_0x17c0a4[_0x0f6a('0x49')][_0x0f6a('0x13')][_0x0f6a('0x3f')]()][_0x0f6a('0x43')]()});}});}return _0x16460e;}exports[_0x0f6a('0x4a')]=function(_0x366b87,_0x3a903f,_0xd17f79,_0x34a922,_0x448739,_0x24abbc){var _0x4ff5e1,_0xc52549;_0x24abbc[_0x0f6a('0x11')]=intUtil[_0x0f6a('0x4b')](_0x24abbc[_0x0f6a('0x11')]);_0x24abbc[_0x0f6a('0x4c')]=intUtil[_0x0f6a('0x4b')](_0x24abbc[_0x0f6a('0x4c')]);if(_0x448739&&_0x448739['monitor_format']){logger['info'](_0x0f6a('0x4d'),_0x0f6a('0x4e'));_0x3a903f['recordingURL']=util[_0x0f6a('0xf')](_0x0f6a('0x4f'),_0x24abbc[_0x0f6a('0x4c')],_0x3a903f[_0x0f6a('0x50')],md5(_0x3a903f[_0x0f6a('0x50')]));}else{_0x3a903f[_0x0f6a('0x51')]='';}headers[_0x0f6a('0x52')]=getAuth(_0x24abbc);return getUser(_0x24abbc,_0x34a922['email'])[_0x0f6a('0x17')](function(_0x316f74){_0x4ff5e1=_0x316f74;logger[_0x0f6a('0xd')](_0x0f6a('0x53'),_0x4ff5e1['id']);return getEndUser(_0x24abbc,_0x3a903f['calleridname'],_0x3a903f[_0x0f6a('0x54')]);})['then'](function(_0x26a967){_0xc52549=_0x26a967;logger[_0x0f6a('0xd')]('The\x20Enduser\x20ID\x20is:',_0xc52549['id']);return getTicket(_0x24abbc,_0x4ff5e1,_0xc52549,_0xd17f79,_0x3a903f);})[_0x0f6a('0x17')](function(_0x25eb8d){if(_0x25eb8d){logger[_0x0f6a('0xd')](_0x0f6a('0x55'),_0x25eb8d['id']);switch(_0x24abbc['type']){case _0x0f6a('0x56'):logger[_0x0f6a('0xd')](_0x0f6a('0x4d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0f6a('0xf')](_0x0f6a('0x57'),_0x24abbc['remoteUri'],_0x4ff5e1['id'],_0x25eb8d['id']),'method':'POST'});case _0x0f6a('0x58'):logger[_0x0f6a('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0f6a('0xf')](_0x0f6a('0x59'),_0x34a922[_0x0f6a('0x13')]),'trigger:browser:url',{'uri':util[_0x0f6a('0xf')]('%s/agent/tickets/%s',_0x24abbc['remoteUri'][_0x0f6a('0x5a')](_0x0f6a('0x5b'),''),_0x25eb8d['id'])});break;default:logger[_0x0f6a('0x5c')](_0x0f6a('0x4d'),_0x0f6a('0x5d'));}}})[_0x0f6a('0x5e')](function(_0x2a2909){logger[_0x0f6a('0x5c')](_0x0f6a('0x5f'),util[_0x0f6a('0x60')](_0x2a2909,{'showHidden':!![],'depth':null}));});};exports[_0x0f6a('0x61')]=function(_0x97b64d,_0x2b126c,_0x46fae7,_0xf847d,_0x49ba77,_0x1f977f,_0x20dc8f){var _0x2f9aa0,_0x3a1313;_0x1f977f[_0x0f6a('0x11')]=intUtil['stripTrailingSlash'](_0x1f977f[_0x0f6a('0x11')]);_0x1f977f[_0x0f6a('0x4c')]=intUtil[_0x0f6a('0x4b')](_0x1f977f[_0x0f6a('0x4c')]);if(_0x20dc8f&&_0x20dc8f[_0x0f6a('0x62')]&&_0x20dc8f['recordingFormat']!=='none'){logger[_0x0f6a('0xd')](_0x0f6a('0x63'),_0x0f6a('0x4e'));_0x2b126c[_0x0f6a('0x51')]=util['format'](_0x0f6a('0x4f'),_0x1f977f[_0x0f6a('0x4c')],_0x2b126c['uniqueid'],md5(_0x2b126c['uniqueid']));}headers[_0x0f6a('0x52')]=getAuth(_0x1f977f);return getUser(_0x1f977f,_0xf847d[_0x0f6a('0x64')])[_0x0f6a('0x17')](function(_0x134ad3){_0x2f9aa0=_0x134ad3;logger['info'](_0x0f6a('0x53'),_0x2f9aa0['id']);return getEndUser(_0x1f977f,_0x2b126c[_0x0f6a('0x65')],_0x2b126c[_0x0f6a('0x66')]);})[_0x0f6a('0x17')](function(_0x257cec){_0x3a1313=_0x257cec;logger[_0x0f6a('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3a1313['id']);return getTicket(_0x1f977f,_0x2f9aa0,_0x3a1313,_0x46fae7,_0x2b126c);})[_0x0f6a('0x17')](function(_0xec021b){if(_0xec021b){logger[_0x0f6a('0xd')](_0x0f6a('0x55'),_0xec021b['id']);switch(_0x1f977f['type']){case _0x0f6a('0x56'):logger[_0x0f6a('0xd')]('[OUTBOUND]',_0x0f6a('0x67'));return request({'uri':util['format'](_0x0f6a('0x57'),_0x1f977f[_0x0f6a('0x11')],_0x2f9aa0['id'],_0xec021b['id']),'method':'POST'});case _0x0f6a('0x58'):logger[_0x0f6a('0xd')]('[OUTBOUND]',_0x0f6a('0x68'));emit(util['format'](_0x0f6a('0x59'),_0xf847d[_0x0f6a('0x13')]),_0x0f6a('0x69'),{'uri':util[_0x0f6a('0xf')](_0x0f6a('0x6a'),_0x1f977f[_0x0f6a('0x11')][_0x0f6a('0x5a')]('/api/v2',''),_0xec021b['id'])});break;default:logger[_0x0f6a('0x5c')](_0x0f6a('0x63'),_0x0f6a('0x5d'));}}})[_0x0f6a('0x5e')](function(_0x1055dd){logger['error'](_0x0f6a('0x6b'),util[_0x0f6a('0x60')](_0x1055dd,{'showHidden':!![],'depth':null}));});};exports[_0x0f6a('0x6c')]=function(_0x380bbf,_0x326996,_0x285526,_0x56fbd8,_0x1eb084,_0x81c3df){var _0x20f025,_0x15f99f;_0x81c3df[_0x0f6a('0x11')]=intUtil[_0x0f6a('0x4b')](_0x81c3df[_0x0f6a('0x11')]);_0x81c3df[_0x0f6a('0x4c')]=intUtil['stripTrailingSlash'](_0x81c3df['serverUrl']);if(_0x1eb084&&_0x1eb084[_0x0f6a('0x6d')]){logger[_0x0f6a('0xd')]('['+_0x326996[_0x0f6a('0x6e')]['toUpperCase']()+']',_0x0f6a('0x4e'));_0x326996[_0x0f6a('0x51')]=util[_0x0f6a('0xf')](_0x0f6a('0x4f'),_0x81c3df[_0x0f6a('0x4c')],_0x326996[_0x0f6a('0x50')],md5(_0x326996[_0x0f6a('0x50')]));}else{_0x326996[_0x0f6a('0x51')]='';}headers['Authorization']=getAuth(_0x81c3df);return getUser(_0x81c3df)['then'](function(_0x19e6fc){_0x20f025=_0x19e6fc;logger[_0x0f6a('0xd')]('The\x20User\x20ID\x20is:',_0x20f025['id']);return getEndUser(_0x81c3df,_0x326996['calleridname'],_0x326996['calleridnum']);})['then'](function(_0x23594e){_0x15f99f=_0x23594e;logger['info'](_0x0f6a('0x6f'),_0x15f99f['id']);return getTicket(_0x81c3df,_0x20f025,_0x15f99f,_0x285526,_0x326996);})['then'](function(_0x375d9a){if(_0x375d9a){logger[_0x0f6a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x375d9a['id']);}})[_0x0f6a('0x5e')](function(_0xeab0ae){logger[_0x0f6a('0x5c')]('['+_0x326996[_0x0f6a('0x6e')][_0x0f6a('0x70')]()+']'+_0x0f6a('0x71'),util[_0x0f6a('0x60')](_0xeab0ae,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x65a1=['The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','defaults','forEach','includes','string','picklist','customField','toLowerCase','content','type','custom_fields','push','variableName','idField','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x3d9e5b,_0x42deea){var _0x596636=function(_0x2a4e56){while(--_0x2a4e56){_0x3d9e5b['push'](_0x3d9e5b['shift']());}};_0x596636(++_0x42deea);}(_0x65a1,0x1db));var _0x165a=function(_0x7be910,_0x2b381b){_0x7be910=_0x7be910-0x0;var _0x496ddf=_0x65a1[_0x7be910];return _0x496ddf;};'use strict';var _=require(_0x165a('0x0'));var rp=require(_0x165a('0x1'));var md5=require(_0x165a('0x2'));var util=require('util');var Redis=require(_0x165a('0x3'));var intUtil=require(_0x165a('0x4'));var config=require(_0x165a('0x5'));var logger=require(_0x165a('0x6'))(_0x165a('0x7'));config[_0x165a('0x8')]=_['defaults'](config[_0x165a('0x8')],{'host':_0x165a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x165a('0x8')]));function emit(_0x2952fe,_0xcd0d99,_0x3a6f58){io['to'](_0x2952fe)[_0x165a('0xa')](_0xcd0d99,_0x3a6f58);}var headers={'Content-Type':_0x165a('0xb'),'Accept':_0x165a('0xb')};function getTicket(_0x3c887d,_0x248312,_0x17fca8,_0x1bb89e,_0x182e91){logger[_0x165a('0xc')](_0x165a('0xd'));return request({'uri':util[_0x165a('0xe')](_0x165a('0xf'),_0x3c887d[_0x165a('0x10')]),'method':'POST','body':{'ticket':_[_0x165a('0x11')]({'requester_id':_0x17fca8['id'],'submitter_id':_0x248312?_0x248312['id']:undefined,'assignee_id':_0x248312?_0x248312['id']:undefined,'tags':getTags(_0x1bb89e[_0x165a('0x12')],_0x165a('0x13')),'subject':intUtil[_0x165a('0x14')](_0x1bb89e[_0x165a('0x15')],_0x182e91,'\x20'),'description':intUtil[_0x165a('0x14')](_0x1bb89e[_0x165a('0x16')],_0x182e91,'\x0a'),'comment':{'public':![],'body':intUtil[_0x165a('0x14')](_0x1bb89e[_0x165a('0x16')],_0x182e91,'\x0a')}},getCustomFields(_0x1bb89e[_0x165a('0x17')],_0x182e91))}})['then'](function(_0x5c068f){logger[_0x165a('0xc')](_0x165a('0x18'));return _0x5c068f[_0x165a('0x19')];});}function getUser(_0x3f93dd,_0x5d4fa6){if(intUtil[_0x165a('0x1a')](_0x5d4fa6)){logger[_0x165a('0xc')](_0x165a('0x1b'),_0x5d4fa6);return request({'uri':util[_0x165a('0xe')]('%s/search.json',_0x3f93dd[_0x165a('0x10')]),'qs':{'query':util[_0x165a('0xe')](_0x165a('0x1c'),_0x5d4fa6)}})[_0x165a('0x1d')](function(_0x53a8e7){if(_0x53a8e7[_0x165a('0x1e')]){logger[_0x165a('0xc')]('Agent\x20found!');return _[_0x165a('0x1f')](_0x53a8e7['results'],{'email':_0x5d4fa6,'role':_0x165a('0x20')});}else{logger[_0x165a('0xc')](_0x165a('0x21'));return request({'uri':util[_0x165a('0xe')](_0x165a('0x22'),_0x3f93dd[_0x165a('0x10')])})['then'](function(_0x25f70d){logger[_0x165a('0xc')](_0x165a('0x23'));return _0x25f70d[_0x165a('0x24')];});}});}else{logger[_0x165a('0xc')](_0x165a('0x21'));return request({'uri':util['format'](_0x165a('0x22'),_0x3f93dd[_0x165a('0x10')])})['then'](function(_0xcac7d5){logger['info'](_0x165a('0x23'));return _0xcac7d5[_0x165a('0x24')];});}}function getEndUser(_0x176c0b,_0x1fbbcd,_0x166c1d){logger[_0x165a('0xc')]('Searching\x20enduser\x20with\x20phone',_0x166c1d);return request({'uri':util['format']('%s/search.json',_0x176c0b[_0x165a('0x10')]),'qs':{'query':util[_0x165a('0xe')](_0x165a('0x25'),_0x166c1d)}})[_0x165a('0x1d')](function(_0xeffd5e){var _0x2017c6;if(_0xeffd5e[_0x165a('0x26')][_0x165a('0x27')]){_0xeffd5e[_0x165a('0x26')]=_[_0x165a('0x28')](_0xeffd5e[_0x165a('0x26')],{'suspended':![],'role':_0x165a('0x29')});if(_0xeffd5e['results'][_0x165a('0x27')]){_0x2017c6=_['first'](_0xeffd5e[_0x165a('0x26')]);}}if(_0x2017c6){logger[_0x165a('0xc')]('Enduser\x20found!');return _0x2017c6;}else{logger[_0x165a('0xc')](_0x165a('0x2a'));return request({'uri':util[_0x165a('0xe')](_0x165a('0x2b'),_0x176c0b[_0x165a('0x10')]),'method':_0x165a('0x2c'),'body':{'user':{'role':_0x165a('0x29'),'name':util[_0x165a('0xe')](_0x165a('0x2d'),_0x1fbbcd||_0x166c1d),'phone':_0x166c1d}}})[_0x165a('0x1d')](function(_0xd9e13d){logger[_0x165a('0xc')](_0x165a('0x2e'));return _0xd9e13d['user'];});}});}function getAuth(_0xf9b55b){var _0x39a853;if(_0xf9b55b[_0x165a('0x2f')]==='password'){_0x39a853=util['format'](_0x165a('0x30'),_0xf9b55b[_0x165a('0x31')],_0xf9b55b[_0x165a('0x32')]);}else if(_0xf9b55b[_0x165a('0x2f')]===_0x165a('0x33')){_0x39a853=util[_0x165a('0xe')](_0x165a('0x34'),_0xf9b55b[_0x165a('0x31')],_0xf9b55b['token']);}return util[_0x165a('0xe')](_0x165a('0x35'),new Buffer(_0x39a853)[_0x165a('0x36')](_0x165a('0x37')));}function request(_0x571619){logger[_0x165a('0x38')]('[HTTP]',JSON['stringify'](_0x571619));return rp(_[_0x165a('0x39')](_0x571619,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4a819c,_0x56fd79){var _0x5caa7c=[];if(_0x4a819c&&_0x4a819c[_0x165a('0x27')]>0x0){_0x5caa7c=_['map'](_0x4a819c,_0x56fd79);}return _0x5caa7c;}function getCustomFields(_0x3eaf69,_0x38fbad){var _0x663682=[];var _0x21a945={'custom_fields':[]};if(_0x3eaf69['length']>0x0){_[_0x165a('0x3a')](_0x3eaf69,function(_0x1b8276){if(_[_0x165a('0x3b')]([_0x165a('0x3c'),_0x165a('0x3d')],_0x1b8276['type'])&&_0x1b8276['nameField']&&!_0x1b8276[_0x165a('0x3e')]){_0x21a945[_0x1b8276['nameField'][_0x165a('0x3f')]()]=_0x1b8276[_0x165a('0x40')]['toString']();}else if(_['includes']([_0x165a('0x3c'),_0x165a('0x3d')],_0x1b8276[_0x165a('0x41')])&&_0x1b8276['idField']&&_0x1b8276[_0x165a('0x3e')]){_0x21a945[_0x165a('0x42')][_0x165a('0x43')]({'id':_0x1b8276['idField'],'value':_0x1b8276[_0x165a('0x40')][_0x165a('0x36')]()});}else if(_0x1b8276[_0x165a('0x41')]==='variable'&&_0x1b8276[_0x165a('0x44')]&&_0x1b8276[_0x165a('0x45')]&&_0x1b8276[_0x165a('0x3e')]){_0x38fbad[_0x1b8276[_0x165a('0x44')]]&&_0x21a945[_0x165a('0x42')][_0x165a('0x43')]({'id':_0x1b8276['idField'],'value':_0x38fbad[_0x1b8276[_0x165a('0x44')]][_0x165a('0x36')]()});}else if(_0x1b8276[_0x165a('0x41')]===_0x165a('0x46')&&_0x1b8276[_0x165a('0x47')]&&_0x1b8276[_0x165a('0x47')][_0x165a('0x13')]&&_0x1b8276[_0x165a('0x45')]&&_0x1b8276['customField']){_0x38fbad[_0x1b8276[_0x165a('0x47')][_0x165a('0x13')][_0x165a('0x3f')]()]&&_0x21a945[_0x165a('0x42')]['push']({'id':_0x1b8276[_0x165a('0x45')],'value':_0x38fbad[_0x1b8276[_0x165a('0x47')][_0x165a('0x13')]['toLowerCase']()][_0x165a('0x36')]()});}});}return _0x21a945;}exports[_0x165a('0x48')]=function(_0x2f1616,_0x12d9cf,_0x50d448,_0x52e4f2,_0x4eb8d1,_0x9d1aee){var _0x568f76,_0x3543b8;_0x9d1aee[_0x165a('0x10')]=intUtil['stripTrailingSlash'](_0x9d1aee[_0x165a('0x10')]);_0x9d1aee[_0x165a('0x49')]=intUtil[_0x165a('0x4a')](_0x9d1aee['serverUrl']);if(_0x4eb8d1&&_0x4eb8d1[_0x165a('0x4b')]){logger[_0x165a('0xc')](_0x165a('0x4c'),_0x165a('0x4d'));_0x12d9cf[_0x165a('0x4e')]=util[_0x165a('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9d1aee[_0x165a('0x49')],_0x12d9cf[_0x165a('0x4f')],md5(_0x12d9cf[_0x165a('0x4f')]));}else{_0x12d9cf[_0x165a('0x4e')]='';}headers[_0x165a('0x50')]=getAuth(_0x9d1aee);return getUser(_0x9d1aee,_0x52e4f2[_0x165a('0x51')])[_0x165a('0x1d')](function(_0x3cd509){_0x568f76=_0x3cd509;logger[_0x165a('0xc')]('The\x20User\x20ID\x20is:',_0x568f76['id']);return getEndUser(_0x9d1aee,_0x12d9cf[_0x165a('0x52')],_0x12d9cf[_0x165a('0x53')]);})[_0x165a('0x1d')](function(_0x3e4e80){_0x3543b8=_0x3e4e80;logger[_0x165a('0xc')](_0x165a('0x54'),_0x3543b8['id']);return getTicket(_0x9d1aee,_0x568f76,_0x3543b8,_0x50d448,_0x12d9cf);})[_0x165a('0x1d')](function(_0x1ad7b3){if(_0x1ad7b3){logger[_0x165a('0xc')](_0x165a('0x55'),_0x1ad7b3['id']);switch(_0x9d1aee[_0x165a('0x41')]){case _0x165a('0x56'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x9d1aee[_0x165a('0x10')],_0x568f76['id'],_0x1ad7b3['id']),'method':_0x165a('0x2c')});case _0x165a('0x57'):logger[_0x165a('0xc')](_0x165a('0x4c'),_0x165a('0x58'));emit(util[_0x165a('0xe')]('user:%s',_0x52e4f2[_0x165a('0x13')]),_0x165a('0x59'),{'uri':util[_0x165a('0xe')](_0x165a('0x5a'),_0x9d1aee[_0x165a('0x10')][_0x165a('0x5b')](_0x165a('0x5c'),''),_0x1ad7b3['id'])});break;default:logger[_0x165a('0x5d')](_0x165a('0x4c'),_0x165a('0x5e'));}}})[_0x165a('0x5f')](function(_0x230b42){logger[_0x165a('0x5d')](_0x165a('0x60'),util['inspect'](_0x230b42,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4cc807,_0x47c768,_0x5ef322,_0x1c6f76,_0x39a9f8,_0x23ce4e,_0x50206d){var _0x4f81c7,_0x3007df;_0x23ce4e['remoteUri']=intUtil[_0x165a('0x4a')](_0x23ce4e[_0x165a('0x10')]);_0x23ce4e[_0x165a('0x49')]=intUtil[_0x165a('0x4a')](_0x23ce4e[_0x165a('0x49')]);if(_0x50206d&&_0x50206d[_0x165a('0x61')]&&_0x50206d[_0x165a('0x61')]!=='none'){logger['info'](_0x165a('0x62'),_0x165a('0x4d'));_0x47c768[_0x165a('0x4e')]=util[_0x165a('0xe')](_0x165a('0x63'),_0x23ce4e[_0x165a('0x49')],_0x47c768['uniqueid'],md5(_0x47c768['uniqueid']));}headers[_0x165a('0x50')]=getAuth(_0x23ce4e);return getUser(_0x23ce4e,_0x1c6f76[_0x165a('0x51')])['then'](function(_0x349c7c){_0x4f81c7=_0x349c7c;logger[_0x165a('0xc')](_0x165a('0x64'),_0x4f81c7['id']);return getEndUser(_0x23ce4e,_0x47c768[_0x165a('0x65')],_0x47c768[_0x165a('0x66')]);})['then'](function(_0x47afef){_0x3007df=_0x47afef;logger[_0x165a('0xc')](_0x165a('0x54'),_0x3007df['id']);return getTicket(_0x23ce4e,_0x4f81c7,_0x3007df,_0x5ef322,_0x47c768);})[_0x165a('0x1d')](function(_0xe90b){if(_0xe90b){logger['info'](_0x165a('0x55'),_0xe90b['id']);switch(_0x23ce4e[_0x165a('0x41')]){case _0x165a('0x56'):logger[_0x165a('0xc')](_0x165a('0x62'),_0x165a('0x67'));return request({'uri':util[_0x165a('0xe')](_0x165a('0x68'),_0x23ce4e['remoteUri'],_0x4f81c7['id'],_0xe90b['id']),'method':_0x165a('0x2c')});case _0x165a('0x57'):logger['info'](_0x165a('0x62'),_0x165a('0x58'));emit(util[_0x165a('0xe')](_0x165a('0x69'),_0x1c6f76[_0x165a('0x13')]),_0x165a('0x59'),{'uri':util[_0x165a('0xe')](_0x165a('0x5a'),_0x23ce4e[_0x165a('0x10')]['replace']('/api/v2',''),_0xe90b['id'])});break;default:logger[_0x165a('0x5d')](_0x165a('0x62'),_0x165a('0x5e'));}}})[_0x165a('0x5f')](function(_0x35bc89){logger[_0x165a('0x5d')](_0x165a('0x6a'),util[_0x165a('0x6b')](_0x35bc89,{'showHidden':!![],'depth':null}));});};exports[_0x165a('0x6c')]=function(_0x1882e1,_0x353b0e,_0x53f308,_0x30e300,_0x18e0f0,_0x3a9062){var _0x26944e,_0x3b3acc;_0x3a9062[_0x165a('0x10')]=intUtil[_0x165a('0x4a')](_0x3a9062[_0x165a('0x10')]);_0x3a9062['serverUrl']=intUtil['stripTrailingSlash'](_0x3a9062[_0x165a('0x49')]);if(_0x18e0f0&&_0x18e0f0[_0x165a('0x4b')]){logger['info']('['+_0x353b0e[_0x165a('0x6d')]['toUpperCase']()+']',_0x165a('0x4d'));_0x353b0e[_0x165a('0x4e')]=util[_0x165a('0xe')](_0x165a('0x63'),_0x3a9062[_0x165a('0x49')],_0x353b0e[_0x165a('0x4f')],md5(_0x353b0e[_0x165a('0x4f')]));}else{_0x353b0e[_0x165a('0x4e')]='';}headers[_0x165a('0x50')]=getAuth(_0x3a9062);return getUser(_0x3a9062)['then'](function(_0x1cfb3d){_0x26944e=_0x1cfb3d;logger['info']('The\x20User\x20ID\x20is:',_0x26944e['id']);return getEndUser(_0x3a9062,_0x353b0e[_0x165a('0x52')],_0x353b0e[_0x165a('0x53')]);})[_0x165a('0x1d')](function(_0x4ce740){_0x3b3acc=_0x4ce740;logger[_0x165a('0xc')](_0x165a('0x54'),_0x3b3acc['id']);return getTicket(_0x3a9062,_0x26944e,_0x3b3acc,_0x53f308,_0x353b0e);})[_0x165a('0x1d')](function(_0x369c89){if(_0x369c89){logger['info'](_0x165a('0x55'),_0x369c89['id']);}})[_0x165a('0x5f')](function(_0x5dd232){logger[_0x165a('0x5d')]('['+_0x353b0e[_0x165a('0x6d')][_0x165a('0x6e')]()+']'+_0x165a('0x6f'),util[_0x165a('0x6b')](_0x5dd232,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index b0f9102..c0e2c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8be=['abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','Inbound','merge','/crm/v2/Calls','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','toString','variableName','customVariable','Variable','name','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','data','enduserType','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','rejected','Rejected'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0xc8be,0x15d));var _0xec8b=function(_0x74d5a3,_0x5830a7){_0x74d5a3=_0x74d5a3-0x0;var _0xa34487=_0xc8be[_0x74d5a3];return _0xa34487;};'use strict';var _=require(_0xec8b('0x0'));var rp=require(_0xec8b('0x1'));var md5=require(_0xec8b('0x2'));var util=require(_0xec8b('0x3'));var intUtil=require(_0xec8b('0x4'));var moment=require(_0xec8b('0x5'));var Redis=require('ioredis');var BPromise=require(_0xec8b('0x6'));var config=require(_0xec8b('0x7'));var logger=require(_0xec8b('0x8'))(_0xec8b('0x9'));config[_0xec8b('0xa')]=_[_0xec8b('0xb')](config[_0xec8b('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xec8b('0xc'))(new Redis(config['redis']));function emit(_0x36b91a,_0x22bda1,_0x16389f){io['to'](_0x36b91a)[_0xec8b('0xd')](_0x22bda1,_0x16389f);}function request(_0x1e2046){logger['debug'](_0xec8b('0xe'),JSON[_0xec8b('0xf')](_0x1e2046));return rp(_0x1e2046);}function getCustomFields(_0x58bee1,_0x5a357b){var _0x2bfae0={};if(_0x58bee1[_0xec8b('0x10')]>0x0){_[_0xec8b('0x11')](_0x58bee1,function(_0x4433c7){if(_[_0xec8b('0x12')](['string',_0xec8b('0x13')],_0x4433c7[_0xec8b('0x14')])&&_0x4433c7[_0xec8b('0x15')]){_0x2bfae0[_0x4433c7[_0xec8b('0x15')]]=_0x4433c7['content'][_0xec8b('0x16')]();}else if(_0x4433c7['type']==='variable'&&_0x4433c7['variableName']&&_0x4433c7[_0xec8b('0x15')]&&_0x5a357b[_0x4433c7[_0xec8b('0x17')]]){_0x2bfae0[_0x4433c7[_0xec8b('0x15')]]=_0x5a357b[_0x4433c7[_0xec8b('0x17')]]['toString']();}else if(_0x4433c7[_0xec8b('0x14')]===_0xec8b('0x18')&&_0x4433c7['Variable']&&_0x4433c7['Variable']['name']&&_0x4433c7['idField']&&_0x5a357b[_0x4433c7[_0xec8b('0x19')]['name']['toLowerCase']()]){_0x2bfae0[_0x4433c7[_0xec8b('0x15')]]=_0x5a357b[_0x4433c7['Variable'][_0xec8b('0x1a')]['toLowerCase']()][_0xec8b('0x16')]();}});}return _0x2bfae0;}function getName(_0x4c455c){if(_0x4c455c[_0xec8b('0x1b')]('\x20')>0x0){var _0x1ac260=_0x4c455c[_0xec8b('0x1c')](/ (.+)/);if(_0x1ac260[0x1]){return _0x1ac260;}}return[_0x4c455c,_0x4c455c];}var accountsTokens={};function getAccessToken(_0x3a4311){return new Promise(function(_0x513e9e,_0x43cfbd){if(!_[_0xec8b('0x1d')](accountsTokens[_0x3a4311['id']])&&!_[_0xec8b('0x1d')](accountsTokens[_0x3a4311['id']][_0xec8b('0x1e')])){if(moment()[_0xec8b('0x1f')](accountsTokens[_0x3a4311['id']]['expires_in'])){_0x513e9e(accountsTokens[_0x3a4311['id']][_0xec8b('0x1e')]);}}var _0x4a31f3;switch(_0x3a4311[_0xec8b('0x20')]){case'US':_0x4a31f3=_0xec8b('0x21');break;case'AU':_0x4a31f3=_0xec8b('0x22');break;case'EU':_0x4a31f3=_0xec8b('0x23');break;case'IN':_0x4a31f3='https://accounts.zoho.in';break;case'CN':_0x4a31f3='https://accounts.zoho.com.cn';break;default:_0x4a31f3=_0xec8b('0x23');break;}var _0x5b5c78={'method':_0xec8b('0x24'),'uri':_0x4a31f3+_0xec8b('0x25'),'qs':{'refresh_token':_0x3a4311[_0xec8b('0x26')],'client_id':_0x3a4311['clientId'],'client_secret':_0x3a4311[_0xec8b('0x27')],'grant_type':_0xec8b('0x28')},'json':!![]};return rp(_0x5b5c78)['then'](function(_0x36d7a6){accountsTokens[_0x3a4311['id']]={'access_token':_0x36d7a6[_0xec8b('0x1e')],'expires_in':moment()[_0xec8b('0x29')](_0x36d7a6[_0xec8b('0x2a')],_0xec8b('0x2b'))};_0x513e9e(_0x36d7a6[_0xec8b('0x1e')]);})[_0xec8b('0x2c')](function(_0x3a3018){logger[_0xec8b('0x2d')](_0xec8b('0x2e'),_0x3a3018[_0xec8b('0x2f')]);_0x43cfbd(_0x3a3018);});});}function getUser(_0x4c3a9f,_0x1913dc,_0x14ead5,_0x4b820a){logger[_0xec8b('0x30')](_0xec8b('0x31'));return request({'method':_0xec8b('0x32'),'uri':util[_0xec8b('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x1913dc),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xec8b('0x34')+_0x4c3a9f},'json':!![]})[_0xec8b('0x35')](function(_0x4bb0c5){if(_0x4bb0c5[_0xec8b('0x36')]){var _0x29a6a2=-0x1;if(_[_0xec8b('0x37')](_0x4bb0c5[_0xec8b('0x36')])){if(!_[_0xec8b('0x1d')](_0x4b820a)){_0x29a6a2=_[_0xec8b('0x38')](_0x4bb0c5[_0xec8b('0x36')],function(_0x3da573){return _0x3da573[_0xec8b('0x39')]===_0x4b820a;});}if(_0x29a6a2>=0x0){logger['info'](_0xec8b('0x3a'));}else{logger[_0xec8b('0x30')]('Using\x20the\x20admin\x20account!');_0x29a6a2=_[_0xec8b('0x38')](_0x4bb0c5[_0xec8b('0x36')],function(_0x32aab9){return _0x32aab9['profile']['name']===_0xec8b('0x3b');});}return _0x4bb0c5[_0xec8b('0x36')][_0x29a6a2];}else{if(_0x4bb0c5[_0xec8b('0x3c')][_0xec8b('0x3d')][_0xec8b('0x1a')]===_0xec8b('0x3b')){logger[_0xec8b('0x30')](_0xec8b('0x3e'));user=_0x4bb0c5[_0xec8b('0x3c')];return user;}else{logger['error'](_0xec8b('0x3f'),JSON[_0xec8b('0xf')](_0x4bb0c5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xec8b('0xf')](_0x4bb0c5));}}}else{logger[_0xec8b('0x2d')](_0xec8b('0x3f'),JSON[_0xec8b('0xf')](_0x4bb0c5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x4bb0c5));}})[_0xec8b('0x2c')](function(_0x4c0763){console[_0xec8b('0x2d')](_0x4c0763);});}function getZohoUser(_0x3bea97,_0x1009ad){return new BPromise(function(_0x3086d0,_0x58187c){request(_0x3bea97)[_0xec8b('0x35')](function(_0xab8da5){var _0x3fcb7c=null;if(_0xab8da5){_0x3fcb7c=_0xab8da5['data'][0x0];_0x3fcb7c['enduserType']=_0x1009ad;}_0x3086d0(_0x3fcb7c);})[_0xec8b('0x2c')](function(_0xf14485){_0x58187c(_0xf14485);});});}function createEndUser(_0x54aa05,_0xd04797,_0x2e7d8c,_0x3d4cce,_0x454f29,_0x408ab2){var _0x2e7d8c=getName(_0x2e7d8c);return request({'method':'POST','uri':'https://www.zohoapis.'+_0xd04797+_0xec8b('0x40')+_[_0xec8b('0x41')](_0x408ab2[_0xec8b('0x42')])+'s','body':{'data':[{'Last_Name':_0x2e7d8c[0x1],'First_Name':_0x2e7d8c[0x0],'Phone':_0x3d4cce,'Owner':{'name':!_[_0xec8b('0x1d')](_0x454f29[_0xec8b('0x43')][_0xec8b('0x1a')])?_0x454f29[_0xec8b('0x43')][_0xec8b('0x1a')]:!_[_0xec8b('0x1d')](_0x454f29[_0xec8b('0x44')])?_0x454f29[_0xec8b('0x44')]+'\x20'+_0x454f29[_0xec8b('0x45')]:_0x454f29[_0xec8b('0x45')],'id':_0x454f29['id']}}]},'headers':{'Authorization':_0xec8b('0x34')+_0x54aa05},'json':!![]})[_0xec8b('0x35')](function(_0x5b5af0){if(_0x5b5af0&&_0x5b5af0['data'][0x0][_0xec8b('0x46')]===_0xec8b('0x47')){var _0x5a2996=_0x5b5af0[_0xec8b('0x48')][0x0]['details'];_0x5a2996[_0xec8b('0x49')]=_[_0xec8b('0x41')](_0x408ab2['moduleCreate'])+'s';return _0x5a2996;}logger[_0xec8b('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xec8b('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x546d50){console[_0xec8b('0x4a')](_0xec8b('0x4b'),_0x546d50);});}function getEndUser(_0x2e11fb,_0x57a0c1,_0x4868cc,_0x1b9225,_0x82a34e,_0x1ad482,_0x25f9e4){var _0x58a244={'method':_0xec8b('0x32'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2e11fb},'json':!![]};switch(_0x25f9e4[_0xec8b('0x4c')]){case _0xec8b('0x4d'):_0x58a244[_0xec8b('0x4e')]=_0xec8b('0x4f')+_0x57a0c1+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x82a34e+'))';return getZohoUser(_0x58a244,_0xec8b('0x50'))[_0xec8b('0x35')](function(_0x482288){if(_0x482288)return _0x482288;_0x58a244['uri']=_0xec8b('0x4f')+_0x57a0c1+_0xec8b('0x51')+_0x82a34e+'))';return getZohoUser(_0x58a244,_0xec8b('0x52'))[_0xec8b('0x35')](function(_0xd6b353){if(_0xd6b353)return _0xd6b353;if(_0x25f9e4[_0xec8b('0x42')]!=_0xec8b('0x53')){return createEndUser(_0x2e11fb,_0x57a0c1,_0x1b9225,_0x82a34e,_0x1ad482,_0x25f9e4);}else{return{};}});});break;case _0xec8b('0x54'):_0x58a244[_0xec8b('0x4e')]=_0xec8b('0x4f')+_0x57a0c1+_0xec8b('0x55')+_0x82a34e+'))';return getZohoUser(_0x58a244,_0xec8b('0x50'))[_0xec8b('0x35')](function(_0x16c29c){if(_0x16c29c)return _0x16c29c;if(_0x25f9e4[_0xec8b('0x42')]!=_0xec8b('0x53')){return createEndUser(_0x2e11fb,_0x57a0c1,_0x1b9225,_0x82a34e,_0x1ad482,_0x25f9e4);}else{return{};}});break;case'lead':_0x58a244[_0xec8b('0x4e')]='https://www.zohoapis.'+_0x57a0c1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x82a34e+'))';return getZohoUser(_0x58a244,_0xec8b('0x52'))['then'](function(_0x21c384){if(_0x21c384)return _0x21c384;if(_0x25f9e4[_0xec8b('0x42')]!=_0xec8b('0x53')){return createEndUser(_0x2e11fb,_0x57a0c1,_0x1b9225,_0x82a34e,_0x1ad482,_0x25f9e4);}else{return{};}});break;}}function getCall(_0x443f05,_0x2b1503,_0x3144fd,_0x5b0dd8,_0x1822e3,_0x489bba,_0x2b5a1b,_0x3003cd){logger['info'](_0xec8b('0x56'));var _0x1c48fa={};_0x1c48fa['Owner']={'name':!_['isNil'](_0x5b0dd8[_0xec8b('0x43')][_0xec8b('0x1a')])&&!_[_0xec8b('0x1d')](_0x5b0dd8[_0xec8b('0x3d')][_0xec8b('0x1a')])&&_0x5b0dd8[_0xec8b('0x3d')][_0xec8b('0x1a')]===_0xec8b('0x57')?_0x5b0dd8[_0xec8b('0x43')][_0xec8b('0x1a')]:!_[_0xec8b('0x1d')](_0x5b0dd8[_0xec8b('0x44')])?_0x5b0dd8[_0xec8b('0x44')]+'\x20'+_0x5b0dd8[_0xec8b('0x45')]:_0x5b0dd8[_0xec8b('0x45')],'id':_0x5b0dd8['id']};_0x1c48fa[_0xec8b('0x58')]=intUtil[_0xec8b('0x59')](_0x489bba[_0xec8b('0x5a')],_0x2b5a1b,'\x20');_0x1c48fa[_0xec8b('0x5b')]=intUtil[_0xec8b('0x59')](_0x489bba[_0xec8b('0x5c')],_0x2b5a1b,'\x0a');if(_0x1822e3[_0xec8b('0x49')]===_0xec8b('0x50')){_0x1c48fa[_0xec8b('0x5d')]={'name':!_[_0xec8b('0x1d')](_0x1822e3[_0xec8b('0x5e')])?_0x1822e3[_0xec8b('0x5e')]:!_['isNil'](_0x1822e3[_0xec8b('0x5f')])?_0x1822e3[_0xec8b('0x5f')]+'\x20'+_0x1822e3[_0xec8b('0x60')]:_0x1822e3[_0xec8b('0x60')],'id':_0x1822e3['id']};}if(_0x1822e3[_0xec8b('0x49')]==='Leads'){_0x1c48fa[_0xec8b('0x61')]={'name':!_[_0xec8b('0x1d')](_0x1822e3['Full_Name'])?_0x1822e3[_0xec8b('0x5e')]:!_[_0xec8b('0x1d')](_0x1822e3[_0xec8b('0x5f')])?_0x1822e3[_0xec8b('0x5f')]+'\x20'+_0x1822e3['Last_Name']:_0x1822e3[_0xec8b('0x60')],'id':_0x1822e3['id']};_0x1c48fa[_0xec8b('0x62')]=_[_0xec8b('0x41')](_0x1822e3[_0xec8b('0x49')]);}if(_0x2b5a1b['talktime']){_0x1c48fa[_0xec8b('0x63')]=moment[_0xec8b('0x64')](parseInt(_0x2b5a1b[_0xec8b('0x65')])*0x3e8)[_0xec8b('0x33')]('mm:ss');}else if(_0x2b5a1b[_0xec8b('0x66')]&&_0x2b5a1b['endtime']){_0x1c48fa[_0xec8b('0x63')]=moment['utc'](moment(_0x2b5a1b[_0xec8b('0x67')],_0xec8b('0x68'))[_0xec8b('0x69')](moment(_0x2b5a1b['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xec8b('0x33')]('mm:ss');}switch(_0x2b5a1b[_0xec8b('0x6a')]){case _0xec8b('0x6b'):_0x1c48fa[_0xec8b('0x6c')]=_0xec8b('0x6d');break;case _0xec8b('0x6e'):case'connect':_0x1c48fa['Call_Result']='Answered';break;case _0xec8b('0x6f'):_0x1c48fa[_0xec8b('0x6c')]=_0xec8b('0x70');break;case _0xec8b('0x71'):_0x1c48fa['Call_Result']=_0xec8b('0x72');break;case _0xec8b('0x73'):_0x1c48fa[_0xec8b('0x6c')]=_0xec8b('0x74');default:}_0x1c48fa[_0xec8b('0x75')]=(_0x3003cd===_0xec8b('0x76')?moment(_0x2b5a1b[_0xec8b('0x77')])['format'](_0xec8b('0x68')):moment(_0x2b5a1b['agentcalledAt'])[_0xec8b('0x33')](_0xec8b('0x68')))||moment()['format'](_0xec8b('0x68'));_0x1c48fa['Call_Type']=_0x3003cd||_0xec8b('0x78');_0x1c48fa=_[_0xec8b('0x79')](_0x1c48fa,getCustomFields(_0x489bba['Fields'],_0x2b5a1b));return request({'method':_0xec8b('0x24'),'uri':'https://www.zohoapis.'+_0x2b1503+_0xec8b('0x7a'),'headers':{'Authorization':_0xec8b('0x34')+_0x443f05},'body':{'data':[_0x1c48fa]},'json':!![]})[_0xec8b('0x35')](function(_0x5939da){if(_0x5939da&&_0x5939da[_0xec8b('0x48')][0x0][_0xec8b('0x46')]===_0xec8b('0x47')){logger['info'](_0xec8b('0x7b'));return{'id':_0x5939da[_0xec8b('0x48')][0x0][_0xec8b('0x7c')]['id']};}})[_0xec8b('0x2c')](function(_0x25a771){logger[_0xec8b('0x30')]('err',_0x25a771['stack']);console[_0xec8b('0x4a')](_0xec8b('0x7d'),_0x25a771);});}exports['queue']=function(_0x510489,_0x218083,_0xd58095,_0x1371ca,_0x3fff7a,_0x2a048b){var _0x58f2d0,_0x2333b7,_0x29c02c;_0x2a048b['host']=intUtil['stripTrailingSlash'](_0x2a048b[_0xec8b('0x7e')]);_0x2a048b['serverUrl']=intUtil[_0xec8b('0x7f')](_0x2a048b[_0xec8b('0x80')]);if(_0x3fff7a&&_0x3fff7a[_0xec8b('0x81')]){logger['info'](_0xec8b('0x82'),_0xec8b('0x83'));_0x218083[_0xec8b('0x84')]=_0x2a048b[_0xec8b('0x80')]+_0xec8b('0x85')+_0x218083[_0xec8b('0x86')]+_0xec8b('0x87')+md5(_0x218083[_0xec8b('0x86')]);}else{_0x218083[_0xec8b('0x84')]='';}var _0x53253d=_0x2a048b[_0xec8b('0x7e')]===_0xec8b('0x88')?'eu':'com';return getAccessToken(_0x2a048b)[_0xec8b('0x35')](function(_0x209e82){_0x29c02c=_0x209e82;return getUser(_0x29c02c,_0x53253d,_0x2a048b,_0x1371ca[_0xec8b('0x39')]);})['then'](function(_0x3c36fd){_0x58f2d0=_0x3c36fd;logger['info'](_0xec8b('0x89'),_0x58f2d0['id']);return getEndUser(_0x29c02c,_0x53253d,_0x2a048b,_0x218083['calleridname'],_0x218083['calleridnum'],_0x58f2d0,_0xd58095);})[_0xec8b('0x35')](function(_0x1c8108){_0x2333b7=_0x1c8108;return getCall(_0x29c02c,_0x53253d,_0x2a048b,_0x58f2d0,_0x2333b7,_0xd58095,_0x218083,_0xec8b('0x78'));})[_0xec8b('0x35')](function(_0x2acf1d){if(_0x2acf1d){logger[_0xec8b('0x30')](_0xec8b('0x8a'),_0x2acf1d['id']);logger[_0xec8b('0x30')](_0xec8b('0x82'),_0xec8b('0x8b'));emit(util['format']('user:%s',_0x1371ca[_0xec8b('0x1a')]),_0xec8b('0x8c'),{'uri':_0xec8b('0x8d')+_0x2a048b['host']+_0xec8b('0x8e')+_0x2acf1d['id']});}})[_0xec8b('0x2c')](function(_0x78ad74){logger[_0xec8b('0x2d')](_0xec8b('0x82'),JSON[_0xec8b('0xf')](_0x78ad74));});};exports[_0xec8b('0x76')]=function(_0x404e07,_0x5c7a4b,_0x558e79,_0x7f2a64,_0x4526c7,_0x4bcc86,_0x258941){var _0x3413eb,_0x2734be,_0x1414ca;_0x4bcc86[_0xec8b('0x7e')]=intUtil[_0xec8b('0x7f')](_0x4bcc86[_0xec8b('0x7e')]);_0x4bcc86[_0xec8b('0x80')]=intUtil['stripTrailingSlash'](_0x4bcc86['serverUrl']);if(_0x258941&&_0x258941[_0xec8b('0x8f')]&&_0x258941[_0xec8b('0x8f')]!==_0xec8b('0x90')){logger['info'](_0xec8b('0x91'),_0xec8b('0x83'));_0x5c7a4b['recordingURL']=_0x4bcc86[_0xec8b('0x80')]+_0xec8b('0x85')+_0x5c7a4b[_0xec8b('0x86')]+_0xec8b('0x87')+md5(_0x5c7a4b[_0xec8b('0x86')]);}var _0x11b386=_0x4bcc86['host']===_0xec8b('0x88')?'eu':_0xec8b('0x92');return getAccessToken(_0x4bcc86)[_0xec8b('0x35')](function(_0x3da227){_0x1414ca=_0x3da227;return getUser(_0x1414ca,_0x11b386,_0x4bcc86,_0x7f2a64[_0xec8b('0x39')]);})[_0xec8b('0x35')](function(_0x5278cd){_0x3413eb=_0x5278cd;logger[_0xec8b('0x30')]('The\x20User\x20ID\x20is:',_0x3413eb['id']);return getEndUser(_0x1414ca,_0x11b386,_0x4bcc86,_0x5c7a4b[_0xec8b('0x93')],_0x5c7a4b[_0xec8b('0x94')],_0x3413eb,_0x558e79);})['then'](function(_0x11d2d6){_0x2734be=_0x11d2d6;return getCall(_0x1414ca,_0x11b386,_0x4bcc86,_0x3413eb,_0x2734be,_0x558e79,_0x5c7a4b,_0xec8b('0x95'));})[_0xec8b('0x35')](function(_0x371c3a){if(_0x371c3a){logger['info']('The\x20Call\x20ID\x20is:',_0x371c3a['id']);logger[_0xec8b('0x30')]('[OUTBOUND]',_0xec8b('0x8b'));emit(util[_0xec8b('0x33')](_0xec8b('0x96'),_0x7f2a64['name']),_0xec8b('0x8c'),{'uri':_0xec8b('0x8d')+_0x4bcc86[_0xec8b('0x7e')]+_0xec8b('0x8e')+_0x371c3a['id']});}})['catch'](function(_0x124719){logger[_0xec8b('0x2d')](_0xec8b('0x91'),JSON['stringify'](_0x124719));});};exports[_0xec8b('0x97')]=function(_0x254244,_0xe8cb9,_0x16d871,_0x41a56a,_0x31bee4,_0x938e79){var _0x24e90f,_0x40b55e,_0x3f112b;_0x938e79[_0xec8b('0x7e')]=intUtil['stripTrailingSlash'](_0x938e79[_0xec8b('0x7e')]);_0x938e79[_0xec8b('0x80')]=intUtil[_0xec8b('0x7f')](_0x938e79[_0xec8b('0x80')]);if(_0x31bee4&&_0x31bee4[_0xec8b('0x81')]){logger['info']('['+_0xe8cb9[_0xec8b('0x6a')][_0xec8b('0x98')]()+']',_0xec8b('0x83'));_0xe8cb9[_0xec8b('0x84')]=_0x938e79[_0xec8b('0x80')]+_0xec8b('0x85')+_0xe8cb9[_0xec8b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0xe8cb9[_0xec8b('0x86')]);}else{_0xe8cb9[_0xec8b('0x84')]='';}var _0x29bf6c=_0x938e79[_0xec8b('0x7e')]===_0xec8b('0x88')?'eu':_0xec8b('0x92');return getAccessToken(_0x938e79)[_0xec8b('0x35')](function(_0x1a9c75){_0x3f112b=_0x1a9c75;return getUser(_0x3f112b,_0x29bf6c,_0x938e79);})['then'](function(_0x116835){_0x24e90f=_0x116835;logger[_0xec8b('0x30')]('The\x20User\x20ID\x20is:',_0x24e90f['id']);return getEndUser(_0x3f112b,_0x29bf6c,_0x938e79,_0xe8cb9[_0xec8b('0x99')],_0xe8cb9['calleridnum'],_0x24e90f,_0x16d871);})[_0xec8b('0x35')](function(_0x572716){_0x40b55e=_0x572716;return getCall(_0x3f112b,_0x29bf6c,_0x938e79,_0x24e90f,_0x40b55e,_0x16d871,_0xe8cb9,_0xec8b('0x78'));})[_0xec8b('0x35')](function(_0xf942fe){if(_0xf942fe){logger[_0xec8b('0x30')](_0xec8b('0x8a'),_0xf942fe['id']);}})['catch'](function(_0x23b9fd){logger['error']('['+_0xe8cb9[_0xec8b('0x6a')]['toUpperCase']()+']',JSON[_0xec8b('0xf')](_0x23b9fd));});};
\ No newline at end of file
+var _0x7a4f=['Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','code','log','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','zoho.eu','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','catch','error','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Creating\x20new\x20call...'];(function(_0x2a0fc4,_0x2eaf74){var _0x531d00=function(_0xa4388f){while(--_0xa4388f){_0x2a0fc4['push'](_0x2a0fc4['shift']());}};_0x531d00(++_0x2eaf74);}(_0x7a4f,0x17a));var _0xf7a4=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0x7a4f[_0x1c8c07];return _0x4aa88f;};'use strict';var _=require('lodash');var rp=require(_0xf7a4('0x0'));var md5=require(_0xf7a4('0x1'));var util=require('util');var intUtil=require(_0xf7a4('0x2'));var moment=require(_0xf7a4('0x3'));var Redis=require(_0xf7a4('0x4'));var BPromise=require(_0xf7a4('0x5'));var config=require('../../../../config/environment');var logger=require(_0xf7a4('0x6'))('zoho');config[_0xf7a4('0x7')]=_[_0xf7a4('0x8')](config['redis'],{'host':_0xf7a4('0x9'),'port':0x18eb});var io=require(_0xf7a4('0xa'))(new Redis(config[_0xf7a4('0x7')]));function emit(_0x18e386,_0x166bdd,_0x228dae){io['to'](_0x18e386)[_0xf7a4('0xb')](_0x166bdd,_0x228dae);}function request(_0x42dfb3){logger[_0xf7a4('0xc')](_0xf7a4('0xd'),JSON[_0xf7a4('0xe')](_0x42dfb3));return rp(_0x42dfb3);}function getCustomFields(_0x293078,_0x50e94a){var _0x1d1df7={};if(_0x293078[_0xf7a4('0xf')]>0x0){_['forEach'](_0x293078,function(_0x28294b){if(_[_0xf7a4('0x10')](['string',_0xf7a4('0x11')],_0x28294b[_0xf7a4('0x12')])&&_0x28294b[_0xf7a4('0x13')]){_0x1d1df7[_0x28294b[_0xf7a4('0x13')]]=_0x28294b[_0xf7a4('0x14')][_0xf7a4('0x15')]();}else if(_0x28294b[_0xf7a4('0x12')]===_0xf7a4('0x16')&&_0x28294b[_0xf7a4('0x17')]&&_0x28294b['idField']&&_0x50e94a[_0x28294b[_0xf7a4('0x17')]]){_0x1d1df7[_0x28294b[_0xf7a4('0x13')]]=_0x50e94a[_0x28294b['variableName']][_0xf7a4('0x15')]();}else if(_0x28294b['type']===_0xf7a4('0x18')&&_0x28294b[_0xf7a4('0x19')]&&_0x28294b['Variable']['name']&&_0x28294b[_0xf7a4('0x13')]&&_0x50e94a[_0x28294b['Variable'][_0xf7a4('0x1a')]['toLowerCase']()]){_0x1d1df7[_0x28294b[_0xf7a4('0x13')]]=_0x50e94a[_0x28294b[_0xf7a4('0x19')][_0xf7a4('0x1a')][_0xf7a4('0x1b')]()][_0xf7a4('0x15')]();}});}return _0x1d1df7;}function getName(_0xab0b8b){if(_0xab0b8b['indexOf']('\x20')>0x0){var _0x42b65b=_0xab0b8b[_0xf7a4('0x1c')](/ (.+)/);if(_0x42b65b[0x1]){return _0x42b65b;}}return[_0xab0b8b,_0xab0b8b];}var accountsTokens={};function getAccessToken(_0x484677){return new Promise(function(_0x42e04f,_0x1a1e41){if(!_[_0xf7a4('0x1d')](accountsTokens[_0x484677['id']])&&!_[_0xf7a4('0x1d')](accountsTokens[_0x484677['id']]['access_token'])){if(moment()[_0xf7a4('0x1e')](accountsTokens[_0x484677['id']]['expires_in'])){_0x42e04f(accountsTokens[_0x484677['id']][_0xf7a4('0x1f')]);}}var _0x2a59ae;switch(_0x484677[_0xf7a4('0x20')]){case'US':_0x2a59ae=_0xf7a4('0x21');break;case'AU':_0x2a59ae=_0xf7a4('0x22');break;case'EU':_0x2a59ae=_0xf7a4('0x23');break;case'IN':_0x2a59ae='https://accounts.zoho.in';break;case'CN':_0x2a59ae=_0xf7a4('0x24');break;default:_0x2a59ae='https://accounts.zoho.eu';break;}var _0x340ba4={'method':_0xf7a4('0x25'),'uri':_0x2a59ae+'/oauth/v2/token','qs':{'refresh_token':_0x484677[_0xf7a4('0x26')],'client_id':_0x484677[_0xf7a4('0x27')],'client_secret':_0x484677[_0xf7a4('0x28')],'grant_type':_0xf7a4('0x29')},'json':!![]};return rp(_0x340ba4)[_0xf7a4('0x2a')](function(_0x39c784){accountsTokens[_0x484677['id']]={'access_token':_0x39c784['access_token'],'expires_in':moment()['add'](_0x39c784[_0xf7a4('0x2b')],'seconds')};_0x42e04f(_0x39c784['access_token']);})[_0xf7a4('0x2c')](function(_0x5e8409){logger[_0xf7a4('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x5e8409[_0xf7a4('0x2e')]);_0x1a1e41(_0x5e8409);});});}function getUser(_0x3b5615,_0x5f1eb3,_0x2dadb0,_0x142835){logger[_0xf7a4('0x2f')](_0xf7a4('0x30'));return request({'method':'GET','uri':util[_0xf7a4('0x31')](_0xf7a4('0x32'),_0x5f1eb3),'qs':{'type':_0xf7a4('0x33')},'headers':{'Authorization':_0xf7a4('0x34')+_0x3b5615},'json':!![]})[_0xf7a4('0x2a')](function(_0x3e614f){if(_0x3e614f[_0xf7a4('0x35')]){var _0x2746a5=-0x1;if(_[_0xf7a4('0x36')](_0x3e614f['users'])){if(!_['isNil'](_0x142835)){_0x2746a5=_[_0xf7a4('0x37')](_0x3e614f[_0xf7a4('0x35')],function(_0xf1690d){return _0xf1690d[_0xf7a4('0x38')]===_0x142835;});}if(_0x2746a5>=0x0){logger[_0xf7a4('0x2f')](_0xf7a4('0x39'));}else{logger[_0xf7a4('0x2f')](_0xf7a4('0x3a'));_0x2746a5=_[_0xf7a4('0x37')](_0x3e614f[_0xf7a4('0x35')],function(_0x11fdaf){return _0x11fdaf['profile'][_0xf7a4('0x1a')]===_0xf7a4('0x3b');});}return _0x3e614f[_0xf7a4('0x35')][_0x2746a5];}else{if(_0x3e614f[_0xf7a4('0x3c')][_0xf7a4('0x3d')][_0xf7a4('0x1a')]==='Administrator'){logger[_0xf7a4('0x2f')](_0xf7a4('0x3a'));user=_0x3e614f[_0xf7a4('0x3c')];return user;}else{logger[_0xf7a4('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xf7a4('0xe')](_0x3e614f));throw new Error(_0xf7a4('0x3e')+JSON[_0xf7a4('0xe')](_0x3e614f));}}}else{logger[_0xf7a4('0x2d')](_0xf7a4('0x3f'),JSON[_0xf7a4('0xe')](_0x3e614f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x3e614f));}})[_0xf7a4('0x2c')](function(_0x5167ca){console[_0xf7a4('0x2d')](_0x5167ca);});}function getZohoUser(_0x2791a7,_0x2937bf){return new BPromise(function(_0x3ffcab,_0x244a8f){request(_0x2791a7)[_0xf7a4('0x2a')](function(_0xda1284){var _0x30d598=null;if(_0xda1284){_0x30d598=_0xda1284['data'][0x0];_0x30d598[_0xf7a4('0x40')]=_0x2937bf;}_0x3ffcab(_0x30d598);})[_0xf7a4('0x2c')](function(_0x584047){_0x244a8f(_0x584047);});});}function createEndUser(_0x4f3137,_0x2eb70c,_0x51ebf1,_0x73e48,_0x8664b9,_0x53cf97){var _0x51ebf1=getName(_0x51ebf1);return request({'method':'POST','uri':_0xf7a4('0x41')+_0x2eb70c+_0xf7a4('0x42')+_[_0xf7a4('0x43')](_0x53cf97[_0xf7a4('0x44')])+'s','body':{'data':[{'Last_Name':_0x51ebf1[0x1],'First_Name':_0x51ebf1[0x0],'Phone':_0x73e48,'Owner':{'name':!_['isNil'](_0x8664b9[_0xf7a4('0x45')][_0xf7a4('0x1a')])?_0x8664b9[_0xf7a4('0x45')]['name']:!_[_0xf7a4('0x1d')](_0x8664b9[_0xf7a4('0x46')])?_0x8664b9[_0xf7a4('0x46')]+'\x20'+_0x8664b9['last_name']:_0x8664b9[_0xf7a4('0x47')],'id':_0x8664b9['id']}}]},'headers':{'Authorization':_0xf7a4('0x34')+_0x4f3137},'json':!![]})[_0xf7a4('0x2a')](function(_0x5dbb8d){if(_0x5dbb8d&&_0x5dbb8d[_0xf7a4('0x48')][0x0]['code']===_0xf7a4('0x49')){var _0xdb0d63=_0x5dbb8d[_0xf7a4('0x48')][0x0][_0xf7a4('0x4a')];_0xdb0d63[_0xf7a4('0x40')]=_[_0xf7a4('0x43')](_0x53cf97[_0xf7a4('0x44')])+'s';return _0xdb0d63;}logger[_0xf7a4('0x2d')](_0xf7a4('0x3f'),JSON[_0xf7a4('0xe')](data));throw new Error('Error:\x20'+JSON[_0xf7a4('0xe')](data));})[_0xf7a4('0x2c')](function(_0x3e6efd){console['log'](_0xf7a4('0x4b'),_0x3e6efd);});}function getEndUser(_0x48d96a,_0x462723,_0x548993,_0x1ce581,_0x32672a,_0x33662d,_0x111d8f){var _0x44098a={'method':'GET','uri':'','headers':{'Authorization':_0xf7a4('0x34')+_0x48d96a},'json':!![]};switch(_0x111d8f[_0xf7a4('0x4c')]){case _0xf7a4('0x4d'):_0x44098a[_0xf7a4('0x4e')]=_0xf7a4('0x41')+_0x462723+_0xf7a4('0x4f')+_0x32672a+'))';return getZohoUser(_0x44098a,_0xf7a4('0x50'))[_0xf7a4('0x2a')](function(_0x128c46){if(_0x128c46)return _0x128c46;_0x44098a[_0xf7a4('0x4e')]=_0xf7a4('0x41')+_0x462723+_0xf7a4('0x51')+_0x32672a+'))';return getZohoUser(_0x44098a,'Leads')[_0xf7a4('0x2a')](function(_0x1c8a8c){if(_0x1c8a8c)return _0x1c8a8c;if(_0x111d8f[_0xf7a4('0x44')]!='nothing'){return createEndUser(_0x48d96a,_0x462723,_0x1ce581,_0x32672a,_0x33662d,_0x111d8f);}else{return{};}});});break;case _0xf7a4('0x52'):_0x44098a[_0xf7a4('0x4e')]='https://www.zohoapis.'+_0x462723+_0xf7a4('0x4f')+_0x32672a+'))';return getZohoUser(_0x44098a,'Contacts')[_0xf7a4('0x2a')](function(_0x2003b6){if(_0x2003b6)return _0x2003b6;if(_0x111d8f[_0xf7a4('0x44')]!=_0xf7a4('0x53')){return createEndUser(_0x48d96a,_0x462723,_0x1ce581,_0x32672a,_0x33662d,_0x111d8f);}else{return{};}});break;case _0xf7a4('0x54'):_0x44098a[_0xf7a4('0x4e')]='https://www.zohoapis.'+_0x462723+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x32672a+'))';return getZohoUser(_0x44098a,_0xf7a4('0x55'))[_0xf7a4('0x2a')](function(_0x4293ad){if(_0x4293ad)return _0x4293ad;if(_0x111d8f[_0xf7a4('0x44')]!='nothing'){return createEndUser(_0x48d96a,_0x462723,_0x1ce581,_0x32672a,_0x33662d,_0x111d8f);}else{return{};}});break;}}function getCall(_0x4134c3,_0x154f3f,_0x263e07,_0x35f6a2,_0x17f539,_0x38c94d,_0x23b0d4,_0x5a2601){logger[_0xf7a4('0x2f')](_0xf7a4('0x56'));var _0x49029c={};_0x49029c[_0xf7a4('0x57')]={'name':!_['isNil'](_0x35f6a2[_0xf7a4('0x45')][_0xf7a4('0x1a')])&&!_[_0xf7a4('0x1d')](_0x35f6a2[_0xf7a4('0x3d')]['name'])&&_0x35f6a2[_0xf7a4('0x3d')]['name']===_0xf7a4('0x58')?_0x35f6a2['role']['name']:!_[_0xf7a4('0x1d')](_0x35f6a2[_0xf7a4('0x46')])?_0x35f6a2['first_name']+'\x20'+_0x35f6a2[_0xf7a4('0x47')]:_0x35f6a2[_0xf7a4('0x47')],'id':_0x35f6a2['id']};_0x49029c[_0xf7a4('0x59')]=intUtil[_0xf7a4('0x5a')](_0x38c94d[_0xf7a4('0x5b')],_0x23b0d4,'\x20');_0x49029c[_0xf7a4('0x5c')]=intUtil[_0xf7a4('0x5a')](_0x38c94d[_0xf7a4('0x5d')],_0x23b0d4,'\x0a');if(_0x17f539[_0xf7a4('0x40')]==='Contacts'){_0x49029c[_0xf7a4('0x5e')]={'name':!_[_0xf7a4('0x1d')](_0x17f539[_0xf7a4('0x5f')])?_0x17f539[_0xf7a4('0x5f')]:!_[_0xf7a4('0x1d')](_0x17f539['First_Name'])?_0x17f539[_0xf7a4('0x60')]+'\x20'+_0x17f539['Last_Name']:_0x17f539[_0xf7a4('0x61')],'id':_0x17f539['id']};}if(_0x17f539[_0xf7a4('0x40')]===_0xf7a4('0x55')){_0x49029c['What_Id']={'name':!_['isNil'](_0x17f539[_0xf7a4('0x5f')])?_0x17f539['Full_Name']:!_[_0xf7a4('0x1d')](_0x17f539[_0xf7a4('0x60')])?_0x17f539[_0xf7a4('0x60')]+'\x20'+_0x17f539[_0xf7a4('0x61')]:_0x17f539[_0xf7a4('0x61')],'id':_0x17f539['id']};_0x49029c[_0xf7a4('0x62')]=_['startCase'](_0x17f539[_0xf7a4('0x40')]);}if(_0x23b0d4[_0xf7a4('0x63')]){_0x49029c[_0xf7a4('0x64')]=moment[_0xf7a4('0x65')](parseInt(_0x23b0d4[_0xf7a4('0x63')])*0x3e8)['format'](_0xf7a4('0x66'));}else if(_0x23b0d4[_0xf7a4('0x67')]&&_0x23b0d4[_0xf7a4('0x68')]){_0x49029c[_0xf7a4('0x64')]=moment[_0xf7a4('0x65')](moment(_0x23b0d4[_0xf7a4('0x68')],_0xf7a4('0x69'))[_0xf7a4('0x6a')](moment(_0x23b0d4[_0xf7a4('0x6b')],_0xf7a4('0x69'))))[_0xf7a4('0x31')](_0xf7a4('0x66'));}switch(_0x23b0d4[_0xf7a4('0x6c')]){case _0xf7a4('0x6d'):_0x49029c[_0xf7a4('0x6e')]='Called';break;case _0xf7a4('0x6f'):case _0xf7a4('0x70'):_0x49029c['Call_Result']=_0xf7a4('0x71');break;case _0xf7a4('0x72'):_0x49029c[_0xf7a4('0x6e')]=_0xf7a4('0x73');break;case _0xf7a4('0x74'):_0x49029c[_0xf7a4('0x6e')]=_0xf7a4('0x75');break;case _0xf7a4('0x76'):_0x49029c[_0xf7a4('0x6e')]='Timeout';default:}_0x49029c[_0xf7a4('0x77')]=(_0x5a2601==='outbound'?moment(_0x23b0d4[_0xf7a4('0x6b')])[_0xf7a4('0x31')](_0xf7a4('0x69')):moment(_0x23b0d4[_0xf7a4('0x78')])[_0xf7a4('0x31')](_0xf7a4('0x69')))||moment()[_0xf7a4('0x31')](_0xf7a4('0x69'));_0x49029c[_0xf7a4('0x79')]=_0x5a2601||'Inbound';_0x49029c=_['merge'](_0x49029c,getCustomFields(_0x38c94d['Fields'],_0x23b0d4));return request({'method':_0xf7a4('0x25'),'uri':_0xf7a4('0x41')+_0x154f3f+'/crm/v2/Calls','headers':{'Authorization':_0xf7a4('0x34')+_0x4134c3},'body':{'data':[_0x49029c]},'json':!![]})[_0xf7a4('0x2a')](function(_0xf39857){if(_0xf39857&&_0xf39857[_0xf7a4('0x48')][0x0][_0xf7a4('0x7a')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0xf39857[_0xf7a4('0x48')][0x0][_0xf7a4('0x4a')]['id']};}})['catch'](function(_0x37f8dc){logger[_0xf7a4('0x2f')]('err',_0x37f8dc[_0xf7a4('0x2e')]);console[_0xf7a4('0x7b')](_0xf7a4('0x7c'),_0x37f8dc);});}exports[_0xf7a4('0x7d')]=function(_0x32dafb,_0x464483,_0x5cc154,_0x38b026,_0x36e2c8,_0x436be5){var _0x58cdcf,_0x2596dc,_0x41b30c;_0x436be5[_0xf7a4('0x7e')]=intUtil['stripTrailingSlash'](_0x436be5[_0xf7a4('0x7e')]);_0x436be5[_0xf7a4('0x7f')]=intUtil[_0xf7a4('0x80')](_0x436be5[_0xf7a4('0x7f')]);if(_0x36e2c8&&_0x36e2c8[_0xf7a4('0x81')]){logger[_0xf7a4('0x2f')]('[QUEUE]',_0xf7a4('0x82'));_0x464483[_0xf7a4('0x83')]=_0x436be5[_0xf7a4('0x7f')]+'/api/voice/recordings/'+_0x464483[_0xf7a4('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x464483[_0xf7a4('0x84')]);}else{_0x464483['recordingURL']='';}var _0x54b836=_0x436be5[_0xf7a4('0x7e')]===_0xf7a4('0x85')?'eu':'com';return getAccessToken(_0x436be5)[_0xf7a4('0x2a')](function(_0x4dfaeb){_0x41b30c=_0x4dfaeb;return getUser(_0x41b30c,_0x54b836,_0x436be5,_0x38b026[_0xf7a4('0x38')]);})[_0xf7a4('0x2a')](function(_0x4b1e4a){_0x58cdcf=_0x4b1e4a;logger[_0xf7a4('0x2f')]('The\x20User\x20ID\x20is:',_0x58cdcf['id']);return getEndUser(_0x41b30c,_0x54b836,_0x436be5,_0x464483[_0xf7a4('0x86')],_0x464483[_0xf7a4('0x87')],_0x58cdcf,_0x5cc154);})[_0xf7a4('0x2a')](function(_0x55632f){_0x2596dc=_0x55632f;return getCall(_0x41b30c,_0x54b836,_0x436be5,_0x58cdcf,_0x2596dc,_0x5cc154,_0x464483,_0xf7a4('0x88'));})[_0xf7a4('0x2a')](function(_0x271b2d){if(_0x271b2d){logger[_0xf7a4('0x2f')](_0xf7a4('0x89'),_0x271b2d['id']);logger['info']('[QUEUE]',_0xf7a4('0x8a'));emit(util[_0xf7a4('0x31')](_0xf7a4('0x8b'),_0x38b026[_0xf7a4('0x1a')]),'trigger:browser:url',{'uri':_0xf7a4('0x8c')+_0x436be5[_0xf7a4('0x7e')]+_0xf7a4('0x8d')+_0x271b2d['id']});}})[_0xf7a4('0x2c')](function(_0x519e39){logger[_0xf7a4('0x2d')](_0xf7a4('0x8e'),JSON['stringify'](_0x519e39));});};exports[_0xf7a4('0x8f')]=function(_0x6d6533,_0x571fd7,_0x77ca0f,_0x42943e,_0x349f8b,_0x93c4b4,_0x3acccd){var _0x437e91,_0x3873b9,_0x3b6911;_0x93c4b4[_0xf7a4('0x7e')]=intUtil[_0xf7a4('0x80')](_0x93c4b4[_0xf7a4('0x7e')]);_0x93c4b4['serverUrl']=intUtil['stripTrailingSlash'](_0x93c4b4[_0xf7a4('0x7f')]);if(_0x3acccd&&_0x3acccd[_0xf7a4('0x90')]&&_0x3acccd['recordingFormat']!=='none'){logger[_0xf7a4('0x2f')](_0xf7a4('0x91'),_0xf7a4('0x82'));_0x571fd7[_0xf7a4('0x83')]=_0x93c4b4[_0xf7a4('0x7f')]+_0xf7a4('0x92')+_0x571fd7[_0xf7a4('0x84')]+_0xf7a4('0x93')+md5(_0x571fd7[_0xf7a4('0x84')]);}var _0x3d9838=_0x93c4b4[_0xf7a4('0x7e')]==='zoho.eu'?'eu':_0xf7a4('0x94');return getAccessToken(_0x93c4b4)[_0xf7a4('0x2a')](function(_0x3a0ad0){_0x3b6911=_0x3a0ad0;return getUser(_0x3b6911,_0x3d9838,_0x93c4b4,_0x42943e['email']);})['then'](function(_0x510862){_0x437e91=_0x510862;logger[_0xf7a4('0x2f')](_0xf7a4('0x95'),_0x437e91['id']);return getEndUser(_0x3b6911,_0x3d9838,_0x93c4b4,_0x571fd7[_0xf7a4('0x96')],_0x571fd7[_0xf7a4('0x97')],_0x437e91,_0x77ca0f);})[_0xf7a4('0x2a')](function(_0x33a54c){_0x3873b9=_0x33a54c;return getCall(_0x3b6911,_0x3d9838,_0x93c4b4,_0x437e91,_0x3873b9,_0x77ca0f,_0x571fd7,_0xf7a4('0x98'));})[_0xf7a4('0x2a')](function(_0x2a7b9d){if(_0x2a7b9d){logger[_0xf7a4('0x2f')](_0xf7a4('0x89'),_0x2a7b9d['id']);logger['info'](_0xf7a4('0x91'),_0xf7a4('0x8a'));emit(util[_0xf7a4('0x31')](_0xf7a4('0x8b'),_0x42943e['name']),_0xf7a4('0x99'),{'uri':'https://crm.'+_0x93c4b4['host']+_0xf7a4('0x8d')+_0x2a7b9d['id']});}})['catch'](function(_0x1920eb){logger[_0xf7a4('0x2d')](_0xf7a4('0x91'),JSON['stringify'](_0x1920eb));});};exports[_0xf7a4('0x9a')]=function(_0x303d2f,_0x332928,_0xfcec0e,_0x3445af,_0x505a84,_0x4e9e6c){var _0x18b54d,_0x44e080,_0x1be72c;_0x4e9e6c['host']=intUtil[_0xf7a4('0x80')](_0x4e9e6c[_0xf7a4('0x7e')]);_0x4e9e6c['serverUrl']=intUtil['stripTrailingSlash'](_0x4e9e6c['serverUrl']);if(_0x505a84&&_0x505a84[_0xf7a4('0x81')]){logger[_0xf7a4('0x2f')]('['+_0x332928['lastevent']['toUpperCase']()+']',_0xf7a4('0x82'));_0x332928[_0xf7a4('0x83')]=_0x4e9e6c[_0xf7a4('0x7f')]+_0xf7a4('0x92')+_0x332928[_0xf7a4('0x84')]+_0xf7a4('0x93')+md5(_0x332928[_0xf7a4('0x84')]);}else{_0x332928[_0xf7a4('0x83')]='';}var _0x4c3b1d=_0x4e9e6c[_0xf7a4('0x7e')]==='zoho.eu'?'eu':_0xf7a4('0x94');return getAccessToken(_0x4e9e6c)[_0xf7a4('0x2a')](function(_0x1beb94){_0x1be72c=_0x1beb94;return getUser(_0x1be72c,_0x4c3b1d,_0x4e9e6c);})[_0xf7a4('0x2a')](function(_0xb185f0){_0x18b54d=_0xb185f0;logger[_0xf7a4('0x2f')](_0xf7a4('0x95'),_0x18b54d['id']);return getEndUser(_0x1be72c,_0x4c3b1d,_0x4e9e6c,_0x332928[_0xf7a4('0x86')],_0x332928[_0xf7a4('0x87')],_0x18b54d,_0xfcec0e);})[_0xf7a4('0x2a')](function(_0x4fae1d){_0x44e080=_0x4fae1d;return getCall(_0x1be72c,_0x4c3b1d,_0x4e9e6c,_0x18b54d,_0x44e080,_0xfcec0e,_0x332928,_0xf7a4('0x88'));})[_0xf7a4('0x2a')](function(_0x269ed0){if(_0x269ed0){logger[_0xf7a4('0x2f')](_0xf7a4('0x89'),_0x269ed0['id']);}})[_0xf7a4('0x2c')](function(_0xc17fc2){logger['error']('['+_0x332928['lastevent']['toUpperCase']()+']',JSON[_0xf7a4('0xe')](_0xc17fc2));});};
\ No newline at end of file
index d192bae..f68b2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6217=['exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger'];(function(_0x263275,_0x1acfe0){var _0x513751=function(_0x487d6c){while(--_0x487d6c){_0x263275['push'](_0x263275['shift']());}};_0x513751(++_0x1acfe0);}(_0x6217,0x8b));var _0x7621=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x6217[_0x122e9b];return _0x22c247;};'use strict';var util=require(_0x7621('0x0'));var sh=require(_0x7621('0x1'));var Mustache=require(_0x7621('0x2'));var logger=require(_0x7621('0x3'))('trigger');exports[_0x7621('0x4')]=function(_0x14342b,_0x4c2506){var _0x24ab08=_0x14342b[_0x7621('0x5')]?_0x14342b[_0x7621('0x5')]:_0x7621('0x6');var _0x12a017=_0x14342b['data3']?Mustache[_0x7621('0x7')](_0x14342b[_0x7621('0x8')],_0x4c2506):_0x4c2506;sh['exec'](_0x12a017,function(_0x2b5e29,_0x2d1e6c,_0x4bf45d){if(_0x2b5e29!==0x0){logger[_0x7621('0x9')](util[_0x7621('0xa')](_0x7621('0xb'),_0x24ab08,_0x12a017,_0x2b5e29,_0x4bf45d));}else{logger['info'](util[_0x7621('0xa')](_0x7621('0xc'),_0x24ab08,_0x12a017,_0x2d1e6c));}});};
\ No newline at end of file
+var _0x3a37=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x3a37,0x92));var _0x73a3=function(_0x2e4e3e,_0x75ae94){_0x2e4e3e=_0x2e4e3e-0x0;var _0x51476b=_0x3a37[_0x2e4e3e];return _0x51476b;};'use strict';var util=require(_0x73a3('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x73a3('0x1'))(_0x73a3('0x2'));exports[_0x73a3('0x3')]=function(_0x46d1c7,_0x41f0d7){var _0x43a486=_0x46d1c7[_0x73a3('0x4')]?_0x46d1c7[_0x73a3('0x4')]:_0x73a3('0x5');var _0x463c01=_0x46d1c7[_0x73a3('0x6')]?Mustache[_0x73a3('0x7')](_0x46d1c7[_0x73a3('0x6')],_0x41f0d7):_0x41f0d7;sh[_0x73a3('0x3')](_0x463c01,function(_0x461d38,_0x2e59c6,_0x1378cc){if(_0x461d38!==0x0){logger[_0x73a3('0x8')](util[_0x73a3('0x9')](_0x73a3('0xa'),_0x43a486,_0x463c01,_0x461d38,_0x1378cc));}else{logger[_0x73a3('0xb')](util[_0x73a3('0x9')](_0x73a3('0xc'),_0x43a486,_0x463c01,_0x2e59c6));}});};
\ No newline at end of file
index b5beeaf..8241249 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fff=['error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','parse','data6'];(function(_0x5d3956,_0x697661){var _0x17325f=function(_0x27ff66){while(--_0x27ff66){_0x5d3956['push'](_0x5d3956['shift']());}};_0x17325f(++_0x697661);}(_0x1fff,0x1f1));var _0xf1ff=function(_0xfea823,_0x2b8e05){_0xfea823=_0xfea823-0x0;var _0x3ef740=_0x1fff[_0xfea823];return _0x3ef740;};'use strict';var rp=require(_0xf1ff('0x0'));var util=require(_0xf1ff('0x1'));var _=require(_0xf1ff('0x2'));var Mustache=require(_0xf1ff('0x3'));var logger=require(_0xf1ff('0x4'))(_0xf1ff('0x5'));exports['exec']=function(_0x55a513,_0x34424e){var _0x38ec55,_0x524451;var _0x14e0e3={'method':_0x55a513[_0xf1ff('0x6')][_0xf1ff('0x7')](),'uri':Mustache[_0xf1ff('0x8')](_0x55a513[_0xf1ff('0x9')],_0x34424e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x55a513[_0xf1ff('0xa')])==='number'&&parseInt(_0x55a513[_0xf1ff('0xa')])>=0x1&&parseInt(_0x55a513[_0xf1ff('0xa')])<=0xa?parseInt(_0x55a513['data5'])*0x3e8:0x5*0x3e8};try{_0x14e0e3['headers']=_0x55a513['data6']?JSON[_0xf1ff('0xb')](Mustache[_0xf1ff('0x8')](_0x55a513[_0xf1ff('0xc')],_0x34424e)):{};}catch(_0x4f811b){logger[_0xf1ff('0xd')](_0x4f811b[_0xf1ff('0xe')]);}switch(_0x55a513[_0xf1ff('0x6')][_0xf1ff('0x7')]()){case _0xf1ff('0xf'):case _0xf1ff('0x10'):_0x38ec55=null;_0x14e0e3['qs']=_0x34424e;break;case _0xf1ff('0x11'):case _0xf1ff('0x12'):if(_0x55a513['data7']){try{_0x38ec55=JSON[_0xf1ff('0xb')](Mustache[_0xf1ff('0x8')](_0x55a513[_0xf1ff('0x13')],_0x34424e));_0x14e0e3[_0xf1ff('0x14')]=_0x38ec55;}catch(_0x2f97cb){logger[_0xf1ff('0xd')](_0x2f97cb['stack']);logger[_0xf1ff('0xd')](_0xf1ff('0x15'));}}else{_0x38ec55=_0x34424e;_0x14e0e3[_0xf1ff('0x14')]=_0x38ec55;}break;}logger[_0xf1ff('0x16')](util[_0xf1ff('0x17')](_0xf1ff('0x18'),_0x55a513[_0xf1ff('0x6')],_0x55a513[_0xf1ff('0x9')],JSON[_0xf1ff('0x19')](_0x14e0e3)));rp(_0x14e0e3)[_0xf1ff('0x1a')](function(_0x5921f1){_0x38ec55=!_[_0xf1ff('0x1b')](_0x38ec55)?_0xf1ff('0x1c')+_0x38ec55:'';_0x524451=typeof _0x5921f1[_0xf1ff('0x14')]===_0xf1ff('0x1d')?JSON[_0xf1ff('0x19')](_0x5921f1['body']):_0x5921f1[_0xf1ff('0x14')];logger[_0xf1ff('0x16')](util[_0xf1ff('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x55a513[_0xf1ff('0x6')],_0x55a513[_0xf1ff('0x9')],_0x5921f1[_0xf1ff('0x1e')],_0x524451));})['catch'](function(_0x392596){logger[_0xf1ff('0xd')](util[_0xf1ff('0x17')](_0xf1ff('0x1f'),_0x55a513[_0xf1ff('0x6')],_0x55a513[_0xf1ff('0x9')],_0x392596[_0xf1ff('0x1e')],_0x392596[_0xf1ff('0x20')],_0x392596[_0xf1ff('0x21')]));});};
\ No newline at end of file
+var _0xe2d9=['../../../../config/logger','exec','toUpperCase','render','data5','number','parse','data6','stack','data1','GET','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache'];(function(_0x8846b,_0x26ed0b){var _0xe2ae20=function(_0x191247){while(--_0x191247){_0x8846b['push'](_0x8846b['shift']());}};_0xe2ae20(++_0x26ed0b);}(_0xe2d9,0x17e));var _0x9e2d=function(_0x19e031,_0xd397a2){_0x19e031=_0x19e031-0x0;var _0x3010e7=_0xe2d9[_0x19e031];return _0x3010e7;};'use strict';var rp=require(_0x9e2d('0x0'));var util=require(_0x9e2d('0x1'));var _=require('lodash');var Mustache=require(_0x9e2d('0x2'));var logger=require(_0x9e2d('0x3'))('trigger');exports[_0x9e2d('0x4')]=function(_0x574caf,_0x10935b){var _0x5ee580,_0x41e2cd;var _0x27d124={'method':_0x574caf['data1'][_0x9e2d('0x5')](),'uri':Mustache[_0x9e2d('0x6')](_0x574caf['data2'],_0x10935b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x574caf[_0x9e2d('0x7')])===_0x9e2d('0x8')&&parseInt(_0x574caf['data5'])>=0x1&&parseInt(_0x574caf[_0x9e2d('0x7')])<=0xa?parseInt(_0x574caf[_0x9e2d('0x7')])*0x3e8:0x5*0x3e8};try{_0x27d124['headers']=_0x574caf['data6']?JSON[_0x9e2d('0x9')](Mustache[_0x9e2d('0x6')](_0x574caf[_0x9e2d('0xa')],_0x10935b)):{};}catch(_0xcdb83f){logger['error'](_0xcdb83f[_0x9e2d('0xb')]);}switch(_0x574caf[_0x9e2d('0xc')][_0x9e2d('0x5')]()){case _0x9e2d('0xd'):case'DELETE':_0x5ee580=null;_0x27d124['qs']=_0x10935b;break;case _0x9e2d('0xe'):case _0x9e2d('0xf'):if(_0x574caf[_0x9e2d('0x10')]){try{_0x5ee580=JSON[_0x9e2d('0x9')](Mustache[_0x9e2d('0x6')](_0x574caf[_0x9e2d('0x10')],_0x10935b));_0x27d124[_0x9e2d('0x11')]=_0x5ee580;}catch(_0x92a432){logger[_0x9e2d('0x12')](_0x92a432[_0x9e2d('0xb')]);logger[_0x9e2d('0x12')](_0x9e2d('0x13'));}}else{_0x5ee580=_0x10935b;_0x27d124['body']=_0x5ee580;}break;}logger[_0x9e2d('0x14')](util[_0x9e2d('0x15')](_0x9e2d('0x16'),_0x574caf[_0x9e2d('0xc')],_0x574caf['data2'],JSON[_0x9e2d('0x17')](_0x27d124)));rp(_0x27d124)[_0x9e2d('0x18')](function(_0x59aaa1){_0x5ee580=!_[_0x9e2d('0x19')](_0x5ee580)?_0x9e2d('0x1a')+_0x5ee580:'';_0x41e2cd=typeof _0x59aaa1['body']===_0x9e2d('0x1b')?JSON[_0x9e2d('0x17')](_0x59aaa1[_0x9e2d('0x11')]):_0x59aaa1[_0x9e2d('0x11')];logger[_0x9e2d('0x14')](util[_0x9e2d('0x15')](_0x9e2d('0x1c'),_0x574caf[_0x9e2d('0xc')],_0x574caf[_0x9e2d('0x1d')],_0x59aaa1[_0x9e2d('0x1e')],_0x41e2cd));})[_0x9e2d('0x1f')](function(_0x17baf0){logger[_0x9e2d('0x12')](util[_0x9e2d('0x15')](_0x9e2d('0x20'),_0x574caf['data1'],_0x574caf['data2'],_0x17baf0[_0x9e2d('0x1e')],_0x17baf0[_0x9e2d('0x21')],_0x17baf0[_0x9e2d('0x22')]));});};
\ No newline at end of file
index a686335..e5ddd94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x819e=['error','result','catch','bluebird','../../config/logger','routing','http','Request','then','debug','rpc'];(function(_0x16c737,_0x597fbc){var _0x5454ed=function(_0x3930e6){while(--_0x3930e6){_0x16c737['push'](_0x16c737['shift']());}};_0x5454ed(++_0x597fbc);}(_0x819e,0x1c6));var _0xe819=function(_0x58cf07,_0x2e3858){_0x58cf07=_0x58cf07-0x0;var _0x42afe0=_0x819e[_0x58cf07];return _0x42afe0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe819('0x0'));var logger=require(_0xe819('0x1'))(_0xe819('0x2'));var client=jayson['client'][_0xe819('0x3')]({'port':0x2329});client[_0xe819('0x4')]=function(_0x3ff892,_0x52ba67){return new BPromise(function(_0x3c9b9f,_0x3a6cf9){return client['request'](_0x3ff892,_0x52ba67)[_0xe819('0x5')](function(_0x4ee1cf){logger[_0xe819('0x6')](_0xe819('0x7'),'routing',_0x3ff892,_0x52ba67,_0x4ee1cf);if(_0x4ee1cf[_0xe819('0x8')]){logger[_0xe819('0x8')]('rpc','routing',_0x3ff892,_0x4ee1cf[_0xe819('0x8')]['message'],_0x52ba67);return _0x3a6cf9(_0x4ee1cf[_0xe819('0x8')]['message']);}else{return _0x3c9b9f(_0x4ee1cf[_0xe819('0x9')]);}})[_0xe819('0xa')](function(_0x31bb71){logger[_0xe819('0x8')](_0xe819('0x7'),_0xe819('0x2'),_0x3ff892,_0x31bb71,_0x52ba67);return _0x3a6cf9(_0x31bb71);});});};module['exports']=client;
\ No newline at end of file
+var _0x677b=['then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x677b,0x152));var _0xb677=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x677b[_0x4cfc1d];return _0x1c01a0;};'use strict';var jayson=require(_0xb677('0x0'));var BPromise=require('bluebird');var logger=require(_0xb677('0x1'))(_0xb677('0x2'));var client=jayson[_0xb677('0x3')][_0xb677('0x4')]({'port':0x2329});client[_0xb677('0x5')]=function(_0x4ef17b,_0x478c38){return new BPromise(function(_0x1ecc2c,_0x403145){return client[_0xb677('0x6')](_0x4ef17b,_0x478c38)[_0xb677('0x7')](function(_0xa1ff46){logger[_0xb677('0x8')](_0xb677('0x9'),_0xb677('0x2'),_0x4ef17b,_0x478c38,_0xa1ff46);if(_0xa1ff46[_0xb677('0xa')]){logger[_0xb677('0xa')](_0xb677('0x9'),_0xb677('0x2'),_0x4ef17b,_0xa1ff46[_0xb677('0xa')][_0xb677('0xb')],_0x478c38);return _0x403145(_0xa1ff46[_0xb677('0xa')]['message']);}else{return _0x1ecc2c(_0xa1ff46[_0xb677('0xc')]);}})[_0xb677('0xd')](function(_0x449839){logger[_0xb677('0xa')]('rpc',_0xb677('0x2'),_0x4ef17b,_0x449839,_0x478c38);return _0x403145(_0x449839);});});};module[_0xb677('0xe')]=client;
\ No newline at end of file
index 74e6367..4fc9c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c7=['catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/setting','email','resolve','then','getMailAccounts','refresh','mailAccounts','listen','loginMailFrequency'];(function(_0x497a34,_0x5ef3e3){var _0x2e1c06=function(_0x481c52){while(--_0x481c52){_0x497a34['push'](_0x497a34['shift']());}};_0x2e1c06(++_0x5ef3e3);}(_0xa2c7,0x1b5));var _0x7a2c=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xa2c7[_0x4eec9b];return _0x2e3849;};'use strict';var server=require('./server');var Realtime=require(_0x7a2c('0x0'));var EmailChannel=require(_0x7a2c('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x7a2c('0x2'));var logger=require('../../config/logger')(_0x7a2c('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7a2c('0x4')]()[_0x7a2c('0x5')](mailAccount[_0x7a2c('0x6')]())['then'](realtime['initMailAccounts']())[_0x7a2c('0x5')](function(){email[_0x7a2c('0x7')](realtime[_0x7a2c('0x8')]);return realtime;});}function main(){return server[_0x7a2c('0x9')](realtime,email)[_0x7a2c('0x5')](function(){return initRealtime();})[_0x7a2c('0x5')](function(){return setting['getSettings']();})[_0x7a2c('0x5')](function(_0x14f85d){return setInterval(initRealtime,_0x14f85d[_0x7a2c('0xa')]*0x3e8);})[_0x7a2c('0xb')](function(_0x30cd68){logger[_0x7a2c('0xc')](_0x7a2c('0xd'),_0x30cd68);});}main();
\ No newline at end of file
+var _0x0598=['./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','refresh','mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x0598,0xc4));var _0x8059=function(_0x19f7fe,_0x4abd0b){_0x19f7fe=_0x19f7fe-0x0;var _0x55ca02=_0x0598[_0x19f7fe];return _0x55ca02;};'use strict';var server=require(_0x8059('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x8059('0x1'));var mailAccount=require(_0x8059('0x2'));var setting=require(_0x8059('0x3'));var logger=require(_0x8059('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x8059('0x5')]()[_0x8059('0x6')](mailAccount['getMailAccounts']())['then'](realtime['initMailAccounts']())[_0x8059('0x6')](function(){email[_0x8059('0x7')](realtime[_0x8059('0x8')]);return realtime;});}function main(){return server[_0x8059('0x9')](realtime,email)[_0x8059('0x6')](function(){return initRealtime();})[_0x8059('0x6')](function(){return setting[_0x8059('0xa')]();})['then'](function(_0x5d99ed){return setInterval(initRealtime,_0x5d99ed['loginMailFrequency']*0x3e8);})[_0x8059('0xb')](function(_0x1331ad){logger[_0x8059('0xc')](_0x8059('0xd'),_0x1331ad);});}main();
\ No newline at end of file
index bfb9aa2..049c0b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0568=['handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','connected','messages','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','error','sendMail','send','verifySmtp','Smtp','lastSync','verified','verify','exports','lodash','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','active','service','provider','custom'];(function(_0x1f7d01,_0x208b56){var _0x48b6f2=function(_0x1ed546){while(--_0x1ed546){_0x1f7d01['push'](_0x1f7d01['shift']());}};_0x48b6f2(++_0x208b56);}(_0x0568,0x170));var _0x8056=function(_0x9cfaa,_0x55cbd9){_0x9cfaa=_0x9cfaa-0x0;var _0x1dc738=_0x0568[_0x9cfaa];return _0x1dc738;};'use strict';var _=require(_0x8056('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x8056('0x1'));var Redis=require(_0x8056('0x2'));var config=require(_0x8056('0x3'));var logger=require(_0x8056('0x4'))(_0x8056('0x5'));config[_0x8056('0x6')]=_[_0x8056('0x7')](config[_0x8056('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x8056('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x8056('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8056('0xa'));var md5Accounts={};function EmailChannel(_0x520ca5){logger['info']('start\x20email\x20channel');this[_0x8056('0xb')]=_0x520ca5['mailAccounts'];this[_0x8056('0xc')]={};this[_0x8056('0xd')]=new EmailSmtp();}EmailChannel[_0x8056('0xe')][_0x8056('0xf')]=function(_0x5e391d){var _0x25d68a=this[_0x8056('0xb')][_0x5e391d];var _0x210b2d={'id':_0x25d68a['id'],'name':_0x25d68a[_0x8056('0x10')],'key':_0x25d68a[_0x8056('0x11')],'active':_0x25d68a['active'],'Imap':{'status':_0x25d68a[_0x8056('0x12')][_0x8056('0x13')],'messageStatus':_0x25d68a[_0x8056('0x12')][_0x8056('0x14')],'total':_0x25d68a['Imap'][_0x8056('0x15')]}};if(_[_0x8056('0x16')](md5Accounts[_0x5e391d])){md5Accounts[_0x5e391d]={};}var _0x207a7e=md5(JSON[_0x8056('0x17')](_0x210b2d));if(md5Accounts[_0x5e391d][_0x8056('0x1')]!==_0x207a7e){md5Accounts[_0x5e391d][_0x8056('0x1')]=_0x207a7e;io['emit'](_0x8056('0x18'),_0x210b2d);}};EmailChannel[_0x8056('0xe')][_0x8056('0x19')]=function(_0x34f2bc){for(var _0x33a03c in _0x34f2bc){if(_0x34f2bc[_0x8056('0x1a')](_0x33a03c)){if(_0x34f2bc[_0x33a03c][_0x8056('0x12')]&&_0x34f2bc[_0x33a03c][_0x8056('0x1b')]){var _0x5dc59b=_0x34f2bc[_0x33a03c][_0x8056('0x12')];if(!_0x5dc59b[_0x8056('0x1c')]&&_0x34f2bc[_0x33a03c][_0x8056('0x1d')]!==_0x8056('0x1e'))_0x5dc59b[_0x8056('0x1c')]=_0x34f2bc[_0x33a03c][_0x8056('0x1d')];if(!this[_0x8056('0xc')][_0x8056('0x1a')](_0x5dc59b['id'])){this[_0x8056('0xc')][_0x5dc59b['id']]=new EmailImap(_0x5dc59b,_0x34f2bc[_0x33a03c]['email']);this[_0x8056('0xc')][_0x5dc59b['id']]['on']('box',this[_0x8056('0x1f')][_0x8056('0x20')](this,_0x33a03c));this['imapAccounts'][_0x5dc59b['id']]['on'](_0x8056('0x5'),this[_0x8056('0x21')][_0x8056('0x20')](this,_0x33a03c));this[_0x8056('0xc')][_0x5dc59b['id']]['on']('end',this[_0x8056('0x22')][_0x8056('0x20')](this,_0x33a03c));this[_0x8056('0xc')][_0x5dc59b['id']]['on']('error',this[_0x8056('0x23')][_0x8056('0x20')](this,_0x33a03c));}}else{if(_[_0x8056('0x16')](this[_0x8056('0xb')][_0x33a03c][_0x8056('0x12')])){this[_0x8056('0xb')][_0x33a03c][_0x8056('0x12')]={};}this[_0x8056('0xb')][_0x33a03c]['Imap'][_0x8056('0x13')]=_0x8056('0x24');this[_0x8056('0xb')][_0x33a03c][_0x8056('0x12')]['messageStatus']='';this['emit'](_0x33a03c);}}}};EmailChannel['prototype'][_0x8056('0x1f')]=function(_0x4e3216,_0x5644ef){if(this[_0x8056('0xb')][_0x4e3216]){this[_0x8056('0xb')][_0x4e3216][_0x8056('0x12')][_0x8056('0x13')]=_0x8056('0x25');this[_0x8056('0xb')][_0x4e3216][_0x8056('0x12')][_0x8056('0x14')]=_0x5644ef[_0x8056('0x10')];if(_0x5644ef[_0x8056('0x26')]){this[_0x8056('0xb')][_0x4e3216][_0x8056('0x12')]['total']=_0x5644ef['messages'][_0x8056('0x15')];}return this[_0x8056('0xf')](_0x4e3216);}};EmailChannel[_0x8056('0xe')][_0x8056('0x21')]=function(_0x496dbd,_0x52b8d5){logger[_0x8056('0x27')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x52b8d5[_0x8056('0x28')],_0x52b8d5[_0x8056('0x29')],_0x52b8d5[_0x8056('0x2a')],_0x496dbd);if(this[_0x8056('0xb')][_0x496dbd]){return mailAccount[_0x8056('0x2b')](_0x496dbd,_0x52b8d5)[_0x8056('0x2c')](function(_0x32a4ec){if(_0x32a4ec){logger[_0x8056('0x27')](_0x8056('0x2d'));}})[_0x8056('0x2e')](function(_0x297900){logger['error'](_0x8056('0x2f'),JSON[_0x8056('0x17')](_0x297900));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x11826c){if(this[_0x8056('0xb')][_0x11826c]&&this[_0x8056('0xb')][_0x11826c][_0x8056('0x12')]){if(this['imapAccounts'][this[_0x8056('0xb')][_0x11826c]['Imap']['id']]){delete this[_0x8056('0xc')][this[_0x8056('0xb')][_0x11826c][_0x8056('0x12')]['id']];}this[_0x8056('0xb')][_0x11826c][_0x8056('0x12')]['lastSync']=moment();this[_0x8056('0xf')](_0x11826c);}};EmailChannel[_0x8056('0xe')][_0x8056('0x23')]=function(_0x30c266,_0x2cfb5d){if(this[_0x8056('0xb')][_0x30c266]){this[_0x8056('0xb')][_0x30c266][_0x8056('0x12')][_0x8056('0x13')]=_0x8056('0x30');this['mailAccounts'][_0x30c266][_0x8056('0x12')][_0x8056('0x14')]=_0x2cfb5d;return this[_0x8056('0xf')](_0x30c266);}};EmailChannel[_0x8056('0xe')][_0x8056('0x31')]=function(_0x114e24,_0x411c2b){return this['smtp'][_0x8056('0x32')](_0x114e24,_0x411c2b);};EmailChannel[_0x8056('0xe')][_0x8056('0x33')]=function(_0x34fd63){var _0x44f761=this;if(this[_0x8056('0xb')][_0x34fd63['id']]){if(_[_0x8056('0x16')](this['mailAccounts'][_0x34fd63['id']]['Smtp'])){this[_0x8056('0xb')][_0x34fd63['id']][_0x8056('0x34')]={};}this['mailAccounts'][_0x34fd63['id']]['Smtp'][_0x8056('0x35')]=moment();return new BPromise(function(_0x1f40da,_0x2f51ef){return _0x44f761[_0x8056('0xd')]['verify'](_0x34fd63)['then'](function(_0x115b97){_0x44f761[_0x8056('0xb')][_0x34fd63['id']][_0x8056('0x34')][_0x8056('0x13')]=_0x8056('0x36');_0x44f761[_0x8056('0xb')][_0x34fd63['id']][_0x8056('0x34')]['messageStatus']='';_0x44f761[_0x8056('0xf')](_0x34fd63['id']);_0x1f40da(_0x115b97);})[_0x8056('0x2e')](function(_0x5cb994){_0x44f761[_0x8056('0xb')][_0x34fd63['id']]['Smtp']['status']=_0x8056('0x30');_0x44f761[_0x8056('0xb')][_0x34fd63['id']][_0x8056('0x34')][_0x8056('0x14')]=_0x5cb994;_0x44f761[_0x8056('0xf')](_0x34fd63['id']);_0x2f51ef(_0x5cb994);});});}return this['smtp'][_0x8056('0x37')](_0x34fd63);};module[_0x8056('0x38')]=EmailChannel;
\ No newline at end of file
+var _0x7f04=['../../../config/logger','email','redis','defaults','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','key','Imap','status','total','isNil','mailAccount:update','refresh','hasOwnProperty','active','service','custom','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','prototype','error','messageStatus','sendMail','send','verifySmtp','Smtp','smtp','verified','exports','lodash','moment','bluebird','md5','ioredis'];(function(_0x4f25ab,_0x50d9a5){var _0x1245d6=function(_0x45eaa2){while(--_0x45eaa2){_0x4f25ab['push'](_0x4f25ab['shift']());}};_0x1245d6(++_0x50d9a5);}(_0x7f04,0x1ea));var _0x47f0=function(_0x5cdb1a,_0x5af0c2){_0x5cdb1a=_0x5cdb1a-0x0;var _0x269752=_0x7f04[_0x5cdb1a];return _0x269752;};'use strict';var _=require(_0x47f0('0x0'));var moment=require(_0x47f0('0x1'));var BPromise=require(_0x47f0('0x2'));var md5=require(_0x47f0('0x3'));var Redis=require(_0x47f0('0x4'));var config=require('../../../config/environment');var logger=require(_0x47f0('0x5'))(_0x47f0('0x6'));config[_0x47f0('0x7')]=_[_0x47f0('0x8')](config[_0x47f0('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x47f0('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x47f0('0xa'));var md5Accounts={};function EmailChannel(_0x2d7db8){logger[_0x47f0('0xb')](_0x47f0('0xc'));this[_0x47f0('0xd')]=_0x2d7db8['mailAccounts'];this[_0x47f0('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x47f0('0xf')]=function(_0x2db9bd){var _0x44f23b=this['mailAccounts'][_0x2db9bd];var _0x47274d={'id':_0x44f23b['id'],'name':_0x44f23b['name'],'key':_0x44f23b[_0x47f0('0x10')],'active':_0x44f23b['active'],'Imap':{'status':_0x44f23b[_0x47f0('0x11')][_0x47f0('0x12')],'messageStatus':_0x44f23b[_0x47f0('0x11')]['messageStatus'],'total':_0x44f23b[_0x47f0('0x11')][_0x47f0('0x13')]}};if(_[_0x47f0('0x14')](md5Accounts[_0x2db9bd])){md5Accounts[_0x2db9bd]={};}var _0x3e0dcd=md5(JSON['stringify'](_0x47274d));if(md5Accounts[_0x2db9bd][_0x47f0('0x3')]!==_0x3e0dcd){md5Accounts[_0x2db9bd][_0x47f0('0x3')]=_0x3e0dcd;io[_0x47f0('0xf')](_0x47f0('0x15'),_0x47274d);}};EmailChannel['prototype'][_0x47f0('0x16')]=function(_0x32c208){for(var _0x380175 in _0x32c208){if(_0x32c208[_0x47f0('0x17')](_0x380175)){if(_0x32c208[_0x380175][_0x47f0('0x11')]&&_0x32c208[_0x380175][_0x47f0('0x18')]){var _0x5b8b05=_0x32c208[_0x380175][_0x47f0('0x11')];if(!_0x5b8b05[_0x47f0('0x19')]&&_0x32c208[_0x380175]['provider']!==_0x47f0('0x1a'))_0x5b8b05['service']=_0x32c208[_0x380175][_0x47f0('0x1b')];if(!this[_0x47f0('0xe')][_0x47f0('0x17')](_0x5b8b05['id'])){this['imapAccounts'][_0x5b8b05['id']]=new EmailImap(_0x5b8b05,_0x32c208[_0x380175][_0x47f0('0x6')]);this['imapAccounts'][_0x5b8b05['id']]['on'](_0x47f0('0x1c'),this[_0x47f0('0x1d')][_0x47f0('0x1e')](this,_0x380175));this[_0x47f0('0xe')][_0x5b8b05['id']]['on'](_0x47f0('0x6'),this[_0x47f0('0x1f')][_0x47f0('0x1e')](this,_0x380175));this[_0x47f0('0xe')][_0x5b8b05['id']]['on'](_0x47f0('0x20'),this[_0x47f0('0x21')][_0x47f0('0x1e')](this,_0x380175));this[_0x47f0('0xe')][_0x5b8b05['id']]['on']('error',this[_0x47f0('0x22')][_0x47f0('0x1e')](this,_0x380175));}}else{if(_[_0x47f0('0x14')](this['mailAccounts'][_0x380175][_0x47f0('0x11')])){this['mailAccounts'][_0x380175][_0x47f0('0x11')]={};}this['mailAccounts'][_0x380175][_0x47f0('0x11')][_0x47f0('0x12')]='disabled';this[_0x47f0('0xd')][_0x380175]['Imap']['messageStatus']='';this['emit'](_0x380175);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x5dea2c,_0x1cdeec){if(this[_0x47f0('0xd')][_0x5dea2c]){this[_0x47f0('0xd')][_0x5dea2c][_0x47f0('0x11')]['status']=_0x47f0('0x23');this[_0x47f0('0xd')][_0x5dea2c]['Imap']['messageStatus']=_0x1cdeec['name'];if(_0x1cdeec[_0x47f0('0x24')]){this[_0x47f0('0xd')][_0x5dea2c]['Imap'][_0x47f0('0x13')]=_0x1cdeec[_0x47f0('0x24')]['total'];}return this[_0x47f0('0xf')](_0x5dea2c);}};EmailChannel['prototype'][_0x47f0('0x1f')]=function(_0x373ee2,_0x4e1ef0){logger[_0x47f0('0xb')](_0x47f0('0x25'),_0x4e1ef0['firstName'],_0x4e1ef0[_0x47f0('0x26')],_0x4e1ef0[_0x47f0('0x27')],_0x373ee2);if(this[_0x47f0('0xd')][_0x373ee2]){return mailAccount[_0x47f0('0x28')](_0x373ee2,_0x4e1ef0)['then'](function(_0x3d7c71){if(_0x3d7c71){logger[_0x47f0('0xb')](_0x47f0('0x29'));}})[_0x47f0('0x2a')](function(_0x1eaf6a){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x47f0('0x2b')](_0x1eaf6a));});}};EmailChannel['prototype'][_0x47f0('0x21')]=function(_0x134bea){if(this[_0x47f0('0xd')][_0x134bea]&&this[_0x47f0('0xd')][_0x134bea][_0x47f0('0x11')]){if(this[_0x47f0('0xe')][this[_0x47f0('0xd')][_0x134bea][_0x47f0('0x11')]['id']]){delete this['imapAccounts'][this[_0x47f0('0xd')][_0x134bea][_0x47f0('0x11')]['id']];}this[_0x47f0('0xd')][_0x134bea]['Imap'][_0x47f0('0x2c')]=moment();this[_0x47f0('0xf')](_0x134bea);}};EmailChannel[_0x47f0('0x2d')][_0x47f0('0x22')]=function(_0x1691c5,_0x3e45d2){if(this['mailAccounts'][_0x1691c5]){this['mailAccounts'][_0x1691c5][_0x47f0('0x11')][_0x47f0('0x12')]=_0x47f0('0x2e');this[_0x47f0('0xd')][_0x1691c5][_0x47f0('0x11')][_0x47f0('0x2f')]=_0x3e45d2;return this[_0x47f0('0xf')](_0x1691c5);}};EmailChannel[_0x47f0('0x2d')][_0x47f0('0x30')]=function(_0x1d69ad,_0x12396e){return this['smtp'][_0x47f0('0x31')](_0x1d69ad,_0x12396e);};EmailChannel[_0x47f0('0x2d')][_0x47f0('0x32')]=function(_0x144c8c){var _0x56bb99=this;if(this[_0x47f0('0xd')][_0x144c8c['id']]){if(_[_0x47f0('0x14')](this[_0x47f0('0xd')][_0x144c8c['id']][_0x47f0('0x33')])){this[_0x47f0('0xd')][_0x144c8c['id']][_0x47f0('0x33')]={};}this[_0x47f0('0xd')][_0x144c8c['id']][_0x47f0('0x33')][_0x47f0('0x2c')]=moment();return new BPromise(function(_0x1fd62d,_0x4cb0fc){return _0x56bb99[_0x47f0('0x34')]['verify'](_0x144c8c)['then'](function(_0x487e73){_0x56bb99['mailAccounts'][_0x144c8c['id']]['Smtp'][_0x47f0('0x12')]=_0x47f0('0x35');_0x56bb99[_0x47f0('0xd')][_0x144c8c['id']]['Smtp']['messageStatus']='';_0x56bb99[_0x47f0('0xf')](_0x144c8c['id']);_0x1fd62d(_0x487e73);})[_0x47f0('0x2a')](function(_0x4aa90f){_0x56bb99[_0x47f0('0xd')][_0x144c8c['id']]['Smtp'][_0x47f0('0x12')]=_0x47f0('0x2e');_0x56bb99[_0x47f0('0xd')][_0x144c8c['id']][_0x47f0('0x33')]['messageStatus']=_0x4aa90f;_0x56bb99['emit'](_0x144c8c['id']);_0x4cb0fc(_0x4aa90f);});});}return this[_0x47f0('0x34')]['verify'](_0x144c8c);};module[_0x47f0('0x36')]=EmailChannel;
\ No newline at end of file
index fb59b51..b2ae15b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd672=['service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','closeBox','handleCloseBox','handleFetchError','handleEnd','stringify','upperFirst','exports','util','imap','mailparser','iconv','Iconv','events','./utils','email','mailbox','getAccount','account','ready','handleReady','bind','once','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout'];(function(_0x67d3ff,_0x170cb2){var _0x4ffdfc=function(_0xd18e51){while(--_0xd18e51){_0x67d3ff['push'](_0x67d3ff['shift']());}};_0x4ffdfc(++_0x170cb2);}(_0xd672,0xe1));var _0x2d67=function(_0x4b25b6,_0x2a9b2f){_0x4b25b6=_0x4b25b6-0x0;var _0x24055e=_0xd672[_0x4b25b6];return _0x24055e;};'use strict';var _=require('lodash');var util=require(_0x2d67('0x0'));var Imap=require(_0x2d67('0x1'));var simpleParser=require(_0x2d67('0x2'))['simpleParser'];var Iconv=require(_0x2d67('0x3'))[_0x2d67('0x4')];var EventEmitter=require(_0x2d67('0x5'))['EventEmitter'];var utils=require(_0x2d67('0x6'));var logger=require('../../../config/logger')(_0x2d67('0x7'));function EmailImap(_0x5e537b,_0x195584){this[_0x2d67('0x8')]=_0x5e537b[_0x2d67('0x8')];this['account']=this[_0x2d67('0x9')](_0x5e537b,_0x195584);this[_0x2d67('0x1')]=new Imap(this[_0x2d67('0xa')]);this[_0x2d67('0x1')]['once'](_0x2d67('0xb'),this[_0x2d67('0xc')][_0x2d67('0xd')](this));this[_0x2d67('0x1')][_0x2d67('0xe')](_0x2d67('0xf'),this['handleEnd'][_0x2d67('0xd')](this));this[_0x2d67('0x1')]['on'](_0x2d67('0x10'),this[_0x2d67('0x11')]['bind'](this));this[_0x2d67('0x1')][_0x2d67('0x12')]();}util[_0x2d67('0x13')](EmailImap,EventEmitter);EmailImap[_0x2d67('0x14')][_0x2d67('0x9')]=function(_0x12fd62,_0x20b24a){var _0x178e63={'connTimeout':_0x12fd62[_0x2d67('0x15')]?_0x12fd62[_0x2d67('0x15')]*0x3e8:0x2710,'authTimeout':_0x12fd62[_0x2d67('0x16')]?_0x12fd62[_0x2d67('0x16')]*0x3e8:0x1388};if(_0x12fd62[_0x2d67('0x17')]){_0x178e63[_0x2d67('0x18')]=_0x12fd62[_0x2d67('0x18')];if(_0x12fd62[_0x2d67('0x19')]){_0x178e63['xoauth2']=utils[_0x2d67('0x1a')](_0x12fd62[_0x2d67('0x1b')][_0x2d67('0x1c')],_0x12fd62[_0x2d67('0x18')]);}else{_0x178e63[_0x2d67('0x1d')]=_0x12fd62[_0x2d67('0x1d')];}}else{if(_0x12fd62[_0x2d67('0x1e')]){_0x178e63[_0x2d67('0x18')]=_0x12fd62['user'];_0x178e63[_0x2d67('0x1d')]=_0x12fd62[_0x2d67('0x1d')];}}_0x178e63[_0x2d67('0x7')]=_0x20b24a||_0x12fd62[_0x2d67('0x18')]||'anonymous@xcally.com';_0x178e63['host']=_0x12fd62[_0x2d67('0x1f')];_0x178e63[_0x2d67('0x20')]=_0x12fd62[_0x2d67('0x20')]||0x3e1;if(_0x12fd62[_0x2d67('0x21')]){_0x178e63[_0x2d67('0x21')]=!![];}else{_0x178e63['tls']=![];_0x178e63['autotls']=_0x2d67('0x22');}return _0x178e63;};EmailImap[_0x2d67('0x14')][_0x2d67('0xc')]=function(){this[_0x2d67('0x1')][_0x2d67('0x23')](this['mailbox'],![],this['handleOpenBox'][_0x2d67('0xd')](this));};EmailImap[_0x2d67('0x14')][_0x2d67('0x24')]=function(_0x22e3fe,_0x58c851){if(_0x22e3fe){this[_0x2d67('0x11')](_0x22e3fe,!![]);}else{this['emit'](_0x2d67('0x25'),_0x58c851);this[_0x2d67('0x26')]();}};EmailImap[_0x2d67('0x14')]['handleCloseBox']=function(_0x2bede3){if(_0x2bede3){this[_0x2d67('0x11')](_0x2bede3,!![]);}else{this[_0x2d67('0x1')][_0x2d67('0xf')]();}};EmailImap[_0x2d67('0x14')]['readUnseen']=function(){this[_0x2d67('0x1')][_0x2d67('0x27')]([_0x2d67('0x28')],this[_0x2d67('0x29')][_0x2d67('0xd')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x3bfa4e,_0x44ba3a){if(_0x3bfa4e){this[_0x2d67('0x11')](_0x3bfa4e,!![]);}else{if(_0x44ba3a[_0x2d67('0x2a')]){try{var _0x1d2dab=this[_0x2d67('0x1')][_0x2d67('0x2b')](_0x44ba3a,{'bodies':'','markSeen':!![]});_0x1d2dab['on'](_0x2d67('0x2c'),this[_0x2d67('0x2d')][_0x2d67('0xd')](this));_0x1d2dab['once'](_0x2d67('0x10'),this['handleFetchError'][_0x2d67('0xd')](this));_0x1d2dab[_0x2d67('0xe')](_0x2d67('0xf'),this['handleFetchEnd']['bind'](this));}catch(_0x13c187){logger[_0x2d67('0x10')](_0x13c187);}}else{this[_0x2d67('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x2d67('0xd')](this));}}};EmailImap[_0x2d67('0x14')][_0x2d67('0x2d')]=function(_0x229783){_0x229783['on'](_0x2d67('0x2e'),this[_0x2d67('0x2f')][_0x2d67('0xd')](this));_0x229783[_0x2d67('0xe')](_0x2d67('0x30'),this[_0x2d67('0x31')][_0x2d67('0xd')](this));_0x229783[_0x2d67('0xe')](_0x2d67('0xf'),this[_0x2d67('0x32')]['bind'](this));};EmailImap[_0x2d67('0x14')][_0x2d67('0x2f')]=function(_0x2ce735){simpleParser(_0x2ce735,{'Iconv':Iconv},this['handleSimpleParser'][_0x2d67('0xd')](this));};EmailImap['prototype'][_0x2d67('0x31')]=function(){};EmailImap[_0x2d67('0x14')][_0x2d67('0x32')]=function(){};EmailImap[_0x2d67('0x14')][_0x2d67('0x33')]=function(_0x2fcda2,_0x276c70){if(_0x2fcda2){logger[_0x2d67('0x10')](_0x2fcda2);}else{var _0x169aad=this;utils[_0x2d67('0x34')](this['account'],_0x276c70,function(_0x4de626){_0x169aad[_0x2d67('0x35')](_0x2d67('0x7'),_0x4de626);});}};EmailImap[_0x2d67('0x14')][_0x2d67('0x36')]=function(){this[_0x2d67('0x1')][_0x2d67('0x37')](!![],this[_0x2d67('0x38')][_0x2d67('0xd')](this));};EmailImap[_0x2d67('0x14')][_0x2d67('0x39')]=function(_0x1582ca){this['handleError'](_0x1582ca);this[_0x2d67('0x1')][_0x2d67('0x37')](!![],this[_0x2d67('0x38')][_0x2d67('0xd')](this));};EmailImap['prototype'][_0x2d67('0x3a')]=function(){this['emit'](_0x2d67('0xf'));};EmailImap['prototype'][_0x2d67('0x11')]=function(_0x1129a4,_0x1bc575){logger[_0x2d67('0x10')](_0x2d67('0x11'),this['account'][_0x2d67('0x7')],JSON[_0x2d67('0x3b')](_0x1129a4));var _0x19350d='';if(_0x1129a4){if(_0x1129a4['textCode']){_0x19350d=_0x1129a4['textCode'];}else{for(var _0x4d4138 in _0x1129a4){if(_0x1129a4['hasOwnProperty'](_0x4d4138)){_0x19350d+=_[_0x2d67('0x3c')](_0x4d4138)+':\x20'+_0x1129a4[_0x4d4138]+'\x0a';}}}}if(_0x1bc575){this[_0x2d67('0x1')][_0x2d67('0xf')]();}else{this[_0x2d67('0x35')]('error',_0x19350d);this['emit']('end');}};module[_0x2d67('0x3d')]=EmailImap;
\ No newline at end of file
+var _0xfbbb=['authTimeout','service','user','generateXOAuth2Token','CloudProvider','password','authentication','email','host','port','tls','autotls','prototype','handleReady','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','mailbox','account','getAccount','once','ready','bind','end','handleEnd','error','handleError','inherits'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xfbbb,0xdc));var _0xbfbb=function(_0x8e992d,_0x5dd91c){_0x8e992d=_0x8e992d-0x0;var _0x41dd7f=_0xfbbb[_0x8e992d];return _0x41dd7f;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var Imap=require(_0xbfbb('0x2'));var simpleParser=require(_0xbfbb('0x3'))[_0xbfbb('0x4')];var Iconv=require(_0xbfbb('0x5'))[_0xbfbb('0x6')];var EventEmitter=require(_0xbfbb('0x7'))['EventEmitter'];var utils=require(_0xbfbb('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x401de4,_0x8d0050){this[_0xbfbb('0x9')]=_0x401de4['mailbox'];this[_0xbfbb('0xa')]=this[_0xbfbb('0xb')](_0x401de4,_0x8d0050);this['imap']=new Imap(this[_0xbfbb('0xa')]);this['imap'][_0xbfbb('0xc')](_0xbfbb('0xd'),this['handleReady'][_0xbfbb('0xe')](this));this['imap'][_0xbfbb('0xc')](_0xbfbb('0xf'),this[_0xbfbb('0x10')]['bind'](this));this[_0xbfbb('0x2')]['on'](_0xbfbb('0x11'),this[_0xbfbb('0x12')][_0xbfbb('0xe')](this));this[_0xbfbb('0x2')]['connect']();}util[_0xbfbb('0x13')](EmailImap,EventEmitter);EmailImap['prototype'][_0xbfbb('0xb')]=function(_0x6791ea,_0x15f45b){var _0x394b38={'connTimeout':_0x6791ea['connTimeout']?_0x6791ea['connTimeout']*0x3e8:0x2710,'authTimeout':_0x6791ea[_0xbfbb('0x14')]?_0x6791ea[_0xbfbb('0x14')]*0x3e8:0x1388};if(_0x6791ea[_0xbfbb('0x15')]){_0x394b38[_0xbfbb('0x16')]=_0x6791ea[_0xbfbb('0x16')];if(_0x6791ea['modernAuthentication']){_0x394b38['xoauth2']=utils[_0xbfbb('0x17')](_0x6791ea[_0xbfbb('0x18')]['data5'],_0x6791ea[_0xbfbb('0x16')]);}else{_0x394b38[_0xbfbb('0x19')]=_0x6791ea[_0xbfbb('0x19')];}}else{if(_0x6791ea[_0xbfbb('0x1a')]){_0x394b38[_0xbfbb('0x16')]=_0x6791ea[_0xbfbb('0x16')];_0x394b38['password']=_0x6791ea['password'];}}_0x394b38[_0xbfbb('0x1b')]=_0x15f45b||_0x6791ea['user']||'anonymous@xcally.com';_0x394b38[_0xbfbb('0x1c')]=_0x6791ea[_0xbfbb('0x1c')];_0x394b38[_0xbfbb('0x1d')]=_0x6791ea[_0xbfbb('0x1d')]||0x3e1;if(_0x6791ea[_0xbfbb('0x1e')]){_0x394b38['tls']=!![];}else{_0x394b38['tls']=![];_0x394b38[_0xbfbb('0x1f')]='required';}return _0x394b38;};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x21')]=function(){this[_0xbfbb('0x2')]['openBox'](this[_0xbfbb('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x22')]=function(_0x5ecbe8,_0x2bc675){if(_0x5ecbe8){this['handleError'](_0x5ecbe8,!![]);}else{this[_0xbfbb('0x23')](_0xbfbb('0x24'),_0x2bc675);this[_0xbfbb('0x25')]();}};EmailImap[_0xbfbb('0x20')]['handleCloseBox']=function(_0x2298e2){if(_0x2298e2){this[_0xbfbb('0x12')](_0x2298e2,!![]);}else{this['imap'][_0xbfbb('0xf')]();}};EmailImap['prototype'][_0xbfbb('0x25')]=function(){this['imap'][_0xbfbb('0x26')]([_0xbfbb('0x27')],this[_0xbfbb('0x28')][_0xbfbb('0xe')](this));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x28')]=function(_0x2ce3b9,_0x4dca3d){if(_0x2ce3b9){this['handleError'](_0x2ce3b9,!![]);}else{if(_0x4dca3d[_0xbfbb('0x29')]){try{var _0x452d62=this['imap'][_0xbfbb('0x2a')](_0x4dca3d,{'bodies':'','markSeen':!![]});_0x452d62['on']('message',this[_0xbfbb('0x2b')]['bind'](this));_0x452d62[_0xbfbb('0xc')](_0xbfbb('0x11'),this[_0xbfbb('0x2c')][_0xbfbb('0xe')](this));_0x452d62['once'](_0xbfbb('0xf'),this[_0xbfbb('0x2d')]['bind'](this));}catch(_0x201af0){logger[_0xbfbb('0x11')](_0x201af0);}}else{this[_0xbfbb('0x2')][_0xbfbb('0x2e')](!![],this['handleCloseBox'][_0xbfbb('0xe')](this));}}};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x2b')]=function(_0xb6b859){_0xb6b859['on'](_0xbfbb('0x2f'),this['handleMessageBody'][_0xbfbb('0xe')](this));_0xb6b859['once'](_0xbfbb('0x30'),this[_0xbfbb('0x31')][_0xbfbb('0xe')](this));_0xb6b859[_0xbfbb('0xc')](_0xbfbb('0xf'),this[_0xbfbb('0x32')][_0xbfbb('0xe')](this));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x33')]=function(_0x2486c7){simpleParser(_0x2486c7,{'Iconv':Iconv},this[_0xbfbb('0x34')][_0xbfbb('0xe')](this));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x31')]=function(){};EmailImap[_0xbfbb('0x20')]['handleMessageEnd']=function(){};EmailImap[_0xbfbb('0x20')]['handleSimpleParser']=function(_0x2f225c,_0x4ccf76){if(_0x2f225c){logger[_0xbfbb('0x11')](_0x2f225c);}else{var _0x5e96a1=this;utils[_0xbfbb('0x35')](this['account'],_0x4ccf76,function(_0x3a9d9d){_0x5e96a1[_0xbfbb('0x23')](_0xbfbb('0x1b'),_0x3a9d9d);});}};EmailImap[_0xbfbb('0x20')]['handleFetchEnd']=function(){this[_0xbfbb('0x2')][_0xbfbb('0x2e')](!![],this[_0xbfbb('0x36')]['bind'](this));};EmailImap['prototype'][_0xbfbb('0x2c')]=function(_0x47c905){this[_0xbfbb('0x12')](_0x47c905);this['imap'][_0xbfbb('0x2e')](!![],this[_0xbfbb('0x36')]['bind'](this));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x10')]=function(){this[_0xbfbb('0x23')](_0xbfbb('0xf'));};EmailImap[_0xbfbb('0x20')][_0xbfbb('0x12')]=function(_0xfa0140,_0x1eb989){logger[_0xbfbb('0x11')](_0xbfbb('0x12'),this[_0xbfbb('0xa')]['email'],JSON[_0xbfbb('0x37')](_0xfa0140));var _0x2a902e='';if(_0xfa0140){if(_0xfa0140[_0xbfbb('0x38')]){_0x2a902e=_0xfa0140[_0xbfbb('0x38')];}else{for(var _0x42065c in _0xfa0140){if(_0xfa0140[_0xbfbb('0x39')](_0x42065c)){_0x2a902e+=_[_0xbfbb('0x3a')](_0x42065c)+':\x20'+_0xfa0140[_0x42065c]+'\x0a';}}}}if(_0x1eb989){this[_0xbfbb('0x2')][_0xbfbb('0xf')]();}else{this[_0xbfbb('0x23')](_0xbfbb('0x11'),_0x2a902e);this[_0xbfbb('0x23')]('end');}};module[_0xbfbb('0x3b')]=EmailImap;
\ No newline at end of file
index b48552b..3bb33d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2360=['sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','createTransport','use','compile'];(function(_0x342f5d,_0x2b16d6){var _0x194c01=function(_0x21aff6){while(--_0x21aff6){_0x342f5d['push'](_0x342f5d['shift']());}};_0x194c01(++_0x2b16d6);}(_0x2360,0x19d));var _0x0236=function(_0x3bf788,_0x375b69){_0x3bf788=_0x3bf788-0x0;var _0x8d7faf=_0x2360[_0x3bf788];return _0x8d7faf;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x0236('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x0236('0x1')]=function(_0x31051a,_0x3a2367){return new Promise(function(_0x1b0894,_0x214479){var _0x2e7e8f=nodemailer[_0x0236('0x2')](_0x31051a);_0x2e7e8f[_0x0236('0x3')](_0x0236('0x4'),inlineBase64());_0x2e7e8f[_0x0236('0x5')](_0x3a2367,function(_0x58a037,_0x4f0ab3){if(_0x58a037){_0x214479(_0x58a037[_0x0236('0x6')]());}else{_0x1b0894(_0x4f0ab3);}});});};EmailSmtp[_0x0236('0x7')][_0x0236('0x8')]=function(_0x526a26){return new Promise(function(_0x2e28fb,_0x310cff){var _0x3a2747=nodemailer[_0x0236('0x2')](_0x526a26);_0x3a2747[_0x0236('0x8')](function(_0x4a6450,_0x2d2745){if(_0x4a6450){_0x310cff(_0x4a6450[_0x0236('0x6')]());}else{if(_0x2d2745){_0x2e28fb(_0x2d2745);}else{_0x310cff(_0x0236('0x9'));}}});});};module[_0x0236('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x030b=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString','Not\x20verifired'];(function(_0x54496d,_0x5b8572){var _0x40e626=function(_0xb6475c){while(--_0xb6475c){_0x54496d['push'](_0x54496d['shift']());}};_0x40e626(++_0x5b8572);}(_0x030b,0xfd));var _0xb030=function(_0x31c96d,_0x316aaa){_0x31c96d=_0x31c96d-0x0;var _0x424d15=_0x030b[_0x31c96d];return _0x424d15;};'use strict';var nodemailer=require(_0xb030('0x0'));var inlineBase64=require(_0xb030('0x1'));function EmailSmtp(){}EmailSmtp[_0xb030('0x2')][_0xb030('0x3')]=function(_0x171b5a,_0x178649){return new Promise(function(_0x18ada5,_0x5aefdb){var _0x582073=nodemailer[_0xb030('0x4')](_0x171b5a);_0x582073[_0xb030('0x5')](_0xb030('0x6'),inlineBase64());_0x582073[_0xb030('0x7')](_0x178649,function(_0x35ddd0,_0x40f10f){if(_0x35ddd0){_0x5aefdb(_0x35ddd0['toString']());}else{_0x18ada5(_0x40f10f);}});});};EmailSmtp['prototype']['verify']=function(_0x3900e1){return new Promise(function(_0x5e3151,_0x5db8fb){var _0x5d7f2e=nodemailer[_0xb030('0x4')](_0x3900e1);_0x5d7f2e[_0xb030('0x8')](function(_0x30ca67,_0x568141){if(_0x30ca67){_0x5db8fb(_0x30ca67[_0xb030('0x9')]());}else{if(_0x568141){_0x5e3151(_0x568141);}else{_0x5db8fb(_0xb030('0xa'));}}});});};module[_0xb030('0xb')]=EmailSmtp;
\ No newline at end of file
index 30ca7ca..4d2ef60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe246=['Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','value','anonymous','@xcally.com','name','address','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','replace','includes','<img','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','originCc','message','bcc','attachments','type','attachment','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','<p>Empty\x20message</p>'];(function(_0x3a6136,_0x1940db){var _0x2941a3=function(_0x49e5b7){while(--_0x49e5b7){_0x3a6136['push'](_0x3a6136['shift']());}};_0x2941a3(++_0x1940db);}(_0xe246,0x1dc));var _0x6e24=function(_0x554902,_0x2b5ca9){_0x554902=_0x554902-0x0;var _0x1a50fb=_0xe246[_0x554902];return _0x1a50fb;};'use strict';var _=require(_0x6e24('0x0'));var moment=require(_0x6e24('0x1'));var random=require(_0x6e24('0x2'));var fs=require('fs');var path=require(_0x6e24('0x3'));var util=require('util');var tnef=require(_0x6e24('0x4'));var logger=require(_0x6e24('0x5'))(_0x6e24('0x6'));var config=require(_0x6e24('0x7'));function getAddress(_0x1a550b){var _0x15ebdb=_['head'](_0x1a550b[_0x6e24('0x8')]);return _0x15ebdb&&_0x15ebdb['address']?_0x15ebdb['address']:_0x6e24('0x9')+random['generate'](0x6)+_0x6e24('0xa');}function getFirstName(_0x3a78f6){var _0x4822fa=_['head'](_0x3a78f6[_0x6e24('0x8')]);if(_0x4822fa&&_0x4822fa['name']){if(_0x4822fa[_0x6e24('0xb')]==_0x4822fa[_0x6e24('0xc')]){return _0x4822fa['name'][_0x6e24('0xd')](0x0,_0x4822fa[_0x6e24('0xb')][_0x6e24('0xe')]('@'));}var _0x17764d=_0x4822fa[_0x6e24('0xb')][_0x6e24('0xf')](/\s+/);return _0x17764d[_0x6e24('0x10')]>0x1?_0x17764d[_0x6e24('0x11')](0x0,-0x1)[_0x6e24('0x12')]('\x20'):_0x4822fa['name'];}return _0x6e24('0x13');}function getLastName(_0x555395){var _0x14fcfb=_['head'](_0x555395[_0x6e24('0x8')]);if(_0x14fcfb&&_0x14fcfb[_0x6e24('0xb')]){var _0x5928d9=_0x14fcfb[_0x6e24('0xb')][_0x6e24('0xf')](/\s+/);return _0x5928d9[_0x6e24('0x10')]>0x1?_0x5928d9[_0x6e24('0x14')]():'';}return'';}function getMails(_0x461b01,_0x230bd4){var _0x25adab='';for(var _0x4910f9=0x0;_0x4910f9<_0x230bd4[_0x6e24('0x8')][_0x6e24('0x10')];_0x4910f9+=0x1){if(_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]!==_0x461b01){if(!_[_0x6e24('0x15')](_0x25adab)){_0x25adab+=',';}_0x25adab+=_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xb')]||_0x230bd4['value'][_0x4910f9][_0x6e24('0xc')]||'';_0x25adab+='\x20<';_0x25adab+=_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]?_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]:_0x6e24('0x9')+random[_0x6e24('0x16')](0x6)+_0x6e24('0xa');_0x25adab+='>';}}return _0x25adab;}function parseEmail(_0x3f48a5,_0x4648f9,_0x4ca8c1){if(_0x4648f9[_0x6e24('0x17')]){var _0x5988cc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5988cc['test'](_0x4648f9[_0x6e24('0x17')])){_0x4648f9[_0x6e24('0x17')]=_0x4648f9[_0x6e24('0x17')][_0x6e24('0x18')](_0x5988cc,'');}if(_0x4648f9[_0x6e24('0x17')][_0x6e24('0x19')](_0x6e24('0x1a'))){var _0x3d84a2=[];_0x4648f9['attachments'][_0x6e24('0x1b')](_0x212364=>{_0x3d84a2['push'](_0x212364[_0x6e24('0x1c')]);});var _0x161374=/<img.*? _SRC(.*?)[^>]+>/g;var _0xd3641c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1c20a6=_0x4648f9[_0x6e24('0x17')][_0x6e24('0x18')](_0xd3641c,_0x6e24('0x1d'));var _0x21a1af=_0x1c20a6[_0x6e24('0x18')](_0x161374,_0x6e24('0x1e'));for(let _0x4a00b3=0x0;_0x4a00b3<_0x3d84a2['length'];_0x4a00b3++){var _0x2b4650=_0x21a1af[_0x6e24('0x18')](_0x6e24('0x1e'),_0x6e24('0x1f')+_0x3d84a2[_0x4a00b3]+'\x20]</span>');_0x21a1af=_0x2b4650;}_0x4648f9[_0x6e24('0x17')]=_0x21a1af;}_0x4ca8c1[_0x6e24('0x20')]=_0x4648f9[_0x6e24('0x17')];}else{_0x4ca8c1[_0x6e24('0x20')]=_0x4648f9[_0x6e24('0x21')];}if(_0x4ca8c1[_0x6e24('0x20')]){_0x4ca8c1[_0x6e24('0x20')]=_0x4ca8c1[_0x6e24('0x20')][_0x6e24('0x18')](/<a\s+/gi,_0x6e24('0x22'));}if(_0x4648f9['to']){_0x4ca8c1['message'][_0x6e24('0x23')]=getMails(null,_0x4648f9['to']);var _0x29e4a5=getMails(_0x3f48a5[_0x6e24('0x6')],_0x4648f9['to']);if(!_[_0x6e24('0x15')](_0x29e4a5)){_0x4ca8c1['message']['cc']+=_0x29e4a5;}}if(_0x4648f9['cc']){_0x4ca8c1['message'][_0x6e24('0x24')]=getMails(null,_0x4648f9['cc']);var _0x26c31f=getMails(_0x3f48a5['email'],_0x4648f9['cc']);if(!_[_0x6e24('0x15')](_0x26c31f)){if(!_[_0x6e24('0x15')](_0x4ca8c1[_0x6e24('0x25')]['cc'])){_0x4ca8c1[_0x6e24('0x25')]['cc']+=',';}_0x4ca8c1[_0x6e24('0x25')]['cc']+=_0x26c31f;}}if(!_[_0x6e24('0x19')](_0x4ca8c1['message'][_0x6e24('0x23')],_0x3f48a5[_0x6e24('0x6')])&&!_['includes'](_0x4ca8c1['message'][_0x6e24('0x24')],_0x3f48a5['email'])){_0x4ca8c1[_0x6e24('0x25')][_0x6e24('0x26')]=_0x3f48a5[_0x6e24('0x6')];}if(_0x4648f9[_0x6e24('0x27')]&&_0x4648f9['attachments'][_0x6e24('0x10')]){_0x4ca8c1[_0x6e24('0x25')]['attach']=_0x4648f9[_0x6e24('0x27')][_0x6e24('0x10')];for(var _0x423057=0x0,_0x3a1db0,_0x55879e,_0x9c3367;_0x423057<_0x4648f9[_0x6e24('0x27')][_0x6e24('0x10')];_0x423057+=0x1){if(_0x4648f9[_0x6e24('0x27')][_0x423057][_0x6e24('0x28')]===_0x6e24('0x29')){_0x9c3367=_0x4648f9[_0x6e24('0x27')][_0x423057]['filename']||_0x6e24('0x2a')+_0x423057;_0x3a1db0=util[_0x6e24('0x2b')](_0x6e24('0x2c'),Date['now'](),_0x9c3367);_0x55879e=path[_0x6e24('0x12')](config[_0x6e24('0x2d')],_0x6e24('0x2e'),_0x3a1db0);fs[_0x6e24('0x2f')](_0x55879e,_0x4648f9['attachments'][_0x423057][_0x6e24('0x30')]);_0x4ca8c1['message']['attachments'][_0x6e24('0x31')]({'name':_0x9c3367,'basename':_0x3a1db0,'type':_0x4648f9[_0x6e24('0x27')][_0x423057][_0x6e24('0x32')],'filepath':_0x55879e});}}}if(_0x4648f9[_0x6e24('0x33')]&&_0x4648f9['headerLines'][_0x6e24('0x10')]>0x0){var _0x2b4e24=[_0x6e24('0x34'),_0x6e24('0x35'),'Precedence:\x20auto_reply'];for(var _0x451c31=0x0;_0x451c31<_0x4648f9[_0x6e24('0x33')][_0x6e24('0x10')];_0x451c31++){var _0x2151a4=_[_0x6e24('0xe')](_0x2b4e24,_0x4648f9['headerLines'][_0x451c31][_0x6e24('0x36')]);if(_0x2151a4>=0x0){_0x4ca8c1[_0x6e24('0x37')]=!![];}}}return _0x4ca8c1;}exports[_0x6e24('0x38')]=function(_0x3e5c0e,_0xd8e59e,_0x197b57){var _0x52cfae={'from':getAddress(_0xd8e59e[_0x6e24('0x39')]),'firstName':getFirstName(_0xd8e59e['from']),'lastName':getLastName(_0xd8e59e['from']),'mapKey':_0x6e24('0x6'),'message':{'from':getMails(_0x3e5c0e[_0x6e24('0x6')],_0xd8e59e[_0x6e24('0x39')]),'to':_0x3e5c0e[_0x6e24('0x6')],'cc':'','subject':_0xd8e59e[_0x6e24('0x3a')]||'','messageId':_0xd8e59e[_0x6e24('0x3b')],'inReplyTo':_0xd8e59e[_0x6e24('0x3c')],'sentAt':moment(_0xd8e59e[_0x6e24('0x3d')])['format'](_0x6e24('0x3e')),'attach':![],'attachments':[]}};if(!_0xd8e59e['html']&&!_0xd8e59e[_0x6e24('0x21')]){var _0x2d6048=_[_0x6e24('0x3f')](_0xd8e59e[_0x6e24('0x27')],{'contentType':_0x6e24('0x40')});if(_0x2d6048[_0x6e24('0x10')]){logger[_0x6e24('0x41')](util[_0x6e24('0x2b')](_0x6e24('0x42'),_0xd8e59e[_0x6e24('0x3b')]));tnef[_0x6e24('0x43')](_['first'](_0x2d6048)[_0x6e24('0x30')],function(_0x34709d,_0x4549cc){if(_0x4549cc){_0xd8e59e['html']=_0x4549cc[_0x6e24('0x44')]||_0x6e24('0x45');if(_0x4549cc[_0x6e24('0x46')]){for(var _0x4f0609=0x0;_0x4f0609<_0x4549cc['Attachments'][_0x6e24('0x10')];_0x4f0609++){var _0x259138=_0x4549cc['Attachments'][_0x4f0609];_0x52cfae[_0x6e24('0x25')][_0x6e24('0x27')][_0x6e24('0x31')]({'filename':_0x259138['Title'],'content':Buffer['from'](_0x259138[_0x6e24('0x47')])});}}}_0x197b57(parseEmail(_0x3e5c0e,_0xd8e59e,_0x52cfae));});}else{_0xd8e59e[_0x6e24('0x17')]=_0x6e24('0x45');_0x197b57(parseEmail(_0x3e5c0e,_0xd8e59e,_0x52cfae));}}else{_0x197b57(parseEmail(_0x3e5c0e,_0xd8e59e,_0x52cfae));}};exports[_0x6e24('0x48')]=function(_0x2b78d8,_0x22a1a9){var _0x4e948c=[_0x6e24('0x49')+(_0x22a1a9||''),_0x6e24('0x4a')+_0x2b78d8,'',''];return Buffer[_0x6e24('0x39')](_0x4e948c[_0x6e24('0x12')]('\ 1'),_0x6e24('0x4b'))[_0x6e24('0x4c')](_0x6e24('0x4d'));};
\ No newline at end of file
+var _0x9c68=['<img','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','replace','<a\x20target=\x22_blank\x22\x20','message','includes','originTo','originCc','bcc','attachments','attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','parser','from','subject','messageId','inReplyTo','date','textAsHtml','first','BodyHTML','<p>Empty\x20message</p>','Attachments','push','Data','generateXOAuth2Token','user=','utf-8','toString','lodash','moment','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','isEmpty','html'];(function(_0x3d510a,_0x4675ea){var _0x13f6bd=function(_0xbbc6b7){while(--_0xbbc6b7){_0x3d510a['push'](_0x3d510a['shift']());}};_0x13f6bd(++_0x4675ea);}(_0x9c68,0x194));var _0x89c6=function(_0x58aeb5,_0x78ba23){_0x58aeb5=_0x58aeb5-0x0;var _0x5c0b74=_0x9c68[_0x58aeb5];return _0x5c0b74;};'use strict';var _=require(_0x89c6('0x0'));var moment=require(_0x89c6('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x89c6('0x2'));var util=require('util');var tnef=require(_0x89c6('0x3'));var logger=require(_0x89c6('0x4'))(_0x89c6('0x5'));var config=require('../../../config/environment');function getAddress(_0x5d3dee){var _0x3a10c6=_[_0x89c6('0x6')](_0x5d3dee[_0x89c6('0x7')]);return _0x3a10c6&&_0x3a10c6[_0x89c6('0x8')]?_0x3a10c6[_0x89c6('0x8')]:_0x89c6('0x9')+random[_0x89c6('0xa')](0x6)+_0x89c6('0xb');}function getFirstName(_0x140822){var _0x3f0230=_[_0x89c6('0x6')](_0x140822[_0x89c6('0x7')]);if(_0x3f0230&&_0x3f0230[_0x89c6('0xc')]){if(_0x3f0230[_0x89c6('0xc')]==_0x3f0230[_0x89c6('0x8')]){return _0x3f0230[_0x89c6('0xc')][_0x89c6('0xd')](0x0,_0x3f0230[_0x89c6('0xc')][_0x89c6('0xe')]('@'));}var _0x6c397c=_0x3f0230['name'][_0x89c6('0xf')](/\s+/);return _0x6c397c[_0x89c6('0x10')]>0x1?_0x6c397c[_0x89c6('0x11')](0x0,-0x1)[_0x89c6('0x12')]('\x20'):_0x3f0230[_0x89c6('0xc')];}return'Anonymous';}function getLastName(_0x3264a8){var _0x183f1d=_['head'](_0x3264a8[_0x89c6('0x7')]);if(_0x183f1d&&_0x183f1d[_0x89c6('0xc')]){var _0xde4576=_0x183f1d['name'][_0x89c6('0xf')](/\s+/);return _0xde4576[_0x89c6('0x10')]>0x1?_0xde4576[_0x89c6('0x13')]():'';}return'';}function getMails(_0x5c7087,_0x35e2e0){var _0x5b8135='';for(var _0x4addce=0x0;_0x4addce<_0x35e2e0[_0x89c6('0x7')]['length'];_0x4addce+=0x1){if(_0x35e2e0['value'][_0x4addce][_0x89c6('0x8')]!==_0x5c7087){if(!_[_0x89c6('0x14')](_0x5b8135)){_0x5b8135+=',';}_0x5b8135+=_0x35e2e0[_0x89c6('0x7')][_0x4addce][_0x89c6('0xc')]||_0x35e2e0[_0x89c6('0x7')][_0x4addce][_0x89c6('0x8')]||'';_0x5b8135+='\x20<';_0x5b8135+=_0x35e2e0[_0x89c6('0x7')][_0x4addce][_0x89c6('0x8')]?_0x35e2e0['value'][_0x4addce][_0x89c6('0x8')]:_0x89c6('0x9')+random['generate'](0x6)+_0x89c6('0xb');_0x5b8135+='>';}}return _0x5b8135;}function parseEmail(_0x1546f8,_0x41fa5f,_0x4669c8){if(_0x41fa5f[_0x89c6('0x15')]){var _0x3214f2=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x3214f2['test'](_0x41fa5f['html'])){_0x41fa5f['html']=_0x41fa5f['html']['replace'](_0x3214f2,'');}if(_0x41fa5f[_0x89c6('0x15')]['includes'](_0x89c6('0x16'))){var _0x26747d=[];_0x41fa5f['attachments'][_0x89c6('0x17')](_0x57e06b=>{_0x26747d['push'](_0x57e06b[_0x89c6('0x18')]);});var _0xee3b0b=/<img.*? _SRC(.*?)[^>]+>/g;var _0x37370b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a4033=_0x41fa5f[_0x89c6('0x15')]['replace'](_0x37370b,_0x89c6('0x19'));var _0x4a5e3a=_0x5a4033['replace'](_0xee3b0b,_0x89c6('0x1a'));for(let _0xb652b8=0x0;_0xb652b8<_0x26747d[_0x89c6('0x10')];_0xb652b8++){var _0x113cfe=_0x4a5e3a['replace']('_IMG',_0x89c6('0x1b')+_0x26747d[_0xb652b8]+_0x89c6('0x1c'));_0x4a5e3a=_0x113cfe;}_0x41fa5f[_0x89c6('0x15')]=_0x4a5e3a;}_0x4669c8[_0x89c6('0x1d')]=_0x41fa5f[_0x89c6('0x15')];}else{_0x4669c8[_0x89c6('0x1d')]=_0x41fa5f['textAsHtml'];}if(_0x4669c8['body']){_0x4669c8[_0x89c6('0x1d')]=_0x4669c8['body'][_0x89c6('0x1e')](/<a\s+/gi,_0x89c6('0x1f'));}if(_0x41fa5f['to']){_0x4669c8[_0x89c6('0x20')]['originTo']=getMails(null,_0x41fa5f['to']);var _0x7cf101=getMails(_0x1546f8[_0x89c6('0x5')],_0x41fa5f['to']);if(!_[_0x89c6('0x14')](_0x7cf101)){_0x4669c8[_0x89c6('0x20')]['cc']+=_0x7cf101;}}if(_0x41fa5f['cc']){_0x4669c8[_0x89c6('0x20')]['originCc']=getMails(null,_0x41fa5f['cc']);var _0x96d458=getMails(_0x1546f8[_0x89c6('0x5')],_0x41fa5f['cc']);if(!_['isEmpty'](_0x96d458)){if(!_[_0x89c6('0x14')](_0x4669c8[_0x89c6('0x20')]['cc'])){_0x4669c8[_0x89c6('0x20')]['cc']+=',';}_0x4669c8[_0x89c6('0x20')]['cc']+=_0x96d458;}}if(!_[_0x89c6('0x21')](_0x4669c8[_0x89c6('0x20')][_0x89c6('0x22')],_0x1546f8[_0x89c6('0x5')])&&!_[_0x89c6('0x21')](_0x4669c8[_0x89c6('0x20')][_0x89c6('0x23')],_0x1546f8['email'])){_0x4669c8[_0x89c6('0x20')][_0x89c6('0x24')]=_0x1546f8['email'];}if(_0x41fa5f[_0x89c6('0x25')]&&_0x41fa5f[_0x89c6('0x25')]['length']){_0x4669c8[_0x89c6('0x20')][_0x89c6('0x26')]=_0x41fa5f[_0x89c6('0x25')]['length'];for(var _0x33f004=0x0,_0x59781c,_0x55d3ef,_0x3d1431;_0x33f004<_0x41fa5f[_0x89c6('0x25')][_0x89c6('0x10')];_0x33f004+=0x1){if(_0x41fa5f['attachments'][_0x33f004][_0x89c6('0x27')]===_0x89c6('0x28')){_0x3d1431=_0x41fa5f[_0x89c6('0x25')][_0x33f004][_0x89c6('0x18')]||'attachment-'+_0x33f004;_0x59781c=util[_0x89c6('0x29')](_0x89c6('0x2a'),Date[_0x89c6('0x2b')](),_0x3d1431);_0x55d3ef=path[_0x89c6('0x12')](config[_0x89c6('0x2c')],_0x89c6('0x2d'),_0x59781c);fs[_0x89c6('0x2e')](_0x55d3ef,_0x41fa5f[_0x89c6('0x25')][_0x33f004][_0x89c6('0x2f')]);_0x4669c8[_0x89c6('0x20')][_0x89c6('0x25')]['push']({'name':_0x3d1431,'basename':_0x59781c,'type':_0x41fa5f[_0x89c6('0x25')][_0x33f004][_0x89c6('0x30')],'filepath':_0x55d3ef});}}}if(_0x41fa5f[_0x89c6('0x31')]&&_0x41fa5f[_0x89c6('0x31')]['length']>0x0){var _0x164966=[_0x89c6('0x32'),_0x89c6('0x33'),_0x89c6('0x34')];for(var _0x2b59e8=0x0;_0x2b59e8<_0x41fa5f[_0x89c6('0x31')][_0x89c6('0x10')];_0x2b59e8++){var _0x4b0e54=_[_0x89c6('0xe')](_0x164966,_0x41fa5f[_0x89c6('0x31')][_0x2b59e8]['line']);if(_0x4b0e54>=0x0){_0x4669c8[_0x89c6('0x35')]=!![];}}}return _0x4669c8;}exports[_0x89c6('0x36')]=function(_0x4d16f4,_0x411b13,_0x5cb58f){var _0x5efba7={'from':getAddress(_0x411b13['from']),'firstName':getFirstName(_0x411b13[_0x89c6('0x37')]),'lastName':getLastName(_0x411b13[_0x89c6('0x37')]),'mapKey':_0x89c6('0x5'),'message':{'from':getMails(_0x4d16f4[_0x89c6('0x5')],_0x411b13[_0x89c6('0x37')]),'to':_0x4d16f4[_0x89c6('0x5')],'cc':'','subject':_0x411b13[_0x89c6('0x38')]||'','messageId':_0x411b13[_0x89c6('0x39')],'inReplyTo':_0x411b13[_0x89c6('0x3a')],'sentAt':moment(_0x411b13[_0x89c6('0x3b')])[_0x89c6('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x411b13[_0x89c6('0x15')]&&!_0x411b13[_0x89c6('0x3c')]){var _0x569361=_['filter'](_0x411b13['attachments'],{'contentType':'application/ms-tnef'});if(_0x569361[_0x89c6('0x10')]){logger['info'](util[_0x89c6('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x411b13[_0x89c6('0x39')]));tnef['parseBuffer'](_[_0x89c6('0x3d')](_0x569361)[_0x89c6('0x2f')],function(_0x5899b7,_0x402339){if(_0x402339){_0x411b13['html']=_0x402339[_0x89c6('0x3e')]||_0x89c6('0x3f');if(_0x402339['Attachments']){for(var _0xd3f933=0x0;_0xd3f933<_0x402339[_0x89c6('0x40')][_0x89c6('0x10')];_0xd3f933++){var _0x3d0382=_0x402339[_0x89c6('0x40')][_0xd3f933];_0x5efba7[_0x89c6('0x20')][_0x89c6('0x25')][_0x89c6('0x41')]({'filename':_0x3d0382['Title'],'content':Buffer[_0x89c6('0x37')](_0x3d0382[_0x89c6('0x42')])});}}}_0x5cb58f(parseEmail(_0x4d16f4,_0x411b13,_0x5efba7));});}else{_0x411b13[_0x89c6('0x15')]=_0x89c6('0x3f');_0x5cb58f(parseEmail(_0x4d16f4,_0x411b13,_0x5efba7));}}else{_0x5cb58f(parseEmail(_0x4d16f4,_0x411b13,_0x5efba7));}};exports[_0x89c6('0x43')]=function(_0x142bf7,_0x4e28d6){var _0x14b00f=[_0x89c6('0x44')+(_0x4e28d6||''),'auth=Bearer\x20'+_0x142bf7,'',''];return Buffer[_0x89c6('0x37')](_0x14b00f[_0x89c6('0x12')]('\ 1'),_0x89c6('0x45'))[_0x89c6('0x46')]('base64');};
\ No newline at end of file
index f479454..ed7b6e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2188=['Service','key','SERV','Imap','Smtp','exports','lodash','name'];(function(_0x1e3195,_0x1f6594){var _0x5069a2=function(_0x2a8180){while(--_0x2a8180){_0x1e3195['push'](_0x1e3195['shift']());}};_0x5069a2(++_0x1f6594);}(_0x2188,0x126));var _0x8218=function(_0x1069fb,_0x36cc39){_0x1069fb=_0x1069fb-0x0;var _0x51ee86=_0x2188[_0x1069fb];return _0x51ee86;};'use strict';var _=require(_0x8218('0x0'));function MailAccount(_0x42b0f2){this['id']=_0x42b0f2['id']||0x0;this['name']=_0x42b0f2[_0x8218('0x1')]||_0x8218('0x2');this[_0x8218('0x3')]=_0x42b0f2[_0x8218('0x3')]||_0x8218('0x4');this['active']=_0x42b0f2['active']||![];this[_0x8218('0x5')]=_0x42b0f2['Imap']||[];this[_0x8218('0x6')]=_0x42b0f2['Smtp']||[];}module[_0x8218('0x7')]=MailAccount;
\ No newline at end of file
+var _0x66b3=['Service','key','SERV','active','Smtp','exports','lodash','name'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x66b3,0xb6));var _0x366b=function(_0x1c67f5,_0x4e02fb){_0x1c67f5=_0x1c67f5-0x0;var _0x2bf7fc=_0x66b3[_0x1c67f5];return _0x2bf7fc;};'use strict';var _=require(_0x366b('0x0'));function MailAccount(_0x10f86c){this['id']=_0x10f86c['id']||0x0;this[_0x366b('0x1')]=_0x10f86c['name']||_0x366b('0x2');this[_0x366b('0x3')]=_0x10f86c['key']||_0x366b('0x4');this['active']=_0x10f86c[_0x366b('0x5')]||![];this['Imap']=_0x10f86c['Imap']||[];this[_0x366b('0x6')]=_0x10f86c[_0x366b('0x6')]||[];}module[_0x366b('0x7')]=MailAccount;
\ No newline at end of file
index b5b7813..970c9a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff5=['prototype','hasOwnProperty','initMailAccounts','length','isUndefined','mailAccounts','mapKeys'];(function(_0x9646f3,_0x2baace){var _0x401fb6=function(_0x3af886){while(--_0x3af886){_0x9646f3['push'](_0x9646f3['shift']());}};_0x401fb6(++_0x2baace);}(_0x5ff5,0x12b));var _0x55ff=function(_0x449f24,_0x5c2078){_0x449f24=_0x449f24-0x0;var _0x18099c=_0x5ff5[_0x449f24];return _0x18099c;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x55ff('0x0')]={};};function freeIsNotKey(_0x3fcc68,_0x5308cd,_0x5ebd77){var _0x21e03a=_[_0x55ff('0x1')](_0x3fcc68,function(_0x46829f,_0x16d2cd){return _0x46829f[_0x5ebd77];});for(var _0x56f9ac in _0x5308cd){if(_0x5308cd['hasOwnProperty'](_0x56f9ac)){if(!_0x21e03a[_0x56f9ac]){delete _0x5308cd[_0x56f9ac];}}}}Realtime[_0x55ff('0x2')]['mergeFromDatabase']=function(_0x5ca9cf,_0x2cc3c0){for(var _0x35e599 in _0x2cc3c0){if(_0x5ca9cf[_0x55ff('0x3')](_0x35e599)){_0x5ca9cf[_0x35e599]=_0x2cc3c0[_0x35e599];}}};Realtime[_0x55ff('0x2')][_0x55ff('0x4')]=function(){var _0x347642=this;return function(_0x277ac3){if(_0x277ac3){freeIsNotKey(_0x277ac3,_0x347642[_0x55ff('0x0')],'id');for(var _0x4b11c1=0x0,_0x43cbe5={},_0x4c690a={};_0x4b11c1<_0x277ac3[_0x55ff('0x5')];_0x4b11c1+=0x1){_0x43cbe5=_0x277ac3[_0x4b11c1];if(_[_0x55ff('0x6')](_0x347642[_0x55ff('0x0')][_0x43cbe5['id']])){_0x347642[_0x55ff('0x0')][_0x43cbe5['id']]=new MailAccount(_0x43cbe5);}else{_['merge'](_0x347642[_0x55ff('0x0')][_0x43cbe5['id']],_0x43cbe5);}}}return _0x347642[_0x55ff('0x0')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xa142=['hasOwnProperty','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase'];(function(_0x50a83a,_0x160138){var _0x48b308=function(_0x49a533){while(--_0x49a533){_0x50a83a['push'](_0x50a83a['shift']());}};_0x48b308(++_0x160138);}(_0xa142,0x1e9));var _0x2a14=function(_0x59a1a0,_0x45d4a8){_0x59a1a0=_0x59a1a0-0x0;var _0x442238=_0xa142[_0x59a1a0];return _0x442238;};'use strict';var _=require(_0x2a14('0x0'));var MailAccount=require(_0x2a14('0x1'));var Realtime=function(){this[_0x2a14('0x2')]={};};function freeIsNotKey(_0x49939a,_0x23572c,_0x484701){var _0x2c42e4=_[_0x2a14('0x3')](_0x49939a,function(_0x39a1e8,_0xa488b5){return _0x39a1e8[_0x484701];});for(var _0xf59cca in _0x23572c){if(_0x23572c['hasOwnProperty'](_0xf59cca)){if(!_0x2c42e4[_0xf59cca]){delete _0x23572c[_0xf59cca];}}}}Realtime[_0x2a14('0x4')][_0x2a14('0x5')]=function(_0x254d39,_0x5c577e){for(var _0x3992c2 in _0x5c577e){if(_0x254d39[_0x2a14('0x6')](_0x3992c2)){_0x254d39[_0x3992c2]=_0x5c577e[_0x3992c2];}}};Realtime[_0x2a14('0x4')]['initMailAccounts']=function(){var _0x289b74=this;return function(_0x3ca00a){if(_0x3ca00a){freeIsNotKey(_0x3ca00a,_0x289b74[_0x2a14('0x2')],'id');for(var _0x1fb90f=0x0,_0x7f8a68={},_0x1290d1={};_0x1fb90f<_0x3ca00a['length'];_0x1fb90f+=0x1){_0x7f8a68=_0x3ca00a[_0x1fb90f];if(_[_0x2a14('0x7')](_0x289b74[_0x2a14('0x2')][_0x7f8a68['id']])){_0x289b74[_0x2a14('0x2')][_0x7f8a68['id']]=new MailAccount(_0x7f8a68);}else{_[_0x2a14('0x8')](_0x289b74[_0x2a14('0x2')][_0x7f8a68['id']],_0x7f8a68);}}}return _0x289b74['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
index e537e69..fc8d308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e02=['data5','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','key','TemplateId','MailServerIn','Imap','CloudProvider','type'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x7e02,0x71));var _0x27e0=function(_0x7d653b,_0x3f3341){_0x7d653b=_0x7d653b-0x0;var _0x3a30e7=_0x7e02[_0x7d653b];return _0x3a30e7;};'use strict';var client=require(_0x27e0('0x0'));exports[_0x27e0('0x1')]=function(){return function(){return client[_0x27e0('0x2')](_0x27e0('0x3'),{'options':{'attributes':['id',_0x27e0('0x4'),_0x27e0('0x5'),_0x27e0('0x6'),'email','active',_0x27e0('0x7'),'ListId',_0x27e0('0x8')],'raw':![],'include':[{'model':_0x27e0('0x9'),'as':_0x27e0('0xa'),'include':[{'model':_0x27e0('0xb'),'attributes':['id',_0x27e0('0x4'),_0x27e0('0x6'),_0x27e0('0xc'),_0x27e0('0xd')],'as':'CloudProvider'}]},{'model':_0x27e0('0xe'),'as':'Smtp','include':[{'model':_0x27e0('0xb'),'attributes':['id',_0x27e0('0x4'),'service',_0x27e0('0xc'),_0x27e0('0xd')],'as':_0x27e0('0xb')}]}]},'log':_0x27e0('0xf')});};};exports[_0x27e0('0x10')]=function(_0x426a81,_0x1ee615){return client[_0x27e0('0x2')](_0x27e0('0x11'),{'account':{'id':_0x426a81},'body':_0x1ee615,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0xd8af=['type','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','active','key','ListId','MailServerIn','CloudProvider'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xd8af,0x18d));var _0xfd8a=function(_0x387953,_0xe94d8b){_0x387953=_0x387953-0x0;var _0x27c6d2=_0xd8af[_0x387953];return _0x27c6d2;};'use strict';var client=require(_0xfd8a('0x0'));exports[_0xfd8a('0x1')]=function(){return function(){return client[_0xfd8a('0x2')](_0xfd8a('0x3'),{'options':{'attributes':['id',_0xfd8a('0x4'),'provider',_0xfd8a('0x5'),'email',_0xfd8a('0x6'),_0xfd8a('0x7'),_0xfd8a('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0xfd8a('0x9'),'as':'Imap','include':[{'model':_0xfd8a('0xa'),'attributes':['id',_0xfd8a('0x4'),_0xfd8a('0x5'),_0xfd8a('0xb'),'data5'],'as':_0xfd8a('0xa')}]},{'model':_0xfd8a('0xc'),'as':_0xfd8a('0xd'),'include':[{'model':_0xfd8a('0xa'),'attributes':['id',_0xfd8a('0x4'),_0xfd8a('0x5'),'type','data5'],'as':_0xfd8a('0xa')}]}]},'log':_0xfd8a('0xe')});};};exports[_0xfd8a('0xf')]=function(_0x59fc71,_0x4f38cc){return client['Request'](_0xfd8a('0x10'),{'account':{'id':_0x59fc71},'body':_0x4f38cc,'log':_0xfd8a('0x10')});};
\ No newline at end of file
index 270ec28..b57e742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d3=['GetSettings','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x28cee5,_0x265baf){var _0x262eef=function(_0x2228ef){while(--_0x2228ef){_0x28cee5['push'](_0x28cee5['shift']());}};_0x262eef(++_0x265baf);}(_0xc6d3,0x182));var _0x3c6d=function(_0x5d5c5f,_0x278aed){_0x5d5c5f=_0x5d5c5f-0x0;var _0x4a0719=_0xc6d3[_0x5d5c5f];return _0x4a0719;};'use strict';var client=require('../client');exports[_0x3c6d('0x0')]=function(){return client[_0x3c6d('0x1')](_0x3c6d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3c6d('0x3')]},'log':_0x3c6d('0x4')});};
\ No newline at end of file
+var _0x87c1=['ShowSetting','GetSettings','../client','Request'];(function(_0x872e5b,_0xbbcc3){var _0x20c92d=function(_0x386237){while(--_0x386237){_0x872e5b['push'](_0x872e5b['shift']());}};_0x20c92d(++_0xbbcc3);}(_0x87c1,0x146));var _0x187c=function(_0x5436da,_0x31717c){_0x5436da=_0x5436da-0x0;var _0xa6693f=_0x87c1[_0x5436da];return _0xa6693f;};'use strict';var client=require(_0x187c('0x0'));exports['getSettings']=function(){return client[_0x187c('0x1')](_0x187c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x187c('0x3')});};
\ No newline at end of file
index 7f68497..cd65463 100644 (file)
@@ -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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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
index 108a6c4..144bb2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa308=['../../config/environment','createServer','listen','websocket','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','express','sticky-session','ioredis'];(function(_0x340fa1,_0x4fedab){var _0x48a053=function(_0x1c2839){while(--_0x1c2839){_0x340fa1['push'](_0x340fa1['shift']());}};_0x48a053(++_0x4fedab);}(_0xa308,0x115));var _0x8a30=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xa308[_0x4c3070];return _0x536a44;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x8a30('0x0'));var sticky=require(_0x8a30('0x1'));var Redis=require(_0x8a30('0x2'));var config=require(_0x8a30('0x3'));var app=express();var server=http[_0x8a30('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x8a30('0x5')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x8a30('0x6'),'polling']});config['redis']=_['defaults'](config[_0x8a30('0x7')],{'host':_0x8a30('0x8'),'port':0x18eb});socketio[_0x8a30('0x9')](require(_0x8a30('0xa'))({'pubClient':new Redis(config[_0x8a30('0x7')]),'subClient':new Redis(config[_0x8a30('0x7')])}));require(_0x8a30('0xb'))[_0x8a30('0xc')]();require(_0x8a30('0xd'))[_0x8a30('0xc')](socketio);require(_0x8a30('0xe'))[_0x8a30('0xc')](app);require(_0x8a30('0xf'))[_0x8a30('0xc')](app);}else{server[_0x8a30('0x10')]('listening',function(){console['log'](_0x8a30('0x11'),config[_0x8a30('0x12')]);});}exports=module[_0x8a30('0x13')]=app;
\ No newline at end of file
+var _0x1a3e=['createServer','timeout','listen','port','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','http','sticky-session','../../config/environment'];(function(_0xe1b88a,_0x29a391){var _0x3b86c6=function(_0x45a93b){while(--_0x45a93b){_0xe1b88a['push'](_0xe1b88a['shift']());}};_0x3b86c6(++_0x29a391);}(_0x1a3e,0x75));var _0xe1a3=function(_0x5ffc93,_0x7e7e63){_0x5ffc93=_0x5ffc93-0x0;var _0x18f477=_0x1a3e[_0x5ffc93];return _0x18f477;};'use strict';var _=require('lodash');var http=require(_0xe1a3('0x0'));var express=require('express');var sticky=require(_0xe1a3('0x1'));var Redis=require('ioredis');var config=require(_0xe1a3('0x2'));var app=express();var server=http[_0xe1a3('0x3')](app);server[_0xe1a3('0x4')]=0xdbba0;if(sticky[_0xe1a3('0x5')](server,config[_0xe1a3('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0xe1a3('0x7'),'polling']});config[_0xe1a3('0x8')]=_[_0xe1a3('0x9')](config[_0xe1a3('0x8')],{'host':_0xe1a3('0xa'),'port':0x18eb});socketio[_0xe1a3('0xb')](require(_0xe1a3('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xe1a3('0x8')])}));require(_0xe1a3('0xd'))[_0xe1a3('0xe')]();require(_0xe1a3('0xf'))['default'](socketio);require(_0xe1a3('0x10'))[_0xe1a3('0xe')](app);require(_0xe1a3('0x11'))[_0xe1a3('0xe')](app);}else{server[_0xe1a3('0x12')]('listening',function(){console['log'](_0xe1a3('0x13'),config[_0xe1a3('0x6')]);});}exports=module['exports']=app;
\ No newline at end of file
index 2052ce4..cd3ef43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1356=['result','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x121c68,_0x59f7fc){var _0x15754c=function(_0x3c9027){while(--_0x3c9027){_0x121c68['push'](_0x121c68['shift']());}};_0x15754c(++_0x59f7fc);}(_0x1356,0x16d));var _0x6135=function(_0xcde485,_0xe4faea){_0xcde485=_0xcde485-0x0;var _0xced84=_0x1356[_0xcde485];return _0xced84;};'use strict';var jayson=require(_0x6135('0x0'));var BPromise=require('bluebird');var logger=require(_0x6135('0x1'))(_0x6135('0x2'));var client=jayson[_0x6135('0x3')][_0x6135('0x4')]({'port':0x2329});client[_0x6135('0x5')]=function(_0xf70c50,_0x475a7b){return new BPromise(function(_0x13c917,_0x2b863e){return client[_0x6135('0x6')](_0xf70c50,_0x475a7b)[_0x6135('0x7')](function(_0x159f1a){logger[_0x6135('0x8')](_0x6135('0x9'),_0x6135('0x2'),_0xf70c50,_0x475a7b,_0x159f1a);if(_0x159f1a[_0x6135('0xa')]){logger[_0x6135('0xa')]('rpc','routing',_0xf70c50,_0x159f1a[_0x6135('0xa')][_0x6135('0xb')],_0x475a7b);return _0x2b863e(_0x159f1a['error'][_0x6135('0xb')]);}else{return _0x13c917(_0x159f1a[_0x6135('0xc')]);}})['catch'](function(_0x130e27){logger[_0x6135('0xa')](_0x6135('0x9'),_0x6135('0x2'),_0xf70c50,_0x130e27,_0x475a7b);return _0x2b863e(_0x130e27);});});};module['exports']=client;
\ No newline at end of file
+var _0x64a9=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','catch'];(function(_0x299c6d,_0x2d2072){var _0x35d9a5=function(_0x268826){while(--_0x268826){_0x299c6d['push'](_0x299c6d['shift']());}};_0x35d9a5(++_0x2d2072);}(_0x64a9,0x91));var _0x964a=function(_0xde186a,_0x1da937){_0xde186a=_0xde186a-0x0;var _0x320954=_0x64a9[_0xde186a];return _0x320954;};'use strict';var jayson=require(_0x964a('0x0'));var BPromise=require(_0x964a('0x1'));var logger=require(_0x964a('0x2'))(_0x964a('0x3'));var client=jayson[_0x964a('0x4')][_0x964a('0x5')]({'port':0x2329});client[_0x964a('0x6')]=function(_0x33f2fc,_0x356985){return new BPromise(function(_0x21285c,_0x424281){return client[_0x964a('0x7')](_0x33f2fc,_0x356985)[_0x964a('0x8')](function(_0x56037f){logger[_0x964a('0x9')](_0x964a('0xa'),_0x964a('0x3'),_0x33f2fc,_0x356985,_0x56037f);if(_0x56037f[_0x964a('0xb')]){logger[_0x964a('0xb')](_0x964a('0xa'),_0x964a('0x3'),_0x33f2fc,_0x56037f[_0x964a('0xb')][_0x964a('0xc')],_0x356985);return _0x424281(_0x56037f[_0x964a('0xb')][_0x964a('0xc')]);}else{return _0x21285c(_0x56037f[_0x964a('0xd')]);}})[_0x964a('0xe')](function(_0x194ec5){logger[_0x964a('0xb')](_0x964a('0xa'),_0x964a('0x3'),_0x33f2fc,_0x194ec5,_0x356985);return _0x424281(_0x194ec5);});});};module[_0x964a('0xf')]=client;
\ No newline at end of file
index 28591ae..5b6a027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd668=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xd668,0x112));var _0x8d66=function(_0x3300e6,_0x524013){_0x3300e6=_0x3300e6-0x0;var _0x239eea=_0xd668[_0x3300e6];return _0x239eea;};'use strict';var BPromise=require('bluebird');var server=require(_0x8d66('0x0'));var Realtime=require(_0x8d66('0x1'));var user=require(_0x8d66('0x2'));var interval=require(_0x8d66('0x3'));var openchannelQueue=require(_0x8d66('0x4'));var chatQueue=require(_0x8d66('0x5'));var smsQueue=require(_0x8d66('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x8d66('0x7'));var whatsappQueue=require(_0x8d66('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8d66('0x9')]()[_0x8d66('0xa')](user[_0x8d66('0xb')]())[_0x8d66('0xa')](realtime['initAgents']())[_0x8d66('0xa')](interval[_0x8d66('0xc')]())[_0x8d66('0xa')](realtime[_0x8d66('0xd')]())['then'](openchannelQueue[_0x8d66('0xe')]())['then'](realtime[_0x8d66('0xf')]())[_0x8d66('0xa')](chatQueue[_0x8d66('0x10')]())[_0x8d66('0xa')](realtime[_0x8d66('0x11')]())[_0x8d66('0xa')](smsQueue['getSmsQueues']())[_0x8d66('0xa')](realtime[_0x8d66('0x12')]())[_0x8d66('0xa')](mailQueue[_0x8d66('0x13')]())['then'](realtime[_0x8d66('0x14')]())[_0x8d66('0xa')](faxQueue[_0x8d66('0x15')]())[_0x8d66('0xa')](realtime[_0x8d66('0x16')]())[_0x8d66('0xa')](whatsappQueue[_0x8d66('0x17')]())[_0x8d66('0xa')](realtime[_0x8d66('0x18')]())[_0x8d66('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x35877a){return initRealtime();})['then'](function(_0x193ee6){return setInterval(initRealtime,0x1388);})['catch'](function(_0x3a5b73){console[_0x8d66('0x19')](_0x3a5b73);});}main();
\ No newline at end of file
+var _0x559f=['getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x559f,0x1d1));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var server=require(_0xf559('0x0'));var Realtime=require(_0xf559('0x1'));var user=require(_0xf559('0x2'));var interval=require(_0xf559('0x3'));var openchannelQueue=require(_0xf559('0x4'));var chatQueue=require(_0xf559('0x5'));var smsQueue=require(_0xf559('0x6'));var mailQueue=require(_0xf559('0x7'));var faxQueue=require(_0xf559('0x8'));var whatsappQueue=require(_0xf559('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf559('0xa')]()['then'](user[_0xf559('0xb')]())['then'](realtime['initAgents']())[_0xf559('0xc')](interval[_0xf559('0xd')]())['then'](realtime[_0xf559('0xe')]())[_0xf559('0xc')](openchannelQueue[_0xf559('0xf')]())[_0xf559('0xc')](realtime[_0xf559('0x10')]())[_0xf559('0xc')](chatQueue[_0xf559('0x11')]())[_0xf559('0xc')](realtime['initChatQueues']())[_0xf559('0xc')](smsQueue['getSmsQueues']())[_0xf559('0xc')](realtime[_0xf559('0x12')]())[_0xf559('0xc')](mailQueue[_0xf559('0x13')]())['then'](realtime[_0xf559('0x14')]())[_0xf559('0xc')](faxQueue[_0xf559('0x15')]())[_0xf559('0xc')](realtime[_0xf559('0x16')]())[_0xf559('0xc')](whatsappQueue[_0xf559('0x17')]())['then'](realtime[_0xf559('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0xf559('0x19')](realtime)[_0xf559('0xc')](function(_0x5936a1){return initRealtime();})[_0xf559('0xc')](function(_0xe92686){return setInterval(initRealtime,0x1388);})[_0xf559('0x1a')](function(_0x2c1c85){console[_0xf559('0x1b')](_0x2c1c85);});}main();
\ No newline at end of file
index 0de6902..b902b6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x2bda6f,_0x470c42){var _0x58f071=function(_0x129b25){while(--_0x129b25){_0x2bda6f['push'](_0x2bda6f['shift']());}};_0x58f071(++_0x470c42);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b3e51,_0x6fb0e4){_0x2b3e51=_0x2b3e51-0x0;var _0x4a36a3=_0x2ef3[_0x2b3e51];return _0x4a36a3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine;
\ No newline at end of file
+var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x28a180,_0x5bb5b0){_0x28a180=_0x28a180-0x0;var _0x1161d3=_0x1261[_0x28a180];return _0x1161d3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine;
\ No newline at end of file
index 40e62dc..a12babf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b7b=['error','message','result','catch','sendMailMessage','SendMail','jayson/promise','http','request'];(function(_0x745eb0,_0xa9731f){var _0x2945ba=function(_0x199c26){while(--_0x199c26){_0x745eb0['push'](_0x745eb0['shift']());}};_0x2945ba(++_0xa9731f);}(_0x9b7b,0x1c8));var _0xb9b7=function(_0x3ba565,_0x3b290b){_0x3ba565=_0x3ba565-0x0;var _0x5e920f=_0x9b7b[_0x3ba565];return _0x5e920f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb9b7('0x0'));var client=jayson['client'][_0xb9b7('0x1')]({'port':0x232b});function request(_0x331933,_0x2233f9){return new BPromise(function(_0x50983e,_0x1ab0a8){return client[_0xb9b7('0x2')](_0x331933,_0x2233f9)['then'](function(_0x47277f){if(_0x47277f[_0xb9b7('0x3')]){return _0x1ab0a8(_0x47277f[_0xb9b7('0x3')][_0xb9b7('0x4')]);}else{return _0x50983e(_0x47277f[_0xb9b7('0x5')]);}})[_0xb9b7('0x6')](function(_0x4cef37){return _0x1ab0a8(_0x4cef37);});});}exports[_0xb9b7('0x7')]=function(_0x3b4a85,_0x10ec8e){return request(_0xb9b7('0x8'),{'account':_0x3b4a85,'message':_0x10ec8e});};
\ No newline at end of file
+var _0x8911=['client','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x3f9a23,_0x4d93e6){var _0x6365a4=function(_0x4aeee0){while(--_0x4aeee0){_0x3f9a23['push'](_0x3f9a23['shift']());}};_0x6365a4(++_0x4d93e6);}(_0x8911,0xae));var _0x1891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8911[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x1891('0x0'));var jayson=require(_0x1891('0x1'));var client=jayson[_0x1891('0x2')]['http']({'port':0x232b});function request(_0x4dbd25,_0x11fde8){return new BPromise(function(_0x82242e,_0x3db6dd){return client[_0x1891('0x3')](_0x4dbd25,_0x11fde8)[_0x1891('0x4')](function(_0x862707){if(_0x862707[_0x1891('0x5')]){return _0x3db6dd(_0x862707['error'][_0x1891('0x6')]);}else{return _0x82242e(_0x862707[_0x1891('0x7')]);}})[_0x1891('0x8')](function(_0x57d5ec){return _0x3db6dd(_0x57d5ec);});});}exports[_0x1891('0x9')]=function(_0x50bac5,_0x444eae){return request(_0x1891('0xa'),{'account':_0x50bac5,'message':_0x444eae});};
\ No newline at end of file
index 3627f6b..d110eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd82f=['busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','whatsapp','getChannelStatus','Status','StatusTime','chatStatusTime','whatsappStatusTime','stringify','exports','md5','ioredis','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy'];(function(_0x2da36d,_0x4a519b){var _0x4e871b=function(_0x4f2d1b){while(--_0x4f2d1b){_0x2da36d['push'](_0x2da36d['shift']());}};_0x4e871b(++_0x4a519b);}(_0xd82f,0x104));var _0xfd82=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd82f[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xfd82('0x0'));var Redis=require(_0xfd82('0x1'));var config=require('../../../config/environment');config[_0xfd82('0x2')]=_[_0xfd82('0x3')](config[_0xfd82('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xfd82('0x4'))(new Redis(config['redis']));function Agent(_0x344355){this['id']=_0x344355['id']||0x0;this['name']=_0x344355[_0xfd82('0x5')]||'';this[_0xfd82('0x6')]=_0x344355[_0xfd82('0x6')]||!![];this[_0xfd82('0x7')]=_0x344355[_0xfd82('0x7')]||![];this[_0xfd82('0x8')]=_0x344355[_0xfd82('0x8')]||![];this[_0xfd82('0x9')]=_0x344355[_0xfd82('0x9')]||![];this[_0xfd82('0xa')]=_0x344355['faxPause']||![];this[_0xfd82('0xb')]=_0x344355['smsPause']||![];this[_0xfd82('0xc')]=_0x344355[_0xfd82('0xc')]||![];this[_0xfd82('0xd')]=_0xfd82('0xe');this['chatStatusTime']=0x0;this[_0xfd82('0xf')]=_0x344355[_0xfd82('0xf')]||0x0;this[_0xfd82('0x10')]=0x0;this['mailStatus']=_0xfd82('0xe');this[_0xfd82('0x11')]=0x0;this['mailCapacity']=_0x344355[_0xfd82('0x12')]||0x0;this[_0xfd82('0x13')]=0x0;this[_0xfd82('0x14')]='unknown';this[_0xfd82('0x15')]=0x0;this[_0xfd82('0x16')]=_0x344355[_0xfd82('0x16')]||0x0;this[_0xfd82('0x17')]=0x0;this[_0xfd82('0x18')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x344355[_0xfd82('0x19')]||0x0;this[_0xfd82('0x1a')]=0x0;this[_0xfd82('0x1b')]='unknown';this['whatsappStatusTime']=0x0;this[_0xfd82('0x1c')]=_0x344355[_0xfd82('0x1c')]||0x0;this[_0xfd82('0x1d')]=0x0;this[_0xfd82('0x1e')]='unknown';this[_0xfd82('0x1f')]=0x0;this[_0xfd82('0x20')]=_0x344355['openchannelCapacity']||0x0;this[_0xfd82('0x21')]=0x0;this[_0xfd82('0x22')]=![];this[_0xfd82('0x23')]=undefined;this[_0xfd82('0x0')]='';this[_0xfd82('0x24')]={};this[_0xfd82('0x25')]={};this[_0xfd82('0x26')]={};this[_0xfd82('0x27')]={};this[_0xfd82('0x28')]={};this[_0xfd82('0x29')]={};this[_0xfd82('0x2a')]();}Agent[_0xfd82('0x2b')]['getChannelStatus']=function(_0x47680b){if(this[_0x47680b+_0xfd82('0x2c')]>0x0){if(this[_0x47680b+_0xfd82('0x2d')]>0x0&&this[_0x47680b+_0xfd82('0x2c')]>=this[_0x47680b+_0xfd82('0x2d')]){return'maxcapacity';}else{return _0xfd82('0x2e');}}else{return _0xfd82('0x2f');}};Agent[_0xfd82('0x2b')]['updateRealtime']=function(){var _0x236225=[_0xfd82('0x30'),_0xfd82('0x31'),_0xfd82('0x32'),'fax','sms',_0xfd82('0x33')];for(var _0x3bfddc=0x0;_0x3bfddc<_0x236225['length'];_0x3bfddc+=0x1){var _0x3c2223=this[_0xfd82('0x34')](_0x236225[_0x3bfddc]);if(this[_0x236225[_0x3bfddc]+_0xfd82('0x35')]!==_0x3c2223){this[_0x236225[_0x3bfddc]+_0xfd82('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0x236225[_0x3bfddc]+_0xfd82('0x35')]=_0x3c2223;}var _0xbe67e5={'id':this['id'],'name':this[_0xfd82('0x5')],'online':this['online'],'voicePause':this[_0xfd82('0x7')],'chatPause':this[_0xfd82('0x8')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xfd82('0xa')],'openchannelPause':this[_0xfd82('0xc')],'chatStatus':this[_0xfd82('0xd')],'chatStatusTime':this[_0xfd82('0x37')],'chatCapacity':this[_0xfd82('0xf')],'chatCurrentCapacity':this[_0xfd82('0x10')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xfd82('0x11')],'mailCapacity':this[_0xfd82('0x12')],'mailCurrentCapacity':this[_0xfd82('0x13')],'faxStatus':this[_0xfd82('0x14')],'faxStatusTime':this[_0xfd82('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xfd82('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xfd82('0x19')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xfd82('0x1b')],'whatsappStatusTime':this[_0xfd82('0x38')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xfd82('0x1d')],'openchannelStatus':this[_0xfd82('0x1e')],'openchannelStatusTime':this[_0xfd82('0x1f')],'openchannelCapacity':this[_0xfd82('0x20')],'openchannelCurrentCapacity':this[_0xfd82('0x21')],'busy':this[_0xfd82('0x22')],'busyQueue':this[_0xfd82('0x23')],'chatWaitingInteractions':this[_0xfd82('0x24')],'faxWaitingInteractions':this[_0xfd82('0x25')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xfd82('0x27')],'smsWaitingInteractions':this[_0xfd82('0x28')],'whatsappWaitingInteractions':this[_0xfd82('0x29')]};var _0xa6e17b=md5(JSON[_0xfd82('0x39')](_0xbe67e5));if(this[_0xfd82('0x0')]!==_0xa6e17b){this[_0xfd82('0x0')]=_0xa6e17b;io['emit']('user:save',_0xbe67e5);}};module[_0xfd82('0x3a')]=Agent;
\ No newline at end of file
+var _0xa00a=['smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','busy','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','Capacity','idle','mail','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','format','mailCapacity','smsStatusTime','whatsappStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xa00a,0x160));var _0xaa00=function(_0x42ee99,_0x56fdaf){_0x42ee99=_0x42ee99-0x0;var _0x42c021=_0xa00a[_0x42ee99];return _0x42c021;};'use strict';var _=require(_0xaa00('0x0'));var moment=require(_0xaa00('0x1'));var md5=require(_0xaa00('0x2'));var Redis=require('ioredis');var config=require(_0xaa00('0x3'));config[_0xaa00('0x4')]=_['defaults'](config[_0xaa00('0x4')],{'host':_0xaa00('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa00('0x4')]));function Agent(_0x3e9326){this['id']=_0x3e9326['id']||0x0;this[_0xaa00('0x6')]=_0x3e9326[_0xaa00('0x6')]||'';this[_0xaa00('0x7')]=_0x3e9326[_0xaa00('0x7')]||!![];this['voicePause']=_0x3e9326[_0xaa00('0x8')]||![];this[_0xaa00('0x9')]=_0x3e9326[_0xaa00('0x9')]||![];this['mailPause']=_0x3e9326[_0xaa00('0xa')]||![];this[_0xaa00('0xb')]=_0x3e9326[_0xaa00('0xb')]||![];this[_0xaa00('0xc')]=_0x3e9326[_0xaa00('0xc')]||![];this[_0xaa00('0xd')]=_0x3e9326[_0xaa00('0xd')]||![];this[_0xaa00('0xe')]=_0xaa00('0xf');this[_0xaa00('0x10')]=0x0;this[_0xaa00('0x11')]=_0x3e9326['chatCapacity']||0x0;this[_0xaa00('0x12')]=0x0;this[_0xaa00('0x13')]=_0xaa00('0xf');this[_0xaa00('0x14')]=0x0;this['mailCapacity']=_0x3e9326['mailCapacity']||0x0;this[_0xaa00('0x15')]=0x0;this[_0xaa00('0x16')]=_0xaa00('0xf');this[_0xaa00('0x17')]=0x0;this[_0xaa00('0x18')]=_0x3e9326[_0xaa00('0x18')]||0x0;this[_0xaa00('0x19')]=0x0;this[_0xaa00('0x1a')]=_0xaa00('0xf');this['smsStatusTime']=0x0;this[_0xaa00('0x1b')]=_0x3e9326['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0xaa00('0x1c')]=0x0;this[_0xaa00('0x1d')]=_0x3e9326[_0xaa00('0x1d')]||0x0;this[_0xaa00('0x1e')]=0x0;this[_0xaa00('0x1f')]=_0xaa00('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x3e9326['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xaa00('0x20')]=![];this['busyQueue']=undefined;this[_0xaa00('0x2')]='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this[_0xaa00('0x21')]={};this[_0xaa00('0x22')]={};this[_0xaa00('0x23')]={};this['whatsappWaitingInteractions']={};this[_0xaa00('0x24')]();}Agent[_0xaa00('0x25')]['getChannelStatus']=function(_0x3777a2){if(this[_0x3777a2+'CurrentCapacity']>0x0){if(this[_0x3777a2+_0xaa00('0x26')]>0x0&&this[_0x3777a2+'CurrentCapacity']>=this[_0x3777a2+'Capacity']){return'maxcapacity';}else{return'working';}}else{return _0xaa00('0x27');}};Agent[_0xaa00('0x25')][_0xaa00('0x24')]=function(){var _0x377642=[_0xaa00('0x28'),'chat',_0xaa00('0x29'),_0xaa00('0x2a'),_0xaa00('0x2b'),_0xaa00('0x2c')];for(var _0x53b719=0x0;_0x53b719<_0x377642[_0xaa00('0x2d')];_0x53b719+=0x1){var _0x1738b5=this[_0xaa00('0x2e')](_0x377642[_0x53b719]);if(this[_0x377642[_0x53b719]+_0xaa00('0x2f')]!==_0x1738b5){this[_0x377642[_0x53b719]+_0xaa00('0x30')]=_['toNumber'](moment()[_0xaa00('0x31')]('x'));}this[_0x377642[_0x53b719]+_0xaa00('0x2f')]=_0x1738b5;}var _0x2191a0={'id':this['id'],'name':this[_0xaa00('0x6')],'online':this[_0xaa00('0x7')],'voicePause':this[_0xaa00('0x8')],'chatPause':this[_0xaa00('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xaa00('0xc')],'faxPause':this[_0xaa00('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xaa00('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xaa00('0x14')],'mailCapacity':this[_0xaa00('0x32')],'mailCurrentCapacity':this[_0xaa00('0x15')],'faxStatus':this[_0xaa00('0x16')],'faxStatusTime':this[_0xaa00('0x17')],'faxCapacity':this[_0xaa00('0x18')],'faxCurrentCapacity':this[_0xaa00('0x19')],'smsStatus':this[_0xaa00('0x1a')],'smsStatusTime':this[_0xaa00('0x33')],'smsCapacity':this[_0xaa00('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xaa00('0x34')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xaa00('0x1d')],'whatsappCurrentCapacity':this[_0xaa00('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xaa00('0x35')],'openchannelCapacity':this[_0xaa00('0x36')],'openchannelCurrentCapacity':this[_0xaa00('0x37')],'busy':this[_0xaa00('0x20')],'busyQueue':this[_0xaa00('0x38')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0xaa00('0x39')],'mailWaitingInteractions':this[_0xaa00('0x21')],'openchannelWaitingInteractions':this[_0xaa00('0x22')],'smsWaitingInteractions':this[_0xaa00('0x23')],'whatsappWaitingInteractions':this[_0xaa00('0x3a')]};var _0x4d3198=md5(JSON[_0xaa00('0x3b')](_0x2191a0));if(this['md5']!==_0x4d3198){this['md5']=_0x4d3198;io[_0xaa00('0x3c')](_0xaa00('0x3d'),_0x2191a0);}};module[_0xaa00('0x3e')]=Agent;
\ No newline at end of file
index 130d402..1c4890d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd536=['format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online','chatPause','paused','available'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xd536,0x11c));var _0x6d53=function(_0x52c6f3,_0x513814){_0x52c6f3=_0x52c6f3-0x0;var _0x6d8938=_0xd536[_0x52c6f3];return _0x6d8938;};'use strict';var _=require(_0x6d53('0x0'));var md5=require(_0x6d53('0x1'));var util=require(_0x6d53('0x2'));var Redis=require(_0x6d53('0x3'));var config=require(_0x6d53('0x4'));config[_0x6d53('0x5')]=_[_0x6d53('0x6')](config[_0x6d53('0x5')],{'host':_0x6d53('0x7'),'port':0x18eb});var io=require(_0x6d53('0x8'))(new Redis(config[_0x6d53('0x5')]));function ChatQueue(_0x57e692){this['id']=_0x57e692['id']||0x0;this[_0x6d53('0x9')]=_0x57e692[_0x6d53('0x9')]||'';this[_0x6d53('0xa')]=_0x57e692['timeout']||0xa;this[_0x6d53('0xb')]=_0x57e692[_0x6d53('0xb')]||_0x6d53('0xc');this[_0x6d53('0xd')]=_0x57e692[_0x6d53('0xd')];this[_0x6d53('0xe')]={};this[_0x6d53('0xf')]=0x0;this[_0x6d53('0x1')]='';this[_0x6d53('0x10')]();this[_0x6d53('0x11')]();}ChatQueue[_0x6d53('0x12')][_0x6d53('0x10')]=function(){var _0x1dd116=this['mapAgentsId']['_rr'];this[_0x6d53('0xe')]=_[_0x6d53('0x13')](this[_0x6d53('0xd')],'id');this[_0x6d53('0xe')][_0x6d53('0x14')]=_0x1dd116;};ChatQueue[_0x6d53('0x12')][_0x6d53('0x11')]=function(){this[_0x6d53('0x15')]=0x0;this['paused']=0x0;for(var _0x277167=0x0;_0x277167<this[_0x6d53('0xd')]['length'];_0x277167+=0x1){if(this[_0x6d53('0xd')][_0x277167][_0x6d53('0x16')]){this[_0x6d53('0x15')]+=0x1;}if(this[_0x6d53('0xd')][_0x277167][_0x6d53('0x17')]){this[_0x6d53('0x18')]+=0x1;}}this['available']=this[_0x6d53('0x15')]-this[_0x6d53('0x18')];this[_0x6d53('0x19')]=this[_0x6d53('0x19')]>=0x0?this['available']:0x0;var _0x4bf4be={'id':this['id'],'available':this[_0x6d53('0x19')],'loggedIn':this[_0x6d53('0x15')],'name':this['name'],'paused':this[_0x6d53('0x18')],'waiting':this[_0x6d53('0xf')]};var _0x4b5445=md5(JSON['stringify'](_0x4bf4be));if(this[_0x6d53('0x1')]!==_0x4b5445){this[_0x6d53('0x1')]=_0x4b5445;io['to'](util[_0x6d53('0x1a')](_0x6d53('0x1b'),_0x4bf4be['name']))[_0x6d53('0x1c')](_0x6d53('0x1d'),_0x4bf4be);}};module[_0x6d53('0x1e')]=ChatQueue;
\ No newline at end of file
+var _0x28c5=['redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','md5','util','ioredis','../../../config/environment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x28c5,0x140));var _0x528c=function(_0x26d125,_0x54685c){_0x26d125=_0x26d125-0x0;var _0x1a3c90=_0x28c5[_0x26d125];return _0x1a3c90;};'use strict';var _=require('lodash');var md5=require(_0x528c('0x0'));var util=require(_0x528c('0x1'));var Redis=require(_0x528c('0x2'));var config=require(_0x528c('0x3'));config[_0x528c('0x4')]=_[_0x528c('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x528c('0x6'))(new Redis(config[_0x528c('0x4')]));function ChatQueue(_0x295608){this['id']=_0x295608['id']||0x0;this['name']=_0x295608[_0x528c('0x7')]||'';this[_0x528c('0x8')]=_0x295608[_0x528c('0x8')]||0xa;this['strategy']=_0x295608[_0x528c('0x9')]||'beepall';this[_0x528c('0xa')]=_0x295608[_0x528c('0xa')];this[_0x528c('0xb')]={};this[_0x528c('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x528c('0xd')]();}ChatQueue[_0x528c('0xe')][_0x528c('0xf')]=function(){var _0x135214=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x528c('0x10')](this['Agents'],'id');this['mapAgentsId'][_0x528c('0x11')]=_0x135214;};ChatQueue[_0x528c('0xe')][_0x528c('0xd')]=function(){this[_0x528c('0x12')]=0x0;this['paused']=0x0;for(var _0x5a63c4=0x0;_0x5a63c4<this[_0x528c('0xa')]['length'];_0x5a63c4+=0x1){if(this[_0x528c('0xa')][_0x5a63c4][_0x528c('0x13')]){this[_0x528c('0x12')]+=0x1;}if(this[_0x528c('0xa')][_0x5a63c4][_0x528c('0x14')]){this[_0x528c('0x15')]+=0x1;}}this[_0x528c('0x16')]=this['loggedIn']-this['paused'];this[_0x528c('0x16')]=this[_0x528c('0x16')]>=0x0?this[_0x528c('0x16')]:0x0;var _0x37751d={'id':this['id'],'available':this[_0x528c('0x16')],'loggedIn':this[_0x528c('0x12')],'name':this[_0x528c('0x7')],'paused':this[_0x528c('0x15')],'waiting':this[_0x528c('0xc')]};var _0x52c171=md5(JSON[_0x528c('0x17')](_0x37751d));if(this['md5']!==_0x52c171){this['md5']=_0x52c171;io['to'](util[_0x528c('0x18')](_0x528c('0x19'),_0x37751d[_0x528c('0x7')]))[_0x528c('0x1a')]('chat_queue:save',_0x37751d);}};module['exports']=ChatQueue;
\ No newline at end of file
index b0e9f43..f731042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2552=['online','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','prototype','loggedIn','length'];(function(_0x21d532,_0x4552a4){var _0x37bda1=function(_0x134a6f){while(--_0x134a6f){_0x21d532['push'](_0x21d532['shift']());}};_0x37bda1(++_0x4552a4);}(_0x2552,0x155));var _0x2255=function(_0x41d9fe,_0xb93714){_0x41d9fe=_0x41d9fe-0x0;var _0x52f397=_0x2552[_0x41d9fe];return _0x52f397;};'use strict';var _=require(_0x2255('0x0'));var md5=require('md5');var util=require(_0x2255('0x1'));var Redis=require(_0x2255('0x2'));var config=require(_0x2255('0x3'));config[_0x2255('0x4')]=_[_0x2255('0x5')](config['redis'],{'host':_0x2255('0x6'),'port':0x18eb});var io=require(_0x2255('0x7'))(new Redis(config[_0x2255('0x4')]));function FaxQueue(_0x127a0a){this['id']=_0x127a0a['id']||0x0;this[_0x2255('0x8')]=_0x127a0a[_0x2255('0x8')]||'';this['timeout']=_0x127a0a['timeout']||0xa;this[_0x2255('0x9')]=_0x127a0a[_0x2255('0x9')]||'beepall';this['Agents']=_0x127a0a[_0x2255('0xa')];this[_0x2255('0xb')]={};this['waiting']=0x0;this[_0x2255('0xc')]='';this[_0x2255('0xd')]();this[_0x2255('0xe')]();}FaxQueue['prototype'][_0x2255('0xd')]=function(){var _0x4acee6=this[_0x2255('0xb')][_0x2255('0xf')];this[_0x2255('0xb')]=_['map'](this[_0x2255('0xa')],'id');this['mapAgentsId']['_rr']=_0x4acee6;};FaxQueue[_0x2255('0x10')][_0x2255('0xe')]=function(){this[_0x2255('0x11')]=0x0;this['paused']=0x0;for(var _0x32fc89=0x0;_0x32fc89<this[_0x2255('0xa')][_0x2255('0x12')];_0x32fc89+=0x1){if(this[_0x2255('0xa')][_0x32fc89][_0x2255('0x13')]){this[_0x2255('0x11')]+=0x1;}if(this[_0x2255('0xa')][_0x32fc89][_0x2255('0x14')]){this[_0x2255('0x15')]+=0x1;}}this[_0x2255('0x16')]=this[_0x2255('0x11')]-this[_0x2255('0x15')];this[_0x2255('0x16')]=this['available']>=0x0?this[_0x2255('0x16')]:0x0;var _0x5b6f55={'id':this['id'],'available':this[_0x2255('0x16')],'loggedIn':this[_0x2255('0x11')],'name':this[_0x2255('0x8')],'paused':this['paused'],'waiting':this[_0x2255('0x17')]};var _0x1e6239=md5(JSON[_0x2255('0x18')](_0x5b6f55));if(this[_0x2255('0xc')]!==_0x1e6239){this[_0x2255('0xc')]=_0x1e6239;io['to'](util[_0x2255('0x19')](_0x2255('0x1a'),_0x5b6f55['name']))[_0x2255('0x1b')](_0x2255('0x1c'),_0x5b6f55);}};module[_0x2255('0x1d')]=FaxQueue;
\ No newline at end of file
+var _0xfffc=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x8aed13,_0x1246c7){var _0xb2ea03=function(_0x4bf65e){while(--_0x4bf65e){_0x8aed13['push'](_0x8aed13['shift']());}};_0xb2ea03(++_0x1246c7);}(_0xfffc,0x156));var _0xcfff=function(_0x1a0a05,_0x1c5480){_0x1a0a05=_0x1a0a05-0x0;var _0x474423=_0xfffc[_0x1a0a05];return _0x474423;};'use strict';var _=require(_0xcfff('0x0'));var md5=require(_0xcfff('0x1'));var util=require(_0xcfff('0x2'));var Redis=require(_0xcfff('0x3'));var config=require(_0xcfff('0x4'));config[_0xcfff('0x5')]=_['defaults'](config[_0xcfff('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x405d47){this['id']=_0x405d47['id']||0x0;this[_0xcfff('0x6')]=_0x405d47[_0xcfff('0x6')]||'';this[_0xcfff('0x7')]=_0x405d47[_0xcfff('0x7')]||0xa;this[_0xcfff('0x8')]=_0x405d47[_0xcfff('0x8')]||_0xcfff('0x9');this[_0xcfff('0xa')]=_0x405d47[_0xcfff('0xa')];this['mapAgentsId']={};this[_0xcfff('0xb')]=0x0;this[_0xcfff('0x1')]='';this[_0xcfff('0xc')]();this[_0xcfff('0xd')]();}FaxQueue[_0xcfff('0xe')][_0xcfff('0xc')]=function(){var _0x4682ab=this[_0xcfff('0xf')][_0xcfff('0x10')];this[_0xcfff('0xf')]=_[_0xcfff('0x11')](this[_0xcfff('0xa')],'id');this[_0xcfff('0xf')]['_rr']=_0x4682ab;};FaxQueue[_0xcfff('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xcfff('0x12')]=0x0;for(var _0x46970c=0x0;_0x46970c<this[_0xcfff('0xa')][_0xcfff('0x13')];_0x46970c+=0x1){if(this[_0xcfff('0xa')][_0x46970c][_0xcfff('0x14')]){this[_0xcfff('0x15')]+=0x1;}if(this[_0xcfff('0xa')][_0x46970c]['faxPause']){this[_0xcfff('0x12')]+=0x1;}}this[_0xcfff('0x16')]=this['loggedIn']-this[_0xcfff('0x12')];this['available']=this[_0xcfff('0x16')]>=0x0?this[_0xcfff('0x16')]:0x0;var _0x4b15e5={'id':this['id'],'available':this[_0xcfff('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xcfff('0x6')],'paused':this[_0xcfff('0x12')],'waiting':this[_0xcfff('0xb')]};var _0x59cfea=md5(JSON[_0xcfff('0x17')](_0x4b15e5));if(this['md5']!==_0x59cfea){this[_0xcfff('0x1')]=_0x59cfea;io['to'](util[_0xcfff('0x18')](_0xcfff('0x19'),_0x4b15e5[_0xcfff('0x6')]))[_0xcfff('0x1a')](_0xcfff('0x1b'),_0x4b15e5);}};module[_0xcfff('0x1c')]=FaxQueue;
\ No newline at end of file
index c74a2a0..6c374ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0903=['Intervals'];(function(_0x346062,_0xca65f9){var _0x5e5d22=function(_0x4ba24e){while(--_0x4ba24e){_0x346062['push'](_0x346062['shift']());}};_0x5e5d22(++_0xca65f9);}(_0x0903,0x138));var _0x3090=function(_0x497d39,_0x2fef30){_0x497d39=_0x497d39-0x0;var _0x4a9d8f=_0x0903[_0x497d39];return _0x4a9d8f;};'use strict';function Interval(_0x4279d6){this['id']=_0x4279d6['id']||0x0;this['name']=_0x4279d6['name']||'';this['Intervals']=_0x4279d6[_0x3090('0x0')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x5ba7=['name','Intervals','exports'];(function(_0x1df3db,_0x406dd6){var _0x3bb8a4=function(_0x317039){while(--_0x317039){_0x1df3db['push'](_0x1df3db['shift']());}};_0x3bb8a4(++_0x406dd6);}(_0x5ba7,0x99));var _0x75ba=function(_0x345b63,_0x2cf91b){_0x345b63=_0x345b63-0x0;var _0x40a5be=_0x5ba7[_0x345b63];return _0x40a5be;};'use strict';function Interval(_0x4f0d01){this['id']=_0x4f0d01['id']||0x0;this['name']=_0x4f0d01[_0x75ba('0x0')]||'';this['Intervals']=_0x4f0d01[_0x75ba('0x1')]||{};}module[_0x75ba('0x2')]=Interval;
\ No newline at end of file
index 4bf1b16..0968a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ea4=['available','paused','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','mailPause'];(function(_0x3926cb,_0x418591){var _0x567d6e=function(_0xfaa287){while(--_0xfaa287){_0x3926cb['push'](_0x3926cb['shift']());}};_0x567d6e(++_0x418591);}(_0x9ea4,0x10c));var _0x49ea=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9ea4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x49ea('0x0'));var md5=require(_0x49ea('0x1'));var util=require(_0x49ea('0x2'));var Redis=require('ioredis');var config=require(_0x49ea('0x3'));config['redis']=_[_0x49ea('0x4')](config['redis'],{'host':_0x49ea('0x5'),'port':0x18eb});var io=require(_0x49ea('0x6'))(new Redis(config['redis']));function MailQueue(_0x55e6b7){this['id']=_0x55e6b7['id']||0x0;this[_0x49ea('0x7')]=_0x55e6b7[_0x49ea('0x7')]||'';this[_0x49ea('0x8')]=_0x55e6b7[_0x49ea('0x8')]||0xa;this[_0x49ea('0x9')]=_0x55e6b7[_0x49ea('0x9')]||_0x49ea('0xa');this[_0x49ea('0xb')]=_0x55e6b7[_0x49ea('0xb')];this[_0x49ea('0xc')]={};this[_0x49ea('0xd')]=0x0;this['md5']='';this[_0x49ea('0xe')]();this[_0x49ea('0xf')]();}MailQueue[_0x49ea('0x10')][_0x49ea('0xe')]=function(){var _0x4373ad=this[_0x49ea('0xc')][_0x49ea('0x11')];this[_0x49ea('0xc')]=_[_0x49ea('0x12')](this['Agents'],'id');this[_0x49ea('0xc')][_0x49ea('0x11')]=_0x4373ad;};MailQueue[_0x49ea('0x10')][_0x49ea('0xf')]=function(){this[_0x49ea('0x13')]=0x0;this['paused']=0x0;for(var _0x199539=0x0;_0x199539<this[_0x49ea('0xb')]['length'];_0x199539+=0x1){if(this[_0x49ea('0xb')][_0x199539][_0x49ea('0x14')]){this[_0x49ea('0x13')]+=0x1;}if(this[_0x49ea('0xb')][_0x199539][_0x49ea('0x15')]){this['paused']+=0x1;}}this[_0x49ea('0x16')]=this[_0x49ea('0x13')]-this[_0x49ea('0x17')];this[_0x49ea('0x16')]=this['available']>=0x0?this[_0x49ea('0x16')]:0x0;var _0x2843ac={'id':this['id'],'available':this['available'],'loggedIn':this[_0x49ea('0x13')],'name':this[_0x49ea('0x7')],'paused':this[_0x49ea('0x17')],'waiting':this[_0x49ea('0xd')]};var _0x1c074d=md5(JSON[_0x49ea('0x18')](_0x2843ac));if(this[_0x49ea('0x1')]!==_0x1c074d){this['md5']=_0x1c074d;io['to'](util['format'](_0x49ea('0x19'),_0x2843ac[_0x49ea('0x7')]))[_0x49ea('0x1a')](_0x49ea('0x1b'),_0x2843ac);}};module[_0x49ea('0x1c')]=MailQueue;
\ No newline at end of file
+var _0xe66f=['_rr','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map'];(function(_0x50c9ea,_0x3e04c3){var _0x24d3d2=function(_0x13c1a4){while(--_0x13c1a4){_0x50c9ea['push'](_0x50c9ea['shift']());}};_0x24d3d2(++_0x3e04c3);}(_0xe66f,0xec));var _0xfe66=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe66f[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xfe66('0x0'));var md5=require(_0xfe66('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xfe66('0x2')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfe66('0x3'))(new Redis(config[_0xfe66('0x2')]));function MailQueue(_0x313976){this['id']=_0x313976['id']||0x0;this[_0xfe66('0x4')]=_0x313976['name']||'';this['timeout']=_0x313976[_0xfe66('0x5')]||0xa;this['strategy']=_0x313976[_0xfe66('0x6')]||'beepall';this['Agents']=_0x313976[_0xfe66('0x7')];this[_0xfe66('0x8')]={};this[_0xfe66('0x9')]=0x0;this['md5']='';this[_0xfe66('0xa')]();this[_0xfe66('0xb')]();}MailQueue[_0xfe66('0xc')]['updateRouting']=function(){var _0xe66a19=this['mapAgentsId']['_rr'];this[_0xfe66('0x8')]=_[_0xfe66('0xd')](this[_0xfe66('0x7')],'id');this[_0xfe66('0x8')][_0xfe66('0xe')]=_0xe66a19;};MailQueue[_0xfe66('0xc')]['updateRealtime']=function(){this[_0xfe66('0xf')]=0x0;this[_0xfe66('0x10')]=0x0;for(var _0x4c634d=0x0;_0x4c634d<this[_0xfe66('0x7')][_0xfe66('0x11')];_0x4c634d+=0x1){if(this['Agents'][_0x4c634d][_0xfe66('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4c634d]['mailPause']){this[_0xfe66('0x10')]+=0x1;}}this[_0xfe66('0x13')]=this[_0xfe66('0xf')]-this[_0xfe66('0x10')];this[_0xfe66('0x13')]=this['available']>=0x0?this[_0xfe66('0x13')]:0x0;var _0x311188={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xfe66('0x10')],'waiting':this['waiting']};var _0x75121d=md5(JSON[_0xfe66('0x14')](_0x311188));if(this[_0xfe66('0x1')]!==_0x75121d){this[_0xfe66('0x1')]=_0x75121d;io['to'](util[_0xfe66('0x15')](_0xfe66('0x16'),_0x311188[_0xfe66('0x4')]))[_0xfe66('0x17')](_0xfe66('0x18'),_0x311188);}};module['exports']=MailQueue;
\ No newline at end of file
index 063a2c0..95df1a7 100644 (file)
@@ -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(_0x62ff29,_0x5b5d4c){var _0x63583b=function(_0x3de158){while(--_0x3de158){_0x62ff29['push'](_0x62ff29['shift']());}};_0x63583b(++_0x5b5d4c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x5fc3[_0x55cc58];return _0x26062e;};'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<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=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(_0x4735a3,_0x3e758e){var _0x175904=function(_0x3eb451){while(--_0x3eb451){_0x4735a3['push'](_0x4735a3['shift']());}};_0x175904(++_0x3e758e);}(_0x814b,0x1a2));var _0xb814=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0x814b[_0x58ceb9];return _0x3d0ff5;};'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<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=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
index b714b59..4cc3f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe205=['_rr','map','prototype','loggedIn','length','online','paused','available','stringify','format','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId'];(function(_0x4b17d8,_0x5d4f95){var _0x1ebd84=function(_0x31be58){while(--_0x31be58){_0x4b17d8['push'](_0x4b17d8['shift']());}};_0x1ebd84(++_0x5d4f95);}(_0xe205,0xa7));var _0x5e20=function(_0x2a9e5f,_0xd00872){_0x2a9e5f=_0x2a9e5f-0x0;var _0x3f33aa=_0xe205[_0x2a9e5f];return _0x3f33aa;};'use strict';var _=require(_0x5e20('0x0'));var md5=require(_0x5e20('0x1'));var util=require(_0x5e20('0x2'));var Redis=require(_0x5e20('0x3'));var config=require(_0x5e20('0x4'));config[_0x5e20('0x5')]=_[_0x5e20('0x6')](config[_0x5e20('0x5')],{'host':_0x5e20('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e20('0x5')]));function SmsQueue(_0x1b26a2){this['id']=_0x1b26a2['id']||0x0;this[_0x5e20('0x8')]=_0x1b26a2[_0x5e20('0x8')]||'';this['timeout']=_0x1b26a2['timeout']||0xa;this[_0x5e20('0x9')]=_0x1b26a2['strategy']||'beepall';this[_0x5e20('0xa')]=_0x1b26a2[_0x5e20('0xa')];this['mapAgentsId']={};this[_0x5e20('0xb')]=0x0;this[_0x5e20('0x1')]='';this[_0x5e20('0xc')]();this[_0x5e20('0xd')]();}SmsQueue['prototype'][_0x5e20('0xc')]=function(){var _0xda6476=this[_0x5e20('0xe')][_0x5e20('0xf')];this[_0x5e20('0xe')]=_[_0x5e20('0x10')](this['Agents'],'id');this[_0x5e20('0xe')][_0x5e20('0xf')]=_0xda6476;};SmsQueue[_0x5e20('0x11')]['updateRealtime']=function(){this[_0x5e20('0x12')]=0x0;this['paused']=0x0;for(var _0x1f47f3=0x0;_0x1f47f3<this['Agents'][_0x5e20('0x13')];_0x1f47f3+=0x1){if(this[_0x5e20('0xa')][_0x1f47f3][_0x5e20('0x14')]){this[_0x5e20('0x12')]+=0x1;}if(this[_0x5e20('0xa')][_0x1f47f3]['smsPause']){this[_0x5e20('0x15')]+=0x1;}}this[_0x5e20('0x16')]=this[_0x5e20('0x12')]-this[_0x5e20('0x15')];this[_0x5e20('0x16')]=this[_0x5e20('0x16')]>=0x0?this[_0x5e20('0x16')]:0x0;var _0xf3488f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5e20('0x12')],'name':this[_0x5e20('0x8')],'paused':this['paused'],'waiting':this[_0x5e20('0xb')]};var _0x1b1457=md5(JSON[_0x5e20('0x17')](_0xf3488f));if(this[_0x5e20('0x1')]!==_0x1b1457){this['md5']=_0x1b1457;io['to'](util[_0x5e20('0x18')]('sms:queue:%s',_0xf3488f['name']))['emit']('sms_queue:save',_0xf3488f);}};module[_0x5e20('0x19')]=SmsQueue;
\ No newline at end of file
+var _0x689c=['defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','available','paused','stringify','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x689c,0x9e));var _0xc689=function(_0x5253b5,_0x368f9b){_0x5253b5=_0x5253b5-0x0;var _0x2cd27d=_0x689c[_0x5253b5];return _0x2cd27d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xc689('0x0'));var Redis=require(_0xc689('0x1'));var config=require(_0xc689('0x2'));config[_0xc689('0x3')]=_[_0xc689('0x4')](config[_0xc689('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xc689('0x5'))(new Redis(config['redis']));function SmsQueue(_0x47aaf0){this['id']=_0x47aaf0['id']||0x0;this[_0xc689('0x6')]=_0x47aaf0[_0xc689('0x6')]||'';this[_0xc689('0x7')]=_0x47aaf0[_0xc689('0x7')]||0xa;this[_0xc689('0x8')]=_0x47aaf0['strategy']||_0xc689('0x9');this[_0xc689('0xa')]=_0x47aaf0[_0xc689('0xa')];this['mapAgentsId']={};this[_0xc689('0xb')]=0x0;this[_0xc689('0xc')]='';this[_0xc689('0xd')]();this[_0xc689('0xe')]();}SmsQueue[_0xc689('0xf')][_0xc689('0xd')]=function(){var _0x367b1d=this[_0xc689('0x10')][_0xc689('0x11')];this[_0xc689('0x10')]=_[_0xc689('0x12')](this['Agents'],'id');this[_0xc689('0x10')]['_rr']=_0x367b1d;};SmsQueue[_0xc689('0xf')][_0xc689('0xe')]=function(){this[_0xc689('0x13')]=0x0;this['paused']=0x0;for(var _0xc3b854=0x0;_0xc3b854<this[_0xc689('0xa')]['length'];_0xc3b854+=0x1){if(this[_0xc689('0xa')][_0xc3b854][_0xc689('0x14')]){this[_0xc689('0x13')]+=0x1;}if(this[_0xc689('0xa')][_0xc3b854]['smsPause']){this['paused']+=0x1;}}this[_0xc689('0x15')]=this[_0xc689('0x13')]-this[_0xc689('0x16')];this['available']=this['available']>=0x0?this[_0xc689('0x15')]:0x0;var _0x1edaef={'id':this['id'],'available':this[_0xc689('0x15')],'loggedIn':this[_0xc689('0x13')],'name':this[_0xc689('0x6')],'paused':this[_0xc689('0x16')],'waiting':this['waiting']};var _0x45e4c3=md5(JSON[_0xc689('0x17')](_0x1edaef));if(this['md5']!==_0x45e4c3){this['md5']=_0x45e4c3;io['to'](util['format']('sms:queue:%s',_0x1edaef['name']))[_0xc689('0x18')](_0xc689('0x19'),_0x1edaef);}};module[_0xc689('0x1a')]=SmsQueue;
\ No newline at end of file
index aabaff9..86c73d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4449=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','paused','available','waiting','stringify','format','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4449,0xd0));var _0x9444=function(_0x1c3573,_0x1a521b){_0x1c3573=_0x1c3573-0x0;var _0x42bafd=_0x4449[_0x1c3573];return _0x42bafd;};'use strict';var _=require(_0x9444('0x0'));var md5=require(_0x9444('0x1'));var util=require(_0x9444('0x2'));var Redis=require(_0x9444('0x3'));var config=require(_0x9444('0x4'));config[_0x9444('0x5')]=_['defaults'](config['redis'],{'host':_0x9444('0x6'),'port':0x18eb});var io=require(_0x9444('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x3935f6){this['id']=_0x3935f6['id']||0x0;this[_0x9444('0x8')]=_0x3935f6['name']||'';this[_0x9444('0x9')]=_0x3935f6[_0x9444('0x9')]||0xa;this[_0x9444('0xa')]=_0x3935f6['strategy']||_0x9444('0xb');this[_0x9444('0xc')]=_0x3935f6[_0x9444('0xc')];this[_0x9444('0xd')]={};this['waiting']=0x0;this[_0x9444('0x1')]='';this[_0x9444('0xe')]();this[_0x9444('0xf')]();}WhatsappQueue['prototype'][_0x9444('0xe')]=function(){var _0xbea2f8=this[_0x9444('0xd')][_0x9444('0x10')];this[_0x9444('0xd')]=_[_0x9444('0x11')](this[_0x9444('0xc')],'id');this[_0x9444('0xd')][_0x9444('0x10')]=_0xbea2f8;};WhatsappQueue[_0x9444('0x12')]['updateRealtime']=function(){this[_0x9444('0x13')]=0x0;this['paused']=0x0;for(var _0x21d4a2=0x0;_0x21d4a2<this['Agents'][_0x9444('0x14')];_0x21d4a2+=0x1){if(this[_0x9444('0xc')][_0x21d4a2][_0x9444('0x15')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x21d4a2]['whatsappPause']){this[_0x9444('0x16')]+=0x1;}}this[_0x9444('0x17')]=this[_0x9444('0x13')]-this[_0x9444('0x16')];this[_0x9444('0x17')]=this[_0x9444('0x17')]>=0x0?this[_0x9444('0x17')]:0x0;var _0x2d9bde={'id':this['id'],'available':this[_0x9444('0x17')],'loggedIn':this[_0x9444('0x13')],'name':this[_0x9444('0x8')],'paused':this[_0x9444('0x16')],'waiting':this[_0x9444('0x18')]};var _0x33c1d0=md5(JSON[_0x9444('0x19')](_0x2d9bde));if(this[_0x9444('0x1')]!==_0x33c1d0){this[_0x9444('0x1')]=_0x33c1d0;io['to'](util[_0x9444('0x1a')]('whatsapp:queue:%s',_0x2d9bde[_0x9444('0x8')]))['emit']('whatsapp_queue:save',_0x2d9bde);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0x3760=['available','stringify','whatsapp:queue:%s','emit','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','online','whatsappPause'];(function(_0x44f391,_0x169473){var _0x1c14d1=function(_0x46ede9){while(--_0x46ede9){_0x44f391['push'](_0x44f391['shift']());}};_0x1c14d1(++_0x169473);}(_0x3760,0x75));var _0x0376=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x3760[_0x3cb30b];return _0x2ca717;};'use strict';var _=require(_0x0376('0x0'));var md5=require('md5');var util=require(_0x0376('0x1'));var Redis=require(_0x0376('0x2'));var config=require('../../../config/environment');config[_0x0376('0x3')]=_[_0x0376('0x4')](config[_0x0376('0x3')],{'host':_0x0376('0x5'),'port':0x18eb});var io=require(_0x0376('0x6'))(new Redis(config[_0x0376('0x3')]));function WhatsappQueue(_0x117dc8){this['id']=_0x117dc8['id']||0x0;this[_0x0376('0x7')]=_0x117dc8['name']||'';this[_0x0376('0x8')]=_0x117dc8[_0x0376('0x8')]||0xa;this['strategy']=_0x117dc8['strategy']||_0x0376('0x9');this[_0x0376('0xa')]=_0x117dc8[_0x0376('0xa')];this[_0x0376('0xb')]={};this[_0x0376('0xc')]=0x0;this[_0x0376('0xd')]='';this[_0x0376('0xe')]();this[_0x0376('0xf')]();}WhatsappQueue['prototype'][_0x0376('0xe')]=function(){var _0x3f346f=this[_0x0376('0xb')]['_rr'];this[_0x0376('0xb')]=_['map'](this[_0x0376('0xa')],'id');this[_0x0376('0xb')][_0x0376('0x10')]=_0x3f346f;};WhatsappQueue[_0x0376('0x11')]['updateRealtime']=function(){this[_0x0376('0x12')]=0x0;this[_0x0376('0x13')]=0x0;for(var _0x554c51=0x0;_0x554c51<this[_0x0376('0xa')][_0x0376('0x14')];_0x554c51+=0x1){if(this['Agents'][_0x554c51][_0x0376('0x15')]){this[_0x0376('0x12')]+=0x1;}if(this[_0x0376('0xa')][_0x554c51][_0x0376('0x16')]){this[_0x0376('0x13')]+=0x1;}}this[_0x0376('0x17')]=this[_0x0376('0x12')]-this[_0x0376('0x13')];this['available']=this[_0x0376('0x17')]>=0x0?this[_0x0376('0x17')]:0x0;var _0xab9a6c={'id':this['id'],'available':this[_0x0376('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0376('0x13')],'waiting':this[_0x0376('0xc')]};var _0x454650=md5(JSON[_0x0376('0x18')](_0xab9a6c));if(this[_0x0376('0xd')]!==_0x454650){this['md5']=_0x454650;io['to'](util['format'](_0x0376('0x19'),_0xab9a6c[_0x0376('0x7')]))[_0x0376('0x1a')]('whatsapp_queue:save',_0xab9a6c);}};module[_0x0376('0x1b')]=WhatsappQueue;
\ No newline at end of file
index 9c666d3..dbe5ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x20bc56,_0x6569e9){var _0x431976=function(_0x1af23c){while(--_0x1af23c){_0x20bc56['push'](_0x20bc56['shift']());}};_0x431976(++_0x6569e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b6fd3,_0x4af8d4){_0x5b6fd3=_0x5b6fd3-0x0;var _0x75ef1e=_0xb10b[_0x5b6fd3];return _0x75ef1e;};'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
index 2ae3301..7682134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3087=['../client','UpdateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x581e01,_0x241cbd){var _0x558b54=function(_0x22a370){while(--_0x22a370){_0x581e01['push'](_0x581e01['shift']());}};_0x558b54(++_0x241cbd);}(_0x3087,0x163));var _0x7308=function(_0x5cba30,_0x3cbdc5){_0x5cba30=_0x5cba30-0x0;var _0x37a7aa=_0x3087[_0x5cba30];return _0x37a7aa;};'use strict';var client=require(_0x7308('0x0'));exports['update']=function(_0x1773ee,_0x42df46){return client['Request'](_0x7308('0x1'),{'body':_0x42df46,'options':{'where':{'id':_0x1773ee}},'log':'updateChatInteraction'});};exports[_0x7308('0x2')]=function(_0x138f18,_0x49f433){return client[_0x7308('0x3')]('AddTagsToChatInteraction',{'body':_0x49f433,'options':{'where':{'id':_0x138f18}},'log':_0x7308('0x4')});};
\ No newline at end of file
+var _0x0e2e=['update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x42acfc,_0x349f46){var _0x24b053=function(_0x49409e){while(--_0x49409e){_0x42acfc['push'](_0x42acfc['shift']());}};_0x24b053(++_0x349f46);}(_0x0e2e,0xad));var _0xe0e2=function(_0x4d8c33,_0x55c487){_0x4d8c33=_0x4d8c33-0x0;var _0x2e832e=_0x0e2e[_0x4d8c33];return _0x2e832e;};'use strict';var client=require(_0xe0e2('0x0'));exports[_0xe0e2('0x1')]=function(_0x19d554,_0x10b2b3){return client[_0xe0e2('0x2')]('UpdateChatInteraction',{'body':_0x10b2b3,'options':{'where':{'id':_0x19d554}},'log':'updateChatInteraction'});};exports[_0xe0e2('0x3')]=function(_0xee996f,_0x15fddf){return client[_0xe0e2('0x2')](_0xe0e2('0x4'),{'body':_0x15fddf,'options':{'where':{'id':_0xee996f}},'log':_0xe0e2('0x5')});};
\ No newline at end of file
index bc2f7c4..42939ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2b4=['Request'];(function(_0x332a14,_0x5c1b72){var _0x1e529f=function(_0x4e9408){while(--_0x4e9408){_0x332a14['push'](_0x332a14['shift']());}};_0x1e529f(++_0x5c1b72);}(_0xc2b4,0x166));var _0x4c2b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2b4[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['create']=function(_0x586dcd){return client[_0x4c2b('0x0')]('CreateChatMessage',{'body':_0x586dcd,'log':'createChatMessage'});};
\ No newline at end of file
+var _0x949d=['Request','createChatMessage','../client','create'];(function(_0x594136,_0x21bd68){var _0x1bc34e=function(_0x350577){while(--_0x350577){_0x594136['push'](_0x594136['shift']());}};_0x1bc34e(++_0x21bd68);}(_0x949d,0x116));var _0xd949=function(_0x329b24,_0x38e2d1){_0x329b24=_0x329b24-0x0;var _0x269d24=_0x949d[_0x329b24];return _0x269d24;};'use strict';var client=require(_0xd949('0x0'));exports[_0xd949('0x1')]=function(_0x22e343){return client[_0xd949('0x2')]('CreateChatMessage',{'body':_0x22e343,'log':_0xd949('0x3')});};
\ No newline at end of file
index 860fe25..69eb542 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be3=['name','strategy','Agents','online','Request','GetChatQueue'];(function(_0x5f53cb,_0x278960){var _0x59eba7=function(_0x2d13e9){while(--_0x2d13e9){_0x5f53cb['push'](_0x5f53cb['shift']());}};_0x59eba7(++_0x278960);}(_0x0be3,0x9a));var _0x30be=function(_0x3ab0f7,_0x421925){_0x3ab0f7=_0x3ab0f7-0x0;var _0x55ab91=_0x0be3[_0x3ab0f7];return _0x55ab91;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x30be('0x0')](_0x30be('0x1'),{'options':{'raw':![],'attributes':['id',_0x30be('0x2'),'timeout',_0x30be('0x3')],'include':[{'model':'User','as':_0x30be('0x4'),'attributes':['id',_0x30be('0x2'),_0x30be('0x5'),'chatPause']}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0x6f72=['GetChatQueue','timeout','strategy','Agents','name','chatPause','getChatQueues','Request'];(function(_0x25f206,_0x1121bb){var _0xf96267=function(_0x2de085){while(--_0x2de085){_0x25f206['push'](_0x25f206['shift']());}};_0xf96267(++_0x1121bb);}(_0x6f72,0xae));var _0x26f7=function(_0xffee19,_0x226ee9){_0xffee19=_0xffee19-0x0;var _0x331273=_0x6f72[_0xffee19];return _0x331273;};'use strict';var client=require('../client');exports[_0x26f7('0x0')]=function(){return function(){return client[_0x26f7('0x1')](_0x26f7('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x26f7('0x3'),_0x26f7('0x4')],'include':[{'model':'User','as':_0x26f7('0x5'),'attributes':['id',_0x26f7('0x6'),'online',_0x26f7('0x7')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
index 98d3341..31d6013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa991=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x28dcad,_0x251fc4){var _0x5308ed=function(_0x453f49){while(--_0x453f49){_0x28dcad['push'](_0x28dcad['shift']());}};_0x5308ed(++_0x251fc4);}(_0xa991,0x143));var _0x1a99=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xa991[_0x45d55e];return _0x29812a;};'use strict';var client=require(_0x1a99('0x0'));exports['create']=function(_0x1ed388){return client[_0x1a99('0x1')](_0x1a99('0x2'),{'body':_0x1ed388,'log':_0x1a99('0x2')});};exports[_0x1a99('0x3')]=function(_0x577db5,_0x46c8c4){return client[_0x1a99('0x1')](_0x1a99('0x4'),{'body':_0x46c8c4,'options':{'where':{'uniqueid':_0x577db5},'order':[['id',_0x1a99('0x5')]],'limit':0x1},'log':_0x1a99('0x4')});};
\ No newline at end of file
+var _0x9f75=['UpdateChatQueueReport','../client','Request','update','DESC'];(function(_0x182da6,_0x389200){var _0x564adb=function(_0xad9005){while(--_0xad9005){_0x182da6['push'](_0x182da6['shift']());}};_0x564adb(++_0x389200);}(_0x9f75,0x15a));var _0x59f7=function(_0x1614a3,_0x7dd393){_0x1614a3=_0x1614a3-0x0;var _0x1648b0=_0x9f75[_0x1614a3];return _0x1648b0;};'use strict';var client=require(_0x59f7('0x0'));exports['create']=function(_0x2d26fa){return client[_0x59f7('0x1')]('CreateChatQueueReport',{'body':_0x2d26fa,'log':'CreateChatQueueReport'});};exports[_0x59f7('0x2')]=function(_0x455b84,_0x3b92a2){return client[_0x59f7('0x1')]('UpdateChatQueueReport',{'body':_0x3b92a2,'options':{'where':{'uniqueid':_0x455b84},'order':[['id',_0x59f7('0x3')]],'limit':0x1},'log':_0x59f7('0x4')});};
\ No newline at end of file
index d3cb3db..f79c9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x47f161,_0x6c9112){var _0x290e3a=function(_0x55b84b){while(--_0x55b84b){_0x47f161['push'](_0x47f161['shift']());}};_0x290e3a(++_0x6c9112);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2f7029,_0x44deb0){var _0x18c24c=function(_0x495afd){while(--_0x495afd){_0x2f7029['push'](_0x2f7029['shift']());}};_0x18c24c(++_0x44deb0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 4268764..054b53e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb7=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1cb7,0xa6));var _0x71cb=function(_0x471963,_0x4ac931){_0x471963=_0x471963-0x0;var _0x4d1d1b=_0x1cb7[_0x471963];return _0x4d1d1b;};'use strict';var client=require(_0x71cb('0x0'));exports[_0x71cb('0x1')]=function(_0x398312){return client[_0x71cb('0x2')](_0x71cb('0x3'),{'body':_0x398312,'log':_0x71cb('0x4')});};
\ No newline at end of file
+var _0x5e8b=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1aa24d,_0x2b1f6b){var _0x448614=function(_0x50fdec){while(--_0x50fdec){_0x1aa24d['push'](_0x1aa24d['shift']());}};_0x448614(++_0x2b1f6b);}(_0x5e8b,0xcc));var _0xb5e8=function(_0x5e2dfd,_0x4d4bf7){_0x5e2dfd=_0x5e2dfd-0x0;var _0x1601ce=_0x5e8b[_0x5e2dfd];return _0x1601ce;};'use strict';var client=require(_0xb5e8('0x0'));exports[_0xb5e8('0x1')]=function(_0x2439c7){return client[_0xb5e8('0x2')](_0xb5e8('0x3'),{'body':_0x2439c7,'log':_0xb5e8('0x4')});};
\ No newline at end of file
index 768181f..b16a7a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbad9=['Request','GetFaxQueue','name','Agents','online','../client','getFaxQueues'];(function(_0x401e86,_0x577bcb){var _0x2e52d2=function(_0x3cd81c){while(--_0x3cd81c){_0x401e86['push'](_0x401e86['shift']());}};_0x2e52d2(++_0x577bcb);}(_0xbad9,0x11d));var _0x9bad=function(_0x5acd8a,_0x556a21){_0x5acd8a=_0x5acd8a-0x0;var _0x3fb683=_0xbad9[_0x5acd8a];return _0x3fb683;};'use strict';var client=require(_0x9bad('0x0'));exports[_0x9bad('0x1')]=function(){return function(){return client[_0x9bad('0x2')](_0x9bad('0x3'),{'options':{'raw':![],'attributes':['id',_0x9bad('0x4'),'timeout','strategy'],'include':[{'model':'User','as':_0x9bad('0x5'),'attributes':['id',_0x9bad('0x4'),_0x9bad('0x6'),'faxPause']}]},'log':'getFaxQueues'});};};
\ No newline at end of file
+var _0xc847=['User','name','faxPause','getFaxQueues','Request','GetFaxQueue','timeout','strategy'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xc847,0x1eb));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x7c84('0x0')]=function(){return function(){return client[_0x7c84('0x1')](_0x7c84('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7c84('0x3'),_0x7c84('0x4')],'include':[{'model':_0x7c84('0x5'),'as':'Agents','attributes':['id',_0x7c84('0x6'),'online',_0x7c84('0x7')]}]},'log':_0x7c84('0x0')});};};
\ No newline at end of file
index c5ac7da..2e04ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x900a=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0xa7c19,_0x4e3519){var _0x36eefa=function(_0x49ad72){while(--_0x49ad72){_0xa7c19['push'](_0xa7c19['shift']());}};_0x36eefa(++_0x4e3519);}(_0x900a,0xe7));var _0xa900=function(_0x56b843,_0x1286b3){_0x56b843=_0x56b843-0x0;var _0x2c1f64=_0x900a[_0x56b843];return _0x2c1f64;};'use strict';var client=require(_0xa900('0x0'));exports[_0xa900('0x1')]=function(_0xa13435){return client[_0xa900('0x2')](_0xa900('0x3'),{'body':_0xa13435,'log':_0xa900('0x3')});};exports[_0xa900('0x4')]=function(_0x499ffb,_0x4ef268){return client[_0xa900('0x2')](_0xa900('0x5'),{'body':_0x4ef268,'options':{'where':{'uniqueid':_0x499ffb},'order':[['id',_0xa900('0x6')]],'limit':0x1},'log':_0xa900('0x5')});};
\ No newline at end of file
+var _0xb447=['update','DESC','Request','CreateFaxQueueReport'];(function(_0x38635b,_0x560282){var _0x2ede1c=function(_0xcaa898){while(--_0xcaa898){_0x38635b['push'](_0x38635b['shift']());}};_0x2ede1c(++_0x560282);}(_0xb447,0x16e));var _0x7b44=function(_0xb0114f,_0x18a8f9){_0xb0114f=_0xb0114f-0x0;var _0x41a68b=_0xb447[_0xb0114f];return _0x41a68b;};'use strict';var client=require('../client');exports['create']=function(_0x2b2c13){return client[_0x7b44('0x0')](_0x7b44('0x1'),{'body':_0x2b2c13,'log':_0x7b44('0x1')});};exports[_0x7b44('0x2')]=function(_0x26a800,_0x3a2e7d){return client[_0x7b44('0x0')]('UpdateFaxQueueReport',{'body':_0x3a2e7d,'options':{'where':{'uniqueid':_0x26a800},'order':[['id',_0x7b44('0x3')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 3cfad54..38e36d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eed=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x7eed,0xec));var _0xd7ee=function(_0x164580,_0x3c81f9){_0x164580=_0x164580-0x0;var _0xed7154=_0x7eed[_0x164580];return _0xed7154;};'use strict';var client=require(_0xd7ee('0x0'));exports[_0xd7ee('0x1')]=function(){return function(){return client[_0xd7ee('0x2')](_0xd7ee('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd7ee('0x4')],'include':[{'model':_0xd7ee('0x5'),'as':'Intervals','attributes':['id','name',_0xd7ee('0x6')]}]},'log':_0xd7ee('0x1')});};};
\ No newline at end of file
+var _0x56fb=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x1ebd71,_0x525260){var _0x10dd66=function(_0x3ae8eb){while(--_0x3ae8eb){_0x1ebd71['push'](_0x1ebd71['shift']());}};_0x10dd66(++_0x525260);}(_0x56fb,0x184));var _0xb56f=function(_0x156a77,_0x522c13){_0x156a77=_0x156a77-0x0;var _0x32398a=_0x56fb[_0x156a77];return _0x32398a;};'use strict';var client=require(_0xb56f('0x0'));exports[_0xb56f('0x1')]=function(){return function(){return client[_0xb56f('0x2')](_0xb56f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb56f('0x4')],'include':[{'model':_0xb56f('0x5'),'as':_0xb56f('0x6'),'attributes':['id',_0xb56f('0x4'),_0xb56f('0x7')]}]},'log':_0xb56f('0x1')});};};
\ No newline at end of file
index 978b2cc..92a899b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['UpdateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x17f3d4,_0x2a8ae8){var _0x63c2e6=function(_0x34e102){while(--_0x34e102){_0x17f3d4['push'](_0x17f3d4['shift']());}};_0x63c2e6(++_0x2a8ae8);}(_0xda2d,0x102));var _0xdda2=function(_0x1e8b69,_0x1424dd){_0x1e8b69=_0x1e8b69-0x0;var _0xcacb4f=_0xda2d[_0x1e8b69];return _0xcacb4f;};'use strict';var client=require('../client');exports[_0xdda2('0x0')]=function(_0x35f029,_0xd495d2){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'body':_0xd495d2,'options':{'where':{'id':_0x35f029}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x5a5f9f,_0x357e97){return client[_0xdda2('0x1')](_0xdda2('0x3'),{'body':_0x357e97,'options':{'where':{'id':_0x5a5f9f}},'log':_0xdda2('0x4')});};
\ No newline at end of file
+var _0x627e=['../client','update','Request','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x627e,0x14a));var _0xe627=function(_0x434ffc,_0x509051){_0x434ffc=_0x434ffc-0x0;var _0x5bb0f0=_0x627e[_0x434ffc];return _0x5bb0f0;};'use strict';var client=require(_0xe627('0x0'));exports[_0xe627('0x1')]=function(_0x2cc4b4,_0x18dba3){return client[_0xe627('0x2')]('UpdateMailInteraction',{'body':_0x18dba3,'options':{'where':{'id':_0x2cc4b4}},'log':_0xe627('0x3')});};exports[_0xe627('0x4')]=function(_0x2abdc7,_0x59a2c8){return client['Request']('AddTagsToMailInteraction',{'body':_0x59a2c8,'options':{'where':{'id':_0x2abdc7}},'log':_0xe627('0x5')});};
\ No newline at end of file
index 08b294b..722bb3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2b3=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xc2b3,0xd2));var _0x3c2b=function(_0x13b202,_0x52ebae){_0x13b202=_0x13b202-0x0;var _0x3479cd=_0xc2b3[_0x13b202];return _0x3479cd;};'use strict';var client=require(_0x3c2b('0x0'));exports[_0x3c2b('0x1')]=function(_0x56e59f){return client[_0x3c2b('0x2')](_0x3c2b('0x3'),{'body':_0x56e59f,'log':_0x3c2b('0x4')});};
\ No newline at end of file
+var _0xbce9=['createMailMessage','../client','create'];(function(_0x4da95a,_0xc794c3){var _0x156133=function(_0x2b211d){while(--_0x2b211d){_0x4da95a['push'](_0x4da95a['shift']());}};_0x156133(++_0xc794c3);}(_0xbce9,0xc4));var _0x9bce=function(_0x509b9d,_0x234651){_0x509b9d=_0x509b9d-0x0;var _0x5a755f=_0xbce9[_0x509b9d];return _0x5a755f;};'use strict';var client=require(_0x9bce('0x0'));exports[_0x9bce('0x1')]=function(_0x3e0564){return client['Request']('CreateMailMessage',{'body':_0x3e0564,'log':_0x9bce('0x2')});};
\ No newline at end of file
index 1e738aa..c79bf35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e86=['Request','GetMailQueue','name','strategy','User','mailPause','getMailQueues'];(function(_0x42eab0,_0x2442e0){var _0x4c3f19=function(_0x11f5cc){while(--_0x11f5cc){_0x42eab0['push'](_0x42eab0['shift']());}};_0x4c3f19(++_0x2442e0);}(_0x3e86,0x84));var _0x63e8=function(_0xa577b9,_0x4b2d3c){_0xa577b9=_0xa577b9-0x0;var _0x434448=_0x3e86[_0xa577b9];return _0x434448;};'use strict';var client=require('../client');exports[_0x63e8('0x0')]=function(){return function(){return client[_0x63e8('0x1')](_0x63e8('0x2'),{'options':{'raw':![],'attributes':['id',_0x63e8('0x3'),'timeout',_0x63e8('0x4')],'include':[{'model':_0x63e8('0x5'),'as':'Agents','attributes':['id','name','online',_0x63e8('0x6')]}]},'log':_0x63e8('0x0')});};};
\ No newline at end of file
+var _0xb5dd=['GetMailQueue','name','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request'];(function(_0x542c61,_0x349e1e){var _0x202f15=function(_0x4319bd){while(--_0x4319bd){_0x542c61['push'](_0x542c61['shift']());}};_0x202f15(++_0x349e1e);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb5dd[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0xdb5d('0x0'));exports[_0xdb5d('0x1')]=function(){return function(){return client[_0xdb5d('0x2')](_0xdb5d('0x3'),{'options':{'raw':![],'attributes':['id',_0xdb5d('0x4'),'timeout',_0xdb5d('0x5')],'include':[{'model':_0xdb5d('0x6'),'as':_0xdb5d('0x7'),'attributes':['id','name',_0xdb5d('0x8'),_0xdb5d('0x9')]}]},'log':_0xdb5d('0x1')});};};
\ No newline at end of file
index 5f7963c..3746b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d9=['create','CreateMailQueueReport','update','DESC'];(function(_0x2169ad,_0x2d91b4){var _0x24fa90=function(_0x44b78e){while(--_0x44b78e){_0x2169ad['push'](_0x2169ad['shift']());}};_0x24fa90(++_0x2d91b4);}(_0x49d9,0xb4));var _0x949d=function(_0x1f8276,_0x496b5a){_0x1f8276=_0x1f8276-0x0;var _0x45636b=_0x49d9[_0x1f8276];return _0x45636b;};'use strict';var client=require('../client');exports[_0x949d('0x0')]=function(_0x2526be){return client['Request'](_0x949d('0x1'),{'body':_0x2526be,'log':_0x949d('0x1')});};exports[_0x949d('0x2')]=function(_0x4404b0,_0x5bbcac){return client['Request']('UpdateMailQueueReport',{'body':_0x5bbcac,'options':{'where':{'uniqueid':_0x4404b0},'order':[['id',_0x949d('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x4b69=['CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4b69,0x69));var _0x94b6=function(_0x36c678,_0x56135e){_0x36c678=_0x36c678-0x0;var _0x292540=_0x4b69[_0x36c678];return _0x292540;};'use strict';var client=require(_0x94b6('0x0'));exports[_0x94b6('0x1')]=function(_0x15b5ed){return client[_0x94b6('0x2')]('CreateMailQueueReport',{'body':_0x15b5ed,'log':_0x94b6('0x3')});};exports['update']=function(_0x1fb447,_0x19ad07){return client[_0x94b6('0x2')](_0x94b6('0x4'),{'body':_0x19ad07,'options':{'where':{'uniqueid':_0x1fb447},'order':[['id',_0x94b6('0x5')]],'limit':0x1},'log':_0x94b6('0x4')});};
\ No newline at end of file
index 0ad57b8..1eeb13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6c2=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x5a20a3,_0x1cf677){var _0x1b9dfe=function(_0x408c78){while(--_0x408c78){_0x5a20a3['push'](_0x5a20a3['shift']());}};_0x1b9dfe(++_0x1cf677);}(_0xa6c2,0x115));var _0x2a6c=function(_0x3a3afe,_0x15da25){_0x3a3afe=_0x3a3afe-0x0;var _0x262dab=_0xa6c2[_0x3a3afe];return _0x262dab;};'use strict';var client=require(_0x2a6c('0x0'));exports[_0x2a6c('0x1')]=function(_0x443ae6,_0x7f7a5b){return client[_0x2a6c('0x2')](_0x2a6c('0x3'),{'body':_0x7f7a5b,'options':{'where':{'id':_0x443ae6}},'log':_0x2a6c('0x4')});};exports[_0x2a6c('0x5')]=function(_0x341412,_0x5d21f6){return client[_0x2a6c('0x2')](_0x2a6c('0x6'),{'body':_0x5d21f6,'options':{'where':{'id':_0x341412}},'log':_0x2a6c('0x7')});};
\ No newline at end of file
+var _0x156c=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','Request','addTagsToChatInteraction','update'];(function(_0x14bf89,_0x539fb1){var _0x5033ea=function(_0x1ef254){while(--_0x1ef254){_0x14bf89['push'](_0x14bf89['shift']());}};_0x5033ea(++_0x539fb1);}(_0x156c,0x1bc));var _0xc156=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x156c[_0x15a8fa];return _0x1355c2;};'use strict';var client=require('../client');exports[_0xc156('0x0')]=function(_0x278c49,_0x1d4f7e){return client['Request'](_0xc156('0x1'),{'body':_0x1d4f7e,'options':{'where':{'id':_0x278c49}},'log':_0xc156('0x2')});};exports['addTags']=function(_0x44603e,_0x44faae){return client[_0xc156('0x3')]('AddTagsToOpenchannelInteraction',{'body':_0x44faae,'options':{'where':{'id':_0x44603e}},'log':_0xc156('0x4')});};
\ No newline at end of file
index d1b77fb..649f864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffb=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x125e4a,_0x3c40a3){var _0x375ef8=function(_0x21f0c6){while(--_0x21f0c6){_0x125e4a['push'](_0x125e4a['shift']());}};_0x375ef8(++_0x3c40a3);}(_0xeffb,0x123));var _0xbeff=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xeffb[_0x367e5b];return _0x4b909e;};'use strict';var client=require(_0xbeff('0x0'));exports[_0xbeff('0x1')]=function(_0x3a5d8d){return client['Request'](_0xbeff('0x2'),{'body':_0x3a5d8d,'log':_0xbeff('0x3')});};
\ No newline at end of file
+var _0xcaed=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x546f7a,_0x1bf4d9){var _0x373bbb=function(_0x1091dc){while(--_0x1091dc){_0x546f7a['push'](_0x546f7a['shift']());}};_0x373bbb(++_0x1bf4d9);}(_0xcaed,0x104));var _0xdcae=function(_0x223f98,_0x548ecb){_0x223f98=_0x223f98-0x0;var _0x5d4586=_0xcaed[_0x223f98];return _0x5d4586;};'use strict';var client=require(_0xdcae('0x0'));exports[_0xdcae('0x1')]=function(_0x4e3322){return client[_0xdcae('0x2')](_0xdcae('0x3'),{'body':_0x4e3322,'log':_0xdcae('0x4')});};
\ No newline at end of file
index a26ec45..6dec876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf5c=['strategy','User','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x5f5a1e,_0x2618a8){var _0x3a66cf=function(_0xc2c3ed){while(--_0xc2c3ed){_0x5f5a1e['push'](_0x5f5a1e['shift']());}};_0x3a66cf(++_0x2618a8);}(_0xaf5c,0x161));var _0xcaf5=function(_0x4815f3,_0x1b8266){_0x4815f3=_0x4815f3-0x0;var _0x384976=_0xaf5c[_0x4815f3];return _0x384976;};'use strict';var client=require('../client');exports[_0xcaf5('0x0')]=function(){return function(){return client[_0xcaf5('0x1')](_0xcaf5('0x2'),{'options':{'raw':![],'attributes':['id',_0xcaf5('0x3'),'timeout',_0xcaf5('0x4')],'include':[{'model':_0xcaf5('0x5'),'as':'Agents','attributes':['id',_0xcaf5('0x3'),'online',_0xcaf5('0x6')]}]},'log':_0xcaf5('0x0')});};};
\ No newline at end of file
+var _0x62ed=['name','timeout','strategy','User','Agents','openchannelPause','getOpenchannelQueues','Request'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x62ed,0x18e));var _0xd62e=function(_0x19207b,_0x19dbc5){_0x19207b=_0x19207b-0x0;var _0x11d16d=_0x62ed[_0x19207b];return _0x11d16d;};'use strict';var client=require('../client');exports[_0xd62e('0x0')]=function(){return function(){return client[_0xd62e('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xd62e('0x2'),_0xd62e('0x3'),_0xd62e('0x4')],'include':[{'model':_0xd62e('0x5'),'as':_0xd62e('0x6'),'attributes':['id','name','online',_0xd62e('0x7')]}]},'log':_0xd62e('0x0')});};};
\ No newline at end of file
index 493f53a..2e6dd1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae0d=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x29ec0b,_0x59f1c9){var _0x11c703=function(_0x33ca5f){while(--_0x33ca5f){_0x29ec0b['push'](_0x29ec0b['shift']());}};_0x11c703(++_0x59f1c9);}(_0xae0d,0x188));var _0xdae0=function(_0x3e2f2d,_0x2664c4){_0x3e2f2d=_0x3e2f2d-0x0;var _0x2bcad9=_0xae0d[_0x3e2f2d];return _0x2bcad9;};'use strict';var client=require(_0xdae0('0x0'));exports[_0xdae0('0x1')]=function(_0x1c5738){return client[_0xdae0('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1c5738,'log':_0xdae0('0x3')});};exports[_0xdae0('0x4')]=function(_0x1b0b7f,_0xafb947){return client[_0xdae0('0x2')](_0xdae0('0x5'),{'body':_0xafb947,'options':{'where':{'uniqueid':_0x1b0b7f},'order':[['id',_0xdae0('0x6')]],'limit':0x1},'log':_0xdae0('0x5')});};
\ No newline at end of file
+var _0xa9a7=['update','UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport'];(function(_0x463183,_0x56bd4e){var _0xd5fe56=function(_0x55cb29){while(--_0x55cb29){_0x463183['push'](_0x463183['shift']());}};_0xd5fe56(++_0x56bd4e);}(_0xa9a7,0x197));var _0x7a9a=function(_0x23fe6d,_0x4ec422){_0x23fe6d=_0x23fe6d-0x0;var _0x3854c0=_0xa9a7[_0x23fe6d];return _0x3854c0;};'use strict';var client=require('../client');exports[_0x7a9a('0x0')]=function(_0x4b9f22){return client[_0x7a9a('0x1')]('CreateOpenchannelQueueReport',{'body':_0x4b9f22,'log':_0x7a9a('0x2')});};exports[_0x7a9a('0x3')]=function(_0x56ca7c,_0x313842){return client['Request'](_0x7a9a('0x4'),{'body':_0x313842,'options':{'where':{'uniqueid':_0x56ca7c},'order':[['id','DESC']],'limit':0x1},'log':_0x7a9a('0x4')});};
\ No newline at end of file
index c049263..15a083c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d25=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0xe69bed,_0x5d74ba){var _0x3d0ef0=function(_0x46b419){while(--_0x46b419){_0xe69bed['push'](_0xe69bed['shift']());}};_0x3d0ef0(++_0x5d74ba);}(_0x1d25,0xba));var _0x51d2=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x1d25[_0x4327fe];return _0x138651;};'use strict';var client=require(_0x51d2('0x0'));exports[_0x51d2('0x1')]=function(_0x153698,_0x3f269b){return client[_0x51d2('0x2')]('UpdateSmsInteraction',{'body':_0x3f269b,'options':{'where':{'id':_0x153698}},'log':_0x51d2('0x3')});};exports[_0x51d2('0x4')]=function(_0x4c93f2,_0x1f9fc8){return client[_0x51d2('0x2')](_0x51d2('0x5'),{'body':_0x1f9fc8,'options':{'where':{'id':_0x4c93f2}},'log':_0x51d2('0x6')});};
\ No newline at end of file
+var _0x3308=['AddTagsToSmsInteraction','addTagsToSmsInteraction','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0xef5fea,_0x2b1285){var _0x2f8561=function(_0x59cf0e){while(--_0x59cf0e){_0xef5fea['push'](_0xef5fea['shift']());}};_0x2f8561(++_0x2b1285);}(_0x3308,0x12e));var _0x8330=function(_0x3a2047,_0xd5798a){_0x3a2047=_0x3a2047-0x0;var _0x1a2675=_0x3308[_0x3a2047];return _0x1a2675;};'use strict';var client=require('../client');exports['update']=function(_0x4f0007,_0x42bb8d){return client[_0x8330('0x0')](_0x8330('0x1'),{'body':_0x42bb8d,'options':{'where':{'id':_0x4f0007}},'log':_0x8330('0x2')});};exports[_0x8330('0x3')]=function(_0x5f52e6,_0x28d8af){return client[_0x8330('0x0')](_0x8330('0x4'),{'body':_0x28d8af,'options':{'where':{'id':_0x5f52e6}},'log':_0x8330('0x5')});};
\ No newline at end of file
index 43efe7c..8e3e7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6657=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x17fea7,_0x102927){var _0x3150c3=function(_0x1d6bd0){while(--_0x1d6bd0){_0x17fea7['push'](_0x17fea7['shift']());}};_0x3150c3(++_0x102927);}(_0x6657,0x165));var _0x7665=function(_0x1287a6,_0x38b142){_0x1287a6=_0x1287a6-0x0;var _0x3b6196=_0x6657[_0x1287a6];return _0x3b6196;};'use strict';var client=require(_0x7665('0x0'));exports[_0x7665('0x1')]=function(_0x470a91){return client[_0x7665('0x2')](_0x7665('0x3'),{'body':_0x470a91,'log':_0x7665('0x4')});};
\ No newline at end of file
+var _0x0617=['Request','createSmsMessage','../client','create'];(function(_0x6620b8,_0x8b3d5e){var _0x33de50=function(_0x2f1f07){while(--_0x2f1f07){_0x6620b8['push'](_0x6620b8['shift']());}};_0x33de50(++_0x8b3d5e);}(_0x0617,0x112));var _0x7061=function(_0xece964,_0x597241){_0xece964=_0xece964-0x0;var _0x569fe4=_0x0617[_0xece964];return _0x569fe4;};'use strict';var client=require(_0x7061('0x0'));exports[_0x7061('0x1')]=function(_0x2c06f8){return client[_0x7061('0x2')]('CreateSmsMessage',{'body':_0x2c06f8,'log':_0x7061('0x3')});};
\ No newline at end of file
index 45c534c..593e429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4e207e,_0xab51f6){var _0xac8677=function(_0x27a19d){while(--_0x27a19d){_0x4e207e['push'](_0x4e207e['shift']());}};_0xac8677(++_0xab51f6);}(_0xe706,0xa3));var _0x6e70=function(_0x4a8ce2,_0x4cd94e){_0x4a8ce2=_0x4a8ce2-0x0;var _0x38c265=_0xe706[_0x4a8ce2];return _0x38c265;};'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
+var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4b47ed,_0x44d42c){var _0x3c74c1=function(_0x23eecd){while(--_0x23eecd){_0x4b47ed['push'](_0x4b47ed['shift']());}};_0x3c74c1(++_0x44d42c);}(_0xe706,0xa3));var _0x6e70=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0xe706[_0x4a1ec0];return _0x49ab91;};'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
index cad098a..ab20081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x4f59dc,_0x14391c){var _0x36de6e=function(_0x173140){while(--_0x173140){_0x4f59dc['push'](_0x4f59dc['shift']());}};_0x36de6e(++_0x14391c);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x3126d9,_0x39860b){var _0x57b17f=function(_0x1b3eff){while(--_0x1b3eff){_0x3126d9['push'](_0x3126d9['shift']());}};_0x57b17f(++_0x39860b);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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
index 7fbb71b..97a4b90 100644 (file)
@@ -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(_0x3a548c,_0x49a8dc){var _0x4c30b5=function(_0x4a159c){while(--_0x4a159c){_0x3a548c['push'](_0x3a548c['shift']());}};_0x4c30b5(++_0x49a8dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x409645,_0x8d152a){var _0x5d51ca=function(_0x1e61af){while(--_0x1e61af){_0x409645['push'](_0x409645['shift']());}};_0x5d51ca(++_0x8d152a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index fb9675e..dedbd75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1db=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5ae849,_0x362baf){var _0x2ef4b1=function(_0xc33ee6){while(--_0xc33ee6){_0x5ae849['push'](_0x5ae849['shift']());}};_0x2ef4b1(++_0x362baf);}(_0xc1db,0x120));var _0xbc1d=function(_0x4dc6d9,_0x575974){_0x4dc6d9=_0x4dc6d9-0x0;var _0x2e95d0=_0xc1db[_0x4dc6d9];return _0x2e95d0;};'use strict';var client=require(_0xbc1d('0x0'));exports['update']=function(_0x363adb,_0x153d86){return client[_0xbc1d('0x1')](_0xbc1d('0x2'),{'body':_0x153d86,'options':{'where':{'id':_0x363adb}},'log':_0xbc1d('0x3')});};exports['addTags']=function(_0x3d0b27,_0x329960){return client[_0xbc1d('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x329960,'options':{'where':{'id':_0x3d0b27}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x323f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x323f,0x1ee));var _0xf323=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x323f[_0x618414];return _0x21c19a;};'use strict';var client=require('../client');exports[_0xf323('0x0')]=function(_0x564979,_0x766661){return client[_0xf323('0x1')](_0xf323('0x2'),{'body':_0x766661,'options':{'where':{'id':_0x564979}},'log':_0xf323('0x3')});};exports[_0xf323('0x4')]=function(_0x2c9d35,_0xb4caa8){return client[_0xf323('0x1')](_0xf323('0x5'),{'body':_0xb4caa8,'options':{'where':{'id':_0x2c9d35}},'log':_0xf323('0x6')});};
\ No newline at end of file
index 18911cc..6b1d5b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc461=['Request','CreateWhatsappMessage','../client','create'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc461,0xa2));var _0x1c46=function(_0x2862bd,_0x368663){_0x2862bd=_0x2862bd-0x0;var _0x5ead7a=_0xc461[_0x2862bd];return _0x5ead7a;};'use strict';var client=require(_0x1c46('0x0'));exports[_0x1c46('0x1')]=function(_0x3783a7){return client[_0x1c46('0x2')](_0x1c46('0x3'),{'body':_0x3783a7,'log':'createWhatsappMessage'});};
\ No newline at end of file
+var _0xe73e=['createWhatsappMessage','../client','create','Request'];(function(_0x4c5f9f,_0x111571){var _0x348da6=function(_0x4873d2){while(--_0x4873d2){_0x4c5f9f['push'](_0x4c5f9f['shift']());}};_0x348da6(++_0x111571);}(_0xe73e,0xbd));var _0xee73=function(_0x1bef68,_0x37aab0){_0x1bef68=_0x1bef68-0x0;var _0x434d9a=_0xe73e[_0x1bef68];return _0x434d9a;};'use strict';var client=require(_0xee73('0x0'));exports[_0xee73('0x1')]=function(_0x3b5bff){return client[_0xee73('0x2')]('CreateWhatsappMessage',{'body':_0x3b5bff,'log':_0xee73('0x3')});};
\ No newline at end of file
index 41f91bf..0e603fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa31d=['Agents','name','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','strategy'];(function(_0x1a15e1,_0x53cde3){var _0x1276fd=function(_0x3cb1bc){while(--_0x3cb1bc){_0x1a15e1['push'](_0x1a15e1['shift']());}};_0x1276fd(++_0x53cde3);}(_0xa31d,0x12c));var _0xda31=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0xa31d[_0x131585];return _0x1fcca2;};'use strict';var client=require(_0xda31('0x0'));exports[_0xda31('0x1')]=function(){return function(){return client['Request'](_0xda31('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xda31('0x3')],'include':[{'model':'User','as':_0xda31('0x4'),'attributes':['id',_0xda31('0x5'),_0xda31('0x6'),_0xda31('0x7')]}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
+var _0x3a1b=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','User','Agents','whatsappPause'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x3a1b,0x15f));var _0xb3a1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3a1b[_0x29d94e];return _0x106237;};'use strict';var client=require(_0xb3a1('0x0'));exports[_0xb3a1('0x1')]=function(){return function(){return client[_0xb3a1('0x2')](_0xb3a1('0x3'),{'options':{'raw':![],'attributes':['id',_0xb3a1('0x4'),_0xb3a1('0x5'),'strategy'],'include':[{'model':_0xb3a1('0x6'),'as':_0xb3a1('0x7'),'attributes':['id',_0xb3a1('0x4'),'online',_0xb3a1('0x8')]}]},'log':_0xb3a1('0x1')});};};
\ No newline at end of file
index e86108b..de1386c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd243=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x37b6d9,_0x62fbd8){var _0x5c1323=function(_0x4c5ccc){while(--_0x4c5ccc){_0x37b6d9['push'](_0x37b6d9['shift']());}};_0x5c1323(++_0x62fbd8);}(_0xd243,0x11a));var _0x3d24=function(_0x292841,_0x28c296){_0x292841=_0x292841-0x0;var _0x52f769=_0xd243[_0x292841];return _0x52f769;};'use strict';var client=require(_0x3d24('0x0'));exports[_0x3d24('0x1')]=function(_0x488b6b){return client[_0x3d24('0x2')](_0x3d24('0x3'),{'body':_0x488b6b,'log':_0x3d24('0x3')});};exports[_0x3d24('0x4')]=function(_0xb40270,_0x1a3f64){return client[_0x3d24('0x2')](_0x3d24('0x5'),{'body':_0x1a3f64,'options':{'where':{'uniqueid':_0xb40270},'order':[['id',_0x3d24('0x6')]],'limit':0x1},'log':_0x3d24('0x5')});};
\ No newline at end of file
+var _0xebaa=['create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','DESC'];(function(_0x4b78f6,_0x3e5ed4){var _0x5ef31f=function(_0x37409f){while(--_0x37409f){_0x4b78f6['push'](_0x4b78f6['shift']());}};_0x5ef31f(++_0x3e5ed4);}(_0xebaa,0x192));var _0xaeba=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xebaa[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0xaeba('0x0')]=function(_0x434ea2){return client['Request'](_0xaeba('0x1'),{'body':_0x434ea2,'log':_0xaeba('0x1')});};exports[_0xaeba('0x2')]=function(_0x277b1d,_0x1ff02b){return client[_0xaeba('0x3')](_0xaeba('0x4'),{'body':_0x1ff02b,'options':{'where':{'uniqueid':_0x277b1d},'order':[['id',_0xaeba('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
index aeed576..c71e291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5359=['toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s','map','message','stop','find','agents','timeout','createQueue','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','lodash','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0x5359,0x130));var _0x9535=function(_0x3a4dc7,_0x5b7442){_0x3a4dc7=_0x3a4dc7-0x0;var _0x585386=_0x5359[_0x3a4dc7];return _0x585386;};'use strict';var schema=require('validate');var _=require(_0x9535('0x0'));var util=require(_0x9535('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x9535('0x2'))(_0x9535('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9535('0x4'),'required':!![],'message':_0x9535('0x5')},'timeout':{'type':'number','message':_0x9535('0x6')}});function writeLog(_0x5598e4,_0x34d7d5,_0x263bad){return logger[_0x9535('0x7')](util[_0x9535('0x8')](_0x9535('0x9'),_0x5598e4,_0x34d7d5['name'],_0x263bad));}function handleFindAgent(_0x349728){return function(_0x2bd6ea){return _0x2bd6ea[_0x9535('0xa')][_0x9535('0xb')]()===_0x349728[_0x9535('0xb')]();};}exports[_0x9535('0xc')]=function(_0x1a3591,_0x2ef774,_0x4e4163,_0x1d5ba4){return function(_0x207363){try{var _0x9786b3={'name':_0x2ef774[0x0],'timeout':_0x2ef774[0x1]};var _0x46b132=queue[_0x9535('0xd')](_0x9786b3,{'typecast':!![]});if(_0x46b132[_0x9535('0xe')]){logger['error'](_0x9535('0xf'),_0x1a3591,_[_0x9535('0x10')](_0x46b132,_0x9535('0x11'))['join'](',\x20'));_0x207363[_0x9535('0x12')]();}else{var _0x58d78b=_[_0x9535('0x13')](_0x4e4163[_0x9535('0x14')],handleFindAgent(_0x9786b3['name']));if(_0x58d78b){var _0x2309ff=(_0x9786b3[_0x9535('0x15')]||0xa)*0x3e8;var _0x264240,_0x142efa;var _0x3c1394=seqqueue[_0x9535('0x16')](_0x2309ff);_0x3c1394['id']=_0x1a3591;_0x3c1394['atimeout']=_0x2309ff;_0x3c1394['channel']=_0x1d5ba4[_0x9535('0x17')];writeLog(_0x1a3591,_0x58d78b,util[_0x9535('0x8')]('START:%s',_0x2309ff));_0x4e4163[_0x9535('0x18')][_0x1a3591]['on'](_0x9535('0x19'),function(){logger[_0x9535('0x7')](_0x9535('0x1a'),_0x1a3591);clearTimeout(_0x142efa);_0x142efa=undefined;_0x3c1394[_0x9535('0x1b')]();if(_0x4e4163[_0x9535('0x18')][_0x1a3591]){delete _0x4e4163['rules'][_0x1a3591];}_0x207363[_0x9535('0x12')]();});_0x4e4163[_0x9535('0x18')][_0x1a3591]['on'](_0x9535('0x1c'),function(){if(_0x4e4163[_0x9535('0x18')][_0x1a3591]){delete _0x4e4163[_0x9535('0x18')][_0x1a3591];}});_0x142efa=setTimeout(function(){logger['info'](_0x9535('0x1d'),_0x1a3591);clearTimeout(_0x142efa);_0x3c1394[_0x9535('0x1b')]();_0x207363[_0x9535('0x1e')]();},_0x2309ff);strategy[_0x9535('0x1f')](_0x3c1394,_0x58d78b,_0x4e4163,_0x1d5ba4);}else{logger['error'](_0x9535('0x20'),_0x1a3591,_0x9786b3[_0x9535('0xa')]);_0x207363['stop']();}}}catch(_0x96bbbb){console[_0x9535('0x21')](_0x96bbbb);logger[_0x9535('0x22')]('[%s][QUEUE]\x20%s',_0x1a3591,_0x96bbbb['stack']);_0x207363[_0x9535('0x12')]();}};};
\ No newline at end of file
+var _0x81dc=['channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x81dc,0x189));var _0xc81d=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x81dc[_0x4243a3];return _0x1b2a33;};'use strict';var schema=require('validate');var _=require(_0xc81d('0x0'));var util=require(_0xc81d('0x1'));var seqqueue=require(_0xc81d('0x2'));var logger=require(_0xc81d('0x3'))('routing');var strategy=require(_0xc81d('0x4'));var queue=schema({'name':{'type':_0xc81d('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xc81d('0x6')}});function writeLog(_0x1fbc71,_0x4bb267,_0x323d36){return logger[_0xc81d('0x7')](util[_0xc81d('0x8')](_0xc81d('0x9'),_0x1fbc71,_0x4bb267['name'],_0x323d36));}function handleFindAgent(_0x16a438){return function(_0x211054){return _0x211054[_0xc81d('0xa')][_0xc81d('0xb')]()===_0x16a438['toLowerCase']();};}exports[_0xc81d('0xc')]=function(_0xba5c9,_0x29ecb8,_0x1ad435,_0x4e9148){return function(_0x54ce7e){try{var _0x11cfc4={'name':_0x29ecb8[0x0],'timeout':_0x29ecb8[0x1]};var _0x487244=queue[_0xc81d('0xd')](_0x11cfc4,{'typecast':!![]});if(_0x487244[_0xc81d('0xe')]){logger[_0xc81d('0xf')](_0xc81d('0x10'),_0xba5c9,_['map'](_0x487244,_0xc81d('0x11'))[_0xc81d('0x12')](',\x20'));_0x54ce7e[_0xc81d('0x13')]();}else{var _0x778057=_[_0xc81d('0x14')](_0x1ad435[_0xc81d('0x15')],handleFindAgent(_0x11cfc4['name']));if(_0x778057){var _0x128169=(_0x11cfc4[_0xc81d('0x16')]||0xa)*0x3e8;var _0x3ecff0,_0x2abe81;var _0x23ecc1=seqqueue[_0xc81d('0x17')](_0x128169);_0x23ecc1['id']=_0xba5c9;_0x23ecc1[_0xc81d('0x18')]=_0x128169;_0x23ecc1['channel']=_0x4e9148[_0xc81d('0x19')];writeLog(_0xba5c9,_0x778057,util[_0xc81d('0x8')](_0xc81d('0x1a'),_0x128169));_0x1ad435[_0xc81d('0x1b')][_0xba5c9]['on']('end',function(){logger[_0xc81d('0x7')](_0xc81d('0x1c'),_0xba5c9);clearTimeout(_0x2abe81);_0x2abe81=undefined;_0x23ecc1[_0xc81d('0x1d')]();if(_0x1ad435[_0xc81d('0x1b')][_0xba5c9]){delete _0x1ad435[_0xc81d('0x1b')][_0xba5c9];}_0x54ce7e[_0xc81d('0x13')]();});_0x1ad435[_0xc81d('0x1b')][_0xba5c9]['on'](_0xc81d('0x1e'),function(){if(_0x1ad435[_0xc81d('0x1b')][_0xba5c9]){delete _0x1ad435['rules'][_0xba5c9];}});_0x2abe81=setTimeout(function(){logger['info'](_0xc81d('0x1f'),_0xba5c9);clearTimeout(_0x2abe81);_0x23ecc1[_0xc81d('0x1d')]();_0x54ce7e[_0xc81d('0x20')]();},_0x128169);strategy[_0xc81d('0x21')](_0x23ecc1,_0x778057,_0x1ad435,_0x4e9148);}else{logger[_0xc81d('0xf')](_0xc81d('0x22'),_0xba5c9,_0x11cfc4[_0xc81d('0xa')]);_0x54ce7e['stop']();}}}catch(_0xf0d48f){console[_0xc81d('0x23')](_0xf0d48f);logger[_0xc81d('0xf')](_0xc81d('0x24'),_0xba5c9,_0xf0d48f[_0xc81d('0x25')]);_0x54ce7e[_0xc81d('0x13')]();}};};
\ No newline at end of file
index 77fafd6..888f912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd58b=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','providerName','amazonlex','providerResponse','Message','catch','error','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','create','then','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0xd58b,0x6d));var _0xbd58=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd58b[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xbd58('0x0'));var utils=require('./utils');var logger=require(_0xbd58('0x1'))(_0xbd58('0x2'));var rpc={'chatMessage':require(_0xbd58('0x3')),'openchannelMessage':require(_0xbd58('0x4')),'mailMessage':require(_0xbd58('0x5')),'smsMessage':require(_0xbd58('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xbd58('0x7'))};exports[_0xbd58('0x8')]=function(_0x3f58a9,_0x3d9076){return function(_0x56fd00){try{if(!_[_0xbd58('0x9')](this[_0xbd58('0xa')][_0xbd58('0xb')])){logger[_0xbd58('0xc')](_0xbd58('0xd'),_0x3f58a9,_0xbd58('0xe'));return _0x56fd00[_0xbd58('0xf')]();}var _0x18808e={'ContactId':this[_0xbd58('0x10')]['id'],'sentAt':moment()[_0xbd58('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xbd58('0x12')};if(this[_0xbd58('0x13')]===_0xbd58('0x14')||this[_0xbd58('0x13')]===_0xbd58('0x15')){_0x18808e['phone']=this[_0xbd58('0xa')][_0xbd58('0x16')];}var _0x4906fb=this[_0xbd58('0x13')];if(_0x4906fb===_0xbd58('0x17')){_0x18808e[_0xbd58('0x18')]=this[_0xbd58('0x19')]['id'];}else{_0x18808e[_['upperFirst'](_0x4906fb)+_0xbd58('0x1a')]=this[_0xbd58('0x19')]['id'];}_0x18808e[_[_0xbd58('0x1b')](_0x4906fb)+_0xbd58('0x1c')]=this[_0xbd58('0xa')]['id'];if(this['interaction']['created']){var _0x42ab02=_0x3d9076[0x4];if(!_[_0xbd58('0x1d')](_0x42ab02)){_0x18808e[_0xbd58('0x1e')]=utils[_0xbd58('0x1f')](_0x42ab02,this);return rpc[_0x4906fb+'Message'][_0xbd58('0x20')](_0x18808e)[_0xbd58('0x21')](function(_0x53c37d){logger[_0xbd58('0xc')](_0xbd58('0xd'),_0x3f58a9,_0x18808e[_0xbd58('0x1e')]);})['catch'](function(_0x2b74ee){logger['error'](_0xbd58('0xd'),_0x3f58a9,JSON[_0xbd58('0x22')](_0x2b74ee));})[_0xbd58('0x23')](function(){logger[_0xbd58('0xc')](_0xbd58('0x24'),_0x3f58a9);_0x56fd00[_0xbd58('0x25')]();});}else{logger[_0xbd58('0xc')](_0xbd58('0x26'),_0x3f58a9);_0x56fd00[_0xbd58('0x25')]();}}else{var _0x4bf538=this;var _0x4eb378=new AWS[(_0xbd58('0x27'))]({'accessKeyId':_0x3d9076[0x0],'secretAccessKey':_0x3d9076[0x1],'region':_0x3d9076[0x2]});var _0x42e14f={'botAlias':'$LATEST','botName':_0x3d9076[0x3],'inputText':this[_0xbd58('0x28')][_0xbd58('0x1e')],'userId':this['channel']+':'+this[_0xbd58('0xa')]['id'][_0xbd58('0x29')]()};_0x4eb378[_0xbd58('0x2a')](_0x42e14f,function(_0x12f8d4,_0x5ba8cd){if(_0x12f8d4){logger['error'](_0xbd58('0xd'),_0x3f58a9,_0x12f8d4[_0xbd58('0x28')]);_0x56fd00[_0xbd58('0xf')]();}else if(_0x5ba8cd&&_0x5ba8cd[_0xbd58('0x28')]){_0x4bf538['body']['amazonlex']=_0x5ba8cd;_0x18808e[_0xbd58('0x1e')]=_0x5ba8cd['message'];_0x18808e[_0xbd58('0x2b')]=_0xbd58('0x2c');_0x18808e[_0xbd58('0x2d')]=JSON[_0xbd58('0x22')](_0x5ba8cd);return rpc[_0x4906fb+_0xbd58('0x2e')]['create'](_0x18808e)['then'](function(_0x1ee61a){logger[_0xbd58('0xc')](_0xbd58('0xd'),_0x3f58a9,_0x18808e['body']);if(_0x5ba8cd['dialogState']=='Failed'){_0x56fd00[_0xbd58('0xf')]();}else{_0x56fd00[_0xbd58('0x25')]();}})[_0xbd58('0x2f')](function(_0x232662){logger[_0xbd58('0x30')]('[%s][AMAZONLEX]\x20%s',_0x3f58a9,JSON[_0xbd58('0x22')](_0x232662));_0x56fd00['next']();});}else{_0x56fd00['next']();}});}}catch(_0x475d5e){logger[_0xbd58('0x30')](_0xbd58('0xd'),_0x3f58a9,JSON[_0xbd58('0x22')](_0x475d5e));_0x56fd00[_0xbd58('0x25')]();}};};
\ No newline at end of file
+var _0x7ea2=['phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','toString','postText','message','providerName','amazonlex','providerResponse','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp'];(function(_0x17d7d3,_0x5f0a2f){var _0x170511=function(_0xdcc557){while(--_0xdcc557){_0x17d7d3['push'](_0x17d7d3['shift']());}};_0x170511(++_0x5f0a2f);}(_0x7ea2,0x1cc));var _0x27ea=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0x7ea2[_0x37c8ef];return _0x5eaee9;};'use strict';var _=require('lodash');var moment=require(_0x27ea('0x0'));var AWS=require(_0x27ea('0x1'));var utils=require(_0x27ea('0x2'));var logger=require(_0x27ea('0x3'))(_0x27ea('0x4'));var rpc={'chatMessage':require(_0x27ea('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x27ea('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x27ea('0x7')),'whatsappMessage':require(_0x27ea('0x8'))};exports[_0x27ea('0x9')]=function(_0x598284,_0x3f2e32){return function(_0x419eef){try{if(!_[_0x27ea('0xa')](this[_0x27ea('0xb')][_0x27ea('0xc')])){logger[_0x27ea('0xd')](_0x27ea('0xe'),_0x598284,_0x27ea('0xf'));return _0x419eef[_0x27ea('0x10')]();}var _0xbb7c4e={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x27ea('0x11')),'direction':'out'};if(this[_0x27ea('0x12')]==='sms'||this[_0x27ea('0x12')]===_0x27ea('0x13')){_0xbb7c4e[_0x27ea('0x14')]=this[_0x27ea('0xb')][_0x27ea('0x14')];}var _0x312eee=this['channel'];if(_0x312eee===_0x27ea('0x15')){_0xbb7c4e[_0x27ea('0x16')]=this[_0x27ea('0x17')]['id'];}else{_0xbb7c4e[_[_0x27ea('0x18')](_0x312eee)+_0x27ea('0x19')]=this[_0x27ea('0x17')]['id'];}_0xbb7c4e[_[_0x27ea('0x18')](_0x312eee)+_0x27ea('0x1a')]=this[_0x27ea('0xb')]['id'];if(this[_0x27ea('0xb')][_0x27ea('0x1b')]){var _0x3c7e30=_0x3f2e32[0x4];if(!_[_0x27ea('0x1c')](_0x3c7e30)){_0xbb7c4e[_0x27ea('0x1d')]=utils[_0x27ea('0x1e')](_0x3c7e30,this);return rpc[_0x312eee+'Message'][_0x27ea('0x1f')](_0xbb7c4e)[_0x27ea('0x20')](function(_0x3f60fc){logger['info'](_0x27ea('0xe'),_0x598284,_0xbb7c4e[_0x27ea('0x1d')]);})[_0x27ea('0x21')](function(_0x51f12a){logger[_0x27ea('0x22')](_0x27ea('0xe'),_0x598284,JSON[_0x27ea('0x23')](_0x51f12a));})[_0x27ea('0x24')](function(){logger[_0x27ea('0xd')](_0x27ea('0x25'),_0x598284);_0x419eef[_0x27ea('0x26')]();});}else{logger[_0x27ea('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x598284);_0x419eef[_0x27ea('0x26')]();}}else{var _0x1973a6=this;var _0x4ae076=new AWS[(_0x27ea('0x27'))]({'accessKeyId':_0x3f2e32[0x0],'secretAccessKey':_0x3f2e32[0x1],'region':_0x3f2e32[0x2]});var _0x32cdaf={'botAlias':'$LATEST','botName':_0x3f2e32[0x3],'inputText':this['message'][_0x27ea('0x1d')],'userId':this[_0x27ea('0x12')]+':'+this['interaction']['id'][_0x27ea('0x28')]()};_0x4ae076[_0x27ea('0x29')](_0x32cdaf,function(_0x3efba7,_0x37e378){if(_0x3efba7){logger[_0x27ea('0x22')]('[%s][AMAZONLEX]\x20%s',_0x598284,_0x3efba7[_0x27ea('0x2a')]);_0x419eef[_0x27ea('0x10')]();}else if(_0x37e378&&_0x37e378[_0x27ea('0x2a')]){_0x1973a6[_0x27ea('0x1d')]['amazonlex']=_0x37e378;_0xbb7c4e[_0x27ea('0x1d')]=_0x37e378[_0x27ea('0x2a')];_0xbb7c4e[_0x27ea('0x2b')]=_0x27ea('0x2c');_0xbb7c4e[_0x27ea('0x2d')]=JSON[_0x27ea('0x23')](_0x37e378);return rpc[_0x312eee+'Message']['create'](_0xbb7c4e)[_0x27ea('0x20')](function(_0x3ae036){logger['info']('[%s][AMAZONLEX]\x20%s',_0x598284,_0xbb7c4e[_0x27ea('0x1d')]);if(_0x37e378[_0x27ea('0x2e')]==_0x27ea('0x2f')){_0x419eef[_0x27ea('0x10')]();}else{_0x419eef[_0x27ea('0x26')]();}})['catch'](function(_0x2cf681){logger[_0x27ea('0x22')](_0x27ea('0xe'),_0x598284,JSON[_0x27ea('0x23')](_0x2cf681));_0x419eef['next']();});}else{_0x419eef[_0x27ea('0x10')]();}});}}catch(_0x175d8c){logger[_0x27ea('0x22')](_0x27ea('0xe'),_0x598284,JSON[_0x27ea('0x23')](_0x175d8c));_0x419eef[_0x27ea('0x26')]();}};};
\ No newline at end of file
index db738c1..bb23346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb95=['lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop'];(function(_0x3ca116,_0x9ffc4e){var _0x53d729=function(_0x2c1d2b){while(--_0x2c1d2b){_0x3ca116['push'](_0x3ca116['shift']());}};_0x53d729(++_0x9ffc4e);}(_0xcb95,0x11c));var _0x5cb9=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xcb95[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x5cb9('0x0'));var moment=require(_0x5cb9('0x1'));var utils=require(_0x5cb9('0x2'));var logger=require('../../../../config/logger')(_0x5cb9('0x3'));var rpc={'chatMessage':require(_0x5cb9('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5cb9('0x5')),'smsMessage':require(_0x5cb9('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5cb9('0x7')),'chatInteraction':require(_0x5cb9('0x8')),'openchannelInteraction':require(_0x5cb9('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x5cb9('0xa')),'faxInteraction':require(_0x5cb9('0xb')),'whatsappInteraction':require(_0x5cb9('0xc'))};var mailRpc=require(_0x5cb9('0xd'));exports[_0x5cb9('0xe')]=function(_0x8cea5f,_0x5ae969,_0x497d0a,_0x2a653a){return function(_0x46d345){try{var _0x454cdc=this[_0x5cb9('0xf')];if(_0x454cdc===_0x5cb9('0x10')&&_0x2a653a[_0x5cb9('0x11')][_0x5cb9('0x12')]){logger[_0x5cb9('0x13')](_0x5cb9('0x14'),_0x8cea5f,_0x5cb9('0x15'));return _0x46d345[_0x5cb9('0x16')]();}if(_0x5ae969[0x0]==='1'&&(_[_0x5cb9('0x17')](this[_0x5cb9('0x18')][_0x5cb9('0x19')])||!this[_0x5cb9('0x18')][_0x5cb9('0x19')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x8cea5f,'Autoreply\x20already\x20sent');return _0x46d345[_0x5cb9('0x16')]();}if(_0x5ae969[0x0]==='2'&&this[_0x5cb9('0x18')][_0x5cb9('0x1a')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x8cea5f,_0x5cb9('0x1b'));return _0x46d345[_0x5cb9('0x16')]();}var _0x360087={'ContactId':this[_0x5cb9('0x1c')]['id'],'sentAt':moment()[_0x5cb9('0x1d')](_0x5cb9('0x1e')),'direction':_0x5cb9('0x1f')};if(this[_0x5cb9('0xf')]===_0x5cb9('0x10')){_0x360087[_0x5cb9('0x11')]=utils['getMustacheRender'](_0x5ae969[0x2],this);}else{_0x360087[_0x5cb9('0x11')]=utils['getMustacheRender'](_0x5ae969[0x1],this);}if(this[_0x5cb9('0x20')]){_0x360087['to']=this['message'][_0x5cb9('0x21')]||'';if(this[_0x5cb9('0xf')]===_0x5cb9('0x10')&&_0x5ae969[0x1]==='1'){_0x360087['cc']=this['message']['cc']||'';}_0x360087[_0x5cb9('0x21')]=this[_0x5cb9('0x20')]['to']||'';_0x360087[_0x5cb9('0x22')]=this['message'][_0x5cb9('0x22')]||'';_0x360087[_0x5cb9('0x23')]=!![];if(this[_0x5cb9('0x20')][_0x5cb9('0x24')]){_0x360087['subject']='';_0x360087[_0x5cb9('0x24')]+=_[_0x5cb9('0x25')](this[_0x5cb9('0x20')][_0x5cb9('0x24')],_0x5cb9('0x26'))?'':_0x5cb9('0x27');_0x360087[_0x5cb9('0x24')]+=this[_0x5cb9('0x20')][_0x5cb9('0x24')];}}if(this[_0x5cb9('0xf')]===_0x5cb9('0x28')){_0x360087[_0x5cb9('0x29')]=this[_0x5cb9('0x2a')]['id'];}else{_0x360087[_['upperFirst'](this[_0x5cb9('0xf')])+_0x5cb9('0x2b')]=this[_0x5cb9('0x2a')]['id'];}_0x360087[_['upperFirst'](this[_0x5cb9('0xf')])+_0x5cb9('0x2c')]=this[_0x5cb9('0x18')]['id'];var _0x32544d=this['interaction'];if(rpc[this[_0x5cb9('0xf')]+_0x5cb9('0x2d')]){if(this[_0x5cb9('0xf')]===_0x5cb9('0x10')){_0x360087[_0x5cb9('0x2e')]=this[_0x5cb9('0x20')][_0x5cb9('0x2f')];_0x360087[_0x5cb9('0x30')]=_0x5cb9('0x31')+_[_0x5cb9('0x32')](_0x360087[_0x5cb9('0x11')],_0x5cb9('0x33'),'<div')+_0x5cb9('0x34');_0x360087[_0x5cb9('0x35')]={'Auto-Submitted':_0x5cb9('0x36'),'X-Auto-Response-Suppress':_0x5cb9('0x37'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0x5cb9('0x2a')][_0x5cb9('0x38')],_0x360087)['then'](function(_0x2dc23d){logger[_0x5cb9('0x13')](_0x5cb9('0x39'),_0x8cea5f);_0x360087[_0x5cb9('0x2f')]=_0x2dc23d['message']['messageId'];return rpc[_0x454cdc+_0x5cb9('0x2d')][_0x5cb9('0x3a')](_0x360087);})[_0x5cb9('0x3b')](function(_0x3c80c0){logger[_0x5cb9('0x13')]('[%s][AUTOREPLY]\x20%s',_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x3c80c0));})['catch'](function(_0x2bedd5){logger[_0x5cb9('0x3d')](_0x5cb9('0x3e'),_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x2bedd5));})[_0x5cb9('0x3f')](function(){Promise['resolve']()[_0x5cb9('0x3b')](function(){if(_0x5ae969[0x0]!=='2'||_0x32544d[_0x5cb9('0x1a')])return;return rpc[_0x454cdc+_0x5cb9('0x40')][_0x5cb9('0x41')](_0x32544d['id'],{'autoreplyExecuted':!![]})[_0x5cb9('0x3b')](function(_0x377b05){logger[_0x5cb9('0x13')](_0x5cb9('0x42'),_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x377b05));})[_0x5cb9('0x43')](function(_0x43894f){logger[_0x5cb9('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x43894f));});})[_0x5cb9('0x3b')](function(){_0x46d345[_0x5cb9('0x16')]();});});}else{return rpc[this['channel']+_0x5cb9('0x2d')][_0x5cb9('0x3a')](_0x360087)[_0x5cb9('0x3b')](function(){logger[_0x5cb9('0x13')](_0x5cb9('0x14'),_0x8cea5f,_0x360087[_0x5cb9('0x11')]);})['catch'](function(_0x953c76){logger[_0x5cb9('0x3d')](_0x5cb9('0x14'),_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x953c76));})[_0x5cb9('0x3f')](function(){Promise[_0x5cb9('0x44')]()[_0x5cb9('0x3b')](function(){if(_0x5ae969[0x0]!=='2'||_0x32544d[_0x5cb9('0x1a')])return;return rpc[_0x454cdc+'Interaction']['update'](_0x32544d['id'],{'autoreplyExecuted':!![]})[_0x5cb9('0x3b')](function(_0x56157d){logger[_0x5cb9('0x13')](_0x5cb9('0x42'),_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x56157d));})['catch'](function(_0x2ba335){logger[_0x5cb9('0x3d')](_0x5cb9('0x45'),_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x2ba335));});})['then'](function(){_0x46d345[_0x5cb9('0x16')]();});});}}}catch(_0x18067d){logger[_0x5cb9('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x8cea5f,JSON[_0x5cb9('0x3c')](_0x18067d));_0x46d345[_0x5cb9('0x46')]();}};};
\ No newline at end of file
+var _0xd261=['autoreplyExecuted','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','One\x20Time\x20already\x20sent','next','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','auto-replied','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve'];(function(_0x33c147,_0xd24400){var _0x216d7d=function(_0x1ac7f8){while(--_0x1ac7f8){_0x33c147['push'](_0x33c147['shift']());}};_0x216d7d(++_0xd24400);}(_0xd261,0xd5));var _0x1d26=function(_0x2f3882,_0x3d38ec){_0x2f3882=_0x2f3882-0x0;var _0x32a311=_0xd261[_0x2f3882];return _0x32a311;};'use strict';var _=require(_0x1d26('0x0'));var moment=require(_0x1d26('0x1'));var utils=require(_0x1d26('0x2'));var logger=require(_0x1d26('0x3'))(_0x1d26('0x4'));var rpc={'chatMessage':require(_0x1d26('0x5')),'openchannelMessage':require(_0x1d26('0x6')),'mailMessage':require(_0x1d26('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1d26('0x8')),'whatsappMessage':require(_0x1d26('0x9')),'chatInteraction':require(_0x1d26('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x1d26('0xb')),'smsInteraction':require(_0x1d26('0xc')),'faxInteraction':require(_0x1d26('0xd')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x1d26('0xe')]=function(_0x55b990,_0x4c83ff,_0x33a213,_0x72ddf3){return function(_0x4ebee5){try{var _0x47e6fa=this[_0x1d26('0xf')];if(_0x47e6fa===_0x1d26('0x10')&&_0x72ddf3[_0x1d26('0x11')][_0x1d26('0x12')]){logger[_0x1d26('0x13')](_0x1d26('0x14'),_0x55b990,_0x1d26('0x15'));return _0x4ebee5['next']();}if(_0x4c83ff[0x0]==='1'&&(_[_0x1d26('0x16')](this['interaction'][_0x1d26('0x17')])||!this['interaction'][_0x1d26('0x17')])){logger[_0x1d26('0x13')]('[%s][AUTOREPLY]\x20%s',_0x55b990,'Autoreply\x20already\x20sent');return _0x4ebee5['next']();}if(_0x4c83ff[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0x1d26('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x55b990,_0x1d26('0x18'));return _0x4ebee5[_0x1d26('0x19')]();}var _0x476479={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1d26('0x1a')](_0x1d26('0x1b')),'direction':'out'};if(this[_0x1d26('0xf')]===_0x1d26('0x10')){_0x476479['body']=utils[_0x1d26('0x1c')](_0x4c83ff[0x2],this);}else{_0x476479[_0x1d26('0x11')]=utils[_0x1d26('0x1c')](_0x4c83ff[0x1],this);}if(this[_0x1d26('0x1d')]){_0x476479['to']=this[_0x1d26('0x1d')][_0x1d26('0x1e')]||'';if(this[_0x1d26('0xf')]===_0x1d26('0x10')&&_0x4c83ff[0x1]==='1'){_0x476479['cc']=this['message']['cc']||'';}_0x476479[_0x1d26('0x1e')]=this[_0x1d26('0x1d')]['to']||'';_0x476479['phone']=this[_0x1d26('0x1d')]['phone']||'';_0x476479[_0x1d26('0x1f')]=!![];if(this[_0x1d26('0x1d')]['subject']){_0x476479[_0x1d26('0x20')]='';_0x476479['subject']+=_[_0x1d26('0x21')](this[_0x1d26('0x1d')][_0x1d26('0x20')],_0x1d26('0x22'))?'':_0x1d26('0x23');_0x476479[_0x1d26('0x20')]+=this[_0x1d26('0x1d')][_0x1d26('0x20')];}}if(this[_0x1d26('0xf')]===_0x1d26('0x24')){_0x476479[_0x1d26('0x25')]=this[_0x1d26('0x26')]['id'];}else{_0x476479[_[_0x1d26('0x27')](this[_0x1d26('0xf')])+_0x1d26('0x28')]=this[_0x1d26('0x26')]['id'];}_0x476479[_['upperFirst'](this[_0x1d26('0xf')])+_0x1d26('0x29')]=this[_0x1d26('0x2a')]['id'];var _0x4f3b9b=this[_0x1d26('0x2a')];if(rpc[this[_0x1d26('0xf')]+_0x1d26('0x2b')]){if(this[_0x1d26('0xf')]===_0x1d26('0x10')){_0x476479['inReplyTo']=this[_0x1d26('0x1d')][_0x1d26('0x2c')];_0x476479[_0x1d26('0x2d')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0x1d26('0x2e')](_0x476479[_0x1d26('0x11')],_0x1d26('0x2f'),_0x1d26('0x30'))+_0x1d26('0x31');_0x476479['headers']={'Auto-Submitted':_0x1d26('0x32'),'X-Auto-Response-Suppress':_0x1d26('0x33'),'Precedence':'auto_reply'};return mailRpc[_0x1d26('0x34')](this['account'][_0x1d26('0x35')],_0x476479)[_0x1d26('0x36')](function(_0x1cf6f0){logger['info'](_0x1d26('0x37'),_0x55b990);_0x476479[_0x1d26('0x2c')]=_0x1cf6f0[_0x1d26('0x1d')][_0x1d26('0x2c')];return rpc[_0x47e6fa+_0x1d26('0x2b')][_0x1d26('0x38')](_0x476479);})[_0x1d26('0x36')](function(_0x21e727){logger[_0x1d26('0x13')](_0x1d26('0x14'),_0x55b990,JSON[_0x1d26('0x39')](_0x21e727));})[_0x1d26('0x3a')](function(_0x4ed525){logger[_0x1d26('0x3b')](_0x1d26('0x3c'),_0x55b990,JSON[_0x1d26('0x39')](_0x4ed525));})[_0x1d26('0x3d')](function(){Promise[_0x1d26('0x3e')]()[_0x1d26('0x36')](function(){if(_0x4c83ff[0x0]!=='2'||_0x4f3b9b[_0x1d26('0x3f')])return;return rpc[_0x47e6fa+_0x1d26('0x40')][_0x1d26('0x41')](_0x4f3b9b['id'],{'autoreplyExecuted':!![]})[_0x1d26('0x36')](function(_0x408517){logger['info'](_0x1d26('0x42'),_0x55b990,JSON['stringify'](_0x408517));})[_0x1d26('0x3a')](function(_0x23e5e3){logger[_0x1d26('0x3b')](_0x1d26('0x43'),_0x55b990,JSON[_0x1d26('0x39')](_0x23e5e3));});})[_0x1d26('0x36')](function(){_0x4ebee5[_0x1d26('0x19')]();});});}else{return rpc[this['channel']+_0x1d26('0x2b')]['create'](_0x476479)[_0x1d26('0x36')](function(){logger[_0x1d26('0x13')](_0x1d26('0x14'),_0x55b990,_0x476479['body']);})['catch'](function(_0x40c190){logger['error'](_0x1d26('0x14'),_0x55b990,JSON[_0x1d26('0x39')](_0x40c190));})['finally'](function(){Promise[_0x1d26('0x3e')]()[_0x1d26('0x36')](function(){if(_0x4c83ff[0x0]!=='2'||_0x4f3b9b[_0x1d26('0x3f')])return;return rpc[_0x47e6fa+_0x1d26('0x40')][_0x1d26('0x41')](_0x4f3b9b['id'],{'autoreplyExecuted':!![]})[_0x1d26('0x36')](function(_0x4244ee){logger[_0x1d26('0x13')](_0x1d26('0x42'),_0x55b990,JSON[_0x1d26('0x39')](_0x4244ee));})[_0x1d26('0x3a')](function(_0x492f09){logger[_0x1d26('0x3b')](_0x1d26('0x43'),_0x55b990,JSON[_0x1d26('0x39')](_0x492f09));});})[_0x1d26('0x36')](function(){_0x4ebee5[_0x1d26('0x19')]();});});}}}catch(_0x5a4dd6){logger[_0x1d26('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x55b990,JSON['stringify'](_0x5a4dd6));_0x4ebee5[_0x1d26('0x44')]();}};};
\ No newline at end of file
index 4d7cd77..e5f25a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4bb=['[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','finally','stop','error','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xa4bb,0xb7));var _0xba4b=function(_0xca0e00,_0xc6f713){_0xca0e00=_0xca0e00-0x0;var _0x2d1731=_0xa4bb[_0xca0e00];return _0x2d1731;};'use strict';var moment=require('moment');var logger=require(_0xba4b('0x0'))(_0xba4b('0x1'));var rpc={'chatInteraction':require(_0xba4b('0x2')),'openchannelInteraction':require(_0xba4b('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xba4b('0x4')),'faxInteraction':require(_0xba4b('0x5')),'whatsappInteraction':require(_0xba4b('0x6'))};exports[_0xba4b('0x7')]=function(_0x3f39d1,_0x4776e4,_0x4407ff,_0x314e02){return function(_0x1edb1d){try{logger[_0xba4b('0x8')](_0xba4b('0x9'),_0x3f39d1,_0x4776e4[0x0]);var _0x5e9f82={'closed':0x1,'closedAt':moment()[_0xba4b('0xa')](_0xba4b('0xb')),'closeReason':_0xba4b('0xc'),'disposition':_0x4776e4[0x0]};if(rpc[_0x314e02[_0xba4b('0xd')]+_0xba4b('0xe')]){rpc[_0x314e02[_0xba4b('0xd')]+_0xba4b('0xe')][_0xba4b('0xf')](_0x314e02[_0xba4b('0x10')]['id'],_0x5e9f82)[_0xba4b('0x11')](function(_0xb692b9){logger[_0xba4b('0x8')](_0xba4b('0x12'),_0x3f39d1,_0x314e02['interaction']['id']);})['catch'](function(_0x2910f5){logger['error'](_0xba4b('0x13'),_0x3f39d1,JSON[_0xba4b('0x14')](_0x2910f5));})[_0xba4b('0x15')](function(){_0x1edb1d[_0xba4b('0x16')]();});}}catch(_0x2db086){logger[_0xba4b('0x17')]('[%s][CLOSE]\x20%s',_0x3f39d1,JSON['stringify'](_0x2db086));_0x1edb1d['stop']();}};};
\ No newline at end of file
+var _0x7236=['[%s][CLOSE]\x20%s','stringify','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','catch','error','finally'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0x7236,0xdf));var _0x6723=function(_0x17d9f5,_0x2f8714){_0x17d9f5=_0x17d9f5-0x0;var _0x537368=_0x7236[_0x17d9f5];return _0x537368;};'use strict';var moment=require(_0x6723('0x0'));var logger=require('../../../../config/logger')(_0x6723('0x1'));var rpc={'chatInteraction':require(_0x6723('0x2')),'openchannelInteraction':require(_0x6723('0x3')),'smsInteraction':require(_0x6723('0x4')),'mailInteraction':require(_0x6723('0x5')),'faxInteraction':require(_0x6723('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x6723('0x7')]=function(_0x39a673,_0x701996,_0x4db566,_0x34ed14){return function(_0x3a0ef6){try{logger['info'](_0x6723('0x8'),_0x39a673,_0x701996[0x0]);var _0x4b870d={'closed':0x1,'closedAt':moment()['format'](_0x6723('0x9')),'closeReason':'system','disposition':_0x701996[0x0]};if(rpc[_0x34ed14[_0x6723('0xa')]+'Interaction']){rpc[_0x34ed14[_0x6723('0xa')]+_0x6723('0xb')][_0x6723('0xc')](_0x34ed14[_0x6723('0xd')]['id'],_0x4b870d)['then'](function(_0x14b85a){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x39a673,_0x34ed14['interaction']['id']);})[_0x6723('0xe')](function(_0x21fd4c){logger[_0x6723('0xf')]('[%s][CLOSE]\x20%s',_0x39a673,JSON['stringify'](_0x21fd4c));})[_0x6723('0x10')](function(){_0x3a0ef6['stop']();});}}catch(_0x287031){logger[_0x6723('0xf')](_0x6723('0x11'),_0x39a673,JSON[_0x6723('0x12')](_0x287031));_0x3a0ef6[_0x6723('0x13')]();}};};
\ No newline at end of file
index 4824f3c..e0ee9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee3c=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','result','providerName','providerResponse','endConversation','next','message','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x14bdfb,_0x7ebb3c){var _0x433477=function(_0x499bf6){while(--_0x499bf6){_0x14bdfb['push'](_0x14bdfb['shift']());}};_0x433477(++_0x7ebb3c);}(_0xee3c,0x14a));var _0xcee3=function(_0x3b1f1a,_0x35d458){_0x3b1f1a=_0x3b1f1a-0x0;var _0x49c954=_0xee3c[_0x3b1f1a];return _0x49c954;};'use strict';var _=require(_0xcee3('0x0'));var moment=require(_0xcee3('0x1'));var apiai=require(_0xcee3('0x2'));var md5=require(_0xcee3('0x3'));var utils=require(_0xcee3('0x4'));var logger=require(_0xcee3('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xcee3('0x6')),'mailMessage':require(_0xcee3('0x7')),'smsMessage':require(_0xcee3('0x8')),'faxMessage':require(_0xcee3('0x9')),'whatsappMessage':require(_0xcee3('0xa'))};exports[_0xcee3('0xb')]=function(_0x3b8ffe,_0x97f00e){return function(_0x22953c){try{if(!_[_0xcee3('0xc')](this[_0xcee3('0xd')][_0xcee3('0xe')])){logger[_0xcee3('0xf')](_0xcee3('0x10'),_0x3b8ffe,_0xcee3('0x11'));return _0x22953c['next']();}var _0x1ed6a6={'ContactId':this[_0xcee3('0x12')]['id'],'sentAt':moment()[_0xcee3('0x13')](_0xcee3('0x14')),'direction':_0xcee3('0x15')};if(this[_0xcee3('0x16')]==='sms'||this[_0xcee3('0x16')]===_0xcee3('0x17')){_0x1ed6a6[_0xcee3('0x18')]=this[_0xcee3('0xd')][_0xcee3('0x18')];}var _0x520ac6=this[_0xcee3('0x16')];if(_0x520ac6==='chat'){_0x1ed6a6['ChatWebsiteId']=this['account']['id'];}else{_0x1ed6a6[_[_0xcee3('0x19')](_0x520ac6)+_0xcee3('0x1a')]=this['account']['id'];}_0x1ed6a6[_['upperFirst'](_0x520ac6)+_0xcee3('0x1b')]=this['interaction']['id'];if(this[_0xcee3('0xd')]['created']){var _0x3471d1=_0x97f00e[0x2];if(!_[_0xcee3('0x1c')](_0x3471d1)){_0x1ed6a6['body']=utils[_0xcee3('0x1d')](_0x3471d1,this);return rpc[_0x520ac6+_0xcee3('0x1e')][_0xcee3('0x1f')](_0x1ed6a6)[_0xcee3('0x20')](function(_0x50bf6e){logger[_0xcee3('0xf')](_0xcee3('0x10'),_0x3b8ffe,_0x1ed6a6[_0xcee3('0x21')]);})[_0xcee3('0x22')](function(_0x52f4d7){logger[_0xcee3('0x23')](_0xcee3('0x10'),_0x3b8ffe,JSON[_0xcee3('0x24')](_0x52f4d7));})[_0xcee3('0x25')](function(){logger[_0xcee3('0xf')](_0xcee3('0x26'),_0x3b8ffe);_0x22953c[_0xcee3('0x27')]();});}else{logger[_0xcee3('0xf')](_0xcee3('0x28'),_0x3b8ffe);_0x22953c[_0xcee3('0x27')]();}}else{var _0x40dd10=this;var _0xa1efbf=apiai(_0x97f00e[0x0],{'language':_0x97f00e[0x1]||'en'});return _0xa1efbf[_0xcee3('0x29')](this['message'][_0xcee3('0x21')],{'sessionId':md5(this[_0xcee3('0xd')]['id'])})[_0xcee3('0x20')](function(_0x1ee247){_0x40dd10[_0xcee3('0x21')]['dialogflow']=_0x1ee247;_0x1ed6a6['body']=_0x1ee247[_0xcee3('0x2a')]['fulfillment']['speech'];_0x1ed6a6[_0xcee3('0x2b')]='dialogflow';_0x1ed6a6[_0xcee3('0x2c')]=JSON[_0xcee3('0x24')](_0x1ee247);return rpc[_0x520ac6+_0xcee3('0x1e')]['create'](_0x1ed6a6)[_0xcee3('0x20')](function(_0x47f32c){logger[_0xcee3('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x3b8ffe,_0x1ed6a6[_0xcee3('0x21')]);if(_0x1ee247[_0xcee3('0x2a')]['metadata'][_0xcee3('0x2d')]){_0x22953c[_0xcee3('0x2e')]();}else{_0x22953c['stop']();}})[_0xcee3('0x22')](function(_0x4ef9da){logger['error'](_0xcee3('0x10'),_0x3b8ffe,JSON['stringify'](_0x4ef9da));_0x22953c[_0xcee3('0x2e')]();});})[_0xcee3('0x22')](function(_0x375cab){logger[_0xcee3('0x23')](_0xcee3('0x10'),_0x3b8ffe,_0x375cab[_0xcee3('0x2f')]);_0x22953c[_0xcee3('0x2e')]();});}}catch(_0x5ce5be){logger[_0xcee3('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x3b8ffe,JSON[_0xcee3('0x24')](_0x5ce5be));_0x22953c[_0xcee3('0x27')]();}};};
\ No newline at end of file
+var _0x2d78=['upperFirst','InteractionId','created','isEmpty','body','Message','create','then','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','stringify','endConversation','error','message','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','AccountId'];(function(_0x221ecd,_0x1417f3){var _0x16964c=function(_0x52feba){while(--_0x52feba){_0x221ecd['push'](_0x221ecd['shift']());}};_0x16964c(++_0x1417f3);}(_0x2d78,0x199));var _0x82d7=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0x2d78[_0x5067db];return _0x2771e4;};'use strict';var _=require(_0x82d7('0x0'));var moment=require(_0x82d7('0x1'));var apiai=require(_0x82d7('0x2'));var md5=require('md5');var utils=require(_0x82d7('0x3'));var logger=require(_0x82d7('0x4'))(_0x82d7('0x5'));var rpc={'chatMessage':require(_0x82d7('0x6')),'openchannelMessage':require(_0x82d7('0x7')),'mailMessage':require(_0x82d7('0x8')),'smsMessage':require(_0x82d7('0x9')),'faxMessage':require(_0x82d7('0xa')),'whatsappMessage':require(_0x82d7('0xb'))};exports[_0x82d7('0xc')]=function(_0x57b0a2,_0x509103){return function(_0x835211){try{if(!_[_0x82d7('0xd')](this[_0x82d7('0xe')][_0x82d7('0xf')])){logger[_0x82d7('0x10')](_0x82d7('0x11'),_0x57b0a2,_0x82d7('0x12'));return _0x835211[_0x82d7('0x13')]();}var _0x84711={'ContactId':this[_0x82d7('0x14')]['id'],'sentAt':moment()[_0x82d7('0x15')](_0x82d7('0x16')),'direction':_0x82d7('0x17')};if(this[_0x82d7('0x18')]===_0x82d7('0x19')||this[_0x82d7('0x18')]==='whatsapp'){_0x84711[_0x82d7('0x1a')]=this['interaction'][_0x82d7('0x1a')];}var _0x552c2b=this[_0x82d7('0x18')];if(_0x552c2b===_0x82d7('0x1b')){_0x84711[_0x82d7('0x1c')]=this[_0x82d7('0x1d')]['id'];}else{_0x84711[_['upperFirst'](_0x552c2b)+_0x82d7('0x1e')]=this[_0x82d7('0x1d')]['id'];}_0x84711[_[_0x82d7('0x1f')](_0x552c2b)+_0x82d7('0x20')]=this[_0x82d7('0xe')]['id'];if(this[_0x82d7('0xe')][_0x82d7('0x21')]){var _0x368111=_0x509103[0x2];if(!_[_0x82d7('0x22')](_0x368111)){_0x84711[_0x82d7('0x23')]=utils['getMustacheRender'](_0x368111,this);return rpc[_0x552c2b+_0x82d7('0x24')][_0x82d7('0x25')](_0x84711)[_0x82d7('0x26')](function(_0x45a6a0){logger[_0x82d7('0x10')](_0x82d7('0x11'),_0x57b0a2,_0x84711[_0x82d7('0x23')]);})[_0x82d7('0x27')](function(_0x29d168){logger['error'](_0x82d7('0x11'),_0x57b0a2,JSON['stringify'](_0x29d168));})[_0x82d7('0x28')](function(){logger[_0x82d7('0x10')](_0x82d7('0x29'),_0x57b0a2);_0x835211['stop']();});}else{logger[_0x82d7('0x10')](_0x82d7('0x2a'),_0x57b0a2);_0x835211[_0x82d7('0x2b')]();}}else{var _0x37c1da=this;var _0x108e9d=apiai(_0x509103[0x0],{'language':_0x509103[0x1]||'en'});return _0x108e9d[_0x82d7('0x2c')](this['message'][_0x82d7('0x23')],{'sessionId':md5(this[_0x82d7('0xe')]['id'])})[_0x82d7('0x26')](function(_0x5abd25){_0x37c1da[_0x82d7('0x23')][_0x82d7('0x2d')]=_0x5abd25;_0x84711['body']=_0x5abd25[_0x82d7('0x2e')][_0x82d7('0x2f')][_0x82d7('0x30')];_0x84711[_0x82d7('0x31')]=_0x82d7('0x2d');_0x84711[_0x82d7('0x32')]=JSON[_0x82d7('0x33')](_0x5abd25);return rpc[_0x552c2b+'Message']['create'](_0x84711)[_0x82d7('0x26')](function(_0x101688){logger[_0x82d7('0x10')](_0x82d7('0x11'),_0x57b0a2,_0x84711[_0x82d7('0x23')]);if(_0x5abd25[_0x82d7('0x2e')]['metadata'][_0x82d7('0x34')]){_0x835211[_0x82d7('0x13')]();}else{_0x835211[_0x82d7('0x2b')]();}})['catch'](function(_0x1af023){logger[_0x82d7('0x35')](_0x82d7('0x11'),_0x57b0a2,JSON[_0x82d7('0x33')](_0x1af023));_0x835211[_0x82d7('0x13')]();});})[_0x82d7('0x27')](function(_0x58f23b){logger[_0x82d7('0x35')]('[%s][DIALOGFLOW]\x20%s',_0x57b0a2,_0x58f23b[_0x82d7('0x36')]);_0x835211[_0x82d7('0x13')]();});}}catch(_0x41f2c5){logger[_0x82d7('0x35')](_0x82d7('0x11'),_0x57b0a2,JSON[_0x82d7('0x33')](_0x41f2c5));_0x835211[_0x82d7('0x2b')]();}};};
\ No newline at end of file
index 5ab0c1f..c50bbfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d82=['clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','length','fulfillmentText','push','all','lodash','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x3d82,0x117));var _0x23d8=function(_0x59fdaa,_0x10a503){_0x59fdaa=_0x59fdaa-0x0;var _0x424463=_0x3d82[_0x59fdaa];return _0x424463;};'use strict';var _=require(_0x23d8('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x23d8('0x1'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x23d8('0x2'));var utils=require('./utils');var rpc={'chatMessage':require(_0x23d8('0x3')),'openchannelMessage':require(_0x23d8('0x4')),'mailMessage':require(_0x23d8('0x5')),'smsMessage':require(_0x23d8('0x6')),'faxMessage':require(_0x23d8('0x7')),'whatsappMessage':require(_0x23d8('0x8'))};function createMessage(_0x582fe5,_0xaa096a,_0x14a90d,_0x4f1a9b){return new Promise(function(_0x4c13ae,_0x1e64c3){var _0x3a7ef8=_[_0x23d8('0x9')](_0x14a90d);_0x3a7ef8[_0x23d8('0xa')]=_0x4f1a9b;return rpc[_0xaa096a+_0x23d8('0xb')][_0x23d8('0xc')](_0x3a7ef8)[_0x23d8('0xd')](function(){logger[_0x23d8('0xe')](_0x23d8('0xf'),_0x582fe5,_0x3a7ef8[_0x23d8('0xa')]);_0x4c13ae();})['catch'](function(_0x5bea33){logger[_0x23d8('0x10')](_0x23d8('0xf'),_0x582fe5,JSON[_0x23d8('0x11')](_0x5bea33));_0x1e64c3(_0x5bea33);});});}exports[_0x23d8('0x12')]=function(_0x3634b5,_0x232fbe){return function(_0x353ee7){try{if(!_[_0x23d8('0x13')](this[_0x23d8('0x14')][_0x23d8('0x15')])){logger[_0x23d8('0xe')](_0x23d8('0xf'),_0x3634b5,_0x23d8('0x16'));return _0x353ee7[_0x23d8('0x17')]();}var _0xd57b85={'ContactId':this[_0x23d8('0x18')]['id'],'sentAt':moment()[_0x23d8('0x19')](_0x23d8('0x1a')),'direction':_0x23d8('0x1b')};if(this[_0x23d8('0x1c')]===_0x23d8('0x1d')||this[_0x23d8('0x1c')]===_0x23d8('0x1e')){_0xd57b85[_0x23d8('0x1f')]=this[_0x23d8('0x14')]['phone'];}var _0x362edf=this[_0x23d8('0x1c')];if(_0x362edf===_0x23d8('0x20')){_0xd57b85['ChatWebsiteId']=this[_0x23d8('0x21')]['id'];}else{_0xd57b85[_[_0x23d8('0x22')](_0x362edf)+'AccountId']=this['account']['id'];}_0xd57b85[_['upperFirst'](_0x362edf)+_0x23d8('0x23')]=this[_0x23d8('0x14')]['id'];if(this[_0x23d8('0x14')][_0x23d8('0x24')]){var _0xa3a0e9=_0x232fbe[0x4];if(!_[_0x23d8('0x25')](_0xa3a0e9)){_0xd57b85[_0x23d8('0xa')]=utils[_0x23d8('0x26')](_0xa3a0e9,this);return rpc[_0x362edf+_0x23d8('0xb')][_0x23d8('0xc')](_0xd57b85)['then'](function(_0x377649){logger['info'](_0x23d8('0xf'),_0x3634b5,_0xd57b85[_0x23d8('0xa')]);})[_0x23d8('0x27')](function(_0x352ef5){logger[_0x23d8('0x10')](_0x23d8('0xf'),_0x3634b5,JSON[_0x23d8('0x11')](_0x352ef5));})[_0x23d8('0x28')](function(){logger[_0x23d8('0xe')](_0x23d8('0x29'),_0x3634b5);_0x353ee7[_0x23d8('0x2a')]();});}else{logger[_0x23d8('0xe')](_0x23d8('0x2b'),_0x3634b5);_0x353ee7['stop']();}}else{var _0x1dc25b=this;var _0x1fc9eb=_0x232fbe[0x2]['replace'](/\\n/g,'\x0a');var _0x793a3e={'credentials':{'private_key':_0x1fc9eb,'client_email':_0x232fbe[0x1]}};var _0x57fcb1=new dialogflow[(_0x23d8('0x2c'))](_0x793a3e);var _0x131495=_0x57fcb1['sessionPath'](_0x232fbe[0x0],md5(_0x1dc25b[_0x23d8('0x14')]['id']));var _0x24bc19={'session':_0x131495,'queryInput':{'text':{'text':_0x1dc25b[_0x23d8('0x2d')][_0x23d8('0xa')],'languageCode':_0x232fbe[0x3]||'en'}}};return _0x57fcb1[_0x23d8('0x2e')](_0x24bc19)['then'](function(_0xd267e1){if(_0xd267e1&&_0xd267e1['length']){_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x2f')]=_0xd267e1;var _0x412b46=_0xd267e1[0x0];var _0x2fd502=_0x412b46[_0x23d8('0x30')]['diagnosticInfo']&&_0x412b46[_0x23d8('0x30')][_0x23d8('0x31')][_0x23d8('0x32')]?_0x412b46[_0x23d8('0x30')][_0x23d8('0x31')][_0x23d8('0x32')]['end_conversation'][_0x23d8('0x33')]:![];_0x1dc25b[_0x23d8('0xa')]['DIALOGFLOWV2_ACTION']=_0x412b46['queryResult'][_0x23d8('0x34')];_0x1dc25b[_0x23d8('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x412b46[_0x23d8('0x30')][_0x23d8('0x35')];_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x36')]=_0x412b46['queryResult'][_0x23d8('0x31')]&&_0x412b46[_0x23d8('0x30')][_0x23d8('0x31')][_0x23d8('0x32')]?_0x412b46[_0x23d8('0x30')][_0x23d8('0x31')][_0x23d8('0x32')][_0x23d8('0x37')][_0x23d8('0x33')]:![];_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x38')]=_0x412b46[_0x23d8('0x30')]['intent']['name'];_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x39')]=_0x412b46[_0x23d8('0x30')]['intent']['displayName'];_0x1dc25b['body'][_0x23d8('0x3a')]=_0x412b46[_0x23d8('0x30')][_0x23d8('0x3b')][_0x23d8('0x3c')];_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x3d')]=_0x412b46[_0x23d8('0x30')][_0x23d8('0x3e')];_0x1dc25b[_0x23d8('0xa')][_0x23d8('0x3f')]=_0x412b46[_0x23d8('0x30')][_0x23d8('0x40')];_0x1dc25b['body'][_0x23d8('0x41')]=_0x412b46[_0x23d8('0x30')][_0x23d8('0x42')];_0xd57b85[_0x23d8('0x43')]=_0x23d8('0x2f');_0xd57b85['providerResponse']=JSON[_0x23d8('0x11')](_0xd267e1);var _0x2008c8=[];for(var _0xe35fac=0x0;_0xe35fac<_0xd267e1[_0x23d8('0x44')];_0xe35fac++){var _0x9974c3=_0xd267e1[_0xe35fac];if(_0x9974c3&&_0x9974c3[_0x23d8('0x30')]&&_0x9974c3['queryResult'][_0x23d8('0x45')]){_0x2008c8[_0x23d8('0x46')](createMessage(_0x3634b5,_0x362edf,_0xd57b85,_0x9974c3[_0x23d8('0x30')]['fulfillmentText']));}}return Promise[_0x23d8('0x47')](_0x2008c8)['then'](function(){if(_0x2fd502){_0x353ee7[_0x23d8('0x17')]();}else{_0x353ee7[_0x23d8('0x2a')]();}})[_0x23d8('0x27')](function(_0x123cfc){logger[_0x23d8('0x10')](_0x23d8('0xf'),_0x3634b5,JSON[_0x23d8('0x11')](_0x123cfc));_0x353ee7['next']();});}})[_0x23d8('0x27')](function(_0x17f7fa){logger[_0x23d8('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x3634b5,_0x17f7fa['message']);_0x353ee7['next']();});}}catch(_0x152e1b){logger[_0x23d8('0x10')](_0x23d8('0xf'),_0x3634b5,JSON[_0x23d8('0x11')](_0x152e1b));_0x353ee7[_0x23d8('0x2a')]();}};};
\ No newline at end of file
+var _0xd0e7=['stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','interaction','phone','chat','upperFirst','AccountId','account','isEmpty','getMustacheRender','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','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s'];(function(_0x39cbe4,_0x4a7958){var _0xe76ba7=function(_0x332a08){while(--_0x332a08){_0x39cbe4['push'](_0x39cbe4['shift']());}};_0xe76ba7(++_0x4a7958);}(_0xd0e7,0x10d));var _0x7d0e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd0e7[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x7d0e('0x0'));var dialogflow=require(_0x7d0e('0x1'));var md5=require(_0x7d0e('0x2'));var moment=require(_0x7d0e('0x3'));var Promise=require('bluebird');var logger=require(_0x7d0e('0x4'))(_0x7d0e('0x5'));var utils=require(_0x7d0e('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7d0e('0x7')),'smsMessage':require(_0x7d0e('0x8')),'faxMessage':require(_0x7d0e('0x9')),'whatsappMessage':require(_0x7d0e('0xa'))};function createMessage(_0x17303e,_0x3559be,_0x5f20b6,_0x16b3dd){return new Promise(function(_0x302ce7,_0x3a84da){var _0x43ded3=_[_0x7d0e('0xb')](_0x5f20b6);_0x43ded3[_0x7d0e('0xc')]=_0x16b3dd;return rpc[_0x3559be+'Message'][_0x7d0e('0xd')](_0x43ded3)[_0x7d0e('0xe')](function(){logger[_0x7d0e('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x17303e,_0x43ded3[_0x7d0e('0xc')]);_0x302ce7();})[_0x7d0e('0x10')](function(_0x53b88d){logger[_0x7d0e('0x11')](_0x7d0e('0x12'),_0x17303e,JSON[_0x7d0e('0x13')](_0x53b88d));_0x3a84da(_0x53b88d);});});}exports[_0x7d0e('0x14')]=function(_0xa94940,_0x7d24e6){return function(_0x44d7dc){try{if(!_[_0x7d0e('0x15')](this['interaction'][_0x7d0e('0x16')])){logger[_0x7d0e('0xf')](_0x7d0e('0x12'),_0xa94940,_0x7d0e('0x17'));return _0x44d7dc[_0x7d0e('0x18')]();}var _0x5dd72c={'ContactId':this[_0x7d0e('0x19')]['id'],'sentAt':moment()[_0x7d0e('0x1a')](_0x7d0e('0x1b')),'direction':'out'};if(this[_0x7d0e('0x1c')]===_0x7d0e('0x1d')||this[_0x7d0e('0x1c')]===_0x7d0e('0x1e')){_0x5dd72c['phone']=this[_0x7d0e('0x1f')][_0x7d0e('0x20')];}var _0x46fe39=this[_0x7d0e('0x1c')];if(_0x46fe39===_0x7d0e('0x21')){_0x5dd72c['ChatWebsiteId']=this['account']['id'];}else{_0x5dd72c[_[_0x7d0e('0x22')](_0x46fe39)+_0x7d0e('0x23')]=this[_0x7d0e('0x24')]['id'];}_0x5dd72c[_['upperFirst'](_0x46fe39)+'InteractionId']=this[_0x7d0e('0x1f')]['id'];if(this[_0x7d0e('0x1f')]['created']){var _0x1bbc76=_0x7d24e6[0x4];if(!_[_0x7d0e('0x25')](_0x1bbc76)){_0x5dd72c[_0x7d0e('0xc')]=utils[_0x7d0e('0x26')](_0x1bbc76,this);return rpc[_0x46fe39+'Message'][_0x7d0e('0xd')](_0x5dd72c)['then'](function(_0x1a2715){logger[_0x7d0e('0xf')](_0x7d0e('0x12'),_0xa94940,_0x5dd72c['body']);})[_0x7d0e('0x10')](function(_0x8a4450){logger[_0x7d0e('0x11')](_0x7d0e('0x12'),_0xa94940,JSON[_0x7d0e('0x13')](_0x8a4450));})[_0x7d0e('0x27')](function(){logger['info'](_0x7d0e('0x28'),_0xa94940);_0x44d7dc[_0x7d0e('0x29')]();});}else{logger[_0x7d0e('0xf')](_0x7d0e('0x2a'),_0xa94940);_0x44d7dc[_0x7d0e('0x29')]();}}else{var _0x52ad4b=this;var _0x67d62e=_0x7d24e6[0x2][_0x7d0e('0x2b')](/\\n/g,'\x0a');var _0x343e90={'credentials':{'private_key':_0x67d62e,'client_email':_0x7d24e6[0x1]}};var _0x2bc2b0=new dialogflow[(_0x7d0e('0x2c'))](_0x343e90);var _0x3ea02e=_0x2bc2b0[_0x7d0e('0x2d')](_0x7d24e6[0x0],md5(_0x52ad4b['interaction']['id']));var _0x28bf3f={'session':_0x3ea02e,'queryInput':{'text':{'text':_0x52ad4b[_0x7d0e('0x2e')][_0x7d0e('0xc')],'languageCode':_0x7d24e6[0x3]||'en'}}};return _0x2bc2b0[_0x7d0e('0x2f')](_0x28bf3f)[_0x7d0e('0xe')](function(_0x30b31a){if(_0x30b31a&&_0x30b31a[_0x7d0e('0x30')]){_0x52ad4b[_0x7d0e('0xc')][_0x7d0e('0x31')]=_0x30b31a;var _0x59a93e=_0x30b31a[0x0];var _0x2f9c2d=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x33')]&&_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x33')][_0x7d0e('0x34')]?_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x33')][_0x7d0e('0x34')][_0x7d0e('0x35')][_0x7d0e('0x36')]:![];_0x52ad4b[_0x7d0e('0xc')][_0x7d0e('0x37')]=_0x59a93e[_0x7d0e('0x32')]['action'];_0x52ad4b[_0x7d0e('0xc')][_0x7d0e('0x38')]=_0x59a93e['queryResult']['allRequiredParamsPresent'];_0x52ad4b[_0x7d0e('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x33')]&&_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x33')]['fields']?_0x59a93e[_0x7d0e('0x32')]['diagnosticInfo']['fields']['end_conversation'][_0x7d0e('0x36')]:![];_0x52ad4b[_0x7d0e('0xc')][_0x7d0e('0x39')]=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x3a')][_0x7d0e('0x3b')];_0x52ad4b['body'][_0x7d0e('0x3c')]=_0x59a93e['queryResult'][_0x7d0e('0x3a')][_0x7d0e('0x3d')];_0x52ad4b['body'][_0x7d0e('0x3e')]=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x3a')][_0x7d0e('0x3f')];_0x52ad4b[_0x7d0e('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x59a93e['queryResult']['languageCode'];_0x52ad4b['body'][_0x7d0e('0x40')]=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x41')];_0x52ad4b[_0x7d0e('0xc')]['DIALOGFLOWV2_SCORE']=_0x59a93e[_0x7d0e('0x32')][_0x7d0e('0x42')];_0x5dd72c[_0x7d0e('0x43')]=_0x7d0e('0x31');_0x5dd72c[_0x7d0e('0x44')]=JSON['stringify'](_0x30b31a);var _0x140be3=[];for(var _0x1886bf=0x0;_0x1886bf<_0x30b31a[_0x7d0e('0x30')];_0x1886bf++){var _0x24b8e2=_0x30b31a[_0x1886bf];if(_0x24b8e2&&_0x24b8e2[_0x7d0e('0x32')]&&_0x24b8e2[_0x7d0e('0x32')]['fulfillmentText']){_0x140be3[_0x7d0e('0x45')](createMessage(_0xa94940,_0x46fe39,_0x5dd72c,_0x24b8e2[_0x7d0e('0x32')][_0x7d0e('0x46')]));}}return Promise[_0x7d0e('0x47')](_0x140be3)['then'](function(){if(_0x2f9c2d){_0x44d7dc[_0x7d0e('0x18')]();}else{_0x44d7dc[_0x7d0e('0x29')]();}})[_0x7d0e('0x10')](function(_0x23a51d){logger[_0x7d0e('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xa94940,JSON[_0x7d0e('0x13')](_0x23a51d));_0x44d7dc['next']();});}})[_0x7d0e('0x10')](function(_0x38e54a){logger[_0x7d0e('0x11')](_0x7d0e('0x12'),_0xa94940,_0x38e54a[_0x7d0e('0x2e')]);_0x44d7dc[_0x7d0e('0x18')]();});}}catch(_0x1c0db0){logger[_0x7d0e('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xa94940,JSON['stringify'](_0x1c0db0));_0x44d7dc['stop']();}};};
\ No newline at end of file
index 117d71f..8d52a12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc86f=['validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','map','message','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','[%s][GOTOIF]\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc86f,0x117));var _0xfc86=function(_0x3d5d40,_0x143d30){_0x3d5d40=_0x3d5d40-0x0;var _0x5ddfa8=_0xc86f[_0x3d5d40];return _0x5ddfa8;};'use strict';var schema=require(_0xfc86('0x0'));var _=require('lodash');var htmlToText=require(_0xfc86('0x1'));var utils=require(_0xfc86('0x2'));var logger=require(_0xfc86('0x3'))(_0xfc86('0x4'));var gotoif=schema({'condition':{'type':_0xfc86('0x5'),'required':!![],'message':_0xfc86('0x6')},'priorityTrue':{'type':_0xfc86('0x7'),'message':_0xfc86('0x8')},'priorityFalse':{'type':_0xfc86('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xfc86('0x9')]=function(_0x46692a,_0x4f1454){return function(_0x228d80){try{var _0x5c879b={'condition':htmlToText[_0xfc86('0xa')](utils[_0xfc86('0xb')](_0x4f1454[0x0],this),{'wordwrap':![]})[_0xfc86('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4f1454[0x1],'priorityFalse':_0x4f1454[0x2]};var _0xaf4a3d=gotoif['validate'](_0x5c879b,{'typecast':!![]});if(_0xaf4a3d[_0xfc86('0xd')]){logger[_0xfc86('0xe')]('[%s][GOTOIF]\x20%s',_0x46692a,_[_0xfc86('0xf')](_0xaf4a3d,_0xfc86('0x10'))[_0xfc86('0x11')](',\x20'));_0x228d80[_0xfc86('0x12')]();}else{try{var _0x1d3b89=eval('('+_0x5c879b[_0xfc86('0x13')]+')');var _0x289cb6=_0x1d3b89?_0x5c879b[_0xfc86('0x14')]:_0x5c879b[_0xfc86('0x15')];logger[_0xfc86('0x16')](_0xfc86('0x17'),_0x46692a,_0x5c879b['condition'],_0x1d3b89,_0x289cb6||_0xfc86('0x18'));if(_0x289cb6){var _0xb460b3=_[_0xfc86('0x19')](_0x228d80['rules'](),{'p':_0x289cb6});if(_0xb460b3>=0x0){logger[_0xfc86('0x16')](_0xfc86('0x1a'),_0x46692a,_0x289cb6||'next',_0xb460b3);_0x228d80['next'](_0xb460b3);}else{logger[_0xfc86('0x16')](_0xfc86('0x1b'),_0x46692a,_0x289cb6||_0xfc86('0x18'));_0x228d80[_0xfc86('0x12')]();}}else{_0x228d80[_0xfc86('0x18')]();}}catch(_0x318e50){logger[_0xfc86('0xe')](_0xfc86('0x1c'),_0x46692a,_0x318e50[_0xfc86('0x10')]);_0x228d80['stop']();}}}catch(_0x2ff34e){logger[_0xfc86('0xe')](_0xfc86('0x1d'),_0x46692a,JSON[_0xfc86('0x1e')](_0x2ff34e));_0x228d80[_0xfc86('0x12')]();}};};
\ No newline at end of file
+var _0x7a0c=['[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0x7a0c,0xcb));var _0xc7a0=function(_0x406985,_0x3dd98e){_0x406985=_0x406985-0x0;var _0x259139=_0x7a0c[_0x406985];return _0x259139;};'use strict';var schema=require(_0xc7a0('0x0'));var _=require('lodash');var htmlToText=require(_0xc7a0('0x1'));var utils=require('./utils');var logger=require(_0xc7a0('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xc7a0('0x3'),'required':!![],'message':_0xc7a0('0x4')},'priorityTrue':{'type':_0xc7a0('0x5'),'message':_0xc7a0('0x6')},'priorityFalse':{'type':_0xc7a0('0x5'),'message':_0xc7a0('0x7')}});exports['consequence']=function(_0x13a182,_0x158a43){return function(_0x3d9f29){try{var _0x2b611a={'condition':htmlToText['fromString'](utils[_0xc7a0('0x8')](_0x158a43[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x158a43[0x1],'priorityFalse':_0x158a43[0x2]};var _0x1646a4=gotoif['validate'](_0x2b611a,{'typecast':!![]});if(_0x1646a4['length']){logger[_0xc7a0('0x9')](_0xc7a0('0xa'),_0x13a182,_[_0xc7a0('0xb')](_0x1646a4,'message')[_0xc7a0('0xc')](',\x20'));_0x3d9f29['stop']();}else{try{var _0x2c3444=eval('('+_0x2b611a[_0xc7a0('0xd')]+')');var _0xe61bf3=_0x2c3444?_0x2b611a[_0xc7a0('0xe')]:_0x2b611a['priorityFalse'];logger['info'](_0xc7a0('0xf'),_0x13a182,_0x2b611a[_0xc7a0('0xd')],_0x2c3444,_0xe61bf3||_0xc7a0('0x10'));if(_0xe61bf3){var _0x37733=_[_0xc7a0('0x11')](_0x3d9f29[_0xc7a0('0x12')](),{'p':_0xe61bf3});if(_0x37733>=0x0){logger[_0xc7a0('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x13a182,_0xe61bf3||_0xc7a0('0x10'),_0x37733);_0x3d9f29[_0xc7a0('0x10')](_0x37733);}else{logger[_0xc7a0('0x13')](_0xc7a0('0x14'),_0x13a182,_0xe61bf3||_0xc7a0('0x10'));_0x3d9f29[_0xc7a0('0x15')]();}}else{_0x3d9f29['next']();}}catch(_0x48faa3){logger[_0xc7a0('0x9')](_0xc7a0('0x16'),_0x13a182,_0x48faa3[_0xc7a0('0x17')]);_0x3d9f29[_0xc7a0('0x15')]();}}}catch(_0x2e4a44){logger[_0xc7a0('0x9')](_0xc7a0('0xa'),_0x13a182,JSON[_0xc7a0('0x18')](_0x2e4a44));_0x3d9f29['stop']();}};};
\ No newline at end of file
index 5567f9f..6230651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf57e=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x591a5b,_0x5b92d2){var _0x374197=function(_0x9fb8e5){while(--_0x9fb8e5){_0x591a5b['push'](_0x591a5b['shift']());}};_0x374197(++_0x5b92d2);}(_0xf57e,0x8f));var _0xef57=function(_0x4492fe,_0x356466){_0x4492fe=_0x4492fe-0x0;var _0x2f7c4e=_0xf57e[_0x4492fe];return _0x2f7c4e;};'use strict';var schema=require('validate');var _=require(_0xef57('0x0'));var logger=require(_0xef57('0x1'))(_0xef57('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xef57('0x3')}});exports[_0xef57('0x4')]=function(_0x3229fa,_0x49487e){return function(_0xb8f43e){try{var _0x2910fe={'priority':_0x49487e[0x0]};var _0x285053=gotop[_0xef57('0x5')](_0x2910fe,{'typecast':!![]});if(_0x285053['length']){logger['error'](_0xef57('0x6'),_0x3229fa,_[_0xef57('0x7')](_0x285053,_0xef57('0x8'))['join'](',\x20'));_0xb8f43e[_0xef57('0x9')]();}else{logger[_0xef57('0xa')](_0xef57('0xb'),_0x3229fa,_0x2910fe[_0xef57('0xc')]);if(_0x2910fe[_0xef57('0xc')]){var _0x4cfb3b=_[_0xef57('0xd')](_0xb8f43e[_0xef57('0xe')](),{'p':_0x2910fe[_0xef57('0xc')]});if(_0x4cfb3b>=0x0){logger[_0xef57('0xa')](_0xef57('0xf'),_0x3229fa,_0x2910fe[_0xef57('0xc')]||_0xef57('0x10'),_0x4cfb3b);_0xb8f43e[_0xef57('0x10')](_0x4cfb3b);}else{logger[_0xef57('0xa')](_0xef57('0x11'),_0x3229fa,_0x2910fe[_0xef57('0xc')]||'next');_0xb8f43e['stop']();}}else{_0xb8f43e[_0xef57('0x10')]();}}}catch(_0x35aee9){logger[_0xef57('0x12')](_0xef57('0x6'),_0x3229fa,JSON[_0xef57('0x13')](_0x35aee9));_0xb8f43e[_0xef57('0x9')]();}};};
\ No newline at end of file
+var _0x920b=['stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','message','join'];(function(_0x391ead,_0x426e09){var _0x5933c7=function(_0x4fa2d8){while(--_0x4fa2d8){_0x391ead['push'](_0x391ead['shift']());}};_0x5933c7(++_0x426e09);}(_0x920b,0x173));var _0xb920=function(_0x445c61,_0x61f757){_0x445c61=_0x445c61-0x0;var _0x36d4b9=_0x920b[_0x445c61];return _0x36d4b9;};'use strict';var schema=require(_0xb920('0x0'));var _=require(_0xb920('0x1'));var logger=require('../../../../config/logger')(_0xb920('0x2'));var gotop=schema({'priority':{'type':_0xb920('0x3'),'required':!![],'message':_0xb920('0x4')}});exports[_0xb920('0x5')]=function(_0x418969,_0x3a2376){return function(_0x39af74){try{var _0x199fb5={'priority':_0x3a2376[0x0]};var _0x1fb1fe=gotop['validate'](_0x199fb5,{'typecast':!![]});if(_0x1fb1fe['length']){logger['error'](_0xb920('0x6'),_0x418969,_['map'](_0x1fb1fe,_0xb920('0x7'))[_0xb920('0x8')](',\x20'));_0x39af74[_0xb920('0x9')]();}else{logger['info'](_0xb920('0xa'),_0x418969,_0x199fb5[_0xb920('0xb')]);if(_0x199fb5[_0xb920('0xb')]){var _0x53b4fa=_[_0xb920('0xc')](_0x39af74[_0xb920('0xd')](),{'p':_0x199fb5[_0xb920('0xb')]});if(_0x53b4fa>=0x0){logger[_0xb920('0xe')](_0xb920('0xf'),_0x418969,_0x199fb5[_0xb920('0xb')]||'next',_0x53b4fa);_0x39af74[_0xb920('0x10')](_0x53b4fa);}else{logger[_0xb920('0xe')](_0xb920('0x11'),_0x418969,_0x199fb5[_0xb920('0xb')]||_0xb920('0x10'));_0x39af74[_0xb920('0x9')]();}}else{_0x39af74[_0xb920('0x10')]();}}}catch(_0x28b93b){logger[_0xb920('0x12')](_0xb920('0x6'),_0x418969,JSON[_0xb920('0x13')](_0x28b93b));_0x39af74['stop']();}};};
\ No newline at end of file
index 22d59fa..5880579 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9f0=['error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch'];(function(_0x251fa8,_0x438d42){var _0x3d89e9=function(_0x5f91dc){while(--_0x5f91dc){_0x251fa8['push'](_0x251fa8['shift']());}};_0x3d89e9(++_0x438d42);}(_0xa9f0,0x153));var _0x0a9f=function(_0x565996,_0x3f8953){_0x565996=_0x565996-0x0;var _0x3b5a72=_0xa9f0[_0x565996];return _0x3b5a72;};'use strict';var _=require(_0x0a9f('0x0'));var utils=require('./utils');var logger=require(_0x0a9f('0x1'))(_0x0a9f('0x2'));var rpc={'chatMessage':require(_0x0a9f('0x3')),'openchannelMessage':require(_0x0a9f('0x4')),'mailMessage':require(_0x0a9f('0x5')),'smsMessage':require(_0x0a9f('0x6')),'faxMessage':require(_0x0a9f('0x7')),'whatsappMessage':require(_0x0a9f('0x8'))};exports['consequence']=function(_0x881644,_0x54579c){return function(_0x19b209){try{var _0x58e827={'body':utils[_0x0a9f('0x9')](_0x54579c[0x0],this),'ContactId':this[_0x0a9f('0xa')]['id']};if(this[_0x0a9f('0xb')]===_0x0a9f('0xc')){_0x58e827['ChatWebsiteId']=this[_0x0a9f('0xd')]['id'];}else{_0x58e827[_[_0x0a9f('0xe')](this[_0x0a9f('0xb')])+_0x0a9f('0xf')]=this['account']['id'];}_0x58e827[_['upperFirst'](this[_0x0a9f('0xb')])+_0x0a9f('0x10')]=this[_0x0a9f('0x11')]['id'];if(rpc[this[_0x0a9f('0xb')]+_0x0a9f('0x12')]){return rpc[this[_0x0a9f('0xb')]+_0x0a9f('0x12')][_0x0a9f('0x13')](_0x58e827)[_0x0a9f('0x14')](function(_0x1340e3){logger[_0x0a9f('0x15')](_0x0a9f('0x16'),_0x881644,_0x58e827[_0x0a9f('0x17')]);_0x19b209['next']();})[_0x0a9f('0x18')](function(_0x482d30){logger[_0x0a9f('0x19')](_0x0a9f('0x16'),_0x881644,JSON[_0x0a9f('0x1a')](_0x482d30));_0x19b209[_0x0a9f('0x1b')]();});}}catch(_0x54dec9){logger['error']('[%s][MESSAGE]\x20%s',_0x881644,JSON['stringify'](_0x54dec9));_0x19b209[_0x0a9f('0x1b')]();}};};
\ No newline at end of file
+var _0x2996=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2996,0x1ea));var _0x6299=function(_0x2f74c7,_0x110671){_0x2f74c7=_0x2f74c7-0x0;var _0x208b91=_0x2996[_0x2f74c7];return _0x208b91;};'use strict';var _=require(_0x6299('0x0'));var utils=require(_0x6299('0x1'));var logger=require(_0x6299('0x2'))(_0x6299('0x3'));var rpc={'chatMessage':require(_0x6299('0x4')),'openchannelMessage':require(_0x6299('0x5')),'mailMessage':require(_0x6299('0x6')),'smsMessage':require(_0x6299('0x7')),'faxMessage':require(_0x6299('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x517653,_0x294771){return function(_0x1c012d){try{var _0x4bfd3d={'body':utils[_0x6299('0x9')](_0x294771[0x0],this),'ContactId':this[_0x6299('0xa')]['id']};if(this[_0x6299('0xb')]===_0x6299('0xc')){_0x4bfd3d[_0x6299('0xd')]=this[_0x6299('0xe')]['id'];}else{_0x4bfd3d[_['upperFirst'](this[_0x6299('0xb')])+_0x6299('0xf')]=this[_0x6299('0xe')]['id'];}_0x4bfd3d[_[_0x6299('0x10')](this[_0x6299('0xb')])+_0x6299('0x11')]=this[_0x6299('0x12')]['id'];if(rpc[this[_0x6299('0xb')]+_0x6299('0x13')]){return rpc[this[_0x6299('0xb')]+_0x6299('0x13')][_0x6299('0x14')](_0x4bfd3d)[_0x6299('0x15')](function(_0x3bd9e1){logger['info'](_0x6299('0x16'),_0x517653,_0x4bfd3d[_0x6299('0x17')]);_0x1c012d[_0x6299('0x18')]();})[_0x6299('0x19')](function(_0x50f167){logger['error']('[%s][MESSAGE]\x20%s',_0x517653,JSON[_0x6299('0x1a')](_0x50f167));_0x1c012d[_0x6299('0x1b')]();});}}catch(_0x4ebb9d){logger[_0x6299('0x1c')](_0x6299('0x16'),_0x517653,JSON[_0x6299('0x1a')](_0x4ebb9d));_0x1c012d[_0x6299('0x1b')]();}};};
\ No newline at end of file
index c721f64..f273fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c3d=['consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger','routing'];(function(_0x1cbe6b,_0x4d7ed3){var _0x262c9b=function(_0x30136c){while(--_0x30136c){_0x1cbe6b['push'](_0x1cbe6b['shift']());}};_0x262c9b(++_0x4d7ed3);}(_0x6c3d,0x96));var _0xd6c3=function(_0x14dc4c,_0x284d70){_0x14dc4c=_0x14dc4c-0x0;var _0x417c53=_0x6c3d[_0x14dc4c];return _0x417c53;};'use strict';var utils=require(_0xd6c3('0x0'));var logger=require(_0xd6c3('0x1'))(_0xd6c3('0x2'));exports[_0xd6c3('0x3')]=function(_0x36b3b3,_0x43b045){return function(_0x18699a){try{logger['info'](_0xd6c3('0x4'),_0x36b3b3,utils[_0xd6c3('0x5')](_0x43b045[0x0],this));_0x18699a[_0xd6c3('0x6')]();}catch(_0x3e730b){logger[_0xd6c3('0x7')](_0xd6c3('0x4'),_0x36b3b3,JSON[_0xd6c3('0x8')](_0x3e730b));_0x18699a['stop']();}};};
\ No newline at end of file
+var _0x5e64=['stop','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','next','error'];(function(_0xb59baa,_0x499c25){var _0x16ed15=function(_0x249309){while(--_0x249309){_0xb59baa['push'](_0xb59baa['shift']());}};_0x16ed15(++_0x499c25);}(_0x5e64,0x6a));var _0x45e6=function(_0x2f381b,_0x4bc41c){_0x2f381b=_0x2f381b-0x0;var _0x367ffc=_0x5e64[_0x2f381b];return _0x367ffc;};'use strict';var utils=require('./utils');var logger=require(_0x45e6('0x0'))(_0x45e6('0x1'));exports['consequence']=function(_0x4c6caf,_0x154a0b){return function(_0x1eb1c6){try{logger[_0x45e6('0x2')](_0x45e6('0x3'),_0x4c6caf,utils['getMustacheRender'](_0x154a0b[0x0],this));_0x1eb1c6[_0x45e6('0x4')]();}catch(_0x2f0c60){logger[_0x45e6('0x5')](_0x45e6('0x3'),_0x4c6caf,JSON['stringify'](_0x2f0c60));_0x1eb1c6[_0x45e6('0x6')]();}};};
\ No newline at end of file
index 10d27ce..fc0a893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d8=['ioredis','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','body','update','error','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue'];(function(_0x5a9b6c,_0x30ccd0){var _0x72bed=function(_0x1468ea){while(--_0x1468ea){_0x5a9b6c['push'](_0x5a9b6c['shift']());}};_0x72bed(++_0x30ccd0);}(_0xd3d8,0x131));var _0x8d3d=function(_0x565d34,_0x4176da){_0x565d34=_0x565d34-0x0;var _0x3751e7=_0xd3d8[_0x565d34];return _0x3751e7;};'use strict';var schema=require(_0x8d3d('0x0'));var _=require(_0x8d3d('0x1'));var util=require('util');var seqqueue=require(_0x8d3d('0x2'));var moment=require('moment');var Redis=require(_0x8d3d('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x8d3d('0x4'));var strategy=require(_0x8d3d('0x5'));config[_0x8d3d('0x6')]=_[_0x8d3d('0x7')](config[_0x8d3d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x8d3d('0x8'))(new Redis(config[_0x8d3d('0x6')]));var attributes=['id','queue_id',_0x8d3d('0x9'),_0x8d3d('0xa'),_0x8d3d('0xb'),_0x8d3d('0xc')];function emit(_0x34f290,_0x2e977e,_0x1cb458){io['to'](_0x34f290)['emit'](_0x2e977e,_0x1cb458);}function emitChannelQueueInteraction(_0x475339,_0x20d76d,_0x5912d1,_0x47bc1b,_0x133cce,_0x1994c3,_0x45828f,_0x540f1e){var _0x405e6b=_[_0x8d3d('0xd')](_0x5912d1);_0x405e6b[_0x8d3d('0xe')]=_0x540f1e;_0x405e6b[_0x8d3d('0xa')]=_0x20d76d;_0x405e6b[_0x8d3d('0x9')]=_0x47bc1b;_0x405e6b['id']=_0x133cce;if(_0x1994c3){attributes[_0x8d3d('0xf')](_[_0x8d3d('0x10')](_0x475339)+_0x8d3d('0x11'));_0x45828f[util[_0x8d3d('0x12')](_0x8d3d('0x13'),_0x475339)][_0x133cce]=_[_0x8d3d('0x14')](_0x405e6b,attributes);}else{delete _0x45828f[util[_0x8d3d('0x12')](_0x8d3d('0x13'),_0x475339)][_0x133cce];}emit(util[_0x8d3d('0x12')](_0x8d3d('0x15'),_0x475339,_0x20d76d),util[_0x8d3d('0x12')](_0x8d3d('0x16'),_0x475339,_0x1994c3?'save':_0x8d3d('0x17')),_[_0x8d3d('0x14')](_0x405e6b,attributes));}var rpc={'openchannelQueueReport':require(_0x8d3d('0x18')),'mailQueueReport':require(_0x8d3d('0x19')),'chatQueueReport':require(_0x8d3d('0x1a')),'smsQueueReport':require(_0x8d3d('0x1b')),'faxQueueReport':require(_0x8d3d('0x1c')),'whatsappQueueReport':require(_0x8d3d('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x8d3d('0x1e')},'timeout':{'type':'number','message':_0x8d3d('0x1f')}});function startRouting(_0x373fe9,_0x3a72f1,_0x3cad98,_0x1e7ab3){if(_0x373fe9&&_0x3a72f1&&_0x3cad98){_0x3a72f1['waiting']+=0x1;var _0xe3f9b3={'uniqueid':_0x373fe9,'from':_0x3cad98['body']?_0x3cad98['body'][_0x8d3d('0xb')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3cad98['contact']?_0x3cad98['contact']['id']:null,'ListId':_0x3cad98[_0x8d3d('0x20')]?_0x3cad98['list']['id']:null};_0xe3f9b3[_[_0x8d3d('0x21')](_0x3cad98[_0x8d3d('0x22')])+_0x8d3d('0x23')]=_0x3a72f1['id']||null;_0xe3f9b3[_[_0x8d3d('0x21')](_0x3cad98[_0x8d3d('0x22')])+_0x8d3d('0x11')]=_0x3cad98['interaction']?_0x3cad98[_0x8d3d('0x24')]['id']:null;_0xe3f9b3[_[_0x8d3d('0x21')](_0x3cad98[_0x8d3d('0x22')])+'MessageId']=_0x3cad98[_0x8d3d('0x25')]?_0x3cad98[_0x8d3d('0x25')]['id']:null;_0xe3f9b3[_['upperFirst'](_0x3cad98[_0x8d3d('0x22')])+(_0x3cad98[_0x8d3d('0x22')]!==_0x8d3d('0x26')?_0x8d3d('0x27'):_0x8d3d('0x28'))]=_0x3cad98[_0x8d3d('0x9')]?_0x3cad98[_0x8d3d('0x9')]['id']:null;logger[_0x8d3d('0x29')](util[_0x8d3d('0x12')](_0x8d3d('0x2a'),_0x373fe9,_0x3a72f1[_0x8d3d('0x2b')]));emitChannelQueueInteraction(_0x3cad98['channel'],_0x3a72f1[_0x8d3d('0x2b')],_0xe3f9b3,_0x3cad98[_0x8d3d('0x9')][_0x8d3d('0x2b')],_0x3cad98[_0x8d3d('0x25')]['id'],!![],_0x1e7ab3,_0x3a72f1['id']);if(rpc[_0x3cad98[_0x8d3d('0x22')]+_0x8d3d('0x2c')]){return rpc[_0x3cad98['channel']+'QueueReport']['create'](_0xe3f9b3)[_0x8d3d('0x2d')](function(_0x508633){logger['error'](_0x8d3d('0x2e'));});}}}function stopRouting(_0x5a107d,_0x1d7501,_0x452f0f,_0x4934e5){if(_0x5a107d&&_0x1d7501){_0x1d7501[_0x8d3d('0x2f')]-=0x1;var _0x4c7b0f={'leaveAt':moment()[_0x8d3d('0x12')](_0x8d3d('0x30')),'acceptAt':moment()[_0x8d3d('0x12')](_0x8d3d('0x30')),'reason':_0x8d3d('0x31')};logger[_0x8d3d('0x29')](util[_0x8d3d('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x5a107d,_0x1d7501['name']));emitChannelQueueInteraction(_0x452f0f[_0x8d3d('0x22')],_0x1d7501[_0x8d3d('0x2b')],_0x452f0f[_0x8d3d('0x32')],_0x452f0f['account'][_0x8d3d('0x2b')],_0x452f0f[_0x8d3d('0x25')]['id'],![],_0x4934e5,_0x1d7501['id']);if(rpc[_0x452f0f[_0x8d3d('0x22')]+_0x8d3d('0x2c')]){return rpc[_0x452f0f[_0x8d3d('0x22')]+_0x8d3d('0x2c')][_0x8d3d('0x33')](_0x5a107d,_0x4c7b0f)[_0x8d3d('0x2d')](function(_0x5dda83){logger[_0x8d3d('0x34')]('update\x20queue\x20report');});}}}function endRouting(_0x566d58,_0x4cb5e3,_0x253c6a,_0x37e685){if(_0x566d58&&_0x4cb5e3){_0x4cb5e3[_0x8d3d('0x2f')]-=0x1;var _0x2042b2={'leaveAt':moment()[_0x8d3d('0x12')](_0x8d3d('0x30')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8d3d('0x35')};logger[_0x8d3d('0x29')](util[_0x8d3d('0x12')](_0x8d3d('0x36'),_0x566d58,_0x4cb5e3[_0x8d3d('0x2b')]));emitChannelQueueInteraction(_0x253c6a[_0x8d3d('0x22')],_0x4cb5e3[_0x8d3d('0x2b')],_0x253c6a[_0x8d3d('0x32')],_0x253c6a[_0x8d3d('0x9')][_0x8d3d('0x2b')],_0x253c6a[_0x8d3d('0x25')]['id'],![],_0x37e685);if(rpc[_0x253c6a[_0x8d3d('0x22')]+'QueueReport']){return rpc[_0x253c6a[_0x8d3d('0x22')]+_0x8d3d('0x2c')][_0x8d3d('0x33')](_0x566d58,_0x2042b2)[_0x8d3d('0x2d')](function(_0x2b11c4){logger[_0x8d3d('0x34')](_0x8d3d('0x37'));});}}}function handleFindQueue(_0x2664b3){return function(_0x8089f){return _0x8089f[_0x8d3d('0x2b')][_0x8d3d('0x38')]()===_0x2664b3['toLowerCase']();};}exports['consequence']=function(_0x450d33,_0x34ceb8,_0x445530,_0x164229){return function(_0x263941){try{var _0x5ecc7f={'name':_0x34ceb8[0x0],'timeout':_0x34ceb8[0x1]};var _0x5b4d46=queue[_0x8d3d('0x0')](_0x5ecc7f,{'typecast':!![]});if(_0x5b4d46[_0x8d3d('0x39')]){logger[_0x8d3d('0x34')](_0x8d3d('0x3a'),_0x450d33,_[_0x8d3d('0x3b')](_0x5b4d46,_0x8d3d('0x25'))['join'](',\x20'));_0x263941[_0x8d3d('0x3c')]();}else{var _0x5832f6=_[_0x8d3d('0x3d')](_0x445530[_0x164229[_0x8d3d('0x22')]+_0x8d3d('0x3e')],handleFindQueue(_0x5ecc7f[_0x8d3d('0x2b')]));if(_0x5832f6){startRouting(_0x450d33,_0x5832f6,_0x164229,_0x445530);var _0xd9112a=(_0x5832f6[_0x8d3d('0x35')]||0xa)*0x3e8;var _0x2942a5=(_0x5ecc7f[_0x8d3d('0x35')]||0x14)*0x3e8;var _0x41d69b;if(_0xd9112a>_0x2942a5){_0x2942a5=_0xd9112a;}var _0xf004d3=seqqueue[_0x8d3d('0x3f')](_0xd9112a);_0xf004d3['id']=_0x450d33;_0xf004d3[_0x8d3d('0x40')]=_0xd9112a;_0xf004d3[_0x8d3d('0x41')]=_0x2942a5;_0xf004d3['channel']=_0x164229[_0x8d3d('0x22')];_0x445530[_0x8d3d('0x42')][_0x450d33]['on'](_0x8d3d('0x43'),function(){logger[_0x8d3d('0x29')](_0x8d3d('0x44'),_0x450d33);stopRouting(_0x450d33,_0x5832f6,_0x164229,_0x445530);clearTimeout(_0x41d69b);_0x41d69b=undefined;_0xf004d3['close'](!![]);if(_0x445530['rules'][_0x450d33]){delete _0x445530[_0x8d3d('0x42')][_0x450d33];}_0x263941[_0x8d3d('0x3c')]();});_0x445530[_0x8d3d('0x42')][_0x450d33]['on'](_0x8d3d('0x45'),function(){if(_0x445530[_0x8d3d('0x42')][_0x450d33]){delete _0x445530[_0x8d3d('0x42')][_0x450d33];}});_0x41d69b=setTimeout(function(){logger['info'](_0x8d3d('0x46'),_0x450d33);endRouting(_0x450d33,_0x5832f6,_0x164229,_0x445530);clearTimeout(_0x41d69b);_0xf004d3['close'](!![]);_0x263941['next']();},_0x2942a5);switch(_0x5832f6[_0x8d3d('0x47')]){case _0x8d3d('0x48'):strategy[_0x8d3d('0x48')](_0xf004d3,_0x5832f6,_0x445530,_0x164229);break;default:strategy[_0x8d3d('0x49')](_0xf004d3,_0x5832f6,_0x445530,_0x164229);}}else{logger[_0x8d3d('0x34')](_0x8d3d('0x4a'),_0x450d33,_0x5ecc7f[_0x8d3d('0x2b')]);_0x263941[_0x8d3d('0x3c')]();}}}catch(_0x1c18ee){console[_0x8d3d('0x4b')](_0x1c18ee);logger['error'](_0x8d3d('0x3a'),_0x450d33,_0x1c18ee[_0x8d3d('0x4c')]);_0x263941['stop']();}};};
\ No newline at end of file
+var _0x7b08=['pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','stop','find','Queues','timeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20%s','validate','lodash','moment','ioredis','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','push','InteractionId','format','%sQueuesWaitingInteractions'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0x7b08,0x1bf));var _0x87b0=function(_0xb8bea7,_0x15f575){_0xb8bea7=_0xb8bea7-0x0;var _0x3e3a44=_0x7b08[_0xb8bea7];return _0x3e3a44;};'use strict';var schema=require(_0x87b0('0x0'));var _=require(_0x87b0('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0x87b0('0x2'));var Redis=require(_0x87b0('0x3'));var config=require('../../../../config/environment');var logger=require(_0x87b0('0x4'))(_0x87b0('0x5'));var strategy=require(_0x87b0('0x6'));config['redis']=_[_0x87b0('0x7')](config[_0x87b0('0x8')],{'host':_0x87b0('0x9'),'port':0x18eb});var io=require(_0x87b0('0xa'))(new Redis(config[_0x87b0('0x8')]));var attributes=['id',_0x87b0('0xb'),_0x87b0('0xc'),_0x87b0('0xd'),_0x87b0('0xe'),_0x87b0('0xf')];function emit(_0x3ed9c7,_0x44089b,_0x20e935){io['to'](_0x3ed9c7)[_0x87b0('0x10')](_0x44089b,_0x20e935);}function emitChannelQueueInteraction(_0xcbc99e,_0x1436dd,_0x45e85d,_0x3d5f39,_0x4ba8ac,_0x1c9b8b,_0x137d6a,_0x2daba0){var _0x4c66a5=_['clone'](_0x45e85d);_0x4c66a5[_0x87b0('0xb')]=_0x2daba0;_0x4c66a5[_0x87b0('0xd')]=_0x1436dd;_0x4c66a5[_0x87b0('0xc')]=_0x3d5f39;_0x4c66a5['id']=_0x4ba8ac;if(_0x1c9b8b){attributes[_0x87b0('0x11')](_['capitalize'](_0xcbc99e)+_0x87b0('0x12'));_0x137d6a[util[_0x87b0('0x13')](_0x87b0('0x14'),_0xcbc99e)][_0x4ba8ac]=_[_0x87b0('0x15')](_0x4c66a5,attributes);}else{delete _0x137d6a[util[_0x87b0('0x13')]('%sQueuesWaitingInteractions',_0xcbc99e)][_0x4ba8ac];}emit(util[_0x87b0('0x13')](_0x87b0('0x16'),_0xcbc99e,_0x1436dd),util[_0x87b0('0x13')](_0x87b0('0x17'),_0xcbc99e,_0x1c9b8b?_0x87b0('0x18'):_0x87b0('0x19')),_[_0x87b0('0x15')](_0x4c66a5,attributes));}var rpc={'openchannelQueueReport':require(_0x87b0('0x1a')),'mailQueueReport':require(_0x87b0('0x1b')),'chatQueueReport':require(_0x87b0('0x1c')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x87b0('0x1d'))};var queue=schema({'name':{'type':_0x87b0('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x87b0('0x1f'),'message':_0x87b0('0x20')}});function startRouting(_0x21c848,_0x2bc98b,_0x3ab4ed,_0x39c1f2){if(_0x21c848&&_0x2bc98b&&_0x3ab4ed){_0x2bc98b['waiting']+=0x1;var _0x33d9b3={'uniqueid':_0x21c848,'from':_0x3ab4ed[_0x87b0('0x21')]?_0x3ab4ed[_0x87b0('0x21')][_0x87b0('0xe')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ab4ed[_0x87b0('0x22')]?_0x3ab4ed[_0x87b0('0x22')]['id']:null,'ListId':_0x3ab4ed[_0x87b0('0x23')]?_0x3ab4ed['list']['id']:null};_0x33d9b3[_[_0x87b0('0x24')](_0x3ab4ed[_0x87b0('0x25')])+_0x87b0('0x26')]=_0x2bc98b['id']||null;_0x33d9b3[_[_0x87b0('0x24')](_0x3ab4ed[_0x87b0('0x25')])+'InteractionId']=_0x3ab4ed[_0x87b0('0x27')]?_0x3ab4ed[_0x87b0('0x27')]['id']:null;_0x33d9b3[_['upperFirst'](_0x3ab4ed[_0x87b0('0x25')])+_0x87b0('0x28')]=_0x3ab4ed[_0x87b0('0x29')]?_0x3ab4ed[_0x87b0('0x29')]['id']:null;_0x33d9b3[_['upperFirst'](_0x3ab4ed[_0x87b0('0x25')])+(_0x3ab4ed[_0x87b0('0x25')]!==_0x87b0('0x2a')?_0x87b0('0x2b'):'WebsiteId')]=_0x3ab4ed[_0x87b0('0xc')]?_0x3ab4ed[_0x87b0('0xc')]['id']:null;logger['info'](util[_0x87b0('0x13')](_0x87b0('0x2c'),_0x21c848,_0x2bc98b[_0x87b0('0x2d')]));emitChannelQueueInteraction(_0x3ab4ed['channel'],_0x2bc98b[_0x87b0('0x2d')],_0x33d9b3,_0x3ab4ed['account'][_0x87b0('0x2d')],_0x3ab4ed['message']['id'],!![],_0x39c1f2,_0x2bc98b['id']);if(rpc[_0x3ab4ed[_0x87b0('0x25')]+'QueueReport']){return rpc[_0x3ab4ed['channel']+_0x87b0('0x2e')][_0x87b0('0x2f')](_0x33d9b3)['catch'](function(_0x4a89c9){logger['error'](_0x87b0('0x30'));});}}}function stopRouting(_0x2ddd61,_0x4bf745,_0x44078b,_0x199e2e){if(_0x2ddd61&&_0x4bf745){_0x4bf745[_0x87b0('0x31')]-=0x1;var _0x5b9719={'leaveAt':moment()[_0x87b0('0x13')](_0x87b0('0x32')),'acceptAt':moment()[_0x87b0('0x13')](_0x87b0('0x32')),'reason':_0x87b0('0x33')};logger[_0x87b0('0x34')](util[_0x87b0('0x13')](_0x87b0('0x35'),_0x2ddd61,_0x4bf745[_0x87b0('0x2d')]));emitChannelQueueInteraction(_0x44078b[_0x87b0('0x25')],_0x4bf745[_0x87b0('0x2d')],_0x44078b['body'],_0x44078b[_0x87b0('0xc')]['name'],_0x44078b[_0x87b0('0x29')]['id'],![],_0x199e2e,_0x4bf745['id']);if(rpc[_0x44078b[_0x87b0('0x25')]+'QueueReport']){return rpc[_0x44078b[_0x87b0('0x25')]+_0x87b0('0x2e')][_0x87b0('0x36')](_0x2ddd61,_0x5b9719)[_0x87b0('0x37')](function(_0x5ed34c){logger[_0x87b0('0x38')](_0x87b0('0x39'));});}}}function endRouting(_0x29f7e2,_0x145188,_0x567ff6,_0x46b7f0){if(_0x29f7e2&&_0x145188){_0x145188[_0x87b0('0x31')]-=0x1;var _0x2bbb45={'leaveAt':moment()[_0x87b0('0x13')](_0x87b0('0x32')),'exitAt':moment()[_0x87b0('0x13')](_0x87b0('0x32')),'reason':'timeout'};logger[_0x87b0('0x34')](util['format'](_0x87b0('0x3a'),_0x29f7e2,_0x145188[_0x87b0('0x2d')]));emitChannelQueueInteraction(_0x567ff6['channel'],_0x145188[_0x87b0('0x2d')],_0x567ff6[_0x87b0('0x21')],_0x567ff6[_0x87b0('0xc')][_0x87b0('0x2d')],_0x567ff6[_0x87b0('0x29')]['id'],![],_0x46b7f0);if(rpc[_0x567ff6[_0x87b0('0x25')]+_0x87b0('0x2e')]){return rpc[_0x567ff6[_0x87b0('0x25')]+'QueueReport'][_0x87b0('0x36')](_0x29f7e2,_0x2bbb45)['catch'](function(_0x33f89c){logger['error'](_0x87b0('0x39'));});}}}function handleFindQueue(_0x143afb){return function(_0x5e381f){return _0x5e381f['name'][_0x87b0('0x3b')]()===_0x143afb['toLowerCase']();};}exports[_0x87b0('0x3c')]=function(_0xc0e0e8,_0x42a3e7,_0x4e3a66,_0x3ad97b){return function(_0x3aacad){try{var _0x18d709={'name':_0x42a3e7[0x0],'timeout':_0x42a3e7[0x1]};var _0x20e157=queue[_0x87b0('0x0')](_0x18d709,{'typecast':!![]});if(_0x20e157[_0x87b0('0x3d')]){logger[_0x87b0('0x38')]('[%s][QUEUE]\x20%s',_0xc0e0e8,_[_0x87b0('0x3e')](_0x20e157,_0x87b0('0x29'))['join'](',\x20'));_0x3aacad[_0x87b0('0x3f')]();}else{var _0x3fb2d3=_[_0x87b0('0x40')](_0x4e3a66[_0x3ad97b[_0x87b0('0x25')]+_0x87b0('0x41')],handleFindQueue(_0x18d709[_0x87b0('0x2d')]));if(_0x3fb2d3){startRouting(_0xc0e0e8,_0x3fb2d3,_0x3ad97b,_0x4e3a66);var _0x2c2b30=(_0x3fb2d3[_0x87b0('0x42')]||0xa)*0x3e8;var _0x50e70b=(_0x18d709[_0x87b0('0x42')]||0x14)*0x3e8;var _0x37c662;if(_0x2c2b30>_0x50e70b){_0x50e70b=_0x2c2b30;}var _0x4da720=seqqueue['createQueue'](_0x2c2b30);_0x4da720['id']=_0xc0e0e8;_0x4da720['atimeout']=_0x2c2b30;_0x4da720[_0x87b0('0x43')]=_0x50e70b;_0x4da720['channel']=_0x3ad97b[_0x87b0('0x25')];_0x4e3a66['rules'][_0xc0e0e8]['on'](_0x87b0('0x44'),function(){logger[_0x87b0('0x34')](_0x87b0('0x45'),_0xc0e0e8);stopRouting(_0xc0e0e8,_0x3fb2d3,_0x3ad97b,_0x4e3a66);clearTimeout(_0x37c662);_0x37c662=undefined;_0x4da720[_0x87b0('0x46')](!![]);if(_0x4e3a66[_0x87b0('0x47')][_0xc0e0e8]){delete _0x4e3a66['rules'][_0xc0e0e8];}_0x3aacad[_0x87b0('0x3f')]();});_0x4e3a66['rules'][_0xc0e0e8]['on'](_0x87b0('0x48'),function(){if(_0x4e3a66[_0x87b0('0x47')][_0xc0e0e8]){delete _0x4e3a66['rules'][_0xc0e0e8];}});_0x37c662=setTimeout(function(){logger['info'](_0x87b0('0x49'),_0xc0e0e8);endRouting(_0xc0e0e8,_0x3fb2d3,_0x3ad97b,_0x4e3a66);clearTimeout(_0x37c662);_0x4da720['close'](!![]);_0x3aacad['next']();},_0x50e70b);switch(_0x3fb2d3[_0x87b0('0x4a')]){case _0x87b0('0x4b'):strategy[_0x87b0('0x4b')](_0x4da720,_0x3fb2d3,_0x4e3a66,_0x3ad97b);break;default:strategy[_0x87b0('0x4c')](_0x4da720,_0x3fb2d3,_0x4e3a66,_0x3ad97b);}}else{logger[_0x87b0('0x38')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xc0e0e8,_0x18d709['name']);_0x3aacad[_0x87b0('0x3f')]();}}}catch(_0x11dc5c){console['log'](_0x11dc5c);logger[_0x87b0('0x38')](_0x87b0('0x4d'),_0xc0e0e8,_0x11dc5c['stack']);_0x3aacad[_0x87b0('0x3f')]();}};};
\ No newline at end of file
index b3a9c92..9f0d342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd1=['forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','removeWaitingNotification','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x1c0341,_0x221960){var _0x2ce684=function(_0x40807c){while(--_0x40807c){_0x1c0341['push'](_0x1c0341['shift']());}};_0x2ce684(++_0x221960);}(_0x5fd1,0x155));var _0x15fd=function(_0xf20f7d,_0x2c5c9d){_0xf20f7d=_0xf20f7d-0x0;var _0xa6888=_0x5fd1[_0xf20f7d];return _0xa6888;};'use strict';var _=require(_0x15fd('0x0'));var uuid=require('uuid');var util=require(_0x15fd('0x1'));var logger=require(_0x15fd('0x2'))(_0x15fd('0x3'));var Agent=function(_0x50fc5a,_0x5d2d77,_0x370d34,_0x3138f3){this[_0x15fd('0x4')]=uuid['v4']();this['squeue']=_0x50fc5a;this[_0x15fd('0x5')]=_0x5d2d77;this[_0x15fd('0x6')]=_0x370d34;this[_0x15fd('0x3')]=_0x3138f3;this[_0x15fd('0x7')][_0x15fd('0x8')](this['handleRun'][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));this['squeue']['on'](_0x15fd('0xb'),this['handleTimeout'][_0x15fd('0x9')](this));this[_0x15fd('0x7')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x15fd('0xc')][_0x15fd('0x8')]=function(){this[_0x15fd('0x7')][_0x15fd('0x8')](this[_0x15fd('0xd')][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));};Agent[_0x15fd('0xc')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x15fd('0xd')]=function(){logger[_0x15fd('0xe')](_0x15fd('0xf'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){logger['debug'](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);setTimeout(this['push'][_0x15fd('0x9')](this),0x3e8);}else{if(this[_0x15fd('0x3')][_0x15fd('0x13')]||util['isAgentAvailable'](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],this[_0x15fd('0x7')][_0x15fd('0x14')],![])){this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=!![];this[_0x15fd('0x6')]['agents'][this['agent']['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x17')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this[_0x15fd('0x7')][_0x15fd('0x14')]);util['showNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],null,this['routing']);util[_0x15fd('0x18')](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],_0x15fd('0x19')+(this[_0x15fd('0x3')]['forcedOwnership']?_0x15fd('0x1a'):''));}else{logger['debug'](_0x15fd('0x1b'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}}};Agent[_0x15fd('0xc')][_0x15fd('0xa')]=function(_0xe650a3){if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){return logger[_0x15fd('0xe')](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);}else{logger[_0x15fd('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);util['hideNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],null,this[_0x15fd('0x3')]);this['realtime'][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=![];this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x1c')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this['squeue'][_0x15fd('0x14')]);util[_0x15fd('0x18')](this['squeue']['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],_0xe650a3?'STOP':_0x15fd('0x1d'));}if(!_0xe650a3){setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}};function agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259){return new Agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259);}module['exports']=agent;
\ No newline at end of file
+var _0x6aa7=['STOP','exports','lodash','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','debug','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x6aa7,0x178));var _0x76aa=function(_0x10a25b,_0x2f2e09){_0x10a25b=_0x10a25b-0x0;var _0x17ebed=_0x6aa7[_0x10a25b];return _0x17ebed;};'use strict';var _=require(_0x76aa('0x0'));var uuid=require('uuid');var util=require(_0x76aa('0x1'));var logger=require(_0x76aa('0x2'))(_0x76aa('0x3'));var Agent=function(_0x2db4fe,_0x4f007e,_0x13f62b,_0xef15ef){this[_0x76aa('0x4')]=uuid['v4']();this['squeue']=_0x2db4fe;this['agent']=_0x4f007e;this[_0x76aa('0x5')]=_0x13f62b;this['routing']=_0xef15ef;this[_0x76aa('0x6')][_0x76aa('0x7')](this[_0x76aa('0x8')]['bind'](this),this[_0x76aa('0x9')][_0x76aa('0xa')](this));this[_0x76aa('0x6')]['on']('timeout',this[_0x76aa('0x9')][_0x76aa('0xa')](this));this[_0x76aa('0x6')]['on'](_0x76aa('0xb'),this[_0x76aa('0xc')][_0x76aa('0xa')](this));};Agent[_0x76aa('0xd')][_0x76aa('0x7')]=function(){this[_0x76aa('0x6')][_0x76aa('0x7')](this['handleRun'][_0x76aa('0xa')](this),this['handleTimeout'][_0x76aa('0xa')](this));};Agent[_0x76aa('0xd')][_0x76aa('0xc')]=function(){this[_0x76aa('0x9')](!![]);};Agent[_0x76aa('0xd')]['handleRun']=function(){logger['debug'](_0x76aa('0xe'),this['squeue']['id'],this[_0x76aa('0xf')]['id']);if(_[_0x76aa('0x10')](this['realtime'][_0x76aa('0x11')][this['agent']['id']])){logger[_0x76aa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x76aa('0x6')]['id'],this[_0x76aa('0xf')]['id']);setTimeout(this[_0x76aa('0x7')][_0x76aa('0xa')](this),0x3e8);}else{if(this[_0x76aa('0x3')][_0x76aa('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this[_0x76aa('0x5')][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']],this[_0x76aa('0x6')][_0x76aa('0x14')],![])){this[_0x76aa('0x5')][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']][_0x76aa('0x15')]=!![];this['realtime'][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']][_0x76aa('0x16')]=undefined;util['saveWaitingNotification'](this[_0x76aa('0x5')],this[_0x76aa('0x3')],this[_0x76aa('0xf')],this[_0x76aa('0x6')][_0x76aa('0x14')]);util[_0x76aa('0x17')](this[_0x76aa('0x4')],this[_0x76aa('0x6')]['id'],this[_0x76aa('0x5')][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']],null,this[_0x76aa('0x3')]);util[_0x76aa('0x18')](this['squeue']['id'],this[_0x76aa('0x5')][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']],_0x76aa('0x19')+(this[_0x76aa('0x3')][_0x76aa('0x13')]?_0x76aa('0x1a'):''));}else{logger[_0x76aa('0x12')](_0x76aa('0x1b'),this[_0x76aa('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x76aa('0x7')]['bind'](this),0x3e8);}}};Agent[_0x76aa('0xd')][_0x76aa('0x9')]=function(_0x2dec94){if(_[_0x76aa('0x10')](this[_0x76aa('0x5')][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']])){return logger[_0x76aa('0x12')](_0x76aa('0x1c'),this[_0x76aa('0x6')]['id'],this['agent']['id']);}else{logger[_0x76aa('0x12')](_0x76aa('0x1d'),this[_0x76aa('0x6')]['id'],this[_0x76aa('0xf')]['id']);util[_0x76aa('0x1e')](this[_0x76aa('0x4')],this[_0x76aa('0x6')]['id'],this['realtime'][_0x76aa('0x11')][this[_0x76aa('0xf')]['id']],null,this['routing']);this[_0x76aa('0x5')]['agents'][this[_0x76aa('0xf')]['id']]['busy']=![];this[_0x76aa('0x5')]['agents'][this['agent']['id']][_0x76aa('0x16')]=undefined;util[_0x76aa('0x1f')](this[_0x76aa('0x5')],this[_0x76aa('0x3')],this['agent'],this['squeue'][_0x76aa('0x14')]);util[_0x76aa('0x18')](this[_0x76aa('0x6')]['id'],this[_0x76aa('0x5')][_0x76aa('0x11')][this['agent']['id']],_0x2dec94?_0x76aa('0x20'):'TIMEOUT');}if(!_0x2dec94){setTimeout(this['push'][_0x76aa('0xa')](this),0x3e8);}};function agent(_0x36d64e,_0x181216,_0x127bc4,_0x48cf51){return new Agent(_0x36d64e,_0x181216,_0x127bc4,_0x48cf51);}module[_0x76aa('0x21')]=agent;
\ No newline at end of file
index 81a37ec..ee9c0d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c7d=['lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','RINGING','busyQueue','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','writeLog','STOP','TIMEOUT','busy','removeWaitingNotification','exports'];(function(_0x2b243f,_0x449342){var _0x263578=function(_0xe9ab80){while(--_0xe9ab80){_0x2b243f['push'](_0x2b243f['shift']());}};_0x263578(++_0x449342);}(_0x9c7d,0x1ba));var _0xd9c7=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x9c7d[_0x1c289a];return _0x28d68e;};'use strict';var _=require(_0xd9c7('0x0'));var uuid=require(_0xd9c7('0x1'));var util=require(_0xd9c7('0x2'));var logger=require(_0xd9c7('0x3'))(_0xd9c7('0x4'));var Beepall=function(_0x339559,_0x272db4,_0x1d5987,_0x4fbbef){this[_0xd9c7('0x5')]=uuid['v4']();this[_0xd9c7('0x6')]=_0x339559;this[_0xd9c7('0x7')]=_0x272db4;this[_0xd9c7('0x8')]=_0x1d5987;this[_0xd9c7('0x4')]=_0x4fbbef;this['squeue'][_0xd9c7('0x9')](this['handleRun'][_0xd9c7('0xa')](this),this[_0xd9c7('0xb')]['bind'](this));this[_0xd9c7('0x6')]['on'](_0xd9c7('0xc'),this[_0xd9c7('0xb')][_0xd9c7('0xa')](this));this['squeue']['on'](_0xd9c7('0xd'),this[_0xd9c7('0xe')][_0xd9c7('0xa')](this));};Beepall[_0xd9c7('0xf')][_0xd9c7('0x9')]=function(){this[_0xd9c7('0x6')]['push'](this[_0xd9c7('0x10')][_0xd9c7('0xa')](this),this[_0xd9c7('0xb')][_0xd9c7('0xa')](this));};Beepall[_0xd9c7('0xf')]['handleDrained']=function(){this[_0xd9c7('0xb')](!![]);};Beepall[_0xd9c7('0xf')]['handleRun']=function(){var _0x518b40=!![];if(!_[_0xd9c7('0x11')](this['queue'])&&!_['isNil'](this[_0xd9c7('0x7')][_0xd9c7('0x12')])&&this[_0xd9c7('0x7')][_0xd9c7('0x12')][_0xd9c7('0x13')]>0x0){for(var _0x2743e7=0x0,_0x5b3be1;_0x2743e7<this[_0xd9c7('0x7')][_0xd9c7('0x12')]['length'];_0x2743e7+=0x1){_0x5b3be1=this[_0xd9c7('0x7')][_0xd9c7('0x12')][_0x2743e7]['id'];if(_[_0xd9c7('0x11')](this[_0xd9c7('0x8')]['agents'][_0x5b3be1])){logger[_0xd9c7('0x14')](_0xd9c7('0x15'),this[_0xd9c7('0x6')]['id'],_0x5b3be1);}else{if(util['isAgentAvailable'](this['squeue']['id'],this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5b3be1],this['squeue'][_0xd9c7('0x17')],!![])){_0x518b40=![];util['writeLog'](this['squeue']['id'],this[_0xd9c7('0x8')]['agents'][_0x5b3be1],_0xd9c7('0x18'));this[_0xd9c7('0x8')]['agents'][_0x5b3be1]['busy']=!![];this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5b3be1][_0xd9c7('0x19')]=this[_0xd9c7('0x7')]['name'];util['saveWaitingNotification'](this['realtime'],this[_0xd9c7('0x4')],this[_0xd9c7('0x7')][_0xd9c7('0x12')][_0x2743e7],this[_0xd9c7('0x6')][_0xd9c7('0x17')]);util['showNotification'](this[_0xd9c7('0x5')],this[_0xd9c7('0x6')]['id'],this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5b3be1],this[_0xd9c7('0x7')],this[_0xd9c7('0x4')]);}}}if(_0x518b40){logger[_0xd9c7('0x14')](_0xd9c7('0x1a'),this['squeue']['id']);setTimeout(this[_0xd9c7('0x9')][_0xd9c7('0xa')](this),0x3e8);}}else{logger['debug']('[%s][QUEUE]\x20EMPTY',this[_0xd9c7('0x6')]['id']);setTimeout(this[_0xd9c7('0x9')][_0xd9c7('0xa')](this),0x3e8);}};Beepall[_0xd9c7('0xf')][_0xd9c7('0xb')]=function(_0x5dcbb4){if(!_[_0xd9c7('0x11')](this[_0xd9c7('0x7')])&&!_['isNil'](this[_0xd9c7('0x7')][_0xd9c7('0x12')])){for(var _0xf23492=0x0,_0x5d4df8;_0xf23492<this[_0xd9c7('0x7')]['Agents'][_0xd9c7('0x13')];_0xf23492+=0x1){_0x5d4df8=this[_0xd9c7('0x7')][_0xd9c7('0x12')][_0xf23492]['id'];if(_['isNil'](this[_0xd9c7('0x8')]['agents'][_0x5d4df8])){logger[_0xd9c7('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd9c7('0x6')]['id'],_0x5d4df8);}else{util[_0xd9c7('0x1b')](this[_0xd9c7('0x5')],this[_0xd9c7('0x6')]['id'],this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5d4df8],this[_0xd9c7('0x7')],this[_0xd9c7('0x4')]);util[_0xd9c7('0x1c')](this['squeue']['id'],this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5d4df8],_0x5dcbb4?_0xd9c7('0x1d'):_0xd9c7('0x1e'));this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5d4df8][_0xd9c7('0x1f')]=![];this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5d4df8]['busyQueue']=undefined;util[_0xd9c7('0x20')](this[_0xd9c7('0x8')],this[_0xd9c7('0x4')],this[_0xd9c7('0x8')][_0xd9c7('0x16')][_0x5d4df8],this[_0xd9c7('0x6')]['channel']);}}}if(!_0x5dcbb4){setTimeout(this[_0xd9c7('0x9')][_0xd9c7('0xa')](this),0x3e8);}};function beepall(_0x5921ed,_0x5a9d07,_0x559443,_0x15445f){return new Beepall(_0x5921ed,_0x5a9d07,_0x559443,_0x15445f);}module[_0xd9c7('0x21')]=beepall;
\ No newline at end of file
+var _0x0189=['uuid','notificationId','squeue','queue','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','Agents','length','realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','busyQueue','name','channel','showNotification','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','busy','exports'];(function(_0x3e697a,_0x5a875e){var _0x25c1e1=function(_0x9c6946){while(--_0x9c6946){_0x3e697a['push'](_0x3e697a['shift']());}};_0x25c1e1(++_0x5a875e);}(_0x0189,0x193));var _0x9018=function(_0x1ff46f,_0x36ae7a){_0x1ff46f=_0x1ff46f-0x0;var _0x584531=_0x0189[_0x1ff46f];return _0x584531;};'use strict';var _=require('lodash');var uuid=require(_0x9018('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x5a6b6d,_0x3e68af,_0x49b344,_0x2bf52a){this[_0x9018('0x1')]=uuid['v4']();this[_0x9018('0x2')]=_0x5a6b6d;this[_0x9018('0x3')]=_0x3e68af;this['realtime']=_0x49b344;this[_0x9018('0x4')]=_0x2bf52a;this[_0x9018('0x2')]['push'](this[_0x9018('0x5')][_0x9018('0x6')](this),this[_0x9018('0x7')][_0x9018('0x6')](this));this[_0x9018('0x2')]['on'](_0x9018('0x8'),this[_0x9018('0x7')][_0x9018('0x6')](this));this['squeue']['on'](_0x9018('0x9'),this[_0x9018('0xa')][_0x9018('0x6')](this));};Beepall[_0x9018('0xb')]['push']=function(){this['squeue'][_0x9018('0xc')](this[_0x9018('0x5')][_0x9018('0x6')](this),this[_0x9018('0x7')][_0x9018('0x6')](this));};Beepall[_0x9018('0xb')][_0x9018('0xa')]=function(){this[_0x9018('0x7')](!![]);};Beepall[_0x9018('0xb')][_0x9018('0x5')]=function(){var _0x1d87c7=!![];if(!_[_0x9018('0xd')](this[_0x9018('0x3')])&&!_[_0x9018('0xd')](this[_0x9018('0x3')][_0x9018('0xe')])&&this['queue'][_0x9018('0xe')]['length']>0x0){for(var _0x595949=0x0,_0x185135;_0x595949<this[_0x9018('0x3')][_0x9018('0xe')][_0x9018('0xf')];_0x595949+=0x1){_0x185135=this[_0x9018('0x3')][_0x9018('0xe')][_0x595949]['id'];if(_[_0x9018('0xd')](this[_0x9018('0x10')][_0x9018('0x11')][_0x185135])){logger[_0x9018('0x12')](_0x9018('0x13'),this[_0x9018('0x2')]['id'],_0x185135);}else{if(util['isAgentAvailable'](this[_0x9018('0x2')]['id'],this['realtime'][_0x9018('0x11')][_0x185135],this[_0x9018('0x2')]['channel'],!![])){_0x1d87c7=![];util[_0x9018('0x14')](this[_0x9018('0x2')]['id'],this[_0x9018('0x10')]['agents'][_0x185135],_0x9018('0x15'));this[_0x9018('0x10')][_0x9018('0x11')][_0x185135]['busy']=!![];this[_0x9018('0x10')][_0x9018('0x11')][_0x185135][_0x9018('0x16')]=this[_0x9018('0x3')][_0x9018('0x17')];util['saveWaitingNotification'](this['realtime'],this[_0x9018('0x4')],this['queue']['Agents'][_0x595949],this[_0x9018('0x2')][_0x9018('0x18')]);util[_0x9018('0x19')](this[_0x9018('0x1')],this[_0x9018('0x2')]['id'],this[_0x9018('0x10')]['agents'][_0x185135],this['queue'],this[_0x9018('0x4')]);}}}if(_0x1d87c7){logger[_0x9018('0x12')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x9018('0x2')]['id']);setTimeout(this['push'][_0x9018('0x6')](this),0x3e8);}}else{logger[_0x9018('0x12')](_0x9018('0x1a'),this[_0x9018('0x2')]['id']);setTimeout(this[_0x9018('0xc')][_0x9018('0x6')](this),0x3e8);}};Beepall['prototype']['handleTimeout']=function(_0x18a470){if(!_[_0x9018('0xd')](this[_0x9018('0x3')])&&!_[_0x9018('0xd')](this[_0x9018('0x3')][_0x9018('0xe')])){for(var _0x54bd47=0x0,_0x4a8c0d;_0x54bd47<this[_0x9018('0x3')][_0x9018('0xe')][_0x9018('0xf')];_0x54bd47+=0x1){_0x4a8c0d=this[_0x9018('0x3')]['Agents'][_0x54bd47]['id'];if(_[_0x9018('0xd')](this[_0x9018('0x10')][_0x9018('0x11')][_0x4a8c0d])){logger[_0x9018('0x12')](_0x9018('0x13'),this[_0x9018('0x2')]['id'],_0x4a8c0d);}else{util['hideNotification'](this[_0x9018('0x1')],this[_0x9018('0x2')]['id'],this[_0x9018('0x10')][_0x9018('0x11')][_0x4a8c0d],this[_0x9018('0x3')],this[_0x9018('0x4')]);util[_0x9018('0x14')](this[_0x9018('0x2')]['id'],this[_0x9018('0x10')]['agents'][_0x4a8c0d],_0x18a470?_0x9018('0x1b'):_0x9018('0x1c'));this[_0x9018('0x10')][_0x9018('0x11')][_0x4a8c0d][_0x9018('0x1d')]=![];this[_0x9018('0x10')]['agents'][_0x4a8c0d][_0x9018('0x16')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x9018('0x4')],this['realtime'][_0x9018('0x11')][_0x4a8c0d],this[_0x9018('0x2')]['channel']);}}}if(!_0x18a470){setTimeout(this['push'][_0x9018('0x6')](this),0x3e8);}};function beepall(_0x3e58e5,_0x1bb209,_0x4f7a4b,_0x43a63b){return new Beepall(_0x3e58e5,_0x1bb209,_0x4f7a4b,_0x43a63b);}module[_0x9018('0x1e')]=beepall;
\ No newline at end of file
index f91dc1d..01894f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a01=['./rrmemory','./agent','exports'];(function(_0xa28fda,_0x362cdc){var _0x75bb3b=function(_0x532dc0){while(--_0x532dc0){_0xa28fda['push'](_0xa28fda['shift']());}};_0x75bb3b(++_0x362cdc);}(_0x0a01,0xc5));var _0x10a0=function(_0x4b425c,_0x1842ab){_0x4b425c=_0x4b425c-0x0;var _0x34e69b=_0x0a01[_0x4b425c];return _0x34e69b;};'use strict';module[_0x10a0('0x0')]={'rrmemory':require(_0x10a0('0x1')),'beepall':require('./beepall'),'agent':require(_0x10a0('0x2'))};
\ No newline at end of file
+var _0x0633=['./beepall','./agent','exports','./rrmemory'];(function(_0x1fe955,_0x5dcffe){var _0x4bee17=function(_0x821679){while(--_0x821679){_0x1fe955['push'](_0x1fe955['shift']());}};_0x4bee17(++_0x5dcffe);}(_0x0633,0xe6));var _0x3063=function(_0x1f3861,_0x3b9a55){_0x1f3861=_0x1f3861-0x0;var _0x1cacc9=_0x0633[_0x1f3861];return _0x1cacc9;};'use strict';module[_0x3063('0x0')]={'rrmemory':require(_0x3063('0x1')),'beepall':require(_0x3063('0x2')),'agent':require(_0x3063('0x3'))};
\ No newline at end of file
index ccaae0f..65bfc46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x133a=['module','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','[%s][QUEUE]\x20try\x20with\x20%s','isNil','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','saveWaitingNotification','showNotification','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','removeWaitingNotification','exports','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','intervals','push','handleRun','bind','handleTimeout'];(function(_0xb58ef4,_0x1640d4){var _0x304417=function(_0x479482){while(--_0x479482){_0xb58ef4['push'](_0xb58ef4['shift']());}};_0x304417(++_0x1640d4);}(_0x133a,0x6a));var _0xa133=function(_0x5860b9,_0x4bf239){_0x5860b9=_0x5860b9-0x0;var _0x275f07=_0x133a[_0x5860b9];return _0x275f07;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require('uuid');var util=require(_0xa133('0x0'));var logger=require(_0xa133('0x1'))(_0xa133('0x2'));var RRMemory=function(_0xfebae1,_0x23e100,_0x2aadd0,_0x454022){this[_0xa133('0x3')]=uuid['v4']();this[_0xa133('0x4')]=_0xfebae1;this['queue']=_0x23e100;this[_0xa133('0x5')]=_0x2aadd0;this[_0xa133('0x2')]=_0x454022;this[_0xa133('0x6')]={};this[_0xa133('0x4')][_0xa133('0x7')](this[_0xa133('0x8')][_0xa133('0x9')](this),this[_0xa133('0xa')][_0xa133('0x9')](this),this[_0xa133('0xb')]);this[_0xa133('0x4')]['on']('timeout',this[_0xa133('0xa')][_0xa133('0x9')](this));this[_0xa133('0x4')]['on']('drained',this[_0xa133('0xc')][_0xa133('0x9')](this));};RRMemory[_0xa133('0xd')][_0xa133('0x7')]=function(){this[_0xa133('0x4')][_0xa133('0x7')](this['handleRun'][_0xa133('0x9')](this),this[_0xa133('0xa')]['bind'](this));};RRMemory[_0xa133('0xd')][_0xa133('0xc')]=function(){this[_0xa133('0xa')](!![]);};RRMemory[_0xa133('0xd')][_0xa133('0xe')]=function(_0x50a7b8){if(util[_0xa133('0xf')](this[_0xa133('0x4')]['id'],this['realtime'][_0xa133('0x10')][this[_0xa133('0x11')]],this['squeue'][_0xa133('0x12')],!![])){logger['debug'](_0xa133('0x13'),this[_0xa133('0x4')]['id'],this[_0xa133('0x11')]);clearInterval(this[_0xa133('0x6')][this['agentId']]);_0x50a7b8[_0xa133('0x14')]();setTimeout(this[_0xa133('0x7')]['bind'](this),0x3e8);}};RRMemory[_0xa133('0xd')]['handleRun']=function(_0x2d4195){this[_0xa133('0x11')]=rr(this[_0xa133('0x15')]['mapAgentsId']);logger['debug'](_0xa133('0x16'),this[_0xa133('0x4')]['id'],this['agentId']);if(_[_0xa133('0x17')](this[_0xa133('0x5')][_0xa133('0x10')][this[_0xa133('0x11')]])){logger[_0xa133('0x18')](_0xa133('0x19'),this[_0xa133('0x4')]['id'],this[_0xa133('0x11')]);_0x2d4195[_0xa133('0x14')]();setTimeout(this[_0xa133('0x7')]['bind'](this),0x3e8);}else{if(util[_0xa133('0xf')](this[_0xa133('0x4')]['id'],this[_0xa133('0x5')]['agents'][this['agentId']],this[_0xa133('0x4')][_0xa133('0x12')],!![])){this[_0xa133('0x5')]['agents'][this['agentId']][_0xa133('0x1a')]=!![];this[_0xa133('0x5')][_0xa133('0x10')][this[_0xa133('0x11')]][_0xa133('0x1b')]=this['queue'][_0xa133('0x1c')];util[_0xa133('0x1d')](this[_0xa133('0x5')],this[_0xa133('0x2')],this[_0xa133('0x5')][_0xa133('0x10')][this[_0xa133('0x11')]],this[_0xa133('0x4')]['channel']);util[_0xa133('0x1e')](this[_0xa133('0x3')],this[_0xa133('0x4')]['id'],this[_0xa133('0x5')][_0xa133('0x10')][this[_0xa133('0x11')]],this[_0xa133('0x15')],this[_0xa133('0x2')]);util['writeLog'](this[_0xa133('0x4')]['id'],this['realtime'][_0xa133('0x10')][this[_0xa133('0x11')]],_0xa133('0x1f'));this[_0xa133('0x6')][this[_0xa133('0x11')]]=setInterval(this[_0xa133('0xe')][_0xa133('0x9')](this,_0x2d4195),0x3e8);}else{logger[_0xa133('0x18')](_0xa133('0x20'),this[_0xa133('0x4')]['id'],this[_0xa133('0x11')]);_0x2d4195[_0xa133('0x14')]();setTimeout(this[_0xa133('0x7')][_0xa133('0x9')](this),0x3e8);}}};RRMemory[_0xa133('0xd')][_0xa133('0xa')]=function(_0x343000){logger[_0xa133('0x18')](_0xa133('0x21'),this[_0xa133('0x4')]['id'],this[_0xa133('0x11')]);if(_[_0xa133('0x17')](this[_0xa133('0x5')]['agents'][this[_0xa133('0x11')]])){logger[_0xa133('0x18')](_0xa133('0x19'),this[_0xa133('0x4')]['id'],this[_0xa133('0x11')]);}else{clearInterval(this[_0xa133('0x6')][this['agentId']]);util[_0xa133('0x22')](this[_0xa133('0x3')],this[_0xa133('0x4')]['id'],this[_0xa133('0x5')][_0xa133('0x10')][this['agentId']],this[_0xa133('0x15')],this[_0xa133('0x2')]);util[_0xa133('0x23')](this['squeue']['id'],this['realtime'][_0xa133('0x10')][this['agentId']],_0xa133('0x24'));this[_0xa133('0x5')][_0xa133('0x10')][this['agentId']][_0xa133('0x1a')]=![];this[_0xa133('0x5')][_0xa133('0x10')][this[_0xa133('0x11')]]['busyQueue']=undefined;util[_0xa133('0x25')](this[_0xa133('0x5')],this[_0xa133('0x2')],this['realtime'][_0xa133('0x10')][this[_0xa133('0x11')]],this[_0xa133('0x4')]['channel']);}if(!_0x343000){setTimeout(this['push'][_0xa133('0x9')](this),0x3e8);}};function rrmemory(_0x107220,_0x7503bb,_0x409d30,_0x272f8c){return new RRMemory(_0x107220,_0x7503bb,_0x409d30,_0x272f8c);}module[_0xa133('0x26')]=rrmemory;
\ No newline at end of file
+var _0x4c9d=['writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','intervals','squeue','push','handleRun','bind','handleTimeout','module','timeout','drained','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','channel','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','debug','[%s][QUEUE]\x20try\x20with\x20%s','isNil','busy','name','showNotification','queue'];(function(_0x223322,_0x34244c){var _0x351d4a=function(_0x29a3da){while(--_0x29a3da){_0x223322['push'](_0x223322['shift']());}};_0x351d4a(++_0x34244c);}(_0x4c9d,0x197));var _0xd4c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4c9d[_0x3ab51d];return _0x29a04e;};'use strict';var rr=require('rr');var _=require(_0xd4c9('0x0'));var uuid=require(_0xd4c9('0x1'));var util=require(_0xd4c9('0x2'));var logger=require(_0xd4c9('0x3'))(_0xd4c9('0x4'));var RRMemory=function(_0x59cffc,_0x22a4a8,_0x3fcec3,_0x17a7ef){this[_0xd4c9('0x5')]=uuid['v4']();this['squeue']=_0x59cffc;this['queue']=_0x22a4a8;this[_0xd4c9('0x6')]=_0x3fcec3;this[_0xd4c9('0x4')]=_0x17a7ef;this[_0xd4c9('0x7')]={};this[_0xd4c9('0x8')][_0xd4c9('0x9')](this[_0xd4c9('0xa')][_0xd4c9('0xb')](this),this[_0xd4c9('0xc')]['bind'](this),this[_0xd4c9('0xd')]);this[_0xd4c9('0x8')]['on'](_0xd4c9('0xe'),this[_0xd4c9('0xc')][_0xd4c9('0xb')](this));this['squeue']['on'](_0xd4c9('0xf'),this[_0xd4c9('0x10')]['bind'](this));};RRMemory[_0xd4c9('0x11')][_0xd4c9('0x9')]=function(){this['squeue'][_0xd4c9('0x9')](this[_0xd4c9('0xa')][_0xd4c9('0xb')](this),this[_0xd4c9('0xc')][_0xd4c9('0xb')](this));};RRMemory[_0xd4c9('0x11')]['handleDrained']=function(){this[_0xd4c9('0xc')](!![]);};RRMemory[_0xd4c9('0x11')][_0xd4c9('0x12')]=function(_0x5c3bb8){if(util[_0xd4c9('0x13')](this[_0xd4c9('0x8')]['id'],this[_0xd4c9('0x6')][_0xd4c9('0x14')][this['agentId']],this['squeue'][_0xd4c9('0x15')],!![])){logger['debug'](_0xd4c9('0x16'),this['squeue']['id'],this[_0xd4c9('0x17')]);clearInterval(this[_0xd4c9('0x7')][this[_0xd4c9('0x17')]]);_0x5c3bb8[_0xd4c9('0x18')]();setTimeout(this['push'][_0xd4c9('0xb')](this),0x3e8);}};RRMemory[_0xd4c9('0x11')][_0xd4c9('0xa')]=function(_0x5925fe){this[_0xd4c9('0x17')]=rr(this['queue'][_0xd4c9('0x19')]);logger[_0xd4c9('0x1a')](_0xd4c9('0x1b'),this[_0xd4c9('0x8')]['id'],this[_0xd4c9('0x17')]);if(_[_0xd4c9('0x1c')](this[_0xd4c9('0x6')][_0xd4c9('0x14')][this['agentId']])){logger['debug']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xd4c9('0x17')]);_0x5925fe['done']();setTimeout(this[_0xd4c9('0x9')][_0xd4c9('0xb')](this),0x3e8);}else{if(util[_0xd4c9('0x13')](this[_0xd4c9('0x8')]['id'],this[_0xd4c9('0x6')][_0xd4c9('0x14')][this[_0xd4c9('0x17')]],this[_0xd4c9('0x8')][_0xd4c9('0x15')],!![])){this['realtime']['agents'][this['agentId']][_0xd4c9('0x1d')]=!![];this[_0xd4c9('0x6')][_0xd4c9('0x14')][this[_0xd4c9('0x17')]]['busyQueue']=this['queue'][_0xd4c9('0x1e')];util['saveWaitingNotification'](this[_0xd4c9('0x6')],this[_0xd4c9('0x4')],this[_0xd4c9('0x6')]['agents'][this[_0xd4c9('0x17')]],this['squeue'][_0xd4c9('0x15')]);util[_0xd4c9('0x1f')](this[_0xd4c9('0x5')],this[_0xd4c9('0x8')]['id'],this['realtime'][_0xd4c9('0x14')][this[_0xd4c9('0x17')]],this[_0xd4c9('0x20')],this[_0xd4c9('0x4')]);util[_0xd4c9('0x21')](this[_0xd4c9('0x8')]['id'],this['realtime'][_0xd4c9('0x14')][this[_0xd4c9('0x17')]],_0xd4c9('0x22'));this[_0xd4c9('0x7')][this[_0xd4c9('0x17')]]=setInterval(this[_0xd4c9('0x12')]['bind'](this,_0x5925fe),0x3e8);}else{logger[_0xd4c9('0x1a')](_0xd4c9('0x23'),this[_0xd4c9('0x8')]['id'],this['agentId']);_0x5925fe[_0xd4c9('0x18')]();setTimeout(this['push'][_0xd4c9('0xb')](this),0x3e8);}}};RRMemory[_0xd4c9('0x11')][_0xd4c9('0xc')]=function(_0x949223){logger[_0xd4c9('0x1a')](_0xd4c9('0x24'),this[_0xd4c9('0x8')]['id'],this[_0xd4c9('0x17')]);if(_[_0xd4c9('0x1c')](this[_0xd4c9('0x6')][_0xd4c9('0x14')][this[_0xd4c9('0x17')]])){logger[_0xd4c9('0x1a')](_0xd4c9('0x25'),this[_0xd4c9('0x8')]['id'],this['agentId']);}else{clearInterval(this['intervals'][this[_0xd4c9('0x17')]]);util['hideNotification'](this['notificationId'],this[_0xd4c9('0x8')]['id'],this['realtime']['agents'][this[_0xd4c9('0x17')]],this['queue'],this[_0xd4c9('0x4')]);util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this['agentId']],'TIMEOUT');this['realtime']['agents'][this[_0xd4c9('0x17')]]['busy']=![];this[_0xd4c9('0x6')][_0xd4c9('0x14')][this['agentId']][_0xd4c9('0x26')]=undefined;util['removeWaitingNotification'](this['realtime'],this['routing'],this[_0xd4c9('0x6')][_0xd4c9('0x14')][this[_0xd4c9('0x17')]],this['squeue']['channel']);}if(!_0x949223){setTimeout(this[_0xd4c9('0x9')][_0xd4c9('0xb')](this),0x3e8);}};function rrmemory(_0x4d690a,_0x431974,_0x5efcad,_0x4b776f){return new RRMemory(_0x4d690a,_0x431974,_0x5efcad,_0x4b776f);}module[_0xd4c9('0x27')]=rrmemory;
\ No newline at end of file
index b285a82..c6f88bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x081e=['WaitingInteractions','message','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','name','emit','notification:%s','save','remove','debug','isAgentAvailable','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x081e,0x17e));var _0xe081=function(_0x365143,_0x46fd86){_0x365143=_0x365143-0x0;var _0x45bb49=_0x081e[_0x365143];return _0x45bb49;};'use strict';var _=require(_0xe081('0x0'));var util=require('util');var utils=require(_0xe081('0x1'));var Redis=require(_0xe081('0x2'));var config=require(_0xe081('0x3'));var logger=require(_0xe081('0x4'))(_0xe081('0x5'));config[_0xe081('0x6')]=_[_0xe081('0x7')](config['redis'],{'host':_0xe081('0x8'),'port':0x18eb});var io=require(_0xe081('0x9'))(new Redis(config[_0xe081('0x6')]));function sendNotification(_0x498b82,_0x326289,_0x1c2a8b,_0x5c83bf,_0x281ea4,_0x5ad7f0){io['to'](util[_0xe081('0xa')](_0xe081('0xb'),_0x5c83bf['name']))['emit'](_0xe081('0xc'),_0x5c83bf);var _0x3711f8=_0x5ad7f0||{};var _0x363133=_0x1c2a8b['split']('.');var _0x1642d2={'uniqueid':_0x326289,'channel':_0x363133[0x0],'id':_0x363133[0x1],'title':_0x363133[0x0]+_0xe081('0xd'),'interactionId':_0x363133[0x2],'queue':_0x281ea4?_0x281ea4['name']:null,'sound':_0x3711f8[_0xe081('0xe')][_0xe081('0xf')],'shake':_0x3711f8[_0xe081('0xe')][_0xe081('0x10')]};try{if(!_0x3711f8[_0xe081('0x11')]){_0x3711f8['body']={};}if(_0x281ea4){_0x3711f8[_0xe081('0x11')]['queue']=_0x281ea4;}else if(_0x3711f8[_0xe081('0x11')][_0xe081('0x12')]){delete _0x3711f8[_0xe081('0x11')]['queue'];}_0x1642d2['msg']=utils[_0xe081('0x13')](_0x3711f8['account']['notificationTemplate'],_0x3711f8);}catch(_0x1b2a44){_0x1642d2['msg']=_0xe081('0x14');logger[_0xe081('0x15')](util[_0xe081('0xa')]('[%s][QUEUE]\x20%s',_0x326289,_0x1b2a44['message']));}io['to'](util['format'](_0xe081('0xb'),_0x5c83bf[_0xe081('0x16')]))[_0xe081('0x17')](util[_0xe081('0xa')](_0xe081('0x18'),_0x498b82?_0xe081('0x19'):_0xe081('0x1a')),_0x1642d2);}function writeLog(_0x444f13,_0x1dbfbf,_0x48953c){return logger[_0xe081('0x1b')](util[_0xe081('0xa')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x444f13,_0x1dbfbf[_0xe081('0x16')],_0x48953c));}exports[_0xe081('0x1c')]=function(_0x39bfd3,_0x37844c,_0x13ab2d,_0x5998d2){if(_0x37844c[_0xe081('0x1d')]){writeLog(_0x39bfd3,_0x37844c,_0xe081('0x1e'));return![];}if(!_0x37844c['online']){writeLog(_0x39bfd3,_0x37844c,_0xe081('0x1f'));return![];}if(_0x37844c[_0x13ab2d+_0xe081('0x20')]){writeLog(_0x39bfd3,_0x37844c,_0xe081('0x21'));return![];}if(_0x5998d2&&_0x37844c[_0xe081('0x22')](_0x13ab2d+'Capacity')&&_0x37844c[_0xe081('0x22')](_0x13ab2d+'CurrentCapacity')){if(_0x37844c[_0x13ab2d+_0xe081('0x23')]>0x0&&_0x37844c[_0x13ab2d+_0xe081('0x24')]>=_0x37844c[_0x13ab2d+_0xe081('0x23')]){writeLog(_0x39bfd3,_0x37844c,_0x13ab2d[_0xe081('0x25')]()+_0xe081('0x26'));return![];}}return!![];};exports[_0xe081('0x27')]=function(_0x504701,_0x16e39f,_0x15ea98,_0x3f2991,_0x431b4c){return sendNotification(!![],_0x504701,_0x16e39f,_0x15ea98,_0x3f2991,_0x431b4c);};exports[_0xe081('0x28')]=function(_0x2c07e8,_0x336ac1,_0x18f81b,_0xd39bc6,_0x49336d){return sendNotification(![],_0x2c07e8,_0x336ac1,_0x18f81b,_0xd39bc6,_0x49336d);};exports[_0xe081('0x29')]=function(_0x5516bf,_0x581b1f,_0x4a6248){var _0x3856ee=_0x581b1f[_0xe081('0x2a')][_0xe081('0x2b')];if(!_0x3856ee&&_0x4a6248){_0x3856ee=_0x4a6248['id'];}var _0x10e7c0=_[_0xe081('0x2c')](_0x5516bf[_0x581b1f[_0xe081('0x2d')]+_0xe081('0x2e')],function(_0x188883){var _0x5d0317=_[_0xe081('0x2f')](_0x581b1f[_0xe081('0x2d')])+_0xe081('0x30');return _0x188883[_0x5d0317]===_0x581b1f[_0xe081('0x2a')]['id'];});if(!_0x10e7c0&&_0x3856ee){_0x10e7c0=_[_0xe081('0x2c')](_0x5516bf[_0xe081('0x31')][_0x3856ee][_0x581b1f[_0xe081('0x2d')]+'WaitingInteractions'],function(_0x565ae9){return _0x565ae9['id']===_0x581b1f[_0xe081('0x2a')]['id'];});}return _0x10e7c0;};exports['saveWaitingNotification']=function(_0xd89b83,_0x2cfae4,_0x5c6611,_0x3f7127){_0xd89b83[_0xe081('0x31')][_0x5c6611['id']][_0x3f7127+_0xe081('0x32')][_0x2cfae4[_0xe081('0x33')]['id']]={'id':_0x2cfae4['interaction']['id']};};exports[_0xe081('0x34')]=function(_0x1ba2c0,_0x517b53,_0x5bbbdf,_0x43ce91){delete _0x1ba2c0[_0xe081('0x31')][_0x5bbbdf['id']][_0x43ce91+_0xe081('0x32')][_0x517b53[_0xe081('0x33')]['id']];};exports[_0xe081('0x35')]=writeLog;
\ No newline at end of file
+var _0xa539=['debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','some','agents','saveWaitingNotification','WaitingInteractions','writeLog','lodash','util','../../../../../config/environment','redis','defaults','localhost','socket.io-emitter','user:%s','name','user:save','split','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','emit','notification:%s','save','remove'];(function(_0x3e745f,_0x2e5955){var _0x218694=function(_0x3948de){while(--_0x3948de){_0x3e745f['push'](_0x3e745f['shift']());}};_0x218694(++_0x2e5955);}(_0xa539,0x1c2));var _0x9a53=function(_0x3fef2e,_0x57a85c){_0x3fef2e=_0x3fef2e-0x0;var _0x1a9634=_0xa539[_0x3fef2e];return _0x1a9634;};'use strict';var _=require(_0x9a53('0x0'));var util=require(_0x9a53('0x1'));var utils=require('../utils');var Redis=require('ioredis');var config=require(_0x9a53('0x2'));var logger=require('../../../../../config/logger')('routing');config[_0x9a53('0x3')]=_[_0x9a53('0x4')](config['redis'],{'host':_0x9a53('0x5'),'port':0x18eb});var io=require(_0x9a53('0x6'))(new Redis(config[_0x9a53('0x3')]));function sendNotification(_0x50f2ec,_0x54d668,_0x157473,_0x12f18c,_0x446005,_0x2bbdb2){io['to'](util['format'](_0x9a53('0x7'),_0x12f18c[_0x9a53('0x8')]))['emit'](_0x9a53('0x9'),_0x12f18c);var _0xf9af7a=_0x2bbdb2||{};var _0x2eb393=_0x157473[_0x9a53('0xa')]('.');var _0x1f9ed8={'uniqueid':_0x54d668,'channel':_0x2eb393[0x0],'id':_0x2eb393[0x1],'title':_0x2eb393[0x0]+_0x9a53('0xb'),'interactionId':_0x2eb393[0x2],'queue':_0x446005?_0x446005[_0x9a53('0x8')]:null,'sound':_0xf9af7a[_0x9a53('0xc')][_0x9a53('0xd')],'shake':_0xf9af7a[_0x9a53('0xc')]['notificationShake']};try{if(!_0xf9af7a[_0x9a53('0xe')]){_0xf9af7a[_0x9a53('0xe')]={};}if(_0x446005){_0xf9af7a['body']['queue']=_0x446005;}else if(_0xf9af7a['body'][_0x9a53('0xf')]){delete _0xf9af7a['body'][_0x9a53('0xf')];}_0x1f9ed8[_0x9a53('0x10')]=utils[_0x9a53('0x11')](_0xf9af7a[_0x9a53('0xc')]['notificationTemplate'],_0xf9af7a);}catch(_0x327462){_0x1f9ed8[_0x9a53('0x10')]=_0x9a53('0x12');logger[_0x9a53('0x13')](util[_0x9a53('0x14')](_0x9a53('0x15'),_0x54d668,_0x327462[_0x9a53('0x16')]));}io['to'](util[_0x9a53('0x14')]('user:%s',_0x12f18c[_0x9a53('0x8')]))[_0x9a53('0x17')](util['format'](_0x9a53('0x18'),_0x50f2ec?_0x9a53('0x19'):_0x9a53('0x1a')),_0x1f9ed8);}function writeLog(_0x46d53c,_0x333348,_0x420bc2){return logger[_0x9a53('0x1b')](util[_0x9a53('0x14')](_0x9a53('0x1c'),_0x46d53c,_0x333348[_0x9a53('0x8')],_0x420bc2));}exports[_0x9a53('0x1d')]=function(_0x120333,_0x20a185,_0xaa731a,_0x9f9350){if(_0x20a185[_0x9a53('0x1e')]){writeLog(_0x120333,_0x20a185,_0x9a53('0x1f'));return![];}if(!_0x20a185[_0x9a53('0x20')]){writeLog(_0x120333,_0x20a185,'OFFLINE');return![];}if(_0x20a185[_0xaa731a+_0x9a53('0x21')]){writeLog(_0x120333,_0x20a185,_0x9a53('0x22'));return![];}if(_0x9f9350&&_0x20a185[_0x9a53('0x23')](_0xaa731a+_0x9a53('0x24'))&&_0x20a185[_0x9a53('0x23')](_0xaa731a+_0x9a53('0x25'))){if(_0x20a185[_0xaa731a+_0x9a53('0x24')]>0x0&&_0x20a185[_0xaa731a+_0x9a53('0x25')]>=_0x20a185[_0xaa731a+_0x9a53('0x24')]){writeLog(_0x120333,_0x20a185,_0xaa731a[_0x9a53('0x26')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x9a53('0x27')]=function(_0x1d077a,_0x4dec38,_0x4d9f34,_0x4334d0,_0x317623){return sendNotification(!![],_0x1d077a,_0x4dec38,_0x4d9f34,_0x4334d0,_0x317623);};exports[_0x9a53('0x28')]=function(_0x287e1a,_0x478079,_0x5d0af7,_0x861d21,_0x1d6721){return sendNotification(![],_0x287e1a,_0x478079,_0x5d0af7,_0x861d21,_0x1d6721);};exports[_0x9a53('0x29')]=function(_0x340acc,_0x8a46a,_0x16dbbf){var _0x230897=_0x8a46a[_0x9a53('0x2a')][_0x9a53('0x2b')];if(!_0x230897&&_0x16dbbf){_0x230897=_0x16dbbf['id'];}var _0x2fc8d0=_['some'](_0x340acc[_0x8a46a[_0x9a53('0x2c')]+_0x9a53('0x2d')],function(_0x3a114b){var _0x4c4313=_[_0x9a53('0x2e')](_0x8a46a['channel'])+_0x9a53('0x2f');return _0x3a114b[_0x4c4313]===_0x8a46a[_0x9a53('0x2a')]['id'];});if(!_0x2fc8d0&&_0x230897){_0x2fc8d0=_[_0x9a53('0x30')](_0x340acc[_0x9a53('0x31')][_0x230897][_0x8a46a[_0x9a53('0x2c')]+'WaitingInteractions'],function(_0x51e1a9){return _0x51e1a9['id']===_0x8a46a[_0x9a53('0x2a')]['id'];});}return _0x2fc8d0;};exports[_0x9a53('0x32')]=function(_0x518b47,_0x496f46,_0x3d85d6,_0x1de8db){_0x518b47[_0x9a53('0x31')][_0x3d85d6['id']][_0x1de8db+'WaitingInteractions'][_0x496f46[_0x9a53('0x16')]['id']]={'id':_0x496f46[_0x9a53('0x2a')]['id']};};exports['removeWaitingNotification']=function(_0x7869f8,_0xdc7f02,_0x28398f,_0x305ff4){delete _0x7869f8[_0x9a53('0x31')][_0x28398f['id']][_0x305ff4+_0x9a53('0x33')][_0xdc7f02[_0x9a53('0x16')]['id']];};exports[_0x9a53('0x34')]=writeLog;
\ No newline at end of file
index 8aded32..57cced5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf18=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','error','isObject','stringify','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x501760,_0x5e3956){var _0x2180b5=function(_0x2744fd){while(--_0x2744fd){_0x501760['push'](_0x501760['shift']());}};_0x2180b5(++_0x5e3956);}(_0xbf18,0xfa));var _0x8bf1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbf18[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x8bf1('0x0'));var utils=require(_0x8bf1('0x1'));var logger=require(_0x8bf1('0x2'))(_0x8bf1('0x3'));var system=schema({'command':{'type':_0x8bf1('0x4'),'required':!![],'message':_0x8bf1('0x5')}});exports[_0x8bf1('0x6')]=function(_0x4d69f4,_0x564c9e){return function(_0x54c2ce){try{var _0x39a737={'command':_0x564c9e[0x0]};var _0x420f67=system[_0x8bf1('0x7')](_0x39a737,{'typecast':!![]});if(_0x420f67[_0x8bf1('0x8')]){logger['error']('[%s][SYSTEM]\x20%s',_0x4d69f4,_['map'](_0x420f67,_0x8bf1('0x9'))['join'](',\x20'));logger[_0x8bf1('0xa')](_0x8bf1('0xb'),_0x4d69f4);_0x54c2ce[_0x8bf1('0xc')]();}else{var _0x1cf57d=this;var _0x304d19=utils[_0x8bf1('0xd')](_0x564c9e[0x0],this);logger[_0x8bf1('0xa')](_0x8bf1('0xe'),_0x4d69f4,_0x304d19);sh[_0x8bf1('0xf')](_[_0x8bf1('0x10')](_0x304d19),function(_0x404bb6,_0x35a54f){logger[_0x8bf1('0xa')](_0x8bf1('0x11'),_0x4d69f4,_0x404bb6);if(_0x404bb6==0x0){var _0x58ee17=_0x35a54f[_0x8bf1('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x564c9e[0x1])||_[_0x8bf1('0x13')](_0x564c9e[0x1])){logger[_0x8bf1('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x4d69f4);_0x1cf57d[_0x8bf1('0x14')][_0x564c9e[0x1]]=_0x58ee17;}else{logger[_0x8bf1('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4d69f4,_0x564c9e[0x1],_0x58ee17);_0x1cf57d[_0x8bf1('0x14')][_0x564c9e[0x1]]=_0x58ee17;}}_0x54c2ce[_0x8bf1('0xc')]();});}}catch(_0x59b567){logger[_0x8bf1('0x15')]('[%s][SYSTEM]\x20%s',_0x4d69f4,_[_0x8bf1('0x16')](_0x59b567)?JSON[_0x8bf1('0x17')](_0x59b567):_0x59b567);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d69f4);_0x54c2ce[_0x8bf1('0xc')]();}};};
\ No newline at end of file
+var _0xab72=['isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x2178a4,_0x136768){var _0x3e9f4d=function(_0x212045){while(--_0x212045){_0x2178a4['push'](_0x2178a4['shift']());}};_0x3e9f4d(++_0x136768);}(_0xab72,0x123));var _0x2ab7=function(_0x3fae02,_0x4dcdef){_0x3fae02=_0x3fae02-0x0;var _0x577be4=_0xab72[_0x3fae02];return _0x577be4;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x2ab7('0x0'));var utils=require(_0x2ab7('0x1'));var logger=require(_0x2ab7('0x2'))(_0x2ab7('0x3'));var system=schema({'command':{'type':_0x2ab7('0x4'),'required':!![],'message':_0x2ab7('0x5')}});exports[_0x2ab7('0x6')]=function(_0x34d14a,_0x44287e){return function(_0x151fd0){try{var _0x6919d7={'command':_0x44287e[0x0]};var _0x1177cd=system['validate'](_0x6919d7,{'typecast':!![]});if(_0x1177cd['length']){logger[_0x2ab7('0x7')](_0x2ab7('0x8'),_0x34d14a,_[_0x2ab7('0x9')](_0x1177cd,_0x2ab7('0xa'))[_0x2ab7('0xb')](',\x20'));logger[_0x2ab7('0xc')](_0x2ab7('0xd'),_0x34d14a);_0x151fd0[_0x2ab7('0xe')]();}else{var _0x43def6=this;var _0x541c7e=utils[_0x2ab7('0xf')](_0x44287e[0x0],this);logger['info'](_0x2ab7('0x10'),_0x34d14a,_0x541c7e);sh[_0x2ab7('0x11')](_[_0x2ab7('0x12')](_0x541c7e),function(_0x48d8af,_0x1fdab7){logger[_0x2ab7('0xc')](_0x2ab7('0x13'),_0x34d14a,_0x48d8af);if(_0x48d8af==0x0){var _0x573850=_0x1fdab7[_0x2ab7('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x2ab7('0x15')](_0x44287e[0x1])||_['isEmpty'](_0x44287e[0x1])){logger[_0x2ab7('0xc')](_0x2ab7('0x16'),_0x34d14a);_0x43def6[_0x2ab7('0x17')][_0x44287e[0x1]]=_0x573850;}else{logger[_0x2ab7('0xc')](_0x2ab7('0x18'),_0x34d14a,_0x44287e[0x1],_0x573850);_0x43def6[_0x2ab7('0x17')][_0x44287e[0x1]]=_0x573850;}}_0x151fd0['next']();});}}catch(_0x5589ce){logger[_0x2ab7('0x7')](_0x2ab7('0x8'),_0x34d14a,_['isObject'](_0x5589ce)?JSON[_0x2ab7('0x19')](_0x5589ce):_0x5589ce);logger[_0x2ab7('0xc')](_0x2ab7('0xd'),_0x34d14a);_0x151fd0['next']();}};};
\ No newline at end of file
index 8d40be7..39b215c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58cb=['Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','validate','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x25b31d,_0x34726){var _0x4992d5=function(_0x43068b){while(--_0x43068b){_0x25b31d['push'](_0x25b31d['shift']());}};_0x4992d5(++_0x34726);}(_0x58cb,0x156));var _0xb58c=function(_0x307e48,_0x22009a){_0x307e48=_0x307e48-0x0;var _0x153af3=_0x58cb[_0x307e48];return _0x153af3;};'use strict';var schema=require(_0xb58c('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb58c('0x1')),'smsInteraction':require(_0xb58c('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xb58c('0x3'))};var logger=require(_0xb58c('0x4'))(_0xb58c('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xb58c('0x6')}});exports['consequence']=function(_0x510812,_0x28b360,_0x15dc88,_0x28d370){return function(_0xda3d59){try{var _0x57b1ed={'tag':_0x28b360[0x0]};var _0x38a8d4=tag[_0xb58c('0x0')](_0x57b1ed,{'typecast':!![]});if(_0x38a8d4[_0xb58c('0x7')]){logger[_0xb58c('0x8')](_0xb58c('0x9'),_0x510812,_[_0xb58c('0xa')](_0x38a8d4,'message')[_0xb58c('0xb')](',\x20'));logger['info'](_0xb58c('0xc'),_0x510812);_0xda3d59[_0xb58c('0xd')]();}else{var _0x3983cf={'ids':[_0x28b360[0x0]]};if(rpc[_0x28d370[_0xb58c('0xe')]+_0xb58c('0xf')]){rpc[_0x28d370['channel']+'Interaction'][_0xb58c('0x10')](_0x28d370[_0xb58c('0x11')]['id'],_0x3983cf)['then'](function(_0x13b5b2){logger[_0xb58c('0x12')](_0xb58c('0x13'),_0x510812,_0x28b360[0x1],_0x28d370[_0xb58c('0xe')],_0x28d370[_0xb58c('0x11')]['id']);})[_0xb58c('0x14')](function(_0x5249f0){logger[_0xb58c('0x8')](_0xb58c('0x9'),_0x510812,JSON['stringify'](_0x5249f0));logger[_0xb58c('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x510812);})['finally'](function(){_0xda3d59[_0xb58c('0xd')]();});}}}catch(_0x1345df){logger[_0xb58c('0x8')](_0xb58c('0x9'),_0x510812,_['isObject'](_0x1345df)?JSON['stringify'](_0x1345df):_0x1345df);logger[_0xb58c('0x12')](_0xb58c('0xc'),_0x510812);_0xda3d59[_0xb58c('0xd')]();}};};
\ No newline at end of file
+var _0xf9c9=['error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xf9c9,0x1db));var _0x9f9c=function(_0x395718,_0x20322d){_0x395718=_0x395718-0x0;var _0x3028b8=_0xf9c9[_0x395718];return _0x3028b8;};'use strict';var schema=require(_0x9f9c('0x0'));var _=require(_0x9f9c('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9f9c('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x9f9c('0x3')),'faxInteraction':require(_0x9f9c('0x4')),'whatsappInteraction':require(_0x9f9c('0x5'))};var logger=require(_0x9f9c('0x6'))(_0x9f9c('0x7'));var tag=schema({'tag':{'type':_0x9f9c('0x8'),'required':!![],'message':_0x9f9c('0x9')}});exports[_0x9f9c('0xa')]=function(_0x5008e9,_0x2de11b,_0x3e6b31,_0x51b85b){return function(_0x380d87){try{var _0x11064f={'tag':_0x2de11b[0x0]};var _0x52ecfd=tag[_0x9f9c('0x0')](_0x11064f,{'typecast':!![]});if(_0x52ecfd['length']){logger[_0x9f9c('0xb')](_0x9f9c('0xc'),_0x5008e9,_['map'](_0x52ecfd,_0x9f9c('0xd'))[_0x9f9c('0xe')](',\x20'));logger[_0x9f9c('0xf')](_0x9f9c('0x10'),_0x5008e9);_0x380d87[_0x9f9c('0x11')]();}else{var _0x37f90c={'ids':[_0x2de11b[0x0]]};if(rpc[_0x51b85b[_0x9f9c('0x12')]+_0x9f9c('0x13')]){rpc[_0x51b85b[_0x9f9c('0x12')]+_0x9f9c('0x13')][_0x9f9c('0x14')](_0x51b85b[_0x9f9c('0x15')]['id'],_0x37f90c)['then'](function(_0x506e32){logger['info'](_0x9f9c('0x16'),_0x5008e9,_0x2de11b[0x1],_0x51b85b['channel'],_0x51b85b[_0x9f9c('0x15')]['id']);})[_0x9f9c('0x17')](function(_0x1b282a){logger['error'](_0x9f9c('0xc'),_0x5008e9,JSON[_0x9f9c('0x18')](_0x1b282a));logger[_0x9f9c('0xf')](_0x9f9c('0x10'),_0x5008e9);})[_0x9f9c('0x19')](function(){_0x380d87[_0x9f9c('0x11')]();});}}}catch(_0x59fbeb){logger[_0x9f9c('0xb')](_0x9f9c('0xc'),_0x5008e9,_[_0x9f9c('0x1a')](_0x59fbeb)?JSON[_0x9f9c('0x18')](_0x59fbeb):_0x59fbeb);logger[_0x9f9c('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5008e9);_0x380d87[_0x9f9c('0x11')]();}};};
\ No newline at end of file
index 87c0b31..3e76eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2538=['info','stop','catch','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','stringify','utf8','POST','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','then'];(function(_0x7f509f,_0x3714fd){var _0x523cbd=function(_0x375d50){while(--_0x375d50){_0x7f509f['push'](_0x7f509f['shift']());}};_0x523cbd(++_0x3714fd);}(_0x2538,0x19c));var _0x8253=function(_0x3fe90c,_0x231b20){_0x3fe90c=_0x3fe90c-0x0;var _0x12c302=_0x2538[_0x3fe90c];return _0x12c302;};'use strict';var rp=require(_0x8253('0x0'));var logger=require(_0x8253('0x1'))(_0x8253('0x2'));var _=require('lodash');var arr=[];exports[_0x8253('0x3')]=function(_0x3dca28,_0x47dbb7){return function(_0x39b224){var _0x1db70e=_0x47dbb7[0xa];var _0x3bbbc4=_0x47dbb7[0xb];var _0x4e822e=_0x47dbb7[0xc];var _0x45d8b0=_0x47dbb7[0xd];var _0x1b06a1=_0x47dbb7[0xe];var _0x49ce2a=_0x47dbb7[0xf][_0x8253('0x4')](/\n/g,_0x8253('0x5'));var _0x10ceff=_0x47dbb7[0x10][_0x8253('0x4')](/\n/g,'\x20');if(!arr[_0x8253('0x6')](_0x3bbbc4)){arr[_0x8253('0x7')](_0x3bbbc4);var _0x44ef3b=_0x47dbb7[0x3];var _0x232429=_0x47dbb7[0x4];var _0x11c86b=_0x47dbb7[0x1];var _0x2fd993=_0x47dbb7[0x0];var _0x1ac1b4={};_0x1ac1b4[_0x8253('0x8')]=_0x47dbb7[0x8]+_0x8253('0x9')+_0x4e822e+'|'+_0x1db70e+'|'+_0x45d8b0+'|'+_0x3bbbc4+'|'+_0x1b06a1;_0x1ac1b4[_0x8253('0xa')]=_0x47dbb7[0x7]+_0x8253('0x9')+_0x4e822e+'|'+_0x1db70e+'|'+_0x45d8b0+'|'+_0x3bbbc4+'|'+_0x1b06a1+'|'+_0x49ce2a+'|'+_0x10ceff;_0x1ac1b4[_0x8253('0xb')]=_0x47dbb7[0x9];var _0x240a3a={};_0x240a3a[_0x8253('0xc')]=_0x8253('0xd');_0x240a3a['method']=_0x8253('0xe');var _0x3dcd06=[];_0x3dcd06[_0x8253('0x7')](_0x47dbb7[0x2]);_0x3dcd06['push'](_0x47dbb7[0x5]);_0x3dcd06[_0x8253('0x7')](_0x47dbb7[0x6]);_0x240a3a['params']=_0x3dcd06;_0x240a3a['id']=0x1;var _0x57384a=JSON[_0x8253('0xf')](_0x240a3a);var _0x48313e={'encoding':_0x8253('0x10'),'method':_0x8253('0x11'),'timeout':0x2710,'url':_0x44ef3b,'headers':{'Content-Type':'application/json-rpc'},'body':_0x57384a};return rp(_0x48313e)['then'](function(_0x462e71){const _0x285430=JSON[_0x8253('0x12')](_0x462e71);if(!_0x285430['result']['logged']){throw new Error(_0x8253('0x13'));}var _0x50b31a=_0x3bbbc4;var _0x488e77=_0x8253('0x14')+_0x11c86b+'&serviceId='+_0x2fd993+_0x8253('0x15')+_0x50b31a+'&data='+JSON[_0x8253('0xf')](_0x1ac1b4);var _0x107d14=_0x232429+'?'+_0x488e77;return rp(_0x107d14);})[_0x8253('0x16')](function(_0x19ad8e){logger[_0x8253('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x3dca28,_0x19ad8e);_0x39b224[_0x8253('0x18')]();})[_0x8253('0x19')](function(_0x1a6d5b){logger['error'](_0x8253('0x1a'),_0x3dca28,_[_0x8253('0x1b')](_0x1a6d5b)?JSON[_0x8253('0xf')](_0x1a6d5b):_0x1a6d5b);_0x39b224['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3dca28);_0x39b224[_0x8253('0x1c')]();}};};
\ No newline at end of file
+var _0xa47a=['lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','params','stringify','parse','channelId=','&serviceId=','&sessionId=','&data=','info','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0xa47a,0x8a));var _0xaa47=function(_0x1d9f7d,_0x581324){_0x1d9f7d=_0x1d9f7d-0x0;var _0x54ceb6=_0xa47a[_0x1d9f7d];return _0x54ceb6;};'use strict';var rp=require(_0xaa47('0x0'));var logger=require('../../../../config/logger')(_0xaa47('0x1'));var _=require(_0xaa47('0x2'));var arr=[];exports[_0xaa47('0x3')]=function(_0x381553,_0x16d959){return function(_0x193205){var _0x1e2754=_0x16d959[0xa];var _0x513271=_0x16d959[0xb];var _0x2a4800=_0x16d959[0xc];var _0xff610f=_0x16d959[0xd];var _0x8b15ae=_0x16d959[0xe];var _0xcf20f0=_0x16d959[0xf][_0xaa47('0x4')](/\n/g,_0xaa47('0x5'));var _0x39f9f0=_0x16d959[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x513271)){arr[_0xaa47('0x6')](_0x513271);var _0xec2f51=_0x16d959[0x3];var _0x38c835=_0x16d959[0x4];var _0x2fb4e1=_0x16d959[0x1];var _0x4b0f80=_0x16d959[0x0];var _0x58c9bc={};_0x58c9bc[_0xaa47('0x7')]=_0x16d959[0x8]+'?params='+_0x2a4800+'|'+_0x1e2754+'|'+_0xff610f+'|'+_0x513271+'|'+_0x8b15ae;_0x58c9bc[_0xaa47('0x8')]=_0x16d959[0x7]+_0xaa47('0x9')+_0x2a4800+'|'+_0x1e2754+'|'+_0xff610f+'|'+_0x513271+'|'+_0x8b15ae+'|'+_0xcf20f0+'|'+_0x39f9f0;_0x58c9bc[_0xaa47('0xa')]=_0x16d959[0x9];var _0x5b48f0={};_0x5b48f0[_0xaa47('0xb')]=_0xaa47('0xc');_0x5b48f0[_0xaa47('0xd')]=_0xaa47('0xe');var _0x17d9ce=[];_0x17d9ce[_0xaa47('0x6')](_0x16d959[0x2]);_0x17d9ce[_0xaa47('0x6')](_0x16d959[0x5]);_0x17d9ce[_0xaa47('0x6')](_0x16d959[0x6]);_0x5b48f0[_0xaa47('0xf')]=_0x17d9ce;_0x5b48f0['id']=0x1;var _0x21714e=JSON[_0xaa47('0x10')](_0x5b48f0);var _0x38696d={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0xec2f51,'headers':{'Content-Type':'application/json-rpc'},'body':_0x21714e};return rp(_0x38696d)['then'](function(_0x292590){const _0x1bdd75=JSON[_0xaa47('0x11')](_0x292590);if(!_0x1bdd75['result']['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x417f99=_0x513271;var _0x217fb3=_0xaa47('0x12')+_0x2fb4e1+_0xaa47('0x13')+_0x4b0f80+_0xaa47('0x14')+_0x417f99+_0xaa47('0x15')+JSON[_0xaa47('0x10')](_0x58c9bc);var _0x17e202=_0x38c835+'?'+_0x217fb3;return rp(_0x17e202);})['then'](function(_0x8d414d){logger[_0xaa47('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x381553,_0x8d414d);_0x193205[_0xaa47('0x17')]();})['catch'](function(_0xd000a9){logger[_0xaa47('0x18')](_0xaa47('0x19'),_0x381553,_[_0xaa47('0x1a')](_0xd000a9)?JSON[_0xaa47('0x10')](_0xd000a9):_0xd000a9);_0x193205['stop']();});}else{logger[_0xaa47('0x16')](_0xaa47('0x1b'),_0x381553);_0x193205['next']();}};};
\ No newline at end of file
index 28b94f1..b210118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['merge','body','account','list','exports','render'];(function(_0xfdd7ba,_0x10ad1a){var _0xd3cb03=function(_0x4557fa){while(--_0x4557fa){_0xfdd7ba['push'](_0xfdd7ba['shift']());}};_0xd3cb03(++_0x10ad1a);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
+var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x29d7bd,_0x256be3){var _0x16f1c6=function(_0xb609e1){while(--_0xb609e1){_0x29d7bd['push'](_0x29d7bd['shift']());}};_0x16f1c6(++_0x256be3);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
index 4d72166..cb1f305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2a2=['../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','split','tag','TagId','tvox','getMustacheRender','account','ContactId','body','intervals','./applications/','consequence','priority','Push\x20new\x20rule','error','rules','info','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','waiting','mailQueues','loggedIn','paused','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport'];(function(_0x3fec27,_0x4d2de5){var _0x774949=function(_0x4cacac){while(--_0x4cacac){_0x3fec27['push'](_0x3fec27['shift']());}};_0x774949(++_0x4d2de5);}(_0xb2a2,0xb9));var _0x2b2a=function(_0x291ada,_0x51acbe){_0x291ada=_0x291ada-0x0;var _0x1009c3=_0xb2a2[_0x291ada];return _0x1009c3;};'use strict';var _=require(_0x2b2a('0x0'));var util=require(_0x2b2a('0x1'));var path=require(_0x2b2a('0x2'));var fs=require('fs');var jayson=require(_0x2b2a('0x3'));var BPromise=require(_0x2b2a('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0x2b2a('0x5'))(_0x2b2a('0x6'));var rpc={'openchannelQueueReport':require(_0x2b2a('0x7')),'mailQueueReport':require(_0x2b2a('0x8')),'chatQueueReport':require(_0x2b2a('0x9')),'smsQueueReport':require(_0x2b2a('0xa')),'faxQueueReport':require(_0x2b2a('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x2b2a('0xc'));function getId(_0xf1111d,_0x5913e1,_0x198c6c){return util[_0x2b2a('0xd')](_0x2b2a('0xe'),_0xf1111d,_0x5913e1||0x0,_0x198c6c||0x0);}function getIntervals(_0x2b242,_0x214897){var _0x528677=[];if(!_[_0x2b2a('0xf')](_0x214897[_0x2b2a('0x10')])&&!_[_0x2b2a('0xf')](_0x2b242[_0x214897['IntervalId']])&&!_[_0x2b2a('0xf')](_0x2b242[_0x214897[_0x2b2a('0x10')]][_0x2b2a('0x11')])){_0x528677=_[_0x2b2a('0x12')](_0x2b242[_0x214897[_0x2b2a('0x10')]][_0x2b2a('0x11')],'interval');}else if(!_['isNil'](_0x214897[_0x2b2a('0x13')])){_0x528677=[_0x214897[_0x2b2a('0x13')]];}return _0x528677;}exports[_0x2b2a('0x14')]=function(_0x14d628){_0x14d628['rules']={};return new BPromise(function(_0x5720da,_0x4d517e){var _0x473e05={'Start':function(_0x5bf362){var _0x3fc677=this;return new Promise(function(_0x24451b,_0x5d172f){if(_0x5bf362){try{var _0x2f7de6=[];var _0x4798e7=getId(_0x5bf362[_0x2b2a('0x15')],_0x5bf362[_0x2b2a('0x16')]?_0x5bf362[_0x2b2a('0x16')]['id']:0x0,_0x5bf362['interaction']?_0x5bf362[_0x2b2a('0x17')]['id']:0x0);var _0x2acdb3=sUtils[_0x2b2a('0x18')](_0x14d628,_0x5bf362);if(!_0x2acdb3&&_0x5bf362[_0x2b2a('0x19')]&&_['isArray'](_0x5bf362['applications'])&&_0x5bf362[_0x2b2a('0x19')][_0x2b2a('0x1a')]){for(var _0x3fe00f=0x0;_0x3fe00f<_0x5bf362[_0x2b2a('0x19')][_0x2b2a('0x1a')];_0x3fe00f+=0x1){var _0x436840=_0x5bf362[_0x2b2a('0x19')][_0x3fe00f];if(fs[_0x2b2a('0x1b')](path[_0x2b2a('0x1c')](__dirname,'applications',_0x436840[_0x2b2a('0x1d')]+_0x2b2a('0x1e')))){var _0x911be7=[];switch(_0x436840[_0x2b2a('0x1d')][_0x2b2a('0x1f')]()){case _0x2b2a('0x20'):var _0x3cbef2=_0x436840['appdata']['split'](',');if(_0x5bf362[_0x2b2a('0x15')]===_0x2b2a('0x21')){_0x911be7[_0x2b2a('0x22')](_0x3cbef2[0x0]);_0x911be7[_0x2b2a('0x22')](_0x3cbef2[0x1]);_0x911be7[_0x2b2a('0x22')](_0x3cbef2[_0x2b2a('0x23')](0x2,_0x3cbef2[_0x2b2a('0x1a')])[_0x2b2a('0x1c')](','));}else{_0x911be7[_0x2b2a('0x22')](_0x3cbef2[0x0]);_0x911be7[_0x2b2a('0x22')](_0x3cbef2[_0x2b2a('0x23')](0x1,_0x3cbef2[_0x2b2a('0x1a')])[_0x2b2a('0x1c')](','));}break;case _0x2b2a('0x24'):var _0x45bc79=_0x436840[_0x2b2a('0x25')]['split'](',');_0x911be7['push'](_0x45bc79[0x0]);_0x911be7[_0x2b2a('0x22')](_0x45bc79[0x1]);_0x911be7[_0x2b2a('0x22')](_0x45bc79[_0x2b2a('0x23')](0x2,_0x45bc79[_0x2b2a('0x1a')])[_0x2b2a('0x1c')](','));break;case _0x2b2a('0x26'):var _0x5f38a6=_0x436840['appdata']['split'](',');_0x911be7[_0x2b2a('0x22')](_0x5f38a6[0x0]);_0x911be7['push'](_0x5f38a6[0x1]);_0x911be7[_0x2b2a('0x22')](_0x5f38a6[0x2]);_0x911be7['push'](_0x5f38a6[0x3]);_0x911be7[_0x2b2a('0x22')](_0x5f38a6[_0x2b2a('0x23')](0x4,_0x5f38a6[_0x2b2a('0x1a')])['join'](','));break;case _0x2b2a('0x27'):var _0x1dfc19=_0x436840[_0x2b2a('0x25')][_0x2b2a('0x28')](',');_0x911be7['push'](_0x1dfc19[0x0]);_0x911be7['push'](_0x1dfc19[0x1]);_0x911be7['push'](_0x1dfc19[0x2]);_0x911be7[_0x2b2a('0x22')](_0x1dfc19[0x3]);_0x911be7[_0x2b2a('0x22')](_0x1dfc19['slice'](0x4,_0x1dfc19[_0x2b2a('0x1a')])['join'](','));break;case _0x2b2a('0x16'):_0x911be7[_0x2b2a('0x22')](_0x436840[_0x2b2a('0x25')]);break;case _0x2b2a('0x29'):_0x911be7['push'](_0x436840[_0x2b2a('0x2a')]);_0x911be7[_0x2b2a('0x22')](_0x436840[_0x2b2a('0x25')]);break;case _0x2b2a('0x2b'):var _0x20a442=utils[_0x2b2a('0x2c')](_0x5bf362[_0x2b2a('0x2d')]['notificationTemplate'],_0x5bf362);var _0x326bd8=_0x436840[_0x2b2a('0x25')][_0x2b2a('0x28')](',');_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x0]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x1]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x2]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x3]);_0x911be7['push'](_0x326bd8[0x4]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x5]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x6]);_0x911be7['push'](_0x326bd8[0x7]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x8]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0x9]);_0x911be7[_0x2b2a('0x22')](_0x326bd8[0xa]);_0x911be7[_0x2b2a('0x22')](_0x5bf362[_0x2b2a('0x17')]['id']);_0x911be7[_0x2b2a('0x22')](_0x5bf362['message']['id']);_0x911be7[_0x2b2a('0x22')](_0x436840['ChatWebsiteId']);_0x911be7[_0x2b2a('0x22')](_0x5bf362[_0x2b2a('0x17')][_0x2b2a('0x2e')]);_0x911be7[_0x2b2a('0x22')](_0x5bf362[_0x2b2a('0x2f')][_0x2b2a('0x2f')]);_0x911be7['push'](_0x20a442);break;default:_0x911be7=_[_0x2b2a('0xf')](_0x436840[_0x2b2a('0x25')])?[]:_0x436840[_0x2b2a('0x25')][_0x2b2a('0x28')](',');}var _0x1faff1={'id':util[_0x2b2a('0xd')]('%s:%s:%s',_0x4798e7,_0x436840['id'],_0x436840[_0x2b2a('0x1d')]),'condition':require('./interval')['condition'](_0x4798e7,getIntervals(_0x14d628[_0x2b2a('0x30')],_0x436840),_0x14d628),'consequence':require(_0x2b2a('0x31')+_0x436840['app'])[_0x2b2a('0x32')](_0x4798e7,_0x911be7,_0x14d628,_0x5bf362),'p':_0x436840[_0x2b2a('0x33')]||0x0};logger['info'](_0x2b2a('0x34'),_0x1faff1['id'],'on\x20interval',getIntervals(_0x14d628[_0x2b2a('0x30')],_0x436840)[_0x2b2a('0x1c')]('\x20|\x20'));_0x2f7de6[_0x2b2a('0x22')](_0x1faff1);}else{logger[_0x2b2a('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x2b2a('0x1c')](__dirname,'applications',_0x436840['app']+_0x2b2a('0x1e')));}}_0x14d628[_0x2b2a('0x36')][_0x4798e7]=new RuleEngine(_0x2f7de6);_0x14d628[_0x2b2a('0x36')][_0x4798e7]['execute'](_0x5bf362,function(_0x236a48){logger[_0x2b2a('0x37')](_0x2b2a('0x38'),JSON['stringify'](_0x236a48[_0x2b2a('0x39')]));if(_0x14d628['rules'][_0x4798e7]){_0x14d628['rules'][_0x4798e7]['emit'](_0x2b2a('0x3a'));}});return _0x24451b({'code':0xc8,'message':_0x5bf362});}else{if(_0x2acdb3){logger[_0x2b2a('0x37')](util[_0x2b2a('0xd')](_0x2b2a('0x3b'),_0x4798e7));}else{logger['info'](_0x2b2a('0x3c'));}return _0x24451b({'code':0xc8,'message':_0x5bf362});}}catch(_0x5c0fad){logger[_0x2b2a('0x35')](_0x5c0fad['stack']);return _0x5d172f(_0x3fc677[_0x2b2a('0x35')](0x1f4,_0x5c0fad));}}return _0x5d172f(_0x2b2a('0x3d'));});},'AcceptMessage':function(_0x4c4028){var _0x351e5a=this;return new Promise(function(_0x49ec8f,_0xe37611){if(_0x4c4028[_0x2b2a('0x3e')]&&_0x4c4028[_0x2b2a('0x3e')]['id']){if(_0x14d628[_0x2b2a('0x3f')][_0x4c4028[_0x2b2a('0x3e')]['id']]){_0x14d628['agents'][_0x4c4028[_0x2b2a('0x3e')]['id']][_0x2b2a('0x40')]=![];_0x14d628['agents'][_0x4c4028[_0x2b2a('0x3e')]['id']][_0x2b2a('0x41')]=undefined;}}if(_0x4c4028['message']&&_0x4c4028[_0x2b2a('0x16')]['id']){try{var _0x2cbdf3=getId(_0x4c4028['channel'],_0x4c4028[_0x2b2a('0x16')]?_0x4c4028[_0x2b2a('0x16')]['id']:0x0,_0x4c4028[_0x2b2a('0x17')]?_0x4c4028['interaction']['id']:0x0);if(_0x14d628['rules'][_0x2cbdf3]){_0x14d628[_0x2b2a('0x36')][_0x2cbdf3][_0x2b2a('0x42')](_0x2b2a('0x43'));if(rpc[_0x4c4028[_0x2b2a('0x15')]+_0x2b2a('0x44')]){rpc[_0x4c4028[_0x2b2a('0x15')]+_0x2b2a('0x44')][_0x2b2a('0x45')](_0x2cbdf3,{'UserId':_0x4c4028['message'][_0x2b2a('0x46')]})['catch'](function(){logger[_0x2b2a('0x35')]('error\x20update\x20queue\x20report');});}}return _0x49ec8f({'code':0xc8,'message':_0x4c4028});}catch(_0x5bcd5e){logger[_0x2b2a('0x35')](_0x5bcd5e[_0x2b2a('0x47')]);return _0xe37611(_0x351e5a['error'](0x1f4,_0x5bcd5e));}}logger[_0x2b2a('0x35')](_0x2b2a('0x48'));return _0xe37611(_0x351e5a[_0x2b2a('0x35')](0x1f4,_0x2b2a('0x48')));});},'RejectMessage':function(_0x4e447e){var _0x408e5b=this;return new Promise(function(_0x117f3e,_0x31eeeb){if(_0x4e447e['agent']&&_0x4e447e[_0x2b2a('0x3e')]['id']){try{if(_0x14d628[_0x2b2a('0x3f')][_0x4e447e[_0x2b2a('0x3e')]['id']]){_0x14d628[_0x2b2a('0x3f')][_0x4e447e[_0x2b2a('0x3e')]['id']][_0x2b2a('0x40')]=![];_0x14d628['agents'][_0x4e447e[_0x2b2a('0x3e')]['id']][_0x2b2a('0x41')]=undefined;}return _0x117f3e({'code':0xc8,'message':_0x4e447e});}catch(_0x1a64ae){logger[_0x2b2a('0x35')](_0x1a64ae[_0x2b2a('0x47')]);return _0x31eeeb(_0x408e5b[_0x2b2a('0x35')](0x1f4,_0x1a64ae));}}logger['error'](_0x2b2a('0x48'));return _0x31eeeb(_0x408e5b[_0x2b2a('0x35')](0x1f4,_0x2b2a('0x48')));});},'AbandonInteraction':function(_0x5182cc){var _0x3b7afc=this;return new Promise(function(_0x3b8f4e,_0x43e0fd){if(_0x5182cc[_0x2b2a('0x15')]&&_0x5182cc[_0x2b2a('0x17')]&&_0x5182cc[_0x2b2a('0x17')]['id']){try{var _0x45467d=getId(_0x5182cc[_0x2b2a('0x15')],_0x5182cc[_0x2b2a('0x16')]?_0x5182cc[_0x2b2a('0x16')]['id']:0x0,_0x5182cc[_0x2b2a('0x17')]?_0x5182cc[_0x2b2a('0x17')]['id']:0x0);if(_0x14d628['rules'][_0x45467d]){_0x14d628[_0x2b2a('0x36')][_0x45467d][_0x2b2a('0x42')]('end');}return _0x3b8f4e({'code':0xc8,'message':_0x5182cc});}catch(_0x4aa7cd){logger[_0x2b2a('0x35')](_0x4aa7cd[_0x2b2a('0x47')]);return _0x43e0fd(_0x3b7afc[_0x2b2a('0x35')](0x1f4,_0x4aa7cd));}}logger['error'](_0x2b2a('0x48'));return _0x43e0fd(_0x3b7afc[_0x2b2a('0x35')](0x1f4,_0x2b2a('0x48')));});},'AgentCapacity':function(_0x3022cf){var _0x5819de=this;return new Promise(function(_0x127695,_0x435107){if(_0x14d628[_0x2b2a('0x3f')][_0x2b2a('0x49')](_0x3022cf['id'])){for(var _0x30dbb4 in _0x3022cf['capacity']){if(_0x3022cf[_0x2b2a('0x4a')][_0x2b2a('0x49')](_0x30dbb4)){if(_0x14d628[_0x2b2a('0x3f')][_0x3022cf['id']]['hasOwnProperty'](_0x30dbb4+'CurrentCapacity')){_0x14d628[_0x2b2a('0x3f')][_0x3022cf['id']][_0x30dbb4+_0x2b2a('0x4b')]=parseInt(_0x3022cf[_0x2b2a('0x4a')][_0x30dbb4],0xa);}}}_0x14d628[_0x2b2a('0x3f')][_0x3022cf['id']]['updateRealtime']();return _0x127695({'code':0xc8,'message':_0x14d628[_0x2b2a('0x3f')][_0x3022cf['id']]});}else{return _0x435107(_0x5819de['error'](0x1f4,_0x2b2a('0x4c')));}});},'Agents':function(_0x239dd3){return new Promise(function(_0x325628){var _0x1727fd=_['values'](_0x14d628[_0x2b2a('0x3f')]);if(_0x239dd3&&_0x239dd3['id']){var _0x4fc94a=_['find'](_0x1727fd,function(_0xa9e095){return _0xa9e095['id']===_0x239dd3['id'];});_0x325628(_0x4fc94a);}else{_0x325628({'count':_0x1727fd[_0x2b2a('0x1a')],'rows':_0x1727fd});}});},'ChatQueues':function(){return new Promise(function(_0xbc3da6){var _0x321a40=[];for(var _0x5d36c3 in _0x14d628[_0x2b2a('0x4d')]){if(_0x14d628[_0x2b2a('0x4d')][_0x2b2a('0x49')](_0x5d36c3)){var _0x416b04=_0x14d628['chatQueues'][_0x5d36c3];var _0x4a582e={'id':_0x416b04['id'],'available':_0x416b04[_0x2b2a('0x4e')],'loggedIn':_0x416b04['loggedIn'],'name':_0x416b04['name'],'paused':_0x416b04['paused'],'waiting':_0x416b04[_0x2b2a('0x4f')]};_0x321a40[_0x2b2a('0x22')](_0x4a582e);}}_0xbc3da6({'count':_0x321a40[_0x2b2a('0x1a')],'rows':_0x321a40});});},'MailQueues':function(){return new Promise(function(_0x58c09a){var _0x30280d=[];for(var _0x579934 in _0x14d628[_0x2b2a('0x50')]){if(_0x14d628['mailQueues']['hasOwnProperty'](_0x579934)){var _0x148ff7=_0x14d628[_0x2b2a('0x50')][_0x579934];var _0x3d53ac={'id':_0x148ff7['id'],'available':_0x148ff7[_0x2b2a('0x4e')],'loggedIn':_0x148ff7[_0x2b2a('0x51')],'name':_0x148ff7['name'],'paused':_0x148ff7[_0x2b2a('0x52')],'waiting':_0x148ff7[_0x2b2a('0x4f')]};_0x30280d['push'](_0x3d53ac);}}_0x58c09a({'count':_0x30280d[_0x2b2a('0x1a')],'rows':_0x30280d});});},'OpenchannelQueues':function(){return new Promise(function(_0x4cad5d){var _0x46a89c=[];for(var _0x1225ae in _0x14d628[_0x2b2a('0x53')]){if(_0x14d628[_0x2b2a('0x53')][_0x2b2a('0x49')](_0x1225ae)){var _0x16637c=_0x14d628[_0x2b2a('0x53')][_0x1225ae];var _0x2aab44={'id':_0x16637c['id'],'available':_0x16637c[_0x2b2a('0x4e')],'loggedIn':_0x16637c[_0x2b2a('0x51')],'name':_0x16637c[_0x2b2a('0x54')],'paused':_0x16637c['paused'],'waiting':_0x16637c['waiting']};_0x46a89c['push'](_0x2aab44);}}_0x4cad5d({'count':_0x46a89c[_0x2b2a('0x1a')],'rows':_0x46a89c});});},'SmsQueues':function(){return new Promise(function(_0x3cf50e){var _0x6f9830=[];for(var _0x5e2b52 in _0x14d628[_0x2b2a('0x55')]){if(_0x14d628[_0x2b2a('0x55')][_0x2b2a('0x49')](_0x5e2b52)){var _0x51bc0a=_0x14d628[_0x2b2a('0x55')][_0x5e2b52];var _0xe68b69={'id':_0x51bc0a['id'],'available':_0x51bc0a[_0x2b2a('0x4e')],'loggedIn':_0x51bc0a[_0x2b2a('0x51')],'name':_0x51bc0a[_0x2b2a('0x54')],'paused':_0x51bc0a[_0x2b2a('0x52')],'waiting':_0x51bc0a['waiting']};_0x6f9830[_0x2b2a('0x22')](_0xe68b69);}}_0x3cf50e({'count':_0x6f9830[_0x2b2a('0x1a')],'rows':_0x6f9830});});},'FaxQueues':function(){return new Promise(function(_0x500e62){var _0x571f9e=[];for(var _0xd137e0 in _0x14d628[_0x2b2a('0x56')]){if(_0x14d628[_0x2b2a('0x56')][_0x2b2a('0x49')](_0xd137e0)){var _0x43a92c=_0x14d628[_0x2b2a('0x56')][_0xd137e0];var _0x1b7573={'id':_0x43a92c['id'],'available':_0x43a92c[_0x2b2a('0x4e')],'loggedIn':_0x43a92c[_0x2b2a('0x51')],'name':_0x43a92c[_0x2b2a('0x54')],'paused':_0x43a92c[_0x2b2a('0x52')],'waiting':_0x43a92c[_0x2b2a('0x4f')]};_0x571f9e['push'](_0x1b7573);}}_0x500e62({'count':_0x571f9e[_0x2b2a('0x1a')],'rows':_0x571f9e});});},'WhatsappQueues':function(){return new Promise(function(_0x36eea8){var _0x271988=[];for(var _0x3833a9 in _0x14d628['whatsappQueues']){if(_0x14d628[_0x2b2a('0x57')][_0x2b2a('0x49')](_0x3833a9)){var _0x5e85df=_0x14d628[_0x2b2a('0x57')][_0x3833a9];var _0x199354={'id':_0x5e85df['id'],'available':_0x5e85df['available'],'loggedIn':_0x5e85df[_0x2b2a('0x51')],'name':_0x5e85df[_0x2b2a('0x54')],'paused':_0x5e85df[_0x2b2a('0x52')],'waiting':_0x5e85df[_0x2b2a('0x4f')]};_0x271988[_0x2b2a('0x22')](_0x199354);}}_0x36eea8({'count':_0x271988[_0x2b2a('0x1a')],'rows':_0x271988});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4ac17d){var _0x13716b=_[_0x2b2a('0x58')](_0x14d628['chatQueuesWaitingInteractions']);_0x4ac17d({'count':_0x13716b[_0x2b2a('0x1a')],'rows':_0x13716b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3c3a08){var _0x4602b8=_[_0x2b2a('0x58')](_0x14d628[_0x2b2a('0x59')]);_0x3c3a08({'count':_0x4602b8[_0x2b2a('0x1a')],'rows':_0x4602b8});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3ec3b3){var _0x345b2b=_[_0x2b2a('0x58')](_0x14d628[_0x2b2a('0x5a')]);_0x3ec3b3({'count':_0x345b2b[_0x2b2a('0x1a')],'rows':_0x345b2b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x347830){var _0x544573=_[_0x2b2a('0x58')](_0x14d628[_0x2b2a('0x5b')]);_0x347830({'count':_0x544573[_0x2b2a('0x1a')],'rows':_0x544573});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4fa5dd){var _0x50ea62=_[_0x2b2a('0x58')](_0x14d628['faxQueuesWaitingInteractions']);_0x4fa5dd({'count':_0x50ea62[_0x2b2a('0x1a')],'rows':_0x50ea62});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3adb92){var _0x2a55b4=_[_0x2b2a('0x58')](_0x14d628['whatsappQueuesWaitingInteractions']);_0x3adb92({'count':_0x2a55b4['length'],'rows':_0x2a55b4});});}};var _0x1ca500=jayson[_0x2b2a('0x5c')](_0x473e05)[_0x2b2a('0x5d')]();_0x1ca500['on'](_0x2b2a('0x35'),function(_0x42c0a5){logger['error'](JSON[_0x2b2a('0x5e')](_0x42c0a5));return _0x4d517e(_0x42c0a5);});_0x1ca500[_0x2b2a('0x14')](0x232c,_0x2b2a('0x5f'),function(){console['log'](_0x2b2a('0x60'),0x232c);return _0x5720da(_0x2b2a('0x61')+0x232c);});});};
\ No newline at end of file
+var _0x5b54=['name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','channel','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn'];(function(_0xd5caf0,_0xc24b01){var _0x54b197=function(_0x589f98){while(--_0x589f98){_0xd5caf0['push'](_0xd5caf0['shift']());}};_0x54b197(++_0xc24b01);}(_0x5b54,0x1c4));var _0x45b5=function(_0x411c8e,_0x43ff51){_0x411c8e=_0x411c8e-0x0;var _0x1c15f1=_0x5b54[_0x411c8e];return _0x1c15f1;};'use strict';var _=require(_0x45b5('0x0'));var util=require('util');var path=require(_0x45b5('0x1'));var fs=require('fs');var jayson=require(_0x45b5('0x2'));var BPromise=require(_0x45b5('0x3'));var utils=require(_0x45b5('0x4'));var sUtils=require(_0x45b5('0x5'));var logger=require(_0x45b5('0x6'))(_0x45b5('0x7'));var rpc={'openchannelQueueReport':require(_0x45b5('0x8')),'mailQueueReport':require(_0x45b5('0x9')),'chatQueueReport':require(_0x45b5('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x45b5('0xb')),'whatsappQueueReport':require(_0x45b5('0xc'))};var RuleEngine=require(_0x45b5('0xd'));function getId(_0x5edd6a,_0x16c09e,_0x48b769){return util[_0x45b5('0xe')](_0x45b5('0xf'),_0x5edd6a,_0x16c09e||0x0,_0x48b769||0x0);}function getIntervals(_0x505d33,_0x106c0b){var _0x2a72af=[];if(!_[_0x45b5('0x10')](_0x106c0b[_0x45b5('0x11')])&&!_[_0x45b5('0x10')](_0x505d33[_0x106c0b[_0x45b5('0x11')]])&&!_[_0x45b5('0x10')](_0x505d33[_0x106c0b['IntervalId']][_0x45b5('0x12')])){_0x2a72af=_[_0x45b5('0x13')](_0x505d33[_0x106c0b['IntervalId']][_0x45b5('0x12')],_0x45b5('0x14'));}else if(!_[_0x45b5('0x10')](_0x106c0b[_0x45b5('0x14')])){_0x2a72af=[_0x106c0b[_0x45b5('0x14')]];}return _0x2a72af;}exports['listen']=function(_0x1dfa7e){_0x1dfa7e['rules']={};return new BPromise(function(_0x4241b7,_0x3fc540){var _0x2846c7={'Start':function(_0xd14400){var _0x5e06e5=this;return new Promise(function(_0x54c545,_0x5609f3){if(_0xd14400){try{var _0x4313ac=[];var _0x17a921=getId(_0xd14400['channel'],_0xd14400[_0x45b5('0x15')]?_0xd14400[_0x45b5('0x15')]['id']:0x0,_0xd14400['interaction']?_0xd14400[_0x45b5('0x16')]['id']:0x0);var _0x36c050=sUtils[_0x45b5('0x17')](_0x1dfa7e,_0xd14400);if(!_0x36c050&&_0xd14400['applications']&&_[_0x45b5('0x18')](_0xd14400['applications'])&&_0xd14400[_0x45b5('0x19')][_0x45b5('0x1a')]){for(var _0x13fae3=0x0;_0x13fae3<_0xd14400[_0x45b5('0x19')]['length'];_0x13fae3+=0x1){var _0x1a3b80=_0xd14400[_0x45b5('0x19')][_0x13fae3];if(fs[_0x45b5('0x1b')](path[_0x45b5('0x1c')](__dirname,'applications',_0x1a3b80['app']+_0x45b5('0x1d')))){var _0x3da8ae=[];switch(_0x1a3b80[_0x45b5('0x1e')][_0x45b5('0x1f')]()){case _0x45b5('0x20'):var _0x17dea7=_0x1a3b80[_0x45b5('0x21')][_0x45b5('0x22')](',');if(_0xd14400[_0x45b5('0x23')]===_0x45b5('0x24')){_0x3da8ae[_0x45b5('0x25')](_0x17dea7[0x0]);_0x3da8ae[_0x45b5('0x25')](_0x17dea7[0x1]);_0x3da8ae[_0x45b5('0x25')](_0x17dea7[_0x45b5('0x26')](0x2,_0x17dea7[_0x45b5('0x1a')])[_0x45b5('0x1c')](','));}else{_0x3da8ae[_0x45b5('0x25')](_0x17dea7[0x0]);_0x3da8ae[_0x45b5('0x25')](_0x17dea7['slice'](0x1,_0x17dea7[_0x45b5('0x1a')])['join'](','));}break;case'dialogflow':var _0x24dfc9=_0x1a3b80[_0x45b5('0x21')][_0x45b5('0x22')](',');_0x3da8ae[_0x45b5('0x25')](_0x24dfc9[0x0]);_0x3da8ae[_0x45b5('0x25')](_0x24dfc9[0x1]);_0x3da8ae[_0x45b5('0x25')](_0x24dfc9['slice'](0x2,_0x24dfc9[_0x45b5('0x1a')])[_0x45b5('0x1c')](','));break;case _0x45b5('0x27'):var _0x3305a7=_0x1a3b80['appdata'][_0x45b5('0x22')](',');_0x3da8ae['push'](_0x3305a7[0x0]);_0x3da8ae[_0x45b5('0x25')](_0x3305a7[0x1]);_0x3da8ae['push'](_0x3305a7[0x2]);_0x3da8ae['push'](_0x3305a7[0x3]);_0x3da8ae[_0x45b5('0x25')](_0x3305a7[_0x45b5('0x26')](0x4,_0x3305a7[_0x45b5('0x1a')])[_0x45b5('0x1c')](','));break;case _0x45b5('0x28'):var _0x22205d=_0x1a3b80[_0x45b5('0x21')][_0x45b5('0x22')](',');_0x3da8ae[_0x45b5('0x25')](_0x22205d[0x0]);_0x3da8ae[_0x45b5('0x25')](_0x22205d[0x1]);_0x3da8ae[_0x45b5('0x25')](_0x22205d[0x2]);_0x3da8ae['push'](_0x22205d[0x3]);_0x3da8ae[_0x45b5('0x25')](_0x22205d[_0x45b5('0x26')](0x4,_0x22205d['length'])['join'](','));break;case'message':_0x3da8ae[_0x45b5('0x25')](_0x1a3b80[_0x45b5('0x21')]);break;case _0x45b5('0x29'):_0x3da8ae[_0x45b5('0x25')](_0x1a3b80[_0x45b5('0x2a')]);_0x3da8ae[_0x45b5('0x25')](_0x1a3b80[_0x45b5('0x21')]);break;case _0x45b5('0x2b'):var _0xfe6018=utils['getMustacheRender'](_0xd14400[_0x45b5('0x2c')][_0x45b5('0x2d')],_0xd14400);var _0xbcda37=_0x1a3b80[_0x45b5('0x21')][_0x45b5('0x22')](',');_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x0]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x1]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x2]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x3]);_0x3da8ae['push'](_0xbcda37[0x4]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x5]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x6]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x7]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x8]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0x9]);_0x3da8ae[_0x45b5('0x25')](_0xbcda37[0xa]);_0x3da8ae[_0x45b5('0x25')](_0xd14400[_0x45b5('0x16')]['id']);_0x3da8ae[_0x45b5('0x25')](_0xd14400[_0x45b5('0x15')]['id']);_0x3da8ae[_0x45b5('0x25')](_0x1a3b80['ChatWebsiteId']);_0x3da8ae[_0x45b5('0x25')](_0xd14400[_0x45b5('0x16')][_0x45b5('0x2e')]);_0x3da8ae[_0x45b5('0x25')](_0xd14400['body'][_0x45b5('0x2f')]);_0x3da8ae['push'](_0xfe6018);break;default:_0x3da8ae=_[_0x45b5('0x10')](_0x1a3b80[_0x45b5('0x21')])?[]:_0x1a3b80[_0x45b5('0x21')][_0x45b5('0x22')](',');}var _0x1e3f3e={'id':util[_0x45b5('0xe')](_0x45b5('0x30'),_0x17a921,_0x1a3b80['id'],_0x1a3b80['app']),'condition':require(_0x45b5('0x31'))[_0x45b5('0x32')](_0x17a921,getIntervals(_0x1dfa7e[_0x45b5('0x33')],_0x1a3b80),_0x1dfa7e),'consequence':require('./applications/'+_0x1a3b80['app'])[_0x45b5('0x34')](_0x17a921,_0x3da8ae,_0x1dfa7e,_0xd14400),'p':_0x1a3b80[_0x45b5('0x35')]||0x0};logger[_0x45b5('0x36')](_0x45b5('0x37'),_0x1e3f3e['id'],_0x45b5('0x38'),getIntervals(_0x1dfa7e[_0x45b5('0x33')],_0x1a3b80)[_0x45b5('0x1c')](_0x45b5('0x39')));_0x4313ac['push'](_0x1e3f3e);}else{logger[_0x45b5('0x3a')](_0x45b5('0x3b'),path[_0x45b5('0x1c')](__dirname,_0x45b5('0x19'),_0x1a3b80[_0x45b5('0x1e')]+_0x45b5('0x1d')));}}_0x1dfa7e[_0x45b5('0x3c')][_0x17a921]=new RuleEngine(_0x4313ac);_0x1dfa7e[_0x45b5('0x3c')][_0x17a921][_0x45b5('0x3d')](_0xd14400,function(_0x1405c8){logger[_0x45b5('0x36')](_0x45b5('0x3e'),JSON[_0x45b5('0x3f')](_0x1405c8[_0x45b5('0x40')]));if(_0x1dfa7e['rules'][_0x17a921]){_0x1dfa7e[_0x45b5('0x3c')][_0x17a921][_0x45b5('0x41')]('complete');}});return _0x54c545({'code':0xc8,'message':_0xd14400});}else{if(_0x36c050){logger[_0x45b5('0x36')](util['format']('Skipped\x20routing\x20for\x20%s',_0x17a921));}else{logger[_0x45b5('0x36')](_0x45b5('0x42'));}return _0x54c545({'code':0xc8,'message':_0xd14400});}}catch(_0x41efa0){logger[_0x45b5('0x3a')](_0x41efa0[_0x45b5('0x43')]);return _0x5609f3(_0x5e06e5[_0x45b5('0x3a')](0x1f4,_0x41efa0));}}return _0x5609f3(_0x45b5('0x44'));});},'AcceptMessage':function(_0x283ec2){var _0x33b16d=this;return new Promise(function(_0x505851,_0x9729d2){if(_0x283ec2[_0x45b5('0x45')]&&_0x283ec2[_0x45b5('0x45')]['id']){if(_0x1dfa7e[_0x45b5('0x46')][_0x283ec2['agent']['id']]){_0x1dfa7e['agents'][_0x283ec2['agent']['id']][_0x45b5('0x47')]=![];_0x1dfa7e[_0x45b5('0x46')][_0x283ec2['agent']['id']]['busyQueue']=undefined;}}if(_0x283ec2[_0x45b5('0x15')]&&_0x283ec2[_0x45b5('0x15')]['id']){try{var _0x338f8d=getId(_0x283ec2[_0x45b5('0x23')],_0x283ec2[_0x45b5('0x15')]?_0x283ec2[_0x45b5('0x15')]['id']:0x0,_0x283ec2[_0x45b5('0x16')]?_0x283ec2[_0x45b5('0x16')]['id']:0x0);if(_0x1dfa7e[_0x45b5('0x3c')][_0x338f8d]){_0x1dfa7e[_0x45b5('0x3c')][_0x338f8d][_0x45b5('0x41')](_0x45b5('0x48'));if(rpc[_0x283ec2[_0x45b5('0x23')]+'QueueReport']){rpc[_0x283ec2[_0x45b5('0x23')]+_0x45b5('0x49')][_0x45b5('0x4a')](_0x338f8d,{'UserId':_0x283ec2[_0x45b5('0x15')][_0x45b5('0x4b')]})['catch'](function(){logger[_0x45b5('0x3a')](_0x45b5('0x4c'));});}}return _0x505851({'code':0xc8,'message':_0x283ec2});}catch(_0x59785b){logger[_0x45b5('0x3a')](_0x59785b[_0x45b5('0x43')]);return _0x9729d2(_0x33b16d['error'](0x1f4,_0x59785b));}}logger[_0x45b5('0x3a')](_0x45b5('0x4d'));return _0x9729d2(_0x33b16d[_0x45b5('0x3a')](0x1f4,_0x45b5('0x4d')));});},'RejectMessage':function(_0x22f74a){var _0x3dcf39=this;return new Promise(function(_0x49092e,_0x809fc3){if(_0x22f74a[_0x45b5('0x45')]&&_0x22f74a[_0x45b5('0x45')]['id']){try{if(_0x1dfa7e[_0x45b5('0x46')][_0x22f74a['agent']['id']]){_0x1dfa7e[_0x45b5('0x46')][_0x22f74a[_0x45b5('0x45')]['id']][_0x45b5('0x47')]=![];_0x1dfa7e['agents'][_0x22f74a[_0x45b5('0x45')]['id']][_0x45b5('0x4e')]=undefined;}return _0x49092e({'code':0xc8,'message':_0x22f74a});}catch(_0x2b387a){logger[_0x45b5('0x3a')](_0x2b387a['stack']);return _0x809fc3(_0x3dcf39[_0x45b5('0x3a')](0x1f4,_0x2b387a));}}logger[_0x45b5('0x3a')](_0x45b5('0x4d'));return _0x809fc3(_0x3dcf39[_0x45b5('0x3a')](0x1f4,_0x45b5('0x4d')));});},'AbandonInteraction':function(_0x3d87a7){var _0x3952c7=this;return new Promise(function(_0x5080ca,_0x54a799){if(_0x3d87a7['channel']&&_0x3d87a7[_0x45b5('0x16')]&&_0x3d87a7[_0x45b5('0x16')]['id']){try{var _0x3262b6=getId(_0x3d87a7[_0x45b5('0x23')],_0x3d87a7['message']?_0x3d87a7[_0x45b5('0x15')]['id']:0x0,_0x3d87a7[_0x45b5('0x16')]?_0x3d87a7[_0x45b5('0x16')]['id']:0x0);if(_0x1dfa7e[_0x45b5('0x3c')][_0x3262b6]){_0x1dfa7e[_0x45b5('0x3c')][_0x3262b6]['emit'](_0x45b5('0x48'));}return _0x5080ca({'code':0xc8,'message':_0x3d87a7});}catch(_0x1a5036){logger[_0x45b5('0x3a')](_0x1a5036[_0x45b5('0x43')]);return _0x54a799(_0x3952c7[_0x45b5('0x3a')](0x1f4,_0x1a5036));}}logger[_0x45b5('0x3a')](_0x45b5('0x4d'));return _0x54a799(_0x3952c7['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x44005e){var _0x17f3ed=this;return new Promise(function(_0x2fdf84,_0xcca471){if(_0x1dfa7e[_0x45b5('0x46')][_0x45b5('0x4f')](_0x44005e['id'])){for(var _0x2ba3b3 in _0x44005e['capacity']){if(_0x44005e[_0x45b5('0x50')][_0x45b5('0x4f')](_0x2ba3b3)){if(_0x1dfa7e[_0x45b5('0x46')][_0x44005e['id']][_0x45b5('0x4f')](_0x2ba3b3+_0x45b5('0x51'))){_0x1dfa7e[_0x45b5('0x46')][_0x44005e['id']][_0x2ba3b3+_0x45b5('0x51')]=parseInt(_0x44005e[_0x45b5('0x50')][_0x2ba3b3],0xa);}}}_0x1dfa7e['agents'][_0x44005e['id']][_0x45b5('0x52')]();return _0x2fdf84({'code':0xc8,'message':_0x1dfa7e[_0x45b5('0x46')][_0x44005e['id']]});}else{return _0xcca471(_0x17f3ed[_0x45b5('0x3a')](0x1f4,_0x45b5('0x53')));}});},'Agents':function(_0x5cf040){return new Promise(function(_0x324444){var _0x379af7=_['values'](_0x1dfa7e['agents']);if(_0x5cf040&&_0x5cf040['id']){var _0x3ada16=_[_0x45b5('0x54')](_0x379af7,function(_0x5e0da0){return _0x5e0da0['id']===_0x5cf040['id'];});_0x324444(_0x3ada16);}else{_0x324444({'count':_0x379af7['length'],'rows':_0x379af7});}});},'ChatQueues':function(){return new Promise(function(_0x2284c9){var _0x1574d8=[];for(var _0x149cca in _0x1dfa7e[_0x45b5('0x55')]){if(_0x1dfa7e['chatQueues'][_0x45b5('0x4f')](_0x149cca)){var _0x149ff1=_0x1dfa7e[_0x45b5('0x55')][_0x149cca];var _0x1a4ee3={'id':_0x149ff1['id'],'available':_0x149ff1[_0x45b5('0x56')],'loggedIn':_0x149ff1[_0x45b5('0x57')],'name':_0x149ff1[_0x45b5('0x58')],'paused':_0x149ff1[_0x45b5('0x59')],'waiting':_0x149ff1[_0x45b5('0x5a')]};_0x1574d8[_0x45b5('0x25')](_0x1a4ee3);}}_0x2284c9({'count':_0x1574d8[_0x45b5('0x1a')],'rows':_0x1574d8});});},'MailQueues':function(){return new Promise(function(_0x224576){var _0x3eb848=[];for(var _0x47bcd1 in _0x1dfa7e['mailQueues']){if(_0x1dfa7e[_0x45b5('0x5b')][_0x45b5('0x4f')](_0x47bcd1)){var _0x8ee804=_0x1dfa7e[_0x45b5('0x5b')][_0x47bcd1];var _0x1fbcd8={'id':_0x8ee804['id'],'available':_0x8ee804[_0x45b5('0x56')],'loggedIn':_0x8ee804[_0x45b5('0x57')],'name':_0x8ee804[_0x45b5('0x58')],'paused':_0x8ee804[_0x45b5('0x59')],'waiting':_0x8ee804[_0x45b5('0x5a')]};_0x3eb848[_0x45b5('0x25')](_0x1fbcd8);}}_0x224576({'count':_0x3eb848[_0x45b5('0x1a')],'rows':_0x3eb848});});},'OpenchannelQueues':function(){return new Promise(function(_0x2bfc6c){var _0x1aaad4=[];for(var _0xb770be in _0x1dfa7e[_0x45b5('0x5c')]){if(_0x1dfa7e[_0x45b5('0x5c')]['hasOwnProperty'](_0xb770be)){var _0x2b3b24=_0x1dfa7e['openchannelQueues'][_0xb770be];var _0x5244ec={'id':_0x2b3b24['id'],'available':_0x2b3b24[_0x45b5('0x56')],'loggedIn':_0x2b3b24[_0x45b5('0x57')],'name':_0x2b3b24['name'],'paused':_0x2b3b24[_0x45b5('0x59')],'waiting':_0x2b3b24[_0x45b5('0x5a')]};_0x1aaad4['push'](_0x5244ec);}}_0x2bfc6c({'count':_0x1aaad4[_0x45b5('0x1a')],'rows':_0x1aaad4});});},'SmsQueues':function(){return new Promise(function(_0xcb7c38){var _0x44c33e=[];for(var _0x69bee6 in _0x1dfa7e[_0x45b5('0x5d')]){if(_0x1dfa7e[_0x45b5('0x5d')][_0x45b5('0x4f')](_0x69bee6)){var _0x5cf444=_0x1dfa7e[_0x45b5('0x5d')][_0x69bee6];var _0x785046={'id':_0x5cf444['id'],'available':_0x5cf444['available'],'loggedIn':_0x5cf444[_0x45b5('0x57')],'name':_0x5cf444[_0x45b5('0x58')],'paused':_0x5cf444[_0x45b5('0x59')],'waiting':_0x5cf444[_0x45b5('0x5a')]};_0x44c33e['push'](_0x785046);}}_0xcb7c38({'count':_0x44c33e[_0x45b5('0x1a')],'rows':_0x44c33e});});},'FaxQueues':function(){return new Promise(function(_0x741f0b){var _0x526f51=[];for(var _0xdf8cc9 in _0x1dfa7e[_0x45b5('0x5e')]){if(_0x1dfa7e['faxQueues'][_0x45b5('0x4f')](_0xdf8cc9)){var _0x42109d=_0x1dfa7e[_0x45b5('0x5e')][_0xdf8cc9];var _0x1c1753={'id':_0x42109d['id'],'available':_0x42109d[_0x45b5('0x56')],'loggedIn':_0x42109d[_0x45b5('0x57')],'name':_0x42109d['name'],'paused':_0x42109d[_0x45b5('0x59')],'waiting':_0x42109d[_0x45b5('0x5a')]};_0x526f51[_0x45b5('0x25')](_0x1c1753);}}_0x741f0b({'count':_0x526f51[_0x45b5('0x1a')],'rows':_0x526f51});});},'WhatsappQueues':function(){return new Promise(function(_0x57bc7a){var _0x14da44=[];for(var _0x3ec6c7 in _0x1dfa7e['whatsappQueues']){if(_0x1dfa7e[_0x45b5('0x5f')]['hasOwnProperty'](_0x3ec6c7)){var _0x5cab29=_0x1dfa7e[_0x45b5('0x5f')][_0x3ec6c7];var _0x37b429={'id':_0x5cab29['id'],'available':_0x5cab29['available'],'loggedIn':_0x5cab29[_0x45b5('0x57')],'name':_0x5cab29[_0x45b5('0x58')],'paused':_0x5cab29[_0x45b5('0x59')],'waiting':_0x5cab29[_0x45b5('0x5a')]};_0x14da44[_0x45b5('0x25')](_0x37b429);}}_0x57bc7a({'count':_0x14da44['length'],'rows':_0x14da44});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x321f0a){var _0x7db60b=_[_0x45b5('0x60')](_0x1dfa7e[_0x45b5('0x61')]);_0x321f0a({'count':_0x7db60b[_0x45b5('0x1a')],'rows':_0x7db60b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x714b5b){var _0x1adea8=_[_0x45b5('0x60')](_0x1dfa7e[_0x45b5('0x62')]);_0x714b5b({'count':_0x1adea8['length'],'rows':_0x1adea8});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1090ee){var _0x1d492d=_[_0x45b5('0x60')](_0x1dfa7e['openchannelQueuesWaitingInteractions']);_0x1090ee({'count':_0x1d492d[_0x45b5('0x1a')],'rows':_0x1d492d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x408612){var _0x109b5c=_[_0x45b5('0x60')](_0x1dfa7e[_0x45b5('0x63')]);_0x408612({'count':_0x109b5c['length'],'rows':_0x109b5c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x59a2bf){var _0x5df160=_['values'](_0x1dfa7e[_0x45b5('0x64')]);_0x59a2bf({'count':_0x5df160[_0x45b5('0x1a')],'rows':_0x5df160});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1b41ad){var _0x20a0cc=_[_0x45b5('0x60')](_0x1dfa7e['whatsappQueuesWaitingInteractions']);_0x1b41ad({'count':_0x20a0cc[_0x45b5('0x1a')],'rows':_0x20a0cc});});}};var _0x185d88=jayson[_0x45b5('0x65')](_0x2846c7)[_0x45b5('0x66')]();_0x185d88['on']('error',function(_0x39ed4e){logger[_0x45b5('0x3a')](JSON[_0x45b5('0x3f')](_0x39ed4e));return _0x3fc540(_0x39ed4e);});_0x185d88[_0x45b5('0x67')](0x232c,_0x45b5('0x68'),function(){console[_0x45b5('0x69')](_0x45b5('0x6a'),0x232c);return _0x4241b7(_0x45b5('0x6b')+0x232c);});});};
\ No newline at end of file
index 6694b38..8e39990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e15=['http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','stop','util','bluebird','lodash','routing'];(function(_0x45132e,_0x401967){var _0x1605f5=function(_0x3f0f48){while(--_0x3f0f48){_0x45132e['push'](_0x45132e['shift']());}};_0x1605f5(++_0x401967);}(_0x3e15,0xdc));var _0x53e1=function(_0x2edf7f,_0x16595b){_0x2edf7f=_0x2edf7f-0x0;var _0x34eadf=_0x3e15[_0x2edf7f];return _0x34eadf;};'use strict';var util=require(_0x53e1('0x0'));var BPromise=require(_0x53e1('0x1'));var jayson=require('jayson/promise');var _=require(_0x53e1('0x2'));var logger=require('../../../config/logger')(_0x53e1('0x3'));var client=jayson['client'][_0x53e1('0x4')]({'port':0x232a});function request(_0x38c9ef,_0x482114){return new BPromise(function(_0x421507,_0xfea3bc){return client[_0x53e1('0x5')](_0x38c9ef,_0x482114)[_0x53e1('0x6')](function(_0x371a37){if(_0x371a37[_0x53e1('0x7')]){return _0xfea3bc(_0x371a37[_0x53e1('0x7')][_0x53e1('0x8')]);}else{return _0x421507(_0x371a37[_0x53e1('0x9')]);}})[_0x53e1('0xa')](function(_0x475282){return _0xfea3bc(_0x475282);});});}exports[_0x53e1('0xb')]=function(_0xd5e89c,_0x1f3a94,_0x4595a6){return function(_0xcb522e){if(_0x4595a6['rules']&&!_0x4595a6['rules'][_0xd5e89c]){logger[_0x53e1('0xc')](_0x53e1('0xd'),_0xd5e89c);return _0xcb522e['stop']();}var _0x4c1cf7=[];for(var _0x38b15b=0x0;_0x38b15b<_0x1f3a94[_0x53e1('0xe')];_0x38b15b+=0x1){_0x4c1cf7['push'](request('Command',{'command':util[_0x53e1('0xf')](_0x53e1('0x10'),_0x1f3a94[_0x38b15b])})['then'](function(_0x44d9e4){return _0x44d9e4&&_0x44d9e4[_0x53e1('0x8')]&&_0x44d9e4['message'][_0x53e1('0x11')](_0x53e1('0x12'))>=0x0?!![]:![];})[_0x53e1('0xa')](function(_0x59896f){logger[_0x53e1('0x7')](_0x53e1('0x13'),_0xd5e89c,_0x1f3a94[_0x38b15b]);}));}BPromise[_0x53e1('0x14')](_0x4c1cf7)[_0x53e1('0x6')](function(_0xa08045){var _0x2eed7a=_[_0x53e1('0x15')](_0xa08045);logger['info'](_0x53e1('0x16'),_0xd5e89c,_0x1f3a94[_0x53e1('0x17')](_0x53e1('0x18')),_0x2eed7a);_0xcb522e['when'](_0x2eed7a);})[_0x53e1('0xa')](function(_0x20bc0b){console[_0x53e1('0x19')](_0x20bc0b);logger[_0x53e1('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0xd5e89c,_0x1f3a94['join']('\x20|\x20'),_0x20bc0b[_0x53e1('0x1a')]);_0xcb522e[_0x53e1('0x1b')]();});};};
\ No newline at end of file
+var _0x18a3=['rules','info','stop','length','push','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','jayson/promise','routing','client','http','request','error','message','result','catch','condition'];(function(_0x16780f,_0x5d4c07){var _0x450fb6=function(_0x3db3dc){while(--_0x3db3dc){_0x16780f['push'](_0x16780f['shift']());}};_0x450fb6(++_0x5d4c07);}(_0x18a3,0x90));var _0x318a=function(_0x274cb3,_0x36caf0){_0x274cb3=_0x274cb3-0x0;var _0x2ee79e=_0x18a3[_0x274cb3];return _0x2ee79e;};'use strict';var util=require(_0x318a('0x0'));var BPromise=require(_0x318a('0x1'));var jayson=require(_0x318a('0x2'));var _=require('lodash');var logger=require('../../../config/logger')(_0x318a('0x3'));var client=jayson[_0x318a('0x4')][_0x318a('0x5')]({'port':0x232a});function request(_0x267965,_0x2791b9){return new BPromise(function(_0x5c50a6,_0x4a06cc){return client[_0x318a('0x6')](_0x267965,_0x2791b9)['then'](function(_0x3d5b4b){if(_0x3d5b4b[_0x318a('0x7')]){return _0x4a06cc(_0x3d5b4b[_0x318a('0x7')][_0x318a('0x8')]);}else{return _0x5c50a6(_0x3d5b4b[_0x318a('0x9')]);}})[_0x318a('0xa')](function(_0x58b792){return _0x4a06cc(_0x58b792);});});}exports[_0x318a('0xb')]=function(_0x4deeb0,_0x2ec992,_0x161143){return function(_0x1fa8dc){if(_0x161143[_0x318a('0xc')]&&!_0x161143['rules'][_0x4deeb0]){logger[_0x318a('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4deeb0);return _0x1fa8dc[_0x318a('0xe')]();}var _0x15a2a7=[];for(var _0x129d4e=0x0;_0x129d4e<_0x2ec992[_0x318a('0xf')];_0x129d4e+=0x1){_0x15a2a7[_0x318a('0x10')](request('Command',{'command':util['format'](_0x318a('0x11'),_0x2ec992[_0x129d4e])})[_0x318a('0x12')](function(_0x28337a){return _0x28337a&&_0x28337a[_0x318a('0x8')]&&_0x28337a[_0x318a('0x8')][_0x318a('0x13')](_0x318a('0x14'))>=0x0?!![]:![];})['catch'](function(_0x7991ad){logger[_0x318a('0x7')](_0x318a('0x15'),_0x4deeb0,_0x2ec992[_0x129d4e]);}));}BPromise['all'](_0x15a2a7)['then'](function(_0x2a5df6){var _0x1296ab=_['some'](_0x2a5df6);logger[_0x318a('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x4deeb0,_0x2ec992[_0x318a('0x16')](_0x318a('0x17')),_0x1296ab);_0x1fa8dc['when'](_0x1296ab);})[_0x318a('0xa')](function(_0x4a834c){console[_0x318a('0x18')](_0x4a834c);logger[_0x318a('0x7')](_0x318a('0x19'),_0x4deeb0,_0x2ec992[_0x318a('0x16')](_0x318a('0x17')),_0x4a834c['stack']);_0x1fa8dc[_0x318a('0xe')]();});};};
\ No newline at end of file
index 63229c6..287ba19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['clone','calleridname','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','util','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0972,0x64));var _0x2097=function(_0x9f373a,_0x50e482){_0x9f373a=_0x9f373a-0x0;var _0x5084f6=_0x0972[_0x9f373a];return _0x5084f6;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1c7a40,_0x4ec7aa){utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1c7a40[_0x2097('0x3')],_0x1c7a40[_0x2097('0x4')],_0x1c7a40[_0x2097('0x5')],_0x1c7a40[_0x2097('0x6')],_0x1c7a40[_0x2097('0x7')],_0x1c7a40[_0x2097('0x8')],_0x1c7a40[_0x2097('0x9')],_0x1c7a40['lastevent']));if(_0x1c7a40[_0x2097('0x5')]){utils[_0x2097('0xa')](_0x1c7a40[_0x2097('0x5')])[_0x2097('0xb')](function(_0x3b8fac){if(_0x3b8fac){_0x1c7a40['type']=_0x3b8fac[_0x2097('0xc')];_0x1c7a40[_0x2097('0xd')]=_0x1c7a40[_0x2097('0xe')]?_0x3b8fac[_0x2097('0xf')]:![];_0x1c7a40[_0x2097('0x10')]=_0x1c7a40[_0x2097('0xd')]?_0x3b8fac[_0x2097('0x11')]:0x0;}utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);});}else{utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);}if(_0x4ec7aa){delete transfers[_0x1c7a40[_0x2097('0x3')]];}else{delete agents[_0x1c7a40[_0x2097('0x14')]];}}exports[_0x2097('0x15')]=function(_0x24ca42){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x24ca42);agents[_0x24ca42[_0x2097('0x14')]]=_0x24ca42;agents[_0x24ca42['destuniqueid']][_0x2097('0x18')]=utils[_0x2097('0x19')]();agents[_0x24ca42['destuniqueid']]['lastevent']='called';agents[_0x24ca42[_0x2097('0x14')]]['connectedlinenum']=null;agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x1a')]=null;utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x1b'),_0x24ca42['uniqueid'],agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x6')],_0x24ca42[_0x2097('0x14')]));}catch(_0x34654a){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x34654a);}};exports['agentringnoanswer']=function(_0x4d957e){try{if(!_[_0x2097('0x1d')](agents[_0x4d957e['destuniqueid']])){utils[_0x2097('0x16')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x4d957e);utils['info'](util[_0x2097('0x2')](_0x2097('0x1e'),_0x4d957e[_0x2097('0x3')],agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x6')],_0x4d957e[_0x2097('0x14')]));agents[_0x4d957e['destuniqueid']][_0x2097('0x1f')]=!![];agents[_0x4d957e['destuniqueid']][_0x2097('0x20')]=utils[_0x2097('0x19')]();agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x21')]='timeout';agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x22')]='timeout';agents[_0x4d957e[_0x2097('0x14')]]['holdtime']=_0x4d957e[_0x2097('0x23')]?parseInt(_0x4d957e['ringtime'])/0x3e8:0x0;agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x24')]=0x0;unanswered[_0x2097('0x25')](_0x4d957e[_0x2097('0x14')]);}}catch(_0x410afa){utils[_0x2097('0x1c')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x410afa);}};exports[_0x2097('0x26')]=function(_0x5cce55){try{_[_0x2097('0x27')](agents,function(_0x41487d,_0x59fb84){if(_0x41487d['uniqueid']==_0x5cce55[_0x2097('0x3')]&&!_[_0x2097('0x28')](unanswered,_0x41487d[_0x2097('0x14')])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x5cce55);utils[_0x2097('0x1')](util['format'](_0x2097('0x2a'),_0x5cce55[_0x2097('0x3')],_0x41487d[_0x2097('0x6')],_0x41487d[_0x2097('0x14')]));_0x41487d[_0x2097('0x1f')]=!![];_0x41487d[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x41487d[_0x2097('0x21')]=_0x2097('0x2b');_0x41487d['reason']=_0x2097('0x2b');_0x41487d[_0x2097('0x2c')]=_0x5cce55[_0x2097('0x2c')];_0x41487d['talktime']=0x0;writeDB(_0x41487d);}});}catch(_0x3d97ee){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x3d97ee);}};exports['agentconnect']=function(_0x5689f6){try{if(agents[_0x5689f6[_0x2097('0x14')]]){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x5689f6);utils[_0x2097('0x1')](util['format'](_0x2097('0x2e'),_0x5689f6[_0x2097('0x3')],agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x6')],_0x5689f6[_0x2097('0x14')]));agents[_0x5689f6[_0x2097('0x14')]]['agentconnectAt']=utils[_0x2097('0x19')]();agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x9')]=_0x5689f6['connectedlinenum'];agents[_0x5689f6['destuniqueid']][_0x2097('0x1a')]=_0x5689f6[_0x2097('0x1a')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x2c')]=_0x5689f6[_0x2097('0x23')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x21')]=_0x2097('0x2f');_[_0x2097('0x27')](agents,function(_0x3bfb5c,_0x337979){if(_0x3bfb5c[_0x2097('0x14')]!=_0x5689f6['destuniqueid']&&_0x3bfb5c[_0x2097('0x3')]==_0x5689f6[_0x2097('0x3')]){_0x3bfb5c[_0x2097('0x24')]=0x0;_0x3bfb5c['holdtime']=_0x5689f6[_0x2097('0x23')];_0x3bfb5c[_0x2097('0x1f')]=!![];_0x3bfb5c[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x3bfb5c[_0x2097('0x21')]=_0x2097('0x30');_0x3bfb5c[_0x2097('0x22')]=_0x2097('0x30');_0x3bfb5c['answeredelsewheredestinationuniqueid']=_0x5689f6[_0x2097('0x14')];_0x3bfb5c[_0x2097('0x31')]=_0x5689f6[_0x2097('0x6')];writeDB(_0x3bfb5c);}});}}catch(_0x3288ae){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x3288ae);}};exports['agentcomplete']=function(_0x3fc3fe){try{if(!_['isNil'](agents[_0x3fc3fe[_0x2097('0x14')]])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x32'),_0x3fc3fe[_0x2097('0x3')]),_0x3fc3fe);utils['info'](util[_0x2097('0x2')](_0x2097('0x33'),_0x3fc3fe[_0x2097('0x3')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x6')],_0x3fc3fe['destuniqueid']));agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0xe')]=!![];agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x34')]=utils[_0x2097('0x19')]();agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x3fc3fe['destuniqueid']][_0x2097('0x34')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x36')]);agents[_0x3fc3fe[_0x2097('0x14')]]['reason']=_0x3fc3fe['reason'];agents[_0x3fc3fe['destuniqueid']][_0x2097('0x21')]=_0x2097('0x37');writeDB(agents[_0x3fc3fe['destuniqueid']]);}}catch(_0x10577d){utils[_0x2097('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x3fc3fe[_0x2097('0x3')]),_0x10577d);}};exports[_0x2097('0x38')]=function(_0x1b4de6){try{if(!_['isNil'](agents[_0x1b4de6[_0x2097('0x39')]])){utils[_0x2097('0x16')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x1b4de6);utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x3b'),_0x1b4de6['uniqueid'],agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x6')],agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3')]));agents[_0x1b4de6['transfereruniqueid']]['transfer']=!![];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3c')]='blind';agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3d')]=_0x1b4de6[_0x2097('0x3e')];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3f')]=agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x3')];}}catch(_0x228b60){utils[_0x2097('0x1c')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x228b60);}};exports['attendedtransfer']=function(_0x12ba76){try{utils['debug'](util[_0x2097('0x2')]('[%s][agents][attendedtransfer]',_0x12ba76['origtransfereruniqueid']),_0x12ba76);if(_0x12ba76['origtransfereruniqueid']==_0x12ba76[_0x2097('0x40')]){if(!_['isNil'](agents[_0x12ba76['secondtransfereruniqueid']])){utils[_0x2097('0x1')](util['format'](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76['secondtransfereruniqueid']][_0x2097('0x6')]));agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3c')]='ATTENDED';agents[_0x12ba76[_0x2097('0x43')]]['transferexten']=_0x12ba76[_0x2097('0x45')];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3f')]=_0x12ba76['origtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x46')]&&agents[_0x12ba76[_0x2097('0x46')]]){agents[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x46')]]=_['clone'](agents[_0x12ba76['transfereeuniqueid']]);transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x8')]=agents[_0x12ba76['secondtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76['transfereeuniqueid']]['calleridname']=agents[_0x12ba76[_0x2097('0x43')]]['calleridname'];transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x2c')]=0x0;transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x2;}}else if(_0x12ba76[_0x2097('0x43')]==_0x12ba76[_0x2097('0x48')]){if(!_['isNil'](agents[_0x12ba76[_0x2097('0x42')]])){utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76[_0x2097('0x42')]]['membername']));agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x3c')]=_0x2097('0x49');agents[_0x12ba76['origtransfereruniqueid']][_0x2097('0x3d')]=_0x12ba76[_0x2097('0x4a')];agents[_0x12ba76['origtransfereruniqueid']]['transferuniqueid']=_0x12ba76['secondtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x4b')]&&agents[_0x12ba76[_0x2097('0x4b')]]){agents[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x4b')]]=_[_0x2097('0x4c')](agents[_0x12ba76[_0x2097('0x4b')]]);transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x8')]=agents[_0x12ba76['origtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x4d')]=agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x4d')];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x4b')]]['holdtime']=0x0;transfers[_0x12ba76['transfertargetuniqueid']][_0x2097('0x47')]=0x2;}}}catch(_0x345a12){utils['error'](util[_0x2097('0x2')](_0x2097('0x4e'),_0x12ba76[_0x2097('0x42')]),_0x345a12);}};exports[_0x2097('0x4f')]=function(_0x1f824f){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f['uniqueid']),_0x1f824f);if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f[_0x2097('0x3')]]['reason']===_0x2097('0x51')){if(_0x1f824f[_0x2097('0x52')]==='21'){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x53');agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x53');}utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f['uniqueid'],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f[_0x2097('0x3')]]);var _0x2a950f=unanswered[_0x2097('0x55')](_0x1f824f['uniqueid']);if(_0x2a950f>-0x1){unanswered[_0x2097('0x56')](_0x2a950f,0x1);}}if(transfers[_0x1f824f['uniqueid']]){transfers[_0x1f824f[_0x2097('0x3')]]['agentcomplete']=!![];transfers[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();transfers[_0x1f824f['uniqueid']][_0x2097('0x24')]=utils[_0x2097('0x35')](transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x34')],transfers[_0x1f824f[_0x2097('0x3')]]['agentconnectAt']);transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x57');transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f[_0x2097('0x3')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]));writeDB(transfers[_0x1f824f['uniqueid']],!![]);}if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f['uniqueid']]['agentconnectAt']){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0xe')]=!![];agents[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x1f824f['uniqueid']][_0x2097('0x34')],agents[_0x1f824f['uniqueid']][_0x2097('0x36')]);agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=agents[_0x1f824f[_0x2097('0x3')]]['transfer']?_0x2097('0x44'):_0x2097('0x57');agents[_0x1f824f[_0x2097('0x3')]]['lastevent']=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1f824f[_0x2097('0x3')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f['uniqueid']]);}}catch(_0xc7481d){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f[_0x2097('0x3')]),_0xc7481d);}};
\ No newline at end of file
+var _0x2750=['calleridnum','connectedlinenum','lastevent','then','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','forIn','talktime','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','agentcomplete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','[%s][agents][hangup]','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername'];(function(_0x2397e6,_0x44c16e){var _0x1cbc43=function(_0x1f262f){while(--_0x1f262f){_0x2397e6['push'](_0x2397e6['shift']());}};_0x1cbc43(++_0x44c16e);}(_0x2750,0x13b));var _0x0275=function(_0xa5dd07,_0x14c236){_0xa5dd07=_0xa5dd07-0x0;var _0x282b3a=_0x2750[_0xa5dd07];return _0x282b3a;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var utils=require(_0x0275('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xf2ae71,_0x372744){utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x4'),_0xf2ae71[_0x0275('0x5')],_0xf2ae71[_0x0275('0x6')],_0xf2ae71[_0x0275('0x7')],_0xf2ae71[_0x0275('0x8')],_0xf2ae71['interface'],_0xf2ae71[_0x0275('0x9')],_0xf2ae71[_0x0275('0xa')],_0xf2ae71[_0x0275('0xb')]));if(_0xf2ae71[_0x0275('0x7')]){utils['getVoiceQueueByName'](_0xf2ae71[_0x0275('0x7')])[_0x0275('0xc')](function(_0x42ae73){if(_0x42ae73){_0xf2ae71['type']=_0x42ae73['type'];_0xf2ae71[_0x0275('0xd')]=_0xf2ae71['agentcomplete']?_0x42ae73[_0x0275('0xe')]:![];_0xf2ae71[_0x0275('0xf')]=_0xf2ae71[_0x0275('0xd')]?_0x42ae73[_0x0275('0x10')]:0x0;}utils[_0x0275('0x11')]('CreateVoiceAgentReport',_0xf2ae71);});}else{utils[_0x0275('0x11')](_0x0275('0x12'),_0xf2ae71);}if(_0x372744){delete transfers[_0xf2ae71[_0x0275('0x5')]];}else{delete agents[_0xf2ae71['destuniqueid']];}}exports['agentcalled']=function(_0x292f93){try{utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x14'),_0x292f93[_0x0275('0x5')]),_0x292f93);agents[_0x292f93[_0x0275('0x15')]]=_0x292f93;agents[_0x292f93['destuniqueid']][_0x0275('0x16')]=utils[_0x0275('0x17')]();agents[_0x292f93['destuniqueid']][_0x0275('0xb')]=_0x0275('0x18');agents[_0x292f93['destuniqueid']][_0x0275('0xa')]=null;agents[_0x292f93[_0x0275('0x15')]]['connectedlinename']=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x292f93['uniqueid'],agents[_0x292f93[_0x0275('0x15')]][_0x0275('0x8')],_0x292f93[_0x0275('0x15')]));}catch(_0x5b2a4c){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x14'),_0x292f93['uniqueid']),_0x5b2a4c);}};exports[_0x0275('0x1a')]=function(_0x402f0d){try{if(!_['isNil'](agents[_0x402f0d['destuniqueid']])){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x1b'),_0x402f0d['uniqueid']),_0x402f0d);utils[_0x0275('0x2')](util['format'](_0x0275('0x1c'),_0x402f0d['uniqueid'],agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x8')],_0x402f0d['destuniqueid']));agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1a')]=!![];agents[_0x402f0d[_0x0275('0x15')]]['agentringnoanswerAt']=utils[_0x0275('0x17')]();agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0xb')]=_0x0275('0x1d');agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1e')]='timeout';agents[_0x402f0d[_0x0275('0x15')]][_0x0275('0x1f')]=_0x402f0d[_0x0275('0x20')]?parseInt(_0x402f0d[_0x0275('0x20')])/0x3e8:0x0;agents[_0x402f0d[_0x0275('0x15')]]['talktime']=0x0;unanswered[_0x0275('0x21')](_0x402f0d[_0x0275('0x15')]);}}catch(_0x3246ea){utils[_0x0275('0x19')](util[_0x0275('0x3')]('[%s][agents][agentringnoanswer]',_0x402f0d[_0x0275('0x5')]),_0x3246ea);}};exports[_0x0275('0x22')]=function(_0x127bbd){try{_['forIn'](agents,function(_0x5e2e22,_0x3cb2d7){if(_0x5e2e22[_0x0275('0x5')]==_0x127bbd['uniqueid']&&!_[_0x0275('0x23')](unanswered,_0x5e2e22[_0x0275('0x15')])){utils[_0x0275('0x13')](util[_0x0275('0x3')]('[%s][agents][queuecallerabandon]',_0x127bbd[_0x0275('0x5')]),_0x127bbd);utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x24'),_0x127bbd['uniqueid'],_0x5e2e22[_0x0275('0x8')],_0x5e2e22['destuniqueid']));_0x5e2e22[_0x0275('0x1a')]=!![];_0x5e2e22['agentringnoanswerAt']=utils[_0x0275('0x17')]();_0x5e2e22[_0x0275('0xb')]='abandoned';_0x5e2e22[_0x0275('0x1e')]=_0x0275('0x25');_0x5e2e22[_0x0275('0x1f')]=_0x127bbd[_0x0275('0x1f')];_0x5e2e22['talktime']=0x0;writeDB(_0x5e2e22);}});}catch(_0x5040de){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x26'),_0x127bbd[_0x0275('0x5')]),_0x5040de);}};exports['agentconnect']=function(_0x2a18c3){try{if(agents[_0x2a18c3[_0x0275('0x15')]]){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x27'),_0x2a18c3[_0x0275('0x5')]),_0x2a18c3);utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x28'),_0x2a18c3[_0x0275('0x5')],agents[_0x2a18c3[_0x0275('0x15')]]['membername'],_0x2a18c3[_0x0275('0x15')]));agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x29')]=utils[_0x0275('0x17')]();agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0xa')]=_0x2a18c3[_0x0275('0xa')];agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x2a')]=_0x2a18c3[_0x0275('0x2a')];agents[_0x2a18c3[_0x0275('0x15')]][_0x0275('0x1f')]=_0x2a18c3[_0x0275('0x20')];agents[_0x2a18c3[_0x0275('0x15')]]['lastevent']=_0x0275('0x2b');_[_0x0275('0x2c')](agents,function(_0x4d2d59,_0x31d0ab){if(_0x4d2d59[_0x0275('0x15')]!=_0x2a18c3[_0x0275('0x15')]&&_0x4d2d59[_0x0275('0x5')]==_0x2a18c3[_0x0275('0x5')]){_0x4d2d59[_0x0275('0x2d')]=0x0;_0x4d2d59[_0x0275('0x1f')]=_0x2a18c3['ringtime'];_0x4d2d59[_0x0275('0x1a')]=!![];_0x4d2d59[_0x0275('0x2e')]=utils[_0x0275('0x17')]();_0x4d2d59[_0x0275('0xb')]='answered_elsewhere';_0x4d2d59[_0x0275('0x1e')]=_0x0275('0x2f');_0x4d2d59[_0x0275('0x30')]=_0x2a18c3[_0x0275('0x15')];_0x4d2d59['answeredelsewheremembername']=_0x2a18c3[_0x0275('0x8')];writeDB(_0x4d2d59);}});}}catch(_0x52f69c){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x27'),_0x2a18c3[_0x0275('0x5')]),_0x52f69c);}};exports['agentcomplete']=function(_0x13c651){try{if(!_[_0x0275('0x31')](agents[_0x13c651['destuniqueid']])){utils[_0x0275('0x13')](util[_0x0275('0x3')](_0x0275('0x32'),_0x13c651['uniqueid']),_0x13c651);utils[_0x0275('0x2')](util[_0x0275('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x13c651[_0x0275('0x5')],agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x8')],_0x13c651[_0x0275('0x15')]));agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x33')]=!![];agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x2d')]=utils['diffTime'](agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x34')],agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x29')]);agents[_0x13c651[_0x0275('0x15')]][_0x0275('0x1e')]=_0x13c651[_0x0275('0x1e')];agents[_0x13c651[_0x0275('0x15')]][_0x0275('0xb')]=_0x0275('0x35');writeDB(agents[_0x13c651[_0x0275('0x15')]]);}}catch(_0x598d15){utils['error'](util[_0x0275('0x3')](_0x0275('0x32'),_0x13c651[_0x0275('0x5')]),_0x598d15);}};exports[_0x0275('0x36')]=function(_0x310c6b){try{if(!_['isNil'](agents[_0x310c6b[_0x0275('0x37')]])){utils['debug'](util[_0x0275('0x3')](_0x0275('0x38'),_0x310c6b[_0x0275('0x5')]),_0x310c6b);utils[_0x0275('0x2')](util['format'](_0x0275('0x39'),_0x310c6b['uniqueid'],agents[_0x310c6b['transfereruniqueid']]['membername'],agents[_0x310c6b[_0x0275('0x37')]]['uniqueid']));agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3a')]=!![];agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3b')]=_0x0275('0x3c');agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x3d')]=_0x310c6b['extension'];agents[_0x310c6b[_0x0275('0x37')]]['transferuniqueid']=agents[_0x310c6b[_0x0275('0x37')]][_0x0275('0x5')];}}catch(_0x119301){utils[_0x0275('0x19')](util[_0x0275('0x3')](_0x0275('0x38'),_0x310c6b[_0x0275('0x5')]),_0x119301);}};exports[_0x0275('0x3e')]=function(_0x41429d){try{utils[_0x0275('0x13')](util['format']('[%s][agents][attendedtransfer]',_0x41429d[_0x0275('0x3f')]),_0x41429d);if(_0x41429d['origtransfereruniqueid']==_0x41429d['origtransfererlinkedid']){if(!_[_0x0275('0x31')](agents[_0x41429d[_0x0275('0x40')]])){utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x41'),_0x41429d[_0x0275('0x3f')],agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x8')]));agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x3a')]=!![];agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x3b')]=_0x0275('0x42');agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x3d')]=_0x41429d[_0x0275('0x43')];agents[_0x41429d['secondtransfereruniqueid']][_0x0275('0x44')]=_0x41429d['origtransfereruniqueid'];}if(_0x41429d[_0x0275('0x45')]&&agents[_0x41429d[_0x0275('0x45')]]){agents[_0x41429d[_0x0275('0x45')]][_0x0275('0x46')]=0x1;transfers[_0x41429d[_0x0275('0x45')]]=_[_0x0275('0x47')](agents[_0x41429d[_0x0275('0x45')]]);transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x9')]=agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x9')];transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x48')]=agents[_0x41429d[_0x0275('0x40')]][_0x0275('0x48')];transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x16')]=utils[_0x0275('0x17')]();transfers[_0x41429d['transfereeuniqueid']][_0x0275('0x29')]=utils['now']();transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x1f')]=0x0;transfers[_0x41429d[_0x0275('0x45')]][_0x0275('0x46')]=0x2;}}else if(_0x41429d['secondtransfereruniqueid']==_0x41429d[_0x0275('0x49')]){if(!_[_0x0275('0x31')](agents[_0x41429d[_0x0275('0x3f')]])){utils[_0x0275('0x2')](util['format'](_0x0275('0x41'),_0x41429d[_0x0275('0x3f')],agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x8')]));agents[_0x41429d[_0x0275('0x3f')]]['transfer']=!![];agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x3b')]=_0x0275('0x42');agents[_0x41429d['origtransfereruniqueid']]['transferexten']=_0x41429d[_0x0275('0x4a')];agents[_0x41429d[_0x0275('0x3f')]][_0x0275('0x44')]=_0x41429d[_0x0275('0x40')];}if(_0x41429d[_0x0275('0x4b')]&&agents[_0x41429d[_0x0275('0x4b')]]){agents[_0x41429d[_0x0275('0x4b')]][_0x0275('0x46')]=0x1;transfers[_0x41429d['transfertargetuniqueid']]=_[_0x0275('0x47')](agents[_0x41429d[_0x0275('0x4b')]]);transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x9')]=agents[_0x41429d[_0x0275('0x3f')]][_0x0275('0x9')];transfers[_0x41429d['transfertargetuniqueid']][_0x0275('0x48')]=agents[_0x41429d['origtransfereruniqueid']][_0x0275('0x48')];transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x16')]=utils[_0x0275('0x17')]();transfers[_0x41429d['transfertargetuniqueid']][_0x0275('0x29')]=utils[_0x0275('0x17')]();transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x1f')]=0x0;transfers[_0x41429d[_0x0275('0x4b')]][_0x0275('0x46')]=0x2;}}}catch(_0x3c7845){utils[_0x0275('0x19')](util[_0x0275('0x3')]('[%s][agents][attendedtransfer]',_0x41429d['origtransfereruniqueid']),_0x3c7845);}};exports['hangup']=function(_0x1dcaa6){try{utils[_0x0275('0x13')](util[_0x0275('0x3')]('[%s][agents][hangup]',_0x1dcaa6[_0x0275('0x5')]),_0x1dcaa6);if(agents[_0x1dcaa6[_0x0275('0x5')]]&&agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]===_0x0275('0x1d')){if(_0x1dcaa6['cause']==='21'){agents[_0x1dcaa6[_0x0275('0x5')]]['reason']=_0x0275('0x4c');agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]=_0x0275('0x4c');}utils['info'](util[_0x0275('0x3')](_0x0275('0x4d'),_0x1dcaa6[_0x0275('0x5')],agents[_0x1dcaa6['uniqueid']][_0x0275('0x8')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(agents[_0x1dcaa6[_0x0275('0x5')]]);var _0x3a9898=unanswered[_0x0275('0x4e')](_0x1dcaa6['uniqueid']);if(_0x3a9898>-0x1){unanswered['splice'](_0x3a9898,0x1);}}if(transfers[_0x1dcaa6['uniqueid']]){transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x33')]=!![];transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();transfers[_0x1dcaa6['uniqueid']][_0x0275('0x2d')]=utils['diffTime'](transfers[_0x1dcaa6['uniqueid']][_0x0275('0x34')],transfers[_0x1dcaa6['uniqueid']][_0x0275('0x29')]);transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]=_0x0275('0x4f');transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]=_0x0275('0x35');utils[_0x0275('0x2')](util[_0x0275('0x3')](_0x0275('0x4d'),_0x1dcaa6[_0x0275('0x5')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x8')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],transfers[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(transfers[_0x1dcaa6[_0x0275('0x5')]],!![]);}if(agents[_0x1dcaa6[_0x0275('0x5')]]&&agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x29')]){agents[_0x1dcaa6['uniqueid']][_0x0275('0x33')]=!![];agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')]=utils[_0x0275('0x17')]();agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x2d')]=utils['diffTime'](agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x34')],agents[_0x1dcaa6['uniqueid']][_0x0275('0x29')]);agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')]=agents[_0x1dcaa6[_0x0275('0x5')]]['transfer']?_0x0275('0x3a'):_0x0275('0x4f');agents[_0x1dcaa6['uniqueid']][_0x0275('0xb')]='complete';utils[_0x0275('0x2')](util[_0x0275('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1dcaa6[_0x0275('0x5')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x8')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0x1e')],agents[_0x1dcaa6[_0x0275('0x5')]][_0x0275('0xb')]));writeDB(agents[_0x1dcaa6['uniqueid']]);}}catch(_0x12476c){utils[_0x0275('0x19')](util['format'](_0x0275('0x50'),_0x1dcaa6['uniqueid']),_0x12476c);}};
\ No newline at end of file
index 34a1390..a7638b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f86=['[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','substring','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','systemanswertime','channelstate','answertime','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','destinationchannel','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','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'];(function(_0x1b015d,_0x2d18f6){var _0x22b341=function(_0xf7ee59){while(--_0xf7ee59){_0x1b015d['push'](_0x1b015d['shift']());}};_0x22b341(++_0x2d18f6);}(_0x7f86,0xea));var _0x67f8=function(_0x11bd09,_0x5a4046){_0x11bd09=_0x11bd09-0x0;var _0x10711c=_0x7f86[_0x11bd09];return _0x10711c;};'use strict';var _=require(_0x67f8('0x0'));var util=require(_0x67f8('0x1'));var utils=require(_0x67f8('0x2'));var transfers=require(_0x67f8('0x3'));var dispositions=[_0x67f8('0x4'),'FAILED',_0x67f8('0x5'),_0x67f8('0x4'),_0x67f8('0x4'),_0x67f8('0x4'),'ANSWERED',_0x67f8('0x6'),_0x67f8('0x5'),_0x67f8('0x5'),'FAILED'];var channels={};function writeDB(_0x4eb036){var _0x8bf433;if(transfers[_0x67f8('0x7')][_0x4eb036[_0x67f8('0x8')]]){_0x8bf433=_0x4eb036[_0x67f8('0x8')];_0x4eb036['uniqueid']=transfers[_0x67f8('0x7')][_0x4eb036[_0x67f8('0x8')]][_0x67f8('0x9')];}utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0xc'),_0x4eb036['uniqueid'],_0x4eb036[_0x67f8('0xd')],_0x4eb036['queue'],_0x4eb036['membername'],_0x4eb036['interface'],_0x4eb036[_0x67f8('0xe')],_0x4eb036[_0x67f8('0xf')],_0x4eb036[_0x67f8('0x10')]));if(_0x4eb036['accountcode']){utils[_0x67f8('0x11')](_0x4eb036[_0x67f8('0x12')])[_0x67f8('0x13')](function(_0x373bd2){if(_0x373bd2){_0x4eb036[_0x67f8('0x14')]=_0x373bd2['id'];}utils[_0x67f8('0x15')](_0x67f8('0x16'),_0x4eb036);});}else{utils['request']('CreateVoiceCallReport',_0x4eb036);}if(channels[_0x4eb036[_0x67f8('0x8')]]){delete channels[_0x4eb036[_0x67f8('0x8')]];}else if(_0x8bf433&&channels[_0x8bf433]){if(!transfers[_0x67f8('0x7')][_0x8bf433][_0x67f8('0x17')])delete transfers['blinds'][_0x8bf433];delete channels[_0x8bf433];}}exports[_0x67f8('0x18')]=function(_0x4041fc){try{utils[_0x67f8('0x19')](util[_0x67f8('0xb')](_0x67f8('0x1a'),_0x4041fc[_0x67f8('0x8')]),_0x4041fc);if(_0x4041fc[_0x67f8('0x8')]==_0x4041fc[_0x67f8('0x1b')]&&_0x4041fc['channel']!=_0x67f8('0x1c')){utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x1d'),_0x4041fc[_0x67f8('0x8')],_0x4041fc[_0x67f8('0x1e')],_0x4041fc[_0x67f8('0x1f')]));channels[_0x4041fc['uniqueid']]={'uniqueid':_0x4041fc[_0x67f8('0x8')],'accountcode':_0x4041fc[_0x67f8('0x12')],'source':_0x4041fc['calleridnum'],'destination':_0x4041fc['exten'],'destinationcontext':_0x4041fc[_0x67f8('0x1e')],'channel':_0x4041fc[_0x67f8('0xd')],'starttime':utils[_0x67f8('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x67f8('0x4'),'amaflags':_0x67f8('0x21')};}}catch(_0x4b18d4){utils[_0x67f8('0x22')](util[_0x67f8('0xb')](_0x67f8('0x1a'),_0x4041fc[_0x67f8('0x8')]),_0x4b18d4);}};exports[_0x67f8('0x23')]=function(_0x5c06ae){try{utils['debug'](util['format'](_0x67f8('0x24'),_0x5c06ae['uniqueid']),_0x5c06ae);if(!_[_0x67f8('0x25')](channels[_0x5c06ae[_0x67f8('0x8')]])&&_0x5c06ae['channelstate']==0x6){utils['info'](util[_0x67f8('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5c06ae[_0x67f8('0x8')],_0x5c06ae[_0x67f8('0x1e')],_0x5c06ae[_0x67f8('0xd')]));if(_['isNil'](channels[_0x5c06ae[_0x67f8('0x8')]][_0x67f8('0x26')])){channels[_0x5c06ae[_0x67f8('0x8')]][_0x67f8('0x26')]=utils[_0x67f8('0x20')]();}}else if(!_[_0x67f8('0x25')](channels[_0x5c06ae[_0x67f8('0x1b')]])&&_0x5c06ae[_0x67f8('0x27')]==0x6&&_0x5c06ae['context']!='transfer'){utils['info'](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5c06ae[_0x67f8('0x8')],_0x5c06ae[_0x67f8('0x1b')],_0x5c06ae[_0x67f8('0x1e')],_0x5c06ae['channel']));channels[_0x5c06ae[_0x67f8('0x1b')]][_0x67f8('0x12')]=_0x5c06ae['accountcode'];channels[_0x5c06ae[_0x67f8('0x1b')]]['destinationchannel']=_0x5c06ae[_0x67f8('0xd')];if(_[_0x67f8('0x25')](channels[_0x5c06ae[_0x67f8('0x1b')]][_0x67f8('0x28')])){channels[_0x5c06ae[_0x67f8('0x1b')]][_0x67f8('0x28')]=utils['now']();}channels[_0x5c06ae[_0x67f8('0x1b')]]['disposition']=dispositions[_['toNumber'](_0x5c06ae[_0x67f8('0x27')])]||_0x67f8('0x29');}}catch(_0x4be36e){utils[_0x67f8('0x22')](util[_0x67f8('0xb')](_0x67f8('0x24'),_0x5c06ae['uniqueid']),_0x4be36e);}};exports[_0x67f8('0x2a')]=function(_0x58a2f2){try{if(!_[_0x67f8('0x25')](channels[_0x58a2f2[_0x67f8('0x8')]])){utils['debug'](util[_0x67f8('0xb')](_0x67f8('0x2b'),_0x58a2f2[_0x67f8('0x8')]),_0x58a2f2);if(_[_0x67f8('0x25')](channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x2c')])){channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x2c')]=_0x58a2f2[_0x67f8('0x2d')]+'\x20<'+_0x58a2f2[_0x67f8('0xe')]+'>';}utils['info'](util['format'](_0x67f8('0x2e'),_0x58a2f2['uniqueid'],channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x2c')],_0x58a2f2[_0x67f8('0x2f')]));channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x30')]=utils[_0x67f8('0x20')]();channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x31')]=utils[_0x67f8('0x32')](channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x30')],channels[_0x58a2f2['uniqueid']][_0x67f8('0x33')]);channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x34')]=channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x28')]?utils[_0x67f8('0x32')](channels[_0x58a2f2[_0x67f8('0x8')]][_0x67f8('0x30')],channels[_0x58a2f2[_0x67f8('0x8')]]['answertime']):0x0;writeDB(channels[_0x58a2f2[_0x67f8('0x8')]]);}}catch(_0x5972d2){utils[_0x67f8('0x22')](util[_0x67f8('0xb')](_0x67f8('0x2b'),_0x58a2f2[_0x67f8('0x8')]),_0x5972d2);}};exports[_0x67f8('0x35')]=function(_0x31e8c3){try{if(!_[_0x67f8('0x25')](channels[_0x31e8c3[_0x67f8('0x36')]])){utils[_0x67f8('0x19')](util[_0x67f8('0xb')](_0x67f8('0x37'),_0x31e8c3[_0x67f8('0x38')]),_0x31e8c3);if(channels[_0x31e8c3[_0x67f8('0x36')]][_0x67f8('0xd')]==_0x31e8c3[_0x67f8('0x39')]){utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x3a'),_0x31e8c3[_0x67f8('0x38')],_0x31e8c3['localtwolinkedid'],_0x31e8c3[_0x67f8('0x3b')]));channels[_0x31e8c3[_0x67f8('0x36')]]['destinationchannel']=_0x31e8c3[_0x67f8('0x3b')];channels[_0x31e8c3[_0x67f8('0x36')]][_0x67f8('0x3c')]=_0x67f8('0x3d');}else if(channels[_0x31e8c3[_0x67f8('0x36')]]['channel']=_0x31e8c3[_0x67f8('0x3e')]){utils[_0x67f8('0xa')](util[_0x67f8('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x31e8c3[_0x67f8('0x38')],_0x31e8c3[_0x67f8('0x36')],_0x31e8c3['origtransfererchannel']));channels[_0x31e8c3[_0x67f8('0x36')]][_0x67f8('0x3f')]=_0x31e8c3[_0x67f8('0x40')];channels[_0x31e8c3[_0x67f8('0x36')]]['userfield']='_attended';}}}catch(_0x1e78f5){utils[_0x67f8('0x22')](util['format'](_0x67f8('0x37'),_0x31e8c3['origtransfereruniqueid']),_0x1e78f5);}};exports['musiconholdstart']=function(_0x36975e){try{if(!_[_0x67f8('0x25')](channels[_0x36975e[_0x67f8('0x8')]])){utils[_0x67f8('0x19')](util[_0x67f8('0xb')]('[%s][calls][musiconholdstart]',_0x36975e['uniqueid']),_0x36975e);channels[_0x36975e[_0x67f8('0x8')]][_0x67f8('0x41')]=utils[_0x67f8('0x20')]();utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x42'),_0x36975e['uniqueid'],channels[_0x36975e[_0x67f8('0x8')]][_0x67f8('0x41')]));}}catch(_0x14b2d0){utils[_0x67f8('0x22')](util[_0x67f8('0xb')]('[%s][calls][musiconholdstart]',_0x36975e['uniqueid']),_0x14b2d0);}};exports[_0x67f8('0x43')]=function(_0x5253d1){try{if(!_[_0x67f8('0x25')](channels[_0x5253d1[_0x67f8('0x8')]])){utils[_0x67f8('0x19')](util['format'](_0x67f8('0x44'),_0x5253d1[_0x67f8('0x8')]),_0x5253d1);if(!_[_0x67f8('0x25')](channels[_0x5253d1[_0x67f8('0x8')]][_0x67f8('0x41')])){channels[_0x5253d1[_0x67f8('0x8')]]['mohtime']+=utils[_0x67f8('0x32')](utils[_0x67f8('0x20')](),channels[_0x5253d1[_0x67f8('0x8')]][_0x67f8('0x41')]);utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x45'),_0x5253d1[_0x67f8('0x8')],channels[_0x5253d1[_0x67f8('0x8')]][_0x67f8('0x46')]));delete channels[_0x5253d1[_0x67f8('0x8')]][_0x67f8('0x41')];}}}catch(_0x417c3f){utils[_0x67f8('0x22')](util[_0x67f8('0xb')](_0x67f8('0x44'),_0x5253d1[_0x67f8('0x8')]),_0x417c3f);}};exports[_0x67f8('0x47')]=function(_0x481987){try{if(!_[_0x67f8('0x25')](channels[_0x481987[_0x67f8('0x8')]])){utils['debug'](util['format'](_0x67f8('0x48'),_0x481987[_0x67f8('0x8')]),_0x481987);if(!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x4a')])){utils['info'](util[_0x67f8('0xb')](_0x67f8('0x4b'),_0x481987['uniqueid'],_0x481987[_0x67f8('0x4c')]));channels[_0x481987[_0x67f8('0x8')]][_0x67f8('0x4d')]=_0x481987[_0x67f8('0x4c')];}if(!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x4e')])){utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x4f'),_0x481987[_0x67f8('0x8')],_0x481987[_0x67f8('0x4c')]));channels[_0x481987[_0x67f8('0x8')]][_0x67f8('0x50')]=_0x481987[_0x67f8('0x4c')];channels[_0x481987['uniqueid']]['callerid']='\x22'+_0x481987[_0x67f8('0x4c')]+_0x67f8('0x51')+_0x481987[_0x67f8('0x4c')]+'>';}if(!_['isNil'](_0x481987[_0x67f8('0x49')][_0x67f8('0x52')])||!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x53')])){utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x54'),_0x481987['uniqueid'],!_['isNil'](_0x481987[_0x67f8('0x49')]['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x481987['value']));channels[_0x481987[_0x67f8('0x8')]][_0x67f8('0x2c')]=_0x481987[_0x67f8('0x4c')];}if(!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x55')])||!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x56')])){utils[_0x67f8('0xa')](util[_0x67f8('0xb')](_0x67f8('0x54'),_0x481987[_0x67f8('0x8')],!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x55')])?'xmd-queue':_0x67f8('0x56'),_0x481987[_0x67f8('0x4c')]));channels[_0x481987[_0x67f8('0x8')]]['lastapplication']=_0x67f8('0x57');channels[_0x481987['uniqueid']]['lastdata']=_0x481987[_0x67f8('0x4c')];channels[_0x481987[_0x67f8('0x8')]]['queue']=!![];}if(!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x58')])){utils['info'](util[_0x67f8('0xb')](_0x67f8('0x59'),_0x481987[_0x67f8('0x8')],_0x481987['value']));channels[_0x481987[_0x67f8('0x8')]]['ContactId']=_0x481987[_0x67f8('0x4c')];}if(!_[_0x67f8('0x25')](_0x481987['variable'][_0x67f8('0x5a')])){utils['info'](util[_0x67f8('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x481987[_0x67f8('0x8')],_0x481987[_0x67f8('0x4c')]));channels[_0x481987['uniqueid']][_0x67f8('0x5b')]=_0x481987['value'];}if(!_['isNil'](_0x481987[_0x67f8('0x49')]['outboundrouteid'])){utils[_0x67f8('0xa')](util[_0x67f8('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x481987[_0x67f8('0x8')],_0x481987[_0x67f8('0x4c')]));channels[_0x481987[_0x67f8('0x8')]]['routeid']=_0x481987['value'];}if(!_[_0x67f8('0x25')](_0x481987[_0x67f8('0x49')][_0x67f8('0x5c')])){utils['info'](util[_0x67f8('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x481987['uniqueid'],_0x481987[_0x67f8('0x4c')]));channels[_0x481987[_0x67f8('0x8')]][_0x67f8('0x5c')]=_0x481987[_0x67f8('0x4c')];}}}catch(_0x22b383){utils[_0x67f8('0x22')](util[_0x67f8('0xb')](_0x67f8('0x48'),_0x481987[_0x67f8('0x8')]),_0x22b383);}};exports[_0x67f8('0x5d')]=function(_0x3a4090){try{if(!_[_0x67f8('0x25')](channels[_0x3a4090[_0x67f8('0x8')]])){utils[_0x67f8('0x19')](util[_0x67f8('0xb')](_0x67f8('0x5e'),_0x3a4090[_0x67f8('0x8')]),_0x3a4090);utils[_0x67f8('0xa')](util[_0x67f8('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3a4090[_0x67f8('0x8')],_0x3a4090[_0x67f8('0x5f')],_0x3a4090[_0x67f8('0x60')]));if(_0x3a4090[_0x67f8('0x5f')][_0x67f8('0x61')]()==_0x67f8('0x62')&&_[_0x67f8('0x63')](_0x3a4090['appdata']['toLowerCase'](),_0x67f8('0x64'))){var _0x317f1e=_0x3a4090[_0x67f8('0x60')]['split']('=');var _0x21ed30=_0x317f1e[0x0][_0x67f8('0x65')](_0x317f1e[0x0]['lastIndexOf']('(')+0x1,_0x317f1e[0x0]['lastIndexOf'](')'));var _0x4842f6=_0x317f1e[0x1];channels[_0x3a4090['uniqueid']][_0x21ed30]=_0x4842f6;}if(!_[_0x67f8('0x66')](['hangup',_0x67f8('0x67'),_0x67f8('0x68'),_0x67f8('0x62'),_0x67f8('0x69')],_0x3a4090['application'][_0x67f8('0x61')]())){channels[_0x3a4090[_0x67f8('0x8')]]['lastapplication']=_0x3a4090[_0x67f8('0x5f')];channels[_0x3a4090[_0x67f8('0x8')]]['lastdata']=_0x3a4090[_0x67f8('0x60')];}}}catch(_0x1fedd4){utils[_0x67f8('0x22')](util['format']('[%s][calls][newexten]',_0x3a4090[_0x67f8('0x8')]),_0x1fedd4);}};
\ No newline at end of file
+var _0xe056=['type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr','split','substring','lastIndexOf','includes','gotoif','toLowerCase','[%s][calls][newexten]','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','linkedid','context','exten','DOCUMENTATION','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','now','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','starttime','billableseconds','answertime','diffTime','error','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstartAt','[%s][calls][musiconholdstart]','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','destination','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s'];(function(_0xfb9174,_0x3f4368){var _0x2e00cd=function(_0x10a8cc){while(--_0x10a8cc){_0xfb9174['push'](_0xfb9174['shift']());}};_0x2e00cd(++_0x3f4368);}(_0xe056,0xdb));var _0x6e05=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xe056[_0x26b8b5];return _0x2150a9;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x6e05('0x0'));var transfers=require(_0x6e05('0x1'));var dispositions=[_0x6e05('0x2'),'FAILED',_0x6e05('0x3'),'NO\x20ANSWER',_0x6e05('0x2'),_0x6e05('0x2'),'ANSWERED','BUSY','FAILED',_0x6e05('0x3'),_0x6e05('0x3')];var channels={};function writeDB(_0x1c78eb){var _0x5dacb2;if(transfers[_0x6e05('0x4')][_0x1c78eb[_0x6e05('0x5')]]){_0x5dacb2=_0x1c78eb[_0x6e05('0x5')];_0x1c78eb[_0x6e05('0x5')]=transfers[_0x6e05('0x4')][_0x1c78eb['uniqueid']][_0x6e05('0x6')];}utils[_0x6e05('0x7')](util[_0x6e05('0x8')](_0x6e05('0x9'),_0x1c78eb[_0x6e05('0x5')],_0x1c78eb[_0x6e05('0xa')],_0x1c78eb['queue'],_0x1c78eb[_0x6e05('0xb')],_0x1c78eb[_0x6e05('0xc')],_0x1c78eb[_0x6e05('0xd')],_0x1c78eb['connectedlinenum'],_0x1c78eb[_0x6e05('0xe')]));if(_0x1c78eb[_0x6e05('0xf')]){utils[_0x6e05('0x10')](_0x1c78eb[_0x6e05('0xf')])[_0x6e05('0x11')](function(_0x4f4fab){if(_0x4f4fab){_0x1c78eb[_0x6e05('0x12')]=_0x4f4fab['id'];}utils[_0x6e05('0x13')]('CreateVoiceCallReport',_0x1c78eb);});}else{utils['request'](_0x6e05('0x14'),_0x1c78eb);}if(channels[_0x1c78eb[_0x6e05('0x5')]]){delete channels[_0x1c78eb[_0x6e05('0x5')]];}else if(_0x5dacb2&&channels[_0x5dacb2]){if(!transfers['blinds'][_0x5dacb2][_0x6e05('0x15')])delete transfers['blinds'][_0x5dacb2];delete channels[_0x5dacb2];}}exports[_0x6e05('0x16')]=function(_0x316fbd){try{utils['debug'](util['format'](_0x6e05('0x17'),_0x316fbd[_0x6e05('0x5')]),_0x316fbd);if(_0x316fbd[_0x6e05('0x5')]==_0x316fbd[_0x6e05('0x18')]&&_0x316fbd[_0x6e05('0xa')]!='OutgoingSpoolFailed'){utils[_0x6e05('0x7')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x316fbd[_0x6e05('0x5')],_0x316fbd[_0x6e05('0x19')],_0x316fbd[_0x6e05('0x1a')]));channels[_0x316fbd[_0x6e05('0x5')]]={'uniqueid':_0x316fbd[_0x6e05('0x5')],'accountcode':_0x316fbd[_0x6e05('0xf')],'source':_0x316fbd[_0x6e05('0xd')],'destination':_0x316fbd[_0x6e05('0x1a')],'destinationcontext':_0x316fbd['context'],'channel':_0x316fbd[_0x6e05('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6e05('0x2'),'amaflags':_0x6e05('0x1b')};}}catch(_0x3eb6e4){utils['error'](util['format'](_0x6e05('0x17'),_0x316fbd['uniqueid']),_0x3eb6e4);}};exports[_0x6e05('0x1c')]=function(_0x63172e){try{utils[_0x6e05('0x1d')](util[_0x6e05('0x8')](_0x6e05('0x1e'),_0x63172e[_0x6e05('0x5')]),_0x63172e);if(!_[_0x6e05('0x1f')](channels[_0x63172e['uniqueid']])&&_0x63172e[_0x6e05('0x20')]==0x6){utils[_0x6e05('0x7')](util['format'](_0x6e05('0x21'),_0x63172e[_0x6e05('0x5')],_0x63172e['context'],_0x63172e['channel']));if(_[_0x6e05('0x1f')](channels[_0x63172e['uniqueid']][_0x6e05('0x22')])){channels[_0x63172e[_0x6e05('0x5')]]['systemanswertime']=utils['now']();}}else if(!_[_0x6e05('0x1f')](channels[_0x63172e[_0x6e05('0x18')]])&&_0x63172e[_0x6e05('0x20')]==0x6&&_0x63172e[_0x6e05('0x19')]!='transfer'){utils[_0x6e05('0x7')](util[_0x6e05('0x8')](_0x6e05('0x23'),_0x63172e['uniqueid'],_0x63172e[_0x6e05('0x18')],_0x63172e['context'],_0x63172e['channel']));channels[_0x63172e['linkedid']][_0x6e05('0xf')]=_0x63172e[_0x6e05('0xf')];channels[_0x63172e[_0x6e05('0x18')]][_0x6e05('0x24')]=_0x63172e[_0x6e05('0xa')];if(_[_0x6e05('0x1f')](channels[_0x63172e[_0x6e05('0x18')]]['answertime'])){channels[_0x63172e[_0x6e05('0x18')]]['answertime']=utils[_0x6e05('0x25')]();}channels[_0x63172e['linkedid']][_0x6e05('0x26')]=dispositions[_['toNumber'](_0x63172e[_0x6e05('0x20')])]||'ANSWERED';}}catch(_0x2578a5){utils['error'](util[_0x6e05('0x8')](_0x6e05('0x1e'),_0x63172e[_0x6e05('0x5')]),_0x2578a5);}};exports[_0x6e05('0x27')]=function(_0x3f03f8){try{if(!_[_0x6e05('0x1f')](channels[_0x3f03f8['uniqueid']])){utils[_0x6e05('0x1d')](util[_0x6e05('0x8')](_0x6e05('0x28'),_0x3f03f8[_0x6e05('0x5')]),_0x3f03f8);if(_['isNil'](channels[_0x3f03f8['uniqueid']][_0x6e05('0x29')])){channels[_0x3f03f8['uniqueid']][_0x6e05('0x29')]=_0x3f03f8[_0x6e05('0x2a')]+'\x20<'+_0x3f03f8[_0x6e05('0xd')]+'>';}utils[_0x6e05('0x7')](util['format'](_0x6e05('0x2b'),_0x3f03f8['uniqueid'],channels[_0x3f03f8['uniqueid']][_0x6e05('0x29')],_0x3f03f8['cause-txt']));channels[_0x3f03f8[_0x6e05('0x5')]][_0x6e05('0x2c')]=utils[_0x6e05('0x25')]();channels[_0x3f03f8[_0x6e05('0x5')]][_0x6e05('0x2d')]=utils['diffTime'](channels[_0x3f03f8[_0x6e05('0x5')]]['endtime'],channels[_0x3f03f8[_0x6e05('0x5')]][_0x6e05('0x2e')]);channels[_0x3f03f8['uniqueid']][_0x6e05('0x2f')]=channels[_0x3f03f8[_0x6e05('0x5')]][_0x6e05('0x30')]?utils[_0x6e05('0x31')](channels[_0x3f03f8['uniqueid']]['endtime'],channels[_0x3f03f8[_0x6e05('0x5')]][_0x6e05('0x30')]):0x0;writeDB(channels[_0x3f03f8[_0x6e05('0x5')]]);}}catch(_0x2a4b2f){utils[_0x6e05('0x32')](util['format'](_0x6e05('0x28'),_0x3f03f8['uniqueid']),_0x2a4b2f);}};exports['attendedtransfer']=function(_0x511e06){try{if(!_['isNil'](channels[_0x511e06[_0x6e05('0x33')]])){utils['debug'](util['format'](_0x6e05('0x34'),_0x511e06[_0x6e05('0x35')]),_0x511e06);if(channels[_0x511e06[_0x6e05('0x33')]][_0x6e05('0xa')]==_0x511e06['transfereechannel']){utils[_0x6e05('0x7')](util['format'](_0x6e05('0x36'),_0x511e06['origtransfereruniqueid'],_0x511e06[_0x6e05('0x33')],_0x511e06['secondtransfererchannel']));channels[_0x511e06[_0x6e05('0x33')]]['destinationchannel']=_0x511e06[_0x6e05('0x37')];channels[_0x511e06[_0x6e05('0x33')]][_0x6e05('0x38')]='_attended';}else if(channels[_0x511e06['localtwolinkedid']][_0x6e05('0xa')]=_0x511e06[_0x6e05('0x39')]){utils['info'](util[_0x6e05('0x8')](_0x6e05('0x36'),_0x511e06[_0x6e05('0x35')],_0x511e06[_0x6e05('0x33')],_0x511e06[_0x6e05('0x3a')]));channels[_0x511e06[_0x6e05('0x33')]][_0x6e05('0x24')]=_0x511e06[_0x6e05('0x3a')];channels[_0x511e06[_0x6e05('0x33')]][_0x6e05('0x38')]=_0x6e05('0x3b');}}}catch(_0x466a3f){utils[_0x6e05('0x32')](util[_0x6e05('0x8')](_0x6e05('0x34'),_0x511e06[_0x6e05('0x35')]),_0x466a3f);}};exports['musiconholdstart']=function(_0x292f9b){try{if(!_[_0x6e05('0x1f')](channels[_0x292f9b[_0x6e05('0x5')]])){utils[_0x6e05('0x1d')](util['format']('[%s][calls][musiconholdstart]',_0x292f9b[_0x6e05('0x5')]),_0x292f9b);channels[_0x292f9b['uniqueid']][_0x6e05('0x3c')]=utils[_0x6e05('0x25')]();utils[_0x6e05('0x7')](util[_0x6e05('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x292f9b[_0x6e05('0x5')],channels[_0x292f9b[_0x6e05('0x5')]][_0x6e05('0x3c')]));}}catch(_0x42899e){utils[_0x6e05('0x32')](util['format'](_0x6e05('0x3d'),_0x292f9b[_0x6e05('0x5')]),_0x42899e);}};exports['musiconholdstop']=function(_0x2b97e6){try{if(!_[_0x6e05('0x1f')](channels[_0x2b97e6[_0x6e05('0x5')]])){utils[_0x6e05('0x1d')](util[_0x6e05('0x8')]('[%s][calls][musiconholdstop]',_0x2b97e6[_0x6e05('0x5')]),_0x2b97e6);if(!_[_0x6e05('0x1f')](channels[_0x2b97e6[_0x6e05('0x5')]][_0x6e05('0x3c')])){channels[_0x2b97e6[_0x6e05('0x5')]]['mohtime']+=utils[_0x6e05('0x31')](utils[_0x6e05('0x25')](),channels[_0x2b97e6['uniqueid']][_0x6e05('0x3c')]);utils[_0x6e05('0x7')](util[_0x6e05('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x2b97e6[_0x6e05('0x5')],channels[_0x2b97e6[_0x6e05('0x5')]][_0x6e05('0x3e')]));delete channels[_0x2b97e6[_0x6e05('0x5')]][_0x6e05('0x3c')];}}}catch(_0x50c0de){utils['error'](util[_0x6e05('0x8')](_0x6e05('0x3f'),_0x2b97e6['uniqueid']),_0x50c0de);}};exports[_0x6e05('0x40')]=function(_0x5df3ad){try{if(!_[_0x6e05('0x1f')](channels[_0x5df3ad['uniqueid']])){utils[_0x6e05('0x1d')](util[_0x6e05('0x8')](_0x6e05('0x41'),_0x5df3ad['uniqueid']),_0x5df3ad);if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x43')])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')](_0x6e05('0x44'),_0x5df3ad[_0x6e05('0x5')],_0x5df3ad[_0x6e05('0x45')]));channels[_0x5df3ad[_0x6e05('0x5')]]['source']=_0x5df3ad[_0x6e05('0x45')];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')]['xmd-phone'])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x5df3ad[_0x6e05('0x5')],_0x5df3ad['value']));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x46')]=_0x5df3ad[_0x6e05('0x45')];channels[_0x5df3ad['uniqueid']][_0x6e05('0x29')]='\x22'+_0x5df3ad[_0x6e05('0x45')]+'\x22\x20<'+_0x5df3ad[_0x6e05('0x45')]+'>';}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')]['xmd-callerid-preview'])||!_[_0x6e05('0x1f')](_0x5df3ad['variable'][_0x6e05('0x47')])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')](_0x6e05('0x48'),_0x5df3ad[_0x6e05('0x5')],!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x49')])?'xmd-callerid-preview':_0x6e05('0x47'),_0x5df3ad[_0x6e05('0x45')]));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x29')]=_0x5df3ad['value'];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x4a')])||!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x4b')])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5df3ad[_0x6e05('0x5')],!_['isNil'](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x4a')])?'xmd-queue':_0x6e05('0x4b'),_0x5df3ad['value']));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x4c')]=_0x6e05('0x4d');channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x4e')]=_0x5df3ad[_0x6e05('0x45')];channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x4f')]=!![];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x50')])){utils['info'](util[_0x6e05('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x5df3ad[_0x6e05('0x5')],_0x5df3ad[_0x6e05('0x45')]));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x51')]=_0x5df3ad[_0x6e05('0x45')];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x52')])){utils[_0x6e05('0x7')](util['format'](_0x6e05('0x53'),_0x5df3ad[_0x6e05('0x5')],_0x5df3ad[_0x6e05('0x45')]));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x54')]=_0x5df3ad[_0x6e05('0x45')];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')][_0x6e05('0x55')])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')](_0x6e05('0x56'),_0x5df3ad[_0x6e05('0x5')],_0x5df3ad[_0x6e05('0x45')]));channels[_0x5df3ad[_0x6e05('0x5')]][_0x6e05('0x57')]=_0x5df3ad[_0x6e05('0x45')];}if(!_[_0x6e05('0x1f')](_0x5df3ad[_0x6e05('0x42')]['sipcallid'])){utils[_0x6e05('0x7')](util[_0x6e05('0x8')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5df3ad[_0x6e05('0x5')],_0x5df3ad['value']));channels[_0x5df3ad['uniqueid']]['sipcallid']=_0x5df3ad[_0x6e05('0x45')];}}}catch(_0x410f81){utils[_0x6e05('0x32')](util[_0x6e05('0x8')]('[%s][calls][varset]',_0x5df3ad['uniqueid']),_0x410f81);}};exports[_0x6e05('0x58')]=function(_0x2aa53b){try{if(!_[_0x6e05('0x1f')](channels[_0x2aa53b[_0x6e05('0x5')]])){utils[_0x6e05('0x1d')](util[_0x6e05('0x8')]('[%s][calls][newexten]',_0x2aa53b['uniqueid']),_0x2aa53b);utils['info'](util[_0x6e05('0x8')](_0x6e05('0x59'),_0x2aa53b[_0x6e05('0x5')],_0x2aa53b[_0x6e05('0x5a')],_0x2aa53b[_0x6e05('0x5b')]));if(_0x2aa53b[_0x6e05('0x5a')]['toLowerCase']()==_0x6e05('0x5c')&&_['startsWith'](_0x2aa53b['appdata']['toLowerCase'](),_0x6e05('0x5d'))){var _0xaeee79=_0x2aa53b[_0x6e05('0x5b')][_0x6e05('0x5e')]('=');var _0x22c666=_0xaeee79[0x0][_0x6e05('0x5f')](_0xaeee79[0x0][_0x6e05('0x60')]('(')+0x1,_0xaeee79[0x0][_0x6e05('0x60')](')'));var _0x204f7e=_0xaeee79[0x1];channels[_0x2aa53b[_0x6e05('0x5')]][_0x22c666]=_0x204f7e;}if(!_[_0x6e05('0x61')](['hangup','noop','execif',_0x6e05('0x5c'),_0x6e05('0x62')],_0x2aa53b['application'][_0x6e05('0x63')]())){channels[_0x2aa53b[_0x6e05('0x5')]]['lastapplication']=_0x2aa53b[_0x6e05('0x5a')];channels[_0x2aa53b[_0x6e05('0x5')]][_0x6e05('0x4e')]=_0x2aa53b['appdata'];}}}catch(_0x581e1d){utils[_0x6e05('0x32')](util[_0x6e05('0x8')](_0x6e05('0x64'),_0x2aa53b['uniqueid']),_0x581e1d);}};
\ No newline at end of file
index 83ccc62..a7dcb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac7=['connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils'];(function(_0x2ebf2e,_0x5bce23){var _0x35413a=function(_0x2b7c48){while(--_0x2b7c48){_0x2ebf2e['push'](_0x2ebf2e['shift']());}};_0x35413a(++_0x5bce23);}(_0xdac7,0xfc));var _0x7dac=function(_0x27cd1c,_0x169a30){_0x27cd1c=_0x27cd1c-0x0;var _0x456fbe=_0xdac7[_0x27cd1c];return _0x456fbe;};'use strict';var utils=require(_0x7dac('0x0'));exports[_0x7dac('0x1')]=function(){utils[_0x7dac('0x2')](_0x7dac('0x3'));};exports['shutdown']=function(){utils[_0x7dac('0x2')](_0x7dac('0x4'));};exports[_0x7dac('0x5')]=function(){utils[_0x7dac('0x2')](_0x7dac('0x6'));};exports[_0x7dac('0x7')]=function(_0x33ae1c){utils['error']('[core]\x20error',_0x33ae1c);};exports[_0x7dac('0x8')]=function(){utils[_0x7dac('0x2')](_0x7dac('0x9'));};exports[_0x7dac('0xa')]=function(_0x596a14){};
\ No newline at end of file
+var _0xa031=['connect','info','shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils'];(function(_0x33e558,_0xfe0cc4){var _0x408de9=function(_0x34c070){while(--_0x34c070){_0x33e558['push'](_0x33e558['shift']());}};_0x408de9(++_0xfe0cc4);}(_0xa031,0x8b));var _0x1a03=function(_0x199f0a,_0x4c53e5){_0x199f0a=_0x199f0a-0x0;var _0x497c24=_0xa031[_0x199f0a];return _0x497c24;};'use strict';var utils=require(_0x1a03('0x0'));exports[_0x1a03('0x1')]=function(){utils[_0x1a03('0x2')]('[core]\x20connected');};exports[_0x1a03('0x3')]=function(){utils[_0x1a03('0x2')]('[core]\x20shutdown');};exports[_0x1a03('0x4')]=function(){utils[_0x1a03('0x2')](_0x1a03('0x5'));};exports[_0x1a03('0x6')]=function(_0xe7fbf5){utils[_0x1a03('0x6')]('[core]\x20error',_0xe7fbf5);};exports[_0x1a03('0x7')]=function(){utils['info'](_0x1a03('0x8'));};exports[_0x1a03('0x9')]=function(_0x29b7fc){};
\ No newline at end of file
index 752c452..dab7524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x798b=['dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','debug','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value'];(function(_0x3474b8,_0x198cc7){var _0x550a6b=function(_0xd4721){while(--_0xd4721){_0x3474b8['push'](_0x3474b8['shift']());}};_0x550a6b(++_0x198cc7);}(_0x798b,0xaa));var _0xb798=function(_0x3f9470,_0x5ef165){_0x3f9470=_0x3f9470-0x0;var _0x3a3d47=_0x798b[_0x3f9470];return _0x3a3d47;};'use strict';var _=require('lodash');var util=require(_0xb798('0x0'));var utils=require(_0xb798('0x1'));var dials={};function writeDB(_0x17c3bf){utils[_0xb798('0x2')](util[_0xb798('0x3')](_0xb798('0x4'),_0x17c3bf[_0xb798('0x5')],_0x17c3bf[_0xb798('0x6')],_0x17c3bf['dialstring'],_0x17c3bf[_0xb798('0x7')],_0x17c3bf['connectedlinenum'],_0x17c3bf[_0xb798('0x8')]));utils[_0xb798('0x9')](_0xb798('0xa'),_0x17c3bf);delete dials[_0x17c3bf[_0xb798('0x5')]];}exports['newexten']=function(_0x5a6720){try{utils['debug'](util[_0xb798('0x3')](_0xb798('0xb'),_0x5a6720['uniqueid']),_0x5a6720);utils['info'](util['format'](_0xb798('0xc'),_0x5a6720[_0xb798('0x5')],_0x5a6720[_0xb798('0xd')],_0x5a6720[_0xb798('0xe')]));if(_0x5a6720[_0xb798('0xd')][_0xb798('0xf')]()==_0xb798('0x10')&&_[_0xb798('0x11')](_0x5a6720[_0xb798('0xe')][_0xb798('0xf')](),'cdr(routeid)')){var _0x1d25d9=_0x5a6720['appdata']['split']('=');dials[_0x5a6720[_0xb798('0x5')]]={'routeId':_0x1d25d9[0x1]};}}catch(_0xab8193){utils[_0xb798('0x12')](util[_0xb798('0x3')](_0xb798('0xb'),_0x5a6720[_0xb798('0x5')]),_0xab8193);}};exports[_0xb798('0x13')]=function(_0xba0040){try{utils['debug'](util['format'](_0xb798('0x14'),_0xba0040[_0xb798('0x5')]),_0xba0040);if(!_[_0xb798('0x15')](_0xba0040[_0xb798('0x16')][_0xb798('0x17')])){utils[_0xb798('0x2')](util['format'](_0xb798('0x18'),_0xba0040[_0xb798('0x5')],_0xba0040[_0xb798('0x19')]));dials[_0xba0040[_0xb798('0x5')]]={'routeId':_0xba0040[_0xb798('0x19')]};}}catch(_0x2e99d9){utils[_0xb798('0x12')](util[_0xb798('0x3')](_0xb798('0x14'),_0xba0040['uniqueid']),_0x2e99d9);}};exports[_0xb798('0x1a')]=function(_0x494a92){try{if(!_[_0xb798('0x15')](dials[_0x494a92[_0xb798('0x5')]])){utils['debug'](util[_0xb798('0x3')](_0xb798('0x1b'),_0x494a92['uniqueid']),_0x494a92);dials[_0x494a92[_0xb798('0x5')]]=_[_0xb798('0x1c')](dials[_0x494a92['uniqueid']],_0x494a92);dials[_0x494a92[_0xb798('0x5')]][_0xb798('0x1d')]=utils[_0xb798('0x1e')]();dials[_0x494a92[_0xb798('0x5')]][_0xb798('0x1f')]='called';utils['info'](util[_0xb798('0x3')](_0xb798('0x20'),_0x494a92[_0xb798('0x5')],dials[_0x494a92[_0xb798('0x5')]][_0xb798('0x1d')]));}}catch(_0x40765d){utils[_0xb798('0x12')](util[_0xb798('0x3')](_0xb798('0x1b'),_0x494a92[_0xb798('0x5')]),_0x40765d);}};exports[_0xb798('0x21')]=function(_0x198d33){try{if(!_[_0xb798('0x15')](dials[_0x198d33[_0xb798('0x5')]])){utils[_0xb798('0x22')](util[_0xb798('0x3')]('[%s][dials][dialend]',_0x198d33[_0xb798('0x5')]),_0x198d33);dials[_0x198d33['uniqueid']]['dialstatus']=_0x198d33[_0xb798('0x8')];if(_0x198d33[_0xb798('0x8')]==_0xb798('0x23')){dials[_0x198d33[_0xb798('0x5')]]=_[_0xb798('0x1c')](dials[_0x198d33[_0xb798('0x5')]],_0x198d33);dials[_0x198d33['uniqueid']][_0xb798('0x24')]=utils[_0xb798('0x1e')]();dials[_0x198d33[_0xb798('0x5')]][_0xb798('0x1f')]=_0xb798('0x25');utils[_0xb798('0x2')](util[_0xb798('0x3')](_0xb798('0x26'),_0x198d33['uniqueid'],_0x198d33[_0xb798('0x8')],dials[_0x198d33[_0xb798('0x5')]][_0xb798('0x24')]));}else{utils[_0xb798('0x2')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x198d33[_0xb798('0x5')],_0x198d33[_0xb798('0x8')]));}}}catch(_0x263e81){utils[_0xb798('0x12')](util['format']('[%s][dials][dialend]',_0x198d33[_0xb798('0x5')]),_0x263e81);}};exports[_0xb798('0x27')]=function(_0x2de384){try{if(!_[_0xb798('0x15')](dials[_0x2de384[_0xb798('0x5')]])){utils[_0xb798('0x22')](util['format'](_0xb798('0x28'),_0x2de384[_0xb798('0x5')]),_0x2de384);utils[_0xb798('0x2')](util[_0xb798('0x3')](_0xb798('0x29'),_0x2de384[_0xb798('0x5')],_0x2de384[_0xb798('0x7')],_0x2de384[_0xb798('0x2a')],_0x2de384[_0xb798('0x2b')]));dials[_0x2de384[_0xb798('0x5')]]=_[_0xb798('0x1c')](dials[_0x2de384['uniqueid']],{'endtime':utils[_0xb798('0x1e')](),'lastevent':_0xb798('0x2c')});dials[_0x2de384[_0xb798('0x5')]][_0xb798('0x2d')]=utils[_0xb798('0x2e')](dials[_0x2de384[_0xb798('0x5')]]['endtime'],dials[_0x2de384['uniqueid']][_0xb798('0x1d')]);dials[_0x2de384['uniqueid']]['holdtime']=utils[_0xb798('0x2e')](dials[_0x2de384[_0xb798('0x5')]][_0xb798('0x24')]||dials[_0x2de384[_0xb798('0x5')]][_0xb798('0x2f')],dials[_0x2de384['uniqueid']][_0xb798('0x1d')]);dials[_0x2de384[_0xb798('0x5')]][_0xb798('0x30')]=dials[_0x2de384[_0xb798('0x5')]]['answertime']?utils[_0xb798('0x2e')](dials[_0x2de384[_0xb798('0x5')]][_0xb798('0x2f')],dials[_0x2de384[_0xb798('0x5')]]['answertime']):0x0;writeDB(dials[_0x2de384['uniqueid']]);}}catch(_0x5926ac){utils[_0xb798('0x12')](util[_0xb798('0x3')](_0xb798('0x28'),_0x2de384[_0xb798('0x5')]),_0x5926ac);}};
\ No newline at end of file
+var _0x4735=['[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','outboundrouteid'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x4735,0x81));var _0x5473=function(_0x19b51d,_0x34c337){_0x19b51d=_0x19b51d-0x0;var _0x200ff8=_0x4735[_0x19b51d];return _0x200ff8;};'use strict';var _=require(_0x5473('0x0'));var util=require(_0x5473('0x1'));var utils=require(_0x5473('0x2'));var dials={};function writeDB(_0x485829){utils['info'](util[_0x5473('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x485829[_0x5473('0x4')],_0x485829[_0x5473('0x5')],_0x485829[_0x5473('0x6')],_0x485829[_0x5473('0x7')],_0x485829[_0x5473('0x8')],_0x485829[_0x5473('0x9')]));utils['request'](_0x5473('0xa'),_0x485829);delete dials[_0x485829[_0x5473('0x4')]];}exports[_0x5473('0xb')]=function(_0x1f69be){try{utils[_0x5473('0xc')](util[_0x5473('0x3')](_0x5473('0xd'),_0x1f69be[_0x5473('0x4')]),_0x1f69be);utils[_0x5473('0xe')](util[_0x5473('0x3')](_0x5473('0xf'),_0x1f69be[_0x5473('0x4')],_0x1f69be[_0x5473('0x10')],_0x1f69be[_0x5473('0x11')]));if(_0x1f69be[_0x5473('0x10')]['toLowerCase']()==_0x5473('0x12')&&_[_0x5473('0x13')](_0x1f69be[_0x5473('0x11')][_0x5473('0x14')](),_0x5473('0x15'))){var _0xea4928=_0x1f69be[_0x5473('0x11')][_0x5473('0x16')]('=');dials[_0x1f69be[_0x5473('0x4')]]={'routeId':_0xea4928[0x1]};}}catch(_0x6b7af1){utils['error'](util[_0x5473('0x3')]('[%s][dials][newexten]',_0x1f69be['uniqueid']),_0x6b7af1);}};exports[_0x5473('0x17')]=function(_0x37e942){try{utils['debug'](util[_0x5473('0x3')](_0x5473('0x18'),_0x37e942['uniqueid']),_0x37e942);if(!_[_0x5473('0x19')](_0x37e942['variable'][_0x5473('0x1a')])){utils[_0x5473('0xe')](util[_0x5473('0x3')](_0x5473('0x1b'),_0x37e942['uniqueid'],_0x37e942[_0x5473('0x1c')]));dials[_0x37e942[_0x5473('0x4')]]={'routeId':_0x37e942[_0x5473('0x1c')]};}}catch(_0x34ee53){utils[_0x5473('0x1d')](util['format'](_0x5473('0x18'),_0x37e942[_0x5473('0x4')]),_0x34ee53);}};exports['dialbegin']=function(_0x31157){try{if(!_['isNil'](dials[_0x31157[_0x5473('0x4')]])){utils[_0x5473('0xc')](util['format'](_0x5473('0x1e'),_0x31157['uniqueid']),_0x31157);dials[_0x31157['uniqueid']]=_[_0x5473('0x1f')](dials[_0x31157[_0x5473('0x4')]],_0x31157);dials[_0x31157[_0x5473('0x4')]][_0x5473('0x20')]=utils[_0x5473('0x21')]();dials[_0x31157['uniqueid']][_0x5473('0x22')]='called';utils['info'](util[_0x5473('0x3')](_0x5473('0x23'),_0x31157[_0x5473('0x4')],dials[_0x31157[_0x5473('0x4')]][_0x5473('0x20')]));}}catch(_0x4307e3){utils[_0x5473('0x1d')](util[_0x5473('0x3')](_0x5473('0x1e'),_0x31157[_0x5473('0x4')]),_0x4307e3);}};exports[_0x5473('0x24')]=function(_0x49c9b7){try{if(!_[_0x5473('0x19')](dials[_0x49c9b7[_0x5473('0x4')]])){utils[_0x5473('0xc')](util['format']('[%s][dials][dialend]',_0x49c9b7['uniqueid']),_0x49c9b7);dials[_0x49c9b7[_0x5473('0x4')]][_0x5473('0x9')]=_0x49c9b7[_0x5473('0x9')];if(_0x49c9b7[_0x5473('0x9')]==_0x5473('0x25')){dials[_0x49c9b7[_0x5473('0x4')]]=_[_0x5473('0x1f')](dials[_0x49c9b7['uniqueid']],_0x49c9b7);dials[_0x49c9b7[_0x5473('0x4')]]['answertime']=utils[_0x5473('0x21')]();dials[_0x49c9b7['uniqueid']][_0x5473('0x22')]=_0x5473('0x26');utils[_0x5473('0xe')](util[_0x5473('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x49c9b7[_0x5473('0x4')],_0x49c9b7['dialstatus'],dials[_0x49c9b7[_0x5473('0x4')]][_0x5473('0x27')]));}else{utils[_0x5473('0xe')](util['format'](_0x5473('0x28'),_0x49c9b7[_0x5473('0x4')],_0x49c9b7['dialstatus']));}}}catch(_0x4874bc){utils[_0x5473('0x1d')](util['format'](_0x5473('0x29'),_0x49c9b7['uniqueid']),_0x4874bc);}};exports[_0x5473('0x2a')]=function(_0x473a8e){try{if(!_['isNil'](dials[_0x473a8e['uniqueid']])){utils[_0x5473('0xc')](util['format']('[%s][dials][hangup]',_0x473a8e[_0x5473('0x4')]),_0x473a8e);utils[_0x5473('0xe')](util[_0x5473('0x3')](_0x5473('0x2b'),_0x473a8e[_0x5473('0x4')],_0x473a8e['calleridnum'],_0x473a8e[_0x5473('0x2c')],_0x473a8e[_0x5473('0x2d')]));dials[_0x473a8e['uniqueid']]=_[_0x5473('0x1f')](dials[_0x473a8e[_0x5473('0x4')]],{'endtime':utils[_0x5473('0x21')](),'lastevent':_0x5473('0x2e')});dials[_0x473a8e['uniqueid']]['duration']=utils[_0x5473('0x2f')](dials[_0x473a8e['uniqueid']][_0x5473('0x30')],dials[_0x473a8e[_0x5473('0x4')]][_0x5473('0x20')]);dials[_0x473a8e[_0x5473('0x4')]][_0x5473('0x31')]=utils[_0x5473('0x2f')](dials[_0x473a8e[_0x5473('0x4')]]['answertime']||dials[_0x473a8e[_0x5473('0x4')]][_0x5473('0x30')],dials[_0x473a8e[_0x5473('0x4')]][_0x5473('0x20')]);dials[_0x473a8e['uniqueid']][_0x5473('0x32')]=dials[_0x473a8e[_0x5473('0x4')]][_0x5473('0x27')]?utils['diffTime'](dials[_0x473a8e['uniqueid']][_0x5473('0x30')],dials[_0x473a8e[_0x5473('0x4')]]['answertime']):0x0;writeDB(dials[_0x473a8e[_0x5473('0x4')]]);}}catch(_0x2902dc){utils['error'](util[_0x5473('0x3')](_0x5473('0x33'),_0x473a8e[_0x5473('0x4')]),_0x2902dc);}};
\ No newline at end of file
index f5e5e5b..10843a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe788=['[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','device'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xe788,0xf8));var _0x8e78=function(_0x4954ea,_0x3c9f40){_0x4954ea=_0x4954ea-0x0;var _0x39d8a8=_0xe788[_0x4954ea];return _0x39d8a8;};var AsteriskManager=require(_0x8e78('0x0'));var config=require('../../config/environment');var utils=require(_0x8e78('0x1'));var util=require(_0x8e78('0x2'));var isXDREnabled=config[_0x8e78('0x3')]&&config[_0x8e78('0x3')][_0x8e78('0x4')]?!config[_0x8e78('0x3')][_0x8e78('0x4')]:!![];var isProduction=config[_0x8e78('0x5')]===_0x8e78('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x8e78('0x3')][_0x8e78('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x8e78('0x8')][_0x8e78('0x9')],config[_0x8e78('0x8')]['ip'],config[_0x8e78('0x8')][_0x8e78('0xa')],config[_0x8e78('0x8')]['password'],!![]);ami[_0x8e78('0xb')]();if(!isXDREnabled){utils['info'](_0x8e78('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8e78('0xd')](_0x8e78('0xe'));}else{var agents=require(_0x8e78('0xf'));var calls=require('./calls.controller');var queues=require(_0x8e78('0x10'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x8e78('0x11'));var transfers=require('./transfers.controller');var core=require(_0x8e78('0x12'));ami['on'](_0x8e78('0x13'),core['connect']);ami['on'](_0x8e78('0x14'),core[_0x8e78('0x14')]);ami['on'](_0x8e78('0x15'),core[_0x8e78('0x15')]);ami['on'](_0x8e78('0x16'),core[_0x8e78('0x16')]);ami['on']('close',core['close']);ami['on'](_0x8e78('0x17'),core['managerevent']);ami['on'](_0x8e78('0x18'),function(_0xef8039){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')]('[%s][index][devicestatechange]',_0xef8039[_0x8e78('0x1b')]),_0xef8039);members[_0x8e78('0x18')](_0xef8039);}catch(_0x13708e){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x1c'),_0xef8039[_0x8e78('0x1b')]),_0x13708e);}});ami['on'](_0x8e78('0x1d'),function(_0x629aa6){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x1e'),_0x629aa6[_0x8e78('0x1f')]),_0x629aa6);agents[_0x8e78('0x1d')](_0x629aa6);}catch(_0x3c5717){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')]('[%s][index][agentcalled]',_0x629aa6[_0x8e78('0x1f')]),_0x3c5717);}});ami['on'](_0x8e78('0x20'),function(_0x282f4e){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x21'),_0x282f4e[_0x8e78('0x1f')]),_0x282f4e);agents[_0x8e78('0x20')](_0x282f4e);}catch(_0x24fcd8){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')]('[%s][index][agentringnoanswer]',_0x282f4e[_0x8e78('0x1f')]),_0x24fcd8);}});ami['on']('agentconnect',function(_0x1bbfa5){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')]('[%s][index][agentconnect]',_0x1bbfa5[_0x8e78('0x1f')]),_0x1bbfa5);agents['agentconnect'](_0x1bbfa5);queues[_0x8e78('0x22')](_0x1bbfa5);}catch(_0x49de3f){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x23'),_0x1bbfa5['uniqueid']),_0x49de3f);}});ami['on'](_0x8e78('0x24'),function(_0x33699e){try{utils['debug'](util[_0x8e78('0x1a')](_0x8e78('0x25'),_0x33699e[_0x8e78('0x1f')]),_0x33699e);agents[_0x8e78('0x24')](_0x33699e);queues['agentcomplete'](_0x33699e);members[_0x8e78('0x24')](_0x33699e);}catch(_0x24e8a5){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x25'),_0x33699e['uniqueid']),_0x24e8a5);}});ami['on']('queuecallerabandon',function(_0x44b644){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x26'),_0x44b644[_0x8e78('0x1f')]),_0x44b644);agents[_0x8e78('0x27')](_0x44b644);queues[_0x8e78('0x27')](_0x44b644);}catch(_0x320d71){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x26'),_0x44b644[_0x8e78('0x1f')]),_0x320d71);}});ami['on'](_0x8e78('0x28'),function(_0x516fba){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')]('[%s][index][queuecallerjoin]',_0x516fba[_0x8e78('0x1f')]),_0x516fba);queues[_0x8e78('0x28')](_0x516fba);recordings[_0x8e78('0x28')](_0x516fba);}catch(_0x43f0e5){utils[_0x8e78('0x16')](util['format'](_0x8e78('0x29'),_0x516fba[_0x8e78('0x1f')]),_0x43f0e5);}});ami['on'](_0x8e78('0x2a'),function(_0x53eb42){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x2b'),_0x53eb42[_0x8e78('0x1f')]),_0x53eb42);queues[_0x8e78('0x2a')](_0x53eb42);}catch(_0x51a439){utils['error'](util[_0x8e78('0x1a')]('[%s][index][queuecallerleave]',_0x53eb42[_0x8e78('0x1f')]),_0x51a439);}});ami['on'](_0x8e78('0x2c'),function(_0x5f1610){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x2d'),_0x5f1610[_0x8e78('0x1f')]),_0x5f1610);queues['musiconholdstart'](_0x5f1610);calls['musiconholdstart'](_0x5f1610);}catch(_0x18b4b3){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x2d'),_0x5f1610[_0x8e78('0x1f')]),_0x18b4b3);}});ami['on'](_0x8e78('0x2e'),function(_0x5a8689){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x2f'),_0x5a8689[_0x8e78('0x1f')]),_0x5a8689);queues[_0x8e78('0x2e')](_0x5a8689);calls[_0x8e78('0x2e')](_0x5a8689);}catch(_0x350c14){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x2f'),_0x5a8689['uniqueid']),_0x350c14);}});ami['on'](_0x8e78('0x30'),function(_0x546991){try{utils['debug'](util[_0x8e78('0x1a')](_0x8e78('0x31'),_0x546991[_0x8e78('0x1f')]),_0x546991);calls['newstate'](_0x546991);recordings['newstate'](_0x546991);}catch(_0xc9c0f6){utils['error'](util['format'](_0x8e78('0x31'),_0x546991[_0x8e78('0x1f')]),_0xc9c0f6);}});ami['on'](_0x8e78('0x32'),function(_0x31ec83){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x33'),_0x31ec83[_0x8e78('0x1f')]),_0x31ec83);calls[_0x8e78('0x32')](_0x31ec83);recordings[_0x8e78('0x32')](_0x31ec83);dials['hangup'](_0x31ec83);agents[_0x8e78('0x32')](_0x31ec83);queues[_0x8e78('0x32')](_0x31ec83);}catch(_0x2fb42d){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x33'),_0x31ec83[_0x8e78('0x1f')]),_0x2fb42d);}});ami['on'](_0x8e78('0x34'),function(_0x25021c){try{utils[_0x8e78('0x19')](util['format'](_0x8e78('0x35'),_0x25021c['uniqueid']),_0x25021c);members[_0x8e78('0x34')](_0x25021c);}catch(_0x19bce6){utils[_0x8e78('0x16')](util['format'](_0x8e78('0x35'),_0x25021c['uniqueid']),_0x19bce6);}});ami['on'](_0x8e78('0x36'),function(_0x1c4b94){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x37'),_0x1c4b94[_0x8e78('0x1f')]),_0x1c4b94);queues[_0x8e78('0x36')](_0x1c4b94);agents[_0x8e78('0x36')](_0x1c4b94);transfers[_0x8e78('0x36')](_0x1c4b94);recordings['blindtransfer'](_0x1c4b94);}catch(_0x143695){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x37'),_0x1c4b94[_0x8e78('0x1f')]),_0x143695);}});ami['on'](_0x8e78('0x38'),function(_0x23d45c){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x39'),_0x23d45c['origtransfereruniqueid']),_0x23d45c);queues[_0x8e78('0x38')](_0x23d45c);transfers[_0x8e78('0x38')](_0x23d45c);agents[_0x8e78('0x38')](_0x23d45c);calls[_0x8e78('0x38')](_0x23d45c);}catch(_0x272196){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x39'),_0x23d45c[_0x8e78('0x3a')]),_0x272196);}});ami['on'](_0x8e78('0x3b'),function(_0x308b76){try{utils['debug'](util[_0x8e78('0x1a')]('[%s][index][varset]',_0x308b76[_0x8e78('0x1f')]),_0x308b76);queues['varset'](_0x308b76);recordings['varset'](_0x308b76);calls['varset'](_0x308b76);dials['varset'](_0x308b76);}catch(_0x3f4a14){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x3c'),_0x308b76['uniqueid']),_0x3f4a14);}});ami['on'](_0x8e78('0x3d'),function(_0x3712a2){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')]('[%s][index][newexten]',_0x3712a2[_0x8e78('0x1f')]),_0x3712a2);calls[_0x8e78('0x3d')](_0x3712a2);recordings[_0x8e78('0x3d')](_0x3712a2);dials[_0x8e78('0x3d')](_0x3712a2);}catch(_0x317f7a){utils[_0x8e78('0x16')](util['format'](_0x8e78('0x3e'),_0x3712a2[_0x8e78('0x1f')]),_0x317f7a);}});ami['on']('newchannel',function(_0x788307){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x3f'),_0x788307['uniqueid']),_0x788307);calls[_0x8e78('0x40')](_0x788307);recordings[_0x8e78('0x40')](_0x788307);}catch(_0x310160){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x3f'),_0x788307[_0x8e78('0x1f')]),_0x310160);}});ami['on'](_0x8e78('0x41'),function(_0x1d7935){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x42'),_0x1d7935[_0x8e78('0x1f')]),_0x1d7935);dials['dialbegin'](_0x1d7935);}catch(_0x84e0b0){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')]('[%s]dialbegin',_0x1d7935[_0x8e78('0x1f')]),_0x84e0b0);}});ami['on'](_0x8e78('0x43'),function(_0x5add15){try{utils[_0x8e78('0x19')](util[_0x8e78('0x1a')](_0x8e78('0x44'),_0x5add15['uniqueid']),_0x5add15);dials['dialend'](_0x5add15);}catch(_0xf76da0){utils[_0x8e78('0x16')](util[_0x8e78('0x1a')](_0x8e78('0x44'),_0x5add15[_0x8e78('0x1f')]),_0xf76da0);}});}
\ No newline at end of file
+var _0x484f=['dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','port','password','keepConnected','info','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]'];(function(_0x1d58a4,_0x24c309){var _0x29118a=function(_0x28c850){while(--_0x28c850){_0x1d58a4['push'](_0x1d58a4['shift']());}};_0x29118a(++_0x24c309);}(_0x484f,0x167));var _0xf484=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x484f[_0x2dc343];return _0x51eac5;};var AsteriskManager=require(_0xf484('0x0'));var config=require(_0xf484('0x1'));var utils=require(_0xf484('0x2'));var util=require(_0xf484('0x3'));var isXDREnabled=config[_0xf484('0x4')]&&config[_0xf484('0x4')][_0xf484('0x5')]?!config[_0xf484('0x4')][_0xf484('0x5')]:!![];var isProduction=config[_0xf484('0x6')]==='production'||![];var isLocalAsterisk=config[_0xf484('0x4')]&&config['xdr'][_0xf484('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xf484('0x8')][_0xf484('0x9')],config['asterisk']['ip'],config[_0xf484('0x8')]['username'],config['asterisk'][_0xf484('0xa')],!![]);ami[_0xf484('0xb')]();if(!isXDREnabled){utils[_0xf484('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xf484('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xf484('0xd'));var calls=require('./calls.controller');var queues=require(_0xf484('0xe'));var recordings=require(_0xf484('0xf'));var members=require('./members.controller');var dials=require(_0xf484('0x10'));var transfers=require(_0xf484('0x11'));var core=require(_0xf484('0x12'));ami['on'](_0xf484('0x13'),core[_0xf484('0x13')]);ami['on'](_0xf484('0x14'),core[_0xf484('0x14')]);ami['on'](_0xf484('0x15'),core[_0xf484('0x15')]);ami['on'](_0xf484('0x16'),core[_0xf484('0x16')]);ami['on'](_0xf484('0x17'),core[_0xf484('0x17')]);ami['on'](_0xf484('0x18'),core[_0xf484('0x18')]);ami['on'](_0xf484('0x19'),function(_0x384f36){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x1c'),_0x384f36[_0xf484('0x1d')]),_0x384f36);members[_0xf484('0x19')](_0x384f36);}catch(_0x311f6d){utils['error'](util[_0xf484('0x1b')](_0xf484('0x1c'),_0x384f36[_0xf484('0x1d')]),_0x311f6d);}});ami['on'](_0xf484('0x1e'),function(_0x17df45){try{utils['debug'](util[_0xf484('0x1b')](_0xf484('0x1f'),_0x17df45[_0xf484('0x20')]),_0x17df45);agents['agentcalled'](_0x17df45);}catch(_0x356f87){utils['error'](util[_0xf484('0x1b')](_0xf484('0x1f'),_0x17df45[_0xf484('0x20')]),_0x356f87);}});ami['on']('agentringnoanswer',function(_0x4abf6f){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x21'),_0x4abf6f[_0xf484('0x20')]),_0x4abf6f);agents[_0xf484('0x22')](_0x4abf6f);}catch(_0x41e7ff){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x21'),_0x4abf6f[_0xf484('0x20')]),_0x41e7ff);}});ami['on']('agentconnect',function(_0xb52038){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')]('[%s][index][agentconnect]',_0xb52038[_0xf484('0x20')]),_0xb52038);agents[_0xf484('0x23')](_0xb52038);queues[_0xf484('0x23')](_0xb52038);}catch(_0x100ce8){utils[_0xf484('0x16')](util['format'](_0xf484('0x24'),_0xb52038[_0xf484('0x20')]),_0x100ce8);}});ami['on'](_0xf484('0x25'),function(_0x1771b0){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x26'),_0x1771b0[_0xf484('0x20')]),_0x1771b0);agents[_0xf484('0x25')](_0x1771b0);queues[_0xf484('0x25')](_0x1771b0);members[_0xf484('0x25')](_0x1771b0);}catch(_0xfb9e73){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x26'),_0x1771b0['uniqueid']),_0xfb9e73);}});ami['on'](_0xf484('0x27'),function(_0x316df4){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x28'),_0x316df4[_0xf484('0x20')]),_0x316df4);agents['queuecallerabandon'](_0x316df4);queues[_0xf484('0x27')](_0x316df4);}catch(_0x3d16aa){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x28'),_0x316df4[_0xf484('0x20')]),_0x3d16aa);}});ami['on']('queuecallerjoin',function(_0x5a3a0a){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x29'),_0x5a3a0a[_0xf484('0x20')]),_0x5a3a0a);queues[_0xf484('0x2a')](_0x5a3a0a);recordings[_0xf484('0x2a')](_0x5a3a0a);}catch(_0x47dd6a){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x29'),_0x5a3a0a[_0xf484('0x20')]),_0x47dd6a);}});ami['on'](_0xf484('0x2b'),function(_0x3161e1){try{utils['debug'](util[_0xf484('0x1b')](_0xf484('0x2c'),_0x3161e1[_0xf484('0x20')]),_0x3161e1);queues[_0xf484('0x2b')](_0x3161e1);}catch(_0x1ffd74){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x2c'),_0x3161e1[_0xf484('0x20')]),_0x1ffd74);}});ami['on'](_0xf484('0x2d'),function(_0x5a1672){try{utils[_0xf484('0x1a')](util['format']('[%s][index][musiconholdstart]',_0x5a1672['uniqueid']),_0x5a1672);queues[_0xf484('0x2d')](_0x5a1672);calls[_0xf484('0x2d')](_0x5a1672);}catch(_0x16dad9){utils['error'](util[_0xf484('0x1b')](_0xf484('0x2e'),_0x5a1672[_0xf484('0x20')]),_0x16dad9);}});ami['on'](_0xf484('0x2f'),function(_0x57ee90){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x30'),_0x57ee90[_0xf484('0x20')]),_0x57ee90);queues[_0xf484('0x2f')](_0x57ee90);calls[_0xf484('0x2f')](_0x57ee90);}catch(_0x128b65){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x30'),_0x57ee90['uniqueid']),_0x128b65);}});ami['on'](_0xf484('0x31'),function(_0x1a1889){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x32'),_0x1a1889[_0xf484('0x20')]),_0x1a1889);calls[_0xf484('0x31')](_0x1a1889);recordings[_0xf484('0x31')](_0x1a1889);}catch(_0x38fc89){utils[_0xf484('0x16')](util[_0xf484('0x1b')]('[%s][index][newstate]',_0x1a1889['uniqueid']),_0x38fc89);}});ami['on'](_0xf484('0x33'),function(_0x69c5b8){try{utils['debug'](util[_0xf484('0x1b')](_0xf484('0x34'),_0x69c5b8[_0xf484('0x20')]),_0x69c5b8);calls[_0xf484('0x33')](_0x69c5b8);recordings['hangup'](_0x69c5b8);dials[_0xf484('0x33')](_0x69c5b8);agents[_0xf484('0x33')](_0x69c5b8);queues[_0xf484('0x33')](_0x69c5b8);}catch(_0x44538b){utils[_0xf484('0x16')](util['format'](_0xf484('0x34'),_0x69c5b8[_0xf484('0x20')]),_0x44538b);}});ami['on'](_0xf484('0x35'),function(_0x6e9efd){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x36'),_0x6e9efd[_0xf484('0x20')]),_0x6e9efd);members['cdr'](_0x6e9efd);}catch(_0x4ba2f1){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x36'),_0x6e9efd['uniqueid']),_0x4ba2f1);}});ami['on']('blindtransfer',function(_0x1c8807){try{utils[_0xf484('0x1a')](util['format'](_0xf484('0x37'),_0x1c8807[_0xf484('0x20')]),_0x1c8807);queues[_0xf484('0x38')](_0x1c8807);agents[_0xf484('0x38')](_0x1c8807);transfers['blindtransfer'](_0x1c8807);recordings[_0xf484('0x38')](_0x1c8807);}catch(_0x224e45){utils[_0xf484('0x16')](util['format']('[%s][index][blindtransfer]',_0x1c8807['uniqueid']),_0x224e45);}});ami['on'](_0xf484('0x39'),function(_0x35d777){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x3a'),_0x35d777[_0xf484('0x3b')]),_0x35d777);queues[_0xf484('0x39')](_0x35d777);transfers[_0xf484('0x39')](_0x35d777);agents['attendedtransfer'](_0x35d777);calls[_0xf484('0x39')](_0x35d777);}catch(_0x31d19e){utils['error'](util['format'](_0xf484('0x3a'),_0x35d777[_0xf484('0x3b')]),_0x31d19e);}});ami['on'](_0xf484('0x3c'),function(_0x2d261c){try{utils['debug'](util['format'](_0xf484('0x3d'),_0x2d261c[_0xf484('0x20')]),_0x2d261c);queues[_0xf484('0x3c')](_0x2d261c);recordings['varset'](_0x2d261c);calls[_0xf484('0x3c')](_0x2d261c);dials[_0xf484('0x3c')](_0x2d261c);}catch(_0x3f1c0c){utils['error'](util['format'](_0xf484('0x3d'),_0x2d261c[_0xf484('0x20')]),_0x3f1c0c);}});ami['on'](_0xf484('0x3e'),function(_0x4f7759){try{utils['debug'](util[_0xf484('0x1b')](_0xf484('0x3f'),_0x4f7759[_0xf484('0x20')]),_0x4f7759);calls['newexten'](_0x4f7759);recordings[_0xf484('0x3e')](_0x4f7759);dials[_0xf484('0x3e')](_0x4f7759);}catch(_0x4fa3bd){utils[_0xf484('0x16')](util['format'](_0xf484('0x3f'),_0x4f7759['uniqueid']),_0x4fa3bd);}});ami['on'](_0xf484('0x40'),function(_0x4cc8d2){try{utils['debug'](util['format'](_0xf484('0x41'),_0x4cc8d2[_0xf484('0x20')]),_0x4cc8d2);calls[_0xf484('0x40')](_0x4cc8d2);recordings[_0xf484('0x40')](_0x4cc8d2);}catch(_0x2e91a7){utils['error'](util[_0xf484('0x1b')](_0xf484('0x41'),_0x4cc8d2[_0xf484('0x20')]),_0x2e91a7);}});ami['on']('dialbegin',function(_0x430aca){try{utils[_0xf484('0x1a')](util[_0xf484('0x1b')](_0xf484('0x42'),_0x430aca['uniqueid']),_0x430aca);dials[_0xf484('0x43')](_0x430aca);}catch(_0x113a62){utils[_0xf484('0x16')](util[_0xf484('0x1b')](_0xf484('0x44'),_0x430aca[_0xf484('0x20')]),_0x113a62);}});ami['on']('dialend',function(_0x5d3e93){try{utils['debug'](util[_0xf484('0x1b')]('[%s][index][dialend]',_0x5d3e93[_0xf484('0x20')]),_0x5d3e93);dials[_0xf484('0x45')](_0x5d3e93);}catch(_0x3c0741){utils[_0xf484('0x16')](util['format'](_0xf484('0x46'),_0x5d3e93['uniqueid']),_0x3c0741);}});}
\ No newline at end of file
index 4ee0383..beed59b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8eb=['lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','getUserByInterface','then','name','request','CreateMemberReport','internal','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','channel','split','data1','type','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]'];(function(_0x4eca6e,_0x1cc757){var _0x353d53=function(_0x2a0b60){while(--_0x2a0b60){_0x4eca6e['push'](_0x4eca6e['shift']());}};_0x353d53(++_0x1cc757);}(_0xd8eb,0x66));var _0xbd8e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xd8eb[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var utils=require('./utils');var members={};var exclude=[_0xbd8e('0x2'),_0xbd8e('0x3')];function writeDB(_0x51d6e1){utils[_0xbd8e('0x4')](util[_0xbd8e('0x5')](_0xbd8e('0x6'),_0x51d6e1[_0xbd8e('0x7')],_0x51d6e1[_0xbd8e('0x8')],_0x51d6e1['channel'],_0x51d6e1['data2'],_0x51d6e1[_0xbd8e('0x9')],_0x51d6e1['type']));if(_0x51d6e1[_0xbd8e('0x8')]){utils[_0xbd8e('0xa')](_0x51d6e1['interface'])[_0xbd8e('0xb')](function(_0x5532dc){if(_0x5532dc){_0x51d6e1[_0xbd8e('0x9')]=_0x5532dc[_0xbd8e('0xc')];_0x51d6e1['internal']=_0x5532dc['internal'];utils[_0xbd8e('0xd')](_0xbd8e('0xe'),_0x51d6e1);}else{utils['getUserByName'](_0x51d6e1[_0xbd8e('0x8')]['split']('/')[0x1])[_0xbd8e('0xb')](function(_0x46ef89){if(_0x46ef89){_0x51d6e1[_0xbd8e('0x9')]=_0x46ef89['name'];_0x51d6e1[_0xbd8e('0xf')]=_0x46ef89['internal'];utils['request'](_0xbd8e('0xe'),_0x51d6e1);}});}})[_0xbd8e('0x10')](function(_0x25d12f){utils[_0xbd8e('0x11')](util[_0xbd8e('0x5')](_0xbd8e('0x12'),_0x51d6e1[_0xbd8e('0x7')]),_0x25d12f);});}delete members[_0x51d6e1[_0xbd8e('0x8')]];}function startsWith(_0x3d0bcf,_0x33ff37){return _[_0xbd8e('0x13')](_0x3d0bcf,function(_0x2355cd){return _[_0xbd8e('0x14')](_0x33ff37,_0x2355cd);});}exports[_0xbd8e('0x15')]=function(_0x4bcae0){try{utils[_0xbd8e('0x16')](util[_0xbd8e('0x5')](_0xbd8e('0x17'),members[_0x4bcae0[_0xbd8e('0x18')]]?members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x7')]:_0x4bcae0[_0xbd8e('0x18')]),_0x4bcae0);utils['info'](util[_0xbd8e('0x5')](_0xbd8e('0x19'),members[_0x4bcae0[_0xbd8e('0x18')]]?members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x7')]:_0x4bcae0[_0xbd8e('0x18')],_0x4bcae0[_0xbd8e('0x1a')],_0x4bcae0[_0xbd8e('0x18')]));switch(_0x4bcae0['state']){case'INUSE':case _0xbd8e('0x1b'):if(!startsWith(exclude,_0x4bcae0[_0xbd8e('0x18')])){members[_0x4bcae0[_0xbd8e('0x18')]]={'channel':'voice','interface':_0x4bcae0[_0xbd8e('0x18')],'type':_0xbd8e('0x1c'),'enterAt':utils[_0xbd8e('0x1d')](),'role':_0xbd8e('0x1e')};}break;case'NOT_INUSE':if(!_[_0xbd8e('0x1f')](members[_0x4bcae0[_0xbd8e('0x18')]])){members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x20')]=utils['now']();members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x21')]=utils[_0xbd8e('0x22')](members[_0x4bcae0[_0xbd8e('0x18')]]['exitAt'],members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x23')]);if(members[_0x4bcae0[_0xbd8e('0x18')]][_0xbd8e('0x7')]){writeDB(members[_0x4bcae0[_0xbd8e('0x18')]]);}}break;default:break;}}catch(_0x27bf80){utils[_0xbd8e('0x11')](util[_0xbd8e('0x5')](_0xbd8e('0x17'),members[_0x4bcae0[_0xbd8e('0x18')]]?members[_0x4bcae0[_0xbd8e('0x18')]]['uniqueid']:_0x4bcae0[_0xbd8e('0x18')]),_0x27bf80);}};exports[_0xbd8e('0x24')]=function(_0x347892){try{if(!_[_0xbd8e('0x1f')](members[_0x347892['interface']])){utils['debug'](util[_0xbd8e('0x5')](_0xbd8e('0x25'),_0x347892[_0xbd8e('0x7')]),_0x347892);utils[_0xbd8e('0x4')](util[_0xbd8e('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x347892['uniqueid'],_0x347892[_0xbd8e('0x8')],_0x347892[_0xbd8e('0x26')]));members[_0x347892[_0xbd8e('0x8')]]=_[_0xbd8e('0x27')](members[_0x347892['interface']],{'data4':_0x347892[_0xbd8e('0x26')],'uniqueid':_0x347892[_0xbd8e('0x7')]});}}catch(_0x41de39){utils['error'](util[_0xbd8e('0x5')](_0xbd8e('0x25'),_0x347892[_0xbd8e('0x7')]),_0x41de39);}};exports['cdr']=function(_0x2d6055){try{utils[_0xbd8e('0x16')](util['format']('[%s][members][cdr]',_0x2d6055[_0xbd8e('0x7')]),_0x2d6055);if(_0x2d6055[_0xbd8e('0x28')]){var _0x12c74b=_0x2d6055[_0xbd8e('0x28')][_0xbd8e('0x29')]('-')[0x0];if(!_['isNil'](members[_0x12c74b])){members[_0x12c74b]=_[_0xbd8e('0x27')](members[_0x12c74b],{'data1':members[_0x12c74b][_0xbd8e('0x2a')]||_0x2d6055[_0xbd8e('0x2b')],'data2':members[_0x12c74b][_0xbd8e('0x2c')]||_0x2d6055[_0xbd8e('0x2d')],'data3':members[_0x12c74b][_0xbd8e('0x2e')]||_0x2d6055[_0xbd8e('0x2f')],'uniqueid':members[_0x12c74b]['uniqueid']||_0x2d6055[_0xbd8e('0x7')]});utils['info'](util[_0xbd8e('0x5')](_0xbd8e('0x30'),_0x2d6055[_0xbd8e('0x7')],members[_0x12c74b][_0xbd8e('0x2a')],members[_0x12c74b][_0xbd8e('0x2c')],members[_0x12c74b][_0xbd8e('0x2e')]));if(members[_0x12c74b][_0xbd8e('0x20')]){writeDB(members[_0x12c74b]);}}}if(_0x2d6055['destinationchannel']){var _0x33f95c=_0x2d6055[_0xbd8e('0x31')][_0xbd8e('0x29')]('-')[0x0];if(!_[_0xbd8e('0x1f')](members[_0x33f95c])){members[_0x33f95c]=_['assign'](members[_0x33f95c],{'data1':members[_0x33f95c][_0xbd8e('0x2a')]||_0x2d6055[_0xbd8e('0x2b')],'data2':members[_0x33f95c][_0xbd8e('0x2c')]||_0x2d6055['source'],'data3':members[_0x33f95c][_0xbd8e('0x2e')]||_0x2d6055['destination'],'uniqueid':members[_0x33f95c][_0xbd8e('0x7')]||_0x2d6055[_0xbd8e('0x7')]});utils['info'](util['format'](_0xbd8e('0x30'),_0x2d6055['uniqueid'],members[_0x33f95c][_0xbd8e('0x2a')],members[_0x33f95c][_0xbd8e('0x2c')],members[_0x33f95c][_0xbd8e('0x2e')]));if(members[_0x33f95c][_0xbd8e('0x20')]){writeDB(members[_0x33f95c]);}}}}catch(_0x20726a){utils[_0xbd8e('0x11')](util[_0xbd8e('0x5')](_0xbd8e('0x32'),_0x2d6055[_0xbd8e('0x7')]),_0x20726a);}};
\ No newline at end of file
+var _0x0c2b=['destinationchannel','source','lodash','util','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','getUserByInterface','then','internal','name','request','CreateMemberReport','catch','error','[%s][members][writeDB]','some','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','split','data1','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','data3'];(function(_0x39d89c,_0x4faa54){var _0x21ef83=function(_0x44270b){while(--_0x44270b){_0x39d89c['push'](_0x39d89c['shift']());}};_0x21ef83(++_0x4faa54);}(_0x0c2b,0x134));var _0xb0c2=function(_0x36db0f,_0x1500c9){_0x36db0f=_0x36db0f-0x0;var _0x4e8081=_0x0c2b[_0x36db0f];return _0x4e8081;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xb0c2('0x2')];function writeDB(_0x4e9482){utils[_0xb0c2('0x3')](util[_0xb0c2('0x4')](_0xb0c2('0x5'),_0x4e9482[_0xb0c2('0x6')],_0x4e9482[_0xb0c2('0x7')],_0x4e9482['channel'],_0x4e9482['data2'],_0x4e9482[_0xb0c2('0x8')],_0x4e9482[_0xb0c2('0x9')]));if(_0x4e9482[_0xb0c2('0x7')]){utils[_0xb0c2('0xa')](_0x4e9482[_0xb0c2('0x7')])[_0xb0c2('0xb')](function(_0x3064b7){if(_0x3064b7){_0x4e9482[_0xb0c2('0x8')]=_0x3064b7['name'];_0x4e9482[_0xb0c2('0xc')]=_0x3064b7[_0xb0c2('0xc')];utils['request']('CreateMemberReport',_0x4e9482);}else{utils['getUserByName'](_0x4e9482[_0xb0c2('0x7')]['split']('/')[0x1])[_0xb0c2('0xb')](function(_0xc1ed7b){if(_0xc1ed7b){_0x4e9482['membername']=_0xc1ed7b[_0xb0c2('0xd')];_0x4e9482[_0xb0c2('0xc')]=_0xc1ed7b[_0xb0c2('0xc')];utils[_0xb0c2('0xe')](_0xb0c2('0xf'),_0x4e9482);}});}})[_0xb0c2('0x10')](function(_0x31ecd8){utils[_0xb0c2('0x11')](util[_0xb0c2('0x4')](_0xb0c2('0x12'),_0x4e9482[_0xb0c2('0x6')]),_0x31ecd8);});}delete members[_0x4e9482['interface']];}function startsWith(_0x465efc,_0x15214f){return _[_0xb0c2('0x13')](_0x465efc,function(_0x5ccb2a){return _['startsWith'](_0x15214f,_0x5ccb2a);});}exports[_0xb0c2('0x14')]=function(_0x182dfb){try{utils['debug'](util['format'](_0xb0c2('0x15'),members[_0x182dfb[_0xb0c2('0x16')]]?members[_0x182dfb[_0xb0c2('0x16')]][_0xb0c2('0x6')]:_0x182dfb['device']),_0x182dfb);utils[_0xb0c2('0x3')](util[_0xb0c2('0x4')](_0xb0c2('0x17'),members[_0x182dfb[_0xb0c2('0x16')]]?members[_0x182dfb['device']][_0xb0c2('0x6')]:_0x182dfb[_0xb0c2('0x16')],_0x182dfb[_0xb0c2('0x18')],_0x182dfb['device']));switch(_0x182dfb[_0xb0c2('0x18')]){case'INUSE':case _0xb0c2('0x19'):if(!startsWith(exclude,_0x182dfb['device'])){members[_0x182dfb[_0xb0c2('0x16')]]={'channel':_0xb0c2('0x1a'),'interface':_0x182dfb[_0xb0c2('0x16')],'type':'TALKING','enterAt':utils[_0xb0c2('0x1b')](),'role':_0xb0c2('0x1c')};}break;case _0xb0c2('0x1d'):if(!_[_0xb0c2('0x1e')](members[_0x182dfb[_0xb0c2('0x16')]])){members[_0x182dfb[_0xb0c2('0x16')]]['exitAt']=utils[_0xb0c2('0x1b')]();members[_0x182dfb[_0xb0c2('0x16')]][_0xb0c2('0x1f')]=utils[_0xb0c2('0x20')](members[_0x182dfb[_0xb0c2('0x16')]][_0xb0c2('0x21')],members[_0x182dfb['device']][_0xb0c2('0x22')]);if(members[_0x182dfb[_0xb0c2('0x16')]]['uniqueid']){writeDB(members[_0x182dfb[_0xb0c2('0x16')]]);}}break;default:break;}}catch(_0x2d7c32){utils[_0xb0c2('0x11')](util[_0xb0c2('0x4')](_0xb0c2('0x15'),members[_0x182dfb[_0xb0c2('0x16')]]?members[_0x182dfb['device']][_0xb0c2('0x6')]:_0x182dfb[_0xb0c2('0x16')]),_0x2d7c32);}};exports['agentcomplete']=function(_0x24be01){try{if(!_[_0xb0c2('0x1e')](members[_0x24be01[_0xb0c2('0x7')]])){utils[_0xb0c2('0x23')](util[_0xb0c2('0x4')]('[%s][members][agentcomplete]',_0x24be01[_0xb0c2('0x6')]),_0x24be01);utils[_0xb0c2('0x3')](util['format'](_0xb0c2('0x24'),_0x24be01[_0xb0c2('0x6')],_0x24be01[_0xb0c2('0x7')],_0x24be01[_0xb0c2('0x25')]));members[_0x24be01[_0xb0c2('0x7')]]=_[_0xb0c2('0x26')](members[_0x24be01['interface']],{'data4':_0x24be01[_0xb0c2('0x25')],'uniqueid':_0x24be01[_0xb0c2('0x6')]});}}catch(_0x24a4e5){utils[_0xb0c2('0x11')](util[_0xb0c2('0x4')](_0xb0c2('0x27'),_0x24be01[_0xb0c2('0x6')]),_0x24a4e5);}};exports[_0xb0c2('0x28')]=function(_0x3f8d60){try{utils[_0xb0c2('0x23')](util['format'](_0xb0c2('0x29'),_0x3f8d60[_0xb0c2('0x6')]),_0x3f8d60);if(_0x3f8d60[_0xb0c2('0x2a')]){var _0x1f5cb4=_0x3f8d60['channel'][_0xb0c2('0x2b')]('-')[0x0];if(!_['isNil'](members[_0x1f5cb4])){members[_0x1f5cb4]=_[_0xb0c2('0x26')](members[_0x1f5cb4],{'data1':members[_0x1f5cb4][_0xb0c2('0x2c')]||_0x3f8d60[_0xb0c2('0x9')],'data2':members[_0x1f5cb4]['data2']||_0x3f8d60['source'],'data3':members[_0x1f5cb4]['data3']||_0x3f8d60[_0xb0c2('0x2d')],'uniqueid':members[_0x1f5cb4][_0xb0c2('0x6')]||_0x3f8d60[_0xb0c2('0x6')]});utils[_0xb0c2('0x3')](util[_0xb0c2('0x4')](_0xb0c2('0x2e'),_0x3f8d60[_0xb0c2('0x6')],members[_0x1f5cb4]['data1'],members[_0x1f5cb4][_0xb0c2('0x2f')],members[_0x1f5cb4][_0xb0c2('0x30')]));if(members[_0x1f5cb4][_0xb0c2('0x21')]){writeDB(members[_0x1f5cb4]);}}}if(_0x3f8d60['destinationchannel']){var _0xe28144=_0x3f8d60[_0xb0c2('0x31')]['split']('-')[0x0];if(!_[_0xb0c2('0x1e')](members[_0xe28144])){members[_0xe28144]=_[_0xb0c2('0x26')](members[_0xe28144],{'data1':members[_0xe28144][_0xb0c2('0x2c')]||_0x3f8d60[_0xb0c2('0x9')],'data2':members[_0xe28144]['data2']||_0x3f8d60[_0xb0c2('0x32')],'data3':members[_0xe28144][_0xb0c2('0x30')]||_0x3f8d60[_0xb0c2('0x2d')],'uniqueid':members[_0xe28144]['uniqueid']||_0x3f8d60[_0xb0c2('0x6')]});utils[_0xb0c2('0x3')](util[_0xb0c2('0x4')](_0xb0c2('0x2e'),_0x3f8d60[_0xb0c2('0x6')],members[_0xe28144][_0xb0c2('0x2c')],members[_0xe28144][_0xb0c2('0x2f')],members[_0xe28144][_0xb0c2('0x30')]));if(members[_0xe28144][_0xb0c2('0x21')]){writeDB(members[_0xe28144]);}}}}catch(_0x378c46){utils[_0xb0c2('0x11')](util['format'](_0xb0c2('0x29'),_0x3f8d60[_0xb0c2('0x6')]),_0x378c46);}};
\ No newline at end of file
index 7a42da8..bc11c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3c8=['ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridname','queuecallerjoinAt','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','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexit','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercomplete','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe3c8,0xe5));var _0x8e3c=function(_0x18d575,_0x1de4e5){_0x18d575=_0x18d575-0x0;var _0x1a84b5=_0xe3c8[_0x18d575];return _0x1a84b5;};'use strict';var _=require('lodash');var util=require(_0x8e3c('0x0'));var utils=require(_0x8e3c('0x1'));var queues={};function writeDB(_0x2b1c4c){utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x4'),_0x2b1c4c[_0x8e3c('0x5')],_0x2b1c4c[_0x8e3c('0x6')],_0x2b1c4c[_0x8e3c('0x7')],_0x2b1c4c['lastAssignedTo'],_0x2b1c4c[_0x8e3c('0x8')],_0x2b1c4c[_0x8e3c('0x9')],_0x2b1c4c[_0x8e3c('0xa')]));if(_0x2b1c4c[_0x8e3c('0x7')]){utils[_0x8e3c('0xb')](_0x2b1c4c[_0x8e3c('0x7')])[_0x8e3c('0xc')](function(_0x522014){if(_0x522014){_0x2b1c4c[_0x8e3c('0xd')]=_0x522014[_0x8e3c('0xd')];}utils[_0x8e3c('0xe')]('CreateVoiceQueueReport',_0x2b1c4c);});}else{utils[_0x8e3c('0xe')]('CreateVoiceQueueReport',_0x2b1c4c);}if(_0x2b1c4c[_0x8e3c('0xf')]){delete queues[_0x2b1c4c[_0x8e3c('0xf')]];}else{delete queues[_0x2b1c4c['uniqueid']];}}exports['queuecallerjoin']=function(_0x19a85c){try{utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x11'),_0x19a85c[_0x8e3c('0x5')]),_0x19a85c);utils['info'](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x19a85c['uniqueid'],_0x19a85c[_0x8e3c('0x7')],_0x19a85c[_0x8e3c('0x12')]));queues[_0x19a85c[_0x8e3c('0x5')]]=_[_0x8e3c('0x13')](_0x19a85c,{'originalposition':_0x19a85c[_0x8e3c('0x12')],'queuecallerjoinAt':utils[_0x8e3c('0x14')](),'mohtime':0x0});}catch(_0x23d8a9){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')]('[%s][queues][queuecallerjoin]',_0x19a85c[_0x8e3c('0x5')]),_0x23d8a9);}};exports[_0x8e3c('0x16')]=function(_0x35ae48){try{if(!_[_0x8e3c('0x17')](queues[_0x35ae48[_0x8e3c('0x5')]])){utils['debug'](util[_0x8e3c('0x3')](_0x8e3c('0x18'),_0x35ae48[_0x8e3c('0x5')]),_0x35ae48);if(queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0x19')]){if(!queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0x1a')]&&!queues[_0x35ae48[_0x8e3c('0x5')]]['queuecallerexit']){queues[_0x35ae48[_0x8e3c('0x5')]]['queuecallercomplete']=!![];queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0x1b')]=utils[_0x8e3c('0x14')]();queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0xa')]=_0x8e3c('0x1c');}utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x1d'),_0x35ae48['uniqueid'],queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0x1e')],queues[_0x35ae48['uniqueid']][_0x8e3c('0xa')]));writeDB(queues[_0x35ae48[_0x8e3c('0x5')]]);}else if(queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0xf')]){utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x1f'),_0x35ae48['uniqueid'],queues[_0x35ae48['uniqueid']][_0x8e3c('0x1e')],queues[_0x35ae48['uniqueid']][_0x8e3c('0xf')]));queues[queues[_0x35ae48[_0x8e3c('0x5')]][_0x8e3c('0xf')]]=queues[_0x35ae48['uniqueid']];queues[queues[_0x35ae48['uniqueid']][_0x8e3c('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x35ae48[_0x8e3c('0x5')]];}}}catch(_0x59fee3){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')](_0x8e3c('0x18'),_0x35ae48[_0x8e3c('0x5')]),_0x59fee3);}};exports[_0x8e3c('0x20')]=function(_0x43f87d){try{utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x21'),_0x43f87d[_0x8e3c('0x5')]),_0x43f87d);if(!_['isNil'](_0x43f87d[_0x8e3c('0x22')][_0x8e3c('0x23')])&&_0x43f87d[_0x8e3c('0x24')][_0x8e3c('0x25')]()!==_0x8e3c('0x26')){if(!_[_0x8e3c('0x17')](queues[_0x43f87d[_0x8e3c('0x5')]])){queues[_0x43f87d[_0x8e3c('0x5')]]['queuecallerabandon']=![];queues[_0x43f87d['uniqueid']][_0x8e3c('0x27')]=null;queues[_0x43f87d[_0x8e3c('0x5')]]['queuecallerexit']=!![];queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0x28')]=utils[_0x8e3c('0x14')]();queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0xa')]=_0x43f87d[_0x8e3c('0x24')][_0x8e3c('0x25')]();utils['info'](util[_0x8e3c('0x3')](_0x8e3c('0x29'),_0x43f87d[_0x8e3c('0x5')],queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0x1e')],_0x43f87d[_0x8e3c('0x24')],queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0xa')]));writeDB(queues[_0x43f87d[_0x8e3c('0x5')]]);}}else if(!_[_0x8e3c('0x17')](_0x43f87d[_0x8e3c('0x22')][_0x8e3c('0x2a')])){if(!_[_0x8e3c('0x17')](queues[_0x43f87d[_0x8e3c('0x5')]])&&!queues[_0x43f87d[_0x8e3c('0x5')]]['queuecallerabandon']){queues[_0x43f87d['uniqueid']][_0x8e3c('0x1a')]=![];queues[_0x43f87d['uniqueid']][_0x8e3c('0x27')]=null;queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0x2b')]=!![];queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0x28')]=utils[_0x8e3c('0x14')]();queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0xa')]='EXITWITHKEY';utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x43f87d[_0x8e3c('0x5')],queues[_0x43f87d['uniqueid']][_0x8e3c('0x1e')],_0x43f87d[_0x8e3c('0x24')],queues[_0x43f87d[_0x8e3c('0x5')]][_0x8e3c('0xa')]));}}}catch(_0x2f8433){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')]('[%s][queues][varset]',_0x43f87d['uniqueid']),_0x2f8433);}};exports[_0x8e3c('0x1a')]=function(_0x2a9e78){try{if(!_[_0x8e3c('0x17')](queues[_0x2a9e78[_0x8e3c('0x5')]])){utils[_0x8e3c('0x10')](util['format'](_0x8e3c('0x2c'),_0x2a9e78[_0x8e3c('0x5')]),_0x2a9e78);queues[_0x2a9e78[_0x8e3c('0x5')]]['queuecallerexit']=![];queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0x28')]=null;queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0x1a')]=!![];queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0x27')]=utils[_0x8e3c('0x14')]();queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0xa')]=_0x8e3c('0x2d');utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x2e'),_0x2a9e78[_0x8e3c('0x5')],queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0x1e')],queues[_0x2a9e78[_0x8e3c('0x5')]][_0x8e3c('0xa')]));}}catch(_0x1092c1){utils['error'](util[_0x8e3c('0x3')](_0x8e3c('0x2c'),_0x2a9e78[_0x8e3c('0x5')]),_0x1092c1);}};exports[_0x8e3c('0x2f')]=function(_0x791f60){try{if(!_[_0x8e3c('0x17')](queues[_0x791f60[_0x8e3c('0x5')]])){utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x30'),_0x791f60[_0x8e3c('0x5')]),_0x791f60);utils[_0x8e3c('0x2')](util['format'](_0x8e3c('0x31'),_0x791f60[_0x8e3c('0x5')],queues[_0x791f60[_0x8e3c('0x5')]]['name'],_0x791f60[_0x8e3c('0x32')],_0x791f60['connectedlinename']));queues[_0x791f60[_0x8e3c('0x5')]][_0x8e3c('0x2f')]=!![];queues[_0x791f60[_0x8e3c('0x5')]][_0x8e3c('0x19')]=utils[_0x8e3c('0x14')]();queues[_0x791f60[_0x8e3c('0x5')]][_0x8e3c('0x33')]=utils[_0x8e3c('0x34')](queues[_0x791f60[_0x8e3c('0x5')]][_0x8e3c('0x19')],queues[_0x791f60[_0x8e3c('0x5')]]['queuecallerjoinAt']);queues[_0x791f60[_0x8e3c('0x5')]]['position']=_0x791f60[_0x8e3c('0x12')];queues[_0x791f60[_0x8e3c('0x5')]][_0x8e3c('0x35')]=_0x791f60['count'];queues[_0x791f60['uniqueid']][_0x8e3c('0x32')]=_0x791f60[_0x8e3c('0x32')];queues[_0x791f60[_0x8e3c('0x5')]]['connectedlinename']=_0x791f60[_0x8e3c('0x36')];}}catch(_0x4f130e){utils[_0x8e3c('0x15')](util['format'](_0x8e3c('0x30'),_0x791f60[_0x8e3c('0x5')]),_0x4f130e);}};exports[_0x8e3c('0x37')]=function(_0x118b4a){try{if(!_[_0x8e3c('0x17')](queues[_0x118b4a[_0x8e3c('0x5')]])){utils['debug'](util[_0x8e3c('0x3')](_0x8e3c('0x38'),_0x118b4a[_0x8e3c('0x5')]),_0x118b4a);utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x39'),_0x118b4a[_0x8e3c('0x5')],queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x1e')],_0x118b4a[_0x8e3c('0x3a')],_0x118b4a['destaccountcode']));queues[_0x118b4a['uniqueid']][_0x8e3c('0x1a')]=![];queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x1a')]=![];queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x27')]=null;queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x2b')]=![];queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0xa')]=null;queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x28')]=null;queues[_0x118b4a['uniqueid']]['assigned']=!![];queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x9')]=_0x118b4a[_0x8e3c('0x3b')];queues[_0x118b4a[_0x8e3c('0x5')]][_0x8e3c('0x3c')]=_0x118b4a[_0x8e3c('0x3a')];}}catch(_0x30fd85){utils[_0x8e3c('0x15')](util['format'](_0x8e3c('0x38'),_0x118b4a[_0x8e3c('0x5')]),_0x30fd85);}};exports[_0x8e3c('0x3d')]=function(_0x15b5ea){try{if(!_['isNil'](queues[_0x15b5ea[_0x8e3c('0x5')]])){if(queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x19')]){utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x3e'),_0x15b5ea['uniqueid']),_0x15b5ea);queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x1a')]=![];queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x1a')]=![];queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x27')]=null;queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x2b')]=![];queues[_0x15b5ea['uniqueid']][_0x8e3c('0x28')]=null;queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x3f')]=!![];queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x3c')]=_0x15b5ea[_0x8e3c('0x3a')];queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x40')]=!![];queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x1b')]=utils[_0x8e3c('0x14')]();if(_0x15b5ea[_0x8e3c('0x41')]==_0x8e3c('0x42')){if(!queues[_0x15b5ea[_0x8e3c('0x5')]]['transfer']){queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0xa')]='TRANSFER';}}else{queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0xa')]='COMPLETEDBY'+_0x15b5ea[_0x8e3c('0x41')][_0x8e3c('0x25')]();}utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x43'),_0x15b5ea[_0x8e3c('0x5')],queues[_0x15b5ea[_0x8e3c('0x5')]][_0x8e3c('0x1e')],_0x15b5ea[_0x8e3c('0x3a')],queues[_0x15b5ea[_0x8e3c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x15b5ea[_0x8e3c('0x5')]]);}}}catch(_0x538c2c){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')](_0x8e3c('0x3e'),_0x15b5ea[_0x8e3c('0x5')]),_0x538c2c);}};exports['blindtransfer']=function(_0xbcf057){try{if(!_[_0x8e3c('0x17')](queues[_0xbcf057[_0x8e3c('0x44')]])){utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')]('[%s][queues][blindtransfer]',_0xbcf057[_0x8e3c('0x5')]),_0xbcf057);queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0x42')]=!![];queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0x45')]='BLIND';queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0x46')]=_0xbcf057['extension'];queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0x47')]=_0xbcf057[_0x8e3c('0x44')];queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0xa')]=_0x8e3c('0x48');utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x49'),_0xbcf057[_0x8e3c('0x5')],queues[_0xbcf057[_0x8e3c('0x44')]][_0x8e3c('0x1e')],_0xbcf057[_0x8e3c('0x44')],_0xbcf057[_0x8e3c('0x4a')]));}}catch(_0x1b4b6){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')](_0x8e3c('0x4b'),_0xbcf057['uniqueid']),_0x1b4b6);}};exports[_0x8e3c('0x4c')]=function(_0x57456d){try{utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x4d'),_0x57456d['origtransfereruniqueid']),_0x57456d);if(_0x57456d[_0x8e3c('0x4e')]==_0x57456d[_0x8e3c('0x4f')]){if(!_[_0x8e3c('0x17')](queues[_0x57456d['secondtransfererlinkedid']])){utils['info'](util[_0x8e3c('0x3')](_0x8e3c('0x50'),_0x57456d['origtransfereruniqueid'],queues[_0x57456d['secondtransfererlinkedid']][_0x8e3c('0x1e')],_0x57456d[_0x8e3c('0x51')]));queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0x42')]=!![];queues[_0x57456d[_0x8e3c('0x52')]]['transfertype']=_0x8e3c('0x53');queues[_0x57456d['secondtransfererlinkedid']]['transferexten']=_0x57456d['origtransfererexten'];queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0x47')]=_0x57456d['origtransfereruniqueid'];queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x8e3c('0x17')](queues[_0x57456d[_0x8e3c('0x4f')]])){if(_0x57456d[_0x8e3c('0x54')]&&queues[_0x57456d['transfereelinkedid']]){queues[_0x57456d[_0x8e3c('0x54')]]['queuecallerenterreason']=0x1;queues[_0x57456d[_0x8e3c('0x44')]]=_[_0x8e3c('0x55')](queues[_0x57456d[_0x8e3c('0x54')]]);queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0xf')]=_0x57456d[_0x8e3c('0x56')];queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x57')]=0x2;queues[_0x57456d['transfereeuniqueid']][_0x8e3c('0x8')]=queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0x8')];queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x58')]=queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0x58')];queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x59')]=utils['now']();queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x19')]=utils[_0x8e3c('0x14')]();queues[_0x57456d['transfereeuniqueid']][_0x8e3c('0x33')]=0x0;queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x5a')]=0x0;utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x5b'),_0x57456d[_0x8e3c('0x4e')],queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x1e')],queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x8')],queues[_0x57456d[_0x8e3c('0x44')]][_0x8e3c('0x58')]));}else{utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')](_0x8e3c('0x5c'),_0x57456d[_0x8e3c('0x4e')],queues[_0x57456d[_0x8e3c('0x4f')]][_0x8e3c('0x1e')],_0x57456d[_0x8e3c('0x52')]));queues[_0x57456d[_0x8e3c('0x4f')]][_0x8e3c('0xf')]=_0x57456d['secondtransfererlinkedid'];}}}else if(_0x57456d['secondtransfereruniqueid']==_0x57456d[_0x8e3c('0x52')]){if(!_[_0x8e3c('0x17')](queues[_0x57456d[_0x8e3c('0x4f')]])){utils[_0x8e3c('0x2')](util['format'](_0x8e3c('0x5d'),_0x57456d[_0x8e3c('0x4e')],queues[_0x57456d[_0x8e3c('0x4f')]][_0x8e3c('0x1e')],_0x57456d[_0x8e3c('0x5e')],_0x57456d[_0x8e3c('0x5f')]));queues[_0x57456d[_0x8e3c('0x4f')]][_0x8e3c('0x42')]=!![];queues[_0x57456d[_0x8e3c('0x4f')]][_0x8e3c('0x45')]=_0x8e3c('0x53');queues[_0x57456d['origtransfererlinkedid']][_0x8e3c('0x46')]=_0x57456d[_0x8e3c('0x5f')];queues[_0x57456d[_0x8e3c('0x4f')]]['transferuniqueid']=_0x57456d['secondtransfereruniqueid'];queues[_0x57456d['origtransfererlinkedid']][_0x8e3c('0xa')]=_0x8e3c('0x60');}if(!_[_0x8e3c('0x17')](queues[_0x57456d[_0x8e3c('0x52')]])){if(_0x57456d[_0x8e3c('0x61')]&&queues[_0x57456d['transfertargetlinkedid']]){queues[_0x57456d[_0x8e3c('0x61')]][_0x8e3c('0x57')]=0x1;queues[_0x57456d[_0x8e3c('0x56')]]=_[_0x8e3c('0x55')](queues[_0x57456d['transfertargetlinkedid']]);queues[_0x57456d['transfertargetuniqueid']][_0x8e3c('0xf')]=_0x57456d['transfertargetuniqueid'];queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x57')]=0x2;queues[_0x57456d['transfertargetuniqueid']]['calleridnum']=queues[_0x57456d[_0x8e3c('0x4f')]]['calleridnum'];queues[_0x57456d[_0x8e3c('0x56')]]['calleridname']=queues[_0x57456d['origtransfererlinkedid']][_0x8e3c('0x58')];queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x59')]=utils[_0x8e3c('0x14')]();queues[_0x57456d['transfertargetuniqueid']][_0x8e3c('0x19')]=utils[_0x8e3c('0x14')]();queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x33')]=0x0;queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x5a')]=0x0;utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x57456d[_0x8e3c('0x4e')],queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x1e')],queues[_0x57456d['transfertargetuniqueid']][_0x8e3c('0xf')],queues[_0x57456d[_0x8e3c('0x56')]]['calleridnum'],queues[_0x57456d[_0x8e3c('0x56')]][_0x8e3c('0x58')]));}else{utils[_0x8e3c('0x2')](util[_0x8e3c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x57456d[_0x8e3c('0x4e')],queues[_0x57456d[_0x8e3c('0x52')]][_0x8e3c('0x1e')],_0x57456d[_0x8e3c('0x4f')]));queues[_0x57456d['secondtransfererlinkedid']][_0x8e3c('0xf')]=_0x57456d['origtransfererlinkedid'];}}}}catch(_0x19fd8b){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')]('[%s][queues][attendedtransfer]',_0x57456d[_0x8e3c('0x4e')]),_0x19fd8b);}};exports['musiconholdstart']=function(_0x254a4b){try{if(!_[_0x8e3c('0x17')](queues[_0x254a4b['uniqueid']])){utils[_0x8e3c('0x10')](util['format'](_0x8e3c('0x62'),_0x254a4b['uniqueid']),_0x254a4b);queues[_0x254a4b[_0x8e3c('0x5')]][_0x8e3c('0x63')]=utils[_0x8e3c('0x14')]();utils[_0x8e3c('0x2')](util['format'](_0x8e3c('0x64'),_0x254a4b[_0x8e3c('0x5')],queues[_0x254a4b[_0x8e3c('0x5')]][_0x8e3c('0x1e')],queues[_0x254a4b['uniqueid']][_0x8e3c('0x63')]));}}catch(_0x2b37e2){utils[_0x8e3c('0x15')](util[_0x8e3c('0x3')](_0x8e3c('0x62'),_0x254a4b[_0x8e3c('0x5')]),_0x2b37e2);}};exports[_0x8e3c('0x65')]=function(_0x250f95){try{if(!_['isNil'](queues[_0x250f95[_0x8e3c('0x5')]])){if(!_['isNil'](queues[_0x250f95['uniqueid']][_0x8e3c('0x63')])){utils[_0x8e3c('0x10')](util[_0x8e3c('0x3')](_0x8e3c('0x66'),_0x250f95[_0x8e3c('0x5')]),_0x250f95);queues[_0x250f95[_0x8e3c('0x5')]][_0x8e3c('0x5a')]+=utils[_0x8e3c('0x34')](utils[_0x8e3c('0x14')](),queues[_0x250f95[_0x8e3c('0x5')]][_0x8e3c('0x63')]);utils[_0x8e3c('0x2')](util['format'](_0x8e3c('0x67'),_0x250f95[_0x8e3c('0x5')],queues[_0x250f95[_0x8e3c('0x5')]][_0x8e3c('0x1e')],queues[_0x250f95[_0x8e3c('0x5')]]['mohtime']));delete queues[_0x250f95[_0x8e3c('0x5')]][_0x8e3c('0x63')];}}}catch(_0x21534d){utils['error'](util[_0x8e3c('0x3')](_0x8e3c('0x66'),_0x250f95['uniqueid']),_0x21534d);}};
\ No newline at end of file
+var _0xb923=['queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','queuecallerleave','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','diffTime','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb923,0x1e5));var _0x3b92=function(_0x3b8e8d,_0x30de7f){_0x3b8e8d=_0x3b8e8d-0x0;var _0x12eddc=_0xb923[_0x3b8e8d];return _0x12eddc;};'use strict';var _=require('lodash');var util=require(_0x3b92('0x0'));var utils=require(_0x3b92('0x1'));var queues={};function writeDB(_0x5f425c){utils['info'](util['format'](_0x3b92('0x2'),_0x5f425c[_0x3b92('0x3')],_0x5f425c[_0x3b92('0x4')],_0x5f425c['queue'],_0x5f425c[_0x3b92('0x5')],_0x5f425c[_0x3b92('0x6')],_0x5f425c['accountcode'],_0x5f425c[_0x3b92('0x7')]));if(_0x5f425c[_0x3b92('0x8')]){utils[_0x3b92('0x9')](_0x5f425c[_0x3b92('0x8')])[_0x3b92('0xa')](function(_0x189109){if(_0x189109){_0x5f425c[_0x3b92('0xb')]=_0x189109[_0x3b92('0xb')];}utils[_0x3b92('0xc')](_0x3b92('0xd'),_0x5f425c);});}else{utils[_0x3b92('0xc')]('CreateVoiceQueueReport',_0x5f425c);}if(_0x5f425c[_0x3b92('0xe')]){delete queues[_0x5f425c[_0x3b92('0xe')]];}else{delete queues[_0x5f425c['uniqueid']];}}exports[_0x3b92('0xf')]=function(_0x83c7c4){try{utils[_0x3b92('0x10')](util[_0x3b92('0x11')]('[%s][queues][queuecallerjoin]',_0x83c7c4[_0x3b92('0x3')]),_0x83c7c4);utils[_0x3b92('0x12')](util['format'](_0x3b92('0x13'),_0x83c7c4['uniqueid'],_0x83c7c4[_0x3b92('0x8')],_0x83c7c4[_0x3b92('0x14')]));queues[_0x83c7c4['uniqueid']]=_['assign'](_0x83c7c4,{'originalposition':_0x83c7c4[_0x3b92('0x14')],'queuecallerjoinAt':utils[_0x3b92('0x15')](),'mohtime':0x0});}catch(_0x55962f){utils['error'](util[_0x3b92('0x11')](_0x3b92('0x16'),_0x83c7c4[_0x3b92('0x3')]),_0x55962f);}};exports[_0x3b92('0x17')]=function(_0xfc2387){try{if(!_['isNil'](queues[_0xfc2387[_0x3b92('0x3')]])){utils[_0x3b92('0x10')](util[_0x3b92('0x11')](_0x3b92('0x18'),_0xfc2387['uniqueid']),_0xfc2387);if(queues[_0xfc2387[_0x3b92('0x3')]][_0x3b92('0x19')]){if(!queues[_0xfc2387['uniqueid']][_0x3b92('0x1a')]&&!queues[_0xfc2387[_0x3b92('0x3')]]['queuecallerexit']){queues[_0xfc2387[_0x3b92('0x3')]][_0x3b92('0x1b')]=!![];queues[_0xfc2387[_0x3b92('0x3')]]['queuecallercompleteAt']=utils[_0x3b92('0x15')]();queues[_0xfc2387['uniqueid']][_0x3b92('0x7')]=_0x3b92('0x1c');}utils[_0x3b92('0x12')](util[_0x3b92('0x11')](_0x3b92('0x1d'),_0xfc2387[_0x3b92('0x3')],queues[_0xfc2387[_0x3b92('0x3')]]['name'],queues[_0xfc2387['uniqueid']][_0x3b92('0x7')]));writeDB(queues[_0xfc2387[_0x3b92('0x3')]]);}else if(queues[_0xfc2387['uniqueid']]['transfereduniqueid']){utils[_0x3b92('0x12')](util[_0x3b92('0x11')](_0x3b92('0x1e'),_0xfc2387[_0x3b92('0x3')],queues[_0xfc2387[_0x3b92('0x3')]][_0x3b92('0x1f')],queues[_0xfc2387['uniqueid']][_0x3b92('0xe')]));queues[queues[_0xfc2387[_0x3b92('0x3')]]['transfereduniqueid']]=queues[_0xfc2387[_0x3b92('0x3')]];queues[queues[_0xfc2387[_0x3b92('0x3')]][_0x3b92('0xe')]][_0x3b92('0x20')]=0x2;delete queues[_0xfc2387[_0x3b92('0x3')]];}}}catch(_0x2edf70){utils['error'](util[_0x3b92('0x11')](_0x3b92('0x18'),_0xfc2387[_0x3b92('0x3')]),_0x2edf70);}};exports[_0x3b92('0x21')]=function(_0x129162){try{utils['debug'](util['format'](_0x3b92('0x22'),_0x129162[_0x3b92('0x3')]),_0x129162);if(!_[_0x3b92('0x23')](_0x129162[_0x3b92('0x24')][_0x3b92('0x25')])&&_0x129162[_0x3b92('0x26')][_0x3b92('0x27')]()!==_0x3b92('0x28')){if(!_[_0x3b92('0x23')](queues[_0x129162[_0x3b92('0x3')]])){queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x1a')]=![];queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x29')]=null;queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x2a')]=!![];queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x2b')]=utils[_0x3b92('0x15')]();queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x7')]=_0x129162[_0x3b92('0x26')][_0x3b92('0x27')]();utils['info'](util[_0x3b92('0x11')](_0x3b92('0x2c'),_0x129162[_0x3b92('0x3')],queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x1f')],_0x129162[_0x3b92('0x26')],queues[_0x129162[_0x3b92('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x129162['uniqueid']]);}}else if(!_[_0x3b92('0x23')](_0x129162[_0x3b92('0x24')][_0x3b92('0x2d')])){if(!_[_0x3b92('0x23')](queues[_0x129162['uniqueid']])&&!queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x1a')]){queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x1a')]=![];queues[_0x129162['uniqueid']][_0x3b92('0x29')]=null;queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x2a')]=!![];queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x2b')]=utils['now']();queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x7')]=_0x3b92('0x2e');utils['info'](util[_0x3b92('0x11')](_0x3b92('0x2f'),_0x129162[_0x3b92('0x3')],queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x1f')],_0x129162[_0x3b92('0x26')],queues[_0x129162[_0x3b92('0x3')]][_0x3b92('0x7')]));}}}catch(_0x5e83a5){utils['error'](util[_0x3b92('0x11')](_0x3b92('0x22'),_0x129162[_0x3b92('0x3')]),_0x5e83a5);}};exports[_0x3b92('0x1a')]=function(_0x7ac62a){try{if(!_[_0x3b92('0x23')](queues[_0x7ac62a['uniqueid']])){utils[_0x3b92('0x10')](util[_0x3b92('0x11')](_0x3b92('0x30'),_0x7ac62a[_0x3b92('0x3')]),_0x7ac62a);queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x2a')]=![];queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x2b')]=null;queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x1a')]=!![];queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x29')]=utils[_0x3b92('0x15')]();queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x7')]=_0x3b92('0x31');utils['info'](util[_0x3b92('0x11')](_0x3b92('0x32'),_0x7ac62a[_0x3b92('0x3')],queues[_0x7ac62a[_0x3b92('0x3')]]['name'],queues[_0x7ac62a[_0x3b92('0x3')]][_0x3b92('0x7')]));}}catch(_0x466587){utils[_0x3b92('0x33')](util[_0x3b92('0x11')](_0x3b92('0x30'),_0x7ac62a[_0x3b92('0x3')]),_0x466587);}};exports[_0x3b92('0x34')]=function(_0x15eefe){try{if(!_[_0x3b92('0x23')](queues[_0x15eefe[_0x3b92('0x3')]])){utils[_0x3b92('0x10')](util[_0x3b92('0x11')]('[%s][queues][queuecallerleave]',_0x15eefe[_0x3b92('0x3')]),_0x15eefe);utils[_0x3b92('0x12')](util[_0x3b92('0x11')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x15eefe[_0x3b92('0x3')],queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x1f')],_0x15eefe[_0x3b92('0x35')],_0x15eefe[_0x3b92('0x36')]));queues[_0x15eefe[_0x3b92('0x3')]]['queuecallerleave']=!![];queues[_0x15eefe['uniqueid']][_0x3b92('0x19')]=utils['now']();queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x37')]=utils['diffTime'](queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x19')],queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x38')]);queues[_0x15eefe[_0x3b92('0x3')]]['position']=_0x15eefe['position'];queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x39')]=_0x15eefe[_0x3b92('0x39')];queues[_0x15eefe['uniqueid']]['connectedlinenum']=_0x15eefe['connectedlinenum'];queues[_0x15eefe[_0x3b92('0x3')]][_0x3b92('0x36')]=_0x15eefe[_0x3b92('0x36')];}}catch(_0x4f3732){utils[_0x3b92('0x33')](util[_0x3b92('0x11')](_0x3b92('0x3a'),_0x15eefe['uniqueid']),_0x4f3732);}};exports[_0x3b92('0x3b')]=function(_0x52db56){try{if(!_[_0x3b92('0x23')](queues[_0x52db56[_0x3b92('0x3')]])){utils['debug'](util[_0x3b92('0x11')](_0x3b92('0x3c'),_0x52db56[_0x3b92('0x3')]),_0x52db56);utils[_0x3b92('0x12')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x52db56[_0x3b92('0x3')],queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x1f')],_0x52db56['membername'],_0x52db56['destaccountcode']));queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x1a')]=![];queues[_0x52db56['uniqueid']]['queuecallerabandon']=![];queues[_0x52db56['uniqueid']][_0x3b92('0x29')]=null;queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x2a')]=![];queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x7')]=null;queues[_0x52db56['uniqueid']][_0x3b92('0x2b')]=null;queues[_0x52db56['uniqueid']][_0x3b92('0x3d')]=!![];queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x3e')]=_0x52db56['destaccountcode'];queues[_0x52db56[_0x3b92('0x3')]][_0x3b92('0x5')]=_0x52db56[_0x3b92('0x3f')];}}catch(_0x1b89c2){utils[_0x3b92('0x33')](util[_0x3b92('0x11')](_0x3b92('0x3c'),_0x52db56['uniqueid']),_0x1b89c2);}};exports[_0x3b92('0x40')]=function(_0x3a15e9){try{if(!_[_0x3b92('0x23')](queues[_0x3a15e9['uniqueid']])){if(queues[_0x3a15e9[_0x3b92('0x3')]]['queuecallerleaveAt']){utils['debug'](util[_0x3b92('0x11')](_0x3b92('0x41'),_0x3a15e9['uniqueid']),_0x3a15e9);queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x1a')]=![];queues[_0x3a15e9['uniqueid']]['queuecallerabandon']=![];queues[_0x3a15e9[_0x3b92('0x3')]]['queuecallerabandonAt']=null;queues[_0x3a15e9['uniqueid']][_0x3b92('0x2a')]=![];queues[_0x3a15e9['uniqueid']][_0x3b92('0x2b')]=null;queues[_0x3a15e9[_0x3b92('0x3')]]['assigned']=!![];queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x5')]=_0x3a15e9[_0x3b92('0x3f')];queues[_0x3a15e9['uniqueid']][_0x3b92('0x1b')]=!![];queues[_0x3a15e9['uniqueid']]['queuecallercompleteAt']=utils[_0x3b92('0x15')]();if(_0x3a15e9[_0x3b92('0x42')]==_0x3b92('0x43')){if(!queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x43')]){queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x7')]=_0x3b92('0x44');}}else{queues[_0x3a15e9[_0x3b92('0x3')]]['queuecallerexitreason']=_0x3b92('0x45')+_0x3a15e9[_0x3b92('0x42')][_0x3b92('0x27')]();}utils['info'](util[_0x3b92('0x11')](_0x3b92('0x46'),_0x3a15e9[_0x3b92('0x3')],queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x1f')],_0x3a15e9['membername'],queues[_0x3a15e9[_0x3b92('0x3')]][_0x3b92('0x7')]));writeDB(queues[_0x3a15e9[_0x3b92('0x3')]]);}}}catch(_0x26fd70){utils['error'](util[_0x3b92('0x11')](_0x3b92('0x41'),_0x3a15e9[_0x3b92('0x3')]),_0x26fd70);}};exports['blindtransfer']=function(_0x1b129f){try{if(!_[_0x3b92('0x23')](queues[_0x1b129f['transfereeuniqueid']])){utils[_0x3b92('0x10')](util[_0x3b92('0x11')](_0x3b92('0x47'),_0x1b129f[_0x3b92('0x3')]),_0x1b129f);queues[_0x1b129f[_0x3b92('0x48')]][_0x3b92('0x43')]=!![];queues[_0x1b129f[_0x3b92('0x48')]][_0x3b92('0x49')]=_0x3b92('0x4a');queues[_0x1b129f[_0x3b92('0x48')]]['transferexten']=_0x1b129f[_0x3b92('0x4b')];queues[_0x1b129f[_0x3b92('0x48')]][_0x3b92('0x4c')]=_0x1b129f[_0x3b92('0x48')];queues[_0x1b129f[_0x3b92('0x48')]]['queuecallerexitreason']=_0x3b92('0x4d');utils['info'](util[_0x3b92('0x11')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1b129f[_0x3b92('0x3')],queues[_0x1b129f[_0x3b92('0x48')]]['name'],_0x1b129f[_0x3b92('0x48')],_0x1b129f['extension']));}}catch(_0xa63d18){utils[_0x3b92('0x33')](util[_0x3b92('0x11')](_0x3b92('0x47'),_0x1b129f[_0x3b92('0x3')]),_0xa63d18);}};exports[_0x3b92('0x4e')]=function(_0x424870){try{utils[_0x3b92('0x10')](util[_0x3b92('0x11')]('[%s][queues][attendedtransfer]',_0x424870['origtransfereruniqueid']),_0x424870);if(_0x424870[_0x3b92('0x4f')]==_0x424870['origtransfererlinkedid']){if(!_[_0x3b92('0x23')](queues[_0x424870['secondtransfererlinkedid']])){utils[_0x3b92('0x12')](util[_0x3b92('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x424870[_0x3b92('0x4f')],queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0x1f')],_0x424870[_0x3b92('0x51')]));queues[_0x424870[_0x3b92('0x50')]]['transfer']=!![];queues[_0x424870[_0x3b92('0x50')]]['transfertype']=_0x3b92('0x52');queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0x53')]=_0x424870[_0x3b92('0x51')];queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0x4c')]=_0x424870[_0x3b92('0x4f')];queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0x7')]=_0x3b92('0x54');}if(!_[_0x3b92('0x23')](queues[_0x424870[_0x3b92('0x55')]])){if(_0x424870[_0x3b92('0x56')]&&queues[_0x424870[_0x3b92('0x56')]]){queues[_0x424870[_0x3b92('0x56')]][_0x3b92('0x20')]=0x1;queues[_0x424870['transfereeuniqueid']]=_[_0x3b92('0x57')](queues[_0x424870[_0x3b92('0x56')]]);queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0xe')]=_0x424870['transfertargetuniqueid'];queues[_0x424870['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x424870['transfereeuniqueid']][_0x3b92('0x6')]=queues[_0x424870['secondtransfererlinkedid']][_0x3b92('0x6')];queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0x58')]=queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0x58')];queues[_0x424870[_0x3b92('0x48')]]['queuecallerjoinAt']=utils[_0x3b92('0x15')]();queues[_0x424870['transfereeuniqueid']][_0x3b92('0x19')]=utils[_0x3b92('0x15')]();queues[_0x424870[_0x3b92('0x48')]]['holdtime']=0x0;queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0x59')]=0x0;utils['info'](util[_0x3b92('0x11')](_0x3b92('0x5a'),_0x424870['origtransfereruniqueid'],queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0x1f')],queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0x6')],queues[_0x424870[_0x3b92('0x48')]][_0x3b92('0x58')]));}else{utils[_0x3b92('0x12')](util[_0x3b92('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x424870[_0x3b92('0x4f')],queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x1f')],_0x424870['secondtransfererlinkedid']));queues[_0x424870[_0x3b92('0x55')]]['transfereduniqueid']=_0x424870[_0x3b92('0x50')];}}}else if(_0x424870[_0x3b92('0x5b')]==_0x424870[_0x3b92('0x50')]){if(!_[_0x3b92('0x23')](queues[_0x424870[_0x3b92('0x55')]])){utils[_0x3b92('0x12')](util[_0x3b92('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x424870[_0x3b92('0x4f')],queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x1f')],_0x424870[_0x3b92('0x5b')],_0x424870[_0x3b92('0x5c')]));queues[_0x424870['origtransfererlinkedid']]['transfer']=!![];queues[_0x424870[_0x3b92('0x55')]]['transfertype']=_0x3b92('0x52');queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x53')]=_0x424870['secondtransfererexten'];queues[_0x424870[_0x3b92('0x55')]]['transferuniqueid']=_0x424870[_0x3b92('0x5b')];queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x3b92('0x23')](queues[_0x424870[_0x3b92('0x50')]])){if(_0x424870[_0x3b92('0x5d')]&&queues[_0x424870[_0x3b92('0x5d')]]){queues[_0x424870[_0x3b92('0x5d')]][_0x3b92('0x20')]=0x1;queues[_0x424870[_0x3b92('0x5e')]]=_[_0x3b92('0x57')](queues[_0x424870[_0x3b92('0x5d')]]);queues[_0x424870['transfertargetuniqueid']][_0x3b92('0xe')]=_0x424870[_0x3b92('0x5e')];queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x20')]=0x2;queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x6')]=queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x6')];queues[_0x424870['transfertargetuniqueid']][_0x3b92('0x58')]=queues[_0x424870[_0x3b92('0x55')]][_0x3b92('0x58')];queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x38')]=utils[_0x3b92('0x15')]();queues[_0x424870[_0x3b92('0x5e')]]['queuecallerleaveAt']=utils[_0x3b92('0x15')]();queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x37')]=0x0;queues[_0x424870[_0x3b92('0x5e')]]['mohtime']=0x0;utils['info'](util[_0x3b92('0x11')](_0x3b92('0x5f'),_0x424870[_0x3b92('0x4f')],queues[_0x424870[_0x3b92('0x5e')]]['name'],queues[_0x424870['transfertargetuniqueid']][_0x3b92('0xe')],queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x6')],queues[_0x424870[_0x3b92('0x5e')]][_0x3b92('0x58')]));}else{utils[_0x3b92('0x12')](util['format'](_0x3b92('0x60'),_0x424870[_0x3b92('0x4f')],queues[_0x424870[_0x3b92('0x50')]]['name'],_0x424870[_0x3b92('0x55')]));queues[_0x424870[_0x3b92('0x50')]][_0x3b92('0xe')]=_0x424870[_0x3b92('0x55')];}}}}catch(_0x705e58){utils[_0x3b92('0x33')](util['format']('[%s][queues][attendedtransfer]',_0x424870[_0x3b92('0x4f')]),_0x705e58);}};exports['musiconholdstart']=function(_0x5a0733){try{if(!_[_0x3b92('0x23')](queues[_0x5a0733[_0x3b92('0x3')]])){utils['debug'](util[_0x3b92('0x11')]('[%s][queues][musiconholdstart]',_0x5a0733[_0x3b92('0x3')]),_0x5a0733);queues[_0x5a0733[_0x3b92('0x3')]][_0x3b92('0x61')]=utils[_0x3b92('0x15')]();utils[_0x3b92('0x12')](util['format'](_0x3b92('0x62'),_0x5a0733['uniqueid'],queues[_0x5a0733[_0x3b92('0x3')]][_0x3b92('0x1f')],queues[_0x5a0733[_0x3b92('0x3')]][_0x3b92('0x61')]));}}catch(_0x20d4ac){utils[_0x3b92('0x33')](util['format'](_0x3b92('0x63'),_0x5a0733[_0x3b92('0x3')]),_0x20d4ac);}};exports['musiconholdstop']=function(_0x5b0949){try{if(!_[_0x3b92('0x23')](queues[_0x5b0949[_0x3b92('0x3')]])){if(!_['isNil'](queues[_0x5b0949[_0x3b92('0x3')]][_0x3b92('0x61')])){utils[_0x3b92('0x10')](util['format'](_0x3b92('0x64'),_0x5b0949[_0x3b92('0x3')]),_0x5b0949);queues[_0x5b0949[_0x3b92('0x3')]][_0x3b92('0x59')]+=utils[_0x3b92('0x65')](utils['now'](),queues[_0x5b0949[_0x3b92('0x3')]][_0x3b92('0x61')]);utils[_0x3b92('0x12')](util[_0x3b92('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5b0949['uniqueid'],queues[_0x5b0949[_0x3b92('0x3')]][_0x3b92('0x1f')],queues[_0x5b0949[_0x3b92('0x3')]]['mohtime']));delete queues[_0x5b0949[_0x3b92('0x3')]]['musiconholdstartAt'];}}}catch(_0x5d22cb){utils[_0x3b92('0x33')](util['format']('[%s][queues][musiconholdstop]',_0x5b0949[_0x3b92('0x3')]),_0x5d22cb);}};
\ No newline at end of file
index be823ad..748729b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb62a=['hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','channel','newstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','find','monitors','push'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xb62a,0x1c8));var _0xab62=function(_0x1538c3,_0x4db427){_0x1538c3=_0x1538c3-0x0;var _0x5c5b7e=_0xb62a[_0x1538c3];return _0x5c5b7e;};'use strict';var _=require(_0xab62('0x0'));var util=require(_0xab62('0x1'));var utils=require(_0xab62('0x2'));var transfers=require(_0xab62('0x3'));var recordings={};function writeDB(_0x4ef946){var _0x91fd23;utils[_0xab62('0x4')](util['format'](_0xab62('0x5'),_0x4ef946[_0xab62('0x6')]));if(transfers[_0xab62('0x7')][_0x4ef946['uniqueid']]){_0x91fd23=_0x4ef946[_0xab62('0x6')];_0x4ef946[_0xab62('0x6')]=transfers[_0xab62('0x7')][_0x4ef946[_0xab62('0x6')]][_0xab62('0x8')];}if(_0x4ef946['accountcode']){utils['getUserByInternal'](_0x4ef946['accountcode'])[_0xab62('0x9')](function(_0x348063){if(_0x348063){_0x4ef946[_0xab62('0xa')]=_0x348063['name'];_0x4ef946[_0xab62('0xb')]=_0x348063['id'];}utils[_0xab62('0xc')](_0xab62('0xd'),_0x4ef946);});}else{utils[_0xab62('0xc')](_0xab62('0xd'),_0x4ef946);}if(_0x91fd23)delete transfers[_0xab62('0x7')][_0x91fd23];}exports[_0xab62('0xe')]=function(_0x491c92){try{utils[_0xab62('0xf')](util[_0xab62('0x10')](_0xab62('0x11'),_0x491c92['uniqueid']),_0x491c92);if(_0x491c92['uniqueid']==_0x491c92[_0xab62('0x12')]){utils[_0xab62('0x4')](util[_0xab62('0x10')](_0xab62('0x13'),_0x491c92['uniqueid'],_0x491c92[_0xab62('0x14')],_0x491c92[_0xab62('0x15')]));recordings[_0x491c92[_0xab62('0x6')]]={'uniqueid':_0x491c92[_0xab62('0x6')],'accountcode':_0x491c92[_0xab62('0x16')],'exten':_0x491c92[_0xab62('0x15')],'context':_0x491c92[_0xab62('0x14')],'channel':_0x491c92[_0xab62('0x17')],'monitors':[]};}}catch(_0x51e753){utils['error'](util[_0xab62('0x10')]('[%s][recordings][newchannel]',_0x491c92['uniqueid']),_0x51e753);}};exports[_0xab62('0x18')]=function(_0x1f8242){try{utils[_0xab62('0xf')](util[_0xab62('0x10')]('[%s][recordings][newstate]',_0x1f8242[_0xab62('0x6')]),_0x1f8242);if(!_[_0xab62('0x19')](recordings[_0x1f8242[_0xab62('0x6')]])&&_0x1f8242['channelstate']==0x6){utils[_0xab62('0x4')](util[_0xab62('0x10')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1f8242[_0xab62('0x6')],_0x1f8242[_0xab62('0x14')],_0x1f8242['channel']));}else if(!_[_0xab62('0x19')](recordings[_0x1f8242[_0xab62('0x12')]])&&_0x1f8242['channelstate']==0x6&&_0x1f8242['context']!=_0xab62('0x1a')){utils[_0xab62('0x4')](util[_0xab62('0x10')](_0xab62('0x1b'),_0x1f8242[_0xab62('0x6')],_0x1f8242[_0xab62('0x12')],_0x1f8242[_0xab62('0x14')],_0x1f8242[_0xab62('0x17')]));recordings[_0x1f8242[_0xab62('0x12')]][_0xab62('0x16')]=_0x1f8242['accountcode'];}}catch(_0x32fe65){utils[_0xab62('0x1c')](util['format'](_0xab62('0x1d'),_0x1f8242[_0xab62('0x6')]),_0x32fe65);}};exports[_0xab62('0x1e')]=function(_0x54c863){try{if(!_[_0xab62('0x19')](_0x54c863[_0xab62('0x1f')])&&!_[_0xab62('0x19')](_0x54c863[_0xab62('0x1f')][_0xab62('0x20')])){utils[_0xab62('0xf')](util[_0xab62('0x10')](_0xab62('0x21'),_0x54c863['uniqueid']),_0x54c863);utils[_0xab62('0x4')](util[_0xab62('0x10')](_0xab62('0x22'),_0x54c863['uniqueid'],_0x54c863['variable'],_0x54c863[_0xab62('0x23')]));if(_[_0xab62('0x24')](_0x54c863[_0xab62('0x23')],_0xab62('0x25'))){_0x54c863[_0xab62('0x23')]=_0x54c863[_0xab62('0x23')]['replace'](_0xab62('0x25'),'.WAV');}if(recordings[_0x54c863[_0xab62('0x12')]]){var _0x1f0911=_[_0xab62('0x26')](recordings[_0x54c863[_0xab62('0x12')]][_0xab62('0x27')],{'value':_0x54c863[_0xab62('0x23')]});if(_['isNil'](_0x1f0911)){recordings[_0x54c863['linkedid']]['monitors'][_0xab62('0x28')]({'value':_0x54c863[_0xab62('0x23')]});}}}}catch(_0x9d8318){utils[_0xab62('0x1c')](util['format']('[%s][recordings][varset]',_0x54c863[_0xab62('0x6')]),_0x9d8318);}};exports[_0xab62('0x29')]=function(_0x11dbbb){try{if(!_[_0xab62('0x19')](recordings[_0x11dbbb['uniqueid']])){utils[_0xab62('0xf')](util[_0xab62('0x10')](_0xab62('0x2a'),_0x11dbbb[_0xab62('0x6')]),_0x11dbbb);utils['info'](util[_0xab62('0x10')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x11dbbb[_0xab62('0x6')],_0x11dbbb[_0xab62('0x2b')],_0x11dbbb[_0xab62('0x2c')],_0x11dbbb[_0xab62('0x2d')]));recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x2b')]=_0x11dbbb[_0xab62('0x2b')];recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x2c')]=_0x11dbbb['calleridname'];recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x2e')]=_0x11dbbb[_0xab62('0x2e')];recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x2f')]=_0x11dbbb[_0xab62('0x2f')];if(recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x30')]==_0xab62('0x31')&&recordings[_0x11dbbb['uniqueid']][_0xab62('0x16')]){recordings[_0x11dbbb[_0xab62('0x6')]]['connectedlinenum']=recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x16')];recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x2f')]='';}recordings[_0x11dbbb[_0xab62('0x6')]][_0xab62('0x27')][_0xab62('0x32')](function(_0x4c5fdd){var _0x581d35=_['clone'](recordings[_0x11dbbb[_0xab62('0x6')]]);_0x581d35[_0xab62('0x23')]=_0x4c5fdd[_0xab62('0x23')];writeDB(_0x581d35);});delete recordings[_0x11dbbb[_0xab62('0x6')]];}}catch(_0xa974a2){utils[_0xab62('0x1c')](util[_0xab62('0x10')]('[%s][recordings][hangup]',_0x11dbbb[_0xab62('0x6')]),_0xa974a2);}};exports[_0xab62('0x33')]=function(_0x37ff34){try{if(!_['isNil'](recordings[_0x37ff34[_0xab62('0x6')]])){utils[_0xab62('0xf')](util[_0xab62('0x10')](_0xab62('0x34'),_0x37ff34[_0xab62('0x6')]),_0x37ff34);utils[_0xab62('0x4')](util[_0xab62('0x10')](_0xab62('0x35'),_0x37ff34[_0xab62('0x6')],_0x37ff34[_0xab62('0x36')],_0x37ff34[_0xab62('0x37')]));if(_0x37ff34[_0xab62('0x36')]['toLowerCase']()==_0xab62('0x38')&&_[_0xab62('0x39')](_0x37ff34['appdata'][_0xab62('0x3a')](),'cdr')){var _0x79f09=_0x37ff34[_0xab62('0x37')]['split']('=');var _0x1ed68e=_0x79f09[0x0][_0xab62('0x3b')](_0x79f09[0x0]['lastIndexOf']('(')+0x1,_0x79f09[0x0][_0xab62('0x3c')](')'));var _0x13fdc5=_0x79f09[0x1];recordings[_0x37ff34['uniqueid']][_0x1ed68e]=_0x13fdc5;}}}catch(_0x3a5016){utils[_0xab62('0x1c')](util[_0xab62('0x10')](_0xab62('0x34'),_0x37ff34[_0xab62('0x6')]),_0x3a5016);}};exports[_0xab62('0x3d')]=function(_0x2b7e75){try{if(!_[_0xab62('0x19')](recordings[_0x2b7e75['uniqueid']])){utils[_0xab62('0xf')](util[_0xab62('0x10')](_0xab62('0x3e'),_0x2b7e75['uniqueid']),_0x2b7e75);utils[_0xab62('0x4')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2b7e75[_0xab62('0x6')],_0x2b7e75['queue']));recordings[_0x2b7e75[_0xab62('0x6')]][_0xab62('0x3f')]=_0x2b7e75['queue'];}}catch(_0x5a0091){utils[_0xab62('0x1c')](util[_0xab62('0x10')](_0xab62('0x3e'),_0x2b7e75['uniqueid']),_0x5a0091);}};exports['blindtransfer']=function(_0x3db9d5){try{utils[_0xab62('0xf')](util[_0xab62('0x10')]('[%s][recordings][blindtransfer]',_0x3db9d5[_0xab62('0x6')]),_0x3db9d5);utils[_0xab62('0x4')](util[_0xab62('0x10')](_0xab62('0x40'),_0x3db9d5['uniqueid'],_0x3db9d5['transferercalleridnum'],_0x3db9d5[_0xab62('0x41')],_0x3db9d5[_0xab62('0x42')],_0x3db9d5[_0xab62('0x43')]));if(recordings[_0x3db9d5[_0xab62('0x44')]]&&transfers[_0xab62('0x7')][_0x3db9d5[_0xab62('0x44')]]){transfers[_0xab62('0x7')][_0x3db9d5['transfereruniqueid']][_0xab62('0x45')]=!![];}}catch(_0x56b0d2){utils[_0xab62('0x1c')](util[_0xab62('0x10')](_0xab62('0x46'),_0x3db9d5[_0xab62('0x6')]),_0x56b0d2);}};
\ No newline at end of file
+var _0x05f0=['./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','lastIndexOf','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','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','./utils'];(function(_0x18d738,_0x45b690){var _0x1e54a0=function(_0x4117f7){while(--_0x4117f7){_0x18d738['push'](_0x18d738['shift']());}};_0x1e54a0(++_0x45b690);}(_0x05f0,0x19c));var _0x005f=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0x05f0[_0x2300f2];return _0x6bd508;};'use strict';var _=require(_0x005f('0x0'));var util=require('util');var utils=require(_0x005f('0x1'));var transfers=require(_0x005f('0x2'));var recordings={};function writeDB(_0x386ab3){var _0x4ac08a;utils[_0x005f('0x3')](util[_0x005f('0x4')](_0x005f('0x5'),_0x386ab3['uniqueid']));if(transfers['blinds'][_0x386ab3[_0x005f('0x6')]]){_0x4ac08a=_0x386ab3[_0x005f('0x6')];_0x386ab3['uniqueid']=transfers[_0x005f('0x7')][_0x386ab3[_0x005f('0x6')]][_0x005f('0x8')];}if(_0x386ab3[_0x005f('0x9')]){utils[_0x005f('0xa')](_0x386ab3[_0x005f('0x9')])[_0x005f('0xb')](function(_0x2607ca){if(_0x2607ca){_0x386ab3[_0x005f('0xc')]=_0x2607ca[_0x005f('0xd')];_0x386ab3['UserId']=_0x2607ca['id'];}utils[_0x005f('0xe')](_0x005f('0xf'),_0x386ab3);});}else{utils[_0x005f('0xe')](_0x005f('0xf'),_0x386ab3);}if(_0x4ac08a)delete transfers[_0x005f('0x7')][_0x4ac08a];}exports['newchannel']=function(_0x5add63){try{utils[_0x005f('0x10')](util['format'](_0x005f('0x11'),_0x5add63[_0x005f('0x6')]),_0x5add63);if(_0x5add63[_0x005f('0x6')]==_0x5add63[_0x005f('0x12')]){utils[_0x005f('0x3')](util[_0x005f('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5add63[_0x005f('0x6')],_0x5add63[_0x005f('0x13')],_0x5add63[_0x005f('0x14')]));recordings[_0x5add63['uniqueid']]={'uniqueid':_0x5add63[_0x005f('0x6')],'accountcode':_0x5add63[_0x005f('0x9')],'exten':_0x5add63['exten'],'context':_0x5add63[_0x005f('0x13')],'channel':_0x5add63[_0x005f('0x15')],'monitors':[]};}}catch(_0x10d93e){utils['error'](util['format'](_0x005f('0x11'),_0x5add63[_0x005f('0x6')]),_0x10d93e);}};exports[_0x005f('0x16')]=function(_0x5a600a){try{utils[_0x005f('0x10')](util[_0x005f('0x4')](_0x005f('0x17'),_0x5a600a[_0x005f('0x6')]),_0x5a600a);if(!_[_0x005f('0x18')](recordings[_0x5a600a['uniqueid']])&&_0x5a600a[_0x005f('0x19')]==0x6){utils['info'](util[_0x005f('0x4')](_0x005f('0x1a'),_0x5a600a[_0x005f('0x6')],_0x5a600a[_0x005f('0x13')],_0x5a600a[_0x005f('0x15')]));}else if(!_[_0x005f('0x18')](recordings[_0x5a600a[_0x005f('0x12')]])&&_0x5a600a[_0x005f('0x19')]==0x6&&_0x5a600a[_0x005f('0x13')]!=_0x005f('0x1b')){utils['info'](util[_0x005f('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5a600a[_0x005f('0x6')],_0x5a600a[_0x005f('0x12')],_0x5a600a['context'],_0x5a600a[_0x005f('0x15')]));recordings[_0x5a600a[_0x005f('0x12')]][_0x005f('0x9')]=_0x5a600a['accountcode'];}}catch(_0x4e09a2){utils[_0x005f('0x1c')](util['format'](_0x005f('0x17'),_0x5a600a[_0x005f('0x6')]),_0x4e09a2);}};exports[_0x005f('0x1d')]=function(_0x4235c6){try{if(!_[_0x005f('0x18')](_0x4235c6[_0x005f('0x1e')])&&!_[_0x005f('0x18')](_0x4235c6[_0x005f('0x1e')]['mixmonitor_filename'])){utils['debug'](util[_0x005f('0x4')](_0x005f('0x1f'),_0x4235c6['uniqueid']),_0x4235c6);utils[_0x005f('0x3')](util[_0x005f('0x4')](_0x005f('0x20'),_0x4235c6[_0x005f('0x6')],_0x4235c6[_0x005f('0x1e')],_0x4235c6[_0x005f('0x21')]));if(_['endsWith'](_0x4235c6['value'],_0x005f('0x22'))){_0x4235c6[_0x005f('0x21')]=_0x4235c6[_0x005f('0x21')][_0x005f('0x23')]('.wav49',_0x005f('0x24'));}if(recordings[_0x4235c6[_0x005f('0x12')]]){var _0x4e3d78=_['find'](recordings[_0x4235c6[_0x005f('0x12')]][_0x005f('0x25')],{'value':_0x4235c6[_0x005f('0x21')]});if(_['isNil'](_0x4e3d78)){recordings[_0x4235c6[_0x005f('0x12')]][_0x005f('0x25')][_0x005f('0x26')]({'value':_0x4235c6[_0x005f('0x21')]});}}}}catch(_0x35aaf1){utils[_0x005f('0x1c')](util['format'](_0x005f('0x1f'),_0x4235c6[_0x005f('0x6')]),_0x35aaf1);}};exports[_0x005f('0x27')]=function(_0x491ac8){try{if(!_[_0x005f('0x18')](recordings[_0x491ac8[_0x005f('0x6')]])){utils['debug'](util[_0x005f('0x4')](_0x005f('0x28'),_0x491ac8['uniqueid']),_0x491ac8);utils[_0x005f('0x3')](util[_0x005f('0x4')](_0x005f('0x29'),_0x491ac8[_0x005f('0x6')],_0x491ac8[_0x005f('0x2a')],_0x491ac8[_0x005f('0x2b')],_0x491ac8[_0x005f('0x2c')]));recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x2a')]=_0x491ac8[_0x005f('0x2a')];recordings[_0x491ac8['uniqueid']][_0x005f('0x2b')]=_0x491ac8[_0x005f('0x2b')];recordings[_0x491ac8['uniqueid']][_0x005f('0x2d')]=_0x491ac8[_0x005f('0x2d')];recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x2e')]=_0x491ac8[_0x005f('0x2e')];if(recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x2f')]==_0x005f('0x30')&&recordings[_0x491ac8[_0x005f('0x6')]]['accountcode']){recordings[_0x491ac8[_0x005f('0x6')]]['connectedlinenum']=recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x9')];recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x2e')]='';}recordings[_0x491ac8[_0x005f('0x6')]][_0x005f('0x25')][_0x005f('0x31')](function(_0x4fc91a){var _0x2f16e8=_[_0x005f('0x32')](recordings[_0x491ac8[_0x005f('0x6')]]);_0x2f16e8[_0x005f('0x21')]=_0x4fc91a[_0x005f('0x21')];writeDB(_0x2f16e8);});delete recordings[_0x491ac8[_0x005f('0x6')]];}}catch(_0x3c8973){utils[_0x005f('0x1c')](util[_0x005f('0x4')](_0x005f('0x28'),_0x491ac8[_0x005f('0x6')]),_0x3c8973);}};exports[_0x005f('0x33')]=function(_0x167d1b){try{if(!_[_0x005f('0x18')](recordings[_0x167d1b[_0x005f('0x6')]])){utils[_0x005f('0x10')](util[_0x005f('0x4')](_0x005f('0x34'),_0x167d1b[_0x005f('0x6')]),_0x167d1b);utils['info'](util[_0x005f('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x167d1b['uniqueid'],_0x167d1b['application'],_0x167d1b[_0x005f('0x35')]));if(_0x167d1b[_0x005f('0x36')][_0x005f('0x37')]()=='set'&&_['startsWith'](_0x167d1b[_0x005f('0x35')][_0x005f('0x37')](),'cdr')){var _0x1ee92c=_0x167d1b[_0x005f('0x35')]['split']('=');var _0x356837=_0x1ee92c[0x0]['substring'](_0x1ee92c[0x0][_0x005f('0x38')]('(')+0x1,_0x1ee92c[0x0][_0x005f('0x38')](')'));var _0x3664e2=_0x1ee92c[0x1];recordings[_0x167d1b[_0x005f('0x6')]][_0x356837]=_0x3664e2;}}}catch(_0x1d6294){utils['error'](util['format'](_0x005f('0x34'),_0x167d1b[_0x005f('0x6')]),_0x1d6294);}};exports[_0x005f('0x39')]=function(_0x3032ce){try{if(!_[_0x005f('0x18')](recordings[_0x3032ce[_0x005f('0x6')]])){utils[_0x005f('0x10')](util['format'](_0x005f('0x3a'),_0x3032ce[_0x005f('0x6')]),_0x3032ce);utils['info'](util[_0x005f('0x4')](_0x005f('0x3b'),_0x3032ce[_0x005f('0x6')],_0x3032ce[_0x005f('0x3c')]));recordings[_0x3032ce[_0x005f('0x6')]][_0x005f('0x3c')]=_0x3032ce['queue'];}}catch(_0x300e4a){utils['error'](util[_0x005f('0x4')](_0x005f('0x3a'),_0x3032ce['uniqueid']),_0x300e4a);}};exports[_0x005f('0x3d')]=function(_0x5c8a84){try{utils[_0x005f('0x10')](util[_0x005f('0x4')](_0x005f('0x3e'),_0x5c8a84[_0x005f('0x6')]),_0x5c8a84);utils['info'](util[_0x005f('0x4')](_0x005f('0x3f'),_0x5c8a84[_0x005f('0x6')],_0x5c8a84[_0x005f('0x40')],_0x5c8a84[_0x005f('0x41')],_0x5c8a84['transfereecalleridnum'],_0x5c8a84[_0x005f('0x42')]));if(recordings[_0x5c8a84[_0x005f('0x43')]]&&transfers[_0x005f('0x7')][_0x5c8a84[_0x005f('0x43')]]){transfers[_0x005f('0x7')][_0x5c8a84[_0x005f('0x43')]][_0x005f('0x44')]=!![];}}catch(_0x500b2c){utils[_0x005f('0x1c')](util['format'](_0x005f('0x3e'),_0x5c8a84[_0x005f('0x6')]),_0x500b2c);}};
\ No newline at end of file
index 45aab13..f53ae7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e5=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0xa3e5,0x8d));var _0x5a3e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa3e5[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x5a3e('0x0'));var utils=require(_0x5a3e('0x1'));function writeDB(_0x370cd8){utils[_0x5a3e('0x2')](util[_0x5a3e('0x3')](_0x5a3e('0x4'),_0x370cd8[_0x5a3e('0x5')]===_0x5a3e('0x6')?_0x370cd8[_0x5a3e('0x7')]:_0x370cd8[_0x5a3e('0x8')],_0x370cd8[_0x5a3e('0x5')]));utils[_0x5a3e('0x9')]('CreateVoiceTransferReport',_0x370cd8);}exports['blinds']={};exports[_0x5a3e('0xa')]=function(_0x2f9d1d){try{utils[_0x5a3e('0xb')](util[_0x5a3e('0x3')](_0x5a3e('0xc'),_0x2f9d1d[_0x5a3e('0x8')]),_0x2f9d1d);utils['info'](util[_0x5a3e('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2f9d1d[_0x5a3e('0x8')],_0x2f9d1d[_0x5a3e('0xd')],_0x2f9d1d[_0x5a3e('0xe')],_0x2f9d1d[_0x5a3e('0xf')],_0x2f9d1d[_0x5a3e('0x10')]));_0x2f9d1d['type']=_0x5a3e('0x11');exports['blinds'][_0x2f9d1d[_0x5a3e('0x12')]]=_0x2f9d1d;writeDB(_0x2f9d1d);}catch(_0x52e712){utils['error'](util[_0x5a3e('0x3')](_0x5a3e('0xc'),_0x2f9d1d[_0x5a3e('0x8')]),_0x52e712);}};exports['attendedtransfer']=function(_0xec75c3){try{utils['debug'](util[_0x5a3e('0x3')]('[%s][transfers][attendedtransfer]',_0xec75c3[_0x5a3e('0x7')]),_0xec75c3);utils[_0x5a3e('0x2')](util[_0x5a3e('0x3')](_0x5a3e('0x13'),_0xec75c3[_0x5a3e('0x7')],_0xec75c3[_0x5a3e('0x14')],_0xec75c3[_0x5a3e('0x15')],_0xec75c3['transfertargetcalleridnum'],_0xec75c3[_0x5a3e('0x16')]));_0xec75c3=_['assign'](_0xec75c3,{'transfererchannel':_0xec75c3['origtransfererchannel'],'transferercalleridnum':_0xec75c3[_0x5a3e('0x14')],'transferercalleridname':_0xec75c3[_0x5a3e('0x15')],'transfererconnectedlinenum':_0xec75c3[_0x5a3e('0x17')],'transfererconnectedlinename':_0xec75c3[_0x5a3e('0x18')],'transfereraccountcode':_0xec75c3['origtransfereraccountcode'],'transferercontext':_0xec75c3[_0x5a3e('0x19')],'transfererexten':_0xec75c3[_0x5a3e('0x1a')],'transfererlinkedid':_0xec75c3['origtransfererlinkedid'],'context':_0xec75c3[_0x5a3e('0x1b')],'extension':_0xec75c3['origtransfererexten'],'type':_0x5a3e('0x6')});if(_[_0x5a3e('0x1c')](_0xec75c3[_0x5a3e('0x1d')])){_0xec75c3=_[_0x5a3e('0x1e')](_0xec75c3,{'transfereechannel':_0xec75c3[_0x5a3e('0x1f')],'transfereecalleridnum':_0xec75c3[_0x5a3e('0x20')],'transfereecalleridname':_0xec75c3[_0x5a3e('0x16')],'transfereeconnectedlinenum':_0xec75c3[_0x5a3e('0x21')],'transfereeconnectedlinename':_0xec75c3[_0x5a3e('0x22')],'transfereeaccountcode':_0xec75c3[_0x5a3e('0x23')],'transfereecontext':_0xec75c3[_0x5a3e('0x24')],'transfereeexten':_0xec75c3[_0x5a3e('0x25')],'transfereelinkedid':_0xec75c3[_0x5a3e('0x26')]});}writeDB(_0xec75c3);}catch(_0x40a5e1){utils['error'](util[_0x5a3e('0x3')](_0x5a3e('0x27'),_0xec75c3[_0x5a3e('0x7')]),_0x40a5e1);}};
\ No newline at end of file
+var _0x3e3f=['type','blind','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x3f0c77,_0x120b09){var _0x2b9178=function(_0x648166){while(--_0x648166){_0x3f0c77['push'](_0x3f0c77['shift']());}};_0x2b9178(++_0x120b09);}(_0x3e3f,0x109));var _0xf3e3=function(_0x186572,_0x177177){_0x186572=_0x186572-0x0;var _0x25754c=_0x3e3f[_0x186572];return _0x25754c;};'use strict';var _=require(_0xf3e3('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x16b2f5){utils['info'](util['format'](_0xf3e3('0x1'),_0x16b2f5['type']===_0xf3e3('0x2')?_0x16b2f5[_0xf3e3('0x3')]:_0x16b2f5[_0xf3e3('0x4')],_0x16b2f5['type']));utils[_0xf3e3('0x5')]('CreateVoiceTransferReport',_0x16b2f5);}exports[_0xf3e3('0x6')]={};exports[_0xf3e3('0x7')]=function(_0xb231b2){try{utils['debug'](util[_0xf3e3('0x8')](_0xf3e3('0x9'),_0xb231b2[_0xf3e3('0x4')]),_0xb231b2);utils[_0xf3e3('0xa')](util[_0xf3e3('0x8')](_0xf3e3('0xb'),_0xb231b2[_0xf3e3('0x4')],_0xb231b2[_0xf3e3('0xc')],_0xb231b2[_0xf3e3('0xd')],_0xb231b2[_0xf3e3('0xe')],_0xb231b2['transfereecalleridname']));_0xb231b2[_0xf3e3('0xf')]=_0xf3e3('0x10');exports[_0xf3e3('0x6')][_0xb231b2['transfereruniqueid']]=_0xb231b2;writeDB(_0xb231b2);}catch(_0x9334dd){utils['error'](util['format'](_0xf3e3('0x9'),_0xb231b2[_0xf3e3('0x4')]),_0x9334dd);}};exports[_0xf3e3('0x11')]=function(_0x41d80f){try{utils[_0xf3e3('0x12')](util[_0xf3e3('0x8')](_0xf3e3('0x13'),_0x41d80f['origtransfereruniqueid']),_0x41d80f);utils[_0xf3e3('0xa')](util[_0xf3e3('0x8')](_0xf3e3('0x14'),_0x41d80f[_0xf3e3('0x3')],_0x41d80f[_0xf3e3('0x15')],_0x41d80f[_0xf3e3('0x16')],_0x41d80f[_0xf3e3('0x17')],_0x41d80f[_0xf3e3('0x18')]));_0x41d80f=_['assign'](_0x41d80f,{'transfererchannel':_0x41d80f[_0xf3e3('0x19')],'transferercalleridnum':_0x41d80f[_0xf3e3('0x15')],'transferercalleridname':_0x41d80f[_0xf3e3('0x16')],'transfererconnectedlinenum':_0x41d80f[_0xf3e3('0x1a')],'transfererconnectedlinename':_0x41d80f[_0xf3e3('0x1b')],'transfereraccountcode':_0x41d80f[_0xf3e3('0x1c')],'transferercontext':_0x41d80f['secondtransferercontext'],'transfererexten':_0x41d80f[_0xf3e3('0x1d')],'transfererlinkedid':_0x41d80f[_0xf3e3('0x1e')],'context':_0x41d80f[_0xf3e3('0x1f')],'extension':_0x41d80f['origtransfererexten'],'type':_0xf3e3('0x2')});if(_['isNil'](_0x41d80f[_0xf3e3('0x20')])){_0x41d80f=_[_0xf3e3('0x21')](_0x41d80f,{'transfereechannel':_0x41d80f[_0xf3e3('0x22')],'transfereecalleridnum':_0x41d80f[_0xf3e3('0x17')],'transfereecalleridname':_0x41d80f[_0xf3e3('0x18')],'transfereeconnectedlinenum':_0x41d80f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x41d80f[_0xf3e3('0x23')],'transfereeaccountcode':_0x41d80f['transfertargetaccountcode'],'transfereecontext':_0x41d80f[_0xf3e3('0x24')],'transfereeexten':_0x41d80f[_0xf3e3('0x25')],'transfereelinkedid':_0x41d80f[_0xf3e3('0x26')]});}writeDB(_0x41d80f);}catch(_0x4fb8f8){utils[_0xf3e3('0x27')](util[_0xf3e3('0x8')](_0xf3e3('0x13'),_0x41d80f[_0xf3e3('0x3')]),_0x4fb8f8);}};
\ No newline at end of file
index 1d09dc2..a3b5494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ff=['[utils][getUserByName]','getVoiceQueueByName','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','internal','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','getUserByInterface','found','notfound','[utils][getUserByInterface]','getUserByName'];(function(_0x382f47,_0x31b681){var _0x3b3eb5=function(_0x5084a7){while(--_0x5084a7){_0x382f47['push'](_0x382f47['shift']());}};_0x3b3eb5(++_0x31b681);}(_0x44ff,0x1c3));var _0xf44f=function(_0x364dc3,_0x28974d){_0x364dc3=_0x364dc3-0x0;var _0x2dd91e=_0x44ff[_0x364dc3];return _0x2dd91e;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf44f('0x0'));var moment=require(_0xf44f('0x1'));var util=require(_0xf44f('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xf44f('0x3')]=function(_0x672258,_0x53c286){logger['info'](_0x672258,_0x53c286?util[_0xf44f('0x4')](_0x53c286,{'showHidden':![],'depth':null}):'');};exports[_0xf44f('0x5')]=function(_0x24baf4,_0x536b0e){logger[_0xf44f('0x5')](_0x24baf4,_0x536b0e?util[_0xf44f('0x4')](_0x536b0e,{'showHidden':![],'depth':null}):'');};exports[_0xf44f('0x6')]=function(_0x4cce53,_0x12b3b9){logger[_0xf44f('0x6')](_0x4cce53,_0x12b3b9?util[_0xf44f('0x4')](_0x12b3b9,{'showHidden':![],'depth':null}):'');};exports[_0xf44f('0x7')]=function(_0x278017,_0x21fb0e){return client[_0xf44f('0x7')](_0x278017,{'body':_0x21fb0e})[_0xf44f('0x8')](function(_0x1acdc4){logger[_0xf44f('0x5')]('[utils][request]\x20name:%s',_0x278017,_0x1acdc4?util[_0xf44f('0x4')](_0x1acdc4,{'showHidden':![],'depth':null}):'');})[_0xf44f('0x9')](function(_0x23b73a){logger[_0xf44f('0x6')](_0xf44f('0xa'),_0x278017,_0x23b73a?util[_0xf44f('0x4')](_0x23b73a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3ad8ba){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf44f('0xb'),'name','interface'],'where':_0x3ad8ba,'limit':0x1}})['then'](function(_0x3aa2b8){logger[_0xf44f('0x5')](_0xf44f('0xc'),JSON[_0xf44f('0xd')](_0x3ad8ba),_0x3aa2b8?util['inspect'](_0x3aa2b8,{'showHidden':![],'depth':null}):'');return _0x3aa2b8[_0xf44f('0xe')]['length']?_0x3aa2b8[_0xf44f('0xe')][0x0]:null;});}exports[_0xf44f('0xf')]=function(_0x43c57d){return new BPromise(function(_0x15e5b6,_0x542786){if(_0x43c57d){return getUser({'internal':_0x43c57d})['then'](function(_0x5d4a52){logger['info'](_0xf44f('0x10'),_0x43c57d,_0x5d4a52?'found':'notfound');return _0x15e5b6(_0x5d4a52);})[_0xf44f('0x9')](function(_0x1e2c07){logger[_0xf44f('0x6')]('[utils][getUserByInternal]',_0x1e2c07?util[_0xf44f('0x4')](_0x1e2c07,{'showHidden':![],'depth':null}):'');return _0x15e5b6(null);});}return _0x15e5b6(null);});};exports[_0xf44f('0x11')]=function(_0x5eb768){return new BPromise(function(_0xe23ff0,_0x5c35f6){if(_0x5eb768){return getUser({'interface':_0x5eb768})[_0xf44f('0x8')](function(_0x166acd){logger[_0xf44f('0x3')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5eb768,_0x166acd?_0xf44f('0x12'):_0xf44f('0x13'));return _0xe23ff0(_0x166acd);})[_0xf44f('0x9')](function(_0x58d4af){logger[_0xf44f('0x6')](_0xf44f('0x14'),_0x58d4af?util[_0xf44f('0x4')](_0x58d4af,{'showHidden':![],'depth':null}):'');return _0xe23ff0(null);});}return _0xe23ff0(null);});};exports[_0xf44f('0x15')]=function(_0x1c85cc){return new BPromise(function(_0x5313f5,_0x3c04fe){if(_0x1c85cc){return getUser({'name':_0x1c85cc})[_0xf44f('0x8')](function(_0x17f1a4){logger[_0xf44f('0x3')]('[utils][getUserByName]\x20name:%s\x20%s',_0x1c85cc,_0x17f1a4?_0xf44f('0x12'):_0xf44f('0x13'));return _0x5313f5(_0x17f1a4);})[_0xf44f('0x9')](function(_0x3ea717){logger[_0xf44f('0x6')](_0xf44f('0x16'),_0x3ea717?util['inspect'](_0x3ea717,{'showHidden':![],'depth':null}):'');return _0x5313f5(null);});}return _0x5313f5(null);});};exports[_0xf44f('0x17')]=function(_0x5255eb){return new BPromise(function(_0x2f5075,_0x14e6cf){if(_0x5255eb){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xf44f('0x18'),_0xf44f('0x19'),_0xf44f('0x1a'),_0xf44f('0x1b')],'where':{'name':_0x5255eb},'limit':0x1}})['then'](function(_0x1ee969){logger[_0xf44f('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5255eb,_0x1ee969?util[_0xf44f('0x4')](_0x1ee969,{'showHidden':![],'depth':null}):'');logger[_0xf44f('0x3')](_0xf44f('0x1c'),_0x5255eb,_0x1ee969?_0xf44f('0x12'):_0xf44f('0x13'));return _0x2f5075(_0x1ee969[_0xf44f('0xe')][_0xf44f('0x1d')]?_0x1ee969[_0xf44f('0xe')][0x0]:null);})[_0xf44f('0x9')](function(_0x31e847){logger['error'](_0xf44f('0x1e'),_0x31e847?util[_0xf44f('0x4')](_0x31e847,{'showHidden':![],'depth':null}):'');return _0x2f5075(null);});}return _0x2f5075(null);});};exports['addTime']=function(_0x234771,_0x2d1932){return moment(_0x234771)[_0xf44f('0x1f')](_0x2d1932,_0xf44f('0x20'))[_0xf44f('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf44f('0x22')]=function(_0x19f3ac,_0x220749){return moment(_0x19f3ac)[_0xf44f('0x23')](_0x220749,_0xf44f('0x20'))[_0xf44f('0x21')](_0xf44f('0x24'));};exports[_0xf44f('0x25')]=function(_0x28cfe7,_0x4eeb11){return moment(_0x28cfe7)[_0xf44f('0x26')](moment(_0x4eeb11),_0xf44f('0x20'));};exports[_0xf44f('0x27')]=function(_0x3abb6e,_0x2865bf){return parseInt(_0x3abb6e,0xa)+parseInt(_0x2865bf,0xa);};exports[_0xf44f('0x28')]=function(){return moment()[_0xf44f('0x21')](_0xf44f('0x24'));};exports[_0xf44f('0x29')]=function(_0x4e1bfe,_0x16808a){if(_0x16808a){return moment(_0x4e1bfe)[_0xf44f('0x29')](_0x16808a);}return!![];};exports[_0xf44f('0x2a')]=function(_0x1ccc9b,_0x44fca1){if(_0x44fca1){return moment(_0x1ccc9b)[_0xf44f('0x2a')](_0x44fca1);}else if(_0x1ccc9b){return!![];}return![];};
\ No newline at end of file
+var _0x9525=['[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','subtractTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length'];(function(_0x13fe35,_0x537cee){var _0x4875a8=function(_0x3fb855){while(--_0x3fb855){_0x13fe35['push'](_0x13fe35['shift']());}};_0x4875a8(++_0x537cee);}(_0x9525,0x12e));var _0x5952=function(_0x4dd4a1,_0x5ca922){_0x4dd4a1=_0x4dd4a1-0x0;var _0x168d0f=_0x9525[_0x4dd4a1];return _0x168d0f;};'use strict';var BPromise=require(_0x5952('0x0'));var jayson=require('jayson/promise');var moment=require(_0x5952('0x1'));var util=require(_0x5952('0x2'));var client=jayson[_0x5952('0x3')][_0x5952('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x5952('0x5')]=function(_0x26bb3c,_0x59cdbf){logger[_0x5952('0x5')](_0x26bb3c,_0x59cdbf?util[_0x5952('0x6')](_0x59cdbf,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x23b750,_0x31a618){logger[_0x5952('0x7')](_0x23b750,_0x31a618?util['inspect'](_0x31a618,{'showHidden':![],'depth':null}):'');};exports[_0x5952('0x8')]=function(_0x57ac0a,_0x1aaaae){logger[_0x5952('0x8')](_0x57ac0a,_0x1aaaae?util['inspect'](_0x1aaaae,{'showHidden':![],'depth':null}):'');};exports[_0x5952('0x9')]=function(_0x24ef66,_0x1cf060){return client[_0x5952('0x9')](_0x24ef66,{'body':_0x1cf060})[_0x5952('0xa')](function(_0x14e28f){logger[_0x5952('0x7')]('[utils][request]\x20name:%s',_0x24ef66,_0x14e28f?util[_0x5952('0x6')](_0x14e28f,{'showHidden':![],'depth':null}):'');})[_0x5952('0xb')](function(_0x6c2f3a){logger[_0x5952('0x8')](_0x5952('0xc'),_0x24ef66,_0x6c2f3a?util[_0x5952('0x6')](_0x6c2f3a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1bc893){return client[_0x5952('0x9')](_0x5952('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x5952('0xe'),_0x5952('0xf')],'where':_0x1bc893,'limit':0x1}})[_0x5952('0xa')](function(_0x458d76){logger[_0x5952('0x7')](_0x5952('0x10'),JSON[_0x5952('0x11')](_0x1bc893),_0x458d76?util[_0x5952('0x6')](_0x458d76,{'showHidden':![],'depth':null}):'');return _0x458d76[_0x5952('0x12')][_0x5952('0x13')]?_0x458d76['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x36c55e){return new BPromise(function(_0x31afd0,_0x496f79){if(_0x36c55e){return getUser({'internal':_0x36c55e})[_0x5952('0xa')](function(_0x4af1c9){logger['info'](_0x5952('0x14'),_0x36c55e,_0x4af1c9?'found':_0x5952('0x15'));return _0x31afd0(_0x4af1c9);})[_0x5952('0xb')](function(_0xda691b){logger[_0x5952('0x8')]('[utils][getUserByInternal]',_0xda691b?util[_0x5952('0x6')](_0xda691b,{'showHidden':![],'depth':null}):'');return _0x31afd0(null);});}return _0x31afd0(null);});};exports[_0x5952('0x16')]=function(_0x55acc8){return new BPromise(function(_0x1b4ea8,_0x59e75f){if(_0x55acc8){return getUser({'interface':_0x55acc8})['then'](function(_0x31605b){logger[_0x5952('0x5')](_0x5952('0x17'),_0x55acc8,_0x31605b?_0x5952('0x18'):_0x5952('0x15'));return _0x1b4ea8(_0x31605b);})[_0x5952('0xb')](function(_0x144969){logger[_0x5952('0x8')](_0x5952('0x19'),_0x144969?util[_0x5952('0x6')](_0x144969,{'showHidden':![],'depth':null}):'');return _0x1b4ea8(null);});}return _0x1b4ea8(null);});};exports[_0x5952('0x1a')]=function(_0x472fae){return new BPromise(function(_0x426832,_0x5865ae){if(_0x472fae){return getUser({'name':_0x472fae})[_0x5952('0xa')](function(_0x4d80bf){logger[_0x5952('0x5')](_0x5952('0x1b'),_0x472fae,_0x4d80bf?'found':'notfound');return _0x426832(_0x4d80bf);})[_0x5952('0xb')](function(_0x1aff25){logger[_0x5952('0x8')]('[utils][getUserByName]',_0x1aff25?util[_0x5952('0x6')](_0x1aff25,{'showHidden':![],'depth':null}):'');return _0x426832(null);});}return _0x426832(null);});};exports[_0x5952('0x1c')]=function(_0x494d93){return new BPromise(function(_0xcb56bb,_0x85130d){if(_0x494d93){return client[_0x5952('0x9')](_0x5952('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x5952('0xe'),'type',_0x5952('0x1e'),'acwTimeout'],'where':{'name':_0x494d93},'limit':0x1}})['then'](function(_0x555108){logger['debug'](_0x5952('0x1f'),_0x494d93,_0x555108?util[_0x5952('0x6')](_0x555108,{'showHidden':![],'depth':null}):'');logger['info'](_0x5952('0x20'),_0x494d93,_0x555108?_0x5952('0x18'):_0x5952('0x15'));return _0xcb56bb(_0x555108[_0x5952('0x12')]['length']?_0x555108['result'][0x0]:null);})[_0x5952('0xb')](function(_0x241515){logger[_0x5952('0x8')](_0x5952('0x21'),_0x241515?util[_0x5952('0x6')](_0x241515,{'showHidden':![],'depth':null}):'');return _0xcb56bb(null);});}return _0xcb56bb(null);});};exports[_0x5952('0x22')]=function(_0x151c39,_0x57e4a3){return moment(_0x151c39)[_0x5952('0x23')](_0x57e4a3,'seconds')[_0x5952('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5952('0x25')]=function(_0x49982a,_0x8611af){return moment(_0x49982a)['subtract'](_0x8611af,_0x5952('0x26'))['format'](_0x5952('0x27'));};exports[_0x5952('0x28')]=function(_0x142877,_0x4be5e0){return moment(_0x142877)[_0x5952('0x29')](moment(_0x4be5e0),_0x5952('0x26'));};exports[_0x5952('0x2a')]=function(_0x46e972,_0x3a8ffc){return parseInt(_0x46e972,0xa)+parseInt(_0x3a8ffc,0xa);};exports[_0x5952('0x2b')]=function(){return moment()[_0x5952('0x24')](_0x5952('0x27'));};exports[_0x5952('0x2c')]=function(_0x481300,_0x341957){if(_0x341957){return moment(_0x481300)['isAfter'](_0x341957);}return!![];};exports['isBefore']=function(_0x4efc50,_0x539e4e){if(_0x539e4e){return moment(_0x4efc50)[_0x5952('0x2d')](_0x539e4e);}else if(_0x4efc50){return!![];}return![];};
\ No newline at end of file
index b403fd8..e8e0a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5188=['fs-extra','lodash','express-winston','path','util','fileLogger','./safe-template','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','data','timestamp','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','x-forwarded-for','headers','connection','remoteAddress','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','url','setupLoggers'];(function(_0x1c7f5a,_0x2a1354){var _0xbf80cd=function(_0x22e7b4){while(--_0x22e7b4){_0x1c7f5a['push'](_0x1c7f5a['shift']());}};_0xbf80cd(++_0x2a1354);}(_0x5188,0xd2));var _0x8518=function(_0x358929,_0x3a9d4b){_0x358929=_0x358929-0x0;var _0x4d3be7=_0x5188[_0x358929];return _0x4d3be7;};var fs=require(_0x8518('0x0'));var _=require(_0x8518('0x1'));var ewinston=require(_0x8518('0x2'));var path=require(_0x8518('0x3'));var util=require(_0x8518('0x4'));var fileLogger=require('./loggers')[_0x8518('0x5')];var safeTemplate=require(_0x8518('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x8518('0x7')];function ClientSideLogger(){function _0x423584(_0x4dd321){var _0x969dcb=path[_0x8518('0x8')](_0x8518('0x9'),_0x8518('0xa'),_0x8518('0xb'));var _0x30f428=path['join'](_0x8518('0xc'),_0x4dd321[_0x8518('0xd')]+'-'+_0x4dd321[_0x8518('0xe')]);return fs[_0x8518('0xf')](path[_0x8518('0x8')](_0x969dcb,_0x30f428))[_0x8518('0x10')](function(){var _0x434b1d=fileLogger('client',path[_0x8518('0x8')](_0x969dcb,_0x30f428));return _0x434b1d;})[_0x8518('0x11')](function(_0x5c63e1){throw _0x5c63e1;});}this['log']=function(_0x2909b3,_0x590d73,_0x21f0cf,_0x2b6c94){return _0x423584(_0x2909b3[_0x8518('0x12')])[_0x8518('0x10')](function(_0x5bb81f){var _0x14b5ac=_0x5bb81f[_0x590d73];return _0x14b5ac;})[_0x8518('0x10')](function(_0x55b643){var _0x1a54e0=_0x2909b3[_0x8518('0x12')]?_0x2909b3[_0x8518('0x12')]['id']:'no-user';var _0x4b500a=_0x2b6c94[_0x8518('0x13')];var _0xf828b5=_0x2b6c94[_0x8518('0x14')];var _0x5c7353=new Date(Number(_0xf828b5));return _0x55b643(_0x1a54e0,_0x5c7353,_0x21f0cf,_0x4b500a);})[_0x8518('0x11')](function(_0x510131){fileLogger(_0x8518('0xc'))['error'](_0x510131);});};}function setupLoggers(_0x4bf6a6){return new Promise(function(_0x1910fb){var _0xf0a9d5=new ClientSideLogger();var _0xebcb7b=fileLogger('api');var _0x555e18=fileLogger('auth');_0x4bf6a6['set']('client-side-logger',_0xf0a9d5);_0x4bf6a6[_0x8518('0x15')](ewinston[_0x8518('0x16')]({'winstonInstance':_0xebcb7b,'meta':![],'statusLevels':!![],'msg':function(_0x236fb4,_0x4e9ef2){var _0x1fa67e=_0x8518('0x17');if(!_[_0x8518('0x18')](_0x236fb4['body'])){_0x1fa67e+=_0x8518('0x19');var _0x44f705=_0x236fb4[_0x8518('0x1a')];maskSensitiveData(_0x44f705);}return safeTemplate(util[_0x8518('0x1b')](_0x1fa67e,_0x236fb4['method'],_0x236fb4['headers'][_0x8518('0x1c')]?_0x236fb4[_0x8518('0x1d')][_0x8518('0x1c')]:_0x236fb4[_0x8518('0x1e')][_0x8518('0x1f')]||_0x236fb4['ip'],_0x236fb4['url'],_0x4e9ef2['statusCode'],_0x4e9ef2[_0x8518('0x20')],_0x236fb4['user']?_0x236fb4[_0x8518('0x12')]['id']:null,_0x236fb4[_0x8518('0x12')]?_0x236fb4[_0x8518('0x12')][_0x8518('0xe')]:null,_0x236fb4[_0x8518('0x12')]?_0x236fb4[_0x8518('0x12')][_0x8518('0xd')]:null,_0x44f705?util[_0x8518('0x21')](_0x44f705,![],null):''));}}));_0x4bf6a6[_0x8518('0x15')](ewinston[_0x8518('0x16')]({'winstonInstance':_0x555e18,'meta':![],'statusLevels':!![],'msg':function(_0x12909e,_0x12b5d4){var _0x333a68=_0x8518('0x22');if(_0x12909e['body']&&_0x12909e[_0x8518('0x1a')][_0x8518('0x23')]&&_0x12909e[_0x8518('0x1a')][_0x8518('0x24')]){_0x333a68=_0x8518('0x25');}return util[_0x8518('0x1b')](_0x333a68,_0x12909e['method'],_0x12909e[_0x8518('0x1d')][_0x8518('0x1c')]?_0x12909e[_0x8518('0x1d')][_0x8518('0x1c')]:_0x12909e['connection'][_0x8518('0x1f')]||_0x12909e['ip'],_0x12909e['url'],_0x12b5d4['statusCode'],_0x12b5d4[_0x8518('0x20')],_0x12909e[_0x8518('0x12')]?_0x12909e['user']['id']:null,_0x12909e['user']?_0x12909e[_0x8518('0x12')][_0x8518('0xe')]:null,_0x12909e['user']?_0x12909e['user'][_0x8518('0xd')]:null,_0x12909e[_0x8518('0x1a')]&&_0x12909e[_0x8518('0x1a')][_0x8518('0x23')]?_0x12909e[_0x8518('0x1a')]['device']:'other',_0x12909e[_0x8518('0x1a')]&&_0x12909e[_0x8518('0x1a')][_0x8518('0x24')]?_0x12909e['body'][_0x8518('0x24')]:'',_0x12909e[_0x8518('0x1a')]&&_0x12909e['body'][_0x8518('0x26')]?_0x12909e[_0x8518('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x219765){var _0x3e03cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3e03cc[_0x8518('0x27')](_0x219765[_0x8518('0x28')]);}}));return _0x1910fb();});}exports[_0x8518('0x29')]=setupLoggers;
\ No newline at end of file
+var _0x069f=['xcally','join','client','role','name','ensureDir','catch','then','user','no-user','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','body','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','statusCode','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','url','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','safeTemplate','maskSensitiveData','/var','log'];(function(_0x58e3d8,_0x4ecbe4){var _0x5af890=function(_0x2fa003){while(--_0x2fa003){_0x58e3d8['push'](_0x58e3d8['shift']());}};_0x5af890(++_0x4ecbe4);}(_0x069f,0x121));var _0xf069=function(_0x2f7023,_0x1aa399){_0x2f7023=_0x2f7023-0x0;var _0x2f5e4e=_0x069f[_0x2f7023];return _0x2f5e4e;};var fs=require(_0xf069('0x0'));var _=require(_0xf069('0x1'));var ewinston=require(_0xf069('0x2'));var path=require(_0xf069('0x3'));var util=require(_0xf069('0x4'));var fileLogger=require(_0xf069('0x5'))['fileLogger'];var safeTemplate=require(_0xf069('0x6'))[_0xf069('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0xf069('0x8')];function ClientSideLogger(){function _0x5b9918(_0x51995c){var _0x252583=path['join'](_0xf069('0x9'),_0xf069('0xa'),_0xf069('0xb'));var _0x4cd547=path[_0xf069('0xc')](_0xf069('0xd'),_0x51995c[_0xf069('0xe')]+'-'+_0x51995c[_0xf069('0xf')]);return fs[_0xf069('0x10')](path[_0xf069('0xc')](_0x252583,_0x4cd547))['then'](function(){var _0xbabcc=fileLogger(_0xf069('0xd'),path[_0xf069('0xc')](_0x252583,_0x4cd547));return _0xbabcc;})[_0xf069('0x11')](function(_0x2ed8f4){throw _0x2ed8f4;});}this[_0xf069('0xa')]=function(_0x18dc36,_0x27986a,_0x20ebb0,_0x360eb6){return _0x5b9918(_0x18dc36['user'])[_0xf069('0x12')](function(_0x51277d){var _0x2597fd=_0x51277d[_0x27986a];return _0x2597fd;})[_0xf069('0x12')](function(_0x4e87cb){var _0x37c3da=_0x18dc36[_0xf069('0x13')]?_0x18dc36[_0xf069('0x13')]['id']:_0xf069('0x14');var _0x5dee9f=_0x360eb6[_0xf069('0x15')];var _0xd99c77=_0x360eb6[_0xf069('0x16')];var _0x213521=new Date(Number(_0xd99c77));return _0x4e87cb(_0x37c3da,_0x213521,_0x20ebb0,_0x5dee9f);})[_0xf069('0x11')](function(_0x18baf7){fileLogger(_0xf069('0xd'))[_0xf069('0x17')](_0x18baf7);});};}function setupLoggers(_0xd2cb2f){return new Promise(function(_0x206393){var _0x28e973=new ClientSideLogger();var _0x38ac47=fileLogger(_0xf069('0x18'));var _0x2eb989=fileLogger(_0xf069('0x19'));_0xd2cb2f[_0xf069('0x1a')](_0xf069('0x1b'),_0x28e973);_0xd2cb2f[_0xf069('0x1c')](ewinston[_0xf069('0x1d')]({'winstonInstance':_0x38ac47,'meta':![],'statusLevels':!![],'msg':function(_0x44a42c,_0x5ac86b){var _0x9f1fb8=_0xf069('0x1e');if(!_['isEmpty'](_0x44a42c[_0xf069('0x1f')])){_0x9f1fb8+=_0xf069('0x20');var _0x1c73da=_0x44a42c[_0xf069('0x1f')];maskSensitiveData(_0x1c73da);}return safeTemplate(util['format'](_0x9f1fb8,_0x44a42c['method'],_0x44a42c[_0xf069('0x21')]['x-forwarded-for']?_0x44a42c[_0xf069('0x21')][_0xf069('0x22')]:_0x44a42c[_0xf069('0x23')][_0xf069('0x24')]||_0x44a42c['ip'],_0x44a42c['url'],_0x5ac86b[_0xf069('0x25')],_0x5ac86b['responseTime'],_0x44a42c[_0xf069('0x13')]?_0x44a42c[_0xf069('0x13')]['id']:null,_0x44a42c[_0xf069('0x13')]?_0x44a42c['user'][_0xf069('0xf')]:null,_0x44a42c['user']?_0x44a42c[_0xf069('0x13')]['role']:null,_0x1c73da?util['inspect'](_0x1c73da,![],null):''));}}));_0xd2cb2f['use'](ewinston['logger']({'winstonInstance':_0x2eb989,'meta':![],'statusLevels':!![],'msg':function(_0x54b900,_0x3f8a8d){var _0x1295ef=_0xf069('0x26');if(_0x54b900[_0xf069('0x1f')]&&_0x54b900['body'][_0xf069('0x27')]&&_0x54b900[_0xf069('0x1f')][_0xf069('0x28')]){_0x1295ef=_0xf069('0x29');}return util[_0xf069('0x2a')](_0x1295ef,_0x54b900[_0xf069('0x2b')],_0x54b900[_0xf069('0x21')][_0xf069('0x22')]?_0x54b900[_0xf069('0x21')][_0xf069('0x22')]:_0x54b900['connection']['remoteAddress']||_0x54b900['ip'],_0x54b900[_0xf069('0x2c')],_0x3f8a8d['statusCode'],_0x3f8a8d[_0xf069('0x2d')],_0x54b900[_0xf069('0x13')]?_0x54b900[_0xf069('0x13')]['id']:null,_0x54b900['user']?_0x54b900[_0xf069('0x13')][_0xf069('0xf')]:null,_0x54b900['user']?_0x54b900[_0xf069('0x13')][_0xf069('0xe')]:null,_0x54b900[_0xf069('0x1f')]&&_0x54b900[_0xf069('0x1f')][_0xf069('0x27')]?_0x54b900[_0xf069('0x1f')][_0xf069('0x27')]:_0xf069('0x2e'),_0x54b900[_0xf069('0x1f')]&&_0x54b900[_0xf069('0x1f')][_0xf069('0x28')]?_0x54b900[_0xf069('0x1f')]['agent_id']:'',_0x54b900[_0xf069('0x1f')]&&_0x54b900[_0xf069('0x1f')]['agent_name']?_0x54b900[_0xf069('0x1f')][_0xf069('0x2f')]:'');},'ignoreRoute':function(_0x58a07d){var _0x4809e9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4809e9[_0xf069('0x30')](_0x58a07d['url']);}}));return _0x206393();});}exports[_0xf069('0x31')]=setupLoggers;
\ No newline at end of file
index d6e8c28..5ed2a82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad2f=['startOf','day','endOf','isBetween','timeCompare','format','includes','dowCompare','date','daysInMonth','min','max','domCompare','monthCompare','guess','isMoment','padStart','length','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','concat','circularMonthInterval','clone','minutes','hours','isBefore'];(function(_0x48eb22,_0x3e5e0){var _0x29ad30=function(_0x212545){while(--_0x212545){_0x48eb22['push'](_0x48eb22['shift']());}};_0x29ad30(++_0x3e5e0);}(_0xad2f,0x17a));var _0xfad2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xad2f[_0x397e5f];return _0x5302b8;};var _=require('lodash');var moment=require(_0xfad2('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xfad2('0x1')](function(_0x5ab587){return _0x5ab587[_0xfad2('0x2')];})[_0xfad2('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfad2('0x4');var EINVALID_DATE=_0xfad2('0x5');function throwIfDateNotValid(_0x418beb){if(!_0x418beb[_0xfad2('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x326a45){var _0x2d176e=_0x326a45[_0xfad2('0x7')](':')[_0xfad2('0x1')](function(_0x29f9a6){return parseInt(_0x29f9a6,0xa);});var _0x1a89eb=_0x2d176e[0x0];var _0x18bd2d=_0x2d176e[0x1];if(_0x1a89eb<0x0||_0x1a89eb>0x17||_0x18bd2d<0x0||_0x18bd2d>0x3b){throw new Error(EINVALID_DATE);}return[_0x1a89eb,_0x18bd2d];}function circularDoWInterval(_0x1eb6d7,_0x58c57c){if(_0x1eb6d7===_0x58c57c){return[_0x1eb6d7];}else{var _0x3707d9=moment['locale']();moment[_0xfad2('0x8')]('en');var _0x30b02e=moment[_0xfad2('0x9')]()[_0xfad2('0x1')](function(_0x2e8881){return _0x2e8881[_0xfad2('0xa')]();});moment['locale'](_0x3707d9);var _0x566852=_0x30b02e[_0xfad2('0xb')](_0x1eb6d7);var _0x1a9143=_0x30b02e[_0xfad2('0xb')](_0x58c57c);if(_0x1a9143>_0x566852){return _0x30b02e['slice'](_0x566852,_0x1a9143+0x1);}else{var _0x107dc7=_0x30b02e[_0xfad2('0xc')](0x0,_0x1a9143+0x1);var _0x188e27=_0x30b02e[_0xfad2('0xc')](_0x566852);return _0x188e27['concat'](_0x107dc7);}}}module[_0xfad2('0xd')][_0xfad2('0xe')]=circularDoWInterval;function circularMonthInterval(_0x5520f5,_0x23a857){if(_0x5520f5===_0x23a857){return[_0x5520f5];}else{var _0x386f3b=moment[_0xfad2('0x8')]();moment[_0xfad2('0x8')]('en');var _0x5bd97e=moment[_0xfad2('0xf')]()[_0xfad2('0x1')](function(_0x48e43b){return _0x48e43b[_0xfad2('0xa')]();});moment[_0xfad2('0x8')](_0x386f3b);var _0x543754=_0x5bd97e['indexOf'](_0x5520f5);var _0x277553=_0x5bd97e[_0xfad2('0xb')](_0x23a857);if(_0x277553>_0x543754){return _0x5bd97e['slice'](_0x543754,_0x277553+0x1);}else{var _0x37a3f0=_0x5bd97e[_0xfad2('0xc')](0x0,_0x277553+0x1);var _0x713f19=_0x5bd97e['slice'](_0x543754);return _0x713f19[_0xfad2('0x10')](_0x37a3f0);}}}module[_0xfad2('0xd')][_0xfad2('0x11')]=circularMonthInterval;function parseDom(_0x584b7d){var _0x3c5078=parseInt(_0x584b7d,0xa);if(_0x3c5078<0x1||_0x3c5078>0x1f){throw new Error(EINVALID_DATE);}return _0x3c5078;}function timeCompare(_0x369060,_0x536766,_0x1474ab){var _0x56c257=_0x369060['clone']();var _0x1072e4=extractTime(_0x536766);var _0x307212=_0x1072e4[0x0];var _0x112249=_0x1072e4[0x1];var _0x4d8ddb=_0x369060[_0xfad2('0x12')]()['hours'](_0x307212)[_0xfad2('0x13')](_0x112249);throwIfDateNotValid(_0x4d8ddb);var _0x7410c0=extractTime(_0x1474ab);var _0x454582=_0x7410c0[0x0];var _0x217fc6=_0x7410c0[0x1];var _0x1133b9=_0x369060[_0xfad2('0x12')]()[_0xfad2('0x14')](_0x454582)[_0xfad2('0x13')](_0x217fc6);throwIfDateNotValid(_0x1133b9);if(_0x1133b9[_0xfad2('0x15')](_0x4d8ddb)){var _0x58c382=_0x56c257['clone']()[_0xfad2('0x16')](_0xfad2('0x17'));var _0x2115c4=_0x56c257[_0xfad2('0x12')]()[_0xfad2('0x18')](_0xfad2('0x17'));return _0x56c257[_0xfad2('0x19')](_0x4d8ddb,_0x2115c4,undefined,'[]')||_0x56c257[_0xfad2('0x19')](_0x58c382,_0x1133b9,undefined,'[]');}else{return _0x56c257['isBetween'](_0x4d8ddb,_0x1133b9,undefined,'[]');}}module[_0xfad2('0xd')][_0xfad2('0x1a')]=timeCompare;function dowCompare(_0x1acb18,_0x3c8977,_0x212611){var _0x3e89f6=_0x1acb18['locale']('en')[_0xfad2('0x1b')]('ddd')[_0xfad2('0xa')]();return circularDoWInterval(_0x3c8977,_0x212611)[_0xfad2('0x1c')](_0x3e89f6);}module[_0xfad2('0xd')][_0xfad2('0x1d')]=dowCompare;function domCompare(_0x2e848f,_0x21d9e4,_0x5c16f4){var _0x431b77=_0x2e848f[_0xfad2('0x1e')]();if(_0x21d9e4===_0x5c16f4){return _0x431b77===_0x21d9e4;}else{var _0x48d410=_0x2e848f[_0xfad2('0x1f')]();var _0x89dade=_0x21d9e4<_0x5c16f4;let _0x2648d0=![];var _0x58a925=0x0;var _0x1709e8=0x0;if(_0x89dade){_0x58a925=Math['max'](0x1,_0x21d9e4);_0x1709e8=Math['min'](_0x5c16f4,_0x48d410);_0x2648d0=_0x431b77>=_0x58a925&&_0x431b77<=_0x1709e8;}else{_0x58a925=Math[_0xfad2('0x20')](_0x21d9e4,_0x48d410);_0x1709e8=Math[_0xfad2('0x21')](0x1,_0x5c16f4);_0x2648d0=_0x431b77>=_0x58a925||_0x431b77<=_0x1709e8;}return _0x2648d0;}}module[_0xfad2('0xd')][_0xfad2('0x22')]=domCompare;function monthCompare(_0x2fba88,_0x635904,_0x4cad46){var _0x408878=_0x2fba88[_0xfad2('0x8')]('en')[_0xfad2('0x1b')]('MMM')[_0xfad2('0xa')]();return circularMonthInterval(_0x635904,_0x4cad46)[_0xfad2('0x1c')](_0x408878);}module[_0xfad2('0xd')][_0xfad2('0x23')]=monthCompare;function iftime(_0x5a976c,_0x39ed3e=moment['tz'][_0xfad2('0x24')](),_0xbfb39b=moment()){if(!validateRx['test'](_0x5a976c)){throw new Error(EINVALID_STRING);}else{var _0x30e027=(moment[_0xfad2('0x25')](_0xbfb39b)?_0xbfb39b[_0xfad2('0x12')]():moment(_0xbfb39b))['tz'](_0x39ed3e)[_0xfad2('0x8')]('en');throwIfDateNotValid(_0x30e027);var _0x4548a4=_0x5a976c['split'](',');var _0x1b942e=_0x4548a4[0x0];var _0x1a8ca9=_0x4548a4[0x1];var _0x549c7d=_0x4548a4[0x2];var _0x5c17fd=_0x4548a4[0x3];let _0x4f17f6=!![];if(_0x1b942e!=='*'){var _0x1e6769=_0x1b942e['split']('-');var _0x37a878=_[_0xfad2('0x26')](_0x1e6769[0x0],0x5,'0');var _0x3882b6=_0x1e6769[_0xfad2('0x27')]===0x2?_[_0xfad2('0x26')](_0x1e6769[0x1],0x5,'0'):_0x37a878;_0x4f17f6=timeCompare(_0x30e027,_0x37a878,_0x3882b6);}let _0x1efd9e=!![];if(_0x1a8ca9!=='*'){var _0x48b6b8=_0x1a8ca9[_0xfad2('0x7')]('-');var _0x1ce503=_0x48b6b8[0x0];var _0x44fa9a=_0x48b6b8[_0xfad2('0x27')]===0x2?_0x48b6b8[0x1]:_0x1ce503;_0x1efd9e=dowCompare(_0x30e027,_0x1ce503,_0x44fa9a);}let _0x4ffc32=!![];if(_0x549c7d!=='*'){var _0x27232f=_0x549c7d[_0xfad2('0x7')]('-');var _0x2af076=parseDom(_0x27232f[0x0]);var _0x1a8476=_0x27232f[_0xfad2('0x27')]===0x2?parseDom(_0x27232f[0x1]):_0x2af076;_0x4ffc32=domCompare(_0x30e027,_0x2af076,_0x1a8476);}let _0xb61667=!![];if(_0x5c17fd!=='*'){var _0xe9fd12=_0x5c17fd[_0xfad2('0x7')]('-');var _0x4baa83=_0xe9fd12[0x0];var _0x152895=_0xe9fd12[_0xfad2('0x27')]===0x2?_0xe9fd12[0x1]:_0xe9fd12[0x0];_0xb61667=monthCompare(_0x30e027,_0x4baa83,_0x152895);}return _0x4f17f6&&_0x1efd9e&&_0x4ffc32&&_0xb61667;}}module['exports']['iftime']=iftime;
\ No newline at end of file
+var _0xd80e=['monthCompare','guess','split','padStart','length','iftime','moment-timezone','map','source','isValid','weekdaysShort','toLowerCase','locale','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','timeCompare','ddd','includes','dowCompare','daysInMonth','max','min','format','MMM'];(function(_0x4e2ad4,_0x429adb){var _0x17835e=function(_0xfcd8d2){while(--_0xfcd8d2){_0x4e2ad4['push'](_0x4e2ad4['shift']());}};_0x17835e(++_0x429adb);}(_0xd80e,0x1f0));var _0xed80=function(_0x5a9abd,_0xec19c2){_0x5a9abd=_0x5a9abd-0x0;var _0x2e483b=_0xd80e[_0x5a9abd];return _0x2e483b;};var _=require('lodash');var moment=require(_0xed80('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xed80('0x1')](function(_0x332037){return _0x332037[_0xed80('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x13a32b){if(!_0x13a32b[_0xed80('0x3')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5f5143){var _0x20d696=_0x5f5143['split'](':')[_0xed80('0x1')](function(_0x4b395c){return parseInt(_0x4b395c,0xa);});var _0x3dd14b=_0x20d696[0x0];var _0x13ba9d=_0x20d696[0x1];if(_0x3dd14b<0x0||_0x3dd14b>0x17||_0x13ba9d<0x0||_0x13ba9d>0x3b){throw new Error(EINVALID_DATE);}return[_0x3dd14b,_0x13ba9d];}function circularDoWInterval(_0x173c8f,_0x49524f){if(_0x173c8f===_0x49524f){return[_0x173c8f];}else{var _0x1239c0=moment['locale']();moment['locale']('en');var _0x4da67c=moment[_0xed80('0x4')]()[_0xed80('0x1')](function(_0x5e33cc){return _0x5e33cc[_0xed80('0x5')]();});moment[_0xed80('0x6')](_0x1239c0);var _0x34aa7e=_0x4da67c['indexOf'](_0x173c8f);var _0x3fb94f=_0x4da67c[_0xed80('0x7')](_0x49524f);if(_0x3fb94f>_0x34aa7e){return _0x4da67c[_0xed80('0x8')](_0x34aa7e,_0x3fb94f+0x1);}else{var _0x30c178=_0x4da67c[_0xed80('0x8')](0x0,_0x3fb94f+0x1);var _0x11c6f0=_0x4da67c[_0xed80('0x8')](_0x34aa7e);return _0x11c6f0[_0xed80('0x9')](_0x30c178);}}}module[_0xed80('0xa')][_0xed80('0xb')]=circularDoWInterval;function circularMonthInterval(_0x9e2ad6,_0x41ffa9){if(_0x9e2ad6===_0x41ffa9){return[_0x9e2ad6];}else{var _0x363386=moment['locale']();moment[_0xed80('0x6')]('en');var _0xf5fcea=moment['monthsShort']()[_0xed80('0x1')](function(_0x43f134){return _0x43f134[_0xed80('0x5')]();});moment[_0xed80('0x6')](_0x363386);var _0x1107b5=_0xf5fcea[_0xed80('0x7')](_0x9e2ad6);var _0x3f1320=_0xf5fcea['indexOf'](_0x41ffa9);if(_0x3f1320>_0x1107b5){return _0xf5fcea[_0xed80('0x8')](_0x1107b5,_0x3f1320+0x1);}else{var _0x3f3465=_0xf5fcea['slice'](0x0,_0x3f1320+0x1);var _0x207062=_0xf5fcea[_0xed80('0x8')](_0x1107b5);return _0x207062['concat'](_0x3f3465);}}}module['exports'][_0xed80('0xc')]=circularMonthInterval;function parseDom(_0x1feec1){var _0x2a84ac=parseInt(_0x1feec1,0xa);if(_0x2a84ac<0x1||_0x2a84ac>0x1f){throw new Error(EINVALID_DATE);}return _0x2a84ac;}function timeCompare(_0x24298a,_0x36562c,_0x78fc52){var _0xce2f9=_0x24298a[_0xed80('0xd')]();var _0x9ff5a=extractTime(_0x36562c);var _0x4c2443=_0x9ff5a[0x0];var _0x4a7f65=_0x9ff5a[0x1];var _0x670db0=_0x24298a[_0xed80('0xd')]()[_0xed80('0xe')](_0x4c2443)['minutes'](_0x4a7f65);throwIfDateNotValid(_0x670db0);var _0x276789=extractTime(_0x78fc52);var _0x40b2a0=_0x276789[0x0];var _0x57d924=_0x276789[0x1];var _0x5a3d62=_0x24298a['clone']()[_0xed80('0xe')](_0x40b2a0)[_0xed80('0xf')](_0x57d924);throwIfDateNotValid(_0x5a3d62);if(_0x5a3d62[_0xed80('0x10')](_0x670db0)){var _0x4c9a12=_0xce2f9[_0xed80('0xd')]()[_0xed80('0x11')](_0xed80('0x12'));var _0x4a578f=_0xce2f9[_0xed80('0xd')]()[_0xed80('0x13')]('day');return _0xce2f9['isBetween'](_0x670db0,_0x4a578f,undefined,'[]')||_0xce2f9['isBetween'](_0x4c9a12,_0x5a3d62,undefined,'[]');}else{return _0xce2f9['isBetween'](_0x670db0,_0x5a3d62,undefined,'[]');}}module[_0xed80('0xa')][_0xed80('0x14')]=timeCompare;function dowCompare(_0x58eba4,_0x11f77d,_0x2cf063){var _0x387f3b=_0x58eba4[_0xed80('0x6')]('en')['format'](_0xed80('0x15'))[_0xed80('0x5')]();return circularDoWInterval(_0x11f77d,_0x2cf063)[_0xed80('0x16')](_0x387f3b);}module[_0xed80('0xa')][_0xed80('0x17')]=dowCompare;function domCompare(_0x18922a,_0x320649,_0x5d7f3f){var _0x185efa=_0x18922a['date']();if(_0x320649===_0x5d7f3f){return _0x185efa===_0x320649;}else{var _0x32d161=_0x18922a[_0xed80('0x18')]();var _0x12ceed=_0x320649<_0x5d7f3f;let _0x49ae11=![];var _0x5a2719=0x0;var _0x27a09d=0x0;if(_0x12ceed){_0x5a2719=Math[_0xed80('0x19')](0x1,_0x320649);_0x27a09d=Math[_0xed80('0x1a')](_0x5d7f3f,_0x32d161);_0x49ae11=_0x185efa>=_0x5a2719&&_0x185efa<=_0x27a09d;}else{_0x5a2719=Math[_0xed80('0x1a')](_0x320649,_0x32d161);_0x27a09d=Math[_0xed80('0x19')](0x1,_0x5d7f3f);_0x49ae11=_0x185efa>=_0x5a2719||_0x185efa<=_0x27a09d;}return _0x49ae11;}}module[_0xed80('0xa')]['domCompare']=domCompare;function monthCompare(_0x2a34a7,_0x321cb2,_0x264b5a){var _0x58822d=_0x2a34a7[_0xed80('0x6')]('en')[_0xed80('0x1b')](_0xed80('0x1c'))[_0xed80('0x5')]();return circularMonthInterval(_0x321cb2,_0x264b5a)[_0xed80('0x16')](_0x58822d);}module[_0xed80('0xa')][_0xed80('0x1d')]=monthCompare;function iftime(_0xe91b64,_0x346e91=moment['tz'][_0xed80('0x1e')](),_0x486968=moment()){if(!validateRx['test'](_0xe91b64)){throw new Error(EINVALID_STRING);}else{var _0x3d80d2=(moment['isMoment'](_0x486968)?_0x486968[_0xed80('0xd')]():moment(_0x486968))['tz'](_0x346e91)[_0xed80('0x6')]('en');throwIfDateNotValid(_0x3d80d2);var _0x496e55=_0xe91b64[_0xed80('0x1f')](',');var _0x6dc082=_0x496e55[0x0];var _0x675899=_0x496e55[0x1];var _0x5df92e=_0x496e55[0x2];var _0x5e6781=_0x496e55[0x3];let _0x16083a=!![];if(_0x6dc082!=='*'){var _0x337117=_0x6dc082['split']('-');var _0x34e329=_[_0xed80('0x20')](_0x337117[0x0],0x5,'0');var _0x573ac5=_0x337117[_0xed80('0x21')]===0x2?_['padStart'](_0x337117[0x1],0x5,'0'):_0x34e329;_0x16083a=timeCompare(_0x3d80d2,_0x34e329,_0x573ac5);}let _0x2a4a0b=!![];if(_0x675899!=='*'){var _0x37e16b=_0x675899[_0xed80('0x1f')]('-');var _0x26123e=_0x37e16b[0x0];var _0x9d4298=_0x37e16b[_0xed80('0x21')]===0x2?_0x37e16b[0x1]:_0x26123e;_0x2a4a0b=dowCompare(_0x3d80d2,_0x26123e,_0x9d4298);}let _0x54a417=!![];if(_0x5df92e!=='*'){var _0xba8d3a=_0x5df92e[_0xed80('0x1f')]('-');var _0x167e0a=parseDom(_0xba8d3a[0x0]);var _0x1349f2=_0xba8d3a[_0xed80('0x21')]===0x2?parseDom(_0xba8d3a[0x1]):_0x167e0a;_0x54a417=domCompare(_0x3d80d2,_0x167e0a,_0x1349f2);}let _0x17b38d=!![];if(_0x5e6781!=='*'){var _0x11aa18=_0x5e6781[_0xed80('0x1f')]('-');var _0x470ee7=_0x11aa18[0x0];var _0x128fd6=_0x11aa18[_0xed80('0x21')]===0x2?_0x11aa18[0x1]:_0x11aa18[0x0];_0x17b38d=monthCompare(_0x3d80d2,_0x470ee7,_0x128fd6);}return _0x16083a&&_0x2a4a0b&&_0x54a417&&_0x17b38d;}}module['exports'][_0xed80('0x22')]=iftime;
\ No newline at end of file
index 0091205..9056fee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be4=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Console','warn','Logger','transports','%s-%s','error','File','consoleLogger','util','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','format','%s-%s.log','message','replace','{{{','}}}'];(function(_0x44e201,_0x2477f9){var _0xb720a9=function(_0x52c73f){while(--_0x52c73f){_0x44e201['push'](_0x44e201['shift']());}};_0xb720a9(++_0x2477f9);}(_0x0be4,0xef));var _0x40be=function(_0x51c933,_0x2064f4){_0x51c933=_0x51c933-0x0;var _0x188d1e=_0x0be4[_0x51c933];return _0x188d1e;};'use strict';var path=require('path');var util=require(_0x40be('0x0'));var moment=require('moment');var winston=require(_0x40be('0x1'));var config=require(_0x40be('0x2'));var debugLevel=config[_0x40be('0x3')]?config[_0x40be('0x3')][_0x40be('0x4')]():_0x40be('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x40be('0x6'),'warn':_0x40be('0x7'),'info':_0x40be('0x8'),'print':_0x40be('0x9'),'success':_0x40be('0xa'),'http':_0x40be('0xb'),'verbose':'bold\x20magenta','debug':_0x40be('0xc'),'silly':_0x40be('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x101e32,_0x264f23,_0x44190c){var _0x46379d=_0x101e32||'/var/log/xcally';return path['join'](_0x46379d,util[_0x40be('0xe')](_0x40be('0xf'),_0x264f23,_0x44190c));}function formatter(_0x407103,_0x1a2544){_0x1a2544[_0x40be('0x10')]=_0x1a2544[_0x40be('0x10')][_0x40be('0x11')](/@@{/g,_0x40be('0x12'))[_0x40be('0x11')](/}@@/g,_0x40be('0x13'))[_0x40be('0x11')](/@{/g,'{{')[_0x40be('0x11')](/}@/g,'}}');return util[_0x40be('0xe')](_0x40be('0x14'),moment()[_0x40be('0xe')](_0x40be('0x15')),_0x1a2544[_0x40be('0x16')]['toUpperCase'](),_0x407103,_0x1a2544[_0x40be('0x10')]);}function fileFormat(_0x35f302,_0x5569ed){_0x5569ed[_0x40be('0x10')]=_0x5569ed[_0x40be('0x10')]['replace'](/@@{/g,_0x40be('0x12'))[_0x40be('0x11')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x116c6e=_0x5569ed[_0x40be('0x17')]&&Object[_0x40be('0x18')](_0x5569ed['meta'])[_0x40be('0x19')]?'\x0a\x09'+JSON[_0x40be('0x1a')](_0x5569ed[_0x40be('0x17')]):'';return util['format'](_0x40be('0x1b'),moment()[_0x40be('0xe')](_0x40be('0x15')),_0x5569ed['level'][_0x40be('0x1c')](),_0x35f302,_0x5569ed[_0x40be('0x10')],_0x116c6e);}function consoleLogger(){var _0x52e54c=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x40be('0x1d'))]({'level':_0x40be('0x1e'),'json':![],'formatter':function(_0x15831d){return formatter('',_0x15831d);}})]});return _0x52e54c;}function fileLogger(_0x2028ab,_0x18bbf0){var _0x3288e6=new winston[(_0x40be('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x40be('0x20'))]['File']({'name':util[_0x40be('0xe')](_0x40be('0x21'),_0x2028ab,_0x40be('0x22')),'filename':getLogFileName(_0x18bbf0,_0x2028ab,_0x40be('0x22')),'level':_0x40be('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x220764){return fileFormat(_0x2028ab,_0x220764);}}),new winston['transports'][(_0x40be('0x23'))]({'name':util[_0x40be('0xe')](_0x40be('0x21'),_0x2028ab,debugLevel),'filename':getLogFileName(_0x18bbf0,_0x2028ab,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x430477){return fileFormat(_0x2028ab,_0x430477);}}),new winston['transports'][(_0x40be('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x4eedd3){return fileFormat(_0x2028ab,_0x4eedd3);}})]});return _0x3288e6;}exports[_0x40be('0x24')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0x5101=['bold\x20blue','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','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20green','bold\x20magenta'];(function(_0xf65bf8,_0x494a66){var _0x2e4a66=function(_0x50d0de){while(--_0x50d0de){_0xf65bf8['push'](_0xf65bf8['shift']());}};_0x2e4a66(++_0x494a66);}(_0x5101,0x1b2));var _0x1510=function(_0x46b141,_0x20aab8){_0x46b141=_0x46b141-0x0;var _0x4e1694=_0x5101[_0x46b141];return _0x4e1694;};'use strict';var path=require(_0x1510('0x0'));var util=require(_0x1510('0x1'));var moment=require('moment');var winston=require(_0x1510('0x2'));var config=require(_0x1510('0x3'));var debugLevel=config[_0x1510('0x4')]?config[_0x1510('0x4')]['toLowerCase']():_0x1510('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':_0x1510('0x6'),'error':_0x1510('0x7'),'warn':'bold\x20yellow','info':'white','print':'bold\x20white','success':_0x1510('0x8'),'http':'gray','verbose':_0x1510('0x9'),'debug':_0x1510('0xa'),'silly':_0x1510('0xb')};winston[_0x1510('0xc')](XC_LOG_COLORS);function getLogFileName(_0x77cbcf,_0x40e0c2,_0x326c5d){var _0x3f1f0b=_0x77cbcf||_0x1510('0xd');return path[_0x1510('0xe')](_0x3f1f0b,util[_0x1510('0xf')](_0x1510('0x10'),_0x40e0c2,_0x326c5d));}function formatter(_0x244edb,_0x15e959){_0x15e959[_0x1510('0x11')]=_0x15e959['message'][_0x1510('0x12')](/@@{/g,'{{{')['replace'](/}@@/g,_0x1510('0x13'))[_0x1510('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x1510('0xf')](_0x1510('0x14'),moment()[_0x1510('0xf')](_0x1510('0x15')),_0x15e959[_0x1510('0x16')][_0x1510('0x17')](),_0x244edb,_0x15e959[_0x1510('0x11')]);}function fileFormat(_0x20d47f,_0x332798){_0x332798[_0x1510('0x11')]=_0x332798[_0x1510('0x11')][_0x1510('0x12')](/@@{/g,_0x1510('0x18'))[_0x1510('0x12')](/}@@/g,_0x1510('0x13'))[_0x1510('0x12')](/@{/g,'{{')[_0x1510('0x12')](/}@/g,'}}');var _0x117617=_0x332798[_0x1510('0x19')]&&Object['keys'](_0x332798['meta'])['length']?'\x0a\x09'+JSON[_0x1510('0x1a')](_0x332798[_0x1510('0x19')]):'';return util[_0x1510('0xf')](_0x1510('0x1b'),moment()[_0x1510('0xf')](_0x1510('0x15')),_0x332798[_0x1510('0x16')][_0x1510('0x17')](),_0x20d47f,_0x332798['message'],_0x117617);}function consoleLogger(){var _0x445ae5=new winston[(_0x1510('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1510('0x1d'))][(_0x1510('0x1e'))]({'level':_0x1510('0x1f'),'json':![],'formatter':function(_0x43efcd){return formatter('',_0x43efcd);}})]});return _0x445ae5;}function fileLogger(_0x215784,_0x239503){var _0xbce35a=new winston[(_0x1510('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x1510('0x20'))]({'name':util[_0x1510('0xf')](_0x1510('0x21'),_0x215784,'error'),'filename':getLogFileName(_0x239503,_0x215784,'error'),'level':_0x1510('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5893c){return fileFormat(_0x215784,_0x5893c);}}),new winston['transports'][(_0x1510('0x20'))]({'name':util[_0x1510('0xf')](_0x1510('0x21'),_0x215784,debugLevel),'filename':getLogFileName(_0x239503,_0x215784,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x400107){return fileFormat(_0x215784,_0x400107);}}),new winston[(_0x1510('0x1d'))][(_0x1510('0x1e'))]({'level':_0x1510('0x1f'),'json':![],'formatter':function(_0x1dc12f){return fileFormat(_0x215784,_0x1dc12f);}})]});return _0xbce35a;}exports[_0x1510('0x23')]=consoleLogger;exports[_0x1510('0x24')]=fileLogger;
\ No newline at end of file
index a80e13a..22fb08a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x0295,0x1f0));var _0x5029=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0x0295[_0x2fbb45];return _0x526325;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0x1a85,0x178));var _0x51a8=function(_0x50514b,_0x83db65){_0x50514b=_0x50514b-0x0;var _0x5d8587=_0x1a85[_0x50514b];return _0x5d8587;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData;
\ No newline at end of file
index dc570b6..8e3ec9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x80ed,0x11c));var _0xd80e=function(_0x2bf0ae,_0xebdfa0){_0x2bf0ae=_0x2bf0ae-0x0;var _0x4d8a81=_0x80ed[_0x2bf0ae];return _0x4d8a81;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate;
\ No newline at end of file
+var _0xa571=['reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string','map','isPlainObject','keys'];(function(_0x367a17,_0x5daa0b){var _0x313d2d=function(_0x3b8338){while(--_0x3b8338){_0x367a17['push'](_0x367a17['shift']());}};_0x313d2d(++_0x5daa0b);}(_0xa571,0x107));var _0x1a57=function(_0x44594e,_0x1a0374){_0x44594e=_0x44594e-0x0;var _0x10af21=_0xa571[_0x44594e];return _0x10af21;};var _=require(_0x1a57('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x289e99){return _0x289e99==='{{'?_0x1a57('0x1'):_0x1a57('0x2');}function safeTemplate(_0x48485e){var _0x1a071f=_0x48485e;if(typeof _0x48485e===_0x1a57('0x3')){_0x1a071f=_0x48485e['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x48485e)){_0x1a071f=_0x48485e[_0x1a57('0x4')](function(_0x5067fa){return safeTemplate(_0x5067fa);});}else if(_[_0x1a57('0x5')](_0x48485e)){_0x1a071f=Object[_0x1a57('0x6')](_0x48485e)[_0x1a57('0x7')](function(_0x3c5352,_0x2492f5){_0x3c5352[_0x2492f5]=safeTemplate(_0x48485e[_0x2492f5]);return _0x3c5352;},{});}return _0x1a071f;}module[_0x1a57('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file